From eaf22c2eb3d4f14203a5bb7eff8a1688288aa800 Mon Sep 17 00:00:00 2001 From: Aniketh Galla Date: Thu, 13 Aug 2026 23:17:38 +0530 Subject: [PATCH 1/5] feat: added tracks,previousevents,gotquesitons sections --- devjams/app/layout.tsx | 6 +- devjams/app/page.tsx | 153 +- .../got-questions/GotQuestionsGraphic.tsx | 69 + .../got-questions/GotQuestionsHeading.tsx | 23 + .../got-questions/GotQuestionsSubHeading.tsx | 22 + devjams/components/hero/HeroCTA.tsx | 34 + devjams/components/hero/HeroLogo.tsx | 64 + devjams/components/hero/HeroTagline.tsx | 26 + devjams/components/hero/HeroTrackIcons.tsx | 57 + .../previous-events/PreviousEventsData.ts | 27 + .../PreviousEventsDecorations.tsx | 86 + .../previous-events/PreviousEventsHeader.tsx | 17 + devjams/components/sections/GotQuestions.tsx | 50 + devjams/components/sections/Hero.tsx | 26 + .../components/sections/PreviousEvents.tsx | 61 + devjams/components/sections/Tracks.tsx | 19 + devjams/components/tracks/TracksData.tsx | 95 + devjams/components/tracks/TracksHeader.tsx | 17 + devjams/components/ui/EventCard.tsx | 54 + devjams/components/ui/TrackCarousel.tsx | 203 + devjams/public/assets/dino.svg | 4 + node_modules/.package-lock.json | 73 + node_modules/framer-motion/LICENSE.md | 21 + node_modules/framer-motion/README.md | 137 + node_modules/framer-motion/client/README.md | 1 + .../framer-motion/client/package.json | 6 + node_modules/framer-motion/dist/cjs/client.js | 370 + .../framer-motion/dist/cjs/client.js.map | 1 + node_modules/framer-motion/dist/cjs/debug.js | 13 + .../framer-motion/dist/cjs/debug.js.map | 1 + .../framer-motion/dist/cjs/dom-mini.js | 531 + .../framer-motion/dist/cjs/dom-mini.js.map | 1 + node_modules/framer-motion/dist/cjs/dom.js | 1354 ++ .../framer-motion/dist/cjs/dom.js.map | 1 + .../dist/cjs/feature-bundle-BZV7Y7IM.js | 1660 ++ .../dist/cjs/feature-bundle-BZV7Y7IM.js.map | 1 + .../framer-motion/dist/cjs/index-BuO47Yrm.js | 771 + .../dist/cjs/index-BuO47Yrm.js.map | 1 + node_modules/framer-motion/dist/cjs/index.js | 3823 ++++ .../framer-motion/dist/cjs/index.js.map | 1 + node_modules/framer-motion/dist/cjs/m.js | 403 + node_modules/framer-motion/dist/cjs/m.js.map | 1 + node_modules/framer-motion/dist/cjs/mini.js | 153 + .../framer-motion/dist/cjs/mini.js.map | 1 + node_modules/framer-motion/dist/client.d.ts | 367 + node_modules/framer-motion/dist/debug.d.ts | 2 + node_modules/framer-motion/dist/dom-mini.d.ts | 69 + node_modules/framer-motion/dist/dom-mini.js | 1 + node_modules/framer-motion/dist/dom.d.ts | 304 + node_modules/framer-motion/dist/dom.js | 1 + .../dist/es/animation/animate/index.mjs | 58 + .../dist/es/animation/animate/index.mjs.map | 1 + .../es/animation/animate/resolve-subjects.mjs | 23 + .../animate/resolve-subjects.mjs.map | 1 + .../dist/es/animation/animate/sequence.mjs | 36 + .../es/animation/animate/sequence.mjs.map | 1 + .../dist/es/animation/animate/subject.mjs | 54 + .../dist/es/animation/animate/subject.mjs.map | 1 + .../animators/waapi/animate-elements.mjs | 110 + .../animators/waapi/animate-elements.mjs.map | 1 + .../animators/waapi/animate-sequence.mjs | 14 + .../animators/waapi/animate-sequence.mjs.map | 1 + .../animators/waapi/animate-style.mjs | 13 + .../animators/waapi/animate-style.mjs.map | 1 + .../es/animation/hooks/animation-controls.mjs | 80 + .../hooks/animation-controls.mjs.map | 1 + .../es/animation/hooks/use-animate-style.mjs | 19 + .../animation/hooks/use-animate-style.mjs.map | 1 + .../dist/es/animation/hooks/use-animate.mjs | 25 + .../es/animation/hooks/use-animate.mjs.map | 1 + .../es/animation/hooks/use-animated-state.mjs | 64 + .../hooks/use-animated-state.mjs.map | 1 + .../dist/es/animation/hooks/use-animation.mjs | 43 + .../es/animation/hooks/use-animation.mjs.map | 1 + .../es/animation/optimized-appear/handoff.mjs | 39 + .../optimized-appear/handoff.mjs.map | 1 + .../es/animation/optimized-appear/start.mjs | 170 + .../animation/optimized-appear/start.mjs.map | 1 + .../animation/optimized-appear/store-id.mjs | 9 + .../optimized-appear/store-id.mjs.map | 1 + .../es/animation/optimized-appear/store.mjs | 5 + .../animation/optimized-appear/store.mjs.map | 1 + .../dist/es/animation/sequence/create.mjs | 308 + .../dist/es/animation/sequence/create.mjs.map | 1 + .../sequence/utils/calc-repeat-duration.mjs | 6 + .../utils/calc-repeat-duration.mjs.map | 1 + .../es/animation/sequence/utils/calc-time.mjs | 24 + .../sequence/utils/calc-time.mjs.map | 1 + .../dist/es/animation/sequence/utils/edit.mjs | 31 + .../es/animation/sequence/utils/edit.mjs.map | 1 + .../sequence/utils/normalize-times.mjs | 18 + .../sequence/utils/normalize-times.mjs.map | 1 + .../dist/es/animation/sequence/utils/sort.mjs | 15 + .../es/animation/sequence/utils/sort.mjs.map | 1 + .../animation/utils/create-visual-element.mjs | 41 + .../utils/create-visual-element.mjs.map | 1 + .../es/animation/utils/is-dom-keyframes.mjs | 6 + .../animation/utils/is-dom-keyframes.mjs.map | 1 + node_modules/framer-motion/dist/es/client.mjs | 2 + .../framer-motion/dist/es/client.mjs.map | 1 + .../components/AnimatePresence/PopChild.mjs | 118 + .../AnimatePresence/PopChild.mjs.map | 1 + .../AnimatePresence/PresenceChild.mjs | 77 + .../AnimatePresence/PresenceChild.mjs.map | 1 + .../es/components/AnimatePresence/index.mjs | 181 + .../components/AnimatePresence/index.mjs.map | 1 + .../AnimatePresence/use-presence-data.mjs | 11 + .../AnimatePresence/use-presence-data.mjs.map | 1 + .../AnimatePresence/use-presence.mjs | 72 + .../AnimatePresence/use-presence.mjs.map | 1 + .../es/components/AnimatePresence/utils.mjs | 15 + .../components/AnimatePresence/utils.mjs.map | 1 + .../es/components/AnimateSharedLayout.mjs | 17 + .../es/components/AnimateSharedLayout.mjs.map | 1 + .../dist/es/components/LayoutGroup/index.mjs | 33 + .../es/components/LayoutGroup/index.mjs.map | 1 + .../dist/es/components/LazyMotion/index.mjs | 69 + .../es/components/LazyMotion/index.mjs.map | 1 + .../dist/es/components/MotionConfig/index.mjs | 52 + .../es/components/MotionConfig/index.mjs.map | 1 + .../dist/es/components/Reorder/Group.mjs | 88 + .../dist/es/components/Reorder/Group.mjs.map | 1 + .../dist/es/components/Reorder/Item.mjs | 48 + .../dist/es/components/Reorder/Item.mjs.map | 1 + .../dist/es/components/Reorder/namespace.mjs | 3 + .../es/components/Reorder/namespace.mjs.map | 1 + .../components/Reorder/utils/auto-scroll.mjs | 124 + .../Reorder/utils/auto-scroll.mjs.map | 1 + .../Reorder/utils/check-reorder.mjs | 95 + .../Reorder/utils/check-reorder.mjs.map | 1 + .../components/Reorder/utils/detect-axis.mjs | 17 + .../Reorder/utils/detect-axis.mjs.map | 1 + .../context/DeprecatedLayoutGroupContext.mjs | 12 + .../DeprecatedLayoutGroupContext.mjs.map | 1 + .../dist/es/context/LayoutGroupContext.mjs | 7 + .../es/context/LayoutGroupContext.mjs.map | 1 + .../dist/es/context/LazyContext.mjs | 7 + .../dist/es/context/LazyContext.mjs.map | 1 + .../dist/es/context/MotionConfigContext.mjs | 14 + .../es/context/MotionConfigContext.mjs.map | 1 + .../dist/es/context/MotionContext/create.mjs | 15 + .../es/context/MotionContext/create.mjs.map | 1 + .../dist/es/context/MotionContext/index.mjs | 7 + .../es/context/MotionContext/index.mjs.map | 1 + .../dist/es/context/MotionContext/utils.mjs | 17 + .../es/context/MotionContext/utils.mjs.map | 1 + .../dist/es/context/PresenceContext.mjs | 11 + .../dist/es/context/PresenceContext.mjs.map | 1 + .../dist/es/context/ReorderContext.mjs | 7 + .../dist/es/context/ReorderContext.mjs.map | 1 + .../es/context/SwitchLayoutGroupContext.mjs | 10 + .../context/SwitchLayoutGroupContext.mjs.map | 1 + node_modules/framer-motion/dist/es/debug.mjs | 2 + .../framer-motion/dist/es/debug.mjs.map | 1 + .../framer-motion/dist/es/dom-mini.mjs | 3 + .../framer-motion/dist/es/dom-mini.mjs.map | 1 + node_modules/framer-motion/dist/es/dom.mjs | 10 + .../framer-motion/dist/es/dom.mjs.map | 1 + .../dist/es/events/add-pointer-event.mjs | 9 + .../dist/es/events/add-pointer-event.mjs.map | 1 + .../dist/es/events/event-info.mjs | 14 + .../dist/es/events/event-info.mjs.map | 1 + .../dist/es/events/use-dom-event.mjs | 36 + .../dist/es/events/use-dom-event.mjs.map | 1 + .../drag/VisualElementDragControls.mjs | 573 + .../drag/VisualElementDragControls.mjs.map | 1 + .../dist/es/gestures/drag/index.mjs | 51 + .../dist/es/gestures/drag/index.mjs.map | 1 + .../es/gestures/drag/use-drag-controls.mjs | 117 + .../gestures/drag/use-drag-controls.mjs.map | 1 + .../es/gestures/drag/utils/constraints.mjs | 128 + .../gestures/drag/utils/constraints.mjs.map | 1 + .../framer-motion/dist/es/gestures/focus.mjs | 41 + .../dist/es/gestures/focus.mjs.map | 1 + .../framer-motion/dist/es/gestures/hover.mjs | 29 + .../dist/es/gestures/hover.mjs.map | 1 + .../dist/es/gestures/pan/PanSession.mjs | 283 + .../dist/es/gestures/pan/PanSession.mjs.map | 1 + .../dist/es/gestures/pan/index.mjs | 50 + .../dist/es/gestures/pan/index.mjs.map | 1 + .../framer-motion/dist/es/gestures/press.mjs | 36 + .../dist/es/gestures/press.mjs.map | 1 + node_modules/framer-motion/dist/es/index.mjs | 79 + .../framer-motion/dist/es/index.mjs.map | 1 + node_modules/framer-motion/dist/es/m.mjs | 3 + node_modules/framer-motion/dist/es/m.mjs.map | 1 + node_modules/framer-motion/dist/es/mini.mjs | 2 + .../framer-motion/dist/es/mini.mjs.map | 1 + .../es/motion/features/animation/exit.mjs | 70 + .../es/motion/features/animation/exit.mjs.map | 1 + .../es/motion/features/animation/index.mjs | 39 + .../motion/features/animation/index.mjs.map | 1 + .../dist/es/motion/features/animations.mjs | 14 + .../es/motion/features/animations.mjs.map | 1 + .../dist/es/motion/features/definitions.mjs | 49 + .../es/motion/features/definitions.mjs.map | 1 + .../dist/es/motion/features/drag.mjs | 18 + .../dist/es/motion/features/drag.mjs.map | 1 + .../dist/es/motion/features/gestures.mjs | 22 + .../dist/es/motion/features/gestures.mjs.map | 1 + .../dist/es/motion/features/layout.mjs | 12 + .../dist/es/motion/features/layout.mjs.map | 1 + .../motion/features/layout/MeasureLayout.mjs | 136 + .../features/layout/MeasureLayout.mjs.map | 1 + .../dist/es/motion/features/load-features.mjs | 16 + .../es/motion/features/load-features.mjs.map | 1 + .../es/motion/features/viewport/index.mjs | 77 + .../es/motion/features/viewport/index.mjs.map | 1 + .../es/motion/features/viewport/observers.mjs | 50 + .../features/viewport/observers.mjs.map | 1 + .../framer-motion/dist/es/motion/index.mjs | 113 + .../dist/es/motion/index.mjs.map | 1 + .../es/motion/utils/is-motion-component.mjs | 13 + .../motion/utils/is-motion-component.mjs.map | 1 + .../dist/es/motion/utils/symbol.mjs | 4 + .../dist/es/motion/utils/symbol.mjs.map | 1 + .../motion/utils/unwrap-motion-component.mjs | 18 + .../utils/unwrap-motion-component.mjs.map | 1 + .../dist/es/motion/utils/use-motion-ref.mjs | 52 + .../es/motion/utils/use-motion-ref.mjs.map | 1 + .../es/motion/utils/use-visual-element.mjs | 166 + .../motion/utils/use-visual-element.mjs.map | 1 + .../dist/es/motion/utils/use-visual-state.mjs | 78 + .../es/motion/utils/use-visual-state.mjs.map | 1 + .../dist/es/motion/utils/valid-prop.mjs | 59 + .../dist/es/motion/utils/valid-prop.mjs.map | 1 + .../framer-motion/dist/es/projection.mjs | 2 + .../framer-motion/dist/es/projection.mjs.map | 1 + .../use-instant-layout-transition.mjs | 15 + .../use-instant-layout-transition.mjs.map | 1 + .../es/projection/use-reset-projection.mjs | 15 + .../projection/use-reset-projection.mjs.map | 1 + .../es/render/components/create-proxy.mjs | 46 + .../es/render/components/create-proxy.mjs.map | 1 + .../dist/es/render/components/m/create.mjs | 8 + .../es/render/components/m/create.mjs.map | 1 + .../dist/es/render/components/m/elements.mjs | 228 + .../es/render/components/m/elements.mjs.map | 1 + .../dist/es/render/components/m/proxy.mjs | 6 + .../dist/es/render/components/m/proxy.mjs.map | 1 + .../es/render/components/motion/create.mjs | 10 + .../render/components/motion/create.mjs.map | 1 + .../es/render/components/motion/elements.mjs | 195 + .../render/components/motion/elements.mjs.map | 1 + .../components/motion/feature-bundle.mjs | 14 + .../components/motion/feature-bundle.mjs.map | 1 + .../es/render/components/motion/proxy.mjs | 8 + .../es/render/components/motion/proxy.mjs.map | 1 + .../es/render/dom/create-visual-element.mjs | 18 + .../render/dom/create-visual-element.mjs.map | 1 + .../dist/es/render/dom/features-animation.mjs | 16 + .../es/render/dom/features-animation.mjs.map | 1 + .../dist/es/render/dom/features-max.mjs | 16 + .../dist/es/render/dom/features-max.mjs.map | 1 + .../dist/es/render/dom/features-min.mjs | 14 + .../dist/es/render/dom/features-min.mjs.map | 1 + .../es/render/dom/scroll/attach-animation.mjs | 38 + .../dom/scroll/attach-animation.mjs.map | 1 + .../es/render/dom/scroll/attach-function.mjs | 25 + .../render/dom/scroll/attach-function.mjs.map | 1 + .../dist/es/render/dom/scroll/index.mjs | 15 + .../dist/es/render/dom/scroll/index.mjs.map | 1 + .../dist/es/render/dom/scroll/info.mjs | 56 + .../dist/es/render/dom/scroll/info.mjs.map | 1 + .../es/render/dom/scroll/offsets/edge.mjs | 46 + .../es/render/dom/scroll/offsets/edge.mjs.map | 1 + .../es/render/dom/scroll/offsets/index.mjs | 60 + .../render/dom/scroll/offsets/index.mjs.map | 1 + .../es/render/dom/scroll/offsets/inset.mjs | 48 + .../render/dom/scroll/offsets/inset.mjs.map | 1 + .../es/render/dom/scroll/offsets/offset.mjs | 36 + .../render/dom/scroll/offsets/offset.mjs.map | 1 + .../es/render/dom/scroll/offsets/presets.mjs | 21 + .../render/dom/scroll/offsets/presets.mjs.map | 1 + .../render/dom/scroll/on-scroll-handler.mjs | 55 + .../dom/scroll/on-scroll-handler.mjs.map | 1 + .../dist/es/render/dom/scroll/track.mjs | 115 + .../dist/es/render/dom/scroll/track.mjs.map | 1 + .../scroll/utils/can-use-native-timeline.mjs | 10 + .../utils/can-use-native-timeline.mjs.map | 1 + .../render/dom/scroll/utils/get-timeline.mjs | 62 + .../dom/scroll/utils/get-timeline.mjs.map | 1 + .../dom/scroll/utils/is-element-tracking.mjs | 10 + .../scroll/utils/is-element-tracking.mjs.map | 1 + .../dom/scroll/utils/offset-to-range.mjs | 73 + .../dom/scroll/utils/offset-to-range.mjs.map | 1 + .../dist/es/render/dom/use-render.mjs | 28 + .../dist/es/render/dom/use-render.mjs.map | 1 + .../dist/es/render/dom/utils/filter-props.mjs | 37 + .../es/render/dom/utils/filter-props.mjs.map | 1 + .../es/render/dom/utils/is-svg-component.mjs | 31 + .../render/dom/utils/is-svg-component.mjs.map | 1 + .../dist/es/render/dom/viewport/index.mjs | 44 + .../dist/es/render/dom/viewport/index.mjs.map | 1 + .../es/render/html/use-html-visual-state.mjs | 12 + .../render/html/use-html-visual-state.mjs.map | 1 + .../dist/es/render/html/use-props.mjs | 57 + .../dist/es/render/html/use-props.mjs.map | 1 + .../render/html/utils/create-render-state.mjs | 9 + .../html/utils/create-render-state.mjs.map | 1 + .../dist/es/render/svg/lowercase-elements.mjs | 34 + .../es/render/svg/lowercase-elements.mjs.map | 1 + .../dist/es/render/svg/use-props.mjs | 25 + .../dist/es/render/svg/use-props.mjs.map | 1 + .../es/render/svg/use-svg-visual-state.mjs | 12 + .../render/svg/use-svg-visual-state.mjs.map | 1 + .../render/svg/utils/create-render-state.mjs | 9 + .../svg/utils/create-render-state.mjs.map | 1 + .../framer-motion/dist/es/utils/distance.mjs | 10 + .../dist/es/utils/distance.mjs.map | 1 + .../dist/es/utils/get-context-window.mjs | 7 + .../dist/es/utils/get-context-window.mjs.map | 1 + .../dist/es/utils/is-browser.mjs | 4 + .../dist/es/utils/is-browser.mjs.map | 1 + .../dist/es/utils/is-ref-object.mjs | 8 + .../dist/es/utils/is-ref-object.mjs.map | 1 + .../use-reduced-motion-config.mjs | 21 + .../use-reduced-motion-config.mjs.map | 1 + .../reduced-motion/use-reduced-motion.mjs | 48 + .../reduced-motion/use-reduced-motion.mjs.map | 1 + .../es/utils/transform-rotated-parent.mjs | 72 + .../es/utils/transform-rotated-parent.mjs.map | 1 + .../dist/es/utils/transform-viewbox-point.mjs | 63 + .../es/utils/transform-viewbox-point.mjs.map | 1 + .../dist/es/utils/use-animation-frame.mjs | 23 + .../dist/es/utils/use-animation-frame.mjs.map | 1 + .../dist/es/utils/use-composed-ref.mjs | 61 + .../dist/es/utils/use-composed-ref.mjs.map | 1 + .../dist/es/utils/use-constant.mjs | 20 + .../dist/es/utils/use-constant.mjs.map | 1 + .../framer-motion/dist/es/utils/use-cycle.mjs | 49 + .../dist/es/utils/use-cycle.mjs.map | 1 + .../dist/es/utils/use-force-update.mjs | 21 + .../dist/es/utils/use-force-update.mjs.map | 1 + .../dist/es/utils/use-in-view.mjs | 25 + .../dist/es/utils/use-in-view.mjs.map | 1 + .../dist/es/utils/use-instant-transition.mjs | 43 + .../es/utils/use-instant-transition.mjs.map | 1 + .../dist/es/utils/use-is-mounted.mjs | 17 + .../dist/es/utils/use-is-mounted.mjs.map | 1 + .../dist/es/utils/use-isomorphic-effect.mjs | 8 + .../es/utils/use-isomorphic-effect.mjs.map | 1 + .../dist/es/utils/use-motion-value-event.mjs | 15 + .../es/utils/use-motion-value-event.mjs.map | 1 + .../dist/es/utils/use-page-in-view.mjs | 20 + .../dist/es/utils/use-page-in-view.mjs.map | 1 + .../dist/es/utils/use-unmount-effect.mjs | 9 + .../dist/es/utils/use-unmount-effect.mjs.map | 1 + .../es/value/scroll/use-element-scroll.mjs | 15 + .../value/scroll/use-element-scroll.mjs.map | 1 + .../es/value/scroll/use-viewport-scroll.mjs | 15 + .../value/scroll/use-viewport-scroll.mjs.map | 1 + .../dist/es/value/use-combine-values.mjs | 39 + .../dist/es/value/use-combine-values.mjs.map | 1 + .../dist/es/value/use-computed.mjs | 21 + .../dist/es/value/use-computed.mjs.map | 1 + .../dist/es/value/use-follow-value.mjs | 23 + .../dist/es/value/use-follow-value.mjs.map | 1 + .../dist/es/value/use-inverted-scale.mjs | 54 + .../dist/es/value/use-inverted-scale.mjs.map | 1 + .../dist/es/value/use-motion-template.mjs | 47 + .../dist/es/value/use-motion-template.mjs.map | 1 + .../dist/es/value/use-motion-value.mjs | 40 + .../dist/es/value/use-motion-value.mjs.map | 1 + .../dist/es/value/use-scroll.mjs | 119 + .../dist/es/value/use-scroll.mjs.map | 1 + .../dist/es/value/use-spring.mjs | 9 + .../dist/es/value/use-spring.mjs.map | 1 + .../framer-motion/dist/es/value/use-time.mjs | 12 + .../dist/es/value/use-time.mjs.map | 1 + .../dist/es/value/use-transform.mjs | 70 + .../dist/es/value/use-transform.mjs.map | 1 + .../dist/es/value/use-velocity.mjs | 37 + .../dist/es/value/use-velocity.mjs.map | 1 + .../use-will-change/WillChangeMotionValue.mjs | 20 + .../WillChangeMotionValue.mjs.map | 1 + .../dist/es/value/use-will-change/index.mjs | 10 + .../es/value/use-will-change/index.mjs.map | 1 + .../framer-motion/dist/framer-motion.dev.js | 17543 ++++++++++++++++ .../framer-motion/dist/framer-motion.js | 1 + node_modules/framer-motion/dist/index.d.ts | 1740 ++ node_modules/framer-motion/dist/m.d.ts | 412 + node_modules/framer-motion/dist/mini.d.ts | 6 + node_modules/framer-motion/dist/mini.js | 1 + .../framer-motion/dist/projection.d.ts | 1 + .../framer-motion/dist/size-rollup-animate.js | 2 + .../dist/size-rollup-animate.js.map | 1 + .../dist/size-rollup-dom-animation-assets.js | 1 + .../dist/size-rollup-dom-animation-m.js | 1 + .../dist/size-rollup-dom-animation.js | 1 + .../dist/size-rollup-dom-max-assets.js | 1 + .../framer-motion/dist/size-rollup-dom-max.js | 1 + .../framer-motion/dist/size-rollup-m.js | 2 + .../framer-motion/dist/size-rollup-m.js.map | 1 + .../framer-motion/dist/size-rollup-motion.js | 2 + .../dist/size-rollup-motion.js.map | 1 + .../framer-motion/dist/size-rollup-scroll.js | 2 + .../dist/size-rollup-scroll.js.map | 1 + .../dist/size-rollup-waapi-animate.js | 2 + .../dist/size-rollup-waapi-animate.js.map | 1 + node_modules/framer-motion/dom/README.md | 1 + .../framer-motion/dom/mini/package.json | 6 + node_modules/framer-motion/dom/package.json | 6 + node_modules/framer-motion/m/package.json | 6 + node_modules/framer-motion/mini/package.json | 6 + node_modules/framer-motion/package.json | 144 + node_modules/motion-dom/LICENSE.md | 21 + node_modules/motion-dom/dist/cjs/index.js | 11036 ++++++++++ node_modules/motion-dom/dist/cjs/index.js.map | 1 + .../animation/AsyncMotionValueAnimation.mjs | 199 + .../AsyncMotionValueAnimation.mjs.map | 1 + .../dist/es/animation/GroupAnimation.mjs | 82 + .../dist/es/animation/GroupAnimation.mjs.map | 1 + .../es/animation/GroupAnimationWithThen.mjs | 10 + .../animation/GroupAnimationWithThen.mjs.map | 1 + .../dist/es/animation/JSAnimation.mjs | 387 + .../dist/es/animation/JSAnimation.mjs.map | 1 + .../dist/es/animation/NativeAnimation.mjs | 179 + .../dist/es/animation/NativeAnimation.mjs.map | 1 + .../es/animation/NativeAnimationExtended.mjs | 88 + .../animation/NativeAnimationExtended.mjs.map | 1 + .../es/animation/NativeAnimationWrapper.mjs | 15 + .../animation/NativeAnimationWrapper.mjs.map | 1 + .../es/animation/animate/single-value.mjs | 12 + .../es/animation/animate/single-value.mjs.map | 1 + .../dist/es/animation/drivers/frame.mjs | 18 + .../dist/es/animation/drivers/frame.mjs.map | 1 + .../dist/es/animation/generators/inertia.mjs | 88 + .../es/animation/generators/inertia.mjs.map | 1 + .../es/animation/generators/keyframes.mjs | 50 + .../es/animation/generators/keyframes.mjs.map | 1 + .../dist/es/animation/generators/spring.mjs | 329 + .../es/animation/generators/spring.mjs.map | 1 + .../generators/utils/calc-duration.mjs | 18 + .../generators/utils/calc-duration.mjs.map | 1 + .../utils/create-generator-easing.mjs | 20 + .../utils/create-generator-easing.mjs.map | 1 + .../generators/utils/is-generator.mjs | 6 + .../generators/utils/is-generator.mjs.map | 1 + .../animation/generators/utils/velocity.mjs | 10 + .../generators/utils/velocity.mjs.map | 1 + .../es/animation/interfaces/motion-value.mjs | 105 + .../animation/interfaces/motion-value.mjs.map | 1 + .../interfaces/visual-element-target.mjs | 108 + .../interfaces/visual-element-target.mjs.map | 1 + .../interfaces/visual-element-variant.mjs | 60 + .../interfaces/visual-element-variant.mjs.map | 1 + .../animation/interfaces/visual-element.mjs | 27 + .../interfaces/visual-element.mjs.map | 1 + .../keyframes/DOMKeyframesResolver.mjs | 142 + .../keyframes/DOMKeyframesResolver.mjs.map | 1 + .../animation/keyframes/KeyframesResolver.mjs | 148 + .../keyframes/KeyframesResolver.mjs.map | 1 + .../dist/es/animation/keyframes/get-final.mjs | 12 + .../es/animation/keyframes/get-final.mjs.map | 1 + .../animation/keyframes/offsets/default.mjs | 10 + .../keyframes/offsets/default.mjs.map | 1 + .../es/animation/keyframes/offsets/fill.mjs | 13 + .../animation/keyframes/offsets/fill.mjs.map | 1 + .../es/animation/keyframes/offsets/time.mjs | 6 + .../animation/keyframes/offsets/time.mjs.map | 1 + .../keyframes/utils/apply-px-defaults.mjs | 12 + .../keyframes/utils/apply-px-defaults.mjs.map | 1 + .../keyframes/utils/fill-wildcards.mjs | 8 + .../keyframes/utils/fill-wildcards.mjs.map | 1 + .../es/animation/keyframes/utils/is-none.mjs | 16 + .../animation/keyframes/utils/is-none.mjs.map | 1 + .../keyframes/utils/make-none-animatable.mjs | 31 + .../utils/make-none-animatable.mjs.map | 1 + .../keyframes/utils/unit-conversion.mjs | 47 + .../keyframes/utils/unit-conversion.mjs.map | 1 + .../es/animation/optimized-appear/data-id.mjs | 7 + .../optimized-appear/data-id.mjs.map | 1 + .../optimized-appear/get-appear-id.mjs | 8 + .../optimized-appear/get-appear-id.mjs.map | 1 + .../dist/es/animation/utils/WithPromise.mjs | 27 + .../es/animation/utils/WithPromise.mjs.map | 1 + .../es/animation/utils/active-animations.mjs | 13 + .../animation/utils/active-animations.mjs.map | 1 + .../dist/es/animation/utils/arc.mjs | 188 + .../dist/es/animation/utils/arc.mjs.map | 1 + .../es/animation/utils/calc-child-stagger.mjs | 16 + .../utils/calc-child-stagger.mjs.map | 1 + .../dist/es/animation/utils/can-animate.mjs | 44 + .../es/animation/utils/can-animate.mjs.map | 1 + .../utils/css-variables-conversion.mjs | 42 + .../utils/css-variables-conversion.mjs.map | 1 + .../animation/utils/default-transitions.mjs | 41 + .../utils/default-transitions.mjs.map | 1 + .../animation/utils/get-value-transition.mjs | 14 + .../utils/get-value-transition.mjs.map | 1 + .../dist/es/animation/utils/is-animatable.mjs | 31 + .../es/animation/utils/is-animatable.mjs.map | 1 + .../es/animation/utils/is-css-variable.mjs | 27 + .../animation/utils/is-css-variable.mjs.map | 1 + .../animation/utils/is-transition-defined.mjs | 27 + .../utils/is-transition-defined.mjs.map | 1 + .../utils/make-animation-instant.mjs | 7 + .../utils/make-animation-instant.mjs.map | 1 + .../utils/replace-transition-type.mjs | 19 + .../utils/replace-transition-type.mjs.map | 1 + .../es/animation/utils/resolve-transition.mjs | 15 + .../utils/resolve-transition.mjs.map | 1 + .../animation/waapi/easing/cubic-bezier.mjs | 4 + .../waapi/easing/cubic-bezier.mjs.map | 1 + .../animation/waapi/easing/is-supported.mjs | 15 + .../waapi/easing/is-supported.mjs.map | 1 + .../es/animation/waapi/easing/map-easing.mjs | 29 + .../animation/waapi/easing/map-easing.mjs.map | 1 + .../es/animation/waapi/easing/supported.mjs | 16 + .../animation/waapi/easing/supported.mjs.map | 1 + .../animation/waapi/start-waapi-animation.mjs | 29 + .../waapi/start-waapi-animation.mjs.map | 1 + .../waapi/supports/partial-keyframes.mjs | 14 + .../waapi/supports/partial-keyframes.mjs.map | 1 + .../es/animation/waapi/supports/waapi.mjs | 55 + .../es/animation/waapi/supports/waapi.mjs.map | 1 + .../waapi/utils/accelerated-values.mjs | 13 + .../waapi/utils/accelerated-values.mjs.map | 1 + .../animation/waapi/utils/apply-generator.mjs | 16 + .../waapi/utils/apply-generator.mjs.map | 1 + .../waapi/utils/is-browser-color.mjs | 13 + .../waapi/utils/is-browser-color.mjs.map | 1 + .../dist/es/animation/waapi/utils/linear.mjs | 13 + .../es/animation/waapi/utils/linear.mjs.map | 1 + .../es/animation/waapi/utils/px-values.mjs | 59 + .../animation/waapi/utils/px-values.mjs.map | 1 + .../waapi/utils/unsupported-easing.mjs | 19 + .../waapi/utils/unsupported-easing.mjs.map | 1 + .../dist/es/effects/MotionValueState.mjs | 43 + .../dist/es/effects/MotionValueState.mjs.map | 1 + .../motion-dom/dist/es/effects/attr/index.mjs | 42 + .../dist/es/effects/attr/index.mjs.map | 1 + .../motion-dom/dist/es/effects/prop/index.mjs | 10 + .../dist/es/effects/prop/index.mjs.map | 1 + .../dist/es/effects/style/index.mjs | 53 + .../dist/es/effects/style/index.mjs.map | 1 + .../dist/es/effects/style/transform.mjs | 48 + .../dist/es/effects/style/transform.mjs.map | 1 + .../motion-dom/dist/es/effects/svg/index.mjs | 45 + .../dist/es/effects/svg/index.mjs.map | 1 + .../es/effects/utils/create-dom-effect.mjs | 19 + .../effects/utils/create-dom-effect.mjs.map | 1 + .../dist/es/effects/utils/create-effect.mjs | 22 + .../es/effects/utils/create-effect.mjs.map | 1 + .../dist/es/events/add-dom-event.mjs | 7 + .../dist/es/events/add-dom-event.mjs.map | 1 + .../motion-dom/dist/es/frameloop/batcher.mjs | 73 + .../dist/es/frameloop/batcher.mjs.map | 1 + .../motion-dom/dist/es/frameloop/frame.mjs | 7 + .../dist/es/frameloop/frame.mjs.map | 1 + .../dist/es/frameloop/index-legacy.mjs | 21 + .../dist/es/frameloop/index-legacy.mjs.map | 1 + .../dist/es/frameloop/microtask.mjs | 7 + .../dist/es/frameloop/microtask.mjs.map | 1 + .../motion-dom/dist/es/frameloop/order.mjs | 13 + .../dist/es/frameloop/order.mjs.map | 1 + .../dist/es/frameloop/render-step.mjs | 84 + .../dist/es/frameloop/render-step.mjs.map | 1 + .../dist/es/frameloop/sync-time.mjs | 32 + .../dist/es/frameloop/sync-time.mjs.map | 1 + .../dist/es/gestures/drag/state/is-active.mjs | 10 + .../es/gestures/drag/state/is-active.mjs.map | 1 + .../es/gestures/drag/state/set-active.mjs | 29 + .../es/gestures/drag/state/set-active.mjs.map | 1 + .../motion-dom/dist/es/gestures/hover.mjs | 70 + .../motion-dom/dist/es/gestures/hover.mjs.map | 1 + .../dist/es/gestures/press/index.mjs | 97 + .../dist/es/gestures/press/index.mjs.map | 1 + .../press/utils/is-keyboard-accessible.mjs | 34 + .../utils/is-keyboard-accessible.mjs.map | 1 + .../dist/es/gestures/press/utils/keyboard.mjs | 39 + .../es/gestures/press/utils/keyboard.mjs.map | 1 + .../dist/es/gestures/press/utils/state.mjs | 4 + .../es/gestures/press/utils/state.mjs.map | 1 + .../es/gestures/utils/is-node-or-child.mjs | 21 + .../gestures/utils/is-node-or-child.mjs.map | 1 + .../es/gestures/utils/is-primary-pointer.mjs | 19 + .../gestures/utils/is-primary-pointer.mjs.map | 1 + .../dist/es/gestures/utils/setup.mjs | 16 + .../dist/es/gestures/utils/setup.mjs.map | 1 + node_modules/motion-dom/dist/es/index.mjs | 176 + node_modules/motion-dom/dist/es/index.mjs.map | 1 + .../dist/es/layout/LayoutAnimationBuilder.mjs | 354 + .../es/layout/LayoutAnimationBuilder.mjs.map | 1 + .../es/projection/animation/mix-values.mjs | 67 + .../projection/animation/mix-values.mjs.map | 1 + .../es/projection/geometry/conversion.mjs | 34 + .../es/projection/geometry/conversion.mjs.map | 1 + .../dist/es/projection/geometry/copy.mjs | 32 + .../dist/es/projection/geometry/copy.mjs.map | 1 + .../es/projection/geometry/delta-apply.mjs | 125 + .../projection/geometry/delta-apply.mjs.map | 1 + .../es/projection/geometry/delta-calc.mjs | 59 + .../es/projection/geometry/delta-calc.mjs.map | 1 + .../es/projection/geometry/delta-remove.mjs | 55 + .../projection/geometry/delta-remove.mjs.map | 1 + .../dist/es/projection/geometry/models.mjs | 18 + .../es/projection/geometry/models.mjs.map | 1 + .../dist/es/projection/geometry/utils.mjs | 32 + .../dist/es/projection/geometry/utils.mjs.map | 1 + .../node/DocumentProjectionNode.mjs | 14 + .../node/DocumentProjectionNode.mjs.map | 1 + .../es/projection/node/HTMLProjectionNode.mjs | 28 + .../node/HTMLProjectionNode.mjs.map | 1 + .../node/create-projection-node.mjs | 1695 ++ .../node/create-projection-node.mjs.map | 1 + .../dist/es/projection/node/group.mjs | 25 + .../dist/es/projection/node/group.mjs.map | 1 + .../dist/es/projection/node/state.mjs | 20 + .../dist/es/projection/node/state.mjs.map | 1 + .../dist/es/projection/shared/stack.mjs | 85 + .../dist/es/projection/shared/stack.mjs.map | 1 + .../projection/styles/scale-border-radius.mjs | 42 + .../styles/scale-border-radius.mjs.map | 1 + .../es/projection/styles/scale-box-shadow.mjs | 36 + .../styles/scale-box-shadow.mjs.map | 1 + .../es/projection/styles/scale-correction.mjs | 27 + .../styles/scale-correction.mjs.map | 1 + .../dist/es/projection/styles/transform.mjs | 53 + .../es/projection/styles/transform.mjs.map | 1 + .../es/projection/utils/compare-by-depth.mjs | 4 + .../projection/utils/compare-by-depth.mjs.map | 1 + .../dist/es/projection/utils/each-axis.mjs | 6 + .../es/projection/utils/each-axis.mjs.map | 1 + .../dist/es/projection/utils/flat-tree.mjs | 25 + .../es/projection/utils/flat-tree.mjs.map | 1 + .../es/projection/utils/has-transform.mjs | 27 + .../es/projection/utils/has-transform.mjs.map | 1 + .../dist/es/projection/utils/measure.mjs | 18 + .../dist/es/projection/utils/measure.mjs.map | 1 + .../motion-dom/dist/es/render/Feature.mjs | 15 + .../motion-dom/dist/es/render/Feature.mjs.map | 1 + .../dist/es/render/VisualElement.mjs | 560 + .../dist/es/render/VisualElement.mjs.map | 1 + .../dist/es/render/dom/DOMVisualElement.mjs | 43 + .../es/render/dom/DOMVisualElement.mjs.map | 1 + .../dist/es/render/dom/is-css-var.mjs | 4 + .../dist/es/render/dom/is-css-var.mjs.map | 1 + .../dist/es/render/dom/parse-transform.mjs | 84 + .../es/render/dom/parse-transform.mjs.map | 1 + .../dist/es/render/dom/style-computed.mjs | 11 + .../dist/es/render/dom/style-computed.mjs.map | 1 + .../dist/es/render/dom/style-set.mjs | 10 + .../dist/es/render/dom/style-set.mjs.map | 1 + .../es/render/dom/utils/camel-to-dash.mjs | 6 + .../es/render/dom/utils/camel-to-dash.mjs.map | 1 + .../dist/es/render/html/HTMLVisualElement.mjs | 55 + .../es/render/html/HTMLVisualElement.mjs.map | 1 + .../es/render/html/utils/build-styles.mjs | 66 + .../es/render/html/utils/build-styles.mjs.map | 1 + .../es/render/html/utils/build-transform.mjs | 72 + .../render/html/utils/build-transform.mjs.map | 1 + .../dist/es/render/html/utils/render.mjs | 18 + .../dist/es/render/html/utils/render.mjs.map | 1 + .../html/utils/scrape-motion-values.mjs | 22 + .../html/utils/scrape-motion-values.mjs.map | 1 + .../es/render/object/ObjectVisualElement.mjs | 42 + .../render/object/ObjectVisualElement.mjs.map | 1 + .../motion-dom/dist/es/render/store.mjs | 4 + .../motion-dom/dist/es/render/store.mjs.map | 1 + .../dist/es/render/svg/SVGVisualElement.mjs | 52 + .../es/render/svg/SVGVisualElement.mjs.map | 1 + .../dist/es/render/svg/utils/build-attrs.mjs | 64 + .../es/render/svg/utils/build-attrs.mjs.map | 1 + .../es/render/svg/utils/camel-case-attrs.mjs | 31 + .../render/svg/utils/camel-case-attrs.mjs.map | 1 + .../dist/es/render/svg/utils/is-svg-tag.mjs | 4 + .../es/render/svg/utils/is-svg-tag.mjs.map | 1 + .../dist/es/render/svg/utils/path.mjs | 32 + .../dist/es/render/svg/utils/path.mjs.map | 1 + .../dist/es/render/svg/utils/render.mjs | 13 + .../dist/es/render/svg/utils/render.mjs.map | 1 + .../render/svg/utils/scrape-motion-values.mjs | 20 + .../svg/utils/scrape-motion-values.mjs.map | 1 + .../dist/es/render/utils/animation-state.mjs | 387 + .../es/render/utils/animation-state.mjs.map | 1 + .../es/render/utils/get-variant-context.mjs | 33 + .../render/utils/get-variant-context.mjs.map | 1 + .../es/render/utils/is-animation-controls.mjs | 8 + .../utils/is-animation-controls.mjs.map | 1 + .../render/utils/is-controlling-variants.mjs | 14 + .../utils/is-controlling-variants.mjs.map | 1 + .../render/utils/is-forced-motion-value.mjs | 13 + .../utils/is-forced-motion-value.mjs.map | 1 + .../es/render/utils/is-keyframes-target.mjs | 6 + .../render/utils/is-keyframes-target.mjs.map | 1 + .../dist/es/render/utils/is-variant-label.mjs | 9 + .../es/render/utils/is-variant-label.mjs.map | 1 + .../dist/es/render/utils/keys-position.mjs | 14 + .../es/render/utils/keys-position.mjs.map | 1 + .../dist/es/render/utils/keys-transform.mjs | 36 + .../es/render/utils/keys-transform.mjs.map | 1 + .../dist/es/render/utils/motion-values.mjs | 56 + .../es/render/utils/motion-values.mjs.map | 1 + .../es/render/utils/reduced-motion/index.mjs | 20 + .../render/utils/reduced-motion/index.mjs.map | 1 + .../es/render/utils/reduced-motion/state.mjs | 6 + .../render/utils/reduced-motion/state.mjs.map | 1 + .../render/utils/resolve-dynamic-variants.mjs | 9 + .../utils/resolve-dynamic-variants.mjs.map | 1 + .../dist/es/render/utils/resolve-variants.mjs | 37 + .../es/render/utils/resolve-variants.mjs.map | 1 + .../dist/es/render/utils/setters.mjs | 32 + .../dist/es/render/utils/setters.mjs.map | 1 + .../dist/es/render/utils/shallow-compare.mjs | 15 + .../es/render/utils/shallow-compare.mjs.map | 1 + .../dist/es/render/utils/variant-props.mjs | 13 + .../es/render/utils/variant-props.mjs.map | 1 + .../dist/es/resize/handle-element.mjs | 64 + .../dist/es/resize/handle-element.mjs.map | 1 + .../dist/es/resize/handle-window.mjs | 32 + .../dist/es/resize/handle-window.mjs.map | 1 + .../motion-dom/dist/es/resize/index.mjs | 9 + .../motion-dom/dist/es/resize/index.mjs.map | 1 + .../motion-dom/dist/es/scroll/observe.mjs | 19 + .../motion-dom/dist/es/scroll/observe.mjs.map | 1 + .../motion-dom/dist/es/stats/buffer.mjs | 7 + .../motion-dom/dist/es/stats/buffer.mjs.map | 1 + .../motion-dom/dist/es/stats/index.mjs | 29 + .../motion-dom/dist/es/stats/index.mjs.map | 1 + .../dist/es/utils/border-radius.mjs | 15 + .../dist/es/utils/border-radius.mjs.map | 1 + .../motion-dom/dist/es/utils/delay.mjs | 25 + .../motion-dom/dist/es/utils/delay.mjs.map | 1 + .../motion-dom/dist/es/utils/interpolate.mjs | 75 + .../dist/es/utils/interpolate.mjs.map | 1 + .../dist/es/utils/is-html-element.mjs | 14 + .../dist/es/utils/is-html-element.mjs.map | 1 + .../dist/es/utils/is-svg-element.mjs | 12 + .../dist/es/utils/is-svg-element.mjs.map | 1 + .../dist/es/utils/is-svg-svg-element.mjs | 12 + .../dist/es/utils/is-svg-svg-element.mjs.map | 1 + .../motion-dom/dist/es/utils/mix/color.mjs | 48 + .../dist/es/utils/mix/color.mjs.map | 1 + .../motion-dom/dist/es/utils/mix/complex.mjs | 93 + .../dist/es/utils/mix/complex.mjs.map | 1 + .../dist/es/utils/mix/immediate.mjs | 6 + .../dist/es/utils/mix/immediate.mjs.map | 1 + .../motion-dom/dist/es/utils/mix/index.mjs | 15 + .../dist/es/utils/mix/index.mjs.map | 1 + .../motion-dom/dist/es/utils/mix/number.mjs | 27 + .../dist/es/utils/mix/number.mjs.map | 1 + .../dist/es/utils/mix/visibility.mjs | 17 + .../dist/es/utils/mix/visibility.mjs.map | 1 + .../dist/es/utils/resolve-elements.mjs | 21 + .../dist/es/utils/resolve-elements.mjs.map | 1 + .../motion-dom/dist/es/utils/stagger.mjs | 27 + .../motion-dom/dist/es/utils/stagger.mjs.map | 1 + .../dist/es/utils/supports/flags.mjs | 8 + .../dist/es/utils/supports/flags.mjs.map | 1 + .../dist/es/utils/supports/linear-easing.mjs | 16 + .../es/utils/supports/linear-easing.mjs.map | 1 + .../dist/es/utils/supports/memo.mjs | 10 + .../dist/es/utils/supports/memo.mjs.map | 1 + .../es/utils/supports/scroll-timeline.mjs | 7 + .../es/utils/supports/scroll-timeline.mjs.map | 1 + .../motion-dom/dist/es/utils/transform.mjs | 15 + .../dist/es/utils/transform.mjs.map | 1 + .../motion-dom/dist/es/value/follow-value.mjs | 124 + .../dist/es/value/follow-value.mjs.map | 1 + .../motion-dom/dist/es/value/index.mjs | 324 + .../motion-dom/dist/es/value/index.mjs.map | 1 + .../motion-dom/dist/es/value/map-value.mjs | 47 + .../dist/es/value/map-value.mjs.map | 1 + .../motion-dom/dist/es/value/spring-value.mjs | 36 + .../dist/es/value/spring-value.mjs.map | 1 + .../dist/es/value/subscribe-value.mjs | 14 + .../dist/es/value/subscribe-value.mjs.map | 1 + .../dist/es/value/transform-value.mjs | 36 + .../dist/es/value/transform-value.mjs.map | 1 + .../motion-dom/dist/es/value/types/auto.mjs | 10 + .../dist/es/value/types/auto.mjs.map | 1 + .../dist/es/value/types/color/hex.mjs | 41 + .../dist/es/value/types/color/hex.mjs.map | 1 + .../es/value/types/color/hsla-to-rgba.mjs | 43 + .../es/value/types/color/hsla-to-rgba.mjs.map | 1 + .../dist/es/value/types/color/hsla.mjs | 23 + .../dist/es/value/types/color/hsla.mjs.map | 1 + .../dist/es/value/types/color/index.mjs | 33 + .../dist/es/value/types/color/index.mjs.map | 1 + .../dist/es/value/types/color/rgba.mjs | 26 + .../dist/es/value/types/color/rgba.mjs.map | 1 + .../dist/es/value/types/color/utils.mjs | 30 + .../dist/es/value/types/color/utils.mjs.map | 1 + .../dist/es/value/types/complex/filter.mjs | 31 + .../es/value/types/complex/filter.mjs.map | 1 + .../dist/es/value/types/complex/index.mjs | 114 + .../dist/es/value/types/complex/index.mjs.map | 1 + .../dist/es/value/types/complex/mask.mjs | 13 + .../dist/es/value/types/complex/mask.mjs.map | 1 + .../dist/es/value/types/dimensions.mjs | 16 + .../dist/es/value/types/dimensions.mjs.map | 1 + .../motion-dom/dist/es/value/types/int.mjs | 9 + .../dist/es/value/types/int.mjs.map | 1 + .../dist/es/value/types/maps/defaults.mjs | 34 + .../dist/es/value/types/maps/defaults.mjs.map | 1 + .../dist/es/value/types/maps/number.mjs | 71 + .../dist/es/value/types/maps/number.mjs.map | 1 + .../dist/es/value/types/maps/transform.mjs | 38 + .../es/value/types/maps/transform.mjs.map | 1 + .../dist/es/value/types/numbers/index.mjs | 18 + .../dist/es/value/types/numbers/index.mjs.map | 1 + .../dist/es/value/types/numbers/units.mjs | 19 + .../dist/es/value/types/numbers/units.mjs.map | 1 + .../motion-dom/dist/es/value/types/test.mjs | 7 + .../dist/es/value/types/test.mjs.map | 1 + .../es/value/types/utils/animatable-none.mjs | 18 + .../value/types/utils/animatable-none.mjs.map | 1 + .../dist/es/value/types/utils/color-regex.mjs | 4 + .../es/value/types/utils/color-regex.mjs.map | 1 + .../dist/es/value/types/utils/find.mjs | 16 + .../dist/es/value/types/utils/find.mjs.map | 1 + .../dist/es/value/types/utils/float-regex.mjs | 4 + .../es/value/types/utils/float-regex.mjs.map | 1 + .../dist/es/value/types/utils/get-as-type.mjs | 11 + .../es/value/types/utils/get-as-type.mjs.map | 1 + .../dist/es/value/types/utils/is-nullish.mjs | 6 + .../es/value/types/utils/is-nullish.mjs.map | 1 + .../dist/es/value/types/utils/sanitize.mjs | 6 + .../es/value/types/utils/sanitize.mjs.map | 1 + .../value/types/utils/single-color-regex.mjs | 4 + .../types/utils/single-color-regex.mjs.map | 1 + .../dist/es/value/utils/is-motion-value.mjs | 4 + .../es/value/utils/is-motion-value.mjs.map | 1 + .../es/value/utils/resolve-motion-value.mjs | 11 + .../value/utils/resolve-motion-value.mjs.map | 1 + .../es/value/will-change/add-will-change.mjs | 21 + .../value/will-change/add-will-change.mjs.map | 1 + .../dist/es/value/will-change/is.mjs | 8 + .../dist/es/value/will-change/is.mjs.map | 1 + .../motion-dom/dist/es/view/index.mjs | 175 + .../motion-dom/dist/es/view/index.mjs.map | 1 + .../motion-dom/dist/es/view/queue.mjs | 59 + .../motion-dom/dist/es/view/queue.mjs.map | 1 + .../motion-dom/dist/es/view/start.mjs | 700 + .../motion-dom/dist/es/view/start.mjs.map | 1 + .../dist/es/view/utils/assign-names.mjs | 146 + .../dist/es/view/utils/assign-names.mjs.map | 1 + .../dist/es/view/utils/choose-layer-type.mjs | 10 + .../es/view/utils/choose-layer-type.mjs.map | 1 + .../motion-dom/dist/es/view/utils/css.mjs | 33 + .../motion-dom/dist/es/view/utils/css.mjs.map | 1 + .../dist/es/view/utils/get-layer-info.mjs | 11 + .../dist/es/view/utils/get-layer-info.mjs.map | 1 + .../es/view/utils/get-view-animations.mjs | 11 + .../es/view/utils/get-view-animations.mjs.map | 1 + .../dist/es/view/utils/has-target.mjs | 6 + .../dist/es/view/utils/has-target.mjs.map | 1 + node_modules/motion-dom/dist/index.d.ts | 5293 +++++ .../motion-dom/dist/motion-dom.dev.js | 11036 ++++++++++ node_modules/motion-dom/dist/motion-dom.js | 1 + .../dist/size-rollup-motion-value.js | 2 + .../dist/size-rollup-motion-value.js.map | 1 + .../dist/size-rollup-style-effect.js | 2 + .../dist/size-rollup-style-effect.js.map | 1 + node_modules/motion-dom/package.json | 40 + node_modules/motion-utils/LICENSE.md | 21 + node_modules/motion-utils/dist/cjs/index.js | 345 + .../motion-utils/dist/cjs/index.js.map | 1 + node_modules/motion-utils/dist/es/array.mjs | 22 + .../motion-utils/dist/es/array.mjs.map | 1 + node_modules/motion-utils/dist/es/clamp.mjs | 10 + .../motion-utils/dist/es/clamp.mjs.map | 1 + .../dist/es/easing/anticipate.mjs | 10 + .../dist/es/easing/anticipate.mjs.map | 1 + .../motion-utils/dist/es/easing/back.mjs | 10 + .../motion-utils/dist/es/easing/back.mjs.map | 1 + .../motion-utils/dist/es/easing/circ.mjs | 9 + .../motion-utils/dist/es/easing/circ.mjs.map | 1 + .../dist/es/easing/cubic-bezier.mjs | 53 + .../dist/es/easing/cubic-bezier.mjs.map | 1 + .../motion-utils/dist/es/easing/ease.mjs | 8 + .../motion-utils/dist/es/easing/ease.mjs.map | 1 + .../dist/es/easing/modifiers/mirror.mjs | 7 + .../dist/es/easing/modifiers/mirror.mjs.map | 1 + .../dist/es/easing/modifiers/reverse.mjs | 7 + .../dist/es/easing/modifiers/reverse.mjs.map | 1 + .../motion-utils/dist/es/easing/steps.mjs | 17 + .../motion-utils/dist/es/easing/steps.mjs.map | 1 + .../easing/utils/get-easing-for-segment.mjs | 10 + .../utils/get-easing-for-segment.mjs.map | 1 + .../es/easing/utils/is-bezier-definition.mjs | 5 + .../easing/utils/is-bezier-definition.mjs.map | 1 + .../dist/es/easing/utils/is-easing-array.mjs | 7 + .../es/easing/utils/is-easing-array.mjs.map | 1 + .../motion-utils/dist/es/easing/utils/map.mjs | 42 + .../dist/es/easing/utils/map.mjs.map | 1 + node_modules/motion-utils/dist/es/errors.mjs | 20 + .../motion-utils/dist/es/errors.mjs.map | 1 + .../dist/es/format-error-message.mjs | 8 + .../dist/es/format-error-message.mjs.map | 1 + .../motion-utils/dist/es/global-config.mjs | 4 + .../dist/es/global-config.mjs.map | 1 + node_modules/motion-utils/dist/es/index.mjs | 29 + .../motion-utils/dist/es/index.mjs.map | 1 + .../dist/es/is-numerical-string.mjs | 7 + .../dist/es/is-numerical-string.mjs.map | 1 + .../motion-utils/dist/es/is-object.mjs | 4 + .../motion-utils/dist/es/is-object.mjs.map | 1 + .../dist/es/is-zero-value-string.mjs | 7 + .../dist/es/is-zero-value-string.mjs.map | 1 + node_modules/motion-utils/dist/es/memo.mjs | 12 + .../motion-utils/dist/es/memo.mjs.map | 1 + node_modules/motion-utils/dist/es/noop.mjs | 5 + .../motion-utils/dist/es/noop.mjs.map | 1 + node_modules/motion-utils/dist/es/pipe.mjs | 11 + .../motion-utils/dist/es/pipe.mjs.map | 1 + .../motion-utils/dist/es/progress.mjs | 15 + .../motion-utils/dist/es/progress.mjs.map | 1 + .../dist/es/subscription-manager.mjs | 41 + .../dist/es/subscription-manager.mjs.map | 1 + .../motion-utils/dist/es/time-conversion.mjs | 13 + .../dist/es/time-conversion.mjs.map | 1 + .../dist/es/velocity-per-second.mjs | 8 + .../dist/es/velocity-per-second.mjs.map | 1 + .../motion-utils/dist/es/warn-once.mjs | 15 + .../motion-utils/dist/es/warn-once.mjs.map | 1 + node_modules/motion-utils/dist/es/wrap.mjs | 7 + .../motion-utils/dist/es/wrap.mjs.map | 1 + node_modules/motion-utils/dist/index.d.ts | 147 + .../motion-utils/dist/motion-utils.dev.js | 348 + .../motion-utils/dist/motion-utils.js | 1 + node_modules/motion-utils/package.json | 26 + node_modules/motion/LICENSE.md | 21 + node_modules/motion/README.md | 141 + node_modules/motion/dist/cjs/debug.js | 14 + node_modules/motion/dist/cjs/index.js | 14 + node_modules/motion/dist/cjs/mini.js | 14 + node_modules/motion/dist/cjs/react-client.js | 14 + node_modules/motion/dist/cjs/react-m.js | 14 + node_modules/motion/dist/cjs/react-mini.js | 14 + node_modules/motion/dist/cjs/react.js | 46 + node_modules/motion/dist/debug.d.ts | 1 + node_modules/motion/dist/es/debug.mjs | 1 + node_modules/motion/dist/es/index.mjs | 1 + node_modules/motion/dist/es/mini.mjs | 1 + node_modules/motion/dist/es/react-client.mjs | 1 + node_modules/motion/dist/es/react-m.mjs | 1 + node_modules/motion/dist/es/react-mini.mjs | 1 + node_modules/motion/dist/es/react.mjs | 17 + node_modules/motion/dist/index.d.ts | 1 + node_modules/motion/dist/mini.d.ts | 1 + node_modules/motion/dist/motion.dev.js | 12706 +++++++++++ node_modules/motion/dist/motion.js | 1 + node_modules/motion/dist/react-client.d.ts | 1 + node_modules/motion/dist/react-m.d.ts | 1 + node_modules/motion/dist/react-mini.d.ts | 1 + node_modules/motion/dist/react.d.ts | 7 + node_modules/motion/mini/package.json | 6 + node_modules/motion/package.json | 95 + node_modules/motion/react-client/package.json | 6 + node_modules/motion/react-m/package.json | 6 + node_modules/motion/react/package.json | 6 + node_modules/tslib/CopyrightNotice.txt | 15 + node_modules/tslib/LICENSE.txt | 12 + node_modules/tslib/README.md | 164 + node_modules/tslib/SECURITY.md | 41 + node_modules/tslib/modules/index.d.ts | 38 + node_modules/tslib/modules/index.js | 70 + node_modules/tslib/modules/package.json | 3 + node_modules/tslib/package.json | 47 + node_modules/tslib/tslib.d.ts | 460 + node_modules/tslib/tslib.es6.html | 1 + node_modules/tslib/tslib.es6.js | 402 + node_modules/tslib/tslib.es6.mjs | 401 + node_modules/tslib/tslib.html | 1 + node_modules/tslib/tslib.js | 484 + package-lock.json | 78 + package.json | 5 + 970 files changed, 94916 insertions(+), 140 deletions(-) create mode 100644 devjams/components/got-questions/GotQuestionsGraphic.tsx create mode 100644 devjams/components/got-questions/GotQuestionsHeading.tsx create mode 100644 devjams/components/got-questions/GotQuestionsSubHeading.tsx create mode 100644 devjams/components/hero/HeroCTA.tsx create mode 100644 devjams/components/hero/HeroLogo.tsx create mode 100644 devjams/components/hero/HeroTagline.tsx create mode 100644 devjams/components/hero/HeroTrackIcons.tsx create mode 100644 devjams/components/previous-events/PreviousEventsData.ts create mode 100644 devjams/components/previous-events/PreviousEventsDecorations.tsx create mode 100644 devjams/components/previous-events/PreviousEventsHeader.tsx create mode 100644 devjams/components/sections/GotQuestions.tsx create mode 100644 devjams/components/sections/Hero.tsx create mode 100644 devjams/components/sections/PreviousEvents.tsx create mode 100644 devjams/components/sections/Tracks.tsx create mode 100644 devjams/components/tracks/TracksData.tsx create mode 100644 devjams/components/tracks/TracksHeader.tsx create mode 100644 devjams/components/ui/EventCard.tsx create mode 100644 devjams/components/ui/TrackCarousel.tsx create mode 100644 devjams/public/assets/dino.svg create mode 100644 node_modules/.package-lock.json create mode 100644 node_modules/framer-motion/LICENSE.md create mode 100644 node_modules/framer-motion/README.md create mode 100644 node_modules/framer-motion/client/README.md create mode 100644 node_modules/framer-motion/client/package.json create mode 100644 node_modules/framer-motion/dist/cjs/client.js create mode 100644 node_modules/framer-motion/dist/cjs/client.js.map create mode 100644 node_modules/framer-motion/dist/cjs/debug.js create mode 100644 node_modules/framer-motion/dist/cjs/debug.js.map create mode 100644 node_modules/framer-motion/dist/cjs/dom-mini.js create mode 100644 node_modules/framer-motion/dist/cjs/dom-mini.js.map create mode 100644 node_modules/framer-motion/dist/cjs/dom.js create mode 100644 node_modules/framer-motion/dist/cjs/dom.js.map create mode 100644 node_modules/framer-motion/dist/cjs/feature-bundle-BZV7Y7IM.js create mode 100644 node_modules/framer-motion/dist/cjs/feature-bundle-BZV7Y7IM.js.map create mode 100644 node_modules/framer-motion/dist/cjs/index-BuO47Yrm.js create mode 100644 node_modules/framer-motion/dist/cjs/index-BuO47Yrm.js.map create mode 100644 node_modules/framer-motion/dist/cjs/index.js create mode 100644 node_modules/framer-motion/dist/cjs/index.js.map create mode 100644 node_modules/framer-motion/dist/cjs/m.js create mode 100644 node_modules/framer-motion/dist/cjs/m.js.map create mode 100644 node_modules/framer-motion/dist/cjs/mini.js create mode 100644 node_modules/framer-motion/dist/cjs/mini.js.map create mode 100644 node_modules/framer-motion/dist/client.d.ts create mode 100644 node_modules/framer-motion/dist/debug.d.ts create mode 100644 node_modules/framer-motion/dist/dom-mini.d.ts create mode 100644 node_modules/framer-motion/dist/dom-mini.js create mode 100644 node_modules/framer-motion/dist/dom.d.ts create mode 100644 node_modules/framer-motion/dist/dom.js create mode 100644 node_modules/framer-motion/dist/es/animation/animate/index.mjs create mode 100644 node_modules/framer-motion/dist/es/animation/animate/index.mjs.map create mode 100644 node_modules/framer-motion/dist/es/animation/animate/resolve-subjects.mjs create mode 100644 node_modules/framer-motion/dist/es/animation/animate/resolve-subjects.mjs.map create mode 100644 node_modules/framer-motion/dist/es/animation/animate/sequence.mjs create mode 100644 node_modules/framer-motion/dist/es/animation/animate/sequence.mjs.map create mode 100644 node_modules/framer-motion/dist/es/animation/animate/subject.mjs create mode 100644 node_modules/framer-motion/dist/es/animation/animate/subject.mjs.map create mode 100644 node_modules/framer-motion/dist/es/animation/animators/waapi/animate-elements.mjs create mode 100644 node_modules/framer-motion/dist/es/animation/animators/waapi/animate-elements.mjs.map create mode 100644 node_modules/framer-motion/dist/es/animation/animators/waapi/animate-sequence.mjs create mode 100644 node_modules/framer-motion/dist/es/animation/animators/waapi/animate-sequence.mjs.map create mode 100644 node_modules/framer-motion/dist/es/animation/animators/waapi/animate-style.mjs create mode 100644 node_modules/framer-motion/dist/es/animation/animators/waapi/animate-style.mjs.map create mode 100644 node_modules/framer-motion/dist/es/animation/hooks/animation-controls.mjs create mode 100644 node_modules/framer-motion/dist/es/animation/hooks/animation-controls.mjs.map create mode 100644 node_modules/framer-motion/dist/es/animation/hooks/use-animate-style.mjs create mode 100644 node_modules/framer-motion/dist/es/animation/hooks/use-animate-style.mjs.map create mode 100644 node_modules/framer-motion/dist/es/animation/hooks/use-animate.mjs create mode 100644 node_modules/framer-motion/dist/es/animation/hooks/use-animate.mjs.map create mode 100644 node_modules/framer-motion/dist/es/animation/hooks/use-animated-state.mjs create mode 100644 node_modules/framer-motion/dist/es/animation/hooks/use-animated-state.mjs.map create mode 100644 node_modules/framer-motion/dist/es/animation/hooks/use-animation.mjs create mode 100644 node_modules/framer-motion/dist/es/animation/hooks/use-animation.mjs.map create mode 100644 node_modules/framer-motion/dist/es/animation/optimized-appear/handoff.mjs create mode 100644 node_modules/framer-motion/dist/es/animation/optimized-appear/handoff.mjs.map create mode 100644 node_modules/framer-motion/dist/es/animation/optimized-appear/start.mjs create mode 100644 node_modules/framer-motion/dist/es/animation/optimized-appear/start.mjs.map create mode 100644 node_modules/framer-motion/dist/es/animation/optimized-appear/store-id.mjs create mode 100644 node_modules/framer-motion/dist/es/animation/optimized-appear/store-id.mjs.map create mode 100644 node_modules/framer-motion/dist/es/animation/optimized-appear/store.mjs create mode 100644 node_modules/framer-motion/dist/es/animation/optimized-appear/store.mjs.map create mode 100644 node_modules/framer-motion/dist/es/animation/sequence/create.mjs create mode 100644 node_modules/framer-motion/dist/es/animation/sequence/create.mjs.map create mode 100644 node_modules/framer-motion/dist/es/animation/sequence/utils/calc-repeat-duration.mjs create mode 100644 node_modules/framer-motion/dist/es/animation/sequence/utils/calc-repeat-duration.mjs.map create mode 100644 node_modules/framer-motion/dist/es/animation/sequence/utils/calc-time.mjs create mode 100644 node_modules/framer-motion/dist/es/animation/sequence/utils/calc-time.mjs.map create mode 100644 node_modules/framer-motion/dist/es/animation/sequence/utils/edit.mjs create mode 100644 node_modules/framer-motion/dist/es/animation/sequence/utils/edit.mjs.map create mode 100644 node_modules/framer-motion/dist/es/animation/sequence/utils/normalize-times.mjs create mode 100644 node_modules/framer-motion/dist/es/animation/sequence/utils/normalize-times.mjs.map create mode 100644 node_modules/framer-motion/dist/es/animation/sequence/utils/sort.mjs create mode 100644 node_modules/framer-motion/dist/es/animation/sequence/utils/sort.mjs.map create mode 100644 node_modules/framer-motion/dist/es/animation/utils/create-visual-element.mjs create mode 100644 node_modules/framer-motion/dist/es/animation/utils/create-visual-element.mjs.map create mode 100644 node_modules/framer-motion/dist/es/animation/utils/is-dom-keyframes.mjs create mode 100644 node_modules/framer-motion/dist/es/animation/utils/is-dom-keyframes.mjs.map create mode 100644 node_modules/framer-motion/dist/es/client.mjs create mode 100644 node_modules/framer-motion/dist/es/client.mjs.map create mode 100644 node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.mjs create mode 100644 node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.mjs.map create mode 100644 node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs create mode 100644 node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs.map create mode 100644 node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs create mode 100644 node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs.map create mode 100644 node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence-data.mjs create mode 100644 node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence-data.mjs.map create mode 100644 node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.mjs create mode 100644 node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.mjs.map create mode 100644 node_modules/framer-motion/dist/es/components/AnimatePresence/utils.mjs create mode 100644 node_modules/framer-motion/dist/es/components/AnimatePresence/utils.mjs.map create mode 100644 node_modules/framer-motion/dist/es/components/AnimateSharedLayout.mjs create mode 100644 node_modules/framer-motion/dist/es/components/AnimateSharedLayout.mjs.map create mode 100644 node_modules/framer-motion/dist/es/components/LayoutGroup/index.mjs create mode 100644 node_modules/framer-motion/dist/es/components/LayoutGroup/index.mjs.map create mode 100644 node_modules/framer-motion/dist/es/components/LazyMotion/index.mjs create mode 100644 node_modules/framer-motion/dist/es/components/LazyMotion/index.mjs.map create mode 100644 node_modules/framer-motion/dist/es/components/MotionConfig/index.mjs create mode 100644 node_modules/framer-motion/dist/es/components/MotionConfig/index.mjs.map create mode 100644 node_modules/framer-motion/dist/es/components/Reorder/Group.mjs create mode 100644 node_modules/framer-motion/dist/es/components/Reorder/Group.mjs.map create mode 100644 node_modules/framer-motion/dist/es/components/Reorder/Item.mjs create mode 100644 node_modules/framer-motion/dist/es/components/Reorder/Item.mjs.map create mode 100644 node_modules/framer-motion/dist/es/components/Reorder/namespace.mjs create mode 100644 node_modules/framer-motion/dist/es/components/Reorder/namespace.mjs.map create mode 100644 node_modules/framer-motion/dist/es/components/Reorder/utils/auto-scroll.mjs create mode 100644 node_modules/framer-motion/dist/es/components/Reorder/utils/auto-scroll.mjs.map create mode 100644 node_modules/framer-motion/dist/es/components/Reorder/utils/check-reorder.mjs create mode 100644 node_modules/framer-motion/dist/es/components/Reorder/utils/check-reorder.mjs.map create mode 100644 node_modules/framer-motion/dist/es/components/Reorder/utils/detect-axis.mjs create mode 100644 node_modules/framer-motion/dist/es/components/Reorder/utils/detect-axis.mjs.map create mode 100644 node_modules/framer-motion/dist/es/context/DeprecatedLayoutGroupContext.mjs create mode 100644 node_modules/framer-motion/dist/es/context/DeprecatedLayoutGroupContext.mjs.map create mode 100644 node_modules/framer-motion/dist/es/context/LayoutGroupContext.mjs create mode 100644 node_modules/framer-motion/dist/es/context/LayoutGroupContext.mjs.map create mode 100644 node_modules/framer-motion/dist/es/context/LazyContext.mjs create mode 100644 node_modules/framer-motion/dist/es/context/LazyContext.mjs.map create mode 100644 node_modules/framer-motion/dist/es/context/MotionConfigContext.mjs create mode 100644 node_modules/framer-motion/dist/es/context/MotionConfigContext.mjs.map create mode 100644 node_modules/framer-motion/dist/es/context/MotionContext/create.mjs create mode 100644 node_modules/framer-motion/dist/es/context/MotionContext/create.mjs.map create mode 100644 node_modules/framer-motion/dist/es/context/MotionContext/index.mjs create mode 100644 node_modules/framer-motion/dist/es/context/MotionContext/index.mjs.map create mode 100644 node_modules/framer-motion/dist/es/context/MotionContext/utils.mjs create mode 100644 node_modules/framer-motion/dist/es/context/MotionContext/utils.mjs.map create mode 100644 node_modules/framer-motion/dist/es/context/PresenceContext.mjs create mode 100644 node_modules/framer-motion/dist/es/context/PresenceContext.mjs.map create mode 100644 node_modules/framer-motion/dist/es/context/ReorderContext.mjs create mode 100644 node_modules/framer-motion/dist/es/context/ReorderContext.mjs.map create mode 100644 node_modules/framer-motion/dist/es/context/SwitchLayoutGroupContext.mjs create mode 100644 node_modules/framer-motion/dist/es/context/SwitchLayoutGroupContext.mjs.map create mode 100644 node_modules/framer-motion/dist/es/debug.mjs create mode 100644 node_modules/framer-motion/dist/es/debug.mjs.map create mode 100644 node_modules/framer-motion/dist/es/dom-mini.mjs create mode 100644 node_modules/framer-motion/dist/es/dom-mini.mjs.map create mode 100644 node_modules/framer-motion/dist/es/dom.mjs create mode 100644 node_modules/framer-motion/dist/es/dom.mjs.map create mode 100644 node_modules/framer-motion/dist/es/events/add-pointer-event.mjs create mode 100644 node_modules/framer-motion/dist/es/events/add-pointer-event.mjs.map create mode 100644 node_modules/framer-motion/dist/es/events/event-info.mjs create mode 100644 node_modules/framer-motion/dist/es/events/event-info.mjs.map create mode 100644 node_modules/framer-motion/dist/es/events/use-dom-event.mjs create mode 100644 node_modules/framer-motion/dist/es/events/use-dom-event.mjs.map create mode 100644 node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs create mode 100644 node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs.map create mode 100644 node_modules/framer-motion/dist/es/gestures/drag/index.mjs create mode 100644 node_modules/framer-motion/dist/es/gestures/drag/index.mjs.map create mode 100644 node_modules/framer-motion/dist/es/gestures/drag/use-drag-controls.mjs create mode 100644 node_modules/framer-motion/dist/es/gestures/drag/use-drag-controls.mjs.map create mode 100644 node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.mjs create mode 100644 node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.mjs.map create mode 100644 node_modules/framer-motion/dist/es/gestures/focus.mjs create mode 100644 node_modules/framer-motion/dist/es/gestures/focus.mjs.map create mode 100644 node_modules/framer-motion/dist/es/gestures/hover.mjs create mode 100644 node_modules/framer-motion/dist/es/gestures/hover.mjs.map create mode 100644 node_modules/framer-motion/dist/es/gestures/pan/PanSession.mjs create mode 100644 node_modules/framer-motion/dist/es/gestures/pan/PanSession.mjs.map create mode 100644 node_modules/framer-motion/dist/es/gestures/pan/index.mjs create mode 100644 node_modules/framer-motion/dist/es/gestures/pan/index.mjs.map create mode 100644 node_modules/framer-motion/dist/es/gestures/press.mjs create mode 100644 node_modules/framer-motion/dist/es/gestures/press.mjs.map create mode 100644 node_modules/framer-motion/dist/es/index.mjs create mode 100644 node_modules/framer-motion/dist/es/index.mjs.map create mode 100644 node_modules/framer-motion/dist/es/m.mjs create mode 100644 node_modules/framer-motion/dist/es/m.mjs.map create mode 100644 node_modules/framer-motion/dist/es/mini.mjs create mode 100644 node_modules/framer-motion/dist/es/mini.mjs.map create mode 100644 node_modules/framer-motion/dist/es/motion/features/animation/exit.mjs create mode 100644 node_modules/framer-motion/dist/es/motion/features/animation/exit.mjs.map create mode 100644 node_modules/framer-motion/dist/es/motion/features/animation/index.mjs create mode 100644 node_modules/framer-motion/dist/es/motion/features/animation/index.mjs.map create mode 100644 node_modules/framer-motion/dist/es/motion/features/animations.mjs create mode 100644 node_modules/framer-motion/dist/es/motion/features/animations.mjs.map create mode 100644 node_modules/framer-motion/dist/es/motion/features/definitions.mjs create mode 100644 node_modules/framer-motion/dist/es/motion/features/definitions.mjs.map create mode 100644 node_modules/framer-motion/dist/es/motion/features/drag.mjs create mode 100644 node_modules/framer-motion/dist/es/motion/features/drag.mjs.map create mode 100644 node_modules/framer-motion/dist/es/motion/features/gestures.mjs create mode 100644 node_modules/framer-motion/dist/es/motion/features/gestures.mjs.map create mode 100644 node_modules/framer-motion/dist/es/motion/features/layout.mjs create mode 100644 node_modules/framer-motion/dist/es/motion/features/layout.mjs.map create mode 100644 node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.mjs create mode 100644 node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.mjs.map create mode 100644 node_modules/framer-motion/dist/es/motion/features/load-features.mjs create mode 100644 node_modules/framer-motion/dist/es/motion/features/load-features.mjs.map create mode 100644 node_modules/framer-motion/dist/es/motion/features/viewport/index.mjs create mode 100644 node_modules/framer-motion/dist/es/motion/features/viewport/index.mjs.map create mode 100644 node_modules/framer-motion/dist/es/motion/features/viewport/observers.mjs create mode 100644 node_modules/framer-motion/dist/es/motion/features/viewport/observers.mjs.map create mode 100644 node_modules/framer-motion/dist/es/motion/index.mjs create mode 100644 node_modules/framer-motion/dist/es/motion/index.mjs.map create mode 100644 node_modules/framer-motion/dist/es/motion/utils/is-motion-component.mjs create mode 100644 node_modules/framer-motion/dist/es/motion/utils/is-motion-component.mjs.map create mode 100644 node_modules/framer-motion/dist/es/motion/utils/symbol.mjs create mode 100644 node_modules/framer-motion/dist/es/motion/utils/symbol.mjs.map create mode 100644 node_modules/framer-motion/dist/es/motion/utils/unwrap-motion-component.mjs create mode 100644 node_modules/framer-motion/dist/es/motion/utils/unwrap-motion-component.mjs.map create mode 100644 node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.mjs create mode 100644 node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.mjs.map create mode 100644 node_modules/framer-motion/dist/es/motion/utils/use-visual-element.mjs create mode 100644 node_modules/framer-motion/dist/es/motion/utils/use-visual-element.mjs.map create mode 100644 node_modules/framer-motion/dist/es/motion/utils/use-visual-state.mjs create mode 100644 node_modules/framer-motion/dist/es/motion/utils/use-visual-state.mjs.map create mode 100644 node_modules/framer-motion/dist/es/motion/utils/valid-prop.mjs create mode 100644 node_modules/framer-motion/dist/es/motion/utils/valid-prop.mjs.map create mode 100644 node_modules/framer-motion/dist/es/projection.mjs create mode 100644 node_modules/framer-motion/dist/es/projection.mjs.map create mode 100644 node_modules/framer-motion/dist/es/projection/use-instant-layout-transition.mjs create mode 100644 node_modules/framer-motion/dist/es/projection/use-instant-layout-transition.mjs.map create mode 100644 node_modules/framer-motion/dist/es/projection/use-reset-projection.mjs create mode 100644 node_modules/framer-motion/dist/es/projection/use-reset-projection.mjs.map create mode 100644 node_modules/framer-motion/dist/es/render/components/create-proxy.mjs create mode 100644 node_modules/framer-motion/dist/es/render/components/create-proxy.mjs.map create mode 100644 node_modules/framer-motion/dist/es/render/components/m/create.mjs create mode 100644 node_modules/framer-motion/dist/es/render/components/m/create.mjs.map create mode 100644 node_modules/framer-motion/dist/es/render/components/m/elements.mjs create mode 100644 node_modules/framer-motion/dist/es/render/components/m/elements.mjs.map create mode 100644 node_modules/framer-motion/dist/es/render/components/m/proxy.mjs create mode 100644 node_modules/framer-motion/dist/es/render/components/m/proxy.mjs.map create mode 100644 node_modules/framer-motion/dist/es/render/components/motion/create.mjs create mode 100644 node_modules/framer-motion/dist/es/render/components/motion/create.mjs.map create mode 100644 node_modules/framer-motion/dist/es/render/components/motion/elements.mjs create mode 100644 node_modules/framer-motion/dist/es/render/components/motion/elements.mjs.map create mode 100644 node_modules/framer-motion/dist/es/render/components/motion/feature-bundle.mjs create mode 100644 node_modules/framer-motion/dist/es/render/components/motion/feature-bundle.mjs.map create mode 100644 node_modules/framer-motion/dist/es/render/components/motion/proxy.mjs create mode 100644 node_modules/framer-motion/dist/es/render/components/motion/proxy.mjs.map create mode 100644 node_modules/framer-motion/dist/es/render/dom/create-visual-element.mjs create mode 100644 node_modules/framer-motion/dist/es/render/dom/create-visual-element.mjs.map create mode 100644 node_modules/framer-motion/dist/es/render/dom/features-animation.mjs create mode 100644 node_modules/framer-motion/dist/es/render/dom/features-animation.mjs.map create mode 100644 node_modules/framer-motion/dist/es/render/dom/features-max.mjs create mode 100644 node_modules/framer-motion/dist/es/render/dom/features-max.mjs.map create mode 100644 node_modules/framer-motion/dist/es/render/dom/features-min.mjs create mode 100644 node_modules/framer-motion/dist/es/render/dom/features-min.mjs.map create mode 100644 node_modules/framer-motion/dist/es/render/dom/scroll/attach-animation.mjs create mode 100644 node_modules/framer-motion/dist/es/render/dom/scroll/attach-animation.mjs.map create mode 100644 node_modules/framer-motion/dist/es/render/dom/scroll/attach-function.mjs create mode 100644 node_modules/framer-motion/dist/es/render/dom/scroll/attach-function.mjs.map create mode 100644 node_modules/framer-motion/dist/es/render/dom/scroll/index.mjs create mode 100644 node_modules/framer-motion/dist/es/render/dom/scroll/index.mjs.map create mode 100644 node_modules/framer-motion/dist/es/render/dom/scroll/info.mjs create mode 100644 node_modules/framer-motion/dist/es/render/dom/scroll/info.mjs.map create mode 100644 node_modules/framer-motion/dist/es/render/dom/scroll/offsets/edge.mjs create mode 100644 node_modules/framer-motion/dist/es/render/dom/scroll/offsets/edge.mjs.map create mode 100644 node_modules/framer-motion/dist/es/render/dom/scroll/offsets/index.mjs create mode 100644 node_modules/framer-motion/dist/es/render/dom/scroll/offsets/index.mjs.map create mode 100644 node_modules/framer-motion/dist/es/render/dom/scroll/offsets/inset.mjs create mode 100644 node_modules/framer-motion/dist/es/render/dom/scroll/offsets/inset.mjs.map create mode 100644 node_modules/framer-motion/dist/es/render/dom/scroll/offsets/offset.mjs create mode 100644 node_modules/framer-motion/dist/es/render/dom/scroll/offsets/offset.mjs.map create mode 100644 node_modules/framer-motion/dist/es/render/dom/scroll/offsets/presets.mjs create mode 100644 node_modules/framer-motion/dist/es/render/dom/scroll/offsets/presets.mjs.map create mode 100644 node_modules/framer-motion/dist/es/render/dom/scroll/on-scroll-handler.mjs create mode 100644 node_modules/framer-motion/dist/es/render/dom/scroll/on-scroll-handler.mjs.map create mode 100644 node_modules/framer-motion/dist/es/render/dom/scroll/track.mjs create mode 100644 node_modules/framer-motion/dist/es/render/dom/scroll/track.mjs.map create mode 100644 node_modules/framer-motion/dist/es/render/dom/scroll/utils/can-use-native-timeline.mjs create mode 100644 node_modules/framer-motion/dist/es/render/dom/scroll/utils/can-use-native-timeline.mjs.map create mode 100644 node_modules/framer-motion/dist/es/render/dom/scroll/utils/get-timeline.mjs create mode 100644 node_modules/framer-motion/dist/es/render/dom/scroll/utils/get-timeline.mjs.map create mode 100644 node_modules/framer-motion/dist/es/render/dom/scroll/utils/is-element-tracking.mjs create mode 100644 node_modules/framer-motion/dist/es/render/dom/scroll/utils/is-element-tracking.mjs.map create mode 100644 node_modules/framer-motion/dist/es/render/dom/scroll/utils/offset-to-range.mjs create mode 100644 node_modules/framer-motion/dist/es/render/dom/scroll/utils/offset-to-range.mjs.map create mode 100644 node_modules/framer-motion/dist/es/render/dom/use-render.mjs create mode 100644 node_modules/framer-motion/dist/es/render/dom/use-render.mjs.map create mode 100644 node_modules/framer-motion/dist/es/render/dom/utils/filter-props.mjs create mode 100644 node_modules/framer-motion/dist/es/render/dom/utils/filter-props.mjs.map create mode 100644 node_modules/framer-motion/dist/es/render/dom/utils/is-svg-component.mjs create mode 100644 node_modules/framer-motion/dist/es/render/dom/utils/is-svg-component.mjs.map create mode 100644 node_modules/framer-motion/dist/es/render/dom/viewport/index.mjs create mode 100644 node_modules/framer-motion/dist/es/render/dom/viewport/index.mjs.map create mode 100644 node_modules/framer-motion/dist/es/render/html/use-html-visual-state.mjs create mode 100644 node_modules/framer-motion/dist/es/render/html/use-html-visual-state.mjs.map create mode 100644 node_modules/framer-motion/dist/es/render/html/use-props.mjs create mode 100644 node_modules/framer-motion/dist/es/render/html/use-props.mjs.map create mode 100644 node_modules/framer-motion/dist/es/render/html/utils/create-render-state.mjs create mode 100644 node_modules/framer-motion/dist/es/render/html/utils/create-render-state.mjs.map create mode 100644 node_modules/framer-motion/dist/es/render/svg/lowercase-elements.mjs create mode 100644 node_modules/framer-motion/dist/es/render/svg/lowercase-elements.mjs.map create mode 100644 node_modules/framer-motion/dist/es/render/svg/use-props.mjs create mode 100644 node_modules/framer-motion/dist/es/render/svg/use-props.mjs.map create mode 100644 node_modules/framer-motion/dist/es/render/svg/use-svg-visual-state.mjs create mode 100644 node_modules/framer-motion/dist/es/render/svg/use-svg-visual-state.mjs.map create mode 100644 node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.mjs create mode 100644 node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.mjs.map create mode 100644 node_modules/framer-motion/dist/es/utils/distance.mjs create mode 100644 node_modules/framer-motion/dist/es/utils/distance.mjs.map create mode 100644 node_modules/framer-motion/dist/es/utils/get-context-window.mjs create mode 100644 node_modules/framer-motion/dist/es/utils/get-context-window.mjs.map create mode 100644 node_modules/framer-motion/dist/es/utils/is-browser.mjs create mode 100644 node_modules/framer-motion/dist/es/utils/is-browser.mjs.map create mode 100644 node_modules/framer-motion/dist/es/utils/is-ref-object.mjs create mode 100644 node_modules/framer-motion/dist/es/utils/is-ref-object.mjs.map create mode 100644 node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion-config.mjs create mode 100644 node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion-config.mjs.map create mode 100644 node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.mjs create mode 100644 node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.mjs.map create mode 100644 node_modules/framer-motion/dist/es/utils/transform-rotated-parent.mjs create mode 100644 node_modules/framer-motion/dist/es/utils/transform-rotated-parent.mjs.map create mode 100644 node_modules/framer-motion/dist/es/utils/transform-viewbox-point.mjs create mode 100644 node_modules/framer-motion/dist/es/utils/transform-viewbox-point.mjs.map create mode 100644 node_modules/framer-motion/dist/es/utils/use-animation-frame.mjs create mode 100644 node_modules/framer-motion/dist/es/utils/use-animation-frame.mjs.map create mode 100644 node_modules/framer-motion/dist/es/utils/use-composed-ref.mjs create mode 100644 node_modules/framer-motion/dist/es/utils/use-composed-ref.mjs.map create mode 100644 node_modules/framer-motion/dist/es/utils/use-constant.mjs create mode 100644 node_modules/framer-motion/dist/es/utils/use-constant.mjs.map create mode 100644 node_modules/framer-motion/dist/es/utils/use-cycle.mjs create mode 100644 node_modules/framer-motion/dist/es/utils/use-cycle.mjs.map create mode 100644 node_modules/framer-motion/dist/es/utils/use-force-update.mjs create mode 100644 node_modules/framer-motion/dist/es/utils/use-force-update.mjs.map create mode 100644 node_modules/framer-motion/dist/es/utils/use-in-view.mjs create mode 100644 node_modules/framer-motion/dist/es/utils/use-in-view.mjs.map create mode 100644 node_modules/framer-motion/dist/es/utils/use-instant-transition.mjs create mode 100644 node_modules/framer-motion/dist/es/utils/use-instant-transition.mjs.map create mode 100644 node_modules/framer-motion/dist/es/utils/use-is-mounted.mjs create mode 100644 node_modules/framer-motion/dist/es/utils/use-is-mounted.mjs.map create mode 100644 node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.mjs create mode 100644 node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.mjs.map create mode 100644 node_modules/framer-motion/dist/es/utils/use-motion-value-event.mjs create mode 100644 node_modules/framer-motion/dist/es/utils/use-motion-value-event.mjs.map create mode 100644 node_modules/framer-motion/dist/es/utils/use-page-in-view.mjs create mode 100644 node_modules/framer-motion/dist/es/utils/use-page-in-view.mjs.map create mode 100644 node_modules/framer-motion/dist/es/utils/use-unmount-effect.mjs create mode 100644 node_modules/framer-motion/dist/es/utils/use-unmount-effect.mjs.map create mode 100644 node_modules/framer-motion/dist/es/value/scroll/use-element-scroll.mjs create mode 100644 node_modules/framer-motion/dist/es/value/scroll/use-element-scroll.mjs.map create mode 100644 node_modules/framer-motion/dist/es/value/scroll/use-viewport-scroll.mjs create mode 100644 node_modules/framer-motion/dist/es/value/scroll/use-viewport-scroll.mjs.map create mode 100644 node_modules/framer-motion/dist/es/value/use-combine-values.mjs create mode 100644 node_modules/framer-motion/dist/es/value/use-combine-values.mjs.map create mode 100644 node_modules/framer-motion/dist/es/value/use-computed.mjs create mode 100644 node_modules/framer-motion/dist/es/value/use-computed.mjs.map create mode 100644 node_modules/framer-motion/dist/es/value/use-follow-value.mjs create mode 100644 node_modules/framer-motion/dist/es/value/use-follow-value.mjs.map create mode 100644 node_modules/framer-motion/dist/es/value/use-inverted-scale.mjs create mode 100644 node_modules/framer-motion/dist/es/value/use-inverted-scale.mjs.map create mode 100644 node_modules/framer-motion/dist/es/value/use-motion-template.mjs create mode 100644 node_modules/framer-motion/dist/es/value/use-motion-template.mjs.map create mode 100644 node_modules/framer-motion/dist/es/value/use-motion-value.mjs create mode 100644 node_modules/framer-motion/dist/es/value/use-motion-value.mjs.map create mode 100644 node_modules/framer-motion/dist/es/value/use-scroll.mjs create mode 100644 node_modules/framer-motion/dist/es/value/use-scroll.mjs.map create mode 100644 node_modules/framer-motion/dist/es/value/use-spring.mjs create mode 100644 node_modules/framer-motion/dist/es/value/use-spring.mjs.map create mode 100644 node_modules/framer-motion/dist/es/value/use-time.mjs create mode 100644 node_modules/framer-motion/dist/es/value/use-time.mjs.map create mode 100644 node_modules/framer-motion/dist/es/value/use-transform.mjs create mode 100644 node_modules/framer-motion/dist/es/value/use-transform.mjs.map create mode 100644 node_modules/framer-motion/dist/es/value/use-velocity.mjs create mode 100644 node_modules/framer-motion/dist/es/value/use-velocity.mjs.map create mode 100644 node_modules/framer-motion/dist/es/value/use-will-change/WillChangeMotionValue.mjs create mode 100644 node_modules/framer-motion/dist/es/value/use-will-change/WillChangeMotionValue.mjs.map create mode 100644 node_modules/framer-motion/dist/es/value/use-will-change/index.mjs create mode 100644 node_modules/framer-motion/dist/es/value/use-will-change/index.mjs.map create mode 100644 node_modules/framer-motion/dist/framer-motion.dev.js create mode 100644 node_modules/framer-motion/dist/framer-motion.js create mode 100644 node_modules/framer-motion/dist/index.d.ts create mode 100644 node_modules/framer-motion/dist/m.d.ts create mode 100644 node_modules/framer-motion/dist/mini.d.ts create mode 100644 node_modules/framer-motion/dist/mini.js create mode 100644 node_modules/framer-motion/dist/projection.d.ts create mode 100644 node_modules/framer-motion/dist/size-rollup-animate.js create mode 100644 node_modules/framer-motion/dist/size-rollup-animate.js.map create mode 100644 node_modules/framer-motion/dist/size-rollup-dom-animation-assets.js create mode 100644 node_modules/framer-motion/dist/size-rollup-dom-animation-m.js create mode 100644 node_modules/framer-motion/dist/size-rollup-dom-animation.js create mode 100644 node_modules/framer-motion/dist/size-rollup-dom-max-assets.js create mode 100644 node_modules/framer-motion/dist/size-rollup-dom-max.js create mode 100644 node_modules/framer-motion/dist/size-rollup-m.js create mode 100644 node_modules/framer-motion/dist/size-rollup-m.js.map create mode 100644 node_modules/framer-motion/dist/size-rollup-motion.js create mode 100644 node_modules/framer-motion/dist/size-rollup-motion.js.map create mode 100644 node_modules/framer-motion/dist/size-rollup-scroll.js create mode 100644 node_modules/framer-motion/dist/size-rollup-scroll.js.map create mode 100644 node_modules/framer-motion/dist/size-rollup-waapi-animate.js create mode 100644 node_modules/framer-motion/dist/size-rollup-waapi-animate.js.map create mode 100644 node_modules/framer-motion/dom/README.md create mode 100644 node_modules/framer-motion/dom/mini/package.json create mode 100644 node_modules/framer-motion/dom/package.json create mode 100644 node_modules/framer-motion/m/package.json create mode 100644 node_modules/framer-motion/mini/package.json create mode 100644 node_modules/framer-motion/package.json create mode 100644 node_modules/motion-dom/LICENSE.md create mode 100644 node_modules/motion-dom/dist/cjs/index.js create mode 100644 node_modules/motion-dom/dist/cjs/index.js.map create mode 100644 node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.mjs create mode 100644 node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.mjs.map create mode 100644 node_modules/motion-dom/dist/es/animation/GroupAnimation.mjs create mode 100644 node_modules/motion-dom/dist/es/animation/GroupAnimation.mjs.map create mode 100644 node_modules/motion-dom/dist/es/animation/GroupAnimationWithThen.mjs create mode 100644 node_modules/motion-dom/dist/es/animation/GroupAnimationWithThen.mjs.map create mode 100644 node_modules/motion-dom/dist/es/animation/JSAnimation.mjs create mode 100644 node_modules/motion-dom/dist/es/animation/JSAnimation.mjs.map create mode 100644 node_modules/motion-dom/dist/es/animation/NativeAnimation.mjs create mode 100644 node_modules/motion-dom/dist/es/animation/NativeAnimation.mjs.map create mode 100644 node_modules/motion-dom/dist/es/animation/NativeAnimationExtended.mjs create mode 100644 node_modules/motion-dom/dist/es/animation/NativeAnimationExtended.mjs.map create mode 100644 node_modules/motion-dom/dist/es/animation/NativeAnimationWrapper.mjs create mode 100644 node_modules/motion-dom/dist/es/animation/NativeAnimationWrapper.mjs.map create mode 100644 node_modules/motion-dom/dist/es/animation/animate/single-value.mjs create mode 100644 node_modules/motion-dom/dist/es/animation/animate/single-value.mjs.map create mode 100644 node_modules/motion-dom/dist/es/animation/drivers/frame.mjs create mode 100644 node_modules/motion-dom/dist/es/animation/drivers/frame.mjs.map create mode 100644 node_modules/motion-dom/dist/es/animation/generators/inertia.mjs create mode 100644 node_modules/motion-dom/dist/es/animation/generators/inertia.mjs.map create mode 100644 node_modules/motion-dom/dist/es/animation/generators/keyframes.mjs create mode 100644 node_modules/motion-dom/dist/es/animation/generators/keyframes.mjs.map create mode 100644 node_modules/motion-dom/dist/es/animation/generators/spring.mjs create mode 100644 node_modules/motion-dom/dist/es/animation/generators/spring.mjs.map create mode 100644 node_modules/motion-dom/dist/es/animation/generators/utils/calc-duration.mjs create mode 100644 node_modules/motion-dom/dist/es/animation/generators/utils/calc-duration.mjs.map create mode 100644 node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.mjs create mode 100644 node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.mjs.map create mode 100644 node_modules/motion-dom/dist/es/animation/generators/utils/is-generator.mjs create mode 100644 node_modules/motion-dom/dist/es/animation/generators/utils/is-generator.mjs.map create mode 100644 node_modules/motion-dom/dist/es/animation/generators/utils/velocity.mjs create mode 100644 node_modules/motion-dom/dist/es/animation/generators/utils/velocity.mjs.map create mode 100644 node_modules/motion-dom/dist/es/animation/interfaces/motion-value.mjs create mode 100644 node_modules/motion-dom/dist/es/animation/interfaces/motion-value.mjs.map create mode 100644 node_modules/motion-dom/dist/es/animation/interfaces/visual-element-target.mjs create mode 100644 node_modules/motion-dom/dist/es/animation/interfaces/visual-element-target.mjs.map create mode 100644 node_modules/motion-dom/dist/es/animation/interfaces/visual-element-variant.mjs create mode 100644 node_modules/motion-dom/dist/es/animation/interfaces/visual-element-variant.mjs.map create mode 100644 node_modules/motion-dom/dist/es/animation/interfaces/visual-element.mjs create mode 100644 node_modules/motion-dom/dist/es/animation/interfaces/visual-element.mjs.map create mode 100644 node_modules/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.mjs create mode 100644 node_modules/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.mjs.map create mode 100644 node_modules/motion-dom/dist/es/animation/keyframes/KeyframesResolver.mjs create mode 100644 node_modules/motion-dom/dist/es/animation/keyframes/KeyframesResolver.mjs.map create mode 100644 node_modules/motion-dom/dist/es/animation/keyframes/get-final.mjs create mode 100644 node_modules/motion-dom/dist/es/animation/keyframes/get-final.mjs.map create mode 100644 node_modules/motion-dom/dist/es/animation/keyframes/offsets/default.mjs create mode 100644 node_modules/motion-dom/dist/es/animation/keyframes/offsets/default.mjs.map create mode 100644 node_modules/motion-dom/dist/es/animation/keyframes/offsets/fill.mjs create mode 100644 node_modules/motion-dom/dist/es/animation/keyframes/offsets/fill.mjs.map create mode 100644 node_modules/motion-dom/dist/es/animation/keyframes/offsets/time.mjs create mode 100644 node_modules/motion-dom/dist/es/animation/keyframes/offsets/time.mjs.map create mode 100644 node_modules/motion-dom/dist/es/animation/keyframes/utils/apply-px-defaults.mjs create mode 100644 node_modules/motion-dom/dist/es/animation/keyframes/utils/apply-px-defaults.mjs.map create mode 100644 node_modules/motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.mjs create mode 100644 node_modules/motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.mjs.map create mode 100644 node_modules/motion-dom/dist/es/animation/keyframes/utils/is-none.mjs create mode 100644 node_modules/motion-dom/dist/es/animation/keyframes/utils/is-none.mjs.map create mode 100644 node_modules/motion-dom/dist/es/animation/keyframes/utils/make-none-animatable.mjs create mode 100644 node_modules/motion-dom/dist/es/animation/keyframes/utils/make-none-animatable.mjs.map create mode 100644 node_modules/motion-dom/dist/es/animation/keyframes/utils/unit-conversion.mjs create mode 100644 node_modules/motion-dom/dist/es/animation/keyframes/utils/unit-conversion.mjs.map create mode 100644 node_modules/motion-dom/dist/es/animation/optimized-appear/data-id.mjs create mode 100644 node_modules/motion-dom/dist/es/animation/optimized-appear/data-id.mjs.map create mode 100644 node_modules/motion-dom/dist/es/animation/optimized-appear/get-appear-id.mjs create mode 100644 node_modules/motion-dom/dist/es/animation/optimized-appear/get-appear-id.mjs.map create mode 100644 node_modules/motion-dom/dist/es/animation/utils/WithPromise.mjs create mode 100644 node_modules/motion-dom/dist/es/animation/utils/WithPromise.mjs.map create mode 100644 node_modules/motion-dom/dist/es/animation/utils/active-animations.mjs create mode 100644 node_modules/motion-dom/dist/es/animation/utils/active-animations.mjs.map create mode 100644 node_modules/motion-dom/dist/es/animation/utils/arc.mjs create mode 100644 node_modules/motion-dom/dist/es/animation/utils/arc.mjs.map create mode 100644 node_modules/motion-dom/dist/es/animation/utils/calc-child-stagger.mjs create mode 100644 node_modules/motion-dom/dist/es/animation/utils/calc-child-stagger.mjs.map create mode 100644 node_modules/motion-dom/dist/es/animation/utils/can-animate.mjs create mode 100644 node_modules/motion-dom/dist/es/animation/utils/can-animate.mjs.map create mode 100644 node_modules/motion-dom/dist/es/animation/utils/css-variables-conversion.mjs create mode 100644 node_modules/motion-dom/dist/es/animation/utils/css-variables-conversion.mjs.map create mode 100644 node_modules/motion-dom/dist/es/animation/utils/default-transitions.mjs create mode 100644 node_modules/motion-dom/dist/es/animation/utils/default-transitions.mjs.map create mode 100644 node_modules/motion-dom/dist/es/animation/utils/get-value-transition.mjs create mode 100644 node_modules/motion-dom/dist/es/animation/utils/get-value-transition.mjs.map create mode 100644 node_modules/motion-dom/dist/es/animation/utils/is-animatable.mjs create mode 100644 node_modules/motion-dom/dist/es/animation/utils/is-animatable.mjs.map create mode 100644 node_modules/motion-dom/dist/es/animation/utils/is-css-variable.mjs create mode 100644 node_modules/motion-dom/dist/es/animation/utils/is-css-variable.mjs.map create mode 100644 node_modules/motion-dom/dist/es/animation/utils/is-transition-defined.mjs create mode 100644 node_modules/motion-dom/dist/es/animation/utils/is-transition-defined.mjs.map create mode 100644 node_modules/motion-dom/dist/es/animation/utils/make-animation-instant.mjs create mode 100644 node_modules/motion-dom/dist/es/animation/utils/make-animation-instant.mjs.map create mode 100644 node_modules/motion-dom/dist/es/animation/utils/replace-transition-type.mjs create mode 100644 node_modules/motion-dom/dist/es/animation/utils/replace-transition-type.mjs.map create mode 100644 node_modules/motion-dom/dist/es/animation/utils/resolve-transition.mjs create mode 100644 node_modules/motion-dom/dist/es/animation/utils/resolve-transition.mjs.map create mode 100644 node_modules/motion-dom/dist/es/animation/waapi/easing/cubic-bezier.mjs create mode 100644 node_modules/motion-dom/dist/es/animation/waapi/easing/cubic-bezier.mjs.map create mode 100644 node_modules/motion-dom/dist/es/animation/waapi/easing/is-supported.mjs create mode 100644 node_modules/motion-dom/dist/es/animation/waapi/easing/is-supported.mjs.map create mode 100644 node_modules/motion-dom/dist/es/animation/waapi/easing/map-easing.mjs create mode 100644 node_modules/motion-dom/dist/es/animation/waapi/easing/map-easing.mjs.map create mode 100644 node_modules/motion-dom/dist/es/animation/waapi/easing/supported.mjs create mode 100644 node_modules/motion-dom/dist/es/animation/waapi/easing/supported.mjs.map create mode 100644 node_modules/motion-dom/dist/es/animation/waapi/start-waapi-animation.mjs create mode 100644 node_modules/motion-dom/dist/es/animation/waapi/start-waapi-animation.mjs.map create mode 100644 node_modules/motion-dom/dist/es/animation/waapi/supports/partial-keyframes.mjs create mode 100644 node_modules/motion-dom/dist/es/animation/waapi/supports/partial-keyframes.mjs.map create mode 100644 node_modules/motion-dom/dist/es/animation/waapi/supports/waapi.mjs create mode 100644 node_modules/motion-dom/dist/es/animation/waapi/supports/waapi.mjs.map create mode 100644 node_modules/motion-dom/dist/es/animation/waapi/utils/accelerated-values.mjs create mode 100644 node_modules/motion-dom/dist/es/animation/waapi/utils/accelerated-values.mjs.map create mode 100644 node_modules/motion-dom/dist/es/animation/waapi/utils/apply-generator.mjs create mode 100644 node_modules/motion-dom/dist/es/animation/waapi/utils/apply-generator.mjs.map create mode 100644 node_modules/motion-dom/dist/es/animation/waapi/utils/is-browser-color.mjs create mode 100644 node_modules/motion-dom/dist/es/animation/waapi/utils/is-browser-color.mjs.map create mode 100644 node_modules/motion-dom/dist/es/animation/waapi/utils/linear.mjs create mode 100644 node_modules/motion-dom/dist/es/animation/waapi/utils/linear.mjs.map create mode 100644 node_modules/motion-dom/dist/es/animation/waapi/utils/px-values.mjs create mode 100644 node_modules/motion-dom/dist/es/animation/waapi/utils/px-values.mjs.map create mode 100644 node_modules/motion-dom/dist/es/animation/waapi/utils/unsupported-easing.mjs create mode 100644 node_modules/motion-dom/dist/es/animation/waapi/utils/unsupported-easing.mjs.map create mode 100644 node_modules/motion-dom/dist/es/effects/MotionValueState.mjs create mode 100644 node_modules/motion-dom/dist/es/effects/MotionValueState.mjs.map create mode 100644 node_modules/motion-dom/dist/es/effects/attr/index.mjs create mode 100644 node_modules/motion-dom/dist/es/effects/attr/index.mjs.map create mode 100644 node_modules/motion-dom/dist/es/effects/prop/index.mjs create mode 100644 node_modules/motion-dom/dist/es/effects/prop/index.mjs.map create mode 100644 node_modules/motion-dom/dist/es/effects/style/index.mjs create mode 100644 node_modules/motion-dom/dist/es/effects/style/index.mjs.map create mode 100644 node_modules/motion-dom/dist/es/effects/style/transform.mjs create mode 100644 node_modules/motion-dom/dist/es/effects/style/transform.mjs.map create mode 100644 node_modules/motion-dom/dist/es/effects/svg/index.mjs create mode 100644 node_modules/motion-dom/dist/es/effects/svg/index.mjs.map create mode 100644 node_modules/motion-dom/dist/es/effects/utils/create-dom-effect.mjs create mode 100644 node_modules/motion-dom/dist/es/effects/utils/create-dom-effect.mjs.map create mode 100644 node_modules/motion-dom/dist/es/effects/utils/create-effect.mjs create mode 100644 node_modules/motion-dom/dist/es/effects/utils/create-effect.mjs.map create mode 100644 node_modules/motion-dom/dist/es/events/add-dom-event.mjs create mode 100644 node_modules/motion-dom/dist/es/events/add-dom-event.mjs.map create mode 100644 node_modules/motion-dom/dist/es/frameloop/batcher.mjs create mode 100644 node_modules/motion-dom/dist/es/frameloop/batcher.mjs.map create mode 100644 node_modules/motion-dom/dist/es/frameloop/frame.mjs create mode 100644 node_modules/motion-dom/dist/es/frameloop/frame.mjs.map create mode 100644 node_modules/motion-dom/dist/es/frameloop/index-legacy.mjs create mode 100644 node_modules/motion-dom/dist/es/frameloop/index-legacy.mjs.map create mode 100644 node_modules/motion-dom/dist/es/frameloop/microtask.mjs create mode 100644 node_modules/motion-dom/dist/es/frameloop/microtask.mjs.map create mode 100644 node_modules/motion-dom/dist/es/frameloop/order.mjs create mode 100644 node_modules/motion-dom/dist/es/frameloop/order.mjs.map create mode 100644 node_modules/motion-dom/dist/es/frameloop/render-step.mjs create mode 100644 node_modules/motion-dom/dist/es/frameloop/render-step.mjs.map create mode 100644 node_modules/motion-dom/dist/es/frameloop/sync-time.mjs create mode 100644 node_modules/motion-dom/dist/es/frameloop/sync-time.mjs.map create mode 100644 node_modules/motion-dom/dist/es/gestures/drag/state/is-active.mjs create mode 100644 node_modules/motion-dom/dist/es/gestures/drag/state/is-active.mjs.map create mode 100644 node_modules/motion-dom/dist/es/gestures/drag/state/set-active.mjs create mode 100644 node_modules/motion-dom/dist/es/gestures/drag/state/set-active.mjs.map create mode 100644 node_modules/motion-dom/dist/es/gestures/hover.mjs create mode 100644 node_modules/motion-dom/dist/es/gestures/hover.mjs.map create mode 100644 node_modules/motion-dom/dist/es/gestures/press/index.mjs create mode 100644 node_modules/motion-dom/dist/es/gestures/press/index.mjs.map create mode 100644 node_modules/motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.mjs create mode 100644 node_modules/motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.mjs.map create mode 100644 node_modules/motion-dom/dist/es/gestures/press/utils/keyboard.mjs create mode 100644 node_modules/motion-dom/dist/es/gestures/press/utils/keyboard.mjs.map create mode 100644 node_modules/motion-dom/dist/es/gestures/press/utils/state.mjs create mode 100644 node_modules/motion-dom/dist/es/gestures/press/utils/state.mjs.map create mode 100644 node_modules/motion-dom/dist/es/gestures/utils/is-node-or-child.mjs create mode 100644 node_modules/motion-dom/dist/es/gestures/utils/is-node-or-child.mjs.map create mode 100644 node_modules/motion-dom/dist/es/gestures/utils/is-primary-pointer.mjs create mode 100644 node_modules/motion-dom/dist/es/gestures/utils/is-primary-pointer.mjs.map create mode 100644 node_modules/motion-dom/dist/es/gestures/utils/setup.mjs create mode 100644 node_modules/motion-dom/dist/es/gestures/utils/setup.mjs.map create mode 100644 node_modules/motion-dom/dist/es/index.mjs create mode 100644 node_modules/motion-dom/dist/es/index.mjs.map create mode 100644 node_modules/motion-dom/dist/es/layout/LayoutAnimationBuilder.mjs create mode 100644 node_modules/motion-dom/dist/es/layout/LayoutAnimationBuilder.mjs.map create mode 100644 node_modules/motion-dom/dist/es/projection/animation/mix-values.mjs create mode 100644 node_modules/motion-dom/dist/es/projection/animation/mix-values.mjs.map create mode 100644 node_modules/motion-dom/dist/es/projection/geometry/conversion.mjs create mode 100644 node_modules/motion-dom/dist/es/projection/geometry/conversion.mjs.map create mode 100644 node_modules/motion-dom/dist/es/projection/geometry/copy.mjs create mode 100644 node_modules/motion-dom/dist/es/projection/geometry/copy.mjs.map create mode 100644 node_modules/motion-dom/dist/es/projection/geometry/delta-apply.mjs create mode 100644 node_modules/motion-dom/dist/es/projection/geometry/delta-apply.mjs.map create mode 100644 node_modules/motion-dom/dist/es/projection/geometry/delta-calc.mjs create mode 100644 node_modules/motion-dom/dist/es/projection/geometry/delta-calc.mjs.map create mode 100644 node_modules/motion-dom/dist/es/projection/geometry/delta-remove.mjs create mode 100644 node_modules/motion-dom/dist/es/projection/geometry/delta-remove.mjs.map create mode 100644 node_modules/motion-dom/dist/es/projection/geometry/models.mjs create mode 100644 node_modules/motion-dom/dist/es/projection/geometry/models.mjs.map create mode 100644 node_modules/motion-dom/dist/es/projection/geometry/utils.mjs create mode 100644 node_modules/motion-dom/dist/es/projection/geometry/utils.mjs.map create mode 100644 node_modules/motion-dom/dist/es/projection/node/DocumentProjectionNode.mjs create mode 100644 node_modules/motion-dom/dist/es/projection/node/DocumentProjectionNode.mjs.map create mode 100644 node_modules/motion-dom/dist/es/projection/node/HTMLProjectionNode.mjs create mode 100644 node_modules/motion-dom/dist/es/projection/node/HTMLProjectionNode.mjs.map create mode 100644 node_modules/motion-dom/dist/es/projection/node/create-projection-node.mjs create mode 100644 node_modules/motion-dom/dist/es/projection/node/create-projection-node.mjs.map create mode 100644 node_modules/motion-dom/dist/es/projection/node/group.mjs create mode 100644 node_modules/motion-dom/dist/es/projection/node/group.mjs.map create mode 100644 node_modules/motion-dom/dist/es/projection/node/state.mjs create mode 100644 node_modules/motion-dom/dist/es/projection/node/state.mjs.map create mode 100644 node_modules/motion-dom/dist/es/projection/shared/stack.mjs create mode 100644 node_modules/motion-dom/dist/es/projection/shared/stack.mjs.map create mode 100644 node_modules/motion-dom/dist/es/projection/styles/scale-border-radius.mjs create mode 100644 node_modules/motion-dom/dist/es/projection/styles/scale-border-radius.mjs.map create mode 100644 node_modules/motion-dom/dist/es/projection/styles/scale-box-shadow.mjs create mode 100644 node_modules/motion-dom/dist/es/projection/styles/scale-box-shadow.mjs.map create mode 100644 node_modules/motion-dom/dist/es/projection/styles/scale-correction.mjs create mode 100644 node_modules/motion-dom/dist/es/projection/styles/scale-correction.mjs.map create mode 100644 node_modules/motion-dom/dist/es/projection/styles/transform.mjs create mode 100644 node_modules/motion-dom/dist/es/projection/styles/transform.mjs.map create mode 100644 node_modules/motion-dom/dist/es/projection/utils/compare-by-depth.mjs create mode 100644 node_modules/motion-dom/dist/es/projection/utils/compare-by-depth.mjs.map create mode 100644 node_modules/motion-dom/dist/es/projection/utils/each-axis.mjs create mode 100644 node_modules/motion-dom/dist/es/projection/utils/each-axis.mjs.map create mode 100644 node_modules/motion-dom/dist/es/projection/utils/flat-tree.mjs create mode 100644 node_modules/motion-dom/dist/es/projection/utils/flat-tree.mjs.map create mode 100644 node_modules/motion-dom/dist/es/projection/utils/has-transform.mjs create mode 100644 node_modules/motion-dom/dist/es/projection/utils/has-transform.mjs.map create mode 100644 node_modules/motion-dom/dist/es/projection/utils/measure.mjs create mode 100644 node_modules/motion-dom/dist/es/projection/utils/measure.mjs.map create mode 100644 node_modules/motion-dom/dist/es/render/Feature.mjs create mode 100644 node_modules/motion-dom/dist/es/render/Feature.mjs.map create mode 100644 node_modules/motion-dom/dist/es/render/VisualElement.mjs create mode 100644 node_modules/motion-dom/dist/es/render/VisualElement.mjs.map create mode 100644 node_modules/motion-dom/dist/es/render/dom/DOMVisualElement.mjs create mode 100644 node_modules/motion-dom/dist/es/render/dom/DOMVisualElement.mjs.map create mode 100644 node_modules/motion-dom/dist/es/render/dom/is-css-var.mjs create mode 100644 node_modules/motion-dom/dist/es/render/dom/is-css-var.mjs.map create mode 100644 node_modules/motion-dom/dist/es/render/dom/parse-transform.mjs create mode 100644 node_modules/motion-dom/dist/es/render/dom/parse-transform.mjs.map create mode 100644 node_modules/motion-dom/dist/es/render/dom/style-computed.mjs create mode 100644 node_modules/motion-dom/dist/es/render/dom/style-computed.mjs.map create mode 100644 node_modules/motion-dom/dist/es/render/dom/style-set.mjs create mode 100644 node_modules/motion-dom/dist/es/render/dom/style-set.mjs.map create mode 100644 node_modules/motion-dom/dist/es/render/dom/utils/camel-to-dash.mjs create mode 100644 node_modules/motion-dom/dist/es/render/dom/utils/camel-to-dash.mjs.map create mode 100644 node_modules/motion-dom/dist/es/render/html/HTMLVisualElement.mjs create mode 100644 node_modules/motion-dom/dist/es/render/html/HTMLVisualElement.mjs.map create mode 100644 node_modules/motion-dom/dist/es/render/html/utils/build-styles.mjs create mode 100644 node_modules/motion-dom/dist/es/render/html/utils/build-styles.mjs.map create mode 100644 node_modules/motion-dom/dist/es/render/html/utils/build-transform.mjs create mode 100644 node_modules/motion-dom/dist/es/render/html/utils/build-transform.mjs.map create mode 100644 node_modules/motion-dom/dist/es/render/html/utils/render.mjs create mode 100644 node_modules/motion-dom/dist/es/render/html/utils/render.mjs.map create mode 100644 node_modules/motion-dom/dist/es/render/html/utils/scrape-motion-values.mjs create mode 100644 node_modules/motion-dom/dist/es/render/html/utils/scrape-motion-values.mjs.map create mode 100644 node_modules/motion-dom/dist/es/render/object/ObjectVisualElement.mjs create mode 100644 node_modules/motion-dom/dist/es/render/object/ObjectVisualElement.mjs.map create mode 100644 node_modules/motion-dom/dist/es/render/store.mjs create mode 100644 node_modules/motion-dom/dist/es/render/store.mjs.map create mode 100644 node_modules/motion-dom/dist/es/render/svg/SVGVisualElement.mjs create mode 100644 node_modules/motion-dom/dist/es/render/svg/SVGVisualElement.mjs.map create mode 100644 node_modules/motion-dom/dist/es/render/svg/utils/build-attrs.mjs create mode 100644 node_modules/motion-dom/dist/es/render/svg/utils/build-attrs.mjs.map create mode 100644 node_modules/motion-dom/dist/es/render/svg/utils/camel-case-attrs.mjs create mode 100644 node_modules/motion-dom/dist/es/render/svg/utils/camel-case-attrs.mjs.map create mode 100644 node_modules/motion-dom/dist/es/render/svg/utils/is-svg-tag.mjs create mode 100644 node_modules/motion-dom/dist/es/render/svg/utils/is-svg-tag.mjs.map create mode 100644 node_modules/motion-dom/dist/es/render/svg/utils/path.mjs create mode 100644 node_modules/motion-dom/dist/es/render/svg/utils/path.mjs.map create mode 100644 node_modules/motion-dom/dist/es/render/svg/utils/render.mjs create mode 100644 node_modules/motion-dom/dist/es/render/svg/utils/render.mjs.map create mode 100644 node_modules/motion-dom/dist/es/render/svg/utils/scrape-motion-values.mjs create mode 100644 node_modules/motion-dom/dist/es/render/svg/utils/scrape-motion-values.mjs.map create mode 100644 node_modules/motion-dom/dist/es/render/utils/animation-state.mjs create mode 100644 node_modules/motion-dom/dist/es/render/utils/animation-state.mjs.map create mode 100644 node_modules/motion-dom/dist/es/render/utils/get-variant-context.mjs create mode 100644 node_modules/motion-dom/dist/es/render/utils/get-variant-context.mjs.map create mode 100644 node_modules/motion-dom/dist/es/render/utils/is-animation-controls.mjs create mode 100644 node_modules/motion-dom/dist/es/render/utils/is-animation-controls.mjs.map create mode 100644 node_modules/motion-dom/dist/es/render/utils/is-controlling-variants.mjs create mode 100644 node_modules/motion-dom/dist/es/render/utils/is-controlling-variants.mjs.map create mode 100644 node_modules/motion-dom/dist/es/render/utils/is-forced-motion-value.mjs create mode 100644 node_modules/motion-dom/dist/es/render/utils/is-forced-motion-value.mjs.map create mode 100644 node_modules/motion-dom/dist/es/render/utils/is-keyframes-target.mjs create mode 100644 node_modules/motion-dom/dist/es/render/utils/is-keyframes-target.mjs.map create mode 100644 node_modules/motion-dom/dist/es/render/utils/is-variant-label.mjs create mode 100644 node_modules/motion-dom/dist/es/render/utils/is-variant-label.mjs.map create mode 100644 node_modules/motion-dom/dist/es/render/utils/keys-position.mjs create mode 100644 node_modules/motion-dom/dist/es/render/utils/keys-position.mjs.map create mode 100644 node_modules/motion-dom/dist/es/render/utils/keys-transform.mjs create mode 100644 node_modules/motion-dom/dist/es/render/utils/keys-transform.mjs.map create mode 100644 node_modules/motion-dom/dist/es/render/utils/motion-values.mjs create mode 100644 node_modules/motion-dom/dist/es/render/utils/motion-values.mjs.map create mode 100644 node_modules/motion-dom/dist/es/render/utils/reduced-motion/index.mjs create mode 100644 node_modules/motion-dom/dist/es/render/utils/reduced-motion/index.mjs.map create mode 100644 node_modules/motion-dom/dist/es/render/utils/reduced-motion/state.mjs create mode 100644 node_modules/motion-dom/dist/es/render/utils/reduced-motion/state.mjs.map create mode 100644 node_modules/motion-dom/dist/es/render/utils/resolve-dynamic-variants.mjs create mode 100644 node_modules/motion-dom/dist/es/render/utils/resolve-dynamic-variants.mjs.map create mode 100644 node_modules/motion-dom/dist/es/render/utils/resolve-variants.mjs create mode 100644 node_modules/motion-dom/dist/es/render/utils/resolve-variants.mjs.map create mode 100644 node_modules/motion-dom/dist/es/render/utils/setters.mjs create mode 100644 node_modules/motion-dom/dist/es/render/utils/setters.mjs.map create mode 100644 node_modules/motion-dom/dist/es/render/utils/shallow-compare.mjs create mode 100644 node_modules/motion-dom/dist/es/render/utils/shallow-compare.mjs.map create mode 100644 node_modules/motion-dom/dist/es/render/utils/variant-props.mjs create mode 100644 node_modules/motion-dom/dist/es/render/utils/variant-props.mjs.map create mode 100644 node_modules/motion-dom/dist/es/resize/handle-element.mjs create mode 100644 node_modules/motion-dom/dist/es/resize/handle-element.mjs.map create mode 100644 node_modules/motion-dom/dist/es/resize/handle-window.mjs create mode 100644 node_modules/motion-dom/dist/es/resize/handle-window.mjs.map create mode 100644 node_modules/motion-dom/dist/es/resize/index.mjs create mode 100644 node_modules/motion-dom/dist/es/resize/index.mjs.map create mode 100644 node_modules/motion-dom/dist/es/scroll/observe.mjs create mode 100644 node_modules/motion-dom/dist/es/scroll/observe.mjs.map create mode 100644 node_modules/motion-dom/dist/es/stats/buffer.mjs create mode 100644 node_modules/motion-dom/dist/es/stats/buffer.mjs.map create mode 100644 node_modules/motion-dom/dist/es/stats/index.mjs create mode 100644 node_modules/motion-dom/dist/es/stats/index.mjs.map create mode 100644 node_modules/motion-dom/dist/es/utils/border-radius.mjs create mode 100644 node_modules/motion-dom/dist/es/utils/border-radius.mjs.map create mode 100644 node_modules/motion-dom/dist/es/utils/delay.mjs create mode 100644 node_modules/motion-dom/dist/es/utils/delay.mjs.map create mode 100644 node_modules/motion-dom/dist/es/utils/interpolate.mjs create mode 100644 node_modules/motion-dom/dist/es/utils/interpolate.mjs.map create mode 100644 node_modules/motion-dom/dist/es/utils/is-html-element.mjs create mode 100644 node_modules/motion-dom/dist/es/utils/is-html-element.mjs.map create mode 100644 node_modules/motion-dom/dist/es/utils/is-svg-element.mjs create mode 100644 node_modules/motion-dom/dist/es/utils/is-svg-element.mjs.map create mode 100644 node_modules/motion-dom/dist/es/utils/is-svg-svg-element.mjs create mode 100644 node_modules/motion-dom/dist/es/utils/is-svg-svg-element.mjs.map create mode 100644 node_modules/motion-dom/dist/es/utils/mix/color.mjs create mode 100644 node_modules/motion-dom/dist/es/utils/mix/color.mjs.map create mode 100644 node_modules/motion-dom/dist/es/utils/mix/complex.mjs create mode 100644 node_modules/motion-dom/dist/es/utils/mix/complex.mjs.map create mode 100644 node_modules/motion-dom/dist/es/utils/mix/immediate.mjs create mode 100644 node_modules/motion-dom/dist/es/utils/mix/immediate.mjs.map create mode 100644 node_modules/motion-dom/dist/es/utils/mix/index.mjs create mode 100644 node_modules/motion-dom/dist/es/utils/mix/index.mjs.map create mode 100644 node_modules/motion-dom/dist/es/utils/mix/number.mjs create mode 100644 node_modules/motion-dom/dist/es/utils/mix/number.mjs.map create mode 100644 node_modules/motion-dom/dist/es/utils/mix/visibility.mjs create mode 100644 node_modules/motion-dom/dist/es/utils/mix/visibility.mjs.map create mode 100644 node_modules/motion-dom/dist/es/utils/resolve-elements.mjs create mode 100644 node_modules/motion-dom/dist/es/utils/resolve-elements.mjs.map create mode 100644 node_modules/motion-dom/dist/es/utils/stagger.mjs create mode 100644 node_modules/motion-dom/dist/es/utils/stagger.mjs.map create mode 100644 node_modules/motion-dom/dist/es/utils/supports/flags.mjs create mode 100644 node_modules/motion-dom/dist/es/utils/supports/flags.mjs.map create mode 100644 node_modules/motion-dom/dist/es/utils/supports/linear-easing.mjs create mode 100644 node_modules/motion-dom/dist/es/utils/supports/linear-easing.mjs.map create mode 100644 node_modules/motion-dom/dist/es/utils/supports/memo.mjs create mode 100644 node_modules/motion-dom/dist/es/utils/supports/memo.mjs.map create mode 100644 node_modules/motion-dom/dist/es/utils/supports/scroll-timeline.mjs create mode 100644 node_modules/motion-dom/dist/es/utils/supports/scroll-timeline.mjs.map create mode 100644 node_modules/motion-dom/dist/es/utils/transform.mjs create mode 100644 node_modules/motion-dom/dist/es/utils/transform.mjs.map create mode 100644 node_modules/motion-dom/dist/es/value/follow-value.mjs create mode 100644 node_modules/motion-dom/dist/es/value/follow-value.mjs.map create mode 100644 node_modules/motion-dom/dist/es/value/index.mjs create mode 100644 node_modules/motion-dom/dist/es/value/index.mjs.map create mode 100644 node_modules/motion-dom/dist/es/value/map-value.mjs create mode 100644 node_modules/motion-dom/dist/es/value/map-value.mjs.map create mode 100644 node_modules/motion-dom/dist/es/value/spring-value.mjs create mode 100644 node_modules/motion-dom/dist/es/value/spring-value.mjs.map create mode 100644 node_modules/motion-dom/dist/es/value/subscribe-value.mjs create mode 100644 node_modules/motion-dom/dist/es/value/subscribe-value.mjs.map create mode 100644 node_modules/motion-dom/dist/es/value/transform-value.mjs create mode 100644 node_modules/motion-dom/dist/es/value/transform-value.mjs.map create mode 100644 node_modules/motion-dom/dist/es/value/types/auto.mjs create mode 100644 node_modules/motion-dom/dist/es/value/types/auto.mjs.map create mode 100644 node_modules/motion-dom/dist/es/value/types/color/hex.mjs create mode 100644 node_modules/motion-dom/dist/es/value/types/color/hex.mjs.map create mode 100644 node_modules/motion-dom/dist/es/value/types/color/hsla-to-rgba.mjs create mode 100644 node_modules/motion-dom/dist/es/value/types/color/hsla-to-rgba.mjs.map create mode 100644 node_modules/motion-dom/dist/es/value/types/color/hsla.mjs create mode 100644 node_modules/motion-dom/dist/es/value/types/color/hsla.mjs.map create mode 100644 node_modules/motion-dom/dist/es/value/types/color/index.mjs create mode 100644 node_modules/motion-dom/dist/es/value/types/color/index.mjs.map create mode 100644 node_modules/motion-dom/dist/es/value/types/color/rgba.mjs create mode 100644 node_modules/motion-dom/dist/es/value/types/color/rgba.mjs.map create mode 100644 node_modules/motion-dom/dist/es/value/types/color/utils.mjs create mode 100644 node_modules/motion-dom/dist/es/value/types/color/utils.mjs.map create mode 100644 node_modules/motion-dom/dist/es/value/types/complex/filter.mjs create mode 100644 node_modules/motion-dom/dist/es/value/types/complex/filter.mjs.map create mode 100644 node_modules/motion-dom/dist/es/value/types/complex/index.mjs create mode 100644 node_modules/motion-dom/dist/es/value/types/complex/index.mjs.map create mode 100644 node_modules/motion-dom/dist/es/value/types/complex/mask.mjs create mode 100644 node_modules/motion-dom/dist/es/value/types/complex/mask.mjs.map create mode 100644 node_modules/motion-dom/dist/es/value/types/dimensions.mjs create mode 100644 node_modules/motion-dom/dist/es/value/types/dimensions.mjs.map create mode 100644 node_modules/motion-dom/dist/es/value/types/int.mjs create mode 100644 node_modules/motion-dom/dist/es/value/types/int.mjs.map create mode 100644 node_modules/motion-dom/dist/es/value/types/maps/defaults.mjs create mode 100644 node_modules/motion-dom/dist/es/value/types/maps/defaults.mjs.map create mode 100644 node_modules/motion-dom/dist/es/value/types/maps/number.mjs create mode 100644 node_modules/motion-dom/dist/es/value/types/maps/number.mjs.map create mode 100644 node_modules/motion-dom/dist/es/value/types/maps/transform.mjs create mode 100644 node_modules/motion-dom/dist/es/value/types/maps/transform.mjs.map create mode 100644 node_modules/motion-dom/dist/es/value/types/numbers/index.mjs create mode 100644 node_modules/motion-dom/dist/es/value/types/numbers/index.mjs.map create mode 100644 node_modules/motion-dom/dist/es/value/types/numbers/units.mjs create mode 100644 node_modules/motion-dom/dist/es/value/types/numbers/units.mjs.map create mode 100644 node_modules/motion-dom/dist/es/value/types/test.mjs create mode 100644 node_modules/motion-dom/dist/es/value/types/test.mjs.map create mode 100644 node_modules/motion-dom/dist/es/value/types/utils/animatable-none.mjs create mode 100644 node_modules/motion-dom/dist/es/value/types/utils/animatable-none.mjs.map create mode 100644 node_modules/motion-dom/dist/es/value/types/utils/color-regex.mjs create mode 100644 node_modules/motion-dom/dist/es/value/types/utils/color-regex.mjs.map create mode 100644 node_modules/motion-dom/dist/es/value/types/utils/find.mjs create mode 100644 node_modules/motion-dom/dist/es/value/types/utils/find.mjs.map create mode 100644 node_modules/motion-dom/dist/es/value/types/utils/float-regex.mjs create mode 100644 node_modules/motion-dom/dist/es/value/types/utils/float-regex.mjs.map create mode 100644 node_modules/motion-dom/dist/es/value/types/utils/get-as-type.mjs create mode 100644 node_modules/motion-dom/dist/es/value/types/utils/get-as-type.mjs.map create mode 100644 node_modules/motion-dom/dist/es/value/types/utils/is-nullish.mjs create mode 100644 node_modules/motion-dom/dist/es/value/types/utils/is-nullish.mjs.map create mode 100644 node_modules/motion-dom/dist/es/value/types/utils/sanitize.mjs create mode 100644 node_modules/motion-dom/dist/es/value/types/utils/sanitize.mjs.map create mode 100644 node_modules/motion-dom/dist/es/value/types/utils/single-color-regex.mjs create mode 100644 node_modules/motion-dom/dist/es/value/types/utils/single-color-regex.mjs.map create mode 100644 node_modules/motion-dom/dist/es/value/utils/is-motion-value.mjs create mode 100644 node_modules/motion-dom/dist/es/value/utils/is-motion-value.mjs.map create mode 100644 node_modules/motion-dom/dist/es/value/utils/resolve-motion-value.mjs create mode 100644 node_modules/motion-dom/dist/es/value/utils/resolve-motion-value.mjs.map create mode 100644 node_modules/motion-dom/dist/es/value/will-change/add-will-change.mjs create mode 100644 node_modules/motion-dom/dist/es/value/will-change/add-will-change.mjs.map create mode 100644 node_modules/motion-dom/dist/es/value/will-change/is.mjs create mode 100644 node_modules/motion-dom/dist/es/value/will-change/is.mjs.map create mode 100644 node_modules/motion-dom/dist/es/view/index.mjs create mode 100644 node_modules/motion-dom/dist/es/view/index.mjs.map create mode 100644 node_modules/motion-dom/dist/es/view/queue.mjs create mode 100644 node_modules/motion-dom/dist/es/view/queue.mjs.map create mode 100644 node_modules/motion-dom/dist/es/view/start.mjs create mode 100644 node_modules/motion-dom/dist/es/view/start.mjs.map create mode 100644 node_modules/motion-dom/dist/es/view/utils/assign-names.mjs create mode 100644 node_modules/motion-dom/dist/es/view/utils/assign-names.mjs.map create mode 100644 node_modules/motion-dom/dist/es/view/utils/choose-layer-type.mjs create mode 100644 node_modules/motion-dom/dist/es/view/utils/choose-layer-type.mjs.map create mode 100644 node_modules/motion-dom/dist/es/view/utils/css.mjs create mode 100644 node_modules/motion-dom/dist/es/view/utils/css.mjs.map create mode 100644 node_modules/motion-dom/dist/es/view/utils/get-layer-info.mjs create mode 100644 node_modules/motion-dom/dist/es/view/utils/get-layer-info.mjs.map create mode 100644 node_modules/motion-dom/dist/es/view/utils/get-view-animations.mjs create mode 100644 node_modules/motion-dom/dist/es/view/utils/get-view-animations.mjs.map create mode 100644 node_modules/motion-dom/dist/es/view/utils/has-target.mjs create mode 100644 node_modules/motion-dom/dist/es/view/utils/has-target.mjs.map create mode 100644 node_modules/motion-dom/dist/index.d.ts create mode 100644 node_modules/motion-dom/dist/motion-dom.dev.js create mode 100644 node_modules/motion-dom/dist/motion-dom.js create mode 100644 node_modules/motion-dom/dist/size-rollup-motion-value.js create mode 100644 node_modules/motion-dom/dist/size-rollup-motion-value.js.map create mode 100644 node_modules/motion-dom/dist/size-rollup-style-effect.js create mode 100644 node_modules/motion-dom/dist/size-rollup-style-effect.js.map create mode 100644 node_modules/motion-dom/package.json create mode 100644 node_modules/motion-utils/LICENSE.md create mode 100644 node_modules/motion-utils/dist/cjs/index.js create mode 100644 node_modules/motion-utils/dist/cjs/index.js.map create mode 100644 node_modules/motion-utils/dist/es/array.mjs create mode 100644 node_modules/motion-utils/dist/es/array.mjs.map create mode 100644 node_modules/motion-utils/dist/es/clamp.mjs create mode 100644 node_modules/motion-utils/dist/es/clamp.mjs.map create mode 100644 node_modules/motion-utils/dist/es/easing/anticipate.mjs create mode 100644 node_modules/motion-utils/dist/es/easing/anticipate.mjs.map create mode 100644 node_modules/motion-utils/dist/es/easing/back.mjs create mode 100644 node_modules/motion-utils/dist/es/easing/back.mjs.map create mode 100644 node_modules/motion-utils/dist/es/easing/circ.mjs create mode 100644 node_modules/motion-utils/dist/es/easing/circ.mjs.map create mode 100644 node_modules/motion-utils/dist/es/easing/cubic-bezier.mjs create mode 100644 node_modules/motion-utils/dist/es/easing/cubic-bezier.mjs.map create mode 100644 node_modules/motion-utils/dist/es/easing/ease.mjs create mode 100644 node_modules/motion-utils/dist/es/easing/ease.mjs.map create mode 100644 node_modules/motion-utils/dist/es/easing/modifiers/mirror.mjs create mode 100644 node_modules/motion-utils/dist/es/easing/modifiers/mirror.mjs.map create mode 100644 node_modules/motion-utils/dist/es/easing/modifiers/reverse.mjs create mode 100644 node_modules/motion-utils/dist/es/easing/modifiers/reverse.mjs.map create mode 100644 node_modules/motion-utils/dist/es/easing/steps.mjs create mode 100644 node_modules/motion-utils/dist/es/easing/steps.mjs.map create mode 100644 node_modules/motion-utils/dist/es/easing/utils/get-easing-for-segment.mjs create mode 100644 node_modules/motion-utils/dist/es/easing/utils/get-easing-for-segment.mjs.map create mode 100644 node_modules/motion-utils/dist/es/easing/utils/is-bezier-definition.mjs create mode 100644 node_modules/motion-utils/dist/es/easing/utils/is-bezier-definition.mjs.map create mode 100644 node_modules/motion-utils/dist/es/easing/utils/is-easing-array.mjs create mode 100644 node_modules/motion-utils/dist/es/easing/utils/is-easing-array.mjs.map create mode 100644 node_modules/motion-utils/dist/es/easing/utils/map.mjs create mode 100644 node_modules/motion-utils/dist/es/easing/utils/map.mjs.map create mode 100644 node_modules/motion-utils/dist/es/errors.mjs create mode 100644 node_modules/motion-utils/dist/es/errors.mjs.map create mode 100644 node_modules/motion-utils/dist/es/format-error-message.mjs create mode 100644 node_modules/motion-utils/dist/es/format-error-message.mjs.map create mode 100644 node_modules/motion-utils/dist/es/global-config.mjs create mode 100644 node_modules/motion-utils/dist/es/global-config.mjs.map create mode 100644 node_modules/motion-utils/dist/es/index.mjs create mode 100644 node_modules/motion-utils/dist/es/index.mjs.map create mode 100644 node_modules/motion-utils/dist/es/is-numerical-string.mjs create mode 100644 node_modules/motion-utils/dist/es/is-numerical-string.mjs.map create mode 100644 node_modules/motion-utils/dist/es/is-object.mjs create mode 100644 node_modules/motion-utils/dist/es/is-object.mjs.map create mode 100644 node_modules/motion-utils/dist/es/is-zero-value-string.mjs create mode 100644 node_modules/motion-utils/dist/es/is-zero-value-string.mjs.map create mode 100644 node_modules/motion-utils/dist/es/memo.mjs create mode 100644 node_modules/motion-utils/dist/es/memo.mjs.map create mode 100644 node_modules/motion-utils/dist/es/noop.mjs create mode 100644 node_modules/motion-utils/dist/es/noop.mjs.map create mode 100644 node_modules/motion-utils/dist/es/pipe.mjs create mode 100644 node_modules/motion-utils/dist/es/pipe.mjs.map create mode 100644 node_modules/motion-utils/dist/es/progress.mjs create mode 100644 node_modules/motion-utils/dist/es/progress.mjs.map create mode 100644 node_modules/motion-utils/dist/es/subscription-manager.mjs create mode 100644 node_modules/motion-utils/dist/es/subscription-manager.mjs.map create mode 100644 node_modules/motion-utils/dist/es/time-conversion.mjs create mode 100644 node_modules/motion-utils/dist/es/time-conversion.mjs.map create mode 100644 node_modules/motion-utils/dist/es/velocity-per-second.mjs create mode 100644 node_modules/motion-utils/dist/es/velocity-per-second.mjs.map create mode 100644 node_modules/motion-utils/dist/es/warn-once.mjs create mode 100644 node_modules/motion-utils/dist/es/warn-once.mjs.map create mode 100644 node_modules/motion-utils/dist/es/wrap.mjs create mode 100644 node_modules/motion-utils/dist/es/wrap.mjs.map create mode 100644 node_modules/motion-utils/dist/index.d.ts create mode 100644 node_modules/motion-utils/dist/motion-utils.dev.js create mode 100644 node_modules/motion-utils/dist/motion-utils.js create mode 100644 node_modules/motion-utils/package.json create mode 100644 node_modules/motion/LICENSE.md create mode 100644 node_modules/motion/README.md create mode 100644 node_modules/motion/dist/cjs/debug.js create mode 100644 node_modules/motion/dist/cjs/index.js create mode 100644 node_modules/motion/dist/cjs/mini.js create mode 100644 node_modules/motion/dist/cjs/react-client.js create mode 100644 node_modules/motion/dist/cjs/react-m.js create mode 100644 node_modules/motion/dist/cjs/react-mini.js create mode 100644 node_modules/motion/dist/cjs/react.js create mode 100644 node_modules/motion/dist/debug.d.ts create mode 100644 node_modules/motion/dist/es/debug.mjs create mode 100644 node_modules/motion/dist/es/index.mjs create mode 100644 node_modules/motion/dist/es/mini.mjs create mode 100644 node_modules/motion/dist/es/react-client.mjs create mode 100644 node_modules/motion/dist/es/react-m.mjs create mode 100644 node_modules/motion/dist/es/react-mini.mjs create mode 100644 node_modules/motion/dist/es/react.mjs create mode 100644 node_modules/motion/dist/index.d.ts create mode 100644 node_modules/motion/dist/mini.d.ts create mode 100644 node_modules/motion/dist/motion.dev.js create mode 100644 node_modules/motion/dist/motion.js create mode 100644 node_modules/motion/dist/react-client.d.ts create mode 100644 node_modules/motion/dist/react-m.d.ts create mode 100644 node_modules/motion/dist/react-mini.d.ts create mode 100644 node_modules/motion/dist/react.d.ts create mode 100644 node_modules/motion/mini/package.json create mode 100644 node_modules/motion/package.json create mode 100644 node_modules/motion/react-client/package.json create mode 100644 node_modules/motion/react-m/package.json create mode 100644 node_modules/motion/react/package.json create mode 100644 node_modules/tslib/CopyrightNotice.txt create mode 100644 node_modules/tslib/LICENSE.txt create mode 100644 node_modules/tslib/README.md create mode 100644 node_modules/tslib/SECURITY.md create mode 100644 node_modules/tslib/modules/index.d.ts create mode 100644 node_modules/tslib/modules/index.js create mode 100644 node_modules/tslib/modules/package.json create mode 100644 node_modules/tslib/package.json create mode 100644 node_modules/tslib/tslib.d.ts create mode 100644 node_modules/tslib/tslib.es6.html create mode 100644 node_modules/tslib/tslib.es6.js create mode 100644 node_modules/tslib/tslib.es6.mjs create mode 100644 node_modules/tslib/tslib.html create mode 100644 node_modules/tslib/tslib.js create mode 100644 package-lock.json create mode 100644 package.json diff --git a/devjams/app/layout.tsx b/devjams/app/layout.tsx index 2e7fa86..6e3dfac 100644 --- a/devjams/app/layout.tsx +++ b/devjams/app/layout.tsx @@ -59,8 +59,12 @@ export default function RootLayout({ - + {children} diff --git a/devjams/app/page.tsx b/devjams/app/page.tsx index 14831e5..184de4e 100644 --- a/devjams/app/page.tsx +++ b/devjams/app/page.tsx @@ -1,149 +1,24 @@ "use client"; -import Image from "next/image"; -import { motion } from "motion/react"; +import { Hero } from "../components/sections/Hero"; +import { Tracks } from "../components/sections/Tracks"; +import { PreviousEvents } from "../components/sections/PreviousEvents"; +import { GotQuestions } from "../components/sections/GotQuestions"; export default function Home() { - const logoLetters = [ - { src: "/assets/logo/D.svg", alt: "D", left: -0.25, top: 8.53, width: 138.68, height: 162.3, zIndex: 10 }, - { src: "/assets/logo/e.svg", alt: "e", left: 114.1, top: 47.96, width: 116.46, height: 122.94, zIndex: 9 }, - { src: "/assets/logo/v.svg", alt: "v", left: 193.51, top: 55.68, width: 127.8, height: 115.3, zIndex: 8 }, - { src: "/assets/logo/J.svg", alt: "J", left: 271.25, top: 4.66, width: 106.5, height: 166.23, zIndex: 7 }, - { src: "/assets/logo/a.svg", alt: "a", left: 353.18, top: 47.52, width: 106.04, height: 122.94, zIndex: 6 }, - { src: "/assets/logo/m.svg", alt: "m", left: 448.28, top: 51.62, width: 178.27, height: 119.23, zIndex: 5 }, - { src: "/assets/logo/s.svg", alt: "s", left: 607.61, top: 47.96, width: 101.41, height: 122.94, zIndex: 4 }, - { src: "/assets/logo/'.svg", alt: "'", left: 724.43, top: 1.98, width: 41.39, height: 54.74, zIndex: 3 }, - { src: "/assets/logo/2.svg", alt: "2", left: 773.45, top: 4.66, width: 104.42, height: 166.23, zIndex: 2 }, - { src: "/assets/logo/6.svg", alt: "6", left: 844.59, top: 0, width: 110.67, height: 170.86, zIndex: 1 }, - ]; - - const trackIcons = [ - { src: "/assets/android.svg", alt: "Android Track", width: 260, height: 159, className: "w-[210px] sm:w-[260px] -mr-8 sm:-mr-12 z-10" }, - { src: "/assets/web.svg", alt: "Web Track", width: 288, height: 288, className: "w-[220px] sm:w-[280px] -mr-8 sm:-mr-12 z-20" }, - { src: "/assets/gemini.svg", alt: "Gemini Track", width: 301, height: 301, className: "w-[230px] sm:w-[290px] -mr-8 sm:-mr-12 z-30" }, - { src: "/assets/cloud.svg", alt: "Cloud Track", width: 278, height: 203, className: "w-[220px] sm:w-[275px] z-40" }, - ]; - return ( -
-
- {/* DevJams '26 Logo Container - Placed ON TOP (z-30) */} -
- {logoLetters.map((letter, index) => ( - - {`DevJams - - ))} -
+
+ {/* Hero Section */} + - {/* 4 Track SVGs Row - Positioned BEHIND DevJams '26 (z-10) */} -
- {trackIcons.map((icon, index) => ( - - - {icon.alt} - - - ))} -
+ {/* Tracks Section */} + - {/* Tagline Text */} - - HACK PACK, DEVJAMS’ BACK. - + {/* Previous Events Section */} + - {/* Idea Submission Button */} - - Idea Submission - -
-
+ {/* Got Questions Section */} + + ); } diff --git a/devjams/components/got-questions/GotQuestionsGraphic.tsx b/devjams/components/got-questions/GotQuestionsGraphic.tsx new file mode 100644 index 0000000..01262a6 --- /dev/null +++ b/devjams/components/got-questions/GotQuestionsGraphic.tsx @@ -0,0 +1,69 @@ +"use client"; + +import { motion, MotionValue } from "motion/react"; + +interface GotQuestionsGraphicProps { + apexX: MotionValue; + apexY: MotionValue; +} + +export function GotQuestionsGraphic({ apexX, apexY }: GotQuestionsGraphicProps) { + // Triangle path definition starting at top edge (y=0) + const trianglePath = useTransform( + [apexX, apexY], + ([x, y]) => `M 0 0 L 1000 0 L ${x} ${y} Z` + ); + + // Left radiating lines (5 cleanly-spaced lines) + const leftLine1 = useTransform([apexX, apexY], ([x, y]) => `M 0 0 L ${x} ${y}`); + const leftLine2 = useTransform([apexX, apexY], ([x, y]) => `M 0 150 L ${x} ${y}`); + const leftLine3 = useTransform([apexX, apexY], ([x, y]) => `M 0 300 L ${x} ${y}`); + const leftLine4 = useTransform([apexX, apexY], ([x, y]) => `M 0 450 L ${x} ${y}`); + const leftLine5 = useTransform([apexX, apexY], ([x, y]) => `M 0 600 L ${x} ${y}`); + + // Right radiating lines (6 cleanly-spaced lines) + const rightLine1 = useTransform([apexX, apexY], ([x, y]) => `M 1000 0 L ${x} ${y}`); + const rightLine2 = useTransform([apexX, apexY], ([x, y]) => `M 1000 130 L ${x} ${y}`); + const rightLine3 = useTransform([apexX, apexY], ([x, y]) => `M 1000 260 L ${x} ${y}`); + const rightLine4 = useTransform([apexX, apexY], ([x, y]) => `M 1000 390 L ${x} ${y}`); + const rightLine5 = useTransform([apexX, apexY], ([x, y]) => `M 1000 520 L ${x} ${y}`); + const rightLine6 = useTransform([apexX, apexY], ([x, y]) => `M 1000 650 L ${x} ${y}`); + + return ( + + + {/* Main horizontal gradient across full coordinate width */} + + + + + + + + + {/* Main Inverted Triangle */} + + + {/* Left Radiating Lines */} + + + + + + + {/* Right Radiating Lines */} + + + + + + + + ); +} + +import { useTransform } from "motion/react"; diff --git a/devjams/components/got-questions/GotQuestionsHeading.tsx b/devjams/components/got-questions/GotQuestionsHeading.tsx new file mode 100644 index 0000000..81889b9 --- /dev/null +++ b/devjams/components/got-questions/GotQuestionsHeading.tsx @@ -0,0 +1,23 @@ +"use client"; + +import { motion, MotionValue } from "motion/react"; + +interface GotQuestionsHeadingProps { + x: MotionValue; + y: MotionValue; +} + +export function GotQuestionsHeading({ x, y }: GotQuestionsHeadingProps) { + return ( + + Got Questions? + + ); +} diff --git a/devjams/components/got-questions/GotQuestionsSubHeading.tsx b/devjams/components/got-questions/GotQuestionsSubHeading.tsx new file mode 100644 index 0000000..f72ffcc --- /dev/null +++ b/devjams/components/got-questions/GotQuestionsSubHeading.tsx @@ -0,0 +1,22 @@ +"use client"; + +import { motion, MotionValue } from "motion/react"; + +interface GotQuestionsSubHeadingProps { + opacity: MotionValue; + y: MotionValue; +} + +export function GotQuestionsSubHeading({ opacity, y }: GotQuestionsSubHeadingProps) { + return ( + + Let’s break it down. + + ); +} diff --git a/devjams/components/hero/HeroCTA.tsx b/devjams/components/hero/HeroCTA.tsx new file mode 100644 index 0000000..116fa3d --- /dev/null +++ b/devjams/components/hero/HeroCTA.tsx @@ -0,0 +1,34 @@ +"use client"; + +import { motion } from "motion/react"; + +export function HeroCTA() { + return ( + + Idea Submission + + ); +} diff --git a/devjams/components/hero/HeroLogo.tsx b/devjams/components/hero/HeroLogo.tsx new file mode 100644 index 0000000..be453dd --- /dev/null +++ b/devjams/components/hero/HeroLogo.tsx @@ -0,0 +1,64 @@ +"use client"; + +import Image from "next/image"; +import { motion } from "motion/react"; + +export interface LogoLetter { + src: string; + alt: string; + left: number; + top: number; + width: number; + height: number; + zIndex: number; +} + +const logoLetters: LogoLetter[] = [ + { src: "/assets/logo/D.svg", alt: "D", left: -0.25, top: 8.53, width: 138.68, height: 162.3, zIndex: 10 }, + { src: "/assets/logo/e.svg", alt: "e", left: 114.1, top: 47.96, width: 116.46, height: 122.94, zIndex: 9 }, + { src: "/assets/logo/v.svg", alt: "v", left: 193.51, top: 55.68, width: 127.8, height: 115.3, zIndex: 8 }, + { src: "/assets/logo/J.svg", alt: "J", left: 271.25, top: 4.66, width: 106.5, height: 166.23, zIndex: 7 }, + { src: "/assets/logo/a.svg", alt: "a", left: 353.18, top: 47.52, width: 106.04, height: 122.94, zIndex: 6 }, + { src: "/assets/logo/m.svg", alt: "m", left: 448.28, top: 51.62, width: 178.27, height: 119.23, zIndex: 5 }, + { src: "/assets/logo/s.svg", alt: "s", left: 607.61, top: 47.96, width: 101.41, height: 122.94, zIndex: 4 }, + { src: "/assets/logo/'.svg", alt: "'", left: 724.43, top: 1.98, width: 41.39, height: 54.74, zIndex: 3 }, + { src: "/assets/logo/2.svg", alt: "2", left: 773.45, top: 4.66, width: 104.42, height: 166.23, zIndex: 2 }, + { src: "/assets/logo/6.svg", alt: "6", left: 844.59, top: 0, width: 110.67, height: 170.86, zIndex: 1 }, +]; + +export function HeroLogo() { + return ( +
+ {logoLetters.map((letter, index) => ( + + {`DevJams + + ))} +
+ ); +} diff --git a/devjams/components/hero/HeroTagline.tsx b/devjams/components/hero/HeroTagline.tsx new file mode 100644 index 0000000..75bcefd --- /dev/null +++ b/devjams/components/hero/HeroTagline.tsx @@ -0,0 +1,26 @@ +"use client"; + +import { motion } from "motion/react"; + +export function HeroTagline() { + return ( + + HACK PACK, DEVJAMS’ BACK. + + ); +} diff --git a/devjams/components/hero/HeroTrackIcons.tsx b/devjams/components/hero/HeroTrackIcons.tsx new file mode 100644 index 0000000..4fb0d1f --- /dev/null +++ b/devjams/components/hero/HeroTrackIcons.tsx @@ -0,0 +1,57 @@ +"use client"; + +import Image from "next/image"; +import { motion } from "motion/react"; + +export interface TrackIcon { + src: string; + alt: string; + width: number; + height: number; + className: string; +} + +const trackIcons: TrackIcon[] = [ + { src: "/assets/android.svg", alt: "Android Track", width: 260, height: 159, className: "w-[210px] sm:w-[260px] -mr-8 sm:-mr-12 z-10" }, + { src: "/assets/web.svg", alt: "Web Track", width: 288, height: 288, className: "w-[220px] sm:w-[280px] -mr-8 sm:-mr-12 z-20" }, + { src: "/assets/gemini.svg", alt: "Gemini Track", width: 301, height: 301, className: "w-[230px] sm:w-[290px] -mr-8 sm:-mr-12 z-30" }, + { src: "/assets/cloud.svg", alt: "Cloud Track", width: 278, height: 203, className: "w-[220px] sm:w-[275px] z-40" }, +]; + +export function HeroTrackIcons() { + return ( +
+ {trackIcons.map((icon, index) => ( + + + {icon.alt} + + + ))} +
+ ); +} diff --git a/devjams/components/previous-events/PreviousEventsData.ts b/devjams/components/previous-events/PreviousEventsData.ts new file mode 100644 index 0000000..f67bdc9 --- /dev/null +++ b/devjams/components/previous-events/PreviousEventsData.ts @@ -0,0 +1,27 @@ +export interface EventItem { + id: number; + title: string; + description: string; + imageUrl: string; +} + +export const EVENTS: EventItem[] = [ + { + id: 1, + title: "<> Women Techies '26", + description: "Here's A Record Of The Events We've Run— Organized, Executed, And Completed. Some Small, Some Scaled— But All Intentional.", + imageUrl: "https://i.postimg.cc/SNNnGxNs/87d633e46da6768baea666e97d4dba0314a7014a.png", + }, + { + id: 2, + title: "<> Hexathon '26", + description: "Here's A Record Of The Events We've Run— Organized, Executed, And Completed. Some Small, Some Scaled— But All Intentional.", + imageUrl: "https://i.postimg.cc/Kc5KLMFv/6b612014df996decd6acb46e0e94740d8380638d.png", + }, + { + id: 3, + title: "<> DevJams '25", + description: "Here's A Record Of The Events We've Run— Organized, Executed, And Completed. Some Small, Some Scaled— But All Intentional.", + imageUrl: "https://i.postimg.cc/3R5yjjdY/8a30442d83722241da01ed905e6025c97a7a9749.png", + } +]; diff --git a/devjams/components/previous-events/PreviousEventsDecorations.tsx b/devjams/components/previous-events/PreviousEventsDecorations.tsx new file mode 100644 index 0000000..7d950d2 --- /dev/null +++ b/devjams/components/previous-events/PreviousEventsDecorations.tsx @@ -0,0 +1,86 @@ +"use client"; + +import { motion } from "motion/react"; + +interface DecorationProps { + index: number; +} + +export function PreviousEventsDecorations({ index }: DecorationProps) { + if (index === 0) { + return ( + + + + + + + + + + + + + ); + } + + if (index === 1) { + return ( + + + + + + + + + + + + + + + + + + + + + + ); + } + + if (index === 2) { + return ( + + + + + + + + + + + + + ); + } + + return null; +} diff --git a/devjams/components/previous-events/PreviousEventsHeader.tsx b/devjams/components/previous-events/PreviousEventsHeader.tsx new file mode 100644 index 0000000..f531673 --- /dev/null +++ b/devjams/components/previous-events/PreviousEventsHeader.tsx @@ -0,0 +1,17 @@ +"use client"; + +import { motion } from "motion/react"; + +export function PreviousEventsHeader() { + return ( + +

Previous Events

+
+ ); +} diff --git a/devjams/components/sections/GotQuestions.tsx b/devjams/components/sections/GotQuestions.tsx new file mode 100644 index 0000000..0e26812 --- /dev/null +++ b/devjams/components/sections/GotQuestions.tsx @@ -0,0 +1,50 @@ +"use client"; + +import { useRef } from "react"; +import { useScroll, useTransform } from "motion/react"; +import { GotQuestionsGraphic } from "../got-questions/GotQuestionsGraphic"; +import { GotQuestionsHeading } from "../got-questions/GotQuestionsHeading"; +import { GotQuestionsSubHeading } from "../got-questions/GotQuestionsSubHeading"; + +export function GotQuestions() { + const sectionRef = useRef(null); + + // Scroll tracking across section viewport + const { scrollYProgress } = useScroll({ + target: sectionRef, + offset: ["start 80%", "start 10%"], + }); + + // Apex interpolation: Initial (850, 540) -> Final (240, 650) + const apexX = useTransform(scrollYProgress, [0, 1], [850, 240]); + const apexY = useTransform(scrollYProgress, [0, 1], [540, 650]); + + // Text Animations + const gotQuestionsX = useTransform(scrollYProgress, [0, 1], ["54%", "62%"]); + const gotQuestionsY = useTransform(scrollYProgress, [0, 1], ["22%", "16%"]); + + // Sub-heading visibility trigger on scroll + const breakItDownOpacity = useTransform(scrollYProgress, [0.55, 0.85], [0, 1]); + const breakItDownY = useTransform(scrollYProgress, [0.55, 0.85], [30, 0]); + + return ( +
+
+ {/* Composable SVG Graphic Canvas */} + + + {/* Text Overlay Container */} +
+ {/* Composable Main Heading */} + + + {/* Composable Sub Heading */} + +
+
+
+ ); +} diff --git a/devjams/components/sections/Hero.tsx b/devjams/components/sections/Hero.tsx new file mode 100644 index 0000000..77f9ee9 --- /dev/null +++ b/devjams/components/sections/Hero.tsx @@ -0,0 +1,26 @@ +"use client"; + +import { HeroLogo } from "../hero/HeroLogo"; +import { HeroTrackIcons } from "../hero/HeroTrackIcons"; +import { HeroTagline } from "../hero/HeroTagline"; +import { HeroCTA } from "../hero/HeroCTA"; + +export function Hero() { + return ( +
+
+ {/* DevJams '26 Logo */} + + + {/* 4 Floating Track SVGs */} + + + {/* Tagline Heading */} + + + {/* Idea Submission CTA Button */} + +
+
+ ); +} diff --git a/devjams/components/sections/PreviousEvents.tsx b/devjams/components/sections/PreviousEvents.tsx new file mode 100644 index 0000000..2817784 --- /dev/null +++ b/devjams/components/sections/PreviousEvents.tsx @@ -0,0 +1,61 @@ +"use client"; + +import { motion } from "motion/react"; +import { EventCard } from "../ui/EventCard"; +import { EVENTS } from "../previous-events/PreviousEventsData"; +import { PreviousEventsHeader } from "../previous-events/PreviousEventsHeader"; +import { PreviousEventsDecorations } from "../previous-events/PreviousEventsDecorations"; + +export function PreviousEvents() { + return ( +
+
+ {/* Composable Header */} + + +
+ {/* Central Timeline Line */} +
+ +
+ {EVENTS.map((event, index) => { + const isEven = index % 2 !== 0; + const alignment = isEven ? "left" : "right"; + + return ( +
+ {/* Composable Decorative Background SVG */} + + + {/* Timeline Dot */} + + + {/* Composable Event Card */} +
+ +
+
+ ); + })} +
+
+
+
+ ); +} diff --git a/devjams/components/sections/Tracks.tsx b/devjams/components/sections/Tracks.tsx new file mode 100644 index 0000000..9a85a3e --- /dev/null +++ b/devjams/components/sections/Tracks.tsx @@ -0,0 +1,19 @@ +"use client"; + +import { TracksHeader } from "../tracks/TracksHeader"; +import { TRACKS_DATA } from "../tracks/TracksData"; +import { TrackCarousel } from "../ui/TrackCarousel"; + +export function Tracks() { + return ( +
+ {/* Composable Tracks Section Header */} + + + {/* Composable Track Carousel */} +
+ +
+
+ ); +} diff --git a/devjams/components/tracks/TracksData.tsx b/devjams/components/tracks/TracksData.tsx new file mode 100644 index 0000000..722bd45 --- /dev/null +++ b/devjams/components/tracks/TracksData.tsx @@ -0,0 +1,95 @@ +import React from "react"; +import { TrackData } from "../ui/TrackCarousel"; + +export const CursorIcon = () => ( + + + +); + +export const TetrisIcon = () => ( + + + + + + + + + + +); + +export const CatStackIcon = () => ( + + + + + + + + + +); + +export const DinoIcon = () => ( + + + + +); + + +export const TRACKS_DATA: TrackData[] = [ + { + id: "t1", + title: "Open Innovation", + colorFrom: "#FA3E2C", + colorTo: "#CC518B", + iconNode: , + iconType: "custom", + }, + { + id: "t2", + title: "Android", + colorFrom: "#F9AB00", + colorTo: "#FFD427", + iconSrc: "/assets/android.svg", + iconType: "svg", + }, + { + id: "t3", + title: "Web 3.0", + colorFrom: "#34A853", + colorTo: "#5CDB6D", + iconSrc: "/assets/gemini.svg", + iconType: "svg", + }, + { + id: "t4", + title: "UI/UX", + colorFrom: "#4285F4", + colorTo: "#57CAFF", + iconNode: , + iconType: "custom", + }, + { + id: "t5", + title: "Game Dev", + colorFrom: "#EA4335", + colorTo: "#FF7DAF", + iconNode: , + iconType: "custom", + }, + { + id: "t6", + title: "Cloud", + colorFrom: "#F9AB00", + colorTo: "#FFD427", + iconNode: , + iconType: "custom", + }, +]; diff --git a/devjams/components/tracks/TracksHeader.tsx b/devjams/components/tracks/TracksHeader.tsx new file mode 100644 index 0000000..f12e147 --- /dev/null +++ b/devjams/components/tracks/TracksHeader.tsx @@ -0,0 +1,17 @@ +"use client"; + +import { motion } from "motion/react"; + +export function TracksHeader() { + return ( + +

Tracks

+
+ ); +} diff --git a/devjams/components/ui/EventCard.tsx b/devjams/components/ui/EventCard.tsx new file mode 100644 index 0000000..3bc86cf --- /dev/null +++ b/devjams/components/ui/EventCard.tsx @@ -0,0 +1,54 @@ +"use client"; + +import { motion } from "motion/react"; + +interface EventCardProps { + title: string; + description: string; + imageUrl: string; + alignment: "left" | "right"; +} + +export function EventCard({ title, description, imageUrl, alignment }: EventCardProps) { + return ( + + +
+ + + +

{title}

+

+ {description} +

+
+ + ); +} diff --git a/devjams/components/ui/TrackCarousel.tsx b/devjams/components/ui/TrackCarousel.tsx new file mode 100644 index 0000000..93da7af --- /dev/null +++ b/devjams/components/ui/TrackCarousel.tsx @@ -0,0 +1,203 @@ +"use client"; + +import { useState, useEffect, useCallback } from "react"; +import { motion, AnimatePresence } from "motion/react"; +import Image from "next/image"; + +export interface TrackData { + id: string; + title: string; + colorFrom: string; + colorTo: string; + iconSrc?: string; + iconNode?: React.ReactNode; + iconType?: "svg" | "placeholder" | "custom"; +} + +interface TrackCarouselProps { + tracks: TrackData[]; +} + +export function TrackCarousel({ tracks }: TrackCarouselProps) { + const [activeIndex, setActiveIndex] = useState(0); + + const handleNext = useCallback(() => { + setActiveIndex((prev) => (prev + 1) % tracks.length); + }, [tracks.length]); + + const handlePrev = useCallback(() => { + setActiveIndex((prev) => (prev - 1 + tracks.length) % tracks.length); + }, [tracks.length]); + + useEffect(() => { + const handleKeyDown = (e: KeyboardEvent) => { + if (e.key === "ArrowRight") { + handleNext(); + } else if (e.key === "ArrowLeft") { + handlePrev(); + } + }; + window.addEventListener("keydown", handleKeyDown); + return () => window.removeEventListener("keydown", handleKeyDown); + }, [handleNext, handlePrev]); + + const handleContainerClick = (e: React.MouseEvent) => { + // Don't trigger section navigation if clicking explicit button elements + if ((e.target as HTMLElement).closest("button")) { + return; + } + const rect = e.currentTarget.getBoundingClientRect(); + const clickX = e.clientX - rect.left; + if (clickX > rect.width / 2) { + handleNext(); + } else { + handlePrev(); + } + }; + + // A helper function to determine the visual styling of each card + const getCardStyles = (index: number) => { + const diff = index - activeIndex; + const absDiff = Math.abs(diff); + + // Active card + if (diff === 0) { + return { + x: 0, + y: 0, + z: 0, + rotateY: 0, + scale: 1, + zIndex: 50, + opacity: 1, + }; + } + + // Right side cards + if (diff > 0) { + return { + x: `${60 + diff * 60}%`, // Increased spacing + y: 0, + z: -150 * diff, + rotateY: -40, + scale: 1 - 0.05 * diff, + zIndex: 50 - diff, + opacity: absDiff > 3 ? 0 : 1 - 0.15 * diff, + }; + } + + // Left side cards + return { + x: `-${60 + absDiff * 60}%`, // Increased spacing + y: 0, + z: -150 * absDiff, + rotateY: 40, + scale: 1 - 0.05 * absDiff, + zIndex: 50 - absDiff, + opacity: absDiff > 3 ? 0 : 1 - 0.15 * absDiff, + }; + }; + + return ( +
+
+ + {tracks.map((track, index) => { + const styles = getCardStyles(index); + + return ( + +
+ {/* Track Title */} +

+ {track.title} +

+ + {/* Track Icon */} +
+ {track.iconType === "custom" && track.iconNode ? ( + track.iconNode + ) : track.iconSrc && track.iconType === "svg" ? ( + {track.title} + ) : ( + // Placeholder if no icon +
+ ? +
+ )} +
+
+
+ ); + })} +
+
+ + {/* Progress Dots / Status */} +
+ + Tracks - {activeIndex}/{tracks.length - 1} + +
+
+ {tracks.map((_, idx) => ( +
+
+
+ ); +} + diff --git a/devjams/public/assets/dino.svg b/devjams/public/assets/dino.svg new file mode 100644 index 0000000..d008d95 --- /dev/null +++ b/devjams/public/assets/dino.svg @@ -0,0 +1,4 @@ + + + + diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json new file mode 100644 index 0000000..48f7ae6 --- /dev/null +++ b/node_modules/.package-lock.json @@ -0,0 +1,73 @@ +{ + "name": "Devjams26-Frontend", + "lockfileVersion": 3, + "requires": true, + "packages": { + "node_modules/framer-motion": { + "version": "13.1.0", + "resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-13.1.0.tgz", + "integrity": "sha512-QSZrF0Id3QGuHJ+OL+9PSY9pk86C8ERFalwAGSchzTm65+ZoGH/RM26lmEARLljcHj2lqhv0jZOOks+EI3COOw==", + "license": "MIT", + "dependencies": { + "motion-dom": "^13.0.0", + "motion-utils": "^13.0.0", + "tslib": "^2.4.0" + }, + "peerDependencies": { + "react": "^18.0.0 || ^19.0.0", + "react-dom": "^18.0.0 || ^19.0.0" + }, + "peerDependenciesMeta": { + "react": { + "optional": true + }, + "react-dom": { + "optional": true + } + } + }, + "node_modules/motion": { + "version": "13.1.0", + "resolved": "https://registry.npmjs.org/motion/-/motion-13.1.0.tgz", + "integrity": "sha512-qtvscq59uCPdWnNW4SdSkrxR+BS/QYsa923bx7ocA+4p+ZGNbbVQwkSnG4aukB81QWjtl3AxX36plxNyZLmHCA==", + "license": "MIT", + "dependencies": { + "framer-motion": "^13.1.0", + "tslib": "^2.4.0" + }, + "peerDependencies": { + "react": "^18.0.0 || ^19.0.0", + "react-dom": "^18.0.0 || ^19.0.0" + }, + "peerDependenciesMeta": { + "react": { + "optional": true + }, + "react-dom": { + "optional": true + } + } + }, + "node_modules/motion-dom": { + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/motion-dom/-/motion-dom-13.0.0.tgz", + "integrity": "sha512-Xk+SJas70uMAUIApg+m3lZDShxI3LBFHq7mFGbBKoRXc2PVPDyAKmzN64Bbzt4CZdP/CItTiJxWtn4TA0v53Ng==", + "license": "MIT", + "dependencies": { + "motion-utils": "^13.0.0" + } + }, + "node_modules/motion-utils": { + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/motion-utils/-/motion-utils-13.0.0.tgz", + "integrity": "sha512-7DnN7TmbLcYXcG4RVadXIihWlyuM9afoUww8Y5Agg431kGKiuL2/OMyP4mJ5wLz+pvN3t5ySClLOaVXJ+wekRQ==", + "license": "MIT" + }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "license": "0BSD" + } + } +} diff --git a/node_modules/framer-motion/LICENSE.md b/node_modules/framer-motion/LICENSE.md new file mode 100644 index 0000000..b5b8d6a --- /dev/null +++ b/node_modules/framer-motion/LICENSE.md @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2018 Framer B.V. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/framer-motion/README.md b/node_modules/framer-motion/README.md new file mode 100644 index 0000000..6577ebe --- /dev/null +++ b/node_modules/framer-motion/README.md @@ -0,0 +1,137 @@ +

Motion logo
Motion for React

+

+ An open source animation library
for React +

+ +

+ npm version + npm downloads per month + jsDelivr hits (npm) + NPM License + MotionScore grade +

+ +```bash +npm install motion +``` + +## Table of Contents + +1. [Why Motion?](#why-motion) +2. [🍦 Platforms](#-platforms) +3. [🎓 Examples](#-examples) +4. [⚡️ Motion+](#-motion) +5. [👩🏻‍⚖️ License](#-license) +6. [💎 Contribute](#-contribute) +7. [✨ Sponsors](#-sponsors) + +## Why Motion? + +- **Simple API:** First-class React, JavaScript, and Vue packages. +- **Hybrid engine:** Power of JavaScript combined with native browser APIs for 120fps, GPU-accelerated animations. +- **Production-ready:** TypeScript, extensive test suite, tree-shakable, tiny footprint. + **Batteries included:** Gestures, springs, layout transitions, scroll-linked effects, timelines. + +## 🍦 Platforms + +Motion is available for [React](https://motion.dev/docs/react), [JavaScript](https://motion.dev/docs/quick-start) and [Vue](https://motion.dev/docs/vue). + +### React + +```jsx +import { motion } from "motion/react" + +function Component() { + return +} +``` + +Get started with [Motion for React](https://motion.dev/docs/react). + +**Note:** Framer Motion is now Motion. Import from `motion/react` instead of `framer-motion`. + +### JS + +```javascript +import { animate } from "motion" + +animate("#box", { x: 100 }) +``` + +Get started with [JavaScript](https://motion.dev/docs/quick-start). + +### Vue + +```html + + + +``` + +Get started with [Motion for Vue](https://motion.dev/docs/vue). + +## 🎓 Examples & tutorials + +Browse 330+ [official examples](https://motion.dev/examples), with copy-paste code that'll level-up your animations whether you're a beginner or an expert. + +Over 100 examples come with a full step-by-step [tutorial](https://motion.dev/tutorials). + +## ⚡️ Motion+ + +A one-time payment, lifetime-updates membership: + +- **330+ examples** +- **100+ tutorials** +- **Premium APIs** like [Cursor](https://motion.dev/docs/cursor) and [Ticker](https://motion.dev/docs/react-ticker) +- **Transition editor** for Cursor and VS Code +- **AI skills** +- **Private Discord** +- **Early access content** + +[Get Motion+](https://motion.dev/plus) + +## 👩🏻‍⚖️ License + +- Motion is MIT licensed. + +## 💎 Contribute + +- Want to contribute to Motion? Our [contributing guide](https://github.com/motiondivision/motion/blob/master/CONTRIBUTING.md) has you covered. + +## ✨ Sponsors + +Motion is sustainable thanks to the kind support of its sponsors. + +[Become a sponsor](https://motion.dev/sponsor) + +### Partners + +Motion powers the animations for all websites built with Framer, the web builder for creative pros. The Motion website itself is built on Framer, for its delightful canvas-based editing and powerful CMS features. + + + Framer + + +Motion drives the animations on the Cursor homepage, and is working with Cursor to bring powerful AI workflows to the Motion examples and docs. + + + Cursor + + +### Platinum + +Linear Figma Sanity Sanity Clerk + +### Gold + +### Silver + +Liveblocks Frontend.fyi Firecrawl Bolt.new + +### Personal + +- [OlegWock](https://sinja.io) +- [Lambert Weller](https://github.com/l-mbert) +- [Jake LeBoeuf](https://jklb.wf) diff --git a/node_modules/framer-motion/client/README.md b/node_modules/framer-motion/client/README.md new file mode 100644 index 0000000..00af8b4 --- /dev/null +++ b/node_modules/framer-motion/client/README.md @@ -0,0 +1 @@ +This directory is a fallback for `exports["./client"]` in the root `framer-motion` `package.json`. diff --git a/node_modules/framer-motion/client/package.json b/node_modules/framer-motion/client/package.json new file mode 100644 index 0000000..c4eeff4 --- /dev/null +++ b/node_modules/framer-motion/client/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "types": "../dist/client.d.ts", + "main": "../dist/cjs/client.js", + "module": "../dist/es/client.mjs" +} diff --git a/node_modules/framer-motion/dist/cjs/client.js b/node_modules/framer-motion/dist/cjs/client.js new file mode 100644 index 0000000..a5b770c --- /dev/null +++ b/node_modules/framer-motion/dist/cjs/client.js @@ -0,0 +1,370 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var index = require('./index-BuO47Yrm.js'); +var featureBundle = require('./feature-bundle-BZV7Y7IM.js'); +require('react/jsx-runtime'); +require('motion-utils'); +require('react'); +require('motion-dom'); + +function createMotionComponentWithFeatures(Component, options) { + return index.createMotionComponent(Component, options, featureBundle.featureBundle, featureBundle.createDomVisualElement); +} + +/** + * HTML components + */ +const MotionA = /*@__PURE__*/ createMotionComponentWithFeatures("a"); +const MotionAbbr = /*@__PURE__*/ createMotionComponentWithFeatures("abbr"); +const MotionAddress = /*@__PURE__*/ createMotionComponentWithFeatures("address"); +const MotionArea = /*@__PURE__*/ createMotionComponentWithFeatures("area"); +const MotionArticle = /*@__PURE__*/ createMotionComponentWithFeatures("article"); +const MotionAside = /*@__PURE__*/ createMotionComponentWithFeatures("aside"); +const MotionAudio = /*@__PURE__*/ createMotionComponentWithFeatures("audio"); +const MotionB = /*@__PURE__*/ createMotionComponentWithFeatures("b"); +const MotionBase = /*@__PURE__*/ createMotionComponentWithFeatures("base"); +const MotionBdi = /*@__PURE__*/ createMotionComponentWithFeatures("bdi"); +const MotionBdo = /*@__PURE__*/ createMotionComponentWithFeatures("bdo"); +const MotionBig = /*@__PURE__*/ createMotionComponentWithFeatures("big"); +const MotionBlockquote = +/*@__PURE__*/ createMotionComponentWithFeatures("blockquote"); +const MotionBody = /*@__PURE__*/ createMotionComponentWithFeatures("body"); +const MotionButton = /*@__PURE__*/ createMotionComponentWithFeatures("button"); +const MotionCanvas = /*@__PURE__*/ createMotionComponentWithFeatures("canvas"); +const MotionCaption = /*@__PURE__*/ createMotionComponentWithFeatures("caption"); +const MotionCite = /*@__PURE__*/ createMotionComponentWithFeatures("cite"); +const MotionCode = /*@__PURE__*/ createMotionComponentWithFeatures("code"); +const MotionCol = /*@__PURE__*/ createMotionComponentWithFeatures("col"); +const MotionColgroup = /*@__PURE__*/ createMotionComponentWithFeatures("colgroup"); +const MotionData = /*@__PURE__*/ createMotionComponentWithFeatures("data"); +const MotionDatalist = /*@__PURE__*/ createMotionComponentWithFeatures("datalist"); +const MotionDd = /*@__PURE__*/ createMotionComponentWithFeatures("dd"); +const MotionDel = /*@__PURE__*/ createMotionComponentWithFeatures("del"); +const MotionDetails = /*@__PURE__*/ createMotionComponentWithFeatures("details"); +const MotionDfn = /*@__PURE__*/ createMotionComponentWithFeatures("dfn"); +const MotionDialog = /*@__PURE__*/ createMotionComponentWithFeatures("dialog"); +const MotionDiv = /*@__PURE__*/ createMotionComponentWithFeatures("div"); +const MotionDl = /*@__PURE__*/ createMotionComponentWithFeatures("dl"); +const MotionDt = /*@__PURE__*/ createMotionComponentWithFeatures("dt"); +const MotionEm = /*@__PURE__*/ createMotionComponentWithFeatures("em"); +const MotionEmbed = /*@__PURE__*/ createMotionComponentWithFeatures("embed"); +const MotionFieldset = /*@__PURE__*/ createMotionComponentWithFeatures("fieldset"); +const MotionFigcaption = +/*@__PURE__*/ createMotionComponentWithFeatures("figcaption"); +const MotionFigure = /*@__PURE__*/ createMotionComponentWithFeatures("figure"); +const MotionFooter = /*@__PURE__*/ createMotionComponentWithFeatures("footer"); +const MotionForm = /*@__PURE__*/ createMotionComponentWithFeatures("form"); +const MotionH1 = /*@__PURE__*/ createMotionComponentWithFeatures("h1"); +const MotionH2 = /*@__PURE__*/ createMotionComponentWithFeatures("h2"); +const MotionH3 = /*@__PURE__*/ createMotionComponentWithFeatures("h3"); +const MotionH4 = /*@__PURE__*/ createMotionComponentWithFeatures("h4"); +const MotionH5 = /*@__PURE__*/ createMotionComponentWithFeatures("h5"); +const MotionH6 = /*@__PURE__*/ createMotionComponentWithFeatures("h6"); +const MotionHead = /*@__PURE__*/ createMotionComponentWithFeatures("head"); +const MotionHeader = /*@__PURE__*/ createMotionComponentWithFeatures("header"); +const MotionHgroup = /*@__PURE__*/ createMotionComponentWithFeatures("hgroup"); +const MotionHr = /*@__PURE__*/ createMotionComponentWithFeatures("hr"); +const MotionHtml = /*@__PURE__*/ createMotionComponentWithFeatures("html"); +const MotionI = /*@__PURE__*/ createMotionComponentWithFeatures("i"); +const MotionIframe = /*@__PURE__*/ createMotionComponentWithFeatures("iframe"); +const MotionImg = /*@__PURE__*/ createMotionComponentWithFeatures("img"); +const MotionInput = /*@__PURE__*/ createMotionComponentWithFeatures("input"); +const MotionIns = /*@__PURE__*/ createMotionComponentWithFeatures("ins"); +const MotionKbd = /*@__PURE__*/ createMotionComponentWithFeatures("kbd"); +const MotionKeygen = /*@__PURE__*/ createMotionComponentWithFeatures("keygen"); +const MotionLabel = /*@__PURE__*/ createMotionComponentWithFeatures("label"); +const MotionLegend = /*@__PURE__*/ createMotionComponentWithFeatures("legend"); +const MotionLi = /*@__PURE__*/ createMotionComponentWithFeatures("li"); +const MotionLink = /*@__PURE__*/ createMotionComponentWithFeatures("link"); +const MotionMain = /*@__PURE__*/ createMotionComponentWithFeatures("main"); +const MotionMap = /*@__PURE__*/ createMotionComponentWithFeatures("map"); +const MotionMark = /*@__PURE__*/ createMotionComponentWithFeatures("mark"); +const MotionMenu = /*@__PURE__*/ createMotionComponentWithFeatures("menu"); +const MotionMenuitem = /*@__PURE__*/ createMotionComponentWithFeatures("menuitem"); +const MotionMeter = /*@__PURE__*/ createMotionComponentWithFeatures("meter"); +const MotionNav = /*@__PURE__*/ createMotionComponentWithFeatures("nav"); +const MotionObject = /*@__PURE__*/ createMotionComponentWithFeatures("object"); +const MotionOl = /*@__PURE__*/ createMotionComponentWithFeatures("ol"); +const MotionOptgroup = /*@__PURE__*/ createMotionComponentWithFeatures("optgroup"); +const MotionOption = /*@__PURE__*/ createMotionComponentWithFeatures("option"); +const MotionOutput = /*@__PURE__*/ createMotionComponentWithFeatures("output"); +const MotionP = /*@__PURE__*/ createMotionComponentWithFeatures("p"); +const MotionParam = /*@__PURE__*/ createMotionComponentWithFeatures("param"); +const MotionPicture = /*@__PURE__*/ createMotionComponentWithFeatures("picture"); +const MotionPre = /*@__PURE__*/ createMotionComponentWithFeatures("pre"); +const MotionProgress = /*@__PURE__*/ createMotionComponentWithFeatures("progress"); +const MotionQ = /*@__PURE__*/ createMotionComponentWithFeatures("q"); +const MotionRp = /*@__PURE__*/ createMotionComponentWithFeatures("rp"); +const MotionRt = /*@__PURE__*/ createMotionComponentWithFeatures("rt"); +const MotionRuby = /*@__PURE__*/ createMotionComponentWithFeatures("ruby"); +const MotionS = /*@__PURE__*/ createMotionComponentWithFeatures("s"); +const MotionSamp = /*@__PURE__*/ createMotionComponentWithFeatures("samp"); +const MotionScript = /*@__PURE__*/ createMotionComponentWithFeatures("script"); +const MotionSection = /*@__PURE__*/ createMotionComponentWithFeatures("section"); +const MotionSelect = /*@__PURE__*/ createMotionComponentWithFeatures("select"); +const MotionSmall = /*@__PURE__*/ createMotionComponentWithFeatures("small"); +const MotionSource = /*@__PURE__*/ createMotionComponentWithFeatures("source"); +const MotionSpan = /*@__PURE__*/ createMotionComponentWithFeatures("span"); +const MotionStrong = /*@__PURE__*/ createMotionComponentWithFeatures("strong"); +const MotionStyle = /*@__PURE__*/ createMotionComponentWithFeatures("style"); +const MotionSub = /*@__PURE__*/ createMotionComponentWithFeatures("sub"); +const MotionSummary = /*@__PURE__*/ createMotionComponentWithFeatures("summary"); +const MotionSup = /*@__PURE__*/ createMotionComponentWithFeatures("sup"); +const MotionTable = /*@__PURE__*/ createMotionComponentWithFeatures("table"); +const MotionTbody = /*@__PURE__*/ createMotionComponentWithFeatures("tbody"); +const MotionTd = /*@__PURE__*/ createMotionComponentWithFeatures("td"); +const MotionTextarea = /*@__PURE__*/ createMotionComponentWithFeatures("textarea"); +const MotionTfoot = /*@__PURE__*/ createMotionComponentWithFeatures("tfoot"); +const MotionTh = /*@__PURE__*/ createMotionComponentWithFeatures("th"); +const MotionThead = /*@__PURE__*/ createMotionComponentWithFeatures("thead"); +const MotionTime = /*@__PURE__*/ createMotionComponentWithFeatures("time"); +const MotionTitle = /*@__PURE__*/ createMotionComponentWithFeatures("title"); +const MotionTr = /*@__PURE__*/ createMotionComponentWithFeatures("tr"); +const MotionTrack = /*@__PURE__*/ createMotionComponentWithFeatures("track"); +const MotionU = /*@__PURE__*/ createMotionComponentWithFeatures("u"); +const MotionUl = /*@__PURE__*/ createMotionComponentWithFeatures("ul"); +const MotionVideo = /*@__PURE__*/ createMotionComponentWithFeatures("video"); +const MotionWbr = /*@__PURE__*/ createMotionComponentWithFeatures("wbr"); +const MotionWebview = /*@__PURE__*/ createMotionComponentWithFeatures("webview"); +/** + * SVG components + */ +const MotionAnimate = /*@__PURE__*/ createMotionComponentWithFeatures("animate"); +const MotionCircle = /*@__PURE__*/ createMotionComponentWithFeatures("circle"); +const MotionDefs = /*@__PURE__*/ createMotionComponentWithFeatures("defs"); +const MotionDesc = /*@__PURE__*/ createMotionComponentWithFeatures("desc"); +const MotionEllipse = /*@__PURE__*/ createMotionComponentWithFeatures("ellipse"); +const MotionG = /*@__PURE__*/ createMotionComponentWithFeatures("g"); +const MotionImage = /*@__PURE__*/ createMotionComponentWithFeatures("image"); +const MotionLine = /*@__PURE__*/ createMotionComponentWithFeatures("line"); +const MotionFilter = /*@__PURE__*/ createMotionComponentWithFeatures("filter"); +const MotionMarker = /*@__PURE__*/ createMotionComponentWithFeatures("marker"); +const MotionMask = /*@__PURE__*/ createMotionComponentWithFeatures("mask"); +const MotionMetadata = /*@__PURE__*/ createMotionComponentWithFeatures("metadata"); +const MotionPath = /*@__PURE__*/ createMotionComponentWithFeatures("path"); +const MotionPattern = /*@__PURE__*/ createMotionComponentWithFeatures("pattern"); +const MotionPolygon = /*@__PURE__*/ createMotionComponentWithFeatures("polygon"); +const MotionPolyline = /*@__PURE__*/ createMotionComponentWithFeatures("polyline"); +const MotionRect = /*@__PURE__*/ createMotionComponentWithFeatures("rect"); +const MotionStop = /*@__PURE__*/ createMotionComponentWithFeatures("stop"); +const MotionSvg = /*@__PURE__*/ createMotionComponentWithFeatures("svg"); +const MotionSymbol = /*@__PURE__*/ createMotionComponentWithFeatures("symbol"); +const MotionText = /*@__PURE__*/ createMotionComponentWithFeatures("text"); +const MotionTspan = /*@__PURE__*/ createMotionComponentWithFeatures("tspan"); +const MotionUse = /*@__PURE__*/ createMotionComponentWithFeatures("use"); +const MotionView = /*@__PURE__*/ createMotionComponentWithFeatures("view"); +const MotionClipPath = /*@__PURE__*/ createMotionComponentWithFeatures("clipPath"); +const MotionFeBlend = /*@__PURE__*/ createMotionComponentWithFeatures("feBlend"); +const MotionFeColorMatrix = +/*@__PURE__*/ createMotionComponentWithFeatures("feColorMatrix"); +const MotionFeComponentTransfer = /*@__PURE__*/ createMotionComponentWithFeatures("feComponentTransfer"); +const MotionFeComposite = +/*@__PURE__*/ createMotionComponentWithFeatures("feComposite"); +const MotionFeConvolveMatrix = +/*@__PURE__*/ createMotionComponentWithFeatures("feConvolveMatrix"); +const MotionFeDiffuseLighting = +/*@__PURE__*/ createMotionComponentWithFeatures("feDiffuseLighting"); +const MotionFeDisplacementMap = +/*@__PURE__*/ createMotionComponentWithFeatures("feDisplacementMap"); +const MotionFeDistantLight = +/*@__PURE__*/ createMotionComponentWithFeatures("feDistantLight"); +const MotionFeDropShadow = +/*@__PURE__*/ createMotionComponentWithFeatures("feDropShadow"); +const MotionFeFlood = /*@__PURE__*/ createMotionComponentWithFeatures("feFlood"); +const MotionFeFuncA = /*@__PURE__*/ createMotionComponentWithFeatures("feFuncA"); +const MotionFeFuncB = /*@__PURE__*/ createMotionComponentWithFeatures("feFuncB"); +const MotionFeFuncG = /*@__PURE__*/ createMotionComponentWithFeatures("feFuncG"); +const MotionFeFuncR = /*@__PURE__*/ createMotionComponentWithFeatures("feFuncR"); +const MotionFeGaussianBlur = +/*@__PURE__*/ createMotionComponentWithFeatures("feGaussianBlur"); +const MotionFeImage = /*@__PURE__*/ createMotionComponentWithFeatures("feImage"); +const MotionFeMerge = /*@__PURE__*/ createMotionComponentWithFeatures("feMerge"); +const MotionFeMergeNode = +/*@__PURE__*/ createMotionComponentWithFeatures("feMergeNode"); +const MotionFeMorphology = +/*@__PURE__*/ createMotionComponentWithFeatures("feMorphology"); +const MotionFeOffset = /*@__PURE__*/ createMotionComponentWithFeatures("feOffset"); +const MotionFePointLight = +/*@__PURE__*/ createMotionComponentWithFeatures("fePointLight"); +const MotionFeSpecularLighting = +/*@__PURE__*/ createMotionComponentWithFeatures("feSpecularLighting"); +const MotionFeSpotLight = +/*@__PURE__*/ createMotionComponentWithFeatures("feSpotLight"); +const MotionFeTile = /*@__PURE__*/ createMotionComponentWithFeatures("feTile"); +const MotionFeTurbulence = +/*@__PURE__*/ createMotionComponentWithFeatures("feTurbulence"); +const MotionForeignObject = +/*@__PURE__*/ createMotionComponentWithFeatures("foreignObject"); +const MotionLinearGradient = +/*@__PURE__*/ createMotionComponentWithFeatures("linearGradient"); +const MotionRadialGradient = +/*@__PURE__*/ createMotionComponentWithFeatures("radialGradient"); +const MotionTextPath = /*@__PURE__*/ createMotionComponentWithFeatures("textPath"); + +exports.a = MotionA; +exports.abbr = MotionAbbr; +exports.address = MotionAddress; +exports.animate = MotionAnimate; +exports.area = MotionArea; +exports.article = MotionArticle; +exports.aside = MotionAside; +exports.audio = MotionAudio; +exports.b = MotionB; +exports.base = MotionBase; +exports.bdi = MotionBdi; +exports.bdo = MotionBdo; +exports.big = MotionBig; +exports.blockquote = MotionBlockquote; +exports.body = MotionBody; +exports.button = MotionButton; +exports.canvas = MotionCanvas; +exports.caption = MotionCaption; +exports.circle = MotionCircle; +exports.cite = MotionCite; +exports.clipPath = MotionClipPath; +exports.code = MotionCode; +exports.col = MotionCol; +exports.colgroup = MotionColgroup; +exports.data = MotionData; +exports.datalist = MotionDatalist; +exports.dd = MotionDd; +exports.defs = MotionDefs; +exports.del = MotionDel; +exports.desc = MotionDesc; +exports.details = MotionDetails; +exports.dfn = MotionDfn; +exports.dialog = MotionDialog; +exports.div = MotionDiv; +exports.dl = MotionDl; +exports.dt = MotionDt; +exports.ellipse = MotionEllipse; +exports.em = MotionEm; +exports.embed = MotionEmbed; +exports.feBlend = MotionFeBlend; +exports.feColorMatrix = MotionFeColorMatrix; +exports.feComponentTransfer = MotionFeComponentTransfer; +exports.feComposite = MotionFeComposite; +exports.feConvolveMatrix = MotionFeConvolveMatrix; +exports.feDiffuseLighting = MotionFeDiffuseLighting; +exports.feDisplacementMap = MotionFeDisplacementMap; +exports.feDistantLight = MotionFeDistantLight; +exports.feDropShadow = MotionFeDropShadow; +exports.feFlood = MotionFeFlood; +exports.feFuncA = MotionFeFuncA; +exports.feFuncB = MotionFeFuncB; +exports.feFuncG = MotionFeFuncG; +exports.feFuncR = MotionFeFuncR; +exports.feGaussianBlur = MotionFeGaussianBlur; +exports.feImage = MotionFeImage; +exports.feMerge = MotionFeMerge; +exports.feMergeNode = MotionFeMergeNode; +exports.feMorphology = MotionFeMorphology; +exports.feOffset = MotionFeOffset; +exports.fePointLight = MotionFePointLight; +exports.feSpecularLighting = MotionFeSpecularLighting; +exports.feSpotLight = MotionFeSpotLight; +exports.feTile = MotionFeTile; +exports.feTurbulence = MotionFeTurbulence; +exports.fieldset = MotionFieldset; +exports.figcaption = MotionFigcaption; +exports.figure = MotionFigure; +exports.filter = MotionFilter; +exports.footer = MotionFooter; +exports.foreignObject = MotionForeignObject; +exports.form = MotionForm; +exports.g = MotionG; +exports.h1 = MotionH1; +exports.h2 = MotionH2; +exports.h3 = MotionH3; +exports.h4 = MotionH4; +exports.h5 = MotionH5; +exports.h6 = MotionH6; +exports.head = MotionHead; +exports.header = MotionHeader; +exports.hgroup = MotionHgroup; +exports.hr = MotionHr; +exports.html = MotionHtml; +exports.i = MotionI; +exports.iframe = MotionIframe; +exports.image = MotionImage; +exports.img = MotionImg; +exports.input = MotionInput; +exports.ins = MotionIns; +exports.kbd = MotionKbd; +exports.keygen = MotionKeygen; +exports.label = MotionLabel; +exports.legend = MotionLegend; +exports.li = MotionLi; +exports.line = MotionLine; +exports.linearGradient = MotionLinearGradient; +exports.link = MotionLink; +exports.main = MotionMain; +exports.map = MotionMap; +exports.mark = MotionMark; +exports.marker = MotionMarker; +exports.mask = MotionMask; +exports.menu = MotionMenu; +exports.menuitem = MotionMenuitem; +exports.metadata = MotionMetadata; +exports.meter = MotionMeter; +exports.nav = MotionNav; +exports.object = MotionObject; +exports.ol = MotionOl; +exports.optgroup = MotionOptgroup; +exports.option = MotionOption; +exports.output = MotionOutput; +exports.p = MotionP; +exports.param = MotionParam; +exports.path = MotionPath; +exports.pattern = MotionPattern; +exports.picture = MotionPicture; +exports.polygon = MotionPolygon; +exports.polyline = MotionPolyline; +exports.pre = MotionPre; +exports.progress = MotionProgress; +exports.q = MotionQ; +exports.radialGradient = MotionRadialGradient; +exports.rect = MotionRect; +exports.rp = MotionRp; +exports.rt = MotionRt; +exports.ruby = MotionRuby; +exports.s = MotionS; +exports.samp = MotionSamp; +exports.script = MotionScript; +exports.section = MotionSection; +exports.select = MotionSelect; +exports.small = MotionSmall; +exports.source = MotionSource; +exports.span = MotionSpan; +exports.stop = MotionStop; +exports.strong = MotionStrong; +exports.style = MotionStyle; +exports.sub = MotionSub; +exports.summary = MotionSummary; +exports.sup = MotionSup; +exports.svg = MotionSvg; +exports.symbol = MotionSymbol; +exports.table = MotionTable; +exports.tbody = MotionTbody; +exports.td = MotionTd; +exports.text = MotionText; +exports.textPath = MotionTextPath; +exports.textarea = MotionTextarea; +exports.tfoot = MotionTfoot; +exports.th = MotionTh; +exports.thead = MotionThead; +exports.time = MotionTime; +exports.title = MotionTitle; +exports.tr = MotionTr; +exports.track = MotionTrack; +exports.tspan = MotionTspan; +exports.u = MotionU; +exports.ul = MotionUl; +exports.use = MotionUse; +exports.video = MotionVideo; +exports.view = MotionView; +exports.wbr = MotionWbr; +exports.webview = MotionWebview; +//# sourceMappingURL=client.js.map diff --git a/node_modules/framer-motion/dist/cjs/client.js.map b/node_modules/framer-motion/dist/cjs/client.js.map new file mode 100644 index 0000000..4663f04 --- /dev/null +++ b/node_modules/framer-motion/dist/cjs/client.js.map @@ -0,0 +1 @@ +{"version":3,"file":"client.js","sources":["../../src/render/components/motion/create.ts","../../src/render/components/motion/elements.ts"],"sourcesContent":["import { createMotionComponent, MotionComponentOptions } from \"../../../motion\"\nimport { createDomVisualElement } from \"../../dom/create-visual-element\"\nimport { DOMMotionComponents } from \"../../dom/types\"\nimport { CreateVisualElement } from \"../../types\"\nimport { featureBundle } from \"./feature-bundle\"\n\nexport function createMotionComponentWithFeatures<\n Props,\n TagName extends keyof DOMMotionComponents | string = \"div\"\n>(\n Component: TagName | string | React.ComponentType,\n options?: MotionComponentOptions\n) {\n return createMotionComponent(\n Component,\n options,\n featureBundle,\n createDomVisualElement as CreateVisualElement\n )\n}\n","\"use client\"\n\nimport { createMotionComponentWithFeatures as createMotionComponent } from \"./create\"\n\n/**\n * HTML components\n */\nexport const MotionA = /*@__PURE__*/ createMotionComponent(\"a\")\nexport const MotionAbbr = /*@__PURE__*/ createMotionComponent(\"abbr\")\nexport const MotionAddress = /*@__PURE__*/ createMotionComponent(\"address\")\nexport const MotionArea = /*@__PURE__*/ createMotionComponent(\"area\")\nexport const MotionArticle = /*@__PURE__*/ createMotionComponent(\"article\")\nexport const MotionAside = /*@__PURE__*/ createMotionComponent(\"aside\")\nexport const MotionAudio = /*@__PURE__*/ createMotionComponent(\"audio\")\nexport const MotionB = /*@__PURE__*/ createMotionComponent(\"b\")\nexport const MotionBase = /*@__PURE__*/ createMotionComponent(\"base\")\nexport const MotionBdi = /*@__PURE__*/ createMotionComponent(\"bdi\")\nexport const MotionBdo = /*@__PURE__*/ createMotionComponent(\"bdo\")\nexport const MotionBig = /*@__PURE__*/ createMotionComponent(\"big\")\nexport const MotionBlockquote =\n /*@__PURE__*/ createMotionComponent(\"blockquote\")\nexport const MotionBody = /*@__PURE__*/ createMotionComponent(\"body\")\nexport const MotionButton = /*@__PURE__*/ createMotionComponent(\"button\")\nexport const MotionCanvas = /*@__PURE__*/ createMotionComponent(\"canvas\")\nexport const MotionCaption = /*@__PURE__*/ createMotionComponent(\"caption\")\nexport const MotionCite = /*@__PURE__*/ createMotionComponent(\"cite\")\nexport const MotionCode = /*@__PURE__*/ createMotionComponent(\"code\")\nexport const MotionCol = /*@__PURE__*/ createMotionComponent(\"col\")\nexport const MotionColgroup = /*@__PURE__*/ createMotionComponent(\"colgroup\")\nexport const MotionData = /*@__PURE__*/ createMotionComponent(\"data\")\nexport const MotionDatalist = /*@__PURE__*/ createMotionComponent(\"datalist\")\nexport const MotionDd = /*@__PURE__*/ createMotionComponent(\"dd\")\nexport const MotionDel = /*@__PURE__*/ createMotionComponent(\"del\")\nexport const MotionDetails = /*@__PURE__*/ createMotionComponent(\"details\")\nexport const MotionDfn = /*@__PURE__*/ createMotionComponent(\"dfn\")\nexport const MotionDialog = /*@__PURE__*/ createMotionComponent(\"dialog\")\nexport const MotionDiv = /*@__PURE__*/ createMotionComponent(\"div\")\nexport const MotionDl = /*@__PURE__*/ createMotionComponent(\"dl\")\nexport const MotionDt = /*@__PURE__*/ createMotionComponent(\"dt\")\nexport const MotionEm = /*@__PURE__*/ createMotionComponent(\"em\")\nexport const MotionEmbed = /*@__PURE__*/ createMotionComponent(\"embed\")\nexport const MotionFieldset = /*@__PURE__*/ createMotionComponent(\"fieldset\")\nexport const MotionFigcaption =\n /*@__PURE__*/ createMotionComponent(\"figcaption\")\nexport const MotionFigure = /*@__PURE__*/ createMotionComponent(\"figure\")\nexport const MotionFooter = /*@__PURE__*/ createMotionComponent(\"footer\")\nexport const MotionForm = /*@__PURE__*/ createMotionComponent(\"form\")\nexport const MotionH1 = /*@__PURE__*/ createMotionComponent(\"h1\")\nexport const MotionH2 = /*@__PURE__*/ createMotionComponent(\"h2\")\nexport const MotionH3 = /*@__PURE__*/ createMotionComponent(\"h3\")\nexport const MotionH4 = /*@__PURE__*/ createMotionComponent(\"h4\")\nexport const MotionH5 = /*@__PURE__*/ createMotionComponent(\"h5\")\nexport const MotionH6 = /*@__PURE__*/ createMotionComponent(\"h6\")\nexport const MotionHead = /*@__PURE__*/ createMotionComponent(\"head\")\nexport const MotionHeader = /*@__PURE__*/ createMotionComponent(\"header\")\nexport const MotionHgroup = /*@__PURE__*/ createMotionComponent(\"hgroup\")\nexport const MotionHr = /*@__PURE__*/ createMotionComponent(\"hr\")\nexport const MotionHtml = /*@__PURE__*/ createMotionComponent(\"html\")\nexport const MotionI = /*@__PURE__*/ createMotionComponent(\"i\")\nexport const MotionIframe = /*@__PURE__*/ createMotionComponent(\"iframe\")\nexport const MotionImg = /*@__PURE__*/ createMotionComponent(\"img\")\nexport const MotionInput = /*@__PURE__*/ createMotionComponent(\"input\")\nexport const MotionIns = /*@__PURE__*/ createMotionComponent(\"ins\")\nexport const MotionKbd = /*@__PURE__*/ createMotionComponent(\"kbd\")\nexport const MotionKeygen = /*@__PURE__*/ createMotionComponent(\"keygen\")\nexport const MotionLabel = /*@__PURE__*/ createMotionComponent(\"label\")\nexport const MotionLegend = /*@__PURE__*/ createMotionComponent(\"legend\")\nexport const MotionLi = /*@__PURE__*/ createMotionComponent(\"li\")\nexport const MotionLink = /*@__PURE__*/ createMotionComponent(\"link\")\nexport const MotionMain = /*@__PURE__*/ createMotionComponent(\"main\")\nexport const MotionMap = /*@__PURE__*/ createMotionComponent(\"map\")\nexport const MotionMark = /*@__PURE__*/ createMotionComponent(\"mark\")\nexport const MotionMenu = /*@__PURE__*/ createMotionComponent(\"menu\")\nexport const MotionMenuitem = /*@__PURE__*/ createMotionComponent(\"menuitem\")\nexport const MotionMeter = /*@__PURE__*/ createMotionComponent(\"meter\")\nexport const MotionNav = /*@__PURE__*/ createMotionComponent(\"nav\")\nexport const MotionObject = /*@__PURE__*/ createMotionComponent(\"object\")\nexport const MotionOl = /*@__PURE__*/ createMotionComponent(\"ol\")\nexport const MotionOptgroup = /*@__PURE__*/ createMotionComponent(\"optgroup\")\nexport const MotionOption = /*@__PURE__*/ createMotionComponent(\"option\")\nexport const MotionOutput = /*@__PURE__*/ createMotionComponent(\"output\")\nexport const MotionP = /*@__PURE__*/ createMotionComponent(\"p\")\nexport const MotionParam = /*@__PURE__*/ createMotionComponent(\"param\")\nexport const MotionPicture = /*@__PURE__*/ createMotionComponent(\"picture\")\nexport const MotionPre = /*@__PURE__*/ createMotionComponent(\"pre\")\nexport const MotionProgress = /*@__PURE__*/ createMotionComponent(\"progress\")\nexport const MotionQ = /*@__PURE__*/ createMotionComponent(\"q\")\nexport const MotionRp = /*@__PURE__*/ createMotionComponent(\"rp\")\nexport const MotionRt = /*@__PURE__*/ createMotionComponent(\"rt\")\nexport const MotionRuby = /*@__PURE__*/ createMotionComponent(\"ruby\")\nexport const MotionS = /*@__PURE__*/ createMotionComponent(\"s\")\nexport const MotionSamp = /*@__PURE__*/ createMotionComponent(\"samp\")\nexport const MotionScript = /*@__PURE__*/ createMotionComponent(\"script\")\nexport const MotionSection = /*@__PURE__*/ createMotionComponent(\"section\")\nexport const MotionSelect = /*@__PURE__*/ createMotionComponent(\"select\")\nexport const MotionSmall = /*@__PURE__*/ createMotionComponent(\"small\")\nexport const MotionSource = /*@__PURE__*/ createMotionComponent(\"source\")\nexport const MotionSpan = /*@__PURE__*/ createMotionComponent(\"span\")\nexport const MotionStrong = /*@__PURE__*/ createMotionComponent(\"strong\")\nexport const MotionStyle = /*@__PURE__*/ createMotionComponent(\"style\")\nexport const MotionSub = /*@__PURE__*/ createMotionComponent(\"sub\")\nexport const MotionSummary = /*@__PURE__*/ createMotionComponent(\"summary\")\nexport const MotionSup = /*@__PURE__*/ createMotionComponent(\"sup\")\nexport const MotionTable = /*@__PURE__*/ createMotionComponent(\"table\")\nexport const MotionTbody = /*@__PURE__*/ createMotionComponent(\"tbody\")\nexport const MotionTd = /*@__PURE__*/ createMotionComponent(\"td\")\nexport const MotionTextarea = /*@__PURE__*/ createMotionComponent(\"textarea\")\nexport const MotionTfoot = /*@__PURE__*/ createMotionComponent(\"tfoot\")\nexport const MotionTh = /*@__PURE__*/ createMotionComponent(\"th\")\nexport const MotionThead = /*@__PURE__*/ createMotionComponent(\"thead\")\nexport const MotionTime = /*@__PURE__*/ createMotionComponent(\"time\")\nexport const MotionTitle = /*@__PURE__*/ createMotionComponent(\"title\")\nexport const MotionTr = /*@__PURE__*/ createMotionComponent(\"tr\")\nexport const MotionTrack = /*@__PURE__*/ createMotionComponent(\"track\")\nexport const MotionU = /*@__PURE__*/ createMotionComponent(\"u\")\nexport const MotionUl = /*@__PURE__*/ createMotionComponent(\"ul\")\nexport const MotionVideo = /*@__PURE__*/ createMotionComponent(\"video\")\nexport const MotionWbr = /*@__PURE__*/ createMotionComponent(\"wbr\")\nexport const MotionWebview = /*@__PURE__*/ createMotionComponent(\"webview\")\n\n/**\n * SVG components\n */\nexport const MotionAnimate = /*@__PURE__*/ createMotionComponent(\"animate\")\nexport const MotionCircle = /*@__PURE__*/ createMotionComponent(\"circle\")\nexport const MotionDefs = /*@__PURE__*/ createMotionComponent(\"defs\")\nexport const MotionDesc = /*@__PURE__*/ createMotionComponent(\"desc\")\nexport const MotionEllipse = /*@__PURE__*/ createMotionComponent(\"ellipse\")\nexport const MotionG = /*@__PURE__*/ createMotionComponent(\"g\")\nexport const MotionImage = /*@__PURE__*/ createMotionComponent(\"image\")\nexport const MotionLine = /*@__PURE__*/ createMotionComponent(\"line\")\nexport const MotionFilter = /*@__PURE__*/ createMotionComponent(\"filter\")\nexport const MotionMarker = /*@__PURE__*/ createMotionComponent(\"marker\")\nexport const MotionMask = /*@__PURE__*/ createMotionComponent(\"mask\")\nexport const MotionMetadata = /*@__PURE__*/ createMotionComponent(\"metadata\")\nexport const MotionPath = /*@__PURE__*/ createMotionComponent(\"path\")\nexport const MotionPattern = /*@__PURE__*/ createMotionComponent(\"pattern\")\nexport const MotionPolygon = /*@__PURE__*/ createMotionComponent(\"polygon\")\nexport const MotionPolyline = /*@__PURE__*/ createMotionComponent(\"polyline\")\nexport const MotionRect = /*@__PURE__*/ createMotionComponent(\"rect\")\nexport const MotionStop = /*@__PURE__*/ createMotionComponent(\"stop\")\nexport const MotionSvg = /*@__PURE__*/ createMotionComponent(\"svg\")\nexport const MotionSymbol = /*@__PURE__*/ createMotionComponent(\"symbol\")\nexport const MotionText = /*@__PURE__*/ createMotionComponent(\"text\")\nexport const MotionTspan = /*@__PURE__*/ createMotionComponent(\"tspan\")\nexport const MotionUse = /*@__PURE__*/ createMotionComponent(\"use\")\nexport const MotionView = /*@__PURE__*/ createMotionComponent(\"view\")\nexport const MotionClipPath = /*@__PURE__*/ createMotionComponent(\"clipPath\")\nexport const MotionFeBlend = /*@__PURE__*/ createMotionComponent(\"feBlend\")\nexport const MotionFeColorMatrix =\n /*@__PURE__*/ createMotionComponent(\"feColorMatrix\")\nexport const MotionFeComponentTransfer = /*@__PURE__*/ createMotionComponent(\n \"feComponentTransfer\"\n)\nexport const MotionFeComposite =\n /*@__PURE__*/ createMotionComponent(\"feComposite\")\nexport const MotionFeConvolveMatrix =\n /*@__PURE__*/ createMotionComponent(\"feConvolveMatrix\")\nexport const MotionFeDiffuseLighting =\n /*@__PURE__*/ createMotionComponent(\"feDiffuseLighting\")\nexport const MotionFeDisplacementMap =\n /*@__PURE__*/ createMotionComponent(\"feDisplacementMap\")\nexport const MotionFeDistantLight =\n /*@__PURE__*/ createMotionComponent(\"feDistantLight\")\nexport const MotionFeDropShadow =\n /*@__PURE__*/ createMotionComponent(\"feDropShadow\")\nexport const MotionFeFlood = /*@__PURE__*/ createMotionComponent(\"feFlood\")\nexport const MotionFeFuncA = /*@__PURE__*/ createMotionComponent(\"feFuncA\")\nexport const MotionFeFuncB = /*@__PURE__*/ createMotionComponent(\"feFuncB\")\nexport const MotionFeFuncG = /*@__PURE__*/ createMotionComponent(\"feFuncG\")\nexport const MotionFeFuncR = /*@__PURE__*/ createMotionComponent(\"feFuncR\")\nexport const MotionFeGaussianBlur =\n /*@__PURE__*/ createMotionComponent(\"feGaussianBlur\")\nexport const MotionFeImage = /*@__PURE__*/ createMotionComponent(\"feImage\")\nexport const MotionFeMerge = /*@__PURE__*/ createMotionComponent(\"feMerge\")\nexport const MotionFeMergeNode =\n /*@__PURE__*/ createMotionComponent(\"feMergeNode\")\nexport const MotionFeMorphology =\n /*@__PURE__*/ createMotionComponent(\"feMorphology\")\nexport const MotionFeOffset = /*@__PURE__*/ createMotionComponent(\"feOffset\")\nexport const MotionFePointLight =\n /*@__PURE__*/ createMotionComponent(\"fePointLight\")\nexport const MotionFeSpecularLighting =\n /*@__PURE__*/ createMotionComponent(\"feSpecularLighting\")\nexport const MotionFeSpotLight =\n /*@__PURE__*/ createMotionComponent(\"feSpotLight\")\nexport const MotionFeTile = /*@__PURE__*/ createMotionComponent(\"feTile\")\nexport const MotionFeTurbulence =\n /*@__PURE__*/ createMotionComponent(\"feTurbulence\")\nexport const MotionForeignObject =\n /*@__PURE__*/ createMotionComponent(\"foreignObject\")\nexport const MotionLinearGradient =\n /*@__PURE__*/ createMotionComponent(\"linearGradient\")\nexport const MotionRadialGradient =\n /*@__PURE__*/ createMotionComponent(\"radialGradient\")\nexport const MotionTextPath = /*@__PURE__*/ createMotionComponent(\"textPath\")\n"],"names":["createMotionComponent","featureBundle","createDomVisualElement"],"mappings":";;;;;;;;;;;AAMM,SAAU,iCAAiC,CAI7C,SAAwD,EACxD,OAAgC,EAAA;IAEhC,OAAOA,2BAAqB,CACxB,SAAS,EACT,OAAO,EACPC,2BAAa,EACbC,oCAA6D,CAChE;AACL;;ACfA;;AAEG;AACI,MAAM,OAAO,iBAAiBF,iCAAqB,CAAC,GAAG;AACvD,MAAM,UAAU,iBAAiBA,iCAAqB,CAAC,MAAM;AAC7D,MAAM,aAAa,iBAAiBA,iCAAqB,CAAC,SAAS;AACnE,MAAM,UAAU,iBAAiBA,iCAAqB,CAAC,MAAM;AAC7D,MAAM,aAAa,iBAAiBA,iCAAqB,CAAC,SAAS;AACnE,MAAM,WAAW,iBAAiBA,iCAAqB,CAAC,OAAO;AAC/D,MAAM,WAAW,iBAAiBA,iCAAqB,CAAC,OAAO;AAC/D,MAAM,OAAO,iBAAiBA,iCAAqB,CAAC,GAAG;AACvD,MAAM,UAAU,iBAAiBA,iCAAqB,CAAC,MAAM;AAC7D,MAAM,SAAS,iBAAiBA,iCAAqB,CAAC,KAAK;AAC3D,MAAM,SAAS,iBAAiBA,iCAAqB,CAAC,KAAK;AAC3D,MAAM,SAAS,iBAAiBA,iCAAqB,CAAC,KAAK;MACrD,gBAAgB;AACzB,cAAcA,iCAAqB,CAAC,YAAY;AAC7C,MAAM,UAAU,iBAAiBA,iCAAqB,CAAC,MAAM;AAC7D,MAAM,YAAY,iBAAiBA,iCAAqB,CAAC,QAAQ;AACjE,MAAM,YAAY,iBAAiBA,iCAAqB,CAAC,QAAQ;AACjE,MAAM,aAAa,iBAAiBA,iCAAqB,CAAC,SAAS;AACnE,MAAM,UAAU,iBAAiBA,iCAAqB,CAAC,MAAM;AAC7D,MAAM,UAAU,iBAAiBA,iCAAqB,CAAC,MAAM;A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-motion/dist/cjs/debug.js b/node_modules/framer-motion/dist/cjs/debug.js new file mode 100644 index 0000000..6fb2ed6 --- /dev/null +++ b/node_modules/framer-motion/dist/cjs/debug.js @@ -0,0 +1,13 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var motionDom = require('motion-dom'); + + + +Object.defineProperty(exports, "recordStats", { + enumerable: true, + get: function () { return motionDom.recordStats; } +}); +//# sourceMappingURL=debug.js.map diff --git a/node_modules/framer-motion/dist/cjs/debug.js.map b/node_modules/framer-motion/dist/cjs/debug.js.map new file mode 100644 index 0000000..ec4f5cd --- /dev/null +++ b/node_modules/framer-motion/dist/cjs/debug.js.map @@ -0,0 +1 @@ +{"version":3,"file":"debug.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/cjs/dom-mini.js b/node_modules/framer-motion/dist/cjs/dom-mini.js new file mode 100644 index 0000000..b33c928 --- /dev/null +++ b/node_modules/framer-motion/dist/cjs/dom-mini.js @@ -0,0 +1,531 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var motionDom = require('motion-dom'); +var motionUtils = require('motion-utils'); + +function isDOMKeyframes(keyframes) { + return typeof keyframes === "object" && !Array.isArray(keyframes); +} + +function resolveSubjects(subject, keyframes, scope, selectorCache) { + if (subject == null) { + return []; + } + if (typeof subject === "string" && isDOMKeyframes(keyframes)) { + return motionDom.resolveElements(subject, scope, selectorCache); + } + else if (subject instanceof NodeList) { + return Array.from(subject); + } + else if (Array.isArray(subject)) { + return subject.filter((s) => s != null); + } + else { + return [subject]; + } +} + +function calculateRepeatDuration(duration, repeat, repeatDelay) { + return duration * (repeat + 1) + repeatDelay * repeat; +} + +/** + * Given a absolute or relative time definition and current/prev time state of the sequence, + * calculate an absolute time for the next keyframes. + */ +function calcNextTime(current, next, prev, labels) { + if (typeof next === "number") { + return next; + } + else if (next.startsWith("-") || next.startsWith("+")) { + return Math.max(0, current + parseFloat(next)); + } + else if (next === "<") { + return prev; + } + else if (next.startsWith("<")) { + return Math.max(0, prev + parseFloat(next.slice(1))); + } + else { + return labels.get(next) ?? current; + } +} + +function eraseKeyframes(sequence, startTime, endTime) { + for (let i = 0; i < sequence.length; i++) { + const keyframe = sequence[i]; + if (keyframe.at > startTime && keyframe.at < endTime) { + motionUtils.removeItem(sequence, keyframe); + // If we remove this item we have to push the pointer back one + i--; + } + } +} +function addKeyframes(sequence, keyframes, easing, offset, startTime, endTime) { + /** + * Erase every existing value between currentTime and targetTime, + * this will essentially splice this timeline into any currently + * defined ones. + */ + eraseKeyframes(sequence, startTime, endTime); + for (let i = 0; i < keyframes.length; i++) { + sequence.push({ + value: keyframes[i], + at: motionDom.mixNumber(startTime, endTime, offset[i]), + easing: motionUtils.getEasingForSegment(easing, i), + }); + } +} + +/** + * Take an array of times that represent repeated keyframes. For instance + * if we have original times of [0, 0.5, 1] then our repeated times will + * be [0, 0.5, 1, 1, 1.5, 2]. Loop over the times and scale them back + * down to a 0-1 scale. + * + * `repeatDelayUnits` is the repeatDelay expressed in units of a single + * iteration's duration, so the total span equals `(repeat + 1) + repeat * repeatDelayUnits`. + */ +function normalizeTimes(times, repeat, repeatDelayUnits = 0) { + const totalUnits = repeat + 1 + repeat * repeatDelayUnits; + for (let i = 0; i < times.length; i++) { + times[i] = times[i] / totalUnits; + } +} + +function compareByTime(a, b) { + if (a.at === b.at) { + if (a.value === null) + return 1; + if (b.value === null) + return -1; + return 0; + } + else { + return a.at - b.at; + } +} + +const defaultSegmentEasing = "easeInOut"; +const MAX_REPEAT = 20; +function createAnimationsFromSequence(sequence, { defaultTransition = {}, ...sequenceTransition } = {}, scope, generators) { + const defaultDuration = defaultTransition.duration || 0.3; + const animationDefinitions = new Map(); + const sequences = new Map(); + const elementCache = {}; + const timeLabels = new Map(); + let prevTime = 0; + let currentTime = 0; + let totalDuration = 0; + /** + * Build the timeline by mapping over the sequence array and converting + * the definitions into keyframes and offsets with absolute time values. + * These will later get converted into relative offsets in a second pass. + */ + for (let i = 0; i < sequence.length; i++) { + const segment = sequence[i]; + /** + * If this is a timeline label, mark it and skip the rest of this iteration. + */ + if (typeof segment === "string") { + timeLabels.set(segment, currentTime); + continue; + } + else if (!Array.isArray(segment)) { + timeLabels.set(segment.name, calcNextTime(currentTime, segment.at, prevTime, timeLabels)); + continue; + } + let [subject, keyframes, transition = {}] = segment; + /** + * If a relative or absolute time value has been specified we need to resolve + * it in relation to the currentTime. + */ + if (transition.at !== undefined) { + currentTime = calcNextTime(currentTime, transition.at, prevTime, timeLabels); + } + /** + * Keep track of the maximum duration in this definition. This will be + * applied to currentTime once the definition has been parsed. + */ + let maxDuration = 0; + const resolveValueSequence = (valueKeyframes, valueTransition, valueSequence, elementIndex = 0, numSubjects = 0) => { + const valueKeyframesAsList = keyframesAsList(valueKeyframes); + const { delay = 0, times = motionDom.defaultOffset(valueKeyframesAsList), type = defaultTransition.type || "keyframes", repeat, repeatType, repeatDelay = 0, ...remainingTransition } = valueTransition; + let { ease = defaultTransition.ease || "easeOut", duration } = valueTransition; + /** + * Resolve stagger() if defined. + */ + const calculatedDelay = typeof delay === "function" + ? delay(elementIndex, numSubjects) + : delay; + /** + * If this animation should and can use a spring, generate a spring easing function. + */ + const numKeyframes = valueKeyframesAsList.length; + const createGenerator = motionDom.isGenerator(type) + ? type + : generators?.[type || "keyframes"]; + if (numKeyframes <= 2 && createGenerator) { + /** + * As we're creating an easing function from a spring, + * ideally we want to generate it using the real distance + * between the two keyframes. However this isn't always + * possible - in these situations we use 0-100. + */ + let absoluteDelta = 100; + if (numKeyframes === 2 && + isNumberKeyframesArray(valueKeyframesAsList)) { + const delta = valueKeyframesAsList[1] - valueKeyframesAsList[0]; + absoluteDelta = Math.abs(delta); + } + const springTransition = { + ...defaultTransition, + ...remainingTransition, + }; + if (duration !== undefined) { + springTransition.duration = motionUtils.secondsToMilliseconds(duration); + } + const springEasing = motionDom.createGeneratorEasing(springTransition, absoluteDelta, createGenerator); + ease = springEasing.ease; + duration = springEasing.duration; + } + duration ?? (duration = defaultDuration); + const startTime = currentTime + calculatedDelay; + /** + * If there's only one time offset of 0, fill in a second with length 1 + */ + if (times.length === 1 && times[0] === 0) { + times[1] = 1; + } + /** + * Fill out if offset if fewer offsets than keyframes + */ + const remainder = times.length - valueKeyframesAsList.length; + remainder > 0 && motionDom.fillOffset(times, remainder); + /** + * If only one value has been set, ie [1], push a null to the start of + * the keyframe array. This will let us mark a keyframe at this point + * that will later be hydrated with the previous value. + */ + valueKeyframesAsList.length === 1 && + valueKeyframesAsList.unshift(null); + /** + * Segments can't express `repeat: Infinity` or very large + * counts — they'd leave dead time after the segment or + * explode the keyframe array. Ignore with a warning. + */ + if (repeat) { + motionUtils.warning(repeat < MAX_REPEAT, `Sequence segments can't repeat ${repeat} times — ignoring repeat option. Use a value below ${MAX_REPEAT} or apply repeat at the sequence level instead.`); + } + if (repeat && repeat < MAX_REPEAT) { + /** + * Express repeatDelay in units of a single iteration's duration + * so it can be added to the per-iteration time offsets below + * before they're normalized to 0-1. + */ + const repeatDelayUnits = duration > 0 ? repeatDelay / duration : 0; + duration = calculateRepeatDuration(duration, repeat, repeatDelay); + const originalKeyframes = [...valueKeyframesAsList]; + const originalTimes = [...times]; + ease = Array.isArray(ease) ? [...ease] : [ease]; + const originalEase = [...ease]; + /** + * For reverse/mirror, alternate iterations play the segment + * backwards. mirror matches JSAnimation's mirroredGenerator: + * reversed keyframes, easings unchanged. reverse matches + * JSAnimation's iterationProgress = 1 - p: reversed + * keyframes, easing array reversed AND each function easing + * mapped through reverseEasing (string easings unchanged — + * they're resolved later by the keyframes engine). + */ + const isFlipping = repeatType === "reverse" || repeatType === "mirror"; + let flippedKeyframes = originalKeyframes; + let flippedEases = originalEase; + if (isFlipping) { + flippedKeyframes = [...originalKeyframes].reverse(); + if (repeatType === "reverse") { + flippedEases = [...originalEase] + .reverse() + .map((e) => typeof e === "function" + ? motionUtils.reverseEasing(e) + : e); + } + } + for (let repeatIndex = 0; repeatIndex < repeat; repeatIndex++) { + const isFlipped = isFlipping && repeatIndex % 2 === 0; + const iterKeyframes = isFlipped + ? flippedKeyframes + : originalKeyframes; + const iterEase = isFlipped ? flippedEases : originalEase; + const iterStartOffset = (repeatIndex + 1) * (1 + repeatDelayUnits); + /** + * If repeatDelay is set, hold the previous iteration's + * final value through the delay by inserting a keyframe + * at the moment the next iteration begins. + */ + if (repeatDelayUnits > 0) { + valueKeyframesAsList.push(valueKeyframesAsList[valueKeyframesAsList.length - 1]); + times.push(iterStartOffset); + ease.push("linear"); + } + valueKeyframesAsList.push(...iterKeyframes); + for (let keyframeIndex = 0; keyframeIndex < iterKeyframes.length; keyframeIndex++) { + times.push(originalTimes[keyframeIndex] + iterStartOffset); + ease.push(keyframeIndex === 0 + ? "linear" + : motionUtils.getEasingForSegment(iterEase, keyframeIndex - 1)); + } + } + normalizeTimes(times, repeat, repeatDelayUnits); + } + const targetTime = startTime + duration; + /** + * Add keyframes, mapping offsets to absolute time. + */ + addKeyframes(valueSequence, valueKeyframesAsList, ease, times, startTime, targetTime); + maxDuration = Math.max(calculatedDelay + duration, maxDuration); + totalDuration = Math.max(targetTime, totalDuration); + }; + if (motionDom.isMotionValue(subject)) { + const subjectSequence = getSubjectSequence(subject, sequences); + resolveValueSequence(keyframes, transition, getValueSequence("default", subjectSequence)); + } + else { + const subjects = resolveSubjects(subject, keyframes, scope, elementCache); + const numSubjects = subjects.length; + /** + * For every element in this segment, process the defined values. + */ + for (let subjectIndex = 0; subjectIndex < numSubjects; subjectIndex++) { + /** + * Cast necessary, but we know these are of this type + */ + keyframes = keyframes; + transition = transition; + const thisSubject = subjects[subjectIndex]; + const subjectSequence = getSubjectSequence(thisSubject, sequences); + for (const key in keyframes) { + resolveValueSequence(keyframes[key], getValueTransition(transition, key), getValueSequence(key, subjectSequence), subjectIndex, numSubjects); + } + } + } + prevTime = currentTime; + currentTime += maxDuration; + } + /** + * For every element and value combination create a new animation. + */ + sequences.forEach((valueSequences, element) => { + for (const key in valueSequences) { + const valueSequence = valueSequences[key]; + /** + * Arrange all the keyframes in ascending time order. + */ + valueSequence.sort(compareByTime); + const keyframes = []; + const valueOffset = []; + const valueEasing = []; + /** + * For each keyframe, translate absolute times into + * relative offsets based on the total duration of the timeline. + */ + for (let i = 0; i < valueSequence.length; i++) { + const { at, value, easing } = valueSequence[i]; + keyframes.push(value); + valueOffset.push(motionUtils.progress(0, totalDuration, at)); + valueEasing.push(easing || "easeOut"); + } + /** + * If the first keyframe doesn't land on offset: 0 + * provide one by duplicating the initial keyframe. This ensures + * it snaps to the first keyframe when the animation starts. + */ + if (valueOffset[0] !== 0) { + valueOffset.unshift(0); + keyframes.unshift(keyframes[0]); + valueEasing.unshift(defaultSegmentEasing); + } + /** + * If the last keyframe doesn't land on offset: 1 + * provide one with a null wildcard value. This will ensure it + * stays static until the end of the animation. + */ + if (valueOffset[valueOffset.length - 1] !== 1) { + valueOffset.push(1); + keyframes.push(null); + } + if (!animationDefinitions.has(element)) { + animationDefinitions.set(element, { + keyframes: {}, + transition: {}, + }); + } + const definition = animationDefinitions.get(element); + definition.keyframes[key] = keyframes; + /** + * Exclude `type` from defaultTransition since springs have been + * converted to duration-based easing functions in resolveValueSequence. + * Including `type: "spring"` would cause JSAnimation to error when + * the merged keyframes array has more than 2 keyframes. + */ + const { type: _type, ...remainingDefaultTransition } = defaultTransition; + definition.transition[key] = { + ...remainingDefaultTransition, + duration: totalDuration, + ease: valueEasing, + times: valueOffset, + ...sequenceTransition, + }; + } + }); + return animationDefinitions; +} +function getSubjectSequence(subject, sequences) { + !sequences.has(subject) && sequences.set(subject, {}); + return sequences.get(subject); +} +function getValueSequence(name, sequences) { + if (!sequences[name]) + sequences[name] = []; + return sequences[name]; +} +function keyframesAsList(keyframes) { + return Array.isArray(keyframes) ? keyframes : [keyframes]; +} +function getValueTransition(transition, key) { + return transition && transition[key] + ? { + ...transition, + ...transition[key], + } + : { ...transition }; +} +const isNumber = (keyframe) => typeof keyframe === "number"; +const isNumberKeyframesArray = (keyframes) => keyframes.every(isNumber); + +function animateElements(elementOrSelector, keyframes, options, scope) { + // Gracefully handle null/undefined elements (e.g., from querySelector returning null) + if (elementOrSelector == null) { + return []; + } + const elements = motionDom.resolveElements(elementOrSelector, scope); + const numElements = elements.length; + motionUtils.invariant(Boolean(numElements), "No valid elements provided.", "no-valid-elements"); + /** + * WAAPI doesn't support interrupting animations. + * + * Therefore, starting animations requires a three-step process: + * 1. Stop existing animations (write styles to DOM) + * 2. Resolve keyframes (read styles from DOM) + * 3. Create new animations (write styles to DOM) + * + * The hybrid `animate()` function uses AsyncAnimation to resolve + * keyframes before creating new animations, which removes style + * thrashing. Here, we have much stricter filesize constraints. + * Therefore we do this in a synchronous way that ensures that + * at least within `animate()` calls there is no style thrashing. + * + * In the motion-native-animate-mini-interrupt benchmark this + * was 80% faster than a single loop. + */ + const animationDefinitions = []; + /** + * Step 1: Build options and stop existing animations (write) + */ + for (let i = 0; i < numElements; i++) { + const element = elements[i]; + const elementTransition = { ...options }; + /** + * Resolve stagger function if provided. + */ + if (typeof elementTransition.delay === "function") { + elementTransition.delay = elementTransition.delay(i, numElements); + } + for (const valueName in keyframes) { + let valueKeyframes = keyframes[valueName]; + if (!Array.isArray(valueKeyframes)) { + valueKeyframes = [valueKeyframes]; + } + const valueOptions = { + ...motionDom.getValueTransition(elementTransition, valueName), + }; + valueOptions.duration && (valueOptions.duration = motionUtils.secondsToMilliseconds(valueOptions.duration)); + valueOptions.delay && (valueOptions.delay = motionUtils.secondsToMilliseconds(valueOptions.delay)); + /** + * If there's an existing animation playing on this element then stop it + * before creating a new one. + */ + const map = motionDom.getAnimationMap(element); + const key = motionDom.animationMapKey(valueName, valueOptions.pseudoElement || ""); + const currentAnimation = map.get(key); + currentAnimation && currentAnimation.stop(); + animationDefinitions.push({ + map, + key, + unresolvedKeyframes: valueKeyframes, + options: { + ...valueOptions, + element, + name: valueName, + allowFlatten: !elementTransition.type && !elementTransition.ease, + }, + }); + } + } + /** + * Step 2: Resolve keyframes (read) + */ + for (let i = 0; i < animationDefinitions.length; i++) { + const { unresolvedKeyframes, options: animationOptions } = animationDefinitions[i]; + const { element, name, pseudoElement } = animationOptions; + if (!pseudoElement && unresolvedKeyframes[0] === null) { + unresolvedKeyframes[0] = motionDom.getComputedStyle(element, name); + } + motionDom.fillWildcards(unresolvedKeyframes); + motionDom.applyPxDefaults(unresolvedKeyframes, name); + /** + * If we only have one keyframe, explicitly read the initial keyframe + * from the computed style. This is to ensure consistency with WAAPI behaviour + * for restarting animations, for instance .play() after finish, when it + * has one vs two keyframes. + */ + if (!pseudoElement && unresolvedKeyframes.length < 2) { + unresolvedKeyframes.unshift(motionDom.getComputedStyle(element, name)); + } + animationOptions.keyframes = unresolvedKeyframes; + } + /** + * Step 3: Create new animations (write) + */ + const animations = []; + for (let i = 0; i < animationDefinitions.length; i++) { + const { map, key, options: animationOptions } = animationDefinitions[i]; + const animation = new motionDom.NativeAnimation(animationOptions); + map.set(key, animation); + animation.finished.finally(() => map.delete(key)); + animations.push(animation); + } + return animations; +} + +function animateSequence(definition, options) { + const animations = []; + createAnimationsFromSequence(definition, options).forEach(({ keyframes, transition }, element) => { + animations.push(...animateElements(element, keyframes, transition)); + }); + return new motionDom.GroupAnimationWithThen(animations); +} + +const createScopedWaapiAnimate = (scope) => { + function scopedAnimate(elementOrSelector, keyframes, options) { + return new motionDom.GroupAnimationWithThen(animateElements(elementOrSelector, keyframes, options, scope)); + } + return scopedAnimate; +}; +const animateMini = /*@__PURE__*/ createScopedWaapiAnimate(); + +exports.animate = animateMini; +exports.animateSequence = animateSequence; +//# sourceMappingURL=dom-mini.js.map diff --git a/node_modules/framer-motion/dist/cjs/dom-mini.js.map b/node_modules/framer-motion/dist/cjs/dom-mini.js.map new file mode 100644 index 0000000..571da8e --- /dev/null +++ b/node_modules/framer-motion/dist/cjs/dom-mini.js.map @@ -0,0 +1 @@ +{"version":3,"file":"dom-mini.js","sources":["../../src/animation/utils/is-dom-keyframes.ts","../../src/animation/animate/resolve-subjects.ts","../../src/animation/sequence/utils/calc-repeat-duration.ts","../../src/animation/sequence/utils/calc-time.ts","../../src/animation/sequence/utils/edit.ts","../../src/animation/sequence/utils/normalize-times.ts","../../src/animation/sequence/utils/sort.ts","../../src/animation/sequence/create.ts","../../src/animation/animators/waapi/animate-elements.ts","../../src/animation/animators/waapi/animate-sequence.ts","../../src/animation/animators/waapi/animate-style.ts"],"sourcesContent":["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(\n subject:\n | string\n | Element\n | Element[]\n | NodeListOf\n | O\n | O[]\n | null\n | undefined,\n keyframes: DOMKeyframesDefinition | ObjectTarget,\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\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()\n const elementCache = {}\n const timeLabels = new Map()\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(\n subject: Element | MotionValue | O,\n sequences: Map\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 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>\n key: string\n unresolvedKeyframes: UnresolvedValueKeyframe[]\n options: Omit & {\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 { AnimationPlaybackControls, GroupAnimationWithThen } from \"motion-dom\"\nimport { createAnimationsFromSequence } from \"../../sequence/create\"\nimport { AnimationSequence, SequenceOptions } from \"../../sequence/types\"\nimport { animateElements } from \"./animate-elements\"\n\nexport function animateSequence(\n definition: AnimationSequence,\n options?: SequenceOptions\n) {\n const animations: AnimationPlaybackControls[] = []\n\n createAnimationsFromSequence(definition, options).forEach(\n ({ keyframes, transition }, element: Element) => {\n animations.push(...animateElements(element, keyframes, transition))\n }\n )\n\n return new GroupAnimationWithThen(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"],"names":["resolveElements","removeItem","mixNumber","getEasingForSegment","defaultOffset","isGenerator","secondsToMilliseconds","createGeneratorEasing","fillOffset","warning","reverseEasing","isMotionValue","progress","invariant","getValueTransition","getAnimationMap","animationMapKey","getComputedStyle","fillWildcards","applyPxDefaults","NativeAnimation","GroupAnimationWithThen"],"mappings":";;;;;;;AAEM,SAAU,cAAc,CAC1B,SAAkB,EAAA;AAElB,IAAA,OAAO,OAAO,SAAS,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC;AACrE;;ACGM,SAAU,eAAe,CAC3B,OAQe,EACf,SAAmD,EACnD,KAAsB,EACtB,aAA6B,EAAA;AAE7B,IAAA,IAAI,OAAO,IAAI,IAAI,EAAE;AACjB,QAAA,OAAO,EAAE;IACb;IAEA,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,cAAc,CAAC,SAAS,CAAC,EAAE;QAC1D,OAAOA,yBAAe,CAAC,OAAO,EAAE,KAAK,EAAE,aAAa,CAAC;IACzD;AAAO,SAAA,IAAI,OAAO,YAAY,QAAQ,EAAE;AACpC,QAAA,OAAO,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC;IAC9B;AAAO,SAAA,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;AAC/B,QAAA,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,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IAAIA,gCAAsB,CAC7B,eAAe,CACX,iBAAiB,EACjB,SAAmC,EACnC,OAAO,EACP,KAAK,CACR,CACJ;IACL;AAEA,IAAA,OAAO,aAAa;AACxB,CAAC;MAEY,WAAW,iBAAiB,wBAAwB;;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/cjs/dom.js b/node_modules/framer-motion/dist/cjs/dom.js new file mode 100644 index 0000000..316013a --- /dev/null +++ b/node_modules/framer-motion/dist/cjs/dom.js @@ -0,0 +1,1354 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var motionDom = require('motion-dom'); +var motionUtils = require('motion-utils'); + +function isDOMKeyframes(keyframes) { + return typeof keyframes === "object" && !Array.isArray(keyframes); +} + +function resolveSubjects(subject, keyframes, scope, selectorCache) { + if (subject == null) { + return []; + } + if (typeof subject === "string" && isDOMKeyframes(keyframes)) { + return motionDom.resolveElements(subject, scope, selectorCache); + } + else if (subject instanceof NodeList) { + return Array.from(subject); + } + else if (Array.isArray(subject)) { + return subject.filter((s) => s != null); + } + else { + return [subject]; + } +} + +function calculateRepeatDuration(duration, repeat, repeatDelay) { + return duration * (repeat + 1) + repeatDelay * repeat; +} + +/** + * Given a absolute or relative time definition and current/prev time state of the sequence, + * calculate an absolute time for the next keyframes. + */ +function calcNextTime(current, next, prev, labels) { + if (typeof next === "number") { + return next; + } + else if (next.startsWith("-") || next.startsWith("+")) { + return Math.max(0, current + parseFloat(next)); + } + else if (next === "<") { + return prev; + } + else if (next.startsWith("<")) { + return Math.max(0, prev + parseFloat(next.slice(1))); + } + else { + return labels.get(next) ?? current; + } +} + +function eraseKeyframes(sequence, startTime, endTime) { + for (let i = 0; i < sequence.length; i++) { + const keyframe = sequence[i]; + if (keyframe.at > startTime && keyframe.at < endTime) { + motionUtils.removeItem(sequence, keyframe); + // If we remove this item we have to push the pointer back one + i--; + } + } +} +function addKeyframes(sequence, keyframes, easing, offset, startTime, endTime) { + /** + * Erase every existing value between currentTime and targetTime, + * this will essentially splice this timeline into any currently + * defined ones. + */ + eraseKeyframes(sequence, startTime, endTime); + for (let i = 0; i < keyframes.length; i++) { + sequence.push({ + value: keyframes[i], + at: motionDom.mixNumber(startTime, endTime, offset[i]), + easing: motionUtils.getEasingForSegment(easing, i), + }); + } +} + +/** + * Take an array of times that represent repeated keyframes. For instance + * if we have original times of [0, 0.5, 1] then our repeated times will + * be [0, 0.5, 1, 1, 1.5, 2]. Loop over the times and scale them back + * down to a 0-1 scale. + * + * `repeatDelayUnits` is the repeatDelay expressed in units of a single + * iteration's duration, so the total span equals `(repeat + 1) + repeat * repeatDelayUnits`. + */ +function normalizeTimes(times, repeat, repeatDelayUnits = 0) { + const totalUnits = repeat + 1 + repeat * repeatDelayUnits; + for (let i = 0; i < times.length; i++) { + times[i] = times[i] / totalUnits; + } +} + +function compareByTime(a, b) { + if (a.at === b.at) { + if (a.value === null) + return 1; + if (b.value === null) + return -1; + return 0; + } + else { + return a.at - b.at; + } +} + +const defaultSegmentEasing = "easeInOut"; +const MAX_REPEAT = 20; +function createAnimationsFromSequence(sequence, { defaultTransition = {}, ...sequenceTransition } = {}, scope, generators) { + const defaultDuration = defaultTransition.duration || 0.3; + const animationDefinitions = new Map(); + const sequences = new Map(); + const elementCache = {}; + const timeLabels = new Map(); + let prevTime = 0; + let currentTime = 0; + let totalDuration = 0; + /** + * Build the timeline by mapping over the sequence array and converting + * the definitions into keyframes and offsets with absolute time values. + * These will later get converted into relative offsets in a second pass. + */ + for (let i = 0; i < sequence.length; i++) { + const segment = sequence[i]; + /** + * If this is a timeline label, mark it and skip the rest of this iteration. + */ + if (typeof segment === "string") { + timeLabels.set(segment, currentTime); + continue; + } + else if (!Array.isArray(segment)) { + timeLabels.set(segment.name, calcNextTime(currentTime, segment.at, prevTime, timeLabels)); + continue; + } + let [subject, keyframes, transition = {}] = segment; + /** + * If a relative or absolute time value has been specified we need to resolve + * it in relation to the currentTime. + */ + if (transition.at !== undefined) { + currentTime = calcNextTime(currentTime, transition.at, prevTime, timeLabels); + } + /** + * Keep track of the maximum duration in this definition. This will be + * applied to currentTime once the definition has been parsed. + */ + let maxDuration = 0; + const resolveValueSequence = (valueKeyframes, valueTransition, valueSequence, elementIndex = 0, numSubjects = 0) => { + const valueKeyframesAsList = keyframesAsList(valueKeyframes); + const { delay = 0, times = motionDom.defaultOffset(valueKeyframesAsList), type = defaultTransition.type || "keyframes", repeat, repeatType, repeatDelay = 0, ...remainingTransition } = valueTransition; + let { ease = defaultTransition.ease || "easeOut", duration } = valueTransition; + /** + * Resolve stagger() if defined. + */ + const calculatedDelay = typeof delay === "function" + ? delay(elementIndex, numSubjects) + : delay; + /** + * If this animation should and can use a spring, generate a spring easing function. + */ + const numKeyframes = valueKeyframesAsList.length; + const createGenerator = motionDom.isGenerator(type) + ? type + : generators?.[type || "keyframes"]; + if (numKeyframes <= 2 && createGenerator) { + /** + * As we're creating an easing function from a spring, + * ideally we want to generate it using the real distance + * between the two keyframes. However this isn't always + * possible - in these situations we use 0-100. + */ + let absoluteDelta = 100; + if (numKeyframes === 2 && + isNumberKeyframesArray(valueKeyframesAsList)) { + const delta = valueKeyframesAsList[1] - valueKeyframesAsList[0]; + absoluteDelta = Math.abs(delta); + } + const springTransition = { + ...defaultTransition, + ...remainingTransition, + }; + if (duration !== undefined) { + springTransition.duration = motionUtils.secondsToMilliseconds(duration); + } + const springEasing = motionDom.createGeneratorEasing(springTransition, absoluteDelta, createGenerator); + ease = springEasing.ease; + duration = springEasing.duration; + } + duration ?? (duration = defaultDuration); + const startTime = currentTime + calculatedDelay; + /** + * If there's only one time offset of 0, fill in a second with length 1 + */ + if (times.length === 1 && times[0] === 0) { + times[1] = 1; + } + /** + * Fill out if offset if fewer offsets than keyframes + */ + const remainder = times.length - valueKeyframesAsList.length; + remainder > 0 && motionDom.fillOffset(times, remainder); + /** + * If only one value has been set, ie [1], push a null to the start of + * the keyframe array. This will let us mark a keyframe at this point + * that will later be hydrated with the previous value. + */ + valueKeyframesAsList.length === 1 && + valueKeyframesAsList.unshift(null); + /** + * Segments can't express `repeat: Infinity` or very large + * counts — they'd leave dead time after the segment or + * explode the keyframe array. Ignore with a warning. + */ + if (repeat) { + motionUtils.warning(repeat < MAX_REPEAT, `Sequence segments can't repeat ${repeat} times — ignoring repeat option. Use a value below ${MAX_REPEAT} or apply repeat at the sequence level instead.`); + } + if (repeat && repeat < MAX_REPEAT) { + /** + * Express repeatDelay in units of a single iteration's duration + * so it can be added to the per-iteration time offsets below + * before they're normalized to 0-1. + */ + const repeatDelayUnits = duration > 0 ? repeatDelay / duration : 0; + duration = calculateRepeatDuration(duration, repeat, repeatDelay); + const originalKeyframes = [...valueKeyframesAsList]; + const originalTimes = [...times]; + ease = Array.isArray(ease) ? [...ease] : [ease]; + const originalEase = [...ease]; + /** + * For reverse/mirror, alternate iterations play the segment + * backwards. mirror matches JSAnimation's mirroredGenerator: + * reversed keyframes, easings unchanged. reverse matches + * JSAnimation's iterationProgress = 1 - p: reversed + * keyframes, easing array reversed AND each function easing + * mapped through reverseEasing (string easings unchanged — + * they're resolved later by the keyframes engine). + */ + const isFlipping = repeatType === "reverse" || repeatType === "mirror"; + let flippedKeyframes = originalKeyframes; + let flippedEases = originalEase; + if (isFlipping) { + flippedKeyframes = [...originalKeyframes].reverse(); + if (repeatType === "reverse") { + flippedEases = [...originalEase] + .reverse() + .map((e) => typeof e === "function" + ? motionUtils.reverseEasing(e) + : e); + } + } + for (let repeatIndex = 0; repeatIndex < repeat; repeatIndex++) { + const isFlipped = isFlipping && repeatIndex % 2 === 0; + const iterKeyframes = isFlipped + ? flippedKeyframes + : originalKeyframes; + const iterEase = isFlipped ? flippedEases : originalEase; + const iterStartOffset = (repeatIndex + 1) * (1 + repeatDelayUnits); + /** + * If repeatDelay is set, hold the previous iteration's + * final value through the delay by inserting a keyframe + * at the moment the next iteration begins. + */ + if (repeatDelayUnits > 0) { + valueKeyframesAsList.push(valueKeyframesAsList[valueKeyframesAsList.length - 1]); + times.push(iterStartOffset); + ease.push("linear"); + } + valueKeyframesAsList.push(...iterKeyframes); + for (let keyframeIndex = 0; keyframeIndex < iterKeyframes.length; keyframeIndex++) { + times.push(originalTimes[keyframeIndex] + iterStartOffset); + ease.push(keyframeIndex === 0 + ? "linear" + : motionUtils.getEasingForSegment(iterEase, keyframeIndex - 1)); + } + } + normalizeTimes(times, repeat, repeatDelayUnits); + } + const targetTime = startTime + duration; + /** + * Add keyframes, mapping offsets to absolute time. + */ + addKeyframes(valueSequence, valueKeyframesAsList, ease, times, startTime, targetTime); + maxDuration = Math.max(calculatedDelay + duration, maxDuration); + totalDuration = Math.max(targetTime, totalDuration); + }; + if (motionDom.isMotionValue(subject)) { + const subjectSequence = getSubjectSequence(subject, sequences); + resolveValueSequence(keyframes, transition, getValueSequence("default", subjectSequence)); + } + else { + const subjects = resolveSubjects(subject, keyframes, scope, elementCache); + const numSubjects = subjects.length; + /** + * For every element in this segment, process the defined values. + */ + for (let subjectIndex = 0; subjectIndex < numSubjects; subjectIndex++) { + /** + * Cast necessary, but we know these are of this type + */ + keyframes = keyframes; + transition = transition; + const thisSubject = subjects[subjectIndex]; + const subjectSequence = getSubjectSequence(thisSubject, sequences); + for (const key in keyframes) { + resolveValueSequence(keyframes[key], getValueTransition(transition, key), getValueSequence(key, subjectSequence), subjectIndex, numSubjects); + } + } + } + prevTime = currentTime; + currentTime += maxDuration; + } + /** + * For every element and value combination create a new animation. + */ + sequences.forEach((valueSequences, element) => { + for (const key in valueSequences) { + const valueSequence = valueSequences[key]; + /** + * Arrange all the keyframes in ascending time order. + */ + valueSequence.sort(compareByTime); + const keyframes = []; + const valueOffset = []; + const valueEasing = []; + /** + * For each keyframe, translate absolute times into + * relative offsets based on the total duration of the timeline. + */ + for (let i = 0; i < valueSequence.length; i++) { + const { at, value, easing } = valueSequence[i]; + keyframes.push(value); + valueOffset.push(motionUtils.progress(0, totalDuration, at)); + valueEasing.push(easing || "easeOut"); + } + /** + * If the first keyframe doesn't land on offset: 0 + * provide one by duplicating the initial keyframe. This ensures + * it snaps to the first keyframe when the animation starts. + */ + if (valueOffset[0] !== 0) { + valueOffset.unshift(0); + keyframes.unshift(keyframes[0]); + valueEasing.unshift(defaultSegmentEasing); + } + /** + * If the last keyframe doesn't land on offset: 1 + * provide one with a null wildcard value. This will ensure it + * stays static until the end of the animation. + */ + if (valueOffset[valueOffset.length - 1] !== 1) { + valueOffset.push(1); + keyframes.push(null); + } + if (!animationDefinitions.has(element)) { + animationDefinitions.set(element, { + keyframes: {}, + transition: {}, + }); + } + const definition = animationDefinitions.get(element); + definition.keyframes[key] = keyframes; + /** + * Exclude `type` from defaultTransition since springs have been + * converted to duration-based easing functions in resolveValueSequence. + * Including `type: "spring"` would cause JSAnimation to error when + * the merged keyframes array has more than 2 keyframes. + */ + const { type: _type, ...remainingDefaultTransition } = defaultTransition; + definition.transition[key] = { + ...remainingDefaultTransition, + duration: totalDuration, + ease: valueEasing, + times: valueOffset, + ...sequenceTransition, + }; + } + }); + return animationDefinitions; +} +function getSubjectSequence(subject, sequences) { + !sequences.has(subject) && sequences.set(subject, {}); + return sequences.get(subject); +} +function getValueSequence(name, sequences) { + if (!sequences[name]) + sequences[name] = []; + return sequences[name]; +} +function keyframesAsList(keyframes) { + return Array.isArray(keyframes) ? keyframes : [keyframes]; +} +function getValueTransition(transition, key) { + return transition && transition[key] + ? { + ...transition, + ...transition[key], + } + : { ...transition }; +} +const isNumber = (keyframe) => typeof keyframe === "number"; +const isNumberKeyframesArray = (keyframes) => keyframes.every(isNumber); + +function createDOMVisualElement(element) { + const options = { + presenceContext: null, + props: {}, + visualState: { + renderState: { + transform: {}, + transformOrigin: {}, + style: {}, + vars: {}, + attrs: {}, + }, + latestValues: {}, + }, + }; + const node = motionDom.isSVGElement(element) && !motionDom.isSVGSVGElement(element) + ? new motionDom.SVGVisualElement(options) + : new motionDom.HTMLVisualElement(options); + node.mount(element); + motionDom.visualElementStore.set(element, node); +} +function createObjectVisualElement(subject) { + const options = { + presenceContext: null, + props: {}, + visualState: { + renderState: { + output: {}, + }, + latestValues: {}, + }, + }; + const node = new motionDom.ObjectVisualElement(options); + node.mount(subject); + motionDom.visualElementStore.set(subject, node); +} + +function isSingleValue(subject, keyframes) { + return (motionDom.isMotionValue(subject) || + typeof subject === "number" || + (typeof subject === "string" && !isDOMKeyframes(keyframes))); +} +/** + * Implementation + */ +function animateSubject(subject, keyframes, options, scope) { + const animations = []; + if (isSingleValue(subject, keyframes)) { + animations.push(motionDom.animateSingleValue(subject, isDOMKeyframes(keyframes) + ? keyframes.default || keyframes + : keyframes, options ? options.default || options : options)); + } + else { + // Gracefully handle null/undefined subjects (e.g., from querySelector returning null) + if (subject == null) { + return animations; + } + const subjects = resolveSubjects(subject, keyframes, scope); + const numSubjects = subjects.length; + motionUtils.invariant(Boolean(numSubjects), "No valid elements provided.", "no-valid-elements"); + for (let i = 0; i < numSubjects; i++) { + const thisSubject = subjects[i]; + const createVisualElement = thisSubject instanceof Element + ? createDOMVisualElement + : createObjectVisualElement; + if (!motionDom.visualElementStore.has(thisSubject)) { + createVisualElement(thisSubject); + } + const visualElement = motionDom.visualElementStore.get(thisSubject); + const transition = { ...options }; + /** + * Resolve stagger function if provided. + */ + if ("delay" in transition && + typeof transition.delay === "function") { + transition.delay = transition.delay(i, numSubjects); + } + animations.push(...motionDom.animateTarget(visualElement, { ...keyframes, transition }, {})); + } + } + return animations; +} + +function animateSequence(sequence, options, scope) { + const animations = []; + /** + * Pre-process: replace function segments with MotionValue segments, + * subscribe callbacks immediately + */ + const processedSequence = sequence.map((segment) => { + if (Array.isArray(segment) && typeof segment[0] === "function") { + const callback = segment[0]; + const mv = motionDom.motionValue(0); + mv.on("change", callback); + if (segment.length === 1) { + return [mv, [0, 1]]; + } + else if (segment.length === 2) { + return [mv, [0, 1], segment[1]]; + } + else { + return [mv, segment[1], segment[2]]; + } + } + return segment; + }); + const animationDefinitions = createAnimationsFromSequence(processedSequence, options, scope, { spring: motionDom.spring }); + animationDefinitions.forEach(({ keyframes, transition }, subject) => { + animations.push(...animateSubject(subject, keyframes, transition)); + }); + return animations; +} + +function isSequence(value) { + return Array.isArray(value) && value.some(Array.isArray); +} +/** + * Creates an animation function that is optionally scoped + * to a specific element. + */ +function createScopedAnimate(options = {}) { + const { scope, reduceMotion, skipAnimations } = options; + /** + * Implementation + */ + function scopedAnimate(subjectOrSequence, optionsOrKeyframes, options) { + let animations = []; + let animationOnComplete; + const inherited = {}; + if (reduceMotion !== undefined) + inherited.reduceMotion = reduceMotion; + if (skipAnimations !== undefined) + inherited.skipAnimations = skipAnimations; + if (isSequence(subjectOrSequence)) { + const { onComplete, ...sequenceOptions } = optionsOrKeyframes || {}; + if (typeof onComplete === "function") { + animationOnComplete = onComplete; + } + animations = animateSequence(subjectOrSequence, { ...inherited, ...sequenceOptions }, scope); + } + else { + // Extract top-level onComplete so it doesn't get applied per-value + const { onComplete, ...rest } = options || {}; + if (typeof onComplete === "function") { + animationOnComplete = onComplete; + } + animations = animateSubject(subjectOrSequence, optionsOrKeyframes, { ...inherited, ...rest }, scope); + } + const animation = new motionDom.GroupAnimationWithThen(animations); + if (animationOnComplete) { + animation.finished.then(animationOnComplete); + } + if (scope) { + scope.animations.push(animation); + animation.finished.then(() => { + motionUtils.removeItem(scope.animations, animation); + }); + } + return animation; + } + return scopedAnimate; +} +const animate = createScopedAnimate(); + +function animateElements(elementOrSelector, keyframes, options, scope) { + // Gracefully handle null/undefined elements (e.g., from querySelector returning null) + if (elementOrSelector == null) { + return []; + } + const elements = motionDom.resolveElements(elementOrSelector, scope); + const numElements = elements.length; + motionUtils.invariant(Boolean(numElements), "No valid elements provided.", "no-valid-elements"); + /** + * WAAPI doesn't support interrupting animations. + * + * Therefore, starting animations requires a three-step process: + * 1. Stop existing animations (write styles to DOM) + * 2. Resolve keyframes (read styles from DOM) + * 3. Create new animations (write styles to DOM) + * + * The hybrid `animate()` function uses AsyncAnimation to resolve + * keyframes before creating new animations, which removes style + * thrashing. Here, we have much stricter filesize constraints. + * Therefore we do this in a synchronous way that ensures that + * at least within `animate()` calls there is no style thrashing. + * + * In the motion-native-animate-mini-interrupt benchmark this + * was 80% faster than a single loop. + */ + const animationDefinitions = []; + /** + * Step 1: Build options and stop existing animations (write) + */ + for (let i = 0; i < numElements; i++) { + const element = elements[i]; + const elementTransition = { ...options }; + /** + * Resolve stagger function if provided. + */ + if (typeof elementTransition.delay === "function") { + elementTransition.delay = elementTransition.delay(i, numElements); + } + for (const valueName in keyframes) { + let valueKeyframes = keyframes[valueName]; + if (!Array.isArray(valueKeyframes)) { + valueKeyframes = [valueKeyframes]; + } + const valueOptions = { + ...motionDom.getValueTransition(elementTransition, valueName), + }; + valueOptions.duration && (valueOptions.duration = motionUtils.secondsToMilliseconds(valueOptions.duration)); + valueOptions.delay && (valueOptions.delay = motionUtils.secondsToMilliseconds(valueOptions.delay)); + /** + * If there's an existing animation playing on this element then stop it + * before creating a new one. + */ + const map = motionDom.getAnimationMap(element); + const key = motionDom.animationMapKey(valueName, valueOptions.pseudoElement || ""); + const currentAnimation = map.get(key); + currentAnimation && currentAnimation.stop(); + animationDefinitions.push({ + map, + key, + unresolvedKeyframes: valueKeyframes, + options: { + ...valueOptions, + element, + name: valueName, + allowFlatten: !elementTransition.type && !elementTransition.ease, + }, + }); + } + } + /** + * Step 2: Resolve keyframes (read) + */ + for (let i = 0; i < animationDefinitions.length; i++) { + const { unresolvedKeyframes, options: animationOptions } = animationDefinitions[i]; + const { element, name, pseudoElement } = animationOptions; + if (!pseudoElement && unresolvedKeyframes[0] === null) { + unresolvedKeyframes[0] = motionDom.getComputedStyle(element, name); + } + motionDom.fillWildcards(unresolvedKeyframes); + motionDom.applyPxDefaults(unresolvedKeyframes, name); + /** + * If we only have one keyframe, explicitly read the initial keyframe + * from the computed style. This is to ensure consistency with WAAPI behaviour + * for restarting animations, for instance .play() after finish, when it + * has one vs two keyframes. + */ + if (!pseudoElement && unresolvedKeyframes.length < 2) { + unresolvedKeyframes.unshift(motionDom.getComputedStyle(element, name)); + } + animationOptions.keyframes = unresolvedKeyframes; + } + /** + * Step 3: Create new animations (write) + */ + const animations = []; + for (let i = 0; i < animationDefinitions.length; i++) { + const { map, key, options: animationOptions } = animationDefinitions[i]; + const animation = new motionDom.NativeAnimation(animationOptions); + map.set(key, animation); + animation.finished.finally(() => map.delete(key)); + animations.push(animation); + } + return animations; +} + +const createScopedWaapiAnimate = (scope) => { + function scopedAnimate(elementOrSelector, keyframes, options) { + return new motionDom.GroupAnimationWithThen(animateElements(elementOrSelector, keyframes, options, scope)); + } + return scopedAnimate; +}; +const animateMini = /*@__PURE__*/ createScopedWaapiAnimate(); + +function canUseNativeTimeline(target) { + if (typeof window === "undefined") + return false; + return target ? motionDom.supportsViewTimeline() : motionDom.supportsScrollTimeline(); +} + +/** + * A time in milliseconds, beyond which we consider the scroll velocity to be 0. + */ +const maxElapsed = 50; +const createAxisInfo = () => ({ + current: 0, + offset: [], + progress: 0, + scrollLength: 0, + targetOffset: 0, + targetLength: 0, + containerLength: 0, + velocity: 0, +}); +const createScrollInfo = () => ({ + time: 0, + x: createAxisInfo(), + y: createAxisInfo(), +}); +const keys = { + x: { + length: "Width", + position: "Left", + }, + y: { + length: "Height", + position: "Top", + }, +}; +function updateAxisInfo(element, axisName, info, time) { + const axis = info[axisName]; + const { length, position } = keys[axisName]; + const prev = axis.current; + const prevTime = info.time; + axis.current = Math.abs(element[`scroll${position}`]); + axis.scrollLength = element[`scroll${length}`] - element[`client${length}`]; + axis.offset.length = 0; + axis.offset[0] = 0; + axis.offset[1] = axis.scrollLength; + axis.progress = motionUtils.progress(0, axis.scrollLength, axis.current); + const elapsed = time - prevTime; + axis.velocity = + elapsed > maxElapsed + ? 0 + : motionUtils.velocityPerSecond(axis.current - prev, elapsed); +} +function updateScrollInfo(element, info, time) { + updateAxisInfo(element, "x", info, time); + updateAxisInfo(element, "y", info, time); + info.time = time; +} + +function calcInset(element, container) { + const inset = { x: 0, y: 0 }; + let current = element; + while (current && current !== container) { + if (motionDom.isHTMLElement(current)) { + inset.x += current.offsetLeft; + inset.y += current.offsetTop; + current = current.offsetParent; + } + else if (current.tagName === "svg") { + /** + * This isn't an ideal approach to measuring the offset of tags. + * It would be preferable, given they behave like HTMLElements in most ways + * to use offsetLeft/Top. But these don't exist on . Likewise we + * can't use .getBBox() like most SVG elements as these provide the offset + * relative to the SVG itself, which for is usually 0x0. + */ + const svgBoundingBox = current.getBoundingClientRect(); + current = current.parentElement; + const parentBoundingBox = current.getBoundingClientRect(); + inset.x += svgBoundingBox.left - parentBoundingBox.left; + inset.y += svgBoundingBox.top - parentBoundingBox.top; + } + else if (current instanceof SVGGraphicsElement) { + const { x, y } = current.getBBox(); + inset.x += x; + inset.y += y; + let svg = null; + let parent = current.parentNode; + while (!svg) { + if (parent.tagName === "svg") { + svg = parent; + } + parent = current.parentNode; + } + current = svg; + } + else { + break; + } + } + return inset; +} + +const namedEdges = { + start: 0, + center: 0.5, + end: 1, +}; +function resolveEdge(edge, length, inset = 0) { + let delta = 0; + /** + * If we have this edge defined as a preset, replace the definition + * with the numerical value. + */ + if (edge in namedEdges) { + edge = namedEdges[edge]; + } + /** + * Handle unit values + */ + if (typeof edge === "string") { + const asNumber = parseFloat(edge); + if (edge.endsWith("px")) { + delta = asNumber; + } + else if (edge.endsWith("%")) { + edge = asNumber / 100; + } + else if (edge.endsWith("vw")) { + delta = (asNumber / 100) * document.documentElement.clientWidth; + } + else if (edge.endsWith("vh")) { + delta = (asNumber / 100) * document.documentElement.clientHeight; + } + else { + edge = asNumber; + } + } + /** + * If the edge is defined as a number, handle as a progress value. + */ + if (typeof edge === "number") { + delta = length * edge; + } + return inset + delta; +} + +const defaultOffset = [0, 0]; +function resolveOffset(offset, containerLength, targetLength, targetInset) { + let offsetDefinition = Array.isArray(offset) ? offset : defaultOffset; + let targetPoint = 0; + let containerPoint = 0; + if (typeof offset === "number") { + /** + * If we're provided offset: [0, 0.5, 1] then each number x should become + * [x, x], so we default to the behaviour of mapping 0 => 0 of both target + * and container etc. + */ + offsetDefinition = [offset, offset]; + } + else if (typeof offset === "string") { + offset = offset.trim(); + if (offset.includes(" ")) { + offsetDefinition = offset.split(" "); + } + else { + /** + * If we're provided a definition like "100px" then we want to apply + * that only to the top of the target point, leaving the container at 0. + * Whereas a named offset like "end" should be applied to both. + */ + offsetDefinition = [offset, namedEdges[offset] ? offset : `0`]; + } + } + targetPoint = resolveEdge(offsetDefinition[0], targetLength, targetInset); + containerPoint = resolveEdge(offsetDefinition[1], containerLength); + return targetPoint - containerPoint; +} + +const ScrollOffset = { + Enter: [ + [0, 1], + [1, 1], + ], + Exit: [ + [0, 0], + [1, 0], + ], + Any: [ + [1, 0], + [0, 1], + ], + All: [ + [0, 0], + [1, 1], + ], +}; + +const point = { x: 0, y: 0 }; +function getTargetSize(target) { + return "getBBox" in target && target.tagName !== "svg" + ? target.getBBox() + : { width: target.clientWidth, height: target.clientHeight }; +} +function resolveOffsets(container, info, options) { + const { offset: offsetDefinition = ScrollOffset.All } = options; + const { target = container, axis = "y" } = options; + const lengthLabel = axis === "y" ? "height" : "width"; + const inset = target !== container ? calcInset(target, container) : point; + /** + * Measure the target and container. If they're the same thing then we + * use the container's scrollWidth/Height as the target, from there + * all other calculations can remain the same. + */ + const targetSize = target === container + ? { width: container.scrollWidth, height: container.scrollHeight } + : getTargetSize(target); + const containerSize = { + width: container.clientWidth, + height: container.clientHeight, + }; + /** + * Reset the length of the resolved offset array rather than creating a new one. + * TODO: More reusable data structures for targetSize/containerSize would also be good. + */ + info[axis].offset.length = 0; + /** + * Populate the offset array by resolving the user's offset definition into + * a list of pixel scroll offets. + */ + let hasChanged = !info[axis].interpolate; + const numOffsets = offsetDefinition.length; + for (let i = 0; i < numOffsets; i++) { + const offset = resolveOffset(offsetDefinition[i], containerSize[lengthLabel], targetSize[lengthLabel], inset[axis]); + if (!hasChanged && offset !== info[axis].interpolatorOffsets[i]) { + hasChanged = true; + } + info[axis].offset[i] = offset; + } + /** + * If the pixel scroll offsets have changed, create a new interpolator function + * to map scroll value into a progress. + */ + if (hasChanged) { + info[axis].interpolate = motionDom.interpolate(info[axis].offset, motionDom.defaultOffset(offsetDefinition), { clamp: false }); + info[axis].interpolatorOffsets = [...info[axis].offset]; + } + info[axis].progress = motionUtils.clamp(0, 1, info[axis].interpolate(info[axis].current)); +} + +function measure(container, target = container, info) { + /** + * Find inset of target within scrollable container + */ + info.x.targetOffset = 0; + info.y.targetOffset = 0; + if (target !== container) { + let node = target; + while (node && node !== container) { + info.x.targetOffset += node.offsetLeft; + info.y.targetOffset += node.offsetTop; + node = node.offsetParent; + } + } + info.x.targetLength = + target === container ? target.scrollWidth : target.clientWidth; + info.y.targetLength = + target === container ? target.scrollHeight : target.clientHeight; + info.x.containerLength = container.clientWidth; + info.y.containerLength = container.clientHeight; + /** + * In development mode ensure scroll containers aren't position: static as this makes + * it difficult to measure their relative positions. The document scrolling element + * is exempt: offsetParent measurements naturally resolve relative to the document. + */ + if (process.env.NODE_ENV !== "production") { + if (container && + target && + target !== container && + container !== document.documentElement && + container !== document.scrollingElement && + container !== document.body) { + motionUtils.warnOnce(getComputedStyle(container).position !== "static", "Please ensure that the container has a non-static position, like 'relative', 'fixed', or 'absolute' to ensure scroll offset is calculated correctly."); + } + } +} +function createOnScrollHandler(element, onScroll, info, options = {}) { + return { + measure: (time) => { + measure(element, options.target, info); + updateScrollInfo(element, info, time); + if (options.offset || options.target) { + resolveOffsets(element, info, options); + } + }, + notify: () => onScroll(info), + }; +} + +const scrollListeners = new WeakMap(); +const resizeListeners = new WeakMap(); +const onScrollHandlers = new WeakMap(); +const scrollSize = new WeakMap(); +const dimensionCheckProcesses = new WeakMap(); +const getEventTarget = (element) => element === document.scrollingElement ? window : element; +function scrollInfo(onScroll, { container = document.scrollingElement, trackContentSize = false, ...options } = {}) { + if (!container) + return motionUtils.noop; + let containerHandlers = onScrollHandlers.get(container); + /** + * Get the onScroll handlers for this container. + * If one isn't found, create a new one. + */ + if (!containerHandlers) { + containerHandlers = new Set(); + onScrollHandlers.set(container, containerHandlers); + } + /** + * Create a new onScroll handler for the provided callback. + */ + const info = createScrollInfo(); + const containerHandler = createOnScrollHandler(container, onScroll, info, options); + containerHandlers.add(containerHandler); + /** + * Check if there's a scroll event listener for this container. + * If not, create one. + */ + if (!scrollListeners.has(container)) { + const measureAll = () => { + for (const handler of containerHandlers) { + handler.measure(motionDom.frameData.timestamp); + } + motionDom.frame.preUpdate(notifyAll); + }; + const notifyAll = () => { + for (const handler of containerHandlers) { + handler.notify(); + } + }; + const listener = () => motionDom.frame.read(measureAll); + scrollListeners.set(container, listener); + const target = getEventTarget(container); + window.addEventListener("resize", listener); + if (container !== document.documentElement) { + resizeListeners.set(container, motionDom.resize(container, listener)); + } + target.addEventListener("scroll", listener); + listener(); + } + /** + * Enable content size tracking if requested and not already enabled. + */ + if (trackContentSize && !dimensionCheckProcesses.has(container)) { + const listener = scrollListeners.get(container); + // Store initial scroll dimensions (object is reused to avoid allocation) + const size = { + width: container.scrollWidth, + height: container.scrollHeight, + }; + scrollSize.set(container, size); + // Add frame-based scroll dimension checking to detect content changes + const checkScrollDimensions = () => { + const newWidth = container.scrollWidth; + const newHeight = container.scrollHeight; + if (size.width !== newWidth || size.height !== newHeight) { + listener(); + size.width = newWidth; + size.height = newHeight; + } + }; + // Schedule with keepAlive=true to run every frame + const dimensionCheckProcess = motionDom.frame.read(checkScrollDimensions, true); + dimensionCheckProcesses.set(container, dimensionCheckProcess); + } + const listener = scrollListeners.get(container); + motionDom.frame.read(listener, false, true); + return () => { + motionDom.cancelFrame(listener); + /** + * Check if we even have any handlers for this container. + */ + const currentHandlers = onScrollHandlers.get(container); + if (!currentHandlers) + return; + currentHandlers.delete(containerHandler); + if (currentHandlers.size) + return; + /** + * If no more handlers, remove the scroll listener too. + */ + const scrollListener = scrollListeners.get(container); + scrollListeners.delete(container); + if (scrollListener) { + getEventTarget(container).removeEventListener("scroll", scrollListener); + resizeListeners.get(container)?.(); + window.removeEventListener("resize", scrollListener); + } + // Clean up scroll dimension checking + const dimensionCheckProcess = dimensionCheckProcesses.get(container); + if (dimensionCheckProcess) { + motionDom.cancelFrame(dimensionCheckProcess); + dimensionCheckProcesses.delete(container); + } + scrollSize.delete(container); + }; +} + +/** + * Maps from ProgressIntersection pairs used by Motion's preset offsets to + * ViewTimeline named ranges. Returns undefined for unrecognised patterns, + * which signals the caller to fall back to JS-based scroll tracking. + */ +const presets = [ + [ScrollOffset.Enter, "entry"], + [ScrollOffset.Exit, "exit"], + [ScrollOffset.Any, "cover"], + [ScrollOffset.All, "contain"], +]; +const stringToProgress = { + start: 0, + end: 1, +}; +function parseStringOffset(s) { + const parts = s.trim().split(/\s+/); + if (parts.length !== 2) + return undefined; + const a = stringToProgress[parts[0]]; + const b = stringToProgress[parts[1]]; + if (a === undefined || b === undefined) + return undefined; + return [a, b]; +} +function normaliseOffset(offset) { + if (offset.length !== 2) + return undefined; + const result = []; + for (const item of offset) { + if (Array.isArray(item)) { + result.push(item); + } + else if (typeof item === "string") { + const parsed = parseStringOffset(item); + if (!parsed) + return undefined; + result.push(parsed); + } + else { + return undefined; + } + } + return result; +} +function matchesPreset(offset, preset) { + const normalised = normaliseOffset(offset); + if (!normalised) + return false; + for (let i = 0; i < 2; i++) { + const o = normalised[i]; + const p = preset[i]; + if (o[0] !== p[0] || o[1] !== p[1]) + return false; + } + return true; +} +function offsetToViewTimelineRange(offset) { + if (!offset) { + return { rangeStart: "contain 0%", rangeEnd: "contain 100%" }; + } + for (const [preset, name] of presets) { + if (matchesPreset(offset, preset)) { + return { rangeStart: `${name} 0%`, rangeEnd: `${name} 100%` }; + } + } + return undefined; +} + +const timelineCache = new Map(); +function scrollTimelineFallback(options) { + const currentTime = { value: 0 }; + const cancel = scrollInfo((info) => { + currentTime.value = info[options.axis].progress * 100; + }, options); + return { currentTime, cancel }; +} +function getTimeline({ source, container, ...options }) { + const { axis } = options; + if (source) + container = source; + let containerCache = timelineCache.get(container); + if (!containerCache) { + containerCache = new Map(); + timelineCache.set(container, containerCache); + } + const targetKey = options.target ?? "self"; + let targetCache = containerCache.get(targetKey); + if (!targetCache) { + targetCache = {}; + containerCache.set(targetKey, targetCache); + } + const axisKey = axis + (options.offset ?? []).join(","); + if (!targetCache[axisKey]) { + if (options.target && canUseNativeTimeline(options.target)) { + const range = offsetToViewTimelineRange(options.offset); + if (range) { + targetCache[axisKey] = new ViewTimeline({ + subject: options.target, + axis, + }); + } + else { + targetCache[axisKey] = scrollTimelineFallback({ + container, + ...options, + }); + } + } + else if (canUseNativeTimeline()) { + targetCache[axisKey] = new ScrollTimeline({ + source: container, + axis, + }); + } + else { + targetCache[axisKey] = scrollTimelineFallback({ + container, + ...options, + }); + } + } + return targetCache[axisKey]; +} + +function attachToAnimation(animation, options) { + const timeline = getTimeline(options); + const range = options.target + ? offsetToViewTimelineRange(options.offset) + : undefined; + /** + * Use native timeline when: + * - No target: ScrollTimeline (existing behaviour) + * - Target with mappable offset: ViewTimeline with named range + * - Target with unmappable offset: fall back to JS observe + */ + const useNative = options.target + ? canUseNativeTimeline(options.target) && !!range + : canUseNativeTimeline(); + return animation.attachTimeline({ + timeline: useNative ? timeline : undefined, + ...(range && + useNative && { + rangeStart: range.rangeStart, + rangeEnd: range.rangeEnd, + }), + observe: (valueAnimation) => { + valueAnimation.pause(); + return motionDom.observeTimeline((progress) => { + valueAnimation.time = + valueAnimation.iterationDuration * progress; + }, timeline); + }, + }); +} + +/** + * Currently, we only support element tracking with `scrollInfo`, though in + * the future we can also offer ViewTimeline support. + */ +function isElementTracking(options) { + return options && (options.target || options.offset); +} + +/** + * If the onScroll function has two arguments, it's expecting + * more specific information about the scroll from scrollInfo. + */ +function isOnScrollWithInfo(onScroll) { + return onScroll.length === 2; +} +function attachToFunction(onScroll, options) { + if (isOnScrollWithInfo(onScroll) || isElementTracking(options)) { + return scrollInfo((info) => { + onScroll(info[options.axis].progress, info); + }, options); + } + else { + return motionDom.observeTimeline(onScroll, getTimeline(options)); + } +} + +function scroll(onScroll, { axis = "y", container = document.scrollingElement, ...options } = {}) { + if (!container) + return motionUtils.noop; + const optionsWithDefaults = { axis, container, ...options }; + return typeof onScroll === "function" + ? attachToFunction(onScroll, optionsWithDefaults) + : attachToAnimation(onScroll, optionsWithDefaults); +} + +const thresholds = { + some: 0, + all: 1, +}; +function inView(elementOrSelector, onStart, { root, margin: rootMargin, amount = "some" } = {}) { + const elements = motionDom.resolveElements(elementOrSelector); + const activeIntersections = new WeakMap(); + const onIntersectionChange = (entries) => { + entries.forEach((entry) => { + const onEnd = activeIntersections.get(entry.target); + /** + * If there's no change to the intersection, we don't need to + * do anything here. + */ + if (entry.isIntersecting === Boolean(onEnd)) + return; + if (entry.isIntersecting) { + const newOnEnd = onStart(entry.target, entry); + if (typeof newOnEnd === "function") { + activeIntersections.set(entry.target, newOnEnd); + } + else { + observer.unobserve(entry.target); + } + } + else if (typeof onEnd === "function") { + onEnd(entry); + activeIntersections.delete(entry.target); + } + }); + }; + const observer = new IntersectionObserver(onIntersectionChange, { + root, + rootMargin, + threshold: typeof amount === "number" ? amount : thresholds[amount], + }); + elements.forEach((element) => observer.observe(element)); + return () => observer.disconnect(); +} + +const distance = (a, b) => Math.abs(a - b); +function distance2D(a, b) { + // Multi-dimensional + const xDelta = distance(a.x, b.x); + const yDelta = distance(a.y, b.y); + return Math.sqrt(xDelta ** 2 + yDelta ** 2); +} + +Object.defineProperty(exports, "delay", { + enumerable: true, + get: function () { return motionDom.delayInSeconds; } +}); +exports.animate = animate; +exports.animateMini = animateMini; +exports.createScopedAnimate = createScopedAnimate; +exports.distance = distance; +exports.distance2D = distance2D; +exports.inView = inView; +exports.scroll = scroll; +exports.scrollInfo = scrollInfo; +Object.keys(motionDom).forEach(function (k) { + if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { + enumerable: true, + get: function () { return motionDom[k]; } + }); +}); +Object.keys(motionUtils).forEach(function (k) { + if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { + enumerable: true, + get: function () { return motionUtils[k]; } + }); +}); +//# sourceMappingURL=dom.js.map diff --git a/node_modules/framer-motion/dist/cjs/dom.js.map b/node_modules/framer-motion/dist/cjs/dom.js.map new file mode 100644 index 0000000..fe5b9d6 --- /dev/null +++ b/node_modules/framer-motion/dist/cjs/dom.js.map @@ -0,0 +1 @@ +{"version":3,"file":"dom.js","sources":["../../src/animation/utils/is-dom-keyframes.ts","../../src/animation/animate/resolve-subjects.ts","../../src/animation/sequence/utils/calc-repeat-duration.ts","../../src/animation/sequence/utils/calc-time.ts","../../src/animation/sequence/utils/edit.ts","../../src/animation/sequence/utils/normalize-times.ts","../../src/animation/sequence/utils/sort.ts","../../src/animation/sequence/create.ts","../../src/animation/utils/create-visual-element.ts","../../src/animation/animate/subject.ts","../../src/animation/animate/sequence.ts","../../src/animation/animate/index.ts","../../src/animation/animators/waapi/animate-elements.ts","../../src/animation/animators/waapi/animate-style.ts","../../src/render/dom/scroll/utils/can-use-native-timeline.ts","../../src/render/dom/scroll/info.ts","../../src/render/dom/scroll/offsets/inset.ts","../../src/render/dom/scroll/offsets/edge.ts","../../src/render/dom/scroll/offsets/offset.ts","../../src/render/dom/scroll/offsets/presets.ts","../../src/render/dom/scroll/offsets/index.ts","../../src/render/dom/scroll/on-scroll-handler.ts","../../src/render/dom/scroll/track.ts","../../src/render/dom/scroll/utils/offset-to-range.ts","../../src/render/dom/scroll/utils/get-timeline.ts","../../src/render/dom/scroll/attach-animation.ts","../../src/render/dom/scroll/utils/is-element-tracking.ts","../../src/render/dom/scroll/attach-function.ts","../../src/render/dom/scroll/index.ts","../../src/render/dom/viewport/index.ts","../../src/utils/distance.ts"],"sourcesContent":["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(\n subject:\n | string\n | Element\n | Element[]\n | NodeListOf\n | O\n | O[]\n | null\n | undefined,\n keyframes: DOMKeyframesDefinition | ObjectTarget,\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\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()\n const elementCache = {}\n const timeLabels = new Map()\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(\n subject: Element | MotionValue | O,\n sequences: Map\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\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,\n keyframes: string | UnresolvedValueKeyframe[],\n options?: ValueAnimationTransition\n): AnimationPlaybackControlsWithThen[]\n/**\n * Animate a number\n */\nexport function animateSubject(\n value: number | MotionValue,\n keyframes: number | UnresolvedValueKeyframe[],\n options?: ValueAnimationTransition\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(\n object: O | O[],\n keyframes: ObjectTarget,\n options?: DynamicAnimationOptions\n): AnimationPlaybackControlsWithThen[]\n/**\n * Implementation\n */\nexport function animateSubject(\n subject:\n | MotionValue\n | MotionValue\n | number\n | string\n | ElementOrSelector\n | O\n | O[],\n keyframes:\n | number\n | string\n | UnresolvedValueKeyframe[]\n | UnresolvedValueKeyframe[]\n | DOMKeyframesDefinition\n | ObjectTarget,\n options?:\n | ValueAnimationTransition\n | ValueAnimationTransition\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,\n keyframes: string | UnresolvedValueKeyframe[],\n options?: ValueAnimationTransition\n ): AnimationPlaybackControlsWithThen\n /**\n * Animate a number\n */\n function scopedAnimate(\n value: number | MotionValue,\n keyframes: number | UnresolvedValueKeyframe[],\n options?: ValueAnimationTransition\n ): AnimationPlaybackControlsWithThen\n /**\n * Animate a generic motion value\n */\n function scopedAnimate(\n value: V | MotionValue,\n keyframes: V | UnresolvedValueKeyframe[],\n options?: ValueAnimationTransition\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(\n object: O | O[],\n keyframes: ObjectTarget,\n options?: DynamicAnimationOptions\n ): AnimationPlaybackControlsWithThen\n /**\n * Implementation\n */\n function scopedAnimate(\n subjectOrSequence:\n | AnimationSequence\n | MotionValue\n | MotionValue\n | number\n | string\n | ElementOrSelector\n | O\n | O[],\n optionsOrKeyframes?:\n | SequenceOptions\n | number\n | string\n | UnresolvedValueKeyframe[]\n | UnresolvedValueKeyframe[]\n | DOMKeyframesDefinition\n | ObjectTarget,\n options?:\n | ValueAnimationTransition\n | ValueAnimationTransition\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>\n key: string\n unresolvedKeyframes: UnresolvedValueKeyframe[]\n options: Omit & {\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 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 . Likewise we\n * can't use .getBBox() like most SVG elements as these provide the offset\n * relative to the SVG itself, which for 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 = {\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 = {\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()\nconst resizeListeners = new WeakMap()\nconst onScrollHandlers = new WeakMap>()\nconst scrollSize = new WeakMap()\nconst dimensionCheckProcesses = new WeakMap()\n\nexport type ScrollTargets = Array\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 = {\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>\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()\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"],"names":["resolveElements","removeItem","mixNumber","getEasingForSegment","defaultOffset","isGenerator","secondsToMilliseconds","createGeneratorEasing","fillOffset","warning","reverseEasing","isMotionValue","progress","isSVGElement","isSVGSVGElement","SVGVisualElement","HTMLVisualElement","visualElementStore","ObjectVisualElement","animateSingleValue","invariant","animateTarget","motionValue","spring","GroupAnimationWithThen","getValueTransition","getAnimationMap","animationMapKey","getComputedStyle","fillWildcards","applyPxDefaults","NativeAnimation","supportsViewTimeline","supportsScrollTimeline","velocityPerSecond","isHTMLElement","interpolate","clamp","warnOnce","noop","frameData","frame","resize","cancelFrame","ScrollOffsetPresets","observeTimeline"],"mappings":";;;;;;;AAEM,SAAU,cAAc,CAC1B,SAAkB,EAAA;AAElB,IAAA,OAAO,OAAO,SAAS,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC;AACrE;;ACGM,SAAU,eAAe,CAC3B,OAQe,EACf,SAAmD,EACnD,KAAsB,EACtB,aAA6B,EAAA;AAE7B,IAAA,IAAI,OAAO,IAAI,IAAI,EAAE;AACjB,QAAA,OAAO,EAAE;IACb;IAEA,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,cAAc,CAAC,SAAS,CAAC,EAAE;QAC1D,OAAOA,yBAAe,CAAC,OAAO,EAAE,KAAK,EAAE,aAAa,CAAC;IACzD;AAAO,SAAA,IAAI,OAAO,YAAY,QAAQ,EAAE;AACpC,QAAA,OAAO,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC;IAC9B;AAAO,SAAA,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;AAC/B,QAAA,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC;IAC3C;SAAO;QACH,OAAO,CAAC,OAAO,CAAC;IACpB;AACJ;;SCpCgB,uBAAuB,CACnC,QAAgB,EAChB,MAAc,EACd,WAAmB,EAAA;IAEnB,OAAO,QAAQ,IAAI,MAAM,GAAG,CAAC,CAAC,GAAG,WAAW,GAAG,MAAM;AACzD;;ACJA;;;AAGG;AACG,SAAU,YAAY,CACxB,OAAe,EACf,IAAkB,EA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M,IAAI,CAAC,GAAG,MAAM,IAAI,CAAC,CAAC;AAC/C;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/cjs/feature-bundle-BZV7Y7IM.js b/node_modules/framer-motion/dist/cjs/feature-bundle-BZV7Y7IM.js new file mode 100644 index 0000000..0a3ff76 --- /dev/null +++ b/node_modules/framer-motion/dist/cjs/feature-bundle-BZV7Y7IM.js @@ -0,0 +1,1660 @@ +'use strict'; + +var motionDom = require('motion-dom'); +var React = require('react'); +var index = require('./index-BuO47Yrm.js'); +var motionUtils = require('motion-utils'); +var jsxRuntime = require('react/jsx-runtime'); + +/** + * When a component is the child of `AnimatePresence`, it can use `usePresence` + * to access information about whether it's still present in the React tree. + * + * ```jsx + * import { usePresence } from "framer-motion" + * + * export const Component = () => { + * const [isPresent, safeToRemove] = usePresence() + * + * useEffect(() => { + * !isPresent && setTimeout(safeToRemove, 1000) + * }, [isPresent]) + * + * return
+ * } + * ``` + * + * If `isPresent` is `false`, it means that a component has been removed from the tree, + * but `AnimatePresence` won't really remove it until `safeToRemove` has been called. + * + * @public + */ +function usePresence(subscribe = true) { + const context = React.useContext(index.PresenceContext); + if (context === null) + return [true, null]; + const { isPresent, onExitComplete, register } = context; + // It's safe to call the following hooks conditionally (after an early return) because the context will always + // either be null or non-null for the lifespan of the component. + const id = React.useId(); + React.useEffect(() => { + if (subscribe) { + return register(id); + } + }, [subscribe]); + const safeToRemove = React.useCallback(() => subscribe && onExitComplete && onExitComplete(id), [id, onExitComplete, subscribe]); + return !isPresent && onExitComplete ? [false, safeToRemove] : [true]; +} +/** + * Similar to `usePresence`, except `useIsPresent` simply returns whether or not the component is present. + * There is no `safeToRemove` function. + * + * ```jsx + * import { useIsPresent } from "framer-motion" + * + * export const Component = () => { + * const isPresent = useIsPresent() + * + * useEffect(() => { + * !isPresent && console.log("I've been removed!") + * }, [isPresent]) + * + * return
+ * } + * ``` + * + * @public + */ +function useIsPresent() { + return isPresent(React.useContext(index.PresenceContext)); +} +function isPresent(context) { + return context === null ? true : context.isPresent; +} + +const createDomVisualElement = (Component, options) => { + /** + * Use explicit isSVG override if provided, otherwise auto-detect + */ + const isSVG = options.isSVG ?? index.isSVGComponent(Component); + return isSVG + ? new motionDom.SVGVisualElement(options) + : new motionDom.HTMLVisualElement(options, { + allowProjection: Component !== React.Fragment, + }); +}; + +class AnimationFeature extends motionDom.Feature { + /** + * We dynamically generate the AnimationState manager as it contains a reference + * to the underlying animation library. We only want to load that if we load this, + * so people can optionally code split it out using the `m` component. + */ + constructor(node) { + super(node); + node.animationState || (node.animationState = motionDom.createAnimationState(node)); + } + updateAnimationControlsSubscription() { + const { animate } = this.node.getProps(); + if (motionDom.isAnimationControls(animate)) { + this.unmountControls = animate.subscribe(this.node); + } + } + /** + * Subscribe any provided AnimationControls to the component's VisualElement + */ + mount() { + this.updateAnimationControlsSubscription(); + } + update() { + const { animate } = this.node.getProps(); + const { animate: prevAnimate } = this.node.prevProps || {}; + if (animate !== prevAnimate) { + this.updateAnimationControlsSubscription(); + } + } + unmount() { + this.node.animationState.reset(); + this.unmountControls?.(); + } +} + +let id = 0; +class ExitAnimationFeature extends motionDom.Feature { + constructor() { + super(...arguments); + this.id = id++; + this.isExitComplete = false; + } + update() { + if (!this.node.presenceContext) + return; + const { isPresent, onExitComplete } = this.node.presenceContext; + const { isPresent: prevIsPresent } = this.node.prevPresenceContext || {}; + if (!this.node.animationState || isPresent === prevIsPresent) { + return; + } + if (isPresent && prevIsPresent === false) { + /** + * When re-entering, if the exit animation already completed + * (element is at rest), reset to initial values so the enter + * animation replays from the correct position. + */ + if (this.isExitComplete) { + const { initial, custom } = this.node.getProps(); + if (typeof initial === "string" || + (typeof initial === "object" && + initial !== null && + !Array.isArray(initial))) { + const resolved = motionDom.resolveVariant(this.node, initial, custom); + if (resolved) { + const { transition, transitionEnd, ...target } = resolved; + for (const key in target) { + this.node + .getValue(key) + ?.jump(target[key]); + } + } + } + this.node.animationState.reset(); + this.node.animationState.animateChanges(); + } + else { + this.node.animationState.setActive("exit", false); + } + this.isExitComplete = false; + return; + } + const exitAnimation = this.node.animationState.setActive("exit", !isPresent); + if (onExitComplete && !isPresent) { + exitAnimation.then(() => { + this.isExitComplete = true; + onExitComplete(this.id); + }); + } + } + mount() { + const { register, onExitComplete } = this.node.presenceContext || {}; + if (onExitComplete) { + onExitComplete(this.id); + } + if (register) { + this.unmount = register(this.id); + } + } + unmount() { } +} + +const animations = { + animation: { + Feature: AnimationFeature, + }, + exit: { + Feature: ExitAnimationFeature, + }, +}; + +function extractEventInfo(event) { + return { + point: { + x: event.pageX, + y: event.pageY, + }, + }; +} +const addPointerInfo = (handler) => (event) => motionDom.isPrimaryPointer(event) && handler(event, extractEventInfo(event)); + +function addPointerEvent(target, eventName, handler, options) { + return motionDom.addDomEvent(target, eventName, addPointerInfo(handler), options); +} + +// Fixes https://github.com/motiondivision/motion/issues/2270 +const getContextWindow = ({ current }) => { + return current ? current.ownerDocument.defaultView : null; +}; + +const distance = (a, b) => Math.abs(a - b); +function distance2D(a, b) { + // Multi-dimensional + const xDelta = distance(a.x, b.x); + const yDelta = distance(a.y, b.y); + return Math.sqrt(xDelta ** 2 + yDelta ** 2); +} + +const overflowStyles = /*#__PURE__*/ new Set(["auto", "scroll"]); +/** + * @internal + */ +class PanSession { + constructor(event, handlers, { transformPagePoint, contextWindow = window, dragSnapToOrigin = false, distanceThreshold = 3, element, } = {}) { + /** + * @internal + */ + this.startEvent = null; + /** + * @internal + */ + this.lastMoveEvent = null; + /** + * @internal + */ + this.lastMoveEventInfo = null; + /** + * Raw (untransformed) event info, re-transformed each frame + * so transformPagePoint sees the current parent matrix. + * @internal + */ + this.lastRawMoveEventInfo = null; + /** + * @internal + */ + this.handlers = {}; + /** + * @internal + */ + this.contextWindow = window; + /** + * Scroll positions of scrollable ancestors and window. + * @internal + */ + this.scrollPositions = new Map(); + /** + * Cleanup function for scroll listeners. + * @internal + */ + this.removeScrollListeners = null; + this.onElementScroll = (event) => { + this.handleScroll(event.target); + }; + this.onWindowScroll = () => { + this.handleScroll(window); + }; + this.updatePoint = () => { + if (!(this.lastMoveEvent && this.lastMoveEventInfo)) + return; + // Re-transform raw point through current transformPagePoint so + // animated parent transforms (e.g. rotation) are picked up each frame + if (this.lastRawMoveEventInfo) { + this.lastMoveEventInfo = transformPoint(this.lastRawMoveEventInfo, this.transformPagePoint); + } + const info = getPanInfo(this.lastMoveEventInfo, this.history); + const isPanStarted = this.startEvent !== null; + // Only start panning if the offset is larger than 3 pixels. If we make it + // any larger than this we'll want to reset the pointer history + // on the first update to avoid visual snapping to the cursor. + const isDistancePastThreshold = distance2D(info.offset, { x: 0, y: 0 }) >= this.distanceThreshold; + if (!isPanStarted && !isDistancePastThreshold) + return; + const { point } = info; + const { timestamp } = motionDom.frameData; + this.history.push({ ...point, timestamp }); + const { onStart, onMove } = this.handlers; + if (!isPanStarted) { + onStart && onStart(this.lastMoveEvent, info); + this.startEvent = this.lastMoveEvent; + } + onMove && onMove(this.lastMoveEvent, info); + }; + this.handlePointerMove = (event, info) => { + this.lastMoveEvent = event; + this.lastRawMoveEventInfo = info; + this.lastMoveEventInfo = transformPoint(info, this.transformPagePoint); + // Throttle mouse move event to once per frame + motionDom.frame.update(this.updatePoint, true); + }; + this.handlePointerUp = (event, info) => { + this.end(); + const { onEnd, onSessionEnd, resumeAnimation } = this.handlers; + // Resume animation if dragSnapToOrigin is set OR if no drag started (user just clicked) + // This ensures constraint animations continue when interrupted by a click + if (this.dragSnapToOrigin || !this.startEvent) { + resumeAnimation && resumeAnimation(); + } + if (!(this.lastMoveEvent && this.lastMoveEventInfo)) + return; + const panInfo = getPanInfo(event.type === "pointercancel" + ? this.lastMoveEventInfo + : transformPoint(info, this.transformPagePoint), this.history); + if (this.startEvent && onEnd) { + onEnd(event, panInfo); + } + onSessionEnd && onSessionEnd(event, panInfo); + }; + // If we have more than one touch, don't start detecting this gesture + if (!motionDom.isPrimaryPointer(event)) + return; + this.dragSnapToOrigin = dragSnapToOrigin; + this.handlers = handlers; + this.transformPagePoint = transformPagePoint; + this.distanceThreshold = distanceThreshold; + this.contextWindow = contextWindow || window; + const info = extractEventInfo(event); + const initialInfo = transformPoint(info, this.transformPagePoint); + const { point } = initialInfo; + const { timestamp } = motionDom.frameData; + this.history = [{ ...point, timestamp }]; + const { onSessionStart } = handlers; + onSessionStart && + onSessionStart(event, getPanInfo(initialInfo, this.history)); + // Listen in the capture phase so a descendant calling + // stopPropagation() (e.g. in its own pointerup handler) can't + // prevent the gesture from ending. See #2794. + const eventOptions = { passive: true, capture: true }; + this.removeListeners = motionUtils.pipe(addPointerEvent(this.contextWindow, "pointermove", this.handlePointerMove, eventOptions), addPointerEvent(this.contextWindow, "pointerup", this.handlePointerUp, eventOptions), addPointerEvent(this.contextWindow, "pointercancel", this.handlePointerUp, eventOptions)); + // Start scroll tracking if element provided + if (element) { + this.startScrollTracking(element); + } + } + /** + * Start tracking scroll on ancestors and window. + */ + startScrollTracking(element) { + // Store initial scroll positions for scrollable ancestors + let current = element.parentElement; + while (current) { + const style = getComputedStyle(current); + if (overflowStyles.has(style.overflowX) || + overflowStyles.has(style.overflowY)) { + this.scrollPositions.set(current, { + x: current.scrollLeft, + y: current.scrollTop, + }); + } + current = current.parentElement; + } + // Track window scroll + this.scrollPositions.set(window, { + x: window.scrollX, + y: window.scrollY, + }); + // Capture listener catches element scroll events as they bubble + window.addEventListener("scroll", this.onElementScroll, { + capture: true, + }); + // Direct window scroll listener (window scroll doesn't bubble) + window.addEventListener("scroll", this.onWindowScroll); + this.removeScrollListeners = () => { + window.removeEventListener("scroll", this.onElementScroll, { + capture: true, + }); + window.removeEventListener("scroll", this.onWindowScroll); + }; + } + /** + * Handle scroll compensation during drag. + * + * For element scroll: adjusts history origin since pageX/pageY doesn't change. + * For window scroll: adjusts lastMoveEventInfo since pageX/pageY would change. + */ + handleScroll(target) { + const initial = this.scrollPositions.get(target); + if (!initial) + return; + const isWindow = target === window; + const current = isWindow + ? { x: window.scrollX, y: window.scrollY } + : { + x: target.scrollLeft, + y: target.scrollTop, + }; + const delta = { x: current.x - initial.x, y: current.y - initial.y }; + if (delta.x === 0 && delta.y === 0) + return; + if (isWindow) { + // Window scroll: pageX/pageY changes, so update lastMoveEventInfo + if (this.lastMoveEventInfo) { + this.lastMoveEventInfo.point.x += delta.x; + this.lastMoveEventInfo.point.y += delta.y; + } + } + else { + // Element scroll: pageX/pageY unchanged, so adjust history origin + if (this.history.length > 0) { + this.history[0].x -= delta.x; + this.history[0].y -= delta.y; + } + } + this.scrollPositions.set(target, current); + motionDom.frame.update(this.updatePoint, true); + } + updateHandlers(handlers) { + this.handlers = handlers; + } + end() { + this.removeListeners && this.removeListeners(); + this.removeScrollListeners && this.removeScrollListeners(); + this.scrollPositions.clear(); + motionDom.cancelFrame(this.updatePoint); + } +} +function transformPoint(info, transformPagePoint) { + return transformPagePoint ? { point: transformPagePoint(info.point) } : info; +} +function subtractPoint(a, b) { + return { x: a.x - b.x, y: a.y - b.y }; +} +function getPanInfo({ point }, history) { + return { + point, + delta: subtractPoint(point, lastDevicePoint(history)), + offset: subtractPoint(point, startDevicePoint(history)), + velocity: getVelocity(history, 0.1), + }; +} +function startDevicePoint(history) { + return history[0]; +} +function lastDevicePoint(history) { + return history[history.length - 1]; +} +function getVelocity(history, timeDelta) { + if (history.length < 2) { + return { x: 0, y: 0 }; + } + let i = history.length - 1; + let timestampedPoint = null; + const lastPoint = lastDevicePoint(history); + while (i >= 0) { + timestampedPoint = history[i]; + if (lastPoint.timestamp - timestampedPoint.timestamp > + motionUtils.secondsToMilliseconds(timeDelta)) { + break; + } + i--; + } + if (!timestampedPoint) { + return { x: 0, y: 0 }; + } + /** + * If the selected point is the pointer-down origin (history[0]), + * there are better movement points available, and the time gap + * is suspiciously large (>2x timeDelta), use the next point instead. + * This prevents stale pointer-down points from diluting velocity + * in hold-then-flick gestures. + */ + if (timestampedPoint === history[0] && + history.length > 2 && + lastPoint.timestamp - timestampedPoint.timestamp > + motionUtils.secondsToMilliseconds(timeDelta) * 2) { + timestampedPoint = history[1]; + } + const time = motionUtils.millisecondsToSeconds(lastPoint.timestamp - timestampedPoint.timestamp); + if (time === 0) { + return { x: 0, y: 0 }; + } + const currentVelocity = { + x: (lastPoint.x - timestampedPoint.x) / time, + y: (lastPoint.y - timestampedPoint.y) / time, + }; + if (currentVelocity.x === Infinity) { + currentVelocity.x = 0; + } + if (currentVelocity.y === Infinity) { + currentVelocity.y = 0; + } + return currentVelocity; +} + +/** + * Apply constraints to a point. These constraints are both physical along an + * axis, and an elastic factor that determines how much to constrain the point + * by if it does lie outside the defined parameters. + */ +function applyConstraints(point, { min, max }, elastic) { + if (min !== undefined && point < min) { + // If we have a min point defined, and this is outside of that, constrain + point = elastic + ? motionDom.mixNumber(min, point, elastic.min) + : Math.max(point, min); + } + else if (max !== undefined && point > max) { + // If we have a max point defined, and this is outside of that, constrain + point = elastic + ? motionDom.mixNumber(max, point, elastic.max) + : Math.min(point, max); + } + return point; +} +/** + * Calculate constraints in terms of the viewport when defined relatively to the + * measured axis. This is measured from the nearest edge, so a max constraint of 200 + * on an axis with a max value of 300 would return a constraint of 500 - axis length + */ +function calcRelativeAxisConstraints(axis, min, max) { + return { + min: min !== undefined ? axis.min + min : undefined, + max: max !== undefined + ? axis.max + max - (axis.max - axis.min) + : undefined, + }; +} +/** + * Calculate constraints in terms of the viewport when + * defined relatively to the measured bounding box. + */ +function calcRelativeConstraints(layoutBox, { top, left, bottom, right }) { + return { + x: calcRelativeAxisConstraints(layoutBox.x, left, right), + y: calcRelativeAxisConstraints(layoutBox.y, top, bottom), + }; +} +/** + * Calculate viewport constraints when defined as another viewport-relative axis + */ +function calcViewportAxisConstraints(layoutAxis, constraintsAxis) { + let min = constraintsAxis.min - layoutAxis.min; + let max = constraintsAxis.max - layoutAxis.max; + // If the constraints axis is actually smaller than the layout axis then we can + // flip the constraints + if (constraintsAxis.max - constraintsAxis.min < + layoutAxis.max - layoutAxis.min) { + [min, max] = [max, min]; + } + return { min, max }; +} +/** + * Calculate viewport constraints when defined as another viewport-relative box + */ +function calcViewportConstraints(layoutBox, constraintsBox) { + return { + x: calcViewportAxisConstraints(layoutBox.x, constraintsBox.x), + y: calcViewportAxisConstraints(layoutBox.y, constraintsBox.y), + }; +} +/** + * Calculate a transform origin relative to the source axis, between 0-1, that results + * in an asthetically pleasing scale/transform needed to project from source to target. + */ +function calcOrigin(source, target) { + let origin = 0.5; + const sourceLength = motionDom.calcLength(source); + const targetLength = motionDom.calcLength(target); + if (targetLength > sourceLength) { + origin = motionUtils.progress(target.min, target.max - sourceLength, source.min); + } + else if (sourceLength > targetLength) { + origin = motionUtils.progress(source.min, source.max - targetLength, target.min); + } + return motionUtils.clamp(0, 1, origin); +} +/** + * Rebase the calculated viewport constraints relative to the layout.min point. + */ +function rebaseAxisConstraints(layout, constraints) { + const relativeConstraints = {}; + if (constraints.min !== undefined) { + relativeConstraints.min = constraints.min - layout.min; + } + if (constraints.max !== undefined) { + relativeConstraints.max = constraints.max - layout.min; + } + return relativeConstraints; +} +const defaultElastic = 0.35; +/** + * Accepts a dragElastic prop and returns resolved elastic values for each axis. + */ +function resolveDragElastic(dragElastic = defaultElastic) { + if (dragElastic === false) { + dragElastic = 0; + } + else if (dragElastic === true) { + dragElastic = defaultElastic; + } + return { + x: resolveAxisElastic(dragElastic, "left", "right"), + y: resolveAxisElastic(dragElastic, "top", "bottom"), + }; +} +function resolveAxisElastic(dragElastic, minLabel, maxLabel) { + return { + min: resolvePointElastic(dragElastic, minLabel), + max: resolvePointElastic(dragElastic, maxLabel), + }; +} +function resolvePointElastic(dragElastic, label) { + return typeof dragElastic === "number" + ? dragElastic + : dragElastic[label] || 0; +} + +const elementDragControls = new WeakMap(); +class VisualElementDragControls { + constructor(visualElement) { + this.openDragLock = null; + this.isDragging = false; + this.currentDirection = null; + this.originPoint = { x: 0, y: 0 }; + /** + * The permitted boundaries of travel, in pixels. + */ + this.constraints = false; + this.hasMutatedConstraints = false; + /** + * The per-axis resolved elastic values. + */ + this.elastic = motionDom.createBox(); + /** + * The latest pointer event. Used as fallback when the `cancel` and `stop` functions are called without arguments. + */ + this.latestPointerEvent = null; + /** + * The latest pan info. Used as fallback when the `cancel` and `stop` functions are called without arguments. + */ + this.latestPanInfo = null; + this.visualElement = visualElement; + } + start(originEvent, { snapToCursor = false, distanceThreshold } = {}) { + /** + * Don't start dragging if this component is exiting + */ + const { presenceContext } = this.visualElement; + if (presenceContext && presenceContext.isPresent === false) + return; + const onSessionStart = (event) => { + if (snapToCursor) { + this.snapToCursor(extractEventInfo(event).point); + } + this.stopAnimation(); + }; + const onStart = (event, info) => { + // Attempt to grab the global drag gesture lock - maybe make this part of PanSession + const { drag, dragPropagation, onDragStart } = this.getProps(); + if (drag && !dragPropagation) { + if (this.openDragLock) + this.openDragLock(); + this.openDragLock = motionDom.setDragLock(drag); + // If we don 't have the lock, don't start dragging + if (!this.openDragLock) + return; + } + this.latestPointerEvent = event; + this.latestPanInfo = info; + this.isDragging = true; + this.currentDirection = null; + this.resolveConstraints(); + if (this.visualElement.projection) { + this.visualElement.projection.isAnimationBlocked = true; + this.visualElement.projection.target = undefined; + } + /** + * Record gesture origin and pointer offset + */ + motionDom.eachAxis((axis) => { + let current = this.getAxisMotionValue(axis).get() || 0; + /** + * If the MotionValue is a percentage value convert to px + */ + if (motionDom.percent.test(current)) { + const { projection } = this.visualElement; + if (projection && projection.layout) { + const measuredAxis = projection.layout.layoutBox[axis]; + if (measuredAxis) { + const length = motionDom.calcLength(measuredAxis); + current = length * (parseFloat(current) / 100); + } + } + } + this.originPoint[axis] = current; + }); + // Fire onDragStart event + if (onDragStart) { + motionDom.frame.update(() => onDragStart(event, info), false, true); + } + motionDom.addValueToWillChange(this.visualElement, "transform"); + const { animationState } = this.visualElement; + animationState && animationState.setActive("whileDrag", true); + }; + const onMove = (event, info) => { + this.latestPointerEvent = event; + this.latestPanInfo = info; + const { dragPropagation, dragDirectionLock, onDirectionLock, onDrag, } = this.getProps(); + // If we didn't successfully receive the gesture lock, early return. + if (!dragPropagation && !this.openDragLock) + return; + const { offset } = info; + // Attempt to detect drag direction if directionLock is true + if (dragDirectionLock && this.currentDirection === null) { + this.currentDirection = getCurrentDirection(offset); + // If we've successfully set a direction, notify listener + if (this.currentDirection !== null) { + onDirectionLock && onDirectionLock(this.currentDirection); + } + return; + } + // Update each point with the latest position + this.updateAxis("x", info.point, offset); + this.updateAxis("y", info.point, offset); + /** + * Ideally we would leave the renderer to fire naturally at the end of + * this frame but if the element is about to change layout as the result + * of a re-render we want to ensure the browser can read the latest + * bounding box to ensure the pointer and element don't fall out of sync. + */ + this.visualElement.render(); + /** + * This must fire after the render call as it might trigger a state + * change which itself might trigger a layout update. + */ + if (onDrag) { + motionDom.frame.update(() => onDrag(event, info), false, true); + } + }; + const onSessionEnd = (event, info) => { + this.latestPointerEvent = event; + this.latestPanInfo = info; + this.stop(event, info); + this.latestPointerEvent = null; + this.latestPanInfo = null; + }; + const resumeAnimation = () => { + const { dragSnapToOrigin: snap } = this.getProps(); + if (snap || this.constraints) { + this.startAnimation({ x: 0, y: 0 }); + } + }; + const { dragSnapToOrigin } = this.getProps(); + this.panSession = new PanSession(originEvent, { + onSessionStart, + onStart, + onMove, + onSessionEnd, + resumeAnimation, + }, { + transformPagePoint: this.visualElement.getTransformPagePoint(), + dragSnapToOrigin, + distanceThreshold, + contextWindow: getContextWindow(this.visualElement), + element: this.visualElement.current, + }); + } + /** + * @internal + */ + stop(event, panInfo) { + const finalEvent = event || this.latestPointerEvent; + const finalPanInfo = panInfo || this.latestPanInfo; + const isDragging = this.isDragging; + this.cancel(); + if (!isDragging || !finalPanInfo || !finalEvent) + return; + const { velocity } = finalPanInfo; + this.startAnimation(velocity); + const { onDragEnd } = this.getProps(); + if (onDragEnd) { + motionDom.frame.postRender(() => onDragEnd(finalEvent, finalPanInfo)); + } + } + /** + * @internal + */ + cancel() { + this.isDragging = false; + const { projection, animationState } = this.visualElement; + if (projection) { + projection.isAnimationBlocked = false; + } + this.endPanSession(); + const { dragPropagation } = this.getProps(); + if (!dragPropagation && this.openDragLock) { + this.openDragLock(); + this.openDragLock = null; + } + animationState && animationState.setActive("whileDrag", false); + } + /** + * Clean up the pan session without modifying other drag state. + * This is used during unmount to ensure event listeners are removed + * without affecting projection animations or drag locks. + * @internal + */ + endPanSession() { + this.panSession && this.panSession.end(); + this.panSession = undefined; + } + updateAxis(axis, _point, offset) { + const { drag } = this.getProps(); + // If we're not dragging this axis, do an early return. + if (!offset || !shouldDrag(axis, drag, this.currentDirection)) + return; + const axisValue = this.getAxisMotionValue(axis); + let next = this.originPoint[axis] + offset[axis]; + // Apply constraints + if (this.constraints && this.constraints[axis]) { + next = applyConstraints(next, this.constraints[axis], this.elastic[axis]); + } + axisValue.set(next); + } + resolveConstraints() { + const { dragConstraints, dragElastic } = this.getProps(); + const layout = this.visualElement.projection && + !this.visualElement.projection.layout + ? this.visualElement.projection.measure(false) + : this.visualElement.projection?.layout; + const prevConstraints = this.constraints; + if (dragConstraints && index.isRefObject(dragConstraints)) { + if (!this.constraints) { + this.constraints = this.resolveRefConstraints(); + } + } + else { + if (dragConstraints && layout) { + this.constraints = calcRelativeConstraints(layout.layoutBox, dragConstraints); + } + else { + this.constraints = false; + } + } + this.elastic = resolveDragElastic(dragElastic); + /** + * If we're outputting to external MotionValues, we want to rebase the measured constraints + * from viewport-relative to component-relative. This only applies to relative (non-ref) + * constraints, as ref-based constraints from calcViewportConstraints are already in the + * correct coordinate space for the motion value transform offset. + */ + if (prevConstraints !== this.constraints && + !index.isRefObject(dragConstraints) && + layout && + this.constraints && + !this.hasMutatedConstraints) { + motionDom.eachAxis((axis) => { + if (this.constraints !== false && + this.getAxisMotionValue(axis)) { + this.constraints[axis] = rebaseAxisConstraints(layout.layoutBox[axis], this.constraints[axis]); + } + }); + } + } + resolveRefConstraints() { + const { dragConstraints: constraints, onMeasureDragConstraints } = this.getProps(); + if (!constraints || !index.isRefObject(constraints)) + return false; + const constraintsElement = constraints.current; + motionUtils.invariant(constraintsElement !== null, "If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.", "drag-constraints-ref"); + const { projection } = this.visualElement; + // TODO + if (!projection || !projection.layout) + return false; + /** + * Refresh the root scroll offset so the constraint's viewport box + * translates to correct page coordinates. The scroll captured at + * drag mount can be stale if the document was scrolled afterwards — + * e.g. via the browser restoring scroll on refresh, or an ancestor + * layout effect running after this element's mount (#2829). + * + * Clear the cached scroll first so `updateScroll` bypasses its + * per-animationId cache and re-reads the live value. + */ + if (projection.root) { + projection.root.scroll = undefined; + projection.root.updateScroll(); + } + const constraintsBox = motionDom.measurePageBox(constraintsElement, projection.root, this.visualElement.getTransformPagePoint()); + let measuredConstraints = calcViewportConstraints(projection.layout.layoutBox, constraintsBox); + /** + * If there's an onMeasureDragConstraints listener we call it and + * if different constraints are returned, set constraints to that + */ + if (onMeasureDragConstraints) { + const userConstraints = onMeasureDragConstraints(motionDom.convertBoxToBoundingBox(measuredConstraints)); + this.hasMutatedConstraints = !!userConstraints; + if (userConstraints) { + measuredConstraints = motionDom.convertBoundingBoxToBox(userConstraints); + } + } + return measuredConstraints; + } + startAnimation(velocity) { + const { drag, dragMomentum, dragElastic, dragTransition, dragSnapToOrigin, onDragTransitionEnd, } = this.getProps(); + const constraints = this.constraints || {}; + const momentumAnimations = motionDom.eachAxis((axis) => { + if (!shouldDrag(axis, drag, this.currentDirection)) { + return; + } + let transition = (constraints && constraints[axis]) || {}; + if (dragSnapToOrigin === true || + dragSnapToOrigin === axis) + transition = { min: 0, max: 0 }; + /** + * Overdamp the boundary spring if `dragElastic` is disabled. There's still a frame + * of spring animations so we should look into adding a disable spring option to `inertia`. + * We could do something here where we affect the `bounceStiffness` and `bounceDamping` + * using the value of `dragElastic`. + */ + const bounceStiffness = dragElastic ? 200 : 1000000; + const bounceDamping = dragElastic ? 40 : 10000000; + const inertia = { + type: "inertia", + velocity: dragMomentum ? velocity[axis] : 0, + bounceStiffness, + bounceDamping, + timeConstant: 750, + restDelta: 1, + restSpeed: 10, + ...dragTransition, + ...transition, + }; + // If we're not animating on an externally-provided `MotionValue` we can use the + // component's animation controls which will handle interactions with whileHover (etc), + // otherwise we just have to animate the `MotionValue` itself. + return this.startAxisValueAnimation(axis, inertia); + }); + // Run all animations and then resolve the new drag constraints. + return Promise.all(momentumAnimations).then(onDragTransitionEnd); + } + startAxisValueAnimation(axis, transition) { + const axisValue = this.getAxisMotionValue(axis); + motionDom.addValueToWillChange(this.visualElement, axis); + return axisValue.start(motionDom.animateMotionValue(axis, axisValue, 0, transition, this.visualElement, false)); + } + stopAnimation() { + motionDom.eachAxis((axis) => this.getAxisMotionValue(axis).stop()); + } + /** + * Drag works differently depending on which props are provided. + * + * - If _dragX and _dragY are provided, we output the gesture delta directly to those motion values. + * - Otherwise, we apply the delta to the x/y motion values. + */ + getAxisMotionValue(axis) { + const dragKey = `_drag${axis.toUpperCase()}`; + const props = this.visualElement.getProps(); + const externalMotionValue = props[dragKey]; + return externalMotionValue + ? externalMotionValue + : this.visualElement.getValue(axis, this.visualElement.latestValues[axis] ?? 0); + } + snapToCursor(point) { + motionDom.eachAxis((axis) => { + const { drag } = this.getProps(); + // If we're not dragging this axis, do an early return. + if (!shouldDrag(axis, drag, this.currentDirection)) + return; + const { projection } = this.visualElement; + const axisValue = this.getAxisMotionValue(axis); + if (projection && projection.layout) { + const { min, max } = projection.layout.layoutBox[axis]; + /** + * The layout measurement includes the current transform value, + * so we need to add it back to get the correct snap position. + * This fixes an issue where elements with initial coordinates + * would snap to the wrong position on the first drag. + */ + const current = axisValue.get() || 0; + axisValue.set(point[axis] - motionDom.mixNumber(min, max, 0.5) + current); + } + }); + } + /** + * When the viewport resizes we want to check if the measured constraints + * have changed and, if so, reposition the element within those new constraints + * relative to where it was before the resize. + */ + scalePositionWithinConstraints() { + if (!this.visualElement.current) + return; + const { drag, dragConstraints } = this.getProps(); + const { projection } = this.visualElement; + if (!index.isRefObject(dragConstraints) || !projection || !this.constraints) + return; + /** + * Stop current animations as there can be visual glitching if we try to do + * this mid-animation + */ + this.stopAnimation(); + /** + * Record the relative position of the dragged element relative to the + * constraints box and save as a progress value. + */ + const boxProgress = { x: 0, y: 0 }; + motionDom.eachAxis((axis) => { + const axisValue = this.getAxisMotionValue(axis); + if (axisValue && this.constraints !== false) { + const latest = axisValue.get(); + boxProgress[axis] = calcOrigin({ min: latest, max: latest }, this.constraints[axis]); + } + }); + /** + * Update the layout of this element and resolve the latest drag constraints + */ + const { transformTemplate } = this.visualElement.getProps(); + this.visualElement.current.style.transform = transformTemplate + ? transformTemplate({}, "") + : "none"; + projection.root && projection.root.updateScroll(); + projection.updateLayout(); + /** + * Reset constraints so resolveConstraints() will recalculate them + * with the freshly measured layout rather than returning the cached value. + */ + this.constraints = false; + this.resolveConstraints(); + /** + * For each axis, calculate the current progress of the layout axis + * within the new constraints. + */ + motionDom.eachAxis((axis) => { + if (!shouldDrag(axis, drag, null)) + return; + /** + * Calculate a new transform based on the previous box progress + */ + const axisValue = this.getAxisMotionValue(axis); + const { min, max } = this.constraints[axis]; + axisValue.set(motionDom.mixNumber(min, max, boxProgress[axis])); + }); + /** + * Flush the updated transform to the DOM synchronously to prevent + * a visual flash at the element's CSS layout position (0,0) when + * the transform was stripped for measurement. + */ + this.visualElement.render(); + } + addListeners() { + if (!this.visualElement.current) + return; + elementDragControls.set(this.visualElement, this); + const element = this.visualElement.current; + /** + * Attach a pointerdown event listener on this DOM element to initiate drag tracking. + */ + const stopPointerListener = addPointerEvent(element, "pointerdown", (event) => { + const { drag, dragListener = true } = this.getProps(); + const target = event.target; + /** + * Only block drag if clicking on a text input child element + * (input, textarea, select, contenteditable) where users might + * want to select text or interact with the control. + * + * Buttons and links don't block drag since they don't have + * click-and-move actions of their own. + */ + const isClickingTextInputChild = target !== element && motionDom.isElementTextInput(target); + if (drag && dragListener && !isClickingTextInputChild) { + this.start(event); + } + }); + /** + * If using ref-based constraints, observe both the draggable element + * and the constraint container for size changes via ResizeObserver. + * Setup is deferred because dragConstraints.current is null when + * addListeners first runs (React hasn't committed the ref yet). + */ + let stopResizeObservers; + const measureDragConstraints = () => { + const { dragConstraints } = this.getProps(); + if (index.isRefObject(dragConstraints) && dragConstraints.current) { + this.constraints = this.resolveRefConstraints(); + if (!stopResizeObservers) { + stopResizeObservers = startResizeObservers(element, dragConstraints.current, () => this.scalePositionWithinConstraints()); + } + } + }; + const { projection } = this.visualElement; + const stopMeasureLayoutListener = projection.addEventListener("measure", measureDragConstraints); + if (projection && !projection.layout) { + projection.root && projection.root.updateScroll(); + projection.updateLayout(); + } + motionDom.frame.read(measureDragConstraints); + /** + * Attach a window resize listener to scale the draggable target within its defined + * constraints as the window resizes. + */ + const stopResizeListener = motionDom.addDomEvent(window, "resize", () => this.scalePositionWithinConstraints()); + /** + * If the element's layout changes, calculate the delta and apply that to + * the drag gesture's origin point. + */ + const stopLayoutUpdateListener = projection.addEventListener("didUpdate", (({ delta, hasLayoutChanged }) => { + if (this.isDragging && hasLayoutChanged) { + motionDom.eachAxis((axis) => { + const motionValue = this.getAxisMotionValue(axis); + if (!motionValue) + return; + this.originPoint[axis] += delta[axis].translate; + motionValue.set(motionValue.get() + delta[axis].translate); + }); + this.visualElement.render(); + } + })); + return () => { + stopResizeListener(); + stopPointerListener(); + stopMeasureLayoutListener(); + stopLayoutUpdateListener && stopLayoutUpdateListener(); + stopResizeObservers && stopResizeObservers(); + }; + } + getProps() { + const props = this.visualElement.getProps(); + const { drag = false, dragDirectionLock = false, dragPropagation = false, dragConstraints = false, dragElastic = defaultElastic, dragMomentum = true, } = props; + return { + ...props, + drag, + dragDirectionLock, + dragPropagation, + dragConstraints, + dragElastic, + dragMomentum, + }; + } +} +function skipFirstCall(callback) { + let isFirst = true; + return () => { + if (isFirst) { + isFirst = false; + return; + } + callback(); + }; +} +function startResizeObservers(element, constraintsElement, onResize) { + const stopElement = motionDom.resize(element, skipFirstCall(onResize)); + const stopContainer = motionDom.resize(constraintsElement, skipFirstCall(onResize)); + return () => { + stopElement(); + stopContainer(); + }; +} +function shouldDrag(direction, drag, currentDirection) { + return ((drag === true || drag === direction) && + (currentDirection === null || currentDirection === direction)); +} +/** + * Based on an x/y offset determine the current drag direction. If both axis' offsets are lower + * than the provided threshold, return `null`. + * + * @param offset - The x/y offset from origin. + * @param lockThreshold - (Optional) - the minimum absolute offset before we can determine a drag direction. + */ +function getCurrentDirection(offset, lockThreshold = 10) { + let direction = null; + if (Math.abs(offset.y) > lockThreshold) { + direction = "y"; + } + else if (Math.abs(offset.x) > lockThreshold) { + direction = "x"; + } + return direction; +} + +class DragGesture extends motionDom.Feature { + constructor(node) { + super(node); + this.removeGroupControls = motionUtils.noop; + this.removeListeners = motionUtils.noop; + this.controls = new VisualElementDragControls(node); + } + mount() { + // If we've been provided a DragControls for manual control over the drag gesture, + // subscribe this component to it on mount. + const { dragControls } = this.node.getProps(); + if (dragControls) { + this.removeGroupControls = dragControls.subscribe(this.controls); + } + this.removeListeners = this.controls.addListeners() || motionUtils.noop; + } + update() { + const { dragControls } = this.node.getProps(); + const { dragControls: prevDragControls } = this.node.prevProps || {}; + if (dragControls !== prevDragControls) { + this.removeGroupControls(); + if (dragControls) { + this.removeGroupControls = dragControls.subscribe(this.controls); + } + } + } + unmount() { + this.removeGroupControls(); + this.removeListeners(); + /** + * In React 19, during list reorder reconciliation, components may + * briefly unmount and remount while the drag is still active. If we're + * actively dragging, we should NOT end the pan session - it will + * continue tracking pointer events via its window-level listeners. + * + * The pan session will be properly cleaned up when: + * 1. The drag ends naturally (pointerup/pointercancel) + * 2. The component is truly removed from the DOM + */ + if (!this.controls.isDragging) { + this.controls.endPanSession(); + } + } +} + +const asyncHandler = (handler) => (event, info) => { + if (handler) { + motionDom.frame.update(() => handler(event, info), false, true); + } +}; +class PanGesture extends motionDom.Feature { + constructor() { + super(...arguments); + this.removePointerDownListener = motionUtils.noop; + } + onPointerDown(pointerDownEvent) { + this.session = new PanSession(pointerDownEvent, this.createPanHandlers(), { + transformPagePoint: this.node.getTransformPagePoint(), + contextWindow: getContextWindow(this.node), + }); + } + createPanHandlers() { + const { onPanSessionStart, onPanStart, onPan, onPanEnd } = this.node.getProps(); + return { + onSessionStart: asyncHandler(onPanSessionStart), + onStart: asyncHandler(onPanStart), + onMove: asyncHandler(onPan), + onEnd: (event, info) => { + delete this.session; + if (onPanEnd) { + motionDom.frame.postRender(() => onPanEnd(event, info)); + } + }, + }; + } + mount() { + this.removePointerDownListener = addPointerEvent(this.node.current, "pointerdown", (event) => this.onPointerDown(event)); + } + update() { + this.session && this.session.updateHandlers(this.createPanHandlers()); + } + unmount() { + this.removePointerDownListener(); + this.session && this.session.end(); + } +} + +/** + * Track whether we've taken any snapshots yet. If not, + * we can safely skip notification of didUpdate. + * + * Difficult to capture in a test but to prevent flickering + * we must set this to true either on update or unmount. + * Running `next-env/layout-id` in Safari will show this behaviour if broken. + */ +let hasTakenAnySnapshot = false; +class MeasureLayoutWithContext extends React.Component { + /** + * This only mounts projection nodes for components that + * need measuring, we might want to do it for all components + * in order to incorporate transforms + */ + componentDidMount() { + const { visualElement, layoutGroup, switchLayoutGroup, layoutId } = this.props; + const { projection } = visualElement; + if (projection) { + if (layoutGroup.group) + layoutGroup.group.add(projection); + if (switchLayoutGroup && switchLayoutGroup.register && layoutId) { + switchLayoutGroup.register(projection); + } + if (hasTakenAnySnapshot) { + projection.root.didUpdate(); + } + projection.addEventListener("animationComplete", () => { + this.safeToRemove(); + }); + projection.setOptions({ + ...projection.options, + layoutDependency: this.props.layoutDependency, + onExitComplete: () => this.safeToRemove(), + }); + } + motionDom.globalProjectionState.hasEverUpdated = true; + } + getSnapshotBeforeUpdate(prevProps) { + const { layoutDependency, visualElement, drag, isPresent } = this.props; + const { projection } = visualElement; + if (!projection) + return null; + /** + * TODO: We use this data in relegate to determine whether to + * promote a previous element. There's no guarantee its presence data + * will have updated by this point - if a bug like this arises it will + * have to be that we markForRelegation and then find a new lead some other way, + * perhaps in didUpdate + */ + projection.isPresent = isPresent; + if (prevProps.layoutDependency !== layoutDependency) { + projection.setOptions({ + ...projection.options, + layoutDependency, + }); + } + hasTakenAnySnapshot = true; + if (drag || + prevProps.layoutDependency !== layoutDependency || + layoutDependency === undefined || + prevProps.isPresent !== isPresent) { + projection.willUpdate(); + } + else { + this.safeToRemove(); + } + if (prevProps.isPresent !== isPresent) { + if (isPresent) { + projection.promote(); + } + else if (!projection.relegate()) { + /** + * If there's another stack member taking over from this one, + * it's in charge of the exit animation and therefore should + * be in charge of the safe to remove. Otherwise we call it here. + */ + motionDom.frame.postRender(() => { + const stack = projection.getStack(); + if (!stack || !stack.members.length) { + this.safeToRemove(); + } + }); + } + } + return null; + } + componentDidUpdate() { + const { visualElement, layoutAnchor } = this.props; + const { projection } = visualElement; + if (projection) { + projection.options.layoutAnchor = layoutAnchor; + projection.root.didUpdate(); + motionDom.microtask.postRender(() => { + if (!projection.currentAnimation && projection.isLead()) { + this.safeToRemove(); + } + }); + } + } + componentWillUnmount() { + const { visualElement, layoutGroup, switchLayoutGroup: promoteContext, } = this.props; + const { projection } = visualElement; + hasTakenAnySnapshot = true; + if (projection) { + projection.scheduleCheckAfterUnmount(); + if (layoutGroup && layoutGroup.group) + layoutGroup.group.remove(projection); + if (promoteContext && promoteContext.deregister) + promoteContext.deregister(projection); + } + } + safeToRemove() { + const { safeToRemove } = this.props; + safeToRemove && safeToRemove(); + } + render() { + return null; + } +} +function MeasureLayout(props) { + const [isPresent, safeToRemove] = usePresence(); + const layoutGroup = React.useContext(index.LayoutGroupContext); + return (jsxRuntime.jsx(MeasureLayoutWithContext, { ...props, layoutGroup: layoutGroup, switchLayoutGroup: React.useContext(index.SwitchLayoutGroupContext), isPresent: isPresent, safeToRemove: safeToRemove })); +} + +const drag = { + pan: { + Feature: PanGesture, + }, + drag: { + Feature: DragGesture, + ProjectionNode: motionDom.HTMLProjectionNode, + MeasureLayout, + }, +}; + +function handleHoverEvent(node, event, lifecycle) { + const { props } = node; + if (node.animationState && props.whileHover) { + node.animationState.setActive("whileHover", lifecycle === "Start"); + } + const eventName = ("onHover" + lifecycle); + const callback = props[eventName]; + if (callback) { + motionDom.frame.postRender(() => callback(event, extractEventInfo(event))); + } +} +class HoverGesture extends motionDom.Feature { + mount() { + const { current } = this.node; + if (!current) + return; + this.unmount = motionDom.hover(current, (_element, startEvent) => { + handleHoverEvent(this.node, startEvent, "Start"); + return (endEvent) => handleHoverEvent(this.node, endEvent, "End"); + }); + } + unmount() { } +} + +class FocusGesture extends motionDom.Feature { + constructor() { + super(...arguments); + this.isActive = false; + } + onFocus() { + let isFocusVisible = false; + /** + * If this element doesn't match focus-visible then don't + * apply whileHover. But, if matches throws that focus-visible + * is not a valid selector then in that browser outline styles will be applied + * to the element by default and we want to match that behaviour with whileFocus. + */ + try { + isFocusVisible = this.node.current.matches(":focus-visible"); + } + catch (e) { + isFocusVisible = true; + } + if (!isFocusVisible || !this.node.animationState) + return; + this.node.animationState.setActive("whileFocus", true); + this.isActive = true; + } + onBlur() { + if (!this.isActive || !this.node.animationState) + return; + this.node.animationState.setActive("whileFocus", false); + this.isActive = false; + } + mount() { + this.unmount = motionUtils.pipe(motionDom.addDomEvent(this.node.current, "focus", () => this.onFocus()), motionDom.addDomEvent(this.node.current, "blur", () => this.onBlur())); + } + unmount() { } +} + +function handlePressEvent(node, event, lifecycle) { + const { props } = node; + if (node.current instanceof HTMLButtonElement && node.current.disabled) { + return; + } + if (node.animationState && props.whileTap) { + node.animationState.setActive("whileTap", lifecycle === "Start"); + } + const eventName = ("onTap" + (lifecycle === "End" ? "" : lifecycle)); + const callback = props[eventName]; + if (callback) { + motionDom.frame.postRender(() => callback(event, extractEventInfo(event))); + } +} +class PressGesture extends motionDom.Feature { + mount() { + const { current } = this.node; + if (!current) + return; + const { globalTapTarget, propagate } = this.node.props; + this.unmount = motionDom.press(current, (_element, startEvent) => { + handlePressEvent(this.node, startEvent, "Start"); + return (endEvent, { success }) => handlePressEvent(this.node, endEvent, success ? "End" : "Cancel"); + }, { + useGlobalTarget: globalTapTarget, + stopPropagation: propagate?.tap === false, + }); + } + unmount() { } +} + +/** + * Map an IntersectionHandler callback to an element. We only ever make one handler for one + * element, so even though these handlers might all be triggered by different + * observers, we can keep them in the same map. + */ +const observerCallbacks = new WeakMap(); +/** + * Multiple observers can be created for multiple element/document roots. Each with + * different settings. So here we store dictionaries of observers to each root, + * using serialised settings (threshold/margin) as lookup keys. + */ +const observers = new WeakMap(); +const fireObserverCallback = (entry) => { + const callback = observerCallbacks.get(entry.target); + callback && callback(entry); +}; +const fireAllObserverCallbacks = (entries) => { + entries.forEach(fireObserverCallback); +}; +function initIntersectionObserver({ root, ...options }) { + const lookupRoot = root || document; + /** + * If we don't have an observer lookup map for this root, create one. + */ + if (!observers.has(lookupRoot)) { + observers.set(lookupRoot, {}); + } + const rootObservers = observers.get(lookupRoot); + const key = JSON.stringify(options); + /** + * If we don't have an observer for this combination of root and settings, + * create one. + */ + if (!rootObservers[key]) { + rootObservers[key] = new IntersectionObserver(fireAllObserverCallbacks, { root, ...options }); + } + return rootObservers[key]; +} +function observeIntersection(element, options, callback) { + const rootInteresectionObserver = initIntersectionObserver(options); + observerCallbacks.set(element, callback); + rootInteresectionObserver.observe(element); + return () => { + observerCallbacks.delete(element); + rootInteresectionObserver.unobserve(element); + }; +} + +const thresholdNames = { + some: 0, + all: 1, +}; +class InViewFeature extends motionDom.Feature { + constructor() { + super(...arguments); + this.hasEnteredView = false; + this.isInView = false; + } + startObserver() { + this.stopObserver?.(); + const { viewport = {} } = this.node.getProps(); + const { root, margin: rootMargin, amount = "some", once } = viewport; + const options = { + root: root ? root.current : undefined, + rootMargin, + threshold: typeof amount === "number" ? amount : thresholdNames[amount], + }; + const onIntersectionUpdate = (entry) => { + const { isIntersecting } = entry; + /** + * If there's been no change in the viewport state, early return. + */ + if (this.isInView === isIntersecting) + return; + this.isInView = isIntersecting; + /** + * Handle hasEnteredView. If this is only meant to run once, and + * element isn't visible, early return. Otherwise set hasEnteredView to true. + */ + if (once && !isIntersecting && this.hasEnteredView) { + return; + } + else if (isIntersecting) { + this.hasEnteredView = true; + } + if (this.node.animationState) { + this.node.animationState.setActive("whileInView", isIntersecting); + } + /** + * Use the latest committed props rather than the ones in scope + * when this observer is created + */ + const { onViewportEnter, onViewportLeave } = this.node.getProps(); + const callback = isIntersecting ? onViewportEnter : onViewportLeave; + callback && callback(entry); + }; + this.stopObserver = observeIntersection(this.node.current, options, onIntersectionUpdate); + } + mount() { + this.startObserver(); + } + update() { + if (typeof IntersectionObserver === "undefined") + return; + const { props, prevProps } = this.node; + const hasOptionsChanged = ["amount", "margin", "root"].some(hasViewportOptionChanged(props, prevProps)); + if (hasOptionsChanged) { + this.startObserver(); + } + } + unmount() { + this.stopObserver?.(); + this.hasEnteredView = false; + this.isInView = false; + } +} +function hasViewportOptionChanged({ viewport = {} }, { viewport: prevViewport = {} } = {}) { + return (name) => viewport[name] !== prevViewport[name]; +} + +const gestureAnimations = { + inView: { + Feature: InViewFeature, + }, + tap: { + Feature: PressGesture, + }, + focus: { + Feature: FocusGesture, + }, + hover: { + Feature: HoverGesture, + }, +}; + +const layout = { + layout: { + ProjectionNode: motionDom.HTMLProjectionNode, + MeasureLayout, + }, +}; + +const featureBundle = { + ...animations, + ...gestureAnimations, + ...drag, + ...layout, +}; + +exports.addPointerEvent = addPointerEvent; +exports.addPointerInfo = addPointerInfo; +exports.animations = animations; +exports.createDomVisualElement = createDomVisualElement; +exports.distance = distance; +exports.distance2D = distance2D; +exports.drag = drag; +exports.featureBundle = featureBundle; +exports.gestureAnimations = gestureAnimations; +exports.layout = layout; +exports.useIsPresent = useIsPresent; +exports.usePresence = usePresence; +//# sourceMappingURL=feature-bundle-BZV7Y7IM.js.map diff --git a/node_modules/framer-motion/dist/cjs/feature-bundle-BZV7Y7IM.js.map b/node_modules/framer-motion/dist/cjs/feature-bundle-BZV7Y7IM.js.map new file mode 100644 index 0000000..b8fe053 --- /dev/null +++ b/node_modules/framer-motion/dist/cjs/feature-bundle-BZV7Y7IM.js.map @@ -0,0 +1 @@ +{"version":3,"file":"feature-bundle-BZV7Y7IM.js","sources":["../../src/components/AnimatePresence/use-presence.ts","../../src/render/dom/create-visual-element.ts","../../src/motion/features/animation/index.ts","../../src/motion/features/animation/exit.ts","../../src/motion/features/animations.ts","../../src/events/event-info.ts","../../src/events/add-pointer-event.ts","../../src/utils/get-context-window.ts","../../src/utils/distance.ts","../../src/gestures/pan/PanSession.ts","../../src/gestures/drag/utils/constraints.ts","../../src/gestures/drag/VisualElementDragControls.ts","../../src/gestures/drag/index.ts","../../src/gestures/pan/index.ts","../../src/motion/features/layout/MeasureLayout.tsx","../../src/motion/features/drag.ts","../../src/gestures/hover.ts","../../src/gestures/focus.ts","../../src/gestures/press.ts","../../src/motion/features/viewport/observers.ts","../../src/motion/features/viewport/index.ts","../../src/motion/features/gestures.ts","../../src/motion/features/layout.ts","../../src/render/components/motion/feature-bundle.ts"],"sourcesContent":["\"use client\"\n\nimport { useCallback, useContext, useEffect, useId } from \"react\"\nimport {\n PresenceContext,\n PresenceContextProps,\n} from \"../../context/PresenceContext\"\n\nexport type SafeToRemove = () => void\n\ntype AlwaysPresent = [true, null]\n\ntype Present = [true]\n\ntype NotPresent = [false, SafeToRemove]\n\n/**\n * When a component is the child of `AnimatePresence`, it can use `usePresence`\n * to access information about whether it's still present in the React tree.\n *\n * ```jsx\n * import { usePresence } from \"framer-motion\"\n *\n * export const Component = () => {\n * const [isPresent, safeToRemove] = usePresence()\n *\n * useEffect(() => {\n * !isPresent && setTimeout(safeToRemove, 1000)\n * }, [isPresent])\n *\n * return
\n * }\n * ```\n *\n * If `isPresent` is `false`, it means that a component has been removed from the tree,\n * but `AnimatePresence` won't really remove it until `safeToRemove` has been called.\n *\n * @public\n */\nexport function usePresence(\n subscribe: boolean = true\n): AlwaysPresent | Present | NotPresent {\n const context = useContext(PresenceContext)\n\n if (context === null) return [true, null]\n\n const { isPresent, onExitComplete, register } = context\n\n // It's safe to call the following hooks conditionally (after an early return) because the context will always\n // either be null or non-null for the lifespan of the component.\n\n const id = useId()\n useEffect(() => {\n if (subscribe) {\n return register(id)\n }\n }, [subscribe])\n\n const safeToRemove = useCallback(\n () => subscribe && onExitComplete && onExitComplete(id),\n [id, onExitComplete, subscribe]\n )\n\n return !isPresent && onExitComplete ? [false, safeToRemove] : [true]\n}\n\n/**\n * Similar to `usePresence`, except `useIsPresent` simply returns whether or not the component is present.\n * There is no `safeToRemove` function.\n *\n * ```jsx\n * import { useIsPresent } from \"framer-motion\"\n *\n * export const Component = () => {\n * const isPresent = useIsPresent()\n *\n * useEffect(() => {\n * !isPresent && console.log(\"I've been removed!\")\n * }, [isPresent])\n *\n * return
\n * }\n * ```\n *\n * @public\n */\nexport function useIsPresent() {\n return isPresent(useContext(PresenceContext))\n}\n\nexport function isPresent(context: PresenceContextProps | null) {\n return context === null ? true : context.isPresent\n}\n","import { HTMLVisualElement, SVGVisualElement } from \"motion-dom\"\nimport { ComponentType, Fragment } from \"react\"\nimport { CreateVisualElement, VisualElementOptions } from \"../types\"\nimport { isSVGComponent } from \"./utils/is-svg-component\"\n\nexport const createDomVisualElement: CreateVisualElement = (\n Component: string | ComponentType>,\n options: VisualElementOptions\n) => {\n /**\n * Use explicit isSVG override if provided, otherwise auto-detect\n */\n const isSVG = options.isSVG ?? isSVGComponent(Component)\n\n return isSVG\n ? new SVGVisualElement(options)\n : new HTMLVisualElement(options, {\n allowProjection: Component !== Fragment,\n })\n}\n","import {\n createAnimationState,\n Feature,\n isAnimationControls,\n type VisualElement,\n} from \"motion-dom\"\n\nexport class AnimationFeature extends Feature {\n unmountControls?: () => void\n\n /**\n * We dynamically generate the AnimationState manager as it contains a reference\n * to the underlying animation library. We only want to load that if we load this,\n * so people can optionally code split it out using the `m` component.\n */\n constructor(node: VisualElement) {\n super(node)\n node.animationState ||= createAnimationState(node)\n }\n\n updateAnimationControlsSubscription() {\n const { animate } = this.node.getProps()\n if (isAnimationControls(animate)) {\n this.unmountControls = animate.subscribe(this.node)\n }\n }\n\n /**\n * Subscribe any provided AnimationControls to the component's VisualElement\n */\n mount() {\n this.updateAnimationControlsSubscription()\n }\n\n update() {\n const { animate } = this.node.getProps()\n const { animate: prevAnimate } = this.node.prevProps || {}\n if (animate !== prevAnimate) {\n this.updateAnimationControlsSubscription()\n }\n }\n\n unmount() {\n this.node.animationState!.reset()\n this.unmountControls?.()\n }\n}\n","import { Feature, resolveVariant } from \"motion-dom\"\n\nlet id = 0\n\nexport class ExitAnimationFeature extends Feature {\n private id: number = id++\n private isExitComplete = false\n\n update() {\n if (!this.node.presenceContext) return\n\n const { isPresent, onExitComplete } = this.node.presenceContext\n const { isPresent: prevIsPresent } = this.node.prevPresenceContext || {}\n\n if (!this.node.animationState || isPresent === prevIsPresent) {\n return\n }\n\n if (isPresent && prevIsPresent === false) {\n /**\n * When re-entering, if the exit animation already completed\n * (element is at rest), reset to initial values so the enter\n * animation replays from the correct position.\n */\n if (this.isExitComplete) {\n const { initial, custom } = this.node.getProps()\n\n if (\n typeof initial === \"string\" ||\n (typeof initial === \"object\" &&\n initial !== null &&\n !Array.isArray(initial))\n ) {\n const resolved = resolveVariant(\n this.node,\n initial,\n custom\n )\n if (resolved) {\n const { transition, transitionEnd, ...target } =\n resolved\n for (const key in target) {\n this.node\n .getValue(key)\n ?.jump(\n target[\n key as keyof typeof target\n ] as any\n )\n }\n }\n }\n\n this.node.animationState.reset()\n this.node.animationState.animateChanges()\n } else {\n this.node.animationState.setActive(\"exit\", false)\n }\n\n this.isExitComplete = false\n return\n }\n\n const exitAnimation = this.node.animationState.setActive(\n \"exit\",\n !isPresent\n )\n\n if (onExitComplete && !isPresent) {\n exitAnimation.then(() => {\n this.isExitComplete = true\n onExitComplete(this.id)\n })\n }\n }\n\n mount() {\n const { register, onExitComplete } = this.node.presenceContext || {}\n\n if (onExitComplete) {\n onExitComplete(this.id)\n }\n\n if (register) {\n this.unmount = register(this.id)\n }\n }\n\n unmount() {}\n}\n","import { AnimationFeature } from \"./animation\"\nimport { ExitAnimationFeature } from \"./animation/exit\"\nimport { FeaturePackages } from \"./types\"\n\nexport const animations: FeaturePackages = {\n animation: {\n Feature: AnimationFeature,\n },\n exit: {\n Feature: ExitAnimationFeature,\n },\n}\n","import { EventInfo, isPrimaryPointer } from \"motion-dom\"\n\nexport type EventListenerWithPointInfo = (\n e: PointerEvent,\n info: EventInfo\n) => void\n\nexport function extractEventInfo(event: PointerEvent): EventInfo {\n return {\n point: {\n x: event.pageX,\n y: event.pageY,\n },\n }\n}\n\nexport const addPointerInfo =\n (handler: EventListenerWithPointInfo): EventListener =>\n (event: PointerEvent) =>\n isPrimaryPointer(event) && handler(event, extractEventInfo(event))\n","import { addDomEvent } from \"motion-dom\"\nimport { addPointerInfo, EventListenerWithPointInfo } from \"./event-info\"\n\nexport function addPointerEvent(\n target: EventTarget,\n eventName: string,\n handler: EventListenerWithPointInfo,\n options?: AddEventListenerOptions\n) {\n return addDomEvent(target, eventName, addPointerInfo(handler), options)\n}\n","import type { VisualElement } from \"motion-dom\"\n\n// Fixes https://github.com/motiondivision/motion/issues/2270\nexport const getContextWindow = ({ current }: VisualElement) => {\n return current ? current.ownerDocument.defaultView : null\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","import type { EventInfo, PanHandler } from \"motion-dom\"\nimport { cancelFrame, frame, frameData, isPrimaryPointer } from \"motion-dom\"\nimport {\n millisecondsToSeconds,\n pipe,\n Point,\n secondsToMilliseconds,\n TransformPoint,\n} from \"motion-utils\"\nimport { addPointerEvent } from \"../../events/add-pointer-event\"\nimport { extractEventInfo } from \"../../events/event-info\"\nimport { distance2D } from \"../../utils/distance\"\n\ninterface PanSessionHandlers {\n onSessionStart: PanHandler\n onStart: PanHandler\n onMove: PanHandler\n onEnd: PanHandler\n onSessionEnd: PanHandler\n resumeAnimation: () => void\n}\n\ninterface PanSessionOptions {\n transformPagePoint?: TransformPoint\n dragSnapToOrigin?: boolean | \"x\" | \"y\"\n distanceThreshold?: number\n contextWindow?: (Window & typeof globalThis) | null\n /**\n * Element being dragged. When provided, scroll events on its\n * ancestors and window are compensated so the gesture continues\n * smoothly during scroll.\n */\n element?: HTMLElement | null\n}\n\ninterface TimestampedPoint extends Point {\n timestamp: number\n}\n\nconst overflowStyles = /*#__PURE__*/ new Set([\"auto\", \"scroll\"])\n\n/**\n * @internal\n */\nexport class PanSession {\n /**\n * @internal\n */\n private history: TimestampedPoint[]\n\n /**\n * @internal\n */\n private startEvent: PointerEvent | null = null\n\n /**\n * @internal\n */\n private lastMoveEvent: PointerEvent | null = null\n\n /**\n * @internal\n */\n private lastMoveEventInfo: EventInfo | null = null\n\n /**\n * Raw (untransformed) event info, re-transformed each frame\n * so transformPagePoint sees the current parent matrix.\n * @internal\n */\n private lastRawMoveEventInfo: EventInfo | null = null\n\n /**\n * @internal\n */\n private transformPagePoint?: TransformPoint\n\n /**\n * @internal\n */\n private handlers: Partial = {}\n\n /**\n * @internal\n */\n private removeListeners: Function\n\n /**\n * For determining if an animation should resume after it is interupted\n *\n * @internal\n */\n private dragSnapToOrigin: boolean | \"x\" | \"y\"\n\n /**\n * The distance after which panning should start.\n *\n * @internal\n */\n private distanceThreshold: number\n\n /**\n * @internal\n */\n private contextWindow: PanSessionOptions[\"contextWindow\"] = window\n\n /**\n * Scroll positions of scrollable ancestors and window.\n * @internal\n */\n private scrollPositions: Map = new Map()\n\n /**\n * Cleanup function for scroll listeners.\n * @internal\n */\n private removeScrollListeners: (() => void) | null = null\n\n constructor(\n event: PointerEvent,\n handlers: Partial,\n {\n transformPagePoint,\n contextWindow = window,\n dragSnapToOrigin = false,\n distanceThreshold = 3,\n element,\n }: PanSessionOptions = {}\n ) {\n // If we have more than one touch, don't start detecting this gesture\n if (!isPrimaryPointer(event)) return\n\n this.dragSnapToOrigin = dragSnapToOrigin\n this.handlers = handlers\n this.transformPagePoint = transformPagePoint\n this.distanceThreshold = distanceThreshold\n this.contextWindow = contextWindow || window\n\n const info = extractEventInfo(event)\n const initialInfo = transformPoint(info, this.transformPagePoint)\n const { point } = initialInfo\n\n const { timestamp } = frameData\n\n this.history = [{ ...point, timestamp }]\n\n const { onSessionStart } = handlers\n onSessionStart &&\n onSessionStart(event, getPanInfo(initialInfo, this.history))\n\n // Listen in the capture phase so a descendant calling\n // stopPropagation() (e.g. in its own pointerup handler) can't\n // prevent the gesture from ending. See #2794.\n const eventOptions = { passive: true, capture: true }\n this.removeListeners = pipe(\n addPointerEvent(\n this.contextWindow,\n \"pointermove\",\n this.handlePointerMove,\n eventOptions\n ),\n addPointerEvent(\n this.contextWindow,\n \"pointerup\",\n this.handlePointerUp,\n eventOptions\n ),\n addPointerEvent(\n this.contextWindow,\n \"pointercancel\",\n this.handlePointerUp,\n eventOptions\n )\n )\n\n // Start scroll tracking if element provided\n if (element) {\n this.startScrollTracking(element)\n }\n }\n\n /**\n * Start tracking scroll on ancestors and window.\n */\n private startScrollTracking(element: HTMLElement): void {\n // Store initial scroll positions for scrollable ancestors\n let current = element.parentElement\n while (current) {\n const style = getComputedStyle(current)\n if (\n overflowStyles.has(style.overflowX) ||\n overflowStyles.has(style.overflowY)\n ) {\n this.scrollPositions.set(current, {\n x: current.scrollLeft,\n y: current.scrollTop,\n })\n }\n current = current.parentElement\n }\n\n // Track window scroll\n this.scrollPositions.set(window, {\n x: window.scrollX,\n y: window.scrollY,\n })\n\n // Capture listener catches element scroll events as they bubble\n window.addEventListener(\"scroll\", this.onElementScroll, {\n capture: true,\n })\n\n // Direct window scroll listener (window scroll doesn't bubble)\n window.addEventListener(\"scroll\", this.onWindowScroll)\n\n this.removeScrollListeners = () => {\n window.removeEventListener(\"scroll\", this.onElementScroll, {\n capture: true,\n })\n window.removeEventListener(\"scroll\", this.onWindowScroll)\n }\n }\n\n private onElementScroll = (event: Event): void => {\n this.handleScroll(event.target as Element)\n }\n\n private onWindowScroll = (): void => {\n this.handleScroll(window)\n }\n\n /**\n * Handle scroll compensation during drag.\n *\n * For element scroll: adjusts history origin since pageX/pageY doesn't change.\n * For window scroll: adjusts lastMoveEventInfo since pageX/pageY would change.\n */\n private handleScroll(target: Element | Window): void {\n const initial = this.scrollPositions.get(target)\n if (!initial) return\n\n const isWindow = target === window\n const current = isWindow\n ? { x: window.scrollX, y: window.scrollY }\n : {\n x: (target as Element).scrollLeft,\n y: (target as Element).scrollTop,\n }\n\n const delta = { x: current.x - initial.x, y: current.y - initial.y }\n if (delta.x === 0 && delta.y === 0) return\n\n if (isWindow) {\n // Window scroll: pageX/pageY changes, so update lastMoveEventInfo\n if (this.lastMoveEventInfo) {\n this.lastMoveEventInfo.point.x += delta.x\n this.lastMoveEventInfo.point.y += delta.y\n }\n } else {\n // Element scroll: pageX/pageY unchanged, so adjust history origin\n if (this.history.length > 0) {\n this.history[0].x -= delta.x\n this.history[0].y -= delta.y\n }\n }\n\n this.scrollPositions.set(target, current)\n frame.update(this.updatePoint, true)\n }\n\n private updatePoint = () => {\n if (!(this.lastMoveEvent && this.lastMoveEventInfo)) return\n\n // Re-transform raw point through current transformPagePoint so\n // animated parent transforms (e.g. rotation) are picked up each frame\n if (this.lastRawMoveEventInfo) {\n this.lastMoveEventInfo = transformPoint(\n this.lastRawMoveEventInfo,\n this.transformPagePoint\n )\n }\n\n const info = getPanInfo(this.lastMoveEventInfo, this.history)\n const isPanStarted = this.startEvent !== null\n\n // Only start panning if the offset is larger than 3 pixels. If we make it\n // any larger than this we'll want to reset the pointer history\n // on the first update to avoid visual snapping to the cursor.\n const isDistancePastThreshold =\n distance2D(info.offset, { x: 0, y: 0 }) >= this.distanceThreshold\n\n if (!isPanStarted && !isDistancePastThreshold) return\n\n const { point } = info\n const { timestamp } = frameData\n this.history.push({ ...point, timestamp })\n\n const { onStart, onMove } = this.handlers\n\n if (!isPanStarted) {\n onStart && onStart(this.lastMoveEvent, info)\n this.startEvent = this.lastMoveEvent\n }\n\n onMove && onMove(this.lastMoveEvent, info)\n }\n\n private handlePointerMove = (event: PointerEvent, info: EventInfo) => {\n this.lastMoveEvent = event\n this.lastRawMoveEventInfo = info\n this.lastMoveEventInfo = transformPoint(info, this.transformPagePoint)\n\n // Throttle mouse move event to once per frame\n frame.update(this.updatePoint, true)\n }\n\n private handlePointerUp = (event: PointerEvent, info: EventInfo) => {\n this.end()\n\n const { onEnd, onSessionEnd, resumeAnimation } = this.handlers\n\n // Resume animation if dragSnapToOrigin is set OR if no drag started (user just clicked)\n // This ensures constraint animations continue when interrupted by a click\n if (this.dragSnapToOrigin || !this.startEvent) {\n resumeAnimation && resumeAnimation()\n }\n if (!(this.lastMoveEvent && this.lastMoveEventInfo)) return\n\n const panInfo = getPanInfo(\n event.type === \"pointercancel\"\n ? this.lastMoveEventInfo\n : transformPoint(info, this.transformPagePoint),\n this.history\n )\n\n if (this.startEvent && onEnd) {\n onEnd(event, panInfo)\n }\n\n onSessionEnd && onSessionEnd(event, panInfo)\n }\n\n updateHandlers(handlers: Partial) {\n this.handlers = handlers\n }\n\n end() {\n this.removeListeners && this.removeListeners()\n this.removeScrollListeners && this.removeScrollListeners()\n this.scrollPositions.clear()\n cancelFrame(this.updatePoint)\n }\n}\n\nfunction transformPoint(\n info: EventInfo,\n transformPagePoint?: (point: Point) => Point\n) {\n return transformPagePoint ? { point: transformPagePoint(info.point) } : info\n}\n\nfunction subtractPoint(a: Point, b: Point): Point {\n return { x: a.x - b.x, y: a.y - b.y }\n}\n\nfunction getPanInfo({ point }: EventInfo, history: TimestampedPoint[]) {\n return {\n point,\n delta: subtractPoint(point, lastDevicePoint(history)),\n offset: subtractPoint(point, startDevicePoint(history)),\n velocity: getVelocity(history, 0.1),\n }\n}\n\nfunction startDevicePoint(history: TimestampedPoint[]): TimestampedPoint {\n return history[0]\n}\n\nfunction lastDevicePoint(history: TimestampedPoint[]): TimestampedPoint {\n return history[history.length - 1]\n}\n\nfunction getVelocity(history: TimestampedPoint[], timeDelta: number): Point {\n if (history.length < 2) {\n return { x: 0, y: 0 }\n }\n\n let i = history.length - 1\n let timestampedPoint: TimestampedPoint | null = null\n const lastPoint = lastDevicePoint(history)\n while (i >= 0) {\n timestampedPoint = history[i]\n if (\n lastPoint.timestamp - timestampedPoint.timestamp >\n secondsToMilliseconds(timeDelta)\n ) {\n break\n }\n i--\n }\n\n if (!timestampedPoint) {\n return { x: 0, y: 0 }\n }\n\n /**\n * If the selected point is the pointer-down origin (history[0]),\n * there are better movement points available, and the time gap\n * is suspiciously large (>2x timeDelta), use the next point instead.\n * This prevents stale pointer-down points from diluting velocity\n * in hold-then-flick gestures.\n */\n if (\n timestampedPoint === history[0] &&\n history.length > 2 &&\n lastPoint.timestamp - timestampedPoint.timestamp >\n secondsToMilliseconds(timeDelta) * 2\n ) {\n timestampedPoint = history[1]\n }\n\n const time = millisecondsToSeconds(\n lastPoint.timestamp - timestampedPoint.timestamp\n )\n if (time === 0) {\n return { x: 0, y: 0 }\n }\n\n const currentVelocity = {\n x: (lastPoint.x - timestampedPoint.x) / time,\n y: (lastPoint.y - timestampedPoint.y) / time,\n }\n\n if (currentVelocity.x === Infinity) {\n currentVelocity.x = 0\n }\n if (currentVelocity.y === Infinity) {\n currentVelocity.y = 0\n }\n\n return currentVelocity\n}\n","import { calcLength, mixNumber, type DragElastic, type ResolvedConstraints } from \"motion-dom\"\nimport {\n Axis,\n BoundingBox,\n Box,\n progress as calcProgress,\n clamp,\n Point,\n} from \"motion-utils\"\n\n/**\n * Apply constraints to a point. These constraints are both physical along an\n * axis, and an elastic factor that determines how much to constrain the point\n * by if it does lie outside the defined parameters.\n */\nexport function applyConstraints(\n point: number,\n { min, max }: Partial,\n elastic?: Axis\n): number {\n if (min !== undefined && point < min) {\n // If we have a min point defined, and this is outside of that, constrain\n point = elastic\n ? mixNumber(min, point, elastic.min)\n : Math.max(point, min)\n } else if (max !== undefined && point > max) {\n // If we have a max point defined, and this is outside of that, constrain\n point = elastic\n ? mixNumber(max, point, elastic.max)\n : Math.min(point, max)\n }\n\n return point\n}\n\n/**\n * Calculates a min projection point based on a pointer, pointer progress\n * within the drag target, and constraints.\n *\n * For instance if an element was 100px width, we were dragging from 0.25\n * along this axis, the pointer is at 200px, and there were no constraints,\n * we would calculate a min projection point of 175px.\n */\nexport function calcConstrainedMinPoint(\n point: number,\n length: number,\n progress: number,\n constraints?: Partial,\n elastic?: Axis\n): number {\n // Calculate a min point for this axis and apply it to the current pointer\n const min = point - length * progress\n\n return constraints ? applyConstraints(min, constraints, elastic) : min\n}\n\n/**\n * Calculate constraints in terms of the viewport when defined relatively to the\n * measured axis. This is measured from the nearest edge, so a max constraint of 200\n * on an axis with a max value of 300 would return a constraint of 500 - axis length\n */\nexport function calcRelativeAxisConstraints(\n axis: Axis,\n min?: number,\n max?: number\n): Partial {\n return {\n min: min !== undefined ? axis.min + min : undefined,\n max:\n max !== undefined\n ? axis.max + max - (axis.max - axis.min)\n : undefined,\n }\n}\n\n/**\n * Calculate constraints in terms of the viewport when\n * defined relatively to the measured bounding box.\n */\nexport function calcRelativeConstraints(\n layoutBox: Box,\n { top, left, bottom, right }: Partial\n): ResolvedConstraints {\n return {\n x: calcRelativeAxisConstraints(layoutBox.x, left, right),\n y: calcRelativeAxisConstraints(layoutBox.y, top, bottom),\n }\n}\n\n/**\n * Calculate viewport constraints when defined as another viewport-relative axis\n */\nexport function calcViewportAxisConstraints(\n layoutAxis: Axis,\n constraintsAxis: Axis\n) {\n let min = constraintsAxis.min - layoutAxis.min\n let max = constraintsAxis.max - layoutAxis.max\n\n // If the constraints axis is actually smaller than the layout axis then we can\n // flip the constraints\n if (\n constraintsAxis.max - constraintsAxis.min <\n layoutAxis.max - layoutAxis.min\n ) {\n ;[min, max] = [max, min]\n }\n\n return { min, max }\n}\n\n/**\n * Calculate viewport constraints when defined as another viewport-relative box\n */\nexport function calcViewportConstraints(layoutBox: Box, constraintsBox: Box) {\n return {\n x: calcViewportAxisConstraints(layoutBox.x, constraintsBox.x),\n y: calcViewportAxisConstraints(layoutBox.y, constraintsBox.y),\n }\n}\n\n/**\n * Calculate a transform origin relative to the source axis, between 0-1, that results\n * in an asthetically pleasing scale/transform needed to project from source to target.\n */\nexport function calcOrigin(source: Axis, target: Axis): number {\n let origin = 0.5\n const sourceLength = calcLength(source)\n const targetLength = calcLength(target)\n\n if (targetLength > sourceLength) {\n origin = calcProgress(target.min, target.max - sourceLength, source.min)\n } else if (sourceLength > targetLength) {\n origin = calcProgress(source.min, source.max - targetLength, target.min)\n }\n\n return clamp(0, 1, origin)\n}\n\n/**\n * Calculate the relative progress of one constraints box relative to another.\n * Imagine a page scroll bar. At the top, this would return 0, at the bottom, 1.\n * Anywhere in-between, a value between 0 and 1.\n *\n * This also handles flipped constraints, for instance a draggable container within\n * a smaller viewport like a scrollable view.\n */\nexport function calcProgressWithinConstraints(\n layoutBox: Box,\n constraintsBox: Box\n): Point {\n return {\n x: calcOrigin(layoutBox.x, constraintsBox.x),\n y: calcOrigin(layoutBox.y, constraintsBox.y),\n }\n}\n\n/**\n * Calculate the an axis position based on two axes and a progress value.\n */\nexport function calcPositionFromProgress(\n axis: Axis,\n constraints: Axis,\n progress: number\n): Axis {\n const axisLength = axis.max - axis.min\n const min = mixNumber(\n constraints.min,\n constraints.max - axisLength,\n progress\n )\n return { min, max: min + axisLength }\n}\n\n/**\n * Rebase the calculated viewport constraints relative to the layout.min point.\n */\nexport function rebaseAxisConstraints(\n layout: Axis,\n constraints: Partial\n): Partial {\n const relativeConstraints: Partial = {}\n\n if (constraints.min !== undefined) {\n relativeConstraints.min = constraints.min - layout.min\n }\n\n if (constraints.max !== undefined) {\n relativeConstraints.max = constraints.max - layout.min\n }\n\n return relativeConstraints\n}\n\nexport const defaultElastic = 0.35\n/**\n * Accepts a dragElastic prop and returns resolved elastic values for each axis.\n */\nexport function resolveDragElastic(\n dragElastic: DragElastic = defaultElastic\n): Box {\n if (dragElastic === false) {\n dragElastic = 0\n } else if (dragElastic === true) {\n dragElastic = defaultElastic\n }\n\n return {\n x: resolveAxisElastic(dragElastic, \"left\", \"right\"),\n y: resolveAxisElastic(dragElastic, \"top\", \"bottom\"),\n }\n}\n\nexport function resolveAxisElastic(\n dragElastic: DragElastic,\n minLabel: string,\n maxLabel: string\n): Axis {\n return {\n min: resolvePointElastic(dragElastic, minLabel),\n max: resolvePointElastic(dragElastic, maxLabel),\n }\n}\n\nexport function resolvePointElastic(\n dragElastic: DragElastic,\n label: string\n): number {\n return typeof dragElastic === \"number\"\n ? dragElastic\n : dragElastic[label as keyof typeof dragElastic] || 0\n}\n","import {\n addValueToWillChange,\n animateMotionValue,\n calcLength,\n convertBoundingBoxToBox,\n convertBoxToBoundingBox,\n createBox,\n eachAxis,\n frame,\n isElementTextInput,\n measurePageBox,\n mixNumber,\n PanInfo,\n percent,\n ResolvedConstraints,\n resize,\n setDragLock,\n Transition,\n type VisualElement,\n} from \"motion-dom\"\nimport { Axis, Point, invariant } from \"motion-utils\"\nimport { addDomEvent, type LayoutUpdateData } from \"motion-dom\"\nimport { addPointerEvent } from \"../../events/add-pointer-event\"\nimport { extractEventInfo } from \"../../events/event-info\"\nimport { MotionProps } from \"../../motion/types\"\nimport { getContextWindow } from \"../../utils/get-context-window\"\nimport { isRefObject } from \"../../utils/is-ref-object\"\nimport { PanSession } from \"../pan/PanSession\"\nimport {\n applyConstraints,\n calcOrigin,\n calcRelativeConstraints,\n calcViewportConstraints,\n defaultElastic,\n rebaseAxisConstraints,\n resolveDragElastic,\n} from \"./utils/constraints\"\n\nexport const elementDragControls = new WeakMap<\n VisualElement,\n VisualElementDragControls\n>()\n\nexport interface DragControlOptions {\n /**\n * This distance after which dragging starts and a direction is locked in.\n *\n * @public\n */\n distanceThreshold?: number\n\n /**\n * Whether to immediately snap to the cursor when dragging starts.\n *\n * @public\n */\n snapToCursor?: boolean\n}\n\ntype DragDirection = \"x\" | \"y\"\n\nexport class VisualElementDragControls {\n private visualElement: VisualElement\n\n private panSession?: PanSession\n\n private openDragLock: VoidFunction | null = null\n\n isDragging = false\n private currentDirection: DragDirection | null = null\n\n private originPoint: Point = { x: 0, y: 0 }\n\n /**\n * The permitted boundaries of travel, in pixels.\n */\n private constraints: ResolvedConstraints | false = false\n\n private hasMutatedConstraints = false\n\n /**\n * The per-axis resolved elastic values.\n */\n private elastic = createBox()\n\n /**\n * The latest pointer event. Used as fallback when the `cancel` and `stop` functions are called without arguments.\n */\n private latestPointerEvent: PointerEvent | null = null\n\n /**\n * The latest pan info. Used as fallback when the `cancel` and `stop` functions are called without arguments.\n */\n private latestPanInfo: PanInfo | null = null\n\n constructor(visualElement: VisualElement) {\n this.visualElement = visualElement\n }\n\n start(\n originEvent: PointerEvent,\n { snapToCursor = false, distanceThreshold }: DragControlOptions = {}\n ) {\n /**\n * Don't start dragging if this component is exiting\n */\n const { presenceContext } = this.visualElement\n if (presenceContext && presenceContext.isPresent === false) return\n\n const onSessionStart = (event: PointerEvent) => {\n if (snapToCursor) {\n this.snapToCursor(extractEventInfo(event).point)\n }\n this.stopAnimation()\n }\n\n const onStart = (event: PointerEvent, info: PanInfo) => {\n // Attempt to grab the global drag gesture lock - maybe make this part of PanSession\n const { drag, dragPropagation, onDragStart } = this.getProps()\n\n if (drag && !dragPropagation) {\n if (this.openDragLock) this.openDragLock()\n\n this.openDragLock = setDragLock(drag)\n\n // If we don 't have the lock, don't start dragging\n if (!this.openDragLock) return\n }\n\n this.latestPointerEvent = event\n this.latestPanInfo = info\n this.isDragging = true\n\n this.currentDirection = null\n\n this.resolveConstraints()\n\n if (this.visualElement.projection) {\n this.visualElement.projection.isAnimationBlocked = true\n this.visualElement.projection.target = undefined\n }\n\n /**\n * Record gesture origin and pointer offset\n */\n eachAxis((axis) => {\n let current = this.getAxisMotionValue(axis).get() || 0\n\n /**\n * If the MotionValue is a percentage value convert to px\n */\n if (percent.test(current)) {\n const { projection } = this.visualElement\n\n if (projection && projection.layout) {\n const measuredAxis = projection.layout.layoutBox[axis]\n\n if (measuredAxis) {\n const length = calcLength(measuredAxis)\n current = length * (parseFloat(current) / 100)\n }\n }\n }\n\n this.originPoint[axis] = current\n })\n\n // Fire onDragStart event\n if (onDragStart) {\n frame.update(() => onDragStart(event, info), false, true)\n }\n\n addValueToWillChange(this.visualElement, \"transform\")\n\n const { animationState } = this.visualElement\n animationState && animationState.setActive(\"whileDrag\", true)\n }\n\n const onMove = (event: PointerEvent, info: PanInfo) => {\n this.latestPointerEvent = event\n this.latestPanInfo = info\n\n const {\n dragPropagation,\n dragDirectionLock,\n onDirectionLock,\n onDrag,\n } = this.getProps()\n\n // If we didn't successfully receive the gesture lock, early return.\n if (!dragPropagation && !this.openDragLock) return\n\n const { offset } = info\n // Attempt to detect drag direction if directionLock is true\n if (dragDirectionLock && this.currentDirection === null) {\n this.currentDirection = getCurrentDirection(offset)\n\n // If we've successfully set a direction, notify listener\n if (this.currentDirection !== null) {\n onDirectionLock && onDirectionLock(this.currentDirection)\n }\n\n return\n }\n\n // Update each point with the latest position\n this.updateAxis(\"x\", info.point, offset)\n this.updateAxis(\"y\", info.point, offset)\n\n /**\n * Ideally we would leave the renderer to fire naturally at the end of\n * this frame but if the element is about to change layout as the result\n * of a re-render we want to ensure the browser can read the latest\n * bounding box to ensure the pointer and element don't fall out of sync.\n */\n this.visualElement.render()\n\n /**\n * This must fire after the render call as it might trigger a state\n * change which itself might trigger a layout update.\n */\n if (onDrag) {\n frame.update(() => onDrag(event, info), false, true)\n }\n }\n\n const onSessionEnd = (event: PointerEvent, info: PanInfo) => {\n this.latestPointerEvent = event\n this.latestPanInfo = info\n\n this.stop(event, info)\n\n this.latestPointerEvent = null\n this.latestPanInfo = null\n }\n\n const resumeAnimation = () => {\n const { dragSnapToOrigin: snap } = this.getProps()\n if (snap || this.constraints) {\n this.startAnimation({ x: 0, y: 0 })\n }\n }\n\n const { dragSnapToOrigin } = this.getProps()\n this.panSession = new PanSession(\n originEvent,\n {\n onSessionStart,\n onStart,\n onMove,\n onSessionEnd,\n resumeAnimation,\n },\n {\n transformPagePoint: this.visualElement.getTransformPagePoint(),\n dragSnapToOrigin,\n distanceThreshold,\n contextWindow: getContextWindow(this.visualElement),\n element: this.visualElement.current,\n }\n )\n }\n\n /**\n * @internal\n */\n stop(event?: PointerEvent, panInfo?: PanInfo) {\n const finalEvent = event || this.latestPointerEvent\n const finalPanInfo = panInfo || this.latestPanInfo\n\n const isDragging = this.isDragging\n this.cancel()\n if (!isDragging || !finalPanInfo || !finalEvent) return\n\n const { velocity } = finalPanInfo\n this.startAnimation(velocity)\n\n const { onDragEnd } = this.getProps()\n if (onDragEnd) {\n frame.postRender(() => onDragEnd(finalEvent, finalPanInfo))\n }\n }\n\n /**\n * @internal\n */\n cancel() {\n this.isDragging = false\n\n const { projection, animationState } = this.visualElement\n\n if (projection) {\n projection.isAnimationBlocked = false\n }\n\n this.endPanSession()\n\n const { dragPropagation } = this.getProps()\n\n if (!dragPropagation && this.openDragLock) {\n this.openDragLock()\n this.openDragLock = null\n }\n\n animationState && animationState.setActive(\"whileDrag\", false)\n }\n\n /**\n * Clean up the pan session without modifying other drag state.\n * This is used during unmount to ensure event listeners are removed\n * without affecting projection animations or drag locks.\n * @internal\n */\n endPanSession() {\n this.panSession && this.panSession.end()\n this.panSession = undefined\n }\n\n private updateAxis(axis: DragDirection, _point: Point, offset?: Point) {\n const { drag } = this.getProps()\n\n // If we're not dragging this axis, do an early return.\n if (!offset || !shouldDrag(axis, drag, this.currentDirection)) return\n\n const axisValue = this.getAxisMotionValue(axis)\n let next = this.originPoint[axis] + offset[axis]\n\n // Apply constraints\n if (this.constraints && this.constraints[axis]) {\n next = applyConstraints(\n next,\n this.constraints[axis],\n this.elastic[axis]\n )\n }\n\n axisValue.set(next)\n }\n\n private resolveConstraints() {\n const { dragConstraints, dragElastic } = this.getProps()\n\n const layout =\n this.visualElement.projection &&\n !this.visualElement.projection.layout\n ? this.visualElement.projection.measure(false)\n : this.visualElement.projection?.layout\n\n const prevConstraints = this.constraints\n\n if (dragConstraints && isRefObject(dragConstraints)) {\n if (!this.constraints) {\n this.constraints = this.resolveRefConstraints()\n }\n } else {\n if (dragConstraints && layout) {\n this.constraints = calcRelativeConstraints(\n layout.layoutBox,\n dragConstraints\n )\n } else {\n this.constraints = false\n }\n }\n\n this.elastic = resolveDragElastic(dragElastic)\n\n /**\n * If we're outputting to external MotionValues, we want to rebase the measured constraints\n * from viewport-relative to component-relative. This only applies to relative (non-ref)\n * constraints, as ref-based constraints from calcViewportConstraints are already in the\n * correct coordinate space for the motion value transform offset.\n */\n if (\n prevConstraints !== this.constraints &&\n !isRefObject(dragConstraints) &&\n layout &&\n this.constraints &&\n !this.hasMutatedConstraints\n ) {\n eachAxis((axis) => {\n if (\n this.constraints !== false &&\n this.getAxisMotionValue(axis)\n ) {\n this.constraints[axis] = rebaseAxisConstraints(\n layout.layoutBox[axis],\n this.constraints[axis]\n )\n }\n })\n }\n }\n\n private resolveRefConstraints() {\n const { dragConstraints: constraints, onMeasureDragConstraints } =\n this.getProps()\n if (!constraints || !isRefObject(constraints)) return false\n\n const constraintsElement = constraints.current as HTMLElement\n\n invariant(\n constraintsElement !== null,\n \"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.\",\n \"drag-constraints-ref\"\n )\n\n const { projection } = this.visualElement\n\n // TODO\n if (!projection || !projection.layout) return false\n\n /**\n * Refresh the root scroll offset so the constraint's viewport box\n * translates to correct page coordinates. The scroll captured at\n * drag mount can be stale if the document was scrolled afterwards —\n * e.g. via the browser restoring scroll on refresh, or an ancestor\n * layout effect running after this element's mount (#2829).\n *\n * Clear the cached scroll first so `updateScroll` bypasses its\n * per-animationId cache and re-reads the live value.\n */\n if (projection.root) {\n projection.root.scroll = undefined\n projection.root.updateScroll()\n }\n\n const constraintsBox = measurePageBox(\n constraintsElement,\n projection.root!,\n this.visualElement.getTransformPagePoint()\n )\n\n let measuredConstraints = calcViewportConstraints(\n projection.layout.layoutBox,\n constraintsBox\n )\n\n /**\n * If there's an onMeasureDragConstraints listener we call it and\n * if different constraints are returned, set constraints to that\n */\n if (onMeasureDragConstraints) {\n const userConstraints = onMeasureDragConstraints(\n convertBoxToBoundingBox(measuredConstraints)\n )\n\n this.hasMutatedConstraints = !!userConstraints\n\n if (userConstraints) {\n measuredConstraints = convertBoundingBoxToBox(userConstraints)\n }\n }\n\n return measuredConstraints\n }\n\n private startAnimation(velocity: Point) {\n const {\n drag,\n dragMomentum,\n dragElastic,\n dragTransition,\n dragSnapToOrigin,\n onDragTransitionEnd,\n } = this.getProps()\n\n const constraints: Partial = this.constraints || {}\n\n const momentumAnimations = eachAxis((axis) => {\n if (!shouldDrag(axis, drag, this.currentDirection)) {\n return\n }\n\n let transition = (constraints && constraints[axis]) || {}\n\n if (\n dragSnapToOrigin === true ||\n (dragSnapToOrigin as unknown) === axis\n )\n transition = { min: 0, max: 0 }\n\n /**\n * Overdamp the boundary spring if `dragElastic` is disabled. There's still a frame\n * of spring animations so we should look into adding a disable spring option to `inertia`.\n * We could do something here where we affect the `bounceStiffness` and `bounceDamping`\n * using the value of `dragElastic`.\n */\n const bounceStiffness = dragElastic ? 200 : 1000000\n const bounceDamping = dragElastic ? 40 : 10000000\n\n const inertia: Transition = {\n type: \"inertia\",\n velocity: dragMomentum ? velocity[axis] : 0,\n bounceStiffness,\n bounceDamping,\n timeConstant: 750,\n restDelta: 1,\n restSpeed: 10,\n ...dragTransition,\n ...transition,\n }\n\n // If we're not animating on an externally-provided `MotionValue` we can use the\n // component's animation controls which will handle interactions with whileHover (etc),\n // otherwise we just have to animate the `MotionValue` itself.\n return this.startAxisValueAnimation(axis, inertia)\n })\n\n // Run all animations and then resolve the new drag constraints.\n return Promise.all(momentumAnimations).then(onDragTransitionEnd)\n }\n\n private startAxisValueAnimation(\n axis: DragDirection,\n transition: Transition\n ) {\n const axisValue = this.getAxisMotionValue(axis)\n\n addValueToWillChange(this.visualElement, axis)\n\n return axisValue.start(\n animateMotionValue(\n axis,\n axisValue,\n 0,\n transition,\n this.visualElement,\n false\n )\n )\n }\n\n private stopAnimation() {\n eachAxis((axis) => this.getAxisMotionValue(axis).stop())\n }\n\n /**\n * Drag works differently depending on which props are provided.\n *\n * - If _dragX and _dragY are provided, we output the gesture delta directly to those motion values.\n * - Otherwise, we apply the delta to the x/y motion values.\n */\n private getAxisMotionValue(axis: DragDirection) {\n const dragKey =\n `_drag${axis.toUpperCase()}` as `_drag${Uppercase}`\n const props = this.visualElement.getProps()\n const externalMotionValue = props[dragKey]\n\n return externalMotionValue\n ? externalMotionValue\n : this.visualElement.getValue(\n axis,\n this.visualElement.latestValues[axis] ?? 0\n )\n }\n\n private snapToCursor(point: Point) {\n eachAxis((axis) => {\n const { drag } = this.getProps()\n\n // If we're not dragging this axis, do an early return.\n if (!shouldDrag(axis, drag, this.currentDirection)) return\n\n const { projection } = this.visualElement\n const axisValue = this.getAxisMotionValue(axis)\n\n if (projection && projection.layout) {\n const { min, max } = projection.layout.layoutBox[axis]\n\n /**\n * The layout measurement includes the current transform value,\n * so we need to add it back to get the correct snap position.\n * This fixes an issue where elements with initial coordinates\n * would snap to the wrong position on the first drag.\n */\n const current = axisValue.get() || 0\n\n axisValue.set(point[axis] - mixNumber(min, max, 0.5) + current)\n }\n })\n }\n\n /**\n * When the viewport resizes we want to check if the measured constraints\n * have changed and, if so, reposition the element within those new constraints\n * relative to where it was before the resize.\n */\n scalePositionWithinConstraints() {\n if (!this.visualElement.current) return\n\n const { drag, dragConstraints } = this.getProps()\n const { projection } = this.visualElement\n if (!isRefObject(dragConstraints) || !projection || !this.constraints)\n return\n\n /**\n * Stop current animations as there can be visual glitching if we try to do\n * this mid-animation\n */\n this.stopAnimation()\n\n /**\n * Record the relative position of the dragged element relative to the\n * constraints box and save as a progress value.\n */\n const boxProgress = { x: 0, y: 0 }\n eachAxis((axis) => {\n const axisValue = this.getAxisMotionValue(axis)\n if (axisValue && this.constraints !== false) {\n const latest = axisValue.get()\n boxProgress[axis] = calcOrigin(\n { min: latest, max: latest },\n this.constraints[axis] as Axis\n )\n }\n })\n\n /**\n * Update the layout of this element and resolve the latest drag constraints\n */\n const { transformTemplate } = this.visualElement.getProps()\n this.visualElement.current.style.transform = transformTemplate\n ? transformTemplate({}, \"\")\n : \"none\"\n projection.root && projection.root.updateScroll()\n projection.updateLayout()\n\n /**\n * Reset constraints so resolveConstraints() will recalculate them\n * with the freshly measured layout rather than returning the cached value.\n */\n this.constraints = false\n this.resolveConstraints()\n\n /**\n * For each axis, calculate the current progress of the layout axis\n * within the new constraints.\n */\n eachAxis((axis) => {\n if (!shouldDrag(axis, drag, null)) return\n\n /**\n * Calculate a new transform based on the previous box progress\n */\n const axisValue = this.getAxisMotionValue(axis)\n const { min, max } = (this.constraints as ResolvedConstraints)[\n axis\n ] as Axis\n axisValue.set(mixNumber(min, max, boxProgress[axis]))\n })\n\n /**\n * Flush the updated transform to the DOM synchronously to prevent\n * a visual flash at the element's CSS layout position (0,0) when\n * the transform was stripped for measurement.\n */\n this.visualElement.render()\n }\n\n addListeners() {\n if (!this.visualElement.current) return\n elementDragControls.set(this.visualElement, this)\n const element = this.visualElement.current\n\n /**\n * Attach a pointerdown event listener on this DOM element to initiate drag tracking.\n */\n const stopPointerListener = addPointerEvent(\n element,\n \"pointerdown\",\n (event) => {\n const { drag, dragListener = true } = this.getProps()\n const target = event.target as Element\n\n /**\n * Only block drag if clicking on a text input child element\n * (input, textarea, select, contenteditable) where users might\n * want to select text or interact with the control.\n *\n * Buttons and links don't block drag since they don't have\n * click-and-move actions of their own.\n */\n const isClickingTextInputChild =\n target !== element && isElementTextInput(target)\n\n if (drag && dragListener && !isClickingTextInputChild) {\n this.start(event)\n }\n }\n )\n\n /**\n * If using ref-based constraints, observe both the draggable element\n * and the constraint container for size changes via ResizeObserver.\n * Setup is deferred because dragConstraints.current is null when\n * addListeners first runs (React hasn't committed the ref yet).\n */\n let stopResizeObservers: VoidFunction | undefined\n\n const measureDragConstraints = () => {\n const { dragConstraints } = this.getProps()\n if (isRefObject(dragConstraints) && dragConstraints.current) {\n this.constraints = this.resolveRefConstraints()\n\n if (!stopResizeObservers) {\n stopResizeObservers = startResizeObservers(\n element,\n dragConstraints.current as HTMLElement,\n () => this.scalePositionWithinConstraints()\n )\n }\n }\n }\n\n const { projection } = this.visualElement\n\n const stopMeasureLayoutListener = projection!.addEventListener(\n \"measure\",\n measureDragConstraints\n )\n\n if (projection && !projection!.layout) {\n projection.root && projection.root.updateScroll()\n projection.updateLayout()\n }\n\n frame.read(measureDragConstraints)\n\n /**\n * Attach a window resize listener to scale the draggable target within its defined\n * constraints as the window resizes.\n */\n const stopResizeListener = addDomEvent(window, \"resize\", () =>\n this.scalePositionWithinConstraints()\n )\n\n /**\n * If the element's layout changes, calculate the delta and apply that to\n * the drag gesture's origin point.\n */\n const stopLayoutUpdateListener = projection!.addEventListener(\n \"didUpdate\",\n (({ delta, hasLayoutChanged }: LayoutUpdateData) => {\n if (this.isDragging && hasLayoutChanged) {\n eachAxis((axis) => {\n const motionValue = this.getAxisMotionValue(axis)\n if (!motionValue) return\n\n this.originPoint[axis] += delta[axis].translate\n motionValue.set(\n motionValue.get() + delta[axis].translate\n )\n })\n\n this.visualElement.render()\n }\n }) as any\n )\n\n return () => {\n stopResizeListener()\n stopPointerListener()\n stopMeasureLayoutListener()\n stopLayoutUpdateListener && stopLayoutUpdateListener()\n stopResizeObservers && stopResizeObservers()\n }\n }\n\n getProps(): MotionProps {\n const props = this.visualElement.getProps()\n const {\n drag = false,\n dragDirectionLock = false,\n dragPropagation = false,\n dragConstraints = false,\n dragElastic = defaultElastic,\n dragMomentum = true,\n } = props\n return {\n ...props,\n drag,\n dragDirectionLock,\n dragPropagation,\n dragConstraints,\n dragElastic,\n dragMomentum,\n }\n }\n}\n\nfunction skipFirstCall(callback: VoidFunction): VoidFunction {\n let isFirst = true\n return () => {\n if (isFirst) {\n isFirst = false\n return\n }\n callback()\n }\n}\n\nfunction startResizeObservers(\n element: HTMLElement,\n constraintsElement: HTMLElement,\n onResize: VoidFunction\n): VoidFunction {\n const stopElement = resize(element, skipFirstCall(onResize))\n const stopContainer = resize(constraintsElement, skipFirstCall(onResize))\n return () => {\n stopElement()\n stopContainer()\n }\n}\n\nfunction shouldDrag(\n direction: DragDirection,\n drag: boolean | DragDirection | undefined,\n currentDirection: null | DragDirection\n) {\n return (\n (drag === true || drag === direction) &&\n (currentDirection === null || currentDirection === direction)\n )\n}\n\n/**\n * Based on an x/y offset determine the current drag direction. If both axis' offsets are lower\n * than the provided threshold, return `null`.\n *\n * @param offset - The x/y offset from origin.\n * @param lockThreshold - (Optional) - the minimum absolute offset before we can determine a drag direction.\n */\nfunction getCurrentDirection(\n offset: Point,\n lockThreshold = 10\n): DragDirection | null {\n let direction: DragDirection | null = null\n\n if (Math.abs(offset.y) > lockThreshold) {\n direction = \"y\"\n } else if (Math.abs(offset.x) > lockThreshold) {\n direction = \"x\"\n }\n\n return direction\n}\n\nexport function expectsResolvedDragConstraints({\n dragConstraints,\n onMeasureDragConstraints,\n}: MotionProps) {\n return isRefObject(dragConstraints) && !!onMeasureDragConstraints\n}\n","import { Feature, type VisualElement } from \"motion-dom\"\nimport { noop } from \"motion-utils\"\nimport { VisualElementDragControls } from \"./VisualElementDragControls\"\n\nexport class DragGesture extends Feature {\n controls: VisualElementDragControls\n\n removeGroupControls: Function = noop\n removeListeners: Function = noop\n\n constructor(node: VisualElement) {\n super(node)\n this.controls = new VisualElementDragControls(node)\n }\n\n mount() {\n // If we've been provided a DragControls for manual control over the drag gesture,\n // subscribe this component to it on mount.\n const { dragControls } = this.node.getProps()\n\n if (dragControls) {\n this.removeGroupControls = dragControls.subscribe(this.controls)\n }\n\n this.removeListeners = this.controls.addListeners() || noop\n }\n\n update() {\n const { dragControls } = this.node.getProps()\n const { dragControls: prevDragControls } = this.node.prevProps || {}\n\n if (dragControls !== prevDragControls) {\n this.removeGroupControls()\n if (dragControls) {\n this.removeGroupControls = dragControls.subscribe(this.controls)\n }\n }\n }\n\n unmount() {\n this.removeGroupControls()\n this.removeListeners()\n /**\n * In React 19, during list reorder reconciliation, components may\n * briefly unmount and remount while the drag is still active. If we're\n * actively dragging, we should NOT end the pan session - it will\n * continue tracking pointer events via its window-level listeners.\n *\n * The pan session will be properly cleaned up when:\n * 1. The drag ends naturally (pointerup/pointercancel)\n * 2. The component is truly removed from the DOM\n */\n if (!this.controls.isDragging) {\n this.controls.endPanSession()\n }\n }\n}\n","import { Feature, frame, type PanInfo } from \"motion-dom\"\nimport { noop } from \"motion-utils\"\nimport { addPointerEvent } from \"../../events/add-pointer-event\"\nimport { getContextWindow } from \"../../utils/get-context-window\"\nimport { PanSession } from \"./PanSession\"\n\ntype PanEventHandler = (event: PointerEvent, info: PanInfo) => void\nconst asyncHandler =\n (handler?: PanEventHandler) => (event: PointerEvent, info: PanInfo) => {\n if (handler) {\n frame.update(() => handler(event, info), false, true)\n }\n }\n\nexport class PanGesture extends Feature {\n private session?: PanSession\n\n private removePointerDownListener: Function = noop\n\n onPointerDown(pointerDownEvent: PointerEvent) {\n this.session = new PanSession(\n pointerDownEvent,\n this.createPanHandlers(),\n {\n transformPagePoint: this.node.getTransformPagePoint(),\n contextWindow: getContextWindow(this.node),\n }\n )\n }\n\n createPanHandlers() {\n const { onPanSessionStart, onPanStart, onPan, onPanEnd } =\n this.node.getProps()\n\n return {\n onSessionStart: asyncHandler(onPanSessionStart),\n onStart: asyncHandler(onPanStart),\n onMove: asyncHandler(onPan),\n onEnd: (event: PointerEvent, info: PanInfo) => {\n delete this.session\n if (onPanEnd) {\n frame.postRender(() => onPanEnd(event, info))\n }\n },\n }\n }\n\n mount() {\n this.removePointerDownListener = addPointerEvent(\n this.node.current!,\n \"pointerdown\",\n (event: PointerEvent) => this.onPointerDown(event)\n )\n }\n\n update() {\n this.session && this.session.updateHandlers(this.createPanHandlers())\n }\n\n unmount() {\n this.removePointerDownListener()\n this.session && this.session.end()\n }\n}\n","\"use client\"\n\nimport { frame, microtask, globalProjectionState, type VisualElement } from \"motion-dom\"\nimport { Component, useContext } from \"react\"\nimport { usePresence } from \"../../../components/AnimatePresence/use-presence\"\nimport {\n LayoutGroupContext,\n LayoutGroupContextProps,\n} from \"../../../context/LayoutGroupContext\"\nimport { SwitchLayoutGroupContext } from \"../../../context/SwitchLayoutGroupContext\"\nimport { MotionProps } from \"../../types\"\n\ninterface MeasureContextProps {\n layoutGroup: LayoutGroupContextProps\n switchLayoutGroup?: SwitchLayoutGroupContext\n isPresent: boolean\n safeToRemove?: VoidFunction | null\n}\n\ntype MeasureProps = MotionProps &\n MeasureContextProps & { visualElement: VisualElement }\n\n/**\n * Track whether we've taken any snapshots yet. If not,\n * we can safely skip notification of didUpdate.\n *\n * Difficult to capture in a test but to prevent flickering\n * we must set this to true either on update or unmount.\n * Running `next-env/layout-id` in Safari will show this behaviour if broken.\n */\nlet hasTakenAnySnapshot = false\n\nclass MeasureLayoutWithContext extends Component {\n /**\n * This only mounts projection nodes for components that\n * need measuring, we might want to do it for all components\n * in order to incorporate transforms\n */\n componentDidMount() {\n const { visualElement, layoutGroup, switchLayoutGroup, layoutId } =\n this.props\n const { projection } = visualElement\n\n if (projection) {\n if (layoutGroup.group) layoutGroup.group.add(projection)\n\n if (switchLayoutGroup && switchLayoutGroup.register && layoutId) {\n switchLayoutGroup.register(projection)\n }\n\n if (hasTakenAnySnapshot) {\n projection.root!.didUpdate()\n }\n\n projection.addEventListener(\"animationComplete\", () => {\n this.safeToRemove()\n })\n projection.setOptions({\n ...projection.options,\n layoutDependency: this.props.layoutDependency,\n onExitComplete: () => this.safeToRemove(),\n })\n }\n\n globalProjectionState.hasEverUpdated = true\n }\n\n getSnapshotBeforeUpdate(prevProps: MeasureProps) {\n const { layoutDependency, visualElement, drag, isPresent } = this.props\n const { projection } = visualElement\n\n if (!projection) return null\n\n /**\n * TODO: We use this data in relegate to determine whether to\n * promote a previous element. There's no guarantee its presence data\n * will have updated by this point - if a bug like this arises it will\n * have to be that we markForRelegation and then find a new lead some other way,\n * perhaps in didUpdate\n */\n projection.isPresent = isPresent\n\n if (prevProps.layoutDependency !== layoutDependency) {\n projection.setOptions({\n ...projection.options,\n layoutDependency,\n })\n }\n\n hasTakenAnySnapshot = true\n\n if (\n drag ||\n prevProps.layoutDependency !== layoutDependency ||\n layoutDependency === undefined ||\n prevProps.isPresent !== isPresent\n ) {\n projection.willUpdate()\n } else {\n this.safeToRemove()\n }\n\n if (prevProps.isPresent !== isPresent) {\n if (isPresent) {\n projection.promote()\n } else if (!projection.relegate()) {\n /**\n * If there's another stack member taking over from this one,\n * it's in charge of the exit animation and therefore should\n * be in charge of the safe to remove. Otherwise we call it here.\n */\n frame.postRender(() => {\n const stack = projection.getStack()\n if (!stack || !stack.members.length) {\n this.safeToRemove()\n }\n })\n }\n }\n\n return null\n }\n\n componentDidUpdate() {\n const { visualElement, layoutAnchor } = this.props\n const { projection } = visualElement\n if (projection) {\n projection.options.layoutAnchor = layoutAnchor\n\n projection.root!.didUpdate()\n\n microtask.postRender(() => {\n if (!projection.currentAnimation && projection.isLead()) {\n this.safeToRemove()\n }\n })\n }\n }\n\n componentWillUnmount() {\n const {\n visualElement,\n layoutGroup,\n switchLayoutGroup: promoteContext,\n } = this.props\n const { projection } = visualElement\n\n hasTakenAnySnapshot = true\n\n if (projection) {\n projection.scheduleCheckAfterUnmount()\n if (layoutGroup && layoutGroup.group)\n layoutGroup.group.remove(projection)\n if (promoteContext && promoteContext.deregister)\n promoteContext.deregister(projection)\n }\n }\n\n safeToRemove() {\n const { safeToRemove } = this.props\n safeToRemove && safeToRemove()\n }\n\n render() {\n return null\n }\n}\n\nexport function MeasureLayout(\n props: MotionProps & { visualElement: VisualElement }\n) {\n const [isPresent, safeToRemove] = usePresence()\n const layoutGroup = useContext(LayoutGroupContext)\n\n return (\n \n )\n}\n","import { DragGesture } from \"../../gestures/drag\"\nimport { PanGesture } from \"../../gestures/pan\"\nimport { HTMLProjectionNode } from \"../../projection\"\nimport { MeasureLayout } from \"./layout/MeasureLayout\"\nimport { FeaturePackages } from \"./types\"\n\nexport const drag: FeaturePackages = {\n pan: {\n Feature: PanGesture,\n },\n drag: {\n Feature: DragGesture,\n ProjectionNode: HTMLProjectionNode,\n MeasureLayout,\n },\n}\n","import { Feature, frame, hover, type VisualElement } from \"motion-dom\"\nimport { extractEventInfo } from \"../events/event-info\"\n\nfunction handleHoverEvent(\n node: VisualElement,\n event: PointerEvent,\n lifecycle: \"Start\" | \"End\"\n) {\n const { props } = node\n\n if (node.animationState && props.whileHover) {\n node.animationState.setActive(\"whileHover\", lifecycle === \"Start\")\n }\n\n const eventName = (\"onHover\" + lifecycle) as \"onHoverStart\" | \"onHoverEnd\"\n const callback = props[eventName]\n if (callback) {\n frame.postRender(() => callback(event, extractEventInfo(event)))\n }\n}\n\nexport class HoverGesture extends Feature {\n mount() {\n const { current } = this.node\n if (!current) return\n\n this.unmount = hover(current, (_element, startEvent) => {\n handleHoverEvent(this.node, startEvent, \"Start\")\n\n return (endEvent) => handleHoverEvent(this.node, endEvent, \"End\")\n })\n }\n\n unmount() {}\n}\n","import { Feature, addDomEvent } from \"motion-dom\"\nimport { pipe } from \"motion-utils\"\n\nexport class FocusGesture extends Feature {\n private isActive = false\n\n onFocus() {\n let isFocusVisible = false\n\n /**\n * If this element doesn't match focus-visible then don't\n * apply whileHover. But, if matches throws that focus-visible\n * is not a valid selector then in that browser outline styles will be applied\n * to the element by default and we want to match that behaviour with whileFocus.\n */\n try {\n isFocusVisible = this.node.current!.matches(\":focus-visible\")\n } catch (e) {\n isFocusVisible = true\n }\n\n if (!isFocusVisible || !this.node.animationState) return\n\n this.node.animationState.setActive(\"whileFocus\", true)\n this.isActive = true\n }\n\n onBlur() {\n if (!this.isActive || !this.node.animationState) return\n this.node.animationState.setActive(\"whileFocus\", false)\n this.isActive = false\n }\n\n mount() {\n this.unmount = pipe(\n addDomEvent(this.node.current!, \"focus\", () => this.onFocus()),\n addDomEvent(this.node.current!, \"blur\", () => this.onBlur())\n ) as VoidFunction\n }\n\n unmount() {}\n}\n","import { Feature, frame, press, type VisualElement } from \"motion-dom\"\nimport { extractEventInfo } from \"../events/event-info\"\n\nfunction handlePressEvent(\n node: VisualElement,\n event: PointerEvent,\n lifecycle: \"Start\" | \"End\" | \"Cancel\"\n) {\n const { props } = node\n\n if (node.current instanceof HTMLButtonElement && node.current.disabled) {\n return\n }\n\n if (node.animationState && props.whileTap) {\n node.animationState.setActive(\"whileTap\", lifecycle === \"Start\")\n }\n\n const eventName = (\"onTap\" + (lifecycle === \"End\" ? \"\" : lifecycle)) as\n | \"onTapStart\"\n | \"onTap\"\n | \"onTapCancel\"\n\n const callback = props[eventName]\n if (callback) {\n frame.postRender(() => callback(event, extractEventInfo(event)))\n }\n}\n\nexport class PressGesture extends Feature {\n mount() {\n const { current } = this.node\n if (!current) return\n\n const { globalTapTarget, propagate } = this.node.props\n\n this.unmount = press(\n current,\n (_element, startEvent) => {\n handlePressEvent(this.node, startEvent, \"Start\")\n\n return (endEvent, { success }) =>\n handlePressEvent(\n this.node,\n endEvent,\n success ? \"End\" : \"Cancel\"\n )\n },\n {\n useGlobalTarget: globalTapTarget,\n stopPropagation: propagate?.tap === false,\n }\n )\n }\n\n unmount() {}\n}\n","type IntersectionHandler = (entry: IntersectionObserverEntry) => void\n\ninterface ElementIntersectionObservers {\n [key: string]: IntersectionObserver\n}\n\n/**\n * Map an IntersectionHandler callback to an element. We only ever make one handler for one\n * element, so even though these handlers might all be triggered by different\n * observers, we can keep them in the same map.\n */\nconst observerCallbacks = new WeakMap()\n\n/**\n * Multiple observers can be created for multiple element/document roots. Each with\n * different settings. So here we store dictionaries of observers to each root,\n * using serialised settings (threshold/margin) as lookup keys.\n */\nconst observers = new WeakMap<\n Element | Document,\n ElementIntersectionObservers\n>()\n\nconst fireObserverCallback = (entry: IntersectionObserverEntry) => {\n const callback = observerCallbacks.get(entry.target)\n callback && callback(entry)\n}\n\nconst fireAllObserverCallbacks: IntersectionObserverCallback = (entries) => {\n entries.forEach(fireObserverCallback)\n}\n\nfunction initIntersectionObserver({\n root,\n ...options\n}: IntersectionObserverInit): IntersectionObserver {\n const lookupRoot = root || document\n\n /**\n * If we don't have an observer lookup map for this root, create one.\n */\n if (!observers.has(lookupRoot)) {\n observers.set(lookupRoot, {})\n }\n const rootObservers = observers.get(lookupRoot)!\n\n const key = JSON.stringify(options)\n\n /**\n * If we don't have an observer for this combination of root and settings,\n * create one.\n */\n if (!rootObservers[key]) {\n rootObservers[key] = new IntersectionObserver(\n fireAllObserverCallbacks,\n { root, ...options }\n )\n }\n\n return rootObservers[key]\n}\n\nexport function observeIntersection(\n element: Element,\n options: IntersectionObserverInit,\n callback: IntersectionHandler\n) {\n const rootInteresectionObserver = initIntersectionObserver(options)\n\n observerCallbacks.set(element, callback)\n rootInteresectionObserver.observe(element)\n\n return () => {\n observerCallbacks.delete(element)\n rootInteresectionObserver.unobserve(element)\n }\n}\n","import { Feature } from \"motion-dom\"\nimport { MotionProps } from \"../../types\"\nimport { observeIntersection } from \"./observers\"\n\nconst thresholdNames = {\n some: 0,\n all: 1,\n}\n\nexport class InViewFeature extends Feature {\n private hasEnteredView = false\n\n private isInView = false\n\n private stopObserver?: () => void\n\n private startObserver() {\n this.stopObserver?.()\n\n const { viewport = {} } = this.node.getProps()\n const { root, margin: rootMargin, amount = \"some\", once } = viewport\n\n const options = {\n root: root ? root.current : undefined,\n rootMargin,\n threshold:\n typeof amount === \"number\" ? amount : thresholdNames[amount],\n }\n\n const onIntersectionUpdate = (entry: IntersectionObserverEntry) => {\n const { isIntersecting } = entry\n\n /**\n * If there's been no change in the viewport state, early return.\n */\n if (this.isInView === isIntersecting) return\n\n this.isInView = isIntersecting\n\n /**\n * Handle hasEnteredView. If this is only meant to run once, and\n * element isn't visible, early return. Otherwise set hasEnteredView to true.\n */\n if (once && !isIntersecting && this.hasEnteredView) {\n return\n } else if (isIntersecting) {\n this.hasEnteredView = true\n }\n\n if (this.node.animationState) {\n this.node.animationState.setActive(\n \"whileInView\",\n isIntersecting\n )\n }\n\n /**\n * Use the latest committed props rather than the ones in scope\n * when this observer is created\n */\n const { onViewportEnter, onViewportLeave } = this.node.getProps()\n const callback = isIntersecting ? onViewportEnter : onViewportLeave\n callback && callback(entry)\n }\n\n this.stopObserver = observeIntersection(\n this.node.current!,\n options,\n onIntersectionUpdate\n )\n }\n\n mount() {\n this.startObserver()\n }\n\n update() {\n if (typeof IntersectionObserver === \"undefined\") return\n\n const { props, prevProps } = this.node\n const hasOptionsChanged = [\"amount\", \"margin\", \"root\"].some(\n hasViewportOptionChanged(props, prevProps)\n )\n\n if (hasOptionsChanged) {\n this.startObserver()\n }\n }\n\n unmount() {\n this.stopObserver?.()\n this.hasEnteredView = false\n this.isInView = false\n }\n}\n\nfunction hasViewportOptionChanged(\n { viewport = {} }: MotionProps,\n { viewport: prevViewport = {} }: MotionProps = {}\n) {\n return (name: keyof typeof viewport) =>\n viewport[name] !== prevViewport[name]\n}\n","import { HoverGesture } from \"../../gestures/hover\"\nimport { FocusGesture } from \"../../gestures/focus\"\nimport { PressGesture } from \"../../gestures/press\"\nimport { InViewFeature } from \"./viewport\"\nimport { FeaturePackages } from \"./types\"\n\nexport const gestureAnimations: FeaturePackages = {\n inView: {\n Feature: InViewFeature,\n },\n tap: {\n Feature: PressGesture,\n },\n focus: {\n Feature: FocusGesture,\n },\n hover: {\n Feature: HoverGesture,\n },\n}\n","import { HTMLProjectionNode } from \"motion-dom\"\nimport { MeasureLayout } from \"./layout/MeasureLayout\"\nimport { FeaturePackages } from \"./types\"\n\nexport const layout: FeaturePackages = {\n layout: {\n ProjectionNode: HTMLProjectionNode,\n MeasureLayout,\n },\n}\n","import { animations } from \"../../../motion/features/animations\"\nimport { drag } from \"../../../motion/features/drag\"\nimport { gestureAnimations } from \"../../../motion/features/gestures\"\nimport { layout } from \"../../../motion/features/layout\"\n\nexport const featureBundle = {\n ...animations,\n ...gestureAnimations,\n ...drag,\n ...layout,\n}\n"],"names":["useContext","PresenceContext","useId","useEffect","useCallback","isSVGComponent","SVGVisualElement","HTMLVisualElement","Fragment","Feature","createAnimationState","isAnimationControls","resolveVariant","isPrimaryPointer","addDomEvent","frameData","frame","pipe","cancelFrame","secondsToMilliseconds","millisecondsToSeconds","mixNumber","calcLength","calcProgress","clamp","createBox","setDragLock","eachAxis","percent","addValueToWillChange","isRefObject","invariant","measurePageBox","convertBoxToBoundingBox","convertBoundingBoxToBox","animateMotionValue","isElementTextInput","resize","noop","Component","globalProjectionState","microtask","LayoutGroupContext","_jsx","SwitchLayoutGroupContext","HTMLProjectionNode","hover","press"],"mappings":";;;;;;;;AAgBA;;;;;;;;;;;;;;;;;;;;;;AAsBG;AACG,SAAU,WAAW,CACvB,SAAA,GAAqB,IAAI,EAAA;AAEzB,IAAA,MAAM,OAAO,GAAGA,gBAAU,CAACC,qBAAe,CAAC;IAE3C,IAAI,OAAO,KAAK,IAAI;AAAE,QAAA,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC;IAEzC,MAAM,EAAE,SAAS,EAAE,cAAc,EAAE,QAAQ,EAAE,GAAG,OAAO;;;AAKvD,IAAA,MAAM,EAAE,GAAGC,WAAK,EAAE;IAClBC,eAAS,CAAC,MAAK;QACX,IAAI,SAAS,EAAE;AACX,YAAA,OAAO,QAAQ,CAAC,EAAE,CAAC;QACvB;AACJ,IAAA,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC;IAEf,MAAM,YAAY,GAAGC,iBAAW,CAC5B,MAAM,SAAS,IAAI,cAAc,IAAI,cAAc,CAAC,EAAE,CAAC,EACvD,CAAC,EAAE,EAAE,cAAc,EAAE,SAAS,CAAC,CAClC;AAED,IAAA,OAAO,CAAC,SAAS,IAAI,cAAc,GAAG,CAAC,KAAK,EAAE,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC;AACxE;AAEA;;;;;;;;;;;;;;;;;;;AAmBG;SACa,YAAY,GAAA;AACxB,IAAA,OAAO,SAAS,CAACJ,gBAAU,CAACC,qBAAe,CAAC,CAAC;AACjD;AAEM,SAAU,SAAS,CAAC,OAAoC,EAAA;AAC1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AAC,CAC7C;QAED,IAAI,iBAAiB,EAAE;YACnB,IAAI,CAAC,aAAa,EAAE;QACxB;IACJ;IAEA,OAAO,GAAA;AACH,QAAA,IAAI,CAAC,YAAY,IAAI;AACrB,QAAA,IAAI,CAAC,cAAc,GAAG,KAAK;AAC3B,QAAA,IAAI,CAAC,QAAQ,GAAG,KAAK;IACzB;AACH;AAED,SAAS,wBAAwB,CAC7B,EAAE,QAAQ,GAAG,EAAE,EAAe,EAC9B,EAAE,QAAQ,EAAE,YAAY,GAAG,EAAE,KAAkB,EAAE,EAAA;AAEjD,IAAA,OAAO,CAAC,IAA2B,KAC/B,QAAQ,CAAC,IAAI,CAAC,KAAK,YAAY,CAAC,IAAI,CAAC;AAC7C;;AChGO,MAAM,iBAAiB,GAAoB;AAC9C,IAAA,MAAM,EAAE;AACJ,QAAA,OAAO,EAAE,aAAa;AACzB,KAAA;AACD,IAAA,GAAG,EAAE;AACD,QAAA,OAAO,EAAE,YAAY;AACxB,KAAA;AACD,IAAA,KAAK,EAAE;AACH,QAAA,OAAO,EAAE,YAAY;AACxB,KAAA;AACD,IAAA,KAAK,EAAE;AACH,QAAA,OAAO,EAAE,YAAY;AACxB,KAAA;;;ACdE,MAAM,MAAM,GAAoB;AACnC,IAAA,MAAM,EAAE;AACJ,QAAA,cAAc,EAAEoC,4BAAkB;QAClC,aAAa;AAChB,KAAA;;;ACHE,MAAM,aAAa,GAAG;AACzB,IAAA,GAAG,UAAU;AACb,IAAA,GAAG,iBAAiB;AACpB,IAAA,GAAG,IAAI;AACP,IAAA,GAAG,MAAM;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/cjs/index-BuO47Yrm.js b/node_modules/framer-motion/dist/cjs/index-BuO47Yrm.js new file mode 100644 index 0000000..eeaf633 --- /dev/null +++ b/node_modules/framer-motion/dist/cjs/index-BuO47Yrm.js @@ -0,0 +1,771 @@ +'use strict'; + +var jsxRuntime = require('react/jsx-runtime'); +var motionUtils = require('motion-utils'); +var React = require('react'); +var motionDom = require('motion-dom'); + +const LayoutGroupContext = React.createContext({}); + +/** + * Creates a constant value over the lifecycle of a component. + * + * Even if `useMemo` is provided an empty array as its final argument, it doesn't offer + * a guarantee that it won't re-run for performance reasons later on. By using `useConstant` + * you can ensure that initialisers don't execute twice or more. + */ +function useConstant(init) { + const ref = React.useRef(null); + if (ref.current === null) { + ref.current = init(); + } + return ref.current; +} + +const isBrowser = typeof window !== "undefined"; + +const useIsomorphicLayoutEffect = isBrowser ? React.useLayoutEffect : React.useEffect; + +/** + * @public + */ +const PresenceContext = +/* @__PURE__ */ React.createContext(null); + +/** + * @public + */ +const MotionConfigContext = React.createContext({ + transformPagePoint: (p) => p, + isStatic: false, + reducedMotion: "never", +}); + +const LazyContext = React.createContext({ strict: false }); + +const featureProps = { + animation: [ + "animate", + "variants", + "whileHover", + "whileTap", + "exit", + "whileInView", + "whileFocus", + "whileDrag", + ], + exit: ["exit"], + drag: ["drag", "dragControls"], + focus: ["whileFocus"], + hover: ["whileHover", "onHoverStart", "onHoverEnd"], + tap: ["whileTap", "onTap", "onTapStart", "onTapCancel"], + pan: ["onPan", "onPanStart", "onPanSessionStart", "onPanEnd"], + inView: ["whileInView", "onViewportEnter", "onViewportLeave"], + layout: ["layout", "layoutId"], +}; +let isInitialized = false; +/** + * Initialize feature definitions with isEnabled checks. + * This must be called before any motion components are rendered. + */ +function initFeatureDefinitions() { + if (isInitialized) + return; + const initialFeatureDefinitions = {}; + for (const key in featureProps) { + initialFeatureDefinitions[key] = { + isEnabled: (props) => featureProps[key].some((name) => !!props[name]), + }; + } + motionDom.setFeatureDefinitions(initialFeatureDefinitions); + isInitialized = true; +} +/** + * Get the current feature definitions, initializing if needed. + */ +function getInitializedFeatureDefinitions() { + initFeatureDefinitions(); + return motionDom.getFeatureDefinitions(); +} + +function loadFeatures(features) { + const featureDefinitions = getInitializedFeatureDefinitions(); + for (const key in features) { + featureDefinitions[key] = { + ...featureDefinitions[key], + ...features[key], + }; + } + motionDom.setFeatureDefinitions(featureDefinitions); +} + +/** + * We keep these listed separately as we use the lowercase tag names as part + * of the runtime bundle to detect SVG components + */ +const lowercaseSVGElements = [ + "animate", + "circle", + "defs", + "desc", + "ellipse", + "g", + "image", + "line", + "filter", + "marker", + "mask", + "metadata", + "path", + "pattern", + "polygon", + "polyline", + "rect", + "stop", + "switch", + "symbol", + "svg", + "text", + "tspan", + "use", + "view", +]; + +function isSVGComponent(Component) { + if ( + /** + * If it's not a string, it's a custom React component. Currently we only support + * HTML custom React components. + */ + typeof Component !== "string" || + /** + * If it contains a dash, the element is a custom HTML webcomponent. + */ + Component.includes("-")) { + return false; + } + else if ( + /** + * If it's in our list of lowercase SVG tags, it's an SVG component + */ + lowercaseSVGElements.indexOf(Component) > -1 || + /** + * If it contains a capital letter, it's an SVG component + */ + /[A-Z]/u.test(Component)) { + return true; + } + return false; +} + +const MotionContext = /* @__PURE__ */ React.createContext({}); + +function getCurrentTreeVariants(props, context) { + if (motionDom.isControllingVariants(props)) { + const { initial, animate } = props; + return { + initial: initial === false || motionDom.isVariantLabel(initial) + ? initial + : undefined, + animate: motionDom.isVariantLabel(animate) ? animate : undefined, + }; + } + return props.inherit !== false ? context : {}; +} + +function useCreateMotionContext(props) { + const { initial, animate } = getCurrentTreeVariants(props, React.useContext(MotionContext)); + return React.useMemo(() => ({ initial, animate }), [variantLabelsAsDependency(initial), variantLabelsAsDependency(animate)]); +} +function variantLabelsAsDependency(prop) { + return Array.isArray(prop) ? prop.join(" ") : prop; +} + +const createHtmlRenderState = () => ({ + style: {}, + transform: {}, + transformOrigin: {}, + vars: {}, +}); + +function copyRawValuesOnly(target, source, props) { + for (const key in source) { + if (!motionDom.isMotionValue(source[key]) && !motionDom.isForcedMotionValue(key, props)) { + target[key] = source[key]; + } + } +} +function useInitialMotionValues({ transformTemplate }, visualState) { + return React.useMemo(() => { + const state = createHtmlRenderState(); + motionDom.buildHTMLStyles(state, visualState, transformTemplate); + return Object.assign({}, state.vars, state.style); + }, [visualState]); +} +function useStyle(props, visualState) { + const styleProp = props.style || {}; + const style = {}; + /** + * Copy non-Motion Values straight into style + */ + copyRawValuesOnly(style, styleProp, props); + Object.assign(style, useInitialMotionValues(props, visualState)); + return style; +} +function useHTMLProps(props, visualState) { + // The `any` isn't ideal but it is the type of createElement props argument + const htmlProps = {}; + const style = useStyle(props, visualState); + if (props.drag && props.dragListener !== false) { + // Disable the ghost element when a user drags + htmlProps.draggable = false; + // Disable text selection + style.userSelect = + style.WebkitUserSelect = + style.WebkitTouchCallout = + "none"; + // Disable scrolling on the draggable direction + style.touchAction = + props.drag === true + ? "none" + : `pan-${props.drag === "x" ? "y" : "x"}`; + } + if (props.tabIndex === undefined && + (props.onTap || props.onTapStart || props.whileTap)) { + htmlProps.tabIndex = 0; + } + htmlProps.style = style; + return htmlProps; +} + +const createSvgRenderState = () => ({ + ...createHtmlRenderState(), + attrs: {}, +}); + +function useSVGProps(props, visualState, _isStatic, Component) { + const visualProps = React.useMemo(() => { + const state = createSvgRenderState(); + motionDom.buildSVGAttrs(state, visualState, motionDom.isSVGTag(Component), props.transformTemplate, props.style); + return { + ...state.attrs, + style: { ...state.style }, + }; + }, [visualState]); + if (props.style) { + const rawStyles = {}; + copyRawValuesOnly(rawStyles, props.style, props); + visualProps.style = { ...rawStyles, ...visualProps.style }; + } + return visualProps; +} + +/** + * A list of all valid MotionProps. + * + * @privateRemarks + * This doesn't throw if a `MotionProp` name is missing - it should. + */ +const validMotionProps = new Set([ + "animate", + "exit", + "variants", + "initial", + "style", + "values", + "variants", + "transition", + "transformTemplate", + "custom", + "inherit", + "onBeforeLayoutMeasure", + "onAnimationStart", + "onAnimationComplete", + "onUpdate", + "onDragStart", + "onDrag", + "onDragEnd", + "onMeasureDragConstraints", + "onDirectionLock", + "onDragTransitionEnd", + "_dragX", + "_dragY", + "onHoverStart", + "onHoverEnd", + "onViewportEnter", + "onViewportLeave", + "globalTapTarget", + "propagate", + "ignoreStrict", + "viewport", +]); +/** + * Check whether a prop name is a valid `MotionProp` key. + * + * @param key - Name of the property to check + * @returns `true` is key is a valid `MotionProp`. + * + * @public + */ +function isValidMotionProp(key) { + return (key.startsWith("while") || + (key.startsWith("drag") && key !== "draggable") || + key.startsWith("layout") || + key.startsWith("onTap") || + key.startsWith("onPan") || + key.startsWith("onLayout") || + validMotionProps.has(key)); +} + +function shouldForward(key, isValidProp) { + return key.startsWith("on") + ? !isValidMotionProp(key) + : isValidProp?.(key) ?? !isValidMotionProp(key); +} +function filterProps(props, isDom, forwardMotionProps, isValidProp) { + const filteredProps = {}; + for (const key in props) { + /** + * values is considered a valid prop by Emotion, so if it's present + * this will be rendered out to the DOM unless explicitly filtered. + * + * We check the type as it could be used with the `feColorMatrix` + * element, which we support. + */ + if (key === "values" && typeof props.values === "object") + continue; + if (motionDom.isMotionValue(props[key])) + continue; + if (shouldForward(key, isValidProp) || + (forwardMotionProps === true && isValidMotionProp(key)) || + (!isDom && !isValidMotionProp(key)) || + // If trying to use native HTML drag events, forward drag listeners + (props["draggable"] && + key.startsWith("onDrag"))) { + filteredProps[key] = + props[key]; + } + } + return filteredProps; +} + +function useRender(Component, props, ref, { latestValues, }, isStatic, forwardMotionProps = false, isSVG, isValidProp) { + const useVisualProps = (isSVG ?? isSVGComponent(Component)) ? useSVGProps : useHTMLProps; + const visualProps = useVisualProps(props, latestValues, isStatic, Component); + const filteredProps = filterProps(props, typeof Component === "string", forwardMotionProps, isValidProp); + const elementProps = Component !== React.Fragment ? { ...filteredProps, ...visualProps, ref } : {}; + /** + * If component has been handed a motion value as its child, + * memoise its initial value and render that. Subsequent updates + * will be handled by the onChange handler + */ + const { children } = props; + const renderedChildren = React.useMemo(() => (motionDom.isMotionValue(children) ? children.get() : children), [children]); + return React.createElement(Component, { + ...elementProps, + children: renderedChildren, + }); +} + +function makeState({ scrapeMotionValuesFromProps, createRenderState, }, props, context, presenceContext) { + const state = { + latestValues: makeLatestValues(props, context, presenceContext, scrapeMotionValuesFromProps), + renderState: createRenderState(), + }; + return state; +} +function makeLatestValues(props, context, presenceContext, scrapeMotionValues) { + const values = {}; + const motionValues = scrapeMotionValues(props, {}); + for (const key in motionValues) { + values[key] = motionDom.resolveMotionValue(motionValues[key]); + } + let { initial, animate } = props; + const isControllingVariants = motionDom.isControllingVariants(props); + const isVariantNode = motionDom.isVariantNode(props); + if (context && + isVariantNode && + !isControllingVariants && + props.inherit !== false) { + if (initial === undefined) + initial = context.initial; + if (animate === undefined) + animate = context.animate; + } + let isInitialAnimationBlocked = presenceContext + ? presenceContext.initial === false + : false; + isInitialAnimationBlocked = isInitialAnimationBlocked || initial === false; + const variantToSet = isInitialAnimationBlocked ? animate : initial; + if (variantToSet && + typeof variantToSet !== "boolean" && + !motionDom.isAnimationControls(variantToSet)) { + const list = Array.isArray(variantToSet) ? variantToSet : [variantToSet]; + for (let i = 0; i < list.length; i++) { + const resolved = motionDom.resolveVariantFromProps(props, list[i]); + if (resolved) { + const { transitionEnd, transition, ...target } = resolved; + for (const key in target) { + let valueTarget = target[key]; + if (Array.isArray(valueTarget)) { + /** + * Take final keyframe if the initial animation is blocked because + * we want to initialise at the end of that blocked animation. + */ + const index = isInitialAnimationBlocked + ? valueTarget.length - 1 + : 0; + valueTarget = valueTarget[index]; + } + if (valueTarget !== null) { + values[key] = valueTarget; + } + } + for (const key in transitionEnd) { + values[key] = transitionEnd[key]; + } + } + } + } + return values; +} +const makeUseVisualState = (config) => (props, isStatic) => { + const context = React.useContext(MotionContext); + const presenceContext = React.useContext(PresenceContext); + const make = () => makeState(config, props, context, presenceContext); + return isStatic ? make() : useConstant(make); +}; + +const useHTMLVisualState = /*@__PURE__*/ makeUseVisualState({ + scrapeMotionValuesFromProps: motionDom.scrapeHTMLMotionValuesFromProps, + createRenderState: createHtmlRenderState, +}); + +const useSVGVisualState = /*@__PURE__*/ makeUseVisualState({ + scrapeMotionValuesFromProps: motionDom.scrapeSVGMotionValuesFromProps, + createRenderState: createSvgRenderState, +}); + +const motionComponentSymbol = Symbol.for("motionComponentSymbol"); + +/** + * Creates a ref function that, when called, hydrates the provided + * external ref and VisualElement. + */ +function useMotionRef(visualState, visualElement, externalRef) { + /** + * Store externalRef in a ref to avoid including it in the useCallback + * dependency array. Including externalRef in dependencies causes issues + * with libraries like Radix UI that create new callback refs on each render + * when using asChild - this would cause the callback to be recreated, + * triggering element remounts and breaking AnimatePresence exit animations. + */ + const externalRefContainer = React.useRef(externalRef); + React.useInsertionEffect(() => { + externalRefContainer.current = externalRef; + }); + // Store cleanup function returned by callback refs (React 19 feature) + const refCleanup = React.useRef(null); + return React.useCallback((instance) => { + if (instance) { + visualState.onMount?.(instance); + } + if (visualElement) { + instance ? visualElement.mount(instance) : visualElement.unmount(); + } + const ref = externalRefContainer.current; + if (typeof ref === "function") { + if (instance) { + const cleanup = ref(instance); + if (typeof cleanup === "function") { + refCleanup.current = cleanup; + } + } + else if (refCleanup.current) { + refCleanup.current(); + refCleanup.current = null; + } + else { + ref(instance); + } + } + else if (ref) { + ref.current = instance; + } + }, [visualElement]); +} + +/** + * Internal, exported only for usage in Framer + */ +const SwitchLayoutGroupContext = React.createContext({}); + +function isRefObject(ref) { + return (ref && + typeof ref === "object" && + Object.prototype.hasOwnProperty.call(ref, "current")); +} + +function useVisualElement(Component, visualState, props, createVisualElement, ProjectionNodeConstructor, isSVG) { + const { visualElement: parent } = React.useContext(MotionContext); + const lazyContext = React.useContext(LazyContext); + const presenceContext = React.useContext(PresenceContext); + const motionConfig = React.useContext(MotionConfigContext); + const reducedMotionConfig = motionConfig.reducedMotion; + const skipAnimations = motionConfig.skipAnimations; + const visualElementRef = React.useRef(null); + /** + * Track whether the component has been through React's commit phase. + * Used to detect when LazyMotion features load after the component has mounted. + */ + const hasMountedOnce = React.useRef(false); + /** + * If we haven't preloaded a renderer, check to see if we have one lazy-loaded + */ + createVisualElement = + createVisualElement || + lazyContext.renderer; + if (!visualElementRef.current && createVisualElement) { + visualElementRef.current = createVisualElement(Component, { + visualState, + parent, + props, + presenceContext, + blockInitialAnimation: presenceContext + ? presenceContext.initial === false + : false, + reducedMotionConfig, + skipAnimations, + isSVG, + }); + /** + * If the component has already mounted before features loaded (e.g. via + * LazyMotion with async feature loading), we need to force the initial + * animation to run. Otherwise state changes that occurred before features + * loaded will be lost and the element will snap to its final state. + */ + if (hasMountedOnce.current && visualElementRef.current) { + visualElementRef.current.manuallyAnimateOnMount = true; + } + } + const visualElement = visualElementRef.current; + /** + * Load Motion gesture and animation features. These are rendered as renderless + * components so each feature can optionally make use of React lifecycle methods. + */ + const initialLayoutGroupConfig = React.useContext(SwitchLayoutGroupContext); + if (visualElement && + !visualElement.projection && + ProjectionNodeConstructor && + (visualElement.type === "html" || visualElement.type === "svg")) { + createProjectionNode(visualElementRef.current, props, ProjectionNodeConstructor, initialLayoutGroupConfig); + } + const isMounted = React.useRef(false); + React.useInsertionEffect(() => { + /** + * Check the component has already mounted before calling + * `update` unnecessarily. This ensures we skip the initial update. + */ + if (visualElement && isMounted.current) { + visualElement.update(props, presenceContext); + } + }); + /** + * Cache this value as we want to know whether HandoffAppearAnimations + * was present on initial render - it will be deleted after this. + */ + const optimisedAppearId = props[motionDom.optimizedAppearDataAttribute]; + const wantsHandoff = React.useRef(Boolean(optimisedAppearId) && + typeof window !== "undefined" && + !window.MotionHandoffIsComplete?.(optimisedAppearId) && + window.MotionHasOptimisedAnimation?.(optimisedAppearId)); + useIsomorphicLayoutEffect(() => { + /** + * Track that this component has mounted. This is used to detect when + * LazyMotion features load after the component has already committed. + */ + hasMountedOnce.current = true; + if (!visualElement) + return; + isMounted.current = true; + window.MotionIsMounted = true; + visualElement.updateFeatures(); + visualElement.scheduleRenderMicrotask(); + /** + * Ideally this function would always run in a useEffect. + * + * However, if we have optimised appear animations to handoff from, + * it needs to happen synchronously to ensure there's no flash of + * incorrect styles in the event of a hydration error. + * + * So if we detect a situtation where optimised appear animations + * are running, we use useLayoutEffect to trigger animations. + */ + if (wantsHandoff.current && visualElement.animationState) { + visualElement.animationState.animateChanges(); + } + }); + React.useEffect(() => { + if (!visualElement) + return; + if (!wantsHandoff.current && visualElement.animationState) { + visualElement.animationState.animateChanges(); + } + if (wantsHandoff.current) { + // This ensures all future calls to animateChanges() in this component will run in useEffect + queueMicrotask(() => { + window.MotionHandoffMarkAsComplete?.(optimisedAppearId); + }); + wantsHandoff.current = false; + } + /** + * Now we've finished triggering animations for this element we + * can wipe the enteringChildren set for the next render. + */ + visualElement.enteringChildren = undefined; + }); + return visualElement; +} +function createProjectionNode(visualElement, props, ProjectionNodeConstructor, initialPromotionConfig) { + const { layoutId, layout, drag, dragConstraints, layoutScroll, layoutRoot, layoutAnchor, layoutCrossfade, } = props; + visualElement.projection = new ProjectionNodeConstructor(visualElement.latestValues, props["data-framer-portal-id"] + ? undefined + : getClosestProjectingNode(visualElement.parent)); + visualElement.projection.setOptions({ + layoutId, + layout, + alwaysMeasureLayout: Boolean(drag) || (dragConstraints && isRefObject(dragConstraints)), + visualElement, + /** + * TODO: Update options in an effect. This could be tricky as it'll be too late + * to update by the time layout animations run. + * We also need to fix this safeToRemove by linking it up to the one returned by usePresence, + * ensuring it gets called if there's no potential layout animations. + * + */ + animationType: typeof layout === "string" ? layout : "both", + initialPromotionConfig, + crossfade: layoutCrossfade, + layoutScroll, + layoutRoot, + layoutAnchor, + }); +} +function getClosestProjectingNode(visualElement) { + if (!visualElement) + return undefined; + return visualElement.options.allowProjection !== false + ? visualElement.projection + : getClosestProjectingNode(visualElement.parent); +} + +/** + * Create a `motion` component. + * + * This function accepts a Component argument, which can be either a string (ie "div" + * for `motion.div`), or an actual React component. + * + * Alongside this is a config option which provides a way of rendering the provided + * component "offline", or outside the React render cycle. + */ +function createMotionComponent(Component, { forwardMotionProps = false, type } = {}, preloadedFeatures, createVisualElement) { + preloadedFeatures && loadFeatures(preloadedFeatures); + /** + * Determine whether to use SVG or HTML rendering based on: + * 1. Explicit `type` option (highest priority) + * 2. Auto-detection via `isSVGComponent` + */ + const isSVG = type ? type === "svg" : isSVGComponent(Component); + const useVisualState = isSVG ? useSVGVisualState : useHTMLVisualState; + function MotionDOMComponent(props, externalRef) { + /** + * If we need to measure the element we load this functionality in a + * separate class component in order to gain access to getSnapshotBeforeUpdate. + */ + let MeasureLayout; + const configAndProps = { + ...React.useContext(MotionConfigContext), + ...props, + layoutId: useLayoutId(props), + }; + const { isStatic, isValidProp } = configAndProps; + const context = useCreateMotionContext(props); + const visualState = useVisualState(props, isStatic); + if (!isStatic && typeof window !== "undefined") { + useStrictMode(configAndProps, preloadedFeatures); + const layoutProjection = getProjectionFunctionality(configAndProps); + MeasureLayout = layoutProjection.MeasureLayout; + /** + * Create a VisualElement for this component. A VisualElement provides a common + * interface to renderer-specific APIs (ie DOM/Three.js etc) as well as + * providing a way of rendering to these APIs outside of the React render loop + * for more performant animations and interactions + */ + context.visualElement = useVisualElement(Component, visualState, configAndProps, createVisualElement, layoutProjection.ProjectionNode, isSVG); + } + /** + * The mount order and hierarchy is specific to ensure our element ref + * is hydrated by the time features fire their effects. + */ + return (jsxRuntime.jsxs(MotionContext.Provider, { value: context, children: [MeasureLayout && context.visualElement ? (jsxRuntime.jsx(MeasureLayout, { visualElement: context.visualElement, ...configAndProps })) : null, useRender(Component, props, useMotionRef(visualState, context.visualElement, externalRef), visualState, isStatic, forwardMotionProps, isSVG, isValidProp)] })); + } + MotionDOMComponent.displayName = `motion.${typeof Component === "string" + ? Component + : `create(${Component.displayName ?? Component.name ?? ""})`}`; + const ForwardRefMotionComponent = React.forwardRef(MotionDOMComponent); + ForwardRefMotionComponent[motionComponentSymbol] = Component; + return ForwardRefMotionComponent; +} +function useLayoutId({ layoutId }) { + const layoutGroupId = React.useContext(LayoutGroupContext).id; + return layoutGroupId && layoutId !== undefined + ? layoutGroupId + "-" + layoutId + : layoutId; +} +function useStrictMode(configAndProps, preloadedFeatures) { + const isStrict = React.useContext(LazyContext).strict; + /** + * If we're in development mode, check to make sure we're not rendering a motion component + * as a child of LazyMotion, as this will break the file-size benefits of using it. + */ + if (process.env.NODE_ENV !== "production" && + preloadedFeatures && + isStrict) { + const strictMessage = "You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead."; + configAndProps.ignoreStrict + ? motionUtils.warning(false, strictMessage, "lazy-strict-mode") + : motionUtils.invariant(false, strictMessage, "lazy-strict-mode"); + } +} +function getProjectionFunctionality(props) { + const featureDefinitions = getInitializedFeatureDefinitions(); + const { drag, layout } = featureDefinitions; + if (!drag && !layout) + return {}; + const combined = { ...drag, ...layout }; + return { + MeasureLayout: drag?.isEnabled(props) || layout?.isEnabled(props) + ? combined.MeasureLayout + : undefined, + ProjectionNode: combined.ProjectionNode, + }; +} + +exports.LayoutGroupContext = LayoutGroupContext; +exports.LazyContext = LazyContext; +exports.MotionConfigContext = MotionConfigContext; +exports.MotionContext = MotionContext; +exports.PresenceContext = PresenceContext; +exports.SwitchLayoutGroupContext = SwitchLayoutGroupContext; +exports.createMotionComponent = createMotionComponent; +exports.filterProps = filterProps; +exports.isBrowser = isBrowser; +exports.isRefObject = isRefObject; +exports.isSVGComponent = isSVGComponent; +exports.isValidMotionProp = isValidMotionProp; +exports.loadFeatures = loadFeatures; +exports.makeUseVisualState = makeUseVisualState; +exports.motionComponentSymbol = motionComponentSymbol; +exports.useConstant = useConstant; +exports.useIsomorphicLayoutEffect = useIsomorphicLayoutEffect; +//# sourceMappingURL=index-BuO47Yrm.js.map diff --git a/node_modules/framer-motion/dist/cjs/index-BuO47Yrm.js.map b/node_modules/framer-motion/dist/cjs/index-BuO47Yrm.js.map new file mode 100644 index 0000000..5606aca --- /dev/null +++ b/node_modules/framer-motion/dist/cjs/index-BuO47Yrm.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index-BuO47Yrm.js","sources":["../../src/context/LayoutGroupContext.ts","../../src/utils/use-constant.ts","../../src/utils/is-browser.ts","../../src/utils/use-isomorphic-effect.ts","../../src/context/PresenceContext.ts","../../src/context/MotionConfigContext.tsx","../../src/context/LazyContext.ts","../../src/motion/features/definitions.ts","../../src/motion/features/load-features.ts","../../src/render/svg/lowercase-elements.ts","../../src/render/dom/utils/is-svg-component.ts","../../src/context/MotionContext/index.ts","../../src/context/MotionContext/utils.ts","../../src/context/MotionContext/create.ts","../../src/render/html/utils/create-render-state.ts","../../src/render/html/use-props.ts","../../src/render/svg/utils/create-render-state.ts","../../src/render/svg/use-props.ts","../../src/motion/utils/valid-prop.ts","../../src/render/dom/utils/filter-props.ts","../../src/render/dom/use-render.ts","../../src/motion/utils/use-visual-state.ts","../../src/render/html/use-html-visual-state.ts","../../src/render/svg/use-svg-visual-state.ts","../../src/motion/utils/symbol.ts","../../src/motion/utils/use-motion-ref.ts","../../src/context/SwitchLayoutGroupContext.ts","../../src/utils/is-ref-object.ts","../../src/motion/utils/use-visual-element.ts","../../src/motion/index.tsx"],"sourcesContent":["\"use client\"\n\nimport { createContext } from \"react\"\nimport type { NodeGroup } from \"motion-dom\"\n\nexport interface LayoutGroupContextProps {\n id?: string\n group?: NodeGroup\n forceRender?: VoidFunction\n}\n\nexport const LayoutGroupContext = createContext({})\n","\"use client\"\n\nimport { useRef } from \"react\"\n\ntype Init = () => T\n\n/**\n * Creates a constant value over the lifecycle of a component.\n *\n * Even if `useMemo` is provided an empty array as its final argument, it doesn't offer\n * a guarantee that it won't re-run for performance reasons later on. By using `useConstant`\n * you can ensure that initialisers don't execute twice or more.\n */\nexport function useConstant(init: Init) {\n const ref = useRef(null)\n\n if (ref.current === null) {\n ref.current = init()\n }\n\n return ref.current\n}\n","export const isBrowser = typeof window !== \"undefined\"\n","\"use client\"\n\nimport { useEffect, useLayoutEffect } from \"react\"\nimport { isBrowser } from \"./is-browser\"\n\nexport const useIsomorphicLayoutEffect = isBrowser ? useLayoutEffect : useEffect\n","\"use client\"\n\nimport { createContext } from \"react\"\nimport type { PresenceContextProps } from \"motion-dom\"\n\nexport type { PresenceContextProps }\n\n/**\n * @public\n */\nexport const PresenceContext =\n /* @__PURE__ */ createContext(null)\n","\"use client\"\n\nimport type { Transition } from \"motion-dom\"\nimport { TransformPoint } from \"motion-utils\"\nimport { createContext } from \"react\"\n\nexport type ReducedMotionConfig = \"always\" | \"never\" | \"user\"\nexport type IsValidProp = (key: string) => boolean\n\n/**\n * @public\n */\nexport interface MotionConfigContext {\n /**\n * Internal, exported only for usage in Framer\n */\n transformPagePoint: TransformPoint\n\n /**\n * Internal. Determines whether this is a static context ie the Framer canvas. If so,\n * it'll disable all dynamic functionality.\n */\n isStatic: boolean\n\n /**\n * Defines a new default transition for the entire tree.\n *\n * @public\n */\n transition?: Transition\n\n /**\n * If true, will respect the device prefersReducedMotion setting by switching\n * transform animations off.\n *\n * @public\n */\n reducedMotion?: ReducedMotionConfig\n\n /**\n * A custom `nonce` attribute used when wanting to enforce a Content Security Policy (CSP).\n * For more details see:\n * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/style-src#unsafe_inline_styles\n *\n * @public\n */\n nonce?: string\n\n /**\n * If true, all animations will be skipped and values will be set instantly.\n * Useful for E2E tests and visual regression testing.\n *\n * @public\n */\n skipAnimations?: boolean\n\n /**\n * Determines whether a prop should be forwarded to the DOM.\n * Useful when wrapping Motion components with a styling library.\n *\n * @public\n */\n isValidProp?: IsValidProp\n}\n\n/**\n * @public\n */\nexport const MotionConfigContext = createContext({\n transformPagePoint: (p) => p,\n isStatic: false,\n reducedMotion: \"never\",\n})\n","\"use client\"\n\nimport { createContext } from \"react\"\nimport { CreateVisualElement } from \"../render/types\"\n\nexport interface LazyContextProps {\n renderer?: CreateVisualElement\n strict: boolean\n}\n\nexport const LazyContext = createContext({ strict: false })\n","import { getFeatureDefinitions, setFeatureDefinitions } from \"motion-dom\"\nimport { MotionProps } from \"../types\"\nimport { FeatureDefinitions } from \"./types\"\n\nconst featureProps = {\n animation: [\n \"animate\",\n \"variants\",\n \"whileHover\",\n \"whileTap\",\n \"exit\",\n \"whileInView\",\n \"whileFocus\",\n \"whileDrag\",\n ],\n exit: [\"exit\"],\n drag: [\"drag\", \"dragControls\"],\n focus: [\"whileFocus\"],\n hover: [\"whileHover\", \"onHoverStart\", \"onHoverEnd\"],\n tap: [\"whileTap\", \"onTap\", \"onTapStart\", \"onTapCancel\"],\n pan: [\"onPan\", \"onPanStart\", \"onPanSessionStart\", \"onPanEnd\"],\n inView: [\"whileInView\", \"onViewportEnter\", \"onViewportLeave\"],\n layout: [\"layout\", \"layoutId\"],\n}\n\nlet isInitialized = false\n\n/**\n * Initialize feature definitions with isEnabled checks.\n * This must be called before any motion components are rendered.\n */\nexport function initFeatureDefinitions() {\n if (isInitialized) return\n\n const initialFeatureDefinitions: Partial = {}\n\n for (const key in featureProps) {\n initialFeatureDefinitions[\n key as keyof typeof initialFeatureDefinitions\n ] = {\n isEnabled: (props: MotionProps) =>\n featureProps[key as keyof typeof featureProps].some(\n (name: string) => !!props[name as keyof typeof props]\n ),\n }\n }\n\n setFeatureDefinitions(initialFeatureDefinitions)\n isInitialized = true\n}\n\n/**\n * Get the current feature definitions, initializing if needed.\n */\nexport function getInitializedFeatureDefinitions(): Partial {\n initFeatureDefinitions()\n return getFeatureDefinitions()\n}\n","import { setFeatureDefinitions } from \"motion-dom\"\nimport { getInitializedFeatureDefinitions } from \"./definitions\"\nimport { FeaturePackages } from \"./types\"\n\nexport function loadFeatures(features: FeaturePackages) {\n const featureDefinitions = getInitializedFeatureDefinitions()\n\n for (const key in features) {\n featureDefinitions[key as keyof typeof featureDefinitions] = {\n ...featureDefinitions[key as keyof typeof featureDefinitions],\n ...features[key as keyof typeof features],\n } as any\n }\n\n setFeatureDefinitions(featureDefinitions)\n}\n","/**\n * We keep these listed separately as we use the lowercase tag names as part\n * of the runtime bundle to detect SVG components\n */\nexport const lowercaseSVGElements = [\n \"animate\",\n \"circle\",\n \"defs\",\n \"desc\",\n \"ellipse\",\n \"g\",\n \"image\",\n \"line\",\n \"filter\",\n \"marker\",\n \"mask\",\n \"metadata\",\n \"path\",\n \"pattern\",\n \"polygon\",\n \"polyline\",\n \"rect\",\n \"stop\",\n \"switch\",\n \"symbol\",\n \"svg\",\n \"text\",\n \"tspan\",\n \"use\",\n \"view\",\n]\n","import * as React from \"react\"\nimport { lowercaseSVGElements } from \"../../svg/lowercase-elements\"\n\nexport function isSVGComponent(Component: string | React.ComponentType) {\n if (\n /**\n * If it's not a string, it's a custom React component. Currently we only support\n * HTML custom React components.\n */\n typeof Component !== \"string\" ||\n /**\n * If it contains a dash, the element is a custom HTML webcomponent.\n */\n Component.includes(\"-\")\n ) {\n return false\n } else if (\n /**\n * If it's in our list of lowercase SVG tags, it's an SVG component\n */\n lowercaseSVGElements.indexOf(Component) > -1 ||\n /**\n * If it contains a capital letter, it's an SVG component\n */\n /[A-Z]/u.test(Component)\n ) {\n return true\n }\n\n return false\n}\n","\"use client\"\n\nimport type { VisualElement } from \"motion-dom\"\nimport { createContext } from \"react\"\n\nexport interface MotionContextProps {\n visualElement?: VisualElement\n initial?: false | string | string[]\n animate?: string | string[]\n}\n\nexport const MotionContext = /* @__PURE__ */ createContext(\n {}\n)\n","import { isControllingVariants, isVariantLabel } from \"motion-dom\"\nimport type { MotionContextProps } from \".\"\nimport { MotionProps } from \"../../motion/types\"\n\nexport function getCurrentTreeVariants(\n props: MotionProps,\n context: MotionContextProps\n): MotionContextProps {\n if (isControllingVariants(props)) {\n const { initial, animate } = props\n return {\n initial:\n initial === false || isVariantLabel(initial)\n ? (initial as any)\n : undefined,\n animate: isVariantLabel(animate) ? animate : undefined,\n }\n }\n return props.inherit !== false ? context : {}\n}\n","\"use client\"\n\nimport { useContext, useMemo } from \"react\"\nimport { MotionContext, type MotionContextProps } from \".\"\nimport { MotionProps } from \"../../motion/types\"\nimport { getCurrentTreeVariants } from \"./utils\"\n\nexport function useCreateMotionContext(\n props: MotionProps\n): MotionContextProps {\n const { initial, animate } = getCurrentTreeVariants(\n props,\n useContext(MotionContext)\n )\n\n return useMemo(\n () => ({ initial, animate }),\n [variantLabelsAsDependency(initial), variantLabelsAsDependency(animate)]\n )\n}\n\nfunction variantLabelsAsDependency(\n prop: undefined | string | string[] | boolean\n) {\n return Array.isArray(prop) ? prop.join(\" \") : prop\n}\n","import { HTMLRenderState } from \"../types\"\n\nexport const createHtmlRenderState = (): HTMLRenderState => ({\n style: {},\n transform: {},\n transformOrigin: {},\n vars: {},\n})\n","\"use client\"\n\nimport { AnyResolvedKeyframe, buildHTMLStyles, isForcedMotionValue, isMotionValue, MotionValue } from \"motion-dom\"\nimport { HTMLProps, useMemo } from \"react\"\nimport { MotionProps } from \"../../motion/types\"\nimport { ResolvedValues } from \"../types\"\nimport { createHtmlRenderState } from \"./utils/create-render-state\"\n\nexport function copyRawValuesOnly(\n target: ResolvedValues,\n source: { [key: string]: AnyResolvedKeyframe | MotionValue },\n props: MotionProps\n) {\n for (const key in source) {\n if (!isMotionValue(source[key]) && !isForcedMotionValue(key, props)) {\n target[key] = source[key] as AnyResolvedKeyframe\n }\n }\n}\n\nfunction useInitialMotionValues(\n { transformTemplate }: MotionProps,\n visualState: ResolvedValues\n) {\n return useMemo(() => {\n const state = createHtmlRenderState()\n\n buildHTMLStyles(state, visualState, transformTemplate)\n\n return Object.assign({}, state.vars, state.style)\n }, [visualState])\n}\n\nfunction useStyle(\n props: MotionProps,\n visualState: ResolvedValues\n): ResolvedValues {\n const styleProp = props.style || {}\n const style = {}\n\n /**\n * Copy non-Motion Values straight into style\n */\n copyRawValuesOnly(style, styleProp as any, props)\n\n Object.assign(style, useInitialMotionValues(props, visualState))\n\n return style\n}\n\nexport function useHTMLProps(\n props: MotionProps & HTMLProps,\n visualState: ResolvedValues\n) {\n // The `any` isn't ideal but it is the type of createElement props argument\n const htmlProps: any = {}\n const style = useStyle(props, visualState)\n\n if (props.drag && props.dragListener !== false) {\n // Disable the ghost element when a user drags\n htmlProps.draggable = false\n\n // Disable text selection\n style.userSelect =\n style.WebkitUserSelect =\n style.WebkitTouchCallout =\n \"none\"\n\n // Disable scrolling on the draggable direction\n style.touchAction =\n props.drag === true\n ? \"none\"\n : `pan-${props.drag === \"x\" ? \"y\" : \"x\"}`\n }\n\n if (\n props.tabIndex === undefined &&\n (props.onTap || props.onTapStart || props.whileTap)\n ) {\n htmlProps.tabIndex = 0\n }\n\n htmlProps.style = style\n\n return htmlProps\n}\n","import { createHtmlRenderState } from \"../../html/utils/create-render-state\"\nimport { SVGRenderState } from \"../types\"\n\nexport const createSvgRenderState = (): SVGRenderState => ({\n ...createHtmlRenderState(),\n attrs: {},\n})\n","\"use client\"\n\nimport { buildSVGAttrs, isSVGTag } from \"motion-dom\"\nimport { useMemo } from \"react\"\nimport { MotionProps } from \"../../motion/types\"\nimport { copyRawValuesOnly } from \"../html/use-props\"\nimport { ResolvedValues } from \"../types\"\nimport { createSvgRenderState } from \"./utils/create-render-state\"\n\nexport function useSVGProps(\n props: MotionProps,\n visualState: ResolvedValues,\n _isStatic: boolean,\n Component: string | React.ComponentType>\n) {\n const visualProps = useMemo(() => {\n const state = createSvgRenderState()\n\n buildSVGAttrs(\n state,\n visualState,\n isSVGTag(Component),\n props.transformTemplate,\n props.style\n )\n\n return {\n ...state.attrs,\n style: { ...state.style },\n }\n }, [visualState])\n\n if (props.style) {\n const rawStyles = {}\n copyRawValuesOnly(rawStyles, props.style as any, props)\n visualProps.style = { ...rawStyles, ...visualProps.style }\n }\n\n return visualProps\n}\n","import { MotionProps } from \"../types\"\n\n/**\n * A list of all valid MotionProps.\n *\n * @privateRemarks\n * This doesn't throw if a `MotionProp` name is missing - it should.\n */\nconst validMotionProps = new Set([\n \"animate\",\n \"exit\",\n \"variants\",\n \"initial\",\n \"style\",\n \"values\",\n \"variants\",\n \"transition\",\n \"transformTemplate\",\n \"custom\",\n \"inherit\",\n \"onBeforeLayoutMeasure\",\n \"onAnimationStart\",\n \"onAnimationComplete\",\n \"onUpdate\",\n \"onDragStart\",\n \"onDrag\",\n \"onDragEnd\",\n \"onMeasureDragConstraints\",\n \"onDirectionLock\",\n \"onDragTransitionEnd\",\n \"_dragX\",\n \"_dragY\",\n \"onHoverStart\",\n \"onHoverEnd\",\n \"onViewportEnter\",\n \"onViewportLeave\",\n \"globalTapTarget\",\n \"propagate\",\n \"ignoreStrict\",\n \"viewport\",\n])\n\n/**\n * Check whether a prop name is a valid `MotionProp` key.\n *\n * @param key - Name of the property to check\n * @returns `true` is key is a valid `MotionProp`.\n *\n * @public\n */\nexport function isValidMotionProp(key: string) {\n return (\n key.startsWith(\"while\") ||\n (key.startsWith(\"drag\") && key !== \"draggable\") ||\n key.startsWith(\"layout\") ||\n key.startsWith(\"onTap\") ||\n key.startsWith(\"onPan\") ||\n key.startsWith(\"onLayout\") ||\n validMotionProps.has(key as keyof MotionProps)\n )\n}\n","import { isMotionValue } from \"motion-dom\"\nimport type { IsValidProp } from \"../../../context/MotionConfigContext\"\nimport type { MotionProps } from \"../../../motion/types\"\nimport { isValidMotionProp } from \"../../../motion/utils/valid-prop\"\n\nfunction shouldForward(key: string, isValidProp?: IsValidProp) {\n return key.startsWith(\"on\")\n ? !isValidMotionProp(key)\n : isValidProp?.(key) ?? !isValidMotionProp(key)\n}\n\nexport function filterProps(\n props: MotionProps,\n isDom: boolean,\n forwardMotionProps: boolean,\n isValidProp?: IsValidProp\n) {\n const filteredProps: MotionProps = {}\n\n for (const key in props) {\n /**\n * values is considered a valid prop by Emotion, so if it's present\n * this will be rendered out to the DOM unless explicitly filtered.\n *\n * We check the type as it could be used with the `feColorMatrix`\n * element, which we support.\n */\n if (key === \"values\" && typeof props.values === \"object\") continue\n\n if (isMotionValue(props[key as keyof typeof props])) continue\n\n if (\n shouldForward(key, isValidProp) ||\n (forwardMotionProps === true && isValidMotionProp(key)) ||\n (!isDom && !isValidMotionProp(key)) ||\n // If trying to use native HTML drag events, forward drag listeners\n (props[\"draggable\" as keyof MotionProps] &&\n key.startsWith(\"onDrag\"))\n ) {\n filteredProps[key as keyof MotionProps] =\n props[key as keyof MotionProps]\n }\n }\n\n return filteredProps\n}\n","\"use client\"\n\nimport { isMotionValue } from \"motion-dom\"\nimport { Fragment, createElement, useMemo } from \"react\"\nimport type { IsValidProp } from \"../../context/MotionConfigContext\"\nimport { MotionProps } from \"../../motion/types\"\nimport { VisualState } from \"../../motion/utils/use-visual-state\"\nimport { HTMLRenderState } from \"../html/types\"\nimport { useHTMLProps } from \"../html/use-props\"\nimport { SVGRenderState } from \"../svg/types\"\nimport { useSVGProps } from \"../svg/use-props\"\nimport { DOMMotionComponents } from \"./types\"\nimport { filterProps } from \"./utils/filter-props\"\nimport { isSVGComponent } from \"./utils/is-svg-component\"\n\nexport function useRender<\n Props = {},\n TagName extends keyof DOMMotionComponents | string = \"div\"\n>(\n Component: TagName | string | React.ComponentType,\n props: MotionProps,\n ref: React.Ref,\n {\n latestValues,\n }: VisualState,\n isStatic: boolean,\n forwardMotionProps: boolean = false,\n isSVG?: boolean,\n isValidProp?: IsValidProp\n) {\n const useVisualProps =\n (isSVG ?? isSVGComponent(Component)) ? useSVGProps : useHTMLProps\n\n const visualProps = useVisualProps(\n props as any,\n latestValues,\n isStatic,\n Component as any\n )\n const filteredProps = filterProps(\n props,\n typeof Component === \"string\",\n forwardMotionProps,\n isValidProp\n )\n const elementProps =\n Component !== Fragment ? { ...filteredProps, ...visualProps, ref } : {}\n\n /**\n * If component has been handed a motion value as its child,\n * memoise its initial value and render that. Subsequent updates\n * will be handled by the onChange handler\n */\n const { children } = props\n const renderedChildren = useMemo(\n () => (isMotionValue(children) ? children.get() : children),\n [children]\n )\n\n return createElement(Component, {\n ...elementProps,\n children: renderedChildren,\n })\n}\n","\"use client\"\n\nimport {\n AnyResolvedKeyframe,\n isAnimationControls,\n isControllingVariants as checkIsControllingVariants,\n isVariantNode as checkIsVariantNode,\n ResolvedValues,\n resolveVariantFromProps,\n} from \"motion-dom\"\nimport { useContext } from \"react\"\nimport { MotionContext, MotionContextProps } from \"../../context/MotionContext\"\nimport {\n PresenceContext,\n type PresenceContextProps,\n} from \"../../context/PresenceContext\"\nimport { ScrapeMotionValuesFromProps } from \"../../render/types\"\nimport { useConstant } from \"../../utils/use-constant\"\nimport { resolveMotionValue } from \"motion-dom\"\nimport { MotionProps } from \"../types\"\n\nexport interface VisualState {\n renderState: RenderState\n latestValues: ResolvedValues\n onMount?: (instance: Instance) => void\n}\n\nexport type UseVisualState = (\n props: MotionProps,\n isStatic: boolean\n) => VisualState\n\nexport interface UseVisualStateConfig {\n scrapeMotionValuesFromProps: ScrapeMotionValuesFromProps\n createRenderState: () => RenderState\n}\n\nfunction makeState(\n {\n scrapeMotionValuesFromProps,\n createRenderState,\n }: UseVisualStateConfig,\n props: MotionProps,\n context: MotionContextProps,\n presenceContext: PresenceContextProps | null\n) {\n const state: VisualState = {\n latestValues: makeLatestValues(\n props,\n context,\n presenceContext,\n scrapeMotionValuesFromProps\n ),\n renderState: createRenderState(),\n }\n\n return state\n}\n\nfunction makeLatestValues(\n props: MotionProps,\n context: MotionContextProps,\n presenceContext: PresenceContextProps | null,\n scrapeMotionValues: ScrapeMotionValuesFromProps\n) {\n const values: ResolvedValues = {}\n\n const motionValues = scrapeMotionValues(props, {})\n for (const key in motionValues) {\n values[key] = resolveMotionValue(motionValues[key])\n }\n\n let { initial, animate } = props\n const isControllingVariants = checkIsControllingVariants(props)\n const isVariantNode = checkIsVariantNode(props)\n\n if (\n context &&\n isVariantNode &&\n !isControllingVariants &&\n props.inherit !== false\n ) {\n if (initial === undefined) initial = context.initial\n if (animate === undefined) animate = context.animate\n }\n\n let isInitialAnimationBlocked = presenceContext\n ? presenceContext.initial === false\n : false\n isInitialAnimationBlocked = isInitialAnimationBlocked || initial === false\n\n const variantToSet = isInitialAnimationBlocked ? animate : initial\n\n if (\n variantToSet &&\n typeof variantToSet !== \"boolean\" &&\n !isAnimationControls(variantToSet)\n ) {\n const list = Array.isArray(variantToSet) ? variantToSet : [variantToSet]\n for (let i = 0; i < list.length; i++) {\n const resolved = resolveVariantFromProps(props, list[i] as any)\n if (resolved) {\n const { transitionEnd, transition, ...target } = resolved\n for (const key in target) {\n let valueTarget = target[key as keyof typeof target]\n\n if (Array.isArray(valueTarget)) {\n /**\n * Take final keyframe if the initial animation is blocked because\n * we want to initialise at the end of that blocked animation.\n */\n const index = isInitialAnimationBlocked\n ? valueTarget.length - 1\n : 0\n valueTarget = valueTarget[index] as any\n }\n\n if (valueTarget !== null) {\n values[key] = valueTarget as AnyResolvedKeyframe\n }\n }\n for (const key in transitionEnd) {\n values[key] = transitionEnd[\n key as keyof typeof transitionEnd\n ] as AnyResolvedKeyframe\n }\n }\n }\n }\n\n return values\n}\n\nexport const makeUseVisualState =\n (config: UseVisualStateConfig): UseVisualState =>\n (props: MotionProps, isStatic: boolean): VisualState => {\n const context = useContext(MotionContext)\n const presenceContext = useContext(PresenceContext)\n const make = () => makeState(config, props, context, presenceContext)\n\n return isStatic ? make() : useConstant(make)\n }\n","\"use client\"\n\nimport { scrapeHTMLMotionValuesFromProps } from \"motion-dom\"\nimport { makeUseVisualState } from \"../../motion/utils/use-visual-state\"\nimport { createHtmlRenderState } from \"./utils/create-render-state\"\n\nexport const useHTMLVisualState = /*@__PURE__*/ makeUseVisualState({\n scrapeMotionValuesFromProps: scrapeHTMLMotionValuesFromProps,\n createRenderState: createHtmlRenderState,\n})\n","\"use client\"\n\nimport { scrapeSVGMotionValuesFromProps } from \"motion-dom\"\nimport { makeUseVisualState } from \"../../motion/utils/use-visual-state\"\nimport { createSvgRenderState } from \"./utils/create-render-state\"\n\nexport const useSVGVisualState = /*@__PURE__*/ makeUseVisualState({\n scrapeMotionValuesFromProps: scrapeSVGMotionValuesFromProps,\n createRenderState: createSvgRenderState,\n})\n","export const motionComponentSymbol = Symbol.for(\"motionComponentSymbol\")\n","\"use client\"\n\nimport type { VisualElement } from \"motion-dom\"\nimport * as React from \"react\"\nimport { useCallback, useInsertionEffect, useRef } from \"react\"\nimport { VisualState } from \"./use-visual-state\"\n\n/**\n * Creates a ref function that, when called, hydrates the provided\n * external ref and VisualElement.\n */\nexport function useMotionRef(\n visualState: VisualState,\n visualElement?: VisualElement | null,\n externalRef?: React.Ref\n): React.Ref {\n /**\n * Store externalRef in a ref to avoid including it in the useCallback\n * dependency array. Including externalRef in dependencies causes issues\n * with libraries like Radix UI that create new callback refs on each render\n * when using asChild - this would cause the callback to be recreated,\n * triggering element remounts and breaking AnimatePresence exit animations.\n */\n const externalRefContainer = useRef(externalRef)\n useInsertionEffect(() => {\n externalRefContainer.current = externalRef\n })\n\n // Store cleanup function returned by callback refs (React 19 feature)\n const refCleanup = useRef<(() => void) | null>(null)\n\n return useCallback(\n (instance: Instance) => {\n if (instance) {\n visualState.onMount?.(instance)\n }\n\n if (visualElement) {\n instance ? visualElement.mount(instance) : visualElement.unmount()\n }\n\n const ref = externalRefContainer.current\n if (typeof ref === \"function\") {\n if (instance) {\n const cleanup = ref(instance)\n if (typeof cleanup === \"function\") {\n refCleanup.current = cleanup\n }\n } else if (refCleanup.current) {\n refCleanup.current()\n refCleanup.current = null\n } else {\n ref(instance)\n }\n } else if (ref) {\n ;(ref as React.MutableRefObject).current = instance\n }\n },\n [visualElement]\n )\n}\n","\"use client\"\n\nimport type { Transition, IProjectionNode } from \"motion-dom\"\nimport { createContext } from \"react\"\n\nexport interface SwitchLayoutGroup {\n register?: (member: IProjectionNode) => void\n deregister?: (member: IProjectionNode) => void\n}\n\nexport type SwitchLayoutGroupContext = SwitchLayoutGroup &\n InitialPromotionConfig\n\nexport type InitialPromotionConfig = {\n /**\n * The initial transition to use when the elements in this group mount (and automatically promoted).\n * Subsequent updates should provide a transition in the promote method.\n */\n transition?: Transition\n /**\n * If the follow tree should preserve its opacity when the lead is promoted on mount\n */\n shouldPreserveFollowOpacity?: (member: IProjectionNode) => boolean\n}\n\n/**\n * Internal, exported only for usage in Framer\n */\nexport const SwitchLayoutGroupContext = createContext(\n {}\n)\n","import { MutableRefObject } from \"./safe-react-types\"\n\nexport function isRefObject(ref: any): ref is MutableRefObject {\n return (\n ref &&\n typeof ref === \"object\" &&\n Object.prototype.hasOwnProperty.call(ref, \"current\")\n )\n}\n","\"use client\"\n\nimport {\n optimizedAppearDataAttribute,\n type HTMLRenderState,\n type SVGRenderState,\n type VisualElement,\n} from \"motion-dom\"\nimport * as React from \"react\"\nimport { useContext, useEffect, useInsertionEffect, useRef } from \"react\"\nimport { LazyContext } from \"../../context/LazyContext\"\nimport { MotionConfigContext } from \"../../context/MotionConfigContext\"\nimport { MotionContext } from \"../../context/MotionContext\"\nimport { PresenceContext } from \"../../context/PresenceContext\"\nimport {\n InitialPromotionConfig,\n SwitchLayoutGroupContext,\n} from \"../../context/SwitchLayoutGroupContext\"\nimport { MotionProps } from \"../../motion/types\"\nimport type { IProjectionNode } from \"motion-dom\"\nimport { DOMMotionComponents } from \"../../render/dom/types\"\nimport { CreateVisualElement } from \"../../render/types\"\nimport { isRefObject } from \"../../utils/is-ref-object\"\nimport { useIsomorphicLayoutEffect } from \"../../utils/use-isomorphic-effect\"\nimport { VisualState } from \"./use-visual-state\"\n\nexport function useVisualElement<\n Props,\n TagName extends keyof DOMMotionComponents | string\n>(\n Component: TagName | string | React.ComponentType,\n visualState:\n | VisualState\n | VisualState,\n props: MotionProps & Partial,\n createVisualElement?: CreateVisualElement,\n ProjectionNodeConstructor?: any,\n isSVG?: boolean\n): VisualElement | undefined {\n const { visualElement: parent } = useContext(MotionContext)\n const lazyContext = useContext(LazyContext)\n const presenceContext = useContext(PresenceContext)\n const motionConfig = useContext(MotionConfigContext)\n const reducedMotionConfig = motionConfig.reducedMotion\n const skipAnimations = motionConfig.skipAnimations\n\n const visualElementRef = useRef | null>(null)\n\n /**\n * Track whether the component has been through React's commit phase.\n * Used to detect when LazyMotion features load after the component has mounted.\n */\n const hasMountedOnce = useRef(false)\n\n /**\n * If we haven't preloaded a renderer, check to see if we have one lazy-loaded\n */\n createVisualElement =\n createVisualElement ||\n (lazyContext.renderer as CreateVisualElement)\n\n if (!visualElementRef.current && createVisualElement) {\n visualElementRef.current = createVisualElement(Component, {\n visualState,\n parent,\n props,\n presenceContext,\n blockInitialAnimation: presenceContext\n ? presenceContext.initial === false\n : false,\n reducedMotionConfig,\n skipAnimations,\n isSVG,\n })\n\n /**\n * If the component has already mounted before features loaded (e.g. via\n * LazyMotion with async feature loading), we need to force the initial\n * animation to run. Otherwise state changes that occurred before features\n * loaded will be lost and the element will snap to its final state.\n */\n if (hasMountedOnce.current && visualElementRef.current) {\n visualElementRef.current.manuallyAnimateOnMount = true\n }\n }\n\n const visualElement = visualElementRef.current\n\n /**\n * Load Motion gesture and animation features. These are rendered as renderless\n * components so each feature can optionally make use of React lifecycle methods.\n */\n const initialLayoutGroupConfig = useContext(SwitchLayoutGroupContext)\n\n if (\n visualElement &&\n !visualElement.projection &&\n ProjectionNodeConstructor &&\n (visualElement.type === \"html\" || visualElement.type === \"svg\")\n ) {\n createProjectionNode(\n visualElementRef.current!,\n props,\n ProjectionNodeConstructor,\n initialLayoutGroupConfig\n )\n }\n\n const isMounted = useRef(false)\n useInsertionEffect(() => {\n /**\n * Check the component has already mounted before calling\n * `update` unnecessarily. This ensures we skip the initial update.\n */\n if (visualElement && isMounted.current) {\n visualElement.update(props, presenceContext)\n }\n })\n\n /**\n * Cache this value as we want to know whether HandoffAppearAnimations\n * was present on initial render - it will be deleted after this.\n */\n const optimisedAppearId =\n props[optimizedAppearDataAttribute as keyof typeof props]\n const wantsHandoff = useRef(\n Boolean(optimisedAppearId) &&\n typeof window !== \"undefined\" &&\n !window.MotionHandoffIsComplete?.(optimisedAppearId) &&\n window.MotionHasOptimisedAnimation?.(optimisedAppearId)\n )\n\n useIsomorphicLayoutEffect(() => {\n /**\n * Track that this component has mounted. This is used to detect when\n * LazyMotion features load after the component has already committed.\n */\n hasMountedOnce.current = true\n\n if (!visualElement) return\n\n isMounted.current = true\n window.MotionIsMounted = true\n\n visualElement.updateFeatures()\n visualElement.scheduleRenderMicrotask()\n\n /**\n * Ideally this function would always run in a useEffect.\n *\n * However, if we have optimised appear animations to handoff from,\n * it needs to happen synchronously to ensure there's no flash of\n * incorrect styles in the event of a hydration error.\n *\n * So if we detect a situtation where optimised appear animations\n * are running, we use useLayoutEffect to trigger animations.\n */\n if (wantsHandoff.current && visualElement.animationState) {\n visualElement.animationState.animateChanges()\n }\n })\n\n useEffect(() => {\n if (!visualElement) return\n\n if (!wantsHandoff.current && visualElement.animationState) {\n visualElement.animationState.animateChanges()\n }\n\n if (wantsHandoff.current) {\n // This ensures all future calls to animateChanges() in this component will run in useEffect\n queueMicrotask(() => {\n window.MotionHandoffMarkAsComplete?.(optimisedAppearId)\n })\n\n wantsHandoff.current = false\n }\n\n /**\n * Now we've finished triggering animations for this element we\n * can wipe the enteringChildren set for the next render.\n */\n visualElement.enteringChildren = undefined\n })\n\n return visualElement!\n}\n\nfunction createProjectionNode(\n visualElement: VisualElement,\n props: MotionProps,\n ProjectionNodeConstructor: any,\n initialPromotionConfig?: InitialPromotionConfig\n) {\n const {\n layoutId,\n layout,\n drag,\n dragConstraints,\n layoutScroll,\n layoutRoot,\n layoutAnchor,\n layoutCrossfade,\n } = props\n\n visualElement.projection = new ProjectionNodeConstructor(\n visualElement.latestValues,\n props[\"data-framer-portal-id\"]\n ? undefined\n : getClosestProjectingNode(visualElement.parent)\n ) as IProjectionNode\n\n visualElement.projection.setOptions({\n layoutId,\n layout,\n alwaysMeasureLayout:\n Boolean(drag) || (dragConstraints && isRefObject(dragConstraints)),\n visualElement,\n /**\n * TODO: Update options in an effect. This could be tricky as it'll be too late\n * to update by the time layout animations run.\n * We also need to fix this safeToRemove by linking it up to the one returned by usePresence,\n * ensuring it gets called if there's no potential layout animations.\n *\n */\n animationType: typeof layout === \"string\" ? layout : \"both\",\n initialPromotionConfig,\n crossfade: layoutCrossfade,\n layoutScroll,\n layoutRoot,\n layoutAnchor,\n })\n}\n\nfunction getClosestProjectingNode(\n visualElement?: VisualElement<\n unknown,\n unknown,\n { allowProjection?: boolean }\n >\n): IProjectionNode | undefined {\n if (!visualElement) return undefined\n\n return visualElement.options.allowProjection !== false\n ? visualElement.projection\n : getClosestProjectingNode(visualElement.parent)\n}\n","\"use client\"\n\nimport { invariant, warning } from \"motion-utils\"\nimport * as React from \"react\"\nimport { forwardRef, useContext } from \"react\"\nimport { LayoutGroupContext } from \"../context/LayoutGroupContext\"\nimport { LazyContext } from \"../context/LazyContext\"\nimport { MotionConfigContext } from \"../context/MotionConfigContext\"\nimport { MotionContext } from \"../context/MotionContext\"\nimport { useCreateMotionContext } from \"../context/MotionContext/create\"\nimport { DOMMotionComponents } from \"../render/dom/types\"\nimport { useRender } from \"../render/dom/use-render\"\nimport { isSVGComponent } from \"../render/dom/utils/is-svg-component\"\nimport { HTMLRenderState } from \"../render/html/types\"\nimport { useHTMLVisualState } from \"../render/html/use-html-visual-state\"\nimport { SVGRenderState } from \"../render/svg/types\"\nimport { useSVGVisualState } from \"../render/svg/use-svg-visual-state\"\nimport { CreateVisualElement } from \"../render/types\"\nimport { getInitializedFeatureDefinitions } from \"./features/definitions\"\nimport { loadFeatures } from \"./features/load-features\"\nimport { FeatureBundle, FeaturePackages } from \"./features/types\"\nimport { MotionProps } from \"./types\"\nimport { motionComponentSymbol } from \"./utils/symbol\"\nimport { useMotionRef } from \"./utils/use-motion-ref\"\nimport { useVisualElement } from \"./utils/use-visual-element\"\n\nexport interface MotionComponentConfig<\n TagName extends keyof DOMMotionComponents | string = \"div\"\n> {\n preloadedFeatures?: FeatureBundle\n createVisualElement?: CreateVisualElement\n Component: TagName | React.ComponentType>\n forwardMotionProps?: boolean\n}\n\nexport type MotionComponentProps = {\n [K in Exclude]?: Props[K]\n} & MotionProps\n\nexport type MotionComponent = T extends keyof DOMMotionComponents\n ? DOMMotionComponents[T]\n : React.ComponentType<\n Omit, \"children\"> & {\n children?: \"children\" extends keyof P\n ? P[\"children\"] | MotionComponentProps

[\"children\"]\n : MotionComponentProps

[\"children\"]\n }\n >\n\nexport interface MotionComponentOptions {\n forwardMotionProps?: boolean\n /**\n * Specify whether the component renders an HTML or SVG element.\n * This is useful when wrapping custom SVG components that need\n * SVG-specific attribute handling (like viewBox animation).\n * By default, Motion auto-detects based on the component name,\n * but custom React components are always treated as HTML.\n */\n type?: \"html\" | \"svg\"\n}\n\n/**\n * Create a `motion` component.\n *\n * This function accepts a Component argument, which can be either a string (ie \"div\"\n * for `motion.div`), or an actual React component.\n *\n * Alongside this is a config option which provides a way of rendering the provided\n * component \"offline\", or outside the React render cycle.\n */\nexport function createMotionComponent<\n Props,\n TagName extends keyof DOMMotionComponents | string = \"div\"\n>(\n Component: TagName | string | React.ComponentType,\n { forwardMotionProps = false, type }: MotionComponentOptions = {},\n preloadedFeatures?: FeaturePackages,\n createVisualElement?: CreateVisualElement\n) {\n preloadedFeatures && loadFeatures(preloadedFeatures)\n\n /**\n * Determine whether to use SVG or HTML rendering based on:\n * 1. Explicit `type` option (highest priority)\n * 2. Auto-detection via `isSVGComponent`\n */\n const isSVG = type ? type === \"svg\" : isSVGComponent(Component)\n const useVisualState = isSVG ? useSVGVisualState : useHTMLVisualState\n\n function MotionDOMComponent(\n props: MotionComponentProps,\n externalRef?: React.Ref\n ) {\n /**\n * If we need to measure the element we load this functionality in a\n * separate class component in order to gain access to getSnapshotBeforeUpdate.\n */\n let MeasureLayout: undefined | React.ComponentType\n\n const configAndProps = {\n ...useContext(MotionConfigContext),\n ...props,\n layoutId: useLayoutId(props),\n }\n\n const { isStatic, isValidProp } = configAndProps\n\n const context = useCreateMotionContext(props)\n\n const visualState = useVisualState(props, isStatic)\n\n if (!isStatic && typeof window !== \"undefined\") {\n useStrictMode(configAndProps, preloadedFeatures)\n\n const layoutProjection = getProjectionFunctionality(configAndProps)\n MeasureLayout = layoutProjection.MeasureLayout\n\n /**\n * Create a VisualElement for this component. A VisualElement provides a common\n * interface to renderer-specific APIs (ie DOM/Three.js etc) as well as\n * providing a way of rendering to these APIs outside of the React render loop\n * for more performant animations and interactions\n */\n context.visualElement = useVisualElement(\n Component,\n visualState,\n configAndProps,\n createVisualElement,\n layoutProjection.ProjectionNode,\n isSVG\n )\n }\n\n /**\n * The mount order and hierarchy is specific to ensure our element ref\n * is hydrated by the time features fire their effects.\n */\n return (\n \n {MeasureLayout && context.visualElement ? (\n \n ) : null}\n {useRender(\n Component,\n props,\n useMotionRef<\n HTMLElement | SVGElement,\n HTMLRenderState | SVGRenderState\n >(visualState, context.visualElement, externalRef),\n visualState,\n isStatic,\n forwardMotionProps,\n isSVG,\n isValidProp\n )}\n \n )\n }\n\n MotionDOMComponent.displayName = `motion.${\n typeof Component === \"string\"\n ? Component\n : `create(${Component.displayName ?? Component.name ?? \"\"})`\n }`\n\n const ForwardRefMotionComponent = forwardRef(MotionDOMComponent as any)\n ;(ForwardRefMotionComponent as any)[motionComponentSymbol] = Component\n\n return ForwardRefMotionComponent as MotionComponent\n}\n\nfunction useLayoutId({ layoutId }: MotionProps) {\n const layoutGroupId = useContext(LayoutGroupContext).id\n return layoutGroupId && layoutId !== undefined\n ? layoutGroupId + \"-\" + layoutId\n : layoutId\n}\n\nfunction useStrictMode(\n configAndProps: MotionProps,\n preloadedFeatures?: FeaturePackages\n) {\n const isStrict = useContext(LazyContext).strict\n\n /**\n * If we're in development mode, check to make sure we're not rendering a motion component\n * as a child of LazyMotion, as this will break the file-size benefits of using it.\n */\n if (\n process.env.NODE_ENV !== \"production\" &&\n preloadedFeatures &&\n isStrict\n ) {\n const strictMessage =\n \"You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.\"\n configAndProps.ignoreStrict\n ? warning(false, strictMessage, \"lazy-strict-mode\")\n : invariant(false, strictMessage, \"lazy-strict-mode\")\n }\n}\n\nfunction getProjectionFunctionality(props: MotionProps) {\n const featureDefinitions = getInitializedFeatureDefinitions()\n const { drag, layout } = featureDefinitions\n\n if (!drag && !layout) return {}\n\n const combined = { ...drag, ...layout }\n\n return {\n MeasureLayout:\n drag?.isEnabled(props) || layout?.isEnabled(props)\n ? combined.MeasureLayout\n : undefined,\n ProjectionNode: combined.ProjectionNode,\n }\n}\n"],"names":["createContext","useRef","useLayoutEffect","useEffect","setFeatureDefinitions","getFeatureDefinitions","isControllingVariants","isVariantLabel","useContext","useMemo","isMotionValue","isForcedMotionValue","buildHTMLStyles","buildSVGAttrs","isSVGTag","Fragment","createElement","resolveMotionValue","checkIsControllingVariants","checkIsVariantNode","isAnimationControls","resolveVariantFromProps","scrapeHTMLMotionValuesFromProps","scrapeSVGMotionValuesFromProps","useInsertionEffect","useCallback","optimizedAppearDataAttribute","_jsxs","_jsx","forwardRef","warning","invariant"],"mappings":";;;;;;;MAWa,kBAAkB,GAAGA,mBAAa,CAA0B,EAAE;;ACL3E;;;;;;AAMG;AACG,SAAU,WAAW,CAAI,IAAa,EAAA;AACxC,IAAA,MAAM,GAAG,GAAGC,YAAM,CAAW,IAAI,CAAC;AAElC,IAAA,IAAI,GAAG,CAAC,OAAO,KAAK,IAAI,EAAE;AACtB,QAAA,GAAG,CAAC,OAAO,GAAG,IAAI,EAAE;IACxB;IAEA,OAAO,GAAG,CAAC,OAAO;AACtB;;MCrBa,SAAS,GAAG,OAAO,MAAM,KAAK;;ACKpC,MAAM,yBAAyB,GAAG,SAAS,GAAGC,qBAAe,GAAGC;;ACEvE;;AAEG;MACU,eAAe;AACxB,gBAAgBH,mBAAa,CAA8B,IAAI;;ACsDnE;;AAEG;AACI,MAAM,mBAAmB,GAAGA,mBAAa,CAAsB;AAClE,IAAA,kBAAkB,EAAE,CAAC,CAAC,KAAK,CAAC;AAC5B,IAAA,QAAQ,EAAE,KAAK;AACf,IAAA,aAAa,EAAE,OAAO;AACzB,CAAA;;AC9DM,MAAM,WAAW,GAAGA,mBAAa,CAAmB,EAAE,MAAM,EAAE,KAAK,EAAE;;ACN5E,MAAM,YAAY,GAAG;AACjB,IAAA,SAAS,EAAE;QACP,SAAS;QACT,UAAU;QACV,YAAY;QACZ,UAAU;QACV,MAAM;QACN,aAAa;QACb,YAAY;QACZ,WAAW;AACd,KAAA;IACD,IAAI,EAAE,CAAC,MAAM,CAAC;AACd,IAAA,IAAI,EAAE,CAAC,MAAM,EAAE,cAAc,CAAC;IAC9B,KAAK,E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AO;AACH,QAAA,aAAa,EACT,IAAI,EAAE,SAAS,CAAC,KAAK,CAAC,IAAI,MAAM,EAAE,SAAS,CAAC,KAAK;cAC3C,QAAQ,CAAC;AACX,cAAE,SAAS;QACnB,cAAc,EAAE,QAAQ,CAAC,cAAc;KAC1C;AACL;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/cjs/index.js b/node_modules/framer-motion/dist/cjs/index.js new file mode 100644 index 0000000..72b8373 --- /dev/null +++ b/node_modules/framer-motion/dist/cjs/index.js @@ -0,0 +1,3823 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var jsxRuntime = require('react/jsx-runtime'); +var React = require('react'); +var index = require('./index-BuO47Yrm.js'); +var motionDom = require('motion-dom'); +var featureBundle = require('./feature-bundle-BZV7Y7IM.js'); +var motionUtils = require('motion-utils'); + +function _interopNamespaceDefault(e) { + var n = Object.create(null); + if (e) { + Object.keys(e).forEach(function (k) { + if (k !== 'default') { + var d = Object.getOwnPropertyDescriptor(e, k); + Object.defineProperty(n, k, d.get ? d : { + enumerable: true, + get: function () { return e[k]; } + }); + } + }); + } + n.default = e; + return Object.freeze(n); +} + +var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React); + +/** + * Taken from https://github.com/radix-ui/primitives/blob/main/packages/react/compose-refs/src/compose-refs.tsx + */ +/** + * Set a given ref to a given value + * This utility takes care of different types of refs: callback refs and RefObject(s) + */ +function setRef(ref, value) { + if (typeof ref === "function") { + return ref(value); + } + else if (ref !== null && ref !== undefined) { + ref.current = value; + } +} +/** + * A utility to compose multiple refs together + * Accepts callback refs and RefObject(s) + */ +function composeRefs(...refs) { + return (node) => { + let hasCleanup = false; + const cleanups = refs.map((ref) => { + const cleanup = setRef(ref, node); + if (!hasCleanup && typeof cleanup === "function") { + hasCleanup = true; + } + return cleanup; + }); + // React <19 will log an error to the console if a callback ref returns a + // value. We don't use ref cleanups internally so this will only happen if a + // user's ref callback returns a value, which we only expect if they are + // using the cleanup functionality added in React 19. + if (hasCleanup) { + return () => { + for (let i = 0; i < cleanups.length; i++) { + const cleanup = cleanups[i]; + if (typeof cleanup === "function") { + cleanup(); + } + else { + setRef(refs[i], null); + } + } + }; + } + }; +} +/** + * A custom hook that composes multiple refs + * Accepts callback refs and RefObject(s) + */ +function useComposedRefs(...refs) { + // eslint-disable-next-line react-hooks/exhaustive-deps + return React__namespace.useCallback(composeRefs(...refs), refs); +} + +/** + * Measurement functionality has to be within a separate component + * to leverage snapshot lifecycle. + */ +class PopChildMeasure extends React__namespace.Component { + getSnapshotBeforeUpdate(prevProps) { + const element = this.props.childRef.current; + if (motionDom.isHTMLElement(element) && prevProps.isPresent && !this.props.isPresent && this.props.pop !== false) { + const parent = element.offsetParent; + const parentWidth = motionDom.isHTMLElement(parent) + ? parent.offsetWidth || 0 + : 0; + const parentHeight = motionDom.isHTMLElement(parent) + ? parent.offsetHeight || 0 + : 0; + const computedStyle = getComputedStyle(element); + const size = this.props.sizeRef.current; + size.height = parseFloat(computedStyle.height); + size.width = parseFloat(computedStyle.width); + size.top = element.offsetTop; + size.left = element.offsetLeft; + size.right = parentWidth - size.width - size.left; + size.bottom = parentHeight - size.height - size.top; + size.direction = computedStyle.direction; + } + return null; + } + /** + * Required with getSnapshotBeforeUpdate to stop React complaining. + */ + componentDidUpdate() { } + render() { + return this.props.children; + } +} +function PopChild({ children, isPresent, anchorX, anchorY, root, pop }) { + const id = React.useId(); + const ref = React.useRef(null); + const size = React.useRef({ + width: 0, + height: 0, + top: 0, + left: 0, + right: 0, + bottom: 0, + direction: "ltr", + }); + const { nonce } = React.useContext(index.MotionConfigContext); + /** + * In React 19, refs are passed via props.ref instead of element.ref. + * We check props.ref first (React 19) and fall back to element.ref (React 18). + * + * The composed ref is only used when popping the child out (pop !== false), + * so we avoid reading children.props.ref otherwise. In React 18.3 that read + * triggers a spurious "`ref` is not a prop" warning getter (#3745). + */ + const childRef = pop !== false + ? (children.props?.ref ?? + children?.ref) + : undefined; + const composedRef = useComposedRefs(ref, childRef); + /** + * We create and inject a style block so we can apply this explicit + * sizing in a non-destructive manner by just deleting the style block. + * + * We can't apply size via render as the measurement happens + * in getSnapshotBeforeUpdate (post-render), likewise if we apply the + * styles directly on the DOM node, we might be overwriting + * styles set via the style prop. + */ + React.useInsertionEffect(() => { + const { width, height, top, left, right, bottom, direction } = size.current; + if (isPresent || pop === false || !ref.current || !width || !height) + return; + const isRTL = direction === "rtl"; + const x = anchorX === "left" + ? (isRTL ? `right: ${right}` : `left: ${left}`) + : (isRTL ? `left: ${left}` : `right: ${right}`); + const y = anchorY === "bottom" ? `bottom: ${bottom}` : `top: ${top}`; + ref.current.dataset.motionPopId = id; + const style = document.createElement("style"); + if (nonce) + style.nonce = nonce; + const parent = root ?? document.head; + parent.appendChild(style); + if (style.sheet) { + style.sheet.insertRule(` + [data-motion-pop-id="${id}"] { + position: absolute !important; + width: ${width}px !important; + height: ${height}px !important; + ${x}px !important; + ${y}px !important; + } + `); + } + return () => { + ref.current?.removeAttribute("data-motion-pop-id"); + if (parent.contains(style)) { + parent.removeChild(style); + } + }; + }, [isPresent]); + return (jsxRuntime.jsx(PopChildMeasure, { isPresent: isPresent, childRef: ref, sizeRef: size, pop: pop, children: pop === false + ? children + : React__namespace.cloneElement(children, { ref: composedRef }) })); +} + +const PresenceChild = ({ children, initial, isPresent, onExitComplete, custom, presenceAffectsLayout, mode, anchorX, anchorY, root }) => { + const presenceChildren = index.useConstant(newChildrenMap); + const id = React.useId(); + // Written in a layout effect (not render) so discarded concurrent + // renders can't leave the refs pointing at uncommitted state. + const isPresentRef = React.useRef(isPresent); + const onExitCompleteRef = React.useRef(onExitComplete); + index.useIsomorphicLayoutEffect(() => { + isPresentRef.current = isPresent; + onExitCompleteRef.current = onExitComplete; + }); + let isReusedContext = true; + let context = React.useMemo(() => { + isReusedContext = false; + return { + id, + initial, + isPresent, + custom, + onExitComplete: (childId) => { + presenceChildren.set(childId, true); + for (const isComplete of presenceChildren.values()) { + if (!isComplete) + return; // can stop searching when any is incomplete + } + onExitComplete && onExitComplete(); + }, + register: (childId) => { + presenceChildren.set(childId, false); + return () => { + presenceChildren.delete(childId); + !isPresentRef.current && + !presenceChildren.size && + onExitCompleteRef.current?.(); + }; + }, + }; + }, [isPresent, presenceChildren, onExitComplete]); + /** + * If the presence of a child affects the layout of the components around it, + * we want to make a new context value to ensure they get re-rendered + * so they can detect that layout change. + */ + if (presenceAffectsLayout && isReusedContext) { + context = { ...context }; + } + React.useMemo(() => { + presenceChildren.forEach((_, key) => presenceChildren.set(key, false)); + }, [isPresent]); + /** + * If there's no `motion` components to fire exit animations, we want to remove this + * component immediately. + */ + React__namespace.useEffect(() => { + !isPresent && + !presenceChildren.size && + onExitComplete && + onExitComplete(); + }, [isPresent]); + children = (jsxRuntime.jsx(PopChild, { pop: mode === "popLayout", isPresent: isPresent, anchorX: anchorX, anchorY: anchorY, root: root, children: children })); + return (jsxRuntime.jsx(index.PresenceContext.Provider, { value: context, children: children })); +}; +function newChildrenMap() { + return new Map(); +} + +const getChildKey = (child) => child.key || ""; +function onlyElements(children) { + const filtered = []; + // We use forEach here instead of map as map mutates the component key by preprending `.$` + React.Children.forEach(children, (child) => { + if (React.isValidElement(child)) + filtered.push(child); + }); + return filtered; +} + +/** + * `AnimatePresence` enables the animation of components that have been removed from the tree. + * + * When adding/removing more than a single child, every child **must** be given a unique `key` prop. + * + * Any `motion` components that have an `exit` property defined will animate out when removed from + * the tree. + * + * ```jsx + * import { motion, AnimatePresence } from 'framer-motion' + * + * export const Items = ({ items }) => ( + * + * {items.map(item => ( + * + * ))} + * + * ) + * ``` + * + * You can sequence exit animations throughout a tree using variants. + * + * If a child contains multiple `motion` components with `exit` props, it will only unmount the child + * once all `motion` components have finished animating out. Likewise, any components using + * `usePresence` all need to call `safeToRemove`. + * + * @public + */ +const AnimatePresence = ({ children, custom, initial = true, onExitComplete, presenceAffectsLayout = true, mode = "sync", propagate = false, anchorX = "left", anchorY = "top", root }) => { + const [isParentPresent, safeToRemove] = featureBundle.usePresence(propagate); + /** + * Filter any children that aren't ReactElements. We can only track components + * between renders with a props.key. + */ + const presentChildren = React.useMemo(() => onlyElements(children), [children]); + /** + * Track the keys of the currently rendered children. This is used to + * determine which children are exiting. + */ + const presentKeys = propagate && !isParentPresent ? [] : presentChildren.map(getChildKey); + /** + * If `initial={false}` we only want to pass this to components in the first render. + */ + const isInitialRender = React.useRef(true); + /** + * A ref containing the currently present children. When all exit animations + * are complete, we use this to re-render the component with the latest children + * *committed* rather than the latest children *rendered*. + */ + const pendingPresentChildren = React.useRef(presentChildren); + /** + * Track which exiting children have finished animating out. + */ + const exitComplete = index.useConstant(() => new Map()); + /** + * Track which components are currently processing exit to prevent duplicate processing. + */ + const exitingComponents = React.useRef(new Set()); + /** + * Save children to render as React state. To ensure this component is concurrent-safe, + * we check for exiting children via an effect. + */ + const [diffedChildren, setDiffedChildren] = React.useState(presentChildren); + const [renderedChildren, setRenderedChildren] = React.useState(presentChildren); + index.useIsomorphicLayoutEffect(() => { + if (propagate && !isParentPresent && !renderedChildren.length) { + safeToRemove?.(); + } + }, [isParentPresent, propagate, renderedChildren.length, safeToRemove]); + index.useIsomorphicLayoutEffect(() => { + isInitialRender.current = false; + pendingPresentChildren.current = presentChildren; + /** + * Update complete status of exiting children. + */ + for (let i = 0; i < renderedChildren.length; i++) { + const key = getChildKey(renderedChildren[i]); + if (!presentKeys.includes(key)) { + if (exitComplete.get(key) !== true) { + exitComplete.set(key, false); + } + } + else { + exitComplete.delete(key); + exitingComponents.current.delete(key); + } + } + }, [renderedChildren, presentKeys.length, presentKeys.join("-")]); + const exitingChildren = []; + if (presentChildren !== diffedChildren) { + let nextChildren = [...presentChildren]; + /** + * Loop through all the currently rendered components and decide which + * are exiting. + */ + for (let i = 0; i < renderedChildren.length; i++) { + const child = renderedChildren[i]; + const key = getChildKey(child); + if (!presentKeys.includes(key)) { + nextChildren.splice(i, 0, child); + exitingChildren.push(child); + } + } + /** + * If we're in "wait" mode, and we have exiting children, we want to + * only render these until they've all exited. + */ + if (mode === "wait" && exitingChildren.length) { + nextChildren = exitingChildren; + } + setRenderedChildren(onlyElements(nextChildren)); + setDiffedChildren(presentChildren); + /** + * Early return to ensure once we've set state with the latest diffed + * children, we can immediately re-render. + */ + return null; + } + if (process.env.NODE_ENV !== "production" && + mode === "wait" && + renderedChildren.length > 1) { + console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`); + } + /** + * If we've been provided a forceRender function by the LayoutGroupContext, + * we can use it to force a re-render amongst all surrounding components once + * all components have finished animating out. + */ + const { forceRender } = React.useContext(index.LayoutGroupContext); + return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: renderedChildren.map((child) => { + const key = getChildKey(child); + const isPresent = propagate && !isParentPresent + ? false + : presentChildren === renderedChildren || + presentKeys.includes(key); + const onExit = () => { + if (exitingComponents.current.has(key)) { + return; + } + if (exitComplete.has(key)) { + exitingComponents.current.add(key); + exitComplete.set(key, true); + } + else { + return; + } + let isEveryExitComplete = true; + exitComplete.forEach((isExitComplete) => { + if (!isExitComplete) + isEveryExitComplete = false; + }); + if (isEveryExitComplete) { + forceRender?.(); + setRenderedChildren(pendingPresentChildren.current); + propagate && safeToRemove?.(); + onExitComplete && onExitComplete(); + } + }; + return (jsxRuntime.jsx(PresenceChild, { isPresent: isPresent, initial: !isInitialRender.current || initial + ? undefined + : false, custom: custom, presenceAffectsLayout: presenceAffectsLayout, mode: mode, root: root, onExitComplete: isPresent ? undefined : onExit, anchorX: anchorX, anchorY: anchorY, children: child }, key)); + }) })); +}; + +/** + * Note: Still used by components generated by old versions of Framer + * + * @deprecated + */ +const DeprecatedLayoutGroupContext = React.createContext(null); + +function useIsMounted() { + const isMounted = React.useRef(false); + index.useIsomorphicLayoutEffect(() => { + isMounted.current = true; + return () => { + isMounted.current = false; + }; + }, []); + return isMounted; +} + +function useForceUpdate() { + const isMounted = useIsMounted(); + const [forcedRenderCount, setForcedRenderCount] = React.useState(0); + const forceRender = React.useCallback(() => { + isMounted.current && setForcedRenderCount(forcedRenderCount + 1); + }, [forcedRenderCount]); + /** + * Defer this to the end of the next animation frame in case there are multiple + * synchronous calls. + */ + const deferredForceRender = React.useCallback(() => motionDom.frame.postRender(forceRender), [forceRender]); + return [deferredForceRender, forcedRenderCount]; +} + +const shouldInheritGroup = (inherit) => inherit === true; +const shouldInheritId = (inherit) => shouldInheritGroup(inherit === true) || inherit === "id"; +const LayoutGroup = ({ children, id, inherit = true }) => { + const layoutGroupContext = React.useContext(index.LayoutGroupContext); + const deprecatedLayoutGroupContext = React.useContext(DeprecatedLayoutGroupContext); + const [forceRender, key] = useForceUpdate(); + const context = React.useRef(null); + const upstreamId = layoutGroupContext.id || deprecatedLayoutGroupContext; + if (context.current === null) { + if (shouldInheritId(inherit) && upstreamId) { + id = id ? upstreamId + "-" + id : upstreamId; + } + context.current = { + id, + group: shouldInheritGroup(inherit) + ? layoutGroupContext.group || motionDom.nodeGroup() + : motionDom.nodeGroup(), + }; + } + const memoizedContext = React.useMemo(() => ({ ...context.current, forceRender }), [key]); + return (jsxRuntime.jsx(index.LayoutGroupContext.Provider, { value: memoizedContext, children: children })); +}; + +/** + * Used in conjunction with the `m` component to reduce bundle size. + * + * `m` is a version of the `motion` component that only loads functionality + * critical for the initial render. + * + * `LazyMotion` can then be used to either synchronously or asynchronously + * load animation and gesture support. + * + * ```jsx + * // Synchronous loading + * import { LazyMotion, m, domAnimation } from "framer-motion" + * + * function App() { + * return ( + * + * + * + * ) + * } + * + * // Asynchronous loading + * import { LazyMotion, m } from "framer-motion" + * + * function App() { + * return ( + * import('./path/to/domAnimation')}> + * + * + * ) + * } + * ``` + * + * @public + */ +function LazyMotion({ children, features, strict = false }) { + const [, setIsLoaded] = React.useState(!isLazyBundle(features)); + const loadedRenderer = React.useRef(undefined); + /** + * If this is a synchronous load, load features immediately + */ + if (!isLazyBundle(features)) { + const { renderer, ...loadedFeatures } = features; + loadedRenderer.current = renderer; + index.loadFeatures(loadedFeatures); + } + React.useEffect(() => { + if (isLazyBundle(features)) { + features().then(({ renderer, ...loadedFeatures }) => { + index.loadFeatures(loadedFeatures); + loadedRenderer.current = renderer; + setIsLoaded(true); + }); + } + }, []); + return (jsxRuntime.jsx(index.LazyContext.Provider, { value: { renderer: loadedRenderer.current, strict }, children: children })); +} +function isLazyBundle(features) { + return typeof features === "function"; +} + +/** + * `MotionConfig` is used to set configuration options for all children `motion` components. + * + * ```jsx + * import { motion, MotionConfig } from "framer-motion" + * + * export function App() { + * return ( + * + * + * + * ) + * } + * ``` + * + * @public + */ +function MotionConfig({ children, ...config }) { + /** + * Inherit props from any parent MotionConfig components + */ + const parentConfig = React.useContext(index.MotionConfigContext); + config = { ...parentConfig, ...config }; + config.transition = motionDom.resolveTransition(config.transition, parentConfig.transition); + /** + * Don't allow isStatic to change between renders as it affects how many hooks + * motion components fire. + */ + config.isStatic = index.useConstant(() => config.isStatic); + /** + * Creating a new config context object will re-render every `motion` component + * every time it renders. So we only want to create a new one sparingly. + */ + const context = React.useMemo(() => config, [ + JSON.stringify(config.transition), + config.transformPagePoint, + config.reducedMotion, + config.skipAnimations, + config.isValidProp, + ]); + return (jsxRuntime.jsx(index.MotionConfigContext.Provider, { value: context, children: children })); +} + +const ReorderContext = React.createContext(null); + +function createMotionProxy(preloadedFeatures, createVisualElement) { + if (typeof Proxy === "undefined") { + return index.createMotionComponent; + } + /** + * A cache of generated `motion` components, e.g `motion.div`, `motion.input` etc. + * Rather than generating them anew every render. + */ + const componentCache = new Map(); + const factory = (Component, options) => { + return index.createMotionComponent(Component, options, preloadedFeatures, createVisualElement); + }; + /** + * Support for deprecated`motion(Component)` pattern + */ + const deprecatedFactoryFunction = (Component, options) => { + if (process.env.NODE_ENV !== "production") { + motionUtils.warnOnce(false, "motion() is deprecated. Use motion.create() instead."); + } + return factory(Component, options); + }; + return new Proxy(deprecatedFactoryFunction, { + /** + * Called when `motion` is referenced with a prop: `motion.div`, `motion.input` etc. + * The prop name is passed through as `key` and we can use that to generate a `motion` + * DOM component with that name. + */ + get: (_target, key) => { + if (key === "create") + return factory; + /** + * If this element doesn't exist in the component cache, create it and cache. + */ + if (!componentCache.has(key)) { + componentCache.set(key, index.createMotionComponent(key, undefined, preloadedFeatures, createVisualElement)); + } + return componentCache.get(key); + }, + }); +} + +const motion = /*@__PURE__*/ createMotionProxy(featureBundle.featureBundle, featureBundle.createDomVisualElement); + +function checkReorder(order, value, offset, velocity, axis, direction = "ltr") { + const index = order.findIndex((item) => item.value === value); + if (index === -1) + return order; + if (axis === "xy") { + const { layout } = order[index]; + const center = { + x: motionDom.mixNumber(layout.x.min, layout.x.max, 0.5) + offset.x, + y: motionDom.mixNumber(layout.y.min, layout.y.max, 0.5) + offset.y, + }; + const lines = getLines(order); + const sourceLine = lines.find((line) => line.items.includes(order[index])); + const targetLine = lines.reduce((closest, line) => distanceToLine(center.y, line) < distanceToLine(center.y, closest) + ? line + : closest); + if (targetLine !== sourceLine) { + return moveToLine(order, index, center.x, targetLine, direction); + } + const currentDistance = distanceToBox(center, layout); + let target = -1; + let targetDistance = currentDistance; + order.forEach((item, targetIndex) => { + if (targetIndex === index) + return; + const distance = distanceToBox(center, item.layout); + if (distance < targetDistance) { + target = targetIndex; + targetDistance = distance; + } + }); + return target === -1 + ? order + : motionUtils.moveItem(order, index, index + Math.sign(target - index)); + } + if (!velocity[axis]) + return order; + const nextOffset = velocity[axis] > 0 ? 1 : -1; + const nextItem = order[index + nextOffset]; + if (!nextItem) + return order; + const item = order[index]; + const itemLayout = item.layout[axis]; + const nextLayout = nextItem.layout[axis]; + const nextItemCenter = motionDom.mixNumber(nextLayout.min, nextLayout.max, 0.5); + if ((nextOffset === 1 && itemLayout.max + offset[axis] > nextItemCenter) || + (nextOffset === -1 && itemLayout.min + offset[axis] < nextItemCenter)) { + return motionUtils.moveItem(order, index, index + nextOffset); + } + return order; +} +function getLines(order) { + const lines = []; + order.forEach((item) => { + const { min, max } = item.layout.y; + const line = lines[lines.length - 1]; + if (!line || min >= line.max || max <= line.min) { + lines.push({ items: [item], min, max }); + } + else { + line.items.push(item); + line.min = Math.min(line.min, min); + line.max = Math.max(line.max, max); + } + }); + return lines; +} +function distanceToLine(y, line) { + return y < line.min ? line.min - y : y > line.max ? y - line.max : 0; +} +function moveToLine(order, index, x, line, direction) { + const remaining = order.filter((_, itemIndex) => itemIndex !== index); + const before = line.items.find((item) => { + const center = motionDom.mixNumber(item.layout.x.min, item.layout.x.max, 0.5); + return direction === "ltr" ? x < center : x > center; + }); + const targetIndex = before + ? remaining.indexOf(before) + : remaining.indexOf(line.items[line.items.length - 1]) + 1; + const nextOrder = [...remaining]; + nextOrder.splice(targetIndex, 0, order[index]); + return nextOrder.every((item, itemIndex) => item === order[itemIndex]) + ? order + : nextOrder; +} +function distanceToBox(point, box) { + const x = Math.max(box.x.min - point.x, 0, point.x - box.x.max); + const y = Math.max(box.y.min - point.y, 0, point.y - box.y.max); + return x * x + y * y; +} + +const isSeparated = (a, b) => a.max <= b.min || b.max <= a.min; +function detectAxis(layouts) { + let x = false; + let y = false; + for (let i = 0; i < layouts.length; i++) { + for (let j = i + 1; j < layouts.length; j++) { + x || (x = isSeparated(layouts[i].x, layouts[j].x)); + y || (y = isSeparated(layouts[i].y, layouts[j].y)); + if (x && y) + return "xy"; + } + } + return x ? "x" : "y"; +} + +function ReorderGroupComponent({ children, as = "ul", axis: axisOverride, onReorder, values, ...props }, externalRef) { + const Component = index.useConstant(() => motion[as]); + const itemLayouts = React.useRef(new Map()); + const [detectedAxis, setDetectedAxis] = React.useState("y"); + const isReordering = React.useRef(false); + const groupRef = React.useRef(null); + const axis = axisOverride || detectedAxis; + motionUtils.invariant(Boolean(values), "Reorder.Group must be provided a values prop", "reorder-values"); + const valuesSet = new Set(values); + itemLayouts.current.forEach((_, value) => { + if (!valuesSet.has(value)) + itemLayouts.current.delete(value); + }); + const context = { + axis, + groupRef, + registerItem: (value, layout) => { + itemLayouts.current.set(value, layout); + if (!axisOverride) { + const nextAxis = detectAxis(values.flatMap((itemValue) => { + const itemLayout = itemLayouts.current.get(itemValue); + return itemLayout ? [itemLayout] : []; + })); + if (nextAxis !== detectedAxis) + setDetectedAxis(nextAxis); + } + }, + updateOrder: (item, offset, velocity) => { + if (isReordering.current) + return; + const order = values.flatMap((value) => { + const layout = itemLayouts.current.get(value); + return layout ? [{ value, layout }] : []; + }); + const direction = groupRef.current?.ownerDocument.defaultView?.getComputedStyle(groupRef.current).direction === "rtl" + ? "rtl" + : "ltr"; + const newOrder = checkReorder(order, item, offset, velocity, axis, direction); + if (order !== newOrder) { + isReordering.current = true; + const newValues = [...values]; + const measuredIndexes = order.map(({ value }) => values.indexOf(value)); + newOrder.forEach(({ value }, index) => { + newValues[measuredIndexes[index]] = value; + }); + onReorder(newValues); + } + }, + }; + React.useEffect(() => { + isReordering.current = false; + }); + // Combine refs if external ref is provided + const setRef = (element) => { + groupRef.current = element; + if (typeof externalRef === "function") { + externalRef(element); + } + else if (externalRef) { + externalRef.current = + element; + } + }; + /** + * Disable browser scroll anchoring on the group container. + * When items reorder, scroll anchoring can cause the browser to adjust + * the scroll position, which interferes with drag position calculations. + */ + const groupStyle = { + overflowAnchor: "none", + ...props.style, + }; + return (jsxRuntime.jsx(Component, { ...props, style: groupStyle, ref: setRef, ignoreStrict: true, children: jsxRuntime.jsx(ReorderContext.Provider, { value: context, children: children }) })); +} +const ReorderGroup = /*@__PURE__*/ React.forwardRef(ReorderGroupComponent); + +/** + * Creates a `MotionValue` to track the state and velocity of a value. + * + * Usually, these are created automatically. For advanced use-cases, like use with `useTransform`, you can create `MotionValue`s externally and pass them into the animated component via the `style` prop. + * + * ```jsx + * export const MyComponent = () => { + * const scale = useMotionValue(1) + * + * return + * } + * ``` + * + * @param initial - The initial state. + * + * @public + */ +function useMotionValue(initial) { + const value = index.useConstant(() => motionDom.motionValue(initial)); + /** + * If this motion value is being used in static mode, like on + * the Framer canvas, force components to rerender when the motion + * value is updated. + */ + const { isStatic } = React.useContext(index.MotionConfigContext); + if (isStatic) { + const [, setLatest] = React.useState(initial); + React.useEffect(() => value.on("change", setLatest), []); + } + return value; +} + +function useCombineMotionValues(values, combineValues) { + /** + * Initialise the returned motion value. This remains the same between renders. + */ + const value = useMotionValue(combineValues()); + /** + * Create a function that will update the template motion value with the latest values. + * This is pre-bound so whenever a motion value updates it can schedule its + * execution in Framesync. If it's already been scheduled it won't be fired twice + * in a single frame. + */ + const updateValue = () => value.set(combineValues()); + /** + * Synchronously update the motion value with the latest values during the render. + * This ensures that within a React render, the styles applied to the DOM are up-to-date. + */ + updateValue(); + /** + * Subscribe to all motion values found within the template. Whenever any of them change, + * schedule an update. + */ + index.useIsomorphicLayoutEffect(() => { + const scheduleUpdate = () => motionDom.frame.preRender(updateValue, false, true); + const subscriptions = values.map((v) => v.on("change", scheduleUpdate)); + return () => { + subscriptions.forEach((unsubscribe) => unsubscribe()); + motionDom.cancelFrame(updateValue); + }; + }); + return value; +} + +function useComputed(compute) { + /** + * Open session of collectMotionValues. Any MotionValue that calls get() + * will be saved into this array. + */ + motionDom.collectMotionValues.current = []; + compute(); + const value = useCombineMotionValues(motionDom.collectMotionValues.current, compute); + /** + * Synchronously close session of collectMotionValues. + */ + motionDom.collectMotionValues.current = undefined; + return value; +} + +function useTransform(input, inputRangeOrTransformer, outputRangeOrMap, options) { + if (typeof input === "function") { + return useComputed(input); + } + /** + * Detect if outputRangeOrMap is an output map (object with keys) + * rather than an output range (array). + */ + const isOutputMap = outputRangeOrMap !== undefined && + !Array.isArray(outputRangeOrMap) && + typeof inputRangeOrTransformer !== "function"; + if (isOutputMap) { + return useMapTransform(input, inputRangeOrTransformer, outputRangeOrMap, options); + } + const outputRange = outputRangeOrMap; + const transformer = typeof inputRangeOrTransformer === "function" + ? inputRangeOrTransformer + : motionDom.transform(inputRangeOrTransformer, outputRange, options); + const result = Array.isArray(input) + ? useListTransform(input, transformer) + : useListTransform([input], ([latest]) => transformer(latest)); + const inputAccelerate = !Array.isArray(input) + ? input.accelerate + : undefined; + if (inputAccelerate && + !inputAccelerate.isTransformed && + typeof inputRangeOrTransformer !== "function" && + Array.isArray(outputRangeOrMap) && + options?.clamp !== false) { + result.accelerate = { + ...inputAccelerate, + times: inputRangeOrTransformer, + keyframes: outputRangeOrMap, + isTransformed: true, + ...(options?.ease ? { ease: options.ease } : {}), + }; + } + return result; +} +function useListTransform(values, transformer) { + const latest = index.useConstant(() => []); + return useCombineMotionValues(values, () => { + latest.length = 0; + const numValues = values.length; + for (let i = 0; i < numValues; i++) { + latest[i] = values[i].get(); + } + return transformer(latest); + }); +} +function useMapTransform(inputValue, inputRange, outputMap, options) { + /** + * Capture keys once to ensure hooks are called in consistent order. + */ + const keys = index.useConstant(() => Object.keys(outputMap)); + const output = index.useConstant(() => ({})); + for (const key of keys) { + output[key] = useTransform(inputValue, inputRange, outputMap[key], options); + } + return output; +} + +const threshold = 50; +const maxSpeed = 25; +const overflowStyles = new Set(["auto", "scroll"]); +// Track initial scroll limits per scrollable element (Bug 1 fix) +const initialScrollLimits = new WeakMap(); +const activeScrollEdge = new WeakMap(); +// Track which group element is currently dragging to clear state on end +let currentGroupElement = null; +function resetAutoScrollState() { + if (currentGroupElement) { + const scrollableAncestor = findScrollableAncestor(currentGroupElement, "y"); + if (scrollableAncestor) { + activeScrollEdge.delete(scrollableAncestor); + initialScrollLimits.delete(scrollableAncestor); + } + // Also try x axis + const scrollableAncestorX = findScrollableAncestor(currentGroupElement, "x"); + if (scrollableAncestorX && scrollableAncestorX !== scrollableAncestor) { + activeScrollEdge.delete(scrollableAncestorX); + initialScrollLimits.delete(scrollableAncestorX); + } + currentGroupElement = null; + } +} +function isScrollableElement(element, axis) { + const style = getComputedStyle(element); + const overflow = axis === "x" ? style.overflowX : style.overflowY; + const isDocumentScroll = element === document.body || + element === document.documentElement; + return overflowStyles.has(overflow) || isDocumentScroll; +} +function findScrollableAncestor(element, axis) { + let current = element?.parentElement; + while (current) { + if (isScrollableElement(current, axis)) { + return current; + } + current = current.parentElement; + } + return null; +} +function getScrollAmount(pointerPosition, scrollElement, axis) { + const rect = scrollElement.getBoundingClientRect(); + const start = axis === "x" ? Math.max(0, rect.left) : Math.max(0, rect.top); + const end = axis === "x" ? Math.min(window.innerWidth, rect.right) : Math.min(window.innerHeight, rect.bottom); + const distanceFromStart = pointerPosition - start; + const distanceFromEnd = end - pointerPosition; + if (distanceFromStart < threshold) { + const intensity = 1 - distanceFromStart / threshold; + return { amount: -maxSpeed * intensity * intensity, edge: "start" }; + } + else if (distanceFromEnd < threshold) { + const intensity = 1 - distanceFromEnd / threshold; + return { amount: maxSpeed * intensity * intensity, edge: "end" }; + } + return { amount: 0, edge: null }; +} +function autoScrollIfNeeded(groupElement, pointerPosition, axis, velocity) { + if (!groupElement) + return; + // Track the group element for cleanup + currentGroupElement = groupElement; + const scrollableAncestor = findScrollableAncestor(groupElement, axis); + if (!scrollableAncestor) + return; + // Convert pointer position from page coordinates to viewport coordinates. + // The gesture system uses pageX/pageY but getBoundingClientRect() returns + // viewport-relative coordinates, so we need to account for page scroll. + const viewportPointerPosition = pointerPosition - (axis === "x" ? window.scrollX : window.scrollY); + const { amount: scrollAmount, edge } = getScrollAmount(viewportPointerPosition, scrollableAncestor, axis); + // If not in any threshold zone, clear all state + if (edge === null) { + activeScrollEdge.delete(scrollableAncestor); + initialScrollLimits.delete(scrollableAncestor); + return; + } + const currentActiveEdge = activeScrollEdge.get(scrollableAncestor); + const isDocumentScroll = scrollableAncestor === document.body || + scrollableAncestor === document.documentElement; + // If not currently scrolling this edge, check velocity to see if we should start + if (currentActiveEdge !== edge) { + // Only start scrolling if velocity is towards the edge + const shouldStart = (edge === "start" && velocity < 0) || + (edge === "end" && velocity > 0); + if (!shouldStart) + return; + // Activate this edge + activeScrollEdge.set(scrollableAncestor, edge); + // Record initial scroll limit (prevents infinite scroll) + const maxScroll = axis === "x" + ? scrollableAncestor.scrollWidth - (isDocumentScroll ? window.innerWidth : scrollableAncestor.clientWidth) + : scrollableAncestor.scrollHeight - (isDocumentScroll ? window.innerHeight : scrollableAncestor.clientHeight); + initialScrollLimits.set(scrollableAncestor, maxScroll); + } + // Cap scrolling at initial limit (prevents infinite scroll) + if (scrollAmount > 0) { + const initialLimit = initialScrollLimits.get(scrollableAncestor); + const currentScroll = axis === "x" + ? (isDocumentScroll ? window.scrollX : scrollableAncestor.scrollLeft) + : (isDocumentScroll ? window.scrollY : scrollableAncestor.scrollTop); + if (currentScroll >= initialLimit) + return; + } + // Apply scroll + if (axis === "x") { + if (isDocumentScroll) { + window.scrollBy({ left: scrollAmount }); + } + else { + scrollableAncestor.scrollLeft += scrollAmount; + } + } + else { + if (isDocumentScroll) { + window.scrollBy({ top: scrollAmount }); + } + else { + scrollableAncestor.scrollTop += scrollAmount; + } + } +} + +function useDefaultMotionValue(value, defaultValue = 0) { + return motionDom.isMotionValue(value) ? value : useMotionValue(defaultValue); +} +function ReorderItemComponent({ children, style = {}, value, as = "li", onDrag, onDragEnd, layout = true, ...props }, externalRef) { + const Component = index.useConstant(() => motion[as]); + const context = React.useContext(ReorderContext); + const point = { + x: useDefaultMotionValue(style.x), + y: useDefaultMotionValue(style.y), + }; + const zIndex = useTransform([point.x, point.y], ([latestX, latestY]) => latestX || latestY ? 1 : "unset"); + motionUtils.invariant(Boolean(context), "Reorder.Item must be a child of Reorder.Group", "reorder-item-child"); + const { axis, registerItem, updateOrder, groupRef } = context; + const dragAxis = axis === "xy" ? true : axis; + return (jsxRuntime.jsx(Component, { drag: dragAxis, ...props, dragSnapToOrigin: true, style: { ...style, x: point.x, y: point.y, zIndex }, layout: layout, onDrag: (event, gesturePoint) => { + const { velocity, point: pointerPoint } = gesturePoint; + const offset = { x: point.x.get(), y: point.y.get() }; + updateOrder(value, offset, velocity); + const scrollAxis = axis === "xy" + ? Math.abs(velocity.x) > Math.abs(velocity.y) + ? "x" + : "y" + : axis; + autoScrollIfNeeded(groupRef.current, pointerPoint[scrollAxis], scrollAxis, velocity[scrollAxis]); + onDrag && onDrag(event, gesturePoint); + }, onDragEnd: (event, gesturePoint) => { + resetAutoScrollState(); + onDragEnd && onDragEnd(event, gesturePoint); + }, onLayoutMeasure: (measured) => { + registerItem(value, measured); + }, ref: externalRef, ignoreStrict: true, children: children })); +} +const ReorderItem = /*@__PURE__*/ React.forwardRef(ReorderItemComponent); + +var namespace = /*#__PURE__*/Object.freeze({ + __proto__: null, + Group: ReorderGroup, + Item: ReorderItem +}); + +function isDOMKeyframes(keyframes) { + return typeof keyframes === "object" && !Array.isArray(keyframes); +} + +function resolveSubjects(subject, keyframes, scope, selectorCache) { + if (subject == null) { + return []; + } + if (typeof subject === "string" && isDOMKeyframes(keyframes)) { + return motionDom.resolveElements(subject, scope, selectorCache); + } + else if (subject instanceof NodeList) { + return Array.from(subject); + } + else if (Array.isArray(subject)) { + return subject.filter((s) => s != null); + } + else { + return [subject]; + } +} + +function calculateRepeatDuration(duration, repeat, repeatDelay) { + return duration * (repeat + 1) + repeatDelay * repeat; +} + +/** + * Given a absolute or relative time definition and current/prev time state of the sequence, + * calculate an absolute time for the next keyframes. + */ +function calcNextTime(current, next, prev, labels) { + if (typeof next === "number") { + return next; + } + else if (next.startsWith("-") || next.startsWith("+")) { + return Math.max(0, current + parseFloat(next)); + } + else if (next === "<") { + return prev; + } + else if (next.startsWith("<")) { + return Math.max(0, prev + parseFloat(next.slice(1))); + } + else { + return labels.get(next) ?? current; + } +} + +function eraseKeyframes(sequence, startTime, endTime) { + for (let i = 0; i < sequence.length; i++) { + const keyframe = sequence[i]; + if (keyframe.at > startTime && keyframe.at < endTime) { + motionUtils.removeItem(sequence, keyframe); + // If we remove this item we have to push the pointer back one + i--; + } + } +} +function addKeyframes(sequence, keyframes, easing, offset, startTime, endTime) { + /** + * Erase every existing value between currentTime and targetTime, + * this will essentially splice this timeline into any currently + * defined ones. + */ + eraseKeyframes(sequence, startTime, endTime); + for (let i = 0; i < keyframes.length; i++) { + sequence.push({ + value: keyframes[i], + at: motionDom.mixNumber(startTime, endTime, offset[i]), + easing: motionUtils.getEasingForSegment(easing, i), + }); + } +} + +/** + * Take an array of times that represent repeated keyframes. For instance + * if we have original times of [0, 0.5, 1] then our repeated times will + * be [0, 0.5, 1, 1, 1.5, 2]. Loop over the times and scale them back + * down to a 0-1 scale. + * + * `repeatDelayUnits` is the repeatDelay expressed in units of a single + * iteration's duration, so the total span equals `(repeat + 1) + repeat * repeatDelayUnits`. + */ +function normalizeTimes(times, repeat, repeatDelayUnits = 0) { + const totalUnits = repeat + 1 + repeat * repeatDelayUnits; + for (let i = 0; i < times.length; i++) { + times[i] = times[i] / totalUnits; + } +} + +function compareByTime(a, b) { + if (a.at === b.at) { + if (a.value === null) + return 1; + if (b.value === null) + return -1; + return 0; + } + else { + return a.at - b.at; + } +} + +const defaultSegmentEasing = "easeInOut"; +const MAX_REPEAT = 20; +function createAnimationsFromSequence(sequence, { defaultTransition = {}, ...sequenceTransition } = {}, scope, generators) { + const defaultDuration = defaultTransition.duration || 0.3; + const animationDefinitions = new Map(); + const sequences = new Map(); + const elementCache = {}; + const timeLabels = new Map(); + let prevTime = 0; + let currentTime = 0; + let totalDuration = 0; + /** + * Build the timeline by mapping over the sequence array and converting + * the definitions into keyframes and offsets with absolute time values. + * These will later get converted into relative offsets in a second pass. + */ + for (let i = 0; i < sequence.length; i++) { + const segment = sequence[i]; + /** + * If this is a timeline label, mark it and skip the rest of this iteration. + */ + if (typeof segment === "string") { + timeLabels.set(segment, currentTime); + continue; + } + else if (!Array.isArray(segment)) { + timeLabels.set(segment.name, calcNextTime(currentTime, segment.at, prevTime, timeLabels)); + continue; + } + let [subject, keyframes, transition = {}] = segment; + /** + * If a relative or absolute time value has been specified we need to resolve + * it in relation to the currentTime. + */ + if (transition.at !== undefined) { + currentTime = calcNextTime(currentTime, transition.at, prevTime, timeLabels); + } + /** + * Keep track of the maximum duration in this definition. This will be + * applied to currentTime once the definition has been parsed. + */ + let maxDuration = 0; + const resolveValueSequence = (valueKeyframes, valueTransition, valueSequence, elementIndex = 0, numSubjects = 0) => { + const valueKeyframesAsList = keyframesAsList(valueKeyframes); + const { delay = 0, times = motionDom.defaultOffset(valueKeyframesAsList), type = defaultTransition.type || "keyframes", repeat, repeatType, repeatDelay = 0, ...remainingTransition } = valueTransition; + let { ease = defaultTransition.ease || "easeOut", duration } = valueTransition; + /** + * Resolve stagger() if defined. + */ + const calculatedDelay = typeof delay === "function" + ? delay(elementIndex, numSubjects) + : delay; + /** + * If this animation should and can use a spring, generate a spring easing function. + */ + const numKeyframes = valueKeyframesAsList.length; + const createGenerator = motionDom.isGenerator(type) + ? type + : generators?.[type || "keyframes"]; + if (numKeyframes <= 2 && createGenerator) { + /** + * As we're creating an easing function from a spring, + * ideally we want to generate it using the real distance + * between the two keyframes. However this isn't always + * possible - in these situations we use 0-100. + */ + let absoluteDelta = 100; + if (numKeyframes === 2 && + isNumberKeyframesArray(valueKeyframesAsList)) { + const delta = valueKeyframesAsList[1] - valueKeyframesAsList[0]; + absoluteDelta = Math.abs(delta); + } + const springTransition = { + ...defaultTransition, + ...remainingTransition, + }; + if (duration !== undefined) { + springTransition.duration = motionUtils.secondsToMilliseconds(duration); + } + const springEasing = motionDom.createGeneratorEasing(springTransition, absoluteDelta, createGenerator); + ease = springEasing.ease; + duration = springEasing.duration; + } + duration ?? (duration = defaultDuration); + const startTime = currentTime + calculatedDelay; + /** + * If there's only one time offset of 0, fill in a second with length 1 + */ + if (times.length === 1 && times[0] === 0) { + times[1] = 1; + } + /** + * Fill out if offset if fewer offsets than keyframes + */ + const remainder = times.length - valueKeyframesAsList.length; + remainder > 0 && motionDom.fillOffset(times, remainder); + /** + * If only one value has been set, ie [1], push a null to the start of + * the keyframe array. This will let us mark a keyframe at this point + * that will later be hydrated with the previous value. + */ + valueKeyframesAsList.length === 1 && + valueKeyframesAsList.unshift(null); + /** + * Segments can't express `repeat: Infinity` or very large + * counts — they'd leave dead time after the segment or + * explode the keyframe array. Ignore with a warning. + */ + if (repeat) { + motionUtils.warning(repeat < MAX_REPEAT, `Sequence segments can't repeat ${repeat} times — ignoring repeat option. Use a value below ${MAX_REPEAT} or apply repeat at the sequence level instead.`); + } + if (repeat && repeat < MAX_REPEAT) { + /** + * Express repeatDelay in units of a single iteration's duration + * so it can be added to the per-iteration time offsets below + * before they're normalized to 0-1. + */ + const repeatDelayUnits = duration > 0 ? repeatDelay / duration : 0; + duration = calculateRepeatDuration(duration, repeat, repeatDelay); + const originalKeyframes = [...valueKeyframesAsList]; + const originalTimes = [...times]; + ease = Array.isArray(ease) ? [...ease] : [ease]; + const originalEase = [...ease]; + /** + * For reverse/mirror, alternate iterations play the segment + * backwards. mirror matches JSAnimation's mirroredGenerator: + * reversed keyframes, easings unchanged. reverse matches + * JSAnimation's iterationProgress = 1 - p: reversed + * keyframes, easing array reversed AND each function easing + * mapped through reverseEasing (string easings unchanged — + * they're resolved later by the keyframes engine). + */ + const isFlipping = repeatType === "reverse" || repeatType === "mirror"; + let flippedKeyframes = originalKeyframes; + let flippedEases = originalEase; + if (isFlipping) { + flippedKeyframes = [...originalKeyframes].reverse(); + if (repeatType === "reverse") { + flippedEases = [...originalEase] + .reverse() + .map((e) => typeof e === "function" + ? motionUtils.reverseEasing(e) + : e); + } + } + for (let repeatIndex = 0; repeatIndex < repeat; repeatIndex++) { + const isFlipped = isFlipping && repeatIndex % 2 === 0; + const iterKeyframes = isFlipped + ? flippedKeyframes + : originalKeyframes; + const iterEase = isFlipped ? flippedEases : originalEase; + const iterStartOffset = (repeatIndex + 1) * (1 + repeatDelayUnits); + /** + * If repeatDelay is set, hold the previous iteration's + * final value through the delay by inserting a keyframe + * at the moment the next iteration begins. + */ + if (repeatDelayUnits > 0) { + valueKeyframesAsList.push(valueKeyframesAsList[valueKeyframesAsList.length - 1]); + times.push(iterStartOffset); + ease.push("linear"); + } + valueKeyframesAsList.push(...iterKeyframes); + for (let keyframeIndex = 0; keyframeIndex < iterKeyframes.length; keyframeIndex++) { + times.push(originalTimes[keyframeIndex] + iterStartOffset); + ease.push(keyframeIndex === 0 + ? "linear" + : motionUtils.getEasingForSegment(iterEase, keyframeIndex - 1)); + } + } + normalizeTimes(times, repeat, repeatDelayUnits); + } + const targetTime = startTime + duration; + /** + * Add keyframes, mapping offsets to absolute time. + */ + addKeyframes(valueSequence, valueKeyframesAsList, ease, times, startTime, targetTime); + maxDuration = Math.max(calculatedDelay + duration, maxDuration); + totalDuration = Math.max(targetTime, totalDuration); + }; + if (motionDom.isMotionValue(subject)) { + const subjectSequence = getSubjectSequence(subject, sequences); + resolveValueSequence(keyframes, transition, getValueSequence("default", subjectSequence)); + } + else { + const subjects = resolveSubjects(subject, keyframes, scope, elementCache); + const numSubjects = subjects.length; + /** + * For every element in this segment, process the defined values. + */ + for (let subjectIndex = 0; subjectIndex < numSubjects; subjectIndex++) { + /** + * Cast necessary, but we know these are of this type + */ + keyframes = keyframes; + transition = transition; + const thisSubject = subjects[subjectIndex]; + const subjectSequence = getSubjectSequence(thisSubject, sequences); + for (const key in keyframes) { + resolveValueSequence(keyframes[key], getValueTransition(transition, key), getValueSequence(key, subjectSequence), subjectIndex, numSubjects); + } + } + } + prevTime = currentTime; + currentTime += maxDuration; + } + /** + * For every element and value combination create a new animation. + */ + sequences.forEach((valueSequences, element) => { + for (const key in valueSequences) { + const valueSequence = valueSequences[key]; + /** + * Arrange all the keyframes in ascending time order. + */ + valueSequence.sort(compareByTime); + const keyframes = []; + const valueOffset = []; + const valueEasing = []; + /** + * For each keyframe, translate absolute times into + * relative offsets based on the total duration of the timeline. + */ + for (let i = 0; i < valueSequence.length; i++) { + const { at, value, easing } = valueSequence[i]; + keyframes.push(value); + valueOffset.push(motionUtils.progress(0, totalDuration, at)); + valueEasing.push(easing || "easeOut"); + } + /** + * If the first keyframe doesn't land on offset: 0 + * provide one by duplicating the initial keyframe. This ensures + * it snaps to the first keyframe when the animation starts. + */ + if (valueOffset[0] !== 0) { + valueOffset.unshift(0); + keyframes.unshift(keyframes[0]); + valueEasing.unshift(defaultSegmentEasing); + } + /** + * If the last keyframe doesn't land on offset: 1 + * provide one with a null wildcard value. This will ensure it + * stays static until the end of the animation. + */ + if (valueOffset[valueOffset.length - 1] !== 1) { + valueOffset.push(1); + keyframes.push(null); + } + if (!animationDefinitions.has(element)) { + animationDefinitions.set(element, { + keyframes: {}, + transition: {}, + }); + } + const definition = animationDefinitions.get(element); + definition.keyframes[key] = keyframes; + /** + * Exclude `type` from defaultTransition since springs have been + * converted to duration-based easing functions in resolveValueSequence. + * Including `type: "spring"` would cause JSAnimation to error when + * the merged keyframes array has more than 2 keyframes. + */ + const { type: _type, ...remainingDefaultTransition } = defaultTransition; + definition.transition[key] = { + ...remainingDefaultTransition, + duration: totalDuration, + ease: valueEasing, + times: valueOffset, + ...sequenceTransition, + }; + } + }); + return animationDefinitions; +} +function getSubjectSequence(subject, sequences) { + !sequences.has(subject) && sequences.set(subject, {}); + return sequences.get(subject); +} +function getValueSequence(name, sequences) { + if (!sequences[name]) + sequences[name] = []; + return sequences[name]; +} +function keyframesAsList(keyframes) { + return Array.isArray(keyframes) ? keyframes : [keyframes]; +} +function getValueTransition(transition, key) { + return transition && transition[key] + ? { + ...transition, + ...transition[key], + } + : { ...transition }; +} +const isNumber = (keyframe) => typeof keyframe === "number"; +const isNumberKeyframesArray = (keyframes) => keyframes.every(isNumber); + +function createDOMVisualElement(element) { + const options = { + presenceContext: null, + props: {}, + visualState: { + renderState: { + transform: {}, + transformOrigin: {}, + style: {}, + vars: {}, + attrs: {}, + }, + latestValues: {}, + }, + }; + const node = motionDom.isSVGElement(element) && !motionDom.isSVGSVGElement(element) + ? new motionDom.SVGVisualElement(options) + : new motionDom.HTMLVisualElement(options); + node.mount(element); + motionDom.visualElementStore.set(element, node); +} +function createObjectVisualElement(subject) { + const options = { + presenceContext: null, + props: {}, + visualState: { + renderState: { + output: {}, + }, + latestValues: {}, + }, + }; + const node = new motionDom.ObjectVisualElement(options); + node.mount(subject); + motionDom.visualElementStore.set(subject, node); +} + +function isSingleValue(subject, keyframes) { + return (motionDom.isMotionValue(subject) || + typeof subject === "number" || + (typeof subject === "string" && !isDOMKeyframes(keyframes))); +} +/** + * Implementation + */ +function animateSubject(subject, keyframes, options, scope) { + const animations = []; + if (isSingleValue(subject, keyframes)) { + animations.push(motionDom.animateSingleValue(subject, isDOMKeyframes(keyframes) + ? keyframes.default || keyframes + : keyframes, options ? options.default || options : options)); + } + else { + // Gracefully handle null/undefined subjects (e.g., from querySelector returning null) + if (subject == null) { + return animations; + } + const subjects = resolveSubjects(subject, keyframes, scope); + const numSubjects = subjects.length; + motionUtils.invariant(Boolean(numSubjects), "No valid elements provided.", "no-valid-elements"); + for (let i = 0; i < numSubjects; i++) { + const thisSubject = subjects[i]; + const createVisualElement = thisSubject instanceof Element + ? createDOMVisualElement + : createObjectVisualElement; + if (!motionDom.visualElementStore.has(thisSubject)) { + createVisualElement(thisSubject); + } + const visualElement = motionDom.visualElementStore.get(thisSubject); + const transition = { ...options }; + /** + * Resolve stagger function if provided. + */ + if ("delay" in transition && + typeof transition.delay === "function") { + transition.delay = transition.delay(i, numSubjects); + } + animations.push(...motionDom.animateTarget(visualElement, { ...keyframes, transition }, {})); + } + } + return animations; +} + +function animateSequence(sequence, options, scope) { + const animations = []; + /** + * Pre-process: replace function segments with MotionValue segments, + * subscribe callbacks immediately + */ + const processedSequence = sequence.map((segment) => { + if (Array.isArray(segment) && typeof segment[0] === "function") { + const callback = segment[0]; + const mv = motionDom.motionValue(0); + mv.on("change", callback); + if (segment.length === 1) { + return [mv, [0, 1]]; + } + else if (segment.length === 2) { + return [mv, [0, 1], segment[1]]; + } + else { + return [mv, segment[1], segment[2]]; + } + } + return segment; + }); + const animationDefinitions = createAnimationsFromSequence(processedSequence, options, scope, { spring: motionDom.spring }); + animationDefinitions.forEach(({ keyframes, transition }, subject) => { + animations.push(...animateSubject(subject, keyframes, transition)); + }); + return animations; +} + +function isSequence(value) { + return Array.isArray(value) && value.some(Array.isArray); +} +/** + * Creates an animation function that is optionally scoped + * to a specific element. + */ +function createScopedAnimate(options = {}) { + const { scope, reduceMotion, skipAnimations } = options; + /** + * Implementation + */ + function scopedAnimate(subjectOrSequence, optionsOrKeyframes, options) { + let animations = []; + let animationOnComplete; + const inherited = {}; + if (reduceMotion !== undefined) + inherited.reduceMotion = reduceMotion; + if (skipAnimations !== undefined) + inherited.skipAnimations = skipAnimations; + if (isSequence(subjectOrSequence)) { + const { onComplete, ...sequenceOptions } = optionsOrKeyframes || {}; + if (typeof onComplete === "function") { + animationOnComplete = onComplete; + } + animations = animateSequence(subjectOrSequence, { ...inherited, ...sequenceOptions }, scope); + } + else { + // Extract top-level onComplete so it doesn't get applied per-value + const { onComplete, ...rest } = options || {}; + if (typeof onComplete === "function") { + animationOnComplete = onComplete; + } + animations = animateSubject(subjectOrSequence, optionsOrKeyframes, { ...inherited, ...rest }, scope); + } + const animation = new motionDom.GroupAnimationWithThen(animations); + if (animationOnComplete) { + animation.finished.then(animationOnComplete); + } + if (scope) { + scope.animations.push(animation); + animation.finished.then(() => { + motionUtils.removeItem(scope.animations, animation); + }); + } + return animation; + } + return scopedAnimate; +} +const animate = createScopedAnimate(); + +function animateElements(elementOrSelector, keyframes, options, scope) { + // Gracefully handle null/undefined elements (e.g., from querySelector returning null) + if (elementOrSelector == null) { + return []; + } + const elements = motionDom.resolveElements(elementOrSelector, scope); + const numElements = elements.length; + motionUtils.invariant(Boolean(numElements), "No valid elements provided.", "no-valid-elements"); + /** + * WAAPI doesn't support interrupting animations. + * + * Therefore, starting animations requires a three-step process: + * 1. Stop existing animations (write styles to DOM) + * 2. Resolve keyframes (read styles from DOM) + * 3. Create new animations (write styles to DOM) + * + * The hybrid `animate()` function uses AsyncAnimation to resolve + * keyframes before creating new animations, which removes style + * thrashing. Here, we have much stricter filesize constraints. + * Therefore we do this in a synchronous way that ensures that + * at least within `animate()` calls there is no style thrashing. + * + * In the motion-native-animate-mini-interrupt benchmark this + * was 80% faster than a single loop. + */ + const animationDefinitions = []; + /** + * Step 1: Build options and stop existing animations (write) + */ + for (let i = 0; i < numElements; i++) { + const element = elements[i]; + const elementTransition = { ...options }; + /** + * Resolve stagger function if provided. + */ + if (typeof elementTransition.delay === "function") { + elementTransition.delay = elementTransition.delay(i, numElements); + } + for (const valueName in keyframes) { + let valueKeyframes = keyframes[valueName]; + if (!Array.isArray(valueKeyframes)) { + valueKeyframes = [valueKeyframes]; + } + const valueOptions = { + ...motionDom.getValueTransition(elementTransition, valueName), + }; + valueOptions.duration && (valueOptions.duration = motionUtils.secondsToMilliseconds(valueOptions.duration)); + valueOptions.delay && (valueOptions.delay = motionUtils.secondsToMilliseconds(valueOptions.delay)); + /** + * If there's an existing animation playing on this element then stop it + * before creating a new one. + */ + const map = motionDom.getAnimationMap(element); + const key = motionDom.animationMapKey(valueName, valueOptions.pseudoElement || ""); + const currentAnimation = map.get(key); + currentAnimation && currentAnimation.stop(); + animationDefinitions.push({ + map, + key, + unresolvedKeyframes: valueKeyframes, + options: { + ...valueOptions, + element, + name: valueName, + allowFlatten: !elementTransition.type && !elementTransition.ease, + }, + }); + } + } + /** + * Step 2: Resolve keyframes (read) + */ + for (let i = 0; i < animationDefinitions.length; i++) { + const { unresolvedKeyframes, options: animationOptions } = animationDefinitions[i]; + const { element, name, pseudoElement } = animationOptions; + if (!pseudoElement && unresolvedKeyframes[0] === null) { + unresolvedKeyframes[0] = motionDom.getComputedStyle(element, name); + } + motionDom.fillWildcards(unresolvedKeyframes); + motionDom.applyPxDefaults(unresolvedKeyframes, name); + /** + * If we only have one keyframe, explicitly read the initial keyframe + * from the computed style. This is to ensure consistency with WAAPI behaviour + * for restarting animations, for instance .play() after finish, when it + * has one vs two keyframes. + */ + if (!pseudoElement && unresolvedKeyframes.length < 2) { + unresolvedKeyframes.unshift(motionDom.getComputedStyle(element, name)); + } + animationOptions.keyframes = unresolvedKeyframes; + } + /** + * Step 3: Create new animations (write) + */ + const animations = []; + for (let i = 0; i < animationDefinitions.length; i++) { + const { map, key, options: animationOptions } = animationDefinitions[i]; + const animation = new motionDom.NativeAnimation(animationOptions); + map.set(key, animation); + animation.finished.finally(() => map.delete(key)); + animations.push(animation); + } + return animations; +} + +const createScopedWaapiAnimate = (scope) => { + function scopedAnimate(elementOrSelector, keyframes, options) { + return new motionDom.GroupAnimationWithThen(animateElements(elementOrSelector, keyframes, options, scope)); + } + return scopedAnimate; +}; +const animateMini = /*@__PURE__*/ createScopedWaapiAnimate(); + +function canUseNativeTimeline(target) { + if (typeof window === "undefined") + return false; + return target ? motionDom.supportsViewTimeline() : motionDom.supportsScrollTimeline(); +} + +/** + * A time in milliseconds, beyond which we consider the scroll velocity to be 0. + */ +const maxElapsed = 50; +const createAxisInfo = () => ({ + current: 0, + offset: [], + progress: 0, + scrollLength: 0, + targetOffset: 0, + targetLength: 0, + containerLength: 0, + velocity: 0, +}); +const createScrollInfo = () => ({ + time: 0, + x: createAxisInfo(), + y: createAxisInfo(), +}); +const keys = { + x: { + length: "Width", + position: "Left", + }, + y: { + length: "Height", + position: "Top", + }, +}; +function updateAxisInfo(element, axisName, info, time) { + const axis = info[axisName]; + const { length, position } = keys[axisName]; + const prev = axis.current; + const prevTime = info.time; + axis.current = Math.abs(element[`scroll${position}`]); + axis.scrollLength = element[`scroll${length}`] - element[`client${length}`]; + axis.offset.length = 0; + axis.offset[0] = 0; + axis.offset[1] = axis.scrollLength; + axis.progress = motionUtils.progress(0, axis.scrollLength, axis.current); + const elapsed = time - prevTime; + axis.velocity = + elapsed > maxElapsed + ? 0 + : motionUtils.velocityPerSecond(axis.current - prev, elapsed); +} +function updateScrollInfo(element, info, time) { + updateAxisInfo(element, "x", info, time); + updateAxisInfo(element, "y", info, time); + info.time = time; +} + +function calcInset(element, container) { + const inset = { x: 0, y: 0 }; + let current = element; + while (current && current !== container) { + if (motionDom.isHTMLElement(current)) { + inset.x += current.offsetLeft; + inset.y += current.offsetTop; + current = current.offsetParent; + } + else if (current.tagName === "svg") { + /** + * This isn't an ideal approach to measuring the offset of tags. + * It would be preferable, given they behave like HTMLElements in most ways + * to use offsetLeft/Top. But these don't exist on . Likewise we + * can't use .getBBox() like most SVG elements as these provide the offset + * relative to the SVG itself, which for is usually 0x0. + */ + const svgBoundingBox = current.getBoundingClientRect(); + current = current.parentElement; + const parentBoundingBox = current.getBoundingClientRect(); + inset.x += svgBoundingBox.left - parentBoundingBox.left; + inset.y += svgBoundingBox.top - parentBoundingBox.top; + } + else if (current instanceof SVGGraphicsElement) { + const { x, y } = current.getBBox(); + inset.x += x; + inset.y += y; + let svg = null; + let parent = current.parentNode; + while (!svg) { + if (parent.tagName === "svg") { + svg = parent; + } + parent = current.parentNode; + } + current = svg; + } + else { + break; + } + } + return inset; +} + +const namedEdges = { + start: 0, + center: 0.5, + end: 1, +}; +function resolveEdge(edge, length, inset = 0) { + let delta = 0; + /** + * If we have this edge defined as a preset, replace the definition + * with the numerical value. + */ + if (edge in namedEdges) { + edge = namedEdges[edge]; + } + /** + * Handle unit values + */ + if (typeof edge === "string") { + const asNumber = parseFloat(edge); + if (edge.endsWith("px")) { + delta = asNumber; + } + else if (edge.endsWith("%")) { + edge = asNumber / 100; + } + else if (edge.endsWith("vw")) { + delta = (asNumber / 100) * document.documentElement.clientWidth; + } + else if (edge.endsWith("vh")) { + delta = (asNumber / 100) * document.documentElement.clientHeight; + } + else { + edge = asNumber; + } + } + /** + * If the edge is defined as a number, handle as a progress value. + */ + if (typeof edge === "number") { + delta = length * edge; + } + return inset + delta; +} + +const defaultOffset = [0, 0]; +function resolveOffset(offset, containerLength, targetLength, targetInset) { + let offsetDefinition = Array.isArray(offset) ? offset : defaultOffset; + let targetPoint = 0; + let containerPoint = 0; + if (typeof offset === "number") { + /** + * If we're provided offset: [0, 0.5, 1] then each number x should become + * [x, x], so we default to the behaviour of mapping 0 => 0 of both target + * and container etc. + */ + offsetDefinition = [offset, offset]; + } + else if (typeof offset === "string") { + offset = offset.trim(); + if (offset.includes(" ")) { + offsetDefinition = offset.split(" "); + } + else { + /** + * If we're provided a definition like "100px" then we want to apply + * that only to the top of the target point, leaving the container at 0. + * Whereas a named offset like "end" should be applied to both. + */ + offsetDefinition = [offset, namedEdges[offset] ? offset : `0`]; + } + } + targetPoint = resolveEdge(offsetDefinition[0], targetLength, targetInset); + containerPoint = resolveEdge(offsetDefinition[1], containerLength); + return targetPoint - containerPoint; +} + +const ScrollOffset = { + Enter: [ + [0, 1], + [1, 1], + ], + Exit: [ + [0, 0], + [1, 0], + ], + Any: [ + [1, 0], + [0, 1], + ], + All: [ + [0, 0], + [1, 1], + ], +}; + +const point = { x: 0, y: 0 }; +function getTargetSize(target) { + return "getBBox" in target && target.tagName !== "svg" + ? target.getBBox() + : { width: target.clientWidth, height: target.clientHeight }; +} +function resolveOffsets(container, info, options) { + const { offset: offsetDefinition = ScrollOffset.All } = options; + const { target = container, axis = "y" } = options; + const lengthLabel = axis === "y" ? "height" : "width"; + const inset = target !== container ? calcInset(target, container) : point; + /** + * Measure the target and container. If they're the same thing then we + * use the container's scrollWidth/Height as the target, from there + * all other calculations can remain the same. + */ + const targetSize = target === container + ? { width: container.scrollWidth, height: container.scrollHeight } + : getTargetSize(target); + const containerSize = { + width: container.clientWidth, + height: container.clientHeight, + }; + /** + * Reset the length of the resolved offset array rather than creating a new one. + * TODO: More reusable data structures for targetSize/containerSize would also be good. + */ + info[axis].offset.length = 0; + /** + * Populate the offset array by resolving the user's offset definition into + * a list of pixel scroll offets. + */ + let hasChanged = !info[axis].interpolate; + const numOffsets = offsetDefinition.length; + for (let i = 0; i < numOffsets; i++) { + const offset = resolveOffset(offsetDefinition[i], containerSize[lengthLabel], targetSize[lengthLabel], inset[axis]); + if (!hasChanged && offset !== info[axis].interpolatorOffsets[i]) { + hasChanged = true; + } + info[axis].offset[i] = offset; + } + /** + * If the pixel scroll offsets have changed, create a new interpolator function + * to map scroll value into a progress. + */ + if (hasChanged) { + info[axis].interpolate = motionDom.interpolate(info[axis].offset, motionDom.defaultOffset(offsetDefinition), { clamp: false }); + info[axis].interpolatorOffsets = [...info[axis].offset]; + } + info[axis].progress = motionUtils.clamp(0, 1, info[axis].interpolate(info[axis].current)); +} + +function measure(container, target = container, info) { + /** + * Find inset of target within scrollable container + */ + info.x.targetOffset = 0; + info.y.targetOffset = 0; + if (target !== container) { + let node = target; + while (node && node !== container) { + info.x.targetOffset += node.offsetLeft; + info.y.targetOffset += node.offsetTop; + node = node.offsetParent; + } + } + info.x.targetLength = + target === container ? target.scrollWidth : target.clientWidth; + info.y.targetLength = + target === container ? target.scrollHeight : target.clientHeight; + info.x.containerLength = container.clientWidth; + info.y.containerLength = container.clientHeight; + /** + * In development mode ensure scroll containers aren't position: static as this makes + * it difficult to measure their relative positions. The document scrolling element + * is exempt: offsetParent measurements naturally resolve relative to the document. + */ + if (process.env.NODE_ENV !== "production") { + if (container && + target && + target !== container && + container !== document.documentElement && + container !== document.scrollingElement && + container !== document.body) { + motionUtils.warnOnce(getComputedStyle(container).position !== "static", "Please ensure that the container has a non-static position, like 'relative', 'fixed', or 'absolute' to ensure scroll offset is calculated correctly."); + } + } +} +function createOnScrollHandler(element, onScroll, info, options = {}) { + return { + measure: (time) => { + measure(element, options.target, info); + updateScrollInfo(element, info, time); + if (options.offset || options.target) { + resolveOffsets(element, info, options); + } + }, + notify: () => onScroll(info), + }; +} + +const scrollListeners = new WeakMap(); +const resizeListeners = new WeakMap(); +const onScrollHandlers = new WeakMap(); +const scrollSize = new WeakMap(); +const dimensionCheckProcesses = new WeakMap(); +const getEventTarget = (element) => element === document.scrollingElement ? window : element; +function scrollInfo(onScroll, { container = document.scrollingElement, trackContentSize = false, ...options } = {}) { + if (!container) + return motionUtils.noop; + let containerHandlers = onScrollHandlers.get(container); + /** + * Get the onScroll handlers for this container. + * If one isn't found, create a new one. + */ + if (!containerHandlers) { + containerHandlers = new Set(); + onScrollHandlers.set(container, containerHandlers); + } + /** + * Create a new onScroll handler for the provided callback. + */ + const info = createScrollInfo(); + const containerHandler = createOnScrollHandler(container, onScroll, info, options); + containerHandlers.add(containerHandler); + /** + * Check if there's a scroll event listener for this container. + * If not, create one. + */ + if (!scrollListeners.has(container)) { + const measureAll = () => { + for (const handler of containerHandlers) { + handler.measure(motionDom.frameData.timestamp); + } + motionDom.frame.preUpdate(notifyAll); + }; + const notifyAll = () => { + for (const handler of containerHandlers) { + handler.notify(); + } + }; + const listener = () => motionDom.frame.read(measureAll); + scrollListeners.set(container, listener); + const target = getEventTarget(container); + window.addEventListener("resize", listener); + if (container !== document.documentElement) { + resizeListeners.set(container, motionDom.resize(container, listener)); + } + target.addEventListener("scroll", listener); + listener(); + } + /** + * Enable content size tracking if requested and not already enabled. + */ + if (trackContentSize && !dimensionCheckProcesses.has(container)) { + const listener = scrollListeners.get(container); + // Store initial scroll dimensions (object is reused to avoid allocation) + const size = { + width: container.scrollWidth, + height: container.scrollHeight, + }; + scrollSize.set(container, size); + // Add frame-based scroll dimension checking to detect content changes + const checkScrollDimensions = () => { + const newWidth = container.scrollWidth; + const newHeight = container.scrollHeight; + if (size.width !== newWidth || size.height !== newHeight) { + listener(); + size.width = newWidth; + size.height = newHeight; + } + }; + // Schedule with keepAlive=true to run every frame + const dimensionCheckProcess = motionDom.frame.read(checkScrollDimensions, true); + dimensionCheckProcesses.set(container, dimensionCheckProcess); + } + const listener = scrollListeners.get(container); + motionDom.frame.read(listener, false, true); + return () => { + motionDom.cancelFrame(listener); + /** + * Check if we even have any handlers for this container. + */ + const currentHandlers = onScrollHandlers.get(container); + if (!currentHandlers) + return; + currentHandlers.delete(containerHandler); + if (currentHandlers.size) + return; + /** + * If no more handlers, remove the scroll listener too. + */ + const scrollListener = scrollListeners.get(container); + scrollListeners.delete(container); + if (scrollListener) { + getEventTarget(container).removeEventListener("scroll", scrollListener); + resizeListeners.get(container)?.(); + window.removeEventListener("resize", scrollListener); + } + // Clean up scroll dimension checking + const dimensionCheckProcess = dimensionCheckProcesses.get(container); + if (dimensionCheckProcess) { + motionDom.cancelFrame(dimensionCheckProcess); + dimensionCheckProcesses.delete(container); + } + scrollSize.delete(container); + }; +} + +/** + * Maps from ProgressIntersection pairs used by Motion's preset offsets to + * ViewTimeline named ranges. Returns undefined for unrecognised patterns, + * which signals the caller to fall back to JS-based scroll tracking. + */ +const presets = [ + [ScrollOffset.Enter, "entry"], + [ScrollOffset.Exit, "exit"], + [ScrollOffset.Any, "cover"], + [ScrollOffset.All, "contain"], +]; +const stringToProgress = { + start: 0, + end: 1, +}; +function parseStringOffset(s) { + const parts = s.trim().split(/\s+/); + if (parts.length !== 2) + return undefined; + const a = stringToProgress[parts[0]]; + const b = stringToProgress[parts[1]]; + if (a === undefined || b === undefined) + return undefined; + return [a, b]; +} +function normaliseOffset(offset) { + if (offset.length !== 2) + return undefined; + const result = []; + for (const item of offset) { + if (Array.isArray(item)) { + result.push(item); + } + else if (typeof item === "string") { + const parsed = parseStringOffset(item); + if (!parsed) + return undefined; + result.push(parsed); + } + else { + return undefined; + } + } + return result; +} +function matchesPreset(offset, preset) { + const normalised = normaliseOffset(offset); + if (!normalised) + return false; + for (let i = 0; i < 2; i++) { + const o = normalised[i]; + const p = preset[i]; + if (o[0] !== p[0] || o[1] !== p[1]) + return false; + } + return true; +} +function offsetToViewTimelineRange(offset) { + if (!offset) { + return { rangeStart: "contain 0%", rangeEnd: "contain 100%" }; + } + for (const [preset, name] of presets) { + if (matchesPreset(offset, preset)) { + return { rangeStart: `${name} 0%`, rangeEnd: `${name} 100%` }; + } + } + return undefined; +} + +const timelineCache = new Map(); +function scrollTimelineFallback(options) { + const currentTime = { value: 0 }; + const cancel = scrollInfo((info) => { + currentTime.value = info[options.axis].progress * 100; + }, options); + return { currentTime, cancel }; +} +function getTimeline({ source, container, ...options }) { + const { axis } = options; + if (source) + container = source; + let containerCache = timelineCache.get(container); + if (!containerCache) { + containerCache = new Map(); + timelineCache.set(container, containerCache); + } + const targetKey = options.target ?? "self"; + let targetCache = containerCache.get(targetKey); + if (!targetCache) { + targetCache = {}; + containerCache.set(targetKey, targetCache); + } + const axisKey = axis + (options.offset ?? []).join(","); + if (!targetCache[axisKey]) { + if (options.target && canUseNativeTimeline(options.target)) { + const range = offsetToViewTimelineRange(options.offset); + if (range) { + targetCache[axisKey] = new ViewTimeline({ + subject: options.target, + axis, + }); + } + else { + targetCache[axisKey] = scrollTimelineFallback({ + container, + ...options, + }); + } + } + else if (canUseNativeTimeline()) { + targetCache[axisKey] = new ScrollTimeline({ + source: container, + axis, + }); + } + else { + targetCache[axisKey] = scrollTimelineFallback({ + container, + ...options, + }); + } + } + return targetCache[axisKey]; +} + +function attachToAnimation(animation, options) { + const timeline = getTimeline(options); + const range = options.target + ? offsetToViewTimelineRange(options.offset) + : undefined; + /** + * Use native timeline when: + * - No target: ScrollTimeline (existing behaviour) + * - Target with mappable offset: ViewTimeline with named range + * - Target with unmappable offset: fall back to JS observe + */ + const useNative = options.target + ? canUseNativeTimeline(options.target) && !!range + : canUseNativeTimeline(); + return animation.attachTimeline({ + timeline: useNative ? timeline : undefined, + ...(range && + useNative && { + rangeStart: range.rangeStart, + rangeEnd: range.rangeEnd, + }), + observe: (valueAnimation) => { + valueAnimation.pause(); + return motionDom.observeTimeline((progress) => { + valueAnimation.time = + valueAnimation.iterationDuration * progress; + }, timeline); + }, + }); +} + +/** + * Currently, we only support element tracking with `scrollInfo`, though in + * the future we can also offer ViewTimeline support. + */ +function isElementTracking(options) { + return options && (options.target || options.offset); +} + +/** + * If the onScroll function has two arguments, it's expecting + * more specific information about the scroll from scrollInfo. + */ +function isOnScrollWithInfo(onScroll) { + return onScroll.length === 2; +} +function attachToFunction(onScroll, options) { + if (isOnScrollWithInfo(onScroll) || isElementTracking(options)) { + return scrollInfo((info) => { + onScroll(info[options.axis].progress, info); + }, options); + } + else { + return motionDom.observeTimeline(onScroll, getTimeline(options)); + } +} + +function scroll(onScroll, { axis = "y", container = document.scrollingElement, ...options } = {}) { + if (!container) + return motionUtils.noop; + const optionsWithDefaults = { axis, container, ...options }; + return typeof onScroll === "function" + ? attachToFunction(onScroll, optionsWithDefaults) + : attachToAnimation(onScroll, optionsWithDefaults); +} + +const thresholds = { + some: 0, + all: 1, +}; +function inView(elementOrSelector, onStart, { root, margin: rootMargin, amount = "some" } = {}) { + const elements = motionDom.resolveElements(elementOrSelector); + const activeIntersections = new WeakMap(); + const onIntersectionChange = (entries) => { + entries.forEach((entry) => { + const onEnd = activeIntersections.get(entry.target); + /** + * If there's no change to the intersection, we don't need to + * do anything here. + */ + if (entry.isIntersecting === Boolean(onEnd)) + return; + if (entry.isIntersecting) { + const newOnEnd = onStart(entry.target, entry); + if (typeof newOnEnd === "function") { + activeIntersections.set(entry.target, newOnEnd); + } + else { + observer.unobserve(entry.target); + } + } + else if (typeof onEnd === "function") { + onEnd(entry); + activeIntersections.delete(entry.target); + } + }); + }; + const observer = new IntersectionObserver(onIntersectionChange, { + root, + rootMargin, + threshold: typeof amount === "number" ? amount : thresholds[amount], + }); + elements.forEach((element) => observer.observe(element)); + return () => observer.disconnect(); +} + +const m = /*@__PURE__*/ createMotionProxy(); + +function useUnmountEffect(callback) { + return React.useEffect(() => () => callback(), []); +} + +/** + * @public + */ +const domAnimation = { + renderer: featureBundle.createDomVisualElement, + ...featureBundle.animations, + ...featureBundle.gestureAnimations, +}; + +/** + * @public + */ +const domMax = { + ...domAnimation, + ...featureBundle.drag, + ...featureBundle.layout, +}; + +/** + * @public + */ +const domMin = { + renderer: featureBundle.createDomVisualElement, + ...featureBundle.animations, +}; + +function useMotionValueEvent(value, event, callback) { + /** + * useInsertionEffect will create subscriptions before any other + * effects will run. Effects run upwards through the tree so it + * can be that binding a useLayoutEffect higher up the tree can + * miss changes from lower down the tree. + */ + React.useInsertionEffect(() => value.on(event, callback), [value, event, callback]); +} + +const createScrollMotionValues = () => ({ + scrollX: motionDom.motionValue(0), + scrollY: motionDom.motionValue(0), + scrollXProgress: motionDom.motionValue(0), + scrollYProgress: motionDom.motionValue(0), +}); +const isRefPending = (ref) => { + if (!ref) + return false; + return !ref.current; +}; +function makeAccelerateConfig(axis, options, container, target) { + return { + // Refs attach child-first; defer so target.current is populated + // before scroll() reads it. + factory: (animation) => { + let cleanup; + const start = () => { + // A provided ref may be hydrated by an effect declared after + // useScroll (or in a parent). Don't attach to the window + // scroll in the meantime — that result gets cached and would + // permanently mistrack. Wait until the ref resolves. + if (isRefPending(container) || isRefPending(target)) { + motionDom.microtask.read(start); + return; + } + cleanup = scroll(animation, { + ...options, + axis, + container: container?.current || undefined, + target: target?.current || undefined, + }); + }; + motionDom.microtask.read(start); + return () => { + motionDom.cancelMicrotask(start); + cleanup?.(); + }; + }, + times: [0, 1], + keyframes: [0, 1], + ease: (v) => v, + duration: 1, + }; +} +function canAccelerateScroll(target, offset) { + if (typeof window === "undefined") + return false; + return target + ? motionDom.supportsViewTimeline() && !!offsetToViewTimelineRange(offset) + : motionDom.supportsScrollTimeline(); +} +function useScroll({ container, target, ...options } = {}) { + const values = index.useConstant(createScrollMotionValues); + if (canAccelerateScroll(target, options.offset)) { + values.scrollXProgress.accelerate = makeAccelerateConfig("x", options, container, target); + values.scrollYProgress.accelerate = makeAccelerateConfig("y", options, container, target); + } + const scrollAnimation = React.useRef(null); + const needsStart = React.useRef(false); + const start = React.useCallback(() => { + scrollAnimation.current = scroll((_progress, { x, y, }) => { + values.scrollX.set(x.current); + values.scrollXProgress.set(x.progress); + values.scrollY.set(y.current); + values.scrollYProgress.set(y.progress); + }, { + ...options, + container: container?.current || undefined, + target: target?.current || undefined, + }); + return () => { + scrollAnimation.current?.(); + }; + }, [container, target, JSON.stringify(options.offset)]); + index.useIsomorphicLayoutEffect(() => { + needsStart.current = false; + if (isRefPending(container) || isRefPending(target)) { + needsStart.current = true; + return; + } + else { + return start(); + } + }, [start]); + React.useEffect(() => { + if (!needsStart.current) + return; + // Defer to a microtask so any sibling/parent effect that hydrates the + // ref has a chance to run first. + let cleanup; + const tryStart = () => { + const containerPending = isRefPending(container); + const targetPending = isRefPending(target); + motionUtils.invariant(!containerPending, "Container ref is defined but not hydrated", "use-scroll-ref"); + motionUtils.invariant(!targetPending, "Target ref is defined but not hydrated", "use-scroll-ref"); + if (!containerPending && !targetPending) + cleanup = start(); + }; + motionDom.microtask.read(tryStart); + return () => { + motionDom.cancelMicrotask(tryStart); + cleanup?.(); + }; + }, [start]); + return values; +} + +/** + * @deprecated useElementScroll is deprecated. Convert to useScroll({ container: ref }) + */ +function useElementScroll(ref) { + if (process.env.NODE_ENV === "development") { + motionUtils.warnOnce(false, "useElementScroll is deprecated. Convert to useScroll({ container: ref })."); + } + return useScroll({ container: ref }); +} + +/** + * @deprecated useViewportScroll is deprecated. Convert to useScroll() + */ +function useViewportScroll() { + if (process.env.NODE_ENV !== "production") { + motionUtils.warnOnce(false, "useViewportScroll is deprecated. Convert to useScroll()."); + } + return useScroll(); +} + +/** + * Combine multiple motion values into a new one using a string template literal. + * + * ```jsx + * import { + * motion, + * useSpring, + * useMotionValue, + * useMotionTemplate + * } from "framer-motion" + * + * function Component() { + * const shadowX = useSpring(0) + * const shadowY = useMotionValue(0) + * const shadow = useMotionTemplate`drop-shadow(${shadowX}px ${shadowY}px 20px rgba(0,0,0,0.3))` + * + * return + * } + * ``` + * + * @public + */ +function useMotionTemplate(fragments, ...values) { + /** + * Create a function that will build a string from the latest motion values. + */ + const numFragments = fragments.length; + function buildValue() { + let output = ``; + for (let i = 0; i < numFragments; i++) { + output += fragments[i]; + const value = values[i]; + if (value) { + output += motionDom.isMotionValue(value) ? value.get() : value; + } + } + return output; + } + return useCombineMotionValues(values.filter(motionDom.isMotionValue), buildValue); +} + +function useFollowValue(source, options = {}) { + const { isStatic } = React.useContext(index.MotionConfigContext); + const getFromSource = () => (motionDom.isMotionValue(source) ? source.get() : source); + // isStatic will never change, allowing early hooks return + if (isStatic) { + return useTransform(getFromSource); + } + const value = useMotionValue(getFromSource()); + React.useInsertionEffect(() => { + return motionDom.attachFollow(value, source, options); + }, [value, JSON.stringify(options)]); + return value; +} + +function useSpring(source, options = {}) { + return useFollowValue(source, { type: "spring", ...options }); +} + +function useAnimationFrame(callback) { + const initialTimestamp = React.useRef(0); + const { isStatic } = React.useContext(index.MotionConfigContext); + React.useEffect(() => { + if (isStatic) + return; + const provideTimeSinceStart = ({ timestamp, delta }) => { + if (!initialTimestamp.current) + initialTimestamp.current = timestamp; + callback(timestamp - initialTimestamp.current, delta); + }; + motionDom.frame.update(provideTimeSinceStart, true); + return () => motionDom.cancelFrame(provideTimeSinceStart); + }, [callback]); +} + +function useTime() { + const time = useMotionValue(0); + useAnimationFrame((t) => time.set(t)); + return time; +} + +/** + * Creates a `MotionValue` that updates when the velocity of the provided `MotionValue` changes. + * + * ```javascript + * const x = useMotionValue(0) + * const xVelocity = useVelocity(x) + * const xAcceleration = useVelocity(xVelocity) + * ``` + * + * @public + */ +function useVelocity(value) { + const velocity = useMotionValue(value.getVelocity()); + const updateVelocity = () => { + const latest = value.getVelocity(); + velocity.set(latest); + /** + * If we still have velocity, schedule an update for the next frame + * to keep checking until it is zero. + */ + if (latest) + motionDom.frame.update(updateVelocity); + }; + useMotionValueEvent(value, "change", () => { + // Schedule an update to this value at the end of the current frame. + motionDom.frame.update(updateVelocity, false, true); + }); + return velocity; +} + +class WillChangeMotionValue extends motionDom.MotionValue { + constructor() { + super(...arguments); + this.isEnabled = false; + } + add(name) { + if (motionDom.transformProps.has(name) || motionDom.acceleratedValues.has(name)) { + this.isEnabled = true; + this.update(); + } + } + update() { + this.set(this.isEnabled ? "transform" : "auto"); + } +} + +function useWillChange() { + return index.useConstant(() => new WillChangeMotionValue("auto")); +} + +/** + * A hook that returns `true` if we should be using reduced motion based on the current device's Reduced Motion setting. + * + * This can be used to implement changes to your UI based on Reduced Motion. For instance, replacing motion-sickness inducing + * `x`/`y` animations with `opacity`, disabling the autoplay of background videos, or turning off parallax motion. + * + * It will actively respond to changes and re-render your components with the latest setting. + * + * ```jsx + * export function Sidebar({ isOpen }) { + * const shouldReduceMotion = useReducedMotion() + * const closedX = shouldReduceMotion ? 0 : "-100%" + * + * return ( + * + * ) + * } + * ``` + * + * @return boolean + * + * @public + */ +function useReducedMotion() { + /** + * Lazy initialisation of prefersReducedMotion + */ + !motionDom.hasReducedMotionListener.current && motionDom.initPrefersReducedMotion(); + const [shouldReduceMotion] = React.useState(motionDom.prefersReducedMotion.current); + if (process.env.NODE_ENV !== "production") { + motionUtils.warnOnce(shouldReduceMotion !== true, "You have Reduced Motion enabled on your device. Animations may not appear as expected.", "reduced-motion-disabled"); + } + /** + * TODO See if people miss automatically updating shouldReduceMotion setting + */ + return shouldReduceMotion; +} + +function useReducedMotionConfig() { + const reducedMotionPreference = useReducedMotion(); + const { reducedMotion } = React.useContext(index.MotionConfigContext); + if (reducedMotion === "never") { + return false; + } + else if (reducedMotion === "always") { + return true; + } + else { + return reducedMotionPreference; + } +} + +function stopAnimation(visualElement) { + visualElement.values.forEach((value) => value.stop()); +} +function setVariants(visualElement, variantLabels) { + const reversedLabels = [...variantLabels].reverse(); + reversedLabels.forEach((key) => { + const variant = visualElement.getVariant(key); + variant && motionDom.setTarget(visualElement, variant); + if (visualElement.variantChildren) { + visualElement.variantChildren.forEach((child) => { + setVariants(child, variantLabels); + }); + } + }); +} +function setValues(visualElement, definition) { + if (Array.isArray(definition)) { + return setVariants(visualElement, definition); + } + else if (typeof definition === "string") { + return setVariants(visualElement, [definition]); + } + else { + motionDom.setTarget(visualElement, definition); + } +} +/** + * @public + */ +function animationControls() { + /** + * Track whether the host component has mounted. + */ + let hasMounted = false; + /** + * A collection of linked component animation controls. + */ + const subscribers = new Set(); + const controls = { + subscribe(visualElement) { + subscribers.add(visualElement); + return () => void subscribers.delete(visualElement); + }, + start(definition, transitionOverride) { + motionUtils.invariant(hasMounted, "controls.start() should only be called after a component has mounted. Consider calling within a useEffect hook."); + const animations = []; + subscribers.forEach((visualElement) => { + animations.push(motionDom.animateVisualElement(visualElement, definition, { + transitionOverride, + })); + }); + return Promise.all(animations); + }, + set(definition) { + motionUtils.invariant(hasMounted, "controls.set() should only be called after a component has mounted. Consider calling within a useEffect hook."); + return subscribers.forEach((visualElement) => { + setValues(visualElement, definition); + }); + }, + stop() { + subscribers.forEach((visualElement) => { + stopAnimation(visualElement); + }); + }, + mount() { + hasMounted = true; + return () => { + hasMounted = false; + controls.stop(); + }; + }, + }; + return controls; +} + +function useAnimate() { + const scope = index.useConstant(() => ({ + current: null, // Will be hydrated by React + animations: [], + })); + const reduceMotion = useReducedMotionConfig() ?? undefined; + const { skipAnimations } = React.useContext(index.MotionConfigContext); + const animate = React.useMemo(() => createScopedAnimate({ scope, reduceMotion, skipAnimations }), [scope, reduceMotion, skipAnimations]); + useUnmountEffect(() => { + scope.animations.forEach((animation) => animation.stop()); + scope.animations.length = 0; + }); + return [scope, animate]; +} + +function useAnimateMini() { + const scope = index.useConstant(() => ({ + current: null, // Will be hydrated by React + animations: [], + })); + const animate = index.useConstant(() => createScopedWaapiAnimate(scope)); + useUnmountEffect(() => { + scope.animations.forEach((animation) => animation.stop()); + }); + return [scope, animate]; +} + +/** + * Creates `LegacyAnimationControls`, which can be used to manually start, stop + * and sequence animations on one or more components. + * + * The returned `LegacyAnimationControls` should be passed to the `animate` property + * of the components you want to animate. + * + * These components can then be animated with the `start` method. + * + * ```jsx + * import * as React from 'react' + * import { motion, useAnimation } from 'framer-motion' + * + * export function MyComponent(props) { + * const controls = useAnimation() + * + * controls.start({ + * x: 100, + * transition: { duration: 0.5 }, + * }) + * + * return + * } + * ``` + * + * @returns Animation controller with `start` and `stop` methods + * + * @public + */ +function useAnimationControls() { + const controls = index.useConstant(animationControls); + index.useIsomorphicLayoutEffect(controls.mount, []); + return controls; +} +const useAnimation = useAnimationControls; + +function usePresenceData() { + const context = React.useContext(index.PresenceContext); + return context ? context.custom : undefined; +} + +/** + * Attaches an event listener directly to the provided DOM element. + * + * Bypassing React's event system can be desirable, for instance when attaching non-passive + * event handlers. + * + * ```jsx + * const ref = useRef(null) + * + * useDomEvent(ref, 'wheel', onWheel, { passive: false }) + * + * return

+ * ``` + * + * @param ref - React.RefObject that's been provided to the element you want to bind the listener to. + * @param eventName - Name of the event you want listen for. + * @param handler - Function to fire when receiving the event. + * @param options - Options to pass to `Event.addEventListener`. + * + * @public + */ +function useDomEvent(ref, eventName, handler, options) { + React.useEffect(() => { + const element = ref.current; + if (handler && element) { + return motionDom.addDomEvent(element, eventName, handler, options); + } + }, [ref, eventName, handler, options]); +} + +/** + * Can manually trigger a drag gesture on one or more `drag`-enabled `motion` components. + * + * ```jsx + * const dragControls = useDragControls() + * + * function startDrag(event) { + * dragControls.start(event, { snapToCursor: true }) + * } + * + * return ( + * <> + *
+ * + * + * ) + * ``` + * + * @public + */ +class DragControls { + constructor() { + this.componentControls = new Set(); + } + /** + * Subscribe a component's internal `VisualElementDragControls` to the user-facing API. + * + * @internal + */ + subscribe(controls) { + this.componentControls.add(controls); + return () => this.componentControls.delete(controls); + } + /** + * Start a drag gesture on every `motion` component that has this set of drag controls + * passed into it via the `dragControls` prop. + * + * ```jsx + * dragControls.start(e, { + * snapToCursor: true + * }) + * ``` + * + * @param event - PointerEvent + * @param options - Options + * + * @public + */ + start(event, options) { + this.componentControls.forEach((controls) => { + controls.start(event.nativeEvent || event, options); + }); + } + /** + * Cancels a drag gesture. + * + * ```jsx + * dragControls.cancel() + * ``` + * + * @public + */ + cancel() { + this.componentControls.forEach((controls) => { + controls.cancel(); + }); + } + /** + * Stops a drag gesture. + * + * ```jsx + * dragControls.stop() + * ``` + * + * @public + */ + stop() { + this.componentControls.forEach((controls) => { + controls.stop(); + }); + } +} +const createDragControls = () => new DragControls(); +/** + * Usually, dragging is initiated by pressing down on a `motion` component with a `drag` prop + * and moving it. For some use-cases, for instance clicking at an arbitrary point on a video scrubber, we + * might want to initiate that dragging from a different component than the draggable one. + * + * By creating a `dragControls` using the `useDragControls` hook, we can pass this into + * the draggable component's `dragControls` prop. It exposes a `start` method + * that can start dragging from pointer events on other components. + * + * ```jsx + * const dragControls = useDragControls() + * + * function startDrag(event) { + * dragControls.start(event, { snapToCursor: true }) + * } + * + * return ( + * <> + *
+ * + * + * ) + * ``` + * + * @public + */ +function useDragControls() { + return index.useConstant(createDragControls); +} + +/** + * Checks if a component is a `motion` component. + */ +function isMotionComponent(component) { + return (component !== null && + typeof component === "object" && + index.motionComponentSymbol in component); +} + +/** + * Unwraps a `motion` component and returns either a string for `motion.div` or + * the React component for `motion(Component)`. + * + * If the component is not a `motion` component it returns undefined. + */ +function unwrapMotionComponent(component) { + if (isMotionComponent(component)) { + return component[index.motionComponentSymbol]; + } + return undefined; +} + +function useInstantLayoutTransition() { + return startTransition; +} +function startTransition(callback) { + if (!motionDom.rootProjectionNode.current) + return; + motionDom.rootProjectionNode.current.isUpdating = false; + motionDom.rootProjectionNode.current.blockUpdate(); + callback && callback(); +} + +function useResetProjection() { + const reset = React.useCallback(() => { + const root = motionDom.rootProjectionNode.current; + if (!root) + return; + root.resetTree(); + }, []); + return reset; +} + +/** + * Cycles through a series of visual properties. Can be used to toggle between or cycle through animations. It works similar to `useState` in React. It is provided an initial array of possible states, and returns an array of two arguments. + * + * An index value can be passed to the returned `cycle` function to cycle to a specific index. + * + * ```jsx + * import * as React from "react" + * import { motion, useCycle } from "framer-motion" + * + * export const MyComponent = () => { + * const [x, cycleX] = useCycle(0, 50, 100) + * + * return ( + * cycleX()} + * /> + * ) + * } + * ``` + * + * @param items - items to cycle through + * @returns [currentState, cycleState] + * + * @public + */ +function useCycle(...items) { + const index = React.useRef(0); + const [item, setItem] = React.useState(items[index.current]); + const runCycle = React.useCallback((next) => { + index.current = + typeof next !== "number" + ? motionUtils.wrap(0, items.length, index.current + 1) + : next; + setItem(items[index.current]); + }, + // The array will change on each call, but by putting items.length at + // the front of this array, we guarantee the dependency comparison will match up + // eslint-disable-next-line react-hooks/exhaustive-deps + [items.length, ...items]); + return [item, runCycle]; +} + +function useInView(ref, { root, margin, amount, once = false, initial = false, } = {}) { + const [isInView, setInView] = React.useState(initial); + React.useEffect(() => { + if (!ref.current || (once && isInView)) + return; + const onEnter = () => { + setInView(true); + return once ? undefined : () => setInView(false); + }; + const options = { + root: (root && root.current) || undefined, + margin, + amount, + }; + return inView(ref.current, onEnter, options); + }, [root, ref, margin, once, amount]); + return isInView; +} + +function useInstantTransition() { + const [forceUpdate, forcedRenderCount] = useForceUpdate(); + const startInstantLayoutTransition = useInstantLayoutTransition(); + const unlockOnFrameRef = React.useRef(-1); + React.useEffect(() => { + /** + * Unblock after two animation frames, otherwise this will unblock too soon. + */ + motionDom.frame.postRender(() => motionDom.frame.postRender(() => { + /** + * If the callback has been called again after the effect + * triggered this 2 frame delay, don't unblock animations. This + * prevents the previous effect from unblocking the current + * instant transition too soon. This becomes more likely when + * used in conjunction with React.startTransition(). + */ + if (forcedRenderCount !== unlockOnFrameRef.current) + return; + motionUtils.MotionGlobalConfig.instantAnimations = false; + })); + }, [forcedRenderCount]); + return (callback) => { + startInstantLayoutTransition(() => { + motionUtils.MotionGlobalConfig.instantAnimations = true; + forceUpdate(); + callback(); + unlockOnFrameRef.current = forcedRenderCount + 1; + }); + }; +} +function disableInstantTransitions() { + motionUtils.MotionGlobalConfig.instantAnimations = false; +} + +function usePageInView() { + const [isInView, setIsInView] = React.useState(true); + React.useEffect(() => { + const handleVisibilityChange = () => setIsInView(!document.hidden); + if (document.hidden) { + handleVisibilityChange(); + } + document.addEventListener("visibilitychange", handleVisibilityChange); + return () => { + document.removeEventListener("visibilitychange", handleVisibilityChange); + }; + }, []); + return isInView; +} + +/** + * Creates a `transformPagePoint` function that accounts for SVG viewBox scaling. + * + * When dragging SVG elements inside an SVG with a viewBox that differs from + * the rendered dimensions (e.g., `viewBox="0 0 100 100"` but rendered at 500x500 pixels), + * pointer coordinates need to be transformed to match the SVG's coordinate system. + * + * @example + * ```jsx + * function App() { + * const svgRef = useRef(null) + * + * return ( + * + * + * + * + * + * ) + * } + * ``` + * + * @param svgRef - A React ref to the SVG element + * @returns A transformPagePoint function for use with MotionConfig + * + * @public + */ +function transformViewBoxPoint(svgRef) { + return (point) => { + const svg = svgRef.current; + if (!svg) { + return point; + } + // Get the viewBox attribute + const viewBox = svg.viewBox?.baseVal; + if (!viewBox || (viewBox.width === 0 && viewBox.height === 0)) { + // No viewBox or empty viewBox - no transformation needed + return point; + } + // Get the rendered dimensions of the SVG + const bbox = svg.getBoundingClientRect(); + if (bbox.width === 0 || bbox.height === 0) { + return point; + } + // Calculate scale factors + const scaleX = viewBox.width / bbox.width; + const scaleY = viewBox.height / bbox.height; + // Get the SVG's position on the page + const svgX = bbox.left + window.scrollX; + const svgY = bbox.top + window.scrollY; + // Transform the point: + // 1. Calculate position relative to SVG + // 2. Scale by viewBox/viewport ratio + // 3. Add back the SVG position (but in SVG coordinates) + return { + x: (point.x - svgX) * scaleX + svgX, + y: (point.y - svgY) * scaleY + svgY, + }; + }; +} + +/** + * Creates a `transformPagePoint` function that corrects pointer coordinates + * for a parent container with CSS transforms (rotation, scale, skew). + * + * When dragging elements inside a transformed parent, pointer coordinates + * need to be transformed through the inverse of the parent's transform + * so the drag offset is in local space. + * + * Works with both static and continuously animating transforms. + * + * @example + * ```jsx + * function App() { + * const ref = useRef(null) + * + * return ( + * + * + * + * + * + * ) + * } + * ``` + * + * @param parentRef - A React ref to the transformed parent element + * @returns A transformPagePoint function for use with MotionConfig + * + * @public + */ +function correctParentTransform(parentRef) { + return (point) => { + const parent = parentRef.current; + if (!parent) + return point; + const inv = getInverseMatrix(parent); + if (!inv) + return point; + // Get center of rotation in page space + const rect = parent.getBoundingClientRect(); + const cx = rect.left + window.scrollX + rect.width / 2; + const cy = rect.top + window.scrollY + rect.height / 2; + // Transform (point - center) through inverse, then add center back + const dx = point.x - cx; + const dy = point.y - cy; + return { + x: cx + inv.a * dx + inv.c * dy, + y: cy + inv.b * dx + inv.d * dy, + }; + }; +} +function getInverseMatrix(element) { + const { transform } = getComputedStyle(element); + if (!transform || transform === "none") + return null; + const match = transform.match(/^matrix3d\((.*)\)$/u) || + transform.match(/^matrix\((.*)\)$/u); + if (!match) + return null; + const v = match[1].split(",").map(Number); + const is3d = transform.startsWith("matrix3d"); + const a = v[0], b = v[1]; + const c = is3d ? v[4] : v[2]; + const d = is3d ? v[5] : v[3]; + const det = a * d - b * c; + if (Math.abs(det) < 1e-10) + return null; + return { a: d / det, b: -b / det, c: -c / det, d: a / det }; +} + +const appearAnimationStore = new Map(); +const appearComplete = new Map(); + +const appearStoreId = (elementId, valueName) => { + const key = motionDom.transformProps.has(valueName) ? "transform" : valueName; + return `${elementId}: ${key}`; +}; + +function handoffOptimizedAppearAnimation(elementId, valueName, frame) { + const storeId = appearStoreId(elementId, valueName); + const optimisedAnimation = appearAnimationStore.get(storeId); + if (!optimisedAnimation) { + return null; + } + const { animation, startTime } = optimisedAnimation; + function cancelAnimation() { + window.MotionCancelOptimisedAnimation?.(elementId, valueName, frame); + } + /** + * We can cancel the animation once it's finished now that we've synced + * with Motion. + * + * Prefer onfinish over finished as onfinish is backwards compatible with + * older browsers. + */ + animation.onfinish = cancelAnimation; + if (startTime === null || window.MotionHandoffIsComplete?.(elementId)) { + /** + * If the startTime is null, this animation is the Paint Ready detection animation + * and we can cancel it immediately without handoff. + * + * Or if we've already handed off the animation then we're now interrupting it. + * In which case we need to cancel it. + */ + cancelAnimation(); + return null; + } + else { + return startTime; + } +} + +/** + * A single time to use across all animations to manually set startTime + * and ensure they're all in sync. + */ +let startFrameTime; +/** + * A dummy animation to detect when Chrome is ready to start + * painting the page and hold off from triggering the real animation + * until then. We only need one animation to detect paint ready. + * + * https://bugs.chromium.org/p/chromium/issues/detail?id=1406850 + */ +let readyAnimation; +/** + * Keep track of animations that were suspended vs cancelled so we + * can easily resume them when we're done measuring layout. + */ +const suspendedAnimations = new Set(); +function resumeSuspendedAnimations() { + suspendedAnimations.forEach((data) => { + data.animation.play(); + data.animation.startTime = data.startTime; + }); + suspendedAnimations.clear(); +} +function startOptimizedAppearAnimation(element, name, keyframes, options, onReady) { + // Prevent optimised appear animations if Motion has already started animating. + if (window.MotionIsMounted) { + return; + } + const id = element.dataset[motionDom.optimizedAppearDataId]; + if (!id) + return; + window.MotionHandoffAnimation = handoffOptimizedAppearAnimation; + const storeId = appearStoreId(id, name); + if (!readyAnimation) { + readyAnimation = motionDom.startWaapiAnimation(element, name, [keyframes[0], keyframes[0]], + /** + * 10 secs is basically just a super-safe duration to give Chrome + * long enough to get the animation ready. + */ + { duration: 10000, ease: "linear" }); + appearAnimationStore.set(storeId, { + animation: readyAnimation, + startTime: null, + }); + /** + * If there's no readyAnimation then there's been no instantiation + * of handoff animations. + */ + window.MotionHandoffAnimation = handoffOptimizedAppearAnimation; + window.MotionHasOptimisedAnimation = (elementId, valueName) => { + if (!elementId) + return false; + /** + * Keep a map of elementIds that have started animating. We check + * via ID instead of Element because of hydration errors and + * pre-hydration checks. We also actively record IDs as they start + * animating rather than simply checking for data-appear-id as + * this attrbute might be present but not lead to an animation, for + * instance if the element's appear animation is on a different + * breakpoint. + */ + if (!valueName) { + return appearComplete.has(elementId); + } + const animationId = appearStoreId(elementId, valueName); + return Boolean(appearAnimationStore.get(animationId)); + }; + window.MotionHandoffMarkAsComplete = (elementId) => { + if (appearComplete.has(elementId)) { + appearComplete.set(elementId, true); + } + }; + window.MotionHandoffIsComplete = (elementId) => { + return appearComplete.get(elementId) === true; + }; + /** + * We only need to cancel transform animations as + * they're the ones that will interfere with the + * layout animation measurements. + */ + window.MotionCancelOptimisedAnimation = (elementId, valueName, frame, canResume) => { + const animationId = appearStoreId(elementId, valueName); + const data = appearAnimationStore.get(animationId); + if (!data) + return; + if (frame && canResume === undefined) { + /** + * Wait until the end of the subsequent frame to cancel the animation + * to ensure we don't remove the animation before the main thread has + * had a chance to resolve keyframes and render. + */ + frame.postRender(() => { + frame.postRender(() => { + data.animation.cancel(); + }); + }); + } + else { + data.animation.cancel(); + } + if (frame && canResume) { + suspendedAnimations.add(data); + frame.render(resumeSuspendedAnimations); + } + else { + appearAnimationStore.delete(animationId); + /** + * If there are no more animations left, we can remove the cancel function. + * This will let us know when we can stop checking for conflicting layout animations. + */ + if (!appearAnimationStore.size) { + window.MotionCancelOptimisedAnimation = undefined; + } + } + }; + window.MotionCheckAppearSync = (visualElement, valueName, value) => { + const appearId = motionDom.getOptimisedAppearId(visualElement); + if (!appearId) + return; + const valueIsOptimised = window.MotionHasOptimisedAnimation?.(appearId, valueName); + const externalAnimationValue = visualElement.props.values?.[valueName]; + if (!valueIsOptimised || !externalAnimationValue) + return; + const removeSyncCheck = value.on("change", (latestValue) => { + if (externalAnimationValue.get() !== latestValue) { + window.MotionCancelOptimisedAnimation?.(appearId, valueName); + removeSyncCheck(); + } + }); + return removeSyncCheck; + }; + } + const startAnimation = () => { + readyAnimation.cancel(); + const appearAnimation = motionDom.startWaapiAnimation(element, name, keyframes, options); + /** + * Record the time of the first started animation. We call performance.now() once + * here and once in handoff to ensure we're getting + * close to a frame-locked time. This keeps all animations in sync. + */ + if (startFrameTime === undefined) { + startFrameTime = performance.now(); + } + appearAnimation.startTime = startFrameTime; + appearAnimationStore.set(storeId, { + animation: appearAnimation, + startTime: startFrameTime, + }); + if (onReady) + onReady(appearAnimation); + }; + appearComplete.set(id, false); + if (readyAnimation.ready) { + readyAnimation.ready.then(startAnimation).catch(motionUtils.noop); + } + else { + startAnimation(); + } +} + +const createObject = () => ({}); +class StateVisualElement extends motionDom.VisualElement { + constructor() { + super(...arguments); + this.measureInstanceViewportBox = motionDom.createBox; + } + build() { } + resetTransform() { } + restoreTransform() { } + removeValueFromRenderState() { } + renderInstance() { } + scrapeMotionValuesFromProps() { + return createObject(); + } + getBaseTargetFromProps() { + return undefined; + } + readValueFromInstance(_state, key, options) { + return options.initialState[key] || 0; + } + sortInstanceNodePosition() { + return 0; + } +} +const useVisualState = index.makeUseVisualState({ + scrapeMotionValuesFromProps: createObject, + createRenderState: createObject, +}); +/** + * This is not an officially supported API and may be removed + * on any version. + */ +function useAnimatedState(initialState) { + const [animationState, setAnimationState] = React.useState(initialState); + const visualState = useVisualState({}, false); + const element = index.useConstant(() => { + return new StateVisualElement({ + props: { + onUpdate: (v) => { + setAnimationState({ ...v }); + }, + }, + visualState, + presenceContext: null, + }, { initialState }); + }); + React.useLayoutEffect(() => { + element.mount({}); + return () => element.unmount(); + }, [element]); + const startAnimation = index.useConstant(() => (animationDefinition) => { + return motionDom.animateVisualElement(element, animationDefinition); + }); + return [animationState, startAnimation]; +} + +let id = 0; +const AnimateSharedLayout = ({ children }) => { + React__namespace.useEffect(() => { + motionUtils.invariant(false, "AnimateSharedLayout is deprecated: https://www.framer.com/docs/guide-upgrade/##shared-layout-animations"); + }, []); + return (jsxRuntime.jsx(LayoutGroup, { id: index.useConstant(() => `asl-${id++}`), children: children })); +}; + +// Keep things reasonable and avoid scale: Infinity. In practise we might need +// to add another value, opacity, that could interpolate scaleX/Y [0,0.01] => [0,1] +// to simply hide content at unreasonable scales. +const maxScale = 100000; +const invertScale = (scale) => scale > 0.001 ? 1 / scale : maxScale; +let hasWarned = false; +/** + * Returns a `MotionValue` each for `scaleX` and `scaleY` that update with the inverse + * of their respective parent scales. + * + * This is useful for undoing the distortion of content when scaling a parent component. + * + * By default, `useInvertedScale` will automatically fetch `scaleX` and `scaleY` from the nearest parent. + * By passing other `MotionValue`s in as `useInvertedScale({ scaleX, scaleY })`, it will invert the output + * of those instead. + * + * ```jsx + * const MyComponent = () => { + * const { scaleX, scaleY } = useInvertedScale() + * return + * } + * ``` + * + * @deprecated + */ +function useInvertedScale(scale) { + let parentScaleX = useMotionValue(1); + let parentScaleY = useMotionValue(1); + const { visualElement } = React.useContext(index.MotionContext); + motionUtils.invariant(!!(scale || visualElement), "If no scale values are provided, useInvertedScale must be used within a child of another motion component."); + motionUtils.warning(hasWarned, "useInvertedScale is deprecated and will be removed in 3.0. Use the layout prop instead."); + hasWarned = true; + if (scale) { + parentScaleX = scale.scaleX || parentScaleX; + parentScaleY = scale.scaleY || parentScaleY; + } + else if (visualElement) { + parentScaleX = visualElement.getValue("scaleX", 1); + parentScaleY = visualElement.getValue("scaleY", 1); + } + const scaleX = useTransform(parentScaleX, invertScale); + const scaleY = useTransform(parentScaleY, invertScale); + return { scaleX, scaleY }; +} + +exports.LayoutGroupContext = index.LayoutGroupContext; +exports.MotionConfigContext = index.MotionConfigContext; +exports.MotionContext = index.MotionContext; +exports.PresenceContext = index.PresenceContext; +exports.SwitchLayoutGroupContext = index.SwitchLayoutGroupContext; +exports.filterProps = index.filterProps; +exports.isBrowser = index.isBrowser; +exports.isValidMotionProp = index.isValidMotionProp; +exports.makeUseVisualState = index.makeUseVisualState; +exports.useIsomorphicLayoutEffect = index.useIsomorphicLayoutEffect; +Object.defineProperty(exports, "VisualElement", { + enumerable: true, + get: function () { return motionDom.VisualElement; } +}); +Object.defineProperty(exports, "addScaleCorrector", { + enumerable: true, + get: function () { return motionDom.addScaleCorrector; } +}); +Object.defineProperty(exports, "animateVisualElement", { + enumerable: true, + get: function () { return motionDom.animateVisualElement; } +}); +Object.defineProperty(exports, "arc", { + enumerable: true, + get: function () { return motionDom.arc; } +}); +Object.defineProperty(exports, "buildTransform", { + enumerable: true, + get: function () { return motionDom.buildTransform; } +}); +Object.defineProperty(exports, "calcLength", { + enumerable: true, + get: function () { return motionDom.calcLength; } +}); +Object.defineProperty(exports, "createBox", { + enumerable: true, + get: function () { return motionDom.createBox; } +}); +Object.defineProperty(exports, "delay", { + enumerable: true, + get: function () { return motionDom.delay; } +}); +Object.defineProperty(exports, "optimizedAppearDataAttribute", { + enumerable: true, + get: function () { return motionDom.optimizedAppearDataAttribute; } +}); +Object.defineProperty(exports, "resolveMotionValue", { + enumerable: true, + get: function () { return motionDom.resolveMotionValue; } +}); +Object.defineProperty(exports, "visualElementStore", { + enumerable: true, + get: function () { return motionDom.visualElementStore; } +}); +exports.addPointerEvent = featureBundle.addPointerEvent; +exports.addPointerInfo = featureBundle.addPointerInfo; +exports.animations = featureBundle.animations; +exports.distance = featureBundle.distance; +exports.distance2D = featureBundle.distance2D; +exports.useIsPresent = featureBundle.useIsPresent; +exports.usePresence = featureBundle.usePresence; +Object.defineProperty(exports, "MotionGlobalConfig", { + enumerable: true, + get: function () { return motionUtils.MotionGlobalConfig; } +}); +exports.AnimatePresence = AnimatePresence; +exports.AnimateSharedLayout = AnimateSharedLayout; +exports.DeprecatedLayoutGroupContext = DeprecatedLayoutGroupContext; +exports.DragControls = DragControls; +exports.LayoutGroup = LayoutGroup; +exports.LazyMotion = LazyMotion; +exports.MotionConfig = MotionConfig; +exports.PopChild = PopChild; +exports.PresenceChild = PresenceChild; +exports.Reorder = namespace; +exports.WillChangeMotionValue = WillChangeMotionValue; +exports.animate = animate; +exports.animateMini = animateMini; +exports.animationControls = animationControls; +exports.correctParentTransform = correctParentTransform; +exports.createScopedAnimate = createScopedAnimate; +exports.disableInstantTransitions = disableInstantTransitions; +exports.domAnimation = domAnimation; +exports.domMax = domMax; +exports.domMin = domMin; +exports.inView = inView; +exports.isMotionComponent = isMotionComponent; +exports.m = m; +exports.motion = motion; +exports.scroll = scroll; +exports.scrollInfo = scrollInfo; +exports.startOptimizedAppearAnimation = startOptimizedAppearAnimation; +exports.transformViewBoxPoint = transformViewBoxPoint; +exports.unwrapMotionComponent = unwrapMotionComponent; +exports.useAnimate = useAnimate; +exports.useAnimateMini = useAnimateMini; +exports.useAnimation = useAnimation; +exports.useAnimationControls = useAnimationControls; +exports.useAnimationFrame = useAnimationFrame; +exports.useComposedRefs = useComposedRefs; +exports.useCycle = useCycle; +exports.useDeprecatedAnimatedState = useAnimatedState; +exports.useDeprecatedInvertedScale = useInvertedScale; +exports.useDomEvent = useDomEvent; +exports.useDragControls = useDragControls; +exports.useElementScroll = useElementScroll; +exports.useFollowValue = useFollowValue; +exports.useForceUpdate = useForceUpdate; +exports.useInView = useInView; +exports.useInstantLayoutTransition = useInstantLayoutTransition; +exports.useInstantTransition = useInstantTransition; +exports.useMotionTemplate = useMotionTemplate; +exports.useMotionValue = useMotionValue; +exports.useMotionValueEvent = useMotionValueEvent; +exports.usePageInView = usePageInView; +exports.usePresenceData = usePresenceData; +exports.useReducedMotion = useReducedMotion; +exports.useReducedMotionConfig = useReducedMotionConfig; +exports.useResetProjection = useResetProjection; +exports.useScroll = useScroll; +exports.useSpring = useSpring; +exports.useTime = useTime; +exports.useTransform = useTransform; +exports.useUnmountEffect = useUnmountEffect; +exports.useVelocity = useVelocity; +exports.useViewportScroll = useViewportScroll; +exports.useWillChange = useWillChange; +Object.keys(motionDom).forEach(function (k) { + if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { + enumerable: true, + get: function () { return motionDom[k]; } + }); +}); +Object.keys(motionUtils).forEach(function (k) { + if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { + enumerable: true, + get: function () { return motionUtils[k]; } + }); +}); +//# sourceMappingURL=index.js.map diff --git a/node_modules/framer-motion/dist/cjs/index.js.map b/node_modules/framer-motion/dist/cjs/index.js.map new file mode 100644 index 0000000..4a60412 --- /dev/null +++ b/node_modules/framer-motion/dist/cjs/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sources":["../../src/utils/use-composed-ref.ts","../../src/components/AnimatePresence/PopChild.tsx","../../src/components/AnimatePresence/PresenceChild.tsx","../../src/components/AnimatePresence/utils.ts","../../src/components/AnimatePresence/index.tsx","../../src/context/DeprecatedLayoutGroupContext.ts","../../src/utils/use-is-mounted.ts","../../src/utils/use-force-update.ts","../../src/components/LayoutGroup/index.tsx","../../src/components/LazyMotion/index.tsx","../../src/components/MotionConfig/index.tsx","../../src/context/ReorderContext.ts","../../src/render/components/create-proxy.ts","../../src/render/components/motion/proxy.ts","../../src/components/Reorder/utils/check-reorder.ts","../../src/components/Reorder/utils/detect-axis.ts","../../src/components/Reorder/Group.tsx","../../src/value/use-motion-value.ts","../../src/value/use-combine-values.ts","../../src/value/use-computed.ts","../../src/value/use-transform.ts","../../src/components/Reorder/utils/auto-scroll.ts","../../src/components/Reorder/Item.tsx","../../src/animation/utils/is-dom-keyframes.ts","../../src/animation/animate/resolve-subjects.ts","../../src/animation/sequence/utils/calc-repeat-duration.ts","../../src/animation/sequence/utils/calc-time.ts","../../src/animation/sequence/utils/edit.ts","../../src/animation/sequence/utils/normalize-times.ts","../../src/animation/sequence/utils/sort.ts","../../src/animation/sequence/create.ts","../../src/animation/utils/create-visual-element.ts","../../src/animation/animate/subject.ts","../../src/animation/animate/sequence.ts","../../src/animation/animate/index.ts","../../src/animation/animators/waapi/animate-elements.ts","../../src/animation/animators/waapi/animate-style.ts","../../src/render/dom/scroll/utils/can-use-native-timeline.ts","../../src/render/dom/scroll/info.ts","../../src/render/dom/scroll/offsets/inset.ts","../../src/render/dom/scroll/offsets/edge.ts","../../src/render/dom/scroll/offsets/offset.ts","../../src/render/dom/scroll/offsets/presets.ts","../../src/render/dom/scroll/offsets/index.ts","../../src/render/dom/scroll/on-scroll-handler.ts","../../src/render/dom/scroll/track.ts","../../src/render/dom/scroll/utils/offset-to-range.ts","../../src/render/dom/scroll/utils/get-timeline.ts","../../src/render/dom/scroll/attach-animation.ts","../../src/render/dom/scroll/utils/is-element-tracking.ts","../../src/render/dom/scroll/attach-function.ts","../../src/render/dom/scroll/index.ts","../../src/render/dom/viewport/index.ts","../../src/render/components/m/proxy.ts","../../src/utils/use-unmount-effect.ts","../../src/render/dom/features-animation.ts","../../src/render/dom/features-max.ts","../../src/render/dom/features-min.ts","../../src/utils/use-motion-value-event.ts","../../src/value/use-scroll.ts","../../src/value/scroll/use-element-scroll.ts","../../src/value/scroll/use-viewport-scroll.ts","../../src/value/use-motion-template.ts","../../src/value/use-follow-value.ts","../../src/value/use-spring.ts","../../src/utils/use-animation-frame.ts","../../src/value/use-time.ts","../../src/value/use-velocity.ts","../../src/value/use-will-change/WillChangeMotionValue.ts","../../src/value/use-will-change/index.ts","../../src/utils/reduced-motion/use-reduced-motion.ts","../../src/utils/reduced-motion/use-reduced-motion-config.ts","../../src/animation/hooks/animation-controls.ts","../../src/animation/hooks/use-animate.ts","../../src/animation/hooks/use-animate-style.ts","../../src/animation/hooks/use-animation.ts","../../src/components/AnimatePresence/use-presence-data.ts","../../src/events/use-dom-event.ts","../../src/gestures/drag/use-drag-controls.ts","../../src/motion/utils/is-motion-component.ts","../../src/motion/utils/unwrap-motion-component.ts","../../src/projection/use-instant-layout-transition.ts","../../src/projection/use-reset-projection.ts","../../src/utils/use-cycle.ts","../../src/utils/use-in-view.ts","../../src/utils/use-instant-transition.ts","../../src/utils/use-page-in-view.ts","../../src/utils/transform-viewbox-point.ts","../../src/utils/transform-rotated-parent.ts","../../src/animation/optimized-appear/store.ts","../../src/animation/optimized-appear/store-id.ts","../../src/animation/optimized-appear/handoff.ts","../../src/animation/optimized-appear/start.ts","../../src/animation/hooks/use-animated-state.ts","../../src/components/AnimateSharedLayout.tsx","../../src/value/use-inverted-scale.ts"],"sourcesContent":["/**\n * Taken from https://github.com/radix-ui/primitives/blob/main/packages/react/compose-refs/src/compose-refs.tsx\n */\nimport * as React from \"react\"\n\ntype PossibleRef = React.Ref | undefined\n\n/**\n * Set a given ref to a given value\n * This utility takes care of different types of refs: callback refs and RefObject(s)\n */\nfunction setRef(ref: PossibleRef, value: T): void | (() => void) {\n if (typeof ref === \"function\") {\n return ref(value)\n } else if (ref !== null && ref !== undefined) {\n ;(ref as React.MutableRefObject).current = value\n }\n}\n\n/**\n * A utility to compose multiple refs together\n * Accepts callback refs and RefObject(s)\n */\nfunction composeRefs(...refs: PossibleRef[]): React.RefCallback {\n return (node) => {\n let hasCleanup = false\n const cleanups = refs.map((ref) => {\n const cleanup = setRef(ref, node)\n if (!hasCleanup && typeof cleanup === \"function\") {\n hasCleanup = true\n }\n return cleanup\n })\n // React <19 will log an error to the console if a callback ref returns a\n // value. We don't use ref cleanups internally so this will only happen if a\n // user's ref callback returns a value, which we only expect if they are\n // using the cleanup functionality added in React 19.\n if (hasCleanup) {\n return () => {\n for (let i = 0; i < cleanups.length; i++) {\n const cleanup = cleanups[i]\n if (typeof cleanup === \"function\") {\n cleanup()\n } else {\n setRef(refs[i], null)\n }\n }\n }\n }\n }\n}\n\n/**\n * A custom hook that composes multiple refs\n * Accepts callback refs and RefObject(s)\n */\nfunction useComposedRefs(...refs: PossibleRef[]): React.RefCallback {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n return React.useCallback(composeRefs(...refs), refs)\n}\n\nexport { useComposedRefs }\n","\"use client\"\n\nimport { isHTMLElement } from \"motion-dom\"\nimport * as React from \"react\"\nimport { useContext, useId, useInsertionEffect, useRef } from \"react\"\n\nimport { MotionConfigContext } from \"../../context/MotionConfigContext\"\nimport { useComposedRefs } from \"../../utils/use-composed-ref\"\n\ninterface Size {\n width: number\n height: number\n top: number\n left: number\n right: number\n bottom: number\n direction: string\n}\n\ninterface Props {\n children: React.ReactElement\n isPresent: boolean\n anchorX?: \"left\" | \"right\"\n anchorY?: \"top\" | \"bottom\"\n root?: HTMLElement | ShadowRoot\n pop?: boolean\n}\n\ninterface MeasureProps extends Props {\n childRef: React.RefObject\n sizeRef: React.RefObject\n}\n\n/**\n * Measurement functionality has to be within a separate component\n * to leverage snapshot lifecycle.\n */\nclass PopChildMeasure extends React.Component {\n getSnapshotBeforeUpdate(prevProps: MeasureProps) {\n const element = this.props.childRef.current\n if (isHTMLElement(element) && prevProps.isPresent && !this.props.isPresent && this.props.pop !== false) {\n const parent = element.offsetParent\n const parentWidth = isHTMLElement(parent)\n ? parent.offsetWidth || 0\n : 0\n const parentHeight = isHTMLElement(parent)\n ? parent.offsetHeight || 0\n : 0\n\n const computedStyle = getComputedStyle(element)\n const size = this.props.sizeRef.current!\n size.height = parseFloat(computedStyle.height)\n size.width = parseFloat(computedStyle.width)\n size.top = element.offsetTop\n size.left = element.offsetLeft\n size.right = parentWidth - size.width - size.left\n size.bottom = parentHeight - size.height - size.top\n size.direction = computedStyle.direction\n }\n\n return null\n }\n\n /**\n * Required with getSnapshotBeforeUpdate to stop React complaining.\n */\n componentDidUpdate() {}\n\n render() {\n return this.props.children\n }\n}\n\nexport function PopChild({ children, isPresent, anchorX, anchorY, root, pop }: Props) {\n const id = useId()\n const ref = useRef(null)\n const size = useRef({\n width: 0,\n height: 0,\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n direction: \"ltr\",\n })\n const { nonce } = useContext(MotionConfigContext)\n /**\n * In React 19, refs are passed via props.ref instead of element.ref.\n * We check props.ref first (React 19) and fall back to element.ref (React 18).\n *\n * The composed ref is only used when popping the child out (pop !== false),\n * so we avoid reading children.props.ref otherwise. In React 18.3 that read\n * triggers a spurious \"`ref` is not a prop\" warning getter (#3745).\n */\n const childRef =\n pop !== false\n ? ((children.props as { ref?: React.Ref })?.ref ??\n (children as unknown as { ref?: React.Ref })?.ref)\n : undefined\n const composedRef = useComposedRefs(ref, childRef)\n\n /**\n * We create and inject a style block so we can apply this explicit\n * sizing in a non-destructive manner by just deleting the style block.\n *\n * We can't apply size via render as the measurement happens\n * in getSnapshotBeforeUpdate (post-render), likewise if we apply the\n * styles directly on the DOM node, we might be overwriting\n * styles set via the style prop.\n */\n useInsertionEffect(() => {\n const { width, height, top, left, right, bottom, direction } = size.current\n if (isPresent || pop === false || !ref.current || !width || !height) return\n\n const isRTL = direction === \"rtl\"\n const x = anchorX === \"left\"\n ? (isRTL ? `right: ${right}` : `left: ${left}`)\n : (isRTL ? `left: ${left}` : `right: ${right}`)\n const y = anchorY === \"bottom\" ? `bottom: ${bottom}` : `top: ${top}`\n\n ref.current.dataset.motionPopId = id\n\n const style = document.createElement(\"style\")\n if (nonce) style.nonce = nonce\n\n const parent = root ?? document.head\n parent.appendChild(style)\n\n if (style.sheet) {\n style.sheet.insertRule(`\n [data-motion-pop-id=\"${id}\"] {\n position: absolute !important;\n width: ${width}px !important;\n height: ${height}px !important;\n ${x}px !important;\n ${y}px !important;\n }\n `)\n }\n\n return () => {\n ref.current?.removeAttribute(\"data-motion-pop-id\")\n if (parent.contains(style)) {\n parent.removeChild(style)\n }\n }\n }, [isPresent])\n\n return (\n \n {pop === false\n ? children\n : React.cloneElement(children as any, { ref: composedRef })}\n \n )\n}\n","\"use client\"\n\nimport * as React from \"react\"\nimport { useId, useMemo, useRef } from \"react\"\nimport {\n PresenceContext,\n type PresenceContextProps,\n} from \"../../context/PresenceContext\"\nimport { VariantLabels } from \"../../motion/types\"\nimport { useConstant } from \"../../utils/use-constant\"\nimport { useIsomorphicLayoutEffect } from \"../../utils/use-isomorphic-effect\"\nimport { PopChild } from \"./PopChild\"\n\ninterface PresenceChildProps {\n children: React.ReactElement\n isPresent: boolean\n onExitComplete?: () => void\n initial?: false | VariantLabels\n custom?: any\n presenceAffectsLayout: boolean\n mode: \"sync\" | \"popLayout\" | \"wait\"\n anchorX?: \"left\" | \"right\"\n anchorY?: \"top\" | \"bottom\"\n root?: HTMLElement | ShadowRoot\n}\n\nexport const PresenceChild = ({\n children,\n initial,\n isPresent,\n onExitComplete,\n custom,\n presenceAffectsLayout,\n mode,\n anchorX,\n anchorY,\n root\n}: PresenceChildProps) => {\n const presenceChildren = useConstant(newChildrenMap)\n const id = useId()\n\n // Written in a layout effect (not render) so discarded concurrent\n // renders can't leave the refs pointing at uncommitted state.\n const isPresentRef = useRef(isPresent)\n const onExitCompleteRef = useRef(onExitComplete)\n useIsomorphicLayoutEffect(() => {\n isPresentRef.current = isPresent\n onExitCompleteRef.current = onExitComplete\n })\n\n let isReusedContext = true\n let context = useMemo((): PresenceContextProps => {\n isReusedContext = false\n return {\n id,\n initial,\n isPresent,\n custom,\n onExitComplete: (childId: string) => {\n presenceChildren.set(childId, true)\n\n for (const isComplete of presenceChildren.values()) {\n if (!isComplete) return // can stop searching when any is incomplete\n }\n\n onExitComplete && onExitComplete()\n },\n register: (childId: string) => {\n presenceChildren.set(childId, false)\n return () => {\n presenceChildren.delete(childId)\n !isPresentRef.current &&\n !presenceChildren.size &&\n onExitCompleteRef.current?.()\n }\n },\n }\n }, [isPresent, presenceChildren, onExitComplete])\n\n /**\n * If the presence of a child affects the layout of the components around it,\n * we want to make a new context value to ensure they get re-rendered\n * so they can detect that layout change.\n */\n if (presenceAffectsLayout && isReusedContext) {\n context = { ...context }\n }\n\n useMemo(() => {\n presenceChildren.forEach((_, key) => presenceChildren.set(key, false))\n }, [isPresent])\n\n /**\n * If there's no `motion` components to fire exit animations, we want to remove this\n * component immediately.\n */\n React.useEffect(() => {\n !isPresent &&\n !presenceChildren.size &&\n onExitComplete &&\n onExitComplete()\n }, [isPresent])\n\n children = (\n \n {children}\n \n )\n\n return (\n \n {children}\n \n )\n}\n\nfunction newChildrenMap(): Map {\n return new Map()\n}\n","import { isValidElement, Children, ReactElement, ReactNode } from \"react\"\n\nexport type ComponentKey = string | number\n\nexport const getChildKey = (child: ReactElement): ComponentKey =>\n child.key || \"\"\n\nexport function onlyElements(children: ReactNode): ReactElement[] {\n const filtered: ReactElement[] = []\n\n // We use forEach here instead of map as map mutates the component key by preprending `.$`\n Children.forEach(children, (child) => {\n if (isValidElement(child)) filtered.push(child)\n })\n\n return filtered\n}\n","\"use client\"\n\nimport * as React from \"react\"\nimport { useContext, useMemo, useRef, useState } from \"react\"\nimport { LayoutGroupContext } from \"../../context/LayoutGroupContext\"\nimport { useConstant } from \"../../utils/use-constant\"\nimport { useIsomorphicLayoutEffect } from \"../../utils/use-isomorphic-effect\"\nimport { PresenceChild } from \"./PresenceChild\"\nimport { AnimatePresenceProps } from \"./types\"\nimport { usePresence } from \"./use-presence\"\nimport { ComponentKey, getChildKey, onlyElements } from \"./utils\"\n\n/**\n * `AnimatePresence` enables the animation of components that have been removed from the tree.\n *\n * When adding/removing more than a single child, every child **must** be given a unique `key` prop.\n *\n * Any `motion` components that have an `exit` property defined will animate out when removed from\n * the tree.\n *\n * ```jsx\n * import { motion, AnimatePresence } from 'framer-motion'\n *\n * export const Items = ({ items }) => (\n * \n * {items.map(item => (\n * \n * ))}\n * \n * )\n * ```\n *\n * You can sequence exit animations throughout a tree using variants.\n *\n * If a child contains multiple `motion` components with `exit` props, it will only unmount the child\n * once all `motion` components have finished animating out. Likewise, any components using\n * `usePresence` all need to call `safeToRemove`.\n *\n * @public\n */\nexport const AnimatePresence = ({\n children,\n custom,\n initial = true,\n onExitComplete,\n presenceAffectsLayout = true,\n mode = \"sync\",\n propagate = false,\n anchorX = \"left\",\n anchorY = \"top\",\n root\n}: React.PropsWithChildren) => {\n const [isParentPresent, safeToRemove] = usePresence(propagate)\n\n /**\n * Filter any children that aren't ReactElements. We can only track components\n * between renders with a props.key.\n */\n const presentChildren = useMemo(() => onlyElements(children), [children])\n\n /**\n * Track the keys of the currently rendered children. This is used to\n * determine which children are exiting.\n */\n const presentKeys =\n propagate && !isParentPresent ? [] : presentChildren.map(getChildKey)\n\n /**\n * If `initial={false}` we only want to pass this to components in the first render.\n */\n const isInitialRender = useRef(true)\n\n /**\n * A ref containing the currently present children. When all exit animations\n * are complete, we use this to re-render the component with the latest children\n * *committed* rather than the latest children *rendered*.\n */\n const pendingPresentChildren = useRef(presentChildren)\n\n /**\n * Track which exiting children have finished animating out.\n */\n const exitComplete = useConstant(() => new Map())\n\n /**\n * Track which components are currently processing exit to prevent duplicate processing.\n */\n const exitingComponents = useRef(new Set())\n\n /**\n * Save children to render as React state. To ensure this component is concurrent-safe,\n * we check for exiting children via an effect.\n */\n const [diffedChildren, setDiffedChildren] = useState(presentChildren)\n const [renderedChildren, setRenderedChildren] = useState(presentChildren)\n\n useIsomorphicLayoutEffect(() => {\n if (propagate && !isParentPresent && !renderedChildren.length) {\n safeToRemove?.()\n }\n }, [isParentPresent, propagate, renderedChildren.length, safeToRemove])\n\n useIsomorphicLayoutEffect(() => {\n isInitialRender.current = false\n pendingPresentChildren.current = presentChildren\n\n /**\n * Update complete status of exiting children.\n */\n for (let i = 0; i < renderedChildren.length; i++) {\n const key = getChildKey(renderedChildren[i])\n\n if (!presentKeys.includes(key)) {\n if (exitComplete.get(key) !== true) {\n exitComplete.set(key, false)\n }\n } else {\n exitComplete.delete(key)\n exitingComponents.current.delete(key)\n }\n }\n }, [renderedChildren, presentKeys.length, presentKeys.join(\"-\")])\n\n const exitingChildren: any[] = []\n\n if (presentChildren !== diffedChildren) {\n let nextChildren = [...presentChildren]\n\n /**\n * Loop through all the currently rendered components and decide which\n * are exiting.\n */\n for (let i = 0; i < renderedChildren.length; i++) {\n const child = renderedChildren[i]\n const key = getChildKey(child)\n\n if (!presentKeys.includes(key)) {\n nextChildren.splice(i, 0, child)\n exitingChildren.push(child)\n }\n }\n\n /**\n * If we're in \"wait\" mode, and we have exiting children, we want to\n * only render these until they've all exited.\n */\n if (mode === \"wait\" && exitingChildren.length) {\n nextChildren = exitingChildren\n }\n\n setRenderedChildren(onlyElements(nextChildren))\n setDiffedChildren(presentChildren)\n\n /**\n * Early return to ensure once we've set state with the latest diffed\n * children, we can immediately re-render.\n */\n return null\n }\n\n if (\n process.env.NODE_ENV !== \"production\" &&\n mode === \"wait\" &&\n renderedChildren.length > 1\n ) {\n console.warn(\n `You're attempting to animate multiple children within AnimatePresence, but its mode is set to \"wait\". This will lead to odd visual behaviour.`\n )\n }\n\n /**\n * If we've been provided a forceRender function by the LayoutGroupContext,\n * we can use it to force a re-render amongst all surrounding components once\n * all components have finished animating out.\n */\n const { forceRender } = useContext(LayoutGroupContext)\n\n return (\n <>\n {renderedChildren.map((child) => {\n const key = getChildKey(child)\n\n const isPresent =\n propagate && !isParentPresent\n ? false\n : presentChildren === renderedChildren ||\n presentKeys.includes(key)\n\n const onExit = () => {\n if (exitingComponents.current.has(key)) {\n return\n }\n\n if (exitComplete.has(key)) {\n exitingComponents.current.add(key)\n exitComplete.set(key, true)\n } else {\n return\n }\n\n let isEveryExitComplete = true\n exitComplete.forEach((isExitComplete) => {\n if (!isExitComplete) isEveryExitComplete = false\n })\n\n if (isEveryExitComplete) {\n forceRender?.()\n setRenderedChildren(pendingPresentChildren.current)\n\n propagate && safeToRemove?.()\n\n onExitComplete && onExitComplete()\n }\n }\n\n return (\n \n {child}\n \n )\n })}\n \n )\n}\n","\"use client\"\n\nimport { createContext } from \"react\"\n\n/**\n * Note: Still used by components generated by old versions of Framer\n *\n * @deprecated\n */\nexport const DeprecatedLayoutGroupContext = createContext(null)\n","\"use client\"\n\nimport { useRef } from \"react\"\nimport { useIsomorphicLayoutEffect } from \"./use-isomorphic-effect\"\n\nexport function useIsMounted() {\n const isMounted = useRef(false)\n useIsomorphicLayoutEffect(() => {\n isMounted.current = true\n\n return () => {\n isMounted.current = false\n }\n }, [])\n\n return isMounted\n}\n","\"use client\"\n\nimport { frame } from \"motion-dom\"\nimport { useCallback, useState } from \"react\"\nimport { useIsMounted } from \"./use-is-mounted\"\n\nexport function useForceUpdate(): [VoidFunction, number] {\n const isMounted = useIsMounted()\n const [forcedRenderCount, setForcedRenderCount] = useState(0)\n\n const forceRender = useCallback(() => {\n isMounted.current && setForcedRenderCount(forcedRenderCount + 1)\n }, [forcedRenderCount])\n\n /**\n * Defer this to the end of the next animation frame in case there are multiple\n * synchronous calls.\n */\n const deferredForceRender = useCallback(\n () => frame.postRender(forceRender),\n [forceRender]\n )\n\n return [deferredForceRender, forcedRenderCount]\n}\n","\"use client\"\n\nimport * as React from \"react\"\nimport { MutableRefObject, useContext, useMemo, useRef } from \"react\"\nimport {\n LayoutGroupContext,\n LayoutGroupContextProps,\n} from \"../../context/LayoutGroupContext\"\nimport { DeprecatedLayoutGroupContext } from \"../../context/DeprecatedLayoutGroupContext\"\nimport { nodeGroup } from \"../../projection\"\nimport { useForceUpdate } from \"../../utils/use-force-update\"\n\ntype InheritOption = boolean | \"id\"\n\nexport interface Props {\n id?: string\n inherit?: InheritOption\n}\n\nconst shouldInheritGroup = (inherit: InheritOption) => inherit === true\nconst shouldInheritId = (inherit: InheritOption) =>\n shouldInheritGroup(inherit === true) || inherit === \"id\"\n\nexport const LayoutGroup: React.FunctionComponent<\n React.PropsWithChildren\n> = ({ children, id, inherit = true }) => {\n const layoutGroupContext = useContext(LayoutGroupContext)\n const deprecatedLayoutGroupContext = useContext(\n DeprecatedLayoutGroupContext\n )\n const [forceRender, key] = useForceUpdate()\n const context = useRef(\n null\n ) as MutableRefObject\n\n const upstreamId = layoutGroupContext.id || deprecatedLayoutGroupContext\n if (context.current === null) {\n if (shouldInheritId(inherit) && upstreamId) {\n id = id ? upstreamId + \"-\" + id : upstreamId\n }\n\n context.current = {\n id,\n group: shouldInheritGroup(inherit)\n ? layoutGroupContext.group || nodeGroup()\n : nodeGroup(),\n }\n }\n\n const memoizedContext = useMemo(\n () => ({ ...context.current, forceRender }),\n [key]\n )\n\n return (\n \n {children}\n \n )\n}\n","\"use client\"\n\nimport { useEffect, useRef, useState } from \"react\"\nimport { LazyContext } from \"../../context/LazyContext\"\nimport { loadFeatures } from \"../../motion/features/load-features\"\nimport { FeatureBundle, LazyFeatureBundle } from \"../../motion/features/types\"\nimport { CreateVisualElement } from \"../../render/types\"\nimport { LazyProps } from \"./types\"\n\n/**\n * Used in conjunction with the `m` component to reduce bundle size.\n *\n * `m` is a version of the `motion` component that only loads functionality\n * critical for the initial render.\n *\n * `LazyMotion` can then be used to either synchronously or asynchronously\n * load animation and gesture support.\n *\n * ```jsx\n * // Synchronous loading\n * import { LazyMotion, m, domAnimation } from \"framer-motion\"\n *\n * function App() {\n * return (\n * \n * \n * \n * )\n * }\n *\n * // Asynchronous loading\n * import { LazyMotion, m } from \"framer-motion\"\n *\n * function App() {\n * return (\n * import('./path/to/domAnimation')}>\n * \n * \n * )\n * }\n * ```\n *\n * @public\n */\nexport function LazyMotion({ children, features, strict = false }: LazyProps) {\n const [, setIsLoaded] = useState(!isLazyBundle(features))\n const loadedRenderer = useRef(undefined)\n\n /**\n * If this is a synchronous load, load features immediately\n */\n if (!isLazyBundle(features)) {\n const { renderer, ...loadedFeatures } = features\n loadedRenderer.current = renderer\n loadFeatures(loadedFeatures)\n }\n\n useEffect(() => {\n if (isLazyBundle(features)) {\n features().then(({ renderer, ...loadedFeatures }) => {\n loadFeatures(loadedFeatures)\n loadedRenderer.current = renderer\n setIsLoaded(true)\n })\n }\n }, [])\n\n return (\n \n {children}\n \n )\n}\n\nfunction isLazyBundle(\n features: FeatureBundle | LazyFeatureBundle\n): features is LazyFeatureBundle {\n return typeof features === \"function\"\n}\n","\"use client\"\n\nimport * as React from \"react\"\nimport { useContext, useMemo } from \"react\"\nimport { resolveTransition } from \"motion-dom\"\nimport { MotionConfigContext } from \"../../context/MotionConfigContext\"\nimport { useConstant } from \"../../utils/use-constant\"\n\nexport interface MotionConfigProps extends Partial {\n children?: React.ReactNode\n}\n\n/**\n * `MotionConfig` is used to set configuration options for all children `motion` components.\n *\n * ```jsx\n * import { motion, MotionConfig } from \"framer-motion\"\n *\n * export function App() {\n * return (\n * \n * \n * \n * )\n * }\n * ```\n *\n * @public\n */\nexport function MotionConfig({ children, ...config }: MotionConfigProps) {\n /**\n * Inherit props from any parent MotionConfig components\n */\n const parentConfig = useContext(MotionConfigContext)\n config = { ...parentConfig, ...config }\n\n config.transition = resolveTransition(\n config.transition,\n parentConfig.transition\n )\n\n /**\n * Don't allow isStatic to change between renders as it affects how many hooks\n * motion components fire.\n */\n config.isStatic = useConstant(() => config.isStatic)\n\n /**\n * Creating a new config context object will re-render every `motion` component\n * every time it renders. So we only want to create a new one sparingly.\n */\n const context = useMemo(\n () => config,\n [\n JSON.stringify(config.transition),\n config.transformPagePoint,\n config.reducedMotion,\n config.skipAnimations,\n config.isValidProp,\n ]\n )\n\n return (\n \n {children}\n \n )\n}\n","\"use client\"\n\nimport { createContext } from \"react\"\nimport { ReorderContextProps } from \"../components/Reorder/types\"\n\nexport const ReorderContext = createContext | null>(\n null\n)\n","import { warnOnce } from \"motion-utils\"\nimport { createMotionComponent, MotionComponentOptions } from \"../../motion\"\nimport { FeaturePackages } from \"../../motion/features/types\"\nimport { MotionProps } from \"../../motion/types\"\nimport { DOMMotionComponents } from \"../dom/types\"\nimport { CreateVisualElement } from \"../types\"\n\n/**\n * I'd rather the return type of `custom` to be implicit but this throws\n * incorrect relative paths in the exported types and API Extractor throws\n * a wobbly.\n */\ntype ComponentProps = React.PropsWithoutRef &\n React.RefAttributes\nexport type CustomDomComponent = React.ComponentType<\n ComponentProps\n>\n\ntype MotionProxy = typeof createMotionComponent &\n DOMMotionComponents & { create: typeof createMotionComponent }\n\nexport function createMotionProxy(\n preloadedFeatures?: FeaturePackages,\n createVisualElement?: CreateVisualElement\n): MotionProxy {\n if (typeof Proxy === \"undefined\") {\n return createMotionComponent as MotionProxy\n }\n\n /**\n * A cache of generated `motion` components, e.g `motion.div`, `motion.input` etc.\n * Rather than generating them anew every render.\n */\n const componentCache = new Map()\n\n const factory = (Component: string, options?: MotionComponentOptions) => {\n return createMotionComponent(\n Component,\n options,\n preloadedFeatures,\n createVisualElement\n )\n }\n\n /**\n * Support for deprecated`motion(Component)` pattern\n */\n const deprecatedFactoryFunction = (\n Component: string,\n options?: MotionComponentOptions\n ) => {\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(\n false,\n \"motion() is deprecated. Use motion.create() instead.\"\n )\n }\n return factory(Component, options)\n }\n\n return new Proxy(deprecatedFactoryFunction, {\n /**\n * Called when `motion` is referenced with a prop: `motion.div`, `motion.input` etc.\n * The prop name is passed through as `key` and we can use that to generate a `motion`\n * DOM component with that name.\n */\n get: (_target, key: string) => {\n if (key === \"create\") return factory\n\n /**\n * If this element doesn't exist in the component cache, create it and cache.\n */\n if (!componentCache.has(key)) {\n componentCache.set(\n key,\n createMotionComponent(\n key,\n undefined,\n preloadedFeatures,\n createVisualElement\n )\n )\n }\n\n return componentCache.get(key)!\n },\n }) as MotionProxy\n}\n","import { createDomVisualElement } from \"../../dom/create-visual-element\"\nimport { createMotionProxy } from \"../create-proxy\"\nimport { featureBundle } from \"./feature-bundle\"\n\nexport const motion = /*@__PURE__*/ createMotionProxy(\n featureBundle,\n createDomVisualElement\n)\n","import { mixNumber } from \"motion-dom\"\nimport { moveItem, Point } from \"motion-utils\"\nimport { ItemData, ReorderAxis } from \"../types\"\n\nexport function checkReorder(\n order: ItemData[],\n value: T,\n offset: Point,\n velocity: Point,\n axis: ReorderAxis,\n direction: \"ltr\" | \"rtl\" = \"ltr\"\n): ItemData[] {\n const index = order.findIndex((item) => item.value === value)\n\n if (index === -1) return order\n\n if (axis === \"xy\") {\n const { layout } = order[index]\n const center = {\n x: mixNumber(layout.x.min, layout.x.max, 0.5) + offset.x,\n y: mixNumber(layout.y.min, layout.y.max, 0.5) + offset.y,\n }\n const lines = getLines(order)\n const sourceLine = lines.find((line) =>\n line.items.includes(order[index])\n )!\n const targetLine = lines.reduce((closest, line) =>\n distanceToLine(center.y, line) < distanceToLine(center.y, closest)\n ? line\n : closest\n )\n\n if (targetLine !== sourceLine) {\n return moveToLine(order, index, center.x, targetLine, direction)\n }\n\n const currentDistance = distanceToBox(center, layout)\n let target = -1\n let targetDistance = currentDistance\n\n order.forEach((item, targetIndex) => {\n if (targetIndex === index) return\n const distance = distanceToBox(center, item.layout)\n if (distance < targetDistance) {\n target = targetIndex\n targetDistance = distance\n }\n })\n\n return target === -1\n ? order\n : moveItem(order, index, index + Math.sign(target - index))\n }\n\n if (!velocity[axis]) return order\n\n const nextOffset = velocity[axis] > 0 ? 1 : -1\n const nextItem = order[index + nextOffset]\n\n if (!nextItem) return order\n\n const item = order[index]\n const itemLayout = item.layout[axis]\n const nextLayout = nextItem.layout[axis]\n const nextItemCenter = mixNumber(nextLayout.min, nextLayout.max, 0.5)\n\n if (\n (nextOffset === 1 && itemLayout.max + offset[axis] > nextItemCenter) ||\n (nextOffset === -1 && itemLayout.min + offset[axis] < nextItemCenter)\n ) {\n return moveItem(order, index, index + nextOffset)\n }\n\n return order\n}\n\ninterface Line {\n items: ItemData[]\n min: number\n max: number\n}\n\nfunction getLines(order: ItemData[]) {\n const lines: Line[] = []\n\n order.forEach((item) => {\n const { min, max } = item.layout.y\n const line = lines[lines.length - 1]\n\n if (!line || min >= line.max || max <= line.min) {\n lines.push({ items: [item], min, max })\n } else {\n line.items.push(item)\n line.min = Math.min(line.min, min)\n line.max = Math.max(line.max, max)\n }\n })\n\n return lines\n}\n\nfunction distanceToLine(y: number, line: Line) {\n return y < line.min ? line.min - y : y > line.max ? y - line.max : 0\n}\n\nfunction moveToLine(\n order: ItemData[],\n index: number,\n x: number,\n line: Line,\n direction: \"ltr\" | \"rtl\"\n) {\n const remaining = order.filter((_, itemIndex) => itemIndex !== index)\n const before = line.items.find((item) => {\n const center = mixNumber(item.layout.x.min, item.layout.x.max, 0.5)\n return direction === \"ltr\" ? x < center : x > center\n })\n const targetIndex = before\n ? remaining.indexOf(before)\n : remaining.indexOf(line.items[line.items.length - 1]) + 1\n const nextOrder = [...remaining]\n nextOrder.splice(targetIndex, 0, order[index])\n\n return nextOrder.every((item, itemIndex) => item === order[itemIndex])\n ? order\n : nextOrder\n}\n\nfunction distanceToBox(point: Point, box: ItemData[\"layout\"]) {\n const x = Math.max(box.x.min - point.x, 0, point.x - box.x.max)\n const y = Math.max(box.y.min - point.y, 0, point.y - box.y.max)\n return x * x + y * y\n}\n","import { Axis, Box } from \"motion-utils\"\nimport { ReorderAxis } from \"../types\"\n\nconst isSeparated = (a: Axis, b: Axis) => a.max <= b.min || b.max <= a.min\n\nexport function detectAxis(layouts: Box[]): ReorderAxis {\n let x = false\n let y = false\n\n for (let i = 0; i < layouts.length; i++) {\n for (let j = i + 1; j < layouts.length; j++) {\n x ||= isSeparated(layouts[i].x, layouts[j].x)\n y ||= isSeparated(layouts[i].y, layouts[j].y)\n\n if (x && y) return \"xy\"\n }\n }\n\n return x ? \"x\" : \"y\"\n}\n","\"use client\"\n\nimport { invariant } from \"motion-utils\"\nimport * as React from \"react\"\nimport {\n forwardRef,\n FunctionComponent,\n JSX,\n useEffect,\n useRef,\n useState,\n} from \"react\"\nimport { ReorderContext } from \"../../context/ReorderContext\"\nimport { motion } from \"../../render/components/motion/proxy\"\nimport { HTMLMotionProps } from \"../../render/html/types\"\nimport { useConstant } from \"../../utils/use-constant\"\nimport {\n DefaultGroupElement,\n ItemData,\n ReorderAxis,\n ReorderContextProps,\n ReorderElementTag,\n} from \"./types\"\nimport { checkReorder } from \"./utils/check-reorder\"\nimport { detectAxis } from \"./utils/detect-axis\"\n\nexport interface Props<\n V,\n TagName extends ReorderElementTag = DefaultGroupElement\n> {\n /**\n * A HTML element to render this component as. Defaults to `\"ul\"`.\n *\n * @public\n */\n as?: TagName\n\n /**\n * The axis to reorder along. By default, this is detected from the item\n * layout. Use `\"xy\"` to explicitly enable wrapped layout reordering.\n *\n * @public\n */\n axis?: ReorderAxis\n\n /**\n * A callback to fire with the new value order. For instance, if the values\n * are provided as a state from `useState`, this could be the set state function.\n *\n * @public\n */\n onReorder: (newOrder: V[]) => void\n\n /**\n * The latest values state.\n *\n * ```jsx\n * function Component() {\n * const [items, setItems] = useState([0, 1, 2])\n *\n * return (\n * \n * {items.map((item) => )}\n * \n * )\n * }\n * ```\n *\n * @public\n */\n values: V[]\n}\n\ntype ReorderGroupProps<\n V,\n TagName extends ReorderElementTag = DefaultGroupElement\n> = Props &\n Omit, \"values\"> &\n React.PropsWithChildren<{}>\n\nexport function ReorderGroupComponent<\n V,\n TagName extends ReorderElementTag = DefaultGroupElement\n>(\n {\n children,\n as = \"ul\" as TagName,\n axis: axisOverride,\n onReorder,\n values,\n ...props\n }: ReorderGroupProps,\n externalRef?: React.ForwardedRef\n): JSX.Element {\n const Component = useConstant(\n () => motion[as as keyof typeof motion]\n ) as FunctionComponent<\n React.PropsWithChildren & { ref?: React.Ref }>\n >\n\n const itemLayouts = useRef(new Map[\"layout\"]>())\n const [detectedAxis, setDetectedAxis] = useState(\"y\")\n const isReordering = useRef(false)\n const groupRef = useRef(null)\n const axis = axisOverride || detectedAxis\n\n invariant(\n Boolean(values),\n \"Reorder.Group must be provided a values prop\",\n \"reorder-values\"\n )\n\n const valuesSet = new Set(values)\n itemLayouts.current.forEach((_, value) => {\n if (!valuesSet.has(value)) itemLayouts.current.delete(value)\n })\n\n const context: ReorderContextProps = {\n axis,\n groupRef,\n registerItem: (value, layout) => {\n itemLayouts.current.set(value, layout)\n\n if (!axisOverride) {\n const nextAxis = detectAxis(\n values.flatMap((itemValue) => {\n const itemLayout = itemLayouts.current.get(itemValue)\n return itemLayout ? [itemLayout] : []\n })\n )\n\n if (nextAxis !== detectedAxis) setDetectedAxis(nextAxis)\n }\n },\n updateOrder: (item, offset, velocity) => {\n if (isReordering.current) return\n\n const order = values.flatMap((value) => {\n const layout = itemLayouts.current.get(value)\n return layout ? [{ value, layout }] : []\n })\n const direction =\n groupRef.current?.ownerDocument.defaultView?.getComputedStyle(\n groupRef.current\n ).direction === \"rtl\"\n ? \"rtl\"\n : \"ltr\"\n const newOrder = checkReorder(\n order,\n item,\n offset,\n velocity,\n axis,\n direction\n )\n\n if (order !== newOrder) {\n isReordering.current = true\n\n const newValues = [...values]\n const measuredIndexes = order.map(({ value }) =>\n values.indexOf(value)\n )\n newOrder.forEach(({ value }, index) => {\n newValues[measuredIndexes[index]] = value\n })\n onReorder(newValues)\n }\n },\n }\n\n useEffect(() => {\n isReordering.current = false\n })\n\n // Combine refs if external ref is provided\n const setRef = (element: Element | null) => {\n ;(groupRef as React.MutableRefObject).current = element\n if (typeof externalRef === \"function\") {\n externalRef(element)\n } else if (externalRef) {\n ;(externalRef as React.MutableRefObject).current =\n element\n }\n }\n\n /**\n * Disable browser scroll anchoring on the group container.\n * When items reorder, scroll anchoring can cause the browser to adjust\n * the scroll position, which interferes with drag position calculations.\n */\n const groupStyle = {\n overflowAnchor: \"none\" as const,\n ...props.style,\n }\n\n return (\n \n \n {children}\n \n \n )\n}\n\nexport const ReorderGroup = /*@__PURE__*/ forwardRef(ReorderGroupComponent) as <\n Values extends any[],\n TagName extends ReorderElementTag = DefaultGroupElement\n>(\n props: Omit<\n ReorderGroupProps,\n \"values\" | \"onReorder\"\n > & {\n values: Values\n onReorder: (newOrder: Values) => void\n } & { ref?: React.ForwardedRef }\n) => ReturnType\n","\"use client\"\n\nimport { motionValue, MotionValue } from \"motion-dom\"\nimport { useContext, useEffect, useState } from \"react\"\nimport { MotionConfigContext } from \"../context/MotionConfigContext\"\nimport { useConstant } from \"../utils/use-constant\"\n\n/**\n * Creates a `MotionValue` to track the state and velocity of a value.\n *\n * Usually, these are created automatically. For advanced use-cases, like use with `useTransform`, you can create `MotionValue`s externally and pass them into the animated component via the `style` prop.\n *\n * ```jsx\n * export const MyComponent = () => {\n * const scale = useMotionValue(1)\n *\n * return \n * }\n * ```\n *\n * @param initial - The initial state.\n *\n * @public\n */\nexport function useMotionValue(initial: T): MotionValue {\n const value = useConstant(() => motionValue(initial))\n\n /**\n * If this motion value is being used in static mode, like on\n * the Framer canvas, force components to rerender when the motion\n * value is updated.\n */\n const { isStatic } = useContext(MotionConfigContext)\n if (isStatic) {\n const [, setLatest] = useState(initial)\n useEffect(() => value.on(\"change\", setLatest), [])\n }\n\n return value\n}\n","\"use client\"\n\nimport { cancelFrame, frame, MotionValue } from \"motion-dom\"\nimport { useIsomorphicLayoutEffect } from \"../utils/use-isomorphic-effect\"\nimport { useMotionValue } from \"./use-motion-value\"\n\nexport function useCombineMotionValues(\n values: MotionValue[],\n combineValues: () => R\n) {\n /**\n * Initialise the returned motion value. This remains the same between renders.\n */\n const value = useMotionValue(combineValues())\n\n /**\n * Create a function that will update the template motion value with the latest values.\n * This is pre-bound so whenever a motion value updates it can schedule its\n * execution in Framesync. If it's already been scheduled it won't be fired twice\n * in a single frame.\n */\n const updateValue = () => value.set(combineValues())\n\n /**\n * Synchronously update the motion value with the latest values during the render.\n * This ensures that within a React render, the styles applied to the DOM are up-to-date.\n */\n updateValue()\n\n /**\n * Subscribe to all motion values found within the template. Whenever any of them change,\n * schedule an update.\n */\n useIsomorphicLayoutEffect(() => {\n const scheduleUpdate = () => frame.preRender(updateValue, false, true)\n const subscriptions = values.map((v) => v.on(\"change\", scheduleUpdate))\n\n return () => {\n subscriptions.forEach((unsubscribe) => unsubscribe())\n cancelFrame(updateValue)\n }\n })\n\n return value\n}\n","\"use client\"\n\nimport { collectMotionValues, type MotionValue } from \"motion-dom\"\nimport { useCombineMotionValues } from \"./use-combine-values\"\n\nexport function useComputed(compute: () => O): MotionValue {\n /**\n * Open session of collectMotionValues. Any MotionValue that calls get()\n * will be saved into this array.\n */\n collectMotionValues.current = []\n\n compute()\n\n const value = useCombineMotionValues(collectMotionValues.current, compute)\n\n /**\n * Synchronously close session of collectMotionValues.\n */\n collectMotionValues.current = undefined\n\n return value\n}\n","\"use client\"\n\nimport {\n AnyResolvedKeyframe,\n MotionValue,\n transform,\n TransformOptions,\n} from \"motion-dom\"\nimport { useConstant } from \"../utils/use-constant\"\nimport { useCombineMotionValues } from \"./use-combine-values\"\nimport { useComputed } from \"./use-computed\"\n\nexport type InputRange = number[]\ntype SingleTransformer = (input: I) => O\ntype MultiTransformer = (input: I[]) => O\ntype Transformer =\n | SingleTransformer\n /**\n * Ideally, this would be typed in all instances, but to type this\n * more accurately requires the tuple support in TypeScript 4:\n * https://gist.github.com/InventingWithMonster/c4d23752a0fae7888596c4ff6d92733a\n */\n | MultiTransformer\n\ninterface OutputMap {\n [key: string]: O[]\n}\n\n/**\n * Create multiple `MotionValue`s that transform the output of another `MotionValue` by mapping it from one range of values into multiple output ranges.\n *\n * @remarks\n *\n * This is useful when you want to derive multiple values from a single input value.\n * The keys of the output map must remain constant across renders.\n *\n * ```jsx\n * export const MyComponent = () => {\n * const x = useMotionValue(0)\n * const { opacity, scale } = useTransform(x, [0, 100], {\n * opacity: [0, 1],\n * scale: [0.5, 1]\n * })\n *\n * return (\n * \n * )\n * }\n * ```\n *\n * @param inputValue - `MotionValue`\n * @param inputRange - A linear series of numbers (either all increasing or decreasing)\n * @param outputMap - An object where keys map to output ranges. Each output range must be the same length as `inputRange`.\n * @param options - Transform options applied to all outputs\n *\n * @returns An object with the same keys as `outputMap`, where each value is a `MotionValue`\n *\n * @public\n */\nexport function useTransform>(\n inputValue: MotionValue,\n inputRange: InputRange,\n outputMap: T,\n options?: TransformOptions\n): { [K in keyof T]: MotionValue }\n\n/**\n * Create a `MotionValue` that transforms the output of another `MotionValue` by mapping it from one range of values into another.\n *\n * @remarks\n *\n * Given an input range of `[-200, -100, 100, 200]` and an output range of\n * `[0, 1, 1, 0]`, the returned `MotionValue` will:\n *\n * - When provided a value between `-200` and `-100`, will return a value between `0` and `1`.\n * - When provided a value between `-100` and `100`, will return `1`.\n * - When provided a value between `100` and `200`, will return a value between `1` and `0`\n *\n *\n * The input range must be a linear series of numbers. The output range\n * can be any value type supported by Motion: numbers, colors, shadows, etc.\n *\n * Every value in the output range must be of the same type and in the same format.\n *\n * ```jsx\n * export const MyComponent = () => {\n * const x = useMotionValue(0)\n * const xRange = [-200, -100, 100, 200]\n * const opacityRange = [0, 1, 1, 0]\n * const opacity = useTransform(x, xRange, opacityRange)\n *\n * return (\n * \n * )\n * }\n * ```\n *\n * @param inputValue - `MotionValue`\n * @param inputRange - A linear series of numbers (either all increasing or decreasing)\n * @param outputRange - A series of numbers, colors or strings. Must be the same length as `inputRange`.\n * @param options -\n *\n * - clamp: boolean. Clamp values to within the given range. Defaults to `true`\n * - ease: EasingFunction[]. Easing functions to use on the interpolations between each value in the input and output ranges. If provided as an array, the array must be one item shorter than the input and output ranges, as the easings apply to the transition between each.\n *\n * @returns `MotionValue`\n *\n * @public\n */\nexport function useTransform(\n value: MotionValue,\n inputRange: InputRange,\n outputRange: O[],\n options?: TransformOptions\n): MotionValue\n\n/**\n * Create a `MotionValue` that transforms the output of another `MotionValue` through a function.\n * In this example, `y` will always be double `x`.\n *\n * ```jsx\n * export const MyComponent = () => {\n * const x = useMotionValue(10)\n * const y = useTransform(x, value => value * 2)\n *\n * return \n * }\n * ```\n *\n * @param input - A `MotionValue` that will pass its latest value through `transform` to update the returned `MotionValue`.\n * @param transform - A function that accepts the latest value from `input` and returns a new value.\n * @returns `MotionValue`\n *\n * @public\n */\nexport function useTransform(\n input: MotionValue,\n transformer: SingleTransformer\n): MotionValue\n\n/**\n * Pass an array of `MotionValue`s and a function to combine them. In this example, `z` will be the `x` multiplied by `y`.\n *\n * ```jsx\n * export const MyComponent = () => {\n * const x = useMotionValue(0)\n * const y = useMotionValue(0)\n * const z = useTransform([x, y], ([latestX, latestY]) => latestX * latestY)\n *\n * return \n * }\n * ```\n *\n * @param input - An array of `MotionValue`s that will pass their latest values through `transform` to update the returned `MotionValue`.\n * @param transform - A function that accepts the latest values from `input` and returns a new value.\n * @returns `MotionValue`\n *\n * @public\n */\nexport function useTransform(\n input:\n | MotionValue[]\n | MotionValue[]\n | MotionValue[],\n transformer: MultiTransformer\n): MotionValue\nexport function useTransform(transformer: () => O): MotionValue\n\nexport function useTransform(\n input:\n | MotionValue\n | MotionValue[]\n | MotionValue[]\n | MotionValue[]\n | (() => O),\n inputRangeOrTransformer?: InputRange | Transformer,\n outputRangeOrMap?: O[] | OutputMap,\n options?: TransformOptions\n): MotionValue | { [key in K]: MotionValue } {\n if (typeof input === \"function\") {\n return useComputed(input)\n }\n\n /**\n * Detect if outputRangeOrMap is an output map (object with keys)\n * rather than an output range (array).\n */\n const isOutputMap =\n outputRangeOrMap !== undefined &&\n !Array.isArray(outputRangeOrMap) &&\n typeof inputRangeOrTransformer !== \"function\"\n\n if (isOutputMap) {\n return useMapTransform(\n input as MotionValue,\n inputRangeOrTransformer as InputRange,\n outputRangeOrMap as OutputMap,\n options\n ) as { [key in K]: MotionValue }\n }\n\n const outputRange = outputRangeOrMap as O[] | undefined\n const transformer =\n typeof inputRangeOrTransformer === \"function\"\n ? inputRangeOrTransformer\n : transform(inputRangeOrTransformer!, outputRange!, options)\n\n const result = Array.isArray(input)\n ? useListTransform(\n input,\n transformer as MultiTransformer\n )\n : useListTransform([input], ([latest]) =>\n (transformer as SingleTransformer)(latest)\n )\n\n const inputAccelerate = !Array.isArray(input)\n ? (input as MotionValue).accelerate\n : undefined\n\n if (\n inputAccelerate &&\n !inputAccelerate.isTransformed &&\n typeof inputRangeOrTransformer !== \"function\" &&\n Array.isArray(outputRangeOrMap) &&\n options?.clamp !== false\n ) {\n result.accelerate = {\n ...inputAccelerate,\n times: inputRangeOrTransformer as number[],\n keyframes: outputRangeOrMap,\n isTransformed: true,\n ...(options?.ease ? { ease: options.ease } : {}),\n }\n }\n\n return result\n}\n\nfunction useListTransform(\n values: MotionValue[],\n transformer: MultiTransformer\n): MotionValue {\n const latest = useConstant(() => [])\n\n return useCombineMotionValues(values, () => {\n latest.length = 0\n const numValues = values.length\n for (let i = 0; i < numValues; i++) {\n latest[i] = values[i].get()\n }\n\n return transformer(latest)\n })\n}\n\nfunction useMapTransform(\n inputValue: MotionValue,\n inputRange: InputRange,\n outputMap: OutputMap,\n options?: TransformOptions\n): { [key: string]: MotionValue } {\n /**\n * Capture keys once to ensure hooks are called in consistent order.\n */\n const keys = useConstant(() => Object.keys(outputMap))\n const output = useConstant<{ [key: string]: MotionValue }>(() => ({}))\n\n for (const key of keys) {\n output[key] = useTransform(inputValue, inputRange, outputMap[key], options)\n }\n\n return output\n}\n","const threshold = 50\nconst maxSpeed = 25\n\nconst overflowStyles = new Set([\"auto\", \"scroll\"])\n\n// Track initial scroll limits per scrollable element (Bug 1 fix)\nconst initialScrollLimits = new WeakMap()\n\n// Track auto-scroll active state per edge: \"start\" (top/left) or \"end\" (bottom/right)\ntype ActiveEdge = \"start\" | \"end\" | null\nconst activeScrollEdge = new WeakMap()\n\n// Track which group element is currently dragging to clear state on end\nlet currentGroupElement: Element | null = null\n\nexport function resetAutoScrollState(): void {\n if (currentGroupElement) {\n const scrollableAncestor = findScrollableAncestor(\n currentGroupElement,\n \"y\"\n )\n if (scrollableAncestor) {\n activeScrollEdge.delete(scrollableAncestor)\n initialScrollLimits.delete(scrollableAncestor)\n }\n // Also try x axis\n const scrollableAncestorX = findScrollableAncestor(\n currentGroupElement,\n \"x\"\n )\n if (scrollableAncestorX && scrollableAncestorX !== scrollableAncestor) {\n activeScrollEdge.delete(scrollableAncestorX)\n initialScrollLimits.delete(scrollableAncestorX)\n }\n currentGroupElement = null\n }\n}\n\nfunction isScrollableElement(element: Element, axis: \"x\" | \"y\"): boolean {\n const style = getComputedStyle(element)\n const overflow = axis === \"x\" ? style.overflowX : style.overflowY\n\n const isDocumentScroll =\n element === document.body ||\n element === document.documentElement\n\n return overflowStyles.has(overflow) || isDocumentScroll\n}\n\nfunction findScrollableAncestor(\n element: Element | null,\n axis: \"x\" | \"y\"\n): HTMLElement | null {\n let current = element?.parentElement\n while (current) {\n if (isScrollableElement(current, axis)) {\n return current\n }\n current = current.parentElement\n }\n return null\n}\n\nfunction getScrollAmount(\n pointerPosition: number,\n scrollElement: HTMLElement,\n axis: \"x\" | \"y\"\n): { amount: number; edge: ActiveEdge } {\n const rect = scrollElement.getBoundingClientRect()\n\n const start = axis === \"x\" ? Math.max(0, rect.left) : Math.max(0, rect.top)\n const end = axis === \"x\" ? Math.min(window.innerWidth, rect.right) : Math.min(window.innerHeight, rect.bottom)\n\n const distanceFromStart = pointerPosition - start\n const distanceFromEnd = end - pointerPosition\n\n if (distanceFromStart < threshold) {\n const intensity = 1 - distanceFromStart / threshold\n return { amount: -maxSpeed * intensity * intensity, edge: \"start\" }\n } else if (distanceFromEnd < threshold) {\n const intensity = 1 - distanceFromEnd / threshold\n return { amount: maxSpeed * intensity * intensity, edge: \"end\" }\n }\n\n return { amount: 0, edge: null }\n}\n\nexport function autoScrollIfNeeded(\n groupElement: Element | null,\n pointerPosition: number,\n axis: \"x\" | \"y\",\n velocity: number\n): void {\n if (!groupElement) return\n\n // Track the group element for cleanup\n currentGroupElement = groupElement\n\n const scrollableAncestor = findScrollableAncestor(groupElement, axis)\n if (!scrollableAncestor) return\n\n // Convert pointer position from page coordinates to viewport coordinates.\n // The gesture system uses pageX/pageY but getBoundingClientRect() returns\n // viewport-relative coordinates, so we need to account for page scroll.\n const viewportPointerPosition =\n pointerPosition - (axis === \"x\" ? window.scrollX : window.scrollY)\n\n const { amount: scrollAmount, edge } = getScrollAmount(\n viewportPointerPosition,\n scrollableAncestor,\n axis\n )\n\n // If not in any threshold zone, clear all state\n if (edge === null) {\n activeScrollEdge.delete(scrollableAncestor)\n initialScrollLimits.delete(scrollableAncestor)\n return\n }\n\n const currentActiveEdge = activeScrollEdge.get(scrollableAncestor)\n\n const isDocumentScroll =\n scrollableAncestor === document.body ||\n scrollableAncestor === document.documentElement\n\n // If not currently scrolling this edge, check velocity to see if we should start\n if (currentActiveEdge !== edge) {\n // Only start scrolling if velocity is towards the edge\n const shouldStart =\n (edge === \"start\" && velocity < 0) ||\n (edge === \"end\" && velocity > 0)\n if (!shouldStart) return\n\n // Activate this edge\n activeScrollEdge.set(scrollableAncestor, edge)\n\n // Record initial scroll limit (prevents infinite scroll)\n const maxScroll =\n axis === \"x\"\n ? scrollableAncestor.scrollWidth - (isDocumentScroll ? window.innerWidth : scrollableAncestor.clientWidth)\n : scrollableAncestor.scrollHeight - (isDocumentScroll ? window.innerHeight : scrollableAncestor.clientHeight)\n\n initialScrollLimits.set(scrollableAncestor, maxScroll)\n }\n\n // Cap scrolling at initial limit (prevents infinite scroll)\n if (scrollAmount > 0) {\n const initialLimit = initialScrollLimits.get(scrollableAncestor)!\n const currentScroll =\n axis === \"x\"\n ? (isDocumentScroll ? window.scrollX : scrollableAncestor.scrollLeft)\n : (isDocumentScroll ? window.scrollY : scrollableAncestor.scrollTop)\n if (currentScroll >= initialLimit) return\n }\n\n // Apply scroll\n if (axis === \"x\") {\n if (isDocumentScroll) {\n window.scrollBy({ left: scrollAmount })\n } else {\n scrollableAncestor.scrollLeft += scrollAmount\n }\n } else {\n if (isDocumentScroll) {\n window.scrollBy({ top: scrollAmount })\n } else {\n scrollableAncestor.scrollTop += scrollAmount\n }\n }\n}\n","\"use client\"\n\nimport { isMotionValue } from \"motion-dom\"\nimport { invariant } from \"motion-utils\"\nimport * as React from \"react\"\nimport { forwardRef, FunctionComponent, useContext } from \"react\"\nimport { ReorderContext } from \"../../context/ReorderContext\"\nimport { motion } from \"../../render/components/motion/proxy\"\nimport { HTMLMotionProps } from \"../../render/html/types\"\nimport { useConstant } from \"../../utils/use-constant\"\nimport { useMotionValue } from \"../../value/use-motion-value\"\nimport { useTransform } from \"../../value/use-transform\"\n\nimport { DefaultItemElement, ReorderElementTag } from \"./types\"\nimport { autoScrollIfNeeded, resetAutoScrollState } from \"./utils/auto-scroll\"\n\nexport interface Props<\n V,\n TagName extends ReorderElementTag = DefaultItemElement\n> {\n /**\n * A HTML element to render this component as. Defaults to `\"li\"`.\n *\n * @public\n */\n as?: TagName\n\n /**\n * The value in the list that this component represents.\n *\n * @public\n */\n value: V\n\n /**\n * A subset of layout options primarily used to disable layout=\"size\"\n *\n * @public\n * @default true\n */\n layout?: true | \"position\"\n}\n\nfunction useDefaultMotionValue(value: any, defaultValue: number = 0) {\n return isMotionValue(value) ? value : useMotionValue(defaultValue)\n}\n\ntype ReorderItemProps<\n V,\n TagName extends ReorderElementTag = DefaultItemElement\n> = Props &\n Omit, \"value\" | \"layout\"> &\n React.PropsWithChildren<{}>\n\nexport function ReorderItemComponent<\n V,\n TagName extends ReorderElementTag = DefaultItemElement\n>(\n {\n children,\n style = {},\n value,\n as = \"li\" as TagName,\n onDrag,\n onDragEnd,\n layout = true,\n ...props\n }: ReorderItemProps,\n externalRef?: React.ForwardedRef\n): React.JSX.Element {\n const Component = useConstant(\n () => motion[as as keyof typeof motion]\n ) as FunctionComponent<\n React.PropsWithChildren & { ref?: React.Ref }>\n >\n\n const context = useContext(ReorderContext)\n const point = {\n x: useDefaultMotionValue(style.x),\n y: useDefaultMotionValue(style.y),\n }\n\n const zIndex = useTransform([point.x, point.y], ([latestX, latestY]) =>\n latestX || latestY ? 1 : \"unset\"\n )\n\n invariant(\n Boolean(context),\n \"Reorder.Item must be a child of Reorder.Group\",\n \"reorder-item-child\"\n )\n\n const { axis, registerItem, updateOrder, groupRef } = context!\n const dragAxis = axis === \"xy\" ? true : axis\n\n return (\n {\n const { velocity, point: pointerPoint } = gesturePoint\n const offset = { x: point.x.get(), y: point.y.get() }\n\n updateOrder(value, offset, velocity)\n\n const scrollAxis =\n axis === \"xy\"\n ? Math.abs(velocity.x) > Math.abs(velocity.y)\n ? \"x\"\n : \"y\"\n : axis\n autoScrollIfNeeded(\n groupRef.current,\n pointerPoint[scrollAxis],\n scrollAxis,\n velocity[scrollAxis]\n )\n\n onDrag && onDrag(event, gesturePoint)\n }}\n onDragEnd={(event, gesturePoint) => {\n resetAutoScrollState()\n onDragEnd && onDragEnd(event, gesturePoint)\n }}\n onLayoutMeasure={(measured) => {\n registerItem(value, measured)\n }}\n ref={externalRef}\n ignoreStrict\n >\n {children}\n \n )\n}\n\nexport const ReorderItem = /*@__PURE__*/ forwardRef(ReorderItemComponent) as <\n V,\n TagName extends ReorderElementTag = DefaultItemElement\n>(\n props: ReorderItemProps & { ref?: React.ForwardedRef }\n) => ReturnType\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(\n subject:\n | string\n | Element\n | Element[]\n | NodeListOf\n | O\n | O[]\n | null\n | undefined,\n keyframes: DOMKeyframesDefinition | ObjectTarget,\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\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()\n const elementCache = {}\n const timeLabels = new Map()\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(\n subject: Element | MotionValue | O,\n sequences: Map\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\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,\n keyframes: string | UnresolvedValueKeyframe[],\n options?: ValueAnimationTransition\n): AnimationPlaybackControlsWithThen[]\n/**\n * Animate a number\n */\nexport function animateSubject(\n value: number | MotionValue,\n keyframes: number | UnresolvedValueKeyframe[],\n options?: ValueAnimationTransition\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(\n object: O | O[],\n keyframes: ObjectTarget,\n options?: DynamicAnimationOptions\n): AnimationPlaybackControlsWithThen[]\n/**\n * Implementation\n */\nexport function animateSubject(\n subject:\n | MotionValue\n | MotionValue\n | number\n | string\n | ElementOrSelector\n | O\n | O[],\n keyframes:\n | number\n | string\n | UnresolvedValueKeyframe[]\n | UnresolvedValueKeyframe[]\n | DOMKeyframesDefinition\n | ObjectTarget,\n options?:\n | ValueAnimationTransition\n | ValueAnimationTransition\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,\n keyframes: string | UnresolvedValueKeyframe[],\n options?: ValueAnimationTransition\n ): AnimationPlaybackControlsWithThen\n /**\n * Animate a number\n */\n function scopedAnimate(\n value: number | MotionValue,\n keyframes: number | UnresolvedValueKeyframe[],\n options?: ValueAnimationTransition\n ): AnimationPlaybackControlsWithThen\n /**\n * Animate a generic motion value\n */\n function scopedAnimate(\n value: V | MotionValue,\n keyframes: V | UnresolvedValueKeyframe[],\n options?: ValueAnimationTransition\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(\n object: O | O[],\n keyframes: ObjectTarget,\n options?: DynamicAnimationOptions\n ): AnimationPlaybackControlsWithThen\n /**\n * Implementation\n */\n function scopedAnimate(\n subjectOrSequence:\n | AnimationSequence\n | MotionValue\n | MotionValue\n | number\n | string\n | ElementOrSelector\n | O\n | O[],\n optionsOrKeyframes?:\n | SequenceOptions\n | number\n | string\n | UnresolvedValueKeyframe[]\n | UnresolvedValueKeyframe[]\n | DOMKeyframesDefinition\n | ObjectTarget,\n options?:\n | ValueAnimationTransition\n | ValueAnimationTransition\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>\n key: string\n unresolvedKeyframes: UnresolvedValueKeyframe[]\n options: Omit & {\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 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 . Likewise we\n * can't use .getBBox() like most SVG elements as these provide the offset\n * relative to the SVG itself, which for 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 = {\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 = {\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()\nconst resizeListeners = new WeakMap()\nconst onScrollHandlers = new WeakMap>()\nconst scrollSize = new WeakMap()\nconst dimensionCheckProcesses = new WeakMap()\n\nexport type ScrollTargets = Array\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 = {\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>\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()\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 { createMotionProxy } from \"../create-proxy\"\n\nexport const m = /*@__PURE__*/ createMotionProxy()\n","\"use client\"\n\nimport { useEffect } from \"react\"\n\nexport function useUnmountEffect(callback: () => void) {\n return useEffect(() => () => callback(), [])\n}\n","\"use client\"\n\nimport { animations } from \"../../motion/features/animations\"\nimport { gestureAnimations } from \"../../motion/features/gestures\"\nimport { FeatureBundle } from \"../../motion/features/types\"\nimport { createDomVisualElement } from \"./create-visual-element\"\n\n/**\n * @public\n */\nexport const domAnimation: FeatureBundle = {\n renderer: createDomVisualElement,\n ...animations,\n ...gestureAnimations,\n}\n","\"use client\"\n\nimport { drag } from \"../../motion/features/drag\"\nimport { layout } from \"../../motion/features/layout\"\nimport { FeatureBundle } from \"../../motion/features/types\"\nimport { domAnimation } from \"./features-animation\"\n\n/**\n * @public\n */\nexport const domMax: FeatureBundle = {\n ...domAnimation,\n ...drag,\n ...layout,\n}\n","\"use client\"\n\nimport { animations } from \"../../motion/features/animations\"\nimport { FeatureBundle } from \"../../motion/features/types\"\nimport { createDomVisualElement } from \"./create-visual-element\"\n\n/**\n * @public\n */\nexport const domMin: FeatureBundle = {\n renderer: createDomVisualElement,\n ...animations,\n}\n","\"use client\"\n\nimport { MotionValue, MotionValueEventCallbacks } from \"motion-dom\"\nimport { useInsertionEffect } from \"react\"\n\nexport function useMotionValueEvent<\n V,\n EventName extends keyof MotionValueEventCallbacks\n>(\n value: MotionValue,\n event: EventName,\n callback: MotionValueEventCallbacks[EventName]\n) {\n /**\n * useInsertionEffect will create subscriptions before any other\n * effects will run. Effects run upwards through the tree so it\n * can be that binding a useLayoutEffect higher up the tree can\n * miss changes from lower down the tree.\n */\n useInsertionEffect(\n () => value.on(event, callback),\n [value, event, callback]\n )\n}\n","\"use client\"\n\nimport {\n AnimationPlaybackControls,\n cancelMicrotask,\n microtask,\n motionValue,\n supportsScrollTimeline,\n supportsViewTimeline,\n} from \"motion-dom\"\nimport { invariant } from \"motion-utils\"\nimport { RefObject, useCallback, useEffect, useRef } from \"react\"\nimport { scroll } from \"../render/dom/scroll\"\nimport { ScrollInfoOptions } from \"../render/dom/scroll/types\"\nimport { offsetToViewTimelineRange } from \"../render/dom/scroll/utils/offset-to-range\"\nimport { useConstant } from \"../utils/use-constant\"\nimport { useIsomorphicLayoutEffect } from \"../utils/use-isomorphic-effect\"\n\nexport interface UseScrollOptions\n extends Omit {\n container?: RefObject\n target?: RefObject\n}\n\nconst createScrollMotionValues = () => ({\n scrollX: motionValue(0),\n scrollY: motionValue(0),\n scrollXProgress: motionValue(0),\n scrollYProgress: motionValue(0),\n})\n\nconst isRefPending = (ref?: RefObject) => {\n if (!ref) return false\n return !ref.current\n}\n\nfunction makeAccelerateConfig(\n axis: \"x\" | \"y\",\n options: Omit,\n container?: RefObject,\n target?: RefObject\n) {\n return {\n // Refs attach child-first; defer so target.current is populated\n // before scroll() reads it.\n factory: (animation: AnimationPlaybackControls) => {\n let cleanup: VoidFunction | undefined\n const start = () => {\n // A provided ref may be hydrated by an effect declared after\n // useScroll (or in a parent). Don't attach to the window\n // scroll in the meantime — that result gets cached and would\n // permanently mistrack. Wait until the ref resolves.\n if (isRefPending(container) || isRefPending(target)) {\n microtask.read(start)\n return\n }\n cleanup = scroll(animation, {\n ...options,\n axis,\n container: container?.current || undefined,\n target: target?.current || undefined,\n })\n }\n microtask.read(start)\n return () => {\n cancelMicrotask(start)\n cleanup?.()\n }\n },\n times: [0, 1],\n keyframes: [0, 1],\n ease: (v: number) => v,\n duration: 1,\n }\n}\n\nfunction canAccelerateScroll(\n target?: RefObject,\n offset?: ScrollInfoOptions[\"offset\"]\n) {\n if (typeof window === \"undefined\") return false\n return target\n ? supportsViewTimeline() && !!offsetToViewTimelineRange(offset)\n : supportsScrollTimeline()\n}\n\nexport function useScroll({\n container,\n target,\n ...options\n}: UseScrollOptions = {}) {\n const values = useConstant(createScrollMotionValues)\n\n if (canAccelerateScroll(target, options.offset)) {\n values.scrollXProgress.accelerate = makeAccelerateConfig(\n \"x\",\n options,\n container,\n target\n )\n values.scrollYProgress.accelerate = makeAccelerateConfig(\n \"y\",\n options,\n container,\n target\n )\n }\n\n const scrollAnimation = useRef(null)\n const needsStart = useRef(false)\n\n const start = useCallback(() => {\n scrollAnimation.current = scroll(\n (\n _progress: number,\n {\n x,\n y,\n }: {\n x: { current: number; progress: number }\n y: { current: number; progress: number }\n }\n ) => {\n values.scrollX.set(x.current)\n values.scrollXProgress.set(x.progress)\n values.scrollY.set(y.current)\n values.scrollYProgress.set(y.progress)\n },\n {\n ...options,\n container: container?.current || undefined,\n target: target?.current || undefined,\n }\n )\n\n return () => {\n scrollAnimation.current?.()\n }\n }, [container, target, JSON.stringify(options.offset)])\n\n useIsomorphicLayoutEffect(() => {\n needsStart.current = false\n\n if (isRefPending(container) || isRefPending(target)) {\n needsStart.current = true\n return\n } else {\n return start()\n }\n }, [start])\n\n useEffect(() => {\n if (!needsStart.current) return\n\n // Defer to a microtask so any sibling/parent effect that hydrates the\n // ref has a chance to run first.\n let cleanup: VoidFunction | undefined\n const tryStart = () => {\n const containerPending = isRefPending(container)\n const targetPending = isRefPending(target)\n invariant(\n !containerPending,\n \"Container ref is defined but not hydrated\",\n \"use-scroll-ref\"\n )\n invariant(\n !targetPending,\n \"Target ref is defined but not hydrated\",\n \"use-scroll-ref\"\n )\n if (!containerPending && !targetPending) cleanup = start()\n }\n microtask.read(tryStart)\n\n return () => {\n cancelMicrotask(tryStart)\n cleanup?.()\n }\n }, [start])\n\n return values\n}\n","import { warnOnce } from \"motion-utils\"\nimport { RefObject } from \"react\"\nimport { useScroll } from \"../use-scroll\"\n\n/**\n * @deprecated useElementScroll is deprecated. Convert to useScroll({ container: ref })\n */\nexport function useElementScroll(ref: RefObject) {\n if (process.env.NODE_ENV === \"development\") {\n warnOnce(\n false,\n \"useElementScroll is deprecated. Convert to useScroll({ container: ref }).\"\n )\n }\n\n return useScroll({ container: ref })\n}\n","import { warnOnce } from \"motion-utils\"\nimport { useScroll } from \"../use-scroll\"\n\n/**\n * @deprecated useViewportScroll is deprecated. Convert to useScroll()\n */\nexport function useViewportScroll() {\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(\n false,\n \"useViewportScroll is deprecated. Convert to useScroll().\"\n )\n }\n return useScroll()\n}\n","\"use client\"\n\nimport { isMotionValue, MotionValue } from \"motion-dom\"\nimport { useCombineMotionValues } from \"./use-combine-values\"\n\n/**\n * Combine multiple motion values into a new one using a string template literal.\n *\n * ```jsx\n * import {\n * motion,\n * useSpring,\n * useMotionValue,\n * useMotionTemplate\n * } from \"framer-motion\"\n *\n * function Component() {\n * const shadowX = useSpring(0)\n * const shadowY = useMotionValue(0)\n * const shadow = useMotionTemplate`drop-shadow(${shadowX}px ${shadowY}px 20px rgba(0,0,0,0.3))`\n *\n * return \n * }\n * ```\n *\n * @public\n */\nexport function useMotionTemplate(\n fragments: TemplateStringsArray,\n ...values: Array\n) {\n /**\n * Create a function that will build a string from the latest motion values.\n */\n const numFragments = fragments.length\n\n function buildValue() {\n let output = ``\n\n for (let i = 0; i < numFragments; i++) {\n output += fragments[i]\n const value = values[i]\n if (value) {\n output += isMotionValue(value) ? value.get() : value\n }\n }\n\n return output\n }\n\n return useCombineMotionValues(values.filter(isMotionValue), buildValue)\n}\n","\"use client\"\n\nimport {\n AnyResolvedKeyframe,\n attachFollow,\n FollowValueOptions,\n isMotionValue,\n MotionValue,\n} from \"motion-dom\"\nimport { useContext, useInsertionEffect } from \"react\"\nimport { MotionConfigContext } from \"../context/MotionConfigContext\"\nimport { useMotionValue } from \"./use-motion-value\"\nimport { useTransform } from \"./use-transform\"\n\n/**\n * Creates a `MotionValue` that, when `set`, will use the specified animation transition to animate to its new state.\n *\n * Unlike `useSpring` which is limited to spring animations, `useFollowValue` accepts any motion transition\n * including spring, tween, inertia, and keyframes.\n *\n * It can either work as a stand-alone `MotionValue` by initialising it with a value, or as a subscriber\n * to another `MotionValue`.\n *\n * @remarks\n *\n * ```jsx\n * // Spring animation (default)\n * const x = useFollowValue(0, { stiffness: 300 })\n *\n * // Tween animation\n * const y = useFollowValue(0, { type: \"tween\", duration: 0.5, ease: \"easeOut\" })\n *\n * // Track another MotionValue with spring\n * const source = useMotionValue(0)\n * const z = useFollowValue(source, { type: \"spring\", damping: 10 })\n *\n * // Inertia animation\n * const w = useFollowValue(0, { type: \"inertia\", velocity: 100 })\n * ```\n *\n * @param inputValue - `MotionValue` or number. If provided a `MotionValue`, when the input `MotionValue` changes, the created `MotionValue` will animate towards that value using the specified transition.\n * @param options - Animation transition options. Supports all transition types: spring, tween, inertia, keyframes.\n * @returns `MotionValue`\n *\n * @public\n */\nexport function useFollowValue(\n source: MotionValue,\n options?: FollowValueOptions\n): MotionValue\nexport function useFollowValue(\n source: string,\n options?: FollowValueOptions\n): MotionValue\nexport function useFollowValue(\n source: MotionValue,\n options?: FollowValueOptions\n): MotionValue\nexport function useFollowValue(\n source: number,\n options?: FollowValueOptions\n): MotionValue\nexport function useFollowValue(\n source: MotionValue | MotionValue | AnyResolvedKeyframe,\n options: FollowValueOptions = {}\n) {\n const { isStatic } = useContext(MotionConfigContext)\n const getFromSource = () => (isMotionValue(source) ? source.get() : source)\n\n // isStatic will never change, allowing early hooks return\n if (isStatic) {\n return useTransform(getFromSource)\n }\n\n const value = useMotionValue(getFromSource())\n\n useInsertionEffect(() => {\n return attachFollow(value, source, options)\n }, [value, JSON.stringify(options)])\n\n return value\n}\n","\"use client\"\n\nimport { FollowValueOptions, MotionValue, SpringOptions } from \"motion-dom\"\nimport { useFollowValue } from \"./use-follow-value\"\n\ntype UseSpringOptions = SpringOptions &\n Pick\n\n/**\n * Creates a `MotionValue` that, when `set`, will use a spring animation to animate to its new state.\n *\n * It can either work as a stand-alone `MotionValue` by initialising it with a value, or as a subscriber\n * to another `MotionValue`.\n *\n * @remarks\n *\n * ```jsx\n * const x = useSpring(0, { stiffness: 300 })\n * const y = useSpring(x, { damping: 10 })\n * ```\n *\n * @param inputValue - `MotionValue` or number. If provided a `MotionValue`, when the input `MotionValue` changes, the created `MotionValue` will spring towards that value.\n * @param springConfig - Configuration options for the spring.\n * @returns `MotionValue`\n *\n * @public\n */\nexport function useSpring(\n source: MotionValue,\n options?: UseSpringOptions\n): MotionValue\nexport function useSpring(\n source: string,\n options?: UseSpringOptions\n): MotionValue\nexport function useSpring(\n source: MotionValue,\n options?: UseSpringOptions\n): MotionValue\nexport function useSpring(\n source: number,\n options?: UseSpringOptions\n): MotionValue\nexport function useSpring(\n source: MotionValue | MotionValue | string | number,\n options: UseSpringOptions = {}\n): MotionValue | MotionValue {\n return useFollowValue(source as any, { type: \"spring\", ...options })\n}\n","\"use client\"\n\nimport { cancelFrame, frame, FrameData } from \"motion-dom\"\nimport { useContext, useEffect, useRef } from \"react\"\nimport { MotionConfigContext } from \"../context/MotionConfigContext\"\n\nexport type FrameCallback = (timestamp: number, delta: number) => void\n\nexport function useAnimationFrame(callback: FrameCallback) {\n const initialTimestamp = useRef(0)\n const { isStatic } = useContext(MotionConfigContext)\n\n useEffect(() => {\n if (isStatic) return\n\n const provideTimeSinceStart = ({ timestamp, delta }: FrameData) => {\n if (!initialTimestamp.current) initialTimestamp.current = timestamp\n\n callback(timestamp - initialTimestamp.current, delta)\n }\n\n frame.update(provideTimeSinceStart, true)\n return () => cancelFrame(provideTimeSinceStart)\n }, [callback])\n}\n","\"use client\"\n\nimport { useAnimationFrame } from \"../utils/use-animation-frame\"\nimport { useMotionValue } from \"./use-motion-value\"\n\nexport function useTime() {\n const time = useMotionValue(0)\n useAnimationFrame((t) => time.set(t))\n return time\n}\n","\"use client\"\n\nimport { frame, MotionValue } from \"motion-dom\"\nimport { useMotionValueEvent } from \"../utils/use-motion-value-event\"\nimport { useMotionValue } from \"./use-motion-value\"\n/**\n * Creates a `MotionValue` that updates when the velocity of the provided `MotionValue` changes.\n *\n * ```javascript\n * const x = useMotionValue(0)\n * const xVelocity = useVelocity(x)\n * const xAcceleration = useVelocity(xVelocity)\n * ```\n *\n * @public\n */\nexport function useVelocity(value: MotionValue): MotionValue {\n const velocity = useMotionValue(value.getVelocity())\n\n const updateVelocity = () => {\n const latest = value.getVelocity()\n velocity.set(latest)\n\n /**\n * If we still have velocity, schedule an update for the next frame\n * to keep checking until it is zero.\n */\n if (latest) frame.update(updateVelocity)\n }\n\n useMotionValueEvent(value, \"change\", () => {\n // Schedule an update to this value at the end of the current frame.\n frame.update(updateVelocity, false, true)\n })\n\n return velocity\n}\n","import {\n acceleratedValues,\n MotionValue,\n transformProps,\n type WillChange,\n} from \"motion-dom\"\n\nexport class WillChangeMotionValue\n extends MotionValue\n implements WillChange\n{\n private isEnabled = false\n\n add(name: string) {\n if (transformProps.has(name) || acceleratedValues.has(name)) {\n this.isEnabled = true\n this.update()\n }\n }\n\n private update() {\n this.set(this.isEnabled ? \"transform\" : \"auto\")\n }\n}\n","\"use client\"\n\nimport type { WillChange } from \"motion-dom\"\nimport { useConstant } from \"../../utils/use-constant\"\nimport { WillChangeMotionValue } from \"./WillChangeMotionValue\"\n\nexport function useWillChange(): WillChange {\n return useConstant(() => new WillChangeMotionValue(\"auto\"))\n}\n","\"use client\"\n\nimport {\n hasReducedMotionListener,\n initPrefersReducedMotion,\n prefersReducedMotion,\n} from \"motion-dom\"\nimport { warnOnce } from \"motion-utils\"\nimport { useState } from \"react\"\n\n/**\n * A hook that returns `true` if we should be using reduced motion based on the current device's Reduced Motion setting.\n *\n * This can be used to implement changes to your UI based on Reduced Motion. For instance, replacing motion-sickness inducing\n * `x`/`y` animations with `opacity`, disabling the autoplay of background videos, or turning off parallax motion.\n *\n * It will actively respond to changes and re-render your components with the latest setting.\n *\n * ```jsx\n * export function Sidebar({ isOpen }) {\n * const shouldReduceMotion = useReducedMotion()\n * const closedX = shouldReduceMotion ? 0 : \"-100%\"\n *\n * return (\n * \n * )\n * }\n * ```\n *\n * @return boolean\n *\n * @public\n */\nexport function useReducedMotion() {\n /**\n * Lazy initialisation of prefersReducedMotion\n */\n !hasReducedMotionListener.current && initPrefersReducedMotion()\n\n const [shouldReduceMotion] = useState(prefersReducedMotion.current)\n\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(\n shouldReduceMotion !== true,\n \"You have Reduced Motion enabled on your device. Animations may not appear as expected.\",\n \"reduced-motion-disabled\"\n )\n }\n\n /**\n * TODO See if people miss automatically updating shouldReduceMotion setting\n */\n\n return shouldReduceMotion\n}\n","\"use client\"\n\nimport { useContext } from \"react\"\nimport { MotionConfigContext } from \"../../context/MotionConfigContext\"\nimport { useReducedMotion } from \"./use-reduced-motion\"\n\nexport function useReducedMotionConfig() {\n const reducedMotionPreference = useReducedMotion()\n const { reducedMotion } = useContext(MotionConfigContext)\n\n if (reducedMotion === \"never\") {\n return false\n } else if (reducedMotion === \"always\") {\n return true\n } else {\n return reducedMotionPreference\n }\n}\n","import {\n animateVisualElement,\n setTarget,\n type AnimationDefinition,\n type LegacyAnimationControls,\n type VisualElement,\n} from \"motion-dom\"\nimport { invariant } from \"motion-utils\"\n\nfunction stopAnimation(visualElement: VisualElement) {\n visualElement.values.forEach((value) => value.stop())\n}\n\nfunction setVariants(visualElement: VisualElement, variantLabels: string[]) {\n const reversedLabels = [...variantLabels].reverse()\n\n reversedLabels.forEach((key) => {\n const variant = visualElement.getVariant(key)\n variant && setTarget(visualElement, variant)\n\n if (visualElement.variantChildren) {\n visualElement.variantChildren.forEach((child) => {\n setVariants(child, variantLabels)\n })\n }\n })\n}\n\nexport function setValues(\n visualElement: VisualElement,\n definition: AnimationDefinition\n) {\n if (Array.isArray(definition)) {\n return setVariants(visualElement, definition)\n } else if (typeof definition === \"string\") {\n return setVariants(visualElement, [definition])\n } else {\n setTarget(visualElement, definition as any)\n }\n}\n\n/**\n * @public\n */\nexport function animationControls(): LegacyAnimationControls {\n /**\n * Track whether the host component has mounted.\n */\n let hasMounted = false\n\n /**\n * A collection of linked component animation controls.\n */\n const subscribers = new Set()\n\n const controls: LegacyAnimationControls = {\n subscribe(visualElement) {\n subscribers.add(visualElement)\n return () => void subscribers.delete(visualElement)\n },\n\n start(definition, transitionOverride) {\n invariant(\n hasMounted,\n \"controls.start() should only be called after a component has mounted. Consider calling within a useEffect hook.\"\n )\n\n const animations: Array> = []\n subscribers.forEach((visualElement) => {\n animations.push(\n animateVisualElement(visualElement, definition, {\n transitionOverride,\n })\n )\n })\n\n return Promise.all(animations)\n },\n\n set(definition) {\n invariant(\n hasMounted,\n \"controls.set() should only be called after a component has mounted. Consider calling within a useEffect hook.\"\n )\n\n return subscribers.forEach((visualElement) => {\n setValues(visualElement, definition)\n })\n },\n\n stop() {\n subscribers.forEach((visualElement) => {\n stopAnimation(visualElement)\n })\n },\n\n mount() {\n hasMounted = true\n\n return () => {\n hasMounted = false\n controls.stop()\n }\n },\n }\n\n return controls\n}\n","\"use client\"\n\nimport { useContext, useMemo } from \"react\"\nimport { AnimationScope } from \"motion-dom\"\nimport { useConstant } from \"../../utils/use-constant\"\nimport { useUnmountEffect } from \"../../utils/use-unmount-effect\"\nimport { useReducedMotionConfig } from \"../../utils/reduced-motion/use-reduced-motion-config\"\nimport { MotionConfigContext } from \"../../context/MotionConfigContext\"\nimport { createScopedAnimate } from \"../animate\"\n\nexport function useAnimate() {\n const scope: AnimationScope = useConstant(() => ({\n current: null!, // Will be hydrated by React\n animations: [],\n }))\n\n const reduceMotion = useReducedMotionConfig() ?? undefined\n const { skipAnimations } = useContext(MotionConfigContext)\n\n const animate = useMemo(\n () => createScopedAnimate({ scope, reduceMotion, skipAnimations }),\n [scope, reduceMotion, skipAnimations]\n )\n\n useUnmountEffect(() => {\n scope.animations.forEach((animation) => animation.stop())\n scope.animations.length = 0\n })\n\n return [scope, animate] as [AnimationScope, typeof animate]\n}\n","\"use client\"\n\nimport { useConstant } from \"../../utils/use-constant\"\nimport { useUnmountEffect } from \"../../utils/use-unmount-effect\"\nimport { createScopedWaapiAnimate } from \"../animators/waapi/animate-style\"\nimport { AnimationScope } from \"motion-dom\"\n\nexport function useAnimateMini() {\n const scope: AnimationScope = useConstant(() => ({\n current: null!, // Will be hydrated by React\n animations: [],\n }))\n\n const animate = useConstant(() => createScopedWaapiAnimate(scope))\n\n useUnmountEffect(() => {\n scope.animations.forEach((animation) => animation.stop())\n })\n\n return [scope, animate] as [AnimationScope, typeof animate]\n}\n","\"use client\"\n\nimport { LegacyAnimationControls } from \"motion-dom\"\nimport { useConstant } from \"../../utils/use-constant\"\nimport { useIsomorphicLayoutEffect } from \"../../utils/use-isomorphic-effect\"\nimport { animationControls } from \"./animation-controls\"\n\n/**\n * Creates `LegacyAnimationControls`, which can be used to manually start, stop\n * and sequence animations on one or more components.\n *\n * The returned `LegacyAnimationControls` should be passed to the `animate` property\n * of the components you want to animate.\n *\n * These components can then be animated with the `start` method.\n *\n * ```jsx\n * import * as React from 'react'\n * import { motion, useAnimation } from 'framer-motion'\n *\n * export function MyComponent(props) {\n * const controls = useAnimation()\n *\n * controls.start({\n * x: 100,\n * transition: { duration: 0.5 },\n * })\n *\n * return \n * }\n * ```\n *\n * @returns Animation controller with `start` and `stop` methods\n *\n * @public\n */\nexport function useAnimationControls(): LegacyAnimationControls {\n const controls = useConstant(animationControls)\n\n useIsomorphicLayoutEffect(controls.mount, [])\n\n return controls\n}\n\nexport const useAnimation = useAnimationControls\n","\"use client\"\n\nimport { useContext } from \"react\"\nimport { PresenceContext } from \"../../context/PresenceContext\"\n\nexport function usePresenceData() {\n const context = useContext(PresenceContext)\n return context ? context.custom : undefined\n}\n","\"use client\"\n\nimport { RefObject, useEffect } from \"react\"\nimport { addDomEvent } from \"motion-dom\"\n\n/**\n * Attaches an event listener directly to the provided DOM element.\n *\n * Bypassing React's event system can be desirable, for instance when attaching non-passive\n * event handlers.\n *\n * ```jsx\n * const ref = useRef(null)\n *\n * useDomEvent(ref, 'wheel', onWheel, { passive: false })\n *\n * return
\n * ```\n *\n * @param ref - React.RefObject that's been provided to the element you want to bind the listener to.\n * @param eventName - Name of the event you want listen for.\n * @param handler - Function to fire when receiving the event.\n * @param options - Options to pass to `Event.addEventListener`.\n *\n * @public\n */\nexport function useDomEvent(\n ref: RefObject,\n eventName: string,\n handler?: EventListener | undefined,\n options?: AddEventListenerOptions\n) {\n useEffect(() => {\n const element = ref.current\n\n if (handler && element) {\n return addDomEvent(element, eventName, handler, options)\n }\n }, [ref, eventName, handler, options])\n}\n","import * as React from \"react\"\nimport { useConstant } from \"../../utils/use-constant\"\nimport {\n DragControlOptions,\n VisualElementDragControls,\n} from \"./VisualElementDragControls\"\n\n/**\n * Can manually trigger a drag gesture on one or more `drag`-enabled `motion` components.\n *\n * ```jsx\n * const dragControls = useDragControls()\n *\n * function startDrag(event) {\n * dragControls.start(event, { snapToCursor: true })\n * }\n *\n * return (\n * <>\n *
\n * \n * \n * )\n * ```\n *\n * @public\n */\nexport class DragControls {\n private componentControls = new Set()\n\n /**\n * Subscribe a component's internal `VisualElementDragControls` to the user-facing API.\n *\n * @internal\n */\n subscribe(controls: VisualElementDragControls): () => void {\n this.componentControls.add(controls)\n\n return () => this.componentControls.delete(controls)\n }\n\n /**\n * Start a drag gesture on every `motion` component that has this set of drag controls\n * passed into it via the `dragControls` prop.\n *\n * ```jsx\n * dragControls.start(e, {\n * snapToCursor: true\n * })\n * ```\n *\n * @param event - PointerEvent\n * @param options - Options\n *\n * @public\n */\n start(\n event: React.PointerEvent | PointerEvent,\n options?: DragControlOptions\n ) {\n this.componentControls.forEach((controls) => {\n controls.start(\n (event as React.PointerEvent).nativeEvent || event,\n options\n )\n })\n }\n\n /**\n * Cancels a drag gesture.\n *\n * ```jsx\n * dragControls.cancel()\n * ```\n *\n * @public\n */\n cancel() {\n this.componentControls.forEach((controls) => {\n controls.cancel()\n })\n }\n\n /**\n * Stops a drag gesture.\n *\n * ```jsx\n * dragControls.stop()\n * ```\n *\n * @public\n */\n stop() {\n this.componentControls.forEach((controls) => {\n controls.stop()\n })\n }\n}\n\nconst createDragControls = () => new DragControls()\n\n/**\n * Usually, dragging is initiated by pressing down on a `motion` component with a `drag` prop\n * and moving it. For some use-cases, for instance clicking at an arbitrary point on a video scrubber, we\n * might want to initiate that dragging from a different component than the draggable one.\n *\n * By creating a `dragControls` using the `useDragControls` hook, we can pass this into\n * the draggable component's `dragControls` prop. It exposes a `start` method\n * that can start dragging from pointer events on other components.\n *\n * ```jsx\n * const dragControls = useDragControls()\n *\n * function startDrag(event) {\n * dragControls.start(event, { snapToCursor: true })\n * }\n *\n * return (\n * <>\n *
\n * \n * \n * )\n * ```\n *\n * @public\n */\nexport function useDragControls() {\n return useConstant(createDragControls)\n}\n","import { motionComponentSymbol } from \"./symbol\"\n\n/**\n * Checks if a component is a `motion` component.\n */\nexport function isMotionComponent(component: React.ComponentType | string) {\n return (\n component !== null &&\n typeof component === \"object\" &&\n motionComponentSymbol in component\n )\n}\n","import { isMotionComponent } from \"./is-motion-component\"\nimport { motionComponentSymbol } from \"./symbol\"\n\n/**\n * Unwraps a `motion` component and returns either a string for `motion.div` or\n * the React component for `motion(Component)`.\n *\n * If the component is not a `motion` component it returns undefined.\n */\nexport function unwrapMotionComponent(\n component: React.ComponentType | string\n): React.ComponentType | string | undefined {\n if (isMotionComponent(component)) {\n return component[motionComponentSymbol as keyof typeof component]\n }\n\n return undefined\n}\n","import { rootProjectionNode } from \"motion-dom\"\n\nexport function useInstantLayoutTransition(): (\n cb?: (() => void) | undefined\n) => void {\n return startTransition\n}\n\nfunction startTransition(callback?: () => void) {\n if (!rootProjectionNode.current) return\n rootProjectionNode.current.isUpdating = false\n rootProjectionNode.current.blockUpdate()\n callback && callback()\n}\n","import { useCallback } from \"react\";\nimport { rootProjectionNode } from \"motion-dom\"\n\nexport function useResetProjection() {\n const reset = useCallback(() => {\n const root = rootProjectionNode.current\n if (!root) return\n root.resetTree()\n }, [])\n\n return reset\n}\n","\"use client\"\n\nimport { wrap } from \"motion-utils\"\nimport { useCallback, useRef, useState } from \"react\"\n\nexport type Cycle = (i?: number) => void\n\nexport type CycleState = [T, Cycle]\n\n/**\n * Cycles through a series of visual properties. Can be used to toggle between or cycle through animations. It works similar to `useState` in React. It is provided an initial array of possible states, and returns an array of two arguments.\n *\n * An index value can be passed to the returned `cycle` function to cycle to a specific index.\n *\n * ```jsx\n * import * as React from \"react\"\n * import { motion, useCycle } from \"framer-motion\"\n *\n * export const MyComponent = () => {\n * const [x, cycleX] = useCycle(0, 50, 100)\n *\n * return (\n * cycleX()}\n * />\n * )\n * }\n * ```\n *\n * @param items - items to cycle through\n * @returns [currentState, cycleState]\n *\n * @public\n */\nexport function useCycle(...items: T[]): CycleState {\n const index = useRef(0)\n const [item, setItem] = useState(items[index.current])\n\n const runCycle = useCallback(\n (next?: number) => {\n index.current =\n typeof next !== \"number\"\n ? wrap(0, items.length, index.current + 1)\n : next\n\n setItem(items[index.current])\n },\n // The array will change on each call, but by putting items.length at\n // the front of this array, we guarantee the dependency comparison will match up\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [items.length, ...items]\n )\n return [item, runCycle]\n}\n","\"use client\"\n\nimport { RefObject, useEffect, useState } from \"react\"\nimport { inView, InViewOptions } from \"../render/dom/viewport\"\n\nexport interface UseInViewOptions\n extends Omit {\n root?: RefObject\n once?: boolean\n amount?: \"some\" | \"all\" | number\n initial?: boolean\n}\n\nexport function useInView(\n ref: RefObject,\n {\n root,\n margin,\n amount,\n once = false,\n initial = false,\n }: UseInViewOptions = {}\n) {\n const [isInView, setInView] = useState(initial)\n\n useEffect(() => {\n if (!ref.current || (once && isInView)) return\n\n const onEnter = () => {\n setInView(true)\n\n return once ? undefined : () => setInView(false)\n }\n\n const options: InViewOptions = {\n root: (root && root.current) || undefined,\n margin,\n amount,\n }\n\n return inView(ref.current, onEnter, options)\n }, [root, ref, margin, once, amount])\n\n return isInView\n}\n","\"use client\"\n\nimport { frame } from \"motion-dom\"\nimport { MotionGlobalConfig } from \"motion-utils\"\nimport { useEffect, useRef } from \"react\"\nimport { useInstantLayoutTransition } from \"../projection/use-instant-layout-transition\"\nimport { useForceUpdate } from \"./use-force-update\"\n\nexport function useInstantTransition() {\n const [forceUpdate, forcedRenderCount] = useForceUpdate()\n const startInstantLayoutTransition = useInstantLayoutTransition()\n const unlockOnFrameRef = useRef(-1)\n\n useEffect(() => {\n /**\n * Unblock after two animation frames, otherwise this will unblock too soon.\n */\n frame.postRender(() =>\n frame.postRender(() => {\n /**\n * If the callback has been called again after the effect\n * triggered this 2 frame delay, don't unblock animations. This\n * prevents the previous effect from unblocking the current\n * instant transition too soon. This becomes more likely when\n * used in conjunction with React.startTransition().\n */\n if (forcedRenderCount !== unlockOnFrameRef.current) return\n MotionGlobalConfig.instantAnimations = false\n })\n )\n }, [forcedRenderCount])\n\n return (callback: () => void) => {\n startInstantLayoutTransition(() => {\n MotionGlobalConfig.instantAnimations = true\n forceUpdate()\n callback()\n unlockOnFrameRef.current = forcedRenderCount + 1\n })\n }\n}\n\nexport function disableInstantTransitions() {\n MotionGlobalConfig.instantAnimations = false\n}\n","\"use client\"\n\nimport { useEffect, useState } from \"react\"\n\nexport function usePageInView() {\n const [isInView, setIsInView] = useState(true)\n\n useEffect(() => {\n const handleVisibilityChange = () => setIsInView(!document.hidden)\n\n if (document.hidden) {\n handleVisibilityChange()\n }\n\n document.addEventListener(\"visibilitychange\", handleVisibilityChange)\n\n return () => {\n document.removeEventListener(\n \"visibilitychange\",\n handleVisibilityChange\n )\n }\n }, [])\n\n return isInView\n}\n","import type { Point, TransformPoint } from \"motion-utils\"\nimport type { RefObject } from \"react\"\n\n/**\n * Creates a `transformPagePoint` function that accounts for SVG viewBox scaling.\n *\n * When dragging SVG elements inside an SVG with a viewBox that differs from\n * the rendered dimensions (e.g., `viewBox=\"0 0 100 100\"` but rendered at 500x500 pixels),\n * pointer coordinates need to be transformed to match the SVG's coordinate system.\n *\n * @example\n * ```jsx\n * function App() {\n * const svgRef = useRef(null)\n *\n * return (\n * \n * \n * \n * \n * \n * )\n * }\n * ```\n *\n * @param svgRef - A React ref to the SVG element\n * @returns A transformPagePoint function for use with MotionConfig\n *\n * @public\n */\nexport function transformViewBoxPoint(\n svgRef: RefObject\n): TransformPoint {\n return (point: Point): Point => {\n const svg = svgRef.current\n if (!svg) {\n return point\n }\n\n // Get the viewBox attribute\n const viewBox = svg.viewBox?.baseVal\n if (!viewBox || (viewBox.width === 0 && viewBox.height === 0)) {\n // No viewBox or empty viewBox - no transformation needed\n return point\n }\n\n // Get the rendered dimensions of the SVG\n const bbox = svg.getBoundingClientRect()\n if (bbox.width === 0 || bbox.height === 0) {\n return point\n }\n\n // Calculate scale factors\n const scaleX = viewBox.width / bbox.width\n const scaleY = viewBox.height / bbox.height\n\n // Get the SVG's position on the page\n const svgX = bbox.left + window.scrollX\n const svgY = bbox.top + window.scrollY\n\n // Transform the point:\n // 1. Calculate position relative to SVG\n // 2. Scale by viewBox/viewport ratio\n // 3. Add back the SVG position (but in SVG coordinates)\n return {\n x: (point.x - svgX) * scaleX + svgX,\n y: (point.y - svgY) * scaleY + svgY,\n }\n }\n}\n","import type { Point, TransformPoint } from \"motion-utils\"\nimport type { RefObject } from \"react\"\n\n/**\n * Creates a `transformPagePoint` function that corrects pointer coordinates\n * for a parent container with CSS transforms (rotation, scale, skew).\n *\n * When dragging elements inside a transformed parent, pointer coordinates\n * need to be transformed through the inverse of the parent's transform\n * so the drag offset is in local space.\n *\n * Works with both static and continuously animating transforms.\n *\n * @example\n * ```jsx\n * function App() {\n * const ref = useRef(null)\n *\n * return (\n * \n * \n * \n * \n * \n * )\n * }\n * ```\n *\n * @param parentRef - A React ref to the transformed parent element\n * @returns A transformPagePoint function for use with MotionConfig\n *\n * @public\n */\nexport function correctParentTransform(\n parentRef: RefObject\n): TransformPoint {\n return (point: Point): Point => {\n const parent = parentRef.current\n if (!parent) return point\n\n const inv = getInverseMatrix(parent)\n if (!inv) return point\n\n // Get center of rotation in page space\n const rect = parent.getBoundingClientRect()\n const cx = rect.left + window.scrollX + rect.width / 2\n const cy = rect.top + window.scrollY + rect.height / 2\n\n // Transform (point - center) through inverse, then add center back\n const dx = point.x - cx\n const dy = point.y - cy\n return {\n x: cx + inv.a * dx + inv.c * dy,\n y: cy + inv.b * dx + inv.d * dy,\n }\n }\n}\n\ninterface InverseMatrix {\n a: number\n b: number\n c: number\n d: number\n}\n\nfunction getInverseMatrix(element: HTMLElement): InverseMatrix | null {\n const { transform } = getComputedStyle(element)\n if (!transform || transform === \"none\") return null\n\n const match =\n transform.match(/^matrix3d\\((.*)\\)$/u) ||\n transform.match(/^matrix\\((.*)\\)$/u)\n if (!match) return null\n\n const v = match[1].split(\",\").map(Number)\n const is3d = transform.startsWith(\"matrix3d\")\n const a = v[0],\n b = v[1]\n const c = is3d ? v[4] : v[2]\n const d = is3d ? v[5] : v[3]\n\n const det = a * d - b * c\n if (Math.abs(det) < 1e-10) return null\n\n return { a: d / det, b: -b / det, c: -c / det, d: a / det }\n}\n","export interface AppearStoreEntry {\n animation: Animation\n startTime: number | null\n}\n\nexport type AppearElementId = string\n\nexport type IsComplete = boolean\n\nexport const appearAnimationStore = new Map()\n\nexport const appearComplete = new Map()\n","import { transformProps } from \"motion-dom\"\n\nexport const appearStoreId = (elementId: string, valueName: string) => {\n const key = transformProps.has(valueName) ? \"transform\" : valueName\n\n return `${elementId}: ${key}`\n}\n","import type { Batcher } from \"motion-dom\"\nimport { appearAnimationStore } from \"./store\"\nimport { appearStoreId } from \"./store-id\"\n\nexport function handoffOptimizedAppearAnimation(\n elementId: string,\n valueName: string,\n frame: Batcher\n): number | null {\n const storeId = appearStoreId(elementId, valueName)\n const optimisedAnimation = appearAnimationStore.get(storeId)\n\n if (!optimisedAnimation) {\n return null\n }\n\n const { animation, startTime } = optimisedAnimation\n\n function cancelAnimation() {\n window.MotionCancelOptimisedAnimation?.(elementId, valueName, frame)\n }\n\n /**\n * We can cancel the animation once it's finished now that we've synced\n * with Motion.\n *\n * Prefer onfinish over finished as onfinish is backwards compatible with\n * older browsers.\n */\n animation.onfinish = cancelAnimation\n\n if (startTime === null || window.MotionHandoffIsComplete?.(elementId)) {\n /**\n * If the startTime is null, this animation is the Paint Ready detection animation\n * and we can cancel it immediately without handoff.\n *\n * Or if we've already handed off the animation then we're now interrupting it.\n * In which case we need to cancel it.\n */\n cancelAnimation()\n return null\n } else {\n return startTime\n }\n}\n","import {\n AnyResolvedKeyframe,\n Batcher,\n getOptimisedAppearId,\n MotionValue,\n optimizedAppearDataId,\n startWaapiAnimation,\n ValueAnimationTransition,\n type WithAppearProps,\n} from \"motion-dom\"\nimport { noop } from \"motion-utils\"\nimport { handoffOptimizedAppearAnimation } from \"./handoff\"\nimport { appearAnimationStore, appearComplete, AppearStoreEntry } from \"./store\"\nimport { appearStoreId } from \"./store-id\"\n\n/**\n * A single time to use across all animations to manually set startTime\n * and ensure they're all in sync.\n */\nlet startFrameTime: number\n\n/**\n * A dummy animation to detect when Chrome is ready to start\n * painting the page and hold off from triggering the real animation\n * until then. We only need one animation to detect paint ready.\n *\n * https://bugs.chromium.org/p/chromium/issues/detail?id=1406850\n */\nlet readyAnimation: Animation\n\n/**\n * Keep track of animations that were suspended vs cancelled so we\n * can easily resume them when we're done measuring layout.\n */\nconst suspendedAnimations = new Set()\n\nfunction resumeSuspendedAnimations() {\n suspendedAnimations.forEach((data) => {\n data.animation.play()\n data.animation.startTime = data.startTime\n })\n suspendedAnimations.clear()\n}\n\nexport function startOptimizedAppearAnimation(\n element: HTMLElement,\n name: string,\n keyframes: string[] | number[],\n options: ValueAnimationTransition,\n onReady?: (animation: Animation) => void\n): void {\n // Prevent optimised appear animations if Motion has already started animating.\n if (window.MotionIsMounted) {\n return\n }\n\n const id = element.dataset[optimizedAppearDataId]\n if (!id) return\n\n window.MotionHandoffAnimation = handoffOptimizedAppearAnimation\n\n const storeId = appearStoreId(id, name)\n if (!readyAnimation) {\n readyAnimation = startWaapiAnimation(\n element,\n name,\n [keyframes[0] as number, keyframes[0] as number],\n /**\n * 10 secs is basically just a super-safe duration to give Chrome\n * long enough to get the animation ready.\n */\n { duration: 10000, ease: \"linear\" }\n )\n\n appearAnimationStore.set(storeId, {\n animation: readyAnimation,\n startTime: null,\n })\n\n /**\n * If there's no readyAnimation then there's been no instantiation\n * of handoff animations.\n */\n window.MotionHandoffAnimation = handoffOptimizedAppearAnimation\n\n window.MotionHasOptimisedAnimation = (\n elementId?: string,\n valueName?: string\n ) => {\n if (!elementId) return false\n\n /**\n * Keep a map of elementIds that have started animating. We check\n * via ID instead of Element because of hydration errors and\n * pre-hydration checks. We also actively record IDs as they start\n * animating rather than simply checking for data-appear-id as\n * this attrbute might be present but not lead to an animation, for\n * instance if the element's appear animation is on a different\n * breakpoint.\n */\n if (!valueName) {\n return appearComplete.has(elementId)\n }\n\n const animationId = appearStoreId(elementId, valueName)\n return Boolean(appearAnimationStore.get(animationId))\n }\n\n window.MotionHandoffMarkAsComplete = (elementId: string): void => {\n if (appearComplete.has(elementId)) {\n appearComplete.set(elementId, true)\n }\n }\n\n window.MotionHandoffIsComplete = (elementId: string): boolean => {\n return appearComplete.get(elementId) === true\n }\n\n /**\n * We only need to cancel transform animations as\n * they're the ones that will interfere with the\n * layout animation measurements.\n */\n window.MotionCancelOptimisedAnimation = (\n elementId: string,\n valueName: string,\n frame?: Batcher,\n canResume?: boolean\n ) => {\n const animationId = appearStoreId(elementId, valueName)\n const data = appearAnimationStore.get(animationId)\n\n if (!data) return\n\n if (frame && canResume === undefined) {\n /**\n * Wait until the end of the subsequent frame to cancel the animation\n * to ensure we don't remove the animation before the main thread has\n * had a chance to resolve keyframes and render.\n */\n frame.postRender(() => {\n frame.postRender(() => {\n data.animation.cancel()\n })\n })\n } else {\n data.animation.cancel()\n }\n\n if (frame && canResume) {\n suspendedAnimations.add(data)\n frame.render(resumeSuspendedAnimations)\n } else {\n appearAnimationStore.delete(animationId)\n\n /**\n * If there are no more animations left, we can remove the cancel function.\n * This will let us know when we can stop checking for conflicting layout animations.\n */\n if (!appearAnimationStore.size) {\n window.MotionCancelOptimisedAnimation = undefined\n }\n }\n }\n\n window.MotionCheckAppearSync = (\n visualElement: WithAppearProps,\n valueName: string,\n value: MotionValue\n ) => {\n const appearId = getOptimisedAppearId(visualElement)\n\n if (!appearId) return\n\n const valueIsOptimised = window.MotionHasOptimisedAnimation?.(\n appearId,\n valueName\n )\n const externalAnimationValue =\n visualElement.props.values?.[valueName]\n\n if (!valueIsOptimised || !externalAnimationValue) return\n\n const removeSyncCheck = value.on(\n \"change\",\n (latestValue: AnyResolvedKeyframe) => {\n if (externalAnimationValue.get() !== latestValue) {\n window.MotionCancelOptimisedAnimation?.(\n appearId,\n valueName\n )\n removeSyncCheck()\n }\n }\n )\n\n return removeSyncCheck\n }\n }\n\n const startAnimation = () => {\n readyAnimation.cancel()\n\n const appearAnimation = startWaapiAnimation(\n element,\n name,\n keyframes,\n options\n )\n\n /**\n * Record the time of the first started animation. We call performance.now() once\n * here and once in handoff to ensure we're getting\n * close to a frame-locked time. This keeps all animations in sync.\n */\n if (startFrameTime === undefined) {\n startFrameTime = performance.now()\n }\n\n appearAnimation.startTime = startFrameTime\n\n appearAnimationStore.set(storeId, {\n animation: appearAnimation,\n startTime: startFrameTime,\n })\n\n if (onReady) onReady(appearAnimation)\n }\n\n appearComplete.set(id, false)\n\n if (readyAnimation.ready) {\n readyAnimation.ready.then(startAnimation).catch(noop)\n } else {\n startAnimation()\n }\n}\n","\"use client\"\n\nimport {\n animateVisualElement,\n createBox,\n ResolvedValues,\n TargetAndTransition,\n VisualElement,\n} from \"motion-dom\"\nimport { useLayoutEffect, useState } from \"react\"\nimport { makeUseVisualState } from \"../../motion/utils/use-visual-state\"\nimport { useConstant } from \"../../utils/use-constant\"\n\ninterface AnimatedStateOptions {\n initialState: ResolvedValues\n}\n\nconst createObject = () => ({})\n\nclass StateVisualElement extends VisualElement<\n ResolvedValues,\n {},\n AnimatedStateOptions\n> {\n type: \"state\"\n build() {}\n measureInstanceViewportBox = createBox\n resetTransform() {}\n restoreTransform() {}\n removeValueFromRenderState() {}\n renderInstance() {}\n scrapeMotionValuesFromProps() {\n return createObject()\n }\n getBaseTargetFromProps() {\n return undefined\n }\n\n readValueFromInstance(\n _state: ResolvedValues,\n key: string,\n options: AnimatedStateOptions\n ) {\n return options.initialState[key] || 0\n }\n\n sortInstanceNodePosition() {\n return 0\n }\n}\n\nconst useVisualState = makeUseVisualState({\n scrapeMotionValuesFromProps: createObject,\n createRenderState: createObject,\n})\n\n/**\n * This is not an officially supported API and may be removed\n * on any version.\n */\nexport function useAnimatedState(initialState: any) {\n const [animationState, setAnimationState] = useState(initialState)\n const visualState = useVisualState({}, false)\n\n const element = useConstant(() => {\n return new StateVisualElement(\n {\n props: {\n onUpdate: (v) => {\n setAnimationState({ ...v })\n },\n },\n visualState,\n presenceContext: null,\n },\n { initialState }\n )\n })\n\n useLayoutEffect(() => {\n element.mount({})\n return () => element.unmount()\n }, [element])\n\n const startAnimation = useConstant(\n () => (animationDefinition: TargetAndTransition) => {\n return animateVisualElement(element, animationDefinition)\n }\n )\n\n return [animationState, startAnimation]\n}\n","\"use client\"\n\nimport { invariant } from \"motion-utils\"\nimport * as React from \"react\"\nimport { useConstant } from \"../utils/use-constant\"\nimport { LayoutGroup } from \"./LayoutGroup\"\n\nlet id = 0\nexport const AnimateSharedLayout: React.FunctionComponent<\n React.PropsWithChildren\n> = ({ children }: React.PropsWithChildren<{}>) => {\n React.useEffect(() => {\n invariant(\n false,\n \"AnimateSharedLayout is deprecated: https://www.framer.com/docs/guide-upgrade/##shared-layout-animations\"\n )\n }, [])\n\n return (\n `asl-${id++}`)}>\n {children}\n \n )\n}\n","\"use client\"\n\nimport { MotionValue } from \"motion-dom\"\nimport { invariant, warning } from \"motion-utils\"\nimport { useContext } from \"react\"\nimport { MotionContext } from \"../context/MotionContext\"\nimport { useMotionValue } from \"./use-motion-value\"\nimport { useTransform } from \"./use-transform\"\n\ninterface ScaleMotionValues {\n scaleX: MotionValue\n scaleY: MotionValue\n}\n\n// Keep things reasonable and avoid scale: Infinity. In practise we might need\n// to add another value, opacity, that could interpolate scaleX/Y [0,0.01] => [0,1]\n// to simply hide content at unreasonable scales.\nconst maxScale = 100000\nexport const invertScale = (scale: number) =>\n scale > 0.001 ? 1 / scale : maxScale\n\nlet hasWarned = false\n\n/**\n * Returns a `MotionValue` each for `scaleX` and `scaleY` that update with the inverse\n * of their respective parent scales.\n *\n * This is useful for undoing the distortion of content when scaling a parent component.\n *\n * By default, `useInvertedScale` will automatically fetch `scaleX` and `scaleY` from the nearest parent.\n * By passing other `MotionValue`s in as `useInvertedScale({ scaleX, scaleY })`, it will invert the output\n * of those instead.\n *\n * ```jsx\n * const MyComponent = () => {\n * const { scaleX, scaleY } = useInvertedScale()\n * return \n * }\n * ```\n *\n * @deprecated\n */\nexport function useInvertedScale(\n scale?: Partial\n): ScaleMotionValues {\n let parentScaleX = useMotionValue(1)\n let parentScaleY = useMotionValue(1)\n const { visualElement } = useContext(MotionContext)\n\n invariant(\n !!(scale || visualElement),\n \"If no scale values are provided, useInvertedScale must be used within a child of another motion component.\"\n )\n\n warning(\n hasWarned,\n \"useInvertedScale is deprecated and will be removed in 3.0. Use the layout prop instead.\"\n )\n\n hasWarned = true\n\n if (scale) {\n parentScaleX = scale.scaleX || parentScaleX\n parentScaleY = scale.scaleY || parentScaleY\n } else if (visualElement) {\n parentScaleX = visualElement.getValue(\"scaleX\", 1)\n parentScaleY = visualElement.getValue(\"scaleY\", 1)\n }\n\n const scaleX = useTransform(parentScaleX, invertScale)\n const scaleY = useTransform(parentScaleY, invertScale)\n\n return { scaleX, scaleY }\n}\n"],"names":["React","isHTMLElement","useId","useRef","useContext","MotionConfigContext","useInsertionEffect","_jsx","useConstant","useIsomorphicLayoutEffect","useMemo","PresenceContext","Children","isValidElement","usePresence","useState","LayoutGroupContext","createContext","useCallback","frame","nodeGroup","loadFeatures","useEffect","LazyContext","resolveTransition","createMotionComponent","warnOnce","featureBundle","createDomVisualElement","mixNumber","moveItem","invariant","forwardRef","motionValue","cancelFrame","collectMotionValues","transform","isMotionValue","resolveElements","removeItem","getEasingForSegment","defaultOffset","isGenerator","secondsToMilliseconds","createGeneratorEasing","fillOffset","warning","reverseEasing","progress","isSVGElement","isSVGSVGElement","SVGVisualElement","HTMLVisualElement","visualElementStore","ObjectVisualElement","animateSingleValue","animateTarget","spring","GroupAnimationWithThen","getValueTransition","getAnimationMap","animationMapKey","getComputedStyle","fillWildcards","applyPxDefaults","NativeAnimation","supportsViewTimeline","supportsScrollTimeline","velocityPerSecond","interpolate","clamp","noop","frameData","resize","ScrollOffsetPresets","observeTimeline","animations","gestureAnimations","drag","layout","microtask","cancelMicrotask","attachFollow","MotionValue","transformProps","acceleratedValues","hasReducedMotionListener","initPrefersReducedMotion","prefersReducedMotion","setTarget","animateVisualElement","addDomEvent","motionComponentSymbol","rootProjectionNode","wrap","MotionGlobalConfig","optimizedAppearDataId","startWaapiAnimation","getOptimisedAppearId","VisualElement","createBox","makeUseVisualState","useLayoutEffect","MotionContext"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAEG;AAKH;;;AAGG;AACH,SAAS,MAAM,CAAI,GAAmB,EAAE,KAAQ,EAAA;AAC5C,IAAA,IAAI,OAAO,GAAG,KAAK,UAAU,EAAE;AAC3B,QAAA,OAAO,GAAG,CAAC,KAAK,CAAC;IACrB;SAAO,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,SAAS,EAAE;AACxC,QAAA,GAAiC,CAAC,OAAO,GAAG,KAAK;IACvD;AACJ;AAEA;;;AAGG;AACH,SAAS,WAAW,CAAI,GAAG,IAAsB,EAAA;IAC7C,OAAO,CAAC,IAAI,KAAI;QACZ,IAAI,UAAU,GAAG,KAAK;QACtB,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,KAAI;YA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AG,KAAK,GAAG,CAAC,GAAG,KAAK,GAAG,QAAQ;AAExC,IAAI,SAAS,GAAG,KAAK;AAErB;;;;;;;;;;;;;;;;;;AAkBG;AACG,SAAU,gBAAgB,CAC5B,KAAkC,EAAA;AAElC,IAAA,IAAI,YAAY,GAAG,cAAc,CAAC,CAAC,CAAC;AACpC,IAAA,IAAI,YAAY,GAAG,cAAc,CAAC,CAAC,CAAC;IACpC,MAAM,EAAE,aAAa,EAAE,GAAGJ,gBAAU,CAACmG,mBAAa,CAAC;IAEnDxE,qBAAS,CACL,CAAC,EAAE,KAAK,IAAI,aAAa,CAAC,EAC1B,4GAA4G,CAC/G;AAED,IAAAe,mBAAO,CACH,SAAS,EACT,yFAAyF,CAC5F;IAED,SAAS,GAAG,IAAI;IAEhB,IAAI,KAAK,EAAE;AACP,QAAA,YAAY,GAAG,KAAK,CAAC,MAAM,IAAI,YAAY;AAC3C,QAAA,YAAY,GAAG,KAAK,CAAC,MAAM,IAAI,YAAY;IAC/C;SAAO,IAAI,aAAa,EAAE;QACtB,YAAY,GAAG,aAAa,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC;QAClD,YAAY,GAAG,aAAa,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC;IACtD;IAEA,MAAM,MAAM,GAAG,YAAY,CAAC,YAAY,EAAE,WAAW,CAAC;IACtD,MAAM,MAAM,GAAG,YAAY,CAAC,YAAY,EAAE,WAAW,CAAC;AAEtD,IAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE;AAC7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/cjs/m.js b/node_modules/framer-motion/dist/cjs/m.js new file mode 100644 index 0000000..c6db4aa --- /dev/null +++ b/node_modules/framer-motion/dist/cjs/m.js @@ -0,0 +1,403 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var index = require('./index-BuO47Yrm.js'); +require('react/jsx-runtime'); +require('motion-utils'); +require('react'); +require('motion-dom'); + +function createMinimalMotionComponent(Component, options) { + return index.createMotionComponent(Component, options); +} + +/** + * HTML components + */ +const MotionA = /*@__PURE__*/ createMinimalMotionComponent("a"); +const MotionAbbr = /*@__PURE__*/ createMinimalMotionComponent("abbr"); +const MotionAddress = +/*@__PURE__*/ createMinimalMotionComponent("address"); +const MotionArea = /*@__PURE__*/ createMinimalMotionComponent("area"); +const MotionArticle = +/*@__PURE__*/ createMinimalMotionComponent("article"); +const MotionAside = /*@__PURE__*/ createMinimalMotionComponent("aside"); +const MotionAudio = /*@__PURE__*/ createMinimalMotionComponent("audio"); +const MotionB = /*@__PURE__*/ createMinimalMotionComponent("b"); +const MotionBase = /*@__PURE__*/ createMinimalMotionComponent("base"); +const MotionBdi = /*@__PURE__*/ createMinimalMotionComponent("bdi"); +const MotionBdo = /*@__PURE__*/ createMinimalMotionComponent("bdo"); +const MotionBig = /*@__PURE__*/ createMinimalMotionComponent("big"); +const MotionBlockquote = +/*@__PURE__*/ createMinimalMotionComponent("blockquote"); +const MotionBody = /*@__PURE__*/ createMinimalMotionComponent("body"); +const MotionButton = /*@__PURE__*/ createMinimalMotionComponent("button"); +const MotionCanvas = /*@__PURE__*/ createMinimalMotionComponent("canvas"); +const MotionCaption = +/*@__PURE__*/ createMinimalMotionComponent("caption"); +const MotionCite = /*@__PURE__*/ createMinimalMotionComponent("cite"); +const MotionCode = /*@__PURE__*/ createMinimalMotionComponent("code"); +const MotionCol = /*@__PURE__*/ createMinimalMotionComponent("col"); +const MotionColgroup = +/*@__PURE__*/ createMinimalMotionComponent("colgroup"); +const MotionData = /*@__PURE__*/ createMinimalMotionComponent("data"); +const MotionDatalist = +/*@__PURE__*/ createMinimalMotionComponent("datalist"); +const MotionDd = /*@__PURE__*/ createMinimalMotionComponent("dd"); +const MotionDel = /*@__PURE__*/ createMinimalMotionComponent("del"); +const MotionDetails = +/*@__PURE__*/ createMinimalMotionComponent("details"); +const MotionDfn = /*@__PURE__*/ createMinimalMotionComponent("dfn"); +const MotionDialog = /*@__PURE__*/ createMinimalMotionComponent("dialog"); +const MotionDiv = /*@__PURE__*/ createMinimalMotionComponent("div"); +const MotionDl = /*@__PURE__*/ createMinimalMotionComponent("dl"); +const MotionDt = /*@__PURE__*/ createMinimalMotionComponent("dt"); +const MotionEm = /*@__PURE__*/ createMinimalMotionComponent("em"); +const MotionEmbed = /*@__PURE__*/ createMinimalMotionComponent("embed"); +const MotionFieldset = +/*@__PURE__*/ createMinimalMotionComponent("fieldset"); +const MotionFigcaption = +/*@__PURE__*/ createMinimalMotionComponent("figcaption"); +const MotionFigure = /*@__PURE__*/ createMinimalMotionComponent("figure"); +const MotionFooter = /*@__PURE__*/ createMinimalMotionComponent("footer"); +const MotionForm = /*@__PURE__*/ createMinimalMotionComponent("form"); +const MotionH1 = /*@__PURE__*/ createMinimalMotionComponent("h1"); +const MotionH2 = /*@__PURE__*/ createMinimalMotionComponent("h2"); +const MotionH3 = /*@__PURE__*/ createMinimalMotionComponent("h3"); +const MotionH4 = /*@__PURE__*/ createMinimalMotionComponent("h4"); +const MotionH5 = /*@__PURE__*/ createMinimalMotionComponent("h5"); +const MotionH6 = /*@__PURE__*/ createMinimalMotionComponent("h6"); +const MotionHead = /*@__PURE__*/ createMinimalMotionComponent("head"); +const MotionHeader = /*@__PURE__*/ createMinimalMotionComponent("header"); +const MotionHgroup = /*@__PURE__*/ createMinimalMotionComponent("hgroup"); +const MotionHr = /*@__PURE__*/ createMinimalMotionComponent("hr"); +const MotionHtml = /*@__PURE__*/ createMinimalMotionComponent("html"); +const MotionI = /*@__PURE__*/ createMinimalMotionComponent("i"); +const MotionIframe = /*@__PURE__*/ createMinimalMotionComponent("iframe"); +const MotionImg = /*@__PURE__*/ createMinimalMotionComponent("img"); +const MotionInput = /*@__PURE__*/ createMinimalMotionComponent("input"); +const MotionIns = /*@__PURE__*/ createMinimalMotionComponent("ins"); +const MotionKbd = /*@__PURE__*/ createMinimalMotionComponent("kbd"); +const MotionKeygen = /*@__PURE__*/ createMinimalMotionComponent("keygen"); +const MotionLabel = /*@__PURE__*/ createMinimalMotionComponent("label"); +const MotionLegend = /*@__PURE__*/ createMinimalMotionComponent("legend"); +const MotionLi = /*@__PURE__*/ createMinimalMotionComponent("li"); +const MotionLink = /*@__PURE__*/ createMinimalMotionComponent("link"); +const MotionMain = /*@__PURE__*/ createMinimalMotionComponent("main"); +const MotionMap = /*@__PURE__*/ createMinimalMotionComponent("map"); +const MotionMark = /*@__PURE__*/ createMinimalMotionComponent("mark"); +const MotionMenu = /*@__PURE__*/ createMinimalMotionComponent("menu"); +const MotionMenuitem = +/*@__PURE__*/ createMinimalMotionComponent("menuitem"); +const MotionMeter = /*@__PURE__*/ createMinimalMotionComponent("meter"); +const MotionNav = /*@__PURE__*/ createMinimalMotionComponent("nav"); +const MotionObject = /*@__PURE__*/ createMinimalMotionComponent("object"); +const MotionOl = /*@__PURE__*/ createMinimalMotionComponent("ol"); +const MotionOptgroup = +/*@__PURE__*/ createMinimalMotionComponent("optgroup"); +const MotionOption = /*@__PURE__*/ createMinimalMotionComponent("option"); +const MotionOutput = /*@__PURE__*/ createMinimalMotionComponent("output"); +const MotionP = /*@__PURE__*/ createMinimalMotionComponent("p"); +const MotionParam = /*@__PURE__*/ createMinimalMotionComponent("param"); +const MotionPicture = +/*@__PURE__*/ createMinimalMotionComponent("picture"); +const MotionPre = /*@__PURE__*/ createMinimalMotionComponent("pre"); +const MotionProgress = +/*@__PURE__*/ createMinimalMotionComponent("progress"); +const MotionQ = /*@__PURE__*/ createMinimalMotionComponent("q"); +const MotionRp = /*@__PURE__*/ createMinimalMotionComponent("rp"); +const MotionRt = /*@__PURE__*/ createMinimalMotionComponent("rt"); +const MotionRuby = /*@__PURE__*/ createMinimalMotionComponent("ruby"); +const MotionS = /*@__PURE__*/ createMinimalMotionComponent("s"); +const MotionSamp = /*@__PURE__*/ createMinimalMotionComponent("samp"); +const MotionScript = /*@__PURE__*/ createMinimalMotionComponent("script"); +const MotionSection = +/*@__PURE__*/ createMinimalMotionComponent("section"); +const MotionSelect = /*@__PURE__*/ createMinimalMotionComponent("select"); +const MotionSmall = /*@__PURE__*/ createMinimalMotionComponent("small"); +const MotionSource = /*@__PURE__*/ createMinimalMotionComponent("source"); +const MotionSpan = /*@__PURE__*/ createMinimalMotionComponent("span"); +const MotionStrong = /*@__PURE__*/ createMinimalMotionComponent("strong"); +const MotionStyle = /*@__PURE__*/ createMinimalMotionComponent("style"); +const MotionSub = /*@__PURE__*/ createMinimalMotionComponent("sub"); +const MotionSummary = +/*@__PURE__*/ createMinimalMotionComponent("summary"); +const MotionSup = /*@__PURE__*/ createMinimalMotionComponent("sup"); +const MotionTable = /*@__PURE__*/ createMinimalMotionComponent("table"); +const MotionTbody = /*@__PURE__*/ createMinimalMotionComponent("tbody"); +const MotionTd = /*@__PURE__*/ createMinimalMotionComponent("td"); +const MotionTextarea = +/*@__PURE__*/ createMinimalMotionComponent("textarea"); +const MotionTfoot = /*@__PURE__*/ createMinimalMotionComponent("tfoot"); +const MotionTh = /*@__PURE__*/ createMinimalMotionComponent("th"); +const MotionThead = /*@__PURE__*/ createMinimalMotionComponent("thead"); +const MotionTime = /*@__PURE__*/ createMinimalMotionComponent("time"); +const MotionTitle = /*@__PURE__*/ createMinimalMotionComponent("title"); +const MotionTr = /*@__PURE__*/ createMinimalMotionComponent("tr"); +const MotionTrack = /*@__PURE__*/ createMinimalMotionComponent("track"); +const MotionU = /*@__PURE__*/ createMinimalMotionComponent("u"); +const MotionUl = /*@__PURE__*/ createMinimalMotionComponent("ul"); +const MotionVideo = /*@__PURE__*/ createMinimalMotionComponent("video"); +const MotionWbr = /*@__PURE__*/ createMinimalMotionComponent("wbr"); +const MotionWebview = +/*@__PURE__*/ createMinimalMotionComponent("webview"); +/** + * SVG components + */ +const MotionAnimate = +/*@__PURE__*/ createMinimalMotionComponent("animate"); +const MotionCircle = /*@__PURE__*/ createMinimalMotionComponent("circle"); +const MotionDefs = /*@__PURE__*/ createMinimalMotionComponent("defs"); +const MotionDesc = /*@__PURE__*/ createMinimalMotionComponent("desc"); +const MotionEllipse = +/*@__PURE__*/ createMinimalMotionComponent("ellipse"); +const MotionG = /*@__PURE__*/ createMinimalMotionComponent("g"); +const MotionImage = /*@__PURE__*/ createMinimalMotionComponent("image"); +const MotionLine = /*@__PURE__*/ createMinimalMotionComponent("line"); +const MotionFilter = /*@__PURE__*/ createMinimalMotionComponent("filter"); +const MotionMarker = /*@__PURE__*/ createMinimalMotionComponent("marker"); +const MotionMask = /*@__PURE__*/ createMinimalMotionComponent("mask"); +const MotionMetadata = +/*@__PURE__*/ createMinimalMotionComponent("metadata"); +const MotionPath = /*@__PURE__*/ createMinimalMotionComponent("path"); +const MotionPattern = +/*@__PURE__*/ createMinimalMotionComponent("pattern"); +const MotionPolygon = +/*@__PURE__*/ createMinimalMotionComponent("polygon"); +const MotionPolyline = +/*@__PURE__*/ createMinimalMotionComponent("polyline"); +const MotionRect = /*@__PURE__*/ createMinimalMotionComponent("rect"); +const MotionStop = /*@__PURE__*/ createMinimalMotionComponent("stop"); +const MotionSvg = /*@__PURE__*/ createMinimalMotionComponent("svg"); +const MotionSymbol = /*@__PURE__*/ createMinimalMotionComponent("symbol"); +const MotionText = /*@__PURE__*/ createMinimalMotionComponent("text"); +const MotionTspan = /*@__PURE__*/ createMinimalMotionComponent("tspan"); +const MotionUse = /*@__PURE__*/ createMinimalMotionComponent("use"); +const MotionView = /*@__PURE__*/ createMinimalMotionComponent("view"); +const MotionClipPath = +/*@__PURE__*/ createMinimalMotionComponent("clipPath"); +const MotionFeBlend = +/*@__PURE__*/ createMinimalMotionComponent("feBlend"); +const MotionFeColorMatrix = +/*@__PURE__*/ createMinimalMotionComponent("feColorMatrix"); +const MotionFeComponentTransfer = +/*@__PURE__*/ createMinimalMotionComponent("feComponentTransfer"); +const MotionFeComposite = +/*@__PURE__*/ createMinimalMotionComponent("feComposite"); +const MotionFeConvolveMatrix = +/*@__PURE__*/ createMinimalMotionComponent("feConvolveMatrix"); +const MotionFeDiffuseLighting = +/*@__PURE__*/ createMinimalMotionComponent("feDiffuseLighting"); +const MotionFeDisplacementMap = +/*@__PURE__*/ createMinimalMotionComponent("feDisplacementMap"); +const MotionFeDistantLight = +/*@__PURE__*/ createMinimalMotionComponent("feDistantLight"); +const MotionFeDropShadow = +/*@__PURE__*/ createMinimalMotionComponent("feDropShadow"); +const MotionFeFlood = +/*@__PURE__*/ createMinimalMotionComponent("feFlood"); +const MotionFeFuncA = +/*@__PURE__*/ createMinimalMotionComponent("feFuncA"); +const MotionFeFuncB = +/*@__PURE__*/ createMinimalMotionComponent("feFuncB"); +const MotionFeFuncG = +/*@__PURE__*/ createMinimalMotionComponent("feFuncG"); +const MotionFeFuncR = +/*@__PURE__*/ createMinimalMotionComponent("feFuncR"); +const MotionFeGaussianBlur = +/*@__PURE__*/ createMinimalMotionComponent("feGaussianBlur"); +const MotionFeImage = +/*@__PURE__*/ createMinimalMotionComponent("feImage"); +const MotionFeMerge = +/*@__PURE__*/ createMinimalMotionComponent("feMerge"); +const MotionFeMergeNode = +/*@__PURE__*/ createMinimalMotionComponent("feMergeNode"); +const MotionFeMorphology = +/*@__PURE__*/ createMinimalMotionComponent("feMorphology"); +const MotionFeOffset = +/*@__PURE__*/ createMinimalMotionComponent("feOffset"); +const MotionFePointLight = +/*@__PURE__*/ createMinimalMotionComponent("fePointLight"); +const MotionFeSpecularLighting = +/*@__PURE__*/ createMinimalMotionComponent("feSpecularLighting"); +const MotionFeSpotLight = +/*@__PURE__*/ createMinimalMotionComponent("feSpotLight"); +const MotionFeTile = /*@__PURE__*/ createMinimalMotionComponent("feTile"); +const MotionFeTurbulence = +/*@__PURE__*/ createMinimalMotionComponent("feTurbulence"); +const MotionForeignObject = +/*@__PURE__*/ createMinimalMotionComponent("foreignObject"); +const MotionLinearGradient = +/*@__PURE__*/ createMinimalMotionComponent("linearGradient"); +const MotionRadialGradient = +/*@__PURE__*/ createMinimalMotionComponent("radialGradient"); +const MotionTextPath = +/*@__PURE__*/ createMinimalMotionComponent("textPath"); + +exports.a = MotionA; +exports.abbr = MotionAbbr; +exports.address = MotionAddress; +exports.animate = MotionAnimate; +exports.area = MotionArea; +exports.article = MotionArticle; +exports.aside = MotionAside; +exports.audio = MotionAudio; +exports.b = MotionB; +exports.base = MotionBase; +exports.bdi = MotionBdi; +exports.bdo = MotionBdo; +exports.big = MotionBig; +exports.blockquote = MotionBlockquote; +exports.body = MotionBody; +exports.button = MotionButton; +exports.canvas = MotionCanvas; +exports.caption = MotionCaption; +exports.circle = MotionCircle; +exports.cite = MotionCite; +exports.clipPath = MotionClipPath; +exports.code = MotionCode; +exports.col = MotionCol; +exports.colgroup = MotionColgroup; +exports.create = createMinimalMotionComponent; +exports.data = MotionData; +exports.datalist = MotionDatalist; +exports.dd = MotionDd; +exports.defs = MotionDefs; +exports.del = MotionDel; +exports.desc = MotionDesc; +exports.details = MotionDetails; +exports.dfn = MotionDfn; +exports.dialog = MotionDialog; +exports.div = MotionDiv; +exports.dl = MotionDl; +exports.dt = MotionDt; +exports.ellipse = MotionEllipse; +exports.em = MotionEm; +exports.embed = MotionEmbed; +exports.feBlend = MotionFeBlend; +exports.feColorMatrix = MotionFeColorMatrix; +exports.feComponentTransfer = MotionFeComponentTransfer; +exports.feComposite = MotionFeComposite; +exports.feConvolveMatrix = MotionFeConvolveMatrix; +exports.feDiffuseLighting = MotionFeDiffuseLighting; +exports.feDisplacementMap = MotionFeDisplacementMap; +exports.feDistantLight = MotionFeDistantLight; +exports.feDropShadow = MotionFeDropShadow; +exports.feFlood = MotionFeFlood; +exports.feFuncA = MotionFeFuncA; +exports.feFuncB = MotionFeFuncB; +exports.feFuncG = MotionFeFuncG; +exports.feFuncR = MotionFeFuncR; +exports.feGaussianBlur = MotionFeGaussianBlur; +exports.feImage = MotionFeImage; +exports.feMerge = MotionFeMerge; +exports.feMergeNode = MotionFeMergeNode; +exports.feMorphology = MotionFeMorphology; +exports.feOffset = MotionFeOffset; +exports.fePointLight = MotionFePointLight; +exports.feSpecularLighting = MotionFeSpecularLighting; +exports.feSpotLight = MotionFeSpotLight; +exports.feTile = MotionFeTile; +exports.feTurbulence = MotionFeTurbulence; +exports.fieldset = MotionFieldset; +exports.figcaption = MotionFigcaption; +exports.figure = MotionFigure; +exports.filter = MotionFilter; +exports.footer = MotionFooter; +exports.foreignObject = MotionForeignObject; +exports.form = MotionForm; +exports.g = MotionG; +exports.h1 = MotionH1; +exports.h2 = MotionH2; +exports.h3 = MotionH3; +exports.h4 = MotionH4; +exports.h5 = MotionH5; +exports.h6 = MotionH6; +exports.head = MotionHead; +exports.header = MotionHeader; +exports.hgroup = MotionHgroup; +exports.hr = MotionHr; +exports.html = MotionHtml; +exports.i = MotionI; +exports.iframe = MotionIframe; +exports.image = MotionImage; +exports.img = MotionImg; +exports.input = MotionInput; +exports.ins = MotionIns; +exports.kbd = MotionKbd; +exports.keygen = MotionKeygen; +exports.label = MotionLabel; +exports.legend = MotionLegend; +exports.li = MotionLi; +exports.line = MotionLine; +exports.linearGradient = MotionLinearGradient; +exports.link = MotionLink; +exports.main = MotionMain; +exports.map = MotionMap; +exports.mark = MotionMark; +exports.marker = MotionMarker; +exports.mask = MotionMask; +exports.menu = MotionMenu; +exports.menuitem = MotionMenuitem; +exports.metadata = MotionMetadata; +exports.meter = MotionMeter; +exports.nav = MotionNav; +exports.object = MotionObject; +exports.ol = MotionOl; +exports.optgroup = MotionOptgroup; +exports.option = MotionOption; +exports.output = MotionOutput; +exports.p = MotionP; +exports.param = MotionParam; +exports.path = MotionPath; +exports.pattern = MotionPattern; +exports.picture = MotionPicture; +exports.polygon = MotionPolygon; +exports.polyline = MotionPolyline; +exports.pre = MotionPre; +exports.progress = MotionProgress; +exports.q = MotionQ; +exports.radialGradient = MotionRadialGradient; +exports.rect = MotionRect; +exports.rp = MotionRp; +exports.rt = MotionRt; +exports.ruby = MotionRuby; +exports.s = MotionS; +exports.samp = MotionSamp; +exports.script = MotionScript; +exports.section = MotionSection; +exports.select = MotionSelect; +exports.small = MotionSmall; +exports.source = MotionSource; +exports.span = MotionSpan; +exports.stop = MotionStop; +exports.strong = MotionStrong; +exports.style = MotionStyle; +exports.sub = MotionSub; +exports.summary = MotionSummary; +exports.sup = MotionSup; +exports.svg = MotionSvg; +exports.symbol = MotionSymbol; +exports.table = MotionTable; +exports.tbody = MotionTbody; +exports.td = MotionTd; +exports.text = MotionText; +exports.textPath = MotionTextPath; +exports.textarea = MotionTextarea; +exports.tfoot = MotionTfoot; +exports.th = MotionTh; +exports.thead = MotionThead; +exports.time = MotionTime; +exports.title = MotionTitle; +exports.tr = MotionTr; +exports.track = MotionTrack; +exports.tspan = MotionTspan; +exports.u = MotionU; +exports.ul = MotionUl; +exports.use = MotionUse; +exports.video = MotionVideo; +exports.view = MotionView; +exports.wbr = MotionWbr; +exports.webview = MotionWebview; +//# sourceMappingURL=m.js.map diff --git a/node_modules/framer-motion/dist/cjs/m.js.map b/node_modules/framer-motion/dist/cjs/m.js.map new file mode 100644 index 0000000..9fcc06b --- /dev/null +++ b/node_modules/framer-motion/dist/cjs/m.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m.js","sources":["../../src/render/components/m/create.ts","../../src/render/components/m/elements.ts"],"sourcesContent":["import { createMotionComponent, MotionComponentOptions } from \"../../../motion\"\nimport { DOMMotionComponents } from \"../../dom/types\"\n\nexport function createMinimalMotionComponent<\n Props,\n TagName extends keyof DOMMotionComponents | string = \"div\"\n>(\n Component: TagName | string | React.ComponentType,\n options?: MotionComponentOptions\n) {\n return createMotionComponent(Component, options)\n}\n","\"use client\"\n\nimport { createMinimalMotionComponent } from \"./create\"\n\n/**\n * HTML components\n */\nexport const MotionA = /*@__PURE__*/ createMinimalMotionComponent(\"a\")\nexport const MotionAbbr = /*@__PURE__*/ createMinimalMotionComponent(\"abbr\")\nexport const MotionAddress =\n /*@__PURE__*/ createMinimalMotionComponent(\"address\")\nexport const MotionArea = /*@__PURE__*/ createMinimalMotionComponent(\"area\")\nexport const MotionArticle =\n /*@__PURE__*/ createMinimalMotionComponent(\"article\")\nexport const MotionAside = /*@__PURE__*/ createMinimalMotionComponent(\"aside\")\nexport const MotionAudio = /*@__PURE__*/ createMinimalMotionComponent(\"audio\")\nexport const MotionB = /*@__PURE__*/ createMinimalMotionComponent(\"b\")\nexport const MotionBase = /*@__PURE__*/ createMinimalMotionComponent(\"base\")\nexport const MotionBdi = /*@__PURE__*/ createMinimalMotionComponent(\"bdi\")\nexport const MotionBdo = /*@__PURE__*/ createMinimalMotionComponent(\"bdo\")\nexport const MotionBig = /*@__PURE__*/ createMinimalMotionComponent(\"big\")\nexport const MotionBlockquote =\n /*@__PURE__*/ createMinimalMotionComponent(\"blockquote\")\nexport const MotionBody = /*@__PURE__*/ createMinimalMotionComponent(\"body\")\nexport const MotionButton = /*@__PURE__*/ createMinimalMotionComponent(\"button\")\nexport const MotionCanvas = /*@__PURE__*/ createMinimalMotionComponent(\"canvas\")\nexport const MotionCaption =\n /*@__PURE__*/ createMinimalMotionComponent(\"caption\")\nexport const MotionCite = /*@__PURE__*/ createMinimalMotionComponent(\"cite\")\nexport const MotionCode = /*@__PURE__*/ createMinimalMotionComponent(\"code\")\nexport const MotionCol = /*@__PURE__*/ createMinimalMotionComponent(\"col\")\nexport const MotionColgroup =\n /*@__PURE__*/ createMinimalMotionComponent(\"colgroup\")\nexport const MotionData = /*@__PURE__*/ createMinimalMotionComponent(\"data\")\nexport const MotionDatalist =\n /*@__PURE__*/ createMinimalMotionComponent(\"datalist\")\nexport const MotionDd = /*@__PURE__*/ createMinimalMotionComponent(\"dd\")\nexport const MotionDel = /*@__PURE__*/ createMinimalMotionComponent(\"del\")\nexport const MotionDetails =\n /*@__PURE__*/ createMinimalMotionComponent(\"details\")\nexport const MotionDfn = /*@__PURE__*/ createMinimalMotionComponent(\"dfn\")\nexport const MotionDialog = /*@__PURE__*/ createMinimalMotionComponent(\"dialog\")\nexport const MotionDiv = /*@__PURE__*/ createMinimalMotionComponent(\"div\")\nexport const MotionDl = /*@__PURE__*/ createMinimalMotionComponent(\"dl\")\nexport const MotionDt = /*@__PURE__*/ createMinimalMotionComponent(\"dt\")\nexport const MotionEm = /*@__PURE__*/ createMinimalMotionComponent(\"em\")\nexport const MotionEmbed = /*@__PURE__*/ createMinimalMotionComponent(\"embed\")\nexport const MotionFieldset =\n /*@__PURE__*/ createMinimalMotionComponent(\"fieldset\")\nexport const MotionFigcaption =\n /*@__PURE__*/ createMinimalMotionComponent(\"figcaption\")\nexport const MotionFigure = /*@__PURE__*/ createMinimalMotionComponent(\"figure\")\nexport const MotionFooter = /*@__PURE__*/ createMinimalMotionComponent(\"footer\")\nexport const MotionForm = /*@__PURE__*/ createMinimalMotionComponent(\"form\")\nexport const MotionH1 = /*@__PURE__*/ createMinimalMotionComponent(\"h1\")\nexport const MotionH2 = /*@__PURE__*/ createMinimalMotionComponent(\"h2\")\nexport const MotionH3 = /*@__PURE__*/ createMinimalMotionComponent(\"h3\")\nexport const MotionH4 = /*@__PURE__*/ createMinimalMotionComponent(\"h4\")\nexport const MotionH5 = /*@__PURE__*/ createMinimalMotionComponent(\"h5\")\nexport const MotionH6 = /*@__PURE__*/ createMinimalMotionComponent(\"h6\")\nexport const MotionHead = /*@__PURE__*/ createMinimalMotionComponent(\"head\")\nexport const MotionHeader = /*@__PURE__*/ createMinimalMotionComponent(\"header\")\nexport const MotionHgroup = /*@__PURE__*/ createMinimalMotionComponent(\"hgroup\")\nexport const MotionHr = /*@__PURE__*/ createMinimalMotionComponent(\"hr\")\nexport const MotionHtml = /*@__PURE__*/ createMinimalMotionComponent(\"html\")\nexport const MotionI = /*@__PURE__*/ createMinimalMotionComponent(\"i\")\nexport const MotionIframe = /*@__PURE__*/ createMinimalMotionComponent(\"iframe\")\nexport const MotionImg = /*@__PURE__*/ createMinimalMotionComponent(\"img\")\nexport const MotionInput = /*@__PURE__*/ createMinimalMotionComponent(\"input\")\nexport const MotionIns = /*@__PURE__*/ createMinimalMotionComponent(\"ins\")\nexport const MotionKbd = /*@__PURE__*/ createMinimalMotionComponent(\"kbd\")\nexport const MotionKeygen = /*@__PURE__*/ createMinimalMotionComponent(\"keygen\")\nexport const MotionLabel = /*@__PURE__*/ createMinimalMotionComponent(\"label\")\nexport const MotionLegend = /*@__PURE__*/ createMinimalMotionComponent(\"legend\")\nexport const MotionLi = /*@__PURE__*/ createMinimalMotionComponent(\"li\")\nexport const MotionLink = /*@__PURE__*/ createMinimalMotionComponent(\"link\")\nexport const MotionMain = /*@__PURE__*/ createMinimalMotionComponent(\"main\")\nexport const MotionMap = /*@__PURE__*/ createMinimalMotionComponent(\"map\")\nexport const MotionMark = /*@__PURE__*/ createMinimalMotionComponent(\"mark\")\nexport const MotionMenu = /*@__PURE__*/ createMinimalMotionComponent(\"menu\")\nexport const MotionMenuitem =\n /*@__PURE__*/ createMinimalMotionComponent(\"menuitem\")\nexport const MotionMeter = /*@__PURE__*/ createMinimalMotionComponent(\"meter\")\nexport const MotionNav = /*@__PURE__*/ createMinimalMotionComponent(\"nav\")\nexport const MotionObject = /*@__PURE__*/ createMinimalMotionComponent(\"object\")\nexport const MotionOl = /*@__PURE__*/ createMinimalMotionComponent(\"ol\")\nexport const MotionOptgroup =\n /*@__PURE__*/ createMinimalMotionComponent(\"optgroup\")\nexport const MotionOption = /*@__PURE__*/ createMinimalMotionComponent(\"option\")\nexport const MotionOutput = /*@__PURE__*/ createMinimalMotionComponent(\"output\")\nexport const MotionP = /*@__PURE__*/ createMinimalMotionComponent(\"p\")\nexport const MotionParam = /*@__PURE__*/ createMinimalMotionComponent(\"param\")\nexport const MotionPicture =\n /*@__PURE__*/ createMinimalMotionComponent(\"picture\")\nexport const MotionPre = /*@__PURE__*/ createMinimalMotionComponent(\"pre\")\nexport const MotionProgress =\n /*@__PURE__*/ createMinimalMotionComponent(\"progress\")\nexport const MotionQ = /*@__PURE__*/ createMinimalMotionComponent(\"q\")\nexport const MotionRp = /*@__PURE__*/ createMinimalMotionComponent(\"rp\")\nexport const MotionRt = /*@__PURE__*/ createMinimalMotionComponent(\"rt\")\nexport const MotionRuby = /*@__PURE__*/ createMinimalMotionComponent(\"ruby\")\nexport const MotionS = /*@__PURE__*/ createMinimalMotionComponent(\"s\")\nexport const MotionSamp = /*@__PURE__*/ createMinimalMotionComponent(\"samp\")\nexport const MotionScript = /*@__PURE__*/ createMinimalMotionComponent(\"script\")\nexport const MotionSection =\n /*@__PURE__*/ createMinimalMotionComponent(\"section\")\nexport const MotionSelect = /*@__PURE__*/ createMinimalMotionComponent(\"select\")\nexport const MotionSmall = /*@__PURE__*/ createMinimalMotionComponent(\"small\")\nexport const MotionSource = /*@__PURE__*/ createMinimalMotionComponent(\"source\")\nexport const MotionSpan = /*@__PURE__*/ createMinimalMotionComponent(\"span\")\nexport const MotionStrong = /*@__PURE__*/ createMinimalMotionComponent(\"strong\")\nexport const MotionStyle = /*@__PURE__*/ createMinimalMotionComponent(\"style\")\nexport const MotionSub = /*@__PURE__*/ createMinimalMotionComponent(\"sub\")\nexport const MotionSummary =\n /*@__PURE__*/ createMinimalMotionComponent(\"summary\")\nexport const MotionSup = /*@__PURE__*/ createMinimalMotionComponent(\"sup\")\nexport const MotionTable = /*@__PURE__*/ createMinimalMotionComponent(\"table\")\nexport const MotionTbody = /*@__PURE__*/ createMinimalMotionComponent(\"tbody\")\nexport const MotionTd = /*@__PURE__*/ createMinimalMotionComponent(\"td\")\nexport const MotionTextarea =\n /*@__PURE__*/ createMinimalMotionComponent(\"textarea\")\nexport const MotionTfoot = /*@__PURE__*/ createMinimalMotionComponent(\"tfoot\")\nexport const MotionTh = /*@__PURE__*/ createMinimalMotionComponent(\"th\")\nexport const MotionThead = /*@__PURE__*/ createMinimalMotionComponent(\"thead\")\nexport const MotionTime = /*@__PURE__*/ createMinimalMotionComponent(\"time\")\nexport const MotionTitle = /*@__PURE__*/ createMinimalMotionComponent(\"title\")\nexport const MotionTr = /*@__PURE__*/ createMinimalMotionComponent(\"tr\")\nexport const MotionTrack = /*@__PURE__*/ createMinimalMotionComponent(\"track\")\nexport const MotionU = /*@__PURE__*/ createMinimalMotionComponent(\"u\")\nexport const MotionUl = /*@__PURE__*/ createMinimalMotionComponent(\"ul\")\nexport const MotionVideo = /*@__PURE__*/ createMinimalMotionComponent(\"video\")\nexport const MotionWbr = /*@__PURE__*/ createMinimalMotionComponent(\"wbr\")\nexport const MotionWebview =\n /*@__PURE__*/ createMinimalMotionComponent(\"webview\")\n\n/**\n * SVG components\n */\nexport const MotionAnimate =\n /*@__PURE__*/ createMinimalMotionComponent(\"animate\")\nexport const MotionCircle = /*@__PURE__*/ createMinimalMotionComponent(\"circle\")\nexport const MotionDefs = /*@__PURE__*/ createMinimalMotionComponent(\"defs\")\nexport const MotionDesc = /*@__PURE__*/ createMinimalMotionComponent(\"desc\")\nexport const MotionEllipse =\n /*@__PURE__*/ createMinimalMotionComponent(\"ellipse\")\nexport const MotionG = /*@__PURE__*/ createMinimalMotionComponent(\"g\")\nexport const MotionImage = /*@__PURE__*/ createMinimalMotionComponent(\"image\")\nexport const MotionLine = /*@__PURE__*/ createMinimalMotionComponent(\"line\")\nexport const MotionFilter = /*@__PURE__*/ createMinimalMotionComponent(\"filter\")\nexport const MotionMarker = /*@__PURE__*/ createMinimalMotionComponent(\"marker\")\nexport const MotionMask = /*@__PURE__*/ createMinimalMotionComponent(\"mask\")\nexport const MotionMetadata =\n /*@__PURE__*/ createMinimalMotionComponent(\"metadata\")\nexport const MotionPath = /*@__PURE__*/ createMinimalMotionComponent(\"path\")\nexport const MotionPattern =\n /*@__PURE__*/ createMinimalMotionComponent(\"pattern\")\nexport const MotionPolygon =\n /*@__PURE__*/ createMinimalMotionComponent(\"polygon\")\nexport const MotionPolyline =\n /*@__PURE__*/ createMinimalMotionComponent(\"polyline\")\nexport const MotionRect = /*@__PURE__*/ createMinimalMotionComponent(\"rect\")\nexport const MotionStop = /*@__PURE__*/ createMinimalMotionComponent(\"stop\")\nexport const MotionSvg = /*@__PURE__*/ createMinimalMotionComponent(\"svg\")\nexport const MotionSymbol = /*@__PURE__*/ createMinimalMotionComponent(\"symbol\")\nexport const MotionText = /*@__PURE__*/ createMinimalMotionComponent(\"text\")\nexport const MotionTspan = /*@__PURE__*/ createMinimalMotionComponent(\"tspan\")\nexport const MotionUse = /*@__PURE__*/ createMinimalMotionComponent(\"use\")\nexport const MotionView = /*@__PURE__*/ createMinimalMotionComponent(\"view\")\nexport const MotionClipPath =\n /*@__PURE__*/ createMinimalMotionComponent(\"clipPath\")\nexport const MotionFeBlend =\n /*@__PURE__*/ createMinimalMotionComponent(\"feBlend\")\nexport const MotionFeColorMatrix =\n /*@__PURE__*/ createMinimalMotionComponent(\"feColorMatrix\")\nexport const MotionFeComponentTransfer =\n /*@__PURE__*/ createMinimalMotionComponent(\"feComponentTransfer\")\nexport const MotionFeComposite =\n /*@__PURE__*/ createMinimalMotionComponent(\"feComposite\")\nexport const MotionFeConvolveMatrix =\n /*@__PURE__*/ createMinimalMotionComponent(\"feConvolveMatrix\")\nexport const MotionFeDiffuseLighting =\n /*@__PURE__*/ createMinimalMotionComponent(\"feDiffuseLighting\")\nexport const MotionFeDisplacementMap =\n /*@__PURE__*/ createMinimalMotionComponent(\"feDisplacementMap\")\nexport const MotionFeDistantLight =\n /*@__PURE__*/ createMinimalMotionComponent(\"feDistantLight\")\nexport const MotionFeDropShadow =\n /*@__PURE__*/ createMinimalMotionComponent(\"feDropShadow\")\nexport const MotionFeFlood =\n /*@__PURE__*/ createMinimalMotionComponent(\"feFlood\")\nexport const MotionFeFuncA =\n /*@__PURE__*/ createMinimalMotionComponent(\"feFuncA\")\nexport const MotionFeFuncB =\n /*@__PURE__*/ createMinimalMotionComponent(\"feFuncB\")\nexport const MotionFeFuncG =\n /*@__PURE__*/ createMinimalMotionComponent(\"feFuncG\")\nexport const MotionFeFuncR =\n /*@__PURE__*/ createMinimalMotionComponent(\"feFuncR\")\nexport const MotionFeGaussianBlur =\n /*@__PURE__*/ createMinimalMotionComponent(\"feGaussianBlur\")\nexport const MotionFeImage =\n /*@__PURE__*/ createMinimalMotionComponent(\"feImage\")\nexport const MotionFeMerge =\n /*@__PURE__*/ createMinimalMotionComponent(\"feMerge\")\nexport const MotionFeMergeNode =\n /*@__PURE__*/ createMinimalMotionComponent(\"feMergeNode\")\nexport const MotionFeMorphology =\n /*@__PURE__*/ createMinimalMotionComponent(\"feMorphology\")\nexport const MotionFeOffset =\n /*@__PURE__*/ createMinimalMotionComponent(\"feOffset\")\nexport const MotionFePointLight =\n /*@__PURE__*/ createMinimalMotionComponent(\"fePointLight\")\nexport const MotionFeSpecularLighting =\n /*@__PURE__*/ createMinimalMotionComponent(\"feSpecularLighting\")\nexport const MotionFeSpotLight =\n /*@__PURE__*/ createMinimalMotionComponent(\"feSpotLight\")\nexport const MotionFeTile = /*@__PURE__*/ createMinimalMotionComponent(\"feTile\")\nexport const MotionFeTurbulence =\n /*@__PURE__*/ createMinimalMotionComponent(\"feTurbulence\")\nexport const MotionForeignObject =\n /*@__PURE__*/ createMinimalMotionComponent(\"foreignObject\")\nexport const MotionLinearGradient =\n /*@__PURE__*/ createMinimalMotionComponent(\"linearGradient\")\nexport const MotionRadialGradient =\n /*@__PURE__*/ createMinimalMotionComponent(\"radialGradient\")\nexport const MotionTextPath =\n /*@__PURE__*/ createMinimalMotionComponent(\"textPath\")\n"],"names":["createMotionComponent"],"mappings":";;;;;;;;;;AAGM,SAAU,4BAA4B,CAIxC,SAAwD,EACxD,OAAgC,EAAA;AAEhC,IAAA,OAAOA,2BAAqB,CAAC,SAAS,EAAE,OAAO,CAAC;AACpD;;ACPA;;AAEG;AACI,MAAM,OAAO,iBAAiB,4BAA4B,CAAC,GAAG;AAC9D,MAAM,UAAU,iBAAiB,4BAA4B,CAAC,MAAM;MAC9D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iBAAiB,4BAA4B,CAAC,QAAQ;MAClE,kBAAkB;AAC3B,cAAc,4BAA4B,CAAC,cAAc;MAChD,mBAAmB;AAC5B,cAAc,4BAA4B,CAAC,eAAe;MACjD,oBAAoB;AAC7B,cAAc,4BAA4B,CAAC,gBAAgB;MAClD,oBAAoB;AAC7B,cAAc,4BAA4B,CAAC,gBAAgB;MAClD,cAAc;AACvB,cAAc,4BAA4B,CAAC,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/cjs/mini.js b/node_modules/framer-motion/dist/cjs/mini.js new file mode 100644 index 0000000..d00b5e1 --- /dev/null +++ b/node_modules/framer-motion/dist/cjs/mini.js @@ -0,0 +1,153 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var react = require('react'); +var motionDom = require('motion-dom'); +var motionUtils = require('motion-utils'); + +/** + * Creates a constant value over the lifecycle of a component. + * + * Even if `useMemo` is provided an empty array as its final argument, it doesn't offer + * a guarantee that it won't re-run for performance reasons later on. By using `useConstant` + * you can ensure that initialisers don't execute twice or more. + */ +function useConstant(init) { + const ref = react.useRef(null); + if (ref.current === null) { + ref.current = init(); + } + return ref.current; +} + +function useUnmountEffect(callback) { + return react.useEffect(() => () => callback(), []); +} + +function animateElements(elementOrSelector, keyframes, options, scope) { + // Gracefully handle null/undefined elements (e.g., from querySelector returning null) + if (elementOrSelector == null) { + return []; + } + const elements = motionDom.resolveElements(elementOrSelector, scope); + const numElements = elements.length; + motionUtils.invariant(Boolean(numElements), "No valid elements provided.", "no-valid-elements"); + /** + * WAAPI doesn't support interrupting animations. + * + * Therefore, starting animations requires a three-step process: + * 1. Stop existing animations (write styles to DOM) + * 2. Resolve keyframes (read styles from DOM) + * 3. Create new animations (write styles to DOM) + * + * The hybrid `animate()` function uses AsyncAnimation to resolve + * keyframes before creating new animations, which removes style + * thrashing. Here, we have much stricter filesize constraints. + * Therefore we do this in a synchronous way that ensures that + * at least within `animate()` calls there is no style thrashing. + * + * In the motion-native-animate-mini-interrupt benchmark this + * was 80% faster than a single loop. + */ + const animationDefinitions = []; + /** + * Step 1: Build options and stop existing animations (write) + */ + for (let i = 0; i < numElements; i++) { + const element = elements[i]; + const elementTransition = { ...options }; + /** + * Resolve stagger function if provided. + */ + if (typeof elementTransition.delay === "function") { + elementTransition.delay = elementTransition.delay(i, numElements); + } + for (const valueName in keyframes) { + let valueKeyframes = keyframes[valueName]; + if (!Array.isArray(valueKeyframes)) { + valueKeyframes = [valueKeyframes]; + } + const valueOptions = { + ...motionDom.getValueTransition(elementTransition, valueName), + }; + valueOptions.duration && (valueOptions.duration = motionUtils.secondsToMilliseconds(valueOptions.duration)); + valueOptions.delay && (valueOptions.delay = motionUtils.secondsToMilliseconds(valueOptions.delay)); + /** + * If there's an existing animation playing on this element then stop it + * before creating a new one. + */ + const map = motionDom.getAnimationMap(element); + const key = motionDom.animationMapKey(valueName, valueOptions.pseudoElement || ""); + const currentAnimation = map.get(key); + currentAnimation && currentAnimation.stop(); + animationDefinitions.push({ + map, + key, + unresolvedKeyframes: valueKeyframes, + options: { + ...valueOptions, + element, + name: valueName, + allowFlatten: !elementTransition.type && !elementTransition.ease, + }, + }); + } + } + /** + * Step 2: Resolve keyframes (read) + */ + for (let i = 0; i < animationDefinitions.length; i++) { + const { unresolvedKeyframes, options: animationOptions } = animationDefinitions[i]; + const { element, name, pseudoElement } = animationOptions; + if (!pseudoElement && unresolvedKeyframes[0] === null) { + unresolvedKeyframes[0] = motionDom.getComputedStyle(element, name); + } + motionDom.fillWildcards(unresolvedKeyframes); + motionDom.applyPxDefaults(unresolvedKeyframes, name); + /** + * If we only have one keyframe, explicitly read the initial keyframe + * from the computed style. This is to ensure consistency with WAAPI behaviour + * for restarting animations, for instance .play() after finish, when it + * has one vs two keyframes. + */ + if (!pseudoElement && unresolvedKeyframes.length < 2) { + unresolvedKeyframes.unshift(motionDom.getComputedStyle(element, name)); + } + animationOptions.keyframes = unresolvedKeyframes; + } + /** + * Step 3: Create new animations (write) + */ + const animations = []; + for (let i = 0; i < animationDefinitions.length; i++) { + const { map, key, options: animationOptions } = animationDefinitions[i]; + const animation = new motionDom.NativeAnimation(animationOptions); + map.set(key, animation); + animation.finished.finally(() => map.delete(key)); + animations.push(animation); + } + return animations; +} + +const createScopedWaapiAnimate = (scope) => { + function scopedAnimate(elementOrSelector, keyframes, options) { + return new motionDom.GroupAnimationWithThen(animateElements(elementOrSelector, keyframes, options, scope)); + } + return scopedAnimate; +}; + +function useAnimateMini() { + const scope = useConstant(() => ({ + current: null, // Will be hydrated by React + animations: [], + })); + const animate = useConstant(() => createScopedWaapiAnimate(scope)); + useUnmountEffect(() => { + scope.animations.forEach((animation) => animation.stop()); + }); + return [scope, animate]; +} + +exports.useAnimate = useAnimateMini; +//# sourceMappingURL=mini.js.map diff --git a/node_modules/framer-motion/dist/cjs/mini.js.map b/node_modules/framer-motion/dist/cjs/mini.js.map new file mode 100644 index 0000000..bc1c077 --- /dev/null +++ b/node_modules/framer-motion/dist/cjs/mini.js.map @@ -0,0 +1 @@ +{"version":3,"file":"mini.js","sources":["../../src/utils/use-constant.ts","../../src/utils/use-unmount-effect.ts","../../src/animation/animators/waapi/animate-elements.ts","../../src/animation/animators/waapi/animate-style.ts","../../src/animation/hooks/use-animate-style.ts"],"sourcesContent":["\"use client\"\n\nimport { useRef } from \"react\"\n\ntype Init = () => T\n\n/**\n * Creates a constant value over the lifecycle of a component.\n *\n * Even if `useMemo` is provided an empty array as its final argument, it doesn't offer\n * a guarantee that it won't re-run for performance reasons later on. By using `useConstant`\n * you can ensure that initialisers don't execute twice or more.\n */\nexport function useConstant(init: Init) {\n const ref = useRef(null)\n\n if (ref.current === null) {\n ref.current = init()\n }\n\n return ref.current\n}\n","\"use client\"\n\nimport { useEffect } from \"react\"\n\nexport function useUnmountEffect(callback: () => void) {\n return useEffect(() => () => callback(), [])\n}\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>\n key: string\n unresolvedKeyframes: UnresolvedValueKeyframe[]\n options: Omit & {\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","\"use client\"\n\nimport { useConstant } from \"../../utils/use-constant\"\nimport { useUnmountEffect } from \"../../utils/use-unmount-effect\"\nimport { createScopedWaapiAnimate } from \"../animators/waapi/animate-style\"\nimport { AnimationScope } from \"motion-dom\"\n\nexport function useAnimateMini() {\n const scope: AnimationScope = useConstant(() => ({\n current: null!, // Will be hydrated by React\n animations: [],\n }))\n\n const animate = useConstant(() => createScopedWaapiAnimate(scope))\n\n useUnmountEffect(() => {\n scope.animations.forEach((animation) => animation.stop())\n })\n\n return [scope, animate] as [AnimationScope, typeof animate]\n}\n"],"names":["useRef","useEffect","resolveElements","invariant","getValueTransition","secondsToMilliseconds","getAnimationMap","animationMapKey","getComputedStyle","fillWildcards","applyPxDefaults","NativeAnimation","GroupAnimationWithThen"],"mappings":";;;;;;;;AAMA;;;;;;AAMG;AACG,SAAU,WAAW,CAAI,IAAa,EAAA;AACxC,IAAA,MAAM,GAAG,GAAGA,YAAM,CAAW,IAAI,CAAC;AAElC,IAAA,IAAI,GAAG,C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ACL;AAEA,IAAA,OAAO,aAAa;AACxB,CAAC;;SCpBe,cAAc,GAAA;AAC1B,IAAA,MAAM,KAAK,GAAsB,WAAW,CAAC,OAAO;QAChD,OAAO,EAAE,IAAK;AACd,QAAA,UAAU,EAAE,EAAE;AACjB,KAAA,CAAC,CAAC;AAEH,IAAA,MAAM,OAAO,GAAG,WAAW,CAAC,MAAM,wBAAwB,CAAC,KAAK,CAAC,CAAC;IAElE,gBAAgB,CAAC,MAAK;AAClB,QAAA,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,SAAS,KAAK,SAAS,CAAC,IAAI,EAAE,CAAC;AAC7D,IAAA,CAAC,CAAC;AAEF,IAAA,OAAO,CAAC,KAAK,EAAE,OAAO,CAAwC;AAClE;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/client.d.ts b/node_modules/framer-motion/dist/client.d.ts new file mode 100644 index 0000000..9781baf --- /dev/null +++ b/node_modules/framer-motion/dist/client.d.ts @@ -0,0 +1,367 @@ +import { CSSProperties, PropsWithoutRef, RefAttributes, JSX, SVGAttributes } from 'react'; +import { MotionNodeOptions, MotionValue, TransformProperties, SVGPathProperties } from 'motion-dom'; + +type MotionValueString = MotionValue; +type MotionValueNumber = MotionValue; +type MotionValueAny = MotionValue; +type AnyMotionValue = MotionValueNumber | MotionValueString | MotionValueAny; +type MotionValueHelper = T | AnyMotionValue; +type MakeMotionHelper = { + [K in keyof T]: MotionValueHelper; +}; +type MakeCustomValueTypeHelper = MakeMotionHelper; +type MakeMotion = MakeCustomValueTypeHelper; +type MotionCSS = MakeMotion>; +/** + * @public + */ +type MotionTransform = MakeMotion; +type MotionSVGProps = MakeMotion; +/** + * @public + */ +interface MotionStyle$1 extends MotionCSS, MotionTransform, MotionSVGProps { +} +/** + * Props for `motion` components. + * + * @public + */ +interface MotionProps extends MotionNodeOptions { + /** + * + * The React DOM `style` prop, enhanced with support for `MotionValue`s and separate `transform` values. + * + * ```jsx + * export const MyComponent = () => { + * const x = useMotionValue(0) + * + * return + * } + * ``` + */ + style?: MotionStyle$1; + children?: React.ReactNode | MotionValueNumber | MotionValueString; +} + +interface HTMLElements { + a: HTMLAnchorElement; + abbr: HTMLElement; + address: HTMLElement; + area: HTMLAreaElement; + article: HTMLElement; + aside: HTMLElement; + audio: HTMLAudioElement; + b: HTMLElement; + base: HTMLBaseElement; + bdi: HTMLElement; + bdo: HTMLElement; + big: HTMLElement; + blockquote: HTMLQuoteElement; + body: HTMLBodyElement; + br: HTMLBRElement; + button: HTMLButtonElement; + canvas: HTMLCanvasElement; + caption: HTMLElement; + center: HTMLElement; + cite: HTMLElement; + code: HTMLElement; + col: HTMLTableColElement; + colgroup: HTMLTableColElement; + data: HTMLDataElement; + datalist: HTMLDataListElement; + dd: HTMLElement; + del: HTMLModElement; + details: HTMLDetailsElement; + dfn: HTMLElement; + dialog: HTMLDialogElement; + div: HTMLDivElement; + dl: HTMLDListElement; + dt: HTMLElement; + em: HTMLElement; + embed: HTMLEmbedElement; + fieldset: HTMLFieldSetElement; + figcaption: HTMLElement; + figure: HTMLElement; + footer: HTMLElement; + form: HTMLFormElement; + h1: HTMLHeadingElement; + h2: HTMLHeadingElement; + h3: HTMLHeadingElement; + h4: HTMLHeadingElement; + h5: HTMLHeadingElement; + h6: HTMLHeadingElement; + head: HTMLHeadElement; + header: HTMLElement; + hgroup: HTMLElement; + hr: HTMLHRElement; + html: HTMLHtmlElement; + i: HTMLElement; + iframe: HTMLIFrameElement; + img: HTMLImageElement; + input: HTMLInputElement; + ins: HTMLModElement; + kbd: HTMLElement; + keygen: HTMLElement; + label: HTMLLabelElement; + legend: HTMLLegendElement; + li: HTMLLIElement; + link: HTMLLinkElement; + main: HTMLElement; + map: HTMLMapElement; + mark: HTMLElement; + menu: HTMLElement; + menuitem: HTMLElement; + meta: HTMLMetaElement; + meter: HTMLMeterElement; + nav: HTMLElement; + noindex: HTMLElement; + noscript: HTMLElement; + object: HTMLObjectElement; + ol: HTMLOListElement; + optgroup: HTMLOptGroupElement; + option: HTMLOptionElement; + output: HTMLOutputElement; + p: HTMLParagraphElement; + param: HTMLParamElement; + picture: HTMLElement; + pre: HTMLPreElement; + progress: HTMLProgressElement; + q: HTMLQuoteElement; + rp: HTMLElement; + rt: HTMLElement; + ruby: HTMLElement; + s: HTMLElement; + samp: HTMLElement; + search: HTMLElement; + slot: HTMLSlotElement; + script: HTMLScriptElement; + section: HTMLElement; + select: HTMLSelectElement; + small: HTMLElement; + source: HTMLSourceElement; + span: HTMLSpanElement; + strong: HTMLElement; + style: HTMLStyleElement; + sub: HTMLElement; + summary: HTMLElement; + sup: HTMLElement; + table: HTMLTableElement; + template: HTMLTemplateElement; + tbody: HTMLTableSectionElement; + td: HTMLTableDataCellElement; + textarea: HTMLTextAreaElement; + tfoot: HTMLTableSectionElement; + th: HTMLTableHeaderCellElement; + thead: HTMLTableSectionElement; + time: HTMLTimeElement; + title: HTMLTitleElement; + tr: HTMLTableRowElement; + track: HTMLTrackElement; + u: HTMLElement; + ul: HTMLUListElement; + var: HTMLElement; + video: HTMLVideoElement; + wbr: HTMLElement; + webview: HTMLWebViewElement; +} + +/** + * @public + */ +type ForwardRefComponent = { + readonly $$typeof: symbol; +} & ((props: PropsWithoutRef

& RefAttributes) => JSX.Element); +type AttributesWithoutMotionProps = { + [K in Exclude]?: Attributes[K]; +}; +/** + * @public + */ +type HTMLMotionProps = AttributesWithoutMotionProps & MotionProps; + +interface SVGAttributesWithoutMotionProps extends Pick, Exclude, keyof MotionProps>> { +} +/** + * Blanket-accept any SVG attribute as a `MotionValue` + * @public + */ +type SVGAttributesAsMotionValues = MakeMotion>; +/** + * @public + */ +interface SVGMotionProps extends SVGAttributesAsMotionValues, MotionProps { +} + +/** + * HTML components + */ +declare const MotionA: ForwardRefComponent>; +declare const MotionAbbr: ForwardRefComponent>; +declare const MotionAddress: ForwardRefComponent>; +declare const MotionArea: ForwardRefComponent>; +declare const MotionArticle: ForwardRefComponent>; +declare const MotionAside: ForwardRefComponent>; +declare const MotionAudio: ForwardRefComponent>; +declare const MotionB: ForwardRefComponent>; +declare const MotionBase: ForwardRefComponent>; +declare const MotionBdi: ForwardRefComponent>; +declare const MotionBdo: ForwardRefComponent>; +declare const MotionBig: ForwardRefComponent>; +declare const MotionBlockquote: ForwardRefComponent>; +declare const MotionBody: ForwardRefComponent>; +declare const MotionButton: ForwardRefComponent>; +declare const MotionCanvas: ForwardRefComponent>; +declare const MotionCaption: ForwardRefComponent>; +declare const MotionCite: ForwardRefComponent>; +declare const MotionCode: ForwardRefComponent>; +declare const MotionCol: ForwardRefComponent>; +declare const MotionColgroup: ForwardRefComponent>; +declare const MotionData: ForwardRefComponent>; +declare const MotionDatalist: ForwardRefComponent>; +declare const MotionDd: ForwardRefComponent>; +declare const MotionDel: ForwardRefComponent>; +declare const MotionDetails: ForwardRefComponent>; +declare const MotionDfn: ForwardRefComponent>; +declare const MotionDialog: ForwardRefComponent>; +declare const MotionDiv: ForwardRefComponent>; +declare const MotionDl: ForwardRefComponent>; +declare const MotionDt: ForwardRefComponent>; +declare const MotionEm: ForwardRefComponent>; +declare const MotionEmbed: ForwardRefComponent>; +declare const MotionFieldset: ForwardRefComponent>; +declare const MotionFigcaption: ForwardRefComponent>; +declare const MotionFigure: ForwardRefComponent>; +declare const MotionFooter: ForwardRefComponent>; +declare const MotionForm: ForwardRefComponent>; +declare const MotionH1: ForwardRefComponent>; +declare const MotionH2: ForwardRefComponent>; +declare const MotionH3: ForwardRefComponent>; +declare const MotionH4: ForwardRefComponent>; +declare const MotionH5: ForwardRefComponent>; +declare const MotionH6: ForwardRefComponent>; +declare const MotionHead: ForwardRefComponent>; +declare const MotionHeader: ForwardRefComponent>; +declare const MotionHgroup: ForwardRefComponent>; +declare const MotionHr: ForwardRefComponent>; +declare const MotionHtml: ForwardRefComponent>; +declare const MotionI: ForwardRefComponent>; +declare const MotionIframe: ForwardRefComponent>; +declare const MotionImg: ForwardRefComponent>; +declare const MotionInput: ForwardRefComponent>; +declare const MotionIns: ForwardRefComponent>; +declare const MotionKbd: ForwardRefComponent>; +declare const MotionKeygen: ForwardRefComponent>; +declare const MotionLabel: ForwardRefComponent>; +declare const MotionLegend: ForwardRefComponent>; +declare const MotionLi: ForwardRefComponent>; +declare const MotionLink: ForwardRefComponent>; +declare const MotionMain: ForwardRefComponent>; +declare const MotionMap: ForwardRefComponent>; +declare const MotionMark: ForwardRefComponent>; +declare const MotionMenu: ForwardRefComponent>; +declare const MotionMenuitem: ForwardRefComponent>; +declare const MotionMeter: ForwardRefComponent>; +declare const MotionNav: ForwardRefComponent>; +declare const MotionObject: ForwardRefComponent>; +declare const MotionOl: ForwardRefComponent>; +declare const MotionOptgroup: ForwardRefComponent>; +declare const MotionOption: ForwardRefComponent>; +declare const MotionOutput: ForwardRefComponent>; +declare const MotionP: ForwardRefComponent>; +declare const MotionParam: ForwardRefComponent>; +declare const MotionPicture: ForwardRefComponent>; +declare const MotionPre: ForwardRefComponent>; +declare const MotionProgress: ForwardRefComponent>; +declare const MotionQ: ForwardRefComponent>; +declare const MotionRp: ForwardRefComponent>; +declare const MotionRt: ForwardRefComponent>; +declare const MotionRuby: ForwardRefComponent>; +declare const MotionS: ForwardRefComponent>; +declare const MotionSamp: ForwardRefComponent>; +declare const MotionScript: ForwardRefComponent>; +declare const MotionSection: ForwardRefComponent>; +declare const MotionSelect: ForwardRefComponent>; +declare const MotionSmall: ForwardRefComponent>; +declare const MotionSource: ForwardRefComponent>; +declare const MotionSpan: ForwardRefComponent>; +declare const MotionStrong: ForwardRefComponent>; +declare const MotionStyle: ForwardRefComponent>; +declare const MotionSub: ForwardRefComponent>; +declare const MotionSummary: ForwardRefComponent>; +declare const MotionSup: ForwardRefComponent>; +declare const MotionTable: ForwardRefComponent>; +declare const MotionTbody: ForwardRefComponent>; +declare const MotionTd: ForwardRefComponent>; +declare const MotionTextarea: ForwardRefComponent>; +declare const MotionTfoot: ForwardRefComponent>; +declare const MotionTh: ForwardRefComponent>; +declare const MotionThead: ForwardRefComponent>; +declare const MotionTime: ForwardRefComponent>; +declare const MotionTitle: ForwardRefComponent>; +declare const MotionTr: ForwardRefComponent>; +declare const MotionTrack: ForwardRefComponent>; +declare const MotionU: ForwardRefComponent>; +declare const MotionUl: ForwardRefComponent>; +declare const MotionVideo: ForwardRefComponent>; +declare const MotionWbr: ForwardRefComponent>; +declare const MotionWebview: ForwardRefComponent>; +/** + * SVG components + */ +declare const MotionAnimate: ForwardRefComponent>; +declare const MotionCircle: ForwardRefComponent>; +declare const MotionDefs: ForwardRefComponent>; +declare const MotionDesc: ForwardRefComponent>; +declare const MotionEllipse: ForwardRefComponent>; +declare const MotionG: ForwardRefComponent>; +declare const MotionImage: ForwardRefComponent>; +declare const MotionLine: ForwardRefComponent>; +declare const MotionFilter: ForwardRefComponent>; +declare const MotionMarker: ForwardRefComponent>; +declare const MotionMask: ForwardRefComponent>; +declare const MotionMetadata: ForwardRefComponent>; +declare const MotionPath: ForwardRefComponent>; +declare const MotionPattern: ForwardRefComponent>; +declare const MotionPolygon: ForwardRefComponent>; +declare const MotionPolyline: ForwardRefComponent>; +declare const MotionRect: ForwardRefComponent>; +declare const MotionStop: ForwardRefComponent>; +declare const MotionSvg: ForwardRefComponent>; +declare const MotionSymbol: ForwardRefComponent>; +declare const MotionText: ForwardRefComponent>; +declare const MotionTspan: ForwardRefComponent>; +declare const MotionUse: ForwardRefComponent>; +declare const MotionView: ForwardRefComponent>; +declare const MotionClipPath: ForwardRefComponent>; +declare const MotionFeBlend: ForwardRefComponent>; +declare const MotionFeColorMatrix: ForwardRefComponent>; +declare const MotionFeComponentTransfer: ForwardRefComponent>; +declare const MotionFeComposite: ForwardRefComponent>; +declare const MotionFeConvolveMatrix: ForwardRefComponent>; +declare const MotionFeDiffuseLighting: ForwardRefComponent>; +declare const MotionFeDisplacementMap: ForwardRefComponent>; +declare const MotionFeDistantLight: ForwardRefComponent>; +declare const MotionFeDropShadow: ForwardRefComponent>; +declare const MotionFeFlood: ForwardRefComponent>; +declare const MotionFeFuncA: ForwardRefComponent>; +declare const MotionFeFuncB: ForwardRefComponent>; +declare const MotionFeFuncG: ForwardRefComponent>; +declare const MotionFeFuncR: ForwardRefComponent>; +declare const MotionFeGaussianBlur: ForwardRefComponent>; +declare const MotionFeImage: ForwardRefComponent>; +declare const MotionFeMerge: ForwardRefComponent>; +declare const MotionFeMergeNode: ForwardRefComponent>; +declare const MotionFeMorphology: ForwardRefComponent>; +declare const MotionFeOffset: ForwardRefComponent>; +declare const MotionFePointLight: ForwardRefComponent>; +declare const MotionFeSpecularLighting: ForwardRefComponent>; +declare const MotionFeSpotLight: ForwardRefComponent>; +declare const MotionFeTile: ForwardRefComponent>; +declare const MotionFeTurbulence: ForwardRefComponent>; +declare const MotionForeignObject: ForwardRefComponent>; +declare const MotionLinearGradient: ForwardRefComponent>; +declare const MotionRadialGradient: ForwardRefComponent>; +declare const MotionTextPath: ForwardRefComponent>; + +export { MotionA as a, MotionAbbr as abbr, MotionAddress as address, MotionAnimate as animate, MotionArea as area, MotionArticle as article, MotionAside as aside, MotionAudio as audio, MotionB as b, MotionBase as base, MotionBdi as bdi, MotionBdo as bdo, MotionBig as big, MotionBlockquote as blockquote, MotionBody as body, MotionButton as button, MotionCanvas as canvas, MotionCaption as caption, MotionCircle as circle, MotionCite as cite, MotionClipPath as clipPath, MotionCode as code, MotionCol as col, MotionColgroup as colgroup, MotionData as data, MotionDatalist as datalist, MotionDd as dd, MotionDefs as defs, MotionDel as del, MotionDesc as desc, MotionDetails as details, MotionDfn as dfn, MotionDialog as dialog, MotionDiv as div, MotionDl as dl, MotionDt as dt, MotionEllipse as ellipse, MotionEm as em, MotionEmbed as embed, MotionFeBlend as feBlend, MotionFeColorMatrix as feColorMatrix, MotionFeComponentTransfer as feComponentTransfer, MotionFeComposite as feComposite, MotionFeConvolveMatrix as feConvolveMatrix, MotionFeDiffuseLighting as feDiffuseLighting, MotionFeDisplacementMap as feDisplacementMap, MotionFeDistantLight as feDistantLight, MotionFeDropShadow as feDropShadow, MotionFeFlood as feFlood, MotionFeFuncA as feFuncA, MotionFeFuncB as feFuncB, MotionFeFuncG as feFuncG, MotionFeFuncR as feFuncR, MotionFeGaussianBlur as feGaussianBlur, MotionFeImage as feImage, MotionFeMerge as feMerge, MotionFeMergeNode as feMergeNode, MotionFeMorphology as feMorphology, MotionFeOffset as feOffset, MotionFePointLight as fePointLight, MotionFeSpecularLighting as feSpecularLighting, MotionFeSpotLight as feSpotLight, MotionFeTile as feTile, MotionFeTurbulence as feTurbulence, MotionFieldset as fieldset, MotionFigcaption as figcaption, MotionFigure as figure, MotionFilter as filter, MotionFooter as footer, MotionForeignObject as foreignObject, MotionForm as form, MotionG as g, MotionH1 as h1, MotionH2 as h2, MotionH3 as h3, MotionH4 as h4, MotionH5 as h5, MotionH6 as h6, MotionHead as head, MotionHeader as header, MotionHgroup as hgroup, MotionHr as hr, MotionHtml as html, MotionI as i, MotionIframe as iframe, MotionImage as image, MotionImg as img, MotionInput as input, MotionIns as ins, MotionKbd as kbd, MotionKeygen as keygen, MotionLabel as label, MotionLegend as legend, MotionLi as li, MotionLine as line, MotionLinearGradient as linearGradient, MotionLink as link, MotionMain as main, MotionMap as map, MotionMark as mark, MotionMarker as marker, MotionMask as mask, MotionMenu as menu, MotionMenuitem as menuitem, MotionMetadata as metadata, MotionMeter as meter, MotionNav as nav, MotionObject as object, MotionOl as ol, MotionOptgroup as optgroup, MotionOption as option, MotionOutput as output, MotionP as p, MotionParam as param, MotionPath as path, MotionPattern as pattern, MotionPicture as picture, MotionPolygon as polygon, MotionPolyline as polyline, MotionPre as pre, MotionProgress as progress, MotionQ as q, MotionRadialGradient as radialGradient, MotionRect as rect, MotionRp as rp, MotionRt as rt, MotionRuby as ruby, MotionS as s, MotionSamp as samp, MotionScript as script, MotionSection as section, MotionSelect as select, MotionSmall as small, MotionSource as source, MotionSpan as span, MotionStop as stop, MotionStrong as strong, MotionStyle as style, MotionSub as sub, MotionSummary as summary, MotionSup as sup, MotionSvg as svg, MotionSymbol as symbol, MotionTable as table, MotionTbody as tbody, MotionTd as td, MotionText as text, MotionTextPath as textPath, MotionTextarea as textarea, MotionTfoot as tfoot, MotionTh as th, MotionThead as thead, MotionTime as time, MotionTitle as title, MotionTr as tr, MotionTrack as track, MotionTspan as tspan, MotionU as u, MotionUl as ul, MotionUse as use, MotionVideo as video, MotionView as view, MotionWbr as wbr, MotionWebview as webview }; diff --git a/node_modules/framer-motion/dist/debug.d.ts b/node_modules/framer-motion/dist/debug.d.ts new file mode 100644 index 0000000..a4901bc --- /dev/null +++ b/node_modules/framer-motion/dist/debug.d.ts @@ -0,0 +1,2 @@ +export * from 'motion-dom'; +export { recordStats } from 'motion-dom'; diff --git a/node_modules/framer-motion/dist/dom-mini.d.ts b/node_modules/framer-motion/dist/dom-mini.d.ts new file mode 100644 index 0000000..36f39d8 --- /dev/null +++ b/node_modules/framer-motion/dist/dom-mini.d.ts @@ -0,0 +1,69 @@ +import { UnresolvedValueKeyframe, AnimationOptions, MotionValue, Transition, ElementOrSelector, DOMKeyframesDefinition, AnimationPlaybackOptions, GroupAnimationWithThen, AnimationPlaybackControlsWithThen } from 'motion-dom'; + +/** + * Lifecycle callbacks are not supported on individual sequence segments + * because segments are consolidated into a single animation per subject. + * Use sequence-level options (e.g. SequenceOptions.onComplete) instead. + */ +type LifecycleCallbacks = "onUpdate" | "onPlay" | "onComplete" | "onRepeat" | "onStop"; +/** + * Distributive Omit preserves union branches (unlike plain Omit). + */ +type DistributiveOmit = T extends any ? Omit : never; +type SegmentTransitionOptions = DistributiveOmit & At; +type SegmentValueTransitionOptions = DistributiveOmit & At; +type ObjectTarget = { + [K in keyof O]?: O[K] | UnresolvedValueKeyframe[]; +}; +type SequenceTime = number | "<" | `+${number}` | `-${number}` | `${string}`; +type SequenceLabel = string; +interface SequenceLabelWithTime { + name: SequenceLabel; + at: SequenceTime; +} +interface At { + at?: SequenceTime; +} +type MotionValueSegment = [ + MotionValue, + UnresolvedValueKeyframe | UnresolvedValueKeyframe[] +]; +type MotionValueSegmentWithTransition = [ + MotionValue, + UnresolvedValueKeyframe | UnresolvedValueKeyframe[], + SegmentValueTransitionOptions +]; +type DOMSegment = [ElementOrSelector, DOMKeyframesDefinition]; +type DOMSegmentWithTransition = [ + ElementOrSelector, + DOMKeyframesDefinition, + SegmentTransitionOptions +]; +type ObjectSegment = [O, ObjectTarget]; +type ObjectSegmentWithTransition = [ + O, + ObjectTarget, + SegmentTransitionOptions +]; +type SequenceProgressCallback = (value: any) => void; +type FunctionSegment = [SequenceProgressCallback] | [SequenceProgressCallback, SegmentTransitionOptions] | [ + SequenceProgressCallback, + UnresolvedValueKeyframe | UnresolvedValueKeyframe[], + SegmentTransitionOptions +]; +type Segment = ObjectSegment | ObjectSegmentWithTransition | SequenceLabel | SequenceLabelWithTime | MotionValueSegment | MotionValueSegmentWithTransition | DOMSegment | DOMSegmentWithTransition | FunctionSegment; +type AnimationSequence = Segment[]; +interface SequenceOptions extends AnimationPlaybackOptions { + delay?: number; + duration?: number; + defaultTransition?: Transition; + reduceMotion?: boolean; + skipAnimations?: boolean; + onComplete?: () => void; +} + +declare function animateSequence(definition: AnimationSequence, options?: SequenceOptions): GroupAnimationWithThen; + +declare const animateMini: (elementOrSelector: ElementOrSelector, keyframes: DOMKeyframesDefinition, options?: AnimationOptions) => AnimationPlaybackControlsWithThen; + +export { animateMini as animate, animateSequence }; diff --git a/node_modules/framer-motion/dist/dom-mini.js b/node_modules/framer-motion/dist/dom-mini.js new file mode 100644 index 0000000..61a0228 --- /dev/null +++ b/node_modules/framer-motion/dist/dom-mini.js @@ -0,0 +1 @@ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Motion={})}(this,function(t){"use strict";function e(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}function n(t,e){return e?`${t}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:t}let i=()=>{},s=()=>{};"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(i=(t,e,i)=>{t||"undefined"==typeof console||console.warn(n(e,i))},s=(t,e,i)=>{if(!t)throw new Error(n(e,i))});const o=t=>t,a=(t,e,n)=>{const i=e-t;return i?(n-t)/i:1},r=t=>1e3*t,l=t=>t/1e3;function u(t,e){return n=t,Array.isArray(n)&&"number"!=typeof n[0]?t[((t,e,n)=>{const i=e-t;return((n-t)%i+i)%i+t})(0,t.length,e)]:t;var n}const h=(t,e,n)=>t+(e-t)*n,c=2e4;function f(t,e=100,n){const i=n({...t,keyframes:[0,e]}),s=Math.min(function(t){let e=0,n=t.next(e);for(;!n.done&&e=c?1/0:e}(i),c);return{type:"keyframes",ease:t=>i.next(s*t).value/e,duration:l(s)}}function d(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const s=a(0,e,i);t.push(h(n,1,s))}}function m(t){const e=[0];return d(e,t.length-1),e}const p=t=>null!==t;class g{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}function y(t){for(let e=1;et.startsWith("--");const T={};function b(t,e){const n=function(t){let e;return()=>(void 0===e&&(e=t()),e)}(t);return()=>T[e]??n()}const v=b(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),S=b(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),k=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,E={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:k([0,.65,.55,1]),circOut:k([.55,0,1,.45]),backIn:k([.31,.01,.66,-.59]),backOut:k([.33,1.53,.69,.99])};function w(t,e){return t?"function"==typeof t?S()?((t,e,n=10)=>{let i="";const s=Math.max(Math.round(e/n),2);for(let e=0;eArray.isArray(t)&&"number"==typeof t[0])(t)?k(t):Array.isArray(t)?t.map(t=>w(t,e)||E.easeOut):E[t]:void 0}function M(t){return"function"==typeof t&&"applyToOptions"in t}class B extends g{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:e,name:n,keyframes:i,pseudoElement:o,allowFlatten:a=!1,finalKeyframe:r,onComplete:l}=t;this.isPseudoElement=Boolean(o),this.allowFlatten=a,this.options=t,s("string"!=typeof t.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const u=function({type:t,...e}){return M(t)&&S()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=function(t,e,n,{delay:i=0,duration:s=300,repeat:o=0,repeatType:a="loop",ease:r="easeOut",times:l}={},u){const h={[e]:n};l&&(h.offset=l);const c=w(r,s);Array.isArray(c)&&(h.easing=c);const f={delay:i,duration:s,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:o+1,direction:"reverse"===a?"alternate":"normal"};return u&&(f.pseudoElement=u),t.animate(h,f)}(e,n,i,u,o),!1===u.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const t=function(t,{repeat:e,repeatType:n="loop"},i,s=1){const o=t.filter(p),a=s<0||e&&"loop"!==n&&e%2==1?0:o.length-1;return a&&void 0!==i?i:o[a]}(i,this.options,r,this.speed);this.updateMotionValue&&this.updateMotionValue(t),function(t,e,n){A(e)?t.style.setProperty(e,n):t.style[e]=n}(e,n,t),this.animation.cancel()}l?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return l(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+l(t)}get time(){return l(Number(this.animation.currentTime)||0)}set time(t){const e=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=r(t),e&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:e,rangeEnd:n,observe:i}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&v()?(this.animation.timeline=t,e&&(this.animation.rangeStart=e),n&&(this.animation.rangeEnd=n),o):i(this)}}class x{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;ne.attachTimeline(t));return()=>{e.forEach((t,e)=>{t&&t(),this.animations[e].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return I(this.animations,"duration")}get iterationDuration(){return I(this.animations,"iterationDuration")}runAll(t){this.animations.forEach(e=>e[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function I(t,e){let n=0;for(let i=0;in&&(n=s)}return n}class O extends x{then(t,e){return this.finished.finally(t).then(()=>{})}}const F=new WeakMap,R=(t,e="")=>`${t}:${e}`;function W(t){let e=F.get(t);return e||(e=new Map,F.set(t,e)),e}function $(t,e){const n=t?.[e]??t?.default??t;return n!==t?function(t,e){if(t?.inherit&&e){const{inherit:n,...i}=t;return{...e,...i}}return t}(n,t):n}const P=t=>Boolean(t&&t.getVelocity),N=new Set(["borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","width","maxWidth","height","maxHeight","top","right","bottom","left","inset","insetBlock","insetBlockStart","insetBlockEnd","insetInline","insetInlineStart","insetInlineEnd","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingBlock","paddingBlockStart","paddingBlockEnd","paddingInline","paddingInlineStart","paddingInlineEnd","margin","marginTop","marginRight","marginBottom","marginLeft","marginBlock","marginBlockStart","marginBlockEnd","marginInline","marginInlineStart","marginInlineEnd","fontSize","backgroundPositionX","backgroundPositionY"]);function V(t,e){for(let n=0;nnull!=t)}function D(t,e){const n=window.getComputedStyle(t);return A(e)?n.getPropertyValue(e):n[e]}function q(t,e,n,i){return null==t?[]:"string"==typeof t&&function(t){return"object"==typeof t&&!Array.isArray(t)}(e)?L(t,0,i):t instanceof NodeList?Array.from(t):Array.isArray(t)?t.filter(t=>null!=t):[t]}function C(t,e,n){return t*(e+1)+n*e}function K(t,e,n,i){return"number"==typeof e?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?n:e.startsWith("<")?Math.max(0,n+parseFloat(e.slice(1))):i.get(e)??t}function _(t,n,i,s,o,a){!function(t,n,i){for(let s=0;sn&&o.at"number"==typeof t,J=t=>t.every(G);function Q(t,e,n,i){if(null==t)return[];const o=L(t),a=o.length;s(Boolean(a),"No valid elements provided.","no-valid-elements");const l=[];for(let t=0;te.delete(n)),u.push(s)}return u}const Z=(()=>function(t,e,n){return new O(Q(t,e,n))})();t.animate=Z,t.animateSequence=function(t,e){const n=[];return function(t,{defaultTransition:e={},...n}={},s,o){const l=e.duration||.3,h=new Map,c=new Map,p={},g=new Map;let y=0,A=0,T=0;for(let n=0;n{const c=X(t),{delay:p=0,times:g=m(c),type:y=e.type||"keyframes",repeat:b,repeatType:S,repeatDelay:k=0,...E}=n;let{ease:w=e.ease||"easeOut",duration:B}=n;const x="function"==typeof p?p(a,h):p,I=c.length,O=M(y)?y:o?.[y||"keyframes"];if(I<=2&&O){let t=100;if(2===I&&J(c)){const e=c[1]-c[0];t=Math.abs(e)}const n={...e,...E};void 0!==B&&(n.duration=r(B));const i=f(n,t,O);w=i.ease,B=i.duration}B??(B=l);const F=A+x;1===g.length&&0===g[0]&&(g[1]=1);const R=g.length-c.length;if(R>0&&d(g,R),1===c.length&&c.unshift(null),b&&i(b<20,`Sequence segments can't repeat ${b} times — ignoring repeat option. Use a value below 20 or apply repeat at the sequence level instead.`),b&&b<20){const t=B>0?k/B:0;B=C(B,b,k);const e=[...c],n=[...g];w=Array.isArray(w)?[...w]:[w];const i=[...w],s="reverse"===S||"mirror"===S;let o=e,a=i;s&&(o=[...e].reverse(),"reverse"===S&&(a=[...i].reverse().map(t=>{return"function"==typeof t?(e=t,t=>1-e(1-t)):t;var e})));for(let r=0;r0&&(c.push(c[c.length-1]),g.push(d),w.push("linear")),c.push(...h);for(let t=0;t{for(const s in t){const o=t[s];o.sort(z);const r=[],l=[],u=[];for(let t=0;t{n.push(...Q(i,t,e))}),new O(n)}}); diff --git a/node_modules/framer-motion/dist/dom.d.ts b/node_modules/framer-motion/dist/dom.d.ts new file mode 100644 index 0000000..52de5ea --- /dev/null +++ b/node_modules/framer-motion/dist/dom.d.ts @@ -0,0 +1,304 @@ +import { AnyResolvedKeyframe, UnresolvedValueKeyframe, AnimationOptions, MotionValue, Transition, ElementOrSelector, DOMKeyframesDefinition, AnimationPlaybackOptions, AnimationPlaybackControlsWithThen, ValueAnimationTransition, AnimationScope, AnimationPlaybackControls } from 'motion-dom'; +export * from 'motion-dom'; +export { DelayedFunction, delayInSeconds as delay } from 'motion-dom'; +import { Easing, EasingFunction, Point } from 'motion-utils'; +export * from 'motion-utils'; + +/** + * Lifecycle callbacks are not supported on individual sequence segments + * because segments are consolidated into a single animation per subject. + * Use sequence-level options (e.g. SequenceOptions.onComplete) instead. + */ +type LifecycleCallbacks = "onUpdate" | "onPlay" | "onComplete" | "onRepeat" | "onStop"; +/** + * Distributive Omit preserves union branches (unlike plain Omit). + */ +type DistributiveOmit = T extends any ? Omit : never; +type SegmentTransitionOptions = DistributiveOmit & At; +type SegmentValueTransitionOptions = DistributiveOmit & At; +type ObjectTarget = { + [K in keyof O]?: O[K] | UnresolvedValueKeyframe[]; +}; +type SequenceTime = number | "<" | `+${number}` | `-${number}` | `${string}`; +type SequenceLabel = string; +interface SequenceLabelWithTime { + name: SequenceLabel; + at: SequenceTime; +} +interface At { + at?: SequenceTime; +} +type MotionValueSegment = [ + MotionValue, + UnresolvedValueKeyframe | UnresolvedValueKeyframe[] +]; +type MotionValueSegmentWithTransition = [ + MotionValue, + UnresolvedValueKeyframe | UnresolvedValueKeyframe[], + SegmentValueTransitionOptions +]; +type DOMSegment = [ElementOrSelector, DOMKeyframesDefinition]; +type DOMSegmentWithTransition = [ + ElementOrSelector, + DOMKeyframesDefinition, + SegmentTransitionOptions +]; +type ObjectSegment = [O, ObjectTarget]; +type ObjectSegmentWithTransition = [ + O, + ObjectTarget, + SegmentTransitionOptions +]; +type SequenceProgressCallback = (value: any) => void; +type FunctionSegment = [SequenceProgressCallback] | [SequenceProgressCallback, SegmentTransitionOptions] | [ + SequenceProgressCallback, + UnresolvedValueKeyframe | UnresolvedValueKeyframe[], + SegmentTransitionOptions +]; +type Segment = ObjectSegment | ObjectSegmentWithTransition | SequenceLabel | SequenceLabelWithTime | MotionValueSegment | MotionValueSegmentWithTransition | DOMSegment | DOMSegmentWithTransition | FunctionSegment; +type AnimationSequence = Segment[]; +interface SequenceOptions extends AnimationPlaybackOptions { + delay?: number; + duration?: number; + defaultTransition?: Transition; + reduceMotion?: boolean; + skipAnimations?: boolean; + onComplete?: () => void; +} +interface AbsoluteKeyframe { + value: AnyResolvedKeyframe | null; + at: number; + easing?: Easing; +} +type ValueSequence = AbsoluteKeyframe[]; +interface SequenceMap { + [key: string]: ValueSequence; +} +type ResolvedAnimationDefinition = { + keyframes: { + [key: string]: UnresolvedValueKeyframe[]; + }; + transition: { + [key: string]: Transition; + }; +}; +type ResolvedAnimationDefinitions = Map; + +interface ScopedAnimateOptions { + scope?: AnimationScope; + reduceMotion?: boolean; + skipAnimations?: boolean; +} +/** + * Creates an animation function that is optionally scoped + * to a specific element. + */ +declare function createScopedAnimate(options?: ScopedAnimateOptions): { + (sequence: AnimationSequence, options?: SequenceOptions): AnimationPlaybackControlsWithThen; + (value: string | MotionValue, keyframes: string | UnresolvedValueKeyframe[], options?: ValueAnimationTransition): AnimationPlaybackControlsWithThen; + (value: number | MotionValue, keyframes: number | UnresolvedValueKeyframe[], options?: ValueAnimationTransition): AnimationPlaybackControlsWithThen; + (value: V | MotionValue, keyframes: V | UnresolvedValueKeyframe[], options?: ValueAnimationTransition): AnimationPlaybackControlsWithThen; + (element: ElementOrSelector, keyframes: DOMKeyframesDefinition, options?: AnimationOptions): AnimationPlaybackControlsWithThen; + (object: O | O[], keyframes: ObjectTarget, options?: AnimationOptions): AnimationPlaybackControlsWithThen; +}; +declare const animate: { + (sequence: AnimationSequence, options?: SequenceOptions): AnimationPlaybackControlsWithThen; + (value: string | MotionValue, keyframes: string | UnresolvedValueKeyframe[], options?: ValueAnimationTransition): AnimationPlaybackControlsWithThen; + (value: number | MotionValue, keyframes: number | UnresolvedValueKeyframe[], options?: ValueAnimationTransition): AnimationPlaybackControlsWithThen; + (value: V | MotionValue, keyframes: V | UnresolvedValueKeyframe[], options?: ValueAnimationTransition): AnimationPlaybackControlsWithThen; + (element: ElementOrSelector, keyframes: DOMKeyframesDefinition, options?: AnimationOptions): AnimationPlaybackControlsWithThen; + (object: O | O[], keyframes: ObjectTarget, options?: AnimationOptions): AnimationPlaybackControlsWithThen; +}; + +declare const animateMini: (elementOrSelector: ElementOrSelector, keyframes: DOMKeyframesDefinition, options?: AnimationOptions) => AnimationPlaybackControlsWithThen; + +interface ScrollOptions { + source?: HTMLElement; + container?: Element; + target?: Element; + axis?: "x" | "y"; + offset?: ScrollOffset; +} +type OnScrollProgress = (progress: number) => void; +type OnScrollWithInfo = (progress: number, info: ScrollInfo) => void; +type OnScroll = OnScrollProgress | OnScrollWithInfo; +interface AxisScrollInfo { + current: number; + offset: number[]; + progress: number; + scrollLength: number; + velocity: number; + targetOffset: number; + targetLength: number; + containerLength: number; + interpolatorOffsets?: number[]; + interpolate?: EasingFunction; +} +interface ScrollInfo { + time: number; + x: AxisScrollInfo; + y: AxisScrollInfo; +} +type OnScrollInfo = (info: ScrollInfo) => void; +type SupportedEdgeUnit = "px" | "vw" | "vh" | "%"; +type EdgeUnit = `${number}${SupportedEdgeUnit}`; +type NamedEdges = "start" | "end" | "center"; +type EdgeString = NamedEdges | EdgeUnit | `${number}`; +type Edge = EdgeString | number; +type ProgressIntersection = [number, number]; +type Intersection = `${Edge} ${Edge}`; +type ScrollOffset = Array; +interface ScrollInfoOptions { + container?: Element; + target?: Element; + axis?: "x" | "y"; + offset?: ScrollOffset; + /** + * When true, enables per-frame checking of scrollWidth/scrollHeight + * to detect content size changes and recalculate scroll progress. + * + * @default false + */ + trackContentSize?: boolean; +} + +declare function scroll(onScroll: OnScroll | AnimationPlaybackControls, { axis, container, ...options }?: ScrollOptions): VoidFunction; + +declare function scrollInfo(onScroll: OnScrollInfo, { container, trackContentSize, ...options }?: ScrollInfoOptions): VoidFunction; + +type ViewChangeHandler = (entry: IntersectionObserverEntry) => void; +type MarginValue = `${number}${"px" | "%"}`; +type MarginType = MarginValue | `${MarginValue} ${MarginValue}` | `${MarginValue} ${MarginValue} ${MarginValue}` | `${MarginValue} ${MarginValue} ${MarginValue} ${MarginValue}`; +interface InViewOptions { + root?: Element | Document; + margin?: MarginType; + amount?: "some" | "all" | number; +} +declare function inView(elementOrSelector: ElementOrSelector, onStart: (element: Element, entry: IntersectionObserverEntry) => void | ViewChangeHandler, { root, margin: rootMargin, amount }?: InViewOptions): VoidFunction; + +interface HTMLElements { + a: HTMLAnchorElement; + abbr: HTMLElement; + address: HTMLElement; + area: HTMLAreaElement; + article: HTMLElement; + aside: HTMLElement; + audio: HTMLAudioElement; + b: HTMLElement; + base: HTMLBaseElement; + bdi: HTMLElement; + bdo: HTMLElement; + big: HTMLElement; + blockquote: HTMLQuoteElement; + body: HTMLBodyElement; + br: HTMLBRElement; + button: HTMLButtonElement; + canvas: HTMLCanvasElement; + caption: HTMLElement; + center: HTMLElement; + cite: HTMLElement; + code: HTMLElement; + col: HTMLTableColElement; + colgroup: HTMLTableColElement; + data: HTMLDataElement; + datalist: HTMLDataListElement; + dd: HTMLElement; + del: HTMLModElement; + details: HTMLDetailsElement; + dfn: HTMLElement; + dialog: HTMLDialogElement; + div: HTMLDivElement; + dl: HTMLDListElement; + dt: HTMLElement; + em: HTMLElement; + embed: HTMLEmbedElement; + fieldset: HTMLFieldSetElement; + figcaption: HTMLElement; + figure: HTMLElement; + footer: HTMLElement; + form: HTMLFormElement; + h1: HTMLHeadingElement; + h2: HTMLHeadingElement; + h3: HTMLHeadingElement; + h4: HTMLHeadingElement; + h5: HTMLHeadingElement; + h6: HTMLHeadingElement; + head: HTMLHeadElement; + header: HTMLElement; + hgroup: HTMLElement; + hr: HTMLHRElement; + html: HTMLHtmlElement; + i: HTMLElement; + iframe: HTMLIFrameElement; + img: HTMLImageElement; + input: HTMLInputElement; + ins: HTMLModElement; + kbd: HTMLElement; + keygen: HTMLElement; + label: HTMLLabelElement; + legend: HTMLLegendElement; + li: HTMLLIElement; + link: HTMLLinkElement; + main: HTMLElement; + map: HTMLMapElement; + mark: HTMLElement; + menu: HTMLElement; + menuitem: HTMLElement; + meta: HTMLMetaElement; + meter: HTMLMeterElement; + nav: HTMLElement; + noindex: HTMLElement; + noscript: HTMLElement; + object: HTMLObjectElement; + ol: HTMLOListElement; + optgroup: HTMLOptGroupElement; + option: HTMLOptionElement; + output: HTMLOutputElement; + p: HTMLParagraphElement; + param: HTMLParamElement; + picture: HTMLElement; + pre: HTMLPreElement; + progress: HTMLProgressElement; + q: HTMLQuoteElement; + rp: HTMLElement; + rt: HTMLElement; + ruby: HTMLElement; + s: HTMLElement; + samp: HTMLElement; + search: HTMLElement; + slot: HTMLSlotElement; + script: HTMLScriptElement; + section: HTMLElement; + select: HTMLSelectElement; + small: HTMLElement; + source: HTMLSourceElement; + span: HTMLSpanElement; + strong: HTMLElement; + style: HTMLStyleElement; + sub: HTMLElement; + summary: HTMLElement; + sup: HTMLElement; + table: HTMLTableElement; + template: HTMLTemplateElement; + tbody: HTMLTableSectionElement; + td: HTMLTableDataCellElement; + textarea: HTMLTextAreaElement; + tfoot: HTMLTableSectionElement; + th: HTMLTableHeaderCellElement; + thead: HTMLTableSectionElement; + time: HTMLTimeElement; + title: HTMLTitleElement; + tr: HTMLTableRowElement; + track: HTMLTrackElement; + u: HTMLElement; + ul: HTMLUListElement; + var: HTMLElement; + video: HTMLVideoElement; + wbr: HTMLElement; + webview: HTMLWebViewElement; +} + +declare const distance: (a: number, b: number) => number; +declare function distance2D(a: Point, b: Point): number; + +export { type AbsoluteKeyframe, type AnimationSequence, type At, type DOMSegment, type DOMSegmentWithTransition, type FunctionSegment, type HTMLElements, type MotionValueSegment, type MotionValueSegmentWithTransition, type ObjectSegment, type ObjectSegmentWithTransition, type ObjectTarget, type ResolvedAnimationDefinition, type ResolvedAnimationDefinitions, type Segment, type SegmentTransitionOptions, type SegmentValueTransitionOptions, type SequenceLabel, type SequenceLabelWithTime, type SequenceMap, type SequenceOptions, type SequenceProgressCallback, type SequenceTime, type ValueSequence, animate, animateMini, createScopedAnimate, distance, distance2D, inView, scroll, scrollInfo }; diff --git a/node_modules/framer-motion/dist/dom.js b/node_modules/framer-motion/dist/dom.js new file mode 100644 index 0000000..b31abc4 --- /dev/null +++ b/node_modules/framer-motion/dist/dom.js @@ -0,0 +1 @@ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Motion={})}(this,function(t){"use strict";function e(t,e){-1===t.indexOf(e)&&t.push(e)}function n(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const i=(t,e,n)=>n>e?e:n{},t.invariant=()=>{},"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(t.warning=(t,e,n)=>{t||"undefined"==typeof console||console.warn(s(e,n))},t.invariant=(t,e,n)=>{if(!t)throw new Error(s(e,n))});const o={},r=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),a=t=>"object"==typeof t&&null!==t,l=t=>/^0[^.\s]+$/u.test(t);function c(t){let e;return()=>(void 0===e&&(e=t()),e)}const u=t=>t,h=(...t)=>t.reduce((t,e)=>n=>e(t(n))),d=(t,e,n)=>{const i=e-t;return i?(n-t)/i:1};class p{constructor(){this.subscriptions=[]}add(t){return e(this.subscriptions,t),()=>n(this.subscriptions,t)}notify(t,e,n){const i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](t,e,n);else for(let s=0;s1e3*t,f=t=>t/1e3,y=(t,e)=>e?t*(1e3/e):0,g=new Set;function v(t,e,n){t||g.has(e)||(console.warn(s(e,n)),g.add(e))}const x=(t,e,n)=>{const i=e-t;return((n-t)%i+i)%i+t},w=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function T(t,e,n,i){if(t===e&&n===i)return u;const s=e=>function(t,e,n,i,s){let o,r,a=0;do{r=e+(n-e)/2,o=w(r,i,s)-t,o>0?n=r:e=r}while(Math.abs(o)>1e-7&&++a<12);return r}(e,0,1,t,n);return t=>0===t||1===t?t:w(s(t),e,i)}const b=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,S=t=>e=>1-t(1-e),A=T(.33,1.53,.69,.99),V=S(A),P=b(V),M=t=>t>=1?1:(t*=2)<1?.5*V(t):.5*(2-Math.pow(2,-10*(t-1))),E=t=>1-Math.sin(Math.acos(t)),k=S(E),D=b(E),C=T(.42,0,1,1),B=T(0,0,.58,1),R=T(.42,0,.58,1);const L=t=>Array.isArray(t)&&"number"!=typeof t[0];function j(t,e){return L(t)?t[x(0,t.length,e)]:t}const O=t=>Array.isArray(t)&&"number"==typeof t[0],F={linear:u,easeIn:C,easeInOut:R,easeOut:B,circIn:E,circInOut:D,circOut:k,backIn:V,backInOut:P,backOut:A,anticipate:M},I=e=>{if(O(e)){t.invariant(4===e.length,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[n,i,s,o]=e;return T(n,i,s,o)}return"string"==typeof e?(t.invariant(void 0!==F[e],`Invalid easing type '${e}'`,"invalid-easing-type"),F[e]):e},$=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function N(t,e){let n=!1,i=!0;const s={delta:0,timestamp:0,isProcessing:!1},r=()=>n=!0,a=$.reduce((t,e)=>(t[e]=function(t){let e=new Set,n=new Set,i=!1,s=!1;const o=new WeakSet;let r={delta:0,timestamp:0,isProcessing:!1};function a(e){o.has(e)&&(l.schedule(e),t()),e(r)}const l={schedule:(t,s=!1,r=!1)=>{const a=r&&i?e:n;return s&&o.add(t),a.add(t),t},cancel:t=>{n.delete(t),o.delete(t)},process:t=>{if(r=t,i)return void(s=!0);i=!0;const o=e;e=n,n=o,e.forEach(a),e.clear(),i=!1,s&&(s=!1,l.process(t))}};return l}(r),t),{}),{setup:l,read:c,resolveKeyframes:u,preUpdate:h,update:d,preRender:p,render:m,postRender:f}=a,y=()=>{const r=o.useManualTiming,a=r?s.timestamp:performance.now();n=!1,r||(s.delta=i?1e3/60:Math.max(Math.min(a-s.timestamp,40),1)),s.timestamp=a,s.isProcessing=!0,l.process(s),c.process(s),u.process(s),h.process(s),d.process(s),p.process(s),m.process(s),f.process(s),s.isProcessing=!1,n&&e&&(i=!1,t(y))};return{schedule:$.reduce((e,o)=>{const r=a[o];return e[o]=(e,o=!1,a=!1)=>(n||(n=!0,i=!0,s.isProcessing||t(y)),r.schedule(e,o,a)),e},{}),cancel:t=>{for(let e=0;e<$.length;e++)a[$[e]].cancel(t)},state:s,steps:a}}const{schedule:W,cancel:U,state:z,steps:K}=N("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:u,!0);let Y;function X(){Y=void 0}const G={now:()=>(void 0===Y&&G.set(z.isProcessing||o.useManualTiming?z.timestamp:performance.now()),Y),set:t=>{Y=t,queueMicrotask(X)}},H=t=>e=>"string"==typeof e&&e.startsWith(t),q=H("--"),Z=H("var(--"),_=t=>!!Z(t)&&J.test(t.split("/*")[0].trim()),J=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Q(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const tt={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},et={...tt,transform:t=>i(0,1,t)},nt={...tt,default:1},it=t=>Math.round(1e5*t)/1e5,st=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const ot=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,rt=(t,e)=>n=>Boolean("string"==typeof n&&ot.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),at=(t,e,n)=>i=>{if("string"!=typeof i)return i;const[s,o,r,a]=i.match(st);return{[t]:parseFloat(s),[e]:parseFloat(o),[n]:parseFloat(r),alpha:void 0!==a?parseFloat(a):1}},lt={...tt,transform:t=>Math.round((t=>i(0,255,t))(t))},ct={test:rt("rgb","red"),parse:at("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+lt.transform(t)+", "+lt.transform(e)+", "+lt.transform(n)+", "+it(et.transform(i))+")"};const ut={test:rt("#"),parse:function(t){let e="",n="",i="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),i=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),i=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,i+=i,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:s?parseInt(s,16)/255:1}},transform:ct.transform},ht=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),dt=ht("deg"),pt=ht("%"),mt=ht("px"),ft=ht("vh"),yt=ht("vw"),gt=(()=>({...pt,parse:t=>pt.parse(t)/100,transform:t=>pt.transform(100*t)}))(),vt={test:rt("hsl","hue"),parse:at("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+pt.transform(it(e))+", "+pt.transform(it(n))+", "+it(et.transform(i))+")"},xt={test:t=>ct.test(t)||ut.test(t)||vt.test(t),parse:t=>ct.test(t)?ct.parse(t):vt.test(t)?vt.parse(t):ut.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?ct.transform(t):vt.transform(t),getAnimatableNone:t=>{const e=xt.parse(t);return e.alpha=0,xt.transform(e)}},wt=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const Tt="number",bt="color",St=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function At(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},s=[];let o=0;const r=e.replace(St,t=>(xt.test(t)?(i.color.push(o),s.push(bt),n.push(xt.parse(t))):t.startsWith("var(")?(i.var.push(o),s.push("var"),n.push(t)):(i.number.push(o),s.push(Tt),n.push(parseFloat(t))),++o,"${}")).split("${}");return{values:n,split:r,indexes:i,types:s}}function Vt({split:t,types:e}){const n=t.length;return i=>{let s="";for(let o=0;o{return"number"==typeof t?e?.trim().endsWith("/")?t:0:"number"==typeof(n=t)?0:xt.test(n)?xt.getAnimatableNone(n):n;var n};const Mt={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(st)?.length||0)+(t.match(wt)?.length||0)>0},parse:function(t){return At(t).values},createTransformer:function(t){return Vt(At(t))},getAnimatableNone:function(t){const e=At(t);return Vt(e)(e.values.map((t,n)=>Pt(t,e.split[n])))}};function Et(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function kt({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let s=0,o=0,r=0;if(e/=100){const i=n<.5?n*(1+e):n+e-n*e,a=2*n-i;s=Et(a,i,t+1/3),o=Et(a,i,t),r=Et(a,i,t-1/3)}else s=o=r=n;return{red:Math.round(255*s),green:Math.round(255*o),blue:Math.round(255*r),alpha:i}}function Dt(t,e){return n=>n>0?e:t}const Ct=(t,e,n)=>t+(e-t)*n,Bt=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},Rt=[ut,ct,vt];function Lt(e){const n=(i=e,Rt.find(t=>t.test(i)));var i;if(t.warning(Boolean(n),`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!Boolean(n))return!1;let s=n.parse(e);return n===vt&&(s=kt(s)),s}const jt=(t,e)=>{const n=Lt(t),i=Lt(e);if(!n||!i)return Dt(t,e);const s={...n};return t=>(s.red=Bt(n.red,i.red,t),s.green=Bt(n.green,i.green,t),s.blue=Bt(n.blue,i.blue,t),s.alpha=Ct(n.alpha,i.alpha,t),ct.transform(s))},Ot=new Set(["none","hidden"]);function Ft(t,e){return Ot.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function It(t,e){return n=>Ct(t,e,n)}function $t(t){return"number"==typeof t?It:"string"==typeof t?_(t)?Dt:xt.test(t)?jt:Ut:Array.isArray(t)?Nt:"object"==typeof t?xt.test(t)?jt:Wt:Dt}function Nt(t,e){const n=[...t],i=n.length,s=t.map((t,n)=>$t(t)(t,e[n]));return t=>{for(let e=0;e{for(const e in i)n[e]=i[e](t);return n}}const Ut=(e,n)=>{const i=Mt.createTransformer(n),s=At(e),o=At(n);return s.indexes.var.length===o.indexes.var.length&&s.indexes.color.length===o.indexes.color.length&&s.indexes.number.length>=o.indexes.number.length?Ot.has(e)&&!o.values.length||Ot.has(n)&&!s.values.length?Ft(e,n):h(Nt(function(t,e){const n=[],i={color:0,var:0,number:0};for(let s=0;s{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>W.update(e,t),stop:()=>U(e),now:()=>z.isProcessing?z.timestamp:G.now()}},Yt=(t,e,n=10)=>{let i="";const s=Math.max(Math.round(e/n),2);for(let e=0;e=Xt?1/0:e}function Ht(t,e=100,n){const i=n({...t,keyframes:[0,e]}),s=Math.min(Gt(i),Xt);return{type:"keyframes",ease:t=>i.next(s*t).value/e,duration:f(s)}}const qt=100,Zt=10,_t=1,Jt=0,Qt=800,te=.3,ee=.3,ne={granular:.01,default:2},ie={granular:.005,default:.5},se=.01,oe=10,re=.05,ae=1;function le(t,e){return t*Math.sqrt(1-e*e)}const ce=.001;const ue=["duration","bounce"],he=["stiffness","damping","mass"];function de(t,e){return e.some(e=>void 0!==t[e])}function pe(e){let n={velocity:Jt,stiffness:qt,damping:Zt,mass:_t,isResolvedFromDuration:!1,...e};if(!de(e,he)&&de(e,ue))if(n.velocity=0,e.visualDuration){const t=e.visualDuration,s=2*Math.PI/(1.2*t),o=s*s,r=2*i(.05,1,1-(e.bounce||0))*Math.sqrt(o);n={...n,mass:_t,stiffness:o,damping:r}}else{const s=function({duration:e=Qt,bounce:n=te,velocity:s=Jt,mass:o=_t}){let r,a;t.warning(e<=m(oe),"Spring duration must be 10 seconds or less","spring-duration-limit");let l=1-n;l=i(re,ae,l),e=i(se,oe,f(e)),l<1?(r=t=>{const n=t*l,i=n*e,o=n-s,r=le(t,l),a=Math.exp(-i);return ce-o/r*a},a=t=>{const n=t*l*e,i=n*s+s,o=Math.pow(l,2)*Math.pow(t,2)*e,a=Math.exp(-n),c=le(Math.pow(t,2),l);return(-r(t)+ce>0?-1:1)*((i-o)*a)/c}):(r=t=>Math.exp(-t*e)*((t-s)*e+1)-.001,a=t=>Math.exp(-t*e)*(e*e*(s-t)));const c=function(t,e,n){let i=n;for(let n=1;n<12;n++)i-=t(i)/e(i);return i}(r,a,5/e);if(e=m(e),isNaN(c))return{stiffness:qt,damping:Zt,duration:e};{const t=Math.pow(c,2)*o;return{stiffness:t,damping:2*l*Math.sqrt(o*t),duration:e}}}({...e,velocity:0});n={...n,...s,mass:_t},n.isResolvedFromDuration=!0}return n}function me(t=ee,e=te){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:i,restDelta:s}=n;const o=n.keyframes[0],r=n.keyframes[n.keyframes.length-1],a={done:!1,value:o},{stiffness:l,damping:c,mass:u,duration:h,velocity:d,isResolvedFromDuration:p}=pe({...n,velocity:-f(n.velocity||0)}),y=d||0,g=c/(2*Math.sqrt(l*u)),v=r-o,x=f(Math.sqrt(l/u)),w=Math.abs(v)<5;let T,b,S,A,V,P;if(i||(i=w?ne.granular:ne.default),s||(s=w?ie.granular:ie.default),g<1)S=le(x,g),A=(y+g*x*v)/S,T=t=>{const e=Math.exp(-g*x*t);return r-e*(A*Math.sin(S*t)+v*Math.cos(S*t))},V=g*x*A+v*S,P=g*x*v-A*S,b=t=>Math.exp(-g*x*t)*(V*Math.sin(S*t)+P*Math.cos(S*t));else if(1===g){T=t=>r-Math.exp(-x*t)*(v+(y+x*v)*t);const t=y+x*v;b=e=>Math.exp(-x*e)*(x*t*e-y)}else{const t=x*Math.sqrt(g*g-1);T=e=>{const n=Math.exp(-g*x*e),i=Math.min(t*e,300);return r-n*((y+g*x*v)*Math.sinh(i)+t*v*Math.cosh(i))/t};const e=(y+g*x*v)/t,n=g*x*e-v*t,i=g*x*v-e*t;b=e=>{const s=Math.exp(-g*x*e),o=Math.min(t*e,300);return s*(n*Math.sinh(o)+i*Math.cosh(o))}}const M={calculatedDuration:p&&h||null,velocity:t=>m(b(t)),next:t=>{if(!p&&g<1){const e=Math.exp(-g*x*t),n=Math.sin(S*t),o=Math.cos(S*t),l=r-e*(A*n+v*o),c=m(e*(V*n+P*o));return a.done=Math.abs(c)<=i&&Math.abs(r-l)<=s,a.value=a.done?r:l,a}const e=T(t);if(p)a.done=t>=h;else{const n=m(b(t));a.done=Math.abs(n)<=i&&Math.abs(r-e)<=s}return a.value=a.done?r:e,a},toString:()=>{const t=Math.min(Gt(M),Xt),e=Yt(e=>M.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return M}me.applyToOptions=t=>{const e=Ht(t,100,me);return t.ease=e.ease,t.duration=m(e.duration),t.type="keyframes",t};function fe(t,e,n){const i=Math.max(e-5,0);return y(n-t(i),e-i)}function ye({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:l,restDelta:c=.5,restSpeed:u}){const h=t[0],d={done:!1,value:h},p=t=>void 0===a?l:void 0===l||Math.abs(a-t)-m*Math.exp(-t/i),v=t=>y+g(t),x=t=>{const e=g(t),n=v(t);d.done=Math.abs(e)<=c,d.value=d.done?y:n};let w,T;const b=t=>{var e;(e=d.value,void 0!==a&&el)&&(w=t,T=me({keyframes:[d.value,p(d.value)],velocity:fe(v,t,d.value),damping:s,stiffness:o,restDelta:c,restSpeed:u}))};return b(0),{calculatedDuration:null,next:t=>{let e=!1;return T||void 0!==w||(e=!0,x(t),b(t)),void 0!==w&&t>=w?T.next(t-w):(!e&&x(t),d)}}}function ge(e,n,{clamp:s=!0,ease:r,mixer:a}={}){const l=e.length;if(t.invariant(l===n.length,"Both input and output ranges must be the same length","range-length"),1===l)return()=>n[0];if(2===l&&n[0]===n[1])return()=>n[1];const c=e[0]===e[1];e[0]>e[l-1]&&(e=[...e].reverse(),n=[...n].reverse());const p=function(t,e,n){const i=[],s=n||o.mix||zt,r=t.length-1;for(let n=0;n{if(c&&t1)for(;if(i(e[0],e[l-1],t)):f}function ve(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const s=d(0,e,i);t.push(Ct(n,1,s))}}function xe(t){const e=[0];return ve(e,t.length-1),e}function we(t,e){return t.map(t=>t*e)}function Te(t,e){return t.map(()=>e||R).splice(0,t.length-1)}function be({duration:t=300,keyframes:e,times:n,ease:i="easeInOut"}){const s=L(i)?i.map(I):I(i),o={done:!1,value:e[0]},r=ge(we(n&&n.length===e.length?n:xe(e),t),e,{ease:Array.isArray(s)?s:Te(e,s)});return{calculatedDuration:t,next:e=>(o.value=r(e),o.done=e>=t,o)}}const Se=t=>null!==t;function Ae(t,{repeat:e,repeatType:n="loop"},i,s=1){const o=t.filter(Se),r=s<0||e&&"loop"!==n&&e%2==1?0:o.length-1;return r&&void 0!==i?i:o[r]}const Ve={decay:ye,inertia:ye,tween:be,keyframes:be,spring:me};function Pe(t){"string"==typeof t.type&&(t.type=Ve[t.type])}class Me{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const Ee=t=>t/100;class ke extends Me{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:t}=this.options;t&&t.updatedAt!==G.now()&&this.tick(G.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;Pe(t);const{type:e=be,repeat:n=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=t;let{keyframes:r}=t;const a=e||be;a!==be&&"number"!=typeof r[0]&&(this.mixKeyframes=h(Ee,zt(r[0],r[1])),r=[0,100]);const l=a({...t,keyframes:r});"mirror"===s&&(this.mirroredGenerator=a({...t,keyframes:[...r].reverse(),velocity:-o})),null===l.calculatedDuration&&(l.calculatedDuration=Gt(l));const{calculatedDuration:c}=l;this.calculatedDuration=c,this.resolvedDuration=c+i,this.totalDuration=this.resolvedDuration*(n+1)-i,this.generator=l}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,e=!1){const{generator:n,totalDuration:s,mixKeyframes:o,mirroredGenerator:r,resolvedDuration:a,calculatedDuration:l}=this;if(null===this.startTime)return n.next(0);const{delay:c=0,keyframes:u,repeat:h,repeatType:d,repeatDelay:p,type:m,onUpdate:f,finalKeyframe:y}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?g<0:g>s;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=s);let x,w=this.currentTime,T=n;if(h){const t=Math.min(this.currentTime,s)/a;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,h+1);Boolean(e%2)&&("reverse"===d?(n=1-n,p&&(n-=p/a)):"mirror"===d&&(T=r)),w=i(0,1,n)*a}v?(this.delayState.value=u[0],x=this.delayState):x=T.next(w),o&&!v&&(x.value=o(x.value));let{done:b}=x;v||null===l||(b=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const S=null===this.holdTime&&("finished"===this.state||"running"===this.state&&b);return S&&m!==ye&&(x.value=Ae(u,this.options,y,this.speed)),f&&f(x.value),S&&this.finish(),x}then(t,e){return this.finished.then(t,e)}get duration(){return f(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+f(t)}get time(){return f(this.currentTime)}set time(t){t=m(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);return fe(t=>this.generator.next(t).value,t,this.generator.next(t).value)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;e&&this.driver&&this.updateTime(G.now()),this.playbackSpeed=t,e&&this.driver&&(this.time=f(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=Kt,startTime:e}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),this.options.onPlay?.();const n=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=n):null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime||(this.startTime=e??n),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(G.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function De(t){for(let e=1;e180*t/Math.PI,Be=t=>{const e=Ce(Math.atan2(t[1],t[0]));return Le(e)},Re={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Be,rotateZ:Be,skewX:t=>Ce(Math.atan(t[1])),skewY:t=>Ce(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Le=t=>((t%=360)<0&&(t+=360),t),je=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Oe=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Fe={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:je,scaleY:Oe,scale:t=>(je(t)+Oe(t))/2,rotateX:t=>Le(Ce(Math.atan2(t[6],t[5]))),rotateY:t=>Le(Ce(Math.atan2(-t[2],t[0]))),rotateZ:Be,rotate:Be,skewX:t=>Ce(Math.atan(t[4])),skewY:t=>Ce(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Ie(t){return t.includes("scale")?1:0}function $e(t,e){if(!t||"none"===t)return Ie(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,s;if(n)i=Fe,s=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=Re,s=e}if(!s)return Ie(e);const o=i[e],r=s[1].split(",").map(We);return"function"==typeof o?o(r):r[o]}const Ne=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return $e(n,e)};function We(t){return parseFloat(t.trim())}const Ue=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ze=(()=>new Set([...Ue,"pathRotation"]))(),Ke=t=>t===tt||t===mt,Ye=new Set(["x","y","z"]),Xe=Ue.filter(t=>!Ye.has(t));const Ge={width:({x:t},{paddingLeft:e="0",paddingRight:n="0",boxSizing:i})=>{const s=t.max-t.min;return"border-box"===i?s:s-parseFloat(e)-parseFloat(n)},height:({y:t},{paddingTop:e="0",paddingBottom:n="0",boxSizing:i})=>{const s=t.max-t.min;return"border-box"===i?s:s-parseFloat(e)-parseFloat(n)},top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>$e(e,"x"),y:(t,{transform:e})=>$e(e,"y")};Ge.translateX=Ge.x,Ge.translateY=Ge.y;const He=new Set;let qe=!1,Ze=!1,_e=!1;function Je(){if(Ze){const t=Array.from(He).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),n=new Map;e.forEach(t=>{const e=function(t){const e=[];return Xe.forEach(n=>{const i=t.getValue(n);void 0!==i&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),e}(t);e.length&&(n.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=n.get(t);e&&e.forEach(([e,n])=>{t.getValue(e)?.set(n)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}Ze=!1,qe=!1,He.forEach(t=>t.complete(_e)),He.clear()}function Qe(){He.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Ze=!0)})}function tn(){_e=!0,Qe(),Je(),_e=!1}class en{constructor(t,e,n,i,s,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(He.add(this),qe||(qe=!0,W.read(Qe),W.resolveKeyframes(Je))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:i}=this;if(null===t[0]){const s=i?.get(),o=t[t.length-1];if(void 0!==s)t[0]=s;else if(n&&e){const i=n.readValue(e,o);null!=i&&(t[0]=i)}void 0===t[0]&&(t[0]=o),i&&void 0===s&&i.set(t[0])}De(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),He.delete(this)}cancel(){"scheduled"===this.state&&(He.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}const nn=t=>t.startsWith("--");function sn(t,e,n){nn(e)?t.style.setProperty(e,n):t.style[e]=n}const on={};function rn(t,e){const n=c(t);return()=>on[e]??n()}const an=rn(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),ln=rn(()=>void 0!==window.ViewTimeline,"viewTimeline"),cn=rn(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),un=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,hn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:un([0,.65,.55,1]),circOut:un([.55,0,1,.45]),backIn:un([.31,.01,.66,-.59]),backOut:un([.33,1.53,.69,.99])};function dn(t,e){return t?"function"==typeof t?cn()?Yt(t,e):"ease-out":O(t)?un(t):Array.isArray(t)?t.map(t=>dn(t,e)||hn.easeOut):hn[t]:void 0}function pn(t,e,n,{delay:i=0,duration:s=300,repeat:o=0,repeatType:r="loop",ease:a="easeOut",times:l}={},c=void 0){const u={[e]:n};l&&(u.offset=l);const h=dn(a,s);Array.isArray(h)&&(u.easing=h);const d={delay:i,duration:s,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:o+1,direction:"reverse"===r?"alternate":"normal"};return c&&(d.pseudoElement=c),t.animate(u,d)}function mn(t){return"function"==typeof t&&"applyToOptions"in t}function fn({type:t,...e}){return mn(t)&&cn()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class yn extends Me{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:i,keyframes:s,pseudoElement:o,allowFlatten:r=!1,finalKeyframe:a,onComplete:l}=e;this.isPseudoElement=Boolean(o),this.allowFlatten=r,this.options=e,t.invariant("string"!=typeof e.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const c=fn(e);this.animation=pn(n,i,s,c,o),!1===c.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const t=Ae(s,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(t),sn(n,i,t),this.animation.cancel()}l?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return f(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+f(t)}get time(){return f(Number(this.animation.currentTime)||0)}set time(t){const e=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=m(t),e&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:e,rangeEnd:n,observe:i}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&an()?(this.animation.timeline=t,e&&(this.animation.rangeStart=e),n&&(this.animation.rangeEnd=n),u):i(this)}}const gn={anticipate:M,backInOut:P,circInOut:D};function vn(t){"string"==typeof t.ease&&t.ease in gn&&(t.ease=gn[t.ease])}class xn extends yn{constructor(t){vn(t),Pe(t),super(t),void 0!==t.startTime&&!1!==t.autoplay&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:e,onUpdate:n,onComplete:s,element:o,...r}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);const a=new ke({...r,autoplay:!1}),l=Math.max(10,G.now()-this.startTime),c=i(0,10,l-10),u=a.sample(l).value,{name:h}=this.options;o&&h&&sn(o,h,u),e.setWithVelocity(a.sample(Math.max(0,l-c)).value,u,c),a.stop()}}const wn=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Mt.test(t)&&"0"!==t||t.startsWith("url(")));function Tn(t){t.duration=0,t.type="keyframes"}const bn=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),Sn=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;const An=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),Vn=c(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Pn(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:s,damping:o,type:r,keyframes:a}=t,l=e?.owner?.current;if(!(l instanceof HTMLElement||l instanceof SVGElement))return!1;const{onUpdate:c,transformTemplate:u}=e.owner.getProps();return Vn()&&n&&(bn.has(n)||An.has(n)&&function(t){for(let e=0;e{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=G.now();const h={autoplay:t,delay:e,type:n,repeat:i,repeatDelay:s,repeatType:o,name:a,motionValue:l,element:c,...u},d=c?.KeyframeResolver||en;this.keyframeResolver=new d(r,(t,e,n)=>this.onKeyframesResolved(t,e,h,!n),a,l,c),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,n,i,s){this.keyframeResolver=void 0;const{name:r,type:a,velocity:l,delay:c,isHandoff:h,onUpdate:d}=i;this.resolvedAt=G.now();let p=!0;(function(e,n,i,s){const o=e[0];if(null===o)return!1;if("display"===n||"visibility"===n)return!0;const r=e[e.length-1],a=wn(o,n),l=wn(r,n);return t.warning(a===l,`You are trying to animate ${n} from "${o}" to "${r}". "${a?r:o}" is not an animatable value.`,"value-not-animatable"),!(!a||!l)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:n,...i,keyframes:e},f=p&&!h&&Pn(m),y=m.motionValue?.owner?.current;let g;if(f)try{g=new xn({...m,element:y})}catch{g=new ke(m)}else g=new ke(m);g.finished.then(()=>{this.notifyFinished()}).catch(u),this.pendingTimeline&&(this.stopTimeline=g.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=g}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),tn()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}class En{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;ne.attachTimeline(t));return()=>{e.forEach((t,e)=>{t&&t(),this.animations[e].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return kn(this.animations,"duration")}get iterationDuration(){return kn(this.animations,"iterationDuration")}runAll(t){this.animations.forEach(e=>e[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function kn(t,e){let n=0;for(let i=0;in&&(n=s)}return n}class Dn extends En{then(t,e){return this.finished.finally(t).then(()=>{})}}class Cn extends yn{constructor(t){super(),this.animation=t,t.onfinish=()=>{this.finishedTime=this.time,this.notifyFinished()}}}const Bn=new WeakMap,Rn=(t,e="")=>`${t}:${e}`;function Ln(t){let e=Bn.get(t);return e||(e=new Map,Bn.set(t,e)),e}function jn(t,e,n,i=0,s=1){const o=Array.from(t).sort((t,e)=>t.sortNodePosition(e)).indexOf(e),r=t.size,a=(r-1)*i;return"function"==typeof n?n(o,r):1===s?o*i:a-o*i}const On={current:void 0};class Fn{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=G.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=G.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new p);const n=this.events[t].add(e);return"change"===t?()=>{n(),W.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return On.current&&On.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=G.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return y(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function In(t,e){return new Fn(t,e)}function $n(t,e){if(t?.inherit&&e){const{inherit:n,...i}=t;return{...e,...i}}return t}function Nn(t,e){const n=t?.[e]??t?.default??t;return n!==t?$n(n,t):n}const Wn={type:"spring",stiffness:500,damping:25,restSpeed:10},Un={type:"keyframes",duration:.8},zn={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Kn=(t,{keyframes:e})=>e.length>2?Un:ze.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:Wn:zn,Yn=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function Xn(t){for(const e in t)if(!Yn.has(e))return!0;return!1}const Gn=(t,e,n,i={},s,r)=>a=>{const l=Nn(i,t)||{},c=l.delay||i.delay||0;let{elapsed:u=0}=i;u-=m(c);const h={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...l,delay:-u,onUpdate:t=>{e.set(t),l.onUpdate&&l.onUpdate(t)},onComplete:()=>{a(),l.onComplete&&l.onComplete()},name:t,motionValue:e,element:r?void 0:s};Xn(l)||Object.assign(h,Kn(t,h)),h.duration&&(h.duration=m(h.duration)),h.repeatDelay&&(h.repeatDelay=m(h.repeatDelay)),void 0!==h.from&&(h.keyframes[0]=h.from);let d=!1;if((!1===h.type||0===h.duration&&!h.repeatDelay)&&(Tn(h),0===h.delay&&(d=!0)),(o.instantAnimations||o.skipAnimations||s?.shouldSkipAnimations||l.skipAnimations)&&(d=!0,Tn(h),h.delay=0),h.allowFlatten=!l.type&&!l.ease,d&&!r&&void 0!==e.get()){const t=Ae(h.keyframes,l);if(void 0!==t)return void W.update(()=>{h.onUpdate(t),h.onComplete()})}return l.isSync?new ke(h):new Mn(h)};function Hn(t,e,n,i){const s=1-t;return s*s*e+2*s*t*n+t*t*i}function qn(t,e,n,i,s,o,r){const a=2*(1-t)*(n-e)+2*t*(i-n),l=2*(1-t)*(o-s)+2*t*(r-o);return Math.atan2(l,a)*(180/Math.PI)}function Zn(t,e,n,i,s,o){const r=n-t,a=i-e,l=Math.sqrt(r*r+a*a);if(l>0){const n=s*l;return{x:t+r*o+-a/l*n,y:e+a*o+r/l*n}}return{x:t,y:e}}const _n=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Jn(t){const e=_n.exec(t);if(!e)return[,];const[,n,i,s]=e;return[`--${n??i}`,s]}function Qn(e,n,i=1){t.invariant(i<=4,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[s,o]=Jn(e);if(!s)return;const a=window.getComputedStyle(n).getPropertyValue(s);if(a){const t=a.trim();return r(t)?parseFloat(t):t}return _(o)?Qn(o,n,i+1):o}function ti(t){const e=[{},{}];return t?.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}function ei(t,e,n,i){if("function"==typeof e){const[s,o]=ti(i);e=e(void 0!==n?n:t.custom,s,o)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[s,o]=ti(i);e=e(void 0!==n?n:t.custom,s,o)}return e}function ni(t,e,n){const i=t.getProps();return ei(i,e,void 0!==n?n:i.custom,t)}const ii=new Set(["width","height","top","left","right","bottom",...Ue]),si=t=>Array.isArray(t);function oi(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,In(n))}function ri(t){return si(t)?t[t.length-1]||0:t}function ai(t,e){const n=ni(t,e);let{transitionEnd:i={},transition:s={},...o}=n||{};o={...o,...i};for(const e in o){oi(t,e,ri(o[e]))}}const li=t=>Boolean(t&&t.getVelocity);function ci(t){return Boolean(li(t)&&t.add)}function ui(t,e){const n=t.getValue("willChange");if(ci(n))return n.add(e);if(!n&&o.WillChange){const n=new o.WillChange("auto");t.addValue("willChange",n),n.add(e)}}function hi(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const di="framerAppearId",pi="data-"+hi(di);function mi(t){return t.props[pi]}function fi({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}function yi(t,e,{delay:n=0,transitionOverride:i,type:s}={}){let{transition:o,transitionEnd:r,...a}=e;const l=t.getDefaultTransition();o=o?$n(o,l):l;const c=o?.reduceMotion,u=o?.skipAnimations;i&&(o=i);const h=[],d=s&&t.animationState&&t.animationState.getState()[s],p=o?.path;p&&p.animateVisualElement(t,a,o,n,h);for(const e in a){const i=t.getValue(e,t.latestValues[e]??null),s=a[e];if(void 0===s||d&&fi(d,e))continue;const r={delay:n,...Nn(o||{},e)};u&&(r.skipAnimations=!0);const l=i.get();if(void 0!==l&&!i.isAnimating()&&!Array.isArray(s)&&s===l&&!r.velocity){W.update(()=>i.set(s));continue}let p=!1;if(window.MotionHandoffAnimation){const n=mi(t);if(n){const t=window.MotionHandoffAnimation(n,e,W);null!==t&&(r.startTime=t,p=!0)}}ui(t,e);const m=c??t.shouldReduceMotion;i.start(Gn(e,i,s,m&&ii.has(e)?{type:!1}:r,t,p));const f=i.animation;f&&h.push(f)}if(r){const e=()=>W.update(()=>{r&&ai(t,r)});h.length?Promise.all(h).then(e):e()}return h}function gi(t,e,n={}){const i=ni(t,e,"exit"===n.type?t.presenceContext?.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const o=i?()=>Promise.all(yi(t,i,n)):()=>Promise.resolve(),r=t.variantChildren&&t.variantChildren.size?(i=0)=>{const{delayChildren:o=0,staggerChildren:r,staggerDirection:a}=s;return function(t,e,n=0,i=0,s=0,o=1,r){const a=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),a.push(gi(l,e,{...r,delay:n+("function"==typeof i?0:i)+jn(t.variantChildren,l,i,s,o)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(a)}(t,e,i,o,r,a,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[t,e]="beforeChildren"===a?[o,r]:[r,o];return t().then(()=>e())}return Promise.all([o(),r(n.delay)])}function vi(t,e,n={}){let i;if(t.notify("AnimationStart",e),Array.isArray(e)){const s=e.map(e=>gi(t,e,n));i=Promise.all(s)}else if("string"==typeof e)i=gi(t,e,n);else{const s="function"==typeof e?ni(t,e,n.custom):e;i=Promise.all(yi(t,s,n))}return i.then(()=>{t.notify("AnimationComplete",e)})}const xi=t=>e=>e.test(t),wi=[tt,mt,pt,dt,yt,ft,{test:t=>"auto"===t,parse:t=>t}],Ti=t=>wi.find(xi(t));function bi(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||l(t))}const Si=new Set(["brightness","contrast","saturate","opacity"]);function Ai(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(st)||[];if(!i)return t;const s=n.replace(i,"");let o=Si.has(e)?1:0;return i!==n&&(o*=100),e+"("+o+s+")"}const Vi=/\b([a-z-]*)\(.*?\)/gu,Pi={...Mt,getAnimatableNone:t=>{const e=t.match(Vi);return e?e.map(Ai).join(" "):t}},Mi={...Mt,getAnimatableNone:t=>{const e=Mt.parse(t);return Mt.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},Ei={...tt,transform:Math.round},ki={rotate:dt,pathRotation:dt,rotateX:dt,rotateY:dt,rotateZ:dt,scale:nt,scaleX:nt,scaleY:nt,scaleZ:nt,skew:dt,skewX:dt,skewY:dt,distance:mt,translateX:mt,translateY:mt,translateZ:mt,x:mt,y:mt,z:mt,perspective:mt,transformPerspective:mt,opacity:et,originX:gt,originY:gt,originZ:mt},Di={borderWidth:mt,borderTopWidth:mt,borderRightWidth:mt,borderBottomWidth:mt,borderLeftWidth:mt,borderRadius:mt,borderTopLeftRadius:mt,borderTopRightRadius:mt,borderBottomRightRadius:mt,borderBottomLeftRadius:mt,width:mt,maxWidth:mt,height:mt,maxHeight:mt,top:mt,right:mt,bottom:mt,left:mt,inset:mt,insetBlock:mt,insetBlockStart:mt,insetBlockEnd:mt,insetInline:mt,insetInlineStart:mt,insetInlineEnd:mt,padding:mt,paddingTop:mt,paddingRight:mt,paddingBottom:mt,paddingLeft:mt,paddingBlock:mt,paddingBlockStart:mt,paddingBlockEnd:mt,paddingInline:mt,paddingInlineStart:mt,paddingInlineEnd:mt,margin:mt,marginTop:mt,marginRight:mt,marginBottom:mt,marginLeft:mt,marginBlock:mt,marginBlockStart:mt,marginBlockEnd:mt,marginInline:mt,marginInlineStart:mt,marginInlineEnd:mt,fontSize:mt,backgroundPositionX:mt,backgroundPositionY:mt,...ki,zIndex:Ei,fillOpacity:et,strokeOpacity:et,numOctaves:Ei},Ci={...Di,color:xt,backgroundColor:xt,outlineColor:xt,fill:xt,stroke:xt,borderColor:xt,borderTopColor:xt,borderRightColor:xt,borderBottomColor:xt,borderLeftColor:xt,filter:Pi,WebkitFilter:Pi,mask:Mi,WebkitMask:Mi},Bi=t=>Ci[t],Ri=new Set([Pi,Mi]);function Li(t,e){let n=Bi(t);return Ri.has(n)||(n=Mt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const ji=new Set(["auto","none","0"]);class Oi extends en{constructor(t,e,n,i,s){super(t,e,n,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n{t.getValue(e).set(n)}),this.resolveNoneKeyframes()}}const Fi=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"],Ii=new Set(["borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius",...Fi,"width","maxWidth","height","maxHeight","top","right","bottom","left","inset","insetBlock","insetBlockStart","insetBlockEnd","insetInline","insetInlineStart","insetInlineEnd","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingBlock","paddingBlockStart","paddingBlockEnd","paddingInline","paddingInlineStart","paddingInlineEnd","margin","marginTop","marginRight","marginBottom","marginLeft","marginBlock","marginBlockStart","marginBlockEnd","marginInline","marginInlineStart","marginInlineEnd","fontSize","backgroundPositionX","backgroundPositionY"]);function $i(t,e){for(let n=0;n{try{document.createElement("div").animate({opacity:[1]})}catch(t){return!1}return!0});function Wi(t,e,n){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){let i=document;e&&(i=e.current);const s=n?.[t]??i.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t).filter(t=>null!=t)}function Ui(t){return(e,n)=>{const i=Wi(e),s=[];for(const e of i){const i=t(e,n);s.push(i)}return()=>{for(const t of s)t()}}}const zi=(t,e)=>e&&"number"==typeof t?e.transform(t):t;class Ki{constructor(){this.latest={},this.values=new Map}set(t,e,n,i,s=!0){const o=this.values.get(t);o&&o.onRemove();const r=()=>{const i=e.get();this.latest[t]=s?zi(i,Di[t]):i,n&&W.render(n)};r();const a=e.on("change",r);i&&e.addDependent(i);const l=()=>{a(),n&&U(n),this.values.delete(t),i&&e.removeDependent(i)};return this.values.set(t,{value:e,onRemove:l}),l}get(t){return this.values.get(t)?.value}}function Yi(t){const e=new WeakMap;return(n,i)=>{const s=e.get(n)??new Ki;e.set(n,s);const o=[];for(const e in i){const r=i[e],a=t(n,s,e,r);o.push(a)}return()=>{for(const t of o)t()}}}const Xi=(t,e,n,i)=>{const s=function(t,e){if(!(e in t))return!1;const n=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(t),e)||Object.getOwnPropertyDescriptor(t,e);return n&&"function"==typeof n.set}(t,n),o=s?n:n.startsWith("data")||n.startsWith("aria")?hi(n):n,r=s?()=>{t[o]=e.latest[n]}:()=>{const i=e.latest[n];null==i?t.removeAttribute(o):t.setAttribute(o,String(i))};return e.set(n,i,r)},Gi=Ui(Yi(Xi)),Hi=Yi((t,e,n,i)=>e.set(n,i,()=>{t[n]=e.latest[n]},void 0,!1));function qi(t){return a(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const Zi={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"};const _i=new Set(["originX","originY","originZ"]),Ji=(t,e,n,i)=>{let s,o;return ze.has(n)?(e.get("transform")||(qi(t)||e.get("transformBox")||Ji(t,e,"transformBox",new Fn("fill-box")),e.set("transform",new Fn("none"),()=>{t.style.transform=function(t){let e="",n=!0;for(let i=0;i{const n=e.latest.originX??"50%",i=e.latest.originY??"50%",s=e.latest.originZ??0;t.style.transformOrigin=`${n} ${i} ${s}`}),o=e.get("transformOrigin")):s=nn(n)?()=>{t.style.setProperty(n,e.latest[n])}:()=>{t.style[n]=e.latest[n]},e.set(n,i,s,o)},Qi=Ui(Yi(Ji));const ts=Ui(Yi((t,e,n,i)=>{if(n.startsWith("path"))return function(t,e,n,i){return W.render(()=>t.setAttribute("pathLength","1")),"pathOffset"===n?e.set(n,i,()=>{const i=e.latest[n];t.setAttribute("stroke-dashoffset",""+-i)}):(e.get("stroke-dasharray")||e.set("stroke-dasharray",new Fn("1 1"),()=>{const{pathLength:n=1,pathSpacing:i}=e.latest;t.setAttribute("stroke-dasharray",`${n} ${i??1-Number(n)}`)}),e.set(n,i,void 0,e.get("stroke-dasharray")))}(t,e,n,i);if(n.startsWith("attr"))return Xi(t,e,function(t){return t.replace(/^attr([A-Z])/,(t,e)=>e.toLowerCase())}(n),i);return(n in t.style?Ji:Xi)(t,e,n,i)}));const{schedule:es,cancel:ns}=N(queueMicrotask,!1),is={x:!1,y:!1};function ss(){return is.x||is.y}function os(t,e){const n=Wi(t),i=new AbortController;return[n,{passive:!0,...e,signal:i.signal},()=>i.abort()]}const rs=(t,e)=>!!e&&(t===e||rs(t,e.parentElement)),as=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,ls=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function cs(t){return ls.has(t.tagName)||!0===t.isContentEditable}const us=new Set(["INPUT","SELECT","TEXTAREA"]);const hs=new WeakSet;function ds(t){return e=>{"Enter"===e.key&&t(e)}}function ps(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function ms(t){return as(t)&&!ss()}const fs=new WeakSet;function ys(t,e){const n=window.getComputedStyle(t);return nn(e)?n.getPropertyValue(e):n[e]}function gs(t){return a(t)&&"ownerSVGElement"in t}const vs=new WeakMap;let xs;const ws=(t,e,n)=>(i,s)=>s&&s[0]?s[0][t+"Size"]:gs(i)&&"getBBox"in i?i.getBBox()[e]:i[n],Ts=ws("inline","width","offsetWidth"),bs=ws("block","height","offsetHeight");function Ss({target:t,borderBoxSize:e}){vs.get(t)?.forEach(n=>{n(t,{get width(){return Ts(t,e)},get height(){return bs(t,e)}})})}function As(t){t.forEach(Ss)}function Vs(t,e){xs||"undefined"!=typeof ResizeObserver&&(xs=new ResizeObserver(As));const n=Wi(t);return n.forEach(t=>{let n=vs.get(t);n||(n=new Set,vs.set(t,n)),n.add(e),xs?.observe(t)}),()=>{n.forEach(t=>{const n=vs.get(t);n?.delete(e),n?.size||xs?.unobserve(t)})}}const Ps=new Set;let Ms;function Es(t){return Ps.add(t),Ms||(Ms=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};Ps.forEach(e=>e(t))},window.addEventListener("resize",Ms)),()=>{Ps.delete(t),Ps.size||"function"!=typeof Ms||(window.removeEventListener("resize",Ms),Ms=void 0)}}function ks(t,e){return"function"==typeof t?Es(t):Vs(t,e)}function Ds(t,e){let n;const i=()=>{const{currentTime:i}=e,s=(null===i?0:i.value)/100;n!==s&&t(s),n=s};return W.preUpdate(i,!0),()=>U(i)}const Cs={value:null,addProjectionMetrics:null};function Bs(t){return gs(t)&&"svg"===t.tagName}function Rs(t,e){if("first"===t)return 0;{const n=e-1;return"last"===t?n:n/2}}function Ls(...t){const e=!Array.isArray(t[0]),n=e?0:-1,i=t[0+n],s=ge(t[1+n],t[2+n],t[3+n]);return e?s(i):s}function js(t,e){const n=In(li(t)?t.get():t);return Os(n,t,e),n}function Os(t,e,n={}){const i=t.get();let s,o=null,r=i;const a="string"==typeof i?i.replace(/[\d.-]/g,""):void 0,l=()=>{o&&(o.stop(),o=null),t.animation=void 0},c=()=>{(()=>{const e=Is(t.get()),i=Is(r);if(e===i)return void l();const a=o?o.getGeneratorVelocity():t.getVelocity();l(),o=new ke({keyframes:[e,i],velocity:a,type:"spring",restDelta:.001,restSpeed:.01,...n,onUpdate:s})})(),t.animation=o??void 0,t.events.animationStart?.notify(),o?.then(()=>{t.animation=void 0,t.events.animationComplete?.notify()})};if(t.attach((t,e)=>{r=t,s=t=>e(Fs(t,a)),W.postRender(c)},l),li(e)){let i=!0===n.skipInitialAnimation;const s=e.on("change",e=>{i?(i=!1,t.jump(Fs(e,a),!1)):t.set(Fs(e,a))}),o=t.on("destroy",s);return()=>{s(),o()}}return l}function Fs(t,e){return e?t+e:t}function Is(t){return"number"==typeof t?t:parseFloat(t)}function $s(t){const e=[];On.current=e;const n=t();On.current=void 0;const i=In(n);return function(t,e,n){const i=()=>e.set(n()),s=()=>W.preRender(i,!1,!0),o=t.map(t=>t.on("change",s));e.on("destroy",()=>{o.forEach(t=>t()),U(i)})}(e,i,t),i}const Ns=[...wi,xt,Mt],Ws=t=>Ns.find(xi(t));let Us=0;const zs=()=>"motion-view-"+Us++;function Ks(t,e,n){e&&(t.style?.setProperty("view-transition-class",e),n.push(t))}function Ys(t,e,n,i,s){if(n&&(t.style?.setProperty("view-transition-group",n),i.push(t),"none"!==n&&s)){const n=getComputedStyle(t);"visible"===n.overflowX&&"visible"===n.overflowY||s.add(e)}}function Xs(t,e,n,i,s,o=[],r,a=[],l){const c=Wi(t);if(i)return c.map((t,c)=>{const u=e.get(t);if(u)return u;const h=i[c]??zs();return t.style?.setProperty("view-transition-name",h),n.push(t),e.set(t,h),Ks(t,s,o),Ys(t,h,r,a,l),h});const u=c.map(t=>e.has(t)?void 0:getComputedStyle(t).getPropertyValue("view-transition-name"));return c.map((t,i)=>{const c=e.get(t);if(c)return c;const h=u[i];let d;return h&&"none"!==h&&"auto"!==h&&"match-element"!==h&&!(t=>t.startsWith("motion-view-"))(h)?d=h:(d=zs(),t.style?.setProperty("view-transition-name",d),n.push(t)),e.set(t,d),Ks(t,s,o),Ys(t,d,r,a,l),d})}function Gs(t){return"layout"===t?"group":"enter"===t||"new"===t?"new":"old"}let Hs={},qs=null;const Zs=(t,e)=>{Hs[t]=e},_s=()=>{qs||(qs=document.createElement("style"),qs.id="motion-view");let t="";for(const e in Hs){const n=Hs[e];t+=`${e} {\n`;for(const[e,i]of Object.entries(n))t+=` ${e}: ${i};\n`;t+="}\n"}qs.textContent=t,document.head.appendChild(qs),Hs={}},Js=()=>{qs&&qs.parentElement&&qs.parentElement.removeChild(qs)};function Qs(t){const e=t.match(/::view-transition-(old|new|group-children|group|image-pair)\((.*?)\)/);return e?{layer:e[2],type:e[1]}:null}function to(){return document.getAnimations().filter(t=>{const{effect:e}=t;return!!e&&e.target===document.documentElement&&e.pseudoElement?.startsWith("::view-transition")})}const eo=["layout","enter","exit","new","old"],no=t=>t.split(" ").every(t=>0===parseFloat(t)),io={group:["layout"],new:["new","enter"],old:["old","exit"]},so={new:{opacity:0,scale:.85},old:{opacity:1,scale:1}};function oo(t){const{update:e,targets:n,resolveDefs:i,cropOverride:s,pairs:o,classNames:r,flatGroups:a,options:l}=t;if(!document.startViewTransition)return(async()=>(await e(),new En([])))();const c=new Map,u=[],h=[],d=[],p=new Set,f=new Map,y=new Set,g=new Map,x=new Map,w=new Map,T=new Map,b=t=>{n.forEach((e,n)=>{const l=r.get(n),m="root"!==n&&i.has(n)?a.has(n)?"none":"contain":void 0;let y;if("root"!==n&&i.has(n))if(o.has(n))if("old"===t)T.set(n,Wi(n)),y=Xs(n,c,u,void 0,l,h,m,d,p),w.set(n,y);else{for(const t of T.get(n)??[])t.style?.removeProperty("view-transition-name"),c.delete(t);y=Xs(o.get(n),c,u,w.get(n),l,h,m,d,p)}else y=Xs(n,c,u,void 0,l,h,m,d,p);else y=[n];const v=s.get(n);y.forEach((n,i)=>{const s=f.get(n);f.set(n,s&&s!==e?{...s,...e}:e),void 0!==v&&g.set(n,v);const o=x.get(n)??{};o[t]=[i,y.length],x.set(n,o)})})},S=(t,e)=>{const n=x.get(t);return("old"===e?n?.old:"new"===e?n?.new:n?.new??n?.old)??[-1,1]},A=(t,e,n,i,s)=>{const o=ro(Nn(l,n),Nn(function(t,e){for(const n of io[e]??[]){const e=t?.[n]?.options;if(e)return e}}(t,e)??{},n));return"function"==typeof o.delay&&(o.delay=o.delay(i,s)),o},V=t=>{const[e,n]=S(t,"group"),i=A(f.get(t),"group","layout",-1===e?0:e,n);i.duration&&(i.duration=m(i.duration));const{delay:s=0,duration:o,ease:r}=fn(i);return{delay:m(s),duration:o,ease:r}},P=new Map,M=t=>c.forEach((e,n)=>{const i=n,s=i.getBoundingClientRect?.();if(s&&s.height){const n=getComputedStyle(i),o={};for(const t of Fi)o[t]=n[t];const r=P.get(e)??{};r[t]={width:s.width,height:s.height,radii:o},P.set(e,r)}}),E=t=>{const e=P.get(t);return!!(e?.old&&e?.new&&e.old.height&&e.new.height)&&Math.abs(e.old.width/e.old.height-e.new.width/e.new.height)>.2},k=()=>{(function(t,e){return e.has(t)&&Object.keys(e.get(t)).length>0})("root",n)||Zs(":root",{"view-transition-name":"none"}),Zs("::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)",{"animation-timing-function":"linear !important"}),y.forEach(t=>{Zs(`::view-transition-group(${t})`,{overflow:"clip"}),Zs(`::view-transition-old(${t}), ::view-transition-new(${t})`,{width:"100%",height:"100%","object-fit":"cover"})}),p.forEach(t=>{Zs(`::view-transition-group-children(${t})`,{overflow:"clip"})}),_s()},D=()=>{!function(t,e=[],n=[]){for(const e of t)e.style?.removeProperty("view-transition-name");for(const t of e)t.style?.removeProperty("view-transition-class");for(const t of n)t.style?.removeProperty("view-transition-group")}(u,h,d),Js()},C=async()=>{await e(),b("new"),M("new"),(()=>{y.clear();for(const t of x.keys())"root"!==t&&(g.get(t)??E(t))&&y.add(t)})(),k()};let B;try{b("old"),M("old"),k(),B=document.startViewTransition(C)}catch(t){return D(),Promise.reject(t)}return B.finished.finally(D),new Promise((t,e)=>{B.ready.then(()=>{const e=to(),n=[],i=new Set,s=new Set;f.forEach((t,e)=>{const o=x.get(e),r=!!o?.new&&!o?.old,a=!!o?.old&&!o?.new;for(const o of eo){if(!t[o])continue;if("enter"===o&&!r)continue;if("exit"===o&&!a)continue;const c=Gs(o),[u,h]=S(e,c);if(-1===u)continue;const{keyframes:d,options:p}=t[o];for(let[f,y]of Object.entries(d)){if(null==y)continue;if("x"===f||"y"===f){v(!1,`animateView() animates view-transition layers with CSS properties; the "${f}" shorthand has no effect - use transform, e.g. { transform: "translateX(40px)" }.`);continue}if("new"===o&&r&&null!=t.enter?.keyframes[f])continue;if("old"===o&&a&&null!=t.exit?.keyframes[f])continue;const d=ro(Nn(l,f),Nn(p,f));if(!Array.isArray(y)){const e="enter"===o?t.exit?.keyframes[f]:void 0,n="opacity"===f||("new"===c?r:a),i=null!=e?Array.isArray(e)?e[e.length-1]:e:n?so[c]?.[f]:void 0;void 0!==i&&(y=[i,y])}"function"==typeof d.delay&&(d.delay=d.delay(u,h)),d.duration&&(d.duration=m(d.duration)),d.delay&&(d.delay=m(d.delay)),n.push(new yn({...d,element:document.documentElement,name:f,pseudoElement:`::view-transition-${c}(${e})`,keyframes:y})),i.add(`${e}:${c}`),"opacity"===f&&s.add(`${e}:${c}`)}}});for(const t of e){if("finished"===t.playState)continue;const{effect:e}=t;if(!(e&&e instanceof KeyframeEffect))continue;const{pseudoElement:o}=e;if(!o)continue;const r=Qs(o);if(!r)continue;const a=f.get(r.layer);if(i.has(`${r.layer}:${r.type}`)){s.has(`${r.layer}:new`)&&s.has(`${r.layer}:old`)&&e.getKeyframes().some(t=>t.mixBlendMode)?n.push(new Cn(t)):t.cancel();continue}const l="old"===r.type?"new":"new"===r.type?"old":void 0;if(l&&i.has(`${r.layer}:${l}`)&&!s.has(`${r.layer}:${l}`)){t.cancel();continue}const c=x.get(r.layer),u=!("old"!==r.type&&"new"!==r.type||!c?.old||!c?.new);let h;if(r.type.startsWith("group")){const{delay:t,duration:e,ease:n}=V(r.layer);h={delay:t,duration:e,easing:dn(n,e)}}else{const t=u?"group":r.type,[e,n]=S(r.layer,t);let i=A(a,t,"group"===t?"layout":"",-1===e?0:e,n);const s=i.visualDuration;i.duration&&(i.duration=m(i.duration)),i=fn(i),h={delay:m(i.delay??0),duration:u&&void 0!==s?m(s):i.duration,easing:u?"linear":dn(i.ease,i.duration)}}e.updateTiming(h),n.push(new Cn(t))}P.forEach((t,e)=>{if(!y.has(e))return;const{delay:i,duration:s,ease:o}=V(e);for(const r of Fi){const a=t.old?.radii[r]||t.new?.radii[r]||"0px",l=t.new?.radii[r]||t.old?.radii[r]||"0px";no(a)&&no(l)||n.push(new yn({element:document.documentElement,name:r,pseudoElement:`::view-transition-group(${e})`,keyframes:[a,l],delay:i,duration:s,ease:o}))}}),t(new En(n))}).catch(()=>B.updateCallbackDone.then(()=>t(new En([])),e))})}function ro(t,e){const n={...t,...e};return void 0!==e.duration&&(void 0===e.visualDuration&&delete n.visualDuration,void 0===e.type&&delete n.type),n}let ao=[],lo=null;function co(){lo=null;const[t]=ao;var e;t&&(n(ao,e=t),lo=e,oo(e).then(t=>(e.notifyReady(t),t.finished)).catch(t=>e.notifyReject(t)).finally(co))}function uo(){for(let t=ao.length-1;t>=0;t--){const e=ao[t],{interrupt:n}=e.options;if("immediate"===n){const n=ao.slice(0,t+1).map(t=>t.update),i=ao.slice(t+1);e.update=()=>{n.forEach(t=>t())},ao=[e,...i];break}}lo&&"immediate"!==ao[0]?.options.interrupt||co()}class ho{constructor(t,e={}){var n;this.currentSubject="root",this.targets=new Map,this.resolveDefs=new Set,this.cropOverride=new Map,this.pairs=new Map,this.classNames=new Map,this.flatGroups=new Set,this.notifyReady=u,this.notifyReject=u,this.readyPromise=new Promise((t,e)=>{this.notifyReady=t,this.notifyReject=e}),this.update=t,this.options={interrupt:"wait",...e},this.readyPromise.catch(u),n=this,ao.push(n),es.render(uo)}add(t,e){return this.currentSubject=t,this.resolveDefs.add(t),void 0!==e&&this.pairs.set(t,e),this.targets.has(t)||this.targets.set(t,{}),this}crop(t=!0){return this.cropOverride.set(this.currentSubject,t),this}group(t=!0){return t?this.flatGroups.delete(this.currentSubject):this.flatGroups.add(this.currentSubject),this}class(t){return this.classNames.set(this.currentSubject,t),this}layout(t={}){return this.updateTarget("layout",{},t),this}enter(t,e){return this.updateTarget("enter",t,e),this}exit(t,e){return this.updateTarget("exit",t,e),this}new(t,e){return this.updateTarget("new",t,e),this}old(t,e){return this.updateTarget("old",t,e),this}updateTarget(t,e,n={}){const{currentSubject:i,targets:s}=this;s.has(i)||s.set(i,{});s.get(i)[t]={keyframes:e,options:n}}then(t,e){return this.readyPromise.then(t,e)}}const po=()=>({translate:0,scale:1,origin:0,originPoint:0}),mo=()=>({x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}),fo=()=>({min:0,max:0}),yo=()=>({x:{min:0,max:0},y:{min:0,max:0}}),go=new WeakMap;function vo(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function xo(t){return"string"==typeof t||Array.isArray(t)}const wo=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],To=["initial",...wo];function bo(t){return vo(t.animate)||To.some(e=>xo(t[e]))}function So(t){return Boolean(bo(t)||t.variants)}function Ao(t,e,n){for(const i in e){const s=e[i],o=n[i];if(li(s))t.addValue(i,s);else if(li(o))t.addValue(i,In(s,{owner:t}));else if(o!==s)if(t.hasValue(i)){const e=t.getValue(i);!0===e.liveStyle?e.jump(s):e.hasAnimated||e.set(s)}else{const e=t.getStaticValue(i);t.addValue(i,In(void 0!==e?e:s,{owner:t}))}}for(const i in n)void 0===e[i]&&t.removeValue(i);return e}const Vo={current:null},Po={current:!1},Mo="undefined"!=typeof window;function Eo(){if(Po.current=!0,Mo)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Vo.current=t.matches;t.addEventListener("change",e),e()}else Vo.current=!1}const ko=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Do={};class Co{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:i,skipAnimations:s,blockInitialAnimation:o,visualState:r},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=en,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const t=G.now();this.renderScheduledAtthis.bindToMotionValue(e,t)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(Po.current||Eo(),this.shouldReduceMotion=Vo.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),U(this.notifyUpdate),U(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,e){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),e.accelerate&&bn.has(t)&&this.current instanceof HTMLElement){const{factory:n,keyframes:i,times:s,ease:o,duration:r}=e.accelerate,a=new yn({element:this.current,name:t,keyframes:i,times:s,ease:o,duration:m(r)}),l=n(a);return void this.valueSubscriptions.set(t,()=>{l(),a.cancel()})}const n=ze.has(t);n&&this.onBindTransform&&this.onBindTransform();const i=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&W.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let s;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{i(),s&&s()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in Do){const e=Do[t];if(!e)continue;const{isEnabled:n,Feature:i}=e;if(!this.features[t]&&i&&n(this.props)&&(this.features[t]=new i(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;ee.variantChildren.delete(t)}addValue(t,e){const n=this.values.get(t);e!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=In(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,e){let n=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];return null!=n&&("string"==typeof n&&(r(n)||l(n))?n=parseFloat(n):!Ws(n)&&Mt.test(e)&&(n=Li(t,e)),this.setBaseTarget(t,li(n)?n.get():n)),li(n)?n.get():n}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let n;if("string"==typeof e||"object"==typeof e){const i=ei(this.props,e,this.presenceContext?.custom);i&&(n=i[t])}if(e&&void 0!==n)return n;const i=this.getBaseTargetFromProps(this.props,t);return void 0===i||li(i)?void 0!==this.initialValues[t]&&void 0===n?void 0:this.baseTarget[t]:i}on(t,e){return this.events[t]||(this.events[t]=new p),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){es.render(this.render)}}class Bo extends Co{constructor(){super(...arguments),this.KeyframeResolver=Oi}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){const n=t.style;return n?n[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;li(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}function Ro({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function Lo(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),i=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}function jo(t){return void 0===t||1===t}function Oo({scale:t,scaleX:e,scaleY:n}){return!jo(t)||!jo(e)||!jo(n)}function Fo(t){return Oo(t)||Io(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Io(t){return $o(t.x)||$o(t.y)}function $o(t){return t&&"0%"!==t}function No(t,e,n){return n+e*(t-n)}function Wo(t,e,n,i,s){return void 0!==s&&(t=No(t,s,i)),No(t,n,i)+e}function Uo(t,e=0,n=1,i,s){t.min=Wo(t.min,e,n,i,s),t.max=Wo(t.max,e,n,i,s)}function zo(t,{x:e,y:n}){Uo(t.x,e.translate,e.scale,e.originPoint),Uo(t.y,n.translate,n.scale,n.originPoint)}const Ko=.999999999999,Yo=1.0000000000001;function Xo(t,e,n,i=!1){const s=n.length;if(!s)return;let o,r;e.x=e.y=1;for(let a=0;aKo&&(e.x=1),e.yKo&&(e.y=1)}function Go(t,e){t.min+=e,t.max+=e}function Ho(t,e,n,i,s=.5){Uo(t,e,n,Ct(t.min,t.max,s),i)}function qo(t,e){return"string"==typeof t?parseFloat(t)/100*(e.max-e.min):t}function Zo(t,e,n){const i=n??t;Ho(t.x,qo(e.x,i.x),e.scaleX,e.scale,e.originX),Ho(t.y,qo(e.y,i.y),e.scaleY,e.scale,e.originY)}function _o(t,e){return Ro(Lo(t.getBoundingClientRect(),e))}const Jo={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Qo=Ue.length;function tr(t,e,n){let i="",s=!0;for(let o=0;o{if(!e.target)return t;if("string"==typeof t){if(!mt.test(t))return t;t=parseFloat(t)}return`${ir(t,e.target.x)}% ${ir(t,e.target.y)}%`}},or={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,s=Mt.parse(t);if(s.length>5)return i;const o=Mt.createTransformer(t),r="number"!=typeof s[0]?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;s[0+r]/=a,s[1+r]/=l;const c=Ct(a,l,.5);return"number"==typeof s[2+r]&&(s[2+r]/=c),"number"==typeof s[3+r]&&(s[3+r]/=c),o(s)}},rr={borderRadius:{...sr,applyTo:[...Fi]},borderTopLeftRadius:sr,borderTopRightRadius:sr,borderBottomLeftRadius:sr,borderBottomRightRadius:sr,boxShadow:or};function ar(t,{layout:e,layoutId:n}){return ze.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!rr[t]||"opacity"===t)}function lr(t,e,n){const i=t.style,s=e?.style,o={};if(!i)return o;for(const e in i)(li(i[e])||s&&li(s[e])||ar(e,t)||void 0!==n?.getValue(e)?.liveStyle)&&(o[e]=i[e]);return o}class cr extends Bo{constructor(){super(...arguments),this.type="html",this.renderInstance=nr}mount(e){t.invariant(Boolean(e.style),"motion.create() components must forward their ref to a HTML or SVG element","custom-component-ref"),super.mount(e)}readValueFromInstance(t,e){if(ze.has(e))return this.projection?.isProjecting?Ie(e):Ne(t,e);{const i=(n=t,window.getComputedStyle(n)),s=(q(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof s?s.trim():s}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return _o(t,e)}build(t,e,n){er(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return lr(t,e,n)}}class ur extends Co{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,e){if(function(t,e){return t in e}(e,t)){const n=t[e];if("string"==typeof n||"number"==typeof n)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(t,e){delete e.output[t]}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}build(t,e){Object.assign(t.output,e)}renderInstance(t,{output:e}){Object.assign(t,e)}sortInstanceNodePosition(){return 0}}const hr={offset:"stroke-dashoffset",array:"stroke-dasharray"},dr={offset:"strokeDashoffset",array:"strokeDasharray"};function pr(t,e,n=1,i=0,s=!0){t.pathLength=1;const o=s?hr:dr;t[o.offset]=""+-i,t[o.array]=`${e} ${n}`}const mr=["transform","opacity","offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function fr(t,{attrX:e,attrY:n,attrScale:i,pathLength:s,pathSpacing:o=1,pathOffset:r=0,...a},l,c,u){if(er(t,a,c),l)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:h,style:d}=t;for(const t of mr)void 0!==h[t]&&(d[t]=h[t],delete h[t]);(d.transform||h.transformOrigin)&&(d.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),d.transform&&(d.transformBox=u?.transformBox??"fill-box",delete h.transformBox),void 0!==e&&(h.x=e),void 0!==n&&(h.y=n),void 0!==i&&(h.scale=i),void 0!==s&&pr(h,s,o,r,!1)}const yr=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),gr=t=>"string"==typeof t&&"svg"===t.toLowerCase();function vr(t,e,n,i){nr(t,e,void 0,i);for(const n in e.attrs)t.setAttribute(yr.has(n)?n:hi(n),e.attrs[n])}function xr(t,e,n){const i=lr(t,e,n);for(const n in t)if(li(t[n])||li(e[n])){i[-1!==Ue.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]}return i}class wr extends Bo{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=yo}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(ze.has(e)){const t=Bi(e);return t&&t.default||0}if(mr.includes(e)){const n=getComputedStyle(t)[e];if("string"==typeof n&&n)return n.trim()}return e=yr.has(e)?e:hi(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return xr(t,e,n)}build(t,e,n){fr(t,e,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,e,n,i){vr(t,e,0,i)}mount(t){this.isSVGTag=gr(t.tagName),super.mount(t)}}const Tr=To.length;function br(t){if(!t)return;if(!t.isControllingVariants){const e=t.parent&&br(t.parent)||{};return void 0!==t.props.initial&&(e.initial=t.props.initial),e}const e={};for(let n=0;n=.9999&&t.scale<=1.0001||isNaN(t.scale))&&(t.scale=1),(t.translate>=-.01&&t.translate<=.01||isNaN(t.translate))&&(t.translate=0)}function jr(t,e,n,i){Lr(t.x,e.x,n.x,i?i.originX:void 0),Lr(t.y,e.y,n.y,i?i.originY:void 0)}function Or(t,e,n,i=0){const s=i?Ct(n.min,n.max,i):n.min;t.min=s+e.min,t.max=t.min+Br(e)}function Fr(t,e,n,i){Or(t.x,e.x,n.x,i?.x),Or(t.y,e.y,n.y,i?.y)}function Ir(t,e,n,i=0){const s=i?Ct(n.min,n.max,i):n.min;t.min=e.min-s,t.max=t.min+Br(e)}function $r(t,e,n,i){Ir(t.x,e.x,n.x,i?.x),Ir(t.y,e.y,n.y,i?.y)}function Nr(t,e,n,i,s){return t=No(t-=e,1/n,i),void 0!==s&&(t=No(t,1/s,i)),t}function Wr(t,e=0,n=1,i=.5,s,o=t,r=t){if(pt.test(e)){e=parseFloat(e);e=Ct(r.min,r.max,e/100)-r.min}if("number"!=typeof e)return;let a=Ct(o.min,o.max,i);t===o&&(a-=e),t.min=Nr(t.min,e,n,a,s),t.max=Nr(t.max,e,n,a,s)}function Ur(t,e,[n,i,s],o,r){Wr(t,e[n],e[i],e[s],e.scale,o,r)}const zr=["x","scaleX","originX"],Kr=["y","scaleY","originY"];function Yr(t,e,n,i){Ur(t.x,e,zr,n?n.x:void 0,i?i.x:void 0),Ur(t.y,e,Kr,n?n.y:void 0,i?i.y:void 0)}function Xr(t){return 0===t.translate&&1===t.scale}function Gr(t){return Xr(t.x)&&Xr(t.y)}function Hr(t,e){return t.min===e.min&&t.max===e.max}function qr(t,e){return Hr(t.x,e.x)&&Hr(t.y,e.y)}function Zr(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function _r(t,e){return Zr(t.x,e.x)&&Zr(t.y,e.y)}function Jr(t){return Br(t.x)/Br(t.y)}function Qr(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function ta(t){return[t("x"),t("y")]}function ea(t,e,n){let i="";const s=t.x.translate/e.x,o=t.y.translate/e.y,r=n?.z||0;if((s||o||r)&&(i=`translate3d(${s}px, ${o}px, ${r}px) `),1===e.x&&1===e.y||(i+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:t,rotate:e,pathRotation:s,rotateX:o,rotateY:r,skewX:a,skewY:l}=n;t&&(i=`perspective(${t}px) ${i}`),e&&(i+=`rotate(${e}deg) `),s&&(i+=`rotate(${s}deg) `),o&&(i+=`rotateX(${o}deg) `),r&&(i+=`rotateY(${r}deg) `),a&&(i+=`skewX(${a}deg) `),l&&(i+=`skewY(${l}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return 1===a&&1===l||(i+=`scale(${a}, ${l})`),i||"none"}const na=Fi.length,ia=t=>"string"==typeof t?parseFloat(t):t,sa=t=>"number"==typeof t||mt.test(t);function oa(t,e,n,i,s,o){s?(t.opacity=Ct(0,n.opacity??1,aa(i)),t.opacityExit=Ct(e.opacity??1,0,la(i))):o&&(t.opacity=Ct(e.opacity??1,n.opacity??1,i));for(let s=0;sie?1:n(d(t,e,i))}function ua(t,e,n){const i=li(t)?t:In(t);return i.start(Gn("",i,e,n)),i.animation}function ha(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n,i)}const da=(t,e)=>t.depth-e.depth;class pa{constructor(){this.children=[],this.isDirty=!1}add(t){e(this.children,t),this.isDirty=!0}remove(t){n(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(da),this.isDirty=!1,this.children.forEach(t)}}function ma(t,e){const n=G.now(),i=({timestamp:s})=>{const o=s-n;o>=e&&(U(i),t(o-e))};return W.setup(i,!0),()=>U(i)}function fa(t,e){return ma(t,m(e))}function ya(t){return li(t)?t.get():t}class ga{constructor(){this.members=[]}add(t){e(this.members,t);for(let e=this.members.length-1;e>=0;e--){const i=this.members[e];if(i===t||i===this.lead||i===this.prevLead)continue;const s=i.instance;s&&!1!==s.isConnected||i.snapshot||(n(this.members,i),i.unmount())}t.scheduleRender()}remove(t){if(n(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){for(let e=this.members.indexOf(t)-1;e>=0;e--){const t=this.members[e];if(!1!==t.isPresent&&!1!==t.instance?.isConnected)return this.promote(t),!0}return!1}promote(t,e){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.updateSnapshot(),t.scheduleRender();const{layoutDependency:i}=n.options,{layoutDependency:s}=t.options;void 0!==i&&i===s||(t.resumeFrom=n,e&&(n.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root?.isUpdating&&(t.isLayoutDirty=!0)),!1===t.options.crossfade&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{t.options.onExitComplete?.(),t.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}const va={hasAnimatedSinceResize:!0,hasEverUpdated:!1},xa={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},wa=["","X","Y","Z"];let Ta=0;function ba(t,e,n,i){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),i&&(i[t]=0))}function Sa(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=mi(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:e,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",W,!(e||i))}const{parent:i}=t;i&&!i.hasCheckedOptimisedAppear&&Sa(i)}function Aa({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:o}){return class{constructor(t={},n=e?.()){this.id=Ta++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Cs.value&&(xa.nodes=xa.calculatedTargetDeltas=xa.calculatedProjections=0),this.nodes.forEach(Ma),this.nodes.forEach(Oa),this.nodes.forEach(Fa),this.nodes.forEach(Ea),Cs.addProjectionMetrics&&Cs.addProjectionMetrics(xa)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=t,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let t=0;tthis.root.updateBlockedByResize=!1;W.read(()=>{i=window.innerWidth}),t(e,()=>{const t=window.innerWidth;t!==i&&(i=t,this.root.updateBlockedByResize=!0,n&&n(),n=ma(s,250),va.hasAnimatedSinceResize&&(va.hasAnimatedSinceResize=!1,this.nodes.forEach(ja)))})}n&&this.root.registerSharedNode(n,this),!1!==this.options.animate&&s&&(n||i)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeLayoutChanged:n,layout:i})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const o=this.options.transition||s.getDefaultTransition()||za,{onLayoutAnimationStart:r,onLayoutAnimationComplete:a}=s.getProps(),l=!this.targetLayout||!_r(this.targetLayout,i),c=!e&&n;if(this.options.layoutRoot||this.resumeFrom||c||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const e={...Nn(o,"layout"),onPlay:r,onComplete:a};(s.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e),this.setAnimationOrigin(t,c,e.path)}else e||ja(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=i})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const t=this.getStack();t&&t.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),U(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Ia),this.animationId++)}getTransformTemplate(){const{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Sa(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||Br(this.snapshot.measuredBox.x)||Br(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;t{const n=e/1e3,i=p?.(n);var c,m,f,y;i?(r.x.translate=i.x,r.x.scale=Ct(t.x.scale,1,n),r.x.origin=t.x.origin,r.x.originPoint=t.x.originPoint,r.y.translate=i.y,r.y.scale=Ct(t.y.scale,1,n),r.y.origin=t.y.origin,r.y.originPoint=t.y.originPoint):(Na(r.x,t.x,n),Na(r.y,t.y,n)),this.setTargetDelta(r),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&($r(a,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),c=this.relativeTarget,m=this.relativeTargetOrigin,f=a,y=n,Wa(c.x,m.x,f.x,y),Wa(c.y,m.y,f.y,y),d&&qr(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||(d={x:{min:0,max:0},y:{min:0,max:0}}),Dr(d,this.relativeTarget)),l&&(this.animationValues=o,oa(o,s,this.latestValues,n,h,u)),i&&void 0!==i.rotate&&(this.animationValues||(this.animationValues=o),this.animationValues.pathRotation=i.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(t){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(U(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=W.update(()=>{va.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=In(0)),this.motionValue.jump(0,!1),this.currentAnimation=ua(this.motionValue,[0,1e3],{...t,velocity:0,isSync:!0,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onComplete:()=>{t.onComplete&&t.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const t=this.getStack();t&&t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead();let{targetWithTransforms:e,target:n,layout:i,latestValues:s}=t;if(e&&n&&i){if(this!==t&&this.layout&&i&&Ga(this.options.animationType,this.layout.layoutBox,i.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=Br(this.layout.layoutBox.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const i=Br(this.layout.layoutBox.y);n.y.min=t.target.y.min,n.y.max=n.y.min+i}Dr(e,n),Zo(e,s),jr(this.projectionDeltaWithTransform,this.layoutCorrected,e,s)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new ga);this.sharedNodes.get(t).add(e);const n=e.options.initialPromotionConfig;e.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(e):void 0})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){const{layoutId:t}=this.options;return t&&this.getStack()?.lead||this}getPrevLead(){const{layoutId:t}=this.options;return t?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:n}={}){const i=this.getStack();i&&i.promote(this,n),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetSkewAndRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const{latestValues:n}=t;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(e=!0),!e)return;const i={};n.z&&ba("z",t,i,this.animationValues);for(let e=0;et.currentAnimation?.stop()),this.root.nodes.forEach(Da),this.root.sharedNodes.clear()}}}function Va(t){t.updateLayout()}function Pa(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=t.layout,{animationType:s}=t.options,o=e.source!==t.layout.source;if("size"===s)ta(t=>{const i=o?e.measuredBox[t]:e.layoutBox[t],s=Br(i);i.min=n[t].min,i.max=i.min+s});else if("x"===s||"y"===s){const t="x"===s?"y":"x";kr(o?e.measuredBox[t]:e.layoutBox[t],n[t])}else Ga(s,e.layoutBox,n)&&ta(i=>{const s=o?e.measuredBox[i]:e.layoutBox[i],r=Br(n[i]);s.max=s.min+r,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[i].max=t.relativeTarget[i].min+r)});const r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};jr(r,n,e.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};o?jr(a,t.applyTransform(i,!0),e.measuredBox):jr(a,n,e.layoutBox);const l=!Gr(r);let c=!1;if(!t.resumeFrom){const i=t.getClosestProjectingParent();if(i&&!i.resumeFrom){const{snapshot:s,layout:o}=i;if(s&&o){const r=t.options.layoutAnchor||void 0,a={x:{min:0,max:0},y:{min:0,max:0}};$r(a,e.layoutBox,s.layoutBox,r);const l={x:{min:0,max:0},y:{min:0,max:0}};$r(l,n,o.layoutBox,r),_r(a,l)||(c=!0),i.options.layoutRoot&&(t.relativeTarget=l,t.relativeTargetOrigin=a,t.relativeParent=i)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:a,layoutDelta:r,hasLayoutChanged:l,hasRelativeLayoutChanged:c})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function Ma(t){Cs.value&&xa.nodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=Boolean(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function Ea(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function ka(t){t.clearSnapshot()}function Da(t){t.clearMeasurements()}function Ca(t){t.isLayoutDirty=!0,t.updateLayout()}function Ba(t){t.isLayoutDirty=!1}function Ra(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function La(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function ja(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Oa(t){t.resolveTargetDelta()}function Fa(t){t.calcProjection()}function Ia(t){t.resetSkewAndRotation()}function $a(t){t.removeLeadSnapshot()}function Na(t,e,n){t.translate=Ct(e.translate,0,n),t.scale=Ct(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Wa(t,e,n,i){t.min=Ct(e.min,n.min,i),t.max=Ct(e.max,n.max,i)}function Ua(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const za={duration:.45,ease:[.4,0,.1,1]},Ka=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Ya=Ka("applewebkit/")&&!Ka("chrome/")?Math.round:u;function Xa(t){t.min=Ya(t.min),t.max=Ya(t.max)}function Ga(t,e,n){return"position"===t||"preserve-aspect"===t&&!Rr(Jr(e),Jr(n),.2)}function Ha(t){return t!==t.root&&t.scroll?.wasRoot}const qa=Aa({attachResizeListener:(t,e)=>ha(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Za=t=>!t.isLayoutDirty&&t.willUpdate(!1);const _a={current:void 0},Ja=Aa({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!_a.current){const t=new qa({});t.mount(window),t.setOptions({layoutScroll:!0}),_a.current=t}return _a.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),Qa="[data-layout],[data-layout-id]",tl=new WeakMap;let el;function nl(t){const e=[];return t instanceof HTMLElement&&t.matches(Qa)&&e.push(t),t.querySelectorAll(Qa).forEach(t=>{t instanceof HTMLElement&&e.push(t)}),e}function il(t,e){const n=t.getAttribute("data-layout");return{layoutId:t.getAttribute("data-layout-id")??void 0,layout:null!==n||void 0,animationType:n&&"true"!==n?n:"both",transition:e}}function sl(t,e){let n=tl.get(t);if(n)n.setOptions(il(t,e));else{let i=go.get(t);i||(i=new cr({props:{},presenceContext:null,visualState:{latestValues:{},renderState:{transform:{},transformOrigin:{},style:{},vars:{}}}},{allowProjection:!0})),t.style.transform&&!Fo(i.latestValues)&&(t.style.transform=""),n=new Ja(i.latestValues,function(t){let e=t.parentElement;for(;e;){const t=tl.get(e);if(t&&t.instance)return t;e=e.parentElement}}(t)),i.projection=n,n.setOptions({...il(t,e),visualElement:i}),n.mount(t),tl.set(t,n)}return n.isPresent=!0,n.options.onExitComplete&&n.setOptions({onExitComplete:void 0}),n}function ol(t,e){e.setOptions({onExitComplete:void 0});e.getStack()&&!e.isLead()||e.currentAnimation?.stop(),e.unmount(),tl.delete(t)}function rl(){const t=el;el=void 0,function(){if(z.isProcessing)return;const t=G.now();z.delta=i(0,1e3/60,t-z.timestamp),z.timestamp=t,z.isProcessing=!0,K.update.process(z),K.preRender.process(z),K.render.process(z),z.isProcessing=!1}();const e=new Map;for(const n of t)for(const t of n.collectTargets()){const i=e.get(t);i?i.push(n):e.set(t,[n])}const n=new Map;for(const t of(s=e.keys(),[...s].sort((t,e)=>t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1))){const i=e.get(t),s=sl(t,i[i.length-1].transitionFor(t));for(const e of i)e.adopt(t,s);n.set(t,s)}var s;n.forEach(t=>{t.isLayoutDirty=!1,t.willUpdate()});const o=[];for(const e of t){const t=e.runUpdate();t&&o.push(t)}const r=()=>{const e=new Set;for(const n of t)n.reconcileAdditions(e);for(const n of t)n.reconcileRemovals(e);let i;n.forEach(t=>i||(i=t.root));for(const e of t)i||(i=e.getRoot());i?.didUpdate(),es.render(()=>{for(const e of t)e.finalize()})};o.length?Promise.all(o).then(r):r()}const al=W,ll=$.reduce((t,e)=>(t[e]=t=>U(t),t),{});function cl(t){return"object"==typeof t&&!Array.isArray(t)}function ul(t,e,n,i){return null==t?[]:"string"==typeof t&&cl(e)?Wi(t,n,i):t instanceof NodeList?Array.from(t):Array.isArray(t)?t.filter(t=>null!=t):[t]}function hl(t,e,n){return t*(e+1)+n*e}function dl(t,e,n,i){return"number"==typeof e?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?n:e.startsWith("<")?Math.max(0,n+parseFloat(e.slice(1))):i.get(e)??t}function pl(t,e,i,s,o,r){!function(t,e,i){for(let s=0;se&&o.at"number"==typeof t,Tl=t=>t.every(wl);function bl(t){const e={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=gs(t)&&!Bs(t)?new wr(e):new cr(e);n.mount(t),go.set(t,n)}function Sl(t){const e=new ur({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});e.mount(t),go.set(t,e)}function Al(e,n,i,s){const o=[];if(function(t,e){return li(t)||"number"==typeof t||"string"==typeof t&&!cl(e)}(e,n))o.push(ua(e,cl(n)&&n.default||n,i&&i.default||i));else{if(null==e)return o;const r=ul(e,n,s),a=r.length;t.invariant(Boolean(a),"No valid elements provided.","no-valid-elements");for(let t=0;t{const c=vl(e),{delay:u=0,times:h=xe(c),type:d=n.type||"keyframes",repeat:y,repeatType:g,repeatDelay:x=0,...w}=i;let{ease:T=n.ease||"easeOut",duration:b}=i;const A="function"==typeof u?u(a,l):u,V=c.length,P=mn(d)?d:o?.[d||"keyframes"];if(V<=2&&P){let t=100;if(2===V&&Tl(c)){const e=c[1]-c[0];t=Math.abs(e)}const e={...n,...w};void 0!==b&&(e.duration=m(b));const i=Ht(e,t,P);T=i.ease,b=i.duration}b??(b=r);const M=p+A;1===h.length&&0===h[0]&&(h[1]=1);const E=h.length-c.length;if(E>0&&ve(h,E),1===c.length&&c.unshift(null),y&&t.warning(y<20,`Sequence segments can't repeat ${y} times — ignoring repeat option. Use a value below 20 or apply repeat at the sequence level instead.`),y&&y<20){const t=b>0?x/b:0;b=hl(b,y,x);const e=[...c],n=[...h];T=Array.isArray(T)?[...T]:[T];const i=[...T],s="reverse"===g||"mirror"===g;let o=e,r=i;s&&(o=[...e].reverse(),"reverse"===g&&(r=[...i].reverse().map(t=>"function"==typeof t?S(t):t)));for(let a=0;a0&&(c.push(c[c.length-1]),h.push(p),T.push("linear")),c.push(...u);for(let t=0;t{for(const s in t){const o=t[s];o.sort(fl);const r=[],l=[],c=[];for(let t=0;t{if(Array.isArray(t)&&"function"==typeof t[0]){const e=t[0],n=In(0);return n.on("change",e),1===t.length?[n,[0,1]]:2===t.length?[n,[0,1],t[1]]:[n,t[1],t[2]]}return t}),n,i,{spring:me});return o.forEach(({keyframes:t,transition:e},n)=>{s.push(...Al(n,t,e))}),s}function Pl(t={}){const{scope:e,reduceMotion:i,skipAnimations:s}=t;return function(t,o,r){let a,l=[];const c={};if(void 0!==i&&(c.reduceMotion=i),void 0!==s&&(c.skipAnimations=s),u=t,Array.isArray(u)&&u.some(Array.isArray)){const{onComplete:n,...i}=o||{};"function"==typeof n&&(a=n),l=Vl(t,{...c,...i},e)}else{const{onComplete:n,...i}=r||{};"function"==typeof n&&(a=n),l=Al(t,o,{...c,...i},e)}var u;const h=new Dn(l);return a&&h.finished.then(a),e&&(e.animations.push(h),h.finished.then(()=>{n(e.animations,h)})),h}}const Ml=Pl();const El=e=>function(n,i,s){return new Dn(function(e,n,i,s){if(null==e)return[];const o=Wi(e,s),r=o.length;t.invariant(Boolean(r),"No valid elements provided.","no-valid-elements");const a=[];for(let t=0;te.delete(n)),l.push(s)}return l}(n,i,s,e))},kl=El();function Dl(t){return"undefined"!=typeof window&&(t?ln():an())}const Cl={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function Bl(t,e,n,i){const s=n[e],{length:o,position:r}=Cl[e],a=s.current,l=n.time;s.current=Math.abs(t[`scroll${r}`]),s.scrollLength=t[`scroll${o}`]-t[`client${o}`],s.offset.length=0,s.offset[0]=0,s.offset[1]=s.scrollLength,s.progress=d(0,s.scrollLength,s.current);const c=i-l;s.velocity=c>50?0:y(s.current-a,c)}const Rl={start:0,center:.5,end:1};function Ll(t,e,n=0){let i=0;if(t in Rl&&(t=Rl[t]),"string"==typeof t){const e=parseFloat(t);t.endsWith("px")?i=e:t.endsWith("%")?t=e/100:t.endsWith("vw")?i=e/100*document.documentElement.clientWidth:t.endsWith("vh")?i=e/100*document.documentElement.clientHeight:t=e}return"number"==typeof t&&(i=e*t),n+i}const jl=[0,0];function Ol(t,e,n,i){let s=Array.isArray(t)?t:jl,o=0,r=0;return"number"==typeof t?s=[t,t]:"string"==typeof t&&(s=(t=t.trim()).includes(" ")?t.split(" "):[t,Rl[t]?t:"0"]),o=Ll(s[0],n,i),r=Ll(s[1],e),o-r}const Fl={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},Il={x:0,y:0};function $l(t,e,n){const{offset:s=Fl.All}=n,{target:o=t,axis:r="y"}=n,a="y"===r?"height":"width",l=o!==t?function(t,e){const n={x:0,y:0};let i=t;for(;i&&i!==e;)if(qi(i))n.x+=i.offsetLeft,n.y+=i.offsetTop,i=i.offsetParent;else if("svg"===i.tagName){const t=i.getBoundingClientRect();i=i.parentElement;const e=i.getBoundingClientRect();n.x+=t.left-e.left,n.y+=t.top-e.top}else{if(!(i instanceof SVGGraphicsElement))break;{const{x:t,y:e}=i.getBBox();n.x+=t,n.y+=e;let s=null,o=i.parentNode;for(;!s;)"svg"===o.tagName&&(s=o),o=i.parentNode;i=s}}return n}(o,t):Il,c=o===t?{width:t.scrollWidth,height:t.scrollHeight}:function(t){return"getBBox"in t&&"svg"!==t.tagName?t.getBBox():{width:t.clientWidth,height:t.clientHeight}}(o),u={width:t.clientWidth,height:t.clientHeight};e[r].offset.length=0;let h=!e[r].interpolate;const d=s.length;for(let t=0;t{!function(t,e=t,n){if(n.x.targetOffset=0,n.y.targetOffset=0,e!==t){let i=e;for(;i&&i!==t;)n.x.targetOffset+=i.offsetLeft,n.y.targetOffset+=i.offsetTop,i=i.offsetParent}n.x.targetLength=e===t?e.scrollWidth:e.clientWidth,n.y.targetLength=e===t?e.scrollHeight:e.clientHeight,n.x.containerLength=t.clientWidth,n.y.containerLength=t.clientHeight}(t,i.target,n),function(t,e,n){Bl(t,"x",e,n),Bl(t,"y",e,n),e.time=n}(t,n,e),(i.offset||i.target)&&$l(t,n,i)},notify:()=>e(n)}}const Wl=new WeakMap,Ul=new WeakMap,zl=new WeakMap,Kl=new WeakMap,Yl=new WeakMap,Xl=t=>t===document.scrollingElement?window:t;function Gl(t,{container:e=document.scrollingElement,trackContentSize:n=!1,...i}={}){if(!e)return u;let s=zl.get(e);s||(s=new Set,zl.set(e,s));const o=Nl(e,t,{time:0,x:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0},y:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}},i);if(s.add(o),!Wl.has(e)){const t=()=>{for(const t of s)t.measure(z.timestamp);W.preUpdate(n)},n=()=>{for(const t of s)t.notify()},i=()=>W.read(t);Wl.set(e,i);const o=Xl(e);window.addEventListener("resize",i),e!==document.documentElement&&Ul.set(e,ks(e,i)),o.addEventListener("scroll",i),i()}if(n&&!Yl.has(e)){const t=Wl.get(e),n={width:e.scrollWidth,height:e.scrollHeight};Kl.set(e,n);const i=()=>{const i=e.scrollWidth,s=e.scrollHeight;n.width===i&&n.height===s||(t(),n.width=i,n.height=s)},s=W.read(i,!0);Yl.set(e,s)}const r=Wl.get(e);return W.read(r,!1,!0),()=>{U(r);const t=zl.get(e);if(!t)return;if(t.delete(o),t.size)return;const n=Wl.get(e);Wl.delete(e),n&&(Xl(e).removeEventListener("scroll",n),Ul.get(e)?.(),window.removeEventListener("resize",n));const i=Yl.get(e);i&&(U(i),Yl.delete(e)),Kl.delete(e)}}const Hl=[[Fl.Enter,"entry"],[Fl.Exit,"exit"],[Fl.Any,"cover"],[Fl.All,"contain"]],ql={start:0,end:1};function Zl(t){const e=t.trim().split(/\s+/);if(2!==e.length)return;const n=ql[e[0]],i=ql[e[1]];return void 0!==n&&void 0!==i?[n,i]:void 0}function _l(t,e){const n=function(t){if(2!==t.length)return;const e=[];for(const n of t)if(Array.isArray(n))e.push(n);else{if("string"!=typeof n)return;{const t=Zl(n);if(!t)return;e.push(t)}}return e}(t);if(!n)return!1;for(let t=0;t<2;t++){const i=n[t],s=e[t];if(i[0]!==s[0]||i[1]!==s[1])return!1}return!0}function Jl(t){if(!t)return{rangeStart:"contain 0%",rangeEnd:"contain 100%"};for(const[e,n]of Hl)if(_l(t,e))return{rangeStart:`${n} 0%`,rangeEnd:`${n} 100%`}}const Ql=new Map;function tc(t){const e={value:0},n=Gl(n=>{e.value=100*n[t.axis].progress},t);return{currentTime:e,cancel:n}}function ec({source:t,container:e,...n}){const{axis:i}=n;t&&(e=t);let s=Ql.get(e);s||(s=new Map,Ql.set(e,s));const o=n.target??"self";let r=s.get(o);r||(r={},s.set(o,r));const a=i+(n.offset??[]).join(",");if(!r[a])if(n.target&&Dl(n.target)){const t=Jl(n.offset);r[a]=t?new ViewTimeline({subject:n.target,axis:i}):tc({container:e,...n})}else Dl()?r[a]=new ScrollTimeline({source:e,axis:i}):r[a]=tc({container:e,...n});return r[a]}const nc={some:0,all:1};const ic=(t,e)=>Math.abs(t-e);t.AsyncMotionValueAnimation=Mn,t.DOMKeyframesResolver=Oi,t.DOMVisualElement=Bo,t.DocumentProjectionNode=qa,t.Feature=class{constructor(t){this.isMounted=!1,this.node=t}update(){}},t.FlatTree=pa,t.GroupAnimation=En,t.GroupAnimationWithThen=Dn,t.HTMLProjectionNode=Ja,t.HTMLVisualElement=cr,t.JSAnimation=ke,t.KeyframeResolver=en,t.LayoutAnimationBuilder=class{constructor(t,e,n){this.scope=t,this.updateDom=e,this.defaultOptions=n,this.sharedTransitions=new Map,this.notifyReady=()=>{},this.rejectReady=()=>{},this.tracked=new Map,this.restorePoints=new Map,this.readyPromise=new Promise((t,e)=>{this.notifyReady=t,this.rejectReady=e}),el||(el=[],queueMicrotask(rl)),el.push(this)}shared(t,e){return this.sharedTransitions.set(t,e),this}then(t,e){return this.readyPromise.then(t,e)}transitionFor(t){const e=t.getAttribute("data-layout-id");return e&&this.sharedTransitions.get(e)||this.defaultOptions}adopt(t,e){this.tracked.set(t,e),this.restorePoints.set(t,{parent:t.parentElement,next:t.nextSibling})}collectTargets(){return nl(this.scope)}runUpdate(){try{const t=this.updateDom();if(t&&"function"==typeof t.then)return t.then(void 0,t=>{this.updateError=t})}catch(t){this.updateError=t}}reconcileAdditions(t){for(const e of nl(this.scope)){if(this.tracked.has(e))continue;const n=sl(e,this.transitionFor(e));this.adopt(e,n),n.options.layoutId&&t.add(n.options.layoutId)}}reconcileRemovals(t){this.tracked.forEach((e,n)=>{if(n.isConnected)return;const i=this.restorePoints.get(n);this.restorePoints.delete(n);const{layoutId:s}=e.options,o=e.getStack(),r=o&&o.members.some(t=>t!==e&&t.instance?.isConnected);if(s&&e.isLead()&&r&&!t.has(s)&&i&&i.parent.isConnected){if(i.parent.insertBefore(n,i.next&&i.next.parentNode===i.parent?i.next:null),e.isPresent=!1,e.setOptions({onExitComplete:()=>{n.remove(),ol(n,e)}}),e.relegate())return;n.remove()}ol(n,e),this.tracked.delete(n)})}getRoot(){let t;return this.tracked.forEach(e=>t||(t=e.root)),t}finalize(){if(this.updateError)return void this.rejectReady(this.updateError);const t=new Set;this.tracked.forEach(e=>{e.instance&&e.currentAnimation&&t.add(e.currentAnimation)}),this.notifyReady(new En([...t]))}},t.MotionGlobalConfig=o,t.MotionValue=Fn,t.NativeAnimation=yn,t.NativeAnimationExtended=xn,t.NativeAnimationWrapper=Cn,t.NodeStack=ga,t.ObjectVisualElement=ur,t.SVGVisualElement=wr,t.SubscriptionManager=p,t.ViewTransitionBuilder=ho,t.VisualElement=Co,t.acceleratedValues=bn,t.addAttrValue=Xi,t.addDomEvent=ha,t.addScaleCorrector=function(t){for(const e in t)rr[e]=t[e],q(e)&&(rr[e].isCSSVariable=!0)},t.addStyleValue=Ji,t.addUniqueItem=e,t.addValueToWillChange=ui,t.alpha=et,t.analyseComplexValue=At,t.animate=Ml,t.animateMini=kl,t.animateMotionValue=Gn,t.animateSingleValue=ua,t.animateTarget=yi,t.animateValue=function(t){return new ke(t)},t.animateVariant=gi,t.animateView=function(t,e={}){return new ho(t,e)},t.animateVisualElement=vi,t.animationMapKey=Rn,t.anticipate=M,t.applyAxisDelta=Uo,t.applyBoxDelta=zo,t.applyGeneratorOptions=fn,t.applyPointDelta=Wo,t.applyPxDefaults=$i,t.applyTreeDeltas=Xo,t.arc=function(t={}){const e=function({strength:t=.5,peak:e=.5,direction:n,rotate:i=!1}={}){const s=!0===i?1:"number"==typeof i?i:0;let o;return(i,r)=>{const a=r.x-i.x,l=r.y-i.y;let c;c="cw"===n?-t:"ccw"===n?t:(Math.abs(a)>=Math.abs(l)?a:l)<0?-t:t;let u=Zn(i.x,i.y,r.x,r.y,c,e);if(void 0===n){const t=Math.abs(a){const e={x:Hn(t,i.x,u.x,r.x),y:Hn(t,i.y,u.y,r.y)};if(s){const n=qn(t,i.x,u.x,r.x,i.y,u.y,r.y),o=h+p*t;e.rotate=x(-180,180,n-o)*s}return e}}}(t),n={interpolateProjection(t){const n=t.x.translate,i=t.y.translate;if(!(Math.sqrt(n*n+i*i)<20))return e({x:n,y:i},{x:0,y:0})},animateVisualElement(t,n,i,s,o){if(!("x"in n)&&!("y"in n))return;const r=t.getValue("x",t.latestValues.x??0),a=t.getValue("y",t.latestValues.y??0),l=n.x,c=n.y,u=(Array.isArray(l)&&null!=l[0]?l[0]:r?.get())??0,h=(Array.isArray(c)&&null!=c[0]?c[0]:a?.get())??0,d=Array.isArray(l)?l[l.length-1]:l??u,p=Array.isArray(c)?c[c.length-1]:c??h,m=e({x:u,y:h},{x:d,y:p}),f=void 0!==m(0).rotate?t.getValue("pathRotation",0):void 0,y={delay:s,...Nn(i||{},"x")};delete y.path;const g=In(0);g.start(Gn("",g,[0,1e3],{...y,isSync:!0,velocity:0,onUpdate:t=>{const e=m(t/1e3);r?.set(e.x),a?.set(e.y),f&&void 0!==e.rotate&&f.set(e.rotate)},onComplete:()=>{r?.set(d),a?.set(p),f?.set(0)},onStop:()=>f?.set(0),onCancel:()=>f?.set(0)})),g.animation&&o.push(g.animation),delete n.x,delete n.y}};return n},t.aspectRatio=Jr,t.attachFollow=Os,t.attachSpring=function(t,e,n){return Os(t,e,{type:"spring",...n})},t.attrEffect=Gi,t.axisDeltaEquals=Qr,t.axisEquals=Hr,t.axisEqualsRounded=Zr,t.backIn=V,t.backInOut=P,t.backOut=A,t.boxEquals=qr,t.boxEqualsRounded=_r,t.buildHTMLStyles=er,t.buildProjectionTransform=ea,t.buildSVGAttrs=fr,t.buildSVGPath=pr,t.buildTransform=tr,t.calcAxisDelta=Lr,t.calcBoxDelta=jr,t.calcChildStagger=jn,t.calcGeneratorDuration=Gt,t.calcLength=Br,t.calcRelativeAxis=Or,t.calcRelativeAxisPosition=Ir,t.calcRelativeBox=Fr,t.calcRelativePosition=$r,t.camelCaseAttributes=yr,t.camelToDash=hi,t.cancelFrame=U,t.cancelMicrotask=ns,t.cancelSync=ll,t.checkVariantsDidChange=Pr,t.circIn=E,t.circInOut=D,t.circOut=k,t.clamp=i,t.cleanDirtyNodes=Ea,t.collectMotionValues=On,t.color=xt,t.compareByDepth=da,t.complex=Mt,t.containsCSSVariable=Q,t.convertBoundingBoxToBox=Ro,t.convertBoxToBoundingBox=function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}},t.convertOffsetToTimes=we,t.copyAxisDeltaInto=Cr,t.copyAxisInto=kr,t.copyBoxInto=Dr,t.correctBorderRadius=sr,t.correctBoxShadow=or,t.createAnimationState=function(t){let e=function(t){return e=>Promise.all(e.map(({animation:e,options:n})=>vi(t,e,n)))}(t),n=Er(),i=!0,s=!1;const o=e=>(n,i)=>{const s=ni(t,i,"exit"===e?t.presenceContext?.custom:void 0);if(s){const{transition:t,transitionEnd:e,...i}=s;n={...n,...i,...e}}return n};function r(r){const{props:a}=t,l=br(t.parent)||{},c=[],u=new Set;let h={},d=1/0;for(let e=0;ed&&y,T=!1;const b=Array.isArray(f)?f:[f];let S=b.reduce(o(p),{});!1===g&&(S={});const{prevResolvedValues:A={}}=m,V={...A,...S},P=e=>{w=!0,u.has(e)&&(T=!0,u.delete(e)),m.needsAnimating[e]=!0;const n=t.getValue(e);n&&(n.liveStyle=!1)};for(const t in V){const e=S[t],n=A[t];if(h.hasOwnProperty(t))continue;let i=!1;i=si(e)&&si(n)?!Sr(e,n)||x:e!==n,i?null!=e?P(t):u.add(t):void 0!==e&&u.has(t)?P(t):m.protectedKeys[t]=!0}m.prevProp=f,m.prevResolvedValues=S,m.isActive&&(h={...h,...S}),(i||s)&&t.blockInitialAnimation&&(w=!1);const M=v&&x;w&&(!M||T)&&c.push(...b.map(e=>{const n={type:p};if("string"==typeof e&&(i||s)&&!M&&t.manuallyAnimateOnMount&&t.parent){const{parent:i}=t,s=ni(i,e);if(i.enteringChildren&&s){const{delayChildren:e}=s.transition||{};n.delay=jn(i.enteringChildren,t,e)}}return{animation:e,options:n}}))}if(u.size){const e={};if("boolean"!=typeof a.initial){const n=ni(t,Array.isArray(a.initial)?a.initial[0]:a.initial);n&&n.transition&&(e.transition=n.transition)}u.forEach(n=>{const i=t.getBaseTarget(n),s=t.getValue(n);s&&(s.liveStyle=!0),e[n]=i??null}),c.push({animation:e})}let p=Boolean(c.length);return!i||!1!==a.initial&&a.initial!==a.animate||t.manuallyAnimateOnMount||(p=!1),i=!1,s=!1,p?e(c):Promise.resolve()}return{animateChanges:r,setActive:function(e,i){if(n[e].isActive===i)return Promise.resolve();t.variantChildren?.forEach(t=>t.animationState?.setActive(e,i)),n[e].isActive=i;const s=r(e);for(const t in n)n[t].protectedKeys={};return s},setAnimateFunction:function(n){e=n(t)},getState:()=>n,reset:()=>{n=Er(),s=!0}}},t.createAxis=fo,t.createAxisDelta=po,t.createBox=yo,t.createDelta=mo,t.createGeneratorEasing=Ht,t.createProjectionNode=Aa,t.createRenderBatcher=N,t.createScopedAnimate=Pl,t.cubicBezier=T,t.cubicBezierAsString=un,t.defaultEasing=Te,t.defaultOffset=xe,t.defaultTransformValue=Ie,t.defaultValueTypes=Ci,t.degrees=dt,t.delay=fa,t.delayInSeconds=fa,t.dimensionValueTypes=wi,t.distance=ic,t.distance2D=function(t,e){const n=ic(t.x,e.x),i=ic(t.y,e.y);return Math.sqrt(n**2+i**2)},t.eachAxis=ta,t.easeIn=C,t.easeInOut=R,t.easeOut=B,t.easingDefinitionToFunction=I,t.fillOffset=ve,t.fillWildcards=De,t.findDimensionValueType=Ti,t.findValueType=Ws,t.flushKeyframeResolvers=tn,t.followValue=js,t.frame=W,t.frameData=z,t.frameSteps=K,t.generateLinearEasing=Yt,t.getAnimatableNone=Li,t.getAnimationMap=Ln,t.getComputedStyle=ys,t.getDefaultTransition=Kn,t.getDefaultValueType=Bi,t.getEasingForSegment=j,t.getFeatureDefinitions=function(){return Do},t.getFinalKeyframe=Ae,t.getMixer=$t,t.getOptimisedAppearId=mi,t.getOriginIndex=Rs,t.getValueAsType=zi,t.getValueTransition=Nn,t.getVariableValue=Qn,t.getVariantContext=br,t.getViewAnimationLayerInfo=Qs,t.getViewAnimations=to,t.globalProjectionState=va,t.has2DTranslate=Io,t.hasReducedMotionListener=Po,t.hasScale=Oo,t.hasTransform=Fo,t.hasWarned=function(t){return g.has(t)},t.hex=ut,t.hover=function(t,e,n={}){const[i,s,o]=os(t,n);return i.forEach(t=>{let n,i=!1,o=!1;const r=e=>{n&&(n(e),n=void 0),t.removeEventListener("pointerleave",l)},a=t=>{i=!1,window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",a),o&&(o=!1,r(t))},l=t=>{"touch"!==t.pointerType&&(i?o=!0:r(t))};t.addEventListener("pointerenter",i=>{if("touch"===i.pointerType||ss())return;o=!1;const r=e(t,i);"function"==typeof r&&(n=r,t.addEventListener("pointerleave",l,s))},s),t.addEventListener("pointerdown",()=>{i=!0,window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",a,s)},s)}),o},t.hsla=vt,t.hslaToRgba=kt,t.inView=function(t,e,{root:n,margin:i,amount:s="some"}={}){const o=Wi(t),r=new WeakMap,a=new IntersectionObserver(t=>{t.forEach(t=>{const n=r.get(t.target);if(t.isIntersecting!==Boolean(n))if(t.isIntersecting){const n=e(t.target,t);"function"==typeof n?r.set(t.target,n):a.unobserve(t.target)}else"function"==typeof n&&(n(t),r.delete(t.target))})},{root:n,rootMargin:i,threshold:"number"==typeof s?s:nc[s]});return o.forEach(t=>a.observe(t)),()=>a.disconnect()},t.inertia=ye,t.initPrefersReducedMotion=Eo,t.interpolate=ge,t.invisibleValues=Ot,t.isAnimationControls=vo,t.isBezierDefinition=O,t.isCSSVariableName=q,t.isCSSVariableToken=_,t.isControllingVariants=bo,t.isDeltaZero=Gr,t.isDragActive=ss,t.isDragging=is,t.isEasingArray=L,t.isElementKeyboardAccessible=cs,t.isElementTextInput=function(t){return us.has(t.tagName)||!0===t.isContentEditable},t.isForcedMotionValue=ar,t.isGenerator=mn,t.isHTMLElement=qi,t.isKeyframesTarget=si,t.isMotionValue=li,t.isNear=Rr,t.isNodeOrChild=rs,t.isNumericalString=r,t.isObject=a,t.isPrimaryPointer=as,t.isSVGElement=gs,t.isSVGSVGElement=Bs,t.isSVGTag=gr,t.isTransitionDefined=Xn,t.isVariantLabel=xo,t.isVariantNode=So,t.isWaapiSupportedEasing=function t(e){return Boolean("function"==typeof e&&cn()||!e||"string"==typeof e&&(e in hn||cn())||O(e)||Array.isArray(e)&&e.every(t))},t.isWillChangeMotionValue=ci,t.isZeroValueString=l,t.keyframes=be,t.makeAnimationInstant=Tn,t.mapEasingToNativeEasing=dn,t.mapValue=function(t,e,n,i){const s=Ls(e,n,i);return $s(()=>s(t.get()))},t.maxGeneratorDuration=Xt,t.measurePageBox=function(t,e,n){const i=_o(t,n),{scroll:s}=e;return s&&(Go(i.x,s.offset.x),Go(i.y,s.offset.y)),i},t.measureViewportBox=_o,t.memo=c,t.microtask=es,t.millisecondsToSeconds=f,t.mirrorEasing=b,t.mix=zt,t.mixArray=Nt,t.mixColor=jt,t.mixComplex=Ut,t.mixImmediate=Dt,t.mixLinearColor=Bt,t.mixNumber=Ct,t.mixObject=Wt,t.mixValues=oa,t.mixVisibility=Ft,t.motionValue=In,t.moveItem=function([...t],e,n){const i=e<0?t.length+e:e;if(i>=0&&it.forEach(Za);return{add:i=>{t.add(i),e.set(i,i.addEventListener("willUpdate",n))},remove:i=>{t.delete(i);const s=e.get(i);s&&(s(),e.delete(i)),n()},dirty:n}},t.noop=u,t.number=tt,t.numberValueTypes=Di,t.observeTimeline=Ds,t.optimizedAppearDataAttribute=pi,t.optimizedAppearDataId=di,t.parseAnimateLayoutArgs=function(t,e,n){return"function"==typeof t?{scope:document,updateDom:t,defaultOptions:e}:{scope:t instanceof Document?t:Wi(t)[0]??document,updateDom:e,defaultOptions:n}},t.parseCSSVariable=Jn,t.parseValueFromTransform=$e,t.percent=pt,t.pipe=h,t.pixelsToPercent=ir,t.positionalKeys=ii,t.prefersReducedMotion=Vo,t.press=function(t,e,n={}){const[i,s,o]=os(t,n),r=t=>{const i=t.currentTarget;if(!ms(t))return;if(fs.has(t))return;hs.add(i),n.stopPropagation&&fs.add(t);const o=e(i,t),r={...s,capture:!0},a=(t,e)=>{window.removeEventListener("pointerup",l,r),window.removeEventListener("pointercancel",c,r),hs.has(i)&&hs.delete(i),ms(t)&&"function"==typeof o&&o(t,{success:e})},l=t=>{a(t,i===window||i===document||n.useGlobalTarget||rs(i,t.target))},c=t=>{a(t,!1)};window.addEventListener("pointerup",l,r),window.addEventListener("pointercancel",c,r)};return i.forEach(t=>{(n.useGlobalTarget?window:t).addEventListener("pointerdown",r,s),qi(t)&&(t.addEventListener("focus",t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const i=ds(()=>{if(hs.has(n))return;ps(n,"down");const t=ds(()=>{ps(n,"up")});n.addEventListener("keyup",t,e),n.addEventListener("blur",()=>ps(n,"cancel"),e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)})(t,s)),cs(t)||t.hasAttribute("tabindex")||(t.tabIndex=0))}),o},t.progress=d,t.progressPercentage=gt,t.propEffect=Hi,t.propagateDirtyNodes=Ma,t.px=mt,t.readTransformValue=Ne,t.recordStats=function(){if(Cs.value)throw Cs.value=null,Cs.addProjectionMetrics=null,new Error("Stats are already being measured");const t=Cs;t.value={layoutProjection:{nodes:[],calculatedTargetDeltas:[],calculatedProjections:[]}},t.addProjectionMetrics=e=>{const{layoutProjection:n}=t.value;n.nodes.push(e.nodes),n.calculatedTargetDeltas.push(e.calculatedTargetDeltas),n.calculatedProjections.push(e.calculatedProjections)}},t.removeAxisDelta=Wr,t.removeAxisTransforms=Ur,t.removeBoxTransforms=Yr,t.removeItem=n,t.removePointDelta=Nr,t.renderHTML=nr,t.renderSVG=vr,t.resize=ks,t.resolveElements=Wi,t.resolveMotionValue=ya,t.resolveTransition=$n,t.resolveVariant=ni,t.resolveVariantFromProps=ei,t.reverseEasing=S,t.rgbUnit=lt,t.rgba=ct,t.rootProjectionNode=_a,t.scale=nt,t.scaleCorrectors=rr,t.scalePoint=No,t.scrapeHTMLMotionValuesFromProps=lr,t.scrapeSVGMotionValuesFromProps=xr,t.scroll=function(t,{axis:e="y",container:n=document.scrollingElement,...i}={}){if(!n)return u;const s={axis:e,container:n,...i};return"function"==typeof t?function(t,e){return function(t){return 2===t.length}(t)||function(t){return t&&(t.target||t.offset)}(e)?Gl(n=>{t(n[e.axis].progress,n)},e):Ds(t,ec(e))}(t,s):function(t,e){const n=ec(e),i=e.target?Jl(e.offset):void 0,s=e.target?Dl(e.target)&&!!i:Dl();return t.attachTimeline({timeline:s?n:void 0,...i&&s&&{rangeStart:i.rangeStart,rangeEnd:i.rangeEnd},observe:t=>(t.pause(),Ds(e=>{t.time=t.iterationDuration*e},n))})}(t,s)},t.scrollInfo=Gl,t.secondsToMilliseconds=m,t.setDragLock=function(t){return"x"===t||"y"===t?is[t]?null:(is[t]=!0,()=>{is[t]=!1}):is.x||is.y?null:(is.x=is.y=!0,()=>{is.x=is.y=!1})},t.setFeatureDefinitions=function(t){Do=t},t.setStyle=sn,t.setTarget=ai,t.spring=me,t.springValue=function(t,e){return js(t,{type:"spring",...e})},t.stagger=function(t=.1,{startDelay:e=0,from:n=0,ease:i}={}){return(s,o)=>{const r="number"==typeof n?n:Rs(n,o),a=Math.abs(r-s);let l=t*a;if(i){const e=o*t;l=I(i)(l/e)*e}return e+l}},t.startWaapiAnimation=pn,t.statsBuffer=Cs,t.steps=function(t,e="end"){return n=>{const s=(n="end"===e?Math.min(n,.999):Math.max(n,.001))*t,o="end"===e?Math.floor(s):Math.ceil(s);return i(0,1,o/t)}},t.styleEffect=Qi,t.supportedWaapiEasing=hn,t.supportsBrowserAnimation=Pn,t.supportsFlags=on,t.supportsLinearEasing=cn,t.supportsPartialKeyframes=Ni,t.supportsScrollTimeline=an,t.supportsViewTimeline=ln,t.svgEffect=ts,t.sync=al,t.testValueType=xi,t.time=G,t.transform=Ls,t.transformAxis=Ho,t.transformBox=Zo,t.transformBoxPoints=Lo,t.transformPropOrder=Ue,t.transformProps=ze,t.transformValue=$s,t.transformValueTypes=ki,t.translateAxis=Go,t.updateMotionValuesFromProps=Ao,t.variantPriorityOrder=wo,t.variantProps=To,t.velocityPerSecond=y,t.vh=ft,t.visualElementStore=go,t.vw=yt,t.warnOnce=v,t.wrap=x}); diff --git a/node_modules/framer-motion/dist/es/animation/animate/index.mjs b/node_modules/framer-motion/dist/es/animation/animate/index.mjs new file mode 100644 index 0000000..0e98ea4 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/animate/index.mjs @@ -0,0 +1,58 @@ +import { GroupAnimationWithThen } from 'motion-dom'; +import { removeItem } from 'motion-utils'; +import { animateSequence } from './sequence.mjs'; +import { animateSubject } from './subject.mjs'; + +function isSequence(value) { + return Array.isArray(value) && value.some(Array.isArray); +} +/** + * Creates an animation function that is optionally scoped + * to a specific element. + */ +function createScopedAnimate(options = {}) { + const { scope, reduceMotion, skipAnimations } = options; + /** + * Implementation + */ + function scopedAnimate(subjectOrSequence, optionsOrKeyframes, options) { + let animations = []; + let animationOnComplete; + const inherited = {}; + if (reduceMotion !== undefined) + inherited.reduceMotion = reduceMotion; + if (skipAnimations !== undefined) + inherited.skipAnimations = skipAnimations; + if (isSequence(subjectOrSequence)) { + const { onComplete, ...sequenceOptions } = optionsOrKeyframes || {}; + if (typeof onComplete === "function") { + animationOnComplete = onComplete; + } + animations = animateSequence(subjectOrSequence, { ...inherited, ...sequenceOptions }, scope); + } + else { + // Extract top-level onComplete so it doesn't get applied per-value + const { onComplete, ...rest } = options || {}; + if (typeof onComplete === "function") { + animationOnComplete = onComplete; + } + animations = animateSubject(subjectOrSequence, optionsOrKeyframes, { ...inherited, ...rest }, scope); + } + const animation = new GroupAnimationWithThen(animations); + if (animationOnComplete) { + animation.finished.then(animationOnComplete); + } + if (scope) { + scope.animations.push(animation); + animation.finished.then(() => { + removeItem(scope.animations, animation); + }); + } + return animation; + } + return scopedAnimate; +} +const animate = createScopedAnimate(); + +export { animate, createScopedAnimate }; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/animate/index.mjs.map b/node_modules/framer-motion/dist/es/animation/animate/index.mjs.map new file mode 100644 index 0000000..9fe05f8 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/animate/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../../../../src/animation/animate/index.ts"],"sourcesContent":["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,\n keyframes: string | UnresolvedValueKeyframe[],\n options?: ValueAnimationTransition\n ): AnimationPlaybackControlsWithThen\n /**\n * Animate a number\n */\n function scopedAnimate(\n value: number | MotionValue,\n keyframes: number | UnresolvedValueKeyframe[],\n options?: ValueAnimationTransition\n ): AnimationPlaybackControlsWithThen\n /**\n * Animate a generic motion value\n */\n function scopedAnimate(\n value: V | MotionValue,\n keyframes: V | UnresolvedValueKeyframe[],\n options?: ValueAnimationTransition\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(\n object: O | O[],\n keyframes: ObjectTarget,\n options?: DynamicAnimationOptions\n ): AnimationPlaybackControlsWithThen\n /**\n * Implementation\n */\n function scopedAnimate(\n subjectOrSequence:\n | AnimationSequence\n | MotionValue\n | MotionValue\n | number\n | string\n | ElementOrSelector\n | O\n | O[],\n optionsOrKeyframes?:\n | SequenceOptions\n | number\n | string\n | UnresolvedValueKeyframe[]\n | UnresolvedValueKeyframe[]\n | DOMKeyframesDefinition\n | ObjectTarget,\n options?:\n | ValueAnimationTransition\n | ValueAnimationTransition\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"],"names":[],"mappings":";;;;;AAoBA,SAAS,UAAU,CAAC,KAAc,EAAA;AAC9B,IAAA,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;AAC5D;AAQA;;;AAGG;AACG,SAAU,mBAAmB,CAAC,OAAA,GAAgC,EAAE,EAAA;IAClE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,GAAG,OAAO;AAgDvD;;AAEG;AACH,IAAA,SAAS,aAAa,CAClB,iBAQS,EACT,kBAOqB,EACrB,OAG6B,EAAA;QAE7B,IAAI,UAAU,GAAwC,EAAE;AACxD,QAAA,IAAI,mBAA6C;QAEjD,MAAM,SAAS,GACX,EAAE;QACN,IAAI,YAAY,KAAK,SAAS;AAAE,YAAA,SAAS,CAAC,YAAY,GAAG,YAAY;QACrE,IAAI,cAAc,KAAK,SAAS;AAC5B,YAAA,SAAS,CAAC,cAAc,GAAG,cAAc;AAE7C,QAAA,IAAI,UAAU,CAAC,iBAAiB,CAAC,EAAE;YAC/B,MAAM,EAAE,UAAU,EAAE,GAAG,eAAe,EAAE,GACnC,kBAAsC,IAAI,EAAE;AACjD,YAAA,IAAI,OAAO,UAAU,KAAK,UAAU,EAAE;gBAClC,mBAAmB,GAAG,UAA0B;YACpD;AACA,YAAA,UAAU,GAAG,eAAe,CACxB,iBAAiB,EACjB,EAAE,GAAG,SAAS,EAAE,GAAG,eAAe,EAAqB,EACvD,KAAK,CACR;QACL;aAAO;;YAEH,MAAM,EAAE,UAAU,EAAE,GAAG,IAAI,EAAE,GAAG,OAAO,IAAI,EAAE;AAC7C,YAAA,IAAI,OAAO,UAAU,KAAK,UAAU,EAAE;gBAClC,mBAAmB,GAAG,UAA0B;YACpD;AACA,YAAA,UAAU,GAAG,cAAc,CACvB,iBAAsC,EACtC,kBAA4C,EAC5C,EAAE,GAAG,SAAS,EAAE,GAAG,IAAI,EAA6B,EACpD,KAAK,CACR;QACL;AAEA,QAAA,MAAM,SAAS,GAAG,IAAI,sBAAsB,CAAC,UAAU,CAAC;QAExD,IAAI,mBAAmB,EAAE;AACrB,YAAA,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,mBAAmB,CAAC;QAChD;QAEA,IAAI,KAAK,EAAE;AACP,YAAA,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC;AAChC,YAAA,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAK;AACzB,gBAAA,UAAU,CAAC,KAAK,CAAC,UAAU,EAAE,SAAS,CAAC;AAC3C,YAAA,CAAC,CAAC;QACN;AAEA,QAAA,OAAO,SAAS;IACpB;AAEA,IAAA,OAAO,aAAa;AACxB;AAEO,MAAM,OAAO,GAAG,mBAAmB;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/animation/animate/resolve-subjects.mjs b/node_modules/framer-motion/dist/es/animation/animate/resolve-subjects.mjs new file mode 100644 index 0000000..3888e74 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/animate/resolve-subjects.mjs @@ -0,0 +1,23 @@ +import { resolveElements } from 'motion-dom'; +import { isDOMKeyframes } from '../utils/is-dom-keyframes.mjs'; + +function resolveSubjects(subject, keyframes, scope, selectorCache) { + if (subject == null) { + return []; + } + if (typeof subject === "string" && isDOMKeyframes(keyframes)) { + return resolveElements(subject, scope, selectorCache); + } + else if (subject instanceof NodeList) { + return Array.from(subject); + } + else if (Array.isArray(subject)) { + return subject.filter((s) => s != null); + } + else { + return [subject]; + } +} + +export { resolveSubjects }; +//# sourceMappingURL=resolve-subjects.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/animate/resolve-subjects.mjs.map b/node_modules/framer-motion/dist/es/animation/animate/resolve-subjects.mjs.map new file mode 100644 index 0000000..0429e09 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/animate/resolve-subjects.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"resolve-subjects.mjs","sources":["../../../../src/animation/animate/resolve-subjects.ts"],"sourcesContent":["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(\n subject:\n | string\n | Element\n | Element[]\n | NodeListOf\n | O\n | O[]\n | null\n | undefined,\n keyframes: DOMKeyframesDefinition | ObjectTarget,\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"],"names":[],"mappings":";;;AASM,SAAU,eAAe,CAC3B,OAQe,EACf,SAAmD,EACnD,KAAsB,EACtB,aAA6B,EAAA;AAE7B,IAAA,IAAI,OAAO,IAAI,IAAI,EAAE;AACjB,QAAA,OAAO,EAAE;IACb;IAEA,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,cAAc,CAAC,SAAS,CAAC,EAAE;QAC1D,OAAO,eAAe,CAAC,OAAO,EAAE,KAAK,EAAE,aAAa,CAAC;IACzD;AAAO,SAAA,IAAI,OAAO,YAAY,QAAQ,EAAE;AACpC,QAAA,OAAO,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC;IAC9B;AAAO,SAAA,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;AAC/B,QAAA,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC;IAC3C;SAAO;QACH,OAAO,CAAC,OAAO,CAAC;IACpB;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/animation/animate/sequence.mjs b/node_modules/framer-motion/dist/es/animation/animate/sequence.mjs new file mode 100644 index 0000000..c19af7a --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/animate/sequence.mjs @@ -0,0 +1,36 @@ +import { motionValue, spring } from 'motion-dom'; +import { createAnimationsFromSequence } from '../sequence/create.mjs'; +import { animateSubject } from './subject.mjs'; + +function animateSequence(sequence, options, scope) { + const animations = []; + /** + * Pre-process: replace function segments with MotionValue segments, + * subscribe callbacks immediately + */ + const processedSequence = sequence.map((segment) => { + if (Array.isArray(segment) && typeof segment[0] === "function") { + const callback = segment[0]; + const mv = motionValue(0); + mv.on("change", callback); + if (segment.length === 1) { + return [mv, [0, 1]]; + } + else if (segment.length === 2) { + return [mv, [0, 1], segment[1]]; + } + else { + return [mv, segment[1], segment[2]]; + } + } + return segment; + }); + const animationDefinitions = createAnimationsFromSequence(processedSequence, options, scope, { spring }); + animationDefinitions.forEach(({ keyframes, transition }, subject) => { + animations.push(...animateSubject(subject, keyframes, transition)); + }); + return animations; +} + +export { animateSequence }; +//# sourceMappingURL=sequence.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/animate/sequence.mjs.map b/node_modules/framer-motion/dist/es/animation/animate/sequence.mjs.map new file mode 100644 index 0000000..871f6c3 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/animate/sequence.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"sequence.mjs","sources":["../../../../src/animation/animate/sequence.ts"],"sourcesContent":["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"],"names":[],"mappings":";;;;SAUgB,eAAe,CAC3B,QAA2B,EAC3B,OAAyB,EACzB,KAAsB,EAAA;IAEtB,MAAM,UAAU,GAAwC,EAAE;AAE1D;;;AAGG;IACH,MAAM,iBAAiB,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,KAAI;AAC/C,QAAA,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,OAAO,OAAO,CAAC,CAAC,CAAC,KAAK,UAAU,EAAE;AAC5D,YAAA,MAAM,QAAQ,GAAG,OAAO,CAAC,CAAC,CAAyB;AACnD,YAAA,MAAM,EAAE,GAAG,WAAW,CAAC,CAAC,CAAC;AACzB,YAAA,EAAE,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC;AAEzB,YAAA,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE;gBACtB,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAQ;YAC9B;AAAO,iBAAA,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE;AAC7B,gBAAA,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAQ;YAC1C;iBAAO;AACH,gBAAA,OAAO,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAQ;YAC9C;QACJ;AACA,QAAA,OAAO,OAAO;AAClB,IAAA,CAAC,CAAsB;AAEvB,IAAA,MAAM,oBAAoB,GAAG,4BAA4B,CACrD,iBAAiB,EACjB,OAAO,EACP,KAAK,EACL,EAAE,MAAM,EAAE,CACb;AAED,IAAA,oBAAoB,CAAC,OAAO,CAAC,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,EAAE,OAAO,KAAI;AAChE,QAAA,UAAU,CAAC,IAAI,CAAC,GAAG,cAAc,CAAC,OAAO,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;AACtE,IAAA,CAAC,CAAC;AAEF,IAAA,OAAO,UAAU;AACrB;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/animation/animate/subject.mjs b/node_modules/framer-motion/dist/es/animation/animate/subject.mjs new file mode 100644 index 0000000..c509d68 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/animate/subject.mjs @@ -0,0 +1,54 @@ +import { animateSingleValue, visualElementStore, animateTarget, isMotionValue } from 'motion-dom'; +import { invariant } from 'motion-utils'; +import { createDOMVisualElement, createObjectVisualElement } from '../utils/create-visual-element.mjs'; +import { isDOMKeyframes } from '../utils/is-dom-keyframes.mjs'; +import { resolveSubjects } from './resolve-subjects.mjs'; + +function isSingleValue(subject, keyframes) { + return (isMotionValue(subject) || + typeof subject === "number" || + (typeof subject === "string" && !isDOMKeyframes(keyframes))); +} +/** + * Implementation + */ +function animateSubject(subject, keyframes, options, scope) { + const animations = []; + if (isSingleValue(subject, keyframes)) { + animations.push(animateSingleValue(subject, isDOMKeyframes(keyframes) + ? keyframes.default || keyframes + : keyframes, options ? options.default || options : options)); + } + else { + // Gracefully handle null/undefined subjects (e.g., from querySelector returning null) + if (subject == null) { + return animations; + } + const subjects = resolveSubjects(subject, keyframes, scope); + const numSubjects = subjects.length; + invariant(Boolean(numSubjects), "No valid elements provided.", "no-valid-elements"); + for (let i = 0; i < numSubjects; i++) { + const thisSubject = subjects[i]; + const createVisualElement = thisSubject instanceof Element + ? createDOMVisualElement + : createObjectVisualElement; + if (!visualElementStore.has(thisSubject)) { + createVisualElement(thisSubject); + } + const visualElement = visualElementStore.get(thisSubject); + const transition = { ...options }; + /** + * Resolve stagger function if provided. + */ + if ("delay" in transition && + typeof transition.delay === "function") { + transition.delay = transition.delay(i, numSubjects); + } + animations.push(...animateTarget(visualElement, { ...keyframes, transition }, {})); + } + } + return animations; +} + +export { animateSubject }; +//# sourceMappingURL=subject.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/animate/subject.mjs.map b/node_modules/framer-motion/dist/es/animation/animate/subject.mjs.map new file mode 100644 index 0000000..f366b18 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/animate/subject.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"subject.mjs","sources":["../../../../src/animation/animate/subject.ts"],"sourcesContent":["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\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,\n keyframes: string | UnresolvedValueKeyframe[],\n options?: ValueAnimationTransition\n): AnimationPlaybackControlsWithThen[]\n/**\n * Animate a number\n */\nexport function animateSubject(\n value: number | MotionValue,\n keyframes: number | UnresolvedValueKeyframe[],\n options?: ValueAnimationTransition\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(\n object: O | O[],\n keyframes: ObjectTarget,\n options?: DynamicAnimationOptions\n): AnimationPlaybackControlsWithThen[]\n/**\n * Implementation\n */\nexport function animateSubject(\n subject:\n | MotionValue\n | MotionValue\n | number\n | string\n | ElementOrSelector\n | O\n | O[],\n keyframes:\n | number\n | string\n | UnresolvedValueKeyframe[]\n | UnresolvedValueKeyframe[]\n | DOMKeyframesDefinition\n | ObjectTarget,\n options?:\n | ValueAnimationTransition\n | ValueAnimationTransition\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"],"names":[],"mappings":";;;;;;AA2BA,SAAS,aAAa,CAClB,OAAgB,EAChB,SAAkB,EAAA;AAElB,IAAA,QACI,aAAa,CAAC,OAAO,CAAC;QACtB,OAAO,OAAO,KAAK,QAAQ;AAC3B,SAAC,OAAO,OAAO,KAAK,QAAQ,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;AAEnE;AAmCA;;AAEG;AACG,SAAU,cAAc,CAC1B,OAOS,EACT,SAMqB,EACrB,OAG6B,EAC7B,KAAsB,EAAA;IAEtB,MAAM,UAAU,GAAwC,EAAE;AAE1D,IAAA,IAAI,aAAa,CAAC,OAAO,EAAE,SAAS,CAAC,EAAE;QACnC,UAAU,CAAC,IAAI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OAAO,UAAU;AACrB;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/animation/animators/waapi/animate-elements.mjs b/node_modules/framer-motion/dist/es/animation/animators/waapi/animate-elements.mjs new file mode 100644 index 0000000..ce71645 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/animators/waapi/animate-elements.mjs @@ -0,0 +1,110 @@ +import { resolveElements, getValueTransition, getAnimationMap, animationMapKey, getComputedStyle, fillWildcards, applyPxDefaults, NativeAnimation } from 'motion-dom'; +import { invariant, secondsToMilliseconds } from 'motion-utils'; + +function animateElements(elementOrSelector, keyframes, options, scope) { + // Gracefully handle null/undefined elements (e.g., from querySelector returning null) + if (elementOrSelector == null) { + return []; + } + const elements = resolveElements(elementOrSelector, scope); + const numElements = elements.length; + invariant(Boolean(numElements), "No valid elements provided.", "no-valid-elements"); + /** + * WAAPI doesn't support interrupting animations. + * + * Therefore, starting animations requires a three-step process: + * 1. Stop existing animations (write styles to DOM) + * 2. Resolve keyframes (read styles from DOM) + * 3. Create new animations (write styles to DOM) + * + * The hybrid `animate()` function uses AsyncAnimation to resolve + * keyframes before creating new animations, which removes style + * thrashing. Here, we have much stricter filesize constraints. + * Therefore we do this in a synchronous way that ensures that + * at least within `animate()` calls there is no style thrashing. + * + * In the motion-native-animate-mini-interrupt benchmark this + * was 80% faster than a single loop. + */ + const animationDefinitions = []; + /** + * Step 1: Build options and stop existing animations (write) + */ + for (let i = 0; i < numElements; i++) { + const element = elements[i]; + const elementTransition = { ...options }; + /** + * Resolve stagger function if provided. + */ + if (typeof elementTransition.delay === "function") { + elementTransition.delay = elementTransition.delay(i, numElements); + } + for (const valueName in keyframes) { + let valueKeyframes = keyframes[valueName]; + if (!Array.isArray(valueKeyframes)) { + valueKeyframes = [valueKeyframes]; + } + const valueOptions = { + ...getValueTransition(elementTransition, valueName), + }; + valueOptions.duration && (valueOptions.duration = secondsToMilliseconds(valueOptions.duration)); + valueOptions.delay && (valueOptions.delay = secondsToMilliseconds(valueOptions.delay)); + /** + * If there's an existing animation playing on this element then stop it + * before creating a new one. + */ + const map = getAnimationMap(element); + const key = animationMapKey(valueName, valueOptions.pseudoElement || ""); + const currentAnimation = map.get(key); + currentAnimation && currentAnimation.stop(); + animationDefinitions.push({ + map, + key, + unresolvedKeyframes: valueKeyframes, + options: { + ...valueOptions, + element, + name: valueName, + allowFlatten: !elementTransition.type && !elementTransition.ease, + }, + }); + } + } + /** + * Step 2: Resolve keyframes (read) + */ + for (let i = 0; i < animationDefinitions.length; i++) { + const { unresolvedKeyframes, options: animationOptions } = animationDefinitions[i]; + const { element, name, pseudoElement } = animationOptions; + if (!pseudoElement && unresolvedKeyframes[0] === null) { + unresolvedKeyframes[0] = getComputedStyle(element, name); + } + fillWildcards(unresolvedKeyframes); + applyPxDefaults(unresolvedKeyframes, name); + /** + * If we only have one keyframe, explicitly read the initial keyframe + * from the computed style. This is to ensure consistency with WAAPI behaviour + * for restarting animations, for instance .play() after finish, when it + * has one vs two keyframes. + */ + if (!pseudoElement && unresolvedKeyframes.length < 2) { + unresolvedKeyframes.unshift(getComputedStyle(element, name)); + } + animationOptions.keyframes = unresolvedKeyframes; + } + /** + * Step 3: Create new animations (write) + */ + const animations = []; + for (let i = 0; i < animationDefinitions.length; i++) { + const { map, key, options: animationOptions } = animationDefinitions[i]; + const animation = new NativeAnimation(animationOptions); + map.set(key, animation); + animation.finished.finally(() => map.delete(key)); + animations.push(animation); + } + return animations; +} + +export { animateElements }; +//# sourceMappingURL=animate-elements.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/animators/waapi/animate-elements.mjs.map b/node_modules/framer-motion/dist/es/animation/animators/waapi/animate-elements.mjs.map new file mode 100644 index 0000000..ee9f79e --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/animators/waapi/animate-elements.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"animate-elements.mjs","sources":["../../../../../src/animation/animators/waapi/animate-elements.ts"],"sourcesContent":["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>\n key: string\n unresolvedKeyframes: UnresolvedValueKeyframe[]\n options: Omit & {\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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AAKG;QACH,IAAI,CAAC,aAAa,IAAI,mBAAmB,CAAC,MAAM,GAAG,CAAC,EAAE;YAClD,mBAAmB,CAAC,OAAO,CAAC,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QAChE;AAEA,QAAA,gBAAgB,CAAC,SAAS,GAAG,mBAAsC;IACvE;AAEA;;AAEG;IACH,MAAM,UAAU,GAAgC,EAAE;AAClD,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,oBAAoB,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AAClD,QAAA,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,gBAAgB,EAAE,GAAG,oBAAoB,CAAC,CAAC,CAAC;AACvE,QAAA,MAAM,SAAS,GAAG,IAAI,eAAe,CACjC,gBAA0C,CAC7C;AAED,QAAA,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,SAAS,CAAC;AACvB,QAAA,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;AAEjD,QAAA,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC;IAC9B;AAEA,IAAA,OAAO,UAAU;AACrB;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/animation/animators/waapi/animate-sequence.mjs b/node_modules/framer-motion/dist/es/animation/animators/waapi/animate-sequence.mjs new file mode 100644 index 0000000..b4a8bf0 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/animators/waapi/animate-sequence.mjs @@ -0,0 +1,14 @@ +import { GroupAnimationWithThen } from 'motion-dom'; +import { createAnimationsFromSequence } from '../../sequence/create.mjs'; +import { animateElements } from './animate-elements.mjs'; + +function animateSequence(definition, options) { + const animations = []; + createAnimationsFromSequence(definition, options).forEach(({ keyframes, transition }, element) => { + animations.push(...animateElements(element, keyframes, transition)); + }); + return new GroupAnimationWithThen(animations); +} + +export { animateSequence }; +//# sourceMappingURL=animate-sequence.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/animators/waapi/animate-sequence.mjs.map b/node_modules/framer-motion/dist/es/animation/animators/waapi/animate-sequence.mjs.map new file mode 100644 index 0000000..07108a2 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/animators/waapi/animate-sequence.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"animate-sequence.mjs","sources":["../../../../../src/animation/animators/waapi/animate-sequence.ts"],"sourcesContent":["import { AnimationPlaybackControls, GroupAnimationWithThen } from \"motion-dom\"\nimport { createAnimationsFromSequence } from \"../../sequence/create\"\nimport { AnimationSequence, SequenceOptions } from \"../../sequence/types\"\nimport { animateElements } from \"./animate-elements\"\n\nexport function animateSequence(\n definition: AnimationSequence,\n options?: SequenceOptions\n) {\n const animations: AnimationPlaybackControls[] = []\n\n createAnimationsFromSequence(definition, options).forEach(\n ({ keyframes, transition }, element: Element) => {\n animations.push(...animateElements(element, keyframes, transition))\n }\n )\n\n return new GroupAnimationWithThen(animations)\n}\n"],"names":[],"mappings":";;;;AAKM,SAAU,eAAe,CAC3B,UAA6B,EAC7B,OAAyB,EAAA;IAEzB,MAAM,UAAU,GAAgC,EAAE;AAElD,IAAA,4BAA4B,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC,OAAO,CACrD,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,EAAE,OAAgB,KAAI;AAC5C,QAAA,UAAU,CAAC,IAAI,CAAC,GAAG,eAAe,CAAC,OAAO,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;AACvE,IAAA,CAAC,CACJ;AAED,IAAA,OAAO,IAAI,sBAAsB,CAAC,UAAU,CAAC;AACjD;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/animation/animators/waapi/animate-style.mjs b/node_modules/framer-motion/dist/es/animation/animators/waapi/animate-style.mjs new file mode 100644 index 0000000..070daf1 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/animators/waapi/animate-style.mjs @@ -0,0 +1,13 @@ +import { GroupAnimationWithThen } from 'motion-dom'; +import { animateElements } from './animate-elements.mjs'; + +const createScopedWaapiAnimate = (scope) => { + function scopedAnimate(elementOrSelector, keyframes, options) { + return new GroupAnimationWithThen(animateElements(elementOrSelector, keyframes, options, scope)); + } + return scopedAnimate; +}; +const animateMini = /*@__PURE__*/ createScopedWaapiAnimate(); + +export { animateMini, createScopedWaapiAnimate }; +//# sourceMappingURL=animate-style.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/animators/waapi/animate-style.mjs.map b/node_modules/framer-motion/dist/es/animation/animators/waapi/animate-style.mjs.map new file mode 100644 index 0000000..eda8aac --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/animators/waapi/animate-style.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"animate-style.mjs","sources":["../../../../../src/animation/animators/waapi/animate-style.ts"],"sourcesContent":["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"],"names":[],"mappings":";;;AAUO,MAAM,wBAAwB,GAAG,CAAC,KAAsB,KAAI;AAC/D,IAAA,SAAS,aAAa,CAClB,iBAAoC,EACpC,SAAiC,EACjC,OAAiC,EAAA;AAEjC,QAAA,OAAO,IAAI,sBAAsB,CAC7B,eAAe,CACX,iBAAiB,EACjB,SAAmC,EACnC,OAAO,EACP,KAAK,CACR,CACJ;IACL;AAEA,IAAA,OAAO,aAAa;AACxB;MAEa,WAAW,iBAAiB,wBAAwB;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/animation/hooks/animation-controls.mjs b/node_modules/framer-motion/dist/es/animation/hooks/animation-controls.mjs new file mode 100644 index 0000000..7fd8c21 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/hooks/animation-controls.mjs @@ -0,0 +1,80 @@ +import { animateVisualElement, setTarget } from 'motion-dom'; +import { invariant } from 'motion-utils'; + +function stopAnimation(visualElement) { + visualElement.values.forEach((value) => value.stop()); +} +function setVariants(visualElement, variantLabels) { + const reversedLabels = [...variantLabels].reverse(); + reversedLabels.forEach((key) => { + const variant = visualElement.getVariant(key); + variant && setTarget(visualElement, variant); + if (visualElement.variantChildren) { + visualElement.variantChildren.forEach((child) => { + setVariants(child, variantLabels); + }); + } + }); +} +function setValues(visualElement, definition) { + if (Array.isArray(definition)) { + return setVariants(visualElement, definition); + } + else if (typeof definition === "string") { + return setVariants(visualElement, [definition]); + } + else { + setTarget(visualElement, definition); + } +} +/** + * @public + */ +function animationControls() { + /** + * Track whether the host component has mounted. + */ + let hasMounted = false; + /** + * A collection of linked component animation controls. + */ + const subscribers = new Set(); + const controls = { + subscribe(visualElement) { + subscribers.add(visualElement); + return () => void subscribers.delete(visualElement); + }, + start(definition, transitionOverride) { + invariant(hasMounted, "controls.start() should only be called after a component has mounted. Consider calling within a useEffect hook."); + const animations = []; + subscribers.forEach((visualElement) => { + animations.push(animateVisualElement(visualElement, definition, { + transitionOverride, + })); + }); + return Promise.all(animations); + }, + set(definition) { + invariant(hasMounted, "controls.set() should only be called after a component has mounted. Consider calling within a useEffect hook."); + return subscribers.forEach((visualElement) => { + setValues(visualElement, definition); + }); + }, + stop() { + subscribers.forEach((visualElement) => { + stopAnimation(visualElement); + }); + }, + mount() { + hasMounted = true; + return () => { + hasMounted = false; + controls.stop(); + }; + }, + }; + return controls; +} + +export { animationControls, setValues }; +//# sourceMappingURL=animation-controls.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/hooks/animation-controls.mjs.map b/node_modules/framer-motion/dist/es/animation/hooks/animation-controls.mjs.map new file mode 100644 index 0000000..3fd62d2 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/hooks/animation-controls.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"animation-controls.mjs","sources":["../../../../src/animation/hooks/animation-controls.ts"],"sourcesContent":["import {\n animateVisualElement,\n setTarget,\n type AnimationDefinition,\n type LegacyAnimationControls,\n type VisualElement,\n} from \"motion-dom\"\nimport { invariant } from \"motion-utils\"\n\nfunction stopAnimation(visualElement: VisualElement) {\n visualElement.values.forEach((value) => value.stop())\n}\n\nfunction setVariants(visualElement: VisualElement, variantLabels: string[]) {\n const reversedLabels = [...variantLabels].reverse()\n\n reversedLabels.forEach((key) => {\n const variant = visualElement.getVariant(key)\n variant && setTarget(visualElement, variant)\n\n if (visualElement.variantChildren) {\n visualElement.variantChildren.forEach((child) => {\n setVariants(child, variantLabels)\n })\n }\n })\n}\n\nexport function setValues(\n visualElement: VisualElement,\n definition: AnimationDefinition\n) {\n if (Array.isArray(definition)) {\n return setVariants(visualElement, definition)\n } else if (typeof definition === \"string\") {\n return setVariants(visualElement, [definition])\n } else {\n setTarget(visualElement, definition as any)\n }\n}\n\n/**\n * @public\n */\nexport function animationControls(): LegacyAnimationControls {\n /**\n * Track whether the host component has mounted.\n */\n let hasMounted = false\n\n /**\n * A collection of linked component animation controls.\n */\n const subscribers = new Set()\n\n const controls: LegacyAnimationControls = {\n subscribe(visualElement) {\n subscribers.add(visualElement)\n return () => void subscribers.delete(visualElement)\n },\n\n start(definition, transitionOverride) {\n invariant(\n hasMounted,\n \"controls.start() should only be called after a component has mounted. Consider calling within a useEffect hook.\"\n )\n\n const animations: Array> = []\n subscribers.forEach((visualElement) => {\n animations.push(\n animateVisualElement(visualElement, definition, {\n transitionOverride,\n })\n )\n })\n\n return Promise.all(animations)\n },\n\n set(definition) {\n invariant(\n hasMounted,\n \"controls.set() should only be called after a component has mounted. Consider calling within a useEffect hook.\"\n )\n\n return subscribers.forEach((visualElement) => {\n setValues(visualElement, definition)\n })\n },\n\n stop() {\n subscribers.forEach((visualElement) => {\n stopAnimation(visualElement)\n })\n },\n\n mount() {\n hasMounted = true\n\n return () => {\n hasMounted = false\n controls.stop()\n }\n },\n }\n\n return controls\n}\n"],"names":[],"mappings":";;;AASA,SAAS,aAAa,CAAC,aAA4B,EAAA;AAC/C,IAAA,aAAa,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,IAAI,EAAE,CAAC;AACzD;AAEA,SAAS,WAAW,CAAC,aAA4B,EAAE,aAAuB,EAAA;IACtE,MAAM,cAAc,GAAG,CAAC,GAAG,aAAa,CAAC,CAAC,OAAO,EAAE;AAEnD,IAAA,cAAc,CAAC,OAAO,CAAC,CAAC,GAAG,KAAI;QAC3B,MAAM,OAAO,GAAG,aAAa,CAAC,UAAU,CAAC,GAAG,CAAC;AAC7C,QAAA,OAAO,IAAI,SAAS,CAAC,aAAa,EAAE,OAAO,CAAC;AAE5C,QAAA,IAAI,aAAa,CAAC,eAAe,EAAE;YAC/B,aAAa,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,KAAK,KAAI;AAC5C,gBAAA,WAAW,CAAC,KAAK,EAAE,aAAa,CAAC;AACrC,YAAA,CAAC,CAAC;QACN;AACJ,IAAA,CAAC,CAAC;AACN;AAEM,SAAU,SAAS,CACrB,aAA4B,EAC5B,UAA+B,EAAA;AAE/B,IAAA,IAAI,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;AAC3B,QAAA,OAAO,WAAW,CAAC,aAAa,EAAE,UAAU,CAAC;IACjD;AAAO,SAAA,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE;QACvC,OAAO,WAAW,CAAC,aAAa,EAAE,CAAC,UAAU,CAAC,CAAC;IACnD;SAAO;AACH,QAAA,SAAS,CAAC,aA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AA,CAAC;QACL,CAAC;KACJ;AAED,IAAA,OAAO,QAAQ;AACnB;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/animation/hooks/use-animate-style.mjs b/node_modules/framer-motion/dist/es/animation/hooks/use-animate-style.mjs new file mode 100644 index 0000000..b2715b8 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/hooks/use-animate-style.mjs @@ -0,0 +1,19 @@ +"use client"; +import { useConstant } from '../../utils/use-constant.mjs'; +import { useUnmountEffect } from '../../utils/use-unmount-effect.mjs'; +import { createScopedWaapiAnimate } from '../animators/waapi/animate-style.mjs'; + +function useAnimateMini() { + const scope = useConstant(() => ({ + current: null, // Will be hydrated by React + animations: [], + })); + const animate = useConstant(() => createScopedWaapiAnimate(scope)); + useUnmountEffect(() => { + scope.animations.forEach((animation) => animation.stop()); + }); + return [scope, animate]; +} + +export { useAnimateMini }; +//# sourceMappingURL=use-animate-style.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/hooks/use-animate-style.mjs.map b/node_modules/framer-motion/dist/es/animation/hooks/use-animate-style.mjs.map new file mode 100644 index 0000000..2ccff9f --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/hooks/use-animate-style.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-animate-style.mjs","sources":["../../../../src/animation/hooks/use-animate-style.ts"],"sourcesContent":["\"use client\"\n\nimport { useConstant } from \"../../utils/use-constant\"\nimport { useUnmountEffect } from \"../../utils/use-unmount-effect\"\nimport { createScopedWaapiAnimate } from \"../animators/waapi/animate-style\"\nimport { AnimationScope } from \"motion-dom\"\n\nexport function useAnimateMini() {\n const scope: AnimationScope = useConstant(() => ({\n current: null!, // Will be hydrated by React\n animations: [],\n }))\n\n const animate = useConstant(() => createScopedWaapiAnimate(scope))\n\n useUnmountEffect(() => {\n scope.animations.forEach((animation) => animation.stop())\n })\n\n return [scope, animate] as [AnimationScope, typeof animate]\n}\n"],"names":[],"mappings":";;;;;;AAQI;;AAEI;AACH;AAED;;AAGI;AACJ;AAEA;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/animation/hooks/use-animate.mjs b/node_modules/framer-motion/dist/es/animation/hooks/use-animate.mjs new file mode 100644 index 0000000..2bcd19b --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/hooks/use-animate.mjs @@ -0,0 +1,25 @@ +"use client"; +import { useContext, useMemo } from 'react'; +import { useConstant } from '../../utils/use-constant.mjs'; +import { useUnmountEffect } from '../../utils/use-unmount-effect.mjs'; +import { useReducedMotionConfig } from '../../utils/reduced-motion/use-reduced-motion-config.mjs'; +import { MotionConfigContext } from '../../context/MotionConfigContext.mjs'; +import { createScopedAnimate } from '../animate/index.mjs'; + +function useAnimate() { + const scope = useConstant(() => ({ + current: null, // Will be hydrated by React + animations: [], + })); + const reduceMotion = useReducedMotionConfig() ?? undefined; + const { skipAnimations } = useContext(MotionConfigContext); + const animate = useMemo(() => createScopedAnimate({ scope, reduceMotion, skipAnimations }), [scope, reduceMotion, skipAnimations]); + useUnmountEffect(() => { + scope.animations.forEach((animation) => animation.stop()); + scope.animations.length = 0; + }); + return [scope, animate]; +} + +export { useAnimate }; +//# sourceMappingURL=use-animate.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/hooks/use-animate.mjs.map b/node_modules/framer-motion/dist/es/animation/hooks/use-animate.mjs.map new file mode 100644 index 0000000..8c23b7e --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/hooks/use-animate.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-animate.mjs","sources":["../../../../src/animation/hooks/use-animate.ts"],"sourcesContent":["\"use client\"\n\nimport { useContext, useMemo } from \"react\"\nimport { AnimationScope } from \"motion-dom\"\nimport { useConstant } from \"../../utils/use-constant\"\nimport { useUnmountEffect } from \"../../utils/use-unmount-effect\"\nimport { useReducedMotionConfig } from \"../../utils/reduced-motion/use-reduced-motion-config\"\nimport { MotionConfigContext } from \"../../context/MotionConfigContext\"\nimport { createScopedAnimate } from \"../animate\"\n\nexport function useAnimate() {\n const scope: AnimationScope = useConstant(() => ({\n current: null!, // Will be hydrated by React\n animations: [],\n }))\n\n const reduceMotion = useReducedMotionConfig() ?? undefined\n const { skipAnimations } = useContext(MotionConfigContext)\n\n const animate = useMemo(\n () => createScopedAnimate({ scope, reduceMotion, skipAnimations }),\n [scope, reduceMotion, skipAnimations]\n )\n\n useUnmountEffect(() => {\n scope.animations.forEach((animation) => animation.stop())\n scope.animations.length = 0\n })\n\n return [scope, animate] as [AnimationScope, typeof animate]\n}\n"],"names":[],"mappings":";;;;;;;;;AAWI;;AAEI;AACH;AAED;;;;AASI;AACA;AACJ;AAEA;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/animation/hooks/use-animated-state.mjs b/node_modules/framer-motion/dist/es/animation/hooks/use-animated-state.mjs new file mode 100644 index 0000000..2f48d0f --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/hooks/use-animated-state.mjs @@ -0,0 +1,64 @@ +"use client"; +import { animateVisualElement, VisualElement, createBox } from 'motion-dom'; +import { useState, useLayoutEffect } from 'react'; +import { makeUseVisualState } from '../../motion/utils/use-visual-state.mjs'; +import { useConstant } from '../../utils/use-constant.mjs'; + +const createObject = () => ({}); +class StateVisualElement extends VisualElement { + constructor() { + super(...arguments); + this.measureInstanceViewportBox = createBox; + } + build() { } + resetTransform() { } + restoreTransform() { } + removeValueFromRenderState() { } + renderInstance() { } + scrapeMotionValuesFromProps() { + return createObject(); + } + getBaseTargetFromProps() { + return undefined; + } + readValueFromInstance(_state, key, options) { + return options.initialState[key] || 0; + } + sortInstanceNodePosition() { + return 0; + } +} +const useVisualState = makeUseVisualState({ + scrapeMotionValuesFromProps: createObject, + createRenderState: createObject, +}); +/** + * This is not an officially supported API and may be removed + * on any version. + */ +function useAnimatedState(initialState) { + const [animationState, setAnimationState] = useState(initialState); + const visualState = useVisualState({}, false); + const element = useConstant(() => { + return new StateVisualElement({ + props: { + onUpdate: (v) => { + setAnimationState({ ...v }); + }, + }, + visualState, + presenceContext: null, + }, { initialState }); + }); + useLayoutEffect(() => { + element.mount({}); + return () => element.unmount(); + }, [element]); + const startAnimation = useConstant(() => (animationDefinition) => { + return animateVisualElement(element, animationDefinition); + }); + return [animationState, startAnimation]; +} + +export { useAnimatedState }; +//# sourceMappingURL=use-animated-state.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/hooks/use-animated-state.mjs.map b/node_modules/framer-motion/dist/es/animation/hooks/use-animated-state.mjs.map new file mode 100644 index 0000000..480d401 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/hooks/use-animated-state.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-animated-state.mjs","sources":["../../../../src/animation/hooks/use-animated-state.ts"],"sourcesContent":["\"use client\"\n\nimport {\n animateVisualElement,\n createBox,\n ResolvedValues,\n TargetAndTransition,\n VisualElement,\n} from \"motion-dom\"\nimport { useLayoutEffect, useState } from \"react\"\nimport { makeUseVisualState } from \"../../motion/utils/use-visual-state\"\nimport { useConstant } from \"../../utils/use-constant\"\n\ninterface AnimatedStateOptions {\n initialState: ResolvedValues\n}\n\nconst createObject = () => ({})\n\nclass StateVisualElement extends VisualElement<\n ResolvedValues,\n {},\n AnimatedStateOptions\n> {\n type: \"state\"\n build() {}\n measureInstanceViewportBox = createBox\n resetTransform() {}\n restoreTransform() {}\n removeValueFromRenderState() {}\n renderInstance() {}\n scrapeMotionValuesFromProps() {\n return createObject()\n }\n getBaseTargetFromProps() {\n return undefined\n }\n\n readValueFromInstance(\n _state: ResolvedValues,\n key: string,\n options: AnimatedStateOptions\n ) {\n return options.initialState[key] || 0\n }\n\n sortInstanceNodePosition() {\n return 0\n }\n}\n\nconst useVisualState = makeUseVisualState({\n scrapeMotionValuesFromProps: createObject,\n createRenderState: createObject,\n})\n\n/**\n * This is not an officially supported API and may be removed\n * on any version.\n */\nexport function useAnimatedState(initialState: any) {\n const [animationState, setAnimationState] = useState(initialState)\n const visualState = useVisualState({}, false)\n\n const element = useConstant(() => {\n return new StateVisualElement(\n {\n props: {\n onUpdate: (v) => {\n setAnimationState({ ...v })\n },\n },\n visualState,\n presenceContext: null,\n },\n { initialState }\n )\n })\n\n useLayoutEffect(() => {\n element.mount({})\n return () => element.unmount()\n }, [element])\n\n const startAnimation = useConstant(\n () => (animationDefinition: TargetAndTransition) => {\n return animateVisualElement(element, animationDefinition)\n }\n )\n\n return [animationState, startAnimation]\n}\n"],"names":[],"mappings":";;;;;;AAiBA;AAEA;AAAA;;;;AAMI;AAEA;AACA;AACA;AACA;;;;;AAKI;;AAGJ;;;;AASI;;AAEP;AAED;AACI;AACA;AACH;AAED;;;AAGG;AACG;;;AAIF;;AAGY;AACI;AACI;;AAEP;;AAED;AACH;AAGT;;AAGI;AACA;AACJ;;AAIQ;AACJ;AAGJ;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/animation/hooks/use-animation.mjs b/node_modules/framer-motion/dist/es/animation/hooks/use-animation.mjs new file mode 100644 index 0000000..b40fbe9 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/hooks/use-animation.mjs @@ -0,0 +1,43 @@ +"use client"; +import { useConstant } from '../../utils/use-constant.mjs'; +import { useIsomorphicLayoutEffect } from '../../utils/use-isomorphic-effect.mjs'; +import { animationControls } from './animation-controls.mjs'; + +/** + * Creates `LegacyAnimationControls`, which can be used to manually start, stop + * and sequence animations on one or more components. + * + * The returned `LegacyAnimationControls` should be passed to the `animate` property + * of the components you want to animate. + * + * These components can then be animated with the `start` method. + * + * ```jsx + * import * as React from 'react' + * import { motion, useAnimation } from 'framer-motion' + * + * export function MyComponent(props) { + * const controls = useAnimation() + * + * controls.start({ + * x: 100, + * transition: { duration: 0.5 }, + * }) + * + * return + * } + * ``` + * + * @returns Animation controller with `start` and `stop` methods + * + * @public + */ +function useAnimationControls() { + const controls = useConstant(animationControls); + useIsomorphicLayoutEffect(controls.mount, []); + return controls; +} +const useAnimation = useAnimationControls; + +export { useAnimation, useAnimationControls }; +//# sourceMappingURL=use-animation.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/hooks/use-animation.mjs.map b/node_modules/framer-motion/dist/es/animation/hooks/use-animation.mjs.map new file mode 100644 index 0000000..bea4be5 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/hooks/use-animation.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-animation.mjs","sources":["../../../../src/animation/hooks/use-animation.ts"],"sourcesContent":["\"use client\"\n\nimport { LegacyAnimationControls } from \"motion-dom\"\nimport { useConstant } from \"../../utils/use-constant\"\nimport { useIsomorphicLayoutEffect } from \"../../utils/use-isomorphic-effect\"\nimport { animationControls } from \"./animation-controls\"\n\n/**\n * Creates `LegacyAnimationControls`, which can be used to manually start, stop\n * and sequence animations on one or more components.\n *\n * The returned `LegacyAnimationControls` should be passed to the `animate` property\n * of the components you want to animate.\n *\n * These components can then be animated with the `start` method.\n *\n * ```jsx\n * import * as React from 'react'\n * import { motion, useAnimation } from 'framer-motion'\n *\n * export function MyComponent(props) {\n * const controls = useAnimation()\n *\n * controls.start({\n * x: 100,\n * transition: { duration: 0.5 },\n * })\n *\n * return \n * }\n * ```\n *\n * @returns Animation controller with `start` and `stop` methods\n *\n * @public\n */\nexport function useAnimationControls(): LegacyAnimationControls {\n const controls = useConstant(animationControls)\n\n useIsomorphicLayoutEffect(controls.mount, [])\n\n return controls\n}\n\nexport const useAnimation = useAnimationControls\n"],"names":[],"mappings":";;;;;AAOA;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BG;;AAEC;AAEA;AAEA;AACJ;AAEO;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/animation/optimized-appear/handoff.mjs b/node_modules/framer-motion/dist/es/animation/optimized-appear/handoff.mjs new file mode 100644 index 0000000..ebdd478 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/optimized-appear/handoff.mjs @@ -0,0 +1,39 @@ +import { appearAnimationStore } from './store.mjs'; +import { appearStoreId } from './store-id.mjs'; + +function handoffOptimizedAppearAnimation(elementId, valueName, frame) { + const storeId = appearStoreId(elementId, valueName); + const optimisedAnimation = appearAnimationStore.get(storeId); + if (!optimisedAnimation) { + return null; + } + const { animation, startTime } = optimisedAnimation; + function cancelAnimation() { + window.MotionCancelOptimisedAnimation?.(elementId, valueName, frame); + } + /** + * We can cancel the animation once it's finished now that we've synced + * with Motion. + * + * Prefer onfinish over finished as onfinish is backwards compatible with + * older browsers. + */ + animation.onfinish = cancelAnimation; + if (startTime === null || window.MotionHandoffIsComplete?.(elementId)) { + /** + * If the startTime is null, this animation is the Paint Ready detection animation + * and we can cancel it immediately without handoff. + * + * Or if we've already handed off the animation then we're now interrupting it. + * In which case we need to cancel it. + */ + cancelAnimation(); + return null; + } + else { + return startTime; + } +} + +export { handoffOptimizedAppearAnimation }; +//# sourceMappingURL=handoff.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/optimized-appear/handoff.mjs.map b/node_modules/framer-motion/dist/es/animation/optimized-appear/handoff.mjs.map new file mode 100644 index 0000000..94affb5 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/optimized-appear/handoff.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"handoff.mjs","sources":["../../../../src/animation/optimized-appear/handoff.ts"],"sourcesContent":["import type { Batcher } from \"motion-dom\"\nimport { appearAnimationStore } from \"./store\"\nimport { appearStoreId } from \"./store-id\"\n\nexport function handoffOptimizedAppearAnimation(\n elementId: string,\n valueName: string,\n frame: Batcher\n): number | null {\n const storeId = appearStoreId(elementId, valueName)\n const optimisedAnimation = appearAnimationStore.get(storeId)\n\n if (!optimisedAnimation) {\n return null\n }\n\n const { animation, startTime } = optimisedAnimation\n\n function cancelAnimation() {\n window.MotionCancelOptimisedAnimation?.(elementId, valueName, frame)\n }\n\n /**\n * We can cancel the animation once it's finished now that we've synced\n * with Motion.\n *\n * Prefer onfinish over finished as onfinish is backwards compatible with\n * older browsers.\n */\n animation.onfinish = cancelAnimation\n\n if (startTime === null || window.MotionHandoffIsComplete?.(elementId)) {\n /**\n * If the startTime is null, this animation is the Paint Ready detection animation\n * and we can cancel it immediately without handoff.\n *\n * Or if we've already handed off the animation then we're now interrupting it.\n * In which case we need to cancel it.\n */\n cancelAnimation()\n return null\n } else {\n return startTime\n }\n}\n"],"names":[],"mappings":";;;SAIgB,+BAA+B,CAC3C,SAAiB,EACjB,SAAiB,EACjB,KAAc,EAAA;IAEd,MAAM,OAAO,GAAG,aAAa,CAAC,SAAS,EAAE,SAAS,CAAC;IACnD,MAAM,kBAAkB,GAAG,oBAAoB,CAAC,GAAG,CAAC,OAAO,CAAC;IAE5D,IAAI,CAAC,kBAAkB,EAAE;AACrB,QAAA,OAAO,IAAI;IACf;AAEA,IAAA,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,kBAAkB;AAEnD,IAAA,SAAS,eAAe,GAAA;QACpB,MAAM,CAAC,8BAA8B,GAAG,SAAS,EAAE,SAAS,EAAE,KAAK,CAAC;IACxE;AAEA;;;;;;AAMG;AACH,IAAA,SAAS,CAAC,QAAQ,GAAG,eAAe;AAEpC,IAAA,IAAI,SAAS,KAAK,IAAI,IAAI,MAAM,CAAC,uBAAuB,GAAG,SAAS,CAAC,EAAE;AACnE;;;;;;AAMG;AACH,QAAA,eAAe,EAAE;AACjB,QAAA,OAAO,IAAI;IACf;SAAO;AACH,QAAA,OAAO,SAAS;IACpB;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/animation/optimized-appear/start.mjs b/node_modules/framer-motion/dist/es/animation/optimized-appear/start.mjs new file mode 100644 index 0000000..e526185 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/optimized-appear/start.mjs @@ -0,0 +1,170 @@ +import { optimizedAppearDataId, startWaapiAnimation, getOptimisedAppearId } from 'motion-dom'; +import { noop } from 'motion-utils'; +import { handoffOptimizedAppearAnimation } from './handoff.mjs'; +import { appearAnimationStore, appearComplete } from './store.mjs'; +import { appearStoreId } from './store-id.mjs'; + +/** + * A single time to use across all animations to manually set startTime + * and ensure they're all in sync. + */ +let startFrameTime; +/** + * A dummy animation to detect when Chrome is ready to start + * painting the page and hold off from triggering the real animation + * until then. We only need one animation to detect paint ready. + * + * https://bugs.chromium.org/p/chromium/issues/detail?id=1406850 + */ +let readyAnimation; +/** + * Keep track of animations that were suspended vs cancelled so we + * can easily resume them when we're done measuring layout. + */ +const suspendedAnimations = new Set(); +function resumeSuspendedAnimations() { + suspendedAnimations.forEach((data) => { + data.animation.play(); + data.animation.startTime = data.startTime; + }); + suspendedAnimations.clear(); +} +function startOptimizedAppearAnimation(element, name, keyframes, options, onReady) { + // Prevent optimised appear animations if Motion has already started animating. + if (window.MotionIsMounted) { + return; + } + const id = element.dataset[optimizedAppearDataId]; + if (!id) + return; + window.MotionHandoffAnimation = handoffOptimizedAppearAnimation; + const storeId = appearStoreId(id, name); + if (!readyAnimation) { + readyAnimation = startWaapiAnimation(element, name, [keyframes[0], keyframes[0]], + /** + * 10 secs is basically just a super-safe duration to give Chrome + * long enough to get the animation ready. + */ + { duration: 10000, ease: "linear" }); + appearAnimationStore.set(storeId, { + animation: readyAnimation, + startTime: null, + }); + /** + * If there's no readyAnimation then there's been no instantiation + * of handoff animations. + */ + window.MotionHandoffAnimation = handoffOptimizedAppearAnimation; + window.MotionHasOptimisedAnimation = (elementId, valueName) => { + if (!elementId) + return false; + /** + * Keep a map of elementIds that have started animating. We check + * via ID instead of Element because of hydration errors and + * pre-hydration checks. We also actively record IDs as they start + * animating rather than simply checking for data-appear-id as + * this attrbute might be present but not lead to an animation, for + * instance if the element's appear animation is on a different + * breakpoint. + */ + if (!valueName) { + return appearComplete.has(elementId); + } + const animationId = appearStoreId(elementId, valueName); + return Boolean(appearAnimationStore.get(animationId)); + }; + window.MotionHandoffMarkAsComplete = (elementId) => { + if (appearComplete.has(elementId)) { + appearComplete.set(elementId, true); + } + }; + window.MotionHandoffIsComplete = (elementId) => { + return appearComplete.get(elementId) === true; + }; + /** + * We only need to cancel transform animations as + * they're the ones that will interfere with the + * layout animation measurements. + */ + window.MotionCancelOptimisedAnimation = (elementId, valueName, frame, canResume) => { + const animationId = appearStoreId(elementId, valueName); + const data = appearAnimationStore.get(animationId); + if (!data) + return; + if (frame && canResume === undefined) { + /** + * Wait until the end of the subsequent frame to cancel the animation + * to ensure we don't remove the animation before the main thread has + * had a chance to resolve keyframes and render. + */ + frame.postRender(() => { + frame.postRender(() => { + data.animation.cancel(); + }); + }); + } + else { + data.animation.cancel(); + } + if (frame && canResume) { + suspendedAnimations.add(data); + frame.render(resumeSuspendedAnimations); + } + else { + appearAnimationStore.delete(animationId); + /** + * If there are no more animations left, we can remove the cancel function. + * This will let us know when we can stop checking for conflicting layout animations. + */ + if (!appearAnimationStore.size) { + window.MotionCancelOptimisedAnimation = undefined; + } + } + }; + window.MotionCheckAppearSync = (visualElement, valueName, value) => { + const appearId = getOptimisedAppearId(visualElement); + if (!appearId) + return; + const valueIsOptimised = window.MotionHasOptimisedAnimation?.(appearId, valueName); + const externalAnimationValue = visualElement.props.values?.[valueName]; + if (!valueIsOptimised || !externalAnimationValue) + return; + const removeSyncCheck = value.on("change", (latestValue) => { + if (externalAnimationValue.get() !== latestValue) { + window.MotionCancelOptimisedAnimation?.(appearId, valueName); + removeSyncCheck(); + } + }); + return removeSyncCheck; + }; + } + const startAnimation = () => { + readyAnimation.cancel(); + const appearAnimation = startWaapiAnimation(element, name, keyframes, options); + /** + * Record the time of the first started animation. We call performance.now() once + * here and once in handoff to ensure we're getting + * close to a frame-locked time. This keeps all animations in sync. + */ + if (startFrameTime === undefined) { + startFrameTime = performance.now(); + } + appearAnimation.startTime = startFrameTime; + appearAnimationStore.set(storeId, { + animation: appearAnimation, + startTime: startFrameTime, + }); + if (onReady) + onReady(appearAnimation); + }; + appearComplete.set(id, false); + if (readyAnimation.ready) { + readyAnimation.ready.then(startAnimation).catch(noop); + } + else { + startAnimation(); + } +} + +export { startOptimizedAppearAnimation }; +//# sourceMappingURL=start.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/optimized-appear/start.mjs.map b/node_modules/framer-motion/dist/es/animation/optimized-appear/start.mjs.map new file mode 100644 index 0000000..316ebff --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/optimized-appear/start.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"start.mjs","sources":["../../../../src/animation/optimized-appear/start.ts"],"sourcesContent":["import {\n AnyResolvedKeyframe,\n Batcher,\n getOptimisedAppearId,\n MotionValue,\n optimizedAppearDataId,\n startWaapiAnimation,\n ValueAnimationTransition,\n type WithAppearProps,\n} from \"motion-dom\"\nimport { noop } from \"motion-utils\"\nimport { handoffOptimizedAppearAnimation } from \"./handoff\"\nimport { appearAnimationStore, appearComplete, AppearStoreEntry } from \"./store\"\nimport { appearStoreId } from \"./store-id\"\n\n/**\n * A single time to use across all animations to manually set startTime\n * and ensure they're all in sync.\n */\nlet startFrameTime: number\n\n/**\n * A dummy animation to detect when Chrome is ready to start\n * painting the page and hold off from triggering the real animation\n * until then. We only need one animation to detect paint ready.\n *\n * https://bugs.chromium.org/p/chromium/issues/detail?id=1406850\n */\nlet readyAnimation: Animation\n\n/**\n * Keep track of animations that were suspended vs cancelled so we\n * can easily resume them when we're done measuring layout.\n */\nconst suspendedAnimations = new Set()\n\nfunction resumeSuspendedAnimations() {\n suspendedAnimations.forEach((data) => {\n data.animation.play()\n data.animation.startTime = data.startTime\n })\n suspendedAnimations.clear()\n}\n\nexport function startOptimizedAppearAnimation(\n element: HTMLElement,\n name: string,\n keyframes: string[] | number[],\n options: ValueAnimationTransition,\n onReady?: (animation: Animation) => void\n): void {\n // Prevent optimised appear animations if Motion has already started animating.\n if (window.MotionIsMounted) {\n return\n }\n\n const id = element.dataset[optimizedAppearDataId]\n if (!id) return\n\n window.MotionHandoffAnimation = handoffOptimizedAppearAnimation\n\n const storeId = appearStoreId(id, name)\n if (!readyAnimation) {\n readyAnimation = startWaapiAnimation(\n element,\n name,\n [keyframes[0] as number, keyframes[0] as number],\n /**\n * 10 secs is basically just a super-safe duration to give Chrome\n * long enough to get the animation ready.\n */\n { duration: 10000, ease: \"linear\" }\n )\n\n appearAnimationStore.set(storeId, {\n animation: readyAnimation,\n startTime: null,\n })\n\n /**\n * If there's no readyAnimation then there's been no instantiation\n * of handoff animations.\n */\n window.MotionHandoffAnimation = handoffOptimizedAppearAnimation\n\n window.MotionHasOptimisedAnimation = (\n elementId?: string,\n valueName?: string\n ) => {\n if (!elementId) return false\n\n /**\n * Keep a map of elementIds that have started animating. We check\n * via ID instead of Element because of hydration errors and\n * pre-hydration checks. We also actively record IDs as they start\n * animating rather than simply checking for data-appear-id as\n * this attrbute might be present but not lead to an animation, for\n * instance if the element's appear animation is on a different\n * breakpoint.\n */\n if (!valueName) {\n return appearComplete.has(elementId)\n }\n\n const animationId = appearStoreId(elementId, valueName)\n return Boolean(appearAnimationStore.get(animationId))\n }\n\n window.MotionHandoffMarkAsComplete = (elementId: string): void => {\n if (appearComplete.has(elementId)) {\n appearComplete.set(elementId, true)\n }\n }\n\n window.MotionHandoffIsComplete = (elementId: string): boolean => {\n return appearComplete.get(elementId) === true\n }\n\n /**\n * We only need to cancel transform animations as\n * they're the ones that will interfere with the\n * layout animation measurements.\n */\n window.MotionCancelOptimisedAnimation = (\n elementId: string,\n valueName: string,\n frame?: Batcher,\n canResume?: boolean\n ) => {\n const animationId = appearStoreId(elementId, valueName)\n const data = appearAnimationStore.get(animationId)\n\n if (!data) return\n\n if (frame && canResume === undefined) {\n /**\n * Wait until the end of the subsequent frame to cancel the animation\n * to ensure we don't remove the animation before the main thread has\n * had a chance to resolve keyframes and render.\n */\n frame.postRender(() => {\n frame.postRender(() => {\n data.animation.cancel()\n })\n })\n } else {\n data.animation.cancel()\n }\n\n if (frame && canResume) {\n suspendedAnimations.add(data)\n frame.render(resumeSuspendedAnimations)\n } else {\n appearAnimationStore.delete(animationId)\n\n /**\n * If there are no more animations left, we can remove the cancel function.\n * This will let us know when we can stop checking for conflicting layout animations.\n */\n if (!appearAnimationStore.size) {\n window.MotionCancelOptimisedAnimation = undefined\n }\n }\n }\n\n window.MotionCheckAppearSync = (\n visualElement: WithAppearProps,\n valueName: string,\n value: MotionValue\n ) => {\n const appearId = getOptimisedAppearId(visualElement)\n\n if (!appearId) return\n\n const valueIsOptimised = window.MotionHasOptimisedAnimation?.(\n appearId,\n valueName\n )\n const externalAnimationValue =\n visualElement.props.values?.[valueName]\n\n if (!valueIsOptimised || !externalAnimationValue) return\n\n const removeSyncCheck = value.on(\n \"change\",\n (latestValue: AnyResolvedKeyframe) => {\n if (externalAnimationValue.get() !== latestValue) {\n window.MotionCancelOptimisedAnimation?.(\n appearId,\n valueName\n )\n removeSyncCheck()\n }\n }\n )\n\n return removeSyncCheck\n }\n }\n\n const startAnimation = () => {\n readyAnimation.cancel()\n\n const appearAnimation = startWaapiAnimation(\n element,\n name,\n keyframes,\n options\n )\n\n /**\n * Record the time of the first started animation. We call performance.now() once\n * here and once in handoff to ensure we're getting\n * close to a frame-locked time. This keeps all animations in sync.\n */\n if (startFrameTime === undefined) {\n startFrameTime = performance.now()\n }\n\n appearAnimation.startTime = startFrameTime\n\n appearAnimationStore.set(storeId, {\n animation: appearAnimation,\n startTime: startFrameTime,\n })\n\n if (onReady) onReady(appearAnimation)\n }\n\n appearComplete.set(id, false)\n\n if (readyAnimation.ready) {\n readyAnimation.ready.then(startAnimation).catch(noop)\n } else {\n startAnimation()\n }\n}\n"],"names":[],"mappings":";;;;;;AAeA;;;AAGG;AACH,IAAI,cAAsB;AAE1B;;;;;;AAMG;AACH,IAAI,cAAyB;AAE7B;;;AAGG;AACH,MAAM,mBAAmB,GAAG,IAAI,GAAG,EAAoB;AAEvD,SAAS,yBAAyB,GAAA;AAC9B,IAAA,mBAAmB,CAAC,OAAO,CAAC,CAAC,IAAI,KAAI;AACjC,QAAA,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE;QACrB,IAAI,CAAC,SAAS,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS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AACzC,IAAA,CAAC;AAED,IAAA,cAAc,CAAC,GAAG,CAAC,EAAE,EAAE,KAAK,CAAC;AAE7B,IAAA,IAAI,cAAc,CAAC,KAAK,EAAE;AACtB,QAAA,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC;IACzD;SAAO;AACH,QAAA,cAAc,EAAE;IACpB;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/animation/optimized-appear/store-id.mjs b/node_modules/framer-motion/dist/es/animation/optimized-appear/store-id.mjs new file mode 100644 index 0000000..3db6ef4 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/optimized-appear/store-id.mjs @@ -0,0 +1,9 @@ +import { transformProps } from 'motion-dom'; + +const appearStoreId = (elementId, valueName) => { + const key = transformProps.has(valueName) ? "transform" : valueName; + return `${elementId}: ${key}`; +}; + +export { appearStoreId }; +//# sourceMappingURL=store-id.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/optimized-appear/store-id.mjs.map b/node_modules/framer-motion/dist/es/animation/optimized-appear/store-id.mjs.map new file mode 100644 index 0000000..372f254 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/optimized-appear/store-id.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"store-id.mjs","sources":["../../../../src/animation/optimized-appear/store-id.ts"],"sourcesContent":["import { transformProps } from \"motion-dom\"\n\nexport const appearStoreId = (elementId: string, valueName: string) => {\n const key = transformProps.has(valueName) ? \"transform\" : valueName\n\n return `${elementId}: ${key}`\n}\n"],"names":[],"mappings":";;MAEa,aAAa,GAAG,CAAC,SAAiB,EAAE,SAAiB,KAAI;AAClE,IAAA,MAAM,GAAG,GAAG,cAAc,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,WAAW,GAAG,SAAS;AAEnE,IAAA,OAAO,CAAA,EAAG,SAAS,CAAA,EAAA,EAAK,GAAG,EAAE;AACjC;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/animation/optimized-appear/store.mjs b/node_modules/framer-motion/dist/es/animation/optimized-appear/store.mjs new file mode 100644 index 0000000..a6cfa5e --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/optimized-appear/store.mjs @@ -0,0 +1,5 @@ +const appearAnimationStore = new Map(); +const appearComplete = new Map(); + +export { appearAnimationStore, appearComplete }; +//# sourceMappingURL=store.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/optimized-appear/store.mjs.map b/node_modules/framer-motion/dist/es/animation/optimized-appear/store.mjs.map new file mode 100644 index 0000000..18a44b3 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/optimized-appear/store.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"store.mjs","sources":["../../../../src/animation/optimized-appear/store.ts"],"sourcesContent":["export interface AppearStoreEntry {\n animation: Animation\n startTime: number | null\n}\n\nexport type AppearElementId = string\n\nexport type IsComplete = boolean\n\nexport const appearAnimationStore = new Map()\n\nexport const appearComplete = new Map()\n"],"names":[],"mappings":"AASO,MAAM,oBAAoB,GAAG,IAAI,GAAG;AAEpC,MAAM,cAAc,GAAG,IAAI,GAAG;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/animation/sequence/create.mjs b/node_modules/framer-motion/dist/es/animation/sequence/create.mjs new file mode 100644 index 0000000..0756f04 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/sequence/create.mjs @@ -0,0 +1,308 @@ +import { isMotionValue, defaultOffset, isGenerator, createGeneratorEasing, fillOffset } from 'motion-dom'; +import { progress, secondsToMilliseconds, warning, reverseEasing, getEasingForSegment } from 'motion-utils'; +import { resolveSubjects } from '../animate/resolve-subjects.mjs'; +import { calculateRepeatDuration } from './utils/calc-repeat-duration.mjs'; +import { calcNextTime } from './utils/calc-time.mjs'; +import { addKeyframes } from './utils/edit.mjs'; +import { normalizeTimes } from './utils/normalize-times.mjs'; +import { compareByTime } from './utils/sort.mjs'; + +const defaultSegmentEasing = "easeInOut"; +const MAX_REPEAT = 20; +function createAnimationsFromSequence(sequence, { defaultTransition = {}, ...sequenceTransition } = {}, scope, generators) { + const defaultDuration = defaultTransition.duration || 0.3; + const animationDefinitions = new Map(); + const sequences = new Map(); + const elementCache = {}; + const timeLabels = new Map(); + let prevTime = 0; + let currentTime = 0; + let totalDuration = 0; + /** + * Build the timeline by mapping over the sequence array and converting + * the definitions into keyframes and offsets with absolute time values. + * These will later get converted into relative offsets in a second pass. + */ + for (let i = 0; i < sequence.length; i++) { + const segment = sequence[i]; + /** + * If this is a timeline label, mark it and skip the rest of this iteration. + */ + if (typeof segment === "string") { + timeLabels.set(segment, currentTime); + continue; + } + else if (!Array.isArray(segment)) { + timeLabels.set(segment.name, calcNextTime(currentTime, segment.at, prevTime, timeLabels)); + continue; + } + let [subject, keyframes, transition = {}] = segment; + /** + * If a relative or absolute time value has been specified we need to resolve + * it in relation to the currentTime. + */ + if (transition.at !== undefined) { + currentTime = calcNextTime(currentTime, transition.at, prevTime, timeLabels); + } + /** + * Keep track of the maximum duration in this definition. This will be + * applied to currentTime once the definition has been parsed. + */ + let maxDuration = 0; + const resolveValueSequence = (valueKeyframes, valueTransition, valueSequence, elementIndex = 0, numSubjects = 0) => { + const valueKeyframesAsList = keyframesAsList(valueKeyframes); + const { delay = 0, times = defaultOffset(valueKeyframesAsList), type = defaultTransition.type || "keyframes", repeat, repeatType, repeatDelay = 0, ...remainingTransition } = valueTransition; + let { ease = defaultTransition.ease || "easeOut", duration } = valueTransition; + /** + * Resolve stagger() if defined. + */ + const calculatedDelay = typeof delay === "function" + ? delay(elementIndex, numSubjects) + : delay; + /** + * If this animation should and can use a spring, generate a spring easing function. + */ + const numKeyframes = valueKeyframesAsList.length; + const createGenerator = isGenerator(type) + ? type + : generators?.[type || "keyframes"]; + if (numKeyframes <= 2 && createGenerator) { + /** + * As we're creating an easing function from a spring, + * ideally we want to generate it using the real distance + * between the two keyframes. However this isn't always + * possible - in these situations we use 0-100. + */ + let absoluteDelta = 100; + if (numKeyframes === 2 && + isNumberKeyframesArray(valueKeyframesAsList)) { + const delta = valueKeyframesAsList[1] - valueKeyframesAsList[0]; + absoluteDelta = Math.abs(delta); + } + const springTransition = { + ...defaultTransition, + ...remainingTransition, + }; + if (duration !== undefined) { + springTransition.duration = secondsToMilliseconds(duration); + } + const springEasing = createGeneratorEasing(springTransition, absoluteDelta, createGenerator); + ease = springEasing.ease; + duration = springEasing.duration; + } + duration ?? (duration = defaultDuration); + const startTime = currentTime + calculatedDelay; + /** + * If there's only one time offset of 0, fill in a second with length 1 + */ + if (times.length === 1 && times[0] === 0) { + times[1] = 1; + } + /** + * Fill out if offset if fewer offsets than keyframes + */ + const remainder = times.length - valueKeyframesAsList.length; + remainder > 0 && fillOffset(times, remainder); + /** + * If only one value has been set, ie [1], push a null to the start of + * the keyframe array. This will let us mark a keyframe at this point + * that will later be hydrated with the previous value. + */ + valueKeyframesAsList.length === 1 && + valueKeyframesAsList.unshift(null); + /** + * Segments can't express `repeat: Infinity` or very large + * counts — they'd leave dead time after the segment or + * explode the keyframe array. Ignore with a warning. + */ + if (repeat) { + warning(repeat < MAX_REPEAT, `Sequence segments can't repeat ${repeat} times — ignoring repeat option. Use a value below ${MAX_REPEAT} or apply repeat at the sequence level instead.`); + } + if (repeat && repeat < MAX_REPEAT) { + /** + * Express repeatDelay in units of a single iteration's duration + * so it can be added to the per-iteration time offsets below + * before they're normalized to 0-1. + */ + const repeatDelayUnits = duration > 0 ? repeatDelay / duration : 0; + duration = calculateRepeatDuration(duration, repeat, repeatDelay); + const originalKeyframes = [...valueKeyframesAsList]; + const originalTimes = [...times]; + ease = Array.isArray(ease) ? [...ease] : [ease]; + const originalEase = [...ease]; + /** + * For reverse/mirror, alternate iterations play the segment + * backwards. mirror matches JSAnimation's mirroredGenerator: + * reversed keyframes, easings unchanged. reverse matches + * JSAnimation's iterationProgress = 1 - p: reversed + * keyframes, easing array reversed AND each function easing + * mapped through reverseEasing (string easings unchanged — + * they're resolved later by the keyframes engine). + */ + const isFlipping = repeatType === "reverse" || repeatType === "mirror"; + let flippedKeyframes = originalKeyframes; + let flippedEases = originalEase; + if (isFlipping) { + flippedKeyframes = [...originalKeyframes].reverse(); + if (repeatType === "reverse") { + flippedEases = [...originalEase] + .reverse() + .map((e) => typeof e === "function" + ? reverseEasing(e) + : e); + } + } + for (let repeatIndex = 0; repeatIndex < repeat; repeatIndex++) { + const isFlipped = isFlipping && repeatIndex % 2 === 0; + const iterKeyframes = isFlipped + ? flippedKeyframes + : originalKeyframes; + const iterEase = isFlipped ? flippedEases : originalEase; + const iterStartOffset = (repeatIndex + 1) * (1 + repeatDelayUnits); + /** + * If repeatDelay is set, hold the previous iteration's + * final value through the delay by inserting a keyframe + * at the moment the next iteration begins. + */ + if (repeatDelayUnits > 0) { + valueKeyframesAsList.push(valueKeyframesAsList[valueKeyframesAsList.length - 1]); + times.push(iterStartOffset); + ease.push("linear"); + } + valueKeyframesAsList.push(...iterKeyframes); + for (let keyframeIndex = 0; keyframeIndex < iterKeyframes.length; keyframeIndex++) { + times.push(originalTimes[keyframeIndex] + iterStartOffset); + ease.push(keyframeIndex === 0 + ? "linear" + : getEasingForSegment(iterEase, keyframeIndex - 1)); + } + } + normalizeTimes(times, repeat, repeatDelayUnits); + } + const targetTime = startTime + duration; + /** + * Add keyframes, mapping offsets to absolute time. + */ + addKeyframes(valueSequence, valueKeyframesAsList, ease, times, startTime, targetTime); + maxDuration = Math.max(calculatedDelay + duration, maxDuration); + totalDuration = Math.max(targetTime, totalDuration); + }; + if (isMotionValue(subject)) { + const subjectSequence = getSubjectSequence(subject, sequences); + resolveValueSequence(keyframes, transition, getValueSequence("default", subjectSequence)); + } + else { + const subjects = resolveSubjects(subject, keyframes, scope, elementCache); + const numSubjects = subjects.length; + /** + * For every element in this segment, process the defined values. + */ + for (let subjectIndex = 0; subjectIndex < numSubjects; subjectIndex++) { + /** + * Cast necessary, but we know these are of this type + */ + keyframes = keyframes; + transition = transition; + const thisSubject = subjects[subjectIndex]; + const subjectSequence = getSubjectSequence(thisSubject, sequences); + for (const key in keyframes) { + resolveValueSequence(keyframes[key], getValueTransition(transition, key), getValueSequence(key, subjectSequence), subjectIndex, numSubjects); + } + } + } + prevTime = currentTime; + currentTime += maxDuration; + } + /** + * For every element and value combination create a new animation. + */ + sequences.forEach((valueSequences, element) => { + for (const key in valueSequences) { + const valueSequence = valueSequences[key]; + /** + * Arrange all the keyframes in ascending time order. + */ + valueSequence.sort(compareByTime); + const keyframes = []; + const valueOffset = []; + const valueEasing = []; + /** + * For each keyframe, translate absolute times into + * relative offsets based on the total duration of the timeline. + */ + for (let i = 0; i < valueSequence.length; i++) { + const { at, value, easing } = valueSequence[i]; + keyframes.push(value); + valueOffset.push(progress(0, totalDuration, at)); + valueEasing.push(easing || "easeOut"); + } + /** + * If the first keyframe doesn't land on offset: 0 + * provide one by duplicating the initial keyframe. This ensures + * it snaps to the first keyframe when the animation starts. + */ + if (valueOffset[0] !== 0) { + valueOffset.unshift(0); + keyframes.unshift(keyframes[0]); + valueEasing.unshift(defaultSegmentEasing); + } + /** + * If the last keyframe doesn't land on offset: 1 + * provide one with a null wildcard value. This will ensure it + * stays static until the end of the animation. + */ + if (valueOffset[valueOffset.length - 1] !== 1) { + valueOffset.push(1); + keyframes.push(null); + } + if (!animationDefinitions.has(element)) { + animationDefinitions.set(element, { + keyframes: {}, + transition: {}, + }); + } + const definition = animationDefinitions.get(element); + definition.keyframes[key] = keyframes; + /** + * Exclude `type` from defaultTransition since springs have been + * converted to duration-based easing functions in resolveValueSequence. + * Including `type: "spring"` would cause JSAnimation to error when + * the merged keyframes array has more than 2 keyframes. + */ + const { type: _type, ...remainingDefaultTransition } = defaultTransition; + definition.transition[key] = { + ...remainingDefaultTransition, + duration: totalDuration, + ease: valueEasing, + times: valueOffset, + ...sequenceTransition, + }; + } + }); + return animationDefinitions; +} +function getSubjectSequence(subject, sequences) { + !sequences.has(subject) && sequences.set(subject, {}); + return sequences.get(subject); +} +function getValueSequence(name, sequences) { + if (!sequences[name]) + sequences[name] = []; + return sequences[name]; +} +function keyframesAsList(keyframes) { + return Array.isArray(keyframes) ? keyframes : [keyframes]; +} +function getValueTransition(transition, key) { + return transition && transition[key] + ? { + ...transition, + ...transition[key], + } + : { ...transition }; +} +const isNumber = (keyframe) => typeof keyframe === "number"; +const isNumberKeyframesArray = (keyframes) => keyframes.every(isNumber); + +export { createAnimationsFromSequence, getValueTransition }; +//# sourceMappingURL=create.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/sequence/create.mjs.map b/node_modules/framer-motion/dist/es/animation/sequence/create.mjs.map new file mode 100644 index 0000000..a9abdf0 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/sequence/create.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"create.mjs","sources":["../../../../src/animation/sequence/create.ts"],"sourcesContent":["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()\n const elementCache = {}\n const timeLabels = new Map()\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(\n subject: Element | MotionValue | O,\n sequences: Map\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: Un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gBAAA,IAAI,EAAE,WAAW;AACjB,gBAAA,KAAK,EAAE,WAAW;AAClB,gBAAA,GAAG,kBAAkB;aACxB;QACL;AACJ,IAAA,CAAC,CAAC;AAEF,IAAA,OAAO,oBAAoB;AAC/B;AAEA,SAAS,kBAAkB,CACvB,OAAkC,EAClC,SAAsD,EAAA;AAEtD,IAAA,CAAC,SAAS,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,SAAS,CAAC,GAAG,CAAC,OAAO,EAAE,EAAE,CAAC;AACrD,IAAA,OAAO,SAAS,CAAC,GAAG,CAAC,OAAO,CAAE;AAClC;AAEA,SAAS,gBAAgB,CAAC,IAAY,EAAE,SAAsB,EAAA;AAC1D,IAAA,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;AAAE,QAAA,SAAS,CAAC,IAAI,CAAC,GAAG,EAAE;AAC1C,IAAA,OAAO,SAAS,CAAC,IAAI,CAAC;AAC1B;AAEA,SAAS,eAAe,CACpB,SAA8D,EAAA;AAE9D,IAAA,OAAO,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,SAAS,GAAG,CAAC,SAAS,CAAC;AAC7D;AAEM,SAAU,kBAAkB,CAC9B,UAAwC,EACxC,GAAW,EAAA;AAEX,IAAA,OAAO,UAAU,IAAI,UAAU,CAAC,GAA8B;AAC1D,UAAE;AACI,YAAA,GAAG,UAAU;YACb,GAAI,UAAU,CAAC,GAA8B,CAAgB;AAChE;AACH,UAAE,EAAE,GAAG,UAAU,EAAE;AAC3B;AAEA,MAAM,QAAQ,GAAG,CAAC,QAAiB,KAAK,OAAO,QAAQ,KAAK,QAAQ;AACpE,MAAM,sBAAsB,GAAG,CAC3B,SAAoC,KACZ,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/animation/sequence/utils/calc-repeat-duration.mjs b/node_modules/framer-motion/dist/es/animation/sequence/utils/calc-repeat-duration.mjs new file mode 100644 index 0000000..652f6d8 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/sequence/utils/calc-repeat-duration.mjs @@ -0,0 +1,6 @@ +function calculateRepeatDuration(duration, repeat, repeatDelay) { + return duration * (repeat + 1) + repeatDelay * repeat; +} + +export { calculateRepeatDuration }; +//# sourceMappingURL=calc-repeat-duration.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/sequence/utils/calc-repeat-duration.mjs.map b/node_modules/framer-motion/dist/es/animation/sequence/utils/calc-repeat-duration.mjs.map new file mode 100644 index 0000000..286da81 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/sequence/utils/calc-repeat-duration.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"calc-repeat-duration.mjs","sources":["../../../../../src/animation/sequence/utils/calc-repeat-duration.ts"],"sourcesContent":["export function calculateRepeatDuration(\n duration: number,\n repeat: number,\n repeatDelay: number\n): number {\n return duration * (repeat + 1) + repeatDelay * repeat\n}\n"],"names":[],"mappings":"SAAgB,uBAAuB,CACnC,QAAgB,EAChB,MAAc,EACd,WAAmB,EAAA;IAEnB,OAAO,QAAQ,IAAI,MAAM,GAAG,CAAC,CAAC,GAAG,WAAW,GAAG,MAAM;AACzD;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/animation/sequence/utils/calc-time.mjs b/node_modules/framer-motion/dist/es/animation/sequence/utils/calc-time.mjs new file mode 100644 index 0000000..7e600c8 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/sequence/utils/calc-time.mjs @@ -0,0 +1,24 @@ +/** + * Given a absolute or relative time definition and current/prev time state of the sequence, + * calculate an absolute time for the next keyframes. + */ +function calcNextTime(current, next, prev, labels) { + if (typeof next === "number") { + return next; + } + else if (next.startsWith("-") || next.startsWith("+")) { + return Math.max(0, current + parseFloat(next)); + } + else if (next === "<") { + return prev; + } + else if (next.startsWith("<")) { + return Math.max(0, prev + parseFloat(next.slice(1))); + } + else { + return labels.get(next) ?? current; + } +} + +export { calcNextTime }; +//# sourceMappingURL=calc-time.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/sequence/utils/calc-time.mjs.map b/node_modules/framer-motion/dist/es/animation/sequence/utils/calc-time.mjs.map new file mode 100644 index 0000000..3647333 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/sequence/utils/calc-time.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"calc-time.mjs","sources":["../../../../../src/animation/sequence/utils/calc-time.ts"],"sourcesContent":["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\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"],"names":[],"mappings":"AAEA;;;AAGG;AACG,SAAU,YAAY,CACxB,OAAe,EACf,IAAkB,EAClB,IAAY,EACZ,MAA2B,EAAA;AAE3B,IAAA,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;AAC1B,QAAA,OAAO,IAAI;IACf;AAAO,SAAA,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;AACrD,QAAA,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;IAClD;AAAO,SAAA,IAAI,IAAI,KAAK,GAAG,EAAE;AACrB,QAAA,OAAO,IAAI;IACf;AAAO,SAAA,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;AAC7B,QAAA,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACxD;SAAO;QACH,OAAO,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,OAAO;IACtC;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/animation/sequence/utils/edit.mjs b/node_modules/framer-motion/dist/es/animation/sequence/utils/edit.mjs new file mode 100644 index 0000000..a140e1b --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/sequence/utils/edit.mjs @@ -0,0 +1,31 @@ +import { mixNumber } from 'motion-dom'; +import { getEasingForSegment, removeItem } from 'motion-utils'; + +function eraseKeyframes(sequence, startTime, endTime) { + for (let i = 0; i < sequence.length; i++) { + const keyframe = sequence[i]; + if (keyframe.at > startTime && keyframe.at < endTime) { + removeItem(sequence, keyframe); + // If we remove this item we have to push the pointer back one + i--; + } + } +} +function addKeyframes(sequence, keyframes, easing, offset, startTime, endTime) { + /** + * Erase every existing value between currentTime and targetTime, + * this will essentially splice this timeline into any currently + * defined ones. + */ + eraseKeyframes(sequence, startTime, endTime); + for (let i = 0; i < keyframes.length; i++) { + sequence.push({ + value: keyframes[i], + at: mixNumber(startTime, endTime, offset[i]), + easing: getEasingForSegment(easing, i), + }); + } +} + +export { addKeyframes, eraseKeyframes }; +//# sourceMappingURL=edit.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/sequence/utils/edit.mjs.map b/node_modules/framer-motion/dist/es/animation/sequence/utils/edit.mjs.map new file mode 100644 index 0000000..f9a56fd --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/sequence/utils/edit.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"edit.mjs","sources":["../../../../../src/animation/sequence/utils/edit.ts"],"sourcesContent":["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"],"names":[],"mappings":";;;SAIgB,cAAc,CAC1B,QAAuB,EACvB,SAAiB,EACjB,OAAe,EAAA;AAEf,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AACtC,QAAA,MAAM,QAAQ,GAAG,QAAQ,CAAC,CAAC,CAAC;AAE5B,QAAA,IAAI,QAAQ,CAAC,EAAE,GAAG,SAAS,IAAI,QAAQ,CAAC,EAAE,GAAG,OAAO,EAAE;AAClD,YAAA,UAAU,CAAC,QAAQ,EAAE,QAAQ,CAAC;;AAG9B,YAAA,CAAC,EAAE;QACP;IACJ;AACJ;AAEM,SAAU,YAAY,CACxB,QAAuB,EACvB,SAAoC,EACpC,MAAyB,EACzB,MAAgB,EAChB,SAAiB,EACjB,OAAe,EAAA;AAEf;;;;AAIG;AACH,IAAA,cAAc,CAAC,QAAQ,EAAE,SAAS,EAAE,OAAO,CAAC;AAE5C,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACvC,QAAQ,CAAC,IAAI,CAAC;AACV,YAAA,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC;YACnB,EAAE,EAAE,SAAS,CAAC,SAAS,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;AAC5C,YAAA,MAAM,EAAE,mBAAmB,CAAC,MAAM,EAAE,CAAC,CAAC;AACzC,SAAA,CAAC;IACN;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/animation/sequence/utils/normalize-times.mjs b/node_modules/framer-motion/dist/es/animation/sequence/utils/normalize-times.mjs new file mode 100644 index 0000000..14f6728 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/sequence/utils/normalize-times.mjs @@ -0,0 +1,18 @@ +/** + * Take an array of times that represent repeated keyframes. For instance + * if we have original times of [0, 0.5, 1] then our repeated times will + * be [0, 0.5, 1, 1, 1.5, 2]. Loop over the times and scale them back + * down to a 0-1 scale. + * + * `repeatDelayUnits` is the repeatDelay expressed in units of a single + * iteration's duration, so the total span equals `(repeat + 1) + repeat * repeatDelayUnits`. + */ +function normalizeTimes(times, repeat, repeatDelayUnits = 0) { + const totalUnits = repeat + 1 + repeat * repeatDelayUnits; + for (let i = 0; i < times.length; i++) { + times[i] = times[i] / totalUnits; + } +} + +export { normalizeTimes }; +//# sourceMappingURL=normalize-times.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/sequence/utils/normalize-times.mjs.map b/node_modules/framer-motion/dist/es/animation/sequence/utils/normalize-times.mjs.map new file mode 100644 index 0000000..26c27ca --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/sequence/utils/normalize-times.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"normalize-times.mjs","sources":["../../../../../src/animation/sequence/utils/normalize-times.ts"],"sourcesContent":["/**\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"],"names":[],"mappings":"AAAA;;;;;;;;AAQG;AACG,SAAU,cAAc,CAC1B,KAAe,EACf,MAAc,EACd,gBAAgB,GAAG,CAAC,EAAA;IAEpB,MAAM,UAAU,GAAG,MAAM,GAAG,CAAC,GAAG,MAAM,GAAG,gBAAgB;AACzD,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACnC,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,UAAU;IACpC;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/animation/sequence/utils/sort.mjs b/node_modules/framer-motion/dist/es/animation/sequence/utils/sort.mjs new file mode 100644 index 0000000..49ae938 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/sequence/utils/sort.mjs @@ -0,0 +1,15 @@ +function compareByTime(a, b) { + if (a.at === b.at) { + if (a.value === null) + return 1; + if (b.value === null) + return -1; + return 0; + } + else { + return a.at - b.at; + } +} + +export { compareByTime }; +//# sourceMappingURL=sort.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/sequence/utils/sort.mjs.map b/node_modules/framer-motion/dist/es/animation/sequence/utils/sort.mjs.map new file mode 100644 index 0000000..148e5d2 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/sequence/utils/sort.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"sort.mjs","sources":["../../../../../src/animation/sequence/utils/sort.ts"],"sourcesContent":["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"],"names":[],"mappings":"AAEM,SAAU,aAAa,CACzB,CAAmB,EACnB,CAAmB,EAAA;IAEnB,IAAI,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,EAAE;AACf,QAAA,IAAI,CAAC,CAAC,KAAK,KAAK,IAAI;AAAE,YAAA,OAAO,CAAC;AAC9B,QAAA,IAAI,CAAC,CAAC,KAAK,KAAK,IAAI;YAAE,OAAO,EAAE;AAC/B,QAAA,OAAO,CAAC;IACZ;SAAO;AACH,QAAA,OAAO,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE;IACtB;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/animation/utils/create-visual-element.mjs b/node_modules/framer-motion/dist/es/animation/utils/create-visual-element.mjs new file mode 100644 index 0000000..d2c7acf --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/utils/create-visual-element.mjs @@ -0,0 +1,41 @@ +import { isSVGElement, isSVGSVGElement, SVGVisualElement, HTMLVisualElement, visualElementStore, ObjectVisualElement } from 'motion-dom'; + +function createDOMVisualElement(element) { + const options = { + presenceContext: null, + props: {}, + visualState: { + renderState: { + transform: {}, + transformOrigin: {}, + style: {}, + vars: {}, + attrs: {}, + }, + latestValues: {}, + }, + }; + const node = isSVGElement(element) && !isSVGSVGElement(element) + ? new SVGVisualElement(options) + : new HTMLVisualElement(options); + node.mount(element); + visualElementStore.set(element, node); +} +function createObjectVisualElement(subject) { + const options = { + presenceContext: null, + props: {}, + visualState: { + renderState: { + output: {}, + }, + latestValues: {}, + }, + }; + const node = new ObjectVisualElement(options); + node.mount(subject); + visualElementStore.set(subject, node); +} + +export { createDOMVisualElement, createObjectVisualElement }; +//# sourceMappingURL=create-visual-element.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/utils/create-visual-element.mjs.map b/node_modules/framer-motion/dist/es/animation/utils/create-visual-element.mjs.map new file mode 100644 index 0000000..98d7295 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/utils/create-visual-element.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"create-visual-element.mjs","sources":["../../../../src/animation/utils/create-visual-element.ts"],"sourcesContent":["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"],"names":[],"mappings":";;AASM,SAAU,sBAAsB,CAAC,OAAiC,EAAA;AACpE,IAAA,MAAM,OAAO,GAAG;AACZ,QAAA,eAAe,EAAE,IAAI;AACrB,QAAA,KAAK,EAAE,EAAE;AACT,QAAA,WAAW,EAAE;AACT,YAAA,WAAW,EAAE;AACT,gBAAA,SAAS,EAAE,EAAE;AACb,gBAAA,eAAe,EAAE,EAAE;AACnB,gBAAA,KAAK,EAAE,EAAE;AACT,gBAAA,IAAI,EAAE,EAAE;AACR,gBAAA,KAAK,EAAE,EAAE;AACZ,aAAA;AACD,YAAA,YAAY,EAAE,EAAE;AACnB,SAAA;KACJ;IACD,MAAM,IAAI,GACN,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,eAAe,CAAC,OAAO;AAC7C,UAAE,IAAI,gBAAgB,CAAC,OAAO;AAC9B,UAAE,IAAI,iBAAiB,CAAC,OAAO,CAAC;AAExC,IAAA,IAAI,CAAC,KAAK,CAAC,OAAc,CAAC;AAE1B,IAAA,kBAAkB,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC;AACzC;AAEM,SAAU,yBAAyB,CAAC,OAAe,EAAA;AACrD,IAAA,MAAM,OAAO,GAAG;AACZ,QAAA,eAAe,EAAE,IAAI;AACrB,QAAA,KAAK,EAAE,EAAE;AACT,QAAA,WAAW,EAAE;AACT,YAAA,WAAW,EAAE;AACT,gBAAA,MAAM,EAAE,EAAE;AACb,aAAA;AACD,YAAA,YAAY,EAAE,EAAE;AACnB,SAAA;KACJ;AACD,IAAA,MAAM,IAAI,GAAG,IAAI,mBAAmB,CAAC,OAAO,CAAC;AAE7C,IAAA,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;AAEnB,IAAA,kBAAkB,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC;AACzC;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/animation/utils/is-dom-keyframes.mjs b/node_modules/framer-motion/dist/es/animation/utils/is-dom-keyframes.mjs new file mode 100644 index 0000000..be44507 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/utils/is-dom-keyframes.mjs @@ -0,0 +1,6 @@ +function isDOMKeyframes(keyframes) { + return typeof keyframes === "object" && !Array.isArray(keyframes); +} + +export { isDOMKeyframes }; +//# sourceMappingURL=is-dom-keyframes.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/utils/is-dom-keyframes.mjs.map b/node_modules/framer-motion/dist/es/animation/utils/is-dom-keyframes.mjs.map new file mode 100644 index 0000000..f8089b3 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/utils/is-dom-keyframes.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"is-dom-keyframes.mjs","sources":["../../../../src/animation/utils/is-dom-keyframes.ts"],"sourcesContent":["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"],"names":[],"mappings":"AAEM,SAAU,cAAc,CAC1B,SAAkB,EAAA;AAElB,IAAA,OAAO,OAAO,SAAS,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC;AACrE;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/client.mjs b/node_modules/framer-motion/dist/es/client.mjs new file mode 100644 index 0000000..ca763ff --- /dev/null +++ b/node_modules/framer-motion/dist/es/client.mjs @@ -0,0 +1,2 @@ +export { MotionA as a, MotionAbbr as abbr, MotionAddress as address, MotionAnimate as animate, MotionArea as area, MotionArticle as article, MotionAside as aside, MotionAudio as audio, MotionB as b, MotionBase as base, MotionBdi as bdi, MotionBdo as bdo, MotionBig as big, MotionBlockquote as blockquote, MotionBody as body, MotionButton as button, MotionCanvas as canvas, MotionCaption as caption, MotionCircle as circle, MotionCite as cite, MotionClipPath as clipPath, MotionCode as code, MotionCol as col, MotionColgroup as colgroup, MotionData as data, MotionDatalist as datalist, MotionDd as dd, MotionDefs as defs, MotionDel as del, MotionDesc as desc, MotionDetails as details, MotionDfn as dfn, MotionDialog as dialog, MotionDiv as div, MotionDl as dl, MotionDt as dt, MotionEllipse as ellipse, MotionEm as em, MotionEmbed as embed, MotionFeBlend as feBlend, MotionFeColorMatrix as feColorMatrix, MotionFeComponentTransfer as feComponentTransfer, MotionFeComposite as feComposite, MotionFeConvolveMatrix as feConvolveMatrix, MotionFeDiffuseLighting as feDiffuseLighting, MotionFeDisplacementMap as feDisplacementMap, MotionFeDistantLight as feDistantLight, MotionFeDropShadow as feDropShadow, MotionFeFlood as feFlood, MotionFeFuncA as feFuncA, MotionFeFuncB as feFuncB, MotionFeFuncG as feFuncG, MotionFeFuncR as feFuncR, MotionFeGaussianBlur as feGaussianBlur, MotionFeImage as feImage, MotionFeMerge as feMerge, MotionFeMergeNode as feMergeNode, MotionFeMorphology as feMorphology, MotionFeOffset as feOffset, MotionFePointLight as fePointLight, MotionFeSpecularLighting as feSpecularLighting, MotionFeSpotLight as feSpotLight, MotionFeTile as feTile, MotionFeTurbulence as feTurbulence, MotionFieldset as fieldset, MotionFigcaption as figcaption, MotionFigure as figure, MotionFilter as filter, MotionFooter as footer, MotionForeignObject as foreignObject, MotionForm as form, MotionG as g, MotionH1 as h1, MotionH2 as h2, MotionH3 as h3, MotionH4 as h4, MotionH5 as h5, MotionH6 as h6, MotionHead as head, MotionHeader as header, MotionHgroup as hgroup, MotionHr as hr, MotionHtml as html, MotionI as i, MotionIframe as iframe, MotionImage as image, MotionImg as img, MotionInput as input, MotionIns as ins, MotionKbd as kbd, MotionKeygen as keygen, MotionLabel as label, MotionLegend as legend, MotionLi as li, MotionLine as line, MotionLinearGradient as linearGradient, MotionLink as link, MotionMain as main, MotionMap as map, MotionMark as mark, MotionMarker as marker, MotionMask as mask, MotionMenu as menu, MotionMenuitem as menuitem, MotionMetadata as metadata, MotionMeter as meter, MotionNav as nav, MotionObject as object, MotionOl as ol, MotionOptgroup as optgroup, MotionOption as option, MotionOutput as output, MotionP as p, MotionParam as param, MotionPath as path, MotionPattern as pattern, MotionPicture as picture, MotionPolygon as polygon, MotionPolyline as polyline, MotionPre as pre, MotionProgress as progress, MotionQ as q, MotionRadialGradient as radialGradient, MotionRect as rect, MotionRp as rp, MotionRt as rt, MotionRuby as ruby, MotionS as s, MotionSamp as samp, MotionScript as script, MotionSection as section, MotionSelect as select, MotionSmall as small, MotionSource as source, MotionSpan as span, MotionStop as stop, MotionStrong as strong, MotionStyle as style, MotionSub as sub, MotionSummary as summary, MotionSup as sup, MotionSvg as svg, MotionSymbol as symbol, MotionTable as table, MotionTbody as tbody, MotionTd as td, MotionText as text, MotionTextPath as textPath, MotionTextarea as textarea, MotionTfoot as tfoot, MotionTh as th, MotionThead as thead, MotionTime as time, MotionTitle as title, MotionTr as tr, MotionTrack as track, MotionTspan as tspan, MotionU as u, MotionUl as ul, MotionUse as use, MotionVideo as video, MotionView as view, MotionWbr as wbr, MotionWebview as webview } from './render/components/motion/elements.mjs'; +//# sourceMappingURL=client.mjs.map diff --git a/node_modules/framer-motion/dist/es/client.mjs.map b/node_modules/framer-motion/dist/es/client.mjs.map new file mode 100644 index 0000000..5835aec --- /dev/null +++ b/node_modules/framer-motion/dist/es/client.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"client.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.mjs b/node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.mjs new file mode 100644 index 0000000..8f94c28 --- /dev/null +++ b/node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.mjs @@ -0,0 +1,118 @@ +"use client"; +import { jsx } from 'react/jsx-runtime'; +import { isHTMLElement } from 'motion-dom'; +import * as React from 'react'; +import { useId, useRef, useContext, useInsertionEffect } from 'react'; +import { MotionConfigContext } from '../../context/MotionConfigContext.mjs'; +import { useComposedRefs } from '../../utils/use-composed-ref.mjs'; + +/** + * Measurement functionality has to be within a separate component + * to leverage snapshot lifecycle. + */ +class PopChildMeasure extends React.Component { + getSnapshotBeforeUpdate(prevProps) { + const element = this.props.childRef.current; + if (isHTMLElement(element) && prevProps.isPresent && !this.props.isPresent && this.props.pop !== false) { + const parent = element.offsetParent; + const parentWidth = isHTMLElement(parent) + ? parent.offsetWidth || 0 + : 0; + const parentHeight = isHTMLElement(parent) + ? parent.offsetHeight || 0 + : 0; + const computedStyle = getComputedStyle(element); + const size = this.props.sizeRef.current; + size.height = parseFloat(computedStyle.height); + size.width = parseFloat(computedStyle.width); + size.top = element.offsetTop; + size.left = element.offsetLeft; + size.right = parentWidth - size.width - size.left; + size.bottom = parentHeight - size.height - size.top; + size.direction = computedStyle.direction; + } + return null; + } + /** + * Required with getSnapshotBeforeUpdate to stop React complaining. + */ + componentDidUpdate() { } + render() { + return this.props.children; + } +} +function PopChild({ children, isPresent, anchorX, anchorY, root, pop }) { + const id = useId(); + const ref = useRef(null); + const size = useRef({ + width: 0, + height: 0, + top: 0, + left: 0, + right: 0, + bottom: 0, + direction: "ltr", + }); + const { nonce } = useContext(MotionConfigContext); + /** + * In React 19, refs are passed via props.ref instead of element.ref. + * We check props.ref first (React 19) and fall back to element.ref (React 18). + * + * The composed ref is only used when popping the child out (pop !== false), + * so we avoid reading children.props.ref otherwise. In React 18.3 that read + * triggers a spurious "`ref` is not a prop" warning getter (#3745). + */ + const childRef = pop !== false + ? (children.props?.ref ?? + children?.ref) + : undefined; + const composedRef = useComposedRefs(ref, childRef); + /** + * We create and inject a style block so we can apply this explicit + * sizing in a non-destructive manner by just deleting the style block. + * + * We can't apply size via render as the measurement happens + * in getSnapshotBeforeUpdate (post-render), likewise if we apply the + * styles directly on the DOM node, we might be overwriting + * styles set via the style prop. + */ + useInsertionEffect(() => { + const { width, height, top, left, right, bottom, direction } = size.current; + if (isPresent || pop === false || !ref.current || !width || !height) + return; + const isRTL = direction === "rtl"; + const x = anchorX === "left" + ? (isRTL ? `right: ${right}` : `left: ${left}`) + : (isRTL ? `left: ${left}` : `right: ${right}`); + const y = anchorY === "bottom" ? `bottom: ${bottom}` : `top: ${top}`; + ref.current.dataset.motionPopId = id; + const style = document.createElement("style"); + if (nonce) + style.nonce = nonce; + const parent = root ?? document.head; + parent.appendChild(style); + if (style.sheet) { + style.sheet.insertRule(` + [data-motion-pop-id="${id}"] { + position: absolute !important; + width: ${width}px !important; + height: ${height}px !important; + ${x}px !important; + ${y}px !important; + } + `); + } + return () => { + ref.current?.removeAttribute("data-motion-pop-id"); + if (parent.contains(style)) { + parent.removeChild(style); + } + }; + }, [isPresent]); + return (jsx(PopChildMeasure, { isPresent: isPresent, childRef: ref, sizeRef: size, pop: pop, children: pop === false + ? children + : React.cloneElement(children, { ref: composedRef }) })); +} + +export { PopChild }; +//# sourceMappingURL=PopChild.mjs.map diff --git a/node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.mjs.map b/node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.mjs.map new file mode 100644 index 0000000..7f8d974 --- /dev/null +++ b/node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"PopChild.mjs","sources":["../../../../src/components/AnimatePresence/PopChild.tsx"],"sourcesContent":["\"use client\"\n\nimport { isHTMLElement } from \"motion-dom\"\nimport * as React from \"react\"\nimport { useContext, useId, useInsertionEffect, useRef } from \"react\"\n\nimport { MotionConfigContext } from \"../../context/MotionConfigContext\"\nimport { useComposedRefs } from \"../../utils/use-composed-ref\"\n\ninterface Size {\n width: number\n height: number\n top: number\n left: number\n right: number\n bottom: number\n direction: string\n}\n\ninterface Props {\n children: React.ReactElement\n isPresent: boolean\n anchorX?: \"left\" | \"right\"\n anchorY?: \"top\" | \"bottom\"\n root?: HTMLElement | ShadowRoot\n pop?: boolean\n}\n\ninterface MeasureProps extends Props {\n childRef: React.RefObject\n sizeRef: React.RefObject\n}\n\n/**\n * Measurement functionality has to be within a separate component\n * to leverage snapshot lifecycle.\n */\nclass PopChildMeasure extends React.Component {\n getSnapshotBeforeUpdate(prevProps: MeasureProps) {\n const element = this.props.childRef.current\n if (isHTMLElement(element) && prevProps.isPresent && !this.props.isPresent && this.props.pop !== false) {\n const parent = element.offsetParent\n const parentWidth = isHTMLElement(parent)\n ? parent.offsetWidth || 0\n : 0\n const parentHeight = isHTMLElement(parent)\n ? parent.offsetHeight || 0\n : 0\n\n const computedStyle = getComputedStyle(element)\n const size = this.props.sizeRef.current!\n size.height = parseFloat(computedStyle.height)\n size.width = parseFloat(computedStyle.width)\n size.top = element.offsetTop\n size.left = element.offsetLeft\n size.right = parentWidth - size.width - size.left\n size.bottom = parentHeight - size.height - size.top\n size.direction = computedStyle.direction\n }\n\n return null\n }\n\n /**\n * Required with getSnapshotBeforeUpdate to stop React complaining.\n */\n componentDidUpdate() {}\n\n render() {\n return this.props.children\n }\n}\n\nexport function PopChild({ children, isPresent, anchorX, anchorY, root, pop }: Props) {\n const id = useId()\n const ref = useRef(null)\n const size = useRef({\n width: 0,\n height: 0,\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n direction: \"ltr\",\n })\n const { nonce } = useContext(MotionConfigContext)\n /**\n * In React 19, refs are passed via props.ref instead of element.ref.\n * We check props.ref first (React 19) and fall back to element.ref (React 18).\n *\n * The composed ref is only used when popping the child out (pop !== false),\n * so we avoid reading children.props.ref otherwise. In React 18.3 that read\n * triggers a spurious \"`ref` is not a prop\" warning getter (#3745).\n */\n const childRef =\n pop !== false\n ? ((children.props as { ref?: React.Ref })?.ref ??\n (children as unknown as { ref?: React.Ref })?.ref)\n : undefined\n const composedRef = useComposedRefs(ref, childRef)\n\n /**\n * We create and inject a style block so we can apply this explicit\n * sizing in a non-destructive manner by just deleting the style block.\n *\n * We can't apply size via render as the measurement happens\n * in getSnapshotBeforeUpdate (post-render), likewise if we apply the\n * styles directly on the DOM node, we might be overwriting\n * styles set via the style prop.\n */\n useInsertionEffect(() => {\n const { width, height, top, left, right, bottom, direction } = size.current\n if (isPresent || pop === false || !ref.current || !width || !height) return\n\n const isRTL = direction === \"rtl\"\n const x = anchorX === \"left\"\n ? (isRTL ? `right: ${right}` : `left: ${left}`)\n : (isRTL ? `left: ${left}` : `right: ${right}`)\n const y = anchorY === \"bottom\" ? `bottom: ${bottom}` : `top: ${top}`\n\n ref.current.dataset.motionPopId = id\n\n const style = document.createElement(\"style\")\n if (nonce) style.nonce = nonce\n\n const parent = root ?? document.head\n parent.appendChild(style)\n\n if (style.sheet) {\n style.sheet.insertRule(`\n [data-motion-pop-id=\"${id}\"] {\n position: absolute !important;\n width: ${width}px !important;\n height: ${height}px !important;\n ${x}px !important;\n ${y}px !important;\n }\n `)\n }\n\n return () => {\n ref.current?.removeAttribute(\"data-motion-pop-id\")\n if (parent.contains(style)) {\n parent.removeChild(style)\n }\n }\n }, [isPresent])\n\n return (\n \n {pop === false\n ? children\n : React.cloneElement(children as any, { ref: composedRef })}\n \n )\n}\n"],"names":[],"mappings":";;;;;;;;AAiCA;;;AAGG;AACH;AACI;;;AAGQ;AACA;AACI;;AAEJ;AACI;;AAGJ;;;;AAIA;AACA;AACA;AACA;AACA;;AAGJ;;AAGJ;;AAEG;AACH;;AAGI;;AAEP;AAEK;AACF;AACA;;AAEI;AACA;AACA;AACA;AACA;AACA;AACA;AACH;;AAED;;;;;;;AAOG;AACH;AAEQ;;;;AAKR;;;;;;;;AAQG;;AAEC;AACA;;AAEA;AACA;AACI;AACA;AACJ;;;AAKA;AAAW;AAEX;AACA;AAEA;AACI;;;;;;;;AAQH;;AAGD;AACI;AACA;AACI;;AAER;AACJ;;AAKY;AACA;AAGhB;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs b/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs new file mode 100644 index 0000000..19d6046 --- /dev/null +++ b/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs @@ -0,0 +1,77 @@ +"use client"; +import { jsx } from 'react/jsx-runtime'; +import * as React from 'react'; +import { useId, useRef, useMemo } from 'react'; +import { PresenceContext } from '../../context/PresenceContext.mjs'; +import { useConstant } from '../../utils/use-constant.mjs'; +import { useIsomorphicLayoutEffect } from '../../utils/use-isomorphic-effect.mjs'; +import { PopChild } from './PopChild.mjs'; + +const PresenceChild = ({ children, initial, isPresent, onExitComplete, custom, presenceAffectsLayout, mode, anchorX, anchorY, root }) => { + const presenceChildren = useConstant(newChildrenMap); + const id = useId(); + // Written in a layout effect (not render) so discarded concurrent + // renders can't leave the refs pointing at uncommitted state. + const isPresentRef = useRef(isPresent); + const onExitCompleteRef = useRef(onExitComplete); + useIsomorphicLayoutEffect(() => { + isPresentRef.current = isPresent; + onExitCompleteRef.current = onExitComplete; + }); + let isReusedContext = true; + let context = useMemo(() => { + isReusedContext = false; + return { + id, + initial, + isPresent, + custom, + onExitComplete: (childId) => { + presenceChildren.set(childId, true); + for (const isComplete of presenceChildren.values()) { + if (!isComplete) + return; // can stop searching when any is incomplete + } + onExitComplete && onExitComplete(); + }, + register: (childId) => { + presenceChildren.set(childId, false); + return () => { + presenceChildren.delete(childId); + !isPresentRef.current && + !presenceChildren.size && + onExitCompleteRef.current?.(); + }; + }, + }; + }, [isPresent, presenceChildren, onExitComplete]); + /** + * If the presence of a child affects the layout of the components around it, + * we want to make a new context value to ensure they get re-rendered + * so they can detect that layout change. + */ + if (presenceAffectsLayout && isReusedContext) { + context = { ...context }; + } + useMemo(() => { + presenceChildren.forEach((_, key) => presenceChildren.set(key, false)); + }, [isPresent]); + /** + * If there's no `motion` components to fire exit animations, we want to remove this + * component immediately. + */ + React.useEffect(() => { + !isPresent && + !presenceChildren.size && + onExitComplete && + onExitComplete(); + }, [isPresent]); + children = (jsx(PopChild, { pop: mode === "popLayout", isPresent: isPresent, anchorX: anchorX, anchorY: anchorY, root: root, children: children })); + return (jsx(PresenceContext.Provider, { value: context, children: children })); +}; +function newChildrenMap() { + return new Map(); +} + +export { PresenceChild }; +//# sourceMappingURL=PresenceChild.mjs.map diff --git a/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs.map b/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs.map new file mode 100644 index 0000000..ccd1c5d --- /dev/null +++ b/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"PresenceChild.mjs","sources":["../../../../src/components/AnimatePresence/PresenceChild.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport { useId, useMemo, useRef } from \"react\"\nimport {\n PresenceContext,\n type PresenceContextProps,\n} from \"../../context/PresenceContext\"\nimport { VariantLabels } from \"../../motion/types\"\nimport { useConstant } from \"../../utils/use-constant\"\nimport { useIsomorphicLayoutEffect } from \"../../utils/use-isomorphic-effect\"\nimport { PopChild } from \"./PopChild\"\n\ninterface PresenceChildProps {\n children: React.ReactElement\n isPresent: boolean\n onExitComplete?: () => void\n initial?: false | VariantLabels\n custom?: any\n presenceAffectsLayout: boolean\n mode: \"sync\" | \"popLayout\" | \"wait\"\n anchorX?: \"left\" | \"right\"\n anchorY?: \"top\" | \"bottom\"\n root?: HTMLElement | ShadowRoot\n}\n\nexport const PresenceChild = ({\n children,\n initial,\n isPresent,\n onExitComplete,\n custom,\n presenceAffectsLayout,\n mode,\n anchorX,\n anchorY,\n root\n}: PresenceChildProps) => {\n const presenceChildren = useConstant(newChildrenMap)\n const id = useId()\n\n // Written in a layout effect (not render) so discarded concurrent\n // renders can't leave the refs pointing at uncommitted state.\n const isPresentRef = useRef(isPresent)\n const onExitCompleteRef = useRef(onExitComplete)\n useIsomorphicLayoutEffect(() => {\n isPresentRef.current = isPresent\n onExitCompleteRef.current = onExitComplete\n })\n\n let isReusedContext = true\n let context = useMemo((): PresenceContextProps => {\n isReusedContext = false\n return {\n id,\n initial,\n isPresent,\n custom,\n onExitComplete: (childId: string) => {\n presenceChildren.set(childId, true)\n\n for (const isComplete of presenceChildren.values()) {\n if (!isComplete) return // can stop searching when any is incomplete\n }\n\n onExitComplete && onExitComplete()\n },\n register: (childId: string) => {\n presenceChildren.set(childId, false)\n return () => {\n presenceChildren.delete(childId)\n !isPresentRef.current &&\n !presenceChildren.size &&\n onExitCompleteRef.current?.()\n }\n },\n }\n }, [isPresent, presenceChildren, onExitComplete])\n\n /**\n * If the presence of a child affects the layout of the components around it,\n * we want to make a new context value to ensure they get re-rendered\n * so they can detect that layout change.\n */\n if (presenceAffectsLayout && isReusedContext) {\n context = { ...context }\n }\n\n useMemo(() => {\n presenceChildren.forEach((_, key) => presenceChildren.set(key, false))\n }, [isPresent])\n\n /**\n * If there's no `motion` components to fire exit animations, we want to remove this\n * component immediately.\n */\n React.useEffect(() => {\n !isPresent &&\n !presenceChildren.size &&\n onExitComplete &&\n onExitComplete()\n }, [isPresent])\n\n children = (\n \n {children}\n \n )\n\n return (\n \n {children}\n \n )\n}\n\nfunction newChildrenMap(): Map {\n return new Map()\n}\n"],"names":[],"mappings":";;;;;;;;;AA0BO;AAYH;AACA;;;AAIA;AACA;;AAEI;AACA;AACJ;;AAGA;;;;;;;AAOQ;AACI;;AAGI;AAAiB;;;;AAKzB;AACI;AACA;AACI;;;AAGI;AACR;;;;AAKZ;;;;AAIG;AACH;AACI;;;AAIA;AACJ;AAEA;;;AAGG;AACH;AACI;;;AAGI;AACR;AAEA;AAMA;AAKJ;AAEA;;AAEA;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs b/node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs new file mode 100644 index 0000000..08b3b7f --- /dev/null +++ b/node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs @@ -0,0 +1,181 @@ +"use client"; +import { jsx, Fragment } from 'react/jsx-runtime'; +import { useMemo, useRef, useState, useContext } from 'react'; +import { LayoutGroupContext } from '../../context/LayoutGroupContext.mjs'; +import { useConstant } from '../../utils/use-constant.mjs'; +import { useIsomorphicLayoutEffect } from '../../utils/use-isomorphic-effect.mjs'; +import { PresenceChild } from './PresenceChild.mjs'; +import { usePresence } from './use-presence.mjs'; +import { onlyElements, getChildKey } from './utils.mjs'; + +/** + * `AnimatePresence` enables the animation of components that have been removed from the tree. + * + * When adding/removing more than a single child, every child **must** be given a unique `key` prop. + * + * Any `motion` components that have an `exit` property defined will animate out when removed from + * the tree. + * + * ```jsx + * import { motion, AnimatePresence } from 'framer-motion' + * + * export const Items = ({ items }) => ( + * + * {items.map(item => ( + * + * ))} + * + * ) + * ``` + * + * You can sequence exit animations throughout a tree using variants. + * + * If a child contains multiple `motion` components with `exit` props, it will only unmount the child + * once all `motion` components have finished animating out. Likewise, any components using + * `usePresence` all need to call `safeToRemove`. + * + * @public + */ +const AnimatePresence = ({ children, custom, initial = true, onExitComplete, presenceAffectsLayout = true, mode = "sync", propagate = false, anchorX = "left", anchorY = "top", root }) => { + const [isParentPresent, safeToRemove] = usePresence(propagate); + /** + * Filter any children that aren't ReactElements. We can only track components + * between renders with a props.key. + */ + const presentChildren = useMemo(() => onlyElements(children), [children]); + /** + * Track the keys of the currently rendered children. This is used to + * determine which children are exiting. + */ + const presentKeys = propagate && !isParentPresent ? [] : presentChildren.map(getChildKey); + /** + * If `initial={false}` we only want to pass this to components in the first render. + */ + const isInitialRender = useRef(true); + /** + * A ref containing the currently present children. When all exit animations + * are complete, we use this to re-render the component with the latest children + * *committed* rather than the latest children *rendered*. + */ + const pendingPresentChildren = useRef(presentChildren); + /** + * Track which exiting children have finished animating out. + */ + const exitComplete = useConstant(() => new Map()); + /** + * Track which components are currently processing exit to prevent duplicate processing. + */ + const exitingComponents = useRef(new Set()); + /** + * Save children to render as React state. To ensure this component is concurrent-safe, + * we check for exiting children via an effect. + */ + const [diffedChildren, setDiffedChildren] = useState(presentChildren); + const [renderedChildren, setRenderedChildren] = useState(presentChildren); + useIsomorphicLayoutEffect(() => { + if (propagate && !isParentPresent && !renderedChildren.length) { + safeToRemove?.(); + } + }, [isParentPresent, propagate, renderedChildren.length, safeToRemove]); + useIsomorphicLayoutEffect(() => { + isInitialRender.current = false; + pendingPresentChildren.current = presentChildren; + /** + * Update complete status of exiting children. + */ + for (let i = 0; i < renderedChildren.length; i++) { + const key = getChildKey(renderedChildren[i]); + if (!presentKeys.includes(key)) { + if (exitComplete.get(key) !== true) { + exitComplete.set(key, false); + } + } + else { + exitComplete.delete(key); + exitingComponents.current.delete(key); + } + } + }, [renderedChildren, presentKeys.length, presentKeys.join("-")]); + const exitingChildren = []; + if (presentChildren !== diffedChildren) { + let nextChildren = [...presentChildren]; + /** + * Loop through all the currently rendered components and decide which + * are exiting. + */ + for (let i = 0; i < renderedChildren.length; i++) { + const child = renderedChildren[i]; + const key = getChildKey(child); + if (!presentKeys.includes(key)) { + nextChildren.splice(i, 0, child); + exitingChildren.push(child); + } + } + /** + * If we're in "wait" mode, and we have exiting children, we want to + * only render these until they've all exited. + */ + if (mode === "wait" && exitingChildren.length) { + nextChildren = exitingChildren; + } + setRenderedChildren(onlyElements(nextChildren)); + setDiffedChildren(presentChildren); + /** + * Early return to ensure once we've set state with the latest diffed + * children, we can immediately re-render. + */ + return null; + } + if (process.env.NODE_ENV !== "production" && + mode === "wait" && + renderedChildren.length > 1) { + console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`); + } + /** + * If we've been provided a forceRender function by the LayoutGroupContext, + * we can use it to force a re-render amongst all surrounding components once + * all components have finished animating out. + */ + const { forceRender } = useContext(LayoutGroupContext); + return (jsx(Fragment, { children: renderedChildren.map((child) => { + const key = getChildKey(child); + const isPresent = propagate && !isParentPresent + ? false + : presentChildren === renderedChildren || + presentKeys.includes(key); + const onExit = () => { + if (exitingComponents.current.has(key)) { + return; + } + if (exitComplete.has(key)) { + exitingComponents.current.add(key); + exitComplete.set(key, true); + } + else { + return; + } + let isEveryExitComplete = true; + exitComplete.forEach((isExitComplete) => { + if (!isExitComplete) + isEveryExitComplete = false; + }); + if (isEveryExitComplete) { + forceRender?.(); + setRenderedChildren(pendingPresentChildren.current); + propagate && safeToRemove?.(); + onExitComplete && onExitComplete(); + } + }; + return (jsx(PresenceChild, { isPresent: isPresent, initial: !isInitialRender.current || initial + ? undefined + : false, custom: custom, presenceAffectsLayout: presenceAffectsLayout, mode: mode, root: root, onExitComplete: isPresent ? undefined : onExit, anchorX: anchorX, anchorY: anchorY, children: child }, key)); + }) })); +}; + +export { AnimatePresence }; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs.map b/node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs.map new file mode 100644 index 0000000..60048d7 --- /dev/null +++ b/node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../../../../src/components/AnimatePresence/index.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport { useContext, useMemo, useRef, useState } from \"react\"\nimport { LayoutGroupContext } from \"../../context/LayoutGroupContext\"\nimport { useConstant } from \"../../utils/use-constant\"\nimport { useIsomorphicLayoutEffect } from \"../../utils/use-isomorphic-effect\"\nimport { PresenceChild } from \"./PresenceChild\"\nimport { AnimatePresenceProps } from \"./types\"\nimport { usePresence } from \"./use-presence\"\nimport { ComponentKey, getChildKey, onlyElements } from \"./utils\"\n\n/**\n * `AnimatePresence` enables the animation of components that have been removed from the tree.\n *\n * When adding/removing more than a single child, every child **must** be given a unique `key` prop.\n *\n * Any `motion` components that have an `exit` property defined will animate out when removed from\n * the tree.\n *\n * ```jsx\n * import { motion, AnimatePresence } from 'framer-motion'\n *\n * export const Items = ({ items }) => (\n * \n * {items.map(item => (\n * \n * ))}\n * \n * )\n * ```\n *\n * You can sequence exit animations throughout a tree using variants.\n *\n * If a child contains multiple `motion` components with `exit` props, it will only unmount the child\n * once all `motion` components have finished animating out. Likewise, any components using\n * `usePresence` all need to call `safeToRemove`.\n *\n * @public\n */\nexport const AnimatePresence = ({\n children,\n custom,\n initial = true,\n onExitComplete,\n presenceAffectsLayout = true,\n mode = \"sync\",\n propagate = false,\n anchorX = \"left\",\n anchorY = \"top\",\n root\n}: React.PropsWithChildren) => {\n const [isParentPresent, safeToRemove] = usePresence(propagate)\n\n /**\n * Filter any children that aren't ReactElements. We can only track components\n * between renders with a props.key.\n */\n const presentChildren = useMemo(() => onlyElements(children), [children])\n\n /**\n * Track the keys of the currently rendered children. This is used to\n * determine which children are exiting.\n */\n const presentKeys =\n propagate && !isParentPresent ? [] : presentChildren.map(getChildKey)\n\n /**\n * If `initial={false}` we only want to pass this to components in the first render.\n */\n const isInitialRender = useRef(true)\n\n /**\n * A ref containing the currently present children. When all exit animations\n * are complete, we use this to re-render the component with the latest children\n * *committed* rather than the latest children *rendered*.\n */\n const pendingPresentChildren = useRef(presentChildren)\n\n /**\n * Track which exiting children have finished animating out.\n */\n const exitComplete = useConstant(() => new Map())\n\n /**\n * Track which components are currently processing exit to prevent duplicate processing.\n */\n const exitingComponents = useRef(new Set())\n\n /**\n * Save children to render as React state. To ensure this component is concurrent-safe,\n * we check for exiting children via an effect.\n */\n const [diffedChildren, setDiffedChildren] = useState(presentChildren)\n const [renderedChildren, setRenderedChildren] = useState(presentChildren)\n\n useIsomorphicLayoutEffect(() => {\n if (propagate && !isParentPresent && !renderedChildren.length) {\n safeToRemove?.()\n }\n }, [isParentPresent, propagate, renderedChildren.length, safeToRemove])\n\n useIsomorphicLayoutEffect(() => {\n isInitialRender.current = false\n pendingPresentChildren.current = presentChildren\n\n /**\n * Update complete status of exiting children.\n */\n for (let i = 0; i < renderedChildren.length; i++) {\n const key = getChildKey(renderedChildren[i])\n\n if (!presentKeys.includes(key)) {\n if (exitComplete.get(key) !== true) {\n exitComplete.set(key, false)\n }\n } else {\n exitComplete.delete(key)\n exitingComponents.current.delete(key)\n }\n }\n }, [renderedChildren, presentKeys.length, presentKeys.join(\"-\")])\n\n const exitingChildren: any[] = []\n\n if (presentChildren !== diffedChildren) {\n let nextChildren = [...presentChildren]\n\n /**\n * Loop through all the currently rendered components and decide which\n * are exiting.\n */\n for (let i = 0; i < renderedChildren.length; i++) {\n const child = renderedChildren[i]\n const key = getChildKey(child)\n\n if (!presentKeys.includes(key)) {\n nextChildren.splice(i, 0, child)\n exitingChildren.push(child)\n }\n }\n\n /**\n * If we're in \"wait\" mode, and we have exiting children, we want to\n * only render these until they've all exited.\n */\n if (mode === \"wait\" && exitingChildren.length) {\n nextChildren = exitingChildren\n }\n\n setRenderedChildren(onlyElements(nextChildren))\n setDiffedChildren(presentChildren)\n\n /**\n * Early return to ensure once we've set state with the latest diffed\n * children, we can immediately re-render.\n */\n return null\n }\n\n if (\n process.env.NODE_ENV !== \"production\" &&\n mode === \"wait\" &&\n renderedChildren.length > 1\n ) {\n console.warn(\n `You're attempting to animate multiple children within AnimatePresence, but its mode is set to \"wait\". This will lead to odd visual behaviour.`\n )\n }\n\n /**\n * If we've been provided a forceRender function by the LayoutGroupContext,\n * we can use it to force a re-render amongst all surrounding components once\n * all components have finished animating out.\n */\n const { forceRender } = useContext(LayoutGroupContext)\n\n return (\n <>\n {renderedChildren.map((child) => {\n const key = getChildKey(child)\n\n const isPresent =\n propagate && !isParentPresent\n ? false\n : presentChildren === renderedChildren ||\n presentKeys.includes(key)\n\n const onExit = () => {\n if (exitingComponents.current.has(key)) {\n return\n }\n\n if (exitComplete.has(key)) {\n exitingComponents.current.add(key)\n exitComplete.set(key, true)\n } else {\n return\n }\n\n let isEveryExitComplete = true\n exitComplete.forEach((isExitComplete) => {\n if (!isExitComplete) isEveryExitComplete = false\n })\n\n if (isEveryExitComplete) {\n forceRender?.()\n setRenderedChildren(pendingPresentChildren.current)\n\n propagate && safeToRemove?.()\n\n onExitComplete && onExitComplete()\n }\n }\n\n return (\n \n {child}\n \n )\n })}\n \n )\n}\n"],"names":[],"mappings":";;;;;;;;;;AAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCG;AACI;;AAcH;;;AAGG;AACH;AAEA;;;AAGG;AACH;AAGA;;AAEG;AACH;AAEA;;;;AAIG;AACH;AAEA;;AAEG;;AAGH;;AAEG;;AAGH;;;AAGG;;;;;;;AAQH;;AAGI;AACA;AAEA;;AAEG;AACH;;;;AAKY;;;;AAGJ;AACA;;;AAGZ;;AAIA;AACI;AAEA;;;AAGG;AACH;AACI;AACA;;;AAII;;;AAIR;;;AAGG;;;;AAKH;;AAGA;;;AAGG;AACH;;AAGJ;AAEI;AACA;AAEA;;AAKJ;;;;AAIG;;;AAMS;AAEA;AAEQ;;AAEE;;;;;AAON;AACI;AACA;;;;;;AAMJ;AACI;;AACJ;;;AAII;AAEA;;;AAIR;AAEA;AAMgB;;;AAiBhC;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence-data.mjs b/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence-data.mjs new file mode 100644 index 0000000..8f0f305 --- /dev/null +++ b/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence-data.mjs @@ -0,0 +1,11 @@ +"use client"; +import { useContext } from 'react'; +import { PresenceContext } from '../../context/PresenceContext.mjs'; + +function usePresenceData() { + const context = useContext(PresenceContext); + return context ? context.custom : undefined; +} + +export { usePresenceData }; +//# sourceMappingURL=use-presence-data.mjs.map diff --git a/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence-data.mjs.map b/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence-data.mjs.map new file mode 100644 index 0000000..a94db78 --- /dev/null +++ b/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence-data.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-presence-data.mjs","sources":["../../../../src/components/AnimatePresence/use-presence-data.ts"],"sourcesContent":["\"use client\"\n\nimport { useContext } from \"react\"\nimport { PresenceContext } from \"../../context/PresenceContext\"\n\nexport function usePresenceData() {\n const context = useContext(PresenceContext)\n return context ? context.custom : undefined\n}\n"],"names":[],"mappings":";;;;;AAMI;;AAEJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.mjs b/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.mjs new file mode 100644 index 0000000..462598e --- /dev/null +++ b/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.mjs @@ -0,0 +1,72 @@ +"use client"; +import { useContext, useId, useEffect, useCallback } from 'react'; +import { PresenceContext } from '../../context/PresenceContext.mjs'; + +/** + * When a component is the child of `AnimatePresence`, it can use `usePresence` + * to access information about whether it's still present in the React tree. + * + * ```jsx + * import { usePresence } from "framer-motion" + * + * export const Component = () => { + * const [isPresent, safeToRemove] = usePresence() + * + * useEffect(() => { + * !isPresent && setTimeout(safeToRemove, 1000) + * }, [isPresent]) + * + * return

+ * } + * ``` + * + * If `isPresent` is `false`, it means that a component has been removed from the tree, + * but `AnimatePresence` won't really remove it until `safeToRemove` has been called. + * + * @public + */ +function usePresence(subscribe = true) { + const context = useContext(PresenceContext); + if (context === null) + return [true, null]; + const { isPresent, onExitComplete, register } = context; + // It's safe to call the following hooks conditionally (after an early return) because the context will always + // either be null or non-null for the lifespan of the component. + const id = useId(); + useEffect(() => { + if (subscribe) { + return register(id); + } + }, [subscribe]); + const safeToRemove = useCallback(() => subscribe && onExitComplete && onExitComplete(id), [id, onExitComplete, subscribe]); + return !isPresent && onExitComplete ? [false, safeToRemove] : [true]; +} +/** + * Similar to `usePresence`, except `useIsPresent` simply returns whether or not the component is present. + * There is no `safeToRemove` function. + * + * ```jsx + * import { useIsPresent } from "framer-motion" + * + * export const Component = () => { + * const isPresent = useIsPresent() + * + * useEffect(() => { + * !isPresent && console.log("I've been removed!") + * }, [isPresent]) + * + * return
+ * } + * ``` + * + * @public + */ +function useIsPresent() { + return isPresent(useContext(PresenceContext)); +} +function isPresent(context) { + return context === null ? true : context.isPresent; +} + +export { isPresent, useIsPresent, usePresence }; +//# sourceMappingURL=use-presence.mjs.map diff --git a/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.mjs.map b/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.mjs.map new file mode 100644 index 0000000..a3af893 --- /dev/null +++ b/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-presence.mjs","sources":["../../../../src/components/AnimatePresence/use-presence.ts"],"sourcesContent":["\"use client\"\n\nimport { useCallback, useContext, useEffect, useId } from \"react\"\nimport {\n PresenceContext,\n PresenceContextProps,\n} from \"../../context/PresenceContext\"\n\nexport type SafeToRemove = () => void\n\ntype AlwaysPresent = [true, null]\n\ntype Present = [true]\n\ntype NotPresent = [false, SafeToRemove]\n\n/**\n * When a component is the child of `AnimatePresence`, it can use `usePresence`\n * to access information about whether it's still present in the React tree.\n *\n * ```jsx\n * import { usePresence } from \"framer-motion\"\n *\n * export const Component = () => {\n * const [isPresent, safeToRemove] = usePresence()\n *\n * useEffect(() => {\n * !isPresent && setTimeout(safeToRemove, 1000)\n * }, [isPresent])\n *\n * return
\n * }\n * ```\n *\n * If `isPresent` is `false`, it means that a component has been removed from the tree,\n * but `AnimatePresence` won't really remove it until `safeToRemove` has been called.\n *\n * @public\n */\nexport function usePresence(\n subscribe: boolean = true\n): AlwaysPresent | Present | NotPresent {\n const context = useContext(PresenceContext)\n\n if (context === null) return [true, null]\n\n const { isPresent, onExitComplete, register } = context\n\n // It's safe to call the following hooks conditionally (after an early return) because the context will always\n // either be null or non-null for the lifespan of the component.\n\n const id = useId()\n useEffect(() => {\n if (subscribe) {\n return register(id)\n }\n }, [subscribe])\n\n const safeToRemove = useCallback(\n () => subscribe && onExitComplete && onExitComplete(id),\n [id, onExitComplete, subscribe]\n )\n\n return !isPresent && onExitComplete ? [false, safeToRemove] : [true]\n}\n\n/**\n * Similar to `usePresence`, except `useIsPresent` simply returns whether or not the component is present.\n * There is no `safeToRemove` function.\n *\n * ```jsx\n * import { useIsPresent } from \"framer-motion\"\n *\n * export const Component = () => {\n * const isPresent = useIsPresent()\n *\n * useEffect(() => {\n * !isPresent && console.log(\"I've been removed!\")\n * }, [isPresent])\n *\n * return
\n * }\n * ```\n *\n * @public\n */\nexport function useIsPresent() {\n return isPresent(useContext(PresenceContext))\n}\n\nexport function isPresent(context: PresenceContextProps | null) {\n return context === null ? true : context.isPresent\n}\n"],"names":[],"mappings":";;;;AAgBA;;;;;;;;;;;;;;;;;;;;;;AAsBG;AACG;AAGF;;AAEsB;;;;AAOtB;;;AAGQ;;AAER;;AAOA;AACJ;AAEA;;;;;;;;;;;;;;;;;;;AAmBG;;AAEC;AACJ;AAEM;AACF;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/components/AnimatePresence/utils.mjs b/node_modules/framer-motion/dist/es/components/AnimatePresence/utils.mjs new file mode 100644 index 0000000..31b4bc8 --- /dev/null +++ b/node_modules/framer-motion/dist/es/components/AnimatePresence/utils.mjs @@ -0,0 +1,15 @@ +import { Children, isValidElement } from 'react'; + +const getChildKey = (child) => child.key || ""; +function onlyElements(children) { + const filtered = []; + // We use forEach here instead of map as map mutates the component key by preprending `.$` + Children.forEach(children, (child) => { + if (isValidElement(child)) + filtered.push(child); + }); + return filtered; +} + +export { getChildKey, onlyElements }; +//# sourceMappingURL=utils.mjs.map diff --git a/node_modules/framer-motion/dist/es/components/AnimatePresence/utils.mjs.map b/node_modules/framer-motion/dist/es/components/AnimatePresence/utils.mjs.map new file mode 100644 index 0000000..5679804 --- /dev/null +++ b/node_modules/framer-motion/dist/es/components/AnimatePresence/utils.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"utils.mjs","sources":["../../../../src/components/AnimatePresence/utils.ts"],"sourcesContent":["import { isValidElement, Children, ReactElement, ReactNode } from \"react\"\n\nexport type ComponentKey = string | number\n\nexport const getChildKey = (child: ReactElement): ComponentKey =>\n child.key || \"\"\n\nexport function onlyElements(children: ReactNode): ReactElement[] {\n const filtered: ReactElement[] = []\n\n // We use forEach here instead of map as map mutates the component key by preprending `.$`\n Children.forEach(children, (child) => {\n if (isValidElement(child)) filtered.push(child)\n })\n\n return filtered\n}\n"],"names":[],"mappings":";;AAIO,MAAM,WAAW,GAAG,CAAC,KAAwB,KAChD,KAAK,CAAC,GAAG,IAAI;AAEX,SAAU,YAAY,CAAC,QAAmB,EAAA;IAC5C,MAAM,QAAQ,GAAwB,EAAE;;IAGxC,QAAQ,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,KAAK,KAAI;QACjC,IAAI,cAAc,CAAC,KAAK,CAAC;AAAE,YAAA,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC;AACnD,IAAA,CAAC,CAAC;AAEF,IAAA,OAAO,QAAQ;AACnB;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/components/AnimateSharedLayout.mjs b/node_modules/framer-motion/dist/es/components/AnimateSharedLayout.mjs new file mode 100644 index 0000000..13a4147 --- /dev/null +++ b/node_modules/framer-motion/dist/es/components/AnimateSharedLayout.mjs @@ -0,0 +1,17 @@ +"use client"; +import { jsx } from 'react/jsx-runtime'; +import { invariant } from 'motion-utils'; +import * as React from 'react'; +import { useConstant } from '../utils/use-constant.mjs'; +import { LayoutGroup } from './LayoutGroup/index.mjs'; + +let id = 0; +const AnimateSharedLayout = ({ children }) => { + React.useEffect(() => { + invariant(false, "AnimateSharedLayout is deprecated: https://www.framer.com/docs/guide-upgrade/##shared-layout-animations"); + }, []); + return (jsx(LayoutGroup, { id: useConstant(() => `asl-${id++}`), children: children })); +}; + +export { AnimateSharedLayout }; +//# sourceMappingURL=AnimateSharedLayout.mjs.map diff --git a/node_modules/framer-motion/dist/es/components/AnimateSharedLayout.mjs.map b/node_modules/framer-motion/dist/es/components/AnimateSharedLayout.mjs.map new file mode 100644 index 0000000..4fb5031 --- /dev/null +++ b/node_modules/framer-motion/dist/es/components/AnimateSharedLayout.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"AnimateSharedLayout.mjs","sources":["../../../src/components/AnimateSharedLayout.tsx"],"sourcesContent":["\"use client\"\n\nimport { invariant } from \"motion-utils\"\nimport * as React from \"react\"\nimport { useConstant } from \"../utils/use-constant\"\nimport { LayoutGroup } from \"./LayoutGroup\"\n\nlet id = 0\nexport const AnimateSharedLayout: React.FunctionComponent<\n React.PropsWithChildren\n> = ({ children }: React.PropsWithChildren<{}>) => {\n React.useEffect(() => {\n invariant(\n false,\n \"AnimateSharedLayout is deprecated: https://www.framer.com/docs/guide-upgrade/##shared-layout-animations\"\n )\n }, [])\n\n return (\n `asl-${id++}`)}>\n {children}\n \n )\n}\n"],"names":[],"mappings":";;;;;;;AAOA;;AAII;AACI;;;AAWR;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/components/LayoutGroup/index.mjs b/node_modules/framer-motion/dist/es/components/LayoutGroup/index.mjs new file mode 100644 index 0000000..4d5b36d --- /dev/null +++ b/node_modules/framer-motion/dist/es/components/LayoutGroup/index.mjs @@ -0,0 +1,33 @@ +"use client"; +import { jsx } from 'react/jsx-runtime'; +import { useContext, useRef, useMemo } from 'react'; +import { LayoutGroupContext } from '../../context/LayoutGroupContext.mjs'; +import { DeprecatedLayoutGroupContext } from '../../context/DeprecatedLayoutGroupContext.mjs'; +import { useForceUpdate } from '../../utils/use-force-update.mjs'; +import { nodeGroup } from 'motion-dom'; + +const shouldInheritGroup = (inherit) => inherit === true; +const shouldInheritId = (inherit) => shouldInheritGroup(inherit === true) || inherit === "id"; +const LayoutGroup = ({ children, id, inherit = true }) => { + const layoutGroupContext = useContext(LayoutGroupContext); + const deprecatedLayoutGroupContext = useContext(DeprecatedLayoutGroupContext); + const [forceRender, key] = useForceUpdate(); + const context = useRef(null); + const upstreamId = layoutGroupContext.id || deprecatedLayoutGroupContext; + if (context.current === null) { + if (shouldInheritId(inherit) && upstreamId) { + id = id ? upstreamId + "-" + id : upstreamId; + } + context.current = { + id, + group: shouldInheritGroup(inherit) + ? layoutGroupContext.group || nodeGroup() + : nodeGroup(), + }; + } + const memoizedContext = useMemo(() => ({ ...context.current, forceRender }), [key]); + return (jsx(LayoutGroupContext.Provider, { value: memoizedContext, children: children })); +}; + +export { LayoutGroup }; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/framer-motion/dist/es/components/LayoutGroup/index.mjs.map b/node_modules/framer-motion/dist/es/components/LayoutGroup/index.mjs.map new file mode 100644 index 0000000..f429a6f --- /dev/null +++ b/node_modules/framer-motion/dist/es/components/LayoutGroup/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../../../../src/components/LayoutGroup/index.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport { MutableRefObject, useContext, useMemo, useRef } from \"react\"\nimport {\n LayoutGroupContext,\n LayoutGroupContextProps,\n} from \"../../context/LayoutGroupContext\"\nimport { DeprecatedLayoutGroupContext } from \"../../context/DeprecatedLayoutGroupContext\"\nimport { nodeGroup } from \"../../projection\"\nimport { useForceUpdate } from \"../../utils/use-force-update\"\n\ntype InheritOption = boolean | \"id\"\n\nexport interface Props {\n id?: string\n inherit?: InheritOption\n}\n\nconst shouldInheritGroup = (inherit: InheritOption) => inherit === true\nconst shouldInheritId = (inherit: InheritOption) =>\n shouldInheritGroup(inherit === true) || inherit === \"id\"\n\nexport const LayoutGroup: React.FunctionComponent<\n React.PropsWithChildren\n> = ({ children, id, inherit = true }) => {\n const layoutGroupContext = useContext(LayoutGroupContext)\n const deprecatedLayoutGroupContext = useContext(\n DeprecatedLayoutGroupContext\n )\n const [forceRender, key] = useForceUpdate()\n const context = useRef(\n null\n ) as MutableRefObject\n\n const upstreamId = layoutGroupContext.id || deprecatedLayoutGroupContext\n if (context.current === null) {\n if (shouldInheritId(inherit) && upstreamId) {\n id = id ? upstreamId + \"-\" + id : upstreamId\n }\n\n context.current = {\n id,\n group: shouldInheritGroup(inherit)\n ? layoutGroupContext.group || nodeGroup()\n : nodeGroup(),\n }\n }\n\n const memoizedContext = useMemo(\n () => ({ ...context.current, forceRender }),\n [key]\n )\n\n return (\n \n {children}\n \n )\n}\n"],"names":[],"mappings":";;;;;;;;AAmBA;AACA;AAGO;AAGH;AACA;;AAIA;AAIA;AACA;AACI;AACI;;;;AAKA;AACI;;;;;AAUZ;AAKJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/components/LazyMotion/index.mjs b/node_modules/framer-motion/dist/es/components/LazyMotion/index.mjs new file mode 100644 index 0000000..2b051f1 --- /dev/null +++ b/node_modules/framer-motion/dist/es/components/LazyMotion/index.mjs @@ -0,0 +1,69 @@ +"use client"; +import { jsx } from 'react/jsx-runtime'; +import { useState, useRef, useEffect } from 'react'; +import { LazyContext } from '../../context/LazyContext.mjs'; +import { loadFeatures } from '../../motion/features/load-features.mjs'; + +/** + * Used in conjunction with the `m` component to reduce bundle size. + * + * `m` is a version of the `motion` component that only loads functionality + * critical for the initial render. + * + * `LazyMotion` can then be used to either synchronously or asynchronously + * load animation and gesture support. + * + * ```jsx + * // Synchronous loading + * import { LazyMotion, m, domAnimation } from "framer-motion" + * + * function App() { + * return ( + * + * + * + * ) + * } + * + * // Asynchronous loading + * import { LazyMotion, m } from "framer-motion" + * + * function App() { + * return ( + * import('./path/to/domAnimation')}> + * + * + * ) + * } + * ``` + * + * @public + */ +function LazyMotion({ children, features, strict = false }) { + const [, setIsLoaded] = useState(!isLazyBundle(features)); + const loadedRenderer = useRef(undefined); + /** + * If this is a synchronous load, load features immediately + */ + if (!isLazyBundle(features)) { + const { renderer, ...loadedFeatures } = features; + loadedRenderer.current = renderer; + loadFeatures(loadedFeatures); + } + useEffect(() => { + if (isLazyBundle(features)) { + features().then(({ renderer, ...loadedFeatures }) => { + loadFeatures(loadedFeatures); + loadedRenderer.current = renderer; + setIsLoaded(true); + }); + } + }, []); + return (jsx(LazyContext.Provider, { value: { renderer: loadedRenderer.current, strict }, children: children })); +} +function isLazyBundle(features) { + return typeof features === "function"; +} + +export { LazyMotion }; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/framer-motion/dist/es/components/LazyMotion/index.mjs.map b/node_modules/framer-motion/dist/es/components/LazyMotion/index.mjs.map new file mode 100644 index 0000000..d33ba6c --- /dev/null +++ b/node_modules/framer-motion/dist/es/components/LazyMotion/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../../../../src/components/LazyMotion/index.tsx"],"sourcesContent":["\"use client\"\n\nimport { useEffect, useRef, useState } from \"react\"\nimport { LazyContext } from \"../../context/LazyContext\"\nimport { loadFeatures } from \"../../motion/features/load-features\"\nimport { FeatureBundle, LazyFeatureBundle } from \"../../motion/features/types\"\nimport { CreateVisualElement } from \"../../render/types\"\nimport { LazyProps } from \"./types\"\n\n/**\n * Used in conjunction with the `m` component to reduce bundle size.\n *\n * `m` is a version of the `motion` component that only loads functionality\n * critical for the initial render.\n *\n * `LazyMotion` can then be used to either synchronously or asynchronously\n * load animation and gesture support.\n *\n * ```jsx\n * // Synchronous loading\n * import { LazyMotion, m, domAnimation } from \"framer-motion\"\n *\n * function App() {\n * return (\n * \n * \n * \n * )\n * }\n *\n * // Asynchronous loading\n * import { LazyMotion, m } from \"framer-motion\"\n *\n * function App() {\n * return (\n * import('./path/to/domAnimation')}>\n * \n * \n * )\n * }\n * ```\n *\n * @public\n */\nexport function LazyMotion({ children, features, strict = false }: LazyProps) {\n const [, setIsLoaded] = useState(!isLazyBundle(features))\n const loadedRenderer = useRef(undefined)\n\n /**\n * If this is a synchronous load, load features immediately\n */\n if (!isLazyBundle(features)) {\n const { renderer, ...loadedFeatures } = features\n loadedRenderer.current = renderer\n loadFeatures(loadedFeatures)\n }\n\n useEffect(() => {\n if (isLazyBundle(features)) {\n features().then(({ renderer, ...loadedFeatures }) => {\n loadFeatures(loadedFeatures)\n loadedRenderer.current = renderer\n setIsLoaded(true)\n })\n }\n }, [])\n\n return (\n \n {children}\n \n )\n}\n\nfunction isLazyBundle(\n features: FeatureBundle | LazyFeatureBundle\n): features is LazyFeatureBundle {\n return typeof features === \"function\"\n}\n"],"names":[],"mappings":";;;;;;AASA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCG;AACG;AACF;AACA;AAEA;;AAEG;AACH;;AAEI;;;;AAKA;AACI;;AAEI;;AAEJ;;;;AAWZ;AAEA;AAGI;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/components/MotionConfig/index.mjs b/node_modules/framer-motion/dist/es/components/MotionConfig/index.mjs new file mode 100644 index 0000000..f9700e2 --- /dev/null +++ b/node_modules/framer-motion/dist/es/components/MotionConfig/index.mjs @@ -0,0 +1,52 @@ +"use client"; +import { jsx } from 'react/jsx-runtime'; +import { useContext, useMemo } from 'react'; +import { resolveTransition } from 'motion-dom'; +import { MotionConfigContext } from '../../context/MotionConfigContext.mjs'; +import { useConstant } from '../../utils/use-constant.mjs'; + +/** + * `MotionConfig` is used to set configuration options for all children `motion` components. + * + * ```jsx + * import { motion, MotionConfig } from "framer-motion" + * + * export function App() { + * return ( + * + * + * + * ) + * } + * ``` + * + * @public + */ +function MotionConfig({ children, ...config }) { + /** + * Inherit props from any parent MotionConfig components + */ + const parentConfig = useContext(MotionConfigContext); + config = { ...parentConfig, ...config }; + config.transition = resolveTransition(config.transition, parentConfig.transition); + /** + * Don't allow isStatic to change between renders as it affects how many hooks + * motion components fire. + */ + config.isStatic = useConstant(() => config.isStatic); + /** + * Creating a new config context object will re-render every `motion` component + * every time it renders. So we only want to create a new one sparingly. + */ + const context = useMemo(() => config, [ + JSON.stringify(config.transition), + config.transformPagePoint, + config.reducedMotion, + config.skipAnimations, + config.isValidProp, + ]); + return (jsx(MotionConfigContext.Provider, { value: context, children: children })); +} + +export { MotionConfig }; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/framer-motion/dist/es/components/MotionConfig/index.mjs.map b/node_modules/framer-motion/dist/es/components/MotionConfig/index.mjs.map new file mode 100644 index 0000000..ee5860c --- /dev/null +++ b/node_modules/framer-motion/dist/es/components/MotionConfig/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../../../../src/components/MotionConfig/index.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport { useContext, useMemo } from \"react\"\nimport { resolveTransition } from \"motion-dom\"\nimport { MotionConfigContext } from \"../../context/MotionConfigContext\"\nimport { useConstant } from \"../../utils/use-constant\"\n\nexport interface MotionConfigProps extends Partial {\n children?: React.ReactNode\n}\n\n/**\n * `MotionConfig` is used to set configuration options for all children `motion` components.\n *\n * ```jsx\n * import { motion, MotionConfig } from \"framer-motion\"\n *\n * export function App() {\n * return (\n * \n * \n * \n * )\n * }\n * ```\n *\n * @public\n */\nexport function MotionConfig({ children, ...config }: MotionConfigProps) {\n /**\n * Inherit props from any parent MotionConfig components\n */\n const parentConfig = useContext(MotionConfigContext)\n config = { ...parentConfig, ...config }\n\n config.transition = resolveTransition(\n config.transition,\n parentConfig.transition\n )\n\n /**\n * Don't allow isStatic to change between renders as it affects how many hooks\n * motion components fire.\n */\n config.isStatic = useConstant(() => config.isStatic)\n\n /**\n * Creating a new config context object will re-render every `motion` component\n * every time it renders. So we only want to create a new one sparingly.\n */\n const context = useMemo(\n () => config,\n [\n JSON.stringify(config.transition),\n config.transformPagePoint,\n config.reducedMotion,\n config.skipAnimations,\n config.isValidProp,\n ]\n )\n\n return (\n \n {children}\n \n )\n}\n"],"names":[],"mappings":";;;;;;;AAYA;;;;;;;;;;;;;;;;AAgBG;AACG;AACF;;AAEG;AACH;;AAGA;AAKA;;;AAGG;AACH;AAEA;;;AAGG;;AAIK;AACA;AACA;AACA;AACA;AACH;AAGL;AAKJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/components/Reorder/Group.mjs b/node_modules/framer-motion/dist/es/components/Reorder/Group.mjs new file mode 100644 index 0000000..1acac79 --- /dev/null +++ b/node_modules/framer-motion/dist/es/components/Reorder/Group.mjs @@ -0,0 +1,88 @@ +"use client"; +import { jsx } from 'react/jsx-runtime'; +import { invariant } from 'motion-utils'; +import { forwardRef, useRef, useState, useEffect } from 'react'; +import { ReorderContext } from '../../context/ReorderContext.mjs'; +import { motion } from '../../render/components/motion/proxy.mjs'; +import { useConstant } from '../../utils/use-constant.mjs'; +import { checkReorder } from './utils/check-reorder.mjs'; +import { detectAxis } from './utils/detect-axis.mjs'; + +function ReorderGroupComponent({ children, as = "ul", axis: axisOverride, onReorder, values, ...props }, externalRef) { + const Component = useConstant(() => motion[as]); + const itemLayouts = useRef(new Map()); + const [detectedAxis, setDetectedAxis] = useState("y"); + const isReordering = useRef(false); + const groupRef = useRef(null); + const axis = axisOverride || detectedAxis; + invariant(Boolean(values), "Reorder.Group must be provided a values prop", "reorder-values"); + const valuesSet = new Set(values); + itemLayouts.current.forEach((_, value) => { + if (!valuesSet.has(value)) + itemLayouts.current.delete(value); + }); + const context = { + axis, + groupRef, + registerItem: (value, layout) => { + itemLayouts.current.set(value, layout); + if (!axisOverride) { + const nextAxis = detectAxis(values.flatMap((itemValue) => { + const itemLayout = itemLayouts.current.get(itemValue); + return itemLayout ? [itemLayout] : []; + })); + if (nextAxis !== detectedAxis) + setDetectedAxis(nextAxis); + } + }, + updateOrder: (item, offset, velocity) => { + if (isReordering.current) + return; + const order = values.flatMap((value) => { + const layout = itemLayouts.current.get(value); + return layout ? [{ value, layout }] : []; + }); + const direction = groupRef.current?.ownerDocument.defaultView?.getComputedStyle(groupRef.current).direction === "rtl" + ? "rtl" + : "ltr"; + const newOrder = checkReorder(order, item, offset, velocity, axis, direction); + if (order !== newOrder) { + isReordering.current = true; + const newValues = [...values]; + const measuredIndexes = order.map(({ value }) => values.indexOf(value)); + newOrder.forEach(({ value }, index) => { + newValues[measuredIndexes[index]] = value; + }); + onReorder(newValues); + } + }, + }; + useEffect(() => { + isReordering.current = false; + }); + // Combine refs if external ref is provided + const setRef = (element) => { + groupRef.current = element; + if (typeof externalRef === "function") { + externalRef(element); + } + else if (externalRef) { + externalRef.current = + element; + } + }; + /** + * Disable browser scroll anchoring on the group container. + * When items reorder, scroll anchoring can cause the browser to adjust + * the scroll position, which interferes with drag position calculations. + */ + const groupStyle = { + overflowAnchor: "none", + ...props.style, + }; + return (jsx(Component, { ...props, style: groupStyle, ref: setRef, ignoreStrict: true, children: jsx(ReorderContext.Provider, { value: context, children: children }) })); +} +const ReorderGroup = /*@__PURE__*/ forwardRef(ReorderGroupComponent); + +export { ReorderGroup, ReorderGroupComponent }; +//# sourceMappingURL=Group.mjs.map diff --git a/node_modules/framer-motion/dist/es/components/Reorder/Group.mjs.map b/node_modules/framer-motion/dist/es/components/Reorder/Group.mjs.map new file mode 100644 index 0000000..2b6ba21 --- /dev/null +++ b/node_modules/framer-motion/dist/es/components/Reorder/Group.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"Group.mjs","sources":["../../../../src/components/Reorder/Group.tsx"],"sourcesContent":["\"use client\"\n\nimport { invariant } from \"motion-utils\"\nimport * as React from \"react\"\nimport {\n forwardRef,\n FunctionComponent,\n JSX,\n useEffect,\n useRef,\n useState,\n} from \"react\"\nimport { ReorderContext } from \"../../context/ReorderContext\"\nimport { motion } from \"../../render/components/motion/proxy\"\nimport { HTMLMotionProps } from \"../../render/html/types\"\nimport { useConstant } from \"../../utils/use-constant\"\nimport {\n DefaultGroupElement,\n ItemData,\n ReorderAxis,\n ReorderContextProps,\n ReorderElementTag,\n} from \"./types\"\nimport { checkReorder } from \"./utils/check-reorder\"\nimport { detectAxis } from \"./utils/detect-axis\"\n\nexport interface Props<\n V,\n TagName extends ReorderElementTag = DefaultGroupElement\n> {\n /**\n * A HTML element to render this component as. Defaults to `\"ul\"`.\n *\n * @public\n */\n as?: TagName\n\n /**\n * The axis to reorder along. By default, this is detected from the item\n * layout. Use `\"xy\"` to explicitly enable wrapped layout reordering.\n *\n * @public\n */\n axis?: ReorderAxis\n\n /**\n * A callback to fire with the new value order. For instance, if the values\n * are provided as a state from `useState`, this could be the set state function.\n *\n * @public\n */\n onReorder: (newOrder: V[]) => void\n\n /**\n * The latest values state.\n *\n * ```jsx\n * function Component() {\n * const [items, setItems] = useState([0, 1, 2])\n *\n * return (\n * \n * {items.map((item) => )}\n * \n * )\n * }\n * ```\n *\n * @public\n */\n values: V[]\n}\n\ntype ReorderGroupProps<\n V,\n TagName extends ReorderElementTag = DefaultGroupElement\n> = Props &\n Omit, \"values\"> &\n React.PropsWithChildren<{}>\n\nexport function ReorderGroupComponent<\n V,\n TagName extends ReorderElementTag = DefaultGroupElement\n>(\n {\n children,\n as = \"ul\" as TagName,\n axis: axisOverride,\n onReorder,\n values,\n ...props\n }: ReorderGroupProps,\n externalRef?: React.ForwardedRef\n): JSX.Element {\n const Component = useConstant(\n () => motion[as as keyof typeof motion]\n ) as FunctionComponent<\n React.PropsWithChildren & { ref?: React.Ref }>\n >\n\n const itemLayouts = useRef(new Map[\"layout\"]>())\n const [detectedAxis, setDetectedAxis] = useState(\"y\")\n const isReordering = useRef(false)\n const groupRef = useRef(null)\n const axis = axisOverride || detectedAxis\n\n invariant(\n Boolean(values),\n \"Reorder.Group must be provided a values prop\",\n \"reorder-values\"\n )\n\n const valuesSet = new Set(values)\n itemLayouts.current.forEach((_, value) => {\n if (!valuesSet.has(value)) itemLayouts.current.delete(value)\n })\n\n const context: ReorderContextProps = {\n axis,\n groupRef,\n registerItem: (value, layout) => {\n itemLayouts.current.set(value, layout)\n\n if (!axisOverride) {\n const nextAxis = detectAxis(\n values.flatMap((itemValue) => {\n const itemLayout = itemLayouts.current.get(itemValue)\n return itemLayout ? [itemLayout] : []\n })\n )\n\n if (nextAxis !== detectedAxis) setDetectedAxis(nextAxis)\n }\n },\n updateOrder: (item, offset, velocity) => {\n if (isReordering.current) return\n\n const order = values.flatMap((value) => {\n const layout = itemLayouts.current.get(value)\n return layout ? [{ value, layout }] : []\n })\n const direction =\n groupRef.current?.ownerDocument.defaultView?.getComputedStyle(\n groupRef.current\n ).direction === \"rtl\"\n ? \"rtl\"\n : \"ltr\"\n const newOrder = checkReorder(\n order,\n item,\n offset,\n velocity,\n axis,\n direction\n )\n\n if (order !== newOrder) {\n isReordering.current = true\n\n const newValues = [...values]\n const measuredIndexes = order.map(({ value }) =>\n values.indexOf(value)\n )\n newOrder.forEach(({ value }, index) => {\n newValues[measuredIndexes[index]] = value\n })\n onReorder(newValues)\n }\n },\n }\n\n useEffect(() => {\n isReordering.current = false\n })\n\n // Combine refs if external ref is provided\n const setRef = (element: Element | null) => {\n ;(groupRef as React.MutableRefObject).current = element\n if (typeof externalRef === \"function\") {\n externalRef(element)\n } else if (externalRef) {\n ;(externalRef as React.MutableRefObject).current =\n element\n }\n }\n\n /**\n * Disable browser scroll anchoring on the group container.\n * When items reorder, scroll anchoring can cause the browser to adjust\n * the scroll position, which interferes with drag position calculations.\n */\n const groupStyle = {\n overflowAnchor: \"none\" as const,\n ...props.style,\n }\n\n return (\n \n \n {children}\n \n \n )\n}\n\nexport const ReorderGroup = /*@__PURE__*/ forwardRef(ReorderGroupComponent) as <\n Values extends any[],\n TagName extends ReorderElementTag = DefaultGroupElement\n>(\n props: Omit<\n ReorderGroupProps,\n \"values\" | \"onReorder\"\n > & {\n values: Values\n onReorder: (newOrder: Values) => void\n } & { ref?: React.ForwardedRef }\n) => ReturnType\n"],"names":[],"mappings":";;;;;;;;;;AAgFM;AAcF;;;AAQA;AACA;AACA;;AAQA;;AAEI;AAA2B;AAC/B;AAEA;;;AAGI;;;;;;;;;;;;;;;;AAmBQ;AACJ;AACA;AAIQ;;AAER;AASA;AACI;AAEA;;;;AAMA;;;;;;AAOR;AACJ;;AAGA;AACM;AACF;;;;AAGM;AACE;;AAEZ;AAEA;;;;AAIG;AACH;AACI;;;AAIJ;AAOJ;AAEO;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/components/Reorder/Item.mjs b/node_modules/framer-motion/dist/es/components/Reorder/Item.mjs new file mode 100644 index 0000000..32c6394 --- /dev/null +++ b/node_modules/framer-motion/dist/es/components/Reorder/Item.mjs @@ -0,0 +1,48 @@ +"use client"; +import { jsx } from 'react/jsx-runtime'; +import { isMotionValue } from 'motion-dom'; +import { invariant } from 'motion-utils'; +import { forwardRef, useContext } from 'react'; +import { ReorderContext } from '../../context/ReorderContext.mjs'; +import { motion } from '../../render/components/motion/proxy.mjs'; +import { useConstant } from '../../utils/use-constant.mjs'; +import { useMotionValue } from '../../value/use-motion-value.mjs'; +import { useTransform } from '../../value/use-transform.mjs'; +import { autoScrollIfNeeded, resetAutoScrollState } from './utils/auto-scroll.mjs'; + +function useDefaultMotionValue(value, defaultValue = 0) { + return isMotionValue(value) ? value : useMotionValue(defaultValue); +} +function ReorderItemComponent({ children, style = {}, value, as = "li", onDrag, onDragEnd, layout = true, ...props }, externalRef) { + const Component = useConstant(() => motion[as]); + const context = useContext(ReorderContext); + const point = { + x: useDefaultMotionValue(style.x), + y: useDefaultMotionValue(style.y), + }; + const zIndex = useTransform([point.x, point.y], ([latestX, latestY]) => latestX || latestY ? 1 : "unset"); + invariant(Boolean(context), "Reorder.Item must be a child of Reorder.Group", "reorder-item-child"); + const { axis, registerItem, updateOrder, groupRef } = context; + const dragAxis = axis === "xy" ? true : axis; + return (jsx(Component, { drag: dragAxis, ...props, dragSnapToOrigin: true, style: { ...style, x: point.x, y: point.y, zIndex }, layout: layout, onDrag: (event, gesturePoint) => { + const { velocity, point: pointerPoint } = gesturePoint; + const offset = { x: point.x.get(), y: point.y.get() }; + updateOrder(value, offset, velocity); + const scrollAxis = axis === "xy" + ? Math.abs(velocity.x) > Math.abs(velocity.y) + ? "x" + : "y" + : axis; + autoScrollIfNeeded(groupRef.current, pointerPoint[scrollAxis], scrollAxis, velocity[scrollAxis]); + onDrag && onDrag(event, gesturePoint); + }, onDragEnd: (event, gesturePoint) => { + resetAutoScrollState(); + onDragEnd && onDragEnd(event, gesturePoint); + }, onLayoutMeasure: (measured) => { + registerItem(value, measured); + }, ref: externalRef, ignoreStrict: true, children: children })); +} +const ReorderItem = /*@__PURE__*/ forwardRef(ReorderItemComponent); + +export { ReorderItem, ReorderItemComponent }; +//# sourceMappingURL=Item.mjs.map diff --git a/node_modules/framer-motion/dist/es/components/Reorder/Item.mjs.map b/node_modules/framer-motion/dist/es/components/Reorder/Item.mjs.map new file mode 100644 index 0000000..c3bfa51 --- /dev/null +++ b/node_modules/framer-motion/dist/es/components/Reorder/Item.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"Item.mjs","sources":["../../../../src/components/Reorder/Item.tsx"],"sourcesContent":["\"use client\"\n\nimport { isMotionValue } from \"motion-dom\"\nimport { invariant } from \"motion-utils\"\nimport * as React from \"react\"\nimport { forwardRef, FunctionComponent, useContext } from \"react\"\nimport { ReorderContext } from \"../../context/ReorderContext\"\nimport { motion } from \"../../render/components/motion/proxy\"\nimport { HTMLMotionProps } from \"../../render/html/types\"\nimport { useConstant } from \"../../utils/use-constant\"\nimport { useMotionValue } from \"../../value/use-motion-value\"\nimport { useTransform } from \"../../value/use-transform\"\n\nimport { DefaultItemElement, ReorderElementTag } from \"./types\"\nimport { autoScrollIfNeeded, resetAutoScrollState } from \"./utils/auto-scroll\"\n\nexport interface Props<\n V,\n TagName extends ReorderElementTag = DefaultItemElement\n> {\n /**\n * A HTML element to render this component as. Defaults to `\"li\"`.\n *\n * @public\n */\n as?: TagName\n\n /**\n * The value in the list that this component represents.\n *\n * @public\n */\n value: V\n\n /**\n * A subset of layout options primarily used to disable layout=\"size\"\n *\n * @public\n * @default true\n */\n layout?: true | \"position\"\n}\n\nfunction useDefaultMotionValue(value: any, defaultValue: number = 0) {\n return isMotionValue(value) ? value : useMotionValue(defaultValue)\n}\n\ntype ReorderItemProps<\n V,\n TagName extends ReorderElementTag = DefaultItemElement\n> = Props &\n Omit, \"value\" | \"layout\"> &\n React.PropsWithChildren<{}>\n\nexport function ReorderItemComponent<\n V,\n TagName extends ReorderElementTag = DefaultItemElement\n>(\n {\n children,\n style = {},\n value,\n as = \"li\" as TagName,\n onDrag,\n onDragEnd,\n layout = true,\n ...props\n }: ReorderItemProps,\n externalRef?: React.ForwardedRef\n): React.JSX.Element {\n const Component = useConstant(\n () => motion[as as keyof typeof motion]\n ) as FunctionComponent<\n React.PropsWithChildren & { ref?: React.Ref }>\n >\n\n const context = useContext(ReorderContext)\n const point = {\n x: useDefaultMotionValue(style.x),\n y: useDefaultMotionValue(style.y),\n }\n\n const zIndex = useTransform([point.x, point.y], ([latestX, latestY]) =>\n latestX || latestY ? 1 : \"unset\"\n )\n\n invariant(\n Boolean(context),\n \"Reorder.Item must be a child of Reorder.Group\",\n \"reorder-item-child\"\n )\n\n const { axis, registerItem, updateOrder, groupRef } = context!\n const dragAxis = axis === \"xy\" ? true : axis\n\n return (\n {\n const { velocity, point: pointerPoint } = gesturePoint\n const offset = { x: point.x.get(), y: point.y.get() }\n\n updateOrder(value, offset, velocity)\n\n const scrollAxis =\n axis === \"xy\"\n ? Math.abs(velocity.x) > Math.abs(velocity.y)\n ? \"x\"\n : \"y\"\n : axis\n autoScrollIfNeeded(\n groupRef.current,\n pointerPoint[scrollAxis],\n scrollAxis,\n velocity[scrollAxis]\n )\n\n onDrag && onDrag(event, gesturePoint)\n }}\n onDragEnd={(event, gesturePoint) => {\n resetAutoScrollState()\n onDragEnd && onDragEnd(event, gesturePoint)\n }}\n onLayoutMeasure={(measured) => {\n registerItem(value, measured)\n }}\n ref={externalRef}\n ignoreStrict\n >\n {children}\n \n )\n}\n\nexport const ReorderItem = /*@__PURE__*/ forwardRef(ReorderItemComponent) as <\n V,\n TagName extends ReorderElementTag = DefaultItemElement\n>(\n props: ReorderItemProps & { ref?: React.ForwardedRef }\n) => ReturnType\n"],"names":[],"mappings":";;;;;;;;;;;;AA2CA;AACI;AACJ;AASM;AAgBF;AAMA;AACA;AACI;AACA;;AAGJ;;;AAWA;;;;AAaY;AAEA;AAEQ;AACI;AACA;;AAEZ;AAOA;;AAGA;AACA;AACJ;AAEI;;AAQhB;AAEO;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/components/Reorder/namespace.mjs b/node_modules/framer-motion/dist/es/components/Reorder/namespace.mjs new file mode 100644 index 0000000..b8d507a --- /dev/null +++ b/node_modules/framer-motion/dist/es/components/Reorder/namespace.mjs @@ -0,0 +1,3 @@ +export { ReorderGroup as Group } from './Group.mjs'; +export { ReorderItem as Item } from './Item.mjs'; +//# sourceMappingURL=namespace.mjs.map diff --git a/node_modules/framer-motion/dist/es/components/Reorder/namespace.mjs.map b/node_modules/framer-motion/dist/es/components/Reorder/namespace.mjs.map new file mode 100644 index 0000000..80982f6 --- /dev/null +++ b/node_modules/framer-motion/dist/es/components/Reorder/namespace.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"namespace.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/components/Reorder/utils/auto-scroll.mjs b/node_modules/framer-motion/dist/es/components/Reorder/utils/auto-scroll.mjs new file mode 100644 index 0000000..a2e4a8f --- /dev/null +++ b/node_modules/framer-motion/dist/es/components/Reorder/utils/auto-scroll.mjs @@ -0,0 +1,124 @@ +const threshold = 50; +const maxSpeed = 25; +const overflowStyles = new Set(["auto", "scroll"]); +// Track initial scroll limits per scrollable element (Bug 1 fix) +const initialScrollLimits = new WeakMap(); +const activeScrollEdge = new WeakMap(); +// Track which group element is currently dragging to clear state on end +let currentGroupElement = null; +function resetAutoScrollState() { + if (currentGroupElement) { + const scrollableAncestor = findScrollableAncestor(currentGroupElement, "y"); + if (scrollableAncestor) { + activeScrollEdge.delete(scrollableAncestor); + initialScrollLimits.delete(scrollableAncestor); + } + // Also try x axis + const scrollableAncestorX = findScrollableAncestor(currentGroupElement, "x"); + if (scrollableAncestorX && scrollableAncestorX !== scrollableAncestor) { + activeScrollEdge.delete(scrollableAncestorX); + initialScrollLimits.delete(scrollableAncestorX); + } + currentGroupElement = null; + } +} +function isScrollableElement(element, axis) { + const style = getComputedStyle(element); + const overflow = axis === "x" ? style.overflowX : style.overflowY; + const isDocumentScroll = element === document.body || + element === document.documentElement; + return overflowStyles.has(overflow) || isDocumentScroll; +} +function findScrollableAncestor(element, axis) { + let current = element?.parentElement; + while (current) { + if (isScrollableElement(current, axis)) { + return current; + } + current = current.parentElement; + } + return null; +} +function getScrollAmount(pointerPosition, scrollElement, axis) { + const rect = scrollElement.getBoundingClientRect(); + const start = axis === "x" ? Math.max(0, rect.left) : Math.max(0, rect.top); + const end = axis === "x" ? Math.min(window.innerWidth, rect.right) : Math.min(window.innerHeight, rect.bottom); + const distanceFromStart = pointerPosition - start; + const distanceFromEnd = end - pointerPosition; + if (distanceFromStart < threshold) { + const intensity = 1 - distanceFromStart / threshold; + return { amount: -maxSpeed * intensity * intensity, edge: "start" }; + } + else if (distanceFromEnd < threshold) { + const intensity = 1 - distanceFromEnd / threshold; + return { amount: maxSpeed * intensity * intensity, edge: "end" }; + } + return { amount: 0, edge: null }; +} +function autoScrollIfNeeded(groupElement, pointerPosition, axis, velocity) { + if (!groupElement) + return; + // Track the group element for cleanup + currentGroupElement = groupElement; + const scrollableAncestor = findScrollableAncestor(groupElement, axis); + if (!scrollableAncestor) + return; + // Convert pointer position from page coordinates to viewport coordinates. + // The gesture system uses pageX/pageY but getBoundingClientRect() returns + // viewport-relative coordinates, so we need to account for page scroll. + const viewportPointerPosition = pointerPosition - (axis === "x" ? window.scrollX : window.scrollY); + const { amount: scrollAmount, edge } = getScrollAmount(viewportPointerPosition, scrollableAncestor, axis); + // If not in any threshold zone, clear all state + if (edge === null) { + activeScrollEdge.delete(scrollableAncestor); + initialScrollLimits.delete(scrollableAncestor); + return; + } + const currentActiveEdge = activeScrollEdge.get(scrollableAncestor); + const isDocumentScroll = scrollableAncestor === document.body || + scrollableAncestor === document.documentElement; + // If not currently scrolling this edge, check velocity to see if we should start + if (currentActiveEdge !== edge) { + // Only start scrolling if velocity is towards the edge + const shouldStart = (edge === "start" && velocity < 0) || + (edge === "end" && velocity > 0); + if (!shouldStart) + return; + // Activate this edge + activeScrollEdge.set(scrollableAncestor, edge); + // Record initial scroll limit (prevents infinite scroll) + const maxScroll = axis === "x" + ? scrollableAncestor.scrollWidth - (isDocumentScroll ? window.innerWidth : scrollableAncestor.clientWidth) + : scrollableAncestor.scrollHeight - (isDocumentScroll ? window.innerHeight : scrollableAncestor.clientHeight); + initialScrollLimits.set(scrollableAncestor, maxScroll); + } + // Cap scrolling at initial limit (prevents infinite scroll) + if (scrollAmount > 0) { + const initialLimit = initialScrollLimits.get(scrollableAncestor); + const currentScroll = axis === "x" + ? (isDocumentScroll ? window.scrollX : scrollableAncestor.scrollLeft) + : (isDocumentScroll ? window.scrollY : scrollableAncestor.scrollTop); + if (currentScroll >= initialLimit) + return; + } + // Apply scroll + if (axis === "x") { + if (isDocumentScroll) { + window.scrollBy({ left: scrollAmount }); + } + else { + scrollableAncestor.scrollLeft += scrollAmount; + } + } + else { + if (isDocumentScroll) { + window.scrollBy({ top: scrollAmount }); + } + else { + scrollableAncestor.scrollTop += scrollAmount; + } + } +} + +export { autoScrollIfNeeded, resetAutoScrollState }; +//# sourceMappingURL=auto-scroll.mjs.map diff --git a/node_modules/framer-motion/dist/es/components/Reorder/utils/auto-scroll.mjs.map b/node_modules/framer-motion/dist/es/components/Reorder/utils/auto-scroll.mjs.map new file mode 100644 index 0000000..13faf16 --- /dev/null +++ b/node_modules/framer-motion/dist/es/components/Reorder/utils/auto-scroll.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"auto-scroll.mjs","sources":["../../../../../src/components/Reorder/utils/auto-scroll.ts"],"sourcesContent":["const threshold = 50\nconst maxSpeed = 25\n\nconst overflowStyles = new Set([\"auto\", \"scroll\"])\n\n// Track initial scroll limits per scrollable element (Bug 1 fix)\nconst initialScrollLimits = new WeakMap()\n\n// Track auto-scroll active state per edge: \"start\" (top/left) or \"end\" (bottom/right)\ntype ActiveEdge = \"start\" | \"end\" | null\nconst activeScrollEdge = new WeakMap()\n\n// Track which group element is currently dragging to clear state on end\nlet currentGroupElement: Element | null = null\n\nexport function resetAutoScrollState(): void {\n if (currentGroupElement) {\n const scrollableAncestor = findScrollableAncestor(\n currentGroupElement,\n \"y\"\n )\n if (scrollableAncestor) {\n activeScrollEdge.delete(scrollableAncestor)\n initialScrollLimits.delete(scrollableAncestor)\n }\n // Also try x axis\n const scrollableAncestorX = findScrollableAncestor(\n currentGroupElement,\n \"x\"\n )\n if (scrollableAncestorX && scrollableAncestorX !== scrollableAncestor) {\n activeScrollEdge.delete(scrollableAncestorX)\n initialScrollLimits.delete(scrollableAncestorX)\n }\n currentGroupElement = null\n }\n}\n\nfunction isScrollableElement(element: Element, axis: \"x\" | \"y\"): boolean {\n const style = getComputedStyle(element)\n const overflow = axis === \"x\" ? style.overflowX : style.overflowY\n\n const isDocumentScroll =\n element === document.body ||\n element === document.documentElement\n\n return overflowStyles.has(overflow) || isDocumentScroll\n}\n\nfunction findScrollableAncestor(\n element: Element | null,\n axis: \"x\" | \"y\"\n): HTMLElement | null {\n let current = element?.parentElement\n while (current) {\n if (isScrollableElement(current, axis)) {\n return current\n }\n current = current.parentElement\n }\n return null\n}\n\nfunction getScrollAmount(\n pointerPosition: number,\n scrollElement: HTMLElement,\n axis: \"x\" | \"y\"\n): { amount: number; edge: ActiveEdge } {\n const rect = scrollElement.getBoundingClientRect()\n\n const start = axis === \"x\" ? Math.max(0, rect.left) : Math.max(0, rect.top)\n const end = axis === \"x\" ? Math.min(window.innerWidth, rect.right) : Math.min(window.innerHeight, rect.bottom)\n\n const distanceFromStart = pointerPosition - start\n const distanceFromEnd = end - pointerPosition\n\n if (distanceFromStart < threshold) {\n const intensity = 1 - distanceFromStart / threshold\n return { amount: -maxSpeed * intensity * intensity, edge: \"start\" }\n } else if (distanceFromEnd < threshold) {\n const intensity = 1 - distanceFromEnd / threshold\n return { amount: maxSpeed * intensity * intensity, edge: \"end\" }\n }\n\n return { amount: 0, edge: null }\n}\n\nexport function autoScrollIfNeeded(\n groupElement: Element | null,\n pointerPosition: number,\n axis: \"x\" | \"y\",\n velocity: number\n): void {\n if (!groupElement) return\n\n // Track the group element for cleanup\n currentGroupElement = groupElement\n\n const scrollableAncestor = findScrollableAncestor(groupElement, axis)\n if (!scrollableAncestor) return\n\n // Convert pointer position from page coordinates to viewport coordinates.\n // The gesture system uses pageX/pageY but getBoundingClientRect() returns\n // viewport-relative coordinates, so we need to account for page scroll.\n const viewportPointerPosition =\n pointerPosition - (axis === \"x\" ? window.scrollX : window.scrollY)\n\n const { amount: scrollAmount, edge } = getScrollAmount(\n viewportPointerPosition,\n scrollableAncestor,\n axis\n )\n\n // If not in any threshold zone, clear all state\n if (edge === null) {\n activeScrollEdge.delete(scrollableAncestor)\n initialScrollLimits.delete(scrollableAncestor)\n return\n }\n\n const currentActiveEdge = activeScrollEdge.get(scrollableAncestor)\n\n const isDocumentScroll =\n scrollableAncestor === document.body ||\n scrollableAncestor === document.documentElement\n\n // If not currently scrolling this edge, check velocity to see if we should start\n if (currentActiveEdge !== edge) {\n // Only start scrolling if velocity is towards the edge\n const shouldStart =\n (edge === \"start\" && velocity < 0) ||\n (edge === \"end\" && velocity > 0)\n if (!shouldStart) return\n\n // Activate this edge\n activeScrollEdge.set(scrollableAncestor, edge)\n\n // Record initial scroll limit (prevents infinite scroll)\n const maxScroll =\n axis === \"x\"\n ? scrollableAncestor.scrollWidth - (isDocumentScroll ? window.innerWidth : scrollableAncestor.clientWidth)\n : scrollableAncestor.scrollHeight - (isDocumentScroll ? window.innerHeight : scrollableAncestor.clientHeight)\n\n initialScrollLimits.set(scrollableAncestor, maxScroll)\n }\n\n // Cap scrolling at initial limit (prevents infinite scroll)\n if (scrollAmount > 0) {\n const initialLimit = initialScrollLimits.get(scrollableAncestor)!\n const currentScroll =\n axis === \"x\"\n ? (isDocumentScroll ? window.scrollX : scrollableAncestor.scrollLeft)\n : (isDocumentScroll ? window.scrollY : scrollableAncestor.scrollTop)\n if (currentScroll >= initialLimit) return\n }\n\n // Apply scroll\n if (axis === \"x\") {\n if (isDocumentScroll) {\n window.scrollBy({ left: scrollAmount })\n } else {\n scrollableAncestor.scrollLeft += scrollAmount\n }\n } else {\n if (isDocumentScroll) {\n window.scrollBy({ top: scrollAmount })\n } else {\n scrollableAncestor.scrollTop += scrollAmount\n }\n }\n}\n"],"names":[],"mappings":"AAAA,MAAM,SAAS,GAAG,EAAE;AACpB,MAAM,QAAQ,GAAG,EAAE;AAEnB,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;AAElD;AACA,MAAM,mBAAmB,GAAG,IAAI,OAAO,EAAuB;AAI9D,MAAM,gBAAgB,GAAG,IAAI,OAAO,EAA2B;AAE/D;AACA,IAAI,mBAAmB,GAAmB,IAAI;SAE9B,oBAAoB,GAAA;IAChC,IAAI,mBAAmB,EAAE;QACrB,MAAM,kBAAkB,GAAG,sBAAsB,CAC7C,mBAAmB,EACnB,GAAG,CACN;QACD,IAAI,kBAAkB,EAAE;AACpB,YAAA,gBAAgB,CAAC,MAAM,CAAC,kBAAkB,CAAC;AAC3C,YAAA,mBAAmB,CAAC,MAAM,CAAC,k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BAAkB,CAAC,UAAU;AACpE,eAAG,gBAAgB,GAAG,MAAM,CAAC,OAAO,GAAG,kBAAkB,CAAC,SAAS,CAAC;QAC5E,IAAI,aAAa,IAAI,YAAY;YAAE;IACvC;;AAGA,IAAA,IAAI,IAAI,KAAK,GAAG,EAAE;QACd,IAAI,gBAAgB,EAAE;YAClB,MAAM,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;QAC3C;aAAO;AACH,YAAA,kBAAkB,CAAC,UAAU,IAAI,YAAY;QACjD;IACJ;SAAO;QACH,IAAI,gBAAgB,EAAE;YAClB,MAAM,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE,YAAY,EAAE,CAAC;QAC1C;aAAO;AACH,YAAA,kBAAkB,CAAC,SAAS,IAAI,YAAY;QAChD;IACJ;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/components/Reorder/utils/check-reorder.mjs b/node_modules/framer-motion/dist/es/components/Reorder/utils/check-reorder.mjs new file mode 100644 index 0000000..0adfa33 --- /dev/null +++ b/node_modules/framer-motion/dist/es/components/Reorder/utils/check-reorder.mjs @@ -0,0 +1,95 @@ +import { mixNumber } from 'motion-dom'; +import { moveItem } from 'motion-utils'; + +function checkReorder(order, value, offset, velocity, axis, direction = "ltr") { + const index = order.findIndex((item) => item.value === value); + if (index === -1) + return order; + if (axis === "xy") { + const { layout } = order[index]; + const center = { + x: mixNumber(layout.x.min, layout.x.max, 0.5) + offset.x, + y: mixNumber(layout.y.min, layout.y.max, 0.5) + offset.y, + }; + const lines = getLines(order); + const sourceLine = lines.find((line) => line.items.includes(order[index])); + const targetLine = lines.reduce((closest, line) => distanceToLine(center.y, line) < distanceToLine(center.y, closest) + ? line + : closest); + if (targetLine !== sourceLine) { + return moveToLine(order, index, center.x, targetLine, direction); + } + const currentDistance = distanceToBox(center, layout); + let target = -1; + let targetDistance = currentDistance; + order.forEach((item, targetIndex) => { + if (targetIndex === index) + return; + const distance = distanceToBox(center, item.layout); + if (distance < targetDistance) { + target = targetIndex; + targetDistance = distance; + } + }); + return target === -1 + ? order + : moveItem(order, index, index + Math.sign(target - index)); + } + if (!velocity[axis]) + return order; + const nextOffset = velocity[axis] > 0 ? 1 : -1; + const nextItem = order[index + nextOffset]; + if (!nextItem) + return order; + const item = order[index]; + const itemLayout = item.layout[axis]; + const nextLayout = nextItem.layout[axis]; + const nextItemCenter = mixNumber(nextLayout.min, nextLayout.max, 0.5); + if ((nextOffset === 1 && itemLayout.max + offset[axis] > nextItemCenter) || + (nextOffset === -1 && itemLayout.min + offset[axis] < nextItemCenter)) { + return moveItem(order, index, index + nextOffset); + } + return order; +} +function getLines(order) { + const lines = []; + order.forEach((item) => { + const { min, max } = item.layout.y; + const line = lines[lines.length - 1]; + if (!line || min >= line.max || max <= line.min) { + lines.push({ items: [item], min, max }); + } + else { + line.items.push(item); + line.min = Math.min(line.min, min); + line.max = Math.max(line.max, max); + } + }); + return lines; +} +function distanceToLine(y, line) { + return y < line.min ? line.min - y : y > line.max ? y - line.max : 0; +} +function moveToLine(order, index, x, line, direction) { + const remaining = order.filter((_, itemIndex) => itemIndex !== index); + const before = line.items.find((item) => { + const center = mixNumber(item.layout.x.min, item.layout.x.max, 0.5); + return direction === "ltr" ? x < center : x > center; + }); + const targetIndex = before + ? remaining.indexOf(before) + : remaining.indexOf(line.items[line.items.length - 1]) + 1; + const nextOrder = [...remaining]; + nextOrder.splice(targetIndex, 0, order[index]); + return nextOrder.every((item, itemIndex) => item === order[itemIndex]) + ? order + : nextOrder; +} +function distanceToBox(point, box) { + const x = Math.max(box.x.min - point.x, 0, point.x - box.x.max); + const y = Math.max(box.y.min - point.y, 0, point.y - box.y.max); + return x * x + y * y; +} + +export { checkReorder }; +//# sourceMappingURL=check-reorder.mjs.map diff --git a/node_modules/framer-motion/dist/es/components/Reorder/utils/check-reorder.mjs.map b/node_modules/framer-motion/dist/es/components/Reorder/utils/check-reorder.mjs.map new file mode 100644 index 0000000..128270d --- /dev/null +++ b/node_modules/framer-motion/dist/es/components/Reorder/utils/check-reorder.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"check-reorder.mjs","sources":["../../../../../src/components/Reorder/utils/check-reorder.ts"],"sourcesContent":["import { mixNumber } from \"motion-dom\"\nimport { moveItem, Point } from \"motion-utils\"\nimport { ItemData, ReorderAxis } from \"../types\"\n\nexport function checkReorder(\n order: ItemData[],\n value: T,\n offset: Point,\n velocity: Point,\n axis: ReorderAxis,\n direction: \"ltr\" | \"rtl\" = \"ltr\"\n): ItemData[] {\n const index = order.findIndex((item) => item.value === value)\n\n if (index === -1) return order\n\n if (axis === \"xy\") {\n const { layout } = order[index]\n const center = {\n x: mixNumber(layout.x.min, layout.x.max, 0.5) + offset.x,\n y: mixNumber(layout.y.min, layout.y.max, 0.5) + offset.y,\n }\n const lines = getLines(order)\n const sourceLine = lines.find((line) =>\n line.items.includes(order[index])\n )!\n const targetLine = lines.reduce((closest, line) =>\n distanceToLine(center.y, line) < distanceToLine(center.y, closest)\n ? line\n : closest\n )\n\n if (targetLine !== sourceLine) {\n return moveToLine(order, index, center.x, targetLine, direction)\n }\n\n const currentDistance = distanceToBox(center, layout)\n let target = -1\n let targetDistance = currentDistance\n\n order.forEach((item, targetIndex) => {\n if (targetIndex === index) return\n const distance = distanceToBox(center, item.layout)\n if (distance < targetDistance) {\n target = targetIndex\n targetDistance = distance\n }\n })\n\n return target === -1\n ? order\n : moveItem(order, index, index + Math.sign(target - index))\n }\n\n if (!velocity[axis]) return order\n\n const nextOffset = velocity[axis] > 0 ? 1 : -1\n const nextItem = order[index + nextOffset]\n\n if (!nextItem) return order\n\n const item = order[index]\n const itemLayout = item.layout[axis]\n const nextLayout = nextItem.layout[axis]\n const nextItemCenter = mixNumber(nextLayout.min, nextLayout.max, 0.5)\n\n if (\n (nextOffset === 1 && itemLayout.max + offset[axis] > nextItemCenter) ||\n (nextOffset === -1 && itemLayout.min + offset[axis] < nextItemCenter)\n ) {\n return moveItem(order, index, index + nextOffset)\n }\n\n return order\n}\n\ninterface Line {\n items: ItemData[]\n min: number\n max: number\n}\n\nfunction getLines(order: ItemData[]) {\n const lines: Line[] = []\n\n order.forEach((item) => {\n const { min, max } = item.layout.y\n const line = lines[lines.length - 1]\n\n if (!line || min >= line.max || max <= line.min) {\n lines.push({ items: [item], min, max })\n } else {\n line.items.push(item)\n line.min = Math.min(line.min, min)\n line.max = Math.max(line.max, max)\n }\n })\n\n return lines\n}\n\nfunction distanceToLine(y: number, line: Line) {\n return y < line.min ? line.min - y : y > line.max ? y - line.max : 0\n}\n\nfunction moveToLine(\n order: ItemData[],\n index: number,\n x: number,\n line: Line,\n direction: \"ltr\" | \"rtl\"\n) {\n const remaining = order.filter((_, itemIndex) => itemIndex !== index)\n const before = line.items.find((item) => {\n const center = mixNumber(item.layout.x.min, item.layout.x.max, 0.5)\n return direction === \"ltr\" ? x < center : x > center\n })\n const targetIndex = before\n ? remaining.indexOf(before)\n : remaining.indexOf(line.items[line.items.length - 1]) + 1\n const nextOrder = [...remaining]\n nextOrder.splice(targetIndex, 0, order[index])\n\n return nextOrder.every((item, itemIndex) => item === order[itemIndex])\n ? order\n : nextOrder\n}\n\nfunction distanceToBox(point: Point, box: ItemData[\"layout\"]) {\n const x = Math.max(box.x.min - point.x, 0, point.x - box.x.max)\n const y = Math.max(box.y.min - point.y, 0, point.y - box.y.max)\n return x * x + y * y\n}\n"],"names":[],"mappings":";;;AAIM,SAAU,YAAY,CACxB,KAAoB,EACpB,KAAQ,EACR,MAAa,EACb,QAAe,EACf,IAAiB,EACjB,YAA2B,KAAK,EAAA;AAEhC,IAAA,MAAM,KAAK,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,KAAK,KAAK,KAAK,CAAC;IAE7D,IAAI,KAAK,KAAK,EAAE;AAAE,QAAA,OAAO,KAAK;AAE9B,IAAA,IAAI,IAAI,KAAK,IAAI,EAAE;QACf,MAAM,EAAE,MAAM,EAAE,GAAG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/es/components/Reorder/utils/detect-axis.mjs b/node_modules/framer-motion/dist/es/components/Reorder/utils/detect-axis.mjs new file mode 100644 index 0000000..55d6b3d --- /dev/null +++ b/node_modules/framer-motion/dist/es/components/Reorder/utils/detect-axis.mjs @@ -0,0 +1,17 @@ +const isSeparated = (a, b) => a.max <= b.min || b.max <= a.min; +function detectAxis(layouts) { + let x = false; + let y = false; + for (let i = 0; i < layouts.length; i++) { + for (let j = i + 1; j < layouts.length; j++) { + x || (x = isSeparated(layouts[i].x, layouts[j].x)); + y || (y = isSeparated(layouts[i].y, layouts[j].y)); + if (x && y) + return "xy"; + } + } + return x ? "x" : "y"; +} + +export { detectAxis }; +//# sourceMappingURL=detect-axis.mjs.map diff --git a/node_modules/framer-motion/dist/es/components/Reorder/utils/detect-axis.mjs.map b/node_modules/framer-motion/dist/es/components/Reorder/utils/detect-axis.mjs.map new file mode 100644 index 0000000..fcd959a --- /dev/null +++ b/node_modules/framer-motion/dist/es/components/Reorder/utils/detect-axis.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"detect-axis.mjs","sources":["../../../../../src/components/Reorder/utils/detect-axis.ts"],"sourcesContent":["import { Axis, Box } from \"motion-utils\"\nimport { ReorderAxis } from \"../types\"\n\nconst isSeparated = (a: Axis, b: Axis) => a.max <= b.min || b.max <= a.min\n\nexport function detectAxis(layouts: Box[]): ReorderAxis {\n let x = false\n let y = false\n\n for (let i = 0; i < layouts.length; i++) {\n for (let j = i + 1; j < layouts.length; j++) {\n x ||= isSeparated(layouts[i].x, layouts[j].x)\n y ||= isSeparated(layouts[i].y, layouts[j].y)\n\n if (x && y) return \"xy\"\n }\n }\n\n return x ? \"x\" : \"y\"\n}\n"],"names":[],"mappings":"AAGA,MAAM,WAAW,GAAG,CAAC,CAAO,EAAE,CAAO,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG;AAEpE,SAAU,UAAU,CAAC,OAAc,EAAA;IACrC,IAAI,CAAC,GAAG,KAAK;IACb,IAAI,CAAC,GAAG,KAAK;AAEb,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AACrC,QAAA,KAAK,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AACzC,YAAA,CAAC,KAAD,CAAC,GAAK,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AAC7C,YAAA,CAAC,KAAD,CAAC,GAAK,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;YAE7C,IAAI,CAAC,IAAI,CAAC;AAAE,gBAAA,OAAO,IAAI;QAC3B;IACJ;IAEA,OAAO,CAAC,GAAG,GAAG,GAAG,GAAG;AACxB;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/context/DeprecatedLayoutGroupContext.mjs b/node_modules/framer-motion/dist/es/context/DeprecatedLayoutGroupContext.mjs new file mode 100644 index 0000000..999cda1 --- /dev/null +++ b/node_modules/framer-motion/dist/es/context/DeprecatedLayoutGroupContext.mjs @@ -0,0 +1,12 @@ +"use client"; +import { createContext } from 'react'; + +/** + * Note: Still used by components generated by old versions of Framer + * + * @deprecated + */ +const DeprecatedLayoutGroupContext = createContext(null); + +export { DeprecatedLayoutGroupContext }; +//# sourceMappingURL=DeprecatedLayoutGroupContext.mjs.map diff --git a/node_modules/framer-motion/dist/es/context/DeprecatedLayoutGroupContext.mjs.map b/node_modules/framer-motion/dist/es/context/DeprecatedLayoutGroupContext.mjs.map new file mode 100644 index 0000000..5a18fc9 --- /dev/null +++ b/node_modules/framer-motion/dist/es/context/DeprecatedLayoutGroupContext.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"DeprecatedLayoutGroupContext.mjs","sources":["../../../src/context/DeprecatedLayoutGroupContext.ts"],"sourcesContent":["\"use client\"\n\nimport { createContext } from \"react\"\n\n/**\n * Note: Still used by components generated by old versions of Framer\n *\n * @deprecated\n */\nexport const DeprecatedLayoutGroupContext = createContext(null)\n"],"names":[],"mappings":";;;AAIA;;;;AAIG;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/context/LayoutGroupContext.mjs b/node_modules/framer-motion/dist/es/context/LayoutGroupContext.mjs new file mode 100644 index 0000000..cd82e0b --- /dev/null +++ b/node_modules/framer-motion/dist/es/context/LayoutGroupContext.mjs @@ -0,0 +1,7 @@ +"use client"; +import { createContext } from 'react'; + +const LayoutGroupContext = createContext({}); + +export { LayoutGroupContext }; +//# sourceMappingURL=LayoutGroupContext.mjs.map diff --git a/node_modules/framer-motion/dist/es/context/LayoutGroupContext.mjs.map b/node_modules/framer-motion/dist/es/context/LayoutGroupContext.mjs.map new file mode 100644 index 0000000..bda87d9 --- /dev/null +++ b/node_modules/framer-motion/dist/es/context/LayoutGroupContext.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"LayoutGroupContext.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/context/LazyContext.mjs b/node_modules/framer-motion/dist/es/context/LazyContext.mjs new file mode 100644 index 0000000..0126060 --- /dev/null +++ b/node_modules/framer-motion/dist/es/context/LazyContext.mjs @@ -0,0 +1,7 @@ +"use client"; +import { createContext } from 'react'; + +const LazyContext = createContext({ strict: false }); + +export { LazyContext }; +//# sourceMappingURL=LazyContext.mjs.map diff --git a/node_modules/framer-motion/dist/es/context/LazyContext.mjs.map b/node_modules/framer-motion/dist/es/context/LazyContext.mjs.map new file mode 100644 index 0000000..57951a8 --- /dev/null +++ b/node_modules/framer-motion/dist/es/context/LazyContext.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"LazyContext.mjs","sources":["../../../src/context/LazyContext.ts"],"sourcesContent":["\"use client\"\n\nimport { createContext } from \"react\"\nimport { CreateVisualElement } from \"../render/types\"\n\nexport interface LazyContextProps {\n renderer?: CreateVisualElement\n strict: boolean\n}\n\nexport const LazyContext = createContext({ strict: false })\n"],"names":[],"mappings":";;;AAUO;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/context/MotionConfigContext.mjs b/node_modules/framer-motion/dist/es/context/MotionConfigContext.mjs new file mode 100644 index 0000000..9847a73 --- /dev/null +++ b/node_modules/framer-motion/dist/es/context/MotionConfigContext.mjs @@ -0,0 +1,14 @@ +"use client"; +import { createContext } from 'react'; + +/** + * @public + */ +const MotionConfigContext = createContext({ + transformPagePoint: (p) => p, + isStatic: false, + reducedMotion: "never", +}); + +export { MotionConfigContext }; +//# sourceMappingURL=MotionConfigContext.mjs.map diff --git a/node_modules/framer-motion/dist/es/context/MotionConfigContext.mjs.map b/node_modules/framer-motion/dist/es/context/MotionConfigContext.mjs.map new file mode 100644 index 0000000..c269bfe --- /dev/null +++ b/node_modules/framer-motion/dist/es/context/MotionConfigContext.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"MotionConfigContext.mjs","sources":["../../../src/context/MotionConfigContext.tsx"],"sourcesContent":["\"use client\"\n\nimport type { Transition } from \"motion-dom\"\nimport { TransformPoint } from \"motion-utils\"\nimport { createContext } from \"react\"\n\nexport type ReducedMotionConfig = \"always\" | \"never\" | \"user\"\nexport type IsValidProp = (key: string) => boolean\n\n/**\n * @public\n */\nexport interface MotionConfigContext {\n /**\n * Internal, exported only for usage in Framer\n */\n transformPagePoint: TransformPoint\n\n /**\n * Internal. Determines whether this is a static context ie the Framer canvas. If so,\n * it'll disable all dynamic functionality.\n */\n isStatic: boolean\n\n /**\n * Defines a new default transition for the entire tree.\n *\n * @public\n */\n transition?: Transition\n\n /**\n * If true, will respect the device prefersReducedMotion setting by switching\n * transform animations off.\n *\n * @public\n */\n reducedMotion?: ReducedMotionConfig\n\n /**\n * A custom `nonce` attribute used when wanting to enforce a Content Security Policy (CSP).\n * For more details see:\n * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/style-src#unsafe_inline_styles\n *\n * @public\n */\n nonce?: string\n\n /**\n * If true, all animations will be skipped and values will be set instantly.\n * Useful for E2E tests and visual regression testing.\n *\n * @public\n */\n skipAnimations?: boolean\n\n /**\n * Determines whether a prop should be forwarded to the DOM.\n * Useful when wrapping Motion components with a styling library.\n *\n * @public\n */\n isValidProp?: IsValidProp\n}\n\n/**\n * @public\n */\nexport const MotionConfigContext = createContext({\n transformPagePoint: (p) => p,\n isStatic: false,\n reducedMotion: \"never\",\n})\n"],"names":[],"mappings":";;;AAiEA;;AAEG;AACI;AACH;AACA;AACA;AACH;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/context/MotionContext/create.mjs b/node_modules/framer-motion/dist/es/context/MotionContext/create.mjs new file mode 100644 index 0000000..90806ea --- /dev/null +++ b/node_modules/framer-motion/dist/es/context/MotionContext/create.mjs @@ -0,0 +1,15 @@ +"use client"; +import { useContext, useMemo } from 'react'; +import { MotionContext } from './index.mjs'; +import { getCurrentTreeVariants } from './utils.mjs'; + +function useCreateMotionContext(props) { + const { initial, animate } = getCurrentTreeVariants(props, useContext(MotionContext)); + return useMemo(() => ({ initial, animate }), [variantLabelsAsDependency(initial), variantLabelsAsDependency(animate)]); +} +function variantLabelsAsDependency(prop) { + return Array.isArray(prop) ? prop.join(" ") : prop; +} + +export { useCreateMotionContext }; +//# sourceMappingURL=create.mjs.map diff --git a/node_modules/framer-motion/dist/es/context/MotionContext/create.mjs.map b/node_modules/framer-motion/dist/es/context/MotionContext/create.mjs.map new file mode 100644 index 0000000..a172977 --- /dev/null +++ b/node_modules/framer-motion/dist/es/context/MotionContext/create.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"create.mjs","sources":["../../../../src/context/MotionContext/create.ts"],"sourcesContent":["\"use client\"\n\nimport { useContext, useMemo } from \"react\"\nimport { MotionContext, type MotionContextProps } from \".\"\nimport { MotionProps } from \"../../motion/types\"\nimport { getCurrentTreeVariants } from \"./utils\"\n\nexport function useCreateMotionContext(\n props: MotionProps\n): MotionContextProps {\n const { initial, animate } = getCurrentTreeVariants(\n props,\n useContext(MotionContext)\n )\n\n return useMemo(\n () => ({ initial, animate }),\n [variantLabelsAsDependency(initial), variantLabelsAsDependency(animate)]\n )\n}\n\nfunction variantLabelsAsDependency(\n prop: undefined | string | string[] | boolean\n) {\n return Array.isArray(prop) ? prop.join(\" \") : prop\n}\n"],"names":[],"mappings":";;;;;AAOM;AAGF;;AASJ;AAEA;AAGI;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/context/MotionContext/index.mjs b/node_modules/framer-motion/dist/es/context/MotionContext/index.mjs new file mode 100644 index 0000000..deb883c --- /dev/null +++ b/node_modules/framer-motion/dist/es/context/MotionContext/index.mjs @@ -0,0 +1,7 @@ +"use client"; +import { createContext } from 'react'; + +const MotionContext = /* @__PURE__ */ createContext({}); + +export { MotionContext }; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/framer-motion/dist/es/context/MotionContext/index.mjs.map b/node_modules/framer-motion/dist/es/context/MotionContext/index.mjs.map new file mode 100644 index 0000000..d1f6cb4 --- /dev/null +++ b/node_modules/framer-motion/dist/es/context/MotionContext/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../../../../src/context/MotionContext/index.ts"],"sourcesContent":["\"use client\"\n\nimport type { VisualElement } from \"motion-dom\"\nimport { createContext } from \"react\"\n\nexport interface MotionContextProps {\n visualElement?: VisualElement\n initial?: false | string | string[]\n animate?: string | string[]\n}\n\nexport const MotionContext = /* @__PURE__ */ createContext(\n {}\n)\n"],"names":[],"mappings":";;;AAWO;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/context/MotionContext/utils.mjs b/node_modules/framer-motion/dist/es/context/MotionContext/utils.mjs new file mode 100644 index 0000000..5281e89 --- /dev/null +++ b/node_modules/framer-motion/dist/es/context/MotionContext/utils.mjs @@ -0,0 +1,17 @@ +import { isControllingVariants, isVariantLabel } from 'motion-dom'; + +function getCurrentTreeVariants(props, context) { + if (isControllingVariants(props)) { + const { initial, animate } = props; + return { + initial: initial === false || isVariantLabel(initial) + ? initial + : undefined, + animate: isVariantLabel(animate) ? animate : undefined, + }; + } + return props.inherit !== false ? context : {}; +} + +export { getCurrentTreeVariants }; +//# sourceMappingURL=utils.mjs.map diff --git a/node_modules/framer-motion/dist/es/context/MotionContext/utils.mjs.map b/node_modules/framer-motion/dist/es/context/MotionContext/utils.mjs.map new file mode 100644 index 0000000..5592073 --- /dev/null +++ b/node_modules/framer-motion/dist/es/context/MotionContext/utils.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"utils.mjs","sources":["../../../../src/context/MotionContext/utils.ts"],"sourcesContent":["import { isControllingVariants, isVariantLabel } from \"motion-dom\"\nimport type { MotionContextProps } from \".\"\nimport { MotionProps } from \"../../motion/types\"\n\nexport function getCurrentTreeVariants(\n props: MotionProps,\n context: MotionContextProps\n): MotionContextProps {\n if (isControllingVariants(props)) {\n const { initial, animate } = props\n return {\n initial:\n initial === false || isVariantLabel(initial)\n ? (initial as any)\n : undefined,\n animate: isVariantLabel(animate) ? animate : undefined,\n }\n }\n return props.inherit !== false ? context : {}\n}\n"],"names":[],"mappings":";;AAIM,SAAU,sBAAsB,CAClC,KAAkB,EAClB,OAA2B,EAAA;AAE3B,IAAA,IAAI,qBAAqB,CAAC,KAAK,CAAC,EAAE;AAC9B,QAAA,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,KAAK;QAClC,OAAO;YACH,OAAO,EACH,OAAO,KAAK,KAAK,IAAI,cAAc,CAAC,OAAO;AACvC,kBAAG;AACH,kBAAE,SAAS;AACnB,YAAA,OAAO,EAAE,cAAc,CAAC,OAAO,CAAC,GAAG,OAAO,GAAG,SAAS;SACzD;IACL;AACA,IAAA,OAAO,KAAK,CAAC,OAAO,KAAK,KAAK,GAAG,OAAO,GAAG,EAAE;AACjD;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/context/PresenceContext.mjs b/node_modules/framer-motion/dist/es/context/PresenceContext.mjs new file mode 100644 index 0000000..2ad3463 --- /dev/null +++ b/node_modules/framer-motion/dist/es/context/PresenceContext.mjs @@ -0,0 +1,11 @@ +"use client"; +import { createContext } from 'react'; + +/** + * @public + */ +const PresenceContext = +/* @__PURE__ */ createContext(null); + +export { PresenceContext }; +//# sourceMappingURL=PresenceContext.mjs.map diff --git a/node_modules/framer-motion/dist/es/context/PresenceContext.mjs.map b/node_modules/framer-motion/dist/es/context/PresenceContext.mjs.map new file mode 100644 index 0000000..de11202 --- /dev/null +++ b/node_modules/framer-motion/dist/es/context/PresenceContext.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"PresenceContext.mjs","sources":["../../../src/context/PresenceContext.ts"],"sourcesContent":["\"use client\"\n\nimport { createContext } from \"react\"\nimport type { PresenceContextProps } from \"motion-dom\"\n\nexport type { PresenceContextProps }\n\n/**\n * @public\n */\nexport const PresenceContext =\n /* @__PURE__ */ createContext(null)\n"],"names":[],"mappings":";;;AAOA;;AAEG;;AAEC;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/context/ReorderContext.mjs b/node_modules/framer-motion/dist/es/context/ReorderContext.mjs new file mode 100644 index 0000000..17cefb9 --- /dev/null +++ b/node_modules/framer-motion/dist/es/context/ReorderContext.mjs @@ -0,0 +1,7 @@ +"use client"; +import { createContext } from 'react'; + +const ReorderContext = createContext(null); + +export { ReorderContext }; +//# sourceMappingURL=ReorderContext.mjs.map diff --git a/node_modules/framer-motion/dist/es/context/ReorderContext.mjs.map b/node_modules/framer-motion/dist/es/context/ReorderContext.mjs.map new file mode 100644 index 0000000..a68068f --- /dev/null +++ b/node_modules/framer-motion/dist/es/context/ReorderContext.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"ReorderContext.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/context/SwitchLayoutGroupContext.mjs b/node_modules/framer-motion/dist/es/context/SwitchLayoutGroupContext.mjs new file mode 100644 index 0000000..08aaa76 --- /dev/null +++ b/node_modules/framer-motion/dist/es/context/SwitchLayoutGroupContext.mjs @@ -0,0 +1,10 @@ +"use client"; +import { createContext } from 'react'; + +/** + * Internal, exported only for usage in Framer + */ +const SwitchLayoutGroupContext = createContext({}); + +export { SwitchLayoutGroupContext }; +//# sourceMappingURL=SwitchLayoutGroupContext.mjs.map diff --git a/node_modules/framer-motion/dist/es/context/SwitchLayoutGroupContext.mjs.map b/node_modules/framer-motion/dist/es/context/SwitchLayoutGroupContext.mjs.map new file mode 100644 index 0000000..e25c485 --- /dev/null +++ b/node_modules/framer-motion/dist/es/context/SwitchLayoutGroupContext.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"SwitchLayoutGroupContext.mjs","sources":["../../../src/context/SwitchLayoutGroupContext.ts"],"sourcesContent":["\"use client\"\n\nimport type { Transition, IProjectionNode } from \"motion-dom\"\nimport { createContext } from \"react\"\n\nexport interface SwitchLayoutGroup {\n register?: (member: IProjectionNode) => void\n deregister?: (member: IProjectionNode) => void\n}\n\nexport type SwitchLayoutGroupContext = SwitchLayoutGroup &\n InitialPromotionConfig\n\nexport type InitialPromotionConfig = {\n /**\n * The initial transition to use when the elements in this group mount (and automatically promoted).\n * Subsequent updates should provide a transition in the promote method.\n */\n transition?: Transition\n /**\n * If the follow tree should preserve its opacity when the lead is promoted on mount\n */\n shouldPreserveFollowOpacity?: (member: IProjectionNode) => boolean\n}\n\n/**\n * Internal, exported only for usage in Framer\n */\nexport const SwitchLayoutGroupContext = createContext(\n {}\n)\n"],"names":[],"mappings":";;;AAyBA;;AAEG;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/debug.mjs b/node_modules/framer-motion/dist/es/debug.mjs new file mode 100644 index 0000000..170c251 --- /dev/null +++ b/node_modules/framer-motion/dist/es/debug.mjs @@ -0,0 +1,2 @@ +export { recordStats } from 'motion-dom'; +//# sourceMappingURL=debug.mjs.map diff --git a/node_modules/framer-motion/dist/es/debug.mjs.map b/node_modules/framer-motion/dist/es/debug.mjs.map new file mode 100644 index 0000000..b79ebba --- /dev/null +++ b/node_modules/framer-motion/dist/es/debug.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"debug.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/dom-mini.mjs b/node_modules/framer-motion/dist/es/dom-mini.mjs new file mode 100644 index 0000000..d8705e7 --- /dev/null +++ b/node_modules/framer-motion/dist/es/dom-mini.mjs @@ -0,0 +1,3 @@ +export { animateSequence } from './animation/animators/waapi/animate-sequence.mjs'; +export { animateMini as animate } from './animation/animators/waapi/animate-style.mjs'; +//# sourceMappingURL=dom-mini.mjs.map diff --git a/node_modules/framer-motion/dist/es/dom-mini.mjs.map b/node_modules/framer-motion/dist/es/dom-mini.mjs.map new file mode 100644 index 0000000..4979ad8 --- /dev/null +++ b/node_modules/framer-motion/dist/es/dom-mini.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"dom-mini.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/dom.mjs b/node_modules/framer-motion/dist/es/dom.mjs new file mode 100644 index 0000000..5df9220 --- /dev/null +++ b/node_modules/framer-motion/dist/es/dom.mjs @@ -0,0 +1,10 @@ +export * from 'motion-dom'; +export { delayInSeconds as delay } from 'motion-dom'; +export * from 'motion-utils'; +export { animate, createScopedAnimate } from './animation/animate/index.mjs'; +export { animateMini } from './animation/animators/waapi/animate-style.mjs'; +export { scroll } from './render/dom/scroll/index.mjs'; +export { scrollInfo } from './render/dom/scroll/track.mjs'; +export { inView } from './render/dom/viewport/index.mjs'; +export { distance, distance2D } from './utils/distance.mjs'; +//# sourceMappingURL=dom.mjs.map diff --git a/node_modules/framer-motion/dist/es/dom.mjs.map b/node_modules/framer-motion/dist/es/dom.mjs.map new file mode 100644 index 0000000..f9925fb --- /dev/null +++ b/node_modules/framer-motion/dist/es/dom.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"dom.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/events/add-pointer-event.mjs b/node_modules/framer-motion/dist/es/events/add-pointer-event.mjs new file mode 100644 index 0000000..e204664 --- /dev/null +++ b/node_modules/framer-motion/dist/es/events/add-pointer-event.mjs @@ -0,0 +1,9 @@ +import { addDomEvent } from 'motion-dom'; +import { addPointerInfo } from './event-info.mjs'; + +function addPointerEvent(target, eventName, handler, options) { + return addDomEvent(target, eventName, addPointerInfo(handler), options); +} + +export { addPointerEvent }; +//# sourceMappingURL=add-pointer-event.mjs.map diff --git a/node_modules/framer-motion/dist/es/events/add-pointer-event.mjs.map b/node_modules/framer-motion/dist/es/events/add-pointer-event.mjs.map new file mode 100644 index 0000000..db1b1b2 --- /dev/null +++ b/node_modules/framer-motion/dist/es/events/add-pointer-event.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"add-pointer-event.mjs","sources":["../../../src/events/add-pointer-event.ts"],"sourcesContent":["import { addDomEvent } from \"motion-dom\"\nimport { addPointerInfo, EventListenerWithPointInfo } from \"./event-info\"\n\nexport function addPointerEvent(\n target: EventTarget,\n eventName: string,\n handler: EventListenerWithPointInfo,\n options?: AddEventListenerOptions\n) {\n return addDomEvent(target, eventName, addPointerInfo(handler), options)\n}\n"],"names":[],"mappings":";;;AAGM,SAAU,eAAe,CAC3B,MAAmB,EACnB,SAAiB,EACjB,OAAmC,EACnC,OAAiC,EAAA;AAEjC,IAAA,OAAO,WAAW,CAAC,MAAM,EAAE,SAAS,EAAE,cAAc,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;AAC3E;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/events/event-info.mjs b/node_modules/framer-motion/dist/es/events/event-info.mjs new file mode 100644 index 0000000..0021717 --- /dev/null +++ b/node_modules/framer-motion/dist/es/events/event-info.mjs @@ -0,0 +1,14 @@ +import { isPrimaryPointer } from 'motion-dom'; + +function extractEventInfo(event) { + return { + point: { + x: event.pageX, + y: event.pageY, + }, + }; +} +const addPointerInfo = (handler) => (event) => isPrimaryPointer(event) && handler(event, extractEventInfo(event)); + +export { addPointerInfo, extractEventInfo }; +//# sourceMappingURL=event-info.mjs.map diff --git a/node_modules/framer-motion/dist/es/events/event-info.mjs.map b/node_modules/framer-motion/dist/es/events/event-info.mjs.map new file mode 100644 index 0000000..c2b8927 --- /dev/null +++ b/node_modules/framer-motion/dist/es/events/event-info.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"event-info.mjs","sources":["../../../src/events/event-info.ts"],"sourcesContent":["import { EventInfo, isPrimaryPointer } from \"motion-dom\"\n\nexport type EventListenerWithPointInfo = (\n e: PointerEvent,\n info: EventInfo\n) => void\n\nexport function extractEventInfo(event: PointerEvent): EventInfo {\n return {\n point: {\n x: event.pageX,\n y: event.pageY,\n },\n }\n}\n\nexport const addPointerInfo =\n (handler: EventListenerWithPointInfo): EventListener =>\n (event: PointerEvent) =>\n isPrimaryPointer(event) && handler(event, extractEventInfo(event))\n"],"names":[],"mappings":";;AAOM,SAAU,gBAAgB,CAAC,KAAmB,EAAA;IAChD,OAAO;AACH,QAAA,KAAK,EAAE;YACH,CAAC,EAAE,KAAK,CAAC,KAAK;YACd,CAAC,EAAE,KAAK,CAAC,KAAK;AACjB,SAAA;KACJ;AACL;AAEO,MAAM,cAAc,GACvB,CAAC,OAAmC,KACpC,CAAC,KAAmB,KAChB,gBAAgB,CAAC,KAAK,CAAC,IAAI,OAAO,CAAC,KAAK,EAAE,gBAAgB,CAAC,KAAK,CAAC;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/events/use-dom-event.mjs b/node_modules/framer-motion/dist/es/events/use-dom-event.mjs new file mode 100644 index 0000000..8ea5b54 --- /dev/null +++ b/node_modules/framer-motion/dist/es/events/use-dom-event.mjs @@ -0,0 +1,36 @@ +"use client"; +import { useEffect } from 'react'; +import { addDomEvent } from 'motion-dom'; + +/** + * Attaches an event listener directly to the provided DOM element. + * + * Bypassing React's event system can be desirable, for instance when attaching non-passive + * event handlers. + * + * ```jsx + * const ref = useRef(null) + * + * useDomEvent(ref, 'wheel', onWheel, { passive: false }) + * + * return
+ * ``` + * + * @param ref - React.RefObject that's been provided to the element you want to bind the listener to. + * @param eventName - Name of the event you want listen for. + * @param handler - Function to fire when receiving the event. + * @param options - Options to pass to `Event.addEventListener`. + * + * @public + */ +function useDomEvent(ref, eventName, handler, options) { + useEffect(() => { + const element = ref.current; + if (handler && element) { + return addDomEvent(element, eventName, handler, options); + } + }, [ref, eventName, handler, options]); +} + +export { useDomEvent }; +//# sourceMappingURL=use-dom-event.mjs.map diff --git a/node_modules/framer-motion/dist/es/events/use-dom-event.mjs.map b/node_modules/framer-motion/dist/es/events/use-dom-event.mjs.map new file mode 100644 index 0000000..f24c4bf --- /dev/null +++ b/node_modules/framer-motion/dist/es/events/use-dom-event.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-dom-event.mjs","sources":["../../../src/events/use-dom-event.ts"],"sourcesContent":["\"use client\"\n\nimport { RefObject, useEffect } from \"react\"\nimport { addDomEvent } from \"motion-dom\"\n\n/**\n * Attaches an event listener directly to the provided DOM element.\n *\n * Bypassing React's event system can be desirable, for instance when attaching non-passive\n * event handlers.\n *\n * ```jsx\n * const ref = useRef(null)\n *\n * useDomEvent(ref, 'wheel', onWheel, { passive: false })\n *\n * return
\n * ```\n *\n * @param ref - React.RefObject that's been provided to the element you want to bind the listener to.\n * @param eventName - Name of the event you want listen for.\n * @param handler - Function to fire when receiving the event.\n * @param options - Options to pass to `Event.addEventListener`.\n *\n * @public\n */\nexport function useDomEvent(\n ref: RefObject,\n eventName: string,\n handler?: EventListener | undefined,\n options?: AddEventListenerOptions\n) {\n useEffect(() => {\n const element = ref.current\n\n if (handler && element) {\n return addDomEvent(element, eventName, handler, options)\n }\n }, [ref, eventName, handler, options])\n}\n"],"names":[],"mappings":";;;;AAKA;;;;;;;;;;;;;;;;;;;;AAoBG;AACG;;AAOE;AAEA;;;;AAIR;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs b/node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs new file mode 100644 index 0000000..d3b54bd --- /dev/null +++ b/node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs @@ -0,0 +1,573 @@ +import { createBox, frame, eachAxis, measurePageBox, convertBoxToBoundingBox, convertBoundingBoxToBox, addValueToWillChange, animateMotionValue, mixNumber, addDomEvent, setDragLock, percent, calcLength, resize, isElementTextInput } from 'motion-dom'; +import { invariant } from 'motion-utils'; +import { addPointerEvent } from '../../events/add-pointer-event.mjs'; +import { extractEventInfo } from '../../events/event-info.mjs'; +import { getContextWindow } from '../../utils/get-context-window.mjs'; +import { isRefObject } from '../../utils/is-ref-object.mjs'; +import { PanSession } from '../pan/PanSession.mjs'; +import { applyConstraints, calcRelativeConstraints, resolveDragElastic, rebaseAxisConstraints, calcViewportConstraints, calcOrigin, defaultElastic } from './utils/constraints.mjs'; + +const elementDragControls = new WeakMap(); +class VisualElementDragControls { + constructor(visualElement) { + this.openDragLock = null; + this.isDragging = false; + this.currentDirection = null; + this.originPoint = { x: 0, y: 0 }; + /** + * The permitted boundaries of travel, in pixels. + */ + this.constraints = false; + this.hasMutatedConstraints = false; + /** + * The per-axis resolved elastic values. + */ + this.elastic = createBox(); + /** + * The latest pointer event. Used as fallback when the `cancel` and `stop` functions are called without arguments. + */ + this.latestPointerEvent = null; + /** + * The latest pan info. Used as fallback when the `cancel` and `stop` functions are called without arguments. + */ + this.latestPanInfo = null; + this.visualElement = visualElement; + } + start(originEvent, { snapToCursor = false, distanceThreshold } = {}) { + /** + * Don't start dragging if this component is exiting + */ + const { presenceContext } = this.visualElement; + if (presenceContext && presenceContext.isPresent === false) + return; + const onSessionStart = (event) => { + if (snapToCursor) { + this.snapToCursor(extractEventInfo(event).point); + } + this.stopAnimation(); + }; + const onStart = (event, info) => { + // Attempt to grab the global drag gesture lock - maybe make this part of PanSession + const { drag, dragPropagation, onDragStart } = this.getProps(); + if (drag && !dragPropagation) { + if (this.openDragLock) + this.openDragLock(); + this.openDragLock = setDragLock(drag); + // If we don 't have the lock, don't start dragging + if (!this.openDragLock) + return; + } + this.latestPointerEvent = event; + this.latestPanInfo = info; + this.isDragging = true; + this.currentDirection = null; + this.resolveConstraints(); + if (this.visualElement.projection) { + this.visualElement.projection.isAnimationBlocked = true; + this.visualElement.projection.target = undefined; + } + /** + * Record gesture origin and pointer offset + */ + eachAxis((axis) => { + let current = this.getAxisMotionValue(axis).get() || 0; + /** + * If the MotionValue is a percentage value convert to px + */ + if (percent.test(current)) { + const { projection } = this.visualElement; + if (projection && projection.layout) { + const measuredAxis = projection.layout.layoutBox[axis]; + if (measuredAxis) { + const length = calcLength(measuredAxis); + current = length * (parseFloat(current) / 100); + } + } + } + this.originPoint[axis] = current; + }); + // Fire onDragStart event + if (onDragStart) { + frame.update(() => onDragStart(event, info), false, true); + } + addValueToWillChange(this.visualElement, "transform"); + const { animationState } = this.visualElement; + animationState && animationState.setActive("whileDrag", true); + }; + const onMove = (event, info) => { + this.latestPointerEvent = event; + this.latestPanInfo = info; + const { dragPropagation, dragDirectionLock, onDirectionLock, onDrag, } = this.getProps(); + // If we didn't successfully receive the gesture lock, early return. + if (!dragPropagation && !this.openDragLock) + return; + const { offset } = info; + // Attempt to detect drag direction if directionLock is true + if (dragDirectionLock && this.currentDirection === null) { + this.currentDirection = getCurrentDirection(offset); + // If we've successfully set a direction, notify listener + if (this.currentDirection !== null) { + onDirectionLock && onDirectionLock(this.currentDirection); + } + return; + } + // Update each point with the latest position + this.updateAxis("x", info.point, offset); + this.updateAxis("y", info.point, offset); + /** + * Ideally we would leave the renderer to fire naturally at the end of + * this frame but if the element is about to change layout as the result + * of a re-render we want to ensure the browser can read the latest + * bounding box to ensure the pointer and element don't fall out of sync. + */ + this.visualElement.render(); + /** + * This must fire after the render call as it might trigger a state + * change which itself might trigger a layout update. + */ + if (onDrag) { + frame.update(() => onDrag(event, info), false, true); + } + }; + const onSessionEnd = (event, info) => { + this.latestPointerEvent = event; + this.latestPanInfo = info; + this.stop(event, info); + this.latestPointerEvent = null; + this.latestPanInfo = null; + }; + const resumeAnimation = () => { + const { dragSnapToOrigin: snap } = this.getProps(); + if (snap || this.constraints) { + this.startAnimation({ x: 0, y: 0 }); + } + }; + const { dragSnapToOrigin } = this.getProps(); + this.panSession = new PanSession(originEvent, { + onSessionStart, + onStart, + onMove, + onSessionEnd, + resumeAnimation, + }, { + transformPagePoint: this.visualElement.getTransformPagePoint(), + dragSnapToOrigin, + distanceThreshold, + contextWindow: getContextWindow(this.visualElement), + element: this.visualElement.current, + }); + } + /** + * @internal + */ + stop(event, panInfo) { + const finalEvent = event || this.latestPointerEvent; + const finalPanInfo = panInfo || this.latestPanInfo; + const isDragging = this.isDragging; + this.cancel(); + if (!isDragging || !finalPanInfo || !finalEvent) + return; + const { velocity } = finalPanInfo; + this.startAnimation(velocity); + const { onDragEnd } = this.getProps(); + if (onDragEnd) { + frame.postRender(() => onDragEnd(finalEvent, finalPanInfo)); + } + } + /** + * @internal + */ + cancel() { + this.isDragging = false; + const { projection, animationState } = this.visualElement; + if (projection) { + projection.isAnimationBlocked = false; + } + this.endPanSession(); + const { dragPropagation } = this.getProps(); + if (!dragPropagation && this.openDragLock) { + this.openDragLock(); + this.openDragLock = null; + } + animationState && animationState.setActive("whileDrag", false); + } + /** + * Clean up the pan session without modifying other drag state. + * This is used during unmount to ensure event listeners are removed + * without affecting projection animations or drag locks. + * @internal + */ + endPanSession() { + this.panSession && this.panSession.end(); + this.panSession = undefined; + } + updateAxis(axis, _point, offset) { + const { drag } = this.getProps(); + // If we're not dragging this axis, do an early return. + if (!offset || !shouldDrag(axis, drag, this.currentDirection)) + return; + const axisValue = this.getAxisMotionValue(axis); + let next = this.originPoint[axis] + offset[axis]; + // Apply constraints + if (this.constraints && this.constraints[axis]) { + next = applyConstraints(next, this.constraints[axis], this.elastic[axis]); + } + axisValue.set(next); + } + resolveConstraints() { + const { dragConstraints, dragElastic } = this.getProps(); + const layout = this.visualElement.projection && + !this.visualElement.projection.layout + ? this.visualElement.projection.measure(false) + : this.visualElement.projection?.layout; + const prevConstraints = this.constraints; + if (dragConstraints && isRefObject(dragConstraints)) { + if (!this.constraints) { + this.constraints = this.resolveRefConstraints(); + } + } + else { + if (dragConstraints && layout) { + this.constraints = calcRelativeConstraints(layout.layoutBox, dragConstraints); + } + else { + this.constraints = false; + } + } + this.elastic = resolveDragElastic(dragElastic); + /** + * If we're outputting to external MotionValues, we want to rebase the measured constraints + * from viewport-relative to component-relative. This only applies to relative (non-ref) + * constraints, as ref-based constraints from calcViewportConstraints are already in the + * correct coordinate space for the motion value transform offset. + */ + if (prevConstraints !== this.constraints && + !isRefObject(dragConstraints) && + layout && + this.constraints && + !this.hasMutatedConstraints) { + eachAxis((axis) => { + if (this.constraints !== false && + this.getAxisMotionValue(axis)) { + this.constraints[axis] = rebaseAxisConstraints(layout.layoutBox[axis], this.constraints[axis]); + } + }); + } + } + resolveRefConstraints() { + const { dragConstraints: constraints, onMeasureDragConstraints } = this.getProps(); + if (!constraints || !isRefObject(constraints)) + return false; + const constraintsElement = constraints.current; + invariant(constraintsElement !== null, "If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.", "drag-constraints-ref"); + const { projection } = this.visualElement; + // TODO + if (!projection || !projection.layout) + return false; + /** + * Refresh the root scroll offset so the constraint's viewport box + * translates to correct page coordinates. The scroll captured at + * drag mount can be stale if the document was scrolled afterwards — + * e.g. via the browser restoring scroll on refresh, or an ancestor + * layout effect running after this element's mount (#2829). + * + * Clear the cached scroll first so `updateScroll` bypasses its + * per-animationId cache and re-reads the live value. + */ + if (projection.root) { + projection.root.scroll = undefined; + projection.root.updateScroll(); + } + const constraintsBox = measurePageBox(constraintsElement, projection.root, this.visualElement.getTransformPagePoint()); + let measuredConstraints = calcViewportConstraints(projection.layout.layoutBox, constraintsBox); + /** + * If there's an onMeasureDragConstraints listener we call it and + * if different constraints are returned, set constraints to that + */ + if (onMeasureDragConstraints) { + const userConstraints = onMeasureDragConstraints(convertBoxToBoundingBox(measuredConstraints)); + this.hasMutatedConstraints = !!userConstraints; + if (userConstraints) { + measuredConstraints = convertBoundingBoxToBox(userConstraints); + } + } + return measuredConstraints; + } + startAnimation(velocity) { + const { drag, dragMomentum, dragElastic, dragTransition, dragSnapToOrigin, onDragTransitionEnd, } = this.getProps(); + const constraints = this.constraints || {}; + const momentumAnimations = eachAxis((axis) => { + if (!shouldDrag(axis, drag, this.currentDirection)) { + return; + } + let transition = (constraints && constraints[axis]) || {}; + if (dragSnapToOrigin === true || + dragSnapToOrigin === axis) + transition = { min: 0, max: 0 }; + /** + * Overdamp the boundary spring if `dragElastic` is disabled. There's still a frame + * of spring animations so we should look into adding a disable spring option to `inertia`. + * We could do something here where we affect the `bounceStiffness` and `bounceDamping` + * using the value of `dragElastic`. + */ + const bounceStiffness = dragElastic ? 200 : 1000000; + const bounceDamping = dragElastic ? 40 : 10000000; + const inertia = { + type: "inertia", + velocity: dragMomentum ? velocity[axis] : 0, + bounceStiffness, + bounceDamping, + timeConstant: 750, + restDelta: 1, + restSpeed: 10, + ...dragTransition, + ...transition, + }; + // If we're not animating on an externally-provided `MotionValue` we can use the + // component's animation controls which will handle interactions with whileHover (etc), + // otherwise we just have to animate the `MotionValue` itself. + return this.startAxisValueAnimation(axis, inertia); + }); + // Run all animations and then resolve the new drag constraints. + return Promise.all(momentumAnimations).then(onDragTransitionEnd); + } + startAxisValueAnimation(axis, transition) { + const axisValue = this.getAxisMotionValue(axis); + addValueToWillChange(this.visualElement, axis); + return axisValue.start(animateMotionValue(axis, axisValue, 0, transition, this.visualElement, false)); + } + stopAnimation() { + eachAxis((axis) => this.getAxisMotionValue(axis).stop()); + } + /** + * Drag works differently depending on which props are provided. + * + * - If _dragX and _dragY are provided, we output the gesture delta directly to those motion values. + * - Otherwise, we apply the delta to the x/y motion values. + */ + getAxisMotionValue(axis) { + const dragKey = `_drag${axis.toUpperCase()}`; + const props = this.visualElement.getProps(); + const externalMotionValue = props[dragKey]; + return externalMotionValue + ? externalMotionValue + : this.visualElement.getValue(axis, this.visualElement.latestValues[axis] ?? 0); + } + snapToCursor(point) { + eachAxis((axis) => { + const { drag } = this.getProps(); + // If we're not dragging this axis, do an early return. + if (!shouldDrag(axis, drag, this.currentDirection)) + return; + const { projection } = this.visualElement; + const axisValue = this.getAxisMotionValue(axis); + if (projection && projection.layout) { + const { min, max } = projection.layout.layoutBox[axis]; + /** + * The layout measurement includes the current transform value, + * so we need to add it back to get the correct snap position. + * This fixes an issue where elements with initial coordinates + * would snap to the wrong position on the first drag. + */ + const current = axisValue.get() || 0; + axisValue.set(point[axis] - mixNumber(min, max, 0.5) + current); + } + }); + } + /** + * When the viewport resizes we want to check if the measured constraints + * have changed and, if so, reposition the element within those new constraints + * relative to where it was before the resize. + */ + scalePositionWithinConstraints() { + if (!this.visualElement.current) + return; + const { drag, dragConstraints } = this.getProps(); + const { projection } = this.visualElement; + if (!isRefObject(dragConstraints) || !projection || !this.constraints) + return; + /** + * Stop current animations as there can be visual glitching if we try to do + * this mid-animation + */ + this.stopAnimation(); + /** + * Record the relative position of the dragged element relative to the + * constraints box and save as a progress value. + */ + const boxProgress = { x: 0, y: 0 }; + eachAxis((axis) => { + const axisValue = this.getAxisMotionValue(axis); + if (axisValue && this.constraints !== false) { + const latest = axisValue.get(); + boxProgress[axis] = calcOrigin({ min: latest, max: latest }, this.constraints[axis]); + } + }); + /** + * Update the layout of this element and resolve the latest drag constraints + */ + const { transformTemplate } = this.visualElement.getProps(); + this.visualElement.current.style.transform = transformTemplate + ? transformTemplate({}, "") + : "none"; + projection.root && projection.root.updateScroll(); + projection.updateLayout(); + /** + * Reset constraints so resolveConstraints() will recalculate them + * with the freshly measured layout rather than returning the cached value. + */ + this.constraints = false; + this.resolveConstraints(); + /** + * For each axis, calculate the current progress of the layout axis + * within the new constraints. + */ + eachAxis((axis) => { + if (!shouldDrag(axis, drag, null)) + return; + /** + * Calculate a new transform based on the previous box progress + */ + const axisValue = this.getAxisMotionValue(axis); + const { min, max } = this.constraints[axis]; + axisValue.set(mixNumber(min, max, boxProgress[axis])); + }); + /** + * Flush the updated transform to the DOM synchronously to prevent + * a visual flash at the element's CSS layout position (0,0) when + * the transform was stripped for measurement. + */ + this.visualElement.render(); + } + addListeners() { + if (!this.visualElement.current) + return; + elementDragControls.set(this.visualElement, this); + const element = this.visualElement.current; + /** + * Attach a pointerdown event listener on this DOM element to initiate drag tracking. + */ + const stopPointerListener = addPointerEvent(element, "pointerdown", (event) => { + const { drag, dragListener = true } = this.getProps(); + const target = event.target; + /** + * Only block drag if clicking on a text input child element + * (input, textarea, select, contenteditable) where users might + * want to select text or interact with the control. + * + * Buttons and links don't block drag since they don't have + * click-and-move actions of their own. + */ + const isClickingTextInputChild = target !== element && isElementTextInput(target); + if (drag && dragListener && !isClickingTextInputChild) { + this.start(event); + } + }); + /** + * If using ref-based constraints, observe both the draggable element + * and the constraint container for size changes via ResizeObserver. + * Setup is deferred because dragConstraints.current is null when + * addListeners first runs (React hasn't committed the ref yet). + */ + let stopResizeObservers; + const measureDragConstraints = () => { + const { dragConstraints } = this.getProps(); + if (isRefObject(dragConstraints) && dragConstraints.current) { + this.constraints = this.resolveRefConstraints(); + if (!stopResizeObservers) { + stopResizeObservers = startResizeObservers(element, dragConstraints.current, () => this.scalePositionWithinConstraints()); + } + } + }; + const { projection } = this.visualElement; + const stopMeasureLayoutListener = projection.addEventListener("measure", measureDragConstraints); + if (projection && !projection.layout) { + projection.root && projection.root.updateScroll(); + projection.updateLayout(); + } + frame.read(measureDragConstraints); + /** + * Attach a window resize listener to scale the draggable target within its defined + * constraints as the window resizes. + */ + const stopResizeListener = addDomEvent(window, "resize", () => this.scalePositionWithinConstraints()); + /** + * If the element's layout changes, calculate the delta and apply that to + * the drag gesture's origin point. + */ + const stopLayoutUpdateListener = projection.addEventListener("didUpdate", (({ delta, hasLayoutChanged }) => { + if (this.isDragging && hasLayoutChanged) { + eachAxis((axis) => { + const motionValue = this.getAxisMotionValue(axis); + if (!motionValue) + return; + this.originPoint[axis] += delta[axis].translate; + motionValue.set(motionValue.get() + delta[axis].translate); + }); + this.visualElement.render(); + } + })); + return () => { + stopResizeListener(); + stopPointerListener(); + stopMeasureLayoutListener(); + stopLayoutUpdateListener && stopLayoutUpdateListener(); + stopResizeObservers && stopResizeObservers(); + }; + } + getProps() { + const props = this.visualElement.getProps(); + const { drag = false, dragDirectionLock = false, dragPropagation = false, dragConstraints = false, dragElastic = defaultElastic, dragMomentum = true, } = props; + return { + ...props, + drag, + dragDirectionLock, + dragPropagation, + dragConstraints, + dragElastic, + dragMomentum, + }; + } +} +function skipFirstCall(callback) { + let isFirst = true; + return () => { + if (isFirst) { + isFirst = false; + return; + } + callback(); + }; +} +function startResizeObservers(element, constraintsElement, onResize) { + const stopElement = resize(element, skipFirstCall(onResize)); + const stopContainer = resize(constraintsElement, skipFirstCall(onResize)); + return () => { + stopElement(); + stopContainer(); + }; +} +function shouldDrag(direction, drag, currentDirection) { + return ((drag === true || drag === direction) && + (currentDirection === null || currentDirection === direction)); +} +/** + * Based on an x/y offset determine the current drag direction. If both axis' offsets are lower + * than the provided threshold, return `null`. + * + * @param offset - The x/y offset from origin. + * @param lockThreshold - (Optional) - the minimum absolute offset before we can determine a drag direction. + */ +function getCurrentDirection(offset, lockThreshold = 10) { + let direction = null; + if (Math.abs(offset.y) > lockThreshold) { + direction = "y"; + } + else if (Math.abs(offset.x) > lockThreshold) { + direction = "x"; + } + return direction; +} + +export { VisualElementDragControls, elementDragControls }; +//# sourceMappingURL=VisualElementDragControls.mjs.map diff --git a/node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs.map b/node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs.map new file mode 100644 index 0000000..2af878e --- /dev/null +++ b/node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"VisualElementDragControls.mjs","sources":["../../../../src/gestures/drag/VisualElementDragControls.ts"],"sourcesContent":["import {\n addValueToWillChange,\n animateMotionValue,\n calcLength,\n convertBoundingBoxToBox,\n convertBoxToBoundingBox,\n createBox,\n eachAxis,\n frame,\n isElementTextInput,\n measurePageBox,\n mixNumber,\n PanInfo,\n percent,\n ResolvedConstraints,\n resize,\n setDragLock,\n Transition,\n type VisualElement,\n} from \"motion-dom\"\nimport { Axis, Point, invariant } from \"motion-utils\"\nimport { addDomEvent, type LayoutUpdateData } from \"motion-dom\"\nimport { addPointerEvent } from \"../../events/add-pointer-event\"\nimport { extractEventInfo } from \"../../events/event-info\"\nimport { MotionProps } from \"../../motion/types\"\nimport { getContextWindow } from \"../../utils/get-context-window\"\nimport { isRefObject } from \"../../utils/is-ref-object\"\nimport { PanSession } from \"../pan/PanSession\"\nimport {\n applyConstraints,\n calcOrigin,\n calcRelativeConstraints,\n calcViewportConstraints,\n defaultElastic,\n rebaseAxisConstraints,\n resolveDragElastic,\n} from \"./utils/constraints\"\n\nexport const elementDragControls = new WeakMap<\n VisualElement,\n VisualElementDragControls\n>()\n\nexport interface DragControlOptions {\n /**\n * This distance after which dragging starts and a direction is locked in.\n *\n * @public\n */\n distanceThreshold?: number\n\n /**\n * Whether to immediately snap to the cursor when dragging starts.\n *\n * @public\n */\n snapToCursor?: boolean\n}\n\ntype DragDirection = \"x\" | \"y\"\n\nexport class VisualElementDragControls {\n private visualElement: VisualElement\n\n private panSession?: PanSession\n\n private openDragLock: VoidFunction | null = null\n\n isDragging = false\n private currentDirection: DragDirection | null = null\n\n private originPoint: Point = { x: 0, y: 0 }\n\n /**\n * The permitted boundaries of travel, in pixels.\n */\n private constraints: ResolvedConstraints | false = false\n\n private hasMutatedConstraints = false\n\n /**\n * The per-axis resolved elastic values.\n */\n private elastic = createBox()\n\n /**\n * The latest pointer event. Used as fallback when the `cancel` and `stop` functions are called without arguments.\n */\n private latestPointerEvent: PointerEvent | null = null\n\n /**\n * The latest pan info. Used as fallback when the `cancel` and `stop` functions are called without arguments.\n */\n private latestPanInfo: PanInfo | null = null\n\n constructor(visualElement: VisualElement) {\n this.visualElement = visualElement\n }\n\n start(\n originEvent: PointerEvent,\n { snapToCursor = false, distanceThreshold }: DragControlOptions = {}\n ) {\n /**\n * Don't start dragging if this component is exiting\n */\n const { presenceContext } = this.visualElement\n if (presenceContext && presenceContext.isPresent === false) return\n\n const onSessionStart = (event: PointerEvent) => {\n if (snapToCursor) {\n this.snapToCursor(extractEventInfo(event).point)\n }\n this.stopAnimation()\n }\n\n const onStart = (event: PointerEvent, info: PanInfo) => {\n // Attempt to grab the global drag gesture lock - maybe make this part of PanSession\n const { drag, dragPropagation, onDragStart } = this.getProps()\n\n if (drag && !dragPropagation) {\n if (this.openDragLock) this.openDragLock()\n\n this.openDragLock = setDragLock(drag)\n\n // If we don 't have the lock, don't start dragging\n if (!this.openDragLock) return\n }\n\n this.latestPointerEvent = event\n this.latestPanInfo = info\n this.isDragging = true\n\n this.currentDirection = null\n\n this.resolveConstraints()\n\n if (this.visualElement.projection) {\n this.visualElement.projection.isAnimationBlocked = true\n this.visualElement.projection.target = undefined\n }\n\n /**\n * Record gesture origin and pointer offset\n */\n eachAxis((axis) => {\n let current = this.getAxisMotionValue(axis).get() || 0\n\n /**\n * If the MotionValue is a percentage value convert to px\n */\n if (percent.test(current)) {\n const { projection } = this.visualElement\n\n if (projection && projection.layout) {\n const measuredAxis = projection.layout.layoutBox[axis]\n\n if (measuredAxis) {\n const length = calcLength(measuredAxis)\n current = length * (parseFloat(current) / 100)\n }\n }\n }\n\n this.originPoint[axis] = current\n })\n\n // Fire onDragStart event\n if (onDragStart) {\n frame.update(() => onDragStart(event, info), false, true)\n }\n\n addValueToWillChange(this.visualElement, \"transform\")\n\n const { animationState } = this.visualElement\n animationState && animationState.setActive(\"whileDrag\", true)\n }\n\n const onMove = (event: PointerEvent, info: PanInfo) => {\n this.latestPointerEvent = event\n this.latestPanInfo = info\n\n const {\n dragPropagation,\n dragDirectionLock,\n onDirectionLock,\n onDrag,\n } = this.getProps()\n\n // If we didn't successfully receive the gesture lock, early return.\n if (!dragPropagation && !this.openDragLock) return\n\n const { offset } = info\n // Attempt to detect drag direction if directionLock is true\n if (dragDirectionLock && this.currentDirection === null) {\n this.currentDirection = getCurrentDirection(offset)\n\n // If we've successfully set a direction, notify listener\n if (this.currentDirection !== null) {\n onDirectionLock && onDirectionLock(this.currentDirection)\n }\n\n return\n }\n\n // Update each point with the latest position\n this.updateAxis(\"x\", info.point, offset)\n this.updateAxis(\"y\", info.point, offset)\n\n /**\n * Ideally we would leave the renderer to fire naturally at the end of\n * this frame but if the element is about to change layout as the result\n * of a re-render we want to ensure the browser can read the latest\n * bounding box to ensure the pointer and element don't fall out of sync.\n */\n this.visualElement.render()\n\n /**\n * This must fire after the render call as it might trigger a state\n * change which itself might trigger a layout update.\n */\n if (onDrag) {\n frame.update(() => onDrag(event, info), false, true)\n }\n }\n\n const onSessionEnd = (event: PointerEvent, info: PanInfo) => {\n this.latestPointerEvent = event\n this.latestPanInfo = info\n\n this.stop(event, info)\n\n this.latestPointerEvent = null\n this.latestPanInfo = null\n }\n\n const resumeAnimation = () => {\n const { dragSnapToOrigin: snap } = this.getProps()\n if (snap || this.constraints) {\n this.startAnimation({ x: 0, y: 0 })\n }\n }\n\n const { dragSnapToOrigin } = this.getProps()\n this.panSession = new PanSession(\n originEvent,\n {\n onSessionStart,\n onStart,\n onMove,\n onSessionEnd,\n resumeAnimation,\n },\n {\n transformPagePoint: this.visualElement.getTransformPagePoint(),\n dragSnapToOrigin,\n distanceThreshold,\n contextWindow: getContextWindow(this.visualElement),\n element: this.visualElement.current,\n }\n )\n }\n\n /**\n * @internal\n */\n stop(event?: PointerEvent, panInfo?: PanInfo) {\n const finalEvent = event || this.latestPointerEvent\n const finalPanInfo = panInfo || this.latestPanInfo\n\n const isDragging = this.isDragging\n this.cancel()\n if (!isDragging || !finalPanInfo || !finalEvent) return\n\n const { velocity } = finalPanInfo\n this.startAnimation(velocity)\n\n const { onDragEnd } = this.getProps()\n if (onDragEnd) {\n frame.postRender(() => onDragEnd(finalEvent, finalPanInfo))\n }\n }\n\n /**\n * @internal\n */\n cancel() {\n this.isDragging = false\n\n const { projection, animationState } = this.visualElement\n\n if (projection) {\n projection.isAnimationBlocked = false\n }\n\n this.endPanSession()\n\n const { dragPropagation } = this.getProps()\n\n if (!dragPropagation && this.openDragLock) {\n this.openDragLock()\n this.openDragLock = null\n }\n\n animationState && animationState.setActive(\"whileDrag\", false)\n }\n\n /**\n * Clean up the pan session without modifying other drag state.\n * This is used during unmount to ensure event listeners are removed\n * without affecting projection animations or drag locks.\n * @internal\n */\n endPanSession() {\n this.panSession && this.panSession.end()\n this.panSession = undefined\n }\n\n private updateAxis(axis: DragDirection, _point: Point, offset?: Point) {\n const { drag } = this.getProps()\n\n // If we're not dragging this axis, do an early return.\n if (!offset || !shouldDrag(axis, drag, this.currentDirection)) return\n\n const axisValue = this.getAxisMotionValue(axis)\n let next = this.originPoint[axis] + offset[axis]\n\n // Apply constraints\n if (this.constraints && this.constraints[axis]) {\n next = applyConstraints(\n next,\n this.constraints[axis],\n this.elastic[axis]\n )\n }\n\n axisValue.set(next)\n }\n\n private resolveConstraints() {\n const { dragConstraints, dragElastic } = this.getProps()\n\n const layout =\n this.visualElement.projection &&\n !this.visualElement.projection.layout\n ? this.visualElement.projection.measure(false)\n : this.visualElement.projection?.layout\n\n const prevConstraints = this.constraints\n\n if (dragConstraints && isRefObject(dragConstraints)) {\n if (!this.constraints) {\n this.constraints = this.resolveRefConstraints()\n }\n } else {\n if (dragConstraints && layout) {\n this.constraints = calcRelativeConstraints(\n layout.layoutBox,\n dragConstraints\n )\n } else {\n this.constraints = false\n }\n }\n\n this.elastic = resolveDragElastic(dragElastic)\n\n /**\n * If we're outputting to external MotionValues, we want to rebase the measured constraints\n * from viewport-relative to component-relative. This only applies to relative (non-ref)\n * constraints, as ref-based constraints from calcViewportConstraints are already in the\n * correct coordinate space for the motion value transform offset.\n */\n if (\n prevConstraints !== this.constraints &&\n !isRefObject(dragConstraints) &&\n layout &&\n this.constraints &&\n !this.hasMutatedConstraints\n ) {\n eachAxis((axis) => {\n if (\n this.constraints !== false &&\n this.getAxisMotionValue(axis)\n ) {\n this.constraints[axis] = rebaseAxisConstraints(\n layout.layoutBox[axis],\n this.constraints[axis]\n )\n }\n })\n }\n }\n\n private resolveRefConstraints() {\n const { dragConstraints: constraints, onMeasureDragConstraints } =\n this.getProps()\n if (!constraints || !isRefObject(constraints)) return false\n\n const constraintsElement = constraints.current as HTMLElement\n\n invariant(\n constraintsElement !== null,\n \"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.\",\n \"drag-constraints-ref\"\n )\n\n const { projection } = this.visualElement\n\n // TODO\n if (!projection || !projection.layout) return false\n\n /**\n * Refresh the root scroll offset so the constraint's viewport box\n * translates to correct page coordinates. The scroll captured at\n * drag mount can be stale if the document was scrolled afterwards —\n * e.g. via the browser restoring scroll on refresh, or an ancestor\n * layout effect running after this element's mount (#2829).\n *\n * Clear the cached scroll first so `updateScroll` bypasses its\n * per-animationId cache and re-reads the live value.\n */\n if (projection.root) {\n projection.root.scroll = undefined\n projection.root.updateScroll()\n }\n\n const constraintsBox = measurePageBox(\n constraintsElement,\n projection.root!,\n this.visualElement.getTransformPagePoint()\n )\n\n let measuredConstraints = calcViewportConstraints(\n projection.layout.layoutBox,\n constraintsBox\n )\n\n /**\n * If there's an onMeasureDragConstraints listener we call it and\n * if different constraints are returned, set constraints to that\n */\n if (onMeasureDragConstraints) {\n const userConstraints = onMeasureDragConstraints(\n convertBoxToBoundingBox(measuredConstraints)\n )\n\n this.hasMutatedConstraints = !!userConstraints\n\n if (userConstraints) {\n measuredConstraints = convertBoundingBoxToBox(userConstraints)\n }\n }\n\n return measuredConstraints\n }\n\n private startAnimation(velocity: Point) {\n const {\n drag,\n dragMomentum,\n dragElastic,\n dragTransition,\n dragSnapToOrigin,\n onDragTransitionEnd,\n } = this.getProps()\n\n const constraints: Partial = this.constraints || {}\n\n const momentumAnimations = eachAxis((axis) => {\n if (!shouldDrag(axis, drag, this.currentDirection)) {\n return\n }\n\n let transition = (constraints && constraints[axis]) || {}\n\n if (\n dragSnapToOrigin === true ||\n (dragSnapToOrigin as unknown) === axis\n )\n transition = { min: 0, max: 0 }\n\n /**\n * Overdamp the boundary spring if `dragElastic` is disabled. There's still a frame\n * of spring animations so we should look into adding a disable spring option to `inertia`.\n * We could do something here where we affect the `bounceStiffness` and `bounceDamping`\n * using the value of `dragElastic`.\n */\n const bounceStiffness = dragElastic ? 200 : 1000000\n const bounceDamping = dragElastic ? 40 : 10000000\n\n const inertia: Transition = {\n type: \"inertia\",\n velocity: dragMomentum ? velocity[axis] : 0,\n bounceStiffness,\n bounceDamping,\n timeConstant: 750,\n restDelta: 1,\n restSpeed: 10,\n ...dragTransition,\n ...transition,\n }\n\n // If we're not animating on an externally-provided `MotionValue` we can use the\n // component's animation controls which will handle interactions with whileHover (etc),\n // otherwise we just have to animate the `MotionValue` itself.\n return this.startAxisValueAnimation(axis, inertia)\n })\n\n // Run all animations and then resolve the new drag constraints.\n return Promise.all(momentumAnimations).then(onDragTransitionEnd)\n }\n\n private startAxisValueAnimation(\n axis: DragDirection,\n transition: Transition\n ) {\n const axisValue = this.getAxisMotionValue(axis)\n\n addValueToWillChange(this.visualElement, axis)\n\n return axisValue.start(\n animateMotionValue(\n axis,\n axisValue,\n 0,\n transition,\n this.visualElement,\n false\n )\n )\n }\n\n private stopAnimation() {\n eachAxis((axis) => this.getAxisMotionValue(axis).stop())\n }\n\n /**\n * Drag works differently depending on which props are provided.\n *\n * - If _dragX and _dragY are provided, we output the gesture delta directly to those motion values.\n * - Otherwise, we apply the delta to the x/y motion values.\n */\n private getAxisMotionValue(axis: DragDirection) {\n const dragKey =\n `_drag${axis.toUpperCase()}` as `_drag${Uppercase}`\n const props = this.visualElement.getProps()\n const externalMotionValue = props[dragKey]\n\n return externalMotionValue\n ? externalMotionValue\n : this.visualElement.getValue(\n axis,\n this.visualElement.latestValues[axis] ?? 0\n )\n }\n\n private snapToCursor(point: Point) {\n eachAxis((axis) => {\n const { drag } = this.getProps()\n\n // If we're not dragging this axis, do an early return.\n if (!shouldDrag(axis, drag, this.currentDirection)) return\n\n const { projection } = this.visualElement\n const axisValue = this.getAxisMotionValue(axis)\n\n if (projection && projection.layout) {\n const { min, max } = projection.layout.layoutBox[axis]\n\n /**\n * The layout measurement includes the current transform value,\n * so we need to add it back to get the correct snap position.\n * This fixes an issue where elements with initial coordinates\n * would snap to the wrong position on the first drag.\n */\n const current = axisValue.get() || 0\n\n axisValue.set(point[axis] - mixNumber(min, max, 0.5) + current)\n }\n })\n }\n\n /**\n * When the viewport resizes we want to check if the measured constraints\n * have changed and, if so, reposition the element within those new constraints\n * relative to where it was before the resize.\n */\n scalePositionWithinConstraints() {\n if (!this.visualElement.current) return\n\n const { drag, dragConstraints } = this.getProps()\n const { projection } = this.visualElement\n if (!isRefObject(dragConstraints) || !projection || !this.constraints)\n return\n\n /**\n * Stop current animations as there can be visual glitching if we try to do\n * this mid-animation\n */\n this.stopAnimation()\n\n /**\n * Record the relative position of the dragged element relative to the\n * constraints box and save as a progress value.\n */\n const boxProgress = { x: 0, y: 0 }\n eachAxis((axis) => {\n const axisValue = this.getAxisMotionValue(axis)\n if (axisValue && this.constraints !== false) {\n const latest = axisValue.get()\n boxProgress[axis] = calcOrigin(\n { min: latest, max: latest },\n this.constraints[axis] as Axis\n )\n }\n })\n\n /**\n * Update the layout of this element and resolve the latest drag constraints\n */\n const { transformTemplate } = this.visualElement.getProps()\n this.visualElement.current.style.transform = transformTemplate\n ? transformTemplate({}, \"\")\n : \"none\"\n projection.root && projection.root.updateScroll()\n projection.updateLayout()\n\n /**\n * Reset constraints so resolveConstraints() will recalculate them\n * with the freshly measured layout rather than returning the cached value.\n */\n this.constraints = false\n this.resolveConstraints()\n\n /**\n * For each axis, calculate the current progress of the layout axis\n * within the new constraints.\n */\n eachAxis((axis) => {\n if (!shouldDrag(axis, drag, null)) return\n\n /**\n * Calculate a new transform based on the previous box progress\n */\n const axisValue = this.getAxisMotionValue(axis)\n const { min, max } = (this.constraints as ResolvedConstraints)[\n axis\n ] as Axis\n axisValue.set(mixNumber(min, max, boxProgress[axis]))\n })\n\n /**\n * Flush the updated transform to the DOM synchronously to prevent\n * a visual flash at the element's CSS layout position (0,0) when\n * the transform was stripped for measurement.\n */\n this.visualElement.render()\n }\n\n addListeners() {\n if (!this.visualElement.current) return\n elementDragControls.set(this.visualElement, this)\n const element = this.visualElement.current\n\n /**\n * Attach a pointerdown event listener on this DOM element to initiate drag tracking.\n */\n const stopPointerListener = addPointerEvent(\n element,\n \"pointerdown\",\n (event) => {\n const { drag, dragListener = true } = this.getProps()\n const target = event.target as Element\n\n /**\n * Only block drag if clicking on a text input child element\n * (input, textarea, select, contenteditable) where users might\n * want to select text or interact with the control.\n *\n * Buttons and links don't block drag since they don't have\n * click-and-move actions of their own.\n */\n const isClickingTextInputChild =\n target !== element && isElementTextInput(target)\n\n if (drag && dragListener && !isClickingTextInputChild) {\n this.start(event)\n }\n }\n )\n\n /**\n * If using ref-based constraints, observe both the draggable element\n * and the constraint container for size changes via ResizeObserver.\n * Setup is deferred because dragConstraints.current is null when\n * addListeners first runs (React hasn't committed the ref yet).\n */\n let stopResizeObservers: VoidFunction | undefined\n\n const measureDragConstraints = () => {\n const { dragConstraints } = this.getProps()\n if (isRefObject(dragConstraints) && dragConstraints.current) {\n this.constraints = this.resolveRefConstraints()\n\n if (!stopResizeObservers) {\n stopResizeObservers = startResizeObservers(\n element,\n dragConstraints.current as HTMLElement,\n () => this.scalePositionWithinConstraints()\n )\n }\n }\n }\n\n const { projection } = this.visualElement\n\n const stopMeasureLayoutListener = projection!.addEventListener(\n \"measure\",\n measureDragConstraints\n )\n\n if (projection && !projection!.layout) {\n projection.root && projection.root.updateScroll()\n projection.updateLayout()\n }\n\n frame.read(measureDragConstraints)\n\n /**\n * Attach a window resize listener to scale the draggable target within its defined\n * constraints as the window resizes.\n */\n const stopResizeListener = addDomEvent(window, \"resize\", () =>\n this.scalePositionWithinConstraints()\n )\n\n /**\n * If the element's layout changes, calculate the delta and apply that to\n * the drag gesture's origin point.\n */\n const stopLayoutUpdateListener = projection!.addEventListener(\n \"didUpdate\",\n (({ delta, hasLayoutChanged }: LayoutUpdateData) => {\n if (this.isDragging && hasLayoutChanged) {\n eachAxis((axis) => {\n const motionValue = this.getAxisMotionValue(axis)\n if (!motionValue) return\n\n this.originPoint[axis] += delta[axis].translate\n motionValue.set(\n motionValue.get() + delta[axis].translate\n )\n })\n\n this.visualElement.render()\n }\n }) as any\n )\n\n return () => {\n stopResizeListener()\n stopPointerListener()\n stopMeasureLayoutListener()\n stopLayoutUpdateListener && stopLayoutUpdateListener()\n stopResizeObservers && stopResizeObservers()\n }\n }\n\n getProps(): MotionProps {\n const props = this.visualElement.getProps()\n const {\n drag = false,\n dragDirectionLock = false,\n dragPropagation = false,\n dragConstraints = false,\n dragElastic = defaultElastic,\n dragMomentum = true,\n } = props\n return {\n ...props,\n drag,\n dragDirectionLock,\n dragPropagation,\n dragConstraints,\n dragElastic,\n dragMomentum,\n }\n }\n}\n\nfunction skipFirstCall(callback: VoidFunction): VoidFunction {\n let isFirst = true\n return () => {\n if (isFirst) {\n isFirst = false\n return\n }\n callback()\n }\n}\n\nfunction startResizeObservers(\n element: HTMLElement,\n constraintsElement: HTMLElement,\n onResize: VoidFunction\n): VoidFunction {\n const stopElement = resize(element, skipFirstCall(onResize))\n const stopContainer = resize(constraintsElement, skipFirstCall(onResize))\n return () => {\n stopElement()\n stopContainer()\n }\n}\n\nfunction shouldDrag(\n direction: DragDirection,\n drag: boolean | DragDirection | undefined,\n currentDirection: null | DragDirection\n) {\n return (\n (drag === true || drag === direction) &&\n (currentDirection === null || currentDirection === direction)\n )\n}\n\n/**\n * Based on an x/y offset determine the current drag direction. If both axis' offsets are lower\n * than the provided threshold, return `null`.\n *\n * @param offset - The x/y offset from origin.\n * @param lockThreshold - (Optional) - the minimum absolute offset before we can determine a drag direction.\n */\nfunction getCurrentDirection(\n offset: Point,\n lockThreshold = 10\n): DragDirection | null {\n let direction: DragDirection | null = null\n\n if (Math.abs(offset.y) > lockThreshold) {\n direction = \"y\"\n } else if (Math.abs(offset.x) > lockThreshold) {\n direction = \"x\"\n }\n\n return direction\n}\n\nexport function expectsResolvedDragConstraints({\n dragConstraints,\n onMeasureDragConstraints,\n}: MotionProps) {\n return isRefObject(dragConstraints) && !!onMeasureDragConstraints\n}\n"],"names":[],"mappings":";;;;;;;;;AAsCO,MAAM,mBAAmB,GAAG,IAAI,OAAO;MAuBjC,yBAAyB,CAAA;AAkClC,IAAA,WAAA,CAAY,aAAyC,EAAA;QA7B7C,IAAA,CAAA,YAAY,GAAwB,IAAI;QAEhD,IAAA,CAAA,UAAU,GAAG,KAAK;QACV,IAAA,CAAA,gBAAgB,GAAyB,IAAI;QAE7C,IAAA,CAAA,WAAW,GAAU,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;AAE3C;;AAEG;QACK,IAAA,CAAA,WAAW,GAAgC,KAAK;QAEhD,IAAA,CAAA,qBAAqB,GAAG,KAAK;AAErC;;AAEG;QACK,IAAA,CAAA,OAAO,GAAG,SAAS,EAAE;AAE7B;;AAEG;QACK,IAAA,CAAA,kBAAkB,GAAwB,IAAI;AAEtD;;AAEG;QACK,IAAA,CAAA,aAAa,GAAmB,IAAI;AAGxC,QAAA,IAAI,CAAC,aAAa,GAAG,aAAa;IACtC;IAEA,KAAK,CACD,WAAyB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S;AACpB;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/gestures/drag/index.mjs b/node_modules/framer-motion/dist/es/gestures/drag/index.mjs new file mode 100644 index 0000000..6eda988 --- /dev/null +++ b/node_modules/framer-motion/dist/es/gestures/drag/index.mjs @@ -0,0 +1,51 @@ +import { Feature } from 'motion-dom'; +import { noop } from 'motion-utils'; +import { VisualElementDragControls } from './VisualElementDragControls.mjs'; + +class DragGesture extends Feature { + constructor(node) { + super(node); + this.removeGroupControls = noop; + this.removeListeners = noop; + this.controls = new VisualElementDragControls(node); + } + mount() { + // If we've been provided a DragControls for manual control over the drag gesture, + // subscribe this component to it on mount. + const { dragControls } = this.node.getProps(); + if (dragControls) { + this.removeGroupControls = dragControls.subscribe(this.controls); + } + this.removeListeners = this.controls.addListeners() || noop; + } + update() { + const { dragControls } = this.node.getProps(); + const { dragControls: prevDragControls } = this.node.prevProps || {}; + if (dragControls !== prevDragControls) { + this.removeGroupControls(); + if (dragControls) { + this.removeGroupControls = dragControls.subscribe(this.controls); + } + } + } + unmount() { + this.removeGroupControls(); + this.removeListeners(); + /** + * In React 19, during list reorder reconciliation, components may + * briefly unmount and remount while the drag is still active. If we're + * actively dragging, we should NOT end the pan session - it will + * continue tracking pointer events via its window-level listeners. + * + * The pan session will be properly cleaned up when: + * 1. The drag ends naturally (pointerup/pointercancel) + * 2. The component is truly removed from the DOM + */ + if (!this.controls.isDragging) { + this.controls.endPanSession(); + } + } +} + +export { DragGesture }; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/framer-motion/dist/es/gestures/drag/index.mjs.map b/node_modules/framer-motion/dist/es/gestures/drag/index.mjs.map new file mode 100644 index 0000000..05a1daa --- /dev/null +++ b/node_modules/framer-motion/dist/es/gestures/drag/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../../../../src/gestures/drag/index.ts"],"sourcesContent":["import { Feature, type VisualElement } from \"motion-dom\"\nimport { noop } from \"motion-utils\"\nimport { VisualElementDragControls } from \"./VisualElementDragControls\"\n\nexport class DragGesture extends Feature {\n controls: VisualElementDragControls\n\n removeGroupControls: Function = noop\n removeListeners: Function = noop\n\n constructor(node: VisualElement) {\n super(node)\n this.controls = new VisualElementDragControls(node)\n }\n\n mount() {\n // If we've been provided a DragControls for manual control over the drag gesture,\n // subscribe this component to it on mount.\n const { dragControls } = this.node.getProps()\n\n if (dragControls) {\n this.removeGroupControls = dragControls.subscribe(this.controls)\n }\n\n this.removeListeners = this.controls.addListeners() || noop\n }\n\n update() {\n const { dragControls } = this.node.getProps()\n const { dragControls: prevDragControls } = this.node.prevProps || {}\n\n if (dragControls !== prevDragControls) {\n this.removeGroupControls()\n if (dragControls) {\n this.removeGroupControls = dragControls.subscribe(this.controls)\n }\n }\n }\n\n unmount() {\n this.removeGroupControls()\n this.removeListeners()\n /**\n * In React 19, during list reorder reconciliation, components may\n * briefly unmount and remount while the drag is still active. If we're\n * actively dragging, we should NOT end the pan session - it will\n * continue tracking pointer events via its window-level listeners.\n *\n * The pan session will be properly cleaned up when:\n * 1. The drag ends naturally (pointerup/pointercancel)\n * 2. The component is truly removed from the DOM\n */\n if (!this.controls.isDragging) {\n this.controls.endPanSession()\n }\n }\n}\n"],"names":[],"mappings":";;;;AAIM,MAAO,WAAY,SAAQ,OAAoB,CAAA;AAMjD,IAAA,WAAA,CAAY,IAAgC,EAAA;QACxC,KAAK,CAAC,IAAI,CAAC;QAJf,IAAA,CAAA,mBAAmB,GAAa,IAAI;QACpC,IAAA,CAAA,eAAe,GAAa,IAAI;QAI5B,IAAI,CAAC,QAAQ,GAAG,IAAI,yBAAyB,CAAC,IAAI,CAAC;IACvD;IAEA,KAAK,GAAA;;;QAGD,MAAM,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;QAE7C,IAAI,YAAY,EAAE;YACd,IAAI,CAAC,mBAAmB,GAAG,YAAY,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC;QACpE;QAEA,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,QAAQ,CAAC,YAAY,EAAE,IAAI,IAAI;IAC/D;IAEA,MAAM,GAAA;QACF,MAAM,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;AAC7C,QAAA,MAAM,EAAE,YAAY,EAAE,gBAAgB,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,IAAI,EAAE;AAEpE,QAAA,IAAI,YAAY,KAAK,gBAAgB,EAAE;YACnC,IAAI,CAAC,mBAAmB,EAAE;YAC1B,IAAI,YAAY,EAAE;gBACd,IAAI,CAAC,mBAAmB,GAAG,YAAY,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC;YACpE;QACJ;IACJ;IAEA,OAAO,GAAA;QACH,IAAI,CAAC,mBAAmB,EAAE;QAC1B,IAAI,CAAC,eAAe,EAAE;AACtB;;;;;;;;;AASG;AACH,QAAA,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE;AAC3B,YAAA,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAE;QACjC;IACJ;AACH;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/gestures/drag/use-drag-controls.mjs b/node_modules/framer-motion/dist/es/gestures/drag/use-drag-controls.mjs new file mode 100644 index 0000000..ebd79b9 --- /dev/null +++ b/node_modules/framer-motion/dist/es/gestures/drag/use-drag-controls.mjs @@ -0,0 +1,117 @@ +import { useConstant } from '../../utils/use-constant.mjs'; + +/** + * Can manually trigger a drag gesture on one or more `drag`-enabled `motion` components. + * + * ```jsx + * const dragControls = useDragControls() + * + * function startDrag(event) { + * dragControls.start(event, { snapToCursor: true }) + * } + * + * return ( + * <> + *
+ * + * + * ) + * ``` + * + * @public + */ +class DragControls { + constructor() { + this.componentControls = new Set(); + } + /** + * Subscribe a component's internal `VisualElementDragControls` to the user-facing API. + * + * @internal + */ + subscribe(controls) { + this.componentControls.add(controls); + return () => this.componentControls.delete(controls); + } + /** + * Start a drag gesture on every `motion` component that has this set of drag controls + * passed into it via the `dragControls` prop. + * + * ```jsx + * dragControls.start(e, { + * snapToCursor: true + * }) + * ``` + * + * @param event - PointerEvent + * @param options - Options + * + * @public + */ + start(event, options) { + this.componentControls.forEach((controls) => { + controls.start(event.nativeEvent || event, options); + }); + } + /** + * Cancels a drag gesture. + * + * ```jsx + * dragControls.cancel() + * ``` + * + * @public + */ + cancel() { + this.componentControls.forEach((controls) => { + controls.cancel(); + }); + } + /** + * Stops a drag gesture. + * + * ```jsx + * dragControls.stop() + * ``` + * + * @public + */ + stop() { + this.componentControls.forEach((controls) => { + controls.stop(); + }); + } +} +const createDragControls = () => new DragControls(); +/** + * Usually, dragging is initiated by pressing down on a `motion` component with a `drag` prop + * and moving it. For some use-cases, for instance clicking at an arbitrary point on a video scrubber, we + * might want to initiate that dragging from a different component than the draggable one. + * + * By creating a `dragControls` using the `useDragControls` hook, we can pass this into + * the draggable component's `dragControls` prop. It exposes a `start` method + * that can start dragging from pointer events on other components. + * + * ```jsx + * const dragControls = useDragControls() + * + * function startDrag(event) { + * dragControls.start(event, { snapToCursor: true }) + * } + * + * return ( + * <> + *
+ * + * + * ) + * ``` + * + * @public + */ +function useDragControls() { + return useConstant(createDragControls); +} + +export { DragControls, useDragControls }; +//# sourceMappingURL=use-drag-controls.mjs.map diff --git a/node_modules/framer-motion/dist/es/gestures/drag/use-drag-controls.mjs.map b/node_modules/framer-motion/dist/es/gestures/drag/use-drag-controls.mjs.map new file mode 100644 index 0000000..43af9eb --- /dev/null +++ b/node_modules/framer-motion/dist/es/gestures/drag/use-drag-controls.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-drag-controls.mjs","sources":["../../../../src/gestures/drag/use-drag-controls.ts"],"sourcesContent":["import * as React from \"react\"\nimport { useConstant } from \"../../utils/use-constant\"\nimport {\n DragControlOptions,\n VisualElementDragControls,\n} from \"./VisualElementDragControls\"\n\n/**\n * Can manually trigger a drag gesture on one or more `drag`-enabled `motion` components.\n *\n * ```jsx\n * const dragControls = useDragControls()\n *\n * function startDrag(event) {\n * dragControls.start(event, { snapToCursor: true })\n * }\n *\n * return (\n * <>\n *
\n * \n * \n * )\n * ```\n *\n * @public\n */\nexport class DragControls {\n private componentControls = new Set()\n\n /**\n * Subscribe a component's internal `VisualElementDragControls` to the user-facing API.\n *\n * @internal\n */\n subscribe(controls: VisualElementDragControls): () => void {\n this.componentControls.add(controls)\n\n return () => this.componentControls.delete(controls)\n }\n\n /**\n * Start a drag gesture on every `motion` component that has this set of drag controls\n * passed into it via the `dragControls` prop.\n *\n * ```jsx\n * dragControls.start(e, {\n * snapToCursor: true\n * })\n * ```\n *\n * @param event - PointerEvent\n * @param options - Options\n *\n * @public\n */\n start(\n event: React.PointerEvent | PointerEvent,\n options?: DragControlOptions\n ) {\n this.componentControls.forEach((controls) => {\n controls.start(\n (event as React.PointerEvent).nativeEvent || event,\n options\n )\n })\n }\n\n /**\n * Cancels a drag gesture.\n *\n * ```jsx\n * dragControls.cancel()\n * ```\n *\n * @public\n */\n cancel() {\n this.componentControls.forEach((controls) => {\n controls.cancel()\n })\n }\n\n /**\n * Stops a drag gesture.\n *\n * ```jsx\n * dragControls.stop()\n * ```\n *\n * @public\n */\n stop() {\n this.componentControls.forEach((controls) => {\n controls.stop()\n })\n }\n}\n\nconst createDragControls = () => new DragControls()\n\n/**\n * Usually, dragging is initiated by pressing down on a `motion` component with a `drag` prop\n * and moving it. For some use-cases, for instance clicking at an arbitrary point on a video scrubber, we\n * might want to initiate that dragging from a different component than the draggable one.\n *\n * By creating a `dragControls` using the `useDragControls` hook, we can pass this into\n * the draggable component's `dragControls` prop. It exposes a `start` method\n * that can start dragging from pointer events on other components.\n *\n * ```jsx\n * const dragControls = useDragControls()\n *\n * function startDrag(event) {\n * dragControls.start(event, { snapToCursor: true })\n * }\n *\n * return (\n * <>\n *
\n * \n * \n * )\n * ```\n *\n * @public\n */\nexport function useDragControls() {\n return useConstant(createDragControls)\n}\n"],"names":[],"mappings":";;AAOA;;;;;;;;;;;;;;;;;;;AAmBG;MACU,YAAY,CAAA;AAAzB,IAAA,WAAA,GAAA;AACY,QAAA,IAAA,CAAA,iBAAiB,GAAG,IAAI,GAAG,EAA6B;IAqEpE;AAnEI;;;;AAIG;AACH,IAAA,SAAS,CAAC,QAAmC,EAAA;AACzC,QAAA,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,QAAQ,CAAC;QAEpC,OAAO,MAAM,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,QAAQ,CAAC;IACxD;AAEA;;;;;;;;;;;;;;AAcG;IACH,KAAK,CACD,KAAwC,EACxC,OAA4B,EAAA;QAE5B,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,QAAQ,KAAI;YACxC,QAAQ,CAAC,KAAK,CACT,KAA4B,CAAC,WAAW,IAAI,KAAK,EAClD,OAAO,CACV;AACL,QAAA,CAAC,CAAC;IACN;AAEA;;;;;;;;AAQG;IACH,MAAM,GAAA;QACF,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,QAAQ,KAAI;YACxC,QAAQ,CAAC,MAAM,EAAE;AACrB,QAAA,CAAC,CAAC;IACN;AAEA;;;;;;;;AAQG;IACH,IAAI,GAAA;QACA,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,QAAQ,KAAI;YACxC,QAAQ,CAAC,IAAI,EAAE;AACnB,QAAA,CAAC,CAAC;IACN;AACH;AAED,MAAM,kBAAkB,GAAG,MAAM,IAAI,YAAY,EAAE;AAEnD;;;;;;;;;;;;;;;;;;;;;;;;;AAyBG;SACa,eAAe,GAAA;AAC3B,IAAA,OAAO,WAAW,CAAC,kBAAkB,CAAC;AAC1C;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.mjs b/node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.mjs new file mode 100644 index 0000000..98c6754 --- /dev/null +++ b/node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.mjs @@ -0,0 +1,128 @@ +import { mixNumber, calcLength } from 'motion-dom'; +import { progress, clamp } from 'motion-utils'; + +/** + * Apply constraints to a point. These constraints are both physical along an + * axis, and an elastic factor that determines how much to constrain the point + * by if it does lie outside the defined parameters. + */ +function applyConstraints(point, { min, max }, elastic) { + if (min !== undefined && point < min) { + // If we have a min point defined, and this is outside of that, constrain + point = elastic + ? mixNumber(min, point, elastic.min) + : Math.max(point, min); + } + else if (max !== undefined && point > max) { + // If we have a max point defined, and this is outside of that, constrain + point = elastic + ? mixNumber(max, point, elastic.max) + : Math.min(point, max); + } + return point; +} +/** + * Calculate constraints in terms of the viewport when defined relatively to the + * measured axis. This is measured from the nearest edge, so a max constraint of 200 + * on an axis with a max value of 300 would return a constraint of 500 - axis length + */ +function calcRelativeAxisConstraints(axis, min, max) { + return { + min: min !== undefined ? axis.min + min : undefined, + max: max !== undefined + ? axis.max + max - (axis.max - axis.min) + : undefined, + }; +} +/** + * Calculate constraints in terms of the viewport when + * defined relatively to the measured bounding box. + */ +function calcRelativeConstraints(layoutBox, { top, left, bottom, right }) { + return { + x: calcRelativeAxisConstraints(layoutBox.x, left, right), + y: calcRelativeAxisConstraints(layoutBox.y, top, bottom), + }; +} +/** + * Calculate viewport constraints when defined as another viewport-relative axis + */ +function calcViewportAxisConstraints(layoutAxis, constraintsAxis) { + let min = constraintsAxis.min - layoutAxis.min; + let max = constraintsAxis.max - layoutAxis.max; + // If the constraints axis is actually smaller than the layout axis then we can + // flip the constraints + if (constraintsAxis.max - constraintsAxis.min < + layoutAxis.max - layoutAxis.min) { + [min, max] = [max, min]; + } + return { min, max }; +} +/** + * Calculate viewport constraints when defined as another viewport-relative box + */ +function calcViewportConstraints(layoutBox, constraintsBox) { + return { + x: calcViewportAxisConstraints(layoutBox.x, constraintsBox.x), + y: calcViewportAxisConstraints(layoutBox.y, constraintsBox.y), + }; +} +/** + * Calculate a transform origin relative to the source axis, between 0-1, that results + * in an asthetically pleasing scale/transform needed to project from source to target. + */ +function calcOrigin(source, target) { + let origin = 0.5; + const sourceLength = calcLength(source); + const targetLength = calcLength(target); + if (targetLength > sourceLength) { + origin = progress(target.min, target.max - sourceLength, source.min); + } + else if (sourceLength > targetLength) { + origin = progress(source.min, source.max - targetLength, target.min); + } + return clamp(0, 1, origin); +} +/** + * Rebase the calculated viewport constraints relative to the layout.min point. + */ +function rebaseAxisConstraints(layout, constraints) { + const relativeConstraints = {}; + if (constraints.min !== undefined) { + relativeConstraints.min = constraints.min - layout.min; + } + if (constraints.max !== undefined) { + relativeConstraints.max = constraints.max - layout.min; + } + return relativeConstraints; +} +const defaultElastic = 0.35; +/** + * Accepts a dragElastic prop and returns resolved elastic values for each axis. + */ +function resolveDragElastic(dragElastic = defaultElastic) { + if (dragElastic === false) { + dragElastic = 0; + } + else if (dragElastic === true) { + dragElastic = defaultElastic; + } + return { + x: resolveAxisElastic(dragElastic, "left", "right"), + y: resolveAxisElastic(dragElastic, "top", "bottom"), + }; +} +function resolveAxisElastic(dragElastic, minLabel, maxLabel) { + return { + min: resolvePointElastic(dragElastic, minLabel), + max: resolvePointElastic(dragElastic, maxLabel), + }; +} +function resolvePointElastic(dragElastic, label) { + return typeof dragElastic === "number" + ? dragElastic + : dragElastic[label] || 0; +} + +export { applyConstraints, calcOrigin, calcRelativeAxisConstraints, calcRelativeConstraints, calcViewportAxisConstraints, calcViewportConstraints, defaultElastic, rebaseAxisConstraints, resolveAxisElastic, resolveDragElastic, resolvePointElastic }; +//# sourceMappingURL=constraints.mjs.map diff --git a/node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.mjs.map b/node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.mjs.map new file mode 100644 index 0000000..3405bd5 --- /dev/null +++ b/node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"constraints.mjs","sources":["../../../../../src/gestures/drag/utils/constraints.ts"],"sourcesContent":["import { calcLength, mixNumber, type DragElastic, type ResolvedConstraints } from \"motion-dom\"\nimport {\n Axis,\n BoundingBox,\n Box,\n progress as calcProgress,\n clamp,\n Point,\n} from \"motion-utils\"\n\n/**\n * Apply constraints to a point. These constraints are both physical along an\n * axis, and an elastic factor that determines how much to constrain the point\n * by if it does lie outside the defined parameters.\n */\nexport function applyConstraints(\n point: number,\n { min, max }: Partial,\n elastic?: Axis\n): number {\n if (min !== undefined && point < min) {\n // If we have a min point defined, and this is outside of that, constrain\n point = elastic\n ? mixNumber(min, point, elastic.min)\n : Math.max(point, min)\n } else if (max !== undefined && point > max) {\n // If we have a max point defined, and this is outside of that, constrain\n point = elastic\n ? mixNumber(max, point, elastic.max)\n : Math.min(point, max)\n }\n\n return point\n}\n\n/**\n * Calculates a min projection point based on a pointer, pointer progress\n * within the drag target, and constraints.\n *\n * For instance if an element was 100px width, we were dragging from 0.25\n * along this axis, the pointer is at 200px, and there were no constraints,\n * we would calculate a min projection point of 175px.\n */\nexport function calcConstrainedMinPoint(\n point: number,\n length: number,\n progress: number,\n constraints?: Partial,\n elastic?: Axis\n): number {\n // Calculate a min point for this axis and apply it to the current pointer\n const min = point - length * progress\n\n return constraints ? applyConstraints(min, constraints, elastic) : min\n}\n\n/**\n * Calculate constraints in terms of the viewport when defined relatively to the\n * measured axis. This is measured from the nearest edge, so a max constraint of 200\n * on an axis with a max value of 300 would return a constraint of 500 - axis length\n */\nexport function calcRelativeAxisConstraints(\n axis: Axis,\n min?: number,\n max?: number\n): Partial {\n return {\n min: min !== undefined ? axis.min + min : undefined,\n max:\n max !== undefined\n ? axis.max + max - (axis.max - axis.min)\n : undefined,\n }\n}\n\n/**\n * Calculate constraints in terms of the viewport when\n * defined relatively to the measured bounding box.\n */\nexport function calcRelativeConstraints(\n layoutBox: Box,\n { top, left, bottom, right }: Partial\n): ResolvedConstraints {\n return {\n x: calcRelativeAxisConstraints(layoutBox.x, left, right),\n y: calcRelativeAxisConstraints(layoutBox.y, top, bottom),\n }\n}\n\n/**\n * Calculate viewport constraints when defined as another viewport-relative axis\n */\nexport function calcViewportAxisConstraints(\n layoutAxis: Axis,\n constraintsAxis: Axis\n) {\n let min = constraintsAxis.min - layoutAxis.min\n let max = constraintsAxis.max - layoutAxis.max\n\n // If the constraints axis is actually smaller than the layout axis then we can\n // flip the constraints\n if (\n constraintsAxis.max - constraintsAxis.min <\n layoutAxis.max - layoutAxis.min\n ) {\n ;[min, max] = [max, min]\n }\n\n return { min, max }\n}\n\n/**\n * Calculate viewport constraints when defined as another viewport-relative box\n */\nexport function calcViewportConstraints(layoutBox: Box, constraintsBox: Box) {\n return {\n x: calcViewportAxisConstraints(layoutBox.x, constraintsBox.x),\n y: calcViewportAxisConstraints(layoutBox.y, constraintsBox.y),\n }\n}\n\n/**\n * Calculate a transform origin relative to the source axis, between 0-1, that results\n * in an asthetically pleasing scale/transform needed to project from source to target.\n */\nexport function calcOrigin(source: Axis, target: Axis): number {\n let origin = 0.5\n const sourceLength = calcLength(source)\n const targetLength = calcLength(target)\n\n if (targetLength > sourceLength) {\n origin = calcProgress(target.min, target.max - sourceLength, source.min)\n } else if (sourceLength > targetLength) {\n origin = calcProgress(source.min, source.max - targetLength, target.min)\n }\n\n return clamp(0, 1, origin)\n}\n\n/**\n * Calculate the relative progress of one constraints box relative to another.\n * Imagine a page scroll bar. At the top, this would return 0, at the bottom, 1.\n * Anywhere in-between, a value between 0 and 1.\n *\n * This also handles flipped constraints, for instance a draggable container within\n * a smaller viewport like a scrollable view.\n */\nexport function calcProgressWithinConstraints(\n layoutBox: Box,\n constraintsBox: Box\n): Point {\n return {\n x: calcOrigin(layoutBox.x, constraintsBox.x),\n y: calcOrigin(layoutBox.y, constraintsBox.y),\n }\n}\n\n/**\n * Calculate the an axis position based on two axes and a progress value.\n */\nexport function calcPositionFromProgress(\n axis: Axis,\n constraints: Axis,\n progress: number\n): Axis {\n const axisLength = axis.max - axis.min\n const min = mixNumber(\n constraints.min,\n constraints.max - axisLength,\n progress\n )\n return { min, max: min + axisLength }\n}\n\n/**\n * Rebase the calculated viewport constraints relative to the layout.min point.\n */\nexport function rebaseAxisConstraints(\n layout: Axis,\n constraints: Partial\n): Partial {\n const relativeConstraints: Partial = {}\n\n if (constraints.min !== undefined) {\n relativeConstraints.min = constraints.min - layout.min\n }\n\n if (constraints.max !== undefined) {\n relativeConstraints.max = constraints.max - layout.min\n }\n\n return relativeConstraints\n}\n\nexport const defaultElastic = 0.35\n/**\n * Accepts a dragElastic prop and returns resolved elastic values for each axis.\n */\nexport function resolveDragElastic(\n dragElastic: DragElastic = defaultElastic\n): Box {\n if (dragElastic === false) {\n dragElastic = 0\n } else if (dragElastic === true) {\n dragElastic = defaultElastic\n }\n\n return {\n x: resolveAxisElastic(dragElastic, \"left\", \"right\"),\n y: resolveAxisElastic(dragElastic, \"top\", \"bottom\"),\n }\n}\n\nexport function resolveAxisElastic(\n dragElastic: DragElastic,\n minLabel: string,\n maxLabel: string\n): Axis {\n return {\n min: resolvePointElastic(dragElastic, minLabel),\n max: resolvePointElastic(dragElastic, maxLabel),\n }\n}\n\nexport function resolvePointElastic(\n dragElastic: DragElastic,\n label: string\n): number {\n return typeof dragElastic === \"number\"\n ? dragElastic\n : dragElastic[label as keyof typeof dragElastic] || 0\n}\n"],"names":["calcProgress"],"mappings":";;;AAUA;;;;AAIG;AACG,SAAU,gBAAgB,CAC5B,KAAa,EACb,EAAE,GAAG,EAAE,GAAG,EAAiB,EAC3B,OAAc,EAAA;IAEd,IAAI,GAAG,KAAK,SAAS,IAAI,KAAK,GAAG,GAAG,EAAE;;AAElC,QAAA,KAAK,GAAG;cACF,SAAS,CAAC,GAAG,EAAE,KAAK,EAAE,OAAO,CAAC,GAAG;cACjC,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC;IAC9B;SAAO,IAAI,GAAG,KAAK,SAAS,IAAI,KAAK,GAAG,GAAG,EAAE;;AAEzC,QAAA,KAAK,GAAG;cACF,SAAS,CAAC,GAAG,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B;AAEO,MAAM,cAAc,GAAG;AAC9B;;AAEG;AACG,SAAU,kBAAkB,CAC9B,WAAA,GAA2B,cAAc,EAAA;AAEzC,IAAA,IAAI,WAAW,KAAK,KAAK,EAAE;QACvB,WAAW,GAAG,CAAC;IACnB;AAAO,SAAA,IAAI,WAAW,KAAK,IAAI,EAAE;QAC7B,WAAW,GAAG,cAAc;IAChC;IAEA,OAAO;QACH,CAAC,EAAE,kBAAkB,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC;QACnD,CAAC,EAAE,kBAAkB,CAAC,WAAW,EAAE,KAAK,EAAE,QAAQ,CAAC;KACtD;AACL;SAEgB,kBAAkB,CAC9B,WAAwB,EACxB,QAAgB,EAChB,QAAgB,EAAA;IAEhB,OAAO;AACH,QAAA,GAAG,EAAE,mBAAmB,CAAC,WAAW,EAAE,QAAQ,CAAC;AAC/C,QAAA,GAAG,EAAE,mBAAmB,CAAC,WAAW,EAAE,QAAQ,CAAC;KAClD;AACL;AAEM,SAAU,mBAAmB,CAC/B,WAAwB,EACxB,KAAa,EAAA;IAEb,OAAO,OAAO,WAAW,KAAK;AAC1B,UAAE;AACF,UAAE,WAAW,CAAC,KAAiC,CAAC,IAAI,CAAC;AAC7D;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/gestures/focus.mjs b/node_modules/framer-motion/dist/es/gestures/focus.mjs new file mode 100644 index 0000000..dcd3282 --- /dev/null +++ b/node_modules/framer-motion/dist/es/gestures/focus.mjs @@ -0,0 +1,41 @@ +import { Feature, addDomEvent } from 'motion-dom'; +import { pipe } from 'motion-utils'; + +class FocusGesture extends Feature { + constructor() { + super(...arguments); + this.isActive = false; + } + onFocus() { + let isFocusVisible = false; + /** + * If this element doesn't match focus-visible then don't + * apply whileHover. But, if matches throws that focus-visible + * is not a valid selector then in that browser outline styles will be applied + * to the element by default and we want to match that behaviour with whileFocus. + */ + try { + isFocusVisible = this.node.current.matches(":focus-visible"); + } + catch (e) { + isFocusVisible = true; + } + if (!isFocusVisible || !this.node.animationState) + return; + this.node.animationState.setActive("whileFocus", true); + this.isActive = true; + } + onBlur() { + if (!this.isActive || !this.node.animationState) + return; + this.node.animationState.setActive("whileFocus", false); + this.isActive = false; + } + mount() { + this.unmount = pipe(addDomEvent(this.node.current, "focus", () => this.onFocus()), addDomEvent(this.node.current, "blur", () => this.onBlur())); + } + unmount() { } +} + +export { FocusGesture }; +//# sourceMappingURL=focus.mjs.map diff --git a/node_modules/framer-motion/dist/es/gestures/focus.mjs.map b/node_modules/framer-motion/dist/es/gestures/focus.mjs.map new file mode 100644 index 0000000..6263f64 --- /dev/null +++ b/node_modules/framer-motion/dist/es/gestures/focus.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"focus.mjs","sources":["../../../src/gestures/focus.ts"],"sourcesContent":["import { Feature, addDomEvent } from \"motion-dom\"\nimport { pipe } from \"motion-utils\"\n\nexport class FocusGesture extends Feature {\n private isActive = false\n\n onFocus() {\n let isFocusVisible = false\n\n /**\n * If this element doesn't match focus-visible then don't\n * apply whileHover. But, if matches throws that focus-visible\n * is not a valid selector then in that browser outline styles will be applied\n * to the element by default and we want to match that behaviour with whileFocus.\n */\n try {\n isFocusVisible = this.node.current!.matches(\":focus-visible\")\n } catch (e) {\n isFocusVisible = true\n }\n\n if (!isFocusVisible || !this.node.animationState) return\n\n this.node.animationState.setActive(\"whileFocus\", true)\n this.isActive = true\n }\n\n onBlur() {\n if (!this.isActive || !this.node.animationState) return\n this.node.animationState.setActive(\"whileFocus\", false)\n this.isActive = false\n }\n\n mount() {\n this.unmount = pipe(\n addDomEvent(this.node.current!, \"focus\", () => this.onFocus()),\n addDomEvent(this.node.current!, \"blur\", () => this.onBlur())\n ) as VoidFunction\n }\n\n unmount() {}\n}\n"],"names":[],"mappings":";;;AAGM,MAAO,YAAa,SAAQ,OAAgB,CAAA;AAAlD,IAAA,WAAA,GAAA;;QACY,IAAA,CAAA,QAAQ,GAAG,KAAK;IAqC5B;IAnCI,OAAO,GAAA;QACH,IAAI,cAAc,GAAG,KAAK;AAE1B;;;;;AAKG;AACH,QAAA,IAAI;YACA,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,OAAQ,CAAC,OAAO,CAAC,gBAAgB,CAAC;QACjE;QAAE,OAAO,CAAC,EAAE;YACR,cAAc,GAAG,IAAI;QACzB;QAEA,IAAI,CAAC,cAAc,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc;YAAE;QAElD,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,YAAY,EAAE,IAAI,CAAC;AACtD,QAAA,IAAI,CAAC,QAAQ,GAAG,IAAI;IACxB;IAEA,MAAM,GAAA;QACF,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc;YAAE;QACjD,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,YAAY,EAAE,KAAK,CAAC;AACvD,QAAA,IAAI,CAAC,QAAQ,GAAG,KAAK;IACzB;IAEA,KAAK,GAAA;AACD,QAAA,IAAI,CAAC,OAAO,GAAG,IAAI,CACf,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,OAAQ,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC,EAC9D,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,OAAQ,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC,MAAM,EAAE,CAAC,CAC/C;IACrB;AAEA,IAAA,OAAO,KAAI;AACd;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/gestures/hover.mjs b/node_modules/framer-motion/dist/es/gestures/hover.mjs new file mode 100644 index 0000000..6ab462f --- /dev/null +++ b/node_modules/framer-motion/dist/es/gestures/hover.mjs @@ -0,0 +1,29 @@ +import { Feature, hover, frame } from 'motion-dom'; +import { extractEventInfo } from '../events/event-info.mjs'; + +function handleHoverEvent(node, event, lifecycle) { + const { props } = node; + if (node.animationState && props.whileHover) { + node.animationState.setActive("whileHover", lifecycle === "Start"); + } + const eventName = ("onHover" + lifecycle); + const callback = props[eventName]; + if (callback) { + frame.postRender(() => callback(event, extractEventInfo(event))); + } +} +class HoverGesture extends Feature { + mount() { + const { current } = this.node; + if (!current) + return; + this.unmount = hover(current, (_element, startEvent) => { + handleHoverEvent(this.node, startEvent, "Start"); + return (endEvent) => handleHoverEvent(this.node, endEvent, "End"); + }); + } + unmount() { } +} + +export { HoverGesture }; +//# sourceMappingURL=hover.mjs.map diff --git a/node_modules/framer-motion/dist/es/gestures/hover.mjs.map b/node_modules/framer-motion/dist/es/gestures/hover.mjs.map new file mode 100644 index 0000000..6f06642 --- /dev/null +++ b/node_modules/framer-motion/dist/es/gestures/hover.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"hover.mjs","sources":["../../../src/gestures/hover.ts"],"sourcesContent":["import { Feature, frame, hover, type VisualElement } from \"motion-dom\"\nimport { extractEventInfo } from \"../events/event-info\"\n\nfunction handleHoverEvent(\n node: VisualElement,\n event: PointerEvent,\n lifecycle: \"Start\" | \"End\"\n) {\n const { props } = node\n\n if (node.animationState && props.whileHover) {\n node.animationState.setActive(\"whileHover\", lifecycle === \"Start\")\n }\n\n const eventName = (\"onHover\" + lifecycle) as \"onHoverStart\" | \"onHoverEnd\"\n const callback = props[eventName]\n if (callback) {\n frame.postRender(() => callback(event, extractEventInfo(event)))\n }\n}\n\nexport class HoverGesture extends Feature {\n mount() {\n const { current } = this.node\n if (!current) return\n\n this.unmount = hover(current, (_element, startEvent) => {\n handleHoverEvent(this.node, startEvent, \"Start\")\n\n return (endEvent) => handleHoverEvent(this.node, endEvent, \"End\")\n })\n }\n\n unmount() {}\n}\n"],"names":[],"mappings":";;;AAGA,SAAS,gBAAgB,CACrB,IAA4B,EAC5B,KAAmB,EACnB,SAA0B,EAAA;AAE1B,IAAA,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI;IAEtB,IAAI,IAAI,CAAC,cAAc,IAAI,KAAK,CAAC,UAAU,EAAE;QACzC,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,YAAY,EAAE,SAAS,KAAK,OAAO,CAAC;IACtE;AAEA,IAAA,MAAM,SAAS,IAAI,SAAS,GAAG,SAAS,CAAkC;AAC1E,IAAA,MAAM,QAAQ,GAAG,KAAK,CAAC,SAAS,CAAC;IACjC,IAAI,QAAQ,EAAE;AACV,QAAA,KAAK,CAAC,UAAU,CAAC,MAAM,QAAQ,CAAC,KAAK,EAAE,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC;IACpE;AACJ;AAEM,MAAO,YAAa,SAAQ,OAAgB,CAAA;IAC9C,KAAK,GAAA;AACD,QAAA,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,IAAI;AAC7B,QAAA,IAAI,CAAC,OAAO;YAAE;AAEd,QAAA,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,UAAU,KAAI;YACnD,gBAAgB,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,CAAC;AAEhD,YAAA,OAAO,CAAC,QAAQ,KAAK,gBAAgB,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,CAAC;AACrE,QAAA,CAAC,CAAC;IACN;AAEA,IAAA,OAAO,KAAI;AACd;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/gestures/pan/PanSession.mjs b/node_modules/framer-motion/dist/es/gestures/pan/PanSession.mjs new file mode 100644 index 0000000..548ff9e --- /dev/null +++ b/node_modules/framer-motion/dist/es/gestures/pan/PanSession.mjs @@ -0,0 +1,283 @@ +import { frameData, frame, isPrimaryPointer, cancelFrame } from 'motion-dom'; +import { pipe, secondsToMilliseconds, millisecondsToSeconds } from 'motion-utils'; +import { addPointerEvent } from '../../events/add-pointer-event.mjs'; +import { extractEventInfo } from '../../events/event-info.mjs'; +import { distance2D } from '../../utils/distance.mjs'; + +const overflowStyles = /*#__PURE__*/ new Set(["auto", "scroll"]); +/** + * @internal + */ +class PanSession { + constructor(event, handlers, { transformPagePoint, contextWindow = window, dragSnapToOrigin = false, distanceThreshold = 3, element, } = {}) { + /** + * @internal + */ + this.startEvent = null; + /** + * @internal + */ + this.lastMoveEvent = null; + /** + * @internal + */ + this.lastMoveEventInfo = null; + /** + * Raw (untransformed) event info, re-transformed each frame + * so transformPagePoint sees the current parent matrix. + * @internal + */ + this.lastRawMoveEventInfo = null; + /** + * @internal + */ + this.handlers = {}; + /** + * @internal + */ + this.contextWindow = window; + /** + * Scroll positions of scrollable ancestors and window. + * @internal + */ + this.scrollPositions = new Map(); + /** + * Cleanup function for scroll listeners. + * @internal + */ + this.removeScrollListeners = null; + this.onElementScroll = (event) => { + this.handleScroll(event.target); + }; + this.onWindowScroll = () => { + this.handleScroll(window); + }; + this.updatePoint = () => { + if (!(this.lastMoveEvent && this.lastMoveEventInfo)) + return; + // Re-transform raw point through current transformPagePoint so + // animated parent transforms (e.g. rotation) are picked up each frame + if (this.lastRawMoveEventInfo) { + this.lastMoveEventInfo = transformPoint(this.lastRawMoveEventInfo, this.transformPagePoint); + } + const info = getPanInfo(this.lastMoveEventInfo, this.history); + const isPanStarted = this.startEvent !== null; + // Only start panning if the offset is larger than 3 pixels. If we make it + // any larger than this we'll want to reset the pointer history + // on the first update to avoid visual snapping to the cursor. + const isDistancePastThreshold = distance2D(info.offset, { x: 0, y: 0 }) >= this.distanceThreshold; + if (!isPanStarted && !isDistancePastThreshold) + return; + const { point } = info; + const { timestamp } = frameData; + this.history.push({ ...point, timestamp }); + const { onStart, onMove } = this.handlers; + if (!isPanStarted) { + onStart && onStart(this.lastMoveEvent, info); + this.startEvent = this.lastMoveEvent; + } + onMove && onMove(this.lastMoveEvent, info); + }; + this.handlePointerMove = (event, info) => { + this.lastMoveEvent = event; + this.lastRawMoveEventInfo = info; + this.lastMoveEventInfo = transformPoint(info, this.transformPagePoint); + // Throttle mouse move event to once per frame + frame.update(this.updatePoint, true); + }; + this.handlePointerUp = (event, info) => { + this.end(); + const { onEnd, onSessionEnd, resumeAnimation } = this.handlers; + // Resume animation if dragSnapToOrigin is set OR if no drag started (user just clicked) + // This ensures constraint animations continue when interrupted by a click + if (this.dragSnapToOrigin || !this.startEvent) { + resumeAnimation && resumeAnimation(); + } + if (!(this.lastMoveEvent && this.lastMoveEventInfo)) + return; + const panInfo = getPanInfo(event.type === "pointercancel" + ? this.lastMoveEventInfo + : transformPoint(info, this.transformPagePoint), this.history); + if (this.startEvent && onEnd) { + onEnd(event, panInfo); + } + onSessionEnd && onSessionEnd(event, panInfo); + }; + // If we have more than one touch, don't start detecting this gesture + if (!isPrimaryPointer(event)) + return; + this.dragSnapToOrigin = dragSnapToOrigin; + this.handlers = handlers; + this.transformPagePoint = transformPagePoint; + this.distanceThreshold = distanceThreshold; + this.contextWindow = contextWindow || window; + const info = extractEventInfo(event); + const initialInfo = transformPoint(info, this.transformPagePoint); + const { point } = initialInfo; + const { timestamp } = frameData; + this.history = [{ ...point, timestamp }]; + const { onSessionStart } = handlers; + onSessionStart && + onSessionStart(event, getPanInfo(initialInfo, this.history)); + // Listen in the capture phase so a descendant calling + // stopPropagation() (e.g. in its own pointerup handler) can't + // prevent the gesture from ending. See #2794. + const eventOptions = { passive: true, capture: true }; + this.removeListeners = pipe(addPointerEvent(this.contextWindow, "pointermove", this.handlePointerMove, eventOptions), addPointerEvent(this.contextWindow, "pointerup", this.handlePointerUp, eventOptions), addPointerEvent(this.contextWindow, "pointercancel", this.handlePointerUp, eventOptions)); + // Start scroll tracking if element provided + if (element) { + this.startScrollTracking(element); + } + } + /** + * Start tracking scroll on ancestors and window. + */ + startScrollTracking(element) { + // Store initial scroll positions for scrollable ancestors + let current = element.parentElement; + while (current) { + const style = getComputedStyle(current); + if (overflowStyles.has(style.overflowX) || + overflowStyles.has(style.overflowY)) { + this.scrollPositions.set(current, { + x: current.scrollLeft, + y: current.scrollTop, + }); + } + current = current.parentElement; + } + // Track window scroll + this.scrollPositions.set(window, { + x: window.scrollX, + y: window.scrollY, + }); + // Capture listener catches element scroll events as they bubble + window.addEventListener("scroll", this.onElementScroll, { + capture: true, + }); + // Direct window scroll listener (window scroll doesn't bubble) + window.addEventListener("scroll", this.onWindowScroll); + this.removeScrollListeners = () => { + window.removeEventListener("scroll", this.onElementScroll, { + capture: true, + }); + window.removeEventListener("scroll", this.onWindowScroll); + }; + } + /** + * Handle scroll compensation during drag. + * + * For element scroll: adjusts history origin since pageX/pageY doesn't change. + * For window scroll: adjusts lastMoveEventInfo since pageX/pageY would change. + */ + handleScroll(target) { + const initial = this.scrollPositions.get(target); + if (!initial) + return; + const isWindow = target === window; + const current = isWindow + ? { x: window.scrollX, y: window.scrollY } + : { + x: target.scrollLeft, + y: target.scrollTop, + }; + const delta = { x: current.x - initial.x, y: current.y - initial.y }; + if (delta.x === 0 && delta.y === 0) + return; + if (isWindow) { + // Window scroll: pageX/pageY changes, so update lastMoveEventInfo + if (this.lastMoveEventInfo) { + this.lastMoveEventInfo.point.x += delta.x; + this.lastMoveEventInfo.point.y += delta.y; + } + } + else { + // Element scroll: pageX/pageY unchanged, so adjust history origin + if (this.history.length > 0) { + this.history[0].x -= delta.x; + this.history[0].y -= delta.y; + } + } + this.scrollPositions.set(target, current); + frame.update(this.updatePoint, true); + } + updateHandlers(handlers) { + this.handlers = handlers; + } + end() { + this.removeListeners && this.removeListeners(); + this.removeScrollListeners && this.removeScrollListeners(); + this.scrollPositions.clear(); + cancelFrame(this.updatePoint); + } +} +function transformPoint(info, transformPagePoint) { + return transformPagePoint ? { point: transformPagePoint(info.point) } : info; +} +function subtractPoint(a, b) { + return { x: a.x - b.x, y: a.y - b.y }; +} +function getPanInfo({ point }, history) { + return { + point, + delta: subtractPoint(point, lastDevicePoint(history)), + offset: subtractPoint(point, startDevicePoint(history)), + velocity: getVelocity(history, 0.1), + }; +} +function startDevicePoint(history) { + return history[0]; +} +function lastDevicePoint(history) { + return history[history.length - 1]; +} +function getVelocity(history, timeDelta) { + if (history.length < 2) { + return { x: 0, y: 0 }; + } + let i = history.length - 1; + let timestampedPoint = null; + const lastPoint = lastDevicePoint(history); + while (i >= 0) { + timestampedPoint = history[i]; + if (lastPoint.timestamp - timestampedPoint.timestamp > + secondsToMilliseconds(timeDelta)) { + break; + } + i--; + } + if (!timestampedPoint) { + return { x: 0, y: 0 }; + } + /** + * If the selected point is the pointer-down origin (history[0]), + * there are better movement points available, and the time gap + * is suspiciously large (>2x timeDelta), use the next point instead. + * This prevents stale pointer-down points from diluting velocity + * in hold-then-flick gestures. + */ + if (timestampedPoint === history[0] && + history.length > 2 && + lastPoint.timestamp - timestampedPoint.timestamp > + secondsToMilliseconds(timeDelta) * 2) { + timestampedPoint = history[1]; + } + const time = millisecondsToSeconds(lastPoint.timestamp - timestampedPoint.timestamp); + if (time === 0) { + return { x: 0, y: 0 }; + } + const currentVelocity = { + x: (lastPoint.x - timestampedPoint.x) / time, + y: (lastPoint.y - timestampedPoint.y) / time, + }; + if (currentVelocity.x === Infinity) { + currentVelocity.x = 0; + } + if (currentVelocity.y === Infinity) { + currentVelocity.y = 0; + } + return currentVelocity; +} + +export { PanSession }; +//# sourceMappingURL=PanSession.mjs.map diff --git a/node_modules/framer-motion/dist/es/gestures/pan/PanSession.mjs.map b/node_modules/framer-motion/dist/es/gestures/pan/PanSession.mjs.map new file mode 100644 index 0000000..696b160 --- /dev/null +++ b/node_modules/framer-motion/dist/es/gestures/pan/PanSession.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"PanSession.mjs","sources":["../../../../src/gestures/pan/PanSession.ts"],"sourcesContent":["import type { EventInfo, PanHandler } from \"motion-dom\"\nimport { cancelFrame, frame, frameData, isPrimaryPointer } from \"motion-dom\"\nimport {\n millisecondsToSeconds,\n pipe,\n Point,\n secondsToMilliseconds,\n TransformPoint,\n} from \"motion-utils\"\nimport { addPointerEvent } from \"../../events/add-pointer-event\"\nimport { extractEventInfo } from \"../../events/event-info\"\nimport { distance2D } from \"../../utils/distance\"\n\ninterface PanSessionHandlers {\n onSessionStart: PanHandler\n onStart: PanHandler\n onMove: PanHandler\n onEnd: PanHandler\n onSessionEnd: PanHandler\n resumeAnimation: () => void\n}\n\ninterface PanSessionOptions {\n transformPagePoint?: TransformPoint\n dragSnapToOrigin?: boolean | \"x\" | \"y\"\n distanceThreshold?: number\n contextWindow?: (Window & typeof globalThis) | null\n /**\n * Element being dragged. When provided, scroll events on its\n * ancestors and window are compensated so the gesture continues\n * smoothly during scroll.\n */\n element?: HTMLElement | null\n}\n\ninterface TimestampedPoint extends Point {\n timestamp: number\n}\n\nconst overflowStyles = /*#__PURE__*/ new Set([\"auto\", \"scroll\"])\n\n/**\n * @internal\n */\nexport class PanSession {\n /**\n * @internal\n */\n private history: TimestampedPoint[]\n\n /**\n * @internal\n */\n private startEvent: PointerEvent | null = null\n\n /**\n * @internal\n */\n private lastMoveEvent: PointerEvent | null = null\n\n /**\n * @internal\n */\n private lastMoveEventInfo: EventInfo | null = null\n\n /**\n * Raw (untransformed) event info, re-transformed each frame\n * so transformPagePoint sees the current parent matrix.\n * @internal\n */\n private lastRawMoveEventInfo: EventInfo | null = null\n\n /**\n * @internal\n */\n private transformPagePoint?: TransformPoint\n\n /**\n * @internal\n */\n private handlers: Partial = {}\n\n /**\n * @internal\n */\n private removeListeners: Function\n\n /**\n * For determining if an animation should resume after it is interupted\n *\n * @internal\n */\n private dragSnapToOrigin: boolean | \"x\" | \"y\"\n\n /**\n * The distance after which panning should start.\n *\n * @internal\n */\n private distanceThreshold: number\n\n /**\n * @internal\n */\n private contextWindow: PanSessionOptions[\"contextWindow\"] = window\n\n /**\n * Scroll positions of scrollable ancestors and window.\n * @internal\n */\n private scrollPositions: Map = new Map()\n\n /**\n * Cleanup function for scroll listeners.\n * @internal\n */\n private removeScrollListeners: (() => void) | null = null\n\n constructor(\n event: PointerEvent,\n handlers: Partial,\n {\n transformPagePoint,\n contextWindow = window,\n dragSnapToOrigin = false,\n distanceThreshold = 3,\n element,\n }: PanSessionOptions = {}\n ) {\n // If we have more than one touch, don't start detecting this gesture\n if (!isPrimaryPointer(event)) return\n\n this.dragSnapToOrigin = dragSnapToOrigin\n this.handlers = handlers\n this.transformPagePoint = transformPagePoint\n this.distanceThreshold = distanceThreshold\n this.contextWindow = contextWindow || window\n\n const info = extractEventInfo(event)\n const initialInfo = transformPoint(info, this.transformPagePoint)\n const { point } = initialInfo\n\n const { timestamp } = frameData\n\n this.history = [{ ...point, timestamp }]\n\n const { onSessionStart } = handlers\n onSessionStart &&\n onSessionStart(event, getPanInfo(initialInfo, this.history))\n\n // Listen in the capture phase so a descendant calling\n // stopPropagation() (e.g. in its own pointerup handler) can't\n // prevent the gesture from ending. See #2794.\n const eventOptions = { passive: true, capture: true }\n this.removeListeners = pipe(\n addPointerEvent(\n this.contextWindow,\n \"pointermove\",\n this.handlePointerMove,\n eventOptions\n ),\n addPointerEvent(\n this.contextWindow,\n \"pointerup\",\n this.handlePointerUp,\n eventOptions\n ),\n addPointerEvent(\n this.contextWindow,\n \"pointercancel\",\n this.handlePointerUp,\n eventOptions\n )\n )\n\n // Start scroll tracking if element provided\n if (element) {\n this.startScrollTracking(element)\n }\n }\n\n /**\n * Start tracking scroll on ancestors and window.\n */\n private startScrollTracking(element: HTMLElement): void {\n // Store initial scroll positions for scrollable ancestors\n let current = element.parentElement\n while (current) {\n const style = getComputedStyle(current)\n if (\n overflowStyles.has(style.overflowX) ||\n overflowStyles.has(style.overflowY)\n ) {\n this.scrollPositions.set(current, {\n x: current.scrollLeft,\n y: current.scrollTop,\n })\n }\n current = current.parentElement\n }\n\n // Track window scroll\n this.scrollPositions.set(window, {\n x: window.scrollX,\n y: window.scrollY,\n })\n\n // Capture listener catches element scroll events as they bubble\n window.addEventListener(\"scroll\", this.onElementScroll, {\n capture: true,\n })\n\n // Direct window scroll listener (window scroll doesn't bubble)\n window.addEventListener(\"scroll\", this.onWindowScroll)\n\n this.removeScrollListeners = () => {\n window.removeEventListener(\"scroll\", this.onElementScroll, {\n capture: true,\n })\n window.removeEventListener(\"scroll\", this.onWindowScroll)\n }\n }\n\n private onElementScroll = (event: Event): void => {\n this.handleScroll(event.target as Element)\n }\n\n private onWindowScroll = (): void => {\n this.handleScroll(window)\n }\n\n /**\n * Handle scroll compensation during drag.\n *\n * For element scroll: adjusts history origin since pageX/pageY doesn't change.\n * For window scroll: adjusts lastMoveEventInfo since pageX/pageY would change.\n */\n private handleScroll(target: Element | Window): void {\n const initial = this.scrollPositions.get(target)\n if (!initial) return\n\n const isWindow = target === window\n const current = isWindow\n ? { x: window.scrollX, y: window.scrollY }\n : {\n x: (target as Element).scrollLeft,\n y: (target as Element).scrollTop,\n }\n\n const delta = { x: current.x - initial.x, y: current.y - initial.y }\n if (delta.x === 0 && delta.y === 0) return\n\n if (isWindow) {\n // Window scroll: pageX/pageY changes, so update lastMoveEventInfo\n if (this.lastMoveEventInfo) {\n this.lastMoveEventInfo.point.x += delta.x\n this.lastMoveEventInfo.point.y += delta.y\n }\n } else {\n // Element scroll: pageX/pageY unchanged, so adjust history origin\n if (this.history.length > 0) {\n this.history[0].x -= delta.x\n this.history[0].y -= delta.y\n }\n }\n\n this.scrollPositions.set(target, current)\n frame.update(this.updatePoint, true)\n }\n\n private updatePoint = () => {\n if (!(this.lastMoveEvent && this.lastMoveEventInfo)) return\n\n // Re-transform raw point through current transformPagePoint so\n // animated parent transforms (e.g. rotation) are picked up each frame\n if (this.lastRawMoveEventInfo) {\n this.lastMoveEventInfo = transformPoint(\n this.lastRawMoveEventInfo,\n this.transformPagePoint\n )\n }\n\n const info = getPanInfo(this.lastMoveEventInfo, this.history)\n const isPanStarted = this.startEvent !== null\n\n // Only start panning if the offset is larger than 3 pixels. If we make it\n // any larger than this we'll want to reset the pointer history\n // on the first update to avoid visual snapping to the cursor.\n const isDistancePastThreshold =\n distance2D(info.offset, { x: 0, y: 0 }) >= this.distanceThreshold\n\n if (!isPanStarted && !isDistancePastThreshold) return\n\n const { point } = info\n const { timestamp } = frameData\n this.history.push({ ...point, timestamp })\n\n const { onStart, onMove } = this.handlers\n\n if (!isPanStarted) {\n onStart && onStart(this.lastMoveEvent, info)\n this.startEvent = this.lastMoveEvent\n }\n\n onMove && onMove(this.lastMoveEvent, info)\n }\n\n private handlePointerMove = (event: PointerEvent, info: EventInfo) => {\n this.lastMoveEvent = event\n this.lastRawMoveEventInfo = info\n this.lastMoveEventInfo = transformPoint(info, this.transformPagePoint)\n\n // Throttle mouse move event to once per frame\n frame.update(this.updatePoint, true)\n }\n\n private handlePointerUp = (event: PointerEvent, info: EventInfo) => {\n this.end()\n\n const { onEnd, onSessionEnd, resumeAnimation } = this.handlers\n\n // Resume animation if dragSnapToOrigin is set OR if no drag started (user just clicked)\n // This ensures constraint animations continue when interrupted by a click\n if (this.dragSnapToOrigin || !this.startEvent) {\n resumeAnimation && resumeAnimation()\n }\n if (!(this.lastMoveEvent && this.lastMoveEventInfo)) return\n\n const panInfo = getPanInfo(\n event.type === \"pointercancel\"\n ? this.lastMoveEventInfo\n : transformPoint(info, this.transformPagePoint),\n this.history\n )\n\n if (this.startEvent && onEnd) {\n onEnd(event, panInfo)\n }\n\n onSessionEnd && onSessionEnd(event, panInfo)\n }\n\n updateHandlers(handlers: Partial) {\n this.handlers = handlers\n }\n\n end() {\n this.removeListeners && this.removeListeners()\n this.removeScrollListeners && this.removeScrollListeners()\n this.scrollPositions.clear()\n cancelFrame(this.updatePoint)\n }\n}\n\nfunction transformPoint(\n info: EventInfo,\n transformPagePoint?: (point: Point) => Point\n) {\n return transformPagePoint ? { point: transformPagePoint(info.point) } : info\n}\n\nfunction subtractPoint(a: Point, b: Point): Point {\n return { x: a.x - b.x, y: a.y - b.y }\n}\n\nfunction getPanInfo({ point }: EventInfo, history: TimestampedPoint[]) {\n return {\n point,\n delta: subtractPoint(point, lastDevicePoint(history)),\n offset: subtractPoint(point, startDevicePoint(history)),\n velocity: getVelocity(history, 0.1),\n }\n}\n\nfunction startDevicePoint(history: TimestampedPoint[]): TimestampedPoint {\n return history[0]\n}\n\nfunction lastDevicePoint(history: TimestampedPoint[]): TimestampedPoint {\n return history[history.length - 1]\n}\n\nfunction getVelocity(history: TimestampedPoint[], timeDelta: number): Point {\n if (history.length < 2) {\n return { x: 0, y: 0 }\n }\n\n let i = history.length - 1\n let timestampedPoint: TimestampedPoint | null = null\n const lastPoint = lastDevicePoint(history)\n while (i >= 0) {\n timestampedPoint = history[i]\n if (\n lastPoint.timestamp - timestampedPoint.timestamp >\n secondsToMilliseconds(timeDelta)\n ) {\n break\n }\n i--\n }\n\n if (!timestampedPoint) {\n return { x: 0, y: 0 }\n }\n\n /**\n * If the selected point is the pointer-down origin (history[0]),\n * there are better movement points available, and the time gap\n * is suspiciously large (>2x timeDelta), use the next point instead.\n * This prevents stale pointer-down points from diluting velocity\n * in hold-then-flick gestures.\n */\n if (\n timestampedPoint === history[0] &&\n history.length > 2 &&\n lastPoint.timestamp - timestampedPoint.timestamp >\n secondsToMilliseconds(timeDelta) * 2\n ) {\n timestampedPoint = history[1]\n }\n\n const time = millisecondsToSeconds(\n lastPoint.timestamp - timestampedPoint.timestamp\n )\n if (time === 0) {\n return { x: 0, y: 0 }\n }\n\n const currentVelocity = {\n x: (lastPoint.x - timestampedPoint.x) / time,\n y: (lastPoint.y - timestampedPoint.y) / time,\n }\n\n if (currentVelocity.x === Infinity) {\n currentVelocity.x = 0\n }\n if (currentVelocity.y === Infinity) {\n currentVelocity.y = 0\n }\n\n return currentVelocity\n}\n"],"names":[],"mappings":";;;;;;AAuCA,MAAM,cAAc,iBAAiB,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;AAEhE;;AAEG;MACU,UAAU,CAAA;IA0EnB,WAAA,CACI,KAAmB,EACnB,QAAqC,EACrC,EACI,kBAAkB,EAClB,aAAa,GAAG,MAAM,EACtB,gBAAgB,GAAG,KAAK,EACxB,iBAAiB,GAAG,CAAC,EACrB,OAAO,GAAA,GACY,EAAE,EAAA;AA7E7B;;AAEG;QACK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AAI,GAAG,qBAAqB,CAC9B,SAAS,CAAC,SAAS,GAAG,gBAAgB,CAAC,SAAS,CACnD;AACD,IAAA,IAAI,IAAI,KAAK,CAAC,EAAE;QACZ,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;IACzB;AAEA,IAAA,MAAM,eAAe,GAAG;QACpB,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,GAAG,gBAAgB,CAAC,CAAC,IAAI,IAAI;QAC5C,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,GAAG,gBAAgB,CAAC,CAAC,IAAI,IAAI;KAC/C;AAED,IAAA,IAAI,eAAe,CAAC,CAAC,KAAK,QAAQ,EAAE;AAChC,QAAA,eAAe,CAAC,CAAC,GAAG,CAAC;IACzB;AACA,IAAA,IAAI,eAAe,CAAC,CAAC,KAAK,QAAQ,EAAE;AAChC,QAAA,eAAe,CAAC,CAAC,GAAG,CAAC;IACzB;AAEA,IAAA,OAAO,eAAe;AAC1B;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/gestures/pan/index.mjs b/node_modules/framer-motion/dist/es/gestures/pan/index.mjs new file mode 100644 index 0000000..e0b1c17 --- /dev/null +++ b/node_modules/framer-motion/dist/es/gestures/pan/index.mjs @@ -0,0 +1,50 @@ +import { Feature, frame } from 'motion-dom'; +import { noop } from 'motion-utils'; +import { addPointerEvent } from '../../events/add-pointer-event.mjs'; +import { getContextWindow } from '../../utils/get-context-window.mjs'; +import { PanSession } from './PanSession.mjs'; + +const asyncHandler = (handler) => (event, info) => { + if (handler) { + frame.update(() => handler(event, info), false, true); + } +}; +class PanGesture extends Feature { + constructor() { + super(...arguments); + this.removePointerDownListener = noop; + } + onPointerDown(pointerDownEvent) { + this.session = new PanSession(pointerDownEvent, this.createPanHandlers(), { + transformPagePoint: this.node.getTransformPagePoint(), + contextWindow: getContextWindow(this.node), + }); + } + createPanHandlers() { + const { onPanSessionStart, onPanStart, onPan, onPanEnd } = this.node.getProps(); + return { + onSessionStart: asyncHandler(onPanSessionStart), + onStart: asyncHandler(onPanStart), + onMove: asyncHandler(onPan), + onEnd: (event, info) => { + delete this.session; + if (onPanEnd) { + frame.postRender(() => onPanEnd(event, info)); + } + }, + }; + } + mount() { + this.removePointerDownListener = addPointerEvent(this.node.current, "pointerdown", (event) => this.onPointerDown(event)); + } + update() { + this.session && this.session.updateHandlers(this.createPanHandlers()); + } + unmount() { + this.removePointerDownListener(); + this.session && this.session.end(); + } +} + +export { PanGesture }; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/framer-motion/dist/es/gestures/pan/index.mjs.map b/node_modules/framer-motion/dist/es/gestures/pan/index.mjs.map new file mode 100644 index 0000000..cd1cdc0 --- /dev/null +++ b/node_modules/framer-motion/dist/es/gestures/pan/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../../../../src/gestures/pan/index.ts"],"sourcesContent":["import { Feature, frame, type PanInfo } from \"motion-dom\"\nimport { noop } from \"motion-utils\"\nimport { addPointerEvent } from \"../../events/add-pointer-event\"\nimport { getContextWindow } from \"../../utils/get-context-window\"\nimport { PanSession } from \"./PanSession\"\n\ntype PanEventHandler = (event: PointerEvent, info: PanInfo) => void\nconst asyncHandler =\n (handler?: PanEventHandler) => (event: PointerEvent, info: PanInfo) => {\n if (handler) {\n frame.update(() => handler(event, info), false, true)\n }\n }\n\nexport class PanGesture extends Feature {\n private session?: PanSession\n\n private removePointerDownListener: Function = noop\n\n onPointerDown(pointerDownEvent: PointerEvent) {\n this.session = new PanSession(\n pointerDownEvent,\n this.createPanHandlers(),\n {\n transformPagePoint: this.node.getTransformPagePoint(),\n contextWindow: getContextWindow(this.node),\n }\n )\n }\n\n createPanHandlers() {\n const { onPanSessionStart, onPanStart, onPan, onPanEnd } =\n this.node.getProps()\n\n return {\n onSessionStart: asyncHandler(onPanSessionStart),\n onStart: asyncHandler(onPanStart),\n onMove: asyncHandler(onPan),\n onEnd: (event: PointerEvent, info: PanInfo) => {\n delete this.session\n if (onPanEnd) {\n frame.postRender(() => onPanEnd(event, info))\n }\n },\n }\n }\n\n mount() {\n this.removePointerDownListener = addPointerEvent(\n this.node.current!,\n \"pointerdown\",\n (event: PointerEvent) => this.onPointerDown(event)\n )\n }\n\n update() {\n this.session && this.session.updateHandlers(this.createPanHandlers())\n }\n\n unmount() {\n this.removePointerDownListener()\n this.session && this.session.end()\n }\n}\n"],"names":[],"mappings":";;;;;;AAOA,MAAM,YAAY,GACd,CAAC,OAAyB,KAAK,CAAC,KAAmB,EAAE,IAAa,KAAI;IAClE,IAAI,OAAO,EAAE;AACT,QAAA,KAAK,CAAC,MAAM,CAAC,MAAM,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC;IACzD;AACJ,CAAC;AAEC,MAAO,UAAW,SAAQ,OAAgB,CAAA;AAAhD,IAAA,WAAA,GAAA;;QAGY,IAAA,CAAA,yBAAyB,GAAa,IAAI;IA8CtD;AA5CI,IAAA,aAAa,CAAC,gBAA8B,EAAA;AACxC,QAAA,IAAI,CAAC,OAAO,GAAG,IAAI,UAAU,CACzB,gBAAgB,EAChB,IAAI,CAAC,iBAAiB,EAAE,EACxB;AACI,YAAA,kBAAkB,EAAE,IAAI,CAAC,IAAI,CAAC,qBAAqB,EAAE;AACrD,YAAA,aAAa,EAAE,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC;AAC7C,SAAA,CACJ;IACL;IAEA,iBAAiB,GAAA;AACb,QAAA,MAAM,EAAE,iBAAiB,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,GACpD,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;QAExB,OAAO;AACH,YAAA,cAAc,EAAE,YAAY,CAAC,iBAAiB,CAAC;AAC/C,YAAA,OAAO,EAAE,YAAY,CAAC,UAAU,CAAC;AACjC,YAAA,MAAM,EAAE,YAAY,CAAC,KAAK,CAAC;AAC3B,YAAA,KAAK,EAAE,CAAC,KAAmB,EAAE,IAAa,KAAI;gBAC1C,OAAO,IAAI,CAAC,OAAO;gBACnB,IAAI,QAAQ,EAAE;AACV,oBAAA,KAAK,CAAC,UAAU,CAAC,MAAM,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;gBACjD;YACJ,CAAC;SACJ;IACL;IAEA,KAAK,GAAA;QACD,IAAI,CAAC,yBAAyB,GAAG,eAAe,CAC5C,IAAI,CAAC,IAAI,CAAC,OAAQ,EAClB,aAAa,EACb,CAAC,KAAmB,KAAK,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CACrD;IACL;IAEA,MAAM,GAAA;AACF,QAAA,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,iBAAiB,EAAE,CAAC;IACzE;IAEA,OAAO,GAAA;QACH,IAAI,CAAC,yBAAyB,EAAE;QAChC,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;IACtC;AACH;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/gestures/press.mjs b/node_modules/framer-motion/dist/es/gestures/press.mjs new file mode 100644 index 0000000..45b99a2 --- /dev/null +++ b/node_modules/framer-motion/dist/es/gestures/press.mjs @@ -0,0 +1,36 @@ +import { Feature, press, frame } from 'motion-dom'; +import { extractEventInfo } from '../events/event-info.mjs'; + +function handlePressEvent(node, event, lifecycle) { + const { props } = node; + if (node.current instanceof HTMLButtonElement && node.current.disabled) { + return; + } + if (node.animationState && props.whileTap) { + node.animationState.setActive("whileTap", lifecycle === "Start"); + } + const eventName = ("onTap" + (lifecycle === "End" ? "" : lifecycle)); + const callback = props[eventName]; + if (callback) { + frame.postRender(() => callback(event, extractEventInfo(event))); + } +} +class PressGesture extends Feature { + mount() { + const { current } = this.node; + if (!current) + return; + const { globalTapTarget, propagate } = this.node.props; + this.unmount = press(current, (_element, startEvent) => { + handlePressEvent(this.node, startEvent, "Start"); + return (endEvent, { success }) => handlePressEvent(this.node, endEvent, success ? "End" : "Cancel"); + }, { + useGlobalTarget: globalTapTarget, + stopPropagation: propagate?.tap === false, + }); + } + unmount() { } +} + +export { PressGesture }; +//# sourceMappingURL=press.mjs.map diff --git a/node_modules/framer-motion/dist/es/gestures/press.mjs.map b/node_modules/framer-motion/dist/es/gestures/press.mjs.map new file mode 100644 index 0000000..9719e26 --- /dev/null +++ b/node_modules/framer-motion/dist/es/gestures/press.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"press.mjs","sources":["../../../src/gestures/press.ts"],"sourcesContent":["import { Feature, frame, press, type VisualElement } from \"motion-dom\"\nimport { extractEventInfo } from \"../events/event-info\"\n\nfunction handlePressEvent(\n node: VisualElement,\n event: PointerEvent,\n lifecycle: \"Start\" | \"End\" | \"Cancel\"\n) {\n const { props } = node\n\n if (node.current instanceof HTMLButtonElement && node.current.disabled) {\n return\n }\n\n if (node.animationState && props.whileTap) {\n node.animationState.setActive(\"whileTap\", lifecycle === \"Start\")\n }\n\n const eventName = (\"onTap\" + (lifecycle === \"End\" ? \"\" : lifecycle)) as\n | \"onTapStart\"\n | \"onTap\"\n | \"onTapCancel\"\n\n const callback = props[eventName]\n if (callback) {\n frame.postRender(() => callback(event, extractEventInfo(event)))\n }\n}\n\nexport class PressGesture extends Feature {\n mount() {\n const { current } = this.node\n if (!current) return\n\n const { globalTapTarget, propagate } = this.node.props\n\n this.unmount = press(\n current,\n (_element, startEvent) => {\n handlePressEvent(this.node, startEvent, \"Start\")\n\n return (endEvent, { success }) =>\n handlePressEvent(\n this.node,\n endEvent,\n success ? \"End\" : \"Cancel\"\n )\n },\n {\n useGlobalTarget: globalTapTarget,\n stopPropagation: propagate?.tap === false,\n }\n )\n }\n\n unmount() {}\n}\n"],"names":[],"mappings":";;;AAGA,SAAS,gBAAgB,CACrB,IAA4B,EAC5B,KAAmB,EACnB,SAAqC,EAAA;AAErC,IAAA,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI;AAEt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;AACd;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/index.mjs b/node_modules/framer-motion/dist/es/index.mjs new file mode 100644 index 0000000..94ee439 --- /dev/null +++ b/node_modules/framer-motion/dist/es/index.mjs @@ -0,0 +1,79 @@ +export { AnimatePresence } from './components/AnimatePresence/index.mjs'; +export { PopChild } from './components/AnimatePresence/PopChild.mjs'; +export { PresenceChild } from './components/AnimatePresence/PresenceChild.mjs'; +export { LayoutGroup } from './components/LayoutGroup/index.mjs'; +export { LazyMotion } from './components/LazyMotion/index.mjs'; +export { MotionConfig } from './components/MotionConfig/index.mjs'; +export { m } from './render/components/m/proxy.mjs'; +export { motion } from './render/components/motion/proxy.mjs'; +export { addPointerEvent } from './events/add-pointer-event.mjs'; +export { addPointerInfo } from './events/event-info.mjs'; +export { animations } from './motion/features/animations.mjs'; +export { makeUseVisualState } from './motion/utils/use-visual-state.mjs'; +export * from 'motion-dom'; +export { VisualElement, addScaleCorrector, animateVisualElement, arc, buildTransform, calcLength, createBox, delay, optimizedAppearDataAttribute, resolveMotionValue, visualElementStore } from 'motion-dom'; +export { filterProps } from './render/dom/utils/filter-props.mjs'; +export { isBrowser } from './utils/is-browser.mjs'; +export { useComposedRefs } from './utils/use-composed-ref.mjs'; +export { useForceUpdate } from './utils/use-force-update.mjs'; +export { useIsomorphicLayoutEffect } from './utils/use-isomorphic-effect.mjs'; +export { useUnmountEffect } from './utils/use-unmount-effect.mjs'; +export { domAnimation } from './render/dom/features-animation.mjs'; +export { domMax } from './render/dom/features-max.mjs'; +export { domMin } from './render/dom/features-min.mjs'; +export { useMotionValueEvent } from './utils/use-motion-value-event.mjs'; +export { useElementScroll } from './value/scroll/use-element-scroll.mjs'; +export { useViewportScroll } from './value/scroll/use-viewport-scroll.mjs'; +export { useMotionTemplate } from './value/use-motion-template.mjs'; +export { useMotionValue } from './value/use-motion-value.mjs'; +export { useScroll } from './value/use-scroll.mjs'; +export { useFollowValue } from './value/use-follow-value.mjs'; +export { useSpring } from './value/use-spring.mjs'; +export { useTime } from './value/use-time.mjs'; +export { useTransform } from './value/use-transform.mjs'; +export { useVelocity } from './value/use-velocity.mjs'; +export { useWillChange } from './value/use-will-change/index.mjs'; +export { WillChangeMotionValue } from './value/use-will-change/WillChangeMotionValue.mjs'; +export { useReducedMotion } from './utils/reduced-motion/use-reduced-motion.mjs'; +export { useReducedMotionConfig } from './utils/reduced-motion/use-reduced-motion-config.mjs'; +export * from 'motion-utils'; +export { MotionGlobalConfig } from 'motion-utils'; +export { animationControls } from './animation/hooks/animation-controls.mjs'; +export { useAnimate } from './animation/hooks/use-animate.mjs'; +export { useAnimateMini } from './animation/hooks/use-animate-style.mjs'; +export { useAnimation, useAnimationControls } from './animation/hooks/use-animation.mjs'; +export { useIsPresent, usePresence } from './components/AnimatePresence/use-presence.mjs'; +export { usePresenceData } from './components/AnimatePresence/use-presence-data.mjs'; +export { useDomEvent } from './events/use-dom-event.mjs'; +export { DragControls, useDragControls } from './gestures/drag/use-drag-controls.mjs'; +export { isMotionComponent } from './motion/utils/is-motion-component.mjs'; +export { unwrapMotionComponent } from './motion/utils/unwrap-motion-component.mjs'; +export { isValidMotionProp } from './motion/utils/valid-prop.mjs'; +export { useInstantLayoutTransition } from './projection/use-instant-layout-transition.mjs'; +export { useResetProjection } from './projection/use-reset-projection.mjs'; +export { useAnimationFrame } from './utils/use-animation-frame.mjs'; +export { useCycle } from './utils/use-cycle.mjs'; +export { useInView } from './utils/use-in-view.mjs'; +export { disableInstantTransitions, useInstantTransition } from './utils/use-instant-transition.mjs'; +export { usePageInView } from './utils/use-page-in-view.mjs'; +export { transformViewBoxPoint } from './utils/transform-viewbox-point.mjs'; +export { correctParentTransform } from './utils/transform-rotated-parent.mjs'; +export { startOptimizedAppearAnimation } from './animation/optimized-appear/start.mjs'; +export { LayoutGroupContext } from './context/LayoutGroupContext.mjs'; +export { MotionConfigContext } from './context/MotionConfigContext.mjs'; +export { MotionContext } from './context/MotionContext/index.mjs'; +export { PresenceContext } from './context/PresenceContext.mjs'; +export { SwitchLayoutGroupContext } from './context/SwitchLayoutGroupContext.mjs'; +export { useAnimatedState as useDeprecatedAnimatedState } from './animation/hooks/use-animated-state.mjs'; +export { AnimateSharedLayout } from './components/AnimateSharedLayout.mjs'; +export { DeprecatedLayoutGroupContext } from './context/DeprecatedLayoutGroupContext.mjs'; +export { useInvertedScale as useDeprecatedInvertedScale } from './value/use-inverted-scale.mjs'; +import * as namespace from './components/Reorder/namespace.mjs'; +export { namespace as Reorder }; +export { animate, createScopedAnimate } from './animation/animate/index.mjs'; +export { animateMini } from './animation/animators/waapi/animate-style.mjs'; +export { distance, distance2D } from './utils/distance.mjs'; +export { inView } from './render/dom/viewport/index.mjs'; +export { scroll } from './render/dom/scroll/index.mjs'; +export { scrollInfo } from './render/dom/scroll/track.mjs'; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/framer-motion/dist/es/index.mjs.map b/node_modules/framer-motion/dist/es/index.mjs.map new file mode 100644 index 0000000..b28b640 --- /dev/null +++ b/node_modules/framer-motion/dist/es/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/m.mjs b/node_modules/framer-motion/dist/es/m.mjs new file mode 100644 index 0000000..2539355 --- /dev/null +++ b/node_modules/framer-motion/dist/es/m.mjs @@ -0,0 +1,3 @@ +export { MotionA as a, MotionAbbr as abbr, MotionAddress as address, MotionAnimate as animate, MotionArea as area, MotionArticle as article, MotionAside as aside, MotionAudio as audio, MotionB as b, MotionBase as base, MotionBdi as bdi, MotionBdo as bdo, MotionBig as big, MotionBlockquote as blockquote, MotionBody as body, MotionButton as button, MotionCanvas as canvas, MotionCaption as caption, MotionCircle as circle, MotionCite as cite, MotionClipPath as clipPath, MotionCode as code, MotionCol as col, MotionColgroup as colgroup, MotionData as data, MotionDatalist as datalist, MotionDd as dd, MotionDefs as defs, MotionDel as del, MotionDesc as desc, MotionDetails as details, MotionDfn as dfn, MotionDialog as dialog, MotionDiv as div, MotionDl as dl, MotionDt as dt, MotionEllipse as ellipse, MotionEm as em, MotionEmbed as embed, MotionFeBlend as feBlend, MotionFeColorMatrix as feColorMatrix, MotionFeComponentTransfer as feComponentTransfer, MotionFeComposite as feComposite, MotionFeConvolveMatrix as feConvolveMatrix, MotionFeDiffuseLighting as feDiffuseLighting, MotionFeDisplacementMap as feDisplacementMap, MotionFeDistantLight as feDistantLight, MotionFeDropShadow as feDropShadow, MotionFeFlood as feFlood, MotionFeFuncA as feFuncA, MotionFeFuncB as feFuncB, MotionFeFuncG as feFuncG, MotionFeFuncR as feFuncR, MotionFeGaussianBlur as feGaussianBlur, MotionFeImage as feImage, MotionFeMerge as feMerge, MotionFeMergeNode as feMergeNode, MotionFeMorphology as feMorphology, MotionFeOffset as feOffset, MotionFePointLight as fePointLight, MotionFeSpecularLighting as feSpecularLighting, MotionFeSpotLight as feSpotLight, MotionFeTile as feTile, MotionFeTurbulence as feTurbulence, MotionFieldset as fieldset, MotionFigcaption as figcaption, MotionFigure as figure, MotionFilter as filter, MotionFooter as footer, MotionForeignObject as foreignObject, MotionForm as form, MotionG as g, MotionH1 as h1, MotionH2 as h2, MotionH3 as h3, MotionH4 as h4, MotionH5 as h5, MotionH6 as h6, MotionHead as head, MotionHeader as header, MotionHgroup as hgroup, MotionHr as hr, MotionHtml as html, MotionI as i, MotionIframe as iframe, MotionImage as image, MotionImg as img, MotionInput as input, MotionIns as ins, MotionKbd as kbd, MotionKeygen as keygen, MotionLabel as label, MotionLegend as legend, MotionLi as li, MotionLine as line, MotionLinearGradient as linearGradient, MotionLink as link, MotionMain as main, MotionMap as map, MotionMark as mark, MotionMarker as marker, MotionMask as mask, MotionMenu as menu, MotionMenuitem as menuitem, MotionMetadata as metadata, MotionMeter as meter, MotionNav as nav, MotionObject as object, MotionOl as ol, MotionOptgroup as optgroup, MotionOption as option, MotionOutput as output, MotionP as p, MotionParam as param, MotionPath as path, MotionPattern as pattern, MotionPicture as picture, MotionPolygon as polygon, MotionPolyline as polyline, MotionPre as pre, MotionProgress as progress, MotionQ as q, MotionRadialGradient as radialGradient, MotionRect as rect, MotionRp as rp, MotionRt as rt, MotionRuby as ruby, MotionS as s, MotionSamp as samp, MotionScript as script, MotionSection as section, MotionSelect as select, MotionSmall as small, MotionSource as source, MotionSpan as span, MotionStop as stop, MotionStrong as strong, MotionStyle as style, MotionSub as sub, MotionSummary as summary, MotionSup as sup, MotionSvg as svg, MotionSymbol as symbol, MotionTable as table, MotionTbody as tbody, MotionTd as td, MotionText as text, MotionTextPath as textPath, MotionTextarea as textarea, MotionTfoot as tfoot, MotionTh as th, MotionThead as thead, MotionTime as time, MotionTitle as title, MotionTr as tr, MotionTrack as track, MotionTspan as tspan, MotionU as u, MotionUl as ul, MotionUse as use, MotionVideo as video, MotionView as view, MotionWbr as wbr, MotionWebview as webview } from './render/components/m/elements.mjs'; +export { createMinimalMotionComponent as create } from './render/components/m/create.mjs'; +//# sourceMappingURL=m.mjs.map diff --git a/node_modules/framer-motion/dist/es/m.mjs.map b/node_modules/framer-motion/dist/es/m.mjs.map new file mode 100644 index 0000000..af0ce5d --- /dev/null +++ b/node_modules/framer-motion/dist/es/m.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"m.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/mini.mjs b/node_modules/framer-motion/dist/es/mini.mjs new file mode 100644 index 0000000..b620a1f --- /dev/null +++ b/node_modules/framer-motion/dist/es/mini.mjs @@ -0,0 +1,2 @@ +export { useAnimateMini as useAnimate } from './animation/hooks/use-animate-style.mjs'; +//# sourceMappingURL=mini.mjs.map diff --git a/node_modules/framer-motion/dist/es/mini.mjs.map b/node_modules/framer-motion/dist/es/mini.mjs.map new file mode 100644 index 0000000..d146aa0 --- /dev/null +++ b/node_modules/framer-motion/dist/es/mini.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"mini.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/motion/features/animation/exit.mjs b/node_modules/framer-motion/dist/es/motion/features/animation/exit.mjs new file mode 100644 index 0000000..2519f77 --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/features/animation/exit.mjs @@ -0,0 +1,70 @@ +import { Feature, resolveVariant } from 'motion-dom'; + +let id = 0; +class ExitAnimationFeature extends Feature { + constructor() { + super(...arguments); + this.id = id++; + this.isExitComplete = false; + } + update() { + if (!this.node.presenceContext) + return; + const { isPresent, onExitComplete } = this.node.presenceContext; + const { isPresent: prevIsPresent } = this.node.prevPresenceContext || {}; + if (!this.node.animationState || isPresent === prevIsPresent) { + return; + } + if (isPresent && prevIsPresent === false) { + /** + * When re-entering, if the exit animation already completed + * (element is at rest), reset to initial values so the enter + * animation replays from the correct position. + */ + if (this.isExitComplete) { + const { initial, custom } = this.node.getProps(); + if (typeof initial === "string" || + (typeof initial === "object" && + initial !== null && + !Array.isArray(initial))) { + const resolved = resolveVariant(this.node, initial, custom); + if (resolved) { + const { transition, transitionEnd, ...target } = resolved; + for (const key in target) { + this.node + .getValue(key) + ?.jump(target[key]); + } + } + } + this.node.animationState.reset(); + this.node.animationState.animateChanges(); + } + else { + this.node.animationState.setActive("exit", false); + } + this.isExitComplete = false; + return; + } + const exitAnimation = this.node.animationState.setActive("exit", !isPresent); + if (onExitComplete && !isPresent) { + exitAnimation.then(() => { + this.isExitComplete = true; + onExitComplete(this.id); + }); + } + } + mount() { + const { register, onExitComplete } = this.node.presenceContext || {}; + if (onExitComplete) { + onExitComplete(this.id); + } + if (register) { + this.unmount = register(this.id); + } + } + unmount() { } +} + +export { ExitAnimationFeature }; +//# sourceMappingURL=exit.mjs.map diff --git a/node_modules/framer-motion/dist/es/motion/features/animation/exit.mjs.map b/node_modules/framer-motion/dist/es/motion/features/animation/exit.mjs.map new file mode 100644 index 0000000..7894c0e --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/features/animation/exit.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"exit.mjs","sources":["../../../../../src/motion/features/animation/exit.ts"],"sourcesContent":["import { Feature, resolveVariant } from \"motion-dom\"\n\nlet id = 0\n\nexport class ExitAnimationFeature extends Feature {\n private id: number = id++\n private isExitComplete = false\n\n update() {\n if (!this.node.presenceContext) return\n\n const { isPresent, onExitComplete } = this.node.presenceContext\n const { isPresent: prevIsPresent } = this.node.prevPresenceContext || {}\n\n if (!this.node.animationState || isPresent === prevIsPresent) {\n return\n }\n\n if (isPresent && prevIsPresent === false) {\n /**\n * When re-entering, if the exit animation already completed\n * (element is at rest), reset to initial values so the enter\n * animation replays from the correct position.\n */\n if (this.isExitComplete) {\n const { initial, custom } = this.node.getProps()\n\n if (\n typeof initial === \"string\" ||\n (typeof initial === \"object\" &&\n initial !== null &&\n !Array.isArray(initial))\n ) {\n const resolved = resolveVariant(\n this.node,\n initial,\n custom\n )\n if (resolved) {\n const { transition, transitionEnd, ...target } =\n resolved\n for (const key in target) {\n this.node\n .getValue(key)\n ?.jump(\n target[\n key as keyof typeof target\n ] as any\n )\n }\n }\n }\n\n this.node.animationState.reset()\n this.node.animationState.animateChanges()\n } else {\n this.node.animationState.setActive(\"exit\", false)\n }\n\n this.isExitComplete = false\n return\n }\n\n const exitAnimation = this.node.animationState.setActive(\n \"exit\",\n !isPresent\n )\n\n if (onExitComplete && !isPresent) {\n exitAnimation.then(() => {\n this.isExitComplete = true\n onExitComplete(this.id)\n })\n }\n }\n\n mount() {\n const { register, onExitComplete } = this.node.presenceContext || {}\n\n if (onExitComplete) {\n onExitComplete(this.id)\n }\n\n if (register) {\n this.unmount = register(this.id)\n }\n }\n\n unmount() {}\n}\n"],"names":[],"mappings":";;AAEA,IAAI,EAAE,GAAG,CAAC;AAEJ,MAAO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A,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE;AAChC,gBAAA,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,cAAc,EAAE;YAC7C;iBAAO;gBACH,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,MAAM,EAAE,KAAK,CAAC;YACrD;AAEA,YAAA,IAAI,CAAC,cAAc,GAAG,KAAK;YAC3B;QACJ;AAEA,QAAA,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,SAAS,CACpD,MAAM,EACN,CAAC,SAAS,CACb;AAED,QAAA,IAAI,cAAc,IAAI,CAAC,SAAS,EAAE;AAC9B,YAAA,aAAa,CAAC,IAAI,CAAC,MAAK;AACpB,gBAAA,IAAI,CAAC,cAAc,GAAG,IAAI;AAC1B,gBAAA,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC;AAC3B,YAAA,CAAC,CAAC;QACN;IACJ;IAEA,KAAK,GAAA;AACD,QAAA,MAAM,EAAE,QAAQ,EAAE,cAAc,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,eAAe,IAAI,EAAE;QAEpE,IAAI,cAAc,EAAE;AAChB,YAAA,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC;QAC3B;QAEA,IAAI,QAAQ,EAAE;YACV,IAAI,CAAC,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;QACpC;IACJ;AAEA,IAAA,OAAO,KAAI;AACd;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/motion/features/animation/index.mjs b/node_modules/framer-motion/dist/es/motion/features/animation/index.mjs new file mode 100644 index 0000000..be9a9ec --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/features/animation/index.mjs @@ -0,0 +1,39 @@ +import { Feature, createAnimationState, isAnimationControls } from 'motion-dom'; + +class AnimationFeature extends Feature { + /** + * We dynamically generate the AnimationState manager as it contains a reference + * to the underlying animation library. We only want to load that if we load this, + * so people can optionally code split it out using the `m` component. + */ + constructor(node) { + super(node); + node.animationState || (node.animationState = createAnimationState(node)); + } + updateAnimationControlsSubscription() { + const { animate } = this.node.getProps(); + if (isAnimationControls(animate)) { + this.unmountControls = animate.subscribe(this.node); + } + } + /** + * Subscribe any provided AnimationControls to the component's VisualElement + */ + mount() { + this.updateAnimationControlsSubscription(); + } + update() { + const { animate } = this.node.getProps(); + const { animate: prevAnimate } = this.node.prevProps || {}; + if (animate !== prevAnimate) { + this.updateAnimationControlsSubscription(); + } + } + unmount() { + this.node.animationState.reset(); + this.unmountControls?.(); + } +} + +export { AnimationFeature }; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/framer-motion/dist/es/motion/features/animation/index.mjs.map b/node_modules/framer-motion/dist/es/motion/features/animation/index.mjs.map new file mode 100644 index 0000000..e4623fc --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/features/animation/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../../../../../src/motion/features/animation/index.ts"],"sourcesContent":["import {\n createAnimationState,\n Feature,\n isAnimationControls,\n type VisualElement,\n} from \"motion-dom\"\n\nexport class AnimationFeature extends Feature {\n unmountControls?: () => void\n\n /**\n * We dynamically generate the AnimationState manager as it contains a reference\n * to the underlying animation library. We only want to load that if we load this,\n * so people can optionally code split it out using the `m` component.\n */\n constructor(node: VisualElement) {\n super(node)\n node.animationState ||= createAnimationState(node)\n }\n\n updateAnimationControlsSubscription() {\n const { animate } = this.node.getProps()\n if (isAnimationControls(animate)) {\n this.unmountControls = animate.subscribe(this.node)\n }\n }\n\n /**\n * Subscribe any provided AnimationControls to the component's VisualElement\n */\n mount() {\n this.updateAnimationControlsSubscription()\n }\n\n update() {\n const { animate } = this.node.getProps()\n const { animate: prevAnimate } = this.node.prevProps || {}\n if (animate !== prevAnimate) {\n this.updateAnimationControlsSubscription()\n }\n }\n\n unmount() {\n this.node.animationState!.reset()\n this.unmountControls?.()\n }\n}\n"],"names":[],"mappings":";;AAOM,MAAO,gBAAiB,SAAQ,OAAgB,CAAA;AAGlD;;;;AAIG;AACH,IAAA,WAAA,CAAY,IAAmB,EAAA;QAC3B,KAAK,CAAC,IAAI,CAAC;QACX,IAAI,CAAC,cAAc,KAAnB,IAAI,CAAC,cAAc,GAAK,oBAAoB,CAAC,IAAI,CAAC,CAAA;IACtD;IAEA,mCAAmC,GAAA;QAC/B,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;AACxC,QAAA,IAAI,mBAAmB,CAAC,OAAO,CAAC,EAAE;YAC9B,IAAI,CAAC,eAAe,GAAG,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC;QACvD;IACJ;AAEA;;AAEG;IACH,KAAK,GAAA;QACD,IAAI,CAAC,mCAAmC,EAAE;IAC9C;IAEA,MAAM,GAAA;QACF,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;AACxC,QAAA,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,IAAI,EAAE;AAC1D,QAAA,IAAI,OAAO,KAAK,WAAW,EAAE;YACzB,IAAI,CAAC,mCAAmC,EAAE;QAC9C;IACJ;IAEA,OAAO,GAAA;AACH,QAAA,IAAI,CAAC,IAAI,CAAC,cAAe,CAAC,KAAK,EAAE;AACjC,QAAA,IAAI,CAAC,eAAe,IAAI;IAC5B;AACH;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/motion/features/animations.mjs b/node_modules/framer-motion/dist/es/motion/features/animations.mjs new file mode 100644 index 0000000..0746a48 --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/features/animations.mjs @@ -0,0 +1,14 @@ +import { AnimationFeature } from './animation/index.mjs'; +import { ExitAnimationFeature } from './animation/exit.mjs'; + +const animations = { + animation: { + Feature: AnimationFeature, + }, + exit: { + Feature: ExitAnimationFeature, + }, +}; + +export { animations }; +//# sourceMappingURL=animations.mjs.map diff --git a/node_modules/framer-motion/dist/es/motion/features/animations.mjs.map b/node_modules/framer-motion/dist/es/motion/features/animations.mjs.map new file mode 100644 index 0000000..8476c44 --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/features/animations.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"animations.mjs","sources":["../../../../src/motion/features/animations.ts"],"sourcesContent":["import { AnimationFeature } from \"./animation\"\nimport { ExitAnimationFeature } from \"./animation/exit\"\nimport { FeaturePackages } from \"./types\"\n\nexport const animations: FeaturePackages = {\n animation: {\n Feature: AnimationFeature,\n },\n exit: {\n Feature: ExitAnimationFeature,\n },\n}\n"],"names":[],"mappings":";;;AAIO,MAAM,UAAU,GAAoB;AACvC,IAAA,SAAS,EAAE;AACP,QAAA,OAAO,EAAE,gBAAgB;AAC5B,KAAA;AACD,IAAA,IAAI,EAAE;AACF,QAAA,OAAO,EAAE,oBAAoB;AAChC,KAAA;;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/motion/features/definitions.mjs b/node_modules/framer-motion/dist/es/motion/features/definitions.mjs new file mode 100644 index 0000000..e3293b6 --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/features/definitions.mjs @@ -0,0 +1,49 @@ +import { getFeatureDefinitions, setFeatureDefinitions } from 'motion-dom'; + +const featureProps = { + animation: [ + "animate", + "variants", + "whileHover", + "whileTap", + "exit", + "whileInView", + "whileFocus", + "whileDrag", + ], + exit: ["exit"], + drag: ["drag", "dragControls"], + focus: ["whileFocus"], + hover: ["whileHover", "onHoverStart", "onHoverEnd"], + tap: ["whileTap", "onTap", "onTapStart", "onTapCancel"], + pan: ["onPan", "onPanStart", "onPanSessionStart", "onPanEnd"], + inView: ["whileInView", "onViewportEnter", "onViewportLeave"], + layout: ["layout", "layoutId"], +}; +let isInitialized = false; +/** + * Initialize feature definitions with isEnabled checks. + * This must be called before any motion components are rendered. + */ +function initFeatureDefinitions() { + if (isInitialized) + return; + const initialFeatureDefinitions = {}; + for (const key in featureProps) { + initialFeatureDefinitions[key] = { + isEnabled: (props) => featureProps[key].some((name) => !!props[name]), + }; + } + setFeatureDefinitions(initialFeatureDefinitions); + isInitialized = true; +} +/** + * Get the current feature definitions, initializing if needed. + */ +function getInitializedFeatureDefinitions() { + initFeatureDefinitions(); + return getFeatureDefinitions(); +} + +export { getInitializedFeatureDefinitions, initFeatureDefinitions }; +//# sourceMappingURL=definitions.mjs.map diff --git a/node_modules/framer-motion/dist/es/motion/features/definitions.mjs.map b/node_modules/framer-motion/dist/es/motion/features/definitions.mjs.map new file mode 100644 index 0000000..1cfc05c --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/features/definitions.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"definitions.mjs","sources":["../../../../src/motion/features/definitions.ts"],"sourcesContent":["import { getFeatureDefinitions, setFeatureDefinitions } from \"motion-dom\"\nimport { MotionProps } from \"../types\"\nimport { FeatureDefinitions } from \"./types\"\n\nconst featureProps = {\n animation: [\n \"animate\",\n \"variants\",\n \"whileHover\",\n \"whileTap\",\n \"exit\",\n \"whileInView\",\n \"whileFocus\",\n \"whileDrag\",\n ],\n exit: [\"exit\"],\n drag: [\"drag\", \"dragControls\"],\n focus: [\"whileFocus\"],\n hover: [\"whileHover\", \"onHoverStart\", \"onHoverEnd\"],\n tap: [\"whileTap\", \"onTap\", \"onTapStart\", \"onTapCancel\"],\n pan: [\"onPan\", \"onPanStart\", \"onPanSessionStart\", \"onPanEnd\"],\n inView: [\"whileInView\", \"onViewportEnter\", \"onViewportLeave\"],\n layout: [\"layout\", \"layoutId\"],\n}\n\nlet isInitialized = false\n\n/**\n * Initialize feature definitions with isEnabled checks.\n * This must be called before any motion components are rendered.\n */\nexport function initFeatureDefinitions() {\n if (isInitialized) return\n\n const initialFeatureDefinitions: Partial = {}\n\n for (const key in featureProps) {\n initialFeatureDefinitions[\n key as keyof typeof initialFeatureDefinitions\n ] = {\n isEnabled: (props: MotionProps) =>\n featureProps[key as keyof typeof featureProps].some(\n (name: string) => !!props[name as keyof typeof props]\n ),\n }\n }\n\n setFeatureDefinitions(initialFeatureDefinitions)\n isInitialized = true\n}\n\n/**\n * Get the current feature definitions, initializing if needed.\n */\nexport function getInitializedFeatureDefinitions(): Partial {\n initFeatureDefinitions()\n return getFeatureDefinitions()\n}\n"],"names":[],"mappings":";;AAIA,MAAM,YAAY,GAAG;AACjB,IAAA,SAAS,EAAE;QACP,SAAS;QACT,UAAU;QACV,YAAY;QACZ,UAAU;QACV,MAAM;QACN,aAAa;QACb,YAAY;QACZ,WAAW;AACd,KAAA;IACD,IAAI,EAAE,CAAC,MAAM,CAAC;AACd,IAAA,IAAI,EAAE,CAAC,MAAM,EAAE,cAAc,CAAC;IAC9B,KAAK,EAAE,CAAC,YAAY,CAAC;AACrB,IAAA,KAAK,EAAE,CAAC,YAAY,EAAE,cAAc,EAAE,YAAY,CAAC;IACnD,GAAG,EAAE,CAAC,UAAU,EAAE,OAAO,EAAE,YAAY,EAAE,aAAa,CAAC;IACvD,GAAG,EAAE,CAAC,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,UAAU,CAAC;AAC7D,IAAA,MAAM,EAAE,CAAC,aAAa,EAAE,iBAAiB,EAAE,iBAAiB,CAAC;AAC7D,IAAA,MAAM,EAAE,CAAC,QAAQ,EAAE,UAAU,CAAC;CACjC;AAED,IAAI,aAAa,GAAG,KAAK;AAEzB;;;AAGG;SACa,sBAAsB,GAAA;AAClC,IAAA,IAAI,aAAa;QAAE;IAEnB,MAAM,yBAAyB,GAAgC,EAAE;AAEjE,IAAA,KAAK,MAAM,GAAG,IAAI,YAAY,EAAE;QAC5B,yBAAyB,CACrB,GAA6C,CAChD,GAAG;YACA,SAAS,EAAE,CAAC,KAAkB,KAC1B,YAAY,CAAC,GAAgC,CAAC,CAAC,IAAI,CAC/C,CAAC,IAAY,KAAK,CAAC,CAAC,KAAK,CAAC,IAA0B,CAAC,CACxD;SACR;IACL;IAEA,qBAAqB,CAAC,yBAAyB,CAAC;IAChD,aAAa,GAAG,IAAI;AACxB;AAEA;;AAEG;SACa,gCAAgC,GAAA;AAC5C,IAAA,sBAAsB,EAAE;IACxB,OAAO,qBAAqB,EAAE;AAClC;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/motion/features/drag.mjs b/node_modules/framer-motion/dist/es/motion/features/drag.mjs new file mode 100644 index 0000000..7852452 --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/features/drag.mjs @@ -0,0 +1,18 @@ +import { DragGesture } from '../../gestures/drag/index.mjs'; +import { PanGesture } from '../../gestures/pan/index.mjs'; +import { MeasureLayout } from './layout/MeasureLayout.mjs'; +import { HTMLProjectionNode } from 'motion-dom'; + +const drag = { + pan: { + Feature: PanGesture, + }, + drag: { + Feature: DragGesture, + ProjectionNode: HTMLProjectionNode, + MeasureLayout, + }, +}; + +export { drag }; +//# sourceMappingURL=drag.mjs.map diff --git a/node_modules/framer-motion/dist/es/motion/features/drag.mjs.map b/node_modules/framer-motion/dist/es/motion/features/drag.mjs.map new file mode 100644 index 0000000..ee98308 --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/features/drag.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"drag.mjs","sources":["../../../../src/motion/features/drag.ts"],"sourcesContent":["import { DragGesture } from \"../../gestures/drag\"\nimport { PanGesture } from \"../../gestures/pan\"\nimport { HTMLProjectionNode } from \"../../projection\"\nimport { MeasureLayout } from \"./layout/MeasureLayout\"\nimport { FeaturePackages } from \"./types\"\n\nexport const drag: FeaturePackages = {\n pan: {\n Feature: PanGesture,\n },\n drag: {\n Feature: DragGesture,\n ProjectionNode: HTMLProjectionNode,\n MeasureLayout,\n },\n}\n"],"names":[],"mappings":";;;;;AAMO,MAAM,IAAI,GAAoB;AACjC,IAAA,GAAG,EAAE;AACD,QAAA,OAAO,EAAE,UAAU;AACtB,KAAA;AACD,IAAA,IAAI,EAAE;AACF,QAAA,OAAO,EAAE,WAAW;AACpB,QAAA,cAAc,EAAE,kBAAkB;QAClC,aAAa;AAChB,KAAA;;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/motion/features/gestures.mjs b/node_modules/framer-motion/dist/es/motion/features/gestures.mjs new file mode 100644 index 0000000..e7708cc --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/features/gestures.mjs @@ -0,0 +1,22 @@ +import { HoverGesture } from '../../gestures/hover.mjs'; +import { FocusGesture } from '../../gestures/focus.mjs'; +import { PressGesture } from '../../gestures/press.mjs'; +import { InViewFeature } from './viewport/index.mjs'; + +const gestureAnimations = { + inView: { + Feature: InViewFeature, + }, + tap: { + Feature: PressGesture, + }, + focus: { + Feature: FocusGesture, + }, + hover: { + Feature: HoverGesture, + }, +}; + +export { gestureAnimations }; +//# sourceMappingURL=gestures.mjs.map diff --git a/node_modules/framer-motion/dist/es/motion/features/gestures.mjs.map b/node_modules/framer-motion/dist/es/motion/features/gestures.mjs.map new file mode 100644 index 0000000..4a554e7 --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/features/gestures.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"gestures.mjs","sources":["../../../../src/motion/features/gestures.ts"],"sourcesContent":["import { HoverGesture } from \"../../gestures/hover\"\nimport { FocusGesture } from \"../../gestures/focus\"\nimport { PressGesture } from \"../../gestures/press\"\nimport { InViewFeature } from \"./viewport\"\nimport { FeaturePackages } from \"./types\"\n\nexport const gestureAnimations: FeaturePackages = {\n inView: {\n Feature: InViewFeature,\n },\n tap: {\n Feature: PressGesture,\n },\n focus: {\n Feature: FocusGesture,\n },\n hover: {\n Feature: HoverGesture,\n },\n}\n"],"names":[],"mappings":";;;;;AAMO,MAAM,iBAAiB,GAAoB;AAC9C,IAAA,MAAM,EAAE;AACJ,QAAA,OAAO,EAAE,aAAa;AACzB,KAAA;AACD,IAAA,GAAG,EAAE;AACD,QAAA,OAAO,EAAE,YAAY;AACxB,KAAA;AACD,IAAA,KAAK,EAAE;AACH,QAAA,OAAO,EAAE,YAAY;AACxB,KAAA;AACD,IAAA,KAAK,EAAE;AACH,QAAA,OAAO,EAAE,YAAY;AACxB,KAAA;;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/motion/features/layout.mjs b/node_modules/framer-motion/dist/es/motion/features/layout.mjs new file mode 100644 index 0000000..6ba67db --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/features/layout.mjs @@ -0,0 +1,12 @@ +import { HTMLProjectionNode } from 'motion-dom'; +import { MeasureLayout } from './layout/MeasureLayout.mjs'; + +const layout = { + layout: { + ProjectionNode: HTMLProjectionNode, + MeasureLayout, + }, +}; + +export { layout }; +//# sourceMappingURL=layout.mjs.map diff --git a/node_modules/framer-motion/dist/es/motion/features/layout.mjs.map b/node_modules/framer-motion/dist/es/motion/features/layout.mjs.map new file mode 100644 index 0000000..900ad00 --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/features/layout.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"layout.mjs","sources":["../../../../src/motion/features/layout.ts"],"sourcesContent":["import { HTMLProjectionNode } from \"motion-dom\"\nimport { MeasureLayout } from \"./layout/MeasureLayout\"\nimport { FeaturePackages } from \"./types\"\n\nexport const layout: FeaturePackages = {\n layout: {\n ProjectionNode: HTMLProjectionNode,\n MeasureLayout,\n },\n}\n"],"names":[],"mappings":";;;AAIO,MAAM,MAAM,GAAoB;AACnC,IAAA,MAAM,EAAE;AACJ,QAAA,cAAc,EAAE,kBAAkB;QAClC,aAAa;AAChB,KAAA;;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.mjs b/node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.mjs new file mode 100644 index 0000000..58fa9ee --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.mjs @@ -0,0 +1,136 @@ +"use client"; +import { jsx } from 'react/jsx-runtime'; +import { globalProjectionState, frame, microtask } from 'motion-dom'; +import { useContext, Component } from 'react'; +import { usePresence } from '../../../components/AnimatePresence/use-presence.mjs'; +import { LayoutGroupContext } from '../../../context/LayoutGroupContext.mjs'; +import { SwitchLayoutGroupContext } from '../../../context/SwitchLayoutGroupContext.mjs'; + +/** + * Track whether we've taken any snapshots yet. If not, + * we can safely skip notification of didUpdate. + * + * Difficult to capture in a test but to prevent flickering + * we must set this to true either on update or unmount. + * Running `next-env/layout-id` in Safari will show this behaviour if broken. + */ +let hasTakenAnySnapshot = false; +class MeasureLayoutWithContext extends Component { + /** + * This only mounts projection nodes for components that + * need measuring, we might want to do it for all components + * in order to incorporate transforms + */ + componentDidMount() { + const { visualElement, layoutGroup, switchLayoutGroup, layoutId } = this.props; + const { projection } = visualElement; + if (projection) { + if (layoutGroup.group) + layoutGroup.group.add(projection); + if (switchLayoutGroup && switchLayoutGroup.register && layoutId) { + switchLayoutGroup.register(projection); + } + if (hasTakenAnySnapshot) { + projection.root.didUpdate(); + } + projection.addEventListener("animationComplete", () => { + this.safeToRemove(); + }); + projection.setOptions({ + ...projection.options, + layoutDependency: this.props.layoutDependency, + onExitComplete: () => this.safeToRemove(), + }); + } + globalProjectionState.hasEverUpdated = true; + } + getSnapshotBeforeUpdate(prevProps) { + const { layoutDependency, visualElement, drag, isPresent } = this.props; + const { projection } = visualElement; + if (!projection) + return null; + /** + * TODO: We use this data in relegate to determine whether to + * promote a previous element. There's no guarantee its presence data + * will have updated by this point - if a bug like this arises it will + * have to be that we markForRelegation and then find a new lead some other way, + * perhaps in didUpdate + */ + projection.isPresent = isPresent; + if (prevProps.layoutDependency !== layoutDependency) { + projection.setOptions({ + ...projection.options, + layoutDependency, + }); + } + hasTakenAnySnapshot = true; + if (drag || + prevProps.layoutDependency !== layoutDependency || + layoutDependency === undefined || + prevProps.isPresent !== isPresent) { + projection.willUpdate(); + } + else { + this.safeToRemove(); + } + if (prevProps.isPresent !== isPresent) { + if (isPresent) { + projection.promote(); + } + else if (!projection.relegate()) { + /** + * If there's another stack member taking over from this one, + * it's in charge of the exit animation and therefore should + * be in charge of the safe to remove. Otherwise we call it here. + */ + frame.postRender(() => { + const stack = projection.getStack(); + if (!stack || !stack.members.length) { + this.safeToRemove(); + } + }); + } + } + return null; + } + componentDidUpdate() { + const { visualElement, layoutAnchor } = this.props; + const { projection } = visualElement; + if (projection) { + projection.options.layoutAnchor = layoutAnchor; + projection.root.didUpdate(); + microtask.postRender(() => { + if (!projection.currentAnimation && projection.isLead()) { + this.safeToRemove(); + } + }); + } + } + componentWillUnmount() { + const { visualElement, layoutGroup, switchLayoutGroup: promoteContext, } = this.props; + const { projection } = visualElement; + hasTakenAnySnapshot = true; + if (projection) { + projection.scheduleCheckAfterUnmount(); + if (layoutGroup && layoutGroup.group) + layoutGroup.group.remove(projection); + if (promoteContext && promoteContext.deregister) + promoteContext.deregister(projection); + } + } + safeToRemove() { + const { safeToRemove } = this.props; + safeToRemove && safeToRemove(); + } + render() { + return null; + } +} +function MeasureLayout(props) { + const [isPresent, safeToRemove] = usePresence(); + const layoutGroup = useContext(LayoutGroupContext); + return (jsx(MeasureLayoutWithContext, { ...props, layoutGroup: layoutGroup, switchLayoutGroup: useContext(SwitchLayoutGroupContext), isPresent: isPresent, safeToRemove: safeToRemove })); +} + +export { MeasureLayout }; +//# sourceMappingURL=MeasureLayout.mjs.map diff --git a/node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.mjs.map b/node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.mjs.map new file mode 100644 index 0000000..46b865d --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"MeasureLayout.mjs","sources":["../../../../../src/motion/features/layout/MeasureLayout.tsx"],"sourcesContent":["\"use client\"\n\nimport { frame, microtask, globalProjectionState, type VisualElement } from \"motion-dom\"\nimport { Component, useContext } from \"react\"\nimport { usePresence } from \"../../../components/AnimatePresence/use-presence\"\nimport {\n LayoutGroupContext,\n LayoutGroupContextProps,\n} from \"../../../context/LayoutGroupContext\"\nimport { SwitchLayoutGroupContext } from \"../../../context/SwitchLayoutGroupContext\"\nimport { MotionProps } from \"../../types\"\n\ninterface MeasureContextProps {\n layoutGroup: LayoutGroupContextProps\n switchLayoutGroup?: SwitchLayoutGroupContext\n isPresent: boolean\n safeToRemove?: VoidFunction | null\n}\n\ntype MeasureProps = MotionProps &\n MeasureContextProps & { visualElement: VisualElement }\n\n/**\n * Track whether we've taken any snapshots yet. If not,\n * we can safely skip notification of didUpdate.\n *\n * Difficult to capture in a test but to prevent flickering\n * we must set this to true either on update or unmount.\n * Running `next-env/layout-id` in Safari will show this behaviour if broken.\n */\nlet hasTakenAnySnapshot = false\n\nclass MeasureLayoutWithContext extends Component {\n /**\n * This only mounts projection nodes for components that\n * need measuring, we might want to do it for all components\n * in order to incorporate transforms\n */\n componentDidMount() {\n const { visualElement, layoutGroup, switchLayoutGroup, layoutId } =\n this.props\n const { projection } = visualElement\n\n if (projection) {\n if (layoutGroup.group) layoutGroup.group.add(projection)\n\n if (switchLayoutGroup && switchLayoutGroup.register && layoutId) {\n switchLayoutGroup.register(projection)\n }\n\n if (hasTakenAnySnapshot) {\n projection.root!.didUpdate()\n }\n\n projection.addEventListener(\"animationComplete\", () => {\n this.safeToRemove()\n })\n projection.setOptions({\n ...projection.options,\n layoutDependency: this.props.layoutDependency,\n onExitComplete: () => this.safeToRemove(),\n })\n }\n\n globalProjectionState.hasEverUpdated = true\n }\n\n getSnapshotBeforeUpdate(prevProps: MeasureProps) {\n const { layoutDependency, visualElement, drag, isPresent } = this.props\n const { projection } = visualElement\n\n if (!projection) return null\n\n /**\n * TODO: We use this data in relegate to determine whether to\n * promote a previous element. There's no guarantee its presence data\n * will have updated by this point - if a bug like this arises it will\n * have to be that we markForRelegation and then find a new lead some other way,\n * perhaps in didUpdate\n */\n projection.isPresent = isPresent\n\n if (prevProps.layoutDependency !== layoutDependency) {\n projection.setOptions({\n ...projection.options,\n layoutDependency,\n })\n }\n\n hasTakenAnySnapshot = true\n\n if (\n drag ||\n prevProps.layoutDependency !== layoutDependency ||\n layoutDependency === undefined ||\n prevProps.isPresent !== isPresent\n ) {\n projection.willUpdate()\n } else {\n this.safeToRemove()\n }\n\n if (prevProps.isPresent !== isPresent) {\n if (isPresent) {\n projection.promote()\n } else if (!projection.relegate()) {\n /**\n * If there's another stack member taking over from this one,\n * it's in charge of the exit animation and therefore should\n * be in charge of the safe to remove. Otherwise we call it here.\n */\n frame.postRender(() => {\n const stack = projection.getStack()\n if (!stack || !stack.members.length) {\n this.safeToRemove()\n }\n })\n }\n }\n\n return null\n }\n\n componentDidUpdate() {\n const { visualElement, layoutAnchor } = this.props\n const { projection } = visualElement\n if (projection) {\n projection.options.layoutAnchor = layoutAnchor\n\n projection.root!.didUpdate()\n\n microtask.postRender(() => {\n if (!projection.currentAnimation && projection.isLead()) {\n this.safeToRemove()\n }\n })\n }\n }\n\n componentWillUnmount() {\n const {\n visualElement,\n layoutGroup,\n switchLayoutGroup: promoteContext,\n } = this.props\n const { projection } = visualElement\n\n hasTakenAnySnapshot = true\n\n if (projection) {\n projection.scheduleCheckAfterUnmount()\n if (layoutGroup && layoutGroup.group)\n layoutGroup.group.remove(projection)\n if (promoteContext && promoteContext.deregister)\n promoteContext.deregister(projection)\n }\n }\n\n safeToRemove() {\n const { safeToRemove } = this.props\n safeToRemove && safeToRemove()\n }\n\n render() {\n return null\n }\n}\n\nexport function MeasureLayout(\n props: MotionProps & { visualElement: VisualElement }\n) {\n const [isPresent, safeToRemove] = usePresence()\n const layoutGroup = useContext(LayoutGroupContext)\n\n return (\n \n )\n}\n"],"names":[],"mappings":";;;;;;;;AAsBA;;;;;;;AAOG;AACH;AAEA;AACI;;;;AAIG;;AAEC;AAEA;;;AAG2B;;AAGnB;;;AAIA;;AAGJ;;AAEA;;;AAGI;AACA;AACH;;AAGL;;AAGJ;AACI;AACA;AAEA;AAAiB;AAEjB;;;;;;AAMG;AACH;AAEA;;;;AAIK;;;AAKL;;AAGI;AACA;;;;;;AAOJ;;;;AAGW;AACH;;;;AAIG;AACH;AACI;;;;AAIJ;;;AAIR;;;;AAKA;;AAEI;AAEA;AAEA;;;;AAIA;;;;AAKJ;AAKA;;;;AAMI;AACI;AACJ;AACI;;;;AAKR;;;;AAKA;;AAEP;AAEK;;AAIF;;AAWJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/motion/features/load-features.mjs b/node_modules/framer-motion/dist/es/motion/features/load-features.mjs new file mode 100644 index 0000000..dc52536 --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/features/load-features.mjs @@ -0,0 +1,16 @@ +import { setFeatureDefinitions } from 'motion-dom'; +import { getInitializedFeatureDefinitions } from './definitions.mjs'; + +function loadFeatures(features) { + const featureDefinitions = getInitializedFeatureDefinitions(); + for (const key in features) { + featureDefinitions[key] = { + ...featureDefinitions[key], + ...features[key], + }; + } + setFeatureDefinitions(featureDefinitions); +} + +export { loadFeatures }; +//# sourceMappingURL=load-features.mjs.map diff --git a/node_modules/framer-motion/dist/es/motion/features/load-features.mjs.map b/node_modules/framer-motion/dist/es/motion/features/load-features.mjs.map new file mode 100644 index 0000000..7601650 --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/features/load-features.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"load-features.mjs","sources":["../../../../src/motion/features/load-features.ts"],"sourcesContent":["import { setFeatureDefinitions } from \"motion-dom\"\nimport { getInitializedFeatureDefinitions } from \"./definitions\"\nimport { FeaturePackages } from \"./types\"\n\nexport function loadFeatures(features: FeaturePackages) {\n const featureDefinitions = getInitializedFeatureDefinitions()\n\n for (const key in features) {\n featureDefinitions[key as keyof typeof featureDefinitions] = {\n ...featureDefinitions[key as keyof typeof featureDefinitions],\n ...features[key as keyof typeof features],\n } as any\n }\n\n setFeatureDefinitions(featureDefinitions)\n}\n"],"names":[],"mappings":";;;AAIM,SAAU,YAAY,CAAC,QAAyB,EAAA;AAClD,IAAA,MAAM,kBAAkB,GAAG,gCAAgC,EAAE;AAE7D,IAAA,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE;QACxB,kBAAkB,CAAC,GAAsC,CAAC,GAAG;YACzD,GAAG,kBAAkB,CAAC,GAAsC,CAAC;YAC7D,GAAG,QAAQ,CAAC,GAA4B,CAAC;SACrC;IACZ;IAEA,qBAAqB,CAAC,kBAAkB,CAAC;AAC7C;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/motion/features/viewport/index.mjs b/node_modules/framer-motion/dist/es/motion/features/viewport/index.mjs new file mode 100644 index 0000000..4d1b957 --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/features/viewport/index.mjs @@ -0,0 +1,77 @@ +import { Feature } from 'motion-dom'; +import { observeIntersection } from './observers.mjs'; + +const thresholdNames = { + some: 0, + all: 1, +}; +class InViewFeature extends Feature { + constructor() { + super(...arguments); + this.hasEnteredView = false; + this.isInView = false; + } + startObserver() { + this.stopObserver?.(); + const { viewport = {} } = this.node.getProps(); + const { root, margin: rootMargin, amount = "some", once } = viewport; + const options = { + root: root ? root.current : undefined, + rootMargin, + threshold: typeof amount === "number" ? amount : thresholdNames[amount], + }; + const onIntersectionUpdate = (entry) => { + const { isIntersecting } = entry; + /** + * If there's been no change in the viewport state, early return. + */ + if (this.isInView === isIntersecting) + return; + this.isInView = isIntersecting; + /** + * Handle hasEnteredView. If this is only meant to run once, and + * element isn't visible, early return. Otherwise set hasEnteredView to true. + */ + if (once && !isIntersecting && this.hasEnteredView) { + return; + } + else if (isIntersecting) { + this.hasEnteredView = true; + } + if (this.node.animationState) { + this.node.animationState.setActive("whileInView", isIntersecting); + } + /** + * Use the latest committed props rather than the ones in scope + * when this observer is created + */ + const { onViewportEnter, onViewportLeave } = this.node.getProps(); + const callback = isIntersecting ? onViewportEnter : onViewportLeave; + callback && callback(entry); + }; + this.stopObserver = observeIntersection(this.node.current, options, onIntersectionUpdate); + } + mount() { + this.startObserver(); + } + update() { + if (typeof IntersectionObserver === "undefined") + return; + const { props, prevProps } = this.node; + const hasOptionsChanged = ["amount", "margin", "root"].some(hasViewportOptionChanged(props, prevProps)); + if (hasOptionsChanged) { + this.startObserver(); + } + } + unmount() { + this.stopObserver?.(); + this.hasEnteredView = false; + this.isInView = false; + } +} +function hasViewportOptionChanged({ viewport = {} }, { viewport: prevViewport = {} } = {}) { + return (name) => viewport[name] !== prevViewport[name]; +} + +export { InViewFeature }; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/framer-motion/dist/es/motion/features/viewport/index.mjs.map b/node_modules/framer-motion/dist/es/motion/features/viewport/index.mjs.map new file mode 100644 index 0000000..cb6c730 --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/features/viewport/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../../../../../src/motion/features/viewport/index.ts"],"sourcesContent":["import { Feature } from \"motion-dom\"\nimport { MotionProps } from \"../../types\"\nimport { observeIntersection } from \"./observers\"\n\nconst thresholdNames = {\n some: 0,\n all: 1,\n}\n\nexport class InViewFeature extends Feature {\n private hasEnteredView = false\n\n private isInView = false\n\n private stopObserver?: () => void\n\n private startObserver() {\n this.stopObserver?.()\n\n const { viewport = {} } = this.node.getProps()\n const { root, margin: rootMargin, amount = \"some\", once } = viewport\n\n const options = {\n root: root ? root.current : undefined,\n rootMargin,\n threshold:\n typeof amount === \"number\" ? amount : thresholdNames[amount],\n }\n\n const onIntersectionUpdate = (entry: IntersectionObserverEntry) => {\n const { isIntersecting } = entry\n\n /**\n * If there's been no change in the viewport state, early return.\n */\n if (this.isInView === isIntersecting) return\n\n this.isInView = isIntersecting\n\n /**\n * Handle hasEnteredView. If this is only meant to run once, and\n * element isn't visible, early return. Otherwise set hasEnteredView to true.\n */\n if (once && !isIntersecting && this.hasEnteredView) {\n return\n } else if (isIntersecting) {\n this.hasEnteredView = true\n }\n\n if (this.node.animationState) {\n this.node.animationState.setActive(\n \"whileInView\",\n isIntersecting\n )\n }\n\n /**\n * Use the latest committed props rather than the ones in scope\n * when this observer is created\n */\n const { onViewportEnter, onViewportLeave } = this.node.getProps()\n const callback = isIntersecting ? onViewportEnter : onViewportLeave\n callback && callback(entry)\n }\n\n this.stopObserver = observeIntersection(\n this.node.current!,\n options,\n onIntersectionUpdate\n )\n }\n\n mount() {\n this.startObserver()\n }\n\n update() {\n if (typeof IntersectionObserver === \"undefined\") return\n\n const { props, prevProps } = this.node\n const hasOptionsChanged = [\"amount\", \"margin\", \"root\"].some(\n hasViewportOptionChanged(props, prevProps)\n )\n\n if (hasOptionsChanged) {\n this.startObserver()\n }\n }\n\n unmount() {\n this.stopObserver?.()\n this.hasEnteredView = false\n this.isInView = false\n }\n}\n\nfunction hasViewportOptionChanged(\n { viewport = {} }: MotionProps,\n { viewport: prevViewport = {} }: MotionProps = {}\n) {\n return (name: keyof typeof viewport) =>\n viewport[name] !== prevViewport[name]\n}\n"],"names":[],"mappings":";;;AAIA,MAAM,cAAc,GAAG;AACnB,IAAA,IAAI,EAAE,CAAC;AACP,IAAA,GAAG,EAAE,CAAC;CACT;AAEK,MAAO,aAAc,SAAQ,OAAgB,CAAA;AAAnD,IAAA,WAAA,GAAA;;QACY,IAAA,CAAA,cAAc,GAAG,KAAK;QAEtB,IAAA,CAAA,QAAQ,GAAG,KAAK;IAkF5B;IA9EY,aAAa,GAAA;AACjB,QAAA,IAAI,CAAC,YAAY,IAAI;AAErB,QAAA,MAAM,EAAE,QAAQ,GAAG,EAAE,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;AAC9C,QAAA,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,IAAI,EAAE,GAAG,QAAQ;AAEpE,QAAA,MAAM,OAAO,GAAG;YACZ,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC,OAAO,GAAG,SAAS;YACrC,UAAU;AACV,YAAA,SAAS,EACL,OAAO,MAAM,KAAK,QAAQ,GAAG,MAAM,GAAG,cAAc,CAA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EAAE;YACnB,IAAI,CAAC,aAAa,EAAE;QACxB;IACJ;IAEA,OAAO,GAAA;AACH,QAAA,IAAI,CAAC,YAAY,IAAI;AACrB,QAAA,IAAI,CAAC,cAAc,GAAG,KAAK;AAC3B,QAAA,IAAI,CAAC,QAAQ,GAAG,KAAK;IACzB;AACH;AAED,SAAS,wBAAwB,CAC7B,EAAE,QAAQ,GAAG,EAAE,EAAe,EAC9B,EAAE,QAAQ,EAAE,YAAY,GAAG,EAAE,KAAkB,EAAE,EAAA;AAEjD,IAAA,OAAO,CAAC,IAA2B,KAC/B,QAAQ,CAAC,IAAI,CAAC,KAAK,YAAY,CAAC,IAAI,CAAC;AAC7C;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/motion/features/viewport/observers.mjs b/node_modules/framer-motion/dist/es/motion/features/viewport/observers.mjs new file mode 100644 index 0000000..7c67d85 --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/features/viewport/observers.mjs @@ -0,0 +1,50 @@ +/** + * Map an IntersectionHandler callback to an element. We only ever make one handler for one + * element, so even though these handlers might all be triggered by different + * observers, we can keep them in the same map. + */ +const observerCallbacks = new WeakMap(); +/** + * Multiple observers can be created for multiple element/document roots. Each with + * different settings. So here we store dictionaries of observers to each root, + * using serialised settings (threshold/margin) as lookup keys. + */ +const observers = new WeakMap(); +const fireObserverCallback = (entry) => { + const callback = observerCallbacks.get(entry.target); + callback && callback(entry); +}; +const fireAllObserverCallbacks = (entries) => { + entries.forEach(fireObserverCallback); +}; +function initIntersectionObserver({ root, ...options }) { + const lookupRoot = root || document; + /** + * If we don't have an observer lookup map for this root, create one. + */ + if (!observers.has(lookupRoot)) { + observers.set(lookupRoot, {}); + } + const rootObservers = observers.get(lookupRoot); + const key = JSON.stringify(options); + /** + * If we don't have an observer for this combination of root and settings, + * create one. + */ + if (!rootObservers[key]) { + rootObservers[key] = new IntersectionObserver(fireAllObserverCallbacks, { root, ...options }); + } + return rootObservers[key]; +} +function observeIntersection(element, options, callback) { + const rootInteresectionObserver = initIntersectionObserver(options); + observerCallbacks.set(element, callback); + rootInteresectionObserver.observe(element); + return () => { + observerCallbacks.delete(element); + rootInteresectionObserver.unobserve(element); + }; +} + +export { observeIntersection }; +//# sourceMappingURL=observers.mjs.map diff --git a/node_modules/framer-motion/dist/es/motion/features/viewport/observers.mjs.map b/node_modules/framer-motion/dist/es/motion/features/viewport/observers.mjs.map new file mode 100644 index 0000000..cbbe273 --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/features/viewport/observers.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"observers.mjs","sources":["../../../../../src/motion/features/viewport/observers.ts"],"sourcesContent":["type IntersectionHandler = (entry: IntersectionObserverEntry) => void\n\ninterface ElementIntersectionObservers {\n [key: string]: IntersectionObserver\n}\n\n/**\n * Map an IntersectionHandler callback to an element. We only ever make one handler for one\n * element, so even though these handlers might all be triggered by different\n * observers, we can keep them in the same map.\n */\nconst observerCallbacks = new WeakMap()\n\n/**\n * Multiple observers can be created for multiple element/document roots. Each with\n * different settings. So here we store dictionaries of observers to each root,\n * using serialised settings (threshold/margin) as lookup keys.\n */\nconst observers = new WeakMap<\n Element | Document,\n ElementIntersectionObservers\n>()\n\nconst fireObserverCallback = (entry: IntersectionObserverEntry) => {\n const callback = observerCallbacks.get(entry.target)\n callback && callback(entry)\n}\n\nconst fireAllObserverCallbacks: IntersectionObserverCallback = (entries) => {\n entries.forEach(fireObserverCallback)\n}\n\nfunction initIntersectionObserver({\n root,\n ...options\n}: IntersectionObserverInit): IntersectionObserver {\n const lookupRoot = root || document\n\n /**\n * If we don't have an observer lookup map for this root, create one.\n */\n if (!observers.has(lookupRoot)) {\n observers.set(lookupRoot, {})\n }\n const rootObservers = observers.get(lookupRoot)!\n\n const key = JSON.stringify(options)\n\n /**\n * If we don't have an observer for this combination of root and settings,\n * create one.\n */\n if (!rootObservers[key]) {\n rootObservers[key] = new IntersectionObserver(\n fireAllObserverCallbacks,\n { root, ...options }\n )\n }\n\n return rootObservers[key]\n}\n\nexport function observeIntersection(\n element: Element,\n options: IntersectionObserverInit,\n callback: IntersectionHandler\n) {\n const rootInteresectionObserver = initIntersectionObserver(options)\n\n observerCallbacks.set(element, callback)\n rootInteresectionObserver.observe(element)\n\n return () => {\n observerCallbacks.delete(element)\n rootInteresectionObserver.unobserve(element)\n }\n}\n"],"names":[],"mappings":"AAMA;;;;AAIG;AACH,MAAM,iBAAiB,GAAG,IAAI,OAAO,EAAgC;AAErE;;;;AAIG;AACH,MAAM,SAAS,GAAG,IAAI,OAAO,EAG1B;AAEH,MAAM,oBAAoB,GAAG,CAAC,KAAgC,KAAI;IAC9D,MAAM,QAAQ,GAAG,iBAAiB,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC;AACpD,IAAA,QAAQ,IAAI,QAAQ,CAAC,KAAK,CAAC;AAC/B,CAAC;AAED,MAAM,wBAAwB,GAAiC,CAAC,OAAO,KAAI;AACvE,IAAA,OAAO,CAAC,OAAO,CAAC,oBAAoB,CAAC;AACzC,CAAC;AAED,SAAS,wBAAwB,CAAC,EAC9B,IAAI,EACJ,GAAG,OAAO,EACa,EAAA;AACvB,IAAA,MAAM,UAAU,GAAG,IAAI,IAAI,QAAQ;AAEnC;;AAEG;IACH,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE;AAC5B,QAAA,SAAS,CAAC,GAAG,CAAC,UAAU,EAAE,EAAE,CAAC;IACjC;IACA,MAAM,aAAa,GAAG,SAAS,CAAC,GAAG,CAAC,UAAU,CAAE;IAEhD,MAAM,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;AAEnC;;;AAGG;AACH,IAAA,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,EAAE;AACrB,QAAA,aAAa,CAAC,GAAG,CAAC,GAAG,IAAI,oBAAoB,CACzC,wBAAwB,EACxB,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CACvB;IACL;AAEA,IAAA,OAAO,aAAa,CAAC,GAAG,CAAC;AAC7B;SAEgB,mBAAmB,CAC/B,OAAgB,EAChB,OAAiC,EACjC,QAA6B,EAAA;AAE7B,IAAA,MAAM,yBAAyB,GAAG,wBAAwB,CAAC,OAAO,CAAC;AAEnE,IAAA,iBAAiB,CAAC,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAC;AACxC,IAAA,yBAAyB,CAAC,OAAO,CAAC,OAAO,CAAC;AAE1C,IAAA,OAAO,MAAK;AACR,QAAA,iBAAiB,CAAC,MAAM,CAAC,OAAO,CAAC;AACjC,QAAA,yBAAyB,CAAC,SAAS,CAAC,OAAO,CAAC;AAChD,IAAA,CAAC;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/motion/index.mjs b/node_modules/framer-motion/dist/es/motion/index.mjs new file mode 100644 index 0000000..50e499c --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/index.mjs @@ -0,0 +1,113 @@ +"use client"; +import { jsxs, jsx } from 'react/jsx-runtime'; +import { warning, invariant } from 'motion-utils'; +import { forwardRef, useContext } from 'react'; +import { LayoutGroupContext } from '../context/LayoutGroupContext.mjs'; +import { LazyContext } from '../context/LazyContext.mjs'; +import { MotionConfigContext } from '../context/MotionConfigContext.mjs'; +import { MotionContext } from '../context/MotionContext/index.mjs'; +import { useCreateMotionContext } from '../context/MotionContext/create.mjs'; +import { useRender } from '../render/dom/use-render.mjs'; +import { isSVGComponent } from '../render/dom/utils/is-svg-component.mjs'; +import { useHTMLVisualState } from '../render/html/use-html-visual-state.mjs'; +import { useSVGVisualState } from '../render/svg/use-svg-visual-state.mjs'; +import { getInitializedFeatureDefinitions } from './features/definitions.mjs'; +import { loadFeatures } from './features/load-features.mjs'; +import { motionComponentSymbol } from './utils/symbol.mjs'; +import { useMotionRef } from './utils/use-motion-ref.mjs'; +import { useVisualElement } from './utils/use-visual-element.mjs'; + +/** + * Create a `motion` component. + * + * This function accepts a Component argument, which can be either a string (ie "div" + * for `motion.div`), or an actual React component. + * + * Alongside this is a config option which provides a way of rendering the provided + * component "offline", or outside the React render cycle. + */ +function createMotionComponent(Component, { forwardMotionProps = false, type } = {}, preloadedFeatures, createVisualElement) { + preloadedFeatures && loadFeatures(preloadedFeatures); + /** + * Determine whether to use SVG or HTML rendering based on: + * 1. Explicit `type` option (highest priority) + * 2. Auto-detection via `isSVGComponent` + */ + const isSVG = type ? type === "svg" : isSVGComponent(Component); + const useVisualState = isSVG ? useSVGVisualState : useHTMLVisualState; + function MotionDOMComponent(props, externalRef) { + /** + * If we need to measure the element we load this functionality in a + * separate class component in order to gain access to getSnapshotBeforeUpdate. + */ + let MeasureLayout; + const configAndProps = { + ...useContext(MotionConfigContext), + ...props, + layoutId: useLayoutId(props), + }; + const { isStatic, isValidProp } = configAndProps; + const context = useCreateMotionContext(props); + const visualState = useVisualState(props, isStatic); + if (!isStatic && typeof window !== "undefined") { + useStrictMode(configAndProps, preloadedFeatures); + const layoutProjection = getProjectionFunctionality(configAndProps); + MeasureLayout = layoutProjection.MeasureLayout; + /** + * Create a VisualElement for this component. A VisualElement provides a common + * interface to renderer-specific APIs (ie DOM/Three.js etc) as well as + * providing a way of rendering to these APIs outside of the React render loop + * for more performant animations and interactions + */ + context.visualElement = useVisualElement(Component, visualState, configAndProps, createVisualElement, layoutProjection.ProjectionNode, isSVG); + } + /** + * The mount order and hierarchy is specific to ensure our element ref + * is hydrated by the time features fire their effects. + */ + return (jsxs(MotionContext.Provider, { value: context, children: [MeasureLayout && context.visualElement ? (jsx(MeasureLayout, { visualElement: context.visualElement, ...configAndProps })) : null, useRender(Component, props, useMotionRef(visualState, context.visualElement, externalRef), visualState, isStatic, forwardMotionProps, isSVG, isValidProp)] })); + } + MotionDOMComponent.displayName = `motion.${typeof Component === "string" + ? Component + : `create(${Component.displayName ?? Component.name ?? ""})`}`; + const ForwardRefMotionComponent = forwardRef(MotionDOMComponent); + ForwardRefMotionComponent[motionComponentSymbol] = Component; + return ForwardRefMotionComponent; +} +function useLayoutId({ layoutId }) { + const layoutGroupId = useContext(LayoutGroupContext).id; + return layoutGroupId && layoutId !== undefined + ? layoutGroupId + "-" + layoutId + : layoutId; +} +function useStrictMode(configAndProps, preloadedFeatures) { + const isStrict = useContext(LazyContext).strict; + /** + * If we're in development mode, check to make sure we're not rendering a motion component + * as a child of LazyMotion, as this will break the file-size benefits of using it. + */ + if (process.env.NODE_ENV !== "production" && + preloadedFeatures && + isStrict) { + const strictMessage = "You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead."; + configAndProps.ignoreStrict + ? warning(false, strictMessage, "lazy-strict-mode") + : invariant(false, strictMessage, "lazy-strict-mode"); + } +} +function getProjectionFunctionality(props) { + const featureDefinitions = getInitializedFeatureDefinitions(); + const { drag, layout } = featureDefinitions; + if (!drag && !layout) + return {}; + const combined = { ...drag, ...layout }; + return { + MeasureLayout: drag?.isEnabled(props) || layout?.isEnabled(props) + ? combined.MeasureLayout + : undefined, + ProjectionNode: combined.ProjectionNode, + }; +} + +export { createMotionComponent }; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/framer-motion/dist/es/motion/index.mjs.map b/node_modules/framer-motion/dist/es/motion/index.mjs.map new file mode 100644 index 0000000..4e73846 --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../../../src/motion/index.tsx"],"sourcesContent":["\"use client\"\n\nimport { invariant, warning } from \"motion-utils\"\nimport * as React from \"react\"\nimport { forwardRef, useContext } from \"react\"\nimport { LayoutGroupContext } from \"../context/LayoutGroupContext\"\nimport { LazyContext } from \"../context/LazyContext\"\nimport { MotionConfigContext } from \"../context/MotionConfigContext\"\nimport { MotionContext } from \"../context/MotionContext\"\nimport { useCreateMotionContext } from \"../context/MotionContext/create\"\nimport { DOMMotionComponents } from \"../render/dom/types\"\nimport { useRender } from \"../render/dom/use-render\"\nimport { isSVGComponent } from \"../render/dom/utils/is-svg-component\"\nimport { HTMLRenderState } from \"../render/html/types\"\nimport { useHTMLVisualState } from \"../render/html/use-html-visual-state\"\nimport { SVGRenderState } from \"../render/svg/types\"\nimport { useSVGVisualState } from \"../render/svg/use-svg-visual-state\"\nimport { CreateVisualElement } from \"../render/types\"\nimport { getInitializedFeatureDefinitions } from \"./features/definitions\"\nimport { loadFeatures } from \"./features/load-features\"\nimport { FeatureBundle, FeaturePackages } from \"./features/types\"\nimport { MotionProps } from \"./types\"\nimport { motionComponentSymbol } from \"./utils/symbol\"\nimport { useMotionRef } from \"./utils/use-motion-ref\"\nimport { useVisualElement } from \"./utils/use-visual-element\"\n\nexport interface MotionComponentConfig<\n TagName extends keyof DOMMotionComponents | string = \"div\"\n> {\n preloadedFeatures?: FeatureBundle\n createVisualElement?: CreateVisualElement\n Component: TagName | React.ComponentType>\n forwardMotionProps?: boolean\n}\n\nexport type MotionComponentProps = {\n [K in Exclude]?: Props[K]\n} & MotionProps\n\nexport type MotionComponent = T extends keyof DOMMotionComponents\n ? DOMMotionComponents[T]\n : React.ComponentType<\n Omit, \"children\"> & {\n children?: \"children\" extends keyof P\n ? P[\"children\"] | MotionComponentProps

[\"children\"]\n : MotionComponentProps

[\"children\"]\n }\n >\n\nexport interface MotionComponentOptions {\n forwardMotionProps?: boolean\n /**\n * Specify whether the component renders an HTML or SVG element.\n * This is useful when wrapping custom SVG components that need\n * SVG-specific attribute handling (like viewBox animation).\n * By default, Motion auto-detects based on the component name,\n * but custom React components are always treated as HTML.\n */\n type?: \"html\" | \"svg\"\n}\n\n/**\n * Create a `motion` component.\n *\n * This function accepts a Component argument, which can be either a string (ie \"div\"\n * for `motion.div`), or an actual React component.\n *\n * Alongside this is a config option which provides a way of rendering the provided\n * component \"offline\", or outside the React render cycle.\n */\nexport function createMotionComponent<\n Props,\n TagName extends keyof DOMMotionComponents | string = \"div\"\n>(\n Component: TagName | string | React.ComponentType,\n { forwardMotionProps = false, type }: MotionComponentOptions = {},\n preloadedFeatures?: FeaturePackages,\n createVisualElement?: CreateVisualElement\n) {\n preloadedFeatures && loadFeatures(preloadedFeatures)\n\n /**\n * Determine whether to use SVG or HTML rendering based on:\n * 1. Explicit `type` option (highest priority)\n * 2. Auto-detection via `isSVGComponent`\n */\n const isSVG = type ? type === \"svg\" : isSVGComponent(Component)\n const useVisualState = isSVG ? useSVGVisualState : useHTMLVisualState\n\n function MotionDOMComponent(\n props: MotionComponentProps,\n externalRef?: React.Ref\n ) {\n /**\n * If we need to measure the element we load this functionality in a\n * separate class component in order to gain access to getSnapshotBeforeUpdate.\n */\n let MeasureLayout: undefined | React.ComponentType\n\n const configAndProps = {\n ...useContext(MotionConfigContext),\n ...props,\n layoutId: useLayoutId(props),\n }\n\n const { isStatic, isValidProp } = configAndProps\n\n const context = useCreateMotionContext(props)\n\n const visualState = useVisualState(props, isStatic)\n\n if (!isStatic && typeof window !== \"undefined\") {\n useStrictMode(configAndProps, preloadedFeatures)\n\n const layoutProjection = getProjectionFunctionality(configAndProps)\n MeasureLayout = layoutProjection.MeasureLayout\n\n /**\n * Create a VisualElement for this component. A VisualElement provides a common\n * interface to renderer-specific APIs (ie DOM/Three.js etc) as well as\n * providing a way of rendering to these APIs outside of the React render loop\n * for more performant animations and interactions\n */\n context.visualElement = useVisualElement(\n Component,\n visualState,\n configAndProps,\n createVisualElement,\n layoutProjection.ProjectionNode,\n isSVG\n )\n }\n\n /**\n * The mount order and hierarchy is specific to ensure our element ref\n * is hydrated by the time features fire their effects.\n */\n return (\n \n {MeasureLayout && context.visualElement ? (\n \n ) : null}\n {useRender(\n Component,\n props,\n useMotionRef<\n HTMLElement | SVGElement,\n HTMLRenderState | SVGRenderState\n >(visualState, context.visualElement, externalRef),\n visualState,\n isStatic,\n forwardMotionProps,\n isSVG,\n isValidProp\n )}\n \n )\n }\n\n MotionDOMComponent.displayName = `motion.${\n typeof Component === \"string\"\n ? Component\n : `create(${Component.displayName ?? Component.name ?? \"\"})`\n }`\n\n const ForwardRefMotionComponent = forwardRef(MotionDOMComponent as any)\n ;(ForwardRefMotionComponent as any)[motionComponentSymbol] = Component\n\n return ForwardRefMotionComponent as MotionComponent\n}\n\nfunction useLayoutId({ layoutId }: MotionProps) {\n const layoutGroupId = useContext(LayoutGroupContext).id\n return layoutGroupId && layoutId !== undefined\n ? layoutGroupId + \"-\" + layoutId\n : layoutId\n}\n\nfunction useStrictMode(\n configAndProps: MotionProps,\n preloadedFeatures?: FeaturePackages\n) {\n const isStrict = useContext(LazyContext).strict\n\n /**\n * If we're in development mode, check to make sure we're not rendering a motion component\n * as a child of LazyMotion, as this will break the file-size benefits of using it.\n */\n if (\n process.env.NODE_ENV !== \"production\" &&\n preloadedFeatures &&\n isStrict\n ) {\n const strictMessage =\n \"You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.\"\n configAndProps.ignoreStrict\n ? warning(false, strictMessage, \"lazy-strict-mode\")\n : invariant(false, strictMessage, \"lazy-strict-mode\")\n }\n}\n\nfunction getProjectionFunctionality(props: MotionProps) {\n const featureDefinitions = getInitializedFeatureDefinitions()\n const { drag, layout } = featureDefinitions\n\n if (!drag && !layout) return {}\n\n const combined = { ...drag, ...layout }\n\n return {\n MeasureLayout:\n drag?.isEnabled(props) || layout?.isEnabled(props)\n ? combined.MeasureLayout\n : undefined,\n ProjectionNode: combined.ProjectionNode,\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AA6DA;;;;;;;;AAQG;;AAUC;AAEA;;;;AAIG;AACH;;AAGA;AAII;;;AAGG;AACH;AAEA;;AAEI;AACA;;AAGJ;AAEA;;;AAKI;AAEA;AACA;AAEA;;;;;AAKG;AACH;;AAUJ;;;AAGG;AACH;;AAyBJ;AAEQ;AACA;AAGR;AACE;AAEF;AACJ;AAEA;;AAEI;AACI;;AAER;AAEA;;AAMI;;;AAGG;AACH;;AAGI;;AAIA;;;;AAIR;AAEA;AACI;AACA;AAEA;AAAsB;;;AAKlB;;AAGQ;;;AAGhB;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/motion/utils/is-motion-component.mjs b/node_modules/framer-motion/dist/es/motion/utils/is-motion-component.mjs new file mode 100644 index 0000000..3d73809 --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/utils/is-motion-component.mjs @@ -0,0 +1,13 @@ +import { motionComponentSymbol } from './symbol.mjs'; + +/** + * Checks if a component is a `motion` component. + */ +function isMotionComponent(component) { + return (component !== null && + typeof component === "object" && + motionComponentSymbol in component); +} + +export { isMotionComponent }; +//# sourceMappingURL=is-motion-component.mjs.map diff --git a/node_modules/framer-motion/dist/es/motion/utils/is-motion-component.mjs.map b/node_modules/framer-motion/dist/es/motion/utils/is-motion-component.mjs.map new file mode 100644 index 0000000..02cdc74 --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/utils/is-motion-component.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"is-motion-component.mjs","sources":["../../../../src/motion/utils/is-motion-component.ts"],"sourcesContent":["import { motionComponentSymbol } from \"./symbol\"\n\n/**\n * Checks if a component is a `motion` component.\n */\nexport function isMotionComponent(component: React.ComponentType | string) {\n return (\n component !== null &&\n typeof component === \"object\" &&\n motionComponentSymbol in component\n )\n}\n"],"names":[],"mappings":";;AAEA;;AAEG;AACG,SAAU,iBAAiB,CAAC,SAAuC,EAAA;IACrE,QACI,SAAS,KAAK,IAAI;QAClB,OAAO,SAAS,KAAK,QAAQ;QAC7B,qBAAqB,IAAI,SAAS;AAE1C;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/motion/utils/symbol.mjs b/node_modules/framer-motion/dist/es/motion/utils/symbol.mjs new file mode 100644 index 0000000..afeb9bb --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/utils/symbol.mjs @@ -0,0 +1,4 @@ +const motionComponentSymbol = Symbol.for("motionComponentSymbol"); + +export { motionComponentSymbol }; +//# sourceMappingURL=symbol.mjs.map diff --git a/node_modules/framer-motion/dist/es/motion/utils/symbol.mjs.map b/node_modules/framer-motion/dist/es/motion/utils/symbol.mjs.map new file mode 100644 index 0000000..84be6e0 --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/utils/symbol.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"symbol.mjs","sources":["../../../../src/motion/utils/symbol.ts"],"sourcesContent":["export const motionComponentSymbol = Symbol.for(\"motionComponentSymbol\")\n"],"names":[],"mappings":"AAAO,MAAM,qBAAqB,GAAG,MAAM,CAAC,GAAG,CAAC,uBAAuB;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/motion/utils/unwrap-motion-component.mjs b/node_modules/framer-motion/dist/es/motion/utils/unwrap-motion-component.mjs new file mode 100644 index 0000000..b76a668 --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/utils/unwrap-motion-component.mjs @@ -0,0 +1,18 @@ +import { isMotionComponent } from './is-motion-component.mjs'; +import { motionComponentSymbol } from './symbol.mjs'; + +/** + * Unwraps a `motion` component and returns either a string for `motion.div` or + * the React component for `motion(Component)`. + * + * If the component is not a `motion` component it returns undefined. + */ +function unwrapMotionComponent(component) { + if (isMotionComponent(component)) { + return component[motionComponentSymbol]; + } + return undefined; +} + +export { unwrapMotionComponent }; +//# sourceMappingURL=unwrap-motion-component.mjs.map diff --git a/node_modules/framer-motion/dist/es/motion/utils/unwrap-motion-component.mjs.map b/node_modules/framer-motion/dist/es/motion/utils/unwrap-motion-component.mjs.map new file mode 100644 index 0000000..55c1556 --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/utils/unwrap-motion-component.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"unwrap-motion-component.mjs","sources":["../../../../src/motion/utils/unwrap-motion-component.ts"],"sourcesContent":["import { isMotionComponent } from \"./is-motion-component\"\nimport { motionComponentSymbol } from \"./symbol\"\n\n/**\n * Unwraps a `motion` component and returns either a string for `motion.div` or\n * the React component for `motion(Component)`.\n *\n * If the component is not a `motion` component it returns undefined.\n */\nexport function unwrapMotionComponent(\n component: React.ComponentType | string\n): React.ComponentType | string | undefined {\n if (isMotionComponent(component)) {\n return component[motionComponentSymbol as keyof typeof component]\n }\n\n return undefined\n}\n"],"names":[],"mappings":";;;AAGA;;;;;AAKG;AACG,SAAU,qBAAqB,CACjC,SAAuC,EAAA;AAEvC,IAAA,IAAI,iBAAiB,CAAC,SAAS,CAAC,EAAE;AAC9B,QAAA,OAAO,SAAS,CAAC,qBAA+C,CAAC;IACrE;AAEA,IAAA,OAAO,SAAS;AACpB;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.mjs b/node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.mjs new file mode 100644 index 0000000..595f011 --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.mjs @@ -0,0 +1,52 @@ +"use client"; +import { useRef, useInsertionEffect, useCallback } from 'react'; + +/** + * Creates a ref function that, when called, hydrates the provided + * external ref and VisualElement. + */ +function useMotionRef(visualState, visualElement, externalRef) { + /** + * Store externalRef in a ref to avoid including it in the useCallback + * dependency array. Including externalRef in dependencies causes issues + * with libraries like Radix UI that create new callback refs on each render + * when using asChild - this would cause the callback to be recreated, + * triggering element remounts and breaking AnimatePresence exit animations. + */ + const externalRefContainer = useRef(externalRef); + useInsertionEffect(() => { + externalRefContainer.current = externalRef; + }); + // Store cleanup function returned by callback refs (React 19 feature) + const refCleanup = useRef(null); + return useCallback((instance) => { + if (instance) { + visualState.onMount?.(instance); + } + if (visualElement) { + instance ? visualElement.mount(instance) : visualElement.unmount(); + } + const ref = externalRefContainer.current; + if (typeof ref === "function") { + if (instance) { + const cleanup = ref(instance); + if (typeof cleanup === "function") { + refCleanup.current = cleanup; + } + } + else if (refCleanup.current) { + refCleanup.current(); + refCleanup.current = null; + } + else { + ref(instance); + } + } + else if (ref) { + ref.current = instance; + } + }, [visualElement]); +} + +export { useMotionRef }; +//# sourceMappingURL=use-motion-ref.mjs.map diff --git a/node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.mjs.map b/node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.mjs.map new file mode 100644 index 0000000..029a602 --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-motion-ref.mjs","sources":["../../../../src/motion/utils/use-motion-ref.ts"],"sourcesContent":["\"use client\"\n\nimport type { VisualElement } from \"motion-dom\"\nimport * as React from \"react\"\nimport { useCallback, useInsertionEffect, useRef } from \"react\"\nimport { VisualState } from \"./use-visual-state\"\n\n/**\n * Creates a ref function that, when called, hydrates the provided\n * external ref and VisualElement.\n */\nexport function useMotionRef(\n visualState: VisualState,\n visualElement?: VisualElement | null,\n externalRef?: React.Ref\n): React.Ref {\n /**\n * Store externalRef in a ref to avoid including it in the useCallback\n * dependency array. Including externalRef in dependencies causes issues\n * with libraries like Radix UI that create new callback refs on each render\n * when using asChild - this would cause the callback to be recreated,\n * triggering element remounts and breaking AnimatePresence exit animations.\n */\n const externalRefContainer = useRef(externalRef)\n useInsertionEffect(() => {\n externalRefContainer.current = externalRef\n })\n\n // Store cleanup function returned by callback refs (React 19 feature)\n const refCleanup = useRef<(() => void) | null>(null)\n\n return useCallback(\n (instance: Instance) => {\n if (instance) {\n visualState.onMount?.(instance)\n }\n\n if (visualElement) {\n instance ? visualElement.mount(instance) : visualElement.unmount()\n }\n\n const ref = externalRefContainer.current\n if (typeof ref === \"function\") {\n if (instance) {\n const cleanup = ref(instance)\n if (typeof cleanup === \"function\") {\n refCleanup.current = cleanup\n }\n } else if (refCleanup.current) {\n refCleanup.current()\n refCleanup.current = null\n } else {\n ref(instance)\n }\n } else if (ref) {\n ;(ref as React.MutableRefObject).current = instance\n }\n },\n [visualElement]\n )\n}\n"],"names":[],"mappings":";;;AAOA;;;AAGG;;AAMC;;;;;;AAMG;AACH;;AAEI;AACJ;;AAGA;AAEA;;AAGY;;;AAIA;;AAGJ;AACA;;AAEQ;AACA;AACI;;;AAED;;AAEH;;;;;;;AAKF;;AAEV;AAGR;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/motion/utils/use-visual-element.mjs b/node_modules/framer-motion/dist/es/motion/utils/use-visual-element.mjs new file mode 100644 index 0000000..317f7cc --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/utils/use-visual-element.mjs @@ -0,0 +1,166 @@ +"use client"; +import { optimizedAppearDataAttribute } from 'motion-dom'; +import { useContext, useRef, useInsertionEffect, useEffect } from 'react'; +import { LazyContext } from '../../context/LazyContext.mjs'; +import { MotionConfigContext } from '../../context/MotionConfigContext.mjs'; +import { MotionContext } from '../../context/MotionContext/index.mjs'; +import { PresenceContext } from '../../context/PresenceContext.mjs'; +import { SwitchLayoutGroupContext } from '../../context/SwitchLayoutGroupContext.mjs'; +import { isRefObject } from '../../utils/is-ref-object.mjs'; +import { useIsomorphicLayoutEffect } from '../../utils/use-isomorphic-effect.mjs'; + +function useVisualElement(Component, visualState, props, createVisualElement, ProjectionNodeConstructor, isSVG) { + const { visualElement: parent } = useContext(MotionContext); + const lazyContext = useContext(LazyContext); + const presenceContext = useContext(PresenceContext); + const motionConfig = useContext(MotionConfigContext); + const reducedMotionConfig = motionConfig.reducedMotion; + const skipAnimations = motionConfig.skipAnimations; + const visualElementRef = useRef(null); + /** + * Track whether the component has been through React's commit phase. + * Used to detect when LazyMotion features load after the component has mounted. + */ + const hasMountedOnce = useRef(false); + /** + * If we haven't preloaded a renderer, check to see if we have one lazy-loaded + */ + createVisualElement = + createVisualElement || + lazyContext.renderer; + if (!visualElementRef.current && createVisualElement) { + visualElementRef.current = createVisualElement(Component, { + visualState, + parent, + props, + presenceContext, + blockInitialAnimation: presenceContext + ? presenceContext.initial === false + : false, + reducedMotionConfig, + skipAnimations, + isSVG, + }); + /** + * If the component has already mounted before features loaded (e.g. via + * LazyMotion with async feature loading), we need to force the initial + * animation to run. Otherwise state changes that occurred before features + * loaded will be lost and the element will snap to its final state. + */ + if (hasMountedOnce.current && visualElementRef.current) { + visualElementRef.current.manuallyAnimateOnMount = true; + } + } + const visualElement = visualElementRef.current; + /** + * Load Motion gesture and animation features. These are rendered as renderless + * components so each feature can optionally make use of React lifecycle methods. + */ + const initialLayoutGroupConfig = useContext(SwitchLayoutGroupContext); + if (visualElement && + !visualElement.projection && + ProjectionNodeConstructor && + (visualElement.type === "html" || visualElement.type === "svg")) { + createProjectionNode(visualElementRef.current, props, ProjectionNodeConstructor, initialLayoutGroupConfig); + } + const isMounted = useRef(false); + useInsertionEffect(() => { + /** + * Check the component has already mounted before calling + * `update` unnecessarily. This ensures we skip the initial update. + */ + if (visualElement && isMounted.current) { + visualElement.update(props, presenceContext); + } + }); + /** + * Cache this value as we want to know whether HandoffAppearAnimations + * was present on initial render - it will be deleted after this. + */ + const optimisedAppearId = props[optimizedAppearDataAttribute]; + const wantsHandoff = useRef(Boolean(optimisedAppearId) && + typeof window !== "undefined" && + !window.MotionHandoffIsComplete?.(optimisedAppearId) && + window.MotionHasOptimisedAnimation?.(optimisedAppearId)); + useIsomorphicLayoutEffect(() => { + /** + * Track that this component has mounted. This is used to detect when + * LazyMotion features load after the component has already committed. + */ + hasMountedOnce.current = true; + if (!visualElement) + return; + isMounted.current = true; + window.MotionIsMounted = true; + visualElement.updateFeatures(); + visualElement.scheduleRenderMicrotask(); + /** + * Ideally this function would always run in a useEffect. + * + * However, if we have optimised appear animations to handoff from, + * it needs to happen synchronously to ensure there's no flash of + * incorrect styles in the event of a hydration error. + * + * So if we detect a situtation where optimised appear animations + * are running, we use useLayoutEffect to trigger animations. + */ + if (wantsHandoff.current && visualElement.animationState) { + visualElement.animationState.animateChanges(); + } + }); + useEffect(() => { + if (!visualElement) + return; + if (!wantsHandoff.current && visualElement.animationState) { + visualElement.animationState.animateChanges(); + } + if (wantsHandoff.current) { + // This ensures all future calls to animateChanges() in this component will run in useEffect + queueMicrotask(() => { + window.MotionHandoffMarkAsComplete?.(optimisedAppearId); + }); + wantsHandoff.current = false; + } + /** + * Now we've finished triggering animations for this element we + * can wipe the enteringChildren set for the next render. + */ + visualElement.enteringChildren = undefined; + }); + return visualElement; +} +function createProjectionNode(visualElement, props, ProjectionNodeConstructor, initialPromotionConfig) { + const { layoutId, layout, drag, dragConstraints, layoutScroll, layoutRoot, layoutAnchor, layoutCrossfade, } = props; + visualElement.projection = new ProjectionNodeConstructor(visualElement.latestValues, props["data-framer-portal-id"] + ? undefined + : getClosestProjectingNode(visualElement.parent)); + visualElement.projection.setOptions({ + layoutId, + layout, + alwaysMeasureLayout: Boolean(drag) || (dragConstraints && isRefObject(dragConstraints)), + visualElement, + /** + * TODO: Update options in an effect. This could be tricky as it'll be too late + * to update by the time layout animations run. + * We also need to fix this safeToRemove by linking it up to the one returned by usePresence, + * ensuring it gets called if there's no potential layout animations. + * + */ + animationType: typeof layout === "string" ? layout : "both", + initialPromotionConfig, + crossfade: layoutCrossfade, + layoutScroll, + layoutRoot, + layoutAnchor, + }); +} +function getClosestProjectingNode(visualElement) { + if (!visualElement) + return undefined; + return visualElement.options.allowProjection !== false + ? visualElement.projection + : getClosestProjectingNode(visualElement.parent); +} + +export { useVisualElement }; +//# sourceMappingURL=use-visual-element.mjs.map diff --git a/node_modules/framer-motion/dist/es/motion/utils/use-visual-element.mjs.map b/node_modules/framer-motion/dist/es/motion/utils/use-visual-element.mjs.map new file mode 100644 index 0000000..e5fa364 --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/utils/use-visual-element.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-visual-element.mjs","sources":["../../../../src/motion/utils/use-visual-element.ts"],"sourcesContent":["\"use client\"\n\nimport {\n optimizedAppearDataAttribute,\n type HTMLRenderState,\n type SVGRenderState,\n type VisualElement,\n} from \"motion-dom\"\nimport * as React from \"react\"\nimport { useContext, useEffect, useInsertionEffect, useRef } from \"react\"\nimport { LazyContext } from \"../../context/LazyContext\"\nimport { MotionConfigContext } from \"../../context/MotionConfigContext\"\nimport { MotionContext } from \"../../context/MotionContext\"\nimport { PresenceContext } from \"../../context/PresenceContext\"\nimport {\n InitialPromotionConfig,\n SwitchLayoutGroupContext,\n} from \"../../context/SwitchLayoutGroupContext\"\nimport { MotionProps } from \"../../motion/types\"\nimport type { IProjectionNode } from \"motion-dom\"\nimport { DOMMotionComponents } from \"../../render/dom/types\"\nimport { CreateVisualElement } from \"../../render/types\"\nimport { isRefObject } from \"../../utils/is-ref-object\"\nimport { useIsomorphicLayoutEffect } from \"../../utils/use-isomorphic-effect\"\nimport { VisualState } from \"./use-visual-state\"\n\nexport function useVisualElement<\n Props,\n TagName extends keyof DOMMotionComponents | string\n>(\n Component: TagName | string | React.ComponentType,\n visualState:\n | VisualState\n | VisualState,\n props: MotionProps & Partial,\n createVisualElement?: CreateVisualElement,\n ProjectionNodeConstructor?: any,\n isSVG?: boolean\n): VisualElement | undefined {\n const { visualElement: parent } = useContext(MotionContext)\n const lazyContext = useContext(LazyContext)\n const presenceContext = useContext(PresenceContext)\n const motionConfig = useContext(MotionConfigContext)\n const reducedMotionConfig = motionConfig.reducedMotion\n const skipAnimations = motionConfig.skipAnimations\n\n const visualElementRef = useRef | null>(null)\n\n /**\n * Track whether the component has been through React's commit phase.\n * Used to detect when LazyMotion features load after the component has mounted.\n */\n const hasMountedOnce = useRef(false)\n\n /**\n * If we haven't preloaded a renderer, check to see if we have one lazy-loaded\n */\n createVisualElement =\n createVisualElement ||\n (lazyContext.renderer as CreateVisualElement)\n\n if (!visualElementRef.current && createVisualElement) {\n visualElementRef.current = createVisualElement(Component, {\n visualState,\n parent,\n props,\n presenceContext,\n blockInitialAnimation: presenceContext\n ? presenceContext.initial === false\n : false,\n reducedMotionConfig,\n skipAnimations,\n isSVG,\n })\n\n /**\n * If the component has already mounted before features loaded (e.g. via\n * LazyMotion with async feature loading), we need to force the initial\n * animation to run. Otherwise state changes that occurred before features\n * loaded will be lost and the element will snap to its final state.\n */\n if (hasMountedOnce.current && visualElementRef.current) {\n visualElementRef.current.manuallyAnimateOnMount = true\n }\n }\n\n const visualElement = visualElementRef.current\n\n /**\n * Load Motion gesture and animation features. These are rendered as renderless\n * components so each feature can optionally make use of React lifecycle methods.\n */\n const initialLayoutGroupConfig = useContext(SwitchLayoutGroupContext)\n\n if (\n visualElement &&\n !visualElement.projection &&\n ProjectionNodeConstructor &&\n (visualElement.type === \"html\" || visualElement.type === \"svg\")\n ) {\n createProjectionNode(\n visualElementRef.current!,\n props,\n ProjectionNodeConstructor,\n initialLayoutGroupConfig\n )\n }\n\n const isMounted = useRef(false)\n useInsertionEffect(() => {\n /**\n * Check the component has already mounted before calling\n * `update` unnecessarily. This ensures we skip the initial update.\n */\n if (visualElement && isMounted.current) {\n visualElement.update(props, presenceContext)\n }\n })\n\n /**\n * Cache this value as we want to know whether HandoffAppearAnimations\n * was present on initial render - it will be deleted after this.\n */\n const optimisedAppearId =\n props[optimizedAppearDataAttribute as keyof typeof props]\n const wantsHandoff = useRef(\n Boolean(optimisedAppearId) &&\n typeof window !== \"undefined\" &&\n !window.MotionHandoffIsComplete?.(optimisedAppearId) &&\n window.MotionHasOptimisedAnimation?.(optimisedAppearId)\n )\n\n useIsomorphicLayoutEffect(() => {\n /**\n * Track that this component has mounted. This is used to detect when\n * LazyMotion features load after the component has already committed.\n */\n hasMountedOnce.current = true\n\n if (!visualElement) return\n\n isMounted.current = true\n window.MotionIsMounted = true\n\n visualElement.updateFeatures()\n visualElement.scheduleRenderMicrotask()\n\n /**\n * Ideally this function would always run in a useEffect.\n *\n * However, if we have optimised appear animations to handoff from,\n * it needs to happen synchronously to ensure there's no flash of\n * incorrect styles in the event of a hydration error.\n *\n * So if we detect a situtation where optimised appear animations\n * are running, we use useLayoutEffect to trigger animations.\n */\n if (wantsHandoff.current && visualElement.animationState) {\n visualElement.animationState.animateChanges()\n }\n })\n\n useEffect(() => {\n if (!visualElement) return\n\n if (!wantsHandoff.current && visualElement.animationState) {\n visualElement.animationState.animateChanges()\n }\n\n if (wantsHandoff.current) {\n // This ensures all future calls to animateChanges() in this component will run in useEffect\n queueMicrotask(() => {\n window.MotionHandoffMarkAsComplete?.(optimisedAppearId)\n })\n\n wantsHandoff.current = false\n }\n\n /**\n * Now we've finished triggering animations for this element we\n * can wipe the enteringChildren set for the next render.\n */\n visualElement.enteringChildren = undefined\n })\n\n return visualElement!\n}\n\nfunction createProjectionNode(\n visualElement: VisualElement,\n props: MotionProps,\n ProjectionNodeConstructor: any,\n initialPromotionConfig?: InitialPromotionConfig\n) {\n const {\n layoutId,\n layout,\n drag,\n dragConstraints,\n layoutScroll,\n layoutRoot,\n layoutAnchor,\n layoutCrossfade,\n } = props\n\n visualElement.projection = new ProjectionNodeConstructor(\n visualElement.latestValues,\n props[\"data-framer-portal-id\"]\n ? undefined\n : getClosestProjectingNode(visualElement.parent)\n ) as IProjectionNode\n\n visualElement.projection.setOptions({\n layoutId,\n layout,\n alwaysMeasureLayout:\n Boolean(drag) || (dragConstraints && isRefObject(dragConstraints)),\n visualElement,\n /**\n * TODO: Update options in an effect. This could be tricky as it'll be too late\n * to update by the time layout animations run.\n * We also need to fix this safeToRemove by linking it up to the one returned by usePresence,\n * ensuring it gets called if there's no potential layout animations.\n *\n */\n animationType: typeof layout === \"string\" ? layout : \"both\",\n initialPromotionConfig,\n crossfade: layoutCrossfade,\n layoutScroll,\n layoutRoot,\n layoutAnchor,\n })\n}\n\nfunction getClosestProjectingNode(\n visualElement?: VisualElement<\n unknown,\n unknown,\n { allowProjection?: boolean }\n >\n): IProjectionNode | undefined {\n if (!visualElement) return undefined\n\n return visualElement.options.allowProjection !== false\n ? visualElement.projection\n : getClosestProjectingNode(visualElement.parent)\n}\n"],"names":[],"mappings":";;;;;;;;;;;AA0BM;;AAcF;AACA;AACA;AACA;AACA;AAEA;AAIA;;;AAGG;AACH;AAEA;;AAEG;;;;AAKH;AACI;;;;;AAKI;AACI;AACA;;;;AAIP;AAED;;;;;AAKG;;AAEC;;;AAIR;AAEA;;;AAGG;AACH;AAEA;;;AAII;;;AAUJ;;AAEI;;;AAGG;AACH;AACI;;AAER;AAEA;;;AAGG;AACH;AAEA;;AAGQ;AACA;;AAIJ;;;AAGG;AACH;AAEA;;AAEA;AACA;;;AAKA;;;;;;;;;AASG;;AAEC;;AAER;;AAGI;;;AAGI;;AAGJ;;;AAGQ;AACJ;AAEA;;AAGJ;;;AAGG;AACH;AACJ;AAEA;AACJ;AAEA;AAMI;AAWA;AAGQ;;AAIR;;;AAGI;;AAGA;;;;;;AAMG;AACH;;AAEA;;;;AAIH;AACL;AAEA;AAOI;AAAoB;AAEpB;;AAEI;AACR;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/motion/utils/use-visual-state.mjs b/node_modules/framer-motion/dist/es/motion/utils/use-visual-state.mjs new file mode 100644 index 0000000..433af58 --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/utils/use-visual-state.mjs @@ -0,0 +1,78 @@ +"use client"; +import { resolveMotionValue, isControllingVariants, isVariantNode, isAnimationControls, resolveVariantFromProps } from 'motion-dom'; +import { useContext } from 'react'; +import { MotionContext } from '../../context/MotionContext/index.mjs'; +import { PresenceContext } from '../../context/PresenceContext.mjs'; +import { useConstant } from '../../utils/use-constant.mjs'; + +function makeState({ scrapeMotionValuesFromProps, createRenderState, }, props, context, presenceContext) { + const state = { + latestValues: makeLatestValues(props, context, presenceContext, scrapeMotionValuesFromProps), + renderState: createRenderState(), + }; + return state; +} +function makeLatestValues(props, context, presenceContext, scrapeMotionValues) { + const values = {}; + const motionValues = scrapeMotionValues(props, {}); + for (const key in motionValues) { + values[key] = resolveMotionValue(motionValues[key]); + } + let { initial, animate } = props; + const isControllingVariants$1 = isControllingVariants(props); + const isVariantNode$1 = isVariantNode(props); + if (context && + isVariantNode$1 && + !isControllingVariants$1 && + props.inherit !== false) { + if (initial === undefined) + initial = context.initial; + if (animate === undefined) + animate = context.animate; + } + let isInitialAnimationBlocked = presenceContext + ? presenceContext.initial === false + : false; + isInitialAnimationBlocked = isInitialAnimationBlocked || initial === false; + const variantToSet = isInitialAnimationBlocked ? animate : initial; + if (variantToSet && + typeof variantToSet !== "boolean" && + !isAnimationControls(variantToSet)) { + const list = Array.isArray(variantToSet) ? variantToSet : [variantToSet]; + for (let i = 0; i < list.length; i++) { + const resolved = resolveVariantFromProps(props, list[i]); + if (resolved) { + const { transitionEnd, transition, ...target } = resolved; + for (const key in target) { + let valueTarget = target[key]; + if (Array.isArray(valueTarget)) { + /** + * Take final keyframe if the initial animation is blocked because + * we want to initialise at the end of that blocked animation. + */ + const index = isInitialAnimationBlocked + ? valueTarget.length - 1 + : 0; + valueTarget = valueTarget[index]; + } + if (valueTarget !== null) { + values[key] = valueTarget; + } + } + for (const key in transitionEnd) { + values[key] = transitionEnd[key]; + } + } + } + } + return values; +} +const makeUseVisualState = (config) => (props, isStatic) => { + const context = useContext(MotionContext); + const presenceContext = useContext(PresenceContext); + const make = () => makeState(config, props, context, presenceContext); + return isStatic ? make() : useConstant(make); +}; + +export { makeUseVisualState }; +//# sourceMappingURL=use-visual-state.mjs.map diff --git a/node_modules/framer-motion/dist/es/motion/utils/use-visual-state.mjs.map b/node_modules/framer-motion/dist/es/motion/utils/use-visual-state.mjs.map new file mode 100644 index 0000000..bca2c6d --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/utils/use-visual-state.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-visual-state.mjs","sources":["../../../../src/motion/utils/use-visual-state.ts"],"sourcesContent":["\"use client\"\n\nimport {\n AnyResolvedKeyframe,\n isAnimationControls,\n isControllingVariants as checkIsControllingVariants,\n isVariantNode as checkIsVariantNode,\n ResolvedValues,\n resolveVariantFromProps,\n} from \"motion-dom\"\nimport { useContext } from \"react\"\nimport { MotionContext, MotionContextProps } from \"../../context/MotionContext\"\nimport {\n PresenceContext,\n type PresenceContextProps,\n} from \"../../context/PresenceContext\"\nimport { ScrapeMotionValuesFromProps } from \"../../render/types\"\nimport { useConstant } from \"../../utils/use-constant\"\nimport { resolveMotionValue } from \"motion-dom\"\nimport { MotionProps } from \"../types\"\n\nexport interface VisualState {\n renderState: RenderState\n latestValues: ResolvedValues\n onMount?: (instance: Instance) => void\n}\n\nexport type UseVisualState = (\n props: MotionProps,\n isStatic: boolean\n) => VisualState\n\nexport interface UseVisualStateConfig {\n scrapeMotionValuesFromProps: ScrapeMotionValuesFromProps\n createRenderState: () => RenderState\n}\n\nfunction makeState(\n {\n scrapeMotionValuesFromProps,\n createRenderState,\n }: UseVisualStateConfig,\n props: MotionProps,\n context: MotionContextProps,\n presenceContext: PresenceContextProps | null\n) {\n const state: VisualState = {\n latestValues: makeLatestValues(\n props,\n context,\n presenceContext,\n scrapeMotionValuesFromProps\n ),\n renderState: createRenderState(),\n }\n\n return state\n}\n\nfunction makeLatestValues(\n props: MotionProps,\n context: MotionContextProps,\n presenceContext: PresenceContextProps | null,\n scrapeMotionValues: ScrapeMotionValuesFromProps\n) {\n const values: ResolvedValues = {}\n\n const motionValues = scrapeMotionValues(props, {})\n for (const key in motionValues) {\n values[key] = resolveMotionValue(motionValues[key])\n }\n\n let { initial, animate } = props\n const isControllingVariants = checkIsControllingVariants(props)\n const isVariantNode = checkIsVariantNode(props)\n\n if (\n context &&\n isVariantNode &&\n !isControllingVariants &&\n props.inherit !== false\n ) {\n if (initial === undefined) initial = context.initial\n if (animate === undefined) animate = context.animate\n }\n\n let isInitialAnimationBlocked = presenceContext\n ? presenceContext.initial === false\n : false\n isInitialAnimationBlocked = isInitialAnimationBlocked || initial === false\n\n const variantToSet = isInitialAnimationBlocked ? animate : initial\n\n if (\n variantToSet &&\n typeof variantToSet !== \"boolean\" &&\n !isAnimationControls(variantToSet)\n ) {\n const list = Array.isArray(variantToSet) ? variantToSet : [variantToSet]\n for (let i = 0; i < list.length; i++) {\n const resolved = resolveVariantFromProps(props, list[i] as any)\n if (resolved) {\n const { transitionEnd, transition, ...target } = resolved\n for (const key in target) {\n let valueTarget = target[key as keyof typeof target]\n\n if (Array.isArray(valueTarget)) {\n /**\n * Take final keyframe if the initial animation is blocked because\n * we want to initialise at the end of that blocked animation.\n */\n const index = isInitialAnimationBlocked\n ? valueTarget.length - 1\n : 0\n valueTarget = valueTarget[index] as any\n }\n\n if (valueTarget !== null) {\n values[key] = valueTarget as AnyResolvedKeyframe\n }\n }\n for (const key in transitionEnd) {\n values[key] = transitionEnd[\n key as keyof typeof transitionEnd\n ] as AnyResolvedKeyframe\n }\n }\n }\n }\n\n return values\n}\n\nexport const makeUseVisualState =\n (config: UseVisualStateConfig): UseVisualState =>\n (props: MotionProps, isStatic: boolean): VisualState => {\n const context = useContext(MotionContext)\n const presenceContext = useContext(PresenceContext)\n const make = () => makeState(config, props, context, presenceContext)\n\n return isStatic ? make() : useConstant(make)\n }\n"],"names":[],"mappings":";;;;;;;AAqCA;AASI;;;;AAUA;AACJ;AAEA;;;AASI;;;AAIA;AACA;AACA;AAEA;;AAGI;AACA;;AAE2B;;AACA;;;AAI3B;;AAEJ;;AAIA;;AAGI;AAEA;AACA;;;;AAIQ;AACI;AAEA;AACI;;;AAGG;;AAEC;;AAEJ;;AAGJ;AACI;;;AAGR;;;;;;AASZ;AACJ;AAEO;AAGC;AACA;AACA;AAEA;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/motion/utils/valid-prop.mjs b/node_modules/framer-motion/dist/es/motion/utils/valid-prop.mjs new file mode 100644 index 0000000..e4c52d6 --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/utils/valid-prop.mjs @@ -0,0 +1,59 @@ +/** + * A list of all valid MotionProps. + * + * @privateRemarks + * This doesn't throw if a `MotionProp` name is missing - it should. + */ +const validMotionProps = new Set([ + "animate", + "exit", + "variants", + "initial", + "style", + "values", + "variants", + "transition", + "transformTemplate", + "custom", + "inherit", + "onBeforeLayoutMeasure", + "onAnimationStart", + "onAnimationComplete", + "onUpdate", + "onDragStart", + "onDrag", + "onDragEnd", + "onMeasureDragConstraints", + "onDirectionLock", + "onDragTransitionEnd", + "_dragX", + "_dragY", + "onHoverStart", + "onHoverEnd", + "onViewportEnter", + "onViewportLeave", + "globalTapTarget", + "propagate", + "ignoreStrict", + "viewport", +]); +/** + * Check whether a prop name is a valid `MotionProp` key. + * + * @param key - Name of the property to check + * @returns `true` is key is a valid `MotionProp`. + * + * @public + */ +function isValidMotionProp(key) { + return (key.startsWith("while") || + (key.startsWith("drag") && key !== "draggable") || + key.startsWith("layout") || + key.startsWith("onTap") || + key.startsWith("onPan") || + key.startsWith("onLayout") || + validMotionProps.has(key)); +} + +export { isValidMotionProp }; +//# sourceMappingURL=valid-prop.mjs.map diff --git a/node_modules/framer-motion/dist/es/motion/utils/valid-prop.mjs.map b/node_modules/framer-motion/dist/es/motion/utils/valid-prop.mjs.map new file mode 100644 index 0000000..0d7bdd0 --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/utils/valid-prop.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"valid-prop.mjs","sources":["../../../../src/motion/utils/valid-prop.ts"],"sourcesContent":["import { MotionProps } from \"../types\"\n\n/**\n * A list of all valid MotionProps.\n *\n * @privateRemarks\n * This doesn't throw if a `MotionProp` name is missing - it should.\n */\nconst validMotionProps = new Set([\n \"animate\",\n \"exit\",\n \"variants\",\n \"initial\",\n \"style\",\n \"values\",\n \"variants\",\n \"transition\",\n \"transformTemplate\",\n \"custom\",\n \"inherit\",\n \"onBeforeLayoutMeasure\",\n \"onAnimationStart\",\n \"onAnimationComplete\",\n \"onUpdate\",\n \"onDragStart\",\n \"onDrag\",\n \"onDragEnd\",\n \"onMeasureDragConstraints\",\n \"onDirectionLock\",\n \"onDragTransitionEnd\",\n \"_dragX\",\n \"_dragY\",\n \"onHoverStart\",\n \"onHoverEnd\",\n \"onViewportEnter\",\n \"onViewportLeave\",\n \"globalTapTarget\",\n \"propagate\",\n \"ignoreStrict\",\n \"viewport\",\n])\n\n/**\n * Check whether a prop name is a valid `MotionProp` key.\n *\n * @param key - Name of the property to check\n * @returns `true` is key is a valid `MotionProp`.\n *\n * @public\n */\nexport function isValidMotionProp(key: string) {\n return (\n key.startsWith(\"while\") ||\n (key.startsWith(\"drag\") && key !== \"draggable\") ||\n key.startsWith(\"layout\") ||\n key.startsWith(\"onTap\") ||\n key.startsWith(\"onPan\") ||\n key.startsWith(\"onLayout\") ||\n validMotionProps.has(key as keyof MotionProps)\n )\n}\n"],"names":[],"mappings":"AAEA;;;;;AAKG;AACH,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAoB;IAChD,SAAS;IACT,MAAM;IACN,UAAU;IACV,SAAS;IACT,OAAO;IACP,QAAQ;IACR,UAAU;IACV,YAAY;IACZ,mBAAmB;IACnB,QAAQ;IACR,SAAS;IACT,uBAAuB;IACvB,kBAAkB;IAClB,qBAAqB;IACrB,UAAU;IACV,aAAa;IACb,QAAQ;IACR,WAAW;IACX,0BAA0B;IAC1B,iBAAiB;IACjB,qBAAqB;IACrB,QAAQ;IACR,QAAQ;IACR,cAAc;IACd,YAAY;IACZ,iBAAiB;IACjB,iBAAiB;IACjB,iBAAiB;IACjB,WAAW;IACX,cAAc;IACd,UAAU;AACb,CAAA,CAAC;AAEF;;;;;;;AAOG;AACG,SAAU,iBAAiB,CAAC,GAAW,EAAA;AACzC,IAAA,QACI,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC;SACtB,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,GAAG,KAAK,WAAW,CAAC;AAC/C,QAAA,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC;AACxB,QAAA,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC;AACvB,QAAA,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC;AACvB,QAAA,GAAG,CAAC,UAAU,CAAC,UAAU,CAAC;AAC1B,QAAA,gBAAgB,CAAC,GAAG,CAAC,GAAwB,CAAC;AAEtD;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/projection.mjs b/node_modules/framer-motion/dist/es/projection.mjs new file mode 100644 index 0000000..902c523 --- /dev/null +++ b/node_modules/framer-motion/dist/es/projection.mjs @@ -0,0 +1,2 @@ +export { HTMLProjectionNode, HTMLVisualElement, addScaleCorrector, buildTransform, calcBoxDelta, correctBorderRadius, correctBoxShadow, frame, frameData, mix, nodeGroup, recordStats, statsBuffer } from 'motion-dom'; +//# sourceMappingURL=projection.mjs.map diff --git a/node_modules/framer-motion/dist/es/projection.mjs.map b/node_modules/framer-motion/dist/es/projection.mjs.map new file mode 100644 index 0000000..2f608b0 --- /dev/null +++ b/node_modules/framer-motion/dist/es/projection.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"projection.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/projection/use-instant-layout-transition.mjs b/node_modules/framer-motion/dist/es/projection/use-instant-layout-transition.mjs new file mode 100644 index 0000000..914d498 --- /dev/null +++ b/node_modules/framer-motion/dist/es/projection/use-instant-layout-transition.mjs @@ -0,0 +1,15 @@ +import { rootProjectionNode } from 'motion-dom'; + +function useInstantLayoutTransition() { + return startTransition; +} +function startTransition(callback) { + if (!rootProjectionNode.current) + return; + rootProjectionNode.current.isUpdating = false; + rootProjectionNode.current.blockUpdate(); + callback && callback(); +} + +export { useInstantLayoutTransition }; +//# sourceMappingURL=use-instant-layout-transition.mjs.map diff --git a/node_modules/framer-motion/dist/es/projection/use-instant-layout-transition.mjs.map b/node_modules/framer-motion/dist/es/projection/use-instant-layout-transition.mjs.map new file mode 100644 index 0000000..4186a7d --- /dev/null +++ b/node_modules/framer-motion/dist/es/projection/use-instant-layout-transition.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-instant-layout-transition.mjs","sources":["../../../src/projection/use-instant-layout-transition.ts"],"sourcesContent":["import { rootProjectionNode } from \"motion-dom\"\n\nexport function useInstantLayoutTransition(): (\n cb?: (() => void) | undefined\n) => void {\n return startTransition\n}\n\nfunction startTransition(callback?: () => void) {\n if (!rootProjectionNode.current) return\n rootProjectionNode.current.isUpdating = false\n rootProjectionNode.current.blockUpdate()\n callback && callback()\n}\n"],"names":[],"mappings":";;SAEgB,0BAA0B,GAAA;AAGtC,IAAA,OAAO,eAAe;AAC1B;AAEA,SAAS,eAAe,CAAC,QAAqB,EAAA;IAC1C,IAAI,CAAC,kBAAkB,CAAC,OAAO;QAAE;AACjC,IAAA,kBAAkB,CAAC,OAAO,CAAC,UAAU,GAAG,KAAK;AAC7C,IAAA,kBAAkB,CAAC,OAAO,CAAC,WAAW,EAAE;IACxC,QAAQ,IAAI,QAAQ,EAAE;AAC1B;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/projection/use-reset-projection.mjs b/node_modules/framer-motion/dist/es/projection/use-reset-projection.mjs new file mode 100644 index 0000000..4ef3e87 --- /dev/null +++ b/node_modules/framer-motion/dist/es/projection/use-reset-projection.mjs @@ -0,0 +1,15 @@ +import { useCallback } from 'react'; +import { rootProjectionNode } from 'motion-dom'; + +function useResetProjection() { + const reset = useCallback(() => { + const root = rootProjectionNode.current; + if (!root) + return; + root.resetTree(); + }, []); + return reset; +} + +export { useResetProjection }; +//# sourceMappingURL=use-reset-projection.mjs.map diff --git a/node_modules/framer-motion/dist/es/projection/use-reset-projection.mjs.map b/node_modules/framer-motion/dist/es/projection/use-reset-projection.mjs.map new file mode 100644 index 0000000..9e26d99 --- /dev/null +++ b/node_modules/framer-motion/dist/es/projection/use-reset-projection.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-reset-projection.mjs","sources":["../../../src/projection/use-reset-projection.ts"],"sourcesContent":["import { useCallback } from \"react\";\nimport { rootProjectionNode } from \"motion-dom\"\n\nexport function useResetProjection() {\n const reset = useCallback(() => {\n const root = rootProjectionNode.current\n if (!root) return\n root.resetTree()\n }, [])\n\n return reset\n}\n"],"names":[],"mappings":";;;SAGgB,kBAAkB,GAAA;AAC9B,IAAA,MAAM,KAAK,GAAG,WAAW,CAAC,MAAK;AAC3B,QAAA,MAAM,IAAI,GAAG,kBAAkB,CAAC,OAAO;AACvC,QAAA,IAAI,CAAC,IAAI;YAAE;QACX,IAAI,CAAC,SAAS,EAAE;IACpB,CAAC,EAAE,EAAE,CAAC;AAEN,IAAA,OAAO,KAAK;AAChB;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/components/create-proxy.mjs b/node_modules/framer-motion/dist/es/render/components/create-proxy.mjs new file mode 100644 index 0000000..5252bc2 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/components/create-proxy.mjs @@ -0,0 +1,46 @@ +import { warnOnce } from 'motion-utils'; +import { createMotionComponent } from '../../motion/index.mjs'; + +function createMotionProxy(preloadedFeatures, createVisualElement) { + if (typeof Proxy === "undefined") { + return createMotionComponent; + } + /** + * A cache of generated `motion` components, e.g `motion.div`, `motion.input` etc. + * Rather than generating them anew every render. + */ + const componentCache = new Map(); + const factory = (Component, options) => { + return createMotionComponent(Component, options, preloadedFeatures, createVisualElement); + }; + /** + * Support for deprecated`motion(Component)` pattern + */ + const deprecatedFactoryFunction = (Component, options) => { + if (process.env.NODE_ENV !== "production") { + warnOnce(false, "motion() is deprecated. Use motion.create() instead."); + } + return factory(Component, options); + }; + return new Proxy(deprecatedFactoryFunction, { + /** + * Called when `motion` is referenced with a prop: `motion.div`, `motion.input` etc. + * The prop name is passed through as `key` and we can use that to generate a `motion` + * DOM component with that name. + */ + get: (_target, key) => { + if (key === "create") + return factory; + /** + * If this element doesn't exist in the component cache, create it and cache. + */ + if (!componentCache.has(key)) { + componentCache.set(key, createMotionComponent(key, undefined, preloadedFeatures, createVisualElement)); + } + return componentCache.get(key); + }, + }); +} + +export { createMotionProxy }; +//# sourceMappingURL=create-proxy.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/components/create-proxy.mjs.map b/node_modules/framer-motion/dist/es/render/components/create-proxy.mjs.map new file mode 100644 index 0000000..c220c4d --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/components/create-proxy.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"create-proxy.mjs","sources":["../../../../src/render/components/create-proxy.ts"],"sourcesContent":["import { warnOnce } from \"motion-utils\"\nimport { createMotionComponent, MotionComponentOptions } from \"../../motion\"\nimport { FeaturePackages } from \"../../motion/features/types\"\nimport { MotionProps } from \"../../motion/types\"\nimport { DOMMotionComponents } from \"../dom/types\"\nimport { CreateVisualElement } from \"../types\"\n\n/**\n * I'd rather the return type of `custom` to be implicit but this throws\n * incorrect relative paths in the exported types and API Extractor throws\n * a wobbly.\n */\ntype ComponentProps = React.PropsWithoutRef &\n React.RefAttributes\nexport type CustomDomComponent = React.ComponentType<\n ComponentProps\n>\n\ntype MotionProxy = typeof createMotionComponent &\n DOMMotionComponents & { create: typeof createMotionComponent }\n\nexport function createMotionProxy(\n preloadedFeatures?: FeaturePackages,\n createVisualElement?: CreateVisualElement\n): MotionProxy {\n if (typeof Proxy === \"undefined\") {\n return createMotionComponent as MotionProxy\n }\n\n /**\n * A cache of generated `motion` components, e.g `motion.div`, `motion.input` etc.\n * Rather than generating them anew every render.\n */\n const componentCache = new Map()\n\n const factory = (Component: string, options?: MotionComponentOptions) => {\n return createMotionComponent(\n Component,\n options,\n preloadedFeatures,\n createVisualElement\n )\n }\n\n /**\n * Support for deprecated`motion(Component)` pattern\n */\n const deprecatedFactoryFunction = (\n Component: string,\n options?: MotionComponentOptions\n ) => {\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(\n false,\n \"motion() is deprecated. Use motion.create() instead.\"\n )\n }\n return factory(Component, options)\n }\n\n return new Proxy(deprecatedFactoryFunction, {\n /**\n * Called when `motion` is referenced with a prop: `motion.div`, `motion.input` etc.\n * The prop name is passed through as `key` and we can use that to generate a `motion`\n * DOM component with that name.\n */\n get: (_target, key: string) => {\n if (key === \"create\") return factory\n\n /**\n * If this element doesn't exist in the component cache, create it and cache.\n */\n if (!componentCache.has(key)) {\n componentCache.set(\n key,\n createMotionComponent(\n key,\n undefined,\n preloadedFeatures,\n createVisualElement\n )\n )\n }\n\n return componentCache.get(key)!\n },\n }) as MotionProxy\n}\n"],"names":[],"mappings":";;;AAqBM,SAAU,iBAAiB,CAC7B,iBAAmC,EACnC,mBAAmD,EAAA;AAEnD,IAAA,IAAI,OAAO,KAAK,KAAK,WAAW,EAAE;AAC9B,QAAA,OAAO,qBAAoC;IAC/C;AAEA;;;AAGG;AACH,IAAA,MAAM,cAAc,GAAG,IAAI,GAAG,EAAe;AAE7C,IAAA,MAAM,OAAO,GAAG,CAAC,SAAiB,EAAE,OAAgC,KAAI;QACpE,OAAO,qBAAqB,CACxB,SAAS,EACT,OAAO,EACP,iBAAiB,EACjB,mBAAmB,CACtB;AACL,IAAA,CAAC;AAED;;AAEG;AACH,IAAA,MAAM,yBAAyB,GAAG,CAC9B,SAAiB,EACjB,OAAgC,KAChC;QACA,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE;AACvC,YAAA,QAAQ,CACJ,KAAK,EACL,sDAAsD,CACzD;QACL;AACA,QAAA,OAAO,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC;AACtC,IAAA,CAAC;AAED,IAAA,OAAO,IAAI,KAAK,CAAC,yBAAyB,EAAE;AACxC;;;;AAIG;AACH,QAAA,GAAG,EAAE,CAAC,OAAO,EAAE,GAAW,KAAI;YAC1B,IAAI,GAAG,KAAK,QAAQ;AAAE,gBAAA,OAAO,OAAO;AAEpC;;AAEG;YACH,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;AAC1B,gBAAA,cAAc,CAAC,GAAG,CACd,GAAG,EACH,qBAAqB,CACjB,GAAG,EACH,SAAS,EACT,iBAAiB,EACjB,mBAAmB,CACtB,CACJ;YACL;AAEA,YAAA,OAAO,cAAc,CAAC,GAAG,CAAC,GAAG,CAAE;QACnC,CAAC;AACJ,KAAA,CAAgB;AACrB;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/components/m/create.mjs b/node_modules/framer-motion/dist/es/render/components/m/create.mjs new file mode 100644 index 0000000..48a923c --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/components/m/create.mjs @@ -0,0 +1,8 @@ +import { createMotionComponent } from '../../../motion/index.mjs'; + +function createMinimalMotionComponent(Component, options) { + return createMotionComponent(Component, options); +} + +export { createMinimalMotionComponent }; +//# sourceMappingURL=create.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/components/m/create.mjs.map b/node_modules/framer-motion/dist/es/render/components/m/create.mjs.map new file mode 100644 index 0000000..8c46836 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/components/m/create.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"create.mjs","sources":["../../../../../src/render/components/m/create.ts"],"sourcesContent":["import { createMotionComponent, MotionComponentOptions } from \"../../../motion\"\nimport { DOMMotionComponents } from \"../../dom/types\"\n\nexport function createMinimalMotionComponent<\n Props,\n TagName extends keyof DOMMotionComponents | string = \"div\"\n>(\n Component: TagName | string | React.ComponentType,\n options?: MotionComponentOptions\n) {\n return createMotionComponent(Component, options)\n}\n"],"names":[],"mappings":";;AAGM,SAAU,4BAA4B,CAIxC,SAAwD,EACxD,OAAgC,EAAA;AAEhC,IAAA,OAAO,qBAAqB,CAAC,SAAS,EAAE,OAAO,CAAC;AACpD;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/components/m/elements.mjs b/node_modules/framer-motion/dist/es/render/components/m/elements.mjs new file mode 100644 index 0000000..7f37fed --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/components/m/elements.mjs @@ -0,0 +1,228 @@ +"use client"; +import { createMinimalMotionComponent } from './create.mjs'; + +/** + * HTML components + */ +const MotionA = /*@__PURE__*/ createMinimalMotionComponent("a"); +const MotionAbbr = /*@__PURE__*/ createMinimalMotionComponent("abbr"); +const MotionAddress = +/*@__PURE__*/ createMinimalMotionComponent("address"); +const MotionArea = /*@__PURE__*/ createMinimalMotionComponent("area"); +const MotionArticle = +/*@__PURE__*/ createMinimalMotionComponent("article"); +const MotionAside = /*@__PURE__*/ createMinimalMotionComponent("aside"); +const MotionAudio = /*@__PURE__*/ createMinimalMotionComponent("audio"); +const MotionB = /*@__PURE__*/ createMinimalMotionComponent("b"); +const MotionBase = /*@__PURE__*/ createMinimalMotionComponent("base"); +const MotionBdi = /*@__PURE__*/ createMinimalMotionComponent("bdi"); +const MotionBdo = /*@__PURE__*/ createMinimalMotionComponent("bdo"); +const MotionBig = /*@__PURE__*/ createMinimalMotionComponent("big"); +const MotionBlockquote = +/*@__PURE__*/ createMinimalMotionComponent("blockquote"); +const MotionBody = /*@__PURE__*/ createMinimalMotionComponent("body"); +const MotionButton = /*@__PURE__*/ createMinimalMotionComponent("button"); +const MotionCanvas = /*@__PURE__*/ createMinimalMotionComponent("canvas"); +const MotionCaption = +/*@__PURE__*/ createMinimalMotionComponent("caption"); +const MotionCite = /*@__PURE__*/ createMinimalMotionComponent("cite"); +const MotionCode = /*@__PURE__*/ createMinimalMotionComponent("code"); +const MotionCol = /*@__PURE__*/ createMinimalMotionComponent("col"); +const MotionColgroup = +/*@__PURE__*/ createMinimalMotionComponent("colgroup"); +const MotionData = /*@__PURE__*/ createMinimalMotionComponent("data"); +const MotionDatalist = +/*@__PURE__*/ createMinimalMotionComponent("datalist"); +const MotionDd = /*@__PURE__*/ createMinimalMotionComponent("dd"); +const MotionDel = /*@__PURE__*/ createMinimalMotionComponent("del"); +const MotionDetails = +/*@__PURE__*/ createMinimalMotionComponent("details"); +const MotionDfn = /*@__PURE__*/ createMinimalMotionComponent("dfn"); +const MotionDialog = /*@__PURE__*/ createMinimalMotionComponent("dialog"); +const MotionDiv = /*@__PURE__*/ createMinimalMotionComponent("div"); +const MotionDl = /*@__PURE__*/ createMinimalMotionComponent("dl"); +const MotionDt = /*@__PURE__*/ createMinimalMotionComponent("dt"); +const MotionEm = /*@__PURE__*/ createMinimalMotionComponent("em"); +const MotionEmbed = /*@__PURE__*/ createMinimalMotionComponent("embed"); +const MotionFieldset = +/*@__PURE__*/ createMinimalMotionComponent("fieldset"); +const MotionFigcaption = +/*@__PURE__*/ createMinimalMotionComponent("figcaption"); +const MotionFigure = /*@__PURE__*/ createMinimalMotionComponent("figure"); +const MotionFooter = /*@__PURE__*/ createMinimalMotionComponent("footer"); +const MotionForm = /*@__PURE__*/ createMinimalMotionComponent("form"); +const MotionH1 = /*@__PURE__*/ createMinimalMotionComponent("h1"); +const MotionH2 = /*@__PURE__*/ createMinimalMotionComponent("h2"); +const MotionH3 = /*@__PURE__*/ createMinimalMotionComponent("h3"); +const MotionH4 = /*@__PURE__*/ createMinimalMotionComponent("h4"); +const MotionH5 = /*@__PURE__*/ createMinimalMotionComponent("h5"); +const MotionH6 = /*@__PURE__*/ createMinimalMotionComponent("h6"); +const MotionHead = /*@__PURE__*/ createMinimalMotionComponent("head"); +const MotionHeader = /*@__PURE__*/ createMinimalMotionComponent("header"); +const MotionHgroup = /*@__PURE__*/ createMinimalMotionComponent("hgroup"); +const MotionHr = /*@__PURE__*/ createMinimalMotionComponent("hr"); +const MotionHtml = /*@__PURE__*/ createMinimalMotionComponent("html"); +const MotionI = /*@__PURE__*/ createMinimalMotionComponent("i"); +const MotionIframe = /*@__PURE__*/ createMinimalMotionComponent("iframe"); +const MotionImg = /*@__PURE__*/ createMinimalMotionComponent("img"); +const MotionInput = /*@__PURE__*/ createMinimalMotionComponent("input"); +const MotionIns = /*@__PURE__*/ createMinimalMotionComponent("ins"); +const MotionKbd = /*@__PURE__*/ createMinimalMotionComponent("kbd"); +const MotionKeygen = /*@__PURE__*/ createMinimalMotionComponent("keygen"); +const MotionLabel = /*@__PURE__*/ createMinimalMotionComponent("label"); +const MotionLegend = /*@__PURE__*/ createMinimalMotionComponent("legend"); +const MotionLi = /*@__PURE__*/ createMinimalMotionComponent("li"); +const MotionLink = /*@__PURE__*/ createMinimalMotionComponent("link"); +const MotionMain = /*@__PURE__*/ createMinimalMotionComponent("main"); +const MotionMap = /*@__PURE__*/ createMinimalMotionComponent("map"); +const MotionMark = /*@__PURE__*/ createMinimalMotionComponent("mark"); +const MotionMenu = /*@__PURE__*/ createMinimalMotionComponent("menu"); +const MotionMenuitem = +/*@__PURE__*/ createMinimalMotionComponent("menuitem"); +const MotionMeter = /*@__PURE__*/ createMinimalMotionComponent("meter"); +const MotionNav = /*@__PURE__*/ createMinimalMotionComponent("nav"); +const MotionObject = /*@__PURE__*/ createMinimalMotionComponent("object"); +const MotionOl = /*@__PURE__*/ createMinimalMotionComponent("ol"); +const MotionOptgroup = +/*@__PURE__*/ createMinimalMotionComponent("optgroup"); +const MotionOption = /*@__PURE__*/ createMinimalMotionComponent("option"); +const MotionOutput = /*@__PURE__*/ createMinimalMotionComponent("output"); +const MotionP = /*@__PURE__*/ createMinimalMotionComponent("p"); +const MotionParam = /*@__PURE__*/ createMinimalMotionComponent("param"); +const MotionPicture = +/*@__PURE__*/ createMinimalMotionComponent("picture"); +const MotionPre = /*@__PURE__*/ createMinimalMotionComponent("pre"); +const MotionProgress = +/*@__PURE__*/ createMinimalMotionComponent("progress"); +const MotionQ = /*@__PURE__*/ createMinimalMotionComponent("q"); +const MotionRp = /*@__PURE__*/ createMinimalMotionComponent("rp"); +const MotionRt = /*@__PURE__*/ createMinimalMotionComponent("rt"); +const MotionRuby = /*@__PURE__*/ createMinimalMotionComponent("ruby"); +const MotionS = /*@__PURE__*/ createMinimalMotionComponent("s"); +const MotionSamp = /*@__PURE__*/ createMinimalMotionComponent("samp"); +const MotionScript = /*@__PURE__*/ createMinimalMotionComponent("script"); +const MotionSection = +/*@__PURE__*/ createMinimalMotionComponent("section"); +const MotionSelect = /*@__PURE__*/ createMinimalMotionComponent("select"); +const MotionSmall = /*@__PURE__*/ createMinimalMotionComponent("small"); +const MotionSource = /*@__PURE__*/ createMinimalMotionComponent("source"); +const MotionSpan = /*@__PURE__*/ createMinimalMotionComponent("span"); +const MotionStrong = /*@__PURE__*/ createMinimalMotionComponent("strong"); +const MotionStyle = /*@__PURE__*/ createMinimalMotionComponent("style"); +const MotionSub = /*@__PURE__*/ createMinimalMotionComponent("sub"); +const MotionSummary = +/*@__PURE__*/ createMinimalMotionComponent("summary"); +const MotionSup = /*@__PURE__*/ createMinimalMotionComponent("sup"); +const MotionTable = /*@__PURE__*/ createMinimalMotionComponent("table"); +const MotionTbody = /*@__PURE__*/ createMinimalMotionComponent("tbody"); +const MotionTd = /*@__PURE__*/ createMinimalMotionComponent("td"); +const MotionTextarea = +/*@__PURE__*/ createMinimalMotionComponent("textarea"); +const MotionTfoot = /*@__PURE__*/ createMinimalMotionComponent("tfoot"); +const MotionTh = /*@__PURE__*/ createMinimalMotionComponent("th"); +const MotionThead = /*@__PURE__*/ createMinimalMotionComponent("thead"); +const MotionTime = /*@__PURE__*/ createMinimalMotionComponent("time"); +const MotionTitle = /*@__PURE__*/ createMinimalMotionComponent("title"); +const MotionTr = /*@__PURE__*/ createMinimalMotionComponent("tr"); +const MotionTrack = /*@__PURE__*/ createMinimalMotionComponent("track"); +const MotionU = /*@__PURE__*/ createMinimalMotionComponent("u"); +const MotionUl = /*@__PURE__*/ createMinimalMotionComponent("ul"); +const MotionVideo = /*@__PURE__*/ createMinimalMotionComponent("video"); +const MotionWbr = /*@__PURE__*/ createMinimalMotionComponent("wbr"); +const MotionWebview = +/*@__PURE__*/ createMinimalMotionComponent("webview"); +/** + * SVG components + */ +const MotionAnimate = +/*@__PURE__*/ createMinimalMotionComponent("animate"); +const MotionCircle = /*@__PURE__*/ createMinimalMotionComponent("circle"); +const MotionDefs = /*@__PURE__*/ createMinimalMotionComponent("defs"); +const MotionDesc = /*@__PURE__*/ createMinimalMotionComponent("desc"); +const MotionEllipse = +/*@__PURE__*/ createMinimalMotionComponent("ellipse"); +const MotionG = /*@__PURE__*/ createMinimalMotionComponent("g"); +const MotionImage = /*@__PURE__*/ createMinimalMotionComponent("image"); +const MotionLine = /*@__PURE__*/ createMinimalMotionComponent("line"); +const MotionFilter = /*@__PURE__*/ createMinimalMotionComponent("filter"); +const MotionMarker = /*@__PURE__*/ createMinimalMotionComponent("marker"); +const MotionMask = /*@__PURE__*/ createMinimalMotionComponent("mask"); +const MotionMetadata = +/*@__PURE__*/ createMinimalMotionComponent("metadata"); +const MotionPath = /*@__PURE__*/ createMinimalMotionComponent("path"); +const MotionPattern = +/*@__PURE__*/ createMinimalMotionComponent("pattern"); +const MotionPolygon = +/*@__PURE__*/ createMinimalMotionComponent("polygon"); +const MotionPolyline = +/*@__PURE__*/ createMinimalMotionComponent("polyline"); +const MotionRect = /*@__PURE__*/ createMinimalMotionComponent("rect"); +const MotionStop = /*@__PURE__*/ createMinimalMotionComponent("stop"); +const MotionSvg = /*@__PURE__*/ createMinimalMotionComponent("svg"); +const MotionSymbol = /*@__PURE__*/ createMinimalMotionComponent("symbol"); +const MotionText = /*@__PURE__*/ createMinimalMotionComponent("text"); +const MotionTspan = /*@__PURE__*/ createMinimalMotionComponent("tspan"); +const MotionUse = /*@__PURE__*/ createMinimalMotionComponent("use"); +const MotionView = /*@__PURE__*/ createMinimalMotionComponent("view"); +const MotionClipPath = +/*@__PURE__*/ createMinimalMotionComponent("clipPath"); +const MotionFeBlend = +/*@__PURE__*/ createMinimalMotionComponent("feBlend"); +const MotionFeColorMatrix = +/*@__PURE__*/ createMinimalMotionComponent("feColorMatrix"); +const MotionFeComponentTransfer = +/*@__PURE__*/ createMinimalMotionComponent("feComponentTransfer"); +const MotionFeComposite = +/*@__PURE__*/ createMinimalMotionComponent("feComposite"); +const MotionFeConvolveMatrix = +/*@__PURE__*/ createMinimalMotionComponent("feConvolveMatrix"); +const MotionFeDiffuseLighting = +/*@__PURE__*/ createMinimalMotionComponent("feDiffuseLighting"); +const MotionFeDisplacementMap = +/*@__PURE__*/ createMinimalMotionComponent("feDisplacementMap"); +const MotionFeDistantLight = +/*@__PURE__*/ createMinimalMotionComponent("feDistantLight"); +const MotionFeDropShadow = +/*@__PURE__*/ createMinimalMotionComponent("feDropShadow"); +const MotionFeFlood = +/*@__PURE__*/ createMinimalMotionComponent("feFlood"); +const MotionFeFuncA = +/*@__PURE__*/ createMinimalMotionComponent("feFuncA"); +const MotionFeFuncB = +/*@__PURE__*/ createMinimalMotionComponent("feFuncB"); +const MotionFeFuncG = +/*@__PURE__*/ createMinimalMotionComponent("feFuncG"); +const MotionFeFuncR = +/*@__PURE__*/ createMinimalMotionComponent("feFuncR"); +const MotionFeGaussianBlur = +/*@__PURE__*/ createMinimalMotionComponent("feGaussianBlur"); +const MotionFeImage = +/*@__PURE__*/ createMinimalMotionComponent("feImage"); +const MotionFeMerge = +/*@__PURE__*/ createMinimalMotionComponent("feMerge"); +const MotionFeMergeNode = +/*@__PURE__*/ createMinimalMotionComponent("feMergeNode"); +const MotionFeMorphology = +/*@__PURE__*/ createMinimalMotionComponent("feMorphology"); +const MotionFeOffset = +/*@__PURE__*/ createMinimalMotionComponent("feOffset"); +const MotionFePointLight = +/*@__PURE__*/ createMinimalMotionComponent("fePointLight"); +const MotionFeSpecularLighting = +/*@__PURE__*/ createMinimalMotionComponent("feSpecularLighting"); +const MotionFeSpotLight = +/*@__PURE__*/ createMinimalMotionComponent("feSpotLight"); +const MotionFeTile = /*@__PURE__*/ createMinimalMotionComponent("feTile"); +const MotionFeTurbulence = +/*@__PURE__*/ createMinimalMotionComponent("feTurbulence"); +const MotionForeignObject = +/*@__PURE__*/ createMinimalMotionComponent("foreignObject"); +const MotionLinearGradient = +/*@__PURE__*/ createMinimalMotionComponent("linearGradient"); +const MotionRadialGradient = +/*@__PURE__*/ createMinimalMotionComponent("radialGradient"); +const MotionTextPath = +/*@__PURE__*/ createMinimalMotionComponent("textPath"); + +export { MotionA, MotionAbbr, MotionAddress, MotionAnimate, MotionArea, MotionArticle, MotionAside, MotionAudio, MotionB, MotionBase, MotionBdi, MotionBdo, MotionBig, MotionBlockquote, MotionBody, MotionButton, MotionCanvas, MotionCaption, MotionCircle, MotionCite, MotionClipPath, MotionCode, MotionCol, MotionColgroup, MotionData, MotionDatalist, MotionDd, MotionDefs, MotionDel, MotionDesc, MotionDetails, MotionDfn, MotionDialog, MotionDiv, MotionDl, MotionDt, MotionEllipse, MotionEm, MotionEmbed, MotionFeBlend, MotionFeColorMatrix, MotionFeComponentTransfer, MotionFeComposite, MotionFeConvolveMatrix, MotionFeDiffuseLighting, MotionFeDisplacementMap, MotionFeDistantLight, MotionFeDropShadow, MotionFeFlood, MotionFeFuncA, MotionFeFuncB, MotionFeFuncG, MotionFeFuncR, MotionFeGaussianBlur, MotionFeImage, MotionFeMerge, MotionFeMergeNode, MotionFeMorphology, MotionFeOffset, MotionFePointLight, MotionFeSpecularLighting, MotionFeSpotLight, MotionFeTile, MotionFeTurbulence, MotionFieldset, MotionFigcaption, MotionFigure, MotionFilter, MotionFooter, MotionForeignObject, MotionForm, MotionG, MotionH1, MotionH2, MotionH3, MotionH4, MotionH5, MotionH6, MotionHead, MotionHeader, MotionHgroup, MotionHr, MotionHtml, MotionI, MotionIframe, MotionImage, MotionImg, MotionInput, MotionIns, MotionKbd, MotionKeygen, MotionLabel, MotionLegend, MotionLi, MotionLine, MotionLinearGradient, MotionLink, MotionMain, MotionMap, MotionMark, MotionMarker, MotionMask, MotionMenu, MotionMenuitem, MotionMetadata, MotionMeter, MotionNav, MotionObject, MotionOl, MotionOptgroup, MotionOption, MotionOutput, MotionP, MotionParam, MotionPath, MotionPattern, MotionPicture, MotionPolygon, MotionPolyline, MotionPre, MotionProgress, MotionQ, MotionRadialGradient, MotionRect, MotionRp, MotionRt, MotionRuby, MotionS, MotionSamp, MotionScript, MotionSection, MotionSelect, MotionSmall, MotionSource, MotionSpan, MotionStop, MotionStrong, MotionStyle, MotionSub, MotionSummary, MotionSup, MotionSvg, MotionSymbol, MotionTable, MotionTbody, MotionTd, MotionText, MotionTextPath, MotionTextarea, MotionTfoot, MotionTh, MotionThead, MotionTime, MotionTitle, MotionTr, MotionTrack, MotionTspan, MotionU, MotionUl, MotionUse, MotionVideo, MotionView, MotionWbr, MotionWebview }; +//# sourceMappingURL=elements.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/components/m/elements.mjs.map b/node_modules/framer-motion/dist/es/render/components/m/elements.mjs.map new file mode 100644 index 0000000..59c7b46 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/components/m/elements.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"elements.mjs","sources":["../../../../../src/render/components/m/elements.ts"],"sourcesContent":["\"use client\"\n\nimport { createMinimalMotionComponent } from \"./create\"\n\n/**\n * HTML components\n */\nexport const MotionA = /*@__PURE__*/ createMinimalMotionComponent(\"a\")\nexport const MotionAbbr = /*@__PURE__*/ createMinimalMotionComponent(\"abbr\")\nexport const MotionAddress =\n /*@__PURE__*/ createMinimalMotionComponent(\"address\")\nexport const MotionArea = /*@__PURE__*/ createMinimalMotionComponent(\"area\")\nexport const MotionArticle =\n /*@__PURE__*/ createMinimalMotionComponent(\"article\")\nexport const MotionAside = /*@__PURE__*/ createMinimalMotionComponent(\"aside\")\nexport const MotionAudio = /*@__PURE__*/ createMinimalMotionComponent(\"audio\")\nexport const MotionB = /*@__PURE__*/ createMinimalMotionComponent(\"b\")\nexport const MotionBase = /*@__PURE__*/ createMinimalMotionComponent(\"base\")\nexport const MotionBdi = /*@__PURE__*/ createMinimalMotionComponent(\"bdi\")\nexport const MotionBdo = /*@__PURE__*/ createMinimalMotionComponent(\"bdo\")\nexport const MotionBig = /*@__PURE__*/ createMinimalMotionComponent(\"big\")\nexport const MotionBlockquote =\n /*@__PURE__*/ createMinimalMotionComponent(\"blockquote\")\nexport const MotionBody = /*@__PURE__*/ createMinimalMotionComponent(\"body\")\nexport const MotionButton = /*@__PURE__*/ createMinimalMotionComponent(\"button\")\nexport const MotionCanvas = /*@__PURE__*/ createMinimalMotionComponent(\"canvas\")\nexport const MotionCaption =\n /*@__PURE__*/ createMinimalMotionComponent(\"caption\")\nexport const MotionCite = /*@__PURE__*/ createMinimalMotionComponent(\"cite\")\nexport const MotionCode = /*@__PURE__*/ createMinimalMotionComponent(\"code\")\nexport const MotionCol = /*@__PURE__*/ createMinimalMotionComponent(\"col\")\nexport const MotionColgroup =\n /*@__PURE__*/ createMinimalMotionComponent(\"colgroup\")\nexport const MotionData = /*@__PURE__*/ createMinimalMotionComponent(\"data\")\nexport const MotionDatalist =\n /*@__PURE__*/ createMinimalMotionComponent(\"datalist\")\nexport const MotionDd = /*@__PURE__*/ createMinimalMotionComponent(\"dd\")\nexport const MotionDel = /*@__PURE__*/ createMinimalMotionComponent(\"del\")\nexport const MotionDetails =\n /*@__PURE__*/ createMinimalMotionComponent(\"details\")\nexport const MotionDfn = /*@__PURE__*/ createMinimalMotionComponent(\"dfn\")\nexport const MotionDialog = /*@__PURE__*/ createMinimalMotionComponent(\"dialog\")\nexport const MotionDiv = /*@__PURE__*/ createMinimalMotionComponent(\"div\")\nexport const MotionDl = /*@__PURE__*/ createMinimalMotionComponent(\"dl\")\nexport const MotionDt = /*@__PURE__*/ createMinimalMotionComponent(\"dt\")\nexport const MotionEm = /*@__PURE__*/ createMinimalMotionComponent(\"em\")\nexport const MotionEmbed = /*@__PURE__*/ createMinimalMotionComponent(\"embed\")\nexport const MotionFieldset =\n /*@__PURE__*/ createMinimalMotionComponent(\"fieldset\")\nexport const MotionFigcaption =\n /*@__PURE__*/ createMinimalMotionComponent(\"figcaption\")\nexport const MotionFigure = /*@__PURE__*/ createMinimalMotionComponent(\"figure\")\nexport const MotionFooter = /*@__PURE__*/ createMinimalMotionComponent(\"footer\")\nexport const MotionForm = /*@__PURE__*/ createMinimalMotionComponent(\"form\")\nexport const MotionH1 = /*@__PURE__*/ createMinimalMotionComponent(\"h1\")\nexport const MotionH2 = /*@__PURE__*/ createMinimalMotionComponent(\"h2\")\nexport const MotionH3 = /*@__PURE__*/ createMinimalMotionComponent(\"h3\")\nexport const MotionH4 = /*@__PURE__*/ createMinimalMotionComponent(\"h4\")\nexport const MotionH5 = /*@__PURE__*/ createMinimalMotionComponent(\"h5\")\nexport const MotionH6 = /*@__PURE__*/ createMinimalMotionComponent(\"h6\")\nexport const MotionHead = /*@__PURE__*/ createMinimalMotionComponent(\"head\")\nexport const MotionHeader = /*@__PURE__*/ createMinimalMotionComponent(\"header\")\nexport const MotionHgroup = /*@__PURE__*/ createMinimalMotionComponent(\"hgroup\")\nexport const MotionHr = /*@__PURE__*/ createMinimalMotionComponent(\"hr\")\nexport const MotionHtml = /*@__PURE__*/ createMinimalMotionComponent(\"html\")\nexport const MotionI = /*@__PURE__*/ createMinimalMotionComponent(\"i\")\nexport const MotionIframe = /*@__PURE__*/ createMinimalMotionComponent(\"iframe\")\nexport const MotionImg = /*@__PURE__*/ createMinimalMotionComponent(\"img\")\nexport const MotionInput = /*@__PURE__*/ createMinimalMotionComponent(\"input\")\nexport const MotionIns = /*@__PURE__*/ createMinimalMotionComponent(\"ins\")\nexport const MotionKbd = /*@__PURE__*/ createMinimalMotionComponent(\"kbd\")\nexport const MotionKeygen = /*@__PURE__*/ createMinimalMotionComponent(\"keygen\")\nexport const MotionLabel = /*@__PURE__*/ createMinimalMotionComponent(\"label\")\nexport const MotionLegend = /*@__PURE__*/ createMinimalMotionComponent(\"legend\")\nexport const MotionLi = /*@__PURE__*/ createMinimalMotionComponent(\"li\")\nexport const MotionLink = /*@__PURE__*/ createMinimalMotionComponent(\"link\")\nexport const MotionMain = /*@__PURE__*/ createMinimalMotionComponent(\"main\")\nexport const MotionMap = /*@__PURE__*/ createMinimalMotionComponent(\"map\")\nexport const MotionMark = /*@__PURE__*/ createMinimalMotionComponent(\"mark\")\nexport const MotionMenu = /*@__PURE__*/ createMinimalMotionComponent(\"menu\")\nexport const MotionMenuitem =\n /*@__PURE__*/ createMinimalMotionComponent(\"menuitem\")\nexport const MotionMeter = /*@__PURE__*/ createMinimalMotionComponent(\"meter\")\nexport const MotionNav = /*@__PURE__*/ createMinimalMotionComponent(\"nav\")\nexport const MotionObject = /*@__PURE__*/ createMinimalMotionComponent(\"object\")\nexport const MotionOl = /*@__PURE__*/ createMinimalMotionComponent(\"ol\")\nexport const MotionOptgroup =\n /*@__PURE__*/ createMinimalMotionComponent(\"optgroup\")\nexport const MotionOption = /*@__PURE__*/ createMinimalMotionComponent(\"option\")\nexport const MotionOutput = /*@__PURE__*/ createMinimalMotionComponent(\"output\")\nexport const MotionP = /*@__PURE__*/ createMinimalMotionComponent(\"p\")\nexport const MotionParam = /*@__PURE__*/ createMinimalMotionComponent(\"param\")\nexport const MotionPicture =\n /*@__PURE__*/ createMinimalMotionComponent(\"picture\")\nexport const MotionPre = /*@__PURE__*/ createMinimalMotionComponent(\"pre\")\nexport const MotionProgress =\n /*@__PURE__*/ createMinimalMotionComponent(\"progress\")\nexport const MotionQ = /*@__PURE__*/ createMinimalMotionComponent(\"q\")\nexport const MotionRp = /*@__PURE__*/ createMinimalMotionComponent(\"rp\")\nexport const MotionRt = /*@__PURE__*/ createMinimalMotionComponent(\"rt\")\nexport const MotionRuby = /*@__PURE__*/ createMinimalMotionComponent(\"ruby\")\nexport const MotionS = /*@__PURE__*/ createMinimalMotionComponent(\"s\")\nexport const MotionSamp = /*@__PURE__*/ createMinimalMotionComponent(\"samp\")\nexport const MotionScript = /*@__PURE__*/ createMinimalMotionComponent(\"script\")\nexport const MotionSection =\n /*@__PURE__*/ createMinimalMotionComponent(\"section\")\nexport const MotionSelect = /*@__PURE__*/ createMinimalMotionComponent(\"select\")\nexport const MotionSmall = /*@__PURE__*/ createMinimalMotionComponent(\"small\")\nexport const MotionSource = /*@__PURE__*/ createMinimalMotionComponent(\"source\")\nexport const MotionSpan = /*@__PURE__*/ createMinimalMotionComponent(\"span\")\nexport const MotionStrong = /*@__PURE__*/ createMinimalMotionComponent(\"strong\")\nexport const MotionStyle = /*@__PURE__*/ createMinimalMotionComponent(\"style\")\nexport const MotionSub = /*@__PURE__*/ createMinimalMotionComponent(\"sub\")\nexport const MotionSummary =\n /*@__PURE__*/ createMinimalMotionComponent(\"summary\")\nexport const MotionSup = /*@__PURE__*/ createMinimalMotionComponent(\"sup\")\nexport const MotionTable = /*@__PURE__*/ createMinimalMotionComponent(\"table\")\nexport const MotionTbody = /*@__PURE__*/ createMinimalMotionComponent(\"tbody\")\nexport const MotionTd = /*@__PURE__*/ createMinimalMotionComponent(\"td\")\nexport const MotionTextarea =\n /*@__PURE__*/ createMinimalMotionComponent(\"textarea\")\nexport const MotionTfoot = /*@__PURE__*/ createMinimalMotionComponent(\"tfoot\")\nexport const MotionTh = /*@__PURE__*/ createMinimalMotionComponent(\"th\")\nexport const MotionThead = /*@__PURE__*/ createMinimalMotionComponent(\"thead\")\nexport const MotionTime = /*@__PURE__*/ createMinimalMotionComponent(\"time\")\nexport const MotionTitle = /*@__PURE__*/ createMinimalMotionComponent(\"title\")\nexport const MotionTr = /*@__PURE__*/ createMinimalMotionComponent(\"tr\")\nexport const MotionTrack = /*@__PURE__*/ createMinimalMotionComponent(\"track\")\nexport const MotionU = /*@__PURE__*/ createMinimalMotionComponent(\"u\")\nexport const MotionUl = /*@__PURE__*/ createMinimalMotionComponent(\"ul\")\nexport const MotionVideo = /*@__PURE__*/ createMinimalMotionComponent(\"video\")\nexport const MotionWbr = /*@__PURE__*/ createMinimalMotionComponent(\"wbr\")\nexport const MotionWebview =\n /*@__PURE__*/ createMinimalMotionComponent(\"webview\")\n\n/**\n * SVG components\n */\nexport const MotionAnimate =\n /*@__PURE__*/ createMinimalMotionComponent(\"animate\")\nexport const MotionCircle = /*@__PURE__*/ createMinimalMotionComponent(\"circle\")\nexport const MotionDefs = /*@__PURE__*/ createMinimalMotionComponent(\"defs\")\nexport const MotionDesc = /*@__PURE__*/ createMinimalMotionComponent(\"desc\")\nexport const MotionEllipse =\n /*@__PURE__*/ createMinimalMotionComponent(\"ellipse\")\nexport const MotionG = /*@__PURE__*/ createMinimalMotionComponent(\"g\")\nexport const MotionImage = /*@__PURE__*/ createMinimalMotionComponent(\"image\")\nexport const MotionLine = /*@__PURE__*/ createMinimalMotionComponent(\"line\")\nexport const MotionFilter = /*@__PURE__*/ createMinimalMotionComponent(\"filter\")\nexport const MotionMarker = /*@__PURE__*/ createMinimalMotionComponent(\"marker\")\nexport const MotionMask = /*@__PURE__*/ createMinimalMotionComponent(\"mask\")\nexport const MotionMetadata =\n /*@__PURE__*/ createMinimalMotionComponent(\"metadata\")\nexport const MotionPath = /*@__PURE__*/ createMinimalMotionComponent(\"path\")\nexport const MotionPattern =\n /*@__PURE__*/ createMinimalMotionComponent(\"pattern\")\nexport const MotionPolygon =\n /*@__PURE__*/ createMinimalMotionComponent(\"polygon\")\nexport const MotionPolyline =\n /*@__PURE__*/ createMinimalMotionComponent(\"polyline\")\nexport const MotionRect = /*@__PURE__*/ createMinimalMotionComponent(\"rect\")\nexport const MotionStop = /*@__PURE__*/ createMinimalMotionComponent(\"stop\")\nexport const MotionSvg = /*@__PURE__*/ createMinimalMotionComponent(\"svg\")\nexport const MotionSymbol = /*@__PURE__*/ createMinimalMotionComponent(\"symbol\")\nexport const MotionText = /*@__PURE__*/ createMinimalMotionComponent(\"text\")\nexport const MotionTspan = /*@__PURE__*/ createMinimalMotionComponent(\"tspan\")\nexport const MotionUse = /*@__PURE__*/ createMinimalMotionComponent(\"use\")\nexport const MotionView = /*@__PURE__*/ createMinimalMotionComponent(\"view\")\nexport const MotionClipPath =\n /*@__PURE__*/ createMinimalMotionComponent(\"clipPath\")\nexport const MotionFeBlend =\n /*@__PURE__*/ createMinimalMotionComponent(\"feBlend\")\nexport const MotionFeColorMatrix =\n /*@__PURE__*/ createMinimalMotionComponent(\"feColorMatrix\")\nexport const MotionFeComponentTransfer =\n /*@__PURE__*/ createMinimalMotionComponent(\"feComponentTransfer\")\nexport const MotionFeComposite =\n /*@__PURE__*/ createMinimalMotionComponent(\"feComposite\")\nexport const MotionFeConvolveMatrix =\n /*@__PURE__*/ createMinimalMotionComponent(\"feConvolveMatrix\")\nexport const MotionFeDiffuseLighting =\n /*@__PURE__*/ createMinimalMotionComponent(\"feDiffuseLighting\")\nexport const MotionFeDisplacementMap =\n /*@__PURE__*/ createMinimalMotionComponent(\"feDisplacementMap\")\nexport const MotionFeDistantLight =\n /*@__PURE__*/ createMinimalMotionComponent(\"feDistantLight\")\nexport const MotionFeDropShadow =\n /*@__PURE__*/ createMinimalMotionComponent(\"feDropShadow\")\nexport const MotionFeFlood =\n /*@__PURE__*/ createMinimalMotionComponent(\"feFlood\")\nexport const MotionFeFuncA =\n /*@__PURE__*/ createMinimalMotionComponent(\"feFuncA\")\nexport const MotionFeFuncB =\n /*@__PURE__*/ createMinimalMotionComponent(\"feFuncB\")\nexport const MotionFeFuncG =\n /*@__PURE__*/ createMinimalMotionComponent(\"feFuncG\")\nexport const MotionFeFuncR =\n /*@__PURE__*/ createMinimalMotionComponent(\"feFuncR\")\nexport const MotionFeGaussianBlur =\n /*@__PURE__*/ createMinimalMotionComponent(\"feGaussianBlur\")\nexport const MotionFeImage =\n /*@__PURE__*/ createMinimalMotionComponent(\"feImage\")\nexport const MotionFeMerge =\n /*@__PURE__*/ createMinimalMotionComponent(\"feMerge\")\nexport const MotionFeMergeNode =\n /*@__PURE__*/ createMinimalMotionComponent(\"feMergeNode\")\nexport const MotionFeMorphology =\n /*@__PURE__*/ createMinimalMotionComponent(\"feMorphology\")\nexport const MotionFeOffset =\n /*@__PURE__*/ createMinimalMotionComponent(\"feOffset\")\nexport const MotionFePointLight =\n /*@__PURE__*/ createMinimalMotionComponent(\"fePointLight\")\nexport const MotionFeSpecularLighting =\n /*@__PURE__*/ createMinimalMotionComponent(\"feSpecularLighting\")\nexport const MotionFeSpotLight =\n /*@__PURE__*/ createMinimalMotionComponent(\"feSpotLight\")\nexport const MotionFeTile = /*@__PURE__*/ createMinimalMotionComponent(\"feTile\")\nexport const MotionFeTurbulence =\n /*@__PURE__*/ createMinimalMotionComponent(\"feTurbulence\")\nexport const MotionForeignObject =\n /*@__PURE__*/ createMinimalMotionComponent(\"foreignObject\")\nexport const MotionLinearGradient =\n /*@__PURE__*/ createMinimalMotionComponent(\"linearGradient\")\nexport const MotionRadialGradient =\n /*@__PURE__*/ createMinimalMotionComponent(\"radialGradient\")\nexport const MotionTextPath =\n /*@__PURE__*/ createMinimalMotionComponent(\"textPath\")\n"],"names":[],"mappings":";;;AAIA;;AAEG;AACI;AACA;;AAEH;AACG;;AAEH;AACG;AACA;AACA;AACA;AACA;AACA;AACA;;AAEH;AACG;AACA;AACA;;AAEH;AACG;AACA;AACA;;AAEH;AACG;;AAEH;AACG;AACA;;AAEH;AACG;AACA;AACA;AACA;AACA;AACA;AACA;;AAEH;;AAEA;AACG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEH;AACG;AACA;AACA;AACA;;AAEH;AACG;AACA;AACA;AACA;;AAEH;AACG;;AAEH;AACG;AACA;AACA;AACA;AACA;AACA;AACA;;AAEH;AACG;AACA;AACA;AACA;AACA;AACA;AACA;;AAEH;AACG;AACA;AACA;AACA;;AAEH;AACG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEH;AAEJ;;AAEG;;AAEC;AACG;AACA;AACA;;AAEH;AACG;AACA;AACA;AACA;AACA;AACA;;AAEH;AACG;;AAEH;;AAEA;;AAEA;AACG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEH;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACG;;AAEH;;AAEA;;AAEA;;AAEA;;AAEA;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/components/m/proxy.mjs b/node_modules/framer-motion/dist/es/render/components/m/proxy.mjs new file mode 100644 index 0000000..2de139e --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/components/m/proxy.mjs @@ -0,0 +1,6 @@ +import { createMotionProxy } from '../create-proxy.mjs'; + +const m = /*@__PURE__*/ createMotionProxy(); + +export { m }; +//# sourceMappingURL=proxy.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/components/m/proxy.mjs.map b/node_modules/framer-motion/dist/es/render/components/m/proxy.mjs.map new file mode 100644 index 0000000..ce75105 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/components/m/proxy.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"proxy.mjs","sources":["../../../../../src/render/components/m/proxy.ts"],"sourcesContent":["import { createMotionProxy } from \"../create-proxy\"\n\nexport const m = /*@__PURE__*/ createMotionProxy()\n"],"names":[],"mappings":";;MAEa,CAAC,iBAAiB,iBAAiB;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/components/motion/create.mjs b/node_modules/framer-motion/dist/es/render/components/motion/create.mjs new file mode 100644 index 0000000..b74f806 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/components/motion/create.mjs @@ -0,0 +1,10 @@ +import { createMotionComponent } from '../../../motion/index.mjs'; +import { createDomVisualElement } from '../../dom/create-visual-element.mjs'; +import { featureBundle } from './feature-bundle.mjs'; + +function createMotionComponentWithFeatures(Component, options) { + return createMotionComponent(Component, options, featureBundle, createDomVisualElement); +} + +export { createMotionComponentWithFeatures }; +//# sourceMappingURL=create.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/components/motion/create.mjs.map b/node_modules/framer-motion/dist/es/render/components/motion/create.mjs.map new file mode 100644 index 0000000..ce872e9 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/components/motion/create.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"create.mjs","sources":["../../../../../src/render/components/motion/create.ts"],"sourcesContent":["import { createMotionComponent, MotionComponentOptions } from \"../../../motion\"\nimport { createDomVisualElement } from \"../../dom/create-visual-element\"\nimport { DOMMotionComponents } from \"../../dom/types\"\nimport { CreateVisualElement } from \"../../types\"\nimport { featureBundle } from \"./feature-bundle\"\n\nexport function createMotionComponentWithFeatures<\n Props,\n TagName extends keyof DOMMotionComponents | string = \"div\"\n>(\n Component: TagName | string | React.ComponentType,\n options?: MotionComponentOptions\n) {\n return createMotionComponent(\n Component,\n options,\n featureBundle,\n createDomVisualElement as CreateVisualElement\n )\n}\n"],"names":[],"mappings":";;;;AAMM,SAAU,iCAAiC,CAI7C,SAAwD,EACxD,OAAgC,EAAA;IAEhC,OAAO,qBAAqB,CACxB,SAAS,EACT,OAAO,EACP,aAAa,EACb,sBAA6D,CAChE;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/components/motion/elements.mjs b/node_modules/framer-motion/dist/es/render/components/motion/elements.mjs new file mode 100644 index 0000000..04dc762 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/components/motion/elements.mjs @@ -0,0 +1,195 @@ +"use client"; +import { createMotionComponentWithFeatures } from './create.mjs'; + +/** + * HTML components + */ +const MotionA = /*@__PURE__*/ createMotionComponentWithFeatures("a"); +const MotionAbbr = /*@__PURE__*/ createMotionComponentWithFeatures("abbr"); +const MotionAddress = /*@__PURE__*/ createMotionComponentWithFeatures("address"); +const MotionArea = /*@__PURE__*/ createMotionComponentWithFeatures("area"); +const MotionArticle = /*@__PURE__*/ createMotionComponentWithFeatures("article"); +const MotionAside = /*@__PURE__*/ createMotionComponentWithFeatures("aside"); +const MotionAudio = /*@__PURE__*/ createMotionComponentWithFeatures("audio"); +const MotionB = /*@__PURE__*/ createMotionComponentWithFeatures("b"); +const MotionBase = /*@__PURE__*/ createMotionComponentWithFeatures("base"); +const MotionBdi = /*@__PURE__*/ createMotionComponentWithFeatures("bdi"); +const MotionBdo = /*@__PURE__*/ createMotionComponentWithFeatures("bdo"); +const MotionBig = /*@__PURE__*/ createMotionComponentWithFeatures("big"); +const MotionBlockquote = +/*@__PURE__*/ createMotionComponentWithFeatures("blockquote"); +const MotionBody = /*@__PURE__*/ createMotionComponentWithFeatures("body"); +const MotionButton = /*@__PURE__*/ createMotionComponentWithFeatures("button"); +const MotionCanvas = /*@__PURE__*/ createMotionComponentWithFeatures("canvas"); +const MotionCaption = /*@__PURE__*/ createMotionComponentWithFeatures("caption"); +const MotionCite = /*@__PURE__*/ createMotionComponentWithFeatures("cite"); +const MotionCode = /*@__PURE__*/ createMotionComponentWithFeatures("code"); +const MotionCol = /*@__PURE__*/ createMotionComponentWithFeatures("col"); +const MotionColgroup = /*@__PURE__*/ createMotionComponentWithFeatures("colgroup"); +const MotionData = /*@__PURE__*/ createMotionComponentWithFeatures("data"); +const MotionDatalist = /*@__PURE__*/ createMotionComponentWithFeatures("datalist"); +const MotionDd = /*@__PURE__*/ createMotionComponentWithFeatures("dd"); +const MotionDel = /*@__PURE__*/ createMotionComponentWithFeatures("del"); +const MotionDetails = /*@__PURE__*/ createMotionComponentWithFeatures("details"); +const MotionDfn = /*@__PURE__*/ createMotionComponentWithFeatures("dfn"); +const MotionDialog = /*@__PURE__*/ createMotionComponentWithFeatures("dialog"); +const MotionDiv = /*@__PURE__*/ createMotionComponentWithFeatures("div"); +const MotionDl = /*@__PURE__*/ createMotionComponentWithFeatures("dl"); +const MotionDt = /*@__PURE__*/ createMotionComponentWithFeatures("dt"); +const MotionEm = /*@__PURE__*/ createMotionComponentWithFeatures("em"); +const MotionEmbed = /*@__PURE__*/ createMotionComponentWithFeatures("embed"); +const MotionFieldset = /*@__PURE__*/ createMotionComponentWithFeatures("fieldset"); +const MotionFigcaption = +/*@__PURE__*/ createMotionComponentWithFeatures("figcaption"); +const MotionFigure = /*@__PURE__*/ createMotionComponentWithFeatures("figure"); +const MotionFooter = /*@__PURE__*/ createMotionComponentWithFeatures("footer"); +const MotionForm = /*@__PURE__*/ createMotionComponentWithFeatures("form"); +const MotionH1 = /*@__PURE__*/ createMotionComponentWithFeatures("h1"); +const MotionH2 = /*@__PURE__*/ createMotionComponentWithFeatures("h2"); +const MotionH3 = /*@__PURE__*/ createMotionComponentWithFeatures("h3"); +const MotionH4 = /*@__PURE__*/ createMotionComponentWithFeatures("h4"); +const MotionH5 = /*@__PURE__*/ createMotionComponentWithFeatures("h5"); +const MotionH6 = /*@__PURE__*/ createMotionComponentWithFeatures("h6"); +const MotionHead = /*@__PURE__*/ createMotionComponentWithFeatures("head"); +const MotionHeader = /*@__PURE__*/ createMotionComponentWithFeatures("header"); +const MotionHgroup = /*@__PURE__*/ createMotionComponentWithFeatures("hgroup"); +const MotionHr = /*@__PURE__*/ createMotionComponentWithFeatures("hr"); +const MotionHtml = /*@__PURE__*/ createMotionComponentWithFeatures("html"); +const MotionI = /*@__PURE__*/ createMotionComponentWithFeatures("i"); +const MotionIframe = /*@__PURE__*/ createMotionComponentWithFeatures("iframe"); +const MotionImg = /*@__PURE__*/ createMotionComponentWithFeatures("img"); +const MotionInput = /*@__PURE__*/ createMotionComponentWithFeatures("input"); +const MotionIns = /*@__PURE__*/ createMotionComponentWithFeatures("ins"); +const MotionKbd = /*@__PURE__*/ createMotionComponentWithFeatures("kbd"); +const MotionKeygen = /*@__PURE__*/ createMotionComponentWithFeatures("keygen"); +const MotionLabel = /*@__PURE__*/ createMotionComponentWithFeatures("label"); +const MotionLegend = /*@__PURE__*/ createMotionComponentWithFeatures("legend"); +const MotionLi = /*@__PURE__*/ createMotionComponentWithFeatures("li"); +const MotionLink = /*@__PURE__*/ createMotionComponentWithFeatures("link"); +const MotionMain = /*@__PURE__*/ createMotionComponentWithFeatures("main"); +const MotionMap = /*@__PURE__*/ createMotionComponentWithFeatures("map"); +const MotionMark = /*@__PURE__*/ createMotionComponentWithFeatures("mark"); +const MotionMenu = /*@__PURE__*/ createMotionComponentWithFeatures("menu"); +const MotionMenuitem = /*@__PURE__*/ createMotionComponentWithFeatures("menuitem"); +const MotionMeter = /*@__PURE__*/ createMotionComponentWithFeatures("meter"); +const MotionNav = /*@__PURE__*/ createMotionComponentWithFeatures("nav"); +const MotionObject = /*@__PURE__*/ createMotionComponentWithFeatures("object"); +const MotionOl = /*@__PURE__*/ createMotionComponentWithFeatures("ol"); +const MotionOptgroup = /*@__PURE__*/ createMotionComponentWithFeatures("optgroup"); +const MotionOption = /*@__PURE__*/ createMotionComponentWithFeatures("option"); +const MotionOutput = /*@__PURE__*/ createMotionComponentWithFeatures("output"); +const MotionP = /*@__PURE__*/ createMotionComponentWithFeatures("p"); +const MotionParam = /*@__PURE__*/ createMotionComponentWithFeatures("param"); +const MotionPicture = /*@__PURE__*/ createMotionComponentWithFeatures("picture"); +const MotionPre = /*@__PURE__*/ createMotionComponentWithFeatures("pre"); +const MotionProgress = /*@__PURE__*/ createMotionComponentWithFeatures("progress"); +const MotionQ = /*@__PURE__*/ createMotionComponentWithFeatures("q"); +const MotionRp = /*@__PURE__*/ createMotionComponentWithFeatures("rp"); +const MotionRt = /*@__PURE__*/ createMotionComponentWithFeatures("rt"); +const MotionRuby = /*@__PURE__*/ createMotionComponentWithFeatures("ruby"); +const MotionS = /*@__PURE__*/ createMotionComponentWithFeatures("s"); +const MotionSamp = /*@__PURE__*/ createMotionComponentWithFeatures("samp"); +const MotionScript = /*@__PURE__*/ createMotionComponentWithFeatures("script"); +const MotionSection = /*@__PURE__*/ createMotionComponentWithFeatures("section"); +const MotionSelect = /*@__PURE__*/ createMotionComponentWithFeatures("select"); +const MotionSmall = /*@__PURE__*/ createMotionComponentWithFeatures("small"); +const MotionSource = /*@__PURE__*/ createMotionComponentWithFeatures("source"); +const MotionSpan = /*@__PURE__*/ createMotionComponentWithFeatures("span"); +const MotionStrong = /*@__PURE__*/ createMotionComponentWithFeatures("strong"); +const MotionStyle = /*@__PURE__*/ createMotionComponentWithFeatures("style"); +const MotionSub = /*@__PURE__*/ createMotionComponentWithFeatures("sub"); +const MotionSummary = /*@__PURE__*/ createMotionComponentWithFeatures("summary"); +const MotionSup = /*@__PURE__*/ createMotionComponentWithFeatures("sup"); +const MotionTable = /*@__PURE__*/ createMotionComponentWithFeatures("table"); +const MotionTbody = /*@__PURE__*/ createMotionComponentWithFeatures("tbody"); +const MotionTd = /*@__PURE__*/ createMotionComponentWithFeatures("td"); +const MotionTextarea = /*@__PURE__*/ createMotionComponentWithFeatures("textarea"); +const MotionTfoot = /*@__PURE__*/ createMotionComponentWithFeatures("tfoot"); +const MotionTh = /*@__PURE__*/ createMotionComponentWithFeatures("th"); +const MotionThead = /*@__PURE__*/ createMotionComponentWithFeatures("thead"); +const MotionTime = /*@__PURE__*/ createMotionComponentWithFeatures("time"); +const MotionTitle = /*@__PURE__*/ createMotionComponentWithFeatures("title"); +const MotionTr = /*@__PURE__*/ createMotionComponentWithFeatures("tr"); +const MotionTrack = /*@__PURE__*/ createMotionComponentWithFeatures("track"); +const MotionU = /*@__PURE__*/ createMotionComponentWithFeatures("u"); +const MotionUl = /*@__PURE__*/ createMotionComponentWithFeatures("ul"); +const MotionVideo = /*@__PURE__*/ createMotionComponentWithFeatures("video"); +const MotionWbr = /*@__PURE__*/ createMotionComponentWithFeatures("wbr"); +const MotionWebview = /*@__PURE__*/ createMotionComponentWithFeatures("webview"); +/** + * SVG components + */ +const MotionAnimate = /*@__PURE__*/ createMotionComponentWithFeatures("animate"); +const MotionCircle = /*@__PURE__*/ createMotionComponentWithFeatures("circle"); +const MotionDefs = /*@__PURE__*/ createMotionComponentWithFeatures("defs"); +const MotionDesc = /*@__PURE__*/ createMotionComponentWithFeatures("desc"); +const MotionEllipse = /*@__PURE__*/ createMotionComponentWithFeatures("ellipse"); +const MotionG = /*@__PURE__*/ createMotionComponentWithFeatures("g"); +const MotionImage = /*@__PURE__*/ createMotionComponentWithFeatures("image"); +const MotionLine = /*@__PURE__*/ createMotionComponentWithFeatures("line"); +const MotionFilter = /*@__PURE__*/ createMotionComponentWithFeatures("filter"); +const MotionMarker = /*@__PURE__*/ createMotionComponentWithFeatures("marker"); +const MotionMask = /*@__PURE__*/ createMotionComponentWithFeatures("mask"); +const MotionMetadata = /*@__PURE__*/ createMotionComponentWithFeatures("metadata"); +const MotionPath = /*@__PURE__*/ createMotionComponentWithFeatures("path"); +const MotionPattern = /*@__PURE__*/ createMotionComponentWithFeatures("pattern"); +const MotionPolygon = /*@__PURE__*/ createMotionComponentWithFeatures("polygon"); +const MotionPolyline = /*@__PURE__*/ createMotionComponentWithFeatures("polyline"); +const MotionRect = /*@__PURE__*/ createMotionComponentWithFeatures("rect"); +const MotionStop = /*@__PURE__*/ createMotionComponentWithFeatures("stop"); +const MotionSvg = /*@__PURE__*/ createMotionComponentWithFeatures("svg"); +const MotionSymbol = /*@__PURE__*/ createMotionComponentWithFeatures("symbol"); +const MotionText = /*@__PURE__*/ createMotionComponentWithFeatures("text"); +const MotionTspan = /*@__PURE__*/ createMotionComponentWithFeatures("tspan"); +const MotionUse = /*@__PURE__*/ createMotionComponentWithFeatures("use"); +const MotionView = /*@__PURE__*/ createMotionComponentWithFeatures("view"); +const MotionClipPath = /*@__PURE__*/ createMotionComponentWithFeatures("clipPath"); +const MotionFeBlend = /*@__PURE__*/ createMotionComponentWithFeatures("feBlend"); +const MotionFeColorMatrix = +/*@__PURE__*/ createMotionComponentWithFeatures("feColorMatrix"); +const MotionFeComponentTransfer = /*@__PURE__*/ createMotionComponentWithFeatures("feComponentTransfer"); +const MotionFeComposite = +/*@__PURE__*/ createMotionComponentWithFeatures("feComposite"); +const MotionFeConvolveMatrix = +/*@__PURE__*/ createMotionComponentWithFeatures("feConvolveMatrix"); +const MotionFeDiffuseLighting = +/*@__PURE__*/ createMotionComponentWithFeatures("feDiffuseLighting"); +const MotionFeDisplacementMap = +/*@__PURE__*/ createMotionComponentWithFeatures("feDisplacementMap"); +const MotionFeDistantLight = +/*@__PURE__*/ createMotionComponentWithFeatures("feDistantLight"); +const MotionFeDropShadow = +/*@__PURE__*/ createMotionComponentWithFeatures("feDropShadow"); +const MotionFeFlood = /*@__PURE__*/ createMotionComponentWithFeatures("feFlood"); +const MotionFeFuncA = /*@__PURE__*/ createMotionComponentWithFeatures("feFuncA"); +const MotionFeFuncB = /*@__PURE__*/ createMotionComponentWithFeatures("feFuncB"); +const MotionFeFuncG = /*@__PURE__*/ createMotionComponentWithFeatures("feFuncG"); +const MotionFeFuncR = /*@__PURE__*/ createMotionComponentWithFeatures("feFuncR"); +const MotionFeGaussianBlur = +/*@__PURE__*/ createMotionComponentWithFeatures("feGaussianBlur"); +const MotionFeImage = /*@__PURE__*/ createMotionComponentWithFeatures("feImage"); +const MotionFeMerge = /*@__PURE__*/ createMotionComponentWithFeatures("feMerge"); +const MotionFeMergeNode = +/*@__PURE__*/ createMotionComponentWithFeatures("feMergeNode"); +const MotionFeMorphology = +/*@__PURE__*/ createMotionComponentWithFeatures("feMorphology"); +const MotionFeOffset = /*@__PURE__*/ createMotionComponentWithFeatures("feOffset"); +const MotionFePointLight = +/*@__PURE__*/ createMotionComponentWithFeatures("fePointLight"); +const MotionFeSpecularLighting = +/*@__PURE__*/ createMotionComponentWithFeatures("feSpecularLighting"); +const MotionFeSpotLight = +/*@__PURE__*/ createMotionComponentWithFeatures("feSpotLight"); +const MotionFeTile = /*@__PURE__*/ createMotionComponentWithFeatures("feTile"); +const MotionFeTurbulence = +/*@__PURE__*/ createMotionComponentWithFeatures("feTurbulence"); +const MotionForeignObject = +/*@__PURE__*/ createMotionComponentWithFeatures("foreignObject"); +const MotionLinearGradient = +/*@__PURE__*/ createMotionComponentWithFeatures("linearGradient"); +const MotionRadialGradient = +/*@__PURE__*/ createMotionComponentWithFeatures("radialGradient"); +const MotionTextPath = /*@__PURE__*/ createMotionComponentWithFeatures("textPath"); + +export { MotionA, MotionAbbr, MotionAddress, MotionAnimate, MotionArea, MotionArticle, MotionAside, MotionAudio, MotionB, MotionBase, MotionBdi, MotionBdo, MotionBig, MotionBlockquote, MotionBody, MotionButton, MotionCanvas, MotionCaption, MotionCircle, MotionCite, MotionClipPath, MotionCode, MotionCol, MotionColgroup, MotionData, MotionDatalist, MotionDd, MotionDefs, MotionDel, MotionDesc, MotionDetails, MotionDfn, MotionDialog, MotionDiv, MotionDl, MotionDt, MotionEllipse, MotionEm, MotionEmbed, MotionFeBlend, MotionFeColorMatrix, MotionFeComponentTransfer, MotionFeComposite, MotionFeConvolveMatrix, MotionFeDiffuseLighting, MotionFeDisplacementMap, MotionFeDistantLight, MotionFeDropShadow, MotionFeFlood, MotionFeFuncA, MotionFeFuncB, MotionFeFuncG, MotionFeFuncR, MotionFeGaussianBlur, MotionFeImage, MotionFeMerge, MotionFeMergeNode, MotionFeMorphology, MotionFeOffset, MotionFePointLight, MotionFeSpecularLighting, MotionFeSpotLight, MotionFeTile, MotionFeTurbulence, MotionFieldset, MotionFigcaption, MotionFigure, MotionFilter, MotionFooter, MotionForeignObject, MotionForm, MotionG, MotionH1, MotionH2, MotionH3, MotionH4, MotionH5, MotionH6, MotionHead, MotionHeader, MotionHgroup, MotionHr, MotionHtml, MotionI, MotionIframe, MotionImage, MotionImg, MotionInput, MotionIns, MotionKbd, MotionKeygen, MotionLabel, MotionLegend, MotionLi, MotionLine, MotionLinearGradient, MotionLink, MotionMain, MotionMap, MotionMark, MotionMarker, MotionMask, MotionMenu, MotionMenuitem, MotionMetadata, MotionMeter, MotionNav, MotionObject, MotionOl, MotionOptgroup, MotionOption, MotionOutput, MotionP, MotionParam, MotionPath, MotionPattern, MotionPicture, MotionPolygon, MotionPolyline, MotionPre, MotionProgress, MotionQ, MotionRadialGradient, MotionRect, MotionRp, MotionRt, MotionRuby, MotionS, MotionSamp, MotionScript, MotionSection, MotionSelect, MotionSmall, MotionSource, MotionSpan, MotionStop, MotionStrong, MotionStyle, MotionSub, MotionSummary, MotionSup, MotionSvg, MotionSymbol, MotionTable, MotionTbody, MotionTd, MotionText, MotionTextPath, MotionTextarea, MotionTfoot, MotionTh, MotionThead, MotionTime, MotionTitle, MotionTr, MotionTrack, MotionTspan, MotionU, MotionUl, MotionUse, MotionVideo, MotionView, MotionWbr, MotionWebview }; +//# sourceMappingURL=elements.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/components/motion/elements.mjs.map b/node_modules/framer-motion/dist/es/render/components/motion/elements.mjs.map new file mode 100644 index 0000000..49a367d --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/components/motion/elements.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"elements.mjs","sources":["../../../../../src/render/components/motion/elements.ts"],"sourcesContent":["\"use client\"\n\nimport { createMotionComponentWithFeatures as createMotionComponent } from \"./create\"\n\n/**\n * HTML components\n */\nexport const MotionA = /*@__PURE__*/ createMotionComponent(\"a\")\nexport const MotionAbbr = /*@__PURE__*/ createMotionComponent(\"abbr\")\nexport const MotionAddress = /*@__PURE__*/ createMotionComponent(\"address\")\nexport const MotionArea = /*@__PURE__*/ createMotionComponent(\"area\")\nexport const MotionArticle = /*@__PURE__*/ createMotionComponent(\"article\")\nexport const MotionAside = /*@__PURE__*/ createMotionComponent(\"aside\")\nexport const MotionAudio = /*@__PURE__*/ createMotionComponent(\"audio\")\nexport const MotionB = /*@__PURE__*/ createMotionComponent(\"b\")\nexport const MotionBase = /*@__PURE__*/ createMotionComponent(\"base\")\nexport const MotionBdi = /*@__PURE__*/ createMotionComponent(\"bdi\")\nexport const MotionBdo = /*@__PURE__*/ createMotionComponent(\"bdo\")\nexport const MotionBig = /*@__PURE__*/ createMotionComponent(\"big\")\nexport const MotionBlockquote =\n /*@__PURE__*/ createMotionComponent(\"blockquote\")\nexport const MotionBody = /*@__PURE__*/ createMotionComponent(\"body\")\nexport const MotionButton = /*@__PURE__*/ createMotionComponent(\"button\")\nexport const MotionCanvas = /*@__PURE__*/ createMotionComponent(\"canvas\")\nexport const MotionCaption = /*@__PURE__*/ createMotionComponent(\"caption\")\nexport const MotionCite = /*@__PURE__*/ createMotionComponent(\"cite\")\nexport const MotionCode = /*@__PURE__*/ createMotionComponent(\"code\")\nexport const MotionCol = /*@__PURE__*/ createMotionComponent(\"col\")\nexport const MotionColgroup = /*@__PURE__*/ createMotionComponent(\"colgroup\")\nexport const MotionData = /*@__PURE__*/ createMotionComponent(\"data\")\nexport const MotionDatalist = /*@__PURE__*/ createMotionComponent(\"datalist\")\nexport const MotionDd = /*@__PURE__*/ createMotionComponent(\"dd\")\nexport const MotionDel = /*@__PURE__*/ createMotionComponent(\"del\")\nexport const MotionDetails = /*@__PURE__*/ createMotionComponent(\"details\")\nexport const MotionDfn = /*@__PURE__*/ createMotionComponent(\"dfn\")\nexport const MotionDialog = /*@__PURE__*/ createMotionComponent(\"dialog\")\nexport const MotionDiv = /*@__PURE__*/ createMotionComponent(\"div\")\nexport const MotionDl = /*@__PURE__*/ createMotionComponent(\"dl\")\nexport const MotionDt = /*@__PURE__*/ createMotionComponent(\"dt\")\nexport const MotionEm = /*@__PURE__*/ createMotionComponent(\"em\")\nexport const MotionEmbed = /*@__PURE__*/ createMotionComponent(\"embed\")\nexport const MotionFieldset = /*@__PURE__*/ createMotionComponent(\"fieldset\")\nexport const MotionFigcaption =\n /*@__PURE__*/ createMotionComponent(\"figcaption\")\nexport const MotionFigure = /*@__PURE__*/ createMotionComponent(\"figure\")\nexport const MotionFooter = /*@__PURE__*/ createMotionComponent(\"footer\")\nexport const MotionForm = /*@__PURE__*/ createMotionComponent(\"form\")\nexport const MotionH1 = /*@__PURE__*/ createMotionComponent(\"h1\")\nexport const MotionH2 = /*@__PURE__*/ createMotionComponent(\"h2\")\nexport const MotionH3 = /*@__PURE__*/ createMotionComponent(\"h3\")\nexport const MotionH4 = /*@__PURE__*/ createMotionComponent(\"h4\")\nexport const MotionH5 = /*@__PURE__*/ createMotionComponent(\"h5\")\nexport const MotionH6 = /*@__PURE__*/ createMotionComponent(\"h6\")\nexport const MotionHead = /*@__PURE__*/ createMotionComponent(\"head\")\nexport const MotionHeader = /*@__PURE__*/ createMotionComponent(\"header\")\nexport const MotionHgroup = /*@__PURE__*/ createMotionComponent(\"hgroup\")\nexport const MotionHr = /*@__PURE__*/ createMotionComponent(\"hr\")\nexport const MotionHtml = /*@__PURE__*/ createMotionComponent(\"html\")\nexport const MotionI = /*@__PURE__*/ createMotionComponent(\"i\")\nexport const MotionIframe = /*@__PURE__*/ createMotionComponent(\"iframe\")\nexport const MotionImg = /*@__PURE__*/ createMotionComponent(\"img\")\nexport const MotionInput = /*@__PURE__*/ createMotionComponent(\"input\")\nexport const MotionIns = /*@__PURE__*/ createMotionComponent(\"ins\")\nexport const MotionKbd = /*@__PURE__*/ createMotionComponent(\"kbd\")\nexport const MotionKeygen = /*@__PURE__*/ createMotionComponent(\"keygen\")\nexport const MotionLabel = /*@__PURE__*/ createMotionComponent(\"label\")\nexport const MotionLegend = /*@__PURE__*/ createMotionComponent(\"legend\")\nexport const MotionLi = /*@__PURE__*/ createMotionComponent(\"li\")\nexport const MotionLink = /*@__PURE__*/ createMotionComponent(\"link\")\nexport const MotionMain = /*@__PURE__*/ createMotionComponent(\"main\")\nexport const MotionMap = /*@__PURE__*/ createMotionComponent(\"map\")\nexport const MotionMark = /*@__PURE__*/ createMotionComponent(\"mark\")\nexport const MotionMenu = /*@__PURE__*/ createMotionComponent(\"menu\")\nexport const MotionMenuitem = /*@__PURE__*/ createMotionComponent(\"menuitem\")\nexport const MotionMeter = /*@__PURE__*/ createMotionComponent(\"meter\")\nexport const MotionNav = /*@__PURE__*/ createMotionComponent(\"nav\")\nexport const MotionObject = /*@__PURE__*/ createMotionComponent(\"object\")\nexport const MotionOl = /*@__PURE__*/ createMotionComponent(\"ol\")\nexport const MotionOptgroup = /*@__PURE__*/ createMotionComponent(\"optgroup\")\nexport const MotionOption = /*@__PURE__*/ createMotionComponent(\"option\")\nexport const MotionOutput = /*@__PURE__*/ createMotionComponent(\"output\")\nexport const MotionP = /*@__PURE__*/ createMotionComponent(\"p\")\nexport const MotionParam = /*@__PURE__*/ createMotionComponent(\"param\")\nexport const MotionPicture = /*@__PURE__*/ createMotionComponent(\"picture\")\nexport const MotionPre = /*@__PURE__*/ createMotionComponent(\"pre\")\nexport const MotionProgress = /*@__PURE__*/ createMotionComponent(\"progress\")\nexport const MotionQ = /*@__PURE__*/ createMotionComponent(\"q\")\nexport const MotionRp = /*@__PURE__*/ createMotionComponent(\"rp\")\nexport const MotionRt = /*@__PURE__*/ createMotionComponent(\"rt\")\nexport const MotionRuby = /*@__PURE__*/ createMotionComponent(\"ruby\")\nexport const MotionS = /*@__PURE__*/ createMotionComponent(\"s\")\nexport const MotionSamp = /*@__PURE__*/ createMotionComponent(\"samp\")\nexport const MotionScript = /*@__PURE__*/ createMotionComponent(\"script\")\nexport const MotionSection = /*@__PURE__*/ createMotionComponent(\"section\")\nexport const MotionSelect = /*@__PURE__*/ createMotionComponent(\"select\")\nexport const MotionSmall = /*@__PURE__*/ createMotionComponent(\"small\")\nexport const MotionSource = /*@__PURE__*/ createMotionComponent(\"source\")\nexport const MotionSpan = /*@__PURE__*/ createMotionComponent(\"span\")\nexport const MotionStrong = /*@__PURE__*/ createMotionComponent(\"strong\")\nexport const MotionStyle = /*@__PURE__*/ createMotionComponent(\"style\")\nexport const MotionSub = /*@__PURE__*/ createMotionComponent(\"sub\")\nexport const MotionSummary = /*@__PURE__*/ createMotionComponent(\"summary\")\nexport const MotionSup = /*@__PURE__*/ createMotionComponent(\"sup\")\nexport const MotionTable = /*@__PURE__*/ createMotionComponent(\"table\")\nexport const MotionTbody = /*@__PURE__*/ createMotionComponent(\"tbody\")\nexport const MotionTd = /*@__PURE__*/ createMotionComponent(\"td\")\nexport const MotionTextarea = /*@__PURE__*/ createMotionComponent(\"textarea\")\nexport const MotionTfoot = /*@__PURE__*/ createMotionComponent(\"tfoot\")\nexport const MotionTh = /*@__PURE__*/ createMotionComponent(\"th\")\nexport const MotionThead = /*@__PURE__*/ createMotionComponent(\"thead\")\nexport const MotionTime = /*@__PURE__*/ createMotionComponent(\"time\")\nexport const MotionTitle = /*@__PURE__*/ createMotionComponent(\"title\")\nexport const MotionTr = /*@__PURE__*/ createMotionComponent(\"tr\")\nexport const MotionTrack = /*@__PURE__*/ createMotionComponent(\"track\")\nexport const MotionU = /*@__PURE__*/ createMotionComponent(\"u\")\nexport const MotionUl = /*@__PURE__*/ createMotionComponent(\"ul\")\nexport const MotionVideo = /*@__PURE__*/ createMotionComponent(\"video\")\nexport const MotionWbr = /*@__PURE__*/ createMotionComponent(\"wbr\")\nexport const MotionWebview = /*@__PURE__*/ createMotionComponent(\"webview\")\n\n/**\n * SVG components\n */\nexport const MotionAnimate = /*@__PURE__*/ createMotionComponent(\"animate\")\nexport const MotionCircle = /*@__PURE__*/ createMotionComponent(\"circle\")\nexport const MotionDefs = /*@__PURE__*/ createMotionComponent(\"defs\")\nexport const MotionDesc = /*@__PURE__*/ createMotionComponent(\"desc\")\nexport const MotionEllipse = /*@__PURE__*/ createMotionComponent(\"ellipse\")\nexport const MotionG = /*@__PURE__*/ createMotionComponent(\"g\")\nexport const MotionImage = /*@__PURE__*/ createMotionComponent(\"image\")\nexport const MotionLine = /*@__PURE__*/ createMotionComponent(\"line\")\nexport const MotionFilter = /*@__PURE__*/ createMotionComponent(\"filter\")\nexport const MotionMarker = /*@__PURE__*/ createMotionComponent(\"marker\")\nexport const MotionMask = /*@__PURE__*/ createMotionComponent(\"mask\")\nexport const MotionMetadata = /*@__PURE__*/ createMotionComponent(\"metadata\")\nexport const MotionPath = /*@__PURE__*/ createMotionComponent(\"path\")\nexport const MotionPattern = /*@__PURE__*/ createMotionComponent(\"pattern\")\nexport const MotionPolygon = /*@__PURE__*/ createMotionComponent(\"polygon\")\nexport const MotionPolyline = /*@__PURE__*/ createMotionComponent(\"polyline\")\nexport const MotionRect = /*@__PURE__*/ createMotionComponent(\"rect\")\nexport const MotionStop = /*@__PURE__*/ createMotionComponent(\"stop\")\nexport const MotionSvg = /*@__PURE__*/ createMotionComponent(\"svg\")\nexport const MotionSymbol = /*@__PURE__*/ createMotionComponent(\"symbol\")\nexport const MotionText = /*@__PURE__*/ createMotionComponent(\"text\")\nexport const MotionTspan = /*@__PURE__*/ createMotionComponent(\"tspan\")\nexport const MotionUse = /*@__PURE__*/ createMotionComponent(\"use\")\nexport const MotionView = /*@__PURE__*/ createMotionComponent(\"view\")\nexport const MotionClipPath = /*@__PURE__*/ createMotionComponent(\"clipPath\")\nexport const MotionFeBlend = /*@__PURE__*/ createMotionComponent(\"feBlend\")\nexport const MotionFeColorMatrix =\n /*@__PURE__*/ createMotionComponent(\"feColorMatrix\")\nexport const MotionFeComponentTransfer = /*@__PURE__*/ createMotionComponent(\n \"feComponentTransfer\"\n)\nexport const MotionFeComposite =\n /*@__PURE__*/ createMotionComponent(\"feComposite\")\nexport const MotionFeConvolveMatrix =\n /*@__PURE__*/ createMotionComponent(\"feConvolveMatrix\")\nexport const MotionFeDiffuseLighting =\n /*@__PURE__*/ createMotionComponent(\"feDiffuseLighting\")\nexport const MotionFeDisplacementMap =\n /*@__PURE__*/ createMotionComponent(\"feDisplacementMap\")\nexport const MotionFeDistantLight =\n /*@__PURE__*/ createMotionComponent(\"feDistantLight\")\nexport const MotionFeDropShadow =\n /*@__PURE__*/ createMotionComponent(\"feDropShadow\")\nexport const MotionFeFlood = /*@__PURE__*/ createMotionComponent(\"feFlood\")\nexport const MotionFeFuncA = /*@__PURE__*/ createMotionComponent(\"feFuncA\")\nexport const MotionFeFuncB = /*@__PURE__*/ createMotionComponent(\"feFuncB\")\nexport const MotionFeFuncG = /*@__PURE__*/ createMotionComponent(\"feFuncG\")\nexport const MotionFeFuncR = /*@__PURE__*/ createMotionComponent(\"feFuncR\")\nexport const MotionFeGaussianBlur =\n /*@__PURE__*/ createMotionComponent(\"feGaussianBlur\")\nexport const MotionFeImage = /*@__PURE__*/ createMotionComponent(\"feImage\")\nexport const MotionFeMerge = /*@__PURE__*/ createMotionComponent(\"feMerge\")\nexport const MotionFeMergeNode =\n /*@__PURE__*/ createMotionComponent(\"feMergeNode\")\nexport const MotionFeMorphology =\n /*@__PURE__*/ createMotionComponent(\"feMorphology\")\nexport const MotionFeOffset = /*@__PURE__*/ createMotionComponent(\"feOffset\")\nexport const MotionFePointLight =\n /*@__PURE__*/ createMotionComponent(\"fePointLight\")\nexport const MotionFeSpecularLighting =\n /*@__PURE__*/ createMotionComponent(\"feSpecularLighting\")\nexport const MotionFeSpotLight =\n /*@__PURE__*/ createMotionComponent(\"feSpotLight\")\nexport const MotionFeTile = /*@__PURE__*/ createMotionComponent(\"feTile\")\nexport const MotionFeTurbulence =\n /*@__PURE__*/ createMotionComponent(\"feTurbulence\")\nexport const MotionForeignObject =\n /*@__PURE__*/ createMotionComponent(\"foreignObject\")\nexport const MotionLinearGradient =\n /*@__PURE__*/ createMotionComponent(\"linearGradient\")\nexport const MotionRadialGradient =\n /*@__PURE__*/ createMotionComponent(\"radialGradient\")\nexport const MotionTextPath = /*@__PURE__*/ createMotionComponent(\"textPath\")\n"],"names":[],"mappings":";;;AAIA;;AAEG;AACI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEH;AACG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEH;AACG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEP;;AAEG;AACI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEH;AACG;;AAIH;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACG;AACA;AACA;AACA;AACA;;AAEH;AACG;AACA;;AAEH;;AAEA;AACG;;AAEH;;AAEA;;AAEA;AACG;;AAEH;;AAEA;;AAEA;;AAEA;AACG;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/components/motion/feature-bundle.mjs b/node_modules/framer-motion/dist/es/render/components/motion/feature-bundle.mjs new file mode 100644 index 0000000..06da6bd --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/components/motion/feature-bundle.mjs @@ -0,0 +1,14 @@ +import { animations } from '../../../motion/features/animations.mjs'; +import { drag } from '../../../motion/features/drag.mjs'; +import { gestureAnimations } from '../../../motion/features/gestures.mjs'; +import { layout } from '../../../motion/features/layout.mjs'; + +const featureBundle = { + ...animations, + ...gestureAnimations, + ...drag, + ...layout, +}; + +export { featureBundle }; +//# sourceMappingURL=feature-bundle.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/components/motion/feature-bundle.mjs.map b/node_modules/framer-motion/dist/es/render/components/motion/feature-bundle.mjs.map new file mode 100644 index 0000000..14f564d --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/components/motion/feature-bundle.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"feature-bundle.mjs","sources":["../../../../../src/render/components/motion/feature-bundle.ts"],"sourcesContent":["import { animations } from \"../../../motion/features/animations\"\nimport { drag } from \"../../../motion/features/drag\"\nimport { gestureAnimations } from \"../../../motion/features/gestures\"\nimport { layout } from \"../../../motion/features/layout\"\n\nexport const featureBundle = {\n ...animations,\n ...gestureAnimations,\n ...drag,\n ...layout,\n}\n"],"names":[],"mappings":";;;;;AAKO,MAAM,aAAa,GAAG;AACzB,IAAA,GAAG,UAAU;AACb,IAAA,GAAG,iBAAiB;AACpB,IAAA,GAAG,IAAI;AACP,IAAA,GAAG,MAAM;;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/components/motion/proxy.mjs b/node_modules/framer-motion/dist/es/render/components/motion/proxy.mjs new file mode 100644 index 0000000..66755ca --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/components/motion/proxy.mjs @@ -0,0 +1,8 @@ +import { createDomVisualElement } from '../../dom/create-visual-element.mjs'; +import { createMotionProxy } from '../create-proxy.mjs'; +import { featureBundle } from './feature-bundle.mjs'; + +const motion = /*@__PURE__*/ createMotionProxy(featureBundle, createDomVisualElement); + +export { motion }; +//# sourceMappingURL=proxy.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/components/motion/proxy.mjs.map b/node_modules/framer-motion/dist/es/render/components/motion/proxy.mjs.map new file mode 100644 index 0000000..7866880 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/components/motion/proxy.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"proxy.mjs","sources":["../../../../../src/render/components/motion/proxy.ts"],"sourcesContent":["import { createDomVisualElement } from \"../../dom/create-visual-element\"\nimport { createMotionProxy } from \"../create-proxy\"\nimport { featureBundle } from \"./feature-bundle\"\n\nexport const motion = /*@__PURE__*/ createMotionProxy(\n featureBundle,\n createDomVisualElement\n)\n"],"names":[],"mappings":";;;;AAIO,MAAM,MAAM,iBAAiB,iBAAiB,CACjD,aAAa,EACb,sBAAsB;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/dom/create-visual-element.mjs b/node_modules/framer-motion/dist/es/render/dom/create-visual-element.mjs new file mode 100644 index 0000000..95a233f --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/create-visual-element.mjs @@ -0,0 +1,18 @@ +import { SVGVisualElement, HTMLVisualElement } from 'motion-dom'; +import { Fragment } from 'react'; +import { isSVGComponent } from './utils/is-svg-component.mjs'; + +const createDomVisualElement = (Component, options) => { + /** + * Use explicit isSVG override if provided, otherwise auto-detect + */ + const isSVG = options.isSVG ?? isSVGComponent(Component); + return isSVG + ? new SVGVisualElement(options) + : new HTMLVisualElement(options, { + allowProjection: Component !== Fragment, + }); +}; + +export { createDomVisualElement }; +//# sourceMappingURL=create-visual-element.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/dom/create-visual-element.mjs.map b/node_modules/framer-motion/dist/es/render/dom/create-visual-element.mjs.map new file mode 100644 index 0000000..a98aaaa --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/create-visual-element.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"create-visual-element.mjs","sources":["../../../../src/render/dom/create-visual-element.ts"],"sourcesContent":["import { HTMLVisualElement, SVGVisualElement } from \"motion-dom\"\nimport { ComponentType, Fragment } from \"react\"\nimport { CreateVisualElement, VisualElementOptions } from \"../types\"\nimport { isSVGComponent } from \"./utils/is-svg-component\"\n\nexport const createDomVisualElement: CreateVisualElement = (\n Component: string | ComponentType>,\n options: VisualElementOptions\n) => {\n /**\n * Use explicit isSVG override if provided, otherwise auto-detect\n */\n const isSVG = options.isSVG ?? isSVGComponent(Component)\n\n return isSVG\n ? new SVGVisualElement(options)\n : new HTMLVisualElement(options, {\n allowProjection: Component !== Fragment,\n })\n}\n"],"names":[],"mappings":";;;;MAKa,sBAAsB,GAAwB,CACvD,SAAmE,EACnE,OAAuD,KACvD;AACA;;AAEG;IACH,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,cAAc,CAAC,SAAS,CAAC;AAExD,IAAA,OAAO;AACH,UAAE,IAAI,gBAAgB,CAAC,OAAO;AAC9B,UAAE,IAAI,iBAAiB,CAAC,OAAO,EAAE;YAC3B,eAAe,EAAE,SAAS,KAAK,QAAQ;AAC1C,SAAA,CAAC;AACZ;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/dom/features-animation.mjs b/node_modules/framer-motion/dist/es/render/dom/features-animation.mjs new file mode 100644 index 0000000..4f15e67 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/features-animation.mjs @@ -0,0 +1,16 @@ +"use client"; +import { animations } from '../../motion/features/animations.mjs'; +import { gestureAnimations } from '../../motion/features/gestures.mjs'; +import { createDomVisualElement } from './create-visual-element.mjs'; + +/** + * @public + */ +const domAnimation = { + renderer: createDomVisualElement, + ...animations, + ...gestureAnimations, +}; + +export { domAnimation }; +//# sourceMappingURL=features-animation.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/dom/features-animation.mjs.map b/node_modules/framer-motion/dist/es/render/dom/features-animation.mjs.map new file mode 100644 index 0000000..f0f6583 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/features-animation.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"features-animation.mjs","sources":["../../../../src/render/dom/features-animation.ts"],"sourcesContent":["\"use client\"\n\nimport { animations } from \"../../motion/features/animations\"\nimport { gestureAnimations } from \"../../motion/features/gestures\"\nimport { FeatureBundle } from \"../../motion/features/types\"\nimport { createDomVisualElement } from \"./create-visual-element\"\n\n/**\n * @public\n */\nexport const domAnimation: FeatureBundle = {\n renderer: createDomVisualElement,\n ...animations,\n ...gestureAnimations,\n}\n"],"names":[],"mappings":";;;;;AAOA;;AAEG;AACI;AACH;AACA;AACA;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/dom/features-max.mjs b/node_modules/framer-motion/dist/es/render/dom/features-max.mjs new file mode 100644 index 0000000..54deaf2 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/features-max.mjs @@ -0,0 +1,16 @@ +"use client"; +import { drag } from '../../motion/features/drag.mjs'; +import { layout } from '../../motion/features/layout.mjs'; +import { domAnimation } from './features-animation.mjs'; + +/** + * @public + */ +const domMax = { + ...domAnimation, + ...drag, + ...layout, +}; + +export { domMax }; +//# sourceMappingURL=features-max.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/dom/features-max.mjs.map b/node_modules/framer-motion/dist/es/render/dom/features-max.mjs.map new file mode 100644 index 0000000..082a5b8 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/features-max.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"features-max.mjs","sources":["../../../../src/render/dom/features-max.ts"],"sourcesContent":["\"use client\"\n\nimport { drag } from \"../../motion/features/drag\"\nimport { layout } from \"../../motion/features/layout\"\nimport { FeatureBundle } from \"../../motion/features/types\"\nimport { domAnimation } from \"./features-animation\"\n\n/**\n * @public\n */\nexport const domMax: FeatureBundle = {\n ...domAnimation,\n ...drag,\n ...layout,\n}\n"],"names":[],"mappings":";;;;;AAOA;;AAEG;AACI;AACH;AACA;AACA;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/dom/features-min.mjs b/node_modules/framer-motion/dist/es/render/dom/features-min.mjs new file mode 100644 index 0000000..72a4fa0 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/features-min.mjs @@ -0,0 +1,14 @@ +"use client"; +import { animations } from '../../motion/features/animations.mjs'; +import { createDomVisualElement } from './create-visual-element.mjs'; + +/** + * @public + */ +const domMin = { + renderer: createDomVisualElement, + ...animations, +}; + +export { domMin }; +//# sourceMappingURL=features-min.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/dom/features-min.mjs.map b/node_modules/framer-motion/dist/es/render/dom/features-min.mjs.map new file mode 100644 index 0000000..75c11f7 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/features-min.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"features-min.mjs","sources":["../../../../src/render/dom/features-min.ts"],"sourcesContent":["\"use client\"\n\nimport { animations } from \"../../motion/features/animations\"\nimport { FeatureBundle } from \"../../motion/features/types\"\nimport { createDomVisualElement } from \"./create-visual-element\"\n\n/**\n * @public\n */\nexport const domMin: FeatureBundle = {\n renderer: createDomVisualElement,\n ...animations,\n}\n"],"names":[],"mappings":";;;;AAMA;;AAEG;AACI;AACH;AACA;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/attach-animation.mjs b/node_modules/framer-motion/dist/es/render/dom/scroll/attach-animation.mjs new file mode 100644 index 0000000..2913e9d --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/scroll/attach-animation.mjs @@ -0,0 +1,38 @@ +import { observeTimeline } from 'motion-dom'; +import { canUseNativeTimeline } from './utils/can-use-native-timeline.mjs'; +import { getTimeline } from './utils/get-timeline.mjs'; +import { offsetToViewTimelineRange } from './utils/offset-to-range.mjs'; + +function attachToAnimation(animation, options) { + const timeline = getTimeline(options); + const range = options.target + ? offsetToViewTimelineRange(options.offset) + : undefined; + /** + * Use native timeline when: + * - No target: ScrollTimeline (existing behaviour) + * - Target with mappable offset: ViewTimeline with named range + * - Target with unmappable offset: fall back to JS observe + */ + const useNative = options.target + ? canUseNativeTimeline(options.target) && !!range + : canUseNativeTimeline(); + return animation.attachTimeline({ + timeline: useNative ? timeline : undefined, + ...(range && + useNative && { + rangeStart: range.rangeStart, + rangeEnd: range.rangeEnd, + }), + observe: (valueAnimation) => { + valueAnimation.pause(); + return observeTimeline((progress) => { + valueAnimation.time = + valueAnimation.iterationDuration * progress; + }, timeline); + }, + }); +} + +export { attachToAnimation }; +//# sourceMappingURL=attach-animation.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/attach-animation.mjs.map b/node_modules/framer-motion/dist/es/render/dom/scroll/attach-animation.mjs.map new file mode 100644 index 0000000..b9553c0 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/scroll/attach-animation.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"attach-animation.mjs","sources":["../../../../../src/render/dom/scroll/attach-animation.ts"],"sourcesContent":["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"],"names":[],"mappings":";;;;;AAMM,SAAU,iBAAiB,CAC7B,SAAoC,EACpC,OAAkC,EAAA;AAElC,IAAA,MAAM,QAAQ,GAAG,WAAW,CAAC,OAAO,CAAC;AAErC,IAAA,MAAM,KAAK,GAAG,OAAO,CAAC;AAClB,UAAE,yBAAyB,CAAC,OAAO,CAAC,MAAM;UACxC,SAAS;AAEf;;;;;AAKG;AACH,IAAA,MAAM,SAAS,GAAG,OAAO,CAAC;UACpB,oBAAoB,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;UAC1C,oBAAoB,EAAE;IAE5B,OAAO,SAAS,CAAC,cAAc,CAAC;QAC5B,QAAQ,EAAE,SAAS,GAAG,QAAQ,GAAG,SAAS;AAC1C,QAAA,IAAI,KAAK;AACL,YAAA,SAAS,IAAI;YACT,UAAU,EAAE,KAAK,CAAC,UAAU;YAC5B,QAAQ,EAAE,KAAK,CAAC,QAAQ;SAC3B,CAAC;AACN,QAAA,OAAO,EAAE,CAAC,cAAc,KAAI;YACxB,cAAc,CAAC,KAAK,EAAE;AAEtB,YAAA,OAAO,eAAe,CAAC,CAAC,QAAQ,KAAI;AAChC,gBAAA,cAAc,CAAC,IAAI;AACf,oBAAA,cAAc,CAAC,iBAAiB,GAAG,QAAQ;YACnD,CAAC,EAAE,QAAQ,CAAC;QAChB,CAAC;AACJ,KAAA,CAAC;AACN;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/attach-function.mjs b/node_modules/framer-motion/dist/es/render/dom/scroll/attach-function.mjs new file mode 100644 index 0000000..f992a87 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/scroll/attach-function.mjs @@ -0,0 +1,25 @@ +import { observeTimeline } from 'motion-dom'; +import { scrollInfo } from './track.mjs'; +import { getTimeline } from './utils/get-timeline.mjs'; +import { isElementTracking } from './utils/is-element-tracking.mjs'; + +/** + * If the onScroll function has two arguments, it's expecting + * more specific information about the scroll from scrollInfo. + */ +function isOnScrollWithInfo(onScroll) { + return onScroll.length === 2; +} +function attachToFunction(onScroll, options) { + if (isOnScrollWithInfo(onScroll) || isElementTracking(options)) { + return scrollInfo((info) => { + onScroll(info[options.axis].progress, info); + }, options); + } + else { + return observeTimeline(onScroll, getTimeline(options)); + } +} + +export { attachToFunction }; +//# sourceMappingURL=attach-function.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/attach-function.mjs.map b/node_modules/framer-motion/dist/es/render/dom/scroll/attach-function.mjs.map new file mode 100644 index 0000000..1a1a38d --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/scroll/attach-function.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"attach-function.mjs","sources":["../../../../../src/render/dom/scroll/attach-function.ts"],"sourcesContent":["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"],"names":[],"mappings":";;;;;AAMA;;;AAGG;AACH,SAAS,kBAAkB,CAAC,QAAkB,EAAA;AAC1C,IAAA,OAAO,QAAQ,CAAC,MAAM,KAAK,CAAC;AAChC;AAEM,SAAU,gBAAgB,CAC5B,QAAkB,EAClB,OAAkC,EAAA;IAElC,IAAI,kBAAkB,CAAC,QAAQ,CAAC,IAAI,iBAAiB,CAAC,OAAO,CAAC,EAAE;AAC5D,QAAA,OAAO,UAAU,CAAC,CAAC,IAAI,KAAI;AACvB,YAAA,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,IAAK,CAAC,CAAC,QAAQ,EAAE,IAAI,CAAC;QAChD,CAAC,EAAE,OAAO,CAAC;IACf;SAAO;QACH,OAAO,eAAe,CAAC,QAAQ,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC1D;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/index.mjs b/node_modules/framer-motion/dist/es/render/dom/scroll/index.mjs new file mode 100644 index 0000000..2c4016a --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/scroll/index.mjs @@ -0,0 +1,15 @@ +import { noop } from 'motion-utils'; +import { attachToAnimation } from './attach-animation.mjs'; +import { attachToFunction } from './attach-function.mjs'; + +function scroll(onScroll, { axis = "y", container = document.scrollingElement, ...options } = {}) { + if (!container) + return noop; + const optionsWithDefaults = { axis, container, ...options }; + return typeof onScroll === "function" + ? attachToFunction(onScroll, optionsWithDefaults) + : attachToAnimation(onScroll, optionsWithDefaults); +} + +export { scroll }; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/index.mjs.map b/node_modules/framer-motion/dist/es/render/dom/scroll/index.mjs.map new file mode 100644 index 0000000..964ab96 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/scroll/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../../../../../src/render/dom/scroll/index.ts"],"sourcesContent":["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"],"names":[],"mappings":";;;;SAMgB,MAAM,CAClB,QAA8C,EAC9C,EACI,IAAI,GAAG,GAAG,EACV,SAAS,GAAG,QAAQ,CAAC,gBAA2B,EAChD,GAAG,OAAO,KACK,EAAE,EAAA;AAErB,IAAA,IAAI,CAAC,SAAS;AAAE,QAAA,OAAO,IAAoB;IAE3C,MAAM,mBAAmB,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,OAAO,EAAE;IAE3D,OAAO,OAAO,QAAQ,KAAK;AACvB,UAAE,gBAAgB,CAAC,QAAQ,EAAE,mBAAmB;AAChD,UAAE,iBAAiB,CAAC,QAAQ,EAAE,mBAAmB,CAAC;AAC1D;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/info.mjs b/node_modules/framer-motion/dist/es/render/dom/scroll/info.mjs new file mode 100644 index 0000000..3d0f053 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/scroll/info.mjs @@ -0,0 +1,56 @@ +import { progress, velocityPerSecond } from 'motion-utils'; + +/** + * A time in milliseconds, beyond which we consider the scroll velocity to be 0. + */ +const maxElapsed = 50; +const createAxisInfo = () => ({ + current: 0, + offset: [], + progress: 0, + scrollLength: 0, + targetOffset: 0, + targetLength: 0, + containerLength: 0, + velocity: 0, +}); +const createScrollInfo = () => ({ + time: 0, + x: createAxisInfo(), + y: createAxisInfo(), +}); +const keys = { + x: { + length: "Width", + position: "Left", + }, + y: { + length: "Height", + position: "Top", + }, +}; +function updateAxisInfo(element, axisName, info, time) { + const axis = info[axisName]; + const { length, position } = keys[axisName]; + const prev = axis.current; + const prevTime = info.time; + axis.current = Math.abs(element[`scroll${position}`]); + axis.scrollLength = element[`scroll${length}`] - element[`client${length}`]; + axis.offset.length = 0; + axis.offset[0] = 0; + axis.offset[1] = axis.scrollLength; + axis.progress = progress(0, axis.scrollLength, axis.current); + const elapsed = time - prevTime; + axis.velocity = + elapsed > maxElapsed + ? 0 + : velocityPerSecond(axis.current - prev, elapsed); +} +function updateScrollInfo(element, info, time) { + updateAxisInfo(element, "x", info, time); + updateAxisInfo(element, "y", info, time); + info.time = time; +} + +export { createScrollInfo, updateScrollInfo }; +//# sourceMappingURL=info.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/info.mjs.map b/node_modules/framer-motion/dist/es/render/dom/scroll/info.mjs.map new file mode 100644 index 0000000..3aea0f4 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/scroll/info.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"info.mjs","sources":["../../../../../src/render/dom/scroll/info.ts"],"sourcesContent":["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"],"names":[],"mappings":";;AAGA;;AAEG;AACH,MAAM,UAAU,GAAG,EAAE;AAErB,MAAM,cAAc,GAAG,OAAuB;AAC1C,IAAA,OAAO,EAAE,CAAC;AACV,IAAA,MAAM,EAAE,EAAE;AACV,IAAA,QAAQ,EAAE,CAAC;AACX,IAAA,YAAY,EAAE,CAAC;AACf,IAAA,YAAY,EAAE,CAAC;AACf,IAAA,YAAY,EAAE,CAAC;AACf,IAAA,eAAe,EAAE,CAAC;AAClB,IAAA,QAAQ,EAAE,CAAC;AACd,CAAA,CAAC;AAEK,MAAM,gBAAgB,GAAG,OAAmB;AAC/C,IAAA,IAAI,EAAE,CAAC;IACP,CAAC,EAAE,cAAc,EAAE;IACnB,CAAC,EAAE,cAAc,EAAE;AACtB,CAAA;AAED,MAAM,IAAI,GAAG;AACT,IAAA,CAAC,EAAE;AACC,QAAA,MAAM,EAAE,OAAO;AACf,QAAA,QAAQ,EAAE,MAAM;AACnB,KAAA;AACD,IAAA,CAAC,EAAE;AACC,QAAA,MAAM,EAAE,QAAQ;AAChB,QAAA,QAAQ,EAAE,KAAK;AAClB,KAAA;CACK;AAEV,SAAS,cAAc,CACnB,OAAgB,EAChB,QAAmB,EACnB,IAAgB,EAChB,IAAY,EAAA;AAEZ,IAAA,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC;IAC3B,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC,QAAQ,CAAC;AAE3C,IAAA,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO;AACzB,IAAA,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI;AAE1B,IAAA,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA,MAAA,EAAS,QAAQ,CAAA,CAAE,CAAC,CAAC;AACrD,IAAA,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,SAAS,MAAM,CAAA,CAAE,CAAC,GAAG,OAAO,CAAC,CAAA,MAAA,EAAS,MAAM,CAAA,CAAE,CAAC;AAE3E,IAAA,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC;AACtB,IAAA,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC;IAClB,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,YAAY;AAClC,IAAA,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC,CAAC,EAAE,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,OAAO,CAAC;AAE5D,IAAA,MAAM,OAAO,GAAG,IAAI,GAAG,QAAQ;AAC/B,IAAA,IAAI,CAAC,QAAQ;AACT,QAAA,OAAO,GAAG;AACN,cAAE;cACA,iBAAiB,CAAC,IAAI,CAAC,OAAO,GAAG,IAAI,EAAE,OAAO,CAAC;AAC7D;SAEgB,gBAAgB,CAC5B,OAAgB,EAChB,IAAgB,EAChB,IAAY,EAAA;IAEZ,cAAc,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC;IACxC,cAAc,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC;AACxC,IAAA,IAAI,CAAC,IAAI,GAAG,IAAI;AACpB;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/edge.mjs b/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/edge.mjs new file mode 100644 index 0000000..58cb4c1 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/edge.mjs @@ -0,0 +1,46 @@ +const namedEdges = { + start: 0, + center: 0.5, + end: 1, +}; +function resolveEdge(edge, length, inset = 0) { + let delta = 0; + /** + * If we have this edge defined as a preset, replace the definition + * with the numerical value. + */ + if (edge in namedEdges) { + edge = namedEdges[edge]; + } + /** + * Handle unit values + */ + if (typeof edge === "string") { + const asNumber = parseFloat(edge); + if (edge.endsWith("px")) { + delta = asNumber; + } + else if (edge.endsWith("%")) { + edge = asNumber / 100; + } + else if (edge.endsWith("vw")) { + delta = (asNumber / 100) * document.documentElement.clientWidth; + } + else if (edge.endsWith("vh")) { + delta = (asNumber / 100) * document.documentElement.clientHeight; + } + else { + edge = asNumber; + } + } + /** + * If the edge is defined as a number, handle as a progress value. + */ + if (typeof edge === "number") { + delta = length * edge; + } + return inset + delta; +} + +export { namedEdges, resolveEdge }; +//# sourceMappingURL=edge.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/edge.mjs.map b/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/edge.mjs.map new file mode 100644 index 0000000..0b568a7 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/edge.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"edge.mjs","sources":["../../../../../../src/render/dom/scroll/offsets/edge.ts"],"sourcesContent":["import { Edge, NamedEdges } from \"../types\"\n\nexport const namedEdges: Record = {\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"],"names":[],"mappings":"AAEO,MAAM,UAAU,GAA+B;AAClD,IAAA,KAAK,EAAE,CAAC;AACR,IAAA,MAAM,EAAE,GAAG;AACX,IAAA,GAAG,EAAE,CAAC;;AAGJ,SAAU,WAAW,CAAC,IAAU,EAAE,MAAc,EAAE,KAAK,GAAG,CAAC,EAAA;IAC7D,IAAI,KAAK,GAAG,CAAC;AAEb;;;AAGG;AACH,IAAA,IAAI,IAAI,IAAI,UAAU,EAAE;AACpB,QAAA,IAAI,GAAG,UAAU,CAAC,IAAkB,CAAC;IACzC;AAEA;;AAEG;AACH,IAAA,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;AAC1B,QAAA,MAAM,QAAQ,GAAG,UAAU,CAAC,IAAI,CAAC;AAEjC,QAAA,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;YACrB,KAAK,GAAG,QAAQ;QACpB;AAAO,aAAA,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;AAC3B,YAAA,IAAI,GAAG,QAAQ,GAAG,GAAG;QACzB;AAAO,aAAA,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;AAC5B,YAAA,KAAK,GAAG,CAAC,QAAQ,GAAG,GAAG,IAAI,QAAQ,CAAC,eAAe,CAAC,WAAW;QACnE;AAAO,aAAA,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;AAC5B,YAAA,KAAK,GAAG,CAAC,QAAQ,GAAG,GAAG,IAAI,QAAQ,CAAC,eAAe,CAAC,YAAY;QACpE;aAAO;YACH,IAAI,GAAG,QAAQ;QACnB;IACJ;AAEA;;AAEG;AACH,IAAA,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;AAC1B,QAAA,KAAK,GAAG,MAAM,GAAG,IAAI;IACzB;IAEA,OAAO,KAAK,GAAG,KAAK;AACxB;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/index.mjs b/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/index.mjs new file mode 100644 index 0000000..32cdd15 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/index.mjs @@ -0,0 +1,60 @@ +import { interpolate, defaultOffset } from 'motion-dom'; +import { clamp } from 'motion-utils'; +import { calcInset } from './inset.mjs'; +import { resolveOffset } from './offset.mjs'; +import { ScrollOffset } from './presets.mjs'; + +const point = { x: 0, y: 0 }; +function getTargetSize(target) { + return "getBBox" in target && target.tagName !== "svg" + ? target.getBBox() + : { width: target.clientWidth, height: target.clientHeight }; +} +function resolveOffsets(container, info, options) { + const { offset: offsetDefinition = ScrollOffset.All } = options; + const { target = container, axis = "y" } = options; + const lengthLabel = axis === "y" ? "height" : "width"; + const inset = target !== container ? calcInset(target, container) : point; + /** + * Measure the target and container. If they're the same thing then we + * use the container's scrollWidth/Height as the target, from there + * all other calculations can remain the same. + */ + const targetSize = target === container + ? { width: container.scrollWidth, height: container.scrollHeight } + : getTargetSize(target); + const containerSize = { + width: container.clientWidth, + height: container.clientHeight, + }; + /** + * Reset the length of the resolved offset array rather than creating a new one. + * TODO: More reusable data structures for targetSize/containerSize would also be good. + */ + info[axis].offset.length = 0; + /** + * Populate the offset array by resolving the user's offset definition into + * a list of pixel scroll offets. + */ + let hasChanged = !info[axis].interpolate; + const numOffsets = offsetDefinition.length; + for (let i = 0; i < numOffsets; i++) { + const offset = resolveOffset(offsetDefinition[i], containerSize[lengthLabel], targetSize[lengthLabel], inset[axis]); + if (!hasChanged && offset !== info[axis].interpolatorOffsets[i]) { + hasChanged = true; + } + info[axis].offset[i] = offset; + } + /** + * If the pixel scroll offsets have changed, create a new interpolator function + * to map scroll value into a progress. + */ + if (hasChanged) { + info[axis].interpolate = interpolate(info[axis].offset, defaultOffset(offsetDefinition), { clamp: false }); + info[axis].interpolatorOffsets = [...info[axis].offset]; + } + info[axis].progress = clamp(0, 1, info[axis].interpolate(info[axis].current)); +} + +export { resolveOffsets }; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/index.mjs.map b/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/index.mjs.map new file mode 100644 index 0000000..cd82ae4 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../../../../../../src/render/dom/scroll/offsets/index.ts"],"sourcesContent":["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"],"names":[],"mappings":";;;;;;AAOA,MAAM,KAAK,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;AAE5B,SAAS,aAAa,CAAC,MAAe,EAAA;IAClC,OAAO,SAAS,IAAI,MAAM,IAAI,MAAM,CAAC,OAAO,KAAK;AAC7C,UAAG,MAA6B,CAAC,OAAO;AACxC,UAAE,EAAE,KAAK,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,CAAC,YAAY,EAAE;AACpE;SAEgB,cAAc,CAC1B,SAAkB,EAClB,IAAgB,EAChB,OAA0B,EAAA;IAE1B,MAAM,EAAE,MAAM,EAAE,gBAAgB,GAAG,YAAY,CAAC,GAAG,EAAE,GAAG,OAAO;IAC/D,MAAM,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,GAAG,GAAG,EAAE,GAAG,OAAO;AAClD,IAAA,MAAM,WAAW,GAAG,IAAI,KAAK,GAAG,GAAG,QAAQ,GAAG,OAAO;AAErD,IAAA,MAAM,KAAK,GAAG,MAAM,KAAK,SAAS,GAAG,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,KAAK;AAEzE;;;;AAIG;AACH,IAAA,MAAM,UAAU,GACZ,MAAM,KAAK;AACP,UAAE,EAA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CAAC,IAAI,CAAC,CAAC,QAAQ,GAAG,KAAK,CACvB,CAAC,EACD,CAAC,EACD,IAAI,CAAC,IAAI,CAAC,CAAC,WAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAC9C;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/inset.mjs b/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/inset.mjs new file mode 100644 index 0000000..82d4652 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/inset.mjs @@ -0,0 +1,48 @@ +import { isHTMLElement } from 'motion-dom'; + +function calcInset(element, container) { + const inset = { x: 0, y: 0 }; + let current = element; + while (current && current !== container) { + if (isHTMLElement(current)) { + inset.x += current.offsetLeft; + inset.y += current.offsetTop; + current = current.offsetParent; + } + else if (current.tagName === "svg") { + /** + * This isn't an ideal approach to measuring the offset of tags. + * It would be preferable, given they behave like HTMLElements in most ways + * to use offsetLeft/Top. But these don't exist on . Likewise we + * can't use .getBBox() like most SVG elements as these provide the offset + * relative to the SVG itself, which for is usually 0x0. + */ + const svgBoundingBox = current.getBoundingClientRect(); + current = current.parentElement; + const parentBoundingBox = current.getBoundingClientRect(); + inset.x += svgBoundingBox.left - parentBoundingBox.left; + inset.y += svgBoundingBox.top - parentBoundingBox.top; + } + else if (current instanceof SVGGraphicsElement) { + const { x, y } = current.getBBox(); + inset.x += x; + inset.y += y; + let svg = null; + let parent = current.parentNode; + while (!svg) { + if (parent.tagName === "svg") { + svg = parent; + } + parent = current.parentNode; + } + current = svg; + } + else { + break; + } + } + return inset; +} + +export { calcInset }; +//# sourceMappingURL=inset.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/inset.mjs.map b/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/inset.mjs.map new file mode 100644 index 0000000..6c03b56 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/inset.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"inset.mjs","sources":["../../../../../../src/render/dom/scroll/offsets/inset.ts"],"sourcesContent":["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 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 . Likewise we\n * can't use .getBBox() like most SVG elements as these provide the offset\n * relative to the SVG itself, which for 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"],"names":[],"mappings":";;AAEM,SAAU,SAAS,CAAC,OAAgB,EAAE,SAAkB,EAAA;IAC1D,MAAM,KAAK,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;IAE5B,IAAI,OAAO,GAAmB,OAAO;AACrC,IAAA,OAAO,OAAO,IAAI,OAAO,KAAK,SAAS,EAAE;AACrC,QAAA,IAAI,aAAa,CAAC,OAAO,CAAC,EAAE;AACxB,YAAA,KAAK,CAAC,CAAC,IAAI,OAAO,CAAC,UAAU;AAC7B,YAAA,KAAK,CAAC,CAAC,IAAI,OAAO,CAAC,SAAS;AAC5B,YAAA,OAAO,GAAG,OAAO,CAAC,YAAY;QAClC;AAAO,aAAA,IAAI,OAAO,CAAC,OAAO,KAAK,KAAK,EAAE;AAClC;;;;;;AAMG;AACH,YAAA,MAAM,cAAc,GAAG,OAAO,CAAC,qBAAqB,EAAE;AACtD,YAAA,OAAO,GAAG,OAAO,CAAC,aAAc;AAChC,YAAA,MAAM,iBAAiB,GAAG,OAAO,CAAC,qBAAqB,EAAE;YACzD,KAAK,CAAC,CAAC,IAAI,cAAc,CAAC,IAAI,GAAG,iBAAiB,CAAC,IAAI;YACvD,KAAK,CAAC,CAAC,IAAI,cAAc,CAAC,GAAG,GAAG,iBAAiB,CAAC,GAAG;QACzD;AAAO,aAAA,IAAI,OAAO,YAAY,kBAAkB,EAAE;YAC9C,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE;AAClC,YAAA,KAAK,CAAC,CAAC,IAAI,CAAC;AACZ,YAAA,KAAK,CAAC,CAAC,IAAI,CAAC;YAEZ,IAAI,GAAG,GAAsB,IAAI;AACjC,YAAA,IAAI,MAAM,GAAe,OAAO,CAAC,UAAwB;YACzD,OAAO,CAAC,GAAG,EAAE;AACT,gBAAA,IAAI,MAAM,CAAC,OAAO,KAAK,KAAK,EAAE;oBAC1B,GAAG,GAAG,MAAM;gBAChB;AACA,gBAAA,MAAM,GAAG,OAAO,CAAC,UAAwB;YAC7C;YACA,OAAO,GAAG,GAAG;QACjB;aAAO;YACH;QACJ;IACJ;AAEA,IAAA,OAAO,KAAK;AAChB;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/offset.mjs b/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/offset.mjs new file mode 100644 index 0000000..fd25b46 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/offset.mjs @@ -0,0 +1,36 @@ +import { resolveEdge, namedEdges } from './edge.mjs'; + +const defaultOffset = [0, 0]; +function resolveOffset(offset, containerLength, targetLength, targetInset) { + let offsetDefinition = Array.isArray(offset) ? offset : defaultOffset; + let targetPoint = 0; + let containerPoint = 0; + if (typeof offset === "number") { + /** + * If we're provided offset: [0, 0.5, 1] then each number x should become + * [x, x], so we default to the behaviour of mapping 0 => 0 of both target + * and container etc. + */ + offsetDefinition = [offset, offset]; + } + else if (typeof offset === "string") { + offset = offset.trim(); + if (offset.includes(" ")) { + offsetDefinition = offset.split(" "); + } + else { + /** + * If we're provided a definition like "100px" then we want to apply + * that only to the top of the target point, leaving the container at 0. + * Whereas a named offset like "end" should be applied to both. + */ + offsetDefinition = [offset, namedEdges[offset] ? offset : `0`]; + } + } + targetPoint = resolveEdge(offsetDefinition[0], targetLength, targetInset); + containerPoint = resolveEdge(offsetDefinition[1], containerLength); + return targetPoint - containerPoint; +} + +export { resolveOffset }; +//# sourceMappingURL=offset.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/offset.mjs.map b/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/offset.mjs.map new file mode 100644 index 0000000..0180029 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/offset.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"offset.mjs","sources":["../../../../../../src/render/dom/scroll/offsets/offset.ts"],"sourcesContent":["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"],"names":[],"mappings":";;AAGA,MAAM,aAAa,GAAyB,CAAC,CAAC,EAAE,CAAC,CAAC;AAE5C,SAAU,aAAa,CACzB,MAAkD,EAClD,eAAuB,EACvB,YAAoB,EACpB,WAAmB,EAAA;AAEnB,IAAA,IAAI,gBAAgB,GAChB,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,GAAG,aAAa;IAElD,IAAI,WAAW,GAAG,CAAC;IACnB,IAAI,cAAc,GAAG,CAAC;AAEtB,IAAA,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;AAC5B;;;;AAIG;AACH,QAAA,gBAAgB,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC;IACvC;AAAO,SAAA,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;AACnC,QAAA,MAAM,GAAG,MAAM,CAAC,IAAI,EAAgB;AAEpC,QAAA,IAAI,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;AACtB,YAAA,gBAAgB,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAA6B;QACpE;aAAO;AACH;;;;AAIG;AACH,YAAA,gBAAgB,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,MAAiC,CAAC,GAAG,MAAM,GAAG,CAAA,CAAA,CAAG,CAAC;QAC7F;IACJ;AAEA,IAAA,WAAW,GAAG,WAAW,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,WAAW,CAAC;IACzE,cAAc,GAAG,WAAW,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,eAAe,CAAC;IAElE,OAAO,WAAW,GAAG,cAAc;AACvC;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/presets.mjs b/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/presets.mjs new file mode 100644 index 0000000..46e42cf --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/presets.mjs @@ -0,0 +1,21 @@ +const ScrollOffset = { + Enter: [ + [0, 1], + [1, 1], + ], + Exit: [ + [0, 0], + [1, 0], + ], + Any: [ + [1, 0], + [0, 1], + ], + All: [ + [0, 0], + [1, 1], + ], +}; + +export { ScrollOffset }; +//# sourceMappingURL=presets.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/presets.mjs.map b/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/presets.mjs.map new file mode 100644 index 0000000..7d45123 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/presets.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"presets.mjs","sources":["../../../../../../src/render/dom/scroll/offsets/presets.ts"],"sourcesContent":["import { ProgressIntersection } from \"../types\"\n\nexport const ScrollOffset: Record = {\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"],"names":[],"mappings":"AAEO,MAAM,YAAY,GAA2C;AAClE,IAAA,KAAK,EAAE;QACL,CAAC,CAAC,EAAE,CAAC,CAAC;QACN,CAAC,CAAC,EAAE,CAAC,CAAC;AACP,KAAA;AACD,IAAA,IAAI,EAAE;QACJ,CAAC,CAAC,EAAE,CAAC,CAAC;QACN,CAAC,CAAC,EAAE,CAAC,CAAC;AACP,KAAA;AACD,IAAA,GAAG,EAAE;QACH,CAAC,CAAC,EAAE,CAAC,CAAC;QACN,CAAC,CAAC,EAAE,CAAC,CAAC;AACP,KAAA;AACD,IAAA,GAAG,EAAE;QACH,CAAC,CAAC,EAAE,CAAC,CAAC;QACN,CAAC,CAAC,EAAE,CAAC,CAAC;AACP,KAAA;;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/on-scroll-handler.mjs b/node_modules/framer-motion/dist/es/render/dom/scroll/on-scroll-handler.mjs new file mode 100644 index 0000000..6523a96 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/scroll/on-scroll-handler.mjs @@ -0,0 +1,55 @@ +import { warnOnce } from 'motion-utils'; +import { updateScrollInfo } from './info.mjs'; +import { resolveOffsets } from './offsets/index.mjs'; + +function measure(container, target = container, info) { + /** + * Find inset of target within scrollable container + */ + info.x.targetOffset = 0; + info.y.targetOffset = 0; + if (target !== container) { + let node = target; + while (node && node !== container) { + info.x.targetOffset += node.offsetLeft; + info.y.targetOffset += node.offsetTop; + node = node.offsetParent; + } + } + info.x.targetLength = + target === container ? target.scrollWidth : target.clientWidth; + info.y.targetLength = + target === container ? target.scrollHeight : target.clientHeight; + info.x.containerLength = container.clientWidth; + info.y.containerLength = container.clientHeight; + /** + * In development mode ensure scroll containers aren't position: static as this makes + * it difficult to measure their relative positions. The document scrolling element + * is exempt: offsetParent measurements naturally resolve relative to the document. + */ + if (process.env.NODE_ENV !== "production") { + if (container && + target && + target !== container && + container !== document.documentElement && + container !== document.scrollingElement && + container !== document.body) { + warnOnce(getComputedStyle(container).position !== "static", "Please ensure that the container has a non-static position, like 'relative', 'fixed', or 'absolute' to ensure scroll offset is calculated correctly."); + } + } +} +function createOnScrollHandler(element, onScroll, info, options = {}) { + return { + measure: (time) => { + measure(element, options.target, info); + updateScrollInfo(element, info, time); + if (options.offset || options.target) { + resolveOffsets(element, info, options); + } + }, + notify: () => onScroll(info), + }; +} + +export { createOnScrollHandler }; +//# sourceMappingURL=on-scroll-handler.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/on-scroll-handler.mjs.map b/node_modules/framer-motion/dist/es/render/dom/scroll/on-scroll-handler.mjs.map new file mode 100644 index 0000000..9ef880a --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/scroll/on-scroll-handler.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"on-scroll-handler.mjs","sources":["../../../../../src/render/dom/scroll/on-scroll-handler.ts"],"sourcesContent":["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"],"names":[],"mappings":";;;;AAUA,SAAS,OAAO,CACZ,SAAkB,EAClB,MAAA,GAAkB,SAAS,EAC3B,IAAgB,EAAA;AAEhB;;AAEG;AACH,IAAA,IAAI,CAAC,CAAC,CAAC,YAAY,GAAG,CAAC;AACvB,IAAA,IAAI,CAAC,CAAC,CAAC,YAAY,GAAG,CAAC;AACvB,IAAA,IAAI,MAAM,KAAK,SAAS,EAAE;QACtB,IAAI,IAAI,GAAG,MAAqB;AAChC,QAAA,OAAO,IAAI,IAAI,IAAI,KAAK,SAAS,EAAE;YAC/B,IAAI,CAAC,CAAC,CAAC,YAAY,IAAI,IAAI,CAAC,UAAU;YACtC,IAAI,CAAC,CAAC,CAAC,YAAY,IAAI,IAAI,CAAC,SAAS;AACrC,YAAA,IAAI,GAAG,IAAI,CAAC,YAA2B;QAC3C;IACJ;IAEA,IAAI,CAAC,CAAC,CAAC,YAAY;AACf,QAAA,MAAM,KAAK,SAAS,GAAG,MAAM,CAAC,WAAW,GAAG,MAAM,CAAC,WAAW;IAClE,IAAI,CAAC,CAAC,CAAC,YAAY;AACf,QAAA,MAAM,KAAK,SAAS,GAAG,MAAM,CAAC,YAAY,GAAG,MAAM,CAAC,YAAY;IACpE,IAAI,CAAC,CAAC,CAAC,eAAe,GAAG,SAAS,CAAC,WAAW;IAC9C,IAAI,CAAC,CAAC,CAAC,eAAe,GAAG,SAAS,CAAC,YAAY;AAE/C;;;;AAIG;IACH,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE;AACvC,QAAA,IACI,SAAS;YACT,MAAM;AACN,YAAA,MAAM,KAAK,SAAS;YACpB,SAAS,KAAK,QAAQ,CAAC,eAAe;YACtC,SAAS,KAAK,QAAQ,CAAC,gBAAgB;AACvC,YAAA,SAAS,KAAK,QAAQ,CAAC,IAAI,EAC7B;AACE,YAAA,QAAQ,CACJ,gBAAgB,CAAC,SAAS,CAAC,CAAC,QAAQ,KAAK,QAAQ,EACjD,sJAAsJ,CACzJ;QACL;IACJ;AACJ;AAEM,SAAU,qBAAqB,CACjC,OAAgB,EAChB,QAAsB,EACtB,IAAgB,EAChB,OAAA,GAA6B,EAAE,EAAA;IAE/B,OAAO;AACH,QAAA,OAAO,EAAE,CAAC,IAAI,KAAI;YACd,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC;AACtC,YAAA,gBAAgB,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC;YAErC,IAAI,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,MAAM,EAAE;AAClC,gBAAA,cAAc,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC;YAC1C;QACJ,CAAC;AACD,QAAA,MAAM,EAAE,MAAM,QAAQ,CAAC,IAAI,CAAC;KAC/B;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/track.mjs b/node_modules/framer-motion/dist/es/render/dom/scroll/track.mjs new file mode 100644 index 0000000..501837d --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/scroll/track.mjs @@ -0,0 +1,115 @@ +import { resize, frame, cancelFrame, frameData } from 'motion-dom'; +import { noop } from 'motion-utils'; +import { createScrollInfo } from './info.mjs'; +import { createOnScrollHandler } from './on-scroll-handler.mjs'; + +const scrollListeners = new WeakMap(); +const resizeListeners = new WeakMap(); +const onScrollHandlers = new WeakMap(); +const scrollSize = new WeakMap(); +const dimensionCheckProcesses = new WeakMap(); +const getEventTarget = (element) => element === document.scrollingElement ? window : element; +function scrollInfo(onScroll, { container = document.scrollingElement, trackContentSize = false, ...options } = {}) { + if (!container) + return noop; + let containerHandlers = onScrollHandlers.get(container); + /** + * Get the onScroll handlers for this container. + * If one isn't found, create a new one. + */ + if (!containerHandlers) { + containerHandlers = new Set(); + onScrollHandlers.set(container, containerHandlers); + } + /** + * Create a new onScroll handler for the provided callback. + */ + const info = createScrollInfo(); + const containerHandler = createOnScrollHandler(container, onScroll, info, options); + containerHandlers.add(containerHandler); + /** + * Check if there's a scroll event listener for this container. + * If not, create one. + */ + if (!scrollListeners.has(container)) { + const measureAll = () => { + for (const handler of containerHandlers) { + handler.measure(frameData.timestamp); + } + frame.preUpdate(notifyAll); + }; + const notifyAll = () => { + for (const handler of containerHandlers) { + handler.notify(); + } + }; + const listener = () => frame.read(measureAll); + scrollListeners.set(container, listener); + const target = getEventTarget(container); + window.addEventListener("resize", listener); + if (container !== document.documentElement) { + resizeListeners.set(container, resize(container, listener)); + } + target.addEventListener("scroll", listener); + listener(); + } + /** + * Enable content size tracking if requested and not already enabled. + */ + if (trackContentSize && !dimensionCheckProcesses.has(container)) { + const listener = scrollListeners.get(container); + // Store initial scroll dimensions (object is reused to avoid allocation) + const size = { + width: container.scrollWidth, + height: container.scrollHeight, + }; + scrollSize.set(container, size); + // Add frame-based scroll dimension checking to detect content changes + const checkScrollDimensions = () => { + const newWidth = container.scrollWidth; + const newHeight = container.scrollHeight; + if (size.width !== newWidth || size.height !== newHeight) { + listener(); + size.width = newWidth; + size.height = newHeight; + } + }; + // Schedule with keepAlive=true to run every frame + const dimensionCheckProcess = frame.read(checkScrollDimensions, true); + dimensionCheckProcesses.set(container, dimensionCheckProcess); + } + const listener = scrollListeners.get(container); + frame.read(listener, false, true); + return () => { + cancelFrame(listener); + /** + * Check if we even have any handlers for this container. + */ + const currentHandlers = onScrollHandlers.get(container); + if (!currentHandlers) + return; + currentHandlers.delete(containerHandler); + if (currentHandlers.size) + return; + /** + * If no more handlers, remove the scroll listener too. + */ + const scrollListener = scrollListeners.get(container); + scrollListeners.delete(container); + if (scrollListener) { + getEventTarget(container).removeEventListener("scroll", scrollListener); + resizeListeners.get(container)?.(); + window.removeEventListener("resize", scrollListener); + } + // Clean up scroll dimension checking + const dimensionCheckProcess = dimensionCheckProcesses.get(container); + if (dimensionCheckProcess) { + cancelFrame(dimensionCheckProcess); + dimensionCheckProcesses.delete(container); + } + scrollSize.delete(container); + }; +} + +export { scrollInfo }; +//# sourceMappingURL=track.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/track.mjs.map b/node_modules/framer-motion/dist/es/render/dom/scroll/track.mjs.map new file mode 100644 index 0000000..be35d66 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/scroll/track.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"track.mjs","sources":["../../../../../src/render/dom/scroll/track.ts"],"sourcesContent":["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()\nconst resizeListeners = new WeakMap()\nconst onScrollHandlers = new WeakMap>()\nconst scrollSize = new WeakMap()\nconst dimensionCheckProcesses = new WeakMap()\n\nexport type ScrollTargets = Array\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"],"names":[],"mappings":";;;;;AAMA,MAAM,eAAe,GAAG,I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/dist/es/render/dom/scroll/utils/can-use-native-timeline.mjs b/node_modules/framer-motion/dist/es/render/dom/scroll/utils/can-use-native-timeline.mjs new file mode 100644 index 0000000..ed95092 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/scroll/utils/can-use-native-timeline.mjs @@ -0,0 +1,10 @@ +import { supportsViewTimeline, supportsScrollTimeline } from 'motion-dom'; + +function canUseNativeTimeline(target) { + if (typeof window === "undefined") + return false; + return target ? supportsViewTimeline() : supportsScrollTimeline(); +} + +export { canUseNativeTimeline }; +//# sourceMappingURL=can-use-native-timeline.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/utils/can-use-native-timeline.mjs.map b/node_modules/framer-motion/dist/es/render/dom/scroll/utils/can-use-native-timeline.mjs.map new file mode 100644 index 0000000..88a8655 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/scroll/utils/can-use-native-timeline.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"can-use-native-timeline.mjs","sources":["../../../../../../src/render/dom/scroll/utils/can-use-native-timeline.ts"],"sourcesContent":["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"],"names":[],"mappings":";;AAEM,SAAU,oBAAoB,CAAC,MAAgB,EAAA;IACjD,IAAI,OAAO,MAAM,KAAK,WAAW;AAAE,QAAA,OAAO,KAAK;IAC/C,OAAO,MAAM,GAAG,oBAAoB,EAAE,GAAG,sBAAsB,EAAE;AACrE;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/utils/get-timeline.mjs b/node_modules/framer-motion/dist/es/render/dom/scroll/utils/get-timeline.mjs new file mode 100644 index 0000000..e7d2848 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/scroll/utils/get-timeline.mjs @@ -0,0 +1,62 @@ +import { scrollInfo } from '../track.mjs'; +import { canUseNativeTimeline } from './can-use-native-timeline.mjs'; +import { offsetToViewTimelineRange } from './offset-to-range.mjs'; + +const timelineCache = new Map(); +function scrollTimelineFallback(options) { + const currentTime = { value: 0 }; + const cancel = scrollInfo((info) => { + currentTime.value = info[options.axis].progress * 100; + }, options); + return { currentTime, cancel }; +} +function getTimeline({ source, container, ...options }) { + const { axis } = options; + if (source) + container = source; + let containerCache = timelineCache.get(container); + if (!containerCache) { + containerCache = new Map(); + timelineCache.set(container, containerCache); + } + const targetKey = options.target ?? "self"; + let targetCache = containerCache.get(targetKey); + if (!targetCache) { + targetCache = {}; + containerCache.set(targetKey, targetCache); + } + const axisKey = axis + (options.offset ?? []).join(","); + if (!targetCache[axisKey]) { + if (options.target && canUseNativeTimeline(options.target)) { + const range = offsetToViewTimelineRange(options.offset); + if (range) { + targetCache[axisKey] = new ViewTimeline({ + subject: options.target, + axis, + }); + } + else { + targetCache[axisKey] = scrollTimelineFallback({ + container, + ...options, + }); + } + } + else if (canUseNativeTimeline()) { + targetCache[axisKey] = new ScrollTimeline({ + source: container, + axis, + }); + } + else { + targetCache[axisKey] = scrollTimelineFallback({ + container, + ...options, + }); + } + } + return targetCache[axisKey]; +} + +export { getTimeline }; +//# sourceMappingURL=get-timeline.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/utils/get-timeline.mjs.map b/node_modules/framer-motion/dist/es/render/dom/scroll/utils/get-timeline.mjs.map new file mode 100644 index 0000000..9055908 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/scroll/utils/get-timeline.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"get-timeline.mjs","sources":["../../../../../../src/render/dom/scroll/utils/get-timeline.ts"],"sourcesContent":["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>\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"],"names":[],"mappings":";;;;AAsBA,MAAM,aAAa,GAAG,IAAI,GAAG,EAG1B;AAEH,SAAS,sBAAsB,CAAC,OAAkC,EAAA;AAC9D,IAAA,MAAM,WAAW,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE;AAEhC,IAAA,MAAM,MAAM,GAAG,UAAU,CAAC,CAAC,IAAI,KAAI;AAC/B,QAAA,W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BAAA,CAAC;YACN;iBAAO;AACH,gBAAA,WAAW,CAAC,OAAO,CAAC,GAAG,sBAAsB,CAAC;oBAC1C,SAAS;AACT,oBAAA,GAAG,OAAO;AACb,iBAAA,CAAC;YACN;QACJ;aAAO,IAAI,oBAAoB,EAAE,EAAE;AAC/B,YAAA,WAAW,CAAC,OAAO,CAAC,GAAG,IAAI,cAAc,CAAC;AACtC,gBAAA,MAAM,EAAE,SAAS;gBACjB,IAAI;AACA,aAAA,CAAC;QACb;aAAO;AACH,YAAA,WAAW,CAAC,OAAO,CAAC,GAAG,sBAAsB,CAAC;gBAC1C,SAAS;AACT,gBAAA,GAAG,OAAO;AACb,aAAA,CAAC;QACN;IACJ;AAEA,IAAA,OAAO,WAAW,CAAC,OAAO,CAAE;AAChC;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/utils/is-element-tracking.mjs b/node_modules/framer-motion/dist/es/render/dom/scroll/utils/is-element-tracking.mjs new file mode 100644 index 0000000..f801dc7 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/scroll/utils/is-element-tracking.mjs @@ -0,0 +1,10 @@ +/** + * Currently, we only support element tracking with `scrollInfo`, though in + * the future we can also offer ViewTimeline support. + */ +function isElementTracking(options) { + return options && (options.target || options.offset); +} + +export { isElementTracking }; +//# sourceMappingURL=is-element-tracking.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/utils/is-element-tracking.mjs.map b/node_modules/framer-motion/dist/es/render/dom/scroll/utils/is-element-tracking.mjs.map new file mode 100644 index 0000000..06205ef --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/scroll/utils/is-element-tracking.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"is-element-tracking.mjs","sources":["../../../../../../src/render/dom/scroll/utils/is-element-tracking.ts"],"sourcesContent":["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"],"names":[],"mappings":"AAEA;;;AAGG;AACG,SAAU,iBAAiB,CAAC,OAAmC,EAAA;IACjE,OAAO,OAAO,KAAK,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC;AACxD;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/utils/offset-to-range.mjs b/node_modules/framer-motion/dist/es/render/dom/scroll/utils/offset-to-range.mjs new file mode 100644 index 0000000..d2a1cce --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/scroll/utils/offset-to-range.mjs @@ -0,0 +1,73 @@ +import { ScrollOffset } from '../offsets/presets.mjs'; + +/** + * Maps from ProgressIntersection pairs used by Motion's preset offsets to + * ViewTimeline named ranges. Returns undefined for unrecognised patterns, + * which signals the caller to fall back to JS-based scroll tracking. + */ +const presets = [ + [ScrollOffset.Enter, "entry"], + [ScrollOffset.Exit, "exit"], + [ScrollOffset.Any, "cover"], + [ScrollOffset.All, "contain"], +]; +const stringToProgress = { + start: 0, + end: 1, +}; +function parseStringOffset(s) { + const parts = s.trim().split(/\s+/); + if (parts.length !== 2) + return undefined; + const a = stringToProgress[parts[0]]; + const b = stringToProgress[parts[1]]; + if (a === undefined || b === undefined) + return undefined; + return [a, b]; +} +function normaliseOffset(offset) { + if (offset.length !== 2) + return undefined; + const result = []; + for (const item of offset) { + if (Array.isArray(item)) { + result.push(item); + } + else if (typeof item === "string") { + const parsed = parseStringOffset(item); + if (!parsed) + return undefined; + result.push(parsed); + } + else { + return undefined; + } + } + return result; +} +function matchesPreset(offset, preset) { + const normalised = normaliseOffset(offset); + if (!normalised) + return false; + for (let i = 0; i < 2; i++) { + const o = normalised[i]; + const p = preset[i]; + if (o[0] !== p[0] || o[1] !== p[1]) + return false; + } + return true; +} +function offsetToViewTimelineRange(offset) { + if (!offset) { + return { rangeStart: "contain 0%", rangeEnd: "contain 100%" }; + } + for (const [preset, name] of presets) { + if (matchesPreset(offset, preset)) { + return { rangeStart: `${name} 0%`, rangeEnd: `${name} 100%` }; + } + } + return undefined; +} + +export { offsetToViewTimelineRange }; +//# sourceMappingURL=offset-to-range.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/utils/offset-to-range.mjs.map b/node_modules/framer-motion/dist/es/render/dom/scroll/utils/offset-to-range.mjs.map new file mode 100644 index 0000000..985a623 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/scroll/utils/offset-to-range.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"offset-to-range.mjs","sources":["../../../../../../src/render/dom/scroll/utils/offset-to-range.ts"],"sourcesContent":["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 = {\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"],"names":["ScrollOffsetPresets"],"mappings":";;AAQA;;;;AAIG;AACH,MAAM,OAAO,GAAuC;AAChD,IAAA,CAACA,YAAmB,CAAC,KAAK,EAAE,OAAO,CAAC;AACpC,IAAA,CAACA,YAAmB,CAAC,IAAI,EAAE,MAAM,CAAC;AAClC,IAAA,CAACA,YAAmB,CAAC,GAAG,EAAE,OAAO,CAAC;AAClC,IAAA,CAACA,YAAmB,CAAC,GAAG,EAAE,SAAS,CAAC;CACvC;AAED,MAAM,gBAAgB,GAA2B;AAC7C,IAAA,KAAK,EAAE,CAAC;AACR,IAAA,GAAG,EAAE,CAAC;CACT;AAED,SAAS,iBAAiB,CACtB,CAAS,EAAA;IAET,MAAM,KAAK,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC;AACnC,IAAA,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;AAAE,QAAA,OAAO,SAAS;IACxC,MAAM,CAAC,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACpC,MAAM,CAAC,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACpC,IAAA,IAAI,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,SAAS;AA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BAAyB,CACrC,MAAqB,EAAA;IAErB,IAAI,CAAC,MAAM,EAAE;QACT,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAE,cAAc,EAAE;IACjE;IAEA,KAAK,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,OAAO,EAAE;AAClC,QAAA,IAAI,aAAa,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE;AAC/B,YAAA,OAAO,EAAE,UAAU,EAAE,CAAA,EAAG,IAAI,CAAA,GAAA,CAAK,EAAE,QAAQ,EAAE,CAAA,EAAG,IAAI,CAAA,KAAA,CAAO,EAAE;QACjE;IACJ;AAEA,IAAA,OAAO,SAAS;AACpB;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/dom/use-render.mjs b/node_modules/framer-motion/dist/es/render/dom/use-render.mjs new file mode 100644 index 0000000..6dff8a9 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/use-render.mjs @@ -0,0 +1,28 @@ +"use client"; +import { isMotionValue } from 'motion-dom'; +import { Fragment, useMemo, createElement } from 'react'; +import { useHTMLProps } from '../html/use-props.mjs'; +import { useSVGProps } from '../svg/use-props.mjs'; +import { filterProps } from './utils/filter-props.mjs'; +import { isSVGComponent } from './utils/is-svg-component.mjs'; + +function useRender(Component, props, ref, { latestValues, }, isStatic, forwardMotionProps = false, isSVG, isValidProp) { + const useVisualProps = (isSVG ?? isSVGComponent(Component)) ? useSVGProps : useHTMLProps; + const visualProps = useVisualProps(props, latestValues, isStatic, Component); + const filteredProps = filterProps(props, typeof Component === "string", forwardMotionProps, isValidProp); + const elementProps = Component !== Fragment ? { ...filteredProps, ...visualProps, ref } : {}; + /** + * If component has been handed a motion value as its child, + * memoise its initial value and render that. Subsequent updates + * will be handled by the onChange handler + */ + const { children } = props; + const renderedChildren = useMemo(() => (isMotionValue(children) ? children.get() : children), [children]); + return createElement(Component, { + ...elementProps, + children: renderedChildren, + }); +} + +export { useRender }; +//# sourceMappingURL=use-render.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/dom/use-render.mjs.map b/node_modules/framer-motion/dist/es/render/dom/use-render.mjs.map new file mode 100644 index 0000000..3f2f8fa --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/use-render.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-render.mjs","sources":["../../../../src/render/dom/use-render.ts"],"sourcesContent":["\"use client\"\n\nimport { isMotionValue } from \"motion-dom\"\nimport { Fragment, createElement, useMemo } from \"react\"\nimport type { IsValidProp } from \"../../context/MotionConfigContext\"\nimport { MotionProps } from \"../../motion/types\"\nimport { VisualState } from \"../../motion/utils/use-visual-state\"\nimport { HTMLRenderState } from \"../html/types\"\nimport { useHTMLProps } from \"../html/use-props\"\nimport { SVGRenderState } from \"../svg/types\"\nimport { useSVGProps } from \"../svg/use-props\"\nimport { DOMMotionComponents } from \"./types\"\nimport { filterProps } from \"./utils/filter-props\"\nimport { isSVGComponent } from \"./utils/is-svg-component\"\n\nexport function useRender<\n Props = {},\n TagName extends keyof DOMMotionComponents | string = \"div\"\n>(\n Component: TagName | string | React.ComponentType,\n props: MotionProps,\n ref: React.Ref,\n {\n latestValues,\n }: VisualState,\n isStatic: boolean,\n forwardMotionProps: boolean = false,\n isSVG?: boolean,\n isValidProp?: IsValidProp\n) {\n const useVisualProps =\n (isSVG ?? isSVGComponent(Component)) ? useSVGProps : useHTMLProps\n\n const visualProps = useVisualProps(\n props as any,\n latestValues,\n isStatic,\n Component as any\n )\n const filteredProps = filterProps(\n props,\n typeof Component === \"string\",\n forwardMotionProps,\n isValidProp\n )\n const elementProps =\n Component !== Fragment ? { ...filteredProps, ...visualProps, ref } : {}\n\n /**\n * If component has been handed a motion value as its child,\n * memoise its initial value and render that. Subsequent updates\n * will be handled by the onChange handler\n */\n const { children } = props\n const renderedChildren = useMemo(\n () => (isMotionValue(children) ? children.get() : children),\n [children]\n )\n\n return createElement(Component, {\n ...elementProps,\n children: renderedChildren,\n })\n}\n"],"names":[],"mappings":";;;;;;;;AAeM;AAeF;AAGA;AAMA;;AASA;;;;AAIG;AACH;AACA;;AAMI;AACA;AACH;AACL;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/dom/utils/filter-props.mjs b/node_modules/framer-motion/dist/es/render/dom/utils/filter-props.mjs new file mode 100644 index 0000000..ac0cfc5 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/utils/filter-props.mjs @@ -0,0 +1,37 @@ +import { isMotionValue } from 'motion-dom'; +import { isValidMotionProp } from '../../../motion/utils/valid-prop.mjs'; + +function shouldForward(key, isValidProp) { + return key.startsWith("on") + ? !isValidMotionProp(key) + : isValidProp?.(key) ?? !isValidMotionProp(key); +} +function filterProps(props, isDom, forwardMotionProps, isValidProp) { + const filteredProps = {}; + for (const key in props) { + /** + * values is considered a valid prop by Emotion, so if it's present + * this will be rendered out to the DOM unless explicitly filtered. + * + * We check the type as it could be used with the `feColorMatrix` + * element, which we support. + */ + if (key === "values" && typeof props.values === "object") + continue; + if (isMotionValue(props[key])) + continue; + if (shouldForward(key, isValidProp) || + (forwardMotionProps === true && isValidMotionProp(key)) || + (!isDom && !isValidMotionProp(key)) || + // If trying to use native HTML drag events, forward drag listeners + (props["draggable"] && + key.startsWith("onDrag"))) { + filteredProps[key] = + props[key]; + } + } + return filteredProps; +} + +export { filterProps }; +//# sourceMappingURL=filter-props.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/dom/utils/filter-props.mjs.map b/node_modules/framer-motion/dist/es/render/dom/utils/filter-props.mjs.map new file mode 100644 index 0000000..8825562 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/utils/filter-props.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"filter-props.mjs","sources":["../../../../../src/render/dom/utils/filter-props.ts"],"sourcesContent":["import { isMotionValue } from \"motion-dom\"\nimport type { IsValidProp } from \"../../../context/MotionConfigContext\"\nimport type { MotionProps } from \"../../../motion/types\"\nimport { isValidMotionProp } from \"../../../motion/utils/valid-prop\"\n\nfunction shouldForward(key: string, isValidProp?: IsValidProp) {\n return key.startsWith(\"on\")\n ? !isValidMotionProp(key)\n : isValidProp?.(key) ?? !isValidMotionProp(key)\n}\n\nexport function filterProps(\n props: MotionProps,\n isDom: boolean,\n forwardMotionProps: boolean,\n isValidProp?: IsValidProp\n) {\n const filteredProps: MotionProps = {}\n\n for (const key in props) {\n /**\n * values is considered a valid prop by Emotion, so if it's present\n * this will be rendered out to the DOM unless explicitly filtered.\n *\n * We check the type as it could be used with the `feColorMatrix`\n * element, which we support.\n */\n if (key === \"values\" && typeof props.values === \"object\") continue\n\n if (isMotionValue(props[key as keyof typeof props])) continue\n\n if (\n shouldForward(key, isValidProp) ||\n (forwardMotionProps === true && isValidMotionProp(key)) ||\n (!isDom && !isValidMotionProp(key)) ||\n // If trying to use native HTML drag events, forward drag listeners\n (props[\"draggable\" as keyof MotionProps] &&\n key.startsWith(\"onDrag\"))\n ) {\n filteredProps[key as keyof MotionProps] =\n props[key as keyof MotionProps]\n }\n }\n\n return filteredProps\n}\n"],"names":[],"mappings":";;;AAKA,SAAS,aAAa,CAAC,GAAW,EAAE,WAAyB,EAAA;AACzD,IAAA,OAAO,GAAG,CAAC,UAAU,CAAC,IAAI;AACtB,UAAE,CAAC,iBAAiB,CAAC,GAAG;AACxB,UAAE,WAAW,GAAG,GAAG,CAAC,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC;AACvD;AAEM,SAAU,WAAW,CACvB,KAAkB,EAClB,KAAc,EACd,kBAA2B,EAC3B,WAAyB,EAAA;IAEzB,MAAM,aAAa,GAAgB,EAAE;AAErC,IAAA,KAAK,MAAM,GAAG,IAAI,KAAK,EAAE;AACrB;;;;;;AAMG;QACH,IAAI,GAAG,KAAK,QAAQ,IAAI,OAAO,KAAK,CAAC,MAAM,KAAK,QAAQ;YAAE;AAE1D,QAAA,IAAI,aAAa,CAAC,KAAK,CAAC,GAAyB,CAAC,CAAC;YAAE;AAErD,QAAA,IACI,aAAa,CAAC,GAAG,EAAE,WAAW,CAAC;aAC9B,kBAAkB,KAAK,IAAI,IAAI,iBAAiB,CAAC,GAAG,CAAC,CAAC;aACtD,CAAC,KAAK,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC;;aAElC,KAAK,CAAC,WAAgC,CAAC;AACpC,gBAAA,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,EAC/B;YACE,aAAa,CAAC,GAAwB,CAAC;gBACnC,KAAK,CAAC,GAAwB,CAAC;QACvC;IACJ;AAEA,IAAA,OAAO,aAAa;AACxB;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/dom/utils/is-svg-component.mjs b/node_modules/framer-motion/dist/es/render/dom/utils/is-svg-component.mjs new file mode 100644 index 0000000..e300fc1 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/utils/is-svg-component.mjs @@ -0,0 +1,31 @@ +import { lowercaseSVGElements } from '../../svg/lowercase-elements.mjs'; + +function isSVGComponent(Component) { + if ( + /** + * If it's not a string, it's a custom React component. Currently we only support + * HTML custom React components. + */ + typeof Component !== "string" || + /** + * If it contains a dash, the element is a custom HTML webcomponent. + */ + Component.includes("-")) { + return false; + } + else if ( + /** + * If it's in our list of lowercase SVG tags, it's an SVG component + */ + lowercaseSVGElements.indexOf(Component) > -1 || + /** + * If it contains a capital letter, it's an SVG component + */ + /[A-Z]/u.test(Component)) { + return true; + } + return false; +} + +export { isSVGComponent }; +//# sourceMappingURL=is-svg-component.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/dom/utils/is-svg-component.mjs.map b/node_modules/framer-motion/dist/es/render/dom/utils/is-svg-component.mjs.map new file mode 100644 index 0000000..88e680d --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/utils/is-svg-component.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"is-svg-component.mjs","sources":["../../../../../src/render/dom/utils/is-svg-component.ts"],"sourcesContent":["import * as React from \"react\"\nimport { lowercaseSVGElements } from \"../../svg/lowercase-elements\"\n\nexport function isSVGComponent(Component: string | React.ComponentType) {\n if (\n /**\n * If it's not a string, it's a custom React component. Currently we only support\n * HTML custom React components.\n */\n typeof Component !== \"string\" ||\n /**\n * If it contains a dash, the element is a custom HTML webcomponent.\n */\n Component.includes(\"-\")\n ) {\n return false\n } else if (\n /**\n * If it's in our list of lowercase SVG tags, it's an SVG component\n */\n lowercaseSVGElements.indexOf(Component) > -1 ||\n /**\n * If it contains a capital letter, it's an SVG component\n */\n /[A-Z]/u.test(Component)\n ) {\n return true\n }\n\n return false\n}\n"],"names":[],"mappings":";;AAGM,SAAU,cAAc,CAAC,SAA4C,EAAA;AACvE,IAAA;AACI;;;AAGG;IACH,OAAO,SAAS,KAAK,QAAQ;AAC7B;;AAEG;AACH,QAAA,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,EACzB;AACE,QAAA,OAAO,KAAK;IAChB;AAAO,SAAA;AACH;;AAEG;AACH,IAAA,oBAAoB,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,EAAE;AAC5C;;AAEG;AACH,QAAA,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,EAC1B;AACE,QAAA,OAAO,IAAI;IACf;AAEA,IAAA,OAAO,KAAK;AAChB;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/dom/viewport/index.mjs b/node_modules/framer-motion/dist/es/render/dom/viewport/index.mjs new file mode 100644 index 0000000..93c0f8d --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/viewport/index.mjs @@ -0,0 +1,44 @@ +import { resolveElements } from 'motion-dom'; + +const thresholds = { + some: 0, + all: 1, +}; +function inView(elementOrSelector, onStart, { root, margin: rootMargin, amount = "some" } = {}) { + const elements = resolveElements(elementOrSelector); + const activeIntersections = new WeakMap(); + const onIntersectionChange = (entries) => { + entries.forEach((entry) => { + const onEnd = activeIntersections.get(entry.target); + /** + * If there's no change to the intersection, we don't need to + * do anything here. + */ + if (entry.isIntersecting === Boolean(onEnd)) + return; + if (entry.isIntersecting) { + const newOnEnd = onStart(entry.target, entry); + if (typeof newOnEnd === "function") { + activeIntersections.set(entry.target, newOnEnd); + } + else { + observer.unobserve(entry.target); + } + } + else if (typeof onEnd === "function") { + onEnd(entry); + activeIntersections.delete(entry.target); + } + }); + }; + const observer = new IntersectionObserver(onIntersectionChange, { + root, + rootMargin, + threshold: typeof amount === "number" ? amount : thresholds[amount], + }); + elements.forEach((element) => observer.observe(element)); + return () => observer.disconnect(); +} + +export { inView }; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/dom/viewport/index.mjs.map b/node_modules/framer-motion/dist/es/render/dom/viewport/index.mjs.map new file mode 100644 index 0000000..7424f4a --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/viewport/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../../../../../src/render/dom/viewport/index.ts"],"sourcesContent":["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()\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"],"names":[],"mappings":";;AAiBA,MAAM,UAAU,GAAG;AACf,IAAA,IAAI,EAAE,CAAC;AACP,IAAA,GAAG,EAAE,CAAC;CACT;SAEe,MAAM,CAClB,iBAAoC,EACpC,OAG6B,EAC7B,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,KAAoB,EAAE,EAAA;AAEjE,IAAA,MAAM,QAAQ,GAAG,eAAe,CAAC,iBAAiB,CAAC;AAEnD,IAAA,MAAM,mBAAmB,GAAG,IAAI,OAAO,EAA8B;AAErE,IAAA,MAAM,oBAAoB,GAAiC,CAAC,OAAO,KAAI;AACnE,QAAA,OAAO,CAAC,OAAO,CAAC,CAAC,KAAK,KAAI;YACtB,MAAM,KAAK,GAAG,mBAAmB,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC;AAEnD;;;AAGG;AACH,YAAA,IAAI,KAAK,CAAC,cAAc,KAAK,OAAO,CAAC,KAAK,CAAC;gBAAE;AAE7C,YAAA,IAAI,KAAK,CAAC,cAAc,EAAE;gBACtB,MAAM,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC;AAC7C,gBAAA,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE;oBAChC,mBAAmB,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,EAAE,QAAQ,CAAC;gBACnD;qBAAO;AACH,oBAAA,QAAQ,CAAC,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC;gBACpC;YACJ;AAAO,iBAAA,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE;gBACpC,KAAK,CAAC,KAAK,CAAC;AACZ,gBAAA,mBAAmB,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC;YAC5C;AACJ,QAAA,CAAC,CAAC;AACN,IAAA,CAAC;AAED,IAAA,MAAM,QAAQ,GAAG,IAAI,oBAAoB,CAAC,oBAAoB,EAAE;QAC5D,IAAI;QACJ,UAAU;AACV,QAAA,SAAS,EAAE,OAAO,MAAM,KAAK,QAAQ,GAAG,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;AACtE,KAAA,CAAC;AAEF,IAAA,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,KAAK,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;AAExD,IAAA,OAAO,MAAM,QAAQ,CAAC,UAAU,EAAE;AACtC;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/html/use-html-visual-state.mjs b/node_modules/framer-motion/dist/es/render/html/use-html-visual-state.mjs new file mode 100644 index 0000000..3b31d71 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/html/use-html-visual-state.mjs @@ -0,0 +1,12 @@ +"use client"; +import { scrapeHTMLMotionValuesFromProps } from 'motion-dom'; +import { makeUseVisualState } from '../../motion/utils/use-visual-state.mjs'; +import { createHtmlRenderState } from './utils/create-render-state.mjs'; + +const useHTMLVisualState = /*@__PURE__*/ makeUseVisualState({ + scrapeMotionValuesFromProps: scrapeHTMLMotionValuesFromProps, + createRenderState: createHtmlRenderState, +}); + +export { useHTMLVisualState }; +//# sourceMappingURL=use-html-visual-state.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/html/use-html-visual-state.mjs.map b/node_modules/framer-motion/dist/es/render/html/use-html-visual-state.mjs.map new file mode 100644 index 0000000..5ed058b --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/html/use-html-visual-state.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-html-visual-state.mjs","sources":["../../../../src/render/html/use-html-visual-state.ts"],"sourcesContent":["\"use client\"\n\nimport { scrapeHTMLMotionValuesFromProps } from \"motion-dom\"\nimport { makeUseVisualState } from \"../../motion/utils/use-visual-state\"\nimport { createHtmlRenderState } from \"./utils/create-render-state\"\n\nexport const useHTMLVisualState = /*@__PURE__*/ makeUseVisualState({\n scrapeMotionValuesFromProps: scrapeHTMLMotionValuesFromProps,\n createRenderState: createHtmlRenderState,\n})\n"],"names":[],"mappings":";;;;;AAMO;AACH;AACA;AACH;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/html/use-props.mjs b/node_modules/framer-motion/dist/es/render/html/use-props.mjs new file mode 100644 index 0000000..62e5556 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/html/use-props.mjs @@ -0,0 +1,57 @@ +"use client"; +import { isMotionValue, isForcedMotionValue, buildHTMLStyles } from 'motion-dom'; +import { useMemo } from 'react'; +import { createHtmlRenderState } from './utils/create-render-state.mjs'; + +function copyRawValuesOnly(target, source, props) { + for (const key in source) { + if (!isMotionValue(source[key]) && !isForcedMotionValue(key, props)) { + target[key] = source[key]; + } + } +} +function useInitialMotionValues({ transformTemplate }, visualState) { + return useMemo(() => { + const state = createHtmlRenderState(); + buildHTMLStyles(state, visualState, transformTemplate); + return Object.assign({}, state.vars, state.style); + }, [visualState]); +} +function useStyle(props, visualState) { + const styleProp = props.style || {}; + const style = {}; + /** + * Copy non-Motion Values straight into style + */ + copyRawValuesOnly(style, styleProp, props); + Object.assign(style, useInitialMotionValues(props, visualState)); + return style; +} +function useHTMLProps(props, visualState) { + // The `any` isn't ideal but it is the type of createElement props argument + const htmlProps = {}; + const style = useStyle(props, visualState); + if (props.drag && props.dragListener !== false) { + // Disable the ghost element when a user drags + htmlProps.draggable = false; + // Disable text selection + style.userSelect = + style.WebkitUserSelect = + style.WebkitTouchCallout = + "none"; + // Disable scrolling on the draggable direction + style.touchAction = + props.drag === true + ? "none" + : `pan-${props.drag === "x" ? "y" : "x"}`; + } + if (props.tabIndex === undefined && + (props.onTap || props.onTapStart || props.whileTap)) { + htmlProps.tabIndex = 0; + } + htmlProps.style = style; + return htmlProps; +} + +export { copyRawValuesOnly, useHTMLProps }; +//# sourceMappingURL=use-props.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/html/use-props.mjs.map b/node_modules/framer-motion/dist/es/render/html/use-props.mjs.map new file mode 100644 index 0000000..2c10e9a --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/html/use-props.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-props.mjs","sources":["../../../../src/render/html/use-props.ts"],"sourcesContent":["\"use client\"\n\nimport { AnyResolvedKeyframe, buildHTMLStyles, isForcedMotionValue, isMotionValue, MotionValue } from \"motion-dom\"\nimport { HTMLProps, useMemo } from \"react\"\nimport { MotionProps } from \"../../motion/types\"\nimport { ResolvedValues } from \"../types\"\nimport { createHtmlRenderState } from \"./utils/create-render-state\"\n\nexport function copyRawValuesOnly(\n target: ResolvedValues,\n source: { [key: string]: AnyResolvedKeyframe | MotionValue },\n props: MotionProps\n) {\n for (const key in source) {\n if (!isMotionValue(source[key]) && !isForcedMotionValue(key, props)) {\n target[key] = source[key] as AnyResolvedKeyframe\n }\n }\n}\n\nfunction useInitialMotionValues(\n { transformTemplate }: MotionProps,\n visualState: ResolvedValues\n) {\n return useMemo(() => {\n const state = createHtmlRenderState()\n\n buildHTMLStyles(state, visualState, transformTemplate)\n\n return Object.assign({}, state.vars, state.style)\n }, [visualState])\n}\n\nfunction useStyle(\n props: MotionProps,\n visualState: ResolvedValues\n): ResolvedValues {\n const styleProp = props.style || {}\n const style = {}\n\n /**\n * Copy non-Motion Values straight into style\n */\n copyRawValuesOnly(style, styleProp as any, props)\n\n Object.assign(style, useInitialMotionValues(props, visualState))\n\n return style\n}\n\nexport function useHTMLProps(\n props: MotionProps & HTMLProps,\n visualState: ResolvedValues\n) {\n // The `any` isn't ideal but it is the type of createElement props argument\n const htmlProps: any = {}\n const style = useStyle(props, visualState)\n\n if (props.drag && props.dragListener !== false) {\n // Disable the ghost element when a user drags\n htmlProps.draggable = false\n\n // Disable text selection\n style.userSelect =\n style.WebkitUserSelect =\n style.WebkitTouchCallout =\n \"none\"\n\n // Disable scrolling on the draggable direction\n style.touchAction =\n props.drag === true\n ? \"none\"\n : `pan-${props.drag === \"x\" ? \"y\" : \"x\"}`\n }\n\n if (\n props.tabIndex === undefined &&\n (props.onTap || props.onTapStart || props.whileTap)\n ) {\n htmlProps.tabIndex = 0\n }\n\n htmlProps.style = style\n\n return htmlProps\n}\n"],"names":[],"mappings":";;;;;;AAaI;AACI;;;;AAIR;AAEA;;AAKQ;AAEA;AAEA;AACJ;AACJ;AAEA;AAII;;AAGA;;AAEG;AACH;AAEA;AAEA;AACJ;AAEM;;;;;;AAUE;;AAGA;AACI;AACA;AACI;;AAGR;;AAEQ;AACA;;AAGZ;AAEI;AAEA;;AAGJ;AAEA;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/html/utils/create-render-state.mjs b/node_modules/framer-motion/dist/es/render/html/utils/create-render-state.mjs new file mode 100644 index 0000000..e387201 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/html/utils/create-render-state.mjs @@ -0,0 +1,9 @@ +const createHtmlRenderState = () => ({ + style: {}, + transform: {}, + transformOrigin: {}, + vars: {}, +}); + +export { createHtmlRenderState }; +//# sourceMappingURL=create-render-state.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/html/utils/create-render-state.mjs.map b/node_modules/framer-motion/dist/es/render/html/utils/create-render-state.mjs.map new file mode 100644 index 0000000..5d7fcc4 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/html/utils/create-render-state.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"create-render-state.mjs","sources":["../../../../../src/render/html/utils/create-render-state.ts"],"sourcesContent":["import { HTMLRenderState } from \"../types\"\n\nexport const createHtmlRenderState = (): HTMLRenderState => ({\n style: {},\n transform: {},\n transformOrigin: {},\n vars: {},\n})\n"],"names":[],"mappings":"AAEO,MAAM,qBAAqB,GAAG,OAAwB;AACzD,IAAA,KAAK,EAAE,EAAE;AACT,IAAA,SAAS,EAAE,EAAE;AACb,IAAA,eAAe,EAAE,EAAE;AACnB,IAAA,IAAI,EAAE,EAAE;AACX,CAAA;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/svg/lowercase-elements.mjs b/node_modules/framer-motion/dist/es/render/svg/lowercase-elements.mjs new file mode 100644 index 0000000..0177ce0 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/svg/lowercase-elements.mjs @@ -0,0 +1,34 @@ +/** + * We keep these listed separately as we use the lowercase tag names as part + * of the runtime bundle to detect SVG components + */ +const lowercaseSVGElements = [ + "animate", + "circle", + "defs", + "desc", + "ellipse", + "g", + "image", + "line", + "filter", + "marker", + "mask", + "metadata", + "path", + "pattern", + "polygon", + "polyline", + "rect", + "stop", + "switch", + "symbol", + "svg", + "text", + "tspan", + "use", + "view", +]; + +export { lowercaseSVGElements }; +//# sourceMappingURL=lowercase-elements.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/svg/lowercase-elements.mjs.map b/node_modules/framer-motion/dist/es/render/svg/lowercase-elements.mjs.map new file mode 100644 index 0000000..3e9fda0 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/svg/lowercase-elements.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"lowercase-elements.mjs","sources":["../../../../src/render/svg/lowercase-elements.ts"],"sourcesContent":["/**\n * We keep these listed separately as we use the lowercase tag names as part\n * of the runtime bundle to detect SVG components\n */\nexport const lowercaseSVGElements = [\n \"animate\",\n \"circle\",\n \"defs\",\n \"desc\",\n \"ellipse\",\n \"g\",\n \"image\",\n \"line\",\n \"filter\",\n \"marker\",\n \"mask\",\n \"metadata\",\n \"path\",\n \"pattern\",\n \"polygon\",\n \"polyline\",\n \"rect\",\n \"stop\",\n \"switch\",\n \"symbol\",\n \"svg\",\n \"text\",\n \"tspan\",\n \"use\",\n \"view\",\n]\n"],"names":[],"mappings":"AAAA;;;AAGG;AACI,MAAM,oBAAoB,GAAG;IAChC,SAAS;IACT,QAAQ;IACR,MAAM;IACN,MAAM;IACN,SAAS;IACT,GAAG;IACH,OAAO;IACP,MAAM;IACN,QAAQ;IACR,QAAQ;IACR,MAAM;IACN,UAAU;IACV,MAAM;IACN,SAAS;IACT,SAAS;IACT,UAAU;IACV,MAAM;IACN,MAAM;IACN,QAAQ;IACR,QAAQ;IACR,KAAK;IACL,MAAM;IACN,OAAO;IACP,KAAK;IACL,MAAM;;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/svg/use-props.mjs b/node_modules/framer-motion/dist/es/render/svg/use-props.mjs new file mode 100644 index 0000000..c992b5f --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/svg/use-props.mjs @@ -0,0 +1,25 @@ +"use client"; +import { buildSVGAttrs, isSVGTag } from 'motion-dom'; +import { useMemo } from 'react'; +import { copyRawValuesOnly } from '../html/use-props.mjs'; +import { createSvgRenderState } from './utils/create-render-state.mjs'; + +function useSVGProps(props, visualState, _isStatic, Component) { + const visualProps = useMemo(() => { + const state = createSvgRenderState(); + buildSVGAttrs(state, visualState, isSVGTag(Component), props.transformTemplate, props.style); + return { + ...state.attrs, + style: { ...state.style }, + }; + }, [visualState]); + if (props.style) { + const rawStyles = {}; + copyRawValuesOnly(rawStyles, props.style, props); + visualProps.style = { ...rawStyles, ...visualProps.style }; + } + return visualProps; +} + +export { useSVGProps }; +//# sourceMappingURL=use-props.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/svg/use-props.mjs.map b/node_modules/framer-motion/dist/es/render/svg/use-props.mjs.map new file mode 100644 index 0000000..6d16ff9 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/svg/use-props.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-props.mjs","sources":["../../../../src/render/svg/use-props.ts"],"sourcesContent":["\"use client\"\n\nimport { buildSVGAttrs, isSVGTag } from \"motion-dom\"\nimport { useMemo } from \"react\"\nimport { MotionProps } from \"../../motion/types\"\nimport { copyRawValuesOnly } from \"../html/use-props\"\nimport { ResolvedValues } from \"../types\"\nimport { createSvgRenderState } from \"./utils/create-render-state\"\n\nexport function useSVGProps(\n props: MotionProps,\n visualState: ResolvedValues,\n _isStatic: boolean,\n Component: string | React.ComponentType>\n) {\n const visualProps = useMemo(() => {\n const state = createSvgRenderState()\n\n buildSVGAttrs(\n state,\n visualState,\n isSVGTag(Component),\n props.transformTemplate,\n props.style\n )\n\n return {\n ...state.attrs,\n style: { ...state.style },\n }\n }, [visualState])\n\n if (props.style) {\n const rawStyles = {}\n copyRawValuesOnly(rawStyles, props.style as any, props)\n visualProps.style = { ...rawStyles, ...visualProps.style }\n }\n\n return visualProps\n}\n"],"names":[],"mappings":";;;;;;AASM;AAMF;AACI;AAEA;;;AAUI;;AAER;AAEA;;;AAGI;;AAGJ;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/svg/use-svg-visual-state.mjs b/node_modules/framer-motion/dist/es/render/svg/use-svg-visual-state.mjs new file mode 100644 index 0000000..a987d88 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/svg/use-svg-visual-state.mjs @@ -0,0 +1,12 @@ +"use client"; +import { scrapeSVGMotionValuesFromProps } from 'motion-dom'; +import { makeUseVisualState } from '../../motion/utils/use-visual-state.mjs'; +import { createSvgRenderState } from './utils/create-render-state.mjs'; + +const useSVGVisualState = /*@__PURE__*/ makeUseVisualState({ + scrapeMotionValuesFromProps: scrapeSVGMotionValuesFromProps, + createRenderState: createSvgRenderState, +}); + +export { useSVGVisualState }; +//# sourceMappingURL=use-svg-visual-state.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/svg/use-svg-visual-state.mjs.map b/node_modules/framer-motion/dist/es/render/svg/use-svg-visual-state.mjs.map new file mode 100644 index 0000000..7f4d418 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/svg/use-svg-visual-state.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-svg-visual-state.mjs","sources":["../../../../src/render/svg/use-svg-visual-state.ts"],"sourcesContent":["\"use client\"\n\nimport { scrapeSVGMotionValuesFromProps } from \"motion-dom\"\nimport { makeUseVisualState } from \"../../motion/utils/use-visual-state\"\nimport { createSvgRenderState } from \"./utils/create-render-state\"\n\nexport const useSVGVisualState = /*@__PURE__*/ makeUseVisualState({\n scrapeMotionValuesFromProps: scrapeSVGMotionValuesFromProps,\n createRenderState: createSvgRenderState,\n})\n"],"names":[],"mappings":";;;;;AAMO;AACH;AACA;AACH;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.mjs b/node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.mjs new file mode 100644 index 0000000..884270f --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.mjs @@ -0,0 +1,9 @@ +import { createHtmlRenderState } from '../../html/utils/create-render-state.mjs'; + +const createSvgRenderState = () => ({ + ...createHtmlRenderState(), + attrs: {}, +}); + +export { createSvgRenderState }; +//# sourceMappingURL=create-render-state.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.mjs.map b/node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.mjs.map new file mode 100644 index 0000000..409d46c --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"create-render-state.mjs","sources":["../../../../../src/render/svg/utils/create-render-state.ts"],"sourcesContent":["import { createHtmlRenderState } from \"../../html/utils/create-render-state\"\nimport { SVGRenderState } from \"../types\"\n\nexport const createSvgRenderState = (): SVGRenderState => ({\n ...createHtmlRenderState(),\n attrs: {},\n})\n"],"names":[],"mappings":";;AAGO,MAAM,oBAAoB,GAAG,OAAuB;AACvD,IAAA,GAAG,qBAAqB,EAAE;AAC1B,IAAA,KAAK,EAAE,EAAE;AACZ,CAAA;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/utils/distance.mjs b/node_modules/framer-motion/dist/es/utils/distance.mjs new file mode 100644 index 0000000..c7ff075 --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/distance.mjs @@ -0,0 +1,10 @@ +const distance = (a, b) => Math.abs(a - b); +function distance2D(a, b) { + // Multi-dimensional + const xDelta = distance(a.x, b.x); + const yDelta = distance(a.y, b.y); + return Math.sqrt(xDelta ** 2 + yDelta ** 2); +} + +export { distance, distance2D }; +//# sourceMappingURL=distance.mjs.map diff --git a/node_modules/framer-motion/dist/es/utils/distance.mjs.map b/node_modules/framer-motion/dist/es/utils/distance.mjs.map new file mode 100644 index 0000000..94ed1f6 --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/distance.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"distance.mjs","sources":["../../../src/utils/distance.ts"],"sourcesContent":["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"],"names":[],"mappings":"AAEO,MAAM,QAAQ,GAAG,CAAC,CAAS,EAAE,CAAS,KAAK,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC;AAE1D,SAAU,UAAU,CAAC,CAAQ,EAAE,CAAQ,EAAA;;AAEzC,IAAA,MAAM,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AACjC,IAAA,MAAM,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AACjC,IAAA,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,GAAG,MAAM,IAAI,CAAC,CAAC;AAC/C;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/utils/get-context-window.mjs b/node_modules/framer-motion/dist/es/utils/get-context-window.mjs new file mode 100644 index 0000000..02fa901 --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/get-context-window.mjs @@ -0,0 +1,7 @@ +// Fixes https://github.com/motiondivision/motion/issues/2270 +const getContextWindow = ({ current }) => { + return current ? current.ownerDocument.defaultView : null; +}; + +export { getContextWindow }; +//# sourceMappingURL=get-context-window.mjs.map diff --git a/node_modules/framer-motion/dist/es/utils/get-context-window.mjs.map b/node_modules/framer-motion/dist/es/utils/get-context-window.mjs.map new file mode 100644 index 0000000..4486b70 --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/get-context-window.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"get-context-window.mjs","sources":["../../../src/utils/get-context-window.ts"],"sourcesContent":["import type { VisualElement } from \"motion-dom\"\n\n// Fixes https://github.com/motiondivision/motion/issues/2270\nexport const getContextWindow = ({ current }: VisualElement) => {\n return current ? current.ownerDocument.defaultView : null\n}\n"],"names":[],"mappings":"AAEA;MACa,gBAAgB,GAAG,CAAC,EAAE,OAAO,EAA0B,KAAI;AACpE,IAAA,OAAO,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC,WAAW,GAAG,IAAI;AAC7D;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/utils/is-browser.mjs b/node_modules/framer-motion/dist/es/utils/is-browser.mjs new file mode 100644 index 0000000..870cec2 --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/is-browser.mjs @@ -0,0 +1,4 @@ +const isBrowser = typeof window !== "undefined"; + +export { isBrowser }; +//# sourceMappingURL=is-browser.mjs.map diff --git a/node_modules/framer-motion/dist/es/utils/is-browser.mjs.map b/node_modules/framer-motion/dist/es/utils/is-browser.mjs.map new file mode 100644 index 0000000..5cf8d86 --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/is-browser.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"is-browser.mjs","sources":["../../../src/utils/is-browser.ts"],"sourcesContent":["export const isBrowser = typeof window !== \"undefined\"\n"],"names":[],"mappings":"MAAa,SAAS,GAAG,OAAO,MAAM,KAAK;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/utils/is-ref-object.mjs b/node_modules/framer-motion/dist/es/utils/is-ref-object.mjs new file mode 100644 index 0000000..7c2f9bb --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/is-ref-object.mjs @@ -0,0 +1,8 @@ +function isRefObject(ref) { + return (ref && + typeof ref === "object" && + Object.prototype.hasOwnProperty.call(ref, "current")); +} + +export { isRefObject }; +//# sourceMappingURL=is-ref-object.mjs.map diff --git a/node_modules/framer-motion/dist/es/utils/is-ref-object.mjs.map b/node_modules/framer-motion/dist/es/utils/is-ref-object.mjs.map new file mode 100644 index 0000000..9565b7f --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/is-ref-object.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"is-ref-object.mjs","sources":["../../../src/utils/is-ref-object.ts"],"sourcesContent":["import { MutableRefObject } from \"./safe-react-types\"\n\nexport function isRefObject(ref: any): ref is MutableRefObject {\n return (\n ref &&\n typeof ref === \"object\" &&\n Object.prototype.hasOwnProperty.call(ref, \"current\")\n )\n}\n"],"names":[],"mappings":"AAEM,SAAU,WAAW,CAAU,GAAQ,EAAA;AACzC,IAAA,QACI,GAAG;QACH,OAAO,GAAG,KAAK,QAAQ;AACvB,QAAA,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,SAAS,CAAC;AAE5D;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion-config.mjs b/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion-config.mjs new file mode 100644 index 0000000..f4a36b0 --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion-config.mjs @@ -0,0 +1,21 @@ +"use client"; +import { useContext } from 'react'; +import { MotionConfigContext } from '../../context/MotionConfigContext.mjs'; +import { useReducedMotion } from './use-reduced-motion.mjs'; + +function useReducedMotionConfig() { + const reducedMotionPreference = useReducedMotion(); + const { reducedMotion } = useContext(MotionConfigContext); + if (reducedMotion === "never") { + return false; + } + else if (reducedMotion === "always") { + return true; + } + else { + return reducedMotionPreference; + } +} + +export { useReducedMotionConfig }; +//# sourceMappingURL=use-reduced-motion-config.mjs.map diff --git a/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion-config.mjs.map b/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion-config.mjs.map new file mode 100644 index 0000000..27f54f2 --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion-config.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-reduced-motion-config.mjs","sources":["../../../../src/utils/reduced-motion/use-reduced-motion-config.ts"],"sourcesContent":["\"use client\"\n\nimport { useContext } from \"react\"\nimport { MotionConfigContext } from \"../../context/MotionConfigContext\"\nimport { useReducedMotion } from \"./use-reduced-motion\"\n\nexport function useReducedMotionConfig() {\n const reducedMotionPreference = useReducedMotion()\n const { reducedMotion } = useContext(MotionConfigContext)\n\n if (reducedMotion === \"never\") {\n return false\n } else if (reducedMotion === \"always\") {\n return true\n } else {\n return reducedMotionPreference\n }\n}\n"],"names":[],"mappings":";;;;;;AAOI;;AAGA;AACI;;AACG;AACH;;;AAEA;;AAER;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.mjs b/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.mjs new file mode 100644 index 0000000..f78cfe8 --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.mjs @@ -0,0 +1,48 @@ +"use client"; +import { hasReducedMotionListener, initPrefersReducedMotion, prefersReducedMotion } from 'motion-dom'; +import { warnOnce } from 'motion-utils'; +import { useState } from 'react'; + +/** + * A hook that returns `true` if we should be using reduced motion based on the current device's Reduced Motion setting. + * + * This can be used to implement changes to your UI based on Reduced Motion. For instance, replacing motion-sickness inducing + * `x`/`y` animations with `opacity`, disabling the autoplay of background videos, or turning off parallax motion. + * + * It will actively respond to changes and re-render your components with the latest setting. + * + * ```jsx + * export function Sidebar({ isOpen }) { + * const shouldReduceMotion = useReducedMotion() + * const closedX = shouldReduceMotion ? 0 : "-100%" + * + * return ( + * + * ) + * } + * ``` + * + * @return boolean + * + * @public + */ +function useReducedMotion() { + /** + * Lazy initialisation of prefersReducedMotion + */ + !hasReducedMotionListener.current && initPrefersReducedMotion(); + const [shouldReduceMotion] = useState(prefersReducedMotion.current); + if (process.env.NODE_ENV !== "production") { + warnOnce(shouldReduceMotion !== true, "You have Reduced Motion enabled on your device. Animations may not appear as expected.", "reduced-motion-disabled"); + } + /** + * TODO See if people miss automatically updating shouldReduceMotion setting + */ + return shouldReduceMotion; +} + +export { useReducedMotion }; +//# sourceMappingURL=use-reduced-motion.mjs.map diff --git a/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.mjs.map b/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.mjs.map new file mode 100644 index 0000000..c5f09d1 --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-reduced-motion.mjs","sources":["../../../../src/utils/reduced-motion/use-reduced-motion.ts"],"sourcesContent":["\"use client\"\n\nimport {\n hasReducedMotionListener,\n initPrefersReducedMotion,\n prefersReducedMotion,\n} from \"motion-dom\"\nimport { warnOnce } from \"motion-utils\"\nimport { useState } from \"react\"\n\n/**\n * A hook that returns `true` if we should be using reduced motion based on the current device's Reduced Motion setting.\n *\n * This can be used to implement changes to your UI based on Reduced Motion. For instance, replacing motion-sickness inducing\n * `x`/`y` animations with `opacity`, disabling the autoplay of background videos, or turning off parallax motion.\n *\n * It will actively respond to changes and re-render your components with the latest setting.\n *\n * ```jsx\n * export function Sidebar({ isOpen }) {\n * const shouldReduceMotion = useReducedMotion()\n * const closedX = shouldReduceMotion ? 0 : \"-100%\"\n *\n * return (\n * \n * )\n * }\n * ```\n *\n * @return boolean\n *\n * @public\n */\nexport function useReducedMotion() {\n /**\n * Lazy initialisation of prefersReducedMotion\n */\n !hasReducedMotionListener.current && initPrefersReducedMotion()\n\n const [shouldReduceMotion] = useState(prefersReducedMotion.current)\n\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(\n shouldReduceMotion !== true,\n \"You have Reduced Motion enabled on your device. Animations may not appear as expected.\",\n \"reduced-motion-disabled\"\n )\n }\n\n /**\n * TODO See if people miss automatically updating shouldReduceMotion setting\n */\n\n return shouldReduceMotion\n}\n"],"names":[],"mappings":";;;;;AAUA;;;;;;;;;;;;;;;;;;;;;;;;;AAyBG;;AAEC;;AAEG;AACH;;;;;AAYA;;AAEG;AAEH;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/utils/transform-rotated-parent.mjs b/node_modules/framer-motion/dist/es/utils/transform-rotated-parent.mjs new file mode 100644 index 0000000..09d364c --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/transform-rotated-parent.mjs @@ -0,0 +1,72 @@ +/** + * Creates a `transformPagePoint` function that corrects pointer coordinates + * for a parent container with CSS transforms (rotation, scale, skew). + * + * When dragging elements inside a transformed parent, pointer coordinates + * need to be transformed through the inverse of the parent's transform + * so the drag offset is in local space. + * + * Works with both static and continuously animating transforms. + * + * @example + * ```jsx + * function App() { + * const ref = useRef(null) + * + * return ( + * + * + * + * + * + * ) + * } + * ``` + * + * @param parentRef - A React ref to the transformed parent element + * @returns A transformPagePoint function for use with MotionConfig + * + * @public + */ +function correctParentTransform(parentRef) { + return (point) => { + const parent = parentRef.current; + if (!parent) + return point; + const inv = getInverseMatrix(parent); + if (!inv) + return point; + // Get center of rotation in page space + const rect = parent.getBoundingClientRect(); + const cx = rect.left + window.scrollX + rect.width / 2; + const cy = rect.top + window.scrollY + rect.height / 2; + // Transform (point - center) through inverse, then add center back + const dx = point.x - cx; + const dy = point.y - cy; + return { + x: cx + inv.a * dx + inv.c * dy, + y: cy + inv.b * dx + inv.d * dy, + }; + }; +} +function getInverseMatrix(element) { + const { transform } = getComputedStyle(element); + if (!transform || transform === "none") + return null; + const match = transform.match(/^matrix3d\((.*)\)$/u) || + transform.match(/^matrix\((.*)\)$/u); + if (!match) + return null; + const v = match[1].split(",").map(Number); + const is3d = transform.startsWith("matrix3d"); + const a = v[0], b = v[1]; + const c = is3d ? v[4] : v[2]; + const d = is3d ? v[5] : v[3]; + const det = a * d - b * c; + if (Math.abs(det) < 1e-10) + return null; + return { a: d / det, b: -b / det, c: -c / det, d: a / det }; +} + +export { correctParentTransform }; +//# sourceMappingURL=transform-rotated-parent.mjs.map diff --git a/node_modules/framer-motion/dist/es/utils/transform-rotated-parent.mjs.map b/node_modules/framer-motion/dist/es/utils/transform-rotated-parent.mjs.map new file mode 100644 index 0000000..0d841cf --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/transform-rotated-parent.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"transform-rotated-parent.mjs","sources":["../../../src/utils/transform-rotated-parent.ts"],"sourcesContent":["import type { Point, TransformPoint } from \"motion-utils\"\nimport type { RefObject } from \"react\"\n\n/**\n * Creates a `transformPagePoint` function that corrects pointer coordinates\n * for a parent container with CSS transforms (rotation, scale, skew).\n *\n * When dragging elements inside a transformed parent, pointer coordinates\n * need to be transformed through the inverse of the parent's transform\n * so the drag offset is in local space.\n *\n * Works with both static and continuously animating transforms.\n *\n * @example\n * ```jsx\n * function App() {\n * const ref = useRef(null)\n *\n * return (\n * \n * \n * \n * \n * \n * )\n * }\n * ```\n *\n * @param parentRef - A React ref to the transformed parent element\n * @returns A transformPagePoint function for use with MotionConfig\n *\n * @public\n */\nexport function correctParentTransform(\n parentRef: RefObject\n): TransformPoint {\n return (point: Point): Point => {\n const parent = parentRef.current\n if (!parent) return point\n\n const inv = getInverseMatrix(parent)\n if (!inv) return point\n\n // Get center of rotation in page space\n const rect = parent.getBoundingClientRect()\n const cx = rect.left + window.scrollX + rect.width / 2\n const cy = rect.top + window.scrollY + rect.height / 2\n\n // Transform (point - center) through inverse, then add center back\n const dx = point.x - cx\n const dy = point.y - cy\n return {\n x: cx + inv.a * dx + inv.c * dy,\n y: cy + inv.b * dx + inv.d * dy,\n }\n }\n}\n\ninterface InverseMatrix {\n a: number\n b: number\n c: number\n d: number\n}\n\nfunction getInverseMatrix(element: HTMLElement): InverseMatrix | null {\n const { transform } = getComputedStyle(element)\n if (!transform || transform === \"none\") return null\n\n const match =\n transform.match(/^matrix3d\\((.*)\\)$/u) ||\n transform.match(/^matrix\\((.*)\\)$/u)\n if (!match) return null\n\n const v = match[1].split(\",\").map(Number)\n const is3d = transform.startsWith(\"matrix3d\")\n const a = v[0],\n b = v[1]\n const c = is3d ? v[4] : v[2]\n const d = is3d ? v[5] : v[3]\n\n const det = a * d - b * c\n if (Math.abs(det) < 1e-10) return null\n\n return { a: d / det, b: -b / det, c: -c / det, d: a / det }\n}\n"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BG;AACG,SAAU,sBAAsB,CAClC,SAAwC,EAAA;IAExC,OAAO,CAAC,KAAY,KAAW;AAC3B,QAAA,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO;AAChC,QAAA,IAAI,CAAC,MAAM;AAAE,YAAA,OAAO,KAAK;AAEzB,QAAA,MAAM,GAAG,GAAG,gBAAgB,CAAC,MAAM,CAAC;AACpC,QAAA,IAAI,CAAC,GAAG;AAAE,YAAA,OAAO,KAAK;;AAGtB,QAAA,MAAM,IAAI,GAAG,MAAM,CAAC,qBAAqB,EAAE;AAC3C,QAAA,MAAM,EAAE,GAAG,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,OAAO,GAAG,IAAI,C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A,MAAM,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAE5B,MAAM,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC;AACzB,IAAA,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK;AAAE,QAAA,OAAO,IAAI;IAEtC,OAAO,EAAE,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE;AAC/D;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/utils/transform-viewbox-point.mjs b/node_modules/framer-motion/dist/es/utils/transform-viewbox-point.mjs new file mode 100644 index 0000000..378b008 --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/transform-viewbox-point.mjs @@ -0,0 +1,63 @@ +/** + * Creates a `transformPagePoint` function that accounts for SVG viewBox scaling. + * + * When dragging SVG elements inside an SVG with a viewBox that differs from + * the rendered dimensions (e.g., `viewBox="0 0 100 100"` but rendered at 500x500 pixels), + * pointer coordinates need to be transformed to match the SVG's coordinate system. + * + * @example + * ```jsx + * function App() { + * const svgRef = useRef(null) + * + * return ( + * + * + * + * + * + * ) + * } + * ``` + * + * @param svgRef - A React ref to the SVG element + * @returns A transformPagePoint function for use with MotionConfig + * + * @public + */ +function transformViewBoxPoint(svgRef) { + return (point) => { + const svg = svgRef.current; + if (!svg) { + return point; + } + // Get the viewBox attribute + const viewBox = svg.viewBox?.baseVal; + if (!viewBox || (viewBox.width === 0 && viewBox.height === 0)) { + // No viewBox or empty viewBox - no transformation needed + return point; + } + // Get the rendered dimensions of the SVG + const bbox = svg.getBoundingClientRect(); + if (bbox.width === 0 || bbox.height === 0) { + return point; + } + // Calculate scale factors + const scaleX = viewBox.width / bbox.width; + const scaleY = viewBox.height / bbox.height; + // Get the SVG's position on the page + const svgX = bbox.left + window.scrollX; + const svgY = bbox.top + window.scrollY; + // Transform the point: + // 1. Calculate position relative to SVG + // 2. Scale by viewBox/viewport ratio + // 3. Add back the SVG position (but in SVG coordinates) + return { + x: (point.x - svgX) * scaleX + svgX, + y: (point.y - svgY) * scaleY + svgY, + }; + }; +} + +export { transformViewBoxPoint }; +//# sourceMappingURL=transform-viewbox-point.mjs.map diff --git a/node_modules/framer-motion/dist/es/utils/transform-viewbox-point.mjs.map b/node_modules/framer-motion/dist/es/utils/transform-viewbox-point.mjs.map new file mode 100644 index 0000000..7dd63e8 --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/transform-viewbox-point.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"transform-viewbox-point.mjs","sources":["../../../src/utils/transform-viewbox-point.ts"],"sourcesContent":["import type { Point, TransformPoint } from \"motion-utils\"\nimport type { RefObject } from \"react\"\n\n/**\n * Creates a `transformPagePoint` function that accounts for SVG viewBox scaling.\n *\n * When dragging SVG elements inside an SVG with a viewBox that differs from\n * the rendered dimensions (e.g., `viewBox=\"0 0 100 100\"` but rendered at 500x500 pixels),\n * pointer coordinates need to be transformed to match the SVG's coordinate system.\n *\n * @example\n * ```jsx\n * function App() {\n * const svgRef = useRef(null)\n *\n * return (\n * \n * \n * \n * \n * \n * )\n * }\n * ```\n *\n * @param svgRef - A React ref to the SVG element\n * @returns A transformPagePoint function for use with MotionConfig\n *\n * @public\n */\nexport function transformViewBoxPoint(\n svgRef: RefObject\n): TransformPoint {\n return (point: Point): Point => {\n const svg = svgRef.current\n if (!svg) {\n return point\n }\n\n // Get the viewBox attribute\n const viewBox = svg.viewBox?.baseVal\n if (!viewBox || (viewBox.width === 0 && viewBox.height === 0)) {\n // No viewBox or empty viewBox - no transformation needed\n return point\n }\n\n // Get the rendered dimensions of the SVG\n const bbox = svg.getBoundingClientRect()\n if (bbox.width === 0 || bbox.height === 0) {\n return point\n }\n\n // Calculate scale factors\n const scaleX = viewBox.width / bbox.width\n const scaleY = viewBox.height / bbox.height\n\n // Get the SVG's position on the page\n const svgX = bbox.left + window.scrollX\n const svgY = bbox.top + window.scrollY\n\n // Transform the point:\n // 1. Calculate position relative to SVG\n // 2. Scale by viewBox/viewport ratio\n // 3. Add back the SVG position (but in SVG coordinates)\n return {\n x: (point.x - svgX) * scaleX + svgX,\n y: (point.y - svgY) * scaleY + svgY,\n }\n }\n}\n"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BG;AACG,SAAU,qBAAqB,CACjC,MAAuC,EAAA;IAEvC,OAAO,CAAC,KAAY,KAAW;AAC3B,QAAA,MAAM,GAAG,GAAG,MAAM,CAAC,OAAO;QAC1B,IAAI,CAAC,GAAG,EAAE;AACN,YAAA,OAAO,KAAK;QAChB;;AAGA,QAAA,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,EAAE,OAAO;AACpC,QAAA,IAAI,CAAC,OAAO,KAAK,OAAO,CAAC,KAAK,KAAK,CAAC,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC,EAAE;;AAE3D,YAAA,OAAO,KAAK;QAChB;;AAGA,QAAA,MAAM,IAAI,GAAG,GAAG,CAAC,qBAAqB,EAAE;AACxC,QAAA,IAAI,IAAI,CAAC,KAAK,KAAK,CAAC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE;AACvC,YAAA,OAAO,KAAK;QAChB;;QAGA,MAAM,MAAM,GAAG,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK;QACzC,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM;;QAG3C,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,OAAO;QACvC,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,GAAG,MAAM,CAAC,OAAO;;;;;QAMtC,OAAO;YACH,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,IAAI,MAAM,GAAG,IAAI;YACnC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,IAAI,MAAM,GAAG,IAAI;SACtC;AACL,IAAA,CAAC;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/utils/use-animation-frame.mjs b/node_modules/framer-motion/dist/es/utils/use-animation-frame.mjs new file mode 100644 index 0000000..529b1ce --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/use-animation-frame.mjs @@ -0,0 +1,23 @@ +"use client"; +import { frame, cancelFrame } from 'motion-dom'; +import { useRef, useContext, useEffect } from 'react'; +import { MotionConfigContext } from '../context/MotionConfigContext.mjs'; + +function useAnimationFrame(callback) { + const initialTimestamp = useRef(0); + const { isStatic } = useContext(MotionConfigContext); + useEffect(() => { + if (isStatic) + return; + const provideTimeSinceStart = ({ timestamp, delta }) => { + if (!initialTimestamp.current) + initialTimestamp.current = timestamp; + callback(timestamp - initialTimestamp.current, delta); + }; + frame.update(provideTimeSinceStart, true); + return () => cancelFrame(provideTimeSinceStart); + }, [callback]); +} + +export { useAnimationFrame }; +//# sourceMappingURL=use-animation-frame.mjs.map diff --git a/node_modules/framer-motion/dist/es/utils/use-animation-frame.mjs.map b/node_modules/framer-motion/dist/es/utils/use-animation-frame.mjs.map new file mode 100644 index 0000000..22b0de0 --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/use-animation-frame.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-animation-frame.mjs","sources":["../../../src/utils/use-animation-frame.ts"],"sourcesContent":["\"use client\"\n\nimport { cancelFrame, frame, FrameData } from \"motion-dom\"\nimport { useContext, useEffect, useRef } from \"react\"\nimport { MotionConfigContext } from \"../context/MotionConfigContext\"\n\nexport type FrameCallback = (timestamp: number, delta: number) => void\n\nexport function useAnimationFrame(callback: FrameCallback) {\n const initialTimestamp = useRef(0)\n const { isStatic } = useContext(MotionConfigContext)\n\n useEffect(() => {\n if (isStatic) return\n\n const provideTimeSinceStart = ({ timestamp, delta }: FrameData) => {\n if (!initialTimestamp.current) initialTimestamp.current = timestamp\n\n callback(timestamp - initialTimestamp.current, delta)\n }\n\n frame.update(provideTimeSinceStart, true)\n return () => cancelFrame(provideTimeSinceStart)\n }, [callback])\n}\n"],"names":[],"mappings":";;;;;AAQM;AACF;;;AAII;;;;AAGmC;;AAGnC;AAEA;AACA;AACJ;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/utils/use-composed-ref.mjs b/node_modules/framer-motion/dist/es/utils/use-composed-ref.mjs new file mode 100644 index 0000000..efa3d32 --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/use-composed-ref.mjs @@ -0,0 +1,61 @@ +import * as React from 'react'; + +/** + * Taken from https://github.com/radix-ui/primitives/blob/main/packages/react/compose-refs/src/compose-refs.tsx + */ +/** + * Set a given ref to a given value + * This utility takes care of different types of refs: callback refs and RefObject(s) + */ +function setRef(ref, value) { + if (typeof ref === "function") { + return ref(value); + } + else if (ref !== null && ref !== undefined) { + ref.current = value; + } +} +/** + * A utility to compose multiple refs together + * Accepts callback refs and RefObject(s) + */ +function composeRefs(...refs) { + return (node) => { + let hasCleanup = false; + const cleanups = refs.map((ref) => { + const cleanup = setRef(ref, node); + if (!hasCleanup && typeof cleanup === "function") { + hasCleanup = true; + } + return cleanup; + }); + // React <19 will log an error to the console if a callback ref returns a + // value. We don't use ref cleanups internally so this will only happen if a + // user's ref callback returns a value, which we only expect if they are + // using the cleanup functionality added in React 19. + if (hasCleanup) { + return () => { + for (let i = 0; i < cleanups.length; i++) { + const cleanup = cleanups[i]; + if (typeof cleanup === "function") { + cleanup(); + } + else { + setRef(refs[i], null); + } + } + }; + } + }; +} +/** + * A custom hook that composes multiple refs + * Accepts callback refs and RefObject(s) + */ +function useComposedRefs(...refs) { + // eslint-disable-next-line react-hooks/exhaustive-deps + return React.useCallback(composeRefs(...refs), refs); +} + +export { useComposedRefs }; +//# sourceMappingURL=use-composed-ref.mjs.map diff --git a/node_modules/framer-motion/dist/es/utils/use-composed-ref.mjs.map b/node_modules/framer-motion/dist/es/utils/use-composed-ref.mjs.map new file mode 100644 index 0000000..f65fb06 --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/use-composed-ref.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-composed-ref.mjs","sources":["../../../src/utils/use-composed-ref.ts"],"sourcesContent":["/**\n * Taken from https://github.com/radix-ui/primitives/blob/main/packages/react/compose-refs/src/compose-refs.tsx\n */\nimport * as React from \"react\"\n\ntype PossibleRef = React.Ref | undefined\n\n/**\n * Set a given ref to a given value\n * This utility takes care of different types of refs: callback refs and RefObject(s)\n */\nfunction setRef(ref: PossibleRef, value: T): void | (() => void) {\n if (typeof ref === \"function\") {\n return ref(value)\n } else if (ref !== null && ref !== undefined) {\n ;(ref as React.MutableRefObject).current = value\n }\n}\n\n/**\n * A utility to compose multiple refs together\n * Accepts callback refs and RefObject(s)\n */\nfunction composeRefs(...refs: PossibleRef[]): React.RefCallback {\n return (node) => {\n let hasCleanup = false\n const cleanups = refs.map((ref) => {\n const cleanup = setRef(ref, node)\n if (!hasCleanup && typeof cleanup === \"function\") {\n hasCleanup = true\n }\n return cleanup\n })\n // React <19 will log an error to the console if a callback ref returns a\n // value. We don't use ref cleanups internally so this will only happen if a\n // user's ref callback returns a value, which we only expect if they are\n // using the cleanup functionality added in React 19.\n if (hasCleanup) {\n return () => {\n for (let i = 0; i < cleanups.length; i++) {\n const cleanup = cleanups[i]\n if (typeof cleanup === \"function\") {\n cleanup()\n } else {\n setRef(refs[i], null)\n }\n }\n }\n }\n }\n}\n\n/**\n * A custom hook that composes multiple refs\n * Accepts callback refs and RefObject(s)\n */\nfunction useComposedRefs(...refs: PossibleRef[]): React.RefCallback {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n return React.useCallback(composeRefs(...refs), refs)\n}\n\nexport { useComposedRefs }\n"],"names":[],"mappings":";;AAAA;;AAEG;AAKH;;;AAGG;AACH,SAAS,M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file diff --git a/node_modules/framer-motion/dist/es/utils/use-constant.mjs b/node_modules/framer-motion/dist/es/utils/use-constant.mjs new file mode 100644 index 0000000..50a3e1d --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/use-constant.mjs @@ -0,0 +1,20 @@ +"use client"; +import { useRef } from 'react'; + +/** + * Creates a constant value over the lifecycle of a component. + * + * Even if `useMemo` is provided an empty array as its final argument, it doesn't offer + * a guarantee that it won't re-run for performance reasons later on. By using `useConstant` + * you can ensure that initialisers don't execute twice or more. + */ +function useConstant(init) { + const ref = useRef(null); + if (ref.current === null) { + ref.current = init(); + } + return ref.current; +} + +export { useConstant }; +//# sourceMappingURL=use-constant.mjs.map diff --git a/node_modules/framer-motion/dist/es/utils/use-constant.mjs.map b/node_modules/framer-motion/dist/es/utils/use-constant.mjs.map new file mode 100644 index 0000000..4a9d7be --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/use-constant.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-constant.mjs","sources":["../../../src/utils/use-constant.ts"],"sourcesContent":["\"use client\"\n\nimport { useRef } from \"react\"\n\ntype Init = () => T\n\n/**\n * Creates a constant value over the lifecycle of a component.\n *\n * Even if `useMemo` is provided an empty array as its final argument, it doesn't offer\n * a guarantee that it won't re-run for performance reasons later on. By using `useConstant`\n * you can ensure that initialisers don't execute twice or more.\n */\nexport function useConstant(init: Init) {\n const ref = useRef(null)\n\n if (ref.current === null) {\n ref.current = init()\n }\n\n return ref.current\n}\n"],"names":[],"mappings":";;;AAMA;;;;;;AAMG;AACG;AACF;AAEA;AACI;;;AAIR;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/utils/use-cycle.mjs b/node_modules/framer-motion/dist/es/utils/use-cycle.mjs new file mode 100644 index 0000000..a5a61ff --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/use-cycle.mjs @@ -0,0 +1,49 @@ +"use client"; +import { wrap } from 'motion-utils'; +import { useRef, useState, useCallback } from 'react'; + +/** + * Cycles through a series of visual properties. Can be used to toggle between or cycle through animations. It works similar to `useState` in React. It is provided an initial array of possible states, and returns an array of two arguments. + * + * An index value can be passed to the returned `cycle` function to cycle to a specific index. + * + * ```jsx + * import * as React from "react" + * import { motion, useCycle } from "framer-motion" + * + * export const MyComponent = () => { + * const [x, cycleX] = useCycle(0, 50, 100) + * + * return ( + * cycleX()} + * /> + * ) + * } + * ``` + * + * @param items - items to cycle through + * @returns [currentState, cycleState] + * + * @public + */ +function useCycle(...items) { + const index = useRef(0); + const [item, setItem] = useState(items[index.current]); + const runCycle = useCallback((next) => { + index.current = + typeof next !== "number" + ? wrap(0, items.length, index.current + 1) + : next; + setItem(items[index.current]); + }, + // The array will change on each call, but by putting items.length at + // the front of this array, we guarantee the dependency comparison will match up + // eslint-disable-next-line react-hooks/exhaustive-deps + [items.length, ...items]); + return [item, runCycle]; +} + +export { useCycle }; +//# sourceMappingURL=use-cycle.mjs.map diff --git a/node_modules/framer-motion/dist/es/utils/use-cycle.mjs.map b/node_modules/framer-motion/dist/es/utils/use-cycle.mjs.map new file mode 100644 index 0000000..59a6bc7 --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/use-cycle.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-cycle.mjs","sources":["../../../src/utils/use-cycle.ts"],"sourcesContent":["\"use client\"\n\nimport { wrap } from \"motion-utils\"\nimport { useCallback, useRef, useState } from \"react\"\n\nexport type Cycle = (i?: number) => void\n\nexport type CycleState = [T, Cycle]\n\n/**\n * Cycles through a series of visual properties. Can be used to toggle between or cycle through animations. It works similar to `useState` in React. It is provided an initial array of possible states, and returns an array of two arguments.\n *\n * An index value can be passed to the returned `cycle` function to cycle to a specific index.\n *\n * ```jsx\n * import * as React from \"react\"\n * import { motion, useCycle } from \"framer-motion\"\n *\n * export const MyComponent = () => {\n * const [x, cycleX] = useCycle(0, 50, 100)\n *\n * return (\n * cycleX()}\n * />\n * )\n * }\n * ```\n *\n * @param items - items to cycle through\n * @returns [currentState, cycleState]\n *\n * @public\n */\nexport function useCycle(...items: T[]): CycleState {\n const index = useRef(0)\n const [item, setItem] = useState(items[index.current])\n\n const runCycle = useCallback(\n (next?: number) => {\n index.current =\n typeof next !== \"number\"\n ? wrap(0, items.length, index.current + 1)\n : next\n\n setItem(items[index.current])\n },\n // The array will change on each call, but by putting items.length at\n // the front of this array, we guarantee the dependency comparison will match up\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [items.length, ...items]\n )\n return [item, runCycle]\n}\n"],"names":[],"mappings":";;;;AASA;;;;;;;;;;;;;;;;;;;;;;;;;AAyBG;AACG;AACF;AACA;AAEA;AAEQ;;AAEQ;;;;;;;;AAUhB;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/utils/use-force-update.mjs b/node_modules/framer-motion/dist/es/utils/use-force-update.mjs new file mode 100644 index 0000000..729a98b --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/use-force-update.mjs @@ -0,0 +1,21 @@ +"use client"; +import { frame } from 'motion-dom'; +import { useState, useCallback } from 'react'; +import { useIsMounted } from './use-is-mounted.mjs'; + +function useForceUpdate() { + const isMounted = useIsMounted(); + const [forcedRenderCount, setForcedRenderCount] = useState(0); + const forceRender = useCallback(() => { + isMounted.current && setForcedRenderCount(forcedRenderCount + 1); + }, [forcedRenderCount]); + /** + * Defer this to the end of the next animation frame in case there are multiple + * synchronous calls. + */ + const deferredForceRender = useCallback(() => frame.postRender(forceRender), [forceRender]); + return [deferredForceRender, forcedRenderCount]; +} + +export { useForceUpdate }; +//# sourceMappingURL=use-force-update.mjs.map diff --git a/node_modules/framer-motion/dist/es/utils/use-force-update.mjs.map b/node_modules/framer-motion/dist/es/utils/use-force-update.mjs.map new file mode 100644 index 0000000..a000fb8 --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/use-force-update.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-force-update.mjs","sources":["../../../src/utils/use-force-update.ts"],"sourcesContent":["\"use client\"\n\nimport { frame } from \"motion-dom\"\nimport { useCallback, useState } from \"react\"\nimport { useIsMounted } from \"./use-is-mounted\"\n\nexport function useForceUpdate(): [VoidFunction, number] {\n const isMounted = useIsMounted()\n const [forcedRenderCount, setForcedRenderCount] = useState(0)\n\n const forceRender = useCallback(() => {\n isMounted.current && setForcedRenderCount(forcedRenderCount + 1)\n }, [forcedRenderCount])\n\n /**\n * Defer this to the end of the next animation frame in case there are multiple\n * synchronous calls.\n */\n const deferredForceRender = useCallback(\n () => frame.postRender(forceRender),\n [forceRender]\n )\n\n return [deferredForceRender, forcedRenderCount]\n}\n"],"names":[],"mappings":";;;;;;AAOI;;AAGA;;AAEA;AAEA;;;AAGG;AACH;AAKA;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/utils/use-in-view.mjs b/node_modules/framer-motion/dist/es/utils/use-in-view.mjs new file mode 100644 index 0000000..59d5aeb --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/use-in-view.mjs @@ -0,0 +1,25 @@ +"use client"; +import { useState, useEffect } from 'react'; +import { inView } from '../render/dom/viewport/index.mjs'; + +function useInView(ref, { root, margin, amount, once = false, initial = false, } = {}) { + const [isInView, setInView] = useState(initial); + useEffect(() => { + if (!ref.current || (once && isInView)) + return; + const onEnter = () => { + setInView(true); + return once ? undefined : () => setInView(false); + }; + const options = { + root: (root && root.current) || undefined, + margin, + amount, + }; + return inView(ref.current, onEnter, options); + }, [root, ref, margin, once, amount]); + return isInView; +} + +export { useInView }; +//# sourceMappingURL=use-in-view.mjs.map diff --git a/node_modules/framer-motion/dist/es/utils/use-in-view.mjs.map b/node_modules/framer-motion/dist/es/utils/use-in-view.mjs.map new file mode 100644 index 0000000..29d21d8 --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/use-in-view.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-in-view.mjs","sources":["../../../src/utils/use-in-view.ts"],"sourcesContent":["\"use client\"\n\nimport { RefObject, useEffect, useState } from \"react\"\nimport { inView, InViewOptions } from \"../render/dom/viewport\"\n\nexport interface UseInViewOptions\n extends Omit {\n root?: RefObject\n once?: boolean\n amount?: \"some\" | \"all\" | number\n initial?: boolean\n}\n\nexport function useInView(\n ref: RefObject,\n {\n root,\n margin,\n amount,\n once = false,\n initial = false,\n }: UseInViewOptions = {}\n) {\n const [isInView, setInView] = useState(initial)\n\n useEffect(() => {\n if (!ref.current || (once && isInView)) return\n\n const onEnter = () => {\n setInView(true)\n\n return once ? undefined : () => setInView(false)\n }\n\n const options: InViewOptions = {\n root: (root && root.current) || undefined,\n margin,\n amount,\n }\n\n return inView(ref.current, onEnter, options)\n }, [root, ref, margin, once, amount])\n\n return isInView\n}\n"],"names":[],"mappings":";;;;AAaM;;;;;;;AAkBM;AACJ;AAEA;;;;;;AAOJ;AAEA;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/utils/use-instant-transition.mjs b/node_modules/framer-motion/dist/es/utils/use-instant-transition.mjs new file mode 100644 index 0000000..8a84ebf --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/use-instant-transition.mjs @@ -0,0 +1,43 @@ +"use client"; +import { frame } from 'motion-dom'; +import { MotionGlobalConfig } from 'motion-utils'; +import { useRef, useEffect } from 'react'; +import { useInstantLayoutTransition } from '../projection/use-instant-layout-transition.mjs'; +import { useForceUpdate } from './use-force-update.mjs'; + +function useInstantTransition() { + const [forceUpdate, forcedRenderCount] = useForceUpdate(); + const startInstantLayoutTransition = useInstantLayoutTransition(); + const unlockOnFrameRef = useRef(-1); + useEffect(() => { + /** + * Unblock after two animation frames, otherwise this will unblock too soon. + */ + frame.postRender(() => frame.postRender(() => { + /** + * If the callback has been called again after the effect + * triggered this 2 frame delay, don't unblock animations. This + * prevents the previous effect from unblocking the current + * instant transition too soon. This becomes more likely when + * used in conjunction with React.startTransition(). + */ + if (forcedRenderCount !== unlockOnFrameRef.current) + return; + MotionGlobalConfig.instantAnimations = false; + })); + }, [forcedRenderCount]); + return (callback) => { + startInstantLayoutTransition(() => { + MotionGlobalConfig.instantAnimations = true; + forceUpdate(); + callback(); + unlockOnFrameRef.current = forcedRenderCount + 1; + }); + }; +} +function disableInstantTransitions() { + MotionGlobalConfig.instantAnimations = false; +} + +export { disableInstantTransitions, useInstantTransition }; +//# sourceMappingURL=use-instant-transition.mjs.map diff --git a/node_modules/framer-motion/dist/es/utils/use-instant-transition.mjs.map b/node_modules/framer-motion/dist/es/utils/use-instant-transition.mjs.map new file mode 100644 index 0000000..8c6bdaa --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/use-instant-transition.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-instant-transition.mjs","sources":["../../../src/utils/use-instant-transition.ts"],"sourcesContent":["\"use client\"\n\nimport { frame } from \"motion-dom\"\nimport { MotionGlobalConfig } from \"motion-utils\"\nimport { useEffect, useRef } from \"react\"\nimport { useInstantLayoutTransition } from \"../projection/use-instant-layout-transition\"\nimport { useForceUpdate } from \"./use-force-update\"\n\nexport function useInstantTransition() {\n const [forceUpdate, forcedRenderCount] = useForceUpdate()\n const startInstantLayoutTransition = useInstantLayoutTransition()\n const unlockOnFrameRef = useRef(-1)\n\n useEffect(() => {\n /**\n * Unblock after two animation frames, otherwise this will unblock too soon.\n */\n frame.postRender(() =>\n frame.postRender(() => {\n /**\n * If the callback has been called again after the effect\n * triggered this 2 frame delay, don't unblock animations. This\n * prevents the previous effect from unblocking the current\n * instant transition too soon. This becomes more likely when\n * used in conjunction with React.startTransition().\n */\n if (forcedRenderCount !== unlockOnFrameRef.current) return\n MotionGlobalConfig.instantAnimations = false\n })\n )\n }, [forcedRenderCount])\n\n return (callback: () => void) => {\n startInstantLayoutTransition(() => {\n MotionGlobalConfig.instantAnimations = true\n forceUpdate()\n callback()\n unlockOnFrameRef.current = forcedRenderCount + 1\n })\n }\n}\n\nexport function disableInstantTransitions() {\n MotionGlobalConfig.instantAnimations = false\n}\n"],"names":[],"mappings":";;;;;;;;;AAUI;AACA;;AAGI;;AAEG;;AAGK;;;;;;AAMG;AACH;;AACA;;AAGZ;;;AAIQ;AACA;AACA;AACA;AACJ;AACJ;AACJ;;AAGI;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/utils/use-is-mounted.mjs b/node_modules/framer-motion/dist/es/utils/use-is-mounted.mjs new file mode 100644 index 0000000..1ebefbe --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/use-is-mounted.mjs @@ -0,0 +1,17 @@ +"use client"; +import { useRef } from 'react'; +import { useIsomorphicLayoutEffect } from './use-isomorphic-effect.mjs'; + +function useIsMounted() { + const isMounted = useRef(false); + useIsomorphicLayoutEffect(() => { + isMounted.current = true; + return () => { + isMounted.current = false; + }; + }, []); + return isMounted; +} + +export { useIsMounted }; +//# sourceMappingURL=use-is-mounted.mjs.map diff --git a/node_modules/framer-motion/dist/es/utils/use-is-mounted.mjs.map b/node_modules/framer-motion/dist/es/utils/use-is-mounted.mjs.map new file mode 100644 index 0000000..72e622c --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/use-is-mounted.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-is-mounted.mjs","sources":["../../../src/utils/use-is-mounted.ts"],"sourcesContent":["\"use client\"\n\nimport { useRef } from \"react\"\nimport { useIsomorphicLayoutEffect } from \"./use-isomorphic-effect\"\n\nexport function useIsMounted() {\n const isMounted = useRef(false)\n useIsomorphicLayoutEffect(() => {\n isMounted.current = true\n\n return () => {\n isMounted.current = false\n }\n }, [])\n\n return isMounted\n}\n"],"names":[],"mappings":";;;;;AAMI;;AAEI;AAEA;AACI;AACJ;;AAGJ;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.mjs b/node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.mjs new file mode 100644 index 0000000..704d9f6 --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.mjs @@ -0,0 +1,8 @@ +"use client"; +import { useLayoutEffect, useEffect } from 'react'; +import { isBrowser } from './is-browser.mjs'; + +const useIsomorphicLayoutEffect = isBrowser ? useLayoutEffect : useEffect; + +export { useIsomorphicLayoutEffect }; +//# sourceMappingURL=use-isomorphic-effect.mjs.map diff --git a/node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.mjs.map b/node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.mjs.map new file mode 100644 index 0000000..66035e5 --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-isomorphic-effect.mjs","sources":["../../../src/utils/use-isomorphic-effect.ts"],"sourcesContent":["\"use client\"\n\nimport { useEffect, useLayoutEffect } from \"react\"\nimport { isBrowser } from \"./is-browser\"\n\nexport const useIsomorphicLayoutEffect = isBrowser ? useLayoutEffect : useEffect\n"],"names":[],"mappings":";;;;AAKO;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/utils/use-motion-value-event.mjs b/node_modules/framer-motion/dist/es/utils/use-motion-value-event.mjs new file mode 100644 index 0000000..5b19c98 --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/use-motion-value-event.mjs @@ -0,0 +1,15 @@ +"use client"; +import { useInsertionEffect } from 'react'; + +function useMotionValueEvent(value, event, callback) { + /** + * useInsertionEffect will create subscriptions before any other + * effects will run. Effects run upwards through the tree so it + * can be that binding a useLayoutEffect higher up the tree can + * miss changes from lower down the tree. + */ + useInsertionEffect(() => value.on(event, callback), [value, event, callback]); +} + +export { useMotionValueEvent }; +//# sourceMappingURL=use-motion-value-event.mjs.map diff --git a/node_modules/framer-motion/dist/es/utils/use-motion-value-event.mjs.map b/node_modules/framer-motion/dist/es/utils/use-motion-value-event.mjs.map new file mode 100644 index 0000000..07df7e4 --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/use-motion-value-event.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-motion-value-event.mjs","sources":["../../../src/utils/use-motion-value-event.ts"],"sourcesContent":["\"use client\"\n\nimport { MotionValue, MotionValueEventCallbacks } from \"motion-dom\"\nimport { useInsertionEffect } from \"react\"\n\nexport function useMotionValueEvent<\n V,\n EventName extends keyof MotionValueEventCallbacks\n>(\n value: MotionValue,\n event: EventName,\n callback: MotionValueEventCallbacks[EventName]\n) {\n /**\n * useInsertionEffect will create subscriptions before any other\n * effects will run. Effects run upwards through the tree so it\n * can be that binding a useLayoutEffect higher up the tree can\n * miss changes from lower down the tree.\n */\n useInsertionEffect(\n () => value.on(event, callback),\n [value, event, callback]\n )\n}\n"],"names":[],"mappings":";;;;AAaI;;;;;AAKG;;AAKP;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/utils/use-page-in-view.mjs b/node_modules/framer-motion/dist/es/utils/use-page-in-view.mjs new file mode 100644 index 0000000..a4c1054 --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/use-page-in-view.mjs @@ -0,0 +1,20 @@ +"use client"; +import { useState, useEffect } from 'react'; + +function usePageInView() { + const [isInView, setIsInView] = useState(true); + useEffect(() => { + const handleVisibilityChange = () => setIsInView(!document.hidden); + if (document.hidden) { + handleVisibilityChange(); + } + document.addEventListener("visibilitychange", handleVisibilityChange); + return () => { + document.removeEventListener("visibilitychange", handleVisibilityChange); + }; + }, []); + return isInView; +} + +export { usePageInView }; +//# sourceMappingURL=use-page-in-view.mjs.map diff --git a/node_modules/framer-motion/dist/es/utils/use-page-in-view.mjs.map b/node_modules/framer-motion/dist/es/utils/use-page-in-view.mjs.map new file mode 100644 index 0000000..9a0dd0d --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/use-page-in-view.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-page-in-view.mjs","sources":["../../../src/utils/use-page-in-view.ts"],"sourcesContent":["\"use client\"\n\nimport { useEffect, useState } from \"react\"\n\nexport function usePageInView() {\n const [isInView, setIsInView] = useState(true)\n\n useEffect(() => {\n const handleVisibilityChange = () => setIsInView(!document.hidden)\n\n if (document.hidden) {\n handleVisibilityChange()\n }\n\n document.addEventListener(\"visibilitychange\", handleVisibilityChange)\n\n return () => {\n document.removeEventListener(\n \"visibilitychange\",\n handleVisibilityChange\n )\n }\n }, [])\n\n return isInView\n}\n"],"names":[],"mappings":";;;;;;AAQQ;AAEA;AACI;;AAGJ;AAEA;AACI;AAIJ;;AAGJ;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/utils/use-unmount-effect.mjs b/node_modules/framer-motion/dist/es/utils/use-unmount-effect.mjs new file mode 100644 index 0000000..a4bd165 --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/use-unmount-effect.mjs @@ -0,0 +1,9 @@ +"use client"; +import { useEffect } from 'react'; + +function useUnmountEffect(callback) { + return useEffect(() => () => callback(), []); +} + +export { useUnmountEffect }; +//# sourceMappingURL=use-unmount-effect.mjs.map diff --git a/node_modules/framer-motion/dist/es/utils/use-unmount-effect.mjs.map b/node_modules/framer-motion/dist/es/utils/use-unmount-effect.mjs.map new file mode 100644 index 0000000..eb242e9 --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/use-unmount-effect.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-unmount-effect.mjs","sources":["../../../src/utils/use-unmount-effect.ts"],"sourcesContent":["\"use client\"\n\nimport { useEffect } from \"react\"\n\nexport function useUnmountEffect(callback: () => void) {\n return useEffect(() => () => callback(), [])\n}\n"],"names":[],"mappings":";;;AAIM;AACF;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/value/scroll/use-element-scroll.mjs b/node_modules/framer-motion/dist/es/value/scroll/use-element-scroll.mjs new file mode 100644 index 0000000..f108d60 --- /dev/null +++ b/node_modules/framer-motion/dist/es/value/scroll/use-element-scroll.mjs @@ -0,0 +1,15 @@ +import { warnOnce } from 'motion-utils'; +import { useScroll } from '../use-scroll.mjs'; + +/** + * @deprecated useElementScroll is deprecated. Convert to useScroll({ container: ref }) + */ +function useElementScroll(ref) { + if (process.env.NODE_ENV === "development") { + warnOnce(false, "useElementScroll is deprecated. Convert to useScroll({ container: ref })."); + } + return useScroll({ container: ref }); +} + +export { useElementScroll }; +//# sourceMappingURL=use-element-scroll.mjs.map diff --git a/node_modules/framer-motion/dist/es/value/scroll/use-element-scroll.mjs.map b/node_modules/framer-motion/dist/es/value/scroll/use-element-scroll.mjs.map new file mode 100644 index 0000000..3375d13 --- /dev/null +++ b/node_modules/framer-motion/dist/es/value/scroll/use-element-scroll.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-element-scroll.mjs","sources":["../../../../src/value/scroll/use-element-scroll.ts"],"sourcesContent":["import { warnOnce } from \"motion-utils\"\nimport { RefObject } from \"react\"\nimport { useScroll } from \"../use-scroll\"\n\n/**\n * @deprecated useElementScroll is deprecated. Convert to useScroll({ container: ref })\n */\nexport function useElementScroll(ref: RefObject) {\n if (process.env.NODE_ENV === \"development\") {\n warnOnce(\n false,\n \"useElementScroll is deprecated. Convert to useScroll({ container: ref }).\"\n )\n }\n\n return useScroll({ container: ref })\n}\n"],"names":[],"mappings":";;;AAIA;;AAEG;AACG,SAAU,gBAAgB,CAAC,GAAkC,EAAA;IAC/D,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,EAAE;AACxC,QAAA,QAAQ,CACJ,KAAK,EACL,2EAA2E,CAC9E;IACL;IAEA,OAAO,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC;AACxC;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/value/scroll/use-viewport-scroll.mjs b/node_modules/framer-motion/dist/es/value/scroll/use-viewport-scroll.mjs new file mode 100644 index 0000000..0c9dcbe --- /dev/null +++ b/node_modules/framer-motion/dist/es/value/scroll/use-viewport-scroll.mjs @@ -0,0 +1,15 @@ +import { warnOnce } from 'motion-utils'; +import { useScroll } from '../use-scroll.mjs'; + +/** + * @deprecated useViewportScroll is deprecated. Convert to useScroll() + */ +function useViewportScroll() { + if (process.env.NODE_ENV !== "production") { + warnOnce(false, "useViewportScroll is deprecated. Convert to useScroll()."); + } + return useScroll(); +} + +export { useViewportScroll }; +//# sourceMappingURL=use-viewport-scroll.mjs.map diff --git a/node_modules/framer-motion/dist/es/value/scroll/use-viewport-scroll.mjs.map b/node_modules/framer-motion/dist/es/value/scroll/use-viewport-scroll.mjs.map new file mode 100644 index 0000000..ea730e9 --- /dev/null +++ b/node_modules/framer-motion/dist/es/value/scroll/use-viewport-scroll.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-viewport-scroll.mjs","sources":["../../../../src/value/scroll/use-viewport-scroll.ts"],"sourcesContent":["import { warnOnce } from \"motion-utils\"\nimport { useScroll } from \"../use-scroll\"\n\n/**\n * @deprecated useViewportScroll is deprecated. Convert to useScroll()\n */\nexport function useViewportScroll() {\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(\n false,\n \"useViewportScroll is deprecated. Convert to useScroll().\"\n )\n }\n return useScroll()\n}\n"],"names":[],"mappings":";;;AAGA;;AAEG;SACa,iBAAiB,GAAA;IAC7B,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE;AACvC,QAAA,QAAQ,CACJ,KAAK,EACL,0DAA0D,CAC7D;IACL;IACA,OAAO,SAAS,EAAE;AACtB;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/value/use-combine-values.mjs b/node_modules/framer-motion/dist/es/value/use-combine-values.mjs new file mode 100644 index 0000000..fc34d54 --- /dev/null +++ b/node_modules/framer-motion/dist/es/value/use-combine-values.mjs @@ -0,0 +1,39 @@ +"use client"; +import { cancelFrame, frame } from 'motion-dom'; +import { useIsomorphicLayoutEffect } from '../utils/use-isomorphic-effect.mjs'; +import { useMotionValue } from './use-motion-value.mjs'; + +function useCombineMotionValues(values, combineValues) { + /** + * Initialise the returned motion value. This remains the same between renders. + */ + const value = useMotionValue(combineValues()); + /** + * Create a function that will update the template motion value with the latest values. + * This is pre-bound so whenever a motion value updates it can schedule its + * execution in Framesync. If it's already been scheduled it won't be fired twice + * in a single frame. + */ + const updateValue = () => value.set(combineValues()); + /** + * Synchronously update the motion value with the latest values during the render. + * This ensures that within a React render, the styles applied to the DOM are up-to-date. + */ + updateValue(); + /** + * Subscribe to all motion values found within the template. Whenever any of them change, + * schedule an update. + */ + useIsomorphicLayoutEffect(() => { + const scheduleUpdate = () => frame.preRender(updateValue, false, true); + const subscriptions = values.map((v) => v.on("change", scheduleUpdate)); + return () => { + subscriptions.forEach((unsubscribe) => unsubscribe()); + cancelFrame(updateValue); + }; + }); + return value; +} + +export { useCombineMotionValues }; +//# sourceMappingURL=use-combine-values.mjs.map diff --git a/node_modules/framer-motion/dist/es/value/use-combine-values.mjs.map b/node_modules/framer-motion/dist/es/value/use-combine-values.mjs.map new file mode 100644 index 0000000..fbcd3a3 --- /dev/null +++ b/node_modules/framer-motion/dist/es/value/use-combine-values.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-combine-values.mjs","sources":["../../../src/value/use-combine-values.ts"],"sourcesContent":["\"use client\"\n\nimport { cancelFrame, frame, MotionValue } from \"motion-dom\"\nimport { useIsomorphicLayoutEffect } from \"../utils/use-isomorphic-effect\"\nimport { useMotionValue } from \"./use-motion-value\"\n\nexport function useCombineMotionValues(\n values: MotionValue[],\n combineValues: () => R\n) {\n /**\n * Initialise the returned motion value. This remains the same between renders.\n */\n const value = useMotionValue(combineValues())\n\n /**\n * Create a function that will update the template motion value with the latest values.\n * This is pre-bound so whenever a motion value updates it can schedule its\n * execution in Framesync. If it's already been scheduled it won't be fired twice\n * in a single frame.\n */\n const updateValue = () => value.set(combineValues())\n\n /**\n * Synchronously update the motion value with the latest values during the render.\n * This ensures that within a React render, the styles applied to the DOM are up-to-date.\n */\n updateValue()\n\n /**\n * Subscribe to all motion values found within the template. Whenever any of them change,\n * schedule an update.\n */\n useIsomorphicLayoutEffect(() => {\n const scheduleUpdate = () => frame.preRender(updateValue, false, true)\n const subscriptions = values.map((v) => v.on(\"change\", scheduleUpdate))\n\n return () => {\n subscriptions.forEach((unsubscribe) => unsubscribe())\n cancelFrame(updateValue)\n }\n })\n\n return value\n}\n"],"names":[],"mappings":";;;;;AAMM;AAIF;;AAEG;AACH;AAEA;;;;;AAKG;AACH;AAEA;;;AAGG;AACH;AAEA;;;AAGG;;AAEC;;AAGA;;;AAGA;AACJ;AAEA;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/value/use-computed.mjs b/node_modules/framer-motion/dist/es/value/use-computed.mjs new file mode 100644 index 0000000..1e85b4e --- /dev/null +++ b/node_modules/framer-motion/dist/es/value/use-computed.mjs @@ -0,0 +1,21 @@ +"use client"; +import { collectMotionValues } from 'motion-dom'; +import { useCombineMotionValues } from './use-combine-values.mjs'; + +function useComputed(compute) { + /** + * Open session of collectMotionValues. Any MotionValue that calls get() + * will be saved into this array. + */ + collectMotionValues.current = []; + compute(); + const value = useCombineMotionValues(collectMotionValues.current, compute); + /** + * Synchronously close session of collectMotionValues. + */ + collectMotionValues.current = undefined; + return value; +} + +export { useComputed }; +//# sourceMappingURL=use-computed.mjs.map diff --git a/node_modules/framer-motion/dist/es/value/use-computed.mjs.map b/node_modules/framer-motion/dist/es/value/use-computed.mjs.map new file mode 100644 index 0000000..f8ada62 --- /dev/null +++ b/node_modules/framer-motion/dist/es/value/use-computed.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-computed.mjs","sources":["../../../src/value/use-computed.ts"],"sourcesContent":["\"use client\"\n\nimport { collectMotionValues, type MotionValue } from \"motion-dom\"\nimport { useCombineMotionValues } from \"./use-combine-values\"\n\nexport function useComputed(compute: () => O): MotionValue {\n /**\n * Open session of collectMotionValues. Any MotionValue that calls get()\n * will be saved into this array.\n */\n collectMotionValues.current = []\n\n compute()\n\n const value = useCombineMotionValues(collectMotionValues.current, compute)\n\n /**\n * Synchronously close session of collectMotionValues.\n */\n collectMotionValues.current = undefined\n\n return value\n}\n"],"names":[],"mappings":";;;;AAKM;AACF;;;AAGG;AACH;AAEA;;AAIA;;AAEG;AACH;AAEA;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/value/use-follow-value.mjs b/node_modules/framer-motion/dist/es/value/use-follow-value.mjs new file mode 100644 index 0000000..29cb0d2 --- /dev/null +++ b/node_modules/framer-motion/dist/es/value/use-follow-value.mjs @@ -0,0 +1,23 @@ +"use client"; +import { attachFollow, isMotionValue } from 'motion-dom'; +import { useContext, useInsertionEffect } from 'react'; +import { MotionConfigContext } from '../context/MotionConfigContext.mjs'; +import { useMotionValue } from './use-motion-value.mjs'; +import { useTransform } from './use-transform.mjs'; + +function useFollowValue(source, options = {}) { + const { isStatic } = useContext(MotionConfigContext); + const getFromSource = () => (isMotionValue(source) ? source.get() : source); + // isStatic will never change, allowing early hooks return + if (isStatic) { + return useTransform(getFromSource); + } + const value = useMotionValue(getFromSource()); + useInsertionEffect(() => { + return attachFollow(value, source, options); + }, [value, JSON.stringify(options)]); + return value; +} + +export { useFollowValue }; +//# sourceMappingURL=use-follow-value.mjs.map diff --git a/node_modules/framer-motion/dist/es/value/use-follow-value.mjs.map b/node_modules/framer-motion/dist/es/value/use-follow-value.mjs.map new file mode 100644 index 0000000..bb1ef6c --- /dev/null +++ b/node_modules/framer-motion/dist/es/value/use-follow-value.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-follow-value.mjs","sources":["../../../src/value/use-follow-value.ts"],"sourcesContent":["\"use client\"\n\nimport {\n AnyResolvedKeyframe,\n attachFollow,\n FollowValueOptions,\n isMotionValue,\n MotionValue,\n} from \"motion-dom\"\nimport { useContext, useInsertionEffect } from \"react\"\nimport { MotionConfigContext } from \"../context/MotionConfigContext\"\nimport { useMotionValue } from \"./use-motion-value\"\nimport { useTransform } from \"./use-transform\"\n\n/**\n * Creates a `MotionValue` that, when `set`, will use the specified animation transition to animate to its new state.\n *\n * Unlike `useSpring` which is limited to spring animations, `useFollowValue` accepts any motion transition\n * including spring, tween, inertia, and keyframes.\n *\n * It can either work as a stand-alone `MotionValue` by initialising it with a value, or as a subscriber\n * to another `MotionValue`.\n *\n * @remarks\n *\n * ```jsx\n * // Spring animation (default)\n * const x = useFollowValue(0, { stiffness: 300 })\n *\n * // Tween animation\n * const y = useFollowValue(0, { type: \"tween\", duration: 0.5, ease: \"easeOut\" })\n *\n * // Track another MotionValue with spring\n * const source = useMotionValue(0)\n * const z = useFollowValue(source, { type: \"spring\", damping: 10 })\n *\n * // Inertia animation\n * const w = useFollowValue(0, { type: \"inertia\", velocity: 100 })\n * ```\n *\n * @param inputValue - `MotionValue` or number. If provided a `MotionValue`, when the input `MotionValue` changes, the created `MotionValue` will animate towards that value using the specified transition.\n * @param options - Animation transition options. Supports all transition types: spring, tween, inertia, keyframes.\n * @returns `MotionValue`\n *\n * @public\n */\nexport function useFollowValue(\n source: MotionValue,\n options?: FollowValueOptions\n): MotionValue\nexport function useFollowValue(\n source: string,\n options?: FollowValueOptions\n): MotionValue\nexport function useFollowValue(\n source: MotionValue,\n options?: FollowValueOptions\n): MotionValue\nexport function useFollowValue(\n source: number,\n options?: FollowValueOptions\n): MotionValue\nexport function useFollowValue(\n source: MotionValue | MotionValue | AnyResolvedKeyframe,\n options: FollowValueOptions = {}\n) {\n const { isStatic } = useContext(MotionConfigContext)\n const getFromSource = () => (isMotionValue(source) ? source.get() : source)\n\n // isStatic will never change, allowing early hooks return\n if (isStatic) {\n return useTransform(getFromSource)\n }\n\n const value = useMotionValue(getFromSource())\n\n useInsertionEffect(() => {\n return attachFollow(value, source, options)\n }, [value, JSON.stringify(options)])\n\n return value\n}\n"],"names":[],"mappings":";;;;;;;;;;;;AAuEQ;;AAGJ;;;AAIA;AAEA;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/value/use-inverted-scale.mjs b/node_modules/framer-motion/dist/es/value/use-inverted-scale.mjs new file mode 100644 index 0000000..347d419 --- /dev/null +++ b/node_modules/framer-motion/dist/es/value/use-inverted-scale.mjs @@ -0,0 +1,54 @@ +"use client"; +import { invariant, warning } from 'motion-utils'; +import { useContext } from 'react'; +import { MotionContext } from '../context/MotionContext/index.mjs'; +import { useMotionValue } from './use-motion-value.mjs'; +import { useTransform } from './use-transform.mjs'; + +// Keep things reasonable and avoid scale: Infinity. In practise we might need +// to add another value, opacity, that could interpolate scaleX/Y [0,0.01] => [0,1] +// to simply hide content at unreasonable scales. +const maxScale = 100000; +const invertScale = (scale) => scale > 0.001 ? 1 / scale : maxScale; +let hasWarned = false; +/** + * Returns a `MotionValue` each for `scaleX` and `scaleY` that update with the inverse + * of their respective parent scales. + * + * This is useful for undoing the distortion of content when scaling a parent component. + * + * By default, `useInvertedScale` will automatically fetch `scaleX` and `scaleY` from the nearest parent. + * By passing other `MotionValue`s in as `useInvertedScale({ scaleX, scaleY })`, it will invert the output + * of those instead. + * + * ```jsx + * const MyComponent = () => { + * const { scaleX, scaleY } = useInvertedScale() + * return + * } + * ``` + * + * @deprecated + */ +function useInvertedScale(scale) { + let parentScaleX = useMotionValue(1); + let parentScaleY = useMotionValue(1); + const { visualElement } = useContext(MotionContext); + invariant(!!(scale || visualElement), "If no scale values are provided, useInvertedScale must be used within a child of another motion component."); + warning(hasWarned, "useInvertedScale is deprecated and will be removed in 3.0. Use the layout prop instead."); + hasWarned = true; + if (scale) { + parentScaleX = scale.scaleX || parentScaleX; + parentScaleY = scale.scaleY || parentScaleY; + } + else if (visualElement) { + parentScaleX = visualElement.getValue("scaleX", 1); + parentScaleY = visualElement.getValue("scaleY", 1); + } + const scaleX = useTransform(parentScaleX, invertScale); + const scaleY = useTransform(parentScaleY, invertScale); + return { scaleX, scaleY }; +} + +export { invertScale, useInvertedScale }; +//# sourceMappingURL=use-inverted-scale.mjs.map diff --git a/node_modules/framer-motion/dist/es/value/use-inverted-scale.mjs.map b/node_modules/framer-motion/dist/es/value/use-inverted-scale.mjs.map new file mode 100644 index 0000000..b9ef57b --- /dev/null +++ b/node_modules/framer-motion/dist/es/value/use-inverted-scale.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-inverted-scale.mjs","sources":["../../../src/value/use-inverted-scale.ts"],"sourcesContent":["\"use client\"\n\nimport { MotionValue } from \"motion-dom\"\nimport { invariant, warning } from \"motion-utils\"\nimport { useContext } from \"react\"\nimport { MotionContext } from \"../context/MotionContext\"\nimport { useMotionValue } from \"./use-motion-value\"\nimport { useTransform } from \"./use-transform\"\n\ninterface ScaleMotionValues {\n scaleX: MotionValue\n scaleY: MotionValue\n}\n\n// Keep things reasonable and avoid scale: Infinity. In practise we might need\n// to add another value, opacity, that could interpolate scaleX/Y [0,0.01] => [0,1]\n// to simply hide content at unreasonable scales.\nconst maxScale = 100000\nexport const invertScale = (scale: number) =>\n scale > 0.001 ? 1 / scale : maxScale\n\nlet hasWarned = false\n\n/**\n * Returns a `MotionValue` each for `scaleX` and `scaleY` that update with the inverse\n * of their respective parent scales.\n *\n * This is useful for undoing the distortion of content when scaling a parent component.\n *\n * By default, `useInvertedScale` will automatically fetch `scaleX` and `scaleY` from the nearest parent.\n * By passing other `MotionValue`s in as `useInvertedScale({ scaleX, scaleY })`, it will invert the output\n * of those instead.\n *\n * ```jsx\n * const MyComponent = () => {\n * const { scaleX, scaleY } = useInvertedScale()\n * return \n * }\n * ```\n *\n * @deprecated\n */\nexport function useInvertedScale(\n scale?: Partial\n): ScaleMotionValues {\n let parentScaleX = useMotionValue(1)\n let parentScaleY = useMotionValue(1)\n const { visualElement } = useContext(MotionContext)\n\n invariant(\n !!(scale || visualElement),\n \"If no scale values are provided, useInvertedScale must be used within a child of another motion component.\"\n )\n\n warning(\n hasWarned,\n \"useInvertedScale is deprecated and will be removed in 3.0. Use the layout prop instead.\"\n )\n\n hasWarned = true\n\n if (scale) {\n parentScaleX = scale.scaleX || parentScaleX\n parentScaleY = scale.scaleY || parentScaleY\n } else if (visualElement) {\n parentScaleX = visualElement.getValue(\"scaleX\", 1)\n parentScaleY = visualElement.getValue(\"scaleY\", 1)\n }\n\n const scaleX = useTransform(parentScaleX, invertScale)\n const scaleY = useTransform(parentScaleY, invertScale)\n\n return { scaleX, scaleY }\n}\n"],"names":[],"mappings":";;;;;;;AAcA;AACA;AACA;AACA;;AAIA;AAEA;;;;;;;;;;;;;;;;;;AAkBG;AACG;AAGF;AACA;;;AAQA;;;AAQI;AACA;;;;;;;;AASJ;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/value/use-motion-template.mjs b/node_modules/framer-motion/dist/es/value/use-motion-template.mjs new file mode 100644 index 0000000..9654b0d --- /dev/null +++ b/node_modules/framer-motion/dist/es/value/use-motion-template.mjs @@ -0,0 +1,47 @@ +"use client"; +import { isMotionValue } from 'motion-dom'; +import { useCombineMotionValues } from './use-combine-values.mjs'; + +/** + * Combine multiple motion values into a new one using a string template literal. + * + * ```jsx + * import { + * motion, + * useSpring, + * useMotionValue, + * useMotionTemplate + * } from "framer-motion" + * + * function Component() { + * const shadowX = useSpring(0) + * const shadowY = useMotionValue(0) + * const shadow = useMotionTemplate`drop-shadow(${shadowX}px ${shadowY}px 20px rgba(0,0,0,0.3))` + * + * return + * } + * ``` + * + * @public + */ +function useMotionTemplate(fragments, ...values) { + /** + * Create a function that will build a string from the latest motion values. + */ + const numFragments = fragments.length; + function buildValue() { + let output = ``; + for (let i = 0; i < numFragments; i++) { + output += fragments[i]; + const value = values[i]; + if (value) { + output += isMotionValue(value) ? value.get() : value; + } + } + return output; + } + return useCombineMotionValues(values.filter(isMotionValue), buildValue); +} + +export { useMotionTemplate }; +//# sourceMappingURL=use-motion-template.mjs.map diff --git a/node_modules/framer-motion/dist/es/value/use-motion-template.mjs.map b/node_modules/framer-motion/dist/es/value/use-motion-template.mjs.map new file mode 100644 index 0000000..ebd693d --- /dev/null +++ b/node_modules/framer-motion/dist/es/value/use-motion-template.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-motion-template.mjs","sources":["../../../src/value/use-motion-template.ts"],"sourcesContent":["\"use client\"\n\nimport { isMotionValue, MotionValue } from \"motion-dom\"\nimport { useCombineMotionValues } from \"./use-combine-values\"\n\n/**\n * Combine multiple motion values into a new one using a string template literal.\n *\n * ```jsx\n * import {\n * motion,\n * useSpring,\n * useMotionValue,\n * useMotionTemplate\n * } from \"framer-motion\"\n *\n * function Component() {\n * const shadowX = useSpring(0)\n * const shadowY = useMotionValue(0)\n * const shadow = useMotionTemplate`drop-shadow(${shadowX}px ${shadowY}px 20px rgba(0,0,0,0.3))`\n *\n * return \n * }\n * ```\n *\n * @public\n */\nexport function useMotionTemplate(\n fragments: TemplateStringsArray,\n ...values: Array\n) {\n /**\n * Create a function that will build a string from the latest motion values.\n */\n const numFragments = fragments.length\n\n function buildValue() {\n let output = ``\n\n for (let i = 0; i < numFragments; i++) {\n output += fragments[i]\n const value = values[i]\n if (value) {\n output += isMotionValue(value) ? value.get() : value\n }\n }\n\n return output\n }\n\n return useCombineMotionValues(values.filter(isMotionValue), buildValue)\n}\n"],"names":[],"mappings":";;;;AAKA;;;;;;;;;;;;;;;;;;;;;AAqBG;;AAKC;;AAEG;AACH;AAEA;;AAGI;AACI;AACA;;AAEI;;;AAIR;;;AAIR;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/value/use-motion-value.mjs b/node_modules/framer-motion/dist/es/value/use-motion-value.mjs new file mode 100644 index 0000000..119b29e --- /dev/null +++ b/node_modules/framer-motion/dist/es/value/use-motion-value.mjs @@ -0,0 +1,40 @@ +"use client"; +import { motionValue } from 'motion-dom'; +import { useContext, useState, useEffect } from 'react'; +import { MotionConfigContext } from '../context/MotionConfigContext.mjs'; +import { useConstant } from '../utils/use-constant.mjs'; + +/** + * Creates a `MotionValue` to track the state and velocity of a value. + * + * Usually, these are created automatically. For advanced use-cases, like use with `useTransform`, you can create `MotionValue`s externally and pass them into the animated component via the `style` prop. + * + * ```jsx + * export const MyComponent = () => { + * const scale = useMotionValue(1) + * + * return + * } + * ``` + * + * @param initial - The initial state. + * + * @public + */ +function useMotionValue(initial) { + const value = useConstant(() => motionValue(initial)); + /** + * If this motion value is being used in static mode, like on + * the Framer canvas, force components to rerender when the motion + * value is updated. + */ + const { isStatic } = useContext(MotionConfigContext); + if (isStatic) { + const [, setLatest] = useState(initial); + useEffect(() => value.on("change", setLatest), []); + } + return value; +} + +export { useMotionValue }; +//# sourceMappingURL=use-motion-value.mjs.map diff --git a/node_modules/framer-motion/dist/es/value/use-motion-value.mjs.map b/node_modules/framer-motion/dist/es/value/use-motion-value.mjs.map new file mode 100644 index 0000000..8dcf9a5 --- /dev/null +++ b/node_modules/framer-motion/dist/es/value/use-motion-value.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-motion-value.mjs","sources":["../../../src/value/use-motion-value.ts"],"sourcesContent":["\"use client\"\n\nimport { motionValue, MotionValue } from \"motion-dom\"\nimport { useContext, useEffect, useState } from \"react\"\nimport { MotionConfigContext } from \"../context/MotionConfigContext\"\nimport { useConstant } from \"../utils/use-constant\"\n\n/**\n * Creates a `MotionValue` to track the state and velocity of a value.\n *\n * Usually, these are created automatically. For advanced use-cases, like use with `useTransform`, you can create `MotionValue`s externally and pass them into the animated component via the `style` prop.\n *\n * ```jsx\n * export const MyComponent = () => {\n * const scale = useMotionValue(1)\n *\n * return \n * }\n * ```\n *\n * @param initial - The initial state.\n *\n * @public\n */\nexport function useMotionValue(initial: T): MotionValue {\n const value = useConstant(() => motionValue(initial))\n\n /**\n * If this motion value is being used in static mode, like on\n * the Framer canvas, force components to rerender when the motion\n * value is updated.\n */\n const { isStatic } = useContext(MotionConfigContext)\n if (isStatic) {\n const [, setLatest] = useState(initial)\n useEffect(() => value.on(\"change\", setLatest), [])\n }\n\n return value\n}\n"],"names":[],"mappings":";;;;;;AAOA;;;;;;;;;;;;;;;;AAgBG;AACG;AACF;AAEA;;;;AAIG;;;;AAIC;;AAGJ;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/value/use-scroll.mjs b/node_modules/framer-motion/dist/es/value/use-scroll.mjs new file mode 100644 index 0000000..9b2fdcc --- /dev/null +++ b/node_modules/framer-motion/dist/es/value/use-scroll.mjs @@ -0,0 +1,119 @@ +"use client"; +import { microtask, cancelMicrotask, supportsViewTimeline, supportsScrollTimeline, motionValue } from 'motion-dom'; +import { invariant } from 'motion-utils'; +import { useRef, useCallback, useEffect } from 'react'; +import { scroll } from '../render/dom/scroll/index.mjs'; +import { offsetToViewTimelineRange } from '../render/dom/scroll/utils/offset-to-range.mjs'; +import { useConstant } from '../utils/use-constant.mjs'; +import { useIsomorphicLayoutEffect } from '../utils/use-isomorphic-effect.mjs'; + +const createScrollMotionValues = () => ({ + scrollX: motionValue(0), + scrollY: motionValue(0), + scrollXProgress: motionValue(0), + scrollYProgress: motionValue(0), +}); +const isRefPending = (ref) => { + if (!ref) + return false; + return !ref.current; +}; +function makeAccelerateConfig(axis, options, container, target) { + return { + // Refs attach child-first; defer so target.current is populated + // before scroll() reads it. + factory: (animation) => { + let cleanup; + const start = () => { + // A provided ref may be hydrated by an effect declared after + // useScroll (or in a parent). Don't attach to the window + // scroll in the meantime — that result gets cached and would + // permanently mistrack. Wait until the ref resolves. + if (isRefPending(container) || isRefPending(target)) { + microtask.read(start); + return; + } + cleanup = scroll(animation, { + ...options, + axis, + container: container?.current || undefined, + target: target?.current || undefined, + }); + }; + microtask.read(start); + return () => { + cancelMicrotask(start); + cleanup?.(); + }; + }, + times: [0, 1], + keyframes: [0, 1], + ease: (v) => v, + duration: 1, + }; +} +function canAccelerateScroll(target, offset) { + if (typeof window === "undefined") + return false; + return target + ? supportsViewTimeline() && !!offsetToViewTimelineRange(offset) + : supportsScrollTimeline(); +} +function useScroll({ container, target, ...options } = {}) { + const values = useConstant(createScrollMotionValues); + if (canAccelerateScroll(target, options.offset)) { + values.scrollXProgress.accelerate = makeAccelerateConfig("x", options, container, target); + values.scrollYProgress.accelerate = makeAccelerateConfig("y", options, container, target); + } + const scrollAnimation = useRef(null); + const needsStart = useRef(false); + const start = useCallback(() => { + scrollAnimation.current = scroll((_progress, { x, y, }) => { + values.scrollX.set(x.current); + values.scrollXProgress.set(x.progress); + values.scrollY.set(y.current); + values.scrollYProgress.set(y.progress); + }, { + ...options, + container: container?.current || undefined, + target: target?.current || undefined, + }); + return () => { + scrollAnimation.current?.(); + }; + }, [container, target, JSON.stringify(options.offset)]); + useIsomorphicLayoutEffect(() => { + needsStart.current = false; + if (isRefPending(container) || isRefPending(target)) { + needsStart.current = true; + return; + } + else { + return start(); + } + }, [start]); + useEffect(() => { + if (!needsStart.current) + return; + // Defer to a microtask so any sibling/parent effect that hydrates the + // ref has a chance to run first. + let cleanup; + const tryStart = () => { + const containerPending = isRefPending(container); + const targetPending = isRefPending(target); + invariant(!containerPending, "Container ref is defined but not hydrated", "use-scroll-ref"); + invariant(!targetPending, "Target ref is defined but not hydrated", "use-scroll-ref"); + if (!containerPending && !targetPending) + cleanup = start(); + }; + microtask.read(tryStart); + return () => { + cancelMicrotask(tryStart); + cleanup?.(); + }; + }, [start]); + return values; +} + +export { useScroll }; +//# sourceMappingURL=use-scroll.mjs.map diff --git a/node_modules/framer-motion/dist/es/value/use-scroll.mjs.map b/node_modules/framer-motion/dist/es/value/use-scroll.mjs.map new file mode 100644 index 0000000..d726410 --- /dev/null +++ b/node_modules/framer-motion/dist/es/value/use-scroll.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-scroll.mjs","sources":["../../../src/value/use-scroll.ts"],"sourcesContent":["\"use client\"\n\nimport {\n AnimationPlaybackControls,\n cancelMicrotask,\n microtask,\n motionValue,\n supportsScrollTimeline,\n supportsViewTimeline,\n} from \"motion-dom\"\nimport { invariant } from \"motion-utils\"\nimport { RefObject, useCallback, useEffect, useRef } from \"react\"\nimport { scroll } from \"../render/dom/scroll\"\nimport { ScrollInfoOptions } from \"../render/dom/scroll/types\"\nimport { offsetToViewTimelineRange } from \"../render/dom/scroll/utils/offset-to-range\"\nimport { useConstant } from \"../utils/use-constant\"\nimport { useIsomorphicLayoutEffect } from \"../utils/use-isomorphic-effect\"\n\nexport interface UseScrollOptions\n extends Omit {\n container?: RefObject\n target?: RefObject\n}\n\nconst createScrollMotionValues = () => ({\n scrollX: motionValue(0),\n scrollY: motionValue(0),\n scrollXProgress: motionValue(0),\n scrollYProgress: motionValue(0),\n})\n\nconst isRefPending = (ref?: RefObject) => {\n if (!ref) return false\n return !ref.current\n}\n\nfunction makeAccelerateConfig(\n axis: \"x\" | \"y\",\n options: Omit,\n container?: RefObject,\n target?: RefObject\n) {\n return {\n // Refs attach child-first; defer so target.current is populated\n // before scroll() reads it.\n factory: (animation: AnimationPlaybackControls) => {\n let cleanup: VoidFunction | undefined\n const start = () => {\n // A provided ref may be hydrated by an effect declared after\n // useScroll (or in a parent). Don't attach to the window\n // scroll in the meantime — that result gets cached and would\n // permanently mistrack. Wait until the ref resolves.\n if (isRefPending(container) || isRefPending(target)) {\n microtask.read(start)\n return\n }\n cleanup = scroll(animation, {\n ...options,\n axis,\n container: container?.current || undefined,\n target: target?.current || undefined,\n })\n }\n microtask.read(start)\n return () => {\n cancelMicrotask(start)\n cleanup?.()\n }\n },\n times: [0, 1],\n keyframes: [0, 1],\n ease: (v: number) => v,\n duration: 1,\n }\n}\n\nfunction canAccelerateScroll(\n target?: RefObject,\n offset?: ScrollInfoOptions[\"offset\"]\n) {\n if (typeof window === \"undefined\") return false\n return target\n ? supportsViewTimeline() && !!offsetToViewTimelineRange(offset)\n : supportsScrollTimeline()\n}\n\nexport function useScroll({\n container,\n target,\n ...options\n}: UseScrollOptions = {}) {\n const values = useConstant(createScrollMotionValues)\n\n if (canAccelerateScroll(target, options.offset)) {\n values.scrollXProgress.accelerate = makeAccelerateConfig(\n \"x\",\n options,\n container,\n target\n )\n values.scrollYProgress.accelerate = makeAccelerateConfig(\n \"y\",\n options,\n container,\n target\n )\n }\n\n const scrollAnimation = useRef(null)\n const needsStart = useRef(false)\n\n const start = useCallback(() => {\n scrollAnimation.current = scroll(\n (\n _progress: number,\n {\n x,\n y,\n }: {\n x: { current: number; progress: number }\n y: { current: number; progress: number }\n }\n ) => {\n values.scrollX.set(x.current)\n values.scrollXProgress.set(x.progress)\n values.scrollY.set(y.current)\n values.scrollYProgress.set(y.progress)\n },\n {\n ...options,\n container: container?.current || undefined,\n target: target?.current || undefined,\n }\n )\n\n return () => {\n scrollAnimation.current?.()\n }\n }, [container, target, JSON.stringify(options.offset)])\n\n useIsomorphicLayoutEffect(() => {\n needsStart.current = false\n\n if (isRefPending(container) || isRefPending(target)) {\n needsStart.current = true\n return\n } else {\n return start()\n }\n }, [start])\n\n useEffect(() => {\n if (!needsStart.current) return\n\n // Defer to a microtask so any sibling/parent effect that hydrates the\n // ref has a chance to run first.\n let cleanup: VoidFunction | undefined\n const tryStart = () => {\n const containerPending = isRefPending(container)\n const targetPending = isRefPending(target)\n invariant(\n !containerPending,\n \"Container ref is defined but not hydrated\",\n \"use-scroll-ref\"\n )\n invariant(\n !targetPending,\n \"Target ref is defined but not hydrated\",\n \"use-scroll-ref\"\n )\n if (!containerPending && !targetPending) cleanup = start()\n }\n microtask.read(tryStart)\n\n return () => {\n cancelMicrotask(tryStart)\n cleanup?.()\n }\n }, [start])\n\n return values\n}\n"],"names":[],"mappings":";;;;;;;;;AAwBA;AACI;AACA;AACA;AACA;AACH;AAED;AACI;AAAU;AACV;AACJ;AAEA;;;;AASQ;AACI;;;;;;;AAOQ;;;AAGJ;AACI;;AAEA;AACA;AACH;AACL;AACA;AACA;;;AAGA;;AAEJ;AACA;AACA;AACA;;AAER;AAEA;;AAIuC;AACnC;;;AAGJ;AAEM;AAKF;;AAGI;AAMA;;AAQJ;AACA;AAEA;AACI;;;;;AAeI;AAEI;AACA;AACA;AACH;AAGL;AACI;AACJ;AACJ;;AAGI;;AAGI;;;;;;AAKR;;;;;;AAOI;;AAEI;AACA;;;AAWA;;AACJ;AACA;AAEA;;;AAGA;AACJ;AAEA;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/value/use-spring.mjs b/node_modules/framer-motion/dist/es/value/use-spring.mjs new file mode 100644 index 0000000..225081a --- /dev/null +++ b/node_modules/framer-motion/dist/es/value/use-spring.mjs @@ -0,0 +1,9 @@ +"use client"; +import { useFollowValue } from './use-follow-value.mjs'; + +function useSpring(source, options = {}) { + return useFollowValue(source, { type: "spring", ...options }); +} + +export { useSpring }; +//# sourceMappingURL=use-spring.mjs.map diff --git a/node_modules/framer-motion/dist/es/value/use-spring.mjs.map b/node_modules/framer-motion/dist/es/value/use-spring.mjs.map new file mode 100644 index 0000000..d96672d --- /dev/null +++ b/node_modules/framer-motion/dist/es/value/use-spring.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-spring.mjs","sources":["../../../src/value/use-spring.ts"],"sourcesContent":["\"use client\"\n\nimport { FollowValueOptions, MotionValue, SpringOptions } from \"motion-dom\"\nimport { useFollowValue } from \"./use-follow-value\"\n\ntype UseSpringOptions = SpringOptions &\n Pick\n\n/**\n * Creates a `MotionValue` that, when `set`, will use a spring animation to animate to its new state.\n *\n * It can either work as a stand-alone `MotionValue` by initialising it with a value, or as a subscriber\n * to another `MotionValue`.\n *\n * @remarks\n *\n * ```jsx\n * const x = useSpring(0, { stiffness: 300 })\n * const y = useSpring(x, { damping: 10 })\n * ```\n *\n * @param inputValue - `MotionValue` or number. If provided a `MotionValue`, when the input `MotionValue` changes, the created `MotionValue` will spring towards that value.\n * @param springConfig - Configuration options for the spring.\n * @returns `MotionValue`\n *\n * @public\n */\nexport function useSpring(\n source: MotionValue,\n options?: UseSpringOptions\n): MotionValue\nexport function useSpring(\n source: string,\n options?: UseSpringOptions\n): MotionValue\nexport function useSpring(\n source: MotionValue,\n options?: UseSpringOptions\n): MotionValue\nexport function useSpring(\n source: number,\n options?: UseSpringOptions\n): MotionValue\nexport function useSpring(\n source: MotionValue | MotionValue | string | number,\n options: UseSpringOptions = {}\n): MotionValue | MotionValue {\n return useFollowValue(source as any, { type: \"spring\", ...options })\n}\n"],"names":[],"mappings":";;;;AA+CI;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/value/use-time.mjs b/node_modules/framer-motion/dist/es/value/use-time.mjs new file mode 100644 index 0000000..74ec85a --- /dev/null +++ b/node_modules/framer-motion/dist/es/value/use-time.mjs @@ -0,0 +1,12 @@ +"use client"; +import { useAnimationFrame } from '../utils/use-animation-frame.mjs'; +import { useMotionValue } from './use-motion-value.mjs'; + +function useTime() { + const time = useMotionValue(0); + useAnimationFrame((t) => time.set(t)); + return time; +} + +export { useTime }; +//# sourceMappingURL=use-time.mjs.map diff --git a/node_modules/framer-motion/dist/es/value/use-time.mjs.map b/node_modules/framer-motion/dist/es/value/use-time.mjs.map new file mode 100644 index 0000000..c733bba --- /dev/null +++ b/node_modules/framer-motion/dist/es/value/use-time.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-time.mjs","sources":["../../../src/value/use-time.ts"],"sourcesContent":["\"use client\"\n\nimport { useAnimationFrame } from \"../utils/use-animation-frame\"\nimport { useMotionValue } from \"./use-motion-value\"\n\nexport function useTime() {\n const time = useMotionValue(0)\n useAnimationFrame((t) => time.set(t))\n return time\n}\n"],"names":[],"mappings":";;;;;AAMI;AACA;AACA;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/value/use-transform.mjs b/node_modules/framer-motion/dist/es/value/use-transform.mjs new file mode 100644 index 0000000..156168e --- /dev/null +++ b/node_modules/framer-motion/dist/es/value/use-transform.mjs @@ -0,0 +1,70 @@ +"use client"; +import { transform } from 'motion-dom'; +import { useConstant } from '../utils/use-constant.mjs'; +import { useCombineMotionValues } from './use-combine-values.mjs'; +import { useComputed } from './use-computed.mjs'; + +function useTransform(input, inputRangeOrTransformer, outputRangeOrMap, options) { + if (typeof input === "function") { + return useComputed(input); + } + /** + * Detect if outputRangeOrMap is an output map (object with keys) + * rather than an output range (array). + */ + const isOutputMap = outputRangeOrMap !== undefined && + !Array.isArray(outputRangeOrMap) && + typeof inputRangeOrTransformer !== "function"; + if (isOutputMap) { + return useMapTransform(input, inputRangeOrTransformer, outputRangeOrMap, options); + } + const outputRange = outputRangeOrMap; + const transformer = typeof inputRangeOrTransformer === "function" + ? inputRangeOrTransformer + : transform(inputRangeOrTransformer, outputRange, options); + const result = Array.isArray(input) + ? useListTransform(input, transformer) + : useListTransform([input], ([latest]) => transformer(latest)); + const inputAccelerate = !Array.isArray(input) + ? input.accelerate + : undefined; + if (inputAccelerate && + !inputAccelerate.isTransformed && + typeof inputRangeOrTransformer !== "function" && + Array.isArray(outputRangeOrMap) && + options?.clamp !== false) { + result.accelerate = { + ...inputAccelerate, + times: inputRangeOrTransformer, + keyframes: outputRangeOrMap, + isTransformed: true, + ...(options?.ease ? { ease: options.ease } : {}), + }; + } + return result; +} +function useListTransform(values, transformer) { + const latest = useConstant(() => []); + return useCombineMotionValues(values, () => { + latest.length = 0; + const numValues = values.length; + for (let i = 0; i < numValues; i++) { + latest[i] = values[i].get(); + } + return transformer(latest); + }); +} +function useMapTransform(inputValue, inputRange, outputMap, options) { + /** + * Capture keys once to ensure hooks are called in consistent order. + */ + const keys = useConstant(() => Object.keys(outputMap)); + const output = useConstant(() => ({})); + for (const key of keys) { + output[key] = useTransform(inputValue, inputRange, outputMap[key], options); + } + return output; +} + +export { useTransform }; +//# sourceMappingURL=use-transform.mjs.map diff --git a/node_modules/framer-motion/dist/es/value/use-transform.mjs.map b/node_modules/framer-motion/dist/es/value/use-transform.mjs.map new file mode 100644 index 0000000..bec9364 --- /dev/null +++ b/node_modules/framer-motion/dist/es/value/use-transform.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-transform.mjs","sources":["../../../src/value/use-transform.ts"],"sourcesContent":["\"use client\"\n\nimport {\n AnyResolvedKeyframe,\n MotionValue,\n transform,\n TransformOptions,\n} from \"motion-dom\"\nimport { useConstant } from \"../utils/use-constant\"\nimport { useCombineMotionValues } from \"./use-combine-values\"\nimport { useComputed } from \"./use-computed\"\n\nexport type InputRange = number[]\ntype SingleTransformer = (input: I) => O\ntype MultiTransformer = (input: I[]) => O\ntype Transformer =\n | SingleTransformer\n /**\n * Ideally, this would be typed in all instances, but to type this\n * more accurately requires the tuple support in TypeScript 4:\n * https://gist.github.com/InventingWithMonster/c4d23752a0fae7888596c4ff6d92733a\n */\n | MultiTransformer\n\ninterface OutputMap {\n [key: string]: O[]\n}\n\n/**\n * Create multiple `MotionValue`s that transform the output of another `MotionValue` by mapping it from one range of values into multiple output ranges.\n *\n * @remarks\n *\n * This is useful when you want to derive multiple values from a single input value.\n * The keys of the output map must remain constant across renders.\n *\n * ```jsx\n * export const MyComponent = () => {\n * const x = useMotionValue(0)\n * const { opacity, scale } = useTransform(x, [0, 100], {\n * opacity: [0, 1],\n * scale: [0.5, 1]\n * })\n *\n * return (\n * \n * )\n * }\n * ```\n *\n * @param inputValue - `MotionValue`\n * @param inputRange - A linear series of numbers (either all increasing or decreasing)\n * @param outputMap - An object where keys map to output ranges. Each output range must be the same length as `inputRange`.\n * @param options - Transform options applied to all outputs\n *\n * @returns An object with the same keys as `outputMap`, where each value is a `MotionValue`\n *\n * @public\n */\nexport function useTransform>(\n inputValue: MotionValue,\n inputRange: InputRange,\n outputMap: T,\n options?: TransformOptions\n): { [K in keyof T]: MotionValue }\n\n/**\n * Create a `MotionValue` that transforms the output of another `MotionValue` by mapping it from one range of values into another.\n *\n * @remarks\n *\n * Given an input range of `[-200, -100, 100, 200]` and an output range of\n * `[0, 1, 1, 0]`, the returned `MotionValue` will:\n *\n * - When provided a value between `-200` and `-100`, will return a value between `0` and `1`.\n * - When provided a value between `-100` and `100`, will return `1`.\n * - When provided a value between `100` and `200`, will return a value between `1` and `0`\n *\n *\n * The input range must be a linear series of numbers. The output range\n * can be any value type supported by Motion: numbers, colors, shadows, etc.\n *\n * Every value in the output range must be of the same type and in the same format.\n *\n * ```jsx\n * export const MyComponent = () => {\n * const x = useMotionValue(0)\n * const xRange = [-200, -100, 100, 200]\n * const opacityRange = [0, 1, 1, 0]\n * const opacity = useTransform(x, xRange, opacityRange)\n *\n * return (\n * \n * )\n * }\n * ```\n *\n * @param inputValue - `MotionValue`\n * @param inputRange - A linear series of numbers (either all increasing or decreasing)\n * @param outputRange - A series of numbers, colors or strings. Must be the same length as `inputRange`.\n * @param options -\n *\n * - clamp: boolean. Clamp values to within the given range. Defaults to `true`\n * - ease: EasingFunction[]. Easing functions to use on the interpolations between each value in the input and output ranges. If provided as an array, the array must be one item shorter than the input and output ranges, as the easings apply to the transition between each.\n *\n * @returns `MotionValue`\n *\n * @public\n */\nexport function useTransform(\n value: MotionValue,\n inputRange: InputRange,\n outputRange: O[],\n options?: TransformOptions\n): MotionValue\n\n/**\n * Create a `MotionValue` that transforms the output of another `MotionValue` through a function.\n * In this example, `y` will always be double `x`.\n *\n * ```jsx\n * export const MyComponent = () => {\n * const x = useMotionValue(10)\n * const y = useTransform(x, value => value * 2)\n *\n * return \n * }\n * ```\n *\n * @param input - A `MotionValue` that will pass its latest value through `transform` to update the returned `MotionValue`.\n * @param transform - A function that accepts the latest value from `input` and returns a new value.\n * @returns `MotionValue`\n *\n * @public\n */\nexport function useTransform(\n input: MotionValue,\n transformer: SingleTransformer\n): MotionValue\n\n/**\n * Pass an array of `MotionValue`s and a function to combine them. In this example, `z` will be the `x` multiplied by `y`.\n *\n * ```jsx\n * export const MyComponent = () => {\n * const x = useMotionValue(0)\n * const y = useMotionValue(0)\n * const z = useTransform([x, y], ([latestX, latestY]) => latestX * latestY)\n *\n * return \n * }\n * ```\n *\n * @param input - An array of `MotionValue`s that will pass their latest values through `transform` to update the returned `MotionValue`.\n * @param transform - A function that accepts the latest values from `input` and returns a new value.\n * @returns `MotionValue`\n *\n * @public\n */\nexport function useTransform(\n input:\n | MotionValue[]\n | MotionValue[]\n | MotionValue[],\n transformer: MultiTransformer\n): MotionValue\nexport function useTransform(transformer: () => O): MotionValue\n\nexport function useTransform(\n input:\n | MotionValue\n | MotionValue[]\n | MotionValue[]\n | MotionValue[]\n | (() => O),\n inputRangeOrTransformer?: InputRange | Transformer,\n outputRangeOrMap?: O[] | OutputMap,\n options?: TransformOptions\n): MotionValue | { [key in K]: MotionValue } {\n if (typeof input === \"function\") {\n return useComputed(input)\n }\n\n /**\n * Detect if outputRangeOrMap is an output map (object with keys)\n * rather than an output range (array).\n */\n const isOutputMap =\n outputRangeOrMap !== undefined &&\n !Array.isArray(outputRangeOrMap) &&\n typeof inputRangeOrTransformer !== \"function\"\n\n if (isOutputMap) {\n return useMapTransform(\n input as MotionValue,\n inputRangeOrTransformer as InputRange,\n outputRangeOrMap as OutputMap,\n options\n ) as { [key in K]: MotionValue }\n }\n\n const outputRange = outputRangeOrMap as O[] | undefined\n const transformer =\n typeof inputRangeOrTransformer === \"function\"\n ? inputRangeOrTransformer\n : transform(inputRangeOrTransformer!, outputRange!, options)\n\n const result = Array.isArray(input)\n ? useListTransform(\n input,\n transformer as MultiTransformer\n )\n : useListTransform([input], ([latest]) =>\n (transformer as SingleTransformer)(latest)\n )\n\n const inputAccelerate = !Array.isArray(input)\n ? (input as MotionValue).accelerate\n : undefined\n\n if (\n inputAccelerate &&\n !inputAccelerate.isTransformed &&\n typeof inputRangeOrTransformer !== \"function\" &&\n Array.isArray(outputRangeOrMap) &&\n options?.clamp !== false\n ) {\n result.accelerate = {\n ...inputAccelerate,\n times: inputRangeOrTransformer as number[],\n keyframes: outputRangeOrMap,\n isTransformed: true,\n ...(options?.ease ? { ease: options.ease } : {}),\n }\n }\n\n return result\n}\n\nfunction useListTransform(\n values: MotionValue[],\n transformer: MultiTransformer\n): MotionValue {\n const latest = useConstant(() => [])\n\n return useCombineMotionValues(values, () => {\n latest.length = 0\n const numValues = values.length\n for (let i = 0; i < numValues; i++) {\n latest[i] = values[i].get()\n }\n\n return transformer(latest)\n })\n}\n\nfunction useMapTransform(\n inputValue: MotionValue,\n inputRange: InputRange,\n outputMap: OutputMap,\n options?: TransformOptions\n): { [key: string]: MotionValue } {\n /**\n * Capture keys once to ensure hooks are called in consistent order.\n */\n const keys = useConstant(() => Object.keys(outputMap))\n const output = useConstant<{ [key: string]: MotionValue }>(() => ({}))\n\n for (const key of keys) {\n output[key] = useTransform(inputValue, inputRange, outputMap[key], options)\n }\n\n return output\n}\n"],"names":[],"mappings":";;;;;;AA2KM;AAWF;AACI;;AAGJ;;;AAGG;AACH;AAEI;;;;;;AAaJ;AAEQ;;AAGR;AACI;AAIA;;;;AAQJ;;;AAII;AACA;;AAGI;AACA;AACA;AACA;AACA;;;AAIR;AACJ;AAEA;;AAMI;AACI;AACA;AACA;;;AAIA;AACJ;AACJ;AAEA;AAMI;;AAEG;AACH;;AAGA;AACI;;AAGJ;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/value/use-velocity.mjs b/node_modules/framer-motion/dist/es/value/use-velocity.mjs new file mode 100644 index 0000000..70a9d19 --- /dev/null +++ b/node_modules/framer-motion/dist/es/value/use-velocity.mjs @@ -0,0 +1,37 @@ +"use client"; +import { frame } from 'motion-dom'; +import { useMotionValueEvent } from '../utils/use-motion-value-event.mjs'; +import { useMotionValue } from './use-motion-value.mjs'; + +/** + * Creates a `MotionValue` that updates when the velocity of the provided `MotionValue` changes. + * + * ```javascript + * const x = useMotionValue(0) + * const xVelocity = useVelocity(x) + * const xAcceleration = useVelocity(xVelocity) + * ``` + * + * @public + */ +function useVelocity(value) { + const velocity = useMotionValue(value.getVelocity()); + const updateVelocity = () => { + const latest = value.getVelocity(); + velocity.set(latest); + /** + * If we still have velocity, schedule an update for the next frame + * to keep checking until it is zero. + */ + if (latest) + frame.update(updateVelocity); + }; + useMotionValueEvent(value, "change", () => { + // Schedule an update to this value at the end of the current frame. + frame.update(updateVelocity, false, true); + }); + return velocity; +} + +export { useVelocity }; +//# sourceMappingURL=use-velocity.mjs.map diff --git a/node_modules/framer-motion/dist/es/value/use-velocity.mjs.map b/node_modules/framer-motion/dist/es/value/use-velocity.mjs.map new file mode 100644 index 0000000..df80afe --- /dev/null +++ b/node_modules/framer-motion/dist/es/value/use-velocity.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-velocity.mjs","sources":["../../../src/value/use-velocity.ts"],"sourcesContent":["\"use client\"\n\nimport { frame, MotionValue } from \"motion-dom\"\nimport { useMotionValueEvent } from \"../utils/use-motion-value-event\"\nimport { useMotionValue } from \"./use-motion-value\"\n/**\n * Creates a `MotionValue` that updates when the velocity of the provided `MotionValue` changes.\n *\n * ```javascript\n * const x = useMotionValue(0)\n * const xVelocity = useVelocity(x)\n * const xAcceleration = useVelocity(xVelocity)\n * ```\n *\n * @public\n */\nexport function useVelocity(value: MotionValue): MotionValue {\n const velocity = useMotionValue(value.getVelocity())\n\n const updateVelocity = () => {\n const latest = value.getVelocity()\n velocity.set(latest)\n\n /**\n * If we still have velocity, schedule an update for the next frame\n * to keep checking until it is zero.\n */\n if (latest) frame.update(updateVelocity)\n }\n\n useMotionValueEvent(value, \"change\", () => {\n // Schedule an update to this value at the end of the current frame.\n frame.update(updateVelocity, false, true)\n })\n\n return velocity\n}\n"],"names":[],"mappings":";;;;;AAKA;;;;;;;;;;AAUG;AACG;;;AAIE;AACA;AAEA;;;AAGG;AACH;AAAY;AAChB;AAEA;;;AAGA;AAEA;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/value/use-will-change/WillChangeMotionValue.mjs b/node_modules/framer-motion/dist/es/value/use-will-change/WillChangeMotionValue.mjs new file mode 100644 index 0000000..b5ba18b --- /dev/null +++ b/node_modules/framer-motion/dist/es/value/use-will-change/WillChangeMotionValue.mjs @@ -0,0 +1,20 @@ +import { MotionValue, transformProps, acceleratedValues } from 'motion-dom'; + +class WillChangeMotionValue extends MotionValue { + constructor() { + super(...arguments); + this.isEnabled = false; + } + add(name) { + if (transformProps.has(name) || acceleratedValues.has(name)) { + this.isEnabled = true; + this.update(); + } + } + update() { + this.set(this.isEnabled ? "transform" : "auto"); + } +} + +export { WillChangeMotionValue }; +//# sourceMappingURL=WillChangeMotionValue.mjs.map diff --git a/node_modules/framer-motion/dist/es/value/use-will-change/WillChangeMotionValue.mjs.map b/node_modules/framer-motion/dist/es/value/use-will-change/WillChangeMotionValue.mjs.map new file mode 100644 index 0000000..1768274 --- /dev/null +++ b/node_modules/framer-motion/dist/es/value/use-will-change/WillChangeMotionValue.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"WillChangeMotionValue.mjs","sources":["../../../../src/value/use-will-change/WillChangeMotionValue.ts"],"sourcesContent":["import {\n acceleratedValues,\n MotionValue,\n transformProps,\n type WillChange,\n} from \"motion-dom\"\n\nexport class WillChangeMotionValue\n extends MotionValue\n implements WillChange\n{\n private isEnabled = false\n\n add(name: string) {\n if (transformProps.has(name) || acceleratedValues.has(name)) {\n this.isEnabled = true\n this.update()\n }\n }\n\n private update() {\n this.set(this.isEnabled ? \"transform\" : \"auto\")\n }\n}\n"],"names":[],"mappings":";;AAOM,MAAO,qBACT,SAAQ,WAAmB,CAAA;AAD/B,IAAA,WAAA,GAAA;;QAIY,IAAA,CAAA,SAAS,GAAG,KAAK;IAY7B;AAVI,IAAA,GAAG,CAAC,IAAY,EAAA;AACZ,QAAA,IAAI,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;AACzD,YAAA,IAAI,CAAC,SAAS,GAAG,IAAI;YACrB,IAAI,CAAC,MAAM,EAAE;QACjB;IACJ;IAEQ,MAAM,GAAA;AACV,QAAA,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,GAAG,WAAW,GAAG,MAAM,CAAC;IACnD;AACH;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/value/use-will-change/index.mjs b/node_modules/framer-motion/dist/es/value/use-will-change/index.mjs new file mode 100644 index 0000000..f06ed5e --- /dev/null +++ b/node_modules/framer-motion/dist/es/value/use-will-change/index.mjs @@ -0,0 +1,10 @@ +"use client"; +import { useConstant } from '../../utils/use-constant.mjs'; +import { WillChangeMotionValue } from './WillChangeMotionValue.mjs'; + +function useWillChange() { + return useConstant(() => new WillChangeMotionValue("auto")); +} + +export { useWillChange }; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/framer-motion/dist/es/value/use-will-change/index.mjs.map b/node_modules/framer-motion/dist/es/value/use-will-change/index.mjs.map new file mode 100644 index 0000000..0944a7c --- /dev/null +++ b/node_modules/framer-motion/dist/es/value/use-will-change/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../../../../src/value/use-will-change/index.ts"],"sourcesContent":["\"use client\"\n\nimport type { WillChange } from \"motion-dom\"\nimport { useConstant } from \"../../utils/use-constant\"\nimport { WillChangeMotionValue } from \"./WillChangeMotionValue\"\n\nexport function useWillChange(): WillChange {\n return useConstant(() => new WillChangeMotionValue(\"auto\"))\n}\n"],"names":[],"mappings":";;;;;;AAQA;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/framer-motion.dev.js b/node_modules/framer-motion/dist/framer-motion.dev.js new file mode 100644 index 0000000..b9a2adf --- /dev/null +++ b/node_modules/framer-motion/dist/framer-motion.dev.js @@ -0,0 +1,17543 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) : + typeof define === 'function' && define.amd ? define(['exports', 'react'], factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Motion = {}, global.React)); +})(this, (function (exports, React$1) { 'use strict'; + + function _interopNamespaceDefault(e) { + var n = Object.create(null); + if (e) { + Object.keys(e).forEach(function (k) { + if (k !== 'default') { + var d = Object.getOwnPropertyDescriptor(e, k); + Object.defineProperty(n, k, d.get ? d : { + enumerable: true, + get: function () { return e[k]; } + }); + } + }); + } + n.default = e; + return Object.freeze(n); + } + + var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React$1); + + // source: react/cjs/react-jsx-runtime.production.min.js + /** + * @license React + * react-jsx-runtime.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + var f = React, + k = Symbol.for("react.element"), + l = Symbol.for("react.fragment"), + m$1 = Object.prototype.hasOwnProperty, + n = f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, + p = { key: true, ref: true, __self: true, __source: true }; + function q(c, a, g) { + var b, + d = {}, + e = null, + h = null; + void 0 !== g && (e = "" + g); + void 0 !== a.key && (e = "" + a.key); + void 0 !== a.ref && (h = a.ref); + for (b in a) m$1.call(a, b) && !p.hasOwnProperty(b) && (d[b] = a[b]); + if (c && c.defaultProps) + for (b in ((a = c.defaultProps), a)) void 0 === d[b] && (d[b] = a[b]); + return { $$typeof: k, type: c, key: e, ref: h, props: d, _owner: n.current } + } + const Fragment = l; + const jsx = q; + const jsxs = q; + + const LayoutGroupContext = React$1.createContext({}); + + /** + * Creates a constant value over the lifecycle of a component. + * + * Even if `useMemo` is provided an empty array as its final argument, it doesn't offer + * a guarantee that it won't re-run for performance reasons later on. By using `useConstant` + * you can ensure that initialisers don't execute twice or more. + */ + function useConstant(init) { + const ref = React$1.useRef(null); + if (ref.current === null) { + ref.current = init(); + } + return ref.current; + } + + const isBrowser$1 = typeof window !== "undefined"; + + const useIsomorphicLayoutEffect = isBrowser$1 ? React$1.useLayoutEffect : React$1.useEffect; + + /** + * @public + */ + const PresenceContext = + /* @__PURE__ */ React$1.createContext(null); + + function addUniqueItem(arr, item) { + if (arr.indexOf(item) === -1) + arr.push(item); + } + function removeItem(arr, item) { + const index = arr.indexOf(item); + if (index > -1) + arr.splice(index, 1); + } + // Adapted from array-move + function moveItem([...arr], fromIndex, toIndex) { + const startIndex = fromIndex < 0 ? arr.length + fromIndex : fromIndex; + if (startIndex >= 0 && startIndex < arr.length) { + const endIndex = toIndex < 0 ? arr.length + toIndex : toIndex; + const [item] = arr.splice(fromIndex, 1); + arr.splice(endIndex, 0, item); + } + return arr; + } + + const clamp = (min, max, v) => { + if (v > max) + return max; + if (v < min) + return min; + return v; + }; + + function formatErrorMessage(message, errorCode) { + return errorCode + ? `${message}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${errorCode}` + : message; + } + + exports.warning = () => { }; + exports.invariant = () => { }; + if (typeof process !== "undefined" && + process.env?.NODE_ENV !== "production") { + exports.warning = (check, message, errorCode) => { + if (!check && typeof console !== "undefined") { + console.warn(formatErrorMessage(message, errorCode)); + } + }; + exports.invariant = (check, message, errorCode) => { + if (!check) { + throw new Error(formatErrorMessage(message, errorCode)); + } + }; + } + + const MotionGlobalConfig = {}; + + /** + * Check if value is a numerical string, ie a string that is purely a number eg "100" or "-100.1" + */ + const isNumericalString = (v) => /^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(v); + + const isObject = (value) => typeof value === "object" && value !== null; + + /** + * Check if the value is a zero value string like "0px" or "0%" + */ + const isZeroValueString = (v) => /^0[^.\s]+$/u.test(v); + + /*#__NO_SIDE_EFFECTS__*/ + function memo(callback) { + let result; + return () => { + if (result === undefined) + result = callback(); + return result; + }; + } + + /*#__NO_SIDE_EFFECTS__*/ + const noop = (any) => any; + + /** + * Pipe + * Compose other transformers to run linearily + * pipe(min(20), max(40)) + * @param {...functions} transformers + * @return {function} + */ + const pipe = (...transformers) => transformers.reduce((a, b) => (v) => b(a(v))); + + /* + Progress within given range + + Given a lower limit and an upper limit, we return the progress + (expressed as a number 0-1) represented by the given value, and + limit that progress to within 0-1. + */ + /*#__NO_SIDE_EFFECTS__*/ + const progress = (from, to, value) => { + const range = to - from; + return range ? (value - from) / range : 1; + }; + + class SubscriptionManager { + constructor() { + this.subscriptions = []; + } + add(handler) { + addUniqueItem(this.subscriptions, handler); + return () => removeItem(this.subscriptions, handler); + } + notify(a, b, c) { + const numSubscriptions = this.subscriptions.length; + if (!numSubscriptions) + return; + if (numSubscriptions === 1) { + /** + * If there's only a single handler we can just call it without invoking a loop. + */ + this.subscriptions[0](a, b, c); + } + else { + for (let i = 0; i < numSubscriptions; i++) { + /** + * Check whether the handler exists before firing as it's possible + * the subscriptions were modified during this loop running. + */ + const handler = this.subscriptions[i]; + handler && handler(a, b, c); + } + } + } + getSize() { + return this.subscriptions.length; + } + clear() { + this.subscriptions.length = 0; + } + } + + /** + * Converts seconds to milliseconds + * + * @param seconds - Time in seconds. + * @return milliseconds - Converted time in milliseconds. + */ + /*#__NO_SIDE_EFFECTS__*/ + const secondsToMilliseconds = (seconds) => seconds * 1000; + /*#__NO_SIDE_EFFECTS__*/ + const millisecondsToSeconds = (milliseconds) => milliseconds / 1000; + + /* + Convert velocity into velocity per second + */ + /*#__NO_SIDE_EFFECTS__*/ + const velocityPerSecond = (velocity, frameDuration) => frameDuration ? velocity * (1000 / frameDuration) : 0; + + const warned = new Set(); + function hasWarned$1(message) { + return warned.has(message); + } + function warnOnce(condition, message, errorCode) { + if (condition || warned.has(message)) + return; + console.warn(formatErrorMessage(message, errorCode)); + warned.add(message); + } + + const wrap = (min, max, v) => { + const rangeSize = max - min; + return ((((v - min) % rangeSize) + rangeSize) % rangeSize) + min; + }; + + /* + Bezier function generator + This has been modified from Gaëtan Renaudeau's BezierEasing + https://github.com/gre/bezier-easing/blob/master/src/index.js + https://github.com/gre/bezier-easing/blob/master/LICENSE + + I've removed the newtonRaphsonIterate algo because in benchmarking it + wasn't noticeably faster than binarySubdivision, indeed removing it + usually improved times, depending on the curve. + I also removed the lookup table, as for the added bundle size and loop we're + only cutting ~4 or so subdivision iterations. I bumped the max iterations up + to 12 to compensate and this still tended to be faster for no perceivable + loss in accuracy. + Usage + const easeOut = cubicBezier(.17,.67,.83,.67); + const x = easeOut(0.5); // returns 0.627... + */ + // Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2. + const calcBezier = (t, a1, a2) => (((1.0 - 3.0 * a2 + 3.0 * a1) * t + (3.0 * a2 - 6.0 * a1)) * t + 3.0 * a1) * + t; + const subdivisionPrecision = 0.0000001; + const subdivisionMaxIterations = 12; + function binarySubdivide(x, lowerBound, upperBound, mX1, mX2) { + let currentX; + let currentT; + let i = 0; + do { + currentT = lowerBound + (upperBound - lowerBound) / 2.0; + currentX = calcBezier(currentT, mX1, mX2) - x; + if (currentX > 0.0) { + upperBound = currentT; + } + else { + lowerBound = currentT; + } + } while (Math.abs(currentX) > subdivisionPrecision && + ++i < subdivisionMaxIterations); + return currentT; + } + /*#__NO_SIDE_EFFECTS__*/ + function cubicBezier(mX1, mY1, mX2, mY2) { + // If this is a linear gradient, return linear easing + if (mX1 === mY1 && mX2 === mY2) + return noop; + const getTForX = (aX) => binarySubdivide(aX, 0, 1, mX1, mX2); + // If animation is at start/end, return t without easing + return (t) => t === 0 || t === 1 ? t : calcBezier(getTForX(t), mY1, mY2); + } + + // Accepts an easing function and returns a new one that outputs mirrored values for + // the second half of the animation. Turns easeIn into easeInOut. + /*#__NO_SIDE_EFFECTS__*/ + const mirrorEasing = (easing) => (p) => p <= 0.5 ? easing(2 * p) / 2 : (2 - easing(2 * (1 - p))) / 2; + + // Accepts an easing function and returns a new one that outputs reversed values. + // Turns easeIn into easeOut. + /*#__NO_SIDE_EFFECTS__*/ + const reverseEasing = (easing) => (p) => 1 - easing(1 - p); + + const backOut = /*@__PURE__*/ cubicBezier(0.33, 1.53, 0.69, 0.99); + const backIn = /*@__PURE__*/ reverseEasing(backOut); + const backInOut = /*@__PURE__*/ mirrorEasing(backIn); + + const anticipate = (p) => p >= 1 + ? 1 + : (p *= 2) < 1 + ? 0.5 * backIn(p) + : 0.5 * (2 - Math.pow(2, -10 * (p - 1))); + + const circIn = (p) => 1 - Math.sin(Math.acos(p)); + const circOut = reverseEasing(circIn); + const circInOut = mirrorEasing(circIn); + + const easeIn = /*@__PURE__*/ cubicBezier(0.42, 0, 1, 1); + const easeOut = /*@__PURE__*/ cubicBezier(0, 0, 0.58, 1); + const easeInOut = /*@__PURE__*/ cubicBezier(0.42, 0, 0.58, 1); + + /*#__NO_SIDE_EFFECTS__*/ + function steps(numSteps, direction = "end") { + return (progress) => { + progress = + direction === "end" + ? Math.min(progress, 0.999) + : Math.max(progress, 0.001); + const expanded = progress * numSteps; + const rounded = direction === "end" ? Math.floor(expanded) : Math.ceil(expanded); + return clamp(0, 1, rounded / numSteps); + }; + } + + /*#__NO_SIDE_EFFECTS__*/ + const isEasingArray = (ease) => { + return Array.isArray(ease) && typeof ease[0] !== "number"; + }; + + /*#__NO_SIDE_EFFECTS__*/ + function getEasingForSegment(easing, i) { + return isEasingArray(easing) ? easing[wrap(0, easing.length, i)] : easing; + } + + /*#__NO_SIDE_EFFECTS__*/ + const isBezierDefinition = (easing) => Array.isArray(easing) && typeof easing[0] === "number"; + + const easingLookup = { + linear: noop, + easeIn, + easeInOut, + easeOut, + circIn, + circInOut, + circOut, + backIn, + backInOut, + backOut, + anticipate, + }; + const isValidEasing = (easing) => { + return typeof easing === "string"; + }; + const easingDefinitionToFunction = (definition) => { + if (isBezierDefinition(definition)) { + // If cubic bezier definition, create bezier curve + exports.invariant(definition.length === 4, `Cubic bezier arrays must contain four numerical values.`, "cubic-bezier-length"); + const [x1, y1, x2, y2] = definition; + return cubicBezier(x1, y1, x2, y2); + } + else if (isValidEasing(definition)) { + // Else lookup from table + exports.invariant(easingLookup[definition] !== undefined, `Invalid easing type '${definition}'`, "invalid-easing-type"); + return easingLookup[definition]; + } + return definition; + }; + + const stepsOrder = [ + "setup", // Compute + "read", // Read + "resolveKeyframes", // Write/Read/Write/Read + "preUpdate", // Compute + "update", // Compute + "preRender", // Compute + "render", // Write + "postRender", // Compute + ]; + + function createRenderStep(runNextFrame) { + /** + * We create and reuse two queues, one to queue jobs for the current frame + * and one for the next. We reuse to avoid triggering GC after x frames. + */ + let thisFrame = new Set(); + let nextFrame = new Set(); + /** + * Track whether we're currently processing jobs in this step. This way + * we can decide whether to schedule new jobs for this frame or next. + */ + let isProcessing = false; + let flushNextFrame = false; + /** + * A set of processes which were marked keepAlive when scheduled. + */ + const toKeepAlive = new WeakSet(); + let latestFrameData = { + delta: 0.0, + timestamp: 0.0, + isProcessing: false, + }; + function triggerCallback(callback) { + if (toKeepAlive.has(callback)) { + step.schedule(callback); + runNextFrame(); + } + callback(latestFrameData); + } + const step = { + /** + * Schedule a process to run on the next frame. + */ + schedule: (callback, keepAlive = false, immediate = false) => { + const addToCurrentFrame = immediate && isProcessing; + const queue = addToCurrentFrame ? thisFrame : nextFrame; + if (keepAlive) + toKeepAlive.add(callback); + queue.add(callback); + return callback; + }, + /** + * Cancel the provided callback from running on the next frame. + */ + cancel: (callback) => { + nextFrame.delete(callback); + toKeepAlive.delete(callback); + }, + /** + * Execute all schedule callbacks. + */ + process: (frameData) => { + latestFrameData = frameData; + /** + * If we're already processing we've probably been triggered by a flushSync + * inside an existing process. Instead of executing, mark flushNextFrame + * as true and ensure we flush the following frame at the end of this one. + */ + if (isProcessing) { + flushNextFrame = true; + return; + } + isProcessing = true; + // Swap this frame and the next to avoid GC + const prevFrame = thisFrame; + thisFrame = nextFrame; + nextFrame = prevFrame; + // Execute this frame + thisFrame.forEach(triggerCallback); + // Clear the frame so no callbacks remain. This is to avoid + // memory leaks should this render step not run for a while. + thisFrame.clear(); + isProcessing = false; + if (flushNextFrame) { + flushNextFrame = false; + step.process(frameData); + } + }, + }; + return step; + } + + const maxElapsed$1 = 40; + function createRenderBatcher(scheduleNextBatch, allowKeepAlive) { + let runNextFrame = false; + let useDefaultElapsed = true; + const state = { + delta: 0.0, + timestamp: 0.0, + isProcessing: false, + }; + const flagRunNextFrame = () => (runNextFrame = true); + const steps = stepsOrder.reduce((acc, key) => { + acc[key] = createRenderStep(flagRunNextFrame); + return acc; + }, {}); + const { setup, read, resolveKeyframes, preUpdate, update, preRender, render, postRender, } = steps; + const processBatch = () => { + const useManualTiming = MotionGlobalConfig.useManualTiming; + const timestamp = useManualTiming + ? state.timestamp + : performance.now(); + runNextFrame = false; + if (!useManualTiming) { + state.delta = useDefaultElapsed + ? 1000 / 60 + : Math.max(Math.min(timestamp - state.timestamp, maxElapsed$1), 1); + } + state.timestamp = timestamp; + state.isProcessing = true; + // Unrolled render loop for better per-frame performance + setup.process(state); + read.process(state); + resolveKeyframes.process(state); + preUpdate.process(state); + update.process(state); + preRender.process(state); + render.process(state); + postRender.process(state); + state.isProcessing = false; + if (runNextFrame && allowKeepAlive) { + useDefaultElapsed = false; + scheduleNextBatch(processBatch); + } + }; + const wake = () => { + runNextFrame = true; + useDefaultElapsed = true; + if (!state.isProcessing) { + scheduleNextBatch(processBatch); + } + }; + const schedule = stepsOrder.reduce((acc, key) => { + const step = steps[key]; + acc[key] = (process, keepAlive = false, immediate = false) => { + if (!runNextFrame) + wake(); + return step.schedule(process, keepAlive, immediate); + }; + return acc; + }, {}); + const cancel = (process) => { + for (let i = 0; i < stepsOrder.length; i++) { + steps[stepsOrder[i]].cancel(process); + } + }; + return { schedule, cancel, state, steps }; + } + + const { schedule: frame, cancel: cancelFrame, state: frameData, steps: frameSteps, } = /* @__PURE__ */ createRenderBatcher(typeof requestAnimationFrame !== "undefined" ? requestAnimationFrame : noop, true); + + let now; + function clearTime() { + now = undefined; + } + /** + * An eventloop-synchronous alternative to performance.now(). + * + * Ensures that time measurements remain consistent within a synchronous context. + * Usually calling performance.now() twice within the same synchronous context + * will return different values which isn't useful for animations when we're usually + * trying to sync animations to the same frame. + */ + const time = { + now: () => { + if (now === undefined) { + time.set(frameData.isProcessing || MotionGlobalConfig.useManualTiming + ? frameData.timestamp + : performance.now()); + } + return now; + }, + set: (newTime) => { + now = newTime; + queueMicrotask(clearTime); + }, + }; + + const checkStringStartsWith = (token) => (key) => typeof key === "string" && key.startsWith(token); + const isCSSVariableName = + /*@__PURE__*/ checkStringStartsWith("--"); + const startsAsVariableToken = + /*@__PURE__*/ checkStringStartsWith("var(--"); + const isCSSVariableToken = (value) => { + const startsWithToken = startsAsVariableToken(value); + if (!startsWithToken) + return false; + // Ensure any comments are stripped from the value as this can harm performance of the regex. + return singleCssVariableRegex.test(value.split("/*")[0].trim()); + }; + const singleCssVariableRegex = /var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu; + /** + * Check if a value contains a CSS variable anywhere (e.g. inside calc()). + * Unlike isCSSVariableToken which checks if the value IS a var() token, + * this checks if the value CONTAINS var() somewhere in the string. + */ + function containsCSSVariable(value) { + if (typeof value !== "string") + return false; + // Strip comments to avoid false positives + return value.split("/*")[0].includes("var(--"); + } + + const number = { + test: (v) => typeof v === "number", + parse: parseFloat, + transform: (v) => v, + }; + const alpha = { + ...number, + transform: (v) => clamp(0, 1, v), + }; + const scale = { + ...number, + default: 1, + }; + + // If this number is a decimal, make it just five decimal places + // to avoid exponents + const sanitize = (v) => Math.round(v * 100000) / 100000; + + const floatRegex = /-?(?:\d+(?:\.\d+)?|\.\d+)/gu; + + function isNullish(v) { + return v == null; + } + + const singleColorRegex = /^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu; + + /** + * Returns true if the provided string is a color, ie rgba(0,0,0,0) or #000, + * but false if a number or multiple colors + */ + const isColorString = (type, testProp) => (v) => { + return Boolean((typeof v === "string" && + singleColorRegex.test(v) && + v.startsWith(type)) || + (testProp && + !isNullish(v) && + Object.prototype.hasOwnProperty.call(v, testProp))); + }; + const splitColor = (aName, bName, cName) => (v) => { + if (typeof v !== "string") + return v; + const [a, b, c, alpha] = v.match(floatRegex); + return { + [aName]: parseFloat(a), + [bName]: parseFloat(b), + [cName]: parseFloat(c), + alpha: alpha !== undefined ? parseFloat(alpha) : 1, + }; + }; + + const clampRgbUnit = (v) => clamp(0, 255, v); + const rgbUnit = { + ...number, + transform: (v) => Math.round(clampRgbUnit(v)), + }; + const rgba = { + test: /*@__PURE__*/ isColorString("rgb", "red"), + parse: /*@__PURE__*/ splitColor("red", "green", "blue"), + transform: ({ red, green, blue, alpha: alpha$1 = 1 }) => "rgba(" + + rgbUnit.transform(red) + + ", " + + rgbUnit.transform(green) + + ", " + + rgbUnit.transform(blue) + + ", " + + sanitize(alpha.transform(alpha$1)) + + ")", + }; + + function parseHex(v) { + let r = ""; + let g = ""; + let b = ""; + let a = ""; + // If we have 6 characters, ie #FF0000 + if (v.length > 5) { + r = v.substring(1, 3); + g = v.substring(3, 5); + b = v.substring(5, 7); + a = v.substring(7, 9); + // Or we have 3 characters, ie #F00 + } + else { + r = v.substring(1, 2); + g = v.substring(2, 3); + b = v.substring(3, 4); + a = v.substring(4, 5); + r += r; + g += g; + b += b; + a += a; + } + return { + red: parseInt(r, 16), + green: parseInt(g, 16), + blue: parseInt(b, 16), + alpha: a ? parseInt(a, 16) / 255 : 1, + }; + } + const hex = { + test: /*@__PURE__*/ isColorString("#"), + parse: parseHex, + transform: rgba.transform, + }; + + /*#__NO_SIDE_EFFECTS__*/ + const createUnitType = (unit) => ({ + test: (v) => typeof v === "string" && v.endsWith(unit) && v.split(" ").length === 1, + parse: parseFloat, + transform: (v) => `${v}${unit}`, + }); + const degrees = /*@__PURE__*/ createUnitType("deg"); + const percent = /*@__PURE__*/ createUnitType("%"); + const px = /*@__PURE__*/ createUnitType("px"); + const vh = /*@__PURE__*/ createUnitType("vh"); + const vw = /*@__PURE__*/ createUnitType("vw"); + const progressPercentage = /*@__PURE__*/ (() => ({ + ...percent, + parse: (v) => percent.parse(v) / 100, + transform: (v) => percent.transform(v * 100), + }))(); + + const hsla = { + test: /*@__PURE__*/ isColorString("hsl", "hue"), + parse: /*@__PURE__*/ splitColor("hue", "saturation", "lightness"), + transform: ({ hue, saturation, lightness, alpha: alpha$1 = 1 }) => { + return ("hsla(" + + Math.round(hue) + + ", " + + percent.transform(sanitize(saturation)) + + ", " + + percent.transform(sanitize(lightness)) + + ", " + + sanitize(alpha.transform(alpha$1)) + + ")"); + }, + }; + + const color = { + test: (v) => rgba.test(v) || hex.test(v) || hsla.test(v), + parse: (v) => { + if (rgba.test(v)) { + return rgba.parse(v); + } + else if (hsla.test(v)) { + return hsla.parse(v); + } + else { + return hex.parse(v); + } + }, + transform: (v) => { + return typeof v === "string" + ? v + : v.hasOwnProperty("red") + ? rgba.transform(v) + : hsla.transform(v); + }, + getAnimatableNone: (v) => { + const parsed = color.parse(v); + parsed.alpha = 0; + return color.transform(parsed); + }, + }; + + const colorRegex = /(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu; + + function test(v) { + return (isNaN(v) && + typeof v === "string" && + (v.match(floatRegex)?.length || 0) + + (v.match(colorRegex)?.length || 0) > + 0); + } + const NUMBER_TOKEN = "number"; + const COLOR_TOKEN = "color"; + const VAR_TOKEN = "var"; + const VAR_FUNCTION_TOKEN = "var("; + const SPLIT_TOKEN = "${}"; + // this regex consists of the `singleCssVariableRegex|rgbHSLValueRegex|digitRegex` + const complexRegex = /var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu; + function analyseComplexValue(value) { + const originalValue = value.toString(); + const values = []; + const indexes = { + color: [], + number: [], + var: [], + }; + const types = []; + let i = 0; + const tokenised = originalValue.replace(complexRegex, (parsedValue) => { + if (color.test(parsedValue)) { + indexes.color.push(i); + types.push(COLOR_TOKEN); + values.push(color.parse(parsedValue)); + } + else if (parsedValue.startsWith(VAR_FUNCTION_TOKEN)) { + indexes.var.push(i); + types.push(VAR_TOKEN); + values.push(parsedValue); + } + else { + indexes.number.push(i); + types.push(NUMBER_TOKEN); + values.push(parseFloat(parsedValue)); + } + ++i; + return SPLIT_TOKEN; + }); + const split = tokenised.split(SPLIT_TOKEN); + return { values, split, indexes, types }; + } + function parseComplexValue(v) { + return analyseComplexValue(v).values; + } + function buildTransformer({ split, types }) { + const numSections = split.length; + return (v) => { + let output = ""; + for (let i = 0; i < numSections; i++) { + output += split[i]; + if (v[i] !== undefined) { + const type = types[i]; + if (type === NUMBER_TOKEN) { + output += sanitize(v[i]); + } + else if (type === COLOR_TOKEN) { + output += color.transform(v[i]); + } + else { + output += v[i]; + } + } + } + return output; + }; + } + function createTransformer(source) { + return buildTransformer(analyseComplexValue(source)); + } + const convertNumbersToZero = (v) => typeof v === "number" ? 0 : color.test(v) ? color.getAnimatableNone(v) : v; + /** + * Convert a parsed value to its zero equivalent, but preserve numbers + * that act as divisors in CSS calc() expressions. + * + * analyseComplexValue extracts numbers from CSS strings and puts the + * surrounding text into a `split` template array. For example: + * "calc(var(--gap) / 5)" → values: [var(--gap), 5] + * split: ["calc(", " / ", ")"] + * + * When building a zero-equivalent for animation, naively zeroing all + * numbers turns the divisor into 0 → "calc(var(--gap) / 0)" → NaN. + * We detect this by checking whether the text preceding a number + * (split[i]) ends with "/" — the CSS calc division operator. + */ + const convertToZero = (value, splitBefore) => { + if (typeof value === "number") { + return splitBefore?.trim().endsWith("/") ? value : 0; + } + return convertNumbersToZero(value); + }; + function getAnimatableNone$1(v) { + const info = analyseComplexValue(v); + const transformer = buildTransformer(info); + return transformer(info.values.map((value, i) => convertToZero(value, info.split[i]))); + } + const complex = { + test, + parse: parseComplexValue, + createTransformer, + getAnimatableNone: getAnimatableNone$1, + }; + + // Adapted from https://gist.github.com/mjackson/5311256 + function hueToRgb(p, q, t) { + if (t < 0) + t += 1; + if (t > 1) + t -= 1; + if (t < 1 / 6) + return p + (q - p) * 6 * t; + if (t < 1 / 2) + return q; + if (t < 2 / 3) + return p + (q - p) * (2 / 3 - t) * 6; + return p; + } + function hslaToRgba({ hue, saturation, lightness, alpha }) { + hue /= 360; + saturation /= 100; + lightness /= 100; + let red = 0; + let green = 0; + let blue = 0; + if (!saturation) { + red = green = blue = lightness; + } + else { + const q = lightness < 0.5 + ? lightness * (1 + saturation) + : lightness + saturation - lightness * saturation; + const p = 2 * lightness - q; + red = hueToRgb(p, q, hue + 1 / 3); + green = hueToRgb(p, q, hue); + blue = hueToRgb(p, q, hue - 1 / 3); + } + return { + red: Math.round(red * 255), + green: Math.round(green * 255), + blue: Math.round(blue * 255), + alpha, + }; + } + + function mixImmediate(a, b) { + return (p) => (p > 0 ? b : a); + } + + /* + Value in range from progress + + Given a lower limit and an upper limit, we return the value within + that range as expressed by progress (usually a number from 0 to 1) + + So progress = 0.5 would change + + from -------- to + + to + + from ---- to + + E.g. from = 10, to = 20, progress = 0.5 => 15 + + @param [number]: Lower limit of range + @param [number]: Upper limit of range + @param [number]: The progress between lower and upper limits expressed 0-1 + @return [number]: Value as calculated from progress within range (not limited within range) + */ + const mixNumber$1 = (from, to, progress) => { + return from + (to - from) * progress; + }; + + // Linear color space blending + // Explained https://www.youtube.com/watch?v=LKnqECcg6Gw + // Demonstrated http://codepen.io/osublake/pen/xGVVaN + const mixLinearColor = (from, to, v) => { + const fromExpo = from * from; + const expo = v * (to * to - fromExpo) + fromExpo; + return expo < 0 ? 0 : Math.sqrt(expo); + }; + const colorTypes = [hex, rgba, hsla]; + const getColorType = (v) => colorTypes.find((type) => type.test(v)); + function asRGBA(color) { + const type = getColorType(color); + exports.warning(Boolean(type), `'${color}' is not an animatable color. Use the equivalent color code instead.`, "color-not-animatable"); + if (!Boolean(type)) + return false; + let model = type.parse(color); + if (type === hsla) { + // TODO Remove this cast - needed since Motion's stricter typing + model = hslaToRgba(model); + } + return model; + } + const mixColor = (from, to) => { + const fromRGBA = asRGBA(from); + const toRGBA = asRGBA(to); + if (!fromRGBA || !toRGBA) { + return mixImmediate(from, to); + } + const blended = { ...fromRGBA }; + return (v) => { + blended.red = mixLinearColor(fromRGBA.red, toRGBA.red, v); + blended.green = mixLinearColor(fromRGBA.green, toRGBA.green, v); + blended.blue = mixLinearColor(fromRGBA.blue, toRGBA.blue, v); + blended.alpha = mixNumber$1(fromRGBA.alpha, toRGBA.alpha, v); + return rgba.transform(blended); + }; + }; + + const invisibleValues = new Set(["none", "hidden"]); + /** + * Returns a function that, when provided a progress value between 0 and 1, + * will return the "none" or "hidden" string only when the progress is that of + * the origin or target. + */ + function mixVisibility(origin, target) { + if (invisibleValues.has(origin)) { + return (p) => (p <= 0 ? origin : target); + } + else { + return (p) => (p >= 1 ? target : origin); + } + } + + function mixNumber(a, b) { + return (p) => mixNumber$1(a, b, p); + } + function getMixer(a) { + if (typeof a === "number") { + return mixNumber; + } + else if (typeof a === "string") { + return isCSSVariableToken(a) + ? mixImmediate + : color.test(a) + ? mixColor + : mixComplex; + } + else if (Array.isArray(a)) { + return mixArray; + } + else if (typeof a === "object") { + return color.test(a) ? mixColor : mixObject; + } + return mixImmediate; + } + function mixArray(a, b) { + const output = [...a]; + const numValues = output.length; + const blendValue = a.map((v, i) => getMixer(v)(v, b[i])); + return (p) => { + for (let i = 0; i < numValues; i++) { + output[i] = blendValue[i](p); + } + return output; + }; + } + function mixObject(a, b) { + const output = { ...a, ...b }; + const blendValue = {}; + for (const key in output) { + if (a[key] !== undefined && b[key] !== undefined) { + blendValue[key] = getMixer(a[key])(a[key], b[key]); + } + } + return (v) => { + for (const key in blendValue) { + output[key] = blendValue[key](v); + } + return output; + }; + } + function matchOrder(origin, target) { + const orderedOrigin = []; + const pointers = { color: 0, var: 0, number: 0 }; + for (let i = 0; i < target.values.length; i++) { + const type = target.types[i]; + const originIndex = origin.indexes[type][pointers[type]]; + const originValue = origin.values[originIndex] ?? 0; + orderedOrigin[i] = originValue; + pointers[type]++; + } + return orderedOrigin; + } + const mixComplex = (origin, target) => { + const template = complex.createTransformer(target); + const originStats = analyseComplexValue(origin); + const targetStats = analyseComplexValue(target); + const canInterpolate = originStats.indexes.var.length === targetStats.indexes.var.length && + originStats.indexes.color.length === targetStats.indexes.color.length && + originStats.indexes.number.length >= targetStats.indexes.number.length; + if (canInterpolate) { + if ((invisibleValues.has(origin) && + !targetStats.values.length) || + (invisibleValues.has(target) && + !originStats.values.length)) { + return mixVisibility(origin, target); + } + return pipe(mixArray(matchOrder(originStats, targetStats), targetStats.values), template); + } + else { + exports.warning(true, `Complex values '${origin}' and '${target}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`, "complex-values-different"); + return mixImmediate(origin, target); + } + }; + + function mix(from, to, p) { + if (typeof from === "number" && + typeof to === "number" && + typeof p === "number") { + return mixNumber$1(from, to, p); + } + const mixer = getMixer(from); + return mixer(from, to); + } + + const frameloopDriver = (update) => { + const passTimestamp = ({ timestamp }) => update(timestamp); + return { + start: (keepAlive = true) => frame.update(passTimestamp, keepAlive), + stop: () => cancelFrame(passTimestamp), + /** + * If we're processing this frame we can use the + * framelocked timestamp to keep things in sync. + */ + now: () => (frameData.isProcessing ? frameData.timestamp : time.now()), + }; + }; + + const generateLinearEasing = (easing, duration, // as milliseconds + resolution = 10 // as milliseconds + ) => { + let points = ""; + const numPoints = Math.max(Math.round(duration / resolution), 2); + for (let i = 0; i < numPoints; i++) { + points += Math.round(easing(i / (numPoints - 1)) * 10000) / 10000 + ", "; + } + return `linear(${points.substring(0, points.length - 2)})`; + }; + + /** + * Implement a practical max duration for keyframe generation + * to prevent infinite loops + */ + const maxGeneratorDuration = 20000; + function calcGeneratorDuration(generator) { + let duration = 0; + const timeStep = 50; + let state = generator.next(duration); + while (!state.done && duration < maxGeneratorDuration) { + duration += timeStep; + state = generator.next(duration); + } + return duration >= maxGeneratorDuration ? Infinity : duration; + } + + /** + * Create a progress => progress easing function from a generator. + */ + function createGeneratorEasing(options, scale = 100, createGenerator) { + const generator = createGenerator({ ...options, keyframes: [0, scale] }); + const duration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration); + return { + type: "keyframes", + ease: (progress) => { + return generator.next(duration * progress).value / scale; + }, + duration: millisecondsToSeconds(duration), + }; + } + + const springDefaults = { + // Default spring physics + stiffness: 100, + damping: 10, + mass: 1.0, + velocity: 0.0, + // Default duration/bounce-based options + duration: 800, // in ms + bounce: 0.3, + visualDuration: 0.3, // in seconds + // Rest thresholds + restSpeed: { + granular: 0.01, + default: 2, + }, + restDelta: { + granular: 0.005, + default: 0.5, + }, + // Limits + minDuration: 0.01, // in seconds + maxDuration: 10.0, // in seconds + minDamping: 0.05, + maxDamping: 1, + }; + function calcAngularFreq(undampedFreq, dampingRatio) { + return undampedFreq * Math.sqrt(1 - dampingRatio * dampingRatio); + } + const rootIterations = 12; + function approximateRoot(envelope, derivative, initialGuess) { + let result = initialGuess; + for (let i = 1; i < rootIterations; i++) { + result = result - envelope(result) / derivative(result); + } + return result; + } + /** + * This is ported from the Framer implementation of duration-based spring resolution. + */ + const safeMin = 0.001; + function findSpring({ duration = springDefaults.duration, bounce = springDefaults.bounce, velocity = springDefaults.velocity, mass = springDefaults.mass, }) { + let envelope; + let derivative; + exports.warning(duration <= secondsToMilliseconds(springDefaults.maxDuration), "Spring duration must be 10 seconds or less", "spring-duration-limit"); + let dampingRatio = 1 - bounce; + /** + * Restrict dampingRatio and duration to within acceptable ranges. + */ + dampingRatio = clamp(springDefaults.minDamping, springDefaults.maxDamping, dampingRatio); + duration = clamp(springDefaults.minDuration, springDefaults.maxDuration, millisecondsToSeconds(duration)); + if (dampingRatio < 1) { + /** + * Underdamped spring + */ + envelope = (undampedFreq) => { + const exponentialDecay = undampedFreq * dampingRatio; + const delta = exponentialDecay * duration; + const a = exponentialDecay - velocity; + const b = calcAngularFreq(undampedFreq, dampingRatio); + const c = Math.exp(-delta); + return safeMin - (a / b) * c; + }; + derivative = (undampedFreq) => { + const exponentialDecay = undampedFreq * dampingRatio; + const delta = exponentialDecay * duration; + const d = delta * velocity + velocity; + const e = Math.pow(dampingRatio, 2) * Math.pow(undampedFreq, 2) * duration; + const f = Math.exp(-delta); + const g = calcAngularFreq(Math.pow(undampedFreq, 2), dampingRatio); + const factor = -envelope(undampedFreq) + safeMin > 0 ? -1 : 1; + return (factor * ((d - e) * f)) / g; + }; + } + else { + /** + * Critically-damped spring + */ + envelope = (undampedFreq) => { + const a = Math.exp(-undampedFreq * duration); + const b = (undampedFreq - velocity) * duration + 1; + return -safeMin + a * b; + }; + derivative = (undampedFreq) => { + const a = Math.exp(-undampedFreq * duration); + const b = (velocity - undampedFreq) * (duration * duration); + return a * b; + }; + } + const initialGuess = 5 / duration; + const undampedFreq = approximateRoot(envelope, derivative, initialGuess); + duration = secondsToMilliseconds(duration); + if (isNaN(undampedFreq)) { + return { + stiffness: springDefaults.stiffness, + damping: springDefaults.damping, + duration, + }; + } + else { + const stiffness = Math.pow(undampedFreq, 2) * mass; + return { + stiffness, + damping: dampingRatio * 2 * Math.sqrt(mass * stiffness), + duration, + }; + } + } + const durationKeys = ["duration", "bounce"]; + const physicsKeys = ["stiffness", "damping", "mass"]; + function isSpringType(options, keys) { + return keys.some((key) => options[key] !== undefined); + } + function getSpringOptions(options) { + let springOptions = { + velocity: springDefaults.velocity, + stiffness: springDefaults.stiffness, + damping: springDefaults.damping, + mass: springDefaults.mass, + isResolvedFromDuration: false, + ...options, + }; + // stiffness/damping/mass overrides duration/bounce + if (!isSpringType(options, physicsKeys) && + isSpringType(options, durationKeys)) { + // Time-defined springs should ignore inherited velocity. + // Velocity from interrupted animations can cause findSpring() + // to compute wildly different spring parameters, leading to + // massive oscillation on small-range animations. + springOptions.velocity = 0; + if (options.visualDuration) { + const visualDuration = options.visualDuration; + const root = (2 * Math.PI) / (visualDuration * 1.2); + const stiffness = root * root; + const damping = 2 * + clamp(0.05, 1, 1 - (options.bounce || 0)) * + Math.sqrt(stiffness); + springOptions = { + ...springOptions, + mass: springDefaults.mass, + stiffness, + damping, + }; + } + else { + const derived = findSpring({ ...options, velocity: 0 }); + springOptions = { + ...springOptions, + ...derived, + mass: springDefaults.mass, + }; + springOptions.isResolvedFromDuration = true; + } + } + return springOptions; + } + function spring(optionsOrVisualDuration = springDefaults.visualDuration, bounce = springDefaults.bounce) { + const options = typeof optionsOrVisualDuration !== "object" + ? { + visualDuration: optionsOrVisualDuration, + keyframes: [0, 1], + bounce, + } + : optionsOrVisualDuration; + let { restSpeed, restDelta } = options; + const origin = options.keyframes[0]; + const target = options.keyframes[options.keyframes.length - 1]; + /** + * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator + * to reduce GC during animation. + */ + const state = { done: false, value: origin }; + const { stiffness, damping, mass, duration, velocity, isResolvedFromDuration, } = getSpringOptions({ + ...options, + velocity: -millisecondsToSeconds(options.velocity || 0), + }); + const initialVelocity = velocity || 0.0; + const dampingRatio = damping / (2 * Math.sqrt(stiffness * mass)); + const initialDelta = target - origin; + const undampedAngularFreq = millisecondsToSeconds(Math.sqrt(stiffness / mass)); + /** + * If we're working on a granular scale, use smaller defaults for determining + * when the spring is finished. + * + * These defaults have been selected emprically based on what strikes a good + * ratio between feeling good and finishing as soon as changes are imperceptible. + */ + const isGranularScale = Math.abs(initialDelta) < 5; + restSpeed || (restSpeed = isGranularScale + ? springDefaults.restSpeed.granular + : springDefaults.restSpeed.default); + restDelta || (restDelta = isGranularScale + ? springDefaults.restDelta.granular + : springDefaults.restDelta.default); + let resolveSpring; + let resolveVelocity; + // Underdamped coefficients, hoisted for use in the inlined next() hot path + let angularFreq; + let A; + let sinCoeff; + let cosCoeff; + if (dampingRatio < 1) { + angularFreq = calcAngularFreq(undampedAngularFreq, dampingRatio); + A = + (initialVelocity + + dampingRatio * undampedAngularFreq * initialDelta) / + angularFreq; + // Underdamped spring + resolveSpring = (t) => { + const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); + return (target - + envelope * + (A * Math.sin(angularFreq * t) + + initialDelta * Math.cos(angularFreq * t))); + }; + // Analytical derivative of underdamped spring (px/ms) + sinCoeff = + dampingRatio * undampedAngularFreq * A + initialDelta * angularFreq; + cosCoeff = + dampingRatio * undampedAngularFreq * initialDelta - A * angularFreq; + resolveVelocity = (t) => { + const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); + return envelope * + (sinCoeff * Math.sin(angularFreq * t) + + cosCoeff * Math.cos(angularFreq * t)); + }; + } + else if (dampingRatio === 1) { + // Critically damped spring + resolveSpring = (t) => target - + Math.exp(-undampedAngularFreq * t) * + (initialDelta + + (initialVelocity + undampedAngularFreq * initialDelta) * t); + // Analytical derivative of critically damped spring (px/ms) + const C = initialVelocity + undampedAngularFreq * initialDelta; + resolveVelocity = (t) => Math.exp(-undampedAngularFreq * t) * + (undampedAngularFreq * C * t - initialVelocity); + } + else { + // Overdamped spring + const dampedAngularFreq = undampedAngularFreq * Math.sqrt(dampingRatio * dampingRatio - 1); + resolveSpring = (t) => { + const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); + // When performing sinh or cosh values can hit Infinity so we cap them here + const freqForT = Math.min(dampedAngularFreq * t, 300); + return (target - + (envelope * + ((initialVelocity + + dampingRatio * undampedAngularFreq * initialDelta) * + Math.sinh(freqForT) + + dampedAngularFreq * + initialDelta * + Math.cosh(freqForT))) / + dampedAngularFreq); + }; + // Analytical derivative of overdamped spring (px/ms) + const P = (initialVelocity + + dampingRatio * undampedAngularFreq * initialDelta) / + dampedAngularFreq; + const sinhCoeff = dampingRatio * undampedAngularFreq * P - initialDelta * dampedAngularFreq; + const coshCoeff = dampingRatio * undampedAngularFreq * initialDelta - P * dampedAngularFreq; + resolveVelocity = (t) => { + const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); + const freqForT = Math.min(dampedAngularFreq * t, 300); + return envelope * + (sinhCoeff * Math.sinh(freqForT) + + coshCoeff * Math.cosh(freqForT)); + }; + } + const generator = { + calculatedDuration: isResolvedFromDuration ? duration || null : null, + velocity: (t) => secondsToMilliseconds(resolveVelocity(t)), + next: (t) => { + /** + * For underdamped physics springs we need both position and + * velocity each tick. Compute shared trig values once to avoid + * duplicate Math.exp/sin/cos calls on the hot path. + */ + if (!isResolvedFromDuration && dampingRatio < 1) { + const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); + const sin = Math.sin(angularFreq * t); + const cos = Math.cos(angularFreq * t); + const current = target - + envelope * + (A * sin + initialDelta * cos); + const currentVelocity = secondsToMilliseconds(envelope * + (sinCoeff * sin + cosCoeff * cos)); + state.done = + Math.abs(currentVelocity) <= restSpeed && + Math.abs(target - current) <= restDelta; + state.value = state.done ? target : current; + return state; + } + const current = resolveSpring(t); + if (!isResolvedFromDuration) { + const currentVelocity = secondsToMilliseconds(resolveVelocity(t)); + state.done = + Math.abs(currentVelocity) <= restSpeed && + Math.abs(target - current) <= restDelta; + } + else { + state.done = t >= duration; + } + state.value = state.done ? target : current; + return state; + }, + toString: () => { + const calculatedDuration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration); + const easing = generateLinearEasing((progress) => generator.next(calculatedDuration * progress).value, calculatedDuration, 30); + return calculatedDuration + "ms " + easing; + }, + toTransition: () => { }, + }; + return generator; + } + spring.applyToOptions = (options) => { + const generatorOptions = createGeneratorEasing(options, 100, spring); + options.ease = generatorOptions.ease; + options.duration = secondsToMilliseconds(generatorOptions.duration); + options.type = "keyframes"; + return options; + }; + + const velocitySampleDuration = 5; // ms + function getGeneratorVelocity(resolveValue, t, current) { + const prevT = Math.max(t - velocitySampleDuration, 0); + return velocityPerSecond(current - resolveValue(prevT), t - prevT); + } + + function inertia({ keyframes, velocity = 0.0, power = 0.8, timeConstant = 325, bounceDamping = 10, bounceStiffness = 500, modifyTarget, min, max, restDelta = 0.5, restSpeed, }) { + const origin = keyframes[0]; + const state = { + done: false, + value: origin, + }; + const isOutOfBounds = (v) => (min !== undefined && v < min) || (max !== undefined && v > max); + const nearestBoundary = (v) => { + if (min === undefined) + return max; + if (max === undefined) + return min; + return Math.abs(min - v) < Math.abs(max - v) ? min : max; + }; + let amplitude = power * velocity; + const ideal = origin + amplitude; + const target = modifyTarget === undefined ? ideal : modifyTarget(ideal); + /** + * If the target has changed we need to re-calculate the amplitude, otherwise + * the animation will start from the wrong position. + */ + if (target !== ideal) + amplitude = target - origin; + const calcDelta = (t) => -amplitude * Math.exp(-t / timeConstant); + const calcLatest = (t) => target + calcDelta(t); + const applyFriction = (t) => { + const delta = calcDelta(t); + const latest = calcLatest(t); + state.done = Math.abs(delta) <= restDelta; + state.value = state.done ? target : latest; + }; + /** + * Ideally this would resolve for t in a stateless way, we could + * do that by always precalculating the animation but as we know + * this will be done anyway we can assume that spring will + * be discovered during that. + */ + let timeReachedBoundary; + let spring$1; + const checkCatchBoundary = (t) => { + if (!isOutOfBounds(state.value)) + return; + timeReachedBoundary = t; + spring$1 = spring({ + keyframes: [state.value, nearestBoundary(state.value)], + velocity: getGeneratorVelocity(calcLatest, t, state.value), // TODO: This should be passing * 1000 + damping: bounceDamping, + stiffness: bounceStiffness, + restDelta, + restSpeed, + }); + }; + checkCatchBoundary(0); + return { + calculatedDuration: null, + next: (t) => { + /** + * We need to resolve the friction to figure out if we need a + * spring but we don't want to do this twice per frame. So here + * we flag if we updated for this frame and later if we did + * we can skip doing it again. + */ + let hasUpdatedFrame = false; + if (!spring$1 && timeReachedBoundary === undefined) { + hasUpdatedFrame = true; + applyFriction(t); + checkCatchBoundary(t); + } + /** + * If we have a spring and the provided t is beyond the moment the friction + * animation crossed the min/max boundary, use the spring. + */ + if (timeReachedBoundary !== undefined && t >= timeReachedBoundary) { + return spring$1.next(t - timeReachedBoundary); + } + else { + !hasUpdatedFrame && applyFriction(t); + return state; + } + }, + }; + } + + function createMixers(output, ease, customMixer) { + const mixers = []; + const mixerFactory = customMixer || MotionGlobalConfig.mix || mix; + const numMixers = output.length - 1; + for (let i = 0; i < numMixers; i++) { + let mixer = mixerFactory(output[i], output[i + 1]); + if (ease) { + const easingFunction = Array.isArray(ease) ? ease[i] || noop : ease; + mixer = pipe(easingFunction, mixer); + } + mixers.push(mixer); + } + return mixers; + } + /** + * Create a function that maps from a numerical input array to a generic output array. + * + * Accepts: + * - Numbers + * - Colors (hex, hsl, hsla, rgb, rgba) + * - Complex (combinations of one or more numbers or strings) + * + * ```jsx + * const mixColor = interpolate([0, 1], ['#fff', '#000']) + * + * mixColor(0.5) // 'rgba(128, 128, 128, 1)' + * ``` + * + * TODO Revisit this approach once we've moved to data models for values, + * probably not needed to pregenerate mixer functions. + * + * @public + */ + function interpolate(input, output, { clamp: isClamp = true, ease, mixer } = {}) { + const inputLength = input.length; + exports.invariant(inputLength === output.length, "Both input and output ranges must be the same length", "range-length"); + /** + * If we're only provided a single input, we can just make a function + * that returns the output. + */ + if (inputLength === 1) + return () => output[0]; + if (inputLength === 2 && output[0] === output[1]) + return () => output[1]; + const isZeroDeltaRange = input[0] === input[1]; + // If input runs highest -> lowest, reverse both arrays + if (input[0] > input[inputLength - 1]) { + input = [...input].reverse(); + output = [...output].reverse(); + } + const mixers = createMixers(output, ease, mixer); + const numMixers = mixers.length; + const interpolator = (v) => { + if (isZeroDeltaRange && v < input[0]) + return output[0]; + let i = 0; + if (numMixers > 1) { + for (; i < input.length - 2; i++) { + if (v < input[i + 1]) + break; + } + } + const progressInRange = progress(input[i], input[i + 1], v); + return mixers[i](progressInRange); + }; + return isClamp + ? (v) => interpolator(clamp(input[0], input[inputLength - 1], v)) + : interpolator; + } + + function fillOffset(offset, remaining) { + const min = offset[offset.length - 1]; + for (let i = 1; i <= remaining; i++) { + const offsetProgress = progress(0, remaining, i); + offset.push(mixNumber$1(min, 1, offsetProgress)); + } + } + + function defaultOffset$1(arr) { + const offset = [0]; + fillOffset(offset, arr.length - 1); + return offset; + } + + function convertOffsetToTimes(offset, duration) { + return offset.map((o) => o * duration); + } + + function defaultEasing(values, easing) { + return values.map(() => easing || easeInOut).splice(0, values.length - 1); + } + function keyframes({ duration = 300, keyframes: keyframeValues, times, ease = "easeInOut", }) { + /** + * Easing functions can be externally defined as strings. Here we convert them + * into actual functions. + */ + const easingFunctions = isEasingArray(ease) + ? ease.map(easingDefinitionToFunction) + : easingDefinitionToFunction(ease); + /** + * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator + * to reduce GC during animation. + */ + const state = { + done: false, + value: keyframeValues[0], + }; + /** + * Create a times array based on the provided 0-1 offsets + */ + const absoluteTimes = convertOffsetToTimes( + // Only use the provided offsets if they're the correct length + // TODO Maybe we should warn here if there's a length mismatch + times && times.length === keyframeValues.length + ? times + : defaultOffset$1(keyframeValues), duration); + const mapTimeToKeyframe = interpolate(absoluteTimes, keyframeValues, { + ease: Array.isArray(easingFunctions) + ? easingFunctions + : defaultEasing(keyframeValues, easingFunctions), + }); + return { + calculatedDuration: duration, + next: (t) => { + state.value = mapTimeToKeyframe(t); + state.done = t >= duration; + return state; + }, + }; + } + + const isNotNull = (value) => value !== null; + function getFinalKeyframe(keyframes, { repeat, repeatType = "loop" }, finalKeyframe, speed = 1) { + const resolvedKeyframes = keyframes.filter(isNotNull); + const useFirstKeyframe = speed < 0 || (repeat && repeatType !== "loop" && repeat % 2 === 1); + const index = useFirstKeyframe ? 0 : resolvedKeyframes.length - 1; + return !index || finalKeyframe === undefined + ? resolvedKeyframes[index] + : finalKeyframe; + } + + const transitionTypeMap = { + decay: inertia, + inertia, + tween: keyframes, + keyframes: keyframes, + spring, + }; + function replaceTransitionType(transition) { + if (typeof transition.type === "string") { + transition.type = transitionTypeMap[transition.type]; + } + } + + class WithPromise { + constructor() { + this.updateFinished(); + } + get finished() { + return this._finished; + } + updateFinished() { + this._finished = new Promise((resolve) => { + this.resolve = resolve; + }); + } + notifyFinished() { + this.resolve(); + } + /** + * Allows the animation to be awaited. + * + * @deprecated Use `finished` instead. + */ + then(onResolve, onReject) { + return this.finished.then(onResolve, onReject); + } + } + + const percentToProgress = (percent) => percent / 100; + class JSAnimation extends WithPromise { + constructor(options) { + super(); + this.state = "idle"; + this.startTime = null; + this.isStopped = false; + /** + * The current time of the animation. + */ + this.currentTime = 0; + /** + * The time at which the animation was paused. + */ + this.holdTime = null; + /** + * Playback speed as a factor. 0 would be stopped, -1 reverse and 2 double speed. + */ + this.playbackSpeed = 1; + /** + * Reusable state object for the delay phase to avoid + * allocating a new object every frame. + */ + this.delayState = { + done: false, + value: undefined, + }; + /** + * This method is bound to the instance to fix a pattern where + * animation.stop is returned as a reference from a useEffect. + */ + this.stop = () => { + const { motionValue } = this.options; + if (motionValue && motionValue.updatedAt !== time.now()) { + this.tick(time.now()); + } + this.isStopped = true; + if (this.state === "idle") + return; + this.teardown(); + this.options.onStop?.(); + }; + this.options = options; + this.initAnimation(); + this.play(); + if (options.autoplay === false) + this.pause(); + } + initAnimation() { + const { options } = this; + replaceTransitionType(options); + const { type = keyframes, repeat = 0, repeatDelay = 0, repeatType, velocity = 0, } = options; + let { keyframes: keyframes$1 } = options; + const generatorFactory = type || keyframes; + if (generatorFactory !== keyframes) { + exports.invariant(keyframes$1.length <= 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${keyframes$1}`, "spring-two-frames"); + } + if (generatorFactory !== keyframes && + typeof keyframes$1[0] !== "number") { + this.mixKeyframes = pipe(percentToProgress, mix(keyframes$1[0], keyframes$1[1])); + keyframes$1 = [0, 100]; + } + const generator = generatorFactory({ ...options, keyframes: keyframes$1 }); + /** + * If we have a mirror repeat type we need to create a second generator that outputs the + * mirrored (not reversed) animation and later ping pong between the two generators. + */ + if (repeatType === "mirror") { + this.mirroredGenerator = generatorFactory({ + ...options, + keyframes: [...keyframes$1].reverse(), + velocity: -velocity, + }); + } + /** + * If duration is undefined and we have repeat options, + * we need to calculate a duration from the generator. + * + * We set it to the generator itself to cache the duration. + * Any timeline resolver will need to have already precalculated + * the duration by this step. + */ + if (generator.calculatedDuration === null) { + generator.calculatedDuration = calcGeneratorDuration(generator); + } + const { calculatedDuration } = generator; + this.calculatedDuration = calculatedDuration; + this.resolvedDuration = calculatedDuration + repeatDelay; + this.totalDuration = this.resolvedDuration * (repeat + 1) - repeatDelay; + this.generator = generator; + } + updateTime(timestamp) { + const animationTime = Math.round(timestamp - this.startTime) * this.playbackSpeed; + // Update currentTime + if (this.holdTime !== null) { + this.currentTime = this.holdTime; + } + else { + // Rounding the time because floating point arithmetic is not always accurate, e.g. 3000.367 - 1000.367 = + // 2000.0000000000002. This is a problem when we are comparing the currentTime with the duration, for + // example. + this.currentTime = animationTime; + } + } + tick(timestamp, sample = false) { + const { generator, totalDuration, mixKeyframes, mirroredGenerator, resolvedDuration, calculatedDuration, } = this; + if (this.startTime === null) + return generator.next(0); + const { delay = 0, keyframes, repeat, repeatType, repeatDelay, type, onUpdate, finalKeyframe, } = this.options; + /** + * requestAnimationFrame timestamps can come through as lower than + * the startTime as set by performance.now(). Here we prevent this, + * though in the future it could be possible to make setting startTime + * a pending operation that gets resolved here. + */ + if (this.speed > 0) { + this.startTime = Math.min(this.startTime, timestamp); + } + else if (this.speed < 0) { + this.startTime = Math.min(timestamp - totalDuration / this.speed, this.startTime); + } + if (sample) { + this.currentTime = timestamp; + } + else { + this.updateTime(timestamp); + } + // Rebase on delay + const timeWithoutDelay = this.currentTime - delay * (this.playbackSpeed >= 0 ? 1 : -1); + const isInDelayPhase = this.playbackSpeed >= 0 + ? timeWithoutDelay < 0 + : timeWithoutDelay > totalDuration; + this.currentTime = Math.max(timeWithoutDelay, 0); + // If this animation has finished, set the current time to the total duration. + if (this.state === "finished" && this.holdTime === null) { + this.currentTime = totalDuration; + } + let elapsed = this.currentTime; + let frameGenerator = generator; + if (repeat) { + /** + * Get the current progress (0-1) of the animation. If t is > + * than duration we'll get values like 2.5 (midway through the + * third iteration) + */ + const progress = Math.min(this.currentTime, totalDuration) / resolvedDuration; + /** + * Get the current iteration (0 indexed). For instance the floor of + * 2.5 is 2. + */ + let currentIteration = Math.floor(progress); + /** + * Get the current progress of the iteration by taking the remainder + * so 2.5 is 0.5 through iteration 2 + */ + let iterationProgress = progress % 1.0; + /** + * If iteration progress is 1 we count that as the end + * of the previous iteration. + */ + if (!iterationProgress && progress >= 1) { + iterationProgress = 1; + } + iterationProgress === 1 && currentIteration--; + currentIteration = Math.min(currentIteration, repeat + 1); + /** + * Reverse progress if we're not running in "normal" direction + */ + const isOddIteration = Boolean(currentIteration % 2); + if (isOddIteration) { + if (repeatType === "reverse") { + iterationProgress = 1 - iterationProgress; + if (repeatDelay) { + iterationProgress -= repeatDelay / resolvedDuration; + } + } + else if (repeatType === "mirror") { + frameGenerator = mirroredGenerator; + } + } + elapsed = clamp(0, 1, iterationProgress) * resolvedDuration; + } + /** + * If we're in negative time, set state as the initial keyframe. + * This prevents delay: x, duration: 0 animations from finishing + * instantly. + */ + let state; + if (isInDelayPhase) { + this.delayState.value = keyframes[0]; + state = this.delayState; + } + else { + state = frameGenerator.next(elapsed); + } + if (mixKeyframes && !isInDelayPhase) { + state.value = mixKeyframes(state.value); + } + let { done } = state; + if (!isInDelayPhase && calculatedDuration !== null) { + done = + this.playbackSpeed >= 0 + ? this.currentTime >= totalDuration + : this.currentTime <= 0; + } + const isAnimationFinished = this.holdTime === null && + (this.state === "finished" || (this.state === "running" && done)); + // TODO: The exception for inertia could be cleaner here + if (isAnimationFinished && type !== inertia) { + state.value = getFinalKeyframe(keyframes, this.options, finalKeyframe, this.speed); + } + if (onUpdate) { + onUpdate(state.value); + } + if (isAnimationFinished) { + this.finish(); + } + return state; + } + /** + * Allows the returned animation to be awaited or promise-chained. Currently + * resolves when the animation finishes at all but in a future update could/should + * reject if its cancels. + */ + then(resolve, reject) { + return this.finished.then(resolve, reject); + } + get duration() { + return millisecondsToSeconds(this.calculatedDuration); + } + get iterationDuration() { + const { delay = 0 } = this.options || {}; + return this.duration + millisecondsToSeconds(delay); + } + get time() { + return millisecondsToSeconds(this.currentTime); + } + set time(newTime) { + newTime = secondsToMilliseconds(newTime); + this.currentTime = newTime; + if (this.startTime === null || + this.holdTime !== null || + this.playbackSpeed === 0) { + this.holdTime = newTime; + } + else if (this.driver) { + this.startTime = this.driver.now() - newTime / this.playbackSpeed; + } + if (this.driver) { + this.driver.start(false); + } + else { + this.startTime = 0; + this.state = "paused"; + this.holdTime = newTime; + this.tick(newTime); + } + } + /** + * Returns the generator's velocity at the current time in units/second. + * Uses the analytical derivative when available (springs), avoiding + * the MotionValue's frame-dependent velocity estimation. + */ + getGeneratorVelocity() { + const t = this.currentTime; + if (t <= 0) + return this.options.velocity || 0; + if (this.generator.velocity) { + return this.generator.velocity(t); + } + // Fallback: finite difference + const current = this.generator.next(t).value; + return getGeneratorVelocity((s) => this.generator.next(s).value, t, current); + } + get speed() { + return this.playbackSpeed; + } + set speed(newSpeed) { + const hasChanged = this.playbackSpeed !== newSpeed; + if (hasChanged && this.driver) { + this.updateTime(time.now()); + } + this.playbackSpeed = newSpeed; + if (hasChanged && this.driver) { + this.time = millisecondsToSeconds(this.currentTime); + } + } + play() { + if (this.isStopped) + return; + const { driver = frameloopDriver, startTime } = this.options; + if (!this.driver) { + this.driver = driver((timestamp) => this.tick(timestamp)); + } + this.options.onPlay?.(); + const now = this.driver.now(); + if (this.state === "finished") { + this.updateFinished(); + this.startTime = now; + } + else if (this.holdTime !== null) { + this.startTime = now - this.holdTime; + } + else if (!this.startTime) { + this.startTime = startTime ?? now; + } + if (this.state === "finished" && this.speed < 0) { + this.startTime += this.calculatedDuration; + } + this.holdTime = null; + /** + * Set playState to running only after we've used it in + * the previous logic. + */ + this.state = "running"; + this.driver.start(); + } + pause() { + this.state = "paused"; + this.updateTime(time.now()); + this.holdTime = this.currentTime; + } + complete() { + if (this.state !== "running") { + this.play(); + } + this.state = "finished"; + this.holdTime = null; + } + finish() { + this.notifyFinished(); + this.teardown(); + this.state = "finished"; + this.options.onComplete?.(); + } + cancel() { + this.holdTime = null; + this.startTime = 0; + this.tick(0); + this.teardown(); + this.options.onCancel?.(); + } + teardown() { + this.state = "idle"; + this.stopDriver(); + this.startTime = this.holdTime = null; + } + stopDriver() { + if (!this.driver) + return; + this.driver.stop(); + this.driver = undefined; + } + sample(sampleTime) { + this.startTime = 0; + return this.tick(sampleTime, true); + } + attachTimeline(timeline) { + if (this.options.allowFlatten) { + this.options.type = "keyframes"; + this.options.ease = "linear"; + this.initAnimation(); + } + this.driver?.stop(); + return timeline.observe(this); + } + } + // Legacy function support + function animateValue(options) { + return new JSAnimation(options); + } + + function fillWildcards(keyframes) { + for (let i = 1; i < keyframes.length; i++) { + keyframes[i] ?? (keyframes[i] = keyframes[i - 1]); + } + } + + const radToDeg = (rad) => (rad * 180) / Math.PI; + const rotate = (v) => { + const angle = radToDeg(Math.atan2(v[1], v[0])); + return rebaseAngle(angle); + }; + const matrix2dParsers = { + x: 4, + y: 5, + translateX: 4, + translateY: 5, + scaleX: 0, + scaleY: 3, + scale: (v) => (Math.abs(v[0]) + Math.abs(v[3])) / 2, + rotate, + rotateZ: rotate, + skewX: (v) => radToDeg(Math.atan(v[1])), + skewY: (v) => radToDeg(Math.atan(v[2])), + skew: (v) => (Math.abs(v[1]) + Math.abs(v[2])) / 2, + }; + const rebaseAngle = (angle) => { + angle = angle % 360; + if (angle < 0) + angle += 360; + return angle; + }; + const rotateZ = rotate; + const scaleX = (v) => Math.sqrt(v[0] * v[0] + v[1] * v[1]); + const scaleY = (v) => Math.sqrt(v[4] * v[4] + v[5] * v[5]); + const matrix3dParsers = { + x: 12, + y: 13, + z: 14, + translateX: 12, + translateY: 13, + translateZ: 14, + scaleX, + scaleY, + scale: (v) => (scaleX(v) + scaleY(v)) / 2, + rotateX: (v) => rebaseAngle(radToDeg(Math.atan2(v[6], v[5]))), + rotateY: (v) => rebaseAngle(radToDeg(Math.atan2(-v[2], v[0]))), + rotateZ, + rotate: rotateZ, + skewX: (v) => radToDeg(Math.atan(v[4])), + skewY: (v) => radToDeg(Math.atan(v[1])), + skew: (v) => (Math.abs(v[1]) + Math.abs(v[4])) / 2, + }; + function defaultTransformValue(name) { + return name.includes("scale") ? 1 : 0; + } + function parseValueFromTransform(transform, name) { + if (!transform || transform === "none") { + return defaultTransformValue(name); + } + const matrix3dMatch = transform.match(/^matrix3d\(([-\d.e\s,]+)\)$/u); + let parsers; + let match; + if (matrix3dMatch) { + parsers = matrix3dParsers; + match = matrix3dMatch; + } + else { + const matrix2dMatch = transform.match(/^matrix\(([-\d.e\s,]+)\)$/u); + parsers = matrix2dParsers; + match = matrix2dMatch; + } + if (!match) { + return defaultTransformValue(name); + } + const valueParser = parsers[name]; + const values = match[1].split(",").map(convertTransformToNumber); + return typeof valueParser === "function" + ? valueParser(values) + : values[valueParser]; + } + const readTransformValue = (instance, name) => { + const { transform = "none" } = getComputedStyle(instance); + return parseValueFromTransform(transform, name); + }; + function convertTransformToNumber(value) { + return parseFloat(value.trim()); + } + + /** + * Generate a list of every possible transform key. + */ + const transformPropOrder = [ + "transformPerspective", + "x", + "y", + "z", + "translateX", + "translateY", + "translateZ", + "scale", + "scaleX", + "scaleY", + "rotate", + "rotateX", + "rotateY", + "rotateZ", + "skew", + "skewX", + "skewY", + ]; + /** + * A quick lookup for transform props. + * + * `pathRotation` is a transform for routing purposes (skipped from raw + * style application, wired to the transform composite, flags transform + * dirty) but is intentionally NOT in `transformPropOrder` — it is + * composed onto `rotate` at the build sites, not serialized in its own + * slot, and must stay out of the order-array consumers (parse-transform, + * unit-conversion, keys-position). + */ + const transformProps = /*@__PURE__*/ (() => new Set([...transformPropOrder, "pathRotation"]))(); + + const isNumOrPxType = (v) => v === number || v === px; + const transformKeys = new Set(["x", "y", "z"]); + const nonTranslationalTransformKeys = transformPropOrder.filter((key) => !transformKeys.has(key)); + function removeNonTranslationalTransform(visualElement) { + const removedTransforms = []; + nonTranslationalTransformKeys.forEach((key) => { + const value = visualElement.getValue(key); + if (value !== undefined) { + removedTransforms.push([key, value.get()]); + value.set(key.startsWith("scale") ? 1 : 0); + } + }); + return removedTransforms; + } + const positionalValues = { + // Dimensions + width: ({ x }, { paddingLeft = "0", paddingRight = "0", boxSizing }) => { + const width = x.max - x.min; + return boxSizing === "border-box" + ? width + : width - parseFloat(paddingLeft) - parseFloat(paddingRight); + }, + height: ({ y }, { paddingTop = "0", paddingBottom = "0", boxSizing }) => { + const height = y.max - y.min; + return boxSizing === "border-box" + ? height + : height - parseFloat(paddingTop) - parseFloat(paddingBottom); + }, + top: (_bbox, { top }) => parseFloat(top), + left: (_bbox, { left }) => parseFloat(left), + bottom: ({ y }, { top }) => parseFloat(top) + (y.max - y.min), + right: ({ x }, { left }) => parseFloat(left) + (x.max - x.min), + // Transform + x: (_bbox, { transform }) => parseValueFromTransform(transform, "x"), + y: (_bbox, { transform }) => parseValueFromTransform(transform, "y"), + }; + // Alias translate longform names + positionalValues.translateX = positionalValues.x; + positionalValues.translateY = positionalValues.y; + + const toResolve = new Set(); + let isScheduled = false; + let anyNeedsMeasurement = false; + let isForced = false; + function measureAllKeyframes() { + if (anyNeedsMeasurement) { + const resolversToMeasure = Array.from(toResolve).filter((resolver) => resolver.needsMeasurement); + const elementsToMeasure = new Set(resolversToMeasure.map((resolver) => resolver.element)); + const transformsToRestore = new Map(); + /** + * Write pass + * If we're measuring elements we want to remove bounding box-changing transforms. + */ + elementsToMeasure.forEach((element) => { + const removedTransforms = removeNonTranslationalTransform(element); + if (!removedTransforms.length) + return; + transformsToRestore.set(element, removedTransforms); + element.render(); + }); + // Read + resolversToMeasure.forEach((resolver) => resolver.measureInitialState()); + // Write + elementsToMeasure.forEach((element) => { + element.render(); + const restore = transformsToRestore.get(element); + if (restore) { + restore.forEach(([key, value]) => { + element.getValue(key)?.set(value); + }); + } + }); + // Read + resolversToMeasure.forEach((resolver) => resolver.measureEndState()); + // Write + resolversToMeasure.forEach((resolver) => { + if (resolver.suspendedScrollY !== undefined) { + window.scrollTo(0, resolver.suspendedScrollY); + } + }); + } + anyNeedsMeasurement = false; + isScheduled = false; + toResolve.forEach((resolver) => resolver.complete(isForced)); + toResolve.clear(); + } + function readAllKeyframes() { + toResolve.forEach((resolver) => { + resolver.readKeyframes(); + if (resolver.needsMeasurement) { + anyNeedsMeasurement = true; + } + }); + } + function flushKeyframeResolvers() { + isForced = true; + readAllKeyframes(); + measureAllKeyframes(); + isForced = false; + } + class KeyframeResolver { + constructor(unresolvedKeyframes, onComplete, name, motionValue, element, isAsync = false) { + this.state = "pending"; + /** + * Track whether this resolver is async. If it is, it'll be added to the + * resolver queue and flushed in the next frame. Resolvers that aren't going + * to trigger read/write thrashing don't need to be async. + */ + this.isAsync = false; + /** + * Track whether this resolver needs to perform a measurement + * to resolve its keyframes. + */ + this.needsMeasurement = false; + this.unresolvedKeyframes = [...unresolvedKeyframes]; + this.onComplete = onComplete; + this.name = name; + this.motionValue = motionValue; + this.element = element; + this.isAsync = isAsync; + } + scheduleResolve() { + this.state = "scheduled"; + if (this.isAsync) { + toResolve.add(this); + if (!isScheduled) { + isScheduled = true; + frame.read(readAllKeyframes); + frame.resolveKeyframes(measureAllKeyframes); + } + } + else { + this.readKeyframes(); + this.complete(); + } + } + readKeyframes() { + const { unresolvedKeyframes, name, element, motionValue } = this; + // If initial keyframe is null we need to read it from the DOM + if (unresolvedKeyframes[0] === null) { + const currentValue = motionValue?.get(); + // TODO: This doesn't work if the final keyframe is a wildcard + const finalKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1]; + if (currentValue !== undefined) { + unresolvedKeyframes[0] = currentValue; + } + else if (element && name) { + const valueAsRead = element.readValue(name, finalKeyframe); + if (valueAsRead !== undefined && valueAsRead !== null) { + unresolvedKeyframes[0] = valueAsRead; + } + } + if (unresolvedKeyframes[0] === undefined) { + unresolvedKeyframes[0] = finalKeyframe; + } + if (motionValue && currentValue === undefined) { + motionValue.set(unresolvedKeyframes[0]); + } + } + fillWildcards(unresolvedKeyframes); + } + setFinalKeyframe() { } + measureInitialState() { } + renderEndStyles() { } + measureEndState() { } + complete(isForcedComplete = false) { + this.state = "complete"; + this.onComplete(this.unresolvedKeyframes, this.finalKeyframe, isForcedComplete); + toResolve.delete(this); + } + cancel() { + if (this.state === "scheduled") { + toResolve.delete(this); + this.state = "pending"; + } + } + resume() { + if (this.state === "pending") + this.scheduleResolve(); + } + } + + const isCSSVar = (name) => name.startsWith("--"); + + function setStyle(element, name, value) { + isCSSVar(name) + ? element.style.setProperty(name, value) + : (element.style[name] = value); + } + + /** + * Add the ability for test suites to manually set support flags + * to better test more environments. + */ + const supportsFlags = {}; + + function memoSupports(callback, supportsFlag) { + const memoized = memo(callback); + return () => supportsFlags[supportsFlag] ?? memoized(); + } + + const supportsScrollTimeline = /* @__PURE__ */ memoSupports(() => window.ScrollTimeline !== undefined, "scrollTimeline"); + const supportsViewTimeline = /* @__PURE__ */ memoSupports(() => window.ViewTimeline !== undefined, "viewTimeline"); + + const supportsLinearEasing = /*@__PURE__*/ memoSupports(() => { + try { + document + .createElement("div") + .animate({ opacity: 0 }, { easing: "linear(0, 1)" }); + } + catch (e) { + return false; + } + return true; + }, "linearEasing"); + + const cubicBezierAsString = ([a, b, c, d]) => `cubic-bezier(${a}, ${b}, ${c}, ${d})`; + + const supportedWaapiEasing = { + linear: "linear", + ease: "ease", + easeIn: "ease-in", + easeOut: "ease-out", + easeInOut: "ease-in-out", + circIn: /*@__PURE__*/ cubicBezierAsString([0, 0.65, 0.55, 1]), + circOut: /*@__PURE__*/ cubicBezierAsString([0.55, 0, 1, 0.45]), + backIn: /*@__PURE__*/ cubicBezierAsString([0.31, 0.01, 0.66, -0.59]), + backOut: /*@__PURE__*/ cubicBezierAsString([0.33, 1.53, 0.69, 0.99]), + }; + + function mapEasingToNativeEasing(easing, duration) { + if (!easing) { + return undefined; + } + else if (typeof easing === "function") { + return supportsLinearEasing() + ? generateLinearEasing(easing, duration) + : "ease-out"; + } + else if (isBezierDefinition(easing)) { + return cubicBezierAsString(easing); + } + else if (Array.isArray(easing)) { + return easing.map((segmentEasing) => mapEasingToNativeEasing(segmentEasing, duration) || + supportedWaapiEasing.easeOut); + } + else { + return supportedWaapiEasing[easing]; + } + } + + function startWaapiAnimation(element, valueName, keyframes, { delay = 0, duration = 300, repeat = 0, repeatType = "loop", ease = "easeOut", times, } = {}, pseudoElement = undefined) { + const keyframeOptions = { + [valueName]: keyframes, + }; + if (times) + keyframeOptions.offset = times; + const easing = mapEasingToNativeEasing(ease, duration); + /** + * If this is an easing array, apply to keyframes, not animation as a whole + */ + if (Array.isArray(easing)) + keyframeOptions.easing = easing; + const options = { + delay, + duration, + easing: !Array.isArray(easing) ? easing : "linear", + fill: "both", + iterations: repeat + 1, + direction: repeatType === "reverse" ? "alternate" : "normal", + }; + if (pseudoElement) + options.pseudoElement = pseudoElement; + return element.animate(keyframeOptions, options); + } + + function isGenerator(type) { + return typeof type === "function" && "applyToOptions" in type; + } + + function applyGeneratorOptions({ type, ...options }) { + if (isGenerator(type) && supportsLinearEasing()) { + return type.applyToOptions(options); + } + else { + options.duration ?? (options.duration = 300); + options.ease ?? (options.ease = "easeOut"); + } + return options; + } + + /** + * NativeAnimation implements AnimationPlaybackControls for the browser's Web Animations API. + */ + class NativeAnimation extends WithPromise { + constructor(options) { + super(); + this.finishedTime = null; + this.isStopped = false; + /** + * Tracks a manually-set start time that takes precedence over WAAPI's + * dynamic startTime. This is cleared when play() or time setter is called, + * allowing WAAPI to take over timing. + */ + this.manualStartTime = null; + if (!options) + return; + const { element, name, keyframes, pseudoElement, allowFlatten = false, finalKeyframe, onComplete, } = options; + this.isPseudoElement = Boolean(pseudoElement); + this.allowFlatten = allowFlatten; + this.options = options; + exports.invariant(typeof options.type !== "string", `Mini animate() doesn't support "type" as a string.`, "mini-spring"); + const transition = applyGeneratorOptions(options); + this.animation = startWaapiAnimation(element, name, keyframes, transition, pseudoElement); + if (transition.autoplay === false) { + this.animation.pause(); + } + this.animation.onfinish = () => { + this.finishedTime = this.time; + if (!pseudoElement) { + const keyframe = getFinalKeyframe(keyframes, this.options, finalKeyframe, this.speed); + if (this.updateMotionValue) { + this.updateMotionValue(keyframe); + } + /** + * If we can, we want to commit the final style as set by the user, + * rather than the computed keyframe value supplied by the animation. + * We always do this, even when a motion value is present, to prevent + * a visual flash in Firefox where the WAAPI animation's fill is removed + * during cancel() before the scheduled render can apply the correct value. + */ + setStyle(element, name, keyframe); + this.animation.cancel(); + } + onComplete?.(); + this.notifyFinished(); + }; + } + play() { + if (this.isStopped) + return; + this.manualStartTime = null; + this.animation.play(); + if (this.state === "finished") { + this.updateFinished(); + } + } + pause() { + this.animation.pause(); + } + complete() { + this.animation.finish?.(); + } + cancel() { + try { + this.animation.cancel(); + } + catch (e) { } + } + stop() { + if (this.isStopped) + return; + this.isStopped = true; + const { state } = this; + if (state === "idle" || state === "finished") { + return; + } + if (this.updateMotionValue) { + this.updateMotionValue(); + } + else { + this.commitStyles(); + } + if (!this.isPseudoElement) + this.cancel(); + } + /** + * WAAPI doesn't natively have any interruption capabilities. + * + * In this method, we commit styles back to the DOM before cancelling + * the animation. + * + * This is designed to be overridden by NativeAnimationExtended, which + * will create a renderless JS animation and sample it twice to calculate + * its current value, "previous" value, and therefore allow + * Motion to also correctly calculate velocity for any subsequent animation + * while deferring the commit until the next animation frame. + */ + commitStyles() { + const element = this.options?.element; + if (!this.isPseudoElement && element?.isConnected) { + this.animation.commitStyles?.(); + } + } + get duration() { + const duration = this.animation.effect?.getComputedTiming?.().duration || 0; + return millisecondsToSeconds(Number(duration)); + } + get iterationDuration() { + const { delay = 0 } = this.options || {}; + return this.duration + millisecondsToSeconds(delay); + } + get time() { + return millisecondsToSeconds(Number(this.animation.currentTime) || 0); + } + set time(newTime) { + const wasFinished = this.finishedTime !== null; + this.manualStartTime = null; + this.finishedTime = null; + this.animation.currentTime = secondsToMilliseconds(newTime); + if (wasFinished) { + this.animation.pause(); + } + } + /** + * The playback speed of the animation. + * 1 = normal speed, 2 = double speed, 0.5 = half speed. + */ + get speed() { + return this.animation.playbackRate; + } + set speed(newSpeed) { + // Allow backwards playback after finishing + if (newSpeed < 0) + this.finishedTime = null; + this.animation.playbackRate = newSpeed; + } + get state() { + return this.finishedTime !== null + ? "finished" + : this.animation.playState; + } + get startTime() { + return this.manualStartTime ?? Number(this.animation.startTime); + } + set startTime(newStartTime) { + this.manualStartTime = this.animation.startTime = newStartTime; + } + /** + * Attaches a timeline to the animation, for instance the `ScrollTimeline`. + */ + attachTimeline({ timeline, rangeStart, rangeEnd, observe, }) { + if (this.allowFlatten) { + this.animation.effect?.updateTiming({ easing: "linear" }); + } + this.animation.onfinish = null; + if (timeline && supportsScrollTimeline()) { + this.animation.timeline = timeline; + if (rangeStart) + this.animation.rangeStart = rangeStart; + if (rangeEnd) + this.animation.rangeEnd = rangeEnd; + return noop; + } + else { + return observe(this); + } + } + } + + const unsupportedEasingFunctions = { + anticipate, + backInOut, + circInOut, + }; + function isUnsupportedEase(key) { + return key in unsupportedEasingFunctions; + } + function replaceStringEasing(transition) { + if (typeof transition.ease === "string" && + isUnsupportedEase(transition.ease)) { + transition.ease = unsupportedEasingFunctions[transition.ease]; + } + } + + /** + * 10ms is chosen here as it strikes a balance between smooth + * results (more than one keyframe per frame at 60fps) and + * keyframe quantity. + */ + const sampleDelta = 10; //ms + class NativeAnimationExtended extends NativeAnimation { + constructor(options) { + /** + * The base NativeAnimation function only supports a subset + * of Motion easings, and WAAPI also only supports some + * easing functions via string/cubic-bezier definitions. + * + * This function replaces those unsupported easing functions + * with a JS easing function. This will later get compiled + * to a linear() easing function. + */ + replaceStringEasing(options); + /** + * Ensure we replace the transition type with a generator function + * before passing to WAAPI. + * + * TODO: Does this have a better home? It could be shared with + * JSAnimation. + */ + replaceTransitionType(options); + super(options); + /** + * Only set startTime when the animation should autoplay. + * Setting startTime on a paused WAAPI animation unpauses it + * (per the WAAPI spec), which breaks autoplay: false. + */ + if (options.startTime !== undefined && options.autoplay !== false) { + this.startTime = options.startTime; + } + this.options = options; + } + /** + * WAAPI doesn't natively have any interruption capabilities. + * + * Rather than read committed styles back out of the DOM, we can + * create a renderless JS animation and sample it twice to calculate + * its current value, "previous" value, and therefore allow + * Motion to calculate velocity for any subsequent animation. + */ + updateMotionValue(value) { + const { motionValue, onUpdate, onComplete, element, ...options } = this.options; + if (!motionValue) + return; + if (value !== undefined) { + motionValue.set(value); + return; + } + const sampleAnimation = new JSAnimation({ + ...options, + autoplay: false, + }); + /** + * Use wall-clock elapsed time for sampling. + * Under CPU load, WAAPI's currentTime may not reflect actual + * elapsed time, causing incorrect sampling and visual jumps. + */ + const sampleTime = Math.max(sampleDelta, time.now() - this.startTime); + const delta = clamp(0, sampleDelta, sampleTime - sampleDelta); + const current = sampleAnimation.sample(sampleTime).value; + /** + * Write the estimated value to inline style so it persists + * after cancel(), covering the async gap before the next + * animation starts. + */ + const { name } = this.options; + if (element && name) + setStyle(element, name, current); + motionValue.setWithVelocity(sampleAnimation.sample(Math.max(0, sampleTime - delta)).value, current, delta); + sampleAnimation.stop(); + } + } + + /** + * Check if a value is animatable. Examples: + * + * ✅: 100, "100px", "#fff" + * ❌: "block", "url(2.jpg)" + * @param value + * + * @internal + */ + const isAnimatable = (value, name) => { + // If the list of keys that might be non-animatable grows, replace with Set + if (name === "zIndex") + return false; + // If it's a number or a keyframes array, we can animate it. We might at some point + // need to do a deep isAnimatable check of keyframes, or let Popmotion handle this, + // but for now lets leave it like this for performance reasons + if (typeof value === "number" || Array.isArray(value)) + return true; + if (typeof value === "string" && // It's animatable if we have a string + (complex.test(value) || value === "0") && // And it contains numbers and/or colors + !value.startsWith("url(") // Unless it starts with "url(" + ) { + return true; + } + return false; + }; + + function hasKeyframesChanged(keyframes) { + const current = keyframes[0]; + if (keyframes.length === 1) + return true; + for (let i = 0; i < keyframes.length; i++) { + if (keyframes[i] !== current) + return true; + } + } + function canAnimate(keyframes, name, type, velocity) { + /** + * Check if we're able to animate between the start and end keyframes, + * and throw a warning if we're attempting to animate between one that's + * animatable and another that isn't. + */ + const originKeyframe = keyframes[0]; + if (originKeyframe === null) { + return false; + } + /** + * These aren't traditionally animatable but we do support them. + * In future we could look into making this more generic or replacing + * this function with mix() === mixImmediate + */ + if (name === "display" || name === "visibility") + return true; + const targetKeyframe = keyframes[keyframes.length - 1]; + const isOriginAnimatable = isAnimatable(originKeyframe, name); + const isTargetAnimatable = isAnimatable(targetKeyframe, name); + exports.warning(isOriginAnimatable === isTargetAnimatable, `You are trying to animate ${name} from "${originKeyframe}" to "${targetKeyframe}". "${isOriginAnimatable ? targetKeyframe : originKeyframe}" is not an animatable value.`, "value-not-animatable"); + // Always skip if any of these are true + if (!isOriginAnimatable || !isTargetAnimatable) { + return false; + } + return (hasKeyframesChanged(keyframes) || + ((type === "spring" || isGenerator(type)) && velocity)); + } + + function makeAnimationInstant(options) { + options.duration = 0; + options.type = "keyframes"; + } + + /** + * A list of values that can be hardware-accelerated. + */ + const acceleratedValues = new Set([ + "opacity", + "clipPath", + "filter", + "transform", + "backgroundColor", + ]); + + const browserColorFunctions = /^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/; + function hasBrowserOnlyColors(keyframes) { + for (let i = 0; i < keyframes.length; i++) { + if (typeof keyframes[i] === "string" && + browserColorFunctions.test(keyframes[i])) { + return true; + } + } + return false; + } + + const colorProperties = new Set([ + "color", + "backgroundColor", + "outlineColor", + "fill", + "stroke", + "borderColor", + "borderTopColor", + "borderRightColor", + "borderBottomColor", + "borderLeftColor", + ]); + const supportsWaapi = /*@__PURE__*/ memo(() => Object.hasOwnProperty.call(Element.prototype, "animate")); + function supportsBrowserAnimation(options) { + const { motionValue, name, repeatDelay, repeatType, damping, type, keyframes, } = options; + const subject = motionValue?.owner?.current; + /** + * We use instanceof checks instead of isHTMLElement()/isSVGElement() + * because we explicitly **don't** want elements in different timing + * contexts (i.e. popups) to be accelerated, as it's not possible to sync + * these animations properly with those driven from the main window + * frameloop. + */ + if (!(subject instanceof HTMLElement) && + !(subject instanceof SVGElement)) { + return false; + } + const { onUpdate, transformTemplate } = motionValue.owner.getProps(); + return (supportsWaapi() && + name && + /** + * Force WAAPI for color properties with browser-only color formats + * (oklch, oklab, lab, lch, etc.) that the JS animation path can't parse. + */ + (acceleratedValues.has(name) || + (colorProperties.has(name) && + hasBrowserOnlyColors(keyframes))) && + (name !== "transform" || !transformTemplate) && + /** + * If we're outputting values to onUpdate then we can't use WAAPI as there's + * no way to read the value from WAAPI every frame. + */ + !onUpdate && + !repeatDelay && + repeatType !== "mirror" && + damping !== 0 && + type !== "inertia"); + } + + /** + * Maximum time allowed between an animation being created and it being + * resolved for us to use the latter as the start time. + * + * This is to ensure that while we prefer to "start" an animation as soon + * as it's triggered, we also want to avoid a visual jump if there's a big delay + * between these two moments. + */ + const MAX_RESOLVE_DELAY = 40; + class AsyncMotionValueAnimation extends WithPromise { + constructor({ autoplay = true, delay = 0, type = "keyframes", repeat = 0, repeatDelay = 0, repeatType = "loop", keyframes, name, motionValue, element, ...options }) { + super(); + /** + * Bound to support return animation.stop pattern + */ + this.stop = () => { + if (this._animation) { + this._animation.stop(); + this.stopTimeline?.(); + } + this.keyframeResolver?.cancel(); + }; + this.createdAt = time.now(); + const optionsWithDefaults = { + autoplay, + delay, + type, + repeat, + repeatDelay, + repeatType, + name, + motionValue, + element, + ...options, + }; + const KeyframeResolver$1 = element?.KeyframeResolver || KeyframeResolver; + this.keyframeResolver = new KeyframeResolver$1(keyframes, (resolvedKeyframes, finalKeyframe, forced) => this.onKeyframesResolved(resolvedKeyframes, finalKeyframe, optionsWithDefaults, !forced), name, motionValue, element); + this.keyframeResolver?.scheduleResolve(); + } + onKeyframesResolved(keyframes, finalKeyframe, options, sync) { + this.keyframeResolver = undefined; + const { name, type, velocity, delay, isHandoff, onUpdate } = options; + this.resolvedAt = time.now(); + /** + * If we can't animate this value with the resolved keyframes + * then we should complete it immediately. + */ + let canAnimateValue = true; + if (!canAnimate(keyframes, name, type, velocity)) { + canAnimateValue = false; + if (MotionGlobalConfig.instantAnimations || !delay) { + onUpdate?.(getFinalKeyframe(keyframes, options, finalKeyframe)); + } + keyframes[0] = keyframes[keyframes.length - 1]; + makeAnimationInstant(options); + options.repeat = 0; + } + /** + * Resolve startTime for the animation. + * + * This method uses the createdAt and resolvedAt to calculate the + * animation startTime. *Ideally*, we would use the createdAt time as t=0 + * as the following frame would then be the first frame of the animation in + * progress, which would feel snappier. + * + * However, if there's a delay (main thread work) between the creation of + * the animation and the first committed frame, we prefer to use resolvedAt + * to avoid a sudden jump into the animation. + */ + const startTime = sync + ? !this.resolvedAt + ? this.createdAt + : this.resolvedAt - this.createdAt > MAX_RESOLVE_DELAY + ? this.resolvedAt + : this.createdAt + : undefined; + const resolvedOptions = { + startTime, + finalKeyframe, + ...options, + keyframes, + }; + /** + * Animate via WAAPI if possible. If this is a handoff animation, the optimised animation will be running via + * WAAPI. Therefore, this animation must be JS to ensure it runs "under" the + * optimised animation. + * + * Also skip WAAPI when keyframes aren't animatable, as the resolved + * values may not be valid CSS and would trigger browser warnings. + */ + const useWaapi = canAnimateValue && + !isHandoff && + supportsBrowserAnimation(resolvedOptions); + const element = resolvedOptions.motionValue?.owner?.current; + let animation; + if (useWaapi) { + try { + animation = new NativeAnimationExtended({ + ...resolvedOptions, + element, + }); + } + catch { + animation = new JSAnimation(resolvedOptions); + } + } + else { + animation = new JSAnimation(resolvedOptions); + } + animation.finished.then(() => { + this.notifyFinished(); + }).catch(noop); + if (this.pendingTimeline) { + this.stopTimeline = animation.attachTimeline(this.pendingTimeline); + this.pendingTimeline = undefined; + } + this._animation = animation; + } + get finished() { + if (!this._animation) { + return this._finished; + } + else { + return this.animation.finished; + } + } + then(onResolve, _onReject) { + return this.finished.finally(onResolve).then(() => { }); + } + get animation() { + if (!this._animation) { + this.keyframeResolver?.resume(); + flushKeyframeResolvers(); + } + return this._animation; + } + get duration() { + return this.animation.duration; + } + get iterationDuration() { + return this.animation.iterationDuration; + } + get time() { + return this.animation.time; + } + set time(newTime) { + this.animation.time = newTime; + } + get speed() { + return this.animation.speed; + } + get state() { + return this.animation.state; + } + set speed(newSpeed) { + this.animation.speed = newSpeed; + } + get startTime() { + return this.animation.startTime; + } + attachTimeline(timeline) { + if (this._animation) { + this.stopTimeline = this.animation.attachTimeline(timeline); + } + else { + this.pendingTimeline = timeline; + } + return () => this.stop(); + } + play() { + this.animation.play(); + } + pause() { + this.animation.pause(); + } + complete() { + this.animation.complete(); + } + cancel() { + if (this._animation) { + this.animation.cancel(); + } + this.keyframeResolver?.cancel(); + } + } + + class GroupAnimation { + constructor(animations) { + // Bound to accomadate common `return animation.stop` pattern + this.stop = () => this.runAll("stop"); + this.animations = animations.filter(Boolean); + } + get finished() { + return Promise.all(this.animations.map((animation) => animation.finished)); + } + /** + * TODO: Filter out cancelled or stopped animations before returning + */ + getAll(propName) { + return this.animations[0][propName]; + } + setAll(propName, newValue) { + for (let i = 0; i < this.animations.length; i++) { + this.animations[i][propName] = newValue; + } + } + attachTimeline(timeline) { + const subscriptions = this.animations.map((animation) => animation.attachTimeline(timeline)); + return () => { + subscriptions.forEach((cancel, i) => { + cancel && cancel(); + this.animations[i].stop(); + }); + }; + } + get time() { + return this.getAll("time"); + } + set time(time) { + this.setAll("time", time); + } + get speed() { + return this.getAll("speed"); + } + set speed(speed) { + this.setAll("speed", speed); + } + get state() { + return this.getAll("state"); + } + get startTime() { + return this.getAll("startTime"); + } + get duration() { + return getMax(this.animations, "duration"); + } + get iterationDuration() { + return getMax(this.animations, "iterationDuration"); + } + runAll(methodName) { + this.animations.forEach((controls) => controls[methodName]()); + } + play() { + this.runAll("play"); + } + pause() { + this.runAll("pause"); + } + cancel() { + this.runAll("cancel"); + } + complete() { + this.runAll("complete"); + } + } + function getMax(animations, propName) { + let max = 0; + for (let i = 0; i < animations.length; i++) { + const value = animations[i][propName]; + if (value !== null && value > max) { + max = value; + } + } + return max; + } + + class GroupAnimationWithThen extends GroupAnimation { + then(onResolve, _onReject) { + return this.finished.finally(onResolve).then(() => { }); + } + } + + class NativeAnimationWrapper extends NativeAnimation { + constructor(animation) { + super(); + this.animation = animation; + animation.onfinish = () => { + this.finishedTime = this.time; + this.notifyFinished(); + }; + } + } + + const animationMaps = new WeakMap(); + const animationMapKey = (name, pseudoElement = "") => `${name}:${pseudoElement}`; + function getAnimationMap(element) { + let map = animationMaps.get(element); + if (!map) { + map = new Map(); + animationMaps.set(element, map); + } + return map; + } + + function calcChildStagger(children, child, delayChildren, staggerChildren = 0, staggerDirection = 1) { + const index = Array.from(children) + .sort((a, b) => a.sortNodePosition(b)) + .indexOf(child); + const numChildren = children.size; + const maxStaggerDuration = (numChildren - 1) * staggerChildren; + const delayIsFunction = typeof delayChildren === "function"; + return delayIsFunction + ? delayChildren(index, numChildren) + : staggerDirection === 1 + ? index * staggerChildren + : maxStaggerDuration - index * staggerChildren; + } + + /** + * Maximum time between the value of two frames, beyond which we + * assume the velocity has since been 0. + */ + const MAX_VELOCITY_DELTA = 30; + const isFloat = (value) => { + return !isNaN(parseFloat(value)); + }; + const collectMotionValues = { + current: undefined, + }; + /** + * `MotionValue` is used to track the state and velocity of motion values. + * + * @public + */ + class MotionValue { + /** + * @param init - The initiating value + * @param config - Optional configuration options + * + * - `transformer`: A function to transform incoming values with. + */ + constructor(init, options = {}) { + /** + * Tracks whether this value can output a velocity. Currently this is only true + * if the value is numerical, but we might be able to widen the scope here and support + * other value types. + * + * @internal + */ + this.canTrackVelocity = null; + /** + * An object containing a SubscriptionManager for each active event. + */ + this.events = {}; + this.updateAndNotify = (v) => { + const currentTime = time.now(); + /** + * If we're updating the value during another frame or eventloop + * than the previous frame, then the we set the previous frame value + * to current. + */ + if (this.updatedAt !== currentTime) { + this.setPrevFrameValue(); + } + this.prev = this.current; + this.setCurrent(v); + // Update update subscribers + if (this.current !== this.prev) { + this.events.change?.notify(this.current); + if (this.dependents) { + for (const dependent of this.dependents) { + dependent.dirty(); + } + } + } + }; + this.hasAnimated = false; + this.setCurrent(init); + this.owner = options.owner; + } + setCurrent(current) { + this.current = current; + this.updatedAt = time.now(); + if (this.canTrackVelocity === null && current !== undefined) { + this.canTrackVelocity = isFloat(this.current); + } + } + setPrevFrameValue(prevFrameValue = this.current) { + this.prevFrameValue = prevFrameValue; + this.prevUpdatedAt = this.updatedAt; + } + /** + * Adds a function that will be notified when the `MotionValue` is updated. + * + * It returns a function that, when called, will cancel the subscription. + * + * When calling `onChange` inside a React component, it should be wrapped with the + * `useEffect` hook. As it returns an unsubscribe function, this should be returned + * from the `useEffect` function to ensure you don't add duplicate subscribers.. + * + * ```jsx + * export const MyComponent = () => { + * const x = useMotionValue(0) + * const y = useMotionValue(0) + * const opacity = useMotionValue(1) + * + * useEffect(() => { + * function updateOpacity() { + * const maxXY = Math.max(x.get(), y.get()) + * const newOpacity = transform(maxXY, [0, 100], [1, 0]) + * opacity.set(newOpacity) + * } + * + * const unsubscribeX = x.on("change", updateOpacity) + * const unsubscribeY = y.on("change", updateOpacity) + * + * return () => { + * unsubscribeX() + * unsubscribeY() + * } + * }, []) + * + * return + * } + * ``` + * + * @param subscriber - A function that receives the latest value. + * @returns A function that, when called, will cancel this subscription. + * + * @deprecated + */ + onChange(subscription) { + { + warnOnce(false, `value.onChange(callback) is deprecated. Switch to value.on("change", callback).`); + } + return this.on("change", subscription); + } + on(eventName, callback) { + if (!this.events[eventName]) { + this.events[eventName] = new SubscriptionManager(); + } + const unsubscribe = this.events[eventName].add(callback); + if (eventName === "change") { + return () => { + unsubscribe(); + /** + * If we have no more change listeners by the start + * of the next frame, stop active animations. + */ + frame.read(() => { + if (!this.events.change.getSize()) { + this.stop(); + } + }); + }; + } + return unsubscribe; + } + clearListeners() { + for (const eventManagers in this.events) { + this.events[eventManagers].clear(); + } + } + /** + * Attaches a passive effect to the `MotionValue`. + */ + attach(passiveEffect, stopPassiveEffect) { + this.passiveEffect = passiveEffect; + this.stopPassiveEffect = stopPassiveEffect; + } + /** + * Sets the state of the `MotionValue`. + * + * @remarks + * + * ```jsx + * const x = useMotionValue(0) + * x.set(10) + * ``` + * + * @param latest - Latest value to set. + * @param render - Whether to notify render subscribers. Defaults to `true` + * + * @public + */ + set(v) { + if (!this.passiveEffect) { + this.updateAndNotify(v); + } + else { + this.passiveEffect(v, this.updateAndNotify); + } + } + setWithVelocity(prev, current, delta) { + this.set(current); + this.prev = undefined; + this.prevFrameValue = prev; + this.prevUpdatedAt = this.updatedAt - delta; + } + /** + * Set the state of the `MotionValue`, stopping any active animations, + * effects, and resets velocity to `0`. + */ + jump(v, endAnimation = true) { + this.updateAndNotify(v); + this.prev = v; + this.prevUpdatedAt = this.prevFrameValue = undefined; + endAnimation && this.stop(); + if (this.stopPassiveEffect) + this.stopPassiveEffect(); + } + dirty() { + this.events.change?.notify(this.current); + } + addDependent(dependent) { + if (!this.dependents) { + this.dependents = new Set(); + } + this.dependents.add(dependent); + } + removeDependent(dependent) { + if (this.dependents) { + this.dependents.delete(dependent); + } + } + /** + * Returns the latest state of `MotionValue` + * + * @returns - The latest state of `MotionValue` + * + * @public + */ + get() { + if (collectMotionValues.current) { + collectMotionValues.current.push(this); + } + return this.current; + } + /** + * @public + */ + getPrevious() { + return this.prev; + } + /** + * Returns the latest velocity of `MotionValue` + * + * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical. + * + * @public + */ + getVelocity() { + const currentTime = time.now(); + if (!this.canTrackVelocity || + this.prevFrameValue === undefined || + currentTime - this.updatedAt > MAX_VELOCITY_DELTA) { + return 0; + } + const delta = Math.min(this.updatedAt - this.prevUpdatedAt, MAX_VELOCITY_DELTA); + // Casts because of parseFloat's poor typing + return velocityPerSecond(parseFloat(this.current) - + parseFloat(this.prevFrameValue), delta); + } + /** + * Registers a new animation to control this `MotionValue`. Only one + * animation can drive a `MotionValue` at one time. + * + * ```jsx + * value.start() + * ``` + * + * @param animation - A function that starts the provided animation + */ + start(startAnimation) { + this.stop(); + return new Promise((resolve) => { + this.hasAnimated = true; + this.animation = startAnimation(resolve); + if (this.events.animationStart) { + this.events.animationStart.notify(); + } + }).then(() => { + if (this.events.animationComplete) { + this.events.animationComplete.notify(); + } + this.clearAnimation(); + }); + } + /** + * Stop the currently active animation. + * + * @public + */ + stop() { + if (this.animation) { + this.animation.stop(); + if (this.events.animationCancel) { + this.events.animationCancel.notify(); + } + } + this.clearAnimation(); + } + /** + * Returns `true` if this value is currently animating. + * + * @public + */ + isAnimating() { + return !!this.animation; + } + clearAnimation() { + delete this.animation; + } + /** + * Destroy and clean up subscribers to this `MotionValue`. + * + * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically + * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually + * created a `MotionValue` via the `motionValue` function. + * + * @public + */ + destroy() { + this.dependents?.clear(); + this.events.destroy?.notify(); + this.clearListeners(); + this.stop(); + if (this.stopPassiveEffect) { + this.stopPassiveEffect(); + } + } + } + function motionValue(init, options) { + return new MotionValue(init, options); + } + + /** + * If `transition` has `inherit: true`, shallow-merge it with + * `parentTransition` (child keys win) and strip the `inherit` key. + * Otherwise return `transition` unchanged. + */ + function resolveTransition(transition, parentTransition) { + if (transition?.inherit && parentTransition) { + const { inherit: _, ...rest } = transition; + return { ...parentTransition, ...rest }; + } + return transition; + } + + function getValueTransition$1(transition, key) { + const valueTransition = transition?.[key] ?? + transition?.["default"] ?? + transition; + if (valueTransition !== transition) { + return resolveTransition(valueTransition, transition); + } + return valueTransition; + } + + const underDampedSpring = { + type: "spring", + stiffness: 500, + damping: 25, + restSpeed: 10, + }; + const criticallyDampedSpring = (target) => ({ + type: "spring", + stiffness: 550, + damping: target === 0 ? 2 * Math.sqrt(550) : 30, + restSpeed: 10, + }); + const keyframesTransition = { + type: "keyframes", + duration: 0.8, + }; + /** + * Default easing curve is a slightly shallower version of + * the default browser easing curve. + */ + const ease = { + type: "keyframes", + ease: [0.25, 0.1, 0.35, 1], + duration: 0.3, + }; + const getDefaultTransition = (valueKey, { keyframes }) => { + if (keyframes.length > 2) { + return keyframesTransition; + } + else if (transformProps.has(valueKey)) { + return valueKey.startsWith("scale") + ? criticallyDampedSpring(keyframes[1]) + : underDampedSpring; + } + return ease; + }; + + const orchestrationKeys = new Set([ + "when", + "delay", + "delayChildren", + "staggerChildren", + "staggerDirection", + "repeat", + "repeatType", + "repeatDelay", + "from", + "elapsed", + ]); + /** + * Decide whether a transition is defined on a given Transition. + * This filters out orchestration options and returns true + * if any options are left. + */ + function isTransitionDefined(transition) { + for (const key in transition) { + if (!orchestrationKeys.has(key)) + return true; + } + return false; + } + + const animateMotionValue = (name, value, target, transition = {}, element, isHandoff) => (onComplete) => { + const valueTransition = getValueTransition$1(transition, name) || {}; + /** + * Most transition values are currently completely overwritten by value-specific + * transitions. In the future it'd be nicer to blend these transitions. But for now + * delay actually does inherit from the root transition if not value-specific. + */ + const delay = valueTransition.delay || transition.delay || 0; + /** + * Elapsed isn't a public transition option but can be passed through from + * optimized appear effects in milliseconds. + */ + let { elapsed = 0 } = transition; + elapsed = elapsed - secondsToMilliseconds(delay); + const options = { + keyframes: Array.isArray(target) ? target : [null, target], + ease: "easeOut", + velocity: value.getVelocity(), + ...valueTransition, + delay: -elapsed, + onUpdate: (v) => { + value.set(v); + valueTransition.onUpdate && valueTransition.onUpdate(v); + }, + onComplete: () => { + onComplete(); + valueTransition.onComplete && valueTransition.onComplete(); + }, + name, + motionValue: value, + element: isHandoff ? undefined : element, + }; + /** + * If there's no transition defined for this value, we can generate + * unique transition settings for this value. + */ + if (!isTransitionDefined(valueTransition)) { + Object.assign(options, getDefaultTransition(name, options)); + } + /** + * Both WAAPI and our internal animation functions use durations + * as defined by milliseconds, while our external API defines them + * as seconds. + */ + options.duration && (options.duration = secondsToMilliseconds(options.duration)); + options.repeatDelay && (options.repeatDelay = secondsToMilliseconds(options.repeatDelay)); + /** + * Support deprecated way to set initial value. Prefer keyframe syntax. + */ + if (options.from !== undefined) { + options.keyframes[0] = options.from; + } + let shouldSkip = false; + if (options.type === false || + (options.duration === 0 && !options.repeatDelay)) { + makeAnimationInstant(options); + if (options.delay === 0) { + shouldSkip = true; + } + } + if (MotionGlobalConfig.instantAnimations || + MotionGlobalConfig.skipAnimations || + element?.shouldSkipAnimations || + valueTransition.skipAnimations) { + shouldSkip = true; + makeAnimationInstant(options); + options.delay = 0; + } + /** + * If the transition type or easing has been explicitly set by the user + * then we don't want to allow flattening the animation. + */ + options.allowFlatten = !valueTransition.type && !valueTransition.ease; + /** + * If we can or must skip creating the animation, and apply only + * the final keyframe, do so. We also check once keyframes are resolved but + * this early check prevents the need to create an animation at all. + */ + if (shouldSkip && !isHandoff && value.get() !== undefined) { + const finalKeyframe = getFinalKeyframe(options.keyframes, valueTransition); + if (finalKeyframe !== undefined) { + frame.update(() => { + options.onUpdate(finalKeyframe); + options.onComplete(); + }); + return; + } + } + return valueTransition.isSync + ? new JSAnimation(options) + : new AsyncMotionValueAnimation(options); + }; + + const MIN_LAYOUT_DISTANCE = 20; + function bezierPoint(t, origin, control, target) { + const inv = 1 - t; + return inv * inv * origin + 2 * inv * t * control + t * t * target; + } + function bezierTangentAngle(t, originX, controlX, targetX, originY, controlY, targetY) { + const dx = 2 * (1 - t) * (controlX - originX) + 2 * t * (targetX - controlX); + const dy = 2 * (1 - t) * (controlY - originY) + 2 * t * (targetY - controlY); + return Math.atan2(dy, dx) * (180 / Math.PI); + } + function computeArcControlPoint(fromX, fromY, toX, toY, strength, peak) { + const deltaX = toX - fromX; + const deltaY = toY - fromY; + const distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY); + if (distance > 0) { + const normalPerpX = -deltaY / distance; + const normalPerpY = deltaX / distance; + const desiredHeight = strength * distance; + return { + x: fromX + deltaX * peak + normalPerpX * desiredHeight, + y: fromY + deltaY * peak + normalPerpY * desiredHeight, + }; + } + return { x: fromX, y: fromY }; + } + /** + * The pure sampling factory: `(from, to) => (t) => point`. Internal — + * used by {@link arc} and the unit tests. Not part of the public surface. + */ + function createArcPath({ strength = 0.5, peak = 0.5, direction, rotate = false, } = {}) { + const rotationScale = rotate === true ? 1 : typeof rotate === "number" ? rotate : 0; + // Auto-direction only: persists across calls to flip the bulge back + // onto the same screen side when the dominant axis changes between + // calls. Reuse the factory (module scope / useMemo) to keep this alive. + let prevBulgeSign; + const createInterpolator = (from, to) => { + const dx = to.x - from.x; + const dy = to.y - from.y; + let signed; + if (direction === "cw") { + signed = -strength; + } + else if (direction === "ccw") { + signed = strength; + } + else { + const dom = Math.abs(dx) >= Math.abs(dy) ? dx : dy; + signed = dom < 0 ? -strength : strength; + } + let control = computeArcControlPoint(from.x, from.y, to.x, to.y, signed, peak); + if (direction === undefined) { + const isVertical = Math.abs(dx) < Math.abs(dy); + const midX = from.x + dx * peak; + const midY = from.y + dy * peak; + const bulgeSign = isVertical + ? Math.sign(control.x - midX) + : Math.sign(control.y - midY); + if (prevBulgeSign !== undefined && + bulgeSign !== 0 && + bulgeSign !== prevBulgeSign) { + signed = -signed; + control = computeArcControlPoint(from.x, from.y, to.x, to.y, signed, peak); + } + else if (bulgeSign !== 0) { + prevBulgeSign = bulgeSign; + } + } + const tangent0 = rotationScale + ? bezierTangentAngle(0, from.x, control.x, to.x, from.y, control.y, to.y) + : 0; + const tangent1 = rotationScale + ? bezierTangentAngle(1, from.x, control.x, to.x, from.y, control.y, to.y) + : 0; + const tangentDelta = rotationScale + ? wrap(-180, 180, tangent1 - tangent0) + : 0; + return (t) => { + const out = { + x: bezierPoint(t, from.x, control.x, to.x), + y: bezierPoint(t, from.y, control.y, to.y), + }; + if (rotationScale) { + const raw = bezierTangentAngle(t, from.x, control.x, to.x, from.y, control.y, to.y); + const baseline = tangent0 + tangentDelta * t; + out.rotate = wrap(-180, 180, raw - baseline) * rotationScale; + } + return out; + }; + }; + return createInterpolator; + } + /** + * Creates a curved path for `transition.path`: + * + * ```ts + * + * ``` + * + * Reuse the returned value (module scope / useMemo / useRef) so its + * continuity closure survives re-renders — a fresh `arc()` has no memory. + */ + function arc(options = {}) { + const sample = createArcPath(options); + const path = { + interpolateProjection(delta) { + // `from` is the current translate offset (carries any in-flight + // displacement when interrupted); `to` is the new layout origin. + // The distance floor avoids visible wobble on tiny shifts. + const tx = delta.x.translate; + const ty = delta.y.translate; + if (Math.sqrt(tx * tx + ty * ty) < MIN_LAYOUT_DISTANCE) { + return undefined; + } + return sample({ x: tx, y: ty }, { x: 0, y: 0 }); + }, + animateVisualElement(visualElement, target, transition, delay, animations) { + if (!("x" in target || "y" in target)) + return; + const xValue = visualElement.getValue("x", visualElement.latestValues["x"] ?? 0); + const yValue = visualElement.getValue("y", visualElement.latestValues["y"] ?? 0); + const xRaw = target.x; + const yRaw = target.y; + const xFrom = (Array.isArray(xRaw) && xRaw[0] != null + ? xRaw[0] + : xValue?.get()) ?? 0; + const yFrom = (Array.isArray(yRaw) && yRaw[0] != null + ? yRaw[0] + : yValue?.get()) ?? 0; + const xTo = (Array.isArray(xRaw) + ? xRaw[xRaw.length - 1] + : xRaw ?? xFrom); + const yTo = (Array.isArray(yRaw) + ? yRaw[yRaw.length - 1] + : yRaw ?? yFrom); + // Interruption needs no flag: x/y already hold the displaced + // mid-arc position, so xFrom/yFrom carry the continuity geometry. + const interpolate = sample({ x: xFrom, y: yFrom }, { x: xTo, y: yTo }); + // Drive a dedicated `pathRotation` value (composed onto `rotate` + // at the build sites) rather than `rotate` itself, so a + // concurrent rotate animation composes and nothing accumulates + // on interrupt. + const pathRotationValue = interpolate(0).rotate !== undefined + ? visualElement.getValue("pathRotation", 0) + : undefined; + const pathTransition = { + delay, + ...getValueTransition$1(transition || {}, "x"), + }; + delete pathTransition.path; + const progress = motionValue(0); + progress.start(animateMotionValue("", progress, [0, 1000], { + ...pathTransition, + isSync: true, + velocity: 0, + onUpdate: (latest) => { + const point = interpolate(latest / 1000); + xValue?.set(point.x); + yValue?.set(point.y); + if (pathRotationValue && point.rotate !== undefined) { + pathRotationValue.set(point.rotate); + } + }, + onComplete: () => { + xValue?.set(xTo); + yValue?.set(yTo); + pathRotationValue?.set(0); + }, + // Interrupt/cancel must clear our additive contribution + // so it can't linger on top of the user's `rotate`. + onStop: () => pathRotationValue?.set(0), + onCancel: () => pathRotationValue?.set(0), + })); + if (progress.animation) + animations.push(progress.animation); + delete target.x; + delete target.y; + }, + }; + return path; + } + + /** + * Parse Framer's special CSS variable format into a CSS token and a fallback. + * + * ``` + * `var(--foo, #fff)` => [`--foo`, '#fff'] + * ``` + * + * @param current + */ + const splitCSSVariableRegex = + // eslint-disable-next-line redos-detector/no-unsafe-regex -- false positive, as it can match a lot of words + /^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u; + function parseCSSVariable(current) { + const match = splitCSSVariableRegex.exec(current); + if (!match) + return [,]; + const [, token1, token2, fallback] = match; + return [`--${token1 ?? token2}`, fallback]; + } + const maxDepth = 4; + function getVariableValue(current, element, depth = 1) { + exports.invariant(depth <= maxDepth, `Max CSS variable fallback depth detected in property "${current}". This may indicate a circular fallback dependency.`, "max-css-var-depth"); + const [token, fallback] = parseCSSVariable(current); + // No CSS variable detected + if (!token) + return; + // Attempt to read this CSS variable off the element + const resolved = window.getComputedStyle(element).getPropertyValue(token); + if (resolved) { + const trimmed = resolved.trim(); + return isNumericalString(trimmed) ? parseFloat(trimmed) : trimmed; + } + return isCSSVariableToken(fallback) + ? getVariableValue(fallback, element, depth + 1) + : fallback; + } + + function getValueState(visualElement) { + const state = [{}, {}]; + visualElement?.values.forEach((value, key) => { + state[0][key] = value.get(); + state[1][key] = value.getVelocity(); + }); + return state; + } + function resolveVariantFromProps(props, definition, custom, visualElement) { + /** + * If the variant definition is a function, resolve. + */ + if (typeof definition === "function") { + const [current, velocity] = getValueState(visualElement); + definition = definition(custom !== undefined ? custom : props.custom, current, velocity); + } + /** + * If the variant definition is a variant label, or + * the function returned a variant label, resolve. + */ + if (typeof definition === "string") { + definition = props.variants && props.variants[definition]; + } + /** + * At this point we've resolved both functions and variant labels, + * but the resolved variant label might itself have been a function. + * If so, resolve. This can only have returned a valid target object. + */ + if (typeof definition === "function") { + const [current, velocity] = getValueState(visualElement); + definition = definition(custom !== undefined ? custom : props.custom, current, velocity); + } + return definition; + } + + function resolveVariant(visualElement, definition, custom) { + const props = visualElement.getProps(); + return resolveVariantFromProps(props, definition, custom !== undefined ? custom : props.custom, visualElement); + } + + const positionalKeys = new Set([ + "width", + "height", + "top", + "left", + "right", + "bottom", + ...transformPropOrder, + ]); + + const isKeyframesTarget = (v) => { + return Array.isArray(v); + }; + + /** + * Set VisualElement's MotionValue, creating a new MotionValue for it if + * it doesn't exist. + */ + function setMotionValue(visualElement, key, value) { + if (visualElement.hasValue(key)) { + visualElement.getValue(key).set(value); + } + else { + visualElement.addValue(key, motionValue(value)); + } + } + function resolveFinalValueInKeyframes(v) { + // TODO maybe throw if v.length - 1 is placeholder token? + return isKeyframesTarget(v) ? v[v.length - 1] || 0 : v; + } + function setTarget(visualElement, definition) { + const resolved = resolveVariant(visualElement, definition); + let { transitionEnd = {}, transition = {}, ...target } = resolved || {}; + target = { ...target, ...transitionEnd }; + for (const key in target) { + const value = resolveFinalValueInKeyframes(target[key]); + setMotionValue(visualElement, key, value); + } + } + + const isMotionValue = (value) => Boolean(value && value.getVelocity); + + function isWillChangeMotionValue(value) { + return Boolean(isMotionValue(value) && value.add); + } + + function addValueToWillChange(visualElement, key) { + const willChange = visualElement.getValue("willChange"); + /** + * It could be that a user has set willChange to a regular MotionValue, + * in which case we can't add the value to it. + */ + if (isWillChangeMotionValue(willChange)) { + return willChange.add(key); + } + else if (!willChange && MotionGlobalConfig.WillChange) { + const newWillChange = new MotionGlobalConfig.WillChange("auto"); + visualElement.addValue("willChange", newWillChange); + newWillChange.add(key); + } + } + + function camelToDash(str) { + return str.replace(/([A-Z])/g, (match) => `-${match.toLowerCase()}`); + } + + const optimizedAppearDataId = "framerAppearId"; + const optimizedAppearDataAttribute = "data-" + camelToDash(optimizedAppearDataId); + + function getOptimisedAppearId(visualElement) { + return visualElement.props[optimizedAppearDataAttribute]; + } + + /** + * Decide whether we should block this animation. Previously, we achieved this + * just by checking whether the key was listed in protectedKeys, but this + * posed problems if an animation was triggered by afterChildren and protectedKeys + * had been set to true in the meantime. + */ + function shouldBlockAnimation({ protectedKeys, needsAnimating }, key) { + const shouldBlock = protectedKeys.hasOwnProperty(key) && needsAnimating[key] !== true; + needsAnimating[key] = false; + return shouldBlock; + } + function animateTarget(visualElement, targetAndTransition, { delay = 0, transitionOverride, type } = {}) { + let { transition, transitionEnd, ...target } = targetAndTransition; + const defaultTransition = visualElement.getDefaultTransition(); + transition = transition + ? resolveTransition(transition, defaultTransition) + : defaultTransition; + const reduceMotion = transition?.reduceMotion; + const skipAnimations = transition?.skipAnimations; + if (transitionOverride) + transition = transitionOverride; + const animations = []; + const animationTypeState = type && + visualElement.animationState && + visualElement.animationState.getState()[type]; + const path = transition?.path; + if (path) { + // path mutates `target` to claim x/y; loop below skips them. + path.animateVisualElement(visualElement, target, transition, delay, animations); + } + for (const key in target) { + const value = visualElement.getValue(key, visualElement.latestValues[key] ?? null); + const valueTarget = target[key]; + if (valueTarget === undefined || + (animationTypeState && + shouldBlockAnimation(animationTypeState, key))) { + continue; + } + const valueTransition = { + delay, + ...getValueTransition$1(transition || {}, key), + }; + if (skipAnimations) + valueTransition.skipAnimations = true; + /** + * If the value is already at the defined target, skip the animation. + * We still re-assert the value via frame.update to take precedence + * over any stale transitionEnd callbacks from previous animations. + */ + const currentValue = value.get(); + if (currentValue !== undefined && + !value.isAnimating() && + !Array.isArray(valueTarget) && + valueTarget === currentValue && + !valueTransition.velocity) { + frame.update(() => value.set(valueTarget)); + continue; + } + /** + * If this is the first time a value is being animated, check + * to see if we're handling off from an existing animation. + */ + let isHandoff = false; + if (window.MotionHandoffAnimation) { + const appearId = getOptimisedAppearId(visualElement); + if (appearId) { + const startTime = window.MotionHandoffAnimation(appearId, key, frame); + if (startTime !== null) { + valueTransition.startTime = startTime; + isHandoff = true; + } + } + } + addValueToWillChange(visualElement, key); + const shouldReduceMotion = reduceMotion ?? visualElement.shouldReduceMotion; + value.start(animateMotionValue(key, value, valueTarget, shouldReduceMotion && positionalKeys.has(key) + ? { type: false } + : valueTransition, visualElement, isHandoff)); + const animation = value.animation; + if (animation) { + animations.push(animation); + } + } + if (transitionEnd) { + const applyTransitionEnd = () => frame.update(() => { + transitionEnd && setTarget(visualElement, transitionEnd); + }); + if (animations.length) { + Promise.all(animations).then(applyTransitionEnd); + } + else { + applyTransitionEnd(); + } + } + return animations; + } + + function animateVariant(visualElement, variant, options = {}) { + const resolved = resolveVariant(visualElement, variant, options.type === "exit" + ? visualElement.presenceContext?.custom + : undefined); + let { transition = visualElement.getDefaultTransition() || {} } = resolved || {}; + if (options.transitionOverride) { + transition = options.transitionOverride; + } + /** + * If we have a variant, create a callback that runs it as an animation. + * Otherwise, we resolve a Promise immediately for a composable no-op. + */ + const getAnimation = resolved + ? () => Promise.all(animateTarget(visualElement, resolved, options)) + : () => Promise.resolve(); + /** + * If we have children, create a callback that runs all their animations. + * Otherwise, we resolve a Promise immediately for a composable no-op. + */ + const getChildAnimations = visualElement.variantChildren && visualElement.variantChildren.size + ? (forwardDelay = 0) => { + const { delayChildren = 0, staggerChildren, staggerDirection, } = transition; + return animateChildren(visualElement, variant, forwardDelay, delayChildren, staggerChildren, staggerDirection, options); + } + : () => Promise.resolve(); + /** + * If the transition explicitly defines a "when" option, we need to resolve either + * this animation or all children animations before playing the other. + */ + const { when } = transition; + if (when) { + const [first, last] = when === "beforeChildren" + ? [getAnimation, getChildAnimations] + : [getChildAnimations, getAnimation]; + return first().then(() => last()); + } + else { + return Promise.all([getAnimation(), getChildAnimations(options.delay)]); + } + } + function animateChildren(visualElement, variant, delay = 0, delayChildren = 0, staggerChildren = 0, staggerDirection = 1, options) { + const animations = []; + for (const child of visualElement.variantChildren) { + child.notify("AnimationStart", variant); + animations.push(animateVariant(child, variant, { + ...options, + delay: delay + + (typeof delayChildren === "function" ? 0 : delayChildren) + + calcChildStagger(visualElement.variantChildren, child, delayChildren, staggerChildren, staggerDirection), + }).then(() => child.notify("AnimationComplete", variant))); + } + return Promise.all(animations); + } + + function animateVisualElement(visualElement, definition, options = {}) { + visualElement.notify("AnimationStart", definition); + let animation; + if (Array.isArray(definition)) { + const animations = definition.map((variant) => animateVariant(visualElement, variant, options)); + animation = Promise.all(animations); + } + else if (typeof definition === "string") { + animation = animateVariant(visualElement, definition, options); + } + else { + const resolvedDefinition = typeof definition === "function" + ? resolveVariant(visualElement, definition, options.custom) + : definition; + animation = Promise.all(animateTarget(visualElement, resolvedDefinition, options)); + } + return animation.then(() => { + visualElement.notify("AnimationComplete", definition); + }); + } + + /** + * ValueType for "auto" + */ + const auto = { + test: (v) => v === "auto", + parse: (v) => v, + }; + + /** + * Tests a provided value against a ValueType + */ + const testValueType = (v) => (type) => type.test(v); + + /** + * A list of value types commonly used for dimensions + */ + const dimensionValueTypes = [number, px, percent, degrees, vw, vh, auto]; + /** + * Tests a dimensional value against the list of dimension ValueTypes + */ + const findDimensionValueType = (v) => dimensionValueTypes.find(testValueType(v)); + + function isNone(value) { + if (typeof value === "number") { + return value === 0; + } + else if (value !== null) { + return value === "none" || value === "0" || isZeroValueString(value); + } + else { + return true; + } + } + + /** + * Properties that should default to 1 or 100% + */ + const maxDefaults = new Set(["brightness", "contrast", "saturate", "opacity"]); + function applyDefaultFilter(v) { + const [name, value] = v.slice(0, -1).split("("); + if (name === "drop-shadow") + return v; + const [number] = value.match(floatRegex) || []; + if (!number) + return v; + const unit = value.replace(number, ""); + let defaultValue = maxDefaults.has(name) ? 1 : 0; + if (number !== value) + defaultValue *= 100; + return name + "(" + defaultValue + unit + ")"; + } + const functionRegex = /\b([a-z-]*)\(.*?\)/gu; + const filter = { + ...complex, + getAnimatableNone: (v) => { + const functions = v.match(functionRegex); + return functions ? functions.map(applyDefaultFilter).join(" ") : v; + }, + }; + + const mask = { + ...complex, + getAnimatableNone: (v) => { + const parsed = complex.parse(v); + const transformer = complex.createTransformer(v); + return transformer(parsed.map((v) => typeof v === "number" ? 0 : typeof v === "object" ? { ...v, alpha: 1 } : v)); + }, + }; + + const int = { + ...number, + transform: Math.round, + }; + + const transformValueTypes = { + rotate: degrees, + /** + * Internal channel for `transition.path` orientToPath. Composed onto + * `rotate` at the transform-build sites so the user's `rotate` is + * never read or overwritten. Not part of `transformPropOrder`. + */ + pathRotation: degrees, + rotateX: degrees, + rotateY: degrees, + rotateZ: degrees, + scale, + scaleX: scale, + scaleY: scale, + scaleZ: scale, + skew: degrees, + skewX: degrees, + skewY: degrees, + distance: px, + translateX: px, + translateY: px, + translateZ: px, + x: px, + y: px, + z: px, + perspective: px, + transformPerspective: px, + opacity: alpha, + originX: progressPercentage, + originY: progressPercentage, + originZ: px, + }; + + const numberValueTypes = { + // Border props + borderWidth: px, + borderTopWidth: px, + borderRightWidth: px, + borderBottomWidth: px, + borderLeftWidth: px, + borderRadius: px, + borderTopLeftRadius: px, + borderTopRightRadius: px, + borderBottomRightRadius: px, + borderBottomLeftRadius: px, + // Positioning props + width: px, + maxWidth: px, + height: px, + maxHeight: px, + top: px, + right: px, + bottom: px, + left: px, + inset: px, + insetBlock: px, + insetBlockStart: px, + insetBlockEnd: px, + insetInline: px, + insetInlineStart: px, + insetInlineEnd: px, + // Spacing props + padding: px, + paddingTop: px, + paddingRight: px, + paddingBottom: px, + paddingLeft: px, + paddingBlock: px, + paddingBlockStart: px, + paddingBlockEnd: px, + paddingInline: px, + paddingInlineStart: px, + paddingInlineEnd: px, + margin: px, + marginTop: px, + marginRight: px, + marginBottom: px, + marginLeft: px, + marginBlock: px, + marginBlockStart: px, + marginBlockEnd: px, + marginInline: px, + marginInlineStart: px, + marginInlineEnd: px, + // Typography + fontSize: px, + // Misc + backgroundPositionX: px, + backgroundPositionY: px, + ...transformValueTypes, + zIndex: int, + // SVG + fillOpacity: alpha, + strokeOpacity: alpha, + numOctaves: int, + }; + + /** + * A map of default value types for common values + */ + const defaultValueTypes = { + ...numberValueTypes, + // Color props + color, + backgroundColor: color, + outlineColor: color, + fill: color, + stroke: color, + // Border props + borderColor: color, + borderTopColor: color, + borderRightColor: color, + borderBottomColor: color, + borderLeftColor: color, + filter, + WebkitFilter: filter, + mask, + WebkitMask: mask, + }; + /** + * Gets the default ValueType for the provided value key + */ + const getDefaultValueType = (key) => defaultValueTypes[key]; + + const customTypes = /*@__PURE__*/ new Set([filter, mask]); + function getAnimatableNone(key, value) { + let defaultValueType = getDefaultValueType(key); + if (!customTypes.has(defaultValueType)) + defaultValueType = complex; + // If value is not recognised as animatable, ie "none", create an animatable version origin based on the target + return defaultValueType.getAnimatableNone + ? defaultValueType.getAnimatableNone(value) + : undefined; + } + + /** + * If we encounter keyframes like "none" or "0" and we also have keyframes like + * "#fff" or "200px 200px" we want to find a keyframe to serve as a template for + * the "none" keyframes. In this case "#fff" or "200px 200px" - then these get turned into + * zero equivalents, i.e. "#fff0" or "0px 0px". + */ + const invalidTemplates = new Set(["auto", "none", "0"]); + function makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, name) { + let i = 0; + let animatableTemplate = undefined; + while (i < unresolvedKeyframes.length && !animatableTemplate) { + const keyframe = unresolvedKeyframes[i]; + if (typeof keyframe === "string" && + !invalidTemplates.has(keyframe) && + analyseComplexValue(keyframe).values.length) { + animatableTemplate = unresolvedKeyframes[i]; + } + i++; + } + if (animatableTemplate && name) { + for (const noneIndex of noneKeyframeIndexes) { + unresolvedKeyframes[noneIndex] = getAnimatableNone(name, animatableTemplate); + } + } + } + + class DOMKeyframesResolver extends KeyframeResolver { + constructor(unresolvedKeyframes, onComplete, name, motionValue, element) { + super(unresolvedKeyframes, onComplete, name, motionValue, element, true); + } + readKeyframes() { + const { unresolvedKeyframes, element, name } = this; + if (!element || !element.current) + return; + super.readKeyframes(); + /** + * If any keyframe is a CSS variable, we need to find its value by sampling the element + */ + for (let i = 0; i < unresolvedKeyframes.length; i++) { + let keyframe = unresolvedKeyframes[i]; + if (typeof keyframe === "string") { + keyframe = keyframe.trim(); + if (isCSSVariableToken(keyframe)) { + const resolved = getVariableValue(keyframe, element.current); + if (resolved !== undefined) { + unresolvedKeyframes[i] = resolved; + } + if (i === unresolvedKeyframes.length - 1) { + this.finalKeyframe = keyframe; + } + } + } + } + /** + * Resolve "none" values. We do this potentially twice - once before and once after measuring keyframes. + * This could be seen as inefficient but it's a trade-off to avoid measurements in more situations, which + * have a far bigger performance impact. + */ + this.resolveNoneKeyframes(); + /** + * Check to see if unit type has changed. If so schedule jobs that will + * temporarily set styles to the destination keyframes. + * Skip if we have more than two keyframes or this isn't a positional value. + * TODO: We can throw if there are multiple keyframes and the value type changes. + */ + if (!positionalKeys.has(name) || unresolvedKeyframes.length !== 2) { + return; + } + const [origin, target] = unresolvedKeyframes; + const originType = findDimensionValueType(origin); + const targetType = findDimensionValueType(target); + /** + * If one keyframe contains embedded CSS variables (e.g. in calc()) and the other + * doesn't, we need to measure to convert to pixels. This handles GitHub issue #3410. + */ + const originHasVar = containsCSSVariable(origin); + const targetHasVar = containsCSSVariable(target); + if (originHasVar !== targetHasVar && positionalValues[name]) { + this.needsMeasurement = true; + return; + } + /** + * Either we don't recognise these value types or we can animate between them. + */ + if (originType === targetType) + return; + /** + * If both values are numbers or pixels, we can animate between them by + * converting them to numbers. + */ + if (isNumOrPxType(originType) && isNumOrPxType(targetType)) { + for (let i = 0; i < unresolvedKeyframes.length; i++) { + const value = unresolvedKeyframes[i]; + if (typeof value === "string") { + unresolvedKeyframes[i] = parseFloat(value); + } + } + } + else if (positionalValues[name]) { + /** + * Else, the only way to resolve this is by measuring the element. + */ + this.needsMeasurement = true; + } + } + resolveNoneKeyframes() { + const { unresolvedKeyframes, name } = this; + const noneKeyframeIndexes = []; + for (let i = 0; i < unresolvedKeyframes.length; i++) { + if (unresolvedKeyframes[i] === null || + isNone(unresolvedKeyframes[i])) { + noneKeyframeIndexes.push(i); + } + } + if (noneKeyframeIndexes.length) { + makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, name); + } + } + measureInitialState() { + const { element, unresolvedKeyframes, name } = this; + if (!element || !element.current) + return; + if (name === "height") { + this.suspendedScrollY = window.pageYOffset; + } + this.measuredOrigin = positionalValues[name](element.measureViewportBox(), window.getComputedStyle(element.current)); + unresolvedKeyframes[0] = this.measuredOrigin; + // Set final key frame to measure after next render + const measureKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1]; + if (measureKeyframe !== undefined) { + element.getValue(name, measureKeyframe).jump(measureKeyframe, false); + } + } + measureEndState() { + const { element, name, unresolvedKeyframes } = this; + if (!element || !element.current) + return; + const value = element.getValue(name); + value && value.jump(this.measuredOrigin, false); + const finalKeyframeIndex = unresolvedKeyframes.length - 1; + const finalKeyframe = unresolvedKeyframes[finalKeyframeIndex]; + unresolvedKeyframes[finalKeyframeIndex] = positionalValues[name](element.measureViewportBox(), window.getComputedStyle(element.current)); + if (finalKeyframe !== null && this.finalKeyframe === undefined) { + this.finalKeyframe = finalKeyframe; + } + // If we removed transform values, reapply them before the next render + if (this.removedTransforms?.length) { + this.removedTransforms.forEach(([unsetTransformName, unsetTransformValue]) => { + element + .getValue(unsetTransformName) + .set(unsetTransformValue); + }); + } + this.resolveNoneKeyframes(); + } + } + + /** + * The four corner-radius longhands. Shared so the projection mixer, scale + * corrector, WAAPI px-value set and view-transition crop pass don't each carry + * their own copy. Order is irrelevant - every consumer mixes/corrects/animates + * each corner independently. + */ + const cornerRadiusProps = [ + "borderTopLeftRadius", + "borderTopRightRadius", + "borderBottomRightRadius", + "borderBottomLeftRadius", + ]; + + const pxValues = new Set([ + // Border props + "borderWidth", + "borderTopWidth", + "borderRightWidth", + "borderBottomWidth", + "borderLeftWidth", + "borderRadius", + ...cornerRadiusProps, + // Positioning props + "width", + "maxWidth", + "height", + "maxHeight", + "top", + "right", + "bottom", + "left", + "inset", + "insetBlock", + "insetBlockStart", + "insetBlockEnd", + "insetInline", + "insetInlineStart", + "insetInlineEnd", + // Spacing props + "padding", + "paddingTop", + "paddingRight", + "paddingBottom", + "paddingLeft", + "paddingBlock", + "paddingBlockStart", + "paddingBlockEnd", + "paddingInline", + "paddingInlineStart", + "paddingInlineEnd", + "margin", + "marginTop", + "marginRight", + "marginBottom", + "marginLeft", + "marginBlock", + "marginBlockStart", + "marginBlockEnd", + "marginInline", + "marginInlineStart", + "marginInlineEnd", + // Typography + "fontSize", + // Misc + "backgroundPositionX", + "backgroundPositionY", + ]); + + function applyPxDefaults(keyframes, name) { + for (let i = 0; i < keyframes.length; i++) { + if (typeof keyframes[i] === "number" && pxValues.has(name)) { + keyframes[i] = keyframes[i] + "px"; + } + } + } + + function isWaapiSupportedEasing(easing) { + return Boolean((typeof easing === "function" && supportsLinearEasing()) || + !easing || + (typeof easing === "string" && + (easing in supportedWaapiEasing || supportsLinearEasing())) || + isBezierDefinition(easing) || + (Array.isArray(easing) && easing.every(isWaapiSupportedEasing))); + } + + const supportsPartialKeyframes = /*@__PURE__*/ memo(() => { + try { + document.createElement("div").animate({ opacity: [1] }); + } + catch (e) { + return false; + } + return true; + }); + + function resolveElements(elementOrSelector, scope, selectorCache) { + if (elementOrSelector == null) { + return []; + } + if (elementOrSelector instanceof EventTarget) { + return [elementOrSelector]; + } + else if (typeof elementOrSelector === "string") { + let root = document; + if (scope) { + root = scope.current; + } + const elements = selectorCache?.[elementOrSelector] ?? + root.querySelectorAll(elementOrSelector); + return elements ? Array.from(elements) : []; + } + return Array.from(elementOrSelector).filter((element) => element != null); + } + + function createSelectorEffect(subjectEffect) { + return (subject, values) => { + const elements = resolveElements(subject); + const subscriptions = []; + for (const element of elements) { + const remove = subjectEffect(element, values); + subscriptions.push(remove); + } + return () => { + for (const remove of subscriptions) + remove(); + }; + }; + } + + /** + * Provided a value and a ValueType, returns the value as that value type. + */ + const getValueAsType = (value, type) => { + return type && typeof value === "number" + ? type.transform(value) + : value; + }; + + class MotionValueState { + constructor() { + this.latest = {}; + this.values = new Map(); + } + set(name, value, render, computed, useDefaultValueType = true) { + const existingValue = this.values.get(name); + if (existingValue) { + existingValue.onRemove(); + } + const onChange = () => { + const v = value.get(); + if (useDefaultValueType) { + this.latest[name] = getValueAsType(v, numberValueTypes[name]); + } + else { + this.latest[name] = v; + } + render && frame.render(render); + }; + onChange(); + const cancelOnChange = value.on("change", onChange); + computed && value.addDependent(computed); + const remove = () => { + cancelOnChange(); + render && cancelFrame(render); + this.values.delete(name); + computed && value.removeDependent(computed); + }; + this.values.set(name, { value, onRemove: remove }); + return remove; + } + get(name) { + return this.values.get(name)?.value; + } + } + + function createEffect(addValue) { + const stateCache = new WeakMap(); + return (subject, values) => { + const state = stateCache.get(subject) ?? new MotionValueState(); + stateCache.set(subject, state); + const subscriptions = []; + for (const key in values) { + const value = values[key]; + const remove = addValue(subject, state, key, value); + subscriptions.push(remove); + } + return () => { + for (const cancel of subscriptions) + cancel(); + }; + }; + } + + function canSetAsProperty(element, name) { + if (!(name in element)) + return false; + const descriptor = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(element), name) || + Object.getOwnPropertyDescriptor(element, name); + // Check if it has a setter + return descriptor && typeof descriptor.set === "function"; + } + const addAttrValue = (element, state, key, value) => { + const isProp = canSetAsProperty(element, key); + const name = isProp + ? key + : key.startsWith("data") || key.startsWith("aria") + ? camelToDash(key) + : key; + /** + * Set attribute directly via property if available + */ + const render = isProp + ? () => { + element[name] = state.latest[key]; + } + : () => { + const v = state.latest[key]; + if (v === null || v === undefined) { + element.removeAttribute(name); + } + else { + element.setAttribute(name, String(v)); + } + }; + return state.set(key, value, render); + }; + const attrEffect = /*@__PURE__*/ createSelectorEffect( + /*@__PURE__*/ createEffect(addAttrValue)); + + const propEffect = /*@__PURE__*/ createEffect((subject, state, key, value) => { + return state.set(key, value, () => { + subject[key] = state.latest[key]; + }, undefined, false); + }); + + /** + * Checks if an element is an HTML element in a way + * that works across iframes + */ + function isHTMLElement(element) { + return (isObject(element) && + "offsetHeight" in element && + !("ownerSVGElement" in element)); + } + + const translateAlias$1 = { + x: "translateX", + y: "translateY", + z: "translateZ", + transformPerspective: "perspective", + }; + function buildTransform$1(state) { + let transform = ""; + let transformIsDefault = true; + /** + * Loop over all possible transforms in order, adding the ones that + * are present to the transform string. + */ + for (let i = 0; i < transformPropOrder.length; i++) { + const key = transformPropOrder[i]; + const value = state.latest[key]; + if (value === undefined) + continue; + let valueIsDefault = true; + if (typeof value === "number") { + valueIsDefault = value === (key.startsWith("scale") ? 1 : 0); + } + else { + const parsed = parseFloat(value); + valueIsDefault = key.startsWith("scale") ? parsed === 1 : parsed === 0; + } + if (!valueIsDefault) { + transformIsDefault = false; + const transformName = translateAlias$1[key] || key; + transform += `${transformName}(${value}) `; + } + } + // See build-transform.ts: additive `rotate()` so user `rotate` isn't + // clobbered. Not a `transformPropOrder` slot. + const pathRotation = state.latest.pathRotation; + if (pathRotation) { + transformIsDefault = false; + transform += `rotate(${typeof pathRotation === "number" + ? `${pathRotation}deg` + : pathRotation}) `; + } + return transformIsDefault ? "none" : transform.trim(); + } + + const originProps = new Set(["originX", "originY", "originZ"]); + const addStyleValue = (element, state, key, value) => { + let render = undefined; + let computed = undefined; + if (transformProps.has(key)) { + if (!state.get("transform")) { + // If this is an HTML element, we need to set the transform-box to fill-box + // to normalise the transform relative to the element's bounding box + if (!isHTMLElement(element) && !state.get("transformBox")) { + addStyleValue(element, state, "transformBox", new MotionValue("fill-box")); + } + state.set("transform", new MotionValue("none"), () => { + element.style.transform = buildTransform$1(state); + }); + } + computed = state.get("transform"); + } + else if (originProps.has(key)) { + if (!state.get("transformOrigin")) { + state.set("transformOrigin", new MotionValue(""), () => { + const originX = state.latest.originX ?? "50%"; + const originY = state.latest.originY ?? "50%"; + const originZ = state.latest.originZ ?? 0; + element.style.transformOrigin = `${originX} ${originY} ${originZ}`; + }); + } + computed = state.get("transformOrigin"); + } + else if (isCSSVar(key)) { + render = () => { + element.style.setProperty(key, state.latest[key]); + }; + } + else { + render = () => { + element.style[key] = state.latest[key]; + }; + } + return state.set(key, value, render, computed); + }; + const styleEffect = /*@__PURE__*/ createSelectorEffect( + /*@__PURE__*/ createEffect(addStyleValue)); + + function addSVGPathValue(element, state, key, value) { + frame.render(() => element.setAttribute("pathLength", "1")); + if (key === "pathOffset") { + return state.set(key, value, () => { + // Use unitless value to avoid Safari zoom bug + const offset = state.latest[key]; + element.setAttribute("stroke-dashoffset", `${-offset}`); + }); + } + else { + if (!state.get("stroke-dasharray")) { + state.set("stroke-dasharray", new MotionValue("1 1"), () => { + const { pathLength = 1, pathSpacing } = state.latest; + // Use unitless values to avoid Safari zoom bug + element.setAttribute("stroke-dasharray", `${pathLength} ${pathSpacing ?? 1 - Number(pathLength)}`); + }); + } + return state.set(key, value, undefined, state.get("stroke-dasharray")); + } + } + const addSVGValue = (element, state, key, value) => { + if (key.startsWith("path")) { + return addSVGPathValue(element, state, key, value); + } + else if (key.startsWith("attr")) { + return addAttrValue(element, state, convertAttrKey(key), value); + } + const handler = key in element.style ? addStyleValue : addAttrValue; + return handler(element, state, key, value); + }; + const svgEffect = /*@__PURE__*/ createSelectorEffect( + /*@__PURE__*/ createEffect(addSVGValue)); + function convertAttrKey(key) { + return key.replace(/^attr([A-Z])/, (_, firstChar) => firstChar.toLowerCase()); + } + + const { schedule: microtask, cancel: cancelMicrotask } = + /* @__PURE__ */ createRenderBatcher(queueMicrotask, false); + + const isDragging = { + x: false, + y: false, + }; + function isDragActive() { + return isDragging.x || isDragging.y; + } + + function setDragLock(axis) { + if (axis === "x" || axis === "y") { + if (isDragging[axis]) { + return null; + } + else { + isDragging[axis] = true; + return () => { + isDragging[axis] = false; + }; + } + } + else { + if (isDragging.x || isDragging.y) { + return null; + } + else { + isDragging.x = isDragging.y = true; + return () => { + isDragging.x = isDragging.y = false; + }; + } + } + } + + function setupGesture(elementOrSelector, options) { + const elements = resolveElements(elementOrSelector); + const gestureAbortController = new AbortController(); + const eventOptions = { + passive: true, + ...options, + signal: gestureAbortController.signal, + }; + const cancel = () => gestureAbortController.abort(); + return [elements, eventOptions, cancel]; + } + + function isValidHover(event) { + return !(event.pointerType === "touch" || isDragActive()); + } + /** + * Create a hover gesture. hover() is different to .addEventListener("pointerenter") + * in that it has an easier syntax, filters out polyfilled touch events, interoperates + * with drag gestures, and automatically removes the "pointerennd" event listener when the hover ends. + * + * @public + */ + function hover(elementOrSelector, onHoverStart, options = {}) { + const [elements, eventOptions, cancel] = setupGesture(elementOrSelector, options); + elements.forEach((element) => { + let isPressed = false; + let deferredHoverEnd = false; + let hoverEndCallback; + const removePointerLeave = () => { + element.removeEventListener("pointerleave", onPointerLeave); + }; + const endHover = (event) => { + if (hoverEndCallback) { + hoverEndCallback(event); + hoverEndCallback = undefined; + } + removePointerLeave(); + }; + const onPointerUp = (event) => { + isPressed = false; + window.removeEventListener("pointerup", onPointerUp); + window.removeEventListener("pointercancel", onPointerUp); + if (deferredHoverEnd) { + deferredHoverEnd = false; + endHover(event); + } + }; + const onPointerDown = () => { + isPressed = true; + window.addEventListener("pointerup", onPointerUp, eventOptions); + window.addEventListener("pointercancel", onPointerUp, eventOptions); + }; + const onPointerLeave = (leaveEvent) => { + if (leaveEvent.pointerType === "touch") + return; + if (isPressed) { + deferredHoverEnd = true; + return; + } + endHover(leaveEvent); + }; + const onPointerEnter = (enterEvent) => { + if (!isValidHover(enterEvent)) + return; + deferredHoverEnd = false; + const onHoverEnd = onHoverStart(element, enterEvent); + if (typeof onHoverEnd !== "function") + return; + hoverEndCallback = onHoverEnd; + element.addEventListener("pointerleave", onPointerLeave, eventOptions); + }; + element.addEventListener("pointerenter", onPointerEnter, eventOptions); + element.addEventListener("pointerdown", onPointerDown, eventOptions); + }); + return cancel; + } + + /** + * Recursively traverse up the tree to check whether the provided child node + * is the parent or a descendant of it. + * + * @param parent - Element to find + * @param child - Element to test against parent + */ + const isNodeOrChild = (parent, child) => { + if (!child) { + return false; + } + else if (parent === child) { + return true; + } + else { + return isNodeOrChild(parent, child.parentElement); + } + }; + + const isPrimaryPointer = (event) => { + if (event.pointerType === "mouse") { + return typeof event.button !== "number" || event.button <= 0; + } + else { + /** + * isPrimary is true for all mice buttons, whereas every touch point + * is regarded as its own input. So subsequent concurrent touch points + * will be false. + * + * Specifically match against false here as incomplete versions of + * PointerEvents in very old browser might have it set as undefined. + */ + return event.isPrimary !== false; + } + }; + + const keyboardAccessibleElements = new Set([ + "BUTTON", + "INPUT", + "SELECT", + "TEXTAREA", + "A", + ]); + /** + * Checks if an element is natively keyboard accessible (focusable). + * Used by the press gesture to determine if we need to add tabIndex. + */ + function isElementKeyboardAccessible(element) { + return (keyboardAccessibleElements.has(element.tagName) || + element.isContentEditable === true); + } + const textInputElements = new Set(["INPUT", "SELECT", "TEXTAREA"]); + /** + * Checks if an element has text selection or direct interaction behavior + * that should block drag gestures from starting. + * + * This specifically targets form controls where the user might want to select + * text or interact with the control (e.g., sliders, dropdowns). + * + * Buttons and links are NOT included because they don't have click-and-move + * actions of their own - they only respond to click events, so dragging + * should still work when initiated from these elements. + */ + function isElementTextInput(element) { + return (textInputElements.has(element.tagName) || + element.isContentEditable === true); + } + + const isPressing = new WeakSet(); + + /** + * Filter out events that are not "Enter" keys. + */ + function filterEvents(callback) { + return (event) => { + if (event.key !== "Enter") + return; + callback(event); + }; + } + function firePointerEvent(target, type) { + target.dispatchEvent(new PointerEvent("pointer" + type, { isPrimary: true, bubbles: true })); + } + const enableKeyboardPress = (focusEvent, eventOptions) => { + const element = focusEvent.currentTarget; + if (!element) + return; + const handleKeydown = filterEvents(() => { + if (isPressing.has(element)) + return; + firePointerEvent(element, "down"); + const handleKeyup = filterEvents(() => { + firePointerEvent(element, "up"); + }); + const handleBlur = () => firePointerEvent(element, "cancel"); + element.addEventListener("keyup", handleKeyup, eventOptions); + element.addEventListener("blur", handleBlur, eventOptions); + }); + element.addEventListener("keydown", handleKeydown, eventOptions); + /** + * Add an event listener that fires on blur to remove the keydown events. + */ + element.addEventListener("blur", () => element.removeEventListener("keydown", handleKeydown), eventOptions); + }; + + /** + * Filter out events that are not primary pointer events, or are triggering + * while a Motion gesture is active. + */ + function isValidPressEvent(event) { + return isPrimaryPointer(event) && !isDragActive(); + } + const claimedPointerDownEvents = new WeakSet(); + /** + * Create a press gesture. + * + * Press is different to `"pointerdown"`, `"pointerup"` in that it + * automatically filters out secondary pointer events like right + * click and multitouch. + * + * It also adds accessibility support for keyboards, where + * an element with a press gesture will receive focus and + * trigger on Enter `"keydown"` and `"keyup"` events. + * + * This is different to a browser's `"click"` event, which does + * respond to keyboards but only for the `"click"` itself, rather + * than the press start and end/cancel. The element also needs + * to be focusable for this to work, whereas a press gesture will + * make an element focusable by default. + * + * @public + */ + function press(targetOrSelector, onPressStart, options = {}) { + const [targets, eventOptions, cancelEvents] = setupGesture(targetOrSelector, options); + const startPress = (startEvent) => { + const target = startEvent.currentTarget; + if (!isValidPressEvent(startEvent)) + return; + if (claimedPointerDownEvents.has(startEvent)) + return; + isPressing.add(target); + if (options.stopPropagation) { + claimedPointerDownEvents.add(startEvent); + } + const onPressEnd = onPressStart(target, startEvent); + /** + * End listeners run in the capture phase so a descendant calling + * stopPropagation() in its own pointerup handler can't prevent the + * press gesture from ending. This also keeps the gesture-end + * ordering consistent with the drag gesture. See #2794. + */ + const endEventOptions = { ...eventOptions, capture: true }; + const onPointerEnd = (endEvent, success) => { + window.removeEventListener("pointerup", onPointerUp, endEventOptions); + window.removeEventListener("pointercancel", onPointerCancel, endEventOptions); + if (isPressing.has(target)) { + isPressing.delete(target); + } + if (!isValidPressEvent(endEvent)) { + return; + } + if (typeof onPressEnd === "function") { + onPressEnd(endEvent, { success }); + } + }; + const onPointerUp = (upEvent) => { + onPointerEnd(upEvent, target === window || + target === document || + options.useGlobalTarget || + isNodeOrChild(target, upEvent.target)); + }; + const onPointerCancel = (cancelEvent) => { + onPointerEnd(cancelEvent, false); + }; + window.addEventListener("pointerup", onPointerUp, endEventOptions); + window.addEventListener("pointercancel", onPointerCancel, endEventOptions); + }; + targets.forEach((target) => { + const pointerDownTarget = options.useGlobalTarget ? window : target; + pointerDownTarget.addEventListener("pointerdown", startPress, eventOptions); + if (isHTMLElement(target)) { + target.addEventListener("focus", (event) => enableKeyboardPress(event, eventOptions)); + if (!isElementKeyboardAccessible(target) && + !target.hasAttribute("tabindex")) { + target.tabIndex = 0; + } + } + }); + return cancelEvents; + } + + function getComputedStyle$2(element, name) { + const computedStyle = window.getComputedStyle(element); + return isCSSVar(name) + ? computedStyle.getPropertyValue(name) + : computedStyle[name]; + } + + /** + * Checks if an element is an SVG element in a way + * that works across iframes + */ + function isSVGElement(element) { + return isObject(element) && "ownerSVGElement" in element; + } + + const resizeHandlers = new WeakMap(); + let observer; + const getSize = (borderBoxAxis, svgAxis, htmlAxis) => (target, borderBoxSize) => { + if (borderBoxSize && borderBoxSize[0]) { + return borderBoxSize[0][(borderBoxAxis + "Size")]; + } + else if (isSVGElement(target) && "getBBox" in target) { + return target.getBBox()[svgAxis]; + } + else { + return target[htmlAxis]; + } + }; + const getWidth = /*@__PURE__*/ getSize("inline", "width", "offsetWidth"); + const getHeight = /*@__PURE__*/ getSize("block", "height", "offsetHeight"); + function notifyTarget({ target, borderBoxSize }) { + resizeHandlers.get(target)?.forEach((handler) => { + handler(target, { + get width() { + return getWidth(target, borderBoxSize); + }, + get height() { + return getHeight(target, borderBoxSize); + }, + }); + }); + } + function notifyAll(entries) { + entries.forEach(notifyTarget); + } + function createResizeObserver() { + if (typeof ResizeObserver === "undefined") + return; + observer = new ResizeObserver(notifyAll); + } + function resizeElement(target, handler) { + if (!observer) + createResizeObserver(); + const elements = resolveElements(target); + elements.forEach((element) => { + let elementHandlers = resizeHandlers.get(element); + if (!elementHandlers) { + elementHandlers = new Set(); + resizeHandlers.set(element, elementHandlers); + } + elementHandlers.add(handler); + observer?.observe(element); + }); + return () => { + elements.forEach((element) => { + const elementHandlers = resizeHandlers.get(element); + elementHandlers?.delete(handler); + if (!elementHandlers?.size) { + observer?.unobserve(element); + } + }); + }; + } + + const windowCallbacks = new Set(); + let windowResizeHandler; + function createWindowResizeHandler() { + windowResizeHandler = () => { + const info = { + get width() { + return window.innerWidth; + }, + get height() { + return window.innerHeight; + }, + }; + windowCallbacks.forEach((callback) => callback(info)); + }; + window.addEventListener("resize", windowResizeHandler); + } + function resizeWindow(callback) { + windowCallbacks.add(callback); + if (!windowResizeHandler) + createWindowResizeHandler(); + return () => { + windowCallbacks.delete(callback); + if (!windowCallbacks.size && + typeof windowResizeHandler === "function") { + window.removeEventListener("resize", windowResizeHandler); + windowResizeHandler = undefined; + } + }; + } + + function resize(a, b) { + return typeof a === "function" ? resizeWindow(a) : resizeElement(a, b); + } + + function observeTimeline(update, timeline) { + let prevProgress; + const onFrame = () => { + const { currentTime } = timeline; + const percentage = currentTime === null ? 0 : currentTime.value; + const progress = percentage / 100; + if (prevProgress !== progress) { + update(progress); + } + prevProgress = progress; + }; + frame.preUpdate(onFrame, true); + return () => cancelFrame(onFrame); + } + + const statsBuffer = { + value: null, + addProjectionMetrics: null, + }; + + function clearStatsBuffer() { + statsBuffer.value = null; + statsBuffer.addProjectionMetrics = null; + } + function recordStats() { + if (statsBuffer.value) { + clearStatsBuffer(); + throw new Error("Stats are already being measured"); + } + const buffer = statsBuffer; + buffer.value = { + layoutProjection: { + nodes: [], + calculatedTargetDeltas: [], + calculatedProjections: [], + }, + }; + buffer.addProjectionMetrics = (metrics) => { + const { layoutProjection } = buffer.value; + layoutProjection.nodes.push(metrics.nodes); + layoutProjection.calculatedTargetDeltas.push(metrics.calculatedTargetDeltas); + layoutProjection.calculatedProjections.push(metrics.calculatedProjections); + }; + } + + /** + * Checks if an element is specifically an SVGSVGElement (the root SVG element) + * in a way that works across iframes + */ + function isSVGSVGElement(element) { + return isSVGElement(element) && element.tagName === "svg"; + } + + function getOriginIndex(from, total) { + if (from === "first") { + return 0; + } + else { + const lastIndex = total - 1; + return from === "last" ? lastIndex : lastIndex / 2; + } + } + function stagger(duration = 0.1, { startDelay = 0, from = 0, ease } = {}) { + return (i, total) => { + const fromIndex = typeof from === "number" ? from : getOriginIndex(from, total); + const distance = Math.abs(fromIndex - i); + let delay = duration * distance; + if (ease) { + const maxDelay = total * duration; + const easingFunction = easingDefinitionToFunction(ease); + delay = easingFunction(delay / maxDelay) * maxDelay; + } + return startDelay + delay; + }; + } + + function transform(...args) { + const useImmediate = !Array.isArray(args[0]); + const argOffset = useImmediate ? 0 : -1; + const inputValue = args[0 + argOffset]; + const inputRange = args[1 + argOffset]; + const outputRange = args[2 + argOffset]; + const options = args[3 + argOffset]; + const interpolator = interpolate(inputRange, outputRange, options); + return useImmediate ? interpolator(inputValue) : interpolator; + } + + /** + * Create a `MotionValue` that animates to its latest value using any transition type. + * Can either be a value or track another `MotionValue`. + * + * ```jsx + * const x = motionValue(0) + * const y = followValue(x, { type: "spring", stiffness: 300 }) + * // or with tween + * const z = followValue(x, { type: "tween", duration: 0.5, ease: "easeOut" }) + * ``` + * + * @param source - Initial value or MotionValue to track + * @param options - Animation transition options + * @returns `MotionValue` + * + * @public + */ + function followValue(source, options) { + const initialValue = isMotionValue(source) ? source.get() : source; + const value = motionValue(initialValue); + attachFollow(value, source, options); + return value; + } + /** + * Attach an animation to a MotionValue that will animate whenever the value changes. + * Similar to attachSpring but supports any transition type (spring, tween, inertia, etc.) + * + * @param value - The MotionValue to animate + * @param source - Initial value or MotionValue to track + * @param options - Animation transition options + * @returns Cleanup function + * + * @public + */ + function attachFollow(value, source, options = {}) { + const initialValue = value.get(); + let activeAnimation = null; + let latestValue = initialValue; + let latestSetter; + const unit = typeof initialValue === "string" + ? initialValue.replace(/[\d.-]/g, "") + : undefined; + const stopAnimation = () => { + if (activeAnimation) { + activeAnimation.stop(); + activeAnimation = null; + } + value.animation = undefined; + }; + const startAnimation = () => { + const currentValue = asNumber$1(value.get()); + const targetValue = asNumber$1(latestValue); + // Don't animate if we're already at the target + if (currentValue === targetValue) { + stopAnimation(); + return; + } + // Use the running animation's analytical velocity for accuracy, + // falling back to the MotionValue's velocity for the initial animation. + // This prevents systematic velocity loss at high frame rates (240hz+). + const velocity = activeAnimation + ? activeAnimation.getGeneratorVelocity() + : value.getVelocity(); + stopAnimation(); + activeAnimation = new JSAnimation({ + keyframes: [currentValue, targetValue], + velocity, + // Default to spring if no type specified (matches useSpring behavior) + type: "spring", + restDelta: 0.001, + restSpeed: 0.01, + ...options, + onUpdate: latestSetter, + }); + }; + // Use a stable function reference so the frame loop Set deduplicates + // multiple calls within the same frame (e.g. rapid mouse events) + const scheduleAnimation = () => { + startAnimation(); + value.animation = activeAnimation ?? undefined; + value["events"].animationStart?.notify(); + activeAnimation?.then(() => { + value.animation = undefined; + value["events"].animationComplete?.notify(); + }); + }; + value.attach((v, set) => { + latestValue = v; + latestSetter = (latest) => set(parseValue(latest, unit)); + frame.postRender(scheduleAnimation); + }, stopAnimation); + if (isMotionValue(source)) { + let skipNextAnimation = options.skipInitialAnimation === true; + const removeSourceOnChange = source.on("change", (v) => { + if (skipNextAnimation) { + skipNextAnimation = false; + value.jump(parseValue(v, unit), false); + } + else { + value.set(parseValue(v, unit)); + } + }); + const removeValueOnDestroy = value.on("destroy", removeSourceOnChange); + return () => { + removeSourceOnChange(); + removeValueOnDestroy(); + }; + } + return stopAnimation; + } + function parseValue(v, unit) { + return unit ? v + unit : v; + } + function asNumber$1(v) { + return typeof v === "number" ? v : parseFloat(v); + } + + function subscribeValue(inputValues, outputValue, getLatest) { + const update = () => outputValue.set(getLatest()); + const scheduleUpdate = () => frame.preRender(update, false, true); + const subscriptions = inputValues.map((v) => v.on("change", scheduleUpdate)); + outputValue.on("destroy", () => { + subscriptions.forEach((unsubscribe) => unsubscribe()); + cancelFrame(update); + }); + } + + /** + * Create a `MotionValue` that transforms the output of other `MotionValue`s by + * passing their latest values through a transform function. + * + * Whenever a `MotionValue` referred to in the provided function is updated, + * it will be re-evaluated. + * + * ```jsx + * const x = motionValue(0) + * const y = transformValue(() => x.get() * 2) // double x + * ``` + * + * @param transformer - A transform function. This function must be pure with no side-effects or conditional statements. + * @returns `MotionValue` + * + * @public + */ + function transformValue(transform) { + const collectedValues = []; + /** + * Open session of collectMotionValues. Any MotionValue that calls get() + * inside transform will be saved into this array. + */ + collectMotionValues.current = collectedValues; + const initialValue = transform(); + collectMotionValues.current = undefined; + const value = motionValue(initialValue); + subscribeValue(collectedValues, value, transform); + return value; + } + + /** + * Create a `MotionValue` that maps the output of another `MotionValue` by + * mapping it from one range of values into another. + * + * @remarks + * + * Given an input range of `[-200, -100, 100, 200]` and an output range of + * `[0, 1, 1, 0]`, the returned `MotionValue` will: + * + * - When provided a value between `-200` and `-100`, will return a value between `0` and `1`. + * - When provided a value between `-100` and `100`, will return `1`. + * - When provided a value between `100` and `200`, will return a value between `1` and `0` + * + * The input range must be a linear series of numbers. The output range + * can be any value type supported by Motion: numbers, colors, shadows, etc. + * + * Every value in the output range must be of the same type and in the same format. + * + * ```jsx + * const x = motionValue(0) + * const xRange = [-200, -100, 100, 200] + * const opacityRange = [0, 1, 1, 0] + * const opacity = mapValue(x, xRange, opacityRange) + * ``` + * + * @param inputValue - `MotionValue` + * @param inputRange - A linear series of numbers (either all increasing or decreasing) + * @param outputRange - A series of numbers, colors or strings. Must be the same length as `inputRange`. + * @param options - + * + * - clamp: boolean. Clamp values to within the given range. Defaults to `true` + * - ease: EasingFunction[]. Easing functions to use on the interpolations between each value in the input and output ranges. If provided as an array, the array must be one item shorter than the input and output ranges, as the easings apply to the transition between each. + * + * @returns `MotionValue` + * + * @public + */ + function mapValue(inputValue, inputRange, outputRange, options) { + const map = transform(inputRange, outputRange, options); + return transformValue(() => map(inputValue.get())); + } + + /** + * Create a `MotionValue` that animates to its latest value using a spring. + * Can either be a value or track another `MotionValue`. + * + * ```jsx + * const x = motionValue(0) + * const y = springValue(x, { stiffness: 300 }) + * ``` + * + * @param source - Initial value or MotionValue to track + * @param options - Spring configuration options + * @returns `MotionValue` + * + * @public + */ + function springValue(source, options) { + return followValue(source, { type: "spring", ...options }); + } + /** + * Attach a spring animation to a MotionValue that will animate whenever the value changes. + * + * @param value - The MotionValue to animate + * @param source - Initial value or MotionValue to track + * @param options - Spring configuration options + * @returns Cleanup function + * + * @public + */ + function attachSpring(value, source, options) { + return attachFollow(value, source, { type: "spring", ...options }); + } + + /** + * A list of all ValueTypes + */ + const valueTypes = [...dimensionValueTypes, color, complex]; + /** + * Tests a value against the list of ValueTypes + */ + const findValueType = (v) => valueTypes.find(testValueType(v)); + + let nameCount = 0; + /** + * Generated names live in their own namespace so we can tell a name we own + * (and must clean up) from an author-defined one - and so a stale generated + * name left behind by an interrupted transition is re-owned, not mistaken for + * the author's and leaked. + */ + const generatedName = () => `motion-view-${nameCount++}`; + const isGeneratedName = (name) => name.startsWith("motion-view-"); + /** + * Tag a captured element with a `view-transition-class` so authors can target + * its generated layer from CSS (e.g. `::view-transition-group(.hero)`) without + * the opaque generated name. Tracked in `classed` - separate from the generated + * names in `assigned` - so cleanup removes the class without ever stripping an + * author's own inline `view-transition-name`. + */ + function tagClass(element, className, classed) { + if (!className) + return; + element.style?.setProperty("view-transition-class", className); + classed.push(element); + } + /** + * Set the element's `view-transition-group` so its layer reconstructs the DOM + * hierarchy in the pseudo-tree (`contain`) - or stays flat (`none`). Tracked in + * `grouped` for cleanup. When the element clips (any non-`visible` overflow) its + * name is recorded in `clipChildren` so the caller can clip the nested children + * (`::view-transition-group-children(name)`), mirroring the live clip through + * the whole transition rather than only at the live-DOM handoff. + * + * Ignored by browsers without nested view-transition groups, where it harmlessly + * degrades to the flat default. + */ + function applyGroup(element, name, group, grouped, clipChildren) { + if (!group) + return; + element.style?.setProperty("view-transition-group", group); + grouped.push(element); + if (group !== "none" && clipChildren) { + const style = getComputedStyle(element); + if (style.overflowX !== "visible" || style.overflowY !== "visible") { + clipChildren.add(name); + } + } + } + /** + * Resolve a selector/Element to elements and ensure each one carries a + * `view-transition-name` we can target from script. + * + * Author-defined names are reused as-is. Elements that are unnamed (or use + * the browser's `auto`/`match-element`, whose generated name is not exposed + * to script) are given a unique generated name, set inline so it's captured, + * and tracked in `assigned` for later cleanup. + * + * `registry` maps each Element to its name so the same element keeps its name + * across both captures (before and after the update), which is what allows a + * persistent element to animate as a single `group` layer. + */ + function assignViewTransitionNames(definition, registry, assigned, forcedNames, className, classed = [], group, grouped = [], clipChildren) { + const elements = resolveElements(definition); + /** + * The new end of a paired morph: give each element the matching name from + * the old end (by index) so the two share one layer and morph. If the new + * end resolves to *more* elements than the old end named, the extras have no + * counterpart - give them a fresh name so they animate as newcomers rather + * than being silently left unnamed. We return the names actually assigned + * (sized to the resolved elements), not the raw `forcedNames`, so stagger + * totals and the layer set stay in step with what's on the page. + */ + if (forcedNames) { + return elements.map((element, i) => { + const existing = registry.get(element); + if (existing) + return existing; + const name = forcedNames[i] ?? generatedName(); + element.style?.setProperty("view-transition-name", name); + assigned.push(element); + registry.set(element, name); + tagClass(element, className, classed); + applyGroup(element, name, group, grouped, clipChildren); + return name; + }); + } + /** + * Read every current name up front, before assigning any. Interleaving the + * reads with the inline `setProperty` writes below would dirty styles + * between reads and force a style recalc per element; batching the reads + * keeps it to one. Elements already in the registry keep their name and + * need no read. + */ + const currentNames = elements.map((element) => registry.has(element) + ? undefined + : getComputedStyle(element).getPropertyValue("view-transition-name")); + return elements.map((element, i) => { + const existing = registry.get(element); + if (existing) + return existing; + const current = currentNames[i]; + let name; + if (current && + current !== "none" && + current !== "auto" && + current !== "match-element" && + !isGeneratedName(current)) { + /** + * The author already named this layer - target it as-is and leave + * it to them to clean up. `auto`/`match-element` are overridden + * because their generated name is not exposed to script, and a + * stale `motion-view-*` (e.g. left by an interrupted transition) is + * re-owned rather than adopted as an author name and leaked. + */ + name = current; + } + else { + name = generatedName(); + element.style?.setProperty("view-transition-name", name); + assigned.push(element); + } + registry.set(element, name); + tagClass(element, className, classed); + applyGroup(element, name, group, grouped, clipChildren); + return name; + }); + } + /** + * Remove the `view-transition-name`s we generated and the + * `view-transition-class`es we applied. Author-defined names are never touched + * (they're not in `assigned`). Safe to call more than once (e.g. on both a + * finished and an interrupted transition). + */ + function releaseViewTransitionNames(assigned, classed = [], grouped = []) { + for (const element of assigned) { + element.style?.removeProperty("view-transition-name"); + } + for (const element of classed) { + element.style?.removeProperty("view-transition-class"); + } + for (const element of grouped) { + element.style?.removeProperty("view-transition-group"); + } + } + + function chooseLayerType(valueName) { + if (valueName === "layout") + return "group"; + if (valueName === "enter" || valueName === "new") + return "new"; + return "old"; + } + + let pendingRules = {}; + let style = null; + const css = { + set: (selector, values) => { + pendingRules[selector] = values; + }, + commit: () => { + if (!style) { + style = document.createElement("style"); + style.id = "motion-view"; + } + let cssText = ""; + for (const selector in pendingRules) { + const rule = pendingRules[selector]; + cssText += `${selector} {\n`; + for (const [property, value] of Object.entries(rule)) { + cssText += ` ${property}: ${value};\n`; + } + cssText += "}\n"; + } + style.textContent = cssText; + document.head.appendChild(style); + pendingRules = {}; + }, + remove: () => { + if (style && style.parentElement) { + style.parentElement.removeChild(style); + } + }, + }; + + function getViewAnimationLayerInfo(pseudoElement) { + const match = pseudoElement.match( + // `group-children` (nested transitions) before `group` so it wins. + /::view-transition-(old|new|group-children|group|image-pair)\((.*?)\)/); + if (!match) + return null; + return { layer: match[2], type: match[1] }; + } + + function getViewAnimations() { + return document.getAnimations().filter((animation) => { + const { effect } = animation; + return (!!effect && + effect.target === document.documentElement && + effect.pseudoElement?.startsWith("::view-transition")); + }); + } + + function hasTarget(target, targets) { + return targets.has(target) && Object.keys(targets.get(target)).length > 0; + } + + const definitionNames = ["layout", "enter", "exit", "new", "old"]; + /** + * Whether a computed border-radius is square (every component zero). Splitting + * on whitespace handles two-value/elliptical radii like "0px 20px" - a leading + * `parseFloat` alone would misread the non-zero vertical radius as square. + */ + const isSquareRadius = (radius) => radius.split(" ").every((value) => parseFloat(value) === 0); + /** + * The `ViewTransitionTarget` buckets driving each generated layer type, in + * priority order - the inverse of `chooseLayerType`. The new view is driven by + * `new`/`enter`, the old by `old`/`exit`. `group-children`/`image-pair` have no + * bucket; they follow the default layout timing. + */ + const typeBuckets = { + group: ["layout"], + new: ["new", "enter"], + old: ["old", "exit"], + }; + /** + * Default "absent" origin for a single-value keyframe, by pseudo type, so e.g. + * `enter({ scale: 1 })` grows in from 0.85 and `exit({ opacity: 0 })` fades + * from 1. `enter` prefers the matching `exit` value over these (see below). + */ + const ORIGIN_DEFAULTS = { + new: { opacity: 0, scale: 0.85 }, + old: { opacity: 1, scale: 1 }, + }; + /** + * How much two box aspect ratios must differ before a morph is treated as + * aspect-changing (and so worth cropping). Matches the projection engine's + * `preserve-aspect` threshold, so small layout jitter doesn't trigger a crop. + */ + const ASPECT_TOLERANCE = 0.2; + function startViewAnimation(builder) { + const { update, targets, resolveDefs, cropOverride, pairs, classNames, flatGroups, options: defaultOptions, } = builder; + if (!document.startViewTransition) { + // An async IIFE (not `new Promise(async …)`) so a throwing/rejecting + // update rejects this promise rather than leaving it unsettled. + return (async () => { + await update(); + return new GroupAnimation([]); + })(); + } + /** + * Resolve any selector/Element targets to layer names, assigning a + * `view-transition-name` to each element as we go. We run this before the + * update (so the elements are captured in the old snapshot) and again + * after it (for the new snapshot). An element present in both keeps the + * same name and animates as a single `group` layer. + */ + const nameRegistry = new Map(); + const assigned = []; + /** + * Elements we tagged with a `view-transition-class` (via `.class()`), + * tracked separately from `assigned` so cleanup removes the class without + * ever stripping an author's own inline `view-transition-name`. + */ + const classed = []; + /** + * Elements we set a `view-transition-group` on (for nesting), tracked for + * cleanup. `clipChildren` collects the names of nested parents that clip in + * the live layout, so their `::view-transition-group-children` is clipped + * through the transition - not just once the live DOM takes back over. + */ + const grouped = []; + const clipChildren = new Set(); + const layerTargets = new Map(); + const croppedNames = new Set(); + /** + * Each layer's explicit `.crop(true | false)` override (by resolved name), + * so `finalizeCrop` can let an author's choice win over the morph default. + */ + const cropForName = new Map(); + /** + * Each layer's stagger position (index + total) within its subject, per + * snapshot. Resolving against the snapshot the layer belongs to keeps + * stagger correct when `update()` replaces the matched elements, and lets + * us skip a layer that's absent from a snapshot (e.g. an exited element + * has no `new` pseudo-element). + */ + const layerStagger = new Map(); + /** + * Names allocated for a paired subject in the old snapshot, replayed onto + * its new-snapshot target so both ends share a layer and morph. + */ + const pairNames = new Map(); + /** + * The old (`from`) elements of each paired subject, so their names can be + * transferred off before the new (`to`) elements inherit them. + */ + const pairFrom = new Map(); + const resolveLayers = (phase) => { + targets.forEach((target, definition) => { + const className = classNames.get(definition); + /** + * Nest each resolved layer under its DOM-ancestor layer by default + * (`contain`), so an ancestor's clip/transform/opacity reach it + * through the transition; `.group(false)` opts a subject out (`none`) + * to stay flat and escape. Skipped for root / pre-named layers, which + * aren't elements we resolve and style. + */ + const group = definition === "root" || !resolveDefs.has(definition) + ? undefined + : flatGroups.has(definition) + ? "none" + : "contain"; + let names; + if (definition === "root" || !resolveDefs.has(definition)) { + names = [definition]; + } + else if (pairs.has(definition)) { + /** + * Paired morph: name the old target in the old snapshot, then + * force the same name(s) onto the new target in the new one, so + * two different elements morph as a single layer. + */ + if (phase === "old") { + pairFrom.set(definition, resolveElements(definition)); + names = assignViewTransitionNames(definition, nameRegistry, assigned, undefined, className, classed, group, grouped, clipChildren); + pairNames.set(definition, names); + } + else { + /** + * Transfer the name(s) off the `from` elements before the + * `to` elements inherit them. A `from` that survives into + * the new snapshot (e.g. hidden with `visibility: hidden` + * rather than removed) would otherwise keep the name and + * collide - "duplicate view-transition-name". + */ + for (const el of pairFrom.get(definition) ?? []) { + el.style?.removeProperty("view-transition-name"); + /** + * Drop the old end from the registry too, so the new + * end alone supplies this name's `new` crop radii - we + * neither re-measure nor get ordered by a stale element. + */ + nameRegistry.delete(el); + } + names = assignViewTransitionNames(pairs.get(definition), nameRegistry, assigned, pairNames.get(definition), className, classed, group, grouped, clipChildren); + } + } + else { + names = assignViewTransitionNames(definition, nameRegistry, assigned, undefined, className, classed, group, grouped, clipChildren); + } + // Record any explicit `.crop(true | false)` per resolved name; the + // crop set itself is computed later by `finalizeCrop` (it needs both + // snapshots to know which morphs change aspect ratio). + const override = cropOverride.get(definition); + names.forEach((name, index) => { + /** + * If two subjects resolve to the same element, merge their + * definitions so neither subject's animations are dropped. + */ + const existing = layerTargets.get(name); + layerTargets.set(name, existing && existing !== target + ? { ...existing, ...target } + : target); + if (override !== undefined) + cropForName.set(name, override); + const stagger = layerStagger.get(name) ?? {}; + stagger[phase] = [index, names.length]; + layerStagger.set(name, stagger); + }); + }); + }; + /** + * The stagger index/total for a layer, resolved against the snapshot it + * belongs to. Returns index -1 when the layer is absent from that snapshot + * so the caller can skip a pseudo-element that doesn't exist. + */ + const staggerPosition = (name, type) => { + const stagger = layerStagger.get(name); + const position = type === "old" + ? stagger?.old + : type === "new" + ? stagger?.new + : // group / group-children / image-pair persist across both. + stagger?.new ?? stagger?.old; + return position ?? [-1, 1]; + }; + /** + * Merge default + per-layer transition options for a generated layer and + * resolve any stagger/delay function against this element's position. Used + * by both the morph-retiming and crop corner-radius passes. + */ + const resolveLayerTransition = (target, type, transitionName, index, total) => { + const transition = mergeTransition(getValueTransition$1(defaultOptions, transitionName), getValueTransition$1((layerOptions(target, type) ?? {}), transitionName)); + if (typeof transition.delay === "function") { + transition.delay = transition.delay(index, total); + } + return transition; + }; + /** + * Resolve a layer's group (`layout`) timing to plain WAAPI values: native + * ms `delay`/`duration` and a baked `ease`. The single source of group + * timing, shared by the generated-group retiming and the crop corner-radius + * pass so the rounded clip animates on exactly the box's timing. It returns + * no generator `type` (the WAAPI-only `NativeAnimation` rejects a string + * type) nor `repeat`/`times` (which the group's `updateTiming` ignores), so + * none of them can leak into the radius animation and desync it. + */ + const resolveGroupTiming = (name) => { + const [index, total] = staggerPosition(name, "group"); + const transition = resolveLayerTransition(layerTargets.get(name), "group", "layout", index === -1 ? 0 : index, total); + transition.duration && (transition.duration = secondsToMilliseconds(transition.duration)); + const { delay = 0, duration, ease } = applyGeneratorOptions(transition); + return { delay: secondsToMilliseconds(delay), duration, ease }; + }; + /** + * Each layer's measured box + corner radii per snapshot. The box lets + * `finalizeCrop` tell whether a morph's aspect ratio changed (the only case + * worth cropping); the radii let a cropped morph's group clip animate each + * corner from the old element's radius to the new element's, keeping it + * rounded where `overflow: clip` would otherwise square the corners. + * + * We never flatten the source for capture (a snapshot is a paint of the live + * DOM, so squaring an element just for its capture would flash one real + * square frame). For an aspect-changing morph `object-fit: cover` crops each + * snapshot's own baked corners off-screen mid-morph, so the animated clip is + * the only visible corner; a near-same-aspect forced crop (`.crop(true)`) + * can't hide the outgoing snapshot's silhouette, but the endpoints coincide. + */ + const cropMeasurements = new Map(); + const measureLayers = (phase) => nameRegistry.forEach((name, element) => { + const el = element; + const rect = el.getBoundingClientRect?.(); + if (rect && rect.height) { + const style = getComputedStyle(el); + const radii = {}; + for (const corner of cornerRadiusProps) { + radii[corner] = style[corner]; + } + const entry = cropMeasurements.get(name) ?? {}; + entry[phase] = { width: rect.width, height: rect.height, radii }; + cropMeasurements.set(name, entry); + } + }); + /** + * With both snapshots measured, settle which layers crop. The default crops + * only a morph whose aspect ratio *changes* between snapshots - the one case + * where `object-fit: cover` does real work. A same-aspect morph or a + * fade-only layer is left uncropped: its corners scale naturally (no flash + * from squaring, no `overflow: clip` eating its shadow) and a backdrop can't + * be clipped to nothing. An explicit `.crop(true | false)` overrides either + * way. Runs after both snapshots are measured, since aspect needs both. + */ + const finalizeCrop = () => { + croppedNames.clear(); + for (const name of layerStagger.keys()) { + if (name === "root") + continue; + // An explicit `.crop(true | false)` wins; otherwise crop a morph + // whose aspect ratio changed. + if (cropForName.get(name) ?? aspectChanged(name)) { + croppedNames.add(name); + } + } + }; + /** + * Whether a layer is a morph whose box aspect ratio changed between + * snapshots (beyond a small tolerance). Fade-only layers (one snapshot) are + * never "changed". + */ + const aspectChanged = (name) => { + const box = cropMeasurements.get(name); + if (!box?.old || !box?.new || !box.old.height || !box.new.height) { + return false; + } + return (Math.abs(box.old.width / box.old.height - + box.new.width / box.new.height) > ASPECT_TOLERANCE); + }; + /** + * Write the persistent view-transition CSS: suppress root capture when the + * root has no animations of its own; force linear timing (baked into the + * keyframes, so we can retime later via updateTiming); and clip + + * object-fit: cover every cropped morph (the UA default overflows on + * aspect-ratio change). + * + * `css.commit` replaces rather than appends, so we re-set the full rule set + * each call - the crop rules are only known after `finalizeCrop` runs in the + * update callback, so the second call writes them. + */ + const commitViewCSS = () => { + if (!hasTarget("root", targets)) { + css.set(":root", { "view-transition-name": "none" }); + } + css.set("::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)", { "animation-timing-function": "linear !important" }); + croppedNames.forEach((name) => { + css.set(`::view-transition-group(${name})`, { overflow: "clip" }); + css.set(`::view-transition-old(${name}), ::view-transition-new(${name})`, { width: "100%", height: "100%", "object-fit": "cover" }); + }); + /** + * Clip the nested children of any layer that clips in the live layout, + * so a wrapper crops its child for the whole morph (mirroring the DOM) + * rather than only at the live-DOM handoff. No-op on browsers without + * nested view-transition groups. + */ + clipChildren.forEach((name) => { + css.set(`::view-transition-group-children(${name})`, { + overflow: "clip", + }); + }); + css.commit(); // Write + }; + const cleanup = () => { + releaseViewTransitionNames(assigned, classed, grouped); + css.remove(); // Write + }; + const callback = async () => { + await update(); + /** + * Re-resolve so elements created by the update are named for the new + * snapshot, then measure them. With both snapshots measured we can + * settle the crop set (aspect-changing morphs + forced). + */ + resolveLayers("new"); + measureLayers("new"); + finalizeCrop(); + /** + * Re-commit the crop CSS unconditionally: `finalizeCrop` is computed + * here (after both snapshots are measured), so the clip rules must be + * (re)written to match the settled set. + */ + commitViewCSS(); + }; + let transition; + try { + resolveLayers("old"); + /** + * Measure the old snapshot against the optimistic crop set (the new + * snapshot doesn't exist yet, so aspect change can't be known here; + * `finalizeCrop` settles it post-update). + */ + measureLayers("old"); + commitViewCSS(); + transition = document.startViewTransition(callback); + } + catch (error) { + /** + * The prelude writes inline names before the transition exists. If it + * throws (e.g. startViewTransition rejects in a bad UA state), release + * them so we neither leak DOM state nor stall the queue on a promise + * that never settles - hand back a rejection it can advance past. + */ + cleanup(); + return Promise.reject(error); + } + transition.finished.finally(cleanup); + return new Promise((resolve, reject) => { + transition.ready + .then(() => { + const generatedViewAnimations = getViewAnimations(); + const animations = []; + /** + * Create animations for each of our explicitly-defined subjects. + * `opacityAnimated` additionally tracks which `${name}:${type}` + * we faded, so we can keep the UA `plus-lighter` blend only for a + * genuine opacity crossfade (both sides fading) and drop it for a + * slide/transform, where additive compositing would flash bright. + */ + const explicitlyAnimated = new Set(); + const opacityAnimated = new Set(); + layerTargets.forEach((target, name) => { + const stagger = layerStagger.get(name); + /** + * Presence: `enter` only fires for a pure newcomer (a new + * view with no old), `exit` only for a pure leaver. A + * survivor (both) gets neither - it just morphs. + */ + const enterApplies = !!stagger?.new && !stagger?.old; + const exitApplies = !!stagger?.old && !stagger?.new; + for (const key of definitionNames) { + if (!target[key]) + continue; + if (key === "enter" && !enterApplies) + continue; + if (key === "exit" && !exitApplies) + continue; + const type = chooseLayerType(key); + const [index, total] = staggerPosition(name, type); + // Skip a layer absent from its snapshot. + if (index === -1) + continue; + const { keyframes, options } = target[key]; + for (let [valueName, valueKeyframes] of Object.entries(keyframes)) { + // Skip only missing values - `0` (e.g. opacity: 0) + // is valid and must reach the from-value inference. + if (valueKeyframes == null) + continue; + /** + * The view path hands keyframes straight to WAAPI, + * so Motion's `x`/`y` shorthands (compiled to + * `transform` only via the value pipeline) have no + * effect. Warn and skip - use `transform`/`translate`. + */ + if (valueName === "x" || valueName === "y") { + warnOnce(false, `animateView() animates view-transition layers with CSS properties; the "${valueName}" shorthand has no effect - use transform, e.g. { transform: "translateX(40px)" }.`); + continue; + } + /** + * enter/exit win over new/old on a shared property - + * skip it here when the gated bucket also defines it. + */ + if (key === "new" && + enterApplies && + target.enter?.keyframes[valueName] != null) { + continue; + } + if (key === "old" && + exitApplies && + target.exit?.keyframes[valueName] != null) { + continue; + } + const valueOptions = mergeTransition(getValueTransition$1(defaultOptions, valueName), getValueTransition$1(options, valueName)); + /** + * Infer an origin for a single-value keyframe. An + * `enter` mirrors the matching `exit` value (a + * defined exit reverses into the enter for free); + * otherwise the per-type default (opacity 0/1, scale + * 0.85). No default -> left as-is (animates from the + * live value). + * + * `new`/`old` fire for survivors too, where only the + * opacity crossfade default applies - a transform + * default like scale 0.85 would pop a persisting + * element, so gate it on the layer actually + * entering/leaving. + */ + if (!Array.isArray(valueKeyframes)) { + const exitValue = key === "enter" + ? target.exit?.keyframes[valueName] + : undefined; + const allowDefault = valueName === "opacity" || + (type === "new" ? enterApplies : exitApplies); + const from = exitValue != null + ? Array.isArray(exitValue) + ? exitValue[exitValue.length - 1] + : exitValue + : allowDefault + ? ORIGIN_DEFAULTS[type]?.[valueName] + : undefined; + if (from !== undefined) { + valueKeyframes = [from, valueKeyframes]; + } + } + /** + * Resolve stagger function if provided, per element + * across this subject's resolved layers. + */ + if (typeof valueOptions.delay === "function") { + valueOptions.delay = valueOptions.delay(index, total); + } + valueOptions.duration && (valueOptions.duration = secondsToMilliseconds(valueOptions.duration)); + valueOptions.delay && (valueOptions.delay = secondsToMilliseconds(valueOptions.delay)); + animations.push(new NativeAnimation({ + ...valueOptions, + element: document.documentElement, + name: valueName, + pseudoElement: `::view-transition-${type}(${name})`, + keyframes: valueKeyframes, + })); + explicitlyAnimated.add(`${name}:${type}`); + if (valueName === "opacity") { + opacityAnimated.add(`${name}:${type}`); + } + } + } + }); + /** + * Handle browser generated animations + */ + for (const animation of generatedViewAnimations) { + if (animation.playState === "finished") + continue; + const { effect } = animation; + if (!effect || !(effect instanceof KeyframeEffect)) + continue; + const { pseudoElement } = effect; + if (!pseudoElement) + continue; + const name = getViewAnimationLayerInfo(pseudoElement); + if (!name) + continue; + const targetDefinition = layerTargets.get(name.layer); + /** + * We built our own animation for this layer, so drop the + * browser-generated fade we're replacing. The UA + * `plus-lighter` blend is a *separate* generated animation on + * the same pseudo (it sets `mix-blend-mode` in its keyframes): + * keep it *only* for a true opacity crossfade - both sides + * fading - so a symmetric crossfade composites without + * darkening, but a slide/transform (where both layers stay + * opaque and overlap) doesn't flash bright from the addition. + */ + if (explicitlyAnimated.has(`${name.layer}:${name.type}`)) { + const isCrossfade = opacityAnimated.has(`${name.layer}:new`) && + opacityAnimated.has(`${name.layer}:old`); + if (isCrossfade && + effect + .getKeyframes() + .some((keyframe) => keyframe.mixBlendMode)) { + animations.push(new NativeAnimationWrapper(animation)); + } + else { + animation.cancel(); + } + continue; + } + /** + * Drop the orphaned half of the default crossfade. The UA + * fades old out and new in as a *pair*; if the opposing half + * was explicitly overridden with something other than an + * opacity fade (a clip or transform reveal), this side's + * default opacity fade has no partner - left to run it would + * dissolve what should be a static backdrop (e.g. + * `.new({ clipPath })` should reveal over a still old view, + * not fade the old out around the growing clip). Cancel it - + * and its `plus-lighter` sibling on the same pseudo, which + * would otherwise flash bright where the two opaque layers + * overlap. A genuine crossfade (the opposing side also fading + * opacity) keeps both halves and is handled above. + */ + const opposite = name.type === "old" + ? "new" + : name.type === "new" + ? "old" + : undefined; + if (opposite && + explicitlyAnimated.has(`${name.layer}:${opposite}`) && + !opacityAnimated.has(`${name.layer}:${opposite}`)) { + animation.cancel(); + continue; + } + /** + * Otherwise retime the browser-generated animation to + * Motion's timing. This auto-enables the layout (group) + * morph for any resolved/named target, and applies the + * default timing to old/new layers we haven't explicitly + * overridden. + * + * group + group-children both follow the layout timing so + * the nesting container stays in sync with the morph. + */ + /** + * A survivor's old + new are the two halves of one + * `plus-lighter` crossfade. They must share identical timing + * (so their opacities stay mirrored and sum to 1 - else the + * additive blend flashes bright wherever both are partly + * visible) and fade linearly (the bounce belongs on the + * group's geometry, not the opacity). So time them as the + * group, rather than via their own - potentially staggered, + * or enter/exit-derived - old/new options. + */ + const stagger = layerStagger.get(name.layer); + const isMorphCrossfade = (name.type === "old" || name.type === "new") && + !!stagger?.old && + !!stagger?.new; + let timing; + if (name.type.startsWith("group")) { + // group + group-children follow the resolved group + // timing - the single source shared with the crop + // corner-radius pass below. + const { delay, duration, ease } = resolveGroupTiming(name.layer); + timing = { + delay, + duration, + easing: mapEasingToNativeEasing(ease, duration), + }; + } + else { + const timingType = isMorphCrossfade ? "group" : name.type; + const [index, total] = staggerPosition(name.layer, timingType); + const transitionName = timingType === "group" ? "layout" : ""; + let animationTransition = resolveLayerTransition(targetDefinition, timingType, transitionName, index === -1 ? 0 : index, total); + /** + * The crossfade should resolve at the spring's + * *perceptual* (visual) duration - the geometry can keep + * bouncing, but the opacity shouldn't drag through the + * settle. So capture `visualDuration` before + * `applyGeneratorOptions` replaces it with the full + * overshoot duration, and use it for the fade. + */ + const visualDuration = animationTransition.visualDuration; + animationTransition.duration && (animationTransition.duration = secondsToMilliseconds(animationTransition.duration)); + animationTransition = + applyGeneratorOptions(animationTransition); + timing = { + delay: secondsToMilliseconds(animationTransition.delay ?? 0), + duration: isMorphCrossfade && visualDuration !== undefined + ? secondsToMilliseconds(visualDuration) + : animationTransition.duration, + easing: isMorphCrossfade + ? "linear" + : mapEasingToNativeEasing(animationTransition.ease, animationTransition.duration), + }; + } + effect.updateTiming(timing); + animations.push(new NativeAnimationWrapper(animation)); + } + /** + * Round each cropped layer's clip. Its `::view-transition-group` + * has `overflow: clip`, which would otherwise square the corners + * mid-morph; animate each corner from the old element's radius to + * the new element's so the crop stays rounded. Timed as the group + * (`layout`) so the radius tracks the morphing box. + */ + cropMeasurements.forEach((entry, name) => { + if (!croppedNames.has(name)) + return; + // Reuse the group's resolved timing - native ms delay/ + // duration + a baked ease, with no generator `type` or + // repeat/times to leak into (or throw inside) NativeAnimation. + const { delay, duration, ease } = resolveGroupTiming(name); + for (const corner of cornerRadiusProps) { + // `||` (not `??`) so an empty measurement falls back to + // the other snapshot rather than an invalid keyframe. + const from = entry.old?.radii[corner] || + entry.new?.radii[corner] || + "0px"; + const to = entry.new?.radii[corner] || + entry.old?.radii[corner] || + "0px"; + // Nothing to round if the corner is square at both ends. + if (isSquareRadius(from) && isSquareRadius(to)) + continue; + animations.push(new NativeAnimation({ + element: document.documentElement, + name: corner, + pseudoElement: `::view-transition-group(${name})`, + keyframes: [from, to], + delay, + duration, + ease, + })); + } + }); + resolve(new GroupAnimation(animations)); + }) + .catch(() => + /** + * `ready` rejects when the transition is skipped - no visual + * change, or superseded by an interrupting transition. The DOM + * update still applied, so settle with no animations rather than + * surfacing it as an error to an awaiting caller. A genuine + * failure in `update()` rejects `updateCallbackDone` (already + * settled by now), so propagate that instead. + */ + transition.updateCallbackDone.then(() => resolve(new GroupAnimation([])), reject)); + }); + } + /** + * The options that should time a given generated layer type, so a retimed + * group/old/new picks up any per-target transition the user provided. Checks + * the type's buckets in priority order (e.g. `new` before `enter`). + */ + function layerOptions(target, type) { + for (const bucket of typeBuckets[type] ?? []) { + const options = target?.[bucket]?.options; + if (options) + return options; + } + } + /** + * Merge a base transition (e.g. the default `options`) with a per-layer/value + * override. An explicit `duration` on the override must win over an inherited + * generator's own timing: a spring prefers `visualDuration`, and + * `spring.applyToOptions` overwrites `duration` with the computed settle time - + * so without this the override is silently discarded. Dropping the inherited + * `type`/`visualDuration` makes the layer a plain tween of that duration, unless + * it asked for its own generator `type`/`visualDuration`. + */ + function mergeTransition(base, override) { + const merged = { ...base, ...override }; + if (override.duration !== undefined) { + if (override.visualDuration === undefined) + delete merged.visualDuration; + if (override.type === undefined) + delete merged.type; + } + return merged; + } + + let builders = []; + let current = null; + function next() { + current = null; + const [nextBuilder] = builders; + if (nextBuilder) + start(nextBuilder); + } + function start(builder) { + removeItem(builders, builder); + current = builder; + startViewAnimation(builder) + .then((animation) => { + builder.notifyReady(animation); + return animation.finished; + }) + // A genuinely failed transition (a throwing update) rejects the + // builder; a skipped/interrupted one resolves with no animations (see + // start.ts). Either way, advance the queue - else later transitions hang. + .catch((error) => builder.notifyReject(error)) + .finally(next); + } + function processQueue() { + /** + * Iterate backwards over the builders array. We can ignore the + * "wait" animations. If we have an interrupting animation in the + * queue then we need to batch all preceeding animations into it. + * Currently this only batches the update functions but will also + * need to batch the targets. + */ + for (let i = builders.length - 1; i >= 0; i--) { + const builder = builders[i]; + const { interrupt } = builder.options; + if (interrupt === "immediate") { + const batchedUpdates = builders.slice(0, i + 1).map((b) => b.update); + const remaining = builders.slice(i + 1); + builder.update = () => { + batchedUpdates.forEach((update) => update()); + }; + // Put the current builder at the front, followed by any "wait" builders + builders = [builder, ...remaining]; + break; + } + } + if (!current || builders[0]?.options.interrupt === "immediate") { + next(); + } + } + function addToQueue(builder) { + builders.push(builder); + microtask.render(processQueue); + } + + class ViewTransitionBuilder { + constructor(update, options = {}) { + this.currentSubject = "root"; + this.targets = new Map(); + /** + * Definitions that must be resolved to elements (and assigned a + * `view-transition-name`) rather than treated as pre-named layers. + */ + this.resolveDefs = new Set(); + /** + * Per-subject crop override: `true` forces the crop (clip + object-fit: + * cover + animated corner radii) on, `false` forces it off. A subject with + * no entry uses the default - crop only a genuine morph (a layer present in + * both snapshots), so a fade-only enter/exit isn't clipped to nothing. + */ + this.cropOverride = new Map(); + /** + * Subjects paired with a different new-snapshot target (the second `.add()` + * argument), so two distinct elements share one name and morph into each + * other - a shared-element transition. + */ + this.pairs = new Map(); + /** + * A `view-transition-class` to apply to each subject's resolved elements, + * so authors can target the generated layers from CSS by class rather than + * the opaque generated name. + */ + this.classNames = new Map(); + /** + * Subjects opted out of automatic group nesting via `.group(false)`. Their + * layer stays a flat top-level group (`view-transition-group: none`) instead + * of nesting under its DOM-ancestor layer - so it animates independently and + * escapes an ancestor's clip/transform (e.g. an element that lifts out of a + * card and flies across, which nesting would clip to the card). + */ + this.flatGroups = new Set(); + this.notifyReady = noop; + this.notifyReject = noop; + this.readyPromise = new Promise((resolve, reject) => { + this.notifyReady = resolve; + this.notifyReject = reject; + }); + this.update = update; + this.options = { + interrupt: "wait", + ...options, + }; + // Avoid an unhandled rejection when a failed transition has no + // `.then(_, reject)` handler attached (e.g. fire-and-forget). + this.readyPromise.catch(noop); + addToQueue(this); + } + /** + * Target elements resolved from a selector or Element, each assigned a + * `view-transition-name` automatically. + * + * Passing a second target pairs them: the first is resolved in the old + * snapshot and the second in the new, sharing one name so two *different* + * elements morph into each other (e.g. `.add(card, ".modal")`). Symmetric - + * pass them the other way round to morph back. + */ + add(subject, newSubject) { + this.currentSubject = subject; + this.resolveDefs.add(subject); + if (newSubject !== undefined) + this.pairs.set(subject, newSubject); + // Register the subject so it participates (and gets an automatic + // layout/morph animation) even without an explicit enter/exit/layout. + if (!this.targets.has(subject)) + this.targets.set(subject, {}); + return this; + } + /** + * Control this subject's crop (clip + `object-fit: cover` + animated + * corners). By default a subject auto-crops only when it actually morphs - + * present in both snapshots (a survivor, or an `.add(a, b)` pair). A + * fade-only enter/exit has no second box to crop against, so it's left to + * the browser default; in particular the `overflow: clip` a crop adds would + * otherwise clip a mis-sized enter/exit layer to nothing. + * + * `.crop(false)` forces the crop off (e.g. a text morph, where + * `object-fit: cover` clips glyphs as the box grows); `.crop(true)` forces + * it on for a non-morph the default wouldn't otherwise crop. + */ + crop(enabled = true) { + this.cropOverride.set(this.currentSubject, enabled); + return this; + } + /** + * By default a subject's layer nests under its nearest DOM-ancestor layer + * (`view-transition-group: contain`), so the ancestor's clip/transform/opacity + * apply to it through the transition - mirroring how the DOM actually paints, + * and letting a wrapper crop its child for the whole morph rather than only + * once the live DOM takes back over. (Needs a browser that supports nested + * view-transition groups; elsewhere it degrades to the flat default.) + * + * Call `.group(false)` to opt out: the layer stays flat and top-level, so it + * animates independently and escapes an ancestor's clip - e.g. an element + * that should lift out of a card and fly across, which nesting would clip. + */ + group(enabled = true) { + enabled + ? this.flatGroups.delete(this.currentSubject) + : this.flatGroups.add(this.currentSubject); + return this; + } + /** + * Tag this subject's generated layers with a `view-transition-class`, so + * they can be targeted from CSS - `::view-transition-group(.name)`, + * `::view-transition-old/new(.name)`, `::view-transition-image-pair(.name)` + * - without the opaque generated `view-transition-name`. Because `.add()` + * can match many elements, a shared class targets them all at once (and, + * for a pair, both ends). The escape hatch for z-index / custom keyframes + * on a morph layer. + */ + class(name) { + this.classNames.set(this.currentSubject, name); + return this; + } + /** + * Set the transition for this subject's morph. The morph is enabled + * automatically by `.add()`; this just customises its timing (duration, + * easing, a `delay`/`stagger`, …). On the implicit `root` subject it also + * opts the page into the transition (the root crossfade). + */ + layout(options = {}) { + this.updateTarget("layout", {}, options); + return this; + } + enter(keyframes, options) { + this.updateTarget("enter", keyframes, options); + return this; + } + exit(keyframes, options) { + this.updateTarget("exit", keyframes, options); + return this; + } + /** + * Animate the new view directly, whether the element is appearing or + * persisting (unlike `.enter()`, which only fires for a pure newcomer). + * Pair with `.old()` for a crossfade or slide-through. + */ + new(keyframes, options) { + this.updateTarget("new", keyframes, options); + return this; + } + /** + * Animate the old view directly, whether the element is leaving or + * persisting (unlike `.exit()`, which only fires for a pure leaver). + */ + old(keyframes, options) { + this.updateTarget("old", keyframes, options); + return this; + } + updateTarget(target, keyframes, options = {}) { + const { currentSubject, targets } = this; + if (!targets.has(currentSubject)) { + targets.set(currentSubject, {}); + } + const targetData = targets.get(currentSubject); + targetData[target] = { keyframes, options }; + } + then(resolve, reject) { + return this.readyPromise.then(resolve, reject); + } + } + function animateView(update, options = {}) { + return new ViewTransitionBuilder(update, options); + } + + const createAxisDelta = () => ({ + translate: 0, + scale: 1, + origin: 0, + originPoint: 0, + }); + const createDelta = () => ({ + x: createAxisDelta(), + y: createAxisDelta(), + }); + const createAxis = () => ({ min: 0, max: 0 }); + const createBox = () => ({ + x: createAxis(), + y: createAxis(), + }); + + const visualElementStore = new WeakMap(); + + function isAnimationControls(v) { + return (v !== null && + typeof v === "object" && + typeof v.start === "function"); + } + + /** + * Decides if the supplied variable is variant label + */ + function isVariantLabel(v) { + return typeof v === "string" || Array.isArray(v); + } + + const variantPriorityOrder = [ + "animate", + "whileInView", + "whileFocus", + "whileHover", + "whileTap", + "whileDrag", + "exit", + ]; + const variantProps = ["initial", ...variantPriorityOrder]; + + function isControllingVariants(props) { + return (isAnimationControls(props.animate) || + variantProps.some((name) => isVariantLabel(props[name]))); + } + function isVariantNode(props) { + return Boolean(isControllingVariants(props) || props.variants); + } + + /** + * Updates motion values from props changes. + * Uses `any` type for element to avoid circular dependencies with VisualElement. + */ + function updateMotionValuesFromProps(element, next, prev) { + for (const key in next) { + const nextValue = next[key]; + const prevValue = prev[key]; + if (isMotionValue(nextValue)) { + /** + * If this is a motion value found in props or style, we want to add it + * to our visual element's motion value map. + */ + element.addValue(key, nextValue); + } + else if (isMotionValue(prevValue)) { + /** + * If we're swapping from a motion value to a static value, + * create a new motion value from that + */ + element.addValue(key, motionValue(nextValue, { owner: element })); + } + else if (prevValue !== nextValue) { + /** + * If this is a flat value that has changed, update the motion value + * or create one if it doesn't exist. We only want to do this if we're + * not handling the value with our animation state. + */ + if (element.hasValue(key)) { + const existingValue = element.getValue(key); + if (existingValue.liveStyle === true) { + existingValue.jump(nextValue); + } + else if (!existingValue.hasAnimated) { + existingValue.set(nextValue); + } + } + else { + const latestValue = element.getStaticValue(key); + element.addValue(key, motionValue(latestValue !== undefined ? latestValue : nextValue, { owner: element })); + } + } + } + // Handle removed values + for (const key in prev) { + if (next[key] === undefined) + element.removeValue(key); + } + return next; + } + + // Does this device prefer reduced motion? Returns `null` server-side. + const prefersReducedMotion = { current: null }; + const hasReducedMotionListener = { current: false }; + + const isBrowser = typeof window !== "undefined"; + function initPrefersReducedMotion() { + hasReducedMotionListener.current = true; + if (!isBrowser) + return; + if (window.matchMedia) { + const motionMediaQuery = window.matchMedia("(prefers-reduced-motion)"); + const setReducedMotionPreferences = () => (prefersReducedMotion.current = motionMediaQuery.matches); + motionMediaQuery.addEventListener("change", setReducedMotionPreferences); + setReducedMotionPreferences(); + } + else { + prefersReducedMotion.current = false; + } + } + + const propEventHandlers = [ + "AnimationStart", + "AnimationComplete", + "Update", + "BeforeLayoutMeasure", + "LayoutMeasure", + "LayoutAnimationStart", + "LayoutAnimationComplete", + ]; + /** + * Static feature definitions - can be injected by framework layer + */ + let featureDefinitions = {}; + /** + * Set feature definitions for all VisualElements. + * This should be called by the framework layer (e.g., framer-motion) during initialization. + */ + function setFeatureDefinitions(definitions) { + featureDefinitions = definitions; + } + /** + * Get the current feature definitions + */ + function getFeatureDefinitions() { + return featureDefinitions; + } + /** + * A VisualElement is an imperative abstraction around UI elements such as + * HTMLElement, SVGElement, Three.Object3D etc. + */ + class VisualElement { + /** + * This method takes React props and returns found MotionValues. For example, HTML + * MotionValues will be found within the style prop, whereas for Three.js within attribute arrays. + * + * This isn't an abstract method as it needs calling in the constructor, but it is + * intended to be one. + */ + scrapeMotionValuesFromProps(_props, _prevProps, _visualElement) { + return {}; + } + constructor({ parent, props, presenceContext, reducedMotionConfig, skipAnimations, blockInitialAnimation, visualState, }, options = {}) { + /** + * A reference to the current underlying Instance, e.g. a HTMLElement + * or Three.Mesh etc. + */ + this.current = null; + /** + * A set containing references to this VisualElement's children. + */ + this.children = new Set(); + /** + * Determine what role this visual element should take in the variant tree. + */ + this.isVariantNode = false; + this.isControllingVariants = false; + /** + * Decides whether this VisualElement should animate in reduced motion + * mode. + * + * TODO: This is currently set on every individual VisualElement but feels + * like it could be set globally. + */ + this.shouldReduceMotion = null; + /** + * Decides whether animations should be skipped for this VisualElement. + * Useful for E2E tests and visual regression testing. + */ + this.shouldSkipAnimations = false; + /** + * A map of all motion values attached to this visual element. Motion + * values are source of truth for any given animated value. A motion + * value might be provided externally by the component via props. + */ + this.values = new Map(); + this.KeyframeResolver = KeyframeResolver; + /** + * Cleanup functions for active features (hover/tap/exit etc) + */ + this.features = {}; + /** + * A map of every subscription that binds the provided or generated + * motion values onChange listeners to this visual element. + */ + this.valueSubscriptions = new Map(); + /** + * A reference to the previously-provided motion values as returned + * from scrapeMotionValuesFromProps. We use the keys in here to determine + * if any motion values need to be removed after props are updated. + */ + this.prevMotionValues = {}; + /** + * Track whether this element has been mounted before, to detect + * remounts after Suspense unmount/remount cycles. + */ + this.hasBeenMounted = false; + /** + * An object containing a SubscriptionManager for each active event. + */ + this.events = {}; + /** + * An object containing an unsubscribe function for each prop event subscription. + * For example, every "Update" event can have multiple subscribers via + * VisualElement.on(), but only one of those can be defined via the onUpdate prop. + */ + this.propEventSubscriptions = {}; + this.notifyUpdate = () => this.notify("Update", this.latestValues); + this.render = () => { + if (!this.current) + return; + this.triggerBuild(); + this.renderInstance(this.current, this.renderState, this.props.style, this.projection); + }; + this.renderScheduledAt = 0.0; + this.scheduleRender = () => { + const now = time.now(); + if (this.renderScheduledAt < now) { + this.renderScheduledAt = now; + frame.render(this.render, false, true); + } + }; + const { latestValues, renderState } = visualState; + this.latestValues = latestValues; + this.baseTarget = { ...latestValues }; + this.initialValues = props.initial ? { ...latestValues } : {}; + this.renderState = renderState; + this.parent = parent; + this.props = props; + this.presenceContext = presenceContext; + this.depth = parent ? parent.depth + 1 : 0; + this.reducedMotionConfig = reducedMotionConfig; + this.skipAnimationsConfig = skipAnimations; + this.options = options; + this.blockInitialAnimation = Boolean(blockInitialAnimation); + this.isControllingVariants = isControllingVariants(props); + this.isVariantNode = isVariantNode(props); + if (this.isVariantNode) { + this.variantChildren = new Set(); + } + this.manuallyAnimateOnMount = Boolean(parent && parent.current); + /** + * Any motion values that are provided to the element when created + * aren't yet bound to the element, as this would technically be impure. + * However, we iterate through the motion values and set them to the + * initial values for this component. + * + * TODO: This is impure and we should look at changing this to run on mount. + * Doing so will break some tests but this isn't necessarily a breaking change, + * more a reflection of the test. + */ + const { willChange, ...initialMotionValues } = this.scrapeMotionValuesFromProps(props, {}, this); + for (const key in initialMotionValues) { + const value = initialMotionValues[key]; + if (latestValues[key] !== undefined && isMotionValue(value)) { + value.set(latestValues[key]); + } + } + } + mount(instance) { + /** + * If this element has been mounted before (e.g. after a Suspense + * unmount/remount), reset motion values to their initial state + * so animations replay correctly from initial → animate. + */ + if (this.hasBeenMounted) { + for (const key in this.initialValues) { + this.values.get(key)?.jump(this.initialValues[key]); + this.latestValues[key] = this.initialValues[key]; + } + } + this.current = instance; + visualElementStore.set(instance, this); + if (this.projection && !this.projection.instance) { + this.projection.mount(instance); + } + if (this.parent && this.isVariantNode && !this.isControllingVariants) { + this.removeFromVariantTree = this.parent.addVariantChild(this); + } + this.values.forEach((value, key) => this.bindToMotionValue(key, value)); + /** + * Determine reduced motion preference. Only initialize the matchMedia + * listener if we actually need the dynamic value (i.e., when config + * is neither "never" nor "always"). + */ + if (this.reducedMotionConfig === "never") { + this.shouldReduceMotion = false; + } + else if (this.reducedMotionConfig === "always") { + this.shouldReduceMotion = true; + } + else { + if (!hasReducedMotionListener.current) { + initPrefersReducedMotion(); + } + this.shouldReduceMotion = prefersReducedMotion.current; + } + { + warnOnce(this.shouldReduceMotion !== true, "You have Reduced Motion enabled on your device. Animations may not appear as expected.", "reduced-motion-disabled"); + } + /** + * Set whether animations should be skipped based on the config. + */ + this.shouldSkipAnimations = this.skipAnimationsConfig ?? false; + this.parent?.addChild(this); + this.update(this.props, this.presenceContext); + this.hasBeenMounted = true; + } + unmount() { + this.projection && this.projection.unmount(); + cancelFrame(this.notifyUpdate); + cancelFrame(this.render); + this.valueSubscriptions.forEach((remove) => remove()); + this.valueSubscriptions.clear(); + this.removeFromVariantTree && this.removeFromVariantTree(); + this.parent?.removeChild(this); + for (const key in this.events) { + this.events[key].clear(); + } + for (const key in this.features) { + const feature = this.features[key]; + if (feature) { + feature.unmount(); + feature.isMounted = false; + } + } + this.current = null; + } + addChild(child) { + this.children.add(child); + this.enteringChildren ?? (this.enteringChildren = new Set()); + this.enteringChildren.add(child); + } + removeChild(child) { + this.children.delete(child); + this.enteringChildren && this.enteringChildren.delete(child); + } + bindToMotionValue(key, value) { + if (this.valueSubscriptions.has(key)) { + this.valueSubscriptions.get(key)(); + } + if (value.accelerate && + acceleratedValues.has(key) && + this.current instanceof HTMLElement) { + const { factory, keyframes, times, ease, duration } = value.accelerate; + const animation = new NativeAnimation({ + element: this.current, + name: key, + keyframes, + times, + ease, + duration: secondsToMilliseconds(duration), + }); + const cleanup = factory(animation); + this.valueSubscriptions.set(key, () => { + cleanup(); + animation.cancel(); + }); + return; + } + const valueIsTransform = transformProps.has(key); + if (valueIsTransform && this.onBindTransform) { + this.onBindTransform(); + } + const removeOnChange = value.on("change", (latestValue) => { + this.latestValues[key] = latestValue; + this.props.onUpdate && frame.preRender(this.notifyUpdate); + if (valueIsTransform && this.projection) { + this.projection.isTransformDirty = true; + } + this.scheduleRender(); + }); + let removeSyncCheck; + if (typeof window !== "undefined" && + window.MotionCheckAppearSync) { + removeSyncCheck = window.MotionCheckAppearSync(this, key, value); + } + this.valueSubscriptions.set(key, () => { + removeOnChange(); + if (removeSyncCheck) + removeSyncCheck(); + // Defer to MotionValue.on("change") auto-stop so React 19 remounts + // can resubscribe before the animation is cancelled (#3315). + }); + } + sortNodePosition(other) { + /** + * If these nodes aren't even of the same type we can't compare their depth. + */ + if (!this.current || + !this.sortInstanceNodePosition || + this.type !== other.type) { + return 0; + } + return this.sortInstanceNodePosition(this.current, other.current); + } + updateFeatures() { + let key = "animation"; + for (key in featureDefinitions) { + const featureDefinition = featureDefinitions[key]; + if (!featureDefinition) + continue; + const { isEnabled, Feature: FeatureConstructor } = featureDefinition; + /** + * If this feature is enabled but not active, make a new instance. + */ + if (!this.features[key] && + FeatureConstructor && + isEnabled(this.props)) { + this.features[key] = new FeatureConstructor(this); + } + /** + * If we have a feature, mount or update it. + */ + if (this.features[key]) { + const feature = this.features[key]; + if (feature.isMounted) { + feature.update(); + } + else { + feature.mount(); + feature.isMounted = true; + } + } + } + } + triggerBuild() { + this.build(this.renderState, this.latestValues, this.props); + } + /** + * Measure the current viewport box with or without transforms. + * Only measures axis-aligned boxes, rotate and skew must be manually + * removed with a re-render to work. + */ + measureViewportBox() { + return this.current + ? this.measureInstanceViewportBox(this.current, this.props) + : createBox(); + } + getStaticValue(key) { + return this.latestValues[key]; + } + setStaticValue(key, value) { + this.latestValues[key] = value; + } + /** + * Update the provided props. Ensure any newly-added motion values are + * added to our map, old ones removed, and listeners updated. + */ + update(props, presenceContext) { + if (props.transformTemplate || this.props.transformTemplate) { + this.scheduleRender(); + } + this.prevProps = this.props; + this.props = props; + this.prevPresenceContext = this.presenceContext; + this.presenceContext = presenceContext; + /** + * Update prop event handlers ie onAnimationStart, onAnimationComplete + */ + for (let i = 0; i < propEventHandlers.length; i++) { + const key = propEventHandlers[i]; + if (this.propEventSubscriptions[key]) { + this.propEventSubscriptions[key](); + delete this.propEventSubscriptions[key]; + } + const listenerName = ("on" + key); + const listener = props[listenerName]; + if (listener) { + this.propEventSubscriptions[key] = this.on(key, listener); + } + } + this.prevMotionValues = updateMotionValuesFromProps(this, this.scrapeMotionValuesFromProps(props, this.prevProps || {}, this), this.prevMotionValues); + if (this.handleChildMotionValue) { + this.handleChildMotionValue(); + } + } + getProps() { + return this.props; + } + /** + * Returns the variant definition with a given name. + */ + getVariant(name) { + return this.props.variants ? this.props.variants[name] : undefined; + } + /** + * Returns the defined default transition on this component. + */ + getDefaultTransition() { + return this.props.transition; + } + getTransformPagePoint() { + return this.props.transformPagePoint; + } + getClosestVariantNode() { + return this.isVariantNode + ? this + : this.parent + ? this.parent.getClosestVariantNode() + : undefined; + } + /** + * Add a child visual element to our set of children. + */ + addVariantChild(child) { + const closestVariantNode = this.getClosestVariantNode(); + if (closestVariantNode) { + closestVariantNode.variantChildren && + closestVariantNode.variantChildren.add(child); + return () => closestVariantNode.variantChildren.delete(child); + } + } + /** + * Add a motion value and bind it to this visual element. + */ + addValue(key, value) { + // Remove existing value if it exists + const existingValue = this.values.get(key); + if (value !== existingValue) { + if (existingValue) + this.removeValue(key); + this.bindToMotionValue(key, value); + this.values.set(key, value); + this.latestValues[key] = value.get(); + } + } + /** + * Remove a motion value and unbind any active subscriptions. + */ + removeValue(key) { + this.values.delete(key); + const unsubscribe = this.valueSubscriptions.get(key); + if (unsubscribe) { + unsubscribe(); + this.valueSubscriptions.delete(key); + } + delete this.latestValues[key]; + this.removeValueFromRenderState(key, this.renderState); + } + /** + * Check whether we have a motion value for this key + */ + hasValue(key) { + return this.values.has(key); + } + getValue(key, defaultValue) { + if (this.props.values && this.props.values[key]) { + return this.props.values[key]; + } + let value = this.values.get(key); + if (value === undefined && defaultValue !== undefined) { + value = motionValue(defaultValue === null ? undefined : defaultValue, { owner: this }); + this.addValue(key, value); + } + return value; + } + /** + * If we're trying to animate to a previously unencountered value, + * we need to check for it in our state and as a last resort read it + * directly from the instance (which might have performance implications). + */ + readValue(key, target) { + let value = this.latestValues[key] !== undefined || !this.current + ? this.latestValues[key] + : this.getBaseTargetFromProps(this.props, key) ?? + this.readValueFromInstance(this.current, key, this.options); + if (value !== undefined && value !== null) { + if (typeof value === "string" && + (isNumericalString(value) || isZeroValueString(value))) { + // If this is a number read as a string, ie "0" or "200", convert it to a number + value = parseFloat(value); + } + else if (!findValueType(value) && complex.test(target)) { + value = getAnimatableNone(key, target); + } + this.setBaseTarget(key, isMotionValue(value) ? value.get() : value); + } + return isMotionValue(value) ? value.get() : value; + } + /** + * Set the base target to later animate back to. This is currently + * only hydrated on creation and when we first read a value. + */ + setBaseTarget(key, value) { + this.baseTarget[key] = value; + } + /** + * Find the base target for a value thats been removed from all animation + * props. + */ + getBaseTarget(key) { + const { initial } = this.props; + let valueFromInitial; + if (typeof initial === "string" || typeof initial === "object") { + const variant = resolveVariantFromProps(this.props, initial, this.presenceContext?.custom); + if (variant) { + valueFromInitial = variant[key]; + } + } + /** + * If this value still exists in the current initial variant, read that. + */ + if (initial && valueFromInitial !== undefined) { + return valueFromInitial; + } + /** + * Alternatively, if this VisualElement config has defined a getBaseTarget + * so we can read the value from an alternative source, try that. + */ + const target = this.getBaseTargetFromProps(this.props, key); + if (target !== undefined && !isMotionValue(target)) + return target; + /** + * If the value was initially defined on initial, but it doesn't any more, + * return undefined. Otherwise return the value as initially read from the DOM. + */ + return this.initialValues[key] !== undefined && + valueFromInitial === undefined + ? undefined + : this.baseTarget[key]; + } + on(eventName, callback) { + if (!this.events[eventName]) { + this.events[eventName] = new SubscriptionManager(); + } + return this.events[eventName].add(callback); + } + notify(eventName, ...args) { + if (this.events[eventName]) { + this.events[eventName].notify(...args); + } + } + scheduleRenderMicrotask() { + microtask.render(this.render); + } + } + + class DOMVisualElement extends VisualElement { + constructor() { + super(...arguments); + this.KeyframeResolver = DOMKeyframesResolver; + } + sortInstanceNodePosition(a, b) { + /** + * compareDocumentPosition returns a bitmask, by using the bitwise & + * we're returning true if 2 in that bitmask is set to true. 2 is set + * to true if b preceeds a. + */ + return a.compareDocumentPosition(b) & 2 ? 1 : -1; + } + getBaseTargetFromProps(props, key) { + const style = props.style; + return style ? style[key] : undefined; + } + removeValueFromRenderState(key, { vars, style }) { + delete vars[key]; + delete style[key]; + } + handleChildMotionValue() { + if (this.childSubscription) { + this.childSubscription(); + delete this.childSubscription; + } + const { children } = this.props; + if (isMotionValue(children)) { + this.childSubscription = children.on("change", (latest) => { + if (this.current) { + this.current.textContent = `${latest}`; + } + }); + } + } + } + + /** + * Feature base class for extending VisualElement functionality. + * Features are plugins that can be mounted/unmounted to add behavior + * like gestures, animations, or layout tracking. + */ + class Feature { + constructor(node) { + this.isMounted = false; + this.node = node; + } + update() { } + } + + /** + * Bounding boxes tend to be defined as top, left, right, bottom. For various operations + * it's easier to consider each axis individually. This function returns a bounding box + * as a map of single-axis min/max values. + */ + function convertBoundingBoxToBox({ top, left, right, bottom, }) { + return { + x: { min: left, max: right }, + y: { min: top, max: bottom }, + }; + } + function convertBoxToBoundingBox({ x, y }) { + return { top: y.min, right: x.max, bottom: y.max, left: x.min }; + } + /** + * Applies a TransformPoint function to a bounding box. TransformPoint is usually a function + * provided by Framer to allow measured points to be corrected for device scaling. This is used + * when measuring DOM elements and DOM event points. + */ + function transformBoxPoints(point, transformPoint) { + if (!transformPoint) + return point; + const topLeft = transformPoint({ x: point.left, y: point.top }); + const bottomRight = transformPoint({ x: point.right, y: point.bottom }); + return { + top: topLeft.y, + left: topLeft.x, + bottom: bottomRight.y, + right: bottomRight.x, + }; + } + + function isIdentityScale(scale) { + return scale === undefined || scale === 1; + } + function hasScale({ scale, scaleX, scaleY }) { + return (!isIdentityScale(scale) || + !isIdentityScale(scaleX) || + !isIdentityScale(scaleY)); + } + function hasTransform(values) { + return (hasScale(values) || + has2DTranslate(values) || + values.z || + values.rotate || + values.rotateX || + values.rotateY || + values.skewX || + values.skewY); + } + function has2DTranslate(values) { + return is2DTranslate(values.x) || is2DTranslate(values.y); + } + function is2DTranslate(value) { + return value && value !== "0%"; + } + + /** + * Scales a point based on a factor and an originPoint + */ + function scalePoint(point, scale, originPoint) { + const distanceFromOrigin = point - originPoint; + const scaled = scale * distanceFromOrigin; + return originPoint + scaled; + } + /** + * Applies a translate/scale delta to a point + */ + function applyPointDelta(point, translate, scale, originPoint, boxScale) { + if (boxScale !== undefined) { + point = scalePoint(point, boxScale, originPoint); + } + return scalePoint(point, scale, originPoint) + translate; + } + /** + * Applies a translate/scale delta to an axis + */ + function applyAxisDelta(axis, translate = 0, scale = 1, originPoint, boxScale) { + axis.min = applyPointDelta(axis.min, translate, scale, originPoint, boxScale); + axis.max = applyPointDelta(axis.max, translate, scale, originPoint, boxScale); + } + /** + * Applies a translate/scale delta to a box + */ + function applyBoxDelta(box, { x, y }) { + applyAxisDelta(box.x, x.translate, x.scale, x.originPoint); + applyAxisDelta(box.y, y.translate, y.scale, y.originPoint); + } + const TREE_SCALE_SNAP_MIN = 0.999999999999; + const TREE_SCALE_SNAP_MAX = 1.0000000000001; + /** + * Apply a tree of deltas to a box. We do this to calculate the effect of all the transforms + * in a tree upon our box before then calculating how to project it into our desired viewport-relative box + * + * This is the final nested loop within updateLayoutDelta for future refactoring + */ + function applyTreeDeltas(box, treeScale, treePath, isSharedTransition = false) { + const treeLength = treePath.length; + if (!treeLength) + return; + // Reset the treeScale + treeScale.x = treeScale.y = 1; + let node; + let delta; + for (let i = 0; i < treeLength; i++) { + node = treePath[i]; + delta = node.projectionDelta; + /** + * TODO: Prefer to remove this, but currently we have motion components with + * display: contents in Framer. + */ + const { visualElement } = node.options; + if (visualElement && + visualElement.props.style && + visualElement.props.style.display === "contents") { + continue; + } + if (isSharedTransition && + node.options.layoutScroll && + node.scroll && + node !== node.root) { + translateAxis(box.x, -node.scroll.offset.x); + translateAxis(box.y, -node.scroll.offset.y); + } + if (delta) { + // Incoporate each ancestor's scale into a cumulative treeScale for this component + treeScale.x *= delta.x.scale; + treeScale.y *= delta.y.scale; + // Apply each ancestor's calculated delta into this component's recorded layout box + applyBoxDelta(box, delta); + } + if (isSharedTransition && hasTransform(node.latestValues)) { + transformBox(box, node.latestValues, node.layout?.layoutBox); + } + } + /** + * Snap tree scale back to 1 if it's within a non-perceivable threshold. + * This will help reduce useless scales getting rendered. + */ + if (treeScale.x < TREE_SCALE_SNAP_MAX && + treeScale.x > TREE_SCALE_SNAP_MIN) { + treeScale.x = 1.0; + } + if (treeScale.y < TREE_SCALE_SNAP_MAX && + treeScale.y > TREE_SCALE_SNAP_MIN) { + treeScale.y = 1.0; + } + } + function translateAxis(axis, distance) { + axis.min += distance; + axis.max += distance; + } + /** + * Apply a transform to an axis from the latest resolved motion values. + * This function basically acts as a bridge between a flat motion value map + * and applyAxisDelta + */ + function transformAxis(axis, axisTranslate, axisScale, boxScale, axisOrigin = 0.5) { + const originPoint = mixNumber$1(axis.min, axis.max, axisOrigin); + // Apply the axis delta to the final axis + applyAxisDelta(axis, axisTranslate, axisScale, originPoint, boxScale); + } + function resolveAxisTranslate(value, axis) { + if (typeof value === "string") { + return (parseFloat(value) / 100) * (axis.max - axis.min); + } + return value; + } + /** + * Apply a transform to a box from the latest resolved motion values. + */ + function transformBox(box, transform, sourceBox) { + const resolveBox = sourceBox ?? box; + transformAxis(box.x, resolveAxisTranslate(transform.x, resolveBox.x), transform.scaleX, transform.scale, transform.originX); + transformAxis(box.y, resolveAxisTranslate(transform.y, resolveBox.y), transform.scaleY, transform.scale, transform.originY); + } + + function measureViewportBox(instance, transformPoint) { + return convertBoundingBoxToBox(transformBoxPoints(instance.getBoundingClientRect(), transformPoint)); + } + function measurePageBox(element, rootProjectionNode, transformPagePoint) { + const viewportBox = measureViewportBox(element, transformPagePoint); + const { scroll } = rootProjectionNode; + if (scroll) { + translateAxis(viewportBox.x, scroll.offset.x); + translateAxis(viewportBox.y, scroll.offset.y); + } + return viewportBox; + } + + const translateAlias = { + x: "translateX", + y: "translateY", + z: "translateZ", + transformPerspective: "perspective", + }; + const numTransforms = transformPropOrder.length; + /** + * Build a CSS transform style from individual x/y/scale etc properties. + * + * This outputs with a default order of transforms/scales/rotations, this can be customised by + * providing a transformTemplate function. + */ + function buildTransform(latestValues, transform, transformTemplate) { + // The transform string we're going to build into. + let transformString = ""; + let transformIsDefault = true; + /** + * Loop over all possible transforms in order, adding the ones that + * are present to the transform string. + */ + for (let i = 0; i < numTransforms; i++) { + const key = transformPropOrder[i]; + const value = latestValues[key]; + if (value === undefined) + continue; + let valueIsDefault = true; + if (typeof value === "number") { + valueIsDefault = value === (key.startsWith("scale") ? 1 : 0); + } + else { + const parsed = parseFloat(value); + valueIsDefault = key.startsWith("scale") ? parsed === 1 : parsed === 0; + } + if (!valueIsDefault || transformTemplate) { + const valueAsType = getValueAsType(value, numberValueTypes[key]); + if (!valueIsDefault) { + transformIsDefault = false; + const transformName = translateAlias[key] || key; + transformString += `${transformName}(${valueAsType}) `; + } + if (transformTemplate) { + transform[key] = valueAsType; + } + } + } + // `pathRotation` composes onto `rotate` as a separate additive term so + // the user's `rotate` is never clobbered. Deliberately not a slot in + // `transformPropOrder`. + const pathRotation = latestValues.pathRotation; + if (pathRotation) { + transformIsDefault = false; + transformString += `rotate(${getValueAsType(pathRotation, numberValueTypes.pathRotation)}) `; + } + transformString = transformString.trim(); + // If we have a custom `transform` template, pass our transform values and + // generated transformString to that before returning + if (transformTemplate) { + transformString = transformTemplate(transform, transformIsDefault ? "" : transformString); + } + else if (transformIsDefault) { + transformString = "none"; + } + return transformString; + } + + function buildHTMLStyles(state, latestValues, transformTemplate) { + const { style, vars, transformOrigin } = state; + // Track whether we encounter any transform or transformOrigin values. + let hasTransform = false; + let hasTransformOrigin = false; + /** + * Loop over all our latest animated values and decide whether to handle them + * as a style or CSS variable. + * + * Transforms and transform origins are kept separately for further processing. + */ + for (const key in latestValues) { + const value = latestValues[key]; + if (transformProps.has(key)) { + // If this is a transform, flag to enable further transform processing + hasTransform = true; + continue; + } + else if (isCSSVariableName(key)) { + vars[key] = value; + continue; + } + else { + // Convert the value to its default value type, ie 0 -> "0px" + const valueAsType = getValueAsType(value, numberValueTypes[key]); + if (key.startsWith("origin")) { + // If this is a transform origin, flag and enable further transform-origin processing + hasTransformOrigin = true; + transformOrigin[key] = + valueAsType; + } + else { + style[key] = valueAsType; + } + } + } + if (!latestValues.transform) { + if (hasTransform || transformTemplate) { + style.transform = buildTransform(latestValues, state.transform, transformTemplate); + } + else if (style.transform) { + /** + * If we have previously created a transform but currently don't have any, + * reset transform style to none. + */ + style.transform = "none"; + } + } + /** + * Build a transformOrigin style. Uses the same defaults as the browser for + * undefined origins. + */ + if (hasTransformOrigin) { + const { originX = "50%", originY = "50%", originZ = 0, } = transformOrigin; + style.transformOrigin = `${originX} ${originY} ${originZ}`; + } + } + + function renderHTML(element, { style, vars }, styleProp, projection) { + const elementStyle = element.style; + let key; + for (key in style) { + // CSSStyleDeclaration has [index: number]: string; in the types, so we use that as key type. + elementStyle[key] = style[key]; + } + // Write projection styles directly to element style + projection?.applyProjectionStyles(elementStyle, styleProp); + for (key in vars) { + // Loop over any CSS variables and assign those. + // They can only be assigned using `setProperty`. + elementStyle.setProperty(key, vars[key]); + } + } + + function pixelsToPercent(pixels, axis) { + if (axis.max === axis.min) + return 0; + return (pixels / (axis.max - axis.min)) * 100; + } + /** + * We always correct borderRadius as a percentage rather than pixels to reduce paints. + * For example, if you are projecting a box that is 100px wide with a 10px borderRadius + * into a box that is 200px wide with a 20px borderRadius, that is actually a 10% + * borderRadius in both states. If we animate between the two in pixels that will trigger + * a paint each time. If we animate between the two in percentage we'll avoid a paint. + */ + const correctBorderRadius = { + correct: (latest, node) => { + if (!node.target) + return latest; + /** + * If latest is a string, if it's a percentage we can return immediately as it's + * going to be stretched appropriately. Otherwise, if it's a pixel, convert it to a number. + */ + if (typeof latest === "string") { + if (px.test(latest)) { + latest = parseFloat(latest); + } + else { + return latest; + } + } + /** + * If latest is a number, it's a pixel value. We use the current viewportBox to calculate that + * pixel value as a percentage of each axis + */ + const x = pixelsToPercent(latest, node.target.x); + const y = pixelsToPercent(latest, node.target.y); + return `${x}% ${y}%`; + }, + }; + + const correctBoxShadow = { + correct: (latest, { treeScale, projectionDelta }) => { + const original = latest; + const shadow = complex.parse(latest); + // TODO: Doesn't support multiple shadows + if (shadow.length > 5) + return original; + const template = complex.createTransformer(latest); + const offset = typeof shadow[0] !== "number" ? 1 : 0; + // Calculate the overall context scale + const xScale = projectionDelta.x.scale * treeScale.x; + const yScale = projectionDelta.y.scale * treeScale.y; + shadow[0 + offset] /= xScale; + shadow[1 + offset] /= yScale; + /** + * Ideally we'd correct x and y scales individually, but because blur and + * spread apply to both we have to take a scale average and apply that instead. + * We could potentially improve the outcome of this by incorporating the ratio between + * the two scales. + */ + const averageScale = mixNumber$1(xScale, yScale, 0.5); + // Blur + if (typeof shadow[2 + offset] === "number") + shadow[2 + offset] /= averageScale; + // Spread + if (typeof shadow[3 + offset] === "number") + shadow[3 + offset] /= averageScale; + return template(shadow); + }, + }; + + const scaleCorrectors = { + borderRadius: { + ...correctBorderRadius, + applyTo: [...cornerRadiusProps], + }, + borderTopLeftRadius: correctBorderRadius, + borderTopRightRadius: correctBorderRadius, + borderBottomLeftRadius: correctBorderRadius, + borderBottomRightRadius: correctBorderRadius, + boxShadow: correctBoxShadow, + }; + function addScaleCorrector(correctors) { + for (const key in correctors) { + scaleCorrectors[key] = correctors[key]; + if (isCSSVariableName(key)) { + scaleCorrectors[key].isCSSVariable = true; + } + } + } + + function isForcedMotionValue(key, { layout, layoutId }) { + return (transformProps.has(key) || + key.startsWith("origin") || + ((layout || layoutId !== undefined) && + (!!scaleCorrectors[key] || key === "opacity"))); + } + + function scrapeMotionValuesFromProps$1(props, prevProps, visualElement) { + const style = props.style; + const prevStyle = prevProps?.style; + const newValues = {}; + if (!style) + return newValues; + for (const key in style) { + if (isMotionValue(style[key]) || + (prevStyle && isMotionValue(prevStyle[key])) || + isForcedMotionValue(key, props) || + visualElement?.getValue(key)?.liveStyle !== undefined) { + newValues[key] = style[key]; + } + } + return newValues; + } + + function getComputedStyle$1(element) { + return window.getComputedStyle(element); + } + class HTMLVisualElement extends DOMVisualElement { + constructor() { + super(...arguments); + this.type = "html"; + this.renderInstance = renderHTML; + } + mount(instance) { + /** + * If a custom component forwards its ref to something other than a + * HTML/SVG element (a class instance, an imperative handle) there's + * nothing for Motion to style, measure or attach gestures to. #2777 + */ + exports.invariant(Boolean(instance.style), "motion.create() components must forward their ref to a HTML or SVG element", "custom-component-ref"); + super.mount(instance); + } + readValueFromInstance(instance, key) { + if (transformProps.has(key)) { + return this.projection?.isProjecting + ? defaultTransformValue(key) + : readTransformValue(instance, key); + } + else { + const computedStyle = getComputedStyle$1(instance); + const value = (isCSSVariableName(key) + ? computedStyle.getPropertyValue(key) + : computedStyle[key]) || 0; + return typeof value === "string" ? value.trim() : value; + } + } + measureInstanceViewportBox(instance, { transformPagePoint }) { + return measureViewportBox(instance, transformPagePoint); + } + build(renderState, latestValues, props) { + buildHTMLStyles(renderState, latestValues, props.transformTemplate); + } + scrapeMotionValuesFromProps(props, prevProps, visualElement) { + return scrapeMotionValuesFromProps$1(props, prevProps, visualElement); + } + } + + function isObjectKey(key, object) { + return key in object; + } + class ObjectVisualElement extends VisualElement { + constructor() { + super(...arguments); + this.type = "object"; + } + readValueFromInstance(instance, key) { + if (isObjectKey(key, instance)) { + const value = instance[key]; + if (typeof value === "string" || typeof value === "number") { + return value; + } + } + return undefined; + } + getBaseTargetFromProps() { + return undefined; + } + removeValueFromRenderState(key, renderState) { + delete renderState.output[key]; + } + measureInstanceViewportBox() { + return createBox(); + } + build(renderState, latestValues) { + Object.assign(renderState.output, latestValues); + } + renderInstance(instance, { output }) { + Object.assign(instance, output); + } + sortInstanceNodePosition() { + return 0; + } + } + + const dashKeys = { + offset: "stroke-dashoffset", + array: "stroke-dasharray", + }; + const camelKeys = { + offset: "strokeDashoffset", + array: "strokeDasharray", + }; + /** + * Build SVG path properties. Uses the path's measured length to convert + * our custom pathLength, pathSpacing and pathOffset into stroke-dashoffset + * and stroke-dasharray attributes. + * + * This function is mutative to reduce per-frame GC. + * + * Note: We use unitless values for stroke-dasharray and stroke-dashoffset + * because Safari incorrectly scales px values when the page is zoomed. + */ + function buildSVGPath(attrs, length, spacing = 1, offset = 0, useDashCase = true) { + // Normalise path length by setting SVG attribute pathLength to 1 + attrs.pathLength = 1; + // We use dash case when setting attributes directly to the DOM node and camel case + // when defining props on a React component. + const keys = useDashCase ? dashKeys : camelKeys; + // Build the dash offset (unitless to avoid Safari zoom bug) + attrs[keys.offset] = `${-offset}`; + // Build the dash array (unitless to avoid Safari zoom bug) + attrs[keys.array] = `${length} ${spacing}`; + } + + const cssStyleProperties = [ + "transform", + "opacity", + "offsetDistance", + "offsetPath", + "offsetRotate", + "offsetAnchor", + ]; + /** + * Build SVG visual attributes, like cx and style.transform + */ + function buildSVGAttrs(state, { attrX, attrY, attrScale, pathLength, pathSpacing = 1, pathOffset = 0, + // This is object creation, which we try to avoid per-frame. + ...latest }, isSVGTag, transformTemplate, styleProp) { + buildHTMLStyles(state, latest, transformTemplate); + /** + * For svg tags we just want to make sure viewBox is animatable and treat all the styles + * as normal HTML tags. + */ + if (isSVGTag) { + if (state.style.viewBox) { + state.attrs.viewBox = state.style.viewBox; + } + return; + } + state.attrs = state.style; + state.style = {}; + const { attrs, style } = state; + for (const key of cssStyleProperties) { + if (attrs[key] !== undefined) { + style[key] = attrs[key]; + delete attrs[key]; + } + } + if (style.transform || attrs.transformOrigin) { + style.transformOrigin = attrs.transformOrigin ?? "50% 50%"; + delete attrs.transformOrigin; + } + if (style.transform) { + /** + * SVG's element transform-origin uses its own median as a reference. + * Therefore, transformBox becomes a fill-box + */ + style.transformBox = styleProp?.transformBox ?? "fill-box"; + delete attrs.transformBox; + } + // Render attrX/attrY/attrScale as attributes + if (attrX !== undefined) + attrs.x = attrX; + if (attrY !== undefined) + attrs.y = attrY; + if (attrScale !== undefined) + attrs.scale = attrScale; + // Build SVG path if one has been defined + if (pathLength !== undefined) { + buildSVGPath(attrs, pathLength, pathSpacing, pathOffset, false); + } + } + + /** + * A set of attribute names that are always read/written as camel case. + */ + const camelCaseAttributes = new Set([ + "baseFrequency", + "diffuseConstant", + "kernelMatrix", + "kernelUnitLength", + "keySplines", + "keyTimes", + "limitingConeAngle", + "markerHeight", + "markerWidth", + "numOctaves", + "targetX", + "targetY", + "surfaceScale", + "specularConstant", + "specularExponent", + "stdDeviation", + "tableValues", + "viewBox", + "gradientTransform", + "pathLength", + "startOffset", + "textLength", + "lengthAdjust", + ]); + + const isSVGTag = (tag) => typeof tag === "string" && tag.toLowerCase() === "svg"; + + function renderSVG(element, renderState, _styleProp, projection) { + renderHTML(element, renderState, undefined, projection); + for (const key in renderState.attrs) { + element.setAttribute(!camelCaseAttributes.has(key) ? camelToDash(key) : key, renderState.attrs[key]); + } + } + + function scrapeMotionValuesFromProps(props, prevProps, visualElement) { + const newValues = scrapeMotionValuesFromProps$1(props, prevProps, visualElement); + for (const key in props) { + if (isMotionValue(props[key]) || + isMotionValue(prevProps[key])) { + const targetKey = transformPropOrder.indexOf(key) !== -1 + ? "attr" + key.charAt(0).toUpperCase() + key.substring(1) + : key; + newValues[targetKey] = props[key]; + } + } + return newValues; + } + + class SVGVisualElement extends DOMVisualElement { + constructor() { + super(...arguments); + this.type = "svg"; + this.isSVGTag = false; + this.measureInstanceViewportBox = createBox; + } + getBaseTargetFromProps(props, key) { + return props[key]; + } + readValueFromInstance(instance, key) { + if (transformProps.has(key)) { + const defaultType = getDefaultValueType(key); + return defaultType ? defaultType.default || 0 : 0; + } + if (cssStyleProperties.includes(key)) { + const computedStyle = getComputedStyle(instance); + const value = computedStyle[key]; + if (typeof value === "string" && value) + return value.trim(); + } + key = !camelCaseAttributes.has(key) ? camelToDash(key) : key; + return instance.getAttribute(key); + } + scrapeMotionValuesFromProps(props, prevProps, visualElement) { + return scrapeMotionValuesFromProps(props, prevProps, visualElement); + } + build(renderState, latestValues, props) { + buildSVGAttrs(renderState, latestValues, this.isSVGTag, props.transformTemplate, props.style); + } + renderInstance(instance, renderState, styleProp, projection) { + renderSVG(instance, renderState, styleProp, projection); + } + mount(instance) { + this.isSVGTag = isSVGTag(instance.tagName); + super.mount(instance); + } + } + + const numVariantProps = variantProps.length; + /** + * Get variant context from a visual element's parent chain. + * Uses `any` type for visualElement to avoid circular dependencies. + */ + function getVariantContext(visualElement) { + if (!visualElement) + return undefined; + if (!visualElement.isControllingVariants) { + const context = visualElement.parent + ? getVariantContext(visualElement.parent) || {} + : {}; + if (visualElement.props.initial !== undefined) { + context.initial = visualElement.props.initial; + } + return context; + } + const context = {}; + for (let i = 0; i < numVariantProps; i++) { + const name = variantProps[i]; + const prop = visualElement.props[name]; + if (isVariantLabel(prop) || prop === false) { + context[name] = prop; + } + } + return context; + } + + function shallowCompare(next, prev) { + if (!Array.isArray(prev)) + return false; + const prevLength = prev.length; + if (prevLength !== next.length) + return false; + for (let i = 0; i < prevLength; i++) { + if (prev[i] !== next[i]) + return false; + } + return true; + } + + const reversePriorityOrder = [...variantPriorityOrder].reverse(); + const numAnimationTypes = variantPriorityOrder.length; + function createAnimateFunction(visualElement) { + return (animations) => { + return Promise.all(animations.map(({ animation, options }) => animateVisualElement(visualElement, animation, options))); + }; + } + function createAnimationState(visualElement) { + let animate = createAnimateFunction(visualElement); + let state = createState(); + let isInitialRender = true; + /** + * Track whether the animation state has been reset (e.g. via StrictMode + * double-invocation or Suspense unmount/remount). On the first + * animateChanges() call after a reset we need to behave like the initial + * render for variant-inheritance checks, even though isInitialRender is + * already false. + */ + let wasReset = false; + /** + * This function will be used to reduce the animation definitions for + * each active animation type into an object of resolved values for it. + */ + const buildResolvedTypeValues = (type) => (acc, definition) => { + const resolved = resolveVariant(visualElement, definition, type === "exit" + ? visualElement.presenceContext?.custom + : undefined); + if (resolved) { + const { transition, transitionEnd, ...target } = resolved; + acc = { ...acc, ...target, ...transitionEnd }; + } + return acc; + }; + /** + * This just allows us to inject mocked animation functions + * @internal + */ + function setAnimateFunction(makeAnimator) { + animate = makeAnimator(visualElement); + } + /** + * When we receive new props, we need to: + * 1. Create a list of protected keys for each type. This is a directory of + * value keys that are currently being "handled" by types of a higher priority + * so that whenever an animation is played of a given type, these values are + * protected from being animated. + * 2. Determine if an animation type needs animating. + * 3. Determine if any values have been removed from a type and figure out + * what to animate those to. + */ + function animateChanges(changedActiveType) { + const { props } = visualElement; + const context = getVariantContext(visualElement.parent) || {}; + /** + * A list of animations that we'll build into as we iterate through the animation + * types. This will get executed at the end of the function. + */ + const animations = []; + /** + * Keep track of which values have been removed. Then, as we hit lower priority + * animation types, we can check if they contain removed values and animate to that. + */ + const removedKeys = new Set(); + /** + * A dictionary of all encountered keys. This is an object to let us build into and + * copy it without iteration. Each time we hit an animation type we set its protected + * keys - the keys its not allowed to animate - to the latest version of this object. + */ + let encounteredKeys = {}; + /** + * If a variant has been removed at a given index, and this component is controlling + * variant animations, we want to ensure lower-priority variants are forced to animate. + */ + let removedVariantIndex = Infinity; + /** + * Iterate through all animation types in reverse priority order. For each, we want to + * detect which values it's handling and whether or not they've changed (and therefore + * need to be animated). If any values have been removed, we want to detect those in + * lower priority props and flag for animation. + */ + for (let i = 0; i < numAnimationTypes; i++) { + const type = reversePriorityOrder[i]; + const typeState = state[type]; + const prop = props[type] !== undefined + ? props[type] + : context[type]; + const propIsVariant = isVariantLabel(prop); + /** + * If this type has *just* changed isActive status, set activeDelta + * to that status. Otherwise set to null. + */ + const activeDelta = type === changedActiveType ? typeState.isActive : null; + if (activeDelta === false) + removedVariantIndex = i; + /** + * If this prop is an inherited variant, rather than been set directly on the + * component itself, we want to make sure we allow the parent to trigger animations. + * + * TODO: Can probably change this to a !isControllingVariants check + */ + let isInherited = prop === context[type] && + prop !== props[type] && + propIsVariant; + if (isInherited && + (isInitialRender || wasReset) && + visualElement.manuallyAnimateOnMount) { + isInherited = false; + } + /** + * Set all encountered keys so far as the protected keys for this type. This will + * be any key that has been animated or otherwise handled by active, higher-priortiy types. + */ + typeState.protectedKeys = { ...encounteredKeys }; + // Check if we can skip analysing this prop early + if ( + // If it isn't active and hasn't *just* been set as inactive + (!typeState.isActive && activeDelta === null) || + // If we didn't and don't have any defined prop for this animation type + (!prop && !typeState.prevProp) || + // Or if the prop doesn't define an animation + isAnimationControls(prop) || + typeof prop === "boolean") { + continue; + } + /** + * If exit is already active and wasn't just activated, skip + * re-processing to prevent interrupting running exit animations. + * Re-resolving exit with a changed custom value can start new + * value animations that stop the originals, leaving the exit + * animation promise unresolved and the component stuck in the DOM. + */ + if (type === "exit" && typeState.isActive && activeDelta !== true) { + if (typeState.prevResolvedValues) { + encounteredKeys = { + ...encounteredKeys, + ...typeState.prevResolvedValues, + }; + } + continue; + } + /** + * As we go look through the values defined on this type, if we detect + * a changed value or a value that was removed in a higher priority, we set + * this to true and add this prop to the animation list. + */ + const variantDidChange = checkVariantsDidChange(typeState.prevProp, prop); + let shouldAnimateType = variantDidChange || + // If we're making this variant active, we want to always make it active + (type === changedActiveType && + typeState.isActive && + !isInherited && + propIsVariant) || + // If we removed a higher-priority variant (i is in reverse order) + (i > removedVariantIndex && propIsVariant); + let handledRemovedValues = false; + /** + * As animations can be set as variant lists, variants or target objects, we + * coerce everything to an array if it isn't one already + */ + const definitionList = Array.isArray(prop) ? prop : [prop]; + /** + * Build an object of all the resolved values. We'll use this in the subsequent + * animateChanges calls to determine whether a value has changed. + */ + let resolvedValues = definitionList.reduce(buildResolvedTypeValues(type), {}); + if (activeDelta === false) + resolvedValues = {}; + /** + * Now we need to loop through all the keys in the prev prop and this prop, + * and decide: + * 1. If the value has changed, and needs animating + * 2. If it has been removed, and needs adding to the removedKeys set + * 3. If it has been removed in a higher priority type and needs animating + * 4. If it hasn't been removed in a higher priority but hasn't changed, and + * needs adding to the type's protectedKeys list. + */ + const { prevResolvedValues = {} } = typeState; + const allKeys = { + ...prevResolvedValues, + ...resolvedValues, + }; + const markToAnimate = (key) => { + shouldAnimateType = true; + if (removedKeys.has(key)) { + handledRemovedValues = true; + removedKeys.delete(key); + } + typeState.needsAnimating[key] = true; + const motionValue = visualElement.getValue(key); + if (motionValue) + motionValue.liveStyle = false; + }; + for (const key in allKeys) { + const next = resolvedValues[key]; + const prev = prevResolvedValues[key]; + // If we've already handled this we can just skip ahead + if (encounteredKeys.hasOwnProperty(key)) + continue; + /** + * If the value has changed, we probably want to animate it. + */ + let valueHasChanged = false; + if (isKeyframesTarget(next) && isKeyframesTarget(prev)) { + valueHasChanged = + !shallowCompare(next, prev) || variantDidChange; + } + else { + valueHasChanged = next !== prev; + } + if (valueHasChanged) { + if (next !== undefined && next !== null) { + // If next is defined and doesn't equal prev, it needs animating + markToAnimate(key); + } + else { + // If it's undefined, it's been removed. + removedKeys.add(key); + } + } + else if (next !== undefined && removedKeys.has(key)) { + /** + * If next hasn't changed and it isn't undefined, we want to check if it's + * been removed by a higher priority + */ + markToAnimate(key); + } + else { + /** + * If it hasn't changed, we add it to the list of protected values + * to ensure it doesn't get animated. + */ + typeState.protectedKeys[key] = true; + } + } + /** + * Update the typeState so next time animateChanges is called we can compare the + * latest prop and resolvedValues to these. + */ + typeState.prevProp = prop; + typeState.prevResolvedValues = resolvedValues; + if (typeState.isActive) { + encounteredKeys = { ...encounteredKeys, ...resolvedValues }; + } + if ((isInitialRender || wasReset) && + visualElement.blockInitialAnimation) { + shouldAnimateType = false; + } + /** + * If this is an inherited prop we want to skip this animation + * unless the inherited variants haven't changed on this render. + */ + const willAnimateViaParent = isInherited && variantDidChange; + const needsAnimating = !willAnimateViaParent || handledRemovedValues; + if (shouldAnimateType && needsAnimating) { + animations.push(...definitionList.map((animation) => { + const options = { type }; + /** + * If we're performing the initial animation, but we're not + * rendering at the same time as the variant-controlling parent, + * we want to use the parent's transition to calculate the stagger. + */ + if (typeof animation === "string" && + (isInitialRender || wasReset) && + !willAnimateViaParent && + visualElement.manuallyAnimateOnMount && + visualElement.parent) { + const { parent } = visualElement; + const parentVariant = resolveVariant(parent, animation); + if (parent.enteringChildren && parentVariant) { + const { delayChildren } = parentVariant.transition || {}; + options.delay = calcChildStagger(parent.enteringChildren, visualElement, delayChildren); + } + } + return { + animation: animation, + options, + }; + })); + } + } + /** + * If there are some removed value that haven't been dealt with, + * we need to create a new animation that falls back either to the value + * defined in the style prop, or the last read value. + */ + if (removedKeys.size) { + const fallbackAnimation = {}; + /** + * If the initial prop contains a transition we can use that, otherwise + * allow the animation function to use the visual element's default. + */ + if (typeof props.initial !== "boolean") { + const initialTransition = resolveVariant(visualElement, Array.isArray(props.initial) + ? props.initial[0] + : props.initial); + if (initialTransition && initialTransition.transition) { + fallbackAnimation.transition = initialTransition.transition; + } + } + removedKeys.forEach((key) => { + const fallbackTarget = visualElement.getBaseTarget(key); + const motionValue = visualElement.getValue(key); + if (motionValue) + motionValue.liveStyle = true; + // @ts-expect-error - @mattgperry to figure if we should do something here + fallbackAnimation[key] = fallbackTarget ?? null; + }); + animations.push({ animation: fallbackAnimation }); + } + let shouldAnimate = Boolean(animations.length); + if (isInitialRender && + (props.initial === false || props.initial === props.animate) && + !visualElement.manuallyAnimateOnMount) { + shouldAnimate = false; + } + isInitialRender = false; + wasReset = false; + return shouldAnimate ? animate(animations) : Promise.resolve(); + } + /** + * Change whether a certain animation type is active. + */ + function setActive(type, isActive) { + // If the active state hasn't changed, we can safely do nothing here + if (state[type].isActive === isActive) + return Promise.resolve(); + // Propagate active change to children + visualElement.variantChildren?.forEach((child) => child.animationState?.setActive(type, isActive)); + state[type].isActive = isActive; + const animations = animateChanges(type); + for (const key in state) { + state[key].protectedKeys = {}; + } + return animations; + } + return { + animateChanges, + setActive, + setAnimateFunction, + getState: () => state, + reset: () => { + state = createState(); + wasReset = true; + }, + }; + } + function checkVariantsDidChange(prev, next) { + if (typeof next === "string") { + return next !== prev; + } + else if (Array.isArray(next)) { + return !shallowCompare(next, prev); + } + return false; + } + function createTypeState(isActive = false) { + return { + isActive, + protectedKeys: {}, + needsAnimating: {}, + prevResolvedValues: {}, + }; + } + function createState() { + return { + animate: createTypeState(true), + whileInView: createTypeState(), + whileHover: createTypeState(), + whileTap: createTypeState(), + whileDrag: createTypeState(), + whileFocus: createTypeState(), + exit: createTypeState(), + }; + } + + /** + * Reset an axis to the provided origin box. + * + * This is a mutative operation. + */ + function copyAxisInto(axis, originAxis) { + axis.min = originAxis.min; + axis.max = originAxis.max; + } + /** + * Reset a box to the provided origin box. + * + * This is a mutative operation. + */ + function copyBoxInto(box, originBox) { + copyAxisInto(box.x, originBox.x); + copyAxisInto(box.y, originBox.y); + } + /** + * Reset a delta to the provided origin box. + * + * This is a mutative operation. + */ + function copyAxisDeltaInto(delta, originDelta) { + delta.translate = originDelta.translate; + delta.scale = originDelta.scale; + delta.originPoint = originDelta.originPoint; + delta.origin = originDelta.origin; + } + + const SCALE_PRECISION = 0.0001; + const SCALE_MIN = 1 - SCALE_PRECISION; + const SCALE_MAX = 1 + SCALE_PRECISION; + const TRANSLATE_PRECISION = 0.01; + const TRANSLATE_MIN = 0 - TRANSLATE_PRECISION; + const TRANSLATE_MAX = 0 + TRANSLATE_PRECISION; + function calcLength(axis) { + return axis.max - axis.min; + } + function isNear(value, target, maxDistance) { + return Math.abs(value - target) <= maxDistance; + } + function calcAxisDelta(delta, source, target, origin = 0.5) { + delta.origin = origin; + delta.originPoint = mixNumber$1(source.min, source.max, delta.origin); + delta.scale = calcLength(target) / calcLength(source); + delta.translate = + mixNumber$1(target.min, target.max, delta.origin) - delta.originPoint; + if ((delta.scale >= SCALE_MIN && delta.scale <= SCALE_MAX) || + isNaN(delta.scale)) { + delta.scale = 1.0; + } + if ((delta.translate >= TRANSLATE_MIN && + delta.translate <= TRANSLATE_MAX) || + isNaN(delta.translate)) { + delta.translate = 0.0; + } + } + function calcBoxDelta(delta, source, target, origin) { + calcAxisDelta(delta.x, source.x, target.x, origin ? origin.originX : undefined); + calcAxisDelta(delta.y, source.y, target.y, origin ? origin.originY : undefined); + } + function calcRelativeAxis(target, relative, parent, anchor = 0) { + const anchorPoint = anchor + ? mixNumber$1(parent.min, parent.max, anchor) + : parent.min; + target.min = anchorPoint + relative.min; + target.max = target.min + calcLength(relative); + } + function calcRelativeBox(target, relative, parent, anchor) { + calcRelativeAxis(target.x, relative.x, parent.x, anchor?.x); + calcRelativeAxis(target.y, relative.y, parent.y, anchor?.y); + } + function calcRelativeAxisPosition(target, layout, parent, anchor = 0) { + const anchorPoint = anchor + ? mixNumber$1(parent.min, parent.max, anchor) + : parent.min; + target.min = layout.min - anchorPoint; + target.max = target.min + calcLength(layout); + } + function calcRelativePosition(target, layout, parent, anchor) { + calcRelativeAxisPosition(target.x, layout.x, parent.x, anchor?.x); + calcRelativeAxisPosition(target.y, layout.y, parent.y, anchor?.y); + } + + /** + * Remove a delta from a point. This is essentially the steps of applyPointDelta in reverse + */ + function removePointDelta(point, translate, scale, originPoint, boxScale) { + point -= translate; + point = scalePoint(point, 1 / scale, originPoint); + if (boxScale !== undefined) { + point = scalePoint(point, 1 / boxScale, originPoint); + } + return point; + } + /** + * Remove a delta from an axis. This is essentially the steps of applyAxisDelta in reverse + */ + function removeAxisDelta(axis, translate = 0, scale = 1, origin = 0.5, boxScale, originAxis = axis, sourceAxis = axis) { + if (percent.test(translate)) { + translate = parseFloat(translate); + const relativeProgress = mixNumber$1(sourceAxis.min, sourceAxis.max, translate / 100); + translate = relativeProgress - sourceAxis.min; + } + if (typeof translate !== "number") + return; + let originPoint = mixNumber$1(originAxis.min, originAxis.max, origin); + if (axis === originAxis) + originPoint -= translate; + axis.min = removePointDelta(axis.min, translate, scale, originPoint, boxScale); + axis.max = removePointDelta(axis.max, translate, scale, originPoint, boxScale); + } + /** + * Remove a transforms from an axis. This is essentially the steps of applyAxisTransforms in reverse + * and acts as a bridge between motion values and removeAxisDelta + */ + function removeAxisTransforms(axis, transforms, [key, scaleKey, originKey], origin, sourceAxis) { + removeAxisDelta(axis, transforms[key], transforms[scaleKey], transforms[originKey], transforms.scale, origin, sourceAxis); + } + /** + * The names of the motion values we want to apply as translation, scale and origin. + */ + const xKeys = ["x", "scaleX", "originX"]; + const yKeys = ["y", "scaleY", "originY"]; + /** + * Remove a transforms from an box. This is essentially the steps of applyAxisBox in reverse + * and acts as a bridge between motion values and removeAxisDelta + */ + function removeBoxTransforms(box, transforms, originBox, sourceBox) { + removeAxisTransforms(box.x, transforms, xKeys, originBox ? originBox.x : undefined, sourceBox ? sourceBox.x : undefined); + removeAxisTransforms(box.y, transforms, yKeys, originBox ? originBox.y : undefined, sourceBox ? sourceBox.y : undefined); + } + + function isAxisDeltaZero(delta) { + return delta.translate === 0 && delta.scale === 1; + } + function isDeltaZero(delta) { + return isAxisDeltaZero(delta.x) && isAxisDeltaZero(delta.y); + } + function axisEquals(a, b) { + return a.min === b.min && a.max === b.max; + } + function boxEquals(a, b) { + return axisEquals(a.x, b.x) && axisEquals(a.y, b.y); + } + function axisEqualsRounded(a, b) { + return (Math.round(a.min) === Math.round(b.min) && + Math.round(a.max) === Math.round(b.max)); + } + function boxEqualsRounded(a, b) { + return axisEqualsRounded(a.x, b.x) && axisEqualsRounded(a.y, b.y); + } + function aspectRatio(box) { + return calcLength(box.x) / calcLength(box.y); + } + function axisDeltaEquals(a, b) { + return (a.translate === b.translate && + a.scale === b.scale && + a.originPoint === b.originPoint); + } + + function eachAxis(callback) { + return [callback("x"), callback("y")]; + } + + function buildProjectionTransform(delta, treeScale, latestTransform) { + let transform = ""; + /** + * The translations we use to calculate are always relative to the viewport coordinate space. + * But when we apply scales, we also scale the coordinate space of an element and its children. + * For instance if we have a treeScale (the culmination of all parent scales) of 0.5 and we need + * to move an element 100 pixels, we actually need to move it 200 in within that scaled space. + */ + const xTranslate = delta.x.translate / treeScale.x; + const yTranslate = delta.y.translate / treeScale.y; + const zTranslate = latestTransform?.z || 0; + if (xTranslate || yTranslate || zTranslate) { + transform = `translate3d(${xTranslate}px, ${yTranslate}px, ${zTranslate}px) `; + } + /** + * Apply scale correction for the tree transform. + * This will apply scale to the screen-orientated axes. + */ + if (treeScale.x !== 1 || treeScale.y !== 1) { + transform += `scale(${1 / treeScale.x}, ${1 / treeScale.y}) `; + } + if (latestTransform) { + const { transformPerspective, rotate, pathRotation, rotateX, rotateY, skewX, skewY, } = latestTransform; + if (transformPerspective) + transform = `perspective(${transformPerspective}px) ${transform}`; + if (rotate) + transform += `rotate(${rotate}deg) `; + // Additive `rotate()` so user `rotate` isn't clobbered. + if (pathRotation) + transform += `rotate(${pathRotation}deg) `; + if (rotateX) + transform += `rotateX(${rotateX}deg) `; + if (rotateY) + transform += `rotateY(${rotateY}deg) `; + if (skewX) + transform += `skewX(${skewX}deg) `; + if (skewY) + transform += `skewY(${skewY}deg) `; + } + /** + * Apply scale to match the size of the element to the size we want it. + * This will apply scale to the element-orientated axes. + */ + const elementScaleX = delta.x.scale * treeScale.x; + const elementScaleY = delta.y.scale * treeScale.y; + if (elementScaleX !== 1 || elementScaleY !== 1) { + transform += `scale(${elementScaleX}, ${elementScaleY})`; + } + return transform || "none"; + } + + const numBorders = cornerRadiusProps.length; + const asNumber = (value) => typeof value === "string" ? parseFloat(value) : value; + const isPx = (value) => typeof value === "number" || px.test(value); + function mixValues(target, follow, lead, progress, shouldCrossfadeOpacity, isOnlyMember) { + if (shouldCrossfadeOpacity) { + target.opacity = mixNumber$1(0, lead.opacity ?? 1, easeCrossfadeIn(progress)); + target.opacityExit = mixNumber$1(follow.opacity ?? 1, 0, easeCrossfadeOut(progress)); + } + else if (isOnlyMember) { + target.opacity = mixNumber$1(follow.opacity ?? 1, lead.opacity ?? 1, progress); + } + /** + * Mix border radius + */ + for (let i = 0; i < numBorders; i++) { + const borderLabel = cornerRadiusProps[i]; + let followRadius = getRadius(follow, borderLabel); + let leadRadius = getRadius(lead, borderLabel); + if (followRadius === undefined && leadRadius === undefined) + continue; + followRadius || (followRadius = 0); + leadRadius || (leadRadius = 0); + const canMix = followRadius === 0 || + leadRadius === 0 || + isPx(followRadius) === isPx(leadRadius); + if (canMix) { + target[borderLabel] = Math.max(mixNumber$1(asNumber(followRadius), asNumber(leadRadius), progress), 0); + if (percent.test(leadRadius) || percent.test(followRadius)) { + target[borderLabel] += "%"; + } + } + else { + target[borderLabel] = leadRadius; + } + } + /** + * Mix rotation + */ + if (follow.rotate || lead.rotate) { + target.rotate = mixNumber$1(follow.rotate || 0, lead.rotate || 0, progress); + } + } + function getRadius(values, radiusName) { + return values[radiusName] !== undefined + ? values[radiusName] + : values.borderRadius; + } + const easeCrossfadeIn = /*@__PURE__*/ compress(0, 0.5, circOut); + const easeCrossfadeOut = /*@__PURE__*/ compress(0.5, 0.95, noop); + function compress(min, max, easing) { + return (p) => { + // Could replace ifs with clamp + if (p < min) + return 0; + if (p > max) + return 1; + return easing(progress(min, max, p)); + }; + } + + function animateSingleValue(value, keyframes, options) { + const motionValue$1 = isMotionValue(value) ? value : motionValue(value); + motionValue$1.start(animateMotionValue("", motionValue$1, keyframes, options)); + return motionValue$1.animation; + } + + function addDomEvent(target, eventName, handler, options = { passive: true }) { + target.addEventListener(eventName, handler, options); + return () => target.removeEventListener(eventName, handler, options); + } + + const compareByDepth = (a, b) => a.depth - b.depth; + + class FlatTree { + constructor() { + this.children = []; + this.isDirty = false; + } + add(child) { + addUniqueItem(this.children, child); + this.isDirty = true; + } + remove(child) { + removeItem(this.children, child); + this.isDirty = true; + } + forEach(callback) { + this.isDirty && this.children.sort(compareByDepth); + this.isDirty = false; + this.children.forEach(callback); + } + } + + /** + * Timeout defined in ms + */ + function delay(callback, timeout) { + const start = time.now(); + const checkElapsed = ({ timestamp }) => { + const elapsed = timestamp - start; + if (elapsed >= timeout) { + cancelFrame(checkElapsed); + callback(elapsed - timeout); + } + }; + frame.setup(checkElapsed, true); + return () => cancelFrame(checkElapsed); + } + function delayInSeconds(callback, timeout) { + return delay(callback, secondsToMilliseconds(timeout)); + } + + /** + * If the provided value is a MotionValue, this returns the actual value, otherwise just the value itself + */ + function resolveMotionValue(value) { + return isMotionValue(value) ? value.get() : value; + } + + class NodeStack { + constructor() { + this.members = []; + } + add(node) { + addUniqueItem(this.members, node); + for (let i = this.members.length - 1; i >= 0; i--) { + const member = this.members[i]; + if (member === node || member === this.lead || member === this.prevLead) + continue; + const inst = member.instance; + if ((!inst || inst.isConnected === false) && !member.snapshot) { + removeItem(this.members, member); + member.unmount(); + } + } + node.scheduleRender(); + } + remove(node) { + removeItem(this.members, node); + if (node === this.prevLead) + this.prevLead = undefined; + if (node === this.lead) { + const prevLead = this.members[this.members.length - 1]; + if (prevLead) + this.promote(prevLead); + } + } + relegate(node) { + for (let i = this.members.indexOf(node) - 1; i >= 0; i--) { + const member = this.members[i]; + if (member.isPresent !== false && member.instance?.isConnected !== false) { + this.promote(member); + return true; + } + } + return false; + } + promote(node, preserveFollowOpacity) { + const prevLead = this.lead; + if (node === prevLead) + return; + this.prevLead = prevLead; + this.lead = node; + node.show(); + if (prevLead) { + prevLead.updateSnapshot(); + node.scheduleRender(); + const { layoutDependency: prevDep } = prevLead.options; + const { layoutDependency: nextDep } = node.options; + if (prevDep === undefined || prevDep !== nextDep) { + node.resumeFrom = prevLead; + if (preserveFollowOpacity) + prevLead.preserveOpacity = true; + if (prevLead.snapshot) { + node.snapshot = prevLead.snapshot; + node.snapshot.latestValues = + prevLead.animationValues || prevLead.latestValues; + } + if (node.root?.isUpdating) + node.isLayoutDirty = true; + } + if (node.options.crossfade === false) + prevLead.hide(); + } + } + exitAnimationComplete() { + this.members.forEach((member) => { + member.options.onExitComplete?.(); + member.resumingFrom?.options.onExitComplete?.(); + }); + } + scheduleRender() { + this.members.forEach((member) => member.instance && member.scheduleRender(false)); + } + removeLeadSnapshot() { + if (this.lead?.snapshot) + this.lead.snapshot = undefined; + } + } + + /** + * This should only ever be modified on the client otherwise it'll + * persist through server requests. If we need instanced states we + * could lazy-init via root. + */ + const globalProjectionState = { + /** + * Global flag as to whether the tree has animated since the last time + * we resized the window + */ + hasAnimatedSinceResize: true, + /** + * We set this to true once, on the first update. Any nodes added to the tree beyond that + * update will be given a `data-projection-id` attribute. + */ + hasEverUpdated: false, + }; + + const metrics = { + nodes: 0, + calculatedTargetDeltas: 0, + calculatedProjections: 0, + }; + const transformAxes = ["", "X", "Y", "Z"]; + /** + * We use 1000 as the animation target as 0-1000 maps better to pixels than 0-1 + * which has a noticeable difference in spring animations + */ + const animationTarget = 1000; + let id$2 = 0; + function resetDistortingTransform(key, visualElement, values, sharedAnimationValues) { + const { latestValues } = visualElement; + // Record the distorting transform and then temporarily set it to 0 + if (latestValues[key]) { + values[key] = latestValues[key]; + visualElement.setStaticValue(key, 0); + if (sharedAnimationValues) { + sharedAnimationValues[key] = 0; + } + } + } + function cancelTreeOptimisedTransformAnimations(projectionNode) { + projectionNode.hasCheckedOptimisedAppear = true; + if (projectionNode.root === projectionNode) + return; + const { visualElement } = projectionNode.options; + if (!visualElement) + return; + const appearId = getOptimisedAppearId(visualElement); + if (window.MotionHasOptimisedAnimation(appearId, "transform")) { + const { layout, layoutId } = projectionNode.options; + window.MotionCancelOptimisedAnimation(appearId, "transform", frame, !(layout || layoutId)); + } + const { parent } = projectionNode; + if (parent && !parent.hasCheckedOptimisedAppear) { + cancelTreeOptimisedTransformAnimations(parent); + } + } + function createProjectionNode$1({ attachResizeListener, defaultParent, measureScroll, checkIsScrollRoot, resetTransform, }) { + return class ProjectionNode { + constructor(latestValues = {}, parent = defaultParent?.()) { + /** + * A unique ID generated for every projection node. + */ + this.id = id$2++; + /** + * An id that represents a unique session instigated by startUpdate. + */ + this.animationId = 0; + this.animationCommitId = 0; + /** + * A Set containing all this component's children. This is used to iterate + * through the children. + * + * TODO: This could be faster to iterate as a flat array stored on the root node. + */ + this.children = new Set(); + /** + * Options for the node. We use this to configure what kind of layout animations + * we should perform (if any). + */ + this.options = {}; + /** + * We use this to detect when its safe to shut down part of a projection tree. + * We have to keep projecting children for scale correction and relative projection + * until all their parents stop performing layout animations. + */ + this.isTreeAnimating = false; + this.isAnimationBlocked = false; + /** + * Flag to true if we think this layout has been changed. We can't always know this, + * currently we set it to true every time a component renders, or if it has a layoutDependency + * if that has changed between renders. Additionally, components can be grouped by LayoutGroup + * and if one node is dirtied, they all are. + */ + this.isLayoutDirty = false; + /** + * Flag to true if we think the projection calculations for this node needs + * recalculating as a result of an updated transform or layout animation. + */ + this.isProjectionDirty = false; + /** + * Flag to true if the layout *or* transform has changed. This then gets propagated + * throughout the projection tree, forcing any element below to recalculate on the next frame. + */ + this.isSharedProjectionDirty = false; + /** + * Flag transform dirty. This gets propagated throughout the whole tree but is only + * respected by shared nodes. + */ + this.isTransformDirty = false; + /** + * Block layout updates for instant layout transitions throughout the tree. + */ + this.updateManuallyBlocked = false; + this.updateBlockedByResize = false; + /** + * Set to true between the start of the first `willUpdate` call and the end of the `didUpdate` + * call. + */ + this.isUpdating = false; + /** + * If this is an SVG element we currently disable projection transforms + */ + this.isSVG = false; + /** + * Flag to true (during promotion) if a node doing an instant layout transition needs to reset + * its projection styles. + */ + this.needsReset = false; + /** + * Flags whether this node should have its transform reset prior to measuring. + */ + this.shouldResetTransform = false; + /** + * Store whether this node has been checked for optimised appear animations. As + * effects fire bottom-up, and we want to look up the tree for appear animations, + * this makes sure we only check each path once, stopping at nodes that + * have already been checked. + */ + this.hasCheckedOptimisedAppear = false; + /** + * An object representing the calculated contextual/accumulated/tree scale. + * This will be used to scale calculcated projection transforms, as these are + * calculated in screen-space but need to be scaled for elements to layoutly + * make it to their calculated destinations. + * + * TODO: Lazy-init + */ + this.treeScale = { x: 1, y: 1 }; + /** + * + */ + this.eventHandlers = new Map(); + this.hasTreeAnimated = false; + this.layoutVersion = 0; + // Note: Currently only running on root node + this.updateScheduled = false; + this.scheduleUpdate = () => this.update(); + this.projectionUpdateScheduled = false; + this.checkUpdateFailed = () => { + if (this.isUpdating) { + this.isUpdating = false; + this.clearAllSnapshots(); + } + }; + /** + * This is a multi-step process as shared nodes might be of different depths. Nodes + * are sorted by depth order, so we need to resolve the entire tree before moving to + * the next step. + */ + this.updateProjection = () => { + this.projectionUpdateScheduled = false; + /** + * Reset debug counts. Manually resetting rather than creating a new + * object each frame. + */ + if (statsBuffer.value) { + metrics.nodes = + metrics.calculatedTargetDeltas = + metrics.calculatedProjections = + 0; + } + this.nodes.forEach(propagateDirtyNodes); + this.nodes.forEach(resolveTargetDelta); + this.nodes.forEach(calcProjection); + this.nodes.forEach(cleanDirtyNodes); + if (statsBuffer.addProjectionMetrics) { + statsBuffer.addProjectionMetrics(metrics); + } + }; + /** + * Frame calculations + */ + this.resolvedRelativeTargetAt = 0.0; + this.linkedParentVersion = 0; + this.hasProjected = false; + this.isVisible = true; + this.animationProgress = 0; + /** + * Shared layout + */ + // TODO Only running on root node + this.sharedNodes = new Map(); + this.latestValues = latestValues; + this.root = parent ? parent.root || parent : this; + this.path = parent ? [...parent.path, parent] : []; + this.parent = parent; + this.depth = parent ? parent.depth + 1 : 0; + for (let i = 0; i < this.path.length; i++) { + this.path[i].shouldResetTransform = true; + } + if (this.root === this) + this.nodes = new FlatTree(); + } + addEventListener(name, handler) { + if (!this.eventHandlers.has(name)) { + this.eventHandlers.set(name, new SubscriptionManager()); + } + return this.eventHandlers.get(name).add(handler); + } + notifyListeners(name, ...args) { + const subscriptionManager = this.eventHandlers.get(name); + subscriptionManager && subscriptionManager.notify(...args); + } + hasListeners(name) { + return this.eventHandlers.has(name); + } + /** + * Lifecycles + */ + mount(instance) { + if (this.instance) + return; + this.isSVG = isSVGElement(instance) && !isSVGSVGElement(instance); + this.instance = instance; + const { layoutId, layout, visualElement } = this.options; + if (visualElement && !visualElement.current) { + visualElement.mount(instance); + } + this.root.nodes.add(this); + this.parent && this.parent.children.add(this); + if (this.root.hasTreeAnimated && (layout || layoutId)) { + this.isLayoutDirty = true; + } + if (attachResizeListener) { + let cancelDelay; + let innerWidth = 0; + const resizeUnblockUpdate = () => (this.root.updateBlockedByResize = false); + // Set initial innerWidth in a frame.read callback to batch the read + frame.read(() => { + innerWidth = window.innerWidth; + }); + attachResizeListener(instance, () => { + const newInnerWidth = window.innerWidth; + if (newInnerWidth === innerWidth) + return; + innerWidth = newInnerWidth; + this.root.updateBlockedByResize = true; + cancelDelay && cancelDelay(); + cancelDelay = delay(resizeUnblockUpdate, 250); + if (globalProjectionState.hasAnimatedSinceResize) { + globalProjectionState.hasAnimatedSinceResize = false; + this.nodes.forEach(finishAnimation); + } + }); + } + if (layoutId) { + this.root.registerSharedNode(layoutId, this); + } + // Only register the handler if it requires layout animation + if (this.options.animate !== false && + visualElement && + (layoutId || layout)) { + this.addEventListener("didUpdate", ({ delta, hasLayoutChanged, hasRelativeLayoutChanged, layout: newLayout, }) => { + if (this.isTreeAnimationBlocked()) { + this.target = undefined; + this.relativeTarget = undefined; + return; + } + // TODO: Check here if an animation exists + const layoutTransition = this.options.transition || + visualElement.getDefaultTransition() || + defaultLayoutTransition; + const { onLayoutAnimationStart, onLayoutAnimationComplete, } = visualElement.getProps(); + /** + * The target layout of the element might stay the same, + * but its position relative to its parent has changed. + */ + const hasTargetChanged = !this.targetLayout || + !boxEqualsRounded(this.targetLayout, newLayout); + /* + * Note: Disabled to fix relative animations always triggering new + * layout animations. If this causes further issues, we can try + * a different approach to detecting relative target changes. + */ + // || hasRelativeLayoutChanged + /** + * If the layout hasn't seemed to have changed, it might be that the + * element is visually in the same place in the document but its position + * relative to its parent has indeed changed. So here we check for that. + */ + const hasOnlyRelativeTargetChanged = !hasLayoutChanged && hasRelativeLayoutChanged; + if (this.options.layoutRoot || + this.resumeFrom || + hasOnlyRelativeTargetChanged || + (hasLayoutChanged && + (hasTargetChanged || !this.currentAnimation))) { + if (this.resumeFrom) { + this.resumingFrom = this.resumeFrom; + this.resumingFrom.resumingFrom = undefined; + } + const animationOptions = { + ...getValueTransition$1(layoutTransition, "layout"), + onPlay: onLayoutAnimationStart, + onComplete: onLayoutAnimationComplete, + }; + if (visualElement.shouldReduceMotion || + this.options.layoutRoot) { + animationOptions.delay = 0; + animationOptions.type = false; + } + this.startAnimation(animationOptions); + /** + * Set animation origin after starting animation to avoid layout jump + * caused by stopping previous layout animation + */ + this.setAnimationOrigin(delta, hasOnlyRelativeTargetChanged, animationOptions + .path); + } + else { + /** + * If the layout hasn't changed and we have an animation that hasn't started yet, + * finish it immediately. Otherwise it will be animating from a location + * that was probably never committed to screen and look like a jumpy box. + */ + if (!hasLayoutChanged) { + finishAnimation(this); + } + if (this.isLead() && this.options.onExitComplete) { + this.options.onExitComplete(); + } + } + this.targetLayout = newLayout; + }); + } + } + unmount() { + this.options.layoutId && this.willUpdate(); + this.root.nodes.remove(this); + const stack = this.getStack(); + stack && stack.remove(this); + this.parent && this.parent.children.delete(this); + this.instance = undefined; + this.eventHandlers.clear(); + cancelFrame(this.updateProjection); + } + // only on the root + blockUpdate() { + this.updateManuallyBlocked = true; + } + unblockUpdate() { + this.updateManuallyBlocked = false; + } + isUpdateBlocked() { + return this.updateManuallyBlocked || this.updateBlockedByResize; + } + isTreeAnimationBlocked() { + return (this.isAnimationBlocked || + (this.parent && this.parent.isTreeAnimationBlocked()) || + false); + } + // Note: currently only running on root node + startUpdate() { + if (this.isUpdateBlocked()) + return; + this.isUpdating = true; + this.nodes && this.nodes.forEach(resetSkewAndRotation); + this.animationId++; + } + getTransformTemplate() { + const { visualElement } = this.options; + return visualElement && visualElement.getProps().transformTemplate; + } + willUpdate(shouldNotifyListeners = true) { + this.root.hasTreeAnimated = true; + if (this.root.isUpdateBlocked()) { + this.options.onExitComplete && this.options.onExitComplete(); + return; + } + /** + * If we're running optimised appear animations then these must be + * cancelled before measuring the DOM. This is so we can measure + * the true layout of the element rather than the WAAPI animation + * which will be unaffected by the resetSkewAndRotate step. + * + * Note: This is a DOM write. Worst case scenario is this is sandwiched + * between other snapshot reads which will cause unnecessary style recalculations. + * This has to happen here though, as we don't yet know which nodes will need + * snapshots in startUpdate(), but we only want to cancel optimised animations + * if a layout animation measurement is actually going to be affected by them. + */ + if (window.MotionCancelOptimisedAnimation && + !this.hasCheckedOptimisedAppear) { + cancelTreeOptimisedTransformAnimations(this); + } + !this.root.isUpdating && this.root.startUpdate(); + if (this.isLayoutDirty) + return; + this.isLayoutDirty = true; + for (let i = 0; i < this.path.length; i++) { + const node = this.path[i]; + node.shouldResetTransform = true; + /** + * Percentage translates resolve against layoutBox dimensions, + * so ancestors with them must be re-measured after transform reset. + */ + if (typeof node.latestValues.x === "string" || + typeof node.latestValues.y === "string") { + node.isLayoutDirty = true; + } + node.updateScroll("snapshot"); + if (node.options.layoutRoot) { + node.willUpdate(false); + } + } + const { layoutId, layout } = this.options; + if (layoutId === undefined && !layout) + return; + const transformTemplate = this.getTransformTemplate(); + this.prevTransformTemplateValue = transformTemplate + ? transformTemplate(this.latestValues, "") + : undefined; + this.updateSnapshot(); + shouldNotifyListeners && this.notifyListeners("willUpdate"); + } + update() { + this.updateScheduled = false; + const updateWasBlocked = this.isUpdateBlocked(); + // When doing an instant transition, we skip the layout update, + // but should still clean up the measurements so that the next + // snapshot could be taken correctly. + if (updateWasBlocked) { + const wasBlockedByResize = this.updateBlockedByResize; + this.unblockUpdate(); + this.updateBlockedByResize = false; + this.clearAllSnapshots(); + /** + * When blocked by resize, still measure layouts so + * callbacks like onLayoutMeasure fire (e.g. Reorder). + * Skip notifyLayoutUpdate to prevent animations. + */ + if (wasBlockedByResize) { + this.nodes.forEach(forceLayoutMeasure); + } + this.nodes.forEach(clearMeasurements); + return; + } + /** + * If this is a repeat of didUpdate then ignore the animation. + */ + if (this.animationId <= this.animationCommitId) { + this.nodes.forEach(clearIsLayoutDirty); + return; + } + this.animationCommitId = this.animationId; + if (!this.isUpdating) { + this.nodes.forEach(clearIsLayoutDirty); + } + else { + this.isUpdating = false; + /** + * Ensure animation-blocked nodes (e.g. during drag) + * get measured even when memoized (willUpdate skipped). + */ + this.nodes.forEach(ensureDraggedNodesSnapshotted); + /** + * Write + */ + this.nodes.forEach(resetTransformStyle); + /** + * Read ================== + */ + // Update layout measurements of updated children + this.nodes.forEach(updateLayout); + /** + * Write + */ + // Notify listeners that the layout is updated + this.nodes.forEach(notifyLayoutUpdate); + } + this.clearAllSnapshots(); + /** + * Manually flush any pending updates. Ideally + * we could leave this to the following requestAnimationFrame but this seems + * to leave a flash of incorrectly styled content. + */ + const now = time.now(); + frameData.delta = clamp(0, 1000 / 60, now - frameData.timestamp); + frameData.timestamp = now; + frameData.isProcessing = true; + frameSteps.update.process(frameData); + frameSteps.preRender.process(frameData); + frameSteps.render.process(frameData); + frameData.isProcessing = false; + } + didUpdate() { + if (!this.updateScheduled) { + this.updateScheduled = true; + microtask.read(this.scheduleUpdate); + } + } + clearAllSnapshots() { + this.nodes.forEach(clearSnapshot); + this.sharedNodes.forEach(removeLeadSnapshots); + } + scheduleUpdateProjection() { + if (!this.projectionUpdateScheduled) { + this.projectionUpdateScheduled = true; + frame.preRender(this.updateProjection, false, true); + } + } + scheduleCheckAfterUnmount() { + /** + * If the unmounting node is in a layoutGroup and did trigger a willUpdate, + * we manually call didUpdate to give a chance to the siblings to animate. + * Otherwise, cleanup all snapshots to prevents future nodes from reusing them. + */ + frame.postRender(() => { + if (this.isLayoutDirty) { + this.root.didUpdate(); + } + else { + this.root.checkUpdateFailed(); + } + }); + } + /** + * Update measurements + */ + updateSnapshot() { + if (this.snapshot || !this.instance) + return; + this.snapshot = this.measure(); + if (this.snapshot && + !calcLength(this.snapshot.measuredBox.x) && + !calcLength(this.snapshot.measuredBox.y)) { + this.snapshot = undefined; + } + } + updateLayout() { + if (!this.instance) + return; + this.updateScroll(); + if (!(this.options.alwaysMeasureLayout && this.isLead()) && + !this.isLayoutDirty) { + return; + } + /** + * When a node is mounted, it simply resumes from the prevLead's + * snapshot instead of taking a new one, but the ancestors scroll + * might have updated while the prevLead is unmounted. We need to + * update the scroll again to make sure the layout we measure is + * up to date. + */ + if (this.resumeFrom && !this.resumeFrom.instance) { + for (let i = 0; i < this.path.length; i++) { + const node = this.path[i]; + node.updateScroll(); + } + } + const prevLayout = this.layout; + this.layout = this.measure(false); + this.layoutVersion++; + if (!this.layoutCorrected) + this.layoutCorrected = createBox(); + this.isLayoutDirty = false; + this.projectionDelta = undefined; + this.notifyListeners("measure", this.layout.layoutBox); + const { visualElement } = this.options; + visualElement && + visualElement.notify("LayoutMeasure", this.layout.layoutBox, prevLayout ? prevLayout.layoutBox : undefined); + } + updateScroll(phase = "measure") { + let needsMeasurement = Boolean(this.options.layoutScroll && this.instance); + if (this.scroll && + this.scroll.animationId === this.root.animationId && + this.scroll.phase === phase) { + needsMeasurement = false; + } + if (needsMeasurement && this.instance) { + const isRoot = checkIsScrollRoot(this.instance); + this.scroll = { + animationId: this.root.animationId, + phase, + isRoot, + offset: measureScroll(this.instance), + wasRoot: this.scroll ? this.scroll.isRoot : isRoot, + }; + } + } + resetTransform() { + if (!resetTransform) + return; + const isResetRequested = this.isLayoutDirty || + this.shouldResetTransform || + this.options.alwaysMeasureLayout; + const hasProjection = this.projectionDelta && !isDeltaZero(this.projectionDelta); + const transformTemplate = this.getTransformTemplate(); + const transformTemplateValue = transformTemplate + ? transformTemplate(this.latestValues, "") + : undefined; + const transformTemplateHasChanged = transformTemplateValue !== this.prevTransformTemplateValue; + if (isResetRequested && + this.instance && + (hasProjection || + hasTransform(this.latestValues) || + transformTemplateHasChanged)) { + resetTransform(this.instance, transformTemplateValue); + this.shouldResetTransform = false; + this.scheduleRender(); + } + } + measure(removeTransform = true) { + const pageBox = this.measurePageBox(); + let layoutBox = this.removeElementScroll(pageBox); + /** + * Measurements taken during the pre-render stage + * still have transforms applied so we remove them + * via calculation. + */ + if (removeTransform) { + layoutBox = this.removeTransform(layoutBox); + } + roundBox(layoutBox); + return { + animationId: this.root.animationId, + measuredBox: pageBox, + layoutBox, + latestValues: {}, + source: this.id, + }; + } + measurePageBox() { + const { visualElement } = this.options; + if (!visualElement) + return createBox(); + const box = visualElement.measureViewportBox(); + const wasInScrollRoot = this.scroll?.wasRoot || this.path.some(checkNodeWasScrollRoot); + if (!wasInScrollRoot) { + // Remove viewport scroll to give page-relative coordinates + const { scroll } = this.root; + if (scroll) { + translateAxis(box.x, scroll.offset.x); + translateAxis(box.y, scroll.offset.y); + } + } + return box; + } + removeElementScroll(box) { + const boxWithoutScroll = createBox(); + copyBoxInto(boxWithoutScroll, box); + if (this.scroll?.wasRoot) { + return boxWithoutScroll; + } + /** + * Performance TODO: Keep a cumulative scroll offset down the tree + * rather than loop back up the path. + */ + for (let i = 0; i < this.path.length; i++) { + const node = this.path[i]; + const { scroll, options } = node; + if (node !== this.root && scroll && options.layoutScroll) { + /** + * If this is a new scroll root, we want to remove all previous scrolls + * from the viewport box. + */ + if (scroll.wasRoot) { + copyBoxInto(boxWithoutScroll, box); + } + translateAxis(boxWithoutScroll.x, scroll.offset.x); + translateAxis(boxWithoutScroll.y, scroll.offset.y); + } + } + return boxWithoutScroll; + } + applyTransform(box, transformOnly = false, output) { + const withTransforms = output || createBox(); + copyBoxInto(withTransforms, box); + for (let i = 0; i < this.path.length; i++) { + const node = this.path[i]; + if (!transformOnly && + node.options.layoutScroll && + node.scroll && + node !== node.root) { + translateAxis(withTransforms.x, -node.scroll.offset.x); + translateAxis(withTransforms.y, -node.scroll.offset.y); + } + if (!hasTransform(node.latestValues)) + continue; + transformBox(withTransforms, node.latestValues, node.layout?.layoutBox); + } + if (hasTransform(this.latestValues)) { + transformBox(withTransforms, this.latestValues, this.layout?.layoutBox); + } + return withTransforms; + } + removeTransform(box) { + const boxWithoutTransform = createBox(); + copyBoxInto(boxWithoutTransform, box); + for (let i = 0; i < this.path.length; i++) { + const node = this.path[i]; + if (!hasTransform(node.latestValues)) + continue; + let sourceBox; + if (node.instance) { + hasScale(node.latestValues) && node.updateSnapshot(); + sourceBox = createBox(); + copyBoxInto(sourceBox, node.measurePageBox()); + } + removeBoxTransforms(boxWithoutTransform, node.latestValues, node.snapshot?.layoutBox, sourceBox); + } + if (hasTransform(this.latestValues)) { + removeBoxTransforms(boxWithoutTransform, this.latestValues); + } + return boxWithoutTransform; + } + setTargetDelta(delta) { + this.targetDelta = delta; + this.root.scheduleUpdateProjection(); + this.isProjectionDirty = true; + } + setOptions(options) { + this.options = { + ...this.options, + ...options, + crossfade: options.crossfade !== undefined ? options.crossfade : true, + }; + } + clearMeasurements() { + this.scroll = undefined; + this.layout = undefined; + this.snapshot = undefined; + this.prevTransformTemplateValue = undefined; + this.targetDelta = undefined; + this.target = undefined; + this.isLayoutDirty = false; + } + forceRelativeParentToResolveTarget() { + if (!this.relativeParent) + return; + /** + * If the parent target isn't up-to-date, force it to update. + * This is an unfortunate de-optimisation as it means any updating relative + * projection will cause all the relative parents to recalculate back + * up the tree. + */ + if (this.relativeParent.resolvedRelativeTargetAt !== + frameData.timestamp) { + this.relativeParent.resolveTargetDelta(true); + } + } + resolveTargetDelta(forceRecalculation = false) { + /** + * Once the dirty status of nodes has been spread through the tree, we also + * need to check if we have a shared node of a different depth that has itself + * been dirtied. + */ + const lead = this.getLead(); + this.isProjectionDirty || (this.isProjectionDirty = lead.isProjectionDirty); + this.isTransformDirty || (this.isTransformDirty = lead.isTransformDirty); + this.isSharedProjectionDirty || (this.isSharedProjectionDirty = lead.isSharedProjectionDirty); + const isShared = Boolean(this.resumingFrom) || this !== lead; + /** + * We don't use transform for this step of processing so we don't + * need to check whether any nodes have changed transform. + */ + const canSkip = !(forceRecalculation || + (isShared && this.isSharedProjectionDirty) || + this.isProjectionDirty || + this.parent?.isProjectionDirty || + this.attemptToResolveRelativeTarget || + this.root.updateBlockedByResize); + if (canSkip) + return; + const { layout, layoutId } = this.options; + /** + * If we have no layout, we can't perform projection, so early return + */ + if (!this.layout || !(layout || layoutId)) + return; + this.resolvedRelativeTargetAt = frameData.timestamp; + const relativeParent = this.getClosestProjectingParent(); + if (relativeParent && + this.linkedParentVersion !== relativeParent.layoutVersion && + !relativeParent.options.layoutRoot) { + this.removeRelativeTarget(); + } + /** + * If we don't have a targetDelta but do have a layout, we can attempt to resolve + * a relativeParent. This will allow a component to perform scale correction + * even if no animation has started. + */ + if (!this.targetDelta && !this.relativeTarget) { + if (this.options.layoutAnchor !== false && + relativeParent && + relativeParent.layout) { + this.createRelativeTarget(relativeParent, this.layout.layoutBox, relativeParent.layout.layoutBox); + } + else { + this.removeRelativeTarget(); + } + } + /** + * If we have no relative target or no target delta our target isn't valid + * for this frame. + */ + if (!this.relativeTarget && !this.targetDelta) + return; + /** + * Lazy-init target data structure + */ + if (!this.target) { + this.target = createBox(); + this.targetWithTransforms = createBox(); + } + /** + * If we've got a relative box for this component, resolve it into a target relative to the parent. + */ + if (this.relativeTarget && + this.relativeTargetOrigin && + this.relativeParent && + this.relativeParent.target) { + this.forceRelativeParentToResolveTarget(); + calcRelativeBox(this.target, this.relativeTarget, this.relativeParent.target, this.options.layoutAnchor || undefined); + /** + * If we've only got a targetDelta, resolve it into a target + */ + } + else if (this.targetDelta) { + if (Boolean(this.resumingFrom)) { + this.applyTransform(this.layout.layoutBox, false, this.target); + } + else { + copyBoxInto(this.target, this.layout.layoutBox); + } + applyBoxDelta(this.target, this.targetDelta); + } + else { + /** + * If no target, use own layout as target + */ + copyBoxInto(this.target, this.layout.layoutBox); + } + /** + * If we've been told to attempt to resolve a relative target, do so. + */ + if (this.attemptToResolveRelativeTarget) { + this.attemptToResolveRelativeTarget = false; + if (this.options.layoutAnchor !== false && + relativeParent && + Boolean(relativeParent.resumingFrom) === + Boolean(this.resumingFrom) && + !relativeParent.options.layoutScroll && + relativeParent.target && + this.animationProgress !== 1) { + this.createRelativeTarget(relativeParent, this.target, relativeParent.target); + } + else { + this.relativeParent = this.relativeTarget = undefined; + } + } + /** + * Increase debug counter for resolved target deltas + */ + if (statsBuffer.value) { + metrics.calculatedTargetDeltas++; + } + } + getClosestProjectingParent() { + if (!this.parent || + hasScale(this.parent.latestValues) || + has2DTranslate(this.parent.latestValues)) { + return undefined; + } + if (this.parent.isProjecting()) { + return this.parent; + } + else { + return this.parent.getClosestProjectingParent(); + } + } + isProjecting() { + return Boolean((this.relativeTarget || + this.targetDelta || + this.options.layoutRoot) && + this.layout); + } + createRelativeTarget(relativeParent, layout, parentLayout) { + this.relativeParent = relativeParent; + this.linkedParentVersion = relativeParent.layoutVersion; + this.forceRelativeParentToResolveTarget(); + this.relativeTarget = createBox(); + this.relativeTargetOrigin = createBox(); + calcRelativePosition(this.relativeTargetOrigin, layout, parentLayout, this.options.layoutAnchor || undefined); + copyBoxInto(this.relativeTarget, this.relativeTargetOrigin); + } + removeRelativeTarget() { + this.relativeParent = this.relativeTarget = undefined; + } + calcProjection() { + const lead = this.getLead(); + const isShared = Boolean(this.resumingFrom) || this !== lead; + let canSkip = true; + /** + * If this is a normal layout animation and neither this node nor its nearest projecting + * is dirty then we can't skip. + */ + if (this.isProjectionDirty || this.parent?.isProjectionDirty) { + canSkip = false; + } + /** + * If this is a shared layout animation and this node's shared projection is dirty then + * we can't skip. + */ + if (isShared && + (this.isSharedProjectionDirty || this.isTransformDirty)) { + canSkip = false; + } + /** + * If we have resolved the target this frame we must recalculate the + * projection to ensure it visually represents the internal calculations. + */ + if (this.resolvedRelativeTargetAt === frameData.timestamp) { + canSkip = false; + } + if (canSkip) + return; + const { layout, layoutId } = this.options; + /** + * If this section of the tree isn't animating we can + * delete our target sources for the following frame. + */ + this.isTreeAnimating = Boolean((this.parent && this.parent.isTreeAnimating) || + this.currentAnimation || + this.pendingAnimation); + if (!this.isTreeAnimating) { + this.targetDelta = this.relativeTarget = undefined; + } + if (!this.layout || !(layout || layoutId)) + return; + /** + * Reset the corrected box with the latest values from box, as we're then going + * to perform mutative operations on it. + */ + copyBoxInto(this.layoutCorrected, this.layout.layoutBox); + /** + * Record previous tree scales before updating. + */ + const prevTreeScaleX = this.treeScale.x; + const prevTreeScaleY = this.treeScale.y; + /** + * Apply all the parent deltas to this box to produce the corrected box. This + * is the layout box, as it will appear on screen as a result of the transforms of its parents. + */ + applyTreeDeltas(this.layoutCorrected, this.treeScale, this.path, isShared); + /** + * If this layer needs to perform scale correction but doesn't have a target, + * use the layout as the target. + */ + if (lead.layout && + !lead.target && + (this.treeScale.x !== 1 || this.treeScale.y !== 1)) { + lead.target = lead.layout.layoutBox; + lead.targetWithTransforms = createBox(); + } + const { target } = lead; + if (!target) { + /** + * If we don't have a target to project into, but we were previously + * projecting, we want to remove the stored transform and schedule + * a render to ensure the elements reflect the removed transform. + */ + if (this.prevProjectionDelta) { + this.createProjectionDeltas(); + this.scheduleRender(); + } + return; + } + if (!this.projectionDelta || !this.prevProjectionDelta) { + this.createProjectionDeltas(); + } + else { + copyAxisDeltaInto(this.prevProjectionDelta.x, this.projectionDelta.x); + copyAxisDeltaInto(this.prevProjectionDelta.y, this.projectionDelta.y); + } + /** + * Update the delta between the corrected box and the target box before user-set transforms were applied. + * This will allow us to calculate the corrected borderRadius and boxShadow to compensate + * for our layout reprojection, but still allow them to be scaled correctly by the user. + * It might be that to simplify this we may want to accept that user-set scale is also corrected + * and we wouldn't have to keep and calc both deltas, OR we could support a user setting + * to allow people to choose whether these styles are corrected based on just the + * layout reprojection or the final bounding box. + */ + calcBoxDelta(this.projectionDelta, this.layoutCorrected, target, this.latestValues); + if (this.treeScale.x !== prevTreeScaleX || + this.treeScale.y !== prevTreeScaleY || + !axisDeltaEquals(this.projectionDelta.x, this.prevProjectionDelta.x) || + !axisDeltaEquals(this.projectionDelta.y, this.prevProjectionDelta.y)) { + this.hasProjected = true; + this.scheduleRender(); + this.notifyListeners("projectionUpdate", target); + } + /** + * Increase debug counter for recalculated projections + */ + if (statsBuffer.value) { + metrics.calculatedProjections++; + } + } + hide() { + this.isVisible = false; + // TODO: Schedule render + } + show() { + this.isVisible = true; + // TODO: Schedule render + } + scheduleRender(notifyAll = true) { + this.options.visualElement?.scheduleRender(); + if (notifyAll) { + const stack = this.getStack(); + stack && stack.scheduleRender(); + } + if (this.resumingFrom && !this.resumingFrom.instance) { + this.resumingFrom = undefined; + } + } + createProjectionDeltas() { + this.prevProjectionDelta = createDelta(); + this.projectionDelta = createDelta(); + this.projectionDeltaWithTransform = createDelta(); + } + setAnimationOrigin(delta, hasOnlyRelativeTargetChanged = false, pathFn) { + const snapshot = this.snapshot; + const snapshotLatestValues = snapshot ? snapshot.latestValues : {}; + const mixedValues = { ...this.latestValues }; + const targetDelta = createDelta(); + if (!this.relativeParent || + !this.relativeParent.options.layoutRoot) { + this.relativeTarget = this.relativeTargetOrigin = undefined; + } + this.attemptToResolveRelativeTarget = !hasOnlyRelativeTargetChanged; + const relativeLayout = createBox(); + const snapshotSource = snapshot ? snapshot.source : undefined; + const layoutSource = this.layout ? this.layout.source : undefined; + const isSharedLayoutAnimation = snapshotSource !== layoutSource; + const stack = this.getStack(); + const isOnlyMember = !stack || stack.members.length <= 1; + const shouldCrossfadeOpacity = Boolean(isSharedLayoutAnimation && + !isOnlyMember && + this.options.crossfade === true && + !this.path.some(hasOpacityCrossfade)); + this.animationProgress = 0; + let prevRelativeTarget; + // The path decides whether the layout shift is worth curving + // (distance floor) and resolves the interpolator from the delta. + const interpolate = pathFn?.interpolateProjection(delta); + this.mixTargetDelta = (latest) => { + const progress = latest / 1000; + const point = interpolate?.(progress); + if (point) { + targetDelta.x.translate = point.x; + targetDelta.x.scale = mixNumber$1(delta.x.scale, 1, progress); + targetDelta.x.origin = delta.x.origin; + targetDelta.x.originPoint = delta.x.originPoint; + targetDelta.y.translate = point.y; + targetDelta.y.scale = mixNumber$1(delta.y.scale, 1, progress); + targetDelta.y.origin = delta.y.origin; + targetDelta.y.originPoint = delta.y.originPoint; + } + else { + mixAxisDeltaLinear(targetDelta.x, delta.x, progress); + mixAxisDeltaLinear(targetDelta.y, delta.y, progress); + } + this.setTargetDelta(targetDelta); + if (this.relativeTarget && + this.relativeTargetOrigin && + this.layout && + this.relativeParent && + this.relativeParent.layout) { + calcRelativePosition(relativeLayout, this.layout.layoutBox, this.relativeParent.layout.layoutBox, this.options.layoutAnchor || undefined); + mixBox(this.relativeTarget, this.relativeTargetOrigin, relativeLayout, progress); + /** + * If this is an unchanged relative target we can consider the + * projection not dirty. + */ + if (prevRelativeTarget && + boxEquals(this.relativeTarget, prevRelativeTarget)) { + this.isProjectionDirty = false; + } + if (!prevRelativeTarget) + prevRelativeTarget = createBox(); + copyBoxInto(prevRelativeTarget, this.relativeTarget); + } + if (isSharedLayoutAnimation) { + this.animationValues = mixedValues; + mixValues(mixedValues, snapshotLatestValues, this.latestValues, progress, shouldCrossfadeOpacity, isOnlyMember); + } + if (point && point.rotate !== undefined) { + // Dedicated `pathRotation` channel, not `rotate`, so an + // animating `rotate` is composed with, never clobbered. + if (!this.animationValues) + this.animationValues = mixedValues; + this.animationValues.pathRotation = point.rotate; + } + this.root.scheduleUpdateProjection(); + this.scheduleRender(); + this.animationProgress = progress; + }; + this.mixTargetDelta(this.options.layoutRoot ? 1000 : 0); + } + startAnimation(options) { + this.notifyListeners("animationStart"); + this.currentAnimation?.stop(); + this.resumingFrom?.currentAnimation?.stop(); + if (this.pendingAnimation) { + cancelFrame(this.pendingAnimation); + this.pendingAnimation = undefined; + } + /** + * Start the animation in the next frame to have a frame with progress 0, + * where the target is the same as when the animation started, so we can + * calculate the relative positions correctly for instant transitions. + */ + this.pendingAnimation = frame.update(() => { + globalProjectionState.hasAnimatedSinceResize = true; + this.motionValue || (this.motionValue = motionValue(0)); + this.motionValue.jump(0, false); + this.currentAnimation = animateSingleValue(this.motionValue, [0, 1000], { + ...options, + velocity: 0, + isSync: true, + onUpdate: (latest) => { + this.mixTargetDelta(latest); + options.onUpdate && options.onUpdate(latest); + }, + onComplete: () => { + options.onComplete && options.onComplete(); + this.completeAnimation(); + }, + }); + if (this.resumingFrom) { + this.resumingFrom.currentAnimation = this.currentAnimation; + } + this.pendingAnimation = undefined; + }); + } + completeAnimation() { + if (this.resumingFrom) { + this.resumingFrom.currentAnimation = undefined; + this.resumingFrom.preserveOpacity = undefined; + } + const stack = this.getStack(); + stack && stack.exitAnimationComplete(); + this.resumingFrom = + this.currentAnimation = + this.animationValues = + undefined; + this.notifyListeners("animationComplete"); + } + finishAnimation() { + if (this.currentAnimation) { + this.mixTargetDelta && this.mixTargetDelta(animationTarget); + this.currentAnimation.stop(); + } + this.completeAnimation(); + } + applyTransformsToTarget() { + const lead = this.getLead(); + let { targetWithTransforms, target, layout, latestValues } = lead; + if (!targetWithTransforms || !target || !layout) + return; + /** + * If we're only animating position, and this element isn't the lead element, + * then instead of projecting into the lead box we instead want to calculate + * a new target that aligns the two boxes but maintains the layout shape. + */ + if (this !== lead && + this.layout && + layout && + shouldAnimatePositionOnly(this.options.animationType, this.layout.layoutBox, layout.layoutBox)) { + target = this.target || createBox(); + const xLength = calcLength(this.layout.layoutBox.x); + target.x.min = lead.target.x.min; + target.x.max = target.x.min + xLength; + const yLength = calcLength(this.layout.layoutBox.y); + target.y.min = lead.target.y.min; + target.y.max = target.y.min + yLength; + } + copyBoxInto(targetWithTransforms, target); + /** + * Apply the latest user-set transforms to the targetBox to produce the targetBoxFinal. + * This is the final box that we will then project into by calculating a transform delta and + * applying it to the corrected box. + */ + transformBox(targetWithTransforms, latestValues); + /** + * Update the delta between the corrected box and the final target box, after + * user-set transforms are applied to it. This will be used by the renderer to + * create a transform style that will reproject the element from its layout layout + * into the desired bounding box. + */ + calcBoxDelta(this.projectionDeltaWithTransform, this.layoutCorrected, targetWithTransforms, latestValues); + } + registerSharedNode(layoutId, node) { + if (!this.sharedNodes.has(layoutId)) { + this.sharedNodes.set(layoutId, new NodeStack()); + } + const stack = this.sharedNodes.get(layoutId); + stack.add(node); + const config = node.options.initialPromotionConfig; + node.promote({ + transition: config ? config.transition : undefined, + preserveFollowOpacity: config && config.shouldPreserveFollowOpacity + ? config.shouldPreserveFollowOpacity(node) + : undefined, + }); + } + isLead() { + const stack = this.getStack(); + return stack ? stack.lead === this : true; + } + getLead() { + const { layoutId } = this.options; + return layoutId ? this.getStack()?.lead || this : this; + } + getPrevLead() { + const { layoutId } = this.options; + return layoutId ? this.getStack()?.prevLead : undefined; + } + getStack() { + const { layoutId } = this.options; + if (layoutId) + return this.root.sharedNodes.get(layoutId); + } + promote({ needsReset, transition, preserveFollowOpacity, } = {}) { + const stack = this.getStack(); + if (stack) + stack.promote(this, preserveFollowOpacity); + if (needsReset) { + this.projectionDelta = undefined; + this.needsReset = true; + } + if (transition) + this.setOptions({ transition }); + } + relegate() { + const stack = this.getStack(); + if (stack) { + return stack.relegate(this); + } + else { + return false; + } + } + resetSkewAndRotation() { + const { visualElement } = this.options; + if (!visualElement) + return; + // If there's no detected skew or rotation values, we can early return without a forced render. + let hasDistortingTransform = false; + /** + * An unrolled check for rotation values. Most elements don't have any rotation and + * skipping the nested loop and new object creation is 50% faster. + */ + const { latestValues } = visualElement; + if (latestValues.z || + latestValues.rotate || + latestValues.rotateX || + latestValues.rotateY || + latestValues.rotateZ || + latestValues.skewX || + latestValues.skewY) { + hasDistortingTransform = true; + } + // If there's no distorting values, we don't need to do any more. + if (!hasDistortingTransform) + return; + const resetValues = {}; + if (latestValues.z) { + resetDistortingTransform("z", visualElement, resetValues, this.animationValues); + } + // Check the skew and rotate value of all axes and reset to 0 + for (let i = 0; i < transformAxes.length; i++) { + resetDistortingTransform(`rotate${transformAxes[i]}`, visualElement, resetValues, this.animationValues); + resetDistortingTransform(`skew${transformAxes[i]}`, visualElement, resetValues, this.animationValues); + } + // Force a render of this element to apply the transform with all skews and rotations + // set to 0. + visualElement.render(); + // Put back all the values we reset + for (const key in resetValues) { + visualElement.setStaticValue(key, resetValues[key]); + if (this.animationValues) { + this.animationValues[key] = resetValues[key]; + } + } + // Schedule a render for the next frame. This ensures we won't visually + // see the element with the reset rotate value applied. + visualElement.scheduleRender(); + } + applyProjectionStyles(targetStyle, // CSSStyleDeclaration - doesn't allow numbers to be assigned to properties + styleProp) { + if (!this.instance || this.isSVG) + return; + if (!this.isVisible) { + targetStyle.visibility = "hidden"; + return; + } + const transformTemplate = this.getTransformTemplate(); + if (this.needsReset) { + this.needsReset = false; + targetStyle.visibility = ""; + targetStyle.opacity = ""; + targetStyle.pointerEvents = + resolveMotionValue(styleProp?.pointerEvents) || ""; + targetStyle.transform = transformTemplate + ? transformTemplate(this.latestValues, "") + : "none"; + return; + } + const lead = this.getLead(); + if (!this.projectionDelta || !this.layout || !lead.target) { + if (this.options.layoutId) { + targetStyle.opacity = + this.latestValues.opacity !== undefined + ? this.latestValues.opacity + : 1; + targetStyle.pointerEvents = + resolveMotionValue(styleProp?.pointerEvents) || ""; + } + if (this.hasProjected && !hasTransform(this.latestValues)) { + targetStyle.transform = transformTemplate + ? transformTemplate({}, "") + : "none"; + this.hasProjected = false; + } + return; + } + targetStyle.visibility = ""; + const valuesToRender = lead.animationValues || lead.latestValues; + this.applyTransformsToTarget(); + let transform = buildProjectionTransform(this.projectionDeltaWithTransform, this.treeScale, valuesToRender); + if (transformTemplate) { + transform = transformTemplate(valuesToRender, transform); + } + targetStyle.transform = transform; + const { x, y } = this.projectionDelta; + targetStyle.transformOrigin = `${x.origin * 100}% ${y.origin * 100}% 0`; + if (lead.animationValues) { + /** + * If the lead component is animating, assign this either the entering/leaving + * opacity + */ + targetStyle.opacity = + lead === this + ? valuesToRender.opacity ?? + this.latestValues.opacity ?? + 1 + : this.preserveOpacity + ? this.latestValues.opacity + : valuesToRender.opacityExit; + } + else { + /** + * Or we're not animating at all, set the lead component to its layout + * opacity and other components to hidden. + */ + targetStyle.opacity = + lead === this + ? valuesToRender.opacity !== undefined + ? valuesToRender.opacity + : "" + : valuesToRender.opacityExit !== undefined + ? valuesToRender.opacityExit + : 0; + } + /** + * Apply scale correction + */ + for (const key in scaleCorrectors) { + if (valuesToRender[key] === undefined) + continue; + const { correct, applyTo, isCSSVariable } = scaleCorrectors[key]; + /** + * Only apply scale correction to the value if we have an + * active projection transform. Otherwise these values become + * vulnerable to distortion if the element changes size without + * a corresponding layout animation. + */ + const corrected = transform === "none" + ? valuesToRender[key] + : correct(valuesToRender[key], lead); + if (applyTo) { + const num = applyTo.length; + for (let i = 0; i < num; i++) { + targetStyle[applyTo[i]] = corrected; + } + } + else { + // If this is a CSS variable, set it directly on the instance. + // Replacing this function from creating styles to setting them + // would be a good place to remove per frame object creation + if (isCSSVariable) { + this.options.visualElement.renderState.vars[key] = corrected; + } + else { + targetStyle[key] = corrected; + } + } + } + /** + * Disable pointer events on follow components. This is to ensure + * that if a follow component covers a lead component it doesn't block + * pointer events on the lead. + */ + if (this.options.layoutId) { + targetStyle.pointerEvents = + lead === this + ? resolveMotionValue(styleProp?.pointerEvents) || "" + : "none"; + } + } + clearSnapshot() { + this.resumeFrom = this.snapshot = undefined; + } + // Only run on root + resetTree() { + this.root.nodes.forEach((node) => node.currentAnimation?.stop()); + this.root.nodes.forEach(clearMeasurements); + this.root.sharedNodes.clear(); + } + }; + } + function updateLayout(node) { + node.updateLayout(); + } + function notifyLayoutUpdate(node) { + const snapshot = node.resumeFrom?.snapshot || node.snapshot; + if (node.isLead() && + node.layout && + snapshot && + node.hasListeners("didUpdate")) { + const { layoutBox: layout, measuredBox: measuredLayout } = node.layout; + const { animationType } = node.options; + const isShared = snapshot.source !== node.layout.source; + // TODO Maybe we want to also resize the layout snapshot so we don't trigger + // animations for instance if layout="size" and an element has only changed position + if (animationType === "size") { + eachAxis((axis) => { + const axisSnapshot = isShared + ? snapshot.measuredBox[axis] + : snapshot.layoutBox[axis]; + const length = calcLength(axisSnapshot); + axisSnapshot.min = layout[axis].min; + axisSnapshot.max = axisSnapshot.min + length; + }); + } + else if (animationType === "x" || animationType === "y") { + const snapAxis = animationType === "x" ? "y" : "x"; + copyAxisInto(isShared + ? snapshot.measuredBox[snapAxis] + : snapshot.layoutBox[snapAxis], layout[snapAxis]); + } + else if (shouldAnimatePositionOnly(animationType, snapshot.layoutBox, layout)) { + eachAxis((axis) => { + const axisSnapshot = isShared + ? snapshot.measuredBox[axis] + : snapshot.layoutBox[axis]; + const length = calcLength(layout[axis]); + axisSnapshot.max = axisSnapshot.min + length; + /** + * Ensure relative target gets resized and rerendererd + */ + if (node.relativeTarget && !node.currentAnimation) { + node.isProjectionDirty = true; + node.relativeTarget[axis].max = + node.relativeTarget[axis].min + length; + } + }); + } + const layoutDelta = createDelta(); + calcBoxDelta(layoutDelta, layout, snapshot.layoutBox); + const visualDelta = createDelta(); + if (isShared) { + calcBoxDelta(visualDelta, node.applyTransform(measuredLayout, true), snapshot.measuredBox); + } + else { + calcBoxDelta(visualDelta, layout, snapshot.layoutBox); + } + const hasLayoutChanged = !isDeltaZero(layoutDelta); + let hasRelativeLayoutChanged = false; + if (!node.resumeFrom) { + const relativeParent = node.getClosestProjectingParent(); + /** + * If the relativeParent is itself resuming from a different element then + * the relative snapshot is not relavent + */ + if (relativeParent && !relativeParent.resumeFrom) { + const { snapshot: parentSnapshot, layout: parentLayout } = relativeParent; + if (parentSnapshot && parentLayout) { + const anchor = node.options.layoutAnchor || undefined; + const relativeSnapshot = createBox(); + calcRelativePosition(relativeSnapshot, snapshot.layoutBox, parentSnapshot.layoutBox, anchor); + const relativeLayout = createBox(); + calcRelativePosition(relativeLayout, layout, parentLayout.layoutBox, anchor); + if (!boxEqualsRounded(relativeSnapshot, relativeLayout)) { + hasRelativeLayoutChanged = true; + } + if (relativeParent.options.layoutRoot) { + node.relativeTarget = relativeLayout; + node.relativeTargetOrigin = relativeSnapshot; + node.relativeParent = relativeParent; + } + } + } + } + node.notifyListeners("didUpdate", { + layout, + snapshot, + delta: visualDelta, + layoutDelta, + hasLayoutChanged, + hasRelativeLayoutChanged, + }); + } + else if (node.isLead()) { + const { onExitComplete } = node.options; + onExitComplete && onExitComplete(); + } + /** + * Clearing transition + * TODO: Investigate why this transition is being passed in as {type: false } from Framer + * and why we need it at all + */ + node.options.transition = undefined; + } + function propagateDirtyNodes(node) { + /** + * Increase debug counter for nodes encountered this frame + */ + if (statsBuffer.value) { + metrics.nodes++; + } + if (!node.parent) + return; + /** + * If this node isn't projecting, propagate isProjectionDirty. It will have + * no performance impact but it will allow the next child that *is* projecting + * but *isn't* dirty to just check its parent to see if *any* ancestor needs + * correcting. + */ + if (!node.isProjecting()) { + node.isProjectionDirty = node.parent.isProjectionDirty; + } + /** + * Propagate isSharedProjectionDirty and isTransformDirty + * throughout the whole tree. A future revision can take another look at + * this but for safety we still recalcualte shared nodes. + */ + node.isSharedProjectionDirty || (node.isSharedProjectionDirty = Boolean(node.isProjectionDirty || + node.parent.isProjectionDirty || + node.parent.isSharedProjectionDirty)); + node.isTransformDirty || (node.isTransformDirty = node.parent.isTransformDirty); + } + function cleanDirtyNodes(node) { + node.isProjectionDirty = + node.isSharedProjectionDirty = + node.isTransformDirty = + false; + } + function clearSnapshot(node) { + node.clearSnapshot(); + } + function clearMeasurements(node) { + node.clearMeasurements(); + } + function forceLayoutMeasure(node) { + node.isLayoutDirty = true; + node.updateLayout(); + } + function clearIsLayoutDirty(node) { + node.isLayoutDirty = false; + } + /** + * When a node is animation-blocked (e.g. during drag) and its component + * didn't re-render (memoized), willUpdate() is never called so there's + * no snapshot. Use the previous layout as a snapshot and mark dirty so + * resetTransform/updateLayout/notifyLayoutUpdate process it normally. + */ + function ensureDraggedNodesSnapshotted(node) { + if (node.isAnimationBlocked && node.layout && !node.isLayoutDirty) { + node.snapshot = node.layout; + node.isLayoutDirty = true; + } + } + function resetTransformStyle(node) { + const { visualElement } = node.options; + if (visualElement && visualElement.getProps().onBeforeLayoutMeasure) { + visualElement.notify("BeforeLayoutMeasure"); + } + node.resetTransform(); + } + function finishAnimation(node) { + node.finishAnimation(); + node.targetDelta = node.relativeTarget = node.target = undefined; + node.isProjectionDirty = true; + } + function resolveTargetDelta(node) { + node.resolveTargetDelta(); + } + function calcProjection(node) { + node.calcProjection(); + } + function resetSkewAndRotation(node) { + node.resetSkewAndRotation(); + } + function removeLeadSnapshots(stack) { + stack.removeLeadSnapshot(); + } + function mixAxisDeltaLinear(output, delta, p) { + output.translate = mixNumber$1(delta.translate, 0, p); + output.scale = mixNumber$1(delta.scale, 1, p); + output.origin = delta.origin; + output.originPoint = delta.originPoint; + } + function mixAxis(output, from, to, p) { + output.min = mixNumber$1(from.min, to.min, p); + output.max = mixNumber$1(from.max, to.max, p); + } + function mixBox(output, from, to, p) { + mixAxis(output.x, from.x, to.x, p); + mixAxis(output.y, from.y, to.y, p); + } + function hasOpacityCrossfade(node) { + return (node.animationValues && node.animationValues.opacityExit !== undefined); + } + const defaultLayoutTransition = { + duration: 0.45, + ease: [0.4, 0, 0.1, 1], + }; + const userAgentContains = (string) => typeof navigator !== "undefined" && + navigator.userAgent && + navigator.userAgent.toLowerCase().includes(string); + /** + * Measured bounding boxes must be rounded in Safari and + * left untouched in Chrome, otherwise non-integer layouts within scaled-up elements + * can appear to jump. + */ + const roundPoint = userAgentContains("applewebkit/") && !userAgentContains("chrome/") + ? Math.round + : noop; + function roundAxis(axis) { + // Round to the nearest .5 pixels to support subpixel layouts + axis.min = roundPoint(axis.min); + axis.max = roundPoint(axis.max); + } + function roundBox(box) { + roundAxis(box.x); + roundAxis(box.y); + } + function shouldAnimatePositionOnly(animationType, snapshot, layout) { + return (animationType === "position" || + (animationType === "preserve-aspect" && + !isNear(aspectRatio(snapshot), aspectRatio(layout), 0.2))); + } + function checkNodeWasScrollRoot(node) { + return node !== node.root && node.scroll?.wasRoot; + } + + const DocumentProjectionNode = createProjectionNode$1({ + attachResizeListener: (ref, notify) => addDomEvent(ref, "resize", notify), + measureScroll: () => ({ + x: document.documentElement.scrollLeft || document.body?.scrollLeft || 0, + y: document.documentElement.scrollTop || document.body?.scrollTop || 0, + }), + checkIsScrollRoot: () => true, + }); + + const notify = (node) => !node.isLayoutDirty && node.willUpdate(false); + function nodeGroup() { + const nodes = new Set(); + const subscriptions = new WeakMap(); + const dirtyAll = () => nodes.forEach(notify); + return { + add: (node) => { + nodes.add(node); + subscriptions.set(node, node.addEventListener("willUpdate", dirtyAll)); + }, + remove: (node) => { + nodes.delete(node); + const unsubscribe = subscriptions.get(node); + if (unsubscribe) { + unsubscribe(); + subscriptions.delete(node); + } + dirtyAll(); + }, + dirty: dirtyAll, + }; + } + + const rootProjectionNode = { + current: undefined, + }; + const HTMLProjectionNode = createProjectionNode$1({ + measureScroll: (instance) => ({ + x: instance.scrollLeft, + y: instance.scrollTop, + }), + defaultParent: () => { + if (!rootProjectionNode.current) { + const documentNode = new DocumentProjectionNode({}); + documentNode.mount(window); + documentNode.setOptions({ layoutScroll: true }); + rootProjectionNode.current = documentNode; + } + return rootProjectionNode.current; + }, + resetTransform: (instance, value) => { + instance.style.transform = value !== undefined ? value : "none"; + }, + checkIsScrollRoot: (instance) => Boolean(window.getComputedStyle(instance).position === "fixed"), + }); + + const layoutSelector = "[data-layout],[data-layout-id]"; + /** + * All imperatively-created projection nodes live in one persistent tree, + * shared across animateLayout() calls (and with any React-created nodes, + * via the singleton document root). Keyed by element for reuse. + */ + const layoutNodes = new WeakMap(); + /** + * Builders created within the same synchronous tick are flushed together + * as a single "commit": every node is snapshotted before any updateDom + * runs, mirroring React batching renders from different parts of the tree. + */ + let pendingBuilders; + function collectLayoutElements(scope) { + const elements = []; + if (scope instanceof HTMLElement && scope.matches(layoutSelector)) { + elements.push(scope); + } + scope.querySelectorAll(layoutSelector).forEach((element) => { + if (element instanceof HTMLElement) + elements.push(element); + }); + return elements; + } + /** + * Process any work scheduled on the frameloop now. A previous animation + * may have been seeked while paused (controls.time = x) without a frame + * having rendered it - we must materialise that state into the DOM + * before taking snapshots. + */ + function flushPendingFrame() { + if (frameData.isProcessing) + return; + const now = time.now(); + frameData.delta = clamp(0, 1000 / 60, now - frameData.timestamp); + frameData.timestamp = now; + frameData.isProcessing = true; + frameSteps.update.process(frameData); + frameSteps.preRender.process(frameData); + frameSteps.render.process(frameData); + frameData.isProcessing = false; + } + function getProjectionParent(element) { + let ancestor = element.parentElement; + while (ancestor) { + const node = layoutNodes.get(ancestor); + if (node && node.instance) + return node; + ancestor = ancestor.parentElement; + } + return undefined; + } + function createVisualElement() { + return new HTMLVisualElement({ + props: {}, + presenceContext: null, + visualState: { + latestValues: {}, + renderState: { + transform: {}, + transformOrigin: {}, + style: {}, + vars: {}, + }, + }, + }, { allowProjection: true }); + } + function readNodeOptions(element, transition) { + const layoutAttr = element.getAttribute("data-layout"); + const layoutId = element.getAttribute("data-layout-id") ?? undefined; + return { + layoutId, + layout: layoutAttr !== null ? true : undefined, + animationType: (!layoutAttr || layoutAttr === "true" + ? "both" + : layoutAttr), + transition, + }; + } + function prepareNode(element, transition) { + let node = layoutNodes.get(element); + if (!node) { + let visualElement = visualElementStore.get(element); + if (!visualElement) + visualElement = createVisualElement(); + /** + * A first-time element may carry a projection transform in its + * inline style (e.g. it was cloned from an element mid-animation). + * That transform isn't tracked in latestValues so the engine can't + * reset it before measuring - clear it now so the first layout + * measurement isn't inflated. + */ + if (element.style.transform && + !hasTransform(visualElement.latestValues)) { + element.style.transform = ""; + } + node = new HTMLProjectionNode(visualElement.latestValues, getProjectionParent(element)); + visualElement.projection = node; + node.setOptions({ + ...readNodeOptions(element, transition), + visualElement, + }); + node.mount(element); + layoutNodes.set(element, node); + } + else { + node.setOptions(readNodeOptions(element, transition)); + } + node.isPresent = true; + if (node.options.onExitComplete) { + node.setOptions({ onExitComplete: undefined }); + } + return node; + } + function sortDocumentOrder(elements) { + return [...elements].sort((a, b) => a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1); + } + function dropNode(element, node) { + node.setOptions({ onExitComplete: undefined }); + /** + * Stop any lingering animation so it can't leak into future updates. + * A follow node can share its currentAnimation with a surviving lead + * (via resumingFrom), in which case it isn't ours to stop. + */ + const stack = node.getStack(); + if (!stack || node.isLead()) + node.currentAnimation?.stop(); + node.unmount(); + layoutNodes.delete(element); + } + function flushPendingBuilders() { + const builders = pendingBuilders; + pendingBuilders = undefined; + flushPendingFrame(); + /** + * Discover and mount every node across all builders before snapshotting + * any of them. Mounting during an active update flags isLayoutDirty, + * which would make that node's own willUpdate skip its snapshot. + * Document order guarantees ancestors mount before descendants, even + * when they're discovered by different builders. + */ + const targets = new Map(); + for (const builder of builders) { + for (const element of builder.collectTargets()) { + const owners = targets.get(element); + owners ? owners.push(builder) : targets.set(element, [builder]); + } + } + const union = new Map(); + for (const element of sortDocumentOrder(targets.keys())) { + const owners = targets.get(element); + const node = prepareNode(element, owners[owners.length - 1].transitionFor(element)); + for (const owner of owners) + owner.adopt(element, node); + union.set(element, node); + } + union.forEach((node) => { + node.isLayoutDirty = false; + node.willUpdate(); + }); + const updatePromises = []; + for (const builder of builders) { + const result = builder.runUpdate(); + if (result) + updatePromises.push(result); + } + const commit = () => { + /** + * Process all additions before any removals so that, even across + * builders, a removed member knows whether a replacement with the + * same layoutId was added in this commit. + */ + const newMemberIds = new Set(); + for (const builder of builders) { + builder.reconcileAdditions(newMemberIds); + } + for (const builder of builders) { + builder.reconcileRemovals(newMemberIds); + } + let root; + union.forEach((node) => (root || (root = node.root))); + for (const builder of builders) + root || (root = builder.getRoot()); + root?.didUpdate(); + /** + * The root flushes the update on a microtask, synchronously + * processing the frame that creates the layout animations. Collect + * them in a later microtask step of the same pass. + */ + microtask.render(() => { + for (const builder of builders) + builder.finalize(); + }); + }; + updatePromises.length ? Promise.all(updatePromises).then(commit) : commit(); + } + class LayoutAnimationBuilder { + constructor(scope, updateDom, defaultOptions) { + this.scope = scope; + this.updateDom = updateDom; + this.defaultOptions = defaultOptions; + this.sharedTransitions = new Map(); + this.notifyReady = () => { }; + this.rejectReady = () => { }; + this.tracked = new Map(); + this.restorePoints = new Map(); + this.readyPromise = new Promise((resolve, reject) => { + this.notifyReady = resolve; + this.rejectReady = reject; + }); + if (!pendingBuilders) { + pendingBuilders = []; + queueMicrotask(flushPendingBuilders); + } + pendingBuilders.push(this); + } + shared(id, transition) { + this.sharedTransitions.set(id, transition); + return this; + } + then(resolve, reject) { + return this.readyPromise.then(resolve, reject); + } + transitionFor(element) { + const layoutId = element.getAttribute("data-layout-id"); + return ((layoutId && this.sharedTransitions.get(layoutId)) || + this.defaultOptions); + } + adopt(element, node) { + this.tracked.set(element, node); + this.restorePoints.set(element, { + parent: element.parentElement, + next: element.nextSibling, + }); + } + collectTargets() { + return collectLayoutElements(this.scope); + } + runUpdate() { + try { + const result = this.updateDom(); + if (result && typeof result.then === "function") { + return result.then(undefined, (error) => { + this.updateError = error; + }); + } + } + catch (error) { + this.updateError = error; + } + return undefined; + } + reconcileAdditions(newMemberIds) { + for (const element of collectLayoutElements(this.scope)) { + if (this.tracked.has(element)) + continue; + const node = prepareNode(element, this.transitionFor(element)); + this.adopt(element, node); + node.options.layoutId && newMemberIds.add(node.options.layoutId); + } + } + reconcileRemovals(newMemberIds) { + this.tracked.forEach((node, element) => { + if (element.isConnected) + return; + const restore = this.restorePoints.get(element); + this.restorePoints.delete(element); + const { layoutId } = node.options; + const stack = node.getStack(); + const hasSurvivor = stack && + stack.members.some((member) => member !== node && + member.instance + ?.isConnected); + /** + * A removed lead with a surviving stack member - and no + * replacement member added this commit - runs an exit + * crossfade: restore the element to its old position in the + * DOM, relegate it and let the survivor take over. It's + * removed again once the animation completes. + */ + if (layoutId && + node.isLead() && + hasSurvivor && + !newMemberIds.has(layoutId)) { + if (restore && restore.parent.isConnected) { + restore.parent.insertBefore(element, restore.next && restore.next.parentNode === restore.parent + ? restore.next + : null); + node.isPresent = false; + node.setOptions({ + onExitComplete: () => { + element.remove(); + dropNode(element, node); + }, + }); + if (node.relegate()) + return; + element.remove(); + } + } + dropNode(element, node); + this.tracked.delete(element); + }); + } + getRoot() { + let root; + this.tracked.forEach((node) => (root || (root = node.root))); + return root; + } + finalize() { + if (this.updateError) { + this.rejectReady(this.updateError); + return; + } + const animations = new Set(); + this.tracked.forEach((node) => { + if (node.instance && node.currentAnimation) { + animations.add(node.currentAnimation); + } + }); + this.notifyReady(new GroupAnimation([...animations])); + } + } + function parseAnimateLayoutArgs(scopeOrUpdateDom, updateDomOrOptions, options) { + if (typeof scopeOrUpdateDom === "function") { + return { + scope: document, + updateDom: scopeOrUpdateDom, + defaultOptions: updateDomOrOptions, + }; + } + const scope = scopeOrUpdateDom instanceof Document + ? scopeOrUpdateDom + : resolveElements(scopeOrUpdateDom)[0] ?? document; + return { + scope, + updateDom: updateDomOrOptions, + defaultOptions: options, + }; + } + + /** + * @deprecated + * + * Import as `frame` instead. + */ + const sync = frame; + /** + * @deprecated + * + * Use cancelFrame(callback) instead. + */ + const cancelSync = stepsOrder.reduce((acc, key) => { + acc[key] = (process) => cancelFrame(process); + return acc; + }, {}); + + /** + * @public + */ + const MotionConfigContext = React$1.createContext({ + transformPagePoint: (p) => p, + isStatic: false, + reducedMotion: "never", + }); + + /** + * Taken from https://github.com/radix-ui/primitives/blob/main/packages/react/compose-refs/src/compose-refs.tsx + */ + /** + * Set a given ref to a given value + * This utility takes care of different types of refs: callback refs and RefObject(s) + */ + function setRef(ref, value) { + if (typeof ref === "function") { + return ref(value); + } + else if (ref !== null && ref !== undefined) { + ref.current = value; + } + } + /** + * A utility to compose multiple refs together + * Accepts callback refs and RefObject(s) + */ + function composeRefs(...refs) { + return (node) => { + let hasCleanup = false; + const cleanups = refs.map((ref) => { + const cleanup = setRef(ref, node); + if (!hasCleanup && typeof cleanup === "function") { + hasCleanup = true; + } + return cleanup; + }); + // React <19 will log an error to the console if a callback ref returns a + // value. We don't use ref cleanups internally so this will only happen if a + // user's ref callback returns a value, which we only expect if they are + // using the cleanup functionality added in React 19. + if (hasCleanup) { + return () => { + for (let i = 0; i < cleanups.length; i++) { + const cleanup = cleanups[i]; + if (typeof cleanup === "function") { + cleanup(); + } + else { + setRef(refs[i], null); + } + } + }; + } + }; + } + /** + * A custom hook that composes multiple refs + * Accepts callback refs and RefObject(s) + */ + function useComposedRefs(...refs) { + // eslint-disable-next-line react-hooks/exhaustive-deps + return React__namespace.useCallback(composeRefs(...refs), refs); + } + + /** + * Measurement functionality has to be within a separate component + * to leverage snapshot lifecycle. + */ + class PopChildMeasure extends React__namespace.Component { + getSnapshotBeforeUpdate(prevProps) { + const element = this.props.childRef.current; + if (isHTMLElement(element) && prevProps.isPresent && !this.props.isPresent && this.props.pop !== false) { + const parent = element.offsetParent; + const parentWidth = isHTMLElement(parent) + ? parent.offsetWidth || 0 + : 0; + const parentHeight = isHTMLElement(parent) + ? parent.offsetHeight || 0 + : 0; + const computedStyle = getComputedStyle(element); + const size = this.props.sizeRef.current; + size.height = parseFloat(computedStyle.height); + size.width = parseFloat(computedStyle.width); + size.top = element.offsetTop; + size.left = element.offsetLeft; + size.right = parentWidth - size.width - size.left; + size.bottom = parentHeight - size.height - size.top; + size.direction = computedStyle.direction; + } + return null; + } + /** + * Required with getSnapshotBeforeUpdate to stop React complaining. + */ + componentDidUpdate() { } + render() { + return this.props.children; + } + } + function PopChild({ children, isPresent, anchorX, anchorY, root, pop }) { + const id = React$1.useId(); + const ref = React$1.useRef(null); + const size = React$1.useRef({ + width: 0, + height: 0, + top: 0, + left: 0, + right: 0, + bottom: 0, + direction: "ltr", + }); + const { nonce } = React$1.useContext(MotionConfigContext); + /** + * In React 19, refs are passed via props.ref instead of element.ref. + * We check props.ref first (React 19) and fall back to element.ref (React 18). + * + * The composed ref is only used when popping the child out (pop !== false), + * so we avoid reading children.props.ref otherwise. In React 18.3 that read + * triggers a spurious "`ref` is not a prop" warning getter (#3745). + */ + const childRef = pop !== false + ? (children.props?.ref ?? + children?.ref) + : undefined; + const composedRef = useComposedRefs(ref, childRef); + /** + * We create and inject a style block so we can apply this explicit + * sizing in a non-destructive manner by just deleting the style block. + * + * We can't apply size via render as the measurement happens + * in getSnapshotBeforeUpdate (post-render), likewise if we apply the + * styles directly on the DOM node, we might be overwriting + * styles set via the style prop. + */ + React$1.useInsertionEffect(() => { + const { width, height, top, left, right, bottom, direction } = size.current; + if (isPresent || pop === false || !ref.current || !width || !height) + return; + const isRTL = direction === "rtl"; + const x = anchorX === "left" + ? (isRTL ? `right: ${right}` : `left: ${left}`) + : (isRTL ? `left: ${left}` : `right: ${right}`); + const y = anchorY === "bottom" ? `bottom: ${bottom}` : `top: ${top}`; + ref.current.dataset.motionPopId = id; + const style = document.createElement("style"); + if (nonce) + style.nonce = nonce; + const parent = root ?? document.head; + parent.appendChild(style); + if (style.sheet) { + style.sheet.insertRule(` + [data-motion-pop-id="${id}"] { + position: absolute !important; + width: ${width}px !important; + height: ${height}px !important; + ${x}px !important; + ${y}px !important; + } + `); + } + return () => { + ref.current?.removeAttribute("data-motion-pop-id"); + if (parent.contains(style)) { + parent.removeChild(style); + } + }; + }, [isPresent]); + return (jsx(PopChildMeasure, { isPresent: isPresent, childRef: ref, sizeRef: size, pop: pop, children: pop === false + ? children + : React__namespace.cloneElement(children, { ref: composedRef }) })); + } + + const PresenceChild = ({ children, initial, isPresent, onExitComplete, custom, presenceAffectsLayout, mode, anchorX, anchorY, root }) => { + const presenceChildren = useConstant(newChildrenMap); + const id = React$1.useId(); + // Written in a layout effect (not render) so discarded concurrent + // renders can't leave the refs pointing at uncommitted state. + const isPresentRef = React$1.useRef(isPresent); + const onExitCompleteRef = React$1.useRef(onExitComplete); + useIsomorphicLayoutEffect(() => { + isPresentRef.current = isPresent; + onExitCompleteRef.current = onExitComplete; + }); + let isReusedContext = true; + let context = React$1.useMemo(() => { + isReusedContext = false; + return { + id, + initial, + isPresent, + custom, + onExitComplete: (childId) => { + presenceChildren.set(childId, true); + for (const isComplete of presenceChildren.values()) { + if (!isComplete) + return; // can stop searching when any is incomplete + } + onExitComplete && onExitComplete(); + }, + register: (childId) => { + presenceChildren.set(childId, false); + return () => { + presenceChildren.delete(childId); + !isPresentRef.current && + !presenceChildren.size && + onExitCompleteRef.current?.(); + }; + }, + }; + }, [isPresent, presenceChildren, onExitComplete]); + /** + * If the presence of a child affects the layout of the components around it, + * we want to make a new context value to ensure they get re-rendered + * so they can detect that layout change. + */ + if (presenceAffectsLayout && isReusedContext) { + context = { ...context }; + } + React$1.useMemo(() => { + presenceChildren.forEach((_, key) => presenceChildren.set(key, false)); + }, [isPresent]); + /** + * If there's no `motion` components to fire exit animations, we want to remove this + * component immediately. + */ + React__namespace.useEffect(() => { + !isPresent && + !presenceChildren.size && + onExitComplete && + onExitComplete(); + }, [isPresent]); + children = (jsx(PopChild, { pop: mode === "popLayout", isPresent: isPresent, anchorX: anchorX, anchorY: anchorY, root: root, children: children })); + return (jsx(PresenceContext.Provider, { value: context, children: children })); + }; + function newChildrenMap() { + return new Map(); + } + + /** + * When a component is the child of `AnimatePresence`, it can use `usePresence` + * to access information about whether it's still present in the React tree. + * + * ```jsx + * import { usePresence } from "framer-motion" + * + * export const Component = () => { + * const [isPresent, safeToRemove] = usePresence() + * + * useEffect(() => { + * !isPresent && setTimeout(safeToRemove, 1000) + * }, [isPresent]) + * + * return

+ * } + * ``` + * + * If `isPresent` is `false`, it means that a component has been removed from the tree, + * but `AnimatePresence` won't really remove it until `safeToRemove` has been called. + * + * @public + */ + function usePresence(subscribe = true) { + const context = React$1.useContext(PresenceContext); + if (context === null) + return [true, null]; + const { isPresent, onExitComplete, register } = context; + // It's safe to call the following hooks conditionally (after an early return) because the context will always + // either be null or non-null for the lifespan of the component. + const id = React$1.useId(); + React$1.useEffect(() => { + if (subscribe) { + return register(id); + } + }, [subscribe]); + const safeToRemove = React$1.useCallback(() => subscribe && onExitComplete && onExitComplete(id), [id, onExitComplete, subscribe]); + return !isPresent && onExitComplete ? [false, safeToRemove] : [true]; + } + /** + * Similar to `usePresence`, except `useIsPresent` simply returns whether or not the component is present. + * There is no `safeToRemove` function. + * + * ```jsx + * import { useIsPresent } from "framer-motion" + * + * export const Component = () => { + * const isPresent = useIsPresent() + * + * useEffect(() => { + * !isPresent && console.log("I've been removed!") + * }, [isPresent]) + * + * return
+ * } + * ``` + * + * @public + */ + function useIsPresent() { + return isPresent(React$1.useContext(PresenceContext)); + } + function isPresent(context) { + return context === null ? true : context.isPresent; + } + + const getChildKey = (child) => child.key || ""; + function onlyElements(children) { + const filtered = []; + // We use forEach here instead of map as map mutates the component key by preprending `.$` + React$1.Children.forEach(children, (child) => { + if (React$1.isValidElement(child)) + filtered.push(child); + }); + return filtered; + } + + /** + * `AnimatePresence` enables the animation of components that have been removed from the tree. + * + * When adding/removing more than a single child, every child **must** be given a unique `key` prop. + * + * Any `motion` components that have an `exit` property defined will animate out when removed from + * the tree. + * + * ```jsx + * import { motion, AnimatePresence } from 'framer-motion' + * + * export const Items = ({ items }) => ( + * + * {items.map(item => ( + * + * ))} + * + * ) + * ``` + * + * You can sequence exit animations throughout a tree using variants. + * + * If a child contains multiple `motion` components with `exit` props, it will only unmount the child + * once all `motion` components have finished animating out. Likewise, any components using + * `usePresence` all need to call `safeToRemove`. + * + * @public + */ + const AnimatePresence = ({ children, custom, initial = true, onExitComplete, presenceAffectsLayout = true, mode = "sync", propagate = false, anchorX = "left", anchorY = "top", root }) => { + const [isParentPresent, safeToRemove] = usePresence(propagate); + /** + * Filter any children that aren't ReactElements. We can only track components + * between renders with a props.key. + */ + const presentChildren = React$1.useMemo(() => onlyElements(children), [children]); + /** + * Track the keys of the currently rendered children. This is used to + * determine which children are exiting. + */ + const presentKeys = propagate && !isParentPresent ? [] : presentChildren.map(getChildKey); + /** + * If `initial={false}` we only want to pass this to components in the first render. + */ + const isInitialRender = React$1.useRef(true); + /** + * A ref containing the currently present children. When all exit animations + * are complete, we use this to re-render the component with the latest children + * *committed* rather than the latest children *rendered*. + */ + const pendingPresentChildren = React$1.useRef(presentChildren); + /** + * Track which exiting children have finished animating out. + */ + const exitComplete = useConstant(() => new Map()); + /** + * Track which components are currently processing exit to prevent duplicate processing. + */ + const exitingComponents = React$1.useRef(new Set()); + /** + * Save children to render as React state. To ensure this component is concurrent-safe, + * we check for exiting children via an effect. + */ + const [diffedChildren, setDiffedChildren] = React$1.useState(presentChildren); + const [renderedChildren, setRenderedChildren] = React$1.useState(presentChildren); + useIsomorphicLayoutEffect(() => { + if (propagate && !isParentPresent && !renderedChildren.length) { + safeToRemove?.(); + } + }, [isParentPresent, propagate, renderedChildren.length, safeToRemove]); + useIsomorphicLayoutEffect(() => { + isInitialRender.current = false; + pendingPresentChildren.current = presentChildren; + /** + * Update complete status of exiting children. + */ + for (let i = 0; i < renderedChildren.length; i++) { + const key = getChildKey(renderedChildren[i]); + if (!presentKeys.includes(key)) { + if (exitComplete.get(key) !== true) { + exitComplete.set(key, false); + } + } + else { + exitComplete.delete(key); + exitingComponents.current.delete(key); + } + } + }, [renderedChildren, presentKeys.length, presentKeys.join("-")]); + const exitingChildren = []; + if (presentChildren !== diffedChildren) { + let nextChildren = [...presentChildren]; + /** + * Loop through all the currently rendered components and decide which + * are exiting. + */ + for (let i = 0; i < renderedChildren.length; i++) { + const child = renderedChildren[i]; + const key = getChildKey(child); + if (!presentKeys.includes(key)) { + nextChildren.splice(i, 0, child); + exitingChildren.push(child); + } + } + /** + * If we're in "wait" mode, and we have exiting children, we want to + * only render these until they've all exited. + */ + if (mode === "wait" && exitingChildren.length) { + nextChildren = exitingChildren; + } + setRenderedChildren(onlyElements(nextChildren)); + setDiffedChildren(presentChildren); + /** + * Early return to ensure once we've set state with the latest diffed + * children, we can immediately re-render. + */ + return null; + } + if (mode === "wait" && + renderedChildren.length > 1) { + console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`); + } + /** + * If we've been provided a forceRender function by the LayoutGroupContext, + * we can use it to force a re-render amongst all surrounding components once + * all components have finished animating out. + */ + const { forceRender } = React$1.useContext(LayoutGroupContext); + return (jsx(Fragment, { children: renderedChildren.map((child) => { + const key = getChildKey(child); + const isPresent = propagate && !isParentPresent + ? false + : presentChildren === renderedChildren || + presentKeys.includes(key); + const onExit = () => { + if (exitingComponents.current.has(key)) { + return; + } + if (exitComplete.has(key)) { + exitingComponents.current.add(key); + exitComplete.set(key, true); + } + else { + return; + } + let isEveryExitComplete = true; + exitComplete.forEach((isExitComplete) => { + if (!isExitComplete) + isEveryExitComplete = false; + }); + if (isEveryExitComplete) { + forceRender?.(); + setRenderedChildren(pendingPresentChildren.current); + propagate && safeToRemove?.(); + onExitComplete && onExitComplete(); + } + }; + return (jsx(PresenceChild, { isPresent: isPresent, initial: !isInitialRender.current || initial + ? undefined + : false, custom: custom, presenceAffectsLayout: presenceAffectsLayout, mode: mode, root: root, onExitComplete: isPresent ? undefined : onExit, anchorX: anchorX, anchorY: anchorY, children: child }, key)); + }) })); + }; + + /** + * Note: Still used by components generated by old versions of Framer + * + * @deprecated + */ + const DeprecatedLayoutGroupContext = React$1.createContext(null); + + function useIsMounted() { + const isMounted = React$1.useRef(false); + useIsomorphicLayoutEffect(() => { + isMounted.current = true; + return () => { + isMounted.current = false; + }; + }, []); + return isMounted; + } + + function useForceUpdate() { + const isMounted = useIsMounted(); + const [forcedRenderCount, setForcedRenderCount] = React$1.useState(0); + const forceRender = React$1.useCallback(() => { + isMounted.current && setForcedRenderCount(forcedRenderCount + 1); + }, [forcedRenderCount]); + /** + * Defer this to the end of the next animation frame in case there are multiple + * synchronous calls. + */ + const deferredForceRender = React$1.useCallback(() => frame.postRender(forceRender), [forceRender]); + return [deferredForceRender, forcedRenderCount]; + } + + const shouldInheritGroup = (inherit) => inherit === true; + const shouldInheritId = (inherit) => shouldInheritGroup(inherit === true) || inherit === "id"; + const LayoutGroup = ({ children, id, inherit = true }) => { + const layoutGroupContext = React$1.useContext(LayoutGroupContext); + const deprecatedLayoutGroupContext = React$1.useContext(DeprecatedLayoutGroupContext); + const [forceRender, key] = useForceUpdate(); + const context = React$1.useRef(null); + const upstreamId = layoutGroupContext.id || deprecatedLayoutGroupContext; + if (context.current === null) { + if (shouldInheritId(inherit) && upstreamId) { + id = id ? upstreamId + "-" + id : upstreamId; + } + context.current = { + id, + group: shouldInheritGroup(inherit) + ? layoutGroupContext.group || nodeGroup() + : nodeGroup(), + }; + } + const memoizedContext = React$1.useMemo(() => ({ ...context.current, forceRender }), [key]); + return (jsx(LayoutGroupContext.Provider, { value: memoizedContext, children: children })); + }; + + const LazyContext = React$1.createContext({ strict: false }); + + const featureProps = { + animation: [ + "animate", + "variants", + "whileHover", + "whileTap", + "exit", + "whileInView", + "whileFocus", + "whileDrag", + ], + exit: ["exit"], + drag: ["drag", "dragControls"], + focus: ["whileFocus"], + hover: ["whileHover", "onHoverStart", "onHoverEnd"], + tap: ["whileTap", "onTap", "onTapStart", "onTapCancel"], + pan: ["onPan", "onPanStart", "onPanSessionStart", "onPanEnd"], + inView: ["whileInView", "onViewportEnter", "onViewportLeave"], + layout: ["layout", "layoutId"], + }; + let isInitialized = false; + /** + * Initialize feature definitions with isEnabled checks. + * This must be called before any motion components are rendered. + */ + function initFeatureDefinitions() { + if (isInitialized) + return; + const initialFeatureDefinitions = {}; + for (const key in featureProps) { + initialFeatureDefinitions[key] = { + isEnabled: (props) => featureProps[key].some((name) => !!props[name]), + }; + } + setFeatureDefinitions(initialFeatureDefinitions); + isInitialized = true; + } + /** + * Get the current feature definitions, initializing if needed. + */ + function getInitializedFeatureDefinitions() { + initFeatureDefinitions(); + return getFeatureDefinitions(); + } + + function loadFeatures(features) { + const featureDefinitions = getInitializedFeatureDefinitions(); + for (const key in features) { + featureDefinitions[key] = { + ...featureDefinitions[key], + ...features[key], + }; + } + setFeatureDefinitions(featureDefinitions); + } + + /** + * Used in conjunction with the `m` component to reduce bundle size. + * + * `m` is a version of the `motion` component that only loads functionality + * critical for the initial render. + * + * `LazyMotion` can then be used to either synchronously or asynchronously + * load animation and gesture support. + * + * ```jsx + * // Synchronous loading + * import { LazyMotion, m, domAnimation } from "framer-motion" + * + * function App() { + * return ( + * + * + * + * ) + * } + * + * // Asynchronous loading + * import { LazyMotion, m } from "framer-motion" + * + * function App() { + * return ( + * import('./path/to/domAnimation')}> + * + * + * ) + * } + * ``` + * + * @public + */ + function LazyMotion({ children, features, strict = false }) { + const [, setIsLoaded] = React$1.useState(!isLazyBundle(features)); + const loadedRenderer = React$1.useRef(undefined); + /** + * If this is a synchronous load, load features immediately + */ + if (!isLazyBundle(features)) { + const { renderer, ...loadedFeatures } = features; + loadedRenderer.current = renderer; + loadFeatures(loadedFeatures); + } + React$1.useEffect(() => { + if (isLazyBundle(features)) { + features().then(({ renderer, ...loadedFeatures }) => { + loadFeatures(loadedFeatures); + loadedRenderer.current = renderer; + setIsLoaded(true); + }); + } + }, []); + return (jsx(LazyContext.Provider, { value: { renderer: loadedRenderer.current, strict }, children: children })); + } + function isLazyBundle(features) { + return typeof features === "function"; + } + + /** + * `MotionConfig` is used to set configuration options for all children `motion` components. + * + * ```jsx + * import { motion, MotionConfig } from "framer-motion" + * + * export function App() { + * return ( + * + * + * + * ) + * } + * ``` + * + * @public + */ + function MotionConfig({ children, ...config }) { + /** + * Inherit props from any parent MotionConfig components + */ + const parentConfig = React$1.useContext(MotionConfigContext); + config = { ...parentConfig, ...config }; + config.transition = resolveTransition(config.transition, parentConfig.transition); + /** + * Don't allow isStatic to change between renders as it affects how many hooks + * motion components fire. + */ + config.isStatic = useConstant(() => config.isStatic); + /** + * Creating a new config context object will re-render every `motion` component + * every time it renders. So we only want to create a new one sparingly. + */ + const context = React$1.useMemo(() => config, [ + JSON.stringify(config.transition), + config.transformPagePoint, + config.reducedMotion, + config.skipAnimations, + config.isValidProp, + ]); + return (jsx(MotionConfigContext.Provider, { value: context, children: children })); + } + + const ReorderContext = React$1.createContext(null); + + /** + * We keep these listed separately as we use the lowercase tag names as part + * of the runtime bundle to detect SVG components + */ + const lowercaseSVGElements = [ + "animate", + "circle", + "defs", + "desc", + "ellipse", + "g", + "image", + "line", + "filter", + "marker", + "mask", + "metadata", + "path", + "pattern", + "polygon", + "polyline", + "rect", + "stop", + "switch", + "symbol", + "svg", + "text", + "tspan", + "use", + "view", + ]; + + function isSVGComponent(Component) { + if ( + /** + * If it's not a string, it's a custom React component. Currently we only support + * HTML custom React components. + */ + typeof Component !== "string" || + /** + * If it contains a dash, the element is a custom HTML webcomponent. + */ + Component.includes("-")) { + return false; + } + else if ( + /** + * If it's in our list of lowercase SVG tags, it's an SVG component + */ + lowercaseSVGElements.indexOf(Component) > -1 || + /** + * If it contains a capital letter, it's an SVG component + */ + /[A-Z]/u.test(Component)) { + return true; + } + return false; + } + + const createDomVisualElement = (Component, options) => { + /** + * Use explicit isSVG override if provided, otherwise auto-detect + */ + const isSVG = options.isSVG ?? isSVGComponent(Component); + return isSVG + ? new SVGVisualElement(options) + : new HTMLVisualElement(options, { + allowProjection: Component !== React$1.Fragment, + }); + }; + + const MotionContext = /* @__PURE__ */ React$1.createContext({}); + + function getCurrentTreeVariants(props, context) { + if (isControllingVariants(props)) { + const { initial, animate } = props; + return { + initial: initial === false || isVariantLabel(initial) + ? initial + : undefined, + animate: isVariantLabel(animate) ? animate : undefined, + }; + } + return props.inherit !== false ? context : {}; + } + + function useCreateMotionContext(props) { + const { initial, animate } = getCurrentTreeVariants(props, React$1.useContext(MotionContext)); + return React$1.useMemo(() => ({ initial, animate }), [variantLabelsAsDependency(initial), variantLabelsAsDependency(animate)]); + } + function variantLabelsAsDependency(prop) { + return Array.isArray(prop) ? prop.join(" ") : prop; + } + + const createHtmlRenderState = () => ({ + style: {}, + transform: {}, + transformOrigin: {}, + vars: {}, + }); + + function copyRawValuesOnly(target, source, props) { + for (const key in source) { + if (!isMotionValue(source[key]) && !isForcedMotionValue(key, props)) { + target[key] = source[key]; + } + } + } + function useInitialMotionValues({ transformTemplate }, visualState) { + return React$1.useMemo(() => { + const state = createHtmlRenderState(); + buildHTMLStyles(state, visualState, transformTemplate); + return Object.assign({}, state.vars, state.style); + }, [visualState]); + } + function useStyle(props, visualState) { + const styleProp = props.style || {}; + const style = {}; + /** + * Copy non-Motion Values straight into style + */ + copyRawValuesOnly(style, styleProp, props); + Object.assign(style, useInitialMotionValues(props, visualState)); + return style; + } + function useHTMLProps(props, visualState) { + // The `any` isn't ideal but it is the type of createElement props argument + const htmlProps = {}; + const style = useStyle(props, visualState); + if (props.drag && props.dragListener !== false) { + // Disable the ghost element when a user drags + htmlProps.draggable = false; + // Disable text selection + style.userSelect = + style.WebkitUserSelect = + style.WebkitTouchCallout = + "none"; + // Disable scrolling on the draggable direction + style.touchAction = + props.drag === true + ? "none" + : `pan-${props.drag === "x" ? "y" : "x"}`; + } + if (props.tabIndex === undefined && + (props.onTap || props.onTapStart || props.whileTap)) { + htmlProps.tabIndex = 0; + } + htmlProps.style = style; + return htmlProps; + } + + const createSvgRenderState = () => ({ + ...createHtmlRenderState(), + attrs: {}, + }); + + function useSVGProps(props, visualState, _isStatic, Component) { + const visualProps = React$1.useMemo(() => { + const state = createSvgRenderState(); + buildSVGAttrs(state, visualState, isSVGTag(Component), props.transformTemplate, props.style); + return { + ...state.attrs, + style: { ...state.style }, + }; + }, [visualState]); + if (props.style) { + const rawStyles = {}; + copyRawValuesOnly(rawStyles, props.style, props); + visualProps.style = { ...rawStyles, ...visualProps.style }; + } + return visualProps; + } + + /** + * A list of all valid MotionProps. + * + * @privateRemarks + * This doesn't throw if a `MotionProp` name is missing - it should. + */ + const validMotionProps = new Set([ + "animate", + "exit", + "variants", + "initial", + "style", + "values", + "variants", + "transition", + "transformTemplate", + "custom", + "inherit", + "onBeforeLayoutMeasure", + "onAnimationStart", + "onAnimationComplete", + "onUpdate", + "onDragStart", + "onDrag", + "onDragEnd", + "onMeasureDragConstraints", + "onDirectionLock", + "onDragTransitionEnd", + "_dragX", + "_dragY", + "onHoverStart", + "onHoverEnd", + "onViewportEnter", + "onViewportLeave", + "globalTapTarget", + "propagate", + "ignoreStrict", + "viewport", + ]); + /** + * Check whether a prop name is a valid `MotionProp` key. + * + * @param key - Name of the property to check + * @returns `true` is key is a valid `MotionProp`. + * + * @public + */ + function isValidMotionProp(key) { + return (key.startsWith("while") || + (key.startsWith("drag") && key !== "draggable") || + key.startsWith("layout") || + key.startsWith("onTap") || + key.startsWith("onPan") || + key.startsWith("onLayout") || + validMotionProps.has(key)); + } + + function shouldForward(key, isValidProp) { + return key.startsWith("on") + ? !isValidMotionProp(key) + : isValidProp?.(key) ?? !isValidMotionProp(key); + } + function filterProps(props, isDom, forwardMotionProps, isValidProp) { + const filteredProps = {}; + for (const key in props) { + /** + * values is considered a valid prop by Emotion, so if it's present + * this will be rendered out to the DOM unless explicitly filtered. + * + * We check the type as it could be used with the `feColorMatrix` + * element, which we support. + */ + if (key === "values" && typeof props.values === "object") + continue; + if (isMotionValue(props[key])) + continue; + if (shouldForward(key, isValidProp) || + (forwardMotionProps === true && isValidMotionProp(key)) || + (!isDom && !isValidMotionProp(key)) || + // If trying to use native HTML drag events, forward drag listeners + (props["draggable"] && + key.startsWith("onDrag"))) { + filteredProps[key] = + props[key]; + } + } + return filteredProps; + } + + function useRender(Component, props, ref, { latestValues, }, isStatic, forwardMotionProps = false, isSVG, isValidProp) { + const useVisualProps = (isSVG ?? isSVGComponent(Component)) ? useSVGProps : useHTMLProps; + const visualProps = useVisualProps(props, latestValues, isStatic, Component); + const filteredProps = filterProps(props, typeof Component === "string", forwardMotionProps, isValidProp); + const elementProps = Component !== React$1.Fragment ? { ...filteredProps, ...visualProps, ref } : {}; + /** + * If component has been handed a motion value as its child, + * memoise its initial value and render that. Subsequent updates + * will be handled by the onChange handler + */ + const { children } = props; + const renderedChildren = React$1.useMemo(() => (isMotionValue(children) ? children.get() : children), [children]); + return React$1.createElement(Component, { + ...elementProps, + children: renderedChildren, + }); + } + + function makeState({ scrapeMotionValuesFromProps, createRenderState, }, props, context, presenceContext) { + const state = { + latestValues: makeLatestValues(props, context, presenceContext, scrapeMotionValuesFromProps), + renderState: createRenderState(), + }; + return state; + } + function makeLatestValues(props, context, presenceContext, scrapeMotionValues) { + const values = {}; + const motionValues = scrapeMotionValues(props, {}); + for (const key in motionValues) { + values[key] = resolveMotionValue(motionValues[key]); + } + let { initial, animate } = props; + const isControllingVariants$1 = isControllingVariants(props); + const isVariantNode$1 = isVariantNode(props); + if (context && + isVariantNode$1 && + !isControllingVariants$1 && + props.inherit !== false) { + if (initial === undefined) + initial = context.initial; + if (animate === undefined) + animate = context.animate; + } + let isInitialAnimationBlocked = presenceContext + ? presenceContext.initial === false + : false; + isInitialAnimationBlocked = isInitialAnimationBlocked || initial === false; + const variantToSet = isInitialAnimationBlocked ? animate : initial; + if (variantToSet && + typeof variantToSet !== "boolean" && + !isAnimationControls(variantToSet)) { + const list = Array.isArray(variantToSet) ? variantToSet : [variantToSet]; + for (let i = 0; i < list.length; i++) { + const resolved = resolveVariantFromProps(props, list[i]); + if (resolved) { + const { transitionEnd, transition, ...target } = resolved; + for (const key in target) { + let valueTarget = target[key]; + if (Array.isArray(valueTarget)) { + /** + * Take final keyframe if the initial animation is blocked because + * we want to initialise at the end of that blocked animation. + */ + const index = isInitialAnimationBlocked + ? valueTarget.length - 1 + : 0; + valueTarget = valueTarget[index]; + } + if (valueTarget !== null) { + values[key] = valueTarget; + } + } + for (const key in transitionEnd) { + values[key] = transitionEnd[key]; + } + } + } + } + return values; + } + const makeUseVisualState = (config) => (props, isStatic) => { + const context = React$1.useContext(MotionContext); + const presenceContext = React$1.useContext(PresenceContext); + const make = () => makeState(config, props, context, presenceContext); + return isStatic ? make() : useConstant(make); + }; + + const useHTMLVisualState = /*@__PURE__*/ makeUseVisualState({ + scrapeMotionValuesFromProps: scrapeMotionValuesFromProps$1, + createRenderState: createHtmlRenderState, + }); + + const useSVGVisualState = /*@__PURE__*/ makeUseVisualState({ + scrapeMotionValuesFromProps: scrapeMotionValuesFromProps, + createRenderState: createSvgRenderState, + }); + + const motionComponentSymbol = Symbol.for("motionComponentSymbol"); + + /** + * Creates a ref function that, when called, hydrates the provided + * external ref and VisualElement. + */ + function useMotionRef(visualState, visualElement, externalRef) { + /** + * Store externalRef in a ref to avoid including it in the useCallback + * dependency array. Including externalRef in dependencies causes issues + * with libraries like Radix UI that create new callback refs on each render + * when using asChild - this would cause the callback to be recreated, + * triggering element remounts and breaking AnimatePresence exit animations. + */ + const externalRefContainer = React$1.useRef(externalRef); + React$1.useInsertionEffect(() => { + externalRefContainer.current = externalRef; + }); + // Store cleanup function returned by callback refs (React 19 feature) + const refCleanup = React$1.useRef(null); + return React$1.useCallback((instance) => { + if (instance) { + visualState.onMount?.(instance); + } + if (visualElement) { + instance ? visualElement.mount(instance) : visualElement.unmount(); + } + const ref = externalRefContainer.current; + if (typeof ref === "function") { + if (instance) { + const cleanup = ref(instance); + if (typeof cleanup === "function") { + refCleanup.current = cleanup; + } + } + else if (refCleanup.current) { + refCleanup.current(); + refCleanup.current = null; + } + else { + ref(instance); + } + } + else if (ref) { + ref.current = instance; + } + }, [visualElement]); + } + + /** + * Internal, exported only for usage in Framer + */ + const SwitchLayoutGroupContext = React$1.createContext({}); + + function isRefObject(ref) { + return (ref && + typeof ref === "object" && + Object.prototype.hasOwnProperty.call(ref, "current")); + } + + function useVisualElement(Component, visualState, props, createVisualElement, ProjectionNodeConstructor, isSVG) { + const { visualElement: parent } = React$1.useContext(MotionContext); + const lazyContext = React$1.useContext(LazyContext); + const presenceContext = React$1.useContext(PresenceContext); + const motionConfig = React$1.useContext(MotionConfigContext); + const reducedMotionConfig = motionConfig.reducedMotion; + const skipAnimations = motionConfig.skipAnimations; + const visualElementRef = React$1.useRef(null); + /** + * Track whether the component has been through React's commit phase. + * Used to detect when LazyMotion features load after the component has mounted. + */ + const hasMountedOnce = React$1.useRef(false); + /** + * If we haven't preloaded a renderer, check to see if we have one lazy-loaded + */ + createVisualElement = + createVisualElement || + lazyContext.renderer; + if (!visualElementRef.current && createVisualElement) { + visualElementRef.current = createVisualElement(Component, { + visualState, + parent, + props, + presenceContext, + blockInitialAnimation: presenceContext + ? presenceContext.initial === false + : false, + reducedMotionConfig, + skipAnimations, + isSVG, + }); + /** + * If the component has already mounted before features loaded (e.g. via + * LazyMotion with async feature loading), we need to force the initial + * animation to run. Otherwise state changes that occurred before features + * loaded will be lost and the element will snap to its final state. + */ + if (hasMountedOnce.current && visualElementRef.current) { + visualElementRef.current.manuallyAnimateOnMount = true; + } + } + const visualElement = visualElementRef.current; + /** + * Load Motion gesture and animation features. These are rendered as renderless + * components so each feature can optionally make use of React lifecycle methods. + */ + const initialLayoutGroupConfig = React$1.useContext(SwitchLayoutGroupContext); + if (visualElement && + !visualElement.projection && + ProjectionNodeConstructor && + (visualElement.type === "html" || visualElement.type === "svg")) { + createProjectionNode(visualElementRef.current, props, ProjectionNodeConstructor, initialLayoutGroupConfig); + } + const isMounted = React$1.useRef(false); + React$1.useInsertionEffect(() => { + /** + * Check the component has already mounted before calling + * `update` unnecessarily. This ensures we skip the initial update. + */ + if (visualElement && isMounted.current) { + visualElement.update(props, presenceContext); + } + }); + /** + * Cache this value as we want to know whether HandoffAppearAnimations + * was present on initial render - it will be deleted after this. + */ + const optimisedAppearId = props[optimizedAppearDataAttribute]; + const wantsHandoff = React$1.useRef(Boolean(optimisedAppearId) && + typeof window !== "undefined" && + !window.MotionHandoffIsComplete?.(optimisedAppearId) && + window.MotionHasOptimisedAnimation?.(optimisedAppearId)); + useIsomorphicLayoutEffect(() => { + /** + * Track that this component has mounted. This is used to detect when + * LazyMotion features load after the component has already committed. + */ + hasMountedOnce.current = true; + if (!visualElement) + return; + isMounted.current = true; + window.MotionIsMounted = true; + visualElement.updateFeatures(); + visualElement.scheduleRenderMicrotask(); + /** + * Ideally this function would always run in a useEffect. + * + * However, if we have optimised appear animations to handoff from, + * it needs to happen synchronously to ensure there's no flash of + * incorrect styles in the event of a hydration error. + * + * So if we detect a situtation where optimised appear animations + * are running, we use useLayoutEffect to trigger animations. + */ + if (wantsHandoff.current && visualElement.animationState) { + visualElement.animationState.animateChanges(); + } + }); + React$1.useEffect(() => { + if (!visualElement) + return; + if (!wantsHandoff.current && visualElement.animationState) { + visualElement.animationState.animateChanges(); + } + if (wantsHandoff.current) { + // This ensures all future calls to animateChanges() in this component will run in useEffect + queueMicrotask(() => { + window.MotionHandoffMarkAsComplete?.(optimisedAppearId); + }); + wantsHandoff.current = false; + } + /** + * Now we've finished triggering animations for this element we + * can wipe the enteringChildren set for the next render. + */ + visualElement.enteringChildren = undefined; + }); + return visualElement; + } + function createProjectionNode(visualElement, props, ProjectionNodeConstructor, initialPromotionConfig) { + const { layoutId, layout, drag, dragConstraints, layoutScroll, layoutRoot, layoutAnchor, layoutCrossfade, } = props; + visualElement.projection = new ProjectionNodeConstructor(visualElement.latestValues, props["data-framer-portal-id"] + ? undefined + : getClosestProjectingNode(visualElement.parent)); + visualElement.projection.setOptions({ + layoutId, + layout, + alwaysMeasureLayout: Boolean(drag) || (dragConstraints && isRefObject(dragConstraints)), + visualElement, + /** + * TODO: Update options in an effect. This could be tricky as it'll be too late + * to update by the time layout animations run. + * We also need to fix this safeToRemove by linking it up to the one returned by usePresence, + * ensuring it gets called if there's no potential layout animations. + * + */ + animationType: typeof layout === "string" ? layout : "both", + initialPromotionConfig, + crossfade: layoutCrossfade, + layoutScroll, + layoutRoot, + layoutAnchor, + }); + } + function getClosestProjectingNode(visualElement) { + if (!visualElement) + return undefined; + return visualElement.options.allowProjection !== false + ? visualElement.projection + : getClosestProjectingNode(visualElement.parent); + } + + /** + * Create a `motion` component. + * + * This function accepts a Component argument, which can be either a string (ie "div" + * for `motion.div`), or an actual React component. + * + * Alongside this is a config option which provides a way of rendering the provided + * component "offline", or outside the React render cycle. + */ + function createMotionComponent(Component, { forwardMotionProps = false, type } = {}, preloadedFeatures, createVisualElement) { + preloadedFeatures && loadFeatures(preloadedFeatures); + /** + * Determine whether to use SVG or HTML rendering based on: + * 1. Explicit `type` option (highest priority) + * 2. Auto-detection via `isSVGComponent` + */ + const isSVG = type ? type === "svg" : isSVGComponent(Component); + const useVisualState = isSVG ? useSVGVisualState : useHTMLVisualState; + function MotionDOMComponent(props, externalRef) { + /** + * If we need to measure the element we load this functionality in a + * separate class component in order to gain access to getSnapshotBeforeUpdate. + */ + let MeasureLayout; + const configAndProps = { + ...React$1.useContext(MotionConfigContext), + ...props, + layoutId: useLayoutId(props), + }; + const { isStatic, isValidProp } = configAndProps; + const context = useCreateMotionContext(props); + const visualState = useVisualState(props, isStatic); + if (!isStatic && typeof window !== "undefined") { + useStrictMode(configAndProps, preloadedFeatures); + const layoutProjection = getProjectionFunctionality(configAndProps); + MeasureLayout = layoutProjection.MeasureLayout; + /** + * Create a VisualElement for this component. A VisualElement provides a common + * interface to renderer-specific APIs (ie DOM/Three.js etc) as well as + * providing a way of rendering to these APIs outside of the React render loop + * for more performant animations and interactions + */ + context.visualElement = useVisualElement(Component, visualState, configAndProps, createVisualElement, layoutProjection.ProjectionNode, isSVG); + } + /** + * The mount order and hierarchy is specific to ensure our element ref + * is hydrated by the time features fire their effects. + */ + return (jsxs(MotionContext.Provider, { value: context, children: [MeasureLayout && context.visualElement ? (jsx(MeasureLayout, { visualElement: context.visualElement, ...configAndProps })) : null, useRender(Component, props, useMotionRef(visualState, context.visualElement, externalRef), visualState, isStatic, forwardMotionProps, isSVG, isValidProp)] })); + } + MotionDOMComponent.displayName = `motion.${typeof Component === "string" + ? Component + : `create(${Component.displayName ?? Component.name ?? ""})`}`; + const ForwardRefMotionComponent = React$1.forwardRef(MotionDOMComponent); + ForwardRefMotionComponent[motionComponentSymbol] = Component; + return ForwardRefMotionComponent; + } + function useLayoutId({ layoutId }) { + const layoutGroupId = React$1.useContext(LayoutGroupContext).id; + return layoutGroupId && layoutId !== undefined + ? layoutGroupId + "-" + layoutId + : layoutId; + } + function useStrictMode(configAndProps, preloadedFeatures) { + const isStrict = React$1.useContext(LazyContext).strict; + /** + * If we're in development mode, check to make sure we're not rendering a motion component + * as a child of LazyMotion, as this will break the file-size benefits of using it. + */ + if (preloadedFeatures && + isStrict) { + const strictMessage = "You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead."; + configAndProps.ignoreStrict + ? exports.warning(false, strictMessage, "lazy-strict-mode") + : exports.invariant(false, strictMessage, "lazy-strict-mode"); + } + } + function getProjectionFunctionality(props) { + const featureDefinitions = getInitializedFeatureDefinitions(); + const { drag, layout } = featureDefinitions; + if (!drag && !layout) + return {}; + const combined = { ...drag, ...layout }; + return { + MeasureLayout: drag?.isEnabled(props) || layout?.isEnabled(props) + ? combined.MeasureLayout + : undefined, + ProjectionNode: combined.ProjectionNode, + }; + } + + function createMotionProxy(preloadedFeatures, createVisualElement) { + if (typeof Proxy === "undefined") { + return createMotionComponent; + } + /** + * A cache of generated `motion` components, e.g `motion.div`, `motion.input` etc. + * Rather than generating them anew every render. + */ + const componentCache = new Map(); + const factory = (Component, options) => { + return createMotionComponent(Component, options, preloadedFeatures, createVisualElement); + }; + /** + * Support for deprecated`motion(Component)` pattern + */ + const deprecatedFactoryFunction = (Component, options) => { + { + warnOnce(false, "motion() is deprecated. Use motion.create() instead."); + } + return factory(Component, options); + }; + return new Proxy(deprecatedFactoryFunction, { + /** + * Called when `motion` is referenced with a prop: `motion.div`, `motion.input` etc. + * The prop name is passed through as `key` and we can use that to generate a `motion` + * DOM component with that name. + */ + get: (_target, key) => { + if (key === "create") + return factory; + /** + * If this element doesn't exist in the component cache, create it and cache. + */ + if (!componentCache.has(key)) { + componentCache.set(key, createMotionComponent(key, undefined, preloadedFeatures, createVisualElement)); + } + return componentCache.get(key); + }, + }); + } + + class AnimationFeature extends Feature { + /** + * We dynamically generate the AnimationState manager as it contains a reference + * to the underlying animation library. We only want to load that if we load this, + * so people can optionally code split it out using the `m` component. + */ + constructor(node) { + super(node); + node.animationState || (node.animationState = createAnimationState(node)); + } + updateAnimationControlsSubscription() { + const { animate } = this.node.getProps(); + if (isAnimationControls(animate)) { + this.unmountControls = animate.subscribe(this.node); + } + } + /** + * Subscribe any provided AnimationControls to the component's VisualElement + */ + mount() { + this.updateAnimationControlsSubscription(); + } + update() { + const { animate } = this.node.getProps(); + const { animate: prevAnimate } = this.node.prevProps || {}; + if (animate !== prevAnimate) { + this.updateAnimationControlsSubscription(); + } + } + unmount() { + this.node.animationState.reset(); + this.unmountControls?.(); + } + } + + let id$1 = 0; + class ExitAnimationFeature extends Feature { + constructor() { + super(...arguments); + this.id = id$1++; + this.isExitComplete = false; + } + update() { + if (!this.node.presenceContext) + return; + const { isPresent, onExitComplete } = this.node.presenceContext; + const { isPresent: prevIsPresent } = this.node.prevPresenceContext || {}; + if (!this.node.animationState || isPresent === prevIsPresent) { + return; + } + if (isPresent && prevIsPresent === false) { + /** + * When re-entering, if the exit animation already completed + * (element is at rest), reset to initial values so the enter + * animation replays from the correct position. + */ + if (this.isExitComplete) { + const { initial, custom } = this.node.getProps(); + if (typeof initial === "string" || + (typeof initial === "object" && + initial !== null && + !Array.isArray(initial))) { + const resolved = resolveVariant(this.node, initial, custom); + if (resolved) { + const { transition, transitionEnd, ...target } = resolved; + for (const key in target) { + this.node + .getValue(key) + ?.jump(target[key]); + } + } + } + this.node.animationState.reset(); + this.node.animationState.animateChanges(); + } + else { + this.node.animationState.setActive("exit", false); + } + this.isExitComplete = false; + return; + } + const exitAnimation = this.node.animationState.setActive("exit", !isPresent); + if (onExitComplete && !isPresent) { + exitAnimation.then(() => { + this.isExitComplete = true; + onExitComplete(this.id); + }); + } + } + mount() { + const { register, onExitComplete } = this.node.presenceContext || {}; + if (onExitComplete) { + onExitComplete(this.id); + } + if (register) { + this.unmount = register(this.id); + } + } + unmount() { } + } + + const animations = { + animation: { + Feature: AnimationFeature, + }, + exit: { + Feature: ExitAnimationFeature, + }, + }; + + function extractEventInfo(event) { + return { + point: { + x: event.pageX, + y: event.pageY, + }, + }; + } + const addPointerInfo = (handler) => (event) => isPrimaryPointer(event) && handler(event, extractEventInfo(event)); + + function addPointerEvent(target, eventName, handler, options) { + return addDomEvent(target, eventName, addPointerInfo(handler), options); + } + + // Fixes https://github.com/motiondivision/motion/issues/2270 + const getContextWindow = ({ current }) => { + return current ? current.ownerDocument.defaultView : null; + }; + + const distance = (a, b) => Math.abs(a - b); + function distance2D(a, b) { + // Multi-dimensional + const xDelta = distance(a.x, b.x); + const yDelta = distance(a.y, b.y); + return Math.sqrt(xDelta ** 2 + yDelta ** 2); + } + + const overflowStyles$1 = /*#__PURE__*/ new Set(["auto", "scroll"]); + /** + * @internal + */ + class PanSession { + constructor(event, handlers, { transformPagePoint, contextWindow = window, dragSnapToOrigin = false, distanceThreshold = 3, element, } = {}) { + /** + * @internal + */ + this.startEvent = null; + /** + * @internal + */ + this.lastMoveEvent = null; + /** + * @internal + */ + this.lastMoveEventInfo = null; + /** + * Raw (untransformed) event info, re-transformed each frame + * so transformPagePoint sees the current parent matrix. + * @internal + */ + this.lastRawMoveEventInfo = null; + /** + * @internal + */ + this.handlers = {}; + /** + * @internal + */ + this.contextWindow = window; + /** + * Scroll positions of scrollable ancestors and window. + * @internal + */ + this.scrollPositions = new Map(); + /** + * Cleanup function for scroll listeners. + * @internal + */ + this.removeScrollListeners = null; + this.onElementScroll = (event) => { + this.handleScroll(event.target); + }; + this.onWindowScroll = () => { + this.handleScroll(window); + }; + this.updatePoint = () => { + if (!(this.lastMoveEvent && this.lastMoveEventInfo)) + return; + // Re-transform raw point through current transformPagePoint so + // animated parent transforms (e.g. rotation) are picked up each frame + if (this.lastRawMoveEventInfo) { + this.lastMoveEventInfo = transformPoint(this.lastRawMoveEventInfo, this.transformPagePoint); + } + const info = getPanInfo(this.lastMoveEventInfo, this.history); + const isPanStarted = this.startEvent !== null; + // Only start panning if the offset is larger than 3 pixels. If we make it + // any larger than this we'll want to reset the pointer history + // on the first update to avoid visual snapping to the cursor. + const isDistancePastThreshold = distance2D(info.offset, { x: 0, y: 0 }) >= this.distanceThreshold; + if (!isPanStarted && !isDistancePastThreshold) + return; + const { point } = info; + const { timestamp } = frameData; + this.history.push({ ...point, timestamp }); + const { onStart, onMove } = this.handlers; + if (!isPanStarted) { + onStart && onStart(this.lastMoveEvent, info); + this.startEvent = this.lastMoveEvent; + } + onMove && onMove(this.lastMoveEvent, info); + }; + this.handlePointerMove = (event, info) => { + this.lastMoveEvent = event; + this.lastRawMoveEventInfo = info; + this.lastMoveEventInfo = transformPoint(info, this.transformPagePoint); + // Throttle mouse move event to once per frame + frame.update(this.updatePoint, true); + }; + this.handlePointerUp = (event, info) => { + this.end(); + const { onEnd, onSessionEnd, resumeAnimation } = this.handlers; + // Resume animation if dragSnapToOrigin is set OR if no drag started (user just clicked) + // This ensures constraint animations continue when interrupted by a click + if (this.dragSnapToOrigin || !this.startEvent) { + resumeAnimation && resumeAnimation(); + } + if (!(this.lastMoveEvent && this.lastMoveEventInfo)) + return; + const panInfo = getPanInfo(event.type === "pointercancel" + ? this.lastMoveEventInfo + : transformPoint(info, this.transformPagePoint), this.history); + if (this.startEvent && onEnd) { + onEnd(event, panInfo); + } + onSessionEnd && onSessionEnd(event, panInfo); + }; + // If we have more than one touch, don't start detecting this gesture + if (!isPrimaryPointer(event)) + return; + this.dragSnapToOrigin = dragSnapToOrigin; + this.handlers = handlers; + this.transformPagePoint = transformPagePoint; + this.distanceThreshold = distanceThreshold; + this.contextWindow = contextWindow || window; + const info = extractEventInfo(event); + const initialInfo = transformPoint(info, this.transformPagePoint); + const { point } = initialInfo; + const { timestamp } = frameData; + this.history = [{ ...point, timestamp }]; + const { onSessionStart } = handlers; + onSessionStart && + onSessionStart(event, getPanInfo(initialInfo, this.history)); + // Listen in the capture phase so a descendant calling + // stopPropagation() (e.g. in its own pointerup handler) can't + // prevent the gesture from ending. See #2794. + const eventOptions = { passive: true, capture: true }; + this.removeListeners = pipe(addPointerEvent(this.contextWindow, "pointermove", this.handlePointerMove, eventOptions), addPointerEvent(this.contextWindow, "pointerup", this.handlePointerUp, eventOptions), addPointerEvent(this.contextWindow, "pointercancel", this.handlePointerUp, eventOptions)); + // Start scroll tracking if element provided + if (element) { + this.startScrollTracking(element); + } + } + /** + * Start tracking scroll on ancestors and window. + */ + startScrollTracking(element) { + // Store initial scroll positions for scrollable ancestors + let current = element.parentElement; + while (current) { + const style = getComputedStyle(current); + if (overflowStyles$1.has(style.overflowX) || + overflowStyles$1.has(style.overflowY)) { + this.scrollPositions.set(current, { + x: current.scrollLeft, + y: current.scrollTop, + }); + } + current = current.parentElement; + } + // Track window scroll + this.scrollPositions.set(window, { + x: window.scrollX, + y: window.scrollY, + }); + // Capture listener catches element scroll events as they bubble + window.addEventListener("scroll", this.onElementScroll, { + capture: true, + }); + // Direct window scroll listener (window scroll doesn't bubble) + window.addEventListener("scroll", this.onWindowScroll); + this.removeScrollListeners = () => { + window.removeEventListener("scroll", this.onElementScroll, { + capture: true, + }); + window.removeEventListener("scroll", this.onWindowScroll); + }; + } + /** + * Handle scroll compensation during drag. + * + * For element scroll: adjusts history origin since pageX/pageY doesn't change. + * For window scroll: adjusts lastMoveEventInfo since pageX/pageY would change. + */ + handleScroll(target) { + const initial = this.scrollPositions.get(target); + if (!initial) + return; + const isWindow = target === window; + const current = isWindow + ? { x: window.scrollX, y: window.scrollY } + : { + x: target.scrollLeft, + y: target.scrollTop, + }; + const delta = { x: current.x - initial.x, y: current.y - initial.y }; + if (delta.x === 0 && delta.y === 0) + return; + if (isWindow) { + // Window scroll: pageX/pageY changes, so update lastMoveEventInfo + if (this.lastMoveEventInfo) { + this.lastMoveEventInfo.point.x += delta.x; + this.lastMoveEventInfo.point.y += delta.y; + } + } + else { + // Element scroll: pageX/pageY unchanged, so adjust history origin + if (this.history.length > 0) { + this.history[0].x -= delta.x; + this.history[0].y -= delta.y; + } + } + this.scrollPositions.set(target, current); + frame.update(this.updatePoint, true); + } + updateHandlers(handlers) { + this.handlers = handlers; + } + end() { + this.removeListeners && this.removeListeners(); + this.removeScrollListeners && this.removeScrollListeners(); + this.scrollPositions.clear(); + cancelFrame(this.updatePoint); + } + } + function transformPoint(info, transformPagePoint) { + return transformPagePoint ? { point: transformPagePoint(info.point) } : info; + } + function subtractPoint(a, b) { + return { x: a.x - b.x, y: a.y - b.y }; + } + function getPanInfo({ point }, history) { + return { + point, + delta: subtractPoint(point, lastDevicePoint(history)), + offset: subtractPoint(point, startDevicePoint(history)), + velocity: getVelocity(history, 0.1), + }; + } + function startDevicePoint(history) { + return history[0]; + } + function lastDevicePoint(history) { + return history[history.length - 1]; + } + function getVelocity(history, timeDelta) { + if (history.length < 2) { + return { x: 0, y: 0 }; + } + let i = history.length - 1; + let timestampedPoint = null; + const lastPoint = lastDevicePoint(history); + while (i >= 0) { + timestampedPoint = history[i]; + if (lastPoint.timestamp - timestampedPoint.timestamp > + secondsToMilliseconds(timeDelta)) { + break; + } + i--; + } + if (!timestampedPoint) { + return { x: 0, y: 0 }; + } + /** + * If the selected point is the pointer-down origin (history[0]), + * there are better movement points available, and the time gap + * is suspiciously large (>2x timeDelta), use the next point instead. + * This prevents stale pointer-down points from diluting velocity + * in hold-then-flick gestures. + */ + if (timestampedPoint === history[0] && + history.length > 2 && + lastPoint.timestamp - timestampedPoint.timestamp > + secondsToMilliseconds(timeDelta) * 2) { + timestampedPoint = history[1]; + } + const time = millisecondsToSeconds(lastPoint.timestamp - timestampedPoint.timestamp); + if (time === 0) { + return { x: 0, y: 0 }; + } + const currentVelocity = { + x: (lastPoint.x - timestampedPoint.x) / time, + y: (lastPoint.y - timestampedPoint.y) / time, + }; + if (currentVelocity.x === Infinity) { + currentVelocity.x = 0; + } + if (currentVelocity.y === Infinity) { + currentVelocity.y = 0; + } + return currentVelocity; + } + + /** + * Apply constraints to a point. These constraints are both physical along an + * axis, and an elastic factor that determines how much to constrain the point + * by if it does lie outside the defined parameters. + */ + function applyConstraints(point, { min, max }, elastic) { + if (min !== undefined && point < min) { + // If we have a min point defined, and this is outside of that, constrain + point = elastic + ? mixNumber$1(min, point, elastic.min) + : Math.max(point, min); + } + else if (max !== undefined && point > max) { + // If we have a max point defined, and this is outside of that, constrain + point = elastic + ? mixNumber$1(max, point, elastic.max) + : Math.min(point, max); + } + return point; + } + /** + * Calculate constraints in terms of the viewport when defined relatively to the + * measured axis. This is measured from the nearest edge, so a max constraint of 200 + * on an axis with a max value of 300 would return a constraint of 500 - axis length + */ + function calcRelativeAxisConstraints(axis, min, max) { + return { + min: min !== undefined ? axis.min + min : undefined, + max: max !== undefined + ? axis.max + max - (axis.max - axis.min) + : undefined, + }; + } + /** + * Calculate constraints in terms of the viewport when + * defined relatively to the measured bounding box. + */ + function calcRelativeConstraints(layoutBox, { top, left, bottom, right }) { + return { + x: calcRelativeAxisConstraints(layoutBox.x, left, right), + y: calcRelativeAxisConstraints(layoutBox.y, top, bottom), + }; + } + /** + * Calculate viewport constraints when defined as another viewport-relative axis + */ + function calcViewportAxisConstraints(layoutAxis, constraintsAxis) { + let min = constraintsAxis.min - layoutAxis.min; + let max = constraintsAxis.max - layoutAxis.max; + // If the constraints axis is actually smaller than the layout axis then we can + // flip the constraints + if (constraintsAxis.max - constraintsAxis.min < + layoutAxis.max - layoutAxis.min) { + [min, max] = [max, min]; + } + return { min, max }; + } + /** + * Calculate viewport constraints when defined as another viewport-relative box + */ + function calcViewportConstraints(layoutBox, constraintsBox) { + return { + x: calcViewportAxisConstraints(layoutBox.x, constraintsBox.x), + y: calcViewportAxisConstraints(layoutBox.y, constraintsBox.y), + }; + } + /** + * Calculate a transform origin relative to the source axis, between 0-1, that results + * in an asthetically pleasing scale/transform needed to project from source to target. + */ + function calcOrigin(source, target) { + let origin = 0.5; + const sourceLength = calcLength(source); + const targetLength = calcLength(target); + if (targetLength > sourceLength) { + origin = progress(target.min, target.max - sourceLength, source.min); + } + else if (sourceLength > targetLength) { + origin = progress(source.min, source.max - targetLength, target.min); + } + return clamp(0, 1, origin); + } + /** + * Rebase the calculated viewport constraints relative to the layout.min point. + */ + function rebaseAxisConstraints(layout, constraints) { + const relativeConstraints = {}; + if (constraints.min !== undefined) { + relativeConstraints.min = constraints.min - layout.min; + } + if (constraints.max !== undefined) { + relativeConstraints.max = constraints.max - layout.min; + } + return relativeConstraints; + } + const defaultElastic = 0.35; + /** + * Accepts a dragElastic prop and returns resolved elastic values for each axis. + */ + function resolveDragElastic(dragElastic = defaultElastic) { + if (dragElastic === false) { + dragElastic = 0; + } + else if (dragElastic === true) { + dragElastic = defaultElastic; + } + return { + x: resolveAxisElastic(dragElastic, "left", "right"), + y: resolveAxisElastic(dragElastic, "top", "bottom"), + }; + } + function resolveAxisElastic(dragElastic, minLabel, maxLabel) { + return { + min: resolvePointElastic(dragElastic, minLabel), + max: resolvePointElastic(dragElastic, maxLabel), + }; + } + function resolvePointElastic(dragElastic, label) { + return typeof dragElastic === "number" + ? dragElastic + : dragElastic[label] || 0; + } + + const elementDragControls = new WeakMap(); + class VisualElementDragControls { + constructor(visualElement) { + this.openDragLock = null; + this.isDragging = false; + this.currentDirection = null; + this.originPoint = { x: 0, y: 0 }; + /** + * The permitted boundaries of travel, in pixels. + */ + this.constraints = false; + this.hasMutatedConstraints = false; + /** + * The per-axis resolved elastic values. + */ + this.elastic = createBox(); + /** + * The latest pointer event. Used as fallback when the `cancel` and `stop` functions are called without arguments. + */ + this.latestPointerEvent = null; + /** + * The latest pan info. Used as fallback when the `cancel` and `stop` functions are called without arguments. + */ + this.latestPanInfo = null; + this.visualElement = visualElement; + } + start(originEvent, { snapToCursor = false, distanceThreshold } = {}) { + /** + * Don't start dragging if this component is exiting + */ + const { presenceContext } = this.visualElement; + if (presenceContext && presenceContext.isPresent === false) + return; + const onSessionStart = (event) => { + if (snapToCursor) { + this.snapToCursor(extractEventInfo(event).point); + } + this.stopAnimation(); + }; + const onStart = (event, info) => { + // Attempt to grab the global drag gesture lock - maybe make this part of PanSession + const { drag, dragPropagation, onDragStart } = this.getProps(); + if (drag && !dragPropagation) { + if (this.openDragLock) + this.openDragLock(); + this.openDragLock = setDragLock(drag); + // If we don 't have the lock, don't start dragging + if (!this.openDragLock) + return; + } + this.latestPointerEvent = event; + this.latestPanInfo = info; + this.isDragging = true; + this.currentDirection = null; + this.resolveConstraints(); + if (this.visualElement.projection) { + this.visualElement.projection.isAnimationBlocked = true; + this.visualElement.projection.target = undefined; + } + /** + * Record gesture origin and pointer offset + */ + eachAxis((axis) => { + let current = this.getAxisMotionValue(axis).get() || 0; + /** + * If the MotionValue is a percentage value convert to px + */ + if (percent.test(current)) { + const { projection } = this.visualElement; + if (projection && projection.layout) { + const measuredAxis = projection.layout.layoutBox[axis]; + if (measuredAxis) { + const length = calcLength(measuredAxis); + current = length * (parseFloat(current) / 100); + } + } + } + this.originPoint[axis] = current; + }); + // Fire onDragStart event + if (onDragStart) { + frame.update(() => onDragStart(event, info), false, true); + } + addValueToWillChange(this.visualElement, "transform"); + const { animationState } = this.visualElement; + animationState && animationState.setActive("whileDrag", true); + }; + const onMove = (event, info) => { + this.latestPointerEvent = event; + this.latestPanInfo = info; + const { dragPropagation, dragDirectionLock, onDirectionLock, onDrag, } = this.getProps(); + // If we didn't successfully receive the gesture lock, early return. + if (!dragPropagation && !this.openDragLock) + return; + const { offset } = info; + // Attempt to detect drag direction if directionLock is true + if (dragDirectionLock && this.currentDirection === null) { + this.currentDirection = getCurrentDirection(offset); + // If we've successfully set a direction, notify listener + if (this.currentDirection !== null) { + onDirectionLock && onDirectionLock(this.currentDirection); + } + return; + } + // Update each point with the latest position + this.updateAxis("x", info.point, offset); + this.updateAxis("y", info.point, offset); + /** + * Ideally we would leave the renderer to fire naturally at the end of + * this frame but if the element is about to change layout as the result + * of a re-render we want to ensure the browser can read the latest + * bounding box to ensure the pointer and element don't fall out of sync. + */ + this.visualElement.render(); + /** + * This must fire after the render call as it might trigger a state + * change which itself might trigger a layout update. + */ + if (onDrag) { + frame.update(() => onDrag(event, info), false, true); + } + }; + const onSessionEnd = (event, info) => { + this.latestPointerEvent = event; + this.latestPanInfo = info; + this.stop(event, info); + this.latestPointerEvent = null; + this.latestPanInfo = null; + }; + const resumeAnimation = () => { + const { dragSnapToOrigin: snap } = this.getProps(); + if (snap || this.constraints) { + this.startAnimation({ x: 0, y: 0 }); + } + }; + const { dragSnapToOrigin } = this.getProps(); + this.panSession = new PanSession(originEvent, { + onSessionStart, + onStart, + onMove, + onSessionEnd, + resumeAnimation, + }, { + transformPagePoint: this.visualElement.getTransformPagePoint(), + dragSnapToOrigin, + distanceThreshold, + contextWindow: getContextWindow(this.visualElement), + element: this.visualElement.current, + }); + } + /** + * @internal + */ + stop(event, panInfo) { + const finalEvent = event || this.latestPointerEvent; + const finalPanInfo = panInfo || this.latestPanInfo; + const isDragging = this.isDragging; + this.cancel(); + if (!isDragging || !finalPanInfo || !finalEvent) + return; + const { velocity } = finalPanInfo; + this.startAnimation(velocity); + const { onDragEnd } = this.getProps(); + if (onDragEnd) { + frame.postRender(() => onDragEnd(finalEvent, finalPanInfo)); + } + } + /** + * @internal + */ + cancel() { + this.isDragging = false; + const { projection, animationState } = this.visualElement; + if (projection) { + projection.isAnimationBlocked = false; + } + this.endPanSession(); + const { dragPropagation } = this.getProps(); + if (!dragPropagation && this.openDragLock) { + this.openDragLock(); + this.openDragLock = null; + } + animationState && animationState.setActive("whileDrag", false); + } + /** + * Clean up the pan session without modifying other drag state. + * This is used during unmount to ensure event listeners are removed + * without affecting projection animations or drag locks. + * @internal + */ + endPanSession() { + this.panSession && this.panSession.end(); + this.panSession = undefined; + } + updateAxis(axis, _point, offset) { + const { drag } = this.getProps(); + // If we're not dragging this axis, do an early return. + if (!offset || !shouldDrag(axis, drag, this.currentDirection)) + return; + const axisValue = this.getAxisMotionValue(axis); + let next = this.originPoint[axis] + offset[axis]; + // Apply constraints + if (this.constraints && this.constraints[axis]) { + next = applyConstraints(next, this.constraints[axis], this.elastic[axis]); + } + axisValue.set(next); + } + resolveConstraints() { + const { dragConstraints, dragElastic } = this.getProps(); + const layout = this.visualElement.projection && + !this.visualElement.projection.layout + ? this.visualElement.projection.measure(false) + : this.visualElement.projection?.layout; + const prevConstraints = this.constraints; + if (dragConstraints && isRefObject(dragConstraints)) { + if (!this.constraints) { + this.constraints = this.resolveRefConstraints(); + } + } + else { + if (dragConstraints && layout) { + this.constraints = calcRelativeConstraints(layout.layoutBox, dragConstraints); + } + else { + this.constraints = false; + } + } + this.elastic = resolveDragElastic(dragElastic); + /** + * If we're outputting to external MotionValues, we want to rebase the measured constraints + * from viewport-relative to component-relative. This only applies to relative (non-ref) + * constraints, as ref-based constraints from calcViewportConstraints are already in the + * correct coordinate space for the motion value transform offset. + */ + if (prevConstraints !== this.constraints && + !isRefObject(dragConstraints) && + layout && + this.constraints && + !this.hasMutatedConstraints) { + eachAxis((axis) => { + if (this.constraints !== false && + this.getAxisMotionValue(axis)) { + this.constraints[axis] = rebaseAxisConstraints(layout.layoutBox[axis], this.constraints[axis]); + } + }); + } + } + resolveRefConstraints() { + const { dragConstraints: constraints, onMeasureDragConstraints } = this.getProps(); + if (!constraints || !isRefObject(constraints)) + return false; + const constraintsElement = constraints.current; + exports.invariant(constraintsElement !== null, "If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.", "drag-constraints-ref"); + const { projection } = this.visualElement; + // TODO + if (!projection || !projection.layout) + return false; + /** + * Refresh the root scroll offset so the constraint's viewport box + * translates to correct page coordinates. The scroll captured at + * drag mount can be stale if the document was scrolled afterwards — + * e.g. via the browser restoring scroll on refresh, or an ancestor + * layout effect running after this element's mount (#2829). + * + * Clear the cached scroll first so `updateScroll` bypasses its + * per-animationId cache and re-reads the live value. + */ + if (projection.root) { + projection.root.scroll = undefined; + projection.root.updateScroll(); + } + const constraintsBox = measurePageBox(constraintsElement, projection.root, this.visualElement.getTransformPagePoint()); + let measuredConstraints = calcViewportConstraints(projection.layout.layoutBox, constraintsBox); + /** + * If there's an onMeasureDragConstraints listener we call it and + * if different constraints are returned, set constraints to that + */ + if (onMeasureDragConstraints) { + const userConstraints = onMeasureDragConstraints(convertBoxToBoundingBox(measuredConstraints)); + this.hasMutatedConstraints = !!userConstraints; + if (userConstraints) { + measuredConstraints = convertBoundingBoxToBox(userConstraints); + } + } + return measuredConstraints; + } + startAnimation(velocity) { + const { drag, dragMomentum, dragElastic, dragTransition, dragSnapToOrigin, onDragTransitionEnd, } = this.getProps(); + const constraints = this.constraints || {}; + const momentumAnimations = eachAxis((axis) => { + if (!shouldDrag(axis, drag, this.currentDirection)) { + return; + } + let transition = (constraints && constraints[axis]) || {}; + if (dragSnapToOrigin === true || + dragSnapToOrigin === axis) + transition = { min: 0, max: 0 }; + /** + * Overdamp the boundary spring if `dragElastic` is disabled. There's still a frame + * of spring animations so we should look into adding a disable spring option to `inertia`. + * We could do something here where we affect the `bounceStiffness` and `bounceDamping` + * using the value of `dragElastic`. + */ + const bounceStiffness = dragElastic ? 200 : 1000000; + const bounceDamping = dragElastic ? 40 : 10000000; + const inertia = { + type: "inertia", + velocity: dragMomentum ? velocity[axis] : 0, + bounceStiffness, + bounceDamping, + timeConstant: 750, + restDelta: 1, + restSpeed: 10, + ...dragTransition, + ...transition, + }; + // If we're not animating on an externally-provided `MotionValue` we can use the + // component's animation controls which will handle interactions with whileHover (etc), + // otherwise we just have to animate the `MotionValue` itself. + return this.startAxisValueAnimation(axis, inertia); + }); + // Run all animations and then resolve the new drag constraints. + return Promise.all(momentumAnimations).then(onDragTransitionEnd); + } + startAxisValueAnimation(axis, transition) { + const axisValue = this.getAxisMotionValue(axis); + addValueToWillChange(this.visualElement, axis); + return axisValue.start(animateMotionValue(axis, axisValue, 0, transition, this.visualElement, false)); + } + stopAnimation() { + eachAxis((axis) => this.getAxisMotionValue(axis).stop()); + } + /** + * Drag works differently depending on which props are provided. + * + * - If _dragX and _dragY are provided, we output the gesture delta directly to those motion values. + * - Otherwise, we apply the delta to the x/y motion values. + */ + getAxisMotionValue(axis) { + const dragKey = `_drag${axis.toUpperCase()}`; + const props = this.visualElement.getProps(); + const externalMotionValue = props[dragKey]; + return externalMotionValue + ? externalMotionValue + : this.visualElement.getValue(axis, this.visualElement.latestValues[axis] ?? 0); + } + snapToCursor(point) { + eachAxis((axis) => { + const { drag } = this.getProps(); + // If we're not dragging this axis, do an early return. + if (!shouldDrag(axis, drag, this.currentDirection)) + return; + const { projection } = this.visualElement; + const axisValue = this.getAxisMotionValue(axis); + if (projection && projection.layout) { + const { min, max } = projection.layout.layoutBox[axis]; + /** + * The layout measurement includes the current transform value, + * so we need to add it back to get the correct snap position. + * This fixes an issue where elements with initial coordinates + * would snap to the wrong position on the first drag. + */ + const current = axisValue.get() || 0; + axisValue.set(point[axis] - mixNumber$1(min, max, 0.5) + current); + } + }); + } + /** + * When the viewport resizes we want to check if the measured constraints + * have changed and, if so, reposition the element within those new constraints + * relative to where it was before the resize. + */ + scalePositionWithinConstraints() { + if (!this.visualElement.current) + return; + const { drag, dragConstraints } = this.getProps(); + const { projection } = this.visualElement; + if (!isRefObject(dragConstraints) || !projection || !this.constraints) + return; + /** + * Stop current animations as there can be visual glitching if we try to do + * this mid-animation + */ + this.stopAnimation(); + /** + * Record the relative position of the dragged element relative to the + * constraints box and save as a progress value. + */ + const boxProgress = { x: 0, y: 0 }; + eachAxis((axis) => { + const axisValue = this.getAxisMotionValue(axis); + if (axisValue && this.constraints !== false) { + const latest = axisValue.get(); + boxProgress[axis] = calcOrigin({ min: latest, max: latest }, this.constraints[axis]); + } + }); + /** + * Update the layout of this element and resolve the latest drag constraints + */ + const { transformTemplate } = this.visualElement.getProps(); + this.visualElement.current.style.transform = transformTemplate + ? transformTemplate({}, "") + : "none"; + projection.root && projection.root.updateScroll(); + projection.updateLayout(); + /** + * Reset constraints so resolveConstraints() will recalculate them + * with the freshly measured layout rather than returning the cached value. + */ + this.constraints = false; + this.resolveConstraints(); + /** + * For each axis, calculate the current progress of the layout axis + * within the new constraints. + */ + eachAxis((axis) => { + if (!shouldDrag(axis, drag, null)) + return; + /** + * Calculate a new transform based on the previous box progress + */ + const axisValue = this.getAxisMotionValue(axis); + const { min, max } = this.constraints[axis]; + axisValue.set(mixNumber$1(min, max, boxProgress[axis])); + }); + /** + * Flush the updated transform to the DOM synchronously to prevent + * a visual flash at the element's CSS layout position (0,0) when + * the transform was stripped for measurement. + */ + this.visualElement.render(); + } + addListeners() { + if (!this.visualElement.current) + return; + elementDragControls.set(this.visualElement, this); + const element = this.visualElement.current; + /** + * Attach a pointerdown event listener on this DOM element to initiate drag tracking. + */ + const stopPointerListener = addPointerEvent(element, "pointerdown", (event) => { + const { drag, dragListener = true } = this.getProps(); + const target = event.target; + /** + * Only block drag if clicking on a text input child element + * (input, textarea, select, contenteditable) where users might + * want to select text or interact with the control. + * + * Buttons and links don't block drag since they don't have + * click-and-move actions of their own. + */ + const isClickingTextInputChild = target !== element && isElementTextInput(target); + if (drag && dragListener && !isClickingTextInputChild) { + this.start(event); + } + }); + /** + * If using ref-based constraints, observe both the draggable element + * and the constraint container for size changes via ResizeObserver. + * Setup is deferred because dragConstraints.current is null when + * addListeners first runs (React hasn't committed the ref yet). + */ + let stopResizeObservers; + const measureDragConstraints = () => { + const { dragConstraints } = this.getProps(); + if (isRefObject(dragConstraints) && dragConstraints.current) { + this.constraints = this.resolveRefConstraints(); + if (!stopResizeObservers) { + stopResizeObservers = startResizeObservers(element, dragConstraints.current, () => this.scalePositionWithinConstraints()); + } + } + }; + const { projection } = this.visualElement; + const stopMeasureLayoutListener = projection.addEventListener("measure", measureDragConstraints); + if (projection && !projection.layout) { + projection.root && projection.root.updateScroll(); + projection.updateLayout(); + } + frame.read(measureDragConstraints); + /** + * Attach a window resize listener to scale the draggable target within its defined + * constraints as the window resizes. + */ + const stopResizeListener = addDomEvent(window, "resize", () => this.scalePositionWithinConstraints()); + /** + * If the element's layout changes, calculate the delta and apply that to + * the drag gesture's origin point. + */ + const stopLayoutUpdateListener = projection.addEventListener("didUpdate", (({ delta, hasLayoutChanged }) => { + if (this.isDragging && hasLayoutChanged) { + eachAxis((axis) => { + const motionValue = this.getAxisMotionValue(axis); + if (!motionValue) + return; + this.originPoint[axis] += delta[axis].translate; + motionValue.set(motionValue.get() + delta[axis].translate); + }); + this.visualElement.render(); + } + })); + return () => { + stopResizeListener(); + stopPointerListener(); + stopMeasureLayoutListener(); + stopLayoutUpdateListener && stopLayoutUpdateListener(); + stopResizeObservers && stopResizeObservers(); + }; + } + getProps() { + const props = this.visualElement.getProps(); + const { drag = false, dragDirectionLock = false, dragPropagation = false, dragConstraints = false, dragElastic = defaultElastic, dragMomentum = true, } = props; + return { + ...props, + drag, + dragDirectionLock, + dragPropagation, + dragConstraints, + dragElastic, + dragMomentum, + }; + } + } + function skipFirstCall(callback) { + let isFirst = true; + return () => { + if (isFirst) { + isFirst = false; + return; + } + callback(); + }; + } + function startResizeObservers(element, constraintsElement, onResize) { + const stopElement = resize(element, skipFirstCall(onResize)); + const stopContainer = resize(constraintsElement, skipFirstCall(onResize)); + return () => { + stopElement(); + stopContainer(); + }; + } + function shouldDrag(direction, drag, currentDirection) { + return ((drag === true || drag === direction) && + (currentDirection === null || currentDirection === direction)); + } + /** + * Based on an x/y offset determine the current drag direction. If both axis' offsets are lower + * than the provided threshold, return `null`. + * + * @param offset - The x/y offset from origin. + * @param lockThreshold - (Optional) - the minimum absolute offset before we can determine a drag direction. + */ + function getCurrentDirection(offset, lockThreshold = 10) { + let direction = null; + if (Math.abs(offset.y) > lockThreshold) { + direction = "y"; + } + else if (Math.abs(offset.x) > lockThreshold) { + direction = "x"; + } + return direction; + } + + class DragGesture extends Feature { + constructor(node) { + super(node); + this.removeGroupControls = noop; + this.removeListeners = noop; + this.controls = new VisualElementDragControls(node); + } + mount() { + // If we've been provided a DragControls for manual control over the drag gesture, + // subscribe this component to it on mount. + const { dragControls } = this.node.getProps(); + if (dragControls) { + this.removeGroupControls = dragControls.subscribe(this.controls); + } + this.removeListeners = this.controls.addListeners() || noop; + } + update() { + const { dragControls } = this.node.getProps(); + const { dragControls: prevDragControls } = this.node.prevProps || {}; + if (dragControls !== prevDragControls) { + this.removeGroupControls(); + if (dragControls) { + this.removeGroupControls = dragControls.subscribe(this.controls); + } + } + } + unmount() { + this.removeGroupControls(); + this.removeListeners(); + /** + * In React 19, during list reorder reconciliation, components may + * briefly unmount and remount while the drag is still active. If we're + * actively dragging, we should NOT end the pan session - it will + * continue tracking pointer events via its window-level listeners. + * + * The pan session will be properly cleaned up when: + * 1. The drag ends naturally (pointerup/pointercancel) + * 2. The component is truly removed from the DOM + */ + if (!this.controls.isDragging) { + this.controls.endPanSession(); + } + } + } + + const asyncHandler = (handler) => (event, info) => { + if (handler) { + frame.update(() => handler(event, info), false, true); + } + }; + class PanGesture extends Feature { + constructor() { + super(...arguments); + this.removePointerDownListener = noop; + } + onPointerDown(pointerDownEvent) { + this.session = new PanSession(pointerDownEvent, this.createPanHandlers(), { + transformPagePoint: this.node.getTransformPagePoint(), + contextWindow: getContextWindow(this.node), + }); + } + createPanHandlers() { + const { onPanSessionStart, onPanStart, onPan, onPanEnd } = this.node.getProps(); + return { + onSessionStart: asyncHandler(onPanSessionStart), + onStart: asyncHandler(onPanStart), + onMove: asyncHandler(onPan), + onEnd: (event, info) => { + delete this.session; + if (onPanEnd) { + frame.postRender(() => onPanEnd(event, info)); + } + }, + }; + } + mount() { + this.removePointerDownListener = addPointerEvent(this.node.current, "pointerdown", (event) => this.onPointerDown(event)); + } + update() { + this.session && this.session.updateHandlers(this.createPanHandlers()); + } + unmount() { + this.removePointerDownListener(); + this.session && this.session.end(); + } + } + + /** + * Track whether we've taken any snapshots yet. If not, + * we can safely skip notification of didUpdate. + * + * Difficult to capture in a test but to prevent flickering + * we must set this to true either on update or unmount. + * Running `next-env/layout-id` in Safari will show this behaviour if broken. + */ + let hasTakenAnySnapshot = false; + class MeasureLayoutWithContext extends React$1.Component { + /** + * This only mounts projection nodes for components that + * need measuring, we might want to do it for all components + * in order to incorporate transforms + */ + componentDidMount() { + const { visualElement, layoutGroup, switchLayoutGroup, layoutId } = this.props; + const { projection } = visualElement; + if (projection) { + if (layoutGroup.group) + layoutGroup.group.add(projection); + if (switchLayoutGroup && switchLayoutGroup.register && layoutId) { + switchLayoutGroup.register(projection); + } + if (hasTakenAnySnapshot) { + projection.root.didUpdate(); + } + projection.addEventListener("animationComplete", () => { + this.safeToRemove(); + }); + projection.setOptions({ + ...projection.options, + layoutDependency: this.props.layoutDependency, + onExitComplete: () => this.safeToRemove(), + }); + } + globalProjectionState.hasEverUpdated = true; + } + getSnapshotBeforeUpdate(prevProps) { + const { layoutDependency, visualElement, drag, isPresent } = this.props; + const { projection } = visualElement; + if (!projection) + return null; + /** + * TODO: We use this data in relegate to determine whether to + * promote a previous element. There's no guarantee its presence data + * will have updated by this point - if a bug like this arises it will + * have to be that we markForRelegation and then find a new lead some other way, + * perhaps in didUpdate + */ + projection.isPresent = isPresent; + if (prevProps.layoutDependency !== layoutDependency) { + projection.setOptions({ + ...projection.options, + layoutDependency, + }); + } + hasTakenAnySnapshot = true; + if (drag || + prevProps.layoutDependency !== layoutDependency || + layoutDependency === undefined || + prevProps.isPresent !== isPresent) { + projection.willUpdate(); + } + else { + this.safeToRemove(); + } + if (prevProps.isPresent !== isPresent) { + if (isPresent) { + projection.promote(); + } + else if (!projection.relegate()) { + /** + * If there's another stack member taking over from this one, + * it's in charge of the exit animation and therefore should + * be in charge of the safe to remove. Otherwise we call it here. + */ + frame.postRender(() => { + const stack = projection.getStack(); + if (!stack || !stack.members.length) { + this.safeToRemove(); + } + }); + } + } + return null; + } + componentDidUpdate() { + const { visualElement, layoutAnchor } = this.props; + const { projection } = visualElement; + if (projection) { + projection.options.layoutAnchor = layoutAnchor; + projection.root.didUpdate(); + microtask.postRender(() => { + if (!projection.currentAnimation && projection.isLead()) { + this.safeToRemove(); + } + }); + } + } + componentWillUnmount() { + const { visualElement, layoutGroup, switchLayoutGroup: promoteContext, } = this.props; + const { projection } = visualElement; + hasTakenAnySnapshot = true; + if (projection) { + projection.scheduleCheckAfterUnmount(); + if (layoutGroup && layoutGroup.group) + layoutGroup.group.remove(projection); + if (promoteContext && promoteContext.deregister) + promoteContext.deregister(projection); + } + } + safeToRemove() { + const { safeToRemove } = this.props; + safeToRemove && safeToRemove(); + } + render() { + return null; + } + } + function MeasureLayout(props) { + const [isPresent, safeToRemove] = usePresence(); + const layoutGroup = React$1.useContext(LayoutGroupContext); + return (jsx(MeasureLayoutWithContext, { ...props, layoutGroup: layoutGroup, switchLayoutGroup: React$1.useContext(SwitchLayoutGroupContext), isPresent: isPresent, safeToRemove: safeToRemove })); + } + + const drag = { + pan: { + Feature: PanGesture, + }, + drag: { + Feature: DragGesture, + ProjectionNode: HTMLProjectionNode, + MeasureLayout, + }, + }; + + function handleHoverEvent(node, event, lifecycle) { + const { props } = node; + if (node.animationState && props.whileHover) { + node.animationState.setActive("whileHover", lifecycle === "Start"); + } + const eventName = ("onHover" + lifecycle); + const callback = props[eventName]; + if (callback) { + frame.postRender(() => callback(event, extractEventInfo(event))); + } + } + class HoverGesture extends Feature { + mount() { + const { current } = this.node; + if (!current) + return; + this.unmount = hover(current, (_element, startEvent) => { + handleHoverEvent(this.node, startEvent, "Start"); + return (endEvent) => handleHoverEvent(this.node, endEvent, "End"); + }); + } + unmount() { } + } + + class FocusGesture extends Feature { + constructor() { + super(...arguments); + this.isActive = false; + } + onFocus() { + let isFocusVisible = false; + /** + * If this element doesn't match focus-visible then don't + * apply whileHover. But, if matches throws that focus-visible + * is not a valid selector then in that browser outline styles will be applied + * to the element by default and we want to match that behaviour with whileFocus. + */ + try { + isFocusVisible = this.node.current.matches(":focus-visible"); + } + catch (e) { + isFocusVisible = true; + } + if (!isFocusVisible || !this.node.animationState) + return; + this.node.animationState.setActive("whileFocus", true); + this.isActive = true; + } + onBlur() { + if (!this.isActive || !this.node.animationState) + return; + this.node.animationState.setActive("whileFocus", false); + this.isActive = false; + } + mount() { + this.unmount = pipe(addDomEvent(this.node.current, "focus", () => this.onFocus()), addDomEvent(this.node.current, "blur", () => this.onBlur())); + } + unmount() { } + } + + function handlePressEvent(node, event, lifecycle) { + const { props } = node; + if (node.current instanceof HTMLButtonElement && node.current.disabled) { + return; + } + if (node.animationState && props.whileTap) { + node.animationState.setActive("whileTap", lifecycle === "Start"); + } + const eventName = ("onTap" + (lifecycle === "End" ? "" : lifecycle)); + const callback = props[eventName]; + if (callback) { + frame.postRender(() => callback(event, extractEventInfo(event))); + } + } + class PressGesture extends Feature { + mount() { + const { current } = this.node; + if (!current) + return; + const { globalTapTarget, propagate } = this.node.props; + this.unmount = press(current, (_element, startEvent) => { + handlePressEvent(this.node, startEvent, "Start"); + return (endEvent, { success }) => handlePressEvent(this.node, endEvent, success ? "End" : "Cancel"); + }, { + useGlobalTarget: globalTapTarget, + stopPropagation: propagate?.tap === false, + }); + } + unmount() { } + } + + /** + * Map an IntersectionHandler callback to an element. We only ever make one handler for one + * element, so even though these handlers might all be triggered by different + * observers, we can keep them in the same map. + */ + const observerCallbacks = new WeakMap(); + /** + * Multiple observers can be created for multiple element/document roots. Each with + * different settings. So here we store dictionaries of observers to each root, + * using serialised settings (threshold/margin) as lookup keys. + */ + const observers = new WeakMap(); + const fireObserverCallback = (entry) => { + const callback = observerCallbacks.get(entry.target); + callback && callback(entry); + }; + const fireAllObserverCallbacks = (entries) => { + entries.forEach(fireObserverCallback); + }; + function initIntersectionObserver({ root, ...options }) { + const lookupRoot = root || document; + /** + * If we don't have an observer lookup map for this root, create one. + */ + if (!observers.has(lookupRoot)) { + observers.set(lookupRoot, {}); + } + const rootObservers = observers.get(lookupRoot); + const key = JSON.stringify(options); + /** + * If we don't have an observer for this combination of root and settings, + * create one. + */ + if (!rootObservers[key]) { + rootObservers[key] = new IntersectionObserver(fireAllObserverCallbacks, { root, ...options }); + } + return rootObservers[key]; + } + function observeIntersection(element, options, callback) { + const rootInteresectionObserver = initIntersectionObserver(options); + observerCallbacks.set(element, callback); + rootInteresectionObserver.observe(element); + return () => { + observerCallbacks.delete(element); + rootInteresectionObserver.unobserve(element); + }; + } + + const thresholdNames = { + some: 0, + all: 1, + }; + class InViewFeature extends Feature { + constructor() { + super(...arguments); + this.hasEnteredView = false; + this.isInView = false; + } + startObserver() { + this.stopObserver?.(); + const { viewport = {} } = this.node.getProps(); + const { root, margin: rootMargin, amount = "some", once } = viewport; + const options = { + root: root ? root.current : undefined, + rootMargin, + threshold: typeof amount === "number" ? amount : thresholdNames[amount], + }; + const onIntersectionUpdate = (entry) => { + const { isIntersecting } = entry; + /** + * If there's been no change in the viewport state, early return. + */ + if (this.isInView === isIntersecting) + return; + this.isInView = isIntersecting; + /** + * Handle hasEnteredView. If this is only meant to run once, and + * element isn't visible, early return. Otherwise set hasEnteredView to true. + */ + if (once && !isIntersecting && this.hasEnteredView) { + return; + } + else if (isIntersecting) { + this.hasEnteredView = true; + } + if (this.node.animationState) { + this.node.animationState.setActive("whileInView", isIntersecting); + } + /** + * Use the latest committed props rather than the ones in scope + * when this observer is created + */ + const { onViewportEnter, onViewportLeave } = this.node.getProps(); + const callback = isIntersecting ? onViewportEnter : onViewportLeave; + callback && callback(entry); + }; + this.stopObserver = observeIntersection(this.node.current, options, onIntersectionUpdate); + } + mount() { + this.startObserver(); + } + update() { + if (typeof IntersectionObserver === "undefined") + return; + const { props, prevProps } = this.node; + const hasOptionsChanged = ["amount", "margin", "root"].some(hasViewportOptionChanged(props, prevProps)); + if (hasOptionsChanged) { + this.startObserver(); + } + } + unmount() { + this.stopObserver?.(); + this.hasEnteredView = false; + this.isInView = false; + } + } + function hasViewportOptionChanged({ viewport = {} }, { viewport: prevViewport = {} } = {}) { + return (name) => viewport[name] !== prevViewport[name]; + } + + const gestureAnimations = { + inView: { + Feature: InViewFeature, + }, + tap: { + Feature: PressGesture, + }, + focus: { + Feature: FocusGesture, + }, + hover: { + Feature: HoverGesture, + }, + }; + + const layout = { + layout: { + ProjectionNode: HTMLProjectionNode, + MeasureLayout, + }, + }; + + const featureBundle = { + ...animations, + ...gestureAnimations, + ...drag, + ...layout, + }; + + const motion = /*@__PURE__*/ createMotionProxy(featureBundle, createDomVisualElement); + + function checkReorder(order, value, offset, velocity, axis, direction = "ltr") { + const index = order.findIndex((item) => item.value === value); + if (index === -1) + return order; + if (axis === "xy") { + const { layout } = order[index]; + const center = { + x: mixNumber$1(layout.x.min, layout.x.max, 0.5) + offset.x, + y: mixNumber$1(layout.y.min, layout.y.max, 0.5) + offset.y, + }; + const lines = getLines(order); + const sourceLine = lines.find((line) => line.items.includes(order[index])); + const targetLine = lines.reduce((closest, line) => distanceToLine(center.y, line) < distanceToLine(center.y, closest) + ? line + : closest); + if (targetLine !== sourceLine) { + return moveToLine(order, index, center.x, targetLine, direction); + } + const currentDistance = distanceToBox(center, layout); + let target = -1; + let targetDistance = currentDistance; + order.forEach((item, targetIndex) => { + if (targetIndex === index) + return; + const distance = distanceToBox(center, item.layout); + if (distance < targetDistance) { + target = targetIndex; + targetDistance = distance; + } + }); + return target === -1 + ? order + : moveItem(order, index, index + Math.sign(target - index)); + } + if (!velocity[axis]) + return order; + const nextOffset = velocity[axis] > 0 ? 1 : -1; + const nextItem = order[index + nextOffset]; + if (!nextItem) + return order; + const item = order[index]; + const itemLayout = item.layout[axis]; + const nextLayout = nextItem.layout[axis]; + const nextItemCenter = mixNumber$1(nextLayout.min, nextLayout.max, 0.5); + if ((nextOffset === 1 && itemLayout.max + offset[axis] > nextItemCenter) || + (nextOffset === -1 && itemLayout.min + offset[axis] < nextItemCenter)) { + return moveItem(order, index, index + nextOffset); + } + return order; + } + function getLines(order) { + const lines = []; + order.forEach((item) => { + const { min, max } = item.layout.y; + const line = lines[lines.length - 1]; + if (!line || min >= line.max || max <= line.min) { + lines.push({ items: [item], min, max }); + } + else { + line.items.push(item); + line.min = Math.min(line.min, min); + line.max = Math.max(line.max, max); + } + }); + return lines; + } + function distanceToLine(y, line) { + return y < line.min ? line.min - y : y > line.max ? y - line.max : 0; + } + function moveToLine(order, index, x, line, direction) { + const remaining = order.filter((_, itemIndex) => itemIndex !== index); + const before = line.items.find((item) => { + const center = mixNumber$1(item.layout.x.min, item.layout.x.max, 0.5); + return direction === "ltr" ? x < center : x > center; + }); + const targetIndex = before + ? remaining.indexOf(before) + : remaining.indexOf(line.items[line.items.length - 1]) + 1; + const nextOrder = [...remaining]; + nextOrder.splice(targetIndex, 0, order[index]); + return nextOrder.every((item, itemIndex) => item === order[itemIndex]) + ? order + : nextOrder; + } + function distanceToBox(point, box) { + const x = Math.max(box.x.min - point.x, 0, point.x - box.x.max); + const y = Math.max(box.y.min - point.y, 0, point.y - box.y.max); + return x * x + y * y; + } + + const isSeparated = (a, b) => a.max <= b.min || b.max <= a.min; + function detectAxis(layouts) { + let x = false; + let y = false; + for (let i = 0; i < layouts.length; i++) { + for (let j = i + 1; j < layouts.length; j++) { + x || (x = isSeparated(layouts[i].x, layouts[j].x)); + y || (y = isSeparated(layouts[i].y, layouts[j].y)); + if (x && y) + return "xy"; + } + } + return x ? "x" : "y"; + } + + function ReorderGroupComponent({ children, as = "ul", axis: axisOverride, onReorder, values, ...props }, externalRef) { + const Component = useConstant(() => motion[as]); + const itemLayouts = React$1.useRef(new Map()); + const [detectedAxis, setDetectedAxis] = React$1.useState("y"); + const isReordering = React$1.useRef(false); + const groupRef = React$1.useRef(null); + const axis = axisOverride || detectedAxis; + exports.invariant(Boolean(values), "Reorder.Group must be provided a values prop", "reorder-values"); + const valuesSet = new Set(values); + itemLayouts.current.forEach((_, value) => { + if (!valuesSet.has(value)) + itemLayouts.current.delete(value); + }); + const context = { + axis, + groupRef, + registerItem: (value, layout) => { + itemLayouts.current.set(value, layout); + if (!axisOverride) { + const nextAxis = detectAxis(values.flatMap((itemValue) => { + const itemLayout = itemLayouts.current.get(itemValue); + return itemLayout ? [itemLayout] : []; + })); + if (nextAxis !== detectedAxis) + setDetectedAxis(nextAxis); + } + }, + updateOrder: (item, offset, velocity) => { + if (isReordering.current) + return; + const order = values.flatMap((value) => { + const layout = itemLayouts.current.get(value); + return layout ? [{ value, layout }] : []; + }); + const direction = groupRef.current?.ownerDocument.defaultView?.getComputedStyle(groupRef.current).direction === "rtl" + ? "rtl" + : "ltr"; + const newOrder = checkReorder(order, item, offset, velocity, axis, direction); + if (order !== newOrder) { + isReordering.current = true; + const newValues = [...values]; + const measuredIndexes = order.map(({ value }) => values.indexOf(value)); + newOrder.forEach(({ value }, index) => { + newValues[measuredIndexes[index]] = value; + }); + onReorder(newValues); + } + }, + }; + React$1.useEffect(() => { + isReordering.current = false; + }); + // Combine refs if external ref is provided + const setRef = (element) => { + groupRef.current = element; + if (typeof externalRef === "function") { + externalRef(element); + } + else if (externalRef) { + externalRef.current = + element; + } + }; + /** + * Disable browser scroll anchoring on the group container. + * When items reorder, scroll anchoring can cause the browser to adjust + * the scroll position, which interferes with drag position calculations. + */ + const groupStyle = { + overflowAnchor: "none", + ...props.style, + }; + return (jsx(Component, { ...props, style: groupStyle, ref: setRef, ignoreStrict: true, children: jsx(ReorderContext.Provider, { value: context, children: children }) })); + } + const ReorderGroup = /*@__PURE__*/ React$1.forwardRef(ReorderGroupComponent); + + /** + * Creates a `MotionValue` to track the state and velocity of a value. + * + * Usually, these are created automatically. For advanced use-cases, like use with `useTransform`, you can create `MotionValue`s externally and pass them into the animated component via the `style` prop. + * + * ```jsx + * export const MyComponent = () => { + * const scale = useMotionValue(1) + * + * return + * } + * ``` + * + * @param initial - The initial state. + * + * @public + */ + function useMotionValue(initial) { + const value = useConstant(() => motionValue(initial)); + /** + * If this motion value is being used in static mode, like on + * the Framer canvas, force components to rerender when the motion + * value is updated. + */ + const { isStatic } = React$1.useContext(MotionConfigContext); + if (isStatic) { + const [, setLatest] = React$1.useState(initial); + React$1.useEffect(() => value.on("change", setLatest), []); + } + return value; + } + + function useCombineMotionValues(values, combineValues) { + /** + * Initialise the returned motion value. This remains the same between renders. + */ + const value = useMotionValue(combineValues()); + /** + * Create a function that will update the template motion value with the latest values. + * This is pre-bound so whenever a motion value updates it can schedule its + * execution in Framesync. If it's already been scheduled it won't be fired twice + * in a single frame. + */ + const updateValue = () => value.set(combineValues()); + /** + * Synchronously update the motion value with the latest values during the render. + * This ensures that within a React render, the styles applied to the DOM are up-to-date. + */ + updateValue(); + /** + * Subscribe to all motion values found within the template. Whenever any of them change, + * schedule an update. + */ + useIsomorphicLayoutEffect(() => { + const scheduleUpdate = () => frame.preRender(updateValue, false, true); + const subscriptions = values.map((v) => v.on("change", scheduleUpdate)); + return () => { + subscriptions.forEach((unsubscribe) => unsubscribe()); + cancelFrame(updateValue); + }; + }); + return value; + } + + function useComputed(compute) { + /** + * Open session of collectMotionValues. Any MotionValue that calls get() + * will be saved into this array. + */ + collectMotionValues.current = []; + compute(); + const value = useCombineMotionValues(collectMotionValues.current, compute); + /** + * Synchronously close session of collectMotionValues. + */ + collectMotionValues.current = undefined; + return value; + } + + function useTransform(input, inputRangeOrTransformer, outputRangeOrMap, options) { + if (typeof input === "function") { + return useComputed(input); + } + /** + * Detect if outputRangeOrMap is an output map (object with keys) + * rather than an output range (array). + */ + const isOutputMap = outputRangeOrMap !== undefined && + !Array.isArray(outputRangeOrMap) && + typeof inputRangeOrTransformer !== "function"; + if (isOutputMap) { + return useMapTransform(input, inputRangeOrTransformer, outputRangeOrMap, options); + } + const outputRange = outputRangeOrMap; + const transformer = typeof inputRangeOrTransformer === "function" + ? inputRangeOrTransformer + : transform(inputRangeOrTransformer, outputRange, options); + const result = Array.isArray(input) + ? useListTransform(input, transformer) + : useListTransform([input], ([latest]) => transformer(latest)); + const inputAccelerate = !Array.isArray(input) + ? input.accelerate + : undefined; + if (inputAccelerate && + !inputAccelerate.isTransformed && + typeof inputRangeOrTransformer !== "function" && + Array.isArray(outputRangeOrMap) && + options?.clamp !== false) { + result.accelerate = { + ...inputAccelerate, + times: inputRangeOrTransformer, + keyframes: outputRangeOrMap, + isTransformed: true, + ...(options?.ease ? { ease: options.ease } : {}), + }; + } + return result; + } + function useListTransform(values, transformer) { + const latest = useConstant(() => []); + return useCombineMotionValues(values, () => { + latest.length = 0; + const numValues = values.length; + for (let i = 0; i < numValues; i++) { + latest[i] = values[i].get(); + } + return transformer(latest); + }); + } + function useMapTransform(inputValue, inputRange, outputMap, options) { + /** + * Capture keys once to ensure hooks are called in consistent order. + */ + const keys = useConstant(() => Object.keys(outputMap)); + const output = useConstant(() => ({})); + for (const key of keys) { + output[key] = useTransform(inputValue, inputRange, outputMap[key], options); + } + return output; + } + + const threshold = 50; + const maxSpeed = 25; + const overflowStyles = new Set(["auto", "scroll"]); + // Track initial scroll limits per scrollable element (Bug 1 fix) + const initialScrollLimits = new WeakMap(); + const activeScrollEdge = new WeakMap(); + // Track which group element is currently dragging to clear state on end + let currentGroupElement = null; + function resetAutoScrollState() { + if (currentGroupElement) { + const scrollableAncestor = findScrollableAncestor(currentGroupElement, "y"); + if (scrollableAncestor) { + activeScrollEdge.delete(scrollableAncestor); + initialScrollLimits.delete(scrollableAncestor); + } + // Also try x axis + const scrollableAncestorX = findScrollableAncestor(currentGroupElement, "x"); + if (scrollableAncestorX && scrollableAncestorX !== scrollableAncestor) { + activeScrollEdge.delete(scrollableAncestorX); + initialScrollLimits.delete(scrollableAncestorX); + } + currentGroupElement = null; + } + } + function isScrollableElement(element, axis) { + const style = getComputedStyle(element); + const overflow = axis === "x" ? style.overflowX : style.overflowY; + const isDocumentScroll = element === document.body || + element === document.documentElement; + return overflowStyles.has(overflow) || isDocumentScroll; + } + function findScrollableAncestor(element, axis) { + let current = element?.parentElement; + while (current) { + if (isScrollableElement(current, axis)) { + return current; + } + current = current.parentElement; + } + return null; + } + function getScrollAmount(pointerPosition, scrollElement, axis) { + const rect = scrollElement.getBoundingClientRect(); + const start = axis === "x" ? Math.max(0, rect.left) : Math.max(0, rect.top); + const end = axis === "x" ? Math.min(window.innerWidth, rect.right) : Math.min(window.innerHeight, rect.bottom); + const distanceFromStart = pointerPosition - start; + const distanceFromEnd = end - pointerPosition; + if (distanceFromStart < threshold) { + const intensity = 1 - distanceFromStart / threshold; + return { amount: -maxSpeed * intensity * intensity, edge: "start" }; + } + else if (distanceFromEnd < threshold) { + const intensity = 1 - distanceFromEnd / threshold; + return { amount: maxSpeed * intensity * intensity, edge: "end" }; + } + return { amount: 0, edge: null }; + } + function autoScrollIfNeeded(groupElement, pointerPosition, axis, velocity) { + if (!groupElement) + return; + // Track the group element for cleanup + currentGroupElement = groupElement; + const scrollableAncestor = findScrollableAncestor(groupElement, axis); + if (!scrollableAncestor) + return; + // Convert pointer position from page coordinates to viewport coordinates. + // The gesture system uses pageX/pageY but getBoundingClientRect() returns + // viewport-relative coordinates, so we need to account for page scroll. + const viewportPointerPosition = pointerPosition - (axis === "x" ? window.scrollX : window.scrollY); + const { amount: scrollAmount, edge } = getScrollAmount(viewportPointerPosition, scrollableAncestor, axis); + // If not in any threshold zone, clear all state + if (edge === null) { + activeScrollEdge.delete(scrollableAncestor); + initialScrollLimits.delete(scrollableAncestor); + return; + } + const currentActiveEdge = activeScrollEdge.get(scrollableAncestor); + const isDocumentScroll = scrollableAncestor === document.body || + scrollableAncestor === document.documentElement; + // If not currently scrolling this edge, check velocity to see if we should start + if (currentActiveEdge !== edge) { + // Only start scrolling if velocity is towards the edge + const shouldStart = (edge === "start" && velocity < 0) || + (edge === "end" && velocity > 0); + if (!shouldStart) + return; + // Activate this edge + activeScrollEdge.set(scrollableAncestor, edge); + // Record initial scroll limit (prevents infinite scroll) + const maxScroll = axis === "x" + ? scrollableAncestor.scrollWidth - (isDocumentScroll ? window.innerWidth : scrollableAncestor.clientWidth) + : scrollableAncestor.scrollHeight - (isDocumentScroll ? window.innerHeight : scrollableAncestor.clientHeight); + initialScrollLimits.set(scrollableAncestor, maxScroll); + } + // Cap scrolling at initial limit (prevents infinite scroll) + if (scrollAmount > 0) { + const initialLimit = initialScrollLimits.get(scrollableAncestor); + const currentScroll = axis === "x" + ? (isDocumentScroll ? window.scrollX : scrollableAncestor.scrollLeft) + : (isDocumentScroll ? window.scrollY : scrollableAncestor.scrollTop); + if (currentScroll >= initialLimit) + return; + } + // Apply scroll + if (axis === "x") { + if (isDocumentScroll) { + window.scrollBy({ left: scrollAmount }); + } + else { + scrollableAncestor.scrollLeft += scrollAmount; + } + } + else { + if (isDocumentScroll) { + window.scrollBy({ top: scrollAmount }); + } + else { + scrollableAncestor.scrollTop += scrollAmount; + } + } + } + + function useDefaultMotionValue(value, defaultValue = 0) { + return isMotionValue(value) ? value : useMotionValue(defaultValue); + } + function ReorderItemComponent({ children, style = {}, value, as = "li", onDrag, onDragEnd, layout = true, ...props }, externalRef) { + const Component = useConstant(() => motion[as]); + const context = React$1.useContext(ReorderContext); + const point = { + x: useDefaultMotionValue(style.x), + y: useDefaultMotionValue(style.y), + }; + const zIndex = useTransform([point.x, point.y], ([latestX, latestY]) => latestX || latestY ? 1 : "unset"); + exports.invariant(Boolean(context), "Reorder.Item must be a child of Reorder.Group", "reorder-item-child"); + const { axis, registerItem, updateOrder, groupRef } = context; + const dragAxis = axis === "xy" ? true : axis; + return (jsx(Component, { drag: dragAxis, ...props, dragSnapToOrigin: true, style: { ...style, x: point.x, y: point.y, zIndex }, layout: layout, onDrag: (event, gesturePoint) => { + const { velocity, point: pointerPoint } = gesturePoint; + const offset = { x: point.x.get(), y: point.y.get() }; + updateOrder(value, offset, velocity); + const scrollAxis = axis === "xy" + ? Math.abs(velocity.x) > Math.abs(velocity.y) + ? "x" + : "y" + : axis; + autoScrollIfNeeded(groupRef.current, pointerPoint[scrollAxis], scrollAxis, velocity[scrollAxis]); + onDrag && onDrag(event, gesturePoint); + }, onDragEnd: (event, gesturePoint) => { + resetAutoScrollState(); + onDragEnd && onDragEnd(event, gesturePoint); + }, onLayoutMeasure: (measured) => { + registerItem(value, measured); + }, ref: externalRef, ignoreStrict: true, children: children })); + } + const ReorderItem = /*@__PURE__*/ React$1.forwardRef(ReorderItemComponent); + + var namespace = /*#__PURE__*/Object.freeze({ + __proto__: null, + Group: ReorderGroup, + Item: ReorderItem + }); + + function isDOMKeyframes(keyframes) { + return typeof keyframes === "object" && !Array.isArray(keyframes); + } + + function resolveSubjects(subject, keyframes, scope, selectorCache) { + if (subject == null) { + return []; + } + if (typeof subject === "string" && isDOMKeyframes(keyframes)) { + return resolveElements(subject, scope, selectorCache); + } + else if (subject instanceof NodeList) { + return Array.from(subject); + } + else if (Array.isArray(subject)) { + return subject.filter((s) => s != null); + } + else { + return [subject]; + } + } + + function calculateRepeatDuration(duration, repeat, repeatDelay) { + return duration * (repeat + 1) + repeatDelay * repeat; + } + + /** + * Given a absolute or relative time definition and current/prev time state of the sequence, + * calculate an absolute time for the next keyframes. + */ + function calcNextTime(current, next, prev, labels) { + if (typeof next === "number") { + return next; + } + else if (next.startsWith("-") || next.startsWith("+")) { + return Math.max(0, current + parseFloat(next)); + } + else if (next === "<") { + return prev; + } + else if (next.startsWith("<")) { + return Math.max(0, prev + parseFloat(next.slice(1))); + } + else { + return labels.get(next) ?? current; + } + } + + function eraseKeyframes(sequence, startTime, endTime) { + for (let i = 0; i < sequence.length; i++) { + const keyframe = sequence[i]; + if (keyframe.at > startTime && keyframe.at < endTime) { + removeItem(sequence, keyframe); + // If we remove this item we have to push the pointer back one + i--; + } + } + } + function addKeyframes(sequence, keyframes, easing, offset, startTime, endTime) { + /** + * Erase every existing value between currentTime and targetTime, + * this will essentially splice this timeline into any currently + * defined ones. + */ + eraseKeyframes(sequence, startTime, endTime); + for (let i = 0; i < keyframes.length; i++) { + sequence.push({ + value: keyframes[i], + at: mixNumber$1(startTime, endTime, offset[i]), + easing: getEasingForSegment(easing, i), + }); + } + } + + /** + * Take an array of times that represent repeated keyframes. For instance + * if we have original times of [0, 0.5, 1] then our repeated times will + * be [0, 0.5, 1, 1, 1.5, 2]. Loop over the times and scale them back + * down to a 0-1 scale. + * + * `repeatDelayUnits` is the repeatDelay expressed in units of a single + * iteration's duration, so the total span equals `(repeat + 1) + repeat * repeatDelayUnits`. + */ + function normalizeTimes(times, repeat, repeatDelayUnits = 0) { + const totalUnits = repeat + 1 + repeat * repeatDelayUnits; + for (let i = 0; i < times.length; i++) { + times[i] = times[i] / totalUnits; + } + } + + function compareByTime(a, b) { + if (a.at === b.at) { + if (a.value === null) + return 1; + if (b.value === null) + return -1; + return 0; + } + else { + return a.at - b.at; + } + } + + const defaultSegmentEasing = "easeInOut"; + const MAX_REPEAT = 20; + function createAnimationsFromSequence(sequence, { defaultTransition = {}, ...sequenceTransition } = {}, scope, generators) { + const defaultDuration = defaultTransition.duration || 0.3; + const animationDefinitions = new Map(); + const sequences = new Map(); + const elementCache = {}; + const timeLabels = new Map(); + let prevTime = 0; + let currentTime = 0; + let totalDuration = 0; + /** + * Build the timeline by mapping over the sequence array and converting + * the definitions into keyframes and offsets with absolute time values. + * These will later get converted into relative offsets in a second pass. + */ + for (let i = 0; i < sequence.length; i++) { + const segment = sequence[i]; + /** + * If this is a timeline label, mark it and skip the rest of this iteration. + */ + if (typeof segment === "string") { + timeLabels.set(segment, currentTime); + continue; + } + else if (!Array.isArray(segment)) { + timeLabels.set(segment.name, calcNextTime(currentTime, segment.at, prevTime, timeLabels)); + continue; + } + let [subject, keyframes, transition = {}] = segment; + /** + * If a relative or absolute time value has been specified we need to resolve + * it in relation to the currentTime. + */ + if (transition.at !== undefined) { + currentTime = calcNextTime(currentTime, transition.at, prevTime, timeLabels); + } + /** + * Keep track of the maximum duration in this definition. This will be + * applied to currentTime once the definition has been parsed. + */ + let maxDuration = 0; + const resolveValueSequence = (valueKeyframes, valueTransition, valueSequence, elementIndex = 0, numSubjects = 0) => { + const valueKeyframesAsList = keyframesAsList(valueKeyframes); + const { delay = 0, times = defaultOffset$1(valueKeyframesAsList), type = defaultTransition.type || "keyframes", repeat, repeatType, repeatDelay = 0, ...remainingTransition } = valueTransition; + let { ease = defaultTransition.ease || "easeOut", duration } = valueTransition; + /** + * Resolve stagger() if defined. + */ + const calculatedDelay = typeof delay === "function" + ? delay(elementIndex, numSubjects) + : delay; + /** + * If this animation should and can use a spring, generate a spring easing function. + */ + const numKeyframes = valueKeyframesAsList.length; + const createGenerator = isGenerator(type) + ? type + : generators?.[type || "keyframes"]; + if (numKeyframes <= 2 && createGenerator) { + /** + * As we're creating an easing function from a spring, + * ideally we want to generate it using the real distance + * between the two keyframes. However this isn't always + * possible - in these situations we use 0-100. + */ + let absoluteDelta = 100; + if (numKeyframes === 2 && + isNumberKeyframesArray(valueKeyframesAsList)) { + const delta = valueKeyframesAsList[1] - valueKeyframesAsList[0]; + absoluteDelta = Math.abs(delta); + } + const springTransition = { + ...defaultTransition, + ...remainingTransition, + }; + if (duration !== undefined) { + springTransition.duration = secondsToMilliseconds(duration); + } + const springEasing = createGeneratorEasing(springTransition, absoluteDelta, createGenerator); + ease = springEasing.ease; + duration = springEasing.duration; + } + duration ?? (duration = defaultDuration); + const startTime = currentTime + calculatedDelay; + /** + * If there's only one time offset of 0, fill in a second with length 1 + */ + if (times.length === 1 && times[0] === 0) { + times[1] = 1; + } + /** + * Fill out if offset if fewer offsets than keyframes + */ + const remainder = times.length - valueKeyframesAsList.length; + remainder > 0 && fillOffset(times, remainder); + /** + * If only one value has been set, ie [1], push a null to the start of + * the keyframe array. This will let us mark a keyframe at this point + * that will later be hydrated with the previous value. + */ + valueKeyframesAsList.length === 1 && + valueKeyframesAsList.unshift(null); + /** + * Segments can't express `repeat: Infinity` or very large + * counts — they'd leave dead time after the segment or + * explode the keyframe array. Ignore with a warning. + */ + if (repeat) { + exports.warning(repeat < MAX_REPEAT, `Sequence segments can't repeat ${repeat} times — ignoring repeat option. Use a value below ${MAX_REPEAT} or apply repeat at the sequence level instead.`); + } + if (repeat && repeat < MAX_REPEAT) { + /** + * Express repeatDelay in units of a single iteration's duration + * so it can be added to the per-iteration time offsets below + * before they're normalized to 0-1. + */ + const repeatDelayUnits = duration > 0 ? repeatDelay / duration : 0; + duration = calculateRepeatDuration(duration, repeat, repeatDelay); + const originalKeyframes = [...valueKeyframesAsList]; + const originalTimes = [...times]; + ease = Array.isArray(ease) ? [...ease] : [ease]; + const originalEase = [...ease]; + /** + * For reverse/mirror, alternate iterations play the segment + * backwards. mirror matches JSAnimation's mirroredGenerator: + * reversed keyframes, easings unchanged. reverse matches + * JSAnimation's iterationProgress = 1 - p: reversed + * keyframes, easing array reversed AND each function easing + * mapped through reverseEasing (string easings unchanged — + * they're resolved later by the keyframes engine). + */ + const isFlipping = repeatType === "reverse" || repeatType === "mirror"; + let flippedKeyframes = originalKeyframes; + let flippedEases = originalEase; + if (isFlipping) { + flippedKeyframes = [...originalKeyframes].reverse(); + if (repeatType === "reverse") { + flippedEases = [...originalEase] + .reverse() + .map((e) => typeof e === "function" + ? reverseEasing(e) + : e); + } + } + for (let repeatIndex = 0; repeatIndex < repeat; repeatIndex++) { + const isFlipped = isFlipping && repeatIndex % 2 === 0; + const iterKeyframes = isFlipped + ? flippedKeyframes + : originalKeyframes; + const iterEase = isFlipped ? flippedEases : originalEase; + const iterStartOffset = (repeatIndex + 1) * (1 + repeatDelayUnits); + /** + * If repeatDelay is set, hold the previous iteration's + * final value through the delay by inserting a keyframe + * at the moment the next iteration begins. + */ + if (repeatDelayUnits > 0) { + valueKeyframesAsList.push(valueKeyframesAsList[valueKeyframesAsList.length - 1]); + times.push(iterStartOffset); + ease.push("linear"); + } + valueKeyframesAsList.push(...iterKeyframes); + for (let keyframeIndex = 0; keyframeIndex < iterKeyframes.length; keyframeIndex++) { + times.push(originalTimes[keyframeIndex] + iterStartOffset); + ease.push(keyframeIndex === 0 + ? "linear" + : getEasingForSegment(iterEase, keyframeIndex - 1)); + } + } + normalizeTimes(times, repeat, repeatDelayUnits); + } + const targetTime = startTime + duration; + /** + * Add keyframes, mapping offsets to absolute time. + */ + addKeyframes(valueSequence, valueKeyframesAsList, ease, times, startTime, targetTime); + maxDuration = Math.max(calculatedDelay + duration, maxDuration); + totalDuration = Math.max(targetTime, totalDuration); + }; + if (isMotionValue(subject)) { + const subjectSequence = getSubjectSequence(subject, sequences); + resolveValueSequence(keyframes, transition, getValueSequence("default", subjectSequence)); + } + else { + const subjects = resolveSubjects(subject, keyframes, scope, elementCache); + const numSubjects = subjects.length; + /** + * For every element in this segment, process the defined values. + */ + for (let subjectIndex = 0; subjectIndex < numSubjects; subjectIndex++) { + /** + * Cast necessary, but we know these are of this type + */ + keyframes = keyframes; + transition = transition; + const thisSubject = subjects[subjectIndex]; + const subjectSequence = getSubjectSequence(thisSubject, sequences); + for (const key in keyframes) { + resolveValueSequence(keyframes[key], getValueTransition(transition, key), getValueSequence(key, subjectSequence), subjectIndex, numSubjects); + } + } + } + prevTime = currentTime; + currentTime += maxDuration; + } + /** + * For every element and value combination create a new animation. + */ + sequences.forEach((valueSequences, element) => { + for (const key in valueSequences) { + const valueSequence = valueSequences[key]; + /** + * Arrange all the keyframes in ascending time order. + */ + valueSequence.sort(compareByTime); + const keyframes = []; + const valueOffset = []; + const valueEasing = []; + /** + * For each keyframe, translate absolute times into + * relative offsets based on the total duration of the timeline. + */ + for (let i = 0; i < valueSequence.length; i++) { + const { at, value, easing } = valueSequence[i]; + keyframes.push(value); + valueOffset.push(progress(0, totalDuration, at)); + valueEasing.push(easing || "easeOut"); + } + /** + * If the first keyframe doesn't land on offset: 0 + * provide one by duplicating the initial keyframe. This ensures + * it snaps to the first keyframe when the animation starts. + */ + if (valueOffset[0] !== 0) { + valueOffset.unshift(0); + keyframes.unshift(keyframes[0]); + valueEasing.unshift(defaultSegmentEasing); + } + /** + * If the last keyframe doesn't land on offset: 1 + * provide one with a null wildcard value. This will ensure it + * stays static until the end of the animation. + */ + if (valueOffset[valueOffset.length - 1] !== 1) { + valueOffset.push(1); + keyframes.push(null); + } + if (!animationDefinitions.has(element)) { + animationDefinitions.set(element, { + keyframes: {}, + transition: {}, + }); + } + const definition = animationDefinitions.get(element); + definition.keyframes[key] = keyframes; + /** + * Exclude `type` from defaultTransition since springs have been + * converted to duration-based easing functions in resolveValueSequence. + * Including `type: "spring"` would cause JSAnimation to error when + * the merged keyframes array has more than 2 keyframes. + */ + const { type: _type, ...remainingDefaultTransition } = defaultTransition; + definition.transition[key] = { + ...remainingDefaultTransition, + duration: totalDuration, + ease: valueEasing, + times: valueOffset, + ...sequenceTransition, + }; + } + }); + return animationDefinitions; + } + function getSubjectSequence(subject, sequences) { + !sequences.has(subject) && sequences.set(subject, {}); + return sequences.get(subject); + } + function getValueSequence(name, sequences) { + if (!sequences[name]) + sequences[name] = []; + return sequences[name]; + } + function keyframesAsList(keyframes) { + return Array.isArray(keyframes) ? keyframes : [keyframes]; + } + function getValueTransition(transition, key) { + return transition && transition[key] + ? { + ...transition, + ...transition[key], + } + : { ...transition }; + } + const isNumber = (keyframe) => typeof keyframe === "number"; + const isNumberKeyframesArray = (keyframes) => keyframes.every(isNumber); + + function createDOMVisualElement(element) { + const options = { + presenceContext: null, + props: {}, + visualState: { + renderState: { + transform: {}, + transformOrigin: {}, + style: {}, + vars: {}, + attrs: {}, + }, + latestValues: {}, + }, + }; + const node = isSVGElement(element) && !isSVGSVGElement(element) + ? new SVGVisualElement(options) + : new HTMLVisualElement(options); + node.mount(element); + visualElementStore.set(element, node); + } + function createObjectVisualElement(subject) { + const options = { + presenceContext: null, + props: {}, + visualState: { + renderState: { + output: {}, + }, + latestValues: {}, + }, + }; + const node = new ObjectVisualElement(options); + node.mount(subject); + visualElementStore.set(subject, node); + } + + function isSingleValue(subject, keyframes) { + return (isMotionValue(subject) || + typeof subject === "number" || + (typeof subject === "string" && !isDOMKeyframes(keyframes))); + } + /** + * Implementation + */ + function animateSubject(subject, keyframes, options, scope) { + const animations = []; + if (isSingleValue(subject, keyframes)) { + animations.push(animateSingleValue(subject, isDOMKeyframes(keyframes) + ? keyframes.default || keyframes + : keyframes, options ? options.default || options : options)); + } + else { + // Gracefully handle null/undefined subjects (e.g., from querySelector returning null) + if (subject == null) { + return animations; + } + const subjects = resolveSubjects(subject, keyframes, scope); + const numSubjects = subjects.length; + exports.invariant(Boolean(numSubjects), "No valid elements provided.", "no-valid-elements"); + for (let i = 0; i < numSubjects; i++) { + const thisSubject = subjects[i]; + const createVisualElement = thisSubject instanceof Element + ? createDOMVisualElement + : createObjectVisualElement; + if (!visualElementStore.has(thisSubject)) { + createVisualElement(thisSubject); + } + const visualElement = visualElementStore.get(thisSubject); + const transition = { ...options }; + /** + * Resolve stagger function if provided. + */ + if ("delay" in transition && + typeof transition.delay === "function") { + transition.delay = transition.delay(i, numSubjects); + } + animations.push(...animateTarget(visualElement, { ...keyframes, transition }, {})); + } + } + return animations; + } + + function animateSequence(sequence, options, scope) { + const animations = []; + /** + * Pre-process: replace function segments with MotionValue segments, + * subscribe callbacks immediately + */ + const processedSequence = sequence.map((segment) => { + if (Array.isArray(segment) && typeof segment[0] === "function") { + const callback = segment[0]; + const mv = motionValue(0); + mv.on("change", callback); + if (segment.length === 1) { + return [mv, [0, 1]]; + } + else if (segment.length === 2) { + return [mv, [0, 1], segment[1]]; + } + else { + return [mv, segment[1], segment[2]]; + } + } + return segment; + }); + const animationDefinitions = createAnimationsFromSequence(processedSequence, options, scope, { spring }); + animationDefinitions.forEach(({ keyframes, transition }, subject) => { + animations.push(...animateSubject(subject, keyframes, transition)); + }); + return animations; + } + + function isSequence(value) { + return Array.isArray(value) && value.some(Array.isArray); + } + /** + * Creates an animation function that is optionally scoped + * to a specific element. + */ + function createScopedAnimate(options = {}) { + const { scope, reduceMotion, skipAnimations } = options; + /** + * Implementation + */ + function scopedAnimate(subjectOrSequence, optionsOrKeyframes, options) { + let animations = []; + let animationOnComplete; + const inherited = {}; + if (reduceMotion !== undefined) + inherited.reduceMotion = reduceMotion; + if (skipAnimations !== undefined) + inherited.skipAnimations = skipAnimations; + if (isSequence(subjectOrSequence)) { + const { onComplete, ...sequenceOptions } = optionsOrKeyframes || {}; + if (typeof onComplete === "function") { + animationOnComplete = onComplete; + } + animations = animateSequence(subjectOrSequence, { ...inherited, ...sequenceOptions }, scope); + } + else { + // Extract top-level onComplete so it doesn't get applied per-value + const { onComplete, ...rest } = options || {}; + if (typeof onComplete === "function") { + animationOnComplete = onComplete; + } + animations = animateSubject(subjectOrSequence, optionsOrKeyframes, { ...inherited, ...rest }, scope); + } + const animation = new GroupAnimationWithThen(animations); + if (animationOnComplete) { + animation.finished.then(animationOnComplete); + } + if (scope) { + scope.animations.push(animation); + animation.finished.then(() => { + removeItem(scope.animations, animation); + }); + } + return animation; + } + return scopedAnimate; + } + const animate = createScopedAnimate(); + + function animateElements(elementOrSelector, keyframes, options, scope) { + // Gracefully handle null/undefined elements (e.g., from querySelector returning null) + if (elementOrSelector == null) { + return []; + } + const elements = resolveElements(elementOrSelector, scope); + const numElements = elements.length; + exports.invariant(Boolean(numElements), "No valid elements provided.", "no-valid-elements"); + /** + * WAAPI doesn't support interrupting animations. + * + * Therefore, starting animations requires a three-step process: + * 1. Stop existing animations (write styles to DOM) + * 2. Resolve keyframes (read styles from DOM) + * 3. Create new animations (write styles to DOM) + * + * The hybrid `animate()` function uses AsyncAnimation to resolve + * keyframes before creating new animations, which removes style + * thrashing. Here, we have much stricter filesize constraints. + * Therefore we do this in a synchronous way that ensures that + * at least within `animate()` calls there is no style thrashing. + * + * In the motion-native-animate-mini-interrupt benchmark this + * was 80% faster than a single loop. + */ + const animationDefinitions = []; + /** + * Step 1: Build options and stop existing animations (write) + */ + for (let i = 0; i < numElements; i++) { + const element = elements[i]; + const elementTransition = { ...options }; + /** + * Resolve stagger function if provided. + */ + if (typeof elementTransition.delay === "function") { + elementTransition.delay = elementTransition.delay(i, numElements); + } + for (const valueName in keyframes) { + let valueKeyframes = keyframes[valueName]; + if (!Array.isArray(valueKeyframes)) { + valueKeyframes = [valueKeyframes]; + } + const valueOptions = { + ...getValueTransition$1(elementTransition, valueName), + }; + valueOptions.duration && (valueOptions.duration = secondsToMilliseconds(valueOptions.duration)); + valueOptions.delay && (valueOptions.delay = secondsToMilliseconds(valueOptions.delay)); + /** + * If there's an existing animation playing on this element then stop it + * before creating a new one. + */ + const map = getAnimationMap(element); + const key = animationMapKey(valueName, valueOptions.pseudoElement || ""); + const currentAnimation = map.get(key); + currentAnimation && currentAnimation.stop(); + animationDefinitions.push({ + map, + key, + unresolvedKeyframes: valueKeyframes, + options: { + ...valueOptions, + element, + name: valueName, + allowFlatten: !elementTransition.type && !elementTransition.ease, + }, + }); + } + } + /** + * Step 2: Resolve keyframes (read) + */ + for (let i = 0; i < animationDefinitions.length; i++) { + const { unresolvedKeyframes, options: animationOptions } = animationDefinitions[i]; + const { element, name, pseudoElement } = animationOptions; + if (!pseudoElement && unresolvedKeyframes[0] === null) { + unresolvedKeyframes[0] = getComputedStyle$2(element, name); + } + fillWildcards(unresolvedKeyframes); + applyPxDefaults(unresolvedKeyframes, name); + /** + * If we only have one keyframe, explicitly read the initial keyframe + * from the computed style. This is to ensure consistency with WAAPI behaviour + * for restarting animations, for instance .play() after finish, when it + * has one vs two keyframes. + */ + if (!pseudoElement && unresolvedKeyframes.length < 2) { + unresolvedKeyframes.unshift(getComputedStyle$2(element, name)); + } + animationOptions.keyframes = unresolvedKeyframes; + } + /** + * Step 3: Create new animations (write) + */ + const animations = []; + for (let i = 0; i < animationDefinitions.length; i++) { + const { map, key, options: animationOptions } = animationDefinitions[i]; + const animation = new NativeAnimation(animationOptions); + map.set(key, animation); + animation.finished.finally(() => map.delete(key)); + animations.push(animation); + } + return animations; + } + + const createScopedWaapiAnimate = (scope) => { + function scopedAnimate(elementOrSelector, keyframes, options) { + return new GroupAnimationWithThen(animateElements(elementOrSelector, keyframes, options, scope)); + } + return scopedAnimate; + }; + const animateMini = /*@__PURE__*/ createScopedWaapiAnimate(); + + function canUseNativeTimeline(target) { + if (typeof window === "undefined") + return false; + return target ? supportsViewTimeline() : supportsScrollTimeline(); + } + + /** + * A time in milliseconds, beyond which we consider the scroll velocity to be 0. + */ + const maxElapsed = 50; + const createAxisInfo = () => ({ + current: 0, + offset: [], + progress: 0, + scrollLength: 0, + targetOffset: 0, + targetLength: 0, + containerLength: 0, + velocity: 0, + }); + const createScrollInfo = () => ({ + time: 0, + x: createAxisInfo(), + y: createAxisInfo(), + }); + const keys = { + x: { + length: "Width", + position: "Left", + }, + y: { + length: "Height", + position: "Top", + }, + }; + function updateAxisInfo(element, axisName, info, time) { + const axis = info[axisName]; + const { length, position } = keys[axisName]; + const prev = axis.current; + const prevTime = info.time; + axis.current = Math.abs(element[`scroll${position}`]); + axis.scrollLength = element[`scroll${length}`] - element[`client${length}`]; + axis.offset.length = 0; + axis.offset[0] = 0; + axis.offset[1] = axis.scrollLength; + axis.progress = progress(0, axis.scrollLength, axis.current); + const elapsed = time - prevTime; + axis.velocity = + elapsed > maxElapsed + ? 0 + : velocityPerSecond(axis.current - prev, elapsed); + } + function updateScrollInfo(element, info, time) { + updateAxisInfo(element, "x", info, time); + updateAxisInfo(element, "y", info, time); + info.time = time; + } + + function calcInset(element, container) { + const inset = { x: 0, y: 0 }; + let current = element; + while (current && current !== container) { + if (isHTMLElement(current)) { + inset.x += current.offsetLeft; + inset.y += current.offsetTop; + current = current.offsetParent; + } + else if (current.tagName === "svg") { + /** + * This isn't an ideal approach to measuring the offset of tags. + * It would be preferable, given they behave like HTMLElements in most ways + * to use offsetLeft/Top. But these don't exist on . Likewise we + * can't use .getBBox() like most SVG elements as these provide the offset + * relative to the SVG itself, which for is usually 0x0. + */ + const svgBoundingBox = current.getBoundingClientRect(); + current = current.parentElement; + const parentBoundingBox = current.getBoundingClientRect(); + inset.x += svgBoundingBox.left - parentBoundingBox.left; + inset.y += svgBoundingBox.top - parentBoundingBox.top; + } + else if (current instanceof SVGGraphicsElement) { + const { x, y } = current.getBBox(); + inset.x += x; + inset.y += y; + let svg = null; + let parent = current.parentNode; + while (!svg) { + if (parent.tagName === "svg") { + svg = parent; + } + parent = current.parentNode; + } + current = svg; + } + else { + break; + } + } + return inset; + } + + const namedEdges = { + start: 0, + center: 0.5, + end: 1, + }; + function resolveEdge(edge, length, inset = 0) { + let delta = 0; + /** + * If we have this edge defined as a preset, replace the definition + * with the numerical value. + */ + if (edge in namedEdges) { + edge = namedEdges[edge]; + } + /** + * Handle unit values + */ + if (typeof edge === "string") { + const asNumber = parseFloat(edge); + if (edge.endsWith("px")) { + delta = asNumber; + } + else if (edge.endsWith("%")) { + edge = asNumber / 100; + } + else if (edge.endsWith("vw")) { + delta = (asNumber / 100) * document.documentElement.clientWidth; + } + else if (edge.endsWith("vh")) { + delta = (asNumber / 100) * document.documentElement.clientHeight; + } + else { + edge = asNumber; + } + } + /** + * If the edge is defined as a number, handle as a progress value. + */ + if (typeof edge === "number") { + delta = length * edge; + } + return inset + delta; + } + + const defaultOffset = [0, 0]; + function resolveOffset(offset, containerLength, targetLength, targetInset) { + let offsetDefinition = Array.isArray(offset) ? offset : defaultOffset; + let targetPoint = 0; + let containerPoint = 0; + if (typeof offset === "number") { + /** + * If we're provided offset: [0, 0.5, 1] then each number x should become + * [x, x], so we default to the behaviour of mapping 0 => 0 of both target + * and container etc. + */ + offsetDefinition = [offset, offset]; + } + else if (typeof offset === "string") { + offset = offset.trim(); + if (offset.includes(" ")) { + offsetDefinition = offset.split(" "); + } + else { + /** + * If we're provided a definition like "100px" then we want to apply + * that only to the top of the target point, leaving the container at 0. + * Whereas a named offset like "end" should be applied to both. + */ + offsetDefinition = [offset, namedEdges[offset] ? offset : `0`]; + } + } + targetPoint = resolveEdge(offsetDefinition[0], targetLength, targetInset); + containerPoint = resolveEdge(offsetDefinition[1], containerLength); + return targetPoint - containerPoint; + } + + const ScrollOffset = { + Enter: [ + [0, 1], + [1, 1], + ], + Exit: [ + [0, 0], + [1, 0], + ], + Any: [ + [1, 0], + [0, 1], + ], + All: [ + [0, 0], + [1, 1], + ], + }; + + const point = { x: 0, y: 0 }; + function getTargetSize(target) { + return "getBBox" in target && target.tagName !== "svg" + ? target.getBBox() + : { width: target.clientWidth, height: target.clientHeight }; + } + function resolveOffsets(container, info, options) { + const { offset: offsetDefinition = ScrollOffset.All } = options; + const { target = container, axis = "y" } = options; + const lengthLabel = axis === "y" ? "height" : "width"; + const inset = target !== container ? calcInset(target, container) : point; + /** + * Measure the target and container. If they're the same thing then we + * use the container's scrollWidth/Height as the target, from there + * all other calculations can remain the same. + */ + const targetSize = target === container + ? { width: container.scrollWidth, height: container.scrollHeight } + : getTargetSize(target); + const containerSize = { + width: container.clientWidth, + height: container.clientHeight, + }; + /** + * Reset the length of the resolved offset array rather than creating a new one. + * TODO: More reusable data structures for targetSize/containerSize would also be good. + */ + info[axis].offset.length = 0; + /** + * Populate the offset array by resolving the user's offset definition into + * a list of pixel scroll offets. + */ + let hasChanged = !info[axis].interpolate; + const numOffsets = offsetDefinition.length; + for (let i = 0; i < numOffsets; i++) { + const offset = resolveOffset(offsetDefinition[i], containerSize[lengthLabel], targetSize[lengthLabel], inset[axis]); + if (!hasChanged && offset !== info[axis].interpolatorOffsets[i]) { + hasChanged = true; + } + info[axis].offset[i] = offset; + } + /** + * If the pixel scroll offsets have changed, create a new interpolator function + * to map scroll value into a progress. + */ + if (hasChanged) { + info[axis].interpolate = interpolate(info[axis].offset, defaultOffset$1(offsetDefinition), { clamp: false }); + info[axis].interpolatorOffsets = [...info[axis].offset]; + } + info[axis].progress = clamp(0, 1, info[axis].interpolate(info[axis].current)); + } + + function measure(container, target = container, info) { + /** + * Find inset of target within scrollable container + */ + info.x.targetOffset = 0; + info.y.targetOffset = 0; + if (target !== container) { + let node = target; + while (node && node !== container) { + info.x.targetOffset += node.offsetLeft; + info.y.targetOffset += node.offsetTop; + node = node.offsetParent; + } + } + info.x.targetLength = + target === container ? target.scrollWidth : target.clientWidth; + info.y.targetLength = + target === container ? target.scrollHeight : target.clientHeight; + info.x.containerLength = container.clientWidth; + info.y.containerLength = container.clientHeight; + /** + * In development mode ensure scroll containers aren't position: static as this makes + * it difficult to measure their relative positions. The document scrolling element + * is exempt: offsetParent measurements naturally resolve relative to the document. + */ + { + if (container && + target && + target !== container && + container !== document.documentElement && + container !== document.scrollingElement && + container !== document.body) { + warnOnce(getComputedStyle(container).position !== "static", "Please ensure that the container has a non-static position, like 'relative', 'fixed', or 'absolute' to ensure scroll offset is calculated correctly."); + } + } + } + function createOnScrollHandler(element, onScroll, info, options = {}) { + return { + measure: (time) => { + measure(element, options.target, info); + updateScrollInfo(element, info, time); + if (options.offset || options.target) { + resolveOffsets(element, info, options); + } + }, + notify: () => onScroll(info), + }; + } + + const scrollListeners = new WeakMap(); + const resizeListeners = new WeakMap(); + const onScrollHandlers = new WeakMap(); + const scrollSize = new WeakMap(); + const dimensionCheckProcesses = new WeakMap(); + const getEventTarget = (element) => element === document.scrollingElement ? window : element; + function scrollInfo(onScroll, { container = document.scrollingElement, trackContentSize = false, ...options } = {}) { + if (!container) + return noop; + let containerHandlers = onScrollHandlers.get(container); + /** + * Get the onScroll handlers for this container. + * If one isn't found, create a new one. + */ + if (!containerHandlers) { + containerHandlers = new Set(); + onScrollHandlers.set(container, containerHandlers); + } + /** + * Create a new onScroll handler for the provided callback. + */ + const info = createScrollInfo(); + const containerHandler = createOnScrollHandler(container, onScroll, info, options); + containerHandlers.add(containerHandler); + /** + * Check if there's a scroll event listener for this container. + * If not, create one. + */ + if (!scrollListeners.has(container)) { + const measureAll = () => { + for (const handler of containerHandlers) { + handler.measure(frameData.timestamp); + } + frame.preUpdate(notifyAll); + }; + const notifyAll = () => { + for (const handler of containerHandlers) { + handler.notify(); + } + }; + const listener = () => frame.read(measureAll); + scrollListeners.set(container, listener); + const target = getEventTarget(container); + window.addEventListener("resize", listener); + if (container !== document.documentElement) { + resizeListeners.set(container, resize(container, listener)); + } + target.addEventListener("scroll", listener); + listener(); + } + /** + * Enable content size tracking if requested and not already enabled. + */ + if (trackContentSize && !dimensionCheckProcesses.has(container)) { + const listener = scrollListeners.get(container); + // Store initial scroll dimensions (object is reused to avoid allocation) + const size = { + width: container.scrollWidth, + height: container.scrollHeight, + }; + scrollSize.set(container, size); + // Add frame-based scroll dimension checking to detect content changes + const checkScrollDimensions = () => { + const newWidth = container.scrollWidth; + const newHeight = container.scrollHeight; + if (size.width !== newWidth || size.height !== newHeight) { + listener(); + size.width = newWidth; + size.height = newHeight; + } + }; + // Schedule with keepAlive=true to run every frame + const dimensionCheckProcess = frame.read(checkScrollDimensions, true); + dimensionCheckProcesses.set(container, dimensionCheckProcess); + } + const listener = scrollListeners.get(container); + frame.read(listener, false, true); + return () => { + cancelFrame(listener); + /** + * Check if we even have any handlers for this container. + */ + const currentHandlers = onScrollHandlers.get(container); + if (!currentHandlers) + return; + currentHandlers.delete(containerHandler); + if (currentHandlers.size) + return; + /** + * If no more handlers, remove the scroll listener too. + */ + const scrollListener = scrollListeners.get(container); + scrollListeners.delete(container); + if (scrollListener) { + getEventTarget(container).removeEventListener("scroll", scrollListener); + resizeListeners.get(container)?.(); + window.removeEventListener("resize", scrollListener); + } + // Clean up scroll dimension checking + const dimensionCheckProcess = dimensionCheckProcesses.get(container); + if (dimensionCheckProcess) { + cancelFrame(dimensionCheckProcess); + dimensionCheckProcesses.delete(container); + } + scrollSize.delete(container); + }; + } + + /** + * Maps from ProgressIntersection pairs used by Motion's preset offsets to + * ViewTimeline named ranges. Returns undefined for unrecognised patterns, + * which signals the caller to fall back to JS-based scroll tracking. + */ + const presets = [ + [ScrollOffset.Enter, "entry"], + [ScrollOffset.Exit, "exit"], + [ScrollOffset.Any, "cover"], + [ScrollOffset.All, "contain"], + ]; + const stringToProgress = { + start: 0, + end: 1, + }; + function parseStringOffset(s) { + const parts = s.trim().split(/\s+/); + if (parts.length !== 2) + return undefined; + const a = stringToProgress[parts[0]]; + const b = stringToProgress[parts[1]]; + if (a === undefined || b === undefined) + return undefined; + return [a, b]; + } + function normaliseOffset(offset) { + if (offset.length !== 2) + return undefined; + const result = []; + for (const item of offset) { + if (Array.isArray(item)) { + result.push(item); + } + else if (typeof item === "string") { + const parsed = parseStringOffset(item); + if (!parsed) + return undefined; + result.push(parsed); + } + else { + return undefined; + } + } + return result; + } + function matchesPreset(offset, preset) { + const normalised = normaliseOffset(offset); + if (!normalised) + return false; + for (let i = 0; i < 2; i++) { + const o = normalised[i]; + const p = preset[i]; + if (o[0] !== p[0] || o[1] !== p[1]) + return false; + } + return true; + } + function offsetToViewTimelineRange(offset) { + if (!offset) { + return { rangeStart: "contain 0%", rangeEnd: "contain 100%" }; + } + for (const [preset, name] of presets) { + if (matchesPreset(offset, preset)) { + return { rangeStart: `${name} 0%`, rangeEnd: `${name} 100%` }; + } + } + return undefined; + } + + const timelineCache = new Map(); + function scrollTimelineFallback(options) { + const currentTime = { value: 0 }; + const cancel = scrollInfo((info) => { + currentTime.value = info[options.axis].progress * 100; + }, options); + return { currentTime, cancel }; + } + function getTimeline({ source, container, ...options }) { + const { axis } = options; + if (source) + container = source; + let containerCache = timelineCache.get(container); + if (!containerCache) { + containerCache = new Map(); + timelineCache.set(container, containerCache); + } + const targetKey = options.target ?? "self"; + let targetCache = containerCache.get(targetKey); + if (!targetCache) { + targetCache = {}; + containerCache.set(targetKey, targetCache); + } + const axisKey = axis + (options.offset ?? []).join(","); + if (!targetCache[axisKey]) { + if (options.target && canUseNativeTimeline(options.target)) { + const range = offsetToViewTimelineRange(options.offset); + if (range) { + targetCache[axisKey] = new ViewTimeline({ + subject: options.target, + axis, + }); + } + else { + targetCache[axisKey] = scrollTimelineFallback({ + container, + ...options, + }); + } + } + else if (canUseNativeTimeline()) { + targetCache[axisKey] = new ScrollTimeline({ + source: container, + axis, + }); + } + else { + targetCache[axisKey] = scrollTimelineFallback({ + container, + ...options, + }); + } + } + return targetCache[axisKey]; + } + + function attachToAnimation(animation, options) { + const timeline = getTimeline(options); + const range = options.target + ? offsetToViewTimelineRange(options.offset) + : undefined; + /** + * Use native timeline when: + * - No target: ScrollTimeline (existing behaviour) + * - Target with mappable offset: ViewTimeline with named range + * - Target with unmappable offset: fall back to JS observe + */ + const useNative = options.target + ? canUseNativeTimeline(options.target) && !!range + : canUseNativeTimeline(); + return animation.attachTimeline({ + timeline: useNative ? timeline : undefined, + ...(range && + useNative && { + rangeStart: range.rangeStart, + rangeEnd: range.rangeEnd, + }), + observe: (valueAnimation) => { + valueAnimation.pause(); + return observeTimeline((progress) => { + valueAnimation.time = + valueAnimation.iterationDuration * progress; + }, timeline); + }, + }); + } + + /** + * Currently, we only support element tracking with `scrollInfo`, though in + * the future we can also offer ViewTimeline support. + */ + function isElementTracking(options) { + return options && (options.target || options.offset); + } + + /** + * If the onScroll function has two arguments, it's expecting + * more specific information about the scroll from scrollInfo. + */ + function isOnScrollWithInfo(onScroll) { + return onScroll.length === 2; + } + function attachToFunction(onScroll, options) { + if (isOnScrollWithInfo(onScroll) || isElementTracking(options)) { + return scrollInfo((info) => { + onScroll(info[options.axis].progress, info); + }, options); + } + else { + return observeTimeline(onScroll, getTimeline(options)); + } + } + + function scroll(onScroll, { axis = "y", container = document.scrollingElement, ...options } = {}) { + if (!container) + return noop; + const optionsWithDefaults = { axis, container, ...options }; + return typeof onScroll === "function" + ? attachToFunction(onScroll, optionsWithDefaults) + : attachToAnimation(onScroll, optionsWithDefaults); + } + + const thresholds = { + some: 0, + all: 1, + }; + function inView(elementOrSelector, onStart, { root, margin: rootMargin, amount = "some" } = {}) { + const elements = resolveElements(elementOrSelector); + const activeIntersections = new WeakMap(); + const onIntersectionChange = (entries) => { + entries.forEach((entry) => { + const onEnd = activeIntersections.get(entry.target); + /** + * If there's no change to the intersection, we don't need to + * do anything here. + */ + if (entry.isIntersecting === Boolean(onEnd)) + return; + if (entry.isIntersecting) { + const newOnEnd = onStart(entry.target, entry); + if (typeof newOnEnd === "function") { + activeIntersections.set(entry.target, newOnEnd); + } + else { + observer.unobserve(entry.target); + } + } + else if (typeof onEnd === "function") { + onEnd(entry); + activeIntersections.delete(entry.target); + } + }); + }; + const observer = new IntersectionObserver(onIntersectionChange, { + root, + rootMargin, + threshold: typeof amount === "number" ? amount : thresholds[amount], + }); + elements.forEach((element) => observer.observe(element)); + return () => observer.disconnect(); + } + + const m = /*@__PURE__*/ createMotionProxy(); + + function useUnmountEffect(callback) { + return React$1.useEffect(() => () => callback(), []); + } + + /** + * @public + */ + const domAnimation = { + renderer: createDomVisualElement, + ...animations, + ...gestureAnimations, + }; + + /** + * @public + */ + const domMax = { + ...domAnimation, + ...drag, + ...layout, + }; + + /** + * @public + */ + const domMin = { + renderer: createDomVisualElement, + ...animations, + }; + + function useMotionValueEvent(value, event, callback) { + /** + * useInsertionEffect will create subscriptions before any other + * effects will run. Effects run upwards through the tree so it + * can be that binding a useLayoutEffect higher up the tree can + * miss changes from lower down the tree. + */ + React$1.useInsertionEffect(() => value.on(event, callback), [value, event, callback]); + } + + const createScrollMotionValues = () => ({ + scrollX: motionValue(0), + scrollY: motionValue(0), + scrollXProgress: motionValue(0), + scrollYProgress: motionValue(0), + }); + const isRefPending = (ref) => { + if (!ref) + return false; + return !ref.current; + }; + function makeAccelerateConfig(axis, options, container, target) { + return { + // Refs attach child-first; defer so target.current is populated + // before scroll() reads it. + factory: (animation) => { + let cleanup; + const start = () => { + // A provided ref may be hydrated by an effect declared after + // useScroll (or in a parent). Don't attach to the window + // scroll in the meantime — that result gets cached and would + // permanently mistrack. Wait until the ref resolves. + if (isRefPending(container) || isRefPending(target)) { + microtask.read(start); + return; + } + cleanup = scroll(animation, { + ...options, + axis, + container: container?.current || undefined, + target: target?.current || undefined, + }); + }; + microtask.read(start); + return () => { + cancelMicrotask(start); + cleanup?.(); + }; + }, + times: [0, 1], + keyframes: [0, 1], + ease: (v) => v, + duration: 1, + }; + } + function canAccelerateScroll(target, offset) { + if (typeof window === "undefined") + return false; + return target + ? supportsViewTimeline() && !!offsetToViewTimelineRange(offset) + : supportsScrollTimeline(); + } + function useScroll({ container, target, ...options } = {}) { + const values = useConstant(createScrollMotionValues); + if (canAccelerateScroll(target, options.offset)) { + values.scrollXProgress.accelerate = makeAccelerateConfig("x", options, container, target); + values.scrollYProgress.accelerate = makeAccelerateConfig("y", options, container, target); + } + const scrollAnimation = React$1.useRef(null); + const needsStart = React$1.useRef(false); + const start = React$1.useCallback(() => { + scrollAnimation.current = scroll((_progress, { x, y, }) => { + values.scrollX.set(x.current); + values.scrollXProgress.set(x.progress); + values.scrollY.set(y.current); + values.scrollYProgress.set(y.progress); + }, { + ...options, + container: container?.current || undefined, + target: target?.current || undefined, + }); + return () => { + scrollAnimation.current?.(); + }; + }, [container, target, JSON.stringify(options.offset)]); + useIsomorphicLayoutEffect(() => { + needsStart.current = false; + if (isRefPending(container) || isRefPending(target)) { + needsStart.current = true; + return; + } + else { + return start(); + } + }, [start]); + React$1.useEffect(() => { + if (!needsStart.current) + return; + // Defer to a microtask so any sibling/parent effect that hydrates the + // ref has a chance to run first. + let cleanup; + const tryStart = () => { + const containerPending = isRefPending(container); + const targetPending = isRefPending(target); + exports.invariant(!containerPending, "Container ref is defined but not hydrated", "use-scroll-ref"); + exports.invariant(!targetPending, "Target ref is defined but not hydrated", "use-scroll-ref"); + if (!containerPending && !targetPending) + cleanup = start(); + }; + microtask.read(tryStart); + return () => { + cancelMicrotask(tryStart); + cleanup?.(); + }; + }, [start]); + return values; + } + + /** + * @deprecated useElementScroll is deprecated. Convert to useScroll({ container: ref }) + */ + function useElementScroll(ref) { + { + warnOnce(false, "useElementScroll is deprecated. Convert to useScroll({ container: ref })."); + } + return useScroll({ container: ref }); + } + + /** + * @deprecated useViewportScroll is deprecated. Convert to useScroll() + */ + function useViewportScroll() { + { + warnOnce(false, "useViewportScroll is deprecated. Convert to useScroll()."); + } + return useScroll(); + } + + /** + * Combine multiple motion values into a new one using a string template literal. + * + * ```jsx + * import { + * motion, + * useSpring, + * useMotionValue, + * useMotionTemplate + * } from "framer-motion" + * + * function Component() { + * const shadowX = useSpring(0) + * const shadowY = useMotionValue(0) + * const shadow = useMotionTemplate`drop-shadow(${shadowX}px ${shadowY}px 20px rgba(0,0,0,0.3))` + * + * return + * } + * ``` + * + * @public + */ + function useMotionTemplate(fragments, ...values) { + /** + * Create a function that will build a string from the latest motion values. + */ + const numFragments = fragments.length; + function buildValue() { + let output = ``; + for (let i = 0; i < numFragments; i++) { + output += fragments[i]; + const value = values[i]; + if (value) { + output += isMotionValue(value) ? value.get() : value; + } + } + return output; + } + return useCombineMotionValues(values.filter(isMotionValue), buildValue); + } + + function useFollowValue(source, options = {}) { + const { isStatic } = React$1.useContext(MotionConfigContext); + const getFromSource = () => (isMotionValue(source) ? source.get() : source); + // isStatic will never change, allowing early hooks return + if (isStatic) { + return useTransform(getFromSource); + } + const value = useMotionValue(getFromSource()); + React$1.useInsertionEffect(() => { + return attachFollow(value, source, options); + }, [value, JSON.stringify(options)]); + return value; + } + + function useSpring(source, options = {}) { + return useFollowValue(source, { type: "spring", ...options }); + } + + function useAnimationFrame(callback) { + const initialTimestamp = React$1.useRef(0); + const { isStatic } = React$1.useContext(MotionConfigContext); + React$1.useEffect(() => { + if (isStatic) + return; + const provideTimeSinceStart = ({ timestamp, delta }) => { + if (!initialTimestamp.current) + initialTimestamp.current = timestamp; + callback(timestamp - initialTimestamp.current, delta); + }; + frame.update(provideTimeSinceStart, true); + return () => cancelFrame(provideTimeSinceStart); + }, [callback]); + } + + function useTime() { + const time = useMotionValue(0); + useAnimationFrame((t) => time.set(t)); + return time; + } + + /** + * Creates a `MotionValue` that updates when the velocity of the provided `MotionValue` changes. + * + * ```javascript + * const x = useMotionValue(0) + * const xVelocity = useVelocity(x) + * const xAcceleration = useVelocity(xVelocity) + * ``` + * + * @public + */ + function useVelocity(value) { + const velocity = useMotionValue(value.getVelocity()); + const updateVelocity = () => { + const latest = value.getVelocity(); + velocity.set(latest); + /** + * If we still have velocity, schedule an update for the next frame + * to keep checking until it is zero. + */ + if (latest) + frame.update(updateVelocity); + }; + useMotionValueEvent(value, "change", () => { + // Schedule an update to this value at the end of the current frame. + frame.update(updateVelocity, false, true); + }); + return velocity; + } + + class WillChangeMotionValue extends MotionValue { + constructor() { + super(...arguments); + this.isEnabled = false; + } + add(name) { + if (transformProps.has(name) || acceleratedValues.has(name)) { + this.isEnabled = true; + this.update(); + } + } + update() { + this.set(this.isEnabled ? "transform" : "auto"); + } + } + + function useWillChange() { + return useConstant(() => new WillChangeMotionValue("auto")); + } + + /** + * A hook that returns `true` if we should be using reduced motion based on the current device's Reduced Motion setting. + * + * This can be used to implement changes to your UI based on Reduced Motion. For instance, replacing motion-sickness inducing + * `x`/`y` animations with `opacity`, disabling the autoplay of background videos, or turning off parallax motion. + * + * It will actively respond to changes and re-render your components with the latest setting. + * + * ```jsx + * export function Sidebar({ isOpen }) { + * const shouldReduceMotion = useReducedMotion() + * const closedX = shouldReduceMotion ? 0 : "-100%" + * + * return ( + * + * ) + * } + * ``` + * + * @return boolean + * + * @public + */ + function useReducedMotion() { + /** + * Lazy initialisation of prefersReducedMotion + */ + !hasReducedMotionListener.current && initPrefersReducedMotion(); + const [shouldReduceMotion] = React$1.useState(prefersReducedMotion.current); + { + warnOnce(shouldReduceMotion !== true, "You have Reduced Motion enabled on your device. Animations may not appear as expected.", "reduced-motion-disabled"); + } + /** + * TODO See if people miss automatically updating shouldReduceMotion setting + */ + return shouldReduceMotion; + } + + function useReducedMotionConfig() { + const reducedMotionPreference = useReducedMotion(); + const { reducedMotion } = React$1.useContext(MotionConfigContext); + if (reducedMotion === "never") { + return false; + } + else if (reducedMotion === "always") { + return true; + } + else { + return reducedMotionPreference; + } + } + + function stopAnimation(visualElement) { + visualElement.values.forEach((value) => value.stop()); + } + function setVariants(visualElement, variantLabels) { + const reversedLabels = [...variantLabels].reverse(); + reversedLabels.forEach((key) => { + const variant = visualElement.getVariant(key); + variant && setTarget(visualElement, variant); + if (visualElement.variantChildren) { + visualElement.variantChildren.forEach((child) => { + setVariants(child, variantLabels); + }); + } + }); + } + function setValues(visualElement, definition) { + if (Array.isArray(definition)) { + return setVariants(visualElement, definition); + } + else if (typeof definition === "string") { + return setVariants(visualElement, [definition]); + } + else { + setTarget(visualElement, definition); + } + } + /** + * @public + */ + function animationControls() { + /** + * Track whether the host component has mounted. + */ + let hasMounted = false; + /** + * A collection of linked component animation controls. + */ + const subscribers = new Set(); + const controls = { + subscribe(visualElement) { + subscribers.add(visualElement); + return () => void subscribers.delete(visualElement); + }, + start(definition, transitionOverride) { + exports.invariant(hasMounted, "controls.start() should only be called after a component has mounted. Consider calling within a useEffect hook."); + const animations = []; + subscribers.forEach((visualElement) => { + animations.push(animateVisualElement(visualElement, definition, { + transitionOverride, + })); + }); + return Promise.all(animations); + }, + set(definition) { + exports.invariant(hasMounted, "controls.set() should only be called after a component has mounted. Consider calling within a useEffect hook."); + return subscribers.forEach((visualElement) => { + setValues(visualElement, definition); + }); + }, + stop() { + subscribers.forEach((visualElement) => { + stopAnimation(visualElement); + }); + }, + mount() { + hasMounted = true; + return () => { + hasMounted = false; + controls.stop(); + }; + }, + }; + return controls; + } + + function useAnimate() { + const scope = useConstant(() => ({ + current: null, // Will be hydrated by React + animations: [], + })); + const reduceMotion = useReducedMotionConfig() ?? undefined; + const { skipAnimations } = React$1.useContext(MotionConfigContext); + const animate = React$1.useMemo(() => createScopedAnimate({ scope, reduceMotion, skipAnimations }), [scope, reduceMotion, skipAnimations]); + useUnmountEffect(() => { + scope.animations.forEach((animation) => animation.stop()); + scope.animations.length = 0; + }); + return [scope, animate]; + } + + function useAnimateMini() { + const scope = useConstant(() => ({ + current: null, // Will be hydrated by React + animations: [], + })); + const animate = useConstant(() => createScopedWaapiAnimate(scope)); + useUnmountEffect(() => { + scope.animations.forEach((animation) => animation.stop()); + }); + return [scope, animate]; + } + + /** + * Creates `LegacyAnimationControls`, which can be used to manually start, stop + * and sequence animations on one or more components. + * + * The returned `LegacyAnimationControls` should be passed to the `animate` property + * of the components you want to animate. + * + * These components can then be animated with the `start` method. + * + * ```jsx + * import * as React from 'react' + * import { motion, useAnimation } from 'framer-motion' + * + * export function MyComponent(props) { + * const controls = useAnimation() + * + * controls.start({ + * x: 100, + * transition: { duration: 0.5 }, + * }) + * + * return + * } + * ``` + * + * @returns Animation controller with `start` and `stop` methods + * + * @public + */ + function useAnimationControls() { + const controls = useConstant(animationControls); + useIsomorphicLayoutEffect(controls.mount, []); + return controls; + } + const useAnimation = useAnimationControls; + + function usePresenceData() { + const context = React$1.useContext(PresenceContext); + return context ? context.custom : undefined; + } + + /** + * Attaches an event listener directly to the provided DOM element. + * + * Bypassing React's event system can be desirable, for instance when attaching non-passive + * event handlers. + * + * ```jsx + * const ref = useRef(null) + * + * useDomEvent(ref, 'wheel', onWheel, { passive: false }) + * + * return
+ * ``` + * + * @param ref - React.RefObject that's been provided to the element you want to bind the listener to. + * @param eventName - Name of the event you want listen for. + * @param handler - Function to fire when receiving the event. + * @param options - Options to pass to `Event.addEventListener`. + * + * @public + */ + function useDomEvent(ref, eventName, handler, options) { + React$1.useEffect(() => { + const element = ref.current; + if (handler && element) { + return addDomEvent(element, eventName, handler, options); + } + }, [ref, eventName, handler, options]); + } + + /** + * Can manually trigger a drag gesture on one or more `drag`-enabled `motion` components. + * + * ```jsx + * const dragControls = useDragControls() + * + * function startDrag(event) { + * dragControls.start(event, { snapToCursor: true }) + * } + * + * return ( + * <> + *
+ * + * + * ) + * ``` + * + * @public + */ + class DragControls { + constructor() { + this.componentControls = new Set(); + } + /** + * Subscribe a component's internal `VisualElementDragControls` to the user-facing API. + * + * @internal + */ + subscribe(controls) { + this.componentControls.add(controls); + return () => this.componentControls.delete(controls); + } + /** + * Start a drag gesture on every `motion` component that has this set of drag controls + * passed into it via the `dragControls` prop. + * + * ```jsx + * dragControls.start(e, { + * snapToCursor: true + * }) + * ``` + * + * @param event - PointerEvent + * @param options - Options + * + * @public + */ + start(event, options) { + this.componentControls.forEach((controls) => { + controls.start(event.nativeEvent || event, options); + }); + } + /** + * Cancels a drag gesture. + * + * ```jsx + * dragControls.cancel() + * ``` + * + * @public + */ + cancel() { + this.componentControls.forEach((controls) => { + controls.cancel(); + }); + } + /** + * Stops a drag gesture. + * + * ```jsx + * dragControls.stop() + * ``` + * + * @public + */ + stop() { + this.componentControls.forEach((controls) => { + controls.stop(); + }); + } + } + const createDragControls = () => new DragControls(); + /** + * Usually, dragging is initiated by pressing down on a `motion` component with a `drag` prop + * and moving it. For some use-cases, for instance clicking at an arbitrary point on a video scrubber, we + * might want to initiate that dragging from a different component than the draggable one. + * + * By creating a `dragControls` using the `useDragControls` hook, we can pass this into + * the draggable component's `dragControls` prop. It exposes a `start` method + * that can start dragging from pointer events on other components. + * + * ```jsx + * const dragControls = useDragControls() + * + * function startDrag(event) { + * dragControls.start(event, { snapToCursor: true }) + * } + * + * return ( + * <> + *
+ * + * + * ) + * ``` + * + * @public + */ + function useDragControls() { + return useConstant(createDragControls); + } + + /** + * Checks if a component is a `motion` component. + */ + function isMotionComponent(component) { + return (component !== null && + typeof component === "object" && + motionComponentSymbol in component); + } + + /** + * Unwraps a `motion` component and returns either a string for `motion.div` or + * the React component for `motion(Component)`. + * + * If the component is not a `motion` component it returns undefined. + */ + function unwrapMotionComponent(component) { + if (isMotionComponent(component)) { + return component[motionComponentSymbol]; + } + return undefined; + } + + function useInstantLayoutTransition() { + return startTransition; + } + function startTransition(callback) { + if (!rootProjectionNode.current) + return; + rootProjectionNode.current.isUpdating = false; + rootProjectionNode.current.blockUpdate(); + callback && callback(); + } + + function useResetProjection() { + const reset = React$1.useCallback(() => { + const root = rootProjectionNode.current; + if (!root) + return; + root.resetTree(); + }, []); + return reset; + } + + /** + * Cycles through a series of visual properties. Can be used to toggle between or cycle through animations. It works similar to `useState` in React. It is provided an initial array of possible states, and returns an array of two arguments. + * + * An index value can be passed to the returned `cycle` function to cycle to a specific index. + * + * ```jsx + * import * as React from "react" + * import { motion, useCycle } from "framer-motion" + * + * export const MyComponent = () => { + * const [x, cycleX] = useCycle(0, 50, 100) + * + * return ( + * cycleX()} + * /> + * ) + * } + * ``` + * + * @param items - items to cycle through + * @returns [currentState, cycleState] + * + * @public + */ + function useCycle(...items) { + const index = React$1.useRef(0); + const [item, setItem] = React$1.useState(items[index.current]); + const runCycle = React$1.useCallback((next) => { + index.current = + typeof next !== "number" + ? wrap(0, items.length, index.current + 1) + : next; + setItem(items[index.current]); + }, + // The array will change on each call, but by putting items.length at + // the front of this array, we guarantee the dependency comparison will match up + // eslint-disable-next-line react-hooks/exhaustive-deps + [items.length, ...items]); + return [item, runCycle]; + } + + function useInView(ref, { root, margin, amount, once = false, initial = false, } = {}) { + const [isInView, setInView] = React$1.useState(initial); + React$1.useEffect(() => { + if (!ref.current || (once && isInView)) + return; + const onEnter = () => { + setInView(true); + return once ? undefined : () => setInView(false); + }; + const options = { + root: (root && root.current) || undefined, + margin, + amount, + }; + return inView(ref.current, onEnter, options); + }, [root, ref, margin, once, amount]); + return isInView; + } + + function useInstantTransition() { + const [forceUpdate, forcedRenderCount] = useForceUpdate(); + const startInstantLayoutTransition = useInstantLayoutTransition(); + const unlockOnFrameRef = React$1.useRef(-1); + React$1.useEffect(() => { + /** + * Unblock after two animation frames, otherwise this will unblock too soon. + */ + frame.postRender(() => frame.postRender(() => { + /** + * If the callback has been called again after the effect + * triggered this 2 frame delay, don't unblock animations. This + * prevents the previous effect from unblocking the current + * instant transition too soon. This becomes more likely when + * used in conjunction with React.startTransition(). + */ + if (forcedRenderCount !== unlockOnFrameRef.current) + return; + MotionGlobalConfig.instantAnimations = false; + })); + }, [forcedRenderCount]); + return (callback) => { + startInstantLayoutTransition(() => { + MotionGlobalConfig.instantAnimations = true; + forceUpdate(); + callback(); + unlockOnFrameRef.current = forcedRenderCount + 1; + }); + }; + } + function disableInstantTransitions() { + MotionGlobalConfig.instantAnimations = false; + } + + function usePageInView() { + const [isInView, setIsInView] = React$1.useState(true); + React$1.useEffect(() => { + const handleVisibilityChange = () => setIsInView(!document.hidden); + if (document.hidden) { + handleVisibilityChange(); + } + document.addEventListener("visibilitychange", handleVisibilityChange); + return () => { + document.removeEventListener("visibilitychange", handleVisibilityChange); + }; + }, []); + return isInView; + } + + /** + * Creates a `transformPagePoint` function that accounts for SVG viewBox scaling. + * + * When dragging SVG elements inside an SVG with a viewBox that differs from + * the rendered dimensions (e.g., `viewBox="0 0 100 100"` but rendered at 500x500 pixels), + * pointer coordinates need to be transformed to match the SVG's coordinate system. + * + * @example + * ```jsx + * function App() { + * const svgRef = useRef(null) + * + * return ( + * + * + * + * + * + * ) + * } + * ``` + * + * @param svgRef - A React ref to the SVG element + * @returns A transformPagePoint function for use with MotionConfig + * + * @public + */ + function transformViewBoxPoint(svgRef) { + return (point) => { + const svg = svgRef.current; + if (!svg) { + return point; + } + // Get the viewBox attribute + const viewBox = svg.viewBox?.baseVal; + if (!viewBox || (viewBox.width === 0 && viewBox.height === 0)) { + // No viewBox or empty viewBox - no transformation needed + return point; + } + // Get the rendered dimensions of the SVG + const bbox = svg.getBoundingClientRect(); + if (bbox.width === 0 || bbox.height === 0) { + return point; + } + // Calculate scale factors + const scaleX = viewBox.width / bbox.width; + const scaleY = viewBox.height / bbox.height; + // Get the SVG's position on the page + const svgX = bbox.left + window.scrollX; + const svgY = bbox.top + window.scrollY; + // Transform the point: + // 1. Calculate position relative to SVG + // 2. Scale by viewBox/viewport ratio + // 3. Add back the SVG position (but in SVG coordinates) + return { + x: (point.x - svgX) * scaleX + svgX, + y: (point.y - svgY) * scaleY + svgY, + }; + }; + } + + /** + * Creates a `transformPagePoint` function that corrects pointer coordinates + * for a parent container with CSS transforms (rotation, scale, skew). + * + * When dragging elements inside a transformed parent, pointer coordinates + * need to be transformed through the inverse of the parent's transform + * so the drag offset is in local space. + * + * Works with both static and continuously animating transforms. + * + * @example + * ```jsx + * function App() { + * const ref = useRef(null) + * + * return ( + * + * + * + * + * + * ) + * } + * ``` + * + * @param parentRef - A React ref to the transformed parent element + * @returns A transformPagePoint function for use with MotionConfig + * + * @public + */ + function correctParentTransform(parentRef) { + return (point) => { + const parent = parentRef.current; + if (!parent) + return point; + const inv = getInverseMatrix(parent); + if (!inv) + return point; + // Get center of rotation in page space + const rect = parent.getBoundingClientRect(); + const cx = rect.left + window.scrollX + rect.width / 2; + const cy = rect.top + window.scrollY + rect.height / 2; + // Transform (point - center) through inverse, then add center back + const dx = point.x - cx; + const dy = point.y - cy; + return { + x: cx + inv.a * dx + inv.c * dy, + y: cy + inv.b * dx + inv.d * dy, + }; + }; + } + function getInverseMatrix(element) { + const { transform } = getComputedStyle(element); + if (!transform || transform === "none") + return null; + const match = transform.match(/^matrix3d\((.*)\)$/u) || + transform.match(/^matrix\((.*)\)$/u); + if (!match) + return null; + const v = match[1].split(",").map(Number); + const is3d = transform.startsWith("matrix3d"); + const a = v[0], b = v[1]; + const c = is3d ? v[4] : v[2]; + const d = is3d ? v[5] : v[3]; + const det = a * d - b * c; + if (Math.abs(det) < 1e-10) + return null; + return { a: d / det, b: -b / det, c: -c / det, d: a / det }; + } + + const appearAnimationStore = new Map(); + const appearComplete = new Map(); + + const appearStoreId = (elementId, valueName) => { + const key = transformProps.has(valueName) ? "transform" : valueName; + return `${elementId}: ${key}`; + }; + + function handoffOptimizedAppearAnimation(elementId, valueName, frame) { + const storeId = appearStoreId(elementId, valueName); + const optimisedAnimation = appearAnimationStore.get(storeId); + if (!optimisedAnimation) { + return null; + } + const { animation, startTime } = optimisedAnimation; + function cancelAnimation() { + window.MotionCancelOptimisedAnimation?.(elementId, valueName, frame); + } + /** + * We can cancel the animation once it's finished now that we've synced + * with Motion. + * + * Prefer onfinish over finished as onfinish is backwards compatible with + * older browsers. + */ + animation.onfinish = cancelAnimation; + if (startTime === null || window.MotionHandoffIsComplete?.(elementId)) { + /** + * If the startTime is null, this animation is the Paint Ready detection animation + * and we can cancel it immediately without handoff. + * + * Or if we've already handed off the animation then we're now interrupting it. + * In which case we need to cancel it. + */ + cancelAnimation(); + return null; + } + else { + return startTime; + } + } + + /** + * A single time to use across all animations to manually set startTime + * and ensure they're all in sync. + */ + let startFrameTime; + /** + * A dummy animation to detect when Chrome is ready to start + * painting the page and hold off from triggering the real animation + * until then. We only need one animation to detect paint ready. + * + * https://bugs.chromium.org/p/chromium/issues/detail?id=1406850 + */ + let readyAnimation; + /** + * Keep track of animations that were suspended vs cancelled so we + * can easily resume them when we're done measuring layout. + */ + const suspendedAnimations = new Set(); + function resumeSuspendedAnimations() { + suspendedAnimations.forEach((data) => { + data.animation.play(); + data.animation.startTime = data.startTime; + }); + suspendedAnimations.clear(); + } + function startOptimizedAppearAnimation(element, name, keyframes, options, onReady) { + // Prevent optimised appear animations if Motion has already started animating. + if (window.MotionIsMounted) { + return; + } + const id = element.dataset[optimizedAppearDataId]; + if (!id) + return; + window.MotionHandoffAnimation = handoffOptimizedAppearAnimation; + const storeId = appearStoreId(id, name); + if (!readyAnimation) { + readyAnimation = startWaapiAnimation(element, name, [keyframes[0], keyframes[0]], + /** + * 10 secs is basically just a super-safe duration to give Chrome + * long enough to get the animation ready. + */ + { duration: 10000, ease: "linear" }); + appearAnimationStore.set(storeId, { + animation: readyAnimation, + startTime: null, + }); + /** + * If there's no readyAnimation then there's been no instantiation + * of handoff animations. + */ + window.MotionHandoffAnimation = handoffOptimizedAppearAnimation; + window.MotionHasOptimisedAnimation = (elementId, valueName) => { + if (!elementId) + return false; + /** + * Keep a map of elementIds that have started animating. We check + * via ID instead of Element because of hydration errors and + * pre-hydration checks. We also actively record IDs as they start + * animating rather than simply checking for data-appear-id as + * this attrbute might be present but not lead to an animation, for + * instance if the element's appear animation is on a different + * breakpoint. + */ + if (!valueName) { + return appearComplete.has(elementId); + } + const animationId = appearStoreId(elementId, valueName); + return Boolean(appearAnimationStore.get(animationId)); + }; + window.MotionHandoffMarkAsComplete = (elementId) => { + if (appearComplete.has(elementId)) { + appearComplete.set(elementId, true); + } + }; + window.MotionHandoffIsComplete = (elementId) => { + return appearComplete.get(elementId) === true; + }; + /** + * We only need to cancel transform animations as + * they're the ones that will interfere with the + * layout animation measurements. + */ + window.MotionCancelOptimisedAnimation = (elementId, valueName, frame, canResume) => { + const animationId = appearStoreId(elementId, valueName); + const data = appearAnimationStore.get(animationId); + if (!data) + return; + if (frame && canResume === undefined) { + /** + * Wait until the end of the subsequent frame to cancel the animation + * to ensure we don't remove the animation before the main thread has + * had a chance to resolve keyframes and render. + */ + frame.postRender(() => { + frame.postRender(() => { + data.animation.cancel(); + }); + }); + } + else { + data.animation.cancel(); + } + if (frame && canResume) { + suspendedAnimations.add(data); + frame.render(resumeSuspendedAnimations); + } + else { + appearAnimationStore.delete(animationId); + /** + * If there are no more animations left, we can remove the cancel function. + * This will let us know when we can stop checking for conflicting layout animations. + */ + if (!appearAnimationStore.size) { + window.MotionCancelOptimisedAnimation = undefined; + } + } + }; + window.MotionCheckAppearSync = (visualElement, valueName, value) => { + const appearId = getOptimisedAppearId(visualElement); + if (!appearId) + return; + const valueIsOptimised = window.MotionHasOptimisedAnimation?.(appearId, valueName); + const externalAnimationValue = visualElement.props.values?.[valueName]; + if (!valueIsOptimised || !externalAnimationValue) + return; + const removeSyncCheck = value.on("change", (latestValue) => { + if (externalAnimationValue.get() !== latestValue) { + window.MotionCancelOptimisedAnimation?.(appearId, valueName); + removeSyncCheck(); + } + }); + return removeSyncCheck; + }; + } + const startAnimation = () => { + readyAnimation.cancel(); + const appearAnimation = startWaapiAnimation(element, name, keyframes, options); + /** + * Record the time of the first started animation. We call performance.now() once + * here and once in handoff to ensure we're getting + * close to a frame-locked time. This keeps all animations in sync. + */ + if (startFrameTime === undefined) { + startFrameTime = performance.now(); + } + appearAnimation.startTime = startFrameTime; + appearAnimationStore.set(storeId, { + animation: appearAnimation, + startTime: startFrameTime, + }); + if (onReady) + onReady(appearAnimation); + }; + appearComplete.set(id, false); + if (readyAnimation.ready) { + readyAnimation.ready.then(startAnimation).catch(noop); + } + else { + startAnimation(); + } + } + + const createObject = () => ({}); + class StateVisualElement extends VisualElement { + constructor() { + super(...arguments); + this.measureInstanceViewportBox = createBox; + } + build() { } + resetTransform() { } + restoreTransform() { } + removeValueFromRenderState() { } + renderInstance() { } + scrapeMotionValuesFromProps() { + return createObject(); + } + getBaseTargetFromProps() { + return undefined; + } + readValueFromInstance(_state, key, options) { + return options.initialState[key] || 0; + } + sortInstanceNodePosition() { + return 0; + } + } + const useVisualState = makeUseVisualState({ + scrapeMotionValuesFromProps: createObject, + createRenderState: createObject, + }); + /** + * This is not an officially supported API and may be removed + * on any version. + */ + function useAnimatedState(initialState) { + const [animationState, setAnimationState] = React$1.useState(initialState); + const visualState = useVisualState({}, false); + const element = useConstant(() => { + return new StateVisualElement({ + props: { + onUpdate: (v) => { + setAnimationState({ ...v }); + }, + }, + visualState, + presenceContext: null, + }, { initialState }); + }); + React$1.useLayoutEffect(() => { + element.mount({}); + return () => element.unmount(); + }, [element]); + const startAnimation = useConstant(() => (animationDefinition) => { + return animateVisualElement(element, animationDefinition); + }); + return [animationState, startAnimation]; + } + + let id = 0; + const AnimateSharedLayout = ({ children }) => { + React__namespace.useEffect(() => { + exports.invariant(false, "AnimateSharedLayout is deprecated: https://www.framer.com/docs/guide-upgrade/##shared-layout-animations"); + }, []); + return (jsx(LayoutGroup, { id: useConstant(() => `asl-${id++}`), children: children })); + }; + + // Keep things reasonable and avoid scale: Infinity. In practise we might need + // to add another value, opacity, that could interpolate scaleX/Y [0,0.01] => [0,1] + // to simply hide content at unreasonable scales. + const maxScale = 100000; + const invertScale = (scale) => scale > 0.001 ? 1 / scale : maxScale; + let hasWarned = false; + /** + * Returns a `MotionValue` each for `scaleX` and `scaleY` that update with the inverse + * of their respective parent scales. + * + * This is useful for undoing the distortion of content when scaling a parent component. + * + * By default, `useInvertedScale` will automatically fetch `scaleX` and `scaleY` from the nearest parent. + * By passing other `MotionValue`s in as `useInvertedScale({ scaleX, scaleY })`, it will invert the output + * of those instead. + * + * ```jsx + * const MyComponent = () => { + * const { scaleX, scaleY } = useInvertedScale() + * return + * } + * ``` + * + * @deprecated + */ + function useInvertedScale(scale) { + let parentScaleX = useMotionValue(1); + let parentScaleY = useMotionValue(1); + const { visualElement } = React$1.useContext(MotionContext); + exports.invariant(!!(scale || visualElement), "If no scale values are provided, useInvertedScale must be used within a child of another motion component."); + exports.warning(hasWarned, "useInvertedScale is deprecated and will be removed in 3.0. Use the layout prop instead."); + hasWarned = true; + if (scale) { + parentScaleX = scale.scaleX || parentScaleX; + parentScaleY = scale.scaleY || parentScaleY; + } + else if (visualElement) { + parentScaleX = visualElement.getValue("scaleX", 1); + parentScaleY = visualElement.getValue("scaleY", 1); + } + const scaleX = useTransform(parentScaleX, invertScale); + const scaleY = useTransform(parentScaleY, invertScale); + return { scaleX, scaleY }; + } + + exports.AnimatePresence = AnimatePresence; + exports.AnimateSharedLayout = AnimateSharedLayout; + exports.AsyncMotionValueAnimation = AsyncMotionValueAnimation; + exports.DOMKeyframesResolver = DOMKeyframesResolver; + exports.DOMVisualElement = DOMVisualElement; + exports.DeprecatedLayoutGroupContext = DeprecatedLayoutGroupContext; + exports.DocumentProjectionNode = DocumentProjectionNode; + exports.DragControls = DragControls; + exports.Feature = Feature; + exports.FlatTree = FlatTree; + exports.GroupAnimation = GroupAnimation; + exports.GroupAnimationWithThen = GroupAnimationWithThen; + exports.HTMLProjectionNode = HTMLProjectionNode; + exports.HTMLVisualElement = HTMLVisualElement; + exports.JSAnimation = JSAnimation; + exports.KeyframeResolver = KeyframeResolver; + exports.LayoutAnimationBuilder = LayoutAnimationBuilder; + exports.LayoutGroup = LayoutGroup; + exports.LayoutGroupContext = LayoutGroupContext; + exports.LazyMotion = LazyMotion; + exports.MotionConfig = MotionConfig; + exports.MotionConfigContext = MotionConfigContext; + exports.MotionContext = MotionContext; + exports.MotionGlobalConfig = MotionGlobalConfig; + exports.MotionValue = MotionValue; + exports.NativeAnimation = NativeAnimation; + exports.NativeAnimationExtended = NativeAnimationExtended; + exports.NativeAnimationWrapper = NativeAnimationWrapper; + exports.NodeStack = NodeStack; + exports.ObjectVisualElement = ObjectVisualElement; + exports.PopChild = PopChild; + exports.PresenceChild = PresenceChild; + exports.PresenceContext = PresenceContext; + exports.Reorder = namespace; + exports.SVGVisualElement = SVGVisualElement; + exports.SubscriptionManager = SubscriptionManager; + exports.SwitchLayoutGroupContext = SwitchLayoutGroupContext; + exports.ViewTransitionBuilder = ViewTransitionBuilder; + exports.VisualElement = VisualElement; + exports.WillChangeMotionValue = WillChangeMotionValue; + exports.acceleratedValues = acceleratedValues; + exports.addAttrValue = addAttrValue; + exports.addDomEvent = addDomEvent; + exports.addPointerEvent = addPointerEvent; + exports.addPointerInfo = addPointerInfo; + exports.addScaleCorrector = addScaleCorrector; + exports.addStyleValue = addStyleValue; + exports.addUniqueItem = addUniqueItem; + exports.addValueToWillChange = addValueToWillChange; + exports.alpha = alpha; + exports.analyseComplexValue = analyseComplexValue; + exports.animate = animate; + exports.animateMini = animateMini; + exports.animateMotionValue = animateMotionValue; + exports.animateSingleValue = animateSingleValue; + exports.animateTarget = animateTarget; + exports.animateValue = animateValue; + exports.animateVariant = animateVariant; + exports.animateView = animateView; + exports.animateVisualElement = animateVisualElement; + exports.animationControls = animationControls; + exports.animationMapKey = animationMapKey; + exports.animations = animations; + exports.anticipate = anticipate; + exports.applyAxisDelta = applyAxisDelta; + exports.applyBoxDelta = applyBoxDelta; + exports.applyGeneratorOptions = applyGeneratorOptions; + exports.applyPointDelta = applyPointDelta; + exports.applyPxDefaults = applyPxDefaults; + exports.applyTreeDeltas = applyTreeDeltas; + exports.arc = arc; + exports.aspectRatio = aspectRatio; + exports.attachFollow = attachFollow; + exports.attachSpring = attachSpring; + exports.attrEffect = attrEffect; + exports.axisDeltaEquals = axisDeltaEquals; + exports.axisEquals = axisEquals; + exports.axisEqualsRounded = axisEqualsRounded; + exports.backIn = backIn; + exports.backInOut = backInOut; + exports.backOut = backOut; + exports.boxEquals = boxEquals; + exports.boxEqualsRounded = boxEqualsRounded; + exports.buildHTMLStyles = buildHTMLStyles; + exports.buildProjectionTransform = buildProjectionTransform; + exports.buildSVGAttrs = buildSVGAttrs; + exports.buildSVGPath = buildSVGPath; + exports.buildTransform = buildTransform; + exports.calcAxisDelta = calcAxisDelta; + exports.calcBoxDelta = calcBoxDelta; + exports.calcChildStagger = calcChildStagger; + exports.calcGeneratorDuration = calcGeneratorDuration; + exports.calcLength = calcLength; + exports.calcRelativeAxis = calcRelativeAxis; + exports.calcRelativeAxisPosition = calcRelativeAxisPosition; + exports.calcRelativeBox = calcRelativeBox; + exports.calcRelativePosition = calcRelativePosition; + exports.camelCaseAttributes = camelCaseAttributes; + exports.camelToDash = camelToDash; + exports.cancelFrame = cancelFrame; + exports.cancelMicrotask = cancelMicrotask; + exports.cancelSync = cancelSync; + exports.checkVariantsDidChange = checkVariantsDidChange; + exports.circIn = circIn; + exports.circInOut = circInOut; + exports.circOut = circOut; + exports.clamp = clamp; + exports.cleanDirtyNodes = cleanDirtyNodes; + exports.collectMotionValues = collectMotionValues; + exports.color = color; + exports.compareByDepth = compareByDepth; + exports.complex = complex; + exports.containsCSSVariable = containsCSSVariable; + exports.convertBoundingBoxToBox = convertBoundingBoxToBox; + exports.convertBoxToBoundingBox = convertBoxToBoundingBox; + exports.convertOffsetToTimes = convertOffsetToTimes; + exports.copyAxisDeltaInto = copyAxisDeltaInto; + exports.copyAxisInto = copyAxisInto; + exports.copyBoxInto = copyBoxInto; + exports.correctBorderRadius = correctBorderRadius; + exports.correctBoxShadow = correctBoxShadow; + exports.correctParentTransform = correctParentTransform; + exports.createAnimationState = createAnimationState; + exports.createAxis = createAxis; + exports.createAxisDelta = createAxisDelta; + exports.createBox = createBox; + exports.createDelta = createDelta; + exports.createGeneratorEasing = createGeneratorEasing; + exports.createProjectionNode = createProjectionNode$1; + exports.createRenderBatcher = createRenderBatcher; + exports.createScopedAnimate = createScopedAnimate; + exports.cubicBezier = cubicBezier; + exports.cubicBezierAsString = cubicBezierAsString; + exports.defaultEasing = defaultEasing; + exports.defaultOffset = defaultOffset$1; + exports.defaultTransformValue = defaultTransformValue; + exports.defaultValueTypes = defaultValueTypes; + exports.degrees = degrees; + exports.delay = delay; + exports.delayInSeconds = delayInSeconds; + exports.dimensionValueTypes = dimensionValueTypes; + exports.disableInstantTransitions = disableInstantTransitions; + exports.distance = distance; + exports.distance2D = distance2D; + exports.domAnimation = domAnimation; + exports.domMax = domMax; + exports.domMin = domMin; + exports.eachAxis = eachAxis; + exports.easeIn = easeIn; + exports.easeInOut = easeInOut; + exports.easeOut = easeOut; + exports.easingDefinitionToFunction = easingDefinitionToFunction; + exports.fillOffset = fillOffset; + exports.fillWildcards = fillWildcards; + exports.filterProps = filterProps; + exports.findDimensionValueType = findDimensionValueType; + exports.findValueType = findValueType; + exports.flushKeyframeResolvers = flushKeyframeResolvers; + exports.followValue = followValue; + exports.frame = frame; + exports.frameData = frameData; + exports.frameSteps = frameSteps; + exports.generateLinearEasing = generateLinearEasing; + exports.getAnimatableNone = getAnimatableNone; + exports.getAnimationMap = getAnimationMap; + exports.getComputedStyle = getComputedStyle$2; + exports.getDefaultTransition = getDefaultTransition; + exports.getDefaultValueType = getDefaultValueType; + exports.getEasingForSegment = getEasingForSegment; + exports.getFeatureDefinitions = getFeatureDefinitions; + exports.getFinalKeyframe = getFinalKeyframe; + exports.getMixer = getMixer; + exports.getOptimisedAppearId = getOptimisedAppearId; + exports.getOriginIndex = getOriginIndex; + exports.getValueAsType = getValueAsType; + exports.getValueTransition = getValueTransition$1; + exports.getVariableValue = getVariableValue; + exports.getVariantContext = getVariantContext; + exports.getViewAnimationLayerInfo = getViewAnimationLayerInfo; + exports.getViewAnimations = getViewAnimations; + exports.globalProjectionState = globalProjectionState; + exports.has2DTranslate = has2DTranslate; + exports.hasReducedMotionListener = hasReducedMotionListener; + exports.hasScale = hasScale; + exports.hasTransform = hasTransform; + exports.hasWarned = hasWarned$1; + exports.hex = hex; + exports.hover = hover; + exports.hsla = hsla; + exports.hslaToRgba = hslaToRgba; + exports.inView = inView; + exports.inertia = inertia; + exports.initPrefersReducedMotion = initPrefersReducedMotion; + exports.interpolate = interpolate; + exports.invisibleValues = invisibleValues; + exports.isAnimationControls = isAnimationControls; + exports.isBezierDefinition = isBezierDefinition; + exports.isBrowser = isBrowser$1; + exports.isCSSVariableName = isCSSVariableName; + exports.isCSSVariableToken = isCSSVariableToken; + exports.isControllingVariants = isControllingVariants; + exports.isDeltaZero = isDeltaZero; + exports.isDragActive = isDragActive; + exports.isDragging = isDragging; + exports.isEasingArray = isEasingArray; + exports.isElementKeyboardAccessible = isElementKeyboardAccessible; + exports.isElementTextInput = isElementTextInput; + exports.isForcedMotionValue = isForcedMotionValue; + exports.isGenerator = isGenerator; + exports.isHTMLElement = isHTMLElement; + exports.isKeyframesTarget = isKeyframesTarget; + exports.isMotionComponent = isMotionComponent; + exports.isMotionValue = isMotionValue; + exports.isNear = isNear; + exports.isNodeOrChild = isNodeOrChild; + exports.isNumericalString = isNumericalString; + exports.isObject = isObject; + exports.isPrimaryPointer = isPrimaryPointer; + exports.isSVGElement = isSVGElement; + exports.isSVGSVGElement = isSVGSVGElement; + exports.isSVGTag = isSVGTag; + exports.isTransitionDefined = isTransitionDefined; + exports.isValidMotionProp = isValidMotionProp; + exports.isVariantLabel = isVariantLabel; + exports.isVariantNode = isVariantNode; + exports.isWaapiSupportedEasing = isWaapiSupportedEasing; + exports.isWillChangeMotionValue = isWillChangeMotionValue; + exports.isZeroValueString = isZeroValueString; + exports.keyframes = keyframes; + exports.m = m; + exports.makeAnimationInstant = makeAnimationInstant; + exports.makeUseVisualState = makeUseVisualState; + exports.mapEasingToNativeEasing = mapEasingToNativeEasing; + exports.mapValue = mapValue; + exports.maxGeneratorDuration = maxGeneratorDuration; + exports.measurePageBox = measurePageBox; + exports.measureViewportBox = measureViewportBox; + exports.memo = memo; + exports.microtask = microtask; + exports.millisecondsToSeconds = millisecondsToSeconds; + exports.mirrorEasing = mirrorEasing; + exports.mix = mix; + exports.mixArray = mixArray; + exports.mixColor = mixColor; + exports.mixComplex = mixComplex; + exports.mixImmediate = mixImmediate; + exports.mixLinearColor = mixLinearColor; + exports.mixNumber = mixNumber$1; + exports.mixObject = mixObject; + exports.mixValues = mixValues; + exports.mixVisibility = mixVisibility; + exports.motion = motion; + exports.motionValue = motionValue; + exports.moveItem = moveItem; + exports.nodeGroup = nodeGroup; + exports.noop = noop; + exports.number = number; + exports.numberValueTypes = numberValueTypes; + exports.observeTimeline = observeTimeline; + exports.optimizedAppearDataAttribute = optimizedAppearDataAttribute; + exports.optimizedAppearDataId = optimizedAppearDataId; + exports.parseAnimateLayoutArgs = parseAnimateLayoutArgs; + exports.parseCSSVariable = parseCSSVariable; + exports.parseValueFromTransform = parseValueFromTransform; + exports.percent = percent; + exports.pipe = pipe; + exports.pixelsToPercent = pixelsToPercent; + exports.positionalKeys = positionalKeys; + exports.prefersReducedMotion = prefersReducedMotion; + exports.press = press; + exports.progress = progress; + exports.progressPercentage = progressPercentage; + exports.propEffect = propEffect; + exports.propagateDirtyNodes = propagateDirtyNodes; + exports.px = px; + exports.readTransformValue = readTransformValue; + exports.recordStats = recordStats; + exports.removeAxisDelta = removeAxisDelta; + exports.removeAxisTransforms = removeAxisTransforms; + exports.removeBoxTransforms = removeBoxTransforms; + exports.removeItem = removeItem; + exports.removePointDelta = removePointDelta; + exports.renderHTML = renderHTML; + exports.renderSVG = renderSVG; + exports.resize = resize; + exports.resolveElements = resolveElements; + exports.resolveMotionValue = resolveMotionValue; + exports.resolveTransition = resolveTransition; + exports.resolveVariant = resolveVariant; + exports.resolveVariantFromProps = resolveVariantFromProps; + exports.reverseEasing = reverseEasing; + exports.rgbUnit = rgbUnit; + exports.rgba = rgba; + exports.rootProjectionNode = rootProjectionNode; + exports.scale = scale; + exports.scaleCorrectors = scaleCorrectors; + exports.scalePoint = scalePoint; + exports.scrapeHTMLMotionValuesFromProps = scrapeMotionValuesFromProps$1; + exports.scrapeSVGMotionValuesFromProps = scrapeMotionValuesFromProps; + exports.scroll = scroll; + exports.scrollInfo = scrollInfo; + exports.secondsToMilliseconds = secondsToMilliseconds; + exports.setDragLock = setDragLock; + exports.setFeatureDefinitions = setFeatureDefinitions; + exports.setStyle = setStyle; + exports.setTarget = setTarget; + exports.spring = spring; + exports.springValue = springValue; + exports.stagger = stagger; + exports.startOptimizedAppearAnimation = startOptimizedAppearAnimation; + exports.startWaapiAnimation = startWaapiAnimation; + exports.statsBuffer = statsBuffer; + exports.steps = steps; + exports.styleEffect = styleEffect; + exports.supportedWaapiEasing = supportedWaapiEasing; + exports.supportsBrowserAnimation = supportsBrowserAnimation; + exports.supportsFlags = supportsFlags; + exports.supportsLinearEasing = supportsLinearEasing; + exports.supportsPartialKeyframes = supportsPartialKeyframes; + exports.supportsScrollTimeline = supportsScrollTimeline; + exports.supportsViewTimeline = supportsViewTimeline; + exports.svgEffect = svgEffect; + exports.sync = sync; + exports.testValueType = testValueType; + exports.time = time; + exports.transform = transform; + exports.transformAxis = transformAxis; + exports.transformBox = transformBox; + exports.transformBoxPoints = transformBoxPoints; + exports.transformPropOrder = transformPropOrder; + exports.transformProps = transformProps; + exports.transformValue = transformValue; + exports.transformValueTypes = transformValueTypes; + exports.transformViewBoxPoint = transformViewBoxPoint; + exports.translateAxis = translateAxis; + exports.unwrapMotionComponent = unwrapMotionComponent; + exports.updateMotionValuesFromProps = updateMotionValuesFromProps; + exports.useAnimate = useAnimate; + exports.useAnimateMini = useAnimateMini; + exports.useAnimation = useAnimation; + exports.useAnimationControls = useAnimationControls; + exports.useAnimationFrame = useAnimationFrame; + exports.useComposedRefs = useComposedRefs; + exports.useCycle = useCycle; + exports.useDeprecatedAnimatedState = useAnimatedState; + exports.useDeprecatedInvertedScale = useInvertedScale; + exports.useDomEvent = useDomEvent; + exports.useDragControls = useDragControls; + exports.useElementScroll = useElementScroll; + exports.useFollowValue = useFollowValue; + exports.useForceUpdate = useForceUpdate; + exports.useInView = useInView; + exports.useInstantLayoutTransition = useInstantLayoutTransition; + exports.useInstantTransition = useInstantTransition; + exports.useIsPresent = useIsPresent; + exports.useIsomorphicLayoutEffect = useIsomorphicLayoutEffect; + exports.useMotionTemplate = useMotionTemplate; + exports.useMotionValue = useMotionValue; + exports.useMotionValueEvent = useMotionValueEvent; + exports.usePageInView = usePageInView; + exports.usePresence = usePresence; + exports.usePresenceData = usePresenceData; + exports.useReducedMotion = useReducedMotion; + exports.useReducedMotionConfig = useReducedMotionConfig; + exports.useResetProjection = useResetProjection; + exports.useScroll = useScroll; + exports.useSpring = useSpring; + exports.useTime = useTime; + exports.useTransform = useTransform; + exports.useUnmountEffect = useUnmountEffect; + exports.useVelocity = useVelocity; + exports.useViewportScroll = useViewportScroll; + exports.useWillChange = useWillChange; + exports.variantPriorityOrder = variantPriorityOrder; + exports.variantProps = variantProps; + exports.velocityPerSecond = velocityPerSecond; + exports.vh = vh; + exports.visualElementStore = visualElementStore; + exports.vw = vw; + exports.warnOnce = warnOnce; + exports.wrap = wrap; + +})); diff --git a/node_modules/framer-motion/dist/framer-motion.js b/node_modules/framer-motion/dist/framer-motion.js new file mode 100644 index 0000000..64b1eae --- /dev/null +++ b/node_modules/framer-motion/dist/framer-motion.js @@ -0,0 +1 @@ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Motion={},t.React)}(this,function(t,e){"use strict";function n(t){var e=Object.create(null);return t&&Object.keys(t).forEach(function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}}),e.default=t,Object.freeze(e)}var i=n(e),o=React,s=Symbol.for("react.element"),r=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,l=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function u(t,e,n){var i,o={},r=null,u=null;for(i in void 0!==n&&(r=""+n),void 0!==e.key&&(r=""+e.key),void 0!==e.ref&&(u=e.ref),e)a.call(e,i)&&!c.hasOwnProperty(i)&&(o[i]=e[i]);if(t&&t.defaultProps)for(i in e=t.defaultProps)void 0===o[i]&&(o[i]=e[i]);return{$$typeof:s,type:t,key:r,ref:u,props:o,_owner:l.current}}const h=r,d=u,p=u,m=e.createContext({});function f(t){const n=e.useRef(null);return null===n.current&&(n.current=t()),n.current}const g="undefined"!=typeof window,y=g?e.useLayoutEffect:e.useEffect,v=e.createContext(null);function x(t,e){-1===t.indexOf(e)&&t.push(e)}function w(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}function S([...t],e,n){const i=e<0?t.length+e:e;if(i>=0&&in>e?e:n{},t.invariant=()=>{},"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(t.warning=(t,e,n)=>{t||"undefined"==typeof console||console.warn(T(e,n))},t.invariant=(t,e,n)=>{if(!t)throw new Error(T(e,n))});const P={},E=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),A=t=>"object"==typeof t&&null!==t,M=t=>/^0[^.\s]+$/u.test(t);function C(t){let e;return()=>(void 0===e&&(e=t()),e)}const V=t=>t,k=(...t)=>t.reduce((t,e)=>n=>e(t(n))),D=(t,e,n)=>{const i=e-t;return i?(n-t)/i:1};class R{constructor(){this.subscriptions=[]}add(t){return x(this.subscriptions,t),()=>w(this.subscriptions,t)}notify(t,e,n){const i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](t,e,n);else for(let o=0;o1e3*t,B=t=>t/1e3,O=(t,e)=>e?t*(1e3/e):0,j=new Set;function I(t,e,n){t||j.has(e)||(console.warn(T(e,n)),j.add(e))}const F=(t,e,n)=>{const i=e-t;return((n-t)%i+i)%i+t},W=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function $(t,e,n,i){if(t===e&&n===i)return V;const o=e=>function(t,e,n,i,o){let s,r,a=0;do{r=e+(n-e)/2,s=W(r,i,o)-t,s>0?n=r:e=r}while(Math.abs(s)>1e-7&&++a<12);return r}(e,0,1,t,n);return t=>0===t||1===t?t:W(o(t),e,i)}const N=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,U=t=>e=>1-t(1-e),z=$(.33,1.53,.69,.99),Y=U(z),H=N(Y),X=t=>t>=1?1:(t*=2)<1?.5*Y(t):.5*(2-Math.pow(2,-10*(t-1))),G=t=>1-Math.sin(Math.acos(t)),K=U(G),_=N(G),q=$(.42,0,1,1),Z=$(0,0,.58,1),J=$(.42,0,.58,1);const Q=t=>Array.isArray(t)&&"number"!=typeof t[0];function tt(t,e){return Q(t)?t[F(0,t.length,e)]:t}const et=t=>Array.isArray(t)&&"number"==typeof t[0],nt={linear:V,easeIn:q,easeInOut:J,easeOut:Z,circIn:G,circInOut:_,circOut:K,backIn:Y,backInOut:H,backOut:z,anticipate:X},it=e=>{if(et(e)){t.invariant(4===e.length,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[n,i,o,s]=e;return $(n,i,o,s)}return"string"==typeof e?(t.invariant(void 0!==nt[e],`Invalid easing type '${e}'`,"invalid-easing-type"),nt[e]):e},ot=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function st(t,e){let n=!1,i=!0;const o={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,r=ot.reduce((t,e)=>(t[e]=function(t){let e=new Set,n=new Set,i=!1,o=!1;const s=new WeakSet;let r={delta:0,timestamp:0,isProcessing:!1};function a(e){s.has(e)&&(l.schedule(e),t()),e(r)}const l={schedule:(t,o=!1,r=!1)=>{const a=r&&i?e:n;return o&&s.add(t),a.add(t),t},cancel:t=>{n.delete(t),s.delete(t)},process:t=>{if(r=t,i)return void(o=!0);i=!0;const s=e;e=n,n=s,e.forEach(a),e.clear(),i=!1,o&&(o=!1,l.process(t))}};return l}(s),t),{}),{setup:a,read:l,resolveKeyframes:c,preUpdate:u,update:h,preRender:d,render:p,postRender:m}=r,f=()=>{const s=P.useManualTiming,r=s?o.timestamp:performance.now();n=!1,s||(o.delta=i?1e3/60:Math.max(Math.min(r-o.timestamp,40),1)),o.timestamp=r,o.isProcessing=!0,a.process(o),l.process(o),c.process(o),u.process(o),h.process(o),d.process(o),p.process(o),m.process(o),o.isProcessing=!1,n&&e&&(i=!1,t(f))};return{schedule:ot.reduce((e,s)=>{const a=r[s];return e[s]=(e,s=!1,r=!1)=>(n||(n=!0,i=!0,o.isProcessing||t(f)),a.schedule(e,s,r)),e},{}),cancel:t=>{for(let e=0;e(void 0===ut&&dt.set(lt.isProcessing||P.useManualTiming?lt.timestamp:performance.now()),ut),set:t=>{ut=t,queueMicrotask(ht)}},pt=t=>e=>"string"==typeof e&&e.startsWith(t),mt=pt("--"),ft=pt("var(--"),gt=t=>!!ft(t)&&yt.test(t.split("/*")[0].trim()),yt=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function vt(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const xt={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},wt={...xt,transform:t=>b(0,1,t)},St={...xt,default:1},bt=t=>Math.round(1e5*t)/1e5,Tt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const Pt=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Et=(t,e)=>n=>Boolean("string"==typeof n&&Pt.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),At=(t,e,n)=>i=>{if("string"!=typeof i)return i;const[o,s,r,a]=i.match(Tt);return{[t]:parseFloat(o),[e]:parseFloat(s),[n]:parseFloat(r),alpha:void 0!==a?parseFloat(a):1}},Mt={...xt,transform:t=>Math.round((t=>b(0,255,t))(t))},Ct={test:Et("rgb","red"),parse:At("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+Mt.transform(t)+", "+Mt.transform(e)+", "+Mt.transform(n)+", "+bt(wt.transform(i))+")"};const Vt={test:Et("#"),parse:function(t){let e="",n="",i="",o="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),i=t.substring(5,7),o=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),i=t.substring(3,4),o=t.substring(4,5),e+=e,n+=n,i+=i,o+=o),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:o?parseInt(o,16)/255:1}},transform:Ct.transform},kt=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),Dt=kt("deg"),Rt=kt("%"),Lt=kt("px"),Bt=kt("vh"),Ot=kt("vw"),jt=(()=>({...Rt,parse:t=>Rt.parse(t)/100,transform:t=>Rt.transform(100*t)}))(),It={test:Et("hsl","hue"),parse:At("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+Rt.transform(bt(e))+", "+Rt.transform(bt(n))+", "+bt(wt.transform(i))+")"},Ft={test:t=>Ct.test(t)||Vt.test(t)||It.test(t),parse:t=>Ct.test(t)?Ct.parse(t):It.test(t)?It.parse(t):Vt.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?Ct.transform(t):It.transform(t),getAnimatableNone:t=>{const e=Ft.parse(t);return e.alpha=0,Ft.transform(e)}},Wt=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const $t="number",Nt="color",Ut=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function zt(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},o=[];let s=0;const r=e.replace(Ut,t=>(Ft.test(t)?(i.color.push(s),o.push(Nt),n.push(Ft.parse(t))):t.startsWith("var(")?(i.var.push(s),o.push("var"),n.push(t)):(i.number.push(s),o.push($t),n.push(parseFloat(t))),++s,"${}")).split("${}");return{values:n,split:r,indexes:i,types:o}}function Yt({split:t,types:e}){const n=t.length;return i=>{let o="";for(let s=0;s{return"number"==typeof t?e?.trim().endsWith("/")?t:0:"number"==typeof(n=t)?0:Ft.test(n)?Ft.getAnimatableNone(n):n;var n};const Xt={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(Tt)?.length||0)+(t.match(Wt)?.length||0)>0},parse:function(t){return zt(t).values},createTransformer:function(t){return Yt(zt(t))},getAnimatableNone:function(t){const e=zt(t);return Yt(e)(e.values.map((t,n)=>Ht(t,e.split[n])))}};function Gt(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function Kt({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let o=0,s=0,r=0;if(e/=100){const i=n<.5?n*(1+e):n+e-n*e,a=2*n-i;o=Gt(a,i,t+1/3),s=Gt(a,i,t),r=Gt(a,i,t-1/3)}else o=s=r=n;return{red:Math.round(255*o),green:Math.round(255*s),blue:Math.round(255*r),alpha:i}}function _t(t,e){return n=>n>0?e:t}const qt=(t,e,n)=>t+(e-t)*n,Zt=(t,e,n)=>{const i=t*t,o=n*(e*e-i)+i;return o<0?0:Math.sqrt(o)},Jt=[Vt,Ct,It];function Qt(e){const n=(i=e,Jt.find(t=>t.test(i)));var i;if(t.warning(Boolean(n),`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!Boolean(n))return!1;let o=n.parse(e);return n===It&&(o=Kt(o)),o}const te=(t,e)=>{const n=Qt(t),i=Qt(e);if(!n||!i)return _t(t,e);const o={...n};return t=>(o.red=Zt(n.red,i.red,t),o.green=Zt(n.green,i.green,t),o.blue=Zt(n.blue,i.blue,t),o.alpha=qt(n.alpha,i.alpha,t),Ct.transform(o))},ee=new Set(["none","hidden"]);function ne(t,e){return ee.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function ie(t,e){return n=>qt(t,e,n)}function oe(t){return"number"==typeof t?ie:"string"==typeof t?gt(t)?_t:Ft.test(t)?te:ae:Array.isArray(t)?se:"object"==typeof t?Ft.test(t)?te:re:_t}function se(t,e){const n=[...t],i=n.length,o=t.map((t,n)=>oe(t)(t,e[n]));return t=>{for(let e=0;e{for(const e in i)n[e]=i[e](t);return n}}const ae=(e,n)=>{const i=Xt.createTransformer(n),o=zt(e),s=zt(n);return o.indexes.var.length===s.indexes.var.length&&o.indexes.color.length===s.indexes.color.length&&o.indexes.number.length>=s.indexes.number.length?ee.has(e)&&!s.values.length||ee.has(n)&&!o.values.length?ne(e,n):k(se(function(t,e){const n=[],i={color:0,var:0,number:0};for(let o=0;o{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>rt.update(e,t),stop:()=>at(e),now:()=>lt.isProcessing?lt.timestamp:dt.now()}},ue=(t,e,n=10)=>{let i="";const o=Math.max(Math.round(e/n),2);for(let e=0;e=he?1/0:e}function pe(t,e=100,n){const i=n({...t,keyframes:[0,e]}),o=Math.min(de(i),he);return{type:"keyframes",ease:t=>i.next(o*t).value/e,duration:B(o)}}const me=100,fe=10,ge=1,ye=0,ve=800,xe=.3,we=.3,Se={granular:.01,default:2},be={granular:.005,default:.5},Te=.01,Pe=10,Ee=.05,Ae=1;function Me(t,e){return t*Math.sqrt(1-e*e)}const Ce=.001;const Ve=["duration","bounce"],ke=["stiffness","damping","mass"];function De(t,e){return e.some(e=>void 0!==t[e])}function Re(e){let n={velocity:ye,stiffness:me,damping:fe,mass:ge,isResolvedFromDuration:!1,...e};if(!De(e,ke)&&De(e,Ve))if(n.velocity=0,e.visualDuration){const t=e.visualDuration,i=2*Math.PI/(1.2*t),o=i*i,s=2*b(.05,1,1-(e.bounce||0))*Math.sqrt(o);n={...n,mass:ge,stiffness:o,damping:s}}else{const i=function({duration:e=ve,bounce:n=xe,velocity:i=ye,mass:o=ge}){let s,r;t.warning(e<=L(Pe),"Spring duration must be 10 seconds or less","spring-duration-limit");let a=1-n;a=b(Ee,Ae,a),e=b(Te,Pe,B(e)),a<1?(s=t=>{const n=t*a,o=n*e,s=n-i,r=Me(t,a),l=Math.exp(-o);return Ce-s/r*l},r=t=>{const n=t*a*e,o=n*i+i,r=Math.pow(a,2)*Math.pow(t,2)*e,l=Math.exp(-n),c=Me(Math.pow(t,2),a);return(-s(t)+Ce>0?-1:1)*((o-r)*l)/c}):(s=t=>Math.exp(-t*e)*((t-i)*e+1)-.001,r=t=>Math.exp(-t*e)*(e*e*(i-t)));const l=function(t,e,n){let i=n;for(let n=1;n<12;n++)i-=t(i)/e(i);return i}(s,r,5/e);if(e=L(e),isNaN(l))return{stiffness:me,damping:fe,duration:e};{const t=Math.pow(l,2)*o;return{stiffness:t,damping:2*a*Math.sqrt(o*t),duration:e}}}({...e,velocity:0});n={...n,...i,mass:ge},n.isResolvedFromDuration=!0}return n}function Le(t=we,e=xe){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:i,restDelta:o}=n;const s=n.keyframes[0],r=n.keyframes[n.keyframes.length-1],a={done:!1,value:s},{stiffness:l,damping:c,mass:u,duration:h,velocity:d,isResolvedFromDuration:p}=Re({...n,velocity:-B(n.velocity||0)}),m=d||0,f=c/(2*Math.sqrt(l*u)),g=r-s,y=B(Math.sqrt(l/u)),v=Math.abs(g)<5;let x,w,S,b,T,P;if(i||(i=v?Se.granular:Se.default),o||(o=v?be.granular:be.default),f<1)S=Me(y,f),b=(m+f*y*g)/S,x=t=>{const e=Math.exp(-f*y*t);return r-e*(b*Math.sin(S*t)+g*Math.cos(S*t))},T=f*y*b+g*S,P=f*y*g-b*S,w=t=>Math.exp(-f*y*t)*(T*Math.sin(S*t)+P*Math.cos(S*t));else if(1===f){x=t=>r-Math.exp(-y*t)*(g+(m+y*g)*t);const t=m+y*g;w=e=>Math.exp(-y*e)*(y*t*e-m)}else{const t=y*Math.sqrt(f*f-1);x=e=>{const n=Math.exp(-f*y*e),i=Math.min(t*e,300);return r-n*((m+f*y*g)*Math.sinh(i)+t*g*Math.cosh(i))/t};const e=(m+f*y*g)/t,n=f*y*e-g*t,i=f*y*g-e*t;w=e=>{const o=Math.exp(-f*y*e),s=Math.min(t*e,300);return o*(n*Math.sinh(s)+i*Math.cosh(s))}}const E={calculatedDuration:p&&h||null,velocity:t=>L(w(t)),next:t=>{if(!p&&f<1){const e=Math.exp(-f*y*t),n=Math.sin(S*t),s=Math.cos(S*t),l=r-e*(b*n+g*s),c=L(e*(T*n+P*s));return a.done=Math.abs(c)<=i&&Math.abs(r-l)<=o,a.value=a.done?r:l,a}const e=x(t);if(p)a.done=t>=h;else{const n=L(w(t));a.done=Math.abs(n)<=i&&Math.abs(r-e)<=o}return a.value=a.done?r:e,a},toString:()=>{const t=Math.min(de(E),he),e=ue(e=>E.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return E}Le.applyToOptions=t=>{const e=pe(t,100,Le);return t.ease=e.ease,t.duration=L(e.duration),t.type="keyframes",t};function Be(t,e,n){const i=Math.max(e-5,0);return O(n-t(i),e-i)}function Oe({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:o=10,bounceStiffness:s=500,modifyTarget:r,min:a,max:l,restDelta:c=.5,restSpeed:u}){const h=t[0],d={done:!1,value:h},p=t=>void 0===a?l:void 0===l||Math.abs(a-t)-m*Math.exp(-t/i),v=t=>g+y(t),x=t=>{const e=y(t),n=v(t);d.done=Math.abs(e)<=c,d.value=d.done?g:n};let w,S;const b=t=>{var e;(e=d.value,void 0!==a&&el)&&(w=t,S=Le({keyframes:[d.value,p(d.value)],velocity:Be(v,t,d.value),damping:o,stiffness:s,restDelta:c,restSpeed:u}))};return b(0),{calculatedDuration:null,next:t=>{let e=!1;return S||void 0!==w||(e=!0,x(t),b(t)),void 0!==w&&t>=w?S.next(t-w):(!e&&x(t),d)}}}function je(e,n,{clamp:i=!0,ease:o,mixer:s}={}){const r=e.length;if(t.invariant(r===n.length,"Both input and output ranges must be the same length","range-length"),1===r)return()=>n[0];if(2===r&&n[0]===n[1])return()=>n[1];const a=e[0]===e[1];e[0]>e[r-1]&&(e=[...e].reverse(),n=[...n].reverse());const l=function(t,e,n){const i=[],o=n||P.mix||le,s=t.length-1;for(let n=0;n{if(a&&t1)for(;iu(b(e[0],e[r-1],t)):u}function Ie(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const o=D(0,e,i);t.push(qt(n,1,o))}}function Fe(t){const e=[0];return Ie(e,t.length-1),e}function We(t,e){return t.map(t=>t*e)}function $e(t,e){return t.map(()=>e||J).splice(0,t.length-1)}function Ne({duration:t=300,keyframes:e,times:n,ease:i="easeInOut"}){const o=Q(i)?i.map(it):it(i),s={done:!1,value:e[0]},r=je(We(n&&n.length===e.length?n:Fe(e),t),e,{ease:Array.isArray(o)?o:$e(e,o)});return{calculatedDuration:t,next:e=>(s.value=r(e),s.done=e>=t,s)}}const Ue=t=>null!==t;function ze(t,{repeat:e,repeatType:n="loop"},i,o=1){const s=t.filter(Ue),r=o<0||e&&"loop"!==n&&e%2==1?0:s.length-1;return r&&void 0!==i?i:s[r]}const Ye={decay:Oe,inertia:Oe,tween:Ne,keyframes:Ne,spring:Le};function He(t){"string"==typeof t.type&&(t.type=Ye[t.type])}class Xe{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const Ge=t=>t/100;class Ke extends Xe{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:t}=this.options;t&&t.updatedAt!==dt.now()&&this.tick(dt.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;He(t);const{type:e=Ne,repeat:n=0,repeatDelay:i=0,repeatType:o,velocity:s=0}=t;let{keyframes:r}=t;const a=e||Ne;a!==Ne&&"number"!=typeof r[0]&&(this.mixKeyframes=k(Ge,le(r[0],r[1])),r=[0,100]);const l=a({...t,keyframes:r});"mirror"===o&&(this.mirroredGenerator=a({...t,keyframes:[...r].reverse(),velocity:-s})),null===l.calculatedDuration&&(l.calculatedDuration=de(l));const{calculatedDuration:c}=l;this.calculatedDuration=c,this.resolvedDuration=c+i,this.totalDuration=this.resolvedDuration*(n+1)-i,this.generator=l}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,e=!1){const{generator:n,totalDuration:i,mixKeyframes:o,mirroredGenerator:s,resolvedDuration:r,calculatedDuration:a}=this;if(null===this.startTime)return n.next(0);const{delay:l=0,keyframes:c,repeat:u,repeatType:h,repeatDelay:d,type:p,onUpdate:m,finalKeyframe:f}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const g=this.currentTime-l*(this.playbackSpeed>=0?1:-1),y=this.playbackSpeed>=0?g<0:g>i;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=i);let v,x=this.currentTime,w=n;if(u){const t=Math.min(this.currentTime,i)/r;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,u+1);Boolean(e%2)&&("reverse"===h?(n=1-n,d&&(n-=d/r)):"mirror"===h&&(w=s)),x=b(0,1,n)*r}y?(this.delayState.value=c[0],v=this.delayState):v=w.next(x),o&&!y&&(v.value=o(v.value));let{done:S}=v;y||null===a||(S=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const T=null===this.holdTime&&("finished"===this.state||"running"===this.state&&S);return T&&p!==Oe&&(v.value=ze(c,this.options,f,this.speed)),m&&m(v.value),T&&this.finish(),v}then(t,e){return this.finished.then(t,e)}get duration(){return B(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+B(t)}get time(){return B(this.currentTime)}set time(t){t=L(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);return Be(t=>this.generator.next(t).value,t,this.generator.next(t).value)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;e&&this.driver&&this.updateTime(dt.now()),this.playbackSpeed=t,e&&this.driver&&(this.time=B(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=ce,startTime:e}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),this.options.onPlay?.();const n=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=n):null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime||(this.startTime=e??n),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(dt.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function _e(t){for(let e=1;e180*t/Math.PI,Ze=t=>{const e=qe(Math.atan2(t[1],t[0]));return Qe(e)},Je={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Ze,rotateZ:Ze,skewX:t=>qe(Math.atan(t[1])),skewY:t=>qe(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Qe=t=>((t%=360)<0&&(t+=360),t),tn=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),en=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),nn={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:tn,scaleY:en,scale:t=>(tn(t)+en(t))/2,rotateX:t=>Qe(qe(Math.atan2(t[6],t[5]))),rotateY:t=>Qe(qe(Math.atan2(-t[2],t[0]))),rotateZ:Ze,rotate:Ze,skewX:t=>qe(Math.atan(t[4])),skewY:t=>qe(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function on(t){return t.includes("scale")?1:0}function sn(t,e){if(!t||"none"===t)return on(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,o;if(n)i=nn,o=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=Je,o=e}if(!o)return on(e);const s=i[e],r=o[1].split(",").map(an);return"function"==typeof s?s(r):r[s]}const rn=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return sn(n,e)};function an(t){return parseFloat(t.trim())}const ln=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],cn=(()=>new Set([...ln,"pathRotation"]))(),un=t=>t===xt||t===Lt,hn=new Set(["x","y","z"]),dn=ln.filter(t=>!hn.has(t));const pn={width:({x:t},{paddingLeft:e="0",paddingRight:n="0",boxSizing:i})=>{const o=t.max-t.min;return"border-box"===i?o:o-parseFloat(e)-parseFloat(n)},height:({y:t},{paddingTop:e="0",paddingBottom:n="0",boxSizing:i})=>{const o=t.max-t.min;return"border-box"===i?o:o-parseFloat(e)-parseFloat(n)},top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>sn(e,"x"),y:(t,{transform:e})=>sn(e,"y")};pn.translateX=pn.x,pn.translateY=pn.y;const mn=new Set;let fn=!1,gn=!1,yn=!1;function vn(){if(gn){const t=Array.from(mn).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),n=new Map;e.forEach(t=>{const e=function(t){const e=[];return dn.forEach(n=>{const i=t.getValue(n);void 0!==i&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),e}(t);e.length&&(n.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=n.get(t);e&&e.forEach(([e,n])=>{t.getValue(e)?.set(n)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}gn=!1,fn=!1,mn.forEach(t=>t.complete(yn)),mn.clear()}function xn(){mn.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(gn=!0)})}function wn(){yn=!0,xn(),vn(),yn=!1}class Sn{constructor(t,e,n,i,o,s=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=i,this.element=o,this.isAsync=s}scheduleResolve(){this.state="scheduled",this.isAsync?(mn.add(this),fn||(fn=!0,rt.read(xn),rt.resolveKeyframes(vn))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:i}=this;if(null===t[0]){const o=i?.get(),s=t[t.length-1];if(void 0!==o)t[0]=o;else if(n&&e){const i=n.readValue(e,s);null!=i&&(t[0]=i)}void 0===t[0]&&(t[0]=s),i&&void 0===o&&i.set(t[0])}_e(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),mn.delete(this)}cancel(){"scheduled"===this.state&&(mn.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}const bn=t=>t.startsWith("--");function Tn(t,e,n){bn(e)?t.style.setProperty(e,n):t.style[e]=n}const Pn={};function En(t,e){const n=C(t);return()=>Pn[e]??n()}const An=En(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),Mn=En(()=>void 0!==window.ViewTimeline,"viewTimeline"),Cn=En(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),Vn=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,kn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Vn([0,.65,.55,1]),circOut:Vn([.55,0,1,.45]),backIn:Vn([.31,.01,.66,-.59]),backOut:Vn([.33,1.53,.69,.99])};function Dn(t,e){return t?"function"==typeof t?Cn()?ue(t,e):"ease-out":et(t)?Vn(t):Array.isArray(t)?t.map(t=>Dn(t,e)||kn.easeOut):kn[t]:void 0}function Rn(t,e,n,{delay:i=0,duration:o=300,repeat:s=0,repeatType:r="loop",ease:a="easeOut",times:l}={},c=void 0){const u={[e]:n};l&&(u.offset=l);const h=Dn(a,o);Array.isArray(h)&&(u.easing=h);const d={delay:i,duration:o,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:s+1,direction:"reverse"===r?"alternate":"normal"};return c&&(d.pseudoElement=c),t.animate(u,d)}function Ln(t){return"function"==typeof t&&"applyToOptions"in t}function Bn({type:t,...e}){return Ln(t)&&Cn()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class On extends Xe{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:i,keyframes:o,pseudoElement:s,allowFlatten:r=!1,finalKeyframe:a,onComplete:l}=e;this.isPseudoElement=Boolean(s),this.allowFlatten=r,this.options=e,t.invariant("string"!=typeof e.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const c=Bn(e);this.animation=Rn(n,i,o,c,s),!1===c.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const t=ze(o,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(t),Tn(n,i,t),this.animation.cancel()}l?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return B(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+B(t)}get time(){return B(Number(this.animation.currentTime)||0)}set time(t){const e=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=L(t),e&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:e,rangeEnd:n,observe:i}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&An()?(this.animation.timeline=t,e&&(this.animation.rangeStart=e),n&&(this.animation.rangeEnd=n),V):i(this)}}const jn={anticipate:X,backInOut:H,circInOut:_};function In(t){"string"==typeof t.ease&&t.ease in jn&&(t.ease=jn[t.ease])}class Fn extends On{constructor(t){In(t),He(t),super(t),void 0!==t.startTime&&!1!==t.autoplay&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:e,onUpdate:n,onComplete:i,element:o,...s}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);const r=new Ke({...s,autoplay:!1}),a=Math.max(10,dt.now()-this.startTime),l=b(0,10,a-10),c=r.sample(a).value,{name:u}=this.options;o&&u&&Tn(o,u,c),e.setWithVelocity(r.sample(Math.max(0,a-l)).value,c,l),r.stop()}}const Wn=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Xt.test(t)&&"0"!==t||t.startsWith("url(")));function $n(t){t.duration=0,t.type="keyframes"}const Nn=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),Un=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;const zn=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),Yn=C(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Hn(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:o,damping:s,type:r,keyframes:a}=t,l=e?.owner?.current;if(!(l instanceof HTMLElement||l instanceof SVGElement))return!1;const{onUpdate:c,transformTemplate:u}=e.owner.getProps();return Yn()&&n&&(Nn.has(n)||zn.has(n)&&function(t){for(let e=0;e{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=dt.now();const h={autoplay:t,delay:e,type:n,repeat:i,repeatDelay:o,repeatType:s,name:a,motionValue:l,element:c,...u},d=c?.KeyframeResolver||Sn;this.keyframeResolver=new d(r,(t,e,n)=>this.onKeyframesResolved(t,e,h,!n),a,l,c),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,n,i,o){this.keyframeResolver=void 0;const{name:s,type:r,velocity:a,delay:l,isHandoff:c,onUpdate:u}=i;this.resolvedAt=dt.now();let h=!0;(function(e,n,i,o){const s=e[0];if(null===s)return!1;if("display"===n||"visibility"===n)return!0;const r=e[e.length-1],a=Wn(s,n),l=Wn(r,n);return t.warning(a===l,`You are trying to animate ${n} from "${s}" to "${r}". "${a?r:s}" is not an animatable value.`,"value-not-animatable"),!(!a||!l)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:n,...i,keyframes:e},p=h&&!c&&Hn(d),m=d.motionValue?.owner?.current;let f;if(p)try{f=new Fn({...d,element:m})}catch{f=new Ke(d)}else f=new Ke(d);f.finished.then(()=>{this.notifyFinished()}).catch(V),this.pendingTimeline&&(this.stopTimeline=f.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=f}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),wn()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}class Gn{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;ne.attachTimeline(t));return()=>{e.forEach((t,e)=>{t&&t(),this.animations[e].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return Kn(this.animations,"duration")}get iterationDuration(){return Kn(this.animations,"iterationDuration")}runAll(t){this.animations.forEach(e=>e[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function Kn(t,e){let n=0;for(let i=0;in&&(n=o)}return n}class _n extends Gn{then(t,e){return this.finished.finally(t).then(()=>{})}}class qn extends On{constructor(t){super(),this.animation=t,t.onfinish=()=>{this.finishedTime=this.time,this.notifyFinished()}}}const Zn=new WeakMap,Jn=(t,e="")=>`${t}:${e}`;function Qn(t){let e=Zn.get(t);return e||(e=new Map,Zn.set(t,e)),e}function ti(t,e,n,i=0,o=1){const s=Array.from(t).sort((t,e)=>t.sortNodePosition(e)).indexOf(e),r=t.size,a=(r-1)*i;return"function"==typeof n?n(s,r):1===o?s*i:a-s*i}const ei={current:void 0};class ni{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=dt.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=dt.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new R);const n=this.events[t].add(e);return"change"===t?()=>{n(),rt.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return ei.current&&ei.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=dt.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return O(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function ii(t,e){return new ni(t,e)}function oi(t,e){if(t?.inherit&&e){const{inherit:n,...i}=t;return{...e,...i}}return t}function si(t,e){const n=t?.[e]??t?.default??t;return n!==t?oi(n,t):n}const ri={type:"spring",stiffness:500,damping:25,restSpeed:10},ai={type:"keyframes",duration:.8},li={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ci=(t,{keyframes:e})=>e.length>2?ai:cn.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:ri:li,ui=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function hi(t){for(const e in t)if(!ui.has(e))return!0;return!1}const di=(t,e,n,i={},o,s)=>r=>{const a=si(i,t)||{},l=a.delay||i.delay||0;let{elapsed:c=0}=i;c-=L(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-c,onUpdate:t=>{e.set(t),a.onUpdate&&a.onUpdate(t)},onComplete:()=>{r(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:s?void 0:o};hi(a)||Object.assign(u,ci(t,u)),u.duration&&(u.duration=L(u.duration)),u.repeatDelay&&(u.repeatDelay=L(u.repeatDelay)),void 0!==u.from&&(u.keyframes[0]=u.from);let h=!1;if((!1===u.type||0===u.duration&&!u.repeatDelay)&&($n(u),0===u.delay&&(h=!0)),(P.instantAnimations||P.skipAnimations||o?.shouldSkipAnimations||a.skipAnimations)&&(h=!0,$n(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,h&&!s&&void 0!==e.get()){const t=ze(u.keyframes,a);if(void 0!==t)return void rt.update(()=>{u.onUpdate(t),u.onComplete()})}return a.isSync?new Ke(u):new Xn(u)};function pi(t,e,n,i){const o=1-t;return o*o*e+2*o*t*n+t*t*i}function mi(t,e,n,i,o,s,r){const a=2*(1-t)*(n-e)+2*t*(i-n),l=2*(1-t)*(s-o)+2*t*(r-s);return Math.atan2(l,a)*(180/Math.PI)}function fi(t,e,n,i,o,s){const r=n-t,a=i-e,l=Math.sqrt(r*r+a*a);if(l>0){const n=o*l;return{x:t+r*s+-a/l*n,y:e+a*s+r/l*n}}return{x:t,y:e}}const gi=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function yi(t){const e=gi.exec(t);if(!e)return[,];const[,n,i,o]=e;return[`--${n??i}`,o]}function vi(e,n,i=1){t.invariant(i<=4,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[o,s]=yi(e);if(!o)return;const r=window.getComputedStyle(n).getPropertyValue(o);if(r){const t=r.trim();return E(t)?parseFloat(t):t}return gt(s)?vi(s,n,i+1):s}function xi(t){const e=[{},{}];return t?.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}function wi(t,e,n,i){if("function"==typeof e){const[o,s]=xi(i);e=e(void 0!==n?n:t.custom,o,s)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[o,s]=xi(i);e=e(void 0!==n?n:t.custom,o,s)}return e}function Si(t,e,n){const i=t.getProps();return wi(i,e,void 0!==n?n:i.custom,t)}const bi=new Set(["width","height","top","left","right","bottom",...ln]),Ti=t=>Array.isArray(t);function Pi(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,ii(n))}function Ei(t){return Ti(t)?t[t.length-1]||0:t}function Ai(t,e){const n=Si(t,e);let{transitionEnd:i={},transition:o={},...s}=n||{};s={...s,...i};for(const e in s){Pi(t,e,Ei(s[e]))}}const Mi=t=>Boolean(t&&t.getVelocity);function Ci(t){return Boolean(Mi(t)&&t.add)}function Vi(t,e){const n=t.getValue("willChange");if(Ci(n))return n.add(e);if(!n&&P.WillChange){const n=new P.WillChange("auto");t.addValue("willChange",n),n.add(e)}}function ki(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const Di="framerAppearId",Ri="data-"+ki(Di);function Li(t){return t.props[Ri]}function Bi({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}function Oi(t,e,{delay:n=0,transitionOverride:i,type:o}={}){let{transition:s,transitionEnd:r,...a}=e;const l=t.getDefaultTransition();s=s?oi(s,l):l;const c=s?.reduceMotion,u=s?.skipAnimations;i&&(s=i);const h=[],d=o&&t.animationState&&t.animationState.getState()[o],p=s?.path;p&&p.animateVisualElement(t,a,s,n,h);for(const e in a){const i=t.getValue(e,t.latestValues[e]??null),o=a[e];if(void 0===o||d&&Bi(d,e))continue;const r={delay:n,...si(s||{},e)};u&&(r.skipAnimations=!0);const l=i.get();if(void 0!==l&&!i.isAnimating()&&!Array.isArray(o)&&o===l&&!r.velocity){rt.update(()=>i.set(o));continue}let p=!1;if(window.MotionHandoffAnimation){const n=Li(t);if(n){const t=window.MotionHandoffAnimation(n,e,rt);null!==t&&(r.startTime=t,p=!0)}}Vi(t,e);const m=c??t.shouldReduceMotion;i.start(di(e,i,o,m&&bi.has(e)?{type:!1}:r,t,p));const f=i.animation;f&&h.push(f)}if(r){const e=()=>rt.update(()=>{r&&Ai(t,r)});h.length?Promise.all(h).then(e):e()}return h}function ji(t,e,n={}){const i=Si(t,e,"exit"===n.type?t.presenceContext?.custom:void 0);let{transition:o=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(o=n.transitionOverride);const s=i?()=>Promise.all(Oi(t,i,n)):()=>Promise.resolve(),r=t.variantChildren&&t.variantChildren.size?(i=0)=>{const{delayChildren:s=0,staggerChildren:r,staggerDirection:a}=o;return function(t,e,n=0,i=0,o=0,s=1,r){const a=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),a.push(ji(l,e,{...r,delay:n+("function"==typeof i?0:i)+ti(t.variantChildren,l,i,o,s)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(a)}(t,e,i,s,r,a,n)}:()=>Promise.resolve(),{when:a}=o;if(a){const[t,e]="beforeChildren"===a?[s,r]:[r,s];return t().then(()=>e())}return Promise.all([s(),r(n.delay)])}function Ii(t,e,n={}){let i;if(t.notify("AnimationStart",e),Array.isArray(e)){const o=e.map(e=>ji(t,e,n));i=Promise.all(o)}else if("string"==typeof e)i=ji(t,e,n);else{const o="function"==typeof e?Si(t,e,n.custom):e;i=Promise.all(Oi(t,o,n))}return i.then(()=>{t.notify("AnimationComplete",e)})}const Fi=t=>e=>e.test(t),Wi=[xt,Lt,Rt,Dt,Ot,Bt,{test:t=>"auto"===t,parse:t=>t}],$i=t=>Wi.find(Fi(t));function Ni(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||M(t))}const Ui=new Set(["brightness","contrast","saturate","opacity"]);function zi(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(Tt)||[];if(!i)return t;const o=n.replace(i,"");let s=Ui.has(e)?1:0;return i!==n&&(s*=100),e+"("+s+o+")"}const Yi=/\b([a-z-]*)\(.*?\)/gu,Hi={...Xt,getAnimatableNone:t=>{const e=t.match(Yi);return e?e.map(zi).join(" "):t}},Xi={...Xt,getAnimatableNone:t=>{const e=Xt.parse(t);return Xt.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},Gi={...xt,transform:Math.round},Ki={rotate:Dt,pathRotation:Dt,rotateX:Dt,rotateY:Dt,rotateZ:Dt,scale:St,scaleX:St,scaleY:St,scaleZ:St,skew:Dt,skewX:Dt,skewY:Dt,distance:Lt,translateX:Lt,translateY:Lt,translateZ:Lt,x:Lt,y:Lt,z:Lt,perspective:Lt,transformPerspective:Lt,opacity:wt,originX:jt,originY:jt,originZ:Lt},_i={borderWidth:Lt,borderTopWidth:Lt,borderRightWidth:Lt,borderBottomWidth:Lt,borderLeftWidth:Lt,borderRadius:Lt,borderTopLeftRadius:Lt,borderTopRightRadius:Lt,borderBottomRightRadius:Lt,borderBottomLeftRadius:Lt,width:Lt,maxWidth:Lt,height:Lt,maxHeight:Lt,top:Lt,right:Lt,bottom:Lt,left:Lt,inset:Lt,insetBlock:Lt,insetBlockStart:Lt,insetBlockEnd:Lt,insetInline:Lt,insetInlineStart:Lt,insetInlineEnd:Lt,padding:Lt,paddingTop:Lt,paddingRight:Lt,paddingBottom:Lt,paddingLeft:Lt,paddingBlock:Lt,paddingBlockStart:Lt,paddingBlockEnd:Lt,paddingInline:Lt,paddingInlineStart:Lt,paddingInlineEnd:Lt,margin:Lt,marginTop:Lt,marginRight:Lt,marginBottom:Lt,marginLeft:Lt,marginBlock:Lt,marginBlockStart:Lt,marginBlockEnd:Lt,marginInline:Lt,marginInlineStart:Lt,marginInlineEnd:Lt,fontSize:Lt,backgroundPositionX:Lt,backgroundPositionY:Lt,...Ki,zIndex:Gi,fillOpacity:wt,strokeOpacity:wt,numOctaves:Gi},qi={..._i,color:Ft,backgroundColor:Ft,outlineColor:Ft,fill:Ft,stroke:Ft,borderColor:Ft,borderTopColor:Ft,borderRightColor:Ft,borderBottomColor:Ft,borderLeftColor:Ft,filter:Hi,WebkitFilter:Hi,mask:Xi,WebkitMask:Xi},Zi=t=>qi[t],Ji=new Set([Hi,Xi]);function Qi(t,e){let n=Zi(t);return Ji.has(n)||(n=Xt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const to=new Set(["auto","none","0"]);class eo extends Sn{constructor(t,e,n,i,o){super(t,e,n,i,o,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n{t.getValue(e).set(n)}),this.resolveNoneKeyframes()}}const no=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"],io=new Set(["borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius",...no,"width","maxWidth","height","maxHeight","top","right","bottom","left","inset","insetBlock","insetBlockStart","insetBlockEnd","insetInline","insetInlineStart","insetInlineEnd","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingBlock","paddingBlockStart","paddingBlockEnd","paddingInline","paddingInlineStart","paddingInlineEnd","margin","marginTop","marginRight","marginBottom","marginLeft","marginBlock","marginBlockStart","marginBlockEnd","marginInline","marginInlineStart","marginInlineEnd","fontSize","backgroundPositionX","backgroundPositionY"]);function oo(t,e){for(let n=0;n{try{document.createElement("div").animate({opacity:[1]})}catch(t){return!1}return!0});function ro(t,e,n){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){let i=document;e&&(i=e.current);const o=n?.[t]??i.querySelectorAll(t);return o?Array.from(o):[]}return Array.from(t).filter(t=>null!=t)}function ao(t){return(e,n)=>{const i=ro(e),o=[];for(const e of i){const i=t(e,n);o.push(i)}return()=>{for(const t of o)t()}}}const lo=(t,e)=>e&&"number"==typeof t?e.transform(t):t;class co{constructor(){this.latest={},this.values=new Map}set(t,e,n,i,o=!0){const s=this.values.get(t);s&&s.onRemove();const r=()=>{const i=e.get();this.latest[t]=o?lo(i,_i[t]):i,n&&rt.render(n)};r();const a=e.on("change",r);i&&e.addDependent(i);const l=()=>{a(),n&&at(n),this.values.delete(t),i&&e.removeDependent(i)};return this.values.set(t,{value:e,onRemove:l}),l}get(t){return this.values.get(t)?.value}}function uo(t){const e=new WeakMap;return(n,i)=>{const o=e.get(n)??new co;e.set(n,o);const s=[];for(const e in i){const r=i[e],a=t(n,o,e,r);s.push(a)}return()=>{for(const t of s)t()}}}const ho=(t,e,n,i)=>{const o=function(t,e){if(!(e in t))return!1;const n=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(t),e)||Object.getOwnPropertyDescriptor(t,e);return n&&"function"==typeof n.set}(t,n),s=o?n:n.startsWith("data")||n.startsWith("aria")?ki(n):n,r=o?()=>{t[s]=e.latest[n]}:()=>{const i=e.latest[n];null==i?t.removeAttribute(s):t.setAttribute(s,String(i))};return e.set(n,i,r)},po=ao(uo(ho)),mo=uo((t,e,n,i)=>e.set(n,i,()=>{t[n]=e.latest[n]},void 0,!1));function fo(t){return A(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const go={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"};const yo=new Set(["originX","originY","originZ"]),vo=(t,e,n,i)=>{let o,s;return cn.has(n)?(e.get("transform")||(fo(t)||e.get("transformBox")||vo(t,e,"transformBox",new ni("fill-box")),e.set("transform",new ni("none"),()=>{t.style.transform=function(t){let e="",n=!0;for(let i=0;i{const n=e.latest.originX??"50%",i=e.latest.originY??"50%",o=e.latest.originZ??0;t.style.transformOrigin=`${n} ${i} ${o}`}),s=e.get("transformOrigin")):o=bn(n)?()=>{t.style.setProperty(n,e.latest[n])}:()=>{t.style[n]=e.latest[n]},e.set(n,i,o,s)},xo=ao(uo(vo));const wo=ao(uo((t,e,n,i)=>{if(n.startsWith("path"))return function(t,e,n,i){return rt.render(()=>t.setAttribute("pathLength","1")),"pathOffset"===n?e.set(n,i,()=>{const i=e.latest[n];t.setAttribute("stroke-dashoffset",""+-i)}):(e.get("stroke-dasharray")||e.set("stroke-dasharray",new ni("1 1"),()=>{const{pathLength:n=1,pathSpacing:i}=e.latest;t.setAttribute("stroke-dasharray",`${n} ${i??1-Number(n)}`)}),e.set(n,i,void 0,e.get("stroke-dasharray")))}(t,e,n,i);if(n.startsWith("attr"))return ho(t,e,function(t){return t.replace(/^attr([A-Z])/,(t,e)=>e.toLowerCase())}(n),i);return(n in t.style?vo:ho)(t,e,n,i)}));const{schedule:So,cancel:bo}=st(queueMicrotask,!1),To={x:!1,y:!1};function Po(){return To.x||To.y}function Eo(t){return"x"===t||"y"===t?To[t]?null:(To[t]=!0,()=>{To[t]=!1}):To.x||To.y?null:(To.x=To.y=!0,()=>{To.x=To.y=!1})}function Ao(t,e){const n=ro(t),i=new AbortController;return[n,{passive:!0,...e,signal:i.signal},()=>i.abort()]}function Mo(t,e,n={}){const[i,o,s]=Ao(t,n);return i.forEach(t=>{let n,i=!1,s=!1;const r=e=>{n&&(n(e),n=void 0),t.removeEventListener("pointerleave",l)},a=t=>{i=!1,window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",a),s&&(s=!1,r(t))},l=t=>{"touch"!==t.pointerType&&(i?s=!0:r(t))};t.addEventListener("pointerenter",i=>{if("touch"===i.pointerType||Po())return;s=!1;const r=e(t,i);"function"==typeof r&&(n=r,t.addEventListener("pointerleave",l,o))},o),t.addEventListener("pointerdown",()=>{i=!0,window.addEventListener("pointerup",a,o),window.addEventListener("pointercancel",a,o)},o)}),s}const Co=(t,e)=>!!e&&(t===e||Co(t,e.parentElement)),Vo=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,ko=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Do(t){return ko.has(t.tagName)||!0===t.isContentEditable}const Ro=new Set(["INPUT","SELECT","TEXTAREA"]);function Lo(t){return Ro.has(t.tagName)||!0===t.isContentEditable}const Bo=new WeakSet;function Oo(t){return e=>{"Enter"===e.key&&t(e)}}function jo(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function Io(t){return Vo(t)&&!Po()}const Fo=new WeakSet;function Wo(t,e,n={}){const[i,o,s]=Ao(t,n),r=t=>{const i=t.currentTarget;if(!Io(t))return;if(Fo.has(t))return;Bo.add(i),n.stopPropagation&&Fo.add(t);const s=e(i,t),r={...o,capture:!0},a=(t,e)=>{window.removeEventListener("pointerup",l,r),window.removeEventListener("pointercancel",c,r),Bo.has(i)&&Bo.delete(i),Io(t)&&"function"==typeof s&&s(t,{success:e})},l=t=>{a(t,i===window||i===document||n.useGlobalTarget||Co(i,t.target))},c=t=>{a(t,!1)};window.addEventListener("pointerup",l,r),window.addEventListener("pointercancel",c,r)};return i.forEach(t=>{(n.useGlobalTarget?window:t).addEventListener("pointerdown",r,o),fo(t)&&(t.addEventListener("focus",t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const i=Oo(()=>{if(Bo.has(n))return;jo(n,"down");const t=Oo(()=>{jo(n,"up")});n.addEventListener("keyup",t,e),n.addEventListener("blur",()=>jo(n,"cancel"),e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)})(t,o)),Do(t)||t.hasAttribute("tabindex")||(t.tabIndex=0))}),s}function $o(t,e){const n=window.getComputedStyle(t);return bn(e)?n.getPropertyValue(e):n[e]}function No(t){return A(t)&&"ownerSVGElement"in t}const Uo=new WeakMap;let zo;const Yo=(t,e,n)=>(i,o)=>o&&o[0]?o[0][t+"Size"]:No(i)&&"getBBox"in i?i.getBBox()[e]:i[n],Ho=Yo("inline","width","offsetWidth"),Xo=Yo("block","height","offsetHeight");function Go({target:t,borderBoxSize:e}){Uo.get(t)?.forEach(n=>{n(t,{get width(){return Ho(t,e)},get height(){return Xo(t,e)}})})}function Ko(t){t.forEach(Go)}function _o(t,e){zo||"undefined"!=typeof ResizeObserver&&(zo=new ResizeObserver(Ko));const n=ro(t);return n.forEach(t=>{let n=Uo.get(t);n||(n=new Set,Uo.set(t,n)),n.add(e),zo?.observe(t)}),()=>{n.forEach(t=>{const n=Uo.get(t);n?.delete(e),n?.size||zo?.unobserve(t)})}}const qo=new Set;let Zo;function Jo(t){return qo.add(t),Zo||(Zo=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};qo.forEach(e=>e(t))},window.addEventListener("resize",Zo)),()=>{qo.delete(t),qo.size||"function"!=typeof Zo||(window.removeEventListener("resize",Zo),Zo=void 0)}}function Qo(t,e){return"function"==typeof t?Jo(t):_o(t,e)}function ts(t,e){let n;const i=()=>{const{currentTime:i}=e,o=(null===i?0:i.value)/100;n!==o&&t(o),n=o};return rt.preUpdate(i,!0),()=>at(i)}const es={value:null,addProjectionMetrics:null};function ns(t){return No(t)&&"svg"===t.tagName}function is(t,e){if("first"===t)return 0;{const n=e-1;return"last"===t?n:n/2}}function os(...t){const e=!Array.isArray(t[0]),n=e?0:-1,i=t[0+n],o=je(t[1+n],t[2+n],t[3+n]);return e?o(i):o}function ss(t,e){const n=ii(Mi(t)?t.get():t);return rs(n,t,e),n}function rs(t,e,n={}){const i=t.get();let o,s=null,r=i;const a="string"==typeof i?i.replace(/[\d.-]/g,""):void 0,l=()=>{s&&(s.stop(),s=null),t.animation=void 0},c=()=>{(()=>{const e=ls(t.get()),i=ls(r);if(e===i)return void l();const a=s?s.getGeneratorVelocity():t.getVelocity();l(),s=new Ke({keyframes:[e,i],velocity:a,type:"spring",restDelta:.001,restSpeed:.01,...n,onUpdate:o})})(),t.animation=s??void 0,t.events.animationStart?.notify(),s?.then(()=>{t.animation=void 0,t.events.animationComplete?.notify()})};if(t.attach((t,e)=>{r=t,o=t=>e(as(t,a)),rt.postRender(c)},l),Mi(e)){let i=!0===n.skipInitialAnimation;const o=e.on("change",e=>{i?(i=!1,t.jump(as(e,a),!1)):t.set(as(e,a))}),s=t.on("destroy",o);return()=>{o(),s()}}return l}function as(t,e){return e?t+e:t}function ls(t){return"number"==typeof t?t:parseFloat(t)}function cs(t){const e=[];ei.current=e;const n=t();ei.current=void 0;const i=ii(n);return function(t,e,n){const i=()=>e.set(n()),o=()=>rt.preRender(i,!1,!0),s=t.map(t=>t.on("change",o));e.on("destroy",()=>{s.forEach(t=>t()),at(i)})}(e,i,t),i}const us=[...Wi,Ft,Xt],hs=t=>us.find(Fi(t));let ds=0;const ps=()=>"motion-view-"+ds++;function ms(t,e,n){e&&(t.style?.setProperty("view-transition-class",e),n.push(t))}function fs(t,e,n,i,o){if(n&&(t.style?.setProperty("view-transition-group",n),i.push(t),"none"!==n&&o)){const n=getComputedStyle(t);"visible"===n.overflowX&&"visible"===n.overflowY||o.add(e)}}function gs(t,e,n,i,o,s=[],r,a=[],l){const c=ro(t);if(i)return c.map((t,c)=>{const u=e.get(t);if(u)return u;const h=i[c]??ps();return t.style?.setProperty("view-transition-name",h),n.push(t),e.set(t,h),ms(t,o,s),fs(t,h,r,a,l),h});const u=c.map(t=>e.has(t)?void 0:getComputedStyle(t).getPropertyValue("view-transition-name"));return c.map((t,i)=>{const c=e.get(t);if(c)return c;const h=u[i];let d;return h&&"none"!==h&&"auto"!==h&&"match-element"!==h&&!(t=>t.startsWith("motion-view-"))(h)?d=h:(d=ps(),t.style?.setProperty("view-transition-name",d),n.push(t)),e.set(t,d),ms(t,o,s),fs(t,d,r,a,l),d})}function ys(t){return"layout"===t?"group":"enter"===t||"new"===t?"new":"old"}let vs={},xs=null;const ws=(t,e)=>{vs[t]=e},Ss=()=>{xs||(xs=document.createElement("style"),xs.id="motion-view");let t="";for(const e in vs){const n=vs[e];t+=`${e} {\n`;for(const[e,i]of Object.entries(n))t+=` ${e}: ${i};\n`;t+="}\n"}xs.textContent=t,document.head.appendChild(xs),vs={}},bs=()=>{xs&&xs.parentElement&&xs.parentElement.removeChild(xs)};function Ts(t){const e=t.match(/::view-transition-(old|new|group-children|group|image-pair)\((.*?)\)/);return e?{layer:e[2],type:e[1]}:null}function Ps(){return document.getAnimations().filter(t=>{const{effect:e}=t;return!!e&&e.target===document.documentElement&&e.pseudoElement?.startsWith("::view-transition")})}const Es=["layout","enter","exit","new","old"],As=t=>t.split(" ").every(t=>0===parseFloat(t)),Ms={group:["layout"],new:["new","enter"],old:["old","exit"]},Cs={new:{opacity:0,scale:.85},old:{opacity:1,scale:1}};function Vs(t){const{update:e,targets:n,resolveDefs:i,cropOverride:o,pairs:s,classNames:r,flatGroups:a,options:l}=t;if(!document.startViewTransition)return(async()=>(await e(),new Gn([])))();const c=new Map,u=[],h=[],d=[],p=new Set,m=new Map,f=new Set,g=new Map,y=new Map,v=new Map,x=new Map,w=t=>{n.forEach((e,n)=>{const l=r.get(n),f="root"!==n&&i.has(n)?a.has(n)?"none":"contain":void 0;let w;if("root"!==n&&i.has(n))if(s.has(n))if("old"===t)x.set(n,ro(n)),w=gs(n,c,u,void 0,l,h,f,d,p),v.set(n,w);else{for(const t of x.get(n)??[])t.style?.removeProperty("view-transition-name"),c.delete(t);w=gs(s.get(n),c,u,v.get(n),l,h,f,d,p)}else w=gs(n,c,u,void 0,l,h,f,d,p);else w=[n];const S=o.get(n);w.forEach((n,i)=>{const o=m.get(n);m.set(n,o&&o!==e?{...o,...e}:e),void 0!==S&&g.set(n,S);const s=y.get(n)??{};s[t]=[i,w.length],y.set(n,s)})})},S=(t,e)=>{const n=y.get(t);return("old"===e?n?.old:"new"===e?n?.new:n?.new??n?.old)??[-1,1]},b=(t,e,n,i,o)=>{const s=ks(si(l,n),si(function(t,e){for(const n of Ms[e]??[]){const e=t?.[n]?.options;if(e)return e}}(t,e)??{},n));return"function"==typeof s.delay&&(s.delay=s.delay(i,o)),s},T=t=>{const[e,n]=S(t,"group"),i=b(m.get(t),"group","layout",-1===e?0:e,n);i.duration&&(i.duration=L(i.duration));const{delay:o=0,duration:s,ease:r}=Bn(i);return{delay:L(o),duration:s,ease:r}},P=new Map,E=t=>c.forEach((e,n)=>{const i=n,o=i.getBoundingClientRect?.();if(o&&o.height){const n=getComputedStyle(i),s={};for(const t of no)s[t]=n[t];const r=P.get(e)??{};r[t]={width:o.width,height:o.height,radii:s},P.set(e,r)}}),A=t=>{const e=P.get(t);return!!(e?.old&&e?.new&&e.old.height&&e.new.height)&&Math.abs(e.old.width/e.old.height-e.new.width/e.new.height)>.2},M=()=>{(function(t,e){return e.has(t)&&Object.keys(e.get(t)).length>0})("root",n)||ws(":root",{"view-transition-name":"none"}),ws("::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)",{"animation-timing-function":"linear !important"}),f.forEach(t=>{ws(`::view-transition-group(${t})`,{overflow:"clip"}),ws(`::view-transition-old(${t}), ::view-transition-new(${t})`,{width:"100%",height:"100%","object-fit":"cover"})}),p.forEach(t=>{ws(`::view-transition-group-children(${t})`,{overflow:"clip"})}),Ss()},C=()=>{!function(t,e=[],n=[]){for(const e of t)e.style?.removeProperty("view-transition-name");for(const t of e)t.style?.removeProperty("view-transition-class");for(const t of n)t.style?.removeProperty("view-transition-group")}(u,h,d),bs()},V=async()=>{await e(),w("new"),E("new"),(()=>{f.clear();for(const t of y.keys())"root"!==t&&(g.get(t)??A(t))&&f.add(t)})(),M()};let k;try{w("old"),E("old"),M(),k=document.startViewTransition(V)}catch(t){return C(),Promise.reject(t)}return k.finished.finally(C),new Promise((t,e)=>{k.ready.then(()=>{const e=Ps(),n=[],i=new Set,o=new Set;m.forEach((t,e)=>{const s=y.get(e),r=!!s?.new&&!s?.old,a=!!s?.old&&!s?.new;for(const s of Es){if(!t[s])continue;if("enter"===s&&!r)continue;if("exit"===s&&!a)continue;const c=ys(s),[u,h]=S(e,c);if(-1===u)continue;const{keyframes:d,options:p}=t[s];for(let[m,f]of Object.entries(d)){if(null==f)continue;if("x"===m||"y"===m){I(!1,`animateView() animates view-transition layers with CSS properties; the "${m}" shorthand has no effect - use transform, e.g. { transform: "translateX(40px)" }.`);continue}if("new"===s&&r&&null!=t.enter?.keyframes[m])continue;if("old"===s&&a&&null!=t.exit?.keyframes[m])continue;const d=ks(si(l,m),si(p,m));if(!Array.isArray(f)){const e="enter"===s?t.exit?.keyframes[m]:void 0,n="opacity"===m||("new"===c?r:a),i=null!=e?Array.isArray(e)?e[e.length-1]:e:n?Cs[c]?.[m]:void 0;void 0!==i&&(f=[i,f])}"function"==typeof d.delay&&(d.delay=d.delay(u,h)),d.duration&&(d.duration=L(d.duration)),d.delay&&(d.delay=L(d.delay)),n.push(new On({...d,element:document.documentElement,name:m,pseudoElement:`::view-transition-${c}(${e})`,keyframes:f})),i.add(`${e}:${c}`),"opacity"===m&&o.add(`${e}:${c}`)}}});for(const t of e){if("finished"===t.playState)continue;const{effect:e}=t;if(!(e&&e instanceof KeyframeEffect))continue;const{pseudoElement:s}=e;if(!s)continue;const r=Ts(s);if(!r)continue;const a=m.get(r.layer);if(i.has(`${r.layer}:${r.type}`)){o.has(`${r.layer}:new`)&&o.has(`${r.layer}:old`)&&e.getKeyframes().some(t=>t.mixBlendMode)?n.push(new qn(t)):t.cancel();continue}const l="old"===r.type?"new":"new"===r.type?"old":void 0;if(l&&i.has(`${r.layer}:${l}`)&&!o.has(`${r.layer}:${l}`)){t.cancel();continue}const c=y.get(r.layer),u=!("old"!==r.type&&"new"!==r.type||!c?.old||!c?.new);let h;if(r.type.startsWith("group")){const{delay:t,duration:e,ease:n}=T(r.layer);h={delay:t,duration:e,easing:Dn(n,e)}}else{const t=u?"group":r.type,[e,n]=S(r.layer,t);let i=b(a,t,"group"===t?"layout":"",-1===e?0:e,n);const o=i.visualDuration;i.duration&&(i.duration=L(i.duration)),i=Bn(i),h={delay:L(i.delay??0),duration:u&&void 0!==o?L(o):i.duration,easing:u?"linear":Dn(i.ease,i.duration)}}e.updateTiming(h),n.push(new qn(t))}P.forEach((t,e)=>{if(!f.has(e))return;const{delay:i,duration:o,ease:s}=T(e);for(const r of no){const a=t.old?.radii[r]||t.new?.radii[r]||"0px",l=t.new?.radii[r]||t.old?.radii[r]||"0px";As(a)&&As(l)||n.push(new On({element:document.documentElement,name:r,pseudoElement:`::view-transition-group(${e})`,keyframes:[a,l],delay:i,duration:o,ease:s}))}}),t(new Gn(n))}).catch(()=>k.updateCallbackDone.then(()=>t(new Gn([])),e))})}function ks(t,e){const n={...t,...e};return void 0!==e.duration&&(void 0===e.visualDuration&&delete n.visualDuration,void 0===e.type&&delete n.type),n}let Ds=[],Rs=null;function Ls(){Rs=null;const[t]=Ds;var e;t&&(w(Ds,e=t),Rs=e,Vs(e).then(t=>(e.notifyReady(t),t.finished)).catch(t=>e.notifyReject(t)).finally(Ls))}function Bs(){for(let t=Ds.length-1;t>=0;t--){const e=Ds[t],{interrupt:n}=e.options;if("immediate"===n){const n=Ds.slice(0,t+1).map(t=>t.update),i=Ds.slice(t+1);e.update=()=>{n.forEach(t=>t())},Ds=[e,...i];break}}Rs&&"immediate"!==Ds[0]?.options.interrupt||Ls()}class Os{constructor(t,e={}){var n;this.currentSubject="root",this.targets=new Map,this.resolveDefs=new Set,this.cropOverride=new Map,this.pairs=new Map,this.classNames=new Map,this.flatGroups=new Set,this.notifyReady=V,this.notifyReject=V,this.readyPromise=new Promise((t,e)=>{this.notifyReady=t,this.notifyReject=e}),this.update=t,this.options={interrupt:"wait",...e},this.readyPromise.catch(V),n=this,Ds.push(n),So.render(Bs)}add(t,e){return this.currentSubject=t,this.resolveDefs.add(t),void 0!==e&&this.pairs.set(t,e),this.targets.has(t)||this.targets.set(t,{}),this}crop(t=!0){return this.cropOverride.set(this.currentSubject,t),this}group(t=!0){return t?this.flatGroups.delete(this.currentSubject):this.flatGroups.add(this.currentSubject),this}class(t){return this.classNames.set(this.currentSubject,t),this}layout(t={}){return this.updateTarget("layout",{},t),this}enter(t,e){return this.updateTarget("enter",t,e),this}exit(t,e){return this.updateTarget("exit",t,e),this}new(t,e){return this.updateTarget("new",t,e),this}old(t,e){return this.updateTarget("old",t,e),this}updateTarget(t,e,n={}){const{currentSubject:i,targets:o}=this;o.has(i)||o.set(i,{});o.get(i)[t]={keyframes:e,options:n}}then(t,e){return this.readyPromise.then(t,e)}}const js=()=>({translate:0,scale:1,origin:0,originPoint:0}),Is=()=>({x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}),Fs=()=>({min:0,max:0}),Ws=()=>({x:{min:0,max:0},y:{min:0,max:0}}),$s=new WeakMap;function Ns(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function Us(t){return"string"==typeof t||Array.isArray(t)}const zs=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Ys=["initial",...zs];function Hs(t){return Ns(t.animate)||Ys.some(e=>Us(t[e]))}function Xs(t){return Boolean(Hs(t)||t.variants)}function Gs(t,e,n){for(const i in e){const o=e[i],s=n[i];if(Mi(o))t.addValue(i,o);else if(Mi(s))t.addValue(i,ii(o,{owner:t}));else if(s!==o)if(t.hasValue(i)){const e=t.getValue(i);!0===e.liveStyle?e.jump(o):e.hasAnimated||e.set(o)}else{const e=t.getStaticValue(i);t.addValue(i,ii(void 0!==e?e:o,{owner:t}))}}for(const i in n)void 0===e[i]&&t.removeValue(i);return e}const Ks={current:null},_s={current:!1},qs="undefined"!=typeof window;function Zs(){if(_s.current=!0,qs)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Ks.current=t.matches;t.addEventListener("change",e),e()}else Ks.current=!1}const Js=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Qs={};function tr(t){Qs=t}function er(){return Qs}class nr{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:i,skipAnimations:o,blockInitialAnimation:s,visualState:r},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Sn,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const t=dt.now();this.renderScheduledAtthis.bindToMotionValue(e,t)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(_s.current||Zs(),this.shouldReduceMotion=Ks.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),at(this.notifyUpdate),at(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,e){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),e.accelerate&&Nn.has(t)&&this.current instanceof HTMLElement){const{factory:n,keyframes:i,times:o,ease:s,duration:r}=e.accelerate,a=new On({element:this.current,name:t,keyframes:i,times:o,ease:s,duration:L(r)}),l=n(a);return void this.valueSubscriptions.set(t,()=>{l(),a.cancel()})}const n=cn.has(t);n&&this.onBindTransform&&this.onBindTransform();const i=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&rt.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{i(),o&&o()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in Qs){const e=Qs[t];if(!e)continue;const{isEnabled:n,Feature:i}=e;if(!this.features[t]&&i&&n(this.props)&&(this.features[t]=new i(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;ee.variantChildren.delete(t)}addValue(t,e){const n=this.values.get(t);e!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=ii(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,e){let n=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];return null!=n&&("string"==typeof n&&(E(n)||M(n))?n=parseFloat(n):!hs(n)&&Xt.test(e)&&(n=Qi(t,e)),this.setBaseTarget(t,Mi(n)?n.get():n)),Mi(n)?n.get():n}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let n;if("string"==typeof e||"object"==typeof e){const i=wi(this.props,e,this.presenceContext?.custom);i&&(n=i[t])}if(e&&void 0!==n)return n;const i=this.getBaseTargetFromProps(this.props,t);return void 0===i||Mi(i)?void 0!==this.initialValues[t]&&void 0===n?void 0:this.baseTarget[t]:i}on(t,e){return this.events[t]||(this.events[t]=new R),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){So.render(this.render)}}class ir extends nr{constructor(){super(...arguments),this.KeyframeResolver=eo}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){const n=t.style;return n?n[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Mi(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}class or{constructor(t){this.isMounted=!1,this.node=t}update(){}}function sr({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function rr({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function ar(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),i=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}function lr(t){return void 0===t||1===t}function cr({scale:t,scaleX:e,scaleY:n}){return!lr(t)||!lr(e)||!lr(n)}function ur(t){return cr(t)||hr(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function hr(t){return dr(t.x)||dr(t.y)}function dr(t){return t&&"0%"!==t}function pr(t,e,n){return n+e*(t-n)}function mr(t,e,n,i,o){return void 0!==o&&(t=pr(t,o,i)),pr(t,n,i)+e}function fr(t,e=0,n=1,i,o){t.min=mr(t.min,e,n,i,o),t.max=mr(t.max,e,n,i,o)}function gr(t,{x:e,y:n}){fr(t.x,e.translate,e.scale,e.originPoint),fr(t.y,n.translate,n.scale,n.originPoint)}const yr=.999999999999,vr=1.0000000000001;function xr(t,e,n,i=!1){const o=n.length;if(!o)return;let s,r;e.x=e.y=1;for(let a=0;ayr&&(e.x=1),e.yyr&&(e.y=1)}function wr(t,e){t.min+=e,t.max+=e}function Sr(t,e,n,i,o=.5){fr(t,e,n,qt(t.min,t.max,o),i)}function br(t,e){return"string"==typeof t?parseFloat(t)/100*(e.max-e.min):t}function Tr(t,e,n){const i=n??t;Sr(t.x,br(e.x,i.x),e.scaleX,e.scale,e.originX),Sr(t.y,br(e.y,i.y),e.scaleY,e.scale,e.originY)}function Pr(t,e){return sr(ar(t.getBoundingClientRect(),e))}function Er(t,e,n){const i=Pr(t,n),{scroll:o}=e;return o&&(wr(i.x,o.offset.x),wr(i.y,o.offset.y)),i}const Ar={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Mr=ln.length;function Cr(t,e,n){let i="",o=!0;for(let s=0;s{if(!e.target)return t;if("string"==typeof t){if(!Lt.test(t))return t;t=parseFloat(t)}return`${Dr(t,e.target.x)}% ${Dr(t,e.target.y)}%`}},Lr={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,o=Xt.parse(t);if(o.length>5)return i;const s=Xt.createTransformer(t),r="number"!=typeof o[0]?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;o[0+r]/=a,o[1+r]/=l;const c=qt(a,l,.5);return"number"==typeof o[2+r]&&(o[2+r]/=c),"number"==typeof o[3+r]&&(o[3+r]/=c),s(o)}},Br={borderRadius:{...Rr,applyTo:[...no]},borderTopLeftRadius:Rr,borderTopRightRadius:Rr,borderBottomLeftRadius:Rr,borderBottomRightRadius:Rr,boxShadow:Lr};function Or(t,{layout:e,layoutId:n}){return cn.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!Br[t]||"opacity"===t)}function jr(t,e,n){const i=t.style,o=e?.style,s={};if(!i)return s;for(const e in i)(Mi(i[e])||o&&Mi(o[e])||Or(e,t)||void 0!==n?.getValue(e)?.liveStyle)&&(s[e]=i[e]);return s}class Ir extends ir{constructor(){super(...arguments),this.type="html",this.renderInstance=kr}mount(e){t.invariant(Boolean(e.style),"motion.create() components must forward their ref to a HTML or SVG element","custom-component-ref"),super.mount(e)}readValueFromInstance(t,e){if(cn.has(e))return this.projection?.isProjecting?on(e):rn(t,e);{const i=(n=t,window.getComputedStyle(n)),o=(mt(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof o?o.trim():o}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return Pr(t,e)}build(t,e,n){Vr(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return jr(t,e,n)}}class Fr extends nr{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,e){if(function(t,e){return t in e}(e,t)){const n=t[e];if("string"==typeof n||"number"==typeof n)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(t,e){delete e.output[t]}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}build(t,e){Object.assign(t.output,e)}renderInstance(t,{output:e}){Object.assign(t,e)}sortInstanceNodePosition(){return 0}}const Wr={offset:"stroke-dashoffset",array:"stroke-dasharray"},$r={offset:"strokeDashoffset",array:"strokeDasharray"};function Nr(t,e,n=1,i=0,o=!0){t.pathLength=1;const s=o?Wr:$r;t[s.offset]=""+-i,t[s.array]=`${e} ${n}`}const Ur=["transform","opacity","offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function zr(t,{attrX:e,attrY:n,attrScale:i,pathLength:o,pathSpacing:s=1,pathOffset:r=0,...a},l,c,u){if(Vr(t,a,c),l)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:h,style:d}=t;for(const t of Ur)void 0!==h[t]&&(d[t]=h[t],delete h[t]);(d.transform||h.transformOrigin)&&(d.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),d.transform&&(d.transformBox=u?.transformBox??"fill-box",delete h.transformBox),void 0!==e&&(h.x=e),void 0!==n&&(h.y=n),void 0!==i&&(h.scale=i),void 0!==o&&Nr(h,o,s,r,!1)}const Yr=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),Hr=t=>"string"==typeof t&&"svg"===t.toLowerCase();function Xr(t,e,n,i){kr(t,e,void 0,i);for(const n in e.attrs)t.setAttribute(Yr.has(n)?n:ki(n),e.attrs[n])}function Gr(t,e,n){const i=jr(t,e,n);for(const n in t)if(Mi(t[n])||Mi(e[n])){i[-1!==ln.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]}return i}class Kr extends ir{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ws}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(cn.has(e)){const t=Zi(e);return t&&t.default||0}if(Ur.includes(e)){const n=getComputedStyle(t)[e];if("string"==typeof n&&n)return n.trim()}return e=Yr.has(e)?e:ki(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return Gr(t,e,n)}build(t,e,n){zr(t,e,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,e,n,i){Xr(t,e,0,i)}mount(t){this.isSVGTag=Hr(t.tagName),super.mount(t)}}const _r=Ys.length;function qr(t){if(!t)return;if(!t.isControllingVariants){const e=t.parent&&qr(t.parent)||{};return void 0!==t.props.initial&&(e.initial=t.props.initial),e}const e={};for(let n=0;n<_r;n++){const i=Ys[n],o=t.props[i];(Us(o)||!1===o)&&(e[i]=o)}return e}function Zr(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let i=0;iPromise.all(e.map(({animation:e,options:n})=>Ii(t,e,n)))}(t),n=ia(),i=!0,o=!1;const s=e=>(n,i)=>{const o=Si(t,i,"exit"===e?t.presenceContext?.custom:void 0);if(o){const{transition:t,transitionEnd:e,...i}=o;n={...n,...i,...e}}return n};function r(r){const{props:a}=t,l=qr(t.parent)||{},c=[],u=new Set;let h={},d=1/0;for(let e=0;ed&&g,S=!1;const b=Array.isArray(f)?f:[f];let T=b.reduce(s(p),{});!1===y&&(T={});const{prevResolvedValues:P={}}=m,E={...P,...T},A=e=>{w=!0,u.has(e)&&(S=!0,u.delete(e)),m.needsAnimating[e]=!0;const n=t.getValue(e);n&&(n.liveStyle=!1)};for(const t in E){const e=T[t],n=P[t];if(h.hasOwnProperty(t))continue;let i=!1;i=Ti(e)&&Ti(n)?!Zr(e,n)||x:e!==n,i?null!=e?A(t):u.add(t):void 0!==e&&u.has(t)?A(t):m.protectedKeys[t]=!0}m.prevProp=f,m.prevResolvedValues=T,m.isActive&&(h={...h,...T}),(i||o)&&t.blockInitialAnimation&&(w=!1);const M=v&&x;w&&(!M||S)&&c.push(...b.map(e=>{const n={type:p};if("string"==typeof e&&(i||o)&&!M&&t.manuallyAnimateOnMount&&t.parent){const{parent:i}=t,o=Si(i,e);if(i.enteringChildren&&o){const{delayChildren:e}=o.transition||{};n.delay=ti(i.enteringChildren,t,e)}}return{animation:e,options:n}}))}if(u.size){const e={};if("boolean"!=typeof a.initial){const n=Si(t,Array.isArray(a.initial)?a.initial[0]:a.initial);n&&n.transition&&(e.transition=n.transition)}u.forEach(n=>{const i=t.getBaseTarget(n),o=t.getValue(n);o&&(o.liveStyle=!0),e[n]=i??null}),c.push({animation:e})}let p=Boolean(c.length);return!i||!1!==a.initial&&a.initial!==a.animate||t.manuallyAnimateOnMount||(p=!1),i=!1,o=!1,p?e(c):Promise.resolve()}return{animateChanges:r,setActive:function(e,i){if(n[e].isActive===i)return Promise.resolve();t.variantChildren?.forEach(t=>t.animationState?.setActive(e,i)),n[e].isActive=i;const o=r(e);for(const t in n)n[t].protectedKeys={};return o},setAnimateFunction:function(n){e=n(t)},getState:()=>n,reset:()=>{n=ia(),o=!0}}}function ea(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!Zr(e,t)}function na(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function ia(){return{animate:na(!0),whileInView:na(),whileHover:na(),whileTap:na(),whileDrag:na(),whileFocus:na(),exit:na()}}function oa(t,e){t.min=e.min,t.max=e.max}function sa(t,e){oa(t.x,e.x),oa(t.y,e.y)}function ra(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function aa(t){return t.max-t.min}function la(t,e,n){return Math.abs(t-e)<=n}function ca(t,e,n,i=.5){t.origin=i,t.originPoint=qt(e.min,e.max,t.origin),t.scale=aa(n)/aa(e),t.translate=qt(n.min,n.max,t.origin)-t.originPoint,(t.scale>=.9999&&t.scale<=1.0001||isNaN(t.scale))&&(t.scale=1),(t.translate>=-.01&&t.translate<=.01||isNaN(t.translate))&&(t.translate=0)}function ua(t,e,n,i){ca(t.x,e.x,n.x,i?i.originX:void 0),ca(t.y,e.y,n.y,i?i.originY:void 0)}function ha(t,e,n,i=0){const o=i?qt(n.min,n.max,i):n.min;t.min=o+e.min,t.max=t.min+aa(e)}function da(t,e,n,i){ha(t.x,e.x,n.x,i?.x),ha(t.y,e.y,n.y,i?.y)}function pa(t,e,n,i=0){const o=i?qt(n.min,n.max,i):n.min;t.min=e.min-o,t.max=t.min+aa(e)}function ma(t,e,n,i){pa(t.x,e.x,n.x,i?.x),pa(t.y,e.y,n.y,i?.y)}function fa(t,e,n,i,o){return t=pr(t-=e,1/n,i),void 0!==o&&(t=pr(t,1/o,i)),t}function ga(t,e=0,n=1,i=.5,o,s=t,r=t){if(Rt.test(e)){e=parseFloat(e);e=qt(r.min,r.max,e/100)-r.min}if("number"!=typeof e)return;let a=qt(s.min,s.max,i);t===s&&(a-=e),t.min=fa(t.min,e,n,a,o),t.max=fa(t.max,e,n,a,o)}function ya(t,e,[n,i,o],s,r){ga(t,e[n],e[i],e[o],e.scale,s,r)}const va=["x","scaleX","originX"],xa=["y","scaleY","originY"];function wa(t,e,n,i){ya(t.x,e,va,n?n.x:void 0,i?i.x:void 0),ya(t.y,e,xa,n?n.y:void 0,i?i.y:void 0)}function Sa(t){return 0===t.translate&&1===t.scale}function ba(t){return Sa(t.x)&&Sa(t.y)}function Ta(t,e){return t.min===e.min&&t.max===e.max}function Pa(t,e){return Ta(t.x,e.x)&&Ta(t.y,e.y)}function Ea(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Aa(t,e){return Ea(t.x,e.x)&&Ea(t.y,e.y)}function Ma(t){return aa(t.x)/aa(t.y)}function Ca(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function Va(t){return[t("x"),t("y")]}function ka(t,e,n){let i="";const o=t.x.translate/e.x,s=t.y.translate/e.y,r=n?.z||0;if((o||s||r)&&(i=`translate3d(${o}px, ${s}px, ${r}px) `),1===e.x&&1===e.y||(i+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:t,rotate:e,pathRotation:o,rotateX:s,rotateY:r,skewX:a,skewY:l}=n;t&&(i=`perspective(${t}px) ${i}`),e&&(i+=`rotate(${e}deg) `),o&&(i+=`rotate(${o}deg) `),s&&(i+=`rotateX(${s}deg) `),r&&(i+=`rotateY(${r}deg) `),a&&(i+=`skewX(${a}deg) `),l&&(i+=`skewY(${l}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return 1===a&&1===l||(i+=`scale(${a}, ${l})`),i||"none"}const Da=no.length,Ra=t=>"string"==typeof t?parseFloat(t):t,La=t=>"number"==typeof t||Lt.test(t);function Ba(t,e,n,i,o,s){o?(t.opacity=qt(0,n.opacity??1,ja(i)),t.opacityExit=qt(e.opacity??1,0,Ia(i))):s&&(t.opacity=qt(e.opacity??1,n.opacity??1,i));for(let o=0;oie?1:n(D(t,e,i))}function Wa(t,e,n){const i=Mi(t)?t:ii(t);return i.start(di("",i,e,n)),i.animation}function $a(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n,i)}const Na=(t,e)=>t.depth-e.depth;class Ua{constructor(){this.children=[],this.isDirty=!1}add(t){x(this.children,t),this.isDirty=!0}remove(t){w(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Na),this.isDirty=!1,this.children.forEach(t)}}function za(t,e){const n=dt.now(),i=({timestamp:o})=>{const s=o-n;s>=e&&(at(i),t(s-e))};return rt.setup(i,!0),()=>at(i)}function Ya(t){return Mi(t)?t.get():t}class Ha{constructor(){this.members=[]}add(t){x(this.members,t);for(let e=this.members.length-1;e>=0;e--){const n=this.members[e];if(n===t||n===this.lead||n===this.prevLead)continue;const i=n.instance;i&&!1!==i.isConnected||n.snapshot||(w(this.members,n),n.unmount())}t.scheduleRender()}remove(t){if(w(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){for(let e=this.members.indexOf(t)-1;e>=0;e--){const t=this.members[e];if(!1!==t.isPresent&&!1!==t.instance?.isConnected)return this.promote(t),!0}return!1}promote(t,e){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.updateSnapshot(),t.scheduleRender();const{layoutDependency:i}=n.options,{layoutDependency:o}=t.options;void 0!==i&&i===o||(t.resumeFrom=n,e&&(n.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root?.isUpdating&&(t.isLayoutDirty=!0)),!1===t.options.crossfade&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{t.options.onExitComplete?.(),t.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}const Xa={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Ga={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},Ka=["","X","Y","Z"];let _a=0;function qa(t,e,n,i){const{latestValues:o}=e;o[t]&&(n[t]=o[t],e.setStaticValue(t,0),i&&(i[t]=0))}function Za(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=Li(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:e,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",rt,!(e||i))}const{parent:i}=t;i&&!i.hasCheckedOptimisedAppear&&Za(i)}function Ja({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:i,resetTransform:o}){return class{constructor(t={},n=e?.()){this.id=_a++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,es.value&&(Ga.nodes=Ga.calculatedTargetDeltas=Ga.calculatedProjections=0),this.nodes.forEach(el),this.nodes.forEach(ul),this.nodes.forEach(hl),this.nodes.forEach(nl),es.addProjectionMetrics&&es.addProjectionMetrics(Ga)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=t,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let t=0;tthis.root.updateBlockedByResize=!1;rt.read(()=>{i=window.innerWidth}),t(e,()=>{const t=window.innerWidth;t!==i&&(i=t,this.root.updateBlockedByResize=!0,n&&n(),n=za(o,250),Xa.hasAnimatedSinceResize&&(Xa.hasAnimatedSinceResize=!1,this.nodes.forEach(cl)))})}n&&this.root.registerSharedNode(n,this),!1!==this.options.animate&&o&&(n||i)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeLayoutChanged:n,layout:i})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const s=this.options.transition||o.getDefaultTransition()||yl,{onLayoutAnimationStart:r,onLayoutAnimationComplete:a}=o.getProps(),l=!this.targetLayout||!Aa(this.targetLayout,i),c=!e&&n;if(this.options.layoutRoot||this.resumeFrom||c||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const e={...si(s,"layout"),onPlay:r,onComplete:a};(o.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e),this.setAnimationOrigin(t,c,e.path)}else e||cl(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=i})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const t=this.getStack();t&&t.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),at(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(dl),this.animationId++)}getTransformTemplate(){const{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Za(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||aa(this.snapshot.measuredBox.x)||aa(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;t{const n=e/1e3,i=p?.(n);i?(r.x.translate=i.x,r.x.scale=qt(t.x.scale,1,n),r.x.origin=t.x.origin,r.x.originPoint=t.x.originPoint,r.y.translate=i.y,r.y.scale=qt(t.y.scale,1,n),r.y.origin=t.y.origin,r.y.originPoint=t.y.originPoint):(ml(r.x,t.x,n),ml(r.y,t.y,n)),this.setTargetDelta(r),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ma(a,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),function(t,e,n,i){fl(t.x,e.x,n.x,i),fl(t.y,e.y,n.y,i)}(this.relativeTarget,this.relativeTargetOrigin,a,n),d&&Pa(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||(d={x:{min:0,max:0},y:{min:0,max:0}}),sa(d,this.relativeTarget)),l&&(this.animationValues=s,Ba(s,o,this.latestValues,n,h,u)),i&&void 0!==i.rotate&&(this.animationValues||(this.animationValues=s),this.animationValues.pathRotation=i.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(t){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(at(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=rt.update(()=>{Xa.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=ii(0)),this.motionValue.jump(0,!1),this.currentAnimation=Wa(this.motionValue,[0,1e3],{...t,velocity:0,isSync:!0,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onComplete:()=>{t.onComplete&&t.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const t=this.getStack();t&&t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead();let{targetWithTransforms:e,target:n,layout:i,latestValues:o}=t;if(e&&n&&i){if(this!==t&&this.layout&&i&&Sl(this.options.animationType,this.layout.layoutBox,i.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=aa(this.layout.layoutBox.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const i=aa(this.layout.layoutBox.y);n.y.min=t.target.y.min,n.y.max=n.y.min+i}sa(e,n),Tr(e,o),ua(this.projectionDeltaWithTransform,this.layoutCorrected,e,o)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new Ha);this.sharedNodes.get(t).add(e);const n=e.options.initialPromotionConfig;e.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(e):void 0})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){const{layoutId:t}=this.options;return t&&this.getStack()?.lead||this}getPrevLead(){const{layoutId:t}=this.options;return t?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:n}={}){const i=this.getStack();i&&i.promote(this,n),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetSkewAndRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const{latestValues:n}=t;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(e=!0),!e)return;const i={};n.z&&qa("z",t,i,this.animationValues);for(let e=0;et.currentAnimation?.stop()),this.root.nodes.forEach(ol),this.root.sharedNodes.clear()}}}function Qa(t){t.updateLayout()}function tl(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=t.layout,{animationType:o}=t.options,s=e.source!==t.layout.source;if("size"===o)Va(t=>{const i=s?e.measuredBox[t]:e.layoutBox[t],o=aa(i);i.min=n[t].min,i.max=i.min+o});else if("x"===o||"y"===o){const t="x"===o?"y":"x";oa(s?e.measuredBox[t]:e.layoutBox[t],n[t])}else Sl(o,e.layoutBox,n)&&Va(i=>{const o=s?e.measuredBox[i]:e.layoutBox[i],r=aa(n[i]);o.max=o.min+r,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[i].max=t.relativeTarget[i].min+r)});const r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};ua(r,n,e.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};s?ua(a,t.applyTransform(i,!0),e.measuredBox):ua(a,n,e.layoutBox);const l=!ba(r);let c=!1;if(!t.resumeFrom){const i=t.getClosestProjectingParent();if(i&&!i.resumeFrom){const{snapshot:o,layout:s}=i;if(o&&s){const r=t.options.layoutAnchor||void 0,a={x:{min:0,max:0},y:{min:0,max:0}};ma(a,e.layoutBox,o.layoutBox,r);const l={x:{min:0,max:0},y:{min:0,max:0}};ma(l,n,s.layoutBox,r),Aa(a,l)||(c=!0),i.options.layoutRoot&&(t.relativeTarget=l,t.relativeTargetOrigin=a,t.relativeParent=i)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:a,layoutDelta:r,hasLayoutChanged:l,hasRelativeLayoutChanged:c})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function el(t){es.value&&Ga.nodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=Boolean(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function nl(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function il(t){t.clearSnapshot()}function ol(t){t.clearMeasurements()}function sl(t){t.isLayoutDirty=!0,t.updateLayout()}function rl(t){t.isLayoutDirty=!1}function al(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function ll(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function cl(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function ul(t){t.resolveTargetDelta()}function hl(t){t.calcProjection()}function dl(t){t.resetSkewAndRotation()}function pl(t){t.removeLeadSnapshot()}function ml(t,e,n){t.translate=qt(e.translate,0,n),t.scale=qt(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function fl(t,e,n,i){t.min=qt(e.min,n.min,i),t.max=qt(e.max,n.max,i)}function gl(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const yl={duration:.45,ease:[.4,0,.1,1]},vl=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),xl=vl("applewebkit/")&&!vl("chrome/")?Math.round:V;function wl(t){t.min=xl(t.min),t.max=xl(t.max)}function Sl(t,e,n){return"position"===t||"preserve-aspect"===t&&!la(Ma(e),Ma(n),.2)}function bl(t){return t!==t.root&&t.scroll?.wasRoot}const Tl=Ja({attachResizeListener:(t,e)=>$a(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Pl=t=>!t.isLayoutDirty&&t.willUpdate(!1);function El(){const t=new Set,e=new WeakMap,n=()=>t.forEach(Pl);return{add:i=>{t.add(i),e.set(i,i.addEventListener("willUpdate",n))},remove:i=>{t.delete(i);const o=e.get(i);o&&(o(),e.delete(i)),n()},dirty:n}}const Al={current:void 0},Ml=Ja({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Al.current){const t=new Tl({});t.mount(window),t.setOptions({layoutScroll:!0}),Al.current=t}return Al.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),Cl="[data-layout],[data-layout-id]",Vl=new WeakMap;let kl;function Dl(t){const e=[];return t instanceof HTMLElement&&t.matches(Cl)&&e.push(t),t.querySelectorAll(Cl).forEach(t=>{t instanceof HTMLElement&&e.push(t)}),e}function Rl(t,e){const n=t.getAttribute("data-layout");return{layoutId:t.getAttribute("data-layout-id")??void 0,layout:null!==n||void 0,animationType:n&&"true"!==n?n:"both",transition:e}}function Ll(t,e){let n=Vl.get(t);if(n)n.setOptions(Rl(t,e));else{let i=$s.get(t);i||(i=new Ir({props:{},presenceContext:null,visualState:{latestValues:{},renderState:{transform:{},transformOrigin:{},style:{},vars:{}}}},{allowProjection:!0})),t.style.transform&&!ur(i.latestValues)&&(t.style.transform=""),n=new Ml(i.latestValues,function(t){let e=t.parentElement;for(;e;){const t=Vl.get(e);if(t&&t.instance)return t;e=e.parentElement}}(t)),i.projection=n,n.setOptions({...Rl(t,e),visualElement:i}),n.mount(t),Vl.set(t,n)}return n.isPresent=!0,n.options.onExitComplete&&n.setOptions({onExitComplete:void 0}),n}function Bl(t,e){e.setOptions({onExitComplete:void 0});e.getStack()&&!e.isLead()||e.currentAnimation?.stop(),e.unmount(),Vl.delete(t)}function Ol(){const t=kl;kl=void 0,function(){if(lt.isProcessing)return;const t=dt.now();lt.delta=b(0,1e3/60,t-lt.timestamp),lt.timestamp=t,lt.isProcessing=!0,ct.update.process(lt),ct.preRender.process(lt),ct.render.process(lt),lt.isProcessing=!1}();const e=new Map;for(const n of t)for(const t of n.collectTargets()){const i=e.get(t);i?i.push(n):e.set(t,[n])}const n=new Map;for(const t of(i=e.keys(),[...i].sort((t,e)=>t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1))){const i=e.get(t),o=Ll(t,i[i.length-1].transitionFor(t));for(const e of i)e.adopt(t,o);n.set(t,o)}var i;n.forEach(t=>{t.isLayoutDirty=!1,t.willUpdate()});const o=[];for(const e of t){const t=e.runUpdate();t&&o.push(t)}const s=()=>{const e=new Set;for(const n of t)n.reconcileAdditions(e);for(const n of t)n.reconcileRemovals(e);let i;n.forEach(t=>i||(i=t.root));for(const e of t)i||(i=e.getRoot());i?.didUpdate(),So.render(()=>{for(const e of t)e.finalize()})};o.length?Promise.all(o).then(s):s()}const jl=rt,Il=ot.reduce((t,e)=>(t[e]=t=>at(t),t),{}),Fl=e.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function Wl(t,e){if("function"==typeof t)return t(e);null!=t&&(t.current=e)}function $l(...t){return i.useCallback(function(...t){return e=>{let n=!1;const i=t.map(t=>{const i=Wl(t,e);return n||"function"!=typeof i||(n=!0),i});if(n)return()=>{for(let e=0;e{const{width:t,height:e,top:i,left:d,right:p,bottom:m,direction:f}=u.current;if(n||!1===a||!c.current||!t||!e)return;const g="rtl"===f,y="left"===o?g?`right: ${p}`:`left: ${d}`:g?`left: ${d}`:`right: ${p}`,v="bottom"===s?`bottom: ${m}`:`top: ${i}`;c.current.dataset.motionPopId=l;const x=document.createElement("style");h&&(x.nonce=h);const w=r??document.head;return w.appendChild(x),x.sheet&&x.sheet.insertRule(`\n [data-motion-pop-id="${l}"] {\n position: absolute !important;\n width: ${t}px !important;\n height: ${e}px !important;\n ${y}px !important;\n ${v}px !important;\n }\n `),()=>{c.current?.removeAttribute("data-motion-pop-id"),w.contains(x)&&w.removeChild(x)}},[n]),d(Nl,{isPresent:n,childRef:c,sizeRef:u,pop:a,children:!1===a?t:i.cloneElement(t,{ref:m})})}const zl=({children:t,initial:n,isPresent:o,onExitComplete:s,custom:r,presenceAffectsLayout:a,mode:l,anchorX:c,anchorY:u,root:h})=>{const p=f(Yl),m=e.useId(),g=e.useRef(o),x=e.useRef(s);y(()=>{g.current=o,x.current=s});let w=!0,S=e.useMemo(()=>(w=!1,{id:m,initial:n,isPresent:o,custom:r,onExitComplete:t=>{p.set(t,!0);for(const t of p.values())if(!t)return;s&&s()},register:t=>(p.set(t,!1),()=>{p.delete(t),!g.current&&!p.size&&x.current?.()})}),[o,p,s]);return a&&w&&(S={...S}),e.useMemo(()=>{p.forEach((t,e)=>p.set(e,!1))},[o]),i.useEffect(()=>{!o&&!p.size&&s&&s()},[o]),t=d(Ul,{pop:"popLayout"===l,isPresent:o,anchorX:c,anchorY:u,root:h,children:t}),d(v.Provider,{value:S,children:t})};function Yl(){return new Map}function Hl(t=!0){const n=e.useContext(v);if(null===n)return[!0,null];const{isPresent:i,onExitComplete:o,register:s}=n,r=e.useId();e.useEffect(()=>{if(t)return s(r)},[t]);const a=e.useCallback(()=>t&&o&&o(r),[r,o,t]);return!i&&o?[!1,a]:[!0]}const Xl=t=>t.key||"";function Gl(t){const n=[];return e.Children.forEach(t,t=>{e.isValidElement(t)&&n.push(t)}),n}const Kl=e.createContext(null);function _l(){const t=function(){const t=e.useRef(!1);return y(()=>(t.current=!0,()=>{t.current=!1}),[]),t}(),[n,i]=e.useState(0),o=e.useCallback(()=>{t.current&&i(n+1)},[n]);return[e.useCallback(()=>rt.postRender(o),[o]),n]}const ql=t=>!0===t,Zl=({children:t,id:n,inherit:i=!0})=>{const o=e.useContext(m),s=e.useContext(Kl),[r,a]=_l(),l=e.useRef(null),c=o.id||s;null===l.current&&((t=>ql(!0===t)||"id"===t)(i)&&c&&(n=n?c+"-"+n:c),l.current={id:n,group:ql(i)&&o.group||El()});const u=e.useMemo(()=>({...l.current,forceRender:r}),[a]);return d(m.Provider,{value:u,children:t})},Jl=e.createContext({strict:!1}),Ql={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let tc=!1;function ec(){return function(){if(tc)return;const t={};for(const e in Ql)t[e]={isEnabled:t=>Ql[e].some(e=>!!t[e])};tr(t),tc=!0}(),er()}function nc(t){const e=ec();for(const n in t)e[n]={...e[n],...t[n]};tr(e)}function ic(t){return"function"==typeof t}const oc=e.createContext(null),sc=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function rc(t){return"string"==typeof t&&!t.includes("-")&&!!(sc.indexOf(t)>-1||/[A-Z]/u.test(t))}const ac=(t,n)=>n.isSVG??rc(t)?new Kr(n):new Ir(n,{allowProjection:t!==e.Fragment}),lc=e.createContext({});function cc(t){const{initial:n,animate:i}=function(t,e){if(Hs(t)){const{initial:e,animate:n}=t;return{initial:!1===e||Us(e)?e:void 0,animate:Us(n)?n:void 0}}return!1!==t.inherit?e:{}}(t,e.useContext(lc));return e.useMemo(()=>({initial:n,animate:i}),[uc(n),uc(i)])}function uc(t){return Array.isArray(t)?t.join(" "):t}const hc=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function dc(t,e,n){for(const i in e)Mi(e[i])||Or(i,n)||(t[i]=e[i])}function pc(t,n){const i={};return dc(i,t.style||{},t),Object.assign(i,function({transformTemplate:t},n){return e.useMemo(()=>{const e={style:{},transform:{},transformOrigin:{},vars:{}};return Vr(e,n,t),Object.assign({},e.vars,e.style)},[n])}(t,n)),i}function mc(t,e){const n={},i=pc(t,e);return t.drag&&!1!==t.dragListener&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),void 0===t.tabIndex&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=i,n}const fc=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}});function gc(t,n,i,o){const s=e.useMemo(()=>{const e={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return zr(e,n,Hr(o),t.transformTemplate,t.style),{...e.attrs,style:{...e.style}}},[n]);if(t.style){const e={};dc(e,t.style,t),s.style={...e,...s.style}}return s}const yc=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function vc(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||yc.has(t)}function xc(t,e){return t.startsWith("on")?!vc(t):e?.(t)??!vc(t)}function wc(t,e,n,i){const o={};for(const s in t)"values"===s&&"object"==typeof t.values||Mi(t[s])||(xc(s,i)||!0===n&&vc(s)||!e&&!vc(s)||t.draggable&&s.startsWith("onDrag"))&&(o[s]=t[s]);return o}function Sc(t,n,i,{latestValues:o},s,r=!1,a,l){const c=(a??rc(t)?gc:mc)(n,o,s,t),u=wc(n,"string"==typeof t,r,l),h=t!==e.Fragment?{...u,...c,ref:i}:{},{children:d}=n,p=e.useMemo(()=>Mi(d)?d.get():d,[d]);return e.createElement(t,{...h,children:p})}function bc(t,e,n,i){const o={},s=i(t,{});for(const t in s)o[t]=Ya(s[t]);let{initial:r,animate:a}=t;const l=Hs(t),c=Xs(t);e&&c&&!l&&!1!==t.inherit&&(void 0===r&&(r=e.initial),void 0===a&&(a=e.animate));let u=!!n&&!1===n.initial;u=u||!1===r;const h=u?a:r;if(h&&"boolean"!=typeof h&&!Ns(h)){const e=Array.isArray(h)?h:[h];for(let n=0;n(n,i)=>{const o=e.useContext(lc),s=e.useContext(v),r=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e},n,i,o){return{latestValues:bc(n,i,o,t),renderState:e()}}(t,n,o,s);return i?r():f(r)},Pc=Tc({scrapeMotionValuesFromProps:jr,createRenderState:hc}),Ec=Tc({scrapeMotionValuesFromProps:Gr,createRenderState:fc}),Ac=Symbol.for("motionComponentSymbol");function Mc(t,n,i){const o=e.useRef(i);e.useInsertionEffect(()=>{o.current=i});const s=e.useRef(null);return e.useCallback(e=>{e&&t.onMount?.(e),n&&(e?n.mount(e):n.unmount());const i=o.current;if("function"==typeof i)if(e){const t=i(e);"function"==typeof t&&(s.current=t)}else s.current?(s.current(),s.current=null):i(e);else i&&(i.current=e)},[n])}const Cc=e.createContext({});function Vc(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function kc(t,n,i,o,s,r){const{visualElement:a}=e.useContext(lc),l=e.useContext(Jl),c=e.useContext(v),u=e.useContext(Fl),h=u.reducedMotion,d=u.skipAnimations,p=e.useRef(null),m=e.useRef(!1);o=o||l.renderer,!p.current&&o&&(p.current=o(t,{visualState:n,parent:a,props:i,presenceContext:c,blockInitialAnimation:!!c&&!1===c.initial,reducedMotionConfig:h,skipAnimations:d,isSVG:r}),m.current&&p.current&&(p.current.manuallyAnimateOnMount=!0));const f=p.current,g=e.useContext(Cc);!f||f.projection||!s||"html"!==f.type&&"svg"!==f.type||function(t,e,n,i){const{layoutId:o,layout:s,drag:r,dragConstraints:a,layoutScroll:l,layoutRoot:c,layoutAnchor:u,layoutCrossfade:h}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:Dc(t.parent)),t.projection.setOptions({layoutId:o,layout:s,alwaysMeasureLayout:Boolean(r)||a&&Vc(a),visualElement:t,animationType:"string"==typeof s?s:"both",initialPromotionConfig:i,crossfade:h,layoutScroll:l,layoutRoot:c,layoutAnchor:u})}(p.current,i,s,g);const x=e.useRef(!1);e.useInsertionEffect(()=>{f&&x.current&&f.update(i,c)});const w=i[Ri],S=e.useRef(Boolean(w)&&"undefined"!=typeof window&&!window.MotionHandoffIsComplete?.(w)&&window.MotionHasOptimisedAnimation?.(w));return y(()=>{m.current=!0,f&&(x.current=!0,window.MotionIsMounted=!0,f.updateFeatures(),f.scheduleRenderMicrotask(),S.current&&f.animationState&&f.animationState.animateChanges())}),e.useEffect(()=>{f&&(!S.current&&f.animationState&&f.animationState.animateChanges(),S.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(w)}),S.current=!1),f.enteringChildren=void 0)}),f}function Dc(t){if(t)return!1!==t.options.allowProjection?t.projection:Dc(t.parent)}function Rc(t,{forwardMotionProps:n=!1,type:i}={},o,s){o&&nc(o);const r=i?"svg"===i:rc(t),a=r?Ec:Pc;function l(i,o){let l;const c={...e.useContext(Fl),...i,layoutId:Lc(i)},{isStatic:u,isValidProp:h}=c,m=cc(i),f=a(i,u);if(!u&&"undefined"!=typeof window){e.useContext(Jl).strict;const n=function(t){const e=ec(),{drag:n,layout:i}=e;if(!n&&!i)return{};const o={...n,...i};return{MeasureLayout:n?.isEnabled(t)||i?.isEnabled(t)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}(c);l=n.MeasureLayout,m.visualElement=kc(t,f,c,s,n.ProjectionNode,r)}return p(lc.Provider,{value:m,children:[l&&m.visualElement?d(l,{visualElement:m.visualElement,...c}):null,Sc(t,i,Mc(f,m.visualElement,o),f,u,n,r,h)]})}l.displayName=`motion.${"string"==typeof t?t:`create(${t.displayName??t.name??""})`}`;const c=e.forwardRef(l);return c[Ac]=t,c}function Lc({layoutId:t}){const n=e.useContext(m).id;return n&&void 0!==t?n+"-"+t:t}function Bc(t,e){if("undefined"==typeof Proxy)return Rc;const n=new Map,i=(n,i)=>Rc(n,i,t,e);return new Proxy((t,e)=>i(t,e),{get:(o,s)=>"create"===s?i:(n.has(s)||n.set(s,Rc(s,void 0,t,e)),n.get(s))})}let Oc=0;const jc={animation:{Feature:class extends or{constructor(t){super(t),t.animationState||(t.animationState=ta(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Ns(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}},exit:{Feature:class extends or{constructor(){super(...arguments),this.id=Oc++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:e}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===n)return;if(t&&!1===n){if(this.isExitComplete){const{initial:t,custom:e}=this.node.getProps();if("string"==typeof t||"object"==typeof t&&null!==t&&!Array.isArray(t)){const n=Si(this.node,t,e);if(n){const{transition:t,transitionEnd:e,...i}=n;for(const t in i)this.node.getValue(t)?.jump(i[t])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);return void(this.isExitComplete=!1)}const i=this.node.animationState.setActive("exit",!t);e&&!t&&i.then(()=>{this.isExitComplete=!0,e(this.id)})}mount(){const{register:t,onExitComplete:e}=this.node.presenceContext||{};e&&e(this.id),t&&(this.unmount=t(this.id))}unmount(){}}}};function Ic(t){return{point:{x:t.pageX,y:t.pageY}}}const Fc=t=>e=>Vo(e)&&t(e,Ic(e));function Wc(t,e,n,i){return $a(t,e,Fc(n),i)}const $c=({current:t})=>t?t.ownerDocument.defaultView:null,Nc=(t,e)=>Math.abs(t-e);function Uc(t,e){const n=Nc(t.x,e.x),i=Nc(t.y,e.y);return Math.sqrt(n**2+i**2)}const zc=new Set(["auto","scroll"]);class Yc{constructor(t,e,{transformPagePoint:n,contextWindow:i=window,dragSnapToOrigin:o=!1,distanceThreshold:s=3,element:r}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=t=>{this.handleScroll(t.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Hc(this.lastRawMoveEventInfo,this.transformPagePoint));const t=Gc(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=Uc(t.offset,{x:0,y:0})>=this.distanceThreshold;if(!e&&!n)return;const{point:i}=t,{timestamp:o}=lt;this.history.push({...i,timestamp:o});const{onStart:s,onMove:r}=this.handlers;e||(s&&s(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),r&&r(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastRawMoveEventInfo=e,this.lastMoveEventInfo=Hc(e,this.transformPagePoint),rt.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();const{onEnd:n,onSessionEnd:i,resumeAnimation:o}=this.handlers;if(!this.dragSnapToOrigin&&this.startEvent||o&&o(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const s=Gc("pointercancel"===t.type?this.lastMoveEventInfo:Hc(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,s),i&&i(t,s)},!Vo(t))return;this.dragSnapToOrigin=o,this.handlers=e,this.transformPagePoint=n,this.distanceThreshold=s,this.contextWindow=i||window;const a=Hc(Ic(t),this.transformPagePoint),{point:l}=a,{timestamp:c}=lt;this.history=[{...l,timestamp:c}];const{onSessionStart:u}=e;u&&u(t,Gc(a,this.history));const h={passive:!0,capture:!0};this.removeListeners=k(Wc(this.contextWindow,"pointermove",this.handlePointerMove,h),Wc(this.contextWindow,"pointerup",this.handlePointerUp,h),Wc(this.contextWindow,"pointercancel",this.handlePointerUp,h)),r&&this.startScrollTracking(r)}startScrollTracking(t){let e=t.parentElement;for(;e;){const t=getComputedStyle(e);(zc.has(t.overflowX)||zc.has(t.overflowY))&&this.scrollPositions.set(e,{x:e.scrollLeft,y:e.scrollTop}),e=e.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const e=this.scrollPositions.get(t);if(!e)return;const n=t===window,i=n?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},o=i.x-e.x,s=i.y-e.y;0===o&&0===s||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=o,this.lastMoveEventInfo.point.y+=s):this.history.length>0&&(this.history[0].x-=o,this.history[0].y-=s),this.scrollPositions.set(t,i),rt.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),at(this.updatePoint)}}function Hc(t,e){return e?{point:e(t.point)}:t}function Xc(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Gc({point:t},e){return{point:t,delta:Xc(t,_c(e)),offset:Xc(t,Kc(e)),velocity:qc(e,.1)}}function Kc(t){return t[0]}function _c(t){return t[t.length-1]}function qc(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const o=_c(t);for(;n>=0&&(i=t[n],!(o.timestamp-i.timestamp>L(e)));)n--;if(!i)return{x:0,y:0};i===t[0]&&t.length>2&&o.timestamp-i.timestamp>2*L(e)&&(i=t[1]);const s=B(o.timestamp-i.timestamp);if(0===s)return{x:0,y:0};const r={x:(o.x-i.x)/s,y:(o.y-i.y)/s};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function Zc(t,e,n){return{min:void 0!==e?t.min+e:void 0,max:void 0!==n?t.max+n-(t.max-t.min):void 0}}function Jc(t,e){let n=e.min-t.min,i=e.max-t.max;return e.max-e.min{e&&this.snapToCursor(Ic(t).point),this.stopAnimation()},onStart:(t,e)=>{const{drag:n,dragPropagation:i,onDragStart:o}=this.getProps();if(n&&!i&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Eo(n),!this.openDragLock))return;this.latestPointerEvent=t,this.latestPanInfo=e,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Va(t=>{let e=this.getAxisMotionValue(t).get()||0;if(Rt.test(e)){const{projection:n}=this.visualElement;if(n&&n.layout){const i=n.layout.layoutBox[t];if(i){e=aa(i)*(parseFloat(e)/100)}}}this.originPoint[t]=e}),o&&rt.update(()=>o(t,e),!1,!0),Vi(this.visualElement,"transform");const{animationState:s}=this.visualElement;s&&s.setActive("whileDrag",!0)},onMove:(t,e)=>{this.latestPointerEvent=t,this.latestPanInfo=e;const{dragPropagation:n,dragDirectionLock:i,onDirectionLock:o,onDrag:s}=this.getProps();if(!n&&!this.openDragLock)return;const{offset:r}=e;if(i&&null===this.currentDirection)return this.currentDirection=function(t,e=10){let n=null;Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x");return n}(r),void(null!==this.currentDirection&&o&&o(this.currentDirection));this.updateAxis("x",e.point,r),this.updateAxis("y",e.point,r),this.visualElement.render(),s&&rt.update(()=>s(t,e),!1,!0)},onSessionEnd:(t,e)=>{this.latestPointerEvent=t,this.latestPanInfo=e,this.stop(t,e),this.latestPointerEvent=null,this.latestPanInfo=null},resumeAnimation:()=>{const{dragSnapToOrigin:t}=this.getProps();(t||this.constraints)&&this.startAnimation({x:0,y:0})}},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:o,distanceThreshold:n,contextWindow:$c(this.visualElement),element:this.visualElement.current})}stop(t,e){const n=t||this.latestPointerEvent,i=e||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!i||!n)return;const{velocity:s}=i;this.startAnimation(s);const{onDragEnd:r}=this.getProps();r&&rt.postRender(()=>r(n,i))}cancel(){this.isDragging=!1;const{projection:t,animationState:e}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),e&&e.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,e,n){const{drag:i}=this.getProps();if(!n||!su(t,i,this.currentDirection))return;const o=this.getAxisMotionValue(t);let s=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(s=function(t,{min:e,max:n},i){return void 0!==e&&tn&&(t=i?qt(n,t,i.max):Math.min(t,n)),t}(s,this.constraints[t],this.elastic[t])),o.set(s)}resolveConstraints(){const{dragConstraints:t,dragElastic:e}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,i=this.constraints;t&&Vc(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!n)&&function(t,{top:e,left:n,bottom:i,right:o}){return{x:Zc(t.x,n,o),y:Zc(t.y,e,i)}}(n.layoutBox,t),this.elastic=function(t=Qc){return!1===t?t=0:!0===t&&(t=Qc),{x:tu(t,"left","right"),y:tu(t,"top","bottom")}}(e),i!==this.constraints&&!Vc(t)&&n&&this.constraints&&!this.hasMutatedConstraints&&Va(t=>{!1!==this.constraints&&this.getAxisMotionValue(t)&&(this.constraints[t]=function(t,e){const n={};return void 0!==e.min&&(n.min=e.min-t.min),void 0!==e.max&&(n.max=e.max-t.min),n}(n.layoutBox[t],this.constraints[t]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!Vc(e))return!1;const i=e.current;t.invariant(null!==i,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:o}=this.visualElement;if(!o||!o.layout)return!1;o.root&&(o.root.scroll=void 0,o.root.updateScroll());const s=Er(i,o.root,this.visualElement.getTransformPagePoint());let r=function(t,e){return{x:Jc(t.x,e.x),y:Jc(t.y,e.y)}}(o.layout.layoutBox,s);if(n){const t=n(rr(r));this.hasMutatedConstraints=!!t,t&&(r=sr(t))}return r}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:i,dragTransition:o,dragSnapToOrigin:s,onDragTransitionEnd:r}=this.getProps(),a=this.constraints||{},l=Va(r=>{if(!su(r,e,this.currentDirection))return;let l=a&&a[r]||{};!0!==s&&s!==r||(l={min:0,max:0});const c=i?200:1e6,u=i?40:1e7,h={type:"inertia",velocity:n?t[r]:0,bounceStiffness:c,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...o,...l};return this.startAxisValueAnimation(r,h)});return Promise.all(l).then(r)}startAxisValueAnimation(t,e){const n=this.getAxisMotionValue(t);return Vi(this.visualElement,t),n.start(di(t,n,0,e,this.visualElement,!1))}stopAnimation(){Va(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const e=`_drag${t.toUpperCase()}`,n=this.visualElement.getProps()[e];return n||this.visualElement.getValue(t,this.visualElement.latestValues[t]??0)}snapToCursor(t){Va(e=>{const{drag:n}=this.getProps();if(!su(e,n,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(e);if(i&&i.layout){const{min:n,max:s}=i.layout.layoutBox[e],r=o.get()||0;o.set(t[e]-qt(n,s,.5)+r)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:e}=this.getProps(),{projection:n}=this.visualElement;if(!Vc(e)||!n||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Va(t=>{const e=this.getAxisMotionValue(t);if(e&&!1!==this.constraints){const n=e.get();i[t]=function(t,e){let n=.5;const i=aa(t),o=aa(e);return o>i?n=D(e.min,e.max-i,t.min):i>o&&(n=D(t.min,t.max-o,e.min)),b(0,1,n)}({min:n,max:n},this.constraints[t])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),Va(e=>{if(!su(e,t,null))return;const n=this.getAxisMotionValue(e),{min:o,max:s}=this.constraints[e];n.set(qt(o,s,i[e]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;nu.set(this.visualElement,this);const t=this.visualElement.current,e=Wc(t,"pointerdown",e=>{const{drag:n,dragListener:i=!0}=this.getProps(),o=e.target,s=o!==t&&Lo(o);n&&i&&!s&&this.start(e)});let n;const i=()=>{const{dragConstraints:e}=this.getProps();Vc(e)&&e.current&&(this.constraints=this.resolveRefConstraints(),n||(n=function(t,e,n){const i=Qo(t,ou(n)),o=Qo(e,ou(n));return()=>{i(),o()}}(t,e.current,()=>this.scalePositionWithinConstraints())))},{projection:o}=this.visualElement,s=o.addEventListener("measure",i);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),rt.read(i);const r=$a(window,"resize",()=>this.scalePositionWithinConstraints()),a=o.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(Va(e=>{const n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))}),this.visualElement.render())});return()=>{r(),e(),s(),a&&a(),n&&n()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:s=Qc,dragMomentum:r=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:i,dragConstraints:o,dragElastic:s,dragMomentum:r}}}function ou(t){let e=!0;return()=>{e?e=!1:t()}}function su(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}const ru=t=>(e,n)=>{t&&rt.update(()=>t(e,n),!1,!0)};let au=!1;class lu extends e.Component{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:i}=this.props,{projection:o}=t;o&&(e.group&&e.group.add(o),n&&n.register&&i&&n.register(o),au&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Xa.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:n,drag:i,isPresent:o}=this.props,{projection:s}=n;return s?(s.isPresent=o,t.layoutDependency!==e&&s.setOptions({...s.options,layoutDependency:e}),au=!0,i||t.layoutDependency!==e||void 0===e||t.isPresent!==o?s.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?s.promote():s.relegate()||rt.postRender(()=>{const t=s.getStack();t&&t.members.length||this.safeToRemove()})),null):null}componentDidUpdate(){const{visualElement:t,layoutAnchor:e}=this.props,{projection:n}=t;n&&(n.options.layoutAnchor=e,n.root.didUpdate(),So.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n}=this.props,{projection:i}=t;au=!0,i&&(i.scheduleCheckAfterUnmount(),e&&e.group&&e.group.remove(i),n&&n.deregister&&n.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function cu(t){const[n,i]=Hl(),o=e.useContext(m);return d(lu,{...t,layoutGroup:o,switchLayoutGroup:e.useContext(Cc),isPresent:n,safeToRemove:i})}const uu={pan:{Feature:class extends or{constructor(){super(...arguments),this.removePointerDownListener=V}onPointerDown(t){this.session=new Yc(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:$c(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:e,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:ru(t),onStart:ru(e),onMove:ru(n),onEnd:(t,e)=>{delete this.session,i&&rt.postRender(()=>i(t,e))}}}mount(){this.removePointerDownListener=Wc(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends or{constructor(t){super(t),this.removeGroupControls=V,this.removeListeners=V,this.controls=new iu(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||V}update(){const{dragControls:t}=this.node.getProps(),{dragControls:e}=this.node.prevProps||{};t!==e&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},ProjectionNode:Ml,MeasureLayout:cu}};function hu(t,e,n){const{props:i}=t;t.animationState&&i.whileHover&&t.animationState.setActive("whileHover","Start"===n);const o=i["onHover"+n];o&&rt.postRender(()=>o(e,Ic(e)))}function du(t,e,n){const{props:i}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&i.whileTap&&t.animationState.setActive("whileTap","Start"===n);const o=i["onTap"+("End"===n?"":n)];o&&rt.postRender(()=>o(e,Ic(e)))}const pu=new WeakMap,mu=new WeakMap,fu=t=>{const e=pu.get(t.target);e&&e(t)},gu=t=>{t.forEach(fu)};function yu(t,e,n){const i=function({root:t,...e}){const n=t||document;mu.has(n)||mu.set(n,{});const i=mu.get(n),o=JSON.stringify(e);return i[o]||(i[o]=new IntersectionObserver(gu,{root:t,...e})),i[o]}(e);return pu.set(t,n),i.observe(t),()=>{pu.delete(t),i.unobserve(t)}}const vu={some:0,all:1};const xu={inView:{Feature:class extends or{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:t={}}=this.node.getProps(),{root:e,margin:n,amount:i="some",once:o}=t,s={root:e?e.current:void 0,rootMargin:n,threshold:"number"==typeof i?i:vu[i]};this.stopObserver=yu(this.node.current,s,t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,o&&!e&&this.hasEnteredView)return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);const{onViewportEnter:n,onViewportLeave:i}=this.node.getProps(),s=e?n:i;s&&s(t)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}(t,e))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}},tap:{Feature:class extends or{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:e,propagate:n}=this.node.props;this.unmount=Wo(t,(t,e)=>(du(this.node,e,"Start"),(t,{success:e})=>du(this.node,t,e?"End":"Cancel")),{useGlobalTarget:e,stopPropagation:!1===n?.tap})}unmount(){}}},focus:{Feature:class extends or{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){t=!0}t&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=k($a(this.node.current,"focus",()=>this.onFocus()),$a(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends or{mount(){const{current:t}=this.node;t&&(this.unmount=Mo(t,(t,e)=>(hu(this.node,e,"Start"),t=>hu(this.node,t,"End"))))}unmount(){}}}},wu={layout:{ProjectionNode:Ml,MeasureLayout:cu}},Su=Bc({...jc,...xu,...uu,...wu},ac);function bu(t,e,n,i,o,s="ltr"){const r=t.findIndex(t=>t.value===e);if(-1===r)return t;if("xy"===o){const{layout:e}=t[r],i={x:qt(e.x.min,e.x.max,.5)+n.x,y:qt(e.y.min,e.y.max,.5)+n.y},o=function(t){const e=[];return t.forEach(t=>{const{min:n,max:i}=t.layout.y,o=e[e.length-1];!o||n>=o.max||i<=o.min?e.push({items:[t],min:n,max:i}):(o.items.push(t),o.min=Math.min(o.min,n),o.max=Math.max(o.max,i))}),e}(t),a=o.find(e=>e.items.includes(t[r])),l=o.reduce((t,e)=>Tu(i.y,e)n!==e),r=i.items.find(t=>{const e=qt(t.layout.x.min,t.layout.x.max,.5);return"ltr"===o?ne}),a=r?s.indexOf(r):s.indexOf(i.items[i.items.length-1])+1,l=[...s];return l.splice(a,0,t[e]),l.every((e,n)=>e===t[n])?t:l}(t,r,i.x,l,s);const c=Pu(i,e);let u=-1,h=c;return t.forEach((t,e)=>{if(e===r)return;const n=Pu(i,t.layout);n0?1:-1,l=t[r+a];if(!l)return t;const c=t[r].layout[o],u=l.layout[o],h=qt(u.min,u.max,.5);return 1===a&&c.max+n[o]>h||-1===a&&c.min+n[o]e.max?t-e.max:0}function Pu(t,e){const n=Math.max(e.x.min-t.x,0,t.x-e.x.max),i=Math.max(e.y.min-t.y,0,t.y-e.y.max);return n*n+i*i}const Eu=(t,e)=>t.max<=e.min||e.max<=t.min;function Au({children:n,as:i="ul",axis:o,onReorder:s,values:r,...a},l){const c=f(()=>Su[i]),u=e.useRef(new Map),[h,p]=e.useState("y"),m=e.useRef(!1),g=e.useRef(null),y=o||h;t.invariant(Boolean(r),"Reorder.Group must be provided a values prop","reorder-values");const v=new Set(r);u.current.forEach((t,e)=>{v.has(e)||u.current.delete(e)});const x={axis:y,groupRef:g,registerItem:(t,e)=>{if(u.current.set(t,e),!o){const t=function(t){let e=!1,n=!1;for(let i=0;i{const e=u.current.get(t);return e?[e]:[]}));t!==h&&p(t)}},updateOrder:(t,e,n)=>{if(m.current)return;const i=r.flatMap(t=>{const e=u.current.get(t);return e?[{value:t,layout:e}]:[]}),o="rtl"===g.current?.ownerDocument.defaultView?.getComputedStyle(g.current).direction?"rtl":"ltr",a=bu(i,t,e,n,y,o);if(i!==a){m.current=!0;const t=[...r],e=i.map(({value:t})=>r.indexOf(t));a.forEach(({value:n},i)=>{t[e[i]]=n}),s(t)}}};e.useEffect(()=>{m.current=!1});const w={overflowAnchor:"none",...a.style};return d(c,{...a,style:w,ref:t=>{g.current=t,"function"==typeof l?l(t):l&&(l.current=t)},ignoreStrict:!0,children:d(oc.Provider,{value:x,children:n})})}const Mu=e.forwardRef(Au);function Cu(t){const n=f(()=>ii(t)),{isStatic:i}=e.useContext(Fl);if(i){const[,i]=e.useState(t);e.useEffect(()=>n.on("change",i),[])}return n}function Vu(t,e){const n=Cu(e()),i=()=>n.set(e());return i(),y(()=>{const e=()=>rt.preRender(i,!1,!0),n=t.map(t=>t.on("change",e));return()=>{n.forEach(t=>t()),at(i)}}),n}function ku(t,e,n,i){if("function"==typeof t)return function(t){ei.current=[],t();const e=Vu(ei.current,t);return ei.current=void 0,e}(t);if(void 0!==n&&!Array.isArray(n)&&"function"!=typeof e)return function(t,e,n,i){const o=f(()=>Object.keys(n)),s=f(()=>({}));for(const r of o)s[r]=ku(t,e,n[r],i);return s}(t,e,n,i);const o="function"==typeof e?e:os(e,n,i),s=Array.isArray(t)?Du(t,o):Du([t],([t])=>o(t)),r=Array.isArray(t)?void 0:t.accelerate;return r&&!r.isTransformed&&"function"!=typeof e&&Array.isArray(n)&&!1!==i?.clamp&&(s.accelerate={...r,times:e,keyframes:n,isTransformed:!0,...i?.ease?{ease:i.ease}:{}}),s}function Du(t,e){const n=f(()=>[]);return Vu(t,()=>{n.length=0;const i=t.length;for(let e=0;e0))return;Bu.set(o,a);const t="x"===n?o.scrollWidth-(c?window.innerWidth:o.clientWidth):o.scrollHeight-(c?window.innerHeight:o.clientHeight);Lu.set(o,t)}if(r>0){const t=Lu.get(o);if(("x"===n?c?window.scrollX:o.scrollLeft:c?window.scrollY:o.scrollTop)>=t)return}"x"===n?c?window.scrollBy({left:r}):o.scrollLeft+=r:c?window.scrollBy({top:r}):o.scrollTop+=r}function Wu(t,e=0){return Mi(t)?t:Cu(e)}function $u({children:n,style:i={},value:o,as:s="li",onDrag:r,onDragEnd:a,layout:l=!0,...c},u){const h=f(()=>Su[s]),p=e.useContext(oc),m={x:Wu(i.x),y:Wu(i.y)},g=ku([m.x,m.y],([t,e])=>t||e?1:"unset");t.invariant(Boolean(p),"Reorder.Item must be a child of Reorder.Group","reorder-item-child");const{axis:y,registerItem:v,updateOrder:x,groupRef:w}=p;return d(h,{drag:"xy"===y||y,...c,dragSnapToOrigin:!0,style:{...i,x:m.x,y:m.y,zIndex:g},layout:l,onDrag:(t,e)=>{const{velocity:n,point:i}=e,s={x:m.x.get(),y:m.y.get()};x(o,s,n);const a="xy"===y?Math.abs(n.x)>Math.abs(n.y)?"x":"y":y;Fu(w.current,i[a],a,n[a]),r&&r(t,e)},onDragEnd:(t,e)=>{!function(){if(Ou){const t=Iu(Ou,"y");t&&(Bu.delete(t),Lu.delete(t));const e=Iu(Ou,"x");e&&e!==t&&(Bu.delete(e),Lu.delete(e)),Ou=null}}(),a&&a(t,e)},onLayoutMeasure:t=>{v(o,t)},ref:u,ignoreStrict:!0,children:n})}const Nu=e.forwardRef($u);var Uu=Object.freeze({__proto__:null,Group:Mu,Item:Nu});function zu(t){return"object"==typeof t&&!Array.isArray(t)}function Yu(t,e,n,i){return null==t?[]:"string"==typeof t&&zu(e)?ro(t,n,i):t instanceof NodeList?Array.from(t):Array.isArray(t)?t.filter(t=>null!=t):[t]}function Hu(t,e,n){return t*(e+1)+n*e}function Xu(t,e,n,i){return"number"==typeof e?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?n:e.startsWith("<")?Math.max(0,n+parseFloat(e.slice(1))):i.get(e)??t}function Gu(t,e,n,i,o,s){!function(t,e,n){for(let i=0;ie&&o.at"number"==typeof t,eh=t=>t.every(th);function nh(t){const e={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=No(t)&&!ns(t)?new Kr(e):new Ir(e);n.mount(t),$s.set(t,n)}function ih(t){const e=new Fr({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});e.mount(t),$s.set(t,e)}function oh(e,n,i,o){const s=[];if(function(t,e){return Mi(t)||"number"==typeof t||"string"==typeof t&&!zu(e)}(e,n))s.push(Wa(e,zu(n)&&n.default||n,i&&i.default||i));else{if(null==e)return s;const r=Yu(e,n,o),a=r.length;t.invariant(Boolean(a),"No valid elements provided.","no-valid-elements");for(let t=0;t{const c=Ju(e),{delay:u=0,times:h=Fe(c),type:m=n.type||"keyframes",repeat:f,repeatType:g,repeatDelay:v=0,...x}=i;let{ease:w=n.ease||"easeOut",duration:S}=i;const b="function"==typeof u?u(a,l):u,T=c.length,P=Ln(m)?m:s?.[m||"keyframes"];if(T<=2&&P){let t=100;if(2===T&&eh(c)){const e=c[1]-c[0];t=Math.abs(e)}const e={...n,...x};void 0!==S&&(e.duration=L(S));const i=pe(e,t,P);w=i.ease,S=i.duration}S??(S=r);const E=d+b;1===h.length&&0===h[0]&&(h[1]=1);const A=h.length-c.length;if(A>0&&Ie(h,A),1===c.length&&c.unshift(null),f&&t.warning(f<20,`Sequence segments can't repeat ${f} times — ignoring repeat option. Use a value below 20 or apply repeat at the sequence level instead.`),f&&f<20){const t=S>0?v/S:0;S=Hu(S,f,v);const e=[...c],n=[...h];w=Array.isArray(w)?[...w]:[w];const i=[...w],o="reverse"===g||"mirror"===g;let s=e,r=i;o&&(s=[...e].reverse(),"reverse"===g&&(r=[...i].reverse().map(t=>"function"==typeof t?U(t):t)));for(let a=0;a0&&(c.push(c[c.length-1]),h.push(p),w.push("linear")),c.push(...u);for(let t=0;t{for(const o in t){const s=t[o];s.sort(_u);const r=[],l=[],c=[];for(let t=0;t{if(Array.isArray(t)&&"function"==typeof t[0]){const e=t[0],n=ii(0);return n.on("change",e),1===t.length?[n,[0,1]]:2===t.length?[n,[0,1],t[1]]:[n,t[1],t[2]]}return t}),n,i,{spring:Le});return s.forEach(({keyframes:t,transition:e},n)=>{o.push(...oh(n,t,e))}),o}function rh(t={}){const{scope:e,reduceMotion:n,skipAnimations:i}=t;return function(t,o,s){let r,a=[];const l={};if(void 0!==n&&(l.reduceMotion=n),void 0!==i&&(l.skipAnimations=i),c=t,Array.isArray(c)&&c.some(Array.isArray)){const{onComplete:n,...i}=o||{};"function"==typeof n&&(r=n),a=sh(t,{...l,...i},e)}else{const{onComplete:n,...i}=s||{};"function"==typeof n&&(r=n),a=oh(t,o,{...l,...i},e)}var c;const u=new _n(a);return r&&u.finished.then(r),e&&(e.animations.push(u),u.finished.then(()=>{w(e.animations,u)})),u}}const ah=rh();const lh=e=>function(n,i,o){return new _n(function(e,n,i,o){if(null==e)return[];const s=ro(e,o),r=s.length;t.invariant(Boolean(r),"No valid elements provided.","no-valid-elements");const a=[];for(let t=0;te.delete(n)),l.push(o)}return l}(n,i,o,e))},ch=lh();function uh(t){return"undefined"!=typeof window&&(t?Mn():An())}const hh={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function dh(t,e,n,i){const o=n[e],{length:s,position:r}=hh[e],a=o.current,l=n.time;o.current=Math.abs(t[`scroll${r}`]),o.scrollLength=t[`scroll${s}`]-t[`client${s}`],o.offset.length=0,o.offset[0]=0,o.offset[1]=o.scrollLength,o.progress=D(0,o.scrollLength,o.current);const c=i-l;o.velocity=c>50?0:O(o.current-a,c)}const ph={start:0,center:.5,end:1};function mh(t,e,n=0){let i=0;if(t in ph&&(t=ph[t]),"string"==typeof t){const e=parseFloat(t);t.endsWith("px")?i=e:t.endsWith("%")?t=e/100:t.endsWith("vw")?i=e/100*document.documentElement.clientWidth:t.endsWith("vh")?i=e/100*document.documentElement.clientHeight:t=e}return"number"==typeof t&&(i=e*t),n+i}const fh=[0,0];function gh(t,e,n,i){let o=Array.isArray(t)?t:fh,s=0,r=0;return"number"==typeof t?o=[t,t]:"string"==typeof t&&(o=(t=t.trim()).includes(" ")?t.split(" "):[t,ph[t]?t:"0"]),s=mh(o[0],n,i),r=mh(o[1],e),s-r}const yh={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},vh={x:0,y:0};function xh(t,e,n){const{offset:i=yh.All}=n,{target:o=t,axis:s="y"}=n,r="y"===s?"height":"width",a=o!==t?function(t,e){const n={x:0,y:0};let i=t;for(;i&&i!==e;)if(fo(i))n.x+=i.offsetLeft,n.y+=i.offsetTop,i=i.offsetParent;else if("svg"===i.tagName){const t=i.getBoundingClientRect();i=i.parentElement;const e=i.getBoundingClientRect();n.x+=t.left-e.left,n.y+=t.top-e.top}else{if(!(i instanceof SVGGraphicsElement))break;{const{x:t,y:e}=i.getBBox();n.x+=t,n.y+=e;let o=null,s=i.parentNode;for(;!o;)"svg"===s.tagName&&(o=s),s=i.parentNode;i=o}}return n}(o,t):vh,l=o===t?{width:t.scrollWidth,height:t.scrollHeight}:function(t){return"getBBox"in t&&"svg"!==t.tagName?t.getBBox():{width:t.clientWidth,height:t.clientHeight}}(o),c={width:t.clientWidth,height:t.clientHeight};e[s].offset.length=0;let u=!e[s].interpolate;const h=i.length;for(let t=0;t{!function(t,e=t,n){if(n.x.targetOffset=0,n.y.targetOffset=0,e!==t){let i=e;for(;i&&i!==t;)n.x.targetOffset+=i.offsetLeft,n.y.targetOffset+=i.offsetTop,i=i.offsetParent}n.x.targetLength=e===t?e.scrollWidth:e.clientWidth,n.y.targetLength=e===t?e.scrollHeight:e.clientHeight,n.x.containerLength=t.clientWidth,n.y.containerLength=t.clientHeight}(t,i.target,n),function(t,e,n){dh(t,"x",e,n),dh(t,"y",e,n),e.time=n}(t,n,e),(i.offset||i.target)&&xh(t,n,i)},notify:()=>e(n)}}const Sh=new WeakMap,bh=new WeakMap,Th=new WeakMap,Ph=new WeakMap,Eh=new WeakMap,Ah=t=>t===document.scrollingElement?window:t;function Mh(t,{container:e=document.scrollingElement,trackContentSize:n=!1,...i}={}){if(!e)return V;let o=Th.get(e);o||(o=new Set,Th.set(e,o));const s=wh(e,t,{time:0,x:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0},y:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}},i);if(o.add(s),!Sh.has(e)){const t=()=>{for(const t of o)t.measure(lt.timestamp);rt.preUpdate(n)},n=()=>{for(const t of o)t.notify()},i=()=>rt.read(t);Sh.set(e,i);const s=Ah(e);window.addEventListener("resize",i),e!==document.documentElement&&bh.set(e,Qo(e,i)),s.addEventListener("scroll",i),i()}if(n&&!Eh.has(e)){const t=Sh.get(e),n={width:e.scrollWidth,height:e.scrollHeight};Ph.set(e,n);const i=()=>{const i=e.scrollWidth,o=e.scrollHeight;n.width===i&&n.height===o||(t(),n.width=i,n.height=o)},o=rt.read(i,!0);Eh.set(e,o)}const r=Sh.get(e);return rt.read(r,!1,!0),()=>{at(r);const t=Th.get(e);if(!t)return;if(t.delete(s),t.size)return;const n=Sh.get(e);Sh.delete(e),n&&(Ah(e).removeEventListener("scroll",n),bh.get(e)?.(),window.removeEventListener("resize",n));const i=Eh.get(e);i&&(at(i),Eh.delete(e)),Ph.delete(e)}}const Ch=[[yh.Enter,"entry"],[yh.Exit,"exit"],[yh.Any,"cover"],[yh.All,"contain"]],Vh={start:0,end:1};function kh(t){const e=t.trim().split(/\s+/);if(2!==e.length)return;const n=Vh[e[0]],i=Vh[e[1]];return void 0!==n&&void 0!==i?[n,i]:void 0}function Dh(t,e){const n=function(t){if(2!==t.length)return;const e=[];for(const n of t)if(Array.isArray(n))e.push(n);else{if("string"!=typeof n)return;{const t=kh(n);if(!t)return;e.push(t)}}return e}(t);if(!n)return!1;for(let t=0;t<2;t++){const i=n[t],o=e[t];if(i[0]!==o[0]||i[1]!==o[1])return!1}return!0}function Rh(t){if(!t)return{rangeStart:"contain 0%",rangeEnd:"contain 100%"};for(const[e,n]of Ch)if(Dh(t,e))return{rangeStart:`${n} 0%`,rangeEnd:`${n} 100%`}}const Lh=new Map;function Bh(t){const e={value:0},n=Mh(n=>{e.value=100*n[t.axis].progress},t);return{currentTime:e,cancel:n}}function Oh({source:t,container:e,...n}){const{axis:i}=n;t&&(e=t);let o=Lh.get(e);o||(o=new Map,Lh.set(e,o));const s=n.target??"self";let r=o.get(s);r||(r={},o.set(s,r));const a=i+(n.offset??[]).join(",");if(!r[a])if(n.target&&uh(n.target)){const t=Rh(n.offset);r[a]=t?new ViewTimeline({subject:n.target,axis:i}):Bh({container:e,...n})}else uh()?r[a]=new ScrollTimeline({source:e,axis:i}):r[a]=Bh({container:e,...n});return r[a]}function jh(t,{axis:e="y",container:n=document.scrollingElement,...i}={}){if(!n)return V;const o={axis:e,container:n,...i};return"function"==typeof t?function(t,e){return function(t){return 2===t.length}(t)||function(t){return t&&(t.target||t.offset)}(e)?Mh(n=>{t(n[e.axis].progress,n)},e):ts(t,Oh(e))}(t,o):function(t,e){const n=Oh(e),i=e.target?Rh(e.offset):void 0,o=e.target?uh(e.target)&&!!i:uh();return t.attachTimeline({timeline:o?n:void 0,...i&&o&&{rangeStart:i.rangeStart,rangeEnd:i.rangeEnd},observe:t=>(t.pause(),ts(e=>{t.time=t.iterationDuration*e},n))})}(t,o)}const Ih={some:0,all:1};function Fh(t,e,{root:n,margin:i,amount:o="some"}={}){const s=ro(t),r=new WeakMap,a=new IntersectionObserver(t=>{t.forEach(t=>{const n=r.get(t.target);if(t.isIntersecting!==Boolean(n))if(t.isIntersecting){const n=e(t.target,t);"function"==typeof n?r.set(t.target,n):a.unobserve(t.target)}else"function"==typeof n&&(n(t),r.delete(t.target))})},{root:n,rootMargin:i,threshold:"number"==typeof o?o:Ih[o]});return s.forEach(t=>a.observe(t)),()=>a.disconnect()}const Wh=Bc();function $h(t){return e.useEffect(()=>()=>t(),[])}const Nh={renderer:ac,...jc,...xu},Uh={...Nh,...uu,...wu},zh={renderer:ac,...jc};function Yh(t,n,i){e.useInsertionEffect(()=>t.on(n,i),[t,n,i])}const Hh=()=>({scrollX:ii(0),scrollY:ii(0),scrollXProgress:ii(0),scrollYProgress:ii(0)}),Xh=t=>!!t&&!t.current;function Gh(t,e,n,i){return{factory:o=>{let s;const r=()=>{Xh(n)||Xh(i)?So.read(r):s=jh(o,{...e,axis:t,container:n?.current||void 0,target:i?.current||void 0})};return So.read(r),()=>{bo(r),s?.()}},times:[0,1],keyframes:[0,1],ease:t=>t,duration:1}}function Kh({container:n,target:i,...o}={}){const s=f(Hh);(function(t,e){return"undefined"!=typeof window&&(t?Mn()&&!!Rh(e):An())})(i,o.offset)&&(s.scrollXProgress.accelerate=Gh("x",o,n,i),s.scrollYProgress.accelerate=Gh("y",o,n,i));const r=e.useRef(null),a=e.useRef(!1),l=e.useCallback(()=>(r.current=jh((t,{x:e,y:n})=>{s.scrollX.set(e.current),s.scrollXProgress.set(e.progress),s.scrollY.set(n.current),s.scrollYProgress.set(n.progress)},{...o,container:n?.current||void 0,target:i?.current||void 0}),()=>{r.current?.()}),[n,i,JSON.stringify(o.offset)]);return y(()=>(a.current=!1,Xh(n)||Xh(i)?void(a.current=!0):l()),[l]),e.useEffect(()=>{if(!a.current)return;let e;const o=()=>{const o=Xh(n),s=Xh(i);t.invariant(!o,"Container ref is defined but not hydrated","use-scroll-ref"),t.invariant(!s,"Target ref is defined but not hydrated","use-scroll-ref"),o||s||(e=l())};return So.read(o),()=>{bo(o),e?.()}},[l]),s}function _h(t,n={}){const{isStatic:i}=e.useContext(Fl),o=()=>Mi(t)?t.get():t;if(i)return ku(o);const s=Cu(o());return e.useInsertionEffect(()=>rs(s,t,n),[s,JSON.stringify(n)]),s}function qh(t){const n=e.useRef(0),{isStatic:i}=e.useContext(Fl);e.useEffect(()=>{if(i)return;const e=({timestamp:e,delta:i})=>{n.current||(n.current=e),t(e-n.current,i)};return rt.update(e,!0),()=>at(e)},[t])}class Zh extends ni{constructor(){super(...arguments),this.isEnabled=!1}add(t){(cn.has(t)||Nn.has(t))&&(this.isEnabled=!0,this.update())}update(){this.set(this.isEnabled?"transform":"auto")}}function Jh(){!_s.current&&Zs();const[t]=e.useState(Ks.current);return t}function Qh(){const t=Jh(),{reducedMotion:n}=e.useContext(Fl);return"never"!==n&&("always"===n||t)}function td(t,e){[...e].reverse().forEach(n=>{const i=t.getVariant(n);i&&Ai(t,i),t.variantChildren&&t.variantChildren.forEach(t=>{td(t,e)})})}function ed(){let e=!1;const n=new Set,i={subscribe:t=>(n.add(t),()=>{n.delete(t)}),start(i,o){t.invariant(e,"controls.start() should only be called after a component has mounted. Consider calling within a useEffect hook.");const s=[];return n.forEach(t=>{s.push(Ii(t,i,{transitionOverride:o}))}),Promise.all(s)},set:i=>(t.invariant(e,"controls.set() should only be called after a component has mounted. Consider calling within a useEffect hook."),n.forEach(t=>{!function(t,e){Array.isArray(e)?td(t,e):"string"==typeof e?td(t,[e]):Ai(t,e)}(t,i)})),stop(){n.forEach(t=>{!function(t){t.values.forEach(t=>t.stop())}(t)})},mount:()=>(e=!0,()=>{e=!1,i.stop()})};return i}function nd(){const t=f(ed);return y(t.mount,[]),t}const id=nd;class od{constructor(){this.componentControls=new Set}subscribe(t){return this.componentControls.add(t),()=>this.componentControls.delete(t)}start(t,e){this.componentControls.forEach(n=>{n.start(t.nativeEvent||t,e)})}cancel(){this.componentControls.forEach(t=>{t.cancel()})}stop(){this.componentControls.forEach(t=>{t.stop()})}}const sd=()=>new od;function rd(t){return null!==t&&"object"==typeof t&&Ac in t}function ad(){return ld}function ld(t){Al.current&&(Al.current.isUpdating=!1,Al.current.blockUpdate(),t&&t())}const cd=new Map,ud=new Map,hd=(t,e)=>`${t}: ${cn.has(e)?"transform":e}`;function dd(t,e,n){const i=hd(t,e),o=cd.get(i);if(!o)return null;const{animation:s,startTime:r}=o;function a(){window.MotionCancelOptimisedAnimation?.(t,e,n)}return s.onfinish=a,null===r||window.MotionHandoffIsComplete?.(t)?(a(),null):r}let pd,md;const fd=new Set;function gd(){fd.forEach(t=>{t.animation.play(),t.animation.startTime=t.startTime}),fd.clear()}const yd=()=>({});class vd extends nr{constructor(){super(...arguments),this.measureInstanceViewportBox=Ws}build(){}resetTransform(){}restoreTransform(){}removeValueFromRenderState(){}renderInstance(){}scrapeMotionValuesFromProps(){return{}}getBaseTargetFromProps(){}readValueFromInstance(t,e,n){return n.initialState[e]||0}sortInstanceNodePosition(){return 0}}const xd=Tc({scrapeMotionValuesFromProps:yd,createRenderState:yd});let wd=0;const Sd=t=>t>.001?1/t:1e5;let bd=!1;t.AnimatePresence=({children:t,custom:n,initial:i=!0,onExitComplete:o,presenceAffectsLayout:s=!0,mode:r="sync",propagate:a=!1,anchorX:l="left",anchorY:c="top",root:u})=>{const[p,g]=Hl(a),v=e.useMemo(()=>Gl(t),[t]),x=a&&!p?[]:v.map(Xl),w=e.useRef(!0),S=e.useRef(v),b=f(()=>new Map),T=e.useRef(new Set),[P,E]=e.useState(v),[A,M]=e.useState(v);y(()=>{!a||p||A.length||g?.()},[p,a,A.length,g]),y(()=>{w.current=!1,S.current=v;for(let t=0;t{const e=Xl(t),h=!(a&&!p)&&(v===A||x.includes(e));return d(zl,{isPresent:h,initial:!(w.current&&!i)&&void 0,custom:n,presenceAffectsLayout:s,mode:r,root:u,onExitComplete:h?void 0:()=>{if(T.current.has(e))return;if(!b.has(e))return;T.current.add(e),b.set(e,!0);let t=!0;b.forEach(e=>{e||(t=!1)}),t&&(V?.(),M(S.current),a&&g?.(),o&&o())},anchorX:l,anchorY:c,children:t},e)})})},t.AnimateSharedLayout=({children:e})=>(i.useEffect(()=>{t.invariant(!1,"AnimateSharedLayout is deprecated: https://www.framer.com/docs/guide-upgrade/##shared-layout-animations")},[]),d(Zl,{id:f(()=>"asl-"+wd++),children:e})),t.AsyncMotionValueAnimation=Xn,t.DOMKeyframesResolver=eo,t.DOMVisualElement=ir,t.DeprecatedLayoutGroupContext=Kl,t.DocumentProjectionNode=Tl,t.DragControls=od,t.Feature=or,t.FlatTree=Ua,t.GroupAnimation=Gn,t.GroupAnimationWithThen=_n,t.HTMLProjectionNode=Ml,t.HTMLVisualElement=Ir,t.JSAnimation=Ke,t.KeyframeResolver=Sn,t.LayoutAnimationBuilder=class{constructor(t,e,n){this.scope=t,this.updateDom=e,this.defaultOptions=n,this.sharedTransitions=new Map,this.notifyReady=()=>{},this.rejectReady=()=>{},this.tracked=new Map,this.restorePoints=new Map,this.readyPromise=new Promise((t,e)=>{this.notifyReady=t,this.rejectReady=e}),kl||(kl=[],queueMicrotask(Ol)),kl.push(this)}shared(t,e){return this.sharedTransitions.set(t,e),this}then(t,e){return this.readyPromise.then(t,e)}transitionFor(t){const e=t.getAttribute("data-layout-id");return e&&this.sharedTransitions.get(e)||this.defaultOptions}adopt(t,e){this.tracked.set(t,e),this.restorePoints.set(t,{parent:t.parentElement,next:t.nextSibling})}collectTargets(){return Dl(this.scope)}runUpdate(){try{const t=this.updateDom();if(t&&"function"==typeof t.then)return t.then(void 0,t=>{this.updateError=t})}catch(t){this.updateError=t}}reconcileAdditions(t){for(const e of Dl(this.scope)){if(this.tracked.has(e))continue;const n=Ll(e,this.transitionFor(e));this.adopt(e,n),n.options.layoutId&&t.add(n.options.layoutId)}}reconcileRemovals(t){this.tracked.forEach((e,n)=>{if(n.isConnected)return;const i=this.restorePoints.get(n);this.restorePoints.delete(n);const{layoutId:o}=e.options,s=e.getStack(),r=s&&s.members.some(t=>t!==e&&t.instance?.isConnected);if(o&&e.isLead()&&r&&!t.has(o)&&i&&i.parent.isConnected){if(i.parent.insertBefore(n,i.next&&i.next.parentNode===i.parent?i.next:null),e.isPresent=!1,e.setOptions({onExitComplete:()=>{n.remove(),Bl(n,e)}}),e.relegate())return;n.remove()}Bl(n,e),this.tracked.delete(n)})}getRoot(){let t;return this.tracked.forEach(e=>t||(t=e.root)),t}finalize(){if(this.updateError)return void this.rejectReady(this.updateError);const t=new Set;this.tracked.forEach(e=>{e.instance&&e.currentAnimation&&t.add(e.currentAnimation)}),this.notifyReady(new Gn([...t]))}},t.LayoutGroup=Zl,t.LayoutGroupContext=m,t.LazyMotion=function({children:t,features:n,strict:i=!1}){const[,o]=e.useState(!ic(n)),s=e.useRef(void 0);if(!ic(n)){const{renderer:t,...e}=n;s.current=t,nc(e)}return e.useEffect(()=>{ic(n)&&n().then(({renderer:t,...e})=>{nc(e),s.current=t,o(!0)})},[]),d(Jl.Provider,{value:{renderer:s.current,strict:i},children:t})},t.MotionConfig=function({children:t,...n}){const i=e.useContext(Fl);(n={...i,...n}).transition=oi(n.transition,i.transition),n.isStatic=f(()=>n.isStatic);const o=e.useMemo(()=>n,[JSON.stringify(n.transition),n.transformPagePoint,n.reducedMotion,n.skipAnimations,n.isValidProp]);return d(Fl.Provider,{value:o,children:t})},t.MotionConfigContext=Fl,t.MotionContext=lc,t.MotionGlobalConfig=P,t.MotionValue=ni,t.NativeAnimation=On,t.NativeAnimationExtended=Fn,t.NativeAnimationWrapper=qn,t.NodeStack=Ha,t.ObjectVisualElement=Fr,t.PopChild=Ul,t.PresenceChild=zl,t.PresenceContext=v,t.Reorder=Uu,t.SVGVisualElement=Kr,t.SubscriptionManager=R,t.SwitchLayoutGroupContext=Cc,t.ViewTransitionBuilder=Os,t.VisualElement=nr,t.WillChangeMotionValue=Zh,t.acceleratedValues=Nn,t.addAttrValue=ho,t.addDomEvent=$a,t.addPointerEvent=Wc,t.addPointerInfo=Fc,t.addScaleCorrector=function(t){for(const e in t)Br[e]=t[e],mt(e)&&(Br[e].isCSSVariable=!0)},t.addStyleValue=vo,t.addUniqueItem=x,t.addValueToWillChange=Vi,t.alpha=wt,t.analyseComplexValue=zt,t.animate=ah,t.animateMini=ch,t.animateMotionValue=di,t.animateSingleValue=Wa,t.animateTarget=Oi,t.animateValue=function(t){return new Ke(t)},t.animateVariant=ji,t.animateView=function(t,e={}){return new Os(t,e)},t.animateVisualElement=Ii,t.animationControls=ed,t.animationMapKey=Jn,t.animations=jc,t.anticipate=X,t.applyAxisDelta=fr,t.applyBoxDelta=gr,t.applyGeneratorOptions=Bn,t.applyPointDelta=mr,t.applyPxDefaults=oo,t.applyTreeDeltas=xr,t.arc=function(t={}){const e=function({strength:t=.5,peak:e=.5,direction:n,rotate:i=!1}={}){const o=!0===i?1:"number"==typeof i?i:0;let s;return(i,r)=>{const a=r.x-i.x,l=r.y-i.y;let c;c="cw"===n?-t:"ccw"===n?t:(Math.abs(a)>=Math.abs(l)?a:l)<0?-t:t;let u=fi(i.x,i.y,r.x,r.y,c,e);if(void 0===n){const t=Math.abs(a){const e={x:pi(t,i.x,u.x,r.x),y:pi(t,i.y,u.y,r.y)};if(o){const n=mi(t,i.x,u.x,r.x,i.y,u.y,r.y),s=h+p*t;e.rotate=F(-180,180,n-s)*o}return e}}}(t),n={interpolateProjection(t){const n=t.x.translate,i=t.y.translate;if(!(Math.sqrt(n*n+i*i)<20))return e({x:n,y:i},{x:0,y:0})},animateVisualElement(t,n,i,o,s){if(!("x"in n)&&!("y"in n))return;const r=t.getValue("x",t.latestValues.x??0),a=t.getValue("y",t.latestValues.y??0),l=n.x,c=n.y,u=(Array.isArray(l)&&null!=l[0]?l[0]:r?.get())??0,h=(Array.isArray(c)&&null!=c[0]?c[0]:a?.get())??0,d=Array.isArray(l)?l[l.length-1]:l??u,p=Array.isArray(c)?c[c.length-1]:c??h,m=e({x:u,y:h},{x:d,y:p}),f=void 0!==m(0).rotate?t.getValue("pathRotation",0):void 0,g={delay:o,...si(i||{},"x")};delete g.path;const y=ii(0);y.start(di("",y,[0,1e3],{...g,isSync:!0,velocity:0,onUpdate:t=>{const e=m(t/1e3);r?.set(e.x),a?.set(e.y),f&&void 0!==e.rotate&&f.set(e.rotate)},onComplete:()=>{r?.set(d),a?.set(p),f?.set(0)},onStop:()=>f?.set(0),onCancel:()=>f?.set(0)})),y.animation&&s.push(y.animation),delete n.x,delete n.y}};return n},t.aspectRatio=Ma,t.attachFollow=rs,t.attachSpring=function(t,e,n){return rs(t,e,{type:"spring",...n})},t.attrEffect=po,t.axisDeltaEquals=Ca,t.axisEquals=Ta,t.axisEqualsRounded=Ea,t.backIn=Y,t.backInOut=H,t.backOut=z,t.boxEquals=Pa,t.boxEqualsRounded=Aa,t.buildHTMLStyles=Vr,t.buildProjectionTransform=ka,t.buildSVGAttrs=zr,t.buildSVGPath=Nr,t.buildTransform=Cr,t.calcAxisDelta=ca,t.calcBoxDelta=ua,t.calcChildStagger=ti,t.calcGeneratorDuration=de,t.calcLength=aa,t.calcRelativeAxis=ha,t.calcRelativeAxisPosition=pa,t.calcRelativeBox=da,t.calcRelativePosition=ma,t.camelCaseAttributes=Yr,t.camelToDash=ki,t.cancelFrame=at,t.cancelMicrotask=bo,t.cancelSync=Il,t.checkVariantsDidChange=ea,t.circIn=G,t.circInOut=_,t.circOut=K,t.clamp=b,t.cleanDirtyNodes=nl,t.collectMotionValues=ei,t.color=Ft,t.compareByDepth=Na,t.complex=Xt,t.containsCSSVariable=vt,t.convertBoundingBoxToBox=sr,t.convertBoxToBoundingBox=rr,t.convertOffsetToTimes=We,t.copyAxisDeltaInto=ra,t.copyAxisInto=oa,t.copyBoxInto=sa,t.correctBorderRadius=Rr,t.correctBoxShadow=Lr,t.correctParentTransform=function(t){return e=>{const n=t.current;if(!n)return e;const i=function(t){const{transform:e}=getComputedStyle(t);if(!e||"none"===e)return null;const n=e.match(/^matrix3d\((.*)\)$/u)||e.match(/^matrix\((.*)\)$/u);if(!n)return null;const i=n[1].split(",").map(Number),o=e.startsWith("matrix3d"),s=i[0],r=i[1],a=o?i[4]:i[2],l=o?i[5]:i[3],c=s*l-r*a;return Math.abs(c)<1e-10?null:{a:l/c,b:-r/c,c:-a/c,d:s/c}}(n);if(!i)return e;const o=n.getBoundingClientRect(),s=o.left+window.scrollX+o.width/2,r=o.top+window.scrollY+o.height/2,a=e.x-s,l=e.y-r;return{x:s+i.a*a+i.c*l,y:r+i.b*a+i.d*l}}},t.createAnimationState=ta,t.createAxis=Fs,t.createAxisDelta=js,t.createBox=Ws,t.createDelta=Is,t.createGeneratorEasing=pe,t.createProjectionNode=Ja,t.createRenderBatcher=st,t.createScopedAnimate=rh,t.cubicBezier=$,t.cubicBezierAsString=Vn,t.defaultEasing=$e,t.defaultOffset=Fe,t.defaultTransformValue=on,t.defaultValueTypes=qi,t.degrees=Dt,t.delay=za,t.delayInSeconds=function(t,e){return za(t,L(e))},t.dimensionValueTypes=Wi,t.disableInstantTransitions=function(){P.instantAnimations=!1},t.distance=Nc,t.distance2D=Uc,t.domAnimation=Nh,t.domMax=Uh,t.domMin=zh,t.eachAxis=Va,t.easeIn=q,t.easeInOut=J,t.easeOut=Z,t.easingDefinitionToFunction=it,t.fillOffset=Ie,t.fillWildcards=_e,t.filterProps=wc,t.findDimensionValueType=$i,t.findValueType=hs,t.flushKeyframeResolvers=wn,t.followValue=ss,t.frame=rt,t.frameData=lt,t.frameSteps=ct,t.generateLinearEasing=ue,t.getAnimatableNone=Qi,t.getAnimationMap=Qn,t.getComputedStyle=$o,t.getDefaultTransition=ci,t.getDefaultValueType=Zi,t.getEasingForSegment=tt,t.getFeatureDefinitions=er,t.getFinalKeyframe=ze,t.getMixer=oe,t.getOptimisedAppearId=Li,t.getOriginIndex=is,t.getValueAsType=lo,t.getValueTransition=si,t.getVariableValue=vi,t.getVariantContext=qr,t.getViewAnimationLayerInfo=Ts,t.getViewAnimations=Ps,t.globalProjectionState=Xa,t.has2DTranslate=hr,t.hasReducedMotionListener=_s,t.hasScale=cr,t.hasTransform=ur,t.hasWarned=function(t){return j.has(t)},t.hex=Vt,t.hover=Mo,t.hsla=It,t.hslaToRgba=Kt,t.inView=Fh,t.inertia=Oe,t.initPrefersReducedMotion=Zs,t.interpolate=je,t.invisibleValues=ee,t.isAnimationControls=Ns,t.isBezierDefinition=et,t.isBrowser=g,t.isCSSVariableName=mt,t.isCSSVariableToken=gt,t.isControllingVariants=Hs,t.isDeltaZero=ba,t.isDragActive=Po,t.isDragging=To,t.isEasingArray=Q,t.isElementKeyboardAccessible=Do,t.isElementTextInput=Lo,t.isForcedMotionValue=Or,t.isGenerator=Ln,t.isHTMLElement=fo,t.isKeyframesTarget=Ti,t.isMotionComponent=rd,t.isMotionValue=Mi,t.isNear=la,t.isNodeOrChild=Co,t.isNumericalString=E,t.isObject=A,t.isPrimaryPointer=Vo,t.isSVGElement=No,t.isSVGSVGElement=ns,t.isSVGTag=Hr,t.isTransitionDefined=hi,t.isValidMotionProp=vc,t.isVariantLabel=Us,t.isVariantNode=Xs,t.isWaapiSupportedEasing=function t(e){return Boolean("function"==typeof e&&Cn()||!e||"string"==typeof e&&(e in kn||Cn())||et(e)||Array.isArray(e)&&e.every(t))},t.isWillChangeMotionValue=Ci,t.isZeroValueString=M,t.keyframes=Ne,t.m=Wh,t.makeAnimationInstant=$n,t.makeUseVisualState=Tc,t.mapEasingToNativeEasing=Dn,t.mapValue=function(t,e,n,i){const o=os(e,n,i);return cs(()=>o(t.get()))},t.maxGeneratorDuration=he,t.measurePageBox=Er,t.measureViewportBox=Pr,t.memo=C,t.microtask=So,t.millisecondsToSeconds=B,t.mirrorEasing=N,t.mix=le,t.mixArray=se,t.mixColor=te,t.mixComplex=ae,t.mixImmediate=_t,t.mixLinearColor=Zt,t.mixNumber=qt,t.mixObject=re,t.mixValues=Ba,t.mixVisibility=ne,t.motion=Su,t.motionValue=ii,t.moveItem=S,t.nodeGroup=El,t.noop=V,t.number=xt,t.numberValueTypes=_i,t.observeTimeline=ts,t.optimizedAppearDataAttribute=Ri,t.optimizedAppearDataId=Di,t.parseAnimateLayoutArgs=function(t,e,n){return"function"==typeof t?{scope:document,updateDom:t,defaultOptions:e}:{scope:t instanceof Document?t:ro(t)[0]??document,updateDom:e,defaultOptions:n}},t.parseCSSVariable=yi,t.parseValueFromTransform=sn,t.percent=Rt,t.pipe=k,t.pixelsToPercent=Dr,t.positionalKeys=bi,t.prefersReducedMotion=Ks,t.press=Wo,t.progress=D,t.progressPercentage=jt,t.propEffect=mo,t.propagateDirtyNodes=el,t.px=Lt,t.readTransformValue=rn,t.recordStats=function(){if(es.value)throw es.value=null,es.addProjectionMetrics=null,new Error("Stats are already being measured");const t=es;t.value={layoutProjection:{nodes:[],calculatedTargetDeltas:[],calculatedProjections:[]}},t.addProjectionMetrics=e=>{const{layoutProjection:n}=t.value;n.nodes.push(e.nodes),n.calculatedTargetDeltas.push(e.calculatedTargetDeltas),n.calculatedProjections.push(e.calculatedProjections)}},t.removeAxisDelta=ga,t.removeAxisTransforms=ya,t.removeBoxTransforms=wa,t.removeItem=w,t.removePointDelta=fa,t.renderHTML=kr,t.renderSVG=Xr,t.resize=Qo,t.resolveElements=ro,t.resolveMotionValue=Ya,t.resolveTransition=oi,t.resolveVariant=Si,t.resolveVariantFromProps=wi,t.reverseEasing=U,t.rgbUnit=Mt,t.rgba=Ct,t.rootProjectionNode=Al,t.scale=St,t.scaleCorrectors=Br,t.scalePoint=pr,t.scrapeHTMLMotionValuesFromProps=jr,t.scrapeSVGMotionValuesFromProps=Gr,t.scroll=jh,t.scrollInfo=Mh,t.secondsToMilliseconds=L,t.setDragLock=Eo,t.setFeatureDefinitions=tr,t.setStyle=Tn,t.setTarget=Ai,t.spring=Le,t.springValue=function(t,e){return ss(t,{type:"spring",...e})},t.stagger=function(t=.1,{startDelay:e=0,from:n=0,ease:i}={}){return(o,s)=>{const r="number"==typeof n?n:is(n,s),a=Math.abs(r-o);let l=t*a;if(i){const e=s*t;l=it(i)(l/e)*e}return e+l}},t.startOptimizedAppearAnimation=function(t,e,n,i,o){if(window.MotionIsMounted)return;const s=t.dataset[Di];if(!s)return;window.MotionHandoffAnimation=dd;const r=hd(s,e);md||(md=Rn(t,e,[n[0],n[0]],{duration:1e4,ease:"linear"}),cd.set(r,{animation:md,startTime:null}),window.MotionHandoffAnimation=dd,window.MotionHasOptimisedAnimation=(t,e)=>{if(!t)return!1;if(!e)return ud.has(t);const n=hd(t,e);return Boolean(cd.get(n))},window.MotionHandoffMarkAsComplete=t=>{ud.has(t)&&ud.set(t,!0)},window.MotionHandoffIsComplete=t=>!0===ud.get(t),window.MotionCancelOptimisedAnimation=(t,e,n,i)=>{const o=hd(t,e),s=cd.get(o);s&&(n&&void 0===i?n.postRender(()=>{n.postRender(()=>{s.animation.cancel()})}):s.animation.cancel(),n&&i?(fd.add(s),n.render(gd)):(cd.delete(o),cd.size||(window.MotionCancelOptimisedAnimation=void 0)))},window.MotionCheckAppearSync=(t,e,n)=>{const i=Li(t);if(!i)return;const o=window.MotionHasOptimisedAnimation?.(i,e),s=t.props.values?.[e];if(!o||!s)return;const r=n.on("change",t=>{s.get()!==t&&(window.MotionCancelOptimisedAnimation?.(i,e),r())});return r});const a=()=>{md.cancel();const s=Rn(t,e,n,i);void 0===pd&&(pd=performance.now()),s.startTime=pd,cd.set(r,{animation:s,startTime:pd}),o&&o(s)};ud.set(s,!1),md.ready?md.ready.then(a).catch(V):a()},t.startWaapiAnimation=Rn,t.statsBuffer=es,t.steps=function(t,e="end"){return n=>{const i=(n="end"===e?Math.min(n,.999):Math.max(n,.001))*t,o="end"===e?Math.floor(i):Math.ceil(i);return b(0,1,o/t)}},t.styleEffect=xo,t.supportedWaapiEasing=kn,t.supportsBrowserAnimation=Hn,t.supportsFlags=Pn,t.supportsLinearEasing=Cn,t.supportsPartialKeyframes=so,t.supportsScrollTimeline=An,t.supportsViewTimeline=Mn,t.svgEffect=wo,t.sync=jl,t.testValueType=Fi,t.time=dt,t.transform=os,t.transformAxis=Sr,t.transformBox=Tr,t.transformBoxPoints=ar,t.transformPropOrder=ln,t.transformProps=cn,t.transformValue=cs,t.transformValueTypes=Ki,t.transformViewBoxPoint=function(t){return e=>{const n=t.current;if(!n)return e;const i=n.viewBox?.baseVal;if(!i||0===i.width&&0===i.height)return e;const o=n.getBoundingClientRect();if(0===o.width||0===o.height)return e;const s=i.width/o.width,r=i.height/o.height,a=o.left+window.scrollX,l=o.top+window.scrollY;return{x:(e.x-a)*s+a,y:(e.y-l)*r+l}}},t.translateAxis=wr,t.unwrapMotionComponent=function(t){if(rd(t))return t[Ac]},t.updateMotionValuesFromProps=Gs,t.useAnimate=function(){const t=f(()=>({current:null,animations:[]})),n=Qh()??void 0,{skipAnimations:i}=e.useContext(Fl),o=e.useMemo(()=>rh({scope:t,reduceMotion:n,skipAnimations:i}),[t,n,i]);return $h(()=>{t.animations.forEach(t=>t.stop()),t.animations.length=0}),[t,o]},t.useAnimateMini=function(){const t=f(()=>({current:null,animations:[]})),e=f(()=>lh(t));return $h(()=>{t.animations.forEach(t=>t.stop())}),[t,e]},t.useAnimation=id,t.useAnimationControls=nd,t.useAnimationFrame=qh,t.useComposedRefs=$l,t.useCycle=function(...t){const n=e.useRef(0),[i,o]=e.useState(t[n.current]),s=e.useCallback(e=>{n.current="number"!=typeof e?F(0,t.length,n.current+1):e,o(t[n.current])},[t.length,...t]);return[i,s]},t.useDeprecatedAnimatedState=function(t){const[n,i]=e.useState(t),o=xd({},!1),s=f(()=>new vd({props:{onUpdate:t=>{i({...t})}},visualState:o,presenceContext:null},{initialState:t}));return e.useLayoutEffect(()=>(s.mount({}),()=>s.unmount()),[s]),[n,f(()=>t=>Ii(s,t))]},t.useDeprecatedInvertedScale=function(n){let i=Cu(1),o=Cu(1);const{visualElement:s}=e.useContext(lc);return t.invariant(!(!n&&!s),"If no scale values are provided, useInvertedScale must be used within a child of another motion component."),t.warning(bd,"useInvertedScale is deprecated and will be removed in 3.0. Use the layout prop instead."),bd=!0,n?(i=n.scaleX||i,o=n.scaleY||o):s&&(i=s.getValue("scaleX",1),o=s.getValue("scaleY",1)),{scaleX:ku(i,Sd),scaleY:ku(o,Sd)}},t.useDomEvent=function(t,n,i,o){e.useEffect(()=>{const e=t.current;if(i&&e)return $a(e,n,i,o)},[t,n,i,o])},t.useDragControls=function(){return f(sd)},t.useElementScroll=function(t){return Kh({container:t})},t.useFollowValue=_h,t.useForceUpdate=_l,t.useInView=function(t,{root:n,margin:i,amount:o,once:s=!1,initial:r=!1}={}){const[a,l]=e.useState(r);return e.useEffect(()=>{if(!t.current||s&&a)return;const e={root:n&&n.current||void 0,margin:i,amount:o};return Fh(t.current,()=>(l(!0),s?void 0:()=>l(!1)),e)},[n,t,i,s,o]),a},t.useInstantLayoutTransition=ad,t.useInstantTransition=function(){const[t,n]=_l(),i=ad(),o=e.useRef(-1);return e.useEffect(()=>{rt.postRender(()=>rt.postRender(()=>{n===o.current&&(P.instantAnimations=!1)}))},[n]),e=>{i(()=>{P.instantAnimations=!0,t(),e(),o.current=n+1})}},t.useIsPresent=function(){return null===(t=e.useContext(v))||t.isPresent;var t},t.useIsomorphicLayoutEffect=y,t.useMotionTemplate=function(t,...e){const n=t.length;return Vu(e.filter(Mi),function(){let i="";for(let o=0;o{const t=()=>n(!document.hidden);return document.hidden&&t(),document.addEventListener("visibilitychange",t),()=>{document.removeEventListener("visibilitychange",t)}},[]),t},t.usePresence=Hl,t.usePresenceData=function(){const t=e.useContext(v);return t?t.custom:void 0},t.useReducedMotion=Jh,t.useReducedMotionConfig=Qh,t.useResetProjection=function(){return e.useCallback(()=>{const t=Al.current;t&&t.resetTree()},[])},t.useScroll=Kh,t.useSpring=function(t,e={}){return _h(t,{type:"spring",...e})},t.useTime=function(){const t=Cu(0);return qh(e=>t.set(e)),t},t.useTransform=ku,t.useUnmountEffect=$h,t.useVelocity=function(t){const e=Cu(t.getVelocity()),n=()=>{const i=t.getVelocity();e.set(i),i&&rt.update(n)};return Yh(t,"change",()=>{rt.update(n,!1,!0)}),e},t.useViewportScroll=function(){return Kh()},t.useWillChange=function(){return f(()=>new Zh("auto"))},t.variantPriorityOrder=zs,t.variantProps=Ys,t.velocityPerSecond=O,t.vh=Bt,t.visualElementStore=$s,t.vw=Ot,t.warnOnce=I,t.wrap=F}); diff --git a/node_modules/framer-motion/dist/index.d.ts b/node_modules/framer-motion/dist/index.d.ts new file mode 100644 index 0000000..be769c6 --- /dev/null +++ b/node_modules/framer-motion/dist/index.d.ts @@ -0,0 +1,1740 @@ +/// +import * as motion_dom from 'motion-dom'; +import { AnyResolvedKeyframe, OnKeyframesResolved, KeyframeResolver, MotionNodeOptions, MotionValue, TransformProperties, SVGPathProperties, Transition, PresenceContextProps, ResolvedValues, VisualElement, Feature, UnresolvedValueKeyframe, AnimationOptions, ElementOrSelector, DOMKeyframesDefinition, AnimationPlaybackOptions, AnimationPlaybackControlsWithThen, ValueAnimationTransition, AnimationScope, AnimationPlaybackControls, EventInfo, MotionValueEventCallbacks, FollowValueOptions, SpringOptions, TransformOptions, WillChange, LegacyAnimationControls, NodeGroup, IProjectionNode } from 'motion-dom'; +export * from 'motion-dom'; +export { ArcOptions, DelayedFunction, FlatTree, FollowValueOptions, IProjectionNode, MotionPath, ResolvedValues, VisualElement, addScaleCorrector, animateVisualElement, arc, buildTransform, calcLength, createBox, delay, optimizedAppearDataAttribute, resolveMotionValue, visualElementStore } from 'motion-dom'; +import * as react_jsx_runtime from 'react/jsx-runtime'; +import * as React$1 from 'react'; +import { CSSProperties, PropsWithoutRef, RefAttributes, JSX, SVGAttributes, useEffect, RefObject } from 'react'; +import { TransformPoint, Easing, EasingFunction, Point } from 'motion-utils'; +export * from 'motion-utils'; +export { MotionGlobalConfig } from 'motion-utils'; + +type ResolveKeyframes = (keyframes: V[], onComplete: OnKeyframesResolved, name?: string, motionValue?: any) => KeyframeResolver; + +/** + * @public + */ +interface AnimatePresenceProps { + /** + * By passing `initial={false}`, `AnimatePresence` will disable any initial animations on children + * that are present when the component is first rendered. + * + * ```jsx + * + * {isVisible && ( + * + * )} + * + * ``` + * + * @public + */ + initial?: boolean; + /** + * When a component is removed, there's no longer a chance to update its props. So if a component's `exit` + * prop is defined as a dynamic variant and you want to pass a new `custom` prop, you can do so via `AnimatePresence`. + * This will ensure all leaving components animate using the latest data. + * + * @public + */ + custom?: any; + /** + * Fires when all exiting nodes have completed animating out. + * + * @public + */ + onExitComplete?: () => void; + /** + * Determines how to handle entering and exiting elements. + * + * - `"sync"`: Default. Elements animate in and out as soon as they're added/removed. + * - `"popLayout"`: Exiting elements are "popped" from the page layout, allowing sibling + * elements to immediately occupy their new layouts. + * - `"wait"`: Only renders one component at a time. Wait for the exiting component to animate out + * before animating the next component in. + * + * @public + */ + mode?: "sync" | "popLayout" | "wait"; + /** + * Root element to use when injecting styles, used when mode === `"popLayout"`. + * This defaults to document.head but can be overridden e.g. for use in shadow DOM. + */ + root?: HTMLElement | ShadowRoot; + /** + * Internal. Used in Framer to flag that sibling children *shouldn't* re-render as a result of a + * child being removed. + */ + presenceAffectsLayout?: boolean; + /** + * If true, the `AnimatePresence` component will propagate parent exit animations + * to its children. + */ + propagate?: boolean; + /** + * Internal. Set whether to anchor the x position of the exiting element to the left or right + * when using `mode="popLayout"`. + */ + anchorX?: "left" | "right"; + /** + * Internal. Set whether to anchor the y position of the exiting element to the top or bottom + * when using `mode="popLayout"`. Use `"bottom"` for elements originally positioned with + * `bottom: 0` to prevent them from shifting during exit animations. + */ + anchorY?: "top" | "bottom"; +} + +/** + * `AnimatePresence` enables the animation of components that have been removed from the tree. + * + * When adding/removing more than a single child, every child **must** be given a unique `key` prop. + * + * Any `motion` components that have an `exit` property defined will animate out when removed from + * the tree. + * + * ```jsx + * import { motion, AnimatePresence } from 'framer-motion' + * + * export const Items = ({ items }) => ( + * + * {items.map(item => ( + * + * ))} + * + * ) + * ``` + * + * You can sequence exit animations throughout a tree using variants. + * + * If a child contains multiple `motion` components with `exit` props, it will only unmount the child + * once all `motion` components have finished animating out. Likewise, any components using + * `usePresence` all need to call `safeToRemove`. + * + * @public + */ +declare const AnimatePresence: ({ children, custom, initial, onExitComplete, presenceAffectsLayout, mode, propagate, anchorX, anchorY, root }: React$1.PropsWithChildren) => react_jsx_runtime.JSX.Element | null; + +interface Props$3 { + children: React$1.ReactElement; + isPresent: boolean; + anchorX?: "left" | "right"; + anchorY?: "top" | "bottom"; + root?: HTMLElement | ShadowRoot; + pop?: boolean; +} +declare function PopChild({ children, isPresent, anchorX, anchorY, root, pop }: Props$3): react_jsx_runtime.JSX.Element; + +/** + * Either a string, or array of strings, that reference variants defined via the `variants` prop. + * @public + */ +type VariantLabels = string | string[]; + +type MotionValueString = MotionValue; +type MotionValueNumber = MotionValue; +type MotionValueAny = MotionValue; +type AnyMotionValue = MotionValueNumber | MotionValueString | MotionValueAny; +type MotionValueHelper = T | AnyMotionValue; +type MakeMotionHelper = { + [K in keyof T]: MotionValueHelper; +}; +type MakeCustomValueTypeHelper = MakeMotionHelper; +type MakeMotion = MakeCustomValueTypeHelper; +type MotionCSS = MakeMotion>; +/** + * @public + */ +type MotionTransform = MakeMotion; +type MotionSVGProps = MakeMotion; +/** + * @public + */ +interface MotionStyle extends MotionCSS, MotionTransform, MotionSVGProps { +} +/** + * Props for `motion` components. + * + * @public + */ +interface MotionProps extends MotionNodeOptions { + /** + * + * The React DOM `style` prop, enhanced with support for `MotionValue`s and separate `transform` values. + * + * ```jsx + * export const MyComponent = () => { + * const x = useMotionValue(0) + * + * return + * } + * ``` + */ + style?: MotionStyle; + children?: React.ReactNode | MotionValueNumber | MotionValueString; +} + +interface PresenceChildProps { + children: React$1.ReactElement; + isPresent: boolean; + onExitComplete?: () => void; + initial?: false | VariantLabels; + custom?: any; + presenceAffectsLayout: boolean; + mode: "sync" | "popLayout" | "wait"; + anchorX?: "left" | "right"; + anchorY?: "top" | "bottom"; + root?: HTMLElement | ShadowRoot; +} +declare const PresenceChild: ({ children, initial, isPresent, onExitComplete, custom, presenceAffectsLayout, mode, anchorX, anchorY, root }: PresenceChildProps) => react_jsx_runtime.JSX.Element; + +type InheritOption = boolean | "id"; +interface Props$2 { + id?: string; + inherit?: InheritOption; +} +declare const LayoutGroup: React$1.FunctionComponent>; + +type ReducedMotionConfig = "always" | "never" | "user"; +type IsValidProp = (key: string) => boolean; +/** + * @public + */ +interface MotionConfigContext { + /** + * Internal, exported only for usage in Framer + */ + transformPagePoint: TransformPoint; + /** + * Internal. Determines whether this is a static context ie the Framer canvas. If so, + * it'll disable all dynamic functionality. + */ + isStatic: boolean; + /** + * Defines a new default transition for the entire tree. + * + * @public + */ + transition?: Transition; + /** + * If true, will respect the device prefersReducedMotion setting by switching + * transform animations off. + * + * @public + */ + reducedMotion?: ReducedMotionConfig; + /** + * A custom `nonce` attribute used when wanting to enforce a Content Security Policy (CSP). + * For more details see: + * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/style-src#unsafe_inline_styles + * + * @public + */ + nonce?: string; + /** + * If true, all animations will be skipped and values will be set instantly. + * Useful for E2E tests and visual regression testing. + * + * @public + */ + skipAnimations?: boolean; + /** + * Determines whether a prop should be forwarded to the DOM. + * Useful when wrapping Motion components with a styling library. + * + * @public + */ + isValidProp?: IsValidProp; +} +/** + * @public + */ +declare const MotionConfigContext: React$1.Context; + +/** + * @public + */ +declare const PresenceContext: React$1.Context; + +interface VisualState { + renderState: RenderState; + latestValues: ResolvedValues; + onMount?: (instance: Instance) => void; +} +type UseVisualState = (props: MotionProps, isStatic: boolean) => VisualState; +interface UseVisualStateConfig { + scrapeMotionValuesFromProps: ScrapeMotionValuesFromProps; + createRenderState: () => RenderState; +} +declare const makeUseVisualState: (config: UseVisualStateConfig) => UseVisualState; + +interface HTMLElements { + a: HTMLAnchorElement; + abbr: HTMLElement; + address: HTMLElement; + area: HTMLAreaElement; + article: HTMLElement; + aside: HTMLElement; + audio: HTMLAudioElement; + b: HTMLElement; + base: HTMLBaseElement; + bdi: HTMLElement; + bdo: HTMLElement; + big: HTMLElement; + blockquote: HTMLQuoteElement; + body: HTMLBodyElement; + br: HTMLBRElement; + button: HTMLButtonElement; + canvas: HTMLCanvasElement; + caption: HTMLElement; + center: HTMLElement; + cite: HTMLElement; + code: HTMLElement; + col: HTMLTableColElement; + colgroup: HTMLTableColElement; + data: HTMLDataElement; + datalist: HTMLDataListElement; + dd: HTMLElement; + del: HTMLModElement; + details: HTMLDetailsElement; + dfn: HTMLElement; + dialog: HTMLDialogElement; + div: HTMLDivElement; + dl: HTMLDListElement; + dt: HTMLElement; + em: HTMLElement; + embed: HTMLEmbedElement; + fieldset: HTMLFieldSetElement; + figcaption: HTMLElement; + figure: HTMLElement; + footer: HTMLElement; + form: HTMLFormElement; + h1: HTMLHeadingElement; + h2: HTMLHeadingElement; + h3: HTMLHeadingElement; + h4: HTMLHeadingElement; + h5: HTMLHeadingElement; + h6: HTMLHeadingElement; + head: HTMLHeadElement; + header: HTMLElement; + hgroup: HTMLElement; + hr: HTMLHRElement; + html: HTMLHtmlElement; + i: HTMLElement; + iframe: HTMLIFrameElement; + img: HTMLImageElement; + input: HTMLInputElement; + ins: HTMLModElement; + kbd: HTMLElement; + keygen: HTMLElement; + label: HTMLLabelElement; + legend: HTMLLegendElement; + li: HTMLLIElement; + link: HTMLLinkElement; + main: HTMLElement; + map: HTMLMapElement; + mark: HTMLElement; + menu: HTMLElement; + menuitem: HTMLElement; + meta: HTMLMetaElement; + meter: HTMLMeterElement; + nav: HTMLElement; + noindex: HTMLElement; + noscript: HTMLElement; + object: HTMLObjectElement; + ol: HTMLOListElement; + optgroup: HTMLOptGroupElement; + option: HTMLOptionElement; + output: HTMLOutputElement; + p: HTMLParagraphElement; + param: HTMLParamElement; + picture: HTMLElement; + pre: HTMLPreElement; + progress: HTMLProgressElement; + q: HTMLQuoteElement; + rp: HTMLElement; + rt: HTMLElement; + ruby: HTMLElement; + s: HTMLElement; + samp: HTMLElement; + search: HTMLElement; + slot: HTMLSlotElement; + script: HTMLScriptElement; + section: HTMLElement; + select: HTMLSelectElement; + small: HTMLElement; + source: HTMLSourceElement; + span: HTMLSpanElement; + strong: HTMLElement; + style: HTMLStyleElement; + sub: HTMLElement; + summary: HTMLElement; + sup: HTMLElement; + table: HTMLTableElement; + template: HTMLTemplateElement; + tbody: HTMLTableSectionElement; + td: HTMLTableDataCellElement; + textarea: HTMLTextAreaElement; + tfoot: HTMLTableSectionElement; + th: HTMLTableHeaderCellElement; + thead: HTMLTableSectionElement; + time: HTMLTimeElement; + title: HTMLTitleElement; + tr: HTMLTableRowElement; + track: HTMLTrackElement; + u: HTMLElement; + ul: HTMLUListElement; + var: HTMLElement; + video: HTMLVideoElement; + wbr: HTMLElement; + webview: HTMLWebViewElement; +} + +/** + * @public + */ +type ForwardRefComponent = { + readonly $$typeof: symbol; +} & ((props: PropsWithoutRef

& RefAttributes) => JSX.Element); +type AttributesWithoutMotionProps = { + [K in Exclude]?: Attributes[K]; +}; +/** + * @public + */ +type HTMLMotionProps = AttributesWithoutMotionProps & MotionProps; +/** + * Motion-optimised versions of React's HTML components. + * + * @public + */ +type HTMLMotionComponents = { + [K in keyof HTMLElements]: ForwardRefComponent>; +}; + +type UnionStringArray> = T[number]; +declare const svgElements: readonly ["animate", "circle", "defs", "desc", "ellipse", "g", "image", "line", "filter", "marker", "mask", "metadata", "path", "pattern", "polygon", "polyline", "rect", "stop", "svg", "switch", "symbol", "text", "tspan", "use", "view", "clipPath", "feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence", "foreignObject", "linearGradient", "radialGradient", "textPath"]; +type SVGElements = UnionStringArray; + +interface SVGAttributesWithoutMotionProps extends Pick, Exclude, keyof MotionProps>> { +} +/** + * Blanket-accept any SVG attribute as a `MotionValue` + * @public + */ +type SVGAttributesAsMotionValues = MakeMotion>; +type UnwrapSVGFactoryElement = F extends React.SVGProps ? P : never; +/** + * @public + */ +interface SVGMotionProps extends SVGAttributesAsMotionValues, MotionProps { +} +/** + * Motion-optimised versions of React's SVG components. + * + * @public + */ +type SVGMotionComponents = { + [K in SVGElements]: ForwardRefComponent, SVGMotionProps>>; +}; + +type DOMMotionComponents = HTMLMotionComponents & SVGMotionComponents; + +type ScrapeMotionValuesFromProps = (props: MotionProps, prevProps: MotionProps, visualElement?: VisualElement) => { + [key: string]: MotionValue | AnyResolvedKeyframe; +}; +interface VisualElementOptions { + visualState: VisualState; + parent?: VisualElement; + variantParent?: VisualElement; + presenceContext: PresenceContextProps | null; + props: MotionProps; + blockInitialAnimation?: boolean; + reducedMotionConfig?: ReducedMotionConfig; + /** + * If true, all animations will be skipped and values will be set instantly. + * Useful for E2E tests and visual regression testing. + */ + skipAnimations?: boolean; + /** + * Explicit override for SVG detection. When true, uses SVG rendering; + * when false, uses HTML rendering. If undefined, auto-detects. + */ + isSVG?: boolean; +} + +type CreateVisualElement = (Component: TagName | string | React.ComponentType, options: VisualElementOptions) => VisualElement; + +declare function MeasureLayout(props: MotionProps & { + visualElement: VisualElement; +}): react_jsx_runtime.JSX.Element; + +interface FeatureClass { + new (props: Props): Feature; +} +interface HydratedFeatureDefinition { + isEnabled: (props: MotionProps) => boolean; + Feature: FeatureClass; + ProjectionNode?: any; + MeasureLayout?: typeof MeasureLayout; +} +interface HydratedFeatureDefinitions { + animation?: HydratedFeatureDefinition; + exit?: HydratedFeatureDefinition; + drag?: HydratedFeatureDefinition; + tap?: HydratedFeatureDefinition; + focus?: HydratedFeatureDefinition; + hover?: HydratedFeatureDefinition; + pan?: HydratedFeatureDefinition; + inView?: HydratedFeatureDefinition; + layout?: HydratedFeatureDefinition; +} +interface FeatureDefinition { + isEnabled: HydratedFeatureDefinition["isEnabled"]; + Feature?: HydratedFeatureDefinition["Feature"]; + ProjectionNode?: HydratedFeatureDefinition["ProjectionNode"]; + MeasureLayout?: HydratedFeatureDefinition["MeasureLayout"]; +} +type FeatureDefinitions = { + [K in keyof HydratedFeatureDefinitions]: FeatureDefinition; +}; +interface FeaturePackage { + Feature?: HydratedFeatureDefinition["Feature"]; + ProjectionNode?: HydratedFeatureDefinition["ProjectionNode"]; + MeasureLayout?: HydratedFeatureDefinition["MeasureLayout"]; +} +type FeaturePackages = { + [K in keyof HydratedFeatureDefinitions]: FeaturePackage; +}; +interface FeatureBundle extends FeaturePackages { + renderer: CreateVisualElement; +} +type LazyFeatureBundle$1 = () => Promise; + +type LazyFeatureBundle = () => Promise; +/** + * @public + */ +interface LazyProps { + children?: React.ReactNode; + /** + * Can be used to provide a feature bundle synchronously or asynchronously. + * + * ```jsx + * // features.js + * import { domAnimation } from "framer-motion" + * export default domAnimation + * + * // index.js + * import { LazyMotion, m } from "framer-motion" + * + * const loadFeatures = () =>import("./features.js") + * .then(res => res.default) + * + * function Component() { + * return ( + * + * + * + * ) + * } + * ``` + * + * @public + */ + features: FeatureBundle | LazyFeatureBundle; + /** + * If `true`, will throw an error if a `motion` component renders within + * a `LazyMotion` component. + * + * ```jsx + * // This component will throw an error that explains using a motion component + * // instead of the m component will break the benefits of code-splitting. + * function Component() { + * return ( + * + * + * + * ) + * } + * ``` + * + * @public + */ + strict?: boolean; +} + +/** + * Used in conjunction with the `m` component to reduce bundle size. + * + * `m` is a version of the `motion` component that only loads functionality + * critical for the initial render. + * + * `LazyMotion` can then be used to either synchronously or asynchronously + * load animation and gesture support. + * + * ```jsx + * // Synchronous loading + * import { LazyMotion, m, domAnimation } from "framer-motion" + * + * function App() { + * return ( + * + * + * + * ) + * } + * + * // Asynchronous loading + * import { LazyMotion, m } from "framer-motion" + * + * function App() { + * return ( + * import('./path/to/domAnimation')}> + * + * + * ) + * } + * ``` + * + * @public + */ +declare function LazyMotion({ children, features, strict }: LazyProps): react_jsx_runtime.JSX.Element; + +interface MotionConfigProps extends Partial { + children?: React$1.ReactNode; +} +/** + * `MotionConfig` is used to set configuration options for all children `motion` components. + * + * ```jsx + * import { motion, MotionConfig } from "framer-motion" + * + * export function App() { + * return ( + * + * + * + * ) + * } + * ``` + * + * @public + */ +declare function MotionConfig({ children, ...config }: MotionConfigProps): react_jsx_runtime.JSX.Element; + +/** + * Lifecycle callbacks are not supported on individual sequence segments + * because segments are consolidated into a single animation per subject. + * Use sequence-level options (e.g. SequenceOptions.onComplete) instead. + */ +type LifecycleCallbacks = "onUpdate" | "onPlay" | "onComplete" | "onRepeat" | "onStop"; +/** + * Distributive Omit preserves union branches (unlike plain Omit). + */ +type DistributiveOmit = T extends any ? Omit : never; +type SegmentTransitionOptions = DistributiveOmit & At; +type SegmentValueTransitionOptions = DistributiveOmit & At; +type ObjectTarget = { + [K in keyof O]?: O[K] | UnresolvedValueKeyframe[]; +}; +type SequenceTime = number | "<" | `+${number}` | `-${number}` | `${string}`; +type SequenceLabel = string; +interface SequenceLabelWithTime { + name: SequenceLabel; + at: SequenceTime; +} +interface At { + at?: SequenceTime; +} +type MotionValueSegment = [ + MotionValue, + UnresolvedValueKeyframe | UnresolvedValueKeyframe[] +]; +type MotionValueSegmentWithTransition = [ + MotionValue, + UnresolvedValueKeyframe | UnresolvedValueKeyframe[], + SegmentValueTransitionOptions +]; +type DOMSegment = [ElementOrSelector, DOMKeyframesDefinition]; +type DOMSegmentWithTransition = [ + ElementOrSelector, + DOMKeyframesDefinition, + SegmentTransitionOptions +]; +type ObjectSegment = [O, ObjectTarget]; +type ObjectSegmentWithTransition = [ + O, + ObjectTarget, + SegmentTransitionOptions +]; +type SequenceProgressCallback = (value: any) => void; +type FunctionSegment = [SequenceProgressCallback] | [SequenceProgressCallback, SegmentTransitionOptions] | [ + SequenceProgressCallback, + UnresolvedValueKeyframe | UnresolvedValueKeyframe[], + SegmentTransitionOptions +]; +type Segment = ObjectSegment | ObjectSegmentWithTransition | SequenceLabel | SequenceLabelWithTime | MotionValueSegment | MotionValueSegmentWithTransition | DOMSegment | DOMSegmentWithTransition | FunctionSegment; +type AnimationSequence = Segment[]; +interface SequenceOptions extends AnimationPlaybackOptions { + delay?: number; + duration?: number; + defaultTransition?: Transition; + reduceMotion?: boolean; + skipAnimations?: boolean; + onComplete?: () => void; +} +interface AbsoluteKeyframe { + value: AnyResolvedKeyframe | null; + at: number; + easing?: Easing; +} +type ValueSequence = AbsoluteKeyframe[]; +interface SequenceMap { + [key: string]: ValueSequence; +} +type ResolvedAnimationDefinition = { + keyframes: { + [key: string]: UnresolvedValueKeyframe[]; + }; + transition: { + [key: string]: Transition; + }; +}; +type ResolvedAnimationDefinitions = Map; + +interface ScopedAnimateOptions { + scope?: AnimationScope; + reduceMotion?: boolean; + skipAnimations?: boolean; +} +/** + * Creates an animation function that is optionally scoped + * to a specific element. + */ +declare function createScopedAnimate(options?: ScopedAnimateOptions): { + (sequence: AnimationSequence, options?: SequenceOptions): AnimationPlaybackControlsWithThen; + (value: string | MotionValue, keyframes: string | UnresolvedValueKeyframe[], options?: ValueAnimationTransition): AnimationPlaybackControlsWithThen; + (value: number | MotionValue, keyframes: number | UnresolvedValueKeyframe[], options?: ValueAnimationTransition): AnimationPlaybackControlsWithThen; + (value: V | MotionValue, keyframes: V | UnresolvedValueKeyframe[], options?: ValueAnimationTransition): AnimationPlaybackControlsWithThen; + (element: ElementOrSelector, keyframes: DOMKeyframesDefinition, options?: AnimationOptions): AnimationPlaybackControlsWithThen; + (object: O | O[], keyframes: ObjectTarget, options?: AnimationOptions): AnimationPlaybackControlsWithThen; +}; +declare const animate: { + (sequence: AnimationSequence, options?: SequenceOptions): AnimationPlaybackControlsWithThen; + (value: string | MotionValue, keyframes: string | UnresolvedValueKeyframe[], options?: ValueAnimationTransition): AnimationPlaybackControlsWithThen; + (value: number | MotionValue, keyframes: number | UnresolvedValueKeyframe[], options?: ValueAnimationTransition): AnimationPlaybackControlsWithThen; + (value: V | MotionValue, keyframes: V | UnresolvedValueKeyframe[], options?: ValueAnimationTransition): AnimationPlaybackControlsWithThen; + (element: ElementOrSelector, keyframes: DOMKeyframesDefinition, options?: AnimationOptions): AnimationPlaybackControlsWithThen; + (object: O | O[], keyframes: ObjectTarget, options?: AnimationOptions): AnimationPlaybackControlsWithThen; +}; + +declare const animateMini: (elementOrSelector: ElementOrSelector, keyframes: DOMKeyframesDefinition, options?: AnimationOptions) => AnimationPlaybackControlsWithThen; + +interface ScrollOptions { + source?: HTMLElement; + container?: Element; + target?: Element; + axis?: "x" | "y"; + offset?: ScrollOffset; +} +type OnScrollProgress = (progress: number) => void; +type OnScrollWithInfo = (progress: number, info: ScrollInfo) => void; +type OnScroll = OnScrollProgress | OnScrollWithInfo; +interface AxisScrollInfo { + current: number; + offset: number[]; + progress: number; + scrollLength: number; + velocity: number; + targetOffset: number; + targetLength: number; + containerLength: number; + interpolatorOffsets?: number[]; + interpolate?: EasingFunction; +} +interface ScrollInfo { + time: number; + x: AxisScrollInfo; + y: AxisScrollInfo; +} +type OnScrollInfo = (info: ScrollInfo) => void; +type SupportedEdgeUnit = "px" | "vw" | "vh" | "%"; +type EdgeUnit = `${number}${SupportedEdgeUnit}`; +type NamedEdges = "start" | "end" | "center"; +type EdgeString = NamedEdges | EdgeUnit | `${number}`; +type Edge = EdgeString | number; +type ProgressIntersection = [number, number]; +type Intersection = `${Edge} ${Edge}`; +type ScrollOffset = Array; +interface ScrollInfoOptions { + container?: Element; + target?: Element; + axis?: "x" | "y"; + offset?: ScrollOffset; + /** + * When true, enables per-frame checking of scrollWidth/scrollHeight + * to detect content size changes and recalculate scroll progress. + * + * @default false + */ + trackContentSize?: boolean; +} + +declare function scroll(onScroll: OnScroll | AnimationPlaybackControls, { axis, container, ...options }?: ScrollOptions): VoidFunction; + +declare function scrollInfo(onScroll: OnScrollInfo, { container, trackContentSize, ...options }?: ScrollInfoOptions): VoidFunction; + +type ViewChangeHandler = (entry: IntersectionObserverEntry) => void; +type MarginValue = `${number}${"px" | "%"}`; +type MarginType = MarginValue | `${MarginValue} ${MarginValue}` | `${MarginValue} ${MarginValue} ${MarginValue}` | `${MarginValue} ${MarginValue} ${MarginValue} ${MarginValue}`; +interface InViewOptions { + root?: Element | Document; + margin?: MarginType; + amount?: "some" | "all" | number; +} +declare function inView(elementOrSelector: ElementOrSelector, onStart: (element: Element, entry: IntersectionObserverEntry) => void | ViewChangeHandler, { root, margin: rootMargin, amount }?: InViewOptions): VoidFunction; + +declare const distance: (a: number, b: number) => number; +declare function distance2D(a: Point, b: Point): number; + +type ReorderAxis = "x" | "y" | "xy"; +type ReorderElementTag = keyof HTMLElements; +type DefaultGroupElement = "ul"; +type DefaultItemElement = "li"; + +interface Props$1 { + /** + * A HTML element to render this component as. Defaults to `"ul"`. + * + * @public + */ + as?: TagName; + /** + * The axis to reorder along. By default, this is detected from the item + * layout. Use `"xy"` to explicitly enable wrapped layout reordering. + * + * @public + */ + axis?: ReorderAxis; + /** + * A callback to fire with the new value order. For instance, if the values + * are provided as a state from `useState`, this could be the set state function. + * + * @public + */ + onReorder: (newOrder: V[]) => void; + /** + * The latest values state. + * + * ```jsx + * function Component() { + * const [items, setItems] = useState([0, 1, 2]) + * + * return ( + * + * {items.map((item) => )} + * + * ) + * } + * ``` + * + * @public + */ + values: V[]; +} +type ReorderGroupProps = Props$1 & Omit, "values"> & React$1.PropsWithChildren<{}>; +declare function ReorderGroupComponent({ children, as, axis: axisOverride, onReorder, values, ...props }: ReorderGroupProps, externalRef?: React$1.ForwardedRef): JSX.Element; +declare const ReorderGroup: (props: Omit, "values" | "onReorder"> & { + values: Values; + onReorder: (newOrder: Values) => void; +} & { + ref?: React$1.ForwardedRef | undefined; +}) => ReturnType; + +interface Props { + /** + * A HTML element to render this component as. Defaults to `"li"`. + * + * @public + */ + as?: TagName; + /** + * The value in the list that this component represents. + * + * @public + */ + value: V; + /** + * A subset of layout options primarily used to disable layout="size" + * + * @public + * @default true + */ + layout?: true | "position"; +} +type ReorderItemProps = Props & Omit, "value" | "layout"> & React$1.PropsWithChildren<{}>; +declare function ReorderItemComponent({ children, style, value, as, onDrag, onDragEnd, layout, ...props }: ReorderItemProps, externalRef?: React$1.ForwardedRef): React$1.JSX.Element; +declare const ReorderItem: (props: ReorderItemProps & { + ref?: React$1.ForwardedRef; +}) => ReturnType; + +declare namespace namespace_d { + export { ReorderGroup as Group, ReorderItem as Item }; +} + +type MotionComponentProps = { + [K in Exclude]?: Props[K]; +} & MotionProps; +type MotionComponent = T extends keyof DOMMotionComponents ? DOMMotionComponents[T] : React$1.ComponentType, "children"> & { + children?: "children" extends keyof P ? P["children"] | MotionComponentProps

["children"] : MotionComponentProps

["children"]; +}>; +interface MotionComponentOptions { + forwardMotionProps?: boolean; + /** + * Specify whether the component renders an HTML or SVG element. + * This is useful when wrapping custom SVG components that need + * SVG-specific attribute handling (like viewBox animation). + * By default, Motion auto-detects based on the component name, + * but custom React components are always treated as HTML. + */ + type?: "html" | "svg"; +} +/** + * Create a `motion` component. + * + * This function accepts a Component argument, which can be either a string (ie "div" + * for `motion.div`), or an actual React component. + * + * Alongside this is a config option which provides a way of rendering the provided + * component "offline", or outside the React render cycle. + */ +declare function createMotionComponent(Component: TagName | string | React$1.ComponentType, { forwardMotionProps, type }?: MotionComponentOptions, preloadedFeatures?: FeaturePackages, createVisualElement?: CreateVisualElement): MotionComponent; + +declare const m: typeof createMotionComponent & HTMLMotionComponents & SVGMotionComponents & { + create: typeof createMotionComponent; +}; + +declare const motion: typeof createMotionComponent & HTMLMotionComponents & SVGMotionComponents & { + create: typeof createMotionComponent; +}; + +type EventListenerWithPointInfo = (e: PointerEvent, info: EventInfo) => void; +declare const addPointerInfo: (handler: EventListenerWithPointInfo) => EventListener; + +declare function addPointerEvent(target: EventTarget, eventName: string, handler: EventListenerWithPointInfo, options?: AddEventListenerOptions): () => void; + +declare const animations: FeaturePackages; + +declare function filterProps(props: MotionProps, isDom: boolean, forwardMotionProps: boolean, isValidProp?: IsValidProp): MotionProps; + +type AnimationType = "animate" | "whileHover" | "whileTap" | "whileDrag" | "whileFocus" | "whileInView" | "exit"; + +declare const isBrowser: boolean; + +/** + * Taken from https://github.com/radix-ui/primitives/blob/main/packages/react/compose-refs/src/compose-refs.tsx + */ + +type PossibleRef = React$1.Ref | undefined; +/** + * A custom hook that composes multiple refs + * Accepts callback refs and RefObject(s) + */ +declare function useComposedRefs(...refs: PossibleRef[]): React$1.RefCallback; + +declare function useForceUpdate(): [VoidFunction, number]; + +declare const useIsomorphicLayoutEffect: typeof useEffect; + +declare function useUnmountEffect(callback: () => void): void; + +/** + * @public + */ +declare const domAnimation: FeatureBundle; + +/** + * @public + */ +declare const domMax: FeatureBundle; + +/** + * @public + */ +declare const domMin: FeatureBundle; + +declare function useMotionValueEvent>(value: MotionValue, event: EventName, callback: MotionValueEventCallbacks[EventName]): void; + +/** + * @deprecated useElementScroll is deprecated. Convert to useScroll({ container: ref }) + */ +declare function useElementScroll(ref: RefObject): { + scrollX: motion_dom.MotionValue; + scrollY: motion_dom.MotionValue; + scrollXProgress: motion_dom.MotionValue; + scrollYProgress: motion_dom.MotionValue; +}; + +/** + * @deprecated useViewportScroll is deprecated. Convert to useScroll() + */ +declare function useViewportScroll(): { + scrollX: motion_dom.MotionValue; + scrollY: motion_dom.MotionValue; + scrollXProgress: motion_dom.MotionValue; + scrollYProgress: motion_dom.MotionValue; +}; + +/** + * Combine multiple motion values into a new one using a string template literal. + * + * ```jsx + * import { + * motion, + * useSpring, + * useMotionValue, + * useMotionTemplate + * } from "framer-motion" + * + * function Component() { + * const shadowX = useSpring(0) + * const shadowY = useMotionValue(0) + * const shadow = useMotionTemplate`drop-shadow(${shadowX}px ${shadowY}px 20px rgba(0,0,0,0.3))` + * + * return + * } + * ``` + * + * @public + */ +declare function useMotionTemplate(fragments: TemplateStringsArray, ...values: Array): MotionValue; + +/** + * Creates a `MotionValue` to track the state and velocity of a value. + * + * Usually, these are created automatically. For advanced use-cases, like use with `useTransform`, you can create `MotionValue`s externally and pass them into the animated component via the `style` prop. + * + * ```jsx + * export const MyComponent = () => { + * const scale = useMotionValue(1) + * + * return + * } + * ``` + * + * @param initial - The initial state. + * + * @public + */ +declare function useMotionValue(initial: T): MotionValue; + +interface UseScrollOptions extends Omit { + container?: RefObject; + target?: RefObject; +} +declare function useScroll({ container, target, ...options }?: UseScrollOptions): { + scrollX: motion_dom.MotionValue; + scrollY: motion_dom.MotionValue; + scrollXProgress: motion_dom.MotionValue; + scrollYProgress: motion_dom.MotionValue; +}; + +/** + * Creates a `MotionValue` that, when `set`, will use the specified animation transition to animate to its new state. + * + * Unlike `useSpring` which is limited to spring animations, `useFollowValue` accepts any motion transition + * including spring, tween, inertia, and keyframes. + * + * It can either work as a stand-alone `MotionValue` by initialising it with a value, or as a subscriber + * to another `MotionValue`. + * + * @remarks + * + * ```jsx + * // Spring animation (default) + * const x = useFollowValue(0, { stiffness: 300 }) + * + * // Tween animation + * const y = useFollowValue(0, { type: "tween", duration: 0.5, ease: "easeOut" }) + * + * // Track another MotionValue with spring + * const source = useMotionValue(0) + * const z = useFollowValue(source, { type: "spring", damping: 10 }) + * + * // Inertia animation + * const w = useFollowValue(0, { type: "inertia", velocity: 100 }) + * ``` + * + * @param inputValue - `MotionValue` or number. If provided a `MotionValue`, when the input `MotionValue` changes, the created `MotionValue` will animate towards that value using the specified transition. + * @param options - Animation transition options. Supports all transition types: spring, tween, inertia, keyframes. + * @returns `MotionValue` + * + * @public + */ +declare function useFollowValue(source: MotionValue, options?: FollowValueOptions): MotionValue; +declare function useFollowValue(source: string, options?: FollowValueOptions): MotionValue; +declare function useFollowValue(source: MotionValue, options?: FollowValueOptions): MotionValue; +declare function useFollowValue(source: number, options?: FollowValueOptions): MotionValue; + +type UseSpringOptions = SpringOptions & Pick; +/** + * Creates a `MotionValue` that, when `set`, will use a spring animation to animate to its new state. + * + * It can either work as a stand-alone `MotionValue` by initialising it with a value, or as a subscriber + * to another `MotionValue`. + * + * @remarks + * + * ```jsx + * const x = useSpring(0, { stiffness: 300 }) + * const y = useSpring(x, { damping: 10 }) + * ``` + * + * @param inputValue - `MotionValue` or number. If provided a `MotionValue`, when the input `MotionValue` changes, the created `MotionValue` will spring towards that value. + * @param springConfig - Configuration options for the spring. + * @returns `MotionValue` + * + * @public + */ +declare function useSpring(source: MotionValue, options?: UseSpringOptions): MotionValue; +declare function useSpring(source: string, options?: UseSpringOptions): MotionValue; +declare function useSpring(source: MotionValue, options?: UseSpringOptions): MotionValue; +declare function useSpring(source: number, options?: UseSpringOptions): MotionValue; + +declare function useTime(): motion_dom.MotionValue; + +type InputRange = number[]; +type SingleTransformer = (input: I) => O; +type MultiTransformer = (input: I[]) => O; +/** + * Create multiple `MotionValue`s that transform the output of another `MotionValue` by mapping it from one range of values into multiple output ranges. + * + * @remarks + * + * This is useful when you want to derive multiple values from a single input value. + * The keys of the output map must remain constant across renders. + * + * ```jsx + * export const MyComponent = () => { + * const x = useMotionValue(0) + * const { opacity, scale } = useTransform(x, [0, 100], { + * opacity: [0, 1], + * scale: [0.5, 1] + * }) + * + * return ( + * + * ) + * } + * ``` + * + * @param inputValue - `MotionValue` + * @param inputRange - A linear series of numbers (either all increasing or decreasing) + * @param outputMap - An object where keys map to output ranges. Each output range must be the same length as `inputRange`. + * @param options - Transform options applied to all outputs + * + * @returns An object with the same keys as `outputMap`, where each value is a `MotionValue` + * + * @public + */ +declare function useTransform>(inputValue: MotionValue, inputRange: InputRange, outputMap: T, options?: TransformOptions): { + [K in keyof T]: MotionValue; +}; +/** + * Create a `MotionValue` that transforms the output of another `MotionValue` by mapping it from one range of values into another. + * + * @remarks + * + * Given an input range of `[-200, -100, 100, 200]` and an output range of + * `[0, 1, 1, 0]`, the returned `MotionValue` will: + * + * - When provided a value between `-200` and `-100`, will return a value between `0` and `1`. + * - When provided a value between `-100` and `100`, will return `1`. + * - When provided a value between `100` and `200`, will return a value between `1` and `0` + * + * + * The input range must be a linear series of numbers. The output range + * can be any value type supported by Motion: numbers, colors, shadows, etc. + * + * Every value in the output range must be of the same type and in the same format. + * + * ```jsx + * export const MyComponent = () => { + * const x = useMotionValue(0) + * const xRange = [-200, -100, 100, 200] + * const opacityRange = [0, 1, 1, 0] + * const opacity = useTransform(x, xRange, opacityRange) + * + * return ( + * + * ) + * } + * ``` + * + * @param inputValue - `MotionValue` + * @param inputRange - A linear series of numbers (either all increasing or decreasing) + * @param outputRange - A series of numbers, colors or strings. Must be the same length as `inputRange`. + * @param options - + * + * - clamp: boolean. Clamp values to within the given range. Defaults to `true` + * - ease: EasingFunction[]. Easing functions to use on the interpolations between each value in the input and output ranges. If provided as an array, the array must be one item shorter than the input and output ranges, as the easings apply to the transition between each. + * + * @returns `MotionValue` + * + * @public + */ +declare function useTransform(value: MotionValue, inputRange: InputRange, outputRange: O[], options?: TransformOptions): MotionValue; +/** + * Create a `MotionValue` that transforms the output of another `MotionValue` through a function. + * In this example, `y` will always be double `x`. + * + * ```jsx + * export const MyComponent = () => { + * const x = useMotionValue(10) + * const y = useTransform(x, value => value * 2) + * + * return + * } + * ``` + * + * @param input - A `MotionValue` that will pass its latest value through `transform` to update the returned `MotionValue`. + * @param transform - A function that accepts the latest value from `input` and returns a new value. + * @returns `MotionValue` + * + * @public + */ +declare function useTransform(input: MotionValue, transformer: SingleTransformer): MotionValue; +/** + * Pass an array of `MotionValue`s and a function to combine them. In this example, `z` will be the `x` multiplied by `y`. + * + * ```jsx + * export const MyComponent = () => { + * const x = useMotionValue(0) + * const y = useMotionValue(0) + * const z = useTransform([x, y], ([latestX, latestY]) => latestX * latestY) + * + * return + * } + * ``` + * + * @param input - An array of `MotionValue`s that will pass their latest values through `transform` to update the returned `MotionValue`. + * @param transform - A function that accepts the latest values from `input` and returns a new value. + * @returns `MotionValue` + * + * @public + */ +declare function useTransform(input: MotionValue[] | MotionValue[] | MotionValue[], transformer: MultiTransformer): MotionValue; +declare function useTransform(transformer: () => O): MotionValue; + +/** + * Creates a `MotionValue` that updates when the velocity of the provided `MotionValue` changes. + * + * ```javascript + * const x = useMotionValue(0) + * const xVelocity = useVelocity(x) + * const xAcceleration = useVelocity(xVelocity) + * ``` + * + * @public + */ +declare function useVelocity(value: MotionValue): MotionValue; + +declare function useWillChange(): WillChange; + +declare class WillChangeMotionValue extends MotionValue implements WillChange { + private isEnabled; + add(name: string): void; + private update; +} + +/** + * A hook that returns `true` if we should be using reduced motion based on the current device's Reduced Motion setting. + * + * This can be used to implement changes to your UI based on Reduced Motion. For instance, replacing motion-sickness inducing + * `x`/`y` animations with `opacity`, disabling the autoplay of background videos, or turning off parallax motion. + * + * It will actively respond to changes and re-render your components with the latest setting. + * + * ```jsx + * export function Sidebar({ isOpen }) { + * const shouldReduceMotion = useReducedMotion() + * const closedX = shouldReduceMotion ? 0 : "-100%" + * + * return ( + * + * ) + * } + * ``` + * + * @return boolean + * + * @public + */ +declare function useReducedMotion(): boolean | null; + +declare function useReducedMotionConfig(): boolean | null; + +/** + * @public + */ +declare function animationControls(): LegacyAnimationControls; + +declare function useAnimate(): [AnimationScope, { + (sequence: AnimationSequence, options?: SequenceOptions | undefined): motion_dom.AnimationPlaybackControlsWithThen; + (value: string | motion_dom.MotionValue, keyframes: string | motion_dom.UnresolvedValueKeyframe[], options?: motion_dom.ValueAnimationTransition | undefined): motion_dom.AnimationPlaybackControlsWithThen; + (value: number | motion_dom.MotionValue, keyframes: number | motion_dom.UnresolvedValueKeyframe[], options?: motion_dom.ValueAnimationTransition | undefined): motion_dom.AnimationPlaybackControlsWithThen; + (value: V | motion_dom.MotionValue, keyframes: V | motion_dom.UnresolvedValueKeyframe[], options?: motion_dom.ValueAnimationTransition | undefined): motion_dom.AnimationPlaybackControlsWithThen; + (element: motion_dom.ElementOrSelector, keyframes: motion_dom.DOMKeyframesDefinition, options?: motion_dom.AnimationOptions | undefined): motion_dom.AnimationPlaybackControlsWithThen; + (object: O | O[], keyframes: ObjectTarget, options?: motion_dom.AnimationOptions | undefined): motion_dom.AnimationPlaybackControlsWithThen; +}]; + +declare function useAnimateMini(): [AnimationScope, (elementOrSelector: motion_dom.ElementOrSelector, keyframes: motion_dom.DOMKeyframesDefinition, options?: motion_dom.AnimationOptions | undefined) => motion_dom.AnimationPlaybackControlsWithThen]; + +/** + * Creates `LegacyAnimationControls`, which can be used to manually start, stop + * and sequence animations on one or more components. + * + * The returned `LegacyAnimationControls` should be passed to the `animate` property + * of the components you want to animate. + * + * These components can then be animated with the `start` method. + * + * ```jsx + * import * as React from 'react' + * import { motion, useAnimation } from 'framer-motion' + * + * export function MyComponent(props) { + * const controls = useAnimation() + * + * controls.start({ + * x: 100, + * transition: { duration: 0.5 }, + * }) + * + * return + * } + * ``` + * + * @returns Animation controller with `start` and `stop` methods + * + * @public + */ +declare function useAnimationControls(): LegacyAnimationControls; +declare const useAnimation: typeof useAnimationControls; + +type SafeToRemove = () => void; +type AlwaysPresent = [true, null]; +type Present = [true]; +type NotPresent = [false, SafeToRemove]; +/** + * When a component is the child of `AnimatePresence`, it can use `usePresence` + * to access information about whether it's still present in the React tree. + * + * ```jsx + * import { usePresence } from "framer-motion" + * + * export const Component = () => { + * const [isPresent, safeToRemove] = usePresence() + * + * useEffect(() => { + * !isPresent && setTimeout(safeToRemove, 1000) + * }, [isPresent]) + * + * return

+ * } + * ``` + * + * If `isPresent` is `false`, it means that a component has been removed from the tree, + * but `AnimatePresence` won't really remove it until `safeToRemove` has been called. + * + * @public + */ +declare function usePresence(subscribe?: boolean): AlwaysPresent | Present | NotPresent; +/** + * Similar to `usePresence`, except `useIsPresent` simply returns whether or not the component is present. + * There is no `safeToRemove` function. + * + * ```jsx + * import { useIsPresent } from "framer-motion" + * + * export const Component = () => { + * const isPresent = useIsPresent() + * + * useEffect(() => { + * !isPresent && console.log("I've been removed!") + * }, [isPresent]) + * + * return
+ * } + * ``` + * + * @public + */ +declare function useIsPresent(): boolean; + +declare function usePresenceData(): any; + +/** + * Attaches an event listener directly to the provided DOM element. + * + * Bypassing React's event system can be desirable, for instance when attaching non-passive + * event handlers. + * + * ```jsx + * const ref = useRef(null) + * + * useDomEvent(ref, 'wheel', onWheel, { passive: false }) + * + * return
+ * ``` + * + * @param ref - React.RefObject that's been provided to the element you want to bind the listener to. + * @param eventName - Name of the event you want listen for. + * @param handler - Function to fire when receiving the event. + * @param options - Options to pass to `Event.addEventListener`. + * + * @public + */ +declare function useDomEvent(ref: RefObject, eventName: string, handler?: EventListener | undefined, options?: AddEventListenerOptions): void; + +interface DragControlOptions { + /** + * This distance after which dragging starts and a direction is locked in. + * + * @public + */ + distanceThreshold?: number; + /** + * Whether to immediately snap to the cursor when dragging starts. + * + * @public + */ + snapToCursor?: boolean; +} + +/** + * Can manually trigger a drag gesture on one or more `drag`-enabled `motion` components. + * + * ```jsx + * const dragControls = useDragControls() + * + * function startDrag(event) { + * dragControls.start(event, { snapToCursor: true }) + * } + * + * return ( + * <> + *
+ * + * + * ) + * ``` + * + * @public + */ +declare class DragControls { + private componentControls; + /** + * Start a drag gesture on every `motion` component that has this set of drag controls + * passed into it via the `dragControls` prop. + * + * ```jsx + * dragControls.start(e, { + * snapToCursor: true + * }) + * ``` + * + * @param event - PointerEvent + * @param options - Options + * + * @public + */ + start(event: React$1.PointerEvent | PointerEvent, options?: DragControlOptions): void; + /** + * Cancels a drag gesture. + * + * ```jsx + * dragControls.cancel() + * ``` + * + * @public + */ + cancel(): void; + /** + * Stops a drag gesture. + * + * ```jsx + * dragControls.stop() + * ``` + * + * @public + */ + stop(): void; +} +/** + * Usually, dragging is initiated by pressing down on a `motion` component with a `drag` prop + * and moving it. For some use-cases, for instance clicking at an arbitrary point on a video scrubber, we + * might want to initiate that dragging from a different component than the draggable one. + * + * By creating a `dragControls` using the `useDragControls` hook, we can pass this into + * the draggable component's `dragControls` prop. It exposes a `start` method + * that can start dragging from pointer events on other components. + * + * ```jsx + * const dragControls = useDragControls() + * + * function startDrag(event) { + * dragControls.start(event, { snapToCursor: true }) + * } + * + * return ( + * <> + *
+ * + * + * ) + * ``` + * + * @public + */ +declare function useDragControls(): DragControls; + +/** + * Checks if a component is a `motion` component. + */ +declare function isMotionComponent(component: React.ComponentType | string): boolean; + +/** + * Unwraps a `motion` component and returns either a string for `motion.div` or + * the React component for `motion(Component)`. + * + * If the component is not a `motion` component it returns undefined. + */ +declare function unwrapMotionComponent(component: React.ComponentType | string): React.ComponentType | string | undefined; + +/** + * Check whether a prop name is a valid `MotionProp` key. + * + * @param key - Name of the property to check + * @returns `true` is key is a valid `MotionProp`. + * + * @public + */ +declare function isValidMotionProp(key: string): boolean; + +declare function useInstantLayoutTransition(): (cb?: (() => void) | undefined) => void; + +declare function useResetProjection(): () => void; + +type FrameCallback = (timestamp: number, delta: number) => void; +declare function useAnimationFrame(callback: FrameCallback): void; + +type Cycle = (i?: number) => void; +type CycleState = [T, Cycle]; +/** + * Cycles through a series of visual properties. Can be used to toggle between or cycle through animations. It works similar to `useState` in React. It is provided an initial array of possible states, and returns an array of two arguments. + * + * An index value can be passed to the returned `cycle` function to cycle to a specific index. + * + * ```jsx + * import * as React from "react" + * import { motion, useCycle } from "framer-motion" + * + * export const MyComponent = () => { + * const [x, cycleX] = useCycle(0, 50, 100) + * + * return ( + * cycleX()} + * /> + * ) + * } + * ``` + * + * @param items - items to cycle through + * @returns [currentState, cycleState] + * + * @public + */ +declare function useCycle(...items: T[]): CycleState; + +interface UseInViewOptions extends Omit { + root?: RefObject; + once?: boolean; + amount?: "some" | "all" | number; + initial?: boolean; +} +declare function useInView(ref: RefObject, { root, margin, amount, once, initial, }?: UseInViewOptions): boolean; + +declare function useInstantTransition(): (callback: () => void) => void; +declare function disableInstantTransitions(): void; + +declare function usePageInView(): boolean; + +/** + * Creates a `transformPagePoint` function that accounts for SVG viewBox scaling. + * + * When dragging SVG elements inside an SVG with a viewBox that differs from + * the rendered dimensions (e.g., `viewBox="0 0 100 100"` but rendered at 500x500 pixels), + * pointer coordinates need to be transformed to match the SVG's coordinate system. + * + * @example + * ```jsx + * function App() { + * const svgRef = useRef(null) + * + * return ( + * + * + * + * + * + * ) + * } + * ``` + * + * @param svgRef - A React ref to the SVG element + * @returns A transformPagePoint function for use with MotionConfig + * + * @public + */ +declare function transformViewBoxPoint(svgRef: RefObject): TransformPoint; + +/** + * Creates a `transformPagePoint` function that corrects pointer coordinates + * for a parent container with CSS transforms (rotation, scale, skew). + * + * When dragging elements inside a transformed parent, pointer coordinates + * need to be transformed through the inverse of the parent's transform + * so the drag offset is in local space. + * + * Works with both static and continuously animating transforms. + * + * @example + * ```jsx + * function App() { + * const ref = useRef(null) + * + * return ( + * + * + * + * + * + * ) + * } + * ``` + * + * @param parentRef - A React ref to the transformed parent element + * @returns A transformPagePoint function for use with MotionConfig + * + * @public + */ +declare function correctParentTransform(parentRef: RefObject): TransformPoint; + +declare function startOptimizedAppearAnimation(element: HTMLElement, name: string, keyframes: string[] | number[], options: ValueAnimationTransition, onReady?: (animation: Animation) => void): void; + +interface LayoutGroupContextProps { + id?: string; + group?: NodeGroup; + forceRender?: VoidFunction; +} +declare const LayoutGroupContext: React$1.Context; + +interface MotionContextProps { + visualElement?: VisualElement; + initial?: false | string | string[]; + animate?: string | string[]; +} +declare const MotionContext: React$1.Context>; + +interface SwitchLayoutGroup { + register?: (member: IProjectionNode) => void; + deregister?: (member: IProjectionNode) => void; +} +type InitialPromotionConfig = { + /** + * The initial transition to use when the elements in this group mount (and automatically promoted). + * Subsequent updates should provide a transition in the promote method. + */ + transition?: Transition; + /** + * If the follow tree should preserve its opacity when the lead is promoted on mount + */ + shouldPreserveFollowOpacity?: (member: IProjectionNode) => boolean; +}; +type SwitchLayoutGroupContext = SwitchLayoutGroup & InitialPromotionConfig; +/** + * Internal, exported only for usage in Framer + */ +declare const SwitchLayoutGroupContext: React$1.Context; + +/** + * @public + */ +interface ScrollMotionValues { + scrollX: MotionValue; + scrollY: MotionValue; + scrollXProgress: MotionValue; + scrollYProgress: MotionValue; +} + +/** + * This is not an officially supported API and may be removed + * on any version. + */ +declare function useAnimatedState(initialState: any): any[]; + +declare const AnimateSharedLayout: React$1.FunctionComponent>; + +/** + * Note: Still used by components generated by old versions of Framer + * + * @deprecated + */ +declare const DeprecatedLayoutGroupContext: React$1.Context; + +interface ScaleMotionValues { + scaleX: MotionValue; + scaleY: MotionValue; +} +/** + * Returns a `MotionValue` each for `scaleX` and `scaleY` that update with the inverse + * of their respective parent scales. + * + * This is useful for undoing the distortion of content when scaling a parent component. + * + * By default, `useInvertedScale` will automatically fetch `scaleX` and `scaleY` from the nearest parent. + * By passing other `MotionValue`s in as `useInvertedScale({ scaleX, scaleY })`, it will invert the output + * of those instead. + * + * ```jsx + * const MyComponent = () => { + * const { scaleX, scaleY } = useInvertedScale() + * return + * } + * ``` + * + * @deprecated + */ +declare function useInvertedScale(scale?: Partial): ScaleMotionValues; + +export { type AbsoluteKeyframe, AnimatePresence, type AnimatePresenceProps, AnimateSharedLayout, type AnimationSequence, type AnimationType, type At, type CreateVisualElement, type Cycle, type CycleState, type DOMMotionComponents, type DOMSegment, type DOMSegmentWithTransition, DeprecatedLayoutGroupContext, DragControls, type FeatureBundle, type FeatureDefinition, type FeatureDefinitions, type FeaturePackage, type FeaturePackages, type ForwardRefComponent, type FunctionSegment, type HTMLElements, type HTMLMotionProps, type HydratedFeatureDefinition, type HydratedFeatureDefinitions, LayoutGroup, LayoutGroupContext, type LazyFeatureBundle$1 as LazyFeatureBundle, LazyMotion, type LazyProps, MotionConfig, MotionConfigContext, type MotionConfigProps, MotionContext, type MotionProps, type MotionStyle, type MotionTransform, type MotionValueSegment, type MotionValueSegmentWithTransition, type ObjectSegment, type ObjectSegmentWithTransition, type ObjectTarget, PopChild, PresenceChild, PresenceContext, namespace_d as Reorder, type ResolveKeyframes, type ResolvedAnimationDefinition, type ResolvedAnimationDefinitions, type SVGAttributesAsMotionValues, type SVGMotionProps, type ScrapeMotionValuesFromProps, type ScrollMotionValues, type Segment, type SegmentTransitionOptions, type SegmentValueTransitionOptions, type SequenceLabel, type SequenceLabelWithTime, type SequenceMap, type SequenceOptions, type SequenceProgressCallback, type SequenceTime, SwitchLayoutGroupContext, type UseInViewOptions, type UseScrollOptions, type ValueSequence, type VariantLabels, type VisualState, WillChangeMotionValue, addPointerEvent, addPointerInfo, animate, animateMini, animationControls, animations, correctParentTransform, createScopedAnimate, disableInstantTransitions, distance, distance2D, domAnimation, domMax, domMin, filterProps, inView, isBrowser, isMotionComponent, isValidMotionProp, m, makeUseVisualState, motion, scroll, scrollInfo, startOptimizedAppearAnimation, transformViewBoxPoint, unwrapMotionComponent, useAnimate, useAnimateMini, useAnimation, useAnimationControls, useAnimationFrame, useComposedRefs, useCycle, useAnimatedState as useDeprecatedAnimatedState, useInvertedScale as useDeprecatedInvertedScale, useDomEvent, useDragControls, useElementScroll, useFollowValue, useForceUpdate, useInView, useInstantLayoutTransition, useInstantTransition, useIsPresent, useIsomorphicLayoutEffect, useMotionTemplate, useMotionValue, useMotionValueEvent, usePageInView, usePresence, usePresenceData, useReducedMotion, useReducedMotionConfig, useResetProjection, useScroll, useSpring, useTime, useTransform, useUnmountEffect, useVelocity, useViewportScroll, useWillChange }; diff --git a/node_modules/framer-motion/dist/m.d.ts b/node_modules/framer-motion/dist/m.d.ts new file mode 100644 index 0000000..b155f07 --- /dev/null +++ b/node_modules/framer-motion/dist/m.d.ts @@ -0,0 +1,412 @@ +/// +import * as React$1 from 'react'; +import { CSSProperties, PropsWithoutRef, RefAttributes, JSX, SVGAttributes } from 'react'; +import { MotionNodeOptions, MotionValue, TransformProperties, SVGPathProperties } from 'motion-dom'; + +type MotionValueString = MotionValue; +type MotionValueNumber = MotionValue; +type MotionValueAny = MotionValue; +type AnyMotionValue = MotionValueNumber | MotionValueString | MotionValueAny; +type MotionValueHelper = T | AnyMotionValue; +type MakeMotionHelper = { + [K in keyof T]: MotionValueHelper; +}; +type MakeCustomValueTypeHelper = MakeMotionHelper; +type MakeMotion = MakeCustomValueTypeHelper; +type MotionCSS = MakeMotion>; +/** + * @public + */ +type MotionTransform = MakeMotion; +type MotionSVGProps = MakeMotion; +/** + * @public + */ +interface MotionStyle$1 extends MotionCSS, MotionTransform, MotionSVGProps { +} +/** + * Props for `motion` components. + * + * @public + */ +interface MotionProps extends MotionNodeOptions { + /** + * + * The React DOM `style` prop, enhanced with support for `MotionValue`s and separate `transform` values. + * + * ```jsx + * export const MyComponent = () => { + * const x = useMotionValue(0) + * + * return + * } + * ``` + */ + style?: MotionStyle$1; + children?: React.ReactNode | MotionValueNumber | MotionValueString; +} + +interface HTMLElements { + a: HTMLAnchorElement; + abbr: HTMLElement; + address: HTMLElement; + area: HTMLAreaElement; + article: HTMLElement; + aside: HTMLElement; + audio: HTMLAudioElement; + b: HTMLElement; + base: HTMLBaseElement; + bdi: HTMLElement; + bdo: HTMLElement; + big: HTMLElement; + blockquote: HTMLQuoteElement; + body: HTMLBodyElement; + br: HTMLBRElement; + button: HTMLButtonElement; + canvas: HTMLCanvasElement; + caption: HTMLElement; + center: HTMLElement; + cite: HTMLElement; + code: HTMLElement; + col: HTMLTableColElement; + colgroup: HTMLTableColElement; + data: HTMLDataElement; + datalist: HTMLDataListElement; + dd: HTMLElement; + del: HTMLModElement; + details: HTMLDetailsElement; + dfn: HTMLElement; + dialog: HTMLDialogElement; + div: HTMLDivElement; + dl: HTMLDListElement; + dt: HTMLElement; + em: HTMLElement; + embed: HTMLEmbedElement; + fieldset: HTMLFieldSetElement; + figcaption: HTMLElement; + figure: HTMLElement; + footer: HTMLElement; + form: HTMLFormElement; + h1: HTMLHeadingElement; + h2: HTMLHeadingElement; + h3: HTMLHeadingElement; + h4: HTMLHeadingElement; + h5: HTMLHeadingElement; + h6: HTMLHeadingElement; + head: HTMLHeadElement; + header: HTMLElement; + hgroup: HTMLElement; + hr: HTMLHRElement; + html: HTMLHtmlElement; + i: HTMLElement; + iframe: HTMLIFrameElement; + img: HTMLImageElement; + input: HTMLInputElement; + ins: HTMLModElement; + kbd: HTMLElement; + keygen: HTMLElement; + label: HTMLLabelElement; + legend: HTMLLegendElement; + li: HTMLLIElement; + link: HTMLLinkElement; + main: HTMLElement; + map: HTMLMapElement; + mark: HTMLElement; + menu: HTMLElement; + menuitem: HTMLElement; + meta: HTMLMetaElement; + meter: HTMLMeterElement; + nav: HTMLElement; + noindex: HTMLElement; + noscript: HTMLElement; + object: HTMLObjectElement; + ol: HTMLOListElement; + optgroup: HTMLOptGroupElement; + option: HTMLOptionElement; + output: HTMLOutputElement; + p: HTMLParagraphElement; + param: HTMLParamElement; + picture: HTMLElement; + pre: HTMLPreElement; + progress: HTMLProgressElement; + q: HTMLQuoteElement; + rp: HTMLElement; + rt: HTMLElement; + ruby: HTMLElement; + s: HTMLElement; + samp: HTMLElement; + search: HTMLElement; + slot: HTMLSlotElement; + script: HTMLScriptElement; + section: HTMLElement; + select: HTMLSelectElement; + small: HTMLElement; + source: HTMLSourceElement; + span: HTMLSpanElement; + strong: HTMLElement; + style: HTMLStyleElement; + sub: HTMLElement; + summary: HTMLElement; + sup: HTMLElement; + table: HTMLTableElement; + template: HTMLTemplateElement; + tbody: HTMLTableSectionElement; + td: HTMLTableDataCellElement; + textarea: HTMLTextAreaElement; + tfoot: HTMLTableSectionElement; + th: HTMLTableHeaderCellElement; + thead: HTMLTableSectionElement; + time: HTMLTimeElement; + title: HTMLTitleElement; + tr: HTMLTableRowElement; + track: HTMLTrackElement; + u: HTMLElement; + ul: HTMLUListElement; + var: HTMLElement; + video: HTMLVideoElement; + wbr: HTMLElement; + webview: HTMLWebViewElement; +} + +/** + * @public + */ +type ForwardRefComponent = { + readonly $$typeof: symbol; +} & ((props: PropsWithoutRef

& RefAttributes) => JSX.Element); +type AttributesWithoutMotionProps = { + [K in Exclude]?: Attributes[K]; +}; +/** + * @public + */ +type HTMLMotionProps = AttributesWithoutMotionProps & MotionProps; +/** + * Motion-optimised versions of React's HTML components. + * + * @public + */ +type HTMLMotionComponents = { + [K in keyof HTMLElements]: ForwardRefComponent>; +}; + +type UnionStringArray> = T[number]; +declare const svgElements: readonly ["animate", "circle", "defs", "desc", "ellipse", "g", "image", "line", "filter", "marker", "mask", "metadata", "path", "pattern", "polygon", "polyline", "rect", "stop", "svg", "switch", "symbol", "text", "tspan", "use", "view", "clipPath", "feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence", "foreignObject", "linearGradient", "radialGradient", "textPath"]; +type SVGElements = UnionStringArray; + +interface SVGAttributesWithoutMotionProps extends Pick, Exclude, keyof MotionProps>> { +} +/** + * Blanket-accept any SVG attribute as a `MotionValue` + * @public + */ +type SVGAttributesAsMotionValues = MakeMotion>; +type UnwrapSVGFactoryElement = F extends React.SVGProps ? P : never; +/** + * @public + */ +interface SVGMotionProps extends SVGAttributesAsMotionValues, MotionProps { +} +/** + * Motion-optimised versions of React's SVG components. + * + * @public + */ +type SVGMotionComponents = { + [K in SVGElements]: ForwardRefComponent, SVGMotionProps>>; +}; + +type DOMMotionComponents = HTMLMotionComponents & SVGMotionComponents; + +type MotionComponentProps = { + [K in Exclude]?: Props[K]; +} & MotionProps; +type MotionComponent = T extends keyof DOMMotionComponents ? DOMMotionComponents[T] : React$1.ComponentType, "children"> & { + children?: "children" extends keyof P ? P["children"] | MotionComponentProps

["children"] : MotionComponentProps

["children"]; +}>; +interface MotionComponentOptions { + forwardMotionProps?: boolean; + /** + * Specify whether the component renders an HTML or SVG element. + * This is useful when wrapping custom SVG components that need + * SVG-specific attribute handling (like viewBox animation). + * By default, Motion auto-detects based on the component name, + * but custom React components are always treated as HTML. + */ + type?: "html" | "svg"; +} + +declare function createMinimalMotionComponent(Component: TagName | string | React.ComponentType, options?: MotionComponentOptions): MotionComponent; + +/** + * HTML components + */ +declare const MotionA: ForwardRefComponent>; +declare const MotionAbbr: ForwardRefComponent>; +declare const MotionAddress: ForwardRefComponent>; +declare const MotionArea: ForwardRefComponent>; +declare const MotionArticle: ForwardRefComponent>; +declare const MotionAside: ForwardRefComponent>; +declare const MotionAudio: ForwardRefComponent>; +declare const MotionB: ForwardRefComponent>; +declare const MotionBase: ForwardRefComponent>; +declare const MotionBdi: ForwardRefComponent>; +declare const MotionBdo: ForwardRefComponent>; +declare const MotionBig: ForwardRefComponent>; +declare const MotionBlockquote: ForwardRefComponent>; +declare const MotionBody: ForwardRefComponent>; +declare const MotionButton: ForwardRefComponent>; +declare const MotionCanvas: ForwardRefComponent>; +declare const MotionCaption: ForwardRefComponent>; +declare const MotionCite: ForwardRefComponent>; +declare const MotionCode: ForwardRefComponent>; +declare const MotionCol: ForwardRefComponent>; +declare const MotionColgroup: ForwardRefComponent>; +declare const MotionData: ForwardRefComponent>; +declare const MotionDatalist: ForwardRefComponent>; +declare const MotionDd: ForwardRefComponent>; +declare const MotionDel: ForwardRefComponent>; +declare const MotionDetails: ForwardRefComponent>; +declare const MotionDfn: ForwardRefComponent>; +declare const MotionDialog: ForwardRefComponent>; +declare const MotionDiv: ForwardRefComponent>; +declare const MotionDl: ForwardRefComponent>; +declare const MotionDt: ForwardRefComponent>; +declare const MotionEm: ForwardRefComponent>; +declare const MotionEmbed: ForwardRefComponent>; +declare const MotionFieldset: ForwardRefComponent>; +declare const MotionFigcaption: ForwardRefComponent>; +declare const MotionFigure: ForwardRefComponent>; +declare const MotionFooter: ForwardRefComponent>; +declare const MotionForm: ForwardRefComponent>; +declare const MotionH1: ForwardRefComponent>; +declare const MotionH2: ForwardRefComponent>; +declare const MotionH3: ForwardRefComponent>; +declare const MotionH4: ForwardRefComponent>; +declare const MotionH5: ForwardRefComponent>; +declare const MotionH6: ForwardRefComponent>; +declare const MotionHead: ForwardRefComponent>; +declare const MotionHeader: ForwardRefComponent>; +declare const MotionHgroup: ForwardRefComponent>; +declare const MotionHr: ForwardRefComponent>; +declare const MotionHtml: ForwardRefComponent>; +declare const MotionI: ForwardRefComponent>; +declare const MotionIframe: ForwardRefComponent>; +declare const MotionImg: ForwardRefComponent>; +declare const MotionInput: ForwardRefComponent>; +declare const MotionIns: ForwardRefComponent>; +declare const MotionKbd: ForwardRefComponent>; +declare const MotionKeygen: ForwardRefComponent>; +declare const MotionLabel: ForwardRefComponent>; +declare const MotionLegend: ForwardRefComponent>; +declare const MotionLi: ForwardRefComponent>; +declare const MotionLink: ForwardRefComponent>; +declare const MotionMain: ForwardRefComponent>; +declare const MotionMap: ForwardRefComponent>; +declare const MotionMark: ForwardRefComponent>; +declare const MotionMenu: ForwardRefComponent>; +declare const MotionMenuitem: ForwardRefComponent>; +declare const MotionMeter: ForwardRefComponent>; +declare const MotionNav: ForwardRefComponent>; +declare const MotionObject: ForwardRefComponent>; +declare const MotionOl: ForwardRefComponent>; +declare const MotionOptgroup: ForwardRefComponent>; +declare const MotionOption: ForwardRefComponent>; +declare const MotionOutput: ForwardRefComponent>; +declare const MotionP: ForwardRefComponent>; +declare const MotionParam: ForwardRefComponent>; +declare const MotionPicture: ForwardRefComponent>; +declare const MotionPre: ForwardRefComponent>; +declare const MotionProgress: ForwardRefComponent>; +declare const MotionQ: ForwardRefComponent>; +declare const MotionRp: ForwardRefComponent>; +declare const MotionRt: ForwardRefComponent>; +declare const MotionRuby: ForwardRefComponent>; +declare const MotionS: ForwardRefComponent>; +declare const MotionSamp: ForwardRefComponent>; +declare const MotionScript: ForwardRefComponent>; +declare const MotionSection: ForwardRefComponent>; +declare const MotionSelect: ForwardRefComponent>; +declare const MotionSmall: ForwardRefComponent>; +declare const MotionSource: ForwardRefComponent>; +declare const MotionSpan: ForwardRefComponent>; +declare const MotionStrong: ForwardRefComponent>; +declare const MotionStyle: ForwardRefComponent>; +declare const MotionSub: ForwardRefComponent>; +declare const MotionSummary: ForwardRefComponent>; +declare const MotionSup: ForwardRefComponent>; +declare const MotionTable: ForwardRefComponent>; +declare const MotionTbody: ForwardRefComponent>; +declare const MotionTd: ForwardRefComponent>; +declare const MotionTextarea: ForwardRefComponent>; +declare const MotionTfoot: ForwardRefComponent>; +declare const MotionTh: ForwardRefComponent>; +declare const MotionThead: ForwardRefComponent>; +declare const MotionTime: ForwardRefComponent>; +declare const MotionTitle: ForwardRefComponent>; +declare const MotionTr: ForwardRefComponent>; +declare const MotionTrack: ForwardRefComponent>; +declare const MotionU: ForwardRefComponent>; +declare const MotionUl: ForwardRefComponent>; +declare const MotionVideo: ForwardRefComponent>; +declare const MotionWbr: ForwardRefComponent>; +declare const MotionWebview: ForwardRefComponent>; +/** + * SVG components + */ +declare const MotionAnimate: ForwardRefComponent>; +declare const MotionCircle: ForwardRefComponent>; +declare const MotionDefs: ForwardRefComponent>; +declare const MotionDesc: ForwardRefComponent>; +declare const MotionEllipse: ForwardRefComponent>; +declare const MotionG: ForwardRefComponent>; +declare const MotionImage: ForwardRefComponent>; +declare const MotionLine: ForwardRefComponent>; +declare const MotionFilter: ForwardRefComponent>; +declare const MotionMarker: ForwardRefComponent>; +declare const MotionMask: ForwardRefComponent>; +declare const MotionMetadata: ForwardRefComponent>; +declare const MotionPath: ForwardRefComponent>; +declare const MotionPattern: ForwardRefComponent>; +declare const MotionPolygon: ForwardRefComponent>; +declare const MotionPolyline: ForwardRefComponent>; +declare const MotionRect: ForwardRefComponent>; +declare const MotionStop: ForwardRefComponent>; +declare const MotionSvg: ForwardRefComponent>; +declare const MotionSymbol: ForwardRefComponent>; +declare const MotionText: ForwardRefComponent>; +declare const MotionTspan: ForwardRefComponent>; +declare const MotionUse: ForwardRefComponent>; +declare const MotionView: ForwardRefComponent>; +declare const MotionClipPath: ForwardRefComponent>; +declare const MotionFeBlend: ForwardRefComponent>; +declare const MotionFeColorMatrix: ForwardRefComponent>; +declare const MotionFeComponentTransfer: ForwardRefComponent>; +declare const MotionFeComposite: ForwardRefComponent>; +declare const MotionFeConvolveMatrix: ForwardRefComponent>; +declare const MotionFeDiffuseLighting: ForwardRefComponent>; +declare const MotionFeDisplacementMap: ForwardRefComponent>; +declare const MotionFeDistantLight: ForwardRefComponent>; +declare const MotionFeDropShadow: ForwardRefComponent>; +declare const MotionFeFlood: ForwardRefComponent>; +declare const MotionFeFuncA: ForwardRefComponent>; +declare const MotionFeFuncB: ForwardRefComponent>; +declare const MotionFeFuncG: ForwardRefComponent>; +declare const MotionFeFuncR: ForwardRefComponent>; +declare const MotionFeGaussianBlur: ForwardRefComponent>; +declare const MotionFeImage: ForwardRefComponent>; +declare const MotionFeMerge: ForwardRefComponent>; +declare const MotionFeMergeNode: ForwardRefComponent>; +declare const MotionFeMorphology: ForwardRefComponent>; +declare const MotionFeOffset: ForwardRefComponent>; +declare const MotionFePointLight: ForwardRefComponent>; +declare const MotionFeSpecularLighting: ForwardRefComponent>; +declare const MotionFeSpotLight: ForwardRefComponent>; +declare const MotionFeTile: ForwardRefComponent>; +declare const MotionFeTurbulence: ForwardRefComponent>; +declare const MotionForeignObject: ForwardRefComponent>; +declare const MotionLinearGradient: ForwardRefComponent>; +declare const MotionRadialGradient: ForwardRefComponent>; +declare const MotionTextPath: ForwardRefComponent>; + +export { MotionA as a, MotionAbbr as abbr, MotionAddress as address, MotionAnimate as animate, MotionArea as area, MotionArticle as article, MotionAside as aside, MotionAudio as audio, MotionB as b, MotionBase as base, MotionBdi as bdi, MotionBdo as bdo, MotionBig as big, MotionBlockquote as blockquote, MotionBody as body, MotionButton as button, MotionCanvas as canvas, MotionCaption as caption, MotionCircle as circle, MotionCite as cite, MotionClipPath as clipPath, MotionCode as code, MotionCol as col, MotionColgroup as colgroup, createMinimalMotionComponent as create, MotionData as data, MotionDatalist as datalist, MotionDd as dd, MotionDefs as defs, MotionDel as del, MotionDesc as desc, MotionDetails as details, MotionDfn as dfn, MotionDialog as dialog, MotionDiv as div, MotionDl as dl, MotionDt as dt, MotionEllipse as ellipse, MotionEm as em, MotionEmbed as embed, MotionFeBlend as feBlend, MotionFeColorMatrix as feColorMatrix, MotionFeComponentTransfer as feComponentTransfer, MotionFeComposite as feComposite, MotionFeConvolveMatrix as feConvolveMatrix, MotionFeDiffuseLighting as feDiffuseLighting, MotionFeDisplacementMap as feDisplacementMap, MotionFeDistantLight as feDistantLight, MotionFeDropShadow as feDropShadow, MotionFeFlood as feFlood, MotionFeFuncA as feFuncA, MotionFeFuncB as feFuncB, MotionFeFuncG as feFuncG, MotionFeFuncR as feFuncR, MotionFeGaussianBlur as feGaussianBlur, MotionFeImage as feImage, MotionFeMerge as feMerge, MotionFeMergeNode as feMergeNode, MotionFeMorphology as feMorphology, MotionFeOffset as feOffset, MotionFePointLight as fePointLight, MotionFeSpecularLighting as feSpecularLighting, MotionFeSpotLight as feSpotLight, MotionFeTile as feTile, MotionFeTurbulence as feTurbulence, MotionFieldset as fieldset, MotionFigcaption as figcaption, MotionFigure as figure, MotionFilter as filter, MotionFooter as footer, MotionForeignObject as foreignObject, MotionForm as form, MotionG as g, MotionH1 as h1, MotionH2 as h2, MotionH3 as h3, MotionH4 as h4, MotionH5 as h5, MotionH6 as h6, MotionHead as head, MotionHeader as header, MotionHgroup as hgroup, MotionHr as hr, MotionHtml as html, MotionI as i, MotionIframe as iframe, MotionImage as image, MotionImg as img, MotionInput as input, MotionIns as ins, MotionKbd as kbd, MotionKeygen as keygen, MotionLabel as label, MotionLegend as legend, MotionLi as li, MotionLine as line, MotionLinearGradient as linearGradient, MotionLink as link, MotionMain as main, MotionMap as map, MotionMark as mark, MotionMarker as marker, MotionMask as mask, MotionMenu as menu, MotionMenuitem as menuitem, MotionMetadata as metadata, MotionMeter as meter, MotionNav as nav, MotionObject as object, MotionOl as ol, MotionOptgroup as optgroup, MotionOption as option, MotionOutput as output, MotionP as p, MotionParam as param, MotionPath as path, MotionPattern as pattern, MotionPicture as picture, MotionPolygon as polygon, MotionPolyline as polyline, MotionPre as pre, MotionProgress as progress, MotionQ as q, MotionRadialGradient as radialGradient, MotionRect as rect, MotionRp as rp, MotionRt as rt, MotionRuby as ruby, MotionS as s, MotionSamp as samp, MotionScript as script, MotionSection as section, MotionSelect as select, MotionSmall as small, MotionSource as source, MotionSpan as span, MotionStop as stop, MotionStrong as strong, MotionStyle as style, MotionSub as sub, MotionSummary as summary, MotionSup as sup, MotionSvg as svg, MotionSymbol as symbol, MotionTable as table, MotionTbody as tbody, MotionTd as td, MotionText as text, MotionTextPath as textPath, MotionTextarea as textarea, MotionTfoot as tfoot, MotionTh as th, MotionThead as thead, MotionTime as time, MotionTitle as title, MotionTr as tr, MotionTrack as track, MotionTspan as tspan, MotionU as u, MotionUl as ul, MotionUse as use, MotionVideo as video, MotionView as view, MotionWbr as wbr, MotionWebview as webview }; diff --git a/node_modules/framer-motion/dist/mini.d.ts b/node_modules/framer-motion/dist/mini.d.ts new file mode 100644 index 0000000..0c2d756 --- /dev/null +++ b/node_modules/framer-motion/dist/mini.d.ts @@ -0,0 +1,6 @@ +import * as motion_dom from 'motion-dom'; +import { AnimationScope } from 'motion-dom'; + +declare function useAnimateMini(): [AnimationScope, (elementOrSelector: motion_dom.ElementOrSelector, keyframes: motion_dom.DOMKeyframesDefinition, options?: motion_dom.AnimationOptions | undefined) => motion_dom.AnimationPlaybackControlsWithThen]; + +export { useAnimateMini as useAnimate }; diff --git a/node_modules/framer-motion/dist/mini.js b/node_modules/framer-motion/dist/mini.js new file mode 100644 index 0000000..ed7ee2e --- /dev/null +++ b/node_modules/framer-motion/dist/mini.js @@ -0,0 +1 @@ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Motion={},t.React)}(this,function(t,e){"use strict";function n(t){const n=e.useRef(null);return null===n.current&&(n.current=t()),n.current}let i=()=>{};"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(i=(t,e,n)=>{if(!t)throw new Error(function(t,e){return e?`${t}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:t}(e,n))});const s=t=>t,a=t=>1e3*t,o=t=>t/1e3,r=t=>null!==t;class l{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}function u(t){for(let e=1;et.startsWith("--");const d={};function m(t,e){const n=function(t){let e;return()=>(void 0===e&&(e=t()),e)}(t);return()=>d[e]??n()}const c=m(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),p=m(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),f=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,g={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:f([0,.65,.55,1]),circOut:f([.55,0,1,.45]),backIn:f([.31,.01,.66,-.59]),backOut:f([.33,1.53,.69,.99])};function y(t,e){return t?"function"==typeof t?p()?((t,e,n=10)=>{let i="";const s=Math.max(Math.round(e/n),2);for(let e=0;eArray.isArray(t)&&"number"==typeof t[0])(t)?f(t):Array.isArray(t)?t.map(t=>y(t,e)||g.easeOut):g[t]:void 0}class T extends l{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:e,name:n,keyframes:s,pseudoElement:a,allowFlatten:o=!1,finalKeyframe:l,onComplete:u}=t;this.isPseudoElement=Boolean(a),this.allowFlatten=o,this.options=t,i("string"!=typeof t.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const d=function({type:t,...e}){return function(t){return"function"==typeof t&&"applyToOptions"in t}(t)&&p()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=function(t,e,n,{delay:i=0,duration:s=300,repeat:a=0,repeatType:o="loop",ease:r="easeOut",times:l}={},u){const h={[e]:n};l&&(h.offset=l);const d=y(r,s);Array.isArray(d)&&(h.easing=d);const m={delay:i,duration:s,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:a+1,direction:"reverse"===o?"alternate":"normal"};return u&&(m.pseudoElement=u),t.animate(h,m)}(e,n,s,d,a),!1===d.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!a){const t=function(t,{repeat:e,repeatType:n="loop"},i,s=1){const a=t.filter(r),o=s<0||e&&"loop"!==n&&e%2==1?0:a.length-1;return o&&void 0!==i?i:a[o]}(s,this.options,l,this.speed);this.updateMotionValue&&this.updateMotionValue(t),function(t,e,n){h(e)?t.style.setProperty(e,n):t.style[e]=n}(e,n,t),this.animation.cancel()}u?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return o(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+o(t)}get time(){return o(Number(this.animation.currentTime)||0)}set time(t){const e=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=a(t),e&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:e,rangeEnd:n,observe:i}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&c()?(this.animation.timeline=t,e&&(this.animation.rangeStart=e),n&&(this.animation.rangeEnd=n),s):i(this)}}class b{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;ne.attachTimeline(t));return()=>{e.forEach((t,e)=>{t&&t(),this.animations[e].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return A(this.animations,"duration")}get iterationDuration(){return A(this.animations,"iterationDuration")}runAll(t){this.animations.forEach(e=>e[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function A(t,e){let n=0;for(let i=0;in&&(n=s)}return n}class S extends b{then(t,e){return this.finished.finally(t).then(()=>{})}}const E=new WeakMap,k=(t,e="")=>`${t}:${e}`;function v(t){let e=E.get(t);return e||(e=new Map,E.set(t,e)),e}function w(t,e){const n=t?.[e]??t?.default??t;return n!==t?function(t,e){if(t?.inherit&&e){const{inherit:n,...i}=t;return{...e,...i}}return t}(n,t):n}const B=new Set(["borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","width","maxWidth","height","maxHeight","top","right","bottom","left","inset","insetBlock","insetBlockStart","insetBlockEnd","insetInline","insetInlineStart","insetInlineEnd","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingBlock","paddingBlockStart","paddingBlockEnd","paddingInline","paddingInlineStart","paddingInlineEnd","margin","marginTop","marginRight","marginBottom","marginLeft","marginBlock","marginBlockStart","marginBlockEnd","marginInline","marginInlineStart","marginInlineEnd","fontSize","backgroundPositionX","backgroundPositionY"]);function R(t,e){for(let n=0;nnull!=t)}(t,s),r=o.length;i(Boolean(r),"No valid elements provided.","no-valid-elements");const l=[];for(let t=0;te.delete(n)),h.push(s)}return h}t.useAnimate=function(){const t=n(()=>({current:null,animations:[]})),i=n(()=>(t=>function(e,n,i){return new S(M(e,n,i,t))})(t));var s;return s=()=>{t.animations.forEach(t=>t.stop())},e.useEffect(()=>()=>s(),[]),[t,i]}}); diff --git a/node_modules/framer-motion/dist/projection.d.ts b/node_modules/framer-motion/dist/projection.d.ts new file mode 100644 index 0000000..32faa61 --- /dev/null +++ b/node_modules/framer-motion/dist/projection.d.ts @@ -0,0 +1 @@ +export { HTMLProjectionNode, HTMLVisualElement, addScaleCorrector, buildTransform, calcBoxDelta, correctBorderRadius, correctBoxShadow, frame, frameData, mix, nodeGroup, recordStats, statsBuffer } from 'motion-dom'; diff --git a/node_modules/framer-motion/dist/size-rollup-animate.js b/node_modules/framer-motion/dist/size-rollup-animate.js new file mode 100644 index 0000000..9d6af59 --- /dev/null +++ b/node_modules/framer-motion/dist/size-rollup-animate.js @@ -0,0 +1,2 @@ +function t(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const e=(t,e,n)=>n>e?e:n{},i=()=>{};"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(s=(t,e,s)=>{t||"undefined"==typeof console||console.warn(n(e,s))},i=(t,e,s)=>{if(!t)throw new Error(n(e,s))});const r={},a=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),o=t=>/^0[^.\s]+$/u.test(t);function l(t){let e;return()=>(void 0===e&&(e=t()),e)}const u=t=>t,h=(...t)=>t.reduce((t,e)=>n=>e(t(n))),c=(t,e,n)=>{const s=e-t;return s?(n-t)/s:1};class d{constructor(){this.subscriptions=[]}add(e){var n,s;return n=this.subscriptions,s=e,-1===n.indexOf(s)&&n.push(s),()=>t(this.subscriptions,e)}notify(t,e,n){const s=this.subscriptions.length;if(s)if(1===s)this.subscriptions[0](t,e,n);else for(let i=0;i1e3*t,m=t=>t/1e3,f=(t,e)=>e?t*(1e3/e):0,g=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function y(t,e,n,s){if(t===e&&n===s)return u;const i=e=>function(t,e,n,s,i){let r,a,o=0;do{a=e+(n-e)/2,r=g(a,s,i)-t,r>0?n=a:e=a}while(Math.abs(r)>1e-7&&++o<12);return a}(e,0,1,t,n);return t=>0===t||1===t?t:g(i(t),e,s)}const v=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,b=t=>e=>1-t(1-e),T=y(.33,1.53,.69,.99),w=b(T),M=v(w),S=t=>t>=1?1:(t*=2)<1?.5*w(t):.5*(2-Math.pow(2,-10*(t-1))),x=t=>1-Math.sin(Math.acos(t)),A=b(x),k=v(x),V=y(.42,0,1,1),C=y(0,0,.58,1),F=y(.42,0,.58,1),P=t=>Array.isArray(t)&&"number"!=typeof t[0];function R(t,e){return P(t)?t[((t,e,n)=>{const s=e-t;return((n-t)%s+s)%s+t})(0,t.length,e)]:t}const E=t=>Array.isArray(t)&&"number"==typeof t[0],B={linear:u,easeIn:V,easeInOut:F,easeOut:C,circIn:x,circInOut:k,circOut:A,backIn:w,backInOut:M,backOut:T,anticipate:S},D=t=>{if(E(t)){i(4===t.length,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[e,n,s,r]=t;return y(e,n,s,r)}return"string"==typeof t?(i(void 0!==B[t],`Invalid easing type '${t}'`,"invalid-easing-type"),B[t]):t},I=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function O(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=I.reduce((t,e)=>(t[e]=function(t){let e=new Set,n=new Set,s=!1,i=!1;const r=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function o(e){r.has(e)&&(l.schedule(e),t()),e(a)}const l={schedule:(t,i=!1,a=!1)=>{const o=a&&s?e:n;return i&&r.add(t),o.add(t),t},cancel:t=>{n.delete(t),r.delete(t)},process:t=>{if(a=t,s)return void(i=!0);s=!0;const r=e;e=n,n=r,e.forEach(o),e.clear(),s=!1,i&&(i=!1,l.process(t))}};return l}(a),t),{}),{setup:l,read:u,resolveKeyframes:h,preUpdate:c,update:d,preRender:p,render:m,postRender:f}=o,g=()=>{const a=r.useManualTiming,o=a?i.timestamp:performance.now();n=!1,a||(i.delta=s?1e3/60:Math.max(Math.min(o-i.timestamp,40),1)),i.timestamp=o,i.isProcessing=!0,l.process(i),u.process(i),h.process(i),c.process(i),d.process(i),p.process(i),m.process(i),f.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(g))};return{schedule:I.reduce((e,r)=>{const a=o[r];return e[r]=(e,r=!1,o=!1)=>(n||(n=!0,s=!0,i.isProcessing||t(g)),a.schedule(e,r,o)),e},{}),cancel:t=>{for(let e=0;e(void 0===j&&L.set(K.isProcessing||r.useManualTiming?K.timestamp:performance.now()),j),set:t=>{j=t,queueMicrotask(W)}},Y=t=>e=>"string"==typeof e&&e.startsWith(t),U=Y("--"),X=Y("var(--"),q=t=>!!X(t)&&z.test(t.split("/*")[0].trim()),z=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Z(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const _={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},G={..._,transform:t=>e(0,1,t)},H={..._,default:1},J=t=>Math.round(1e5*t)/1e5,Q=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const tt=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,et=(t,e)=>n=>Boolean("string"==typeof n&&tt.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),nt=(t,e,n)=>s=>{if("string"!=typeof s)return s;const[i,r,a,o]=s.match(Q);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(a),alpha:void 0!==o?parseFloat(o):1}},st={..._,transform:t=>Math.round((t=>e(0,255,t))(t))},it={test:et("rgb","red"),parse:nt("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+st.transform(t)+", "+st.transform(e)+", "+st.transform(n)+", "+J(G.transform(s))+")"};const rt={test:et("#"),parse:function(t){let e="",n="",s="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,s+=s,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}},transform:it.transform},at=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),ot=at("deg"),lt=at("%"),ut=at("px"),ht=at("vh"),ct=at("vw"),dt=(()=>({...lt,parse:t=>lt.parse(t)/100,transform:t=>lt.transform(100*t)}))(),pt={test:et("hsl","hue"),parse:nt("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+lt.transform(J(e))+", "+lt.transform(J(n))+", "+J(G.transform(s))+")"},mt={test:t=>it.test(t)||rt.test(t)||pt.test(t),parse:t=>it.test(t)?it.parse(t):pt.test(t)?pt.parse(t):rt.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?it.transform(t):pt.transform(t),getAnimatableNone:t=>{const e=mt.parse(t);return e.alpha=0,mt.transform(e)}},ft=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const gt="number",yt="color",vt=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function bt(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let r=0;const a=e.replace(vt,t=>(mt.test(t)?(s.color.push(r),i.push(yt),n.push(mt.parse(t))):t.startsWith("var(")?(s.var.push(r),i.push("var"),n.push(t)):(s.number.push(r),i.push(gt),n.push(parseFloat(t))),++r,"${}")).split("${}");return{values:n,split:a,indexes:s,types:i}}function Tt({split:t,types:e}){const n=t.length;return s=>{let i="";for(let r=0;r{return"number"==typeof t?e?.trim().endsWith("/")?t:0:"number"==typeof(n=t)?0:mt.test(n)?mt.getAnimatableNone(n):n;var n};const Mt={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(Q)?.length||0)+(t.match(ft)?.length||0)>0},parse:function(t){return bt(t).values},createTransformer:function(t){return Tt(bt(t))},getAnimatableNone:function(t){const e=bt(t);return Tt(e)(e.values.map((t,n)=>wt(t,e.split[n])))}};function St(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function xt(t,e){return n=>n>0?e:t}const At=(t,e,n)=>t+(e-t)*n,kt=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},Vt=[rt,it,pt];function Ct(t){const e=(n=t,Vt.find(t=>t.test(n)));var n;if(s(Boolean(e),`'${t}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!Boolean(e))return!1;let i=e.parse(t);return e===pt&&(i=function({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,n/=100;let i=0,r=0,a=0;if(e/=100){const s=n<.5?n*(1+e):n+e-n*e,o=2*n-s;i=St(o,s,t+1/3),r=St(o,s,t),a=St(o,s,t-1/3)}else i=r=a=n;return{red:Math.round(255*i),green:Math.round(255*r),blue:Math.round(255*a),alpha:s}}(i)),i}const Ft=(t,e)=>{const n=Ct(t),s=Ct(e);if(!n||!s)return xt(t,e);const i={...n};return t=>(i.red=kt(n.red,s.red,t),i.green=kt(n.green,s.green,t),i.blue=kt(n.blue,s.blue,t),i.alpha=At(n.alpha,s.alpha,t),it.transform(i))},Pt=new Set(["none","hidden"]);function Rt(t,e){return n=>At(t,e,n)}function Et(t){return"number"==typeof t?Rt:"string"==typeof t?q(t)?xt:mt.test(t)?Ft:It:Array.isArray(t)?Bt:"object"==typeof t?mt.test(t)?Ft:Dt:xt}function Bt(t,e){const n=[...t],s=n.length,i=t.map((t,n)=>Et(t)(t,e[n]));return t=>{for(let e=0;e{for(const e in s)n[e]=s[e](t);return n}}const It=(t,e)=>{const n=Mt.createTransformer(e),i=bt(t),r=bt(e);return i.indexes.var.length===r.indexes.var.length&&i.indexes.color.length===r.indexes.color.length&&i.indexes.number.length>=r.indexes.number.length?Pt.has(t)&&!r.values.length||Pt.has(e)&&!i.values.length?function(t,e){return Pt.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):h(Bt(function(t,e){const n=[],s={color:0,var:0,number:0};for(let i=0;i{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>N.update(e,t),stop:()=>$(e),now:()=>K.isProcessing?K.timestamp:L.now()}},$t=(t,e,n=10)=>{let s="";const i=Math.max(Math.round(e/n),2);for(let e=0;e=Kt?1/0:e}function Wt(t,e=100,n){const s=n({...t,keyframes:[0,e]}),i=Math.min(jt(s),Kt);return{type:"keyframes",ease:t=>s.next(i*t).value/e,duration:m(i)}}const Lt=100,Yt=10,Ut=1,Xt=0,qt=800,zt=.3,Zt=.3,_t={granular:.01,default:2},Gt={granular:.005,default:.5},Ht=.01,Jt=10,Qt=.05,te=1;function ee(t,e){return t*Math.sqrt(1-e*e)}const ne=.001;const se=["duration","bounce"],ie=["stiffness","damping","mass"];function re(t,e){return e.some(e=>void 0!==t[e])}function ae(t){let n={velocity:Xt,stiffness:Lt,damping:Yt,mass:Ut,isResolvedFromDuration:!1,...t};if(!re(t,ie)&&re(t,se))if(n.velocity=0,t.visualDuration){const s=t.visualDuration,i=2*Math.PI/(1.2*s),r=i*i,a=2*e(.05,1,1-(t.bounce||0))*Math.sqrt(r);n={...n,mass:Ut,stiffness:r,damping:a}}else{const i=function({duration:t=qt,bounce:n=zt,velocity:i=Xt,mass:r=Ut}){let a,o;s(t<=p(Jt),"Spring duration must be 10 seconds or less","spring-duration-limit");let l=1-n;l=e(Qt,te,l),t=e(Ht,Jt,m(t)),l<1?(a=e=>{const n=e*l,s=n*t,r=n-i,a=ee(e,l),o=Math.exp(-s);return ne-r/a*o},o=e=>{const n=e*l*t,s=n*i+i,r=Math.pow(l,2)*Math.pow(e,2)*t,o=Math.exp(-n),u=ee(Math.pow(e,2),l);return(-a(e)+ne>0?-1:1)*((s-r)*o)/u}):(a=e=>Math.exp(-e*t)*((e-i)*t+1)-.001,o=e=>Math.exp(-e*t)*(t*t*(i-e)));const u=function(t,e,n){let s=n;for(let n=1;n<12;n++)s-=t(s)/e(s);return s}(a,o,5/t);if(t=p(t),isNaN(u))return{stiffness:Lt,damping:Yt,duration:t};{const e=Math.pow(u,2)*r;return{stiffness:e,damping:2*l*Math.sqrt(r*e),duration:t}}}({...t,velocity:0});n={...n,...i,mass:Ut},n.isResolvedFromDuration=!0}return n}function oe(t=Zt,e=zt){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:i}=n;const r=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],o={done:!1,value:r},{stiffness:l,damping:u,mass:h,duration:c,velocity:d,isResolvedFromDuration:f}=ae({...n,velocity:-m(n.velocity||0)}),g=d||0,y=u/(2*Math.sqrt(l*h)),v=a-r,b=m(Math.sqrt(l/h)),T=Math.abs(v)<5;let w,M,S,x,A,k;if(s||(s=T?_t.granular:_t.default),i||(i=T?Gt.granular:Gt.default),y<1)S=ee(b,y),x=(g+y*b*v)/S,w=t=>{const e=Math.exp(-y*b*t);return a-e*(x*Math.sin(S*t)+v*Math.cos(S*t))},A=y*b*x+v*S,k=y*b*v-x*S,M=t=>Math.exp(-y*b*t)*(A*Math.sin(S*t)+k*Math.cos(S*t));else if(1===y){w=t=>a-Math.exp(-b*t)*(v+(g+b*v)*t);const t=g+b*v;M=e=>Math.exp(-b*e)*(b*t*e-g)}else{const t=b*Math.sqrt(y*y-1);w=e=>{const n=Math.exp(-y*b*e),s=Math.min(t*e,300);return a-n*((g+y*b*v)*Math.sinh(s)+t*v*Math.cosh(s))/t};const e=(g+y*b*v)/t,n=y*b*e-v*t,s=y*b*v-e*t;M=e=>{const i=Math.exp(-y*b*e),r=Math.min(t*e,300);return i*(n*Math.sinh(r)+s*Math.cosh(r))}}const V={calculatedDuration:f&&c||null,velocity:t=>p(M(t)),next:t=>{if(!f&&y<1){const e=Math.exp(-y*b*t),n=Math.sin(S*t),r=Math.cos(S*t),l=a-e*(x*n+v*r),u=p(e*(A*n+k*r));return o.done=Math.abs(u)<=s&&Math.abs(a-l)<=i,o.value=o.done?a:l,o}const e=w(t);if(f)o.done=t>=c;else{const n=p(M(t));o.done=Math.abs(n)<=s&&Math.abs(a-e)<=i}return o.value=o.done?a:e,o},toString:()=>{const t=Math.min(jt(V),Kt),e=$t(e=>V.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return V}oe.applyToOptions=t=>{const e=Wt(t,100,oe);return t.ease=e.ease,t.duration=p(e.duration),t.type="keyframes",t};function le(t,e,n){const s=Math.max(e-5,0);return f(n-t(s),e-s)}function ue({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:r=500,modifyTarget:a,min:o,max:l,restDelta:u=.5,restSpeed:h}){const c=t[0],d={done:!1,value:c},p=t=>void 0===o?l:void 0===l||Math.abs(o-t)-m*Math.exp(-t/s),v=t=>g+y(t),b=t=>{const e=y(t),n=v(t);d.done=Math.abs(e)<=u,d.value=d.done?g:n};let T,w;const M=t=>{var e;(e=d.value,void 0!==o&&el)&&(T=t,w=oe({keyframes:[d.value,p(d.value)],velocity:le(v,t,d.value),damping:i,stiffness:r,restDelta:u,restSpeed:h}))};return M(0),{calculatedDuration:null,next:t=>{let e=!1;return w||void 0!==T||(e=!0,b(t),M(t)),void 0!==T&&t>=T?w.next(t-T):(!e&&b(t),d)}}}function he(t,n,{clamp:s=!0,ease:a,mixer:o}={}){const l=t.length;if(i(l===n.length,"Both input and output ranges must be the same length","range-length"),1===l)return()=>n[0];if(2===l&&n[0]===n[1])return()=>n[1];const d=t[0]===t[1];t[0]>t[l-1]&&(t=[...t].reverse(),n=[...n].reverse());const p=function(t,e,n){const s=[],i=n||r.mix||Ot,a=t.length-1;for(let n=0;n{if(d&&e1)for(;sf(e(t[0],t[l-1],n)):f}function ce(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=c(0,e,s);t.push(At(n,1,i))}}function de(t){const e=[0];return ce(e,t.length-1),e}function pe({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=P(s)?s.map(D):D(s),r={done:!1,value:e[0]},a=function(t,e){return t.map(t=>t*e)}(n&&n.length===e.length?n:de(e),t),o=he(a,e,{ease:Array.isArray(i)?i:(l=e,u=i,l.map(()=>u||F).splice(0,l.length-1))});var l,u;return{calculatedDuration:t,next:e=>(r.value=o(e),r.done=e>=t,r)}}const me=t=>null!==t;function fe(t,{repeat:e,repeatType:n="loop"},s,i=1){const r=t.filter(me),a=i<0||e&&"loop"!==n&&e%2==1?0:r.length-1;return a&&void 0!==s?s:r[a]}const ge={decay:ue,inertia:ue,tween:pe,keyframes:pe,spring:oe};function ye(t){"string"==typeof t.type&&(t.type=ge[t.type])}class ve{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const be=t=>t/100;class Te extends ve{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:t}=this.options;t&&t.updatedAt!==L.now()&&this.tick(L.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;ye(t);const{type:e=pe,repeat:n=0,repeatDelay:s=0,repeatType:i,velocity:r=0}=t;let{keyframes:a}=t;const o=e||pe;o!==pe&&"number"!=typeof a[0]&&(this.mixKeyframes=h(be,Ot(a[0],a[1])),a=[0,100]);const l=o({...t,keyframes:a});"mirror"===i&&(this.mirroredGenerator=o({...t,keyframes:[...a].reverse(),velocity:-r})),null===l.calculatedDuration&&(l.calculatedDuration=jt(l));const{calculatedDuration:u}=l;this.calculatedDuration=u,this.resolvedDuration=u+s,this.totalDuration=this.resolvedDuration*(n+1)-s,this.generator=l}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,n=!1){const{generator:s,totalDuration:i,mixKeyframes:r,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:l}=this;if(null===this.startTime)return s.next(0);const{delay:u=0,keyframes:h,repeat:c,repeatType:d,repeatDelay:p,type:m,onUpdate:f,finalKeyframe:g}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const y=this.currentTime-u*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?y<0:y>i;this.currentTime=Math.max(y,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=i);let b,T=this.currentTime,w=s;if(c){const t=Math.min(this.currentTime,i)/o;let n=Math.floor(t),s=t%1;!s&&t>=1&&(s=1),1===s&&n--,n=Math.min(n,c+1);Boolean(n%2)&&("reverse"===d?(s=1-s,p&&(s-=p/o)):"mirror"===d&&(w=a)),T=e(0,1,s)*o}v?(this.delayState.value=h[0],b=this.delayState):b=w.next(T),r&&!v&&(b.value=r(b.value));let{done:M}=b;v||null===l||(M=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const S=null===this.holdTime&&("finished"===this.state||"running"===this.state&&M);return S&&m!==ue&&(b.value=fe(h,this.options,g,this.speed)),f&&f(b.value),S&&this.finish(),b}then(t,e){return this.finished.then(t,e)}get duration(){return m(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+m(t)}get time(){return m(this.currentTime)}set time(t){t=p(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);return le(t=>this.generator.next(t).value,t,this.generator.next(t).value)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;e&&this.driver&&this.updateTime(L.now()),this.playbackSpeed=t,e&&this.driver&&(this.time=m(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=Nt,startTime:e}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),this.options.onPlay?.();const n=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=n):null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime||(this.startTime=e??n),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(L.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}const we=t=>180*t/Math.PI,Me=t=>{const e=we(Math.atan2(t[1],t[0]));return xe(e)},Se={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Me,rotateZ:Me,skewX:t=>we(Math.atan(t[1])),skewY:t=>we(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},xe=t=>((t%=360)<0&&(t+=360),t),Ae=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),ke=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Ve={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Ae,scaleY:ke,scale:t=>(Ae(t)+ke(t))/2,rotateX:t=>xe(we(Math.atan2(t[6],t[5]))),rotateY:t=>xe(we(Math.atan2(-t[2],t[0]))),rotateZ:Me,rotate:Me,skewX:t=>we(Math.atan(t[4])),skewY:t=>we(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Ce(t){return t.includes("scale")?1:0}function Fe(t,e){if(!t||"none"===t)return Ce(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=Ve,i=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=Se,i=e}if(!i)return Ce(e);const r=s[e],a=i[1].split(",").map(Pe);return"function"==typeof r?r(a):a[r]}function Pe(t){return parseFloat(t.trim())}const Re=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ee=(()=>new Set([...Re,"pathRotation"]))(),Be=t=>t===_||t===ut,De=new Set(["x","y","z"]),Ie=Re.filter(t=>!De.has(t));const Oe={width:({x:t},{paddingLeft:e="0",paddingRight:n="0",boxSizing:s})=>{const i=t.max-t.min;return"border-box"===s?i:i-parseFloat(e)-parseFloat(n)},height:({y:t},{paddingTop:e="0",paddingBottom:n="0",boxSizing:s})=>{const i=t.max-t.min;return"border-box"===s?i:i-parseFloat(e)-parseFloat(n)},top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>Fe(e,"x"),y:(t,{transform:e})=>Fe(e,"y")};Oe.translateX=Oe.x,Oe.translateY=Oe.y;const Ne=new Set;let $e=!1,Ke=!1,je=!1;function We(){if(Ke){const t=Array.from(Ne).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),n=new Map;e.forEach(t=>{const e=function(t){const e=[];return Ie.forEach(n=>{const s=t.getValue(n);void 0!==s&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e}(t);e.length&&(n.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=n.get(t);e&&e.forEach(([e,n])=>{t.getValue(e)?.set(n)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}Ke=!1,$e=!1,Ne.forEach(t=>t.complete(je)),Ne.clear()}function Le(){Ne.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Ke=!0)})}class Ye{constructor(t,e,n,s,i,r=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=s,this.element=i,this.isAsync=r}scheduleResolve(){this.state="scheduled",this.isAsync?(Ne.add(this),$e||($e=!0,N.read(Le),N.resolveKeyframes(We))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:s}=this;if(null===t[0]){const i=s?.get(),r=t[t.length-1];if(void 0!==i)t[0]=i;else if(n&&e){const s=n.readValue(e,r);null!=s&&(t[0]=s)}void 0===t[0]&&(t[0]=r),s&&void 0===i&&s.set(t[0])}!function(t){for(let e=1;et.startsWith("--"))(e)?t.style.setProperty(e,n):t.style[e]=n}const Xe={};function qe(t,e){const n=l(t);return()=>Xe[e]??n()}const ze=qe(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),Ze=qe(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),_e=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,Ge={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:_e([0,.65,.55,1]),circOut:_e([.55,0,1,.45]),backIn:_e([.31,.01,.66,-.59]),backOut:_e([.33,1.53,.69,.99])};function He(t,e){return t?"function"==typeof t?Ze()?$t(t,e):"ease-out":E(t)?_e(t):Array.isArray(t)?t.map(t=>He(t,e)||Ge.easeOut):Ge[t]:void 0}function Je(t,e,n,{delay:s=0,duration:i=300,repeat:r=0,repeatType:a="loop",ease:o="easeOut",times:l}={},u=void 0){const h={[e]:n};l&&(h.offset=l);const c=He(o,i);Array.isArray(c)&&(h.easing=c);const d={delay:s,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:r+1,direction:"reverse"===a?"alternate":"normal"};return u&&(d.pseudoElement=u),t.animate(h,d)}function Qe(t){return"function"==typeof t&&"applyToOptions"in t}class tn extends ve{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:e,name:n,keyframes:s,pseudoElement:r,allowFlatten:a=!1,finalKeyframe:o,onComplete:l}=t;this.isPseudoElement=Boolean(r),this.allowFlatten=a,this.options=t,i("string"!=typeof t.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const u=function({type:t,...e}){return Qe(t)&&Ze()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=Je(e,n,s,u,r),!1===u.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!r){const t=fe(s,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(t),Ue(e,n,t),this.animation.cancel()}l?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return m(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+m(t)}get time(){return m(Number(this.animation.currentTime)||0)}set time(t){const e=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=p(t),e&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:e,rangeEnd:n,observe:s}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&ze()?(this.animation.timeline=t,e&&(this.animation.rangeStart=e),n&&(this.animation.rangeEnd=n),u):s(this)}}const en={anticipate:S,backInOut:M,circInOut:k};function nn(t){"string"==typeof t.ease&&t.ease in en&&(t.ease=en[t.ease])}class sn extends tn{constructor(t){nn(t),ye(t),super(t),void 0!==t.startTime&&!1!==t.autoplay&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:s,onComplete:i,element:r,...a}=this.options;if(!n)return;if(void 0!==t)return void n.set(t);const o=new Te({...a,autoplay:!1}),l=Math.max(10,L.now()-this.startTime),u=e(0,10,l-10),h=o.sample(l).value,{name:c}=this.options;r&&c&&Ue(r,c,h),n.setWithVelocity(o.sample(Math.max(0,l-u)).value,h,u),o.stop()}}const rn=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Mt.test(t)&&"0"!==t||t.startsWith("url(")));function an(t){t.duration=0,t.type="keyframes"}const on=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),ln=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;const un=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),hn=l(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function cn(t){const{motionValue:e,name:n,repeatDelay:s,repeatType:i,damping:r,type:a,keyframes:o}=t,l=e?.owner?.current;if(!(l instanceof HTMLElement||l instanceof SVGElement))return!1;const{onUpdate:u,transformTemplate:h}=e.owner.getProps();return hn()&&n&&(on.has(n)||un.has(n)&&function(t){for(let e=0;e{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=L.now();const c={autoplay:t,delay:e,type:n,repeat:s,repeatDelay:i,repeatType:r,name:o,motionValue:l,element:u,...h},d=u?.KeyframeResolver||Ye;this.keyframeResolver=new d(a,(t,e,n)=>this.onKeyframesResolved(t,e,c,!n),o,l,u),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,e,n,i){this.keyframeResolver=void 0;const{name:a,type:o,velocity:l,delay:h,isHandoff:c,onUpdate:d}=n;this.resolvedAt=L.now();let p=!0;(function(t,e,n,i){const r=t[0];if(null===r)return!1;if("display"===e||"visibility"===e)return!0;const a=t[t.length-1],o=rn(r,e),l=rn(a,e);return s(o===l,`You are trying to animate ${e} from "${r}" to "${a}". "${o?a:r}" is not an animatable value.`,"value-not-animatable"),!(!o||!l)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:e,...n,keyframes:t},f=p&&!c&&cn(m),g=m.motionValue?.owner?.current;let y;if(f)try{y=new sn({...m,element:g})}catch{y=new Te(m)}else y=new Te(m);y.finished.then(()=>{this.notifyFinished()}).catch(u),this.pendingTimeline&&(this.stopTimeline=y.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=y}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),je=!0,Le(),We(),je=!1),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}class pn{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;ne.attachTimeline(t));return()=>{e.forEach((t,e)=>{t&&t(),this.animations[e].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return mn(this.animations,"duration")}get iterationDuration(){return mn(this.animations,"iterationDuration")}runAll(t){this.animations.forEach(e=>e[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function mn(t,e){let n=0;for(let s=0;sn&&(n=i)}return n}class fn extends pn{then(t,e){return this.finished.finally(t).then(()=>{})}}class gn{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=L.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=L.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new d);const n=this.events[t].add(e);return"change"===t?()=>{n(),N.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=L.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return f(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function yn(t,e){return new gn(t,e)}function vn(t,e){if(t?.inherit&&e){const{inherit:n,...s}=t;return{...e,...s}}return t}function bn(t,e){const n=t?.[e]??t?.default??t;return n!==t?vn(n,t):n}const Tn={type:"spring",stiffness:500,damping:25,restSpeed:10},wn={type:"keyframes",duration:.8},Mn={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Sn=(t,{keyframes:e})=>e.length>2?wn:Ee.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:Tn:Mn,xn=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);const An=(t,e,n,s={},i,a)=>o=>{const l=bn(s,t)||{},u=l.delay||s.delay||0;let{elapsed:h=0}=s;h-=p(u);const c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...l,delay:-h,onUpdate:t=>{e.set(t),l.onUpdate&&l.onUpdate(t)},onComplete:()=>{o(),l.onComplete&&l.onComplete()},name:t,motionValue:e,element:a?void 0:i};(function(t){for(const e in t)if(!xn.has(e))return!0;return!1})(l)||Object.assign(c,Sn(t,c)),c.duration&&(c.duration=p(c.duration)),c.repeatDelay&&(c.repeatDelay=p(c.repeatDelay)),void 0!==c.from&&(c.keyframes[0]=c.from);let d=!1;if((!1===c.type||0===c.duration&&!c.repeatDelay)&&(an(c),0===c.delay&&(d=!0)),(r.instantAnimations||r.skipAnimations||i?.shouldSkipAnimations||l.skipAnimations)&&(d=!0,an(c),c.delay=0),c.allowFlatten=!l.type&&!l.ease,d&&!a&&void 0!==e.get()){const t=fe(c.keyframes,l);if(void 0!==t)return void N.update(()=>{c.onUpdate(t),c.onComplete()})}return l.isSync?new Te(c):new dn(c)},kn=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Vn(t,e,n=1){i(n<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[s,r]=function(t){const e=kn.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}(t);if(!s)return;const o=window.getComputedStyle(e).getPropertyValue(s);if(o){const t=o.trim();return a(t)?parseFloat(t):t}return q(r)?Vn(r,e,n+1):r}function Cn(t){const e=[{},{}];return t?.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}function Fn(t,e,n,s){if("function"==typeof e){const[i,r]=Cn(s);e=e(void 0!==n?n:t.custom,i,r)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[i,r]=Cn(s);e=e(void 0!==n?n:t.custom,i,r)}return e}const Pn=new Set(["width","height","top","left","right","bottom",...Re]);function Rn(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,yn(n))}function En(t){return(t=>Array.isArray(t))(t)?t[t.length-1]||0:t}function Bn(t,e){const n=function(t,e){const n=t.getProps();return Fn(n,e,n.custom,t)}(t,e);let{transitionEnd:s={},transition:i={},...r}=n||{};r={...r,...s};for(const e in r){Rn(t,e,En(r[e]))}}const Dn=t=>Boolean(t&&t.getVelocity);function In(t,e){const n=t.getValue("willChange");if(s=n,Boolean(Dn(s)&&s.add))return n.add(e);if(!n&&r.WillChange){const n=new r.WillChange("auto");t.addValue("willChange",n),n.add(e)}var s}function On(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const Nn="data-"+On("framerAppearId");function $n(t){return t.props[Nn]}function Kn({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,s}function jn(t,e,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:r,transitionEnd:a,...o}=e;const l=t.getDefaultTransition();r=r?vn(r,l):l;const u=r?.reduceMotion,h=r?.skipAnimations;s&&(r=s);const c=[],d=i&&t.animationState&&t.animationState.getState()[i],p=r?.path;p&&p.animateVisualElement(t,o,r,n,c);for(const e in o){const s=t.getValue(e,t.latestValues[e]??null),i=o[e];if(void 0===i||d&&Kn(d,e))continue;const a={delay:n,...bn(r||{},e)};h&&(a.skipAnimations=!0);const l=s.get();if(void 0!==l&&!s.isAnimating()&&!Array.isArray(i)&&i===l&&!a.velocity){N.update(()=>s.set(i));continue}let p=!1;if(window.MotionHandoffAnimation){const n=$n(t);if(n){const t=window.MotionHandoffAnimation(n,e,N);null!==t&&(a.startTime=t,p=!0)}}In(t,e);const m=u??t.shouldReduceMotion;s.start(An(e,s,i,m&&Pn.has(e)?{type:!1}:a,t,p));const f=s.animation;f&&c.push(f)}if(a){const e=()=>N.update(()=>{a&&Bn(t,a)});c.length?Promise.all(c).then(e):e()}return c}const Wn=t=>e=>e.test(t),Ln=[_,ut,lt,ot,ct,ht,{test:t=>"auto"===t,parse:t=>t}],Yn=t=>Ln.find(Wn(t));function Un(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||o(t))}const Xn=new Set(["brightness","contrast","saturate","opacity"]);function qn(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[s]=n.match(Q)||[];if(!s)return t;const i=n.replace(s,"");let r=Xn.has(e)?1:0;return s!==n&&(r*=100),e+"("+r+i+")"}const zn=/\b([a-z-]*)\(.*?\)/gu,Zn={...Mt,getAnimatableNone:t=>{const e=t.match(zn);return e?e.map(qn).join(" "):t}},_n={...Mt,getAnimatableNone:t=>{const e=Mt.parse(t);return Mt.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},Gn={..._,transform:Math.round},Hn={borderWidth:ut,borderTopWidth:ut,borderRightWidth:ut,borderBottomWidth:ut,borderLeftWidth:ut,borderRadius:ut,borderTopLeftRadius:ut,borderTopRightRadius:ut,borderBottomRightRadius:ut,borderBottomLeftRadius:ut,width:ut,maxWidth:ut,height:ut,maxHeight:ut,top:ut,right:ut,bottom:ut,left:ut,inset:ut,insetBlock:ut,insetBlockStart:ut,insetBlockEnd:ut,insetInline:ut,insetInlineStart:ut,insetInlineEnd:ut,padding:ut,paddingTop:ut,paddingRight:ut,paddingBottom:ut,paddingLeft:ut,paddingBlock:ut,paddingBlockStart:ut,paddingBlockEnd:ut,paddingInline:ut,paddingInlineStart:ut,paddingInlineEnd:ut,margin:ut,marginTop:ut,marginRight:ut,marginBottom:ut,marginLeft:ut,marginBlock:ut,marginBlockStart:ut,marginBlockEnd:ut,marginInline:ut,marginInlineStart:ut,marginInlineEnd:ut,fontSize:ut,backgroundPositionX:ut,backgroundPositionY:ut,...{rotate:ot,pathRotation:ot,rotateX:ot,rotateY:ot,rotateZ:ot,scale:H,scaleX:H,scaleY:H,scaleZ:H,skew:ot,skewX:ot,skewY:ot,distance:ut,translateX:ut,translateY:ut,translateZ:ut,x:ut,y:ut,z:ut,perspective:ut,transformPerspective:ut,opacity:G,originX:dt,originY:dt,originZ:ut},zIndex:Gn,fillOpacity:G,strokeOpacity:G,numOctaves:Gn},Jn={...Hn,color:mt,backgroundColor:mt,outlineColor:mt,fill:mt,stroke:mt,borderColor:mt,borderTopColor:mt,borderRightColor:mt,borderBottomColor:mt,borderLeftColor:mt,filter:Zn,WebkitFilter:Zn,mask:_n,WebkitMask:_n},Qn=t=>Jn[t],ts=new Set([Zn,_n]);function es(t,e){let n=Qn(t);return ts.has(n)||(n=Mt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const ns=new Set(["auto","none","0"]);class ss extends Ye{constructor(t,e,n,s,i){super(t,e,n,s,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n{t.getValue(e).set(n)}),this.resolveNoneKeyframes()}}const is=(t,e)=>e&&"number"==typeof t?e.transform(t):t,{schedule:rs}=O(queueMicrotask,!1);function as(t){return"object"==typeof(e=t)&&null!==e&&"ownerSVGElement"in t;var e}const os=[...Ln,mt,Mt],ls=()=>({x:{min:0,max:0},y:{min:0,max:0}}),us=new WeakMap;const hs=["initial","animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"];function cs(t){return null!==(e=t.animate)&&"object"==typeof e&&"function"==typeof e.start||hs.some(e=>function(t){return"string"==typeof t||Array.isArray(t)}(t[e]));var e}const ds={current:null},ps={current:!1},ms="undefined"!=typeof window;const fs=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let gs={};class ys{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:s,skipAnimations:i,blockInitialAnimation:r,visualState:a},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Ye,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const t=L.now();this.renderScheduledAtthis.bindToMotionValue(e,t)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(ps.current||function(){if(ps.current=!0,ms)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>ds.current=t.matches;t.addEventListener("change",e),e()}else ds.current=!1}(),this.shouldReduceMotion=ds.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),$(this.notifyUpdate),$(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,e){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),e.accelerate&&on.has(t)&&this.current instanceof HTMLElement){const{factory:n,keyframes:s,times:i,ease:r,duration:a}=e.accelerate,o=new tn({element:this.current,name:t,keyframes:s,times:i,ease:r,duration:p(a)}),l=n(o);return void this.valueSubscriptions.set(t,()=>{l(),o.cancel()})}const n=Ee.has(t);n&&this.onBindTransform&&this.onBindTransform();const s=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&N.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{s(),i&&i()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in gs){const e=gs[t];if(!e)continue;const{isEnabled:n,Feature:s}=e;if(!this.features[t]&&s&&n(this.props)&&(this.features[t]=new s(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;ee.variantChildren.delete(t)}addValue(t,e){const n=this.values.get(t);e!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=yn(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,e){let n=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var s;return null!=n&&("string"==typeof n&&(a(n)||o(n))?n=parseFloat(n):(s=n,!os.find(Wn(s))&&Mt.test(e)&&(n=es(t,e))),this.setBaseTarget(t,Dn(n)?n.get():n)),Dn(n)?n.get():n}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let n;if("string"==typeof e||"object"==typeof e){const s=Fn(this.props,e,this.presenceContext?.custom);s&&(n=s[t])}if(e&&void 0!==n)return n;const s=this.getBaseTargetFromProps(this.props,t);return void 0===s||Dn(s)?void 0!==this.initialValues[t]&&void 0===n?void 0:this.baseTarget[t]:s}on(t,e){return this.events[t]||(this.events[t]=new d),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){rs.render(this.render)}}class vs extends ys{constructor(){super(...arguments),this.KeyframeResolver=ss}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){const n=t.style;return n?n[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Dn(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}const bs={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Ts=Re.length;function ws(t,e,n){const{style:s,vars:i,transformOrigin:r}=t;let a=!1,o=!1;for(const t in e){const n=e[t];if(Ee.has(t))a=!0;else if(U(t))i[t]=n;else{const e=is(n,Hn[t]);t.startsWith("origin")?(o=!0,r[t]=e):s[t]=e}}if(e.transform||(a||n?s.transform=function(t,e,n){let s="",i=!0;for(let r=0;r{if(!e.target)return t;if("string"==typeof t){if(!ut.test(t))return t;t=parseFloat(t)}return`${Ss(t,e.target.x)}% ${Ss(t,e.target.y)}%`}},As={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,i=Mt.parse(t);if(i.length>5)return s;const r=Mt.createTransformer(t),a="number"!=typeof i[0]?1:0,o=n.x.scale*e.x,l=n.y.scale*e.y;i[0+a]/=o,i[1+a]/=l;const u=At(o,l,.5);return"number"==typeof i[2+a]&&(i[2+a]/=u),"number"==typeof i[3+a]&&(i[3+a]/=u),r(i)}},ks={borderRadius:{...xs,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"]},borderTopLeftRadius:xs,borderTopRightRadius:xs,borderBottomLeftRadius:xs,borderBottomRightRadius:xs,boxShadow:As};function Vs(t,{layout:e,layoutId:n}){return Ee.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!ks[t]||"opacity"===t)}function Cs(t,e,n){const s=t.style,i=e?.style,r={};if(!s)return r;for(const e in s)(Dn(s[e])||i&&Dn(i[e])||Vs(e,t)||void 0!==n?.getValue(e)?.liveStyle)&&(r[e]=s[e]);return r}class Fs extends vs{constructor(){super(...arguments),this.type="html",this.renderInstance=Ms}mount(t){i(Boolean(t.style),"motion.create() components must forward their ref to a HTML or SVG element","custom-component-ref"),super.mount(t)}readValueFromInstance(t,e){if(Ee.has(e))return this.projection?.isProjecting?Ce(e):((t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Fe(n,e)})(t,e);{const s=(n=t,window.getComputedStyle(n)),i=(U(e)?s.getPropertyValue(e):s[e])||0;return"string"==typeof i?i.trim():i}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return function(t,e){return function({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}(t.getBoundingClientRect(),e))}(t,e)}build(t,e,n){ws(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return Cs(t,e,n)}}class Ps extends ys{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,e){if(function(t,e){return t in e}(e,t)){const n=t[e];if("string"==typeof n||"number"==typeof n)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(t,e){delete e.output[t]}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}build(t,e){Object.assign(t.output,e)}renderInstance(t,{output:e}){Object.assign(t,e)}sortInstanceNodePosition(){return 0}}const Rs={offset:"stroke-dashoffset",array:"stroke-dasharray"},Es={offset:"strokeDashoffset",array:"strokeDasharray"};const Bs=["transform","opacity","offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Ds(t,{attrX:e,attrY:n,attrScale:s,pathLength:i,pathSpacing:r=1,pathOffset:a=0,...o},l,u,h){if(ws(t,o,u),l)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:c,style:d}=t;for(const t of Bs)void 0!==c[t]&&(d[t]=c[t],delete c[t]);(d.transform||c.transformOrigin)&&(d.transformOrigin=c.transformOrigin??"50% 50%",delete c.transformOrigin),d.transform&&(d.transformBox=h?.transformBox??"fill-box",delete c.transformBox),void 0!==e&&(c.x=e),void 0!==n&&(c.y=n),void 0!==s&&(c.scale=s),void 0!==i&&function(t,e,n=1,s=0,i=!0){t.pathLength=1;const r=i?Rs:Es;t[r.offset]=""+-s,t[r.array]=`${e} ${n}`}(c,i,r,a,!1)}const Is=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);class Os extends vs{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ls}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(Ee.has(e)){const t=Qn(e);return t&&t.default||0}if(Bs.includes(e)){const n=getComputedStyle(t)[e];if("string"==typeof n&&n)return n.trim()}return e=Is.has(e)?e:On(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return function(t,e,n){const s=Cs(t,e,n);for(const n in t)(Dn(t[n])||Dn(e[n]))&&(s[-1!==Re.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]);return s}(t,e,n)}build(t,e,n){Ds(t,e,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,e,n,s){!function(t,e,n,s){Ms(t,e,void 0,s);for(const n in e.attrs)t.setAttribute(Is.has(n)?n:On(n),e.attrs[n])}(t,e,0,s)}mount(t){var e;this.isSVGTag="string"==typeof(e=t.tagName)&&"svg"===e.toLowerCase(),super.mount(t)}}function Ns(t){return"object"==typeof t&&!Array.isArray(t)}function $s(t,e,n,s){return null==t?[]:"string"==typeof t&&Ns(e)?function(t,e,n){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){let s=document;e&&(s=e.current);const i=n?.[t]??s.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t).filter(t=>null!=t)}(t,n,s):t instanceof NodeList?Array.from(t):Array.isArray(t)?t.filter(t=>null!=t):[t]}function Ks(t,e,n){return t*(e+1)+n*e}function js(t,e,n,s){return"number"==typeof e?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?n:e.startsWith("<")?Math.max(0,n+parseFloat(e.slice(1))):s.get(e)??t}function Ws(e,n,s,i,r,a){!function(e,n,s){for(let i=0;in&&r.at"number"==typeof t,_s=t=>t.every(Zs);function Gs(t){const e={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=as(t)&&!function(t){return as(t)&&"svg"===t.tagName}(t)?new Os(e):new Fs(e);n.mount(t),us.set(t,n)}function Hs(t){const e=new Ps({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});e.mount(t),us.set(t,e)}function Js(t,e,n,s){const r=[];if(function(t,e){return Dn(t)||"number"==typeof t||"string"==typeof t&&!Ns(e)}(t,e))r.push(function(t,e,n){const s=Dn(t)?t:yn(t);return s.start(An("",s,e,n)),s.animation}(t,Ns(e)&&e.default||e,n&&n.default||n));else{if(null==t)return r;const a=$s(t,e,s),o=a.length;i(Boolean(o),"No valid elements provided.","no-valid-elements");for(let t=0;t{const u=qs(t),{delay:h=0,times:c=de(u),type:d=e.type||"keyframes",repeat:g,repeatType:y,repeatDelay:T=0,...w}=n;let{ease:M=e.ease||"easeOut",duration:S}=n;const x="function"==typeof h?h(o,l):h,A=u.length,k=Qe(d)?d:r?.[d||"keyframes"];if(A<=2&&k){let t=100;if(2===A&&_s(u)){const e=u[1]-u[0];t=Math.abs(e)}const n={...e,...w};void 0!==S&&(n.duration=p(S));const s=Wt(n,t,k);M=s.ease,S=s.duration}S??(S=a);const V=m+x;1===c.length&&0===c[0]&&(c[1]=1);const C=c.length-u.length;if(C>0&&ce(c,C),1===u.length&&u.unshift(null),g&&s(g<20,`Sequence segments can't repeat ${g} times — ignoring repeat option. Use a value below 20 or apply repeat at the sequence level instead.`),g&&g<20){const t=S>0?T/S:0;S=Ks(S,g,T);const e=[...u],n=[...c];M=Array.isArray(M)?[...M]:[M];const s=[...M],i="reverse"===y||"mirror"===y;let r=e,a=s;i&&(r=[...e].reverse(),"reverse"===y&&(a=[...s].reverse().map(t=>"function"==typeof t?b(t):t)));for(let o=0;o0&&(u.push(u[u.length-1]),c.push(p),M.push("linear")),u.push(...h);for(let t=0;t{for(const i in t){const r=t[i];r.sort(Ys);const a=[],l=[],u=[];for(let t=0;t{if(Array.isArray(t)&&"function"==typeof t[0]){const e=t[0],n=yn(0);return n.on("change",e),1===t.length?[n,[0,1]]:2===t.length?[n,[0,1],t[1]]:[n,t[1],t[2]]}return t}),e,n,{spring:oe});return r.forEach(({keyframes:t,transition:e},n)=>{i.push(...Js(n,t,e))}),i}function ti(e={}){const{scope:n,reduceMotion:s,skipAnimations:i}=e;return function(e,r,a){let o,l=[];const u={};if(void 0!==s&&(u.reduceMotion=s),void 0!==i&&(u.skipAnimations=i),h=e,Array.isArray(h)&&h.some(Array.isArray)){const{onComplete:t,...s}=r||{};"function"==typeof t&&(o=t),l=Qs(e,{...u,...s},n)}else{const{onComplete:t,...s}=a||{};"function"==typeof t&&(o=t),l=Js(e,r,{...u,...s},n)}var h;const c=new fn(l);return o&&c.finished.then(o),n&&(n.animations.push(c),c.finished.then(()=>{t(n.animations,c)})),c}}const ei=ti();export{ei as animate,ti as createScopedAnimate}; +//# sourceMappingURL=size-rollup-animate.js.map diff --git a/node_modules/framer-motion/dist/size-rollup-animate.js.map b/node_modules/framer-motion/dist/size-rollup-animate.js.map new file mode 100644 index 0000000..ccef52f --- /dev/null +++ b/node_modules/framer-motion/dist/size-rollup-animate.js.map @@ -0,0 +1 @@ +{"version":3,"file":"size-rollup-animate.js","sources":["../../motion-utils/dist/es/array.mjs","../../motion-utils/dist/es/clamp.mjs","../../motion-utils/dist/es/format-error-message.mjs","../../motion-utils/dist/es/errors.mjs","../../motion-utils/dist/es/global-config.mjs","../../motion-utils/dist/es/is-numerical-string.mjs","../../motion-utils/dist/es/is-zero-value-string.mjs","../../motion-utils/dist/es/memo.mjs","../../motion-utils/dist/es/noop.mjs","../../motion-utils/dist/es/pipe.mjs","../../motion-utils/dist/es/progress.mjs","../../motion-utils/dist/es/subscription-manager.mjs","../../motion-utils/dist/es/time-conversion.mjs","../../motion-utils/dist/es/velocity-per-second.mjs","../../motion-utils/dist/es/easing/cubic-bezier.mjs","../../motion-utils/dist/es/easing/modifiers/mirror.mjs","../../motion-utils/dist/es/easing/modifiers/reverse.mjs","../../motion-utils/dist/es/easing/back.mjs","../../motion-utils/dist/es/easing/anticipate.mjs","../../motion-utils/dist/es/easing/circ.mjs","../../motion-utils/dist/es/easing/ease.mjs","../../motion-utils/dist/es/easing/utils/is-easing-array.mjs","../../motion-utils/dist/es/easing/utils/get-easing-for-segment.mjs","../../motion-utils/dist/es/wrap.mjs","../../motion-utils/dist/es/easing/utils/is-bezier-definition.mjs","../../motion-utils/dist/es/easing/utils/map.mjs","../../motion-dom/dist/es/frameloop/order.mjs","../../motion-dom/dist/es/frameloop/batcher.mjs","../../motion-dom/dist/es/frameloop/render-step.mjs","../../motion-dom/dist/es/frameloop/frame.mjs","../../motion-dom/dist/es/frameloop/sync-time.mjs","../../motion-dom/dist/es/animation/utils/is-css-variable.mjs","../../motion-dom/dist/es/value/types/numbers/index.mjs","../../motion-dom/dist/es/value/types/utils/sanitize.mjs","../../motion-dom/dist/es/value/types/utils/float-regex.mjs","../../motion-dom/dist/es/value/types/utils/single-color-regex.mjs","../../motion-dom/dist/es/value/types/color/utils.mjs","../../motion-dom/dist/es/value/types/utils/is-nullish.mjs","../../motion-dom/dist/es/value/types/color/rgba.mjs","../../motion-dom/dist/es/value/types/color/hex.mjs","../../motion-dom/dist/es/value/types/numbers/units.mjs","../../motion-dom/dist/es/value/types/color/hsla.mjs","../../motion-dom/dist/es/value/types/color/index.mjs","../../motion-dom/dist/es/value/types/utils/color-regex.mjs","../../motion-dom/dist/es/value/types/complex/index.mjs","../../motion-dom/dist/es/value/types/color/hsla-to-rgba.mjs","../../motion-dom/dist/es/utils/mix/immediate.mjs","../../motion-dom/dist/es/utils/mix/number.mjs","../../motion-dom/dist/es/utils/mix/color.mjs","../../motion-dom/dist/es/utils/mix/visibility.mjs","../../motion-dom/dist/es/utils/mix/complex.mjs","../../motion-dom/dist/es/utils/mix/index.mjs","../../motion-dom/dist/es/animation/drivers/frame.mjs","../../motion-dom/dist/es/animation/waapi/utils/linear.mjs","../../motion-dom/dist/es/animation/generators/utils/calc-duration.mjs","../../motion-dom/dist/es/animation/generators/utils/create-generator-easing.mjs","../../motion-dom/dist/es/animation/generators/spring.mjs","../../motion-dom/dist/es/animation/generators/utils/velocity.mjs","../../motion-dom/dist/es/animation/generators/inertia.mjs","../../motion-dom/dist/es/utils/interpolate.mjs","../../motion-dom/dist/es/animation/keyframes/offsets/fill.mjs","../../motion-dom/dist/es/animation/keyframes/offsets/default.mjs","../../motion-dom/dist/es/animation/generators/keyframes.mjs","../../motion-dom/dist/es/animation/keyframes/offsets/time.mjs","../../motion-dom/dist/es/animation/keyframes/get-final.mjs","../../motion-dom/dist/es/animation/utils/replace-transition-type.mjs","../../motion-dom/dist/es/animation/utils/WithPromise.mjs","../../motion-dom/dist/es/animation/JSAnimation.mjs","../../motion-dom/dist/es/render/dom/parse-transform.mjs","../../motion-dom/dist/es/render/utils/keys-transform.mjs","../../motion-dom/dist/es/animation/keyframes/utils/unit-conversion.mjs","../../motion-dom/dist/es/animation/keyframes/KeyframesResolver.mjs","../../motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.mjs","../../motion-dom/dist/es/render/dom/style-set.mjs","../../motion-dom/dist/es/render/dom/is-css-var.mjs","../../motion-dom/dist/es/utils/supports/flags.mjs","../../motion-dom/dist/es/utils/supports/memo.mjs","../../motion-dom/dist/es/utils/supports/scroll-timeline.mjs","../../motion-dom/dist/es/utils/supports/linear-easing.mjs","../../motion-dom/dist/es/animation/waapi/easing/cubic-bezier.mjs","../../motion-dom/dist/es/animation/waapi/easing/supported.mjs","../../motion-dom/dist/es/animation/waapi/easing/map-easing.mjs","../../motion-dom/dist/es/animation/waapi/start-waapi-animation.mjs","../../motion-dom/dist/es/animation/generators/utils/is-generator.mjs","../../motion-dom/dist/es/animation/NativeAnimation.mjs","../../motion-dom/dist/es/animation/waapi/utils/apply-generator.mjs","../../motion-dom/dist/es/animation/waapi/utils/unsupported-easing.mjs","../../motion-dom/dist/es/animation/NativeAnimationExtended.mjs","../../motion-dom/dist/es/animation/utils/is-animatable.mjs","../../motion-dom/dist/es/animation/utils/make-animation-instant.mjs","../../motion-dom/dist/es/animation/waapi/utils/accelerated-values.mjs","../../motion-dom/dist/es/animation/waapi/utils/is-browser-color.mjs","../../motion-dom/dist/es/animation/waapi/supports/waapi.mjs","../../motion-dom/dist/es/animation/AsyncMotionValueAnimation.mjs","../../motion-dom/dist/es/animation/utils/can-animate.mjs","../../motion-dom/dist/es/animation/GroupAnimation.mjs","../../motion-dom/dist/es/animation/GroupAnimationWithThen.mjs","../../motion-dom/dist/es/value/index.mjs","../../motion-dom/dist/es/animation/utils/resolve-transition.mjs","../../motion-dom/dist/es/animation/utils/get-value-transition.mjs","../../motion-dom/dist/es/animation/utils/default-transitions.mjs","../../motion-dom/dist/es/animation/utils/is-transition-defined.mjs","../../motion-dom/dist/es/animation/interfaces/motion-value.mjs","../../motion-dom/dist/es/animation/utils/css-variables-conversion.mjs","../../motion-dom/dist/es/render/utils/resolve-variants.mjs","../../motion-dom/dist/es/render/utils/keys-position.mjs","../../motion-dom/dist/es/render/utils/setters.mjs","../../motion-dom/dist/es/render/utils/is-keyframes-target.mjs","../../motion-dom/dist/es/render/utils/resolve-dynamic-variants.mjs","../../motion-dom/dist/es/value/utils/is-motion-value.mjs","../../motion-dom/dist/es/value/will-change/add-will-change.mjs","../../motion-dom/dist/es/value/will-change/is.mjs","../../motion-dom/dist/es/render/dom/utils/camel-to-dash.mjs","../../motion-dom/dist/es/animation/optimized-appear/data-id.mjs","../../motion-dom/dist/es/animation/optimized-appear/get-appear-id.mjs","../../motion-dom/dist/es/animation/interfaces/visual-element-target.mjs","../../motion-dom/dist/es/value/types/auto.mjs","../../motion-dom/dist/es/value/types/test.mjs","../../motion-dom/dist/es/value/types/dimensions.mjs","../../motion-dom/dist/es/animation/keyframes/utils/is-none.mjs","../../motion-dom/dist/es/value/types/complex/filter.mjs","../../motion-dom/dist/es/value/types/complex/mask.mjs","../../motion-dom/dist/es/value/types/int.mjs","../../motion-dom/dist/es/value/types/maps/number.mjs","../../motion-dom/dist/es/value/types/maps/transform.mjs","../../motion-dom/dist/es/value/types/maps/defaults.mjs","../../motion-dom/dist/es/value/types/utils/animatable-none.mjs","../../motion-dom/dist/es/animation/keyframes/utils/make-none-animatable.mjs","../../motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.mjs","../../motion-dom/dist/es/value/types/utils/get-as-type.mjs","../../motion-dom/dist/es/frameloop/microtask.mjs","../../motion-dom/dist/es/utils/is-svg-element.mjs","../../motion-utils/dist/es/is-object.mjs","../../motion-dom/dist/es/value/types/utils/find.mjs","../../motion-dom/dist/es/projection/geometry/models.mjs","../../motion-dom/dist/es/render/store.mjs","../../motion-dom/dist/es/render/utils/variant-props.mjs","../../motion-dom/dist/es/render/utils/is-controlling-variants.mjs","../../motion-dom/dist/es/render/utils/is-animation-controls.mjs","../../motion-dom/dist/es/render/utils/is-variant-label.mjs","../../motion-dom/dist/es/render/utils/reduced-motion/state.mjs","../../motion-dom/dist/es/render/utils/reduced-motion/index.mjs","../../motion-dom/dist/es/render/VisualElement.mjs","../../motion-dom/dist/es/render/utils/motion-values.mjs","../../motion-dom/dist/es/render/dom/DOMVisualElement.mjs","../../motion-dom/dist/es/render/html/utils/build-transform.mjs","../../motion-dom/dist/es/render/html/utils/build-styles.mjs","../../motion-dom/dist/es/render/html/utils/render.mjs","../../motion-dom/dist/es/projection/styles/scale-border-radius.mjs","../../motion-dom/dist/es/projection/styles/scale-box-shadow.mjs","../../motion-dom/dist/es/projection/styles/scale-correction.mjs","../../motion-dom/dist/es/utils/border-radius.mjs","../../motion-dom/dist/es/render/utils/is-forced-motion-value.mjs","../../motion-dom/dist/es/render/html/utils/scrape-motion-values.mjs","../../motion-dom/dist/es/render/html/HTMLVisualElement.mjs","../../motion-dom/dist/es/projection/utils/measure.mjs","../../motion-dom/dist/es/projection/geometry/conversion.mjs","../../motion-dom/dist/es/render/object/ObjectVisualElement.mjs","../../motion-dom/dist/es/render/svg/utils/path.mjs","../../motion-dom/dist/es/render/svg/utils/build-attrs.mjs","../../motion-dom/dist/es/render/svg/utils/camel-case-attrs.mjs","../../motion-dom/dist/es/render/svg/SVGVisualElement.mjs","../../motion-dom/dist/es/render/svg/utils/scrape-motion-values.mjs","../../motion-dom/dist/es/render/svg/utils/render.mjs","../../motion-dom/dist/es/render/svg/utils/is-svg-tag.mjs","../lib/animation/utils/is-dom-keyframes.js","../lib/animation/animate/resolve-subjects.js","../../motion-dom/dist/es/utils/resolve-elements.mjs","../lib/animation/sequence/utils/calc-repeat-duration.js","../lib/animation/sequence/utils/calc-time.js","../lib/animation/sequence/utils/edit.js","../lib/animation/sequence/utils/normalize-times.js","../lib/animation/sequence/utils/sort.js","../lib/animation/sequence/create.js","../lib/animation/utils/create-visual-element.js","../../motion-dom/dist/es/utils/is-svg-svg-element.mjs","../lib/animation/animate/subject.js","../../motion-dom/dist/es/animation/animate/single-value.mjs","../lib/animation/animate/sequence.js","../lib/animation/animate/index.js"],"sourcesContent":["function addUniqueItem(arr, item) {\n if (arr.indexOf(item) === -1)\n arr.push(item);\n}\nfunction removeItem(arr, item) {\n const index = arr.indexOf(item);\n if (index > -1)\n arr.splice(index, 1);\n}\n// Adapted from array-move\nfunction moveItem([...arr], fromIndex, toIndex) {\n const startIndex = fromIndex < 0 ? arr.length + fromIndex : fromIndex;\n if (startIndex >= 0 && startIndex < arr.length) {\n const endIndex = toIndex < 0 ? arr.length + toIndex : toIndex;\n const [item] = arr.splice(fromIndex, 1);\n arr.splice(endIndex, 0, item);\n }\n return arr;\n}\n\nexport { addUniqueItem, moveItem, removeItem };\n//# sourceMappingURL=array.mjs.map\n","const clamp = (min, max, v) => {\n if (v > max)\n return max;\n if (v < min)\n return min;\n return v;\n};\n\nexport { clamp };\n//# sourceMappingURL=clamp.mjs.map\n","function formatErrorMessage(message, errorCode) {\n return errorCode\n ? `${message}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${errorCode}`\n : message;\n}\n\nexport { formatErrorMessage };\n//# sourceMappingURL=format-error-message.mjs.map\n","import { formatErrorMessage } from './format-error-message.mjs';\n\nlet warning = () => { };\nlet invariant = () => { };\nif (typeof process !== \"undefined\" &&\n process.env?.NODE_ENV !== \"production\") {\n warning = (check, message, errorCode) => {\n if (!check && typeof console !== \"undefined\") {\n console.warn(formatErrorMessage(message, errorCode));\n }\n };\n invariant = (check, message, errorCode) => {\n if (!check) {\n throw new Error(formatErrorMessage(message, errorCode));\n }\n };\n}\n\nexport { invariant, warning };\n//# sourceMappingURL=errors.mjs.map\n","const MotionGlobalConfig = {};\n\nexport { MotionGlobalConfig };\n//# sourceMappingURL=global-config.mjs.map\n","/**\n * Check if value is a numerical string, ie a string that is purely a number eg \"100\" or \"-100.1\"\n */\nconst isNumericalString = (v) => /^-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)$/u.test(v);\n\nexport { isNumericalString };\n//# sourceMappingURL=is-numerical-string.mjs.map\n","/**\n * Check if the value is a zero value string like \"0px\" or \"0%\"\n */\nconst isZeroValueString = (v) => /^0[^.\\s]+$/u.test(v);\n\nexport { isZeroValueString };\n//# sourceMappingURL=is-zero-value-string.mjs.map\n","/*#__NO_SIDE_EFFECTS__*/\nfunction memo(callback) {\n let result;\n return () => {\n if (result === undefined)\n result = callback();\n return result;\n };\n}\n\nexport { memo };\n//# sourceMappingURL=memo.mjs.map\n","/*#__NO_SIDE_EFFECTS__*/\nconst noop = (any) => any;\n\nexport { noop };\n//# sourceMappingURL=noop.mjs.map\n","/**\n * Pipe\n * Compose other transformers to run linearily\n * pipe(min(20), max(40))\n * @param {...functions} transformers\n * @return {function}\n */\nconst pipe = (...transformers) => transformers.reduce((a, b) => (v) => b(a(v)));\n\nexport { pipe };\n//# sourceMappingURL=pipe.mjs.map\n","/*\n Progress within given range\n\n Given a lower limit and an upper limit, we return the progress\n (expressed as a number 0-1) represented by the given value, and\n limit that progress to within 0-1.\n*/\n/*#__NO_SIDE_EFFECTS__*/\nconst progress = (from, to, value) => {\n const range = to - from;\n return range ? (value - from) / range : 1;\n};\n\nexport { progress };\n//# sourceMappingURL=progress.mjs.map\n","import { addUniqueItem, removeItem } from './array.mjs';\n\nclass SubscriptionManager {\n constructor() {\n this.subscriptions = [];\n }\n add(handler) {\n addUniqueItem(this.subscriptions, handler);\n return () => removeItem(this.subscriptions, handler);\n }\n notify(a, b, c) {\n const numSubscriptions = this.subscriptions.length;\n if (!numSubscriptions)\n return;\n if (numSubscriptions === 1) {\n /**\n * If there's only a single handler we can just call it without invoking a loop.\n */\n this.subscriptions[0](a, b, c);\n }\n else {\n for (let i = 0; i < numSubscriptions; i++) {\n /**\n * Check whether the handler exists before firing as it's possible\n * the subscriptions were modified during this loop running.\n */\n const handler = this.subscriptions[i];\n handler && handler(a, b, c);\n }\n }\n }\n getSize() {\n return this.subscriptions.length;\n }\n clear() {\n this.subscriptions.length = 0;\n }\n}\n\nexport { SubscriptionManager };\n//# sourceMappingURL=subscription-manager.mjs.map\n","/**\n * Converts seconds to milliseconds\n *\n * @param seconds - Time in seconds.\n * @return milliseconds - Converted time in milliseconds.\n */\n/*#__NO_SIDE_EFFECTS__*/\nconst secondsToMilliseconds = (seconds) => seconds * 1000;\n/*#__NO_SIDE_EFFECTS__*/\nconst millisecondsToSeconds = (milliseconds) => milliseconds / 1000;\n\nexport { millisecondsToSeconds, secondsToMilliseconds };\n//# sourceMappingURL=time-conversion.mjs.map\n","/*\n Convert velocity into velocity per second\n*/\n/*#__NO_SIDE_EFFECTS__*/\nconst velocityPerSecond = (velocity, frameDuration) => frameDuration ? velocity * (1000 / frameDuration) : 0;\n\nexport { velocityPerSecond };\n//# sourceMappingURL=velocity-per-second.mjs.map\n","import { noop } from '../noop.mjs';\n\n/*\n Bezier function generator\n This has been modified from Gaëtan Renaudeau's BezierEasing\n https://github.com/gre/bezier-easing/blob/master/src/index.js\n https://github.com/gre/bezier-easing/blob/master/LICENSE\n \n I've removed the newtonRaphsonIterate algo because in benchmarking it\n wasn't noticeably faster than binarySubdivision, indeed removing it\n usually improved times, depending on the curve.\n I also removed the lookup table, as for the added bundle size and loop we're\n only cutting ~4 or so subdivision iterations. I bumped the max iterations up\n to 12 to compensate and this still tended to be faster for no perceivable\n loss in accuracy.\n Usage\n const easeOut = cubicBezier(.17,.67,.83,.67);\n const x = easeOut(0.5); // returns 0.627...\n*/\n// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.\nconst calcBezier = (t, a1, a2) => (((1.0 - 3.0 * a2 + 3.0 * a1) * t + (3.0 * a2 - 6.0 * a1)) * t + 3.0 * a1) *\n t;\nconst subdivisionPrecision = 0.0000001;\nconst subdivisionMaxIterations = 12;\nfunction binarySubdivide(x, lowerBound, upperBound, mX1, mX2) {\n let currentX;\n let currentT;\n let i = 0;\n do {\n currentT = lowerBound + (upperBound - lowerBound) / 2.0;\n currentX = calcBezier(currentT, mX1, mX2) - x;\n if (currentX > 0.0) {\n upperBound = currentT;\n }\n else {\n lowerBound = currentT;\n }\n } while (Math.abs(currentX) > subdivisionPrecision &&\n ++i < subdivisionMaxIterations);\n return currentT;\n}\n/*#__NO_SIDE_EFFECTS__*/\nfunction cubicBezier(mX1, mY1, mX2, mY2) {\n // If this is a linear gradient, return linear easing\n if (mX1 === mY1 && mX2 === mY2)\n return noop;\n const getTForX = (aX) => binarySubdivide(aX, 0, 1, mX1, mX2);\n // If animation is at start/end, return t without easing\n return (t) => t === 0 || t === 1 ? t : calcBezier(getTForX(t), mY1, mY2);\n}\n\nexport { cubicBezier };\n//# sourceMappingURL=cubic-bezier.mjs.map\n","// Accepts an easing function and returns a new one that outputs mirrored values for\n// the second half of the animation. Turns easeIn into easeInOut.\n/*#__NO_SIDE_EFFECTS__*/\nconst mirrorEasing = (easing) => (p) => p <= 0.5 ? easing(2 * p) / 2 : (2 - easing(2 * (1 - p))) / 2;\n\nexport { mirrorEasing };\n//# sourceMappingURL=mirror.mjs.map\n","// Accepts an easing function and returns a new one that outputs reversed values.\n// Turns easeIn into easeOut.\n/*#__NO_SIDE_EFFECTS__*/\nconst reverseEasing = (easing) => (p) => 1 - easing(1 - p);\n\nexport { reverseEasing };\n//# sourceMappingURL=reverse.mjs.map\n","import { cubicBezier } from './cubic-bezier.mjs';\nimport { mirrorEasing } from './modifiers/mirror.mjs';\nimport { reverseEasing } from './modifiers/reverse.mjs';\n\nconst backOut = /*@__PURE__*/ cubicBezier(0.33, 1.53, 0.69, 0.99);\nconst backIn = /*@__PURE__*/ reverseEasing(backOut);\nconst backInOut = /*@__PURE__*/ mirrorEasing(backIn);\n\nexport { backIn, backInOut, backOut };\n//# sourceMappingURL=back.mjs.map\n","import { backIn } from './back.mjs';\n\nconst anticipate = (p) => p >= 1\n ? 1\n : (p *= 2) < 1\n ? 0.5 * backIn(p)\n : 0.5 * (2 - Math.pow(2, -10 * (p - 1)));\n\nexport { anticipate };\n//# sourceMappingURL=anticipate.mjs.map\n","import { mirrorEasing } from './modifiers/mirror.mjs';\nimport { reverseEasing } from './modifiers/reverse.mjs';\n\nconst circIn = (p) => 1 - Math.sin(Math.acos(p));\nconst circOut = reverseEasing(circIn);\nconst circInOut = mirrorEasing(circIn);\n\nexport { circIn, circInOut, circOut };\n//# sourceMappingURL=circ.mjs.map\n","import { cubicBezier } from './cubic-bezier.mjs';\n\nconst easeIn = /*@__PURE__*/ cubicBezier(0.42, 0, 1, 1);\nconst easeOut = /*@__PURE__*/ cubicBezier(0, 0, 0.58, 1);\nconst easeInOut = /*@__PURE__*/ cubicBezier(0.42, 0, 0.58, 1);\n\nexport { easeIn, easeInOut, easeOut };\n//# sourceMappingURL=ease.mjs.map\n","/*#__NO_SIDE_EFFECTS__*/\nconst isEasingArray = (ease) => {\n return Array.isArray(ease) && typeof ease[0] !== \"number\";\n};\n\nexport { isEasingArray };\n//# sourceMappingURL=is-easing-array.mjs.map\n","import { wrap } from '../../wrap.mjs';\nimport { isEasingArray } from './is-easing-array.mjs';\n\n/*#__NO_SIDE_EFFECTS__*/\nfunction getEasingForSegment(easing, i) {\n return isEasingArray(easing) ? easing[wrap(0, easing.length, i)] : easing;\n}\n\nexport { getEasingForSegment };\n//# sourceMappingURL=get-easing-for-segment.mjs.map\n","const wrap = (min, max, v) => {\n const rangeSize = max - min;\n return ((((v - min) % rangeSize) + rangeSize) % rangeSize) + min;\n};\n\nexport { wrap };\n//# sourceMappingURL=wrap.mjs.map\n","/*#__NO_SIDE_EFFECTS__*/\nconst isBezierDefinition = (easing) => Array.isArray(easing) && typeof easing[0] === \"number\";\n\nexport { isBezierDefinition };\n//# sourceMappingURL=is-bezier-definition.mjs.map\n","import { invariant } from '../../errors.mjs';\nimport { noop } from '../../noop.mjs';\nimport { anticipate } from '../anticipate.mjs';\nimport { backOut, backInOut, backIn } from '../back.mjs';\nimport { circOut, circInOut, circIn } from '../circ.mjs';\nimport { cubicBezier } from '../cubic-bezier.mjs';\nimport { easeOut, easeInOut, easeIn } from '../ease.mjs';\nimport { isBezierDefinition } from './is-bezier-definition.mjs';\n\nconst easingLookup = {\n linear: noop,\n easeIn,\n easeInOut,\n easeOut,\n circIn,\n circInOut,\n circOut,\n backIn,\n backInOut,\n backOut,\n anticipate,\n};\nconst isValidEasing = (easing) => {\n return typeof easing === \"string\";\n};\nconst easingDefinitionToFunction = (definition) => {\n if (isBezierDefinition(definition)) {\n // If cubic bezier definition, create bezier curve\n invariant(definition.length === 4, `Cubic bezier arrays must contain four numerical values.`, \"cubic-bezier-length\");\n const [x1, y1, x2, y2] = definition;\n return cubicBezier(x1, y1, x2, y2);\n }\n else if (isValidEasing(definition)) {\n // Else lookup from table\n invariant(easingLookup[definition] !== undefined, `Invalid easing type '${definition}'`, \"invalid-easing-type\");\n return easingLookup[definition];\n }\n return definition;\n};\n\nexport { easingDefinitionToFunction };\n//# sourceMappingURL=map.mjs.map\n","const stepsOrder = [\n \"setup\", // Compute\n \"read\", // Read\n \"resolveKeyframes\", // Write/Read/Write/Read\n \"preUpdate\", // Compute\n \"update\", // Compute\n \"preRender\", // Compute\n \"render\", // Write\n \"postRender\", // Compute\n];\n\nexport { stepsOrder };\n//# sourceMappingURL=order.mjs.map\n","import { MotionGlobalConfig } from 'motion-utils';\nimport { stepsOrder } from './order.mjs';\nimport { createRenderStep } from './render-step.mjs';\n\nconst maxElapsed = 40;\nfunction createRenderBatcher(scheduleNextBatch, allowKeepAlive) {\n let runNextFrame = false;\n let useDefaultElapsed = true;\n const state = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n };\n const flagRunNextFrame = () => (runNextFrame = true);\n const steps = stepsOrder.reduce((acc, key) => {\n acc[key] = createRenderStep(flagRunNextFrame);\n return acc;\n }, {});\n const { setup, read, resolveKeyframes, preUpdate, update, preRender, render, postRender, } = steps;\n const processBatch = () => {\n const useManualTiming = MotionGlobalConfig.useManualTiming;\n const timestamp = useManualTiming\n ? state.timestamp\n : performance.now();\n runNextFrame = false;\n if (!useManualTiming) {\n state.delta = useDefaultElapsed\n ? 1000 / 60\n : Math.max(Math.min(timestamp - state.timestamp, maxElapsed), 1);\n }\n state.timestamp = timestamp;\n state.isProcessing = true;\n // Unrolled render loop for better per-frame performance\n setup.process(state);\n read.process(state);\n resolveKeyframes.process(state);\n preUpdate.process(state);\n update.process(state);\n preRender.process(state);\n render.process(state);\n postRender.process(state);\n state.isProcessing = false;\n if (runNextFrame && allowKeepAlive) {\n useDefaultElapsed = false;\n scheduleNextBatch(processBatch);\n }\n };\n const wake = () => {\n runNextFrame = true;\n useDefaultElapsed = true;\n if (!state.isProcessing) {\n scheduleNextBatch(processBatch);\n }\n };\n const schedule = stepsOrder.reduce((acc, key) => {\n const step = steps[key];\n acc[key] = (process, keepAlive = false, immediate = false) => {\n if (!runNextFrame)\n wake();\n return step.schedule(process, keepAlive, immediate);\n };\n return acc;\n }, {});\n const cancel = (process) => {\n for (let i = 0; i < stepsOrder.length; i++) {\n steps[stepsOrder[i]].cancel(process);\n }\n };\n return { schedule, cancel, state, steps };\n}\n\nexport { createRenderBatcher };\n//# sourceMappingURL=batcher.mjs.map\n","function createRenderStep(runNextFrame) {\n /**\n * We create and reuse two queues, one to queue jobs for the current frame\n * and one for the next. We reuse to avoid triggering GC after x frames.\n */\n let thisFrame = new Set();\n let nextFrame = new Set();\n /**\n * Track whether we're currently processing jobs in this step. This way\n * we can decide whether to schedule new jobs for this frame or next.\n */\n let isProcessing = false;\n let flushNextFrame = false;\n /**\n * A set of processes which were marked keepAlive when scheduled.\n */\n const toKeepAlive = new WeakSet();\n let latestFrameData = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n };\n function triggerCallback(callback) {\n if (toKeepAlive.has(callback)) {\n step.schedule(callback);\n runNextFrame();\n }\n callback(latestFrameData);\n }\n const step = {\n /**\n * Schedule a process to run on the next frame.\n */\n schedule: (callback, keepAlive = false, immediate = false) => {\n const addToCurrentFrame = immediate && isProcessing;\n const queue = addToCurrentFrame ? thisFrame : nextFrame;\n if (keepAlive)\n toKeepAlive.add(callback);\n queue.add(callback);\n return callback;\n },\n /**\n * Cancel the provided callback from running on the next frame.\n */\n cancel: (callback) => {\n nextFrame.delete(callback);\n toKeepAlive.delete(callback);\n },\n /**\n * Execute all schedule callbacks.\n */\n process: (frameData) => {\n latestFrameData = frameData;\n /**\n * If we're already processing we've probably been triggered by a flushSync\n * inside an existing process. Instead of executing, mark flushNextFrame\n * as true and ensure we flush the following frame at the end of this one.\n */\n if (isProcessing) {\n flushNextFrame = true;\n return;\n }\n isProcessing = true;\n // Swap this frame and the next to avoid GC\n const prevFrame = thisFrame;\n thisFrame = nextFrame;\n nextFrame = prevFrame;\n // Execute this frame\n thisFrame.forEach(triggerCallback);\n // Clear the frame so no callbacks remain. This is to avoid\n // memory leaks should this render step not run for a while.\n thisFrame.clear();\n isProcessing = false;\n if (flushNextFrame) {\n flushNextFrame = false;\n step.process(frameData);\n }\n },\n };\n return step;\n}\n\nexport { createRenderStep };\n//# sourceMappingURL=render-step.mjs.map\n","import { noop } from 'motion-utils';\nimport { createRenderBatcher } from './batcher.mjs';\n\nconst { schedule: frame, cancel: cancelFrame, state: frameData, steps: frameSteps, } = /* @__PURE__ */ createRenderBatcher(typeof requestAnimationFrame !== \"undefined\" ? requestAnimationFrame : noop, true);\n\nexport { cancelFrame, frame, frameData, frameSteps };\n//# sourceMappingURL=frame.mjs.map\n","import { MotionGlobalConfig } from 'motion-utils';\nimport { frameData } from './frame.mjs';\n\nlet now;\nfunction clearTime() {\n now = undefined;\n}\n/**\n * An eventloop-synchronous alternative to performance.now().\n *\n * Ensures that time measurements remain consistent within a synchronous context.\n * Usually calling performance.now() twice within the same synchronous context\n * will return different values which isn't useful for animations when we're usually\n * trying to sync animations to the same frame.\n */\nconst time = {\n now: () => {\n if (now === undefined) {\n time.set(frameData.isProcessing || MotionGlobalConfig.useManualTiming\n ? frameData.timestamp\n : performance.now());\n }\n return now;\n },\n set: (newTime) => {\n now = newTime;\n queueMicrotask(clearTime);\n },\n};\n\nexport { time };\n//# sourceMappingURL=sync-time.mjs.map\n","const checkStringStartsWith = (token) => (key) => typeof key === \"string\" && key.startsWith(token);\nconst isCSSVariableName = \n/*@__PURE__*/ checkStringStartsWith(\"--\");\nconst startsAsVariableToken = \n/*@__PURE__*/ checkStringStartsWith(\"var(--\");\nconst isCSSVariableToken = (value) => {\n const startsWithToken = startsAsVariableToken(value);\n if (!startsWithToken)\n return false;\n // Ensure any comments are stripped from the value as this can harm performance of the regex.\n return singleCssVariableRegex.test(value.split(\"/*\")[0].trim());\n};\nconst singleCssVariableRegex = /var\\(--(?:[\\w-]+\\s*|[\\w-]+\\s*,(?:\\s*[^)(\\s]|\\s*\\((?:[^)(]|\\([^)(]*\\))*\\))+\\s*)\\)$/iu;\n/**\n * Check if a value contains a CSS variable anywhere (e.g. inside calc()).\n * Unlike isCSSVariableToken which checks if the value IS a var() token,\n * this checks if the value CONTAINS var() somewhere in the string.\n */\nfunction containsCSSVariable(value) {\n if (typeof value !== \"string\")\n return false;\n // Strip comments to avoid false positives\n return value.split(\"/*\")[0].includes(\"var(--\");\n}\n\nexport { containsCSSVariable, isCSSVariableName, isCSSVariableToken };\n//# sourceMappingURL=is-css-variable.mjs.map\n","import { clamp } from 'motion-utils';\n\nconst number = {\n test: (v) => typeof v === \"number\",\n parse: parseFloat,\n transform: (v) => v,\n};\nconst alpha = {\n ...number,\n transform: (v) => clamp(0, 1, v),\n};\nconst scale = {\n ...number,\n default: 1,\n};\n\nexport { alpha, number, scale };\n//# sourceMappingURL=index.mjs.map\n","// If this number is a decimal, make it just five decimal places\n// to avoid exponents\nconst sanitize = (v) => Math.round(v * 100000) / 100000;\n\nexport { sanitize };\n//# sourceMappingURL=sanitize.mjs.map\n","const floatRegex = /-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)/gu;\n\nexport { floatRegex };\n//# sourceMappingURL=float-regex.mjs.map\n","const singleColorRegex = /^(?:#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\))$/iu;\n\nexport { singleColorRegex };\n//# sourceMappingURL=single-color-regex.mjs.map\n","import { floatRegex } from '../utils/float-regex.mjs';\nimport { isNullish } from '../utils/is-nullish.mjs';\nimport { singleColorRegex } from '../utils/single-color-regex.mjs';\n\n/**\n * Returns true if the provided string is a color, ie rgba(0,0,0,0) or #000,\n * but false if a number or multiple colors\n */\nconst isColorString = (type, testProp) => (v) => {\n return Boolean((typeof v === \"string\" &&\n singleColorRegex.test(v) &&\n v.startsWith(type)) ||\n (testProp &&\n !isNullish(v) &&\n Object.prototype.hasOwnProperty.call(v, testProp)));\n};\nconst splitColor = (aName, bName, cName) => (v) => {\n if (typeof v !== \"string\")\n return v;\n const [a, b, c, alpha] = v.match(floatRegex);\n return {\n [aName]: parseFloat(a),\n [bName]: parseFloat(b),\n [cName]: parseFloat(c),\n alpha: alpha !== undefined ? parseFloat(alpha) : 1,\n };\n};\n\nexport { isColorString, splitColor };\n//# sourceMappingURL=utils.mjs.map\n","function isNullish(v) {\n return v == null;\n}\n\nexport { isNullish };\n//# sourceMappingURL=is-nullish.mjs.map\n","import { clamp } from 'motion-utils';\nimport { number, alpha } from '../numbers/index.mjs';\nimport { sanitize } from '../utils/sanitize.mjs';\nimport { splitColor, isColorString } from './utils.mjs';\n\nconst clampRgbUnit = (v) => clamp(0, 255, v);\nconst rgbUnit = {\n ...number,\n transform: (v) => Math.round(clampRgbUnit(v)),\n};\nconst rgba = {\n test: /*@__PURE__*/ isColorString(\"rgb\", \"red\"),\n parse: /*@__PURE__*/ splitColor(\"red\", \"green\", \"blue\"),\n transform: ({ red, green, blue, alpha: alpha$1 = 1 }) => \"rgba(\" +\n rgbUnit.transform(red) +\n \", \" +\n rgbUnit.transform(green) +\n \", \" +\n rgbUnit.transform(blue) +\n \", \" +\n sanitize(alpha.transform(alpha$1)) +\n \")\",\n};\n\nexport { rgbUnit, rgba };\n//# sourceMappingURL=rgba.mjs.map\n","import { rgba } from './rgba.mjs';\nimport { isColorString } from './utils.mjs';\n\nfunction parseHex(v) {\n let r = \"\";\n let g = \"\";\n let b = \"\";\n let a = \"\";\n // If we have 6 characters, ie #FF0000\n if (v.length > 5) {\n r = v.substring(1, 3);\n g = v.substring(3, 5);\n b = v.substring(5, 7);\n a = v.substring(7, 9);\n // Or we have 3 characters, ie #F00\n }\n else {\n r = v.substring(1, 2);\n g = v.substring(2, 3);\n b = v.substring(3, 4);\n a = v.substring(4, 5);\n r += r;\n g += g;\n b += b;\n a += a;\n }\n return {\n red: parseInt(r, 16),\n green: parseInt(g, 16),\n blue: parseInt(b, 16),\n alpha: a ? parseInt(a, 16) / 255 : 1,\n };\n}\nconst hex = {\n test: /*@__PURE__*/ isColorString(\"#\"),\n parse: parseHex,\n transform: rgba.transform,\n};\n\nexport { hex };\n//# sourceMappingURL=hex.mjs.map\n","/*#__NO_SIDE_EFFECTS__*/\nconst createUnitType = (unit) => ({\n test: (v) => typeof v === \"string\" && v.endsWith(unit) && v.split(\" \").length === 1,\n parse: parseFloat,\n transform: (v) => `${v}${unit}`,\n});\nconst degrees = /*@__PURE__*/ createUnitType(\"deg\");\nconst percent = /*@__PURE__*/ createUnitType(\"%\");\nconst px = /*@__PURE__*/ createUnitType(\"px\");\nconst vh = /*@__PURE__*/ createUnitType(\"vh\");\nconst vw = /*@__PURE__*/ createUnitType(\"vw\");\nconst progressPercentage = /*@__PURE__*/ (() => ({\n ...percent,\n parse: (v) => percent.parse(v) / 100,\n transform: (v) => percent.transform(v * 100),\n}))();\n\nexport { degrees, percent, progressPercentage, px, vh, vw };\n//# sourceMappingURL=units.mjs.map\n","import { alpha } from '../numbers/index.mjs';\nimport { percent } from '../numbers/units.mjs';\nimport { sanitize } from '../utils/sanitize.mjs';\nimport { splitColor, isColorString } from './utils.mjs';\n\nconst hsla = {\n test: /*@__PURE__*/ isColorString(\"hsl\", \"hue\"),\n parse: /*@__PURE__*/ splitColor(\"hue\", \"saturation\", \"lightness\"),\n transform: ({ hue, saturation, lightness, alpha: alpha$1 = 1 }) => {\n return (\"hsla(\" +\n Math.round(hue) +\n \", \" +\n percent.transform(sanitize(saturation)) +\n \", \" +\n percent.transform(sanitize(lightness)) +\n \", \" +\n sanitize(alpha.transform(alpha$1)) +\n \")\");\n },\n};\n\nexport { hsla };\n//# sourceMappingURL=hsla.mjs.map\n","import { hex } from './hex.mjs';\nimport { hsla } from './hsla.mjs';\nimport { rgba } from './rgba.mjs';\n\nconst color = {\n test: (v) => rgba.test(v) || hex.test(v) || hsla.test(v),\n parse: (v) => {\n if (rgba.test(v)) {\n return rgba.parse(v);\n }\n else if (hsla.test(v)) {\n return hsla.parse(v);\n }\n else {\n return hex.parse(v);\n }\n },\n transform: (v) => {\n return typeof v === \"string\"\n ? v\n : v.hasOwnProperty(\"red\")\n ? rgba.transform(v)\n : hsla.transform(v);\n },\n getAnimatableNone: (v) => {\n const parsed = color.parse(v);\n parsed.alpha = 0;\n return color.transform(parsed);\n },\n};\n\nexport { color };\n//# sourceMappingURL=index.mjs.map\n","const colorRegex = /(?:#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\))/giu;\n\nexport { colorRegex };\n//# sourceMappingURL=color-regex.mjs.map\n","import { color } from '../color/index.mjs';\nimport { colorRegex } from '../utils/color-regex.mjs';\nimport { floatRegex } from '../utils/float-regex.mjs';\nimport { sanitize } from '../utils/sanitize.mjs';\n\nfunction test(v) {\n return (isNaN(v) &&\n typeof v === \"string\" &&\n (v.match(floatRegex)?.length || 0) +\n (v.match(colorRegex)?.length || 0) >\n 0);\n}\nconst NUMBER_TOKEN = \"number\";\nconst COLOR_TOKEN = \"color\";\nconst VAR_TOKEN = \"var\";\nconst VAR_FUNCTION_TOKEN = \"var(\";\nconst SPLIT_TOKEN = \"${}\";\n// this regex consists of the `singleCssVariableRegex|rgbHSLValueRegex|digitRegex`\nconst complexRegex = /var\\s*\\(\\s*--(?:[\\w-]+\\s*|[\\w-]+\\s*,(?:\\s*[^)(\\s]|\\s*\\((?:[^)(]|\\([^)(]*\\))*\\))+\\s*)\\)|#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\)|-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)/giu;\nfunction analyseComplexValue(value) {\n const originalValue = value.toString();\n const values = [];\n const indexes = {\n color: [],\n number: [],\n var: [],\n };\n const types = [];\n let i = 0;\n const tokenised = originalValue.replace(complexRegex, (parsedValue) => {\n if (color.test(parsedValue)) {\n indexes.color.push(i);\n types.push(COLOR_TOKEN);\n values.push(color.parse(parsedValue));\n }\n else if (parsedValue.startsWith(VAR_FUNCTION_TOKEN)) {\n indexes.var.push(i);\n types.push(VAR_TOKEN);\n values.push(parsedValue);\n }\n else {\n indexes.number.push(i);\n types.push(NUMBER_TOKEN);\n values.push(parseFloat(parsedValue));\n }\n ++i;\n return SPLIT_TOKEN;\n });\n const split = tokenised.split(SPLIT_TOKEN);\n return { values, split, indexes, types };\n}\nfunction parseComplexValue(v) {\n return analyseComplexValue(v).values;\n}\nfunction buildTransformer({ split, types }) {\n const numSections = split.length;\n return (v) => {\n let output = \"\";\n for (let i = 0; i < numSections; i++) {\n output += split[i];\n if (v[i] !== undefined) {\n const type = types[i];\n if (type === NUMBER_TOKEN) {\n output += sanitize(v[i]);\n }\n else if (type === COLOR_TOKEN) {\n output += color.transform(v[i]);\n }\n else {\n output += v[i];\n }\n }\n }\n return output;\n };\n}\nfunction createTransformer(source) {\n return buildTransformer(analyseComplexValue(source));\n}\nconst convertNumbersToZero = (v) => typeof v === \"number\" ? 0 : color.test(v) ? color.getAnimatableNone(v) : v;\n/**\n * Convert a parsed value to its zero equivalent, but preserve numbers\n * that act as divisors in CSS calc() expressions.\n *\n * analyseComplexValue extracts numbers from CSS strings and puts the\n * surrounding text into a `split` template array. For example:\n * \"calc(var(--gap) / 5)\" → values: [var(--gap), 5]\n * split: [\"calc(\", \" / \", \")\"]\n *\n * When building a zero-equivalent for animation, naively zeroing all\n * numbers turns the divisor into 0 → \"calc(var(--gap) / 0)\" → NaN.\n * We detect this by checking whether the text preceding a number\n * (split[i]) ends with \"/\" — the CSS calc division operator.\n */\nconst convertToZero = (value, splitBefore) => {\n if (typeof value === \"number\") {\n return splitBefore?.trim().endsWith(\"/\") ? value : 0;\n }\n return convertNumbersToZero(value);\n};\nfunction getAnimatableNone(v) {\n const info = analyseComplexValue(v);\n const transformer = buildTransformer(info);\n return transformer(info.values.map((value, i) => convertToZero(value, info.split[i])));\n}\nconst complex = {\n test,\n parse: parseComplexValue,\n createTransformer,\n getAnimatableNone,\n};\n\nexport { analyseComplexValue, complex };\n//# sourceMappingURL=index.mjs.map\n","// Adapted from https://gist.github.com/mjackson/5311256\nfunction hueToRgb(p, q, t) {\n if (t < 0)\n t += 1;\n if (t > 1)\n t -= 1;\n if (t < 1 / 6)\n return p + (q - p) * 6 * t;\n if (t < 1 / 2)\n return q;\n if (t < 2 / 3)\n return p + (q - p) * (2 / 3 - t) * 6;\n return p;\n}\nfunction hslaToRgba({ hue, saturation, lightness, alpha }) {\n hue /= 360;\n saturation /= 100;\n lightness /= 100;\n let red = 0;\n let green = 0;\n let blue = 0;\n if (!saturation) {\n red = green = blue = lightness;\n }\n else {\n const q = lightness < 0.5\n ? lightness * (1 + saturation)\n : lightness + saturation - lightness * saturation;\n const p = 2 * lightness - q;\n red = hueToRgb(p, q, hue + 1 / 3);\n green = hueToRgb(p, q, hue);\n blue = hueToRgb(p, q, hue - 1 / 3);\n }\n return {\n red: Math.round(red * 255),\n green: Math.round(green * 255),\n blue: Math.round(blue * 255),\n alpha,\n };\n}\n\nexport { hslaToRgba };\n//# sourceMappingURL=hsla-to-rgba.mjs.map\n","function mixImmediate(a, b) {\n return (p) => (p > 0 ? b : a);\n}\n\nexport { mixImmediate };\n//# sourceMappingURL=immediate.mjs.map\n","/*\n Value in range from progress\n\n Given a lower limit and an upper limit, we return the value within\n that range as expressed by progress (usually a number from 0 to 1)\n\n So progress = 0.5 would change\n\n from -------- to\n\n to\n\n from ---- to\n\n E.g. from = 10, to = 20, progress = 0.5 => 15\n\n @param [number]: Lower limit of range\n @param [number]: Upper limit of range\n @param [number]: The progress between lower and upper limits expressed 0-1\n @return [number]: Value as calculated from progress within range (not limited within range)\n*/\nconst mixNumber = (from, to, progress) => {\n return from + (to - from) * progress;\n};\n\nexport { mixNumber };\n//# sourceMappingURL=number.mjs.map\n","import { warning } from 'motion-utils';\nimport { hex } from '../../value/types/color/hex.mjs';\nimport { hsla } from '../../value/types/color/hsla.mjs';\nimport { hslaToRgba } from '../../value/types/color/hsla-to-rgba.mjs';\nimport { rgba } from '../../value/types/color/rgba.mjs';\nimport { mixImmediate } from './immediate.mjs';\nimport { mixNumber } from './number.mjs';\n\n// Linear color space blending\n// Explained https://www.youtube.com/watch?v=LKnqECcg6Gw\n// Demonstrated http://codepen.io/osublake/pen/xGVVaN\nconst mixLinearColor = (from, to, v) => {\n const fromExpo = from * from;\n const expo = v * (to * to - fromExpo) + fromExpo;\n return expo < 0 ? 0 : Math.sqrt(expo);\n};\nconst colorTypes = [hex, rgba, hsla];\nconst getColorType = (v) => colorTypes.find((type) => type.test(v));\nfunction asRGBA(color) {\n const type = getColorType(color);\n warning(Boolean(type), `'${color}' is not an animatable color. Use the equivalent color code instead.`, \"color-not-animatable\");\n if (!Boolean(type))\n return false;\n let model = type.parse(color);\n if (type === hsla) {\n // TODO Remove this cast - needed since Motion's stricter typing\n model = hslaToRgba(model);\n }\n return model;\n}\nconst mixColor = (from, to) => {\n const fromRGBA = asRGBA(from);\n const toRGBA = asRGBA(to);\n if (!fromRGBA || !toRGBA) {\n return mixImmediate(from, to);\n }\n const blended = { ...fromRGBA };\n return (v) => {\n blended.red = mixLinearColor(fromRGBA.red, toRGBA.red, v);\n blended.green = mixLinearColor(fromRGBA.green, toRGBA.green, v);\n blended.blue = mixLinearColor(fromRGBA.blue, toRGBA.blue, v);\n blended.alpha = mixNumber(fromRGBA.alpha, toRGBA.alpha, v);\n return rgba.transform(blended);\n };\n};\n\nexport { mixColor, mixLinearColor };\n//# sourceMappingURL=color.mjs.map\n","const invisibleValues = new Set([\"none\", \"hidden\"]);\n/**\n * Returns a function that, when provided a progress value between 0 and 1,\n * will return the \"none\" or \"hidden\" string only when the progress is that of\n * the origin or target.\n */\nfunction mixVisibility(origin, target) {\n if (invisibleValues.has(origin)) {\n return (p) => (p <= 0 ? origin : target);\n }\n else {\n return (p) => (p >= 1 ? target : origin);\n }\n}\n\nexport { invisibleValues, mixVisibility };\n//# sourceMappingURL=visibility.mjs.map\n","import { pipe, warning } from 'motion-utils';\nimport { isCSSVariableToken } from '../../animation/utils/is-css-variable.mjs';\nimport { color } from '../../value/types/color/index.mjs';\nimport { complex, analyseComplexValue } from '../../value/types/complex/index.mjs';\nimport { mixColor } from './color.mjs';\nimport { mixImmediate } from './immediate.mjs';\nimport { mixNumber as mixNumber$1 } from './number.mjs';\nimport { invisibleValues, mixVisibility } from './visibility.mjs';\n\nfunction mixNumber(a, b) {\n return (p) => mixNumber$1(a, b, p);\n}\nfunction getMixer(a) {\n if (typeof a === \"number\") {\n return mixNumber;\n }\n else if (typeof a === \"string\") {\n return isCSSVariableToken(a)\n ? mixImmediate\n : color.test(a)\n ? mixColor\n : mixComplex;\n }\n else if (Array.isArray(a)) {\n return mixArray;\n }\n else if (typeof a === \"object\") {\n return color.test(a) ? mixColor : mixObject;\n }\n return mixImmediate;\n}\nfunction mixArray(a, b) {\n const output = [...a];\n const numValues = output.length;\n const blendValue = a.map((v, i) => getMixer(v)(v, b[i]));\n return (p) => {\n for (let i = 0; i < numValues; i++) {\n output[i] = blendValue[i](p);\n }\n return output;\n };\n}\nfunction mixObject(a, b) {\n const output = { ...a, ...b };\n const blendValue = {};\n for (const key in output) {\n if (a[key] !== undefined && b[key] !== undefined) {\n blendValue[key] = getMixer(a[key])(a[key], b[key]);\n }\n }\n return (v) => {\n for (const key in blendValue) {\n output[key] = blendValue[key](v);\n }\n return output;\n };\n}\nfunction matchOrder(origin, target) {\n const orderedOrigin = [];\n const pointers = { color: 0, var: 0, number: 0 };\n for (let i = 0; i < target.values.length; i++) {\n const type = target.types[i];\n const originIndex = origin.indexes[type][pointers[type]];\n const originValue = origin.values[originIndex] ?? 0;\n orderedOrigin[i] = originValue;\n pointers[type]++;\n }\n return orderedOrigin;\n}\nconst mixComplex = (origin, target) => {\n const template = complex.createTransformer(target);\n const originStats = analyseComplexValue(origin);\n const targetStats = analyseComplexValue(target);\n const canInterpolate = originStats.indexes.var.length === targetStats.indexes.var.length &&\n originStats.indexes.color.length === targetStats.indexes.color.length &&\n originStats.indexes.number.length >= targetStats.indexes.number.length;\n if (canInterpolate) {\n if ((invisibleValues.has(origin) &&\n !targetStats.values.length) ||\n (invisibleValues.has(target) &&\n !originStats.values.length)) {\n return mixVisibility(origin, target);\n }\n return pipe(mixArray(matchOrder(originStats, targetStats), targetStats.values), template);\n }\n else {\n warning(true, `Complex values '${origin}' and '${target}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`, \"complex-values-different\");\n return mixImmediate(origin, target);\n }\n};\n\nexport { getMixer, mixArray, mixComplex, mixObject };\n//# sourceMappingURL=complex.mjs.map\n","import { getMixer } from './complex.mjs';\nimport { mixNumber } from './number.mjs';\n\nfunction mix(from, to, p) {\n if (typeof from === \"number\" &&\n typeof to === \"number\" &&\n typeof p === \"number\") {\n return mixNumber(from, to, p);\n }\n const mixer = getMixer(from);\n return mixer(from, to);\n}\n\nexport { mix };\n//# sourceMappingURL=index.mjs.map\n","import { time } from '../../frameloop/sync-time.mjs';\nimport { frameData, cancelFrame, frame } from '../../frameloop/frame.mjs';\n\nconst frameloopDriver = (update) => {\n const passTimestamp = ({ timestamp }) => update(timestamp);\n return {\n start: (keepAlive = true) => frame.update(passTimestamp, keepAlive),\n stop: () => cancelFrame(passTimestamp),\n /**\n * If we're processing this frame we can use the\n * framelocked timestamp to keep things in sync.\n */\n now: () => (frameData.isProcessing ? frameData.timestamp : time.now()),\n };\n};\n\nexport { frameloopDriver };\n//# sourceMappingURL=frame.mjs.map\n","const generateLinearEasing = (easing, duration, // as milliseconds\nresolution = 10 // as milliseconds\n) => {\n let points = \"\";\n const numPoints = Math.max(Math.round(duration / resolution), 2);\n for (let i = 0; i < numPoints; i++) {\n points += Math.round(easing(i / (numPoints - 1)) * 10000) / 10000 + \", \";\n }\n return `linear(${points.substring(0, points.length - 2)})`;\n};\n\nexport { generateLinearEasing };\n//# sourceMappingURL=linear.mjs.map\n","/**\n * Implement a practical max duration for keyframe generation\n * to prevent infinite loops\n */\nconst maxGeneratorDuration = 20000;\nfunction calcGeneratorDuration(generator) {\n let duration = 0;\n const timeStep = 50;\n let state = generator.next(duration);\n while (!state.done && duration < maxGeneratorDuration) {\n duration += timeStep;\n state = generator.next(duration);\n }\n return duration >= maxGeneratorDuration ? Infinity : duration;\n}\n\nexport { calcGeneratorDuration, maxGeneratorDuration };\n//# sourceMappingURL=calc-duration.mjs.map\n","import { millisecondsToSeconds } from 'motion-utils';\nimport { calcGeneratorDuration, maxGeneratorDuration } from './calc-duration.mjs';\n\n/**\n * Create a progress => progress easing function from a generator.\n */\nfunction createGeneratorEasing(options, scale = 100, createGenerator) {\n const generator = createGenerator({ ...options, keyframes: [0, scale] });\n const duration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration);\n return {\n type: \"keyframes\",\n ease: (progress) => {\n return generator.next(duration * progress).value / scale;\n },\n duration: millisecondsToSeconds(duration),\n };\n}\n\nexport { createGeneratorEasing };\n//# sourceMappingURL=create-generator-easing.mjs.map\n","import { millisecondsToSeconds, clamp, secondsToMilliseconds, warning } from 'motion-utils';\nimport { generateLinearEasing } from '../waapi/utils/linear.mjs';\nimport { calcGeneratorDuration, maxGeneratorDuration } from './utils/calc-duration.mjs';\nimport { createGeneratorEasing } from './utils/create-generator-easing.mjs';\n\nconst springDefaults = {\n // Default spring physics\n stiffness: 100,\n damping: 10,\n mass: 1.0,\n velocity: 0.0,\n // Default duration/bounce-based options\n duration: 800, // in ms\n bounce: 0.3,\n visualDuration: 0.3, // in seconds\n // Rest thresholds\n restSpeed: {\n granular: 0.01,\n default: 2,\n },\n restDelta: {\n granular: 0.005,\n default: 0.5,\n },\n // Limits\n minDuration: 0.01, // in seconds\n maxDuration: 10.0, // in seconds\n minDamping: 0.05,\n maxDamping: 1,\n};\nfunction calcAngularFreq(undampedFreq, dampingRatio) {\n return undampedFreq * Math.sqrt(1 - dampingRatio * dampingRatio);\n}\nconst rootIterations = 12;\nfunction approximateRoot(envelope, derivative, initialGuess) {\n let result = initialGuess;\n for (let i = 1; i < rootIterations; i++) {\n result = result - envelope(result) / derivative(result);\n }\n return result;\n}\n/**\n * This is ported from the Framer implementation of duration-based spring resolution.\n */\nconst safeMin = 0.001;\nfunction findSpring({ duration = springDefaults.duration, bounce = springDefaults.bounce, velocity = springDefaults.velocity, mass = springDefaults.mass, }) {\n let envelope;\n let derivative;\n warning(duration <= secondsToMilliseconds(springDefaults.maxDuration), \"Spring duration must be 10 seconds or less\", \"spring-duration-limit\");\n let dampingRatio = 1 - bounce;\n /**\n * Restrict dampingRatio and duration to within acceptable ranges.\n */\n dampingRatio = clamp(springDefaults.minDamping, springDefaults.maxDamping, dampingRatio);\n duration = clamp(springDefaults.minDuration, springDefaults.maxDuration, millisecondsToSeconds(duration));\n if (dampingRatio < 1) {\n /**\n * Underdamped spring\n */\n envelope = (undampedFreq) => {\n const exponentialDecay = undampedFreq * dampingRatio;\n const delta = exponentialDecay * duration;\n const a = exponentialDecay - velocity;\n const b = calcAngularFreq(undampedFreq, dampingRatio);\n const c = Math.exp(-delta);\n return safeMin - (a / b) * c;\n };\n derivative = (undampedFreq) => {\n const exponentialDecay = undampedFreq * dampingRatio;\n const delta = exponentialDecay * duration;\n const d = delta * velocity + velocity;\n const e = Math.pow(dampingRatio, 2) * Math.pow(undampedFreq, 2) * duration;\n const f = Math.exp(-delta);\n const g = calcAngularFreq(Math.pow(undampedFreq, 2), dampingRatio);\n const factor = -envelope(undampedFreq) + safeMin > 0 ? -1 : 1;\n return (factor * ((d - e) * f)) / g;\n };\n }\n else {\n /**\n * Critically-damped spring\n */\n envelope = (undampedFreq) => {\n const a = Math.exp(-undampedFreq * duration);\n const b = (undampedFreq - velocity) * duration + 1;\n return -safeMin + a * b;\n };\n derivative = (undampedFreq) => {\n const a = Math.exp(-undampedFreq * duration);\n const b = (velocity - undampedFreq) * (duration * duration);\n return a * b;\n };\n }\n const initialGuess = 5 / duration;\n const undampedFreq = approximateRoot(envelope, derivative, initialGuess);\n duration = secondsToMilliseconds(duration);\n if (isNaN(undampedFreq)) {\n return {\n stiffness: springDefaults.stiffness,\n damping: springDefaults.damping,\n duration,\n };\n }\n else {\n const stiffness = Math.pow(undampedFreq, 2) * mass;\n return {\n stiffness,\n damping: dampingRatio * 2 * Math.sqrt(mass * stiffness),\n duration,\n };\n }\n}\nconst durationKeys = [\"duration\", \"bounce\"];\nconst physicsKeys = [\"stiffness\", \"damping\", \"mass\"];\nfunction isSpringType(options, keys) {\n return keys.some((key) => options[key] !== undefined);\n}\nfunction getSpringOptions(options) {\n let springOptions = {\n velocity: springDefaults.velocity,\n stiffness: springDefaults.stiffness,\n damping: springDefaults.damping,\n mass: springDefaults.mass,\n isResolvedFromDuration: false,\n ...options,\n };\n // stiffness/damping/mass overrides duration/bounce\n if (!isSpringType(options, physicsKeys) &&\n isSpringType(options, durationKeys)) {\n // Time-defined springs should ignore inherited velocity.\n // Velocity from interrupted animations can cause findSpring()\n // to compute wildly different spring parameters, leading to\n // massive oscillation on small-range animations.\n springOptions.velocity = 0;\n if (options.visualDuration) {\n const visualDuration = options.visualDuration;\n const root = (2 * Math.PI) / (visualDuration * 1.2);\n const stiffness = root * root;\n const damping = 2 *\n clamp(0.05, 1, 1 - (options.bounce || 0)) *\n Math.sqrt(stiffness);\n springOptions = {\n ...springOptions,\n mass: springDefaults.mass,\n stiffness,\n damping,\n };\n }\n else {\n const derived = findSpring({ ...options, velocity: 0 });\n springOptions = {\n ...springOptions,\n ...derived,\n mass: springDefaults.mass,\n };\n springOptions.isResolvedFromDuration = true;\n }\n }\n return springOptions;\n}\nfunction spring(optionsOrVisualDuration = springDefaults.visualDuration, bounce = springDefaults.bounce) {\n const options = typeof optionsOrVisualDuration !== \"object\"\n ? {\n visualDuration: optionsOrVisualDuration,\n keyframes: [0, 1],\n bounce,\n }\n : optionsOrVisualDuration;\n let { restSpeed, restDelta } = options;\n const origin = options.keyframes[0];\n const target = options.keyframes[options.keyframes.length - 1];\n /**\n * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator\n * to reduce GC during animation.\n */\n const state = { done: false, value: origin };\n const { stiffness, damping, mass, duration, velocity, isResolvedFromDuration, } = getSpringOptions({\n ...options,\n velocity: -millisecondsToSeconds(options.velocity || 0),\n });\n const initialVelocity = velocity || 0.0;\n const dampingRatio = damping / (2 * Math.sqrt(stiffness * mass));\n const initialDelta = target - origin;\n const undampedAngularFreq = millisecondsToSeconds(Math.sqrt(stiffness / mass));\n /**\n * If we're working on a granular scale, use smaller defaults for determining\n * when the spring is finished.\n *\n * These defaults have been selected emprically based on what strikes a good\n * ratio between feeling good and finishing as soon as changes are imperceptible.\n */\n const isGranularScale = Math.abs(initialDelta) < 5;\n restSpeed || (restSpeed = isGranularScale\n ? springDefaults.restSpeed.granular\n : springDefaults.restSpeed.default);\n restDelta || (restDelta = isGranularScale\n ? springDefaults.restDelta.granular\n : springDefaults.restDelta.default);\n let resolveSpring;\n let resolveVelocity;\n // Underdamped coefficients, hoisted for use in the inlined next() hot path\n let angularFreq;\n let A;\n let sinCoeff;\n let cosCoeff;\n if (dampingRatio < 1) {\n angularFreq = calcAngularFreq(undampedAngularFreq, dampingRatio);\n A =\n (initialVelocity +\n dampingRatio * undampedAngularFreq * initialDelta) /\n angularFreq;\n // Underdamped spring\n resolveSpring = (t) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);\n return (target -\n envelope *\n (A * Math.sin(angularFreq * t) +\n initialDelta * Math.cos(angularFreq * t)));\n };\n // Analytical derivative of underdamped spring (px/ms)\n sinCoeff =\n dampingRatio * undampedAngularFreq * A + initialDelta * angularFreq;\n cosCoeff =\n dampingRatio * undampedAngularFreq * initialDelta - A * angularFreq;\n resolveVelocity = (t) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);\n return envelope *\n (sinCoeff * Math.sin(angularFreq * t) +\n cosCoeff * Math.cos(angularFreq * t));\n };\n }\n else if (dampingRatio === 1) {\n // Critically damped spring\n resolveSpring = (t) => target -\n Math.exp(-undampedAngularFreq * t) *\n (initialDelta +\n (initialVelocity + undampedAngularFreq * initialDelta) * t);\n // Analytical derivative of critically damped spring (px/ms)\n const C = initialVelocity + undampedAngularFreq * initialDelta;\n resolveVelocity = (t) => Math.exp(-undampedAngularFreq * t) *\n (undampedAngularFreq * C * t - initialVelocity);\n }\n else {\n // Overdamped spring\n const dampedAngularFreq = undampedAngularFreq * Math.sqrt(dampingRatio * dampingRatio - 1);\n resolveSpring = (t) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);\n // When performing sinh or cosh values can hit Infinity so we cap them here\n const freqForT = Math.min(dampedAngularFreq * t, 300);\n return (target -\n (envelope *\n ((initialVelocity +\n dampingRatio * undampedAngularFreq * initialDelta) *\n Math.sinh(freqForT) +\n dampedAngularFreq *\n initialDelta *\n Math.cosh(freqForT))) /\n dampedAngularFreq);\n };\n // Analytical derivative of overdamped spring (px/ms)\n const P = (initialVelocity +\n dampingRatio * undampedAngularFreq * initialDelta) /\n dampedAngularFreq;\n const sinhCoeff = dampingRatio * undampedAngularFreq * P - initialDelta * dampedAngularFreq;\n const coshCoeff = dampingRatio * undampedAngularFreq * initialDelta - P * dampedAngularFreq;\n resolveVelocity = (t) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);\n const freqForT = Math.min(dampedAngularFreq * t, 300);\n return envelope *\n (sinhCoeff * Math.sinh(freqForT) +\n coshCoeff * Math.cosh(freqForT));\n };\n }\n const generator = {\n calculatedDuration: isResolvedFromDuration ? duration || null : null,\n velocity: (t) => secondsToMilliseconds(resolveVelocity(t)),\n next: (t) => {\n /**\n * For underdamped physics springs we need both position and\n * velocity each tick. Compute shared trig values once to avoid\n * duplicate Math.exp/sin/cos calls on the hot path.\n */\n if (!isResolvedFromDuration && dampingRatio < 1) {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);\n const sin = Math.sin(angularFreq * t);\n const cos = Math.cos(angularFreq * t);\n const current = target -\n envelope *\n (A * sin + initialDelta * cos);\n const currentVelocity = secondsToMilliseconds(envelope *\n (sinCoeff * sin + cosCoeff * cos));\n state.done =\n Math.abs(currentVelocity) <= restSpeed &&\n Math.abs(target - current) <= restDelta;\n state.value = state.done ? target : current;\n return state;\n }\n const current = resolveSpring(t);\n if (!isResolvedFromDuration) {\n const currentVelocity = secondsToMilliseconds(resolveVelocity(t));\n state.done =\n Math.abs(currentVelocity) <= restSpeed &&\n Math.abs(target - current) <= restDelta;\n }\n else {\n state.done = t >= duration;\n }\n state.value = state.done ? target : current;\n return state;\n },\n toString: () => {\n const calculatedDuration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration);\n const easing = generateLinearEasing((progress) => generator.next(calculatedDuration * progress).value, calculatedDuration, 30);\n return calculatedDuration + \"ms \" + easing;\n },\n toTransition: () => { },\n };\n return generator;\n}\nspring.applyToOptions = (options) => {\n const generatorOptions = createGeneratorEasing(options, 100, spring);\n options.ease = generatorOptions.ease;\n options.duration = secondsToMilliseconds(generatorOptions.duration);\n options.type = \"keyframes\";\n return options;\n};\n\nexport { spring };\n//# sourceMappingURL=spring.mjs.map\n","import { velocityPerSecond } from 'motion-utils';\n\nconst velocitySampleDuration = 5; // ms\nfunction getGeneratorVelocity(resolveValue, t, current) {\n const prevT = Math.max(t - velocitySampleDuration, 0);\n return velocityPerSecond(current - resolveValue(prevT), t - prevT);\n}\n\nexport { getGeneratorVelocity };\n//# sourceMappingURL=velocity.mjs.map\n","import { spring } from './spring.mjs';\nimport { getGeneratorVelocity } from './utils/velocity.mjs';\n\nfunction inertia({ keyframes, velocity = 0.0, power = 0.8, timeConstant = 325, bounceDamping = 10, bounceStiffness = 500, modifyTarget, min, max, restDelta = 0.5, restSpeed, }) {\n const origin = keyframes[0];\n const state = {\n done: false,\n value: origin,\n };\n const isOutOfBounds = (v) => (min !== undefined && v < min) || (max !== undefined && v > max);\n const nearestBoundary = (v) => {\n if (min === undefined)\n return max;\n if (max === undefined)\n return min;\n return Math.abs(min - v) < Math.abs(max - v) ? min : max;\n };\n let amplitude = power * velocity;\n const ideal = origin + amplitude;\n const target = modifyTarget === undefined ? ideal : modifyTarget(ideal);\n /**\n * If the target has changed we need to re-calculate the amplitude, otherwise\n * the animation will start from the wrong position.\n */\n if (target !== ideal)\n amplitude = target - origin;\n const calcDelta = (t) => -amplitude * Math.exp(-t / timeConstant);\n const calcLatest = (t) => target + calcDelta(t);\n const applyFriction = (t) => {\n const delta = calcDelta(t);\n const latest = calcLatest(t);\n state.done = Math.abs(delta) <= restDelta;\n state.value = state.done ? target : latest;\n };\n /**\n * Ideally this would resolve for t in a stateless way, we could\n * do that by always precalculating the animation but as we know\n * this will be done anyway we can assume that spring will\n * be discovered during that.\n */\n let timeReachedBoundary;\n let spring$1;\n const checkCatchBoundary = (t) => {\n if (!isOutOfBounds(state.value))\n return;\n timeReachedBoundary = t;\n spring$1 = spring({\n keyframes: [state.value, nearestBoundary(state.value)],\n velocity: getGeneratorVelocity(calcLatest, t, state.value), // TODO: This should be passing * 1000\n damping: bounceDamping,\n stiffness: bounceStiffness,\n restDelta,\n restSpeed,\n });\n };\n checkCatchBoundary(0);\n return {\n calculatedDuration: null,\n next: (t) => {\n /**\n * We need to resolve the friction to figure out if we need a\n * spring but we don't want to do this twice per frame. So here\n * we flag if we updated for this frame and later if we did\n * we can skip doing it again.\n */\n let hasUpdatedFrame = false;\n if (!spring$1 && timeReachedBoundary === undefined) {\n hasUpdatedFrame = true;\n applyFriction(t);\n checkCatchBoundary(t);\n }\n /**\n * If we have a spring and the provided t is beyond the moment the friction\n * animation crossed the min/max boundary, use the spring.\n */\n if (timeReachedBoundary !== undefined && t >= timeReachedBoundary) {\n return spring$1.next(t - timeReachedBoundary);\n }\n else {\n !hasUpdatedFrame && applyFriction(t);\n return state;\n }\n },\n };\n}\n\nexport { inertia };\n//# sourceMappingURL=inertia.mjs.map\n","import { invariant, clamp, MotionGlobalConfig, noop, pipe, progress } from 'motion-utils';\nimport { mix } from './mix/index.mjs';\n\nfunction createMixers(output, ease, customMixer) {\n const mixers = [];\n const mixerFactory = customMixer || MotionGlobalConfig.mix || mix;\n const numMixers = output.length - 1;\n for (let i = 0; i < numMixers; i++) {\n let mixer = mixerFactory(output[i], output[i + 1]);\n if (ease) {\n const easingFunction = Array.isArray(ease) ? ease[i] || noop : ease;\n mixer = pipe(easingFunction, mixer);\n }\n mixers.push(mixer);\n }\n return mixers;\n}\n/**\n * Create a function that maps from a numerical input array to a generic output array.\n *\n * Accepts:\n * - Numbers\n * - Colors (hex, hsl, hsla, rgb, rgba)\n * - Complex (combinations of one or more numbers or strings)\n *\n * ```jsx\n * const mixColor = interpolate([0, 1], ['#fff', '#000'])\n *\n * mixColor(0.5) // 'rgba(128, 128, 128, 1)'\n * ```\n *\n * TODO Revisit this approach once we've moved to data models for values,\n * probably not needed to pregenerate mixer functions.\n *\n * @public\n */\nfunction interpolate(input, output, { clamp: isClamp = true, ease, mixer } = {}) {\n const inputLength = input.length;\n invariant(inputLength === output.length, \"Both input and output ranges must be the same length\", \"range-length\");\n /**\n * If we're only provided a single input, we can just make a function\n * that returns the output.\n */\n if (inputLength === 1)\n return () => output[0];\n if (inputLength === 2 && output[0] === output[1])\n return () => output[1];\n const isZeroDeltaRange = input[0] === input[1];\n // If input runs highest -> lowest, reverse both arrays\n if (input[0] > input[inputLength - 1]) {\n input = [...input].reverse();\n output = [...output].reverse();\n }\n const mixers = createMixers(output, ease, mixer);\n const numMixers = mixers.length;\n const interpolator = (v) => {\n if (isZeroDeltaRange && v < input[0])\n return output[0];\n let i = 0;\n if (numMixers > 1) {\n for (; i < input.length - 2; i++) {\n if (v < input[i + 1])\n break;\n }\n }\n const progressInRange = progress(input[i], input[i + 1], v);\n return mixers[i](progressInRange);\n };\n return isClamp\n ? (v) => interpolator(clamp(input[0], input[inputLength - 1], v))\n : interpolator;\n}\n\nexport { interpolate };\n//# sourceMappingURL=interpolate.mjs.map\n","import { progress } from 'motion-utils';\nimport { mixNumber } from '../../../utils/mix/number.mjs';\n\nfunction fillOffset(offset, remaining) {\n const min = offset[offset.length - 1];\n for (let i = 1; i <= remaining; i++) {\n const offsetProgress = progress(0, remaining, i);\n offset.push(mixNumber(min, 1, offsetProgress));\n }\n}\n\nexport { fillOffset };\n//# sourceMappingURL=fill.mjs.map\n","import { fillOffset } from './fill.mjs';\n\nfunction defaultOffset(arr) {\n const offset = [0];\n fillOffset(offset, arr.length - 1);\n return offset;\n}\n\nexport { defaultOffset };\n//# sourceMappingURL=default.mjs.map\n","import { easeInOut, isEasingArray, easingDefinitionToFunction } from 'motion-utils';\nimport { interpolate } from '../../utils/interpolate.mjs';\nimport { defaultOffset } from '../keyframes/offsets/default.mjs';\nimport { convertOffsetToTimes } from '../keyframes/offsets/time.mjs';\n\nfunction defaultEasing(values, easing) {\n return values.map(() => easing || easeInOut).splice(0, values.length - 1);\n}\nfunction keyframes({ duration = 300, keyframes: keyframeValues, times, ease = \"easeInOut\", }) {\n /**\n * Easing functions can be externally defined as strings. Here we convert them\n * into actual functions.\n */\n const easingFunctions = isEasingArray(ease)\n ? ease.map(easingDefinitionToFunction)\n : easingDefinitionToFunction(ease);\n /**\n * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator\n * to reduce GC during animation.\n */\n const state = {\n done: false,\n value: keyframeValues[0],\n };\n /**\n * Create a times array based on the provided 0-1 offsets\n */\n const absoluteTimes = convertOffsetToTimes(\n // Only use the provided offsets if they're the correct length\n // TODO Maybe we should warn here if there's a length mismatch\n times && times.length === keyframeValues.length\n ? times\n : defaultOffset(keyframeValues), duration);\n const mapTimeToKeyframe = interpolate(absoluteTimes, keyframeValues, {\n ease: Array.isArray(easingFunctions)\n ? easingFunctions\n : defaultEasing(keyframeValues, easingFunctions),\n });\n return {\n calculatedDuration: duration,\n next: (t) => {\n state.value = mapTimeToKeyframe(t);\n state.done = t >= duration;\n return state;\n },\n };\n}\n\nexport { defaultEasing, keyframes };\n//# sourceMappingURL=keyframes.mjs.map\n","function convertOffsetToTimes(offset, duration) {\n return offset.map((o) => o * duration);\n}\n\nexport { convertOffsetToTimes };\n//# sourceMappingURL=time.mjs.map\n","const isNotNull = (value) => value !== null;\nfunction getFinalKeyframe(keyframes, { repeat, repeatType = \"loop\" }, finalKeyframe, speed = 1) {\n const resolvedKeyframes = keyframes.filter(isNotNull);\n const useFirstKeyframe = speed < 0 || (repeat && repeatType !== \"loop\" && repeat % 2 === 1);\n const index = useFirstKeyframe ? 0 : resolvedKeyframes.length - 1;\n return !index || finalKeyframe === undefined\n ? resolvedKeyframes[index]\n : finalKeyframe;\n}\n\nexport { getFinalKeyframe };\n//# sourceMappingURL=get-final.mjs.map\n","import { inertia } from '../generators/inertia.mjs';\nimport { keyframes } from '../generators/keyframes.mjs';\nimport { spring } from '../generators/spring.mjs';\n\nconst transitionTypeMap = {\n decay: inertia,\n inertia,\n tween: keyframes,\n keyframes: keyframes,\n spring,\n};\nfunction replaceTransitionType(transition) {\n if (typeof transition.type === \"string\") {\n transition.type = transitionTypeMap[transition.type];\n }\n}\n\nexport { replaceTransitionType };\n//# sourceMappingURL=replace-transition-type.mjs.map\n","class WithPromise {\n constructor() {\n this.updateFinished();\n }\n get finished() {\n return this._finished;\n }\n updateFinished() {\n this._finished = new Promise((resolve) => {\n this.resolve = resolve;\n });\n }\n notifyFinished() {\n this.resolve();\n }\n /**\n * Allows the animation to be awaited.\n *\n * @deprecated Use `finished` instead.\n */\n then(onResolve, onReject) {\n return this.finished.then(onResolve, onReject);\n }\n}\n\nexport { WithPromise };\n//# sourceMappingURL=WithPromise.mjs.map\n","import { invariant, pipe, clamp, millisecondsToSeconds, secondsToMilliseconds } from 'motion-utils';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { mix } from '../utils/mix/index.mjs';\nimport { frameloopDriver } from './drivers/frame.mjs';\nimport { inertia } from './generators/inertia.mjs';\nimport { keyframes } from './generators/keyframes.mjs';\nimport { calcGeneratorDuration } from './generators/utils/calc-duration.mjs';\nimport { getGeneratorVelocity } from './generators/utils/velocity.mjs';\nimport { getFinalKeyframe } from './keyframes/get-final.mjs';\nimport { replaceTransitionType } from './utils/replace-transition-type.mjs';\nimport { WithPromise } from './utils/WithPromise.mjs';\n\nconst percentToProgress = (percent) => percent / 100;\nclass JSAnimation extends WithPromise {\n constructor(options) {\n super();\n this.state = \"idle\";\n this.startTime = null;\n this.isStopped = false;\n /**\n * The current time of the animation.\n */\n this.currentTime = 0;\n /**\n * The time at which the animation was paused.\n */\n this.holdTime = null;\n /**\n * Playback speed as a factor. 0 would be stopped, -1 reverse and 2 double speed.\n */\n this.playbackSpeed = 1;\n /**\n * Reusable state object for the delay phase to avoid\n * allocating a new object every frame.\n */\n this.delayState = {\n done: false,\n value: undefined,\n };\n /**\n * This method is bound to the instance to fix a pattern where\n * animation.stop is returned as a reference from a useEffect.\n */\n this.stop = () => {\n const { motionValue } = this.options;\n if (motionValue && motionValue.updatedAt !== time.now()) {\n this.tick(time.now());\n }\n this.isStopped = true;\n if (this.state === \"idle\")\n return;\n this.teardown();\n this.options.onStop?.();\n };\n this.options = options;\n this.initAnimation();\n this.play();\n if (options.autoplay === false)\n this.pause();\n }\n initAnimation() {\n const { options } = this;\n replaceTransitionType(options);\n const { type = keyframes, repeat = 0, repeatDelay = 0, repeatType, velocity = 0, } = options;\n let { keyframes: keyframes$1 } = options;\n const generatorFactory = type || keyframes;\n if (process.env.NODE_ENV !== \"production\" &&\n generatorFactory !== keyframes) {\n invariant(keyframes$1.length <= 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${keyframes$1}`, \"spring-two-frames\");\n }\n if (generatorFactory !== keyframes &&\n typeof keyframes$1[0] !== \"number\") {\n this.mixKeyframes = pipe(percentToProgress, mix(keyframes$1[0], keyframes$1[1]));\n keyframes$1 = [0, 100];\n }\n const generator = generatorFactory({ ...options, keyframes: keyframes$1 });\n /**\n * If we have a mirror repeat type we need to create a second generator that outputs the\n * mirrored (not reversed) animation and later ping pong between the two generators.\n */\n if (repeatType === \"mirror\") {\n this.mirroredGenerator = generatorFactory({\n ...options,\n keyframes: [...keyframes$1].reverse(),\n velocity: -velocity,\n });\n }\n /**\n * If duration is undefined and we have repeat options,\n * we need to calculate a duration from the generator.\n *\n * We set it to the generator itself to cache the duration.\n * Any timeline resolver will need to have already precalculated\n * the duration by this step.\n */\n if (generator.calculatedDuration === null) {\n generator.calculatedDuration = calcGeneratorDuration(generator);\n }\n const { calculatedDuration } = generator;\n this.calculatedDuration = calculatedDuration;\n this.resolvedDuration = calculatedDuration + repeatDelay;\n this.totalDuration = this.resolvedDuration * (repeat + 1) - repeatDelay;\n this.generator = generator;\n }\n updateTime(timestamp) {\n const animationTime = Math.round(timestamp - this.startTime) * this.playbackSpeed;\n // Update currentTime\n if (this.holdTime !== null) {\n this.currentTime = this.holdTime;\n }\n else {\n // Rounding the time because floating point arithmetic is not always accurate, e.g. 3000.367 - 1000.367 =\n // 2000.0000000000002. This is a problem when we are comparing the currentTime with the duration, for\n // example.\n this.currentTime = animationTime;\n }\n }\n tick(timestamp, sample = false) {\n const { generator, totalDuration, mixKeyframes, mirroredGenerator, resolvedDuration, calculatedDuration, } = this;\n if (this.startTime === null)\n return generator.next(0);\n const { delay = 0, keyframes, repeat, repeatType, repeatDelay, type, onUpdate, finalKeyframe, } = this.options;\n /**\n * requestAnimationFrame timestamps can come through as lower than\n * the startTime as set by performance.now(). Here we prevent this,\n * though in the future it could be possible to make setting startTime\n * a pending operation that gets resolved here.\n */\n if (this.speed > 0) {\n this.startTime = Math.min(this.startTime, timestamp);\n }\n else if (this.speed < 0) {\n this.startTime = Math.min(timestamp - totalDuration / this.speed, this.startTime);\n }\n if (sample) {\n this.currentTime = timestamp;\n }\n else {\n this.updateTime(timestamp);\n }\n // Rebase on delay\n const timeWithoutDelay = this.currentTime - delay * (this.playbackSpeed >= 0 ? 1 : -1);\n const isInDelayPhase = this.playbackSpeed >= 0\n ? timeWithoutDelay < 0\n : timeWithoutDelay > totalDuration;\n this.currentTime = Math.max(timeWithoutDelay, 0);\n // If this animation has finished, set the current time to the total duration.\n if (this.state === \"finished\" && this.holdTime === null) {\n this.currentTime = totalDuration;\n }\n let elapsed = this.currentTime;\n let frameGenerator = generator;\n if (repeat) {\n /**\n * Get the current progress (0-1) of the animation. If t is >\n * than duration we'll get values like 2.5 (midway through the\n * third iteration)\n */\n const progress = Math.min(this.currentTime, totalDuration) / resolvedDuration;\n /**\n * Get the current iteration (0 indexed). For instance the floor of\n * 2.5 is 2.\n */\n let currentIteration = Math.floor(progress);\n /**\n * Get the current progress of the iteration by taking the remainder\n * so 2.5 is 0.5 through iteration 2\n */\n let iterationProgress = progress % 1.0;\n /**\n * If iteration progress is 1 we count that as the end\n * of the previous iteration.\n */\n if (!iterationProgress && progress >= 1) {\n iterationProgress = 1;\n }\n iterationProgress === 1 && currentIteration--;\n currentIteration = Math.min(currentIteration, repeat + 1);\n /**\n * Reverse progress if we're not running in \"normal\" direction\n */\n const isOddIteration = Boolean(currentIteration % 2);\n if (isOddIteration) {\n if (repeatType === \"reverse\") {\n iterationProgress = 1 - iterationProgress;\n if (repeatDelay) {\n iterationProgress -= repeatDelay / resolvedDuration;\n }\n }\n else if (repeatType === \"mirror\") {\n frameGenerator = mirroredGenerator;\n }\n }\n elapsed = clamp(0, 1, iterationProgress) * resolvedDuration;\n }\n /**\n * If we're in negative time, set state as the initial keyframe.\n * This prevents delay: x, duration: 0 animations from finishing\n * instantly.\n */\n let state;\n if (isInDelayPhase) {\n this.delayState.value = keyframes[0];\n state = this.delayState;\n }\n else {\n state = frameGenerator.next(elapsed);\n }\n if (mixKeyframes && !isInDelayPhase) {\n state.value = mixKeyframes(state.value);\n }\n let { done } = state;\n if (!isInDelayPhase && calculatedDuration !== null) {\n done =\n this.playbackSpeed >= 0\n ? this.currentTime >= totalDuration\n : this.currentTime <= 0;\n }\n const isAnimationFinished = this.holdTime === null &&\n (this.state === \"finished\" || (this.state === \"running\" && done));\n // TODO: The exception for inertia could be cleaner here\n if (isAnimationFinished && type !== inertia) {\n state.value = getFinalKeyframe(keyframes, this.options, finalKeyframe, this.speed);\n }\n if (onUpdate) {\n onUpdate(state.value);\n }\n if (isAnimationFinished) {\n this.finish();\n }\n return state;\n }\n /**\n * Allows the returned animation to be awaited or promise-chained. Currently\n * resolves when the animation finishes at all but in a future update could/should\n * reject if its cancels.\n */\n then(resolve, reject) {\n return this.finished.then(resolve, reject);\n }\n get duration() {\n return millisecondsToSeconds(this.calculatedDuration);\n }\n get iterationDuration() {\n const { delay = 0 } = this.options || {};\n return this.duration + millisecondsToSeconds(delay);\n }\n get time() {\n return millisecondsToSeconds(this.currentTime);\n }\n set time(newTime) {\n newTime = secondsToMilliseconds(newTime);\n this.currentTime = newTime;\n if (this.startTime === null ||\n this.holdTime !== null ||\n this.playbackSpeed === 0) {\n this.holdTime = newTime;\n }\n else if (this.driver) {\n this.startTime = this.driver.now() - newTime / this.playbackSpeed;\n }\n if (this.driver) {\n this.driver.start(false);\n }\n else {\n this.startTime = 0;\n this.state = \"paused\";\n this.holdTime = newTime;\n this.tick(newTime);\n }\n }\n /**\n * Returns the generator's velocity at the current time in units/second.\n * Uses the analytical derivative when available (springs), avoiding\n * the MotionValue's frame-dependent velocity estimation.\n */\n getGeneratorVelocity() {\n const t = this.currentTime;\n if (t <= 0)\n return this.options.velocity || 0;\n if (this.generator.velocity) {\n return this.generator.velocity(t);\n }\n // Fallback: finite difference\n const current = this.generator.next(t).value;\n return getGeneratorVelocity((s) => this.generator.next(s).value, t, current);\n }\n get speed() {\n return this.playbackSpeed;\n }\n set speed(newSpeed) {\n const hasChanged = this.playbackSpeed !== newSpeed;\n if (hasChanged && this.driver) {\n this.updateTime(time.now());\n }\n this.playbackSpeed = newSpeed;\n if (hasChanged && this.driver) {\n this.time = millisecondsToSeconds(this.currentTime);\n }\n }\n play() {\n if (this.isStopped)\n return;\n const { driver = frameloopDriver, startTime } = this.options;\n if (!this.driver) {\n this.driver = driver((timestamp) => this.tick(timestamp));\n }\n this.options.onPlay?.();\n const now = this.driver.now();\n if (this.state === \"finished\") {\n this.updateFinished();\n this.startTime = now;\n }\n else if (this.holdTime !== null) {\n this.startTime = now - this.holdTime;\n }\n else if (!this.startTime) {\n this.startTime = startTime ?? now;\n }\n if (this.state === \"finished\" && this.speed < 0) {\n this.startTime += this.calculatedDuration;\n }\n this.holdTime = null;\n /**\n * Set playState to running only after we've used it in\n * the previous logic.\n */\n this.state = \"running\";\n this.driver.start();\n }\n pause() {\n this.state = \"paused\";\n this.updateTime(time.now());\n this.holdTime = this.currentTime;\n }\n complete() {\n if (this.state !== \"running\") {\n this.play();\n }\n this.state = \"finished\";\n this.holdTime = null;\n }\n finish() {\n this.notifyFinished();\n this.teardown();\n this.state = \"finished\";\n this.options.onComplete?.();\n }\n cancel() {\n this.holdTime = null;\n this.startTime = 0;\n this.tick(0);\n this.teardown();\n this.options.onCancel?.();\n }\n teardown() {\n this.state = \"idle\";\n this.stopDriver();\n this.startTime = this.holdTime = null;\n }\n stopDriver() {\n if (!this.driver)\n return;\n this.driver.stop();\n this.driver = undefined;\n }\n sample(sampleTime) {\n this.startTime = 0;\n return this.tick(sampleTime, true);\n }\n attachTimeline(timeline) {\n if (this.options.allowFlatten) {\n this.options.type = \"keyframes\";\n this.options.ease = \"linear\";\n this.initAnimation();\n }\n this.driver?.stop();\n return timeline.observe(this);\n }\n}\n// Legacy function support\nfunction animateValue(options) {\n return new JSAnimation(options);\n}\n\nexport { JSAnimation, animateValue };\n//# sourceMappingURL=JSAnimation.mjs.map\n","const radToDeg = (rad) => (rad * 180) / Math.PI;\nconst rotate = (v) => {\n const angle = radToDeg(Math.atan2(v[1], v[0]));\n return rebaseAngle(angle);\n};\nconst matrix2dParsers = {\n x: 4,\n y: 5,\n translateX: 4,\n translateY: 5,\n scaleX: 0,\n scaleY: 3,\n scale: (v) => (Math.abs(v[0]) + Math.abs(v[3])) / 2,\n rotate,\n rotateZ: rotate,\n skewX: (v) => radToDeg(Math.atan(v[1])),\n skewY: (v) => radToDeg(Math.atan(v[2])),\n skew: (v) => (Math.abs(v[1]) + Math.abs(v[2])) / 2,\n};\nconst rebaseAngle = (angle) => {\n angle = angle % 360;\n if (angle < 0)\n angle += 360;\n return angle;\n};\nconst rotateZ = rotate;\nconst scaleX = (v) => Math.sqrt(v[0] * v[0] + v[1] * v[1]);\nconst scaleY = (v) => Math.sqrt(v[4] * v[4] + v[5] * v[5]);\nconst matrix3dParsers = {\n x: 12,\n y: 13,\n z: 14,\n translateX: 12,\n translateY: 13,\n translateZ: 14,\n scaleX,\n scaleY,\n scale: (v) => (scaleX(v) + scaleY(v)) / 2,\n rotateX: (v) => rebaseAngle(radToDeg(Math.atan2(v[6], v[5]))),\n rotateY: (v) => rebaseAngle(radToDeg(Math.atan2(-v[2], v[0]))),\n rotateZ,\n rotate: rotateZ,\n skewX: (v) => radToDeg(Math.atan(v[4])),\n skewY: (v) => radToDeg(Math.atan(v[1])),\n skew: (v) => (Math.abs(v[1]) + Math.abs(v[4])) / 2,\n};\nfunction defaultTransformValue(name) {\n return name.includes(\"scale\") ? 1 : 0;\n}\nfunction parseValueFromTransform(transform, name) {\n if (!transform || transform === \"none\") {\n return defaultTransformValue(name);\n }\n const matrix3dMatch = transform.match(/^matrix3d\\(([-\\d.e\\s,]+)\\)$/u);\n let parsers;\n let match;\n if (matrix3dMatch) {\n parsers = matrix3dParsers;\n match = matrix3dMatch;\n }\n else {\n const matrix2dMatch = transform.match(/^matrix\\(([-\\d.e\\s,]+)\\)$/u);\n parsers = matrix2dParsers;\n match = matrix2dMatch;\n }\n if (!match) {\n return defaultTransformValue(name);\n }\n const valueParser = parsers[name];\n const values = match[1].split(\",\").map(convertTransformToNumber);\n return typeof valueParser === \"function\"\n ? valueParser(values)\n : values[valueParser];\n}\nconst readTransformValue = (instance, name) => {\n const { transform = \"none\" } = getComputedStyle(instance);\n return parseValueFromTransform(transform, name);\n};\nfunction convertTransformToNumber(value) {\n return parseFloat(value.trim());\n}\n\nexport { defaultTransformValue, parseValueFromTransform, readTransformValue };\n//# sourceMappingURL=parse-transform.mjs.map\n","/**\n * Generate a list of every possible transform key.\n */\nconst transformPropOrder = [\n \"transformPerspective\",\n \"x\",\n \"y\",\n \"z\",\n \"translateX\",\n \"translateY\",\n \"translateZ\",\n \"scale\",\n \"scaleX\",\n \"scaleY\",\n \"rotate\",\n \"rotateX\",\n \"rotateY\",\n \"rotateZ\",\n \"skew\",\n \"skewX\",\n \"skewY\",\n];\n/**\n * A quick lookup for transform props.\n *\n * `pathRotation` is a transform for routing purposes (skipped from raw\n * style application, wired to the transform composite, flags transform\n * dirty) but is intentionally NOT in `transformPropOrder` — it is\n * composed onto `rotate` at the build sites, not serialized in its own\n * slot, and must stay out of the order-array consumers (parse-transform,\n * unit-conversion, keys-position).\n */\nconst transformProps = /*@__PURE__*/ (() => new Set([...transformPropOrder, \"pathRotation\"]))();\n\nexport { transformPropOrder, transformProps };\n//# sourceMappingURL=keys-transform.mjs.map\n","import { parseValueFromTransform } from '../../../render/dom/parse-transform.mjs';\nimport { transformPropOrder } from '../../../render/utils/keys-transform.mjs';\nimport { number } from '../../../value/types/numbers/index.mjs';\nimport { px } from '../../../value/types/numbers/units.mjs';\n\nconst isNumOrPxType = (v) => v === number || v === px;\nconst transformKeys = new Set([\"x\", \"y\", \"z\"]);\nconst nonTranslationalTransformKeys = transformPropOrder.filter((key) => !transformKeys.has(key));\nfunction removeNonTranslationalTransform(visualElement) {\n const removedTransforms = [];\n nonTranslationalTransformKeys.forEach((key) => {\n const value = visualElement.getValue(key);\n if (value !== undefined) {\n removedTransforms.push([key, value.get()]);\n value.set(key.startsWith(\"scale\") ? 1 : 0);\n }\n });\n return removedTransforms;\n}\nconst positionalValues = {\n // Dimensions\n width: ({ x }, { paddingLeft = \"0\", paddingRight = \"0\", boxSizing }) => {\n const width = x.max - x.min;\n return boxSizing === \"border-box\"\n ? width\n : width - parseFloat(paddingLeft) - parseFloat(paddingRight);\n },\n height: ({ y }, { paddingTop = \"0\", paddingBottom = \"0\", boxSizing }) => {\n const height = y.max - y.min;\n return boxSizing === \"border-box\"\n ? height\n : height - parseFloat(paddingTop) - parseFloat(paddingBottom);\n },\n top: (_bbox, { top }) => parseFloat(top),\n left: (_bbox, { left }) => parseFloat(left),\n bottom: ({ y }, { top }) => parseFloat(top) + (y.max - y.min),\n right: ({ x }, { left }) => parseFloat(left) + (x.max - x.min),\n // Transform\n x: (_bbox, { transform }) => parseValueFromTransform(transform, \"x\"),\n y: (_bbox, { transform }) => parseValueFromTransform(transform, \"y\"),\n};\n// Alias translate longform names\npositionalValues.translateX = positionalValues.x;\npositionalValues.translateY = positionalValues.y;\n\nexport { isNumOrPxType, positionalValues, removeNonTranslationalTransform };\n//# sourceMappingURL=unit-conversion.mjs.map\n","import { fillWildcards } from './utils/fill-wildcards.mjs';\nimport { removeNonTranslationalTransform } from './utils/unit-conversion.mjs';\nimport { frame } from '../../frameloop/frame.mjs';\n\nconst toResolve = new Set();\nlet isScheduled = false;\nlet anyNeedsMeasurement = false;\nlet isForced = false;\nfunction measureAllKeyframes() {\n if (anyNeedsMeasurement) {\n const resolversToMeasure = Array.from(toResolve).filter((resolver) => resolver.needsMeasurement);\n const elementsToMeasure = new Set(resolversToMeasure.map((resolver) => resolver.element));\n const transformsToRestore = new Map();\n /**\n * Write pass\n * If we're measuring elements we want to remove bounding box-changing transforms.\n */\n elementsToMeasure.forEach((element) => {\n const removedTransforms = removeNonTranslationalTransform(element);\n if (!removedTransforms.length)\n return;\n transformsToRestore.set(element, removedTransforms);\n element.render();\n });\n // Read\n resolversToMeasure.forEach((resolver) => resolver.measureInitialState());\n // Write\n elementsToMeasure.forEach((element) => {\n element.render();\n const restore = transformsToRestore.get(element);\n if (restore) {\n restore.forEach(([key, value]) => {\n element.getValue(key)?.set(value);\n });\n }\n });\n // Read\n resolversToMeasure.forEach((resolver) => resolver.measureEndState());\n // Write\n resolversToMeasure.forEach((resolver) => {\n if (resolver.suspendedScrollY !== undefined) {\n window.scrollTo(0, resolver.suspendedScrollY);\n }\n });\n }\n anyNeedsMeasurement = false;\n isScheduled = false;\n toResolve.forEach((resolver) => resolver.complete(isForced));\n toResolve.clear();\n}\nfunction readAllKeyframes() {\n toResolve.forEach((resolver) => {\n resolver.readKeyframes();\n if (resolver.needsMeasurement) {\n anyNeedsMeasurement = true;\n }\n });\n}\nfunction flushKeyframeResolvers() {\n isForced = true;\n readAllKeyframes();\n measureAllKeyframes();\n isForced = false;\n}\nclass KeyframeResolver {\n constructor(unresolvedKeyframes, onComplete, name, motionValue, element, isAsync = false) {\n this.state = \"pending\";\n /**\n * Track whether this resolver is async. If it is, it'll be added to the\n * resolver queue and flushed in the next frame. Resolvers that aren't going\n * to trigger read/write thrashing don't need to be async.\n */\n this.isAsync = false;\n /**\n * Track whether this resolver needs to perform a measurement\n * to resolve its keyframes.\n */\n this.needsMeasurement = false;\n this.unresolvedKeyframes = [...unresolvedKeyframes];\n this.onComplete = onComplete;\n this.name = name;\n this.motionValue = motionValue;\n this.element = element;\n this.isAsync = isAsync;\n }\n scheduleResolve() {\n this.state = \"scheduled\";\n if (this.isAsync) {\n toResolve.add(this);\n if (!isScheduled) {\n isScheduled = true;\n frame.read(readAllKeyframes);\n frame.resolveKeyframes(measureAllKeyframes);\n }\n }\n else {\n this.readKeyframes();\n this.complete();\n }\n }\n readKeyframes() {\n const { unresolvedKeyframes, name, element, motionValue } = this;\n // If initial keyframe is null we need to read it from the DOM\n if (unresolvedKeyframes[0] === null) {\n const currentValue = motionValue?.get();\n // TODO: This doesn't work if the final keyframe is a wildcard\n const finalKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1];\n if (currentValue !== undefined) {\n unresolvedKeyframes[0] = currentValue;\n }\n else if (element && name) {\n const valueAsRead = element.readValue(name, finalKeyframe);\n if (valueAsRead !== undefined && valueAsRead !== null) {\n unresolvedKeyframes[0] = valueAsRead;\n }\n }\n if (unresolvedKeyframes[0] === undefined) {\n unresolvedKeyframes[0] = finalKeyframe;\n }\n if (motionValue && currentValue === undefined) {\n motionValue.set(unresolvedKeyframes[0]);\n }\n }\n fillWildcards(unresolvedKeyframes);\n }\n setFinalKeyframe() { }\n measureInitialState() { }\n renderEndStyles() { }\n measureEndState() { }\n complete(isForcedComplete = false) {\n this.state = \"complete\";\n this.onComplete(this.unresolvedKeyframes, this.finalKeyframe, isForcedComplete);\n toResolve.delete(this);\n }\n cancel() {\n if (this.state === \"scheduled\") {\n toResolve.delete(this);\n this.state = \"pending\";\n }\n }\n resume() {\n if (this.state === \"pending\")\n this.scheduleResolve();\n }\n}\n\nexport { KeyframeResolver, flushKeyframeResolvers };\n//# sourceMappingURL=KeyframesResolver.mjs.map\n","function fillWildcards(keyframes) {\n for (let i = 1; i < keyframes.length; i++) {\n keyframes[i] ?? (keyframes[i] = keyframes[i - 1]);\n }\n}\n\nexport { fillWildcards };\n//# sourceMappingURL=fill-wildcards.mjs.map\n","import { isCSSVar } from './is-css-var.mjs';\n\nfunction setStyle(element, name, value) {\n isCSSVar(name)\n ? element.style.setProperty(name, value)\n : (element.style[name] = value);\n}\n\nexport { setStyle };\n//# sourceMappingURL=style-set.mjs.map\n","const isCSSVar = (name) => name.startsWith(\"--\");\n\nexport { isCSSVar };\n//# sourceMappingURL=is-css-var.mjs.map\n","/**\n * Add the ability for test suites to manually set support flags\n * to better test more environments.\n */\nconst supportsFlags = {};\n\nexport { supportsFlags };\n//# sourceMappingURL=flags.mjs.map\n","import { memo } from 'motion-utils';\nimport { supportsFlags } from './flags.mjs';\n\nfunction memoSupports(callback, supportsFlag) {\n const memoized = memo(callback);\n return () => supportsFlags[supportsFlag] ?? memoized();\n}\n\nexport { memoSupports };\n//# sourceMappingURL=memo.mjs.map\n","import { memoSupports } from './memo.mjs';\n\nconst supportsScrollTimeline = /* @__PURE__ */ memoSupports(() => window.ScrollTimeline !== undefined, \"scrollTimeline\");\nconst supportsViewTimeline = /* @__PURE__ */ memoSupports(() => window.ViewTimeline !== undefined, \"viewTimeline\");\n\nexport { supportsScrollTimeline, supportsViewTimeline };\n//# sourceMappingURL=scroll-timeline.mjs.map\n","import { memoSupports } from './memo.mjs';\n\nconst supportsLinearEasing = /*@__PURE__*/ memoSupports(() => {\n try {\n document\n .createElement(\"div\")\n .animate({ opacity: 0 }, { easing: \"linear(0, 1)\" });\n }\n catch (e) {\n return false;\n }\n return true;\n}, \"linearEasing\");\n\nexport { supportsLinearEasing };\n//# sourceMappingURL=linear-easing.mjs.map\n","const cubicBezierAsString = ([a, b, c, d]) => `cubic-bezier(${a}, ${b}, ${c}, ${d})`;\n\nexport { cubicBezierAsString };\n//# sourceMappingURL=cubic-bezier.mjs.map\n","import { cubicBezierAsString } from './cubic-bezier.mjs';\n\nconst supportedWaapiEasing = {\n linear: \"linear\",\n ease: \"ease\",\n easeIn: \"ease-in\",\n easeOut: \"ease-out\",\n easeInOut: \"ease-in-out\",\n circIn: /*@__PURE__*/ cubicBezierAsString([0, 0.65, 0.55, 1]),\n circOut: /*@__PURE__*/ cubicBezierAsString([0.55, 0, 1, 0.45]),\n backIn: /*@__PURE__*/ cubicBezierAsString([0.31, 0.01, 0.66, -0.59]),\n backOut: /*@__PURE__*/ cubicBezierAsString([0.33, 1.53, 0.69, 0.99]),\n};\n\nexport { supportedWaapiEasing };\n//# sourceMappingURL=supported.mjs.map\n","import { isBezierDefinition } from 'motion-utils';\nimport { supportsLinearEasing } from '../../../utils/supports/linear-easing.mjs';\nimport { generateLinearEasing } from '../utils/linear.mjs';\nimport { cubicBezierAsString } from './cubic-bezier.mjs';\nimport { supportedWaapiEasing } from './supported.mjs';\n\nfunction mapEasingToNativeEasing(easing, duration) {\n if (!easing) {\n return undefined;\n }\n else if (typeof easing === \"function\") {\n return supportsLinearEasing()\n ? generateLinearEasing(easing, duration)\n : \"ease-out\";\n }\n else if (isBezierDefinition(easing)) {\n return cubicBezierAsString(easing);\n }\n else if (Array.isArray(easing)) {\n return easing.map((segmentEasing) => mapEasingToNativeEasing(segmentEasing, duration) ||\n supportedWaapiEasing.easeOut);\n }\n else {\n return supportedWaapiEasing[easing];\n }\n}\n\nexport { mapEasingToNativeEasing };\n//# sourceMappingURL=map-easing.mjs.map\n","import { mapEasingToNativeEasing } from './easing/map-easing.mjs';\n\nfunction startWaapiAnimation(element, valueName, keyframes, { delay = 0, duration = 300, repeat = 0, repeatType = \"loop\", ease = \"easeOut\", times, } = {}, pseudoElement = undefined) {\n const keyframeOptions = {\n [valueName]: keyframes,\n };\n if (times)\n keyframeOptions.offset = times;\n const easing = mapEasingToNativeEasing(ease, duration);\n /**\n * If this is an easing array, apply to keyframes, not animation as a whole\n */\n if (Array.isArray(easing))\n keyframeOptions.easing = easing;\n const options = {\n delay,\n duration,\n easing: !Array.isArray(easing) ? easing : \"linear\",\n fill: \"both\",\n iterations: repeat + 1,\n direction: repeatType === \"reverse\" ? \"alternate\" : \"normal\",\n };\n if (pseudoElement)\n options.pseudoElement = pseudoElement;\n return element.animate(keyframeOptions, options);\n}\n\nexport { startWaapiAnimation };\n//# sourceMappingURL=start-waapi-animation.mjs.map\n","function isGenerator(type) {\n return typeof type === \"function\" && \"applyToOptions\" in type;\n}\n\nexport { isGenerator };\n//# sourceMappingURL=is-generator.mjs.map\n","import { invariant, millisecondsToSeconds, secondsToMilliseconds, noop } from 'motion-utils';\nimport { setStyle } from '../render/dom/style-set.mjs';\nimport { supportsScrollTimeline } from '../utils/supports/scroll-timeline.mjs';\nimport { getFinalKeyframe } from './keyframes/get-final.mjs';\nimport { WithPromise } from './utils/WithPromise.mjs';\nimport { startWaapiAnimation } from './waapi/start-waapi-animation.mjs';\nimport { applyGeneratorOptions } from './waapi/utils/apply-generator.mjs';\n\n/**\n * NativeAnimation implements AnimationPlaybackControls for the browser's Web Animations API.\n */\nclass NativeAnimation extends WithPromise {\n constructor(options) {\n super();\n this.finishedTime = null;\n this.isStopped = false;\n /**\n * Tracks a manually-set start time that takes precedence over WAAPI's\n * dynamic startTime. This is cleared when play() or time setter is called,\n * allowing WAAPI to take over timing.\n */\n this.manualStartTime = null;\n if (!options)\n return;\n const { element, name, keyframes, pseudoElement, allowFlatten = false, finalKeyframe, onComplete, } = options;\n this.isPseudoElement = Boolean(pseudoElement);\n this.allowFlatten = allowFlatten;\n this.options = options;\n invariant(typeof options.type !== \"string\", `Mini animate() doesn't support \"type\" as a string.`, \"mini-spring\");\n const transition = applyGeneratorOptions(options);\n this.animation = startWaapiAnimation(element, name, keyframes, transition, pseudoElement);\n if (transition.autoplay === false) {\n this.animation.pause();\n }\n this.animation.onfinish = () => {\n this.finishedTime = this.time;\n if (!pseudoElement) {\n const keyframe = getFinalKeyframe(keyframes, this.options, finalKeyframe, this.speed);\n if (this.updateMotionValue) {\n this.updateMotionValue(keyframe);\n }\n /**\n * If we can, we want to commit the final style as set by the user,\n * rather than the computed keyframe value supplied by the animation.\n * We always do this, even when a motion value is present, to prevent\n * a visual flash in Firefox where the WAAPI animation's fill is removed\n * during cancel() before the scheduled render can apply the correct value.\n */\n setStyle(element, name, keyframe);\n this.animation.cancel();\n }\n onComplete?.();\n this.notifyFinished();\n };\n }\n play() {\n if (this.isStopped)\n return;\n this.manualStartTime = null;\n this.animation.play();\n if (this.state === \"finished\") {\n this.updateFinished();\n }\n }\n pause() {\n this.animation.pause();\n }\n complete() {\n this.animation.finish?.();\n }\n cancel() {\n try {\n this.animation.cancel();\n }\n catch (e) { }\n }\n stop() {\n if (this.isStopped)\n return;\n this.isStopped = true;\n const { state } = this;\n if (state === \"idle\" || state === \"finished\") {\n return;\n }\n if (this.updateMotionValue) {\n this.updateMotionValue();\n }\n else {\n this.commitStyles();\n }\n if (!this.isPseudoElement)\n this.cancel();\n }\n /**\n * WAAPI doesn't natively have any interruption capabilities.\n *\n * In this method, we commit styles back to the DOM before cancelling\n * the animation.\n *\n * This is designed to be overridden by NativeAnimationExtended, which\n * will create a renderless JS animation and sample it twice to calculate\n * its current value, \"previous\" value, and therefore allow\n * Motion to also correctly calculate velocity for any subsequent animation\n * while deferring the commit until the next animation frame.\n */\n commitStyles() {\n const element = this.options?.element;\n if (!this.isPseudoElement && element?.isConnected) {\n this.animation.commitStyles?.();\n }\n }\n get duration() {\n const duration = this.animation.effect?.getComputedTiming?.().duration || 0;\n return millisecondsToSeconds(Number(duration));\n }\n get iterationDuration() {\n const { delay = 0 } = this.options || {};\n return this.duration + millisecondsToSeconds(delay);\n }\n get time() {\n return millisecondsToSeconds(Number(this.animation.currentTime) || 0);\n }\n set time(newTime) {\n const wasFinished = this.finishedTime !== null;\n this.manualStartTime = null;\n this.finishedTime = null;\n this.animation.currentTime = secondsToMilliseconds(newTime);\n if (wasFinished) {\n this.animation.pause();\n }\n }\n /**\n * The playback speed of the animation.\n * 1 = normal speed, 2 = double speed, 0.5 = half speed.\n */\n get speed() {\n return this.animation.playbackRate;\n }\n set speed(newSpeed) {\n // Allow backwards playback after finishing\n if (newSpeed < 0)\n this.finishedTime = null;\n this.animation.playbackRate = newSpeed;\n }\n get state() {\n return this.finishedTime !== null\n ? \"finished\"\n : this.animation.playState;\n }\n get startTime() {\n return this.manualStartTime ?? Number(this.animation.startTime);\n }\n set startTime(newStartTime) {\n this.manualStartTime = this.animation.startTime = newStartTime;\n }\n /**\n * Attaches a timeline to the animation, for instance the `ScrollTimeline`.\n */\n attachTimeline({ timeline, rangeStart, rangeEnd, observe, }) {\n if (this.allowFlatten) {\n this.animation.effect?.updateTiming({ easing: \"linear\" });\n }\n this.animation.onfinish = null;\n if (timeline && supportsScrollTimeline()) {\n this.animation.timeline = timeline;\n if (rangeStart)\n this.animation.rangeStart = rangeStart;\n if (rangeEnd)\n this.animation.rangeEnd = rangeEnd;\n return noop;\n }\n else {\n return observe(this);\n }\n }\n}\n\nexport { NativeAnimation };\n//# sourceMappingURL=NativeAnimation.mjs.map\n","import { supportsLinearEasing } from '../../../utils/supports/linear-easing.mjs';\nimport { isGenerator } from '../../generators/utils/is-generator.mjs';\n\nfunction applyGeneratorOptions({ type, ...options }) {\n if (isGenerator(type) && supportsLinearEasing()) {\n return type.applyToOptions(options);\n }\n else {\n options.duration ?? (options.duration = 300);\n options.ease ?? (options.ease = \"easeOut\");\n }\n return options;\n}\n\nexport { applyGeneratorOptions };\n//# sourceMappingURL=apply-generator.mjs.map\n","import { circInOut, backInOut, anticipate } from 'motion-utils';\n\nconst unsupportedEasingFunctions = {\n anticipate,\n backInOut,\n circInOut,\n};\nfunction isUnsupportedEase(key) {\n return key in unsupportedEasingFunctions;\n}\nfunction replaceStringEasing(transition) {\n if (typeof transition.ease === \"string\" &&\n isUnsupportedEase(transition.ease)) {\n transition.ease = unsupportedEasingFunctions[transition.ease];\n }\n}\n\nexport { replaceStringEasing };\n//# sourceMappingURL=unsupported-easing.mjs.map\n","import { clamp } from 'motion-utils';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { setStyle } from '../render/dom/style-set.mjs';\nimport { JSAnimation } from './JSAnimation.mjs';\nimport { NativeAnimation } from './NativeAnimation.mjs';\nimport { replaceTransitionType } from './utils/replace-transition-type.mjs';\nimport { replaceStringEasing } from './waapi/utils/unsupported-easing.mjs';\n\n/**\n * 10ms is chosen here as it strikes a balance between smooth\n * results (more than one keyframe per frame at 60fps) and\n * keyframe quantity.\n */\nconst sampleDelta = 10; //ms\nclass NativeAnimationExtended extends NativeAnimation {\n constructor(options) {\n /**\n * The base NativeAnimation function only supports a subset\n * of Motion easings, and WAAPI also only supports some\n * easing functions via string/cubic-bezier definitions.\n *\n * This function replaces those unsupported easing functions\n * with a JS easing function. This will later get compiled\n * to a linear() easing function.\n */\n replaceStringEasing(options);\n /**\n * Ensure we replace the transition type with a generator function\n * before passing to WAAPI.\n *\n * TODO: Does this have a better home? It could be shared with\n * JSAnimation.\n */\n replaceTransitionType(options);\n super(options);\n /**\n * Only set startTime when the animation should autoplay.\n * Setting startTime on a paused WAAPI animation unpauses it\n * (per the WAAPI spec), which breaks autoplay: false.\n */\n if (options.startTime !== undefined && options.autoplay !== false) {\n this.startTime = options.startTime;\n }\n this.options = options;\n }\n /**\n * WAAPI doesn't natively have any interruption capabilities.\n *\n * Rather than read committed styles back out of the DOM, we can\n * create a renderless JS animation and sample it twice to calculate\n * its current value, \"previous\" value, and therefore allow\n * Motion to calculate velocity for any subsequent animation.\n */\n updateMotionValue(value) {\n const { motionValue, onUpdate, onComplete, element, ...options } = this.options;\n if (!motionValue)\n return;\n if (value !== undefined) {\n motionValue.set(value);\n return;\n }\n const sampleAnimation = new JSAnimation({\n ...options,\n autoplay: false,\n });\n /**\n * Use wall-clock elapsed time for sampling.\n * Under CPU load, WAAPI's currentTime may not reflect actual\n * elapsed time, causing incorrect sampling and visual jumps.\n */\n const sampleTime = Math.max(sampleDelta, time.now() - this.startTime);\n const delta = clamp(0, sampleDelta, sampleTime - sampleDelta);\n const current = sampleAnimation.sample(sampleTime).value;\n /**\n * Write the estimated value to inline style so it persists\n * after cancel(), covering the async gap before the next\n * animation starts.\n */\n const { name } = this.options;\n if (element && name)\n setStyle(element, name, current);\n motionValue.setWithVelocity(sampleAnimation.sample(Math.max(0, sampleTime - delta)).value, current, delta);\n sampleAnimation.stop();\n }\n}\n\nexport { NativeAnimationExtended };\n//# sourceMappingURL=NativeAnimationExtended.mjs.map\n","import { complex } from '../../value/types/complex/index.mjs';\n\n/**\n * Check if a value is animatable. Examples:\n *\n * ✅: 100, \"100px\", \"#fff\"\n * ❌: \"block\", \"url(2.jpg)\"\n * @param value\n *\n * @internal\n */\nconst isAnimatable = (value, name) => {\n // If the list of keys that might be non-animatable grows, replace with Set\n if (name === \"zIndex\")\n return false;\n // If it's a number or a keyframes array, we can animate it. We might at some point\n // need to do a deep isAnimatable check of keyframes, or let Popmotion handle this,\n // but for now lets leave it like this for performance reasons\n if (typeof value === \"number\" || Array.isArray(value))\n return true;\n if (typeof value === \"string\" && // It's animatable if we have a string\n (complex.test(value) || value === \"0\") && // And it contains numbers and/or colors\n !value.startsWith(\"url(\") // Unless it starts with \"url(\"\n ) {\n return true;\n }\n return false;\n};\n\nexport { isAnimatable };\n//# sourceMappingURL=is-animatable.mjs.map\n","function makeAnimationInstant(options) {\n options.duration = 0;\n options.type = \"keyframes\";\n}\n\nexport { makeAnimationInstant };\n//# sourceMappingURL=make-animation-instant.mjs.map\n","/**\n * A list of values that can be hardware-accelerated.\n */\nconst acceleratedValues = new Set([\n \"opacity\",\n \"clipPath\",\n \"filter\",\n \"transform\",\n \"backgroundColor\",\n]);\n\nexport { acceleratedValues };\n//# sourceMappingURL=accelerated-values.mjs.map\n","const browserColorFunctions = /^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\\(/;\nfunction hasBrowserOnlyColors(keyframes) {\n for (let i = 0; i < keyframes.length; i++) {\n if (typeof keyframes[i] === \"string\" &&\n browserColorFunctions.test(keyframes[i])) {\n return true;\n }\n }\n return false;\n}\n\nexport { hasBrowserOnlyColors };\n//# sourceMappingURL=is-browser-color.mjs.map\n","import { memo } from 'motion-utils';\nimport { acceleratedValues } from '../utils/accelerated-values.mjs';\nimport { hasBrowserOnlyColors } from '../utils/is-browser-color.mjs';\n\nconst colorProperties = new Set([\n \"color\",\n \"backgroundColor\",\n \"outlineColor\",\n \"fill\",\n \"stroke\",\n \"borderColor\",\n \"borderTopColor\",\n \"borderRightColor\",\n \"borderBottomColor\",\n \"borderLeftColor\",\n]);\nconst supportsWaapi = /*@__PURE__*/ memo(() => Object.hasOwnProperty.call(Element.prototype, \"animate\"));\nfunction supportsBrowserAnimation(options) {\n const { motionValue, name, repeatDelay, repeatType, damping, type, keyframes, } = options;\n const subject = motionValue?.owner?.current;\n /**\n * We use instanceof checks instead of isHTMLElement()/isSVGElement()\n * because we explicitly **don't** want elements in different timing\n * contexts (i.e. popups) to be accelerated, as it's not possible to sync\n * these animations properly with those driven from the main window\n * frameloop.\n */\n if (!(subject instanceof HTMLElement) &&\n !(subject instanceof SVGElement)) {\n return false;\n }\n const { onUpdate, transformTemplate } = motionValue.owner.getProps();\n return (supportsWaapi() &&\n name &&\n /**\n * Force WAAPI for color properties with browser-only color formats\n * (oklch, oklab, lab, lch, etc.) that the JS animation path can't parse.\n */\n (acceleratedValues.has(name) ||\n (colorProperties.has(name) &&\n hasBrowserOnlyColors(keyframes))) &&\n (name !== \"transform\" || !transformTemplate) &&\n /**\n * If we're outputting values to onUpdate then we can't use WAAPI as there's\n * no way to read the value from WAAPI every frame.\n */\n !onUpdate &&\n !repeatDelay &&\n repeatType !== \"mirror\" &&\n damping !== 0 &&\n type !== \"inertia\");\n}\n\nexport { supportsBrowserAnimation };\n//# sourceMappingURL=waapi.mjs.map\n","import { MotionGlobalConfig, noop } from 'motion-utils';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { JSAnimation } from './JSAnimation.mjs';\nimport { getFinalKeyframe } from './keyframes/get-final.mjs';\nimport { KeyframeResolver, flushKeyframeResolvers } from './keyframes/KeyframesResolver.mjs';\nimport { NativeAnimationExtended } from './NativeAnimationExtended.mjs';\nimport { canAnimate } from './utils/can-animate.mjs';\nimport { makeAnimationInstant } from './utils/make-animation-instant.mjs';\nimport { WithPromise } from './utils/WithPromise.mjs';\nimport { supportsBrowserAnimation } from './waapi/supports/waapi.mjs';\n\n/**\n * Maximum time allowed between an animation being created and it being\n * resolved for us to use the latter as the start time.\n *\n * This is to ensure that while we prefer to \"start\" an animation as soon\n * as it's triggered, we also want to avoid a visual jump if there's a big delay\n * between these two moments.\n */\nconst MAX_RESOLVE_DELAY = 40;\nclass AsyncMotionValueAnimation extends WithPromise {\n constructor({ autoplay = true, delay = 0, type = \"keyframes\", repeat = 0, repeatDelay = 0, repeatType = \"loop\", keyframes, name, motionValue, element, ...options }) {\n super();\n /**\n * Bound to support return animation.stop pattern\n */\n this.stop = () => {\n if (this._animation) {\n this._animation.stop();\n this.stopTimeline?.();\n }\n this.keyframeResolver?.cancel();\n };\n this.createdAt = time.now();\n const optionsWithDefaults = {\n autoplay,\n delay,\n type,\n repeat,\n repeatDelay,\n repeatType,\n name,\n motionValue,\n element,\n ...options,\n };\n const KeyframeResolver$1 = element?.KeyframeResolver || KeyframeResolver;\n this.keyframeResolver = new KeyframeResolver$1(keyframes, (resolvedKeyframes, finalKeyframe, forced) => this.onKeyframesResolved(resolvedKeyframes, finalKeyframe, optionsWithDefaults, !forced), name, motionValue, element);\n this.keyframeResolver?.scheduleResolve();\n }\n onKeyframesResolved(keyframes, finalKeyframe, options, sync) {\n this.keyframeResolver = undefined;\n const { name, type, velocity, delay, isHandoff, onUpdate } = options;\n this.resolvedAt = time.now();\n /**\n * If we can't animate this value with the resolved keyframes\n * then we should complete it immediately.\n */\n let canAnimateValue = true;\n if (!canAnimate(keyframes, name, type, velocity)) {\n canAnimateValue = false;\n if (MotionGlobalConfig.instantAnimations || !delay) {\n onUpdate?.(getFinalKeyframe(keyframes, options, finalKeyframe));\n }\n keyframes[0] = keyframes[keyframes.length - 1];\n makeAnimationInstant(options);\n options.repeat = 0;\n }\n /**\n * Resolve startTime for the animation.\n *\n * This method uses the createdAt and resolvedAt to calculate the\n * animation startTime. *Ideally*, we would use the createdAt time as t=0\n * as the following frame would then be the first frame of the animation in\n * progress, which would feel snappier.\n *\n * However, if there's a delay (main thread work) between the creation of\n * the animation and the first committed frame, we prefer to use resolvedAt\n * to avoid a sudden jump into the animation.\n */\n const startTime = sync\n ? !this.resolvedAt\n ? this.createdAt\n : this.resolvedAt - this.createdAt > MAX_RESOLVE_DELAY\n ? this.resolvedAt\n : this.createdAt\n : undefined;\n const resolvedOptions = {\n startTime,\n finalKeyframe,\n ...options,\n keyframes,\n };\n /**\n * Animate via WAAPI if possible. If this is a handoff animation, the optimised animation will be running via\n * WAAPI. Therefore, this animation must be JS to ensure it runs \"under\" the\n * optimised animation.\n *\n * Also skip WAAPI when keyframes aren't animatable, as the resolved\n * values may not be valid CSS and would trigger browser warnings.\n */\n const useWaapi = canAnimateValue &&\n !isHandoff &&\n supportsBrowserAnimation(resolvedOptions);\n const element = resolvedOptions.motionValue?.owner?.current;\n let animation;\n if (useWaapi) {\n try {\n animation = new NativeAnimationExtended({\n ...resolvedOptions,\n element,\n });\n }\n catch {\n animation = new JSAnimation(resolvedOptions);\n }\n }\n else {\n animation = new JSAnimation(resolvedOptions);\n }\n animation.finished.then(() => {\n this.notifyFinished();\n }).catch(noop);\n if (this.pendingTimeline) {\n this.stopTimeline = animation.attachTimeline(this.pendingTimeline);\n this.pendingTimeline = undefined;\n }\n this._animation = animation;\n }\n get finished() {\n if (!this._animation) {\n return this._finished;\n }\n else {\n return this.animation.finished;\n }\n }\n then(onResolve, _onReject) {\n return this.finished.finally(onResolve).then(() => { });\n }\n get animation() {\n if (!this._animation) {\n this.keyframeResolver?.resume();\n flushKeyframeResolvers();\n }\n return this._animation;\n }\n get duration() {\n return this.animation.duration;\n }\n get iterationDuration() {\n return this.animation.iterationDuration;\n }\n get time() {\n return this.animation.time;\n }\n set time(newTime) {\n this.animation.time = newTime;\n }\n get speed() {\n return this.animation.speed;\n }\n get state() {\n return this.animation.state;\n }\n set speed(newSpeed) {\n this.animation.speed = newSpeed;\n }\n get startTime() {\n return this.animation.startTime;\n }\n attachTimeline(timeline) {\n if (this._animation) {\n this.stopTimeline = this.animation.attachTimeline(timeline);\n }\n else {\n this.pendingTimeline = timeline;\n }\n return () => this.stop();\n }\n play() {\n this.animation.play();\n }\n pause() {\n this.animation.pause();\n }\n complete() {\n this.animation.complete();\n }\n cancel() {\n if (this._animation) {\n this.animation.cancel();\n }\n this.keyframeResolver?.cancel();\n }\n}\n\nexport { AsyncMotionValueAnimation };\n//# sourceMappingURL=AsyncMotionValueAnimation.mjs.map\n","import { warning } from 'motion-utils';\nimport { isGenerator } from '../generators/utils/is-generator.mjs';\nimport { isAnimatable } from './is-animatable.mjs';\n\nfunction hasKeyframesChanged(keyframes) {\n const current = keyframes[0];\n if (keyframes.length === 1)\n return true;\n for (let i = 0; i < keyframes.length; i++) {\n if (keyframes[i] !== current)\n return true;\n }\n}\nfunction canAnimate(keyframes, name, type, velocity) {\n /**\n * Check if we're able to animate between the start and end keyframes,\n * and throw a warning if we're attempting to animate between one that's\n * animatable and another that isn't.\n */\n const originKeyframe = keyframes[0];\n if (originKeyframe === null) {\n return false;\n }\n /**\n * These aren't traditionally animatable but we do support them.\n * In future we could look into making this more generic or replacing\n * this function with mix() === mixImmediate\n */\n if (name === \"display\" || name === \"visibility\")\n return true;\n const targetKeyframe = keyframes[keyframes.length - 1];\n const isOriginAnimatable = isAnimatable(originKeyframe, name);\n const isTargetAnimatable = isAnimatable(targetKeyframe, name);\n warning(isOriginAnimatable === isTargetAnimatable, `You are trying to animate ${name} from \"${originKeyframe}\" to \"${targetKeyframe}\". \"${isOriginAnimatable ? targetKeyframe : originKeyframe}\" is not an animatable value.`, \"value-not-animatable\");\n // Always skip if any of these are true\n if (!isOriginAnimatable || !isTargetAnimatable) {\n return false;\n }\n return (hasKeyframesChanged(keyframes) ||\n ((type === \"spring\" || isGenerator(type)) && velocity));\n}\n\nexport { canAnimate };\n//# sourceMappingURL=can-animate.mjs.map\n","class GroupAnimation {\n constructor(animations) {\n // Bound to accomadate common `return animation.stop` pattern\n this.stop = () => this.runAll(\"stop\");\n this.animations = animations.filter(Boolean);\n }\n get finished() {\n return Promise.all(this.animations.map((animation) => animation.finished));\n }\n /**\n * TODO: Filter out cancelled or stopped animations before returning\n */\n getAll(propName) {\n return this.animations[0][propName];\n }\n setAll(propName, newValue) {\n for (let i = 0; i < this.animations.length; i++) {\n this.animations[i][propName] = newValue;\n }\n }\n attachTimeline(timeline) {\n const subscriptions = this.animations.map((animation) => animation.attachTimeline(timeline));\n return () => {\n subscriptions.forEach((cancel, i) => {\n cancel && cancel();\n this.animations[i].stop();\n });\n };\n }\n get time() {\n return this.getAll(\"time\");\n }\n set time(time) {\n this.setAll(\"time\", time);\n }\n get speed() {\n return this.getAll(\"speed\");\n }\n set speed(speed) {\n this.setAll(\"speed\", speed);\n }\n get state() {\n return this.getAll(\"state\");\n }\n get startTime() {\n return this.getAll(\"startTime\");\n }\n get duration() {\n return getMax(this.animations, \"duration\");\n }\n get iterationDuration() {\n return getMax(this.animations, \"iterationDuration\");\n }\n runAll(methodName) {\n this.animations.forEach((controls) => controls[methodName]());\n }\n play() {\n this.runAll(\"play\");\n }\n pause() {\n this.runAll(\"pause\");\n }\n cancel() {\n this.runAll(\"cancel\");\n }\n complete() {\n this.runAll(\"complete\");\n }\n}\nfunction getMax(animations, propName) {\n let max = 0;\n for (let i = 0; i < animations.length; i++) {\n const value = animations[i][propName];\n if (value !== null && value > max) {\n max = value;\n }\n }\n return max;\n}\n\nexport { GroupAnimation };\n//# sourceMappingURL=GroupAnimation.mjs.map\n","import { GroupAnimation } from './GroupAnimation.mjs';\n\nclass GroupAnimationWithThen extends GroupAnimation {\n then(onResolve, _onReject) {\n return this.finished.finally(onResolve).then(() => { });\n }\n}\n\nexport { GroupAnimationWithThen };\n//# sourceMappingURL=GroupAnimationWithThen.mjs.map\n","import { warnOnce, SubscriptionManager, velocityPerSecond } from 'motion-utils';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { frame } from '../frameloop/frame.mjs';\n\n/**\n * Maximum time between the value of two frames, beyond which we\n * assume the velocity has since been 0.\n */\nconst MAX_VELOCITY_DELTA = 30;\nconst isFloat = (value) => {\n return !isNaN(parseFloat(value));\n};\nconst collectMotionValues = {\n current: undefined,\n};\n/**\n * `MotionValue` is used to track the state and velocity of motion values.\n *\n * @public\n */\nclass MotionValue {\n /**\n * @param init - The initiating value\n * @param config - Optional configuration options\n *\n * - `transformer`: A function to transform incoming values with.\n */\n constructor(init, options = {}) {\n /**\n * Tracks whether this value can output a velocity. Currently this is only true\n * if the value is numerical, but we might be able to widen the scope here and support\n * other value types.\n *\n * @internal\n */\n this.canTrackVelocity = null;\n /**\n * An object containing a SubscriptionManager for each active event.\n */\n this.events = {};\n this.updateAndNotify = (v) => {\n const currentTime = time.now();\n /**\n * If we're updating the value during another frame or eventloop\n * than the previous frame, then the we set the previous frame value\n * to current.\n */\n if (this.updatedAt !== currentTime) {\n this.setPrevFrameValue();\n }\n this.prev = this.current;\n this.setCurrent(v);\n // Update update subscribers\n if (this.current !== this.prev) {\n this.events.change?.notify(this.current);\n if (this.dependents) {\n for (const dependent of this.dependents) {\n dependent.dirty();\n }\n }\n }\n };\n this.hasAnimated = false;\n this.setCurrent(init);\n this.owner = options.owner;\n }\n setCurrent(current) {\n this.current = current;\n this.updatedAt = time.now();\n if (this.canTrackVelocity === null && current !== undefined) {\n this.canTrackVelocity = isFloat(this.current);\n }\n }\n setPrevFrameValue(prevFrameValue = this.current) {\n this.prevFrameValue = prevFrameValue;\n this.prevUpdatedAt = this.updatedAt;\n }\n /**\n * Adds a function that will be notified when the `MotionValue` is updated.\n *\n * It returns a function that, when called, will cancel the subscription.\n *\n * When calling `onChange` inside a React component, it should be wrapped with the\n * `useEffect` hook. As it returns an unsubscribe function, this should be returned\n * from the `useEffect` function to ensure you don't add duplicate subscribers..\n *\n * ```jsx\n * export const MyComponent = () => {\n * const x = useMotionValue(0)\n * const y = useMotionValue(0)\n * const opacity = useMotionValue(1)\n *\n * useEffect(() => {\n * function updateOpacity() {\n * const maxXY = Math.max(x.get(), y.get())\n * const newOpacity = transform(maxXY, [0, 100], [1, 0])\n * opacity.set(newOpacity)\n * }\n *\n * const unsubscribeX = x.on(\"change\", updateOpacity)\n * const unsubscribeY = y.on(\"change\", updateOpacity)\n *\n * return () => {\n * unsubscribeX()\n * unsubscribeY()\n * }\n * }, [])\n *\n * return \n * }\n * ```\n *\n * @param subscriber - A function that receives the latest value.\n * @returns A function that, when called, will cancel this subscription.\n *\n * @deprecated\n */\n onChange(subscription) {\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(false, `value.onChange(callback) is deprecated. Switch to value.on(\"change\", callback).`);\n }\n return this.on(\"change\", subscription);\n }\n on(eventName, callback) {\n if (!this.events[eventName]) {\n this.events[eventName] = new SubscriptionManager();\n }\n const unsubscribe = this.events[eventName].add(callback);\n if (eventName === \"change\") {\n return () => {\n unsubscribe();\n /**\n * If we have no more change listeners by the start\n * of the next frame, stop active animations.\n */\n frame.read(() => {\n if (!this.events.change.getSize()) {\n this.stop();\n }\n });\n };\n }\n return unsubscribe;\n }\n clearListeners() {\n for (const eventManagers in this.events) {\n this.events[eventManagers].clear();\n }\n }\n /**\n * Attaches a passive effect to the `MotionValue`.\n */\n attach(passiveEffect, stopPassiveEffect) {\n this.passiveEffect = passiveEffect;\n this.stopPassiveEffect = stopPassiveEffect;\n }\n /**\n * Sets the state of the `MotionValue`.\n *\n * @remarks\n *\n * ```jsx\n * const x = useMotionValue(0)\n * x.set(10)\n * ```\n *\n * @param latest - Latest value to set.\n * @param render - Whether to notify render subscribers. Defaults to `true`\n *\n * @public\n */\n set(v) {\n if (!this.passiveEffect) {\n this.updateAndNotify(v);\n }\n else {\n this.passiveEffect(v, this.updateAndNotify);\n }\n }\n setWithVelocity(prev, current, delta) {\n this.set(current);\n this.prev = undefined;\n this.prevFrameValue = prev;\n this.prevUpdatedAt = this.updatedAt - delta;\n }\n /**\n * Set the state of the `MotionValue`, stopping any active animations,\n * effects, and resets velocity to `0`.\n */\n jump(v, endAnimation = true) {\n this.updateAndNotify(v);\n this.prev = v;\n this.prevUpdatedAt = this.prevFrameValue = undefined;\n endAnimation && this.stop();\n if (this.stopPassiveEffect)\n this.stopPassiveEffect();\n }\n dirty() {\n this.events.change?.notify(this.current);\n }\n addDependent(dependent) {\n if (!this.dependents) {\n this.dependents = new Set();\n }\n this.dependents.add(dependent);\n }\n removeDependent(dependent) {\n if (this.dependents) {\n this.dependents.delete(dependent);\n }\n }\n /**\n * Returns the latest state of `MotionValue`\n *\n * @returns - The latest state of `MotionValue`\n *\n * @public\n */\n get() {\n if (collectMotionValues.current) {\n collectMotionValues.current.push(this);\n }\n return this.current;\n }\n /**\n * @public\n */\n getPrevious() {\n return this.prev;\n }\n /**\n * Returns the latest velocity of `MotionValue`\n *\n * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical.\n *\n * @public\n */\n getVelocity() {\n const currentTime = time.now();\n if (!this.canTrackVelocity ||\n this.prevFrameValue === undefined ||\n currentTime - this.updatedAt > MAX_VELOCITY_DELTA) {\n return 0;\n }\n const delta = Math.min(this.updatedAt - this.prevUpdatedAt, MAX_VELOCITY_DELTA);\n // Casts because of parseFloat's poor typing\n return velocityPerSecond(parseFloat(this.current) -\n parseFloat(this.prevFrameValue), delta);\n }\n /**\n * Registers a new animation to control this `MotionValue`. Only one\n * animation can drive a `MotionValue` at one time.\n *\n * ```jsx\n * value.start()\n * ```\n *\n * @param animation - A function that starts the provided animation\n */\n start(startAnimation) {\n this.stop();\n return new Promise((resolve) => {\n this.hasAnimated = true;\n this.animation = startAnimation(resolve);\n if (this.events.animationStart) {\n this.events.animationStart.notify();\n }\n }).then(() => {\n if (this.events.animationComplete) {\n this.events.animationComplete.notify();\n }\n this.clearAnimation();\n });\n }\n /**\n * Stop the currently active animation.\n *\n * @public\n */\n stop() {\n if (this.animation) {\n this.animation.stop();\n if (this.events.animationCancel) {\n this.events.animationCancel.notify();\n }\n }\n this.clearAnimation();\n }\n /**\n * Returns `true` if this value is currently animating.\n *\n * @public\n */\n isAnimating() {\n return !!this.animation;\n }\n clearAnimation() {\n delete this.animation;\n }\n /**\n * Destroy and clean up subscribers to this `MotionValue`.\n *\n * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically\n * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually\n * created a `MotionValue` via the `motionValue` function.\n *\n * @public\n */\n destroy() {\n this.dependents?.clear();\n this.events.destroy?.notify();\n this.clearListeners();\n this.stop();\n if (this.stopPassiveEffect) {\n this.stopPassiveEffect();\n }\n }\n}\nfunction motionValue(init, options) {\n return new MotionValue(init, options);\n}\n\nexport { MotionValue, collectMotionValues, motionValue };\n//# sourceMappingURL=index.mjs.map\n","/**\n * If `transition` has `inherit: true`, shallow-merge it with\n * `parentTransition` (child keys win) and strip the `inherit` key.\n * Otherwise return `transition` unchanged.\n */\nfunction resolveTransition(transition, parentTransition) {\n if (transition?.inherit && parentTransition) {\n const { inherit: _, ...rest } = transition;\n return { ...parentTransition, ...rest };\n }\n return transition;\n}\n\nexport { resolveTransition };\n//# sourceMappingURL=resolve-transition.mjs.map\n","import { resolveTransition } from './resolve-transition.mjs';\n\nfunction getValueTransition(transition, key) {\n const valueTransition = transition?.[key] ??\n transition?.[\"default\"] ??\n transition;\n if (valueTransition !== transition) {\n return resolveTransition(valueTransition, transition);\n }\n return valueTransition;\n}\n\nexport { getValueTransition };\n//# sourceMappingURL=get-value-transition.mjs.map\n","import { transformProps } from '../../render/utils/keys-transform.mjs';\n\nconst underDampedSpring = {\n type: \"spring\",\n stiffness: 500,\n damping: 25,\n restSpeed: 10,\n};\nconst criticallyDampedSpring = (target) => ({\n type: \"spring\",\n stiffness: 550,\n damping: target === 0 ? 2 * Math.sqrt(550) : 30,\n restSpeed: 10,\n});\nconst keyframesTransition = {\n type: \"keyframes\",\n duration: 0.8,\n};\n/**\n * Default easing curve is a slightly shallower version of\n * the default browser easing curve.\n */\nconst ease = {\n type: \"keyframes\",\n ease: [0.25, 0.1, 0.35, 1],\n duration: 0.3,\n};\nconst getDefaultTransition = (valueKey, { keyframes }) => {\n if (keyframes.length > 2) {\n return keyframesTransition;\n }\n else if (transformProps.has(valueKey)) {\n return valueKey.startsWith(\"scale\")\n ? criticallyDampedSpring(keyframes[1])\n : underDampedSpring;\n }\n return ease;\n};\n\nexport { getDefaultTransition };\n//# sourceMappingURL=default-transitions.mjs.map\n","const orchestrationKeys = new Set([\n \"when\",\n \"delay\",\n \"delayChildren\",\n \"staggerChildren\",\n \"staggerDirection\",\n \"repeat\",\n \"repeatType\",\n \"repeatDelay\",\n \"from\",\n \"elapsed\",\n]);\n/**\n * Decide whether a transition is defined on a given Transition.\n * This filters out orchestration options and returns true\n * if any options are left.\n */\nfunction isTransitionDefined(transition) {\n for (const key in transition) {\n if (!orchestrationKeys.has(key))\n return true;\n }\n return false;\n}\n\nexport { isTransitionDefined };\n//# sourceMappingURL=is-transition-defined.mjs.map\n","import { secondsToMilliseconds, MotionGlobalConfig } from 'motion-utils';\nimport { AsyncMotionValueAnimation } from '../AsyncMotionValueAnimation.mjs';\nimport { JSAnimation } from '../JSAnimation.mjs';\nimport { getValueTransition } from '../utils/get-value-transition.mjs';\nimport { makeAnimationInstant } from '../utils/make-animation-instant.mjs';\nimport { getDefaultTransition } from '../utils/default-transitions.mjs';\nimport { getFinalKeyframe } from '../keyframes/get-final.mjs';\nimport { isTransitionDefined } from '../utils/is-transition-defined.mjs';\nimport { frame } from '../../frameloop/frame.mjs';\n\nconst animateMotionValue = (name, value, target, transition = {}, element, isHandoff) => (onComplete) => {\n const valueTransition = getValueTransition(transition, name) || {};\n /**\n * Most transition values are currently completely overwritten by value-specific\n * transitions. In the future it'd be nicer to blend these transitions. But for now\n * delay actually does inherit from the root transition if not value-specific.\n */\n const delay = valueTransition.delay || transition.delay || 0;\n /**\n * Elapsed isn't a public transition option but can be passed through from\n * optimized appear effects in milliseconds.\n */\n let { elapsed = 0 } = transition;\n elapsed = elapsed - secondsToMilliseconds(delay);\n const options = {\n keyframes: Array.isArray(target) ? target : [null, target],\n ease: \"easeOut\",\n velocity: value.getVelocity(),\n ...valueTransition,\n delay: -elapsed,\n onUpdate: (v) => {\n value.set(v);\n valueTransition.onUpdate && valueTransition.onUpdate(v);\n },\n onComplete: () => {\n onComplete();\n valueTransition.onComplete && valueTransition.onComplete();\n },\n name,\n motionValue: value,\n element: isHandoff ? undefined : element,\n };\n /**\n * If there's no transition defined for this value, we can generate\n * unique transition settings for this value.\n */\n if (!isTransitionDefined(valueTransition)) {\n Object.assign(options, getDefaultTransition(name, options));\n }\n /**\n * Both WAAPI and our internal animation functions use durations\n * as defined by milliseconds, while our external API defines them\n * as seconds.\n */\n options.duration && (options.duration = secondsToMilliseconds(options.duration));\n options.repeatDelay && (options.repeatDelay = secondsToMilliseconds(options.repeatDelay));\n /**\n * Support deprecated way to set initial value. Prefer keyframe syntax.\n */\n if (options.from !== undefined) {\n options.keyframes[0] = options.from;\n }\n let shouldSkip = false;\n if (options.type === false ||\n (options.duration === 0 && !options.repeatDelay)) {\n makeAnimationInstant(options);\n if (options.delay === 0) {\n shouldSkip = true;\n }\n }\n if (MotionGlobalConfig.instantAnimations ||\n MotionGlobalConfig.skipAnimations ||\n element?.shouldSkipAnimations ||\n valueTransition.skipAnimations) {\n shouldSkip = true;\n makeAnimationInstant(options);\n options.delay = 0;\n }\n /**\n * If the transition type or easing has been explicitly set by the user\n * then we don't want to allow flattening the animation.\n */\n options.allowFlatten = !valueTransition.type && !valueTransition.ease;\n /**\n * If we can or must skip creating the animation, and apply only\n * the final keyframe, do so. We also check once keyframes are resolved but\n * this early check prevents the need to create an animation at all.\n */\n if (shouldSkip && !isHandoff && value.get() !== undefined) {\n const finalKeyframe = getFinalKeyframe(options.keyframes, valueTransition);\n if (finalKeyframe !== undefined) {\n frame.update(() => {\n options.onUpdate(finalKeyframe);\n options.onComplete();\n });\n return;\n }\n }\n return valueTransition.isSync\n ? new JSAnimation(options)\n : new AsyncMotionValueAnimation(options);\n};\n\nexport { animateMotionValue };\n//# sourceMappingURL=motion-value.mjs.map\n","import { invariant, isNumericalString } from 'motion-utils';\nimport { isCSSVariableToken } from './is-css-variable.mjs';\n\n/**\n * Parse Framer's special CSS variable format into a CSS token and a fallback.\n *\n * ```\n * `var(--foo, #fff)` => [`--foo`, '#fff']\n * ```\n *\n * @param current\n */\nconst splitCSSVariableRegex = \n// eslint-disable-next-line redos-detector/no-unsafe-regex -- false positive, as it can match a lot of words\n/^var\\(--(?:([\\w-]+)|([\\w-]+), ?([a-zA-Z\\d ()%#.,-]+))\\)/u;\nfunction parseCSSVariable(current) {\n const match = splitCSSVariableRegex.exec(current);\n if (!match)\n return [,];\n const [, token1, token2, fallback] = match;\n return [`--${token1 ?? token2}`, fallback];\n}\nconst maxDepth = 4;\nfunction getVariableValue(current, element, depth = 1) {\n invariant(depth <= maxDepth, `Max CSS variable fallback depth detected in property \"${current}\". This may indicate a circular fallback dependency.`, \"max-css-var-depth\");\n const [token, fallback] = parseCSSVariable(current);\n // No CSS variable detected\n if (!token)\n return;\n // Attempt to read this CSS variable off the element\n const resolved = window.getComputedStyle(element).getPropertyValue(token);\n if (resolved) {\n const trimmed = resolved.trim();\n return isNumericalString(trimmed) ? parseFloat(trimmed) : trimmed;\n }\n return isCSSVariableToken(fallback)\n ? getVariableValue(fallback, element, depth + 1)\n : fallback;\n}\n\nexport { getVariableValue, parseCSSVariable };\n//# sourceMappingURL=css-variables-conversion.mjs.map\n","function getValueState(visualElement) {\n const state = [{}, {}];\n visualElement?.values.forEach((value, key) => {\n state[0][key] = value.get();\n state[1][key] = value.getVelocity();\n });\n return state;\n}\nfunction resolveVariantFromProps(props, definition, custom, visualElement) {\n /**\n * If the variant definition is a function, resolve.\n */\n if (typeof definition === \"function\") {\n const [current, velocity] = getValueState(visualElement);\n definition = definition(custom !== undefined ? custom : props.custom, current, velocity);\n }\n /**\n * If the variant definition is a variant label, or\n * the function returned a variant label, resolve.\n */\n if (typeof definition === \"string\") {\n definition = props.variants && props.variants[definition];\n }\n /**\n * At this point we've resolved both functions and variant labels,\n * but the resolved variant label might itself have been a function.\n * If so, resolve. This can only have returned a valid target object.\n */\n if (typeof definition === \"function\") {\n const [current, velocity] = getValueState(visualElement);\n definition = definition(custom !== undefined ? custom : props.custom, current, velocity);\n }\n return definition;\n}\n\nexport { resolveVariantFromProps };\n//# sourceMappingURL=resolve-variants.mjs.map\n","import { transformPropOrder } from './keys-transform.mjs';\n\nconst positionalKeys = new Set([\n \"width\",\n \"height\",\n \"top\",\n \"left\",\n \"right\",\n \"bottom\",\n ...transformPropOrder,\n]);\n\nexport { positionalKeys };\n//# sourceMappingURL=keys-position.mjs.map\n","import { motionValue } from '../../value/index.mjs';\nimport { resolveVariant } from './resolve-dynamic-variants.mjs';\nimport { isKeyframesTarget } from './is-keyframes-target.mjs';\n\n/**\n * Set VisualElement's MotionValue, creating a new MotionValue for it if\n * it doesn't exist.\n */\nfunction setMotionValue(visualElement, key, value) {\n if (visualElement.hasValue(key)) {\n visualElement.getValue(key).set(value);\n }\n else {\n visualElement.addValue(key, motionValue(value));\n }\n}\nfunction resolveFinalValueInKeyframes(v) {\n // TODO maybe throw if v.length - 1 is placeholder token?\n return isKeyframesTarget(v) ? v[v.length - 1] || 0 : v;\n}\nfunction setTarget(visualElement, definition) {\n const resolved = resolveVariant(visualElement, definition);\n let { transitionEnd = {}, transition = {}, ...target } = resolved || {};\n target = { ...target, ...transitionEnd };\n for (const key in target) {\n const value = resolveFinalValueInKeyframes(target[key]);\n setMotionValue(visualElement, key, value);\n }\n}\n\nexport { setTarget };\n//# sourceMappingURL=setters.mjs.map\n","const isKeyframesTarget = (v) => {\n return Array.isArray(v);\n};\n\nexport { isKeyframesTarget };\n//# sourceMappingURL=is-keyframes-target.mjs.map\n","import { resolveVariantFromProps } from './resolve-variants.mjs';\n\nfunction resolveVariant(visualElement, definition, custom) {\n const props = visualElement.getProps();\n return resolveVariantFromProps(props, definition, custom !== undefined ? custom : props.custom, visualElement);\n}\n\nexport { resolveVariant };\n//# sourceMappingURL=resolve-dynamic-variants.mjs.map\n","const isMotionValue = (value) => Boolean(value && value.getVelocity);\n\nexport { isMotionValue };\n//# sourceMappingURL=is-motion-value.mjs.map\n","import { MotionGlobalConfig } from 'motion-utils';\nimport { isWillChangeMotionValue } from './is.mjs';\n\nfunction addValueToWillChange(visualElement, key) {\n const willChange = visualElement.getValue(\"willChange\");\n /**\n * It could be that a user has set willChange to a regular MotionValue,\n * in which case we can't add the value to it.\n */\n if (isWillChangeMotionValue(willChange)) {\n return willChange.add(key);\n }\n else if (!willChange && MotionGlobalConfig.WillChange) {\n const newWillChange = new MotionGlobalConfig.WillChange(\"auto\");\n visualElement.addValue(\"willChange\", newWillChange);\n newWillChange.add(key);\n }\n}\n\nexport { addValueToWillChange };\n//# sourceMappingURL=add-will-change.mjs.map\n","import { isMotionValue } from '../utils/is-motion-value.mjs';\n\nfunction isWillChangeMotionValue(value) {\n return Boolean(isMotionValue(value) && value.add);\n}\n\nexport { isWillChangeMotionValue };\n//# sourceMappingURL=is.mjs.map\n","function camelToDash(str) {\n return str.replace(/([A-Z])/g, (match) => `-${match.toLowerCase()}`);\n}\n\nexport { camelToDash };\n//# sourceMappingURL=camel-to-dash.mjs.map\n","import { camelToDash } from '../../render/dom/utils/camel-to-dash.mjs';\n\nconst optimizedAppearDataId = \"framerAppearId\";\nconst optimizedAppearDataAttribute = \"data-\" + camelToDash(optimizedAppearDataId);\n\nexport { optimizedAppearDataAttribute, optimizedAppearDataId };\n//# sourceMappingURL=data-id.mjs.map\n","import { optimizedAppearDataAttribute } from './data-id.mjs';\n\nfunction getOptimisedAppearId(visualElement) {\n return visualElement.props[optimizedAppearDataAttribute];\n}\n\nexport { getOptimisedAppearId };\n//# sourceMappingURL=get-appear-id.mjs.map\n","import { getValueTransition } from '../utils/get-value-transition.mjs';\nimport { resolveTransition } from '../utils/resolve-transition.mjs';\nimport { positionalKeys } from '../../render/utils/keys-position.mjs';\nimport { setTarget } from '../../render/utils/setters.mjs';\nimport { addValueToWillChange } from '../../value/will-change/add-will-change.mjs';\nimport { getOptimisedAppearId } from '../optimized-appear/get-appear-id.mjs';\nimport { animateMotionValue } from './motion-value.mjs';\nimport { frame } from '../../frameloop/frame.mjs';\n\n/**\n * Decide whether we should block this animation. Previously, we achieved this\n * just by checking whether the key was listed in protectedKeys, but this\n * posed problems if an animation was triggered by afterChildren and protectedKeys\n * had been set to true in the meantime.\n */\nfunction shouldBlockAnimation({ protectedKeys, needsAnimating }, key) {\n const shouldBlock = protectedKeys.hasOwnProperty(key) && needsAnimating[key] !== true;\n needsAnimating[key] = false;\n return shouldBlock;\n}\nfunction animateTarget(visualElement, targetAndTransition, { delay = 0, transitionOverride, type } = {}) {\n let { transition, transitionEnd, ...target } = targetAndTransition;\n const defaultTransition = visualElement.getDefaultTransition();\n transition = transition\n ? resolveTransition(transition, defaultTransition)\n : defaultTransition;\n const reduceMotion = transition?.reduceMotion;\n const skipAnimations = transition?.skipAnimations;\n if (transitionOverride)\n transition = transitionOverride;\n const animations = [];\n const animationTypeState = type &&\n visualElement.animationState &&\n visualElement.animationState.getState()[type];\n const path = transition?.path;\n if (path) {\n // path mutates `target` to claim x/y; loop below skips them.\n path.animateVisualElement(visualElement, target, transition, delay, animations);\n }\n for (const key in target) {\n const value = visualElement.getValue(key, visualElement.latestValues[key] ?? null);\n const valueTarget = target[key];\n if (valueTarget === undefined ||\n (animationTypeState &&\n shouldBlockAnimation(animationTypeState, key))) {\n continue;\n }\n const valueTransition = {\n delay,\n ...getValueTransition(transition || {}, key),\n };\n if (skipAnimations)\n valueTransition.skipAnimations = true;\n /**\n * If the value is already at the defined target, skip the animation.\n * We still re-assert the value via frame.update to take precedence\n * over any stale transitionEnd callbacks from previous animations.\n */\n const currentValue = value.get();\n if (currentValue !== undefined &&\n !value.isAnimating() &&\n !Array.isArray(valueTarget) &&\n valueTarget === currentValue &&\n !valueTransition.velocity) {\n frame.update(() => value.set(valueTarget));\n continue;\n }\n /**\n * If this is the first time a value is being animated, check\n * to see if we're handling off from an existing animation.\n */\n let isHandoff = false;\n if (window.MotionHandoffAnimation) {\n const appearId = getOptimisedAppearId(visualElement);\n if (appearId) {\n const startTime = window.MotionHandoffAnimation(appearId, key, frame);\n if (startTime !== null) {\n valueTransition.startTime = startTime;\n isHandoff = true;\n }\n }\n }\n addValueToWillChange(visualElement, key);\n const shouldReduceMotion = reduceMotion ?? visualElement.shouldReduceMotion;\n value.start(animateMotionValue(key, value, valueTarget, shouldReduceMotion && positionalKeys.has(key)\n ? { type: false }\n : valueTransition, visualElement, isHandoff));\n const animation = value.animation;\n if (animation) {\n animations.push(animation);\n }\n }\n if (transitionEnd) {\n const applyTransitionEnd = () => frame.update(() => {\n transitionEnd && setTarget(visualElement, transitionEnd);\n });\n if (animations.length) {\n Promise.all(animations).then(applyTransitionEnd);\n }\n else {\n applyTransitionEnd();\n }\n }\n return animations;\n}\n\nexport { animateTarget };\n//# sourceMappingURL=visual-element-target.mjs.map\n","/**\n * ValueType for \"auto\"\n */\nconst auto = {\n test: (v) => v === \"auto\",\n parse: (v) => v,\n};\n\nexport { auto };\n//# sourceMappingURL=auto.mjs.map\n","/**\n * Tests a provided value against a ValueType\n */\nconst testValueType = (v) => (type) => type.test(v);\n\nexport { testValueType };\n//# sourceMappingURL=test.mjs.map\n","import { auto } from './auto.mjs';\nimport { number } from './numbers/index.mjs';\nimport { px, percent, degrees, vw, vh } from './numbers/units.mjs';\nimport { testValueType } from './test.mjs';\n\n/**\n * A list of value types commonly used for dimensions\n */\nconst dimensionValueTypes = [number, px, percent, degrees, vw, vh, auto];\n/**\n * Tests a dimensional value against the list of dimension ValueTypes\n */\nconst findDimensionValueType = (v) => dimensionValueTypes.find(testValueType(v));\n\nexport { dimensionValueTypes, findDimensionValueType };\n//# sourceMappingURL=dimensions.mjs.map\n","import { isZeroValueString } from 'motion-utils';\n\nfunction isNone(value) {\n if (typeof value === \"number\") {\n return value === 0;\n }\n else if (value !== null) {\n return value === \"none\" || value === \"0\" || isZeroValueString(value);\n }\n else {\n return true;\n }\n}\n\nexport { isNone };\n//# sourceMappingURL=is-none.mjs.map\n","import { complex } from './index.mjs';\nimport { floatRegex } from '../utils/float-regex.mjs';\n\n/**\n * Properties that should default to 1 or 100%\n */\nconst maxDefaults = new Set([\"brightness\", \"contrast\", \"saturate\", \"opacity\"]);\nfunction applyDefaultFilter(v) {\n const [name, value] = v.slice(0, -1).split(\"(\");\n if (name === \"drop-shadow\")\n return v;\n const [number] = value.match(floatRegex) || [];\n if (!number)\n return v;\n const unit = value.replace(number, \"\");\n let defaultValue = maxDefaults.has(name) ? 1 : 0;\n if (number !== value)\n defaultValue *= 100;\n return name + \"(\" + defaultValue + unit + \")\";\n}\nconst functionRegex = /\\b([a-z-]*)\\(.*?\\)/gu;\nconst filter = {\n ...complex,\n getAnimatableNone: (v) => {\n const functions = v.match(functionRegex);\n return functions ? functions.map(applyDefaultFilter).join(\" \") : v;\n },\n};\n\nexport { filter };\n//# sourceMappingURL=filter.mjs.map\n","import { complex } from './index.mjs';\n\nconst mask = {\n ...complex,\n getAnimatableNone: (v) => {\n const parsed = complex.parse(v);\n const transformer = complex.createTransformer(v);\n return transformer(parsed.map((v) => typeof v === \"number\" ? 0 : typeof v === \"object\" ? { ...v, alpha: 1 } : v));\n },\n};\n\nexport { mask };\n//# sourceMappingURL=mask.mjs.map\n","import { number } from './numbers/index.mjs';\n\nconst int = {\n ...number,\n transform: Math.round,\n};\n\nexport { int };\n//# sourceMappingURL=int.mjs.map\n","import { int } from '../int.mjs';\nimport { alpha } from '../numbers/index.mjs';\nimport { px } from '../numbers/units.mjs';\nimport { transformValueTypes } from './transform.mjs';\n\nconst numberValueTypes = {\n // Border props\n borderWidth: px,\n borderTopWidth: px,\n borderRightWidth: px,\n borderBottomWidth: px,\n borderLeftWidth: px,\n borderRadius: px,\n borderTopLeftRadius: px,\n borderTopRightRadius: px,\n borderBottomRightRadius: px,\n borderBottomLeftRadius: px,\n // Positioning props\n width: px,\n maxWidth: px,\n height: px,\n maxHeight: px,\n top: px,\n right: px,\n bottom: px,\n left: px,\n inset: px,\n insetBlock: px,\n insetBlockStart: px,\n insetBlockEnd: px,\n insetInline: px,\n insetInlineStart: px,\n insetInlineEnd: px,\n // Spacing props\n padding: px,\n paddingTop: px,\n paddingRight: px,\n paddingBottom: px,\n paddingLeft: px,\n paddingBlock: px,\n paddingBlockStart: px,\n paddingBlockEnd: px,\n paddingInline: px,\n paddingInlineStart: px,\n paddingInlineEnd: px,\n margin: px,\n marginTop: px,\n marginRight: px,\n marginBottom: px,\n marginLeft: px,\n marginBlock: px,\n marginBlockStart: px,\n marginBlockEnd: px,\n marginInline: px,\n marginInlineStart: px,\n marginInlineEnd: px,\n // Typography\n fontSize: px,\n // Misc\n backgroundPositionX: px,\n backgroundPositionY: px,\n ...transformValueTypes,\n zIndex: int,\n // SVG\n fillOpacity: alpha,\n strokeOpacity: alpha,\n numOctaves: int,\n};\n\nexport { numberValueTypes };\n//# sourceMappingURL=number.mjs.map\n","import { alpha, scale } from '../numbers/index.mjs';\nimport { px, progressPercentage, degrees } from '../numbers/units.mjs';\n\nconst transformValueTypes = {\n rotate: degrees,\n /**\n * Internal channel for `transition.path` orientToPath. Composed onto\n * `rotate` at the transform-build sites so the user's `rotate` is\n * never read or overwritten. Not part of `transformPropOrder`.\n */\n pathRotation: degrees,\n rotateX: degrees,\n rotateY: degrees,\n rotateZ: degrees,\n scale,\n scaleX: scale,\n scaleY: scale,\n scaleZ: scale,\n skew: degrees,\n skewX: degrees,\n skewY: degrees,\n distance: px,\n translateX: px,\n translateY: px,\n translateZ: px,\n x: px,\n y: px,\n z: px,\n perspective: px,\n transformPerspective: px,\n opacity: alpha,\n originX: progressPercentage,\n originY: progressPercentage,\n originZ: px,\n};\n\nexport { transformValueTypes };\n//# sourceMappingURL=transform.mjs.map\n","import { color } from '../color/index.mjs';\nimport { filter } from '../complex/filter.mjs';\nimport { mask } from '../complex/mask.mjs';\nimport { numberValueTypes } from './number.mjs';\n\n/**\n * A map of default value types for common values\n */\nconst defaultValueTypes = {\n ...numberValueTypes,\n // Color props\n color,\n backgroundColor: color,\n outlineColor: color,\n fill: color,\n stroke: color,\n // Border props\n borderColor: color,\n borderTopColor: color,\n borderRightColor: color,\n borderBottomColor: color,\n borderLeftColor: color,\n filter,\n WebkitFilter: filter,\n mask,\n WebkitMask: mask,\n};\n/**\n * Gets the default ValueType for the provided value key\n */\nconst getDefaultValueType = (key) => defaultValueTypes[key];\n\nexport { defaultValueTypes, getDefaultValueType };\n//# sourceMappingURL=defaults.mjs.map\n","import { complex } from '../complex/index.mjs';\nimport { filter } from '../complex/filter.mjs';\nimport { mask } from '../complex/mask.mjs';\nimport { getDefaultValueType } from '../maps/defaults.mjs';\n\nconst customTypes = /*@__PURE__*/ new Set([filter, mask]);\nfunction getAnimatableNone(key, value) {\n let defaultValueType = getDefaultValueType(key);\n if (!customTypes.has(defaultValueType))\n defaultValueType = complex;\n // If value is not recognised as animatable, ie \"none\", create an animatable version origin based on the target\n return defaultValueType.getAnimatableNone\n ? defaultValueType.getAnimatableNone(value)\n : undefined;\n}\n\nexport { getAnimatableNone };\n//# sourceMappingURL=animatable-none.mjs.map\n","import { analyseComplexValue } from '../../../value/types/complex/index.mjs';\nimport { getAnimatableNone } from '../../../value/types/utils/animatable-none.mjs';\n\n/**\n * If we encounter keyframes like \"none\" or \"0\" and we also have keyframes like\n * \"#fff\" or \"200px 200px\" we want to find a keyframe to serve as a template for\n * the \"none\" keyframes. In this case \"#fff\" or \"200px 200px\" - then these get turned into\n * zero equivalents, i.e. \"#fff0\" or \"0px 0px\".\n */\nconst invalidTemplates = new Set([\"auto\", \"none\", \"0\"]);\nfunction makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, name) {\n let i = 0;\n let animatableTemplate = undefined;\n while (i < unresolvedKeyframes.length && !animatableTemplate) {\n const keyframe = unresolvedKeyframes[i];\n if (typeof keyframe === \"string\" &&\n !invalidTemplates.has(keyframe) &&\n analyseComplexValue(keyframe).values.length) {\n animatableTemplate = unresolvedKeyframes[i];\n }\n i++;\n }\n if (animatableTemplate && name) {\n for (const noneIndex of noneKeyframeIndexes) {\n unresolvedKeyframes[noneIndex] = getAnimatableNone(name, animatableTemplate);\n }\n }\n}\n\nexport { makeNoneKeyframesAnimatable };\n//# sourceMappingURL=make-none-animatable.mjs.map\n","import { positionalKeys } from '../../render/utils/keys-position.mjs';\nimport { findDimensionValueType } from '../../value/types/dimensions.mjs';\nimport { getVariableValue } from '../utils/css-variables-conversion.mjs';\nimport { isCSSVariableToken, containsCSSVariable } from '../utils/is-css-variable.mjs';\nimport { KeyframeResolver } from './KeyframesResolver.mjs';\nimport { isNone } from './utils/is-none.mjs';\nimport { makeNoneKeyframesAnimatable } from './utils/make-none-animatable.mjs';\nimport { positionalValues, isNumOrPxType } from './utils/unit-conversion.mjs';\n\nclass DOMKeyframesResolver extends KeyframeResolver {\n constructor(unresolvedKeyframes, onComplete, name, motionValue, element) {\n super(unresolvedKeyframes, onComplete, name, motionValue, element, true);\n }\n readKeyframes() {\n const { unresolvedKeyframes, element, name } = this;\n if (!element || !element.current)\n return;\n super.readKeyframes();\n /**\n * If any keyframe is a CSS variable, we need to find its value by sampling the element\n */\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n let keyframe = unresolvedKeyframes[i];\n if (typeof keyframe === \"string\") {\n keyframe = keyframe.trim();\n if (isCSSVariableToken(keyframe)) {\n const resolved = getVariableValue(keyframe, element.current);\n if (resolved !== undefined) {\n unresolvedKeyframes[i] = resolved;\n }\n if (i === unresolvedKeyframes.length - 1) {\n this.finalKeyframe = keyframe;\n }\n }\n }\n }\n /**\n * Resolve \"none\" values. We do this potentially twice - once before and once after measuring keyframes.\n * This could be seen as inefficient but it's a trade-off to avoid measurements in more situations, which\n * have a far bigger performance impact.\n */\n this.resolveNoneKeyframes();\n /**\n * Check to see if unit type has changed. If so schedule jobs that will\n * temporarily set styles to the destination keyframes.\n * Skip if we have more than two keyframes or this isn't a positional value.\n * TODO: We can throw if there are multiple keyframes and the value type changes.\n */\n if (!positionalKeys.has(name) || unresolvedKeyframes.length !== 2) {\n return;\n }\n const [origin, target] = unresolvedKeyframes;\n const originType = findDimensionValueType(origin);\n const targetType = findDimensionValueType(target);\n /**\n * If one keyframe contains embedded CSS variables (e.g. in calc()) and the other\n * doesn't, we need to measure to convert to pixels. This handles GitHub issue #3410.\n */\n const originHasVar = containsCSSVariable(origin);\n const targetHasVar = containsCSSVariable(target);\n if (originHasVar !== targetHasVar && positionalValues[name]) {\n this.needsMeasurement = true;\n return;\n }\n /**\n * Either we don't recognise these value types or we can animate between them.\n */\n if (originType === targetType)\n return;\n /**\n * If both values are numbers or pixels, we can animate between them by\n * converting them to numbers.\n */\n if (isNumOrPxType(originType) && isNumOrPxType(targetType)) {\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n const value = unresolvedKeyframes[i];\n if (typeof value === \"string\") {\n unresolvedKeyframes[i] = parseFloat(value);\n }\n }\n }\n else if (positionalValues[name]) {\n /**\n * Else, the only way to resolve this is by measuring the element.\n */\n this.needsMeasurement = true;\n }\n }\n resolveNoneKeyframes() {\n const { unresolvedKeyframes, name } = this;\n const noneKeyframeIndexes = [];\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n if (unresolvedKeyframes[i] === null ||\n isNone(unresolvedKeyframes[i])) {\n noneKeyframeIndexes.push(i);\n }\n }\n if (noneKeyframeIndexes.length) {\n makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, name);\n }\n }\n measureInitialState() {\n const { element, unresolvedKeyframes, name } = this;\n if (!element || !element.current)\n return;\n if (name === \"height\") {\n this.suspendedScrollY = window.pageYOffset;\n }\n this.measuredOrigin = positionalValues[name](element.measureViewportBox(), window.getComputedStyle(element.current));\n unresolvedKeyframes[0] = this.measuredOrigin;\n // Set final key frame to measure after next render\n const measureKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1];\n if (measureKeyframe !== undefined) {\n element.getValue(name, measureKeyframe).jump(measureKeyframe, false);\n }\n }\n measureEndState() {\n const { element, name, unresolvedKeyframes } = this;\n if (!element || !element.current)\n return;\n const value = element.getValue(name);\n value && value.jump(this.measuredOrigin, false);\n const finalKeyframeIndex = unresolvedKeyframes.length - 1;\n const finalKeyframe = unresolvedKeyframes[finalKeyframeIndex];\n unresolvedKeyframes[finalKeyframeIndex] = positionalValues[name](element.measureViewportBox(), window.getComputedStyle(element.current));\n if (finalKeyframe !== null && this.finalKeyframe === undefined) {\n this.finalKeyframe = finalKeyframe;\n }\n // If we removed transform values, reapply them before the next render\n if (this.removedTransforms?.length) {\n this.removedTransforms.forEach(([unsetTransformName, unsetTransformValue]) => {\n element\n .getValue(unsetTransformName)\n .set(unsetTransformValue);\n });\n }\n this.resolveNoneKeyframes();\n }\n}\n\nexport { DOMKeyframesResolver };\n//# sourceMappingURL=DOMKeyframesResolver.mjs.map\n","/**\n * Provided a value and a ValueType, returns the value as that value type.\n */\nconst getValueAsType = (value, type) => {\n return type && typeof value === \"number\"\n ? type.transform(value)\n : value;\n};\n\nexport { getValueAsType };\n//# sourceMappingURL=get-as-type.mjs.map\n","import { createRenderBatcher } from './batcher.mjs';\n\nconst { schedule: microtask, cancel: cancelMicrotask } = \n/* @__PURE__ */ createRenderBatcher(queueMicrotask, false);\n\nexport { cancelMicrotask, microtask };\n//# sourceMappingURL=microtask.mjs.map\n","import { isObject } from 'motion-utils';\n\n/**\n * Checks if an element is an SVG element in a way\n * that works across iframes\n */\nfunction isSVGElement(element) {\n return isObject(element) && \"ownerSVGElement\" in element;\n}\n\nexport { isSVGElement };\n//# sourceMappingURL=is-svg-element.mjs.map\n","const isObject = (value) => typeof value === \"object\" && value !== null;\n\nexport { isObject };\n//# sourceMappingURL=is-object.mjs.map\n","import { color } from '../color/index.mjs';\nimport { complex } from '../complex/index.mjs';\nimport { dimensionValueTypes } from '../dimensions.mjs';\nimport { testValueType } from '../test.mjs';\n\n/**\n * A list of all ValueTypes\n */\nconst valueTypes = [...dimensionValueTypes, color, complex];\n/**\n * Tests a value against the list of ValueTypes\n */\nconst findValueType = (v) => valueTypes.find(testValueType(v));\n\nexport { findValueType };\n//# sourceMappingURL=find.mjs.map\n","const createAxisDelta = () => ({\n translate: 0,\n scale: 1,\n origin: 0,\n originPoint: 0,\n});\nconst createDelta = () => ({\n x: createAxisDelta(),\n y: createAxisDelta(),\n});\nconst createAxis = () => ({ min: 0, max: 0 });\nconst createBox = () => ({\n x: createAxis(),\n y: createAxis(),\n});\n\nexport { createAxis, createAxisDelta, createBox, createDelta };\n//# sourceMappingURL=models.mjs.map\n","const visualElementStore = new WeakMap();\n\nexport { visualElementStore };\n//# sourceMappingURL=store.mjs.map\n","const variantPriorityOrder = [\n \"animate\",\n \"whileInView\",\n \"whileFocus\",\n \"whileHover\",\n \"whileTap\",\n \"whileDrag\",\n \"exit\",\n];\nconst variantProps = [\"initial\", ...variantPriorityOrder];\n\nexport { variantPriorityOrder, variantProps };\n//# sourceMappingURL=variant-props.mjs.map\n","import { isAnimationControls } from './is-animation-controls.mjs';\nimport { isVariantLabel } from './is-variant-label.mjs';\nimport { variantProps } from './variant-props.mjs';\n\nfunction isControllingVariants(props) {\n return (isAnimationControls(props.animate) ||\n variantProps.some((name) => isVariantLabel(props[name])));\n}\nfunction isVariantNode(props) {\n return Boolean(isControllingVariants(props) || props.variants);\n}\n\nexport { isControllingVariants, isVariantNode };\n//# sourceMappingURL=is-controlling-variants.mjs.map\n","function isAnimationControls(v) {\n return (v !== null &&\n typeof v === \"object\" &&\n typeof v.start === \"function\");\n}\n\nexport { isAnimationControls };\n//# sourceMappingURL=is-animation-controls.mjs.map\n","/**\n * Decides if the supplied variable is variant label\n */\nfunction isVariantLabel(v) {\n return typeof v === \"string\" || Array.isArray(v);\n}\n\nexport { isVariantLabel };\n//# sourceMappingURL=is-variant-label.mjs.map\n","// Does this device prefer reduced motion? Returns `null` server-side.\nconst prefersReducedMotion = { current: null };\nconst hasReducedMotionListener = { current: false };\n\nexport { hasReducedMotionListener, prefersReducedMotion };\n//# sourceMappingURL=state.mjs.map\n","import { hasReducedMotionListener, prefersReducedMotion } from './state.mjs';\n\nconst isBrowser = typeof window !== \"undefined\";\nfunction initPrefersReducedMotion() {\n hasReducedMotionListener.current = true;\n if (!isBrowser)\n return;\n if (window.matchMedia) {\n const motionMediaQuery = window.matchMedia(\"(prefers-reduced-motion)\");\n const setReducedMotionPreferences = () => (prefersReducedMotion.current = motionMediaQuery.matches);\n motionMediaQuery.addEventListener(\"change\", setReducedMotionPreferences);\n setReducedMotionPreferences();\n }\n else {\n prefersReducedMotion.current = false;\n }\n}\n\nexport { hasReducedMotionListener, initPrefersReducedMotion, prefersReducedMotion };\n//# sourceMappingURL=index.mjs.map\n","import { warnOnce, secondsToMilliseconds, isNumericalString, isZeroValueString, SubscriptionManager } from 'motion-utils';\nimport { KeyframeResolver } from '../animation/keyframes/KeyframesResolver.mjs';\nimport { NativeAnimation } from '../animation/NativeAnimation.mjs';\nimport { acceleratedValues } from '../animation/waapi/utils/accelerated-values.mjs';\nimport { microtask } from '../frameloop/microtask.mjs';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { createBox } from '../projection/geometry/models.mjs';\nimport { motionValue } from '../value/index.mjs';\nimport { complex } from '../value/types/complex/index.mjs';\nimport { getAnimatableNone } from '../value/types/utils/animatable-none.mjs';\nimport { findValueType } from '../value/types/utils/find.mjs';\nimport { isMotionValue } from '../value/utils/is-motion-value.mjs';\nimport { visualElementStore } from './store.mjs';\nimport { isControllingVariants, isVariantNode } from './utils/is-controlling-variants.mjs';\nimport { transformProps } from './utils/keys-transform.mjs';\nimport { updateMotionValuesFromProps } from './utils/motion-values.mjs';\nimport { initPrefersReducedMotion } from './utils/reduced-motion/index.mjs';\nimport { resolveVariantFromProps } from './utils/resolve-variants.mjs';\nimport { hasReducedMotionListener, prefersReducedMotion } from './utils/reduced-motion/state.mjs';\nimport { frame, cancelFrame } from '../frameloop/frame.mjs';\n\nconst propEventHandlers = [\n \"AnimationStart\",\n \"AnimationComplete\",\n \"Update\",\n \"BeforeLayoutMeasure\",\n \"LayoutMeasure\",\n \"LayoutAnimationStart\",\n \"LayoutAnimationComplete\",\n];\n/**\n * Static feature definitions - can be injected by framework layer\n */\nlet featureDefinitions = {};\n/**\n * Set feature definitions for all VisualElements.\n * This should be called by the framework layer (e.g., framer-motion) during initialization.\n */\nfunction setFeatureDefinitions(definitions) {\n featureDefinitions = definitions;\n}\n/**\n * Get the current feature definitions\n */\nfunction getFeatureDefinitions() {\n return featureDefinitions;\n}\n/**\n * A VisualElement is an imperative abstraction around UI elements such as\n * HTMLElement, SVGElement, Three.Object3D etc.\n */\nclass VisualElement {\n /**\n * This method takes React props and returns found MotionValues. For example, HTML\n * MotionValues will be found within the style prop, whereas for Three.js within attribute arrays.\n *\n * This isn't an abstract method as it needs calling in the constructor, but it is\n * intended to be one.\n */\n scrapeMotionValuesFromProps(_props, _prevProps, _visualElement) {\n return {};\n }\n constructor({ parent, props, presenceContext, reducedMotionConfig, skipAnimations, blockInitialAnimation, visualState, }, options = {}) {\n /**\n * A reference to the current underlying Instance, e.g. a HTMLElement\n * or Three.Mesh etc.\n */\n this.current = null;\n /**\n * A set containing references to this VisualElement's children.\n */\n this.children = new Set();\n /**\n * Determine what role this visual element should take in the variant tree.\n */\n this.isVariantNode = false;\n this.isControllingVariants = false;\n /**\n * Decides whether this VisualElement should animate in reduced motion\n * mode.\n *\n * TODO: This is currently set on every individual VisualElement but feels\n * like it could be set globally.\n */\n this.shouldReduceMotion = null;\n /**\n * Decides whether animations should be skipped for this VisualElement.\n * Useful for E2E tests and visual regression testing.\n */\n this.shouldSkipAnimations = false;\n /**\n * A map of all motion values attached to this visual element. Motion\n * values are source of truth for any given animated value. A motion\n * value might be provided externally by the component via props.\n */\n this.values = new Map();\n this.KeyframeResolver = KeyframeResolver;\n /**\n * Cleanup functions for active features (hover/tap/exit etc)\n */\n this.features = {};\n /**\n * A map of every subscription that binds the provided or generated\n * motion values onChange listeners to this visual element.\n */\n this.valueSubscriptions = new Map();\n /**\n * A reference to the previously-provided motion values as returned\n * from scrapeMotionValuesFromProps. We use the keys in here to determine\n * if any motion values need to be removed after props are updated.\n */\n this.prevMotionValues = {};\n /**\n * Track whether this element has been mounted before, to detect\n * remounts after Suspense unmount/remount cycles.\n */\n this.hasBeenMounted = false;\n /**\n * An object containing a SubscriptionManager for each active event.\n */\n this.events = {};\n /**\n * An object containing an unsubscribe function for each prop event subscription.\n * For example, every \"Update\" event can have multiple subscribers via\n * VisualElement.on(), but only one of those can be defined via the onUpdate prop.\n */\n this.propEventSubscriptions = {};\n this.notifyUpdate = () => this.notify(\"Update\", this.latestValues);\n this.render = () => {\n if (!this.current)\n return;\n this.triggerBuild();\n this.renderInstance(this.current, this.renderState, this.props.style, this.projection);\n };\n this.renderScheduledAt = 0.0;\n this.scheduleRender = () => {\n const now = time.now();\n if (this.renderScheduledAt < now) {\n this.renderScheduledAt = now;\n frame.render(this.render, false, true);\n }\n };\n const { latestValues, renderState } = visualState;\n this.latestValues = latestValues;\n this.baseTarget = { ...latestValues };\n this.initialValues = props.initial ? { ...latestValues } : {};\n this.renderState = renderState;\n this.parent = parent;\n this.props = props;\n this.presenceContext = presenceContext;\n this.depth = parent ? parent.depth + 1 : 0;\n this.reducedMotionConfig = reducedMotionConfig;\n this.skipAnimationsConfig = skipAnimations;\n this.options = options;\n this.blockInitialAnimation = Boolean(blockInitialAnimation);\n this.isControllingVariants = isControllingVariants(props);\n this.isVariantNode = isVariantNode(props);\n if (this.isVariantNode) {\n this.variantChildren = new Set();\n }\n this.manuallyAnimateOnMount = Boolean(parent && parent.current);\n /**\n * Any motion values that are provided to the element when created\n * aren't yet bound to the element, as this would technically be impure.\n * However, we iterate through the motion values and set them to the\n * initial values for this component.\n *\n * TODO: This is impure and we should look at changing this to run on mount.\n * Doing so will break some tests but this isn't necessarily a breaking change,\n * more a reflection of the test.\n */\n const { willChange, ...initialMotionValues } = this.scrapeMotionValuesFromProps(props, {}, this);\n for (const key in initialMotionValues) {\n const value = initialMotionValues[key];\n if (latestValues[key] !== undefined && isMotionValue(value)) {\n value.set(latestValues[key]);\n }\n }\n }\n mount(instance) {\n /**\n * If this element has been mounted before (e.g. after a Suspense\n * unmount/remount), reset motion values to their initial state\n * so animations replay correctly from initial → animate.\n */\n if (this.hasBeenMounted) {\n for (const key in this.initialValues) {\n this.values.get(key)?.jump(this.initialValues[key]);\n this.latestValues[key] = this.initialValues[key];\n }\n }\n this.current = instance;\n visualElementStore.set(instance, this);\n if (this.projection && !this.projection.instance) {\n this.projection.mount(instance);\n }\n if (this.parent && this.isVariantNode && !this.isControllingVariants) {\n this.removeFromVariantTree = this.parent.addVariantChild(this);\n }\n this.values.forEach((value, key) => this.bindToMotionValue(key, value));\n /**\n * Determine reduced motion preference. Only initialize the matchMedia\n * listener if we actually need the dynamic value (i.e., when config\n * is neither \"never\" nor \"always\").\n */\n if (this.reducedMotionConfig === \"never\") {\n this.shouldReduceMotion = false;\n }\n else if (this.reducedMotionConfig === \"always\") {\n this.shouldReduceMotion = true;\n }\n else {\n if (!hasReducedMotionListener.current) {\n initPrefersReducedMotion();\n }\n this.shouldReduceMotion = prefersReducedMotion.current;\n }\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(this.shouldReduceMotion !== true, \"You have Reduced Motion enabled on your device. Animations may not appear as expected.\", \"reduced-motion-disabled\");\n }\n /**\n * Set whether animations should be skipped based on the config.\n */\n this.shouldSkipAnimations = this.skipAnimationsConfig ?? false;\n this.parent?.addChild(this);\n this.update(this.props, this.presenceContext);\n this.hasBeenMounted = true;\n }\n unmount() {\n this.projection && this.projection.unmount();\n cancelFrame(this.notifyUpdate);\n cancelFrame(this.render);\n this.valueSubscriptions.forEach((remove) => remove());\n this.valueSubscriptions.clear();\n this.removeFromVariantTree && this.removeFromVariantTree();\n this.parent?.removeChild(this);\n for (const key in this.events) {\n this.events[key].clear();\n }\n for (const key in this.features) {\n const feature = this.features[key];\n if (feature) {\n feature.unmount();\n feature.isMounted = false;\n }\n }\n this.current = null;\n }\n addChild(child) {\n this.children.add(child);\n this.enteringChildren ?? (this.enteringChildren = new Set());\n this.enteringChildren.add(child);\n }\n removeChild(child) {\n this.children.delete(child);\n this.enteringChildren && this.enteringChildren.delete(child);\n }\n bindToMotionValue(key, value) {\n if (this.valueSubscriptions.has(key)) {\n this.valueSubscriptions.get(key)();\n }\n if (value.accelerate &&\n acceleratedValues.has(key) &&\n this.current instanceof HTMLElement) {\n const { factory, keyframes, times, ease, duration } = value.accelerate;\n const animation = new NativeAnimation({\n element: this.current,\n name: key,\n keyframes,\n times,\n ease,\n duration: secondsToMilliseconds(duration),\n });\n const cleanup = factory(animation);\n this.valueSubscriptions.set(key, () => {\n cleanup();\n animation.cancel();\n });\n return;\n }\n const valueIsTransform = transformProps.has(key);\n if (valueIsTransform && this.onBindTransform) {\n this.onBindTransform();\n }\n const removeOnChange = value.on(\"change\", (latestValue) => {\n this.latestValues[key] = latestValue;\n this.props.onUpdate && frame.preRender(this.notifyUpdate);\n if (valueIsTransform && this.projection) {\n this.projection.isTransformDirty = true;\n }\n this.scheduleRender();\n });\n let removeSyncCheck;\n if (typeof window !== \"undefined\" &&\n window.MotionCheckAppearSync) {\n removeSyncCheck = window.MotionCheckAppearSync(this, key, value);\n }\n this.valueSubscriptions.set(key, () => {\n removeOnChange();\n if (removeSyncCheck)\n removeSyncCheck();\n // Defer to MotionValue.on(\"change\") auto-stop so React 19 remounts\n // can resubscribe before the animation is cancelled (#3315).\n });\n }\n sortNodePosition(other) {\n /**\n * If these nodes aren't even of the same type we can't compare their depth.\n */\n if (!this.current ||\n !this.sortInstanceNodePosition ||\n this.type !== other.type) {\n return 0;\n }\n return this.sortInstanceNodePosition(this.current, other.current);\n }\n updateFeatures() {\n let key = \"animation\";\n for (key in featureDefinitions) {\n const featureDefinition = featureDefinitions[key];\n if (!featureDefinition)\n continue;\n const { isEnabled, Feature: FeatureConstructor } = featureDefinition;\n /**\n * If this feature is enabled but not active, make a new instance.\n */\n if (!this.features[key] &&\n FeatureConstructor &&\n isEnabled(this.props)) {\n this.features[key] = new FeatureConstructor(this);\n }\n /**\n * If we have a feature, mount or update it.\n */\n if (this.features[key]) {\n const feature = this.features[key];\n if (feature.isMounted) {\n feature.update();\n }\n else {\n feature.mount();\n feature.isMounted = true;\n }\n }\n }\n }\n triggerBuild() {\n this.build(this.renderState, this.latestValues, this.props);\n }\n /**\n * Measure the current viewport box with or without transforms.\n * Only measures axis-aligned boxes, rotate and skew must be manually\n * removed with a re-render to work.\n */\n measureViewportBox() {\n return this.current\n ? this.measureInstanceViewportBox(this.current, this.props)\n : createBox();\n }\n getStaticValue(key) {\n return this.latestValues[key];\n }\n setStaticValue(key, value) {\n this.latestValues[key] = value;\n }\n /**\n * Update the provided props. Ensure any newly-added motion values are\n * added to our map, old ones removed, and listeners updated.\n */\n update(props, presenceContext) {\n if (props.transformTemplate || this.props.transformTemplate) {\n this.scheduleRender();\n }\n this.prevProps = this.props;\n this.props = props;\n this.prevPresenceContext = this.presenceContext;\n this.presenceContext = presenceContext;\n /**\n * Update prop event handlers ie onAnimationStart, onAnimationComplete\n */\n for (let i = 0; i < propEventHandlers.length; i++) {\n const key = propEventHandlers[i];\n if (this.propEventSubscriptions[key]) {\n this.propEventSubscriptions[key]();\n delete this.propEventSubscriptions[key];\n }\n const listenerName = (\"on\" + key);\n const listener = props[listenerName];\n if (listener) {\n this.propEventSubscriptions[key] = this.on(key, listener);\n }\n }\n this.prevMotionValues = updateMotionValuesFromProps(this, this.scrapeMotionValuesFromProps(props, this.prevProps || {}, this), this.prevMotionValues);\n if (this.handleChildMotionValue) {\n this.handleChildMotionValue();\n }\n }\n getProps() {\n return this.props;\n }\n /**\n * Returns the variant definition with a given name.\n */\n getVariant(name) {\n return this.props.variants ? this.props.variants[name] : undefined;\n }\n /**\n * Returns the defined default transition on this component.\n */\n getDefaultTransition() {\n return this.props.transition;\n }\n getTransformPagePoint() {\n return this.props.transformPagePoint;\n }\n getClosestVariantNode() {\n return this.isVariantNode\n ? this\n : this.parent\n ? this.parent.getClosestVariantNode()\n : undefined;\n }\n /**\n * Add a child visual element to our set of children.\n */\n addVariantChild(child) {\n const closestVariantNode = this.getClosestVariantNode();\n if (closestVariantNode) {\n closestVariantNode.variantChildren &&\n closestVariantNode.variantChildren.add(child);\n return () => closestVariantNode.variantChildren.delete(child);\n }\n }\n /**\n * Add a motion value and bind it to this visual element.\n */\n addValue(key, value) {\n // Remove existing value if it exists\n const existingValue = this.values.get(key);\n if (value !== existingValue) {\n if (existingValue)\n this.removeValue(key);\n this.bindToMotionValue(key, value);\n this.values.set(key, value);\n this.latestValues[key] = value.get();\n }\n }\n /**\n * Remove a motion value and unbind any active subscriptions.\n */\n removeValue(key) {\n this.values.delete(key);\n const unsubscribe = this.valueSubscriptions.get(key);\n if (unsubscribe) {\n unsubscribe();\n this.valueSubscriptions.delete(key);\n }\n delete this.latestValues[key];\n this.removeValueFromRenderState(key, this.renderState);\n }\n /**\n * Check whether we have a motion value for this key\n */\n hasValue(key) {\n return this.values.has(key);\n }\n getValue(key, defaultValue) {\n if (this.props.values && this.props.values[key]) {\n return this.props.values[key];\n }\n let value = this.values.get(key);\n if (value === undefined && defaultValue !== undefined) {\n value = motionValue(defaultValue === null ? undefined : defaultValue, { owner: this });\n this.addValue(key, value);\n }\n return value;\n }\n /**\n * If we're trying to animate to a previously unencountered value,\n * we need to check for it in our state and as a last resort read it\n * directly from the instance (which might have performance implications).\n */\n readValue(key, target) {\n let value = this.latestValues[key] !== undefined || !this.current\n ? this.latestValues[key]\n : this.getBaseTargetFromProps(this.props, key) ??\n this.readValueFromInstance(this.current, key, this.options);\n if (value !== undefined && value !== null) {\n if (typeof value === \"string\" &&\n (isNumericalString(value) || isZeroValueString(value))) {\n // If this is a number read as a string, ie \"0\" or \"200\", convert it to a number\n value = parseFloat(value);\n }\n else if (!findValueType(value) && complex.test(target)) {\n value = getAnimatableNone(key, target);\n }\n this.setBaseTarget(key, isMotionValue(value) ? value.get() : value);\n }\n return isMotionValue(value) ? value.get() : value;\n }\n /**\n * Set the base target to later animate back to. This is currently\n * only hydrated on creation and when we first read a value.\n */\n setBaseTarget(key, value) {\n this.baseTarget[key] = value;\n }\n /**\n * Find the base target for a value thats been removed from all animation\n * props.\n */\n getBaseTarget(key) {\n const { initial } = this.props;\n let valueFromInitial;\n if (typeof initial === \"string\" || typeof initial === \"object\") {\n const variant = resolveVariantFromProps(this.props, initial, this.presenceContext?.custom);\n if (variant) {\n valueFromInitial = variant[key];\n }\n }\n /**\n * If this value still exists in the current initial variant, read that.\n */\n if (initial && valueFromInitial !== undefined) {\n return valueFromInitial;\n }\n /**\n * Alternatively, if this VisualElement config has defined a getBaseTarget\n * so we can read the value from an alternative source, try that.\n */\n const target = this.getBaseTargetFromProps(this.props, key);\n if (target !== undefined && !isMotionValue(target))\n return target;\n /**\n * If the value was initially defined on initial, but it doesn't any more,\n * return undefined. Otherwise return the value as initially read from the DOM.\n */\n return this.initialValues[key] !== undefined &&\n valueFromInitial === undefined\n ? undefined\n : this.baseTarget[key];\n }\n on(eventName, callback) {\n if (!this.events[eventName]) {\n this.events[eventName] = new SubscriptionManager();\n }\n return this.events[eventName].add(callback);\n }\n notify(eventName, ...args) {\n if (this.events[eventName]) {\n this.events[eventName].notify(...args);\n }\n }\n scheduleRenderMicrotask() {\n microtask.render(this.render);\n }\n}\n\nexport { VisualElement, getFeatureDefinitions, setFeatureDefinitions };\n//# sourceMappingURL=VisualElement.mjs.map\n","import { motionValue } from '../../value/index.mjs';\nimport { isMotionValue } from '../../value/utils/is-motion-value.mjs';\n\n/**\n * Updates motion values from props changes.\n * Uses `any` type for element to avoid circular dependencies with VisualElement.\n */\nfunction updateMotionValuesFromProps(element, next, prev) {\n for (const key in next) {\n const nextValue = next[key];\n const prevValue = prev[key];\n if (isMotionValue(nextValue)) {\n /**\n * If this is a motion value found in props or style, we want to add it\n * to our visual element's motion value map.\n */\n element.addValue(key, nextValue);\n }\n else if (isMotionValue(prevValue)) {\n /**\n * If we're swapping from a motion value to a static value,\n * create a new motion value from that\n */\n element.addValue(key, motionValue(nextValue, { owner: element }));\n }\n else if (prevValue !== nextValue) {\n /**\n * If this is a flat value that has changed, update the motion value\n * or create one if it doesn't exist. We only want to do this if we're\n * not handling the value with our animation state.\n */\n if (element.hasValue(key)) {\n const existingValue = element.getValue(key);\n if (existingValue.liveStyle === true) {\n existingValue.jump(nextValue);\n }\n else if (!existingValue.hasAnimated) {\n existingValue.set(nextValue);\n }\n }\n else {\n const latestValue = element.getStaticValue(key);\n element.addValue(key, motionValue(latestValue !== undefined ? latestValue : nextValue, { owner: element }));\n }\n }\n }\n // Handle removed values\n for (const key in prev) {\n if (next[key] === undefined)\n element.removeValue(key);\n }\n return next;\n}\n\nexport { updateMotionValuesFromProps };\n//# sourceMappingURL=motion-values.mjs.map\n","import { isMotionValue } from '../../value/utils/is-motion-value.mjs';\nimport { DOMKeyframesResolver } from '../../animation/keyframes/DOMKeyframesResolver.mjs';\nimport { VisualElement } from '../VisualElement.mjs';\n\nclass DOMVisualElement extends VisualElement {\n constructor() {\n super(...arguments);\n this.KeyframeResolver = DOMKeyframesResolver;\n }\n sortInstanceNodePosition(a, b) {\n /**\n * compareDocumentPosition returns a bitmask, by using the bitwise &\n * we're returning true if 2 in that bitmask is set to true. 2 is set\n * to true if b preceeds a.\n */\n return a.compareDocumentPosition(b) & 2 ? 1 : -1;\n }\n getBaseTargetFromProps(props, key) {\n const style = props.style;\n return style ? style[key] : undefined;\n }\n removeValueFromRenderState(key, { vars, style }) {\n delete vars[key];\n delete style[key];\n }\n handleChildMotionValue() {\n if (this.childSubscription) {\n this.childSubscription();\n delete this.childSubscription;\n }\n const { children } = this.props;\n if (isMotionValue(children)) {\n this.childSubscription = children.on(\"change\", (latest) => {\n if (this.current) {\n this.current.textContent = `${latest}`;\n }\n });\n }\n }\n}\n\nexport { DOMVisualElement };\n//# sourceMappingURL=DOMVisualElement.mjs.map\n","import { getValueAsType } from '../../../value/types/utils/get-as-type.mjs';\nimport { numberValueTypes } from '../../../value/types/maps/number.mjs';\nimport { transformPropOrder } from '../../utils/keys-transform.mjs';\n\nconst translateAlias = {\n x: \"translateX\",\n y: \"translateY\",\n z: \"translateZ\",\n transformPerspective: \"perspective\",\n};\nconst numTransforms = transformPropOrder.length;\n/**\n * Build a CSS transform style from individual x/y/scale etc properties.\n *\n * This outputs with a default order of transforms/scales/rotations, this can be customised by\n * providing a transformTemplate function.\n */\nfunction buildTransform(latestValues, transform, transformTemplate) {\n // The transform string we're going to build into.\n let transformString = \"\";\n let transformIsDefault = true;\n /**\n * Loop over all possible transforms in order, adding the ones that\n * are present to the transform string.\n */\n for (let i = 0; i < numTransforms; i++) {\n const key = transformPropOrder[i];\n const value = latestValues[key];\n if (value === undefined)\n continue;\n let valueIsDefault = true;\n if (typeof value === \"number\") {\n valueIsDefault = value === (key.startsWith(\"scale\") ? 1 : 0);\n }\n else {\n const parsed = parseFloat(value);\n valueIsDefault = key.startsWith(\"scale\") ? parsed === 1 : parsed === 0;\n }\n if (!valueIsDefault || transformTemplate) {\n const valueAsType = getValueAsType(value, numberValueTypes[key]);\n if (!valueIsDefault) {\n transformIsDefault = false;\n const transformName = translateAlias[key] || key;\n transformString += `${transformName}(${valueAsType}) `;\n }\n if (transformTemplate) {\n transform[key] = valueAsType;\n }\n }\n }\n // `pathRotation` composes onto `rotate` as a separate additive term so\n // the user's `rotate` is never clobbered. Deliberately not a slot in\n // `transformPropOrder`.\n const pathRotation = latestValues.pathRotation;\n if (pathRotation) {\n transformIsDefault = false;\n transformString += `rotate(${getValueAsType(pathRotation, numberValueTypes.pathRotation)}) `;\n }\n transformString = transformString.trim();\n // If we have a custom `transform` template, pass our transform values and\n // generated transformString to that before returning\n if (transformTemplate) {\n transformString = transformTemplate(transform, transformIsDefault ? \"\" : transformString);\n }\n else if (transformIsDefault) {\n transformString = \"none\";\n }\n return transformString;\n}\n\nexport { buildTransform };\n//# sourceMappingURL=build-transform.mjs.map\n","import { getValueAsType } from '../../../value/types/utils/get-as-type.mjs';\nimport { numberValueTypes } from '../../../value/types/maps/number.mjs';\nimport { transformProps } from '../../utils/keys-transform.mjs';\nimport { isCSSVariableName } from '../../../animation/utils/is-css-variable.mjs';\nimport { buildTransform } from './build-transform.mjs';\n\nfunction buildHTMLStyles(state, latestValues, transformTemplate) {\n const { style, vars, transformOrigin } = state;\n // Track whether we encounter any transform or transformOrigin values.\n let hasTransform = false;\n let hasTransformOrigin = false;\n /**\n * Loop over all our latest animated values and decide whether to handle them\n * as a style or CSS variable.\n *\n * Transforms and transform origins are kept separately for further processing.\n */\n for (const key in latestValues) {\n const value = latestValues[key];\n if (transformProps.has(key)) {\n // If this is a transform, flag to enable further transform processing\n hasTransform = true;\n continue;\n }\n else if (isCSSVariableName(key)) {\n vars[key] = value;\n continue;\n }\n else {\n // Convert the value to its default value type, ie 0 -> \"0px\"\n const valueAsType = getValueAsType(value, numberValueTypes[key]);\n if (key.startsWith(\"origin\")) {\n // If this is a transform origin, flag and enable further transform-origin processing\n hasTransformOrigin = true;\n transformOrigin[key] =\n valueAsType;\n }\n else {\n style[key] = valueAsType;\n }\n }\n }\n if (!latestValues.transform) {\n if (hasTransform || transformTemplate) {\n style.transform = buildTransform(latestValues, state.transform, transformTemplate);\n }\n else if (style.transform) {\n /**\n * If we have previously created a transform but currently don't have any,\n * reset transform style to none.\n */\n style.transform = \"none\";\n }\n }\n /**\n * Build a transformOrigin style. Uses the same defaults as the browser for\n * undefined origins.\n */\n if (hasTransformOrigin) {\n const { originX = \"50%\", originY = \"50%\", originZ = 0, } = transformOrigin;\n style.transformOrigin = `${originX} ${originY} ${originZ}`;\n }\n}\n\nexport { buildHTMLStyles };\n//# sourceMappingURL=build-styles.mjs.map\n","function renderHTML(element, { style, vars }, styleProp, projection) {\n const elementStyle = element.style;\n let key;\n for (key in style) {\n // CSSStyleDeclaration has [index: number]: string; in the types, so we use that as key type.\n elementStyle[key] = style[key];\n }\n // Write projection styles directly to element style\n projection?.applyProjectionStyles(elementStyle, styleProp);\n for (key in vars) {\n // Loop over any CSS variables and assign those.\n // They can only be assigned using `setProperty`.\n elementStyle.setProperty(key, vars[key]);\n }\n}\n\nexport { renderHTML };\n//# sourceMappingURL=render.mjs.map\n","import { px } from '../../value/types/numbers/units.mjs';\n\nfunction pixelsToPercent(pixels, axis) {\n if (axis.max === axis.min)\n return 0;\n return (pixels / (axis.max - axis.min)) * 100;\n}\n/**\n * We always correct borderRadius as a percentage rather than pixels to reduce paints.\n * For example, if you are projecting a box that is 100px wide with a 10px borderRadius\n * into a box that is 200px wide with a 20px borderRadius, that is actually a 10%\n * borderRadius in both states. If we animate between the two in pixels that will trigger\n * a paint each time. If we animate between the two in percentage we'll avoid a paint.\n */\nconst correctBorderRadius = {\n correct: (latest, node) => {\n if (!node.target)\n return latest;\n /**\n * If latest is a string, if it's a percentage we can return immediately as it's\n * going to be stretched appropriately. Otherwise, if it's a pixel, convert it to a number.\n */\n if (typeof latest === \"string\") {\n if (px.test(latest)) {\n latest = parseFloat(latest);\n }\n else {\n return latest;\n }\n }\n /**\n * If latest is a number, it's a pixel value. We use the current viewportBox to calculate that\n * pixel value as a percentage of each axis\n */\n const x = pixelsToPercent(latest, node.target.x);\n const y = pixelsToPercent(latest, node.target.y);\n return `${x}% ${y}%`;\n },\n};\n\nexport { correctBorderRadius, pixelsToPercent };\n//# sourceMappingURL=scale-border-radius.mjs.map\n","import { complex } from '../../value/types/complex/index.mjs';\nimport { mixNumber } from '../../utils/mix/number.mjs';\n\nconst correctBoxShadow = {\n correct: (latest, { treeScale, projectionDelta }) => {\n const original = latest;\n const shadow = complex.parse(latest);\n // TODO: Doesn't support multiple shadows\n if (shadow.length > 5)\n return original;\n const template = complex.createTransformer(latest);\n const offset = typeof shadow[0] !== \"number\" ? 1 : 0;\n // Calculate the overall context scale\n const xScale = projectionDelta.x.scale * treeScale.x;\n const yScale = projectionDelta.y.scale * treeScale.y;\n shadow[0 + offset] /= xScale;\n shadow[1 + offset] /= yScale;\n /**\n * Ideally we'd correct x and y scales individually, but because blur and\n * spread apply to both we have to take a scale average and apply that instead.\n * We could potentially improve the outcome of this by incorporating the ratio between\n * the two scales.\n */\n const averageScale = mixNumber(xScale, yScale, 0.5);\n // Blur\n if (typeof shadow[2 + offset] === \"number\")\n shadow[2 + offset] /= averageScale;\n // Spread\n if (typeof shadow[3 + offset] === \"number\")\n shadow[3 + offset] /= averageScale;\n return template(shadow);\n },\n};\n\nexport { correctBoxShadow };\n//# sourceMappingURL=scale-box-shadow.mjs.map\n","import { isCSSVariableName } from '../../animation/utils/is-css-variable.mjs';\nimport { cornerRadiusProps } from '../../utils/border-radius.mjs';\nimport { correctBorderRadius } from './scale-border-radius.mjs';\nimport { correctBoxShadow } from './scale-box-shadow.mjs';\n\nconst scaleCorrectors = {\n borderRadius: {\n ...correctBorderRadius,\n applyTo: [...cornerRadiusProps],\n },\n borderTopLeftRadius: correctBorderRadius,\n borderTopRightRadius: correctBorderRadius,\n borderBottomLeftRadius: correctBorderRadius,\n borderBottomRightRadius: correctBorderRadius,\n boxShadow: correctBoxShadow,\n};\nfunction addScaleCorrector(correctors) {\n for (const key in correctors) {\n scaleCorrectors[key] = correctors[key];\n if (isCSSVariableName(key)) {\n scaleCorrectors[key].isCSSVariable = true;\n }\n }\n}\n\nexport { addScaleCorrector, scaleCorrectors };\n//# sourceMappingURL=scale-correction.mjs.map\n","/**\n * The four corner-radius longhands. Shared so the projection mixer, scale\n * corrector, WAAPI px-value set and view-transition crop pass don't each carry\n * their own copy. Order is irrelevant - every consumer mixes/corrects/animates\n * each corner independently.\n */\nconst cornerRadiusProps = [\n \"borderTopLeftRadius\",\n \"borderTopRightRadius\",\n \"borderBottomRightRadius\",\n \"borderBottomLeftRadius\",\n];\n\nexport { cornerRadiusProps };\n//# sourceMappingURL=border-radius.mjs.map\n","import { transformProps } from './keys-transform.mjs';\nimport { scaleCorrectors } from '../../projection/styles/scale-correction.mjs';\nexport { addScaleCorrector } from '../../projection/styles/scale-correction.mjs';\n\nfunction isForcedMotionValue(key, { layout, layoutId }) {\n return (transformProps.has(key) ||\n key.startsWith(\"origin\") ||\n ((layout || layoutId !== undefined) &&\n (!!scaleCorrectors[key] || key === \"opacity\")));\n}\n\nexport { isForcedMotionValue, scaleCorrectors };\n//# sourceMappingURL=is-forced-motion-value.mjs.map\n","import { isMotionValue } from '../../../value/utils/is-motion-value.mjs';\nimport { isForcedMotionValue } from '../../utils/is-forced-motion-value.mjs';\n\nfunction scrapeMotionValuesFromProps(props, prevProps, visualElement) {\n const style = props.style;\n const prevStyle = prevProps?.style;\n const newValues = {};\n if (!style)\n return newValues;\n for (const key in style) {\n if (isMotionValue(style[key]) ||\n (prevStyle && isMotionValue(prevStyle[key])) ||\n isForcedMotionValue(key, props) ||\n visualElement?.getValue(key)?.liveStyle !== undefined) {\n newValues[key] = style[key];\n }\n }\n return newValues;\n}\n\nexport { scrapeMotionValuesFromProps };\n//# sourceMappingURL=scrape-motion-values.mjs.map\n","import { invariant } from 'motion-utils';\nimport { isCSSVariableName } from '../../animation/utils/is-css-variable.mjs';\nimport { transformProps } from '../utils/keys-transform.mjs';\nimport { defaultTransformValue, readTransformValue } from '../dom/parse-transform.mjs';\nimport { measureViewportBox } from '../../projection/utils/measure.mjs';\nimport { DOMVisualElement } from '../dom/DOMVisualElement.mjs';\nimport { buildHTMLStyles } from './utils/build-styles.mjs';\nimport { renderHTML } from './utils/render.mjs';\nimport { scrapeMotionValuesFromProps } from './utils/scrape-motion-values.mjs';\n\nfunction getComputedStyle(element) {\n return window.getComputedStyle(element);\n}\nclass HTMLVisualElement extends DOMVisualElement {\n constructor() {\n super(...arguments);\n this.type = \"html\";\n this.renderInstance = renderHTML;\n }\n mount(instance) {\n /**\n * If a custom component forwards its ref to something other than a\n * HTML/SVG element (a class instance, an imperative handle) there's\n * nothing for Motion to style, measure or attach gestures to. #2777\n */\n invariant(Boolean(instance.style), \"motion.create() components must forward their ref to a HTML or SVG element\", \"custom-component-ref\");\n super.mount(instance);\n }\n readValueFromInstance(instance, key) {\n if (transformProps.has(key)) {\n return this.projection?.isProjecting\n ? defaultTransformValue(key)\n : readTransformValue(instance, key);\n }\n else {\n const computedStyle = getComputedStyle(instance);\n const value = (isCSSVariableName(key)\n ? computedStyle.getPropertyValue(key)\n : computedStyle[key]) || 0;\n return typeof value === \"string\" ? value.trim() : value;\n }\n }\n measureInstanceViewportBox(instance, { transformPagePoint }) {\n return measureViewportBox(instance, transformPagePoint);\n }\n build(renderState, latestValues, props) {\n buildHTMLStyles(renderState, latestValues, props.transformTemplate);\n }\n scrapeMotionValuesFromProps(props, prevProps, visualElement) {\n return scrapeMotionValuesFromProps(props, prevProps, visualElement);\n }\n}\n\nexport { HTMLVisualElement, getComputedStyle };\n//# sourceMappingURL=HTMLVisualElement.mjs.map\n","import { convertBoundingBoxToBox, transformBoxPoints } from '../geometry/conversion.mjs';\nimport { translateAxis } from '../geometry/delta-apply.mjs';\n\nfunction measureViewportBox(instance, transformPoint) {\n return convertBoundingBoxToBox(transformBoxPoints(instance.getBoundingClientRect(), transformPoint));\n}\nfunction measurePageBox(element, rootProjectionNode, transformPagePoint) {\n const viewportBox = measureViewportBox(element, transformPagePoint);\n const { scroll } = rootProjectionNode;\n if (scroll) {\n translateAxis(viewportBox.x, scroll.offset.x);\n translateAxis(viewportBox.y, scroll.offset.y);\n }\n return viewportBox;\n}\n\nexport { measurePageBox, measureViewportBox };\n//# sourceMappingURL=measure.mjs.map\n","/**\n * Bounding boxes tend to be defined as top, left, right, bottom. For various operations\n * it's easier to consider each axis individually. This function returns a bounding box\n * as a map of single-axis min/max values.\n */\nfunction convertBoundingBoxToBox({ top, left, right, bottom, }) {\n return {\n x: { min: left, max: right },\n y: { min: top, max: bottom },\n };\n}\nfunction convertBoxToBoundingBox({ x, y }) {\n return { top: y.min, right: x.max, bottom: y.max, left: x.min };\n}\n/**\n * Applies a TransformPoint function to a bounding box. TransformPoint is usually a function\n * provided by Framer to allow measured points to be corrected for device scaling. This is used\n * when measuring DOM elements and DOM event points.\n */\nfunction transformBoxPoints(point, transformPoint) {\n if (!transformPoint)\n return point;\n const topLeft = transformPoint({ x: point.left, y: point.top });\n const bottomRight = transformPoint({ x: point.right, y: point.bottom });\n return {\n top: topLeft.y,\n left: topLeft.x,\n bottom: bottomRight.y,\n right: bottomRight.x,\n };\n}\n\nexport { convertBoundingBoxToBox, convertBoxToBoundingBox, transformBoxPoints };\n//# sourceMappingURL=conversion.mjs.map\n","import { createBox } from '../../projection/geometry/models.mjs';\nimport { VisualElement } from '../VisualElement.mjs';\n\nfunction isObjectKey(key, object) {\n return key in object;\n}\nclass ObjectVisualElement extends VisualElement {\n constructor() {\n super(...arguments);\n this.type = \"object\";\n }\n readValueFromInstance(instance, key) {\n if (isObjectKey(key, instance)) {\n const value = instance[key];\n if (typeof value === \"string\" || typeof value === \"number\") {\n return value;\n }\n }\n return undefined;\n }\n getBaseTargetFromProps() {\n return undefined;\n }\n removeValueFromRenderState(key, renderState) {\n delete renderState.output[key];\n }\n measureInstanceViewportBox() {\n return createBox();\n }\n build(renderState, latestValues) {\n Object.assign(renderState.output, latestValues);\n }\n renderInstance(instance, { output }) {\n Object.assign(instance, output);\n }\n sortInstanceNodePosition() {\n return 0;\n }\n}\n\nexport { ObjectVisualElement };\n//# sourceMappingURL=ObjectVisualElement.mjs.map\n","const dashKeys = {\n offset: \"stroke-dashoffset\",\n array: \"stroke-dasharray\",\n};\nconst camelKeys = {\n offset: \"strokeDashoffset\",\n array: \"strokeDasharray\",\n};\n/**\n * Build SVG path properties. Uses the path's measured length to convert\n * our custom pathLength, pathSpacing and pathOffset into stroke-dashoffset\n * and stroke-dasharray attributes.\n *\n * This function is mutative to reduce per-frame GC.\n *\n * Note: We use unitless values for stroke-dasharray and stroke-dashoffset\n * because Safari incorrectly scales px values when the page is zoomed.\n */\nfunction buildSVGPath(attrs, length, spacing = 1, offset = 0, useDashCase = true) {\n // Normalise path length by setting SVG attribute pathLength to 1\n attrs.pathLength = 1;\n // We use dash case when setting attributes directly to the DOM node and camel case\n // when defining props on a React component.\n const keys = useDashCase ? dashKeys : camelKeys;\n // Build the dash offset (unitless to avoid Safari zoom bug)\n attrs[keys.offset] = `${-offset}`;\n // Build the dash array (unitless to avoid Safari zoom bug)\n attrs[keys.array] = `${length} ${spacing}`;\n}\n\nexport { buildSVGPath };\n//# sourceMappingURL=path.mjs.map\n","import { buildHTMLStyles } from '../../html/utils/build-styles.mjs';\nimport { buildSVGPath } from './path.mjs';\n\nconst cssStyleProperties = [\n \"transform\",\n \"opacity\",\n \"offsetDistance\",\n \"offsetPath\",\n \"offsetRotate\",\n \"offsetAnchor\",\n];\n/**\n * Build SVG visual attributes, like cx and style.transform\n */\nfunction buildSVGAttrs(state, { attrX, attrY, attrScale, pathLength, pathSpacing = 1, pathOffset = 0, \n// This is object creation, which we try to avoid per-frame.\n...latest }, isSVGTag, transformTemplate, styleProp) {\n buildHTMLStyles(state, latest, transformTemplate);\n /**\n * For svg tags we just want to make sure viewBox is animatable and treat all the styles\n * as normal HTML tags.\n */\n if (isSVGTag) {\n if (state.style.viewBox) {\n state.attrs.viewBox = state.style.viewBox;\n }\n return;\n }\n state.attrs = state.style;\n state.style = {};\n const { attrs, style } = state;\n for (const key of cssStyleProperties) {\n if (attrs[key] !== undefined) {\n style[key] = attrs[key];\n delete attrs[key];\n }\n }\n if (style.transform || attrs.transformOrigin) {\n style.transformOrigin = attrs.transformOrigin ?? \"50% 50%\";\n delete attrs.transformOrigin;\n }\n if (style.transform) {\n /**\n * SVG's element transform-origin uses its own median as a reference.\n * Therefore, transformBox becomes a fill-box\n */\n style.transformBox = styleProp?.transformBox ?? \"fill-box\";\n delete attrs.transformBox;\n }\n // Render attrX/attrY/attrScale as attributes\n if (attrX !== undefined)\n attrs.x = attrX;\n if (attrY !== undefined)\n attrs.y = attrY;\n if (attrScale !== undefined)\n attrs.scale = attrScale;\n // Build SVG path if one has been defined\n if (pathLength !== undefined) {\n buildSVGPath(attrs, pathLength, pathSpacing, pathOffset, false);\n }\n}\n\nexport { buildSVGAttrs, cssStyleProperties };\n//# sourceMappingURL=build-attrs.mjs.map\n","/**\n * A set of attribute names that are always read/written as camel case.\n */\nconst camelCaseAttributes = new Set([\n \"baseFrequency\",\n \"diffuseConstant\",\n \"kernelMatrix\",\n \"kernelUnitLength\",\n \"keySplines\",\n \"keyTimes\",\n \"limitingConeAngle\",\n \"markerHeight\",\n \"markerWidth\",\n \"numOctaves\",\n \"targetX\",\n \"targetY\",\n \"surfaceScale\",\n \"specularConstant\",\n \"specularExponent\",\n \"stdDeviation\",\n \"tableValues\",\n \"viewBox\",\n \"gradientTransform\",\n \"pathLength\",\n \"startOffset\",\n \"textLength\",\n \"lengthAdjust\",\n]);\n\nexport { camelCaseAttributes };\n//# sourceMappingURL=camel-case-attrs.mjs.map\n","import { transformProps } from '../utils/keys-transform.mjs';\nimport { getDefaultValueType } from '../../value/types/maps/defaults.mjs';\nimport { createBox } from '../../projection/geometry/models.mjs';\nimport { DOMVisualElement } from '../dom/DOMVisualElement.mjs';\nimport { camelToDash } from '../dom/utils/camel-to-dash.mjs';\nimport { cssStyleProperties, buildSVGAttrs } from './utils/build-attrs.mjs';\nimport { camelCaseAttributes } from './utils/camel-case-attrs.mjs';\nimport { isSVGTag } from './utils/is-svg-tag.mjs';\nimport { renderSVG } from './utils/render.mjs';\nimport { scrapeMotionValuesFromProps } from './utils/scrape-motion-values.mjs';\n\nclass SVGVisualElement extends DOMVisualElement {\n constructor() {\n super(...arguments);\n this.type = \"svg\";\n this.isSVGTag = false;\n this.measureInstanceViewportBox = createBox;\n }\n getBaseTargetFromProps(props, key) {\n return props[key];\n }\n readValueFromInstance(instance, key) {\n if (transformProps.has(key)) {\n const defaultType = getDefaultValueType(key);\n return defaultType ? defaultType.default || 0 : 0;\n }\n if (cssStyleProperties.includes(key)) {\n const computedStyle = getComputedStyle(instance);\n const value = computedStyle[key];\n if (typeof value === \"string\" && value)\n return value.trim();\n }\n key = !camelCaseAttributes.has(key) ? camelToDash(key) : key;\n return instance.getAttribute(key);\n }\n scrapeMotionValuesFromProps(props, prevProps, visualElement) {\n return scrapeMotionValuesFromProps(props, prevProps, visualElement);\n }\n build(renderState, latestValues, props) {\n buildSVGAttrs(renderState, latestValues, this.isSVGTag, props.transformTemplate, props.style);\n }\n renderInstance(instance, renderState, styleProp, projection) {\n renderSVG(instance, renderState, styleProp, projection);\n }\n mount(instance) {\n this.isSVGTag = isSVGTag(instance.tagName);\n super.mount(instance);\n }\n}\n\nexport { SVGVisualElement };\n//# sourceMappingURL=SVGVisualElement.mjs.map\n","import { isMotionValue } from '../../../value/utils/is-motion-value.mjs';\nimport { transformPropOrder } from '../../utils/keys-transform.mjs';\nimport { scrapeMotionValuesFromProps as scrapeMotionValuesFromProps$1 } from '../../html/utils/scrape-motion-values.mjs';\n\nfunction scrapeMotionValuesFromProps(props, prevProps, visualElement) {\n const newValues = scrapeMotionValuesFromProps$1(props, prevProps, visualElement);\n for (const key in props) {\n if (isMotionValue(props[key]) ||\n isMotionValue(prevProps[key])) {\n const targetKey = transformPropOrder.indexOf(key) !== -1\n ? \"attr\" + key.charAt(0).toUpperCase() + key.substring(1)\n : key;\n newValues[targetKey] = props[key];\n }\n }\n return newValues;\n}\n\nexport { scrapeMotionValuesFromProps };\n//# sourceMappingURL=scrape-motion-values.mjs.map\n","import { camelToDash } from '../../dom/utils/camel-to-dash.mjs';\nimport { renderHTML } from '../../html/utils/render.mjs';\nimport { camelCaseAttributes } from './camel-case-attrs.mjs';\n\nfunction renderSVG(element, renderState, _styleProp, projection) {\n renderHTML(element, renderState, undefined, projection);\n for (const key in renderState.attrs) {\n element.setAttribute(!camelCaseAttributes.has(key) ? camelToDash(key) : key, renderState.attrs[key]);\n }\n}\n\nexport { renderSVG };\n//# sourceMappingURL=render.mjs.map\n","const isSVGTag = (tag) => typeof tag === \"string\" && tag.toLowerCase() === \"svg\";\n\nexport { isSVGTag };\n//# sourceMappingURL=is-svg-tag.mjs.map\n","export function isDOMKeyframes(keyframes) {\n return typeof keyframes === \"object\" && !Array.isArray(keyframes);\n}\n//# sourceMappingURL=is-dom-keyframes.js.map","import { resolveElements, } from \"motion-dom\";\nimport { isDOMKeyframes } from \"../utils/is-dom-keyframes\";\nexport function resolveSubjects(subject, keyframes, scope, selectorCache) {\n if (subject == null) {\n return [];\n }\n if (typeof subject === \"string\" && isDOMKeyframes(keyframes)) {\n return resolveElements(subject, scope, selectorCache);\n }\n else if (subject instanceof NodeList) {\n return Array.from(subject);\n }\n else if (Array.isArray(subject)) {\n return subject.filter((s) => s != null);\n }\n else {\n return [subject];\n }\n}\n//# sourceMappingURL=resolve-subjects.js.map","function resolveElements(elementOrSelector, scope, selectorCache) {\n if (elementOrSelector == null) {\n return [];\n }\n if (elementOrSelector instanceof EventTarget) {\n return [elementOrSelector];\n }\n else if (typeof elementOrSelector === \"string\") {\n let root = document;\n if (scope) {\n root = scope.current;\n }\n const elements = selectorCache?.[elementOrSelector] ??\n root.querySelectorAll(elementOrSelector);\n return elements ? Array.from(elements) : [];\n }\n return Array.from(elementOrSelector).filter((element) => element != null);\n}\n\nexport { resolveElements };\n//# sourceMappingURL=resolve-elements.mjs.map\n","export function calculateRepeatDuration(duration, repeat, repeatDelay) {\n return duration * (repeat + 1) + repeatDelay * repeat;\n}\n//# sourceMappingURL=calc-repeat-duration.js.map","/**\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(current, next, prev, labels) {\n if (typeof next === \"number\") {\n return next;\n }\n else if (next.startsWith(\"-\") || next.startsWith(\"+\")) {\n return Math.max(0, current + parseFloat(next));\n }\n else if (next === \"<\") {\n return prev;\n }\n else if (next.startsWith(\"<\")) {\n return Math.max(0, prev + parseFloat(next.slice(1)));\n }\n else {\n return labels.get(next) ?? current;\n }\n}\n//# sourceMappingURL=calc-time.js.map","import { mixNumber } from \"motion-dom\";\nimport { getEasingForSegment, removeItem } from \"motion-utils\";\nexport function eraseKeyframes(sequence, startTime, endTime) {\n for (let i = 0; i < sequence.length; i++) {\n const keyframe = sequence[i];\n if (keyframe.at > startTime && keyframe.at < endTime) {\n removeItem(sequence, keyframe);\n // If we remove this item we have to push the pointer back one\n i--;\n }\n }\n}\nexport function addKeyframes(sequence, keyframes, easing, offset, startTime, endTime) {\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 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//# sourceMappingURL=edit.js.map","/**\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(times, repeat, repeatDelayUnits = 0) {\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//# sourceMappingURL=normalize-times.js.map","export function compareByTime(a, b) {\n if (a.at === b.at) {\n if (a.value === null)\n return 1;\n if (b.value === null)\n return -1;\n return 0;\n }\n else {\n return a.at - b.at;\n }\n}\n//# sourceMappingURL=sort.js.map","import { createGeneratorEasing, defaultOffset, fillOffset, isGenerator, isMotionValue, } from \"motion-dom\";\nimport { getEasingForSegment, progress, reverseEasing, secondsToMilliseconds, warning, } from \"motion-utils\";\nimport { resolveSubjects } from \"../animate/resolve-subjects\";\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\";\nconst defaultSegmentEasing = \"easeInOut\";\nconst MAX_REPEAT = 20;\nexport function createAnimationsFromSequence(sequence, { defaultTransition = {}, ...sequenceTransition } = {}, scope, generators) {\n const defaultDuration = defaultTransition.duration || 0.3;\n const animationDefinitions = new Map();\n const sequences = new Map();\n const elementCache = {};\n const timeLabels = new Map();\n let prevTime = 0;\n let currentTime = 0;\n let totalDuration = 0;\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 * 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 }\n else if (!Array.isArray(segment)) {\n timeLabels.set(segment.name, calcNextTime(currentTime, segment.at, prevTime, timeLabels));\n continue;\n }\n let [subject, keyframes, transition = {}] = segment;\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(currentTime, transition.at, prevTime, timeLabels);\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 const resolveValueSequence = (valueKeyframes, valueTransition, valueSequence, elementIndex = 0, numSubjects = 0) => {\n const valueKeyframesAsList = keyframesAsList(valueKeyframes);\n const { delay = 0, times = defaultOffset(valueKeyframesAsList), type = defaultTransition.type || \"keyframes\", repeat, repeatType, repeatDelay = 0, ...remainingTransition } = valueTransition;\n let { ease = defaultTransition.ease || \"easeOut\", duration } = valueTransition;\n /**\n * Resolve stagger() if defined.\n */\n const calculatedDelay = typeof delay === \"function\"\n ? delay(elementIndex, numSubjects)\n : delay;\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 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 (numKeyframes === 2 &&\n isNumberKeyframesArray(valueKeyframesAsList)) {\n const delta = valueKeyframesAsList[1] - valueKeyframesAsList[0];\n absoluteDelta = Math.abs(delta);\n }\n const springTransition = {\n ...defaultTransition,\n ...remainingTransition,\n };\n if (duration !== undefined) {\n springTransition.duration = secondsToMilliseconds(duration);\n }\n const springEasing = createGeneratorEasing(springTransition, absoluteDelta, createGenerator);\n ease = springEasing.ease;\n duration = springEasing.duration;\n }\n duration ?? (duration = defaultDuration);\n const startTime = currentTime + calculatedDelay;\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 * 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 * 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 * 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(repeat < MAX_REPEAT, `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 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 = duration > 0 ? repeatDelay / duration : 0;\n duration = calculateRepeatDuration(duration, repeat, repeatDelay);\n const originalKeyframes = [...valueKeyframesAsList];\n const originalTimes = [...times];\n ease = Array.isArray(ease) ? [...ease] : [ease];\n const originalEase = [...ease];\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 = 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) => typeof e === \"function\"\n ? reverseEasing(e)\n : e);\n }\n }\n for (let repeatIndex = 0; repeatIndex < repeat; repeatIndex++) {\n const isFlipped = isFlipping && repeatIndex % 2 === 0;\n const iterKeyframes = isFlipped\n ? flippedKeyframes\n : originalKeyframes;\n const iterEase = isFlipped ? flippedEases : originalEase;\n const iterStartOffset = (repeatIndex + 1) * (1 + repeatDelayUnits);\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(valueKeyframesAsList[valueKeyframesAsList.length - 1]);\n times.push(iterStartOffset);\n ease.push(\"linear\");\n }\n valueKeyframesAsList.push(...iterKeyframes);\n for (let keyframeIndex = 0; keyframeIndex < iterKeyframes.length; keyframeIndex++) {\n times.push(originalTimes[keyframeIndex] + iterStartOffset);\n ease.push(keyframeIndex === 0\n ? \"linear\"\n : getEasingForSegment(iterEase, keyframeIndex - 1));\n }\n }\n normalizeTimes(times, repeat, repeatDelayUnits);\n }\n const targetTime = startTime + duration;\n /**\n * Add keyframes, mapping offsets to absolute time.\n */\n addKeyframes(valueSequence, valueKeyframesAsList, ease, times, startTime, targetTime);\n maxDuration = Math.max(calculatedDelay + duration, maxDuration);\n totalDuration = Math.max(targetTime, totalDuration);\n };\n if (isMotionValue(subject)) {\n const subjectSequence = getSubjectSequence(subject, sequences);\n resolveValueSequence(keyframes, transition, getValueSequence(\"default\", subjectSequence));\n }\n else {\n const subjects = resolveSubjects(subject, keyframes, scope, elementCache);\n const numSubjects = subjects.length;\n /**\n * For every element in this segment, process the defined values.\n */\n for (let subjectIndex = 0; subjectIndex < numSubjects; subjectIndex++) {\n /**\n * Cast necessary, but we know these are of this type\n */\n keyframes = keyframes;\n transition = transition;\n const thisSubject = subjects[subjectIndex];\n const subjectSequence = getSubjectSequence(thisSubject, sequences);\n for (const key in keyframes) {\n resolveValueSequence(keyframes[key], getValueTransition(transition, key), getValueSequence(key, subjectSequence), subjectIndex, numSubjects);\n }\n }\n }\n prevTime = currentTime;\n currentTime += maxDuration;\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 * Arrange all the keyframes in ascending time order.\n */\n valueSequence.sort(compareByTime);\n const keyframes = [];\n const valueOffset = [];\n const valueEasing = [];\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 * 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 * 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 if (!animationDefinitions.has(element)) {\n animationDefinitions.set(element, {\n keyframes: {},\n transition: {},\n });\n }\n const definition = animationDefinitions.get(element);\n definition.keyframes[key] = keyframes;\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 } = defaultTransition;\n definition.transition[key] = {\n ...remainingDefaultTransition,\n duration: totalDuration,\n ease: valueEasing,\n times: valueOffset,\n ...sequenceTransition,\n };\n }\n });\n return animationDefinitions;\n}\nfunction getSubjectSequence(subject, sequences) {\n !sequences.has(subject) && sequences.set(subject, {});\n return sequences.get(subject);\n}\nfunction getValueSequence(name, sequences) {\n if (!sequences[name])\n sequences[name] = [];\n return sequences[name];\n}\nfunction keyframesAsList(keyframes) {\n return Array.isArray(keyframes) ? keyframes : [keyframes];\n}\nexport function getValueTransition(transition, key) {\n return transition && transition[key]\n ? {\n ...transition,\n ...transition[key],\n }\n : { ...transition };\n}\nconst isNumber = (keyframe) => typeof keyframe === \"number\";\nconst isNumberKeyframesArray = (keyframes) => keyframes.every(isNumber);\n//# sourceMappingURL=create.js.map","import { HTMLVisualElement, isSVGElement, isSVGSVGElement, ObjectVisualElement, SVGVisualElement, visualElementStore, } from \"motion-dom\";\nexport function createDOMVisualElement(element) {\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 = isSVGElement(element) && !isSVGSVGElement(element)\n ? new SVGVisualElement(options)\n : new HTMLVisualElement(options);\n node.mount(element);\n visualElementStore.set(element, node);\n}\nexport function createObjectVisualElement(subject) {\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 node.mount(subject);\n visualElementStore.set(subject, node);\n}\n//# sourceMappingURL=create-visual-element.js.map","import { isSVGElement } from './is-svg-element.mjs';\n\n/**\n * Checks if an element is specifically an SVGSVGElement (the root SVG element)\n * in a way that works across iframes\n */\nfunction isSVGSVGElement(element) {\n return isSVGElement(element) && element.tagName === \"svg\";\n}\n\nexport { isSVGSVGElement };\n//# sourceMappingURL=is-svg-svg-element.mjs.map\n","import { animateTarget, isMotionValue, visualElementStore, } from \"motion-dom\";\nimport { invariant } from \"motion-utils\";\nimport { createDOMVisualElement, createObjectVisualElement, } from \"../utils/create-visual-element\";\nimport { isDOMKeyframes } from \"../utils/is-dom-keyframes\";\nimport { resolveSubjects } from \"./resolve-subjects\";\nimport { animateSingleValue } from \"motion-dom\";\nfunction isSingleValue(subject, keyframes) {\n return (isMotionValue(subject) ||\n typeof subject === \"number\" ||\n (typeof subject === \"string\" && !isDOMKeyframes(keyframes)));\n}\n/**\n * Implementation\n */\nexport function animateSubject(subject, keyframes, options, scope) {\n const animations = [];\n if (isSingleValue(subject, keyframes)) {\n animations.push(animateSingleValue(subject, isDOMKeyframes(keyframes)\n ? keyframes.default || keyframes\n : keyframes, options ? options.default || options : options));\n }\n else {\n // Gracefully handle null/undefined subjects (e.g., from querySelector returning null)\n if (subject == null) {\n return animations;\n }\n const subjects = resolveSubjects(subject, keyframes, scope);\n const numSubjects = subjects.length;\n invariant(Boolean(numSubjects), \"No valid elements provided.\", \"no-valid-elements\");\n for (let i = 0; i < numSubjects; i++) {\n const thisSubject = subjects[i];\n const createVisualElement = thisSubject instanceof Element\n ? createDOMVisualElement\n : createObjectVisualElement;\n if (!visualElementStore.has(thisSubject)) {\n createVisualElement(thisSubject);\n }\n const visualElement = visualElementStore.get(thisSubject);\n const transition = { ...options };\n /**\n * Resolve stagger function if provided.\n */\n if (\"delay\" in transition &&\n typeof transition.delay === \"function\") {\n transition.delay = transition.delay(i, numSubjects);\n }\n animations.push(...animateTarget(visualElement, { ...keyframes, transition }, {}));\n }\n }\n return animations;\n}\n//# sourceMappingURL=subject.js.map","import { animateMotionValue } from '../interfaces/motion-value.mjs';\nimport { motionValue } from '../../value/index.mjs';\nimport { isMotionValue } from '../../value/utils/is-motion-value.mjs';\n\nfunction animateSingleValue(value, keyframes, options) {\n const motionValue$1 = isMotionValue(value) ? value : motionValue(value);\n motionValue$1.start(animateMotionValue(\"\", motionValue$1, keyframes, options));\n return motionValue$1.animation;\n}\n\nexport { animateSingleValue };\n//# sourceMappingURL=single-value.mjs.map\n","import { motionValue, spring, } from \"motion-dom\";\nimport { createAnimationsFromSequence } from \"../sequence/create\";\nimport { animateSubject } from \"./subject\";\nexport function animateSequence(sequence, options, scope) {\n const animations = [];\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];\n const mv = motionValue(0);\n mv.on(\"change\", callback);\n if (segment.length === 1) {\n return [mv, [0, 1]];\n }\n else if (segment.length === 2) {\n return [mv, [0, 1], segment[1]];\n }\n else {\n return [mv, segment[1], segment[2]];\n }\n }\n return segment;\n });\n const animationDefinitions = createAnimationsFromSequence(processedSequence, options, scope, { spring });\n animationDefinitions.forEach(({ keyframes, transition }, subject) => {\n animations.push(...animateSubject(subject, keyframes, transition));\n });\n return animations;\n}\n//# sourceMappingURL=sequence.js.map","import { GroupAnimationWithThen } from \"motion-dom\";\nimport { removeItem } from \"motion-utils\";\nimport { animateSequence } from \"./sequence\";\nimport { animateSubject } from \"./subject\";\nfunction isSequence(value) {\n return Array.isArray(value) && value.some(Array.isArray);\n}\n/**\n * Creates an animation function that is optionally scoped\n * to a specific element.\n */\nexport function createScopedAnimate(options = {}) {\n const { scope, reduceMotion, skipAnimations } = options;\n /**\n * Implementation\n */\n function scopedAnimate(subjectOrSequence, optionsOrKeyframes, options) {\n let animations = [];\n let animationOnComplete;\n const inherited = {};\n if (reduceMotion !== undefined)\n inherited.reduceMotion = reduceMotion;\n if (skipAnimations !== undefined)\n inherited.skipAnimations = skipAnimations;\n if (isSequence(subjectOrSequence)) {\n const { onComplete, ...sequenceOptions } = optionsOrKeyframes || {};\n if (typeof onComplete === \"function\") {\n animationOnComplete = onComplete;\n }\n animations = animateSequence(subjectOrSequence, { ...inherited, ...sequenceOptions }, 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;\n }\n animations = animateSubject(subjectOrSequence, optionsOrKeyframes, { ...inherited, ...rest }, scope);\n }\n const animation = new GroupAnimationWithThen(animations);\n if (animationOnComplete) {\n animation.finished.then(animationOnComplete);\n }\n if (scope) {\n scope.animations.push(animation);\n animation.finished.then(() => {\n removeItem(scope.animations, animation);\n });\n }\n return animation;\n }\n return scopedAnimate;\n}\nexport const animate = createScopedAnimate();\n//# sourceMappingURL=index.js.map"],"names":["removeItem","arr","item","index","indexOf","splice","clamp","min","max","v","formatErrorMessage","message","errorCode","warning","invariant","process","env","NODE_ENV","check","console","warn","Error","MotionGlobalConfig","isNumericalString","test","isZeroValueString","memo","callback","result","undefined","noop","any","pipe","transformers","reduce","a","b","progress","from","to","value","range","SubscriptionManager","constructor","this","subscriptions","add","handler","push","notify","c","numSubscriptions","length","i","getSize","clear","secondsToMilliseconds","seconds","millisecondsToSeconds","milliseconds","velocityPerSecond","velocity","frameDuration","calcBezier","t","a1","a2","cubicBezier","mX1","mY1","mX2","mY2","getTForX","aX","x","lowerBound","upperBound","currentX","currentT","Math","abs","binarySubdivide","mirrorEasing","easing","p","reverseEasing","backOut","backIn","backInOut","anticipate","pow","circIn","sin","acos","circOut","circInOut","easeIn","easeOut","easeInOut","isEasingArray","ease","Array","isArray","getEasingForSegment","rangeSize","wrap","isBezierDefinition","easingLookup","linear","easingDefinitionToFunction","definition","x1","y1","x2","y2","stepsOrder","createRenderBatcher","scheduleNextBatch","allowKeepAlive","runNextFrame","useDefaultElapsed","state","delta","timestamp","isProcessing","flagRunNextFrame","steps","acc","key","thisFrame","Set","nextFrame","flushNextFrame","toKeepAlive","WeakSet","latestFrameData","triggerCallback","has","step","schedule","keepAlive","immediate","queue","cancel","delete","frameData","prevFrame","forEach","createRenderStep","setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender","processBatch","useManualTiming","performance","now","frame","cancelFrame","requestAnimationFrame","clearTime","time","set","newTime","queueMicrotask","checkStringStartsWith","token","startsWith","isCSSVariableName","startsAsVariableToken","isCSSVariableToken","singleCssVariableRegex","split","trim","containsCSSVariable","includes","number","parse","parseFloat","transform","alpha","scale","default","sanitize","round","floatRegex","singleColorRegex","isColorString","type","testProp","Boolean","isNullish","Object","prototype","hasOwnProperty","call","splitColor","aName","bName","cName","match","rgbUnit","clampRgbUnit","rgba","red","green","blue","alpha$1","hex","r","g","substring","parseInt","createUnitType","unit","endsWith","degrees","percent","px","vh","vw","progressPercentage","hsla","hue","saturation","lightness","color","getAnimatableNone","parsed","colorRegex","NUMBER_TOKEN","COLOR_TOKEN","complexRegex","analyseComplexValue","originalValue","toString","values","indexes","var","types","replace","parsedValue","buildTransformer","numSections","output","convertToZero","splitBefore","complex","isNaN","createTransformer","source","info","transformer","map","hueToRgb","q","mixImmediate","mixNumber","mixLinearColor","fromExpo","expo","sqrt","colorTypes","asRGBA","find","model","hslaToRgba","mixColor","fromRGBA","toRGBA","blended","invisibleValues","mixNumber$1","getMixer","mixComplex","mixArray","mixObject","numValues","blendValue","origin","target","template","originStats","targetStats","mixVisibility","orderedOrigin","pointers","originIndex","originValue","matchOrder","mix","mixer","frameloopDriver","passTimestamp","start","stop","generateLinearEasing","duration","resolution","points","numPoints","maxGeneratorDuration","calcGeneratorDuration","generator","next","done","Infinity","createGeneratorEasing","options","createGenerator","keyframes","springDefaults","granular","calcAngularFreq","undampedFreq","dampingRatio","safeMin","durationKeys","physicsKeys","isSpringType","keys","some","getSpringOptions","springOptions","stiffness","damping","mass","isResolvedFromDuration","visualDuration","root","PI","bounce","derived","envelope","derivative","exponentialDecay","exp","d","e","f","initialGuess","approximateRoot","findSpring","spring","optionsOrVisualDuration","restSpeed","restDelta","initialVelocity","initialDelta","undampedAngularFreq","isGranularScale","resolveSpring","resolveVelocity","angularFreq","A","sinCoeff","cosCoeff","cos","C","dampedAngularFreq","freqForT","sinh","cosh","P","sinhCoeff","coshCoeff","calculatedDuration","current","currentVelocity","toTransition","applyToOptions","generatorOptions","getGeneratorVelocity","resolveValue","prevT","inertia","power","timeConstant","bounceDamping","bounceStiffness","modifyTarget","nearestBoundary","amplitude","ideal","calcDelta","calcLatest","applyFriction","latest","timeReachedBoundary","spring$1","checkCatchBoundary","hasUpdatedFrame","interpolate","input","isClamp","inputLength","isZeroDeltaRange","reverse","mixers","customMixer","mixerFactory","numMixers","easingFunction","createMixers","interpolator","progressInRange","fillOffset","offset","remaining","offsetProgress","defaultOffset","keyframeValues","times","easingFunctions","absoluteTimes","o","convertOffsetToTimes","mapTimeToKeyframe","isNotNull","getFinalKeyframe","repeat","repeatType","finalKeyframe","speed","resolvedKeyframes","filter","transitionTypeMap","decay","tween","replaceTransitionType","transition","WithPromise","updateFinished","finished","_finished","Promise","resolve","notifyFinished","then","onResolve","onReject","percentToProgress","JSAnimation","super","startTime","isStopped","currentTime","holdTime","playbackSpeed","delayState","motionValue","updatedAt","tick","teardown","onStop","initAnimation","play","autoplay","pause","repeatDelay","keyframes$1","generatorFactory","mixKeyframes","mirroredGenerator","resolvedDuration","totalDuration","updateTime","animationTime","sample","delay","onUpdate","timeWithoutDelay","isInDelayPhase","elapsed","frameGenerator","currentIteration","floor","iterationProgress","isAnimationFinished","finish","reject","iterationDuration","driver","s","newSpeed","hasChanged","onPlay","complete","onComplete","onCancel","stopDriver","sampleTime","attachTimeline","timeline","allowFlatten","observe","radToDeg","rad","rotate","angle","atan2","rebaseAngle","matrix2dParsers","y","translateX","translateY","scaleX","scaleY","rotateZ","skewX","atan","skewY","skew","matrix3dParsers","z","translateZ","rotateX","rotateY","defaultTransformValue","name","parseValueFromTransform","matrix3dMatch","parsers","matrix2dMatch","valueParser","convertTransformToNumber","transformPropOrder","transformProps","isNumOrPxType","transformKeys","nonTranslationalTransformKeys","positionalValues","width","paddingLeft","paddingRight","boxSizing","height","paddingTop","paddingBottom","top","_bbox","left","bottom","right","toResolve","isScheduled","anyNeedsMeasurement","isForced","measureAllKeyframes","resolversToMeasure","resolver","needsMeasurement","elementsToMeasure","element","transformsToRestore","Map","removedTransforms","visualElement","getValue","get","removeNonTranslationalTransform","measureInitialState","restore","measureEndState","suspendedScrollY","window","scrollTo","readAllKeyframes","readKeyframes","KeyframeResolver","unresolvedKeyframes","isAsync","scheduleResolve","currentValue","valueAsRead","readValue","fillWildcards","setFinalKeyframe","renderEndStyles","isForcedComplete","resume","setStyle","isCSSVar","style","setProperty","supportsFlags","memoSupports","supportsFlag","memoized","supportsScrollTimeline","ScrollTimeline","supportsLinearEasing","document","createElement","animate","opacity","cubicBezierAsString","supportedWaapiEasing","mapEasingToNativeEasing","segmentEasing","startWaapiAnimation","valueName","pseudoElement","keyframeOptions","fill","iterations","direction","isGenerator","NativeAnimation","finishedTime","manualStartTime","isPseudoElement","applyGeneratorOptions","animation","onfinish","keyframe","updateMotionValue","commitStyles","isConnected","effect","getComputedTiming","Number","wasFinished","playbackRate","playState","newStartTime","rangeStart","rangeEnd","updateTiming","unsupportedEasingFunctions","replaceStringEasing","NativeAnimationExtended","sampleAnimation","setWithVelocity","isAnimatable","makeAnimationInstant","acceleratedValues","browserColorFunctions","colorProperties","supportsWaapi","Element","supportsBrowserAnimation","subject","owner","HTMLElement","SVGElement","transformTemplate","getProps","hasBrowserOnlyColors","AsyncMotionValueAnimation","_animation","stopTimeline","keyframeResolver","createdAt","optionsWithDefaults","KeyframeResolver$1","forced","onKeyframesResolved","sync","isHandoff","resolvedAt","canAnimateValue","originKeyframe","targetKeyframe","isOriginAnimatable","isTargetAnimatable","hasKeyframesChanged","canAnimate","instantAnimations","resolvedOptions","useWaapi","catch","pendingTimeline","_onReject","finally","GroupAnimation","animations","runAll","all","getAll","propName","setAll","newValue","getMax","methodName","controls","GroupAnimationWithThen","MotionValue","init","canTrackVelocity","events","updateAndNotify","setPrevFrameValue","prev","setCurrent","change","dependents","dependent","dirty","hasAnimated","prevFrameValue","prevUpdatedAt","onChange","subscription","on","eventName","unsubscribe","clearListeners","eventManagers","attach","passiveEffect","stopPassiveEffect","jump","endAnimation","addDependent","removeDependent","getPrevious","getVelocity","startAnimation","animationStart","animationComplete","clearAnimation","animationCancel","isAnimating","destroy","resolveTransition","parentTransition","inherit","_","rest","getValueTransition","valueTransition","underDampedSpring","keyframesTransition","getDefaultTransition","valueKey","orchestrationKeys","animateMotionValue","isTransitionDefined","assign","shouldSkip","skipAnimations","shouldSkipAnimations","isSync","splitCSSVariableRegex","getVariableValue","depth","fallback","exec","token1","token2","parseCSSVariable","resolved","getComputedStyle","getPropertyValue","trimmed","getValueState","resolveVariantFromProps","props","custom","variants","positionalKeys","setMotionValue","hasValue","addValue","resolveFinalValueInKeyframes","isKeyframesTarget","setTarget","resolveVariant","transitionEnd","isMotionValue","addValueToWillChange","willChange","WillChange","newWillChange","camelToDash","str","toLowerCase","optimizedAppearDataAttribute","getOptimisedAppearId","shouldBlockAnimation","protectedKeys","needsAnimating","shouldBlock","animateTarget","targetAndTransition","transitionOverride","defaultTransition","reduceMotion","animationTypeState","animationState","getState","path","animateVisualElement","latestValues","valueTarget","MotionHandoffAnimation","appearId","shouldReduceMotion","applyTransitionEnd","testValueType","dimensionValueTypes","findDimensionValueType","isNone","maxDefaults","applyDefaultFilter","slice","defaultValue","functionRegex","functions","join","mask","int","numberValueTypes","borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","maxWidth","maxHeight","inset","insetBlock","insetBlockStart","insetBlockEnd","insetInline","insetInlineStart","insetInlineEnd","padding","paddingBlock","paddingBlockStart","paddingBlockEnd","paddingInline","paddingInlineStart","paddingInlineEnd","margin","marginTop","marginRight","marginBottom","marginLeft","marginBlock","marginBlockStart","marginBlockEnd","marginInline","marginInlineStart","marginInlineEnd","fontSize","backgroundPositionX","backgroundPositionY","pathRotation","scaleZ","distance","perspective","transformPerspective","originX","originY","originZ","zIndex","fillOpacity","strokeOpacity","numOctaves","defaultValueTypes","backgroundColor","outlineColor","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","WebkitFilter","WebkitMask","getDefaultValueType","customTypes","defaultValueType","invalidTemplates","DOMKeyframesResolver","resolveNoneKeyframes","originType","targetType","noneKeyframeIndexes","animatableTemplate","noneIndex","makeNoneKeyframesAnimatable","pageYOffset","measuredOrigin","measureViewportBox","measureKeyframe","finalKeyframeIndex","unsetTransformName","unsetTransformValue","getValueAsType","microtask","isSVGElement","valueTypes","createBox","visualElementStore","WeakMap","variantProps","isControllingVariants","isVariantLabel","prefersReducedMotion","hasReducedMotionListener","isBrowser","propEventHandlers","featureDefinitions","VisualElement","scrapeMotionValuesFromProps","_props","_prevProps","_visualElement","parent","presenceContext","reducedMotionConfig","blockInitialAnimation","visualState","children","isVariantNode","features","valueSubscriptions","prevMotionValues","hasBeenMounted","propEventSubscriptions","notifyUpdate","triggerBuild","renderInstance","renderState","projection","renderScheduledAt","scheduleRender","baseTarget","initialValues","initial","skipAnimationsConfig","variantChildren","manuallyAnimateOnMount","initialMotionValues","mount","instance","removeFromVariantTree","addVariantChild","bindToMotionValue","matchMedia","motionMediaQuery","setReducedMotionPreferences","matches","addEventListener","initPrefersReducedMotion","addChild","unmount","remove","removeChild","feature","isMounted","child","enteringChildren","accelerate","factory","cleanup","valueIsTransform","onBindTransform","removeOnChange","latestValue","isTransformDirty","removeSyncCheck","MotionCheckAppearSync","sortNodePosition","other","sortInstanceNodePosition","updateFeatures","featureDefinition","isEnabled","Feature","FeatureConstructor","build","measureInstanceViewportBox","getStaticValue","setStaticValue","prevProps","prevPresenceContext","listener","nextValue","prevValue","existingValue","liveStyle","removeValue","updateMotionValuesFromProps","handleChildMotionValue","getVariant","getTransformPagePoint","transformPagePoint","getClosestVariantNode","closestVariantNode","removeValueFromRenderState","getBaseTargetFromProps","readValueFromInstance","setBaseTarget","getBaseTarget","valueFromInitial","variant","args","scheduleRenderMicrotask","DOMVisualElement","arguments","compareDocumentPosition","vars","childSubscription","textContent","translateAlias","numTransforms","buildHTMLStyles","transformOrigin","hasTransform","hasTransformOrigin","valueAsType","transformString","transformIsDefault","valueIsDefault","buildTransform","renderHTML","styleProp","elementStyle","applyProjectionStyles","pixelsToPercent","pixels","axis","correctBorderRadius","correct","node","correctBoxShadow","treeScale","projectionDelta","original","shadow","xScale","yScale","averageScale","scaleCorrectors","applyTo","boxShadow","isForcedMotionValue","layout","layoutId","prevStyle","newValues","HTMLVisualElement","isProjecting","readTransformValue","computedStyle","transformPoint","convertBoundingBoxToBox","point","topLeft","bottomRight","transformBoxPoints","getBoundingClientRect","ObjectVisualElement","object","isObjectKey","dashKeys","array","camelKeys","cssStyleProperties","buildSVGAttrs","attrX","attrY","attrScale","pathLength","pathSpacing","pathOffset","isSVGTag","viewBox","attrs","transformBox","spacing","useDashCase","buildSVGPath","camelCaseAttributes","SVGVisualElement","defaultType","getAttribute","scrapeMotionValuesFromProps$1","charAt","toUpperCase","_styleProp","setAttribute","renderSVG","tag","tagName","isDOMKeyframes","resolveSubjects","scope","selectorCache","elementOrSelector","EventTarget","elements","querySelectorAll","resolveElements","NodeList","calculateRepeatDuration","calcNextTime","labels","addKeyframes","sequence","endTime","at","eraseKeyframes","normalizeTimes","repeatDelayUnits","totalUnits","compareByTime","getSubjectSequence","sequences","getValueSequence","keyframesAsList","isNumber","isNumberKeyframesArray","every","createDOMVisualElement","isSVGSVGElement","createObjectVisualElement","animateSubject","isSingleValue","motionValue$1","animateSingleValue","subjects","numSubjects","thisSubject","createVisualElement","animateSequence","animationDefinitions","sequenceTransition","generators","defaultDuration","elementCache","timeLabels","prevTime","segment","maxDuration","resolveValueSequence","valueKeyframes","valueSequence","elementIndex","valueKeyframesAsList","remainingTransition","calculatedDelay","numKeyframes","absoluteDelta","springTransition","springEasing","remainder","unshift","originalKeyframes","originalTimes","originalEase","isFlipping","flippedKeyframes","flippedEases","repeatIndex","isFlipped","iterKeyframes","iterEase","iterStartOffset","keyframeIndex","targetTime","subjectIndex","subjectSequence","valueSequences","sort","valueOffset","valueEasing","_type","remainingDefaultTransition","createAnimationsFromSequence","mv","createScopedAnimate","subjectOrSequence","optionsOrKeyframes","animationOnComplete","inherited","sequenceOptions"],"mappings":"AAIA,SAASA,EAAWC,EAAKC,GACrB,MAAMC,EAAQF,EAAIG,QAAQF,GACtBC,GAAQ,GACRF,EAAII,OAAOF,EAAO,EAC1B,CCRA,MAAMG,EAAQ,CAACC,EAAKC,EAAKC,IACjBA,EAAID,EACGA,EACPC,EAAIF,EACGA,EACJE,ECLX,SAASC,EAAmBC,EAASC,GACjC,OAAOA,EACD,GAAGD,2FAAiGC,IACpGD,CACV,CCFA,IAAIE,EAAU,OACVC,EAAY,OACO,oBAAZC,SACmB,eAA1BA,QAAQC,KAAKC,WACbJ,EAAU,CAACK,EAAOP,EAASC,KAClBM,GAA4B,oBAAZC,SACjBA,QAAQC,KAAKV,EAAmBC,EAASC,KAGjDE,EAAY,CAACI,EAAOP,EAASC,KACzB,IAAKM,EACD,MAAM,IAAIG,MAAMX,EAAmBC,EAASC,MCbxD,MAAMU,EAAqB,CAAA,ECGrBC,EAAqBd,GAAM,+BAA+Be,KAAKf,GCA/DgB,EAAqBhB,GAAM,cAAce,KAAKf,GCFpD,SAASiB,EAAKC,GACV,IAAIC,EACJ,MAAO,UACYC,IAAXD,IACAA,EAASD,KACNC,EAEf,CCPA,MAAME,EAAQC,GAAQA,ECMhBC,EAAO,IAAIC,IAAiBA,EAAaC,OAAO,CAACC,EAAGC,IAAO3B,GAAM2B,EAAED,EAAE1B,KCCrE4B,EAAW,CAACC,EAAMC,EAAIC,KACxB,MAAMC,EAAQF,EAAKD,EACnB,OAAOG,GAASD,EAAQF,GAAQG,EAAQ,GCR5C,MAAMC,EACF,WAAAC,GACIC,KAAKC,cAAgB,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uD,EAAmBC,EAAoB,IAAKE,KAAcvc,GAAQ+W,EAClG,CAlCR,IAAoBpiC,EAmCZ,MAAMikB,EAAY,IAAIyE,GAAuBV,GAU7C,OATI2f,GACA1jB,EAAUpL,SAASK,KAAKyuB,GAExBvF,IACAA,EAAMpa,WAAWxnB,KAAKyjB,GACtBA,EAAUpL,SAASK,KAAK,KACpB1b,EAAW4kC,EAAMpa,WAAY/D,MAG9BA,CACX,CAEJ,CACY,MAACnB,GAAU0kB"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/size-rollup-dom-animation-assets.js b/node_modules/framer-motion/dist/size-rollup-dom-animation-assets.js new file mode 100644 index 0000000..febbd57 --- /dev/null +++ b/node_modules/framer-motion/dist/size-rollup-dom-animation-assets.js @@ -0,0 +1 @@ +const t=(t,e,s)=>s>e?e:s{},n=()=>{};"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(s=(t,s,n)=>{t||"undefined"==typeof console||console.warn(e(s,n))},n=(t,s,n)=>{if(!t)throw new Error(e(s,n))});const i={},r=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),a=t=>/^0[^.\s]+$/u.test(t);function o(t){let e;return()=>(void 0===e&&(e=t()),e)}const h=t=>t;class l{constructor(){this.subscriptions=[]}add(t){var e,s;return e=this.subscriptions,s=t,-1===e.indexOf(s)&&e.push(s),()=>function(t,e){const s=t.indexOf(e);s>-1&&t.splice(s,1)}(this.subscriptions,t)}notify(t,e,s){const n=this.subscriptions.length;if(n)if(1===n)this.subscriptions[0](t,e,s);else for(let i=0;i1e3*t,c=t=>t/1e3,d=(t,e)=>e?t*(1e3/e):0,p=t=>Array.isArray(t)&&"number"==typeof t[0],f=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function m(t,e){let s=!1,n=!0;const r={delta:0,timestamp:0,isProcessing:!1},a=()=>s=!0,o=f.reduce((t,e)=>(t[e]=function(t){let e=new Set,s=new Set,n=!1,i=!1;const r=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function o(e){r.has(e)&&(h.schedule(e),t()),e(a)}const h={schedule:(t,i=!1,a=!1)=>{const o=a&&n?e:s;return i&&r.add(t),o.add(t),t},cancel:t=>{s.delete(t),r.delete(t)},process:t=>{if(a=t,n)return void(i=!0);n=!0;const r=e;e=s,s=r,e.forEach(o),e.clear(),n=!1,i&&(i=!1,h.process(t))}};return h}(a),t),{}),{setup:h,read:l,resolveKeyframes:u,preUpdate:c,update:d,preRender:p,render:m,postRender:g}=o,v=()=>{const a=i.useManualTiming,o=a?r.timestamp:performance.now();s=!1,a||(r.delta=n?1e3/60:Math.max(Math.min(o-r.timestamp,40),1)),r.timestamp=o,r.isProcessing=!0,h.process(r),l.process(r),u.process(r),c.process(r),d.process(r),p.process(r),m.process(r),g.process(r),r.isProcessing=!1,s&&e&&(n=!1,t(v))};return{schedule:f.reduce((e,i)=>{const a=o[i];return e[i]=(e,i=!1,o=!1)=>(s||(s=!0,n=!0,r.isProcessing||t(v)),a.schedule(e,i,o)),e},{}),cancel:t=>{for(let e=0;e(void 0===b&&V.set(y.isProcessing||i.useManualTiming?y.timestamp:performance.now()),b),set:t=>{b=t,queueMicrotask(w)}},S=t=>e=>"string"==typeof e&&e.startsWith(t),M=S("--"),T=S("var(--"),A=t=>!!T(t)&&C.test(t.split("/*")[0].trim()),C=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function x(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const k={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},F={...k,transform:e=>t(0,1,e)},E={...k,default:1},R=t=>Math.round(1e5*t)/1e5,B=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const P=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,I=(t,e)=>s=>Boolean("string"==typeof s&&P.test(s)&&s.startsWith(t)||e&&!function(t){return null==t}(s)&&Object.prototype.hasOwnProperty.call(s,e)),N=(t,e,s)=>n=>{if("string"!=typeof n)return n;const[i,r,a,o]=n.match(B);return{[t]:parseFloat(i),[e]:parseFloat(r),[s]:parseFloat(a),alpha:void 0!==o?parseFloat(o):1}},O={...k,transform:e=>Math.round((e=>t(0,255,e))(e))},$={test:I("rgb","red"),parse:N("red","green","blue"),transform:({red:t,green:e,blue:s,alpha:n=1})=>"rgba("+O.transform(t)+", "+O.transform(e)+", "+O.transform(s)+", "+R(F.transform(n))+")"};const L={test:I("#"),parse:function(t){let e="",s="",n="",i="";return t.length>5?(e=t.substring(1,3),s=t.substring(3,5),n=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),s=t.substring(2,3),n=t.substring(3,4),i=t.substring(4,5),e+=e,s+=s,n+=n,i+=i),{red:parseInt(e,16),green:parseInt(s,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}},transform:$.transform},Y=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),W=Y("deg"),X=Y("%"),j=Y("px"),z=Y("vh"),K=Y("vw"),U=(()=>({...X,parse:t=>X.parse(t)/100,transform:t=>X.transform(100*t)}))(),Z={test:I("hsl","hue"),parse:N("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:s,alpha:n=1})=>"hsla("+Math.round(t)+", "+X.transform(R(e))+", "+X.transform(R(s))+", "+R(F.transform(n))+")"},D={test:t=>$.test(t)||L.test(t)||Z.test(t),parse:t=>$.test(t)?$.parse(t):Z.test(t)?Z.parse(t):L.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?$.transform(t):Z.transform(t),getAnimatableNone:t=>{const e=D.parse(t);return e.alpha=0,D.transform(e)}},q=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const H="number",_="color",G=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function J(t){const e=t.toString(),s=[],n={color:[],number:[],var:[]},i=[];let r=0;const a=e.replace(G,t=>(D.test(t)?(n.color.push(r),i.push(_),s.push(D.parse(t))):t.startsWith("var(")?(n.var.push(r),i.push("var"),s.push(t)):(n.number.push(r),i.push(H),s.push(parseFloat(t))),++r,"${}")).split("${}");return{values:s,split:a,indexes:n,types:i}}function Q({split:t,types:e}){const s=t.length;return n=>{let i="";for(let r=0;r{return"number"==typeof t?e?.trim().endsWith("/")?t:0:"number"==typeof(s=t)?0:D.test(s)?D.getAnimatableNone(s):s;var s};const et={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(B)?.length||0)+(t.match(q)?.length||0)>0},parse:function(t){return J(t).values},createTransformer:function(t){return Q(J(t))},getAnimatableNone:function(t){const e=J(t);return Q(e)(e.values.map((t,s)=>tt(t,e.split[s])))}},st=(t,e,s)=>t+(e-t)*s,nt=(t,e,s=10)=>{let n="";const i=Math.max(Math.round(e/s),2);for(let e=0;enull!==t;function rt(t,{repeat:e,repeatType:s="loop"},n,i=1){const r=t.filter(it),a=i<0||e&&"loop"!==s&&e%2==1?0:r.length-1;return a&&void 0!==n?n:r[a]}class at{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const ot=t=>180*t/Math.PI,ht=t=>{const e=ot(Math.atan2(t[1],t[0]));return ut(e)},lt={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:ht,rotateZ:ht,skewX:t=>ot(Math.atan(t[1])),skewY:t=>ot(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},ut=t=>((t%=360)<0&&(t+=360),t),ct=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),dt=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),pt={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:ct,scaleY:dt,scale:t=>(ct(t)+dt(t))/2,rotateX:t=>ut(ot(Math.atan2(t[6],t[5]))),rotateY:t=>ut(ot(Math.atan2(-t[2],t[0]))),rotateZ:ht,rotate:ht,skewX:t=>ot(Math.atan(t[4])),skewY:t=>ot(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function ft(t){return t.includes("scale")?1:0}function mt(t,e){if(!t||"none"===t)return ft(e);const s=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let n,i;if(s)n=pt,i=s;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);n=lt,i=e}if(!i)return ft(e);const r=n[e],a=i[1].split(",").map(vt);return"function"==typeof r?r(a):a[r]}const gt=(t,e)=>{const{transform:s="none"}=getComputedStyle(t);return mt(s,e)};function vt(t){return parseFloat(t.trim())}const yt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],bt=(()=>new Set([...yt,"pathRotation"]))(),wt=t=>t===k||t===j,Vt=new Set(["x","y","z"]),St=yt.filter(t=>!Vt.has(t));const Mt={width:({x:t},{paddingLeft:e="0",paddingRight:s="0",boxSizing:n})=>{const i=t.max-t.min;return"border-box"===n?i:i-parseFloat(e)-parseFloat(s)},height:({y:t},{paddingTop:e="0",paddingBottom:s="0",boxSizing:n})=>{const i=t.max-t.min;return"border-box"===n?i:i-parseFloat(e)-parseFloat(s)},top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>mt(e,"x"),y:(t,{transform:e})=>mt(e,"y")};Mt.translateX=Mt.x,Mt.translateY=Mt.y;const Tt=new Set;let At=!1,Ct=!1,xt=!1;function kt(){if(Ct){const t=Array.from(Tt).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),s=new Map;e.forEach(t=>{const e=function(t){const e=[];return St.forEach(s=>{const n=t.getValue(s);void 0!==n&&(e.push([s,n.get()]),n.set(s.startsWith("scale")?1:0))}),e}(t);e.length&&(s.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=s.get(t);e&&e.forEach(([e,s])=>{t.getValue(e)?.set(s)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}Ct=!1,At=!1,Tt.forEach(t=>t.complete(xt)),Tt.clear()}function Ft(){Tt.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Ct=!0)})}function Et(){xt=!0,Ft(),kt(),xt=!1}class Rt{constructor(t,e,s,n,i,r=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=s,this.motionValue=n,this.element=i,this.isAsync=r}scheduleResolve(){this.state="scheduled",this.isAsync?(Tt.add(this),At||(At=!0,g.read(Ft),g.resolveKeyframes(kt))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:s,motionValue:n}=this;if(null===t[0]){const i=n?.get(),r=t[t.length-1];if(void 0!==i)t[0]=i;else if(s&&e){const n=s.readValue(e,r);null!=n&&(t[0]=n)}void 0===t[0]&&(t[0]=r),n&&void 0===i&&n.set(t[0])}!function(t){for(let e=1;et.startsWith("--"))(e)?t.style.setProperty(e,s):t.style[e]=s}const Pt={};function It(t,e){const s=o(t);return()=>Pt[e]??s()}const Nt=It(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),Ot=It(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),$t=([t,e,s,n])=>`cubic-bezier(${t}, ${e}, ${s}, ${n})`,Lt={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:$t([0,.65,.55,1]),circOut:$t([.55,0,1,.45]),backIn:$t([.31,.01,.66,-.59]),backOut:$t([.33,1.53,.69,.99])};function Yt(t,e){return t?"function"==typeof t?Ot()?nt(t,e):"ease-out":p(t)?$t(t):Array.isArray(t)?t.map(t=>Yt(t,e)||Lt.easeOut):Lt[t]:void 0}function Wt(t,e,s,{delay:n=0,duration:i=300,repeat:r=0,repeatType:a="loop",ease:o="easeOut",times:h}={},l=void 0){const u={[e]:s};h&&(u.offset=h);const c=Yt(o,i);Array.isArray(c)&&(u.easing=c);const d={delay:n,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:r+1,direction:"reverse"===a?"alternate":"normal"};return l&&(d.pseudoElement=l),t.animate(u,d)}function Xt(t){return"function"==typeof t&&"applyToOptions"in t}class jt extends at{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:e,name:s,keyframes:i,pseudoElement:r,allowFlatten:a=!1,finalKeyframe:o,onComplete:h}=t;this.isPseudoElement=Boolean(r),this.allowFlatten=a,this.options=t,n("string"!=typeof t.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const l=function({type:t,...e}){return Xt(t)&&Ot()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=Wt(e,s,i,l,r),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!r){const t=rt(i,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(t),Bt(e,s,t),this.animation.cancel()}h?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return c(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+c(t)}get time(){return c(Number(this.animation.currentTime)||0)}set time(t){const e=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=u(t),e&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:e,rangeEnd:s,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&Nt()?(this.animation.timeline=t,e&&(this.animation.rangeStart=e),s&&(this.animation.rangeEnd=s),h):n(this)}}const zt=new Set(["opacity","clipPath","filter","transform","backgroundColor"]);class Kt{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=V.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=V.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new l);const s=this.events[t].add(e);return"change"===t?()=>{s(),g.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,s){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-s}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=V.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return d(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Ut(t,e){return new Kt(t,e)}function Zt(t){const e=[{},{}];return t?.values.forEach((t,s)=>{e[0][s]=t.get(),e[1][s]=t.getVelocity()}),e}function Dt(t,e,s,n){if("function"==typeof e){const[i,r]=Zt(n);e=e(void 0!==s?s:t.custom,i,r)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[i,r]=Zt(n);e=e(void 0!==s?s:t.custom,i,r)}return e}const qt=t=>Boolean(t&&t.getVelocity);function Ht(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const _t="data-"+Ht("framerAppearId"),Gt=t=>e=>e.test(t),Jt=[k,j,X,W,K,z,{test:t=>"auto"===t,parse:t=>t}],Qt=t=>Jt.find(Gt(t)),te=new Set(["brightness","contrast","saturate","opacity"]);function ee(t){const[e,s]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[n]=s.match(B)||[];if(!n)return t;const i=s.replace(n,"");let r=te.has(e)?1:0;return n!==s&&(r*=100),e+"("+r+i+")"}const se=/\b([a-z-]*)\(.*?\)/gu,ne={...et,getAnimatableNone:t=>{const e=t.match(se);return e?e.map(ee).join(" "):t}},ie={...et,getAnimatableNone:t=>{const e=et.parse(t);return et.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},re={...k,transform:Math.round},ae={borderWidth:j,borderTopWidth:j,borderRightWidth:j,borderBottomWidth:j,borderLeftWidth:j,borderRadius:j,borderTopLeftRadius:j,borderTopRightRadius:j,borderBottomRightRadius:j,borderBottomLeftRadius:j,width:j,maxWidth:j,height:j,maxHeight:j,top:j,right:j,bottom:j,left:j,inset:j,insetBlock:j,insetBlockStart:j,insetBlockEnd:j,insetInline:j,insetInlineStart:j,insetInlineEnd:j,padding:j,paddingTop:j,paddingRight:j,paddingBottom:j,paddingLeft:j,paddingBlock:j,paddingBlockStart:j,paddingBlockEnd:j,paddingInline:j,paddingInlineStart:j,paddingInlineEnd:j,margin:j,marginTop:j,marginRight:j,marginBottom:j,marginLeft:j,marginBlock:j,marginBlockStart:j,marginBlockEnd:j,marginInline:j,marginInlineStart:j,marginInlineEnd:j,fontSize:j,backgroundPositionX:j,backgroundPositionY:j,...{rotate:W,pathRotation:W,rotateX:W,rotateY:W,rotateZ:W,scale:E,scaleX:E,scaleY:E,scaleZ:E,skew:W,skewX:W,skewY:W,distance:j,translateX:j,translateY:j,translateZ:j,x:j,y:j,z:j,perspective:j,transformPerspective:j,opacity:F,originX:U,originY:U,originZ:j},zIndex:re,fillOpacity:F,strokeOpacity:F,numOctaves:re},oe={...ae,color:D,backgroundColor:D,outlineColor:D,fill:D,stroke:D,borderColor:D,borderTopColor:D,borderRightColor:D,borderBottomColor:D,borderLeftColor:D,filter:ne,WebkitFilter:ne,mask:ie,WebkitMask:ie},he=t=>oe[t],le=new Set([ne,ie]);function ue(t,e){let s=he(t);return le.has(s)||(s=et),s.getAnimatableNone?s.getAnimatableNone(e):void 0}const ce=(t,e)=>e&&"number"==typeof t?e.transform(t):t,{schedule:de}=m(queueMicrotask,!1),pe=[...Jt,D,et],fe=()=>({x:{min:0,max:0},y:{min:0,max:0}}),me=new WeakMap;function ge(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function ve(t){return"string"==typeof t||Array.isArray(t)}const ye=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],be=["initial",...ye];function we(t){return ge(t.animate)||be.some(e=>ve(t[e]))}function Ve(t){return Boolean(we(t)||t.variants)}const Se={current:null},Me={current:!1},Te="undefined"!=typeof window;const Ae=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Ce={};function xe(t){Ce=t}function ke(){return Ce}class Fe{scrapeMotionValuesFromProps(t,e,s){return{}}constructor({parent:t,props:e,presenceContext:s,reducedMotionConfig:n,skipAnimations:i,blockInitialAnimation:r,visualState:a},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Rt,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const t=V.now();this.renderScheduledAtthis.bindToMotionValue(e,t)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(Me.current||function(){if(Me.current=!0,Te)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Se.current=t.matches;t.addEventListener("change",e),e()}else Se.current=!1}(),this.shouldReduceMotion=Se.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),v(this.notifyUpdate),v(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,e){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),e.accelerate&&zt.has(t)&&this.current instanceof HTMLElement){const{factory:s,keyframes:n,times:i,ease:r,duration:a}=e.accelerate,o=new jt({element:this.current,name:t,keyframes:n,times:i,ease:r,duration:u(a)}),h=s(o);return void this.valueSubscriptions.set(t,()=>{h(),o.cancel()})}const s=bt.has(t);s&&this.onBindTransform&&this.onBindTransform();const n=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&g.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{n(),i&&i()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in Ce){const e=Ce[t];if(!e)continue;const{isEnabled:s,Feature:n}=e;if(!this.features[t]&&n&&s(this.props)&&(this.features[t]=new n(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;ee.variantChildren.delete(t)}addValue(t,e){const s=this.values.get(t);e!==s&&(s&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let s=this.values.get(t);return void 0===s&&void 0!==e&&(s=Ut(null===e?void 0:e,{owner:this}),this.addValue(t,s)),s}readValue(t,e){let s=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var n;return null!=s&&("string"==typeof s&&(r(s)||a(s))?s=parseFloat(s):(n=s,!pe.find(Gt(n))&&et.test(e)&&(s=ue(t,e))),this.setBaseTarget(t,qt(s)?s.get():s)),qt(s)?s.get():s}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let s;if("string"==typeof e||"object"==typeof e){const n=Dt(this.props,e,this.presenceContext?.custom);n&&(s=n[t])}if(e&&void 0!==s)return s;const n=this.getBaseTargetFromProps(this.props,t);return void 0===n||qt(n)?void 0!==this.initialValues[t]&&void 0===s?void 0:this.baseTarget[t]:n}on(t,e){return this.events[t]||(this.events[t]=new l),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){de.render(this.render)}}const Ee={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Re=yt.length;function Be(t,e,s){const{style:n,vars:i,transformOrigin:r}=t;let a=!1,o=!1;for(const t in e){const s=e[t];if(bt.has(t))a=!0;else if(M(t))i[t]=s;else{const e=ce(s,ae[t]);t.startsWith("origin")?(o=!0,r[t]=e):n[t]=e}}if(e.transform||(a||s?n.transform=function(t,e,s){let n="",i=!0;for(let r=0;r{if(!e.target)return t;if("string"==typeof t){if(!j.test(t))return t;t=parseFloat(t)}return`${Pe(t,e.target.x)}% ${Pe(t,e.target.y)}%`}},Ne={correct:(t,{treeScale:e,projectionDelta:s})=>{const n=t,i=et.parse(t);if(i.length>5)return n;const r=et.createTransformer(t),a="number"!=typeof i[0]?1:0,o=s.x.scale*e.x,h=s.y.scale*e.y;i[0+a]/=o,i[1+a]/=h;const l=st(o,h,.5);return"number"==typeof i[2+a]&&(i[2+a]/=l),"number"==typeof i[3+a]&&(i[3+a]/=l),r(i)}},Oe={borderRadius:{...Ie,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"]},borderTopLeftRadius:Ie,borderTopRightRadius:Ie,borderBottomLeftRadius:Ie,borderBottomRightRadius:Ie,boxShadow:Ne};function $e(t,{layout:e,layoutId:s}){return bt.has(t)||t.startsWith("origin")||(e||void 0!==s)&&(!!Oe[t]||"opacity"===t)}function Le(t,e,s){const n=t.style,i=e?.style,r={};if(!n)return r;for(const e in n)(qt(n[e])||i&&qt(i[e])||$e(e,t)||void 0!==s?.getValue(e)?.liveStyle)&&(r[e]=n[e]);return r}const Ye={offset:"stroke-dashoffset",array:"stroke-dasharray"},We={offset:"strokeDashoffset",array:"strokeDasharray"};const Xe=["transform","opacity","offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function je(t,{attrX:e,attrY:s,attrScale:n,pathLength:i,pathSpacing:r=1,pathOffset:a=0,...o},h,l,u){if(Be(t,o,l),h)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:c,style:d}=t;for(const t of Xe)void 0!==c[t]&&(d[t]=c[t],delete c[t]);(d.transform||c.transformOrigin)&&(d.transformOrigin=c.transformOrigin??"50% 50%",delete c.transformOrigin),d.transform&&(d.transformBox=u?.transformBox??"fill-box",delete c.transformBox),void 0!==e&&(c.x=e),void 0!==s&&(c.y=s),void 0!==n&&(c.scale=n),void 0!==i&&function(t,e,s=1,n=0,i=!0){t.pathLength=1;const r=i?Ye:We;t[r.offset]=""+-n,t[r.array]=`${e} ${s}`}(c,i,r,a,!1)}const ze=t=>"string"==typeof t&&"svg"===t.toLowerCase();function Ke(t,e,s){const n=Le(t,e,s);for(const s in t)if(qt(t[s])||qt(e[s])){n[-1!==yt.indexOf(s)?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s]=t[s]}return n}const Ue=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Ze(t){return"string"==typeof t&&!t.includes("-")&&!!(Ue.indexOf(t)>-1||/[A-Z]/u.test(t))}export{Qt as $,et as A,J as B,y as C,V as D,v as E,g as F,c as G,t as H,nt as I,u as J,d as K,rt as L,i as M,jt as N,Bt as O,Xt as P,zt as Q,o as R,Rt as S,Et as T,bt as U,r as V,at as W,yt as X,Ut as Y,a as Z,ue as _,we as a,x as a0,Mt as a1,wt as a2,Fe as a3,ft as a4,gt as a5,M as a6,Ht as a7,fe as a8,Xe as a9,he as aa,be as ab,ye as ac,ve as b,$e as c,Be as d,je as e,ze as f,Ze as g,Ve as h,qt as i,ge as j,Ke as k,ke as l,xe as m,h as n,_t as o,p,n as q,Dt as r,Le as s,st as t,$ as u,Z as v,L as w,s as x,A as y,D as z}; diff --git a/node_modules/framer-motion/dist/size-rollup-dom-animation-m.js b/node_modules/framer-motion/dist/size-rollup-dom-animation-m.js new file mode 100644 index 0000000..5ccb079 --- /dev/null +++ b/node_modules/framer-motion/dist/size-rollup-dom-animation-m.js @@ -0,0 +1 @@ +import{jsxs as t,jsx as n}from"react/jsx-runtime";import{createContext as o,useContext as e,useMemo as r,Fragment as a,createElement as i,useRef as s,useInsertionEffect as u,useCallback as c,useLayoutEffect as l,useEffect as d,forwardRef as f}from"react";import{i as m,a as p,b as y,c as g,d as v,e as h,f as w,g as S,P as M,r as b,h as P,j as E,k as A,s as T,l as C,m as j,n as V,S as x,o as I,p as L,L as k}from"./size-rollup-dom-max-assets.js";const W=o({strict:!1}),H=o({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),O=o({});function D(t){const{initial:n,animate:o}=function(t,n){if(m(t)){const{initial:n,animate:o}=t;return{initial:!1===n||p(n)?n:void 0,animate:p(o)?o:void 0}}return!1!==t.inherit?n:{}}(t,e(O));return r(()=>({initial:n,animate:o}),[F(n),F(o)])}function F(t){return Array.isArray(t)?t.join(" "):t}const R=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function N(t,n,o){for(const e in n)y(n[e])||g(e,o)||(t[e]=n[e])}function B(t,n){const o={};return N(o,t.style||{},t),Object.assign(o,function({transformTemplate:t},n){return r(()=>{const o={style:{},transform:{},transformOrigin:{},vars:{}};return v(o,n,t),Object.assign({},o.vars,o.style)},[n])}(t,n)),o}function U(t,n){const o={},e=B(t,n);return t.drag&&!1!==t.dragListener&&(o.draggable=!1,e.userSelect=e.WebkitUserSelect=e.WebkitTouchCallout="none",e.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),void 0===t.tabIndex&&(t.onTap||t.onTapStart||t.whileTap)&&(o.tabIndex=0),o.style=e,o}const $=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}});function _(t,n,o,e){const a=r(()=>{const o={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return h(o,n,w(e),t.transformTemplate,t.style),{...o.attrs,style:{...o.style}}},[n]);if(t.style){const n={};N(n,t.style,t),a.style={...n,...a.style}}return a}const q=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function z(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||q.has(t)}function G(t,n){return t.startsWith("on")?!z(t):n?.(t)??!z(t)}function X(t,n,o,{latestValues:e},s,u=!1,c,l){const d=(c??S(t)?_:U)(n,e,s,t),f=function(t,n,o,e){const r={};for(const a in t)"values"===a&&"object"==typeof t.values||y(t[a])||(G(a,e)||!0===o&&z(a)||!n&&!z(a)||t.draggable&&a.startsWith("onDrag"))&&(r[a]=t[a]);return r}(n,"string"==typeof t,u,l),m=t!==a?{...f,...d,ref:o}:{},{children:p}=n,g=r(()=>y(p)?p.get():p,[p]);return i(t,{...m,children:g})}function Y(t,n,o,e){const r={},a=e(t,{});for(const t in a)r[t]=b(a[t]);let{initial:i,animate:s}=t;const u=m(t),c=P(t);n&&c&&!u&&!1!==t.inherit&&(void 0===i&&(i=n.initial),void 0===s&&(s=n.animate));let l=!!o&&!1===o.initial;l=l||!1===i;const d=l?s:i;if(d&&"boolean"!=typeof d&&!E(d)){const n=Array.isArray(d)?d:[d];for(let o=0;o(n,o)=>{const r=e(O),a=e(M),i=()=>function({scrapeMotionValuesFromProps:t,createRenderState:n},o,e,r){return{latestValues:Y(o,e,r,t),renderState:n()}}(t,n,r,a);return o?i():function(t){const n=s(null);return null===n.current&&(n.current=t()),n.current}(i)},K=J({scrapeMotionValuesFromProps:T,createRenderState:R}),Q=J({scrapeMotionValuesFromProps:C,createRenderState:$}),Z={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let tt=!1;function nt(){return function(){if(tt)return;const t={};for(const n in Z)t[n]={isEnabled:t=>Z[n].some(n=>!!t[n])};V(t),tt=!0}(),j()}const ot=Symbol.for("motionComponentSymbol");function et(t,n,o){const e=s(o);u(()=>{e.current=o});const r=s(null);return c(o=>{o&&t.onMount?.(o),n&&(o?n.mount(o):n.unmount());const a=e.current;if("function"==typeof a)if(o){const t=a(o);"function"==typeof t&&(r.current=t)}else r.current?(r.current(),r.current=null):a(o);else a&&(a.current=o)},[n])}const rt="undefined"!=typeof window?l:d;function at(t,n,o,r,a,i){const{visualElement:c}=e(O),l=e(W),f=e(M),m=e(H),p=m.reducedMotion,y=m.skipAnimations,g=s(null),v=s(!1);r=r||l.renderer,!g.current&&r&&(g.current=r(t,{visualState:n,parent:c,props:o,presenceContext:f,blockInitialAnimation:!!f&&!1===f.initial,reducedMotionConfig:p,skipAnimations:y,isSVG:i}),v.current&&g.current&&(g.current.manuallyAnimateOnMount=!0));const h=g.current,w=e(x);!h||h.projection||!a||"html"!==h.type&&"svg"!==h.type||function(t,n,o,e){const{layoutId:r,layout:a,drag:i,dragConstraints:s,layoutScroll:u,layoutRoot:c,layoutAnchor:l,layoutCrossfade:d}=n;t.projection=new o(t.latestValues,n["data-framer-portal-id"]?void 0:it(t.parent)),t.projection.setOptions({layoutId:r,layout:a,alwaysMeasureLayout:Boolean(i)||s&&L(s),visualElement:t,animationType:"string"==typeof a?a:"both",initialPromotionConfig:e,crossfade:d,layoutScroll:u,layoutRoot:c,layoutAnchor:l})}(g.current,o,a,w);const S=s(!1);u(()=>{h&&S.current&&h.update(o,f)});const b=o[I],P=s(Boolean(b)&&"undefined"!=typeof window&&!window.MotionHandoffIsComplete?.(b)&&window.MotionHasOptimisedAnimation?.(b));return rt(()=>{v.current=!0,h&&(S.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),h.scheduleRenderMicrotask(),P.current&&h.animationState&&h.animationState.animateChanges())}),d(()=>{h&&(!P.current&&h.animationState&&h.animationState.animateChanges(),P.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(b)}),P.current=!1),h.enteringChildren=void 0)}),h}function it(t){if(t)return!1!==t.options.allowProjection?t.projection:it(t.parent)}function st(o,{forwardMotionProps:r=!1,type:a}={},i,s){const u=a?"svg"===a:S(o),c=u?Q:K;function l(a,i){let l;const d={...e(H),...a,layoutId:ut(a)},{isStatic:f,isValidProp:m}=d,p=D(a),y=c(a,f);if(!f&&"undefined"!=typeof window){e(W).strict;const t=function(t){const n=nt(),{drag:o,layout:e}=n;if(!o&&!e)return{};const r={...o,...e};return{MeasureLayout:o?.isEnabled(t)||e?.isEnabled(t)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}(d);l=t.MeasureLayout,p.visualElement=at(o,y,d,s,t.ProjectionNode,u)}return t(O.Provider,{value:p,children:[l&&p.visualElement?n(l,{visualElement:p.visualElement,...d}):null,X(o,a,et(y,p.visualElement,i),y,f,r,u,m)]})}l.displayName=`motion.${"string"==typeof o?o:`create(${o.displayName??o.name??""})`}`;const d=f(l);return d[ot]=o,d}function ut({layoutId:t}){const n=e(k).id;return n&&void 0!==t?n+"-"+t:t}function ct(t,n){return st(t,n)}const lt=ct("div");export{lt as MotionDiv}; diff --git a/node_modules/framer-motion/dist/size-rollup-dom-animation.js b/node_modules/framer-motion/dist/size-rollup-dom-animation.js new file mode 100644 index 0000000..71098c3 --- /dev/null +++ b/node_modules/framer-motion/dist/size-rollup-dom-animation.js @@ -0,0 +1 @@ +import{n as t,p as e,q as n,t as i,u as s,v as r,w as o,x as a,y as u,z as l,A as c,B as h,C as d,D as p,E as m,F as f,G as y,H as v,I as g,J as w,K as b,M as T,W as x,L as A,N as S,O as M,P as k,Q as C,R as E,S as V,T as P,U as D,V as O,r as I,X as F,Y as L,i as R,o as K,Z as B,_ as j,$ as G,a0 as q,a1 as H,a2 as N,a3 as U,a4 as $,a5 as W,a6 as _,d as z,s as Y,a7 as X,a8 as J,a9 as Z,k as Q,e as tt,f as et,aa as nt,b as it,ab as st,j as rt,ac as ot,g as at}from"./size-rollup-dom-animation-assets.js";import{Fragment as ut}from"react";const lt=(...t)=>t.reduce((t,e)=>n=>e(t(n))),ct=(t,e,n)=>{const i=e-t;return i?(n-t)/i:1},ht=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function dt(e,n,i,s){if(e===n&&i===s)return t;const r=t=>function(t,e,n,i,s){let r,o,a=0;do{o=e+(n-e)/2,r=ht(o,i,s)-t,r>0?n=o:e=o}while(Math.abs(r)>1e-7&&++a<12);return o}(t,0,1,e,i);return t=>0===t||1===t?t:ht(r(t),n,s)}const pt=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,mt=t=>e=>1-t(1-e),ft=dt(.33,1.53,.69,.99),yt=mt(ft),vt=pt(yt),gt=t=>t>=1?1:(t*=2)<1?.5*yt(t):.5*(2-Math.pow(2,-10*(t-1))),wt=t=>1-Math.sin(Math.acos(t)),bt=mt(wt),Tt=pt(wt),xt=dt(.42,0,1,1),At=dt(0,0,.58,1),St=dt(.42,0,.58,1),Mt={linear:t,easeIn:xt,easeInOut:St,easeOut:At,circIn:wt,circInOut:Tt,circOut:bt,backIn:yt,backInOut:vt,backOut:ft,anticipate:gt},kt=t=>{if(e(t)){n(4===t.length,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[e,i,s,r]=t;return dt(e,i,s,r)}return"string"==typeof t?(n(void 0!==Mt[t],`Invalid easing type '${t}'`,"invalid-easing-type"),Mt[t]):t};function Ct(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function Et(t,e){return n=>n>0?e:t}const Vt=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},Pt=[o,s,r];function Dt(t){const e=(n=t,Pt.find(t=>t.test(n)));var n;if(a(Boolean(e),`'${t}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!Boolean(e))return!1;let i=e.parse(t);return e===r&&(i=function({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let s=0,r=0,o=0;if(e/=100){const i=n<.5?n*(1+e):n+e-n*e,a=2*n-i;s=Ct(a,i,t+1/3),r=Ct(a,i,t),o=Ct(a,i,t-1/3)}else s=r=o=n;return{red:Math.round(255*s),green:Math.round(255*r),blue:Math.round(255*o),alpha:i}}(i)),i}const Ot=(t,e)=>{const n=Dt(t),r=Dt(e);if(!n||!r)return Et(t,e);const o={...n};return t=>(o.red=Vt(n.red,r.red,t),o.green=Vt(n.green,r.green,t),o.blue=Vt(n.blue,r.blue,t),o.alpha=i(n.alpha,r.alpha,t),s.transform(o))},It=new Set(["none","hidden"]);function Ft(t,e){return n=>i(t,e,n)}function Lt(t){return"number"==typeof t?Ft:"string"==typeof t?u(t)?Et:l.test(t)?Ot:Bt:Array.isArray(t)?Rt:"object"==typeof t?l.test(t)?Ot:Kt:Et}function Rt(t,e){const n=[...t],i=n.length,s=t.map((t,n)=>Lt(t)(t,e[n]));return t=>{for(let e=0;e{for(const e in i)n[e]=i[e](t);return n}}const Bt=(t,e)=>{const n=c.createTransformer(e),i=h(t),s=h(e);return i.indexes.var.length===s.indexes.var.length&&i.indexes.color.length===s.indexes.color.length&&i.indexes.number.length>=s.indexes.number.length?It.has(t)&&!s.values.length||It.has(e)&&!i.values.length?function(t,e){return It.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):lt(Rt(function(t,e){const n=[],i={color:0,var:0,number:0};for(let s=0;s{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>f.update(e,t),stop:()=>m(e),now:()=>d.isProcessing?d.timestamp:p.now()}},qt=2e4;function Ht(t){let e=0;let n=t.next(e);for(;!n.done&&e=qt?1/0:e}const Nt=100,Ut=10,$t=1,Wt=0,_t=800,zt=.3,Yt=.3,Xt={granular:.01,default:2},Jt={granular:.005,default:.5},Zt=.01,Qt=10,te=.05,ee=1;function ne(t,e){return t*Math.sqrt(1-e*e)}const ie=.001;const se=["duration","bounce"],re=["stiffness","damping","mass"];function oe(t,e){return e.some(e=>void 0!==t[e])}function ae(t){let e={velocity:Wt,stiffness:Nt,damping:Ut,mass:$t,isResolvedFromDuration:!1,...t};if(!oe(t,re)&&oe(t,se))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,i=2*Math.PI/(1.2*n),s=i*i,r=2*v(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:$t,stiffness:s,damping:r}}else{const n=function({duration:t=_t,bounce:e=zt,velocity:n=Wt,mass:i=$t}){let s,r;a(t<=w(Qt),"Spring duration must be 10 seconds or less","spring-duration-limit");let o=1-e;o=v(te,ee,o),t=v(Zt,Qt,y(t)),o<1?(s=e=>{const i=e*o,s=i*t,r=i-n,a=ne(e,o),u=Math.exp(-s);return ie-r/a*u},r=e=>{const i=e*o*t,r=i*n+n,a=Math.pow(o,2)*Math.pow(e,2)*t,u=Math.exp(-i),l=ne(Math.pow(e,2),o);return(-s(e)+ie>0?-1:1)*((r-a)*u)/l}):(s=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,r=e=>Math.exp(-e*t)*(t*t*(n-e)));const u=function(t,e,n){let i=n;for(let n=1;n<12;n++)i-=t(i)/e(i);return i}(s,r,5/t);if(t=w(t),isNaN(u))return{stiffness:Nt,damping:Ut,duration:t};{const e=Math.pow(u,2)*i;return{stiffness:e,damping:2*o*Math.sqrt(i*e),duration:t}}}({...t,velocity:0});e={...e,...n,mass:$t},e.isResolvedFromDuration=!0}return e}function ue(t=Yt,e=zt){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:i,restDelta:s}=n;const r=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:u,damping:l,mass:c,duration:h,velocity:d,isResolvedFromDuration:p}=ae({...n,velocity:-y(n.velocity||0)}),m=d||0,f=l/(2*Math.sqrt(u*c)),v=o-r,b=y(Math.sqrt(u/c)),T=Math.abs(v)<5;let x,A,S,M,k,C;if(i||(i=T?Xt.granular:Xt.default),s||(s=T?Jt.granular:Jt.default),f<1)S=ne(b,f),M=(m+f*b*v)/S,x=t=>{const e=Math.exp(-f*b*t);return o-e*(M*Math.sin(S*t)+v*Math.cos(S*t))},k=f*b*M+v*S,C=f*b*v-M*S,A=t=>Math.exp(-f*b*t)*(k*Math.sin(S*t)+C*Math.cos(S*t));else if(1===f){x=t=>o-Math.exp(-b*t)*(v+(m+b*v)*t);const t=m+b*v;A=e=>Math.exp(-b*e)*(b*t*e-m)}else{const t=b*Math.sqrt(f*f-1);x=e=>{const n=Math.exp(-f*b*e),i=Math.min(t*e,300);return o-n*((m+f*b*v)*Math.sinh(i)+t*v*Math.cosh(i))/t};const e=(m+f*b*v)/t,n=f*b*e-v*t,i=f*b*v-e*t;A=e=>{const s=Math.exp(-f*b*e),r=Math.min(t*e,300);return s*(n*Math.sinh(r)+i*Math.cosh(r))}}const E={calculatedDuration:p&&h||null,velocity:t=>w(A(t)),next:t=>{if(!p&&f<1){const e=Math.exp(-f*b*t),n=Math.sin(S*t),r=Math.cos(S*t),u=o-e*(M*n+v*r),l=w(e*(k*n+C*r));return a.done=Math.abs(l)<=i&&Math.abs(o-u)<=s,a.value=a.done?o:u,a}const e=x(t);if(p)a.done=t>=h;else{const n=w(A(t));a.done=Math.abs(n)<=i&&Math.abs(o-e)<=s}return a.value=a.done?o:e,a},toString:()=>{const t=Math.min(Ht(E),qt),e=g(e=>E.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return E}ue.applyToOptions=t=>{const e=function(t,e=100,n){const i=n({...t,keyframes:[0,e]}),s=Math.min(Ht(i),qt);return{type:"keyframes",ease:t=>i.next(s*t).value/e,duration:y(s)}}(t,100,ue);return t.ease=e.ease,t.duration=w(e.duration),t.type="keyframes",t};function le(t,e,n){const i=Math.max(e-5,0);return b(n-t(i),e-i)}function ce({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:u,restDelta:l=.5,restSpeed:c}){const h=t[0],d={done:!1,value:h},p=t=>void 0===a?u:void 0===u||Math.abs(a-t)-m*Math.exp(-t/i),g=t=>y+v(t),w=t=>{const e=v(t),n=g(t);d.done=Math.abs(e)<=l,d.value=d.done?y:n};let b,T;const x=t=>{var e;(e=d.value,void 0!==a&&eu)&&(b=t,T=ue({keyframes:[d.value,p(d.value)],velocity:le(g,t,d.value),damping:s,stiffness:r,restDelta:l,restSpeed:c}))};return x(0),{calculatedDuration:null,next:t=>{let e=!1;return T||void 0!==b||(e=!0,w(t),x(t)),void 0!==b&&t>=b?T.next(t-b):(!e&&w(t),d)}}}function he(e,i,{clamp:s=!0,ease:r,mixer:o}={}){const a=e.length;if(n(a===i.length,"Both input and output ranges must be the same length","range-length"),1===a)return()=>i[0];if(2===a&&i[0]===i[1])return()=>i[1];const u=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),i=[...i].reverse());const l=function(e,n,i){const s=[],r=i||T.mix||jt,o=e.length-1;for(let i=0;i{if(u&&t1)for(;nh(v(e[0],e[a-1],t)):h}function de(t){const e=[0];return function(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const r=ct(0,e,s);t.push(i(n,1,r))}}(e,t.length-1),e}function pe({duration:t=300,keyframes:e,times:n,ease:i="easeInOut"}){const s=(t=>Array.isArray(t)&&"number"!=typeof t[0])(i)?i.map(kt):kt(i),r={done:!1,value:e[0]},o=function(t,e){return t.map(t=>t*e)}(n&&n.length===e.length?n:de(e),t),a=he(o,e,{ease:Array.isArray(s)?s:(u=e,l=s,u.map(()=>l||St).splice(0,u.length-1))});var u,l;return{calculatedDuration:t,next:e=>(r.value=a(e),r.done=e>=t,r)}}const me={decay:ce,inertia:ce,tween:pe,keyframes:pe,spring:ue};function fe(t){"string"==typeof t.type&&(t.type=me[t.type])}const ye=t=>t/100;class ve extends x{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:t}=this.options;t&&t.updatedAt!==p.now()&&this.tick(p.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;fe(t);const{type:e=pe,repeat:n=0,repeatDelay:i=0,repeatType:s,velocity:r=0}=t;let{keyframes:o}=t;const a=e||pe;a!==pe&&"number"!=typeof o[0]&&(this.mixKeyframes=lt(ye,jt(o[0],o[1])),o=[0,100]);const u=a({...t,keyframes:o});"mirror"===s&&(this.mirroredGenerator=a({...t,keyframes:[...o].reverse(),velocity:-r})),null===u.calculatedDuration&&(u.calculatedDuration=Ht(u));const{calculatedDuration:l}=u;this.calculatedDuration=l,this.resolvedDuration=l+i,this.totalDuration=this.resolvedDuration*(n+1)-i,this.generator=u}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,e=!1){const{generator:n,totalDuration:i,mixKeyframes:s,mirroredGenerator:r,resolvedDuration:o,calculatedDuration:a}=this;if(null===this.startTime)return n.next(0);const{delay:u=0,keyframes:l,repeat:c,repeatType:h,repeatDelay:d,type:p,onUpdate:m,finalKeyframe:f}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const y=this.currentTime-u*(this.playbackSpeed>=0?1:-1),g=this.playbackSpeed>=0?y<0:y>i;this.currentTime=Math.max(y,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=i);let w,b=this.currentTime,T=n;if(c){const t=Math.min(this.currentTime,i)/o;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,c+1);Boolean(e%2)&&("reverse"===h?(n=1-n,d&&(n-=d/o)):"mirror"===h&&(T=r)),b=v(0,1,n)*o}g?(this.delayState.value=l[0],w=this.delayState):w=T.next(b),s&&!g&&(w.value=s(w.value));let{done:x}=w;g||null===a||(x=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const S=null===this.holdTime&&("finished"===this.state||"running"===this.state&&x);return S&&p!==ce&&(w.value=A(l,this.options,f,this.speed)),m&&m(w.value),S&&this.finish(),w}then(t,e){return this.finished.then(t,e)}get duration(){return y(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+y(t)}get time(){return y(this.currentTime)}set time(t){t=w(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);return le(t=>this.generator.next(t).value,t,this.generator.next(t).value)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;e&&this.driver&&this.updateTime(p.now()),this.playbackSpeed=t,e&&this.driver&&(this.time=y(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=Gt,startTime:e}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),this.options.onPlay?.();const n=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=n):null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime||(this.startTime=e??n),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(p.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}const ge={anticipate:gt,backInOut:vt,circInOut:Tt};function we(t){"string"==typeof t.ease&&t.ease in ge&&(t.ease=ge[t.ease])}class be extends S{constructor(t){we(t),fe(t),super(t),void 0!==t.startTime&&!1!==t.autoplay&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:e,onUpdate:n,onComplete:i,element:s,...r}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);const o=new ve({...r,autoplay:!1}),a=Math.max(10,p.now()-this.startTime),u=v(0,10,a-10),l=o.sample(a).value,{name:c}=this.options;s&&c&&M(s,c,l),e.setWithVelocity(o.sample(Math.max(0,a-u)).value,l,u),o.stop()}}const Te=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!c.test(t)&&"0"!==t||t.startsWith("url(")));function xe(t){t.duration=0,t.type="keyframes"}const Ae=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;const Se=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),Me=E(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function ke(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:s,damping:r,type:o,keyframes:a}=t,u=e?.owner?.current;if(!(u instanceof HTMLElement||u instanceof SVGElement))return!1;const{onUpdate:l,transformTemplate:c}=e.owner.getProps();return Me()&&n&&(C.has(n)||Se.has(n)&&function(t){for(let e=0;e{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=p.now();const h={autoplay:t,delay:e,type:n,repeat:i,repeatDelay:s,repeatType:r,name:a,motionValue:u,element:l,...c},d=l?.KeyframeResolver||V;this.keyframeResolver=new d(o,(t,e,n)=>this.onKeyframesResolved(t,e,h,!n),a,u,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,n,i,s){this.keyframeResolver=void 0;const{name:r,type:o,velocity:u,delay:l,isHandoff:c,onUpdate:h}=i;this.resolvedAt=p.now();let d=!0;(function(t,e,n,i){const s=t[0];if(null===s)return!1;if("display"===e||"visibility"===e)return!0;const r=t[t.length-1],o=Te(s,e),u=Te(r,e);return a(o===u,`You are trying to animate ${e} from "${s}" to "${r}". "${o?r:s}" is not an animatable value.`,"value-not-animatable"),!(!o||!u)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:n,...i,keyframes:e},f=d&&!c&&ke(m),y=m.motionValue?.owner?.current;let v;if(f)try{v=new be({...m,element:y})}catch{v=new ve(m)}else v=new ve(m);v.finished.then(()=>{this.notifyFinished()}).catch(t),this.pendingTimeline&&(this.stopTimeline=v.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=v}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),P()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function Ee(t,e,n,i=0,s=1){const r=Array.from(t).sort((t,e)=>t.sortNodePosition(e)).indexOf(e),o=t.size,a=(o-1)*i;return"function"==typeof n?n(r,o):1===s?r*i:a-r*i}function Ve(t,e){if(t?.inherit&&e){const{inherit:n,...i}=t;return{...e,...i}}return t}function Pe(t,e){const n=t?.[e]??t?.default??t;return n!==t?Ve(n,t):n}const De={type:"spring",stiffness:500,damping:25,restSpeed:10},Oe={type:"keyframes",duration:.8},Ie={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Fe=(t,{keyframes:e})=>e.length>2?Oe:D.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:De:Ie,Le=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);const Re=(t,e,n,i={},s,r)=>o=>{const a=Pe(i,t)||{},u=a.delay||i.delay||0;let{elapsed:l=0}=i;l-=w(u);const c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-l,onUpdate:t=>{e.set(t),a.onUpdate&&a.onUpdate(t)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:r?void 0:s};(function(t){for(const e in t)if(!Le.has(e))return!0;return!1})(a)||Object.assign(c,Fe(t,c)),c.duration&&(c.duration=w(c.duration)),c.repeatDelay&&(c.repeatDelay=w(c.repeatDelay)),void 0!==c.from&&(c.keyframes[0]=c.from);let h=!1;if((!1===c.type||0===c.duration&&!c.repeatDelay)&&(xe(c),0===c.delay&&(h=!0)),(T.instantAnimations||T.skipAnimations||s?.shouldSkipAnimations||a.skipAnimations)&&(h=!0,xe(c),c.delay=0),c.allowFlatten=!a.type&&!a.ease,h&&!r&&void 0!==e.get()){const t=A(c.keyframes,a);if(void 0!==t)return void f.update(()=>{c.onUpdate(t),c.onComplete()})}return a.isSync?new ve(c):new Ce(c)},Ke=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Be(t,e,i=1){n(i<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[s,r]=function(t){const e=Ke.exec(t);if(!e)return[,];const[,n,i,s]=e;return[`--${n??i}`,s]}(t);if(!s)return;const o=window.getComputedStyle(e).getPropertyValue(s);if(o){const t=o.trim();return O(t)?parseFloat(t):t}return u(r)?Be(r,e,i+1):r}function je(t,e,n){const i=t.getProps();return I(i,e,void 0!==n?n:i.custom,t)}const Ge=new Set(["width","height","top","left","right","bottom",...F]),qe=t=>Array.isArray(t);function He(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,L(n))}function Ne(t){return qe(t)?t[t.length-1]||0:t}function Ue(t,e){const n=t.getValue("willChange");if(i=n,Boolean(R(i)&&i.add))return n.add(e);if(!n&&T.WillChange){const n=new T.WillChange("auto");t.addValue("willChange",n),n.add(e)}var i}function $e(t){return t.props[K]}function We({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}function _e(t,e,{delay:n=0,transitionOverride:i,type:s}={}){let{transition:r,transitionEnd:o,...a}=e;const u=t.getDefaultTransition();r=r?Ve(r,u):u;const l=r?.reduceMotion,c=r?.skipAnimations;i&&(r=i);const h=[],d=s&&t.animationState&&t.animationState.getState()[s],p=r?.path;p&&p.animateVisualElement(t,a,r,n,h);for(const e in a){const i=t.getValue(e,t.latestValues[e]??null),s=a[e];if(void 0===s||d&&We(d,e))continue;const o={delay:n,...Pe(r||{},e)};c&&(o.skipAnimations=!0);const u=i.get();if(void 0!==u&&!i.isAnimating()&&!Array.isArray(s)&&s===u&&!o.velocity){f.update(()=>i.set(s));continue}let p=!1;if(window.MotionHandoffAnimation){const n=$e(t);if(n){const t=window.MotionHandoffAnimation(n,e,f);null!==t&&(o.startTime=t,p=!0)}}Ue(t,e);const m=l??t.shouldReduceMotion;i.start(Re(e,i,s,m&&Ge.has(e)?{type:!1}:o,t,p));const y=i.animation;y&&h.push(y)}if(o){const e=()=>f.update(()=>{o&&function(t,e){const n=je(t,e);let{transitionEnd:i={},transition:s={},...r}=n||{};r={...r,...i};for(const e in r)He(t,e,Ne(r[e]))}(t,o)});h.length?Promise.all(h).then(e):e()}return h}function ze(t,e,n={}){const i=je(t,e,"exit"===n.type?t.presenceContext?.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const r=i?()=>Promise.all(_e(t,i,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(i=0)=>{const{delayChildren:r=0,staggerChildren:o,staggerDirection:a}=s;return function(t,e,n=0,i=0,s=0,r=1,o){const a=[];for(const u of t.variantChildren)u.notify("AnimationStart",e),a.push(ze(u,e,{...o,delay:n+("function"==typeof i?0:i)+Ee(t.variantChildren,u,i,s,r)}).then(()=>u.notify("AnimationComplete",e)));return Promise.all(a)}(t,e,i,r,o,a,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[t,e]="beforeChildren"===a?[r,o]:[o,r];return t().then(()=>e())}return Promise.all([r(),o(n.delay)])}function Ye(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||B(t))}const Xe=new Set(["auto","none","0"]);class Je extends V{constructor(t,e,n,i,s){super(t,e,n,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n{t.getValue(e).set(n)}),this.resolveNoneKeyframes()}}const Ze=!1;function Qe(t,e){const n=function(t,e,n){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){let e=document;const i=n?.[t]??e.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t).filter(t=>null!=t)}(t),i=new AbortController;return[n,{passive:!0,...e,signal:i.signal},()=>i.abort()]}function tn(t){return!("touch"===t.pointerType||Ze)}function en(t,e,n={}){const[i,s,r]=Qe(t,n);return i.forEach(t=>{let n,i=!1,r=!1;const o=e=>{n&&(n(e),n=void 0),t.removeEventListener("pointerleave",u)},a=t=>{i=!1,window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",a),r&&(r=!1,o(t))},u=t=>{"touch"!==t.pointerType&&(i?r=!0:o(t))};t.addEventListener("pointerenter",i=>{if(!tn(i))return;r=!1;const o=e(t,i);"function"==typeof o&&(n=o,t.addEventListener("pointerleave",u,s))},s),t.addEventListener("pointerdown",()=>{i=!0,window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",a,s)},s)}),r}const nn=(t,e)=>!!e&&(t===e||nn(t,e.parentElement)),sn=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const rn=new WeakSet;function on(t){return e=>{"Enter"===e.key&&t(e)}}function an(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function un(t){return(t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary)(t)&&!0}const ln=new WeakSet;function cn(t,e,n={}){const[i,s,r]=Qe(t,n),o=t=>{const i=t.currentTarget;if(!un(t))return;if(ln.has(t))return;rn.add(i),n.stopPropagation&&ln.add(t);const r=e(i,t),o={...s,capture:!0},a=(t,e)=>{window.removeEventListener("pointerup",u,o),window.removeEventListener("pointercancel",l,o),rn.has(i)&&rn.delete(i),un(t)&&"function"==typeof r&&r(t,{success:e})},u=t=>{a(t,i===window||i===document||n.useGlobalTarget||nn(i,t.target))},l=t=>{a(t,!1)};window.addEventListener("pointerup",u,o),window.addEventListener("pointercancel",l,o)};return i.forEach(t=>{var e,i;(n.useGlobalTarget?window:t).addEventListener("pointerdown",o,s),"object"==typeof(i=e=t)&&null!==i&&"offsetHeight"in e&&!("ownerSVGElement"in e)&&(t.addEventListener("focus",t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const i=on(()=>{if(rn.has(n))return;an(n,"down");const t=on(()=>{an(n,"up")});n.addEventListener("keyup",t,e),n.addEventListener("blur",()=>an(n,"cancel"),e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)})(t,s)),function(t){return sn.has(t.tagName)||!0===t.isContentEditable}(t)||t.hasAttribute("tabindex")||(t.tabIndex=0))}),r}class hn extends U{constructor(){super(...arguments),this.KeyframeResolver=Je}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){const n=t.style;return n?n[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;R(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}class dn{constructor(t){this.isMounted=!1,this.node=t}update(){}}function pn(t,{style:e,vars:n},i,s){const r=t.style;let o;for(o in e)r[o]=e[o];for(o in s?.applyProjectionStyles(r,i),n)r.setProperty(o,n[o])}class mn extends hn{constructor(){super(...arguments),this.type="html",this.renderInstance=pn}mount(t){n(Boolean(t.style),"motion.create() components must forward their ref to a HTML or SVG element","custom-component-ref"),super.mount(t)}readValueFromInstance(t,e){if(D.has(e))return this.projection?.isProjecting?$(e):W(t,e);{const i=(n=t,window.getComputedStyle(n)),s=(_(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof s?s.trim():s}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return function(t,e){return function({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),i=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}(t.getBoundingClientRect(),e))}(t,e)}build(t,e,n){z(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return Y(t,e,n)}}const fn=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);class yn extends hn{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=J}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(D.has(e)){const t=nt(e);return t&&t.default||0}if(Z.includes(e)){const n=getComputedStyle(t)[e];if("string"==typeof n&&n)return n.trim()}return e=fn.has(e)?e:X(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return Q(t,e,n)}build(t,e,n){tt(t,e,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,e,n,i){!function(t,e,n,i){pn(t,e,void 0,i);for(const n in e.attrs)t.setAttribute(fn.has(n)?n:X(n),e.attrs[n])}(t,e,0,i)}mount(t){this.isSVGTag=et(t.tagName),super.mount(t)}}const vn=st.length;function gn(t){if(!t)return;if(!t.isControllingVariants){const e=t.parent&&gn(t.parent)||{};return void 0!==t.props.initial&&(e.initial=t.props.initial),e}const e={};for(let n=0;nPromise.all(e.map(({animation:e,options:n})=>function(t,e,n={}){let i;if(t.notify("AnimationStart",e),Array.isArray(e)){const s=e.map(e=>ze(t,e,n));i=Promise.all(s)}else if("string"==typeof e)i=ze(t,e,n);else{const s="function"==typeof e?je(t,e,n.custom):e;i=Promise.all(_e(t,s,n))}return i.then(()=>{t.notify("AnimationComplete",e)})}(t,e,n)))}function An(t){let e=xn(t),n=kn(),i=!0,s=!1;const r=e=>(n,i)=>{const s=je(t,i,"exit"===e?t.presenceContext?.custom:void 0);if(s){const{transition:t,transitionEnd:e,...i}=s;n={...n,...i,...e}}return n};function o(o){const{props:a}=t,u=gn(t.parent)||{},l=[],c=new Set;let h={},d=1/0;for(let e=0;ed&&y,T=!1;const x=Array.isArray(f)?f:[f];let A=x.reduce(r(p),{});!1===v&&(A={});const{prevResolvedValues:S={}}=m,M={...S,...A},k=e=>{b=!0,c.has(e)&&(T=!0,c.delete(e)),m.needsAnimating[e]=!0;const n=t.getValue(e);n&&(n.liveStyle=!1)};for(const t in M){const e=A[t],n=S[t];if(h.hasOwnProperty(t))continue;let i=!1;i=qe(e)&&qe(n)?!wn(e,n)||w:e!==n,i?null!=e?k(t):c.add(t):void 0!==e&&c.has(t)?k(t):m.protectedKeys[t]=!0}m.prevProp=f,m.prevResolvedValues=A,m.isActive&&(h={...h,...A}),(i||s)&&t.blockInitialAnimation&&(b=!1);const C=g&&w;b&&(!C||T)&&l.push(...x.map(e=>{const n={type:p};if("string"==typeof e&&(i||s)&&!C&&t.manuallyAnimateOnMount&&t.parent){const{parent:i}=t,s=je(i,e);if(i.enteringChildren&&s){const{delayChildren:e}=s.transition||{};n.delay=Ee(i.enteringChildren,t,e)}}return{animation:e,options:n}}))}if(c.size){const e={};if("boolean"!=typeof a.initial){const n=je(t,Array.isArray(a.initial)?a.initial[0]:a.initial);n&&n.transition&&(e.transition=n.transition)}c.forEach(n=>{const i=t.getBaseTarget(n),s=t.getValue(n);s&&(s.liveStyle=!0),e[n]=i??null}),l.push({animation:e})}let p=Boolean(l.length);return!i||!1!==a.initial&&a.initial!==a.animate||t.manuallyAnimateOnMount||(p=!1),i=!1,s=!1,p?e(l):Promise.resolve()}return{animateChanges:o,setActive:function(e,i){if(n[e].isActive===i)return Promise.resolve();t.variantChildren?.forEach(t=>t.animationState?.setActive(e,i)),n[e].isActive=i;const s=o(e);for(const t in n)n[t].protectedKeys={};return s},setAnimateFunction:function(n){e=n(t)},getState:()=>n,reset:()=>{n=kn(),s=!0}}}function Sn(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!wn(e,t)}function Mn(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function kn(){return{animate:Mn(!0),whileInView:Mn(),whileHover:Mn(),whileTap:Mn(),whileDrag:Mn(),whileFocus:Mn(),exit:Mn()}}function Cn(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n,i)}let En=0;const Vn={animation:{Feature:class extends dn{constructor(t){super(t),t.animationState||(t.animationState=An(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();rt(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}},exit:{Feature:class extends dn{constructor(){super(...arguments),this.id=En++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:e}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===n)return;if(t&&!1===n){if(this.isExitComplete){const{initial:t,custom:e}=this.node.getProps();if("string"==typeof t||"object"==typeof t&&null!==t&&!Array.isArray(t)){const n=je(this.node,t,e);if(n){const{transition:t,transitionEnd:e,...i}=n;for(const t in i)this.node.getValue(t)?.jump(i[t])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);return void(this.isExitComplete=!1)}const i=this.node.animationState.setActive("exit",!t);e&&!t&&i.then(()=>{this.isExitComplete=!0,e(this.id)})}mount(){const{register:t,onExitComplete:e}=this.node.presenceContext||{};e&&e(this.id),t&&(this.unmount=t(this.id))}unmount(){}}}};function Pn(t){return{point:{x:t.pageX,y:t.pageY}}}function Dn(t,e,n){const{props:i}=t;t.animationState&&i.whileHover&&t.animationState.setActive("whileHover","Start"===n);const s=i["onHover"+n];s&&f.postRender(()=>s(e,Pn(e)))}function On(t,e,n){const{props:i}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&i.whileTap&&t.animationState.setActive("whileTap","Start"===n);const s=i["onTap"+("End"===n?"":n)];s&&f.postRender(()=>s(e,Pn(e)))}const In=new WeakMap,Fn=new WeakMap,Ln=t=>{const e=In.get(t.target);e&&e(t)},Rn=t=>{t.forEach(Ln)};function Kn(t,e,n){const i=function({root:t,...e}){const n=t||document;Fn.has(n)||Fn.set(n,{});const i=Fn.get(n),s=JSON.stringify(e);return i[s]||(i[s]=new IntersectionObserver(Rn,{root:t,...e})),i[s]}(e);return In.set(t,n),i.observe(t),()=>{In.delete(t),i.unobserve(t)}}const Bn={some:0,all:1};const jn={renderer:(t,e)=>e.isSVG??at(t)?new yn(e):new mn(e,{allowProjection:t!==ut}),...Vn,...{inView:{Feature:class extends dn{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:t={}}=this.node.getProps(),{root:e,margin:n,amount:i="some",once:s}=t,r={root:e?e.current:void 0,rootMargin:n,threshold:"number"==typeof i?i:Bn[i]};this.stopObserver=Kn(this.node.current,r,t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,s&&!e&&this.hasEnteredView)return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);const{onViewportEnter:n,onViewportLeave:i}=this.node.getProps(),r=e?n:i;r&&r(t)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}(t,e))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}},tap:{Feature:class extends dn{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:e,propagate:n}=this.node.props;this.unmount=cn(t,(t,e)=>(On(this.node,e,"Start"),(t,{success:e})=>On(this.node,t,e?"End":"Cancel")),{useGlobalTarget:e,stopPropagation:!1===n?.tap})}unmount(){}}},focus:{Feature:class extends dn{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){t=!0}t&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=lt(Cn(this.node.current,"focus",()=>this.onFocus()),Cn(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends dn{mount(){const{current:t}=this.node;t&&(this.unmount=en(t,(t,e)=>(Dn(this.node,e,"Start"),t=>Dn(this.node,t,"End"))))}unmount(){}}}}};export{jn as domAnimation}; diff --git a/node_modules/framer-motion/dist/size-rollup-dom-max-assets.js b/node_modules/framer-motion/dist/size-rollup-dom-max-assets.js new file mode 100644 index 0000000..fbd0595 --- /dev/null +++ b/node_modules/framer-motion/dist/size-rollup-dom-max-assets.js @@ -0,0 +1 @@ +import{createContext as t}from"react";function e(t,e){-1===t.indexOf(e)&&t.push(e)}function s(t,e){const s=t.indexOf(e);s>-1&&t.splice(s,1)}const n=(t,e,s)=>s>e?e:s{},r=()=>{};"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(a=(t,e,s)=>{t||"undefined"==typeof console||console.warn(i(e,s))},r=(t,e,s)=>{if(!t)throw new Error(i(e,s))});const o={},h=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),l=t=>/^0[^.\s]+$/u.test(t);function u(t){let e;return()=>(void 0===e&&(e=t()),e)}const c=t=>t;class d{constructor(){this.subscriptions=[]}add(t){return e(this.subscriptions,t),()=>s(this.subscriptions,t)}notify(t,e,s){const n=this.subscriptions.length;if(n)if(1===n)this.subscriptions[0](t,e,s);else for(let i=0;i1e3*t,f=t=>t/1e3,m=(t,e)=>e?t*(1e3/e):0,g=t=>Array.isArray(t)&&"number"==typeof t[0],v=t({}),y=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function b(t,e){let s=!1,n=!0;const i={delta:0,timestamp:0,isProcessing:!1},a=()=>s=!0,r=y.reduce((t,e)=>(t[e]=function(t){let e=new Set,s=new Set,n=!1,i=!1;const a=new WeakSet;let r={delta:0,timestamp:0,isProcessing:!1};function o(e){a.has(e)&&(h.schedule(e),t()),e(r)}const h={schedule:(t,i=!1,r=!1)=>{const o=r&&n?e:s;return i&&a.add(t),o.add(t),t},cancel:t=>{s.delete(t),a.delete(t)},process:t=>{if(r=t,n)return void(i=!0);n=!0;const a=e;e=s,s=a,e.forEach(o),e.clear(),n=!1,i&&(i=!1,h.process(t))}};return h}(a),t),{}),{setup:h,read:l,resolveKeyframes:u,preUpdate:c,update:d,preRender:p,render:f,postRender:m}=r,g=()=>{const a=o.useManualTiming,r=a?i.timestamp:performance.now();s=!1,a||(i.delta=n?1e3/60:Math.max(Math.min(r-i.timestamp,40),1)),i.timestamp=r,i.isProcessing=!0,h.process(i),l.process(i),u.process(i),c.process(i),d.process(i),p.process(i),f.process(i),m.process(i),i.isProcessing=!1,s&&e&&(n=!1,t(g))};return{schedule:y.reduce((e,a)=>{const o=r[a];return e[a]=(e,a=!1,r=!1)=>(s||(s=!0,n=!0,i.isProcessing||t(g)),o.schedule(e,a,r)),e},{}),cancel:t=>{for(let e=0;e(void 0===T&&A.set(S.isProcessing||o.useManualTiming?S.timestamp:performance.now()),T),set:t=>{T=t,queueMicrotask(x)}},C=t=>e=>"string"==typeof e&&e.startsWith(t),k=C("--"),F=C("var(--"),E=t=>!!F(t)&&P.test(t.split("/*")[0].trim()),P=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function R(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const B={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},I={...B,transform:t=>n(0,1,t)},N={...B,default:1},O=t=>Math.round(1e5*t)/1e5,$=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const L=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Y=(t,e)=>s=>Boolean("string"==typeof s&&L.test(s)&&s.startsWith(t)||e&&!function(t){return null==t}(s)&&Object.prototype.hasOwnProperty.call(s,e)),W=(t,e,s)=>n=>{if("string"!=typeof n)return n;const[i,a,r,o]=n.match($);return{[t]:parseFloat(i),[e]:parseFloat(a),[s]:parseFloat(r),alpha:void 0!==o?parseFloat(o):1}},X={...B,transform:t=>Math.round((t=>n(0,255,t))(t))},j={test:Y("rgb","red"),parse:W("red","green","blue"),transform:({red:t,green:e,blue:s,alpha:n=1})=>"rgba("+X.transform(t)+", "+X.transform(e)+", "+X.transform(s)+", "+O(I.transform(n))+")"};const z={test:Y("#"),parse:function(t){let e="",s="",n="",i="";return t.length>5?(e=t.substring(1,3),s=t.substring(3,5),n=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),s=t.substring(2,3),n=t.substring(3,4),i=t.substring(4,5),e+=e,s+=s,n+=n,i+=i),{red:parseInt(e,16),green:parseInt(s,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}},transform:j.transform},K=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),U=K("deg"),Z=K("%"),D=K("px"),q=K("vh"),H=K("vw"),_=(()=>({...Z,parse:t=>Z.parse(t)/100,transform:t=>Z.transform(100*t)}))(),G={test:Y("hsl","hue"),parse:W("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:s,alpha:n=1})=>"hsla("+Math.round(t)+", "+Z.transform(O(e))+", "+Z.transform(O(s))+", "+O(I.transform(n))+")"},J={test:t=>j.test(t)||z.test(t)||G.test(t),parse:t=>j.test(t)?j.parse(t):G.test(t)?G.parse(t):z.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?j.transform(t):G.transform(t),getAnimatableNone:t=>{const e=J.parse(t);return e.alpha=0,J.transform(e)}},Q=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const tt="number",et="color",st=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function nt(t){const e=t.toString(),s=[],n={color:[],number:[],var:[]},i=[];let a=0;const r=e.replace(st,t=>(J.test(t)?(n.color.push(a),i.push(et),s.push(J.parse(t))):t.startsWith("var(")?(n.var.push(a),i.push("var"),s.push(t)):(n.number.push(a),i.push(tt),s.push(parseFloat(t))),++a,"${}")).split("${}");return{values:s,split:r,indexes:n,types:i}}function it({split:t,types:e}){const s=t.length;return n=>{let i="";for(let a=0;a{return"number"==typeof t?e?.trim().endsWith("/")?t:0:"number"==typeof(s=t)?0:J.test(s)?J.getAnimatableNone(s):s;var s};const rt={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match($)?.length||0)+(t.match(Q)?.length||0)>0},parse:function(t){return nt(t).values},createTransformer:function(t){return it(nt(t))},getAnimatableNone:function(t){const e=nt(t);return it(e)(e.values.map((t,s)=>at(t,e.split[s])))}},ot=(t,e,s)=>t+(e-t)*s,ht=(t,e,s=10)=>{let n="";const i=Math.max(Math.round(e/s),2);for(let e=0;enull!==t;function ut(t,{repeat:e,repeatType:s="loop"},n,i=1){const a=t.filter(lt),r=i<0||e&&"loop"!==s&&e%2==1?0:a.length-1;return r&&void 0!==n?n:a[r]}class ct{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const dt=t=>180*t/Math.PI,pt=t=>{const e=dt(Math.atan2(t[1],t[0]));return mt(e)},ft={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:pt,rotateZ:pt,skewX:t=>dt(Math.atan(t[1])),skewY:t=>dt(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},mt=t=>((t%=360)<0&&(t+=360),t),gt=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),vt=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),yt={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:gt,scaleY:vt,scale:t=>(gt(t)+vt(t))/2,rotateX:t=>mt(dt(Math.atan2(t[6],t[5]))),rotateY:t=>mt(dt(Math.atan2(-t[2],t[0]))),rotateZ:pt,rotate:pt,skewX:t=>dt(Math.atan(t[4])),skewY:t=>dt(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function bt(t){return t.includes("scale")?1:0}function wt(t,e){if(!t||"none"===t)return bt(e);const s=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let n,i;if(s)n=yt,i=s;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);n=ft,i=e}if(!i)return bt(e);const a=n[e],r=i[1].split(",").map(St);return"function"==typeof a?a(r):r[a]}const Vt=(t,e)=>{const{transform:s="none"}=getComputedStyle(t);return wt(s,e)};function St(t){return parseFloat(t.trim())}const Mt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Tt=(()=>new Set([...Mt,"pathRotation"]))(),xt=t=>t===B||t===D,At=new Set(["x","y","z"]),Ct=Mt.filter(t=>!At.has(t));const kt={width:({x:t},{paddingLeft:e="0",paddingRight:s="0",boxSizing:n})=>{const i=t.max-t.min;return"border-box"===n?i:i-parseFloat(e)-parseFloat(s)},height:({y:t},{paddingTop:e="0",paddingBottom:s="0",boxSizing:n})=>{const i=t.max-t.min;return"border-box"===n?i:i-parseFloat(e)-parseFloat(s)},top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>wt(e,"x"),y:(t,{transform:e})=>wt(e,"y")};kt.translateX=kt.x,kt.translateY=kt.y;const Ft=new Set;let Et=!1,Pt=!1,Rt=!1;function Bt(){if(Pt){const t=Array.from(Ft).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),s=new Map;e.forEach(t=>{const e=function(t){const e=[];return Ct.forEach(s=>{const n=t.getValue(s);void 0!==n&&(e.push([s,n.get()]),n.set(s.startsWith("scale")?1:0))}),e}(t);e.length&&(s.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=s.get(t);e&&e.forEach(([e,s])=>{t.getValue(e)?.set(s)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}Pt=!1,Et=!1,Ft.forEach(t=>t.complete(Rt)),Ft.clear()}function It(){Ft.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Pt=!0)})}function Nt(){Rt=!0,It(),Bt(),Rt=!1}class Ot{constructor(t,e,s,n,i,a=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=s,this.motionValue=n,this.element=i,this.isAsync=a}scheduleResolve(){this.state="scheduled",this.isAsync?(Ft.add(this),Et||(Et=!0,w.read(It),w.resolveKeyframes(Bt))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:s,motionValue:n}=this;if(null===t[0]){const i=n?.get(),a=t[t.length-1];if(void 0!==i)t[0]=i;else if(s&&e){const n=s.readValue(e,a);null!=n&&(t[0]=n)}void 0===t[0]&&(t[0]=a),n&&void 0===i&&n.set(t[0])}!function(t){for(let e=1;et.startsWith("--"))(e)?t.style.setProperty(e,s):t.style[e]=s}const Lt={};function Yt(t,e){const s=u(t);return()=>Lt[e]??s()}const Wt=Yt(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),Xt=Yt(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),jt=([t,e,s,n])=>`cubic-bezier(${t}, ${e}, ${s}, ${n})`,zt={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:jt([0,.65,.55,1]),circOut:jt([.55,0,1,.45]),backIn:jt([.31,.01,.66,-.59]),backOut:jt([.33,1.53,.69,.99])};function Kt(t,e){return t?"function"==typeof t?Xt()?ht(t,e):"ease-out":g(t)?jt(t):Array.isArray(t)?t.map(t=>Kt(t,e)||zt.easeOut):zt[t]:void 0}function Ut(t,e,s,{delay:n=0,duration:i=300,repeat:a=0,repeatType:r="loop",ease:o="easeOut",times:h}={},l=void 0){const u={[e]:s};h&&(u.offset=h);const c=Kt(o,i);Array.isArray(c)&&(u.easing=c);const d={delay:n,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:a+1,direction:"reverse"===r?"alternate":"normal"};return l&&(d.pseudoElement=l),t.animate(u,d)}function Zt(t){return"function"==typeof t&&"applyToOptions"in t}class Dt extends ct{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:e,name:s,keyframes:n,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:h}=t;this.isPseudoElement=Boolean(i),this.allowFlatten=a,this.options=t,r("string"!=typeof t.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const l=function({type:t,...e}){return Zt(t)&&Xt()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=Ut(e,s,n,l,i),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const t=ut(n,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(t),$t(e,s,t),this.animation.cancel()}h?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return f(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+f(t)}get time(){return f(Number(this.animation.currentTime)||0)}set time(t){const e=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=p(t),e&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:e,rangeEnd:s,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&Wt()?(this.animation.timeline=t,e&&(this.animation.rangeStart=e),s&&(this.animation.rangeEnd=s),c):n(this)}}const qt=new Set(["opacity","clipPath","filter","transform","backgroundColor"]);class Ht{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=A.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=A.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new d);const s=this.events[t].add(e);return"change"===t?()=>{s(),w.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,s){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-s}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=A.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return m(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function _t(t,e){return new Ht(t,e)}function Gt(t){const e=[{},{}];return t?.values.forEach((t,s)=>{e[0][s]=t.get(),e[1][s]=t.getVelocity()}),e}function Jt(t,e,s,n){if("function"==typeof e){const[i,a]=Gt(n);e=e(void 0!==s?s:t.custom,i,a)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[i,a]=Gt(n);e=e(void 0!==s?s:t.custom,i,a)}return e}const Qt=t=>Boolean(t&&t.getVelocity);function te(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const ee="data-"+te("framerAppearId"),se=t=>e=>e.test(t),ne=[B,D,Z,U,H,q,{test:t=>"auto"===t,parse:t=>t}],ie=t=>ne.find(se(t)),ae=new Set(["brightness","contrast","saturate","opacity"]);function re(t){const[e,s]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[n]=s.match($)||[];if(!n)return t;const i=s.replace(n,"");let a=ae.has(e)?1:0;return n!==s&&(a*=100),e+"("+a+i+")"}const oe=/\b([a-z-]*)\(.*?\)/gu,he={...rt,getAnimatableNone:t=>{const e=t.match(oe);return e?e.map(re).join(" "):t}},le={...rt,getAnimatableNone:t=>{const e=rt.parse(t);return rt.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},ue={...B,transform:Math.round},ce={borderWidth:D,borderTopWidth:D,borderRightWidth:D,borderBottomWidth:D,borderLeftWidth:D,borderRadius:D,borderTopLeftRadius:D,borderTopRightRadius:D,borderBottomRightRadius:D,borderBottomLeftRadius:D,width:D,maxWidth:D,height:D,maxHeight:D,top:D,right:D,bottom:D,left:D,inset:D,insetBlock:D,insetBlockStart:D,insetBlockEnd:D,insetInline:D,insetInlineStart:D,insetInlineEnd:D,padding:D,paddingTop:D,paddingRight:D,paddingBottom:D,paddingLeft:D,paddingBlock:D,paddingBlockStart:D,paddingBlockEnd:D,paddingInline:D,paddingInlineStart:D,paddingInlineEnd:D,margin:D,marginTop:D,marginRight:D,marginBottom:D,marginLeft:D,marginBlock:D,marginBlockStart:D,marginBlockEnd:D,marginInline:D,marginInlineStart:D,marginInlineEnd:D,fontSize:D,backgroundPositionX:D,backgroundPositionY:D,...{rotate:U,pathRotation:U,rotateX:U,rotateY:U,rotateZ:U,scale:N,scaleX:N,scaleY:N,scaleZ:N,skew:U,skewX:U,skewY:U,distance:D,translateX:D,translateY:D,translateZ:D,x:D,y:D,z:D,perspective:D,transformPerspective:D,opacity:I,originX:_,originY:_,originZ:D},zIndex:ue,fillOpacity:I,strokeOpacity:I,numOctaves:ue},de={...ce,color:J,backgroundColor:J,outlineColor:J,fill:J,stroke:J,borderColor:J,borderTopColor:J,borderRightColor:J,borderBottomColor:J,borderLeftColor:J,filter:he,WebkitFilter:he,mask:le,WebkitMask:le},pe=t=>de[t],fe=new Set([he,le]);function me(t,e){let s=pe(t);return fe.has(s)||(s=rt),s.getAnimatableNone?s.getAnimatableNone(e):void 0}const ge=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"],ve=(t,e)=>e&&"number"==typeof t?e.transform(t):t,{schedule:ye}=b(queueMicrotask,!1),be=[...ne,J,rt],we=()=>({x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}),Ve=()=>({x:{min:0,max:0},y:{min:0,max:0}}),Se=new WeakMap;function Me(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function Te(t){return"string"==typeof t||Array.isArray(t)}const xe=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Ae=["initial",...xe];function Ce(t){return Me(t.animate)||Ae.some(e=>Te(t[e]))}function ke(t){return Boolean(Ce(t)||t.variants)}const Fe={current:null},Ee={current:!1},Pe="undefined"!=typeof window;const Re=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Be={};function Ie(t){Be=t}function Ne(){return Be}class Oe{scrapeMotionValuesFromProps(t,e,s){return{}}constructor({parent:t,props:e,presenceContext:s,reducedMotionConfig:n,skipAnimations:i,blockInitialAnimation:a,visualState:r},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Ot,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const t=A.now();this.renderScheduledAtthis.bindToMotionValue(e,t)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(Ee.current||function(){if(Ee.current=!0,Pe)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Fe.current=t.matches;t.addEventListener("change",e),e()}else Fe.current=!1}(),this.shouldReduceMotion=Fe.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),V(this.notifyUpdate),V(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,e){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),e.accelerate&&qt.has(t)&&this.current instanceof HTMLElement){const{factory:s,keyframes:n,times:i,ease:a,duration:r}=e.accelerate,o=new Dt({element:this.current,name:t,keyframes:n,times:i,ease:a,duration:p(r)}),h=s(o);return void this.valueSubscriptions.set(t,()=>{h(),o.cancel()})}const s=Tt.has(t);s&&this.onBindTransform&&this.onBindTransform();const n=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&w.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{n(),i&&i()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in Be){const e=Be[t];if(!e)continue;const{isEnabled:s,Feature:n}=e;if(!this.features[t]&&n&&s(this.props)&&(this.features[t]=new n(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;ee.variantChildren.delete(t)}addValue(t,e){const s=this.values.get(t);e!==s&&(s&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let s=this.values.get(t);return void 0===s&&void 0!==e&&(s=_t(null===e?void 0:e,{owner:this}),this.addValue(t,s)),s}readValue(t,e){let s=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var n;return null!=s&&("string"==typeof s&&(h(s)||l(s))?s=parseFloat(s):(n=s,!be.find(se(n))&&rt.test(e)&&(s=me(t,e))),this.setBaseTarget(t,Qt(s)?s.get():s)),Qt(s)?s.get():s}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let s;if("string"==typeof e||"object"==typeof e){const n=Jt(this.props,e,this.presenceContext?.custom);n&&(s=n[t])}if(e&&void 0!==s)return s;const n=this.getBaseTargetFromProps(this.props,t);return void 0===n||Qt(n)?void 0!==this.initialValues[t]&&void 0===s?void 0:this.baseTarget[t]:n}on(t,e){return this.events[t]||(this.events[t]=new d),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){ye.render(this.render)}}const $e={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Le=Mt.length;function Ye(t,e,s){const{style:n,vars:i,transformOrigin:a}=t;let r=!1,o=!1;for(const t in e){const s=e[t];if(Tt.has(t))r=!0;else if(k(t))i[t]=s;else{const e=ve(s,ce[t]);t.startsWith("origin")?(o=!0,a[t]=e):n[t]=e}}if(e.transform||(r||s?n.transform=function(t,e,s){let n="",i=!0;for(let a=0;a{if(!e.target)return t;if("string"==typeof t){if(!D.test(t))return t;t=parseFloat(t)}return`${We(t,e.target.x)}% ${We(t,e.target.y)}%`}},je={correct:(t,{treeScale:e,projectionDelta:s})=>{const n=t,i=rt.parse(t);if(i.length>5)return n;const a=rt.createTransformer(t),r="number"!=typeof i[0]?1:0,o=s.x.scale*e.x,h=s.y.scale*e.y;i[0+r]/=o,i[1+r]/=h;const l=ot(o,h,.5);return"number"==typeof i[2+r]&&(i[2+r]/=l),"number"==typeof i[3+r]&&(i[3+r]/=l),a(i)}},ze={borderRadius:{...Xe,applyTo:[...ge]},borderTopLeftRadius:Xe,borderTopRightRadius:Xe,borderBottomLeftRadius:Xe,borderBottomRightRadius:Xe,boxShadow:je};function Ke(t,{layout:e,layoutId:s}){return Tt.has(t)||t.startsWith("origin")||(e||void 0!==s)&&(!!ze[t]||"opacity"===t)}function Ue(t,e,s){const n=t.style,i=e?.style,a={};if(!n)return a;for(const e in n)(Qt(n[e])||i&&Qt(i[e])||Ke(e,t)||void 0!==s?.getValue(e)?.liveStyle)&&(a[e]=n[e]);return a}const Ze={offset:"stroke-dashoffset",array:"stroke-dasharray"},De={offset:"strokeDashoffset",array:"strokeDasharray"};const qe=["transform","opacity","offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function He(t,{attrX:e,attrY:s,attrScale:n,pathLength:i,pathSpacing:a=1,pathOffset:r=0,...o},h,l,u){if(Ye(t,o,l),h)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:c,style:d}=t;for(const t of qe)void 0!==c[t]&&(d[t]=c[t],delete c[t]);(d.transform||c.transformOrigin)&&(d.transformOrigin=c.transformOrigin??"50% 50%",delete c.transformOrigin),d.transform&&(d.transformBox=u?.transformBox??"fill-box",delete c.transformBox),void 0!==e&&(c.x=e),void 0!==s&&(c.y=s),void 0!==n&&(c.scale=n),void 0!==i&&function(t,e,s=1,n=0,i=!0){t.pathLength=1;const a=i?Ze:De;t[a.offset]=""+-n,t[a.array]=`${e} ${s}`}(c,i,a,r,!1)}const _e=t=>"string"==typeof t&&"svg"===t.toLowerCase();function Ge(t,e,s){const n=Ue(t,e,s);for(const s in t)if(Qt(t[s])||Qt(e[s])){n[-1!==Mt.indexOf(s)?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s]=t[s]}return n}function Je(t){return Qt(t)?t.get():t}const Qe=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function ts(t){return"string"==typeof t&&!t.includes("-")&&!!(Qe.indexOf(t)>-1||/[A-Z]/u.test(t))}const es=t(null),ss=t({});function ns(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}export{h as $,E as A,J as B,rt as C,nt as D,S as E,A as F,V as G,w as H,f as I,n as J,ht as K,v as L,p as M,m as N,o as O,es as P,ut as Q,Dt as R,ss as S,$t as T,Zt as U,u as V,ct as W,qt as X,Ot as Y,Nt as Z,Tt as _,Te as a,Mt as a0,_t as a1,l as a2,me as a3,ie as a4,R as a5,kt as a6,xt as a7,Oe as a8,bt as a9,Vt as aa,k as ab,te as ac,Ve as ad,qe as ae,pe as af,Ae as ag,xe as ah,Z as ai,ge as aj,D as ak,e as al,s as am,d as an,M as ao,ye as ap,we as aq,ze as ar,Qt as b,Ke as c,Ye as d,He as e,_e as f,ts as g,ke as h,Ce as i,Me as j,Jt as k,Ge as l,Ne as m,Ie as n,ee as o,ns as p,c as q,Je as r,Ue as s,g as t,r as u,ot as v,j as w,G as x,z as y,a as z}; diff --git a/node_modules/framer-motion/dist/size-rollup-dom-max.js b/node_modules/framer-motion/dist/size-rollup-dom-max.js new file mode 100644 index 0000000..d4b68f3 --- /dev/null +++ b/node_modules/framer-motion/dist/size-rollup-dom-max.js @@ -0,0 +1 @@ +import{q as t,t as e,u as i,v as n,w as s,x as o,y as r,z as a,A as l,B as h,C as u,D as c,E as d,F as m,G as p,H as f,I as y,J as g,K as v,M as x,N as T,O as P,W as w,Q as S,R as E,T as A,U as D,V as b,X as M,Y as k,Z as C,_ as V,$ as L,k as R,a0 as B,a1 as j,b as I,o as O,a2 as F,a3 as U,a4 as z,a5 as W,a6 as $,a7 as N,a8 as G,a9 as H,aa as K,ab as Y,d as X,s as q,ac as _,ad as Z,ae as J,l as Q,e as tt,f as et,af as it,a as nt,ag as st,j as ot,ah as rt,ai as at,aj as lt,ak as ht,al as ut,am as ct,an as dt,ao as mt,ap as pt,aq as ft,r as yt,ar as gt,p as vt,P as xt,L as Tt,S as Pt,g as wt}from"./size-rollup-dom-max-assets.js";import{jsx as St}from"react/jsx-runtime";import{useContext as Et,useId as At,useEffect as Dt,useCallback as bt,Component as Mt,Fragment as kt}from"react";const Ct=t=>"object"==typeof t&&null!==t,Vt=(...t)=>t.reduce((t,e)=>i=>e(t(i))),Lt=(t,e,i)=>{const n=e-t;return n?(i-t)/n:1},Rt=(t,e,i)=>(((1-3*i+3*e)*t+(3*i-6*e))*t+3*e)*t;function Bt(e,i,n,s){if(e===i&&n===s)return t;const o=t=>function(t,e,i,n,s){let o,r,a=0;do{r=e+(i-e)/2,o=Rt(r,n,s)-t,o>0?i=r:e=r}while(Math.abs(o)>1e-7&&++a<12);return r}(t,0,1,e,n);return t=>0===t||1===t?t:Rt(o(t),i,s)}const jt=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,It=t=>e=>1-t(1-e),Ot=Bt(.33,1.53,.69,.99),Ft=It(Ot),Ut=jt(Ft),zt=t=>t>=1?1:(t*=2)<1?.5*Ft(t):.5*(2-Math.pow(2,-10*(t-1))),Wt=t=>1-Math.sin(Math.acos(t)),$t=It(Wt),Nt=jt(Wt),Gt=Bt(.42,0,1,1),Ht=Bt(0,0,.58,1),Kt=Bt(.42,0,.58,1),Yt={linear:t,easeIn:Gt,easeInOut:Kt,easeOut:Ht,circIn:Wt,circInOut:Nt,circOut:$t,backIn:Ft,backInOut:Ut,backOut:Ot,anticipate:zt},Xt=t=>{if(e(t)){i(4===t.length,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[e,n,s,o]=t;return Bt(e,n,s,o)}return"string"==typeof t?(i(void 0!==Yt[t],`Invalid easing type '${t}'`,"invalid-easing-type"),Yt[t]):t};function qt(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}function _t(t,e){return i=>i>0?e:t}const Zt=(t,e,i)=>{const n=t*t,s=i*(e*e-n)+n;return s<0?0:Math.sqrt(s)},Jt=[r,s,o];function Qt(t){const e=(i=t,Jt.find(t=>t.test(i)));var i;if(a(Boolean(e),`'${t}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!Boolean(e))return!1;let n=e.parse(t);return e===o&&(n=function({hue:t,saturation:e,lightness:i,alpha:n}){t/=360,i/=100;let s=0,o=0,r=0;if(e/=100){const n=i<.5?i*(1+e):i+e-i*e,a=2*i-n;s=qt(a,n,t+1/3),o=qt(a,n,t),r=qt(a,n,t-1/3)}else s=o=r=i;return{red:Math.round(255*s),green:Math.round(255*o),blue:Math.round(255*r),alpha:n}}(n)),n}const te=(t,e)=>{const i=Qt(t),o=Qt(e);if(!i||!o)return _t(t,e);const r={...i};return t=>(r.red=Zt(i.red,o.red,t),r.green=Zt(i.green,o.green,t),r.blue=Zt(i.blue,o.blue,t),r.alpha=n(i.alpha,o.alpha,t),s.transform(r))},ee=new Set(["none","hidden"]);function ie(t,e){return i=>n(t,e,i)}function ne(t){return"number"==typeof t?ie:"string"==typeof t?l(t)?_t:h.test(t)?te:re:Array.isArray(t)?se:"object"==typeof t?h.test(t)?te:oe:_t}function se(t,e){const i=[...t],n=i.length,s=t.map((t,i)=>ne(t)(t,e[i]));return t=>{for(let e=0;e{for(const e in n)i[e]=n[e](t);return i}}const re=(t,e)=>{const i=u.createTransformer(e),n=c(t),s=c(e);return n.indexes.var.length===s.indexes.var.length&&n.indexes.color.length===s.indexes.color.length&&n.indexes.number.length>=s.indexes.number.length?ee.has(t)&&!s.values.length||ee.has(e)&&!n.values.length?function(t,e){return ee.has(t)?i=>i<=0?t:e:i=>i>=1?e:t}(t,e):Vt(se(function(t,e){const i=[],n={color:0,var:0,number:0};for(let s=0;s{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>f.update(e,t),stop:()=>p(e),now:()=>d.isProcessing?d.timestamp:m.now()}},he=2e4;function ue(t){let e=0;let i=t.next(e);for(;!i.done&&e=he?1/0:e}const ce=100,de=10,me=1,pe=0,fe=800,ye=.3,ge=.3,ve={granular:.01,default:2},xe={granular:.005,default:.5},Te=.01,Pe=10,we=.05,Se=1;function Ee(t,e){return t*Math.sqrt(1-e*e)}const Ae=.001;const De=["duration","bounce"],be=["stiffness","damping","mass"];function Me(t,e){return e.some(e=>void 0!==t[e])}function ke(t){let e={velocity:pe,stiffness:ce,damping:de,mass:me,isResolvedFromDuration:!1,...t};if(!Me(t,be)&&Me(t,De))if(e.velocity=0,t.visualDuration){const i=t.visualDuration,n=2*Math.PI/(1.2*i),s=n*n,o=2*g(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:me,stiffness:s,damping:o}}else{const i=function({duration:t=fe,bounce:e=ye,velocity:i=pe,mass:n=me}){let s,o;a(t<=x(Pe),"Spring duration must be 10 seconds or less","spring-duration-limit");let r=1-e;r=g(we,Se,r),t=g(Te,Pe,y(t)),r<1?(s=e=>{const n=e*r,s=n*t,o=n-i,a=Ee(e,r),l=Math.exp(-s);return Ae-o/a*l},o=e=>{const n=e*r*t,o=n*i+i,a=Math.pow(r,2)*Math.pow(e,2)*t,l=Math.exp(-n),h=Ee(Math.pow(e,2),r);return(-s(e)+Ae>0?-1:1)*((o-a)*l)/h}):(s=e=>Math.exp(-e*t)*((e-i)*t+1)-.001,o=e=>Math.exp(-e*t)*(t*t*(i-e)));const l=function(t,e,i){let n=i;for(let i=1;i<12;i++)n-=t(n)/e(n);return n}(s,o,5/t);if(t=x(t),isNaN(l))return{stiffness:ce,damping:de,duration:t};{const e=Math.pow(l,2)*n;return{stiffness:e,damping:2*r*Math.sqrt(n*e),duration:t}}}({...t,velocity:0});e={...e,...i,mass:me},e.isResolvedFromDuration=!0}return e}function Ce(t=ge,e=ye){const i="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:n,restDelta:s}=i;const o=i.keyframes[0],r=i.keyframes[i.keyframes.length-1],a={done:!1,value:o},{stiffness:l,damping:h,mass:u,duration:c,velocity:d,isResolvedFromDuration:m}=ke({...i,velocity:-y(i.velocity||0)}),p=d||0,f=h/(2*Math.sqrt(l*u)),g=r-o,T=y(Math.sqrt(l/u)),P=Math.abs(g)<5;let w,S,E,A,D,b;if(n||(n=P?ve.granular:ve.default),s||(s=P?xe.granular:xe.default),f<1)E=Ee(T,f),A=(p+f*T*g)/E,w=t=>{const e=Math.exp(-f*T*t);return r-e*(A*Math.sin(E*t)+g*Math.cos(E*t))},D=f*T*A+g*E,b=f*T*g-A*E,S=t=>Math.exp(-f*T*t)*(D*Math.sin(E*t)+b*Math.cos(E*t));else if(1===f){w=t=>r-Math.exp(-T*t)*(g+(p+T*g)*t);const t=p+T*g;S=e=>Math.exp(-T*e)*(T*t*e-p)}else{const t=T*Math.sqrt(f*f-1);w=e=>{const i=Math.exp(-f*T*e),n=Math.min(t*e,300);return r-i*((p+f*T*g)*Math.sinh(n)+t*g*Math.cosh(n))/t};const e=(p+f*T*g)/t,i=f*T*e-g*t,n=f*T*g-e*t;S=e=>{const s=Math.exp(-f*T*e),o=Math.min(t*e,300);return s*(i*Math.sinh(o)+n*Math.cosh(o))}}const M={calculatedDuration:m&&c||null,velocity:t=>x(S(t)),next:t=>{if(!m&&f<1){const e=Math.exp(-f*T*t),i=Math.sin(E*t),o=Math.cos(E*t),l=r-e*(A*i+g*o),h=x(e*(D*i+b*o));return a.done=Math.abs(h)<=n&&Math.abs(r-l)<=s,a.value=a.done?r:l,a}const e=w(t);if(m)a.done=t>=c;else{const i=x(S(t));a.done=Math.abs(i)<=n&&Math.abs(r-e)<=s}return a.value=a.done?r:e,a},toString:()=>{const t=Math.min(ue(M),he),e=v(e=>M.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return M}Ce.applyToOptions=t=>{const e=function(t,e=100,i){const n=i({...t,keyframes:[0,e]}),s=Math.min(ue(n),he);return{type:"keyframes",ease:t=>n.next(s*t).value/e,duration:y(s)}}(t,100,Ce);return t.ease=e.ease,t.duration=x(e.duration),t.type="keyframes",t};function Ve(t,e,i){const n=Math.max(e-5,0);return T(i-t(n),e-n)}function Le({keyframes:t,velocity:e=0,power:i=.8,timeConstant:n=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:l,restDelta:h=.5,restSpeed:u}){const c=t[0],d={done:!1,value:c},m=t=>void 0===a?l:void 0===l||Math.abs(a-t)-p*Math.exp(-t/n),v=t=>y+g(t),x=t=>{const e=g(t),i=v(t);d.done=Math.abs(e)<=h,d.value=d.done?y:i};let T,P;const w=t=>{var e;(e=d.value,void 0!==a&&el)&&(T=t,P=Ce({keyframes:[d.value,m(d.value)],velocity:Ve(v,t,d.value),damping:s,stiffness:o,restDelta:h,restSpeed:u}))};return w(0),{calculatedDuration:null,next:t=>{let e=!1;return P||void 0!==T||(e=!0,x(t),w(t)),void 0!==T&&t>=T?P.next(t-T):(!e&&x(t),d)}}}function Re(e,n,{clamp:s=!0,ease:o,mixer:r}={}){const a=e.length;if(i(a===n.length,"Both input and output ranges must be the same length","range-length"),1===a)return()=>n[0];if(2===a&&n[0]===n[1])return()=>n[1];const l=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),n=[...n].reverse());const h=function(e,i,n){const s=[],o=n||P.mix||ae,r=e.length-1;for(let n=0;n{if(l&&t1)for(;ic(g(e[0],e[a-1],t)):c}function Be(t){const e=[0];return function(t,e){const i=t[t.length-1];for(let s=1;s<=e;s++){const o=Lt(0,e,s);t.push(n(i,1,o))}}(e,t.length-1),e}function je({duration:t=300,keyframes:e,times:i,ease:n="easeInOut"}){const s=(t=>Array.isArray(t)&&"number"!=typeof t[0])(n)?n.map(Xt):Xt(n),o={done:!1,value:e[0]},r=function(t,e){return t.map(t=>t*e)}(i&&i.length===e.length?i:Be(e),t),a=Re(r,e,{ease:Array.isArray(s)?s:(l=e,h=s,l.map(()=>h||Kt).splice(0,l.length-1))});var l,h;return{calculatedDuration:t,next:e=>(o.value=a(e),o.done=e>=t,o)}}const Ie={decay:Le,inertia:Le,tween:je,keyframes:je,spring:Ce};function Oe(t){"string"==typeof t.type&&(t.type=Ie[t.type])}const Fe=t=>t/100;class Ue extends w{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:t}=this.options;t&&t.updatedAt!==m.now()&&this.tick(m.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;Oe(t);const{type:e=je,repeat:i=0,repeatDelay:n=0,repeatType:s,velocity:o=0}=t;let{keyframes:r}=t;const a=e||je;a!==je&&"number"!=typeof r[0]&&(this.mixKeyframes=Vt(Fe,ae(r[0],r[1])),r=[0,100]);const l=a({...t,keyframes:r});"mirror"===s&&(this.mirroredGenerator=a({...t,keyframes:[...r].reverse(),velocity:-o})),null===l.calculatedDuration&&(l.calculatedDuration=ue(l));const{calculatedDuration:h}=l;this.calculatedDuration=h,this.resolvedDuration=h+n,this.totalDuration=this.resolvedDuration*(i+1)-n,this.generator=l}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,e=!1){const{generator:i,totalDuration:n,mixKeyframes:s,mirroredGenerator:o,resolvedDuration:r,calculatedDuration:a}=this;if(null===this.startTime)return i.next(0);const{delay:l=0,keyframes:h,repeat:u,repeatType:c,repeatDelay:d,type:m,onUpdate:p,finalKeyframe:f}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-n/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const y=this.currentTime-l*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?y<0:y>n;this.currentTime=Math.max(y,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=n);let x,T=this.currentTime,P=i;if(u){const t=Math.min(this.currentTime,n)/r;let e=Math.floor(t),i=t%1;!i&&t>=1&&(i=1),1===i&&e--,e=Math.min(e,u+1);Boolean(e%2)&&("reverse"===c?(i=1-i,d&&(i-=d/r)):"mirror"===c&&(P=o)),T=g(0,1,i)*r}v?(this.delayState.value=h[0],x=this.delayState):x=P.next(T),s&&!v&&(x.value=s(x.value));let{done:w}=x;v||null===a||(w=this.playbackSpeed>=0?this.currentTime>=n:this.currentTime<=0);const E=null===this.holdTime&&("finished"===this.state||"running"===this.state&&w);return E&&m!==Le&&(x.value=S(h,this.options,f,this.speed)),p&&p(x.value),E&&this.finish(),x}then(t,e){return this.finished.then(t,e)}get duration(){return y(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+y(t)}get time(){return y(this.currentTime)}set time(t){t=x(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);return Ve(t=>this.generator.next(t).value,t,this.generator.next(t).value)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;e&&this.driver&&this.updateTime(m.now()),this.playbackSpeed=t,e&&this.driver&&(this.time=y(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=le,startTime:e}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),this.options.onPlay?.();const i=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=i):null!==this.holdTime?this.startTime=i-this.holdTime:this.startTime||(this.startTime=e??i),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(m.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}const ze={anticipate:zt,backInOut:Ut,circInOut:Nt};function We(t){"string"==typeof t.ease&&t.ease in ze&&(t.ease=ze[t.ease])}class $e extends E{constructor(t){We(t),Oe(t),super(t),void 0!==t.startTime&&!1!==t.autoplay&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:e,onUpdate:i,onComplete:n,element:s,...o}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);const r=new Ue({...o,autoplay:!1}),a=Math.max(10,m.now()-this.startTime),l=g(0,10,a-10),h=r.sample(a).value,{name:u}=this.options;s&&u&&A(s,u,h),e.setWithVelocity(r.sample(Math.max(0,a-l)).value,h,l),r.stop()}}const Ne=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!u.test(t)&&"0"!==t||t.startsWith("url(")));function Ge(t){t.duration=0,t.type="keyframes"}const He=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;const Ke=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),Ye=b(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Xe(t){const{motionValue:e,name:i,repeatDelay:n,repeatType:s,damping:o,type:r,keyframes:a}=t,l=e?.owner?.current;if(!(l instanceof HTMLElement||l instanceof SVGElement))return!1;const{onUpdate:h,transformTemplate:u}=e.owner.getProps();return Ye()&&i&&(M.has(i)||Ke.has(i)&&function(t){for(let e=0;e{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=m.now();const c={autoplay:t,delay:e,type:i,repeat:n,repeatDelay:s,repeatType:o,name:a,motionValue:l,element:h,...u},d=h?.KeyframeResolver||k;this.keyframeResolver=new d(r,(t,e,i)=>this.onKeyframesResolved(t,e,c,!i),a,l,h),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,i,n,s){this.keyframeResolver=void 0;const{name:o,type:r,velocity:l,delay:h,isHandoff:u,onUpdate:c}=n;this.resolvedAt=m.now();let d=!0;(function(t,e,i,n){const s=t[0];if(null===s)return!1;if("display"===e||"visibility"===e)return!0;const o=t[t.length-1],r=Ne(s,e),l=Ne(o,e);return a(r===l,`You are trying to animate ${e} from "${s}" to "${o}". "${r?o:s}" is not an animatable value.`,"value-not-animatable"),!(!r||!l)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let i=0;i40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:i,...n,keyframes:e},f=d&&!u&&Xe(p),y=p.motionValue?.owner?.current;let g;if(f)try{g=new $e({...p,element:y})}catch{g=new Ue(p)}else g=new Ue(p);g.finished.then(()=>{this.notifyFinished()}).catch(t),this.pendingTimeline&&(this.stopTimeline=g.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=g}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),C()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function _e(t,e,i,n=0,s=1){const o=Array.from(t).sort((t,e)=>t.sortNodePosition(e)).indexOf(e),r=t.size,a=(r-1)*n;return"function"==typeof i?i(o,r):1===s?o*n:a-o*n}function Ze(t,e){if(t?.inherit&&e){const{inherit:i,...n}=t;return{...e,...n}}return t}function Je(t,e){const i=t?.[e]??t?.default??t;return i!==t?Ze(i,t):i}const Qe={type:"spring",stiffness:500,damping:25,restSpeed:10},ti={type:"keyframes",duration:.8},ei={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ii=(t,{keyframes:e})=>e.length>2?ti:V.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:Qe:ei,ni=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);const si=(t,e,i,n={},s,o)=>r=>{const a=Je(n,t)||{},l=a.delay||n.delay||0;let{elapsed:h=0}=n;h-=x(l);const u={keyframes:Array.isArray(i)?i:[null,i],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-h,onUpdate:t=>{e.set(t),a.onUpdate&&a.onUpdate(t)},onComplete:()=>{r(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:o?void 0:s};(function(t){for(const e in t)if(!ni.has(e))return!0;return!1})(a)||Object.assign(u,ii(t,u)),u.duration&&(u.duration=x(u.duration)),u.repeatDelay&&(u.repeatDelay=x(u.repeatDelay)),void 0!==u.from&&(u.keyframes[0]=u.from);let c=!1;if((!1===u.type||0===u.duration&&!u.repeatDelay)&&(Ge(u),0===u.delay&&(c=!0)),(P.instantAnimations||P.skipAnimations||s?.shouldSkipAnimations||a.skipAnimations)&&(c=!0,Ge(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,c&&!o&&void 0!==e.get()){const t=S(u.keyframes,a);if(void 0!==t)return void f.update(()=>{u.onUpdate(t),u.onComplete()})}return a.isSync?new Ue(u):new qe(u)},oi=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function ri(t,e,n=1){i(n<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[s,o]=function(t){const e=oi.exec(t);if(!e)return[,];const[,i,n,s]=e;return[`--${i??n}`,s]}(t);if(!s)return;const r=window.getComputedStyle(e).getPropertyValue(s);if(r){const t=r.trim();return L(t)?parseFloat(t):t}return l(o)?ri(o,e,n+1):o}function ai(t,e,i){const n=t.getProps();return R(n,e,void 0!==i?i:n.custom,t)}const li=new Set(["width","height","top","left","right","bottom",...B]),hi=t=>Array.isArray(t);function ui(t,e,i){t.hasValue(e)?t.getValue(e).set(i):t.addValue(e,j(i))}function ci(t){return hi(t)?t[t.length-1]||0:t}function di(t,e){const i=t.getValue("willChange");if(n=i,Boolean(I(n)&&n.add))return i.add(e);if(!i&&P.WillChange){const i=new P.WillChange("auto");t.addValue("willChange",i),i.add(e)}var n}function mi(t){return t.props[O]}function pi({protectedKeys:t,needsAnimating:e},i){const n=t.hasOwnProperty(i)&&!0!==e[i];return e[i]=!1,n}function fi(t,e,{delay:i=0,transitionOverride:n,type:s}={}){let{transition:o,transitionEnd:r,...a}=e;const l=t.getDefaultTransition();o=o?Ze(o,l):l;const h=o?.reduceMotion,u=o?.skipAnimations;n&&(o=n);const c=[],d=s&&t.animationState&&t.animationState.getState()[s],m=o?.path;m&&m.animateVisualElement(t,a,o,i,c);for(const e in a){const n=t.getValue(e,t.latestValues[e]??null),s=a[e];if(void 0===s||d&&pi(d,e))continue;const r={delay:i,...Je(o||{},e)};u&&(r.skipAnimations=!0);const l=n.get();if(void 0!==l&&!n.isAnimating()&&!Array.isArray(s)&&s===l&&!r.velocity){f.update(()=>n.set(s));continue}let m=!1;if(window.MotionHandoffAnimation){const i=mi(t);if(i){const t=window.MotionHandoffAnimation(i,e,f);null!==t&&(r.startTime=t,m=!0)}}di(t,e);const p=h??t.shouldReduceMotion;n.start(si(e,n,s,p&&li.has(e)?{type:!1}:r,t,m));const y=n.animation;y&&c.push(y)}if(r){const e=()=>f.update(()=>{r&&function(t,e){const i=ai(t,e);let{transitionEnd:n={},transition:s={},...o}=i||{};o={...o,...n};for(const e in o)ui(t,e,ci(o[e]))}(t,r)});c.length?Promise.all(c).then(e):e()}return c}function yi(t,e,i={}){const n=ai(t,e,"exit"===i.type?t.presenceContext?.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=n||{};i.transitionOverride&&(s=i.transitionOverride);const o=n?()=>Promise.all(fi(t,n,i)):()=>Promise.resolve(),r=t.variantChildren&&t.variantChildren.size?(n=0)=>{const{delayChildren:o=0,staggerChildren:r,staggerDirection:a}=s;return function(t,e,i=0,n=0,s=0,o=1,r){const a=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),a.push(yi(l,e,{...r,delay:i+("function"==typeof n?0:n)+_e(t.variantChildren,l,n,s,o)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(a)}(t,e,n,o,r,a,i)}:()=>Promise.resolve(),{when:a}=s;if(a){const[t,e]="beforeChildren"===a?[o,r]:[r,o];return t().then(()=>e())}return Promise.all([o(),r(i.delay)])}function gi(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||F(t))}const vi=new Set(["auto","none","0"]);class xi extends k{constructor(t,e,i,n,s){super(t,e,i,n,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:i}=this;if(!e||!e.current)return;super.readKeyframes();for(let i=0;i{t.getValue(e).set(i)}),this.resolveNoneKeyframes()}}function Ti(t,e,i){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){let e=document;const n=i?.[t]??e.querySelectorAll(t);return n?Array.from(n):[]}return Array.from(t).filter(t=>null!=t)}const Pi={x:!1,y:!1};function wi(){return Pi.x||Pi.y}function Si(t,e){const i=Ti(t),n=new AbortController;return[i,{passive:!0,...e,signal:n.signal},()=>n.abort()]}function Ei(t,e,i={}){const[n,s,o]=Si(t,i);return n.forEach(t=>{let i,n=!1,o=!1;const r=e=>{i&&(i(e),i=void 0),t.removeEventListener("pointerleave",l)},a=t=>{n=!1,window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",a),o&&(o=!1,r(t))},l=t=>{"touch"!==t.pointerType&&(n?o=!0:r(t))};t.addEventListener("pointerenter",n=>{if("touch"===n.pointerType||wi())return;o=!1;const r=e(t,n);"function"==typeof r&&(i=r,t.addEventListener("pointerleave",l,s))},s),t.addEventListener("pointerdown",()=>{n=!0,window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",a,s)},s)}),o}const Ai=(t,e)=>!!e&&(t===e||Ai(t,e.parentElement)),Di=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,bi=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const Mi=new Set(["INPUT","SELECT","TEXTAREA"]);const ki=new WeakSet;function Ci(t){return e=>{"Enter"===e.key&&t(e)}}function Vi(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function Li(t){return Di(t)&&!wi()}const Ri=new WeakSet;function Bi(t,e,i={}){const[n,s,o]=Si(t,i),r=t=>{const n=t.currentTarget;if(!Li(t))return;if(Ri.has(t))return;ki.add(n),i.stopPropagation&&Ri.add(t);const o=e(n,t),r={...s,capture:!0},a=(t,e)=>{window.removeEventListener("pointerup",l,r),window.removeEventListener("pointercancel",h,r),ki.has(n)&&ki.delete(n),Li(t)&&"function"==typeof o&&o(t,{success:e})},l=t=>{a(t,n===window||n===document||i.useGlobalTarget||Ai(n,t.target))},h=t=>{a(t,!1)};window.addEventListener("pointerup",l,r),window.addEventListener("pointercancel",h,r)};return n.forEach(t=>{var e;(i.useGlobalTarget?window:t).addEventListener("pointerdown",r,s),Ct(e=t)&&"offsetHeight"in e&&!("ownerSVGElement"in e)&&(t.addEventListener("focus",t=>((t,e)=>{const i=t.currentTarget;if(!i)return;const n=Ci(()=>{if(ki.has(i))return;Vi(i,"down");const t=Ci(()=>{Vi(i,"up")});i.addEventListener("keyup",t,e),i.addEventListener("blur",()=>Vi(i,"cancel"),e)});i.addEventListener("keydown",n,e),i.addEventListener("blur",()=>i.removeEventListener("keydown",n),e)})(t,s)),function(t){return bi.has(t.tagName)||!0===t.isContentEditable}(t)||t.hasAttribute("tabindex")||(t.tabIndex=0))}),o}function ji(t){return Ct(t)&&"ownerSVGElement"in t}const Ii=new WeakMap;let Oi;const Fi=(t,e,i)=>(n,s)=>s&&s[0]?s[0][t+"Size"]:ji(n)&&"getBBox"in n?n.getBBox()[e]:n[i],Ui=Fi("inline","width","offsetWidth"),zi=Fi("block","height","offsetHeight");function Wi({target:t,borderBoxSize:e}){Ii.get(t)?.forEach(i=>{i(t,{get width(){return Ui(t,e)},get height(){return zi(t,e)}})})}function $i(t){t.forEach(Wi)}function Ni(t,e){Oi||"undefined"!=typeof ResizeObserver&&(Oi=new ResizeObserver($i));const i=Ti(t);return i.forEach(t=>{let i=Ii.get(t);i||(i=new Set,Ii.set(t,i)),i.add(e),Oi?.observe(t)}),()=>{i.forEach(t=>{const i=Ii.get(t);i?.delete(e),i?.size||Oi?.unobserve(t)})}}const Gi=new Set;let Hi;function Ki(t){return Gi.add(t),Hi||(Hi=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};Gi.forEach(e=>e(t))},window.addEventListener("resize",Hi)),()=>{Gi.delete(t),Gi.size||"function"!=typeof Hi||(window.removeEventListener("resize",Hi),Hi=void 0)}}function Yi(t,e){return"function"==typeof t?Ki(t):Ni(t,e)}class Xi extends G{constructor(){super(...arguments),this.KeyframeResolver=xi}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){const i=t.style;return i?i[e]:void 0}removeValueFromRenderState(t,{vars:e,style:i}){delete e[t],delete i[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;I(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}class qi{constructor(t){this.isMounted=!1,this.node=t}update(){}}function _i({top:t,left:e,right:i,bottom:n}){return{x:{min:e,max:i},y:{min:t,max:n}}}function Zi(t){return void 0===t||1===t}function Ji({scale:t,scaleX:e,scaleY:i}){return!Zi(t)||!Zi(e)||!Zi(i)}function Qi(t){return Ji(t)||tn(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function tn(t){return en(t.x)||en(t.y)}function en(t){return t&&"0%"!==t}function nn(t,e,i){return i+e*(t-i)}function sn(t,e,i,n,s){return void 0!==s&&(t=nn(t,s,n)),nn(t,i,n)+e}function on(t,e=0,i=1,n,s){t.min=sn(t.min,e,i,n,s),t.max=sn(t.max,e,i,n,s)}function rn(t,{x:e,y:i}){on(t.x,e.translate,e.scale,e.originPoint),on(t.y,i.translate,i.scale,i.originPoint)}const an=.999999999999,ln=1.0000000000001;function hn(t,e){t.min+=e,t.max+=e}function un(t,e,i,s,o=.5){on(t,e,i,n(t.min,t.max,o),s)}function cn(t,e){return"string"==typeof t?parseFloat(t)/100*(e.max-e.min):t}function dn(t,e,i){const n=i??t;un(t.x,cn(e.x,n.x),e.scaleX,e.scale,e.originX),un(t.y,cn(e.y,n.y),e.scaleY,e.scale,e.originY)}function mn(t,e){return _i(function(t,e){if(!e)return t;const i=e({x:t.left,y:t.top}),n=e({x:t.right,y:t.bottom});return{top:i.y,left:i.x,bottom:n.y,right:n.x}}(t.getBoundingClientRect(),e))}function pn(t,{style:e,vars:i},n,s){const o=t.style;let r;for(r in e)o[r]=e[r];for(r in s?.applyProjectionStyles(o,n),i)o.setProperty(r,i[r])}class fn extends Xi{constructor(){super(...arguments),this.type="html",this.renderInstance=pn}mount(t){i(Boolean(t.style),"motion.create() components must forward their ref to a HTML or SVG element","custom-component-ref"),super.mount(t)}readValueFromInstance(t,e){if(V.has(e))return this.projection?.isProjecting?H(e):K(t,e);{const n=(i=t,window.getComputedStyle(i)),s=(Y(e)?n.getPropertyValue(e):n[e])||0;return"string"==typeof s?s.trim():s}var i}measureInstanceViewportBox(t,{transformPagePoint:e}){return mn(t,e)}build(t,e,i){X(t,e,i.transformTemplate)}scrapeMotionValuesFromProps(t,e,i){return q(t,e,i)}}const yn=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);class gn extends Xi{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Z}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(V.has(e)){const t=it(e);return t&&t.default||0}if(J.includes(e)){const i=getComputedStyle(t)[e];if("string"==typeof i&&i)return i.trim()}return e=yn.has(e)?e:_(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,i){return Q(t,e,i)}build(t,e,i){tt(t,e,this.isSVGTag,i.transformTemplate,i.style)}renderInstance(t,e,i,n){!function(t,e,i,n){pn(t,e,void 0,n);for(const i in e.attrs)t.setAttribute(yn.has(i)?i:_(i),e.attrs[i])}(t,e,0,n)}mount(t){this.isSVGTag=et(t.tagName),super.mount(t)}}const vn=st.length;function xn(t){if(!t)return;if(!t.isControllingVariants){const e=t.parent&&xn(t.parent)||{};return void 0!==t.props.initial&&(e.initial=t.props.initial),e}const e={};for(let i=0;iPromise.all(e.map(({animation:e,options:i})=>function(t,e,i={}){let n;if(t.notify("AnimationStart",e),Array.isArray(e)){const s=e.map(e=>yi(t,e,i));n=Promise.all(s)}else if("string"==typeof e)n=yi(t,e,i);else{const s="function"==typeof e?ai(t,e,i.custom):e;n=Promise.all(fi(t,s,i))}return n.then(()=>{t.notify("AnimationComplete",e)})}(t,e,i)))}function En(t){let e=Sn(t),i=bn(),n=!0,s=!1;const o=e=>(i,n)=>{const s=ai(t,n,"exit"===e?t.presenceContext?.custom:void 0);if(s){const{transition:t,transitionEnd:e,...n}=s;i={...i,...n,...e}}return i};function r(r){const{props:a}=t,l=xn(t.parent)||{},h=[],u=new Set;let c={},d=1/0;for(let e=0;ed&&y,P=!1;const w=Array.isArray(f)?f:[f];let S=w.reduce(o(m),{});!1===g&&(S={});const{prevResolvedValues:E={}}=p,A={...E,...S},D=e=>{T=!0,u.has(e)&&(P=!0,u.delete(e)),p.needsAnimating[e]=!0;const i=t.getValue(e);i&&(i.liveStyle=!1)};for(const t in A){const e=S[t],i=E[t];if(c.hasOwnProperty(t))continue;let n=!1;n=hi(e)&&hi(i)?!Tn(e,i)||x:e!==i,n?null!=e?D(t):u.add(t):void 0!==e&&u.has(t)?D(t):p.protectedKeys[t]=!0}p.prevProp=f,p.prevResolvedValues=S,p.isActive&&(c={...c,...S}),(n||s)&&t.blockInitialAnimation&&(T=!1);const b=v&&x;T&&(!b||P)&&h.push(...w.map(e=>{const i={type:m};if("string"==typeof e&&(n||s)&&!b&&t.manuallyAnimateOnMount&&t.parent){const{parent:n}=t,s=ai(n,e);if(n.enteringChildren&&s){const{delayChildren:e}=s.transition||{};i.delay=_e(n.enteringChildren,t,e)}}return{animation:e,options:i}}))}if(u.size){const e={};if("boolean"!=typeof a.initial){const i=ai(t,Array.isArray(a.initial)?a.initial[0]:a.initial);i&&i.transition&&(e.transition=i.transition)}u.forEach(i=>{const n=t.getBaseTarget(i),s=t.getValue(i);s&&(s.liveStyle=!0),e[i]=n??null}),h.push({animation:e})}let m=Boolean(h.length);return!n||!1!==a.initial&&a.initial!==a.animate||t.manuallyAnimateOnMount||(m=!1),n=!1,s=!1,m?e(h):Promise.resolve()}return{animateChanges:r,setActive:function(e,n){if(i[e].isActive===n)return Promise.resolve();t.variantChildren?.forEach(t=>t.animationState?.setActive(e,n)),i[e].isActive=n;const s=r(e);for(const t in i)i[t].protectedKeys={};return s},setAnimateFunction:function(i){e=i(t)},getState:()=>i,reset:()=>{i=bn(),s=!0}}}function An(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!Tn(e,t)}function Dn(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function bn(){return{animate:Dn(!0),whileInView:Dn(),whileHover:Dn(),whileTap:Dn(),whileDrag:Dn(),whileFocus:Dn(),exit:Dn()}}function Mn(t,e){t.min=e.min,t.max=e.max}function kn(t,e){Mn(t.x,e.x),Mn(t.y,e.y)}function Cn(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function Vn(t){return t.max-t.min}function Ln(t,e,i,s=.5){t.origin=s,t.originPoint=n(e.min,e.max,t.origin),t.scale=Vn(i)/Vn(e),t.translate=n(i.min,i.max,t.origin)-t.originPoint,(t.scale>=.9999&&t.scale<=1.0001||isNaN(t.scale))&&(t.scale=1),(t.translate>=-.01&&t.translate<=.01||isNaN(t.translate))&&(t.translate=0)}function Rn(t,e,i,n){Ln(t.x,e.x,i.x,n?n.originX:void 0),Ln(t.y,e.y,i.y,n?n.originY:void 0)}function Bn(t,e,i,s=0){const o=s?n(i.min,i.max,s):i.min;t.min=o+e.min,t.max=t.min+Vn(e)}function jn(t,e,i,s=0){const o=s?n(i.min,i.max,s):i.min;t.min=e.min-o,t.max=t.min+Vn(e)}function In(t,e,i,n){jn(t.x,e.x,i.x,n?.x),jn(t.y,e.y,i.y,n?.y)}function On(t,e,i,n,s){return t=nn(t-=e,1/i,n),void 0!==s&&(t=nn(t,1/s,n)),t}function Fn(t,e,[i,s,o],r,a){!function(t,e=0,i=1,s=.5,o,r=t,a=t){at.test(e)&&(e=parseFloat(e),e=n(a.min,a.max,e/100)-a.min);if("number"!=typeof e)return;let l=n(r.min,r.max,s);t===r&&(l-=e),t.min=On(t.min,e,i,l,o),t.max=On(t.max,e,i,l,o)}(t,e[i],e[s],e[o],e.scale,r,a)}const Un=["x","scaleX","originX"],zn=["y","scaleY","originY"];function Wn(t,e,i,n){Fn(t.x,e,Un,i?i.x:void 0,n?n.x:void 0),Fn(t.y,e,zn,i?i.y:void 0,n?n.y:void 0)}function $n(t){return 0===t.translate&&1===t.scale}function Nn(t){return $n(t.x)&&$n(t.y)}function Gn(t,e){return t.min===e.min&&t.max===e.max}function Hn(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Kn(t,e){return Hn(t.x,e.x)&&Hn(t.y,e.y)}function Yn(t){return Vn(t.x)/Vn(t.y)}function Xn(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function qn(t){return[t("x"),t("y")]}const _n=lt.length,Zn=t=>"string"==typeof t?parseFloat(t):t,Jn=t=>"number"==typeof t||ht.test(t);function Qn(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const ts=is(0,.5,$t),es=is(.5,.95,t);function is(t,e,i){return n=>ne?1:i(Lt(t,e,n))}function ns(t,e,i,n={passive:!0}){return t.addEventListener(e,i,n),()=>t.removeEventListener(e,i,n)}const ss=(t,e)=>t.depth-e.depth;class os{constructor(){this.children=[],this.isDirty=!1}add(t){ut(this.children,t),this.isDirty=!0}remove(t){ct(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(ss),this.isDirty=!1,this.children.forEach(t)}}class rs{constructor(){this.members=[]}add(t){ut(this.members,t);for(let e=this.members.length-1;e>=0;e--){const i=this.members[e];if(i===t||i===this.lead||i===this.prevLead)continue;const n=i.instance;n&&!1!==n.isConnected||i.snapshot||(ct(this.members,i),i.unmount())}t.scheduleRender()}remove(t){if(ct(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){for(let e=this.members.indexOf(t)-1;e>=0;e--){const t=this.members[e];if(!1!==t.isPresent&&!1!==t.instance?.isConnected)return this.promote(t),!0}return!1}promote(t,e){const i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.updateSnapshot(),t.scheduleRender();const{layoutDependency:n}=i.options,{layoutDependency:s}=t.options;void 0!==n&&n===s||(t.resumeFrom=i,e&&(i.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues),t.root?.isUpdating&&(t.isLayoutDirty=!0)),!1===t.options.crossfade&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{t.options.onExitComplete?.(),t.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}const as={hasAnimatedSinceResize:!0,hasEverUpdated:!1},ls=["","X","Y","Z"];let hs=0;function us(t,e,i,n){const{latestValues:s}=e;s[t]&&(i[t]=s[t],e.setStaticValue(t,0),n&&(n[t]=0))}function cs(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const i=mi(e);if(window.MotionHasOptimisedAnimation(i,"transform")){const{layout:e,layoutId:n}=t.options;window.MotionCancelOptimisedAnimation(i,"transform",f,!(e||n))}const{parent:n}=t;n&&!n.hasCheckedOptimisedAppear&&cs(n)}function ds({attachResizeListener:t,defaultParent:e,measureScroll:i,checkIsScrollRoot:s,resetTransform:o}){return class{constructor(t={},i=e?.()){this.id=hs++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(fs),this.nodes.forEach(Es),this.nodes.forEach(As),this.nodes.forEach(ys)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=t,this.root=i?i.root||i:this,this.path=i?[...i.path,i]:[],this.parent=i,this.depth=i?i.depth+1:0;for(let t=0;tthis.root.updateBlockedByResize=!1;f.read(()=>{n=window.innerWidth}),t(e,()=>{const t=window.innerWidth;t!==n&&(n=t,this.root.updateBlockedByResize=!0,i&&i(),i=function(t,e){const i=m.now(),n=({timestamp:s})=>{const o=s-i;o>=e&&(p(n),t(o-e))};return f.setup(n,!0),()=>p(n)}(s,250),as.hasAnimatedSinceResize&&(as.hasAnimatedSinceResize=!1,this.nodes.forEach(Ss)))})}n&&this.root.registerSharedNode(n,this),!1!==this.options.animate&&o&&(n||s)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeLayoutChanged:i,layout:n})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const s=this.options.transition||o.getDefaultTransition()||Vs,{onLayoutAnimationStart:r,onLayoutAnimationComplete:a}=o.getProps(),l=!this.targetLayout||!Kn(this.targetLayout,n),h=!e&&i;if(this.options.layoutRoot||this.resumeFrom||h||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const e={...Je(s,"layout"),onPlay:r,onComplete:a};(o.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e),this.setAnimationOrigin(t,h,e.path)}else e||Ss(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=n})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const t=this.getStack();t&&t.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),p(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Ds),this.animationId++)}getTransformTemplate(){const{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&cs(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||Vn(this.snapshot.measuredBox.x)||Vn(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;tan&&(e.x=1),e.yan&&(e.y=1)}(this.layoutCorrected,this.treeScale,this.path,e),!t.layout||t.target||1===this.treeScale.x&&1===this.treeScale.y||(t.target=t.layout.layoutBox,t.targetWithTransforms=Z());const{target:a}=t;a?(this.projectionDelta&&this.prevProjectionDelta?(Cn(this.prevProjectionDelta.x,this.projectionDelta.x),Cn(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),Rn(this.projectionDelta,this.layoutCorrected,a,this.latestValues),this.treeScale.x===o&&this.treeScale.y===r&&Xn(this.projectionDelta.x,this.prevProjectionDelta.x)&&Xn(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",a))):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){if(this.options.visualElement?.scheduleRender(),t){const t=this.getStack();t&&t.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=ft(),this.projectionDelta=ft(),this.projectionDeltaWithTransform=ft()}setAnimationOrigin(t,e=!1,i){const s=this.snapshot,o=s?s.latestValues:{},r={...this.latestValues},a=ft();this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!e;const l=Z(),h=(s?s.source:void 0)!==(this.layout?this.layout.source:void 0),u=this.getStack(),c=!u||u.members.length<=1,d=Boolean(h&&!c&&!0===this.options.crossfade&&!this.path.some(Cs));let m;this.animationProgress=0;const p=i?.interpolateProjection(t);this.mixTargetDelta=e=>{const i=e/1e3,s=p?.(i);var u,f,y,g,v,x;s?(a.x.translate=s.x,a.x.scale=n(t.x.scale,1,i),a.x.origin=t.x.origin,a.x.originPoint=t.x.originPoint,a.y.translate=s.y,a.y.scale=n(t.y.scale,1,i),a.y.origin=t.y.origin,a.y.originPoint=t.y.originPoint):(Ms(a.x,t.x,i),Ms(a.y,t.y,i)),this.setTargetDelta(a),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(In(l,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),y=this.relativeTarget,g=this.relativeTargetOrigin,v=l,x=i,ks(y.x,g.x,v.x,x),ks(y.y,g.y,v.y,x),m&&(u=this.relativeTarget,f=m,Gn(u.x,f.x)&&Gn(u.y,f.y))&&(this.isProjectionDirty=!1),m||(m=Z()),kn(m,this.relativeTarget)),h&&(this.animationValues=r,function(t,e,i,s,o,r){o?(t.opacity=n(0,i.opacity??1,ts(s)),t.opacityExit=n(e.opacity??1,0,es(s))):r&&(t.opacity=n(e.opacity??1,i.opacity??1,s));for(let o=0;o<_n;o++){const r=lt[o];let a=Qn(e,r),l=Qn(i,r);void 0===a&&void 0===l||(a||(a=0),l||(l=0),0===a||0===l||Jn(a)===Jn(l)?(t[r]=Math.max(n(Zn(a),Zn(l),s),0),(at.test(l)||at.test(a))&&(t[r]+="%")):t[r]=l)}(e.rotate||i.rotate)&&(t.rotate=n(e.rotate||0,i.rotate||0,s))}(r,o,this.latestValues,i,d,c)),s&&void 0!==s.rotate&&(this.animationValues||(this.animationValues=r),this.animationValues.pathRotation=s.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=i},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(t){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(p(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=f.update(()=>{as.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=j(0)),this.motionValue.jump(0,!1),this.currentAnimation=function(t,e,i){const n=I(t)?t:j(t);return n.start(si("",n,e,i)),n.animation}(this.motionValue,[0,1e3],{...t,velocity:0,isSync:!0,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onComplete:()=>{t.onComplete&&t.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const t=this.getStack();t&&t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead();let{targetWithTransforms:e,target:i,layout:n,latestValues:s}=t;if(e&&i&&n){if(this!==t&&this.layout&&n&&js(this.options.animationType,this.layout.layoutBox,n.layoutBox)){i=this.target||Z();const e=Vn(this.layout.layoutBox.x);i.x.min=t.target.x.min,i.x.max=i.x.min+e;const n=Vn(this.layout.layoutBox.y);i.y.min=t.target.y.min,i.y.max=i.y.min+n}kn(e,i),dn(e,s),Rn(this.projectionDeltaWithTransform,this.layoutCorrected,e,s)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new rs);this.sharedNodes.get(t).add(e);const i=e.options.initialPromotionConfig;e.promote({transition:i?i.transition:void 0,preserveFollowOpacity:i&&i.shouldPreserveFollowOpacity?i.shouldPreserveFollowOpacity(e):void 0})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){const{layoutId:t}=this.options;return t&&this.getStack()?.lead||this}getPrevLead(){const{layoutId:t}=this.options;return t?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:i}={}){const n=this.getStack();n&&n.promote(this,i),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetSkewAndRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const{latestValues:i}=t;if((i.z||i.rotate||i.rotateX||i.rotateY||i.rotateZ||i.skewX||i.skewY)&&(e=!0),!e)return;const n={};i.z&&us("z",t,n,this.animationValues);for(let e=0;et.currentAnimation?.stop()),this.root.nodes.forEach(vs),this.root.sharedNodes.clear()}}}function ms(t){t.updateLayout()}function ps(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:i,measuredBox:n}=t.layout,{animationType:s}=t.options,o=e.source!==t.layout.source;if("size"===s)qn(t=>{const n=o?e.measuredBox[t]:e.layoutBox[t],s=Vn(n);n.min=i[t].min,n.max=n.min+s});else if("x"===s||"y"===s){const t="x"===s?"y":"x";Mn(o?e.measuredBox[t]:e.layoutBox[t],i[t])}else js(s,e.layoutBox,i)&&qn(n=>{const s=o?e.measuredBox[n]:e.layoutBox[n],r=Vn(i[n]);s.max=s.min+r,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[n].max=t.relativeTarget[n].min+r)});const r=ft();Rn(r,i,e.layoutBox);const a=ft();o?Rn(a,t.applyTransform(n,!0),e.measuredBox):Rn(a,i,e.layoutBox);const l=!Nn(r);let h=!1;if(!t.resumeFrom){const n=t.getClosestProjectingParent();if(n&&!n.resumeFrom){const{snapshot:s,layout:o}=n;if(s&&o){const r=t.options.layoutAnchor||void 0,a=Z();In(a,e.layoutBox,s.layoutBox,r);const l=Z();In(l,i,o.layoutBox,r),Kn(a,l)||(h=!0),n.options.layoutRoot&&(t.relativeTarget=l,t.relativeTargetOrigin=a,t.relativeParent=n)}}}t.notifyListeners("didUpdate",{layout:i,snapshot:e,delta:a,layoutDelta:r,hasLayoutChanged:l,hasRelativeLayoutChanged:h})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function fs(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=Boolean(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function ys(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function gs(t){t.clearSnapshot()}function vs(t){t.clearMeasurements()}function xs(t){t.isLayoutDirty=!0,t.updateLayout()}function Ts(t){t.isLayoutDirty=!1}function Ps(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function ws(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Ss(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Es(t){t.resolveTargetDelta()}function As(t){t.calcProjection()}function Ds(t){t.resetSkewAndRotation()}function bs(t){t.removeLeadSnapshot()}function Ms(t,e,i){t.translate=n(e.translate,0,i),t.scale=n(e.scale,1,i),t.origin=e.origin,t.originPoint=e.originPoint}function ks(t,e,i,s){t.min=n(e.min,i.min,s),t.max=n(e.max,i.max,s)}function Cs(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const Vs={duration:.45,ease:[.4,0,.1,1]},Ls=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Rs=Ls("applewebkit/")&&!Ls("chrome/")?Math.round:t;function Bs(t){t.min=Rs(t.min),t.max=Rs(t.max)}function js(t,e,i){return"position"===t||"preserve-aspect"===t&&(n=Yn(e),s=Yn(i),o=.2,!(Math.abs(n-s)<=o));var n,s,o}function Is(t){return t!==t.root&&t.scroll?.wasRoot}const Os=ds({attachResizeListener:(t,e)=>ns(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Fs={current:void 0},Us=ds({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Fs.current){const t=new Os({});t.mount(window),t.setOptions({layoutScroll:!0}),Fs.current=t}return Fs.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)});function zs(t){return{point:{x:t.pageX,y:t.pageY}}}function Ws(t,e,i,n){return ns(t,e,(t=>e=>Di(e)&&t(e,zs(e)))(i),n)}const $s=({current:t})=>t?t.ownerDocument.defaultView:null,Ns=(t,e)=>Math.abs(t-e);const Gs=new Set(["auto","scroll"]);class Hs{constructor(t,e,{transformPagePoint:i,contextWindow:n=window,dragSnapToOrigin:s=!1,distanceThreshold:o=3,element:r}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=t=>{this.handleScroll(t.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Ks(this.lastRawMoveEventInfo,this.transformPagePoint));const t=Xs(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,i=function(t,e){const i=Ns(t.x,e.x),n=Ns(t.y,e.y);return Math.sqrt(i**2+n**2)}(t.offset,{x:0,y:0})>=this.distanceThreshold;if(!e&&!i)return;const{point:n}=t,{timestamp:s}=d;this.history.push({...n,timestamp:s});const{onStart:o,onMove:r}=this.handlers;e||(o&&o(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),r&&r(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastRawMoveEventInfo=e,this.lastMoveEventInfo=Ks(e,this.transformPagePoint),f.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();const{onEnd:i,onSessionEnd:n,resumeAnimation:s}=this.handlers;if(!this.dragSnapToOrigin&&this.startEvent||s&&s(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const o=Xs("pointercancel"===t.type?this.lastMoveEventInfo:Ks(e,this.transformPagePoint),this.history);this.startEvent&&i&&i(t,o),n&&n(t,o)},!Di(t))return;this.dragSnapToOrigin=s,this.handlers=e,this.transformPagePoint=i,this.distanceThreshold=o,this.contextWindow=n||window;const a=Ks(zs(t),this.transformPagePoint),{point:l}=a,{timestamp:h}=d;this.history=[{...l,timestamp:h}];const{onSessionStart:u}=e;u&&u(t,Xs(a,this.history));const c={passive:!0,capture:!0};this.removeListeners=Vt(Ws(this.contextWindow,"pointermove",this.handlePointerMove,c),Ws(this.contextWindow,"pointerup",this.handlePointerUp,c),Ws(this.contextWindow,"pointercancel",this.handlePointerUp,c)),r&&this.startScrollTracking(r)}startScrollTracking(t){let e=t.parentElement;for(;e;){const t=getComputedStyle(e);(Gs.has(t.overflowX)||Gs.has(t.overflowY))&&this.scrollPositions.set(e,{x:e.scrollLeft,y:e.scrollTop}),e=e.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const e=this.scrollPositions.get(t);if(!e)return;const i=t===window,n=i?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},s=n.x-e.x,o=n.y-e.y;0===s&&0===o||(i?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=s,this.lastMoveEventInfo.point.y+=o):this.history.length>0&&(this.history[0].x-=s,this.history[0].y-=o),this.scrollPositions.set(t,n),f.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),p(this.updatePoint)}}function Ks(t,e){return e?{point:e(t.point)}:t}function Ys(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Xs({point:t},e){return{point:t,delta:Ys(t,_s(e)),offset:Ys(t,qs(e)),velocity:Zs(e,.1)}}function qs(t){return t[0]}function _s(t){return t[t.length-1]}function Zs(t,e){if(t.length<2)return{x:0,y:0};let i=t.length-1,n=null;const s=_s(t);for(;i>=0&&(n=t[i],!(s.timestamp-n.timestamp>x(e)));)i--;if(!n)return{x:0,y:0};n===t[0]&&t.length>2&&s.timestamp-n.timestamp>2*x(e)&&(n=t[1]);const o=y(s.timestamp-n.timestamp);if(0===o)return{x:0,y:0};const r={x:(s.x-n.x)/o,y:(s.y-n.y)/o};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function Js(t,e,i){return{min:void 0!==e?t.min+e:void 0,max:void 0!==i?t.max+i-(t.max-t.min):void 0}}function Qs(t,e){let i=e.min-t.min,n=e.max-t.max;return e.max-e.min{e&&this.snapToCursor(zs(t).point),this.stopAnimation()},onStart:(t,e)=>{const{drag:i,dragPropagation:n,onDragStart:s}=this.getProps();if(i&&!n&&(this.openDragLock&&this.openDragLock(),this.openDragLock="x"===(o=i)||"y"===o?Pi[o]?null:(Pi[o]=!0,()=>{Pi[o]=!1}):Pi.x||Pi.y?null:(Pi.x=Pi.y=!0,()=>{Pi.x=Pi.y=!1}),!this.openDragLock))return;var o;this.latestPointerEvent=t,this.latestPanInfo=e,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),qn(t=>{let e=this.getAxisMotionValue(t).get()||0;if(at.test(e)){const{projection:i}=this.visualElement;if(i&&i.layout){const n=i.layout.layoutBox[t];if(n){e=Vn(n)*(parseFloat(e)/100)}}}this.originPoint[t]=e}),s&&f.update(()=>s(t,e),!1,!0),di(this.visualElement,"transform");const{animationState:r}=this.visualElement;r&&r.setActive("whileDrag",!0)},onMove:(t,e)=>{this.latestPointerEvent=t,this.latestPanInfo=e;const{dragPropagation:i,dragDirectionLock:n,onDirectionLock:s,onDrag:o}=this.getProps();if(!i&&!this.openDragLock)return;const{offset:r}=e;if(n&&null===this.currentDirection)return this.currentDirection=function(t,e=10){let i=null;Math.abs(t.y)>e?i="y":Math.abs(t.x)>e&&(i="x");return i}(r),void(null!==this.currentDirection&&s&&s(this.currentDirection));this.updateAxis("x",e.point,r),this.updateAxis("y",e.point,r),this.visualElement.render(),o&&f.update(()=>o(t,e),!1,!0)},onSessionEnd:(t,e)=>{this.latestPointerEvent=t,this.latestPanInfo=e,this.stop(t,e),this.latestPointerEvent=null,this.latestPanInfo=null},resumeAnimation:()=>{const{dragSnapToOrigin:t}=this.getProps();(t||this.constraints)&&this.startAnimation({x:0,y:0})}},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:s,distanceThreshold:i,contextWindow:$s(this.visualElement),element:this.visualElement.current})}stop(t,e){const i=t||this.latestPointerEvent,n=e||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!n||!i)return;const{velocity:o}=n;this.startAnimation(o);const{onDragEnd:r}=this.getProps();r&&f.postRender(()=>r(i,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:e}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:i}=this.getProps();!i&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),e&&e.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,e,i){const{drag:s}=this.getProps();if(!i||!ro(t,s,this.currentDirection))return;const o=this.getAxisMotionValue(t);let r=this.originPoint[t]+i[t];this.constraints&&this.constraints[t]&&(r=function(t,{min:e,max:i},s){return void 0!==e&&ti&&(t=s?n(i,t,s.max):Math.min(t,i)),t}(r,this.constraints[t],this.elastic[t])),o.set(r)}resolveConstraints(){const{dragConstraints:t,dragElastic:e}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,n=this.constraints;t&&vt(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!i)&&function(t,{top:e,left:i,bottom:n,right:s}){return{x:Js(t.x,i,s),y:Js(t.y,e,n)}}(i.layoutBox,t),this.elastic=function(t=to){return!1===t?t=0:!0===t&&(t=to),{x:eo(t,"left","right"),y:eo(t,"top","bottom")}}(e),n!==this.constraints&&!vt(t)&&i&&this.constraints&&!this.hasMutatedConstraints&&qn(t=>{!1!==this.constraints&&this.getAxisMotionValue(t)&&(this.constraints[t]=function(t,e){const i={};return void 0!==e.min&&(i.min=e.min-t.min),void 0!==e.max&&(i.max=e.max-t.min),i}(i.layoutBox[t],this.constraints[t]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!t||!vt(t))return!1;const n=t.current;i(null!==n,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:s}=this.visualElement;if(!s||!s.layout)return!1;s.root&&(s.root.scroll=void 0,s.root.updateScroll());const o=function(t,e,i){const n=mn(t,i),{scroll:s}=e;return s&&(hn(n.x,s.offset.x),hn(n.y,s.offset.y)),n}(n,s.root,this.visualElement.getTransformPagePoint());let r=function(t,e){return{x:Qs(t.x,e.x),y:Qs(t.y,e.y)}}(s.layout.layoutBox,o);if(e){const t=e(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(r));this.hasMutatedConstraints=!!t,t&&(r=_i(t))}return r}startAnimation(t){const{drag:e,dragMomentum:i,dragElastic:n,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:r}=this.getProps(),a=this.constraints||{},l=qn(r=>{if(!ro(r,e,this.currentDirection))return;let l=a&&a[r]||{};!0!==o&&o!==r||(l={min:0,max:0});const h=n?200:1e6,u=n?40:1e7,c={type:"inertia",velocity:i?t[r]:0,bounceStiffness:h,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...s,...l};return this.startAxisValueAnimation(r,c)});return Promise.all(l).then(r)}startAxisValueAnimation(t,e){const i=this.getAxisMotionValue(t);return di(this.visualElement,t),i.start(si(t,i,0,e,this.visualElement,!1))}stopAnimation(){qn(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const e=`_drag${t.toUpperCase()}`,i=this.visualElement.getProps()[e];return i||this.visualElement.getValue(t,this.visualElement.latestValues[t]??0)}snapToCursor(t){qn(e=>{const{drag:i}=this.getProps();if(!ro(e,i,this.currentDirection))return;const{projection:s}=this.visualElement,o=this.getAxisMotionValue(e);if(s&&s.layout){const{min:i,max:r}=s.layout.layoutBox[e],a=o.get()||0;o.set(t[e]-n(i,r,.5)+a)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:e}=this.getProps(),{projection:i}=this.visualElement;if(!vt(e)||!i||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};qn(t=>{const e=this.getAxisMotionValue(t);if(e&&!1!==this.constraints){const i=e.get();s[t]=function(t,e){let i=.5;const n=Vn(t),s=Vn(e);return s>n?i=Lt(e.min,e.max-n,t.min):n>s&&(i=Lt(t.min,t.max-s,e.min)),g(0,1,i)}({min:i,max:i},this.constraints[t])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.constraints=!1,this.resolveConstraints(),qn(e=>{if(!ro(e,t,null))return;const i=this.getAxisMotionValue(e),{min:o,max:r}=this.constraints[e];i.set(n(o,r,s[e]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;no.set(this.visualElement,this);const t=this.visualElement.current,e=Ws(t,"pointerdown",e=>{const{drag:i,dragListener:n=!0}=this.getProps(),s=e.target,o=s!==t&&function(t){return Mi.has(t.tagName)||!0===t.isContentEditable}(s);i&&n&&!o&&this.start(e)});let i;const n=()=>{const{dragConstraints:e}=this.getProps();vt(e)&&e.current&&(this.constraints=this.resolveRefConstraints(),i||(i=function(t,e,i){const n=Yi(t,oo(i)),s=Yi(e,oo(i));return()=>{n(),s()}}(t,e.current,()=>this.scalePositionWithinConstraints())))},{projection:s}=this.visualElement,o=s.addEventListener("measure",n);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),f.read(n);const r=ns(window,"resize",()=>this.scalePositionWithinConstraints()),a=s.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(qn(e=>{const i=this.getAxisMotionValue(e);i&&(this.originPoint[e]+=t[e].translate,i.set(i.get()+t[e].translate))}),this.visualElement.render())});return()=>{r(),e(),o(),a&&a(),i&&i()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:i=!1,dragPropagation:n=!1,dragConstraints:s=!1,dragElastic:o=to,dragMomentum:r=!0}=t;return{...t,drag:e,dragDirectionLock:i,dragPropagation:n,dragConstraints:s,dragElastic:o,dragMomentum:r}}}function oo(t){let e=!0;return()=>{e?e=!1:t()}}function ro(t,e,i){return!(!0!==e&&e!==t||null!==i&&i!==t)}const ao=t=>(e,i)=>{t&&f.update(()=>t(e,i),!1,!0)};let lo=!1;class ho extends Mt{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:i,layoutId:n}=this.props,{projection:s}=t;s&&(e.group&&e.group.add(s),i&&i.register&&n&&i.register(s),lo&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),as.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:i,drag:n,isPresent:s}=this.props,{projection:o}=i;return o?(o.isPresent=s,t.layoutDependency!==e&&o.setOptions({...o.options,layoutDependency:e}),lo=!0,n||t.layoutDependency!==e||void 0===e||t.isPresent!==s?o.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?o.promote():o.relegate()||f.postRender(()=>{const t=o.getStack();t&&t.members.length||this.safeToRemove()})),null):null}componentDidUpdate(){const{visualElement:t,layoutAnchor:e}=this.props,{projection:i}=t;i&&(i.options.layoutAnchor=e,i.root.didUpdate(),pt.postRender(()=>{!i.currentAnimation&&i.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:i}=this.props,{projection:n}=t;lo=!0,n&&(n.scheduleCheckAfterUnmount(),e&&e.group&&e.group.remove(n),i&&i.deregister&&i.deregister(n))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function uo(t){const[e,i]=function(t=!0){const e=Et(xt);if(null===e)return[!0,null];const{isPresent:i,onExitComplete:n,register:s}=e,o=At();Dt(()=>{if(t)return s(o)},[t]);const r=bt(()=>t&&n&&n(o),[o,n,t]);return!i&&n?[!1,r]:[!0]}(),n=Et(Tt);return St(ho,{...t,layoutGroup:n,switchLayoutGroup:Et(Pt),isPresent:e,safeToRemove:i})}const co={pan:{Feature:class extends qi{constructor(){super(...arguments),this.removePointerDownListener=t}onPointerDown(t){this.session=new Hs(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:$s(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:e,onPan:i,onPanEnd:n}=this.node.getProps();return{onSessionStart:ao(t),onStart:ao(e),onMove:ao(i),onEnd:(t,e)=>{delete this.session,n&&f.postRender(()=>n(t,e))}}}mount(){this.removePointerDownListener=Ws(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends qi{constructor(e){super(e),this.removeGroupControls=t,this.removeListeners=t,this.controls=new so(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||t}update(){const{dragControls:t}=this.node.getProps(),{dragControls:e}=this.node.prevProps||{};t!==e&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},ProjectionNode:Us,MeasureLayout:uo}},mo={layout:{ProjectionNode:Us,MeasureLayout:uo}};let po=0;const fo={animation:{Feature:class extends qi{constructor(t){super(t),t.animationState||(t.animationState=En(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();ot(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}},exit:{Feature:class extends qi{constructor(){super(...arguments),this.id=po++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:e}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===i)return;if(t&&!1===i){if(this.isExitComplete){const{initial:t,custom:e}=this.node.getProps();if("string"==typeof t||"object"==typeof t&&null!==t&&!Array.isArray(t)){const i=ai(this.node,t,e);if(i){const{transition:t,transitionEnd:e,...n}=i;for(const t in n)this.node.getValue(t)?.jump(n[t])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);return void(this.isExitComplete=!1)}const n=this.node.animationState.setActive("exit",!t);e&&!t&&n.then(()=>{this.isExitComplete=!0,e(this.id)})}mount(){const{register:t,onExitComplete:e}=this.node.presenceContext||{};e&&e(this.id),t&&(this.unmount=t(this.id))}unmount(){}}}};function yo(t,e,i){const{props:n}=t;t.animationState&&n.whileHover&&t.animationState.setActive("whileHover","Start"===i);const s=n["onHover"+i];s&&f.postRender(()=>s(e,zs(e)))}function go(t,e,i){const{props:n}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&n.whileTap&&t.animationState.setActive("whileTap","Start"===i);const s=n["onTap"+("End"===i?"":i)];s&&f.postRender(()=>s(e,zs(e)))}const vo=new WeakMap,xo=new WeakMap,To=t=>{const e=vo.get(t.target);e&&e(t)},Po=t=>{t.forEach(To)};function wo(t,e,i){const n=function({root:t,...e}){const i=t||document;xo.has(i)||xo.set(i,{});const n=xo.get(i),s=JSON.stringify(e);return n[s]||(n[s]=new IntersectionObserver(Po,{root:t,...e})),n[s]}(e);return vo.set(t,i),n.observe(t),()=>{vo.delete(t),n.unobserve(t)}}const So={some:0,all:1};const Eo={renderer:(t,e)=>e.isSVG??wt(t)?new gn(e):new fn(e,{allowProjection:t!==kt}),...fo,...{inView:{Feature:class extends qi{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:t={}}=this.node.getProps(),{root:e,margin:i,amount:n="some",once:s}=t,o={root:e?e.current:void 0,rootMargin:i,threshold:"number"==typeof n?n:So[n]};this.stopObserver=wo(this.node.current,o,t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,s&&!e&&this.hasEnteredView)return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);const{onViewportEnter:i,onViewportLeave:n}=this.node.getProps(),o=e?i:n;o&&o(t)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return i=>t[i]!==e[i]}(t,e))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}},tap:{Feature:class extends qi{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:e,propagate:i}=this.node.props;this.unmount=Bi(t,(t,e)=>(go(this.node,e,"Start"),(t,{success:e})=>go(this.node,t,e?"End":"Cancel")),{useGlobalTarget:e,stopPropagation:!1===i?.tap})}unmount(){}}},focus:{Feature:class extends qi{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){t=!0}t&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Vt(ns(this.node.current,"focus",()=>this.onFocus()),ns(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends qi{mount(){const{current:t}=this.node;t&&(this.unmount=Ei(t,(t,e)=>(yo(this.node,e,"Start"),t=>yo(this.node,t,"End"))))}unmount(){}}}}},Ao={...Eo,...co,...mo};export{Ao as domMax}; diff --git a/node_modules/framer-motion/dist/size-rollup-m.js b/node_modules/framer-motion/dist/size-rollup-m.js new file mode 100644 index 0000000..ad7fbc9 --- /dev/null +++ b/node_modules/framer-motion/dist/size-rollup-m.js @@ -0,0 +1,2 @@ +import{jsxs as t,jsx as n}from"react/jsx-runtime";import{createContext as r,useContext as e,useMemo as o,Fragment as a,createElement as s,useRef as i,useInsertionEffect as l,useCallback as u,useLayoutEffect as c,useEffect as f,forwardRef as d}from"react";const p=(t,n,r)=>r>n?n:rt,isStatic:!1,reducedMotion:"never"}),y=r({}),v=(t=>n=>"string"==typeof n&&n.startsWith(t))("--"),b={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},w={...b,transform:t=>p(0,1,t)},S={...b,default:1},x=t=>Math.round(1e5*t)/1e5,R=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const k=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,B=(t,n)=>r=>Boolean("string"==typeof r&&k.test(r)&&r.startsWith(t)||n&&!function(t){return null==t}(r)&&Object.prototype.hasOwnProperty.call(r,n)),T=(t,n,r)=>e=>{if("string"!=typeof e)return e;const[o,a,s,i]=e.match(R);return{[t]:parseFloat(o),[n]:parseFloat(a),[r]:parseFloat(s),alpha:void 0!==i?parseFloat(i):1}},I={...b,transform:t=>Math.round((t=>p(0,255,t))(t))},A={test:B("rgb","red"),parse:T("red","green","blue"),transform:({red:t,green:n,blue:r,alpha:e=1})=>"rgba("+I.transform(t)+", "+I.transform(n)+", "+I.transform(r)+", "+x(w.transform(e))+")"};const M={test:B("#"),parse:function(t){let n="",r="",e="",o="";return t.length>5?(n=t.substring(1,3),r=t.substring(3,5),e=t.substring(5,7),o=t.substring(7,9)):(n=t.substring(1,2),r=t.substring(2,3),e=t.substring(3,4),o=t.substring(4,5),n+=n,r+=r,e+=e,o+=o),{red:parseInt(n,16),green:parseInt(r,16),blue:parseInt(e,16),alpha:o?parseInt(o,16)/255:1}},transform:A.transform},P=t=>({test:n=>"string"==typeof n&&n.endsWith(t)&&1===n.split(" ").length,parse:parseFloat,transform:n=>`${n}${t}`}),O=P("deg"),W=P("%"),E=P("px"),L=(()=>({...W,parse:t=>W.parse(t)/100,transform:t=>W.transform(100*t)}))(),C={test:B("hsl","hue"),parse:T("hue","saturation","lightness"),transform:({hue:t,saturation:n,lightness:r,alpha:e=1})=>"hsla("+Math.round(t)+", "+W.transform(x(n))+", "+W.transform(x(r))+", "+x(w.transform(e))+")"},j={test:t=>A.test(t)||M.test(t)||C.test(t),parse:t=>A.test(t)?A.parse(t):C.test(t)?C.parse(t):M.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?A.transform(t):C.transform(t),getAnimatableNone:t=>{const n=j.parse(t);return n.alpha=0,j.transform(n)}},V=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const $="number",F="color",X=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Y(t){const n=t.toString(),r=[],e={color:[],number:[],var:[]},o=[];let a=0;const s=n.replace(X,t=>(j.test(t)?(e.color.push(a),o.push(F),r.push(j.parse(t))):t.startsWith("var(")?(e.var.push(a),o.push("var"),r.push(t)):(e.number.push(a),o.push($),r.push(parseFloat(t))),++a,"${}")).split("${}");return{values:r,split:s,indexes:e,types:o}}function D({split:t,types:n}){const r=t.length;return e=>{let o="";for(let a=0;a{return"number"==typeof t?n?.trim().endsWith("/")?t:0:"number"==typeof(r=t)?0:j.test(r)?j.getAnimatableNone(r):r;var r};const N={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(R)?.length||0)+(t.match(V)?.length||0)>0},parse:function(t){return Y(t).values},createTransformer:function(t){return D(Y(t))},getAnimatableNone:function(t){const n=Y(t);return D(n)(n.values.map((t,r)=>H(t,n.split[r])))}},Z=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],z=(()=>new Set([...Z,"pathRotation"]))();function U(t,n,r,e){if("function"==typeof n){const[r,e]=[{},{}];n=n(t.custom,r,e)}if("string"==typeof n&&(n=t.variants&&t.variants[n]),"function"==typeof n){const[r,e]=[{},{}];n=n(t.custom,r,e)}return n}const _=t=>Boolean(t&&t.getVelocity);const q="data-"+"framerAppearId".replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`);const G={...b,transform:Math.round},J={borderWidth:E,borderTopWidth:E,borderRightWidth:E,borderBottomWidth:E,borderLeftWidth:E,borderRadius:E,borderTopLeftRadius:E,borderTopRightRadius:E,borderBottomRightRadius:E,borderBottomLeftRadius:E,width:E,maxWidth:E,height:E,maxHeight:E,top:E,right:E,bottom:E,left:E,inset:E,insetBlock:E,insetBlockStart:E,insetBlockEnd:E,insetInline:E,insetInlineStart:E,insetInlineEnd:E,padding:E,paddingTop:E,paddingRight:E,paddingBottom:E,paddingLeft:E,paddingBlock:E,paddingBlockStart:E,paddingBlockEnd:E,paddingInline:E,paddingInlineStart:E,paddingInlineEnd:E,margin:E,marginTop:E,marginRight:E,marginBottom:E,marginLeft:E,marginBlock:E,marginBlockStart:E,marginBlockEnd:E,marginInline:E,marginInlineStart:E,marginInlineEnd:E,fontSize:E,backgroundPositionX:E,backgroundPositionY:E,...{rotate:O,pathRotation:O,rotateX:O,rotateY:O,rotateZ:O,scale:S,scaleX:S,scaleY:S,scaleZ:S,skew:O,skewX:O,skewY:O,distance:E,translateX:E,translateY:E,translateZ:E,x:E,y:E,z:E,perspective:E,transformPerspective:E,opacity:w,originX:L,originY:L,originZ:E},zIndex:G,fillOpacity:w,strokeOpacity:w,numOctaves:G},K=(t,n)=>n&&"number"==typeof t?n.transform(t):t;function Q(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function tt(t){return"string"==typeof t||Array.isArray(t)}const nt=["initial","animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"];function rt(t){return Q(t.animate)||nt.some(n=>tt(t[n]))}let et={};const ot={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},at=Z.length;function st(t,n,r){const{style:e,vars:o,transformOrigin:a}=t;let s=!1,i=!1;for(const t in n){const r=n[t];if(z.has(t))s=!0;else if(v(t))o[t]=r;else{const n=K(r,J[t]);t.startsWith("origin")?(i=!0,a[t]=n):e[t]=n}}if(n.transform||(s||r?e.transform=function(t,n,r){let e="",o=!0;for(let a=0;a{if(!n.target)return t;if("string"==typeof t){if(!E.test(t))return t;t=parseFloat(t)}return`${it(t,n.target.x)}% ${it(t,n.target.y)}%`}},ut={correct:(t,{treeScale:n,projectionDelta:r})=>{const e=t,o=N.parse(t);if(o.length>5)return e;const a=N.createTransformer(t),s="number"!=typeof o[0]?1:0,i=r.x.scale*n.x,l=r.y.scale*n.y;o[0+s]/=i,o[1+s]/=l;const u=(c=i)+(l-c)*.5;var c;return"number"==typeof o[2+s]&&(o[2+s]/=u),"number"==typeof o[3+s]&&(o[3+s]/=u),a(o)}},ct={borderRadius:{...lt,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"]},borderTopLeftRadius:lt,borderTopRightRadius:lt,borderBottomLeftRadius:lt,borderBottomRightRadius:lt,boxShadow:ut};function ft(t,{layout:n,layoutId:r}){return z.has(t)||t.startsWith("origin")||(n||void 0!==r)&&(!!ct[t]||"opacity"===t)}function dt(t,n,r){const e=t.style,o=n?.style,a={};if(!e)return a;for(const n in e)(_(e[n])||o&&_(o[n])||ft(n,t)||void 0!==r?.getValue(n)?.liveStyle)&&(a[n]=e[n]);return a}const pt={offset:"stroke-dashoffset",array:"stroke-dasharray"},mt={offset:"strokeDashoffset",array:"strokeDasharray"};const gt=["transform","opacity","offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function ht(t,{attrX:n,attrY:r,attrScale:e,pathLength:o,pathSpacing:a=1,pathOffset:s=0,...i},l,u,c){if(st(t,i,u),l)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:f,style:d}=t;for(const t of gt)void 0!==f[t]&&(d[t]=f[t],delete f[t]);(d.transform||f.transformOrigin)&&(d.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),d.transform&&(d.transformBox=c?.transformBox??"fill-box",delete f.transformBox),void 0!==n&&(f.x=n),void 0!==r&&(f.y=r),void 0!==e&&(f.scale=e),void 0!==o&&function(t,n,r=1,e=0,o=!0){t.pathLength=1;const a=o?pt:mt;t[a.offset]=""+-e,t[a.array]=`${n} ${r}`}(f,o,a,s,!1)}function yt(t){return _(t)?t.get():t}function vt(t){const{initial:n,animate:r}=function(t,n){if(rt(t)){const{initial:n,animate:r}=t;return{initial:!1===n||tt(n)?n:void 0,animate:tt(r)?r:void 0}}return!1!==t.inherit?n:{}}(t,e(y));return o(()=>({initial:n,animate:r}),[bt(n),bt(r)])}function bt(t){return Array.isArray(t)?t.join(" "):t}const wt=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function St(t,n,r){for(const e in n)_(n[e])||ft(e,r)||(t[e]=n[e])}function xt(t,n){const r={};return St(r,t.style||{},t),Object.assign(r,function({transformTemplate:t},n){return o(()=>{const r={style:{},transform:{},transformOrigin:{},vars:{}};return st(r,n,t),Object.assign({},r.vars,r.style)},[n])}(t,n)),r}function Rt(t,n){const r={},e=xt(t,n);return t.drag&&!1!==t.dragListener&&(r.draggable=!1,e.userSelect=e.WebkitUserSelect=e.WebkitTouchCallout="none",e.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),void 0===t.tabIndex&&(t.onTap||t.onTapStart||t.whileTap)&&(r.tabIndex=0),r.style=e,r}const kt=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}});function Bt(t,n,r,e){const a=o(()=>{const r={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};var o;return ht(r,n,"string"==typeof(o=e)&&"svg"===o.toLowerCase(),t.transformTemplate,t.style),{...r.attrs,style:{...r.style}}},[n]);if(t.style){const n={};St(n,t.style,t),a.style={...n,...a.style}}return a}const Tt=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function It(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Tt.has(t)}function At(t,n){return t.startsWith("on")?!It(t):n?.(t)??!It(t)}const Mt=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Pt(t){return"string"==typeof t&&!t.includes("-")&&!!(Mt.indexOf(t)>-1||/[A-Z]/u.test(t))}function Ot(t,n,r,{latestValues:e},i,l=!1,u,c){const f=(u??Pt(t)?Bt:Rt)(n,e,i,t),d=function(t,n,r,e){const o={};for(const a in t)"values"===a&&"object"==typeof t.values||_(t[a])||(At(a,e)||!0===r&&It(a)||!n&&!It(a)||t.draggable&&a.startsWith("onDrag"))&&(o[a]=t[a]);return o}(n,"string"==typeof t,l,c),p=t!==a?{...d,...f,ref:r}:{},{children:m}=n,g=o(()=>_(m)?m.get():m,[m]);return s(t,{...p,children:g})}const Wt=r(null);function Et(t,n,r,e){const o={},a=e(t,{});for(const t in a)o[t]=yt(a[t]);let{initial:s,animate:i}=t;const l=rt(t),u=function(t){return Boolean(rt(t)||t.variants)}(t);n&&u&&!l&&!1!==t.inherit&&(void 0===s&&(s=n.initial),void 0===i&&(i=n.animate));let c=!!r&&!1===r.initial;c=c||!1===s;const f=c?i:s;if(f&&"boolean"!=typeof f&&!Q(f)){const n=Array.isArray(f)?f:[f];for(let r=0;r(n,r)=>{const o=e(y),a=e(Wt),s=()=>function({scrapeMotionValuesFromProps:t,createRenderState:n},r,e,o){return{latestValues:Et(r,e,o,t),renderState:n()}}(t,n,o,a);return r?s():function(t){const n=i(null);return null===n.current&&(n.current=t()),n.current}(s)},Ct=Lt({scrapeMotionValuesFromProps:dt,createRenderState:wt}),jt=Lt({scrapeMotionValuesFromProps:function(t,n,r){const e=dt(t,n,r);for(const r in t)if(_(t[r])||_(n[r])){e[-1!==Z.indexOf(r)?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r]=t[r]}return e},createRenderState:kt}),Vt={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let $t=!1;function Ft(){if($t)return;const t={};for(const n in Vt)t[n]={isEnabled:t=>Vt[n].some(n=>!!t[n])};et=t,$t=!0}function Xt(){return Ft(),et}const Yt=Symbol.for("motionComponentSymbol");function Dt(t,n,r){const e=i(r);l(()=>{e.current=r});const o=i(null);return u(r=>{r&&t.onMount?.(r),n&&(r?n.mount(r):n.unmount());const a=e.current;if("function"==typeof a)if(r){const t=a(r);"function"==typeof t&&(o.current=t)}else o.current?(o.current(),o.current=null):a(r);else a&&(a.current=r)},[n])}const Ht=r({});function Nt(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}const Zt="undefined"!=typeof window?c:f;function zt(t,n,r,o,a,s){const{visualElement:u}=e(y),c=e(g),d=e(Wt),p=e(h),m=p.reducedMotion,v=p.skipAnimations,b=i(null),w=i(!1);o=o||c.renderer,!b.current&&o&&(b.current=o(t,{visualState:n,parent:u,props:r,presenceContext:d,blockInitialAnimation:!!d&&!1===d.initial,reducedMotionConfig:m,skipAnimations:v,isSVG:s}),w.current&&b.current&&(b.current.manuallyAnimateOnMount=!0));const S=b.current,x=e(Ht);!S||S.projection||!a||"html"!==S.type&&"svg"!==S.type||function(t,n,r,e){const{layoutId:o,layout:a,drag:s,dragConstraints:i,layoutScroll:l,layoutRoot:u,layoutAnchor:c,layoutCrossfade:f}=n;t.projection=new r(t.latestValues,n["data-framer-portal-id"]?void 0:Ut(t.parent)),t.projection.setOptions({layoutId:o,layout:a,alwaysMeasureLayout:Boolean(s)||i&&Nt(i),visualElement:t,animationType:"string"==typeof a?a:"both",initialPromotionConfig:e,crossfade:f,layoutScroll:l,layoutRoot:u,layoutAnchor:c})}(b.current,r,a,x);const R=i(!1);l(()=>{S&&R.current&&S.update(r,d)});const k=r[q],B=i(Boolean(k)&&"undefined"!=typeof window&&!window.MotionHandoffIsComplete?.(k)&&window.MotionHasOptimisedAnimation?.(k));return Zt(()=>{w.current=!0,S&&(R.current=!0,window.MotionIsMounted=!0,S.updateFeatures(),S.scheduleRenderMicrotask(),B.current&&S.animationState&&S.animationState.animateChanges())}),f(()=>{S&&(!B.current&&S.animationState&&S.animationState.animateChanges(),B.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(k)}),B.current=!1),S.enteringChildren=void 0)}),S}function Ut(t){if(t)return!1!==t.options.allowProjection?t.projection:Ut(t.parent)}function _t(r,{forwardMotionProps:o=!1,type:a}={},s,i){const l=a?"svg"===a:Pt(r),u=l?jt:Ct;function c(a,s){let c;const f={...e(h),...a,layoutId:qt(a)},{isStatic:d,isValidProp:p}=f,m=vt(a),v=u(a,d);if(!d&&"undefined"!=typeof window){e(g).strict;const t=function(t){const n=Xt(),{drag:r,layout:e}=n;if(!r&&!e)return{};const o={...r,...e};return{MeasureLayout:r?.isEnabled(t)||e?.isEnabled(t)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}(f);c=t.MeasureLayout,m.visualElement=zt(r,v,f,i,t.ProjectionNode,l)}return t(y.Provider,{value:m,children:[c&&m.visualElement?n(c,{visualElement:m.visualElement,...f}):null,Ot(r,a,Dt(v,m.visualElement,s),v,d,o,l,p)]})}c.displayName=`motion.${"string"==typeof r?r:`create(${r.displayName??r.name??""})`}`;const f=d(c);return f[Yt]=r,f}function qt({layoutId:t}){const n=e(m).id;return n&&void 0!==t?n+"-"+t:t}function Gt(t,n){return _t(t,n)}const Jt=Gt("div");export{Jt as MotionDiv}; +//# sourceMappingURL=size-rollup-m.js.map diff --git a/node_modules/framer-motion/dist/size-rollup-m.js.map b/node_modules/framer-motion/dist/size-rollup-m.js.map new file mode 100644 index 0000000..8ec200c --- /dev/null +++ b/node_modules/framer-motion/dist/size-rollup-m.js.map @@ -0,0 +1 @@ +{"version":3,"file":"size-rollup-m.js","sources":["../../motion-utils/dist/es/clamp.mjs","../lib/context/LayoutGroupContext.js","../lib/context/LazyContext.js","../lib/context/MotionConfigContext.js","../lib/context/MotionContext/index.js","../../motion-dom/dist/es/animation/utils/is-css-variable.mjs","../../motion-dom/dist/es/value/types/numbers/index.mjs","../../motion-dom/dist/es/value/types/utils/sanitize.mjs","../../motion-dom/dist/es/value/types/utils/float-regex.mjs","../../motion-dom/dist/es/value/types/utils/single-color-regex.mjs","../../motion-dom/dist/es/value/types/color/utils.mjs","../../motion-dom/dist/es/value/types/utils/is-nullish.mjs","../../motion-dom/dist/es/value/types/color/rgba.mjs","../../motion-dom/dist/es/value/types/color/hex.mjs","../../motion-dom/dist/es/value/types/numbers/units.mjs","../../motion-dom/dist/es/value/types/color/hsla.mjs","../../motion-dom/dist/es/value/types/color/index.mjs","../../motion-dom/dist/es/value/types/utils/color-regex.mjs","../../motion-dom/dist/es/value/types/complex/index.mjs","../../motion-dom/dist/es/render/utils/keys-transform.mjs","../../motion-dom/dist/es/render/utils/resolve-variants.mjs","../../motion-dom/dist/es/value/utils/is-motion-value.mjs","../../motion-dom/dist/es/animation/optimized-appear/data-id.mjs","../../motion-dom/dist/es/render/dom/utils/camel-to-dash.mjs","../../motion-dom/dist/es/value/types/int.mjs","../../motion-dom/dist/es/value/types/maps/number.mjs","../../motion-dom/dist/es/value/types/maps/transform.mjs","../../motion-dom/dist/es/value/types/utils/get-as-type.mjs","../../motion-dom/dist/es/render/utils/is-animation-controls.mjs","../../motion-dom/dist/es/render/utils/is-variant-label.mjs","../../motion-dom/dist/es/render/utils/variant-props.mjs","../../motion-dom/dist/es/render/utils/is-controlling-variants.mjs","../../motion-dom/dist/es/render/VisualElement.mjs","../../motion-dom/dist/es/render/html/utils/build-transform.mjs","../../motion-dom/dist/es/render/html/utils/build-styles.mjs","../../motion-dom/dist/es/projection/styles/scale-border-radius.mjs","../../motion-dom/dist/es/projection/styles/scale-box-shadow.mjs","../../motion-dom/dist/es/utils/mix/number.mjs","../../motion-dom/dist/es/projection/styles/scale-correction.mjs","../../motion-dom/dist/es/utils/border-radius.mjs","../../motion-dom/dist/es/render/utils/is-forced-motion-value.mjs","../../motion-dom/dist/es/render/html/utils/scrape-motion-values.mjs","../../motion-dom/dist/es/render/svg/utils/path.mjs","../../motion-dom/dist/es/render/svg/utils/build-attrs.mjs","../../motion-dom/dist/es/value/utils/resolve-motion-value.mjs","../lib/context/MotionContext/create.js","../lib/context/MotionContext/utils.js","../lib/render/html/utils/create-render-state.js","../lib/render/html/use-props.js","../lib/render/svg/utils/create-render-state.js","../lib/render/svg/use-props.js","../../motion-dom/dist/es/render/svg/utils/is-svg-tag.mjs","../lib/motion/utils/valid-prop.js","../lib/render/dom/utils/filter-props.js","../lib/render/svg/lowercase-elements.js","../lib/render/dom/utils/is-svg-component.js","../lib/render/dom/use-render.js","../lib/context/PresenceContext.js","../lib/motion/utils/use-visual-state.js","../lib/utils/use-constant.js","../lib/render/html/use-html-visual-state.js","../lib/render/svg/use-svg-visual-state.js","../../motion-dom/dist/es/render/svg/utils/scrape-motion-values.mjs","../lib/motion/features/definitions.js","../lib/motion/utils/symbol.js","../lib/motion/utils/use-motion-ref.js","../lib/context/SwitchLayoutGroupContext.js","../lib/utils/is-ref-object.js","../lib/utils/is-browser.js","../lib/utils/use-isomorphic-effect.js","../lib/motion/utils/use-visual-element.js","../lib/motion/index.js","../lib/render/components/m/create.js","../lib/render/components/m/elements.js","../lib/render/components/m/size.js"],"sourcesContent":["const clamp = (min, max, v) => {\n if (v > max)\n return max;\n if (v < min)\n return min;\n return v;\n};\n\nexport { clamp };\n//# sourceMappingURL=clamp.mjs.map\n","\"use client\";\nimport { createContext } from \"react\";\nexport const LayoutGroupContext = createContext({});\n//# sourceMappingURL=LayoutGroupContext.js.map","\"use client\";\nimport { createContext } from \"react\";\nexport const LazyContext = createContext({ strict: false });\n//# sourceMappingURL=LazyContext.js.map","\"use client\";\nimport { createContext } from \"react\";\n/**\n * @public\n */\nexport const MotionConfigContext = createContext({\n transformPagePoint: (p) => p,\n isStatic: false,\n reducedMotion: \"never\",\n});\n//# sourceMappingURL=MotionConfigContext.js.map","\"use client\";\nimport { createContext } from \"react\";\nexport const MotionContext = /* @__PURE__ */ createContext({});\n//# sourceMappingURL=index.js.map","const checkStringStartsWith = (token) => (key) => typeof key === \"string\" && key.startsWith(token);\nconst isCSSVariableName = \n/*@__PURE__*/ checkStringStartsWith(\"--\");\nconst startsAsVariableToken = \n/*@__PURE__*/ checkStringStartsWith(\"var(--\");\nconst isCSSVariableToken = (value) => {\n const startsWithToken = startsAsVariableToken(value);\n if (!startsWithToken)\n return false;\n // Ensure any comments are stripped from the value as this can harm performance of the regex.\n return singleCssVariableRegex.test(value.split(\"/*\")[0].trim());\n};\nconst singleCssVariableRegex = /var\\(--(?:[\\w-]+\\s*|[\\w-]+\\s*,(?:\\s*[^)(\\s]|\\s*\\((?:[^)(]|\\([^)(]*\\))*\\))+\\s*)\\)$/iu;\n/**\n * Check if a value contains a CSS variable anywhere (e.g. inside calc()).\n * Unlike isCSSVariableToken which checks if the value IS a var() token,\n * this checks if the value CONTAINS var() somewhere in the string.\n */\nfunction containsCSSVariable(value) {\n if (typeof value !== \"string\")\n return false;\n // Strip comments to avoid false positives\n return value.split(\"/*\")[0].includes(\"var(--\");\n}\n\nexport { containsCSSVariable, isCSSVariableName, isCSSVariableToken };\n//# sourceMappingURL=is-css-variable.mjs.map\n","import { clamp } from 'motion-utils';\n\nconst number = {\n test: (v) => typeof v === \"number\",\n parse: parseFloat,\n transform: (v) => v,\n};\nconst alpha = {\n ...number,\n transform: (v) => clamp(0, 1, v),\n};\nconst scale = {\n ...number,\n default: 1,\n};\n\nexport { alpha, number, scale };\n//# sourceMappingURL=index.mjs.map\n","// If this number is a decimal, make it just five decimal places\n// to avoid exponents\nconst sanitize = (v) => Math.round(v * 100000) / 100000;\n\nexport { sanitize };\n//# sourceMappingURL=sanitize.mjs.map\n","const floatRegex = /-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)/gu;\n\nexport { floatRegex };\n//# sourceMappingURL=float-regex.mjs.map\n","const singleColorRegex = /^(?:#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\))$/iu;\n\nexport { singleColorRegex };\n//# sourceMappingURL=single-color-regex.mjs.map\n","import { floatRegex } from '../utils/float-regex.mjs';\nimport { isNullish } from '../utils/is-nullish.mjs';\nimport { singleColorRegex } from '../utils/single-color-regex.mjs';\n\n/**\n * Returns true if the provided string is a color, ie rgba(0,0,0,0) or #000,\n * but false if a number or multiple colors\n */\nconst isColorString = (type, testProp) => (v) => {\n return Boolean((typeof v === \"string\" &&\n singleColorRegex.test(v) &&\n v.startsWith(type)) ||\n (testProp &&\n !isNullish(v) &&\n Object.prototype.hasOwnProperty.call(v, testProp)));\n};\nconst splitColor = (aName, bName, cName) => (v) => {\n if (typeof v !== \"string\")\n return v;\n const [a, b, c, alpha] = v.match(floatRegex);\n return {\n [aName]: parseFloat(a),\n [bName]: parseFloat(b),\n [cName]: parseFloat(c),\n alpha: alpha !== undefined ? parseFloat(alpha) : 1,\n };\n};\n\nexport { isColorString, splitColor };\n//# sourceMappingURL=utils.mjs.map\n","function isNullish(v) {\n return v == null;\n}\n\nexport { isNullish };\n//# sourceMappingURL=is-nullish.mjs.map\n","import { clamp } from 'motion-utils';\nimport { number, alpha } from '../numbers/index.mjs';\nimport { sanitize } from '../utils/sanitize.mjs';\nimport { splitColor, isColorString } from './utils.mjs';\n\nconst clampRgbUnit = (v) => clamp(0, 255, v);\nconst rgbUnit = {\n ...number,\n transform: (v) => Math.round(clampRgbUnit(v)),\n};\nconst rgba = {\n test: /*@__PURE__*/ isColorString(\"rgb\", \"red\"),\n parse: /*@__PURE__*/ splitColor(\"red\", \"green\", \"blue\"),\n transform: ({ red, green, blue, alpha: alpha$1 = 1 }) => \"rgba(\" +\n rgbUnit.transform(red) +\n \", \" +\n rgbUnit.transform(green) +\n \", \" +\n rgbUnit.transform(blue) +\n \", \" +\n sanitize(alpha.transform(alpha$1)) +\n \")\",\n};\n\nexport { rgbUnit, rgba };\n//# sourceMappingURL=rgba.mjs.map\n","import { rgba } from './rgba.mjs';\nimport { isColorString } from './utils.mjs';\n\nfunction parseHex(v) {\n let r = \"\";\n let g = \"\";\n let b = \"\";\n let a = \"\";\n // If we have 6 characters, ie #FF0000\n if (v.length > 5) {\n r = v.substring(1, 3);\n g = v.substring(3, 5);\n b = v.substring(5, 7);\n a = v.substring(7, 9);\n // Or we have 3 characters, ie #F00\n }\n else {\n r = v.substring(1, 2);\n g = v.substring(2, 3);\n b = v.substring(3, 4);\n a = v.substring(4, 5);\n r += r;\n g += g;\n b += b;\n a += a;\n }\n return {\n red: parseInt(r, 16),\n green: parseInt(g, 16),\n blue: parseInt(b, 16),\n alpha: a ? parseInt(a, 16) / 255 : 1,\n };\n}\nconst hex = {\n test: /*@__PURE__*/ isColorString(\"#\"),\n parse: parseHex,\n transform: rgba.transform,\n};\n\nexport { hex };\n//# sourceMappingURL=hex.mjs.map\n","/*#__NO_SIDE_EFFECTS__*/\nconst createUnitType = (unit) => ({\n test: (v) => typeof v === \"string\" && v.endsWith(unit) && v.split(\" \").length === 1,\n parse: parseFloat,\n transform: (v) => `${v}${unit}`,\n});\nconst degrees = /*@__PURE__*/ createUnitType(\"deg\");\nconst percent = /*@__PURE__*/ createUnitType(\"%\");\nconst px = /*@__PURE__*/ createUnitType(\"px\");\nconst vh = /*@__PURE__*/ createUnitType(\"vh\");\nconst vw = /*@__PURE__*/ createUnitType(\"vw\");\nconst progressPercentage = /*@__PURE__*/ (() => ({\n ...percent,\n parse: (v) => percent.parse(v) / 100,\n transform: (v) => percent.transform(v * 100),\n}))();\n\nexport { degrees, percent, progressPercentage, px, vh, vw };\n//# sourceMappingURL=units.mjs.map\n","import { alpha } from '../numbers/index.mjs';\nimport { percent } from '../numbers/units.mjs';\nimport { sanitize } from '../utils/sanitize.mjs';\nimport { splitColor, isColorString } from './utils.mjs';\n\nconst hsla = {\n test: /*@__PURE__*/ isColorString(\"hsl\", \"hue\"),\n parse: /*@__PURE__*/ splitColor(\"hue\", \"saturation\", \"lightness\"),\n transform: ({ hue, saturation, lightness, alpha: alpha$1 = 1 }) => {\n return (\"hsla(\" +\n Math.round(hue) +\n \", \" +\n percent.transform(sanitize(saturation)) +\n \", \" +\n percent.transform(sanitize(lightness)) +\n \", \" +\n sanitize(alpha.transform(alpha$1)) +\n \")\");\n },\n};\n\nexport { hsla };\n//# sourceMappingURL=hsla.mjs.map\n","import { hex } from './hex.mjs';\nimport { hsla } from './hsla.mjs';\nimport { rgba } from './rgba.mjs';\n\nconst color = {\n test: (v) => rgba.test(v) || hex.test(v) || hsla.test(v),\n parse: (v) => {\n if (rgba.test(v)) {\n return rgba.parse(v);\n }\n else if (hsla.test(v)) {\n return hsla.parse(v);\n }\n else {\n return hex.parse(v);\n }\n },\n transform: (v) => {\n return typeof v === \"string\"\n ? v\n : v.hasOwnProperty(\"red\")\n ? rgba.transform(v)\n : hsla.transform(v);\n },\n getAnimatableNone: (v) => {\n const parsed = color.parse(v);\n parsed.alpha = 0;\n return color.transform(parsed);\n },\n};\n\nexport { color };\n//# sourceMappingURL=index.mjs.map\n","const colorRegex = /(?:#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\))/giu;\n\nexport { colorRegex };\n//# sourceMappingURL=color-regex.mjs.map\n","import { color } from '../color/index.mjs';\nimport { colorRegex } from '../utils/color-regex.mjs';\nimport { floatRegex } from '../utils/float-regex.mjs';\nimport { sanitize } from '../utils/sanitize.mjs';\n\nfunction test(v) {\n return (isNaN(v) &&\n typeof v === \"string\" &&\n (v.match(floatRegex)?.length || 0) +\n (v.match(colorRegex)?.length || 0) >\n 0);\n}\nconst NUMBER_TOKEN = \"number\";\nconst COLOR_TOKEN = \"color\";\nconst VAR_TOKEN = \"var\";\nconst VAR_FUNCTION_TOKEN = \"var(\";\nconst SPLIT_TOKEN = \"${}\";\n// this regex consists of the `singleCssVariableRegex|rgbHSLValueRegex|digitRegex`\nconst complexRegex = /var\\s*\\(\\s*--(?:[\\w-]+\\s*|[\\w-]+\\s*,(?:\\s*[^)(\\s]|\\s*\\((?:[^)(]|\\([^)(]*\\))*\\))+\\s*)\\)|#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\)|-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)/giu;\nfunction analyseComplexValue(value) {\n const originalValue = value.toString();\n const values = [];\n const indexes = {\n color: [],\n number: [],\n var: [],\n };\n const types = [];\n let i = 0;\n const tokenised = originalValue.replace(complexRegex, (parsedValue) => {\n if (color.test(parsedValue)) {\n indexes.color.push(i);\n types.push(COLOR_TOKEN);\n values.push(color.parse(parsedValue));\n }\n else if (parsedValue.startsWith(VAR_FUNCTION_TOKEN)) {\n indexes.var.push(i);\n types.push(VAR_TOKEN);\n values.push(parsedValue);\n }\n else {\n indexes.number.push(i);\n types.push(NUMBER_TOKEN);\n values.push(parseFloat(parsedValue));\n }\n ++i;\n return SPLIT_TOKEN;\n });\n const split = tokenised.split(SPLIT_TOKEN);\n return { values, split, indexes, types };\n}\nfunction parseComplexValue(v) {\n return analyseComplexValue(v).values;\n}\nfunction buildTransformer({ split, types }) {\n const numSections = split.length;\n return (v) => {\n let output = \"\";\n for (let i = 0; i < numSections; i++) {\n output += split[i];\n if (v[i] !== undefined) {\n const type = types[i];\n if (type === NUMBER_TOKEN) {\n output += sanitize(v[i]);\n }\n else if (type === COLOR_TOKEN) {\n output += color.transform(v[i]);\n }\n else {\n output += v[i];\n }\n }\n }\n return output;\n };\n}\nfunction createTransformer(source) {\n return buildTransformer(analyseComplexValue(source));\n}\nconst convertNumbersToZero = (v) => typeof v === \"number\" ? 0 : color.test(v) ? color.getAnimatableNone(v) : v;\n/**\n * Convert a parsed value to its zero equivalent, but preserve numbers\n * that act as divisors in CSS calc() expressions.\n *\n * analyseComplexValue extracts numbers from CSS strings and puts the\n * surrounding text into a `split` template array. For example:\n * \"calc(var(--gap) / 5)\" → values: [var(--gap), 5]\n * split: [\"calc(\", \" / \", \")\"]\n *\n * When building a zero-equivalent for animation, naively zeroing all\n * numbers turns the divisor into 0 → \"calc(var(--gap) / 0)\" → NaN.\n * We detect this by checking whether the text preceding a number\n * (split[i]) ends with \"/\" — the CSS calc division operator.\n */\nconst convertToZero = (value, splitBefore) => {\n if (typeof value === \"number\") {\n return splitBefore?.trim().endsWith(\"/\") ? value : 0;\n }\n return convertNumbersToZero(value);\n};\nfunction getAnimatableNone(v) {\n const info = analyseComplexValue(v);\n const transformer = buildTransformer(info);\n return transformer(info.values.map((value, i) => convertToZero(value, info.split[i])));\n}\nconst complex = {\n test,\n parse: parseComplexValue,\n createTransformer,\n getAnimatableNone,\n};\n\nexport { analyseComplexValue, complex };\n//# sourceMappingURL=index.mjs.map\n","/**\n * Generate a list of every possible transform key.\n */\nconst transformPropOrder = [\n \"transformPerspective\",\n \"x\",\n \"y\",\n \"z\",\n \"translateX\",\n \"translateY\",\n \"translateZ\",\n \"scale\",\n \"scaleX\",\n \"scaleY\",\n \"rotate\",\n \"rotateX\",\n \"rotateY\",\n \"rotateZ\",\n \"skew\",\n \"skewX\",\n \"skewY\",\n];\n/**\n * A quick lookup for transform props.\n *\n * `pathRotation` is a transform for routing purposes (skipped from raw\n * style application, wired to the transform composite, flags transform\n * dirty) but is intentionally NOT in `transformPropOrder` — it is\n * composed onto `rotate` at the build sites, not serialized in its own\n * slot, and must stay out of the order-array consumers (parse-transform,\n * unit-conversion, keys-position).\n */\nconst transformProps = /*@__PURE__*/ (() => new Set([...transformPropOrder, \"pathRotation\"]))();\n\nexport { transformPropOrder, transformProps };\n//# sourceMappingURL=keys-transform.mjs.map\n","function getValueState(visualElement) {\n const state = [{}, {}];\n visualElement?.values.forEach((value, key) => {\n state[0][key] = value.get();\n state[1][key] = value.getVelocity();\n });\n return state;\n}\nfunction resolveVariantFromProps(props, definition, custom, visualElement) {\n /**\n * If the variant definition is a function, resolve.\n */\n if (typeof definition === \"function\") {\n const [current, velocity] = getValueState(visualElement);\n definition = definition(custom !== undefined ? custom : props.custom, current, velocity);\n }\n /**\n * If the variant definition is a variant label, or\n * the function returned a variant label, resolve.\n */\n if (typeof definition === \"string\") {\n definition = props.variants && props.variants[definition];\n }\n /**\n * At this point we've resolved both functions and variant labels,\n * but the resolved variant label might itself have been a function.\n * If so, resolve. This can only have returned a valid target object.\n */\n if (typeof definition === \"function\") {\n const [current, velocity] = getValueState(visualElement);\n definition = definition(custom !== undefined ? custom : props.custom, current, velocity);\n }\n return definition;\n}\n\nexport { resolveVariantFromProps };\n//# sourceMappingURL=resolve-variants.mjs.map\n","const isMotionValue = (value) => Boolean(value && value.getVelocity);\n\nexport { isMotionValue };\n//# sourceMappingURL=is-motion-value.mjs.map\n","import { camelToDash } from '../../render/dom/utils/camel-to-dash.mjs';\n\nconst optimizedAppearDataId = \"framerAppearId\";\nconst optimizedAppearDataAttribute = \"data-\" + camelToDash(optimizedAppearDataId);\n\nexport { optimizedAppearDataAttribute, optimizedAppearDataId };\n//# sourceMappingURL=data-id.mjs.map\n","function camelToDash(str) {\n return str.replace(/([A-Z])/g, (match) => `-${match.toLowerCase()}`);\n}\n\nexport { camelToDash };\n//# sourceMappingURL=camel-to-dash.mjs.map\n","import { number } from './numbers/index.mjs';\n\nconst int = {\n ...number,\n transform: Math.round,\n};\n\nexport { int };\n//# sourceMappingURL=int.mjs.map\n","import { int } from '../int.mjs';\nimport { alpha } from '../numbers/index.mjs';\nimport { px } from '../numbers/units.mjs';\nimport { transformValueTypes } from './transform.mjs';\n\nconst numberValueTypes = {\n // Border props\n borderWidth: px,\n borderTopWidth: px,\n borderRightWidth: px,\n borderBottomWidth: px,\n borderLeftWidth: px,\n borderRadius: px,\n borderTopLeftRadius: px,\n borderTopRightRadius: px,\n borderBottomRightRadius: px,\n borderBottomLeftRadius: px,\n // Positioning props\n width: px,\n maxWidth: px,\n height: px,\n maxHeight: px,\n top: px,\n right: px,\n bottom: px,\n left: px,\n inset: px,\n insetBlock: px,\n insetBlockStart: px,\n insetBlockEnd: px,\n insetInline: px,\n insetInlineStart: px,\n insetInlineEnd: px,\n // Spacing props\n padding: px,\n paddingTop: px,\n paddingRight: px,\n paddingBottom: px,\n paddingLeft: px,\n paddingBlock: px,\n paddingBlockStart: px,\n paddingBlockEnd: px,\n paddingInline: px,\n paddingInlineStart: px,\n paddingInlineEnd: px,\n margin: px,\n marginTop: px,\n marginRight: px,\n marginBottom: px,\n marginLeft: px,\n marginBlock: px,\n marginBlockStart: px,\n marginBlockEnd: px,\n marginInline: px,\n marginInlineStart: px,\n marginInlineEnd: px,\n // Typography\n fontSize: px,\n // Misc\n backgroundPositionX: px,\n backgroundPositionY: px,\n ...transformValueTypes,\n zIndex: int,\n // SVG\n fillOpacity: alpha,\n strokeOpacity: alpha,\n numOctaves: int,\n};\n\nexport { numberValueTypes };\n//# sourceMappingURL=number.mjs.map\n","import { alpha, scale } from '../numbers/index.mjs';\nimport { px, progressPercentage, degrees } from '../numbers/units.mjs';\n\nconst transformValueTypes = {\n rotate: degrees,\n /**\n * Internal channel for `transition.path` orientToPath. Composed onto\n * `rotate` at the transform-build sites so the user's `rotate` is\n * never read or overwritten. Not part of `transformPropOrder`.\n */\n pathRotation: degrees,\n rotateX: degrees,\n rotateY: degrees,\n rotateZ: degrees,\n scale,\n scaleX: scale,\n scaleY: scale,\n scaleZ: scale,\n skew: degrees,\n skewX: degrees,\n skewY: degrees,\n distance: px,\n translateX: px,\n translateY: px,\n translateZ: px,\n x: px,\n y: px,\n z: px,\n perspective: px,\n transformPerspective: px,\n opacity: alpha,\n originX: progressPercentage,\n originY: progressPercentage,\n originZ: px,\n};\n\nexport { transformValueTypes };\n//# sourceMappingURL=transform.mjs.map\n","/**\n * Provided a value and a ValueType, returns the value as that value type.\n */\nconst getValueAsType = (value, type) => {\n return type && typeof value === \"number\"\n ? type.transform(value)\n : value;\n};\n\nexport { getValueAsType };\n//# sourceMappingURL=get-as-type.mjs.map\n","function isAnimationControls(v) {\n return (v !== null &&\n typeof v === \"object\" &&\n typeof v.start === \"function\");\n}\n\nexport { isAnimationControls };\n//# sourceMappingURL=is-animation-controls.mjs.map\n","/**\n * Decides if the supplied variable is variant label\n */\nfunction isVariantLabel(v) {\n return typeof v === \"string\" || Array.isArray(v);\n}\n\nexport { isVariantLabel };\n//# sourceMappingURL=is-variant-label.mjs.map\n","const variantPriorityOrder = [\n \"animate\",\n \"whileInView\",\n \"whileFocus\",\n \"whileHover\",\n \"whileTap\",\n \"whileDrag\",\n \"exit\",\n];\nconst variantProps = [\"initial\", ...variantPriorityOrder];\n\nexport { variantPriorityOrder, variantProps };\n//# sourceMappingURL=variant-props.mjs.map\n","import { isAnimationControls } from './is-animation-controls.mjs';\nimport { isVariantLabel } from './is-variant-label.mjs';\nimport { variantProps } from './variant-props.mjs';\n\nfunction isControllingVariants(props) {\n return (isAnimationControls(props.animate) ||\n variantProps.some((name) => isVariantLabel(props[name])));\n}\nfunction isVariantNode(props) {\n return Boolean(isControllingVariants(props) || props.variants);\n}\n\nexport { isControllingVariants, isVariantNode };\n//# sourceMappingURL=is-controlling-variants.mjs.map\n","import { warnOnce, secondsToMilliseconds, isNumericalString, isZeroValueString, SubscriptionManager } from 'motion-utils';\nimport { KeyframeResolver } from '../animation/keyframes/KeyframesResolver.mjs';\nimport { NativeAnimation } from '../animation/NativeAnimation.mjs';\nimport { acceleratedValues } from '../animation/waapi/utils/accelerated-values.mjs';\nimport { microtask } from '../frameloop/microtask.mjs';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { createBox } from '../projection/geometry/models.mjs';\nimport { motionValue } from '../value/index.mjs';\nimport { complex } from '../value/types/complex/index.mjs';\nimport { getAnimatableNone } from '../value/types/utils/animatable-none.mjs';\nimport { findValueType } from '../value/types/utils/find.mjs';\nimport { isMotionValue } from '../value/utils/is-motion-value.mjs';\nimport { visualElementStore } from './store.mjs';\nimport { isControllingVariants, isVariantNode } from './utils/is-controlling-variants.mjs';\nimport { transformProps } from './utils/keys-transform.mjs';\nimport { updateMotionValuesFromProps } from './utils/motion-values.mjs';\nimport { initPrefersReducedMotion } from './utils/reduced-motion/index.mjs';\nimport { resolveVariantFromProps } from './utils/resolve-variants.mjs';\nimport { hasReducedMotionListener, prefersReducedMotion } from './utils/reduced-motion/state.mjs';\nimport { frame, cancelFrame } from '../frameloop/frame.mjs';\n\nconst propEventHandlers = [\n \"AnimationStart\",\n \"AnimationComplete\",\n \"Update\",\n \"BeforeLayoutMeasure\",\n \"LayoutMeasure\",\n \"LayoutAnimationStart\",\n \"LayoutAnimationComplete\",\n];\n/**\n * Static feature definitions - can be injected by framework layer\n */\nlet featureDefinitions = {};\n/**\n * Set feature definitions for all VisualElements.\n * This should be called by the framework layer (e.g., framer-motion) during initialization.\n */\nfunction setFeatureDefinitions(definitions) {\n featureDefinitions = definitions;\n}\n/**\n * Get the current feature definitions\n */\nfunction getFeatureDefinitions() {\n return featureDefinitions;\n}\n/**\n * A VisualElement is an imperative abstraction around UI elements such as\n * HTMLElement, SVGElement, Three.Object3D etc.\n */\nclass VisualElement {\n /**\n * This method takes React props and returns found MotionValues. For example, HTML\n * MotionValues will be found within the style prop, whereas for Three.js within attribute arrays.\n *\n * This isn't an abstract method as it needs calling in the constructor, but it is\n * intended to be one.\n */\n scrapeMotionValuesFromProps(_props, _prevProps, _visualElement) {\n return {};\n }\n constructor({ parent, props, presenceContext, reducedMotionConfig, skipAnimations, blockInitialAnimation, visualState, }, options = {}) {\n /**\n * A reference to the current underlying Instance, e.g. a HTMLElement\n * or Three.Mesh etc.\n */\n this.current = null;\n /**\n * A set containing references to this VisualElement's children.\n */\n this.children = new Set();\n /**\n * Determine what role this visual element should take in the variant tree.\n */\n this.isVariantNode = false;\n this.isControllingVariants = false;\n /**\n * Decides whether this VisualElement should animate in reduced motion\n * mode.\n *\n * TODO: This is currently set on every individual VisualElement but feels\n * like it could be set globally.\n */\n this.shouldReduceMotion = null;\n /**\n * Decides whether animations should be skipped for this VisualElement.\n * Useful for E2E tests and visual regression testing.\n */\n this.shouldSkipAnimations = false;\n /**\n * A map of all motion values attached to this visual element. Motion\n * values are source of truth for any given animated value. A motion\n * value might be provided externally by the component via props.\n */\n this.values = new Map();\n this.KeyframeResolver = KeyframeResolver;\n /**\n * Cleanup functions for active features (hover/tap/exit etc)\n */\n this.features = {};\n /**\n * A map of every subscription that binds the provided or generated\n * motion values onChange listeners to this visual element.\n */\n this.valueSubscriptions = new Map();\n /**\n * A reference to the previously-provided motion values as returned\n * from scrapeMotionValuesFromProps. We use the keys in here to determine\n * if any motion values need to be removed after props are updated.\n */\n this.prevMotionValues = {};\n /**\n * Track whether this element has been mounted before, to detect\n * remounts after Suspense unmount/remount cycles.\n */\n this.hasBeenMounted = false;\n /**\n * An object containing a SubscriptionManager for each active event.\n */\n this.events = {};\n /**\n * An object containing an unsubscribe function for each prop event subscription.\n * For example, every \"Update\" event can have multiple subscribers via\n * VisualElement.on(), but only one of those can be defined via the onUpdate prop.\n */\n this.propEventSubscriptions = {};\n this.notifyUpdate = () => this.notify(\"Update\", this.latestValues);\n this.render = () => {\n if (!this.current)\n return;\n this.triggerBuild();\n this.renderInstance(this.current, this.renderState, this.props.style, this.projection);\n };\n this.renderScheduledAt = 0.0;\n this.scheduleRender = () => {\n const now = time.now();\n if (this.renderScheduledAt < now) {\n this.renderScheduledAt = now;\n frame.render(this.render, false, true);\n }\n };\n const { latestValues, renderState } = visualState;\n this.latestValues = latestValues;\n this.baseTarget = { ...latestValues };\n this.initialValues = props.initial ? { ...latestValues } : {};\n this.renderState = renderState;\n this.parent = parent;\n this.props = props;\n this.presenceContext = presenceContext;\n this.depth = parent ? parent.depth + 1 : 0;\n this.reducedMotionConfig = reducedMotionConfig;\n this.skipAnimationsConfig = skipAnimations;\n this.options = options;\n this.blockInitialAnimation = Boolean(blockInitialAnimation);\n this.isControllingVariants = isControllingVariants(props);\n this.isVariantNode = isVariantNode(props);\n if (this.isVariantNode) {\n this.variantChildren = new Set();\n }\n this.manuallyAnimateOnMount = Boolean(parent && parent.current);\n /**\n * Any motion values that are provided to the element when created\n * aren't yet bound to the element, as this would technically be impure.\n * However, we iterate through the motion values and set them to the\n * initial values for this component.\n *\n * TODO: This is impure and we should look at changing this to run on mount.\n * Doing so will break some tests but this isn't necessarily a breaking change,\n * more a reflection of the test.\n */\n const { willChange, ...initialMotionValues } = this.scrapeMotionValuesFromProps(props, {}, this);\n for (const key in initialMotionValues) {\n const value = initialMotionValues[key];\n if (latestValues[key] !== undefined && isMotionValue(value)) {\n value.set(latestValues[key]);\n }\n }\n }\n mount(instance) {\n /**\n * If this element has been mounted before (e.g. after a Suspense\n * unmount/remount), reset motion values to their initial state\n * so animations replay correctly from initial → animate.\n */\n if (this.hasBeenMounted) {\n for (const key in this.initialValues) {\n this.values.get(key)?.jump(this.initialValues[key]);\n this.latestValues[key] = this.initialValues[key];\n }\n }\n this.current = instance;\n visualElementStore.set(instance, this);\n if (this.projection && !this.projection.instance) {\n this.projection.mount(instance);\n }\n if (this.parent && this.isVariantNode && !this.isControllingVariants) {\n this.removeFromVariantTree = this.parent.addVariantChild(this);\n }\n this.values.forEach((value, key) => this.bindToMotionValue(key, value));\n /**\n * Determine reduced motion preference. Only initialize the matchMedia\n * listener if we actually need the dynamic value (i.e., when config\n * is neither \"never\" nor \"always\").\n */\n if (this.reducedMotionConfig === \"never\") {\n this.shouldReduceMotion = false;\n }\n else if (this.reducedMotionConfig === \"always\") {\n this.shouldReduceMotion = true;\n }\n else {\n if (!hasReducedMotionListener.current) {\n initPrefersReducedMotion();\n }\n this.shouldReduceMotion = prefersReducedMotion.current;\n }\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(this.shouldReduceMotion !== true, \"You have Reduced Motion enabled on your device. Animations may not appear as expected.\", \"reduced-motion-disabled\");\n }\n /**\n * Set whether animations should be skipped based on the config.\n */\n this.shouldSkipAnimations = this.skipAnimationsConfig ?? false;\n this.parent?.addChild(this);\n this.update(this.props, this.presenceContext);\n this.hasBeenMounted = true;\n }\n unmount() {\n this.projection && this.projection.unmount();\n cancelFrame(this.notifyUpdate);\n cancelFrame(this.render);\n this.valueSubscriptions.forEach((remove) => remove());\n this.valueSubscriptions.clear();\n this.removeFromVariantTree && this.removeFromVariantTree();\n this.parent?.removeChild(this);\n for (const key in this.events) {\n this.events[key].clear();\n }\n for (const key in this.features) {\n const feature = this.features[key];\n if (feature) {\n feature.unmount();\n feature.isMounted = false;\n }\n }\n this.current = null;\n }\n addChild(child) {\n this.children.add(child);\n this.enteringChildren ?? (this.enteringChildren = new Set());\n this.enteringChildren.add(child);\n }\n removeChild(child) {\n this.children.delete(child);\n this.enteringChildren && this.enteringChildren.delete(child);\n }\n bindToMotionValue(key, value) {\n if (this.valueSubscriptions.has(key)) {\n this.valueSubscriptions.get(key)();\n }\n if (value.accelerate &&\n acceleratedValues.has(key) &&\n this.current instanceof HTMLElement) {\n const { factory, keyframes, times, ease, duration } = value.accelerate;\n const animation = new NativeAnimation({\n element: this.current,\n name: key,\n keyframes,\n times,\n ease,\n duration: secondsToMilliseconds(duration),\n });\n const cleanup = factory(animation);\n this.valueSubscriptions.set(key, () => {\n cleanup();\n animation.cancel();\n });\n return;\n }\n const valueIsTransform = transformProps.has(key);\n if (valueIsTransform && this.onBindTransform) {\n this.onBindTransform();\n }\n const removeOnChange = value.on(\"change\", (latestValue) => {\n this.latestValues[key] = latestValue;\n this.props.onUpdate && frame.preRender(this.notifyUpdate);\n if (valueIsTransform && this.projection) {\n this.projection.isTransformDirty = true;\n }\n this.scheduleRender();\n });\n let removeSyncCheck;\n if (typeof window !== \"undefined\" &&\n window.MotionCheckAppearSync) {\n removeSyncCheck = window.MotionCheckAppearSync(this, key, value);\n }\n this.valueSubscriptions.set(key, () => {\n removeOnChange();\n if (removeSyncCheck)\n removeSyncCheck();\n // Defer to MotionValue.on(\"change\") auto-stop so React 19 remounts\n // can resubscribe before the animation is cancelled (#3315).\n });\n }\n sortNodePosition(other) {\n /**\n * If these nodes aren't even of the same type we can't compare their depth.\n */\n if (!this.current ||\n !this.sortInstanceNodePosition ||\n this.type !== other.type) {\n return 0;\n }\n return this.sortInstanceNodePosition(this.current, other.current);\n }\n updateFeatures() {\n let key = \"animation\";\n for (key in featureDefinitions) {\n const featureDefinition = featureDefinitions[key];\n if (!featureDefinition)\n continue;\n const { isEnabled, Feature: FeatureConstructor } = featureDefinition;\n /**\n * If this feature is enabled but not active, make a new instance.\n */\n if (!this.features[key] &&\n FeatureConstructor &&\n isEnabled(this.props)) {\n this.features[key] = new FeatureConstructor(this);\n }\n /**\n * If we have a feature, mount or update it.\n */\n if (this.features[key]) {\n const feature = this.features[key];\n if (feature.isMounted) {\n feature.update();\n }\n else {\n feature.mount();\n feature.isMounted = true;\n }\n }\n }\n }\n triggerBuild() {\n this.build(this.renderState, this.latestValues, this.props);\n }\n /**\n * Measure the current viewport box with or without transforms.\n * Only measures axis-aligned boxes, rotate and skew must be manually\n * removed with a re-render to work.\n */\n measureViewportBox() {\n return this.current\n ? this.measureInstanceViewportBox(this.current, this.props)\n : createBox();\n }\n getStaticValue(key) {\n return this.latestValues[key];\n }\n setStaticValue(key, value) {\n this.latestValues[key] = value;\n }\n /**\n * Update the provided props. Ensure any newly-added motion values are\n * added to our map, old ones removed, and listeners updated.\n */\n update(props, presenceContext) {\n if (props.transformTemplate || this.props.transformTemplate) {\n this.scheduleRender();\n }\n this.prevProps = this.props;\n this.props = props;\n this.prevPresenceContext = this.presenceContext;\n this.presenceContext = presenceContext;\n /**\n * Update prop event handlers ie onAnimationStart, onAnimationComplete\n */\n for (let i = 0; i < propEventHandlers.length; i++) {\n const key = propEventHandlers[i];\n if (this.propEventSubscriptions[key]) {\n this.propEventSubscriptions[key]();\n delete this.propEventSubscriptions[key];\n }\n const listenerName = (\"on\" + key);\n const listener = props[listenerName];\n if (listener) {\n this.propEventSubscriptions[key] = this.on(key, listener);\n }\n }\n this.prevMotionValues = updateMotionValuesFromProps(this, this.scrapeMotionValuesFromProps(props, this.prevProps || {}, this), this.prevMotionValues);\n if (this.handleChildMotionValue) {\n this.handleChildMotionValue();\n }\n }\n getProps() {\n return this.props;\n }\n /**\n * Returns the variant definition with a given name.\n */\n getVariant(name) {\n return this.props.variants ? this.props.variants[name] : undefined;\n }\n /**\n * Returns the defined default transition on this component.\n */\n getDefaultTransition() {\n return this.props.transition;\n }\n getTransformPagePoint() {\n return this.props.transformPagePoint;\n }\n getClosestVariantNode() {\n return this.isVariantNode\n ? this\n : this.parent\n ? this.parent.getClosestVariantNode()\n : undefined;\n }\n /**\n * Add a child visual element to our set of children.\n */\n addVariantChild(child) {\n const closestVariantNode = this.getClosestVariantNode();\n if (closestVariantNode) {\n closestVariantNode.variantChildren &&\n closestVariantNode.variantChildren.add(child);\n return () => closestVariantNode.variantChildren.delete(child);\n }\n }\n /**\n * Add a motion value and bind it to this visual element.\n */\n addValue(key, value) {\n // Remove existing value if it exists\n const existingValue = this.values.get(key);\n if (value !== existingValue) {\n if (existingValue)\n this.removeValue(key);\n this.bindToMotionValue(key, value);\n this.values.set(key, value);\n this.latestValues[key] = value.get();\n }\n }\n /**\n * Remove a motion value and unbind any active subscriptions.\n */\n removeValue(key) {\n this.values.delete(key);\n const unsubscribe = this.valueSubscriptions.get(key);\n if (unsubscribe) {\n unsubscribe();\n this.valueSubscriptions.delete(key);\n }\n delete this.latestValues[key];\n this.removeValueFromRenderState(key, this.renderState);\n }\n /**\n * Check whether we have a motion value for this key\n */\n hasValue(key) {\n return this.values.has(key);\n }\n getValue(key, defaultValue) {\n if (this.props.values && this.props.values[key]) {\n return this.props.values[key];\n }\n let value = this.values.get(key);\n if (value === undefined && defaultValue !== undefined) {\n value = motionValue(defaultValue === null ? undefined : defaultValue, { owner: this });\n this.addValue(key, value);\n }\n return value;\n }\n /**\n * If we're trying to animate to a previously unencountered value,\n * we need to check for it in our state and as a last resort read it\n * directly from the instance (which might have performance implications).\n */\n readValue(key, target) {\n let value = this.latestValues[key] !== undefined || !this.current\n ? this.latestValues[key]\n : this.getBaseTargetFromProps(this.props, key) ??\n this.readValueFromInstance(this.current, key, this.options);\n if (value !== undefined && value !== null) {\n if (typeof value === \"string\" &&\n (isNumericalString(value) || isZeroValueString(value))) {\n // If this is a number read as a string, ie \"0\" or \"200\", convert it to a number\n value = parseFloat(value);\n }\n else if (!findValueType(value) && complex.test(target)) {\n value = getAnimatableNone(key, target);\n }\n this.setBaseTarget(key, isMotionValue(value) ? value.get() : value);\n }\n return isMotionValue(value) ? value.get() : value;\n }\n /**\n * Set the base target to later animate back to. This is currently\n * only hydrated on creation and when we first read a value.\n */\n setBaseTarget(key, value) {\n this.baseTarget[key] = value;\n }\n /**\n * Find the base target for a value thats been removed from all animation\n * props.\n */\n getBaseTarget(key) {\n const { initial } = this.props;\n let valueFromInitial;\n if (typeof initial === \"string\" || typeof initial === \"object\") {\n const variant = resolveVariantFromProps(this.props, initial, this.presenceContext?.custom);\n if (variant) {\n valueFromInitial = variant[key];\n }\n }\n /**\n * If this value still exists in the current initial variant, read that.\n */\n if (initial && valueFromInitial !== undefined) {\n return valueFromInitial;\n }\n /**\n * Alternatively, if this VisualElement config has defined a getBaseTarget\n * so we can read the value from an alternative source, try that.\n */\n const target = this.getBaseTargetFromProps(this.props, key);\n if (target !== undefined && !isMotionValue(target))\n return target;\n /**\n * If the value was initially defined on initial, but it doesn't any more,\n * return undefined. Otherwise return the value as initially read from the DOM.\n */\n return this.initialValues[key] !== undefined &&\n valueFromInitial === undefined\n ? undefined\n : this.baseTarget[key];\n }\n on(eventName, callback) {\n if (!this.events[eventName]) {\n this.events[eventName] = new SubscriptionManager();\n }\n return this.events[eventName].add(callback);\n }\n notify(eventName, ...args) {\n if (this.events[eventName]) {\n this.events[eventName].notify(...args);\n }\n }\n scheduleRenderMicrotask() {\n microtask.render(this.render);\n }\n}\n\nexport { VisualElement, getFeatureDefinitions, setFeatureDefinitions };\n//# sourceMappingURL=VisualElement.mjs.map\n","import { getValueAsType } from '../../../value/types/utils/get-as-type.mjs';\nimport { numberValueTypes } from '../../../value/types/maps/number.mjs';\nimport { transformPropOrder } from '../../utils/keys-transform.mjs';\n\nconst translateAlias = {\n x: \"translateX\",\n y: \"translateY\",\n z: \"translateZ\",\n transformPerspective: \"perspective\",\n};\nconst numTransforms = transformPropOrder.length;\n/**\n * Build a CSS transform style from individual x/y/scale etc properties.\n *\n * This outputs with a default order of transforms/scales/rotations, this can be customised by\n * providing a transformTemplate function.\n */\nfunction buildTransform(latestValues, transform, transformTemplate) {\n // The transform string we're going to build into.\n let transformString = \"\";\n let transformIsDefault = true;\n /**\n * Loop over all possible transforms in order, adding the ones that\n * are present to the transform string.\n */\n for (let i = 0; i < numTransforms; i++) {\n const key = transformPropOrder[i];\n const value = latestValues[key];\n if (value === undefined)\n continue;\n let valueIsDefault = true;\n if (typeof value === \"number\") {\n valueIsDefault = value === (key.startsWith(\"scale\") ? 1 : 0);\n }\n else {\n const parsed = parseFloat(value);\n valueIsDefault = key.startsWith(\"scale\") ? parsed === 1 : parsed === 0;\n }\n if (!valueIsDefault || transformTemplate) {\n const valueAsType = getValueAsType(value, numberValueTypes[key]);\n if (!valueIsDefault) {\n transformIsDefault = false;\n const transformName = translateAlias[key] || key;\n transformString += `${transformName}(${valueAsType}) `;\n }\n if (transformTemplate) {\n transform[key] = valueAsType;\n }\n }\n }\n // `pathRotation` composes onto `rotate` as a separate additive term so\n // the user's `rotate` is never clobbered. Deliberately not a slot in\n // `transformPropOrder`.\n const pathRotation = latestValues.pathRotation;\n if (pathRotation) {\n transformIsDefault = false;\n transformString += `rotate(${getValueAsType(pathRotation, numberValueTypes.pathRotation)}) `;\n }\n transformString = transformString.trim();\n // If we have a custom `transform` template, pass our transform values and\n // generated transformString to that before returning\n if (transformTemplate) {\n transformString = transformTemplate(transform, transformIsDefault ? \"\" : transformString);\n }\n else if (transformIsDefault) {\n transformString = \"none\";\n }\n return transformString;\n}\n\nexport { buildTransform };\n//# sourceMappingURL=build-transform.mjs.map\n","import { getValueAsType } from '../../../value/types/utils/get-as-type.mjs';\nimport { numberValueTypes } from '../../../value/types/maps/number.mjs';\nimport { transformProps } from '../../utils/keys-transform.mjs';\nimport { isCSSVariableName } from '../../../animation/utils/is-css-variable.mjs';\nimport { buildTransform } from './build-transform.mjs';\n\nfunction buildHTMLStyles(state, latestValues, transformTemplate) {\n const { style, vars, transformOrigin } = state;\n // Track whether we encounter any transform or transformOrigin values.\n let hasTransform = false;\n let hasTransformOrigin = false;\n /**\n * Loop over all our latest animated values and decide whether to handle them\n * as a style or CSS variable.\n *\n * Transforms and transform origins are kept separately for further processing.\n */\n for (const key in latestValues) {\n const value = latestValues[key];\n if (transformProps.has(key)) {\n // If this is a transform, flag to enable further transform processing\n hasTransform = true;\n continue;\n }\n else if (isCSSVariableName(key)) {\n vars[key] = value;\n continue;\n }\n else {\n // Convert the value to its default value type, ie 0 -> \"0px\"\n const valueAsType = getValueAsType(value, numberValueTypes[key]);\n if (key.startsWith(\"origin\")) {\n // If this is a transform origin, flag and enable further transform-origin processing\n hasTransformOrigin = true;\n transformOrigin[key] =\n valueAsType;\n }\n else {\n style[key] = valueAsType;\n }\n }\n }\n if (!latestValues.transform) {\n if (hasTransform || transformTemplate) {\n style.transform = buildTransform(latestValues, state.transform, transformTemplate);\n }\n else if (style.transform) {\n /**\n * If we have previously created a transform but currently don't have any,\n * reset transform style to none.\n */\n style.transform = \"none\";\n }\n }\n /**\n * Build a transformOrigin style. Uses the same defaults as the browser for\n * undefined origins.\n */\n if (hasTransformOrigin) {\n const { originX = \"50%\", originY = \"50%\", originZ = 0, } = transformOrigin;\n style.transformOrigin = `${originX} ${originY} ${originZ}`;\n }\n}\n\nexport { buildHTMLStyles };\n//# sourceMappingURL=build-styles.mjs.map\n","import { px } from '../../value/types/numbers/units.mjs';\n\nfunction pixelsToPercent(pixels, axis) {\n if (axis.max === axis.min)\n return 0;\n return (pixels / (axis.max - axis.min)) * 100;\n}\n/**\n * We always correct borderRadius as a percentage rather than pixels to reduce paints.\n * For example, if you are projecting a box that is 100px wide with a 10px borderRadius\n * into a box that is 200px wide with a 20px borderRadius, that is actually a 10%\n * borderRadius in both states. If we animate between the two in pixels that will trigger\n * a paint each time. If we animate between the two in percentage we'll avoid a paint.\n */\nconst correctBorderRadius = {\n correct: (latest, node) => {\n if (!node.target)\n return latest;\n /**\n * If latest is a string, if it's a percentage we can return immediately as it's\n * going to be stretched appropriately. Otherwise, if it's a pixel, convert it to a number.\n */\n if (typeof latest === \"string\") {\n if (px.test(latest)) {\n latest = parseFloat(latest);\n }\n else {\n return latest;\n }\n }\n /**\n * If latest is a number, it's a pixel value. We use the current viewportBox to calculate that\n * pixel value as a percentage of each axis\n */\n const x = pixelsToPercent(latest, node.target.x);\n const y = pixelsToPercent(latest, node.target.y);\n return `${x}% ${y}%`;\n },\n};\n\nexport { correctBorderRadius, pixelsToPercent };\n//# sourceMappingURL=scale-border-radius.mjs.map\n","import { complex } from '../../value/types/complex/index.mjs';\nimport { mixNumber } from '../../utils/mix/number.mjs';\n\nconst correctBoxShadow = {\n correct: (latest, { treeScale, projectionDelta }) => {\n const original = latest;\n const shadow = complex.parse(latest);\n // TODO: Doesn't support multiple shadows\n if (shadow.length > 5)\n return original;\n const template = complex.createTransformer(latest);\n const offset = typeof shadow[0] !== \"number\" ? 1 : 0;\n // Calculate the overall context scale\n const xScale = projectionDelta.x.scale * treeScale.x;\n const yScale = projectionDelta.y.scale * treeScale.y;\n shadow[0 + offset] /= xScale;\n shadow[1 + offset] /= yScale;\n /**\n * Ideally we'd correct x and y scales individually, but because blur and\n * spread apply to both we have to take a scale average and apply that instead.\n * We could potentially improve the outcome of this by incorporating the ratio between\n * the two scales.\n */\n const averageScale = mixNumber(xScale, yScale, 0.5);\n // Blur\n if (typeof shadow[2 + offset] === \"number\")\n shadow[2 + offset] /= averageScale;\n // Spread\n if (typeof shadow[3 + offset] === \"number\")\n shadow[3 + offset] /= averageScale;\n return template(shadow);\n },\n};\n\nexport { correctBoxShadow };\n//# sourceMappingURL=scale-box-shadow.mjs.map\n","/*\n Value in range from progress\n\n Given a lower limit and an upper limit, we return the value within\n that range as expressed by progress (usually a number from 0 to 1)\n\n So progress = 0.5 would change\n\n from -------- to\n\n to\n\n from ---- to\n\n E.g. from = 10, to = 20, progress = 0.5 => 15\n\n @param [number]: Lower limit of range\n @param [number]: Upper limit of range\n @param [number]: The progress between lower and upper limits expressed 0-1\n @return [number]: Value as calculated from progress within range (not limited within range)\n*/\nconst mixNumber = (from, to, progress) => {\n return from + (to - from) * progress;\n};\n\nexport { mixNumber };\n//# sourceMappingURL=number.mjs.map\n","import { isCSSVariableName } from '../../animation/utils/is-css-variable.mjs';\nimport { cornerRadiusProps } from '../../utils/border-radius.mjs';\nimport { correctBorderRadius } from './scale-border-radius.mjs';\nimport { correctBoxShadow } from './scale-box-shadow.mjs';\n\nconst scaleCorrectors = {\n borderRadius: {\n ...correctBorderRadius,\n applyTo: [...cornerRadiusProps],\n },\n borderTopLeftRadius: correctBorderRadius,\n borderTopRightRadius: correctBorderRadius,\n borderBottomLeftRadius: correctBorderRadius,\n borderBottomRightRadius: correctBorderRadius,\n boxShadow: correctBoxShadow,\n};\nfunction addScaleCorrector(correctors) {\n for (const key in correctors) {\n scaleCorrectors[key] = correctors[key];\n if (isCSSVariableName(key)) {\n scaleCorrectors[key].isCSSVariable = true;\n }\n }\n}\n\nexport { addScaleCorrector, scaleCorrectors };\n//# sourceMappingURL=scale-correction.mjs.map\n","/**\n * The four corner-radius longhands. Shared so the projection mixer, scale\n * corrector, WAAPI px-value set and view-transition crop pass don't each carry\n * their own copy. Order is irrelevant - every consumer mixes/corrects/animates\n * each corner independently.\n */\nconst cornerRadiusProps = [\n \"borderTopLeftRadius\",\n \"borderTopRightRadius\",\n \"borderBottomRightRadius\",\n \"borderBottomLeftRadius\",\n];\n\nexport { cornerRadiusProps };\n//# sourceMappingURL=border-radius.mjs.map\n","import { transformProps } from './keys-transform.mjs';\nimport { scaleCorrectors } from '../../projection/styles/scale-correction.mjs';\nexport { addScaleCorrector } from '../../projection/styles/scale-correction.mjs';\n\nfunction isForcedMotionValue(key, { layout, layoutId }) {\n return (transformProps.has(key) ||\n key.startsWith(\"origin\") ||\n ((layout || layoutId !== undefined) &&\n (!!scaleCorrectors[key] || key === \"opacity\")));\n}\n\nexport { isForcedMotionValue, scaleCorrectors };\n//# sourceMappingURL=is-forced-motion-value.mjs.map\n","import { isMotionValue } from '../../../value/utils/is-motion-value.mjs';\nimport { isForcedMotionValue } from '../../utils/is-forced-motion-value.mjs';\n\nfunction scrapeMotionValuesFromProps(props, prevProps, visualElement) {\n const style = props.style;\n const prevStyle = prevProps?.style;\n const newValues = {};\n if (!style)\n return newValues;\n for (const key in style) {\n if (isMotionValue(style[key]) ||\n (prevStyle && isMotionValue(prevStyle[key])) ||\n isForcedMotionValue(key, props) ||\n visualElement?.getValue(key)?.liveStyle !== undefined) {\n newValues[key] = style[key];\n }\n }\n return newValues;\n}\n\nexport { scrapeMotionValuesFromProps };\n//# sourceMappingURL=scrape-motion-values.mjs.map\n","const dashKeys = {\n offset: \"stroke-dashoffset\",\n array: \"stroke-dasharray\",\n};\nconst camelKeys = {\n offset: \"strokeDashoffset\",\n array: \"strokeDasharray\",\n};\n/**\n * Build SVG path properties. Uses the path's measured length to convert\n * our custom pathLength, pathSpacing and pathOffset into stroke-dashoffset\n * and stroke-dasharray attributes.\n *\n * This function is mutative to reduce per-frame GC.\n *\n * Note: We use unitless values for stroke-dasharray and stroke-dashoffset\n * because Safari incorrectly scales px values when the page is zoomed.\n */\nfunction buildSVGPath(attrs, length, spacing = 1, offset = 0, useDashCase = true) {\n // Normalise path length by setting SVG attribute pathLength to 1\n attrs.pathLength = 1;\n // We use dash case when setting attributes directly to the DOM node and camel case\n // when defining props on a React component.\n const keys = useDashCase ? dashKeys : camelKeys;\n // Build the dash offset (unitless to avoid Safari zoom bug)\n attrs[keys.offset] = `${-offset}`;\n // Build the dash array (unitless to avoid Safari zoom bug)\n attrs[keys.array] = `${length} ${spacing}`;\n}\n\nexport { buildSVGPath };\n//# sourceMappingURL=path.mjs.map\n","import { buildHTMLStyles } from '../../html/utils/build-styles.mjs';\nimport { buildSVGPath } from './path.mjs';\n\nconst cssStyleProperties = [\n \"transform\",\n \"opacity\",\n \"offsetDistance\",\n \"offsetPath\",\n \"offsetRotate\",\n \"offsetAnchor\",\n];\n/**\n * Build SVG visual attributes, like cx and style.transform\n */\nfunction buildSVGAttrs(state, { attrX, attrY, attrScale, pathLength, pathSpacing = 1, pathOffset = 0, \n// This is object creation, which we try to avoid per-frame.\n...latest }, isSVGTag, transformTemplate, styleProp) {\n buildHTMLStyles(state, latest, transformTemplate);\n /**\n * For svg tags we just want to make sure viewBox is animatable and treat all the styles\n * as normal HTML tags.\n */\n if (isSVGTag) {\n if (state.style.viewBox) {\n state.attrs.viewBox = state.style.viewBox;\n }\n return;\n }\n state.attrs = state.style;\n state.style = {};\n const { attrs, style } = state;\n for (const key of cssStyleProperties) {\n if (attrs[key] !== undefined) {\n style[key] = attrs[key];\n delete attrs[key];\n }\n }\n if (style.transform || attrs.transformOrigin) {\n style.transformOrigin = attrs.transformOrigin ?? \"50% 50%\";\n delete attrs.transformOrigin;\n }\n if (style.transform) {\n /**\n * SVG's element transform-origin uses its own median as a reference.\n * Therefore, transformBox becomes a fill-box\n */\n style.transformBox = styleProp?.transformBox ?? \"fill-box\";\n delete attrs.transformBox;\n }\n // Render attrX/attrY/attrScale as attributes\n if (attrX !== undefined)\n attrs.x = attrX;\n if (attrY !== undefined)\n attrs.y = attrY;\n if (attrScale !== undefined)\n attrs.scale = attrScale;\n // Build SVG path if one has been defined\n if (pathLength !== undefined) {\n buildSVGPath(attrs, pathLength, pathSpacing, pathOffset, false);\n }\n}\n\nexport { buildSVGAttrs, cssStyleProperties };\n//# sourceMappingURL=build-attrs.mjs.map\n","import { isMotionValue } from './is-motion-value.mjs';\n\n/**\n * If the provided value is a MotionValue, this returns the actual value, otherwise just the value itself\n */\nfunction resolveMotionValue(value) {\n return isMotionValue(value) ? value.get() : value;\n}\n\nexport { resolveMotionValue };\n//# sourceMappingURL=resolve-motion-value.mjs.map\n","\"use client\";\nimport { useContext, useMemo } from \"react\";\nimport { MotionContext } from \".\";\nimport { getCurrentTreeVariants } from \"./utils\";\nexport function useCreateMotionContext(props) {\n const { initial, animate } = getCurrentTreeVariants(props, useContext(MotionContext));\n return useMemo(() => ({ initial, animate }), [variantLabelsAsDependency(initial), variantLabelsAsDependency(animate)]);\n}\nfunction variantLabelsAsDependency(prop) {\n return Array.isArray(prop) ? prop.join(\" \") : prop;\n}\n//# sourceMappingURL=create.js.map","import { isControllingVariants, isVariantLabel } from \"motion-dom\";\nexport function getCurrentTreeVariants(props, context) {\n if (isControllingVariants(props)) {\n const { initial, animate } = props;\n return {\n initial: initial === false || isVariantLabel(initial)\n ? initial\n : undefined,\n animate: isVariantLabel(animate) ? animate : undefined,\n };\n }\n return props.inherit !== false ? context : {};\n}\n//# sourceMappingURL=utils.js.map","export const createHtmlRenderState = () => ({\n style: {},\n transform: {},\n transformOrigin: {},\n vars: {},\n});\n//# sourceMappingURL=create-render-state.js.map","\"use client\";\nimport { buildHTMLStyles, isForcedMotionValue, isMotionValue } from \"motion-dom\";\nimport { useMemo } from \"react\";\nimport { createHtmlRenderState } from \"./utils/create-render-state\";\nexport function copyRawValuesOnly(target, source, props) {\n for (const key in source) {\n if (!isMotionValue(source[key]) && !isForcedMotionValue(key, props)) {\n target[key] = source[key];\n }\n }\n}\nfunction useInitialMotionValues({ transformTemplate }, visualState) {\n return useMemo(() => {\n const state = createHtmlRenderState();\n buildHTMLStyles(state, visualState, transformTemplate);\n return Object.assign({}, state.vars, state.style);\n }, [visualState]);\n}\nfunction useStyle(props, visualState) {\n const styleProp = props.style || {};\n const style = {};\n /**\n * Copy non-Motion Values straight into style\n */\n copyRawValuesOnly(style, styleProp, props);\n Object.assign(style, useInitialMotionValues(props, visualState));\n return style;\n}\nexport function useHTMLProps(props, visualState) {\n // The `any` isn't ideal but it is the type of createElement props argument\n const htmlProps = {};\n const style = useStyle(props, visualState);\n if (props.drag && props.dragListener !== false) {\n // Disable the ghost element when a user drags\n htmlProps.draggable = false;\n // Disable text selection\n style.userSelect =\n style.WebkitUserSelect =\n style.WebkitTouchCallout =\n \"none\";\n // Disable scrolling on the draggable direction\n style.touchAction =\n props.drag === true\n ? \"none\"\n : `pan-${props.drag === \"x\" ? \"y\" : \"x\"}`;\n }\n if (props.tabIndex === undefined &&\n (props.onTap || props.onTapStart || props.whileTap)) {\n htmlProps.tabIndex = 0;\n }\n htmlProps.style = style;\n return htmlProps;\n}\n//# sourceMappingURL=use-props.js.map","import { createHtmlRenderState } from \"../../html/utils/create-render-state\";\nexport const createSvgRenderState = () => ({\n ...createHtmlRenderState(),\n attrs: {},\n});\n//# sourceMappingURL=create-render-state.js.map","\"use client\";\nimport { buildSVGAttrs, isSVGTag } from \"motion-dom\";\nimport { useMemo } from \"react\";\nimport { copyRawValuesOnly } from \"../html/use-props\";\nimport { createSvgRenderState } from \"./utils/create-render-state\";\nexport function useSVGProps(props, visualState, _isStatic, Component) {\n const visualProps = useMemo(() => {\n const state = createSvgRenderState();\n buildSVGAttrs(state, visualState, isSVGTag(Component), props.transformTemplate, props.style);\n return {\n ...state.attrs,\n style: { ...state.style },\n };\n }, [visualState]);\n if (props.style) {\n const rawStyles = {};\n copyRawValuesOnly(rawStyles, props.style, props);\n visualProps.style = { ...rawStyles, ...visualProps.style };\n }\n return visualProps;\n}\n//# sourceMappingURL=use-props.js.map","const isSVGTag = (tag) => typeof tag === \"string\" && tag.toLowerCase() === \"svg\";\n\nexport { isSVGTag };\n//# sourceMappingURL=is-svg-tag.mjs.map\n","/**\n * A list of all valid MotionProps.\n *\n * @privateRemarks\n * This doesn't throw if a `MotionProp` name is missing - it should.\n */\nconst validMotionProps = new Set([\n \"animate\",\n \"exit\",\n \"variants\",\n \"initial\",\n \"style\",\n \"values\",\n \"variants\",\n \"transition\",\n \"transformTemplate\",\n \"custom\",\n \"inherit\",\n \"onBeforeLayoutMeasure\",\n \"onAnimationStart\",\n \"onAnimationComplete\",\n \"onUpdate\",\n \"onDragStart\",\n \"onDrag\",\n \"onDragEnd\",\n \"onMeasureDragConstraints\",\n \"onDirectionLock\",\n \"onDragTransitionEnd\",\n \"_dragX\",\n \"_dragY\",\n \"onHoverStart\",\n \"onHoverEnd\",\n \"onViewportEnter\",\n \"onViewportLeave\",\n \"globalTapTarget\",\n \"propagate\",\n \"ignoreStrict\",\n \"viewport\",\n]);\n/**\n * Check whether a prop name is a valid `MotionProp` key.\n *\n * @param key - Name of the property to check\n * @returns `true` is key is a valid `MotionProp`.\n *\n * @public\n */\nexport function isValidMotionProp(key) {\n return (key.startsWith(\"while\") ||\n (key.startsWith(\"drag\") && key !== \"draggable\") ||\n key.startsWith(\"layout\") ||\n key.startsWith(\"onTap\") ||\n key.startsWith(\"onPan\") ||\n key.startsWith(\"onLayout\") ||\n validMotionProps.has(key));\n}\n//# sourceMappingURL=valid-prop.js.map","import { isMotionValue } from \"motion-dom\";\nimport { isValidMotionProp } from \"../../../motion/utils/valid-prop\";\nfunction shouldForward(key, isValidProp) {\n return key.startsWith(\"on\")\n ? !isValidMotionProp(key)\n : isValidProp?.(key) ?? !isValidMotionProp(key);\n}\nexport function filterProps(props, isDom, forwardMotionProps, isValidProp) {\n const filteredProps = {};\n for (const key in props) {\n /**\n * values is considered a valid prop by Emotion, so if it's present\n * this will be rendered out to the DOM unless explicitly filtered.\n *\n * We check the type as it could be used with the `feColorMatrix`\n * element, which we support.\n */\n if (key === \"values\" && typeof props.values === \"object\")\n continue;\n if (isMotionValue(props[key]))\n continue;\n if (shouldForward(key, isValidProp) ||\n (forwardMotionProps === true && isValidMotionProp(key)) ||\n (!isDom && !isValidMotionProp(key)) ||\n // If trying to use native HTML drag events, forward drag listeners\n (props[\"draggable\"] &&\n key.startsWith(\"onDrag\"))) {\n filteredProps[key] =\n props[key];\n }\n }\n return filteredProps;\n}\n//# sourceMappingURL=filter-props.js.map","/**\n * We keep these listed separately as we use the lowercase tag names as part\n * of the runtime bundle to detect SVG components\n */\nexport const lowercaseSVGElements = [\n \"animate\",\n \"circle\",\n \"defs\",\n \"desc\",\n \"ellipse\",\n \"g\",\n \"image\",\n \"line\",\n \"filter\",\n \"marker\",\n \"mask\",\n \"metadata\",\n \"path\",\n \"pattern\",\n \"polygon\",\n \"polyline\",\n \"rect\",\n \"stop\",\n \"switch\",\n \"symbol\",\n \"svg\",\n \"text\",\n \"tspan\",\n \"use\",\n \"view\",\n];\n//# sourceMappingURL=lowercase-elements.js.map","import { lowercaseSVGElements } from \"../../svg/lowercase-elements\";\nexport function isSVGComponent(Component) {\n if (\n /**\n * If it's not a string, it's a custom React component. Currently we only support\n * HTML custom React components.\n */\n typeof Component !== \"string\" ||\n /**\n * If it contains a dash, the element is a custom HTML webcomponent.\n */\n Component.includes(\"-\")) {\n return false;\n }\n else if (\n /**\n * If it's in our list of lowercase SVG tags, it's an SVG component\n */\n lowercaseSVGElements.indexOf(Component) > -1 ||\n /**\n * If it contains a capital letter, it's an SVG component\n */\n /[A-Z]/u.test(Component)) {\n return true;\n }\n return false;\n}\n//# sourceMappingURL=is-svg-component.js.map","\"use client\";\nimport { isMotionValue } from \"motion-dom\";\nimport { Fragment, createElement, useMemo } from \"react\";\nimport { useHTMLProps } from \"../html/use-props\";\nimport { useSVGProps } from \"../svg/use-props\";\nimport { filterProps } from \"./utils/filter-props\";\nimport { isSVGComponent } from \"./utils/is-svg-component\";\nexport function useRender(Component, props, ref, { latestValues, }, isStatic, forwardMotionProps = false, isSVG, isValidProp) {\n const useVisualProps = (isSVG ?? isSVGComponent(Component)) ? useSVGProps : useHTMLProps;\n const visualProps = useVisualProps(props, latestValues, isStatic, Component);\n const filteredProps = filterProps(props, typeof Component === \"string\", forwardMotionProps, isValidProp);\n const elementProps = Component !== Fragment ? { ...filteredProps, ...visualProps, ref } : {};\n /**\n * If component has been handed a motion value as its child,\n * memoise its initial value and render that. Subsequent updates\n * will be handled by the onChange handler\n */\n const { children } = props;\n const renderedChildren = useMemo(() => (isMotionValue(children) ? children.get() : children), [children]);\n return createElement(Component, {\n ...elementProps,\n children: renderedChildren,\n });\n}\n//# sourceMappingURL=use-render.js.map","\"use client\";\nimport { createContext } from \"react\";\n/**\n * @public\n */\nexport const PresenceContext = \n/* @__PURE__ */ createContext(null);\n//# sourceMappingURL=PresenceContext.js.map","\"use client\";\nimport { isAnimationControls, isControllingVariants as checkIsControllingVariants, isVariantNode as checkIsVariantNode, resolveVariantFromProps, } from \"motion-dom\";\nimport { useContext } from \"react\";\nimport { MotionContext } from \"../../context/MotionContext\";\nimport { PresenceContext, } from \"../../context/PresenceContext\";\nimport { useConstant } from \"../../utils/use-constant\";\nimport { resolveMotionValue } from \"motion-dom\";\nfunction makeState({ scrapeMotionValuesFromProps, createRenderState, }, props, context, presenceContext) {\n const state = {\n latestValues: makeLatestValues(props, context, presenceContext, scrapeMotionValuesFromProps),\n renderState: createRenderState(),\n };\n return state;\n}\nfunction makeLatestValues(props, context, presenceContext, scrapeMotionValues) {\n const values = {};\n const motionValues = scrapeMotionValues(props, {});\n for (const key in motionValues) {\n values[key] = resolveMotionValue(motionValues[key]);\n }\n let { initial, animate } = props;\n const isControllingVariants = checkIsControllingVariants(props);\n const isVariantNode = checkIsVariantNode(props);\n if (context &&\n isVariantNode &&\n !isControllingVariants &&\n props.inherit !== false) {\n if (initial === undefined)\n initial = context.initial;\n if (animate === undefined)\n animate = context.animate;\n }\n let isInitialAnimationBlocked = presenceContext\n ? presenceContext.initial === false\n : false;\n isInitialAnimationBlocked = isInitialAnimationBlocked || initial === false;\n const variantToSet = isInitialAnimationBlocked ? animate : initial;\n if (variantToSet &&\n typeof variantToSet !== \"boolean\" &&\n !isAnimationControls(variantToSet)) {\n const list = Array.isArray(variantToSet) ? variantToSet : [variantToSet];\n for (let i = 0; i < list.length; i++) {\n const resolved = resolveVariantFromProps(props, list[i]);\n if (resolved) {\n const { transitionEnd, transition, ...target } = resolved;\n for (const key in target) {\n let valueTarget = target[key];\n if (Array.isArray(valueTarget)) {\n /**\n * Take final keyframe if the initial animation is blocked because\n * we want to initialise at the end of that blocked animation.\n */\n const index = isInitialAnimationBlocked\n ? valueTarget.length - 1\n : 0;\n valueTarget = valueTarget[index];\n }\n if (valueTarget !== null) {\n values[key] = valueTarget;\n }\n }\n for (const key in transitionEnd) {\n values[key] = transitionEnd[key];\n }\n }\n }\n }\n return values;\n}\nexport const makeUseVisualState = (config) => (props, isStatic) => {\n const context = useContext(MotionContext);\n const presenceContext = useContext(PresenceContext);\n const make = () => makeState(config, props, context, presenceContext);\n return isStatic ? make() : useConstant(make);\n};\n//# sourceMappingURL=use-visual-state.js.map","\"use client\";\nimport { useRef } from \"react\";\n/**\n * Creates a constant value over the lifecycle of a component.\n *\n * Even if `useMemo` is provided an empty array as its final argument, it doesn't offer\n * a guarantee that it won't re-run for performance reasons later on. By using `useConstant`\n * you can ensure that initialisers don't execute twice or more.\n */\nexport function useConstant(init) {\n const ref = useRef(null);\n if (ref.current === null) {\n ref.current = init();\n }\n return ref.current;\n}\n//# sourceMappingURL=use-constant.js.map","\"use client\";\nimport { scrapeHTMLMotionValuesFromProps } from \"motion-dom\";\nimport { makeUseVisualState } from \"../../motion/utils/use-visual-state\";\nimport { createHtmlRenderState } from \"./utils/create-render-state\";\nexport const useHTMLVisualState = /*@__PURE__*/ makeUseVisualState({\n scrapeMotionValuesFromProps: scrapeHTMLMotionValuesFromProps,\n createRenderState: createHtmlRenderState,\n});\n//# sourceMappingURL=use-html-visual-state.js.map","\"use client\";\nimport { scrapeSVGMotionValuesFromProps } from \"motion-dom\";\nimport { makeUseVisualState } from \"../../motion/utils/use-visual-state\";\nimport { createSvgRenderState } from \"./utils/create-render-state\";\nexport const useSVGVisualState = /*@__PURE__*/ makeUseVisualState({\n scrapeMotionValuesFromProps: scrapeSVGMotionValuesFromProps,\n createRenderState: createSvgRenderState,\n});\n//# sourceMappingURL=use-svg-visual-state.js.map","import { isMotionValue } from '../../../value/utils/is-motion-value.mjs';\nimport { transformPropOrder } from '../../utils/keys-transform.mjs';\nimport { scrapeMotionValuesFromProps as scrapeMotionValuesFromProps$1 } from '../../html/utils/scrape-motion-values.mjs';\n\nfunction scrapeMotionValuesFromProps(props, prevProps, visualElement) {\n const newValues = scrapeMotionValuesFromProps$1(props, prevProps, visualElement);\n for (const key in props) {\n if (isMotionValue(props[key]) ||\n isMotionValue(prevProps[key])) {\n const targetKey = transformPropOrder.indexOf(key) !== -1\n ? \"attr\" + key.charAt(0).toUpperCase() + key.substring(1)\n : key;\n newValues[targetKey] = props[key];\n }\n }\n return newValues;\n}\n\nexport { scrapeMotionValuesFromProps };\n//# sourceMappingURL=scrape-motion-values.mjs.map\n","import { getFeatureDefinitions, setFeatureDefinitions } from \"motion-dom\";\nconst featureProps = {\n animation: [\n \"animate\",\n \"variants\",\n \"whileHover\",\n \"whileTap\",\n \"exit\",\n \"whileInView\",\n \"whileFocus\",\n \"whileDrag\",\n ],\n exit: [\"exit\"],\n drag: [\"drag\", \"dragControls\"],\n focus: [\"whileFocus\"],\n hover: [\"whileHover\", \"onHoverStart\", \"onHoverEnd\"],\n tap: [\"whileTap\", \"onTap\", \"onTapStart\", \"onTapCancel\"],\n pan: [\"onPan\", \"onPanStart\", \"onPanSessionStart\", \"onPanEnd\"],\n inView: [\"whileInView\", \"onViewportEnter\", \"onViewportLeave\"],\n layout: [\"layout\", \"layoutId\"],\n};\nlet isInitialized = false;\n/**\n * Initialize feature definitions with isEnabled checks.\n * This must be called before any motion components are rendered.\n */\nexport function initFeatureDefinitions() {\n if (isInitialized)\n return;\n const initialFeatureDefinitions = {};\n for (const key in featureProps) {\n initialFeatureDefinitions[key] = {\n isEnabled: (props) => featureProps[key].some((name) => !!props[name]),\n };\n }\n setFeatureDefinitions(initialFeatureDefinitions);\n isInitialized = true;\n}\n/**\n * Get the current feature definitions, initializing if needed.\n */\nexport function getInitializedFeatureDefinitions() {\n initFeatureDefinitions();\n return getFeatureDefinitions();\n}\n//# sourceMappingURL=definitions.js.map","export const motionComponentSymbol = Symbol.for(\"motionComponentSymbol\");\n//# sourceMappingURL=symbol.js.map","\"use client\";\nimport { useCallback, useInsertionEffect, useRef } from \"react\";\n/**\n * Creates a ref function that, when called, hydrates the provided\n * external ref and VisualElement.\n */\nexport function useMotionRef(visualState, visualElement, externalRef) {\n /**\n * Store externalRef in a ref to avoid including it in the useCallback\n * dependency array. Including externalRef in dependencies causes issues\n * with libraries like Radix UI that create new callback refs on each render\n * when using asChild - this would cause the callback to be recreated,\n * triggering element remounts and breaking AnimatePresence exit animations.\n */\n const externalRefContainer = useRef(externalRef);\n useInsertionEffect(() => {\n externalRefContainer.current = externalRef;\n });\n // Store cleanup function returned by callback refs (React 19 feature)\n const refCleanup = useRef(null);\n return useCallback((instance) => {\n if (instance) {\n visualState.onMount?.(instance);\n }\n if (visualElement) {\n instance ? visualElement.mount(instance) : visualElement.unmount();\n }\n const ref = externalRefContainer.current;\n if (typeof ref === \"function\") {\n if (instance) {\n const cleanup = ref(instance);\n if (typeof cleanup === \"function\") {\n refCleanup.current = cleanup;\n }\n }\n else if (refCleanup.current) {\n refCleanup.current();\n refCleanup.current = null;\n }\n else {\n ref(instance);\n }\n }\n else if (ref) {\n ;\n ref.current = instance;\n }\n }, [visualElement]);\n}\n//# sourceMappingURL=use-motion-ref.js.map","\"use client\";\nimport { createContext } from \"react\";\n/**\n * Internal, exported only for usage in Framer\n */\nexport const SwitchLayoutGroupContext = createContext({});\n//# sourceMappingURL=SwitchLayoutGroupContext.js.map","export function isRefObject(ref) {\n return (ref &&\n typeof ref === \"object\" &&\n Object.prototype.hasOwnProperty.call(ref, \"current\"));\n}\n//# sourceMappingURL=is-ref-object.js.map","export const isBrowser = typeof window !== \"undefined\";\n//# sourceMappingURL=is-browser.js.map","\"use client\";\nimport { useEffect, useLayoutEffect } from \"react\";\nimport { isBrowser } from \"./is-browser\";\nexport const useIsomorphicLayoutEffect = isBrowser ? useLayoutEffect : useEffect;\n//# sourceMappingURL=use-isomorphic-effect.js.map","\"use client\";\nimport { optimizedAppearDataAttribute, } from \"motion-dom\";\nimport { useContext, useEffect, useInsertionEffect, useRef } from \"react\";\nimport { LazyContext } from \"../../context/LazyContext\";\nimport { MotionConfigContext } from \"../../context/MotionConfigContext\";\nimport { MotionContext } from \"../../context/MotionContext\";\nimport { PresenceContext } from \"../../context/PresenceContext\";\nimport { SwitchLayoutGroupContext, } from \"../../context/SwitchLayoutGroupContext\";\nimport { isRefObject } from \"../../utils/is-ref-object\";\nimport { useIsomorphicLayoutEffect } from \"../../utils/use-isomorphic-effect\";\nexport function useVisualElement(Component, visualState, props, createVisualElement, ProjectionNodeConstructor, isSVG) {\n const { visualElement: parent } = useContext(MotionContext);\n const lazyContext = useContext(LazyContext);\n const presenceContext = useContext(PresenceContext);\n const motionConfig = useContext(MotionConfigContext);\n const reducedMotionConfig = motionConfig.reducedMotion;\n const skipAnimations = motionConfig.skipAnimations;\n const visualElementRef = useRef(null);\n /**\n * Track whether the component has been through React's commit phase.\n * Used to detect when LazyMotion features load after the component has mounted.\n */\n const hasMountedOnce = useRef(false);\n /**\n * If we haven't preloaded a renderer, check to see if we have one lazy-loaded\n */\n createVisualElement =\n createVisualElement ||\n lazyContext.renderer;\n if (!visualElementRef.current && createVisualElement) {\n visualElementRef.current = createVisualElement(Component, {\n visualState,\n parent,\n props,\n presenceContext,\n blockInitialAnimation: presenceContext\n ? presenceContext.initial === false\n : false,\n reducedMotionConfig,\n skipAnimations,\n isSVG,\n });\n /**\n * If the component has already mounted before features loaded (e.g. via\n * LazyMotion with async feature loading), we need to force the initial\n * animation to run. Otherwise state changes that occurred before features\n * loaded will be lost and the element will snap to its final state.\n */\n if (hasMountedOnce.current && visualElementRef.current) {\n visualElementRef.current.manuallyAnimateOnMount = true;\n }\n }\n const visualElement = visualElementRef.current;\n /**\n * Load Motion gesture and animation features. These are rendered as renderless\n * components so each feature can optionally make use of React lifecycle methods.\n */\n const initialLayoutGroupConfig = useContext(SwitchLayoutGroupContext);\n if (visualElement &&\n !visualElement.projection &&\n ProjectionNodeConstructor &&\n (visualElement.type === \"html\" || visualElement.type === \"svg\")) {\n createProjectionNode(visualElementRef.current, props, ProjectionNodeConstructor, initialLayoutGroupConfig);\n }\n const isMounted = useRef(false);\n useInsertionEffect(() => {\n /**\n * Check the component has already mounted before calling\n * `update` unnecessarily. This ensures we skip the initial update.\n */\n if (visualElement && isMounted.current) {\n visualElement.update(props, presenceContext);\n }\n });\n /**\n * Cache this value as we want to know whether HandoffAppearAnimations\n * was present on initial render - it will be deleted after this.\n */\n const optimisedAppearId = props[optimizedAppearDataAttribute];\n const wantsHandoff = useRef(Boolean(optimisedAppearId) &&\n typeof window !== \"undefined\" &&\n !window.MotionHandoffIsComplete?.(optimisedAppearId) &&\n window.MotionHasOptimisedAnimation?.(optimisedAppearId));\n useIsomorphicLayoutEffect(() => {\n /**\n * Track that this component has mounted. This is used to detect when\n * LazyMotion features load after the component has already committed.\n */\n hasMountedOnce.current = true;\n if (!visualElement)\n return;\n isMounted.current = true;\n window.MotionIsMounted = true;\n visualElement.updateFeatures();\n visualElement.scheduleRenderMicrotask();\n /**\n * Ideally this function would always run in a useEffect.\n *\n * However, if we have optimised appear animations to handoff from,\n * it needs to happen synchronously to ensure there's no flash of\n * incorrect styles in the event of a hydration error.\n *\n * So if we detect a situtation where optimised appear animations\n * are running, we use useLayoutEffect to trigger animations.\n */\n if (wantsHandoff.current && visualElement.animationState) {\n visualElement.animationState.animateChanges();\n }\n });\n useEffect(() => {\n if (!visualElement)\n return;\n if (!wantsHandoff.current && visualElement.animationState) {\n visualElement.animationState.animateChanges();\n }\n if (wantsHandoff.current) {\n // This ensures all future calls to animateChanges() in this component will run in useEffect\n queueMicrotask(() => {\n window.MotionHandoffMarkAsComplete?.(optimisedAppearId);\n });\n wantsHandoff.current = false;\n }\n /**\n * Now we've finished triggering animations for this element we\n * can wipe the enteringChildren set for the next render.\n */\n visualElement.enteringChildren = undefined;\n });\n return visualElement;\n}\nfunction createProjectionNode(visualElement, props, ProjectionNodeConstructor, initialPromotionConfig) {\n const { layoutId, layout, drag, dragConstraints, layoutScroll, layoutRoot, layoutAnchor, layoutCrossfade, } = props;\n visualElement.projection = new ProjectionNodeConstructor(visualElement.latestValues, props[\"data-framer-portal-id\"]\n ? undefined\n : getClosestProjectingNode(visualElement.parent));\n visualElement.projection.setOptions({\n layoutId,\n layout,\n alwaysMeasureLayout: Boolean(drag) || (dragConstraints && isRefObject(dragConstraints)),\n visualElement,\n /**\n * TODO: Update options in an effect. This could be tricky as it'll be too late\n * to update by the time layout animations run.\n * We also need to fix this safeToRemove by linking it up to the one returned by usePresence,\n * ensuring it gets called if there's no potential layout animations.\n *\n */\n animationType: typeof layout === \"string\" ? layout : \"both\",\n initialPromotionConfig,\n crossfade: layoutCrossfade,\n layoutScroll,\n layoutRoot,\n layoutAnchor,\n });\n}\nfunction getClosestProjectingNode(visualElement) {\n if (!visualElement)\n return undefined;\n return visualElement.options.allowProjection !== false\n ? visualElement.projection\n : getClosestProjectingNode(visualElement.parent);\n}\n//# sourceMappingURL=use-visual-element.js.map","\"use client\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { invariant, warning } from \"motion-utils\";\nimport { forwardRef, useContext } from \"react\";\nimport { LayoutGroupContext } from \"../context/LayoutGroupContext\";\nimport { LazyContext } from \"../context/LazyContext\";\nimport { MotionConfigContext } from \"../context/MotionConfigContext\";\nimport { MotionContext } from \"../context/MotionContext\";\nimport { useCreateMotionContext } from \"../context/MotionContext/create\";\nimport { useRender } from \"../render/dom/use-render\";\nimport { isSVGComponent } from \"../render/dom/utils/is-svg-component\";\nimport { useHTMLVisualState } from \"../render/html/use-html-visual-state\";\nimport { useSVGVisualState } from \"../render/svg/use-svg-visual-state\";\nimport { getInitializedFeatureDefinitions } from \"./features/definitions\";\nimport { loadFeatures } from \"./features/load-features\";\nimport { motionComponentSymbol } from \"./utils/symbol\";\nimport { useMotionRef } from \"./utils/use-motion-ref\";\nimport { useVisualElement } from \"./utils/use-visual-element\";\n/**\n * Create a `motion` component.\n *\n * This function accepts a Component argument, which can be either a string (ie \"div\"\n * for `motion.div`), or an actual React component.\n *\n * Alongside this is a config option which provides a way of rendering the provided\n * component \"offline\", or outside the React render cycle.\n */\nexport function createMotionComponent(Component, { forwardMotionProps = false, type } = {}, preloadedFeatures, createVisualElement) {\n preloadedFeatures && loadFeatures(preloadedFeatures);\n /**\n * Determine whether to use SVG or HTML rendering based on:\n * 1. Explicit `type` option (highest priority)\n * 2. Auto-detection via `isSVGComponent`\n */\n const isSVG = type ? type === \"svg\" : isSVGComponent(Component);\n const useVisualState = isSVG ? useSVGVisualState : useHTMLVisualState;\n function MotionDOMComponent(props, externalRef) {\n /**\n * If we need to measure the element we load this functionality in a\n * separate class component in order to gain access to getSnapshotBeforeUpdate.\n */\n let MeasureLayout;\n const configAndProps = {\n ...useContext(MotionConfigContext),\n ...props,\n layoutId: useLayoutId(props),\n };\n const { isStatic, isValidProp } = configAndProps;\n const context = useCreateMotionContext(props);\n const visualState = useVisualState(props, isStatic);\n if (!isStatic && typeof window !== \"undefined\") {\n useStrictMode(configAndProps, preloadedFeatures);\n const layoutProjection = getProjectionFunctionality(configAndProps);\n MeasureLayout = layoutProjection.MeasureLayout;\n /**\n * Create a VisualElement for this component. A VisualElement provides a common\n * interface to renderer-specific APIs (ie DOM/Three.js etc) as well as\n * providing a way of rendering to these APIs outside of the React render loop\n * for more performant animations and interactions\n */\n context.visualElement = useVisualElement(Component, visualState, configAndProps, createVisualElement, layoutProjection.ProjectionNode, isSVG);\n }\n /**\n * The mount order and hierarchy is specific to ensure our element ref\n * is hydrated by the time features fire their effects.\n */\n return (_jsxs(MotionContext.Provider, { value: context, children: [MeasureLayout && context.visualElement ? (_jsx(MeasureLayout, { visualElement: context.visualElement, ...configAndProps })) : null, useRender(Component, props, useMotionRef(visualState, context.visualElement, externalRef), visualState, isStatic, forwardMotionProps, isSVG, isValidProp)] }));\n }\n MotionDOMComponent.displayName = `motion.${typeof Component === \"string\"\n ? Component\n : `create(${Component.displayName ?? Component.name ?? \"\"})`}`;\n const ForwardRefMotionComponent = forwardRef(MotionDOMComponent);\n ForwardRefMotionComponent[motionComponentSymbol] = Component;\n return ForwardRefMotionComponent;\n}\nfunction useLayoutId({ layoutId }) {\n const layoutGroupId = useContext(LayoutGroupContext).id;\n return layoutGroupId && layoutId !== undefined\n ? layoutGroupId + \"-\" + layoutId\n : layoutId;\n}\nfunction useStrictMode(configAndProps, preloadedFeatures) {\n const isStrict = useContext(LazyContext).strict;\n /**\n * If we're in development mode, check to make sure we're not rendering a motion component\n * as a child of LazyMotion, as this will break the file-size benefits of using it.\n */\n if (process.env.NODE_ENV !== \"production\" &&\n preloadedFeatures &&\n isStrict) {\n const strictMessage = \"You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.\";\n configAndProps.ignoreStrict\n ? warning(false, strictMessage, \"lazy-strict-mode\")\n : invariant(false, strictMessage, \"lazy-strict-mode\");\n }\n}\nfunction getProjectionFunctionality(props) {\n const featureDefinitions = getInitializedFeatureDefinitions();\n const { drag, layout } = featureDefinitions;\n if (!drag && !layout)\n return {};\n const combined = { ...drag, ...layout };\n return {\n MeasureLayout: drag?.isEnabled(props) || layout?.isEnabled(props)\n ? combined.MeasureLayout\n : undefined,\n ProjectionNode: combined.ProjectionNode,\n };\n}\n//# sourceMappingURL=index.js.map","import { createMotionComponent } from \"../../../motion\";\nexport function createMinimalMotionComponent(Component, options) {\n return createMotionComponent(Component, options);\n}\n//# sourceMappingURL=create.js.map","\"use client\";\nimport { createMinimalMotionComponent } from \"./create\";\n/**\n * HTML components\n */\nexport const MotionA = /*@__PURE__*/ createMinimalMotionComponent(\"a\");\nexport const MotionAbbr = /*@__PURE__*/ createMinimalMotionComponent(\"abbr\");\nexport const MotionAddress = \n/*@__PURE__*/ createMinimalMotionComponent(\"address\");\nexport const MotionArea = /*@__PURE__*/ createMinimalMotionComponent(\"area\");\nexport const MotionArticle = \n/*@__PURE__*/ createMinimalMotionComponent(\"article\");\nexport const MotionAside = /*@__PURE__*/ createMinimalMotionComponent(\"aside\");\nexport const MotionAudio = /*@__PURE__*/ createMinimalMotionComponent(\"audio\");\nexport const MotionB = /*@__PURE__*/ createMinimalMotionComponent(\"b\");\nexport const MotionBase = /*@__PURE__*/ createMinimalMotionComponent(\"base\");\nexport const MotionBdi = /*@__PURE__*/ createMinimalMotionComponent(\"bdi\");\nexport const MotionBdo = /*@__PURE__*/ createMinimalMotionComponent(\"bdo\");\nexport const MotionBig = /*@__PURE__*/ createMinimalMotionComponent(\"big\");\nexport const MotionBlockquote = \n/*@__PURE__*/ createMinimalMotionComponent(\"blockquote\");\nexport const MotionBody = /*@__PURE__*/ createMinimalMotionComponent(\"body\");\nexport const MotionButton = /*@__PURE__*/ createMinimalMotionComponent(\"button\");\nexport const MotionCanvas = /*@__PURE__*/ createMinimalMotionComponent(\"canvas\");\nexport const MotionCaption = \n/*@__PURE__*/ createMinimalMotionComponent(\"caption\");\nexport const MotionCite = /*@__PURE__*/ createMinimalMotionComponent(\"cite\");\nexport const MotionCode = /*@__PURE__*/ createMinimalMotionComponent(\"code\");\nexport const MotionCol = /*@__PURE__*/ createMinimalMotionComponent(\"col\");\nexport const MotionColgroup = \n/*@__PURE__*/ createMinimalMotionComponent(\"colgroup\");\nexport const MotionData = /*@__PURE__*/ createMinimalMotionComponent(\"data\");\nexport const MotionDatalist = \n/*@__PURE__*/ createMinimalMotionComponent(\"datalist\");\nexport const MotionDd = /*@__PURE__*/ createMinimalMotionComponent(\"dd\");\nexport const MotionDel = /*@__PURE__*/ createMinimalMotionComponent(\"del\");\nexport const MotionDetails = \n/*@__PURE__*/ createMinimalMotionComponent(\"details\");\nexport const MotionDfn = /*@__PURE__*/ createMinimalMotionComponent(\"dfn\");\nexport const MotionDialog = /*@__PURE__*/ createMinimalMotionComponent(\"dialog\");\nexport const MotionDiv = /*@__PURE__*/ createMinimalMotionComponent(\"div\");\nexport const MotionDl = /*@__PURE__*/ createMinimalMotionComponent(\"dl\");\nexport const MotionDt = /*@__PURE__*/ createMinimalMotionComponent(\"dt\");\nexport const MotionEm = /*@__PURE__*/ createMinimalMotionComponent(\"em\");\nexport const MotionEmbed = /*@__PURE__*/ createMinimalMotionComponent(\"embed\");\nexport const MotionFieldset = \n/*@__PURE__*/ createMinimalMotionComponent(\"fieldset\");\nexport const MotionFigcaption = \n/*@__PURE__*/ createMinimalMotionComponent(\"figcaption\");\nexport const MotionFigure = /*@__PURE__*/ createMinimalMotionComponent(\"figure\");\nexport const MotionFooter = /*@__PURE__*/ createMinimalMotionComponent(\"footer\");\nexport const MotionForm = /*@__PURE__*/ createMinimalMotionComponent(\"form\");\nexport const MotionH1 = /*@__PURE__*/ createMinimalMotionComponent(\"h1\");\nexport const MotionH2 = /*@__PURE__*/ createMinimalMotionComponent(\"h2\");\nexport const MotionH3 = /*@__PURE__*/ createMinimalMotionComponent(\"h3\");\nexport const MotionH4 = /*@__PURE__*/ createMinimalMotionComponent(\"h4\");\nexport const MotionH5 = /*@__PURE__*/ createMinimalMotionComponent(\"h5\");\nexport const MotionH6 = /*@__PURE__*/ createMinimalMotionComponent(\"h6\");\nexport const MotionHead = /*@__PURE__*/ createMinimalMotionComponent(\"head\");\nexport const MotionHeader = /*@__PURE__*/ createMinimalMotionComponent(\"header\");\nexport const MotionHgroup = /*@__PURE__*/ createMinimalMotionComponent(\"hgroup\");\nexport const MotionHr = /*@__PURE__*/ createMinimalMotionComponent(\"hr\");\nexport const MotionHtml = /*@__PURE__*/ createMinimalMotionComponent(\"html\");\nexport const MotionI = /*@__PURE__*/ createMinimalMotionComponent(\"i\");\nexport const MotionIframe = /*@__PURE__*/ createMinimalMotionComponent(\"iframe\");\nexport const MotionImg = /*@__PURE__*/ createMinimalMotionComponent(\"img\");\nexport const MotionInput = /*@__PURE__*/ createMinimalMotionComponent(\"input\");\nexport const MotionIns = /*@__PURE__*/ createMinimalMotionComponent(\"ins\");\nexport const MotionKbd = /*@__PURE__*/ createMinimalMotionComponent(\"kbd\");\nexport const MotionKeygen = /*@__PURE__*/ createMinimalMotionComponent(\"keygen\");\nexport const MotionLabel = /*@__PURE__*/ createMinimalMotionComponent(\"label\");\nexport const MotionLegend = /*@__PURE__*/ createMinimalMotionComponent(\"legend\");\nexport const MotionLi = /*@__PURE__*/ createMinimalMotionComponent(\"li\");\nexport const MotionLink = /*@__PURE__*/ createMinimalMotionComponent(\"link\");\nexport const MotionMain = /*@__PURE__*/ createMinimalMotionComponent(\"main\");\nexport const MotionMap = /*@__PURE__*/ createMinimalMotionComponent(\"map\");\nexport const MotionMark = /*@__PURE__*/ createMinimalMotionComponent(\"mark\");\nexport const MotionMenu = /*@__PURE__*/ createMinimalMotionComponent(\"menu\");\nexport const MotionMenuitem = \n/*@__PURE__*/ createMinimalMotionComponent(\"menuitem\");\nexport const MotionMeter = /*@__PURE__*/ createMinimalMotionComponent(\"meter\");\nexport const MotionNav = /*@__PURE__*/ createMinimalMotionComponent(\"nav\");\nexport const MotionObject = /*@__PURE__*/ createMinimalMotionComponent(\"object\");\nexport const MotionOl = /*@__PURE__*/ createMinimalMotionComponent(\"ol\");\nexport const MotionOptgroup = \n/*@__PURE__*/ createMinimalMotionComponent(\"optgroup\");\nexport const MotionOption = /*@__PURE__*/ createMinimalMotionComponent(\"option\");\nexport const MotionOutput = /*@__PURE__*/ createMinimalMotionComponent(\"output\");\nexport const MotionP = /*@__PURE__*/ createMinimalMotionComponent(\"p\");\nexport const MotionParam = /*@__PURE__*/ createMinimalMotionComponent(\"param\");\nexport const MotionPicture = \n/*@__PURE__*/ createMinimalMotionComponent(\"picture\");\nexport const MotionPre = /*@__PURE__*/ createMinimalMotionComponent(\"pre\");\nexport const MotionProgress = \n/*@__PURE__*/ createMinimalMotionComponent(\"progress\");\nexport const MotionQ = /*@__PURE__*/ createMinimalMotionComponent(\"q\");\nexport const MotionRp = /*@__PURE__*/ createMinimalMotionComponent(\"rp\");\nexport const MotionRt = /*@__PURE__*/ createMinimalMotionComponent(\"rt\");\nexport const MotionRuby = /*@__PURE__*/ createMinimalMotionComponent(\"ruby\");\nexport const MotionS = /*@__PURE__*/ createMinimalMotionComponent(\"s\");\nexport const MotionSamp = /*@__PURE__*/ createMinimalMotionComponent(\"samp\");\nexport const MotionScript = /*@__PURE__*/ createMinimalMotionComponent(\"script\");\nexport const MotionSection = \n/*@__PURE__*/ createMinimalMotionComponent(\"section\");\nexport const MotionSelect = /*@__PURE__*/ createMinimalMotionComponent(\"select\");\nexport const MotionSmall = /*@__PURE__*/ createMinimalMotionComponent(\"small\");\nexport const MotionSource = /*@__PURE__*/ createMinimalMotionComponent(\"source\");\nexport const MotionSpan = /*@__PURE__*/ createMinimalMotionComponent(\"span\");\nexport const MotionStrong = /*@__PURE__*/ createMinimalMotionComponent(\"strong\");\nexport const MotionStyle = /*@__PURE__*/ createMinimalMotionComponent(\"style\");\nexport const MotionSub = /*@__PURE__*/ createMinimalMotionComponent(\"sub\");\nexport const MotionSummary = \n/*@__PURE__*/ createMinimalMotionComponent(\"summary\");\nexport const MotionSup = /*@__PURE__*/ createMinimalMotionComponent(\"sup\");\nexport const MotionTable = /*@__PURE__*/ createMinimalMotionComponent(\"table\");\nexport const MotionTbody = /*@__PURE__*/ createMinimalMotionComponent(\"tbody\");\nexport const MotionTd = /*@__PURE__*/ createMinimalMotionComponent(\"td\");\nexport const MotionTextarea = \n/*@__PURE__*/ createMinimalMotionComponent(\"textarea\");\nexport const MotionTfoot = /*@__PURE__*/ createMinimalMotionComponent(\"tfoot\");\nexport const MotionTh = /*@__PURE__*/ createMinimalMotionComponent(\"th\");\nexport const MotionThead = /*@__PURE__*/ createMinimalMotionComponent(\"thead\");\nexport const MotionTime = /*@__PURE__*/ createMinimalMotionComponent(\"time\");\nexport const MotionTitle = /*@__PURE__*/ createMinimalMotionComponent(\"title\");\nexport const MotionTr = /*@__PURE__*/ createMinimalMotionComponent(\"tr\");\nexport const MotionTrack = /*@__PURE__*/ createMinimalMotionComponent(\"track\");\nexport const MotionU = /*@__PURE__*/ createMinimalMotionComponent(\"u\");\nexport const MotionUl = /*@__PURE__*/ createMinimalMotionComponent(\"ul\");\nexport const MotionVideo = /*@__PURE__*/ createMinimalMotionComponent(\"video\");\nexport const MotionWbr = /*@__PURE__*/ createMinimalMotionComponent(\"wbr\");\nexport const MotionWebview = \n/*@__PURE__*/ createMinimalMotionComponent(\"webview\");\n/**\n * SVG components\n */\nexport const MotionAnimate = \n/*@__PURE__*/ createMinimalMotionComponent(\"animate\");\nexport const MotionCircle = /*@__PURE__*/ createMinimalMotionComponent(\"circle\");\nexport const MotionDefs = /*@__PURE__*/ createMinimalMotionComponent(\"defs\");\nexport const MotionDesc = /*@__PURE__*/ createMinimalMotionComponent(\"desc\");\nexport const MotionEllipse = \n/*@__PURE__*/ createMinimalMotionComponent(\"ellipse\");\nexport const MotionG = /*@__PURE__*/ createMinimalMotionComponent(\"g\");\nexport const MotionImage = /*@__PURE__*/ createMinimalMotionComponent(\"image\");\nexport const MotionLine = /*@__PURE__*/ createMinimalMotionComponent(\"line\");\nexport const MotionFilter = /*@__PURE__*/ createMinimalMotionComponent(\"filter\");\nexport const MotionMarker = /*@__PURE__*/ createMinimalMotionComponent(\"marker\");\nexport const MotionMask = /*@__PURE__*/ createMinimalMotionComponent(\"mask\");\nexport const MotionMetadata = \n/*@__PURE__*/ createMinimalMotionComponent(\"metadata\");\nexport const MotionPath = /*@__PURE__*/ createMinimalMotionComponent(\"path\");\nexport const MotionPattern = \n/*@__PURE__*/ createMinimalMotionComponent(\"pattern\");\nexport const MotionPolygon = \n/*@__PURE__*/ createMinimalMotionComponent(\"polygon\");\nexport const MotionPolyline = \n/*@__PURE__*/ createMinimalMotionComponent(\"polyline\");\nexport const MotionRect = /*@__PURE__*/ createMinimalMotionComponent(\"rect\");\nexport const MotionStop = /*@__PURE__*/ createMinimalMotionComponent(\"stop\");\nexport const MotionSvg = /*@__PURE__*/ createMinimalMotionComponent(\"svg\");\nexport const MotionSymbol = /*@__PURE__*/ createMinimalMotionComponent(\"symbol\");\nexport const MotionText = /*@__PURE__*/ createMinimalMotionComponent(\"text\");\nexport const MotionTspan = /*@__PURE__*/ createMinimalMotionComponent(\"tspan\");\nexport const MotionUse = /*@__PURE__*/ createMinimalMotionComponent(\"use\");\nexport const MotionView = /*@__PURE__*/ createMinimalMotionComponent(\"view\");\nexport const MotionClipPath = \n/*@__PURE__*/ createMinimalMotionComponent(\"clipPath\");\nexport const MotionFeBlend = \n/*@__PURE__*/ createMinimalMotionComponent(\"feBlend\");\nexport const MotionFeColorMatrix = \n/*@__PURE__*/ createMinimalMotionComponent(\"feColorMatrix\");\nexport const MotionFeComponentTransfer = \n/*@__PURE__*/ createMinimalMotionComponent(\"feComponentTransfer\");\nexport const MotionFeComposite = \n/*@__PURE__*/ createMinimalMotionComponent(\"feComposite\");\nexport const MotionFeConvolveMatrix = \n/*@__PURE__*/ createMinimalMotionComponent(\"feConvolveMatrix\");\nexport const MotionFeDiffuseLighting = \n/*@__PURE__*/ createMinimalMotionComponent(\"feDiffuseLighting\");\nexport const MotionFeDisplacementMap = \n/*@__PURE__*/ createMinimalMotionComponent(\"feDisplacementMap\");\nexport const MotionFeDistantLight = \n/*@__PURE__*/ createMinimalMotionComponent(\"feDistantLight\");\nexport const MotionFeDropShadow = \n/*@__PURE__*/ createMinimalMotionComponent(\"feDropShadow\");\nexport const MotionFeFlood = \n/*@__PURE__*/ createMinimalMotionComponent(\"feFlood\");\nexport const MotionFeFuncA = \n/*@__PURE__*/ createMinimalMotionComponent(\"feFuncA\");\nexport const MotionFeFuncB = \n/*@__PURE__*/ createMinimalMotionComponent(\"feFuncB\");\nexport const MotionFeFuncG = \n/*@__PURE__*/ createMinimalMotionComponent(\"feFuncG\");\nexport const MotionFeFuncR = \n/*@__PURE__*/ createMinimalMotionComponent(\"feFuncR\");\nexport const MotionFeGaussianBlur = \n/*@__PURE__*/ createMinimalMotionComponent(\"feGaussianBlur\");\nexport const MotionFeImage = \n/*@__PURE__*/ createMinimalMotionComponent(\"feImage\");\nexport const MotionFeMerge = \n/*@__PURE__*/ createMinimalMotionComponent(\"feMerge\");\nexport const MotionFeMergeNode = \n/*@__PURE__*/ createMinimalMotionComponent(\"feMergeNode\");\nexport const MotionFeMorphology = \n/*@__PURE__*/ createMinimalMotionComponent(\"feMorphology\");\nexport const MotionFeOffset = \n/*@__PURE__*/ createMinimalMotionComponent(\"feOffset\");\nexport const MotionFePointLight = \n/*@__PURE__*/ createMinimalMotionComponent(\"fePointLight\");\nexport const MotionFeSpecularLighting = \n/*@__PURE__*/ createMinimalMotionComponent(\"feSpecularLighting\");\nexport const MotionFeSpotLight = \n/*@__PURE__*/ createMinimalMotionComponent(\"feSpotLight\");\nexport const MotionFeTile = /*@__PURE__*/ createMinimalMotionComponent(\"feTile\");\nexport const MotionFeTurbulence = \n/*@__PURE__*/ createMinimalMotionComponent(\"feTurbulence\");\nexport const MotionForeignObject = \n/*@__PURE__*/ createMinimalMotionComponent(\"foreignObject\");\nexport const MotionLinearGradient = \n/*@__PURE__*/ createMinimalMotionComponent(\"linearGradient\");\nexport const MotionRadialGradient = \n/*@__PURE__*/ createMinimalMotionComponent(\"radialGradient\");\nexport const MotionTextPath = \n/*@__PURE__*/ createMinimalMotionComponent(\"textPath\");\n//# sourceMappingURL=elements.js.map","import { m } from \"./\";\nexport const MotionDiv = m.div;\n//# sourceMappingURL=size.js.map"],"names":["clamp","min","max","v","LayoutGroupContext","createContext","LazyContext","strict","MotionConfigContext","transformPagePoint","p","isStatic","reducedMotion","MotionContext","isCSSVariableName","token","key","startsWith","checkStringStartsWith","number","test","parse","parseFloat","transform","alpha","scale","default","sanitize","Math","round","floatRegex","singleColorRegex","isColorString","type","testProp","Boolean","isNullish","Object","prototype","hasOwnProperty","call","splitColor","aName","bName","cName","a","b","c","match","undefined","rgbUnit","clampRgbUnit","rgba","red","green","blue","alpha$1","hex","r","g","length","substring","parseInt","createUnitType","unit","endsWith","split","degrees","percent","px","progressPercentage","hsla","hue","saturation","lightness","color","getAnimatableNone","parsed","colorRegex","NUMBER_TOKEN","COLOR_TOKEN","complexRegex","analyseComplexValue","value","originalValue","toString","values","indexes","var","types","i","replace","parsedValue","push","buildTransformer","numSections","output","convertToZero","splitBefore","trim","complex","isNaN","createTransformer","source","info","transformer","map","transformPropOrder","transformProps","Set","resolveVariantFromProps","props","definition","custom","visualElement","current","velocity","variants","isMotionValue","getVelocity","optimizedAppearDataAttribute","toLowerCase","int","numberValueTypes","borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","width","maxWidth","height","maxHeight","top","right","bottom","left","inset","insetBlock","insetBlockStart","insetBlockEnd","insetInline","insetInlineStart","insetInlineEnd","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingBlock","paddingBlockStart","paddingBlockEnd","paddingInline","paddingInlineStart","paddingInlineEnd","margin","marginTop","marginRight","marginBottom","marginLeft","marginBlock","marginBlockStart","marginBlockEnd","marginInline","marginInlineStart","marginInlineEnd","fontSize","backgroundPositionX","backgroundPositionY","rotate","pathRotation","rotateX","rotateY","rotateZ","scaleX","scaleY","scaleZ","skew","skewX","skewY","distance","translateX","translateY","translateZ","x","y","z","perspective","transformPerspective","opacity","originX","originY","originZ","zIndex","fillOpacity","strokeOpacity","numOctaves","getValueAsType","isAnimationControls","start","isVariantLabel","Array","isArray","variantProps","isControllingVariants","animate","some","name","featureDefinitions","translateAlias","numTransforms","buildHTMLStyles","state","latestValues","transformTemplate","style","vars","transformOrigin","hasTransform","hasTransformOrigin","has","valueAsType","transformString","transformIsDefault","valueIsDefault","buildTransform","pixelsToPercent","pixels","axis","correctBorderRadius","correct","latest","node","target","correctBoxShadow","treeScale","projectionDelta","original","shadow","template","offset","xScale","yScale","averageScale","from","scaleCorrectors","applyTo","boxShadow","isForcedMotionValue","layout","layoutId","scrapeMotionValuesFromProps","prevProps","prevStyle","newValues","getValue","liveStyle","dashKeys","array","camelKeys","cssStyleProperties","buildSVGAttrs","attrX","attrY","attrScale","pathLength","pathSpacing","pathOffset","isSVGTag","styleProp","viewBox","attrs","transformBox","spacing","useDashCase","keys","buildSVGPath","resolveMotionValue","get","useCreateMotionContext","initial","context","inherit","getCurrentTreeVariants","useContext","useMemo","variantLabelsAsDependency","prop","join","createHtmlRenderState","copyRawValuesOnly","useStyle","visualState","assign","useInitialMotionValues","useHTMLProps","htmlProps","drag","dragListener","draggable","userSelect","WebkitUserSelect","WebkitTouchCallout","touchAction","tabIndex","onTap","onTapStart","whileTap","createSvgRenderState","useSVGProps","_isStatic","Component","visualProps","tag","rawStyles","validMotionProps","isValidMotionProp","shouldForward","isValidProp","lowercaseSVGElements","isSVGComponent","includes","indexOf","useRender","ref","forwardMotionProps","isSVG","filteredProps","isDom","filterProps","elementProps","Fragment","children","renderedChildren","createElement","PresenceContext","makeLatestValues","presenceContext","scrapeMotionValues","motionValues","checkIsControllingVariants","isVariantNode","checkIsVariantNode","isInitialAnimationBlocked","variantToSet","list","resolved","transitionEnd","transition","valueTarget","makeUseVisualState","config","make","createRenderState","renderState","makeState","init","useRef","useConstant","useHTMLVisualState","scrapeHTMLMotionValuesFromProps","useSVGVisualState","scrapeMotionValuesFromProps$1","charAt","toUpperCase","featureProps","animation","exit","focus","hover","tap","pan","inView","isInitialized","initFeatureDefinitions","initialFeatureDefinitions","isEnabled","getInitializedFeatureDefinitions","motionComponentSymbol","Symbol","for","useMotionRef","externalRef","externalRefContainer","useInsertionEffect","refCleanup","useCallback","instance","onMount","mount","unmount","cleanup","SwitchLayoutGroupContext","isRefObject","useIsomorphicLayoutEffect","window","useLayoutEffect","useEffect","useVisualElement","createVisualElement","ProjectionNodeConstructor","parent","lazyContext","motionConfig","reducedMotionConfig","skipAnimations","visualElementRef","hasMountedOnce","renderer","blockInitialAnimation","manuallyAnimateOnMount","initialLayoutGroupConfig","projection","initialPromotionConfig","dragConstraints","layoutScroll","layoutRoot","layoutAnchor","layoutCrossfade","getClosestProjectingNode","setOptions","alwaysMeasureLayout","animationType","crossfade","createProjectionNode","isMounted","update","optimisedAppearId","wantsHandoff","MotionHandoffIsComplete","MotionHasOptimisedAnimation","MotionIsMounted","updateFeatures","scheduleRenderMicrotask","animationState","animateChanges","queueMicrotask","MotionHandoffMarkAsComplete","enteringChildren","options","allowProjection","createMotionComponent","preloadedFeatures","useVisualState","MotionDOMComponent","MeasureLayout","configAndProps","useLayoutId","layoutProjection","combined","ProjectionNode","getProjectionFunctionality","_jsxs","Provider","_jsx","displayName","ForwardRefMotionComponent","forwardRef","layoutGroupId","id","createMinimalMotionComponent","MotionDiv"],"mappings":"+PAAA,MAAMA,EAAQ,CAACC,EAAKC,EAAKC,IACjBA,EAAID,EACGA,EACPC,EAAIF,EACGA,EACJE,ECHEC,EAAqBC,EAAc,ICAnCC,EAAcD,EAAc,CAAEE,QAAQ,ICGtCC,EAAsBH,EAAc,CAC7CI,mBAAqBC,GAAMA,EAC3BC,UAAU,EACVC,cAAe,UCNNC,EAAgCR,EAAc,ICDrDS,EADwB,CAACC,GAAWC,GAAuB,iBAARA,GAAoBA,EAAIC,WAAWF,GAE9EG,CAAsB,MCA9BC,EAAS,CACXC,KAAOjB,GAAmB,iBAANA,EACpBkB,MAAOC,WACPC,UAAYpB,GAAMA,GAEhBqB,EAAQ,IACPL,EACHI,UAAYpB,GAAMH,EAAM,EAAG,EAAGG,IAE5BsB,EAAQ,IACPN,EACHO,QAAS,GCXPC,EAAYxB,GAAMyB,KAAKC,MAAU,IAAJ1B,GAAc,ICF3C2B,EAAa,8BCAnB,MAAMC,EAAmB,sHCQnBC,EAAgB,CAACC,EAAMC,IAAc/B,GAChCgC,QAAsB,iBAANhC,GACnB4B,EAAiBX,KAAKjB,IACtBA,EAAEc,WAAWgB,IACZC,ICZT,SAAmB/B,GACf,OAAY,MAALA,CACX,CDWaiC,CAAUjC,IACXkC,OAAOC,UAAUC,eAAeC,KAAKrC,EAAG+B,IAE9CO,EAAa,CAACC,EAAOC,EAAOC,IAAWzC,IACzC,GAAiB,iBAANA,EACP,OAAOA,EACX,MAAO0C,EAAGC,EAAGC,EAAGvB,GAASrB,EAAE6C,MAAMlB,GACjC,MAAO,CACHY,CAACA,GAAQpB,WAAWuB,GACpBF,CAACA,GAAQrB,WAAWwB,GACpBF,CAACA,GAAQtB,WAAWyB,GACpBvB,WAAiByB,IAAVzB,EAAsBF,WAAWE,GAAS,IElBnD0B,EAAU,IAC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B,IAAKyF,IAAShD,EACV,MAAO,CAAA,EACX,MAAMwM,EAAW,IAAKxJ,KAAShD,GAC/B,MAAO,CACHoM,cAAepJ,GAAM+E,UAAU9Q,IAAU+I,GAAQ+H,UAAU9Q,GACrDuV,EAASJ,mBACTjZ,EACNsZ,eAAgBD,EAASC,eAEjC,CAxDqCC,CAA2BL,GACpDD,EAAgBG,EAAiBH,cAOjCpK,EAAQ5K,cAAgBiS,GAAiBvF,EAAWnB,EAAa0J,EAAgB/C,EAAqBiD,EAAiBE,eAAgB5H,EAC3I,CAKA,OAAQ8H,EAAM5b,EAAc6b,SAAU,CAAEvX,MAAO2M,EAASmD,SAAU,CAACiH,GAAiBpK,EAAQ5K,cAAiByV,EAAKT,EAAe,CAAEhV,cAAe4K,EAAQ5K,iBAAkBiV,IAAqB,KAAM3H,GAAUZ,EAAW7M,EAAOmR,GAAazF,EAAaX,EAAQ5K,cAAeiR,GAAc1F,EAAa9R,EAAU+T,EAAoBC,EAAOR,KACxV,CACA8H,EAAmBW,YAAc,UAA+B,iBAAdhJ,EAC5CA,EACA,UAAUA,EAAUgJ,aAAehJ,EAAUxG,MAAQ,QAC3D,MAAMyP,EAA4BC,EAAWb,GAE7C,OADAY,EAA0B9E,IAAyBnE,EAC5CiJ,CACX,CACA,SAAST,IAAYrM,SAAEA,IACnB,MAAMgN,EAAgB9K,EAAW7R,GAAoB4c,GACrD,OAAOD,QAA8B9Z,IAAb8M,EAClBgN,EAAgB,IAAMhN,EACtBA,CACV,CC/EO,SAASkN,GAA6BrJ,EAAWgI,GACpD,OAAOE,GAAsBlI,EAAWgI,EAC5C,CCqCO,MCvCMsB,GDuC0BD,GAA6B"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/size-rollup-motion.js b/node_modules/framer-motion/dist/size-rollup-motion.js new file mode 100644 index 0000000..6ba5c44 --- /dev/null +++ b/node_modules/framer-motion/dist/size-rollup-motion.js @@ -0,0 +1,2 @@ +import{jsxs as t,jsx as e}from"react/jsx-runtime";import{createContext as n,useContext as i,useMemo as s,Fragment as o,createElement as r,useRef as a,useInsertionEffect as l,useCallback as h,useLayoutEffect as u,useEffect as c,forwardRef as d,useId as p,Component as m}from"react";function f(t,e){-1===t.indexOf(e)&&t.push(e)}function y(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const g=(t,e,n)=>n>e?e:n{},w=()=>{};"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(x=(t,e,n)=>{t||"undefined"==typeof console||console.warn(v(e,n))},w=(t,e,n)=>{if(!t)throw new Error(v(e,n))});const T={},S=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),P=t=>"object"==typeof t&&null!==t,b=t=>/^0[^.\s]+$/u.test(t);function E(t){let e;return()=>(void 0===e&&(e=t()),e)}const A=t=>t,M=(...t)=>t.reduce((t,e)=>n=>e(t(n))),V=(t,e,n)=>{const i=e-t;return i?(n-t)/i:1};class C{constructor(){this.subscriptions=[]}add(t){return f(this.subscriptions,t),()=>y(this.subscriptions,t)}notify(t,e,n){const i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](t,e,n);else for(let s=0;s1e3*t,D=t=>t/1e3,R=(t,e)=>e?t*(1e3/e):0,L=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function B(t,e,n,i){if(t===e&&n===i)return A;const s=e=>function(t,e,n,i,s){let o,r,a=0;do{r=e+(n-e)/2,o=L(r,i,s)-t,o>0?n=r:e=r}while(Math.abs(o)>1e-7&&++a<12);return r}(e,0,1,t,n);return t=>0===t||1===t?t:L(s(t),e,i)}const j=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,F=t=>e=>1-t(1-e),I=B(.33,1.53,.69,.99),O=F(I),U=j(O),W=t=>t>=1?1:(t*=2)<1?.5*O(t):.5*(2-Math.pow(2,-10*(t-1))),N=t=>1-Math.sin(Math.acos(t)),$=F(N),z=j(N),Y=B(.42,0,1,1),X=B(0,0,.58,1),H=B(.42,0,.58,1),K=t=>Array.isArray(t)&&"number"==typeof t[0],G={linear:A,easeIn:Y,easeInOut:H,easeOut:X,circIn:N,circInOut:z,circOut:$,backIn:O,backInOut:U,backOut:I,anticipate:W},q=t=>{if(K(t)){w(4===t.length,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[e,n,i,s]=t;return B(e,n,i,s)}return"string"==typeof t?(w(void 0!==G[t],`Invalid easing type '${t}'`,"invalid-easing-type"),G[t]):t},Z=n({}),_=n({strict:!1}),J=n({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),Q=n({}),tt=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function et(t,e){let n=!1,i=!0;const s={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,r=tt.reduce((t,e)=>(t[e]=function(t){let e=new Set,n=new Set,i=!1,s=!1;const o=new WeakSet;let r={delta:0,timestamp:0,isProcessing:!1};function a(e){o.has(e)&&(l.schedule(e),t()),e(r)}const l={schedule:(t,s=!1,r=!1)=>{const a=r&&i?e:n;return s&&o.add(t),a.add(t),t},cancel:t=>{n.delete(t),o.delete(t)},process:t=>{if(r=t,i)return void(s=!0);i=!0;const o=e;e=n,n=o,e.forEach(a),e.clear(),i=!1,s&&(s=!1,l.process(t))}};return l}(o),t),{}),{setup:a,read:l,resolveKeyframes:h,preUpdate:u,update:c,preRender:d,render:p,postRender:m}=r,f=()=>{const o=T.useManualTiming,r=o?s.timestamp:performance.now();n=!1,o||(s.delta=i?1e3/60:Math.max(Math.min(r-s.timestamp,40),1)),s.timestamp=r,s.isProcessing=!0,a.process(s),l.process(s),h.process(s),u.process(s),c.process(s),d.process(s),p.process(s),m.process(s),s.isProcessing=!1,n&&e&&(i=!1,t(f))};return{schedule:tt.reduce((e,o)=>{const a=r[o];return e[o]=(e,o=!1,r=!1)=>(n||(n=!0,i=!0,s.isProcessing||t(f)),a.schedule(e,o,r)),e},{}),cancel:t=>{for(let e=0;e(void 0===rt&<.set(st.isProcessing||T.useManualTiming?st.timestamp:performance.now()),rt),set:t=>{rt=t,queueMicrotask(at)}},ht=t=>e=>"string"==typeof e&&e.startsWith(t),ut=ht("--"),ct=ht("var(--"),dt=t=>!!ct(t)&&pt.test(t.split("/*")[0].trim()),pt=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function mt(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const ft={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},yt={...ft,transform:t=>g(0,1,t)},gt={...ft,default:1},vt=t=>Math.round(1e5*t)/1e5,xt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const wt=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Tt=(t,e)=>n=>Boolean("string"==typeof n&&wt.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),St=(t,e,n)=>i=>{if("string"!=typeof i)return i;const[s,o,r,a]=i.match(xt);return{[t]:parseFloat(s),[e]:parseFloat(o),[n]:parseFloat(r),alpha:void 0!==a?parseFloat(a):1}},Pt={...ft,transform:t=>Math.round((t=>g(0,255,t))(t))},bt={test:Tt("rgb","red"),parse:St("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+Pt.transform(t)+", "+Pt.transform(e)+", "+Pt.transform(n)+", "+vt(yt.transform(i))+")"};const Et={test:Tt("#"),parse:function(t){let e="",n="",i="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),i=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),i=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,i+=i,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:s?parseInt(s,16)/255:1}},transform:bt.transform},At=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),Mt=At("deg"),Vt=At("%"),Ct=At("px"),kt=At("vh"),Dt=At("vw"),Rt=(()=>({...Vt,parse:t=>Vt.parse(t)/100,transform:t=>Vt.transform(100*t)}))(),Lt={test:Tt("hsl","hue"),parse:St("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+Vt.transform(vt(e))+", "+Vt.transform(vt(n))+", "+vt(yt.transform(i))+")"},Bt={test:t=>bt.test(t)||Et.test(t)||Lt.test(t),parse:t=>bt.test(t)?bt.parse(t):Lt.test(t)?Lt.parse(t):Et.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?bt.transform(t):Lt.transform(t),getAnimatableNone:t=>{const e=Bt.parse(t);return e.alpha=0,Bt.transform(e)}},jt=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const Ft="number",It="color",Ot=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Ut(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},s=[];let o=0;const r=e.replace(Ot,t=>(Bt.test(t)?(i.color.push(o),s.push(It),n.push(Bt.parse(t))):t.startsWith("var(")?(i.var.push(o),s.push("var"),n.push(t)):(i.number.push(o),s.push(Ft),n.push(parseFloat(t))),++o,"${}")).split("${}");return{values:n,split:r,indexes:i,types:s}}function Wt({split:t,types:e}){const n=t.length;return i=>{let s="";for(let o=0;o{return"number"==typeof t?e?.trim().endsWith("/")?t:0:"number"==typeof(n=t)?0:Bt.test(n)?Bt.getAnimatableNone(n):n;var n};const $t={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(xt)?.length||0)+(t.match(jt)?.length||0)>0},parse:function(t){return Ut(t).values},createTransformer:function(t){return Wt(Ut(t))},getAnimatableNone:function(t){const e=Ut(t);return Wt(e)(e.values.map((t,n)=>Nt(t,e.split[n])))}};function zt(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function Yt(t,e){return n=>n>0?e:t}const Xt=(t,e,n)=>t+(e-t)*n,Ht=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},Kt=[Et,bt,Lt];function Gt(t){const e=(n=t,Kt.find(t=>t.test(n)));var n;if(x(Boolean(e),`'${t}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!Boolean(e))return!1;let i=e.parse(t);return e===Lt&&(i=function({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let s=0,o=0,r=0;if(e/=100){const i=n<.5?n*(1+e):n+e-n*e,a=2*n-i;s=zt(a,i,t+1/3),o=zt(a,i,t),r=zt(a,i,t-1/3)}else s=o=r=n;return{red:Math.round(255*s),green:Math.round(255*o),blue:Math.round(255*r),alpha:i}}(i)),i}const qt=(t,e)=>{const n=Gt(t),i=Gt(e);if(!n||!i)return Yt(t,e);const s={...n};return t=>(s.red=Ht(n.red,i.red,t),s.green=Ht(n.green,i.green,t),s.blue=Ht(n.blue,i.blue,t),s.alpha=Xt(n.alpha,i.alpha,t),bt.transform(s))},Zt=new Set(["none","hidden"]);function _t(t,e){return n=>Xt(t,e,n)}function Jt(t){return"number"==typeof t?_t:"string"==typeof t?dt(t)?Yt:Bt.test(t)?qt:ee:Array.isArray(t)?Qt:"object"==typeof t?Bt.test(t)?qt:te:Yt}function Qt(t,e){const n=[...t],i=n.length,s=t.map((t,n)=>Jt(t)(t,e[n]));return t=>{for(let e=0;e{for(const e in i)n[e]=i[e](t);return n}}const ee=(t,e)=>{const n=$t.createTransformer(e),i=Ut(t),s=Ut(e);return i.indexes.var.length===s.indexes.var.length&&i.indexes.color.length===s.indexes.color.length&&i.indexes.number.length>=s.indexes.number.length?Zt.has(t)&&!s.values.length||Zt.has(e)&&!i.values.length?function(t,e){return Zt.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):M(Qt(function(t,e){const n=[],i={color:0,var:0,number:0};for(let s=0;s{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>nt.update(e,t),stop:()=>it(e),now:()=>st.isProcessing?st.timestamp:lt.now()}},se=(t,e,n=10)=>{let i="";const s=Math.max(Math.round(e/n),2);for(let e=0;e=oe?1/0:e}const ae=100,le=10,he=1,ue=0,ce=800,de=.3,pe=.3,me={granular:.01,default:2},fe={granular:.005,default:.5},ye=.01,ge=10,ve=.05,xe=1;function we(t,e){return t*Math.sqrt(1-e*e)}const Te=.001;const Se=["duration","bounce"],Pe=["stiffness","damping","mass"];function be(t,e){return e.some(e=>void 0!==t[e])}function Ee(t){let e={velocity:ue,stiffness:ae,damping:le,mass:he,isResolvedFromDuration:!1,...t};if(!be(t,Pe)&&be(t,Se))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,i=2*Math.PI/(1.2*n),s=i*i,o=2*g(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:he,stiffness:s,damping:o}}else{const n=function({duration:t=ce,bounce:e=de,velocity:n=ue,mass:i=he}){let s,o;x(t<=k(ge),"Spring duration must be 10 seconds or less","spring-duration-limit");let r=1-e;r=g(ve,xe,r),t=g(ye,ge,D(t)),r<1?(s=e=>{const i=e*r,s=i*t,o=i-n,a=we(e,r),l=Math.exp(-s);return Te-o/a*l},o=e=>{const i=e*r*t,o=i*n+n,a=Math.pow(r,2)*Math.pow(e,2)*t,l=Math.exp(-i),h=we(Math.pow(e,2),r);return(-s(e)+Te>0?-1:1)*((o-a)*l)/h}):(s=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,o=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let i=n;for(let n=1;n<12;n++)i-=t(i)/e(i);return i}(s,o,5/t);if(t=k(t),isNaN(a))return{stiffness:ae,damping:le,duration:t};{const e=Math.pow(a,2)*i;return{stiffness:e,damping:2*r*Math.sqrt(i*e),duration:t}}}({...t,velocity:0});e={...e,...n,mass:he},e.isResolvedFromDuration=!0}return e}function Ae(t=pe,e=de){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:i,restDelta:s}=n;const o=n.keyframes[0],r=n.keyframes[n.keyframes.length-1],a={done:!1,value:o},{stiffness:l,damping:h,mass:u,duration:c,velocity:d,isResolvedFromDuration:p}=Ee({...n,velocity:-D(n.velocity||0)}),m=d||0,f=h/(2*Math.sqrt(l*u)),y=r-o,g=D(Math.sqrt(l/u)),v=Math.abs(y)<5;let x,w,T,S,P,b;if(i||(i=v?me.granular:me.default),s||(s=v?fe.granular:fe.default),f<1)T=we(g,f),S=(m+f*g*y)/T,x=t=>{const e=Math.exp(-f*g*t);return r-e*(S*Math.sin(T*t)+y*Math.cos(T*t))},P=f*g*S+y*T,b=f*g*y-S*T,w=t=>Math.exp(-f*g*t)*(P*Math.sin(T*t)+b*Math.cos(T*t));else if(1===f){x=t=>r-Math.exp(-g*t)*(y+(m+g*y)*t);const t=m+g*y;w=e=>Math.exp(-g*e)*(g*t*e-m)}else{const t=g*Math.sqrt(f*f-1);x=e=>{const n=Math.exp(-f*g*e),i=Math.min(t*e,300);return r-n*((m+f*g*y)*Math.sinh(i)+t*y*Math.cosh(i))/t};const e=(m+f*g*y)/t,n=f*g*e-y*t,i=f*g*y-e*t;w=e=>{const s=Math.exp(-f*g*e),o=Math.min(t*e,300);return s*(n*Math.sinh(o)+i*Math.cosh(o))}}const E={calculatedDuration:p&&c||null,velocity:t=>k(w(t)),next:t=>{if(!p&&f<1){const e=Math.exp(-f*g*t),n=Math.sin(T*t),o=Math.cos(T*t),l=r-e*(S*n+y*o),h=k(e*(P*n+b*o));return a.done=Math.abs(h)<=i&&Math.abs(r-l)<=s,a.value=a.done?r:l,a}const e=x(t);if(p)a.done=t>=c;else{const n=k(w(t));a.done=Math.abs(n)<=i&&Math.abs(r-e)<=s}return a.value=a.done?r:e,a},toString:()=>{const t=Math.min(re(E),oe),e=se(e=>E.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return E}Ae.applyToOptions=t=>{const e=function(t,e=100,n){const i=n({...t,keyframes:[0,e]}),s=Math.min(re(i),oe);return{type:"keyframes",ease:t=>i.next(s*t).value/e,duration:D(s)}}(t,100,Ae);return t.ease=e.ease,t.duration=k(e.duration),t.type="keyframes",t};function Me(t,e,n){const i=Math.max(e-5,0);return R(n-t(i),e-i)}function Ve({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:l,restDelta:h=.5,restSpeed:u}){const c=t[0],d={done:!1,value:c},p=t=>void 0===a?l:void 0===l||Math.abs(a-t)-m*Math.exp(-t/i),v=t=>y+g(t),x=t=>{const e=g(t),n=v(t);d.done=Math.abs(e)<=h,d.value=d.done?y:n};let w,T;const S=t=>{var e;(e=d.value,void 0!==a&&el)&&(w=t,T=Ae({keyframes:[d.value,p(d.value)],velocity:Me(v,t,d.value),damping:s,stiffness:o,restDelta:h,restSpeed:u}))};return S(0),{calculatedDuration:null,next:t=>{let e=!1;return T||void 0!==w||(e=!0,x(t),S(t)),void 0!==w&&t>=w?T.next(t-w):(!e&&x(t),d)}}}function Ce(t,e,{clamp:n=!0,ease:i,mixer:s}={}){const o=t.length;if(w(o===e.length,"Both input and output ranges must be the same length","range-length"),1===o)return()=>e[0];if(2===o&&e[0]===e[1])return()=>e[1];const r=t[0]===t[1];t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=function(t,e,n){const i=[],s=n||T.mix||ne,o=t.length-1;for(let n=0;n{if(r&&n1)for(;ih(g(t[0],t[o-1],e)):h}function ke(t){const e=[0];return function(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const s=V(0,e,i);t.push(Xt(n,1,s))}}(e,t.length-1),e}function De({duration:t=300,keyframes:e,times:n,ease:i="easeInOut"}){const s=(t=>Array.isArray(t)&&"number"!=typeof t[0])(i)?i.map(q):q(i),o={done:!1,value:e[0]},r=function(t,e){return t.map(t=>t*e)}(n&&n.length===e.length?n:ke(e),t),a=Ce(r,e,{ease:Array.isArray(s)?s:(l=e,h=s,l.map(()=>h||H).splice(0,l.length-1))});var l,h;return{calculatedDuration:t,next:e=>(o.value=a(e),o.done=e>=t,o)}}const Re=t=>null!==t;function Le(t,{repeat:e,repeatType:n="loop"},i,s=1){const o=t.filter(Re),r=s<0||e&&"loop"!==n&&e%2==1?0:o.length-1;return r&&void 0!==i?i:o[r]}const Be={decay:Ve,inertia:Ve,tween:De,keyframes:De,spring:Ae};function je(t){"string"==typeof t.type&&(t.type=Be[t.type])}class Fe{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const Ie=t=>t/100;class Oe extends Fe{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:t}=this.options;t&&t.updatedAt!==lt.now()&&this.tick(lt.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;je(t);const{type:e=De,repeat:n=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=t;let{keyframes:r}=t;const a=e||De;a!==De&&"number"!=typeof r[0]&&(this.mixKeyframes=M(Ie,ne(r[0],r[1])),r=[0,100]);const l=a({...t,keyframes:r});"mirror"===s&&(this.mirroredGenerator=a({...t,keyframes:[...r].reverse(),velocity:-o})),null===l.calculatedDuration&&(l.calculatedDuration=re(l));const{calculatedDuration:h}=l;this.calculatedDuration=h,this.resolvedDuration=h+i,this.totalDuration=this.resolvedDuration*(n+1)-i,this.generator=l}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,e=!1){const{generator:n,totalDuration:i,mixKeyframes:s,mirroredGenerator:o,resolvedDuration:r,calculatedDuration:a}=this;if(null===this.startTime)return n.next(0);const{delay:l=0,keyframes:h,repeat:u,repeatType:c,repeatDelay:d,type:p,onUpdate:m,finalKeyframe:f}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const y=this.currentTime-l*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?y<0:y>i;this.currentTime=Math.max(y,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=i);let x,w=this.currentTime,T=n;if(u){const t=Math.min(this.currentTime,i)/r;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,u+1);Boolean(e%2)&&("reverse"===c?(n=1-n,d&&(n-=d/r)):"mirror"===c&&(T=o)),w=g(0,1,n)*r}v?(this.delayState.value=h[0],x=this.delayState):x=T.next(w),s&&!v&&(x.value=s(x.value));let{done:S}=x;v||null===a||(S=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const P=null===this.holdTime&&("finished"===this.state||"running"===this.state&&S);return P&&p!==Ve&&(x.value=Le(h,this.options,f,this.speed)),m&&m(x.value),P&&this.finish(),x}then(t,e){return this.finished.then(t,e)}get duration(){return D(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+D(t)}get time(){return D(this.currentTime)}set time(t){t=k(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);return Me(t=>this.generator.next(t).value,t,this.generator.next(t).value)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;e&&this.driver&&this.updateTime(lt.now()),this.playbackSpeed=t,e&&this.driver&&(this.time=D(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=ie,startTime:e}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),this.options.onPlay?.();const n=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=n):null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime||(this.startTime=e??n),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(lt.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}const Ue=t=>180*t/Math.PI,We=t=>{const e=Ue(Math.atan2(t[1],t[0]));return $e(e)},Ne={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:We,rotateZ:We,skewX:t=>Ue(Math.atan(t[1])),skewY:t=>Ue(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},$e=t=>((t%=360)<0&&(t+=360),t),ze=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Ye=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Xe={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:ze,scaleY:Ye,scale:t=>(ze(t)+Ye(t))/2,rotateX:t=>$e(Ue(Math.atan2(t[6],t[5]))),rotateY:t=>$e(Ue(Math.atan2(-t[2],t[0]))),rotateZ:We,rotate:We,skewX:t=>Ue(Math.atan(t[4])),skewY:t=>Ue(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function He(t){return t.includes("scale")?1:0}function Ke(t,e){if(!t||"none"===t)return He(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,s;if(n)i=Xe,s=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=Ne,s=e}if(!s)return He(e);const o=i[e],r=s[1].split(",").map(Ge);return"function"==typeof o?o(r):r[o]}function Ge(t){return parseFloat(t.trim())}const qe=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ze=(()=>new Set([...qe,"pathRotation"]))(),_e=t=>t===ft||t===Ct,Je=new Set(["x","y","z"]),Qe=qe.filter(t=>!Je.has(t));const tn={width:({x:t},{paddingLeft:e="0",paddingRight:n="0",boxSizing:i})=>{const s=t.max-t.min;return"border-box"===i?s:s-parseFloat(e)-parseFloat(n)},height:({y:t},{paddingTop:e="0",paddingBottom:n="0",boxSizing:i})=>{const s=t.max-t.min;return"border-box"===i?s:s-parseFloat(e)-parseFloat(n)},top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>Ke(e,"x"),y:(t,{transform:e})=>Ke(e,"y")};tn.translateX=tn.x,tn.translateY=tn.y;const en=new Set;let nn=!1,sn=!1,on=!1;function rn(){if(sn){const t=Array.from(en).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),n=new Map;e.forEach(t=>{const e=function(t){const e=[];return Qe.forEach(n=>{const i=t.getValue(n);void 0!==i&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),e}(t);e.length&&(n.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=n.get(t);e&&e.forEach(([e,n])=>{t.getValue(e)?.set(n)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}sn=!1,nn=!1,en.forEach(t=>t.complete(on)),en.clear()}function an(){en.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(sn=!0)})}class ln{constructor(t,e,n,i,s,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(en.add(this),nn||(nn=!0,nt.read(an),nt.resolveKeyframes(rn))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:i}=this;if(null===t[0]){const s=i?.get(),o=t[t.length-1];if(void 0!==s)t[0]=s;else if(n&&e){const i=n.readValue(e,o);null!=i&&(t[0]=i)}void 0===t[0]&&(t[0]=o),i&&void 0===s&&i.set(t[0])}!function(t){for(let e=1;et.startsWith("--"))(e)?t.style.setProperty(e,n):t.style[e]=n}const un={};function cn(t,e){const n=E(t);return()=>un[e]??n()}const dn=cn(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),pn=cn(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),mn=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,fn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:mn([0,.65,.55,1]),circOut:mn([.55,0,1,.45]),backIn:mn([.31,.01,.66,-.59]),backOut:mn([.33,1.53,.69,.99])};function yn(t,e){return t?"function"==typeof t?pn()?se(t,e):"ease-out":K(t)?mn(t):Array.isArray(t)?t.map(t=>yn(t,e)||fn.easeOut):fn[t]:void 0}function gn(t,e,n,{delay:i=0,duration:s=300,repeat:o=0,repeatType:r="loop",ease:a="easeOut",times:l}={},h=void 0){const u={[e]:n};l&&(u.offset=l);const c=yn(a,s);Array.isArray(c)&&(u.easing=c);const d={delay:i,duration:s,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:o+1,direction:"reverse"===r?"alternate":"normal"};return h&&(d.pseudoElement=h),t.animate(u,d)}function vn(t){return"function"==typeof t&&"applyToOptions"in t}class xn extends Fe{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:e,name:n,keyframes:i,pseudoElement:s,allowFlatten:o=!1,finalKeyframe:r,onComplete:a}=t;this.isPseudoElement=Boolean(s),this.allowFlatten=o,this.options=t,w("string"!=typeof t.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const l=function({type:t,...e}){return vn(t)&&pn()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=gn(e,n,i,l,s),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const t=Le(i,this.options,r,this.speed);this.updateMotionValue&&this.updateMotionValue(t),hn(e,n,t),this.animation.cancel()}a?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return D(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+D(t)}get time(){return D(Number(this.animation.currentTime)||0)}set time(t){const e=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=k(t),e&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:e,rangeEnd:n,observe:i}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&dn()?(this.animation.timeline=t,e&&(this.animation.rangeStart=e),n&&(this.animation.rangeEnd=n),A):i(this)}}const wn={anticipate:W,backInOut:U,circInOut:z};function Tn(t){"string"==typeof t.ease&&t.ease in wn&&(t.ease=wn[t.ease])}class Sn extends xn{constructor(t){Tn(t),je(t),super(t),void 0!==t.startTime&&!1!==t.autoplay&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:e,onUpdate:n,onComplete:i,element:s,...o}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);const r=new Oe({...o,autoplay:!1}),a=Math.max(10,lt.now()-this.startTime),l=g(0,10,a-10),h=r.sample(a).value,{name:u}=this.options;s&&u&&hn(s,u,h),e.setWithVelocity(r.sample(Math.max(0,a-l)).value,h,l),r.stop()}}const Pn=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!$t.test(t)&&"0"!==t||t.startsWith("url(")));function bn(t){t.duration=0,t.type="keyframes"}const En=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),An=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;const Mn=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),Vn=E(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Cn(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:s,damping:o,type:r,keyframes:a}=t,l=e?.owner?.current;if(!(l instanceof HTMLElement||l instanceof SVGElement))return!1;const{onUpdate:h,transformTemplate:u}=e.owner.getProps();return Vn()&&n&&(En.has(n)||Mn.has(n)&&function(t){for(let e=0;e{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=lt.now();const c={autoplay:t,delay:e,type:n,repeat:i,repeatDelay:s,repeatType:o,name:a,motionValue:l,element:h,...u},d=h?.KeyframeResolver||ln;this.keyframeResolver=new d(r,(t,e,n)=>this.onKeyframesResolved(t,e,c,!n),a,l,h),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,e,n,i){this.keyframeResolver=void 0;const{name:s,type:o,velocity:r,delay:a,isHandoff:l,onUpdate:h}=n;this.resolvedAt=lt.now();let u=!0;(function(t,e,n,i){const s=t[0];if(null===s)return!1;if("display"===e||"visibility"===e)return!0;const o=t[t.length-1],r=Pn(s,e),a=Pn(o,e);return x(r===a,`You are trying to animate ${e} from "${s}" to "${o}". "${r?o:s}" is not an animatable value.`,"value-not-animatable"),!(!r||!a)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:e,...n,keyframes:t},d=u&&!l&&Cn(c),p=c.motionValue?.owner?.current;let m;if(d)try{m=new Sn({...c,element:p})}catch{m=new Oe(c)}else m=new Oe(c);m.finished.then(()=>{this.notifyFinished()}).catch(A),this.pendingTimeline&&(this.stopTimeline=m.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),on=!0,an(),rn(),on=!1),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function Dn(t,e,n,i=0,s=1){const o=Array.from(t).sort((t,e)=>t.sortNodePosition(e)).indexOf(e),r=t.size,a=(r-1)*i;return"function"==typeof n?n(o,r):1===s?o*i:a-o*i}class Rn{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=lt.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=lt.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new C);const n=this.events[t].add(e);return"change"===t?()=>{n(),nt.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=lt.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return R(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Ln(t,e){return new Rn(t,e)}function Bn(t,e){if(t?.inherit&&e){const{inherit:n,...i}=t;return{...e,...i}}return t}function jn(t,e){const n=t?.[e]??t?.default??t;return n!==t?Bn(n,t):n}const Fn={type:"spring",stiffness:500,damping:25,restSpeed:10},In={type:"keyframes",duration:.8},On={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Un=(t,{keyframes:e})=>e.length>2?In:Ze.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:Fn:On,Wn=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);const Nn=(t,e,n,i={},s,o)=>r=>{const a=jn(i,t)||{},l=a.delay||i.delay||0;let{elapsed:h=0}=i;h-=k(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-h,onUpdate:t=>{e.set(t),a.onUpdate&&a.onUpdate(t)},onComplete:()=>{r(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:o?void 0:s};(function(t){for(const e in t)if(!Wn.has(e))return!0;return!1})(a)||Object.assign(u,Un(t,u)),u.duration&&(u.duration=k(u.duration)),u.repeatDelay&&(u.repeatDelay=k(u.repeatDelay)),void 0!==u.from&&(u.keyframes[0]=u.from);let c=!1;if((!1===u.type||0===u.duration&&!u.repeatDelay)&&(bn(u),0===u.delay&&(c=!0)),(T.instantAnimations||T.skipAnimations||s?.shouldSkipAnimations||a.skipAnimations)&&(c=!0,bn(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,c&&!o&&void 0!==e.get()){const t=Le(u.keyframes,a);if(void 0!==t)return void nt.update(()=>{u.onUpdate(t),u.onComplete()})}return a.isSync?new Oe(u):new kn(u)},$n=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function zn(t,e,n=1){w(n<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[i,s]=function(t){const e=$n.exec(t);if(!e)return[,];const[,n,i,s]=e;return[`--${n??i}`,s]}(t);if(!i)return;const o=window.getComputedStyle(e).getPropertyValue(i);if(o){const t=o.trim();return S(t)?parseFloat(t):t}return dt(s)?zn(s,e,n+1):s}function Yn(t){const e=[{},{}];return t?.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}function Xn(t,e,n,i){if("function"==typeof e){const[s,o]=Yn(i);e=e(void 0!==n?n:t.custom,s,o)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[s,o]=Yn(i);e=e(void 0!==n?n:t.custom,s,o)}return e}function Hn(t,e,n){const i=t.getProps();return Xn(i,e,void 0!==n?n:i.custom,t)}const Kn=new Set(["width","height","top","left","right","bottom",...qe]),Gn=t=>Array.isArray(t);function qn(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Ln(n))}function Zn(t){return Gn(t)?t[t.length-1]||0:t}const _n=t=>Boolean(t&&t.getVelocity);function Jn(t,e){const n=t.getValue("willChange");if(i=n,Boolean(_n(i)&&i.add))return n.add(e);if(!n&&T.WillChange){const n=new T.WillChange("auto");t.addValue("willChange",n),n.add(e)}var i}function Qn(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const ti="data-"+Qn("framerAppearId");function ei(t){return t.props[ti]}function ni({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}function ii(t,e,{delay:n=0,transitionOverride:i,type:s}={}){let{transition:o,transitionEnd:r,...a}=e;const l=t.getDefaultTransition();o=o?Bn(o,l):l;const h=o?.reduceMotion,u=o?.skipAnimations;i&&(o=i);const c=[],d=s&&t.animationState&&t.animationState.getState()[s],p=o?.path;p&&p.animateVisualElement(t,a,o,n,c);for(const e in a){const i=t.getValue(e,t.latestValues[e]??null),s=a[e];if(void 0===s||d&&ni(d,e))continue;const r={delay:n,...jn(o||{},e)};u&&(r.skipAnimations=!0);const l=i.get();if(void 0!==l&&!i.isAnimating()&&!Array.isArray(s)&&s===l&&!r.velocity){nt.update(()=>i.set(s));continue}let p=!1;if(window.MotionHandoffAnimation){const n=ei(t);if(n){const t=window.MotionHandoffAnimation(n,e,nt);null!==t&&(r.startTime=t,p=!0)}}Jn(t,e);const m=h??t.shouldReduceMotion;i.start(Nn(e,i,s,m&&Kn.has(e)?{type:!1}:r,t,p));const f=i.animation;f&&c.push(f)}if(r){const e=()=>nt.update(()=>{r&&function(t,e){const n=Hn(t,e);let{transitionEnd:i={},transition:s={},...o}=n||{};o={...o,...i};for(const e in o)qn(t,e,Zn(o[e]))}(t,r)});c.length?Promise.all(c).then(e):e()}return c}function si(t,e,n={}){const i=Hn(t,e,"exit"===n.type?t.presenceContext?.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const o=i?()=>Promise.all(ii(t,i,n)):()=>Promise.resolve(),r=t.variantChildren&&t.variantChildren.size?(i=0)=>{const{delayChildren:o=0,staggerChildren:r,staggerDirection:a}=s;return function(t,e,n=0,i=0,s=0,o=1,r){const a=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),a.push(si(l,e,{...r,delay:n+("function"==typeof i?0:i)+Dn(t.variantChildren,l,i,s,o)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(a)}(t,e,i,o,r,a,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[t,e]="beforeChildren"===a?[o,r]:[r,o];return t().then(()=>e())}return Promise.all([o(),r(n.delay)])}const oi=t=>e=>e.test(t),ri=[ft,Ct,Vt,Mt,Dt,kt,{test:t=>"auto"===t,parse:t=>t}],ai=t=>ri.find(oi(t));function li(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||b(t))}const hi=new Set(["brightness","contrast","saturate","opacity"]);function ui(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(xt)||[];if(!i)return t;const s=n.replace(i,"");let o=hi.has(e)?1:0;return i!==n&&(o*=100),e+"("+o+s+")"}const ci=/\b([a-z-]*)\(.*?\)/gu,di={...$t,getAnimatableNone:t=>{const e=t.match(ci);return e?e.map(ui).join(" "):t}},pi={...$t,getAnimatableNone:t=>{const e=$t.parse(t);return $t.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},mi={...ft,transform:Math.round},fi={borderWidth:Ct,borderTopWidth:Ct,borderRightWidth:Ct,borderBottomWidth:Ct,borderLeftWidth:Ct,borderRadius:Ct,borderTopLeftRadius:Ct,borderTopRightRadius:Ct,borderBottomRightRadius:Ct,borderBottomLeftRadius:Ct,width:Ct,maxWidth:Ct,height:Ct,maxHeight:Ct,top:Ct,right:Ct,bottom:Ct,left:Ct,inset:Ct,insetBlock:Ct,insetBlockStart:Ct,insetBlockEnd:Ct,insetInline:Ct,insetInlineStart:Ct,insetInlineEnd:Ct,padding:Ct,paddingTop:Ct,paddingRight:Ct,paddingBottom:Ct,paddingLeft:Ct,paddingBlock:Ct,paddingBlockStart:Ct,paddingBlockEnd:Ct,paddingInline:Ct,paddingInlineStart:Ct,paddingInlineEnd:Ct,margin:Ct,marginTop:Ct,marginRight:Ct,marginBottom:Ct,marginLeft:Ct,marginBlock:Ct,marginBlockStart:Ct,marginBlockEnd:Ct,marginInline:Ct,marginInlineStart:Ct,marginInlineEnd:Ct,fontSize:Ct,backgroundPositionX:Ct,backgroundPositionY:Ct,...{rotate:Mt,pathRotation:Mt,rotateX:Mt,rotateY:Mt,rotateZ:Mt,scale:gt,scaleX:gt,scaleY:gt,scaleZ:gt,skew:Mt,skewX:Mt,skewY:Mt,distance:Ct,translateX:Ct,translateY:Ct,translateZ:Ct,x:Ct,y:Ct,z:Ct,perspective:Ct,transformPerspective:Ct,opacity:yt,originX:Rt,originY:Rt,originZ:Ct},zIndex:mi,fillOpacity:yt,strokeOpacity:yt,numOctaves:mi},yi={...fi,color:Bt,backgroundColor:Bt,outlineColor:Bt,fill:Bt,stroke:Bt,borderColor:Bt,borderTopColor:Bt,borderRightColor:Bt,borderBottomColor:Bt,borderLeftColor:Bt,filter:di,WebkitFilter:di,mask:pi,WebkitMask:pi},gi=t=>yi[t],vi=new Set([di,pi]);function xi(t,e){let n=gi(t);return vi.has(n)||(n=$t),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const wi=new Set(["auto","none","0"]);class Ti extends ln{constructor(t,e,n,i,s){super(t,e,n,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n{t.getValue(e).set(n)}),this.resolveNoneKeyframes()}}const Si=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function Pi(t,e,n){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){let e=document;const i=n?.[t]??e.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t).filter(t=>null!=t)}const bi=(t,e)=>e&&"number"==typeof t?e.transform(t):t;const{schedule:Ei}=et(queueMicrotask,!1),Ai={x:!1,y:!1};function Mi(){return Ai.x||Ai.y}function Vi(t,e){const n=Pi(t),i=new AbortController;return[n,{passive:!0,...e,signal:i.signal},()=>i.abort()]}function Ci(t,e,n={}){const[i,s,o]=Vi(t,n);return i.forEach(t=>{let n,i=!1,o=!1;const r=e=>{n&&(n(e),n=void 0),t.removeEventListener("pointerleave",l)},a=t=>{i=!1,window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",a),o&&(o=!1,r(t))},l=t=>{"touch"!==t.pointerType&&(i?o=!0:r(t))};t.addEventListener("pointerenter",i=>{if("touch"===i.pointerType||Mi())return;o=!1;const r=e(t,i);"function"==typeof r&&(n=r,t.addEventListener("pointerleave",l,s))},s),t.addEventListener("pointerdown",()=>{i=!0,window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",a,s)},s)}),o}const ki=(t,e)=>!!e&&(t===e||ki(t,e.parentElement)),Di=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,Ri=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const Li=new Set(["INPUT","SELECT","TEXTAREA"]);const Bi=new WeakSet;function ji(t){return e=>{"Enter"===e.key&&t(e)}}function Fi(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function Ii(t){return Di(t)&&!Mi()}const Oi=new WeakSet;function Ui(t,e,n={}){const[i,s,o]=Vi(t,n),r=t=>{const i=t.currentTarget;if(!Ii(t))return;if(Oi.has(t))return;Bi.add(i),n.stopPropagation&&Oi.add(t);const o=e(i,t),r={...s,capture:!0},a=(t,e)=>{window.removeEventListener("pointerup",l,r),window.removeEventListener("pointercancel",h,r),Bi.has(i)&&Bi.delete(i),Ii(t)&&"function"==typeof o&&o(t,{success:e})},l=t=>{a(t,i===window||i===document||n.useGlobalTarget||ki(i,t.target))},h=t=>{a(t,!1)};window.addEventListener("pointerup",l,r),window.addEventListener("pointercancel",h,r)};return i.forEach(t=>{var e;(n.useGlobalTarget?window:t).addEventListener("pointerdown",r,s),P(e=t)&&"offsetHeight"in e&&!("ownerSVGElement"in e)&&(t.addEventListener("focus",t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const i=ji(()=>{if(Bi.has(n))return;Fi(n,"down");const t=ji(()=>{Fi(n,"up")});n.addEventListener("keyup",t,e),n.addEventListener("blur",()=>Fi(n,"cancel"),e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)})(t,s)),function(t){return Ri.has(t.tagName)||!0===t.isContentEditable}(t)||t.hasAttribute("tabindex")||(t.tabIndex=0))}),o}function Wi(t){return P(t)&&"ownerSVGElement"in t}const Ni=new WeakMap;let $i;const zi=(t,e,n)=>(i,s)=>s&&s[0]?s[0][t+"Size"]:Wi(i)&&"getBBox"in i?i.getBBox()[e]:i[n],Yi=zi("inline","width","offsetWidth"),Xi=zi("block","height","offsetHeight");function Hi({target:t,borderBoxSize:e}){Ni.get(t)?.forEach(n=>{n(t,{get width(){return Yi(t,e)},get height(){return Xi(t,e)}})})}function Ki(t){t.forEach(Hi)}function Gi(t,e){$i||"undefined"!=typeof ResizeObserver&&($i=new ResizeObserver(Ki));const n=Pi(t);return n.forEach(t=>{let n=Ni.get(t);n||(n=new Set,Ni.set(t,n)),n.add(e),$i?.observe(t)}),()=>{n.forEach(t=>{const n=Ni.get(t);n?.delete(e),n?.size||$i?.unobserve(t)})}}const qi=new Set;let Zi;function _i(t){return qi.add(t),Zi||(Zi=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};qi.forEach(e=>e(t))},window.addEventListener("resize",Zi)),()=>{qi.delete(t),qi.size||"function"!=typeof Zi||(window.removeEventListener("resize",Zi),Zi=void 0)}}function Ji(t,e){return"function"==typeof t?_i(t):Gi(t,e)}const Qi=[...ri,Bt,$t],ts=()=>({x:{min:0,max:0},y:{min:0,max:0}}),es=new WeakMap;function ns(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function is(t){return"string"==typeof t||Array.isArray(t)}const ss=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],os=["initial",...ss];function rs(t){return ns(t.animate)||os.some(e=>is(t[e]))}function as(t){return Boolean(rs(t)||t.variants)}const ls={current:null},hs={current:!1},us="undefined"!=typeof window;const cs=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let ds={};function ps(t){ds=t}class ms{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:i,skipAnimations:s,blockInitialAnimation:o,visualState:r},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=ln,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const t=lt.now();this.renderScheduledAtthis.bindToMotionValue(e,t)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(hs.current||function(){if(hs.current=!0,us)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>ls.current=t.matches;t.addEventListener("change",e),e()}else ls.current=!1}(),this.shouldReduceMotion=ls.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),it(this.notifyUpdate),it(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,e){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),e.accelerate&&En.has(t)&&this.current instanceof HTMLElement){const{factory:n,keyframes:i,times:s,ease:o,duration:r}=e.accelerate,a=new xn({element:this.current,name:t,keyframes:i,times:s,ease:o,duration:k(r)}),l=n(a);return void this.valueSubscriptions.set(t,()=>{l(),a.cancel()})}const n=Ze.has(t);n&&this.onBindTransform&&this.onBindTransform();const i=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&nt.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let s;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{i(),s&&s()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in ds){const e=ds[t];if(!e)continue;const{isEnabled:n,Feature:i}=e;if(!this.features[t]&&i&&n(this.props)&&(this.features[t]=new i(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;ee.variantChildren.delete(t)}addValue(t,e){const n=this.values.get(t);e!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=Ln(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,e){let n=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var i;return null!=n&&("string"==typeof n&&(S(n)||b(n))?n=parseFloat(n):(i=n,!Qi.find(oi(i))&&$t.test(e)&&(n=xi(t,e))),this.setBaseTarget(t,_n(n)?n.get():n)),_n(n)?n.get():n}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let n;if("string"==typeof e||"object"==typeof e){const i=Xn(this.props,e,this.presenceContext?.custom);i&&(n=i[t])}if(e&&void 0!==n)return n;const i=this.getBaseTargetFromProps(this.props,t);return void 0===i||_n(i)?void 0!==this.initialValues[t]&&void 0===n?void 0:this.baseTarget[t]:i}on(t,e){return this.events[t]||(this.events[t]=new C),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){Ei.render(this.render)}}class fs extends ms{constructor(){super(...arguments),this.KeyframeResolver=Ti}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){const n=t.style;return n?n[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;_n(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}class ys{constructor(t){this.isMounted=!1,this.node=t}update(){}}function gs({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function vs(t){return void 0===t||1===t}function xs({scale:t,scaleX:e,scaleY:n}){return!vs(t)||!vs(e)||!vs(n)}function ws(t){return xs(t)||Ts(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Ts(t){return Ss(t.x)||Ss(t.y)}function Ss(t){return t&&"0%"!==t}function Ps(t,e,n){return n+e*(t-n)}function bs(t,e,n,i,s){return void 0!==s&&(t=Ps(t,s,i)),Ps(t,n,i)+e}function Es(t,e=0,n=1,i,s){t.min=bs(t.min,e,n,i,s),t.max=bs(t.max,e,n,i,s)}function As(t,{x:e,y:n}){Es(t.x,e.translate,e.scale,e.originPoint),Es(t.y,n.translate,n.scale,n.originPoint)}const Ms=.999999999999,Vs=1.0000000000001;function Cs(t,e){t.min+=e,t.max+=e}function ks(t,e,n,i,s=.5){Es(t,e,n,Xt(t.min,t.max,s),i)}function Ds(t,e){return"string"==typeof t?parseFloat(t)/100*(e.max-e.min):t}function Rs(t,e,n){const i=n??t;ks(t.x,Ds(e.x,i.x),e.scaleX,e.scale,e.originX),ks(t.y,Ds(e.y,i.y),e.scaleY,e.scale,e.originY)}function Ls(t,e){return gs(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),i=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}(t.getBoundingClientRect(),e))}const Bs={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},js=qe.length;function Fs(t,e,n){const{style:i,vars:s,transformOrigin:o}=t;let r=!1,a=!1;for(const t in e){const n=e[t];if(Ze.has(t))r=!0;else if(ut(t))s[t]=n;else{const e=bi(n,fi[t]);t.startsWith("origin")?(a=!0,o[t]=e):i[t]=e}}if(e.transform||(r||n?i.transform=function(t,e,n){let i="",s=!0;for(let o=0;o{if(!e.target)return t;if("string"==typeof t){if(!Ct.test(t))return t;t=parseFloat(t)}return`${Os(t,e.target.x)}% ${Os(t,e.target.y)}%`}},Ws={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,s=$t.parse(t);if(s.length>5)return i;const o=$t.createTransformer(t),r="number"!=typeof s[0]?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;s[0+r]/=a,s[1+r]/=l;const h=Xt(a,l,.5);return"number"==typeof s[2+r]&&(s[2+r]/=h),"number"==typeof s[3+r]&&(s[3+r]/=h),o(s)}},Ns={borderRadius:{...Us,applyTo:[...Si]},borderTopLeftRadius:Us,borderTopRightRadius:Us,borderBottomLeftRadius:Us,borderBottomRightRadius:Us,boxShadow:Ws};function $s(t,{layout:e,layoutId:n}){return Ze.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!Ns[t]||"opacity"===t)}function zs(t,e,n){const i=t.style,s=e?.style,o={};if(!i)return o;for(const e in i)(_n(i[e])||s&&_n(s[e])||$s(e,t)||void 0!==n?.getValue(e)?.liveStyle)&&(o[e]=i[e]);return o}class Ys extends fs{constructor(){super(...arguments),this.type="html",this.renderInstance=Is}mount(t){w(Boolean(t.style),"motion.create() components must forward their ref to a HTML or SVG element","custom-component-ref"),super.mount(t)}readValueFromInstance(t,e){if(Ze.has(e))return this.projection?.isProjecting?He(e):((t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Ke(n,e)})(t,e);{const i=(n=t,window.getComputedStyle(n)),s=(ut(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof s?s.trim():s}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return Ls(t,e)}build(t,e,n){Fs(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return zs(t,e,n)}}const Xs={offset:"stroke-dashoffset",array:"stroke-dasharray"},Hs={offset:"strokeDashoffset",array:"strokeDasharray"};const Ks=["transform","opacity","offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Gs(t,{attrX:e,attrY:n,attrScale:i,pathLength:s,pathSpacing:o=1,pathOffset:r=0,...a},l,h,u){if(Fs(t,a,h),l)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:c,style:d}=t;for(const t of Ks)void 0!==c[t]&&(d[t]=c[t],delete c[t]);(d.transform||c.transformOrigin)&&(d.transformOrigin=c.transformOrigin??"50% 50%",delete c.transformOrigin),d.transform&&(d.transformBox=u?.transformBox??"fill-box",delete c.transformBox),void 0!==e&&(c.x=e),void 0!==n&&(c.y=n),void 0!==i&&(c.scale=i),void 0!==s&&function(t,e,n=1,i=0,s=!0){t.pathLength=1;const o=s?Xs:Hs;t[o.offset]=""+-i,t[o.array]=`${e} ${n}`}(c,s,o,r,!1)}const qs=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),Zs=t=>"string"==typeof t&&"svg"===t.toLowerCase();function _s(t,e,n){const i=zs(t,e,n);for(const n in t)if(_n(t[n])||_n(e[n])){i[-1!==qe.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]}return i}class Js extends fs{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ts}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(Ze.has(e)){const t=gi(e);return t&&t.default||0}if(Ks.includes(e)){const n=getComputedStyle(t)[e];if("string"==typeof n&&n)return n.trim()}return e=qs.has(e)?e:Qn(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return _s(t,e,n)}build(t,e,n){Gs(t,e,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,e,n,i){!function(t,e,n,i){Is(t,e,void 0,i);for(const n in e.attrs)t.setAttribute(qs.has(n)?n:Qn(n),e.attrs[n])}(t,e,0,i)}mount(t){this.isSVGTag=Zs(t.tagName),super.mount(t)}}const Qs=os.length;function to(t){if(!t)return;if(!t.isControllingVariants){const e=t.parent&&to(t.parent)||{};return void 0!==t.props.initial&&(e.initial=t.props.initial),e}const e={};for(let n=0;nPromise.all(e.map(({animation:e,options:n})=>function(t,e,n={}){let i;if(t.notify("AnimationStart",e),Array.isArray(e)){const s=e.map(e=>si(t,e,n));i=Promise.all(s)}else if("string"==typeof e)i=si(t,e,n);else{const s="function"==typeof e?Hn(t,e,n.custom):e;i=Promise.all(ii(t,s,n))}return i.then(()=>{t.notify("AnimationComplete",e)})}(t,e,n)))}function oo(t){let e=so(t),n=lo(),i=!0,s=!1;const o=e=>(n,i)=>{const s=Hn(t,i,"exit"===e?t.presenceContext?.custom:void 0);if(s){const{transition:t,transitionEnd:e,...i}=s;n={...n,...i,...e}}return n};function r(r){const{props:a}=t,l=to(t.parent)||{},h=[],u=new Set;let c={},d=1/0;for(let e=0;ed&&y,T=!1;const S=Array.isArray(f)?f:[f];let P=S.reduce(o(p),{});!1===g&&(P={});const{prevResolvedValues:b={}}=m,E={...b,...P},A=e=>{w=!0,u.has(e)&&(T=!0,u.delete(e)),m.needsAnimating[e]=!0;const n=t.getValue(e);n&&(n.liveStyle=!1)};for(const t in E){const e=P[t],n=b[t];if(c.hasOwnProperty(t))continue;let i=!1;i=Gn(e)&&Gn(n)?!eo(e,n)||x:e!==n,i?null!=e?A(t):u.add(t):void 0!==e&&u.has(t)?A(t):m.protectedKeys[t]=!0}m.prevProp=f,m.prevResolvedValues=P,m.isActive&&(c={...c,...P}),(i||s)&&t.blockInitialAnimation&&(w=!1);const M=v&&x;w&&(!M||T)&&h.push(...S.map(e=>{const n={type:p};if("string"==typeof e&&(i||s)&&!M&&t.manuallyAnimateOnMount&&t.parent){const{parent:i}=t,s=Hn(i,e);if(i.enteringChildren&&s){const{delayChildren:e}=s.transition||{};n.delay=Dn(i.enteringChildren,t,e)}}return{animation:e,options:n}}))}if(u.size){const e={};if("boolean"!=typeof a.initial){const n=Hn(t,Array.isArray(a.initial)?a.initial[0]:a.initial);n&&n.transition&&(e.transition=n.transition)}u.forEach(n=>{const i=t.getBaseTarget(n),s=t.getValue(n);s&&(s.liveStyle=!0),e[n]=i??null}),h.push({animation:e})}let p=Boolean(h.length);return!i||!1!==a.initial&&a.initial!==a.animate||t.manuallyAnimateOnMount||(p=!1),i=!1,s=!1,p?e(h):Promise.resolve()}return{animateChanges:r,setActive:function(e,i){if(n[e].isActive===i)return Promise.resolve();t.variantChildren?.forEach(t=>t.animationState?.setActive(e,i)),n[e].isActive=i;const s=r(e);for(const t in n)n[t].protectedKeys={};return s},setAnimateFunction:function(n){e=n(t)},getState:()=>n,reset:()=>{n=lo(),s=!0}}}function ro(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!eo(e,t)}function ao(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function lo(){return{animate:ao(!0),whileInView:ao(),whileHover:ao(),whileTap:ao(),whileDrag:ao(),whileFocus:ao(),exit:ao()}}function ho(t,e){t.min=e.min,t.max=e.max}function uo(t,e){ho(t.x,e.x),ho(t.y,e.y)}function co(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function po(t){return t.max-t.min}function mo(t,e,n,i=.5){t.origin=i,t.originPoint=Xt(e.min,e.max,t.origin),t.scale=po(n)/po(e),t.translate=Xt(n.min,n.max,t.origin)-t.originPoint,(t.scale>=.9999&&t.scale<=1.0001||isNaN(t.scale))&&(t.scale=1),(t.translate>=-.01&&t.translate<=.01||isNaN(t.translate))&&(t.translate=0)}function fo(t,e,n,i){mo(t.x,e.x,n.x,i?i.originX:void 0),mo(t.y,e.y,n.y,i?i.originY:void 0)}function yo(t,e,n,i=0){const s=i?Xt(n.min,n.max,i):n.min;t.min=s+e.min,t.max=t.min+po(e)}function go(t,e,n,i=0){const s=i?Xt(n.min,n.max,i):n.min;t.min=e.min-s,t.max=t.min+po(e)}function vo(t,e,n,i){go(t.x,e.x,n.x,i?.x),go(t.y,e.y,n.y,i?.y)}function xo(t,e,n,i,s){return t=Ps(t-=e,1/n,i),void 0!==s&&(t=Ps(t,1/s,i)),t}function wo(t,e,[n,i,s],o,r){!function(t,e=0,n=1,i=.5,s,o=t,r=t){Vt.test(e)&&(e=parseFloat(e),e=Xt(r.min,r.max,e/100)-r.min);if("number"!=typeof e)return;let a=Xt(o.min,o.max,i);t===o&&(a-=e),t.min=xo(t.min,e,n,a,s),t.max=xo(t.max,e,n,a,s)}(t,e[n],e[i],e[s],e.scale,o,r)}const To=["x","scaleX","originX"],So=["y","scaleY","originY"];function Po(t,e,n,i){wo(t.x,e,To,n?n.x:void 0,i?i.x:void 0),wo(t.y,e,So,n?n.y:void 0,i?i.y:void 0)}function bo(t){return 0===t.translate&&1===t.scale}function Eo(t){return bo(t.x)&&bo(t.y)}function Ao(t,e){return t.min===e.min&&t.max===e.max}function Mo(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Vo(t,e){return Mo(t.x,e.x)&&Mo(t.y,e.y)}function Co(t){return po(t.x)/po(t.y)}function ko(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function Do(t){return[t("x"),t("y")]}const Ro=Si.length,Lo=t=>"string"==typeof t?parseFloat(t):t,Bo=t=>"number"==typeof t||Ct.test(t);function jo(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const Fo=Oo(0,.5,$),Io=Oo(.5,.95,A);function Oo(t,e,n){return i=>ie?1:n(V(t,e,i))}function Uo(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n,i)}const Wo=(t,e)=>t.depth-e.depth;class No{constructor(){this.children=[],this.isDirty=!1}add(t){f(this.children,t),this.isDirty=!0}remove(t){y(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Wo),this.isDirty=!1,this.children.forEach(t)}}function $o(t){return _n(t)?t.get():t}class zo{constructor(){this.members=[]}add(t){f(this.members,t);for(let e=this.members.length-1;e>=0;e--){const n=this.members[e];if(n===t||n===this.lead||n===this.prevLead)continue;const i=n.instance;i&&!1!==i.isConnected||n.snapshot||(y(this.members,n),n.unmount())}t.scheduleRender()}remove(t){if(y(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){for(let e=this.members.indexOf(t)-1;e>=0;e--){const t=this.members[e];if(!1!==t.isPresent&&!1!==t.instance?.isConnected)return this.promote(t),!0}return!1}promote(t,e){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.updateSnapshot(),t.scheduleRender();const{layoutDependency:i}=n.options,{layoutDependency:s}=t.options;void 0!==i&&i===s||(t.resumeFrom=n,e&&(n.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root?.isUpdating&&(t.isLayoutDirty=!0)),!1===t.options.crossfade&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{t.options.onExitComplete?.(),t.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}const Yo={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Xo=["","X","Y","Z"];let Ho=0;function Ko(t,e,n,i){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),i&&(i[t]=0))}function Go(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=ei(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:e,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",nt,!(e||i))}const{parent:i}=t;i&&!i.hasCheckedOptimisedAppear&&Go(i)}function qo({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:i,resetTransform:s}){return class{constructor(t={},n=e?.()){this.id=Ho++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(Jo),this.nodes.forEach(ar),this.nodes.forEach(lr),this.nodes.forEach(Qo)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=t,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let t=0;tthis.root.updateBlockedByResize=!1;nt.read(()=>{i=window.innerWidth}),t(e,()=>{const t=window.innerWidth;t!==i&&(i=t,this.root.updateBlockedByResize=!0,n&&n(),n=function(t,e){const n=lt.now(),i=({timestamp:s})=>{const o=s-n;o>=e&&(it(i),t(o-e))};return nt.setup(i,!0),()=>it(i)}(s,250),Yo.hasAnimatedSinceResize&&(Yo.hasAnimatedSinceResize=!1,this.nodes.forEach(rr)))})}i&&this.root.registerSharedNode(i,this),!1!==this.options.animate&&o&&(i||s)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeLayoutChanged:n,layout:i})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const s=this.options.transition||o.getDefaultTransition()||mr,{onLayoutAnimationStart:r,onLayoutAnimationComplete:a}=o.getProps(),l=!this.targetLayout||!Vo(this.targetLayout,i),h=!e&&n;if(this.options.layoutRoot||this.resumeFrom||h||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const e={...jn(s,"layout"),onPlay:r,onComplete:a};(o.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e),this.setAnimationOrigin(t,h,e.path)}else e||rr(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=i})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const t=this.getStack();t&&t.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),it(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(hr),this.animationId++)}getTransformTemplate(){const{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Go(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||po(this.snapshot.measuredBox.x)||po(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;tMs&&(e.x=1),e.yMs&&(e.y=1)}(this.layoutCorrected,this.treeScale,this.path,e),!t.layout||t.target||1===this.treeScale.x&&1===this.treeScale.y||(t.target=t.layout.layoutBox,t.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}});const{target:a}=t;a?(this.projectionDelta&&this.prevProjectionDelta?(co(this.prevProjectionDelta.x,this.projectionDelta.x),co(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),fo(this.projectionDelta,this.layoutCorrected,a,this.latestValues),this.treeScale.x===o&&this.treeScale.y===r&&ko(this.projectionDelta.x,this.prevProjectionDelta.x)&&ko(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",a))):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){if(this.options.visualElement?.scheduleRender(),t){const t=this.getStack();t&&t.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}}setAnimationOrigin(t,e=!1,n){const i=this.snapshot,s=i?i.latestValues:{},o={...this.latestValues},r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!e;const a={x:{min:0,max:0},y:{min:0,max:0}},l=(i?i.source:void 0)!==(this.layout?this.layout.source:void 0),h=this.getStack(),u=!h||h.members.length<=1,c=Boolean(l&&!u&&!0===this.options.crossfade&&!this.path.some(pr));let d;this.animationProgress=0;const p=n?.interpolateProjection(t);this.mixTargetDelta=e=>{const n=e/1e3,i=p?.(n);var h,m,f,y,g,v;i?(r.x.translate=i.x,r.x.scale=Xt(t.x.scale,1,n),r.x.origin=t.x.origin,r.x.originPoint=t.x.originPoint,r.y.translate=i.y,r.y.scale=Xt(t.y.scale,1,n),r.y.origin=t.y.origin,r.y.originPoint=t.y.originPoint):(cr(r.x,t.x,n),cr(r.y,t.y,n)),this.setTargetDelta(r),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(vo(a,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),f=this.relativeTarget,y=this.relativeTargetOrigin,g=a,v=n,dr(f.x,y.x,g.x,v),dr(f.y,y.y,g.y,v),d&&(h=this.relativeTarget,m=d,Ao(h.x,m.x)&&Ao(h.y,m.y))&&(this.isProjectionDirty=!1),d||(d={x:{min:0,max:0},y:{min:0,max:0}}),uo(d,this.relativeTarget)),l&&(this.animationValues=o,function(t,e,n,i,s,o){s?(t.opacity=Xt(0,n.opacity??1,Fo(i)),t.opacityExit=Xt(e.opacity??1,0,Io(i))):o&&(t.opacity=Xt(e.opacity??1,n.opacity??1,i));for(let s=0;s{Yo.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Ln(0)),this.motionValue.jump(0,!1),this.currentAnimation=function(t,e,n){const i=_n(t)?t:Ln(t);return i.start(Nn("",i,e,n)),i.animation}(this.motionValue,[0,1e3],{...t,velocity:0,isSync:!0,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onComplete:()=>{t.onComplete&&t.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const t=this.getStack();t&&t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead();let{targetWithTransforms:e,target:n,layout:i,latestValues:s}=t;if(e&&n&&i){if(this!==t&&this.layout&&i&&vr(this.options.animationType,this.layout.layoutBox,i.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=po(this.layout.layoutBox.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const i=po(this.layout.layoutBox.y);n.y.min=t.target.y.min,n.y.max=n.y.min+i}uo(e,n),Rs(e,s),fo(this.projectionDeltaWithTransform,this.layoutCorrected,e,s)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new zo);this.sharedNodes.get(t).add(e);const n=e.options.initialPromotionConfig;e.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(e):void 0})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){const{layoutId:t}=this.options;return t&&this.getStack()?.lead||this}getPrevLead(){const{layoutId:t}=this.options;return t?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:n}={}){const i=this.getStack();i&&i.promote(this,n),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetSkewAndRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const{latestValues:n}=t;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(e=!0),!e)return;const i={};n.z&&Ko("z",t,i,this.animationValues);for(let e=0;et.currentAnimation?.stop()),this.root.nodes.forEach(er),this.root.sharedNodes.clear()}}}function Zo(t){t.updateLayout()}function _o(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=t.layout,{animationType:s}=t.options,o=e.source!==t.layout.source;if("size"===s)Do(t=>{const i=o?e.measuredBox[t]:e.layoutBox[t],s=po(i);i.min=n[t].min,i.max=i.min+s});else if("x"===s||"y"===s){const t="x"===s?"y":"x";ho(o?e.measuredBox[t]:e.layoutBox[t],n[t])}else vr(s,e.layoutBox,n)&&Do(i=>{const s=o?e.measuredBox[i]:e.layoutBox[i],r=po(n[i]);s.max=s.min+r,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[i].max=t.relativeTarget[i].min+r)});const r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};fo(r,n,e.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};o?fo(a,t.applyTransform(i,!0),e.measuredBox):fo(a,n,e.layoutBox);const l=!Eo(r);let h=!1;if(!t.resumeFrom){const i=t.getClosestProjectingParent();if(i&&!i.resumeFrom){const{snapshot:s,layout:o}=i;if(s&&o){const r=t.options.layoutAnchor||void 0,a={x:{min:0,max:0},y:{min:0,max:0}};vo(a,e.layoutBox,s.layoutBox,r);const l={x:{min:0,max:0},y:{min:0,max:0}};vo(l,n,o.layoutBox,r),Vo(a,l)||(h=!0),i.options.layoutRoot&&(t.relativeTarget=l,t.relativeTargetOrigin=a,t.relativeParent=i)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:a,layoutDelta:r,hasLayoutChanged:l,hasRelativeLayoutChanged:h})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function Jo(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=Boolean(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function Qo(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function tr(t){t.clearSnapshot()}function er(t){t.clearMeasurements()}function nr(t){t.isLayoutDirty=!0,t.updateLayout()}function ir(t){t.isLayoutDirty=!1}function sr(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function or(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function rr(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function ar(t){t.resolveTargetDelta()}function lr(t){t.calcProjection()}function hr(t){t.resetSkewAndRotation()}function ur(t){t.removeLeadSnapshot()}function cr(t,e,n){t.translate=Xt(e.translate,0,n),t.scale=Xt(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function dr(t,e,n,i){t.min=Xt(e.min,n.min,i),t.max=Xt(e.max,n.max,i)}function pr(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const mr={duration:.45,ease:[.4,0,.1,1]},fr=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),yr=fr("applewebkit/")&&!fr("chrome/")?Math.round:A;function gr(t){t.min=yr(t.min),t.max=yr(t.max)}function vr(t,e,n){return"position"===t||"preserve-aspect"===t&&(i=Co(e),s=Co(n),o=.2,!(Math.abs(i-s)<=o));var i,s,o}function xr(t){return t!==t.root&&t.scroll?.wasRoot}const wr=qo({attachResizeListener:(t,e)=>Uo(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Tr={current:void 0},Sr=qo({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Tr.current){const t=new wr({});t.mount(window),t.setOptions({layoutScroll:!0}),Tr.current=t}return Tr.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)});function Pr(t){const{initial:e,animate:n}=function(t,e){if(rs(t)){const{initial:e,animate:n}=t;return{initial:!1===e||is(e)?e:void 0,animate:is(n)?n:void 0}}return!1!==t.inherit?e:{}}(t,i(Q));return s(()=>({initial:e,animate:n}),[br(e),br(n)])}function br(t){return Array.isArray(t)?t.join(" "):t}const Er=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Ar(t,e,n){for(const i in e)_n(e[i])||$s(i,n)||(t[i]=e[i])}function Mr(t,e){const n={};return Ar(n,t.style||{},t),Object.assign(n,function({transformTemplate:t},e){return s(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{}};return Fs(n,e,t),Object.assign({},n.vars,n.style)},[e])}(t,e)),n}function Vr(t,e){const n={},i=Mr(t,e);return t.drag&&!1!==t.dragListener&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),void 0===t.tabIndex&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=i,n}const Cr=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}});function kr(t,e,n,i){const o=s(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return Gs(n,e,Zs(i),t.transformTemplate,t.style),{...n.attrs,style:{...n.style}}},[e]);if(t.style){const e={};Ar(e,t.style,t),o.style={...e,...o.style}}return o}const Dr=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function Rr(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Dr.has(t)}function Lr(t,e){return t.startsWith("on")?!Rr(t):e?.(t)??!Rr(t)}const Br=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function jr(t){return"string"==typeof t&&!t.includes("-")&&!!(Br.indexOf(t)>-1||/[A-Z]/u.test(t))}function Fr(t,e,n,{latestValues:i},a,l=!1,h,u){const c=(h??jr(t)?kr:Vr)(e,i,a,t),d=function(t,e,n,i){const s={};for(const o in t)"values"===o&&"object"==typeof t.values||_n(t[o])||(Lr(o,i)||!0===n&&Rr(o)||!e&&!Rr(o)||t.draggable&&o.startsWith("onDrag"))&&(s[o]=t[o]);return s}(e,"string"==typeof t,l,u),p=t!==o?{...d,...c,ref:n}:{},{children:m}=e,f=s(()=>_n(m)?m.get():m,[m]);return r(t,{...p,children:f})}const Ir=n(null);function Or(t,e,n,i){const s={},o=i(t,{});for(const t in o)s[t]=$o(o[t]);let{initial:r,animate:a}=t;const l=rs(t),h=as(t);e&&h&&!l&&!1!==t.inherit&&(void 0===r&&(r=e.initial),void 0===a&&(a=e.animate));let u=!!n&&!1===n.initial;u=u||!1===r;const c=u?a:r;if(c&&"boolean"!=typeof c&&!ns(c)){const e=Array.isArray(c)?c:[c];for(let n=0;n(e,n)=>{const s=i(Q),o=i(Ir),r=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e},n,i,s){return{latestValues:Or(n,i,s,t),renderState:e()}}(t,e,s,o);return n?r():function(t){const e=a(null);return null===e.current&&(e.current=t()),e.current}(r)},Wr=Ur({scrapeMotionValuesFromProps:zs,createRenderState:Er}),Nr=Ur({scrapeMotionValuesFromProps:_s,createRenderState:Cr}),$r={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let zr=!1;function Yr(){return function(){if(zr)return;const t={};for(const e in $r)t[e]={isEnabled:t=>$r[e].some(e=>!!t[e])};ps(t),zr=!0}(),ds}const Xr=Symbol.for("motionComponentSymbol");function Hr(t,e,n){const i=a(n);l(()=>{i.current=n});const s=a(null);return h(n=>{n&&t.onMount?.(n),e&&(n?e.mount(n):e.unmount());const o=i.current;if("function"==typeof o)if(n){const t=o(n);"function"==typeof t&&(s.current=t)}else s.current?(s.current(),s.current=null):o(n);else o&&(o.current=n)},[e])}const Kr=n({});function Gr(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}const qr="undefined"!=typeof window?u:c;function Zr(t,e,n,s,o,r){const{visualElement:h}=i(Q),u=i(_),d=i(Ir),p=i(J),m=p.reducedMotion,f=p.skipAnimations,y=a(null),g=a(!1);s=s||u.renderer,!y.current&&s&&(y.current=s(t,{visualState:e,parent:h,props:n,presenceContext:d,blockInitialAnimation:!!d&&!1===d.initial,reducedMotionConfig:m,skipAnimations:f,isSVG:r}),g.current&&y.current&&(y.current.manuallyAnimateOnMount=!0));const v=y.current,x=i(Kr);!v||v.projection||!o||"html"!==v.type&&"svg"!==v.type||function(t,e,n,i){const{layoutId:s,layout:o,drag:r,dragConstraints:a,layoutScroll:l,layoutRoot:h,layoutAnchor:u,layoutCrossfade:c}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:_r(t.parent)),t.projection.setOptions({layoutId:s,layout:o,alwaysMeasureLayout:Boolean(r)||a&&Gr(a),visualElement:t,animationType:"string"==typeof o?o:"both",initialPromotionConfig:i,crossfade:c,layoutScroll:l,layoutRoot:h,layoutAnchor:u})}(y.current,n,o,x);const w=a(!1);l(()=>{v&&w.current&&v.update(n,d)});const T=n[ti],S=a(Boolean(T)&&"undefined"!=typeof window&&!window.MotionHandoffIsComplete?.(T)&&window.MotionHasOptimisedAnimation?.(T));return qr(()=>{g.current=!0,v&&(w.current=!0,window.MotionIsMounted=!0,v.updateFeatures(),v.scheduleRenderMicrotask(),S.current&&v.animationState&&v.animationState.animateChanges())}),c(()=>{v&&(!S.current&&v.animationState&&v.animationState.animateChanges(),S.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(T)}),S.current=!1),v.enteringChildren=void 0)}),v}function _r(t){if(t)return!1!==t.options.allowProjection?t.projection:_r(t.parent)}function Jr(n,{forwardMotionProps:s=!1,type:o}={},r,a){r&&function(t){const e=Yr();for(const n in t)e[n]={...e[n],...t[n]};ps(e)}(r);const l=o?"svg"===o:jr(n),h=l?Nr:Wr;function u(o,r){let u;const c={...i(J),...o,layoutId:Qr(o)},{isStatic:d,isValidProp:p}=c,m=Pr(o),f=h(o,d);if(!d&&"undefined"!=typeof window){i(_).strict;const t=function(t){const e=Yr(),{drag:n,layout:i}=e;if(!n&&!i)return{};const s={...n,...i};return{MeasureLayout:n?.isEnabled(t)||i?.isEnabled(t)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}(c);u=t.MeasureLayout,m.visualElement=Zr(n,f,c,a,t.ProjectionNode,l)}return t(Q.Provider,{value:m,children:[u&&m.visualElement?e(u,{visualElement:m.visualElement,...c}):null,Fr(n,o,Hr(f,m.visualElement,r),f,d,s,l,p)]})}u.displayName=`motion.${"string"==typeof n?n:`create(${n.displayName??n.name??""})`}`;const c=d(u);return c[Xr]=n,c}function Qr({layoutId:t}){const e=i(Z).id;return e&&void 0!==t?e+"-"+t:t}const ta=(t,e)=>e.isSVG??jr(t)?new Js(e):new Ys(e,{allowProjection:t!==o});let ea=0;const na={animation:{Feature:class extends ys{constructor(t){super(t),t.animationState||(t.animationState=oo(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();ns(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}},exit:{Feature:class extends ys{constructor(){super(...arguments),this.id=ea++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:e}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===n)return;if(t&&!1===n){if(this.isExitComplete){const{initial:t,custom:e}=this.node.getProps();if("string"==typeof t||"object"==typeof t&&null!==t&&!Array.isArray(t)){const n=Hn(this.node,t,e);if(n){const{transition:t,transitionEnd:e,...i}=n;for(const t in i)this.node.getValue(t)?.jump(i[t])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);return void(this.isExitComplete=!1)}const i=this.node.animationState.setActive("exit",!t);e&&!t&&i.then(()=>{this.isExitComplete=!0,e(this.id)})}mount(){const{register:t,onExitComplete:e}=this.node.presenceContext||{};e&&e(this.id),t&&(this.unmount=t(this.id))}unmount(){}}}};function ia(t){return{point:{x:t.pageX,y:t.pageY}}}function sa(t,e,n,i){return Uo(t,e,(t=>e=>Di(e)&&t(e,ia(e)))(n),i)}const oa=({current:t})=>t?t.ownerDocument.defaultView:null,ra=(t,e)=>Math.abs(t-e);const aa=new Set(["auto","scroll"]);class la{constructor(t,e,{transformPagePoint:n,contextWindow:i=window,dragSnapToOrigin:s=!1,distanceThreshold:o=3,element:r}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=t=>{this.handleScroll(t.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=ha(this.lastRawMoveEventInfo,this.transformPagePoint));const t=ca(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=function(t,e){const n=ra(t.x,e.x),i=ra(t.y,e.y);return Math.sqrt(n**2+i**2)}(t.offset,{x:0,y:0})>=this.distanceThreshold;if(!e&&!n)return;const{point:i}=t,{timestamp:s}=st;this.history.push({...i,timestamp:s});const{onStart:o,onMove:r}=this.handlers;e||(o&&o(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),r&&r(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastRawMoveEventInfo=e,this.lastMoveEventInfo=ha(e,this.transformPagePoint),nt.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();const{onEnd:n,onSessionEnd:i,resumeAnimation:s}=this.handlers;if(!this.dragSnapToOrigin&&this.startEvent||s&&s(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const o=ca("pointercancel"===t.type?this.lastMoveEventInfo:ha(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,o),i&&i(t,o)},!Di(t))return;this.dragSnapToOrigin=s,this.handlers=e,this.transformPagePoint=n,this.distanceThreshold=o,this.contextWindow=i||window;const a=ha(ia(t),this.transformPagePoint),{point:l}=a,{timestamp:h}=st;this.history=[{...l,timestamp:h}];const{onSessionStart:u}=e;u&&u(t,ca(a,this.history));const c={passive:!0,capture:!0};this.removeListeners=M(sa(this.contextWindow,"pointermove",this.handlePointerMove,c),sa(this.contextWindow,"pointerup",this.handlePointerUp,c),sa(this.contextWindow,"pointercancel",this.handlePointerUp,c)),r&&this.startScrollTracking(r)}startScrollTracking(t){let e=t.parentElement;for(;e;){const t=getComputedStyle(e);(aa.has(t.overflowX)||aa.has(t.overflowY))&&this.scrollPositions.set(e,{x:e.scrollLeft,y:e.scrollTop}),e=e.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const e=this.scrollPositions.get(t);if(!e)return;const n=t===window,i=n?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},s=i.x-e.x,o=i.y-e.y;0===s&&0===o||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=s,this.lastMoveEventInfo.point.y+=o):this.history.length>0&&(this.history[0].x-=s,this.history[0].y-=o),this.scrollPositions.set(t,i),nt.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),it(this.updatePoint)}}function ha(t,e){return e?{point:e(t.point)}:t}function ua(t,e){return{x:t.x-e.x,y:t.y-e.y}}function ca({point:t},e){return{point:t,delta:ua(t,pa(e)),offset:ua(t,da(e)),velocity:ma(e,.1)}}function da(t){return t[0]}function pa(t){return t[t.length-1]}function ma(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const s=pa(t);for(;n>=0&&(i=t[n],!(s.timestamp-i.timestamp>k(e)));)n--;if(!i)return{x:0,y:0};i===t[0]&&t.length>2&&s.timestamp-i.timestamp>2*k(e)&&(i=t[1]);const o=D(s.timestamp-i.timestamp);if(0===o)return{x:0,y:0};const r={x:(s.x-i.x)/o,y:(s.y-i.y)/o};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function fa(t,e,n){return{min:void 0!==e?t.min+e:void 0,max:void 0!==n?t.max+n-(t.max-t.min):void 0}}function ya(t,e){let n=e.min-t.min,i=e.max-t.max;return e.max-e.min{e&&this.snapToCursor(ia(t).point),this.stopAnimation()},onStart:(t,e)=>{const{drag:n,dragPropagation:i,onDragStart:s}=this.getProps();if(n&&!i&&(this.openDragLock&&this.openDragLock(),this.openDragLock="x"===(o=n)||"y"===o?Ai[o]?null:(Ai[o]=!0,()=>{Ai[o]=!1}):Ai.x||Ai.y?null:(Ai.x=Ai.y=!0,()=>{Ai.x=Ai.y=!1}),!this.openDragLock))return;var o;this.latestPointerEvent=t,this.latestPanInfo=e,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Do(t=>{let e=this.getAxisMotionValue(t).get()||0;if(Vt.test(e)){const{projection:n}=this.visualElement;if(n&&n.layout){const i=n.layout.layoutBox[t];if(i){e=po(i)*(parseFloat(e)/100)}}}this.originPoint[t]=e}),s&&nt.update(()=>s(t,e),!1,!0),Jn(this.visualElement,"transform");const{animationState:r}=this.visualElement;r&&r.setActive("whileDrag",!0)},onMove:(t,e)=>{this.latestPointerEvent=t,this.latestPanInfo=e;const{dragPropagation:n,dragDirectionLock:i,onDirectionLock:s,onDrag:o}=this.getProps();if(!n&&!this.openDragLock)return;const{offset:r}=e;if(i&&null===this.currentDirection)return this.currentDirection=function(t,e=10){let n=null;Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x");return n}(r),void(null!==this.currentDirection&&s&&s(this.currentDirection));this.updateAxis("x",e.point,r),this.updateAxis("y",e.point,r),this.visualElement.render(),o&&nt.update(()=>o(t,e),!1,!0)},onSessionEnd:(t,e)=>{this.latestPointerEvent=t,this.latestPanInfo=e,this.stop(t,e),this.latestPointerEvent=null,this.latestPanInfo=null},resumeAnimation:()=>{const{dragSnapToOrigin:t}=this.getProps();(t||this.constraints)&&this.startAnimation({x:0,y:0})}},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:s,distanceThreshold:n,contextWindow:oa(this.visualElement),element:this.visualElement.current})}stop(t,e){const n=t||this.latestPointerEvent,i=e||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!i||!n)return;const{velocity:o}=i;this.startAnimation(o);const{onDragEnd:r}=this.getProps();r&&nt.postRender(()=>r(n,i))}cancel(){this.isDragging=!1;const{projection:t,animationState:e}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),e&&e.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,e,n){const{drag:i}=this.getProps();if(!n||!Pa(t,i,this.currentDirection))return;const s=this.getAxisMotionValue(t);let o=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(o=function(t,{min:e,max:n},i){return void 0!==e&&tn&&(t=i?Xt(n,t,i.max):Math.min(t,n)),t}(o,this.constraints[t],this.elastic[t])),s.set(o)}resolveConstraints(){const{dragConstraints:t,dragElastic:e}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,i=this.constraints;t&&Gr(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!n)&&function(t,{top:e,left:n,bottom:i,right:s}){return{x:fa(t.x,n,s),y:fa(t.y,e,i)}}(n.layoutBox,t),this.elastic=function(t=ga){return!1===t?t=0:!0===t&&(t=ga),{x:va(t,"left","right"),y:va(t,"top","bottom")}}(e),i!==this.constraints&&!Gr(t)&&n&&this.constraints&&!this.hasMutatedConstraints&&Do(t=>{!1!==this.constraints&&this.getAxisMotionValue(t)&&(this.constraints[t]=function(t,e){const n={};return void 0!==e.min&&(n.min=e.min-t.min),void 0!==e.max&&(n.max=e.max-t.min),n}(n.layoutBox[t],this.constraints[t]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!t||!Gr(t))return!1;const n=t.current;w(null!==n,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:i}=this.visualElement;if(!i||!i.layout)return!1;i.root&&(i.root.scroll=void 0,i.root.updateScroll());const s=function(t,e,n){const i=Ls(t,n),{scroll:s}=e;return s&&(Cs(i.x,s.offset.x),Cs(i.y,s.offset.y)),i}(n,i.root,this.visualElement.getTransformPagePoint());let o=function(t,e){return{x:ya(t.x,e.x),y:ya(t.y,e.y)}}(i.layout.layoutBox,s);if(e){const t=e(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(o));this.hasMutatedConstraints=!!t,t&&(o=gs(t))}return o}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:r}=this.getProps(),a=this.constraints||{},l=Do(r=>{if(!Pa(r,e,this.currentDirection))return;let l=a&&a[r]||{};!0!==o&&o!==r||(l={min:0,max:0});const h=i?200:1e6,u=i?40:1e7,c={type:"inertia",velocity:n?t[r]:0,bounceStiffness:h,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...s,...l};return this.startAxisValueAnimation(r,c)});return Promise.all(l).then(r)}startAxisValueAnimation(t,e){const n=this.getAxisMotionValue(t);return Jn(this.visualElement,t),n.start(Nn(t,n,0,e,this.visualElement,!1))}stopAnimation(){Do(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const e=`_drag${t.toUpperCase()}`,n=this.visualElement.getProps()[e];return n||this.visualElement.getValue(t,this.visualElement.latestValues[t]??0)}snapToCursor(t){Do(e=>{const{drag:n}=this.getProps();if(!Pa(e,n,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(e);if(i&&i.layout){const{min:n,max:o}=i.layout.layoutBox[e],r=s.get()||0;s.set(t[e]-Xt(n,o,.5)+r)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:e}=this.getProps(),{projection:n}=this.visualElement;if(!Gr(e)||!n||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Do(t=>{const e=this.getAxisMotionValue(t);if(e&&!1!==this.constraints){const n=e.get();i[t]=function(t,e){let n=.5;const i=po(t),s=po(e);return s>i?n=V(e.min,e.max-i,t.min):i>s&&(n=V(t.min,t.max-s,e.min)),g(0,1,n)}({min:n,max:n},this.constraints[t])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),Do(e=>{if(!Pa(e,t,null))return;const n=this.getAxisMotionValue(e),{min:s,max:o}=this.constraints[e];n.set(Xt(s,o,i[e]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;wa.set(this.visualElement,this);const t=this.visualElement.current,e=sa(t,"pointerdown",e=>{const{drag:n,dragListener:i=!0}=this.getProps(),s=e.target,o=s!==t&&function(t){return Li.has(t.tagName)||!0===t.isContentEditable}(s);n&&i&&!o&&this.start(e)});let n;const i=()=>{const{dragConstraints:e}=this.getProps();Gr(e)&&e.current&&(this.constraints=this.resolveRefConstraints(),n||(n=function(t,e,n){const i=Ji(t,Sa(n)),s=Ji(e,Sa(n));return()=>{i(),s()}}(t,e.current,()=>this.scalePositionWithinConstraints())))},{projection:s}=this.visualElement,o=s.addEventListener("measure",i);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),nt.read(i);const r=Uo(window,"resize",()=>this.scalePositionWithinConstraints()),a=s.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(Do(e=>{const n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))}),this.visualElement.render())});return()=>{r(),e(),o(),a&&a(),n&&n()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:o=ga,dragMomentum:r=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:r}}}function Sa(t){let e=!0;return()=>{e?e=!1:t()}}function Pa(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}const ba=t=>(e,n)=>{t&&nt.update(()=>t(e,n),!1,!0)};let Ea=!1;class Aa extends m{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:i}=this.props,{projection:s}=t;s&&(e.group&&e.group.add(s),n&&n.register&&i&&n.register(s),Ea&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Yo.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:n,drag:i,isPresent:s}=this.props,{projection:o}=n;return o?(o.isPresent=s,t.layoutDependency!==e&&o.setOptions({...o.options,layoutDependency:e}),Ea=!0,i||t.layoutDependency!==e||void 0===e||t.isPresent!==s?o.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?o.promote():o.relegate()||nt.postRender(()=>{const t=o.getStack();t&&t.members.length||this.safeToRemove()})),null):null}componentDidUpdate(){const{visualElement:t,layoutAnchor:e}=this.props,{projection:n}=t;n&&(n.options.layoutAnchor=e,n.root.didUpdate(),Ei.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n}=this.props,{projection:i}=t;Ea=!0,i&&(i.scheduleCheckAfterUnmount(),e&&e.group&&e.group.remove(i),n&&n.deregister&&n.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Ma(t){const[n,s]=function(t=!0){const e=i(Ir);if(null===e)return[!0,null];const{isPresent:n,onExitComplete:s,register:o}=e,r=p();c(()=>{if(t)return o(r)},[t]);const a=h(()=>t&&s&&s(r),[r,s,t]);return!n&&s?[!1,a]:[!0]}(),o=i(Z);return e(Aa,{...t,layoutGroup:o,switchLayoutGroup:i(Kr),isPresent:n,safeToRemove:s})}const Va={pan:{Feature:class extends ys{constructor(){super(...arguments),this.removePointerDownListener=A}onPointerDown(t){this.session=new la(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:oa(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:e,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:ba(t),onStart:ba(e),onMove:ba(n),onEnd:(t,e)=>{delete this.session,i&&nt.postRender(()=>i(t,e))}}}mount(){this.removePointerDownListener=sa(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends ys{constructor(t){super(t),this.removeGroupControls=A,this.removeListeners=A,this.controls=new Ta(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||A}update(){const{dragControls:t}=this.node.getProps(),{dragControls:e}=this.node.prevProps||{};t!==e&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},ProjectionNode:Sr,MeasureLayout:Ma}};function Ca(t,e,n){const{props:i}=t;t.animationState&&i.whileHover&&t.animationState.setActive("whileHover","Start"===n);const s=i["onHover"+n];s&&nt.postRender(()=>s(e,ia(e)))}function ka(t,e,n){const{props:i}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&i.whileTap&&t.animationState.setActive("whileTap","Start"===n);const s=i["onTap"+("End"===n?"":n)];s&&nt.postRender(()=>s(e,ia(e)))}const Da=new WeakMap,Ra=new WeakMap,La=t=>{const e=Da.get(t.target);e&&e(t)},Ba=t=>{t.forEach(La)};function ja(t,e,n){const i=function({root:t,...e}){const n=t||document;Ra.has(n)||Ra.set(n,{});const i=Ra.get(n),s=JSON.stringify(e);return i[s]||(i[s]=new IntersectionObserver(Ba,{root:t,...e})),i[s]}(e);return Da.set(t,n),i.observe(t),()=>{Da.delete(t),i.unobserve(t)}}const Fa={some:0,all:1};const Ia={...na,...{inView:{Feature:class extends ys{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:t={}}=this.node.getProps(),{root:e,margin:n,amount:i="some",once:s}=t,o={root:e?e.current:void 0,rootMargin:n,threshold:"number"==typeof i?i:Fa[i]};this.stopObserver=ja(this.node.current,o,t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,s&&!e&&this.hasEnteredView)return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);const{onViewportEnter:n,onViewportLeave:i}=this.node.getProps(),o=e?n:i;o&&o(t)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}(t,e))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}},tap:{Feature:class extends ys{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:e,propagate:n}=this.node.props;this.unmount=Ui(t,(t,e)=>(ka(this.node,e,"Start"),(t,{success:e})=>ka(this.node,t,e?"End":"Cancel")),{useGlobalTarget:e,stopPropagation:!1===n?.tap})}unmount(){}}},focus:{Feature:class extends ys{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){t=!0}t&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=M(Uo(this.node.current,"focus",()=>this.onFocus()),Uo(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends ys{mount(){const{current:t}=this.node;t&&(this.unmount=Ci(t,(t,e)=>(Ca(this.node,e,"Start"),t=>Ca(this.node,t,"End"))))}unmount(){}}}},...Va,...{layout:{ProjectionNode:Sr,MeasureLayout:Ma}}};function Oa(t,e){return Jr(t,e,Ia,ta)}const Ua=Oa("div");export{Ua as MotionDiv}; +//# sourceMappingURL=size-rollup-motion.js.map diff --git a/node_modules/framer-motion/dist/size-rollup-motion.js.map b/node_modules/framer-motion/dist/size-rollup-motion.js.map new file mode 100644 index 0000000..3b5a8e5 --- /dev/null +++ b/node_modules/framer-motion/dist/size-rollup-motion.js.map @@ -0,0 +1 @@ +{"version":3,"file":"size-rollup-motion.js","sources":["../../motion-utils/dist/es/array.mjs","../../motion-utils/dist/es/clamp.mjs","../../motion-utils/dist/es/format-error-message.mjs","../../motion-utils/dist/es/errors.mjs","../../motion-utils/dist/es/global-config.mjs","../../motion-utils/dist/es/is-numerical-string.mjs","../../motion-utils/dist/es/is-object.mjs","../../motion-utils/dist/es/is-zero-value-string.mjs","../../motion-utils/dist/es/memo.mjs","../../motion-utils/dist/es/noop.mjs","../../motion-utils/dist/es/pipe.mjs","../../motion-utils/dist/es/progress.mjs","../../motion-utils/dist/es/subscription-manager.mjs","../../motion-utils/dist/es/time-conversion.mjs","../../motion-utils/dist/es/velocity-per-second.mjs","../../motion-utils/dist/es/easing/cubic-bezier.mjs","../../motion-utils/dist/es/easing/modifiers/mirror.mjs","../../motion-utils/dist/es/easing/modifiers/reverse.mjs","../../motion-utils/dist/es/easing/back.mjs","../../motion-utils/dist/es/easing/anticipate.mjs","../../motion-utils/dist/es/easing/circ.mjs","../../motion-utils/dist/es/easing/ease.mjs","../../motion-utils/dist/es/easing/utils/is-bezier-definition.mjs","../../motion-utils/dist/es/easing/utils/map.mjs","../lib/context/LayoutGroupContext.js","../lib/context/LazyContext.js","../lib/context/MotionConfigContext.js","../lib/context/MotionContext/index.js","../../motion-dom/dist/es/frameloop/order.mjs","../../motion-dom/dist/es/frameloop/batcher.mjs","../../motion-dom/dist/es/frameloop/render-step.mjs","../../motion-dom/dist/es/frameloop/frame.mjs","../../motion-dom/dist/es/frameloop/sync-time.mjs","../../motion-dom/dist/es/animation/utils/is-css-variable.mjs","../../motion-dom/dist/es/value/types/numbers/index.mjs","../../motion-dom/dist/es/value/types/utils/sanitize.mjs","../../motion-dom/dist/es/value/types/utils/float-regex.mjs","../../motion-dom/dist/es/value/types/utils/single-color-regex.mjs","../../motion-dom/dist/es/value/types/color/utils.mjs","../../motion-dom/dist/es/value/types/utils/is-nullish.mjs","../../motion-dom/dist/es/value/types/color/rgba.mjs","../../motion-dom/dist/es/value/types/color/hex.mjs","../../motion-dom/dist/es/value/types/numbers/units.mjs","../../motion-dom/dist/es/value/types/color/hsla.mjs","../../motion-dom/dist/es/value/types/color/index.mjs","../../motion-dom/dist/es/value/types/utils/color-regex.mjs","../../motion-dom/dist/es/value/types/complex/index.mjs","../../motion-dom/dist/es/value/types/color/hsla-to-rgba.mjs","../../motion-dom/dist/es/utils/mix/immediate.mjs","../../motion-dom/dist/es/utils/mix/number.mjs","../../motion-dom/dist/es/utils/mix/color.mjs","../../motion-dom/dist/es/utils/mix/visibility.mjs","../../motion-dom/dist/es/utils/mix/complex.mjs","../../motion-dom/dist/es/utils/mix/index.mjs","../../motion-dom/dist/es/animation/drivers/frame.mjs","../../motion-dom/dist/es/animation/waapi/utils/linear.mjs","../../motion-dom/dist/es/animation/generators/utils/calc-duration.mjs","../../motion-dom/dist/es/animation/generators/spring.mjs","../../motion-dom/dist/es/animation/generators/utils/create-generator-easing.mjs","../../motion-dom/dist/es/animation/generators/utils/velocity.mjs","../../motion-dom/dist/es/animation/generators/inertia.mjs","../../motion-dom/dist/es/utils/interpolate.mjs","../../motion-dom/dist/es/animation/keyframes/offsets/default.mjs","../../motion-dom/dist/es/animation/keyframes/offsets/fill.mjs","../../motion-dom/dist/es/animation/generators/keyframes.mjs","../../motion-utils/dist/es/easing/utils/is-easing-array.mjs","../../motion-dom/dist/es/animation/keyframes/offsets/time.mjs","../../motion-dom/dist/es/animation/keyframes/get-final.mjs","../../motion-dom/dist/es/animation/utils/replace-transition-type.mjs","../../motion-dom/dist/es/animation/utils/WithPromise.mjs","../../motion-dom/dist/es/animation/JSAnimation.mjs","../../motion-dom/dist/es/render/dom/parse-transform.mjs","../../motion-dom/dist/es/render/utils/keys-transform.mjs","../../motion-dom/dist/es/animation/keyframes/utils/unit-conversion.mjs","../../motion-dom/dist/es/animation/keyframes/KeyframesResolver.mjs","../../motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.mjs","../../motion-dom/dist/es/render/dom/style-set.mjs","../../motion-dom/dist/es/render/dom/is-css-var.mjs","../../motion-dom/dist/es/utils/supports/flags.mjs","../../motion-dom/dist/es/utils/supports/memo.mjs","../../motion-dom/dist/es/utils/supports/scroll-timeline.mjs","../../motion-dom/dist/es/utils/supports/linear-easing.mjs","../../motion-dom/dist/es/animation/waapi/easing/cubic-bezier.mjs","../../motion-dom/dist/es/animation/waapi/easing/supported.mjs","../../motion-dom/dist/es/animation/waapi/easing/map-easing.mjs","../../motion-dom/dist/es/animation/waapi/start-waapi-animation.mjs","../../motion-dom/dist/es/animation/generators/utils/is-generator.mjs","../../motion-dom/dist/es/animation/NativeAnimation.mjs","../../motion-dom/dist/es/animation/waapi/utils/apply-generator.mjs","../../motion-dom/dist/es/animation/waapi/utils/unsupported-easing.mjs","../../motion-dom/dist/es/animation/NativeAnimationExtended.mjs","../../motion-dom/dist/es/animation/utils/is-animatable.mjs","../../motion-dom/dist/es/animation/utils/make-animation-instant.mjs","../../motion-dom/dist/es/animation/waapi/utils/accelerated-values.mjs","../../motion-dom/dist/es/animation/waapi/utils/is-browser-color.mjs","../../motion-dom/dist/es/animation/waapi/supports/waapi.mjs","../../motion-dom/dist/es/animation/AsyncMotionValueAnimation.mjs","../../motion-dom/dist/es/animation/utils/can-animate.mjs","../../motion-dom/dist/es/animation/utils/calc-child-stagger.mjs","../../motion-dom/dist/es/value/index.mjs","../../motion-dom/dist/es/animation/utils/resolve-transition.mjs","../../motion-dom/dist/es/animation/utils/get-value-transition.mjs","../../motion-dom/dist/es/animation/utils/default-transitions.mjs","../../motion-dom/dist/es/animation/utils/is-transition-defined.mjs","../../motion-dom/dist/es/animation/interfaces/motion-value.mjs","../../motion-dom/dist/es/animation/utils/css-variables-conversion.mjs","../../motion-dom/dist/es/render/utils/resolve-variants.mjs","../../motion-dom/dist/es/render/utils/resolve-dynamic-variants.mjs","../../motion-dom/dist/es/render/utils/keys-position.mjs","../../motion-dom/dist/es/render/utils/is-keyframes-target.mjs","../../motion-dom/dist/es/render/utils/setters.mjs","../../motion-dom/dist/es/value/utils/is-motion-value.mjs","../../motion-dom/dist/es/value/will-change/add-will-change.mjs","../../motion-dom/dist/es/value/will-change/is.mjs","../../motion-dom/dist/es/render/dom/utils/camel-to-dash.mjs","../../motion-dom/dist/es/animation/optimized-appear/data-id.mjs","../../motion-dom/dist/es/animation/optimized-appear/get-appear-id.mjs","../../motion-dom/dist/es/animation/interfaces/visual-element-target.mjs","../../motion-dom/dist/es/animation/interfaces/visual-element-variant.mjs","../../motion-dom/dist/es/value/types/auto.mjs","../../motion-dom/dist/es/value/types/test.mjs","../../motion-dom/dist/es/value/types/dimensions.mjs","../../motion-dom/dist/es/animation/keyframes/utils/is-none.mjs","../../motion-dom/dist/es/value/types/complex/filter.mjs","../../motion-dom/dist/es/value/types/complex/mask.mjs","../../motion-dom/dist/es/value/types/int.mjs","../../motion-dom/dist/es/value/types/maps/number.mjs","../../motion-dom/dist/es/value/types/maps/transform.mjs","../../motion-dom/dist/es/value/types/maps/defaults.mjs","../../motion-dom/dist/es/value/types/utils/animatable-none.mjs","../../motion-dom/dist/es/animation/keyframes/utils/make-none-animatable.mjs","../../motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.mjs","../../motion-dom/dist/es/utils/border-radius.mjs","../../motion-dom/dist/es/utils/resolve-elements.mjs","../../motion-dom/dist/es/value/types/utils/get-as-type.mjs","../../motion-dom/dist/es/frameloop/microtask.mjs","../../motion-dom/dist/es/gestures/drag/state/is-active.mjs","../../motion-dom/dist/es/gestures/utils/setup.mjs","../../motion-dom/dist/es/gestures/hover.mjs","../../motion-dom/dist/es/gestures/utils/is-node-or-child.mjs","../../motion-dom/dist/es/gestures/utils/is-primary-pointer.mjs","../../motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.mjs","../../motion-dom/dist/es/gestures/press/utils/state.mjs","../../motion-dom/dist/es/gestures/press/utils/keyboard.mjs","../../motion-dom/dist/es/gestures/press/index.mjs","../../motion-dom/dist/es/utils/is-html-element.mjs","../../motion-dom/dist/es/utils/is-svg-element.mjs","../../motion-dom/dist/es/resize/handle-element.mjs","../../motion-dom/dist/es/resize/handle-window.mjs","../../motion-dom/dist/es/resize/index.mjs","../../motion-dom/dist/es/value/types/utils/find.mjs","../../motion-dom/dist/es/projection/geometry/models.mjs","../../motion-dom/dist/es/render/store.mjs","../../motion-dom/dist/es/render/utils/is-animation-controls.mjs","../../motion-dom/dist/es/render/utils/is-variant-label.mjs","../../motion-dom/dist/es/render/utils/variant-props.mjs","../../motion-dom/dist/es/render/utils/is-controlling-variants.mjs","../../motion-dom/dist/es/render/utils/reduced-motion/state.mjs","../../motion-dom/dist/es/render/utils/reduced-motion/index.mjs","../../motion-dom/dist/es/render/VisualElement.mjs","../../motion-dom/dist/es/render/utils/motion-values.mjs","../../motion-dom/dist/es/render/dom/DOMVisualElement.mjs","../../motion-dom/dist/es/render/Feature.mjs","../../motion-dom/dist/es/projection/geometry/conversion.mjs","../../motion-dom/dist/es/projection/utils/has-transform.mjs","../../motion-dom/dist/es/projection/geometry/delta-apply.mjs","../../motion-dom/dist/es/projection/utils/measure.mjs","../../motion-dom/dist/es/render/html/utils/build-transform.mjs","../../motion-dom/dist/es/render/html/utils/build-styles.mjs","../../motion-dom/dist/es/render/html/utils/render.mjs","../../motion-dom/dist/es/projection/styles/scale-border-radius.mjs","../../motion-dom/dist/es/projection/styles/scale-box-shadow.mjs","../../motion-dom/dist/es/projection/styles/scale-correction.mjs","../../motion-dom/dist/es/render/utils/is-forced-motion-value.mjs","../../motion-dom/dist/es/render/html/utils/scrape-motion-values.mjs","../../motion-dom/dist/es/render/html/HTMLVisualElement.mjs","../../motion-dom/dist/es/render/svg/utils/path.mjs","../../motion-dom/dist/es/render/svg/utils/build-attrs.mjs","../../motion-dom/dist/es/render/svg/utils/camel-case-attrs.mjs","../../motion-dom/dist/es/render/svg/utils/is-svg-tag.mjs","../../motion-dom/dist/es/render/svg/utils/scrape-motion-values.mjs","../../motion-dom/dist/es/render/svg/SVGVisualElement.mjs","../../motion-dom/dist/es/render/svg/utils/render.mjs","../../motion-dom/dist/es/render/utils/get-variant-context.mjs","../../motion-dom/dist/es/render/utils/shallow-compare.mjs","../../motion-dom/dist/es/render/utils/animation-state.mjs","../../motion-dom/dist/es/animation/interfaces/visual-element.mjs","../../motion-dom/dist/es/projection/geometry/copy.mjs","../../motion-dom/dist/es/projection/geometry/delta-calc.mjs","../../motion-dom/dist/es/projection/geometry/delta-remove.mjs","../../motion-dom/dist/es/projection/geometry/utils.mjs","../../motion-dom/dist/es/projection/utils/each-axis.mjs","../../motion-dom/dist/es/projection/animation/mix-values.mjs","../../motion-dom/dist/es/events/add-dom-event.mjs","../../motion-dom/dist/es/projection/utils/compare-by-depth.mjs","../../motion-dom/dist/es/projection/utils/flat-tree.mjs","../../motion-dom/dist/es/value/utils/resolve-motion-value.mjs","../../motion-dom/dist/es/projection/shared/stack.mjs","../../motion-dom/dist/es/projection/node/state.mjs","../../motion-dom/dist/es/projection/node/create-projection-node.mjs","../../motion-dom/dist/es/utils/is-svg-svg-element.mjs","../../motion-dom/dist/es/utils/delay.mjs","../../motion-dom/dist/es/animation/animate/single-value.mjs","../../motion-dom/dist/es/projection/styles/transform.mjs","../../motion-dom/dist/es/projection/node/DocumentProjectionNode.mjs","../../motion-dom/dist/es/projection/node/HTMLProjectionNode.mjs","../lib/context/MotionContext/create.js","../lib/context/MotionContext/utils.js","../lib/render/html/utils/create-render-state.js","../lib/render/html/use-props.js","../lib/render/svg/utils/create-render-state.js","../lib/render/svg/use-props.js","../lib/motion/utils/valid-prop.js","../lib/render/dom/utils/filter-props.js","../lib/render/svg/lowercase-elements.js","../lib/render/dom/utils/is-svg-component.js","../lib/render/dom/use-render.js","../lib/context/PresenceContext.js","../lib/motion/utils/use-visual-state.js","../lib/utils/use-constant.js","../lib/render/html/use-html-visual-state.js","../lib/render/svg/use-svg-visual-state.js","../lib/motion/features/definitions.js","../lib/motion/utils/symbol.js","../lib/motion/utils/use-motion-ref.js","../lib/context/SwitchLayoutGroupContext.js","../lib/utils/is-ref-object.js","../lib/utils/is-browser.js","../lib/utils/use-isomorphic-effect.js","../lib/motion/utils/use-visual-element.js","../lib/motion/index.js","../lib/motion/features/load-features.js","../lib/render/dom/create-visual-element.js","../lib/motion/features/animation/exit.js","../lib/motion/features/animations.js","../lib/motion/features/animation/index.js","../lib/events/event-info.js","../lib/events/add-pointer-event.js","../lib/utils/get-context-window.js","../lib/utils/distance.js","../lib/gestures/pan/PanSession.js","../lib/gestures/drag/utils/constraints.js","../lib/gestures/drag/VisualElementDragControls.js","../../motion-dom/dist/es/gestures/drag/state/set-active.mjs","../lib/gestures/pan/index.js","../lib/motion/features/layout/MeasureLayout.js","../lib/components/AnimatePresence/use-presence.js","../lib/motion/features/drag.js","../lib/gestures/drag/index.js","../lib/gestures/hover.js","../lib/gestures/press.js","../lib/motion/features/viewport/observers.js","../lib/motion/features/viewport/index.js","../lib/motion/features/gestures.js","../lib/render/components/motion/feature-bundle.js","../lib/gestures/focus.js","../lib/motion/features/layout.js","../lib/render/components/motion/create.js","../lib/render/components/motion/elements.js","../lib/render/components/motion/size.js"],"sourcesContent":["function addUniqueItem(arr, item) {\n if (arr.indexOf(item) === -1)\n arr.push(item);\n}\nfunction removeItem(arr, item) {\n const index = arr.indexOf(item);\n if (index > -1)\n arr.splice(index, 1);\n}\n// Adapted from array-move\nfunction moveItem([...arr], fromIndex, toIndex) {\n const startIndex = fromIndex < 0 ? arr.length + fromIndex : fromIndex;\n if (startIndex >= 0 && startIndex < arr.length) {\n const endIndex = toIndex < 0 ? arr.length + toIndex : toIndex;\n const [item] = arr.splice(fromIndex, 1);\n arr.splice(endIndex, 0, item);\n }\n return arr;\n}\n\nexport { addUniqueItem, moveItem, removeItem };\n//# sourceMappingURL=array.mjs.map\n","const clamp = (min, max, v) => {\n if (v > max)\n return max;\n if (v < min)\n return min;\n return v;\n};\n\nexport { clamp };\n//# sourceMappingURL=clamp.mjs.map\n","function formatErrorMessage(message, errorCode) {\n return errorCode\n ? `${message}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${errorCode}`\n : message;\n}\n\nexport { formatErrorMessage };\n//# sourceMappingURL=format-error-message.mjs.map\n","import { formatErrorMessage } from './format-error-message.mjs';\n\nlet warning = () => { };\nlet invariant = () => { };\nif (typeof process !== \"undefined\" &&\n process.env?.NODE_ENV !== \"production\") {\n warning = (check, message, errorCode) => {\n if (!check && typeof console !== \"undefined\") {\n console.warn(formatErrorMessage(message, errorCode));\n }\n };\n invariant = (check, message, errorCode) => {\n if (!check) {\n throw new Error(formatErrorMessage(message, errorCode));\n }\n };\n}\n\nexport { invariant, warning };\n//# sourceMappingURL=errors.mjs.map\n","const MotionGlobalConfig = {};\n\nexport { MotionGlobalConfig };\n//# sourceMappingURL=global-config.mjs.map\n","/**\n * Check if value is a numerical string, ie a string that is purely a number eg \"100\" or \"-100.1\"\n */\nconst isNumericalString = (v) => /^-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)$/u.test(v);\n\nexport { isNumericalString };\n//# sourceMappingURL=is-numerical-string.mjs.map\n","const isObject = (value) => typeof value === \"object\" && value !== null;\n\nexport { isObject };\n//# sourceMappingURL=is-object.mjs.map\n","/**\n * Check if the value is a zero value string like \"0px\" or \"0%\"\n */\nconst isZeroValueString = (v) => /^0[^.\\s]+$/u.test(v);\n\nexport { isZeroValueString };\n//# sourceMappingURL=is-zero-value-string.mjs.map\n","/*#__NO_SIDE_EFFECTS__*/\nfunction memo(callback) {\n let result;\n return () => {\n if (result === undefined)\n result = callback();\n return result;\n };\n}\n\nexport { memo };\n//# sourceMappingURL=memo.mjs.map\n","/*#__NO_SIDE_EFFECTS__*/\nconst noop = (any) => any;\n\nexport { noop };\n//# sourceMappingURL=noop.mjs.map\n","/**\n * Pipe\n * Compose other transformers to run linearily\n * pipe(min(20), max(40))\n * @param {...functions} transformers\n * @return {function}\n */\nconst pipe = (...transformers) => transformers.reduce((a, b) => (v) => b(a(v)));\n\nexport { pipe };\n//# sourceMappingURL=pipe.mjs.map\n","/*\n Progress within given range\n\n Given a lower limit and an upper limit, we return the progress\n (expressed as a number 0-1) represented by the given value, and\n limit that progress to within 0-1.\n*/\n/*#__NO_SIDE_EFFECTS__*/\nconst progress = (from, to, value) => {\n const range = to - from;\n return range ? (value - from) / range : 1;\n};\n\nexport { progress };\n//# sourceMappingURL=progress.mjs.map\n","import { addUniqueItem, removeItem } from './array.mjs';\n\nclass SubscriptionManager {\n constructor() {\n this.subscriptions = [];\n }\n add(handler) {\n addUniqueItem(this.subscriptions, handler);\n return () => removeItem(this.subscriptions, handler);\n }\n notify(a, b, c) {\n const numSubscriptions = this.subscriptions.length;\n if (!numSubscriptions)\n return;\n if (numSubscriptions === 1) {\n /**\n * If there's only a single handler we can just call it without invoking a loop.\n */\n this.subscriptions[0](a, b, c);\n }\n else {\n for (let i = 0; i < numSubscriptions; i++) {\n /**\n * Check whether the handler exists before firing as it's possible\n * the subscriptions were modified during this loop running.\n */\n const handler = this.subscriptions[i];\n handler && handler(a, b, c);\n }\n }\n }\n getSize() {\n return this.subscriptions.length;\n }\n clear() {\n this.subscriptions.length = 0;\n }\n}\n\nexport { SubscriptionManager };\n//# sourceMappingURL=subscription-manager.mjs.map\n","/**\n * Converts seconds to milliseconds\n *\n * @param seconds - Time in seconds.\n * @return milliseconds - Converted time in milliseconds.\n */\n/*#__NO_SIDE_EFFECTS__*/\nconst secondsToMilliseconds = (seconds) => seconds * 1000;\n/*#__NO_SIDE_EFFECTS__*/\nconst millisecondsToSeconds = (milliseconds) => milliseconds / 1000;\n\nexport { millisecondsToSeconds, secondsToMilliseconds };\n//# sourceMappingURL=time-conversion.mjs.map\n","/*\n Convert velocity into velocity per second\n*/\n/*#__NO_SIDE_EFFECTS__*/\nconst velocityPerSecond = (velocity, frameDuration) => frameDuration ? velocity * (1000 / frameDuration) : 0;\n\nexport { velocityPerSecond };\n//# sourceMappingURL=velocity-per-second.mjs.map\n","import { noop } from '../noop.mjs';\n\n/*\n Bezier function generator\n This has been modified from Gaëtan Renaudeau's BezierEasing\n https://github.com/gre/bezier-easing/blob/master/src/index.js\n https://github.com/gre/bezier-easing/blob/master/LICENSE\n \n I've removed the newtonRaphsonIterate algo because in benchmarking it\n wasn't noticeably faster than binarySubdivision, indeed removing it\n usually improved times, depending on the curve.\n I also removed the lookup table, as for the added bundle size and loop we're\n only cutting ~4 or so subdivision iterations. I bumped the max iterations up\n to 12 to compensate and this still tended to be faster for no perceivable\n loss in accuracy.\n Usage\n const easeOut = cubicBezier(.17,.67,.83,.67);\n const x = easeOut(0.5); // returns 0.627...\n*/\n// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.\nconst calcBezier = (t, a1, a2) => (((1.0 - 3.0 * a2 + 3.0 * a1) * t + (3.0 * a2 - 6.0 * a1)) * t + 3.0 * a1) *\n t;\nconst subdivisionPrecision = 0.0000001;\nconst subdivisionMaxIterations = 12;\nfunction binarySubdivide(x, lowerBound, upperBound, mX1, mX2) {\n let currentX;\n let currentT;\n let i = 0;\n do {\n currentT = lowerBound + (upperBound - lowerBound) / 2.0;\n currentX = calcBezier(currentT, mX1, mX2) - x;\n if (currentX > 0.0) {\n upperBound = currentT;\n }\n else {\n lowerBound = currentT;\n }\n } while (Math.abs(currentX) > subdivisionPrecision &&\n ++i < subdivisionMaxIterations);\n return currentT;\n}\n/*#__NO_SIDE_EFFECTS__*/\nfunction cubicBezier(mX1, mY1, mX2, mY2) {\n // If this is a linear gradient, return linear easing\n if (mX1 === mY1 && mX2 === mY2)\n return noop;\n const getTForX = (aX) => binarySubdivide(aX, 0, 1, mX1, mX2);\n // If animation is at start/end, return t without easing\n return (t) => t === 0 || t === 1 ? t : calcBezier(getTForX(t), mY1, mY2);\n}\n\nexport { cubicBezier };\n//# sourceMappingURL=cubic-bezier.mjs.map\n","// Accepts an easing function and returns a new one that outputs mirrored values for\n// the second half of the animation. Turns easeIn into easeInOut.\n/*#__NO_SIDE_EFFECTS__*/\nconst mirrorEasing = (easing) => (p) => p <= 0.5 ? easing(2 * p) / 2 : (2 - easing(2 * (1 - p))) / 2;\n\nexport { mirrorEasing };\n//# sourceMappingURL=mirror.mjs.map\n","// Accepts an easing function and returns a new one that outputs reversed values.\n// Turns easeIn into easeOut.\n/*#__NO_SIDE_EFFECTS__*/\nconst reverseEasing = (easing) => (p) => 1 - easing(1 - p);\n\nexport { reverseEasing };\n//# sourceMappingURL=reverse.mjs.map\n","import { cubicBezier } from './cubic-bezier.mjs';\nimport { mirrorEasing } from './modifiers/mirror.mjs';\nimport { reverseEasing } from './modifiers/reverse.mjs';\n\nconst backOut = /*@__PURE__*/ cubicBezier(0.33, 1.53, 0.69, 0.99);\nconst backIn = /*@__PURE__*/ reverseEasing(backOut);\nconst backInOut = /*@__PURE__*/ mirrorEasing(backIn);\n\nexport { backIn, backInOut, backOut };\n//# sourceMappingURL=back.mjs.map\n","import { backIn } from './back.mjs';\n\nconst anticipate = (p) => p >= 1\n ? 1\n : (p *= 2) < 1\n ? 0.5 * backIn(p)\n : 0.5 * (2 - Math.pow(2, -10 * (p - 1)));\n\nexport { anticipate };\n//# sourceMappingURL=anticipate.mjs.map\n","import { mirrorEasing } from './modifiers/mirror.mjs';\nimport { reverseEasing } from './modifiers/reverse.mjs';\n\nconst circIn = (p) => 1 - Math.sin(Math.acos(p));\nconst circOut = reverseEasing(circIn);\nconst circInOut = mirrorEasing(circIn);\n\nexport { circIn, circInOut, circOut };\n//# sourceMappingURL=circ.mjs.map\n","import { cubicBezier } from './cubic-bezier.mjs';\n\nconst easeIn = /*@__PURE__*/ cubicBezier(0.42, 0, 1, 1);\nconst easeOut = /*@__PURE__*/ cubicBezier(0, 0, 0.58, 1);\nconst easeInOut = /*@__PURE__*/ cubicBezier(0.42, 0, 0.58, 1);\n\nexport { easeIn, easeInOut, easeOut };\n//# sourceMappingURL=ease.mjs.map\n","/*#__NO_SIDE_EFFECTS__*/\nconst isBezierDefinition = (easing) => Array.isArray(easing) && typeof easing[0] === \"number\";\n\nexport { isBezierDefinition };\n//# sourceMappingURL=is-bezier-definition.mjs.map\n","import { invariant } from '../../errors.mjs';\nimport { noop } from '../../noop.mjs';\nimport { anticipate } from '../anticipate.mjs';\nimport { backOut, backInOut, backIn } from '../back.mjs';\nimport { circOut, circInOut, circIn } from '../circ.mjs';\nimport { cubicBezier } from '../cubic-bezier.mjs';\nimport { easeOut, easeInOut, easeIn } from '../ease.mjs';\nimport { isBezierDefinition } from './is-bezier-definition.mjs';\n\nconst easingLookup = {\n linear: noop,\n easeIn,\n easeInOut,\n easeOut,\n circIn,\n circInOut,\n circOut,\n backIn,\n backInOut,\n backOut,\n anticipate,\n};\nconst isValidEasing = (easing) => {\n return typeof easing === \"string\";\n};\nconst easingDefinitionToFunction = (definition) => {\n if (isBezierDefinition(definition)) {\n // If cubic bezier definition, create bezier curve\n invariant(definition.length === 4, `Cubic bezier arrays must contain four numerical values.`, \"cubic-bezier-length\");\n const [x1, y1, x2, y2] = definition;\n return cubicBezier(x1, y1, x2, y2);\n }\n else if (isValidEasing(definition)) {\n // Else lookup from table\n invariant(easingLookup[definition] !== undefined, `Invalid easing type '${definition}'`, \"invalid-easing-type\");\n return easingLookup[definition];\n }\n return definition;\n};\n\nexport { easingDefinitionToFunction };\n//# sourceMappingURL=map.mjs.map\n","\"use client\";\nimport { createContext } from \"react\";\nexport const LayoutGroupContext = createContext({});\n//# sourceMappingURL=LayoutGroupContext.js.map","\"use client\";\nimport { createContext } from \"react\";\nexport const LazyContext = createContext({ strict: false });\n//# sourceMappingURL=LazyContext.js.map","\"use client\";\nimport { createContext } from \"react\";\n/**\n * @public\n */\nexport const MotionConfigContext = createContext({\n transformPagePoint: (p) => p,\n isStatic: false,\n reducedMotion: \"never\",\n});\n//# sourceMappingURL=MotionConfigContext.js.map","\"use client\";\nimport { createContext } from \"react\";\nexport const MotionContext = /* @__PURE__ */ createContext({});\n//# sourceMappingURL=index.js.map","const stepsOrder = [\n \"setup\", // Compute\n \"read\", // Read\n \"resolveKeyframes\", // Write/Read/Write/Read\n \"preUpdate\", // Compute\n \"update\", // Compute\n \"preRender\", // Compute\n \"render\", // Write\n \"postRender\", // Compute\n];\n\nexport { stepsOrder };\n//# sourceMappingURL=order.mjs.map\n","import { MotionGlobalConfig } from 'motion-utils';\nimport { stepsOrder } from './order.mjs';\nimport { createRenderStep } from './render-step.mjs';\n\nconst maxElapsed = 40;\nfunction createRenderBatcher(scheduleNextBatch, allowKeepAlive) {\n let runNextFrame = false;\n let useDefaultElapsed = true;\n const state = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n };\n const flagRunNextFrame = () => (runNextFrame = true);\n const steps = stepsOrder.reduce((acc, key) => {\n acc[key] = createRenderStep(flagRunNextFrame);\n return acc;\n }, {});\n const { setup, read, resolveKeyframes, preUpdate, update, preRender, render, postRender, } = steps;\n const processBatch = () => {\n const useManualTiming = MotionGlobalConfig.useManualTiming;\n const timestamp = useManualTiming\n ? state.timestamp\n : performance.now();\n runNextFrame = false;\n if (!useManualTiming) {\n state.delta = useDefaultElapsed\n ? 1000 / 60\n : Math.max(Math.min(timestamp - state.timestamp, maxElapsed), 1);\n }\n state.timestamp = timestamp;\n state.isProcessing = true;\n // Unrolled render loop for better per-frame performance\n setup.process(state);\n read.process(state);\n resolveKeyframes.process(state);\n preUpdate.process(state);\n update.process(state);\n preRender.process(state);\n render.process(state);\n postRender.process(state);\n state.isProcessing = false;\n if (runNextFrame && allowKeepAlive) {\n useDefaultElapsed = false;\n scheduleNextBatch(processBatch);\n }\n };\n const wake = () => {\n runNextFrame = true;\n useDefaultElapsed = true;\n if (!state.isProcessing) {\n scheduleNextBatch(processBatch);\n }\n };\n const schedule = stepsOrder.reduce((acc, key) => {\n const step = steps[key];\n acc[key] = (process, keepAlive = false, immediate = false) => {\n if (!runNextFrame)\n wake();\n return step.schedule(process, keepAlive, immediate);\n };\n return acc;\n }, {});\n const cancel = (process) => {\n for (let i = 0; i < stepsOrder.length; i++) {\n steps[stepsOrder[i]].cancel(process);\n }\n };\n return { schedule, cancel, state, steps };\n}\n\nexport { createRenderBatcher };\n//# sourceMappingURL=batcher.mjs.map\n","function createRenderStep(runNextFrame) {\n /**\n * We create and reuse two queues, one to queue jobs for the current frame\n * and one for the next. We reuse to avoid triggering GC after x frames.\n */\n let thisFrame = new Set();\n let nextFrame = new Set();\n /**\n * Track whether we're currently processing jobs in this step. This way\n * we can decide whether to schedule new jobs for this frame or next.\n */\n let isProcessing = false;\n let flushNextFrame = false;\n /**\n * A set of processes which were marked keepAlive when scheduled.\n */\n const toKeepAlive = new WeakSet();\n let latestFrameData = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n };\n function triggerCallback(callback) {\n if (toKeepAlive.has(callback)) {\n step.schedule(callback);\n runNextFrame();\n }\n callback(latestFrameData);\n }\n const step = {\n /**\n * Schedule a process to run on the next frame.\n */\n schedule: (callback, keepAlive = false, immediate = false) => {\n const addToCurrentFrame = immediate && isProcessing;\n const queue = addToCurrentFrame ? thisFrame : nextFrame;\n if (keepAlive)\n toKeepAlive.add(callback);\n queue.add(callback);\n return callback;\n },\n /**\n * Cancel the provided callback from running on the next frame.\n */\n cancel: (callback) => {\n nextFrame.delete(callback);\n toKeepAlive.delete(callback);\n },\n /**\n * Execute all schedule callbacks.\n */\n process: (frameData) => {\n latestFrameData = frameData;\n /**\n * If we're already processing we've probably been triggered by a flushSync\n * inside an existing process. Instead of executing, mark flushNextFrame\n * as true and ensure we flush the following frame at the end of this one.\n */\n if (isProcessing) {\n flushNextFrame = true;\n return;\n }\n isProcessing = true;\n // Swap this frame and the next to avoid GC\n const prevFrame = thisFrame;\n thisFrame = nextFrame;\n nextFrame = prevFrame;\n // Execute this frame\n thisFrame.forEach(triggerCallback);\n // Clear the frame so no callbacks remain. This is to avoid\n // memory leaks should this render step not run for a while.\n thisFrame.clear();\n isProcessing = false;\n if (flushNextFrame) {\n flushNextFrame = false;\n step.process(frameData);\n }\n },\n };\n return step;\n}\n\nexport { createRenderStep };\n//# sourceMappingURL=render-step.mjs.map\n","import { noop } from 'motion-utils';\nimport { createRenderBatcher } from './batcher.mjs';\n\nconst { schedule: frame, cancel: cancelFrame, state: frameData, steps: frameSteps, } = /* @__PURE__ */ createRenderBatcher(typeof requestAnimationFrame !== \"undefined\" ? requestAnimationFrame : noop, true);\n\nexport { cancelFrame, frame, frameData, frameSteps };\n//# sourceMappingURL=frame.mjs.map\n","import { MotionGlobalConfig } from 'motion-utils';\nimport { frameData } from './frame.mjs';\n\nlet now;\nfunction clearTime() {\n now = undefined;\n}\n/**\n * An eventloop-synchronous alternative to performance.now().\n *\n * Ensures that time measurements remain consistent within a synchronous context.\n * Usually calling performance.now() twice within the same synchronous context\n * will return different values which isn't useful for animations when we're usually\n * trying to sync animations to the same frame.\n */\nconst time = {\n now: () => {\n if (now === undefined) {\n time.set(frameData.isProcessing || MotionGlobalConfig.useManualTiming\n ? frameData.timestamp\n : performance.now());\n }\n return now;\n },\n set: (newTime) => {\n now = newTime;\n queueMicrotask(clearTime);\n },\n};\n\nexport { time };\n//# sourceMappingURL=sync-time.mjs.map\n","const checkStringStartsWith = (token) => (key) => typeof key === \"string\" && key.startsWith(token);\nconst isCSSVariableName = \n/*@__PURE__*/ checkStringStartsWith(\"--\");\nconst startsAsVariableToken = \n/*@__PURE__*/ checkStringStartsWith(\"var(--\");\nconst isCSSVariableToken = (value) => {\n const startsWithToken = startsAsVariableToken(value);\n if (!startsWithToken)\n return false;\n // Ensure any comments are stripped from the value as this can harm performance of the regex.\n return singleCssVariableRegex.test(value.split(\"/*\")[0].trim());\n};\nconst singleCssVariableRegex = /var\\(--(?:[\\w-]+\\s*|[\\w-]+\\s*,(?:\\s*[^)(\\s]|\\s*\\((?:[^)(]|\\([^)(]*\\))*\\))+\\s*)\\)$/iu;\n/**\n * Check if a value contains a CSS variable anywhere (e.g. inside calc()).\n * Unlike isCSSVariableToken which checks if the value IS a var() token,\n * this checks if the value CONTAINS var() somewhere in the string.\n */\nfunction containsCSSVariable(value) {\n if (typeof value !== \"string\")\n return false;\n // Strip comments to avoid false positives\n return value.split(\"/*\")[0].includes(\"var(--\");\n}\n\nexport { containsCSSVariable, isCSSVariableName, isCSSVariableToken };\n//# sourceMappingURL=is-css-variable.mjs.map\n","import { clamp } from 'motion-utils';\n\nconst number = {\n test: (v) => typeof v === \"number\",\n parse: parseFloat,\n transform: (v) => v,\n};\nconst alpha = {\n ...number,\n transform: (v) => clamp(0, 1, v),\n};\nconst scale = {\n ...number,\n default: 1,\n};\n\nexport { alpha, number, scale };\n//# sourceMappingURL=index.mjs.map\n","// If this number is a decimal, make it just five decimal places\n// to avoid exponents\nconst sanitize = (v) => Math.round(v * 100000) / 100000;\n\nexport { sanitize };\n//# sourceMappingURL=sanitize.mjs.map\n","const floatRegex = /-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)/gu;\n\nexport { floatRegex };\n//# sourceMappingURL=float-regex.mjs.map\n","const singleColorRegex = /^(?:#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\))$/iu;\n\nexport { singleColorRegex };\n//# sourceMappingURL=single-color-regex.mjs.map\n","import { floatRegex } from '../utils/float-regex.mjs';\nimport { isNullish } from '../utils/is-nullish.mjs';\nimport { singleColorRegex } from '../utils/single-color-regex.mjs';\n\n/**\n * Returns true if the provided string is a color, ie rgba(0,0,0,0) or #000,\n * but false if a number or multiple colors\n */\nconst isColorString = (type, testProp) => (v) => {\n return Boolean((typeof v === \"string\" &&\n singleColorRegex.test(v) &&\n v.startsWith(type)) ||\n (testProp &&\n !isNullish(v) &&\n Object.prototype.hasOwnProperty.call(v, testProp)));\n};\nconst splitColor = (aName, bName, cName) => (v) => {\n if (typeof v !== \"string\")\n return v;\n const [a, b, c, alpha] = v.match(floatRegex);\n return {\n [aName]: parseFloat(a),\n [bName]: parseFloat(b),\n [cName]: parseFloat(c),\n alpha: alpha !== undefined ? parseFloat(alpha) : 1,\n };\n};\n\nexport { isColorString, splitColor };\n//# sourceMappingURL=utils.mjs.map\n","function isNullish(v) {\n return v == null;\n}\n\nexport { isNullish };\n//# sourceMappingURL=is-nullish.mjs.map\n","import { clamp } from 'motion-utils';\nimport { number, alpha } from '../numbers/index.mjs';\nimport { sanitize } from '../utils/sanitize.mjs';\nimport { splitColor, isColorString } from './utils.mjs';\n\nconst clampRgbUnit = (v) => clamp(0, 255, v);\nconst rgbUnit = {\n ...number,\n transform: (v) => Math.round(clampRgbUnit(v)),\n};\nconst rgba = {\n test: /*@__PURE__*/ isColorString(\"rgb\", \"red\"),\n parse: /*@__PURE__*/ splitColor(\"red\", \"green\", \"blue\"),\n transform: ({ red, green, blue, alpha: alpha$1 = 1 }) => \"rgba(\" +\n rgbUnit.transform(red) +\n \", \" +\n rgbUnit.transform(green) +\n \", \" +\n rgbUnit.transform(blue) +\n \", \" +\n sanitize(alpha.transform(alpha$1)) +\n \")\",\n};\n\nexport { rgbUnit, rgba };\n//# sourceMappingURL=rgba.mjs.map\n","import { rgba } from './rgba.mjs';\nimport { isColorString } from './utils.mjs';\n\nfunction parseHex(v) {\n let r = \"\";\n let g = \"\";\n let b = \"\";\n let a = \"\";\n // If we have 6 characters, ie #FF0000\n if (v.length > 5) {\n r = v.substring(1, 3);\n g = v.substring(3, 5);\n b = v.substring(5, 7);\n a = v.substring(7, 9);\n // Or we have 3 characters, ie #F00\n }\n else {\n r = v.substring(1, 2);\n g = v.substring(2, 3);\n b = v.substring(3, 4);\n a = v.substring(4, 5);\n r += r;\n g += g;\n b += b;\n a += a;\n }\n return {\n red: parseInt(r, 16),\n green: parseInt(g, 16),\n blue: parseInt(b, 16),\n alpha: a ? parseInt(a, 16) / 255 : 1,\n };\n}\nconst hex = {\n test: /*@__PURE__*/ isColorString(\"#\"),\n parse: parseHex,\n transform: rgba.transform,\n};\n\nexport { hex };\n//# sourceMappingURL=hex.mjs.map\n","/*#__NO_SIDE_EFFECTS__*/\nconst createUnitType = (unit) => ({\n test: (v) => typeof v === \"string\" && v.endsWith(unit) && v.split(\" \").length === 1,\n parse: parseFloat,\n transform: (v) => `${v}${unit}`,\n});\nconst degrees = /*@__PURE__*/ createUnitType(\"deg\");\nconst percent = /*@__PURE__*/ createUnitType(\"%\");\nconst px = /*@__PURE__*/ createUnitType(\"px\");\nconst vh = /*@__PURE__*/ createUnitType(\"vh\");\nconst vw = /*@__PURE__*/ createUnitType(\"vw\");\nconst progressPercentage = /*@__PURE__*/ (() => ({\n ...percent,\n parse: (v) => percent.parse(v) / 100,\n transform: (v) => percent.transform(v * 100),\n}))();\n\nexport { degrees, percent, progressPercentage, px, vh, vw };\n//# sourceMappingURL=units.mjs.map\n","import { alpha } from '../numbers/index.mjs';\nimport { percent } from '../numbers/units.mjs';\nimport { sanitize } from '../utils/sanitize.mjs';\nimport { splitColor, isColorString } from './utils.mjs';\n\nconst hsla = {\n test: /*@__PURE__*/ isColorString(\"hsl\", \"hue\"),\n parse: /*@__PURE__*/ splitColor(\"hue\", \"saturation\", \"lightness\"),\n transform: ({ hue, saturation, lightness, alpha: alpha$1 = 1 }) => {\n return (\"hsla(\" +\n Math.round(hue) +\n \", \" +\n percent.transform(sanitize(saturation)) +\n \", \" +\n percent.transform(sanitize(lightness)) +\n \", \" +\n sanitize(alpha.transform(alpha$1)) +\n \")\");\n },\n};\n\nexport { hsla };\n//# sourceMappingURL=hsla.mjs.map\n","import { hex } from './hex.mjs';\nimport { hsla } from './hsla.mjs';\nimport { rgba } from './rgba.mjs';\n\nconst color = {\n test: (v) => rgba.test(v) || hex.test(v) || hsla.test(v),\n parse: (v) => {\n if (rgba.test(v)) {\n return rgba.parse(v);\n }\n else if (hsla.test(v)) {\n return hsla.parse(v);\n }\n else {\n return hex.parse(v);\n }\n },\n transform: (v) => {\n return typeof v === \"string\"\n ? v\n : v.hasOwnProperty(\"red\")\n ? rgba.transform(v)\n : hsla.transform(v);\n },\n getAnimatableNone: (v) => {\n const parsed = color.parse(v);\n parsed.alpha = 0;\n return color.transform(parsed);\n },\n};\n\nexport { color };\n//# sourceMappingURL=index.mjs.map\n","const colorRegex = /(?:#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\))/giu;\n\nexport { colorRegex };\n//# sourceMappingURL=color-regex.mjs.map\n","import { color } from '../color/index.mjs';\nimport { colorRegex } from '../utils/color-regex.mjs';\nimport { floatRegex } from '../utils/float-regex.mjs';\nimport { sanitize } from '../utils/sanitize.mjs';\n\nfunction test(v) {\n return (isNaN(v) &&\n typeof v === \"string\" &&\n (v.match(floatRegex)?.length || 0) +\n (v.match(colorRegex)?.length || 0) >\n 0);\n}\nconst NUMBER_TOKEN = \"number\";\nconst COLOR_TOKEN = \"color\";\nconst VAR_TOKEN = \"var\";\nconst VAR_FUNCTION_TOKEN = \"var(\";\nconst SPLIT_TOKEN = \"${}\";\n// this regex consists of the `singleCssVariableRegex|rgbHSLValueRegex|digitRegex`\nconst complexRegex = /var\\s*\\(\\s*--(?:[\\w-]+\\s*|[\\w-]+\\s*,(?:\\s*[^)(\\s]|\\s*\\((?:[^)(]|\\([^)(]*\\))*\\))+\\s*)\\)|#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\)|-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)/giu;\nfunction analyseComplexValue(value) {\n const originalValue = value.toString();\n const values = [];\n const indexes = {\n color: [],\n number: [],\n var: [],\n };\n const types = [];\n let i = 0;\n const tokenised = originalValue.replace(complexRegex, (parsedValue) => {\n if (color.test(parsedValue)) {\n indexes.color.push(i);\n types.push(COLOR_TOKEN);\n values.push(color.parse(parsedValue));\n }\n else if (parsedValue.startsWith(VAR_FUNCTION_TOKEN)) {\n indexes.var.push(i);\n types.push(VAR_TOKEN);\n values.push(parsedValue);\n }\n else {\n indexes.number.push(i);\n types.push(NUMBER_TOKEN);\n values.push(parseFloat(parsedValue));\n }\n ++i;\n return SPLIT_TOKEN;\n });\n const split = tokenised.split(SPLIT_TOKEN);\n return { values, split, indexes, types };\n}\nfunction parseComplexValue(v) {\n return analyseComplexValue(v).values;\n}\nfunction buildTransformer({ split, types }) {\n const numSections = split.length;\n return (v) => {\n let output = \"\";\n for (let i = 0; i < numSections; i++) {\n output += split[i];\n if (v[i] !== undefined) {\n const type = types[i];\n if (type === NUMBER_TOKEN) {\n output += sanitize(v[i]);\n }\n else if (type === COLOR_TOKEN) {\n output += color.transform(v[i]);\n }\n else {\n output += v[i];\n }\n }\n }\n return output;\n };\n}\nfunction createTransformer(source) {\n return buildTransformer(analyseComplexValue(source));\n}\nconst convertNumbersToZero = (v) => typeof v === \"number\" ? 0 : color.test(v) ? color.getAnimatableNone(v) : v;\n/**\n * Convert a parsed value to its zero equivalent, but preserve numbers\n * that act as divisors in CSS calc() expressions.\n *\n * analyseComplexValue extracts numbers from CSS strings and puts the\n * surrounding text into a `split` template array. For example:\n * \"calc(var(--gap) / 5)\" → values: [var(--gap), 5]\n * split: [\"calc(\", \" / \", \")\"]\n *\n * When building a zero-equivalent for animation, naively zeroing all\n * numbers turns the divisor into 0 → \"calc(var(--gap) / 0)\" → NaN.\n * We detect this by checking whether the text preceding a number\n * (split[i]) ends with \"/\" — the CSS calc division operator.\n */\nconst convertToZero = (value, splitBefore) => {\n if (typeof value === \"number\") {\n return splitBefore?.trim().endsWith(\"/\") ? value : 0;\n }\n return convertNumbersToZero(value);\n};\nfunction getAnimatableNone(v) {\n const info = analyseComplexValue(v);\n const transformer = buildTransformer(info);\n return transformer(info.values.map((value, i) => convertToZero(value, info.split[i])));\n}\nconst complex = {\n test,\n parse: parseComplexValue,\n createTransformer,\n getAnimatableNone,\n};\n\nexport { analyseComplexValue, complex };\n//# sourceMappingURL=index.mjs.map\n","// Adapted from https://gist.github.com/mjackson/5311256\nfunction hueToRgb(p, q, t) {\n if (t < 0)\n t += 1;\n if (t > 1)\n t -= 1;\n if (t < 1 / 6)\n return p + (q - p) * 6 * t;\n if (t < 1 / 2)\n return q;\n if (t < 2 / 3)\n return p + (q - p) * (2 / 3 - t) * 6;\n return p;\n}\nfunction hslaToRgba({ hue, saturation, lightness, alpha }) {\n hue /= 360;\n saturation /= 100;\n lightness /= 100;\n let red = 0;\n let green = 0;\n let blue = 0;\n if (!saturation) {\n red = green = blue = lightness;\n }\n else {\n const q = lightness < 0.5\n ? lightness * (1 + saturation)\n : lightness + saturation - lightness * saturation;\n const p = 2 * lightness - q;\n red = hueToRgb(p, q, hue + 1 / 3);\n green = hueToRgb(p, q, hue);\n blue = hueToRgb(p, q, hue - 1 / 3);\n }\n return {\n red: Math.round(red * 255),\n green: Math.round(green * 255),\n blue: Math.round(blue * 255),\n alpha,\n };\n}\n\nexport { hslaToRgba };\n//# sourceMappingURL=hsla-to-rgba.mjs.map\n","function mixImmediate(a, b) {\n return (p) => (p > 0 ? b : a);\n}\n\nexport { mixImmediate };\n//# sourceMappingURL=immediate.mjs.map\n","/*\n Value in range from progress\n\n Given a lower limit and an upper limit, we return the value within\n that range as expressed by progress (usually a number from 0 to 1)\n\n So progress = 0.5 would change\n\n from -------- to\n\n to\n\n from ---- to\n\n E.g. from = 10, to = 20, progress = 0.5 => 15\n\n @param [number]: Lower limit of range\n @param [number]: Upper limit of range\n @param [number]: The progress between lower and upper limits expressed 0-1\n @return [number]: Value as calculated from progress within range (not limited within range)\n*/\nconst mixNumber = (from, to, progress) => {\n return from + (to - from) * progress;\n};\n\nexport { mixNumber };\n//# sourceMappingURL=number.mjs.map\n","import { warning } from 'motion-utils';\nimport { hex } from '../../value/types/color/hex.mjs';\nimport { hsla } from '../../value/types/color/hsla.mjs';\nimport { hslaToRgba } from '../../value/types/color/hsla-to-rgba.mjs';\nimport { rgba } from '../../value/types/color/rgba.mjs';\nimport { mixImmediate } from './immediate.mjs';\nimport { mixNumber } from './number.mjs';\n\n// Linear color space blending\n// Explained https://www.youtube.com/watch?v=LKnqECcg6Gw\n// Demonstrated http://codepen.io/osublake/pen/xGVVaN\nconst mixLinearColor = (from, to, v) => {\n const fromExpo = from * from;\n const expo = v * (to * to - fromExpo) + fromExpo;\n return expo < 0 ? 0 : Math.sqrt(expo);\n};\nconst colorTypes = [hex, rgba, hsla];\nconst getColorType = (v) => colorTypes.find((type) => type.test(v));\nfunction asRGBA(color) {\n const type = getColorType(color);\n warning(Boolean(type), `'${color}' is not an animatable color. Use the equivalent color code instead.`, \"color-not-animatable\");\n if (!Boolean(type))\n return false;\n let model = type.parse(color);\n if (type === hsla) {\n // TODO Remove this cast - needed since Motion's stricter typing\n model = hslaToRgba(model);\n }\n return model;\n}\nconst mixColor = (from, to) => {\n const fromRGBA = asRGBA(from);\n const toRGBA = asRGBA(to);\n if (!fromRGBA || !toRGBA) {\n return mixImmediate(from, to);\n }\n const blended = { ...fromRGBA };\n return (v) => {\n blended.red = mixLinearColor(fromRGBA.red, toRGBA.red, v);\n blended.green = mixLinearColor(fromRGBA.green, toRGBA.green, v);\n blended.blue = mixLinearColor(fromRGBA.blue, toRGBA.blue, v);\n blended.alpha = mixNumber(fromRGBA.alpha, toRGBA.alpha, v);\n return rgba.transform(blended);\n };\n};\n\nexport { mixColor, mixLinearColor };\n//# sourceMappingURL=color.mjs.map\n","const invisibleValues = new Set([\"none\", \"hidden\"]);\n/**\n * Returns a function that, when provided a progress value between 0 and 1,\n * will return the \"none\" or \"hidden\" string only when the progress is that of\n * the origin or target.\n */\nfunction mixVisibility(origin, target) {\n if (invisibleValues.has(origin)) {\n return (p) => (p <= 0 ? origin : target);\n }\n else {\n return (p) => (p >= 1 ? target : origin);\n }\n}\n\nexport { invisibleValues, mixVisibility };\n//# sourceMappingURL=visibility.mjs.map\n","import { pipe, warning } from 'motion-utils';\nimport { isCSSVariableToken } from '../../animation/utils/is-css-variable.mjs';\nimport { color } from '../../value/types/color/index.mjs';\nimport { complex, analyseComplexValue } from '../../value/types/complex/index.mjs';\nimport { mixColor } from './color.mjs';\nimport { mixImmediate } from './immediate.mjs';\nimport { mixNumber as mixNumber$1 } from './number.mjs';\nimport { invisibleValues, mixVisibility } from './visibility.mjs';\n\nfunction mixNumber(a, b) {\n return (p) => mixNumber$1(a, b, p);\n}\nfunction getMixer(a) {\n if (typeof a === \"number\") {\n return mixNumber;\n }\n else if (typeof a === \"string\") {\n return isCSSVariableToken(a)\n ? mixImmediate\n : color.test(a)\n ? mixColor\n : mixComplex;\n }\n else if (Array.isArray(a)) {\n return mixArray;\n }\n else if (typeof a === \"object\") {\n return color.test(a) ? mixColor : mixObject;\n }\n return mixImmediate;\n}\nfunction mixArray(a, b) {\n const output = [...a];\n const numValues = output.length;\n const blendValue = a.map((v, i) => getMixer(v)(v, b[i]));\n return (p) => {\n for (let i = 0; i < numValues; i++) {\n output[i] = blendValue[i](p);\n }\n return output;\n };\n}\nfunction mixObject(a, b) {\n const output = { ...a, ...b };\n const blendValue = {};\n for (const key in output) {\n if (a[key] !== undefined && b[key] !== undefined) {\n blendValue[key] = getMixer(a[key])(a[key], b[key]);\n }\n }\n return (v) => {\n for (const key in blendValue) {\n output[key] = blendValue[key](v);\n }\n return output;\n };\n}\nfunction matchOrder(origin, target) {\n const orderedOrigin = [];\n const pointers = { color: 0, var: 0, number: 0 };\n for (let i = 0; i < target.values.length; i++) {\n const type = target.types[i];\n const originIndex = origin.indexes[type][pointers[type]];\n const originValue = origin.values[originIndex] ?? 0;\n orderedOrigin[i] = originValue;\n pointers[type]++;\n }\n return orderedOrigin;\n}\nconst mixComplex = (origin, target) => {\n const template = complex.createTransformer(target);\n const originStats = analyseComplexValue(origin);\n const targetStats = analyseComplexValue(target);\n const canInterpolate = originStats.indexes.var.length === targetStats.indexes.var.length &&\n originStats.indexes.color.length === targetStats.indexes.color.length &&\n originStats.indexes.number.length >= targetStats.indexes.number.length;\n if (canInterpolate) {\n if ((invisibleValues.has(origin) &&\n !targetStats.values.length) ||\n (invisibleValues.has(target) &&\n !originStats.values.length)) {\n return mixVisibility(origin, target);\n }\n return pipe(mixArray(matchOrder(originStats, targetStats), targetStats.values), template);\n }\n else {\n warning(true, `Complex values '${origin}' and '${target}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`, \"complex-values-different\");\n return mixImmediate(origin, target);\n }\n};\n\nexport { getMixer, mixArray, mixComplex, mixObject };\n//# sourceMappingURL=complex.mjs.map\n","import { getMixer } from './complex.mjs';\nimport { mixNumber } from './number.mjs';\n\nfunction mix(from, to, p) {\n if (typeof from === \"number\" &&\n typeof to === \"number\" &&\n typeof p === \"number\") {\n return mixNumber(from, to, p);\n }\n const mixer = getMixer(from);\n return mixer(from, to);\n}\n\nexport { mix };\n//# sourceMappingURL=index.mjs.map\n","import { time } from '../../frameloop/sync-time.mjs';\nimport { frameData, cancelFrame, frame } from '../../frameloop/frame.mjs';\n\nconst frameloopDriver = (update) => {\n const passTimestamp = ({ timestamp }) => update(timestamp);\n return {\n start: (keepAlive = true) => frame.update(passTimestamp, keepAlive),\n stop: () => cancelFrame(passTimestamp),\n /**\n * If we're processing this frame we can use the\n * framelocked timestamp to keep things in sync.\n */\n now: () => (frameData.isProcessing ? frameData.timestamp : time.now()),\n };\n};\n\nexport { frameloopDriver };\n//# sourceMappingURL=frame.mjs.map\n","const generateLinearEasing = (easing, duration, // as milliseconds\nresolution = 10 // as milliseconds\n) => {\n let points = \"\";\n const numPoints = Math.max(Math.round(duration / resolution), 2);\n for (let i = 0; i < numPoints; i++) {\n points += Math.round(easing(i / (numPoints - 1)) * 10000) / 10000 + \", \";\n }\n return `linear(${points.substring(0, points.length - 2)})`;\n};\n\nexport { generateLinearEasing };\n//# sourceMappingURL=linear.mjs.map\n","/**\n * Implement a practical max duration for keyframe generation\n * to prevent infinite loops\n */\nconst maxGeneratorDuration = 20000;\nfunction calcGeneratorDuration(generator) {\n let duration = 0;\n const timeStep = 50;\n let state = generator.next(duration);\n while (!state.done && duration < maxGeneratorDuration) {\n duration += timeStep;\n state = generator.next(duration);\n }\n return duration >= maxGeneratorDuration ? Infinity : duration;\n}\n\nexport { calcGeneratorDuration, maxGeneratorDuration };\n//# sourceMappingURL=calc-duration.mjs.map\n","import { millisecondsToSeconds, clamp, secondsToMilliseconds, warning } from 'motion-utils';\nimport { generateLinearEasing } from '../waapi/utils/linear.mjs';\nimport { calcGeneratorDuration, maxGeneratorDuration } from './utils/calc-duration.mjs';\nimport { createGeneratorEasing } from './utils/create-generator-easing.mjs';\n\nconst springDefaults = {\n // Default spring physics\n stiffness: 100,\n damping: 10,\n mass: 1.0,\n velocity: 0.0,\n // Default duration/bounce-based options\n duration: 800, // in ms\n bounce: 0.3,\n visualDuration: 0.3, // in seconds\n // Rest thresholds\n restSpeed: {\n granular: 0.01,\n default: 2,\n },\n restDelta: {\n granular: 0.005,\n default: 0.5,\n },\n // Limits\n minDuration: 0.01, // in seconds\n maxDuration: 10.0, // in seconds\n minDamping: 0.05,\n maxDamping: 1,\n};\nfunction calcAngularFreq(undampedFreq, dampingRatio) {\n return undampedFreq * Math.sqrt(1 - dampingRatio * dampingRatio);\n}\nconst rootIterations = 12;\nfunction approximateRoot(envelope, derivative, initialGuess) {\n let result = initialGuess;\n for (let i = 1; i < rootIterations; i++) {\n result = result - envelope(result) / derivative(result);\n }\n return result;\n}\n/**\n * This is ported from the Framer implementation of duration-based spring resolution.\n */\nconst safeMin = 0.001;\nfunction findSpring({ duration = springDefaults.duration, bounce = springDefaults.bounce, velocity = springDefaults.velocity, mass = springDefaults.mass, }) {\n let envelope;\n let derivative;\n warning(duration <= secondsToMilliseconds(springDefaults.maxDuration), \"Spring duration must be 10 seconds or less\", \"spring-duration-limit\");\n let dampingRatio = 1 - bounce;\n /**\n * Restrict dampingRatio and duration to within acceptable ranges.\n */\n dampingRatio = clamp(springDefaults.minDamping, springDefaults.maxDamping, dampingRatio);\n duration = clamp(springDefaults.minDuration, springDefaults.maxDuration, millisecondsToSeconds(duration));\n if (dampingRatio < 1) {\n /**\n * Underdamped spring\n */\n envelope = (undampedFreq) => {\n const exponentialDecay = undampedFreq * dampingRatio;\n const delta = exponentialDecay * duration;\n const a = exponentialDecay - velocity;\n const b = calcAngularFreq(undampedFreq, dampingRatio);\n const c = Math.exp(-delta);\n return safeMin - (a / b) * c;\n };\n derivative = (undampedFreq) => {\n const exponentialDecay = undampedFreq * dampingRatio;\n const delta = exponentialDecay * duration;\n const d = delta * velocity + velocity;\n const e = Math.pow(dampingRatio, 2) * Math.pow(undampedFreq, 2) * duration;\n const f = Math.exp(-delta);\n const g = calcAngularFreq(Math.pow(undampedFreq, 2), dampingRatio);\n const factor = -envelope(undampedFreq) + safeMin > 0 ? -1 : 1;\n return (factor * ((d - e) * f)) / g;\n };\n }\n else {\n /**\n * Critically-damped spring\n */\n envelope = (undampedFreq) => {\n const a = Math.exp(-undampedFreq * duration);\n const b = (undampedFreq - velocity) * duration + 1;\n return -safeMin + a * b;\n };\n derivative = (undampedFreq) => {\n const a = Math.exp(-undampedFreq * duration);\n const b = (velocity - undampedFreq) * (duration * duration);\n return a * b;\n };\n }\n const initialGuess = 5 / duration;\n const undampedFreq = approximateRoot(envelope, derivative, initialGuess);\n duration = secondsToMilliseconds(duration);\n if (isNaN(undampedFreq)) {\n return {\n stiffness: springDefaults.stiffness,\n damping: springDefaults.damping,\n duration,\n };\n }\n else {\n const stiffness = Math.pow(undampedFreq, 2) * mass;\n return {\n stiffness,\n damping: dampingRatio * 2 * Math.sqrt(mass * stiffness),\n duration,\n };\n }\n}\nconst durationKeys = [\"duration\", \"bounce\"];\nconst physicsKeys = [\"stiffness\", \"damping\", \"mass\"];\nfunction isSpringType(options, keys) {\n return keys.some((key) => options[key] !== undefined);\n}\nfunction getSpringOptions(options) {\n let springOptions = {\n velocity: springDefaults.velocity,\n stiffness: springDefaults.stiffness,\n damping: springDefaults.damping,\n mass: springDefaults.mass,\n isResolvedFromDuration: false,\n ...options,\n };\n // stiffness/damping/mass overrides duration/bounce\n if (!isSpringType(options, physicsKeys) &&\n isSpringType(options, durationKeys)) {\n // Time-defined springs should ignore inherited velocity.\n // Velocity from interrupted animations can cause findSpring()\n // to compute wildly different spring parameters, leading to\n // massive oscillation on small-range animations.\n springOptions.velocity = 0;\n if (options.visualDuration) {\n const visualDuration = options.visualDuration;\n const root = (2 * Math.PI) / (visualDuration * 1.2);\n const stiffness = root * root;\n const damping = 2 *\n clamp(0.05, 1, 1 - (options.bounce || 0)) *\n Math.sqrt(stiffness);\n springOptions = {\n ...springOptions,\n mass: springDefaults.mass,\n stiffness,\n damping,\n };\n }\n else {\n const derived = findSpring({ ...options, velocity: 0 });\n springOptions = {\n ...springOptions,\n ...derived,\n mass: springDefaults.mass,\n };\n springOptions.isResolvedFromDuration = true;\n }\n }\n return springOptions;\n}\nfunction spring(optionsOrVisualDuration = springDefaults.visualDuration, bounce = springDefaults.bounce) {\n const options = typeof optionsOrVisualDuration !== \"object\"\n ? {\n visualDuration: optionsOrVisualDuration,\n keyframes: [0, 1],\n bounce,\n }\n : optionsOrVisualDuration;\n let { restSpeed, restDelta } = options;\n const origin = options.keyframes[0];\n const target = options.keyframes[options.keyframes.length - 1];\n /**\n * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator\n * to reduce GC during animation.\n */\n const state = { done: false, value: origin };\n const { stiffness, damping, mass, duration, velocity, isResolvedFromDuration, } = getSpringOptions({\n ...options,\n velocity: -millisecondsToSeconds(options.velocity || 0),\n });\n const initialVelocity = velocity || 0.0;\n const dampingRatio = damping / (2 * Math.sqrt(stiffness * mass));\n const initialDelta = target - origin;\n const undampedAngularFreq = millisecondsToSeconds(Math.sqrt(stiffness / mass));\n /**\n * If we're working on a granular scale, use smaller defaults for determining\n * when the spring is finished.\n *\n * These defaults have been selected emprically based on what strikes a good\n * ratio between feeling good and finishing as soon as changes are imperceptible.\n */\n const isGranularScale = Math.abs(initialDelta) < 5;\n restSpeed || (restSpeed = isGranularScale\n ? springDefaults.restSpeed.granular\n : springDefaults.restSpeed.default);\n restDelta || (restDelta = isGranularScale\n ? springDefaults.restDelta.granular\n : springDefaults.restDelta.default);\n let resolveSpring;\n let resolveVelocity;\n // Underdamped coefficients, hoisted for use in the inlined next() hot path\n let angularFreq;\n let A;\n let sinCoeff;\n let cosCoeff;\n if (dampingRatio < 1) {\n angularFreq = calcAngularFreq(undampedAngularFreq, dampingRatio);\n A =\n (initialVelocity +\n dampingRatio * undampedAngularFreq * initialDelta) /\n angularFreq;\n // Underdamped spring\n resolveSpring = (t) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);\n return (target -\n envelope *\n (A * Math.sin(angularFreq * t) +\n initialDelta * Math.cos(angularFreq * t)));\n };\n // Analytical derivative of underdamped spring (px/ms)\n sinCoeff =\n dampingRatio * undampedAngularFreq * A + initialDelta * angularFreq;\n cosCoeff =\n dampingRatio * undampedAngularFreq * initialDelta - A * angularFreq;\n resolveVelocity = (t) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);\n return envelope *\n (sinCoeff * Math.sin(angularFreq * t) +\n cosCoeff * Math.cos(angularFreq * t));\n };\n }\n else if (dampingRatio === 1) {\n // Critically damped spring\n resolveSpring = (t) => target -\n Math.exp(-undampedAngularFreq * t) *\n (initialDelta +\n (initialVelocity + undampedAngularFreq * initialDelta) * t);\n // Analytical derivative of critically damped spring (px/ms)\n const C = initialVelocity + undampedAngularFreq * initialDelta;\n resolveVelocity = (t) => Math.exp(-undampedAngularFreq * t) *\n (undampedAngularFreq * C * t - initialVelocity);\n }\n else {\n // Overdamped spring\n const dampedAngularFreq = undampedAngularFreq * Math.sqrt(dampingRatio * dampingRatio - 1);\n resolveSpring = (t) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);\n // When performing sinh or cosh values can hit Infinity so we cap them here\n const freqForT = Math.min(dampedAngularFreq * t, 300);\n return (target -\n (envelope *\n ((initialVelocity +\n dampingRatio * undampedAngularFreq * initialDelta) *\n Math.sinh(freqForT) +\n dampedAngularFreq *\n initialDelta *\n Math.cosh(freqForT))) /\n dampedAngularFreq);\n };\n // Analytical derivative of overdamped spring (px/ms)\n const P = (initialVelocity +\n dampingRatio * undampedAngularFreq * initialDelta) /\n dampedAngularFreq;\n const sinhCoeff = dampingRatio * undampedAngularFreq * P - initialDelta * dampedAngularFreq;\n const coshCoeff = dampingRatio * undampedAngularFreq * initialDelta - P * dampedAngularFreq;\n resolveVelocity = (t) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);\n const freqForT = Math.min(dampedAngularFreq * t, 300);\n return envelope *\n (sinhCoeff * Math.sinh(freqForT) +\n coshCoeff * Math.cosh(freqForT));\n };\n }\n const generator = {\n calculatedDuration: isResolvedFromDuration ? duration || null : null,\n velocity: (t) => secondsToMilliseconds(resolveVelocity(t)),\n next: (t) => {\n /**\n * For underdamped physics springs we need both position and\n * velocity each tick. Compute shared trig values once to avoid\n * duplicate Math.exp/sin/cos calls on the hot path.\n */\n if (!isResolvedFromDuration && dampingRatio < 1) {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);\n const sin = Math.sin(angularFreq * t);\n const cos = Math.cos(angularFreq * t);\n const current = target -\n envelope *\n (A * sin + initialDelta * cos);\n const currentVelocity = secondsToMilliseconds(envelope *\n (sinCoeff * sin + cosCoeff * cos));\n state.done =\n Math.abs(currentVelocity) <= restSpeed &&\n Math.abs(target - current) <= restDelta;\n state.value = state.done ? target : current;\n return state;\n }\n const current = resolveSpring(t);\n if (!isResolvedFromDuration) {\n const currentVelocity = secondsToMilliseconds(resolveVelocity(t));\n state.done =\n Math.abs(currentVelocity) <= restSpeed &&\n Math.abs(target - current) <= restDelta;\n }\n else {\n state.done = t >= duration;\n }\n state.value = state.done ? target : current;\n return state;\n },\n toString: () => {\n const calculatedDuration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration);\n const easing = generateLinearEasing((progress) => generator.next(calculatedDuration * progress).value, calculatedDuration, 30);\n return calculatedDuration + \"ms \" + easing;\n },\n toTransition: () => { },\n };\n return generator;\n}\nspring.applyToOptions = (options) => {\n const generatorOptions = createGeneratorEasing(options, 100, spring);\n options.ease = generatorOptions.ease;\n options.duration = secondsToMilliseconds(generatorOptions.duration);\n options.type = \"keyframes\";\n return options;\n};\n\nexport { spring };\n//# sourceMappingURL=spring.mjs.map\n","import { millisecondsToSeconds } from 'motion-utils';\nimport { calcGeneratorDuration, maxGeneratorDuration } from './calc-duration.mjs';\n\n/**\n * Create a progress => progress easing function from a generator.\n */\nfunction createGeneratorEasing(options, scale = 100, createGenerator) {\n const generator = createGenerator({ ...options, keyframes: [0, scale] });\n const duration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration);\n return {\n type: \"keyframes\",\n ease: (progress) => {\n return generator.next(duration * progress).value / scale;\n },\n duration: millisecondsToSeconds(duration),\n };\n}\n\nexport { createGeneratorEasing };\n//# sourceMappingURL=create-generator-easing.mjs.map\n","import { velocityPerSecond } from 'motion-utils';\n\nconst velocitySampleDuration = 5; // ms\nfunction getGeneratorVelocity(resolveValue, t, current) {\n const prevT = Math.max(t - velocitySampleDuration, 0);\n return velocityPerSecond(current - resolveValue(prevT), t - prevT);\n}\n\nexport { getGeneratorVelocity };\n//# sourceMappingURL=velocity.mjs.map\n","import { spring } from './spring.mjs';\nimport { getGeneratorVelocity } from './utils/velocity.mjs';\n\nfunction inertia({ keyframes, velocity = 0.0, power = 0.8, timeConstant = 325, bounceDamping = 10, bounceStiffness = 500, modifyTarget, min, max, restDelta = 0.5, restSpeed, }) {\n const origin = keyframes[0];\n const state = {\n done: false,\n value: origin,\n };\n const isOutOfBounds = (v) => (min !== undefined && v < min) || (max !== undefined && v > max);\n const nearestBoundary = (v) => {\n if (min === undefined)\n return max;\n if (max === undefined)\n return min;\n return Math.abs(min - v) < Math.abs(max - v) ? min : max;\n };\n let amplitude = power * velocity;\n const ideal = origin + amplitude;\n const target = modifyTarget === undefined ? ideal : modifyTarget(ideal);\n /**\n * If the target has changed we need to re-calculate the amplitude, otherwise\n * the animation will start from the wrong position.\n */\n if (target !== ideal)\n amplitude = target - origin;\n const calcDelta = (t) => -amplitude * Math.exp(-t / timeConstant);\n const calcLatest = (t) => target + calcDelta(t);\n const applyFriction = (t) => {\n const delta = calcDelta(t);\n const latest = calcLatest(t);\n state.done = Math.abs(delta) <= restDelta;\n state.value = state.done ? target : latest;\n };\n /**\n * Ideally this would resolve for t in a stateless way, we could\n * do that by always precalculating the animation but as we know\n * this will be done anyway we can assume that spring will\n * be discovered during that.\n */\n let timeReachedBoundary;\n let spring$1;\n const checkCatchBoundary = (t) => {\n if (!isOutOfBounds(state.value))\n return;\n timeReachedBoundary = t;\n spring$1 = spring({\n keyframes: [state.value, nearestBoundary(state.value)],\n velocity: getGeneratorVelocity(calcLatest, t, state.value), // TODO: This should be passing * 1000\n damping: bounceDamping,\n stiffness: bounceStiffness,\n restDelta,\n restSpeed,\n });\n };\n checkCatchBoundary(0);\n return {\n calculatedDuration: null,\n next: (t) => {\n /**\n * We need to resolve the friction to figure out if we need a\n * spring but we don't want to do this twice per frame. So here\n * we flag if we updated for this frame and later if we did\n * we can skip doing it again.\n */\n let hasUpdatedFrame = false;\n if (!spring$1 && timeReachedBoundary === undefined) {\n hasUpdatedFrame = true;\n applyFriction(t);\n checkCatchBoundary(t);\n }\n /**\n * If we have a spring and the provided t is beyond the moment the friction\n * animation crossed the min/max boundary, use the spring.\n */\n if (timeReachedBoundary !== undefined && t >= timeReachedBoundary) {\n return spring$1.next(t - timeReachedBoundary);\n }\n else {\n !hasUpdatedFrame && applyFriction(t);\n return state;\n }\n },\n };\n}\n\nexport { inertia };\n//# sourceMappingURL=inertia.mjs.map\n","import { invariant, clamp, MotionGlobalConfig, noop, pipe, progress } from 'motion-utils';\nimport { mix } from './mix/index.mjs';\n\nfunction createMixers(output, ease, customMixer) {\n const mixers = [];\n const mixerFactory = customMixer || MotionGlobalConfig.mix || mix;\n const numMixers = output.length - 1;\n for (let i = 0; i < numMixers; i++) {\n let mixer = mixerFactory(output[i], output[i + 1]);\n if (ease) {\n const easingFunction = Array.isArray(ease) ? ease[i] || noop : ease;\n mixer = pipe(easingFunction, mixer);\n }\n mixers.push(mixer);\n }\n return mixers;\n}\n/**\n * Create a function that maps from a numerical input array to a generic output array.\n *\n * Accepts:\n * - Numbers\n * - Colors (hex, hsl, hsla, rgb, rgba)\n * - Complex (combinations of one or more numbers or strings)\n *\n * ```jsx\n * const mixColor = interpolate([0, 1], ['#fff', '#000'])\n *\n * mixColor(0.5) // 'rgba(128, 128, 128, 1)'\n * ```\n *\n * TODO Revisit this approach once we've moved to data models for values,\n * probably not needed to pregenerate mixer functions.\n *\n * @public\n */\nfunction interpolate(input, output, { clamp: isClamp = true, ease, mixer } = {}) {\n const inputLength = input.length;\n invariant(inputLength === output.length, \"Both input and output ranges must be the same length\", \"range-length\");\n /**\n * If we're only provided a single input, we can just make a function\n * that returns the output.\n */\n if (inputLength === 1)\n return () => output[0];\n if (inputLength === 2 && output[0] === output[1])\n return () => output[1];\n const isZeroDeltaRange = input[0] === input[1];\n // If input runs highest -> lowest, reverse both arrays\n if (input[0] > input[inputLength - 1]) {\n input = [...input].reverse();\n output = [...output].reverse();\n }\n const mixers = createMixers(output, ease, mixer);\n const numMixers = mixers.length;\n const interpolator = (v) => {\n if (isZeroDeltaRange && v < input[0])\n return output[0];\n let i = 0;\n if (numMixers > 1) {\n for (; i < input.length - 2; i++) {\n if (v < input[i + 1])\n break;\n }\n }\n const progressInRange = progress(input[i], input[i + 1], v);\n return mixers[i](progressInRange);\n };\n return isClamp\n ? (v) => interpolator(clamp(input[0], input[inputLength - 1], v))\n : interpolator;\n}\n\nexport { interpolate };\n//# sourceMappingURL=interpolate.mjs.map\n","import { fillOffset } from './fill.mjs';\n\nfunction defaultOffset(arr) {\n const offset = [0];\n fillOffset(offset, arr.length - 1);\n return offset;\n}\n\nexport { defaultOffset };\n//# sourceMappingURL=default.mjs.map\n","import { progress } from 'motion-utils';\nimport { mixNumber } from '../../../utils/mix/number.mjs';\n\nfunction fillOffset(offset, remaining) {\n const min = offset[offset.length - 1];\n for (let i = 1; i <= remaining; i++) {\n const offsetProgress = progress(0, remaining, i);\n offset.push(mixNumber(min, 1, offsetProgress));\n }\n}\n\nexport { fillOffset };\n//# sourceMappingURL=fill.mjs.map\n","import { easeInOut, isEasingArray, easingDefinitionToFunction } from 'motion-utils';\nimport { interpolate } from '../../utils/interpolate.mjs';\nimport { defaultOffset } from '../keyframes/offsets/default.mjs';\nimport { convertOffsetToTimes } from '../keyframes/offsets/time.mjs';\n\nfunction defaultEasing(values, easing) {\n return values.map(() => easing || easeInOut).splice(0, values.length - 1);\n}\nfunction keyframes({ duration = 300, keyframes: keyframeValues, times, ease = \"easeInOut\", }) {\n /**\n * Easing functions can be externally defined as strings. Here we convert them\n * into actual functions.\n */\n const easingFunctions = isEasingArray(ease)\n ? ease.map(easingDefinitionToFunction)\n : easingDefinitionToFunction(ease);\n /**\n * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator\n * to reduce GC during animation.\n */\n const state = {\n done: false,\n value: keyframeValues[0],\n };\n /**\n * Create a times array based on the provided 0-1 offsets\n */\n const absoluteTimes = convertOffsetToTimes(\n // Only use the provided offsets if they're the correct length\n // TODO Maybe we should warn here if there's a length mismatch\n times && times.length === keyframeValues.length\n ? times\n : defaultOffset(keyframeValues), duration);\n const mapTimeToKeyframe = interpolate(absoluteTimes, keyframeValues, {\n ease: Array.isArray(easingFunctions)\n ? easingFunctions\n : defaultEasing(keyframeValues, easingFunctions),\n });\n return {\n calculatedDuration: duration,\n next: (t) => {\n state.value = mapTimeToKeyframe(t);\n state.done = t >= duration;\n return state;\n },\n };\n}\n\nexport { defaultEasing, keyframes };\n//# sourceMappingURL=keyframes.mjs.map\n","/*#__NO_SIDE_EFFECTS__*/\nconst isEasingArray = (ease) => {\n return Array.isArray(ease) && typeof ease[0] !== \"number\";\n};\n\nexport { isEasingArray };\n//# sourceMappingURL=is-easing-array.mjs.map\n","function convertOffsetToTimes(offset, duration) {\n return offset.map((o) => o * duration);\n}\n\nexport { convertOffsetToTimes };\n//# sourceMappingURL=time.mjs.map\n","const isNotNull = (value) => value !== null;\nfunction getFinalKeyframe(keyframes, { repeat, repeatType = \"loop\" }, finalKeyframe, speed = 1) {\n const resolvedKeyframes = keyframes.filter(isNotNull);\n const useFirstKeyframe = speed < 0 || (repeat && repeatType !== \"loop\" && repeat % 2 === 1);\n const index = useFirstKeyframe ? 0 : resolvedKeyframes.length - 1;\n return !index || finalKeyframe === undefined\n ? resolvedKeyframes[index]\n : finalKeyframe;\n}\n\nexport { getFinalKeyframe };\n//# sourceMappingURL=get-final.mjs.map\n","import { inertia } from '../generators/inertia.mjs';\nimport { keyframes } from '../generators/keyframes.mjs';\nimport { spring } from '../generators/spring.mjs';\n\nconst transitionTypeMap = {\n decay: inertia,\n inertia,\n tween: keyframes,\n keyframes: keyframes,\n spring,\n};\nfunction replaceTransitionType(transition) {\n if (typeof transition.type === \"string\") {\n transition.type = transitionTypeMap[transition.type];\n }\n}\n\nexport { replaceTransitionType };\n//# sourceMappingURL=replace-transition-type.mjs.map\n","class WithPromise {\n constructor() {\n this.updateFinished();\n }\n get finished() {\n return this._finished;\n }\n updateFinished() {\n this._finished = new Promise((resolve) => {\n this.resolve = resolve;\n });\n }\n notifyFinished() {\n this.resolve();\n }\n /**\n * Allows the animation to be awaited.\n *\n * @deprecated Use `finished` instead.\n */\n then(onResolve, onReject) {\n return this.finished.then(onResolve, onReject);\n }\n}\n\nexport { WithPromise };\n//# sourceMappingURL=WithPromise.mjs.map\n","import { invariant, pipe, clamp, millisecondsToSeconds, secondsToMilliseconds } from 'motion-utils';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { mix } from '../utils/mix/index.mjs';\nimport { frameloopDriver } from './drivers/frame.mjs';\nimport { inertia } from './generators/inertia.mjs';\nimport { keyframes } from './generators/keyframes.mjs';\nimport { calcGeneratorDuration } from './generators/utils/calc-duration.mjs';\nimport { getGeneratorVelocity } from './generators/utils/velocity.mjs';\nimport { getFinalKeyframe } from './keyframes/get-final.mjs';\nimport { replaceTransitionType } from './utils/replace-transition-type.mjs';\nimport { WithPromise } from './utils/WithPromise.mjs';\n\nconst percentToProgress = (percent) => percent / 100;\nclass JSAnimation extends WithPromise {\n constructor(options) {\n super();\n this.state = \"idle\";\n this.startTime = null;\n this.isStopped = false;\n /**\n * The current time of the animation.\n */\n this.currentTime = 0;\n /**\n * The time at which the animation was paused.\n */\n this.holdTime = null;\n /**\n * Playback speed as a factor. 0 would be stopped, -1 reverse and 2 double speed.\n */\n this.playbackSpeed = 1;\n /**\n * Reusable state object for the delay phase to avoid\n * allocating a new object every frame.\n */\n this.delayState = {\n done: false,\n value: undefined,\n };\n /**\n * This method is bound to the instance to fix a pattern where\n * animation.stop is returned as a reference from a useEffect.\n */\n this.stop = () => {\n const { motionValue } = this.options;\n if (motionValue && motionValue.updatedAt !== time.now()) {\n this.tick(time.now());\n }\n this.isStopped = true;\n if (this.state === \"idle\")\n return;\n this.teardown();\n this.options.onStop?.();\n };\n this.options = options;\n this.initAnimation();\n this.play();\n if (options.autoplay === false)\n this.pause();\n }\n initAnimation() {\n const { options } = this;\n replaceTransitionType(options);\n const { type = keyframes, repeat = 0, repeatDelay = 0, repeatType, velocity = 0, } = options;\n let { keyframes: keyframes$1 } = options;\n const generatorFactory = type || keyframes;\n if (process.env.NODE_ENV !== \"production\" &&\n generatorFactory !== keyframes) {\n invariant(keyframes$1.length <= 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${keyframes$1}`, \"spring-two-frames\");\n }\n if (generatorFactory !== keyframes &&\n typeof keyframes$1[0] !== \"number\") {\n this.mixKeyframes = pipe(percentToProgress, mix(keyframes$1[0], keyframes$1[1]));\n keyframes$1 = [0, 100];\n }\n const generator = generatorFactory({ ...options, keyframes: keyframes$1 });\n /**\n * If we have a mirror repeat type we need to create a second generator that outputs the\n * mirrored (not reversed) animation and later ping pong between the two generators.\n */\n if (repeatType === \"mirror\") {\n this.mirroredGenerator = generatorFactory({\n ...options,\n keyframes: [...keyframes$1].reverse(),\n velocity: -velocity,\n });\n }\n /**\n * If duration is undefined and we have repeat options,\n * we need to calculate a duration from the generator.\n *\n * We set it to the generator itself to cache the duration.\n * Any timeline resolver will need to have already precalculated\n * the duration by this step.\n */\n if (generator.calculatedDuration === null) {\n generator.calculatedDuration = calcGeneratorDuration(generator);\n }\n const { calculatedDuration } = generator;\n this.calculatedDuration = calculatedDuration;\n this.resolvedDuration = calculatedDuration + repeatDelay;\n this.totalDuration = this.resolvedDuration * (repeat + 1) - repeatDelay;\n this.generator = generator;\n }\n updateTime(timestamp) {\n const animationTime = Math.round(timestamp - this.startTime) * this.playbackSpeed;\n // Update currentTime\n if (this.holdTime !== null) {\n this.currentTime = this.holdTime;\n }\n else {\n // Rounding the time because floating point arithmetic is not always accurate, e.g. 3000.367 - 1000.367 =\n // 2000.0000000000002. This is a problem when we are comparing the currentTime with the duration, for\n // example.\n this.currentTime = animationTime;\n }\n }\n tick(timestamp, sample = false) {\n const { generator, totalDuration, mixKeyframes, mirroredGenerator, resolvedDuration, calculatedDuration, } = this;\n if (this.startTime === null)\n return generator.next(0);\n const { delay = 0, keyframes, repeat, repeatType, repeatDelay, type, onUpdate, finalKeyframe, } = this.options;\n /**\n * requestAnimationFrame timestamps can come through as lower than\n * the startTime as set by performance.now(). Here we prevent this,\n * though in the future it could be possible to make setting startTime\n * a pending operation that gets resolved here.\n */\n if (this.speed > 0) {\n this.startTime = Math.min(this.startTime, timestamp);\n }\n else if (this.speed < 0) {\n this.startTime = Math.min(timestamp - totalDuration / this.speed, this.startTime);\n }\n if (sample) {\n this.currentTime = timestamp;\n }\n else {\n this.updateTime(timestamp);\n }\n // Rebase on delay\n const timeWithoutDelay = this.currentTime - delay * (this.playbackSpeed >= 0 ? 1 : -1);\n const isInDelayPhase = this.playbackSpeed >= 0\n ? timeWithoutDelay < 0\n : timeWithoutDelay > totalDuration;\n this.currentTime = Math.max(timeWithoutDelay, 0);\n // If this animation has finished, set the current time to the total duration.\n if (this.state === \"finished\" && this.holdTime === null) {\n this.currentTime = totalDuration;\n }\n let elapsed = this.currentTime;\n let frameGenerator = generator;\n if (repeat) {\n /**\n * Get the current progress (0-1) of the animation. If t is >\n * than duration we'll get values like 2.5 (midway through the\n * third iteration)\n */\n const progress = Math.min(this.currentTime, totalDuration) / resolvedDuration;\n /**\n * Get the current iteration (0 indexed). For instance the floor of\n * 2.5 is 2.\n */\n let currentIteration = Math.floor(progress);\n /**\n * Get the current progress of the iteration by taking the remainder\n * so 2.5 is 0.5 through iteration 2\n */\n let iterationProgress = progress % 1.0;\n /**\n * If iteration progress is 1 we count that as the end\n * of the previous iteration.\n */\n if (!iterationProgress && progress >= 1) {\n iterationProgress = 1;\n }\n iterationProgress === 1 && currentIteration--;\n currentIteration = Math.min(currentIteration, repeat + 1);\n /**\n * Reverse progress if we're not running in \"normal\" direction\n */\n const isOddIteration = Boolean(currentIteration % 2);\n if (isOddIteration) {\n if (repeatType === \"reverse\") {\n iterationProgress = 1 - iterationProgress;\n if (repeatDelay) {\n iterationProgress -= repeatDelay / resolvedDuration;\n }\n }\n else if (repeatType === \"mirror\") {\n frameGenerator = mirroredGenerator;\n }\n }\n elapsed = clamp(0, 1, iterationProgress) * resolvedDuration;\n }\n /**\n * If we're in negative time, set state as the initial keyframe.\n * This prevents delay: x, duration: 0 animations from finishing\n * instantly.\n */\n let state;\n if (isInDelayPhase) {\n this.delayState.value = keyframes[0];\n state = this.delayState;\n }\n else {\n state = frameGenerator.next(elapsed);\n }\n if (mixKeyframes && !isInDelayPhase) {\n state.value = mixKeyframes(state.value);\n }\n let { done } = state;\n if (!isInDelayPhase && calculatedDuration !== null) {\n done =\n this.playbackSpeed >= 0\n ? this.currentTime >= totalDuration\n : this.currentTime <= 0;\n }\n const isAnimationFinished = this.holdTime === null &&\n (this.state === \"finished\" || (this.state === \"running\" && done));\n // TODO: The exception for inertia could be cleaner here\n if (isAnimationFinished && type !== inertia) {\n state.value = getFinalKeyframe(keyframes, this.options, finalKeyframe, this.speed);\n }\n if (onUpdate) {\n onUpdate(state.value);\n }\n if (isAnimationFinished) {\n this.finish();\n }\n return state;\n }\n /**\n * Allows the returned animation to be awaited or promise-chained. Currently\n * resolves when the animation finishes at all but in a future update could/should\n * reject if its cancels.\n */\n then(resolve, reject) {\n return this.finished.then(resolve, reject);\n }\n get duration() {\n return millisecondsToSeconds(this.calculatedDuration);\n }\n get iterationDuration() {\n const { delay = 0 } = this.options || {};\n return this.duration + millisecondsToSeconds(delay);\n }\n get time() {\n return millisecondsToSeconds(this.currentTime);\n }\n set time(newTime) {\n newTime = secondsToMilliseconds(newTime);\n this.currentTime = newTime;\n if (this.startTime === null ||\n this.holdTime !== null ||\n this.playbackSpeed === 0) {\n this.holdTime = newTime;\n }\n else if (this.driver) {\n this.startTime = this.driver.now() - newTime / this.playbackSpeed;\n }\n if (this.driver) {\n this.driver.start(false);\n }\n else {\n this.startTime = 0;\n this.state = \"paused\";\n this.holdTime = newTime;\n this.tick(newTime);\n }\n }\n /**\n * Returns the generator's velocity at the current time in units/second.\n * Uses the analytical derivative when available (springs), avoiding\n * the MotionValue's frame-dependent velocity estimation.\n */\n getGeneratorVelocity() {\n const t = this.currentTime;\n if (t <= 0)\n return this.options.velocity || 0;\n if (this.generator.velocity) {\n return this.generator.velocity(t);\n }\n // Fallback: finite difference\n const current = this.generator.next(t).value;\n return getGeneratorVelocity((s) => this.generator.next(s).value, t, current);\n }\n get speed() {\n return this.playbackSpeed;\n }\n set speed(newSpeed) {\n const hasChanged = this.playbackSpeed !== newSpeed;\n if (hasChanged && this.driver) {\n this.updateTime(time.now());\n }\n this.playbackSpeed = newSpeed;\n if (hasChanged && this.driver) {\n this.time = millisecondsToSeconds(this.currentTime);\n }\n }\n play() {\n if (this.isStopped)\n return;\n const { driver = frameloopDriver, startTime } = this.options;\n if (!this.driver) {\n this.driver = driver((timestamp) => this.tick(timestamp));\n }\n this.options.onPlay?.();\n const now = this.driver.now();\n if (this.state === \"finished\") {\n this.updateFinished();\n this.startTime = now;\n }\n else if (this.holdTime !== null) {\n this.startTime = now - this.holdTime;\n }\n else if (!this.startTime) {\n this.startTime = startTime ?? now;\n }\n if (this.state === \"finished\" && this.speed < 0) {\n this.startTime += this.calculatedDuration;\n }\n this.holdTime = null;\n /**\n * Set playState to running only after we've used it in\n * the previous logic.\n */\n this.state = \"running\";\n this.driver.start();\n }\n pause() {\n this.state = \"paused\";\n this.updateTime(time.now());\n this.holdTime = this.currentTime;\n }\n complete() {\n if (this.state !== \"running\") {\n this.play();\n }\n this.state = \"finished\";\n this.holdTime = null;\n }\n finish() {\n this.notifyFinished();\n this.teardown();\n this.state = \"finished\";\n this.options.onComplete?.();\n }\n cancel() {\n this.holdTime = null;\n this.startTime = 0;\n this.tick(0);\n this.teardown();\n this.options.onCancel?.();\n }\n teardown() {\n this.state = \"idle\";\n this.stopDriver();\n this.startTime = this.holdTime = null;\n }\n stopDriver() {\n if (!this.driver)\n return;\n this.driver.stop();\n this.driver = undefined;\n }\n sample(sampleTime) {\n this.startTime = 0;\n return this.tick(sampleTime, true);\n }\n attachTimeline(timeline) {\n if (this.options.allowFlatten) {\n this.options.type = \"keyframes\";\n this.options.ease = \"linear\";\n this.initAnimation();\n }\n this.driver?.stop();\n return timeline.observe(this);\n }\n}\n// Legacy function support\nfunction animateValue(options) {\n return new JSAnimation(options);\n}\n\nexport { JSAnimation, animateValue };\n//# sourceMappingURL=JSAnimation.mjs.map\n","const radToDeg = (rad) => (rad * 180) / Math.PI;\nconst rotate = (v) => {\n const angle = radToDeg(Math.atan2(v[1], v[0]));\n return rebaseAngle(angle);\n};\nconst matrix2dParsers = {\n x: 4,\n y: 5,\n translateX: 4,\n translateY: 5,\n scaleX: 0,\n scaleY: 3,\n scale: (v) => (Math.abs(v[0]) + Math.abs(v[3])) / 2,\n rotate,\n rotateZ: rotate,\n skewX: (v) => radToDeg(Math.atan(v[1])),\n skewY: (v) => radToDeg(Math.atan(v[2])),\n skew: (v) => (Math.abs(v[1]) + Math.abs(v[2])) / 2,\n};\nconst rebaseAngle = (angle) => {\n angle = angle % 360;\n if (angle < 0)\n angle += 360;\n return angle;\n};\nconst rotateZ = rotate;\nconst scaleX = (v) => Math.sqrt(v[0] * v[0] + v[1] * v[1]);\nconst scaleY = (v) => Math.sqrt(v[4] * v[4] + v[5] * v[5]);\nconst matrix3dParsers = {\n x: 12,\n y: 13,\n z: 14,\n translateX: 12,\n translateY: 13,\n translateZ: 14,\n scaleX,\n scaleY,\n scale: (v) => (scaleX(v) + scaleY(v)) / 2,\n rotateX: (v) => rebaseAngle(radToDeg(Math.atan2(v[6], v[5]))),\n rotateY: (v) => rebaseAngle(radToDeg(Math.atan2(-v[2], v[0]))),\n rotateZ,\n rotate: rotateZ,\n skewX: (v) => radToDeg(Math.atan(v[4])),\n skewY: (v) => radToDeg(Math.atan(v[1])),\n skew: (v) => (Math.abs(v[1]) + Math.abs(v[4])) / 2,\n};\nfunction defaultTransformValue(name) {\n return name.includes(\"scale\") ? 1 : 0;\n}\nfunction parseValueFromTransform(transform, name) {\n if (!transform || transform === \"none\") {\n return defaultTransformValue(name);\n }\n const matrix3dMatch = transform.match(/^matrix3d\\(([-\\d.e\\s,]+)\\)$/u);\n let parsers;\n let match;\n if (matrix3dMatch) {\n parsers = matrix3dParsers;\n match = matrix3dMatch;\n }\n else {\n const matrix2dMatch = transform.match(/^matrix\\(([-\\d.e\\s,]+)\\)$/u);\n parsers = matrix2dParsers;\n match = matrix2dMatch;\n }\n if (!match) {\n return defaultTransformValue(name);\n }\n const valueParser = parsers[name];\n const values = match[1].split(\",\").map(convertTransformToNumber);\n return typeof valueParser === \"function\"\n ? valueParser(values)\n : values[valueParser];\n}\nconst readTransformValue = (instance, name) => {\n const { transform = \"none\" } = getComputedStyle(instance);\n return parseValueFromTransform(transform, name);\n};\nfunction convertTransformToNumber(value) {\n return parseFloat(value.trim());\n}\n\nexport { defaultTransformValue, parseValueFromTransform, readTransformValue };\n//# sourceMappingURL=parse-transform.mjs.map\n","/**\n * Generate a list of every possible transform key.\n */\nconst transformPropOrder = [\n \"transformPerspective\",\n \"x\",\n \"y\",\n \"z\",\n \"translateX\",\n \"translateY\",\n \"translateZ\",\n \"scale\",\n \"scaleX\",\n \"scaleY\",\n \"rotate\",\n \"rotateX\",\n \"rotateY\",\n \"rotateZ\",\n \"skew\",\n \"skewX\",\n \"skewY\",\n];\n/**\n * A quick lookup for transform props.\n *\n * `pathRotation` is a transform for routing purposes (skipped from raw\n * style application, wired to the transform composite, flags transform\n * dirty) but is intentionally NOT in `transformPropOrder` — it is\n * composed onto `rotate` at the build sites, not serialized in its own\n * slot, and must stay out of the order-array consumers (parse-transform,\n * unit-conversion, keys-position).\n */\nconst transformProps = /*@__PURE__*/ (() => new Set([...transformPropOrder, \"pathRotation\"]))();\n\nexport { transformPropOrder, transformProps };\n//# sourceMappingURL=keys-transform.mjs.map\n","import { parseValueFromTransform } from '../../../render/dom/parse-transform.mjs';\nimport { transformPropOrder } from '../../../render/utils/keys-transform.mjs';\nimport { number } from '../../../value/types/numbers/index.mjs';\nimport { px } from '../../../value/types/numbers/units.mjs';\n\nconst isNumOrPxType = (v) => v === number || v === px;\nconst transformKeys = new Set([\"x\", \"y\", \"z\"]);\nconst nonTranslationalTransformKeys = transformPropOrder.filter((key) => !transformKeys.has(key));\nfunction removeNonTranslationalTransform(visualElement) {\n const removedTransforms = [];\n nonTranslationalTransformKeys.forEach((key) => {\n const value = visualElement.getValue(key);\n if (value !== undefined) {\n removedTransforms.push([key, value.get()]);\n value.set(key.startsWith(\"scale\") ? 1 : 0);\n }\n });\n return removedTransforms;\n}\nconst positionalValues = {\n // Dimensions\n width: ({ x }, { paddingLeft = \"0\", paddingRight = \"0\", boxSizing }) => {\n const width = x.max - x.min;\n return boxSizing === \"border-box\"\n ? width\n : width - parseFloat(paddingLeft) - parseFloat(paddingRight);\n },\n height: ({ y }, { paddingTop = \"0\", paddingBottom = \"0\", boxSizing }) => {\n const height = y.max - y.min;\n return boxSizing === \"border-box\"\n ? height\n : height - parseFloat(paddingTop) - parseFloat(paddingBottom);\n },\n top: (_bbox, { top }) => parseFloat(top),\n left: (_bbox, { left }) => parseFloat(left),\n bottom: ({ y }, { top }) => parseFloat(top) + (y.max - y.min),\n right: ({ x }, { left }) => parseFloat(left) + (x.max - x.min),\n // Transform\n x: (_bbox, { transform }) => parseValueFromTransform(transform, \"x\"),\n y: (_bbox, { transform }) => parseValueFromTransform(transform, \"y\"),\n};\n// Alias translate longform names\npositionalValues.translateX = positionalValues.x;\npositionalValues.translateY = positionalValues.y;\n\nexport { isNumOrPxType, positionalValues, removeNonTranslationalTransform };\n//# sourceMappingURL=unit-conversion.mjs.map\n","import { fillWildcards } from './utils/fill-wildcards.mjs';\nimport { removeNonTranslationalTransform } from './utils/unit-conversion.mjs';\nimport { frame } from '../../frameloop/frame.mjs';\n\nconst toResolve = new Set();\nlet isScheduled = false;\nlet anyNeedsMeasurement = false;\nlet isForced = false;\nfunction measureAllKeyframes() {\n if (anyNeedsMeasurement) {\n const resolversToMeasure = Array.from(toResolve).filter((resolver) => resolver.needsMeasurement);\n const elementsToMeasure = new Set(resolversToMeasure.map((resolver) => resolver.element));\n const transformsToRestore = new Map();\n /**\n * Write pass\n * If we're measuring elements we want to remove bounding box-changing transforms.\n */\n elementsToMeasure.forEach((element) => {\n const removedTransforms = removeNonTranslationalTransform(element);\n if (!removedTransforms.length)\n return;\n transformsToRestore.set(element, removedTransforms);\n element.render();\n });\n // Read\n resolversToMeasure.forEach((resolver) => resolver.measureInitialState());\n // Write\n elementsToMeasure.forEach((element) => {\n element.render();\n const restore = transformsToRestore.get(element);\n if (restore) {\n restore.forEach(([key, value]) => {\n element.getValue(key)?.set(value);\n });\n }\n });\n // Read\n resolversToMeasure.forEach((resolver) => resolver.measureEndState());\n // Write\n resolversToMeasure.forEach((resolver) => {\n if (resolver.suspendedScrollY !== undefined) {\n window.scrollTo(0, resolver.suspendedScrollY);\n }\n });\n }\n anyNeedsMeasurement = false;\n isScheduled = false;\n toResolve.forEach((resolver) => resolver.complete(isForced));\n toResolve.clear();\n}\nfunction readAllKeyframes() {\n toResolve.forEach((resolver) => {\n resolver.readKeyframes();\n if (resolver.needsMeasurement) {\n anyNeedsMeasurement = true;\n }\n });\n}\nfunction flushKeyframeResolvers() {\n isForced = true;\n readAllKeyframes();\n measureAllKeyframes();\n isForced = false;\n}\nclass KeyframeResolver {\n constructor(unresolvedKeyframes, onComplete, name, motionValue, element, isAsync = false) {\n this.state = \"pending\";\n /**\n * Track whether this resolver is async. If it is, it'll be added to the\n * resolver queue and flushed in the next frame. Resolvers that aren't going\n * to trigger read/write thrashing don't need to be async.\n */\n this.isAsync = false;\n /**\n * Track whether this resolver needs to perform a measurement\n * to resolve its keyframes.\n */\n this.needsMeasurement = false;\n this.unresolvedKeyframes = [...unresolvedKeyframes];\n this.onComplete = onComplete;\n this.name = name;\n this.motionValue = motionValue;\n this.element = element;\n this.isAsync = isAsync;\n }\n scheduleResolve() {\n this.state = \"scheduled\";\n if (this.isAsync) {\n toResolve.add(this);\n if (!isScheduled) {\n isScheduled = true;\n frame.read(readAllKeyframes);\n frame.resolveKeyframes(measureAllKeyframes);\n }\n }\n else {\n this.readKeyframes();\n this.complete();\n }\n }\n readKeyframes() {\n const { unresolvedKeyframes, name, element, motionValue } = this;\n // If initial keyframe is null we need to read it from the DOM\n if (unresolvedKeyframes[0] === null) {\n const currentValue = motionValue?.get();\n // TODO: This doesn't work if the final keyframe is a wildcard\n const finalKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1];\n if (currentValue !== undefined) {\n unresolvedKeyframes[0] = currentValue;\n }\n else if (element && name) {\n const valueAsRead = element.readValue(name, finalKeyframe);\n if (valueAsRead !== undefined && valueAsRead !== null) {\n unresolvedKeyframes[0] = valueAsRead;\n }\n }\n if (unresolvedKeyframes[0] === undefined) {\n unresolvedKeyframes[0] = finalKeyframe;\n }\n if (motionValue && currentValue === undefined) {\n motionValue.set(unresolvedKeyframes[0]);\n }\n }\n fillWildcards(unresolvedKeyframes);\n }\n setFinalKeyframe() { }\n measureInitialState() { }\n renderEndStyles() { }\n measureEndState() { }\n complete(isForcedComplete = false) {\n this.state = \"complete\";\n this.onComplete(this.unresolvedKeyframes, this.finalKeyframe, isForcedComplete);\n toResolve.delete(this);\n }\n cancel() {\n if (this.state === \"scheduled\") {\n toResolve.delete(this);\n this.state = \"pending\";\n }\n }\n resume() {\n if (this.state === \"pending\")\n this.scheduleResolve();\n }\n}\n\nexport { KeyframeResolver, flushKeyframeResolvers };\n//# sourceMappingURL=KeyframesResolver.mjs.map\n","function fillWildcards(keyframes) {\n for (let i = 1; i < keyframes.length; i++) {\n keyframes[i] ?? (keyframes[i] = keyframes[i - 1]);\n }\n}\n\nexport { fillWildcards };\n//# sourceMappingURL=fill-wildcards.mjs.map\n","import { isCSSVar } from './is-css-var.mjs';\n\nfunction setStyle(element, name, value) {\n isCSSVar(name)\n ? element.style.setProperty(name, value)\n : (element.style[name] = value);\n}\n\nexport { setStyle };\n//# sourceMappingURL=style-set.mjs.map\n","const isCSSVar = (name) => name.startsWith(\"--\");\n\nexport { isCSSVar };\n//# sourceMappingURL=is-css-var.mjs.map\n","/**\n * Add the ability for test suites to manually set support flags\n * to better test more environments.\n */\nconst supportsFlags = {};\n\nexport { supportsFlags };\n//# sourceMappingURL=flags.mjs.map\n","import { memo } from 'motion-utils';\nimport { supportsFlags } from './flags.mjs';\n\nfunction memoSupports(callback, supportsFlag) {\n const memoized = memo(callback);\n return () => supportsFlags[supportsFlag] ?? memoized();\n}\n\nexport { memoSupports };\n//# sourceMappingURL=memo.mjs.map\n","import { memoSupports } from './memo.mjs';\n\nconst supportsScrollTimeline = /* @__PURE__ */ memoSupports(() => window.ScrollTimeline !== undefined, \"scrollTimeline\");\nconst supportsViewTimeline = /* @__PURE__ */ memoSupports(() => window.ViewTimeline !== undefined, \"viewTimeline\");\n\nexport { supportsScrollTimeline, supportsViewTimeline };\n//# sourceMappingURL=scroll-timeline.mjs.map\n","import { memoSupports } from './memo.mjs';\n\nconst supportsLinearEasing = /*@__PURE__*/ memoSupports(() => {\n try {\n document\n .createElement(\"div\")\n .animate({ opacity: 0 }, { easing: \"linear(0, 1)\" });\n }\n catch (e) {\n return false;\n }\n return true;\n}, \"linearEasing\");\n\nexport { supportsLinearEasing };\n//# sourceMappingURL=linear-easing.mjs.map\n","const cubicBezierAsString = ([a, b, c, d]) => `cubic-bezier(${a}, ${b}, ${c}, ${d})`;\n\nexport { cubicBezierAsString };\n//# sourceMappingURL=cubic-bezier.mjs.map\n","import { cubicBezierAsString } from './cubic-bezier.mjs';\n\nconst supportedWaapiEasing = {\n linear: \"linear\",\n ease: \"ease\",\n easeIn: \"ease-in\",\n easeOut: \"ease-out\",\n easeInOut: \"ease-in-out\",\n circIn: /*@__PURE__*/ cubicBezierAsString([0, 0.65, 0.55, 1]),\n circOut: /*@__PURE__*/ cubicBezierAsString([0.55, 0, 1, 0.45]),\n backIn: /*@__PURE__*/ cubicBezierAsString([0.31, 0.01, 0.66, -0.59]),\n backOut: /*@__PURE__*/ cubicBezierAsString([0.33, 1.53, 0.69, 0.99]),\n};\n\nexport { supportedWaapiEasing };\n//# sourceMappingURL=supported.mjs.map\n","import { isBezierDefinition } from 'motion-utils';\nimport { supportsLinearEasing } from '../../../utils/supports/linear-easing.mjs';\nimport { generateLinearEasing } from '../utils/linear.mjs';\nimport { cubicBezierAsString } from './cubic-bezier.mjs';\nimport { supportedWaapiEasing } from './supported.mjs';\n\nfunction mapEasingToNativeEasing(easing, duration) {\n if (!easing) {\n return undefined;\n }\n else if (typeof easing === \"function\") {\n return supportsLinearEasing()\n ? generateLinearEasing(easing, duration)\n : \"ease-out\";\n }\n else if (isBezierDefinition(easing)) {\n return cubicBezierAsString(easing);\n }\n else if (Array.isArray(easing)) {\n return easing.map((segmentEasing) => mapEasingToNativeEasing(segmentEasing, duration) ||\n supportedWaapiEasing.easeOut);\n }\n else {\n return supportedWaapiEasing[easing];\n }\n}\n\nexport { mapEasingToNativeEasing };\n//# sourceMappingURL=map-easing.mjs.map\n","import { mapEasingToNativeEasing } from './easing/map-easing.mjs';\n\nfunction startWaapiAnimation(element, valueName, keyframes, { delay = 0, duration = 300, repeat = 0, repeatType = \"loop\", ease = \"easeOut\", times, } = {}, pseudoElement = undefined) {\n const keyframeOptions = {\n [valueName]: keyframes,\n };\n if (times)\n keyframeOptions.offset = times;\n const easing = mapEasingToNativeEasing(ease, duration);\n /**\n * If this is an easing array, apply to keyframes, not animation as a whole\n */\n if (Array.isArray(easing))\n keyframeOptions.easing = easing;\n const options = {\n delay,\n duration,\n easing: !Array.isArray(easing) ? easing : \"linear\",\n fill: \"both\",\n iterations: repeat + 1,\n direction: repeatType === \"reverse\" ? \"alternate\" : \"normal\",\n };\n if (pseudoElement)\n options.pseudoElement = pseudoElement;\n return element.animate(keyframeOptions, options);\n}\n\nexport { startWaapiAnimation };\n//# sourceMappingURL=start-waapi-animation.mjs.map\n","function isGenerator(type) {\n return typeof type === \"function\" && \"applyToOptions\" in type;\n}\n\nexport { isGenerator };\n//# sourceMappingURL=is-generator.mjs.map\n","import { invariant, millisecondsToSeconds, secondsToMilliseconds, noop } from 'motion-utils';\nimport { setStyle } from '../render/dom/style-set.mjs';\nimport { supportsScrollTimeline } from '../utils/supports/scroll-timeline.mjs';\nimport { getFinalKeyframe } from './keyframes/get-final.mjs';\nimport { WithPromise } from './utils/WithPromise.mjs';\nimport { startWaapiAnimation } from './waapi/start-waapi-animation.mjs';\nimport { applyGeneratorOptions } from './waapi/utils/apply-generator.mjs';\n\n/**\n * NativeAnimation implements AnimationPlaybackControls for the browser's Web Animations API.\n */\nclass NativeAnimation extends WithPromise {\n constructor(options) {\n super();\n this.finishedTime = null;\n this.isStopped = false;\n /**\n * Tracks a manually-set start time that takes precedence over WAAPI's\n * dynamic startTime. This is cleared when play() or time setter is called,\n * allowing WAAPI to take over timing.\n */\n this.manualStartTime = null;\n if (!options)\n return;\n const { element, name, keyframes, pseudoElement, allowFlatten = false, finalKeyframe, onComplete, } = options;\n this.isPseudoElement = Boolean(pseudoElement);\n this.allowFlatten = allowFlatten;\n this.options = options;\n invariant(typeof options.type !== \"string\", `Mini animate() doesn't support \"type\" as a string.`, \"mini-spring\");\n const transition = applyGeneratorOptions(options);\n this.animation = startWaapiAnimation(element, name, keyframes, transition, pseudoElement);\n if (transition.autoplay === false) {\n this.animation.pause();\n }\n this.animation.onfinish = () => {\n this.finishedTime = this.time;\n if (!pseudoElement) {\n const keyframe = getFinalKeyframe(keyframes, this.options, finalKeyframe, this.speed);\n if (this.updateMotionValue) {\n this.updateMotionValue(keyframe);\n }\n /**\n * If we can, we want to commit the final style as set by the user,\n * rather than the computed keyframe value supplied by the animation.\n * We always do this, even when a motion value is present, to prevent\n * a visual flash in Firefox where the WAAPI animation's fill is removed\n * during cancel() before the scheduled render can apply the correct value.\n */\n setStyle(element, name, keyframe);\n this.animation.cancel();\n }\n onComplete?.();\n this.notifyFinished();\n };\n }\n play() {\n if (this.isStopped)\n return;\n this.manualStartTime = null;\n this.animation.play();\n if (this.state === \"finished\") {\n this.updateFinished();\n }\n }\n pause() {\n this.animation.pause();\n }\n complete() {\n this.animation.finish?.();\n }\n cancel() {\n try {\n this.animation.cancel();\n }\n catch (e) { }\n }\n stop() {\n if (this.isStopped)\n return;\n this.isStopped = true;\n const { state } = this;\n if (state === \"idle\" || state === \"finished\") {\n return;\n }\n if (this.updateMotionValue) {\n this.updateMotionValue();\n }\n else {\n this.commitStyles();\n }\n if (!this.isPseudoElement)\n this.cancel();\n }\n /**\n * WAAPI doesn't natively have any interruption capabilities.\n *\n * In this method, we commit styles back to the DOM before cancelling\n * the animation.\n *\n * This is designed to be overridden by NativeAnimationExtended, which\n * will create a renderless JS animation and sample it twice to calculate\n * its current value, \"previous\" value, and therefore allow\n * Motion to also correctly calculate velocity for any subsequent animation\n * while deferring the commit until the next animation frame.\n */\n commitStyles() {\n const element = this.options?.element;\n if (!this.isPseudoElement && element?.isConnected) {\n this.animation.commitStyles?.();\n }\n }\n get duration() {\n const duration = this.animation.effect?.getComputedTiming?.().duration || 0;\n return millisecondsToSeconds(Number(duration));\n }\n get iterationDuration() {\n const { delay = 0 } = this.options || {};\n return this.duration + millisecondsToSeconds(delay);\n }\n get time() {\n return millisecondsToSeconds(Number(this.animation.currentTime) || 0);\n }\n set time(newTime) {\n const wasFinished = this.finishedTime !== null;\n this.manualStartTime = null;\n this.finishedTime = null;\n this.animation.currentTime = secondsToMilliseconds(newTime);\n if (wasFinished) {\n this.animation.pause();\n }\n }\n /**\n * The playback speed of the animation.\n * 1 = normal speed, 2 = double speed, 0.5 = half speed.\n */\n get speed() {\n return this.animation.playbackRate;\n }\n set speed(newSpeed) {\n // Allow backwards playback after finishing\n if (newSpeed < 0)\n this.finishedTime = null;\n this.animation.playbackRate = newSpeed;\n }\n get state() {\n return this.finishedTime !== null\n ? \"finished\"\n : this.animation.playState;\n }\n get startTime() {\n return this.manualStartTime ?? Number(this.animation.startTime);\n }\n set startTime(newStartTime) {\n this.manualStartTime = this.animation.startTime = newStartTime;\n }\n /**\n * Attaches a timeline to the animation, for instance the `ScrollTimeline`.\n */\n attachTimeline({ timeline, rangeStart, rangeEnd, observe, }) {\n if (this.allowFlatten) {\n this.animation.effect?.updateTiming({ easing: \"linear\" });\n }\n this.animation.onfinish = null;\n if (timeline && supportsScrollTimeline()) {\n this.animation.timeline = timeline;\n if (rangeStart)\n this.animation.rangeStart = rangeStart;\n if (rangeEnd)\n this.animation.rangeEnd = rangeEnd;\n return noop;\n }\n else {\n return observe(this);\n }\n }\n}\n\nexport { NativeAnimation };\n//# sourceMappingURL=NativeAnimation.mjs.map\n","import { supportsLinearEasing } from '../../../utils/supports/linear-easing.mjs';\nimport { isGenerator } from '../../generators/utils/is-generator.mjs';\n\nfunction applyGeneratorOptions({ type, ...options }) {\n if (isGenerator(type) && supportsLinearEasing()) {\n return type.applyToOptions(options);\n }\n else {\n options.duration ?? (options.duration = 300);\n options.ease ?? (options.ease = \"easeOut\");\n }\n return options;\n}\n\nexport { applyGeneratorOptions };\n//# sourceMappingURL=apply-generator.mjs.map\n","import { circInOut, backInOut, anticipate } from 'motion-utils';\n\nconst unsupportedEasingFunctions = {\n anticipate,\n backInOut,\n circInOut,\n};\nfunction isUnsupportedEase(key) {\n return key in unsupportedEasingFunctions;\n}\nfunction replaceStringEasing(transition) {\n if (typeof transition.ease === \"string\" &&\n isUnsupportedEase(transition.ease)) {\n transition.ease = unsupportedEasingFunctions[transition.ease];\n }\n}\n\nexport { replaceStringEasing };\n//# sourceMappingURL=unsupported-easing.mjs.map\n","import { clamp } from 'motion-utils';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { setStyle } from '../render/dom/style-set.mjs';\nimport { JSAnimation } from './JSAnimation.mjs';\nimport { NativeAnimation } from './NativeAnimation.mjs';\nimport { replaceTransitionType } from './utils/replace-transition-type.mjs';\nimport { replaceStringEasing } from './waapi/utils/unsupported-easing.mjs';\n\n/**\n * 10ms is chosen here as it strikes a balance between smooth\n * results (more than one keyframe per frame at 60fps) and\n * keyframe quantity.\n */\nconst sampleDelta = 10; //ms\nclass NativeAnimationExtended extends NativeAnimation {\n constructor(options) {\n /**\n * The base NativeAnimation function only supports a subset\n * of Motion easings, and WAAPI also only supports some\n * easing functions via string/cubic-bezier definitions.\n *\n * This function replaces those unsupported easing functions\n * with a JS easing function. This will later get compiled\n * to a linear() easing function.\n */\n replaceStringEasing(options);\n /**\n * Ensure we replace the transition type with a generator function\n * before passing to WAAPI.\n *\n * TODO: Does this have a better home? It could be shared with\n * JSAnimation.\n */\n replaceTransitionType(options);\n super(options);\n /**\n * Only set startTime when the animation should autoplay.\n * Setting startTime on a paused WAAPI animation unpauses it\n * (per the WAAPI spec), which breaks autoplay: false.\n */\n if (options.startTime !== undefined && options.autoplay !== false) {\n this.startTime = options.startTime;\n }\n this.options = options;\n }\n /**\n * WAAPI doesn't natively have any interruption capabilities.\n *\n * Rather than read committed styles back out of the DOM, we can\n * create a renderless JS animation and sample it twice to calculate\n * its current value, \"previous\" value, and therefore allow\n * Motion to calculate velocity for any subsequent animation.\n */\n updateMotionValue(value) {\n const { motionValue, onUpdate, onComplete, element, ...options } = this.options;\n if (!motionValue)\n return;\n if (value !== undefined) {\n motionValue.set(value);\n return;\n }\n const sampleAnimation = new JSAnimation({\n ...options,\n autoplay: false,\n });\n /**\n * Use wall-clock elapsed time for sampling.\n * Under CPU load, WAAPI's currentTime may not reflect actual\n * elapsed time, causing incorrect sampling and visual jumps.\n */\n const sampleTime = Math.max(sampleDelta, time.now() - this.startTime);\n const delta = clamp(0, sampleDelta, sampleTime - sampleDelta);\n const current = sampleAnimation.sample(sampleTime).value;\n /**\n * Write the estimated value to inline style so it persists\n * after cancel(), covering the async gap before the next\n * animation starts.\n */\n const { name } = this.options;\n if (element && name)\n setStyle(element, name, current);\n motionValue.setWithVelocity(sampleAnimation.sample(Math.max(0, sampleTime - delta)).value, current, delta);\n sampleAnimation.stop();\n }\n}\n\nexport { NativeAnimationExtended };\n//# sourceMappingURL=NativeAnimationExtended.mjs.map\n","import { complex } from '../../value/types/complex/index.mjs';\n\n/**\n * Check if a value is animatable. Examples:\n *\n * ✅: 100, \"100px\", \"#fff\"\n * ❌: \"block\", \"url(2.jpg)\"\n * @param value\n *\n * @internal\n */\nconst isAnimatable = (value, name) => {\n // If the list of keys that might be non-animatable grows, replace with Set\n if (name === \"zIndex\")\n return false;\n // If it's a number or a keyframes array, we can animate it. We might at some point\n // need to do a deep isAnimatable check of keyframes, or let Popmotion handle this,\n // but for now lets leave it like this for performance reasons\n if (typeof value === \"number\" || Array.isArray(value))\n return true;\n if (typeof value === \"string\" && // It's animatable if we have a string\n (complex.test(value) || value === \"0\") && // And it contains numbers and/or colors\n !value.startsWith(\"url(\") // Unless it starts with \"url(\"\n ) {\n return true;\n }\n return false;\n};\n\nexport { isAnimatable };\n//# sourceMappingURL=is-animatable.mjs.map\n","function makeAnimationInstant(options) {\n options.duration = 0;\n options.type = \"keyframes\";\n}\n\nexport { makeAnimationInstant };\n//# sourceMappingURL=make-animation-instant.mjs.map\n","/**\n * A list of values that can be hardware-accelerated.\n */\nconst acceleratedValues = new Set([\n \"opacity\",\n \"clipPath\",\n \"filter\",\n \"transform\",\n \"backgroundColor\",\n]);\n\nexport { acceleratedValues };\n//# sourceMappingURL=accelerated-values.mjs.map\n","const browserColorFunctions = /^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\\(/;\nfunction hasBrowserOnlyColors(keyframes) {\n for (let i = 0; i < keyframes.length; i++) {\n if (typeof keyframes[i] === \"string\" &&\n browserColorFunctions.test(keyframes[i])) {\n return true;\n }\n }\n return false;\n}\n\nexport { hasBrowserOnlyColors };\n//# sourceMappingURL=is-browser-color.mjs.map\n","import { memo } from 'motion-utils';\nimport { acceleratedValues } from '../utils/accelerated-values.mjs';\nimport { hasBrowserOnlyColors } from '../utils/is-browser-color.mjs';\n\nconst colorProperties = new Set([\n \"color\",\n \"backgroundColor\",\n \"outlineColor\",\n \"fill\",\n \"stroke\",\n \"borderColor\",\n \"borderTopColor\",\n \"borderRightColor\",\n \"borderBottomColor\",\n \"borderLeftColor\",\n]);\nconst supportsWaapi = /*@__PURE__*/ memo(() => Object.hasOwnProperty.call(Element.prototype, \"animate\"));\nfunction supportsBrowserAnimation(options) {\n const { motionValue, name, repeatDelay, repeatType, damping, type, keyframes, } = options;\n const subject = motionValue?.owner?.current;\n /**\n * We use instanceof checks instead of isHTMLElement()/isSVGElement()\n * because we explicitly **don't** want elements in different timing\n * contexts (i.e. popups) to be accelerated, as it's not possible to sync\n * these animations properly with those driven from the main window\n * frameloop.\n */\n if (!(subject instanceof HTMLElement) &&\n !(subject instanceof SVGElement)) {\n return false;\n }\n const { onUpdate, transformTemplate } = motionValue.owner.getProps();\n return (supportsWaapi() &&\n name &&\n /**\n * Force WAAPI for color properties with browser-only color formats\n * (oklch, oklab, lab, lch, etc.) that the JS animation path can't parse.\n */\n (acceleratedValues.has(name) ||\n (colorProperties.has(name) &&\n hasBrowserOnlyColors(keyframes))) &&\n (name !== \"transform\" || !transformTemplate) &&\n /**\n * If we're outputting values to onUpdate then we can't use WAAPI as there's\n * no way to read the value from WAAPI every frame.\n */\n !onUpdate &&\n !repeatDelay &&\n repeatType !== \"mirror\" &&\n damping !== 0 &&\n type !== \"inertia\");\n}\n\nexport { supportsBrowserAnimation };\n//# sourceMappingURL=waapi.mjs.map\n","import { MotionGlobalConfig, noop } from 'motion-utils';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { JSAnimation } from './JSAnimation.mjs';\nimport { getFinalKeyframe } from './keyframes/get-final.mjs';\nimport { KeyframeResolver, flushKeyframeResolvers } from './keyframes/KeyframesResolver.mjs';\nimport { NativeAnimationExtended } from './NativeAnimationExtended.mjs';\nimport { canAnimate } from './utils/can-animate.mjs';\nimport { makeAnimationInstant } from './utils/make-animation-instant.mjs';\nimport { WithPromise } from './utils/WithPromise.mjs';\nimport { supportsBrowserAnimation } from './waapi/supports/waapi.mjs';\n\n/**\n * Maximum time allowed between an animation being created and it being\n * resolved for us to use the latter as the start time.\n *\n * This is to ensure that while we prefer to \"start\" an animation as soon\n * as it's triggered, we also want to avoid a visual jump if there's a big delay\n * between these two moments.\n */\nconst MAX_RESOLVE_DELAY = 40;\nclass AsyncMotionValueAnimation extends WithPromise {\n constructor({ autoplay = true, delay = 0, type = \"keyframes\", repeat = 0, repeatDelay = 0, repeatType = \"loop\", keyframes, name, motionValue, element, ...options }) {\n super();\n /**\n * Bound to support return animation.stop pattern\n */\n this.stop = () => {\n if (this._animation) {\n this._animation.stop();\n this.stopTimeline?.();\n }\n this.keyframeResolver?.cancel();\n };\n this.createdAt = time.now();\n const optionsWithDefaults = {\n autoplay,\n delay,\n type,\n repeat,\n repeatDelay,\n repeatType,\n name,\n motionValue,\n element,\n ...options,\n };\n const KeyframeResolver$1 = element?.KeyframeResolver || KeyframeResolver;\n this.keyframeResolver = new KeyframeResolver$1(keyframes, (resolvedKeyframes, finalKeyframe, forced) => this.onKeyframesResolved(resolvedKeyframes, finalKeyframe, optionsWithDefaults, !forced), name, motionValue, element);\n this.keyframeResolver?.scheduleResolve();\n }\n onKeyframesResolved(keyframes, finalKeyframe, options, sync) {\n this.keyframeResolver = undefined;\n const { name, type, velocity, delay, isHandoff, onUpdate } = options;\n this.resolvedAt = time.now();\n /**\n * If we can't animate this value with the resolved keyframes\n * then we should complete it immediately.\n */\n let canAnimateValue = true;\n if (!canAnimate(keyframes, name, type, velocity)) {\n canAnimateValue = false;\n if (MotionGlobalConfig.instantAnimations || !delay) {\n onUpdate?.(getFinalKeyframe(keyframes, options, finalKeyframe));\n }\n keyframes[0] = keyframes[keyframes.length - 1];\n makeAnimationInstant(options);\n options.repeat = 0;\n }\n /**\n * Resolve startTime for the animation.\n *\n * This method uses the createdAt and resolvedAt to calculate the\n * animation startTime. *Ideally*, we would use the createdAt time as t=0\n * as the following frame would then be the first frame of the animation in\n * progress, which would feel snappier.\n *\n * However, if there's a delay (main thread work) between the creation of\n * the animation and the first committed frame, we prefer to use resolvedAt\n * to avoid a sudden jump into the animation.\n */\n const startTime = sync\n ? !this.resolvedAt\n ? this.createdAt\n : this.resolvedAt - this.createdAt > MAX_RESOLVE_DELAY\n ? this.resolvedAt\n : this.createdAt\n : undefined;\n const resolvedOptions = {\n startTime,\n finalKeyframe,\n ...options,\n keyframes,\n };\n /**\n * Animate via WAAPI if possible. If this is a handoff animation, the optimised animation will be running via\n * WAAPI. Therefore, this animation must be JS to ensure it runs \"under\" the\n * optimised animation.\n *\n * Also skip WAAPI when keyframes aren't animatable, as the resolved\n * values may not be valid CSS and would trigger browser warnings.\n */\n const useWaapi = canAnimateValue &&\n !isHandoff &&\n supportsBrowserAnimation(resolvedOptions);\n const element = resolvedOptions.motionValue?.owner?.current;\n let animation;\n if (useWaapi) {\n try {\n animation = new NativeAnimationExtended({\n ...resolvedOptions,\n element,\n });\n }\n catch {\n animation = new JSAnimation(resolvedOptions);\n }\n }\n else {\n animation = new JSAnimation(resolvedOptions);\n }\n animation.finished.then(() => {\n this.notifyFinished();\n }).catch(noop);\n if (this.pendingTimeline) {\n this.stopTimeline = animation.attachTimeline(this.pendingTimeline);\n this.pendingTimeline = undefined;\n }\n this._animation = animation;\n }\n get finished() {\n if (!this._animation) {\n return this._finished;\n }\n else {\n return this.animation.finished;\n }\n }\n then(onResolve, _onReject) {\n return this.finished.finally(onResolve).then(() => { });\n }\n get animation() {\n if (!this._animation) {\n this.keyframeResolver?.resume();\n flushKeyframeResolvers();\n }\n return this._animation;\n }\n get duration() {\n return this.animation.duration;\n }\n get iterationDuration() {\n return this.animation.iterationDuration;\n }\n get time() {\n return this.animation.time;\n }\n set time(newTime) {\n this.animation.time = newTime;\n }\n get speed() {\n return this.animation.speed;\n }\n get state() {\n return this.animation.state;\n }\n set speed(newSpeed) {\n this.animation.speed = newSpeed;\n }\n get startTime() {\n return this.animation.startTime;\n }\n attachTimeline(timeline) {\n if (this._animation) {\n this.stopTimeline = this.animation.attachTimeline(timeline);\n }\n else {\n this.pendingTimeline = timeline;\n }\n return () => this.stop();\n }\n play() {\n this.animation.play();\n }\n pause() {\n this.animation.pause();\n }\n complete() {\n this.animation.complete();\n }\n cancel() {\n if (this._animation) {\n this.animation.cancel();\n }\n this.keyframeResolver?.cancel();\n }\n}\n\nexport { AsyncMotionValueAnimation };\n//# sourceMappingURL=AsyncMotionValueAnimation.mjs.map\n","import { warning } from 'motion-utils';\nimport { isGenerator } from '../generators/utils/is-generator.mjs';\nimport { isAnimatable } from './is-animatable.mjs';\n\nfunction hasKeyframesChanged(keyframes) {\n const current = keyframes[0];\n if (keyframes.length === 1)\n return true;\n for (let i = 0; i < keyframes.length; i++) {\n if (keyframes[i] !== current)\n return true;\n }\n}\nfunction canAnimate(keyframes, name, type, velocity) {\n /**\n * Check if we're able to animate between the start and end keyframes,\n * and throw a warning if we're attempting to animate between one that's\n * animatable and another that isn't.\n */\n const originKeyframe = keyframes[0];\n if (originKeyframe === null) {\n return false;\n }\n /**\n * These aren't traditionally animatable but we do support them.\n * In future we could look into making this more generic or replacing\n * this function with mix() === mixImmediate\n */\n if (name === \"display\" || name === \"visibility\")\n return true;\n const targetKeyframe = keyframes[keyframes.length - 1];\n const isOriginAnimatable = isAnimatable(originKeyframe, name);\n const isTargetAnimatable = isAnimatable(targetKeyframe, name);\n warning(isOriginAnimatable === isTargetAnimatable, `You are trying to animate ${name} from \"${originKeyframe}\" to \"${targetKeyframe}\". \"${isOriginAnimatable ? targetKeyframe : originKeyframe}\" is not an animatable value.`, \"value-not-animatable\");\n // Always skip if any of these are true\n if (!isOriginAnimatable || !isTargetAnimatable) {\n return false;\n }\n return (hasKeyframesChanged(keyframes) ||\n ((type === \"spring\" || isGenerator(type)) && velocity));\n}\n\nexport { canAnimate };\n//# sourceMappingURL=can-animate.mjs.map\n","function calcChildStagger(children, child, delayChildren, staggerChildren = 0, staggerDirection = 1) {\n const index = Array.from(children)\n .sort((a, b) => a.sortNodePosition(b))\n .indexOf(child);\n const numChildren = children.size;\n const maxStaggerDuration = (numChildren - 1) * staggerChildren;\n const delayIsFunction = typeof delayChildren === \"function\";\n return delayIsFunction\n ? delayChildren(index, numChildren)\n : staggerDirection === 1\n ? index * staggerChildren\n : maxStaggerDuration - index * staggerChildren;\n}\n\nexport { calcChildStagger };\n//# sourceMappingURL=calc-child-stagger.mjs.map\n","import { warnOnce, SubscriptionManager, velocityPerSecond } from 'motion-utils';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { frame } from '../frameloop/frame.mjs';\n\n/**\n * Maximum time between the value of two frames, beyond which we\n * assume the velocity has since been 0.\n */\nconst MAX_VELOCITY_DELTA = 30;\nconst isFloat = (value) => {\n return !isNaN(parseFloat(value));\n};\nconst collectMotionValues = {\n current: undefined,\n};\n/**\n * `MotionValue` is used to track the state and velocity of motion values.\n *\n * @public\n */\nclass MotionValue {\n /**\n * @param init - The initiating value\n * @param config - Optional configuration options\n *\n * - `transformer`: A function to transform incoming values with.\n */\n constructor(init, options = {}) {\n /**\n * Tracks whether this value can output a velocity. Currently this is only true\n * if the value is numerical, but we might be able to widen the scope here and support\n * other value types.\n *\n * @internal\n */\n this.canTrackVelocity = null;\n /**\n * An object containing a SubscriptionManager for each active event.\n */\n this.events = {};\n this.updateAndNotify = (v) => {\n const currentTime = time.now();\n /**\n * If we're updating the value during another frame or eventloop\n * than the previous frame, then the we set the previous frame value\n * to current.\n */\n if (this.updatedAt !== currentTime) {\n this.setPrevFrameValue();\n }\n this.prev = this.current;\n this.setCurrent(v);\n // Update update subscribers\n if (this.current !== this.prev) {\n this.events.change?.notify(this.current);\n if (this.dependents) {\n for (const dependent of this.dependents) {\n dependent.dirty();\n }\n }\n }\n };\n this.hasAnimated = false;\n this.setCurrent(init);\n this.owner = options.owner;\n }\n setCurrent(current) {\n this.current = current;\n this.updatedAt = time.now();\n if (this.canTrackVelocity === null && current !== undefined) {\n this.canTrackVelocity = isFloat(this.current);\n }\n }\n setPrevFrameValue(prevFrameValue = this.current) {\n this.prevFrameValue = prevFrameValue;\n this.prevUpdatedAt = this.updatedAt;\n }\n /**\n * Adds a function that will be notified when the `MotionValue` is updated.\n *\n * It returns a function that, when called, will cancel the subscription.\n *\n * When calling `onChange` inside a React component, it should be wrapped with the\n * `useEffect` hook. As it returns an unsubscribe function, this should be returned\n * from the `useEffect` function to ensure you don't add duplicate subscribers..\n *\n * ```jsx\n * export const MyComponent = () => {\n * const x = useMotionValue(0)\n * const y = useMotionValue(0)\n * const opacity = useMotionValue(1)\n *\n * useEffect(() => {\n * function updateOpacity() {\n * const maxXY = Math.max(x.get(), y.get())\n * const newOpacity = transform(maxXY, [0, 100], [1, 0])\n * opacity.set(newOpacity)\n * }\n *\n * const unsubscribeX = x.on(\"change\", updateOpacity)\n * const unsubscribeY = y.on(\"change\", updateOpacity)\n *\n * return () => {\n * unsubscribeX()\n * unsubscribeY()\n * }\n * }, [])\n *\n * return \n * }\n * ```\n *\n * @param subscriber - A function that receives the latest value.\n * @returns A function that, when called, will cancel this subscription.\n *\n * @deprecated\n */\n onChange(subscription) {\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(false, `value.onChange(callback) is deprecated. Switch to value.on(\"change\", callback).`);\n }\n return this.on(\"change\", subscription);\n }\n on(eventName, callback) {\n if (!this.events[eventName]) {\n this.events[eventName] = new SubscriptionManager();\n }\n const unsubscribe = this.events[eventName].add(callback);\n if (eventName === \"change\") {\n return () => {\n unsubscribe();\n /**\n * If we have no more change listeners by the start\n * of the next frame, stop active animations.\n */\n frame.read(() => {\n if (!this.events.change.getSize()) {\n this.stop();\n }\n });\n };\n }\n return unsubscribe;\n }\n clearListeners() {\n for (const eventManagers in this.events) {\n this.events[eventManagers].clear();\n }\n }\n /**\n * Attaches a passive effect to the `MotionValue`.\n */\n attach(passiveEffect, stopPassiveEffect) {\n this.passiveEffect = passiveEffect;\n this.stopPassiveEffect = stopPassiveEffect;\n }\n /**\n * Sets the state of the `MotionValue`.\n *\n * @remarks\n *\n * ```jsx\n * const x = useMotionValue(0)\n * x.set(10)\n * ```\n *\n * @param latest - Latest value to set.\n * @param render - Whether to notify render subscribers. Defaults to `true`\n *\n * @public\n */\n set(v) {\n if (!this.passiveEffect) {\n this.updateAndNotify(v);\n }\n else {\n this.passiveEffect(v, this.updateAndNotify);\n }\n }\n setWithVelocity(prev, current, delta) {\n this.set(current);\n this.prev = undefined;\n this.prevFrameValue = prev;\n this.prevUpdatedAt = this.updatedAt - delta;\n }\n /**\n * Set the state of the `MotionValue`, stopping any active animations,\n * effects, and resets velocity to `0`.\n */\n jump(v, endAnimation = true) {\n this.updateAndNotify(v);\n this.prev = v;\n this.prevUpdatedAt = this.prevFrameValue = undefined;\n endAnimation && this.stop();\n if (this.stopPassiveEffect)\n this.stopPassiveEffect();\n }\n dirty() {\n this.events.change?.notify(this.current);\n }\n addDependent(dependent) {\n if (!this.dependents) {\n this.dependents = new Set();\n }\n this.dependents.add(dependent);\n }\n removeDependent(dependent) {\n if (this.dependents) {\n this.dependents.delete(dependent);\n }\n }\n /**\n * Returns the latest state of `MotionValue`\n *\n * @returns - The latest state of `MotionValue`\n *\n * @public\n */\n get() {\n if (collectMotionValues.current) {\n collectMotionValues.current.push(this);\n }\n return this.current;\n }\n /**\n * @public\n */\n getPrevious() {\n return this.prev;\n }\n /**\n * Returns the latest velocity of `MotionValue`\n *\n * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical.\n *\n * @public\n */\n getVelocity() {\n const currentTime = time.now();\n if (!this.canTrackVelocity ||\n this.prevFrameValue === undefined ||\n currentTime - this.updatedAt > MAX_VELOCITY_DELTA) {\n return 0;\n }\n const delta = Math.min(this.updatedAt - this.prevUpdatedAt, MAX_VELOCITY_DELTA);\n // Casts because of parseFloat's poor typing\n return velocityPerSecond(parseFloat(this.current) -\n parseFloat(this.prevFrameValue), delta);\n }\n /**\n * Registers a new animation to control this `MotionValue`. Only one\n * animation can drive a `MotionValue` at one time.\n *\n * ```jsx\n * value.start()\n * ```\n *\n * @param animation - A function that starts the provided animation\n */\n start(startAnimation) {\n this.stop();\n return new Promise((resolve) => {\n this.hasAnimated = true;\n this.animation = startAnimation(resolve);\n if (this.events.animationStart) {\n this.events.animationStart.notify();\n }\n }).then(() => {\n if (this.events.animationComplete) {\n this.events.animationComplete.notify();\n }\n this.clearAnimation();\n });\n }\n /**\n * Stop the currently active animation.\n *\n * @public\n */\n stop() {\n if (this.animation) {\n this.animation.stop();\n if (this.events.animationCancel) {\n this.events.animationCancel.notify();\n }\n }\n this.clearAnimation();\n }\n /**\n * Returns `true` if this value is currently animating.\n *\n * @public\n */\n isAnimating() {\n return !!this.animation;\n }\n clearAnimation() {\n delete this.animation;\n }\n /**\n * Destroy and clean up subscribers to this `MotionValue`.\n *\n * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically\n * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually\n * created a `MotionValue` via the `motionValue` function.\n *\n * @public\n */\n destroy() {\n this.dependents?.clear();\n this.events.destroy?.notify();\n this.clearListeners();\n this.stop();\n if (this.stopPassiveEffect) {\n this.stopPassiveEffect();\n }\n }\n}\nfunction motionValue(init, options) {\n return new MotionValue(init, options);\n}\n\nexport { MotionValue, collectMotionValues, motionValue };\n//# sourceMappingURL=index.mjs.map\n","/**\n * If `transition` has `inherit: true`, shallow-merge it with\n * `parentTransition` (child keys win) and strip the `inherit` key.\n * Otherwise return `transition` unchanged.\n */\nfunction resolveTransition(transition, parentTransition) {\n if (transition?.inherit && parentTransition) {\n const { inherit: _, ...rest } = transition;\n return { ...parentTransition, ...rest };\n }\n return transition;\n}\n\nexport { resolveTransition };\n//# sourceMappingURL=resolve-transition.mjs.map\n","import { resolveTransition } from './resolve-transition.mjs';\n\nfunction getValueTransition(transition, key) {\n const valueTransition = transition?.[key] ??\n transition?.[\"default\"] ??\n transition;\n if (valueTransition !== transition) {\n return resolveTransition(valueTransition, transition);\n }\n return valueTransition;\n}\n\nexport { getValueTransition };\n//# sourceMappingURL=get-value-transition.mjs.map\n","import { transformProps } from '../../render/utils/keys-transform.mjs';\n\nconst underDampedSpring = {\n type: \"spring\",\n stiffness: 500,\n damping: 25,\n restSpeed: 10,\n};\nconst criticallyDampedSpring = (target) => ({\n type: \"spring\",\n stiffness: 550,\n damping: target === 0 ? 2 * Math.sqrt(550) : 30,\n restSpeed: 10,\n});\nconst keyframesTransition = {\n type: \"keyframes\",\n duration: 0.8,\n};\n/**\n * Default easing curve is a slightly shallower version of\n * the default browser easing curve.\n */\nconst ease = {\n type: \"keyframes\",\n ease: [0.25, 0.1, 0.35, 1],\n duration: 0.3,\n};\nconst getDefaultTransition = (valueKey, { keyframes }) => {\n if (keyframes.length > 2) {\n return keyframesTransition;\n }\n else if (transformProps.has(valueKey)) {\n return valueKey.startsWith(\"scale\")\n ? criticallyDampedSpring(keyframes[1])\n : underDampedSpring;\n }\n return ease;\n};\n\nexport { getDefaultTransition };\n//# sourceMappingURL=default-transitions.mjs.map\n","const orchestrationKeys = new Set([\n \"when\",\n \"delay\",\n \"delayChildren\",\n \"staggerChildren\",\n \"staggerDirection\",\n \"repeat\",\n \"repeatType\",\n \"repeatDelay\",\n \"from\",\n \"elapsed\",\n]);\n/**\n * Decide whether a transition is defined on a given Transition.\n * This filters out orchestration options and returns true\n * if any options are left.\n */\nfunction isTransitionDefined(transition) {\n for (const key in transition) {\n if (!orchestrationKeys.has(key))\n return true;\n }\n return false;\n}\n\nexport { isTransitionDefined };\n//# sourceMappingURL=is-transition-defined.mjs.map\n","import { secondsToMilliseconds, MotionGlobalConfig } from 'motion-utils';\nimport { AsyncMotionValueAnimation } from '../AsyncMotionValueAnimation.mjs';\nimport { JSAnimation } from '../JSAnimation.mjs';\nimport { getValueTransition } from '../utils/get-value-transition.mjs';\nimport { makeAnimationInstant } from '../utils/make-animation-instant.mjs';\nimport { getDefaultTransition } from '../utils/default-transitions.mjs';\nimport { getFinalKeyframe } from '../keyframes/get-final.mjs';\nimport { isTransitionDefined } from '../utils/is-transition-defined.mjs';\nimport { frame } from '../../frameloop/frame.mjs';\n\nconst animateMotionValue = (name, value, target, transition = {}, element, isHandoff) => (onComplete) => {\n const valueTransition = getValueTransition(transition, name) || {};\n /**\n * Most transition values are currently completely overwritten by value-specific\n * transitions. In the future it'd be nicer to blend these transitions. But for now\n * delay actually does inherit from the root transition if not value-specific.\n */\n const delay = valueTransition.delay || transition.delay || 0;\n /**\n * Elapsed isn't a public transition option but can be passed through from\n * optimized appear effects in milliseconds.\n */\n let { elapsed = 0 } = transition;\n elapsed = elapsed - secondsToMilliseconds(delay);\n const options = {\n keyframes: Array.isArray(target) ? target : [null, target],\n ease: \"easeOut\",\n velocity: value.getVelocity(),\n ...valueTransition,\n delay: -elapsed,\n onUpdate: (v) => {\n value.set(v);\n valueTransition.onUpdate && valueTransition.onUpdate(v);\n },\n onComplete: () => {\n onComplete();\n valueTransition.onComplete && valueTransition.onComplete();\n },\n name,\n motionValue: value,\n element: isHandoff ? undefined : element,\n };\n /**\n * If there's no transition defined for this value, we can generate\n * unique transition settings for this value.\n */\n if (!isTransitionDefined(valueTransition)) {\n Object.assign(options, getDefaultTransition(name, options));\n }\n /**\n * Both WAAPI and our internal animation functions use durations\n * as defined by milliseconds, while our external API defines them\n * as seconds.\n */\n options.duration && (options.duration = secondsToMilliseconds(options.duration));\n options.repeatDelay && (options.repeatDelay = secondsToMilliseconds(options.repeatDelay));\n /**\n * Support deprecated way to set initial value. Prefer keyframe syntax.\n */\n if (options.from !== undefined) {\n options.keyframes[0] = options.from;\n }\n let shouldSkip = false;\n if (options.type === false ||\n (options.duration === 0 && !options.repeatDelay)) {\n makeAnimationInstant(options);\n if (options.delay === 0) {\n shouldSkip = true;\n }\n }\n if (MotionGlobalConfig.instantAnimations ||\n MotionGlobalConfig.skipAnimations ||\n element?.shouldSkipAnimations ||\n valueTransition.skipAnimations) {\n shouldSkip = true;\n makeAnimationInstant(options);\n options.delay = 0;\n }\n /**\n * If the transition type or easing has been explicitly set by the user\n * then we don't want to allow flattening the animation.\n */\n options.allowFlatten = !valueTransition.type && !valueTransition.ease;\n /**\n * If we can or must skip creating the animation, and apply only\n * the final keyframe, do so. We also check once keyframes are resolved but\n * this early check prevents the need to create an animation at all.\n */\n if (shouldSkip && !isHandoff && value.get() !== undefined) {\n const finalKeyframe = getFinalKeyframe(options.keyframes, valueTransition);\n if (finalKeyframe !== undefined) {\n frame.update(() => {\n options.onUpdate(finalKeyframe);\n options.onComplete();\n });\n return;\n }\n }\n return valueTransition.isSync\n ? new JSAnimation(options)\n : new AsyncMotionValueAnimation(options);\n};\n\nexport { animateMotionValue };\n//# sourceMappingURL=motion-value.mjs.map\n","import { invariant, isNumericalString } from 'motion-utils';\nimport { isCSSVariableToken } from './is-css-variable.mjs';\n\n/**\n * Parse Framer's special CSS variable format into a CSS token and a fallback.\n *\n * ```\n * `var(--foo, #fff)` => [`--foo`, '#fff']\n * ```\n *\n * @param current\n */\nconst splitCSSVariableRegex = \n// eslint-disable-next-line redos-detector/no-unsafe-regex -- false positive, as it can match a lot of words\n/^var\\(--(?:([\\w-]+)|([\\w-]+), ?([a-zA-Z\\d ()%#.,-]+))\\)/u;\nfunction parseCSSVariable(current) {\n const match = splitCSSVariableRegex.exec(current);\n if (!match)\n return [,];\n const [, token1, token2, fallback] = match;\n return [`--${token1 ?? token2}`, fallback];\n}\nconst maxDepth = 4;\nfunction getVariableValue(current, element, depth = 1) {\n invariant(depth <= maxDepth, `Max CSS variable fallback depth detected in property \"${current}\". This may indicate a circular fallback dependency.`, \"max-css-var-depth\");\n const [token, fallback] = parseCSSVariable(current);\n // No CSS variable detected\n if (!token)\n return;\n // Attempt to read this CSS variable off the element\n const resolved = window.getComputedStyle(element).getPropertyValue(token);\n if (resolved) {\n const trimmed = resolved.trim();\n return isNumericalString(trimmed) ? parseFloat(trimmed) : trimmed;\n }\n return isCSSVariableToken(fallback)\n ? getVariableValue(fallback, element, depth + 1)\n : fallback;\n}\n\nexport { getVariableValue, parseCSSVariable };\n//# sourceMappingURL=css-variables-conversion.mjs.map\n","function getValueState(visualElement) {\n const state = [{}, {}];\n visualElement?.values.forEach((value, key) => {\n state[0][key] = value.get();\n state[1][key] = value.getVelocity();\n });\n return state;\n}\nfunction resolveVariantFromProps(props, definition, custom, visualElement) {\n /**\n * If the variant definition is a function, resolve.\n */\n if (typeof definition === \"function\") {\n const [current, velocity] = getValueState(visualElement);\n definition = definition(custom !== undefined ? custom : props.custom, current, velocity);\n }\n /**\n * If the variant definition is a variant label, or\n * the function returned a variant label, resolve.\n */\n if (typeof definition === \"string\") {\n definition = props.variants && props.variants[definition];\n }\n /**\n * At this point we've resolved both functions and variant labels,\n * but the resolved variant label might itself have been a function.\n * If so, resolve. This can only have returned a valid target object.\n */\n if (typeof definition === \"function\") {\n const [current, velocity] = getValueState(visualElement);\n definition = definition(custom !== undefined ? custom : props.custom, current, velocity);\n }\n return definition;\n}\n\nexport { resolveVariantFromProps };\n//# sourceMappingURL=resolve-variants.mjs.map\n","import { resolveVariantFromProps } from './resolve-variants.mjs';\n\nfunction resolveVariant(visualElement, definition, custom) {\n const props = visualElement.getProps();\n return resolveVariantFromProps(props, definition, custom !== undefined ? custom : props.custom, visualElement);\n}\n\nexport { resolveVariant };\n//# sourceMappingURL=resolve-dynamic-variants.mjs.map\n","import { transformPropOrder } from './keys-transform.mjs';\n\nconst positionalKeys = new Set([\n \"width\",\n \"height\",\n \"top\",\n \"left\",\n \"right\",\n \"bottom\",\n ...transformPropOrder,\n]);\n\nexport { positionalKeys };\n//# sourceMappingURL=keys-position.mjs.map\n","const isKeyframesTarget = (v) => {\n return Array.isArray(v);\n};\n\nexport { isKeyframesTarget };\n//# sourceMappingURL=is-keyframes-target.mjs.map\n","import { motionValue } from '../../value/index.mjs';\nimport { resolveVariant } from './resolve-dynamic-variants.mjs';\nimport { isKeyframesTarget } from './is-keyframes-target.mjs';\n\n/**\n * Set VisualElement's MotionValue, creating a new MotionValue for it if\n * it doesn't exist.\n */\nfunction setMotionValue(visualElement, key, value) {\n if (visualElement.hasValue(key)) {\n visualElement.getValue(key).set(value);\n }\n else {\n visualElement.addValue(key, motionValue(value));\n }\n}\nfunction resolveFinalValueInKeyframes(v) {\n // TODO maybe throw if v.length - 1 is placeholder token?\n return isKeyframesTarget(v) ? v[v.length - 1] || 0 : v;\n}\nfunction setTarget(visualElement, definition) {\n const resolved = resolveVariant(visualElement, definition);\n let { transitionEnd = {}, transition = {}, ...target } = resolved || {};\n target = { ...target, ...transitionEnd };\n for (const key in target) {\n const value = resolveFinalValueInKeyframes(target[key]);\n setMotionValue(visualElement, key, value);\n }\n}\n\nexport { setTarget };\n//# sourceMappingURL=setters.mjs.map\n","const isMotionValue = (value) => Boolean(value && value.getVelocity);\n\nexport { isMotionValue };\n//# sourceMappingURL=is-motion-value.mjs.map\n","import { MotionGlobalConfig } from 'motion-utils';\nimport { isWillChangeMotionValue } from './is.mjs';\n\nfunction addValueToWillChange(visualElement, key) {\n const willChange = visualElement.getValue(\"willChange\");\n /**\n * It could be that a user has set willChange to a regular MotionValue,\n * in which case we can't add the value to it.\n */\n if (isWillChangeMotionValue(willChange)) {\n return willChange.add(key);\n }\n else if (!willChange && MotionGlobalConfig.WillChange) {\n const newWillChange = new MotionGlobalConfig.WillChange(\"auto\");\n visualElement.addValue(\"willChange\", newWillChange);\n newWillChange.add(key);\n }\n}\n\nexport { addValueToWillChange };\n//# sourceMappingURL=add-will-change.mjs.map\n","import { isMotionValue } from '../utils/is-motion-value.mjs';\n\nfunction isWillChangeMotionValue(value) {\n return Boolean(isMotionValue(value) && value.add);\n}\n\nexport { isWillChangeMotionValue };\n//# sourceMappingURL=is.mjs.map\n","function camelToDash(str) {\n return str.replace(/([A-Z])/g, (match) => `-${match.toLowerCase()}`);\n}\n\nexport { camelToDash };\n//# sourceMappingURL=camel-to-dash.mjs.map\n","import { camelToDash } from '../../render/dom/utils/camel-to-dash.mjs';\n\nconst optimizedAppearDataId = \"framerAppearId\";\nconst optimizedAppearDataAttribute = \"data-\" + camelToDash(optimizedAppearDataId);\n\nexport { optimizedAppearDataAttribute, optimizedAppearDataId };\n//# sourceMappingURL=data-id.mjs.map\n","import { optimizedAppearDataAttribute } from './data-id.mjs';\n\nfunction getOptimisedAppearId(visualElement) {\n return visualElement.props[optimizedAppearDataAttribute];\n}\n\nexport { getOptimisedAppearId };\n//# sourceMappingURL=get-appear-id.mjs.map\n","import { getValueTransition } from '../utils/get-value-transition.mjs';\nimport { resolveTransition } from '../utils/resolve-transition.mjs';\nimport { positionalKeys } from '../../render/utils/keys-position.mjs';\nimport { setTarget } from '../../render/utils/setters.mjs';\nimport { addValueToWillChange } from '../../value/will-change/add-will-change.mjs';\nimport { getOptimisedAppearId } from '../optimized-appear/get-appear-id.mjs';\nimport { animateMotionValue } from './motion-value.mjs';\nimport { frame } from '../../frameloop/frame.mjs';\n\n/**\n * Decide whether we should block this animation. Previously, we achieved this\n * just by checking whether the key was listed in protectedKeys, but this\n * posed problems if an animation was triggered by afterChildren and protectedKeys\n * had been set to true in the meantime.\n */\nfunction shouldBlockAnimation({ protectedKeys, needsAnimating }, key) {\n const shouldBlock = protectedKeys.hasOwnProperty(key) && needsAnimating[key] !== true;\n needsAnimating[key] = false;\n return shouldBlock;\n}\nfunction animateTarget(visualElement, targetAndTransition, { delay = 0, transitionOverride, type } = {}) {\n let { transition, transitionEnd, ...target } = targetAndTransition;\n const defaultTransition = visualElement.getDefaultTransition();\n transition = transition\n ? resolveTransition(transition, defaultTransition)\n : defaultTransition;\n const reduceMotion = transition?.reduceMotion;\n const skipAnimations = transition?.skipAnimations;\n if (transitionOverride)\n transition = transitionOverride;\n const animations = [];\n const animationTypeState = type &&\n visualElement.animationState &&\n visualElement.animationState.getState()[type];\n const path = transition?.path;\n if (path) {\n // path mutates `target` to claim x/y; loop below skips them.\n path.animateVisualElement(visualElement, target, transition, delay, animations);\n }\n for (const key in target) {\n const value = visualElement.getValue(key, visualElement.latestValues[key] ?? null);\n const valueTarget = target[key];\n if (valueTarget === undefined ||\n (animationTypeState &&\n shouldBlockAnimation(animationTypeState, key))) {\n continue;\n }\n const valueTransition = {\n delay,\n ...getValueTransition(transition || {}, key),\n };\n if (skipAnimations)\n valueTransition.skipAnimations = true;\n /**\n * If the value is already at the defined target, skip the animation.\n * We still re-assert the value via frame.update to take precedence\n * over any stale transitionEnd callbacks from previous animations.\n */\n const currentValue = value.get();\n if (currentValue !== undefined &&\n !value.isAnimating() &&\n !Array.isArray(valueTarget) &&\n valueTarget === currentValue &&\n !valueTransition.velocity) {\n frame.update(() => value.set(valueTarget));\n continue;\n }\n /**\n * If this is the first time a value is being animated, check\n * to see if we're handling off from an existing animation.\n */\n let isHandoff = false;\n if (window.MotionHandoffAnimation) {\n const appearId = getOptimisedAppearId(visualElement);\n if (appearId) {\n const startTime = window.MotionHandoffAnimation(appearId, key, frame);\n if (startTime !== null) {\n valueTransition.startTime = startTime;\n isHandoff = true;\n }\n }\n }\n addValueToWillChange(visualElement, key);\n const shouldReduceMotion = reduceMotion ?? visualElement.shouldReduceMotion;\n value.start(animateMotionValue(key, value, valueTarget, shouldReduceMotion && positionalKeys.has(key)\n ? { type: false }\n : valueTransition, visualElement, isHandoff));\n const animation = value.animation;\n if (animation) {\n animations.push(animation);\n }\n }\n if (transitionEnd) {\n const applyTransitionEnd = () => frame.update(() => {\n transitionEnd && setTarget(visualElement, transitionEnd);\n });\n if (animations.length) {\n Promise.all(animations).then(applyTransitionEnd);\n }\n else {\n applyTransitionEnd();\n }\n }\n return animations;\n}\n\nexport { animateTarget };\n//# sourceMappingURL=visual-element-target.mjs.map\n","import { resolveVariant } from '../../render/utils/resolve-dynamic-variants.mjs';\nimport { calcChildStagger } from '../utils/calc-child-stagger.mjs';\nimport { animateTarget } from './visual-element-target.mjs';\n\nfunction animateVariant(visualElement, variant, options = {}) {\n const resolved = resolveVariant(visualElement, variant, options.type === \"exit\"\n ? visualElement.presenceContext?.custom\n : undefined);\n let { transition = visualElement.getDefaultTransition() || {} } = resolved || {};\n if (options.transitionOverride) {\n transition = options.transitionOverride;\n }\n /**\n * If we have a variant, create a callback that runs it as an animation.\n * Otherwise, we resolve a Promise immediately for a composable no-op.\n */\n const getAnimation = resolved\n ? () => Promise.all(animateTarget(visualElement, resolved, options))\n : () => Promise.resolve();\n /**\n * If we have children, create a callback that runs all their animations.\n * Otherwise, we resolve a Promise immediately for a composable no-op.\n */\n const getChildAnimations = visualElement.variantChildren && visualElement.variantChildren.size\n ? (forwardDelay = 0) => {\n const { delayChildren = 0, staggerChildren, staggerDirection, } = transition;\n return animateChildren(visualElement, variant, forwardDelay, delayChildren, staggerChildren, staggerDirection, options);\n }\n : () => Promise.resolve();\n /**\n * If the transition explicitly defines a \"when\" option, we need to resolve either\n * this animation or all children animations before playing the other.\n */\n const { when } = transition;\n if (when) {\n const [first, last] = when === \"beforeChildren\"\n ? [getAnimation, getChildAnimations]\n : [getChildAnimations, getAnimation];\n return first().then(() => last());\n }\n else {\n return Promise.all([getAnimation(), getChildAnimations(options.delay)]);\n }\n}\nfunction animateChildren(visualElement, variant, delay = 0, delayChildren = 0, staggerChildren = 0, staggerDirection = 1, options) {\n const animations = [];\n for (const child of visualElement.variantChildren) {\n child.notify(\"AnimationStart\", variant);\n animations.push(animateVariant(child, variant, {\n ...options,\n delay: delay +\n (typeof delayChildren === \"function\" ? 0 : delayChildren) +\n calcChildStagger(visualElement.variantChildren, child, delayChildren, staggerChildren, staggerDirection),\n }).then(() => child.notify(\"AnimationComplete\", variant)));\n }\n return Promise.all(animations);\n}\n\nexport { animateVariant };\n//# sourceMappingURL=visual-element-variant.mjs.map\n","/**\n * ValueType for \"auto\"\n */\nconst auto = {\n test: (v) => v === \"auto\",\n parse: (v) => v,\n};\n\nexport { auto };\n//# sourceMappingURL=auto.mjs.map\n","/**\n * Tests a provided value against a ValueType\n */\nconst testValueType = (v) => (type) => type.test(v);\n\nexport { testValueType };\n//# sourceMappingURL=test.mjs.map\n","import { auto } from './auto.mjs';\nimport { number } from './numbers/index.mjs';\nimport { px, percent, degrees, vw, vh } from './numbers/units.mjs';\nimport { testValueType } from './test.mjs';\n\n/**\n * A list of value types commonly used for dimensions\n */\nconst dimensionValueTypes = [number, px, percent, degrees, vw, vh, auto];\n/**\n * Tests a dimensional value against the list of dimension ValueTypes\n */\nconst findDimensionValueType = (v) => dimensionValueTypes.find(testValueType(v));\n\nexport { dimensionValueTypes, findDimensionValueType };\n//# sourceMappingURL=dimensions.mjs.map\n","import { isZeroValueString } from 'motion-utils';\n\nfunction isNone(value) {\n if (typeof value === \"number\") {\n return value === 0;\n }\n else if (value !== null) {\n return value === \"none\" || value === \"0\" || isZeroValueString(value);\n }\n else {\n return true;\n }\n}\n\nexport { isNone };\n//# sourceMappingURL=is-none.mjs.map\n","import { complex } from './index.mjs';\nimport { floatRegex } from '../utils/float-regex.mjs';\n\n/**\n * Properties that should default to 1 or 100%\n */\nconst maxDefaults = new Set([\"brightness\", \"contrast\", \"saturate\", \"opacity\"]);\nfunction applyDefaultFilter(v) {\n const [name, value] = v.slice(0, -1).split(\"(\");\n if (name === \"drop-shadow\")\n return v;\n const [number] = value.match(floatRegex) || [];\n if (!number)\n return v;\n const unit = value.replace(number, \"\");\n let defaultValue = maxDefaults.has(name) ? 1 : 0;\n if (number !== value)\n defaultValue *= 100;\n return name + \"(\" + defaultValue + unit + \")\";\n}\nconst functionRegex = /\\b([a-z-]*)\\(.*?\\)/gu;\nconst filter = {\n ...complex,\n getAnimatableNone: (v) => {\n const functions = v.match(functionRegex);\n return functions ? functions.map(applyDefaultFilter).join(\" \") : v;\n },\n};\n\nexport { filter };\n//# sourceMappingURL=filter.mjs.map\n","import { complex } from './index.mjs';\n\nconst mask = {\n ...complex,\n getAnimatableNone: (v) => {\n const parsed = complex.parse(v);\n const transformer = complex.createTransformer(v);\n return transformer(parsed.map((v) => typeof v === \"number\" ? 0 : typeof v === \"object\" ? { ...v, alpha: 1 } : v));\n },\n};\n\nexport { mask };\n//# sourceMappingURL=mask.mjs.map\n","import { number } from './numbers/index.mjs';\n\nconst int = {\n ...number,\n transform: Math.round,\n};\n\nexport { int };\n//# sourceMappingURL=int.mjs.map\n","import { int } from '../int.mjs';\nimport { alpha } from '../numbers/index.mjs';\nimport { px } from '../numbers/units.mjs';\nimport { transformValueTypes } from './transform.mjs';\n\nconst numberValueTypes = {\n // Border props\n borderWidth: px,\n borderTopWidth: px,\n borderRightWidth: px,\n borderBottomWidth: px,\n borderLeftWidth: px,\n borderRadius: px,\n borderTopLeftRadius: px,\n borderTopRightRadius: px,\n borderBottomRightRadius: px,\n borderBottomLeftRadius: px,\n // Positioning props\n width: px,\n maxWidth: px,\n height: px,\n maxHeight: px,\n top: px,\n right: px,\n bottom: px,\n left: px,\n inset: px,\n insetBlock: px,\n insetBlockStart: px,\n insetBlockEnd: px,\n insetInline: px,\n insetInlineStart: px,\n insetInlineEnd: px,\n // Spacing props\n padding: px,\n paddingTop: px,\n paddingRight: px,\n paddingBottom: px,\n paddingLeft: px,\n paddingBlock: px,\n paddingBlockStart: px,\n paddingBlockEnd: px,\n paddingInline: px,\n paddingInlineStart: px,\n paddingInlineEnd: px,\n margin: px,\n marginTop: px,\n marginRight: px,\n marginBottom: px,\n marginLeft: px,\n marginBlock: px,\n marginBlockStart: px,\n marginBlockEnd: px,\n marginInline: px,\n marginInlineStart: px,\n marginInlineEnd: px,\n // Typography\n fontSize: px,\n // Misc\n backgroundPositionX: px,\n backgroundPositionY: px,\n ...transformValueTypes,\n zIndex: int,\n // SVG\n fillOpacity: alpha,\n strokeOpacity: alpha,\n numOctaves: int,\n};\n\nexport { numberValueTypes };\n//# sourceMappingURL=number.mjs.map\n","import { alpha, scale } from '../numbers/index.mjs';\nimport { px, progressPercentage, degrees } from '../numbers/units.mjs';\n\nconst transformValueTypes = {\n rotate: degrees,\n /**\n * Internal channel for `transition.path` orientToPath. Composed onto\n * `rotate` at the transform-build sites so the user's `rotate` is\n * never read or overwritten. Not part of `transformPropOrder`.\n */\n pathRotation: degrees,\n rotateX: degrees,\n rotateY: degrees,\n rotateZ: degrees,\n scale,\n scaleX: scale,\n scaleY: scale,\n scaleZ: scale,\n skew: degrees,\n skewX: degrees,\n skewY: degrees,\n distance: px,\n translateX: px,\n translateY: px,\n translateZ: px,\n x: px,\n y: px,\n z: px,\n perspective: px,\n transformPerspective: px,\n opacity: alpha,\n originX: progressPercentage,\n originY: progressPercentage,\n originZ: px,\n};\n\nexport { transformValueTypes };\n//# sourceMappingURL=transform.mjs.map\n","import { color } from '../color/index.mjs';\nimport { filter } from '../complex/filter.mjs';\nimport { mask } from '../complex/mask.mjs';\nimport { numberValueTypes } from './number.mjs';\n\n/**\n * A map of default value types for common values\n */\nconst defaultValueTypes = {\n ...numberValueTypes,\n // Color props\n color,\n backgroundColor: color,\n outlineColor: color,\n fill: color,\n stroke: color,\n // Border props\n borderColor: color,\n borderTopColor: color,\n borderRightColor: color,\n borderBottomColor: color,\n borderLeftColor: color,\n filter,\n WebkitFilter: filter,\n mask,\n WebkitMask: mask,\n};\n/**\n * Gets the default ValueType for the provided value key\n */\nconst getDefaultValueType = (key) => defaultValueTypes[key];\n\nexport { defaultValueTypes, getDefaultValueType };\n//# sourceMappingURL=defaults.mjs.map\n","import { complex } from '../complex/index.mjs';\nimport { filter } from '../complex/filter.mjs';\nimport { mask } from '../complex/mask.mjs';\nimport { getDefaultValueType } from '../maps/defaults.mjs';\n\nconst customTypes = /*@__PURE__*/ new Set([filter, mask]);\nfunction getAnimatableNone(key, value) {\n let defaultValueType = getDefaultValueType(key);\n if (!customTypes.has(defaultValueType))\n defaultValueType = complex;\n // If value is not recognised as animatable, ie \"none\", create an animatable version origin based on the target\n return defaultValueType.getAnimatableNone\n ? defaultValueType.getAnimatableNone(value)\n : undefined;\n}\n\nexport { getAnimatableNone };\n//# sourceMappingURL=animatable-none.mjs.map\n","import { analyseComplexValue } from '../../../value/types/complex/index.mjs';\nimport { getAnimatableNone } from '../../../value/types/utils/animatable-none.mjs';\n\n/**\n * If we encounter keyframes like \"none\" or \"0\" and we also have keyframes like\n * \"#fff\" or \"200px 200px\" we want to find a keyframe to serve as a template for\n * the \"none\" keyframes. In this case \"#fff\" or \"200px 200px\" - then these get turned into\n * zero equivalents, i.e. \"#fff0\" or \"0px 0px\".\n */\nconst invalidTemplates = new Set([\"auto\", \"none\", \"0\"]);\nfunction makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, name) {\n let i = 0;\n let animatableTemplate = undefined;\n while (i < unresolvedKeyframes.length && !animatableTemplate) {\n const keyframe = unresolvedKeyframes[i];\n if (typeof keyframe === \"string\" &&\n !invalidTemplates.has(keyframe) &&\n analyseComplexValue(keyframe).values.length) {\n animatableTemplate = unresolvedKeyframes[i];\n }\n i++;\n }\n if (animatableTemplate && name) {\n for (const noneIndex of noneKeyframeIndexes) {\n unresolvedKeyframes[noneIndex] = getAnimatableNone(name, animatableTemplate);\n }\n }\n}\n\nexport { makeNoneKeyframesAnimatable };\n//# sourceMappingURL=make-none-animatable.mjs.map\n","import { positionalKeys } from '../../render/utils/keys-position.mjs';\nimport { findDimensionValueType } from '../../value/types/dimensions.mjs';\nimport { getVariableValue } from '../utils/css-variables-conversion.mjs';\nimport { isCSSVariableToken, containsCSSVariable } from '../utils/is-css-variable.mjs';\nimport { KeyframeResolver } from './KeyframesResolver.mjs';\nimport { isNone } from './utils/is-none.mjs';\nimport { makeNoneKeyframesAnimatable } from './utils/make-none-animatable.mjs';\nimport { positionalValues, isNumOrPxType } from './utils/unit-conversion.mjs';\n\nclass DOMKeyframesResolver extends KeyframeResolver {\n constructor(unresolvedKeyframes, onComplete, name, motionValue, element) {\n super(unresolvedKeyframes, onComplete, name, motionValue, element, true);\n }\n readKeyframes() {\n const { unresolvedKeyframes, element, name } = this;\n if (!element || !element.current)\n return;\n super.readKeyframes();\n /**\n * If any keyframe is a CSS variable, we need to find its value by sampling the element\n */\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n let keyframe = unresolvedKeyframes[i];\n if (typeof keyframe === \"string\") {\n keyframe = keyframe.trim();\n if (isCSSVariableToken(keyframe)) {\n const resolved = getVariableValue(keyframe, element.current);\n if (resolved !== undefined) {\n unresolvedKeyframes[i] = resolved;\n }\n if (i === unresolvedKeyframes.length - 1) {\n this.finalKeyframe = keyframe;\n }\n }\n }\n }\n /**\n * Resolve \"none\" values. We do this potentially twice - once before and once after measuring keyframes.\n * This could be seen as inefficient but it's a trade-off to avoid measurements in more situations, which\n * have a far bigger performance impact.\n */\n this.resolveNoneKeyframes();\n /**\n * Check to see if unit type has changed. If so schedule jobs that will\n * temporarily set styles to the destination keyframes.\n * Skip if we have more than two keyframes or this isn't a positional value.\n * TODO: We can throw if there are multiple keyframes and the value type changes.\n */\n if (!positionalKeys.has(name) || unresolvedKeyframes.length !== 2) {\n return;\n }\n const [origin, target] = unresolvedKeyframes;\n const originType = findDimensionValueType(origin);\n const targetType = findDimensionValueType(target);\n /**\n * If one keyframe contains embedded CSS variables (e.g. in calc()) and the other\n * doesn't, we need to measure to convert to pixels. This handles GitHub issue #3410.\n */\n const originHasVar = containsCSSVariable(origin);\n const targetHasVar = containsCSSVariable(target);\n if (originHasVar !== targetHasVar && positionalValues[name]) {\n this.needsMeasurement = true;\n return;\n }\n /**\n * Either we don't recognise these value types or we can animate between them.\n */\n if (originType === targetType)\n return;\n /**\n * If both values are numbers or pixels, we can animate between them by\n * converting them to numbers.\n */\n if (isNumOrPxType(originType) && isNumOrPxType(targetType)) {\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n const value = unresolvedKeyframes[i];\n if (typeof value === \"string\") {\n unresolvedKeyframes[i] = parseFloat(value);\n }\n }\n }\n else if (positionalValues[name]) {\n /**\n * Else, the only way to resolve this is by measuring the element.\n */\n this.needsMeasurement = true;\n }\n }\n resolveNoneKeyframes() {\n const { unresolvedKeyframes, name } = this;\n const noneKeyframeIndexes = [];\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n if (unresolvedKeyframes[i] === null ||\n isNone(unresolvedKeyframes[i])) {\n noneKeyframeIndexes.push(i);\n }\n }\n if (noneKeyframeIndexes.length) {\n makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, name);\n }\n }\n measureInitialState() {\n const { element, unresolvedKeyframes, name } = this;\n if (!element || !element.current)\n return;\n if (name === \"height\") {\n this.suspendedScrollY = window.pageYOffset;\n }\n this.measuredOrigin = positionalValues[name](element.measureViewportBox(), window.getComputedStyle(element.current));\n unresolvedKeyframes[0] = this.measuredOrigin;\n // Set final key frame to measure after next render\n const measureKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1];\n if (measureKeyframe !== undefined) {\n element.getValue(name, measureKeyframe).jump(measureKeyframe, false);\n }\n }\n measureEndState() {\n const { element, name, unresolvedKeyframes } = this;\n if (!element || !element.current)\n return;\n const value = element.getValue(name);\n value && value.jump(this.measuredOrigin, false);\n const finalKeyframeIndex = unresolvedKeyframes.length - 1;\n const finalKeyframe = unresolvedKeyframes[finalKeyframeIndex];\n unresolvedKeyframes[finalKeyframeIndex] = positionalValues[name](element.measureViewportBox(), window.getComputedStyle(element.current));\n if (finalKeyframe !== null && this.finalKeyframe === undefined) {\n this.finalKeyframe = finalKeyframe;\n }\n // If we removed transform values, reapply them before the next render\n if (this.removedTransforms?.length) {\n this.removedTransforms.forEach(([unsetTransformName, unsetTransformValue]) => {\n element\n .getValue(unsetTransformName)\n .set(unsetTransformValue);\n });\n }\n this.resolveNoneKeyframes();\n }\n}\n\nexport { DOMKeyframesResolver };\n//# sourceMappingURL=DOMKeyframesResolver.mjs.map\n","/**\n * The four corner-radius longhands. Shared so the projection mixer, scale\n * corrector, WAAPI px-value set and view-transition crop pass don't each carry\n * their own copy. Order is irrelevant - every consumer mixes/corrects/animates\n * each corner independently.\n */\nconst cornerRadiusProps = [\n \"borderTopLeftRadius\",\n \"borderTopRightRadius\",\n \"borderBottomRightRadius\",\n \"borderBottomLeftRadius\",\n];\n\nexport { cornerRadiusProps };\n//# sourceMappingURL=border-radius.mjs.map\n","function resolveElements(elementOrSelector, scope, selectorCache) {\n if (elementOrSelector == null) {\n return [];\n }\n if (elementOrSelector instanceof EventTarget) {\n return [elementOrSelector];\n }\n else if (typeof elementOrSelector === \"string\") {\n let root = document;\n if (scope) {\n root = scope.current;\n }\n const elements = selectorCache?.[elementOrSelector] ??\n root.querySelectorAll(elementOrSelector);\n return elements ? Array.from(elements) : [];\n }\n return Array.from(elementOrSelector).filter((element) => element != null);\n}\n\nexport { resolveElements };\n//# sourceMappingURL=resolve-elements.mjs.map\n","/**\n * Provided a value and a ValueType, returns the value as that value type.\n */\nconst getValueAsType = (value, type) => {\n return type && typeof value === \"number\"\n ? type.transform(value)\n : value;\n};\n\nexport { getValueAsType };\n//# sourceMappingURL=get-as-type.mjs.map\n","import { createRenderBatcher } from './batcher.mjs';\n\nconst { schedule: microtask, cancel: cancelMicrotask } = \n/* @__PURE__ */ createRenderBatcher(queueMicrotask, false);\n\nexport { cancelMicrotask, microtask };\n//# sourceMappingURL=microtask.mjs.map\n","const isDragging = {\n x: false,\n y: false,\n};\nfunction isDragActive() {\n return isDragging.x || isDragging.y;\n}\n\nexport { isDragActive, isDragging };\n//# sourceMappingURL=is-active.mjs.map\n","import { resolveElements } from '../../utils/resolve-elements.mjs';\n\nfunction setupGesture(elementOrSelector, options) {\n const elements = resolveElements(elementOrSelector);\n const gestureAbortController = new AbortController();\n const eventOptions = {\n passive: true,\n ...options,\n signal: gestureAbortController.signal,\n };\n const cancel = () => gestureAbortController.abort();\n return [elements, eventOptions, cancel];\n}\n\nexport { setupGesture };\n//# sourceMappingURL=setup.mjs.map\n","import { isDragActive } from './drag/state/is-active.mjs';\nimport { setupGesture } from './utils/setup.mjs';\n\nfunction isValidHover(event) {\n return !(event.pointerType === \"touch\" || isDragActive());\n}\n/**\n * Create a hover gesture. hover() is different to .addEventListener(\"pointerenter\")\n * in that it has an easier syntax, filters out polyfilled touch events, interoperates\n * with drag gestures, and automatically removes the \"pointerennd\" event listener when the hover ends.\n *\n * @public\n */\nfunction hover(elementOrSelector, onHoverStart, options = {}) {\n const [elements, eventOptions, cancel] = setupGesture(elementOrSelector, options);\n elements.forEach((element) => {\n let isPressed = false;\n let deferredHoverEnd = false;\n let hoverEndCallback;\n const removePointerLeave = () => {\n element.removeEventListener(\"pointerleave\", onPointerLeave);\n };\n const endHover = (event) => {\n if (hoverEndCallback) {\n hoverEndCallback(event);\n hoverEndCallback = undefined;\n }\n removePointerLeave();\n };\n const onPointerUp = (event) => {\n isPressed = false;\n window.removeEventListener(\"pointerup\", onPointerUp);\n window.removeEventListener(\"pointercancel\", onPointerUp);\n if (deferredHoverEnd) {\n deferredHoverEnd = false;\n endHover(event);\n }\n };\n const onPointerDown = () => {\n isPressed = true;\n window.addEventListener(\"pointerup\", onPointerUp, eventOptions);\n window.addEventListener(\"pointercancel\", onPointerUp, eventOptions);\n };\n const onPointerLeave = (leaveEvent) => {\n if (leaveEvent.pointerType === \"touch\")\n return;\n if (isPressed) {\n deferredHoverEnd = true;\n return;\n }\n endHover(leaveEvent);\n };\n const onPointerEnter = (enterEvent) => {\n if (!isValidHover(enterEvent))\n return;\n deferredHoverEnd = false;\n const onHoverEnd = onHoverStart(element, enterEvent);\n if (typeof onHoverEnd !== \"function\")\n return;\n hoverEndCallback = onHoverEnd;\n element.addEventListener(\"pointerleave\", onPointerLeave, eventOptions);\n };\n element.addEventListener(\"pointerenter\", onPointerEnter, eventOptions);\n element.addEventListener(\"pointerdown\", onPointerDown, eventOptions);\n });\n return cancel;\n}\n\nexport { hover };\n//# sourceMappingURL=hover.mjs.map\n","/**\n * Recursively traverse up the tree to check whether the provided child node\n * is the parent or a descendant of it.\n *\n * @param parent - Element to find\n * @param child - Element to test against parent\n */\nconst isNodeOrChild = (parent, child) => {\n if (!child) {\n return false;\n }\n else if (parent === child) {\n return true;\n }\n else {\n return isNodeOrChild(parent, child.parentElement);\n }\n};\n\nexport { isNodeOrChild };\n//# sourceMappingURL=is-node-or-child.mjs.map\n","const isPrimaryPointer = (event) => {\n if (event.pointerType === \"mouse\") {\n return typeof event.button !== \"number\" || event.button <= 0;\n }\n else {\n /**\n * isPrimary is true for all mice buttons, whereas every touch point\n * is regarded as its own input. So subsequent concurrent touch points\n * will be false.\n *\n * Specifically match against false here as incomplete versions of\n * PointerEvents in very old browser might have it set as undefined.\n */\n return event.isPrimary !== false;\n }\n};\n\nexport { isPrimaryPointer };\n//# sourceMappingURL=is-primary-pointer.mjs.map\n","const keyboardAccessibleElements = new Set([\n \"BUTTON\",\n \"INPUT\",\n \"SELECT\",\n \"TEXTAREA\",\n \"A\",\n]);\n/**\n * Checks if an element is natively keyboard accessible (focusable).\n * Used by the press gesture to determine if we need to add tabIndex.\n */\nfunction isElementKeyboardAccessible(element) {\n return (keyboardAccessibleElements.has(element.tagName) ||\n element.isContentEditable === true);\n}\nconst textInputElements = new Set([\"INPUT\", \"SELECT\", \"TEXTAREA\"]);\n/**\n * Checks if an element has text selection or direct interaction behavior\n * that should block drag gestures from starting.\n *\n * This specifically targets form controls where the user might want to select\n * text or interact with the control (e.g., sliders, dropdowns).\n *\n * Buttons and links are NOT included because they don't have click-and-move\n * actions of their own - they only respond to click events, so dragging\n * should still work when initiated from these elements.\n */\nfunction isElementTextInput(element) {\n return (textInputElements.has(element.tagName) ||\n element.isContentEditable === true);\n}\n\nexport { isElementKeyboardAccessible, isElementTextInput };\n//# sourceMappingURL=is-keyboard-accessible.mjs.map\n","const isPressing = new WeakSet();\n\nexport { isPressing };\n//# sourceMappingURL=state.mjs.map\n","import { isPressing } from './state.mjs';\n\n/**\n * Filter out events that are not \"Enter\" keys.\n */\nfunction filterEvents(callback) {\n return (event) => {\n if (event.key !== \"Enter\")\n return;\n callback(event);\n };\n}\nfunction firePointerEvent(target, type) {\n target.dispatchEvent(new PointerEvent(\"pointer\" + type, { isPrimary: true, bubbles: true }));\n}\nconst enableKeyboardPress = (focusEvent, eventOptions) => {\n const element = focusEvent.currentTarget;\n if (!element)\n return;\n const handleKeydown = filterEvents(() => {\n if (isPressing.has(element))\n return;\n firePointerEvent(element, \"down\");\n const handleKeyup = filterEvents(() => {\n firePointerEvent(element, \"up\");\n });\n const handleBlur = () => firePointerEvent(element, \"cancel\");\n element.addEventListener(\"keyup\", handleKeyup, eventOptions);\n element.addEventListener(\"blur\", handleBlur, eventOptions);\n });\n element.addEventListener(\"keydown\", handleKeydown, eventOptions);\n /**\n * Add an event listener that fires on blur to remove the keydown events.\n */\n element.addEventListener(\"blur\", () => element.removeEventListener(\"keydown\", handleKeydown), eventOptions);\n};\n\nexport { enableKeyboardPress };\n//# sourceMappingURL=keyboard.mjs.map\n","import { isHTMLElement } from '../../utils/is-html-element.mjs';\nimport { isDragActive } from '../drag/state/is-active.mjs';\nimport { isNodeOrChild } from '../utils/is-node-or-child.mjs';\nimport { isPrimaryPointer } from '../utils/is-primary-pointer.mjs';\nimport { setupGesture } from '../utils/setup.mjs';\nimport { isElementKeyboardAccessible } from './utils/is-keyboard-accessible.mjs';\nimport { enableKeyboardPress } from './utils/keyboard.mjs';\nimport { isPressing } from './utils/state.mjs';\n\n/**\n * Filter out events that are not primary pointer events, or are triggering\n * while a Motion gesture is active.\n */\nfunction isValidPressEvent(event) {\n return isPrimaryPointer(event) && !isDragActive();\n}\nconst claimedPointerDownEvents = new WeakSet();\n/**\n * Create a press gesture.\n *\n * Press is different to `\"pointerdown\"`, `\"pointerup\"` in that it\n * automatically filters out secondary pointer events like right\n * click and multitouch.\n *\n * It also adds accessibility support for keyboards, where\n * an element with a press gesture will receive focus and\n * trigger on Enter `\"keydown\"` and `\"keyup\"` events.\n *\n * This is different to a browser's `\"click\"` event, which does\n * respond to keyboards but only for the `\"click\"` itself, rather\n * than the press start and end/cancel. The element also needs\n * to be focusable for this to work, whereas a press gesture will\n * make an element focusable by default.\n *\n * @public\n */\nfunction press(targetOrSelector, onPressStart, options = {}) {\n const [targets, eventOptions, cancelEvents] = setupGesture(targetOrSelector, options);\n const startPress = (startEvent) => {\n const target = startEvent.currentTarget;\n if (!isValidPressEvent(startEvent))\n return;\n if (claimedPointerDownEvents.has(startEvent))\n return;\n isPressing.add(target);\n if (options.stopPropagation) {\n claimedPointerDownEvents.add(startEvent);\n }\n const onPressEnd = onPressStart(target, startEvent);\n /**\n * End listeners run in the capture phase so a descendant calling\n * stopPropagation() in its own pointerup handler can't prevent the\n * press gesture from ending. This also keeps the gesture-end\n * ordering consistent with the drag gesture. See #2794.\n */\n const endEventOptions = { ...eventOptions, capture: true };\n const onPointerEnd = (endEvent, success) => {\n window.removeEventListener(\"pointerup\", onPointerUp, endEventOptions);\n window.removeEventListener(\"pointercancel\", onPointerCancel, endEventOptions);\n if (isPressing.has(target)) {\n isPressing.delete(target);\n }\n if (!isValidPressEvent(endEvent)) {\n return;\n }\n if (typeof onPressEnd === \"function\") {\n onPressEnd(endEvent, { success });\n }\n };\n const onPointerUp = (upEvent) => {\n onPointerEnd(upEvent, target === window ||\n target === document ||\n options.useGlobalTarget ||\n isNodeOrChild(target, upEvent.target));\n };\n const onPointerCancel = (cancelEvent) => {\n onPointerEnd(cancelEvent, false);\n };\n window.addEventListener(\"pointerup\", onPointerUp, endEventOptions);\n window.addEventListener(\"pointercancel\", onPointerCancel, endEventOptions);\n };\n targets.forEach((target) => {\n const pointerDownTarget = options.useGlobalTarget ? window : target;\n pointerDownTarget.addEventListener(\"pointerdown\", startPress, eventOptions);\n if (isHTMLElement(target)) {\n target.addEventListener(\"focus\", (event) => enableKeyboardPress(event, eventOptions));\n if (!isElementKeyboardAccessible(target) &&\n !target.hasAttribute(\"tabindex\")) {\n target.tabIndex = 0;\n }\n }\n });\n return cancelEvents;\n}\n\nexport { press };\n//# sourceMappingURL=index.mjs.map\n","import { isObject } from 'motion-utils';\n\n/**\n * Checks if an element is an HTML element in a way\n * that works across iframes\n */\nfunction isHTMLElement(element) {\n return (isObject(element) &&\n \"offsetHeight\" in element &&\n !(\"ownerSVGElement\" in element));\n}\n\nexport { isHTMLElement };\n//# sourceMappingURL=is-html-element.mjs.map\n","import { isObject } from 'motion-utils';\n\n/**\n * Checks if an element is an SVG element in a way\n * that works across iframes\n */\nfunction isSVGElement(element) {\n return isObject(element) && \"ownerSVGElement\" in element;\n}\n\nexport { isSVGElement };\n//# sourceMappingURL=is-svg-element.mjs.map\n","import { isSVGElement } from '../utils/is-svg-element.mjs';\nimport { resolveElements } from '../utils/resolve-elements.mjs';\n\nconst resizeHandlers = new WeakMap();\nlet observer;\nconst getSize = (borderBoxAxis, svgAxis, htmlAxis) => (target, borderBoxSize) => {\n if (borderBoxSize && borderBoxSize[0]) {\n return borderBoxSize[0][(borderBoxAxis + \"Size\")];\n }\n else if (isSVGElement(target) && \"getBBox\" in target) {\n return target.getBBox()[svgAxis];\n }\n else {\n return target[htmlAxis];\n }\n};\nconst getWidth = /*@__PURE__*/ getSize(\"inline\", \"width\", \"offsetWidth\");\nconst getHeight = /*@__PURE__*/ getSize(\"block\", \"height\", \"offsetHeight\");\nfunction notifyTarget({ target, borderBoxSize }) {\n resizeHandlers.get(target)?.forEach((handler) => {\n handler(target, {\n get width() {\n return getWidth(target, borderBoxSize);\n },\n get height() {\n return getHeight(target, borderBoxSize);\n },\n });\n });\n}\nfunction notifyAll(entries) {\n entries.forEach(notifyTarget);\n}\nfunction createResizeObserver() {\n if (typeof ResizeObserver === \"undefined\")\n return;\n observer = new ResizeObserver(notifyAll);\n}\nfunction resizeElement(target, handler) {\n if (!observer)\n createResizeObserver();\n const elements = resolveElements(target);\n elements.forEach((element) => {\n let elementHandlers = resizeHandlers.get(element);\n if (!elementHandlers) {\n elementHandlers = new Set();\n resizeHandlers.set(element, elementHandlers);\n }\n elementHandlers.add(handler);\n observer?.observe(element);\n });\n return () => {\n elements.forEach((element) => {\n const elementHandlers = resizeHandlers.get(element);\n elementHandlers?.delete(handler);\n if (!elementHandlers?.size) {\n observer?.unobserve(element);\n }\n });\n };\n}\n\nexport { resizeElement };\n//# sourceMappingURL=handle-element.mjs.map\n","const windowCallbacks = new Set();\nlet windowResizeHandler;\nfunction createWindowResizeHandler() {\n windowResizeHandler = () => {\n const info = {\n get width() {\n return window.innerWidth;\n },\n get height() {\n return window.innerHeight;\n },\n };\n windowCallbacks.forEach((callback) => callback(info));\n };\n window.addEventListener(\"resize\", windowResizeHandler);\n}\nfunction resizeWindow(callback) {\n windowCallbacks.add(callback);\n if (!windowResizeHandler)\n createWindowResizeHandler();\n return () => {\n windowCallbacks.delete(callback);\n if (!windowCallbacks.size &&\n typeof windowResizeHandler === \"function\") {\n window.removeEventListener(\"resize\", windowResizeHandler);\n windowResizeHandler = undefined;\n }\n };\n}\n\nexport { resizeWindow };\n//# sourceMappingURL=handle-window.mjs.map\n","import { resizeElement } from './handle-element.mjs';\nimport { resizeWindow } from './handle-window.mjs';\n\nfunction resize(a, b) {\n return typeof a === \"function\" ? resizeWindow(a) : resizeElement(a, b);\n}\n\nexport { resize };\n//# sourceMappingURL=index.mjs.map\n","import { color } from '../color/index.mjs';\nimport { complex } from '../complex/index.mjs';\nimport { dimensionValueTypes } from '../dimensions.mjs';\nimport { testValueType } from '../test.mjs';\n\n/**\n * A list of all ValueTypes\n */\nconst valueTypes = [...dimensionValueTypes, color, complex];\n/**\n * Tests a value against the list of ValueTypes\n */\nconst findValueType = (v) => valueTypes.find(testValueType(v));\n\nexport { findValueType };\n//# sourceMappingURL=find.mjs.map\n","const createAxisDelta = () => ({\n translate: 0,\n scale: 1,\n origin: 0,\n originPoint: 0,\n});\nconst createDelta = () => ({\n x: createAxisDelta(),\n y: createAxisDelta(),\n});\nconst createAxis = () => ({ min: 0, max: 0 });\nconst createBox = () => ({\n x: createAxis(),\n y: createAxis(),\n});\n\nexport { createAxis, createAxisDelta, createBox, createDelta };\n//# sourceMappingURL=models.mjs.map\n","const visualElementStore = new WeakMap();\n\nexport { visualElementStore };\n//# sourceMappingURL=store.mjs.map\n","function isAnimationControls(v) {\n return (v !== null &&\n typeof v === \"object\" &&\n typeof v.start === \"function\");\n}\n\nexport { isAnimationControls };\n//# sourceMappingURL=is-animation-controls.mjs.map\n","/**\n * Decides if the supplied variable is variant label\n */\nfunction isVariantLabel(v) {\n return typeof v === \"string\" || Array.isArray(v);\n}\n\nexport { isVariantLabel };\n//# sourceMappingURL=is-variant-label.mjs.map\n","const variantPriorityOrder = [\n \"animate\",\n \"whileInView\",\n \"whileFocus\",\n \"whileHover\",\n \"whileTap\",\n \"whileDrag\",\n \"exit\",\n];\nconst variantProps = [\"initial\", ...variantPriorityOrder];\n\nexport { variantPriorityOrder, variantProps };\n//# sourceMappingURL=variant-props.mjs.map\n","import { isAnimationControls } from './is-animation-controls.mjs';\nimport { isVariantLabel } from './is-variant-label.mjs';\nimport { variantProps } from './variant-props.mjs';\n\nfunction isControllingVariants(props) {\n return (isAnimationControls(props.animate) ||\n variantProps.some((name) => isVariantLabel(props[name])));\n}\nfunction isVariantNode(props) {\n return Boolean(isControllingVariants(props) || props.variants);\n}\n\nexport { isControllingVariants, isVariantNode };\n//# sourceMappingURL=is-controlling-variants.mjs.map\n","// Does this device prefer reduced motion? Returns `null` server-side.\nconst prefersReducedMotion = { current: null };\nconst hasReducedMotionListener = { current: false };\n\nexport { hasReducedMotionListener, prefersReducedMotion };\n//# sourceMappingURL=state.mjs.map\n","import { hasReducedMotionListener, prefersReducedMotion } from './state.mjs';\n\nconst isBrowser = typeof window !== \"undefined\";\nfunction initPrefersReducedMotion() {\n hasReducedMotionListener.current = true;\n if (!isBrowser)\n return;\n if (window.matchMedia) {\n const motionMediaQuery = window.matchMedia(\"(prefers-reduced-motion)\");\n const setReducedMotionPreferences = () => (prefersReducedMotion.current = motionMediaQuery.matches);\n motionMediaQuery.addEventListener(\"change\", setReducedMotionPreferences);\n setReducedMotionPreferences();\n }\n else {\n prefersReducedMotion.current = false;\n }\n}\n\nexport { hasReducedMotionListener, initPrefersReducedMotion, prefersReducedMotion };\n//# sourceMappingURL=index.mjs.map\n","import { warnOnce, secondsToMilliseconds, isNumericalString, isZeroValueString, SubscriptionManager } from 'motion-utils';\nimport { KeyframeResolver } from '../animation/keyframes/KeyframesResolver.mjs';\nimport { NativeAnimation } from '../animation/NativeAnimation.mjs';\nimport { acceleratedValues } from '../animation/waapi/utils/accelerated-values.mjs';\nimport { microtask } from '../frameloop/microtask.mjs';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { createBox } from '../projection/geometry/models.mjs';\nimport { motionValue } from '../value/index.mjs';\nimport { complex } from '../value/types/complex/index.mjs';\nimport { getAnimatableNone } from '../value/types/utils/animatable-none.mjs';\nimport { findValueType } from '../value/types/utils/find.mjs';\nimport { isMotionValue } from '../value/utils/is-motion-value.mjs';\nimport { visualElementStore } from './store.mjs';\nimport { isControllingVariants, isVariantNode } from './utils/is-controlling-variants.mjs';\nimport { transformProps } from './utils/keys-transform.mjs';\nimport { updateMotionValuesFromProps } from './utils/motion-values.mjs';\nimport { initPrefersReducedMotion } from './utils/reduced-motion/index.mjs';\nimport { resolveVariantFromProps } from './utils/resolve-variants.mjs';\nimport { hasReducedMotionListener, prefersReducedMotion } from './utils/reduced-motion/state.mjs';\nimport { frame, cancelFrame } from '../frameloop/frame.mjs';\n\nconst propEventHandlers = [\n \"AnimationStart\",\n \"AnimationComplete\",\n \"Update\",\n \"BeforeLayoutMeasure\",\n \"LayoutMeasure\",\n \"LayoutAnimationStart\",\n \"LayoutAnimationComplete\",\n];\n/**\n * Static feature definitions - can be injected by framework layer\n */\nlet featureDefinitions = {};\n/**\n * Set feature definitions for all VisualElements.\n * This should be called by the framework layer (e.g., framer-motion) during initialization.\n */\nfunction setFeatureDefinitions(definitions) {\n featureDefinitions = definitions;\n}\n/**\n * Get the current feature definitions\n */\nfunction getFeatureDefinitions() {\n return featureDefinitions;\n}\n/**\n * A VisualElement is an imperative abstraction around UI elements such as\n * HTMLElement, SVGElement, Three.Object3D etc.\n */\nclass VisualElement {\n /**\n * This method takes React props and returns found MotionValues. For example, HTML\n * MotionValues will be found within the style prop, whereas for Three.js within attribute arrays.\n *\n * This isn't an abstract method as it needs calling in the constructor, but it is\n * intended to be one.\n */\n scrapeMotionValuesFromProps(_props, _prevProps, _visualElement) {\n return {};\n }\n constructor({ parent, props, presenceContext, reducedMotionConfig, skipAnimations, blockInitialAnimation, visualState, }, options = {}) {\n /**\n * A reference to the current underlying Instance, e.g. a HTMLElement\n * or Three.Mesh etc.\n */\n this.current = null;\n /**\n * A set containing references to this VisualElement's children.\n */\n this.children = new Set();\n /**\n * Determine what role this visual element should take in the variant tree.\n */\n this.isVariantNode = false;\n this.isControllingVariants = false;\n /**\n * Decides whether this VisualElement should animate in reduced motion\n * mode.\n *\n * TODO: This is currently set on every individual VisualElement but feels\n * like it could be set globally.\n */\n this.shouldReduceMotion = null;\n /**\n * Decides whether animations should be skipped for this VisualElement.\n * Useful for E2E tests and visual regression testing.\n */\n this.shouldSkipAnimations = false;\n /**\n * A map of all motion values attached to this visual element. Motion\n * values are source of truth for any given animated value. A motion\n * value might be provided externally by the component via props.\n */\n this.values = new Map();\n this.KeyframeResolver = KeyframeResolver;\n /**\n * Cleanup functions for active features (hover/tap/exit etc)\n */\n this.features = {};\n /**\n * A map of every subscription that binds the provided or generated\n * motion values onChange listeners to this visual element.\n */\n this.valueSubscriptions = new Map();\n /**\n * A reference to the previously-provided motion values as returned\n * from scrapeMotionValuesFromProps. We use the keys in here to determine\n * if any motion values need to be removed after props are updated.\n */\n this.prevMotionValues = {};\n /**\n * Track whether this element has been mounted before, to detect\n * remounts after Suspense unmount/remount cycles.\n */\n this.hasBeenMounted = false;\n /**\n * An object containing a SubscriptionManager for each active event.\n */\n this.events = {};\n /**\n * An object containing an unsubscribe function for each prop event subscription.\n * For example, every \"Update\" event can have multiple subscribers via\n * VisualElement.on(), but only one of those can be defined via the onUpdate prop.\n */\n this.propEventSubscriptions = {};\n this.notifyUpdate = () => this.notify(\"Update\", this.latestValues);\n this.render = () => {\n if (!this.current)\n return;\n this.triggerBuild();\n this.renderInstance(this.current, this.renderState, this.props.style, this.projection);\n };\n this.renderScheduledAt = 0.0;\n this.scheduleRender = () => {\n const now = time.now();\n if (this.renderScheduledAt < now) {\n this.renderScheduledAt = now;\n frame.render(this.render, false, true);\n }\n };\n const { latestValues, renderState } = visualState;\n this.latestValues = latestValues;\n this.baseTarget = { ...latestValues };\n this.initialValues = props.initial ? { ...latestValues } : {};\n this.renderState = renderState;\n this.parent = parent;\n this.props = props;\n this.presenceContext = presenceContext;\n this.depth = parent ? parent.depth + 1 : 0;\n this.reducedMotionConfig = reducedMotionConfig;\n this.skipAnimationsConfig = skipAnimations;\n this.options = options;\n this.blockInitialAnimation = Boolean(blockInitialAnimation);\n this.isControllingVariants = isControllingVariants(props);\n this.isVariantNode = isVariantNode(props);\n if (this.isVariantNode) {\n this.variantChildren = new Set();\n }\n this.manuallyAnimateOnMount = Boolean(parent && parent.current);\n /**\n * Any motion values that are provided to the element when created\n * aren't yet bound to the element, as this would technically be impure.\n * However, we iterate through the motion values and set them to the\n * initial values for this component.\n *\n * TODO: This is impure and we should look at changing this to run on mount.\n * Doing so will break some tests but this isn't necessarily a breaking change,\n * more a reflection of the test.\n */\n const { willChange, ...initialMotionValues } = this.scrapeMotionValuesFromProps(props, {}, this);\n for (const key in initialMotionValues) {\n const value = initialMotionValues[key];\n if (latestValues[key] !== undefined && isMotionValue(value)) {\n value.set(latestValues[key]);\n }\n }\n }\n mount(instance) {\n /**\n * If this element has been mounted before (e.g. after a Suspense\n * unmount/remount), reset motion values to their initial state\n * so animations replay correctly from initial → animate.\n */\n if (this.hasBeenMounted) {\n for (const key in this.initialValues) {\n this.values.get(key)?.jump(this.initialValues[key]);\n this.latestValues[key] = this.initialValues[key];\n }\n }\n this.current = instance;\n visualElementStore.set(instance, this);\n if (this.projection && !this.projection.instance) {\n this.projection.mount(instance);\n }\n if (this.parent && this.isVariantNode && !this.isControllingVariants) {\n this.removeFromVariantTree = this.parent.addVariantChild(this);\n }\n this.values.forEach((value, key) => this.bindToMotionValue(key, value));\n /**\n * Determine reduced motion preference. Only initialize the matchMedia\n * listener if we actually need the dynamic value (i.e., when config\n * is neither \"never\" nor \"always\").\n */\n if (this.reducedMotionConfig === \"never\") {\n this.shouldReduceMotion = false;\n }\n else if (this.reducedMotionConfig === \"always\") {\n this.shouldReduceMotion = true;\n }\n else {\n if (!hasReducedMotionListener.current) {\n initPrefersReducedMotion();\n }\n this.shouldReduceMotion = prefersReducedMotion.current;\n }\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(this.shouldReduceMotion !== true, \"You have Reduced Motion enabled on your device. Animations may not appear as expected.\", \"reduced-motion-disabled\");\n }\n /**\n * Set whether animations should be skipped based on the config.\n */\n this.shouldSkipAnimations = this.skipAnimationsConfig ?? false;\n this.parent?.addChild(this);\n this.update(this.props, this.presenceContext);\n this.hasBeenMounted = true;\n }\n unmount() {\n this.projection && this.projection.unmount();\n cancelFrame(this.notifyUpdate);\n cancelFrame(this.render);\n this.valueSubscriptions.forEach((remove) => remove());\n this.valueSubscriptions.clear();\n this.removeFromVariantTree && this.removeFromVariantTree();\n this.parent?.removeChild(this);\n for (const key in this.events) {\n this.events[key].clear();\n }\n for (const key in this.features) {\n const feature = this.features[key];\n if (feature) {\n feature.unmount();\n feature.isMounted = false;\n }\n }\n this.current = null;\n }\n addChild(child) {\n this.children.add(child);\n this.enteringChildren ?? (this.enteringChildren = new Set());\n this.enteringChildren.add(child);\n }\n removeChild(child) {\n this.children.delete(child);\n this.enteringChildren && this.enteringChildren.delete(child);\n }\n bindToMotionValue(key, value) {\n if (this.valueSubscriptions.has(key)) {\n this.valueSubscriptions.get(key)();\n }\n if (value.accelerate &&\n acceleratedValues.has(key) &&\n this.current instanceof HTMLElement) {\n const { factory, keyframes, times, ease, duration } = value.accelerate;\n const animation = new NativeAnimation({\n element: this.current,\n name: key,\n keyframes,\n times,\n ease,\n duration: secondsToMilliseconds(duration),\n });\n const cleanup = factory(animation);\n this.valueSubscriptions.set(key, () => {\n cleanup();\n animation.cancel();\n });\n return;\n }\n const valueIsTransform = transformProps.has(key);\n if (valueIsTransform && this.onBindTransform) {\n this.onBindTransform();\n }\n const removeOnChange = value.on(\"change\", (latestValue) => {\n this.latestValues[key] = latestValue;\n this.props.onUpdate && frame.preRender(this.notifyUpdate);\n if (valueIsTransform && this.projection) {\n this.projection.isTransformDirty = true;\n }\n this.scheduleRender();\n });\n let removeSyncCheck;\n if (typeof window !== \"undefined\" &&\n window.MotionCheckAppearSync) {\n removeSyncCheck = window.MotionCheckAppearSync(this, key, value);\n }\n this.valueSubscriptions.set(key, () => {\n removeOnChange();\n if (removeSyncCheck)\n removeSyncCheck();\n // Defer to MotionValue.on(\"change\") auto-stop so React 19 remounts\n // can resubscribe before the animation is cancelled (#3315).\n });\n }\n sortNodePosition(other) {\n /**\n * If these nodes aren't even of the same type we can't compare their depth.\n */\n if (!this.current ||\n !this.sortInstanceNodePosition ||\n this.type !== other.type) {\n return 0;\n }\n return this.sortInstanceNodePosition(this.current, other.current);\n }\n updateFeatures() {\n let key = \"animation\";\n for (key in featureDefinitions) {\n const featureDefinition = featureDefinitions[key];\n if (!featureDefinition)\n continue;\n const { isEnabled, Feature: FeatureConstructor } = featureDefinition;\n /**\n * If this feature is enabled but not active, make a new instance.\n */\n if (!this.features[key] &&\n FeatureConstructor &&\n isEnabled(this.props)) {\n this.features[key] = new FeatureConstructor(this);\n }\n /**\n * If we have a feature, mount or update it.\n */\n if (this.features[key]) {\n const feature = this.features[key];\n if (feature.isMounted) {\n feature.update();\n }\n else {\n feature.mount();\n feature.isMounted = true;\n }\n }\n }\n }\n triggerBuild() {\n this.build(this.renderState, this.latestValues, this.props);\n }\n /**\n * Measure the current viewport box with or without transforms.\n * Only measures axis-aligned boxes, rotate and skew must be manually\n * removed with a re-render to work.\n */\n measureViewportBox() {\n return this.current\n ? this.measureInstanceViewportBox(this.current, this.props)\n : createBox();\n }\n getStaticValue(key) {\n return this.latestValues[key];\n }\n setStaticValue(key, value) {\n this.latestValues[key] = value;\n }\n /**\n * Update the provided props. Ensure any newly-added motion values are\n * added to our map, old ones removed, and listeners updated.\n */\n update(props, presenceContext) {\n if (props.transformTemplate || this.props.transformTemplate) {\n this.scheduleRender();\n }\n this.prevProps = this.props;\n this.props = props;\n this.prevPresenceContext = this.presenceContext;\n this.presenceContext = presenceContext;\n /**\n * Update prop event handlers ie onAnimationStart, onAnimationComplete\n */\n for (let i = 0; i < propEventHandlers.length; i++) {\n const key = propEventHandlers[i];\n if (this.propEventSubscriptions[key]) {\n this.propEventSubscriptions[key]();\n delete this.propEventSubscriptions[key];\n }\n const listenerName = (\"on\" + key);\n const listener = props[listenerName];\n if (listener) {\n this.propEventSubscriptions[key] = this.on(key, listener);\n }\n }\n this.prevMotionValues = updateMotionValuesFromProps(this, this.scrapeMotionValuesFromProps(props, this.prevProps || {}, this), this.prevMotionValues);\n if (this.handleChildMotionValue) {\n this.handleChildMotionValue();\n }\n }\n getProps() {\n return this.props;\n }\n /**\n * Returns the variant definition with a given name.\n */\n getVariant(name) {\n return this.props.variants ? this.props.variants[name] : undefined;\n }\n /**\n * Returns the defined default transition on this component.\n */\n getDefaultTransition() {\n return this.props.transition;\n }\n getTransformPagePoint() {\n return this.props.transformPagePoint;\n }\n getClosestVariantNode() {\n return this.isVariantNode\n ? this\n : this.parent\n ? this.parent.getClosestVariantNode()\n : undefined;\n }\n /**\n * Add a child visual element to our set of children.\n */\n addVariantChild(child) {\n const closestVariantNode = this.getClosestVariantNode();\n if (closestVariantNode) {\n closestVariantNode.variantChildren &&\n closestVariantNode.variantChildren.add(child);\n return () => closestVariantNode.variantChildren.delete(child);\n }\n }\n /**\n * Add a motion value and bind it to this visual element.\n */\n addValue(key, value) {\n // Remove existing value if it exists\n const existingValue = this.values.get(key);\n if (value !== existingValue) {\n if (existingValue)\n this.removeValue(key);\n this.bindToMotionValue(key, value);\n this.values.set(key, value);\n this.latestValues[key] = value.get();\n }\n }\n /**\n * Remove a motion value and unbind any active subscriptions.\n */\n removeValue(key) {\n this.values.delete(key);\n const unsubscribe = this.valueSubscriptions.get(key);\n if (unsubscribe) {\n unsubscribe();\n this.valueSubscriptions.delete(key);\n }\n delete this.latestValues[key];\n this.removeValueFromRenderState(key, this.renderState);\n }\n /**\n * Check whether we have a motion value for this key\n */\n hasValue(key) {\n return this.values.has(key);\n }\n getValue(key, defaultValue) {\n if (this.props.values && this.props.values[key]) {\n return this.props.values[key];\n }\n let value = this.values.get(key);\n if (value === undefined && defaultValue !== undefined) {\n value = motionValue(defaultValue === null ? undefined : defaultValue, { owner: this });\n this.addValue(key, value);\n }\n return value;\n }\n /**\n * If we're trying to animate to a previously unencountered value,\n * we need to check for it in our state and as a last resort read it\n * directly from the instance (which might have performance implications).\n */\n readValue(key, target) {\n let value = this.latestValues[key] !== undefined || !this.current\n ? this.latestValues[key]\n : this.getBaseTargetFromProps(this.props, key) ??\n this.readValueFromInstance(this.current, key, this.options);\n if (value !== undefined && value !== null) {\n if (typeof value === \"string\" &&\n (isNumericalString(value) || isZeroValueString(value))) {\n // If this is a number read as a string, ie \"0\" or \"200\", convert it to a number\n value = parseFloat(value);\n }\n else if (!findValueType(value) && complex.test(target)) {\n value = getAnimatableNone(key, target);\n }\n this.setBaseTarget(key, isMotionValue(value) ? value.get() : value);\n }\n return isMotionValue(value) ? value.get() : value;\n }\n /**\n * Set the base target to later animate back to. This is currently\n * only hydrated on creation and when we first read a value.\n */\n setBaseTarget(key, value) {\n this.baseTarget[key] = value;\n }\n /**\n * Find the base target for a value thats been removed from all animation\n * props.\n */\n getBaseTarget(key) {\n const { initial } = this.props;\n let valueFromInitial;\n if (typeof initial === \"string\" || typeof initial === \"object\") {\n const variant = resolveVariantFromProps(this.props, initial, this.presenceContext?.custom);\n if (variant) {\n valueFromInitial = variant[key];\n }\n }\n /**\n * If this value still exists in the current initial variant, read that.\n */\n if (initial && valueFromInitial !== undefined) {\n return valueFromInitial;\n }\n /**\n * Alternatively, if this VisualElement config has defined a getBaseTarget\n * so we can read the value from an alternative source, try that.\n */\n const target = this.getBaseTargetFromProps(this.props, key);\n if (target !== undefined && !isMotionValue(target))\n return target;\n /**\n * If the value was initially defined on initial, but it doesn't any more,\n * return undefined. Otherwise return the value as initially read from the DOM.\n */\n return this.initialValues[key] !== undefined &&\n valueFromInitial === undefined\n ? undefined\n : this.baseTarget[key];\n }\n on(eventName, callback) {\n if (!this.events[eventName]) {\n this.events[eventName] = new SubscriptionManager();\n }\n return this.events[eventName].add(callback);\n }\n notify(eventName, ...args) {\n if (this.events[eventName]) {\n this.events[eventName].notify(...args);\n }\n }\n scheduleRenderMicrotask() {\n microtask.render(this.render);\n }\n}\n\nexport { VisualElement, getFeatureDefinitions, setFeatureDefinitions };\n//# sourceMappingURL=VisualElement.mjs.map\n","import { motionValue } from '../../value/index.mjs';\nimport { isMotionValue } from '../../value/utils/is-motion-value.mjs';\n\n/**\n * Updates motion values from props changes.\n * Uses `any` type for element to avoid circular dependencies with VisualElement.\n */\nfunction updateMotionValuesFromProps(element, next, prev) {\n for (const key in next) {\n const nextValue = next[key];\n const prevValue = prev[key];\n if (isMotionValue(nextValue)) {\n /**\n * If this is a motion value found in props or style, we want to add it\n * to our visual element's motion value map.\n */\n element.addValue(key, nextValue);\n }\n else if (isMotionValue(prevValue)) {\n /**\n * If we're swapping from a motion value to a static value,\n * create a new motion value from that\n */\n element.addValue(key, motionValue(nextValue, { owner: element }));\n }\n else if (prevValue !== nextValue) {\n /**\n * If this is a flat value that has changed, update the motion value\n * or create one if it doesn't exist. We only want to do this if we're\n * not handling the value with our animation state.\n */\n if (element.hasValue(key)) {\n const existingValue = element.getValue(key);\n if (existingValue.liveStyle === true) {\n existingValue.jump(nextValue);\n }\n else if (!existingValue.hasAnimated) {\n existingValue.set(nextValue);\n }\n }\n else {\n const latestValue = element.getStaticValue(key);\n element.addValue(key, motionValue(latestValue !== undefined ? latestValue : nextValue, { owner: element }));\n }\n }\n }\n // Handle removed values\n for (const key in prev) {\n if (next[key] === undefined)\n element.removeValue(key);\n }\n return next;\n}\n\nexport { updateMotionValuesFromProps };\n//# sourceMappingURL=motion-values.mjs.map\n","import { isMotionValue } from '../../value/utils/is-motion-value.mjs';\nimport { DOMKeyframesResolver } from '../../animation/keyframes/DOMKeyframesResolver.mjs';\nimport { VisualElement } from '../VisualElement.mjs';\n\nclass DOMVisualElement extends VisualElement {\n constructor() {\n super(...arguments);\n this.KeyframeResolver = DOMKeyframesResolver;\n }\n sortInstanceNodePosition(a, b) {\n /**\n * compareDocumentPosition returns a bitmask, by using the bitwise &\n * we're returning true if 2 in that bitmask is set to true. 2 is set\n * to true if b preceeds a.\n */\n return a.compareDocumentPosition(b) & 2 ? 1 : -1;\n }\n getBaseTargetFromProps(props, key) {\n const style = props.style;\n return style ? style[key] : undefined;\n }\n removeValueFromRenderState(key, { vars, style }) {\n delete vars[key];\n delete style[key];\n }\n handleChildMotionValue() {\n if (this.childSubscription) {\n this.childSubscription();\n delete this.childSubscription;\n }\n const { children } = this.props;\n if (isMotionValue(children)) {\n this.childSubscription = children.on(\"change\", (latest) => {\n if (this.current) {\n this.current.textContent = `${latest}`;\n }\n });\n }\n }\n}\n\nexport { DOMVisualElement };\n//# sourceMappingURL=DOMVisualElement.mjs.map\n","/**\n * Feature base class for extending VisualElement functionality.\n * Features are plugins that can be mounted/unmounted to add behavior\n * like gestures, animations, or layout tracking.\n */\nclass Feature {\n constructor(node) {\n this.isMounted = false;\n this.node = node;\n }\n update() { }\n}\n\nexport { Feature };\n//# sourceMappingURL=Feature.mjs.map\n","/**\n * Bounding boxes tend to be defined as top, left, right, bottom. For various operations\n * it's easier to consider each axis individually. This function returns a bounding box\n * as a map of single-axis min/max values.\n */\nfunction convertBoundingBoxToBox({ top, left, right, bottom, }) {\n return {\n x: { min: left, max: right },\n y: { min: top, max: bottom },\n };\n}\nfunction convertBoxToBoundingBox({ x, y }) {\n return { top: y.min, right: x.max, bottom: y.max, left: x.min };\n}\n/**\n * Applies a TransformPoint function to a bounding box. TransformPoint is usually a function\n * provided by Framer to allow measured points to be corrected for device scaling. This is used\n * when measuring DOM elements and DOM event points.\n */\nfunction transformBoxPoints(point, transformPoint) {\n if (!transformPoint)\n return point;\n const topLeft = transformPoint({ x: point.left, y: point.top });\n const bottomRight = transformPoint({ x: point.right, y: point.bottom });\n return {\n top: topLeft.y,\n left: topLeft.x,\n bottom: bottomRight.y,\n right: bottomRight.x,\n };\n}\n\nexport { convertBoundingBoxToBox, convertBoxToBoundingBox, transformBoxPoints };\n//# sourceMappingURL=conversion.mjs.map\n","function isIdentityScale(scale) {\n return scale === undefined || scale === 1;\n}\nfunction hasScale({ scale, scaleX, scaleY }) {\n return (!isIdentityScale(scale) ||\n !isIdentityScale(scaleX) ||\n !isIdentityScale(scaleY));\n}\nfunction hasTransform(values) {\n return (hasScale(values) ||\n has2DTranslate(values) ||\n values.z ||\n values.rotate ||\n values.rotateX ||\n values.rotateY ||\n values.skewX ||\n values.skewY);\n}\nfunction has2DTranslate(values) {\n return is2DTranslate(values.x) || is2DTranslate(values.y);\n}\nfunction is2DTranslate(value) {\n return value && value !== \"0%\";\n}\n\nexport { has2DTranslate, hasScale, hasTransform };\n//# sourceMappingURL=has-transform.mjs.map\n","import { mixNumber } from '../../utils/mix/number.mjs';\nimport { hasTransform } from '../utils/has-transform.mjs';\n\n/**\n * Scales a point based on a factor and an originPoint\n */\nfunction scalePoint(point, scale, originPoint) {\n const distanceFromOrigin = point - originPoint;\n const scaled = scale * distanceFromOrigin;\n return originPoint + scaled;\n}\n/**\n * Applies a translate/scale delta to a point\n */\nfunction applyPointDelta(point, translate, scale, originPoint, boxScale) {\n if (boxScale !== undefined) {\n point = scalePoint(point, boxScale, originPoint);\n }\n return scalePoint(point, scale, originPoint) + translate;\n}\n/**\n * Applies a translate/scale delta to an axis\n */\nfunction applyAxisDelta(axis, translate = 0, scale = 1, originPoint, boxScale) {\n axis.min = applyPointDelta(axis.min, translate, scale, originPoint, boxScale);\n axis.max = applyPointDelta(axis.max, translate, scale, originPoint, boxScale);\n}\n/**\n * Applies a translate/scale delta to a box\n */\nfunction applyBoxDelta(box, { x, y }) {\n applyAxisDelta(box.x, x.translate, x.scale, x.originPoint);\n applyAxisDelta(box.y, y.translate, y.scale, y.originPoint);\n}\nconst TREE_SCALE_SNAP_MIN = 0.999999999999;\nconst TREE_SCALE_SNAP_MAX = 1.0000000000001;\n/**\n * Apply a tree of deltas to a box. We do this to calculate the effect of all the transforms\n * in a tree upon our box before then calculating how to project it into our desired viewport-relative box\n *\n * This is the final nested loop within updateLayoutDelta for future refactoring\n */\nfunction applyTreeDeltas(box, treeScale, treePath, isSharedTransition = false) {\n const treeLength = treePath.length;\n if (!treeLength)\n return;\n // Reset the treeScale\n treeScale.x = treeScale.y = 1;\n let node;\n let delta;\n for (let i = 0; i < treeLength; i++) {\n node = treePath[i];\n delta = node.projectionDelta;\n /**\n * TODO: Prefer to remove this, but currently we have motion components with\n * display: contents in Framer.\n */\n const { visualElement } = node.options;\n if (visualElement &&\n visualElement.props.style &&\n visualElement.props.style.display === \"contents\") {\n continue;\n }\n if (isSharedTransition &&\n node.options.layoutScroll &&\n node.scroll &&\n node !== node.root) {\n translateAxis(box.x, -node.scroll.offset.x);\n translateAxis(box.y, -node.scroll.offset.y);\n }\n if (delta) {\n // Incoporate each ancestor's scale into a cumulative treeScale for this component\n treeScale.x *= delta.x.scale;\n treeScale.y *= delta.y.scale;\n // Apply each ancestor's calculated delta into this component's recorded layout box\n applyBoxDelta(box, delta);\n }\n if (isSharedTransition && hasTransform(node.latestValues)) {\n transformBox(box, node.latestValues, node.layout?.layoutBox);\n }\n }\n /**\n * Snap tree scale back to 1 if it's within a non-perceivable threshold.\n * This will help reduce useless scales getting rendered.\n */\n if (treeScale.x < TREE_SCALE_SNAP_MAX &&\n treeScale.x > TREE_SCALE_SNAP_MIN) {\n treeScale.x = 1.0;\n }\n if (treeScale.y < TREE_SCALE_SNAP_MAX &&\n treeScale.y > TREE_SCALE_SNAP_MIN) {\n treeScale.y = 1.0;\n }\n}\nfunction translateAxis(axis, distance) {\n axis.min += distance;\n axis.max += distance;\n}\n/**\n * Apply a transform to an axis from the latest resolved motion values.\n * This function basically acts as a bridge between a flat motion value map\n * and applyAxisDelta\n */\nfunction transformAxis(axis, axisTranslate, axisScale, boxScale, axisOrigin = 0.5) {\n const originPoint = mixNumber(axis.min, axis.max, axisOrigin);\n // Apply the axis delta to the final axis\n applyAxisDelta(axis, axisTranslate, axisScale, originPoint, boxScale);\n}\nfunction resolveAxisTranslate(value, axis) {\n if (typeof value === \"string\") {\n return (parseFloat(value) / 100) * (axis.max - axis.min);\n }\n return value;\n}\n/**\n * Apply a transform to a box from the latest resolved motion values.\n */\nfunction transformBox(box, transform, sourceBox) {\n const resolveBox = sourceBox ?? box;\n transformAxis(box.x, resolveAxisTranslate(transform.x, resolveBox.x), transform.scaleX, transform.scale, transform.originX);\n transformAxis(box.y, resolveAxisTranslate(transform.y, resolveBox.y), transform.scaleY, transform.scale, transform.originY);\n}\n\nexport { applyAxisDelta, applyBoxDelta, applyPointDelta, applyTreeDeltas, scalePoint, transformAxis, transformBox, translateAxis };\n//# sourceMappingURL=delta-apply.mjs.map\n","import { convertBoundingBoxToBox, transformBoxPoints } from '../geometry/conversion.mjs';\nimport { translateAxis } from '../geometry/delta-apply.mjs';\n\nfunction measureViewportBox(instance, transformPoint) {\n return convertBoundingBoxToBox(transformBoxPoints(instance.getBoundingClientRect(), transformPoint));\n}\nfunction measurePageBox(element, rootProjectionNode, transformPagePoint) {\n const viewportBox = measureViewportBox(element, transformPagePoint);\n const { scroll } = rootProjectionNode;\n if (scroll) {\n translateAxis(viewportBox.x, scroll.offset.x);\n translateAxis(viewportBox.y, scroll.offset.y);\n }\n return viewportBox;\n}\n\nexport { measurePageBox, measureViewportBox };\n//# sourceMappingURL=measure.mjs.map\n","import { getValueAsType } from '../../../value/types/utils/get-as-type.mjs';\nimport { numberValueTypes } from '../../../value/types/maps/number.mjs';\nimport { transformPropOrder } from '../../utils/keys-transform.mjs';\n\nconst translateAlias = {\n x: \"translateX\",\n y: \"translateY\",\n z: \"translateZ\",\n transformPerspective: \"perspective\",\n};\nconst numTransforms = transformPropOrder.length;\n/**\n * Build a CSS transform style from individual x/y/scale etc properties.\n *\n * This outputs with a default order of transforms/scales/rotations, this can be customised by\n * providing a transformTemplate function.\n */\nfunction buildTransform(latestValues, transform, transformTemplate) {\n // The transform string we're going to build into.\n let transformString = \"\";\n let transformIsDefault = true;\n /**\n * Loop over all possible transforms in order, adding the ones that\n * are present to the transform string.\n */\n for (let i = 0; i < numTransforms; i++) {\n const key = transformPropOrder[i];\n const value = latestValues[key];\n if (value === undefined)\n continue;\n let valueIsDefault = true;\n if (typeof value === \"number\") {\n valueIsDefault = value === (key.startsWith(\"scale\") ? 1 : 0);\n }\n else {\n const parsed = parseFloat(value);\n valueIsDefault = key.startsWith(\"scale\") ? parsed === 1 : parsed === 0;\n }\n if (!valueIsDefault || transformTemplate) {\n const valueAsType = getValueAsType(value, numberValueTypes[key]);\n if (!valueIsDefault) {\n transformIsDefault = false;\n const transformName = translateAlias[key] || key;\n transformString += `${transformName}(${valueAsType}) `;\n }\n if (transformTemplate) {\n transform[key] = valueAsType;\n }\n }\n }\n // `pathRotation` composes onto `rotate` as a separate additive term so\n // the user's `rotate` is never clobbered. Deliberately not a slot in\n // `transformPropOrder`.\n const pathRotation = latestValues.pathRotation;\n if (pathRotation) {\n transformIsDefault = false;\n transformString += `rotate(${getValueAsType(pathRotation, numberValueTypes.pathRotation)}) `;\n }\n transformString = transformString.trim();\n // If we have a custom `transform` template, pass our transform values and\n // generated transformString to that before returning\n if (transformTemplate) {\n transformString = transformTemplate(transform, transformIsDefault ? \"\" : transformString);\n }\n else if (transformIsDefault) {\n transformString = \"none\";\n }\n return transformString;\n}\n\nexport { buildTransform };\n//# sourceMappingURL=build-transform.mjs.map\n","import { getValueAsType } from '../../../value/types/utils/get-as-type.mjs';\nimport { numberValueTypes } from '../../../value/types/maps/number.mjs';\nimport { transformProps } from '../../utils/keys-transform.mjs';\nimport { isCSSVariableName } from '../../../animation/utils/is-css-variable.mjs';\nimport { buildTransform } from './build-transform.mjs';\n\nfunction buildHTMLStyles(state, latestValues, transformTemplate) {\n const { style, vars, transformOrigin } = state;\n // Track whether we encounter any transform or transformOrigin values.\n let hasTransform = false;\n let hasTransformOrigin = false;\n /**\n * Loop over all our latest animated values and decide whether to handle them\n * as a style or CSS variable.\n *\n * Transforms and transform origins are kept separately for further processing.\n */\n for (const key in latestValues) {\n const value = latestValues[key];\n if (transformProps.has(key)) {\n // If this is a transform, flag to enable further transform processing\n hasTransform = true;\n continue;\n }\n else if (isCSSVariableName(key)) {\n vars[key] = value;\n continue;\n }\n else {\n // Convert the value to its default value type, ie 0 -> \"0px\"\n const valueAsType = getValueAsType(value, numberValueTypes[key]);\n if (key.startsWith(\"origin\")) {\n // If this is a transform origin, flag and enable further transform-origin processing\n hasTransformOrigin = true;\n transformOrigin[key] =\n valueAsType;\n }\n else {\n style[key] = valueAsType;\n }\n }\n }\n if (!latestValues.transform) {\n if (hasTransform || transformTemplate) {\n style.transform = buildTransform(latestValues, state.transform, transformTemplate);\n }\n else if (style.transform) {\n /**\n * If we have previously created a transform but currently don't have any,\n * reset transform style to none.\n */\n style.transform = \"none\";\n }\n }\n /**\n * Build a transformOrigin style. Uses the same defaults as the browser for\n * undefined origins.\n */\n if (hasTransformOrigin) {\n const { originX = \"50%\", originY = \"50%\", originZ = 0, } = transformOrigin;\n style.transformOrigin = `${originX} ${originY} ${originZ}`;\n }\n}\n\nexport { buildHTMLStyles };\n//# sourceMappingURL=build-styles.mjs.map\n","function renderHTML(element, { style, vars }, styleProp, projection) {\n const elementStyle = element.style;\n let key;\n for (key in style) {\n // CSSStyleDeclaration has [index: number]: string; in the types, so we use that as key type.\n elementStyle[key] = style[key];\n }\n // Write projection styles directly to element style\n projection?.applyProjectionStyles(elementStyle, styleProp);\n for (key in vars) {\n // Loop over any CSS variables and assign those.\n // They can only be assigned using `setProperty`.\n elementStyle.setProperty(key, vars[key]);\n }\n}\n\nexport { renderHTML };\n//# sourceMappingURL=render.mjs.map\n","import { px } from '../../value/types/numbers/units.mjs';\n\nfunction pixelsToPercent(pixels, axis) {\n if (axis.max === axis.min)\n return 0;\n return (pixels / (axis.max - axis.min)) * 100;\n}\n/**\n * We always correct borderRadius as a percentage rather than pixels to reduce paints.\n * For example, if you are projecting a box that is 100px wide with a 10px borderRadius\n * into a box that is 200px wide with a 20px borderRadius, that is actually a 10%\n * borderRadius in both states. If we animate between the two in pixels that will trigger\n * a paint each time. If we animate between the two in percentage we'll avoid a paint.\n */\nconst correctBorderRadius = {\n correct: (latest, node) => {\n if (!node.target)\n return latest;\n /**\n * If latest is a string, if it's a percentage we can return immediately as it's\n * going to be stretched appropriately. Otherwise, if it's a pixel, convert it to a number.\n */\n if (typeof latest === \"string\") {\n if (px.test(latest)) {\n latest = parseFloat(latest);\n }\n else {\n return latest;\n }\n }\n /**\n * If latest is a number, it's a pixel value. We use the current viewportBox to calculate that\n * pixel value as a percentage of each axis\n */\n const x = pixelsToPercent(latest, node.target.x);\n const y = pixelsToPercent(latest, node.target.y);\n return `${x}% ${y}%`;\n },\n};\n\nexport { correctBorderRadius, pixelsToPercent };\n//# sourceMappingURL=scale-border-radius.mjs.map\n","import { complex } from '../../value/types/complex/index.mjs';\nimport { mixNumber } from '../../utils/mix/number.mjs';\n\nconst correctBoxShadow = {\n correct: (latest, { treeScale, projectionDelta }) => {\n const original = latest;\n const shadow = complex.parse(latest);\n // TODO: Doesn't support multiple shadows\n if (shadow.length > 5)\n return original;\n const template = complex.createTransformer(latest);\n const offset = typeof shadow[0] !== \"number\" ? 1 : 0;\n // Calculate the overall context scale\n const xScale = projectionDelta.x.scale * treeScale.x;\n const yScale = projectionDelta.y.scale * treeScale.y;\n shadow[0 + offset] /= xScale;\n shadow[1 + offset] /= yScale;\n /**\n * Ideally we'd correct x and y scales individually, but because blur and\n * spread apply to both we have to take a scale average and apply that instead.\n * We could potentially improve the outcome of this by incorporating the ratio between\n * the two scales.\n */\n const averageScale = mixNumber(xScale, yScale, 0.5);\n // Blur\n if (typeof shadow[2 + offset] === \"number\")\n shadow[2 + offset] /= averageScale;\n // Spread\n if (typeof shadow[3 + offset] === \"number\")\n shadow[3 + offset] /= averageScale;\n return template(shadow);\n },\n};\n\nexport { correctBoxShadow };\n//# sourceMappingURL=scale-box-shadow.mjs.map\n","import { isCSSVariableName } from '../../animation/utils/is-css-variable.mjs';\nimport { cornerRadiusProps } from '../../utils/border-radius.mjs';\nimport { correctBorderRadius } from './scale-border-radius.mjs';\nimport { correctBoxShadow } from './scale-box-shadow.mjs';\n\nconst scaleCorrectors = {\n borderRadius: {\n ...correctBorderRadius,\n applyTo: [...cornerRadiusProps],\n },\n borderTopLeftRadius: correctBorderRadius,\n borderTopRightRadius: correctBorderRadius,\n borderBottomLeftRadius: correctBorderRadius,\n borderBottomRightRadius: correctBorderRadius,\n boxShadow: correctBoxShadow,\n};\nfunction addScaleCorrector(correctors) {\n for (const key in correctors) {\n scaleCorrectors[key] = correctors[key];\n if (isCSSVariableName(key)) {\n scaleCorrectors[key].isCSSVariable = true;\n }\n }\n}\n\nexport { addScaleCorrector, scaleCorrectors };\n//# sourceMappingURL=scale-correction.mjs.map\n","import { transformProps } from './keys-transform.mjs';\nimport { scaleCorrectors } from '../../projection/styles/scale-correction.mjs';\nexport { addScaleCorrector } from '../../projection/styles/scale-correction.mjs';\n\nfunction isForcedMotionValue(key, { layout, layoutId }) {\n return (transformProps.has(key) ||\n key.startsWith(\"origin\") ||\n ((layout || layoutId !== undefined) &&\n (!!scaleCorrectors[key] || key === \"opacity\")));\n}\n\nexport { isForcedMotionValue, scaleCorrectors };\n//# sourceMappingURL=is-forced-motion-value.mjs.map\n","import { isMotionValue } from '../../../value/utils/is-motion-value.mjs';\nimport { isForcedMotionValue } from '../../utils/is-forced-motion-value.mjs';\n\nfunction scrapeMotionValuesFromProps(props, prevProps, visualElement) {\n const style = props.style;\n const prevStyle = prevProps?.style;\n const newValues = {};\n if (!style)\n return newValues;\n for (const key in style) {\n if (isMotionValue(style[key]) ||\n (prevStyle && isMotionValue(prevStyle[key])) ||\n isForcedMotionValue(key, props) ||\n visualElement?.getValue(key)?.liveStyle !== undefined) {\n newValues[key] = style[key];\n }\n }\n return newValues;\n}\n\nexport { scrapeMotionValuesFromProps };\n//# sourceMappingURL=scrape-motion-values.mjs.map\n","import { invariant } from 'motion-utils';\nimport { isCSSVariableName } from '../../animation/utils/is-css-variable.mjs';\nimport { transformProps } from '../utils/keys-transform.mjs';\nimport { defaultTransformValue, readTransformValue } from '../dom/parse-transform.mjs';\nimport { measureViewportBox } from '../../projection/utils/measure.mjs';\nimport { DOMVisualElement } from '../dom/DOMVisualElement.mjs';\nimport { buildHTMLStyles } from './utils/build-styles.mjs';\nimport { renderHTML } from './utils/render.mjs';\nimport { scrapeMotionValuesFromProps } from './utils/scrape-motion-values.mjs';\n\nfunction getComputedStyle(element) {\n return window.getComputedStyle(element);\n}\nclass HTMLVisualElement extends DOMVisualElement {\n constructor() {\n super(...arguments);\n this.type = \"html\";\n this.renderInstance = renderHTML;\n }\n mount(instance) {\n /**\n * If a custom component forwards its ref to something other than a\n * HTML/SVG element (a class instance, an imperative handle) there's\n * nothing for Motion to style, measure or attach gestures to. #2777\n */\n invariant(Boolean(instance.style), \"motion.create() components must forward their ref to a HTML or SVG element\", \"custom-component-ref\");\n super.mount(instance);\n }\n readValueFromInstance(instance, key) {\n if (transformProps.has(key)) {\n return this.projection?.isProjecting\n ? defaultTransformValue(key)\n : readTransformValue(instance, key);\n }\n else {\n const computedStyle = getComputedStyle(instance);\n const value = (isCSSVariableName(key)\n ? computedStyle.getPropertyValue(key)\n : computedStyle[key]) || 0;\n return typeof value === \"string\" ? value.trim() : value;\n }\n }\n measureInstanceViewportBox(instance, { transformPagePoint }) {\n return measureViewportBox(instance, transformPagePoint);\n }\n build(renderState, latestValues, props) {\n buildHTMLStyles(renderState, latestValues, props.transformTemplate);\n }\n scrapeMotionValuesFromProps(props, prevProps, visualElement) {\n return scrapeMotionValuesFromProps(props, prevProps, visualElement);\n }\n}\n\nexport { HTMLVisualElement, getComputedStyle };\n//# sourceMappingURL=HTMLVisualElement.mjs.map\n","const dashKeys = {\n offset: \"stroke-dashoffset\",\n array: \"stroke-dasharray\",\n};\nconst camelKeys = {\n offset: \"strokeDashoffset\",\n array: \"strokeDasharray\",\n};\n/**\n * Build SVG path properties. Uses the path's measured length to convert\n * our custom pathLength, pathSpacing and pathOffset into stroke-dashoffset\n * and stroke-dasharray attributes.\n *\n * This function is mutative to reduce per-frame GC.\n *\n * Note: We use unitless values for stroke-dasharray and stroke-dashoffset\n * because Safari incorrectly scales px values when the page is zoomed.\n */\nfunction buildSVGPath(attrs, length, spacing = 1, offset = 0, useDashCase = true) {\n // Normalise path length by setting SVG attribute pathLength to 1\n attrs.pathLength = 1;\n // We use dash case when setting attributes directly to the DOM node and camel case\n // when defining props on a React component.\n const keys = useDashCase ? dashKeys : camelKeys;\n // Build the dash offset (unitless to avoid Safari zoom bug)\n attrs[keys.offset] = `${-offset}`;\n // Build the dash array (unitless to avoid Safari zoom bug)\n attrs[keys.array] = `${length} ${spacing}`;\n}\n\nexport { buildSVGPath };\n//# sourceMappingURL=path.mjs.map\n","import { buildHTMLStyles } from '../../html/utils/build-styles.mjs';\nimport { buildSVGPath } from './path.mjs';\n\nconst cssStyleProperties = [\n \"transform\",\n \"opacity\",\n \"offsetDistance\",\n \"offsetPath\",\n \"offsetRotate\",\n \"offsetAnchor\",\n];\n/**\n * Build SVG visual attributes, like cx and style.transform\n */\nfunction buildSVGAttrs(state, { attrX, attrY, attrScale, pathLength, pathSpacing = 1, pathOffset = 0, \n// This is object creation, which we try to avoid per-frame.\n...latest }, isSVGTag, transformTemplate, styleProp) {\n buildHTMLStyles(state, latest, transformTemplate);\n /**\n * For svg tags we just want to make sure viewBox is animatable and treat all the styles\n * as normal HTML tags.\n */\n if (isSVGTag) {\n if (state.style.viewBox) {\n state.attrs.viewBox = state.style.viewBox;\n }\n return;\n }\n state.attrs = state.style;\n state.style = {};\n const { attrs, style } = state;\n for (const key of cssStyleProperties) {\n if (attrs[key] !== undefined) {\n style[key] = attrs[key];\n delete attrs[key];\n }\n }\n if (style.transform || attrs.transformOrigin) {\n style.transformOrigin = attrs.transformOrigin ?? \"50% 50%\";\n delete attrs.transformOrigin;\n }\n if (style.transform) {\n /**\n * SVG's element transform-origin uses its own median as a reference.\n * Therefore, transformBox becomes a fill-box\n */\n style.transformBox = styleProp?.transformBox ?? \"fill-box\";\n delete attrs.transformBox;\n }\n // Render attrX/attrY/attrScale as attributes\n if (attrX !== undefined)\n attrs.x = attrX;\n if (attrY !== undefined)\n attrs.y = attrY;\n if (attrScale !== undefined)\n attrs.scale = attrScale;\n // Build SVG path if one has been defined\n if (pathLength !== undefined) {\n buildSVGPath(attrs, pathLength, pathSpacing, pathOffset, false);\n }\n}\n\nexport { buildSVGAttrs, cssStyleProperties };\n//# sourceMappingURL=build-attrs.mjs.map\n","/**\n * A set of attribute names that are always read/written as camel case.\n */\nconst camelCaseAttributes = new Set([\n \"baseFrequency\",\n \"diffuseConstant\",\n \"kernelMatrix\",\n \"kernelUnitLength\",\n \"keySplines\",\n \"keyTimes\",\n \"limitingConeAngle\",\n \"markerHeight\",\n \"markerWidth\",\n \"numOctaves\",\n \"targetX\",\n \"targetY\",\n \"surfaceScale\",\n \"specularConstant\",\n \"specularExponent\",\n \"stdDeviation\",\n \"tableValues\",\n \"viewBox\",\n \"gradientTransform\",\n \"pathLength\",\n \"startOffset\",\n \"textLength\",\n \"lengthAdjust\",\n]);\n\nexport { camelCaseAttributes };\n//# sourceMappingURL=camel-case-attrs.mjs.map\n","const isSVGTag = (tag) => typeof tag === \"string\" && tag.toLowerCase() === \"svg\";\n\nexport { isSVGTag };\n//# sourceMappingURL=is-svg-tag.mjs.map\n","import { isMotionValue } from '../../../value/utils/is-motion-value.mjs';\nimport { transformPropOrder } from '../../utils/keys-transform.mjs';\nimport { scrapeMotionValuesFromProps as scrapeMotionValuesFromProps$1 } from '../../html/utils/scrape-motion-values.mjs';\n\nfunction scrapeMotionValuesFromProps(props, prevProps, visualElement) {\n const newValues = scrapeMotionValuesFromProps$1(props, prevProps, visualElement);\n for (const key in props) {\n if (isMotionValue(props[key]) ||\n isMotionValue(prevProps[key])) {\n const targetKey = transformPropOrder.indexOf(key) !== -1\n ? \"attr\" + key.charAt(0).toUpperCase() + key.substring(1)\n : key;\n newValues[targetKey] = props[key];\n }\n }\n return newValues;\n}\n\nexport { scrapeMotionValuesFromProps };\n//# sourceMappingURL=scrape-motion-values.mjs.map\n","import { transformProps } from '../utils/keys-transform.mjs';\nimport { getDefaultValueType } from '../../value/types/maps/defaults.mjs';\nimport { createBox } from '../../projection/geometry/models.mjs';\nimport { DOMVisualElement } from '../dom/DOMVisualElement.mjs';\nimport { camelToDash } from '../dom/utils/camel-to-dash.mjs';\nimport { cssStyleProperties, buildSVGAttrs } from './utils/build-attrs.mjs';\nimport { camelCaseAttributes } from './utils/camel-case-attrs.mjs';\nimport { isSVGTag } from './utils/is-svg-tag.mjs';\nimport { renderSVG } from './utils/render.mjs';\nimport { scrapeMotionValuesFromProps } from './utils/scrape-motion-values.mjs';\n\nclass SVGVisualElement extends DOMVisualElement {\n constructor() {\n super(...arguments);\n this.type = \"svg\";\n this.isSVGTag = false;\n this.measureInstanceViewportBox = createBox;\n }\n getBaseTargetFromProps(props, key) {\n return props[key];\n }\n readValueFromInstance(instance, key) {\n if (transformProps.has(key)) {\n const defaultType = getDefaultValueType(key);\n return defaultType ? defaultType.default || 0 : 0;\n }\n if (cssStyleProperties.includes(key)) {\n const computedStyle = getComputedStyle(instance);\n const value = computedStyle[key];\n if (typeof value === \"string\" && value)\n return value.trim();\n }\n key = !camelCaseAttributes.has(key) ? camelToDash(key) : key;\n return instance.getAttribute(key);\n }\n scrapeMotionValuesFromProps(props, prevProps, visualElement) {\n return scrapeMotionValuesFromProps(props, prevProps, visualElement);\n }\n build(renderState, latestValues, props) {\n buildSVGAttrs(renderState, latestValues, this.isSVGTag, props.transformTemplate, props.style);\n }\n renderInstance(instance, renderState, styleProp, projection) {\n renderSVG(instance, renderState, styleProp, projection);\n }\n mount(instance) {\n this.isSVGTag = isSVGTag(instance.tagName);\n super.mount(instance);\n }\n}\n\nexport { SVGVisualElement };\n//# sourceMappingURL=SVGVisualElement.mjs.map\n","import { camelToDash } from '../../dom/utils/camel-to-dash.mjs';\nimport { renderHTML } from '../../html/utils/render.mjs';\nimport { camelCaseAttributes } from './camel-case-attrs.mjs';\n\nfunction renderSVG(element, renderState, _styleProp, projection) {\n renderHTML(element, renderState, undefined, projection);\n for (const key in renderState.attrs) {\n element.setAttribute(!camelCaseAttributes.has(key) ? camelToDash(key) : key, renderState.attrs[key]);\n }\n}\n\nexport { renderSVG };\n//# sourceMappingURL=render.mjs.map\n","import { isVariantLabel } from './is-variant-label.mjs';\nimport { variantProps } from './variant-props.mjs';\n\nconst numVariantProps = variantProps.length;\n/**\n * Get variant context from a visual element's parent chain.\n * Uses `any` type for visualElement to avoid circular dependencies.\n */\nfunction getVariantContext(visualElement) {\n if (!visualElement)\n return undefined;\n if (!visualElement.isControllingVariants) {\n const context = visualElement.parent\n ? getVariantContext(visualElement.parent) || {}\n : {};\n if (visualElement.props.initial !== undefined) {\n context.initial = visualElement.props.initial;\n }\n return context;\n }\n const context = {};\n for (let i = 0; i < numVariantProps; i++) {\n const name = variantProps[i];\n const prop = visualElement.props[name];\n if (isVariantLabel(prop) || prop === false) {\n context[name] = prop;\n }\n }\n return context;\n}\n\nexport { getVariantContext };\n//# sourceMappingURL=get-variant-context.mjs.map\n","function shallowCompare(next, prev) {\n if (!Array.isArray(prev))\n return false;\n const prevLength = prev.length;\n if (prevLength !== next.length)\n return false;\n for (let i = 0; i < prevLength; i++) {\n if (prev[i] !== next[i])\n return false;\n }\n return true;\n}\n\nexport { shallowCompare };\n//# sourceMappingURL=shallow-compare.mjs.map\n","import { animateVisualElement } from '../../animation/interfaces/visual-element.mjs';\nimport { calcChildStagger } from '../../animation/utils/calc-child-stagger.mjs';\nimport { getVariantContext } from './get-variant-context.mjs';\nimport { isAnimationControls } from './is-animation-controls.mjs';\nimport { isKeyframesTarget } from './is-keyframes-target.mjs';\nimport { isVariantLabel } from './is-variant-label.mjs';\nimport { resolveVariant } from './resolve-dynamic-variants.mjs';\nimport { shallowCompare } from './shallow-compare.mjs';\nimport { variantPriorityOrder } from './variant-props.mjs';\n\nconst reversePriorityOrder = [...variantPriorityOrder].reverse();\nconst numAnimationTypes = variantPriorityOrder.length;\nfunction createAnimateFunction(visualElement) {\n return (animations) => {\n return Promise.all(animations.map(({ animation, options }) => animateVisualElement(visualElement, animation, options)));\n };\n}\nfunction createAnimationState(visualElement) {\n let animate = createAnimateFunction(visualElement);\n let state = createState();\n let isInitialRender = true;\n /**\n * Track whether the animation state has been reset (e.g. via StrictMode\n * double-invocation or Suspense unmount/remount). On the first\n * animateChanges() call after a reset we need to behave like the initial\n * render for variant-inheritance checks, even though isInitialRender is\n * already false.\n */\n let wasReset = false;\n /**\n * This function will be used to reduce the animation definitions for\n * each active animation type into an object of resolved values for it.\n */\n const buildResolvedTypeValues = (type) => (acc, definition) => {\n const resolved = resolveVariant(visualElement, definition, type === \"exit\"\n ? visualElement.presenceContext?.custom\n : undefined);\n if (resolved) {\n const { transition, transitionEnd, ...target } = resolved;\n acc = { ...acc, ...target, ...transitionEnd };\n }\n return acc;\n };\n /**\n * This just allows us to inject mocked animation functions\n * @internal\n */\n function setAnimateFunction(makeAnimator) {\n animate = makeAnimator(visualElement);\n }\n /**\n * When we receive new props, we need to:\n * 1. Create a list of protected keys for each type. This is a directory of\n * value keys that are currently being \"handled\" by types of a higher priority\n * so that whenever an animation is played of a given type, these values are\n * protected from being animated.\n * 2. Determine if an animation type needs animating.\n * 3. Determine if any values have been removed from a type and figure out\n * what to animate those to.\n */\n function animateChanges(changedActiveType) {\n const { props } = visualElement;\n const context = getVariantContext(visualElement.parent) || {};\n /**\n * A list of animations that we'll build into as we iterate through the animation\n * types. This will get executed at the end of the function.\n */\n const animations = [];\n /**\n * Keep track of which values have been removed. Then, as we hit lower priority\n * animation types, we can check if they contain removed values and animate to that.\n */\n const removedKeys = new Set();\n /**\n * A dictionary of all encountered keys. This is an object to let us build into and\n * copy it without iteration. Each time we hit an animation type we set its protected\n * keys - the keys its not allowed to animate - to the latest version of this object.\n */\n let encounteredKeys = {};\n /**\n * If a variant has been removed at a given index, and this component is controlling\n * variant animations, we want to ensure lower-priority variants are forced to animate.\n */\n let removedVariantIndex = Infinity;\n /**\n * Iterate through all animation types in reverse priority order. For each, we want to\n * detect which values it's handling and whether or not they've changed (and therefore\n * need to be animated). If any values have been removed, we want to detect those in\n * lower priority props and flag for animation.\n */\n for (let i = 0; i < numAnimationTypes; i++) {\n const type = reversePriorityOrder[i];\n const typeState = state[type];\n const prop = props[type] !== undefined\n ? props[type]\n : context[type];\n const propIsVariant = isVariantLabel(prop);\n /**\n * If this type has *just* changed isActive status, set activeDelta\n * to that status. Otherwise set to null.\n */\n const activeDelta = type === changedActiveType ? typeState.isActive : null;\n if (activeDelta === false)\n removedVariantIndex = i;\n /**\n * If this prop is an inherited variant, rather than been set directly on the\n * component itself, we want to make sure we allow the parent to trigger animations.\n *\n * TODO: Can probably change this to a !isControllingVariants check\n */\n let isInherited = prop === context[type] &&\n prop !== props[type] &&\n propIsVariant;\n if (isInherited &&\n (isInitialRender || wasReset) &&\n visualElement.manuallyAnimateOnMount) {\n isInherited = false;\n }\n /**\n * Set all encountered keys so far as the protected keys for this type. This will\n * be any key that has been animated or otherwise handled by active, higher-priortiy types.\n */\n typeState.protectedKeys = { ...encounteredKeys };\n // Check if we can skip analysing this prop early\n if (\n // If it isn't active and hasn't *just* been set as inactive\n (!typeState.isActive && activeDelta === null) ||\n // If we didn't and don't have any defined prop for this animation type\n (!prop && !typeState.prevProp) ||\n // Or if the prop doesn't define an animation\n isAnimationControls(prop) ||\n typeof prop === \"boolean\") {\n continue;\n }\n /**\n * If exit is already active and wasn't just activated, skip\n * re-processing to prevent interrupting running exit animations.\n * Re-resolving exit with a changed custom value can start new\n * value animations that stop the originals, leaving the exit\n * animation promise unresolved and the component stuck in the DOM.\n */\n if (type === \"exit\" && typeState.isActive && activeDelta !== true) {\n if (typeState.prevResolvedValues) {\n encounteredKeys = {\n ...encounteredKeys,\n ...typeState.prevResolvedValues,\n };\n }\n continue;\n }\n /**\n * As we go look through the values defined on this type, if we detect\n * a changed value or a value that was removed in a higher priority, we set\n * this to true and add this prop to the animation list.\n */\n const variantDidChange = checkVariantsDidChange(typeState.prevProp, prop);\n let shouldAnimateType = variantDidChange ||\n // If we're making this variant active, we want to always make it active\n (type === changedActiveType &&\n typeState.isActive &&\n !isInherited &&\n propIsVariant) ||\n // If we removed a higher-priority variant (i is in reverse order)\n (i > removedVariantIndex && propIsVariant);\n let handledRemovedValues = false;\n /**\n * As animations can be set as variant lists, variants or target objects, we\n * coerce everything to an array if it isn't one already\n */\n const definitionList = Array.isArray(prop) ? prop : [prop];\n /**\n * Build an object of all the resolved values. We'll use this in the subsequent\n * animateChanges calls to determine whether a value has changed.\n */\n let resolvedValues = definitionList.reduce(buildResolvedTypeValues(type), {});\n if (activeDelta === false)\n resolvedValues = {};\n /**\n * Now we need to loop through all the keys in the prev prop and this prop,\n * and decide:\n * 1. If the value has changed, and needs animating\n * 2. If it has been removed, and needs adding to the removedKeys set\n * 3. If it has been removed in a higher priority type and needs animating\n * 4. If it hasn't been removed in a higher priority but hasn't changed, and\n * needs adding to the type's protectedKeys list.\n */\n const { prevResolvedValues = {} } = typeState;\n const allKeys = {\n ...prevResolvedValues,\n ...resolvedValues,\n };\n const markToAnimate = (key) => {\n shouldAnimateType = true;\n if (removedKeys.has(key)) {\n handledRemovedValues = true;\n removedKeys.delete(key);\n }\n typeState.needsAnimating[key] = true;\n const motionValue = visualElement.getValue(key);\n if (motionValue)\n motionValue.liveStyle = false;\n };\n for (const key in allKeys) {\n const next = resolvedValues[key];\n const prev = prevResolvedValues[key];\n // If we've already handled this we can just skip ahead\n if (encounteredKeys.hasOwnProperty(key))\n continue;\n /**\n * If the value has changed, we probably want to animate it.\n */\n let valueHasChanged = false;\n if (isKeyframesTarget(next) && isKeyframesTarget(prev)) {\n valueHasChanged =\n !shallowCompare(next, prev) || variantDidChange;\n }\n else {\n valueHasChanged = next !== prev;\n }\n if (valueHasChanged) {\n if (next !== undefined && next !== null) {\n // If next is defined and doesn't equal prev, it needs animating\n markToAnimate(key);\n }\n else {\n // If it's undefined, it's been removed.\n removedKeys.add(key);\n }\n }\n else if (next !== undefined && removedKeys.has(key)) {\n /**\n * If next hasn't changed and it isn't undefined, we want to check if it's\n * been removed by a higher priority\n */\n markToAnimate(key);\n }\n else {\n /**\n * If it hasn't changed, we add it to the list of protected values\n * to ensure it doesn't get animated.\n */\n typeState.protectedKeys[key] = true;\n }\n }\n /**\n * Update the typeState so next time animateChanges is called we can compare the\n * latest prop and resolvedValues to these.\n */\n typeState.prevProp = prop;\n typeState.prevResolvedValues = resolvedValues;\n if (typeState.isActive) {\n encounteredKeys = { ...encounteredKeys, ...resolvedValues };\n }\n if ((isInitialRender || wasReset) &&\n visualElement.blockInitialAnimation) {\n shouldAnimateType = false;\n }\n /**\n * If this is an inherited prop we want to skip this animation\n * unless the inherited variants haven't changed on this render.\n */\n const willAnimateViaParent = isInherited && variantDidChange;\n const needsAnimating = !willAnimateViaParent || handledRemovedValues;\n if (shouldAnimateType && needsAnimating) {\n animations.push(...definitionList.map((animation) => {\n const options = { type };\n /**\n * If we're performing the initial animation, but we're not\n * rendering at the same time as the variant-controlling parent,\n * we want to use the parent's transition to calculate the stagger.\n */\n if (typeof animation === \"string\" &&\n (isInitialRender || wasReset) &&\n !willAnimateViaParent &&\n visualElement.manuallyAnimateOnMount &&\n visualElement.parent) {\n const { parent } = visualElement;\n const parentVariant = resolveVariant(parent, animation);\n if (parent.enteringChildren && parentVariant) {\n const { delayChildren } = parentVariant.transition || {};\n options.delay = calcChildStagger(parent.enteringChildren, visualElement, delayChildren);\n }\n }\n return {\n animation: animation,\n options,\n };\n }));\n }\n }\n /**\n * If there are some removed value that haven't been dealt with,\n * we need to create a new animation that falls back either to the value\n * defined in the style prop, or the last read value.\n */\n if (removedKeys.size) {\n const fallbackAnimation = {};\n /**\n * If the initial prop contains a transition we can use that, otherwise\n * allow the animation function to use the visual element's default.\n */\n if (typeof props.initial !== \"boolean\") {\n const initialTransition = resolveVariant(visualElement, Array.isArray(props.initial)\n ? props.initial[0]\n : props.initial);\n if (initialTransition && initialTransition.transition) {\n fallbackAnimation.transition = initialTransition.transition;\n }\n }\n removedKeys.forEach((key) => {\n const fallbackTarget = visualElement.getBaseTarget(key);\n const motionValue = visualElement.getValue(key);\n if (motionValue)\n motionValue.liveStyle = true;\n // @ts-expect-error - @mattgperry to figure if we should do something here\n fallbackAnimation[key] = fallbackTarget ?? null;\n });\n animations.push({ animation: fallbackAnimation });\n }\n let shouldAnimate = Boolean(animations.length);\n if (isInitialRender &&\n (props.initial === false || props.initial === props.animate) &&\n !visualElement.manuallyAnimateOnMount) {\n shouldAnimate = false;\n }\n isInitialRender = false;\n wasReset = false;\n return shouldAnimate ? animate(animations) : Promise.resolve();\n }\n /**\n * Change whether a certain animation type is active.\n */\n function setActive(type, isActive) {\n // If the active state hasn't changed, we can safely do nothing here\n if (state[type].isActive === isActive)\n return Promise.resolve();\n // Propagate active change to children\n visualElement.variantChildren?.forEach((child) => child.animationState?.setActive(type, isActive));\n state[type].isActive = isActive;\n const animations = animateChanges(type);\n for (const key in state) {\n state[key].protectedKeys = {};\n }\n return animations;\n }\n return {\n animateChanges,\n setActive,\n setAnimateFunction,\n getState: () => state,\n reset: () => {\n state = createState();\n wasReset = true;\n },\n };\n}\nfunction checkVariantsDidChange(prev, next) {\n if (typeof next === \"string\") {\n return next !== prev;\n }\n else if (Array.isArray(next)) {\n return !shallowCompare(next, prev);\n }\n return false;\n}\nfunction createTypeState(isActive = false) {\n return {\n isActive,\n protectedKeys: {},\n needsAnimating: {},\n prevResolvedValues: {},\n };\n}\nfunction createState() {\n return {\n animate: createTypeState(true),\n whileInView: createTypeState(),\n whileHover: createTypeState(),\n whileTap: createTypeState(),\n whileDrag: createTypeState(),\n whileFocus: createTypeState(),\n exit: createTypeState(),\n };\n}\n\nexport { checkVariantsDidChange, createAnimationState };\n//# sourceMappingURL=animation-state.mjs.map\n","import { resolveVariant } from '../../render/utils/resolve-dynamic-variants.mjs';\nimport { animateTarget } from './visual-element-target.mjs';\nimport { animateVariant } from './visual-element-variant.mjs';\n\nfunction animateVisualElement(visualElement, definition, options = {}) {\n visualElement.notify(\"AnimationStart\", definition);\n let animation;\n if (Array.isArray(definition)) {\n const animations = definition.map((variant) => animateVariant(visualElement, variant, options));\n animation = Promise.all(animations);\n }\n else if (typeof definition === \"string\") {\n animation = animateVariant(visualElement, definition, options);\n }\n else {\n const resolvedDefinition = typeof definition === \"function\"\n ? resolveVariant(visualElement, definition, options.custom)\n : definition;\n animation = Promise.all(animateTarget(visualElement, resolvedDefinition, options));\n }\n return animation.then(() => {\n visualElement.notify(\"AnimationComplete\", definition);\n });\n}\n\nexport { animateVisualElement };\n//# sourceMappingURL=visual-element.mjs.map\n","/**\n * Reset an axis to the provided origin box.\n *\n * This is a mutative operation.\n */\nfunction copyAxisInto(axis, originAxis) {\n axis.min = originAxis.min;\n axis.max = originAxis.max;\n}\n/**\n * Reset a box to the provided origin box.\n *\n * This is a mutative operation.\n */\nfunction copyBoxInto(box, originBox) {\n copyAxisInto(box.x, originBox.x);\n copyAxisInto(box.y, originBox.y);\n}\n/**\n * Reset a delta to the provided origin box.\n *\n * This is a mutative operation.\n */\nfunction copyAxisDeltaInto(delta, originDelta) {\n delta.translate = originDelta.translate;\n delta.scale = originDelta.scale;\n delta.originPoint = originDelta.originPoint;\n delta.origin = originDelta.origin;\n}\n\nexport { copyAxisDeltaInto, copyAxisInto, copyBoxInto };\n//# sourceMappingURL=copy.mjs.map\n","import { mixNumber } from '../../utils/mix/number.mjs';\n\nconst SCALE_PRECISION = 0.0001;\nconst SCALE_MIN = 1 - SCALE_PRECISION;\nconst SCALE_MAX = 1 + SCALE_PRECISION;\nconst TRANSLATE_PRECISION = 0.01;\nconst TRANSLATE_MIN = 0 - TRANSLATE_PRECISION;\nconst TRANSLATE_MAX = 0 + TRANSLATE_PRECISION;\nfunction calcLength(axis) {\n return axis.max - axis.min;\n}\nfunction isNear(value, target, maxDistance) {\n return Math.abs(value - target) <= maxDistance;\n}\nfunction calcAxisDelta(delta, source, target, origin = 0.5) {\n delta.origin = origin;\n delta.originPoint = mixNumber(source.min, source.max, delta.origin);\n delta.scale = calcLength(target) / calcLength(source);\n delta.translate =\n mixNumber(target.min, target.max, delta.origin) - delta.originPoint;\n if ((delta.scale >= SCALE_MIN && delta.scale <= SCALE_MAX) ||\n isNaN(delta.scale)) {\n delta.scale = 1.0;\n }\n if ((delta.translate >= TRANSLATE_MIN &&\n delta.translate <= TRANSLATE_MAX) ||\n isNaN(delta.translate)) {\n delta.translate = 0.0;\n }\n}\nfunction calcBoxDelta(delta, source, target, origin) {\n calcAxisDelta(delta.x, source.x, target.x, origin ? origin.originX : undefined);\n calcAxisDelta(delta.y, source.y, target.y, origin ? origin.originY : undefined);\n}\nfunction calcRelativeAxis(target, relative, parent, anchor = 0) {\n const anchorPoint = anchor\n ? mixNumber(parent.min, parent.max, anchor)\n : parent.min;\n target.min = anchorPoint + relative.min;\n target.max = target.min + calcLength(relative);\n}\nfunction calcRelativeBox(target, relative, parent, anchor) {\n calcRelativeAxis(target.x, relative.x, parent.x, anchor?.x);\n calcRelativeAxis(target.y, relative.y, parent.y, anchor?.y);\n}\nfunction calcRelativeAxisPosition(target, layout, parent, anchor = 0) {\n const anchorPoint = anchor\n ? mixNumber(parent.min, parent.max, anchor)\n : parent.min;\n target.min = layout.min - anchorPoint;\n target.max = target.min + calcLength(layout);\n}\nfunction calcRelativePosition(target, layout, parent, anchor) {\n calcRelativeAxisPosition(target.x, layout.x, parent.x, anchor?.x);\n calcRelativeAxisPosition(target.y, layout.y, parent.y, anchor?.y);\n}\n\nexport { calcAxisDelta, calcBoxDelta, calcLength, calcRelativeAxis, calcRelativeAxisPosition, calcRelativeBox, calcRelativePosition, isNear };\n//# sourceMappingURL=delta-calc.mjs.map\n","import { mixNumber } from '../../utils/mix/number.mjs';\nimport { percent } from '../../value/types/numbers/units.mjs';\nimport { scalePoint } from './delta-apply.mjs';\n\n/**\n * Remove a delta from a point. This is essentially the steps of applyPointDelta in reverse\n */\nfunction removePointDelta(point, translate, scale, originPoint, boxScale) {\n point -= translate;\n point = scalePoint(point, 1 / scale, originPoint);\n if (boxScale !== undefined) {\n point = scalePoint(point, 1 / boxScale, originPoint);\n }\n return point;\n}\n/**\n * Remove a delta from an axis. This is essentially the steps of applyAxisDelta in reverse\n */\nfunction removeAxisDelta(axis, translate = 0, scale = 1, origin = 0.5, boxScale, originAxis = axis, sourceAxis = axis) {\n if (percent.test(translate)) {\n translate = parseFloat(translate);\n const relativeProgress = mixNumber(sourceAxis.min, sourceAxis.max, translate / 100);\n translate = relativeProgress - sourceAxis.min;\n }\n if (typeof translate !== \"number\")\n return;\n let originPoint = mixNumber(originAxis.min, originAxis.max, origin);\n if (axis === originAxis)\n originPoint -= translate;\n axis.min = removePointDelta(axis.min, translate, scale, originPoint, boxScale);\n axis.max = removePointDelta(axis.max, translate, scale, originPoint, boxScale);\n}\n/**\n * Remove a transforms from an axis. This is essentially the steps of applyAxisTransforms in reverse\n * and acts as a bridge between motion values and removeAxisDelta\n */\nfunction removeAxisTransforms(axis, transforms, [key, scaleKey, originKey], origin, sourceAxis) {\n removeAxisDelta(axis, transforms[key], transforms[scaleKey], transforms[originKey], transforms.scale, origin, sourceAxis);\n}\n/**\n * The names of the motion values we want to apply as translation, scale and origin.\n */\nconst xKeys = [\"x\", \"scaleX\", \"originX\"];\nconst yKeys = [\"y\", \"scaleY\", \"originY\"];\n/**\n * Remove a transforms from an box. This is essentially the steps of applyAxisBox in reverse\n * and acts as a bridge between motion values and removeAxisDelta\n */\nfunction removeBoxTransforms(box, transforms, originBox, sourceBox) {\n removeAxisTransforms(box.x, transforms, xKeys, originBox ? originBox.x : undefined, sourceBox ? sourceBox.x : undefined);\n removeAxisTransforms(box.y, transforms, yKeys, originBox ? originBox.y : undefined, sourceBox ? sourceBox.y : undefined);\n}\n\nexport { removeAxisDelta, removeAxisTransforms, removeBoxTransforms, removePointDelta };\n//# sourceMappingURL=delta-remove.mjs.map\n","import { calcLength } from './delta-calc.mjs';\n\nfunction isAxisDeltaZero(delta) {\n return delta.translate === 0 && delta.scale === 1;\n}\nfunction isDeltaZero(delta) {\n return isAxisDeltaZero(delta.x) && isAxisDeltaZero(delta.y);\n}\nfunction axisEquals(a, b) {\n return a.min === b.min && a.max === b.max;\n}\nfunction boxEquals(a, b) {\n return axisEquals(a.x, b.x) && axisEquals(a.y, b.y);\n}\nfunction axisEqualsRounded(a, b) {\n return (Math.round(a.min) === Math.round(b.min) &&\n Math.round(a.max) === Math.round(b.max));\n}\nfunction boxEqualsRounded(a, b) {\n return axisEqualsRounded(a.x, b.x) && axisEqualsRounded(a.y, b.y);\n}\nfunction aspectRatio(box) {\n return calcLength(box.x) / calcLength(box.y);\n}\nfunction axisDeltaEquals(a, b) {\n return (a.translate === b.translate &&\n a.scale === b.scale &&\n a.originPoint === b.originPoint);\n}\n\nexport { aspectRatio, axisDeltaEquals, axisEquals, axisEqualsRounded, boxEquals, boxEqualsRounded, isDeltaZero };\n//# sourceMappingURL=utils.mjs.map\n","function eachAxis(callback) {\n return [callback(\"x\"), callback(\"y\")];\n}\n\nexport { eachAxis };\n//# sourceMappingURL=each-axis.mjs.map\n","import { mixNumber } from '../../utils/mix/number.mjs';\nimport { percent, px } from '../../value/types/numbers/units.mjs';\nimport { progress, circOut, noop } from 'motion-utils';\nimport { cornerRadiusProps } from '../../utils/border-radius.mjs';\n\nconst numBorders = cornerRadiusProps.length;\nconst asNumber = (value) => typeof value === \"string\" ? parseFloat(value) : value;\nconst isPx = (value) => typeof value === \"number\" || px.test(value);\nfunction mixValues(target, follow, lead, progress, shouldCrossfadeOpacity, isOnlyMember) {\n if (shouldCrossfadeOpacity) {\n target.opacity = mixNumber(0, lead.opacity ?? 1, easeCrossfadeIn(progress));\n target.opacityExit = mixNumber(follow.opacity ?? 1, 0, easeCrossfadeOut(progress));\n }\n else if (isOnlyMember) {\n target.opacity = mixNumber(follow.opacity ?? 1, lead.opacity ?? 1, progress);\n }\n /**\n * Mix border radius\n */\n for (let i = 0; i < numBorders; i++) {\n const borderLabel = cornerRadiusProps[i];\n let followRadius = getRadius(follow, borderLabel);\n let leadRadius = getRadius(lead, borderLabel);\n if (followRadius === undefined && leadRadius === undefined)\n continue;\n followRadius || (followRadius = 0);\n leadRadius || (leadRadius = 0);\n const canMix = followRadius === 0 ||\n leadRadius === 0 ||\n isPx(followRadius) === isPx(leadRadius);\n if (canMix) {\n target[borderLabel] = Math.max(mixNumber(asNumber(followRadius), asNumber(leadRadius), progress), 0);\n if (percent.test(leadRadius) || percent.test(followRadius)) {\n target[borderLabel] += \"%\";\n }\n }\n else {\n target[borderLabel] = leadRadius;\n }\n }\n /**\n * Mix rotation\n */\n if (follow.rotate || lead.rotate) {\n target.rotate = mixNumber(follow.rotate || 0, lead.rotate || 0, progress);\n }\n}\nfunction getRadius(values, radiusName) {\n return values[radiusName] !== undefined\n ? values[radiusName]\n : values.borderRadius;\n}\nconst easeCrossfadeIn = /*@__PURE__*/ compress(0, 0.5, circOut);\nconst easeCrossfadeOut = /*@__PURE__*/ compress(0.5, 0.95, noop);\nfunction compress(min, max, easing) {\n return (p) => {\n // Could replace ifs with clamp\n if (p < min)\n return 0;\n if (p > max)\n return 1;\n return easing(progress(min, max, p));\n };\n}\n\nexport { mixValues };\n//# sourceMappingURL=mix-values.mjs.map\n","function addDomEvent(target, eventName, handler, options = { passive: true }) {\n target.addEventListener(eventName, handler, options);\n return () => target.removeEventListener(eventName, handler, options);\n}\n\nexport { addDomEvent };\n//# sourceMappingURL=add-dom-event.mjs.map\n","const compareByDepth = (a, b) => a.depth - b.depth;\n\nexport { compareByDepth };\n//# sourceMappingURL=compare-by-depth.mjs.map\n","import { addUniqueItem, removeItem } from 'motion-utils';\nimport { compareByDepth } from './compare-by-depth.mjs';\n\nclass FlatTree {\n constructor() {\n this.children = [];\n this.isDirty = false;\n }\n add(child) {\n addUniqueItem(this.children, child);\n this.isDirty = true;\n }\n remove(child) {\n removeItem(this.children, child);\n this.isDirty = true;\n }\n forEach(callback) {\n this.isDirty && this.children.sort(compareByDepth);\n this.isDirty = false;\n this.children.forEach(callback);\n }\n}\n\nexport { FlatTree };\n//# sourceMappingURL=flat-tree.mjs.map\n","import { isMotionValue } from './is-motion-value.mjs';\n\n/**\n * If the provided value is a MotionValue, this returns the actual value, otherwise just the value itself\n */\nfunction resolveMotionValue(value) {\n return isMotionValue(value) ? value.get() : value;\n}\n\nexport { resolveMotionValue };\n//# sourceMappingURL=resolve-motion-value.mjs.map\n","import { addUniqueItem, removeItem } from 'motion-utils';\n\nclass NodeStack {\n constructor() {\n this.members = [];\n }\n add(node) {\n addUniqueItem(this.members, node);\n for (let i = this.members.length - 1; i >= 0; i--) {\n const member = this.members[i];\n if (member === node || member === this.lead || member === this.prevLead)\n continue;\n const inst = member.instance;\n if ((!inst || inst.isConnected === false) && !member.snapshot) {\n removeItem(this.members, member);\n member.unmount();\n }\n }\n node.scheduleRender();\n }\n remove(node) {\n removeItem(this.members, node);\n if (node === this.prevLead)\n this.prevLead = undefined;\n if (node === this.lead) {\n const prevLead = this.members[this.members.length - 1];\n if (prevLead)\n this.promote(prevLead);\n }\n }\n relegate(node) {\n for (let i = this.members.indexOf(node) - 1; i >= 0; i--) {\n const member = this.members[i];\n if (member.isPresent !== false && member.instance?.isConnected !== false) {\n this.promote(member);\n return true;\n }\n }\n return false;\n }\n promote(node, preserveFollowOpacity) {\n const prevLead = this.lead;\n if (node === prevLead)\n return;\n this.prevLead = prevLead;\n this.lead = node;\n node.show();\n if (prevLead) {\n prevLead.updateSnapshot();\n node.scheduleRender();\n const { layoutDependency: prevDep } = prevLead.options;\n const { layoutDependency: nextDep } = node.options;\n if (prevDep === undefined || prevDep !== nextDep) {\n node.resumeFrom = prevLead;\n if (preserveFollowOpacity)\n prevLead.preserveOpacity = true;\n if (prevLead.snapshot) {\n node.snapshot = prevLead.snapshot;\n node.snapshot.latestValues =\n prevLead.animationValues || prevLead.latestValues;\n }\n if (node.root?.isUpdating)\n node.isLayoutDirty = true;\n }\n if (node.options.crossfade === false)\n prevLead.hide();\n }\n }\n exitAnimationComplete() {\n this.members.forEach((member) => {\n member.options.onExitComplete?.();\n member.resumingFrom?.options.onExitComplete?.();\n });\n }\n scheduleRender() {\n this.members.forEach((member) => member.instance && member.scheduleRender(false));\n }\n removeLeadSnapshot() {\n if (this.lead?.snapshot)\n this.lead.snapshot = undefined;\n }\n}\n\nexport { NodeStack };\n//# sourceMappingURL=stack.mjs.map\n","/**\n * This should only ever be modified on the client otherwise it'll\n * persist through server requests. If we need instanced states we\n * could lazy-init via root.\n */\nconst globalProjectionState = {\n /**\n * Global flag as to whether the tree has animated since the last time\n * we resized the window\n */\n hasAnimatedSinceResize: true,\n /**\n * We set this to true once, on the first update. Any nodes added to the tree beyond that\n * update will be given a `data-projection-id` attribute.\n */\n hasEverUpdated: false,\n};\n\nexport { globalProjectionState };\n//# sourceMappingURL=state.mjs.map\n","import { SubscriptionManager, clamp, noop } from 'motion-utils';\nimport { animateSingleValue } from '../../animation/animate/single-value.mjs';\nimport { getOptimisedAppearId } from '../../animation/optimized-appear/get-appear-id.mjs';\nimport { getValueTransition } from '../../animation/utils/get-value-transition.mjs';\nimport { microtask } from '../../frameloop/microtask.mjs';\nimport { time } from '../../frameloop/sync-time.mjs';\nimport { scaleCorrectors } from '../styles/scale-correction.mjs';\nimport { statsBuffer } from '../../stats/buffer.mjs';\nimport { delay } from '../../utils/delay.mjs';\nimport { isSVGElement } from '../../utils/is-svg-element.mjs';\nimport { isSVGSVGElement } from '../../utils/is-svg-svg-element.mjs';\nimport { mixNumber } from '../../utils/mix/number.mjs';\nimport { motionValue } from '../../value/index.mjs';\nimport { resolveMotionValue } from '../../value/utils/resolve-motion-value.mjs';\nimport { mixValues } from '../animation/mix-values.mjs';\nimport { copyBoxInto, copyAxisDeltaInto, copyAxisInto } from '../geometry/copy.mjs';\nimport { translateAxis, transformBox, applyBoxDelta, applyTreeDeltas } from '../geometry/delta-apply.mjs';\nimport { calcLength, calcRelativeBox, calcRelativePosition, calcBoxDelta, isNear } from '../geometry/delta-calc.mjs';\nimport { removeBoxTransforms } from '../geometry/delta-remove.mjs';\nimport { createBox, createDelta } from '../geometry/models.mjs';\nimport { boxEqualsRounded, isDeltaZero, axisDeltaEquals, boxEquals, aspectRatio } from '../geometry/utils.mjs';\nimport { NodeStack } from '../shared/stack.mjs';\nimport { buildProjectionTransform } from '../styles/transform.mjs';\nimport { eachAxis } from '../utils/each-axis.mjs';\nimport { FlatTree } from '../utils/flat-tree.mjs';\nimport { hasTransform, hasScale, has2DTranslate } from '../utils/has-transform.mjs';\nimport { globalProjectionState } from './state.mjs';\nimport { frame, cancelFrame, frameData, frameSteps } from '../../frameloop/frame.mjs';\n\nconst metrics = {\n nodes: 0,\n calculatedTargetDeltas: 0,\n calculatedProjections: 0,\n};\nconst transformAxes = [\"\", \"X\", \"Y\", \"Z\"];\n/**\n * We use 1000 as the animation target as 0-1000 maps better to pixels than 0-1\n * which has a noticeable difference in spring animations\n */\nconst animationTarget = 1000;\nlet id = 0;\nfunction resetDistortingTransform(key, visualElement, values, sharedAnimationValues) {\n const { latestValues } = visualElement;\n // Record the distorting transform and then temporarily set it to 0\n if (latestValues[key]) {\n values[key] = latestValues[key];\n visualElement.setStaticValue(key, 0);\n if (sharedAnimationValues) {\n sharedAnimationValues[key] = 0;\n }\n }\n}\nfunction cancelTreeOptimisedTransformAnimations(projectionNode) {\n projectionNode.hasCheckedOptimisedAppear = true;\n if (projectionNode.root === projectionNode)\n return;\n const { visualElement } = projectionNode.options;\n if (!visualElement)\n return;\n const appearId = getOptimisedAppearId(visualElement);\n if (window.MotionHasOptimisedAnimation(appearId, \"transform\")) {\n const { layout, layoutId } = projectionNode.options;\n window.MotionCancelOptimisedAnimation(appearId, \"transform\", frame, !(layout || layoutId));\n }\n const { parent } = projectionNode;\n if (parent && !parent.hasCheckedOptimisedAppear) {\n cancelTreeOptimisedTransformAnimations(parent);\n }\n}\nfunction createProjectionNode({ attachResizeListener, defaultParent, measureScroll, checkIsScrollRoot, resetTransform, }) {\n return class ProjectionNode {\n constructor(latestValues = {}, parent = defaultParent?.()) {\n /**\n * A unique ID generated for every projection node.\n */\n this.id = id++;\n /**\n * An id that represents a unique session instigated by startUpdate.\n */\n this.animationId = 0;\n this.animationCommitId = 0;\n /**\n * A Set containing all this component's children. This is used to iterate\n * through the children.\n *\n * TODO: This could be faster to iterate as a flat array stored on the root node.\n */\n this.children = new Set();\n /**\n * Options for the node. We use this to configure what kind of layout animations\n * we should perform (if any).\n */\n this.options = {};\n /**\n * We use this to detect when its safe to shut down part of a projection tree.\n * We have to keep projecting children for scale correction and relative projection\n * until all their parents stop performing layout animations.\n */\n this.isTreeAnimating = false;\n this.isAnimationBlocked = false;\n /**\n * Flag to true if we think this layout has been changed. We can't always know this,\n * currently we set it to true every time a component renders, or if it has a layoutDependency\n * if that has changed between renders. Additionally, components can be grouped by LayoutGroup\n * and if one node is dirtied, they all are.\n */\n this.isLayoutDirty = false;\n /**\n * Flag to true if we think the projection calculations for this node needs\n * recalculating as a result of an updated transform or layout animation.\n */\n this.isProjectionDirty = false;\n /**\n * Flag to true if the layout *or* transform has changed. This then gets propagated\n * throughout the projection tree, forcing any element below to recalculate on the next frame.\n */\n this.isSharedProjectionDirty = false;\n /**\n * Flag transform dirty. This gets propagated throughout the whole tree but is only\n * respected by shared nodes.\n */\n this.isTransformDirty = false;\n /**\n * Block layout updates for instant layout transitions throughout the tree.\n */\n this.updateManuallyBlocked = false;\n this.updateBlockedByResize = false;\n /**\n * Set to true between the start of the first `willUpdate` call and the end of the `didUpdate`\n * call.\n */\n this.isUpdating = false;\n /**\n * If this is an SVG element we currently disable projection transforms\n */\n this.isSVG = false;\n /**\n * Flag to true (during promotion) if a node doing an instant layout transition needs to reset\n * its projection styles.\n */\n this.needsReset = false;\n /**\n * Flags whether this node should have its transform reset prior to measuring.\n */\n this.shouldResetTransform = false;\n /**\n * Store whether this node has been checked for optimised appear animations. As\n * effects fire bottom-up, and we want to look up the tree for appear animations,\n * this makes sure we only check each path once, stopping at nodes that\n * have already been checked.\n */\n this.hasCheckedOptimisedAppear = false;\n /**\n * An object representing the calculated contextual/accumulated/tree scale.\n * This will be used to scale calculcated projection transforms, as these are\n * calculated in screen-space but need to be scaled for elements to layoutly\n * make it to their calculated destinations.\n *\n * TODO: Lazy-init\n */\n this.treeScale = { x: 1, y: 1 };\n /**\n *\n */\n this.eventHandlers = new Map();\n this.hasTreeAnimated = false;\n this.layoutVersion = 0;\n // Note: Currently only running on root node\n this.updateScheduled = false;\n this.scheduleUpdate = () => this.update();\n this.projectionUpdateScheduled = false;\n this.checkUpdateFailed = () => {\n if (this.isUpdating) {\n this.isUpdating = false;\n this.clearAllSnapshots();\n }\n };\n /**\n * This is a multi-step process as shared nodes might be of different depths. Nodes\n * are sorted by depth order, so we need to resolve the entire tree before moving to\n * the next step.\n */\n this.updateProjection = () => {\n this.projectionUpdateScheduled = false;\n /**\n * Reset debug counts. Manually resetting rather than creating a new\n * object each frame.\n */\n if (statsBuffer.value) {\n metrics.nodes =\n metrics.calculatedTargetDeltas =\n metrics.calculatedProjections =\n 0;\n }\n this.nodes.forEach(propagateDirtyNodes);\n this.nodes.forEach(resolveTargetDelta);\n this.nodes.forEach(calcProjection);\n this.nodes.forEach(cleanDirtyNodes);\n if (statsBuffer.addProjectionMetrics) {\n statsBuffer.addProjectionMetrics(metrics);\n }\n };\n /**\n * Frame calculations\n */\n this.resolvedRelativeTargetAt = 0.0;\n this.linkedParentVersion = 0;\n this.hasProjected = false;\n this.isVisible = true;\n this.animationProgress = 0;\n /**\n * Shared layout\n */\n // TODO Only running on root node\n this.sharedNodes = new Map();\n this.latestValues = latestValues;\n this.root = parent ? parent.root || parent : this;\n this.path = parent ? [...parent.path, parent] : [];\n this.parent = parent;\n this.depth = parent ? parent.depth + 1 : 0;\n for (let i = 0; i < this.path.length; i++) {\n this.path[i].shouldResetTransform = true;\n }\n if (this.root === this)\n this.nodes = new FlatTree();\n }\n addEventListener(name, handler) {\n if (!this.eventHandlers.has(name)) {\n this.eventHandlers.set(name, new SubscriptionManager());\n }\n return this.eventHandlers.get(name).add(handler);\n }\n notifyListeners(name, ...args) {\n const subscriptionManager = this.eventHandlers.get(name);\n subscriptionManager && subscriptionManager.notify(...args);\n }\n hasListeners(name) {\n return this.eventHandlers.has(name);\n }\n /**\n * Lifecycles\n */\n mount(instance) {\n if (this.instance)\n return;\n this.isSVG = isSVGElement(instance) && !isSVGSVGElement(instance);\n this.instance = instance;\n const { layoutId, layout, visualElement } = this.options;\n if (visualElement && !visualElement.current) {\n visualElement.mount(instance);\n }\n this.root.nodes.add(this);\n this.parent && this.parent.children.add(this);\n if (this.root.hasTreeAnimated && (layout || layoutId)) {\n this.isLayoutDirty = true;\n }\n if (attachResizeListener) {\n let cancelDelay;\n let innerWidth = 0;\n const resizeUnblockUpdate = () => (this.root.updateBlockedByResize = false);\n // Set initial innerWidth in a frame.read callback to batch the read\n frame.read(() => {\n innerWidth = window.innerWidth;\n });\n attachResizeListener(instance, () => {\n const newInnerWidth = window.innerWidth;\n if (newInnerWidth === innerWidth)\n return;\n innerWidth = newInnerWidth;\n this.root.updateBlockedByResize = true;\n cancelDelay && cancelDelay();\n cancelDelay = delay(resizeUnblockUpdate, 250);\n if (globalProjectionState.hasAnimatedSinceResize) {\n globalProjectionState.hasAnimatedSinceResize = false;\n this.nodes.forEach(finishAnimation);\n }\n });\n }\n if (layoutId) {\n this.root.registerSharedNode(layoutId, this);\n }\n // Only register the handler if it requires layout animation\n if (this.options.animate !== false &&\n visualElement &&\n (layoutId || layout)) {\n this.addEventListener(\"didUpdate\", ({ delta, hasLayoutChanged, hasRelativeLayoutChanged, layout: newLayout, }) => {\n if (this.isTreeAnimationBlocked()) {\n this.target = undefined;\n this.relativeTarget = undefined;\n return;\n }\n // TODO: Check here if an animation exists\n const layoutTransition = this.options.transition ||\n visualElement.getDefaultTransition() ||\n defaultLayoutTransition;\n const { onLayoutAnimationStart, onLayoutAnimationComplete, } = visualElement.getProps();\n /**\n * The target layout of the element might stay the same,\n * but its position relative to its parent has changed.\n */\n const hasTargetChanged = !this.targetLayout ||\n !boxEqualsRounded(this.targetLayout, newLayout);\n /*\n * Note: Disabled to fix relative animations always triggering new\n * layout animations. If this causes further issues, we can try\n * a different approach to detecting relative target changes.\n */\n // || hasRelativeLayoutChanged\n /**\n * If the layout hasn't seemed to have changed, it might be that the\n * element is visually in the same place in the document but its position\n * relative to its parent has indeed changed. So here we check for that.\n */\n const hasOnlyRelativeTargetChanged = !hasLayoutChanged && hasRelativeLayoutChanged;\n if (this.options.layoutRoot ||\n this.resumeFrom ||\n hasOnlyRelativeTargetChanged ||\n (hasLayoutChanged &&\n (hasTargetChanged || !this.currentAnimation))) {\n if (this.resumeFrom) {\n this.resumingFrom = this.resumeFrom;\n this.resumingFrom.resumingFrom = undefined;\n }\n const animationOptions = {\n ...getValueTransition(layoutTransition, \"layout\"),\n onPlay: onLayoutAnimationStart,\n onComplete: onLayoutAnimationComplete,\n };\n if (visualElement.shouldReduceMotion ||\n this.options.layoutRoot) {\n animationOptions.delay = 0;\n animationOptions.type = false;\n }\n this.startAnimation(animationOptions);\n /**\n * Set animation origin after starting animation to avoid layout jump\n * caused by stopping previous layout animation\n */\n this.setAnimationOrigin(delta, hasOnlyRelativeTargetChanged, animationOptions\n .path);\n }\n else {\n /**\n * If the layout hasn't changed and we have an animation that hasn't started yet,\n * finish it immediately. Otherwise it will be animating from a location\n * that was probably never committed to screen and look like a jumpy box.\n */\n if (!hasLayoutChanged) {\n finishAnimation(this);\n }\n if (this.isLead() && this.options.onExitComplete) {\n this.options.onExitComplete();\n }\n }\n this.targetLayout = newLayout;\n });\n }\n }\n unmount() {\n this.options.layoutId && this.willUpdate();\n this.root.nodes.remove(this);\n const stack = this.getStack();\n stack && stack.remove(this);\n this.parent && this.parent.children.delete(this);\n this.instance = undefined;\n this.eventHandlers.clear();\n cancelFrame(this.updateProjection);\n }\n // only on the root\n blockUpdate() {\n this.updateManuallyBlocked = true;\n }\n unblockUpdate() {\n this.updateManuallyBlocked = false;\n }\n isUpdateBlocked() {\n return this.updateManuallyBlocked || this.updateBlockedByResize;\n }\n isTreeAnimationBlocked() {\n return (this.isAnimationBlocked ||\n (this.parent && this.parent.isTreeAnimationBlocked()) ||\n false);\n }\n // Note: currently only running on root node\n startUpdate() {\n if (this.isUpdateBlocked())\n return;\n this.isUpdating = true;\n this.nodes && this.nodes.forEach(resetSkewAndRotation);\n this.animationId++;\n }\n getTransformTemplate() {\n const { visualElement } = this.options;\n return visualElement && visualElement.getProps().transformTemplate;\n }\n willUpdate(shouldNotifyListeners = true) {\n this.root.hasTreeAnimated = true;\n if (this.root.isUpdateBlocked()) {\n this.options.onExitComplete && this.options.onExitComplete();\n return;\n }\n /**\n * If we're running optimised appear animations then these must be\n * cancelled before measuring the DOM. This is so we can measure\n * the true layout of the element rather than the WAAPI animation\n * which will be unaffected by the resetSkewAndRotate step.\n *\n * Note: This is a DOM write. Worst case scenario is this is sandwiched\n * between other snapshot reads which will cause unnecessary style recalculations.\n * This has to happen here though, as we don't yet know which nodes will need\n * snapshots in startUpdate(), but we only want to cancel optimised animations\n * if a layout animation measurement is actually going to be affected by them.\n */\n if (window.MotionCancelOptimisedAnimation &&\n !this.hasCheckedOptimisedAppear) {\n cancelTreeOptimisedTransformAnimations(this);\n }\n !this.root.isUpdating && this.root.startUpdate();\n if (this.isLayoutDirty)\n return;\n this.isLayoutDirty = true;\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i];\n node.shouldResetTransform = true;\n /**\n * Percentage translates resolve against layoutBox dimensions,\n * so ancestors with them must be re-measured after transform reset.\n */\n if (typeof node.latestValues.x === \"string\" ||\n typeof node.latestValues.y === \"string\") {\n node.isLayoutDirty = true;\n }\n node.updateScroll(\"snapshot\");\n if (node.options.layoutRoot) {\n node.willUpdate(false);\n }\n }\n const { layoutId, layout } = this.options;\n if (layoutId === undefined && !layout)\n return;\n const transformTemplate = this.getTransformTemplate();\n this.prevTransformTemplateValue = transformTemplate\n ? transformTemplate(this.latestValues, \"\")\n : undefined;\n this.updateSnapshot();\n shouldNotifyListeners && this.notifyListeners(\"willUpdate\");\n }\n update() {\n this.updateScheduled = false;\n const updateWasBlocked = this.isUpdateBlocked();\n // When doing an instant transition, we skip the layout update,\n // but should still clean up the measurements so that the next\n // snapshot could be taken correctly.\n if (updateWasBlocked) {\n const wasBlockedByResize = this.updateBlockedByResize;\n this.unblockUpdate();\n this.updateBlockedByResize = false;\n this.clearAllSnapshots();\n /**\n * When blocked by resize, still measure layouts so\n * callbacks like onLayoutMeasure fire (e.g. Reorder).\n * Skip notifyLayoutUpdate to prevent animations.\n */\n if (wasBlockedByResize) {\n this.nodes.forEach(forceLayoutMeasure);\n }\n this.nodes.forEach(clearMeasurements);\n return;\n }\n /**\n * If this is a repeat of didUpdate then ignore the animation.\n */\n if (this.animationId <= this.animationCommitId) {\n this.nodes.forEach(clearIsLayoutDirty);\n return;\n }\n this.animationCommitId = this.animationId;\n if (!this.isUpdating) {\n this.nodes.forEach(clearIsLayoutDirty);\n }\n else {\n this.isUpdating = false;\n /**\n * Ensure animation-blocked nodes (e.g. during drag)\n * get measured even when memoized (willUpdate skipped).\n */\n this.nodes.forEach(ensureDraggedNodesSnapshotted);\n /**\n * Write\n */\n this.nodes.forEach(resetTransformStyle);\n /**\n * Read ==================\n */\n // Update layout measurements of updated children\n this.nodes.forEach(updateLayout);\n /**\n * Write\n */\n // Notify listeners that the layout is updated\n this.nodes.forEach(notifyLayoutUpdate);\n }\n this.clearAllSnapshots();\n /**\n * Manually flush any pending updates. Ideally\n * we could leave this to the following requestAnimationFrame but this seems\n * to leave a flash of incorrectly styled content.\n */\n const now = time.now();\n frameData.delta = clamp(0, 1000 / 60, now - frameData.timestamp);\n frameData.timestamp = now;\n frameData.isProcessing = true;\n frameSteps.update.process(frameData);\n frameSteps.preRender.process(frameData);\n frameSteps.render.process(frameData);\n frameData.isProcessing = false;\n }\n didUpdate() {\n if (!this.updateScheduled) {\n this.updateScheduled = true;\n microtask.read(this.scheduleUpdate);\n }\n }\n clearAllSnapshots() {\n this.nodes.forEach(clearSnapshot);\n this.sharedNodes.forEach(removeLeadSnapshots);\n }\n scheduleUpdateProjection() {\n if (!this.projectionUpdateScheduled) {\n this.projectionUpdateScheduled = true;\n frame.preRender(this.updateProjection, false, true);\n }\n }\n scheduleCheckAfterUnmount() {\n /**\n * If the unmounting node is in a layoutGroup and did trigger a willUpdate,\n * we manually call didUpdate to give a chance to the siblings to animate.\n * Otherwise, cleanup all snapshots to prevents future nodes from reusing them.\n */\n frame.postRender(() => {\n if (this.isLayoutDirty) {\n this.root.didUpdate();\n }\n else {\n this.root.checkUpdateFailed();\n }\n });\n }\n /**\n * Update measurements\n */\n updateSnapshot() {\n if (this.snapshot || !this.instance)\n return;\n this.snapshot = this.measure();\n if (this.snapshot &&\n !calcLength(this.snapshot.measuredBox.x) &&\n !calcLength(this.snapshot.measuredBox.y)) {\n this.snapshot = undefined;\n }\n }\n updateLayout() {\n if (!this.instance)\n return;\n this.updateScroll();\n if (!(this.options.alwaysMeasureLayout && this.isLead()) &&\n !this.isLayoutDirty) {\n return;\n }\n /**\n * When a node is mounted, it simply resumes from the prevLead's\n * snapshot instead of taking a new one, but the ancestors scroll\n * might have updated while the prevLead is unmounted. We need to\n * update the scroll again to make sure the layout we measure is\n * up to date.\n */\n if (this.resumeFrom && !this.resumeFrom.instance) {\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i];\n node.updateScroll();\n }\n }\n const prevLayout = this.layout;\n this.layout = this.measure(false);\n this.layoutVersion++;\n if (!this.layoutCorrected)\n this.layoutCorrected = createBox();\n this.isLayoutDirty = false;\n this.projectionDelta = undefined;\n this.notifyListeners(\"measure\", this.layout.layoutBox);\n const { visualElement } = this.options;\n visualElement &&\n visualElement.notify(\"LayoutMeasure\", this.layout.layoutBox, prevLayout ? prevLayout.layoutBox : undefined);\n }\n updateScroll(phase = \"measure\") {\n let needsMeasurement = Boolean(this.options.layoutScroll && this.instance);\n if (this.scroll &&\n this.scroll.animationId === this.root.animationId &&\n this.scroll.phase === phase) {\n needsMeasurement = false;\n }\n if (needsMeasurement && this.instance) {\n const isRoot = checkIsScrollRoot(this.instance);\n this.scroll = {\n animationId: this.root.animationId,\n phase,\n isRoot,\n offset: measureScroll(this.instance),\n wasRoot: this.scroll ? this.scroll.isRoot : isRoot,\n };\n }\n }\n resetTransform() {\n if (!resetTransform)\n return;\n const isResetRequested = this.isLayoutDirty ||\n this.shouldResetTransform ||\n this.options.alwaysMeasureLayout;\n const hasProjection = this.projectionDelta && !isDeltaZero(this.projectionDelta);\n const transformTemplate = this.getTransformTemplate();\n const transformTemplateValue = transformTemplate\n ? transformTemplate(this.latestValues, \"\")\n : undefined;\n const transformTemplateHasChanged = transformTemplateValue !== this.prevTransformTemplateValue;\n if (isResetRequested &&\n this.instance &&\n (hasProjection ||\n hasTransform(this.latestValues) ||\n transformTemplateHasChanged)) {\n resetTransform(this.instance, transformTemplateValue);\n this.shouldResetTransform = false;\n this.scheduleRender();\n }\n }\n measure(removeTransform = true) {\n const pageBox = this.measurePageBox();\n let layoutBox = this.removeElementScroll(pageBox);\n /**\n * Measurements taken during the pre-render stage\n * still have transforms applied so we remove them\n * via calculation.\n */\n if (removeTransform) {\n layoutBox = this.removeTransform(layoutBox);\n }\n roundBox(layoutBox);\n return {\n animationId: this.root.animationId,\n measuredBox: pageBox,\n layoutBox,\n latestValues: {},\n source: this.id,\n };\n }\n measurePageBox() {\n const { visualElement } = this.options;\n if (!visualElement)\n return createBox();\n const box = visualElement.measureViewportBox();\n const wasInScrollRoot = this.scroll?.wasRoot || this.path.some(checkNodeWasScrollRoot);\n if (!wasInScrollRoot) {\n // Remove viewport scroll to give page-relative coordinates\n const { scroll } = this.root;\n if (scroll) {\n translateAxis(box.x, scroll.offset.x);\n translateAxis(box.y, scroll.offset.y);\n }\n }\n return box;\n }\n removeElementScroll(box) {\n const boxWithoutScroll = createBox();\n copyBoxInto(boxWithoutScroll, box);\n if (this.scroll?.wasRoot) {\n return boxWithoutScroll;\n }\n /**\n * Performance TODO: Keep a cumulative scroll offset down the tree\n * rather than loop back up the path.\n */\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i];\n const { scroll, options } = node;\n if (node !== this.root && scroll && options.layoutScroll) {\n /**\n * If this is a new scroll root, we want to remove all previous scrolls\n * from the viewport box.\n */\n if (scroll.wasRoot) {\n copyBoxInto(boxWithoutScroll, box);\n }\n translateAxis(boxWithoutScroll.x, scroll.offset.x);\n translateAxis(boxWithoutScroll.y, scroll.offset.y);\n }\n }\n return boxWithoutScroll;\n }\n applyTransform(box, transformOnly = false, output) {\n const withTransforms = output || createBox();\n copyBoxInto(withTransforms, box);\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i];\n if (!transformOnly &&\n node.options.layoutScroll &&\n node.scroll &&\n node !== node.root) {\n translateAxis(withTransforms.x, -node.scroll.offset.x);\n translateAxis(withTransforms.y, -node.scroll.offset.y);\n }\n if (!hasTransform(node.latestValues))\n continue;\n transformBox(withTransforms, node.latestValues, node.layout?.layoutBox);\n }\n if (hasTransform(this.latestValues)) {\n transformBox(withTransforms, this.latestValues, this.layout?.layoutBox);\n }\n return withTransforms;\n }\n removeTransform(box) {\n const boxWithoutTransform = createBox();\n copyBoxInto(boxWithoutTransform, box);\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i];\n if (!hasTransform(node.latestValues))\n continue;\n let sourceBox;\n if (node.instance) {\n hasScale(node.latestValues) && node.updateSnapshot();\n sourceBox = createBox();\n copyBoxInto(sourceBox, node.measurePageBox());\n }\n removeBoxTransforms(boxWithoutTransform, node.latestValues, node.snapshot?.layoutBox, sourceBox);\n }\n if (hasTransform(this.latestValues)) {\n removeBoxTransforms(boxWithoutTransform, this.latestValues);\n }\n return boxWithoutTransform;\n }\n setTargetDelta(delta) {\n this.targetDelta = delta;\n this.root.scheduleUpdateProjection();\n this.isProjectionDirty = true;\n }\n setOptions(options) {\n this.options = {\n ...this.options,\n ...options,\n crossfade: options.crossfade !== undefined ? options.crossfade : true,\n };\n }\n clearMeasurements() {\n this.scroll = undefined;\n this.layout = undefined;\n this.snapshot = undefined;\n this.prevTransformTemplateValue = undefined;\n this.targetDelta = undefined;\n this.target = undefined;\n this.isLayoutDirty = false;\n }\n forceRelativeParentToResolveTarget() {\n if (!this.relativeParent)\n return;\n /**\n * If the parent target isn't up-to-date, force it to update.\n * This is an unfortunate de-optimisation as it means any updating relative\n * projection will cause all the relative parents to recalculate back\n * up the tree.\n */\n if (this.relativeParent.resolvedRelativeTargetAt !==\n frameData.timestamp) {\n this.relativeParent.resolveTargetDelta(true);\n }\n }\n resolveTargetDelta(forceRecalculation = false) {\n /**\n * Once the dirty status of nodes has been spread through the tree, we also\n * need to check if we have a shared node of a different depth that has itself\n * been dirtied.\n */\n const lead = this.getLead();\n this.isProjectionDirty || (this.isProjectionDirty = lead.isProjectionDirty);\n this.isTransformDirty || (this.isTransformDirty = lead.isTransformDirty);\n this.isSharedProjectionDirty || (this.isSharedProjectionDirty = lead.isSharedProjectionDirty);\n const isShared = Boolean(this.resumingFrom) || this !== lead;\n /**\n * We don't use transform for this step of processing so we don't\n * need to check whether any nodes have changed transform.\n */\n const canSkip = !(forceRecalculation ||\n (isShared && this.isSharedProjectionDirty) ||\n this.isProjectionDirty ||\n this.parent?.isProjectionDirty ||\n this.attemptToResolveRelativeTarget ||\n this.root.updateBlockedByResize);\n if (canSkip)\n return;\n const { layout, layoutId } = this.options;\n /**\n * If we have no layout, we can't perform projection, so early return\n */\n if (!this.layout || !(layout || layoutId))\n return;\n this.resolvedRelativeTargetAt = frameData.timestamp;\n const relativeParent = this.getClosestProjectingParent();\n if (relativeParent &&\n this.linkedParentVersion !== relativeParent.layoutVersion &&\n !relativeParent.options.layoutRoot) {\n this.removeRelativeTarget();\n }\n /**\n * If we don't have a targetDelta but do have a layout, we can attempt to resolve\n * a relativeParent. This will allow a component to perform scale correction\n * even if no animation has started.\n */\n if (!this.targetDelta && !this.relativeTarget) {\n if (this.options.layoutAnchor !== false &&\n relativeParent &&\n relativeParent.layout) {\n this.createRelativeTarget(relativeParent, this.layout.layoutBox, relativeParent.layout.layoutBox);\n }\n else {\n this.removeRelativeTarget();\n }\n }\n /**\n * If we have no relative target or no target delta our target isn't valid\n * for this frame.\n */\n if (!this.relativeTarget && !this.targetDelta)\n return;\n /**\n * Lazy-init target data structure\n */\n if (!this.target) {\n this.target = createBox();\n this.targetWithTransforms = createBox();\n }\n /**\n * If we've got a relative box for this component, resolve it into a target relative to the parent.\n */\n if (this.relativeTarget &&\n this.relativeTargetOrigin &&\n this.relativeParent &&\n this.relativeParent.target) {\n this.forceRelativeParentToResolveTarget();\n calcRelativeBox(this.target, this.relativeTarget, this.relativeParent.target, this.options.layoutAnchor || undefined);\n /**\n * If we've only got a targetDelta, resolve it into a target\n */\n }\n else if (this.targetDelta) {\n if (Boolean(this.resumingFrom)) {\n this.applyTransform(this.layout.layoutBox, false, this.target);\n }\n else {\n copyBoxInto(this.target, this.layout.layoutBox);\n }\n applyBoxDelta(this.target, this.targetDelta);\n }\n else {\n /**\n * If no target, use own layout as target\n */\n copyBoxInto(this.target, this.layout.layoutBox);\n }\n /**\n * If we've been told to attempt to resolve a relative target, do so.\n */\n if (this.attemptToResolveRelativeTarget) {\n this.attemptToResolveRelativeTarget = false;\n if (this.options.layoutAnchor !== false &&\n relativeParent &&\n Boolean(relativeParent.resumingFrom) ===\n Boolean(this.resumingFrom) &&\n !relativeParent.options.layoutScroll &&\n relativeParent.target &&\n this.animationProgress !== 1) {\n this.createRelativeTarget(relativeParent, this.target, relativeParent.target);\n }\n else {\n this.relativeParent = this.relativeTarget = undefined;\n }\n }\n /**\n * Increase debug counter for resolved target deltas\n */\n if (statsBuffer.value) {\n metrics.calculatedTargetDeltas++;\n }\n }\n getClosestProjectingParent() {\n if (!this.parent ||\n hasScale(this.parent.latestValues) ||\n has2DTranslate(this.parent.latestValues)) {\n return undefined;\n }\n if (this.parent.isProjecting()) {\n return this.parent;\n }\n else {\n return this.parent.getClosestProjectingParent();\n }\n }\n isProjecting() {\n return Boolean((this.relativeTarget ||\n this.targetDelta ||\n this.options.layoutRoot) &&\n this.layout);\n }\n createRelativeTarget(relativeParent, layout, parentLayout) {\n this.relativeParent = relativeParent;\n this.linkedParentVersion = relativeParent.layoutVersion;\n this.forceRelativeParentToResolveTarget();\n this.relativeTarget = createBox();\n this.relativeTargetOrigin = createBox();\n calcRelativePosition(this.relativeTargetOrigin, layout, parentLayout, this.options.layoutAnchor || undefined);\n copyBoxInto(this.relativeTarget, this.relativeTargetOrigin);\n }\n removeRelativeTarget() {\n this.relativeParent = this.relativeTarget = undefined;\n }\n calcProjection() {\n const lead = this.getLead();\n const isShared = Boolean(this.resumingFrom) || this !== lead;\n let canSkip = true;\n /**\n * If this is a normal layout animation and neither this node nor its nearest projecting\n * is dirty then we can't skip.\n */\n if (this.isProjectionDirty || this.parent?.isProjectionDirty) {\n canSkip = false;\n }\n /**\n * If this is a shared layout animation and this node's shared projection is dirty then\n * we can't skip.\n */\n if (isShared &&\n (this.isSharedProjectionDirty || this.isTransformDirty)) {\n canSkip = false;\n }\n /**\n * If we have resolved the target this frame we must recalculate the\n * projection to ensure it visually represents the internal calculations.\n */\n if (this.resolvedRelativeTargetAt === frameData.timestamp) {\n canSkip = false;\n }\n if (canSkip)\n return;\n const { layout, layoutId } = this.options;\n /**\n * If this section of the tree isn't animating we can\n * delete our target sources for the following frame.\n */\n this.isTreeAnimating = Boolean((this.parent && this.parent.isTreeAnimating) ||\n this.currentAnimation ||\n this.pendingAnimation);\n if (!this.isTreeAnimating) {\n this.targetDelta = this.relativeTarget = undefined;\n }\n if (!this.layout || !(layout || layoutId))\n return;\n /**\n * Reset the corrected box with the latest values from box, as we're then going\n * to perform mutative operations on it.\n */\n copyBoxInto(this.layoutCorrected, this.layout.layoutBox);\n /**\n * Record previous tree scales before updating.\n */\n const prevTreeScaleX = this.treeScale.x;\n const prevTreeScaleY = this.treeScale.y;\n /**\n * Apply all the parent deltas to this box to produce the corrected box. This\n * is the layout box, as it will appear on screen as a result of the transforms of its parents.\n */\n applyTreeDeltas(this.layoutCorrected, this.treeScale, this.path, isShared);\n /**\n * If this layer needs to perform scale correction but doesn't have a target,\n * use the layout as the target.\n */\n if (lead.layout &&\n !lead.target &&\n (this.treeScale.x !== 1 || this.treeScale.y !== 1)) {\n lead.target = lead.layout.layoutBox;\n lead.targetWithTransforms = createBox();\n }\n const { target } = lead;\n if (!target) {\n /**\n * If we don't have a target to project into, but we were previously\n * projecting, we want to remove the stored transform and schedule\n * a render to ensure the elements reflect the removed transform.\n */\n if (this.prevProjectionDelta) {\n this.createProjectionDeltas();\n this.scheduleRender();\n }\n return;\n }\n if (!this.projectionDelta || !this.prevProjectionDelta) {\n this.createProjectionDeltas();\n }\n else {\n copyAxisDeltaInto(this.prevProjectionDelta.x, this.projectionDelta.x);\n copyAxisDeltaInto(this.prevProjectionDelta.y, this.projectionDelta.y);\n }\n /**\n * Update the delta between the corrected box and the target box before user-set transforms were applied.\n * This will allow us to calculate the corrected borderRadius and boxShadow to compensate\n * for our layout reprojection, but still allow them to be scaled correctly by the user.\n * It might be that to simplify this we may want to accept that user-set scale is also corrected\n * and we wouldn't have to keep and calc both deltas, OR we could support a user setting\n * to allow people to choose whether these styles are corrected based on just the\n * layout reprojection or the final bounding box.\n */\n calcBoxDelta(this.projectionDelta, this.layoutCorrected, target, this.latestValues);\n if (this.treeScale.x !== prevTreeScaleX ||\n this.treeScale.y !== prevTreeScaleY ||\n !axisDeltaEquals(this.projectionDelta.x, this.prevProjectionDelta.x) ||\n !axisDeltaEquals(this.projectionDelta.y, this.prevProjectionDelta.y)) {\n this.hasProjected = true;\n this.scheduleRender();\n this.notifyListeners(\"projectionUpdate\", target);\n }\n /**\n * Increase debug counter for recalculated projections\n */\n if (statsBuffer.value) {\n metrics.calculatedProjections++;\n }\n }\n hide() {\n this.isVisible = false;\n // TODO: Schedule render\n }\n show() {\n this.isVisible = true;\n // TODO: Schedule render\n }\n scheduleRender(notifyAll = true) {\n this.options.visualElement?.scheduleRender();\n if (notifyAll) {\n const stack = this.getStack();\n stack && stack.scheduleRender();\n }\n if (this.resumingFrom && !this.resumingFrom.instance) {\n this.resumingFrom = undefined;\n }\n }\n createProjectionDeltas() {\n this.prevProjectionDelta = createDelta();\n this.projectionDelta = createDelta();\n this.projectionDeltaWithTransform = createDelta();\n }\n setAnimationOrigin(delta, hasOnlyRelativeTargetChanged = false, pathFn) {\n const snapshot = this.snapshot;\n const snapshotLatestValues = snapshot ? snapshot.latestValues : {};\n const mixedValues = { ...this.latestValues };\n const targetDelta = createDelta();\n if (!this.relativeParent ||\n !this.relativeParent.options.layoutRoot) {\n this.relativeTarget = this.relativeTargetOrigin = undefined;\n }\n this.attemptToResolveRelativeTarget = !hasOnlyRelativeTargetChanged;\n const relativeLayout = createBox();\n const snapshotSource = snapshot ? snapshot.source : undefined;\n const layoutSource = this.layout ? this.layout.source : undefined;\n const isSharedLayoutAnimation = snapshotSource !== layoutSource;\n const stack = this.getStack();\n const isOnlyMember = !stack || stack.members.length <= 1;\n const shouldCrossfadeOpacity = Boolean(isSharedLayoutAnimation &&\n !isOnlyMember &&\n this.options.crossfade === true &&\n !this.path.some(hasOpacityCrossfade));\n this.animationProgress = 0;\n let prevRelativeTarget;\n // The path decides whether the layout shift is worth curving\n // (distance floor) and resolves the interpolator from the delta.\n const interpolate = pathFn?.interpolateProjection(delta);\n this.mixTargetDelta = (latest) => {\n const progress = latest / 1000;\n const point = interpolate?.(progress);\n if (point) {\n targetDelta.x.translate = point.x;\n targetDelta.x.scale = mixNumber(delta.x.scale, 1, progress);\n targetDelta.x.origin = delta.x.origin;\n targetDelta.x.originPoint = delta.x.originPoint;\n targetDelta.y.translate = point.y;\n targetDelta.y.scale = mixNumber(delta.y.scale, 1, progress);\n targetDelta.y.origin = delta.y.origin;\n targetDelta.y.originPoint = delta.y.originPoint;\n }\n else {\n mixAxisDeltaLinear(targetDelta.x, delta.x, progress);\n mixAxisDeltaLinear(targetDelta.y, delta.y, progress);\n }\n this.setTargetDelta(targetDelta);\n if (this.relativeTarget &&\n this.relativeTargetOrigin &&\n this.layout &&\n this.relativeParent &&\n this.relativeParent.layout) {\n calcRelativePosition(relativeLayout, this.layout.layoutBox, this.relativeParent.layout.layoutBox, this.options.layoutAnchor || undefined);\n mixBox(this.relativeTarget, this.relativeTargetOrigin, relativeLayout, progress);\n /**\n * If this is an unchanged relative target we can consider the\n * projection not dirty.\n */\n if (prevRelativeTarget &&\n boxEquals(this.relativeTarget, prevRelativeTarget)) {\n this.isProjectionDirty = false;\n }\n if (!prevRelativeTarget)\n prevRelativeTarget = createBox();\n copyBoxInto(prevRelativeTarget, this.relativeTarget);\n }\n if (isSharedLayoutAnimation) {\n this.animationValues = mixedValues;\n mixValues(mixedValues, snapshotLatestValues, this.latestValues, progress, shouldCrossfadeOpacity, isOnlyMember);\n }\n if (point && point.rotate !== undefined) {\n // Dedicated `pathRotation` channel, not `rotate`, so an\n // animating `rotate` is composed with, never clobbered.\n if (!this.animationValues)\n this.animationValues = mixedValues;\n this.animationValues.pathRotation = point.rotate;\n }\n this.root.scheduleUpdateProjection();\n this.scheduleRender();\n this.animationProgress = progress;\n };\n this.mixTargetDelta(this.options.layoutRoot ? 1000 : 0);\n }\n startAnimation(options) {\n this.notifyListeners(\"animationStart\");\n this.currentAnimation?.stop();\n this.resumingFrom?.currentAnimation?.stop();\n if (this.pendingAnimation) {\n cancelFrame(this.pendingAnimation);\n this.pendingAnimation = undefined;\n }\n /**\n * Start the animation in the next frame to have a frame with progress 0,\n * where the target is the same as when the animation started, so we can\n * calculate the relative positions correctly for instant transitions.\n */\n this.pendingAnimation = frame.update(() => {\n globalProjectionState.hasAnimatedSinceResize = true;\n this.motionValue || (this.motionValue = motionValue(0));\n this.motionValue.jump(0, false);\n this.currentAnimation = animateSingleValue(this.motionValue, [0, 1000], {\n ...options,\n velocity: 0,\n isSync: true,\n onUpdate: (latest) => {\n this.mixTargetDelta(latest);\n options.onUpdate && options.onUpdate(latest);\n },\n onComplete: () => {\n options.onComplete && options.onComplete();\n this.completeAnimation();\n },\n });\n if (this.resumingFrom) {\n this.resumingFrom.currentAnimation = this.currentAnimation;\n }\n this.pendingAnimation = undefined;\n });\n }\n completeAnimation() {\n if (this.resumingFrom) {\n this.resumingFrom.currentAnimation = undefined;\n this.resumingFrom.preserveOpacity = undefined;\n }\n const stack = this.getStack();\n stack && stack.exitAnimationComplete();\n this.resumingFrom =\n this.currentAnimation =\n this.animationValues =\n undefined;\n this.notifyListeners(\"animationComplete\");\n }\n finishAnimation() {\n if (this.currentAnimation) {\n this.mixTargetDelta && this.mixTargetDelta(animationTarget);\n this.currentAnimation.stop();\n }\n this.completeAnimation();\n }\n applyTransformsToTarget() {\n const lead = this.getLead();\n let { targetWithTransforms, target, layout, latestValues } = lead;\n if (!targetWithTransforms || !target || !layout)\n return;\n /**\n * If we're only animating position, and this element isn't the lead element,\n * then instead of projecting into the lead box we instead want to calculate\n * a new target that aligns the two boxes but maintains the layout shape.\n */\n if (this !== lead &&\n this.layout &&\n layout &&\n shouldAnimatePositionOnly(this.options.animationType, this.layout.layoutBox, layout.layoutBox)) {\n target = this.target || createBox();\n const xLength = calcLength(this.layout.layoutBox.x);\n target.x.min = lead.target.x.min;\n target.x.max = target.x.min + xLength;\n const yLength = calcLength(this.layout.layoutBox.y);\n target.y.min = lead.target.y.min;\n target.y.max = target.y.min + yLength;\n }\n copyBoxInto(targetWithTransforms, target);\n /**\n * Apply the latest user-set transforms to the targetBox to produce the targetBoxFinal.\n * This is the final box that we will then project into by calculating a transform delta and\n * applying it to the corrected box.\n */\n transformBox(targetWithTransforms, latestValues);\n /**\n * Update the delta between the corrected box and the final target box, after\n * user-set transforms are applied to it. This will be used by the renderer to\n * create a transform style that will reproject the element from its layout layout\n * into the desired bounding box.\n */\n calcBoxDelta(this.projectionDeltaWithTransform, this.layoutCorrected, targetWithTransforms, latestValues);\n }\n registerSharedNode(layoutId, node) {\n if (!this.sharedNodes.has(layoutId)) {\n this.sharedNodes.set(layoutId, new NodeStack());\n }\n const stack = this.sharedNodes.get(layoutId);\n stack.add(node);\n const config = node.options.initialPromotionConfig;\n node.promote({\n transition: config ? config.transition : undefined,\n preserveFollowOpacity: config && config.shouldPreserveFollowOpacity\n ? config.shouldPreserveFollowOpacity(node)\n : undefined,\n });\n }\n isLead() {\n const stack = this.getStack();\n return stack ? stack.lead === this : true;\n }\n getLead() {\n const { layoutId } = this.options;\n return layoutId ? this.getStack()?.lead || this : this;\n }\n getPrevLead() {\n const { layoutId } = this.options;\n return layoutId ? this.getStack()?.prevLead : undefined;\n }\n getStack() {\n const { layoutId } = this.options;\n if (layoutId)\n return this.root.sharedNodes.get(layoutId);\n }\n promote({ needsReset, transition, preserveFollowOpacity, } = {}) {\n const stack = this.getStack();\n if (stack)\n stack.promote(this, preserveFollowOpacity);\n if (needsReset) {\n this.projectionDelta = undefined;\n this.needsReset = true;\n }\n if (transition)\n this.setOptions({ transition });\n }\n relegate() {\n const stack = this.getStack();\n if (stack) {\n return stack.relegate(this);\n }\n else {\n return false;\n }\n }\n resetSkewAndRotation() {\n const { visualElement } = this.options;\n if (!visualElement)\n return;\n // If there's no detected skew or rotation values, we can early return without a forced render.\n let hasDistortingTransform = false;\n /**\n * An unrolled check for rotation values. Most elements don't have any rotation and\n * skipping the nested loop and new object creation is 50% faster.\n */\n const { latestValues } = visualElement;\n if (latestValues.z ||\n latestValues.rotate ||\n latestValues.rotateX ||\n latestValues.rotateY ||\n latestValues.rotateZ ||\n latestValues.skewX ||\n latestValues.skewY) {\n hasDistortingTransform = true;\n }\n // If there's no distorting values, we don't need to do any more.\n if (!hasDistortingTransform)\n return;\n const resetValues = {};\n if (latestValues.z) {\n resetDistortingTransform(\"z\", visualElement, resetValues, this.animationValues);\n }\n // Check the skew and rotate value of all axes and reset to 0\n for (let i = 0; i < transformAxes.length; i++) {\n resetDistortingTransform(`rotate${transformAxes[i]}`, visualElement, resetValues, this.animationValues);\n resetDistortingTransform(`skew${transformAxes[i]}`, visualElement, resetValues, this.animationValues);\n }\n // Force a render of this element to apply the transform with all skews and rotations\n // set to 0.\n visualElement.render();\n // Put back all the values we reset\n for (const key in resetValues) {\n visualElement.setStaticValue(key, resetValues[key]);\n if (this.animationValues) {\n this.animationValues[key] = resetValues[key];\n }\n }\n // Schedule a render for the next frame. This ensures we won't visually\n // see the element with the reset rotate value applied.\n visualElement.scheduleRender();\n }\n applyProjectionStyles(targetStyle, // CSSStyleDeclaration - doesn't allow numbers to be assigned to properties\n styleProp) {\n if (!this.instance || this.isSVG)\n return;\n if (!this.isVisible) {\n targetStyle.visibility = \"hidden\";\n return;\n }\n const transformTemplate = this.getTransformTemplate();\n if (this.needsReset) {\n this.needsReset = false;\n targetStyle.visibility = \"\";\n targetStyle.opacity = \"\";\n targetStyle.pointerEvents =\n resolveMotionValue(styleProp?.pointerEvents) || \"\";\n targetStyle.transform = transformTemplate\n ? transformTemplate(this.latestValues, \"\")\n : \"none\";\n return;\n }\n const lead = this.getLead();\n if (!this.projectionDelta || !this.layout || !lead.target) {\n if (this.options.layoutId) {\n targetStyle.opacity =\n this.latestValues.opacity !== undefined\n ? this.latestValues.opacity\n : 1;\n targetStyle.pointerEvents =\n resolveMotionValue(styleProp?.pointerEvents) || \"\";\n }\n if (this.hasProjected && !hasTransform(this.latestValues)) {\n targetStyle.transform = transformTemplate\n ? transformTemplate({}, \"\")\n : \"none\";\n this.hasProjected = false;\n }\n return;\n }\n targetStyle.visibility = \"\";\n const valuesToRender = lead.animationValues || lead.latestValues;\n this.applyTransformsToTarget();\n let transform = buildProjectionTransform(this.projectionDeltaWithTransform, this.treeScale, valuesToRender);\n if (transformTemplate) {\n transform = transformTemplate(valuesToRender, transform);\n }\n targetStyle.transform = transform;\n const { x, y } = this.projectionDelta;\n targetStyle.transformOrigin = `${x.origin * 100}% ${y.origin * 100}% 0`;\n if (lead.animationValues) {\n /**\n * If the lead component is animating, assign this either the entering/leaving\n * opacity\n */\n targetStyle.opacity =\n lead === this\n ? valuesToRender.opacity ??\n this.latestValues.opacity ??\n 1\n : this.preserveOpacity\n ? this.latestValues.opacity\n : valuesToRender.opacityExit;\n }\n else {\n /**\n * Or we're not animating at all, set the lead component to its layout\n * opacity and other components to hidden.\n */\n targetStyle.opacity =\n lead === this\n ? valuesToRender.opacity !== undefined\n ? valuesToRender.opacity\n : \"\"\n : valuesToRender.opacityExit !== undefined\n ? valuesToRender.opacityExit\n : 0;\n }\n /**\n * Apply scale correction\n */\n for (const key in scaleCorrectors) {\n if (valuesToRender[key] === undefined)\n continue;\n const { correct, applyTo, isCSSVariable } = scaleCorrectors[key];\n /**\n * Only apply scale correction to the value if we have an\n * active projection transform. Otherwise these values become\n * vulnerable to distortion if the element changes size without\n * a corresponding layout animation.\n */\n const corrected = transform === \"none\"\n ? valuesToRender[key]\n : correct(valuesToRender[key], lead);\n if (applyTo) {\n const num = applyTo.length;\n for (let i = 0; i < num; i++) {\n targetStyle[applyTo[i]] = corrected;\n }\n }\n else {\n // If this is a CSS variable, set it directly on the instance.\n // Replacing this function from creating styles to setting them\n // would be a good place to remove per frame object creation\n if (isCSSVariable) {\n this.options.visualElement.renderState.vars[key] = corrected;\n }\n else {\n targetStyle[key] = corrected;\n }\n }\n }\n /**\n * Disable pointer events on follow components. This is to ensure\n * that if a follow component covers a lead component it doesn't block\n * pointer events on the lead.\n */\n if (this.options.layoutId) {\n targetStyle.pointerEvents =\n lead === this\n ? resolveMotionValue(styleProp?.pointerEvents) || \"\"\n : \"none\";\n }\n }\n clearSnapshot() {\n this.resumeFrom = this.snapshot = undefined;\n }\n // Only run on root\n resetTree() {\n this.root.nodes.forEach((node) => node.currentAnimation?.stop());\n this.root.nodes.forEach(clearMeasurements);\n this.root.sharedNodes.clear();\n }\n };\n}\nfunction updateLayout(node) {\n node.updateLayout();\n}\nfunction notifyLayoutUpdate(node) {\n const snapshot = node.resumeFrom?.snapshot || node.snapshot;\n if (node.isLead() &&\n node.layout &&\n snapshot &&\n node.hasListeners(\"didUpdate\")) {\n const { layoutBox: layout, measuredBox: measuredLayout } = node.layout;\n const { animationType } = node.options;\n const isShared = snapshot.source !== node.layout.source;\n // TODO Maybe we want to also resize the layout snapshot so we don't trigger\n // animations for instance if layout=\"size\" and an element has only changed position\n if (animationType === \"size\") {\n eachAxis((axis) => {\n const axisSnapshot = isShared\n ? snapshot.measuredBox[axis]\n : snapshot.layoutBox[axis];\n const length = calcLength(axisSnapshot);\n axisSnapshot.min = layout[axis].min;\n axisSnapshot.max = axisSnapshot.min + length;\n });\n }\n else if (animationType === \"x\" || animationType === \"y\") {\n const snapAxis = animationType === \"x\" ? \"y\" : \"x\";\n copyAxisInto(isShared\n ? snapshot.measuredBox[snapAxis]\n : snapshot.layoutBox[snapAxis], layout[snapAxis]);\n }\n else if (shouldAnimatePositionOnly(animationType, snapshot.layoutBox, layout)) {\n eachAxis((axis) => {\n const axisSnapshot = isShared\n ? snapshot.measuredBox[axis]\n : snapshot.layoutBox[axis];\n const length = calcLength(layout[axis]);\n axisSnapshot.max = axisSnapshot.min + length;\n /**\n * Ensure relative target gets resized and rerendererd\n */\n if (node.relativeTarget && !node.currentAnimation) {\n node.isProjectionDirty = true;\n node.relativeTarget[axis].max =\n node.relativeTarget[axis].min + length;\n }\n });\n }\n const layoutDelta = createDelta();\n calcBoxDelta(layoutDelta, layout, snapshot.layoutBox);\n const visualDelta = createDelta();\n if (isShared) {\n calcBoxDelta(visualDelta, node.applyTransform(measuredLayout, true), snapshot.measuredBox);\n }\n else {\n calcBoxDelta(visualDelta, layout, snapshot.layoutBox);\n }\n const hasLayoutChanged = !isDeltaZero(layoutDelta);\n let hasRelativeLayoutChanged = false;\n if (!node.resumeFrom) {\n const relativeParent = node.getClosestProjectingParent();\n /**\n * If the relativeParent is itself resuming from a different element then\n * the relative snapshot is not relavent\n */\n if (relativeParent && !relativeParent.resumeFrom) {\n const { snapshot: parentSnapshot, layout: parentLayout } = relativeParent;\n if (parentSnapshot && parentLayout) {\n const anchor = node.options.layoutAnchor || undefined;\n const relativeSnapshot = createBox();\n calcRelativePosition(relativeSnapshot, snapshot.layoutBox, parentSnapshot.layoutBox, anchor);\n const relativeLayout = createBox();\n calcRelativePosition(relativeLayout, layout, parentLayout.layoutBox, anchor);\n if (!boxEqualsRounded(relativeSnapshot, relativeLayout)) {\n hasRelativeLayoutChanged = true;\n }\n if (relativeParent.options.layoutRoot) {\n node.relativeTarget = relativeLayout;\n node.relativeTargetOrigin = relativeSnapshot;\n node.relativeParent = relativeParent;\n }\n }\n }\n }\n node.notifyListeners(\"didUpdate\", {\n layout,\n snapshot,\n delta: visualDelta,\n layoutDelta,\n hasLayoutChanged,\n hasRelativeLayoutChanged,\n });\n }\n else if (node.isLead()) {\n const { onExitComplete } = node.options;\n onExitComplete && onExitComplete();\n }\n /**\n * Clearing transition\n * TODO: Investigate why this transition is being passed in as {type: false } from Framer\n * and why we need it at all\n */\n node.options.transition = undefined;\n}\nfunction propagateDirtyNodes(node) {\n /**\n * Increase debug counter for nodes encountered this frame\n */\n if (statsBuffer.value) {\n metrics.nodes++;\n }\n if (!node.parent)\n return;\n /**\n * If this node isn't projecting, propagate isProjectionDirty. It will have\n * no performance impact but it will allow the next child that *is* projecting\n * but *isn't* dirty to just check its parent to see if *any* ancestor needs\n * correcting.\n */\n if (!node.isProjecting()) {\n node.isProjectionDirty = node.parent.isProjectionDirty;\n }\n /**\n * Propagate isSharedProjectionDirty and isTransformDirty\n * throughout the whole tree. A future revision can take another look at\n * this but for safety we still recalcualte shared nodes.\n */\n node.isSharedProjectionDirty || (node.isSharedProjectionDirty = Boolean(node.isProjectionDirty ||\n node.parent.isProjectionDirty ||\n node.parent.isSharedProjectionDirty));\n node.isTransformDirty || (node.isTransformDirty = node.parent.isTransformDirty);\n}\nfunction cleanDirtyNodes(node) {\n node.isProjectionDirty =\n node.isSharedProjectionDirty =\n node.isTransformDirty =\n false;\n}\nfunction clearSnapshot(node) {\n node.clearSnapshot();\n}\nfunction clearMeasurements(node) {\n node.clearMeasurements();\n}\nfunction forceLayoutMeasure(node) {\n node.isLayoutDirty = true;\n node.updateLayout();\n}\nfunction clearIsLayoutDirty(node) {\n node.isLayoutDirty = false;\n}\n/**\n * When a node is animation-blocked (e.g. during drag) and its component\n * didn't re-render (memoized), willUpdate() is never called so there's\n * no snapshot. Use the previous layout as a snapshot and mark dirty so\n * resetTransform/updateLayout/notifyLayoutUpdate process it normally.\n */\nfunction ensureDraggedNodesSnapshotted(node) {\n if (node.isAnimationBlocked && node.layout && !node.isLayoutDirty) {\n node.snapshot = node.layout;\n node.isLayoutDirty = true;\n }\n}\nfunction resetTransformStyle(node) {\n const { visualElement } = node.options;\n if (visualElement && visualElement.getProps().onBeforeLayoutMeasure) {\n visualElement.notify(\"BeforeLayoutMeasure\");\n }\n node.resetTransform();\n}\nfunction finishAnimation(node) {\n node.finishAnimation();\n node.targetDelta = node.relativeTarget = node.target = undefined;\n node.isProjectionDirty = true;\n}\nfunction resolveTargetDelta(node) {\n node.resolveTargetDelta();\n}\nfunction calcProjection(node) {\n node.calcProjection();\n}\nfunction resetSkewAndRotation(node) {\n node.resetSkewAndRotation();\n}\nfunction removeLeadSnapshots(stack) {\n stack.removeLeadSnapshot();\n}\nfunction mixAxisDeltaLinear(output, delta, p) {\n output.translate = mixNumber(delta.translate, 0, p);\n output.scale = mixNumber(delta.scale, 1, p);\n output.origin = delta.origin;\n output.originPoint = delta.originPoint;\n}\nfunction mixAxis(output, from, to, p) {\n output.min = mixNumber(from.min, to.min, p);\n output.max = mixNumber(from.max, to.max, p);\n}\nfunction mixBox(output, from, to, p) {\n mixAxis(output.x, from.x, to.x, p);\n mixAxis(output.y, from.y, to.y, p);\n}\nfunction hasOpacityCrossfade(node) {\n return (node.animationValues && node.animationValues.opacityExit !== undefined);\n}\nconst defaultLayoutTransition = {\n duration: 0.45,\n ease: [0.4, 0, 0.1, 1],\n};\nconst userAgentContains = (string) => typeof navigator !== \"undefined\" &&\n navigator.userAgent &&\n navigator.userAgent.toLowerCase().includes(string);\n/**\n * Measured bounding boxes must be rounded in Safari and\n * left untouched in Chrome, otherwise non-integer layouts within scaled-up elements\n * can appear to jump.\n */\nconst roundPoint = userAgentContains(\"applewebkit/\") && !userAgentContains(\"chrome/\")\n ? Math.round\n : noop;\nfunction roundAxis(axis) {\n // Round to the nearest .5 pixels to support subpixel layouts\n axis.min = roundPoint(axis.min);\n axis.max = roundPoint(axis.max);\n}\nfunction roundBox(box) {\n roundAxis(box.x);\n roundAxis(box.y);\n}\nfunction shouldAnimatePositionOnly(animationType, snapshot, layout) {\n return (animationType === \"position\" ||\n (animationType === \"preserve-aspect\" &&\n !isNear(aspectRatio(snapshot), aspectRatio(layout), 0.2)));\n}\nfunction checkNodeWasScrollRoot(node) {\n return node !== node.root && node.scroll?.wasRoot;\n}\n\nexport { cleanDirtyNodes, createProjectionNode, mixAxis, mixBox, propagateDirtyNodes };\n//# sourceMappingURL=create-projection-node.mjs.map\n","import { isSVGElement } from './is-svg-element.mjs';\n\n/**\n * Checks if an element is specifically an SVGSVGElement (the root SVG element)\n * in a way that works across iframes\n */\nfunction isSVGSVGElement(element) {\n return isSVGElement(element) && element.tagName === \"svg\";\n}\n\nexport { isSVGSVGElement };\n//# sourceMappingURL=is-svg-svg-element.mjs.map\n","import { time } from '../frameloop/sync-time.mjs';\nimport { secondsToMilliseconds } from 'motion-utils';\nimport { frame, cancelFrame } from '../frameloop/frame.mjs';\n\n/**\n * Timeout defined in ms\n */\nfunction delay(callback, timeout) {\n const start = time.now();\n const checkElapsed = ({ timestamp }) => {\n const elapsed = timestamp - start;\n if (elapsed >= timeout) {\n cancelFrame(checkElapsed);\n callback(elapsed - timeout);\n }\n };\n frame.setup(checkElapsed, true);\n return () => cancelFrame(checkElapsed);\n}\nfunction delayInSeconds(callback, timeout) {\n return delay(callback, secondsToMilliseconds(timeout));\n}\n\nexport { delay, delayInSeconds };\n//# sourceMappingURL=delay.mjs.map\n","import { animateMotionValue } from '../interfaces/motion-value.mjs';\nimport { motionValue } from '../../value/index.mjs';\nimport { isMotionValue } from '../../value/utils/is-motion-value.mjs';\n\nfunction animateSingleValue(value, keyframes, options) {\n const motionValue$1 = isMotionValue(value) ? value : motionValue(value);\n motionValue$1.start(animateMotionValue(\"\", motionValue$1, keyframes, options));\n return motionValue$1.animation;\n}\n\nexport { animateSingleValue };\n//# sourceMappingURL=single-value.mjs.map\n","function buildProjectionTransform(delta, treeScale, latestTransform) {\n let transform = \"\";\n /**\n * The translations we use to calculate are always relative to the viewport coordinate space.\n * But when we apply scales, we also scale the coordinate space of an element and its children.\n * For instance if we have a treeScale (the culmination of all parent scales) of 0.5 and we need\n * to move an element 100 pixels, we actually need to move it 200 in within that scaled space.\n */\n const xTranslate = delta.x.translate / treeScale.x;\n const yTranslate = delta.y.translate / treeScale.y;\n const zTranslate = latestTransform?.z || 0;\n if (xTranslate || yTranslate || zTranslate) {\n transform = `translate3d(${xTranslate}px, ${yTranslate}px, ${zTranslate}px) `;\n }\n /**\n * Apply scale correction for the tree transform.\n * This will apply scale to the screen-orientated axes.\n */\n if (treeScale.x !== 1 || treeScale.y !== 1) {\n transform += `scale(${1 / treeScale.x}, ${1 / treeScale.y}) `;\n }\n if (latestTransform) {\n const { transformPerspective, rotate, pathRotation, rotateX, rotateY, skewX, skewY, } = latestTransform;\n if (transformPerspective)\n transform = `perspective(${transformPerspective}px) ${transform}`;\n if (rotate)\n transform += `rotate(${rotate}deg) `;\n // Additive `rotate()` so user `rotate` isn't clobbered.\n if (pathRotation)\n transform += `rotate(${pathRotation}deg) `;\n if (rotateX)\n transform += `rotateX(${rotateX}deg) `;\n if (rotateY)\n transform += `rotateY(${rotateY}deg) `;\n if (skewX)\n transform += `skewX(${skewX}deg) `;\n if (skewY)\n transform += `skewY(${skewY}deg) `;\n }\n /**\n * Apply scale to match the size of the element to the size we want it.\n * This will apply scale to the element-orientated axes.\n */\n const elementScaleX = delta.x.scale * treeScale.x;\n const elementScaleY = delta.y.scale * treeScale.y;\n if (elementScaleX !== 1 || elementScaleY !== 1) {\n transform += `scale(${elementScaleX}, ${elementScaleY})`;\n }\n return transform || \"none\";\n}\n\nexport { buildProjectionTransform };\n//# sourceMappingURL=transform.mjs.map\n","import { addDomEvent } from '../../events/add-dom-event.mjs';\nimport { createProjectionNode } from './create-projection-node.mjs';\n\nconst DocumentProjectionNode = createProjectionNode({\n attachResizeListener: (ref, notify) => addDomEvent(ref, \"resize\", notify),\n measureScroll: () => ({\n x: document.documentElement.scrollLeft || document.body?.scrollLeft || 0,\n y: document.documentElement.scrollTop || document.body?.scrollTop || 0,\n }),\n checkIsScrollRoot: () => true,\n});\n\nexport { DocumentProjectionNode };\n//# sourceMappingURL=DocumentProjectionNode.mjs.map\n","import { createProjectionNode } from './create-projection-node.mjs';\nimport { DocumentProjectionNode } from './DocumentProjectionNode.mjs';\n\nconst rootProjectionNode = {\n current: undefined,\n};\nconst HTMLProjectionNode = createProjectionNode({\n measureScroll: (instance) => ({\n x: instance.scrollLeft,\n y: instance.scrollTop,\n }),\n defaultParent: () => {\n if (!rootProjectionNode.current) {\n const documentNode = new DocumentProjectionNode({});\n documentNode.mount(window);\n documentNode.setOptions({ layoutScroll: true });\n rootProjectionNode.current = documentNode;\n }\n return rootProjectionNode.current;\n },\n resetTransform: (instance, value) => {\n instance.style.transform = value !== undefined ? value : \"none\";\n },\n checkIsScrollRoot: (instance) => Boolean(window.getComputedStyle(instance).position === \"fixed\"),\n});\n\nexport { HTMLProjectionNode, rootProjectionNode };\n//# sourceMappingURL=HTMLProjectionNode.mjs.map\n","\"use client\";\nimport { useContext, useMemo } from \"react\";\nimport { MotionContext } from \".\";\nimport { getCurrentTreeVariants } from \"./utils\";\nexport function useCreateMotionContext(props) {\n const { initial, animate } = getCurrentTreeVariants(props, useContext(MotionContext));\n return useMemo(() => ({ initial, animate }), [variantLabelsAsDependency(initial), variantLabelsAsDependency(animate)]);\n}\nfunction variantLabelsAsDependency(prop) {\n return Array.isArray(prop) ? prop.join(\" \") : prop;\n}\n//# sourceMappingURL=create.js.map","import { isControllingVariants, isVariantLabel } from \"motion-dom\";\nexport function getCurrentTreeVariants(props, context) {\n if (isControllingVariants(props)) {\n const { initial, animate } = props;\n return {\n initial: initial === false || isVariantLabel(initial)\n ? initial\n : undefined,\n animate: isVariantLabel(animate) ? animate : undefined,\n };\n }\n return props.inherit !== false ? context : {};\n}\n//# sourceMappingURL=utils.js.map","export const createHtmlRenderState = () => ({\n style: {},\n transform: {},\n transformOrigin: {},\n vars: {},\n});\n//# sourceMappingURL=create-render-state.js.map","\"use client\";\nimport { buildHTMLStyles, isForcedMotionValue, isMotionValue } from \"motion-dom\";\nimport { useMemo } from \"react\";\nimport { createHtmlRenderState } from \"./utils/create-render-state\";\nexport function copyRawValuesOnly(target, source, props) {\n for (const key in source) {\n if (!isMotionValue(source[key]) && !isForcedMotionValue(key, props)) {\n target[key] = source[key];\n }\n }\n}\nfunction useInitialMotionValues({ transformTemplate }, visualState) {\n return useMemo(() => {\n const state = createHtmlRenderState();\n buildHTMLStyles(state, visualState, transformTemplate);\n return Object.assign({}, state.vars, state.style);\n }, [visualState]);\n}\nfunction useStyle(props, visualState) {\n const styleProp = props.style || {};\n const style = {};\n /**\n * Copy non-Motion Values straight into style\n */\n copyRawValuesOnly(style, styleProp, props);\n Object.assign(style, useInitialMotionValues(props, visualState));\n return style;\n}\nexport function useHTMLProps(props, visualState) {\n // The `any` isn't ideal but it is the type of createElement props argument\n const htmlProps = {};\n const style = useStyle(props, visualState);\n if (props.drag && props.dragListener !== false) {\n // Disable the ghost element when a user drags\n htmlProps.draggable = false;\n // Disable text selection\n style.userSelect =\n style.WebkitUserSelect =\n style.WebkitTouchCallout =\n \"none\";\n // Disable scrolling on the draggable direction\n style.touchAction =\n props.drag === true\n ? \"none\"\n : `pan-${props.drag === \"x\" ? \"y\" : \"x\"}`;\n }\n if (props.tabIndex === undefined &&\n (props.onTap || props.onTapStart || props.whileTap)) {\n htmlProps.tabIndex = 0;\n }\n htmlProps.style = style;\n return htmlProps;\n}\n//# sourceMappingURL=use-props.js.map","import { createHtmlRenderState } from \"../../html/utils/create-render-state\";\nexport const createSvgRenderState = () => ({\n ...createHtmlRenderState(),\n attrs: {},\n});\n//# sourceMappingURL=create-render-state.js.map","\"use client\";\nimport { buildSVGAttrs, isSVGTag } from \"motion-dom\";\nimport { useMemo } from \"react\";\nimport { copyRawValuesOnly } from \"../html/use-props\";\nimport { createSvgRenderState } from \"./utils/create-render-state\";\nexport function useSVGProps(props, visualState, _isStatic, Component) {\n const visualProps = useMemo(() => {\n const state = createSvgRenderState();\n buildSVGAttrs(state, visualState, isSVGTag(Component), props.transformTemplate, props.style);\n return {\n ...state.attrs,\n style: { ...state.style },\n };\n }, [visualState]);\n if (props.style) {\n const rawStyles = {};\n copyRawValuesOnly(rawStyles, props.style, props);\n visualProps.style = { ...rawStyles, ...visualProps.style };\n }\n return visualProps;\n}\n//# sourceMappingURL=use-props.js.map","/**\n * A list of all valid MotionProps.\n *\n * @privateRemarks\n * This doesn't throw if a `MotionProp` name is missing - it should.\n */\nconst validMotionProps = new Set([\n \"animate\",\n \"exit\",\n \"variants\",\n \"initial\",\n \"style\",\n \"values\",\n \"variants\",\n \"transition\",\n \"transformTemplate\",\n \"custom\",\n \"inherit\",\n \"onBeforeLayoutMeasure\",\n \"onAnimationStart\",\n \"onAnimationComplete\",\n \"onUpdate\",\n \"onDragStart\",\n \"onDrag\",\n \"onDragEnd\",\n \"onMeasureDragConstraints\",\n \"onDirectionLock\",\n \"onDragTransitionEnd\",\n \"_dragX\",\n \"_dragY\",\n \"onHoverStart\",\n \"onHoverEnd\",\n \"onViewportEnter\",\n \"onViewportLeave\",\n \"globalTapTarget\",\n \"propagate\",\n \"ignoreStrict\",\n \"viewport\",\n]);\n/**\n * Check whether a prop name is a valid `MotionProp` key.\n *\n * @param key - Name of the property to check\n * @returns `true` is key is a valid `MotionProp`.\n *\n * @public\n */\nexport function isValidMotionProp(key) {\n return (key.startsWith(\"while\") ||\n (key.startsWith(\"drag\") && key !== \"draggable\") ||\n key.startsWith(\"layout\") ||\n key.startsWith(\"onTap\") ||\n key.startsWith(\"onPan\") ||\n key.startsWith(\"onLayout\") ||\n validMotionProps.has(key));\n}\n//# sourceMappingURL=valid-prop.js.map","import { isMotionValue } from \"motion-dom\";\nimport { isValidMotionProp } from \"../../../motion/utils/valid-prop\";\nfunction shouldForward(key, isValidProp) {\n return key.startsWith(\"on\")\n ? !isValidMotionProp(key)\n : isValidProp?.(key) ?? !isValidMotionProp(key);\n}\nexport function filterProps(props, isDom, forwardMotionProps, isValidProp) {\n const filteredProps = {};\n for (const key in props) {\n /**\n * values is considered a valid prop by Emotion, so if it's present\n * this will be rendered out to the DOM unless explicitly filtered.\n *\n * We check the type as it could be used with the `feColorMatrix`\n * element, which we support.\n */\n if (key === \"values\" && typeof props.values === \"object\")\n continue;\n if (isMotionValue(props[key]))\n continue;\n if (shouldForward(key, isValidProp) ||\n (forwardMotionProps === true && isValidMotionProp(key)) ||\n (!isDom && !isValidMotionProp(key)) ||\n // If trying to use native HTML drag events, forward drag listeners\n (props[\"draggable\"] &&\n key.startsWith(\"onDrag\"))) {\n filteredProps[key] =\n props[key];\n }\n }\n return filteredProps;\n}\n//# sourceMappingURL=filter-props.js.map","/**\n * We keep these listed separately as we use the lowercase tag names as part\n * of the runtime bundle to detect SVG components\n */\nexport const lowercaseSVGElements = [\n \"animate\",\n \"circle\",\n \"defs\",\n \"desc\",\n \"ellipse\",\n \"g\",\n \"image\",\n \"line\",\n \"filter\",\n \"marker\",\n \"mask\",\n \"metadata\",\n \"path\",\n \"pattern\",\n \"polygon\",\n \"polyline\",\n \"rect\",\n \"stop\",\n \"switch\",\n \"symbol\",\n \"svg\",\n \"text\",\n \"tspan\",\n \"use\",\n \"view\",\n];\n//# sourceMappingURL=lowercase-elements.js.map","import { lowercaseSVGElements } from \"../../svg/lowercase-elements\";\nexport function isSVGComponent(Component) {\n if (\n /**\n * If it's not a string, it's a custom React component. Currently we only support\n * HTML custom React components.\n */\n typeof Component !== \"string\" ||\n /**\n * If it contains a dash, the element is a custom HTML webcomponent.\n */\n Component.includes(\"-\")) {\n return false;\n }\n else if (\n /**\n * If it's in our list of lowercase SVG tags, it's an SVG component\n */\n lowercaseSVGElements.indexOf(Component) > -1 ||\n /**\n * If it contains a capital letter, it's an SVG component\n */\n /[A-Z]/u.test(Component)) {\n return true;\n }\n return false;\n}\n//# sourceMappingURL=is-svg-component.js.map","\"use client\";\nimport { isMotionValue } from \"motion-dom\";\nimport { Fragment, createElement, useMemo } from \"react\";\nimport { useHTMLProps } from \"../html/use-props\";\nimport { useSVGProps } from \"../svg/use-props\";\nimport { filterProps } from \"./utils/filter-props\";\nimport { isSVGComponent } from \"./utils/is-svg-component\";\nexport function useRender(Component, props, ref, { latestValues, }, isStatic, forwardMotionProps = false, isSVG, isValidProp) {\n const useVisualProps = (isSVG ?? isSVGComponent(Component)) ? useSVGProps : useHTMLProps;\n const visualProps = useVisualProps(props, latestValues, isStatic, Component);\n const filteredProps = filterProps(props, typeof Component === \"string\", forwardMotionProps, isValidProp);\n const elementProps = Component !== Fragment ? { ...filteredProps, ...visualProps, ref } : {};\n /**\n * If component has been handed a motion value as its child,\n * memoise its initial value and render that. Subsequent updates\n * will be handled by the onChange handler\n */\n const { children } = props;\n const renderedChildren = useMemo(() => (isMotionValue(children) ? children.get() : children), [children]);\n return createElement(Component, {\n ...elementProps,\n children: renderedChildren,\n });\n}\n//# sourceMappingURL=use-render.js.map","\"use client\";\nimport { createContext } from \"react\";\n/**\n * @public\n */\nexport const PresenceContext = \n/* @__PURE__ */ createContext(null);\n//# sourceMappingURL=PresenceContext.js.map","\"use client\";\nimport { isAnimationControls, isControllingVariants as checkIsControllingVariants, isVariantNode as checkIsVariantNode, resolveVariantFromProps, } from \"motion-dom\";\nimport { useContext } from \"react\";\nimport { MotionContext } from \"../../context/MotionContext\";\nimport { PresenceContext, } from \"../../context/PresenceContext\";\nimport { useConstant } from \"../../utils/use-constant\";\nimport { resolveMotionValue } from \"motion-dom\";\nfunction makeState({ scrapeMotionValuesFromProps, createRenderState, }, props, context, presenceContext) {\n const state = {\n latestValues: makeLatestValues(props, context, presenceContext, scrapeMotionValuesFromProps),\n renderState: createRenderState(),\n };\n return state;\n}\nfunction makeLatestValues(props, context, presenceContext, scrapeMotionValues) {\n const values = {};\n const motionValues = scrapeMotionValues(props, {});\n for (const key in motionValues) {\n values[key] = resolveMotionValue(motionValues[key]);\n }\n let { initial, animate } = props;\n const isControllingVariants = checkIsControllingVariants(props);\n const isVariantNode = checkIsVariantNode(props);\n if (context &&\n isVariantNode &&\n !isControllingVariants &&\n props.inherit !== false) {\n if (initial === undefined)\n initial = context.initial;\n if (animate === undefined)\n animate = context.animate;\n }\n let isInitialAnimationBlocked = presenceContext\n ? presenceContext.initial === false\n : false;\n isInitialAnimationBlocked = isInitialAnimationBlocked || initial === false;\n const variantToSet = isInitialAnimationBlocked ? animate : initial;\n if (variantToSet &&\n typeof variantToSet !== \"boolean\" &&\n !isAnimationControls(variantToSet)) {\n const list = Array.isArray(variantToSet) ? variantToSet : [variantToSet];\n for (let i = 0; i < list.length; i++) {\n const resolved = resolveVariantFromProps(props, list[i]);\n if (resolved) {\n const { transitionEnd, transition, ...target } = resolved;\n for (const key in target) {\n let valueTarget = target[key];\n if (Array.isArray(valueTarget)) {\n /**\n * Take final keyframe if the initial animation is blocked because\n * we want to initialise at the end of that blocked animation.\n */\n const index = isInitialAnimationBlocked\n ? valueTarget.length - 1\n : 0;\n valueTarget = valueTarget[index];\n }\n if (valueTarget !== null) {\n values[key] = valueTarget;\n }\n }\n for (const key in transitionEnd) {\n values[key] = transitionEnd[key];\n }\n }\n }\n }\n return values;\n}\nexport const makeUseVisualState = (config) => (props, isStatic) => {\n const context = useContext(MotionContext);\n const presenceContext = useContext(PresenceContext);\n const make = () => makeState(config, props, context, presenceContext);\n return isStatic ? make() : useConstant(make);\n};\n//# sourceMappingURL=use-visual-state.js.map","\"use client\";\nimport { useRef } from \"react\";\n/**\n * Creates a constant value over the lifecycle of a component.\n *\n * Even if `useMemo` is provided an empty array as its final argument, it doesn't offer\n * a guarantee that it won't re-run for performance reasons later on. By using `useConstant`\n * you can ensure that initialisers don't execute twice or more.\n */\nexport function useConstant(init) {\n const ref = useRef(null);\n if (ref.current === null) {\n ref.current = init();\n }\n return ref.current;\n}\n//# sourceMappingURL=use-constant.js.map","\"use client\";\nimport { scrapeHTMLMotionValuesFromProps } from \"motion-dom\";\nimport { makeUseVisualState } from \"../../motion/utils/use-visual-state\";\nimport { createHtmlRenderState } from \"./utils/create-render-state\";\nexport const useHTMLVisualState = /*@__PURE__*/ makeUseVisualState({\n scrapeMotionValuesFromProps: scrapeHTMLMotionValuesFromProps,\n createRenderState: createHtmlRenderState,\n});\n//# sourceMappingURL=use-html-visual-state.js.map","\"use client\";\nimport { scrapeSVGMotionValuesFromProps } from \"motion-dom\";\nimport { makeUseVisualState } from \"../../motion/utils/use-visual-state\";\nimport { createSvgRenderState } from \"./utils/create-render-state\";\nexport const useSVGVisualState = /*@__PURE__*/ makeUseVisualState({\n scrapeMotionValuesFromProps: scrapeSVGMotionValuesFromProps,\n createRenderState: createSvgRenderState,\n});\n//# sourceMappingURL=use-svg-visual-state.js.map","import { getFeatureDefinitions, setFeatureDefinitions } from \"motion-dom\";\nconst featureProps = {\n animation: [\n \"animate\",\n \"variants\",\n \"whileHover\",\n \"whileTap\",\n \"exit\",\n \"whileInView\",\n \"whileFocus\",\n \"whileDrag\",\n ],\n exit: [\"exit\"],\n drag: [\"drag\", \"dragControls\"],\n focus: [\"whileFocus\"],\n hover: [\"whileHover\", \"onHoverStart\", \"onHoverEnd\"],\n tap: [\"whileTap\", \"onTap\", \"onTapStart\", \"onTapCancel\"],\n pan: [\"onPan\", \"onPanStart\", \"onPanSessionStart\", \"onPanEnd\"],\n inView: [\"whileInView\", \"onViewportEnter\", \"onViewportLeave\"],\n layout: [\"layout\", \"layoutId\"],\n};\nlet isInitialized = false;\n/**\n * Initialize feature definitions with isEnabled checks.\n * This must be called before any motion components are rendered.\n */\nexport function initFeatureDefinitions() {\n if (isInitialized)\n return;\n const initialFeatureDefinitions = {};\n for (const key in featureProps) {\n initialFeatureDefinitions[key] = {\n isEnabled: (props) => featureProps[key].some((name) => !!props[name]),\n };\n }\n setFeatureDefinitions(initialFeatureDefinitions);\n isInitialized = true;\n}\n/**\n * Get the current feature definitions, initializing if needed.\n */\nexport function getInitializedFeatureDefinitions() {\n initFeatureDefinitions();\n return getFeatureDefinitions();\n}\n//# sourceMappingURL=definitions.js.map","export const motionComponentSymbol = Symbol.for(\"motionComponentSymbol\");\n//# sourceMappingURL=symbol.js.map","\"use client\";\nimport { useCallback, useInsertionEffect, useRef } from \"react\";\n/**\n * Creates a ref function that, when called, hydrates the provided\n * external ref and VisualElement.\n */\nexport function useMotionRef(visualState, visualElement, externalRef) {\n /**\n * Store externalRef in a ref to avoid including it in the useCallback\n * dependency array. Including externalRef in dependencies causes issues\n * with libraries like Radix UI that create new callback refs on each render\n * when using asChild - this would cause the callback to be recreated,\n * triggering element remounts and breaking AnimatePresence exit animations.\n */\n const externalRefContainer = useRef(externalRef);\n useInsertionEffect(() => {\n externalRefContainer.current = externalRef;\n });\n // Store cleanup function returned by callback refs (React 19 feature)\n const refCleanup = useRef(null);\n return useCallback((instance) => {\n if (instance) {\n visualState.onMount?.(instance);\n }\n if (visualElement) {\n instance ? visualElement.mount(instance) : visualElement.unmount();\n }\n const ref = externalRefContainer.current;\n if (typeof ref === \"function\") {\n if (instance) {\n const cleanup = ref(instance);\n if (typeof cleanup === \"function\") {\n refCleanup.current = cleanup;\n }\n }\n else if (refCleanup.current) {\n refCleanup.current();\n refCleanup.current = null;\n }\n else {\n ref(instance);\n }\n }\n else if (ref) {\n ;\n ref.current = instance;\n }\n }, [visualElement]);\n}\n//# sourceMappingURL=use-motion-ref.js.map","\"use client\";\nimport { createContext } from \"react\";\n/**\n * Internal, exported only for usage in Framer\n */\nexport const SwitchLayoutGroupContext = createContext({});\n//# sourceMappingURL=SwitchLayoutGroupContext.js.map","export function isRefObject(ref) {\n return (ref &&\n typeof ref === \"object\" &&\n Object.prototype.hasOwnProperty.call(ref, \"current\"));\n}\n//# sourceMappingURL=is-ref-object.js.map","export const isBrowser = typeof window !== \"undefined\";\n//# sourceMappingURL=is-browser.js.map","\"use client\";\nimport { useEffect, useLayoutEffect } from \"react\";\nimport { isBrowser } from \"./is-browser\";\nexport const useIsomorphicLayoutEffect = isBrowser ? useLayoutEffect : useEffect;\n//# sourceMappingURL=use-isomorphic-effect.js.map","\"use client\";\nimport { optimizedAppearDataAttribute, } from \"motion-dom\";\nimport { useContext, useEffect, useInsertionEffect, useRef } from \"react\";\nimport { LazyContext } from \"../../context/LazyContext\";\nimport { MotionConfigContext } from \"../../context/MotionConfigContext\";\nimport { MotionContext } from \"../../context/MotionContext\";\nimport { PresenceContext } from \"../../context/PresenceContext\";\nimport { SwitchLayoutGroupContext, } from \"../../context/SwitchLayoutGroupContext\";\nimport { isRefObject } from \"../../utils/is-ref-object\";\nimport { useIsomorphicLayoutEffect } from \"../../utils/use-isomorphic-effect\";\nexport function useVisualElement(Component, visualState, props, createVisualElement, ProjectionNodeConstructor, isSVG) {\n const { visualElement: parent } = useContext(MotionContext);\n const lazyContext = useContext(LazyContext);\n const presenceContext = useContext(PresenceContext);\n const motionConfig = useContext(MotionConfigContext);\n const reducedMotionConfig = motionConfig.reducedMotion;\n const skipAnimations = motionConfig.skipAnimations;\n const visualElementRef = useRef(null);\n /**\n * Track whether the component has been through React's commit phase.\n * Used to detect when LazyMotion features load after the component has mounted.\n */\n const hasMountedOnce = useRef(false);\n /**\n * If we haven't preloaded a renderer, check to see if we have one lazy-loaded\n */\n createVisualElement =\n createVisualElement ||\n lazyContext.renderer;\n if (!visualElementRef.current && createVisualElement) {\n visualElementRef.current = createVisualElement(Component, {\n visualState,\n parent,\n props,\n presenceContext,\n blockInitialAnimation: presenceContext\n ? presenceContext.initial === false\n : false,\n reducedMotionConfig,\n skipAnimations,\n isSVG,\n });\n /**\n * If the component has already mounted before features loaded (e.g. via\n * LazyMotion with async feature loading), we need to force the initial\n * animation to run. Otherwise state changes that occurred before features\n * loaded will be lost and the element will snap to its final state.\n */\n if (hasMountedOnce.current && visualElementRef.current) {\n visualElementRef.current.manuallyAnimateOnMount = true;\n }\n }\n const visualElement = visualElementRef.current;\n /**\n * Load Motion gesture and animation features. These are rendered as renderless\n * components so each feature can optionally make use of React lifecycle methods.\n */\n const initialLayoutGroupConfig = useContext(SwitchLayoutGroupContext);\n if (visualElement &&\n !visualElement.projection &&\n ProjectionNodeConstructor &&\n (visualElement.type === \"html\" || visualElement.type === \"svg\")) {\n createProjectionNode(visualElementRef.current, props, ProjectionNodeConstructor, initialLayoutGroupConfig);\n }\n const isMounted = useRef(false);\n useInsertionEffect(() => {\n /**\n * Check the component has already mounted before calling\n * `update` unnecessarily. This ensures we skip the initial update.\n */\n if (visualElement && isMounted.current) {\n visualElement.update(props, presenceContext);\n }\n });\n /**\n * Cache this value as we want to know whether HandoffAppearAnimations\n * was present on initial render - it will be deleted after this.\n */\n const optimisedAppearId = props[optimizedAppearDataAttribute];\n const wantsHandoff = useRef(Boolean(optimisedAppearId) &&\n typeof window !== \"undefined\" &&\n !window.MotionHandoffIsComplete?.(optimisedAppearId) &&\n window.MotionHasOptimisedAnimation?.(optimisedAppearId));\n useIsomorphicLayoutEffect(() => {\n /**\n * Track that this component has mounted. This is used to detect when\n * LazyMotion features load after the component has already committed.\n */\n hasMountedOnce.current = true;\n if (!visualElement)\n return;\n isMounted.current = true;\n window.MotionIsMounted = true;\n visualElement.updateFeatures();\n visualElement.scheduleRenderMicrotask();\n /**\n * Ideally this function would always run in a useEffect.\n *\n * However, if we have optimised appear animations to handoff from,\n * it needs to happen synchronously to ensure there's no flash of\n * incorrect styles in the event of a hydration error.\n *\n * So if we detect a situtation where optimised appear animations\n * are running, we use useLayoutEffect to trigger animations.\n */\n if (wantsHandoff.current && visualElement.animationState) {\n visualElement.animationState.animateChanges();\n }\n });\n useEffect(() => {\n if (!visualElement)\n return;\n if (!wantsHandoff.current && visualElement.animationState) {\n visualElement.animationState.animateChanges();\n }\n if (wantsHandoff.current) {\n // This ensures all future calls to animateChanges() in this component will run in useEffect\n queueMicrotask(() => {\n window.MotionHandoffMarkAsComplete?.(optimisedAppearId);\n });\n wantsHandoff.current = false;\n }\n /**\n * Now we've finished triggering animations for this element we\n * can wipe the enteringChildren set for the next render.\n */\n visualElement.enteringChildren = undefined;\n });\n return visualElement;\n}\nfunction createProjectionNode(visualElement, props, ProjectionNodeConstructor, initialPromotionConfig) {\n const { layoutId, layout, drag, dragConstraints, layoutScroll, layoutRoot, layoutAnchor, layoutCrossfade, } = props;\n visualElement.projection = new ProjectionNodeConstructor(visualElement.latestValues, props[\"data-framer-portal-id\"]\n ? undefined\n : getClosestProjectingNode(visualElement.parent));\n visualElement.projection.setOptions({\n layoutId,\n layout,\n alwaysMeasureLayout: Boolean(drag) || (dragConstraints && isRefObject(dragConstraints)),\n visualElement,\n /**\n * TODO: Update options in an effect. This could be tricky as it'll be too late\n * to update by the time layout animations run.\n * We also need to fix this safeToRemove by linking it up to the one returned by usePresence,\n * ensuring it gets called if there's no potential layout animations.\n *\n */\n animationType: typeof layout === \"string\" ? layout : \"both\",\n initialPromotionConfig,\n crossfade: layoutCrossfade,\n layoutScroll,\n layoutRoot,\n layoutAnchor,\n });\n}\nfunction getClosestProjectingNode(visualElement) {\n if (!visualElement)\n return undefined;\n return visualElement.options.allowProjection !== false\n ? visualElement.projection\n : getClosestProjectingNode(visualElement.parent);\n}\n//# sourceMappingURL=use-visual-element.js.map","\"use client\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { invariant, warning } from \"motion-utils\";\nimport { forwardRef, useContext } from \"react\";\nimport { LayoutGroupContext } from \"../context/LayoutGroupContext\";\nimport { LazyContext } from \"../context/LazyContext\";\nimport { MotionConfigContext } from \"../context/MotionConfigContext\";\nimport { MotionContext } from \"../context/MotionContext\";\nimport { useCreateMotionContext } from \"../context/MotionContext/create\";\nimport { useRender } from \"../render/dom/use-render\";\nimport { isSVGComponent } from \"../render/dom/utils/is-svg-component\";\nimport { useHTMLVisualState } from \"../render/html/use-html-visual-state\";\nimport { useSVGVisualState } from \"../render/svg/use-svg-visual-state\";\nimport { getInitializedFeatureDefinitions } from \"./features/definitions\";\nimport { loadFeatures } from \"./features/load-features\";\nimport { motionComponentSymbol } from \"./utils/symbol\";\nimport { useMotionRef } from \"./utils/use-motion-ref\";\nimport { useVisualElement } from \"./utils/use-visual-element\";\n/**\n * Create a `motion` component.\n *\n * This function accepts a Component argument, which can be either a string (ie \"div\"\n * for `motion.div`), or an actual React component.\n *\n * Alongside this is a config option which provides a way of rendering the provided\n * component \"offline\", or outside the React render cycle.\n */\nexport function createMotionComponent(Component, { forwardMotionProps = false, type } = {}, preloadedFeatures, createVisualElement) {\n preloadedFeatures && loadFeatures(preloadedFeatures);\n /**\n * Determine whether to use SVG or HTML rendering based on:\n * 1. Explicit `type` option (highest priority)\n * 2. Auto-detection via `isSVGComponent`\n */\n const isSVG = type ? type === \"svg\" : isSVGComponent(Component);\n const useVisualState = isSVG ? useSVGVisualState : useHTMLVisualState;\n function MotionDOMComponent(props, externalRef) {\n /**\n * If we need to measure the element we load this functionality in a\n * separate class component in order to gain access to getSnapshotBeforeUpdate.\n */\n let MeasureLayout;\n const configAndProps = {\n ...useContext(MotionConfigContext),\n ...props,\n layoutId: useLayoutId(props),\n };\n const { isStatic, isValidProp } = configAndProps;\n const context = useCreateMotionContext(props);\n const visualState = useVisualState(props, isStatic);\n if (!isStatic && typeof window !== \"undefined\") {\n useStrictMode(configAndProps, preloadedFeatures);\n const layoutProjection = getProjectionFunctionality(configAndProps);\n MeasureLayout = layoutProjection.MeasureLayout;\n /**\n * Create a VisualElement for this component. A VisualElement provides a common\n * interface to renderer-specific APIs (ie DOM/Three.js etc) as well as\n * providing a way of rendering to these APIs outside of the React render loop\n * for more performant animations and interactions\n */\n context.visualElement = useVisualElement(Component, visualState, configAndProps, createVisualElement, layoutProjection.ProjectionNode, isSVG);\n }\n /**\n * The mount order and hierarchy is specific to ensure our element ref\n * is hydrated by the time features fire their effects.\n */\n return (_jsxs(MotionContext.Provider, { value: context, children: [MeasureLayout && context.visualElement ? (_jsx(MeasureLayout, { visualElement: context.visualElement, ...configAndProps })) : null, useRender(Component, props, useMotionRef(visualState, context.visualElement, externalRef), visualState, isStatic, forwardMotionProps, isSVG, isValidProp)] }));\n }\n MotionDOMComponent.displayName = `motion.${typeof Component === \"string\"\n ? Component\n : `create(${Component.displayName ?? Component.name ?? \"\"})`}`;\n const ForwardRefMotionComponent = forwardRef(MotionDOMComponent);\n ForwardRefMotionComponent[motionComponentSymbol] = Component;\n return ForwardRefMotionComponent;\n}\nfunction useLayoutId({ layoutId }) {\n const layoutGroupId = useContext(LayoutGroupContext).id;\n return layoutGroupId && layoutId !== undefined\n ? layoutGroupId + \"-\" + layoutId\n : layoutId;\n}\nfunction useStrictMode(configAndProps, preloadedFeatures) {\n const isStrict = useContext(LazyContext).strict;\n /**\n * If we're in development mode, check to make sure we're not rendering a motion component\n * as a child of LazyMotion, as this will break the file-size benefits of using it.\n */\n if (process.env.NODE_ENV !== \"production\" &&\n preloadedFeatures &&\n isStrict) {\n const strictMessage = \"You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.\";\n configAndProps.ignoreStrict\n ? warning(false, strictMessage, \"lazy-strict-mode\")\n : invariant(false, strictMessage, \"lazy-strict-mode\");\n }\n}\nfunction getProjectionFunctionality(props) {\n const featureDefinitions = getInitializedFeatureDefinitions();\n const { drag, layout } = featureDefinitions;\n if (!drag && !layout)\n return {};\n const combined = { ...drag, ...layout };\n return {\n MeasureLayout: drag?.isEnabled(props) || layout?.isEnabled(props)\n ? combined.MeasureLayout\n : undefined,\n ProjectionNode: combined.ProjectionNode,\n };\n}\n//# sourceMappingURL=index.js.map","import { setFeatureDefinitions } from \"motion-dom\";\nimport { getInitializedFeatureDefinitions } from \"./definitions\";\nexport function loadFeatures(features) {\n const featureDefinitions = getInitializedFeatureDefinitions();\n for (const key in features) {\n featureDefinitions[key] = {\n ...featureDefinitions[key],\n ...features[key],\n };\n }\n setFeatureDefinitions(featureDefinitions);\n}\n//# sourceMappingURL=load-features.js.map","import { HTMLVisualElement, SVGVisualElement } from \"motion-dom\";\nimport { Fragment } from \"react\";\nimport { isSVGComponent } from \"./utils/is-svg-component\";\nexport const createDomVisualElement = (Component, options) => {\n /**\n * Use explicit isSVG override if provided, otherwise auto-detect\n */\n const isSVG = options.isSVG ?? isSVGComponent(Component);\n return isSVG\n ? new SVGVisualElement(options)\n : new HTMLVisualElement(options, {\n allowProjection: Component !== Fragment,\n });\n};\n//# sourceMappingURL=create-visual-element.js.map","import { Feature, resolveVariant } from \"motion-dom\";\nlet id = 0;\nexport class ExitAnimationFeature extends Feature {\n constructor() {\n super(...arguments);\n this.id = id++;\n this.isExitComplete = false;\n }\n update() {\n if (!this.node.presenceContext)\n return;\n const { isPresent, onExitComplete } = this.node.presenceContext;\n const { isPresent: prevIsPresent } = this.node.prevPresenceContext || {};\n if (!this.node.animationState || isPresent === prevIsPresent) {\n return;\n }\n if (isPresent && prevIsPresent === false) {\n /**\n * When re-entering, if the exit animation already completed\n * (element is at rest), reset to initial values so the enter\n * animation replays from the correct position.\n */\n if (this.isExitComplete) {\n const { initial, custom } = this.node.getProps();\n if (typeof initial === \"string\" ||\n (typeof initial === \"object\" &&\n initial !== null &&\n !Array.isArray(initial))) {\n const resolved = resolveVariant(this.node, initial, custom);\n if (resolved) {\n const { transition, transitionEnd, ...target } = resolved;\n for (const key in target) {\n this.node\n .getValue(key)\n ?.jump(target[key]);\n }\n }\n }\n this.node.animationState.reset();\n this.node.animationState.animateChanges();\n }\n else {\n this.node.animationState.setActive(\"exit\", false);\n }\n this.isExitComplete = false;\n return;\n }\n const exitAnimation = this.node.animationState.setActive(\"exit\", !isPresent);\n if (onExitComplete && !isPresent) {\n exitAnimation.then(() => {\n this.isExitComplete = true;\n onExitComplete(this.id);\n });\n }\n }\n mount() {\n const { register, onExitComplete } = this.node.presenceContext || {};\n if (onExitComplete) {\n onExitComplete(this.id);\n }\n if (register) {\n this.unmount = register(this.id);\n }\n }\n unmount() { }\n}\n//# sourceMappingURL=exit.js.map","import { AnimationFeature } from \"./animation\";\nimport { ExitAnimationFeature } from \"./animation/exit\";\nexport const animations = {\n animation: {\n Feature: AnimationFeature,\n },\n exit: {\n Feature: ExitAnimationFeature,\n },\n};\n//# sourceMappingURL=animations.js.map","import { createAnimationState, Feature, isAnimationControls, } from \"motion-dom\";\nexport class AnimationFeature extends Feature {\n /**\n * We dynamically generate the AnimationState manager as it contains a reference\n * to the underlying animation library. We only want to load that if we load this,\n * so people can optionally code split it out using the `m` component.\n */\n constructor(node) {\n super(node);\n node.animationState || (node.animationState = createAnimationState(node));\n }\n updateAnimationControlsSubscription() {\n const { animate } = this.node.getProps();\n if (isAnimationControls(animate)) {\n this.unmountControls = animate.subscribe(this.node);\n }\n }\n /**\n * Subscribe any provided AnimationControls to the component's VisualElement\n */\n mount() {\n this.updateAnimationControlsSubscription();\n }\n update() {\n const { animate } = this.node.getProps();\n const { animate: prevAnimate } = this.node.prevProps || {};\n if (animate !== prevAnimate) {\n this.updateAnimationControlsSubscription();\n }\n }\n unmount() {\n this.node.animationState.reset();\n this.unmountControls?.();\n }\n}\n//# sourceMappingURL=index.js.map","import { isPrimaryPointer } from \"motion-dom\";\nexport function extractEventInfo(event) {\n return {\n point: {\n x: event.pageX,\n y: event.pageY,\n },\n };\n}\nexport const addPointerInfo = (handler) => (event) => isPrimaryPointer(event) && handler(event, extractEventInfo(event));\n//# sourceMappingURL=event-info.js.map","import { addDomEvent } from \"motion-dom\";\nimport { addPointerInfo } from \"./event-info\";\nexport function addPointerEvent(target, eventName, handler, options) {\n return addDomEvent(target, eventName, addPointerInfo(handler), options);\n}\n//# sourceMappingURL=add-pointer-event.js.map","// Fixes https://github.com/motiondivision/motion/issues/2270\nexport const getContextWindow = ({ current }) => {\n return current ? current.ownerDocument.defaultView : null;\n};\n//# sourceMappingURL=get-context-window.js.map","export const distance = (a, b) => Math.abs(a - b);\nexport function distance2D(a, b) {\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//# sourceMappingURL=distance.js.map","import { cancelFrame, frame, frameData, isPrimaryPointer } from \"motion-dom\";\nimport { millisecondsToSeconds, pipe, secondsToMilliseconds, } from \"motion-utils\";\nimport { addPointerEvent } from \"../../events/add-pointer-event\";\nimport { extractEventInfo } from \"../../events/event-info\";\nimport { distance2D } from \"../../utils/distance\";\nconst overflowStyles = /*#__PURE__*/ new Set([\"auto\", \"scroll\"]);\n/**\n * @internal\n */\nexport class PanSession {\n constructor(event, handlers, { transformPagePoint, contextWindow = window, dragSnapToOrigin = false, distanceThreshold = 3, element, } = {}) {\n /**\n * @internal\n */\n this.startEvent = null;\n /**\n * @internal\n */\n this.lastMoveEvent = null;\n /**\n * @internal\n */\n this.lastMoveEventInfo = null;\n /**\n * Raw (untransformed) event info, re-transformed each frame\n * so transformPagePoint sees the current parent matrix.\n * @internal\n */\n this.lastRawMoveEventInfo = null;\n /**\n * @internal\n */\n this.handlers = {};\n /**\n * @internal\n */\n this.contextWindow = window;\n /**\n * Scroll positions of scrollable ancestors and window.\n * @internal\n */\n this.scrollPositions = new Map();\n /**\n * Cleanup function for scroll listeners.\n * @internal\n */\n this.removeScrollListeners = null;\n this.onElementScroll = (event) => {\n this.handleScroll(event.target);\n };\n this.onWindowScroll = () => {\n this.handleScroll(window);\n };\n this.updatePoint = () => {\n if (!(this.lastMoveEvent && this.lastMoveEventInfo))\n return;\n // Re-transform raw point through current transformPagePoint so\n // animated parent transforms (e.g. rotation) are picked up each frame\n if (this.lastRawMoveEventInfo) {\n this.lastMoveEventInfo = transformPoint(this.lastRawMoveEventInfo, this.transformPagePoint);\n }\n const info = getPanInfo(this.lastMoveEventInfo, this.history);\n const isPanStarted = this.startEvent !== null;\n // Only start panning if the offset is larger than 3 pixels. If we make it\n // any larger than this we'll want to reset the pointer history\n // on the first update to avoid visual snapping to the cursor.\n const isDistancePastThreshold = distance2D(info.offset, { x: 0, y: 0 }) >= this.distanceThreshold;\n if (!isPanStarted && !isDistancePastThreshold)\n return;\n const { point } = info;\n const { timestamp } = frameData;\n this.history.push({ ...point, timestamp });\n const { onStart, onMove } = this.handlers;\n if (!isPanStarted) {\n onStart && onStart(this.lastMoveEvent, info);\n this.startEvent = this.lastMoveEvent;\n }\n onMove && onMove(this.lastMoveEvent, info);\n };\n this.handlePointerMove = (event, info) => {\n this.lastMoveEvent = event;\n this.lastRawMoveEventInfo = info;\n this.lastMoveEventInfo = transformPoint(info, this.transformPagePoint);\n // Throttle mouse move event to once per frame\n frame.update(this.updatePoint, true);\n };\n this.handlePointerUp = (event, info) => {\n this.end();\n const { onEnd, onSessionEnd, resumeAnimation } = this.handlers;\n // Resume animation if dragSnapToOrigin is set OR if no drag started (user just clicked)\n // This ensures constraint animations continue when interrupted by a click\n if (this.dragSnapToOrigin || !this.startEvent) {\n resumeAnimation && resumeAnimation();\n }\n if (!(this.lastMoveEvent && this.lastMoveEventInfo))\n return;\n const panInfo = getPanInfo(event.type === \"pointercancel\"\n ? this.lastMoveEventInfo\n : transformPoint(info, this.transformPagePoint), this.history);\n if (this.startEvent && onEnd) {\n onEnd(event, panInfo);\n }\n onSessionEnd && onSessionEnd(event, panInfo);\n };\n // If we have more than one touch, don't start detecting this gesture\n if (!isPrimaryPointer(event))\n return;\n this.dragSnapToOrigin = dragSnapToOrigin;\n this.handlers = handlers;\n this.transformPagePoint = transformPagePoint;\n this.distanceThreshold = distanceThreshold;\n this.contextWindow = contextWindow || window;\n const info = extractEventInfo(event);\n const initialInfo = transformPoint(info, this.transformPagePoint);\n const { point } = initialInfo;\n const { timestamp } = frameData;\n this.history = [{ ...point, timestamp }];\n const { onSessionStart } = handlers;\n onSessionStart &&\n onSessionStart(event, getPanInfo(initialInfo, this.history));\n // Listen in the capture phase so a descendant calling\n // stopPropagation() (e.g. in its own pointerup handler) can't\n // prevent the gesture from ending. See #2794.\n const eventOptions = { passive: true, capture: true };\n this.removeListeners = pipe(addPointerEvent(this.contextWindow, \"pointermove\", this.handlePointerMove, eventOptions), addPointerEvent(this.contextWindow, \"pointerup\", this.handlePointerUp, eventOptions), addPointerEvent(this.contextWindow, \"pointercancel\", this.handlePointerUp, eventOptions));\n // Start scroll tracking if element provided\n if (element) {\n this.startScrollTracking(element);\n }\n }\n /**\n * Start tracking scroll on ancestors and window.\n */\n startScrollTracking(element) {\n // Store initial scroll positions for scrollable ancestors\n let current = element.parentElement;\n while (current) {\n const style = getComputedStyle(current);\n if (overflowStyles.has(style.overflowX) ||\n overflowStyles.has(style.overflowY)) {\n this.scrollPositions.set(current, {\n x: current.scrollLeft,\n y: current.scrollTop,\n });\n }\n current = current.parentElement;\n }\n // Track window scroll\n this.scrollPositions.set(window, {\n x: window.scrollX,\n y: window.scrollY,\n });\n // Capture listener catches element scroll events as they bubble\n window.addEventListener(\"scroll\", this.onElementScroll, {\n capture: true,\n });\n // Direct window scroll listener (window scroll doesn't bubble)\n window.addEventListener(\"scroll\", this.onWindowScroll);\n this.removeScrollListeners = () => {\n window.removeEventListener(\"scroll\", this.onElementScroll, {\n capture: true,\n });\n window.removeEventListener(\"scroll\", this.onWindowScroll);\n };\n }\n /**\n * Handle scroll compensation during drag.\n *\n * For element scroll: adjusts history origin since pageX/pageY doesn't change.\n * For window scroll: adjusts lastMoveEventInfo since pageX/pageY would change.\n */\n handleScroll(target) {\n const initial = this.scrollPositions.get(target);\n if (!initial)\n return;\n const isWindow = target === window;\n const current = isWindow\n ? { x: window.scrollX, y: window.scrollY }\n : {\n x: target.scrollLeft,\n y: target.scrollTop,\n };\n const delta = { x: current.x - initial.x, y: current.y - initial.y };\n if (delta.x === 0 && delta.y === 0)\n return;\n if (isWindow) {\n // Window scroll: pageX/pageY changes, so update lastMoveEventInfo\n if (this.lastMoveEventInfo) {\n this.lastMoveEventInfo.point.x += delta.x;\n this.lastMoveEventInfo.point.y += delta.y;\n }\n }\n else {\n // Element scroll: pageX/pageY unchanged, so adjust history origin\n if (this.history.length > 0) {\n this.history[0].x -= delta.x;\n this.history[0].y -= delta.y;\n }\n }\n this.scrollPositions.set(target, current);\n frame.update(this.updatePoint, true);\n }\n updateHandlers(handlers) {\n this.handlers = handlers;\n }\n end() {\n this.removeListeners && this.removeListeners();\n this.removeScrollListeners && this.removeScrollListeners();\n this.scrollPositions.clear();\n cancelFrame(this.updatePoint);\n }\n}\nfunction transformPoint(info, transformPagePoint) {\n return transformPagePoint ? { point: transformPagePoint(info.point) } : info;\n}\nfunction subtractPoint(a, b) {\n return { x: a.x - b.x, y: a.y - b.y };\n}\nfunction getPanInfo({ point }, history) {\n return {\n point,\n delta: subtractPoint(point, lastDevicePoint(history)),\n offset: subtractPoint(point, startDevicePoint(history)),\n velocity: getVelocity(history, 0.1),\n };\n}\nfunction startDevicePoint(history) {\n return history[0];\n}\nfunction lastDevicePoint(history) {\n return history[history.length - 1];\n}\nfunction getVelocity(history, timeDelta) {\n if (history.length < 2) {\n return { x: 0, y: 0 };\n }\n let i = history.length - 1;\n let timestampedPoint = null;\n const lastPoint = lastDevicePoint(history);\n while (i >= 0) {\n timestampedPoint = history[i];\n if (lastPoint.timestamp - timestampedPoint.timestamp >\n secondsToMilliseconds(timeDelta)) {\n break;\n }\n i--;\n }\n if (!timestampedPoint) {\n return { x: 0, y: 0 };\n }\n /**\n * If the selected point is the pointer-down origin (history[0]),\n * there are better movement points available, and the time gap\n * is suspiciously large (>2x timeDelta), use the next point instead.\n * This prevents stale pointer-down points from diluting velocity\n * in hold-then-flick gestures.\n */\n if (timestampedPoint === history[0] &&\n history.length > 2 &&\n lastPoint.timestamp - timestampedPoint.timestamp >\n secondsToMilliseconds(timeDelta) * 2) {\n timestampedPoint = history[1];\n }\n const time = millisecondsToSeconds(lastPoint.timestamp - timestampedPoint.timestamp);\n if (time === 0) {\n return { x: 0, y: 0 };\n }\n const currentVelocity = {\n x: (lastPoint.x - timestampedPoint.x) / time,\n y: (lastPoint.y - timestampedPoint.y) / time,\n };\n if (currentVelocity.x === Infinity) {\n currentVelocity.x = 0;\n }\n if (currentVelocity.y === Infinity) {\n currentVelocity.y = 0;\n }\n return currentVelocity;\n}\n//# sourceMappingURL=PanSession.js.map","import { calcLength, mixNumber } from \"motion-dom\";\nimport { progress as calcProgress, clamp, } from \"motion-utils\";\n/**\n * Apply constraints to a point. These constraints are both physical along an\n * axis, and an elastic factor that determines how much to constrain the point\n * by if it does lie outside the defined parameters.\n */\nexport function applyConstraints(point, { min, max }, elastic) {\n if (min !== undefined && point < min) {\n // If we have a min point defined, and this is outside of that, constrain\n point = elastic\n ? mixNumber(min, point, elastic.min)\n : Math.max(point, min);\n }\n else if (max !== undefined && point > max) {\n // If we have a max point defined, and this is outside of that, constrain\n point = elastic\n ? mixNumber(max, point, elastic.max)\n : Math.min(point, max);\n }\n return point;\n}\n/**\n * Calculates a min projection point based on a pointer, pointer progress\n * within the drag target, and constraints.\n *\n * For instance if an element was 100px width, we were dragging from 0.25\n * along this axis, the pointer is at 200px, and there were no constraints,\n * we would calculate a min projection point of 175px.\n */\nexport function calcConstrainedMinPoint(point, length, progress, constraints, elastic) {\n // Calculate a min point for this axis and apply it to the current pointer\n const min = point - length * progress;\n return constraints ? applyConstraints(min, constraints, elastic) : min;\n}\n/**\n * Calculate constraints in terms of the viewport when defined relatively to the\n * measured axis. This is measured from the nearest edge, so a max constraint of 200\n * on an axis with a max value of 300 would return a constraint of 500 - axis length\n */\nexport function calcRelativeAxisConstraints(axis, min, max) {\n return {\n min: min !== undefined ? axis.min + min : undefined,\n max: max !== undefined\n ? axis.max + max - (axis.max - axis.min)\n : undefined,\n };\n}\n/**\n * Calculate constraints in terms of the viewport when\n * defined relatively to the measured bounding box.\n */\nexport function calcRelativeConstraints(layoutBox, { top, left, bottom, right }) {\n return {\n x: calcRelativeAxisConstraints(layoutBox.x, left, right),\n y: calcRelativeAxisConstraints(layoutBox.y, top, bottom),\n };\n}\n/**\n * Calculate viewport constraints when defined as another viewport-relative axis\n */\nexport function calcViewportAxisConstraints(layoutAxis, constraintsAxis) {\n let min = constraintsAxis.min - layoutAxis.min;\n let max = constraintsAxis.max - layoutAxis.max;\n // If the constraints axis is actually smaller than the layout axis then we can\n // flip the constraints\n if (constraintsAxis.max - constraintsAxis.min <\n layoutAxis.max - layoutAxis.min) {\n ;\n [min, max] = [max, min];\n }\n return { min, max };\n}\n/**\n * Calculate viewport constraints when defined as another viewport-relative box\n */\nexport function calcViewportConstraints(layoutBox, constraintsBox) {\n return {\n x: calcViewportAxisConstraints(layoutBox.x, constraintsBox.x),\n y: calcViewportAxisConstraints(layoutBox.y, constraintsBox.y),\n };\n}\n/**\n * Calculate a transform origin relative to the source axis, between 0-1, that results\n * in an asthetically pleasing scale/transform needed to project from source to target.\n */\nexport function calcOrigin(source, target) {\n let origin = 0.5;\n const sourceLength = calcLength(source);\n const targetLength = calcLength(target);\n if (targetLength > sourceLength) {\n origin = calcProgress(target.min, target.max - sourceLength, source.min);\n }\n else if (sourceLength > targetLength) {\n origin = calcProgress(source.min, source.max - targetLength, target.min);\n }\n return clamp(0, 1, origin);\n}\n/**\n * Calculate the relative progress of one constraints box relative to another.\n * Imagine a page scroll bar. At the top, this would return 0, at the bottom, 1.\n * Anywhere in-between, a value between 0 and 1.\n *\n * This also handles flipped constraints, for instance a draggable container within\n * a smaller viewport like a scrollable view.\n */\nexport function calcProgressWithinConstraints(layoutBox, constraintsBox) {\n return {\n x: calcOrigin(layoutBox.x, constraintsBox.x),\n y: calcOrigin(layoutBox.y, constraintsBox.y),\n };\n}\n/**\n * Calculate the an axis position based on two axes and a progress value.\n */\nexport function calcPositionFromProgress(axis, constraints, progress) {\n const axisLength = axis.max - axis.min;\n const min = mixNumber(constraints.min, constraints.max - axisLength, progress);\n return { min, max: min + axisLength };\n}\n/**\n * Rebase the calculated viewport constraints relative to the layout.min point.\n */\nexport function rebaseAxisConstraints(layout, constraints) {\n const relativeConstraints = {};\n if (constraints.min !== undefined) {\n relativeConstraints.min = constraints.min - layout.min;\n }\n if (constraints.max !== undefined) {\n relativeConstraints.max = constraints.max - layout.min;\n }\n return relativeConstraints;\n}\nexport const defaultElastic = 0.35;\n/**\n * Accepts a dragElastic prop and returns resolved elastic values for each axis.\n */\nexport function resolveDragElastic(dragElastic = defaultElastic) {\n if (dragElastic === false) {\n dragElastic = 0;\n }\n else if (dragElastic === true) {\n dragElastic = defaultElastic;\n }\n return {\n x: resolveAxisElastic(dragElastic, \"left\", \"right\"),\n y: resolveAxisElastic(dragElastic, \"top\", \"bottom\"),\n };\n}\nexport function resolveAxisElastic(dragElastic, minLabel, maxLabel) {\n return {\n min: resolvePointElastic(dragElastic, minLabel),\n max: resolvePointElastic(dragElastic, maxLabel),\n };\n}\nexport function resolvePointElastic(dragElastic, label) {\n return typeof dragElastic === \"number\"\n ? dragElastic\n : dragElastic[label] || 0;\n}\n//# sourceMappingURL=constraints.js.map","import { addValueToWillChange, animateMotionValue, calcLength, convertBoundingBoxToBox, convertBoxToBoundingBox, createBox, eachAxis, frame, isElementTextInput, measurePageBox, mixNumber, percent, resize, setDragLock, } from \"motion-dom\";\nimport { invariant } from \"motion-utils\";\nimport { addDomEvent } from \"motion-dom\";\nimport { addPointerEvent } from \"../../events/add-pointer-event\";\nimport { extractEventInfo } from \"../../events/event-info\";\nimport { getContextWindow } from \"../../utils/get-context-window\";\nimport { isRefObject } from \"../../utils/is-ref-object\";\nimport { PanSession } from \"../pan/PanSession\";\nimport { applyConstraints, calcOrigin, calcRelativeConstraints, calcViewportConstraints, defaultElastic, rebaseAxisConstraints, resolveDragElastic, } from \"./utils/constraints\";\nexport const elementDragControls = new WeakMap();\nexport class VisualElementDragControls {\n constructor(visualElement) {\n this.openDragLock = null;\n this.isDragging = false;\n this.currentDirection = null;\n this.originPoint = { x: 0, y: 0 };\n /**\n * The permitted boundaries of travel, in pixels.\n */\n this.constraints = false;\n this.hasMutatedConstraints = false;\n /**\n * The per-axis resolved elastic values.\n */\n this.elastic = createBox();\n /**\n * The latest pointer event. Used as fallback when the `cancel` and `stop` functions are called without arguments.\n */\n this.latestPointerEvent = null;\n /**\n * The latest pan info. Used as fallback when the `cancel` and `stop` functions are called without arguments.\n */\n this.latestPanInfo = null;\n this.visualElement = visualElement;\n }\n start(originEvent, { snapToCursor = false, distanceThreshold } = {}) {\n /**\n * Don't start dragging if this component is exiting\n */\n const { presenceContext } = this.visualElement;\n if (presenceContext && presenceContext.isPresent === false)\n return;\n const onSessionStart = (event) => {\n if (snapToCursor) {\n this.snapToCursor(extractEventInfo(event).point);\n }\n this.stopAnimation();\n };\n const onStart = (event, info) => {\n // Attempt to grab the global drag gesture lock - maybe make this part of PanSession\n const { drag, dragPropagation, onDragStart } = this.getProps();\n if (drag && !dragPropagation) {\n if (this.openDragLock)\n this.openDragLock();\n this.openDragLock = setDragLock(drag);\n // If we don 't have the lock, don't start dragging\n if (!this.openDragLock)\n return;\n }\n this.latestPointerEvent = event;\n this.latestPanInfo = info;\n this.isDragging = true;\n this.currentDirection = null;\n this.resolveConstraints();\n if (this.visualElement.projection) {\n this.visualElement.projection.isAnimationBlocked = true;\n this.visualElement.projection.target = undefined;\n }\n /**\n * Record gesture origin and pointer offset\n */\n eachAxis((axis) => {\n let current = this.getAxisMotionValue(axis).get() || 0;\n /**\n * If the MotionValue is a percentage value convert to px\n */\n if (percent.test(current)) {\n const { projection } = this.visualElement;\n if (projection && projection.layout) {\n const measuredAxis = projection.layout.layoutBox[axis];\n if (measuredAxis) {\n const length = calcLength(measuredAxis);\n current = length * (parseFloat(current) / 100);\n }\n }\n }\n this.originPoint[axis] = current;\n });\n // Fire onDragStart event\n if (onDragStart) {\n frame.update(() => onDragStart(event, info), false, true);\n }\n addValueToWillChange(this.visualElement, \"transform\");\n const { animationState } = this.visualElement;\n animationState && animationState.setActive(\"whileDrag\", true);\n };\n const onMove = (event, info) => {\n this.latestPointerEvent = event;\n this.latestPanInfo = info;\n const { dragPropagation, dragDirectionLock, onDirectionLock, onDrag, } = this.getProps();\n // If we didn't successfully receive the gesture lock, early return.\n if (!dragPropagation && !this.openDragLock)\n return;\n const { offset } = info;\n // Attempt to detect drag direction if directionLock is true\n if (dragDirectionLock && this.currentDirection === null) {\n this.currentDirection = getCurrentDirection(offset);\n // If we've successfully set a direction, notify listener\n if (this.currentDirection !== null) {\n onDirectionLock && onDirectionLock(this.currentDirection);\n }\n return;\n }\n // Update each point with the latest position\n this.updateAxis(\"x\", info.point, offset);\n this.updateAxis(\"y\", info.point, offset);\n /**\n * Ideally we would leave the renderer to fire naturally at the end of\n * this frame but if the element is about to change layout as the result\n * of a re-render we want to ensure the browser can read the latest\n * bounding box to ensure the pointer and element don't fall out of sync.\n */\n this.visualElement.render();\n /**\n * This must fire after the render call as it might trigger a state\n * change which itself might trigger a layout update.\n */\n if (onDrag) {\n frame.update(() => onDrag(event, info), false, true);\n }\n };\n const onSessionEnd = (event, info) => {\n this.latestPointerEvent = event;\n this.latestPanInfo = info;\n this.stop(event, info);\n this.latestPointerEvent = null;\n this.latestPanInfo = null;\n };\n const resumeAnimation = () => {\n const { dragSnapToOrigin: snap } = this.getProps();\n if (snap || this.constraints) {\n this.startAnimation({ x: 0, y: 0 });\n }\n };\n const { dragSnapToOrigin } = this.getProps();\n this.panSession = new PanSession(originEvent, {\n onSessionStart,\n onStart,\n onMove,\n onSessionEnd,\n resumeAnimation,\n }, {\n transformPagePoint: this.visualElement.getTransformPagePoint(),\n dragSnapToOrigin,\n distanceThreshold,\n contextWindow: getContextWindow(this.visualElement),\n element: this.visualElement.current,\n });\n }\n /**\n * @internal\n */\n stop(event, panInfo) {\n const finalEvent = event || this.latestPointerEvent;\n const finalPanInfo = panInfo || this.latestPanInfo;\n const isDragging = this.isDragging;\n this.cancel();\n if (!isDragging || !finalPanInfo || !finalEvent)\n return;\n const { velocity } = finalPanInfo;\n this.startAnimation(velocity);\n const { onDragEnd } = this.getProps();\n if (onDragEnd) {\n frame.postRender(() => onDragEnd(finalEvent, finalPanInfo));\n }\n }\n /**\n * @internal\n */\n cancel() {\n this.isDragging = false;\n const { projection, animationState } = this.visualElement;\n if (projection) {\n projection.isAnimationBlocked = false;\n }\n this.endPanSession();\n const { dragPropagation } = this.getProps();\n if (!dragPropagation && this.openDragLock) {\n this.openDragLock();\n this.openDragLock = null;\n }\n animationState && animationState.setActive(\"whileDrag\", false);\n }\n /**\n * Clean up the pan session without modifying other drag state.\n * This is used during unmount to ensure event listeners are removed\n * without affecting projection animations or drag locks.\n * @internal\n */\n endPanSession() {\n this.panSession && this.panSession.end();\n this.panSession = undefined;\n }\n updateAxis(axis, _point, offset) {\n const { drag } = this.getProps();\n // If we're not dragging this axis, do an early return.\n if (!offset || !shouldDrag(axis, drag, this.currentDirection))\n return;\n const axisValue = this.getAxisMotionValue(axis);\n let next = this.originPoint[axis] + offset[axis];\n // Apply constraints\n if (this.constraints && this.constraints[axis]) {\n next = applyConstraints(next, this.constraints[axis], this.elastic[axis]);\n }\n axisValue.set(next);\n }\n resolveConstraints() {\n const { dragConstraints, dragElastic } = this.getProps();\n const layout = this.visualElement.projection &&\n !this.visualElement.projection.layout\n ? this.visualElement.projection.measure(false)\n : this.visualElement.projection?.layout;\n const prevConstraints = this.constraints;\n if (dragConstraints && isRefObject(dragConstraints)) {\n if (!this.constraints) {\n this.constraints = this.resolveRefConstraints();\n }\n }\n else {\n if (dragConstraints && layout) {\n this.constraints = calcRelativeConstraints(layout.layoutBox, dragConstraints);\n }\n else {\n this.constraints = false;\n }\n }\n this.elastic = resolveDragElastic(dragElastic);\n /**\n * If we're outputting to external MotionValues, we want to rebase the measured constraints\n * from viewport-relative to component-relative. This only applies to relative (non-ref)\n * constraints, as ref-based constraints from calcViewportConstraints are already in the\n * correct coordinate space for the motion value transform offset.\n */\n if (prevConstraints !== this.constraints &&\n !isRefObject(dragConstraints) &&\n layout &&\n this.constraints &&\n !this.hasMutatedConstraints) {\n eachAxis((axis) => {\n if (this.constraints !== false &&\n this.getAxisMotionValue(axis)) {\n this.constraints[axis] = rebaseAxisConstraints(layout.layoutBox[axis], this.constraints[axis]);\n }\n });\n }\n }\n resolveRefConstraints() {\n const { dragConstraints: constraints, onMeasureDragConstraints } = this.getProps();\n if (!constraints || !isRefObject(constraints))\n return false;\n const constraintsElement = constraints.current;\n invariant(constraintsElement !== null, \"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.\", \"drag-constraints-ref\");\n const { projection } = this.visualElement;\n // TODO\n if (!projection || !projection.layout)\n return false;\n /**\n * Refresh the root scroll offset so the constraint's viewport box\n * translates to correct page coordinates. The scroll captured at\n * drag mount can be stale if the document was scrolled afterwards —\n * e.g. via the browser restoring scroll on refresh, or an ancestor\n * layout effect running after this element's mount (#2829).\n *\n * Clear the cached scroll first so `updateScroll` bypasses its\n * per-animationId cache and re-reads the live value.\n */\n if (projection.root) {\n projection.root.scroll = undefined;\n projection.root.updateScroll();\n }\n const constraintsBox = measurePageBox(constraintsElement, projection.root, this.visualElement.getTransformPagePoint());\n let measuredConstraints = calcViewportConstraints(projection.layout.layoutBox, constraintsBox);\n /**\n * If there's an onMeasureDragConstraints listener we call it and\n * if different constraints are returned, set constraints to that\n */\n if (onMeasureDragConstraints) {\n const userConstraints = onMeasureDragConstraints(convertBoxToBoundingBox(measuredConstraints));\n this.hasMutatedConstraints = !!userConstraints;\n if (userConstraints) {\n measuredConstraints = convertBoundingBoxToBox(userConstraints);\n }\n }\n return measuredConstraints;\n }\n startAnimation(velocity) {\n const { drag, dragMomentum, dragElastic, dragTransition, dragSnapToOrigin, onDragTransitionEnd, } = this.getProps();\n const constraints = this.constraints || {};\n const momentumAnimations = eachAxis((axis) => {\n if (!shouldDrag(axis, drag, this.currentDirection)) {\n return;\n }\n let transition = (constraints && constraints[axis]) || {};\n if (dragSnapToOrigin === true ||\n dragSnapToOrigin === axis)\n transition = { min: 0, max: 0 };\n /**\n * Overdamp the boundary spring if `dragElastic` is disabled. There's still a frame\n * of spring animations so we should look into adding a disable spring option to `inertia`.\n * We could do something here where we affect the `bounceStiffness` and `bounceDamping`\n * using the value of `dragElastic`.\n */\n const bounceStiffness = dragElastic ? 200 : 1000000;\n const bounceDamping = dragElastic ? 40 : 10000000;\n const inertia = {\n type: \"inertia\",\n velocity: dragMomentum ? velocity[axis] : 0,\n bounceStiffness,\n bounceDamping,\n timeConstant: 750,\n restDelta: 1,\n restSpeed: 10,\n ...dragTransition,\n ...transition,\n };\n // If we're not animating on an externally-provided `MotionValue` we can use the\n // component's animation controls which will handle interactions with whileHover (etc),\n // otherwise we just have to animate the `MotionValue` itself.\n return this.startAxisValueAnimation(axis, inertia);\n });\n // Run all animations and then resolve the new drag constraints.\n return Promise.all(momentumAnimations).then(onDragTransitionEnd);\n }\n startAxisValueAnimation(axis, transition) {\n const axisValue = this.getAxisMotionValue(axis);\n addValueToWillChange(this.visualElement, axis);\n return axisValue.start(animateMotionValue(axis, axisValue, 0, transition, this.visualElement, false));\n }\n stopAnimation() {\n eachAxis((axis) => this.getAxisMotionValue(axis).stop());\n }\n /**\n * Drag works differently depending on which props are provided.\n *\n * - If _dragX and _dragY are provided, we output the gesture delta directly to those motion values.\n * - Otherwise, we apply the delta to the x/y motion values.\n */\n getAxisMotionValue(axis) {\n const dragKey = `_drag${axis.toUpperCase()}`;\n const props = this.visualElement.getProps();\n const externalMotionValue = props[dragKey];\n return externalMotionValue\n ? externalMotionValue\n : this.visualElement.getValue(axis, this.visualElement.latestValues[axis] ?? 0);\n }\n snapToCursor(point) {\n eachAxis((axis) => {\n const { drag } = this.getProps();\n // If we're not dragging this axis, do an early return.\n if (!shouldDrag(axis, drag, this.currentDirection))\n return;\n const { projection } = this.visualElement;\n const axisValue = this.getAxisMotionValue(axis);\n if (projection && projection.layout) {\n const { min, max } = projection.layout.layoutBox[axis];\n /**\n * The layout measurement includes the current transform value,\n * so we need to add it back to get the correct snap position.\n * This fixes an issue where elements with initial coordinates\n * would snap to the wrong position on the first drag.\n */\n const current = axisValue.get() || 0;\n axisValue.set(point[axis] - mixNumber(min, max, 0.5) + current);\n }\n });\n }\n /**\n * When the viewport resizes we want to check if the measured constraints\n * have changed and, if so, reposition the element within those new constraints\n * relative to where it was before the resize.\n */\n scalePositionWithinConstraints() {\n if (!this.visualElement.current)\n return;\n const { drag, dragConstraints } = this.getProps();\n const { projection } = this.visualElement;\n if (!isRefObject(dragConstraints) || !projection || !this.constraints)\n return;\n /**\n * Stop current animations as there can be visual glitching if we try to do\n * this mid-animation\n */\n this.stopAnimation();\n /**\n * Record the relative position of the dragged element relative to the\n * constraints box and save as a progress value.\n */\n const boxProgress = { x: 0, y: 0 };\n eachAxis((axis) => {\n const axisValue = this.getAxisMotionValue(axis);\n if (axisValue && this.constraints !== false) {\n const latest = axisValue.get();\n boxProgress[axis] = calcOrigin({ min: latest, max: latest }, this.constraints[axis]);\n }\n });\n /**\n * Update the layout of this element and resolve the latest drag constraints\n */\n const { transformTemplate } = this.visualElement.getProps();\n this.visualElement.current.style.transform = transformTemplate\n ? transformTemplate({}, \"\")\n : \"none\";\n projection.root && projection.root.updateScroll();\n projection.updateLayout();\n /**\n * Reset constraints so resolveConstraints() will recalculate them\n * with the freshly measured layout rather than returning the cached value.\n */\n this.constraints = false;\n this.resolveConstraints();\n /**\n * For each axis, calculate the current progress of the layout axis\n * within the new constraints.\n */\n eachAxis((axis) => {\n if (!shouldDrag(axis, drag, null))\n return;\n /**\n * Calculate a new transform based on the previous box progress\n */\n const axisValue = this.getAxisMotionValue(axis);\n const { min, max } = this.constraints[axis];\n axisValue.set(mixNumber(min, max, boxProgress[axis]));\n });\n /**\n * Flush the updated transform to the DOM synchronously to prevent\n * a visual flash at the element's CSS layout position (0,0) when\n * the transform was stripped for measurement.\n */\n this.visualElement.render();\n }\n addListeners() {\n if (!this.visualElement.current)\n return;\n elementDragControls.set(this.visualElement, this);\n const element = this.visualElement.current;\n /**\n * Attach a pointerdown event listener on this DOM element to initiate drag tracking.\n */\n const stopPointerListener = addPointerEvent(element, \"pointerdown\", (event) => {\n const { drag, dragListener = true } = this.getProps();\n const target = event.target;\n /**\n * Only block drag if clicking on a text input child element\n * (input, textarea, select, contenteditable) where users might\n * want to select text or interact with the control.\n *\n * Buttons and links don't block drag since they don't have\n * click-and-move actions of their own.\n */\n const isClickingTextInputChild = target !== element && isElementTextInput(target);\n if (drag && dragListener && !isClickingTextInputChild) {\n this.start(event);\n }\n });\n /**\n * If using ref-based constraints, observe both the draggable element\n * and the constraint container for size changes via ResizeObserver.\n * Setup is deferred because dragConstraints.current is null when\n * addListeners first runs (React hasn't committed the ref yet).\n */\n let stopResizeObservers;\n const measureDragConstraints = () => {\n const { dragConstraints } = this.getProps();\n if (isRefObject(dragConstraints) && dragConstraints.current) {\n this.constraints = this.resolveRefConstraints();\n if (!stopResizeObservers) {\n stopResizeObservers = startResizeObservers(element, dragConstraints.current, () => this.scalePositionWithinConstraints());\n }\n }\n };\n const { projection } = this.visualElement;\n const stopMeasureLayoutListener = projection.addEventListener(\"measure\", measureDragConstraints);\n if (projection && !projection.layout) {\n projection.root && projection.root.updateScroll();\n projection.updateLayout();\n }\n frame.read(measureDragConstraints);\n /**\n * Attach a window resize listener to scale the draggable target within its defined\n * constraints as the window resizes.\n */\n const stopResizeListener = addDomEvent(window, \"resize\", () => this.scalePositionWithinConstraints());\n /**\n * If the element's layout changes, calculate the delta and apply that to\n * the drag gesture's origin point.\n */\n const stopLayoutUpdateListener = projection.addEventListener(\"didUpdate\", (({ delta, hasLayoutChanged }) => {\n if (this.isDragging && hasLayoutChanged) {\n eachAxis((axis) => {\n const motionValue = this.getAxisMotionValue(axis);\n if (!motionValue)\n return;\n this.originPoint[axis] += delta[axis].translate;\n motionValue.set(motionValue.get() + delta[axis].translate);\n });\n this.visualElement.render();\n }\n }));\n return () => {\n stopResizeListener();\n stopPointerListener();\n stopMeasureLayoutListener();\n stopLayoutUpdateListener && stopLayoutUpdateListener();\n stopResizeObservers && stopResizeObservers();\n };\n }\n getProps() {\n const props = this.visualElement.getProps();\n const { drag = false, dragDirectionLock = false, dragPropagation = false, dragConstraints = false, dragElastic = defaultElastic, dragMomentum = true, } = props;\n return {\n ...props,\n drag,\n dragDirectionLock,\n dragPropagation,\n dragConstraints,\n dragElastic,\n dragMomentum,\n };\n }\n}\nfunction skipFirstCall(callback) {\n let isFirst = true;\n return () => {\n if (isFirst) {\n isFirst = false;\n return;\n }\n callback();\n };\n}\nfunction startResizeObservers(element, constraintsElement, onResize) {\n const stopElement = resize(element, skipFirstCall(onResize));\n const stopContainer = resize(constraintsElement, skipFirstCall(onResize));\n return () => {\n stopElement();\n stopContainer();\n };\n}\nfunction shouldDrag(direction, drag, currentDirection) {\n return ((drag === true || drag === direction) &&\n (currentDirection === null || currentDirection === direction));\n}\n/**\n * Based on an x/y offset determine the current drag direction. If both axis' offsets are lower\n * than the provided threshold, return `null`.\n *\n * @param offset - The x/y offset from origin.\n * @param lockThreshold - (Optional) - the minimum absolute offset before we can determine a drag direction.\n */\nfunction getCurrentDirection(offset, lockThreshold = 10) {\n let direction = null;\n if (Math.abs(offset.y) > lockThreshold) {\n direction = \"y\";\n }\n else if (Math.abs(offset.x) > lockThreshold) {\n direction = \"x\";\n }\n return direction;\n}\nexport function expectsResolvedDragConstraints({ dragConstraints, onMeasureDragConstraints, }) {\n return isRefObject(dragConstraints) && !!onMeasureDragConstraints;\n}\n//# sourceMappingURL=VisualElementDragControls.js.map","import { isDragging } from './is-active.mjs';\n\nfunction setDragLock(axis) {\n if (axis === \"x\" || axis === \"y\") {\n if (isDragging[axis]) {\n return null;\n }\n else {\n isDragging[axis] = true;\n return () => {\n isDragging[axis] = false;\n };\n }\n }\n else {\n if (isDragging.x || isDragging.y) {\n return null;\n }\n else {\n isDragging.x = isDragging.y = true;\n return () => {\n isDragging.x = isDragging.y = false;\n };\n }\n }\n}\n\nexport { setDragLock };\n//# sourceMappingURL=set-active.mjs.map\n","import { Feature, frame } from \"motion-dom\";\nimport { noop } from \"motion-utils\";\nimport { addPointerEvent } from \"../../events/add-pointer-event\";\nimport { getContextWindow } from \"../../utils/get-context-window\";\nimport { PanSession } from \"./PanSession\";\nconst asyncHandler = (handler) => (event, info) => {\n if (handler) {\n frame.update(() => handler(event, info), false, true);\n }\n};\nexport class PanGesture extends Feature {\n constructor() {\n super(...arguments);\n this.removePointerDownListener = noop;\n }\n onPointerDown(pointerDownEvent) {\n this.session = new PanSession(pointerDownEvent, this.createPanHandlers(), {\n transformPagePoint: this.node.getTransformPagePoint(),\n contextWindow: getContextWindow(this.node),\n });\n }\n createPanHandlers() {\n const { onPanSessionStart, onPanStart, onPan, onPanEnd } = this.node.getProps();\n return {\n onSessionStart: asyncHandler(onPanSessionStart),\n onStart: asyncHandler(onPanStart),\n onMove: asyncHandler(onPan),\n onEnd: (event, info) => {\n delete this.session;\n if (onPanEnd) {\n frame.postRender(() => onPanEnd(event, info));\n }\n },\n };\n }\n mount() {\n this.removePointerDownListener = addPointerEvent(this.node.current, \"pointerdown\", (event) => this.onPointerDown(event));\n }\n update() {\n this.session && this.session.updateHandlers(this.createPanHandlers());\n }\n unmount() {\n this.removePointerDownListener();\n this.session && this.session.end();\n }\n}\n//# sourceMappingURL=index.js.map","\"use client\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { frame, microtask, globalProjectionState } from \"motion-dom\";\nimport { Component, useContext } from \"react\";\nimport { usePresence } from \"../../../components/AnimatePresence/use-presence\";\nimport { LayoutGroupContext, } from \"../../../context/LayoutGroupContext\";\nimport { SwitchLayoutGroupContext } from \"../../../context/SwitchLayoutGroupContext\";\n/**\n * Track whether we've taken any snapshots yet. If not,\n * we can safely skip notification of didUpdate.\n *\n * Difficult to capture in a test but to prevent flickering\n * we must set this to true either on update or unmount.\n * Running `next-env/layout-id` in Safari will show this behaviour if broken.\n */\nlet hasTakenAnySnapshot = false;\nclass MeasureLayoutWithContext extends Component {\n /**\n * This only mounts projection nodes for components that\n * need measuring, we might want to do it for all components\n * in order to incorporate transforms\n */\n componentDidMount() {\n const { visualElement, layoutGroup, switchLayoutGroup, layoutId } = this.props;\n const { projection } = visualElement;\n if (projection) {\n if (layoutGroup.group)\n layoutGroup.group.add(projection);\n if (switchLayoutGroup && switchLayoutGroup.register && layoutId) {\n switchLayoutGroup.register(projection);\n }\n if (hasTakenAnySnapshot) {\n projection.root.didUpdate();\n }\n projection.addEventListener(\"animationComplete\", () => {\n this.safeToRemove();\n });\n projection.setOptions({\n ...projection.options,\n layoutDependency: this.props.layoutDependency,\n onExitComplete: () => this.safeToRemove(),\n });\n }\n globalProjectionState.hasEverUpdated = true;\n }\n getSnapshotBeforeUpdate(prevProps) {\n const { layoutDependency, visualElement, drag, isPresent } = this.props;\n const { projection } = visualElement;\n if (!projection)\n return null;\n /**\n * TODO: We use this data in relegate to determine whether to\n * promote a previous element. There's no guarantee its presence data\n * will have updated by this point - if a bug like this arises it will\n * have to be that we markForRelegation and then find a new lead some other way,\n * perhaps in didUpdate\n */\n projection.isPresent = isPresent;\n if (prevProps.layoutDependency !== layoutDependency) {\n projection.setOptions({\n ...projection.options,\n layoutDependency,\n });\n }\n hasTakenAnySnapshot = true;\n if (drag ||\n prevProps.layoutDependency !== layoutDependency ||\n layoutDependency === undefined ||\n prevProps.isPresent !== isPresent) {\n projection.willUpdate();\n }\n else {\n this.safeToRemove();\n }\n if (prevProps.isPresent !== isPresent) {\n if (isPresent) {\n projection.promote();\n }\n else if (!projection.relegate()) {\n /**\n * If there's another stack member taking over from this one,\n * it's in charge of the exit animation and therefore should\n * be in charge of the safe to remove. Otherwise we call it here.\n */\n frame.postRender(() => {\n const stack = projection.getStack();\n if (!stack || !stack.members.length) {\n this.safeToRemove();\n }\n });\n }\n }\n return null;\n }\n componentDidUpdate() {\n const { visualElement, layoutAnchor } = this.props;\n const { projection } = visualElement;\n if (projection) {\n projection.options.layoutAnchor = layoutAnchor;\n projection.root.didUpdate();\n microtask.postRender(() => {\n if (!projection.currentAnimation && projection.isLead()) {\n this.safeToRemove();\n }\n });\n }\n }\n componentWillUnmount() {\n const { visualElement, layoutGroup, switchLayoutGroup: promoteContext, } = this.props;\n const { projection } = visualElement;\n hasTakenAnySnapshot = true;\n if (projection) {\n projection.scheduleCheckAfterUnmount();\n if (layoutGroup && layoutGroup.group)\n layoutGroup.group.remove(projection);\n if (promoteContext && promoteContext.deregister)\n promoteContext.deregister(projection);\n }\n }\n safeToRemove() {\n const { safeToRemove } = this.props;\n safeToRemove && safeToRemove();\n }\n render() {\n return null;\n }\n}\nexport function MeasureLayout(props) {\n const [isPresent, safeToRemove] = usePresence();\n const layoutGroup = useContext(LayoutGroupContext);\n return (_jsx(MeasureLayoutWithContext, { ...props, layoutGroup: layoutGroup, switchLayoutGroup: useContext(SwitchLayoutGroupContext), isPresent: isPresent, safeToRemove: safeToRemove }));\n}\n//# sourceMappingURL=MeasureLayout.js.map","\"use client\";\nimport { useCallback, useContext, useEffect, useId } from \"react\";\nimport { PresenceContext, } from \"../../context/PresenceContext\";\n/**\n * When a component is the child of `AnimatePresence`, it can use `usePresence`\n * to access information about whether it's still present in the React tree.\n *\n * ```jsx\n * import { usePresence } from \"framer-motion\"\n *\n * export const Component = () => {\n * const [isPresent, safeToRemove] = usePresence()\n *\n * useEffect(() => {\n * !isPresent && setTimeout(safeToRemove, 1000)\n * }, [isPresent])\n *\n * return

\n * }\n * ```\n *\n * If `isPresent` is `false`, it means that a component has been removed from the tree,\n * but `AnimatePresence` won't really remove it until `safeToRemove` has been called.\n *\n * @public\n */\nexport function usePresence(subscribe = true) {\n const context = useContext(PresenceContext);\n if (context === null)\n return [true, null];\n const { isPresent, onExitComplete, register } = context;\n // It's safe to call the following hooks conditionally (after an early return) because the context will always\n // either be null or non-null for the lifespan of the component.\n const id = useId();\n useEffect(() => {\n if (subscribe) {\n return register(id);\n }\n }, [subscribe]);\n const safeToRemove = useCallback(() => subscribe && onExitComplete && onExitComplete(id), [id, onExitComplete, subscribe]);\n return !isPresent && onExitComplete ? [false, safeToRemove] : [true];\n}\n/**\n * Similar to `usePresence`, except `useIsPresent` simply returns whether or not the component is present.\n * There is no `safeToRemove` function.\n *\n * ```jsx\n * import { useIsPresent } from \"framer-motion\"\n *\n * export const Component = () => {\n * const isPresent = useIsPresent()\n *\n * useEffect(() => {\n * !isPresent && console.log(\"I've been removed!\")\n * }, [isPresent])\n *\n * return
\n * }\n * ```\n *\n * @public\n */\nexport function useIsPresent() {\n return isPresent(useContext(PresenceContext));\n}\nexport function isPresent(context) {\n return context === null ? true : context.isPresent;\n}\n//# sourceMappingURL=use-presence.js.map","import { DragGesture } from \"../../gestures/drag\";\nimport { PanGesture } from \"../../gestures/pan\";\nimport { HTMLProjectionNode } from \"../../projection\";\nimport { MeasureLayout } from \"./layout/MeasureLayout\";\nexport const drag = {\n pan: {\n Feature: PanGesture,\n },\n drag: {\n Feature: DragGesture,\n ProjectionNode: HTMLProjectionNode,\n MeasureLayout,\n },\n};\n//# sourceMappingURL=drag.js.map","import { Feature } from \"motion-dom\";\nimport { noop } from \"motion-utils\";\nimport { VisualElementDragControls } from \"./VisualElementDragControls\";\nexport class DragGesture extends Feature {\n constructor(node) {\n super(node);\n this.removeGroupControls = noop;\n this.removeListeners = noop;\n this.controls = new VisualElementDragControls(node);\n }\n mount() {\n // If we've been provided a DragControls for manual control over the drag gesture,\n // subscribe this component to it on mount.\n const { dragControls } = this.node.getProps();\n if (dragControls) {\n this.removeGroupControls = dragControls.subscribe(this.controls);\n }\n this.removeListeners = this.controls.addListeners() || noop;\n }\n update() {\n const { dragControls } = this.node.getProps();\n const { dragControls: prevDragControls } = this.node.prevProps || {};\n if (dragControls !== prevDragControls) {\n this.removeGroupControls();\n if (dragControls) {\n this.removeGroupControls = dragControls.subscribe(this.controls);\n }\n }\n }\n unmount() {\n this.removeGroupControls();\n this.removeListeners();\n /**\n * In React 19, during list reorder reconciliation, components may\n * briefly unmount and remount while the drag is still active. If we're\n * actively dragging, we should NOT end the pan session - it will\n * continue tracking pointer events via its window-level listeners.\n *\n * The pan session will be properly cleaned up when:\n * 1. The drag ends naturally (pointerup/pointercancel)\n * 2. The component is truly removed from the DOM\n */\n if (!this.controls.isDragging) {\n this.controls.endPanSession();\n }\n }\n}\n//# sourceMappingURL=index.js.map","import { Feature, frame, hover } from \"motion-dom\";\nimport { extractEventInfo } from \"../events/event-info\";\nfunction handleHoverEvent(node, event, lifecycle) {\n const { props } = node;\n if (node.animationState && props.whileHover) {\n node.animationState.setActive(\"whileHover\", lifecycle === \"Start\");\n }\n const eventName = (\"onHover\" + lifecycle);\n const callback = props[eventName];\n if (callback) {\n frame.postRender(() => callback(event, extractEventInfo(event)));\n }\n}\nexport class HoverGesture extends Feature {\n mount() {\n const { current } = this.node;\n if (!current)\n return;\n this.unmount = hover(current, (_element, startEvent) => {\n handleHoverEvent(this.node, startEvent, \"Start\");\n return (endEvent) => handleHoverEvent(this.node, endEvent, \"End\");\n });\n }\n unmount() { }\n}\n//# sourceMappingURL=hover.js.map","import { Feature, frame, press } from \"motion-dom\";\nimport { extractEventInfo } from \"../events/event-info\";\nfunction handlePressEvent(node, event, lifecycle) {\n const { props } = node;\n if (node.current instanceof HTMLButtonElement && node.current.disabled) {\n return;\n }\n if (node.animationState && props.whileTap) {\n node.animationState.setActive(\"whileTap\", lifecycle === \"Start\");\n }\n const eventName = (\"onTap\" + (lifecycle === \"End\" ? \"\" : lifecycle));\n const callback = props[eventName];\n if (callback) {\n frame.postRender(() => callback(event, extractEventInfo(event)));\n }\n}\nexport class PressGesture extends Feature {\n mount() {\n const { current } = this.node;\n if (!current)\n return;\n const { globalTapTarget, propagate } = this.node.props;\n this.unmount = press(current, (_element, startEvent) => {\n handlePressEvent(this.node, startEvent, \"Start\");\n return (endEvent, { success }) => handlePressEvent(this.node, endEvent, success ? \"End\" : \"Cancel\");\n }, {\n useGlobalTarget: globalTapTarget,\n stopPropagation: propagate?.tap === false,\n });\n }\n unmount() { }\n}\n//# sourceMappingURL=press.js.map","/**\n * Map an IntersectionHandler callback to an element. We only ever make one handler for one\n * element, so even though these handlers might all be triggered by different\n * observers, we can keep them in the same map.\n */\nconst observerCallbacks = new WeakMap();\n/**\n * Multiple observers can be created for multiple element/document roots. Each with\n * different settings. So here we store dictionaries of observers to each root,\n * using serialised settings (threshold/margin) as lookup keys.\n */\nconst observers = new WeakMap();\nconst fireObserverCallback = (entry) => {\n const callback = observerCallbacks.get(entry.target);\n callback && callback(entry);\n};\nconst fireAllObserverCallbacks = (entries) => {\n entries.forEach(fireObserverCallback);\n};\nfunction initIntersectionObserver({ root, ...options }) {\n const lookupRoot = root || document;\n /**\n * If we don't have an observer lookup map for this root, create one.\n */\n if (!observers.has(lookupRoot)) {\n observers.set(lookupRoot, {});\n }\n const rootObservers = observers.get(lookupRoot);\n const key = JSON.stringify(options);\n /**\n * If we don't have an observer for this combination of root and settings,\n * create one.\n */\n if (!rootObservers[key]) {\n rootObservers[key] = new IntersectionObserver(fireAllObserverCallbacks, { root, ...options });\n }\n return rootObservers[key];\n}\nexport function observeIntersection(element, options, callback) {\n const rootInteresectionObserver = initIntersectionObserver(options);\n observerCallbacks.set(element, callback);\n rootInteresectionObserver.observe(element);\n return () => {\n observerCallbacks.delete(element);\n rootInteresectionObserver.unobserve(element);\n };\n}\n//# sourceMappingURL=observers.js.map","import { Feature } from \"motion-dom\";\nimport { observeIntersection } from \"./observers\";\nconst thresholdNames = {\n some: 0,\n all: 1,\n};\nexport class InViewFeature extends Feature {\n constructor() {\n super(...arguments);\n this.hasEnteredView = false;\n this.isInView = false;\n }\n startObserver() {\n this.stopObserver?.();\n const { viewport = {} } = this.node.getProps();\n const { root, margin: rootMargin, amount = \"some\", once } = viewport;\n const options = {\n root: root ? root.current : undefined,\n rootMargin,\n threshold: typeof amount === \"number\" ? amount : thresholdNames[amount],\n };\n const onIntersectionUpdate = (entry) => {\n const { isIntersecting } = entry;\n /**\n * If there's been no change in the viewport state, early return.\n */\n if (this.isInView === isIntersecting)\n return;\n this.isInView = isIntersecting;\n /**\n * Handle hasEnteredView. If this is only meant to run once, and\n * element isn't visible, early return. Otherwise set hasEnteredView to true.\n */\n if (once && !isIntersecting && this.hasEnteredView) {\n return;\n }\n else if (isIntersecting) {\n this.hasEnteredView = true;\n }\n if (this.node.animationState) {\n this.node.animationState.setActive(\"whileInView\", isIntersecting);\n }\n /**\n * Use the latest committed props rather than the ones in scope\n * when this observer is created\n */\n const { onViewportEnter, onViewportLeave } = this.node.getProps();\n const callback = isIntersecting ? onViewportEnter : onViewportLeave;\n callback && callback(entry);\n };\n this.stopObserver = observeIntersection(this.node.current, options, onIntersectionUpdate);\n }\n mount() {\n this.startObserver();\n }\n update() {\n if (typeof IntersectionObserver === \"undefined\")\n return;\n const { props, prevProps } = this.node;\n const hasOptionsChanged = [\"amount\", \"margin\", \"root\"].some(hasViewportOptionChanged(props, prevProps));\n if (hasOptionsChanged) {\n this.startObserver();\n }\n }\n unmount() {\n this.stopObserver?.();\n this.hasEnteredView = false;\n this.isInView = false;\n }\n}\nfunction hasViewportOptionChanged({ viewport = {} }, { viewport: prevViewport = {} } = {}) {\n return (name) => viewport[name] !== prevViewport[name];\n}\n//# sourceMappingURL=index.js.map","import { HoverGesture } from \"../../gestures/hover\";\nimport { FocusGesture } from \"../../gestures/focus\";\nimport { PressGesture } from \"../../gestures/press\";\nimport { InViewFeature } from \"./viewport\";\nexport const gestureAnimations = {\n inView: {\n Feature: InViewFeature,\n },\n tap: {\n Feature: PressGesture,\n },\n focus: {\n Feature: FocusGesture,\n },\n hover: {\n Feature: HoverGesture,\n },\n};\n//# sourceMappingURL=gestures.js.map","import { animations } from \"../../../motion/features/animations\";\nimport { drag } from \"../../../motion/features/drag\";\nimport { gestureAnimations } from \"../../../motion/features/gestures\";\nimport { layout } from \"../../../motion/features/layout\";\nexport const featureBundle = {\n ...animations,\n ...gestureAnimations,\n ...drag,\n ...layout,\n};\n//# sourceMappingURL=feature-bundle.js.map","import { Feature, addDomEvent } from \"motion-dom\";\nimport { pipe } from \"motion-utils\";\nexport class FocusGesture extends Feature {\n constructor() {\n super(...arguments);\n this.isActive = false;\n }\n onFocus() {\n let isFocusVisible = false;\n /**\n * If this element doesn't match focus-visible then don't\n * apply whileHover. But, if matches throws that focus-visible\n * is not a valid selector then in that browser outline styles will be applied\n * to the element by default and we want to match that behaviour with whileFocus.\n */\n try {\n isFocusVisible = this.node.current.matches(\":focus-visible\");\n }\n catch (e) {\n isFocusVisible = true;\n }\n if (!isFocusVisible || !this.node.animationState)\n return;\n this.node.animationState.setActive(\"whileFocus\", true);\n this.isActive = true;\n }\n onBlur() {\n if (!this.isActive || !this.node.animationState)\n return;\n this.node.animationState.setActive(\"whileFocus\", false);\n this.isActive = false;\n }\n mount() {\n this.unmount = pipe(addDomEvent(this.node.current, \"focus\", () => this.onFocus()), addDomEvent(this.node.current, \"blur\", () => this.onBlur()));\n }\n unmount() { }\n}\n//# sourceMappingURL=focus.js.map","import { HTMLProjectionNode } from \"motion-dom\";\nimport { MeasureLayout } from \"./layout/MeasureLayout\";\nexport const layout = {\n layout: {\n ProjectionNode: HTMLProjectionNode,\n MeasureLayout,\n },\n};\n//# sourceMappingURL=layout.js.map","import { createMotionComponent } from \"../../../motion\";\nimport { createDomVisualElement } from \"../../dom/create-visual-element\";\nimport { featureBundle } from \"./feature-bundle\";\nexport function createMotionComponentWithFeatures(Component, options) {\n return createMotionComponent(Component, options, featureBundle, createDomVisualElement);\n}\n//# sourceMappingURL=create.js.map","\"use client\";\nimport { createMotionComponentWithFeatures as createMotionComponent } from \"./create\";\n/**\n * HTML components\n */\nexport const MotionA = /*@__PURE__*/ createMotionComponent(\"a\");\nexport const MotionAbbr = /*@__PURE__*/ createMotionComponent(\"abbr\");\nexport const MotionAddress = /*@__PURE__*/ createMotionComponent(\"address\");\nexport const MotionArea = /*@__PURE__*/ createMotionComponent(\"area\");\nexport const MotionArticle = /*@__PURE__*/ createMotionComponent(\"article\");\nexport const MotionAside = /*@__PURE__*/ createMotionComponent(\"aside\");\nexport const MotionAudio = /*@__PURE__*/ createMotionComponent(\"audio\");\nexport const MotionB = /*@__PURE__*/ createMotionComponent(\"b\");\nexport const MotionBase = /*@__PURE__*/ createMotionComponent(\"base\");\nexport const MotionBdi = /*@__PURE__*/ createMotionComponent(\"bdi\");\nexport const MotionBdo = /*@__PURE__*/ createMotionComponent(\"bdo\");\nexport const MotionBig = /*@__PURE__*/ createMotionComponent(\"big\");\nexport const MotionBlockquote = \n/*@__PURE__*/ createMotionComponent(\"blockquote\");\nexport const MotionBody = /*@__PURE__*/ createMotionComponent(\"body\");\nexport const MotionButton = /*@__PURE__*/ createMotionComponent(\"button\");\nexport const MotionCanvas = /*@__PURE__*/ createMotionComponent(\"canvas\");\nexport const MotionCaption = /*@__PURE__*/ createMotionComponent(\"caption\");\nexport const MotionCite = /*@__PURE__*/ createMotionComponent(\"cite\");\nexport const MotionCode = /*@__PURE__*/ createMotionComponent(\"code\");\nexport const MotionCol = /*@__PURE__*/ createMotionComponent(\"col\");\nexport const MotionColgroup = /*@__PURE__*/ createMotionComponent(\"colgroup\");\nexport const MotionData = /*@__PURE__*/ createMotionComponent(\"data\");\nexport const MotionDatalist = /*@__PURE__*/ createMotionComponent(\"datalist\");\nexport const MotionDd = /*@__PURE__*/ createMotionComponent(\"dd\");\nexport const MotionDel = /*@__PURE__*/ createMotionComponent(\"del\");\nexport const MotionDetails = /*@__PURE__*/ createMotionComponent(\"details\");\nexport const MotionDfn = /*@__PURE__*/ createMotionComponent(\"dfn\");\nexport const MotionDialog = /*@__PURE__*/ createMotionComponent(\"dialog\");\nexport const MotionDiv = /*@__PURE__*/ createMotionComponent(\"div\");\nexport const MotionDl = /*@__PURE__*/ createMotionComponent(\"dl\");\nexport const MotionDt = /*@__PURE__*/ createMotionComponent(\"dt\");\nexport const MotionEm = /*@__PURE__*/ createMotionComponent(\"em\");\nexport const MotionEmbed = /*@__PURE__*/ createMotionComponent(\"embed\");\nexport const MotionFieldset = /*@__PURE__*/ createMotionComponent(\"fieldset\");\nexport const MotionFigcaption = \n/*@__PURE__*/ createMotionComponent(\"figcaption\");\nexport const MotionFigure = /*@__PURE__*/ createMotionComponent(\"figure\");\nexport const MotionFooter = /*@__PURE__*/ createMotionComponent(\"footer\");\nexport const MotionForm = /*@__PURE__*/ createMotionComponent(\"form\");\nexport const MotionH1 = /*@__PURE__*/ createMotionComponent(\"h1\");\nexport const MotionH2 = /*@__PURE__*/ createMotionComponent(\"h2\");\nexport const MotionH3 = /*@__PURE__*/ createMotionComponent(\"h3\");\nexport const MotionH4 = /*@__PURE__*/ createMotionComponent(\"h4\");\nexport const MotionH5 = /*@__PURE__*/ createMotionComponent(\"h5\");\nexport const MotionH6 = /*@__PURE__*/ createMotionComponent(\"h6\");\nexport const MotionHead = /*@__PURE__*/ createMotionComponent(\"head\");\nexport const MotionHeader = /*@__PURE__*/ createMotionComponent(\"header\");\nexport const MotionHgroup = /*@__PURE__*/ createMotionComponent(\"hgroup\");\nexport const MotionHr = /*@__PURE__*/ createMotionComponent(\"hr\");\nexport const MotionHtml = /*@__PURE__*/ createMotionComponent(\"html\");\nexport const MotionI = /*@__PURE__*/ createMotionComponent(\"i\");\nexport const MotionIframe = /*@__PURE__*/ createMotionComponent(\"iframe\");\nexport const MotionImg = /*@__PURE__*/ createMotionComponent(\"img\");\nexport const MotionInput = /*@__PURE__*/ createMotionComponent(\"input\");\nexport const MotionIns = /*@__PURE__*/ createMotionComponent(\"ins\");\nexport const MotionKbd = /*@__PURE__*/ createMotionComponent(\"kbd\");\nexport const MotionKeygen = /*@__PURE__*/ createMotionComponent(\"keygen\");\nexport const MotionLabel = /*@__PURE__*/ createMotionComponent(\"label\");\nexport const MotionLegend = /*@__PURE__*/ createMotionComponent(\"legend\");\nexport const MotionLi = /*@__PURE__*/ createMotionComponent(\"li\");\nexport const MotionLink = /*@__PURE__*/ createMotionComponent(\"link\");\nexport const MotionMain = /*@__PURE__*/ createMotionComponent(\"main\");\nexport const MotionMap = /*@__PURE__*/ createMotionComponent(\"map\");\nexport const MotionMark = /*@__PURE__*/ createMotionComponent(\"mark\");\nexport const MotionMenu = /*@__PURE__*/ createMotionComponent(\"menu\");\nexport const MotionMenuitem = /*@__PURE__*/ createMotionComponent(\"menuitem\");\nexport const MotionMeter = /*@__PURE__*/ createMotionComponent(\"meter\");\nexport const MotionNav = /*@__PURE__*/ createMotionComponent(\"nav\");\nexport const MotionObject = /*@__PURE__*/ createMotionComponent(\"object\");\nexport const MotionOl = /*@__PURE__*/ createMotionComponent(\"ol\");\nexport const MotionOptgroup = /*@__PURE__*/ createMotionComponent(\"optgroup\");\nexport const MotionOption = /*@__PURE__*/ createMotionComponent(\"option\");\nexport const MotionOutput = /*@__PURE__*/ createMotionComponent(\"output\");\nexport const MotionP = /*@__PURE__*/ createMotionComponent(\"p\");\nexport const MotionParam = /*@__PURE__*/ createMotionComponent(\"param\");\nexport const MotionPicture = /*@__PURE__*/ createMotionComponent(\"picture\");\nexport const MotionPre = /*@__PURE__*/ createMotionComponent(\"pre\");\nexport const MotionProgress = /*@__PURE__*/ createMotionComponent(\"progress\");\nexport const MotionQ = /*@__PURE__*/ createMotionComponent(\"q\");\nexport const MotionRp = /*@__PURE__*/ createMotionComponent(\"rp\");\nexport const MotionRt = /*@__PURE__*/ createMotionComponent(\"rt\");\nexport const MotionRuby = /*@__PURE__*/ createMotionComponent(\"ruby\");\nexport const MotionS = /*@__PURE__*/ createMotionComponent(\"s\");\nexport const MotionSamp = /*@__PURE__*/ createMotionComponent(\"samp\");\nexport const MotionScript = /*@__PURE__*/ createMotionComponent(\"script\");\nexport const MotionSection = /*@__PURE__*/ createMotionComponent(\"section\");\nexport const MotionSelect = /*@__PURE__*/ createMotionComponent(\"select\");\nexport const MotionSmall = /*@__PURE__*/ createMotionComponent(\"small\");\nexport const MotionSource = /*@__PURE__*/ createMotionComponent(\"source\");\nexport const MotionSpan = /*@__PURE__*/ createMotionComponent(\"span\");\nexport const MotionStrong = /*@__PURE__*/ createMotionComponent(\"strong\");\nexport const MotionStyle = /*@__PURE__*/ createMotionComponent(\"style\");\nexport const MotionSub = /*@__PURE__*/ createMotionComponent(\"sub\");\nexport const MotionSummary = /*@__PURE__*/ createMotionComponent(\"summary\");\nexport const MotionSup = /*@__PURE__*/ createMotionComponent(\"sup\");\nexport const MotionTable = /*@__PURE__*/ createMotionComponent(\"table\");\nexport const MotionTbody = /*@__PURE__*/ createMotionComponent(\"tbody\");\nexport const MotionTd = /*@__PURE__*/ createMotionComponent(\"td\");\nexport const MotionTextarea = /*@__PURE__*/ createMotionComponent(\"textarea\");\nexport const MotionTfoot = /*@__PURE__*/ createMotionComponent(\"tfoot\");\nexport const MotionTh = /*@__PURE__*/ createMotionComponent(\"th\");\nexport const MotionThead = /*@__PURE__*/ createMotionComponent(\"thead\");\nexport const MotionTime = /*@__PURE__*/ createMotionComponent(\"time\");\nexport const MotionTitle = /*@__PURE__*/ createMotionComponent(\"title\");\nexport const MotionTr = /*@__PURE__*/ createMotionComponent(\"tr\");\nexport const MotionTrack = /*@__PURE__*/ createMotionComponent(\"track\");\nexport const MotionU = /*@__PURE__*/ createMotionComponent(\"u\");\nexport const MotionUl = /*@__PURE__*/ createMotionComponent(\"ul\");\nexport const MotionVideo = /*@__PURE__*/ createMotionComponent(\"video\");\nexport const MotionWbr = /*@__PURE__*/ createMotionComponent(\"wbr\");\nexport const MotionWebview = /*@__PURE__*/ createMotionComponent(\"webview\");\n/**\n * SVG components\n */\nexport const MotionAnimate = /*@__PURE__*/ createMotionComponent(\"animate\");\nexport const MotionCircle = /*@__PURE__*/ createMotionComponent(\"circle\");\nexport const MotionDefs = /*@__PURE__*/ createMotionComponent(\"defs\");\nexport const MotionDesc = /*@__PURE__*/ createMotionComponent(\"desc\");\nexport const MotionEllipse = /*@__PURE__*/ createMotionComponent(\"ellipse\");\nexport const MotionG = /*@__PURE__*/ createMotionComponent(\"g\");\nexport const MotionImage = /*@__PURE__*/ createMotionComponent(\"image\");\nexport const MotionLine = /*@__PURE__*/ createMotionComponent(\"line\");\nexport const MotionFilter = /*@__PURE__*/ createMotionComponent(\"filter\");\nexport const MotionMarker = /*@__PURE__*/ createMotionComponent(\"marker\");\nexport const MotionMask = /*@__PURE__*/ createMotionComponent(\"mask\");\nexport const MotionMetadata = /*@__PURE__*/ createMotionComponent(\"metadata\");\nexport const MotionPath = /*@__PURE__*/ createMotionComponent(\"path\");\nexport const MotionPattern = /*@__PURE__*/ createMotionComponent(\"pattern\");\nexport const MotionPolygon = /*@__PURE__*/ createMotionComponent(\"polygon\");\nexport const MotionPolyline = /*@__PURE__*/ createMotionComponent(\"polyline\");\nexport const MotionRect = /*@__PURE__*/ createMotionComponent(\"rect\");\nexport const MotionStop = /*@__PURE__*/ createMotionComponent(\"stop\");\nexport const MotionSvg = /*@__PURE__*/ createMotionComponent(\"svg\");\nexport const MotionSymbol = /*@__PURE__*/ createMotionComponent(\"symbol\");\nexport const MotionText = /*@__PURE__*/ createMotionComponent(\"text\");\nexport const MotionTspan = /*@__PURE__*/ createMotionComponent(\"tspan\");\nexport const MotionUse = /*@__PURE__*/ createMotionComponent(\"use\");\nexport const MotionView = /*@__PURE__*/ createMotionComponent(\"view\");\nexport const MotionClipPath = /*@__PURE__*/ createMotionComponent(\"clipPath\");\nexport const MotionFeBlend = /*@__PURE__*/ createMotionComponent(\"feBlend\");\nexport const MotionFeColorMatrix = \n/*@__PURE__*/ createMotionComponent(\"feColorMatrix\");\nexport const MotionFeComponentTransfer = /*@__PURE__*/ createMotionComponent(\"feComponentTransfer\");\nexport const MotionFeComposite = \n/*@__PURE__*/ createMotionComponent(\"feComposite\");\nexport const MotionFeConvolveMatrix = \n/*@__PURE__*/ createMotionComponent(\"feConvolveMatrix\");\nexport const MotionFeDiffuseLighting = \n/*@__PURE__*/ createMotionComponent(\"feDiffuseLighting\");\nexport const MotionFeDisplacementMap = \n/*@__PURE__*/ createMotionComponent(\"feDisplacementMap\");\nexport const MotionFeDistantLight = \n/*@__PURE__*/ createMotionComponent(\"feDistantLight\");\nexport const MotionFeDropShadow = \n/*@__PURE__*/ createMotionComponent(\"feDropShadow\");\nexport const MotionFeFlood = /*@__PURE__*/ createMotionComponent(\"feFlood\");\nexport const MotionFeFuncA = /*@__PURE__*/ createMotionComponent(\"feFuncA\");\nexport const MotionFeFuncB = /*@__PURE__*/ createMotionComponent(\"feFuncB\");\nexport const MotionFeFuncG = /*@__PURE__*/ createMotionComponent(\"feFuncG\");\nexport const MotionFeFuncR = /*@__PURE__*/ createMotionComponent(\"feFuncR\");\nexport const MotionFeGaussianBlur = \n/*@__PURE__*/ createMotionComponent(\"feGaussianBlur\");\nexport const MotionFeImage = /*@__PURE__*/ createMotionComponent(\"feImage\");\nexport const MotionFeMerge = /*@__PURE__*/ createMotionComponent(\"feMerge\");\nexport const MotionFeMergeNode = \n/*@__PURE__*/ createMotionComponent(\"feMergeNode\");\nexport const MotionFeMorphology = \n/*@__PURE__*/ createMotionComponent(\"feMorphology\");\nexport const MotionFeOffset = /*@__PURE__*/ createMotionComponent(\"feOffset\");\nexport const MotionFePointLight = \n/*@__PURE__*/ createMotionComponent(\"fePointLight\");\nexport const MotionFeSpecularLighting = \n/*@__PURE__*/ createMotionComponent(\"feSpecularLighting\");\nexport const MotionFeSpotLight = \n/*@__PURE__*/ createMotionComponent(\"feSpotLight\");\nexport const MotionFeTile = /*@__PURE__*/ createMotionComponent(\"feTile\");\nexport const MotionFeTurbulence = \n/*@__PURE__*/ createMotionComponent(\"feTurbulence\");\nexport const MotionForeignObject = \n/*@__PURE__*/ createMotionComponent(\"foreignObject\");\nexport const MotionLinearGradient = \n/*@__PURE__*/ createMotionComponent(\"linearGradient\");\nexport const MotionRadialGradient = \n/*@__PURE__*/ createMotionComponent(\"radialGradient\");\nexport const MotionTextPath = /*@__PURE__*/ createMotionComponent(\"textPath\");\n//# sourceMappingURL=elements.js.map","import { motion } from \"./\";\nexport const MotionDiv = motion.div;\n//# sourceMappingURL=size.js.map"],"names":["addUniqueItem","arr","item","indexOf","push","removeItem","index","splice","clamp","min","max","v","formatErrorMessage","message","errorCode","warning","invariant","process","env","NODE_ENV","check","console","warn","Error","MotionGlobalConfig","isNumericalString","test","isObject","value","isZeroValueString","memo","callback","result","undefined","noop","any","pipe","transformers","reduce","a","b","progress","from","to","range","SubscriptionManager","constructor","this","subscriptions","add","handler","notify","c","numSubscriptions","length","i","getSize","clear","secondsToMilliseconds","seconds","millisecondsToSeconds","milliseconds","velocityPerSecond","velocity","frameDuration","calcBezier","t","a1","a2","cubicBezier","mX1","mY1","mX2","mY2","getTForX","aX","x","lowerBound","upperBound","currentX","currentT","Math","abs","binarySubdivide","mirrorEasing","easing","p","reverseEasing","backOut","backIn","backInOut","anticipate","pow","circIn","sin","acos","circOut","circInOut","easeIn","easeOut","easeInOut","isBezierDefinition","Array","isArray","easingLookup","linear","easingDefinitionToFunction","definition","x1","y1","x2","y2","LayoutGroupContext","createContext","LazyContext","strict","MotionConfigContext","transformPagePoint","isStatic","reducedMotion","MotionContext","stepsOrder","createRenderBatcher","scheduleNextBatch","allowKeepAlive","runNextFrame","useDefaultElapsed","state","delta","timestamp","isProcessing","flagRunNextFrame","steps","acc","key","thisFrame","Set","nextFrame","flushNextFrame","toKeepAlive","WeakSet","latestFrameData","triggerCallback","has","step","schedule","keepAlive","immediate","queue","cancel","delete","frameData","prevFrame","forEach","createRenderStep","setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender","processBatch","useManualTiming","performance","now","frame","cancelFrame","frameSteps","requestAnimationFrame","clearTime","time","set","newTime","queueMicrotask","checkStringStartsWith","token","startsWith","isCSSVariableName","startsAsVariableToken","isCSSVariableToken","singleCssVariableRegex","split","trim","containsCSSVariable","includes","number","parse","parseFloat","transform","alpha","scale","default","sanitize","round","floatRegex","singleColorRegex","isColorString","type","testProp","Boolean","isNullish","Object","prototype","hasOwnProperty","call","splitColor","aName","bName","cName","match","rgbUnit","clampRgbUnit","rgba","red","green","blue","alpha$1","hex","r","g","substring","parseInt","createUnitType","unit","endsWith","degrees","percent","px","vh","vw","progressPercentage","hsla","hue","saturation","lightness","color","getAnimatableNone","parsed","colorRegex","NUMBER_TOKEN","COLOR_TOKEN","complexRegex","analyseComplexValue","originalValue","toString","values","indexes","var","types","replace","parsedValue","buildTransformer","numSections","output","convertToZero","splitBefore","complex","isNaN","createTransformer","source","info","transformer","map","hueToRgb","q","mixImmediate","mixNumber","mixLinearColor","fromExpo","expo","sqrt","colorTypes","asRGBA","find","model","hslaToRgba","mixColor","fromRGBA","toRGBA","blended","invisibleValues","mixNumber$1","getMixer","mixComplex","mixArray","mixObject","numValues","blendValue","origin","target","template","originStats","targetStats","mixVisibility","orderedOrigin","pointers","originIndex","originValue","matchOrder","mix","mixer","frameloopDriver","passTimestamp","start","stop","generateLinearEasing","duration","resolution","points","numPoints","maxGeneratorDuration","calcGeneratorDuration","generator","next","done","Infinity","springDefaults","granular","calcAngularFreq","undampedFreq","dampingRatio","safeMin","durationKeys","physicsKeys","isSpringType","options","keys","some","getSpringOptions","springOptions","stiffness","damping","mass","isResolvedFromDuration","visualDuration","root","PI","bounce","derived","envelope","derivative","exponentialDecay","exp","d","e","f","initialGuess","approximateRoot","findSpring","spring","optionsOrVisualDuration","keyframes","restSpeed","restDelta","initialVelocity","initialDelta","undampedAngularFreq","isGranularScale","resolveSpring","resolveVelocity","angularFreq","A","sinCoeff","cosCoeff","cos","C","dampedAngularFreq","freqForT","sinh","cosh","P","sinhCoeff","coshCoeff","calculatedDuration","current","currentVelocity","toTransition","applyToOptions","generatorOptions","createGenerator","ease","createGeneratorEasing","getGeneratorVelocity","resolveValue","prevT","inertia","power","timeConstant","bounceDamping","bounceStiffness","modifyTarget","nearestBoundary","amplitude","ideal","calcDelta","calcLatest","applyFriction","latest","timeReachedBoundary","spring$1","checkCatchBoundary","hasUpdatedFrame","interpolate","input","isClamp","inputLength","isZeroDeltaRange","reverse","mixers","customMixer","mixerFactory","numMixers","easingFunction","createMixers","interpolator","progressInRange","defaultOffset","offset","remaining","offsetProgress","fillOffset","keyframeValues","times","easingFunctions","isEasingArray","absoluteTimes","o","convertOffsetToTimes","mapTimeToKeyframe","isNotNull","getFinalKeyframe","repeat","repeatType","finalKeyframe","speed","resolvedKeyframes","filter","transitionTypeMap","decay","tween","replaceTransitionType","transition","WithPromise","updateFinished","finished","_finished","Promise","resolve","notifyFinished","then","onResolve","onReject","percentToProgress","JSAnimation","super","startTime","isStopped","currentTime","holdTime","playbackSpeed","delayState","motionValue","updatedAt","tick","teardown","onStop","initAnimation","play","autoplay","pause","repeatDelay","keyframes$1","generatorFactory","mixKeyframes","mirroredGenerator","resolvedDuration","totalDuration","updateTime","animationTime","sample","delay","onUpdate","timeWithoutDelay","isInDelayPhase","elapsed","frameGenerator","currentIteration","floor","iterationProgress","isAnimationFinished","finish","reject","iterationDuration","driver","s","newSpeed","hasChanged","onPlay","complete","onComplete","onCancel","stopDriver","sampleTime","attachTimeline","timeline","allowFlatten","observe","radToDeg","rad","rotate","angle","atan2","rebaseAngle","matrix2dParsers","y","translateX","translateY","scaleX","scaleY","rotateZ","skewX","atan","skewY","skew","matrix3dParsers","z","translateZ","rotateX","rotateY","defaultTransformValue","name","parseValueFromTransform","matrix3dMatch","parsers","matrix2dMatch","valueParser","convertTransformToNumber","transformPropOrder","transformProps","isNumOrPxType","transformKeys","nonTranslationalTransformKeys","positionalValues","width","paddingLeft","paddingRight","boxSizing","height","paddingTop","paddingBottom","top","_bbox","left","bottom","right","toResolve","isScheduled","anyNeedsMeasurement","isForced","measureAllKeyframes","resolversToMeasure","resolver","needsMeasurement","elementsToMeasure","element","transformsToRestore","Map","removedTransforms","visualElement","getValue","get","removeNonTranslationalTransform","measureInitialState","restore","measureEndState","suspendedScrollY","window","scrollTo","readAllKeyframes","readKeyframes","KeyframeResolver","unresolvedKeyframes","isAsync","scheduleResolve","currentValue","valueAsRead","readValue","fillWildcards","setFinalKeyframe","renderEndStyles","isForcedComplete","resume","setStyle","isCSSVar","style","setProperty","supportsFlags","memoSupports","supportsFlag","memoized","supportsScrollTimeline","ScrollTimeline","supportsLinearEasing","document","createElement","animate","opacity","cubicBezierAsString","supportedWaapiEasing","mapEasingToNativeEasing","segmentEasing","startWaapiAnimation","valueName","pseudoElement","keyframeOptions","fill","iterations","direction","isGenerator","NativeAnimation","finishedTime","manualStartTime","isPseudoElement","applyGeneratorOptions","animation","onfinish","keyframe","updateMotionValue","commitStyles","isConnected","effect","getComputedTiming","Number","wasFinished","playbackRate","playState","newStartTime","rangeStart","rangeEnd","updateTiming","unsupportedEasingFunctions","replaceStringEasing","NativeAnimationExtended","sampleAnimation","setWithVelocity","isAnimatable","makeAnimationInstant","acceleratedValues","browserColorFunctions","colorProperties","supportsWaapi","Element","supportsBrowserAnimation","subject","owner","HTMLElement","SVGElement","transformTemplate","getProps","hasBrowserOnlyColors","AsyncMotionValueAnimation","_animation","stopTimeline","keyframeResolver","createdAt","optionsWithDefaults","KeyframeResolver$1","forced","onKeyframesResolved","sync","isHandoff","resolvedAt","canAnimateValue","originKeyframe","targetKeyframe","isOriginAnimatable","isTargetAnimatable","hasKeyframesChanged","canAnimate","instantAnimations","resolvedOptions","useWaapi","catch","pendingTimeline","_onReject","finally","calcChildStagger","children","child","delayChildren","staggerChildren","staggerDirection","sort","sortNodePosition","numChildren","size","maxStaggerDuration","MotionValue","init","canTrackVelocity","events","updateAndNotify","setPrevFrameValue","prev","setCurrent","change","dependents","dependent","dirty","hasAnimated","prevFrameValue","prevUpdatedAt","onChange","subscription","on","eventName","unsubscribe","clearListeners","eventManagers","attach","passiveEffect","stopPassiveEffect","jump","endAnimation","addDependent","removeDependent","getPrevious","getVelocity","startAnimation","animationStart","animationComplete","clearAnimation","animationCancel","isAnimating","destroy","resolveTransition","parentTransition","inherit","_","rest","getValueTransition","valueTransition","underDampedSpring","keyframesTransition","getDefaultTransition","valueKey","orchestrationKeys","animateMotionValue","isTransitionDefined","assign","shouldSkip","skipAnimations","shouldSkipAnimations","isSync","splitCSSVariableRegex","getVariableValue","depth","fallback","exec","token1","token2","parseCSSVariable","resolved","getComputedStyle","getPropertyValue","trimmed","getValueState","resolveVariantFromProps","props","custom","variants","resolveVariant","positionalKeys","isKeyframesTarget","setMotionValue","hasValue","addValue","resolveFinalValueInKeyframes","isMotionValue","addValueToWillChange","willChange","WillChange","newWillChange","camelToDash","str","toLowerCase","optimizedAppearDataAttribute","getOptimisedAppearId","shouldBlockAnimation","protectedKeys","needsAnimating","shouldBlock","animateTarget","targetAndTransition","transitionOverride","transitionEnd","defaultTransition","reduceMotion","animations","animationTypeState","animationState","getState","path","animateVisualElement","latestValues","valueTarget","MotionHandoffAnimation","appearId","shouldReduceMotion","applyTransitionEnd","setTarget","all","animateVariant","variant","presenceContext","getAnimation","getChildAnimations","variantChildren","forwardDelay","animateChildren","when","first","last","testValueType","dimensionValueTypes","findDimensionValueType","isNone","maxDefaults","applyDefaultFilter","slice","defaultValue","functionRegex","functions","join","mask","int","numberValueTypes","borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","maxWidth","maxHeight","inset","insetBlock","insetBlockStart","insetBlockEnd","insetInline","insetInlineStart","insetInlineEnd","padding","paddingBlock","paddingBlockStart","paddingBlockEnd","paddingInline","paddingInlineStart","paddingInlineEnd","margin","marginTop","marginRight","marginBottom","marginLeft","marginBlock","marginBlockStart","marginBlockEnd","marginInline","marginInlineStart","marginInlineEnd","fontSize","backgroundPositionX","backgroundPositionY","pathRotation","scaleZ","distance","perspective","transformPerspective","originX","originY","originZ","zIndex","fillOpacity","strokeOpacity","numOctaves","defaultValueTypes","backgroundColor","outlineColor","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","WebkitFilter","WebkitMask","getDefaultValueType","customTypes","defaultValueType","invalidTemplates","DOMKeyframesResolver","resolveNoneKeyframes","originType","targetType","noneKeyframeIndexes","animatableTemplate","noneIndex","makeNoneKeyframesAnimatable","pageYOffset","measuredOrigin","measureViewportBox","measureKeyframe","finalKeyframeIndex","unsetTransformName","unsetTransformValue","cornerRadiusProps","resolveElements","elementOrSelector","scope","selectorCache","EventTarget","elements","querySelectorAll","getValueAsType","microtask","isDragging","isDragActive","setupGesture","gestureAbortController","AbortController","passive","signal","abort","hover","onHoverStart","eventOptions","hoverEndCallback","isPressed","deferredHoverEnd","endHover","event","removeEventListener","onPointerLeave","onPointerUp","leaveEvent","pointerType","addEventListener","enterEvent","onHoverEnd","isNodeOrChild","parent","parentElement","isPrimaryPointer","button","isPrimary","keyboardAccessibleElements","textInputElements","isPressing","filterEvents","firePointerEvent","dispatchEvent","PointerEvent","bubbles","isValidPressEvent","claimedPointerDownEvents","press","targetOrSelector","onPressStart","targets","cancelEvents","startPress","startEvent","currentTarget","stopPropagation","onPressEnd","endEventOptions","capture","onPointerEnd","endEvent","success","onPointerCancel","upEvent","useGlobalTarget","cancelEvent","focusEvent","handleKeydown","handleKeyup","enableKeyboardPress","tagName","isContentEditable","isElementKeyboardAccessible","hasAttribute","tabIndex","isSVGElement","resizeHandlers","WeakMap","observer","borderBoxAxis","svgAxis","htmlAxis","borderBoxSize","getBBox","getWidth","getHeight","notifyTarget","notifyAll","entries","resizeElement","ResizeObserver","elementHandlers","unobserve","windowCallbacks","windowResizeHandler","resizeWindow","innerWidth","innerHeight","resize","valueTypes","createBox","visualElementStore","isAnimationControls","isVariantLabel","variantPriorityOrder","variantProps","isControllingVariants","isVariantNode","prefersReducedMotion","hasReducedMotionListener","isBrowser","propEventHandlers","featureDefinitions","setFeatureDefinitions","definitions","VisualElement","scrapeMotionValuesFromProps","_props","_prevProps","_visualElement","reducedMotionConfig","blockInitialAnimation","visualState","features","valueSubscriptions","prevMotionValues","hasBeenMounted","propEventSubscriptions","notifyUpdate","triggerBuild","renderInstance","renderState","projection","renderScheduledAt","scheduleRender","baseTarget","initialValues","initial","skipAnimationsConfig","manuallyAnimateOnMount","initialMotionValues","mount","instance","removeFromVariantTree","addVariantChild","bindToMotionValue","matchMedia","motionMediaQuery","setReducedMotionPreferences","matches","initPrefersReducedMotion","addChild","unmount","remove","removeChild","feature","isMounted","enteringChildren","accelerate","factory","cleanup","valueIsTransform","onBindTransform","removeOnChange","latestValue","isTransformDirty","removeSyncCheck","MotionCheckAppearSync","other","sortInstanceNodePosition","updateFeatures","featureDefinition","isEnabled","Feature","FeatureConstructor","build","measureInstanceViewportBox","getStaticValue","setStaticValue","prevProps","prevPresenceContext","listener","nextValue","prevValue","existingValue","liveStyle","removeValue","updateMotionValuesFromProps","handleChildMotionValue","getVariant","getTransformPagePoint","getClosestVariantNode","closestVariantNode","removeValueFromRenderState","getBaseTargetFromProps","readValueFromInstance","setBaseTarget","getBaseTarget","valueFromInitial","args","scheduleRenderMicrotask","DOMVisualElement","arguments","compareDocumentPosition","vars","childSubscription","textContent","node","convertBoundingBoxToBox","isIdentityScale","hasScale","hasTransform","has2DTranslate","is2DTranslate","scalePoint","point","originPoint","applyPointDelta","translate","boxScale","applyAxisDelta","axis","applyBoxDelta","box","TREE_SCALE_SNAP_MIN","TREE_SCALE_SNAP_MAX","translateAxis","transformAxis","axisTranslate","axisScale","axisOrigin","resolveAxisTranslate","transformBox","sourceBox","resolveBox","transformPoint","topLeft","bottomRight","transformBoxPoints","getBoundingClientRect","translateAlias","numTransforms","buildHTMLStyles","transformOrigin","hasTransformOrigin","valueAsType","transformString","transformIsDefault","valueIsDefault","buildTransform","renderHTML","styleProp","elementStyle","applyProjectionStyles","pixelsToPercent","pixels","correctBorderRadius","correct","correctBoxShadow","treeScale","projectionDelta","original","shadow","xScale","yScale","averageScale","scaleCorrectors","applyTo","boxShadow","isForcedMotionValue","layout","layoutId","prevStyle","newValues","HTMLVisualElement","isProjecting","readTransformValue","computedStyle","dashKeys","array","camelKeys","cssStyleProperties","buildSVGAttrs","attrX","attrY","attrScale","pathLength","pathSpacing","pathOffset","isSVGTag","viewBox","attrs","spacing","useDashCase","buildSVGPath","camelCaseAttributes","tag","scrapeMotionValuesFromProps$1","charAt","toUpperCase","SVGVisualElement","defaultType","getAttribute","_styleProp","setAttribute","renderSVG","numVariantProps","getVariantContext","context","prop","shallowCompare","prevLength","reversePriorityOrder","numAnimationTypes","createAnimateFunction","resolvedDefinition","createAnimationState","createState","isInitialRender","wasReset","buildResolvedTypeValues","animateChanges","changedActiveType","removedKeys","encounteredKeys","removedVariantIndex","typeState","propIsVariant","activeDelta","isActive","isInherited","prevProp","prevResolvedValues","variantDidChange","checkVariantsDidChange","shouldAnimateType","handledRemovedValues","definitionList","resolvedValues","allKeys","markToAnimate","valueHasChanged","willAnimateViaParent","parentVariant","fallbackAnimation","initialTransition","fallbackTarget","shouldAnimate","setActive","setAnimateFunction","makeAnimator","reset","createTypeState","whileInView","whileHover","whileTap","whileDrag","whileFocus","exit","copyAxisInto","originAxis","copyBoxInto","originBox","copyAxisDeltaInto","originDelta","calcLength","calcAxisDelta","calcBoxDelta","calcRelativeAxis","relative","anchor","anchorPoint","calcRelativeAxisPosition","calcRelativePosition","removePointDelta","removeAxisTransforms","transforms","scaleKey","originKey","sourceAxis","removeAxisDelta","xKeys","yKeys","removeBoxTransforms","isAxisDeltaZero","isDeltaZero","axisEquals","axisEqualsRounded","boxEqualsRounded","aspectRatio","axisDeltaEquals","eachAxis","numBorders","asNumber","isPx","getRadius","radiusName","easeCrossfadeIn","compress","easeCrossfadeOut","addDomEvent","compareByDepth","FlatTree","isDirty","resolveMotionValue","NodeStack","members","member","lead","prevLead","inst","snapshot","promote","relegate","isPresent","preserveFollowOpacity","show","updateSnapshot","layoutDependency","prevDep","nextDep","resumeFrom","preserveOpacity","animationValues","isUpdating","isLayoutDirty","crossfade","hide","exitAnimationComplete","onExitComplete","resumingFrom","removeLeadSnapshot","globalProjectionState","hasAnimatedSinceResize","hasEverUpdated","transformAxes","id","resetDistortingTransform","sharedAnimationValues","cancelTreeOptimisedTransformAnimations","projectionNode","hasCheckedOptimisedAppear","MotionHasOptimisedAnimation","MotionCancelOptimisedAnimation","createProjectionNode","attachResizeListener","defaultParent","measureScroll","checkIsScrollRoot","resetTransform","animationId","animationCommitId","isTreeAnimating","isAnimationBlocked","isProjectionDirty","isSharedProjectionDirty","updateManuallyBlocked","updateBlockedByResize","isSVG","needsReset","shouldResetTransform","eventHandlers","hasTreeAnimated","layoutVersion","updateScheduled","scheduleUpdate","projectionUpdateScheduled","checkUpdateFailed","clearAllSnapshots","updateProjection","nodes","propagateDirtyNodes","resolveTargetDelta","calcProjection","cleanDirtyNodes","resolvedRelativeTargetAt","linkedParentVersion","hasProjected","isVisible","animationProgress","sharedNodes","notifyListeners","subscriptionManager","hasListeners","cancelDelay","resizeUnblockUpdate","newInnerWidth","timeout","checkElapsed","finishAnimation","registerSharedNode","hasLayoutChanged","hasRelativeLayoutChanged","newLayout","isTreeAnimationBlocked","relativeTarget","layoutTransition","defaultLayoutTransition","onLayoutAnimationStart","onLayoutAnimationComplete","hasTargetChanged","targetLayout","hasOnlyRelativeTargetChanged","layoutRoot","currentAnimation","animationOptions","setAnimationOrigin","isLead","willUpdate","stack","getStack","blockUpdate","unblockUpdate","isUpdateBlocked","startUpdate","resetSkewAndRotation","getTransformTemplate","shouldNotifyListeners","updateScroll","prevTransformTemplateValue","wasBlockedByResize","forceLayoutMeasure","clearMeasurements","clearIsLayoutDirty","ensureDraggedNodesSnapshotted","resetTransformStyle","updateLayout","notifyLayoutUpdate","didUpdate","clearSnapshot","removeLeadSnapshots","scheduleUpdateProjection","scheduleCheckAfterUnmount","measure","measuredBox","alwaysMeasureLayout","prevLayout","layoutCorrected","layoutBox","phase","layoutScroll","scroll","isRoot","wasRoot","isResetRequested","hasProjection","transformTemplateValue","transformTemplateHasChanged","removeTransform","pageBox","measurePageBox","removeElementScroll","roundAxis","checkNodeWasScrollRoot","boxWithoutScroll","applyTransform","transformOnly","withTransforms","boxWithoutTransform","setTargetDelta","targetDelta","setOptions","forceRelativeParentToResolveTarget","relativeParent","forceRecalculation","getLead","isShared","attemptToResolveRelativeTarget","getClosestProjectingParent","removeRelativeTarget","layoutAnchor","createRelativeTarget","targetWithTransforms","relativeTargetOrigin","parentLayout","canSkip","pendingAnimation","prevTreeScaleX","prevTreeScaleY","treePath","isSharedTransition","treeLength","display","applyTreeDeltas","prevProjectionDelta","createProjectionDeltas","projectionDeltaWithTransform","pathFn","snapshotLatestValues","mixedValues","relativeLayout","isSharedLayoutAnimation","isOnlyMember","shouldCrossfadeOpacity","hasOpacityCrossfade","prevRelativeTarget","interpolateProjection","mixTargetDelta","mixAxisDeltaLinear","mixAxis","follow","opacityExit","borderLabel","followRadius","leadRadius","mixValues","motionValue$1","animateSingleValue","completeAnimation","applyTransformsToTarget","shouldAnimatePositionOnly","animationType","xLength","yLength","config","initialPromotionConfig","shouldPreserveFollowOpacity","getPrevLead","hasDistortingTransform","resetValues","targetStyle","visibility","pointerEvents","valuesToRender","latestTransform","xTranslate","yTranslate","zTranslate","elementScaleX","elementScaleY","buildProjectionTransform","isCSSVariable","corrected","num","resetTree","measuredLayout","axisSnapshot","snapAxis","layoutDelta","visualDelta","parentSnapshot","relativeSnapshot","onBeforeLayoutMeasure","userAgentContains","string","navigator","userAgent","roundPoint","maxDistance","DocumentProjectionNode","ref","documentElement","scrollLeft","body","scrollTop","rootProjectionNode","HTMLProjectionNode","documentNode","position","useCreateMotionContext","getCurrentTreeVariants","useContext","useMemo","variantLabelsAsDependency","createHtmlRenderState","copyRawValuesOnly","useStyle","useInitialMotionValues","useHTMLProps","htmlProps","drag","dragListener","draggable","userSelect","WebkitUserSelect","WebkitTouchCallout","touchAction","onTap","onTapStart","createSvgRenderState","useSVGProps","_isStatic","Component","visualProps","rawStyles","validMotionProps","isValidMotionProp","shouldForward","isValidProp","lowercaseSVGElements","isSVGComponent","useRender","forwardMotionProps","filteredProps","isDom","filterProps","elementProps","Fragment","renderedChildren","PresenceContext","makeLatestValues","scrapeMotionValues","motionValues","checkIsControllingVariants","checkIsVariantNode","isInitialAnimationBlocked","variantToSet","list","makeUseVisualState","make","createRenderState","makeState","useRef","useConstant","useHTMLVisualState","scrapeHTMLMotionValuesFromProps","useSVGVisualState","scrapeSVGMotionValuesFromProps","featureProps","focus","tap","pan","inView","isInitialized","getInitializedFeatureDefinitions","initialFeatureDefinitions","initFeatureDefinitions","motionComponentSymbol","Symbol","for","useMotionRef","externalRef","externalRefContainer","useInsertionEffect","refCleanup","useCallback","onMount","SwitchLayoutGroupContext","isRefObject","useIsomorphicLayoutEffect","useLayoutEffect","useEffect","useVisualElement","createVisualElement","ProjectionNodeConstructor","lazyContext","motionConfig","visualElementRef","hasMountedOnce","renderer","initialLayoutGroupConfig","dragConstraints","layoutCrossfade","getClosestProjectingNode","optimisedAppearId","wantsHandoff","MotionHandoffIsComplete","MotionIsMounted","MotionHandoffMarkAsComplete","allowProjection","createMotionComponent","preloadedFeatures","loadFeatures","useVisualState","MotionDOMComponent","MeasureLayout","configAndProps","useLayoutId","layoutProjection","combined","ProjectionNode","getProjectionFunctionality","_jsxs","Provider","_jsx","displayName","ForwardRefMotionComponent","forwardRef","layoutGroupId","createDomVisualElement","updateAnimationControlsSubscription","unmountControls","subscribe","prevAnimate","isExitComplete","prevIsPresent","exitAnimation","register","extractEventInfo","pageX","pageY","addPointerEvent","addPointerInfo","getContextWindow","ownerDocument","defaultView","overflowStyles","PanSession","handlers","contextWindow","dragSnapToOrigin","distanceThreshold","lastMoveEvent","lastMoveEventInfo","lastRawMoveEventInfo","scrollPositions","removeScrollListeners","onElementScroll","handleScroll","onWindowScroll","updatePoint","getPanInfo","history","isPanStarted","isDistancePastThreshold","xDelta","yDelta","distance2D","onStart","onMove","handlePointerMove","handlePointerUp","end","onEnd","onSessionEnd","resumeAnimation","panInfo","initialInfo","onSessionStart","removeListeners","startScrollTracking","overflowX","overflowY","scrollX","scrollY","isWindow","updateHandlers","subtractPoint","lastDevicePoint","startDevicePoint","timeDelta","timestampedPoint","lastPoint","calcRelativeAxisConstraints","calcViewportAxisConstraints","layoutAxis","constraintsAxis","defaultElastic","resolveAxisElastic","dragElastic","minLabel","maxLabel","resolvePointElastic","label","elementDragControls","VisualElementDragControls","openDragLock","currentDirection","constraints","hasMutatedConstraints","elastic","latestPointerEvent","latestPanInfo","originEvent","snapToCursor","panSession","stopAnimation","dragPropagation","onDragStart","resolveConstraints","getAxisMotionValue","measuredAxis","dragDirectionLock","onDirectionLock","onDrag","lockThreshold","getCurrentDirection","updateAxis","snap","finalEvent","finalPanInfo","onDragEnd","endPanSession","_point","shouldDrag","axisValue","applyConstraints","prevConstraints","resolveRefConstraints","calcRelativeConstraints","resolveDragElastic","relativeConstraints","rebaseAxisConstraints","onMeasureDragConstraints","constraintsElement","constraintsBox","viewportBox","measuredConstraints","calcViewportConstraints","userConstraints","convertBoxToBoundingBox","dragMomentum","dragTransition","onDragTransitionEnd","momentumAnimations","startAxisValueAnimation","dragKey","externalMotionValue","scalePositionWithinConstraints","boxProgress","sourceLength","targetLength","calcProgress","calcOrigin","addListeners","stopPointerListener","isClickingTextInputChild","isElementTextInput","stopResizeObservers","measureDragConstraints","onResize","stopElement","skipFirstCall","stopContainer","startResizeObservers","stopMeasureLayoutListener","stopResizeListener","stopLayoutUpdateListener","isFirst","asyncHandler","hasTakenAnySnapshot","MeasureLayoutWithContext","componentDidMount","layoutGroup","switchLayoutGroup","group","safeToRemove","getSnapshotBeforeUpdate","componentDidUpdate","componentWillUnmount","promoteContext","deregister","useId","usePresence","removePointerDownListener","onPointerDown","pointerDownEvent","session","createPanHandlers","onPanSessionStart","onPanStart","onPan","onPanEnd","removeGroupControls","controls","dragControls","prevDragControls","handleHoverEvent","lifecycle","handlePressEvent","HTMLButtonElement","disabled","observerCallbacks","observers","fireObserverCallback","entry","fireAllObserverCallbacks","observeIntersection","rootInteresectionObserver","lookupRoot","rootObservers","JSON","stringify","IntersectionObserver","initIntersectionObserver","thresholdNames","featureBundle","hasEnteredView","isInView","startObserver","stopObserver","viewport","rootMargin","amount","once","threshold","isIntersecting","onViewportEnter","onViewportLeave","prevViewport","hasViewportOptionChanged","globalTapTarget","propagate","_element","onFocus","isFocusVisible","onBlur","createMotionComponentWithFeatures","MotionDiv"],"mappings":"yRAAA,SAASA,EAAcC,EAAKC,IACE,IAAtBD,EAAIE,QAAQD,IACZD,EAAIG,KAAKF,EACjB,CACA,SAASG,EAAWJ,EAAKC,GACrB,MAAMI,EAAQL,EAAIE,QAAQD,GACtBI,GAAQ,GACRL,EAAIM,OAAOD,EAAO,EAC1B,CCRA,MAAME,EAAQ,CAACC,EAAKC,EAAKC,IACjBA,EAAID,EACGA,EACPC,EAAIF,EACGA,EACJE,ECLX,SAASC,EAAmBC,EAASC,GACjC,OAAOA,EACD,GAAGD,2FAAiGC,IACpGD,CACV,CCFA,IAAIE,EAAU,OACVC,EAAY,OACO,oBAAZC,SACmB,eAA1BA,QAAQC,KAAKC,WACbJ,EAAU,CAACK,EAAOP,EAASC,KAClBM,GAA4B,oBAAZC,SACjBA,QAAQC,KAAKV,EAAmBC,EAASC,KAGjDE,EAAY,CAACI,EAAOP,EAASC,KACzB,IAAKM,EACD,MAAM,IAAIG,MAAMX,EAAmBC,EAASC,MCbxD,MAAMU,EAAqB,CAAA,ECGrBC,EAAqBd,GAAM,+BAA+Be,KAAKf,GCH/DgB,EAAYC,GAA2B,iBAAVA,GAAgC,OAAVA,ECGnDC,EAAqBlB,GAAM,cAAce,KAAKf,GCFpD,SAASmB,EAAKC,GACV,IAAIC,EACJ,MAAO,UACYC,IAAXD,IACAA,EAASD,KACNC,EAEf,CCPA,MAAME,EAAQC,GAAQA,ECMhBC,EAAO,IAAIC,IAAiBA,EAAaC,OAAO,CAACC,EAAGC,IAAO7B,GAAM6B,EAAED,EAAE5B,KCCrE8B,EAAW,CAACC,EAAMC,EAAIf,KACxB,MAAMgB,EAAQD,EAAKD,EACnB,OAAOE,GAAShB,EAAQc,GAAQE,EAAQ,GCR5C,MAAMC,EACF,WAAAC,GACIC,KAAKC,cAAgB,EACzB,CACA,GAAAC,CAAIC,GAEA,OADAlD,EAAc+C,KAAKC,cAAeE,GAC3B,I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,EAAU,SAEnE,CACA,OAAA4F,GAAY,QKhBTsgB,MELe,CAClBhZ,OAAQ,CACJof,eAAgBlH,GAChB6G,oBCFD,SAASwO,GAAkC3T,EAAW/vC,GACzD,OAAO60C,GAAsB9E,EAAW/vC,EAASqiD,GAAerM,GACpE,CC6BO,MCjCM2N,GDiC0B9O,GAAsB"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/size-rollup-scroll.js b/node_modules/framer-motion/dist/size-rollup-scroll.js new file mode 100644 index 0000000..f9a2168 --- /dev/null +++ b/node_modules/framer-motion/dist/size-rollup-scroll.js @@ -0,0 +1,2 @@ +const e=(e,t,n)=>n>t?t:n{},r=()=>{};"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(n=(e,n,r)=>{e||"undefined"==typeof console||console.warn(t(n,r))},r=(e,n,r)=>{if(!e)throw new Error(t(n,r))});const s={},o=e=>"object"==typeof e&&null!==e;const i=e=>e,a=(...e)=>e.reduce((e,t)=>n=>t(e(n))),c=(e,t,n)=>{const r=t-e;return r?(n-e)/r:1},l=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function u(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,a=l.reduce((e,t)=>(e[t]=function(e){let t=new Set,n=new Set,r=!1,s=!1;const o=new WeakSet;let i={delta:0,timestamp:0,isProcessing:!1};function a(t){o.has(t)&&(c.schedule(t),e()),t(i)}const c={schedule:(e,s=!1,i=!1)=>{const a=i&&r?t:n;return s&&o.add(e),a.add(e),e},cancel:e=>{n.delete(e),o.delete(e)},process:e=>{if(i=e,r)return void(s=!0);r=!0;const o=t;t=n,n=o,t.forEach(a),t.clear(),r=!1,s&&(s=!1,c.process(e))}};return c}(i),e),{}),{setup:c,read:u,resolveKeyframes:f,preUpdate:d,update:g,preRender:h,render:p,postRender:m}=a,v=()=>{const i=s.useManualTiming,a=i?o.timestamp:performance.now();n=!1,i||(o.delta=r?1e3/60:Math.max(Math.min(a-o.timestamp,40),1)),o.timestamp=a,o.isProcessing=!0,c.process(o),u.process(o),f.process(o),d.process(o),g.process(o),h.process(o),p.process(o),m.process(o),o.isProcessing=!1,n&&t&&(r=!1,e(v))};return{schedule:l.reduce((t,s)=>{const i=a[s];return t[s]=(t,s=!1,a=!1)=>(n||(n=!0,r=!0,o.isProcessing||e(v)),i.schedule(t,s,a)),t},{}),cancel:e=>{for(let t=0;tt=>"string"==typeof t&&t.startsWith(e))("var(--"),p=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,m={test:e=>"number"==typeof e,parse:parseFloat,transform:e=>e},v={...m,transform:t=>e(0,1,t)},y=e=>Math.round(1e5*e)/1e5,w=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const b=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,x=(e,t)=>n=>Boolean("string"==typeof n&&b.test(n)&&n.startsWith(e)||t&&!function(e){return null==e}(n)&&Object.prototype.hasOwnProperty.call(n,t)),E=(e,t,n)=>r=>{if("string"!=typeof r)return r;const[s,o,i,a]=r.match(w);return{[e]:parseFloat(s),[t]:parseFloat(o),[n]:parseFloat(i),alpha:void 0!==a?parseFloat(a):1}},W={...m,transform:t=>Math.round((t=>e(0,255,t))(t))},L={test:x("rgb","red"),parse:E("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+W.transform(e)+", "+W.transform(t)+", "+W.transform(n)+", "+y(v.transform(r))+")"};const A={test:x("#"),parse:function(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}},transform:L.transform},S=(e=>({test:t=>"string"==typeof t&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}))("%"),M={test:x("hsl","hue"),parse:E("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+S.transform(y(t))+", "+S.transform(y(n))+", "+y(v.transform(r))+")"},B={test:e=>L.test(e)||A.test(e)||M.test(e),parse:e=>L.test(e)?L.parse(e):M.test(e)?M.parse(e):A.parse(e),transform:e=>"string"==typeof e?e:e.hasOwnProperty("red")?L.transform(e):M.transform(e),getAnimatableNone:e=>{const t=B.parse(e);return t.alpha=0,B.transform(t)}},T=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const $="number",O="color",H=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function z(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let o=0;const i=t.replace(H,e=>(B.test(e)?(r.color.push(o),s.push(O),n.push(B.parse(e))):e.startsWith("var(")?(r.var.push(o),s.push("var"),n.push(e)):(r.number.push(o),s.push($),n.push(parseFloat(e))),++o,"${}")).split("${}");return{values:n,split:i,indexes:r,types:s}}function F({split:e,types:t}){const n=e.length;return r=>{let s="";for(let o=0;o{return"number"==typeof e?t?.trim().endsWith("/")?e:0:"number"==typeof(n=e)?0:B.test(n)?B.getAnimatableNone(n):n;var n};const k={test:function(e){return isNaN(e)&&"string"==typeof e&&(e.match(w)?.length||0)+(e.match(T)?.length||0)>0},parse:function(e){return z(e).values},createTransformer:function(e){return F(z(e))},getAnimatableNone:function(e){const t=z(e);return F(t)(t.values.map((e,n)=>N(e,t.split[n])))}};function P(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function R(e,t){return n=>n>0?t:e}const q=(e,t,n)=>e+(t-e)*n,V=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},j=[A,L,M];function U(e){const t=(r=e,j.find(e=>e.test(r)));var r;if(n(Boolean(t),`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!Boolean(t))return!1;let s=t.parse(e);return t===M&&(s=function({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,n/=100;let s=0,o=0,i=0;if(t/=100){const r=n<.5?n*(1+t):n+t-n*t,a=2*n-r;s=P(a,r,e+1/3),o=P(a,r,e),i=P(a,r,e-1/3)}else s=o=i=n;return{red:Math.round(255*s),green:Math.round(255*o),blue:Math.round(255*i),alpha:r}}(s)),s}const C=(e,t)=>{const n=U(e),r=U(t);if(!n||!r)return R(e,t);const s={...n};return e=>(s.red=V(n.red,r.red,e),s.green=V(n.green,r.green,e),s.blue=V(n.blue,r.blue,e),s.alpha=q(n.alpha,r.alpha,e),L.transform(s))},G=new Set(["none","hidden"]);function I(e,t){return n=>q(e,t,n)}function D(e){return"number"==typeof e?I:"string"==typeof e?h(t=e)&&p.test(t.split("/*")[0].trim())?R:B.test(e)?C:J:Array.isArray(e)?K:"object"==typeof e?B.test(e)?C:_:R;var t}function K(e,t){const n=[...e],r=n.length,s=e.map((e,n)=>D(e)(e,t[n]));return e=>{for(let t=0;t{for(const t in r)n[t]=r[t](e);return n}}const J=(e,t)=>{const r=k.createTransformer(t),s=z(e),o=z(t);return s.indexes.var.length===o.indexes.var.length&&s.indexes.color.length===o.indexes.color.length&&s.indexes.number.length>=o.indexes.number.length?G.has(e)&&!o.values.length||G.has(t)&&!s.values.length?function(e,t){return G.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}(e,t):a(K(function(e,t){const n=[],r={color:0,var:0,number:0};for(let s=0;sn[0];if(2===f&&n[0]===n[1])return()=>n[1];const d=t[0]===t[1];t[0]>t[f-1]&&(t=[...t].reverse(),n=[...n].reverse());const g=function(e,t,n){const r=[],o=n||s.mix||Q,c=e.length-1;for(let n=0;n{if(d&&e1)for(;rp(e(t[0],t[f-1],n)):p}function Y(e){const t=[0];return function(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=c(0,t,r);e.push(q(n,1,s))}}(t,e.length-1),t}const Z={};function ee(e,t){const n=function(e){let t;return()=>(void 0===t&&(t=e()),t)}(e);return()=>Z[t]??n()}const te=ee(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),ne=ee(()=>void 0!==window.ViewTimeline,"viewTimeline");function re(e){return o(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const se=new WeakMap;let oe;const ie=(e,t,n)=>(r,s)=>{return s&&s[0]?s[0][e+"Size"]:o(i=r)&&"ownerSVGElement"in i&&"getBBox"in r?r.getBBox()[t]:r[n];var i},ae=ie("inline","width","offsetWidth"),ce=ie("block","height","offsetHeight");function le({target:e,borderBoxSize:t}){se.get(e)?.forEach(n=>{n(e,{get width(){return ae(e,t)},get height(){return ce(e,t)}})})}function ue(e){e.forEach(le)}function fe(e,t){oe||"undefined"!=typeof ResizeObserver&&(oe=new ResizeObserver(ue));const n=function(e){if(null==e)return[];if(e instanceof EventTarget)return[e];if("string"==typeof e){const t=document.querySelectorAll(e);return t?Array.from(t):[]}return Array.from(e).filter(e=>null!=e)}(e);return n.forEach(e=>{let n=se.get(e);n||(n=new Set,se.set(e,n)),n.add(t),oe?.observe(e)}),()=>{n.forEach(e=>{const n=se.get(e);n?.delete(t),n?.size||oe?.unobserve(e)})}}const de=new Set;let ge;function he(e){return de.add(e),ge||(ge=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};de.forEach(t=>t(e))},window.addEventListener("resize",ge)),()=>{de.delete(e),de.size||"function"!=typeof ge||(window.removeEventListener("resize",ge),ge=void 0)}}function pe(e,t){let n;const r=()=>{const{currentTime:r}=t,s=(null===r?0:r.value)/100;n!==s&&e(s),n=s};return f.preUpdate(r,!0),()=>d(r)}function me(e){return"undefined"!=typeof window&&(e?ne():te())}const ve={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function ye(e,t,n,r){const s=n[t],{length:o,position:i}=ve[t],a=s.current,l=n.time;s.current=Math.abs(e[`scroll${i}`]),s.scrollLength=e[`scroll${o}`]-e[`client${o}`],s.offset.length=0,s.offset[0]=0,s.offset[1]=s.scrollLength,s.progress=c(0,s.scrollLength,s.current);const u=r-l;var f,d;s.velocity=u>50?0:(f=s.current-a,(d=u)?f*(1e3/d):0)}const we={start:0,center:.5,end:1};function be(e,t,n=0){let r=0;if(e in we&&(e=we[e]),"string"==typeof e){const t=parseFloat(e);e.endsWith("px")?r=t:e.endsWith("%")?e=t/100:e.endsWith("vw")?r=t/100*document.documentElement.clientWidth:e.endsWith("vh")?r=t/100*document.documentElement.clientHeight:e=t}return"number"==typeof e&&(r=t*e),n+r}const xe=[0,0];function Ee(e,t,n,r){let s=Array.isArray(e)?e:xe,o=0,i=0;return"number"==typeof e?s=[e,e]:"string"==typeof e&&(s=(e=e.trim()).includes(" ")?e.split(" "):[e,we[e]?e:"0"]),o=be(s[0],n,r),i=be(s[1],t),o-i}const We={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},Le={x:0,y:0};function Ae(t,n,r){const{offset:s=We.All}=r,{target:o=t,axis:i="y"}=r,a="y"===i?"height":"width",c=o!==t?function(e,t){const n={x:0,y:0};let r=e;for(;r&&r!==t;)if(re(r))n.x+=r.offsetLeft,n.y+=r.offsetTop,r=r.offsetParent;else if("svg"===r.tagName){const e=r.getBoundingClientRect();r=r.parentElement;const t=r.getBoundingClientRect();n.x+=e.left-t.left,n.y+=e.top-t.top}else{if(!(r instanceof SVGGraphicsElement))break;{const{x:e,y:t}=r.getBBox();n.x+=e,n.y+=t;let s=null,o=r.parentNode;for(;!s;)"svg"===o.tagName&&(s=o),o=r.parentNode;r=s}}return n}(o,t):Le,l=o===t?{width:t.scrollWidth,height:t.scrollHeight}:function(e){return"getBBox"in e&&"svg"!==e.tagName?e.getBBox():{width:e.clientWidth,height:e.clientHeight}}(o),u={width:t.clientWidth,height:t.clientHeight};n[i].offset.length=0;let f=!n[i].interpolate;const d=s.length;for(let e=0;e{!function(e,t=e,n){if(n.x.targetOffset=0,n.y.targetOffset=0,t!==e){let r=t;for(;r&&r!==e;)n.x.targetOffset+=r.offsetLeft,n.y.targetOffset+=r.offsetTop,r=r.offsetParent}n.x.targetLength=t===e?t.scrollWidth:t.clientWidth,n.y.targetLength=t===e?t.scrollHeight:t.clientHeight,n.x.containerLength=e.clientWidth,n.y.containerLength=e.clientHeight}(e,r.target,n),function(e,t,n){ye(e,"x",t,n),ye(e,"y",t,n),t.time=n}(e,n,t),(r.offset||r.target)&&Ae(e,n,r)},notify:()=>t(n)}}const Me=new WeakMap,Be=new WeakMap,Te=new WeakMap,$e=new WeakMap,Oe=new WeakMap,He=e=>e===document.scrollingElement?window:e;function ze(e,{container:t=document.scrollingElement,trackContentSize:n=!1,...r}={}){if(!t)return i;let s=Te.get(t);s||(s=new Set,Te.set(t,s));const o=Se(t,e,{time:0,x:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0},y:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}},r);if(s.add(o),!Me.has(t)){const e=()=>{for(const e of s)e.measure(g.timestamp);f.preUpdate(n)},n=()=>{for(const e of s)e.notify()},r=()=>f.read(e);Me.set(t,r);const o=He(t);window.addEventListener("resize",r),t!==document.documentElement&&Be.set(t,(c=r,"function"==typeof(a=t)?he(a):fe(a,c))),o.addEventListener("scroll",r),r()}var a,c;if(n&&!Oe.has(t)){const e=Me.get(t),n={width:t.scrollWidth,height:t.scrollHeight};$e.set(t,n);const r=()=>{const r=t.scrollWidth,s=t.scrollHeight;n.width===r&&n.height===s||(e(),n.width=r,n.height=s)},s=f.read(r,!0);Oe.set(t,s)}const l=Me.get(t);return f.read(l,!1,!0),()=>{d(l);const e=Te.get(t);if(!e)return;if(e.delete(o),e.size)return;const n=Me.get(t);Me.delete(t),n&&(He(t).removeEventListener("scroll",n),Be.get(t)?.(),window.removeEventListener("resize",n));const r=Oe.get(t);r&&(d(r),Oe.delete(t)),$e.delete(t)}}const Fe=[[We.Enter,"entry"],[We.Exit,"exit"],[We.Any,"cover"],[We.All,"contain"]],Ne={start:0,end:1};function ke(e){const t=e.trim().split(/\s+/);if(2!==t.length)return;const n=Ne[t[0]],r=Ne[t[1]];return void 0!==n&&void 0!==r?[n,r]:void 0}function Pe(e,t){const n=function(e){if(2!==e.length)return;const t=[];for(const n of e)if(Array.isArray(n))t.push(n);else{if("string"!=typeof n)return;{const e=ke(n);if(!e)return;t.push(e)}}return t}(e);if(!n)return!1;for(let e=0;e<2;e++){const r=n[e],s=t[e];if(r[0]!==s[0]||r[1]!==s[1])return!1}return!0}function Re(e){if(!e)return{rangeStart:"contain 0%",rangeEnd:"contain 100%"};for(const[t,n]of Fe)if(Pe(e,t))return{rangeStart:`${n} 0%`,rangeEnd:`${n} 100%`}}const qe=new Map;function Ve(e){const t={value:0},n=ze(n=>{t.value=100*n[e.axis].progress},e);return{currentTime:t,cancel:n}}function je({source:e,container:t,...n}){const{axis:r}=n;e&&(t=e);let s=qe.get(t);s||(s=new Map,qe.set(t,s));const o=n.target??"self";let i=s.get(o);i||(i={},s.set(o,i));const a=r+(n.offset??[]).join(",");if(!i[a])if(n.target&&me(n.target)){const e=Re(n.offset);i[a]=e?new ViewTimeline({subject:n.target,axis:r}):Ve({container:t,...n})}else me()?i[a]=new ScrollTimeline({source:t,axis:r}):i[a]=Ve({container:t,...n});return i[a]}function Ue(e,{axis:t="y",container:n=document.scrollingElement,...r}={}){if(!n)return i;const s={axis:t,container:n,...r};return"function"==typeof e?function(e,t){return function(e){return 2===e.length}(e)||function(e){return e&&(e.target||e.offset)}(t)?ze(n=>{e(n[t.axis].progress,n)},t):pe(e,je(t))}(e,s):function(e,t){const n=je(t),r=t.target?Re(t.offset):void 0,s=t.target?me(t.target)&&!!r:me();return e.attachTimeline({timeline:s?n:void 0,...r&&s&&{rangeStart:r.rangeStart,rangeEnd:r.rangeEnd},observe:e=>(e.pause(),pe(t=>{e.time=e.iterationDuration*t},n))})}(e,s)}export{Ue as scroll}; +//# sourceMappingURL=size-rollup-scroll.js.map diff --git a/node_modules/framer-motion/dist/size-rollup-scroll.js.map b/node_modules/framer-motion/dist/size-rollup-scroll.js.map new file mode 100644 index 0000000..ad8a8df --- /dev/null +++ b/node_modules/framer-motion/dist/size-rollup-scroll.js.map @@ -0,0 +1 @@ +{"version":3,"file":"size-rollup-scroll.js","sources":["../../motion-utils/dist/es/clamp.mjs","../../motion-utils/dist/es/format-error-message.mjs","../../motion-utils/dist/es/errors.mjs","../../motion-utils/dist/es/global-config.mjs","../../motion-utils/dist/es/is-object.mjs","../../motion-utils/dist/es/noop.mjs","../../motion-utils/dist/es/pipe.mjs","../../motion-utils/dist/es/progress.mjs","../../motion-dom/dist/es/frameloop/order.mjs","../../motion-dom/dist/es/frameloop/batcher.mjs","../../motion-dom/dist/es/frameloop/render-step.mjs","../../motion-dom/dist/es/frameloop/frame.mjs","../../motion-dom/dist/es/animation/utils/is-css-variable.mjs","../../motion-dom/dist/es/value/types/numbers/index.mjs","../../motion-dom/dist/es/value/types/utils/sanitize.mjs","../../motion-dom/dist/es/value/types/utils/float-regex.mjs","../../motion-dom/dist/es/value/types/utils/single-color-regex.mjs","../../motion-dom/dist/es/value/types/color/utils.mjs","../../motion-dom/dist/es/value/types/utils/is-nullish.mjs","../../motion-dom/dist/es/value/types/color/rgba.mjs","../../motion-dom/dist/es/value/types/color/hex.mjs","../../motion-dom/dist/es/value/types/numbers/units.mjs","../../motion-dom/dist/es/value/types/color/hsla.mjs","../../motion-dom/dist/es/value/types/color/index.mjs","../../motion-dom/dist/es/value/types/utils/color-regex.mjs","../../motion-dom/dist/es/value/types/complex/index.mjs","../../motion-dom/dist/es/value/types/color/hsla-to-rgba.mjs","../../motion-dom/dist/es/utils/mix/immediate.mjs","../../motion-dom/dist/es/utils/mix/number.mjs","../../motion-dom/dist/es/utils/mix/color.mjs","../../motion-dom/dist/es/utils/mix/visibility.mjs","../../motion-dom/dist/es/utils/mix/complex.mjs","../../motion-dom/dist/es/utils/mix/index.mjs","../../motion-dom/dist/es/utils/interpolate.mjs","../../motion-dom/dist/es/animation/keyframes/offsets/default.mjs","../../motion-dom/dist/es/animation/keyframes/offsets/fill.mjs","../../motion-dom/dist/es/utils/supports/flags.mjs","../../motion-dom/dist/es/utils/supports/memo.mjs","../../motion-utils/dist/es/memo.mjs","../../motion-dom/dist/es/utils/supports/scroll-timeline.mjs","../../motion-dom/dist/es/utils/is-html-element.mjs","../../motion-dom/dist/es/resize/handle-element.mjs","../../motion-dom/dist/es/utils/is-svg-element.mjs","../../motion-dom/dist/es/utils/resolve-elements.mjs","../../motion-dom/dist/es/resize/handle-window.mjs","../../motion-dom/dist/es/scroll/observe.mjs","../lib/render/dom/scroll/utils/can-use-native-timeline.js","../lib/render/dom/scroll/info.js","../../motion-utils/dist/es/velocity-per-second.mjs","../lib/render/dom/scroll/offsets/edge.js","../lib/render/dom/scroll/offsets/offset.js","../lib/render/dom/scroll/offsets/presets.js","../lib/render/dom/scroll/offsets/index.js","../lib/render/dom/scroll/offsets/inset.js","../lib/render/dom/scroll/on-scroll-handler.js","../lib/render/dom/scroll/track.js","../../motion-dom/dist/es/resize/index.mjs","../lib/render/dom/scroll/utils/offset-to-range.js","../lib/render/dom/scroll/utils/get-timeline.js","../lib/render/dom/scroll/index.js","../lib/render/dom/scroll/attach-function.js","../lib/render/dom/scroll/utils/is-element-tracking.js","../lib/render/dom/scroll/attach-animation.js"],"sourcesContent":["const clamp = (min, max, v) => {\n if (v > max)\n return max;\n if (v < min)\n return min;\n return v;\n};\n\nexport { clamp };\n//# sourceMappingURL=clamp.mjs.map\n","function formatErrorMessage(message, errorCode) {\n return errorCode\n ? `${message}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${errorCode}`\n : message;\n}\n\nexport { formatErrorMessage };\n//# sourceMappingURL=format-error-message.mjs.map\n","import { formatErrorMessage } from './format-error-message.mjs';\n\nlet warning = () => { };\nlet invariant = () => { };\nif (typeof process !== \"undefined\" &&\n process.env?.NODE_ENV !== \"production\") {\n warning = (check, message, errorCode) => {\n if (!check && typeof console !== \"undefined\") {\n console.warn(formatErrorMessage(message, errorCode));\n }\n };\n invariant = (check, message, errorCode) => {\n if (!check) {\n throw new Error(formatErrorMessage(message, errorCode));\n }\n };\n}\n\nexport { invariant, warning };\n//# sourceMappingURL=errors.mjs.map\n","const MotionGlobalConfig = {};\n\nexport { MotionGlobalConfig };\n//# sourceMappingURL=global-config.mjs.map\n","const isObject = (value) => typeof value === \"object\" && value !== null;\n\nexport { isObject };\n//# sourceMappingURL=is-object.mjs.map\n","/*#__NO_SIDE_EFFECTS__*/\nconst noop = (any) => any;\n\nexport { noop };\n//# sourceMappingURL=noop.mjs.map\n","/**\n * Pipe\n * Compose other transformers to run linearily\n * pipe(min(20), max(40))\n * @param {...functions} transformers\n * @return {function}\n */\nconst pipe = (...transformers) => transformers.reduce((a, b) => (v) => b(a(v)));\n\nexport { pipe };\n//# sourceMappingURL=pipe.mjs.map\n","/*\n Progress within given range\n\n Given a lower limit and an upper limit, we return the progress\n (expressed as a number 0-1) represented by the given value, and\n limit that progress to within 0-1.\n*/\n/*#__NO_SIDE_EFFECTS__*/\nconst progress = (from, to, value) => {\n const range = to - from;\n return range ? (value - from) / range : 1;\n};\n\nexport { progress };\n//# sourceMappingURL=progress.mjs.map\n","const stepsOrder = [\n \"setup\", // Compute\n \"read\", // Read\n \"resolveKeyframes\", // Write/Read/Write/Read\n \"preUpdate\", // Compute\n \"update\", // Compute\n \"preRender\", // Compute\n \"render\", // Write\n \"postRender\", // Compute\n];\n\nexport { stepsOrder };\n//# sourceMappingURL=order.mjs.map\n","import { MotionGlobalConfig } from 'motion-utils';\nimport { stepsOrder } from './order.mjs';\nimport { createRenderStep } from './render-step.mjs';\n\nconst maxElapsed = 40;\nfunction createRenderBatcher(scheduleNextBatch, allowKeepAlive) {\n let runNextFrame = false;\n let useDefaultElapsed = true;\n const state = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n };\n const flagRunNextFrame = () => (runNextFrame = true);\n const steps = stepsOrder.reduce((acc, key) => {\n acc[key] = createRenderStep(flagRunNextFrame);\n return acc;\n }, {});\n const { setup, read, resolveKeyframes, preUpdate, update, preRender, render, postRender, } = steps;\n const processBatch = () => {\n const useManualTiming = MotionGlobalConfig.useManualTiming;\n const timestamp = useManualTiming\n ? state.timestamp\n : performance.now();\n runNextFrame = false;\n if (!useManualTiming) {\n state.delta = useDefaultElapsed\n ? 1000 / 60\n : Math.max(Math.min(timestamp - state.timestamp, maxElapsed), 1);\n }\n state.timestamp = timestamp;\n state.isProcessing = true;\n // Unrolled render loop for better per-frame performance\n setup.process(state);\n read.process(state);\n resolveKeyframes.process(state);\n preUpdate.process(state);\n update.process(state);\n preRender.process(state);\n render.process(state);\n postRender.process(state);\n state.isProcessing = false;\n if (runNextFrame && allowKeepAlive) {\n useDefaultElapsed = false;\n scheduleNextBatch(processBatch);\n }\n };\n const wake = () => {\n runNextFrame = true;\n useDefaultElapsed = true;\n if (!state.isProcessing) {\n scheduleNextBatch(processBatch);\n }\n };\n const schedule = stepsOrder.reduce((acc, key) => {\n const step = steps[key];\n acc[key] = (process, keepAlive = false, immediate = false) => {\n if (!runNextFrame)\n wake();\n return step.schedule(process, keepAlive, immediate);\n };\n return acc;\n }, {});\n const cancel = (process) => {\n for (let i = 0; i < stepsOrder.length; i++) {\n steps[stepsOrder[i]].cancel(process);\n }\n };\n return { schedule, cancel, state, steps };\n}\n\nexport { createRenderBatcher };\n//# sourceMappingURL=batcher.mjs.map\n","function createRenderStep(runNextFrame) {\n /**\n * We create and reuse two queues, one to queue jobs for the current frame\n * and one for the next. We reuse to avoid triggering GC after x frames.\n */\n let thisFrame = new Set();\n let nextFrame = new Set();\n /**\n * Track whether we're currently processing jobs in this step. This way\n * we can decide whether to schedule new jobs for this frame or next.\n */\n let isProcessing = false;\n let flushNextFrame = false;\n /**\n * A set of processes which were marked keepAlive when scheduled.\n */\n const toKeepAlive = new WeakSet();\n let latestFrameData = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n };\n function triggerCallback(callback) {\n if (toKeepAlive.has(callback)) {\n step.schedule(callback);\n runNextFrame();\n }\n callback(latestFrameData);\n }\n const step = {\n /**\n * Schedule a process to run on the next frame.\n */\n schedule: (callback, keepAlive = false, immediate = false) => {\n const addToCurrentFrame = immediate && isProcessing;\n const queue = addToCurrentFrame ? thisFrame : nextFrame;\n if (keepAlive)\n toKeepAlive.add(callback);\n queue.add(callback);\n return callback;\n },\n /**\n * Cancel the provided callback from running on the next frame.\n */\n cancel: (callback) => {\n nextFrame.delete(callback);\n toKeepAlive.delete(callback);\n },\n /**\n * Execute all schedule callbacks.\n */\n process: (frameData) => {\n latestFrameData = frameData;\n /**\n * If we're already processing we've probably been triggered by a flushSync\n * inside an existing process. Instead of executing, mark flushNextFrame\n * as true and ensure we flush the following frame at the end of this one.\n */\n if (isProcessing) {\n flushNextFrame = true;\n return;\n }\n isProcessing = true;\n // Swap this frame and the next to avoid GC\n const prevFrame = thisFrame;\n thisFrame = nextFrame;\n nextFrame = prevFrame;\n // Execute this frame\n thisFrame.forEach(triggerCallback);\n // Clear the frame so no callbacks remain. This is to avoid\n // memory leaks should this render step not run for a while.\n thisFrame.clear();\n isProcessing = false;\n if (flushNextFrame) {\n flushNextFrame = false;\n step.process(frameData);\n }\n },\n };\n return step;\n}\n\nexport { createRenderStep };\n//# sourceMappingURL=render-step.mjs.map\n","import { noop } from 'motion-utils';\nimport { createRenderBatcher } from './batcher.mjs';\n\nconst { schedule: frame, cancel: cancelFrame, state: frameData, steps: frameSteps, } = /* @__PURE__ */ createRenderBatcher(typeof requestAnimationFrame !== \"undefined\" ? requestAnimationFrame : noop, true);\n\nexport { cancelFrame, frame, frameData, frameSteps };\n//# sourceMappingURL=frame.mjs.map\n","const checkStringStartsWith = (token) => (key) => typeof key === \"string\" && key.startsWith(token);\nconst isCSSVariableName = \n/*@__PURE__*/ checkStringStartsWith(\"--\");\nconst startsAsVariableToken = \n/*@__PURE__*/ checkStringStartsWith(\"var(--\");\nconst isCSSVariableToken = (value) => {\n const startsWithToken = startsAsVariableToken(value);\n if (!startsWithToken)\n return false;\n // Ensure any comments are stripped from the value as this can harm performance of the regex.\n return singleCssVariableRegex.test(value.split(\"/*\")[0].trim());\n};\nconst singleCssVariableRegex = /var\\(--(?:[\\w-]+\\s*|[\\w-]+\\s*,(?:\\s*[^)(\\s]|\\s*\\((?:[^)(]|\\([^)(]*\\))*\\))+\\s*)\\)$/iu;\n/**\n * Check if a value contains a CSS variable anywhere (e.g. inside calc()).\n * Unlike isCSSVariableToken which checks if the value IS a var() token,\n * this checks if the value CONTAINS var() somewhere in the string.\n */\nfunction containsCSSVariable(value) {\n if (typeof value !== \"string\")\n return false;\n // Strip comments to avoid false positives\n return value.split(\"/*\")[0].includes(\"var(--\");\n}\n\nexport { containsCSSVariable, isCSSVariableName, isCSSVariableToken };\n//# sourceMappingURL=is-css-variable.mjs.map\n","import { clamp } from 'motion-utils';\n\nconst number = {\n test: (v) => typeof v === \"number\",\n parse: parseFloat,\n transform: (v) => v,\n};\nconst alpha = {\n ...number,\n transform: (v) => clamp(0, 1, v),\n};\nconst scale = {\n ...number,\n default: 1,\n};\n\nexport { alpha, number, scale };\n//# sourceMappingURL=index.mjs.map\n","// If this number is a decimal, make it just five decimal places\n// to avoid exponents\nconst sanitize = (v) => Math.round(v * 100000) / 100000;\n\nexport { sanitize };\n//# sourceMappingURL=sanitize.mjs.map\n","const floatRegex = /-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)/gu;\n\nexport { floatRegex };\n//# sourceMappingURL=float-regex.mjs.map\n","const singleColorRegex = /^(?:#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\))$/iu;\n\nexport { singleColorRegex };\n//# sourceMappingURL=single-color-regex.mjs.map\n","import { floatRegex } from '../utils/float-regex.mjs';\nimport { isNullish } from '../utils/is-nullish.mjs';\nimport { singleColorRegex } from '../utils/single-color-regex.mjs';\n\n/**\n * Returns true if the provided string is a color, ie rgba(0,0,0,0) or #000,\n * but false if a number or multiple colors\n */\nconst isColorString = (type, testProp) => (v) => {\n return Boolean((typeof v === \"string\" &&\n singleColorRegex.test(v) &&\n v.startsWith(type)) ||\n (testProp &&\n !isNullish(v) &&\n Object.prototype.hasOwnProperty.call(v, testProp)));\n};\nconst splitColor = (aName, bName, cName) => (v) => {\n if (typeof v !== \"string\")\n return v;\n const [a, b, c, alpha] = v.match(floatRegex);\n return {\n [aName]: parseFloat(a),\n [bName]: parseFloat(b),\n [cName]: parseFloat(c),\n alpha: alpha !== undefined ? parseFloat(alpha) : 1,\n };\n};\n\nexport { isColorString, splitColor };\n//# sourceMappingURL=utils.mjs.map\n","function isNullish(v) {\n return v == null;\n}\n\nexport { isNullish };\n//# sourceMappingURL=is-nullish.mjs.map\n","import { clamp } from 'motion-utils';\nimport { number, alpha } from '../numbers/index.mjs';\nimport { sanitize } from '../utils/sanitize.mjs';\nimport { splitColor, isColorString } from './utils.mjs';\n\nconst clampRgbUnit = (v) => clamp(0, 255, v);\nconst rgbUnit = {\n ...number,\n transform: (v) => Math.round(clampRgbUnit(v)),\n};\nconst rgba = {\n test: /*@__PURE__*/ isColorString(\"rgb\", \"red\"),\n parse: /*@__PURE__*/ splitColor(\"red\", \"green\", \"blue\"),\n transform: ({ red, green, blue, alpha: alpha$1 = 1 }) => \"rgba(\" +\n rgbUnit.transform(red) +\n \", \" +\n rgbUnit.transform(green) +\n \", \" +\n rgbUnit.transform(blue) +\n \", \" +\n sanitize(alpha.transform(alpha$1)) +\n \")\",\n};\n\nexport { rgbUnit, rgba };\n//# sourceMappingURL=rgba.mjs.map\n","import { rgba } from './rgba.mjs';\nimport { isColorString } from './utils.mjs';\n\nfunction parseHex(v) {\n let r = \"\";\n let g = \"\";\n let b = \"\";\n let a = \"\";\n // If we have 6 characters, ie #FF0000\n if (v.length > 5) {\n r = v.substring(1, 3);\n g = v.substring(3, 5);\n b = v.substring(5, 7);\n a = v.substring(7, 9);\n // Or we have 3 characters, ie #F00\n }\n else {\n r = v.substring(1, 2);\n g = v.substring(2, 3);\n b = v.substring(3, 4);\n a = v.substring(4, 5);\n r += r;\n g += g;\n b += b;\n a += a;\n }\n return {\n red: parseInt(r, 16),\n green: parseInt(g, 16),\n blue: parseInt(b, 16),\n alpha: a ? parseInt(a, 16) / 255 : 1,\n };\n}\nconst hex = {\n test: /*@__PURE__*/ isColorString(\"#\"),\n parse: parseHex,\n transform: rgba.transform,\n};\n\nexport { hex };\n//# sourceMappingURL=hex.mjs.map\n","/*#__NO_SIDE_EFFECTS__*/\nconst createUnitType = (unit) => ({\n test: (v) => typeof v === \"string\" && v.endsWith(unit) && v.split(\" \").length === 1,\n parse: parseFloat,\n transform: (v) => `${v}${unit}`,\n});\nconst degrees = /*@__PURE__*/ createUnitType(\"deg\");\nconst percent = /*@__PURE__*/ createUnitType(\"%\");\nconst px = /*@__PURE__*/ createUnitType(\"px\");\nconst vh = /*@__PURE__*/ createUnitType(\"vh\");\nconst vw = /*@__PURE__*/ createUnitType(\"vw\");\nconst progressPercentage = /*@__PURE__*/ (() => ({\n ...percent,\n parse: (v) => percent.parse(v) / 100,\n transform: (v) => percent.transform(v * 100),\n}))();\n\nexport { degrees, percent, progressPercentage, px, vh, vw };\n//# sourceMappingURL=units.mjs.map\n","import { alpha } from '../numbers/index.mjs';\nimport { percent } from '../numbers/units.mjs';\nimport { sanitize } from '../utils/sanitize.mjs';\nimport { splitColor, isColorString } from './utils.mjs';\n\nconst hsla = {\n test: /*@__PURE__*/ isColorString(\"hsl\", \"hue\"),\n parse: /*@__PURE__*/ splitColor(\"hue\", \"saturation\", \"lightness\"),\n transform: ({ hue, saturation, lightness, alpha: alpha$1 = 1 }) => {\n return (\"hsla(\" +\n Math.round(hue) +\n \", \" +\n percent.transform(sanitize(saturation)) +\n \", \" +\n percent.transform(sanitize(lightness)) +\n \", \" +\n sanitize(alpha.transform(alpha$1)) +\n \")\");\n },\n};\n\nexport { hsla };\n//# sourceMappingURL=hsla.mjs.map\n","import { hex } from './hex.mjs';\nimport { hsla } from './hsla.mjs';\nimport { rgba } from './rgba.mjs';\n\nconst color = {\n test: (v) => rgba.test(v) || hex.test(v) || hsla.test(v),\n parse: (v) => {\n if (rgba.test(v)) {\n return rgba.parse(v);\n }\n else if (hsla.test(v)) {\n return hsla.parse(v);\n }\n else {\n return hex.parse(v);\n }\n },\n transform: (v) => {\n return typeof v === \"string\"\n ? v\n : v.hasOwnProperty(\"red\")\n ? rgba.transform(v)\n : hsla.transform(v);\n },\n getAnimatableNone: (v) => {\n const parsed = color.parse(v);\n parsed.alpha = 0;\n return color.transform(parsed);\n },\n};\n\nexport { color };\n//# sourceMappingURL=index.mjs.map\n","const colorRegex = /(?:#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\))/giu;\n\nexport { colorRegex };\n//# sourceMappingURL=color-regex.mjs.map\n","import { color } from '../color/index.mjs';\nimport { colorRegex } from '../utils/color-regex.mjs';\nimport { floatRegex } from '../utils/float-regex.mjs';\nimport { sanitize } from '../utils/sanitize.mjs';\n\nfunction test(v) {\n return (isNaN(v) &&\n typeof v === \"string\" &&\n (v.match(floatRegex)?.length || 0) +\n (v.match(colorRegex)?.length || 0) >\n 0);\n}\nconst NUMBER_TOKEN = \"number\";\nconst COLOR_TOKEN = \"color\";\nconst VAR_TOKEN = \"var\";\nconst VAR_FUNCTION_TOKEN = \"var(\";\nconst SPLIT_TOKEN = \"${}\";\n// this regex consists of the `singleCssVariableRegex|rgbHSLValueRegex|digitRegex`\nconst complexRegex = /var\\s*\\(\\s*--(?:[\\w-]+\\s*|[\\w-]+\\s*,(?:\\s*[^)(\\s]|\\s*\\((?:[^)(]|\\([^)(]*\\))*\\))+\\s*)\\)|#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\)|-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)/giu;\nfunction analyseComplexValue(value) {\n const originalValue = value.toString();\n const values = [];\n const indexes = {\n color: [],\n number: [],\n var: [],\n };\n const types = [];\n let i = 0;\n const tokenised = originalValue.replace(complexRegex, (parsedValue) => {\n if (color.test(parsedValue)) {\n indexes.color.push(i);\n types.push(COLOR_TOKEN);\n values.push(color.parse(parsedValue));\n }\n else if (parsedValue.startsWith(VAR_FUNCTION_TOKEN)) {\n indexes.var.push(i);\n types.push(VAR_TOKEN);\n values.push(parsedValue);\n }\n else {\n indexes.number.push(i);\n types.push(NUMBER_TOKEN);\n values.push(parseFloat(parsedValue));\n }\n ++i;\n return SPLIT_TOKEN;\n });\n const split = tokenised.split(SPLIT_TOKEN);\n return { values, split, indexes, types };\n}\nfunction parseComplexValue(v) {\n return analyseComplexValue(v).values;\n}\nfunction buildTransformer({ split, types }) {\n const numSections = split.length;\n return (v) => {\n let output = \"\";\n for (let i = 0; i < numSections; i++) {\n output += split[i];\n if (v[i] !== undefined) {\n const type = types[i];\n if (type === NUMBER_TOKEN) {\n output += sanitize(v[i]);\n }\n else if (type === COLOR_TOKEN) {\n output += color.transform(v[i]);\n }\n else {\n output += v[i];\n }\n }\n }\n return output;\n };\n}\nfunction createTransformer(source) {\n return buildTransformer(analyseComplexValue(source));\n}\nconst convertNumbersToZero = (v) => typeof v === \"number\" ? 0 : color.test(v) ? color.getAnimatableNone(v) : v;\n/**\n * Convert a parsed value to its zero equivalent, but preserve numbers\n * that act as divisors in CSS calc() expressions.\n *\n * analyseComplexValue extracts numbers from CSS strings and puts the\n * surrounding text into a `split` template array. For example:\n * \"calc(var(--gap) / 5)\" → values: [var(--gap), 5]\n * split: [\"calc(\", \" / \", \")\"]\n *\n * When building a zero-equivalent for animation, naively zeroing all\n * numbers turns the divisor into 0 → \"calc(var(--gap) / 0)\" → NaN.\n * We detect this by checking whether the text preceding a number\n * (split[i]) ends with \"/\" — the CSS calc division operator.\n */\nconst convertToZero = (value, splitBefore) => {\n if (typeof value === \"number\") {\n return splitBefore?.trim().endsWith(\"/\") ? value : 0;\n }\n return convertNumbersToZero(value);\n};\nfunction getAnimatableNone(v) {\n const info = analyseComplexValue(v);\n const transformer = buildTransformer(info);\n return transformer(info.values.map((value, i) => convertToZero(value, info.split[i])));\n}\nconst complex = {\n test,\n parse: parseComplexValue,\n createTransformer,\n getAnimatableNone,\n};\n\nexport { analyseComplexValue, complex };\n//# sourceMappingURL=index.mjs.map\n","// Adapted from https://gist.github.com/mjackson/5311256\nfunction hueToRgb(p, q, t) {\n if (t < 0)\n t += 1;\n if (t > 1)\n t -= 1;\n if (t < 1 / 6)\n return p + (q - p) * 6 * t;\n if (t < 1 / 2)\n return q;\n if (t < 2 / 3)\n return p + (q - p) * (2 / 3 - t) * 6;\n return p;\n}\nfunction hslaToRgba({ hue, saturation, lightness, alpha }) {\n hue /= 360;\n saturation /= 100;\n lightness /= 100;\n let red = 0;\n let green = 0;\n let blue = 0;\n if (!saturation) {\n red = green = blue = lightness;\n }\n else {\n const q = lightness < 0.5\n ? lightness * (1 + saturation)\n : lightness + saturation - lightness * saturation;\n const p = 2 * lightness - q;\n red = hueToRgb(p, q, hue + 1 / 3);\n green = hueToRgb(p, q, hue);\n blue = hueToRgb(p, q, hue - 1 / 3);\n }\n return {\n red: Math.round(red * 255),\n green: Math.round(green * 255),\n blue: Math.round(blue * 255),\n alpha,\n };\n}\n\nexport { hslaToRgba };\n//# sourceMappingURL=hsla-to-rgba.mjs.map\n","function mixImmediate(a, b) {\n return (p) => (p > 0 ? b : a);\n}\n\nexport { mixImmediate };\n//# sourceMappingURL=immediate.mjs.map\n","/*\n Value in range from progress\n\n Given a lower limit and an upper limit, we return the value within\n that range as expressed by progress (usually a number from 0 to 1)\n\n So progress = 0.5 would change\n\n from -------- to\n\n to\n\n from ---- to\n\n E.g. from = 10, to = 20, progress = 0.5 => 15\n\n @param [number]: Lower limit of range\n @param [number]: Upper limit of range\n @param [number]: The progress between lower and upper limits expressed 0-1\n @return [number]: Value as calculated from progress within range (not limited within range)\n*/\nconst mixNumber = (from, to, progress) => {\n return from + (to - from) * progress;\n};\n\nexport { mixNumber };\n//# sourceMappingURL=number.mjs.map\n","import { warning } from 'motion-utils';\nimport { hex } from '../../value/types/color/hex.mjs';\nimport { hsla } from '../../value/types/color/hsla.mjs';\nimport { hslaToRgba } from '../../value/types/color/hsla-to-rgba.mjs';\nimport { rgba } from '../../value/types/color/rgba.mjs';\nimport { mixImmediate } from './immediate.mjs';\nimport { mixNumber } from './number.mjs';\n\n// Linear color space blending\n// Explained https://www.youtube.com/watch?v=LKnqECcg6Gw\n// Demonstrated http://codepen.io/osublake/pen/xGVVaN\nconst mixLinearColor = (from, to, v) => {\n const fromExpo = from * from;\n const expo = v * (to * to - fromExpo) + fromExpo;\n return expo < 0 ? 0 : Math.sqrt(expo);\n};\nconst colorTypes = [hex, rgba, hsla];\nconst getColorType = (v) => colorTypes.find((type) => type.test(v));\nfunction asRGBA(color) {\n const type = getColorType(color);\n warning(Boolean(type), `'${color}' is not an animatable color. Use the equivalent color code instead.`, \"color-not-animatable\");\n if (!Boolean(type))\n return false;\n let model = type.parse(color);\n if (type === hsla) {\n // TODO Remove this cast - needed since Motion's stricter typing\n model = hslaToRgba(model);\n }\n return model;\n}\nconst mixColor = (from, to) => {\n const fromRGBA = asRGBA(from);\n const toRGBA = asRGBA(to);\n if (!fromRGBA || !toRGBA) {\n return mixImmediate(from, to);\n }\n const blended = { ...fromRGBA };\n return (v) => {\n blended.red = mixLinearColor(fromRGBA.red, toRGBA.red, v);\n blended.green = mixLinearColor(fromRGBA.green, toRGBA.green, v);\n blended.blue = mixLinearColor(fromRGBA.blue, toRGBA.blue, v);\n blended.alpha = mixNumber(fromRGBA.alpha, toRGBA.alpha, v);\n return rgba.transform(blended);\n };\n};\n\nexport { mixColor, mixLinearColor };\n//# sourceMappingURL=color.mjs.map\n","const invisibleValues = new Set([\"none\", \"hidden\"]);\n/**\n * Returns a function that, when provided a progress value between 0 and 1,\n * will return the \"none\" or \"hidden\" string only when the progress is that of\n * the origin or target.\n */\nfunction mixVisibility(origin, target) {\n if (invisibleValues.has(origin)) {\n return (p) => (p <= 0 ? origin : target);\n }\n else {\n return (p) => (p >= 1 ? target : origin);\n }\n}\n\nexport { invisibleValues, mixVisibility };\n//# sourceMappingURL=visibility.mjs.map\n","import { pipe, warning } from 'motion-utils';\nimport { isCSSVariableToken } from '../../animation/utils/is-css-variable.mjs';\nimport { color } from '../../value/types/color/index.mjs';\nimport { complex, analyseComplexValue } from '../../value/types/complex/index.mjs';\nimport { mixColor } from './color.mjs';\nimport { mixImmediate } from './immediate.mjs';\nimport { mixNumber as mixNumber$1 } from './number.mjs';\nimport { invisibleValues, mixVisibility } from './visibility.mjs';\n\nfunction mixNumber(a, b) {\n return (p) => mixNumber$1(a, b, p);\n}\nfunction getMixer(a) {\n if (typeof a === \"number\") {\n return mixNumber;\n }\n else if (typeof a === \"string\") {\n return isCSSVariableToken(a)\n ? mixImmediate\n : color.test(a)\n ? mixColor\n : mixComplex;\n }\n else if (Array.isArray(a)) {\n return mixArray;\n }\n else if (typeof a === \"object\") {\n return color.test(a) ? mixColor : mixObject;\n }\n return mixImmediate;\n}\nfunction mixArray(a, b) {\n const output = [...a];\n const numValues = output.length;\n const blendValue = a.map((v, i) => getMixer(v)(v, b[i]));\n return (p) => {\n for (let i = 0; i < numValues; i++) {\n output[i] = blendValue[i](p);\n }\n return output;\n };\n}\nfunction mixObject(a, b) {\n const output = { ...a, ...b };\n const blendValue = {};\n for (const key in output) {\n if (a[key] !== undefined && b[key] !== undefined) {\n blendValue[key] = getMixer(a[key])(a[key], b[key]);\n }\n }\n return (v) => {\n for (const key in blendValue) {\n output[key] = blendValue[key](v);\n }\n return output;\n };\n}\nfunction matchOrder(origin, target) {\n const orderedOrigin = [];\n const pointers = { color: 0, var: 0, number: 0 };\n for (let i = 0; i < target.values.length; i++) {\n const type = target.types[i];\n const originIndex = origin.indexes[type][pointers[type]];\n const originValue = origin.values[originIndex] ?? 0;\n orderedOrigin[i] = originValue;\n pointers[type]++;\n }\n return orderedOrigin;\n}\nconst mixComplex = (origin, target) => {\n const template = complex.createTransformer(target);\n const originStats = analyseComplexValue(origin);\n const targetStats = analyseComplexValue(target);\n const canInterpolate = originStats.indexes.var.length === targetStats.indexes.var.length &&\n originStats.indexes.color.length === targetStats.indexes.color.length &&\n originStats.indexes.number.length >= targetStats.indexes.number.length;\n if (canInterpolate) {\n if ((invisibleValues.has(origin) &&\n !targetStats.values.length) ||\n (invisibleValues.has(target) &&\n !originStats.values.length)) {\n return mixVisibility(origin, target);\n }\n return pipe(mixArray(matchOrder(originStats, targetStats), targetStats.values), template);\n }\n else {\n warning(true, `Complex values '${origin}' and '${target}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`, \"complex-values-different\");\n return mixImmediate(origin, target);\n }\n};\n\nexport { getMixer, mixArray, mixComplex, mixObject };\n//# sourceMappingURL=complex.mjs.map\n","import { getMixer } from './complex.mjs';\nimport { mixNumber } from './number.mjs';\n\nfunction mix(from, to, p) {\n if (typeof from === \"number\" &&\n typeof to === \"number\" &&\n typeof p === \"number\") {\n return mixNumber(from, to, p);\n }\n const mixer = getMixer(from);\n return mixer(from, to);\n}\n\nexport { mix };\n//# sourceMappingURL=index.mjs.map\n","import { invariant, clamp, MotionGlobalConfig, noop, pipe, progress } from 'motion-utils';\nimport { mix } from './mix/index.mjs';\n\nfunction createMixers(output, ease, customMixer) {\n const mixers = [];\n const mixerFactory = customMixer || MotionGlobalConfig.mix || mix;\n const numMixers = output.length - 1;\n for (let i = 0; i < numMixers; i++) {\n let mixer = mixerFactory(output[i], output[i + 1]);\n if (ease) {\n const easingFunction = Array.isArray(ease) ? ease[i] || noop : ease;\n mixer = pipe(easingFunction, mixer);\n }\n mixers.push(mixer);\n }\n return mixers;\n}\n/**\n * Create a function that maps from a numerical input array to a generic output array.\n *\n * Accepts:\n * - Numbers\n * - Colors (hex, hsl, hsla, rgb, rgba)\n * - Complex (combinations of one or more numbers or strings)\n *\n * ```jsx\n * const mixColor = interpolate([0, 1], ['#fff', '#000'])\n *\n * mixColor(0.5) // 'rgba(128, 128, 128, 1)'\n * ```\n *\n * TODO Revisit this approach once we've moved to data models for values,\n * probably not needed to pregenerate mixer functions.\n *\n * @public\n */\nfunction interpolate(input, output, { clamp: isClamp = true, ease, mixer } = {}) {\n const inputLength = input.length;\n invariant(inputLength === output.length, \"Both input and output ranges must be the same length\", \"range-length\");\n /**\n * If we're only provided a single input, we can just make a function\n * that returns the output.\n */\n if (inputLength === 1)\n return () => output[0];\n if (inputLength === 2 && output[0] === output[1])\n return () => output[1];\n const isZeroDeltaRange = input[0] === input[1];\n // If input runs highest -> lowest, reverse both arrays\n if (input[0] > input[inputLength - 1]) {\n input = [...input].reverse();\n output = [...output].reverse();\n }\n const mixers = createMixers(output, ease, mixer);\n const numMixers = mixers.length;\n const interpolator = (v) => {\n if (isZeroDeltaRange && v < input[0])\n return output[0];\n let i = 0;\n if (numMixers > 1) {\n for (; i < input.length - 2; i++) {\n if (v < input[i + 1])\n break;\n }\n }\n const progressInRange = progress(input[i], input[i + 1], v);\n return mixers[i](progressInRange);\n };\n return isClamp\n ? (v) => interpolator(clamp(input[0], input[inputLength - 1], v))\n : interpolator;\n}\n\nexport { interpolate };\n//# sourceMappingURL=interpolate.mjs.map\n","import { fillOffset } from './fill.mjs';\n\nfunction defaultOffset(arr) {\n const offset = [0];\n fillOffset(offset, arr.length - 1);\n return offset;\n}\n\nexport { defaultOffset };\n//# sourceMappingURL=default.mjs.map\n","import { progress } from 'motion-utils';\nimport { mixNumber } from '../../../utils/mix/number.mjs';\n\nfunction fillOffset(offset, remaining) {\n const min = offset[offset.length - 1];\n for (let i = 1; i <= remaining; i++) {\n const offsetProgress = progress(0, remaining, i);\n offset.push(mixNumber(min, 1, offsetProgress));\n }\n}\n\nexport { fillOffset };\n//# sourceMappingURL=fill.mjs.map\n","/**\n * Add the ability for test suites to manually set support flags\n * to better test more environments.\n */\nconst supportsFlags = {};\n\nexport { supportsFlags };\n//# sourceMappingURL=flags.mjs.map\n","import { memo } from 'motion-utils';\nimport { supportsFlags } from './flags.mjs';\n\nfunction memoSupports(callback, supportsFlag) {\n const memoized = memo(callback);\n return () => supportsFlags[supportsFlag] ?? memoized();\n}\n\nexport { memoSupports };\n//# sourceMappingURL=memo.mjs.map\n","/*#__NO_SIDE_EFFECTS__*/\nfunction memo(callback) {\n let result;\n return () => {\n if (result === undefined)\n result = callback();\n return result;\n };\n}\n\nexport { memo };\n//# sourceMappingURL=memo.mjs.map\n","import { memoSupports } from './memo.mjs';\n\nconst supportsScrollTimeline = /* @__PURE__ */ memoSupports(() => window.ScrollTimeline !== undefined, \"scrollTimeline\");\nconst supportsViewTimeline = /* @__PURE__ */ memoSupports(() => window.ViewTimeline !== undefined, \"viewTimeline\");\n\nexport { supportsScrollTimeline, supportsViewTimeline };\n//# sourceMappingURL=scroll-timeline.mjs.map\n","import { isObject } from 'motion-utils';\n\n/**\n * Checks if an element is an HTML element in a way\n * that works across iframes\n */\nfunction isHTMLElement(element) {\n return (isObject(element) &&\n \"offsetHeight\" in element &&\n !(\"ownerSVGElement\" in element));\n}\n\nexport { isHTMLElement };\n//# sourceMappingURL=is-html-element.mjs.map\n","import { isSVGElement } from '../utils/is-svg-element.mjs';\nimport { resolveElements } from '../utils/resolve-elements.mjs';\n\nconst resizeHandlers = new WeakMap();\nlet observer;\nconst getSize = (borderBoxAxis, svgAxis, htmlAxis) => (target, borderBoxSize) => {\n if (borderBoxSize && borderBoxSize[0]) {\n return borderBoxSize[0][(borderBoxAxis + \"Size\")];\n }\n else if (isSVGElement(target) && \"getBBox\" in target) {\n return target.getBBox()[svgAxis];\n }\n else {\n return target[htmlAxis];\n }\n};\nconst getWidth = /*@__PURE__*/ getSize(\"inline\", \"width\", \"offsetWidth\");\nconst getHeight = /*@__PURE__*/ getSize(\"block\", \"height\", \"offsetHeight\");\nfunction notifyTarget({ target, borderBoxSize }) {\n resizeHandlers.get(target)?.forEach((handler) => {\n handler(target, {\n get width() {\n return getWidth(target, borderBoxSize);\n },\n get height() {\n return getHeight(target, borderBoxSize);\n },\n });\n });\n}\nfunction notifyAll(entries) {\n entries.forEach(notifyTarget);\n}\nfunction createResizeObserver() {\n if (typeof ResizeObserver === \"undefined\")\n return;\n observer = new ResizeObserver(notifyAll);\n}\nfunction resizeElement(target, handler) {\n if (!observer)\n createResizeObserver();\n const elements = resolveElements(target);\n elements.forEach((element) => {\n let elementHandlers = resizeHandlers.get(element);\n if (!elementHandlers) {\n elementHandlers = new Set();\n resizeHandlers.set(element, elementHandlers);\n }\n elementHandlers.add(handler);\n observer?.observe(element);\n });\n return () => {\n elements.forEach((element) => {\n const elementHandlers = resizeHandlers.get(element);\n elementHandlers?.delete(handler);\n if (!elementHandlers?.size) {\n observer?.unobserve(element);\n }\n });\n };\n}\n\nexport { resizeElement };\n//# sourceMappingURL=handle-element.mjs.map\n","import { isObject } from 'motion-utils';\n\n/**\n * Checks if an element is an SVG element in a way\n * that works across iframes\n */\nfunction isSVGElement(element) {\n return isObject(element) && \"ownerSVGElement\" in element;\n}\n\nexport { isSVGElement };\n//# sourceMappingURL=is-svg-element.mjs.map\n","function resolveElements(elementOrSelector, scope, selectorCache) {\n if (elementOrSelector == null) {\n return [];\n }\n if (elementOrSelector instanceof EventTarget) {\n return [elementOrSelector];\n }\n else if (typeof elementOrSelector === \"string\") {\n let root = document;\n if (scope) {\n root = scope.current;\n }\n const elements = selectorCache?.[elementOrSelector] ??\n root.querySelectorAll(elementOrSelector);\n return elements ? Array.from(elements) : [];\n }\n return Array.from(elementOrSelector).filter((element) => element != null);\n}\n\nexport { resolveElements };\n//# sourceMappingURL=resolve-elements.mjs.map\n","const windowCallbacks = new Set();\nlet windowResizeHandler;\nfunction createWindowResizeHandler() {\n windowResizeHandler = () => {\n const info = {\n get width() {\n return window.innerWidth;\n },\n get height() {\n return window.innerHeight;\n },\n };\n windowCallbacks.forEach((callback) => callback(info));\n };\n window.addEventListener(\"resize\", windowResizeHandler);\n}\nfunction resizeWindow(callback) {\n windowCallbacks.add(callback);\n if (!windowResizeHandler)\n createWindowResizeHandler();\n return () => {\n windowCallbacks.delete(callback);\n if (!windowCallbacks.size &&\n typeof windowResizeHandler === \"function\") {\n window.removeEventListener(\"resize\", windowResizeHandler);\n windowResizeHandler = undefined;\n }\n };\n}\n\nexport { resizeWindow };\n//# sourceMappingURL=handle-window.mjs.map\n","import { frame, cancelFrame } from '../frameloop/frame.mjs';\n\nfunction observeTimeline(update, timeline) {\n let prevProgress;\n const onFrame = () => {\n const { currentTime } = timeline;\n const percentage = currentTime === null ? 0 : currentTime.value;\n const progress = percentage / 100;\n if (prevProgress !== progress) {\n update(progress);\n }\n prevProgress = progress;\n };\n frame.preUpdate(onFrame, true);\n return () => cancelFrame(onFrame);\n}\n\nexport { observeTimeline };\n//# sourceMappingURL=observe.mjs.map\n","import { supportsScrollTimeline, supportsViewTimeline } from \"motion-dom\";\nexport function canUseNativeTimeline(target) {\n if (typeof window === \"undefined\")\n return false;\n return target ? supportsViewTimeline() : supportsScrollTimeline();\n}\n//# sourceMappingURL=can-use-native-timeline.js.map","import { progress, velocityPerSecond } from \"motion-utils\";\n/**\n * A time in milliseconds, beyond which we consider the scroll velocity to be 0.\n */\nconst maxElapsed = 50;\nconst createAxisInfo = () => ({\n current: 0,\n offset: [],\n progress: 0,\n scrollLength: 0,\n targetOffset: 0,\n targetLength: 0,\n containerLength: 0,\n velocity: 0,\n});\nexport const createScrollInfo = () => ({\n time: 0,\n x: createAxisInfo(),\n y: createAxisInfo(),\n});\nconst keys = {\n x: {\n length: \"Width\",\n position: \"Left\",\n },\n y: {\n length: \"Height\",\n position: \"Top\",\n },\n};\nfunction updateAxisInfo(element, axisName, info, time) {\n const axis = info[axisName];\n const { length, position } = keys[axisName];\n const prev = axis.current;\n const prevTime = info.time;\n axis.current = Math.abs(element[`scroll${position}`]);\n axis.scrollLength = element[`scroll${length}`] - element[`client${length}`];\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 const elapsed = time - prevTime;\n axis.velocity =\n elapsed > maxElapsed\n ? 0\n : velocityPerSecond(axis.current - prev, elapsed);\n}\nexport function updateScrollInfo(element, info, time) {\n updateAxisInfo(element, \"x\", info, time);\n updateAxisInfo(element, \"y\", info, time);\n info.time = time;\n}\n//# sourceMappingURL=info.js.map","/*\n Convert velocity into velocity per second\n*/\n/*#__NO_SIDE_EFFECTS__*/\nconst velocityPerSecond = (velocity, frameDuration) => frameDuration ? velocity * (1000 / frameDuration) : 0;\n\nexport { velocityPerSecond };\n//# sourceMappingURL=velocity-per-second.mjs.map\n","export const namedEdges = {\n start: 0,\n center: 0.5,\n end: 1,\n};\nexport function resolveEdge(edge, length, inset = 0) {\n let delta = 0;\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];\n }\n /**\n * Handle unit values\n */\n if (typeof edge === \"string\") {\n const asNumber = parseFloat(edge);\n if (edge.endsWith(\"px\")) {\n delta = asNumber;\n }\n else if (edge.endsWith(\"%\")) {\n edge = asNumber / 100;\n }\n else if (edge.endsWith(\"vw\")) {\n delta = (asNumber / 100) * document.documentElement.clientWidth;\n }\n else if (edge.endsWith(\"vh\")) {\n delta = (asNumber / 100) * document.documentElement.clientHeight;\n }\n else {\n edge = asNumber;\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 return inset + delta;\n}\n//# sourceMappingURL=edge.js.map","import { namedEdges, resolveEdge } from \"./edge\";\nconst defaultOffset = [0, 0];\nexport function resolveOffset(offset, containerLength, targetLength, targetInset) {\n let offsetDefinition = Array.isArray(offset) ? offset : defaultOffset;\n let targetPoint = 0;\n let containerPoint = 0;\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 }\n else if (typeof offset === \"string\") {\n offset = offset.trim();\n if (offset.includes(\" \")) {\n offsetDefinition = offset.split(\" \");\n }\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] ? offset : `0`];\n }\n }\n targetPoint = resolveEdge(offsetDefinition[0], targetLength, targetInset);\n containerPoint = resolveEdge(offsetDefinition[1], containerLength);\n return targetPoint - containerPoint;\n}\n//# sourceMappingURL=offset.js.map","export const ScrollOffset = {\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//# sourceMappingURL=presets.js.map","import { defaultOffset, interpolate } from \"motion-dom\";\nimport { clamp } from \"motion-utils\";\nimport { calcInset } from \"./inset\";\nimport { resolveOffset } from \"./offset\";\nimport { ScrollOffset } from \"./presets\";\nconst point = { x: 0, y: 0 };\nfunction getTargetSize(target) {\n return \"getBBox\" in target && target.tagName !== \"svg\"\n ? target.getBBox()\n : { width: target.clientWidth, height: target.clientHeight };\n}\nexport function resolveOffsets(container, info, options) {\n const { offset: offsetDefinition = ScrollOffset.All } = options;\n const { target = container, axis = \"y\" } = options;\n const lengthLabel = axis === \"y\" ? \"height\" : \"width\";\n const inset = target !== container ? calcInset(target, container) : point;\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 = target === container\n ? { width: container.scrollWidth, height: container.scrollHeight }\n : getTargetSize(target);\n const containerSize = {\n width: container.clientWidth,\n height: container.clientHeight,\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 * 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 const numOffsets = offsetDefinition.length;\n for (let i = 0; i < numOffsets; i++) {\n const offset = resolveOffset(offsetDefinition[i], containerSize[lengthLabel], targetSize[lengthLabel], inset[axis]);\n if (!hasChanged && offset !== info[axis].interpolatorOffsets[i]) {\n hasChanged = true;\n }\n info[axis].offset[i] = offset;\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(info[axis].offset, defaultOffset(offsetDefinition), { clamp: false });\n info[axis].interpolatorOffsets = [...info[axis].offset];\n }\n info[axis].progress = clamp(0, 1, info[axis].interpolate(info[axis].current));\n}\n//# sourceMappingURL=index.js.map","import { isHTMLElement } from \"motion-dom\";\nexport function calcInset(element, container) {\n const inset = { x: 0, y: 0 };\n let current = 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 }\n else if (current.tagName === \"svg\") {\n /**\n * This isn't an ideal approach to measuring the offset of 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 . Likewise we\n * can't use .getBBox() like most SVG elements as these provide the offset\n * relative to the SVG itself, which for 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 }\n else if (current instanceof SVGGraphicsElement) {\n const { x, y } = current.getBBox();\n inset.x += x;\n inset.y += y;\n let svg = null;\n let parent = current.parentNode;\n while (!svg) {\n if (parent.tagName === \"svg\") {\n svg = parent;\n }\n parent = current.parentNode;\n }\n current = svg;\n }\n else {\n break;\n }\n }\n return inset;\n}\n//# sourceMappingURL=inset.js.map","import { warnOnce } from \"motion-utils\";\nimport { updateScrollInfo } from \"./info\";\nimport { resolveOffsets } from \"./offsets/index\";\nfunction measure(container, target = container, info) {\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;\n while (node && node !== container) {\n info.x.targetOffset += node.offsetLeft;\n info.y.targetOffset += node.offsetTop;\n node = node.offsetParent;\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 * 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 (container &&\n target &&\n target !== container &&\n container !== document.documentElement &&\n container !== document.scrollingElement &&\n container !== document.body) {\n warnOnce(getComputedStyle(container).position !== \"static\", \"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}\nexport function createOnScrollHandler(element, onScroll, info, options = {}) {\n return {\n measure: (time) => {\n measure(element, options.target, info);\n updateScrollInfo(element, info, time);\n if (options.offset || options.target) {\n resolveOffsets(element, info, options);\n }\n },\n notify: () => onScroll(info),\n };\n}\n//# sourceMappingURL=on-scroll-handler.js.map","import { cancelFrame, frame, frameData, resize } from \"motion-dom\";\nimport { noop } from \"motion-utils\";\nimport { createScrollInfo } from \"./info\";\nimport { createOnScrollHandler } from \"./on-scroll-handler\";\nconst scrollListeners = new WeakMap();\nconst resizeListeners = new WeakMap();\nconst onScrollHandlers = new WeakMap();\nconst scrollSize = new WeakMap();\nconst dimensionCheckProcesses = new WeakMap();\nconst getEventTarget = (element) => element === document.scrollingElement ? window : element;\nexport function scrollInfo(onScroll, { container = document.scrollingElement, trackContentSize = false, ...options } = {}) {\n if (!container)\n return noop;\n let containerHandlers = onScrollHandlers.get(container);\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 * Create a new onScroll handler for the provided callback.\n */\n const info = createScrollInfo();\n const containerHandler = createOnScrollHandler(container, onScroll, info, options);\n containerHandlers.add(containerHandler);\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 frame.preUpdate(notifyAll);\n };\n const notifyAll = () => {\n for (const handler of containerHandlers) {\n handler.notify();\n }\n };\n const listener = () => frame.read(measureAll);\n scrollListeners.set(container, listener);\n const target = getEventTarget(container);\n window.addEventListener(\"resize\", listener);\n if (container !== document.documentElement) {\n resizeListeners.set(container, resize(container, listener));\n }\n target.addEventListener(\"scroll\", listener);\n listener();\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 // 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 // Add frame-based scroll dimension checking to detect content changes\n const checkScrollDimensions = () => {\n const newWidth = container.scrollWidth;\n const newHeight = container.scrollHeight;\n if (size.width !== newWidth || size.height !== newHeight) {\n listener();\n size.width = newWidth;\n size.height = newHeight;\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 const listener = scrollListeners.get(container);\n frame.read(listener, false, true);\n return () => {\n cancelFrame(listener);\n /**\n * Check if we even have any handlers for this container.\n */\n const currentHandlers = onScrollHandlers.get(container);\n if (!currentHandlers)\n return;\n currentHandlers.delete(containerHandler);\n if (currentHandlers.size)\n return;\n /**\n * If no more handlers, remove the scroll listener too.\n */\n const scrollListener = scrollListeners.get(container);\n scrollListeners.delete(container);\n if (scrollListener) {\n getEventTarget(container).removeEventListener(\"scroll\", scrollListener);\n resizeListeners.get(container)?.();\n window.removeEventListener(\"resize\", scrollListener);\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//# sourceMappingURL=track.js.map","import { resizeElement } from './handle-element.mjs';\nimport { resizeWindow } from './handle-window.mjs';\n\nfunction resize(a, b) {\n return typeof a === \"function\" ? resizeWindow(a) : resizeElement(a, b);\n}\n\nexport { resize };\n//# sourceMappingURL=index.mjs.map\n","import { ScrollOffset as ScrollOffsetPresets } from \"../offsets/presets\";\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 = [\n [ScrollOffsetPresets.Enter, \"entry\"],\n [ScrollOffsetPresets.Exit, \"exit\"],\n [ScrollOffsetPresets.Any, \"cover\"],\n [ScrollOffsetPresets.All, \"contain\"],\n];\nconst stringToProgress = {\n start: 0,\n end: 1,\n};\nfunction parseStringOffset(s) {\n const parts = s.trim().split(/\\s+/);\n if (parts.length !== 2)\n return undefined;\n const a = stringToProgress[parts[0]];\n const b = stringToProgress[parts[1]];\n if (a === undefined || b === undefined)\n return undefined;\n return [a, b];\n}\nfunction normaliseOffset(offset) {\n if (offset.length !== 2)\n return undefined;\n const result = [];\n for (const item of offset) {\n if (Array.isArray(item)) {\n result.push(item);\n }\n else if (typeof item === \"string\") {\n const parsed = parseStringOffset(item);\n if (!parsed)\n return undefined;\n result.push(parsed);\n }\n else {\n return undefined;\n }\n }\n return result;\n}\nfunction matchesPreset(offset, preset) {\n const normalised = normaliseOffset(offset);\n if (!normalised)\n return false;\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])\n return false;\n }\n return true;\n}\nexport function offsetToViewTimelineRange(offset) {\n if (!offset) {\n return { rangeStart: \"contain 0%\", rangeEnd: \"contain 100%\" };\n }\n for (const [preset, name] of presets) {\n if (matchesPreset(offset, preset)) {\n return { rangeStart: `${name} 0%`, rangeEnd: `${name} 100%` };\n }\n }\n return undefined;\n}\n//# sourceMappingURL=offset-to-range.js.map","import { scrollInfo } from \"../track\";\nimport { canUseNativeTimeline } from \"./can-use-native-timeline\";\nimport { offsetToViewTimelineRange } from \"./offset-to-range\";\nconst timelineCache = new Map();\nfunction scrollTimelineFallback(options) {\n const currentTime = { value: 0 };\n const cancel = scrollInfo((info) => {\n currentTime.value = info[options.axis].progress * 100;\n }, options);\n return { currentTime, cancel };\n}\nexport function getTimeline({ source, container, ...options }) {\n const { axis } = options;\n if (source)\n container = source;\n let containerCache = timelineCache.get(container);\n if (!containerCache) {\n containerCache = new Map();\n timelineCache.set(container, containerCache);\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 const axisKey = axis + (options.offset ?? []).join(\",\");\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 }\n else {\n targetCache[axisKey] = scrollTimelineFallback({\n container,\n ...options,\n });\n }\n }\n else if (canUseNativeTimeline()) {\n targetCache[axisKey] = new ScrollTimeline({\n source: container,\n axis,\n });\n }\n else {\n targetCache[axisKey] = scrollTimelineFallback({\n container,\n ...options,\n });\n }\n }\n return targetCache[axisKey];\n}\n//# sourceMappingURL=get-timeline.js.map","import { noop } from \"motion-utils\";\nimport { attachToAnimation } from \"./attach-animation\";\nimport { attachToFunction } from \"./attach-function\";\nexport function scroll(onScroll, { axis = \"y\", container = document.scrollingElement, ...options } = {}) {\n if (!container)\n return noop;\n const optionsWithDefaults = { axis, container, ...options };\n return typeof onScroll === \"function\"\n ? attachToFunction(onScroll, optionsWithDefaults)\n : attachToAnimation(onScroll, optionsWithDefaults);\n}\n//# sourceMappingURL=index.js.map","import { observeTimeline } from \"motion-dom\";\nimport { scrollInfo } from \"./track\";\nimport { getTimeline } from \"./utils/get-timeline\";\nimport { isElementTracking } from \"./utils/is-element-tracking\";\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) {\n return onScroll.length === 2;\n}\nexport function attachToFunction(onScroll, options) {\n if (isOnScrollWithInfo(onScroll) || isElementTracking(options)) {\n return scrollInfo((info) => {\n onScroll(info[options.axis].progress, info);\n }, options);\n }\n else {\n return observeTimeline(onScroll, getTimeline(options));\n }\n}\n//# sourceMappingURL=attach-function.js.map","/**\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) {\n return options && (options.target || options.offset);\n}\n//# sourceMappingURL=is-element-tracking.js.map","import { observeTimeline } from \"motion-dom\";\nimport { canUseNativeTimeline } from \"./utils/can-use-native-timeline\";\nimport { getTimeline } from \"./utils/get-timeline\";\nimport { offsetToViewTimelineRange } from \"./utils/offset-to-range\";\nexport function attachToAnimation(animation, options) {\n const timeline = getTimeline(options);\n const range = options.target\n ? offsetToViewTimelineRange(options.offset)\n : undefined;\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 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 return observeTimeline((progress) => {\n valueAnimation.time =\n valueAnimation.iterationDuration * progress;\n }, timeline);\n },\n });\n}\n//# sourceMappingURL=attach-animation.js.map"],"names":["clamp","min","max","v","formatErrorMessage","message","errorCode","warning","invariant","process","env","NODE_ENV","check","console","warn","Error","MotionGlobalConfig","isObject","value","noop","any","pipe","transformers","reduce","a","b","progress","from","to","range","stepsOrder","createRenderBatcher","scheduleNextBatch","allowKeepAlive","runNextFrame","useDefaultElapsed","state","delta","timestamp","isProcessing","flagRunNextFrame","steps","acc","key","thisFrame","Set","nextFrame","flushNextFrame","toKeepAlive","WeakSet","latestFrameData","triggerCallback","callback","has","step","schedule","keepAlive","immediate","queue","add","cancel","delete","frameData","prevFrame","forEach","clear","createRenderStep","setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender","processBatch","useManualTiming","performance","now","Math","i","length","frame","cancelFrame","requestAnimationFrame","startsAsVariableToken","token","startsWith","checkStringStartsWith","singleCssVariableRegex","number","test","parse","parseFloat","transform","alpha","sanitize","round","floatRegex","singleColorRegex","isColorString","type","testProp","Boolean","isNullish","Object","prototype","hasOwnProperty","call","splitColor","aName","bName","cName","c","match","undefined","rgbUnit","clampRgbUnit","rgba","red","green","blue","alpha$1","hex","r","g","substring","parseInt","percent","unit","endsWith","split","createUnitType","hsla","hue","saturation","lightness","color","getAnimatableNone","parsed","colorRegex","NUMBER_TOKEN","COLOR_TOKEN","complexRegex","analyseComplexValue","originalValue","toString","values","indexes","var","types","replace","parsedValue","push","buildTransformer","numSections","output","convertToZero","splitBefore","trim","complex","isNaN","createTransformer","source","info","transformer","map","hueToRgb","p","q","t","mixImmediate","mixNumber","mixLinearColor","fromExpo","expo","sqrt","colorTypes","asRGBA","find","model","hslaToRgba","mixColor","fromRGBA","toRGBA","blended","invisibleValues","mixNumber$1","getMixer","mixComplex","Array","isArray","mixArray","mixObject","numValues","blendValue","origin","target","template","originStats","targetStats","mixVisibility","orderedOrigin","pointers","originIndex","originValue","matchOrder","mix","mixer","interpolate","input","isClamp","ease","inputLength","isZeroDeltaRange","reverse","mixers","customMixer","mixerFactory","numMixers","easingFunction","createMixers","interpolator","progressInRange","defaultOffset","arr","offset","remaining","offsetProgress","fillOffset","supportsFlags","memoSupports","supportsFlag","memoized","result","memo","supportsScrollTimeline","window","ScrollTimeline","supportsViewTimeline","ViewTimeline","isHTMLElement","element","resizeHandlers","WeakMap","observer","getSize","borderBoxAxis","svgAxis","htmlAxis","borderBoxSize","getBBox","getWidth","getHeight","notifyTarget","get","handler","width","height","notifyAll","entries","resizeElement","ResizeObserver","elements","elementOrSelector","EventTarget","document","querySelectorAll","filter","resolveElements","elementHandlers","set","observe","size","unobserve","windowCallbacks","windowResizeHandler","resizeWindow","innerWidth","innerHeight","addEventListener","removeEventListener","observeTimeline","timeline","prevProgress","onFrame","currentTime","canUseNativeTimeline","keys","x","position","y","updateAxisInfo","axisName","time","axis","prev","current","prevTime","abs","scrollLength","elapsed","velocity","frameDuration","namedEdges","start","center","end","resolveEdge","edge","inset","asNumber","documentElement","clientWidth","clientHeight","resolveOffset","containerLength","targetLength","targetInset","offsetDefinition","targetPoint","containerPoint","includes","ScrollOffset","Enter","Exit","Any","All","point","resolveOffsets","container","options","lengthLabel","offsetLeft","offsetTop","offsetParent","tagName","svgBoundingBox","getBoundingClientRect","parentElement","parentBoundingBox","left","top","SVGGraphicsElement","svg","parent","parentNode","calcInset","targetSize","scrollWidth","scrollHeight","getTargetSize","containerSize","hasChanged","numOffsets","interpolatorOffsets","createOnScrollHandler","onScroll","measure","targetOffset","node","updateScrollInfo","notify","scrollListeners","resizeListeners","onScrollHandlers","scrollSize","dimensionCheckProcesses","getEventTarget","scrollingElement","scrollInfo","trackContentSize","containerHandlers","containerHandler","measureAll","listener","checkScrollDimensions","newWidth","newHeight","dimensionCheckProcess","currentHandlers","scrollListener","presets","ScrollOffsetPresets","stringToProgress","parseStringOffset","s","parts","matchesPreset","preset","normalised","item","normaliseOffset","o","offsetToViewTimelineRange","rangeStart","rangeEnd","name","timelineCache","Map","scrollTimelineFallback","getTimeline","containerCache","targetKey","targetCache","axisKey","join","subject","scroll","optionsWithDefaults","isOnScrollWithInfo","isElementTracking","attachToFunction","animation","useNative","attachTimeline","valueAnimation","pause","iterationDuration","attachToAnimation"],"mappings":"AAAA,MAAMA,EAAQ,CAACC,EAAKC,EAAKC,IACjBA,EAAID,EACGA,EACPC,EAAIF,EACGA,EACJE,ECLX,SAASC,EAAmBC,EAASC,GACjC,OAAOA,EACD,GAAGD,2FAAiGC,IACpGD,CACV,CCFA,IAAIE,EAAU,OACVC,EAAY,OACO,oBAAZC,SACmB,eAA1BA,QAAQC,KAAKC,WACbJ,EAAU,CAACK,EAAOP,EAASC,KAClBM,GAA4B,oBAAZC,SACjBA,QAAQC,KAAKV,EAAmBC,EAASC,KAGjDE,EAAY,CAACI,EAAOP,EAASC,KACzB,IAAKM,EACD,MAAM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AeE,kBAAoBxY,GACxCiQ,KAGf,CHxBUwI,CAAkB9D,EAAUoD,EACtC"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/size-rollup-waapi-animate.js b/node_modules/framer-motion/dist/size-rollup-waapi-animate.js new file mode 100644 index 0000000..d52bdcb --- /dev/null +++ b/node_modules/framer-motion/dist/size-rollup-waapi-animate.js @@ -0,0 +1,2 @@ +let t=()=>{};"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(t=(t,e,n)=>{if(!t)throw new Error(function(t,e){return e?`${t}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:t}(e,n))});const e=t=>t,n=t=>1e3*t,i=t=>t/1e3,s=t=>null!==t;class a{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}function o(t){for(let e=1;et.startsWith("--");const l={};function u(t,e){const n=function(t){let e;return()=>(void 0===e&&(e=t()),e)}(t);return()=>l[e]??n()}const h=u(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),d=u(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),m=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,c={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:m([0,.65,.55,1]),circOut:m([.55,0,1,.45]),backIn:m([.31,.01,.66,-.59]),backOut:m([.33,1.53,.69,.99])};function p(t,e){return t?"function"==typeof t?d()?((t,e,n=10)=>{let i="";const s=Math.max(Math.round(e/n),2);for(let e=0;eArray.isArray(t)&&"number"==typeof t[0])(t)?m(t):Array.isArray(t)?t.map(t=>p(t,e)||c.easeOut):c[t]:void 0}class f extends a{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:i,keyframes:a,pseudoElement:o,allowFlatten:l=!1,finalKeyframe:u,onComplete:h}=e;this.isPseudoElement=Boolean(o),this.allowFlatten=l,this.options=e,t("string"!=typeof e.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const m=function({type:t,...e}){return function(t){return"function"==typeof t&&"applyToOptions"in t}(t)&&d()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(e);this.animation=function(t,e,n,{delay:i=0,duration:s=300,repeat:a=0,repeatType:o="loop",ease:r="easeOut",times:l}={},u){const h={[e]:n};l&&(h.offset=l);const d=p(r,s);Array.isArray(d)&&(h.easing=d);const m={delay:i,duration:s,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:a+1,direction:"reverse"===o?"alternate":"normal"};return u&&(m.pseudoElement=u),t.animate(h,m)}(n,i,a,m,o),!1===m.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const t=function(t,{repeat:e,repeatType:n="loop"},i,a=1){const o=t.filter(s),r=a<0||e&&"loop"!==n&&e%2==1?0:o.length-1;return r&&void 0!==i?i:o[r]}(a,this.options,u,this.speed);this.updateMotionValue&&this.updateMotionValue(t),function(t,e,n){r(e)?t.style.setProperty(e,n):t.style[e]=n}(n,i,t),this.animation.cancel()}h?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return i(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+i(t)}get time(){return i(Number(this.animation.currentTime)||0)}set time(t){const e=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=n(t),e&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:n,rangeEnd:i,observe:s}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&h()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),i&&(this.animation.rangeEnd=i),e):s(this)}}class g{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;ne.attachTimeline(t));return()=>{e.forEach((t,e)=>{t&&t(),this.animations[e].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return y(this.animations,"duration")}get iterationDuration(){return y(this.animations,"iterationDuration")}runAll(t){this.animations.forEach(e=>e[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function y(t,e){let n=0;for(let i=0;in&&(n=s)}return n}class T extends g{then(t,e){return this.finished.finally(t).then(()=>{})}}const b=new WeakMap,A=(t,e="")=>`${t}:${e}`;function S(t){let e=b.get(t);return e||(e=new Map,b.set(t,e)),e}function E(t,e){const n=t?.[e]??t?.default??t;return n!==t?function(t,e){if(t?.inherit&&e){const{inherit:n,...i}=t;return{...e,...i}}return t}(n,t):n}const k=new Set(["borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","width","maxWidth","height","maxHeight","top","right","bottom","left","inset","insetBlock","insetBlockStart","insetBlockEnd","insetInline","insetInlineStart","insetInlineEnd","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingBlock","paddingBlockStart","paddingBlockEnd","paddingInline","paddingInlineStart","paddingInlineEnd","margin","marginTop","marginRight","marginBottom","marginLeft","marginBlock","marginBlockStart","marginBlockEnd","marginInline","marginInlineStart","marginInlineEnd","fontSize","backgroundPositionX","backgroundPositionY"]);function v(t,e){for(let n=0;nnull!=t)}(e,a),l=r.length;t(Boolean(l),"No valid elements provided.","no-valid-elements");const u=[];for(let t=0;te.delete(n)),h.push(s)}return h}const I=t=>function(e,n,i){return new T(B(e,n,i,t))},R=I();export{R as animateMini,I as createScopedWaapiAnimate}; +//# sourceMappingURL=size-rollup-waapi-animate.js.map diff --git a/node_modules/framer-motion/dist/size-rollup-waapi-animate.js.map b/node_modules/framer-motion/dist/size-rollup-waapi-animate.js.map new file mode 100644 index 0000000..b82bf23 --- /dev/null +++ b/node_modules/framer-motion/dist/size-rollup-waapi-animate.js.map @@ -0,0 +1 @@ +{"version":3,"file":"size-rollup-waapi-animate.js","sources":["../../motion-utils/dist/es/errors.mjs","../../motion-utils/dist/es/format-error-message.mjs","../../motion-utils/dist/es/noop.mjs","../../motion-utils/dist/es/time-conversion.mjs","../../motion-dom/dist/es/animation/keyframes/get-final.mjs","../../motion-dom/dist/es/animation/utils/WithPromise.mjs","../../motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.mjs","../../motion-dom/dist/es/render/dom/is-css-var.mjs","../../motion-dom/dist/es/utils/supports/flags.mjs","../../motion-dom/dist/es/utils/supports/memo.mjs","../../motion-utils/dist/es/memo.mjs","../../motion-dom/dist/es/utils/supports/scroll-timeline.mjs","../../motion-dom/dist/es/utils/supports/linear-easing.mjs","../../motion-dom/dist/es/animation/waapi/easing/cubic-bezier.mjs","../../motion-dom/dist/es/animation/waapi/easing/supported.mjs","../../motion-dom/dist/es/animation/waapi/easing/map-easing.mjs","../../motion-dom/dist/es/animation/waapi/utils/linear.mjs","../../motion-utils/dist/es/easing/utils/is-bezier-definition.mjs","../../motion-dom/dist/es/animation/NativeAnimation.mjs","../../motion-dom/dist/es/animation/waapi/utils/apply-generator.mjs","../../motion-dom/dist/es/animation/generators/utils/is-generator.mjs","../../motion-dom/dist/es/animation/waapi/start-waapi-animation.mjs","../../motion-dom/dist/es/render/dom/style-set.mjs","../../motion-dom/dist/es/animation/GroupAnimation.mjs","../../motion-dom/dist/es/animation/GroupAnimationWithThen.mjs","../../motion-dom/dist/es/animation/utils/active-animations.mjs","../../motion-dom/dist/es/animation/utils/get-value-transition.mjs","../../motion-dom/dist/es/animation/utils/resolve-transition.mjs","../../motion-dom/dist/es/utils/border-radius.mjs","../../motion-dom/dist/es/animation/waapi/utils/px-values.mjs","../../motion-dom/dist/es/animation/keyframes/utils/apply-px-defaults.mjs","../../motion-dom/dist/es/render/dom/style-computed.mjs","../lib/animation/animators/waapi/animate-elements.js","../../motion-dom/dist/es/utils/resolve-elements.mjs","../lib/animation/animators/waapi/animate-style.js"],"sourcesContent":["import { formatErrorMessage } from './format-error-message.mjs';\n\nlet warning = () => { };\nlet invariant = () => { };\nif (typeof process !== \"undefined\" &&\n process.env?.NODE_ENV !== \"production\") {\n warning = (check, message, errorCode) => {\n if (!check && typeof console !== \"undefined\") {\n console.warn(formatErrorMessage(message, errorCode));\n }\n };\n invariant = (check, message, errorCode) => {\n if (!check) {\n throw new Error(formatErrorMessage(message, errorCode));\n }\n };\n}\n\nexport { invariant, warning };\n//# sourceMappingURL=errors.mjs.map\n","function formatErrorMessage(message, errorCode) {\n return errorCode\n ? `${message}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${errorCode}`\n : message;\n}\n\nexport { formatErrorMessage };\n//# sourceMappingURL=format-error-message.mjs.map\n","/*#__NO_SIDE_EFFECTS__*/\nconst noop = (any) => any;\n\nexport { noop };\n//# sourceMappingURL=noop.mjs.map\n","/**\n * Converts seconds to milliseconds\n *\n * @param seconds - Time in seconds.\n * @return milliseconds - Converted time in milliseconds.\n */\n/*#__NO_SIDE_EFFECTS__*/\nconst secondsToMilliseconds = (seconds) => seconds * 1000;\n/*#__NO_SIDE_EFFECTS__*/\nconst millisecondsToSeconds = (milliseconds) => milliseconds / 1000;\n\nexport { millisecondsToSeconds, secondsToMilliseconds };\n//# sourceMappingURL=time-conversion.mjs.map\n","const isNotNull = (value) => value !== null;\nfunction getFinalKeyframe(keyframes, { repeat, repeatType = \"loop\" }, finalKeyframe, speed = 1) {\n const resolvedKeyframes = keyframes.filter(isNotNull);\n const useFirstKeyframe = speed < 0 || (repeat && repeatType !== \"loop\" && repeat % 2 === 1);\n const index = useFirstKeyframe ? 0 : resolvedKeyframes.length - 1;\n return !index || finalKeyframe === undefined\n ? resolvedKeyframes[index]\n : finalKeyframe;\n}\n\nexport { getFinalKeyframe };\n//# sourceMappingURL=get-final.mjs.map\n","class WithPromise {\n constructor() {\n this.updateFinished();\n }\n get finished() {\n return this._finished;\n }\n updateFinished() {\n this._finished = new Promise((resolve) => {\n this.resolve = resolve;\n });\n }\n notifyFinished() {\n this.resolve();\n }\n /**\n * Allows the animation to be awaited.\n *\n * @deprecated Use `finished` instead.\n */\n then(onResolve, onReject) {\n return this.finished.then(onResolve, onReject);\n }\n}\n\nexport { WithPromise };\n//# sourceMappingURL=WithPromise.mjs.map\n","function fillWildcards(keyframes) {\n for (let i = 1; i < keyframes.length; i++) {\n keyframes[i] ?? (keyframes[i] = keyframes[i - 1]);\n }\n}\n\nexport { fillWildcards };\n//# sourceMappingURL=fill-wildcards.mjs.map\n","const isCSSVar = (name) => name.startsWith(\"--\");\n\nexport { isCSSVar };\n//# sourceMappingURL=is-css-var.mjs.map\n","/**\n * Add the ability for test suites to manually set support flags\n * to better test more environments.\n */\nconst supportsFlags = {};\n\nexport { supportsFlags };\n//# sourceMappingURL=flags.mjs.map\n","import { memo } from 'motion-utils';\nimport { supportsFlags } from './flags.mjs';\n\nfunction memoSupports(callback, supportsFlag) {\n const memoized = memo(callback);\n return () => supportsFlags[supportsFlag] ?? memoized();\n}\n\nexport { memoSupports };\n//# sourceMappingURL=memo.mjs.map\n","/*#__NO_SIDE_EFFECTS__*/\nfunction memo(callback) {\n let result;\n return () => {\n if (result === undefined)\n result = callback();\n return result;\n };\n}\n\nexport { memo };\n//# sourceMappingURL=memo.mjs.map\n","import { memoSupports } from './memo.mjs';\n\nconst supportsScrollTimeline = /* @__PURE__ */ memoSupports(() => window.ScrollTimeline !== undefined, \"scrollTimeline\");\nconst supportsViewTimeline = /* @__PURE__ */ memoSupports(() => window.ViewTimeline !== undefined, \"viewTimeline\");\n\nexport { supportsScrollTimeline, supportsViewTimeline };\n//# sourceMappingURL=scroll-timeline.mjs.map\n","import { memoSupports } from './memo.mjs';\n\nconst supportsLinearEasing = /*@__PURE__*/ memoSupports(() => {\n try {\n document\n .createElement(\"div\")\n .animate({ opacity: 0 }, { easing: \"linear(0, 1)\" });\n }\n catch (e) {\n return false;\n }\n return true;\n}, \"linearEasing\");\n\nexport { supportsLinearEasing };\n//# sourceMappingURL=linear-easing.mjs.map\n","const cubicBezierAsString = ([a, b, c, d]) => `cubic-bezier(${a}, ${b}, ${c}, ${d})`;\n\nexport { cubicBezierAsString };\n//# sourceMappingURL=cubic-bezier.mjs.map\n","import { cubicBezierAsString } from './cubic-bezier.mjs';\n\nconst supportedWaapiEasing = {\n linear: \"linear\",\n ease: \"ease\",\n easeIn: \"ease-in\",\n easeOut: \"ease-out\",\n easeInOut: \"ease-in-out\",\n circIn: /*@__PURE__*/ cubicBezierAsString([0, 0.65, 0.55, 1]),\n circOut: /*@__PURE__*/ cubicBezierAsString([0.55, 0, 1, 0.45]),\n backIn: /*@__PURE__*/ cubicBezierAsString([0.31, 0.01, 0.66, -0.59]),\n backOut: /*@__PURE__*/ cubicBezierAsString([0.33, 1.53, 0.69, 0.99]),\n};\n\nexport { supportedWaapiEasing };\n//# sourceMappingURL=supported.mjs.map\n","import { isBezierDefinition } from 'motion-utils';\nimport { supportsLinearEasing } from '../../../utils/supports/linear-easing.mjs';\nimport { generateLinearEasing } from '../utils/linear.mjs';\nimport { cubicBezierAsString } from './cubic-bezier.mjs';\nimport { supportedWaapiEasing } from './supported.mjs';\n\nfunction mapEasingToNativeEasing(easing, duration) {\n if (!easing) {\n return undefined;\n }\n else if (typeof easing === \"function\") {\n return supportsLinearEasing()\n ? generateLinearEasing(easing, duration)\n : \"ease-out\";\n }\n else if (isBezierDefinition(easing)) {\n return cubicBezierAsString(easing);\n }\n else if (Array.isArray(easing)) {\n return easing.map((segmentEasing) => mapEasingToNativeEasing(segmentEasing, duration) ||\n supportedWaapiEasing.easeOut);\n }\n else {\n return supportedWaapiEasing[easing];\n }\n}\n\nexport { mapEasingToNativeEasing };\n//# sourceMappingURL=map-easing.mjs.map\n","const generateLinearEasing = (easing, duration, // as milliseconds\nresolution = 10 // as milliseconds\n) => {\n let points = \"\";\n const numPoints = Math.max(Math.round(duration / resolution), 2);\n for (let i = 0; i < numPoints; i++) {\n points += Math.round(easing(i / (numPoints - 1)) * 10000) / 10000 + \", \";\n }\n return `linear(${points.substring(0, points.length - 2)})`;\n};\n\nexport { generateLinearEasing };\n//# sourceMappingURL=linear.mjs.map\n","/*#__NO_SIDE_EFFECTS__*/\nconst isBezierDefinition = (easing) => Array.isArray(easing) && typeof easing[0] === \"number\";\n\nexport { isBezierDefinition };\n//# sourceMappingURL=is-bezier-definition.mjs.map\n","import { invariant, millisecondsToSeconds, secondsToMilliseconds, noop } from 'motion-utils';\nimport { setStyle } from '../render/dom/style-set.mjs';\nimport { supportsScrollTimeline } from '../utils/supports/scroll-timeline.mjs';\nimport { getFinalKeyframe } from './keyframes/get-final.mjs';\nimport { WithPromise } from './utils/WithPromise.mjs';\nimport { startWaapiAnimation } from './waapi/start-waapi-animation.mjs';\nimport { applyGeneratorOptions } from './waapi/utils/apply-generator.mjs';\n\n/**\n * NativeAnimation implements AnimationPlaybackControls for the browser's Web Animations API.\n */\nclass NativeAnimation extends WithPromise {\n constructor(options) {\n super();\n this.finishedTime = null;\n this.isStopped = false;\n /**\n * Tracks a manually-set start time that takes precedence over WAAPI's\n * dynamic startTime. This is cleared when play() or time setter is called,\n * allowing WAAPI to take over timing.\n */\n this.manualStartTime = null;\n if (!options)\n return;\n const { element, name, keyframes, pseudoElement, allowFlatten = false, finalKeyframe, onComplete, } = options;\n this.isPseudoElement = Boolean(pseudoElement);\n this.allowFlatten = allowFlatten;\n this.options = options;\n invariant(typeof options.type !== \"string\", `Mini animate() doesn't support \"type\" as a string.`, \"mini-spring\");\n const transition = applyGeneratorOptions(options);\n this.animation = startWaapiAnimation(element, name, keyframes, transition, pseudoElement);\n if (transition.autoplay === false) {\n this.animation.pause();\n }\n this.animation.onfinish = () => {\n this.finishedTime = this.time;\n if (!pseudoElement) {\n const keyframe = getFinalKeyframe(keyframes, this.options, finalKeyframe, this.speed);\n if (this.updateMotionValue) {\n this.updateMotionValue(keyframe);\n }\n /**\n * If we can, we want to commit the final style as set by the user,\n * rather than the computed keyframe value supplied by the animation.\n * We always do this, even when a motion value is present, to prevent\n * a visual flash in Firefox where the WAAPI animation's fill is removed\n * during cancel() before the scheduled render can apply the correct value.\n */\n setStyle(element, name, keyframe);\n this.animation.cancel();\n }\n onComplete?.();\n this.notifyFinished();\n };\n }\n play() {\n if (this.isStopped)\n return;\n this.manualStartTime = null;\n this.animation.play();\n if (this.state === \"finished\") {\n this.updateFinished();\n }\n }\n pause() {\n this.animation.pause();\n }\n complete() {\n this.animation.finish?.();\n }\n cancel() {\n try {\n this.animation.cancel();\n }\n catch (e) { }\n }\n stop() {\n if (this.isStopped)\n return;\n this.isStopped = true;\n const { state } = this;\n if (state === \"idle\" || state === \"finished\") {\n return;\n }\n if (this.updateMotionValue) {\n this.updateMotionValue();\n }\n else {\n this.commitStyles();\n }\n if (!this.isPseudoElement)\n this.cancel();\n }\n /**\n * WAAPI doesn't natively have any interruption capabilities.\n *\n * In this method, we commit styles back to the DOM before cancelling\n * the animation.\n *\n * This is designed to be overridden by NativeAnimationExtended, which\n * will create a renderless JS animation and sample it twice to calculate\n * its current value, \"previous\" value, and therefore allow\n * Motion to also correctly calculate velocity for any subsequent animation\n * while deferring the commit until the next animation frame.\n */\n commitStyles() {\n const element = this.options?.element;\n if (!this.isPseudoElement && element?.isConnected) {\n this.animation.commitStyles?.();\n }\n }\n get duration() {\n const duration = this.animation.effect?.getComputedTiming?.().duration || 0;\n return millisecondsToSeconds(Number(duration));\n }\n get iterationDuration() {\n const { delay = 0 } = this.options || {};\n return this.duration + millisecondsToSeconds(delay);\n }\n get time() {\n return millisecondsToSeconds(Number(this.animation.currentTime) || 0);\n }\n set time(newTime) {\n const wasFinished = this.finishedTime !== null;\n this.manualStartTime = null;\n this.finishedTime = null;\n this.animation.currentTime = secondsToMilliseconds(newTime);\n if (wasFinished) {\n this.animation.pause();\n }\n }\n /**\n * The playback speed of the animation.\n * 1 = normal speed, 2 = double speed, 0.5 = half speed.\n */\n get speed() {\n return this.animation.playbackRate;\n }\n set speed(newSpeed) {\n // Allow backwards playback after finishing\n if (newSpeed < 0)\n this.finishedTime = null;\n this.animation.playbackRate = newSpeed;\n }\n get state() {\n return this.finishedTime !== null\n ? \"finished\"\n : this.animation.playState;\n }\n get startTime() {\n return this.manualStartTime ?? Number(this.animation.startTime);\n }\n set startTime(newStartTime) {\n this.manualStartTime = this.animation.startTime = newStartTime;\n }\n /**\n * Attaches a timeline to the animation, for instance the `ScrollTimeline`.\n */\n attachTimeline({ timeline, rangeStart, rangeEnd, observe, }) {\n if (this.allowFlatten) {\n this.animation.effect?.updateTiming({ easing: \"linear\" });\n }\n this.animation.onfinish = null;\n if (timeline && supportsScrollTimeline()) {\n this.animation.timeline = timeline;\n if (rangeStart)\n this.animation.rangeStart = rangeStart;\n if (rangeEnd)\n this.animation.rangeEnd = rangeEnd;\n return noop;\n }\n else {\n return observe(this);\n }\n }\n}\n\nexport { NativeAnimation };\n//# sourceMappingURL=NativeAnimation.mjs.map\n","import { supportsLinearEasing } from '../../../utils/supports/linear-easing.mjs';\nimport { isGenerator } from '../../generators/utils/is-generator.mjs';\n\nfunction applyGeneratorOptions({ type, ...options }) {\n if (isGenerator(type) && supportsLinearEasing()) {\n return type.applyToOptions(options);\n }\n else {\n options.duration ?? (options.duration = 300);\n options.ease ?? (options.ease = \"easeOut\");\n }\n return options;\n}\n\nexport { applyGeneratorOptions };\n//# sourceMappingURL=apply-generator.mjs.map\n","function isGenerator(type) {\n return typeof type === \"function\" && \"applyToOptions\" in type;\n}\n\nexport { isGenerator };\n//# sourceMappingURL=is-generator.mjs.map\n","import { mapEasingToNativeEasing } from './easing/map-easing.mjs';\n\nfunction startWaapiAnimation(element, valueName, keyframes, { delay = 0, duration = 300, repeat = 0, repeatType = \"loop\", ease = \"easeOut\", times, } = {}, pseudoElement = undefined) {\n const keyframeOptions = {\n [valueName]: keyframes,\n };\n if (times)\n keyframeOptions.offset = times;\n const easing = mapEasingToNativeEasing(ease, duration);\n /**\n * If this is an easing array, apply to keyframes, not animation as a whole\n */\n if (Array.isArray(easing))\n keyframeOptions.easing = easing;\n const options = {\n delay,\n duration,\n easing: !Array.isArray(easing) ? easing : \"linear\",\n fill: \"both\",\n iterations: repeat + 1,\n direction: repeatType === \"reverse\" ? \"alternate\" : \"normal\",\n };\n if (pseudoElement)\n options.pseudoElement = pseudoElement;\n return element.animate(keyframeOptions, options);\n}\n\nexport { startWaapiAnimation };\n//# sourceMappingURL=start-waapi-animation.mjs.map\n","import { isCSSVar } from './is-css-var.mjs';\n\nfunction setStyle(element, name, value) {\n isCSSVar(name)\n ? element.style.setProperty(name, value)\n : (element.style[name] = value);\n}\n\nexport { setStyle };\n//# sourceMappingURL=style-set.mjs.map\n","class GroupAnimation {\n constructor(animations) {\n // Bound to accomadate common `return animation.stop` pattern\n this.stop = () => this.runAll(\"stop\");\n this.animations = animations.filter(Boolean);\n }\n get finished() {\n return Promise.all(this.animations.map((animation) => animation.finished));\n }\n /**\n * TODO: Filter out cancelled or stopped animations before returning\n */\n getAll(propName) {\n return this.animations[0][propName];\n }\n setAll(propName, newValue) {\n for (let i = 0; i < this.animations.length; i++) {\n this.animations[i][propName] = newValue;\n }\n }\n attachTimeline(timeline) {\n const subscriptions = this.animations.map((animation) => animation.attachTimeline(timeline));\n return () => {\n subscriptions.forEach((cancel, i) => {\n cancel && cancel();\n this.animations[i].stop();\n });\n };\n }\n get time() {\n return this.getAll(\"time\");\n }\n set time(time) {\n this.setAll(\"time\", time);\n }\n get speed() {\n return this.getAll(\"speed\");\n }\n set speed(speed) {\n this.setAll(\"speed\", speed);\n }\n get state() {\n return this.getAll(\"state\");\n }\n get startTime() {\n return this.getAll(\"startTime\");\n }\n get duration() {\n return getMax(this.animations, \"duration\");\n }\n get iterationDuration() {\n return getMax(this.animations, \"iterationDuration\");\n }\n runAll(methodName) {\n this.animations.forEach((controls) => controls[methodName]());\n }\n play() {\n this.runAll(\"play\");\n }\n pause() {\n this.runAll(\"pause\");\n }\n cancel() {\n this.runAll(\"cancel\");\n }\n complete() {\n this.runAll(\"complete\");\n }\n}\nfunction getMax(animations, propName) {\n let max = 0;\n for (let i = 0; i < animations.length; i++) {\n const value = animations[i][propName];\n if (value !== null && value > max) {\n max = value;\n }\n }\n return max;\n}\n\nexport { GroupAnimation };\n//# sourceMappingURL=GroupAnimation.mjs.map\n","import { GroupAnimation } from './GroupAnimation.mjs';\n\nclass GroupAnimationWithThen extends GroupAnimation {\n then(onResolve, _onReject) {\n return this.finished.finally(onResolve).then(() => { });\n }\n}\n\nexport { GroupAnimationWithThen };\n//# sourceMappingURL=GroupAnimationWithThen.mjs.map\n","const animationMaps = new WeakMap();\nconst animationMapKey = (name, pseudoElement = \"\") => `${name}:${pseudoElement}`;\nfunction getAnimationMap(element) {\n let map = animationMaps.get(element);\n if (!map) {\n map = new Map();\n animationMaps.set(element, map);\n }\n return map;\n}\n\nexport { animationMapKey, getAnimationMap };\n//# sourceMappingURL=active-animations.mjs.map\n","import { resolveTransition } from './resolve-transition.mjs';\n\nfunction getValueTransition(transition, key) {\n const valueTransition = transition?.[key] ??\n transition?.[\"default\"] ??\n transition;\n if (valueTransition !== transition) {\n return resolveTransition(valueTransition, transition);\n }\n return valueTransition;\n}\n\nexport { getValueTransition };\n//# sourceMappingURL=get-value-transition.mjs.map\n","/**\n * If `transition` has `inherit: true`, shallow-merge it with\n * `parentTransition` (child keys win) and strip the `inherit` key.\n * Otherwise return `transition` unchanged.\n */\nfunction resolveTransition(transition, parentTransition) {\n if (transition?.inherit && parentTransition) {\n const { inherit: _, ...rest } = transition;\n return { ...parentTransition, ...rest };\n }\n return transition;\n}\n\nexport { resolveTransition };\n//# sourceMappingURL=resolve-transition.mjs.map\n","/**\n * The four corner-radius longhands. Shared so the projection mixer, scale\n * corrector, WAAPI px-value set and view-transition crop pass don't each carry\n * their own copy. Order is irrelevant - every consumer mixes/corrects/animates\n * each corner independently.\n */\nconst cornerRadiusProps = [\n \"borderTopLeftRadius\",\n \"borderTopRightRadius\",\n \"borderBottomRightRadius\",\n \"borderBottomLeftRadius\",\n];\n\nexport { cornerRadiusProps };\n//# sourceMappingURL=border-radius.mjs.map\n","import { cornerRadiusProps } from '../../../utils/border-radius.mjs';\n\nconst pxValues = new Set([\n // Border props\n \"borderWidth\",\n \"borderTopWidth\",\n \"borderRightWidth\",\n \"borderBottomWidth\",\n \"borderLeftWidth\",\n \"borderRadius\",\n ...cornerRadiusProps,\n // Positioning props\n \"width\",\n \"maxWidth\",\n \"height\",\n \"maxHeight\",\n \"top\",\n \"right\",\n \"bottom\",\n \"left\",\n \"inset\",\n \"insetBlock\",\n \"insetBlockStart\",\n \"insetBlockEnd\",\n \"insetInline\",\n \"insetInlineStart\",\n \"insetInlineEnd\",\n // Spacing props\n \"padding\",\n \"paddingTop\",\n \"paddingRight\",\n \"paddingBottom\",\n \"paddingLeft\",\n \"paddingBlock\",\n \"paddingBlockStart\",\n \"paddingBlockEnd\",\n \"paddingInline\",\n \"paddingInlineStart\",\n \"paddingInlineEnd\",\n \"margin\",\n \"marginTop\",\n \"marginRight\",\n \"marginBottom\",\n \"marginLeft\",\n \"marginBlock\",\n \"marginBlockStart\",\n \"marginBlockEnd\",\n \"marginInline\",\n \"marginInlineStart\",\n \"marginInlineEnd\",\n // Typography\n \"fontSize\",\n // Misc\n \"backgroundPositionX\",\n \"backgroundPositionY\",\n]);\n\nexport { pxValues };\n//# sourceMappingURL=px-values.mjs.map\n","import { pxValues } from '../../waapi/utils/px-values.mjs';\n\nfunction applyPxDefaults(keyframes, name) {\n for (let i = 0; i < keyframes.length; i++) {\n if (typeof keyframes[i] === \"number\" && pxValues.has(name)) {\n keyframes[i] = keyframes[i] + \"px\";\n }\n }\n}\n\nexport { applyPxDefaults };\n//# sourceMappingURL=apply-px-defaults.mjs.map\n","import { isCSSVar } from './is-css-var.mjs';\n\nfunction getComputedStyle(element, name) {\n const computedStyle = window.getComputedStyle(element);\n return isCSSVar(name)\n ? computedStyle.getPropertyValue(name)\n : computedStyle[name];\n}\n\nexport { getComputedStyle };\n//# sourceMappingURL=style-computed.mjs.map\n","import { animationMapKey, applyPxDefaults, fillWildcards, getAnimationMap, getComputedStyle, getValueTransition, NativeAnimation, resolveElements, } from \"motion-dom\";\nimport { invariant, secondsToMilliseconds } from \"motion-utils\";\nexport function animateElements(elementOrSelector, keyframes, options, scope) {\n // Gracefully handle null/undefined elements (e.g., from querySelector returning null)\n if (elementOrSelector == null) {\n return [];\n }\n const elements = resolveElements(elementOrSelector, scope);\n const numElements = elements.length;\n invariant(Boolean(numElements), \"No valid elements provided.\", \"no-valid-elements\");\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 = [];\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 = { ...options };\n /**\n * Resolve stagger function if provided.\n */\n if (typeof elementTransition.delay === \"function\") {\n elementTransition.delay = elementTransition.delay(i, numElements);\n }\n for (const valueName in keyframes) {\n let valueKeyframes = keyframes[valueName];\n if (!Array.isArray(valueKeyframes)) {\n valueKeyframes = [valueKeyframes];\n }\n const valueOptions = {\n ...getValueTransition(elementTransition, valueName),\n };\n valueOptions.duration && (valueOptions.duration = secondsToMilliseconds(valueOptions.duration));\n valueOptions.delay && (valueOptions.delay = secondsToMilliseconds(valueOptions.delay));\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(valueName, valueOptions.pseudoElement || \"\");\n const currentAnimation = map.get(key);\n currentAnimation && currentAnimation.stop();\n animationDefinitions.push({\n map,\n key,\n unresolvedKeyframes: valueKeyframes,\n options: {\n ...valueOptions,\n element,\n name: valueName,\n allowFlatten: !elementTransition.type && !elementTransition.ease,\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 } = animationDefinitions[i];\n const { element, name, pseudoElement } = animationOptions;\n if (!pseudoElement && unresolvedKeyframes[0] === null) {\n unresolvedKeyframes[0] = getComputedStyle(element, name);\n }\n fillWildcards(unresolvedKeyframes);\n applyPxDefaults(unresolvedKeyframes, name);\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 animationOptions.keyframes = unresolvedKeyframes;\n }\n /**\n * Step 3: Create new animations (write)\n */\n const animations = [];\n for (let i = 0; i < animationDefinitions.length; i++) {\n const { map, key, options: animationOptions } = animationDefinitions[i];\n const animation = new NativeAnimation(animationOptions);\n map.set(key, animation);\n animation.finished.finally(() => map.delete(key));\n animations.push(animation);\n }\n return animations;\n}\n//# sourceMappingURL=animate-elements.js.map","function resolveElements(elementOrSelector, scope, selectorCache) {\n if (elementOrSelector == null) {\n return [];\n }\n if (elementOrSelector instanceof EventTarget) {\n return [elementOrSelector];\n }\n else if (typeof elementOrSelector === \"string\") {\n let root = document;\n if (scope) {\n root = scope.current;\n }\n const elements = selectorCache?.[elementOrSelector] ??\n root.querySelectorAll(elementOrSelector);\n return elements ? Array.from(elements) : [];\n }\n return Array.from(elementOrSelector).filter((element) => element != null);\n}\n\nexport { resolveElements };\n//# sourceMappingURL=resolve-elements.mjs.map\n","import { GroupAnimationWithThen, } from \"motion-dom\";\nimport { animateElements } from \"./animate-elements\";\nexport const createScopedWaapiAnimate = (scope) => {\n function scopedAnimate(elementOrSelector, keyframes, options) {\n return new GroupAnimationWithThen(animateElements(elementOrSelector, keyframes, options, scope));\n }\n return scopedAnimate;\n};\nexport const animateMini = /*@__PURE__*/ createScopedWaapiAnimate();\n//# sourceMappingURL=animate-style.js.map"],"names":["invariant","process","env","NODE_ENV","check","message","errorCode","Error","formatErrorMessage","noop","any","secondsToMilliseconds","seconds","millisecondsToSeconds","milliseconds","isNotNull","value","WithPromise","constructor","this","updateFinished","finished","_finished","Promise","resolve","notifyFinished","then","onResolve","onReject","fillWildcards","keyframes","i","length","isCSSVar","name","startsWith","supportsFlags","memoSupports","callback","supportsFlag","memoized","result","undefined","memo","supportsScrollTimeline","window","ScrollTimeline","supportsLinearEasing","document","createElement","animate","opacity","easing","e","cubicBezierAsString","a","b","c","d","supportedWaapiEasing","linear","ease","easeIn","easeOut","easeInOut","circIn","circOut","backIn","backOut","mapEasingToNativeEasing","duration","resolution","points","numPoints","Math","max","round","substring","generateLinearEasing","Array","isArray","isBezierDefinition","map","segmentEasing","NativeAnimation","options","super","finishedTime","isStopped","manualStartTime","element","pseudoElement","allowFlatten","finalKeyframe","onComplete","isPseudoElement","Boolean","type","transition","isGenerator","applyToOptions","applyGeneratorOptions","animation","valueName","delay","repeat","repeatType","times","keyframeOptions","offset","fill","iterations","direction","startWaapiAnimation","autoplay","pause","onfinish","time","keyframe","speed","resolvedKeyframes","filter","index","getFinalKeyframe","updateMotionValue","style","setProperty","setStyle","cancel","play","state","complete","finish","stop","commitStyles","isConnected","effect","getComputedTiming","Number","iterationDuration","currentTime","newTime","wasFinished","playbackRate","newSpeed","playState","startTime","newStartTime","attachTimeline","timeline","rangeStart","rangeEnd","observe","updateTiming","GroupAnimation","animations","runAll","all","getAll","propName","setAll","newValue","subscriptions","forEach","getMax","methodName","controls","GroupAnimationWithThen","_onReject","finally","animationMaps","WeakMap","animationMapKey","getAnimationMap","get","Map","set","getValueTransition","key","valueTransition","parentTransition","inherit","_","rest","resolveTransition","pxValues","Set","applyPxDefaults","has","getComputedStyle","computedStyle","getPropertyValue","animateElements","elementOrSelector","scope","elements","EventTarget","root","current","querySelectorAll","from","resolveElements","numElements","animationDefinitions","elementTransition","valueKeyframes","valueOptions","currentAnimation","push","unresolvedKeyframes","animationOptions","unshift","delete","createScopedWaapiAnimate","animateMini"],"mappings":"AAGA,IAAIA,EAAY,OACO,oBAAZC,SACmB,eAA1BA,QAAQC,KAAKC,WAMbH,EAAY,CAACI,EAAOC,EAASC,KACzB,IAAKF,EACD,MAAM,IAAIG,MCbtB,SAA4BF,EAASC,GACjC,OAAOA,EACD,GAAGD,2FAAiGC,IACpGD,CACV,CDS4BG,CAAmBH,EAASC,MEZxD,MAAMG,EAAQC,GAAQA,ECMhBC,EAAyBC,GAAsB,IAAVA,EAErCC,EAAyBC,GAAiBA,EAAe,ICTzDC,EAAaC,GAAoB,OAAVA,ECA7B,MAAMC,EACF,WAAAC,GACIC,KAAKC,gBAC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AkBuH,EACpCvH,GAA4C,OAA3BsH,EAAoB,KACtCA,EAAoB,GAAKpB,EAAiBnG,EAASxD,IAEvDL,EAAcoL,GACdtB,EAAgBsB,EAAqB/K,IAOhCyD,GAAiBsH,EAAoBjL,OAAS,GAC/CiL,EAAoBE,QAAQtB,EAAiBnG,EAASxD,IAE1DgL,EAAiBpL,UAAYmL,CACjC,CAIA,MAAMtD,EAAa,GACnB,IAAK,IAAI5H,EAAI,EAAGA,EAAI4K,EAAqB3K,OAAQD,IAAK,CAClD,MAAMmD,IAAEA,EAAGgG,IAAEA,EAAK7F,QAAS6H,GAAqBP,EAAqB5K,GAC/DuE,EAAY,IAAIlB,EAAgB8H,GACtChI,EAAI8F,IAAIE,EAAK5E,GACbA,EAAUjF,SAASoJ,QAAQ,IAAMvF,EAAIkI,OAAOlC,IAC5CvB,EAAWqD,KAAK1G,EACpB,CACA,OAAOqD,CACX,CEvGY,MAAC0D,EAA4BnB,GACrC,SAAuBD,EAAmBnK,EAAWuD,GACjD,OAAO,IAAIkF,EAAuByB,EAAgBC,EAAmBnK,EAAWuD,EAAS6G,GAC7F,EAGSoB,EAA4BD"} \ No newline at end of file diff --git a/node_modules/framer-motion/dom/README.md b/node_modules/framer-motion/dom/README.md new file mode 100644 index 0000000..9f4c437 --- /dev/null +++ b/node_modules/framer-motion/dom/README.md @@ -0,0 +1 @@ +This directory is a fallback for `exports["./dom"]` in the root `framer-motion` `package.json`. diff --git a/node_modules/framer-motion/dom/mini/package.json b/node_modules/framer-motion/dom/mini/package.json new file mode 100644 index 0000000..6d6ee8d --- /dev/null +++ b/node_modules/framer-motion/dom/mini/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "types": "../../dist/dom-mini.d.ts", + "main": "../../dist/cjs/dom-mini.js", + "module": "../../dist/es/dom-mini.mjs" +} diff --git a/node_modules/framer-motion/dom/package.json b/node_modules/framer-motion/dom/package.json new file mode 100644 index 0000000..c08f91c --- /dev/null +++ b/node_modules/framer-motion/dom/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "types": "../dist/dom.d.ts", + "main": "../dist/cjs/dom.js", + "module": "../dist/es/dom.mjs" +} diff --git a/node_modules/framer-motion/m/package.json b/node_modules/framer-motion/m/package.json new file mode 100644 index 0000000..5e76408 --- /dev/null +++ b/node_modules/framer-motion/m/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "types": "../dist/m.d.ts", + "main": "../dist/cjs/m.js", + "module": "../dist/es/m.mjs" +} diff --git a/node_modules/framer-motion/mini/package.json b/node_modules/framer-motion/mini/package.json new file mode 100644 index 0000000..1ed4407 --- /dev/null +++ b/node_modules/framer-motion/mini/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "types": "../dist/mini.d.ts", + "main": "../dist/cjs/mini.js", + "module": "../dist/es/mini.mjs" +} diff --git a/node_modules/framer-motion/package.json b/node_modules/framer-motion/package.json new file mode 100644 index 0000000..5826e56 --- /dev/null +++ b/node_modules/framer-motion/package.json @@ -0,0 +1,144 @@ +{ + "name": "framer-motion", + "version": "13.1.0", + "description": "A simple and powerful JavaScript animation library", + "main": "dist/cjs/index.js", + "module": "dist/es/index.mjs", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "require": "./dist/cjs/index.js", + "import": "./dist/es/index.mjs", + "default": "./dist/cjs/index.js" + }, + "./debug": { + "types": "./dist/debug.d.ts", + "require": "./dist/cjs/debug.js", + "import": "./dist/es/debug.mjs", + "default": "./dist/cjs/debug.js" + }, + "./dom/mini": { + "types": "./dist/dom-mini.d.ts", + "require": "./dist/cjs/dom-mini.js", + "import": "./dist/es/dom-mini.mjs", + "default": "./dist/cjs/dom-mini.js" + }, + "./dom": { + "types": "./dist/dom.d.ts", + "require": "./dist/cjs/dom.js", + "import": "./dist/es/dom.mjs", + "default": "./dist/cjs/dom.js" + }, + "./client": { + "types": "./dist/client.d.ts", + "require": "./dist/cjs/client.js", + "import": "./dist/es/client.mjs", + "default": "./dist/cjs/client.js" + }, + "./m": { + "types": "./dist/m.d.ts", + "require": "./dist/cjs/m.js", + "import": "./dist/es/m.mjs", + "default": "./dist/cjs/m.js" + }, + "./mini": { + "types": "./dist/mini.d.ts", + "require": "./dist/cjs/mini.js", + "import": "./dist/es/mini.mjs", + "default": "./dist/cjs/mini.js" + }, + "./projection": { + "types": "./dist/projection.d.ts", + "import": "./dist/es/projection.mjs", + "default": "./dist/es/projection.mjs" + }, + "./package.json": "./package.json" + }, + "types": "dist/index.d.ts", + "author": "Matt Perry", + "license": "MIT", + "repository": "https://github.com/motiondivision/motion/", + "sideEffects": false, + "keywords": [ + "react animation", + "react", + "pose", + "react pose", + "animation", + "gestures", + "drag", + "spring", + "popmotion", + "framer", + "waapi" + ], + "scripts": { + "eslint": "yarn run lint", + "lint": "yarn eslint src/**/*.ts", + "build": "yarn clean && tsc --noEmitOnError -p . && rollup -c && node ./scripts/check-bundle.js", + "dev": "yarn watch", + "clean": "rm -rf types dist lib", + "test": "yarn test-server && yarn test-client", + "test-client": "jest --config jest.config.json --max-workers=2", + "test-server": "jest --config jest.config.ssr.json", + "prettier": "prettier ./src/* --write", + "watch": "concurrently -c blue,red -n tsc --noEmitOnError ,rollup --kill-others \"tsc --noEmitOnError --watch -p . --preserveWatchOutput\" \"rollup --config --watch --no-watch.clearScreen\"", + "prepack": "yarn build && yarn measure", + "postpublish": "git push --tags", + "measure": "rollup -c ./rollup.size.config.mjs" + }, + "dependencies": { + "motion-dom": "^13.0.0", + "motion-utils": "^13.0.0", + "tslib": "^2.4.0" + }, + "devDependencies": { + "@radix-ui/react-dialog": "^1.1.15", + "@thednp/dommatrix": "^2.0.11", + "@types/three": "0.137.0", + "three": "0.137.0" + }, + "peerDependencies": { + "react": "^18.0.0 || ^19.0.0", + "react-dom": "^18.0.0 || ^19.0.0" + }, + "peerDependenciesMeta": { + "react": { + "optional": true + }, + "react-dom": { + "optional": true + } + }, + "bundlesize": [ + { + "path": "./dist/size-rollup-motion.js", + "maxSize": "34.9 kB" + }, + { + "path": "./dist/size-rollup-m.js", + "maxSize": "6 kB" + }, + { + "path": "./dist/size-rollup-dom-animation.js", + "maxSize": "17.85 kB" + }, + { + "path": "./dist/size-rollup-dom-max.js", + "maxSize": "29.8 kB" + }, + { + "path": "./dist/size-rollup-animate.js", + "maxSize": "19.1 kB" + }, + { + "path": "./dist/size-rollup-scroll.js", + "maxSize": "5.2 kB" + }, + { + "path": "./dist/size-rollup-waapi-animate.js", + "maxSize": "2.26 kB" + } + ], + "gitHead": "adaf7a4e5368d704ea350669f6ac674fb26ff270" +} diff --git a/node_modules/motion-dom/LICENSE.md b/node_modules/motion-dom/LICENSE.md new file mode 100644 index 0000000..8111044 --- /dev/null +++ b/node_modules/motion-dom/LICENSE.md @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2024 [Motion](https://motion.dev) B.V. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/motion-dom/dist/cjs/index.js b/node_modules/motion-dom/dist/cjs/index.js new file mode 100644 index 0000000..8fe6b5b --- /dev/null +++ b/node_modules/motion-dom/dist/cjs/index.js @@ -0,0 +1,11036 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var motionUtils = require('motion-utils'); + +const stepsOrder = [ + "setup", // Compute + "read", // Read + "resolveKeyframes", // Write/Read/Write/Read + "preUpdate", // Compute + "update", // Compute + "preRender", // Compute + "render", // Write + "postRender", // Compute +]; + +function createRenderStep(runNextFrame) { + /** + * We create and reuse two queues, one to queue jobs for the current frame + * and one for the next. We reuse to avoid triggering GC after x frames. + */ + let thisFrame = new Set(); + let nextFrame = new Set(); + /** + * Track whether we're currently processing jobs in this step. This way + * we can decide whether to schedule new jobs for this frame or next. + */ + let isProcessing = false; + let flushNextFrame = false; + /** + * A set of processes which were marked keepAlive when scheduled. + */ + const toKeepAlive = new WeakSet(); + let latestFrameData = { + delta: 0.0, + timestamp: 0.0, + isProcessing: false, + }; + function triggerCallback(callback) { + if (toKeepAlive.has(callback)) { + step.schedule(callback); + runNextFrame(); + } + callback(latestFrameData); + } + const step = { + /** + * Schedule a process to run on the next frame. + */ + schedule: (callback, keepAlive = false, immediate = false) => { + const addToCurrentFrame = immediate && isProcessing; + const queue = addToCurrentFrame ? thisFrame : nextFrame; + if (keepAlive) + toKeepAlive.add(callback); + queue.add(callback); + return callback; + }, + /** + * Cancel the provided callback from running on the next frame. + */ + cancel: (callback) => { + nextFrame.delete(callback); + toKeepAlive.delete(callback); + }, + /** + * Execute all schedule callbacks. + */ + process: (frameData) => { + latestFrameData = frameData; + /** + * If we're already processing we've probably been triggered by a flushSync + * inside an existing process. Instead of executing, mark flushNextFrame + * as true and ensure we flush the following frame at the end of this one. + */ + if (isProcessing) { + flushNextFrame = true; + return; + } + isProcessing = true; + // Swap this frame and the next to avoid GC + const prevFrame = thisFrame; + thisFrame = nextFrame; + nextFrame = prevFrame; + // Execute this frame + thisFrame.forEach(triggerCallback); + // Clear the frame so no callbacks remain. This is to avoid + // memory leaks should this render step not run for a while. + thisFrame.clear(); + isProcessing = false; + if (flushNextFrame) { + flushNextFrame = false; + step.process(frameData); + } + }, + }; + return step; +} + +const maxElapsed = 40; +function createRenderBatcher(scheduleNextBatch, allowKeepAlive) { + let runNextFrame = false; + let useDefaultElapsed = true; + const state = { + delta: 0.0, + timestamp: 0.0, + isProcessing: false, + }; + const flagRunNextFrame = () => (runNextFrame = true); + const steps = stepsOrder.reduce((acc, key) => { + acc[key] = createRenderStep(flagRunNextFrame); + return acc; + }, {}); + const { setup, read, resolveKeyframes, preUpdate, update, preRender, render, postRender, } = steps; + const processBatch = () => { + const useManualTiming = motionUtils.MotionGlobalConfig.useManualTiming; + const timestamp = useManualTiming + ? state.timestamp + : performance.now(); + runNextFrame = false; + if (!useManualTiming) { + state.delta = useDefaultElapsed + ? 1000 / 60 + : Math.max(Math.min(timestamp - state.timestamp, maxElapsed), 1); + } + state.timestamp = timestamp; + state.isProcessing = true; + // Unrolled render loop for better per-frame performance + setup.process(state); + read.process(state); + resolveKeyframes.process(state); + preUpdate.process(state); + update.process(state); + preRender.process(state); + render.process(state); + postRender.process(state); + state.isProcessing = false; + if (runNextFrame && allowKeepAlive) { + useDefaultElapsed = false; + scheduleNextBatch(processBatch); + } + }; + const wake = () => { + runNextFrame = true; + useDefaultElapsed = true; + if (!state.isProcessing) { + scheduleNextBatch(processBatch); + } + }; + const schedule = stepsOrder.reduce((acc, key) => { + const step = steps[key]; + acc[key] = (process, keepAlive = false, immediate = false) => { + if (!runNextFrame) + wake(); + return step.schedule(process, keepAlive, immediate); + }; + return acc; + }, {}); + const cancel = (process) => { + for (let i = 0; i < stepsOrder.length; i++) { + steps[stepsOrder[i]].cancel(process); + } + }; + return { schedule, cancel, state, steps }; +} + +const { schedule: frame, cancel: cancelFrame, state: frameData, steps: frameSteps, } = /* @__PURE__ */ createRenderBatcher(typeof requestAnimationFrame !== "undefined" ? requestAnimationFrame : motionUtils.noop, true); + +let now; +function clearTime() { + now = undefined; +} +/** + * An eventloop-synchronous alternative to performance.now(). + * + * Ensures that time measurements remain consistent within a synchronous context. + * Usually calling performance.now() twice within the same synchronous context + * will return different values which isn't useful for animations when we're usually + * trying to sync animations to the same frame. + */ +const time = { + now: () => { + if (now === undefined) { + time.set(frameData.isProcessing || motionUtils.MotionGlobalConfig.useManualTiming + ? frameData.timestamp + : performance.now()); + } + return now; + }, + set: (newTime) => { + now = newTime; + queueMicrotask(clearTime); + }, +}; + +const checkStringStartsWith = (token) => (key) => typeof key === "string" && key.startsWith(token); +const isCSSVariableName = +/*@__PURE__*/ checkStringStartsWith("--"); +const startsAsVariableToken = +/*@__PURE__*/ checkStringStartsWith("var(--"); +const isCSSVariableToken = (value) => { + const startsWithToken = startsAsVariableToken(value); + if (!startsWithToken) + return false; + // Ensure any comments are stripped from the value as this can harm performance of the regex. + return singleCssVariableRegex.test(value.split("/*")[0].trim()); +}; +const singleCssVariableRegex = /var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu; +/** + * Check if a value contains a CSS variable anywhere (e.g. inside calc()). + * Unlike isCSSVariableToken which checks if the value IS a var() token, + * this checks if the value CONTAINS var() somewhere in the string. + */ +function containsCSSVariable(value) { + if (typeof value !== "string") + return false; + // Strip comments to avoid false positives + return value.split("/*")[0].includes("var(--"); +} + +const number = { + test: (v) => typeof v === "number", + parse: parseFloat, + transform: (v) => v, +}; +const alpha = { + ...number, + transform: (v) => motionUtils.clamp(0, 1, v), +}; +const scale = { + ...number, + default: 1, +}; + +// If this number is a decimal, make it just five decimal places +// to avoid exponents +const sanitize = (v) => Math.round(v * 100000) / 100000; + +const floatRegex = /-?(?:\d+(?:\.\d+)?|\.\d+)/gu; + +function isNullish(v) { + return v == null; +} + +const singleColorRegex = /^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu; + +/** + * Returns true if the provided string is a color, ie rgba(0,0,0,0) or #000, + * but false if a number or multiple colors + */ +const isColorString = (type, testProp) => (v) => { + return Boolean((typeof v === "string" && + singleColorRegex.test(v) && + v.startsWith(type)) || + (testProp && + !isNullish(v) && + Object.prototype.hasOwnProperty.call(v, testProp))); +}; +const splitColor = (aName, bName, cName) => (v) => { + if (typeof v !== "string") + return v; + const [a, b, c, alpha] = v.match(floatRegex); + return { + [aName]: parseFloat(a), + [bName]: parseFloat(b), + [cName]: parseFloat(c), + alpha: alpha !== undefined ? parseFloat(alpha) : 1, + }; +}; + +const clampRgbUnit = (v) => motionUtils.clamp(0, 255, v); +const rgbUnit = { + ...number, + transform: (v) => Math.round(clampRgbUnit(v)), +}; +const rgba = { + test: /*@__PURE__*/ isColorString("rgb", "red"), + parse: /*@__PURE__*/ splitColor("red", "green", "blue"), + transform: ({ red, green, blue, alpha: alpha$1 = 1 }) => "rgba(" + + rgbUnit.transform(red) + + ", " + + rgbUnit.transform(green) + + ", " + + rgbUnit.transform(blue) + + ", " + + sanitize(alpha.transform(alpha$1)) + + ")", +}; + +function parseHex(v) { + let r = ""; + let g = ""; + let b = ""; + let a = ""; + // If we have 6 characters, ie #FF0000 + if (v.length > 5) { + r = v.substring(1, 3); + g = v.substring(3, 5); + b = v.substring(5, 7); + a = v.substring(7, 9); + // Or we have 3 characters, ie #F00 + } + else { + r = v.substring(1, 2); + g = v.substring(2, 3); + b = v.substring(3, 4); + a = v.substring(4, 5); + r += r; + g += g; + b += b; + a += a; + } + return { + red: parseInt(r, 16), + green: parseInt(g, 16), + blue: parseInt(b, 16), + alpha: a ? parseInt(a, 16) / 255 : 1, + }; +} +const hex = { + test: /*@__PURE__*/ isColorString("#"), + parse: parseHex, + transform: rgba.transform, +}; + +/*#__NO_SIDE_EFFECTS__*/ +const createUnitType = (unit) => ({ + test: (v) => typeof v === "string" && v.endsWith(unit) && v.split(" ").length === 1, + parse: parseFloat, + transform: (v) => `${v}${unit}`, +}); +const degrees = /*@__PURE__*/ createUnitType("deg"); +const percent = /*@__PURE__*/ createUnitType("%"); +const px = /*@__PURE__*/ createUnitType("px"); +const vh = /*@__PURE__*/ createUnitType("vh"); +const vw = /*@__PURE__*/ createUnitType("vw"); +const progressPercentage = /*@__PURE__*/ (() => ({ + ...percent, + parse: (v) => percent.parse(v) / 100, + transform: (v) => percent.transform(v * 100), +}))(); + +const hsla = { + test: /*@__PURE__*/ isColorString("hsl", "hue"), + parse: /*@__PURE__*/ splitColor("hue", "saturation", "lightness"), + transform: ({ hue, saturation, lightness, alpha: alpha$1 = 1 }) => { + return ("hsla(" + + Math.round(hue) + + ", " + + percent.transform(sanitize(saturation)) + + ", " + + percent.transform(sanitize(lightness)) + + ", " + + sanitize(alpha.transform(alpha$1)) + + ")"); + }, +}; + +const color = { + test: (v) => rgba.test(v) || hex.test(v) || hsla.test(v), + parse: (v) => { + if (rgba.test(v)) { + return rgba.parse(v); + } + else if (hsla.test(v)) { + return hsla.parse(v); + } + else { + return hex.parse(v); + } + }, + transform: (v) => { + return typeof v === "string" + ? v + : v.hasOwnProperty("red") + ? rgba.transform(v) + : hsla.transform(v); + }, + getAnimatableNone: (v) => { + const parsed = color.parse(v); + parsed.alpha = 0; + return color.transform(parsed); + }, +}; + +const colorRegex = /(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu; + +function test(v) { + return (isNaN(v) && + typeof v === "string" && + (v.match(floatRegex)?.length || 0) + + (v.match(colorRegex)?.length || 0) > + 0); +} +const NUMBER_TOKEN = "number"; +const COLOR_TOKEN = "color"; +const VAR_TOKEN = "var"; +const VAR_FUNCTION_TOKEN = "var("; +const SPLIT_TOKEN = "${}"; +// this regex consists of the `singleCssVariableRegex|rgbHSLValueRegex|digitRegex` +const complexRegex = /var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu; +function analyseComplexValue(value) { + const originalValue = value.toString(); + const values = []; + const indexes = { + color: [], + number: [], + var: [], + }; + const types = []; + let i = 0; + const tokenised = originalValue.replace(complexRegex, (parsedValue) => { + if (color.test(parsedValue)) { + indexes.color.push(i); + types.push(COLOR_TOKEN); + values.push(color.parse(parsedValue)); + } + else if (parsedValue.startsWith(VAR_FUNCTION_TOKEN)) { + indexes.var.push(i); + types.push(VAR_TOKEN); + values.push(parsedValue); + } + else { + indexes.number.push(i); + types.push(NUMBER_TOKEN); + values.push(parseFloat(parsedValue)); + } + ++i; + return SPLIT_TOKEN; + }); + const split = tokenised.split(SPLIT_TOKEN); + return { values, split, indexes, types }; +} +function parseComplexValue(v) { + return analyseComplexValue(v).values; +} +function buildTransformer({ split, types }) { + const numSections = split.length; + return (v) => { + let output = ""; + for (let i = 0; i < numSections; i++) { + output += split[i]; + if (v[i] !== undefined) { + const type = types[i]; + if (type === NUMBER_TOKEN) { + output += sanitize(v[i]); + } + else if (type === COLOR_TOKEN) { + output += color.transform(v[i]); + } + else { + output += v[i]; + } + } + } + return output; + }; +} +function createTransformer(source) { + return buildTransformer(analyseComplexValue(source)); +} +const convertNumbersToZero = (v) => typeof v === "number" ? 0 : color.test(v) ? color.getAnimatableNone(v) : v; +/** + * Convert a parsed value to its zero equivalent, but preserve numbers + * that act as divisors in CSS calc() expressions. + * + * analyseComplexValue extracts numbers from CSS strings and puts the + * surrounding text into a `split` template array. For example: + * "calc(var(--gap) / 5)" → values: [var(--gap), 5] + * split: ["calc(", " / ", ")"] + * + * When building a zero-equivalent for animation, naively zeroing all + * numbers turns the divisor into 0 → "calc(var(--gap) / 0)" → NaN. + * We detect this by checking whether the text preceding a number + * (split[i]) ends with "/" — the CSS calc division operator. + */ +const convertToZero = (value, splitBefore) => { + if (typeof value === "number") { + return splitBefore?.trim().endsWith("/") ? value : 0; + } + return convertNumbersToZero(value); +}; +function getAnimatableNone$1(v) { + const info = analyseComplexValue(v); + const transformer = buildTransformer(info); + return transformer(info.values.map((value, i) => convertToZero(value, info.split[i]))); +} +const complex = { + test, + parse: parseComplexValue, + createTransformer, + getAnimatableNone: getAnimatableNone$1, +}; + +// Adapted from https://gist.github.com/mjackson/5311256 +function hueToRgb(p, q, t) { + if (t < 0) + t += 1; + if (t > 1) + t -= 1; + if (t < 1 / 6) + return p + (q - p) * 6 * t; + if (t < 1 / 2) + return q; + if (t < 2 / 3) + return p + (q - p) * (2 / 3 - t) * 6; + return p; +} +function hslaToRgba({ hue, saturation, lightness, alpha }) { + hue /= 360; + saturation /= 100; + lightness /= 100; + let red = 0; + let green = 0; + let blue = 0; + if (!saturation) { + red = green = blue = lightness; + } + else { + const q = lightness < 0.5 + ? lightness * (1 + saturation) + : lightness + saturation - lightness * saturation; + const p = 2 * lightness - q; + red = hueToRgb(p, q, hue + 1 / 3); + green = hueToRgb(p, q, hue); + blue = hueToRgb(p, q, hue - 1 / 3); + } + return { + red: Math.round(red * 255), + green: Math.round(green * 255), + blue: Math.round(blue * 255), + alpha, + }; +} + +function mixImmediate(a, b) { + return (p) => (p > 0 ? b : a); +} + +/* + Value in range from progress + + Given a lower limit and an upper limit, we return the value within + that range as expressed by progress (usually a number from 0 to 1) + + So progress = 0.5 would change + + from -------- to + + to + + from ---- to + + E.g. from = 10, to = 20, progress = 0.5 => 15 + + @param [number]: Lower limit of range + @param [number]: Upper limit of range + @param [number]: The progress between lower and upper limits expressed 0-1 + @return [number]: Value as calculated from progress within range (not limited within range) +*/ +const mixNumber$1 = (from, to, progress) => { + return from + (to - from) * progress; +}; + +// Linear color space blending +// Explained https://www.youtube.com/watch?v=LKnqECcg6Gw +// Demonstrated http://codepen.io/osublake/pen/xGVVaN +const mixLinearColor = (from, to, v) => { + const fromExpo = from * from; + const expo = v * (to * to - fromExpo) + fromExpo; + return expo < 0 ? 0 : Math.sqrt(expo); +}; +const colorTypes = [hex, rgba, hsla]; +const getColorType = (v) => colorTypes.find((type) => type.test(v)); +function asRGBA(color) { + const type = getColorType(color); + motionUtils.warning(Boolean(type), `'${color}' is not an animatable color. Use the equivalent color code instead.`, "color-not-animatable"); + if (!Boolean(type)) + return false; + let model = type.parse(color); + if (type === hsla) { + // TODO Remove this cast - needed since Motion's stricter typing + model = hslaToRgba(model); + } + return model; +} +const mixColor = (from, to) => { + const fromRGBA = asRGBA(from); + const toRGBA = asRGBA(to); + if (!fromRGBA || !toRGBA) { + return mixImmediate(from, to); + } + const blended = { ...fromRGBA }; + return (v) => { + blended.red = mixLinearColor(fromRGBA.red, toRGBA.red, v); + blended.green = mixLinearColor(fromRGBA.green, toRGBA.green, v); + blended.blue = mixLinearColor(fromRGBA.blue, toRGBA.blue, v); + blended.alpha = mixNumber$1(fromRGBA.alpha, toRGBA.alpha, v); + return rgba.transform(blended); + }; +}; + +const invisibleValues = new Set(["none", "hidden"]); +/** + * Returns a function that, when provided a progress value between 0 and 1, + * will return the "none" or "hidden" string only when the progress is that of + * the origin or target. + */ +function mixVisibility(origin, target) { + if (invisibleValues.has(origin)) { + return (p) => (p <= 0 ? origin : target); + } + else { + return (p) => (p >= 1 ? target : origin); + } +} + +function mixNumber(a, b) { + return (p) => mixNumber$1(a, b, p); +} +function getMixer(a) { + if (typeof a === "number") { + return mixNumber; + } + else if (typeof a === "string") { + return isCSSVariableToken(a) + ? mixImmediate + : color.test(a) + ? mixColor + : mixComplex; + } + else if (Array.isArray(a)) { + return mixArray; + } + else if (typeof a === "object") { + return color.test(a) ? mixColor : mixObject; + } + return mixImmediate; +} +function mixArray(a, b) { + const output = [...a]; + const numValues = output.length; + const blendValue = a.map((v, i) => getMixer(v)(v, b[i])); + return (p) => { + for (let i = 0; i < numValues; i++) { + output[i] = blendValue[i](p); + } + return output; + }; +} +function mixObject(a, b) { + const output = { ...a, ...b }; + const blendValue = {}; + for (const key in output) { + if (a[key] !== undefined && b[key] !== undefined) { + blendValue[key] = getMixer(a[key])(a[key], b[key]); + } + } + return (v) => { + for (const key in blendValue) { + output[key] = blendValue[key](v); + } + return output; + }; +} +function matchOrder(origin, target) { + const orderedOrigin = []; + const pointers = { color: 0, var: 0, number: 0 }; + for (let i = 0; i < target.values.length; i++) { + const type = target.types[i]; + const originIndex = origin.indexes[type][pointers[type]]; + const originValue = origin.values[originIndex] ?? 0; + orderedOrigin[i] = originValue; + pointers[type]++; + } + return orderedOrigin; +} +const mixComplex = (origin, target) => { + const template = complex.createTransformer(target); + const originStats = analyseComplexValue(origin); + const targetStats = analyseComplexValue(target); + const canInterpolate = originStats.indexes.var.length === targetStats.indexes.var.length && + originStats.indexes.color.length === targetStats.indexes.color.length && + originStats.indexes.number.length >= targetStats.indexes.number.length; + if (canInterpolate) { + if ((invisibleValues.has(origin) && + !targetStats.values.length) || + (invisibleValues.has(target) && + !originStats.values.length)) { + return mixVisibility(origin, target); + } + return motionUtils.pipe(mixArray(matchOrder(originStats, targetStats), targetStats.values), template); + } + else { + motionUtils.warning(true, `Complex values '${origin}' and '${target}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`, "complex-values-different"); + return mixImmediate(origin, target); + } +}; + +function mix(from, to, p) { + if (typeof from === "number" && + typeof to === "number" && + typeof p === "number") { + return mixNumber$1(from, to, p); + } + const mixer = getMixer(from); + return mixer(from, to); +} + +const frameloopDriver = (update) => { + const passTimestamp = ({ timestamp }) => update(timestamp); + return { + start: (keepAlive = true) => frame.update(passTimestamp, keepAlive), + stop: () => cancelFrame(passTimestamp), + /** + * If we're processing this frame we can use the + * framelocked timestamp to keep things in sync. + */ + now: () => (frameData.isProcessing ? frameData.timestamp : time.now()), + }; +}; + +const generateLinearEasing = (easing, duration, // as milliseconds +resolution = 10 // as milliseconds +) => { + let points = ""; + const numPoints = Math.max(Math.round(duration / resolution), 2); + for (let i = 0; i < numPoints; i++) { + points += Math.round(easing(i / (numPoints - 1)) * 10000) / 10000 + ", "; + } + return `linear(${points.substring(0, points.length - 2)})`; +}; + +/** + * Implement a practical max duration for keyframe generation + * to prevent infinite loops + */ +const maxGeneratorDuration = 20000; +function calcGeneratorDuration(generator) { + let duration = 0; + const timeStep = 50; + let state = generator.next(duration); + while (!state.done && duration < maxGeneratorDuration) { + duration += timeStep; + state = generator.next(duration); + } + return duration >= maxGeneratorDuration ? Infinity : duration; +} + +/** + * Create a progress => progress easing function from a generator. + */ +function createGeneratorEasing(options, scale = 100, createGenerator) { + const generator = createGenerator({ ...options, keyframes: [0, scale] }); + const duration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration); + return { + type: "keyframes", + ease: (progress) => { + return generator.next(duration * progress).value / scale; + }, + duration: motionUtils.millisecondsToSeconds(duration), + }; +} + +const springDefaults = { + // Default spring physics + stiffness: 100, + damping: 10, + mass: 1.0, + velocity: 0.0, + // Default duration/bounce-based options + duration: 800, // in ms + bounce: 0.3, + visualDuration: 0.3, // in seconds + // Rest thresholds + restSpeed: { + granular: 0.01, + default: 2, + }, + restDelta: { + granular: 0.005, + default: 0.5, + }, + // Limits + minDuration: 0.01, // in seconds + maxDuration: 10.0, // in seconds + minDamping: 0.05, + maxDamping: 1, +}; +function calcAngularFreq(undampedFreq, dampingRatio) { + return undampedFreq * Math.sqrt(1 - dampingRatio * dampingRatio); +} +const rootIterations = 12; +function approximateRoot(envelope, derivative, initialGuess) { + let result = initialGuess; + for (let i = 1; i < rootIterations; i++) { + result = result - envelope(result) / derivative(result); + } + return result; +} +/** + * This is ported from the Framer implementation of duration-based spring resolution. + */ +const safeMin = 0.001; +function findSpring({ duration = springDefaults.duration, bounce = springDefaults.bounce, velocity = springDefaults.velocity, mass = springDefaults.mass, }) { + let envelope; + let derivative; + motionUtils.warning(duration <= motionUtils.secondsToMilliseconds(springDefaults.maxDuration), "Spring duration must be 10 seconds or less", "spring-duration-limit"); + let dampingRatio = 1 - bounce; + /** + * Restrict dampingRatio and duration to within acceptable ranges. + */ + dampingRatio = motionUtils.clamp(springDefaults.minDamping, springDefaults.maxDamping, dampingRatio); + duration = motionUtils.clamp(springDefaults.minDuration, springDefaults.maxDuration, motionUtils.millisecondsToSeconds(duration)); + if (dampingRatio < 1) { + /** + * Underdamped spring + */ + envelope = (undampedFreq) => { + const exponentialDecay = undampedFreq * dampingRatio; + const delta = exponentialDecay * duration; + const a = exponentialDecay - velocity; + const b = calcAngularFreq(undampedFreq, dampingRatio); + const c = Math.exp(-delta); + return safeMin - (a / b) * c; + }; + derivative = (undampedFreq) => { + const exponentialDecay = undampedFreq * dampingRatio; + const delta = exponentialDecay * duration; + const d = delta * velocity + velocity; + const e = Math.pow(dampingRatio, 2) * Math.pow(undampedFreq, 2) * duration; + const f = Math.exp(-delta); + const g = calcAngularFreq(Math.pow(undampedFreq, 2), dampingRatio); + const factor = -envelope(undampedFreq) + safeMin > 0 ? -1 : 1; + return (factor * ((d - e) * f)) / g; + }; + } + else { + /** + * Critically-damped spring + */ + envelope = (undampedFreq) => { + const a = Math.exp(-undampedFreq * duration); + const b = (undampedFreq - velocity) * duration + 1; + return -safeMin + a * b; + }; + derivative = (undampedFreq) => { + const a = Math.exp(-undampedFreq * duration); + const b = (velocity - undampedFreq) * (duration * duration); + return a * b; + }; + } + const initialGuess = 5 / duration; + const undampedFreq = approximateRoot(envelope, derivative, initialGuess); + duration = motionUtils.secondsToMilliseconds(duration); + if (isNaN(undampedFreq)) { + return { + stiffness: springDefaults.stiffness, + damping: springDefaults.damping, + duration, + }; + } + else { + const stiffness = Math.pow(undampedFreq, 2) * mass; + return { + stiffness, + damping: dampingRatio * 2 * Math.sqrt(mass * stiffness), + duration, + }; + } +} +const durationKeys = ["duration", "bounce"]; +const physicsKeys = ["stiffness", "damping", "mass"]; +function isSpringType(options, keys) { + return keys.some((key) => options[key] !== undefined); +} +function getSpringOptions(options) { + let springOptions = { + velocity: springDefaults.velocity, + stiffness: springDefaults.stiffness, + damping: springDefaults.damping, + mass: springDefaults.mass, + isResolvedFromDuration: false, + ...options, + }; + // stiffness/damping/mass overrides duration/bounce + if (!isSpringType(options, physicsKeys) && + isSpringType(options, durationKeys)) { + // Time-defined springs should ignore inherited velocity. + // Velocity from interrupted animations can cause findSpring() + // to compute wildly different spring parameters, leading to + // massive oscillation on small-range animations. + springOptions.velocity = 0; + if (options.visualDuration) { + const visualDuration = options.visualDuration; + const root = (2 * Math.PI) / (visualDuration * 1.2); + const stiffness = root * root; + const damping = 2 * + motionUtils.clamp(0.05, 1, 1 - (options.bounce || 0)) * + Math.sqrt(stiffness); + springOptions = { + ...springOptions, + mass: springDefaults.mass, + stiffness, + damping, + }; + } + else { + const derived = findSpring({ ...options, velocity: 0 }); + springOptions = { + ...springOptions, + ...derived, + mass: springDefaults.mass, + }; + springOptions.isResolvedFromDuration = true; + } + } + return springOptions; +} +function spring(optionsOrVisualDuration = springDefaults.visualDuration, bounce = springDefaults.bounce) { + const options = typeof optionsOrVisualDuration !== "object" + ? { + visualDuration: optionsOrVisualDuration, + keyframes: [0, 1], + bounce, + } + : optionsOrVisualDuration; + let { restSpeed, restDelta } = options; + const origin = options.keyframes[0]; + const target = options.keyframes[options.keyframes.length - 1]; + /** + * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator + * to reduce GC during animation. + */ + const state = { done: false, value: origin }; + const { stiffness, damping, mass, duration, velocity, isResolvedFromDuration, } = getSpringOptions({ + ...options, + velocity: -motionUtils.millisecondsToSeconds(options.velocity || 0), + }); + const initialVelocity = velocity || 0.0; + const dampingRatio = damping / (2 * Math.sqrt(stiffness * mass)); + const initialDelta = target - origin; + const undampedAngularFreq = motionUtils.millisecondsToSeconds(Math.sqrt(stiffness / mass)); + /** + * If we're working on a granular scale, use smaller defaults for determining + * when the spring is finished. + * + * These defaults have been selected emprically based on what strikes a good + * ratio between feeling good and finishing as soon as changes are imperceptible. + */ + const isGranularScale = Math.abs(initialDelta) < 5; + restSpeed || (restSpeed = isGranularScale + ? springDefaults.restSpeed.granular + : springDefaults.restSpeed.default); + restDelta || (restDelta = isGranularScale + ? springDefaults.restDelta.granular + : springDefaults.restDelta.default); + let resolveSpring; + let resolveVelocity; + // Underdamped coefficients, hoisted for use in the inlined next() hot path + let angularFreq; + let A; + let sinCoeff; + let cosCoeff; + if (dampingRatio < 1) { + angularFreq = calcAngularFreq(undampedAngularFreq, dampingRatio); + A = + (initialVelocity + + dampingRatio * undampedAngularFreq * initialDelta) / + angularFreq; + // Underdamped spring + resolveSpring = (t) => { + const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); + return (target - + envelope * + (A * Math.sin(angularFreq * t) + + initialDelta * Math.cos(angularFreq * t))); + }; + // Analytical derivative of underdamped spring (px/ms) + sinCoeff = + dampingRatio * undampedAngularFreq * A + initialDelta * angularFreq; + cosCoeff = + dampingRatio * undampedAngularFreq * initialDelta - A * angularFreq; + resolveVelocity = (t) => { + const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); + return envelope * + (sinCoeff * Math.sin(angularFreq * t) + + cosCoeff * Math.cos(angularFreq * t)); + }; + } + else if (dampingRatio === 1) { + // Critically damped spring + resolveSpring = (t) => target - + Math.exp(-undampedAngularFreq * t) * + (initialDelta + + (initialVelocity + undampedAngularFreq * initialDelta) * t); + // Analytical derivative of critically damped spring (px/ms) + const C = initialVelocity + undampedAngularFreq * initialDelta; + resolveVelocity = (t) => Math.exp(-undampedAngularFreq * t) * + (undampedAngularFreq * C * t - initialVelocity); + } + else { + // Overdamped spring + const dampedAngularFreq = undampedAngularFreq * Math.sqrt(dampingRatio * dampingRatio - 1); + resolveSpring = (t) => { + const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); + // When performing sinh or cosh values can hit Infinity so we cap them here + const freqForT = Math.min(dampedAngularFreq * t, 300); + return (target - + (envelope * + ((initialVelocity + + dampingRatio * undampedAngularFreq * initialDelta) * + Math.sinh(freqForT) + + dampedAngularFreq * + initialDelta * + Math.cosh(freqForT))) / + dampedAngularFreq); + }; + // Analytical derivative of overdamped spring (px/ms) + const P = (initialVelocity + + dampingRatio * undampedAngularFreq * initialDelta) / + dampedAngularFreq; + const sinhCoeff = dampingRatio * undampedAngularFreq * P - initialDelta * dampedAngularFreq; + const coshCoeff = dampingRatio * undampedAngularFreq * initialDelta - P * dampedAngularFreq; + resolveVelocity = (t) => { + const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); + const freqForT = Math.min(dampedAngularFreq * t, 300); + return envelope * + (sinhCoeff * Math.sinh(freqForT) + + coshCoeff * Math.cosh(freqForT)); + }; + } + const generator = { + calculatedDuration: isResolvedFromDuration ? duration || null : null, + velocity: (t) => motionUtils.secondsToMilliseconds(resolveVelocity(t)), + next: (t) => { + /** + * For underdamped physics springs we need both position and + * velocity each tick. Compute shared trig values once to avoid + * duplicate Math.exp/sin/cos calls on the hot path. + */ + if (!isResolvedFromDuration && dampingRatio < 1) { + const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); + const sin = Math.sin(angularFreq * t); + const cos = Math.cos(angularFreq * t); + const current = target - + envelope * + (A * sin + initialDelta * cos); + const currentVelocity = motionUtils.secondsToMilliseconds(envelope * + (sinCoeff * sin + cosCoeff * cos)); + state.done = + Math.abs(currentVelocity) <= restSpeed && + Math.abs(target - current) <= restDelta; + state.value = state.done ? target : current; + return state; + } + const current = resolveSpring(t); + if (!isResolvedFromDuration) { + const currentVelocity = motionUtils.secondsToMilliseconds(resolveVelocity(t)); + state.done = + Math.abs(currentVelocity) <= restSpeed && + Math.abs(target - current) <= restDelta; + } + else { + state.done = t >= duration; + } + state.value = state.done ? target : current; + return state; + }, + toString: () => { + const calculatedDuration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration); + const easing = generateLinearEasing((progress) => generator.next(calculatedDuration * progress).value, calculatedDuration, 30); + return calculatedDuration + "ms " + easing; + }, + toTransition: () => { }, + }; + return generator; +} +spring.applyToOptions = (options) => { + const generatorOptions = createGeneratorEasing(options, 100, spring); + options.ease = generatorOptions.ease; + options.duration = motionUtils.secondsToMilliseconds(generatorOptions.duration); + options.type = "keyframes"; + return options; +}; + +const velocitySampleDuration = 5; // ms +function getGeneratorVelocity(resolveValue, t, current) { + const prevT = Math.max(t - velocitySampleDuration, 0); + return motionUtils.velocityPerSecond(current - resolveValue(prevT), t - prevT); +} + +function inertia({ keyframes, velocity = 0.0, power = 0.8, timeConstant = 325, bounceDamping = 10, bounceStiffness = 500, modifyTarget, min, max, restDelta = 0.5, restSpeed, }) { + const origin = keyframes[0]; + const state = { + done: false, + value: origin, + }; + const isOutOfBounds = (v) => (min !== undefined && v < min) || (max !== undefined && v > max); + const nearestBoundary = (v) => { + if (min === undefined) + return max; + if (max === undefined) + return min; + return Math.abs(min - v) < Math.abs(max - v) ? min : max; + }; + let amplitude = power * velocity; + const ideal = origin + amplitude; + const target = modifyTarget === undefined ? ideal : modifyTarget(ideal); + /** + * If the target has changed we need to re-calculate the amplitude, otherwise + * the animation will start from the wrong position. + */ + if (target !== ideal) + amplitude = target - origin; + const calcDelta = (t) => -amplitude * Math.exp(-t / timeConstant); + const calcLatest = (t) => target + calcDelta(t); + const applyFriction = (t) => { + const delta = calcDelta(t); + const latest = calcLatest(t); + state.done = Math.abs(delta) <= restDelta; + state.value = state.done ? target : latest; + }; + /** + * Ideally this would resolve for t in a stateless way, we could + * do that by always precalculating the animation but as we know + * this will be done anyway we can assume that spring will + * be discovered during that. + */ + let timeReachedBoundary; + let spring$1; + const checkCatchBoundary = (t) => { + if (!isOutOfBounds(state.value)) + return; + timeReachedBoundary = t; + spring$1 = spring({ + keyframes: [state.value, nearestBoundary(state.value)], + velocity: getGeneratorVelocity(calcLatest, t, state.value), // TODO: This should be passing * 1000 + damping: bounceDamping, + stiffness: bounceStiffness, + restDelta, + restSpeed, + }); + }; + checkCatchBoundary(0); + return { + calculatedDuration: null, + next: (t) => { + /** + * We need to resolve the friction to figure out if we need a + * spring but we don't want to do this twice per frame. So here + * we flag if we updated for this frame and later if we did + * we can skip doing it again. + */ + let hasUpdatedFrame = false; + if (!spring$1 && timeReachedBoundary === undefined) { + hasUpdatedFrame = true; + applyFriction(t); + checkCatchBoundary(t); + } + /** + * If we have a spring and the provided t is beyond the moment the friction + * animation crossed the min/max boundary, use the spring. + */ + if (timeReachedBoundary !== undefined && t >= timeReachedBoundary) { + return spring$1.next(t - timeReachedBoundary); + } + else { + !hasUpdatedFrame && applyFriction(t); + return state; + } + }, + }; +} + +function createMixers(output, ease, customMixer) { + const mixers = []; + const mixerFactory = customMixer || motionUtils.MotionGlobalConfig.mix || mix; + const numMixers = output.length - 1; + for (let i = 0; i < numMixers; i++) { + let mixer = mixerFactory(output[i], output[i + 1]); + if (ease) { + const easingFunction = Array.isArray(ease) ? ease[i] || motionUtils.noop : ease; + mixer = motionUtils.pipe(easingFunction, mixer); + } + mixers.push(mixer); + } + return mixers; +} +/** + * Create a function that maps from a numerical input array to a generic output array. + * + * Accepts: + * - Numbers + * - Colors (hex, hsl, hsla, rgb, rgba) + * - Complex (combinations of one or more numbers or strings) + * + * ```jsx + * const mixColor = interpolate([0, 1], ['#fff', '#000']) + * + * mixColor(0.5) // 'rgba(128, 128, 128, 1)' + * ``` + * + * TODO Revisit this approach once we've moved to data models for values, + * probably not needed to pregenerate mixer functions. + * + * @public + */ +function interpolate(input, output, { clamp: isClamp = true, ease, mixer } = {}) { + const inputLength = input.length; + motionUtils.invariant(inputLength === output.length, "Both input and output ranges must be the same length", "range-length"); + /** + * If we're only provided a single input, we can just make a function + * that returns the output. + */ + if (inputLength === 1) + return () => output[0]; + if (inputLength === 2 && output[0] === output[1]) + return () => output[1]; + const isZeroDeltaRange = input[0] === input[1]; + // If input runs highest -> lowest, reverse both arrays + if (input[0] > input[inputLength - 1]) { + input = [...input].reverse(); + output = [...output].reverse(); + } + const mixers = createMixers(output, ease, mixer); + const numMixers = mixers.length; + const interpolator = (v) => { + if (isZeroDeltaRange && v < input[0]) + return output[0]; + let i = 0; + if (numMixers > 1) { + for (; i < input.length - 2; i++) { + if (v < input[i + 1]) + break; + } + } + const progressInRange = motionUtils.progress(input[i], input[i + 1], v); + return mixers[i](progressInRange); + }; + return isClamp + ? (v) => interpolator(motionUtils.clamp(input[0], input[inputLength - 1], v)) + : interpolator; +} + +function fillOffset(offset, remaining) { + const min = offset[offset.length - 1]; + for (let i = 1; i <= remaining; i++) { + const offsetProgress = motionUtils.progress(0, remaining, i); + offset.push(mixNumber$1(min, 1, offsetProgress)); + } +} + +function defaultOffset(arr) { + const offset = [0]; + fillOffset(offset, arr.length - 1); + return offset; +} + +function convertOffsetToTimes(offset, duration) { + return offset.map((o) => o * duration); +} + +function defaultEasing(values, easing) { + return values.map(() => easing || motionUtils.easeInOut).splice(0, values.length - 1); +} +function keyframes({ duration = 300, keyframes: keyframeValues, times, ease = "easeInOut", }) { + /** + * Easing functions can be externally defined as strings. Here we convert them + * into actual functions. + */ + const easingFunctions = motionUtils.isEasingArray(ease) + ? ease.map(motionUtils.easingDefinitionToFunction) + : motionUtils.easingDefinitionToFunction(ease); + /** + * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator + * to reduce GC during animation. + */ + const state = { + done: false, + value: keyframeValues[0], + }; + /** + * Create a times array based on the provided 0-1 offsets + */ + const absoluteTimes = convertOffsetToTimes( + // Only use the provided offsets if they're the correct length + // TODO Maybe we should warn here if there's a length mismatch + times && times.length === keyframeValues.length + ? times + : defaultOffset(keyframeValues), duration); + const mapTimeToKeyframe = interpolate(absoluteTimes, keyframeValues, { + ease: Array.isArray(easingFunctions) + ? easingFunctions + : defaultEasing(keyframeValues, easingFunctions), + }); + return { + calculatedDuration: duration, + next: (t) => { + state.value = mapTimeToKeyframe(t); + state.done = t >= duration; + return state; + }, + }; +} + +const isNotNull = (value) => value !== null; +function getFinalKeyframe(keyframes, { repeat, repeatType = "loop" }, finalKeyframe, speed = 1) { + const resolvedKeyframes = keyframes.filter(isNotNull); + const useFirstKeyframe = speed < 0 || (repeat && repeatType !== "loop" && repeat % 2 === 1); + const index = useFirstKeyframe ? 0 : resolvedKeyframes.length - 1; + return !index || finalKeyframe === undefined + ? resolvedKeyframes[index] + : finalKeyframe; +} + +const transitionTypeMap = { + decay: inertia, + inertia, + tween: keyframes, + keyframes: keyframes, + spring, +}; +function replaceTransitionType(transition) { + if (typeof transition.type === "string") { + transition.type = transitionTypeMap[transition.type]; + } +} + +class WithPromise { + constructor() { + this.updateFinished(); + } + get finished() { + return this._finished; + } + updateFinished() { + this._finished = new Promise((resolve) => { + this.resolve = resolve; + }); + } + notifyFinished() { + this.resolve(); + } + /** + * Allows the animation to be awaited. + * + * @deprecated Use `finished` instead. + */ + then(onResolve, onReject) { + return this.finished.then(onResolve, onReject); + } +} + +const percentToProgress = (percent) => percent / 100; +class JSAnimation extends WithPromise { + constructor(options) { + super(); + this.state = "idle"; + this.startTime = null; + this.isStopped = false; + /** + * The current time of the animation. + */ + this.currentTime = 0; + /** + * The time at which the animation was paused. + */ + this.holdTime = null; + /** + * Playback speed as a factor. 0 would be stopped, -1 reverse and 2 double speed. + */ + this.playbackSpeed = 1; + /** + * Reusable state object for the delay phase to avoid + * allocating a new object every frame. + */ + this.delayState = { + done: false, + value: undefined, + }; + /** + * This method is bound to the instance to fix a pattern where + * animation.stop is returned as a reference from a useEffect. + */ + this.stop = () => { + const { motionValue } = this.options; + if (motionValue && motionValue.updatedAt !== time.now()) { + this.tick(time.now()); + } + this.isStopped = true; + if (this.state === "idle") + return; + this.teardown(); + this.options.onStop?.(); + }; + this.options = options; + this.initAnimation(); + this.play(); + if (options.autoplay === false) + this.pause(); + } + initAnimation() { + const { options } = this; + replaceTransitionType(options); + const { type = keyframes, repeat = 0, repeatDelay = 0, repeatType, velocity = 0, } = options; + let { keyframes: keyframes$1 } = options; + const generatorFactory = type || keyframes; + if (process.env.NODE_ENV !== "production" && + generatorFactory !== keyframes) { + motionUtils.invariant(keyframes$1.length <= 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${keyframes$1}`, "spring-two-frames"); + } + if (generatorFactory !== keyframes && + typeof keyframes$1[0] !== "number") { + this.mixKeyframes = motionUtils.pipe(percentToProgress, mix(keyframes$1[0], keyframes$1[1])); + keyframes$1 = [0, 100]; + } + const generator = generatorFactory({ ...options, keyframes: keyframes$1 }); + /** + * If we have a mirror repeat type we need to create a second generator that outputs the + * mirrored (not reversed) animation and later ping pong between the two generators. + */ + if (repeatType === "mirror") { + this.mirroredGenerator = generatorFactory({ + ...options, + keyframes: [...keyframes$1].reverse(), + velocity: -velocity, + }); + } + /** + * If duration is undefined and we have repeat options, + * we need to calculate a duration from the generator. + * + * We set it to the generator itself to cache the duration. + * Any timeline resolver will need to have already precalculated + * the duration by this step. + */ + if (generator.calculatedDuration === null) { + generator.calculatedDuration = calcGeneratorDuration(generator); + } + const { calculatedDuration } = generator; + this.calculatedDuration = calculatedDuration; + this.resolvedDuration = calculatedDuration + repeatDelay; + this.totalDuration = this.resolvedDuration * (repeat + 1) - repeatDelay; + this.generator = generator; + } + updateTime(timestamp) { + const animationTime = Math.round(timestamp - this.startTime) * this.playbackSpeed; + // Update currentTime + if (this.holdTime !== null) { + this.currentTime = this.holdTime; + } + else { + // Rounding the time because floating point arithmetic is not always accurate, e.g. 3000.367 - 1000.367 = + // 2000.0000000000002. This is a problem when we are comparing the currentTime with the duration, for + // example. + this.currentTime = animationTime; + } + } + tick(timestamp, sample = false) { + const { generator, totalDuration, mixKeyframes, mirroredGenerator, resolvedDuration, calculatedDuration, } = this; + if (this.startTime === null) + return generator.next(0); + const { delay = 0, keyframes, repeat, repeatType, repeatDelay, type, onUpdate, finalKeyframe, } = this.options; + /** + * requestAnimationFrame timestamps can come through as lower than + * the startTime as set by performance.now(). Here we prevent this, + * though in the future it could be possible to make setting startTime + * a pending operation that gets resolved here. + */ + if (this.speed > 0) { + this.startTime = Math.min(this.startTime, timestamp); + } + else if (this.speed < 0) { + this.startTime = Math.min(timestamp - totalDuration / this.speed, this.startTime); + } + if (sample) { + this.currentTime = timestamp; + } + else { + this.updateTime(timestamp); + } + // Rebase on delay + const timeWithoutDelay = this.currentTime - delay * (this.playbackSpeed >= 0 ? 1 : -1); + const isInDelayPhase = this.playbackSpeed >= 0 + ? timeWithoutDelay < 0 + : timeWithoutDelay > totalDuration; + this.currentTime = Math.max(timeWithoutDelay, 0); + // If this animation has finished, set the current time to the total duration. + if (this.state === "finished" && this.holdTime === null) { + this.currentTime = totalDuration; + } + let elapsed = this.currentTime; + let frameGenerator = generator; + if (repeat) { + /** + * Get the current progress (0-1) of the animation. If t is > + * than duration we'll get values like 2.5 (midway through the + * third iteration) + */ + const progress = Math.min(this.currentTime, totalDuration) / resolvedDuration; + /** + * Get the current iteration (0 indexed). For instance the floor of + * 2.5 is 2. + */ + let currentIteration = Math.floor(progress); + /** + * Get the current progress of the iteration by taking the remainder + * so 2.5 is 0.5 through iteration 2 + */ + let iterationProgress = progress % 1.0; + /** + * If iteration progress is 1 we count that as the end + * of the previous iteration. + */ + if (!iterationProgress && progress >= 1) { + iterationProgress = 1; + } + iterationProgress === 1 && currentIteration--; + currentIteration = Math.min(currentIteration, repeat + 1); + /** + * Reverse progress if we're not running in "normal" direction + */ + const isOddIteration = Boolean(currentIteration % 2); + if (isOddIteration) { + if (repeatType === "reverse") { + iterationProgress = 1 - iterationProgress; + if (repeatDelay) { + iterationProgress -= repeatDelay / resolvedDuration; + } + } + else if (repeatType === "mirror") { + frameGenerator = mirroredGenerator; + } + } + elapsed = motionUtils.clamp(0, 1, iterationProgress) * resolvedDuration; + } + /** + * If we're in negative time, set state as the initial keyframe. + * This prevents delay: x, duration: 0 animations from finishing + * instantly. + */ + let state; + if (isInDelayPhase) { + this.delayState.value = keyframes[0]; + state = this.delayState; + } + else { + state = frameGenerator.next(elapsed); + } + if (mixKeyframes && !isInDelayPhase) { + state.value = mixKeyframes(state.value); + } + let { done } = state; + if (!isInDelayPhase && calculatedDuration !== null) { + done = + this.playbackSpeed >= 0 + ? this.currentTime >= totalDuration + : this.currentTime <= 0; + } + const isAnimationFinished = this.holdTime === null && + (this.state === "finished" || (this.state === "running" && done)); + // TODO: The exception for inertia could be cleaner here + if (isAnimationFinished && type !== inertia) { + state.value = getFinalKeyframe(keyframes, this.options, finalKeyframe, this.speed); + } + if (onUpdate) { + onUpdate(state.value); + } + if (isAnimationFinished) { + this.finish(); + } + return state; + } + /** + * Allows the returned animation to be awaited or promise-chained. Currently + * resolves when the animation finishes at all but in a future update could/should + * reject if its cancels. + */ + then(resolve, reject) { + return this.finished.then(resolve, reject); + } + get duration() { + return motionUtils.millisecondsToSeconds(this.calculatedDuration); + } + get iterationDuration() { + const { delay = 0 } = this.options || {}; + return this.duration + motionUtils.millisecondsToSeconds(delay); + } + get time() { + return motionUtils.millisecondsToSeconds(this.currentTime); + } + set time(newTime) { + newTime = motionUtils.secondsToMilliseconds(newTime); + this.currentTime = newTime; + if (this.startTime === null || + this.holdTime !== null || + this.playbackSpeed === 0) { + this.holdTime = newTime; + } + else if (this.driver) { + this.startTime = this.driver.now() - newTime / this.playbackSpeed; + } + if (this.driver) { + this.driver.start(false); + } + else { + this.startTime = 0; + this.state = "paused"; + this.holdTime = newTime; + this.tick(newTime); + } + } + /** + * Returns the generator's velocity at the current time in units/second. + * Uses the analytical derivative when available (springs), avoiding + * the MotionValue's frame-dependent velocity estimation. + */ + getGeneratorVelocity() { + const t = this.currentTime; + if (t <= 0) + return this.options.velocity || 0; + if (this.generator.velocity) { + return this.generator.velocity(t); + } + // Fallback: finite difference + const current = this.generator.next(t).value; + return getGeneratorVelocity((s) => this.generator.next(s).value, t, current); + } + get speed() { + return this.playbackSpeed; + } + set speed(newSpeed) { + const hasChanged = this.playbackSpeed !== newSpeed; + if (hasChanged && this.driver) { + this.updateTime(time.now()); + } + this.playbackSpeed = newSpeed; + if (hasChanged && this.driver) { + this.time = motionUtils.millisecondsToSeconds(this.currentTime); + } + } + play() { + if (this.isStopped) + return; + const { driver = frameloopDriver, startTime } = this.options; + if (!this.driver) { + this.driver = driver((timestamp) => this.tick(timestamp)); + } + this.options.onPlay?.(); + const now = this.driver.now(); + if (this.state === "finished") { + this.updateFinished(); + this.startTime = now; + } + else if (this.holdTime !== null) { + this.startTime = now - this.holdTime; + } + else if (!this.startTime) { + this.startTime = startTime ?? now; + } + if (this.state === "finished" && this.speed < 0) { + this.startTime += this.calculatedDuration; + } + this.holdTime = null; + /** + * Set playState to running only after we've used it in + * the previous logic. + */ + this.state = "running"; + this.driver.start(); + } + pause() { + this.state = "paused"; + this.updateTime(time.now()); + this.holdTime = this.currentTime; + } + complete() { + if (this.state !== "running") { + this.play(); + } + this.state = "finished"; + this.holdTime = null; + } + finish() { + this.notifyFinished(); + this.teardown(); + this.state = "finished"; + this.options.onComplete?.(); + } + cancel() { + this.holdTime = null; + this.startTime = 0; + this.tick(0); + this.teardown(); + this.options.onCancel?.(); + } + teardown() { + this.state = "idle"; + this.stopDriver(); + this.startTime = this.holdTime = null; + } + stopDriver() { + if (!this.driver) + return; + this.driver.stop(); + this.driver = undefined; + } + sample(sampleTime) { + this.startTime = 0; + return this.tick(sampleTime, true); + } + attachTimeline(timeline) { + if (this.options.allowFlatten) { + this.options.type = "keyframes"; + this.options.ease = "linear"; + this.initAnimation(); + } + this.driver?.stop(); + return timeline.observe(this); + } +} +// Legacy function support +function animateValue(options) { + return new JSAnimation(options); +} + +function fillWildcards(keyframes) { + for (let i = 1; i < keyframes.length; i++) { + keyframes[i] ?? (keyframes[i] = keyframes[i - 1]); + } +} + +const radToDeg = (rad) => (rad * 180) / Math.PI; +const rotate = (v) => { + const angle = radToDeg(Math.atan2(v[1], v[0])); + return rebaseAngle(angle); +}; +const matrix2dParsers = { + x: 4, + y: 5, + translateX: 4, + translateY: 5, + scaleX: 0, + scaleY: 3, + scale: (v) => (Math.abs(v[0]) + Math.abs(v[3])) / 2, + rotate, + rotateZ: rotate, + skewX: (v) => radToDeg(Math.atan(v[1])), + skewY: (v) => radToDeg(Math.atan(v[2])), + skew: (v) => (Math.abs(v[1]) + Math.abs(v[2])) / 2, +}; +const rebaseAngle = (angle) => { + angle = angle % 360; + if (angle < 0) + angle += 360; + return angle; +}; +const rotateZ = rotate; +const scaleX = (v) => Math.sqrt(v[0] * v[0] + v[1] * v[1]); +const scaleY = (v) => Math.sqrt(v[4] * v[4] + v[5] * v[5]); +const matrix3dParsers = { + x: 12, + y: 13, + z: 14, + translateX: 12, + translateY: 13, + translateZ: 14, + scaleX, + scaleY, + scale: (v) => (scaleX(v) + scaleY(v)) / 2, + rotateX: (v) => rebaseAngle(radToDeg(Math.atan2(v[6], v[5]))), + rotateY: (v) => rebaseAngle(radToDeg(Math.atan2(-v[2], v[0]))), + rotateZ, + rotate: rotateZ, + skewX: (v) => radToDeg(Math.atan(v[4])), + skewY: (v) => radToDeg(Math.atan(v[1])), + skew: (v) => (Math.abs(v[1]) + Math.abs(v[4])) / 2, +}; +function defaultTransformValue(name) { + return name.includes("scale") ? 1 : 0; +} +function parseValueFromTransform(transform, name) { + if (!transform || transform === "none") { + return defaultTransformValue(name); + } + const matrix3dMatch = transform.match(/^matrix3d\(([-\d.e\s,]+)\)$/u); + let parsers; + let match; + if (matrix3dMatch) { + parsers = matrix3dParsers; + match = matrix3dMatch; + } + else { + const matrix2dMatch = transform.match(/^matrix\(([-\d.e\s,]+)\)$/u); + parsers = matrix2dParsers; + match = matrix2dMatch; + } + if (!match) { + return defaultTransformValue(name); + } + const valueParser = parsers[name]; + const values = match[1].split(",").map(convertTransformToNumber); + return typeof valueParser === "function" + ? valueParser(values) + : values[valueParser]; +} +const readTransformValue = (instance, name) => { + const { transform = "none" } = getComputedStyle(instance); + return parseValueFromTransform(transform, name); +}; +function convertTransformToNumber(value) { + return parseFloat(value.trim()); +} + +/** + * Generate a list of every possible transform key. + */ +const transformPropOrder = [ + "transformPerspective", + "x", + "y", + "z", + "translateX", + "translateY", + "translateZ", + "scale", + "scaleX", + "scaleY", + "rotate", + "rotateX", + "rotateY", + "rotateZ", + "skew", + "skewX", + "skewY", +]; +/** + * A quick lookup for transform props. + * + * `pathRotation` is a transform for routing purposes (skipped from raw + * style application, wired to the transform composite, flags transform + * dirty) but is intentionally NOT in `transformPropOrder` — it is + * composed onto `rotate` at the build sites, not serialized in its own + * slot, and must stay out of the order-array consumers (parse-transform, + * unit-conversion, keys-position). + */ +const transformProps = /*@__PURE__*/ (() => new Set([...transformPropOrder, "pathRotation"]))(); + +const isNumOrPxType = (v) => v === number || v === px; +const transformKeys = new Set(["x", "y", "z"]); +const nonTranslationalTransformKeys = transformPropOrder.filter((key) => !transformKeys.has(key)); +function removeNonTranslationalTransform(visualElement) { + const removedTransforms = []; + nonTranslationalTransformKeys.forEach((key) => { + const value = visualElement.getValue(key); + if (value !== undefined) { + removedTransforms.push([key, value.get()]); + value.set(key.startsWith("scale") ? 1 : 0); + } + }); + return removedTransforms; +} +const positionalValues = { + // Dimensions + width: ({ x }, { paddingLeft = "0", paddingRight = "0", boxSizing }) => { + const width = x.max - x.min; + return boxSizing === "border-box" + ? width + : width - parseFloat(paddingLeft) - parseFloat(paddingRight); + }, + height: ({ y }, { paddingTop = "0", paddingBottom = "0", boxSizing }) => { + const height = y.max - y.min; + return boxSizing === "border-box" + ? height + : height - parseFloat(paddingTop) - parseFloat(paddingBottom); + }, + top: (_bbox, { top }) => parseFloat(top), + left: (_bbox, { left }) => parseFloat(left), + bottom: ({ y }, { top }) => parseFloat(top) + (y.max - y.min), + right: ({ x }, { left }) => parseFloat(left) + (x.max - x.min), + // Transform + x: (_bbox, { transform }) => parseValueFromTransform(transform, "x"), + y: (_bbox, { transform }) => parseValueFromTransform(transform, "y"), +}; +// Alias translate longform names +positionalValues.translateX = positionalValues.x; +positionalValues.translateY = positionalValues.y; + +const toResolve = new Set(); +let isScheduled = false; +let anyNeedsMeasurement = false; +let isForced = false; +function measureAllKeyframes() { + if (anyNeedsMeasurement) { + const resolversToMeasure = Array.from(toResolve).filter((resolver) => resolver.needsMeasurement); + const elementsToMeasure = new Set(resolversToMeasure.map((resolver) => resolver.element)); + const transformsToRestore = new Map(); + /** + * Write pass + * If we're measuring elements we want to remove bounding box-changing transforms. + */ + elementsToMeasure.forEach((element) => { + const removedTransforms = removeNonTranslationalTransform(element); + if (!removedTransforms.length) + return; + transformsToRestore.set(element, removedTransforms); + element.render(); + }); + // Read + resolversToMeasure.forEach((resolver) => resolver.measureInitialState()); + // Write + elementsToMeasure.forEach((element) => { + element.render(); + const restore = transformsToRestore.get(element); + if (restore) { + restore.forEach(([key, value]) => { + element.getValue(key)?.set(value); + }); + } + }); + // Read + resolversToMeasure.forEach((resolver) => resolver.measureEndState()); + // Write + resolversToMeasure.forEach((resolver) => { + if (resolver.suspendedScrollY !== undefined) { + window.scrollTo(0, resolver.suspendedScrollY); + } + }); + } + anyNeedsMeasurement = false; + isScheduled = false; + toResolve.forEach((resolver) => resolver.complete(isForced)); + toResolve.clear(); +} +function readAllKeyframes() { + toResolve.forEach((resolver) => { + resolver.readKeyframes(); + if (resolver.needsMeasurement) { + anyNeedsMeasurement = true; + } + }); +} +function flushKeyframeResolvers() { + isForced = true; + readAllKeyframes(); + measureAllKeyframes(); + isForced = false; +} +class KeyframeResolver { + constructor(unresolvedKeyframes, onComplete, name, motionValue, element, isAsync = false) { + this.state = "pending"; + /** + * Track whether this resolver is async. If it is, it'll be added to the + * resolver queue and flushed in the next frame. Resolvers that aren't going + * to trigger read/write thrashing don't need to be async. + */ + this.isAsync = false; + /** + * Track whether this resolver needs to perform a measurement + * to resolve its keyframes. + */ + this.needsMeasurement = false; + this.unresolvedKeyframes = [...unresolvedKeyframes]; + this.onComplete = onComplete; + this.name = name; + this.motionValue = motionValue; + this.element = element; + this.isAsync = isAsync; + } + scheduleResolve() { + this.state = "scheduled"; + if (this.isAsync) { + toResolve.add(this); + if (!isScheduled) { + isScheduled = true; + frame.read(readAllKeyframes); + frame.resolveKeyframes(measureAllKeyframes); + } + } + else { + this.readKeyframes(); + this.complete(); + } + } + readKeyframes() { + const { unresolvedKeyframes, name, element, motionValue } = this; + // If initial keyframe is null we need to read it from the DOM + if (unresolvedKeyframes[0] === null) { + const currentValue = motionValue?.get(); + // TODO: This doesn't work if the final keyframe is a wildcard + const finalKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1]; + if (currentValue !== undefined) { + unresolvedKeyframes[0] = currentValue; + } + else if (element && name) { + const valueAsRead = element.readValue(name, finalKeyframe); + if (valueAsRead !== undefined && valueAsRead !== null) { + unresolvedKeyframes[0] = valueAsRead; + } + } + if (unresolvedKeyframes[0] === undefined) { + unresolvedKeyframes[0] = finalKeyframe; + } + if (motionValue && currentValue === undefined) { + motionValue.set(unresolvedKeyframes[0]); + } + } + fillWildcards(unresolvedKeyframes); + } + setFinalKeyframe() { } + measureInitialState() { } + renderEndStyles() { } + measureEndState() { } + complete(isForcedComplete = false) { + this.state = "complete"; + this.onComplete(this.unresolvedKeyframes, this.finalKeyframe, isForcedComplete); + toResolve.delete(this); + } + cancel() { + if (this.state === "scheduled") { + toResolve.delete(this); + this.state = "pending"; + } + } + resume() { + if (this.state === "pending") + this.scheduleResolve(); + } +} + +const isCSSVar = (name) => name.startsWith("--"); + +function setStyle(element, name, value) { + isCSSVar(name) + ? element.style.setProperty(name, value) + : (element.style[name] = value); +} + +/** + * Add the ability for test suites to manually set support flags + * to better test more environments. + */ +const supportsFlags = {}; + +function memoSupports(callback, supportsFlag) { + const memoized = motionUtils.memo(callback); + return () => supportsFlags[supportsFlag] ?? memoized(); +} + +const supportsScrollTimeline = /* @__PURE__ */ memoSupports(() => window.ScrollTimeline !== undefined, "scrollTimeline"); +const supportsViewTimeline = /* @__PURE__ */ memoSupports(() => window.ViewTimeline !== undefined, "viewTimeline"); + +const supportsLinearEasing = /*@__PURE__*/ memoSupports(() => { + try { + document + .createElement("div") + .animate({ opacity: 0 }, { easing: "linear(0, 1)" }); + } + catch (e) { + return false; + } + return true; +}, "linearEasing"); + +const cubicBezierAsString = ([a, b, c, d]) => `cubic-bezier(${a}, ${b}, ${c}, ${d})`; + +const supportedWaapiEasing = { + linear: "linear", + ease: "ease", + easeIn: "ease-in", + easeOut: "ease-out", + easeInOut: "ease-in-out", + circIn: /*@__PURE__*/ cubicBezierAsString([0, 0.65, 0.55, 1]), + circOut: /*@__PURE__*/ cubicBezierAsString([0.55, 0, 1, 0.45]), + backIn: /*@__PURE__*/ cubicBezierAsString([0.31, 0.01, 0.66, -0.59]), + backOut: /*@__PURE__*/ cubicBezierAsString([0.33, 1.53, 0.69, 0.99]), +}; + +function mapEasingToNativeEasing(easing, duration) { + if (!easing) { + return undefined; + } + else if (typeof easing === "function") { + return supportsLinearEasing() + ? generateLinearEasing(easing, duration) + : "ease-out"; + } + else if (motionUtils.isBezierDefinition(easing)) { + return cubicBezierAsString(easing); + } + else if (Array.isArray(easing)) { + return easing.map((segmentEasing) => mapEasingToNativeEasing(segmentEasing, duration) || + supportedWaapiEasing.easeOut); + } + else { + return supportedWaapiEasing[easing]; + } +} + +function startWaapiAnimation(element, valueName, keyframes, { delay = 0, duration = 300, repeat = 0, repeatType = "loop", ease = "easeOut", times, } = {}, pseudoElement = undefined) { + const keyframeOptions = { + [valueName]: keyframes, + }; + if (times) + keyframeOptions.offset = times; + const easing = mapEasingToNativeEasing(ease, duration); + /** + * If this is an easing array, apply to keyframes, not animation as a whole + */ + if (Array.isArray(easing)) + keyframeOptions.easing = easing; + const options = { + delay, + duration, + easing: !Array.isArray(easing) ? easing : "linear", + fill: "both", + iterations: repeat + 1, + direction: repeatType === "reverse" ? "alternate" : "normal", + }; + if (pseudoElement) + options.pseudoElement = pseudoElement; + return element.animate(keyframeOptions, options); +} + +function isGenerator(type) { + return typeof type === "function" && "applyToOptions" in type; +} + +function applyGeneratorOptions({ type, ...options }) { + if (isGenerator(type) && supportsLinearEasing()) { + return type.applyToOptions(options); + } + else { + options.duration ?? (options.duration = 300); + options.ease ?? (options.ease = "easeOut"); + } + return options; +} + +/** + * NativeAnimation implements AnimationPlaybackControls for the browser's Web Animations API. + */ +class NativeAnimation extends WithPromise { + constructor(options) { + super(); + this.finishedTime = null; + this.isStopped = false; + /** + * Tracks a manually-set start time that takes precedence over WAAPI's + * dynamic startTime. This is cleared when play() or time setter is called, + * allowing WAAPI to take over timing. + */ + this.manualStartTime = null; + if (!options) + return; + const { element, name, keyframes, pseudoElement, allowFlatten = false, finalKeyframe, onComplete, } = options; + this.isPseudoElement = Boolean(pseudoElement); + this.allowFlatten = allowFlatten; + this.options = options; + motionUtils.invariant(typeof options.type !== "string", `Mini animate() doesn't support "type" as a string.`, "mini-spring"); + const transition = applyGeneratorOptions(options); + this.animation = startWaapiAnimation(element, name, keyframes, transition, pseudoElement); + if (transition.autoplay === false) { + this.animation.pause(); + } + this.animation.onfinish = () => { + this.finishedTime = this.time; + if (!pseudoElement) { + const keyframe = getFinalKeyframe(keyframes, this.options, finalKeyframe, this.speed); + if (this.updateMotionValue) { + this.updateMotionValue(keyframe); + } + /** + * If we can, we want to commit the final style as set by the user, + * rather than the computed keyframe value supplied by the animation. + * We always do this, even when a motion value is present, to prevent + * a visual flash in Firefox where the WAAPI animation's fill is removed + * during cancel() before the scheduled render can apply the correct value. + */ + setStyle(element, name, keyframe); + this.animation.cancel(); + } + onComplete?.(); + this.notifyFinished(); + }; + } + play() { + if (this.isStopped) + return; + this.manualStartTime = null; + this.animation.play(); + if (this.state === "finished") { + this.updateFinished(); + } + } + pause() { + this.animation.pause(); + } + complete() { + this.animation.finish?.(); + } + cancel() { + try { + this.animation.cancel(); + } + catch (e) { } + } + stop() { + if (this.isStopped) + return; + this.isStopped = true; + const { state } = this; + if (state === "idle" || state === "finished") { + return; + } + if (this.updateMotionValue) { + this.updateMotionValue(); + } + else { + this.commitStyles(); + } + if (!this.isPseudoElement) + this.cancel(); + } + /** + * WAAPI doesn't natively have any interruption capabilities. + * + * In this method, we commit styles back to the DOM before cancelling + * the animation. + * + * This is designed to be overridden by NativeAnimationExtended, which + * will create a renderless JS animation and sample it twice to calculate + * its current value, "previous" value, and therefore allow + * Motion to also correctly calculate velocity for any subsequent animation + * while deferring the commit until the next animation frame. + */ + commitStyles() { + const element = this.options?.element; + if (!this.isPseudoElement && element?.isConnected) { + this.animation.commitStyles?.(); + } + } + get duration() { + const duration = this.animation.effect?.getComputedTiming?.().duration || 0; + return motionUtils.millisecondsToSeconds(Number(duration)); + } + get iterationDuration() { + const { delay = 0 } = this.options || {}; + return this.duration + motionUtils.millisecondsToSeconds(delay); + } + get time() { + return motionUtils.millisecondsToSeconds(Number(this.animation.currentTime) || 0); + } + set time(newTime) { + const wasFinished = this.finishedTime !== null; + this.manualStartTime = null; + this.finishedTime = null; + this.animation.currentTime = motionUtils.secondsToMilliseconds(newTime); + if (wasFinished) { + this.animation.pause(); + } + } + /** + * The playback speed of the animation. + * 1 = normal speed, 2 = double speed, 0.5 = half speed. + */ + get speed() { + return this.animation.playbackRate; + } + set speed(newSpeed) { + // Allow backwards playback after finishing + if (newSpeed < 0) + this.finishedTime = null; + this.animation.playbackRate = newSpeed; + } + get state() { + return this.finishedTime !== null + ? "finished" + : this.animation.playState; + } + get startTime() { + return this.manualStartTime ?? Number(this.animation.startTime); + } + set startTime(newStartTime) { + this.manualStartTime = this.animation.startTime = newStartTime; + } + /** + * Attaches a timeline to the animation, for instance the `ScrollTimeline`. + */ + attachTimeline({ timeline, rangeStart, rangeEnd, observe, }) { + if (this.allowFlatten) { + this.animation.effect?.updateTiming({ easing: "linear" }); + } + this.animation.onfinish = null; + if (timeline && supportsScrollTimeline()) { + this.animation.timeline = timeline; + if (rangeStart) + this.animation.rangeStart = rangeStart; + if (rangeEnd) + this.animation.rangeEnd = rangeEnd; + return motionUtils.noop; + } + else { + return observe(this); + } + } +} + +const unsupportedEasingFunctions = { + anticipate: motionUtils.anticipate, + backInOut: motionUtils.backInOut, + circInOut: motionUtils.circInOut, +}; +function isUnsupportedEase(key) { + return key in unsupportedEasingFunctions; +} +function replaceStringEasing(transition) { + if (typeof transition.ease === "string" && + isUnsupportedEase(transition.ease)) { + transition.ease = unsupportedEasingFunctions[transition.ease]; + } +} + +/** + * 10ms is chosen here as it strikes a balance between smooth + * results (more than one keyframe per frame at 60fps) and + * keyframe quantity. + */ +const sampleDelta = 10; //ms +class NativeAnimationExtended extends NativeAnimation { + constructor(options) { + /** + * The base NativeAnimation function only supports a subset + * of Motion easings, and WAAPI also only supports some + * easing functions via string/cubic-bezier definitions. + * + * This function replaces those unsupported easing functions + * with a JS easing function. This will later get compiled + * to a linear() easing function. + */ + replaceStringEasing(options); + /** + * Ensure we replace the transition type with a generator function + * before passing to WAAPI. + * + * TODO: Does this have a better home? It could be shared with + * JSAnimation. + */ + replaceTransitionType(options); + super(options); + /** + * Only set startTime when the animation should autoplay. + * Setting startTime on a paused WAAPI animation unpauses it + * (per the WAAPI spec), which breaks autoplay: false. + */ + if (options.startTime !== undefined && options.autoplay !== false) { + this.startTime = options.startTime; + } + this.options = options; + } + /** + * WAAPI doesn't natively have any interruption capabilities. + * + * Rather than read committed styles back out of the DOM, we can + * create a renderless JS animation and sample it twice to calculate + * its current value, "previous" value, and therefore allow + * Motion to calculate velocity for any subsequent animation. + */ + updateMotionValue(value) { + const { motionValue, onUpdate, onComplete, element, ...options } = this.options; + if (!motionValue) + return; + if (value !== undefined) { + motionValue.set(value); + return; + } + const sampleAnimation = new JSAnimation({ + ...options, + autoplay: false, + }); + /** + * Use wall-clock elapsed time for sampling. + * Under CPU load, WAAPI's currentTime may not reflect actual + * elapsed time, causing incorrect sampling and visual jumps. + */ + const sampleTime = Math.max(sampleDelta, time.now() - this.startTime); + const delta = motionUtils.clamp(0, sampleDelta, sampleTime - sampleDelta); + const current = sampleAnimation.sample(sampleTime).value; + /** + * Write the estimated value to inline style so it persists + * after cancel(), covering the async gap before the next + * animation starts. + */ + const { name } = this.options; + if (element && name) + setStyle(element, name, current); + motionValue.setWithVelocity(sampleAnimation.sample(Math.max(0, sampleTime - delta)).value, current, delta); + sampleAnimation.stop(); + } +} + +/** + * Check if a value is animatable. Examples: + * + * ✅: 100, "100px", "#fff" + * ❌: "block", "url(2.jpg)" + * @param value + * + * @internal + */ +const isAnimatable = (value, name) => { + // If the list of keys that might be non-animatable grows, replace with Set + if (name === "zIndex") + return false; + // If it's a number or a keyframes array, we can animate it. We might at some point + // need to do a deep isAnimatable check of keyframes, or let Popmotion handle this, + // but for now lets leave it like this for performance reasons + if (typeof value === "number" || Array.isArray(value)) + return true; + if (typeof value === "string" && // It's animatable if we have a string + (complex.test(value) || value === "0") && // And it contains numbers and/or colors + !value.startsWith("url(") // Unless it starts with "url(" + ) { + return true; + } + return false; +}; + +function hasKeyframesChanged(keyframes) { + const current = keyframes[0]; + if (keyframes.length === 1) + return true; + for (let i = 0; i < keyframes.length; i++) { + if (keyframes[i] !== current) + return true; + } +} +function canAnimate(keyframes, name, type, velocity) { + /** + * Check if we're able to animate between the start and end keyframes, + * and throw a warning if we're attempting to animate between one that's + * animatable and another that isn't. + */ + const originKeyframe = keyframes[0]; + if (originKeyframe === null) { + return false; + } + /** + * These aren't traditionally animatable but we do support them. + * In future we could look into making this more generic or replacing + * this function with mix() === mixImmediate + */ + if (name === "display" || name === "visibility") + return true; + const targetKeyframe = keyframes[keyframes.length - 1]; + const isOriginAnimatable = isAnimatable(originKeyframe, name); + const isTargetAnimatable = isAnimatable(targetKeyframe, name); + motionUtils.warning(isOriginAnimatable === isTargetAnimatable, `You are trying to animate ${name} from "${originKeyframe}" to "${targetKeyframe}". "${isOriginAnimatable ? targetKeyframe : originKeyframe}" is not an animatable value.`, "value-not-animatable"); + // Always skip if any of these are true + if (!isOriginAnimatable || !isTargetAnimatable) { + return false; + } + return (hasKeyframesChanged(keyframes) || + ((type === "spring" || isGenerator(type)) && velocity)); +} + +function makeAnimationInstant(options) { + options.duration = 0; + options.type = "keyframes"; +} + +/** + * A list of values that can be hardware-accelerated. + */ +const acceleratedValues = new Set([ + "opacity", + "clipPath", + "filter", + "transform", + "backgroundColor", +]); + +const browserColorFunctions = /^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/; +function hasBrowserOnlyColors(keyframes) { + for (let i = 0; i < keyframes.length; i++) { + if (typeof keyframes[i] === "string" && + browserColorFunctions.test(keyframes[i])) { + return true; + } + } + return false; +} + +const colorProperties = new Set([ + "color", + "backgroundColor", + "outlineColor", + "fill", + "stroke", + "borderColor", + "borderTopColor", + "borderRightColor", + "borderBottomColor", + "borderLeftColor", +]); +const supportsWaapi = /*@__PURE__*/ motionUtils.memo(() => Object.hasOwnProperty.call(Element.prototype, "animate")); +function supportsBrowserAnimation(options) { + const { motionValue, name, repeatDelay, repeatType, damping, type, keyframes, } = options; + const subject = motionValue?.owner?.current; + /** + * We use instanceof checks instead of isHTMLElement()/isSVGElement() + * because we explicitly **don't** want elements in different timing + * contexts (i.e. popups) to be accelerated, as it's not possible to sync + * these animations properly with those driven from the main window + * frameloop. + */ + if (!(subject instanceof HTMLElement) && + !(subject instanceof SVGElement)) { + return false; + } + const { onUpdate, transformTemplate } = motionValue.owner.getProps(); + return (supportsWaapi() && + name && + /** + * Force WAAPI for color properties with browser-only color formats + * (oklch, oklab, lab, lch, etc.) that the JS animation path can't parse. + */ + (acceleratedValues.has(name) || + (colorProperties.has(name) && + hasBrowserOnlyColors(keyframes))) && + (name !== "transform" || !transformTemplate) && + /** + * If we're outputting values to onUpdate then we can't use WAAPI as there's + * no way to read the value from WAAPI every frame. + */ + !onUpdate && + !repeatDelay && + repeatType !== "mirror" && + damping !== 0 && + type !== "inertia"); +} + +/** + * Maximum time allowed between an animation being created and it being + * resolved for us to use the latter as the start time. + * + * This is to ensure that while we prefer to "start" an animation as soon + * as it's triggered, we also want to avoid a visual jump if there's a big delay + * between these two moments. + */ +const MAX_RESOLVE_DELAY = 40; +class AsyncMotionValueAnimation extends WithPromise { + constructor({ autoplay = true, delay = 0, type = "keyframes", repeat = 0, repeatDelay = 0, repeatType = "loop", keyframes, name, motionValue, element, ...options }) { + super(); + /** + * Bound to support return animation.stop pattern + */ + this.stop = () => { + if (this._animation) { + this._animation.stop(); + this.stopTimeline?.(); + } + this.keyframeResolver?.cancel(); + }; + this.createdAt = time.now(); + const optionsWithDefaults = { + autoplay, + delay, + type, + repeat, + repeatDelay, + repeatType, + name, + motionValue, + element, + ...options, + }; + const KeyframeResolver$1 = element?.KeyframeResolver || KeyframeResolver; + this.keyframeResolver = new KeyframeResolver$1(keyframes, (resolvedKeyframes, finalKeyframe, forced) => this.onKeyframesResolved(resolvedKeyframes, finalKeyframe, optionsWithDefaults, !forced), name, motionValue, element); + this.keyframeResolver?.scheduleResolve(); + } + onKeyframesResolved(keyframes, finalKeyframe, options, sync) { + this.keyframeResolver = undefined; + const { name, type, velocity, delay, isHandoff, onUpdate } = options; + this.resolvedAt = time.now(); + /** + * If we can't animate this value with the resolved keyframes + * then we should complete it immediately. + */ + let canAnimateValue = true; + if (!canAnimate(keyframes, name, type, velocity)) { + canAnimateValue = false; + if (motionUtils.MotionGlobalConfig.instantAnimations || !delay) { + onUpdate?.(getFinalKeyframe(keyframes, options, finalKeyframe)); + } + keyframes[0] = keyframes[keyframes.length - 1]; + makeAnimationInstant(options); + options.repeat = 0; + } + /** + * Resolve startTime for the animation. + * + * This method uses the createdAt and resolvedAt to calculate the + * animation startTime. *Ideally*, we would use the createdAt time as t=0 + * as the following frame would then be the first frame of the animation in + * progress, which would feel snappier. + * + * However, if there's a delay (main thread work) between the creation of + * the animation and the first committed frame, we prefer to use resolvedAt + * to avoid a sudden jump into the animation. + */ + const startTime = sync + ? !this.resolvedAt + ? this.createdAt + : this.resolvedAt - this.createdAt > MAX_RESOLVE_DELAY + ? this.resolvedAt + : this.createdAt + : undefined; + const resolvedOptions = { + startTime, + finalKeyframe, + ...options, + keyframes, + }; + /** + * Animate via WAAPI if possible. If this is a handoff animation, the optimised animation will be running via + * WAAPI. Therefore, this animation must be JS to ensure it runs "under" the + * optimised animation. + * + * Also skip WAAPI when keyframes aren't animatable, as the resolved + * values may not be valid CSS and would trigger browser warnings. + */ + const useWaapi = canAnimateValue && + !isHandoff && + supportsBrowserAnimation(resolvedOptions); + const element = resolvedOptions.motionValue?.owner?.current; + let animation; + if (useWaapi) { + try { + animation = new NativeAnimationExtended({ + ...resolvedOptions, + element, + }); + } + catch { + animation = new JSAnimation(resolvedOptions); + } + } + else { + animation = new JSAnimation(resolvedOptions); + } + animation.finished.then(() => { + this.notifyFinished(); + }).catch(motionUtils.noop); + if (this.pendingTimeline) { + this.stopTimeline = animation.attachTimeline(this.pendingTimeline); + this.pendingTimeline = undefined; + } + this._animation = animation; + } + get finished() { + if (!this._animation) { + return this._finished; + } + else { + return this.animation.finished; + } + } + then(onResolve, _onReject) { + return this.finished.finally(onResolve).then(() => { }); + } + get animation() { + if (!this._animation) { + this.keyframeResolver?.resume(); + flushKeyframeResolvers(); + } + return this._animation; + } + get duration() { + return this.animation.duration; + } + get iterationDuration() { + return this.animation.iterationDuration; + } + get time() { + return this.animation.time; + } + set time(newTime) { + this.animation.time = newTime; + } + get speed() { + return this.animation.speed; + } + get state() { + return this.animation.state; + } + set speed(newSpeed) { + this.animation.speed = newSpeed; + } + get startTime() { + return this.animation.startTime; + } + attachTimeline(timeline) { + if (this._animation) { + this.stopTimeline = this.animation.attachTimeline(timeline); + } + else { + this.pendingTimeline = timeline; + } + return () => this.stop(); + } + play() { + this.animation.play(); + } + pause() { + this.animation.pause(); + } + complete() { + this.animation.complete(); + } + cancel() { + if (this._animation) { + this.animation.cancel(); + } + this.keyframeResolver?.cancel(); + } +} + +class GroupAnimation { + constructor(animations) { + // Bound to accomadate common `return animation.stop` pattern + this.stop = () => this.runAll("stop"); + this.animations = animations.filter(Boolean); + } + get finished() { + return Promise.all(this.animations.map((animation) => animation.finished)); + } + /** + * TODO: Filter out cancelled or stopped animations before returning + */ + getAll(propName) { + return this.animations[0][propName]; + } + setAll(propName, newValue) { + for (let i = 0; i < this.animations.length; i++) { + this.animations[i][propName] = newValue; + } + } + attachTimeline(timeline) { + const subscriptions = this.animations.map((animation) => animation.attachTimeline(timeline)); + return () => { + subscriptions.forEach((cancel, i) => { + cancel && cancel(); + this.animations[i].stop(); + }); + }; + } + get time() { + return this.getAll("time"); + } + set time(time) { + this.setAll("time", time); + } + get speed() { + return this.getAll("speed"); + } + set speed(speed) { + this.setAll("speed", speed); + } + get state() { + return this.getAll("state"); + } + get startTime() { + return this.getAll("startTime"); + } + get duration() { + return getMax(this.animations, "duration"); + } + get iterationDuration() { + return getMax(this.animations, "iterationDuration"); + } + runAll(methodName) { + this.animations.forEach((controls) => controls[methodName]()); + } + play() { + this.runAll("play"); + } + pause() { + this.runAll("pause"); + } + cancel() { + this.runAll("cancel"); + } + complete() { + this.runAll("complete"); + } +} +function getMax(animations, propName) { + let max = 0; + for (let i = 0; i < animations.length; i++) { + const value = animations[i][propName]; + if (value !== null && value > max) { + max = value; + } + } + return max; +} + +class GroupAnimationWithThen extends GroupAnimation { + then(onResolve, _onReject) { + return this.finished.finally(onResolve).then(() => { }); + } +} + +class NativeAnimationWrapper extends NativeAnimation { + constructor(animation) { + super(); + this.animation = animation; + animation.onfinish = () => { + this.finishedTime = this.time; + this.notifyFinished(); + }; + } +} + +const animationMaps = new WeakMap(); +const animationMapKey = (name, pseudoElement = "") => `${name}:${pseudoElement}`; +function getAnimationMap(element) { + let map = animationMaps.get(element); + if (!map) { + map = new Map(); + animationMaps.set(element, map); + } + return map; +} + +function calcChildStagger(children, child, delayChildren, staggerChildren = 0, staggerDirection = 1) { + const index = Array.from(children) + .sort((a, b) => a.sortNodePosition(b)) + .indexOf(child); + const numChildren = children.size; + const maxStaggerDuration = (numChildren - 1) * staggerChildren; + const delayIsFunction = typeof delayChildren === "function"; + return delayIsFunction + ? delayChildren(index, numChildren) + : staggerDirection === 1 + ? index * staggerChildren + : maxStaggerDuration - index * staggerChildren; +} + +/** + * Maximum time between the value of two frames, beyond which we + * assume the velocity has since been 0. + */ +const MAX_VELOCITY_DELTA = 30; +const isFloat = (value) => { + return !isNaN(parseFloat(value)); +}; +const collectMotionValues = { + current: undefined, +}; +/** + * `MotionValue` is used to track the state and velocity of motion values. + * + * @public + */ +class MotionValue { + /** + * @param init - The initiating value + * @param config - Optional configuration options + * + * - `transformer`: A function to transform incoming values with. + */ + constructor(init, options = {}) { + /** + * Tracks whether this value can output a velocity. Currently this is only true + * if the value is numerical, but we might be able to widen the scope here and support + * other value types. + * + * @internal + */ + this.canTrackVelocity = null; + /** + * An object containing a SubscriptionManager for each active event. + */ + this.events = {}; + this.updateAndNotify = (v) => { + const currentTime = time.now(); + /** + * If we're updating the value during another frame or eventloop + * than the previous frame, then the we set the previous frame value + * to current. + */ + if (this.updatedAt !== currentTime) { + this.setPrevFrameValue(); + } + this.prev = this.current; + this.setCurrent(v); + // Update update subscribers + if (this.current !== this.prev) { + this.events.change?.notify(this.current); + if (this.dependents) { + for (const dependent of this.dependents) { + dependent.dirty(); + } + } + } + }; + this.hasAnimated = false; + this.setCurrent(init); + this.owner = options.owner; + } + setCurrent(current) { + this.current = current; + this.updatedAt = time.now(); + if (this.canTrackVelocity === null && current !== undefined) { + this.canTrackVelocity = isFloat(this.current); + } + } + setPrevFrameValue(prevFrameValue = this.current) { + this.prevFrameValue = prevFrameValue; + this.prevUpdatedAt = this.updatedAt; + } + /** + * Adds a function that will be notified when the `MotionValue` is updated. + * + * It returns a function that, when called, will cancel the subscription. + * + * When calling `onChange` inside a React component, it should be wrapped with the + * `useEffect` hook. As it returns an unsubscribe function, this should be returned + * from the `useEffect` function to ensure you don't add duplicate subscribers.. + * + * ```jsx + * export const MyComponent = () => { + * const x = useMotionValue(0) + * const y = useMotionValue(0) + * const opacity = useMotionValue(1) + * + * useEffect(() => { + * function updateOpacity() { + * const maxXY = Math.max(x.get(), y.get()) + * const newOpacity = transform(maxXY, [0, 100], [1, 0]) + * opacity.set(newOpacity) + * } + * + * const unsubscribeX = x.on("change", updateOpacity) + * const unsubscribeY = y.on("change", updateOpacity) + * + * return () => { + * unsubscribeX() + * unsubscribeY() + * } + * }, []) + * + * return + * } + * ``` + * + * @param subscriber - A function that receives the latest value. + * @returns A function that, when called, will cancel this subscription. + * + * @deprecated + */ + onChange(subscription) { + if (process.env.NODE_ENV !== "production") { + motionUtils.warnOnce(false, `value.onChange(callback) is deprecated. Switch to value.on("change", callback).`); + } + return this.on("change", subscription); + } + on(eventName, callback) { + if (!this.events[eventName]) { + this.events[eventName] = new motionUtils.SubscriptionManager(); + } + const unsubscribe = this.events[eventName].add(callback); + if (eventName === "change") { + return () => { + unsubscribe(); + /** + * If we have no more change listeners by the start + * of the next frame, stop active animations. + */ + frame.read(() => { + if (!this.events.change.getSize()) { + this.stop(); + } + }); + }; + } + return unsubscribe; + } + clearListeners() { + for (const eventManagers in this.events) { + this.events[eventManagers].clear(); + } + } + /** + * Attaches a passive effect to the `MotionValue`. + */ + attach(passiveEffect, stopPassiveEffect) { + this.passiveEffect = passiveEffect; + this.stopPassiveEffect = stopPassiveEffect; + } + /** + * Sets the state of the `MotionValue`. + * + * @remarks + * + * ```jsx + * const x = useMotionValue(0) + * x.set(10) + * ``` + * + * @param latest - Latest value to set. + * @param render - Whether to notify render subscribers. Defaults to `true` + * + * @public + */ + set(v) { + if (!this.passiveEffect) { + this.updateAndNotify(v); + } + else { + this.passiveEffect(v, this.updateAndNotify); + } + } + setWithVelocity(prev, current, delta) { + this.set(current); + this.prev = undefined; + this.prevFrameValue = prev; + this.prevUpdatedAt = this.updatedAt - delta; + } + /** + * Set the state of the `MotionValue`, stopping any active animations, + * effects, and resets velocity to `0`. + */ + jump(v, endAnimation = true) { + this.updateAndNotify(v); + this.prev = v; + this.prevUpdatedAt = this.prevFrameValue = undefined; + endAnimation && this.stop(); + if (this.stopPassiveEffect) + this.stopPassiveEffect(); + } + dirty() { + this.events.change?.notify(this.current); + } + addDependent(dependent) { + if (!this.dependents) { + this.dependents = new Set(); + } + this.dependents.add(dependent); + } + removeDependent(dependent) { + if (this.dependents) { + this.dependents.delete(dependent); + } + } + /** + * Returns the latest state of `MotionValue` + * + * @returns - The latest state of `MotionValue` + * + * @public + */ + get() { + if (collectMotionValues.current) { + collectMotionValues.current.push(this); + } + return this.current; + } + /** + * @public + */ + getPrevious() { + return this.prev; + } + /** + * Returns the latest velocity of `MotionValue` + * + * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical. + * + * @public + */ + getVelocity() { + const currentTime = time.now(); + if (!this.canTrackVelocity || + this.prevFrameValue === undefined || + currentTime - this.updatedAt > MAX_VELOCITY_DELTA) { + return 0; + } + const delta = Math.min(this.updatedAt - this.prevUpdatedAt, MAX_VELOCITY_DELTA); + // Casts because of parseFloat's poor typing + return motionUtils.velocityPerSecond(parseFloat(this.current) - + parseFloat(this.prevFrameValue), delta); + } + /** + * Registers a new animation to control this `MotionValue`. Only one + * animation can drive a `MotionValue` at one time. + * + * ```jsx + * value.start() + * ``` + * + * @param animation - A function that starts the provided animation + */ + start(startAnimation) { + this.stop(); + return new Promise((resolve) => { + this.hasAnimated = true; + this.animation = startAnimation(resolve); + if (this.events.animationStart) { + this.events.animationStart.notify(); + } + }).then(() => { + if (this.events.animationComplete) { + this.events.animationComplete.notify(); + } + this.clearAnimation(); + }); + } + /** + * Stop the currently active animation. + * + * @public + */ + stop() { + if (this.animation) { + this.animation.stop(); + if (this.events.animationCancel) { + this.events.animationCancel.notify(); + } + } + this.clearAnimation(); + } + /** + * Returns `true` if this value is currently animating. + * + * @public + */ + isAnimating() { + return !!this.animation; + } + clearAnimation() { + delete this.animation; + } + /** + * Destroy and clean up subscribers to this `MotionValue`. + * + * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically + * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually + * created a `MotionValue` via the `motionValue` function. + * + * @public + */ + destroy() { + this.dependents?.clear(); + this.events.destroy?.notify(); + this.clearListeners(); + this.stop(); + if (this.stopPassiveEffect) { + this.stopPassiveEffect(); + } + } +} +function motionValue(init, options) { + return new MotionValue(init, options); +} + +/** + * If `transition` has `inherit: true`, shallow-merge it with + * `parentTransition` (child keys win) and strip the `inherit` key. + * Otherwise return `transition` unchanged. + */ +function resolveTransition(transition, parentTransition) { + if (transition?.inherit && parentTransition) { + const { inherit: _, ...rest } = transition; + return { ...parentTransition, ...rest }; + } + return transition; +} + +function getValueTransition(transition, key) { + const valueTransition = transition?.[key] ?? + transition?.["default"] ?? + transition; + if (valueTransition !== transition) { + return resolveTransition(valueTransition, transition); + } + return valueTransition; +} + +const underDampedSpring = { + type: "spring", + stiffness: 500, + damping: 25, + restSpeed: 10, +}; +const criticallyDampedSpring = (target) => ({ + type: "spring", + stiffness: 550, + damping: target === 0 ? 2 * Math.sqrt(550) : 30, + restSpeed: 10, +}); +const keyframesTransition = { + type: "keyframes", + duration: 0.8, +}; +/** + * Default easing curve is a slightly shallower version of + * the default browser easing curve. + */ +const ease = { + type: "keyframes", + ease: [0.25, 0.1, 0.35, 1], + duration: 0.3, +}; +const getDefaultTransition = (valueKey, { keyframes }) => { + if (keyframes.length > 2) { + return keyframesTransition; + } + else if (transformProps.has(valueKey)) { + return valueKey.startsWith("scale") + ? criticallyDampedSpring(keyframes[1]) + : underDampedSpring; + } + return ease; +}; + +const orchestrationKeys = new Set([ + "when", + "delay", + "delayChildren", + "staggerChildren", + "staggerDirection", + "repeat", + "repeatType", + "repeatDelay", + "from", + "elapsed", +]); +/** + * Decide whether a transition is defined on a given Transition. + * This filters out orchestration options and returns true + * if any options are left. + */ +function isTransitionDefined(transition) { + for (const key in transition) { + if (!orchestrationKeys.has(key)) + return true; + } + return false; +} + +const animateMotionValue = (name, value, target, transition = {}, element, isHandoff) => (onComplete) => { + const valueTransition = getValueTransition(transition, name) || {}; + /** + * Most transition values are currently completely overwritten by value-specific + * transitions. In the future it'd be nicer to blend these transitions. But for now + * delay actually does inherit from the root transition if not value-specific. + */ + const delay = valueTransition.delay || transition.delay || 0; + /** + * Elapsed isn't a public transition option but can be passed through from + * optimized appear effects in milliseconds. + */ + let { elapsed = 0 } = transition; + elapsed = elapsed - motionUtils.secondsToMilliseconds(delay); + const options = { + keyframes: Array.isArray(target) ? target : [null, target], + ease: "easeOut", + velocity: value.getVelocity(), + ...valueTransition, + delay: -elapsed, + onUpdate: (v) => { + value.set(v); + valueTransition.onUpdate && valueTransition.onUpdate(v); + }, + onComplete: () => { + onComplete(); + valueTransition.onComplete && valueTransition.onComplete(); + }, + name, + motionValue: value, + element: isHandoff ? undefined : element, + }; + /** + * If there's no transition defined for this value, we can generate + * unique transition settings for this value. + */ + if (!isTransitionDefined(valueTransition)) { + Object.assign(options, getDefaultTransition(name, options)); + } + /** + * Both WAAPI and our internal animation functions use durations + * as defined by milliseconds, while our external API defines them + * as seconds. + */ + options.duration && (options.duration = motionUtils.secondsToMilliseconds(options.duration)); + options.repeatDelay && (options.repeatDelay = motionUtils.secondsToMilliseconds(options.repeatDelay)); + /** + * Support deprecated way to set initial value. Prefer keyframe syntax. + */ + if (options.from !== undefined) { + options.keyframes[0] = options.from; + } + let shouldSkip = false; + if (options.type === false || + (options.duration === 0 && !options.repeatDelay)) { + makeAnimationInstant(options); + if (options.delay === 0) { + shouldSkip = true; + } + } + if (motionUtils.MotionGlobalConfig.instantAnimations || + motionUtils.MotionGlobalConfig.skipAnimations || + element?.shouldSkipAnimations || + valueTransition.skipAnimations) { + shouldSkip = true; + makeAnimationInstant(options); + options.delay = 0; + } + /** + * If the transition type or easing has been explicitly set by the user + * then we don't want to allow flattening the animation. + */ + options.allowFlatten = !valueTransition.type && !valueTransition.ease; + /** + * If we can or must skip creating the animation, and apply only + * the final keyframe, do so. We also check once keyframes are resolved but + * this early check prevents the need to create an animation at all. + */ + if (shouldSkip && !isHandoff && value.get() !== undefined) { + const finalKeyframe = getFinalKeyframe(options.keyframes, valueTransition); + if (finalKeyframe !== undefined) { + frame.update(() => { + options.onUpdate(finalKeyframe); + options.onComplete(); + }); + return; + } + } + return valueTransition.isSync + ? new JSAnimation(options) + : new AsyncMotionValueAnimation(options); +}; + +const MIN_LAYOUT_DISTANCE = 20; +function bezierPoint(t, origin, control, target) { + const inv = 1 - t; + return inv * inv * origin + 2 * inv * t * control + t * t * target; +} +function bezierTangentAngle(t, originX, controlX, targetX, originY, controlY, targetY) { + const dx = 2 * (1 - t) * (controlX - originX) + 2 * t * (targetX - controlX); + const dy = 2 * (1 - t) * (controlY - originY) + 2 * t * (targetY - controlY); + return Math.atan2(dy, dx) * (180 / Math.PI); +} +function computeArcControlPoint(fromX, fromY, toX, toY, strength, peak) { + const deltaX = toX - fromX; + const deltaY = toY - fromY; + const distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY); + if (distance > 0) { + const normalPerpX = -deltaY / distance; + const normalPerpY = deltaX / distance; + const desiredHeight = strength * distance; + return { + x: fromX + deltaX * peak + normalPerpX * desiredHeight, + y: fromY + deltaY * peak + normalPerpY * desiredHeight, + }; + } + return { x: fromX, y: fromY }; +} +/** + * The pure sampling factory: `(from, to) => (t) => point`. Internal — + * used by {@link arc} and the unit tests. Not part of the public surface. + */ +function createArcPath({ strength = 0.5, peak = 0.5, direction, rotate = false, } = {}) { + const rotationScale = rotate === true ? 1 : typeof rotate === "number" ? rotate : 0; + // Auto-direction only: persists across calls to flip the bulge back + // onto the same screen side when the dominant axis changes between + // calls. Reuse the factory (module scope / useMemo) to keep this alive. + let prevBulgeSign; + const createInterpolator = (from, to) => { + const dx = to.x - from.x; + const dy = to.y - from.y; + let signed; + if (direction === "cw") { + signed = -strength; + } + else if (direction === "ccw") { + signed = strength; + } + else { + const dom = Math.abs(dx) >= Math.abs(dy) ? dx : dy; + signed = dom < 0 ? -strength : strength; + } + let control = computeArcControlPoint(from.x, from.y, to.x, to.y, signed, peak); + if (direction === undefined) { + const isVertical = Math.abs(dx) < Math.abs(dy); + const midX = from.x + dx * peak; + const midY = from.y + dy * peak; + const bulgeSign = isVertical + ? Math.sign(control.x - midX) + : Math.sign(control.y - midY); + if (prevBulgeSign !== undefined && + bulgeSign !== 0 && + bulgeSign !== prevBulgeSign) { + signed = -signed; + control = computeArcControlPoint(from.x, from.y, to.x, to.y, signed, peak); + } + else if (bulgeSign !== 0) { + prevBulgeSign = bulgeSign; + } + } + const tangent0 = rotationScale + ? bezierTangentAngle(0, from.x, control.x, to.x, from.y, control.y, to.y) + : 0; + const tangent1 = rotationScale + ? bezierTangentAngle(1, from.x, control.x, to.x, from.y, control.y, to.y) + : 0; + const tangentDelta = rotationScale + ? motionUtils.wrap(-180, 180, tangent1 - tangent0) + : 0; + return (t) => { + const out = { + x: bezierPoint(t, from.x, control.x, to.x), + y: bezierPoint(t, from.y, control.y, to.y), + }; + if (rotationScale) { + const raw = bezierTangentAngle(t, from.x, control.x, to.x, from.y, control.y, to.y); + const baseline = tangent0 + tangentDelta * t; + out.rotate = motionUtils.wrap(-180, 180, raw - baseline) * rotationScale; + } + return out; + }; + }; + return createInterpolator; +} +/** + * Creates a curved path for `transition.path`: + * + * ```ts + * + * ``` + * + * Reuse the returned value (module scope / useMemo / useRef) so its + * continuity closure survives re-renders — a fresh `arc()` has no memory. + */ +function arc(options = {}) { + const sample = createArcPath(options); + const path = { + interpolateProjection(delta) { + // `from` is the current translate offset (carries any in-flight + // displacement when interrupted); `to` is the new layout origin. + // The distance floor avoids visible wobble on tiny shifts. + const tx = delta.x.translate; + const ty = delta.y.translate; + if (Math.sqrt(tx * tx + ty * ty) < MIN_LAYOUT_DISTANCE) { + return undefined; + } + return sample({ x: tx, y: ty }, { x: 0, y: 0 }); + }, + animateVisualElement(visualElement, target, transition, delay, animations) { + if (!("x" in target || "y" in target)) + return; + const xValue = visualElement.getValue("x", visualElement.latestValues["x"] ?? 0); + const yValue = visualElement.getValue("y", visualElement.latestValues["y"] ?? 0); + const xRaw = target.x; + const yRaw = target.y; + const xFrom = (Array.isArray(xRaw) && xRaw[0] != null + ? xRaw[0] + : xValue?.get()) ?? 0; + const yFrom = (Array.isArray(yRaw) && yRaw[0] != null + ? yRaw[0] + : yValue?.get()) ?? 0; + const xTo = (Array.isArray(xRaw) + ? xRaw[xRaw.length - 1] + : xRaw ?? xFrom); + const yTo = (Array.isArray(yRaw) + ? yRaw[yRaw.length - 1] + : yRaw ?? yFrom); + // Interruption needs no flag: x/y already hold the displaced + // mid-arc position, so xFrom/yFrom carry the continuity geometry. + const interpolate = sample({ x: xFrom, y: yFrom }, { x: xTo, y: yTo }); + // Drive a dedicated `pathRotation` value (composed onto `rotate` + // at the build sites) rather than `rotate` itself, so a + // concurrent rotate animation composes and nothing accumulates + // on interrupt. + const pathRotationValue = interpolate(0).rotate !== undefined + ? visualElement.getValue("pathRotation", 0) + : undefined; + const pathTransition = { + delay, + ...getValueTransition(transition || {}, "x"), + }; + delete pathTransition.path; + const progress = motionValue(0); + progress.start(animateMotionValue("", progress, [0, 1000], { + ...pathTransition, + isSync: true, + velocity: 0, + onUpdate: (latest) => { + const point = interpolate(latest / 1000); + xValue?.set(point.x); + yValue?.set(point.y); + if (pathRotationValue && point.rotate !== undefined) { + pathRotationValue.set(point.rotate); + } + }, + onComplete: () => { + xValue?.set(xTo); + yValue?.set(yTo); + pathRotationValue?.set(0); + }, + // Interrupt/cancel must clear our additive contribution + // so it can't linger on top of the user's `rotate`. + onStop: () => pathRotationValue?.set(0), + onCancel: () => pathRotationValue?.set(0), + })); + if (progress.animation) + animations.push(progress.animation); + delete target.x; + delete target.y; + }, + }; + return path; +} + +/** + * Parse Framer's special CSS variable format into a CSS token and a fallback. + * + * ``` + * `var(--foo, #fff)` => [`--foo`, '#fff'] + * ``` + * + * @param current + */ +const splitCSSVariableRegex = +// eslint-disable-next-line redos-detector/no-unsafe-regex -- false positive, as it can match a lot of words +/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u; +function parseCSSVariable(current) { + const match = splitCSSVariableRegex.exec(current); + if (!match) + return [,]; + const [, token1, token2, fallback] = match; + return [`--${token1 ?? token2}`, fallback]; +} +const maxDepth = 4; +function getVariableValue(current, element, depth = 1) { + motionUtils.invariant(depth <= maxDepth, `Max CSS variable fallback depth detected in property "${current}". This may indicate a circular fallback dependency.`, "max-css-var-depth"); + const [token, fallback] = parseCSSVariable(current); + // No CSS variable detected + if (!token) + return; + // Attempt to read this CSS variable off the element + const resolved = window.getComputedStyle(element).getPropertyValue(token); + if (resolved) { + const trimmed = resolved.trim(); + return motionUtils.isNumericalString(trimmed) ? parseFloat(trimmed) : trimmed; + } + return isCSSVariableToken(fallback) + ? getVariableValue(fallback, element, depth + 1) + : fallback; +} + +function getValueState(visualElement) { + const state = [{}, {}]; + visualElement?.values.forEach((value, key) => { + state[0][key] = value.get(); + state[1][key] = value.getVelocity(); + }); + return state; +} +function resolveVariantFromProps(props, definition, custom, visualElement) { + /** + * If the variant definition is a function, resolve. + */ + if (typeof definition === "function") { + const [current, velocity] = getValueState(visualElement); + definition = definition(custom !== undefined ? custom : props.custom, current, velocity); + } + /** + * If the variant definition is a variant label, or + * the function returned a variant label, resolve. + */ + if (typeof definition === "string") { + definition = props.variants && props.variants[definition]; + } + /** + * At this point we've resolved both functions and variant labels, + * but the resolved variant label might itself have been a function. + * If so, resolve. This can only have returned a valid target object. + */ + if (typeof definition === "function") { + const [current, velocity] = getValueState(visualElement); + definition = definition(custom !== undefined ? custom : props.custom, current, velocity); + } + return definition; +} + +function resolveVariant(visualElement, definition, custom) { + const props = visualElement.getProps(); + return resolveVariantFromProps(props, definition, custom !== undefined ? custom : props.custom, visualElement); +} + +const positionalKeys = new Set([ + "width", + "height", + "top", + "left", + "right", + "bottom", + ...transformPropOrder, +]); + +const isKeyframesTarget = (v) => { + return Array.isArray(v); +}; + +/** + * Set VisualElement's MotionValue, creating a new MotionValue for it if + * it doesn't exist. + */ +function setMotionValue(visualElement, key, value) { + if (visualElement.hasValue(key)) { + visualElement.getValue(key).set(value); + } + else { + visualElement.addValue(key, motionValue(value)); + } +} +function resolveFinalValueInKeyframes(v) { + // TODO maybe throw if v.length - 1 is placeholder token? + return isKeyframesTarget(v) ? v[v.length - 1] || 0 : v; +} +function setTarget(visualElement, definition) { + const resolved = resolveVariant(visualElement, definition); + let { transitionEnd = {}, transition = {}, ...target } = resolved || {}; + target = { ...target, ...transitionEnd }; + for (const key in target) { + const value = resolveFinalValueInKeyframes(target[key]); + setMotionValue(visualElement, key, value); + } +} + +const isMotionValue = (value) => Boolean(value && value.getVelocity); + +function isWillChangeMotionValue(value) { + return Boolean(isMotionValue(value) && value.add); +} + +function addValueToWillChange(visualElement, key) { + const willChange = visualElement.getValue("willChange"); + /** + * It could be that a user has set willChange to a regular MotionValue, + * in which case we can't add the value to it. + */ + if (isWillChangeMotionValue(willChange)) { + return willChange.add(key); + } + else if (!willChange && motionUtils.MotionGlobalConfig.WillChange) { + const newWillChange = new motionUtils.MotionGlobalConfig.WillChange("auto"); + visualElement.addValue("willChange", newWillChange); + newWillChange.add(key); + } +} + +function camelToDash(str) { + return str.replace(/([A-Z])/g, (match) => `-${match.toLowerCase()}`); +} + +const optimizedAppearDataId = "framerAppearId"; +const optimizedAppearDataAttribute = "data-" + camelToDash(optimizedAppearDataId); + +function getOptimisedAppearId(visualElement) { + return visualElement.props[optimizedAppearDataAttribute]; +} + +/** + * Decide whether we should block this animation. Previously, we achieved this + * just by checking whether the key was listed in protectedKeys, but this + * posed problems if an animation was triggered by afterChildren and protectedKeys + * had been set to true in the meantime. + */ +function shouldBlockAnimation({ protectedKeys, needsAnimating }, key) { + const shouldBlock = protectedKeys.hasOwnProperty(key) && needsAnimating[key] !== true; + needsAnimating[key] = false; + return shouldBlock; +} +function animateTarget(visualElement, targetAndTransition, { delay = 0, transitionOverride, type } = {}) { + let { transition, transitionEnd, ...target } = targetAndTransition; + const defaultTransition = visualElement.getDefaultTransition(); + transition = transition + ? resolveTransition(transition, defaultTransition) + : defaultTransition; + const reduceMotion = transition?.reduceMotion; + const skipAnimations = transition?.skipAnimations; + if (transitionOverride) + transition = transitionOverride; + const animations = []; + const animationTypeState = type && + visualElement.animationState && + visualElement.animationState.getState()[type]; + const path = transition?.path; + if (path) { + // path mutates `target` to claim x/y; loop below skips them. + path.animateVisualElement(visualElement, target, transition, delay, animations); + } + for (const key in target) { + const value = visualElement.getValue(key, visualElement.latestValues[key] ?? null); + const valueTarget = target[key]; + if (valueTarget === undefined || + (animationTypeState && + shouldBlockAnimation(animationTypeState, key))) { + continue; + } + const valueTransition = { + delay, + ...getValueTransition(transition || {}, key), + }; + if (skipAnimations) + valueTransition.skipAnimations = true; + /** + * If the value is already at the defined target, skip the animation. + * We still re-assert the value via frame.update to take precedence + * over any stale transitionEnd callbacks from previous animations. + */ + const currentValue = value.get(); + if (currentValue !== undefined && + !value.isAnimating() && + !Array.isArray(valueTarget) && + valueTarget === currentValue && + !valueTransition.velocity) { + frame.update(() => value.set(valueTarget)); + continue; + } + /** + * If this is the first time a value is being animated, check + * to see if we're handling off from an existing animation. + */ + let isHandoff = false; + if (window.MotionHandoffAnimation) { + const appearId = getOptimisedAppearId(visualElement); + if (appearId) { + const startTime = window.MotionHandoffAnimation(appearId, key, frame); + if (startTime !== null) { + valueTransition.startTime = startTime; + isHandoff = true; + } + } + } + addValueToWillChange(visualElement, key); + const shouldReduceMotion = reduceMotion ?? visualElement.shouldReduceMotion; + value.start(animateMotionValue(key, value, valueTarget, shouldReduceMotion && positionalKeys.has(key) + ? { type: false } + : valueTransition, visualElement, isHandoff)); + const animation = value.animation; + if (animation) { + animations.push(animation); + } + } + if (transitionEnd) { + const applyTransitionEnd = () => frame.update(() => { + transitionEnd && setTarget(visualElement, transitionEnd); + }); + if (animations.length) { + Promise.all(animations).then(applyTransitionEnd); + } + else { + applyTransitionEnd(); + } + } + return animations; +} + +function animateVariant(visualElement, variant, options = {}) { + const resolved = resolveVariant(visualElement, variant, options.type === "exit" + ? visualElement.presenceContext?.custom + : undefined); + let { transition = visualElement.getDefaultTransition() || {} } = resolved || {}; + if (options.transitionOverride) { + transition = options.transitionOverride; + } + /** + * If we have a variant, create a callback that runs it as an animation. + * Otherwise, we resolve a Promise immediately for a composable no-op. + */ + const getAnimation = resolved + ? () => Promise.all(animateTarget(visualElement, resolved, options)) + : () => Promise.resolve(); + /** + * If we have children, create a callback that runs all their animations. + * Otherwise, we resolve a Promise immediately for a composable no-op. + */ + const getChildAnimations = visualElement.variantChildren && visualElement.variantChildren.size + ? (forwardDelay = 0) => { + const { delayChildren = 0, staggerChildren, staggerDirection, } = transition; + return animateChildren(visualElement, variant, forwardDelay, delayChildren, staggerChildren, staggerDirection, options); + } + : () => Promise.resolve(); + /** + * If the transition explicitly defines a "when" option, we need to resolve either + * this animation or all children animations before playing the other. + */ + const { when } = transition; + if (when) { + const [first, last] = when === "beforeChildren" + ? [getAnimation, getChildAnimations] + : [getChildAnimations, getAnimation]; + return first().then(() => last()); + } + else { + return Promise.all([getAnimation(), getChildAnimations(options.delay)]); + } +} +function animateChildren(visualElement, variant, delay = 0, delayChildren = 0, staggerChildren = 0, staggerDirection = 1, options) { + const animations = []; + for (const child of visualElement.variantChildren) { + child.notify("AnimationStart", variant); + animations.push(animateVariant(child, variant, { + ...options, + delay: delay + + (typeof delayChildren === "function" ? 0 : delayChildren) + + calcChildStagger(visualElement.variantChildren, child, delayChildren, staggerChildren, staggerDirection), + }).then(() => child.notify("AnimationComplete", variant))); + } + return Promise.all(animations); +} + +function animateVisualElement(visualElement, definition, options = {}) { + visualElement.notify("AnimationStart", definition); + let animation; + if (Array.isArray(definition)) { + const animations = definition.map((variant) => animateVariant(visualElement, variant, options)); + animation = Promise.all(animations); + } + else if (typeof definition === "string") { + animation = animateVariant(visualElement, definition, options); + } + else { + const resolvedDefinition = typeof definition === "function" + ? resolveVariant(visualElement, definition, options.custom) + : definition; + animation = Promise.all(animateTarget(visualElement, resolvedDefinition, options)); + } + return animation.then(() => { + visualElement.notify("AnimationComplete", definition); + }); +} + +/** + * ValueType for "auto" + */ +const auto = { + test: (v) => v === "auto", + parse: (v) => v, +}; + +/** + * Tests a provided value against a ValueType + */ +const testValueType = (v) => (type) => type.test(v); + +/** + * A list of value types commonly used for dimensions + */ +const dimensionValueTypes = [number, px, percent, degrees, vw, vh, auto]; +/** + * Tests a dimensional value against the list of dimension ValueTypes + */ +const findDimensionValueType = (v) => dimensionValueTypes.find(testValueType(v)); + +function isNone(value) { + if (typeof value === "number") { + return value === 0; + } + else if (value !== null) { + return value === "none" || value === "0" || motionUtils.isZeroValueString(value); + } + else { + return true; + } +} + +/** + * Properties that should default to 1 or 100% + */ +const maxDefaults = new Set(["brightness", "contrast", "saturate", "opacity"]); +function applyDefaultFilter(v) { + const [name, value] = v.slice(0, -1).split("("); + if (name === "drop-shadow") + return v; + const [number] = value.match(floatRegex) || []; + if (!number) + return v; + const unit = value.replace(number, ""); + let defaultValue = maxDefaults.has(name) ? 1 : 0; + if (number !== value) + defaultValue *= 100; + return name + "(" + defaultValue + unit + ")"; +} +const functionRegex = /\b([a-z-]*)\(.*?\)/gu; +const filter = { + ...complex, + getAnimatableNone: (v) => { + const functions = v.match(functionRegex); + return functions ? functions.map(applyDefaultFilter).join(" ") : v; + }, +}; + +const mask = { + ...complex, + getAnimatableNone: (v) => { + const parsed = complex.parse(v); + const transformer = complex.createTransformer(v); + return transformer(parsed.map((v) => typeof v === "number" ? 0 : typeof v === "object" ? { ...v, alpha: 1 } : v)); + }, +}; + +const int = { + ...number, + transform: Math.round, +}; + +const transformValueTypes = { + rotate: degrees, + /** + * Internal channel for `transition.path` orientToPath. Composed onto + * `rotate` at the transform-build sites so the user's `rotate` is + * never read or overwritten. Not part of `transformPropOrder`. + */ + pathRotation: degrees, + rotateX: degrees, + rotateY: degrees, + rotateZ: degrees, + scale, + scaleX: scale, + scaleY: scale, + scaleZ: scale, + skew: degrees, + skewX: degrees, + skewY: degrees, + distance: px, + translateX: px, + translateY: px, + translateZ: px, + x: px, + y: px, + z: px, + perspective: px, + transformPerspective: px, + opacity: alpha, + originX: progressPercentage, + originY: progressPercentage, + originZ: px, +}; + +const numberValueTypes = { + // Border props + borderWidth: px, + borderTopWidth: px, + borderRightWidth: px, + borderBottomWidth: px, + borderLeftWidth: px, + borderRadius: px, + borderTopLeftRadius: px, + borderTopRightRadius: px, + borderBottomRightRadius: px, + borderBottomLeftRadius: px, + // Positioning props + width: px, + maxWidth: px, + height: px, + maxHeight: px, + top: px, + right: px, + bottom: px, + left: px, + inset: px, + insetBlock: px, + insetBlockStart: px, + insetBlockEnd: px, + insetInline: px, + insetInlineStart: px, + insetInlineEnd: px, + // Spacing props + padding: px, + paddingTop: px, + paddingRight: px, + paddingBottom: px, + paddingLeft: px, + paddingBlock: px, + paddingBlockStart: px, + paddingBlockEnd: px, + paddingInline: px, + paddingInlineStart: px, + paddingInlineEnd: px, + margin: px, + marginTop: px, + marginRight: px, + marginBottom: px, + marginLeft: px, + marginBlock: px, + marginBlockStart: px, + marginBlockEnd: px, + marginInline: px, + marginInlineStart: px, + marginInlineEnd: px, + // Typography + fontSize: px, + // Misc + backgroundPositionX: px, + backgroundPositionY: px, + ...transformValueTypes, + zIndex: int, + // SVG + fillOpacity: alpha, + strokeOpacity: alpha, + numOctaves: int, +}; + +/** + * A map of default value types for common values + */ +const defaultValueTypes = { + ...numberValueTypes, + // Color props + color, + backgroundColor: color, + outlineColor: color, + fill: color, + stroke: color, + // Border props + borderColor: color, + borderTopColor: color, + borderRightColor: color, + borderBottomColor: color, + borderLeftColor: color, + filter, + WebkitFilter: filter, + mask, + WebkitMask: mask, +}; +/** + * Gets the default ValueType for the provided value key + */ +const getDefaultValueType = (key) => defaultValueTypes[key]; + +const customTypes = /*@__PURE__*/ new Set([filter, mask]); +function getAnimatableNone(key, value) { + let defaultValueType = getDefaultValueType(key); + if (!customTypes.has(defaultValueType)) + defaultValueType = complex; + // If value is not recognised as animatable, ie "none", create an animatable version origin based on the target + return defaultValueType.getAnimatableNone + ? defaultValueType.getAnimatableNone(value) + : undefined; +} + +/** + * If we encounter keyframes like "none" or "0" and we also have keyframes like + * "#fff" or "200px 200px" we want to find a keyframe to serve as a template for + * the "none" keyframes. In this case "#fff" or "200px 200px" - then these get turned into + * zero equivalents, i.e. "#fff0" or "0px 0px". + */ +const invalidTemplates = new Set(["auto", "none", "0"]); +function makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, name) { + let i = 0; + let animatableTemplate = undefined; + while (i < unresolvedKeyframes.length && !animatableTemplate) { + const keyframe = unresolvedKeyframes[i]; + if (typeof keyframe === "string" && + !invalidTemplates.has(keyframe) && + analyseComplexValue(keyframe).values.length) { + animatableTemplate = unresolvedKeyframes[i]; + } + i++; + } + if (animatableTemplate && name) { + for (const noneIndex of noneKeyframeIndexes) { + unresolvedKeyframes[noneIndex] = getAnimatableNone(name, animatableTemplate); + } + } +} + +class DOMKeyframesResolver extends KeyframeResolver { + constructor(unresolvedKeyframes, onComplete, name, motionValue, element) { + super(unresolvedKeyframes, onComplete, name, motionValue, element, true); + } + readKeyframes() { + const { unresolvedKeyframes, element, name } = this; + if (!element || !element.current) + return; + super.readKeyframes(); + /** + * If any keyframe is a CSS variable, we need to find its value by sampling the element + */ + for (let i = 0; i < unresolvedKeyframes.length; i++) { + let keyframe = unresolvedKeyframes[i]; + if (typeof keyframe === "string") { + keyframe = keyframe.trim(); + if (isCSSVariableToken(keyframe)) { + const resolved = getVariableValue(keyframe, element.current); + if (resolved !== undefined) { + unresolvedKeyframes[i] = resolved; + } + if (i === unresolvedKeyframes.length - 1) { + this.finalKeyframe = keyframe; + } + } + } + } + /** + * Resolve "none" values. We do this potentially twice - once before and once after measuring keyframes. + * This could be seen as inefficient but it's a trade-off to avoid measurements in more situations, which + * have a far bigger performance impact. + */ + this.resolveNoneKeyframes(); + /** + * Check to see if unit type has changed. If so schedule jobs that will + * temporarily set styles to the destination keyframes. + * Skip if we have more than two keyframes or this isn't a positional value. + * TODO: We can throw if there are multiple keyframes and the value type changes. + */ + if (!positionalKeys.has(name) || unresolvedKeyframes.length !== 2) { + return; + } + const [origin, target] = unresolvedKeyframes; + const originType = findDimensionValueType(origin); + const targetType = findDimensionValueType(target); + /** + * If one keyframe contains embedded CSS variables (e.g. in calc()) and the other + * doesn't, we need to measure to convert to pixels. This handles GitHub issue #3410. + */ + const originHasVar = containsCSSVariable(origin); + const targetHasVar = containsCSSVariable(target); + if (originHasVar !== targetHasVar && positionalValues[name]) { + this.needsMeasurement = true; + return; + } + /** + * Either we don't recognise these value types or we can animate between them. + */ + if (originType === targetType) + return; + /** + * If both values are numbers or pixels, we can animate between them by + * converting them to numbers. + */ + if (isNumOrPxType(originType) && isNumOrPxType(targetType)) { + for (let i = 0; i < unresolvedKeyframes.length; i++) { + const value = unresolvedKeyframes[i]; + if (typeof value === "string") { + unresolvedKeyframes[i] = parseFloat(value); + } + } + } + else if (positionalValues[name]) { + /** + * Else, the only way to resolve this is by measuring the element. + */ + this.needsMeasurement = true; + } + } + resolveNoneKeyframes() { + const { unresolvedKeyframes, name } = this; + const noneKeyframeIndexes = []; + for (let i = 0; i < unresolvedKeyframes.length; i++) { + if (unresolvedKeyframes[i] === null || + isNone(unresolvedKeyframes[i])) { + noneKeyframeIndexes.push(i); + } + } + if (noneKeyframeIndexes.length) { + makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, name); + } + } + measureInitialState() { + const { element, unresolvedKeyframes, name } = this; + if (!element || !element.current) + return; + if (name === "height") { + this.suspendedScrollY = window.pageYOffset; + } + this.measuredOrigin = positionalValues[name](element.measureViewportBox(), window.getComputedStyle(element.current)); + unresolvedKeyframes[0] = this.measuredOrigin; + // Set final key frame to measure after next render + const measureKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1]; + if (measureKeyframe !== undefined) { + element.getValue(name, measureKeyframe).jump(measureKeyframe, false); + } + } + measureEndState() { + const { element, name, unresolvedKeyframes } = this; + if (!element || !element.current) + return; + const value = element.getValue(name); + value && value.jump(this.measuredOrigin, false); + const finalKeyframeIndex = unresolvedKeyframes.length - 1; + const finalKeyframe = unresolvedKeyframes[finalKeyframeIndex]; + unresolvedKeyframes[finalKeyframeIndex] = positionalValues[name](element.measureViewportBox(), window.getComputedStyle(element.current)); + if (finalKeyframe !== null && this.finalKeyframe === undefined) { + this.finalKeyframe = finalKeyframe; + } + // If we removed transform values, reapply them before the next render + if (this.removedTransforms?.length) { + this.removedTransforms.forEach(([unsetTransformName, unsetTransformValue]) => { + element + .getValue(unsetTransformName) + .set(unsetTransformValue); + }); + } + this.resolveNoneKeyframes(); + } +} + +/** + * The four corner-radius longhands. Shared so the projection mixer, scale + * corrector, WAAPI px-value set and view-transition crop pass don't each carry + * their own copy. Order is irrelevant - every consumer mixes/corrects/animates + * each corner independently. + */ +const cornerRadiusProps = [ + "borderTopLeftRadius", + "borderTopRightRadius", + "borderBottomRightRadius", + "borderBottomLeftRadius", +]; + +const pxValues = new Set([ + // Border props + "borderWidth", + "borderTopWidth", + "borderRightWidth", + "borderBottomWidth", + "borderLeftWidth", + "borderRadius", + ...cornerRadiusProps, + // Positioning props + "width", + "maxWidth", + "height", + "maxHeight", + "top", + "right", + "bottom", + "left", + "inset", + "insetBlock", + "insetBlockStart", + "insetBlockEnd", + "insetInline", + "insetInlineStart", + "insetInlineEnd", + // Spacing props + "padding", + "paddingTop", + "paddingRight", + "paddingBottom", + "paddingLeft", + "paddingBlock", + "paddingBlockStart", + "paddingBlockEnd", + "paddingInline", + "paddingInlineStart", + "paddingInlineEnd", + "margin", + "marginTop", + "marginRight", + "marginBottom", + "marginLeft", + "marginBlock", + "marginBlockStart", + "marginBlockEnd", + "marginInline", + "marginInlineStart", + "marginInlineEnd", + // Typography + "fontSize", + // Misc + "backgroundPositionX", + "backgroundPositionY", +]); + +function applyPxDefaults(keyframes, name) { + for (let i = 0; i < keyframes.length; i++) { + if (typeof keyframes[i] === "number" && pxValues.has(name)) { + keyframes[i] = keyframes[i] + "px"; + } + } +} + +function isWaapiSupportedEasing(easing) { + return Boolean((typeof easing === "function" && supportsLinearEasing()) || + !easing || + (typeof easing === "string" && + (easing in supportedWaapiEasing || supportsLinearEasing())) || + motionUtils.isBezierDefinition(easing) || + (Array.isArray(easing) && easing.every(isWaapiSupportedEasing))); +} + +const supportsPartialKeyframes = /*@__PURE__*/ motionUtils.memo(() => { + try { + document.createElement("div").animate({ opacity: [1] }); + } + catch (e) { + return false; + } + return true; +}); + +function resolveElements(elementOrSelector, scope, selectorCache) { + if (elementOrSelector == null) { + return []; + } + if (elementOrSelector instanceof EventTarget) { + return [elementOrSelector]; + } + else if (typeof elementOrSelector === "string") { + let root = document; + if (scope) { + root = scope.current; + } + const elements = selectorCache?.[elementOrSelector] ?? + root.querySelectorAll(elementOrSelector); + return elements ? Array.from(elements) : []; + } + return Array.from(elementOrSelector).filter((element) => element != null); +} + +function createSelectorEffect(subjectEffect) { + return (subject, values) => { + const elements = resolveElements(subject); + const subscriptions = []; + for (const element of elements) { + const remove = subjectEffect(element, values); + subscriptions.push(remove); + } + return () => { + for (const remove of subscriptions) + remove(); + }; + }; +} + +/** + * Provided a value and a ValueType, returns the value as that value type. + */ +const getValueAsType = (value, type) => { + return type && typeof value === "number" + ? type.transform(value) + : value; +}; + +class MotionValueState { + constructor() { + this.latest = {}; + this.values = new Map(); + } + set(name, value, render, computed, useDefaultValueType = true) { + const existingValue = this.values.get(name); + if (existingValue) { + existingValue.onRemove(); + } + const onChange = () => { + const v = value.get(); + if (useDefaultValueType) { + this.latest[name] = getValueAsType(v, numberValueTypes[name]); + } + else { + this.latest[name] = v; + } + render && frame.render(render); + }; + onChange(); + const cancelOnChange = value.on("change", onChange); + computed && value.addDependent(computed); + const remove = () => { + cancelOnChange(); + render && cancelFrame(render); + this.values.delete(name); + computed && value.removeDependent(computed); + }; + this.values.set(name, { value, onRemove: remove }); + return remove; + } + get(name) { + return this.values.get(name)?.value; + } +} + +function createEffect(addValue) { + const stateCache = new WeakMap(); + return (subject, values) => { + const state = stateCache.get(subject) ?? new MotionValueState(); + stateCache.set(subject, state); + const subscriptions = []; + for (const key in values) { + const value = values[key]; + const remove = addValue(subject, state, key, value); + subscriptions.push(remove); + } + return () => { + for (const cancel of subscriptions) + cancel(); + }; + }; +} + +function canSetAsProperty(element, name) { + if (!(name in element)) + return false; + const descriptor = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(element), name) || + Object.getOwnPropertyDescriptor(element, name); + // Check if it has a setter + return descriptor && typeof descriptor.set === "function"; +} +const addAttrValue = (element, state, key, value) => { + const isProp = canSetAsProperty(element, key); + const name = isProp + ? key + : key.startsWith("data") || key.startsWith("aria") + ? camelToDash(key) + : key; + /** + * Set attribute directly via property if available + */ + const render = isProp + ? () => { + element[name] = state.latest[key]; + } + : () => { + const v = state.latest[key]; + if (v === null || v === undefined) { + element.removeAttribute(name); + } + else { + element.setAttribute(name, String(v)); + } + }; + return state.set(key, value, render); +}; +const attrEffect = /*@__PURE__*/ createSelectorEffect( +/*@__PURE__*/ createEffect(addAttrValue)); + +const propEffect = /*@__PURE__*/ createEffect((subject, state, key, value) => { + return state.set(key, value, () => { + subject[key] = state.latest[key]; + }, undefined, false); +}); + +/** + * Checks if an element is an HTML element in a way + * that works across iframes + */ +function isHTMLElement(element) { + return (motionUtils.isObject(element) && + "offsetHeight" in element && + !("ownerSVGElement" in element)); +} + +const translateAlias$1 = { + x: "translateX", + y: "translateY", + z: "translateZ", + transformPerspective: "perspective", +}; +function buildTransform$1(state) { + let transform = ""; + let transformIsDefault = true; + /** + * Loop over all possible transforms in order, adding the ones that + * are present to the transform string. + */ + for (let i = 0; i < transformPropOrder.length; i++) { + const key = transformPropOrder[i]; + const value = state.latest[key]; + if (value === undefined) + continue; + let valueIsDefault = true; + if (typeof value === "number") { + valueIsDefault = value === (key.startsWith("scale") ? 1 : 0); + } + else { + const parsed = parseFloat(value); + valueIsDefault = key.startsWith("scale") ? parsed === 1 : parsed === 0; + } + if (!valueIsDefault) { + transformIsDefault = false; + const transformName = translateAlias$1[key] || key; + transform += `${transformName}(${value}) `; + } + } + // See build-transform.ts: additive `rotate()` so user `rotate` isn't + // clobbered. Not a `transformPropOrder` slot. + const pathRotation = state.latest.pathRotation; + if (pathRotation) { + transformIsDefault = false; + transform += `rotate(${typeof pathRotation === "number" + ? `${pathRotation}deg` + : pathRotation}) `; + } + return transformIsDefault ? "none" : transform.trim(); +} + +const originProps = new Set(["originX", "originY", "originZ"]); +const addStyleValue = (element, state, key, value) => { + let render = undefined; + let computed = undefined; + if (transformProps.has(key)) { + if (!state.get("transform")) { + // If this is an HTML element, we need to set the transform-box to fill-box + // to normalise the transform relative to the element's bounding box + if (!isHTMLElement(element) && !state.get("transformBox")) { + addStyleValue(element, state, "transformBox", new MotionValue("fill-box")); + } + state.set("transform", new MotionValue("none"), () => { + element.style.transform = buildTransform$1(state); + }); + } + computed = state.get("transform"); + } + else if (originProps.has(key)) { + if (!state.get("transformOrigin")) { + state.set("transformOrigin", new MotionValue(""), () => { + const originX = state.latest.originX ?? "50%"; + const originY = state.latest.originY ?? "50%"; + const originZ = state.latest.originZ ?? 0; + element.style.transformOrigin = `${originX} ${originY} ${originZ}`; + }); + } + computed = state.get("transformOrigin"); + } + else if (isCSSVar(key)) { + render = () => { + element.style.setProperty(key, state.latest[key]); + }; + } + else { + render = () => { + element.style[key] = state.latest[key]; + }; + } + return state.set(key, value, render, computed); +}; +const styleEffect = /*@__PURE__*/ createSelectorEffect( +/*@__PURE__*/ createEffect(addStyleValue)); + +function addSVGPathValue(element, state, key, value) { + frame.render(() => element.setAttribute("pathLength", "1")); + if (key === "pathOffset") { + return state.set(key, value, () => { + // Use unitless value to avoid Safari zoom bug + const offset = state.latest[key]; + element.setAttribute("stroke-dashoffset", `${-offset}`); + }); + } + else { + if (!state.get("stroke-dasharray")) { + state.set("stroke-dasharray", new MotionValue("1 1"), () => { + const { pathLength = 1, pathSpacing } = state.latest; + // Use unitless values to avoid Safari zoom bug + element.setAttribute("stroke-dasharray", `${pathLength} ${pathSpacing ?? 1 - Number(pathLength)}`); + }); + } + return state.set(key, value, undefined, state.get("stroke-dasharray")); + } +} +const addSVGValue = (element, state, key, value) => { + if (key.startsWith("path")) { + return addSVGPathValue(element, state, key, value); + } + else if (key.startsWith("attr")) { + return addAttrValue(element, state, convertAttrKey(key), value); + } + const handler = key in element.style ? addStyleValue : addAttrValue; + return handler(element, state, key, value); +}; +const svgEffect = /*@__PURE__*/ createSelectorEffect( +/*@__PURE__*/ createEffect(addSVGValue)); +function convertAttrKey(key) { + return key.replace(/^attr([A-Z])/, (_, firstChar) => firstChar.toLowerCase()); +} + +const { schedule: microtask, cancel: cancelMicrotask } = +/* @__PURE__ */ createRenderBatcher(queueMicrotask, false); + +const isDragging = { + x: false, + y: false, +}; +function isDragActive() { + return isDragging.x || isDragging.y; +} + +function setDragLock(axis) { + if (axis === "x" || axis === "y") { + if (isDragging[axis]) { + return null; + } + else { + isDragging[axis] = true; + return () => { + isDragging[axis] = false; + }; + } + } + else { + if (isDragging.x || isDragging.y) { + return null; + } + else { + isDragging.x = isDragging.y = true; + return () => { + isDragging.x = isDragging.y = false; + }; + } + } +} + +function setupGesture(elementOrSelector, options) { + const elements = resolveElements(elementOrSelector); + const gestureAbortController = new AbortController(); + const eventOptions = { + passive: true, + ...options, + signal: gestureAbortController.signal, + }; + const cancel = () => gestureAbortController.abort(); + return [elements, eventOptions, cancel]; +} + +function isValidHover(event) { + return !(event.pointerType === "touch" || isDragActive()); +} +/** + * Create a hover gesture. hover() is different to .addEventListener("pointerenter") + * in that it has an easier syntax, filters out polyfilled touch events, interoperates + * with drag gestures, and automatically removes the "pointerennd" event listener when the hover ends. + * + * @public + */ +function hover(elementOrSelector, onHoverStart, options = {}) { + const [elements, eventOptions, cancel] = setupGesture(elementOrSelector, options); + elements.forEach((element) => { + let isPressed = false; + let deferredHoverEnd = false; + let hoverEndCallback; + const removePointerLeave = () => { + element.removeEventListener("pointerleave", onPointerLeave); + }; + const endHover = (event) => { + if (hoverEndCallback) { + hoverEndCallback(event); + hoverEndCallback = undefined; + } + removePointerLeave(); + }; + const onPointerUp = (event) => { + isPressed = false; + window.removeEventListener("pointerup", onPointerUp); + window.removeEventListener("pointercancel", onPointerUp); + if (deferredHoverEnd) { + deferredHoverEnd = false; + endHover(event); + } + }; + const onPointerDown = () => { + isPressed = true; + window.addEventListener("pointerup", onPointerUp, eventOptions); + window.addEventListener("pointercancel", onPointerUp, eventOptions); + }; + const onPointerLeave = (leaveEvent) => { + if (leaveEvent.pointerType === "touch") + return; + if (isPressed) { + deferredHoverEnd = true; + return; + } + endHover(leaveEvent); + }; + const onPointerEnter = (enterEvent) => { + if (!isValidHover(enterEvent)) + return; + deferredHoverEnd = false; + const onHoverEnd = onHoverStart(element, enterEvent); + if (typeof onHoverEnd !== "function") + return; + hoverEndCallback = onHoverEnd; + element.addEventListener("pointerleave", onPointerLeave, eventOptions); + }; + element.addEventListener("pointerenter", onPointerEnter, eventOptions); + element.addEventListener("pointerdown", onPointerDown, eventOptions); + }); + return cancel; +} + +/** + * Recursively traverse up the tree to check whether the provided child node + * is the parent or a descendant of it. + * + * @param parent - Element to find + * @param child - Element to test against parent + */ +const isNodeOrChild = (parent, child) => { + if (!child) { + return false; + } + else if (parent === child) { + return true; + } + else { + return isNodeOrChild(parent, child.parentElement); + } +}; + +const isPrimaryPointer = (event) => { + if (event.pointerType === "mouse") { + return typeof event.button !== "number" || event.button <= 0; + } + else { + /** + * isPrimary is true for all mice buttons, whereas every touch point + * is regarded as its own input. So subsequent concurrent touch points + * will be false. + * + * Specifically match against false here as incomplete versions of + * PointerEvents in very old browser might have it set as undefined. + */ + return event.isPrimary !== false; + } +}; + +const keyboardAccessibleElements = new Set([ + "BUTTON", + "INPUT", + "SELECT", + "TEXTAREA", + "A", +]); +/** + * Checks if an element is natively keyboard accessible (focusable). + * Used by the press gesture to determine if we need to add tabIndex. + */ +function isElementKeyboardAccessible(element) { + return (keyboardAccessibleElements.has(element.tagName) || + element.isContentEditable === true); +} +const textInputElements = new Set(["INPUT", "SELECT", "TEXTAREA"]); +/** + * Checks if an element has text selection or direct interaction behavior + * that should block drag gestures from starting. + * + * This specifically targets form controls where the user might want to select + * text or interact with the control (e.g., sliders, dropdowns). + * + * Buttons and links are NOT included because they don't have click-and-move + * actions of their own - they only respond to click events, so dragging + * should still work when initiated from these elements. + */ +function isElementTextInput(element) { + return (textInputElements.has(element.tagName) || + element.isContentEditable === true); +} + +const isPressing = new WeakSet(); + +/** + * Filter out events that are not "Enter" keys. + */ +function filterEvents(callback) { + return (event) => { + if (event.key !== "Enter") + return; + callback(event); + }; +} +function firePointerEvent(target, type) { + target.dispatchEvent(new PointerEvent("pointer" + type, { isPrimary: true, bubbles: true })); +} +const enableKeyboardPress = (focusEvent, eventOptions) => { + const element = focusEvent.currentTarget; + if (!element) + return; + const handleKeydown = filterEvents(() => { + if (isPressing.has(element)) + return; + firePointerEvent(element, "down"); + const handleKeyup = filterEvents(() => { + firePointerEvent(element, "up"); + }); + const handleBlur = () => firePointerEvent(element, "cancel"); + element.addEventListener("keyup", handleKeyup, eventOptions); + element.addEventListener("blur", handleBlur, eventOptions); + }); + element.addEventListener("keydown", handleKeydown, eventOptions); + /** + * Add an event listener that fires on blur to remove the keydown events. + */ + element.addEventListener("blur", () => element.removeEventListener("keydown", handleKeydown), eventOptions); +}; + +/** + * Filter out events that are not primary pointer events, or are triggering + * while a Motion gesture is active. + */ +function isValidPressEvent(event) { + return isPrimaryPointer(event) && !isDragActive(); +} +const claimedPointerDownEvents = new WeakSet(); +/** + * Create a press gesture. + * + * Press is different to `"pointerdown"`, `"pointerup"` in that it + * automatically filters out secondary pointer events like right + * click and multitouch. + * + * It also adds accessibility support for keyboards, where + * an element with a press gesture will receive focus and + * trigger on Enter `"keydown"` and `"keyup"` events. + * + * This is different to a browser's `"click"` event, which does + * respond to keyboards but only for the `"click"` itself, rather + * than the press start and end/cancel. The element also needs + * to be focusable for this to work, whereas a press gesture will + * make an element focusable by default. + * + * @public + */ +function press(targetOrSelector, onPressStart, options = {}) { + const [targets, eventOptions, cancelEvents] = setupGesture(targetOrSelector, options); + const startPress = (startEvent) => { + const target = startEvent.currentTarget; + if (!isValidPressEvent(startEvent)) + return; + if (claimedPointerDownEvents.has(startEvent)) + return; + isPressing.add(target); + if (options.stopPropagation) { + claimedPointerDownEvents.add(startEvent); + } + const onPressEnd = onPressStart(target, startEvent); + /** + * End listeners run in the capture phase so a descendant calling + * stopPropagation() in its own pointerup handler can't prevent the + * press gesture from ending. This also keeps the gesture-end + * ordering consistent with the drag gesture. See #2794. + */ + const endEventOptions = { ...eventOptions, capture: true }; + const onPointerEnd = (endEvent, success) => { + window.removeEventListener("pointerup", onPointerUp, endEventOptions); + window.removeEventListener("pointercancel", onPointerCancel, endEventOptions); + if (isPressing.has(target)) { + isPressing.delete(target); + } + if (!isValidPressEvent(endEvent)) { + return; + } + if (typeof onPressEnd === "function") { + onPressEnd(endEvent, { success }); + } + }; + const onPointerUp = (upEvent) => { + onPointerEnd(upEvent, target === window || + target === document || + options.useGlobalTarget || + isNodeOrChild(target, upEvent.target)); + }; + const onPointerCancel = (cancelEvent) => { + onPointerEnd(cancelEvent, false); + }; + window.addEventListener("pointerup", onPointerUp, endEventOptions); + window.addEventListener("pointercancel", onPointerCancel, endEventOptions); + }; + targets.forEach((target) => { + const pointerDownTarget = options.useGlobalTarget ? window : target; + pointerDownTarget.addEventListener("pointerdown", startPress, eventOptions); + if (isHTMLElement(target)) { + target.addEventListener("focus", (event) => enableKeyboardPress(event, eventOptions)); + if (!isElementKeyboardAccessible(target) && + !target.hasAttribute("tabindex")) { + target.tabIndex = 0; + } + } + }); + return cancelEvents; +} + +function getComputedStyle$2(element, name) { + const computedStyle = window.getComputedStyle(element); + return isCSSVar(name) + ? computedStyle.getPropertyValue(name) + : computedStyle[name]; +} + +/** + * Checks if an element is an SVG element in a way + * that works across iframes + */ +function isSVGElement(element) { + return motionUtils.isObject(element) && "ownerSVGElement" in element; +} + +const resizeHandlers = new WeakMap(); +let observer; +const getSize = (borderBoxAxis, svgAxis, htmlAxis) => (target, borderBoxSize) => { + if (borderBoxSize && borderBoxSize[0]) { + return borderBoxSize[0][(borderBoxAxis + "Size")]; + } + else if (isSVGElement(target) && "getBBox" in target) { + return target.getBBox()[svgAxis]; + } + else { + return target[htmlAxis]; + } +}; +const getWidth = /*@__PURE__*/ getSize("inline", "width", "offsetWidth"); +const getHeight = /*@__PURE__*/ getSize("block", "height", "offsetHeight"); +function notifyTarget({ target, borderBoxSize }) { + resizeHandlers.get(target)?.forEach((handler) => { + handler(target, { + get width() { + return getWidth(target, borderBoxSize); + }, + get height() { + return getHeight(target, borderBoxSize); + }, + }); + }); +} +function notifyAll(entries) { + entries.forEach(notifyTarget); +} +function createResizeObserver() { + if (typeof ResizeObserver === "undefined") + return; + observer = new ResizeObserver(notifyAll); +} +function resizeElement(target, handler) { + if (!observer) + createResizeObserver(); + const elements = resolveElements(target); + elements.forEach((element) => { + let elementHandlers = resizeHandlers.get(element); + if (!elementHandlers) { + elementHandlers = new Set(); + resizeHandlers.set(element, elementHandlers); + } + elementHandlers.add(handler); + observer?.observe(element); + }); + return () => { + elements.forEach((element) => { + const elementHandlers = resizeHandlers.get(element); + elementHandlers?.delete(handler); + if (!elementHandlers?.size) { + observer?.unobserve(element); + } + }); + }; +} + +const windowCallbacks = new Set(); +let windowResizeHandler; +function createWindowResizeHandler() { + windowResizeHandler = () => { + const info = { + get width() { + return window.innerWidth; + }, + get height() { + return window.innerHeight; + }, + }; + windowCallbacks.forEach((callback) => callback(info)); + }; + window.addEventListener("resize", windowResizeHandler); +} +function resizeWindow(callback) { + windowCallbacks.add(callback); + if (!windowResizeHandler) + createWindowResizeHandler(); + return () => { + windowCallbacks.delete(callback); + if (!windowCallbacks.size && + typeof windowResizeHandler === "function") { + window.removeEventListener("resize", windowResizeHandler); + windowResizeHandler = undefined; + } + }; +} + +function resize(a, b) { + return typeof a === "function" ? resizeWindow(a) : resizeElement(a, b); +} + +function observeTimeline(update, timeline) { + let prevProgress; + const onFrame = () => { + const { currentTime } = timeline; + const percentage = currentTime === null ? 0 : currentTime.value; + const progress = percentage / 100; + if (prevProgress !== progress) { + update(progress); + } + prevProgress = progress; + }; + frame.preUpdate(onFrame, true); + return () => cancelFrame(onFrame); +} + +const statsBuffer = { + value: null, + addProjectionMetrics: null, +}; + +function clearStatsBuffer() { + statsBuffer.value = null; + statsBuffer.addProjectionMetrics = null; +} +function recordStats() { + if (statsBuffer.value) { + clearStatsBuffer(); + throw new Error("Stats are already being measured"); + } + const buffer = statsBuffer; + buffer.value = { + layoutProjection: { + nodes: [], + calculatedTargetDeltas: [], + calculatedProjections: [], + }, + }; + buffer.addProjectionMetrics = (metrics) => { + const { layoutProjection } = buffer.value; + layoutProjection.nodes.push(metrics.nodes); + layoutProjection.calculatedTargetDeltas.push(metrics.calculatedTargetDeltas); + layoutProjection.calculatedProjections.push(metrics.calculatedProjections); + }; +} + +/** + * Checks if an element is specifically an SVGSVGElement (the root SVG element) + * in a way that works across iframes + */ +function isSVGSVGElement(element) { + return isSVGElement(element) && element.tagName === "svg"; +} + +function getOriginIndex(from, total) { + if (from === "first") { + return 0; + } + else { + const lastIndex = total - 1; + return from === "last" ? lastIndex : lastIndex / 2; + } +} +function stagger(duration = 0.1, { startDelay = 0, from = 0, ease } = {}) { + return (i, total) => { + const fromIndex = typeof from === "number" ? from : getOriginIndex(from, total); + const distance = Math.abs(fromIndex - i); + let delay = duration * distance; + if (ease) { + const maxDelay = total * duration; + const easingFunction = motionUtils.easingDefinitionToFunction(ease); + delay = easingFunction(delay / maxDelay) * maxDelay; + } + return startDelay + delay; + }; +} + +function transform(...args) { + const useImmediate = !Array.isArray(args[0]); + const argOffset = useImmediate ? 0 : -1; + const inputValue = args[0 + argOffset]; + const inputRange = args[1 + argOffset]; + const outputRange = args[2 + argOffset]; + const options = args[3 + argOffset]; + const interpolator = interpolate(inputRange, outputRange, options); + return useImmediate ? interpolator(inputValue) : interpolator; +} + +/** + * Create a `MotionValue` that animates to its latest value using any transition type. + * Can either be a value or track another `MotionValue`. + * + * ```jsx + * const x = motionValue(0) + * const y = followValue(x, { type: "spring", stiffness: 300 }) + * // or with tween + * const z = followValue(x, { type: "tween", duration: 0.5, ease: "easeOut" }) + * ``` + * + * @param source - Initial value or MotionValue to track + * @param options - Animation transition options + * @returns `MotionValue` + * + * @public + */ +function followValue(source, options) { + const initialValue = isMotionValue(source) ? source.get() : source; + const value = motionValue(initialValue); + attachFollow(value, source, options); + return value; +} +/** + * Attach an animation to a MotionValue that will animate whenever the value changes. + * Similar to attachSpring but supports any transition type (spring, tween, inertia, etc.) + * + * @param value - The MotionValue to animate + * @param source - Initial value or MotionValue to track + * @param options - Animation transition options + * @returns Cleanup function + * + * @public + */ +function attachFollow(value, source, options = {}) { + const initialValue = value.get(); + let activeAnimation = null; + let latestValue = initialValue; + let latestSetter; + const unit = typeof initialValue === "string" + ? initialValue.replace(/[\d.-]/g, "") + : undefined; + const stopAnimation = () => { + if (activeAnimation) { + activeAnimation.stop(); + activeAnimation = null; + } + value.animation = undefined; + }; + const startAnimation = () => { + const currentValue = asNumber$1(value.get()); + const targetValue = asNumber$1(latestValue); + // Don't animate if we're already at the target + if (currentValue === targetValue) { + stopAnimation(); + return; + } + // Use the running animation's analytical velocity for accuracy, + // falling back to the MotionValue's velocity for the initial animation. + // This prevents systematic velocity loss at high frame rates (240hz+). + const velocity = activeAnimation + ? activeAnimation.getGeneratorVelocity() + : value.getVelocity(); + stopAnimation(); + activeAnimation = new JSAnimation({ + keyframes: [currentValue, targetValue], + velocity, + // Default to spring if no type specified (matches useSpring behavior) + type: "spring", + restDelta: 0.001, + restSpeed: 0.01, + ...options, + onUpdate: latestSetter, + }); + }; + // Use a stable function reference so the frame loop Set deduplicates + // multiple calls within the same frame (e.g. rapid mouse events) + const scheduleAnimation = () => { + startAnimation(); + value.animation = activeAnimation ?? undefined; + value["events"].animationStart?.notify(); + activeAnimation?.then(() => { + value.animation = undefined; + value["events"].animationComplete?.notify(); + }); + }; + value.attach((v, set) => { + latestValue = v; + latestSetter = (latest) => set(parseValue(latest, unit)); + frame.postRender(scheduleAnimation); + }, stopAnimation); + if (isMotionValue(source)) { + let skipNextAnimation = options.skipInitialAnimation === true; + const removeSourceOnChange = source.on("change", (v) => { + if (skipNextAnimation) { + skipNextAnimation = false; + value.jump(parseValue(v, unit), false); + } + else { + value.set(parseValue(v, unit)); + } + }); + const removeValueOnDestroy = value.on("destroy", removeSourceOnChange); + return () => { + removeSourceOnChange(); + removeValueOnDestroy(); + }; + } + return stopAnimation; +} +function parseValue(v, unit) { + return unit ? v + unit : v; +} +function asNumber$1(v) { + return typeof v === "number" ? v : parseFloat(v); +} + +function subscribeValue(inputValues, outputValue, getLatest) { + const update = () => outputValue.set(getLatest()); + const scheduleUpdate = () => frame.preRender(update, false, true); + const subscriptions = inputValues.map((v) => v.on("change", scheduleUpdate)); + outputValue.on("destroy", () => { + subscriptions.forEach((unsubscribe) => unsubscribe()); + cancelFrame(update); + }); +} + +/** + * Create a `MotionValue` that transforms the output of other `MotionValue`s by + * passing their latest values through a transform function. + * + * Whenever a `MotionValue` referred to in the provided function is updated, + * it will be re-evaluated. + * + * ```jsx + * const x = motionValue(0) + * const y = transformValue(() => x.get() * 2) // double x + * ``` + * + * @param transformer - A transform function. This function must be pure with no side-effects or conditional statements. + * @returns `MotionValue` + * + * @public + */ +function transformValue(transform) { + const collectedValues = []; + /** + * Open session of collectMotionValues. Any MotionValue that calls get() + * inside transform will be saved into this array. + */ + collectMotionValues.current = collectedValues; + const initialValue = transform(); + collectMotionValues.current = undefined; + const value = motionValue(initialValue); + subscribeValue(collectedValues, value, transform); + return value; +} + +/** + * Create a `MotionValue` that maps the output of another `MotionValue` by + * mapping it from one range of values into another. + * + * @remarks + * + * Given an input range of `[-200, -100, 100, 200]` and an output range of + * `[0, 1, 1, 0]`, the returned `MotionValue` will: + * + * - When provided a value between `-200` and `-100`, will return a value between `0` and `1`. + * - When provided a value between `-100` and `100`, will return `1`. + * - When provided a value between `100` and `200`, will return a value between `1` and `0` + * + * The input range must be a linear series of numbers. The output range + * can be any value type supported by Motion: numbers, colors, shadows, etc. + * + * Every value in the output range must be of the same type and in the same format. + * + * ```jsx + * const x = motionValue(0) + * const xRange = [-200, -100, 100, 200] + * const opacityRange = [0, 1, 1, 0] + * const opacity = mapValue(x, xRange, opacityRange) + * ``` + * + * @param inputValue - `MotionValue` + * @param inputRange - A linear series of numbers (either all increasing or decreasing) + * @param outputRange - A series of numbers, colors or strings. Must be the same length as `inputRange`. + * @param options - + * + * - clamp: boolean. Clamp values to within the given range. Defaults to `true` + * - ease: EasingFunction[]. Easing functions to use on the interpolations between each value in the input and output ranges. If provided as an array, the array must be one item shorter than the input and output ranges, as the easings apply to the transition between each. + * + * @returns `MotionValue` + * + * @public + */ +function mapValue(inputValue, inputRange, outputRange, options) { + const map = transform(inputRange, outputRange, options); + return transformValue(() => map(inputValue.get())); +} + +/** + * Create a `MotionValue` that animates to its latest value using a spring. + * Can either be a value or track another `MotionValue`. + * + * ```jsx + * const x = motionValue(0) + * const y = springValue(x, { stiffness: 300 }) + * ``` + * + * @param source - Initial value or MotionValue to track + * @param options - Spring configuration options + * @returns `MotionValue` + * + * @public + */ +function springValue(source, options) { + return followValue(source, { type: "spring", ...options }); +} +/** + * Attach a spring animation to a MotionValue that will animate whenever the value changes. + * + * @param value - The MotionValue to animate + * @param source - Initial value or MotionValue to track + * @param options - Spring configuration options + * @returns Cleanup function + * + * @public + */ +function attachSpring(value, source, options) { + return attachFollow(value, source, { type: "spring", ...options }); +} + +/** + * A list of all ValueTypes + */ +const valueTypes = [...dimensionValueTypes, color, complex]; +/** + * Tests a value against the list of ValueTypes + */ +const findValueType = (v) => valueTypes.find(testValueType(v)); + +let nameCount = 0; +/** + * Generated names live in their own namespace so we can tell a name we own + * (and must clean up) from an author-defined one - and so a stale generated + * name left behind by an interrupted transition is re-owned, not mistaken for + * the author's and leaked. + */ +const generatedName = () => `motion-view-${nameCount++}`; +const isGeneratedName = (name) => name.startsWith("motion-view-"); +/** + * Tag a captured element with a `view-transition-class` so authors can target + * its generated layer from CSS (e.g. `::view-transition-group(.hero)`) without + * the opaque generated name. Tracked in `classed` - separate from the generated + * names in `assigned` - so cleanup removes the class without ever stripping an + * author's own inline `view-transition-name`. + */ +function tagClass(element, className, classed) { + if (!className) + return; + element.style?.setProperty("view-transition-class", className); + classed.push(element); +} +/** + * Set the element's `view-transition-group` so its layer reconstructs the DOM + * hierarchy in the pseudo-tree (`contain`) - or stays flat (`none`). Tracked in + * `grouped` for cleanup. When the element clips (any non-`visible` overflow) its + * name is recorded in `clipChildren` so the caller can clip the nested children + * (`::view-transition-group-children(name)`), mirroring the live clip through + * the whole transition rather than only at the live-DOM handoff. + * + * Ignored by browsers without nested view-transition groups, where it harmlessly + * degrades to the flat default. + */ +function applyGroup(element, name, group, grouped, clipChildren) { + if (!group) + return; + element.style?.setProperty("view-transition-group", group); + grouped.push(element); + if (group !== "none" && clipChildren) { + const style = getComputedStyle(element); + if (style.overflowX !== "visible" || style.overflowY !== "visible") { + clipChildren.add(name); + } + } +} +/** + * Resolve a selector/Element to elements and ensure each one carries a + * `view-transition-name` we can target from script. + * + * Author-defined names are reused as-is. Elements that are unnamed (or use + * the browser's `auto`/`match-element`, whose generated name is not exposed + * to script) are given a unique generated name, set inline so it's captured, + * and tracked in `assigned` for later cleanup. + * + * `registry` maps each Element to its name so the same element keeps its name + * across both captures (before and after the update), which is what allows a + * persistent element to animate as a single `group` layer. + */ +function assignViewTransitionNames(definition, registry, assigned, forcedNames, className, classed = [], group, grouped = [], clipChildren) { + const elements = resolveElements(definition); + /** + * The new end of a paired morph: give each element the matching name from + * the old end (by index) so the two share one layer and morph. If the new + * end resolves to *more* elements than the old end named, the extras have no + * counterpart - give them a fresh name so they animate as newcomers rather + * than being silently left unnamed. We return the names actually assigned + * (sized to the resolved elements), not the raw `forcedNames`, so stagger + * totals and the layer set stay in step with what's on the page. + */ + if (forcedNames) { + return elements.map((element, i) => { + const existing = registry.get(element); + if (existing) + return existing; + const name = forcedNames[i] ?? generatedName(); + element.style?.setProperty("view-transition-name", name); + assigned.push(element); + registry.set(element, name); + tagClass(element, className, classed); + applyGroup(element, name, group, grouped, clipChildren); + return name; + }); + } + /** + * Read every current name up front, before assigning any. Interleaving the + * reads with the inline `setProperty` writes below would dirty styles + * between reads and force a style recalc per element; batching the reads + * keeps it to one. Elements already in the registry keep their name and + * need no read. + */ + const currentNames = elements.map((element) => registry.has(element) + ? undefined + : getComputedStyle(element).getPropertyValue("view-transition-name")); + return elements.map((element, i) => { + const existing = registry.get(element); + if (existing) + return existing; + const current = currentNames[i]; + let name; + if (current && + current !== "none" && + current !== "auto" && + current !== "match-element" && + !isGeneratedName(current)) { + /** + * The author already named this layer - target it as-is and leave + * it to them to clean up. `auto`/`match-element` are overridden + * because their generated name is not exposed to script, and a + * stale `motion-view-*` (e.g. left by an interrupted transition) is + * re-owned rather than adopted as an author name and leaked. + */ + name = current; + } + else { + name = generatedName(); + element.style?.setProperty("view-transition-name", name); + assigned.push(element); + } + registry.set(element, name); + tagClass(element, className, classed); + applyGroup(element, name, group, grouped, clipChildren); + return name; + }); +} +/** + * Remove the `view-transition-name`s we generated and the + * `view-transition-class`es we applied. Author-defined names are never touched + * (they're not in `assigned`). Safe to call more than once (e.g. on both a + * finished and an interrupted transition). + */ +function releaseViewTransitionNames(assigned, classed = [], grouped = []) { + for (const element of assigned) { + element.style?.removeProperty("view-transition-name"); + } + for (const element of classed) { + element.style?.removeProperty("view-transition-class"); + } + for (const element of grouped) { + element.style?.removeProperty("view-transition-group"); + } +} + +function chooseLayerType(valueName) { + if (valueName === "layout") + return "group"; + if (valueName === "enter" || valueName === "new") + return "new"; + return "old"; +} + +let pendingRules = {}; +let style = null; +const css = { + set: (selector, values) => { + pendingRules[selector] = values; + }, + commit: () => { + if (!style) { + style = document.createElement("style"); + style.id = "motion-view"; + } + let cssText = ""; + for (const selector in pendingRules) { + const rule = pendingRules[selector]; + cssText += `${selector} {\n`; + for (const [property, value] of Object.entries(rule)) { + cssText += ` ${property}: ${value};\n`; + } + cssText += "}\n"; + } + style.textContent = cssText; + document.head.appendChild(style); + pendingRules = {}; + }, + remove: () => { + if (style && style.parentElement) { + style.parentElement.removeChild(style); + } + }, +}; + +function getViewAnimationLayerInfo(pseudoElement) { + const match = pseudoElement.match( + // `group-children` (nested transitions) before `group` so it wins. + /::view-transition-(old|new|group-children|group|image-pair)\((.*?)\)/); + if (!match) + return null; + return { layer: match[2], type: match[1] }; +} + +function getViewAnimations() { + return document.getAnimations().filter((animation) => { + const { effect } = animation; + return (!!effect && + effect.target === document.documentElement && + effect.pseudoElement?.startsWith("::view-transition")); + }); +} + +function hasTarget(target, targets) { + return targets.has(target) && Object.keys(targets.get(target)).length > 0; +} + +const definitionNames = ["layout", "enter", "exit", "new", "old"]; +/** + * Whether a computed border-radius is square (every component zero). Splitting + * on whitespace handles two-value/elliptical radii like "0px 20px" - a leading + * `parseFloat` alone would misread the non-zero vertical radius as square. + */ +const isSquareRadius = (radius) => radius.split(" ").every((value) => parseFloat(value) === 0); +/** + * The `ViewTransitionTarget` buckets driving each generated layer type, in + * priority order - the inverse of `chooseLayerType`. The new view is driven by + * `new`/`enter`, the old by `old`/`exit`. `group-children`/`image-pair` have no + * bucket; they follow the default layout timing. + */ +const typeBuckets = { + group: ["layout"], + new: ["new", "enter"], + old: ["old", "exit"], +}; +/** + * Default "absent" origin for a single-value keyframe, by pseudo type, so e.g. + * `enter({ scale: 1 })` grows in from 0.85 and `exit({ opacity: 0 })` fades + * from 1. `enter` prefers the matching `exit` value over these (see below). + */ +const ORIGIN_DEFAULTS = { + new: { opacity: 0, scale: 0.85 }, + old: { opacity: 1, scale: 1 }, +}; +/** + * How much two box aspect ratios must differ before a morph is treated as + * aspect-changing (and so worth cropping). Matches the projection engine's + * `preserve-aspect` threshold, so small layout jitter doesn't trigger a crop. + */ +const ASPECT_TOLERANCE = 0.2; +function startViewAnimation(builder) { + const { update, targets, resolveDefs, cropOverride, pairs, classNames, flatGroups, options: defaultOptions, } = builder; + if (!document.startViewTransition) { + // An async IIFE (not `new Promise(async …)`) so a throwing/rejecting + // update rejects this promise rather than leaving it unsettled. + return (async () => { + await update(); + return new GroupAnimation([]); + })(); + } + /** + * Resolve any selector/Element targets to layer names, assigning a + * `view-transition-name` to each element as we go. We run this before the + * update (so the elements are captured in the old snapshot) and again + * after it (for the new snapshot). An element present in both keeps the + * same name and animates as a single `group` layer. + */ + const nameRegistry = new Map(); + const assigned = []; + /** + * Elements we tagged with a `view-transition-class` (via `.class()`), + * tracked separately from `assigned` so cleanup removes the class without + * ever stripping an author's own inline `view-transition-name`. + */ + const classed = []; + /** + * Elements we set a `view-transition-group` on (for nesting), tracked for + * cleanup. `clipChildren` collects the names of nested parents that clip in + * the live layout, so their `::view-transition-group-children` is clipped + * through the transition - not just once the live DOM takes back over. + */ + const grouped = []; + const clipChildren = new Set(); + const layerTargets = new Map(); + const croppedNames = new Set(); + /** + * Each layer's explicit `.crop(true | false)` override (by resolved name), + * so `finalizeCrop` can let an author's choice win over the morph default. + */ + const cropForName = new Map(); + /** + * Each layer's stagger position (index + total) within its subject, per + * snapshot. Resolving against the snapshot the layer belongs to keeps + * stagger correct when `update()` replaces the matched elements, and lets + * us skip a layer that's absent from a snapshot (e.g. an exited element + * has no `new` pseudo-element). + */ + const layerStagger = new Map(); + /** + * Names allocated for a paired subject in the old snapshot, replayed onto + * its new-snapshot target so both ends share a layer and morph. + */ + const pairNames = new Map(); + /** + * The old (`from`) elements of each paired subject, so their names can be + * transferred off before the new (`to`) elements inherit them. + */ + const pairFrom = new Map(); + const resolveLayers = (phase) => { + targets.forEach((target, definition) => { + const className = classNames.get(definition); + /** + * Nest each resolved layer under its DOM-ancestor layer by default + * (`contain`), so an ancestor's clip/transform/opacity reach it + * through the transition; `.group(false)` opts a subject out (`none`) + * to stay flat and escape. Skipped for root / pre-named layers, which + * aren't elements we resolve and style. + */ + const group = definition === "root" || !resolveDefs.has(definition) + ? undefined + : flatGroups.has(definition) + ? "none" + : "contain"; + let names; + if (definition === "root" || !resolveDefs.has(definition)) { + names = [definition]; + } + else if (pairs.has(definition)) { + /** + * Paired morph: name the old target in the old snapshot, then + * force the same name(s) onto the new target in the new one, so + * two different elements morph as a single layer. + */ + if (phase === "old") { + pairFrom.set(definition, resolveElements(definition)); + names = assignViewTransitionNames(definition, nameRegistry, assigned, undefined, className, classed, group, grouped, clipChildren); + pairNames.set(definition, names); + } + else { + /** + * Transfer the name(s) off the `from` elements before the + * `to` elements inherit them. A `from` that survives into + * the new snapshot (e.g. hidden with `visibility: hidden` + * rather than removed) would otherwise keep the name and + * collide - "duplicate view-transition-name". + */ + for (const el of pairFrom.get(definition) ?? []) { + el.style?.removeProperty("view-transition-name"); + /** + * Drop the old end from the registry too, so the new + * end alone supplies this name's `new` crop radii - we + * neither re-measure nor get ordered by a stale element. + */ + nameRegistry.delete(el); + } + names = assignViewTransitionNames(pairs.get(definition), nameRegistry, assigned, pairNames.get(definition), className, classed, group, grouped, clipChildren); + } + } + else { + names = assignViewTransitionNames(definition, nameRegistry, assigned, undefined, className, classed, group, grouped, clipChildren); + } + // Record any explicit `.crop(true | false)` per resolved name; the + // crop set itself is computed later by `finalizeCrop` (it needs both + // snapshots to know which morphs change aspect ratio). + const override = cropOverride.get(definition); + names.forEach((name, index) => { + /** + * If two subjects resolve to the same element, merge their + * definitions so neither subject's animations are dropped. + */ + const existing = layerTargets.get(name); + layerTargets.set(name, existing && existing !== target + ? { ...existing, ...target } + : target); + if (override !== undefined) + cropForName.set(name, override); + const stagger = layerStagger.get(name) ?? {}; + stagger[phase] = [index, names.length]; + layerStagger.set(name, stagger); + }); + }); + }; + /** + * The stagger index/total for a layer, resolved against the snapshot it + * belongs to. Returns index -1 when the layer is absent from that snapshot + * so the caller can skip a pseudo-element that doesn't exist. + */ + const staggerPosition = (name, type) => { + const stagger = layerStagger.get(name); + const position = type === "old" + ? stagger?.old + : type === "new" + ? stagger?.new + : // group / group-children / image-pair persist across both. + stagger?.new ?? stagger?.old; + return position ?? [-1, 1]; + }; + /** + * Merge default + per-layer transition options for a generated layer and + * resolve any stagger/delay function against this element's position. Used + * by both the morph-retiming and crop corner-radius passes. + */ + const resolveLayerTransition = (target, type, transitionName, index, total) => { + const transition = mergeTransition(getValueTransition(defaultOptions, transitionName), getValueTransition((layerOptions(target, type) ?? {}), transitionName)); + if (typeof transition.delay === "function") { + transition.delay = transition.delay(index, total); + } + return transition; + }; + /** + * Resolve a layer's group (`layout`) timing to plain WAAPI values: native + * ms `delay`/`duration` and a baked `ease`. The single source of group + * timing, shared by the generated-group retiming and the crop corner-radius + * pass so the rounded clip animates on exactly the box's timing. It returns + * no generator `type` (the WAAPI-only `NativeAnimation` rejects a string + * type) nor `repeat`/`times` (which the group's `updateTiming` ignores), so + * none of them can leak into the radius animation and desync it. + */ + const resolveGroupTiming = (name) => { + const [index, total] = staggerPosition(name, "group"); + const transition = resolveLayerTransition(layerTargets.get(name), "group", "layout", index === -1 ? 0 : index, total); + transition.duration && (transition.duration = motionUtils.secondsToMilliseconds(transition.duration)); + const { delay = 0, duration, ease } = applyGeneratorOptions(transition); + return { delay: motionUtils.secondsToMilliseconds(delay), duration, ease }; + }; + /** + * Each layer's measured box + corner radii per snapshot. The box lets + * `finalizeCrop` tell whether a morph's aspect ratio changed (the only case + * worth cropping); the radii let a cropped morph's group clip animate each + * corner from the old element's radius to the new element's, keeping it + * rounded where `overflow: clip` would otherwise square the corners. + * + * We never flatten the source for capture (a snapshot is a paint of the live + * DOM, so squaring an element just for its capture would flash one real + * square frame). For an aspect-changing morph `object-fit: cover` crops each + * snapshot's own baked corners off-screen mid-morph, so the animated clip is + * the only visible corner; a near-same-aspect forced crop (`.crop(true)`) + * can't hide the outgoing snapshot's silhouette, but the endpoints coincide. + */ + const cropMeasurements = new Map(); + const measureLayers = (phase) => nameRegistry.forEach((name, element) => { + const el = element; + const rect = el.getBoundingClientRect?.(); + if (rect && rect.height) { + const style = getComputedStyle(el); + const radii = {}; + for (const corner of cornerRadiusProps) { + radii[corner] = style[corner]; + } + const entry = cropMeasurements.get(name) ?? {}; + entry[phase] = { width: rect.width, height: rect.height, radii }; + cropMeasurements.set(name, entry); + } + }); + /** + * With both snapshots measured, settle which layers crop. The default crops + * only a morph whose aspect ratio *changes* between snapshots - the one case + * where `object-fit: cover` does real work. A same-aspect morph or a + * fade-only layer is left uncropped: its corners scale naturally (no flash + * from squaring, no `overflow: clip` eating its shadow) and a backdrop can't + * be clipped to nothing. An explicit `.crop(true | false)` overrides either + * way. Runs after both snapshots are measured, since aspect needs both. + */ + const finalizeCrop = () => { + croppedNames.clear(); + for (const name of layerStagger.keys()) { + if (name === "root") + continue; + // An explicit `.crop(true | false)` wins; otherwise crop a morph + // whose aspect ratio changed. + if (cropForName.get(name) ?? aspectChanged(name)) { + croppedNames.add(name); + } + } + }; + /** + * Whether a layer is a morph whose box aspect ratio changed between + * snapshots (beyond a small tolerance). Fade-only layers (one snapshot) are + * never "changed". + */ + const aspectChanged = (name) => { + const box = cropMeasurements.get(name); + if (!box?.old || !box?.new || !box.old.height || !box.new.height) { + return false; + } + return (Math.abs(box.old.width / box.old.height - + box.new.width / box.new.height) > ASPECT_TOLERANCE); + }; + /** + * Write the persistent view-transition CSS: suppress root capture when the + * root has no animations of its own; force linear timing (baked into the + * keyframes, so we can retime later via updateTiming); and clip + + * object-fit: cover every cropped morph (the UA default overflows on + * aspect-ratio change). + * + * `css.commit` replaces rather than appends, so we re-set the full rule set + * each call - the crop rules are only known after `finalizeCrop` runs in the + * update callback, so the second call writes them. + */ + const commitViewCSS = () => { + if (!hasTarget("root", targets)) { + css.set(":root", { "view-transition-name": "none" }); + } + css.set("::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)", { "animation-timing-function": "linear !important" }); + croppedNames.forEach((name) => { + css.set(`::view-transition-group(${name})`, { overflow: "clip" }); + css.set(`::view-transition-old(${name}), ::view-transition-new(${name})`, { width: "100%", height: "100%", "object-fit": "cover" }); + }); + /** + * Clip the nested children of any layer that clips in the live layout, + * so a wrapper crops its child for the whole morph (mirroring the DOM) + * rather than only at the live-DOM handoff. No-op on browsers without + * nested view-transition groups. + */ + clipChildren.forEach((name) => { + css.set(`::view-transition-group-children(${name})`, { + overflow: "clip", + }); + }); + css.commit(); // Write + }; + const cleanup = () => { + releaseViewTransitionNames(assigned, classed, grouped); + css.remove(); // Write + }; + const callback = async () => { + await update(); + /** + * Re-resolve so elements created by the update are named for the new + * snapshot, then measure them. With both snapshots measured we can + * settle the crop set (aspect-changing morphs + forced). + */ + resolveLayers("new"); + measureLayers("new"); + finalizeCrop(); + /** + * Re-commit the crop CSS unconditionally: `finalizeCrop` is computed + * here (after both snapshots are measured), so the clip rules must be + * (re)written to match the settled set. + */ + commitViewCSS(); + }; + let transition; + try { + resolveLayers("old"); + /** + * Measure the old snapshot against the optimistic crop set (the new + * snapshot doesn't exist yet, so aspect change can't be known here; + * `finalizeCrop` settles it post-update). + */ + measureLayers("old"); + commitViewCSS(); + transition = document.startViewTransition(callback); + } + catch (error) { + /** + * The prelude writes inline names before the transition exists. If it + * throws (e.g. startViewTransition rejects in a bad UA state), release + * them so we neither leak DOM state nor stall the queue on a promise + * that never settles - hand back a rejection it can advance past. + */ + cleanup(); + return Promise.reject(error); + } + transition.finished.finally(cleanup); + return new Promise((resolve, reject) => { + transition.ready + .then(() => { + const generatedViewAnimations = getViewAnimations(); + const animations = []; + /** + * Create animations for each of our explicitly-defined subjects. + * `opacityAnimated` additionally tracks which `${name}:${type}` + * we faded, so we can keep the UA `plus-lighter` blend only for a + * genuine opacity crossfade (both sides fading) and drop it for a + * slide/transform, where additive compositing would flash bright. + */ + const explicitlyAnimated = new Set(); + const opacityAnimated = new Set(); + layerTargets.forEach((target, name) => { + const stagger = layerStagger.get(name); + /** + * Presence: `enter` only fires for a pure newcomer (a new + * view with no old), `exit` only for a pure leaver. A + * survivor (both) gets neither - it just morphs. + */ + const enterApplies = !!stagger?.new && !stagger?.old; + const exitApplies = !!stagger?.old && !stagger?.new; + for (const key of definitionNames) { + if (!target[key]) + continue; + if (key === "enter" && !enterApplies) + continue; + if (key === "exit" && !exitApplies) + continue; + const type = chooseLayerType(key); + const [index, total] = staggerPosition(name, type); + // Skip a layer absent from its snapshot. + if (index === -1) + continue; + const { keyframes, options } = target[key]; + for (let [valueName, valueKeyframes] of Object.entries(keyframes)) { + // Skip only missing values - `0` (e.g. opacity: 0) + // is valid and must reach the from-value inference. + if (valueKeyframes == null) + continue; + /** + * The view path hands keyframes straight to WAAPI, + * so Motion's `x`/`y` shorthands (compiled to + * `transform` only via the value pipeline) have no + * effect. Warn and skip - use `transform`/`translate`. + */ + if (valueName === "x" || valueName === "y") { + motionUtils.warnOnce(false, `animateView() animates view-transition layers with CSS properties; the "${valueName}" shorthand has no effect - use transform, e.g. { transform: "translateX(40px)" }.`); + continue; + } + /** + * enter/exit win over new/old on a shared property - + * skip it here when the gated bucket also defines it. + */ + if (key === "new" && + enterApplies && + target.enter?.keyframes[valueName] != null) { + continue; + } + if (key === "old" && + exitApplies && + target.exit?.keyframes[valueName] != null) { + continue; + } + const valueOptions = mergeTransition(getValueTransition(defaultOptions, valueName), getValueTransition(options, valueName)); + /** + * Infer an origin for a single-value keyframe. An + * `enter` mirrors the matching `exit` value (a + * defined exit reverses into the enter for free); + * otherwise the per-type default (opacity 0/1, scale + * 0.85). No default -> left as-is (animates from the + * live value). + * + * `new`/`old` fire for survivors too, where only the + * opacity crossfade default applies - a transform + * default like scale 0.85 would pop a persisting + * element, so gate it on the layer actually + * entering/leaving. + */ + if (!Array.isArray(valueKeyframes)) { + const exitValue = key === "enter" + ? target.exit?.keyframes[valueName] + : undefined; + const allowDefault = valueName === "opacity" || + (type === "new" ? enterApplies : exitApplies); + const from = exitValue != null + ? Array.isArray(exitValue) + ? exitValue[exitValue.length - 1] + : exitValue + : allowDefault + ? ORIGIN_DEFAULTS[type]?.[valueName] + : undefined; + if (from !== undefined) { + valueKeyframes = [from, valueKeyframes]; + } + } + /** + * Resolve stagger function if provided, per element + * across this subject's resolved layers. + */ + if (typeof valueOptions.delay === "function") { + valueOptions.delay = valueOptions.delay(index, total); + } + valueOptions.duration && (valueOptions.duration = motionUtils.secondsToMilliseconds(valueOptions.duration)); + valueOptions.delay && (valueOptions.delay = motionUtils.secondsToMilliseconds(valueOptions.delay)); + animations.push(new NativeAnimation({ + ...valueOptions, + element: document.documentElement, + name: valueName, + pseudoElement: `::view-transition-${type}(${name})`, + keyframes: valueKeyframes, + })); + explicitlyAnimated.add(`${name}:${type}`); + if (valueName === "opacity") { + opacityAnimated.add(`${name}:${type}`); + } + } + } + }); + /** + * Handle browser generated animations + */ + for (const animation of generatedViewAnimations) { + if (animation.playState === "finished") + continue; + const { effect } = animation; + if (!effect || !(effect instanceof KeyframeEffect)) + continue; + const { pseudoElement } = effect; + if (!pseudoElement) + continue; + const name = getViewAnimationLayerInfo(pseudoElement); + if (!name) + continue; + const targetDefinition = layerTargets.get(name.layer); + /** + * We built our own animation for this layer, so drop the + * browser-generated fade we're replacing. The UA + * `plus-lighter` blend is a *separate* generated animation on + * the same pseudo (it sets `mix-blend-mode` in its keyframes): + * keep it *only* for a true opacity crossfade - both sides + * fading - so a symmetric crossfade composites without + * darkening, but a slide/transform (where both layers stay + * opaque and overlap) doesn't flash bright from the addition. + */ + if (explicitlyAnimated.has(`${name.layer}:${name.type}`)) { + const isCrossfade = opacityAnimated.has(`${name.layer}:new`) && + opacityAnimated.has(`${name.layer}:old`); + if (isCrossfade && + effect + .getKeyframes() + .some((keyframe) => keyframe.mixBlendMode)) { + animations.push(new NativeAnimationWrapper(animation)); + } + else { + animation.cancel(); + } + continue; + } + /** + * Drop the orphaned half of the default crossfade. The UA + * fades old out and new in as a *pair*; if the opposing half + * was explicitly overridden with something other than an + * opacity fade (a clip or transform reveal), this side's + * default opacity fade has no partner - left to run it would + * dissolve what should be a static backdrop (e.g. + * `.new({ clipPath })` should reveal over a still old view, + * not fade the old out around the growing clip). Cancel it - + * and its `plus-lighter` sibling on the same pseudo, which + * would otherwise flash bright where the two opaque layers + * overlap. A genuine crossfade (the opposing side also fading + * opacity) keeps both halves and is handled above. + */ + const opposite = name.type === "old" + ? "new" + : name.type === "new" + ? "old" + : undefined; + if (opposite && + explicitlyAnimated.has(`${name.layer}:${opposite}`) && + !opacityAnimated.has(`${name.layer}:${opposite}`)) { + animation.cancel(); + continue; + } + /** + * Otherwise retime the browser-generated animation to + * Motion's timing. This auto-enables the layout (group) + * morph for any resolved/named target, and applies the + * default timing to old/new layers we haven't explicitly + * overridden. + * + * group + group-children both follow the layout timing so + * the nesting container stays in sync with the morph. + */ + /** + * A survivor's old + new are the two halves of one + * `plus-lighter` crossfade. They must share identical timing + * (so their opacities stay mirrored and sum to 1 - else the + * additive blend flashes bright wherever both are partly + * visible) and fade linearly (the bounce belongs on the + * group's geometry, not the opacity). So time them as the + * group, rather than via their own - potentially staggered, + * or enter/exit-derived - old/new options. + */ + const stagger = layerStagger.get(name.layer); + const isMorphCrossfade = (name.type === "old" || name.type === "new") && + !!stagger?.old && + !!stagger?.new; + let timing; + if (name.type.startsWith("group")) { + // group + group-children follow the resolved group + // timing - the single source shared with the crop + // corner-radius pass below. + const { delay, duration, ease } = resolveGroupTiming(name.layer); + timing = { + delay, + duration, + easing: mapEasingToNativeEasing(ease, duration), + }; + } + else { + const timingType = isMorphCrossfade ? "group" : name.type; + const [index, total] = staggerPosition(name.layer, timingType); + const transitionName = timingType === "group" ? "layout" : ""; + let animationTransition = resolveLayerTransition(targetDefinition, timingType, transitionName, index === -1 ? 0 : index, total); + /** + * The crossfade should resolve at the spring's + * *perceptual* (visual) duration - the geometry can keep + * bouncing, but the opacity shouldn't drag through the + * settle. So capture `visualDuration` before + * `applyGeneratorOptions` replaces it with the full + * overshoot duration, and use it for the fade. + */ + const visualDuration = animationTransition.visualDuration; + animationTransition.duration && (animationTransition.duration = motionUtils.secondsToMilliseconds(animationTransition.duration)); + animationTransition = + applyGeneratorOptions(animationTransition); + timing = { + delay: motionUtils.secondsToMilliseconds(animationTransition.delay ?? 0), + duration: isMorphCrossfade && visualDuration !== undefined + ? motionUtils.secondsToMilliseconds(visualDuration) + : animationTransition.duration, + easing: isMorphCrossfade + ? "linear" + : mapEasingToNativeEasing(animationTransition.ease, animationTransition.duration), + }; + } + effect.updateTiming(timing); + animations.push(new NativeAnimationWrapper(animation)); + } + /** + * Round each cropped layer's clip. Its `::view-transition-group` + * has `overflow: clip`, which would otherwise square the corners + * mid-morph; animate each corner from the old element's radius to + * the new element's so the crop stays rounded. Timed as the group + * (`layout`) so the radius tracks the morphing box. + */ + cropMeasurements.forEach((entry, name) => { + if (!croppedNames.has(name)) + return; + // Reuse the group's resolved timing - native ms delay/ + // duration + a baked ease, with no generator `type` or + // repeat/times to leak into (or throw inside) NativeAnimation. + const { delay, duration, ease } = resolveGroupTiming(name); + for (const corner of cornerRadiusProps) { + // `||` (not `??`) so an empty measurement falls back to + // the other snapshot rather than an invalid keyframe. + const from = entry.old?.radii[corner] || + entry.new?.radii[corner] || + "0px"; + const to = entry.new?.radii[corner] || + entry.old?.radii[corner] || + "0px"; + // Nothing to round if the corner is square at both ends. + if (isSquareRadius(from) && isSquareRadius(to)) + continue; + animations.push(new NativeAnimation({ + element: document.documentElement, + name: corner, + pseudoElement: `::view-transition-group(${name})`, + keyframes: [from, to], + delay, + duration, + ease, + })); + } + }); + resolve(new GroupAnimation(animations)); + }) + .catch(() => + /** + * `ready` rejects when the transition is skipped - no visual + * change, or superseded by an interrupting transition. The DOM + * update still applied, so settle with no animations rather than + * surfacing it as an error to an awaiting caller. A genuine + * failure in `update()` rejects `updateCallbackDone` (already + * settled by now), so propagate that instead. + */ + transition.updateCallbackDone.then(() => resolve(new GroupAnimation([])), reject)); + }); +} +/** + * The options that should time a given generated layer type, so a retimed + * group/old/new picks up any per-target transition the user provided. Checks + * the type's buckets in priority order (e.g. `new` before `enter`). + */ +function layerOptions(target, type) { + for (const bucket of typeBuckets[type] ?? []) { + const options = target?.[bucket]?.options; + if (options) + return options; + } +} +/** + * Merge a base transition (e.g. the default `options`) with a per-layer/value + * override. An explicit `duration` on the override must win over an inherited + * generator's own timing: a spring prefers `visualDuration`, and + * `spring.applyToOptions` overwrites `duration` with the computed settle time - + * so without this the override is silently discarded. Dropping the inherited + * `type`/`visualDuration` makes the layer a plain tween of that duration, unless + * it asked for its own generator `type`/`visualDuration`. + */ +function mergeTransition(base, override) { + const merged = { ...base, ...override }; + if (override.duration !== undefined) { + if (override.visualDuration === undefined) + delete merged.visualDuration; + if (override.type === undefined) + delete merged.type; + } + return merged; +} + +let builders = []; +let current = null; +function next() { + current = null; + const [nextBuilder] = builders; + if (nextBuilder) + start(nextBuilder); +} +function start(builder) { + motionUtils.removeItem(builders, builder); + current = builder; + startViewAnimation(builder) + .then((animation) => { + builder.notifyReady(animation); + return animation.finished; + }) + // A genuinely failed transition (a throwing update) rejects the + // builder; a skipped/interrupted one resolves with no animations (see + // start.ts). Either way, advance the queue - else later transitions hang. + .catch((error) => builder.notifyReject(error)) + .finally(next); +} +function processQueue() { + /** + * Iterate backwards over the builders array. We can ignore the + * "wait" animations. If we have an interrupting animation in the + * queue then we need to batch all preceeding animations into it. + * Currently this only batches the update functions but will also + * need to batch the targets. + */ + for (let i = builders.length - 1; i >= 0; i--) { + const builder = builders[i]; + const { interrupt } = builder.options; + if (interrupt === "immediate") { + const batchedUpdates = builders.slice(0, i + 1).map((b) => b.update); + const remaining = builders.slice(i + 1); + builder.update = () => { + batchedUpdates.forEach((update) => update()); + }; + // Put the current builder at the front, followed by any "wait" builders + builders = [builder, ...remaining]; + break; + } + } + if (!current || builders[0]?.options.interrupt === "immediate") { + next(); + } +} +function addToQueue(builder) { + builders.push(builder); + microtask.render(processQueue); +} + +class ViewTransitionBuilder { + constructor(update, options = {}) { + this.currentSubject = "root"; + this.targets = new Map(); + /** + * Definitions that must be resolved to elements (and assigned a + * `view-transition-name`) rather than treated as pre-named layers. + */ + this.resolveDefs = new Set(); + /** + * Per-subject crop override: `true` forces the crop (clip + object-fit: + * cover + animated corner radii) on, `false` forces it off. A subject with + * no entry uses the default - crop only a genuine morph (a layer present in + * both snapshots), so a fade-only enter/exit isn't clipped to nothing. + */ + this.cropOverride = new Map(); + /** + * Subjects paired with a different new-snapshot target (the second `.add()` + * argument), so two distinct elements share one name and morph into each + * other - a shared-element transition. + */ + this.pairs = new Map(); + /** + * A `view-transition-class` to apply to each subject's resolved elements, + * so authors can target the generated layers from CSS by class rather than + * the opaque generated name. + */ + this.classNames = new Map(); + /** + * Subjects opted out of automatic group nesting via `.group(false)`. Their + * layer stays a flat top-level group (`view-transition-group: none`) instead + * of nesting under its DOM-ancestor layer - so it animates independently and + * escapes an ancestor's clip/transform (e.g. an element that lifts out of a + * card and flies across, which nesting would clip to the card). + */ + this.flatGroups = new Set(); + this.notifyReady = motionUtils.noop; + this.notifyReject = motionUtils.noop; + this.readyPromise = new Promise((resolve, reject) => { + this.notifyReady = resolve; + this.notifyReject = reject; + }); + this.update = update; + this.options = { + interrupt: "wait", + ...options, + }; + // Avoid an unhandled rejection when a failed transition has no + // `.then(_, reject)` handler attached (e.g. fire-and-forget). + this.readyPromise.catch(motionUtils.noop); + addToQueue(this); + } + /** + * Target elements resolved from a selector or Element, each assigned a + * `view-transition-name` automatically. + * + * Passing a second target pairs them: the first is resolved in the old + * snapshot and the second in the new, sharing one name so two *different* + * elements morph into each other (e.g. `.add(card, ".modal")`). Symmetric - + * pass them the other way round to morph back. + */ + add(subject, newSubject) { + this.currentSubject = subject; + this.resolveDefs.add(subject); + if (newSubject !== undefined) + this.pairs.set(subject, newSubject); + // Register the subject so it participates (and gets an automatic + // layout/morph animation) even without an explicit enter/exit/layout. + if (!this.targets.has(subject)) + this.targets.set(subject, {}); + return this; + } + /** + * Control this subject's crop (clip + `object-fit: cover` + animated + * corners). By default a subject auto-crops only when it actually morphs - + * present in both snapshots (a survivor, or an `.add(a, b)` pair). A + * fade-only enter/exit has no second box to crop against, so it's left to + * the browser default; in particular the `overflow: clip` a crop adds would + * otherwise clip a mis-sized enter/exit layer to nothing. + * + * `.crop(false)` forces the crop off (e.g. a text morph, where + * `object-fit: cover` clips glyphs as the box grows); `.crop(true)` forces + * it on for a non-morph the default wouldn't otherwise crop. + */ + crop(enabled = true) { + this.cropOverride.set(this.currentSubject, enabled); + return this; + } + /** + * By default a subject's layer nests under its nearest DOM-ancestor layer + * (`view-transition-group: contain`), so the ancestor's clip/transform/opacity + * apply to it through the transition - mirroring how the DOM actually paints, + * and letting a wrapper crop its child for the whole morph rather than only + * once the live DOM takes back over. (Needs a browser that supports nested + * view-transition groups; elsewhere it degrades to the flat default.) + * + * Call `.group(false)` to opt out: the layer stays flat and top-level, so it + * animates independently and escapes an ancestor's clip - e.g. an element + * that should lift out of a card and fly across, which nesting would clip. + */ + group(enabled = true) { + enabled + ? this.flatGroups.delete(this.currentSubject) + : this.flatGroups.add(this.currentSubject); + return this; + } + /** + * Tag this subject's generated layers with a `view-transition-class`, so + * they can be targeted from CSS - `::view-transition-group(.name)`, + * `::view-transition-old/new(.name)`, `::view-transition-image-pair(.name)` + * - without the opaque generated `view-transition-name`. Because `.add()` + * can match many elements, a shared class targets them all at once (and, + * for a pair, both ends). The escape hatch for z-index / custom keyframes + * on a morph layer. + */ + class(name) { + this.classNames.set(this.currentSubject, name); + return this; + } + /** + * Set the transition for this subject's morph. The morph is enabled + * automatically by `.add()`; this just customises its timing (duration, + * easing, a `delay`/`stagger`, …). On the implicit `root` subject it also + * opts the page into the transition (the root crossfade). + */ + layout(options = {}) { + this.updateTarget("layout", {}, options); + return this; + } + enter(keyframes, options) { + this.updateTarget("enter", keyframes, options); + return this; + } + exit(keyframes, options) { + this.updateTarget("exit", keyframes, options); + return this; + } + /** + * Animate the new view directly, whether the element is appearing or + * persisting (unlike `.enter()`, which only fires for a pure newcomer). + * Pair with `.old()` for a crossfade or slide-through. + */ + new(keyframes, options) { + this.updateTarget("new", keyframes, options); + return this; + } + /** + * Animate the old view directly, whether the element is leaving or + * persisting (unlike `.exit()`, which only fires for a pure leaver). + */ + old(keyframes, options) { + this.updateTarget("old", keyframes, options); + return this; + } + updateTarget(target, keyframes, options = {}) { + const { currentSubject, targets } = this; + if (!targets.has(currentSubject)) { + targets.set(currentSubject, {}); + } + const targetData = targets.get(currentSubject); + targetData[target] = { keyframes, options }; + } + then(resolve, reject) { + return this.readyPromise.then(resolve, reject); + } +} +function animateView(update, options = {}) { + return new ViewTransitionBuilder(update, options); +} + +const createAxisDelta = () => ({ + translate: 0, + scale: 1, + origin: 0, + originPoint: 0, +}); +const createDelta = () => ({ + x: createAxisDelta(), + y: createAxisDelta(), +}); +const createAxis = () => ({ min: 0, max: 0 }); +const createBox = () => ({ + x: createAxis(), + y: createAxis(), +}); + +const visualElementStore = new WeakMap(); + +function isAnimationControls(v) { + return (v !== null && + typeof v === "object" && + typeof v.start === "function"); +} + +/** + * Decides if the supplied variable is variant label + */ +function isVariantLabel(v) { + return typeof v === "string" || Array.isArray(v); +} + +const variantPriorityOrder = [ + "animate", + "whileInView", + "whileFocus", + "whileHover", + "whileTap", + "whileDrag", + "exit", +]; +const variantProps = ["initial", ...variantPriorityOrder]; + +function isControllingVariants(props) { + return (isAnimationControls(props.animate) || + variantProps.some((name) => isVariantLabel(props[name]))); +} +function isVariantNode(props) { + return Boolean(isControllingVariants(props) || props.variants); +} + +/** + * Updates motion values from props changes. + * Uses `any` type for element to avoid circular dependencies with VisualElement. + */ +function updateMotionValuesFromProps(element, next, prev) { + for (const key in next) { + const nextValue = next[key]; + const prevValue = prev[key]; + if (isMotionValue(nextValue)) { + /** + * If this is a motion value found in props or style, we want to add it + * to our visual element's motion value map. + */ + element.addValue(key, nextValue); + } + else if (isMotionValue(prevValue)) { + /** + * If we're swapping from a motion value to a static value, + * create a new motion value from that + */ + element.addValue(key, motionValue(nextValue, { owner: element })); + } + else if (prevValue !== nextValue) { + /** + * If this is a flat value that has changed, update the motion value + * or create one if it doesn't exist. We only want to do this if we're + * not handling the value with our animation state. + */ + if (element.hasValue(key)) { + const existingValue = element.getValue(key); + if (existingValue.liveStyle === true) { + existingValue.jump(nextValue); + } + else if (!existingValue.hasAnimated) { + existingValue.set(nextValue); + } + } + else { + const latestValue = element.getStaticValue(key); + element.addValue(key, motionValue(latestValue !== undefined ? latestValue : nextValue, { owner: element })); + } + } + } + // Handle removed values + for (const key in prev) { + if (next[key] === undefined) + element.removeValue(key); + } + return next; +} + +// Does this device prefer reduced motion? Returns `null` server-side. +const prefersReducedMotion = { current: null }; +const hasReducedMotionListener = { current: false }; + +const isBrowser = typeof window !== "undefined"; +function initPrefersReducedMotion() { + hasReducedMotionListener.current = true; + if (!isBrowser) + return; + if (window.matchMedia) { + const motionMediaQuery = window.matchMedia("(prefers-reduced-motion)"); + const setReducedMotionPreferences = () => (prefersReducedMotion.current = motionMediaQuery.matches); + motionMediaQuery.addEventListener("change", setReducedMotionPreferences); + setReducedMotionPreferences(); + } + else { + prefersReducedMotion.current = false; + } +} + +const propEventHandlers = [ + "AnimationStart", + "AnimationComplete", + "Update", + "BeforeLayoutMeasure", + "LayoutMeasure", + "LayoutAnimationStart", + "LayoutAnimationComplete", +]; +/** + * Static feature definitions - can be injected by framework layer + */ +let featureDefinitions = {}; +/** + * Set feature definitions for all VisualElements. + * This should be called by the framework layer (e.g., framer-motion) during initialization. + */ +function setFeatureDefinitions(definitions) { + featureDefinitions = definitions; +} +/** + * Get the current feature definitions + */ +function getFeatureDefinitions() { + return featureDefinitions; +} +/** + * A VisualElement is an imperative abstraction around UI elements such as + * HTMLElement, SVGElement, Three.Object3D etc. + */ +class VisualElement { + /** + * This method takes React props and returns found MotionValues. For example, HTML + * MotionValues will be found within the style prop, whereas for Three.js within attribute arrays. + * + * This isn't an abstract method as it needs calling in the constructor, but it is + * intended to be one. + */ + scrapeMotionValuesFromProps(_props, _prevProps, _visualElement) { + return {}; + } + constructor({ parent, props, presenceContext, reducedMotionConfig, skipAnimations, blockInitialAnimation, visualState, }, options = {}) { + /** + * A reference to the current underlying Instance, e.g. a HTMLElement + * or Three.Mesh etc. + */ + this.current = null; + /** + * A set containing references to this VisualElement's children. + */ + this.children = new Set(); + /** + * Determine what role this visual element should take in the variant tree. + */ + this.isVariantNode = false; + this.isControllingVariants = false; + /** + * Decides whether this VisualElement should animate in reduced motion + * mode. + * + * TODO: This is currently set on every individual VisualElement but feels + * like it could be set globally. + */ + this.shouldReduceMotion = null; + /** + * Decides whether animations should be skipped for this VisualElement. + * Useful for E2E tests and visual regression testing. + */ + this.shouldSkipAnimations = false; + /** + * A map of all motion values attached to this visual element. Motion + * values are source of truth for any given animated value. A motion + * value might be provided externally by the component via props. + */ + this.values = new Map(); + this.KeyframeResolver = KeyframeResolver; + /** + * Cleanup functions for active features (hover/tap/exit etc) + */ + this.features = {}; + /** + * A map of every subscription that binds the provided or generated + * motion values onChange listeners to this visual element. + */ + this.valueSubscriptions = new Map(); + /** + * A reference to the previously-provided motion values as returned + * from scrapeMotionValuesFromProps. We use the keys in here to determine + * if any motion values need to be removed after props are updated. + */ + this.prevMotionValues = {}; + /** + * Track whether this element has been mounted before, to detect + * remounts after Suspense unmount/remount cycles. + */ + this.hasBeenMounted = false; + /** + * An object containing a SubscriptionManager for each active event. + */ + this.events = {}; + /** + * An object containing an unsubscribe function for each prop event subscription. + * For example, every "Update" event can have multiple subscribers via + * VisualElement.on(), but only one of those can be defined via the onUpdate prop. + */ + this.propEventSubscriptions = {}; + this.notifyUpdate = () => this.notify("Update", this.latestValues); + this.render = () => { + if (!this.current) + return; + this.triggerBuild(); + this.renderInstance(this.current, this.renderState, this.props.style, this.projection); + }; + this.renderScheduledAt = 0.0; + this.scheduleRender = () => { + const now = time.now(); + if (this.renderScheduledAt < now) { + this.renderScheduledAt = now; + frame.render(this.render, false, true); + } + }; + const { latestValues, renderState } = visualState; + this.latestValues = latestValues; + this.baseTarget = { ...latestValues }; + this.initialValues = props.initial ? { ...latestValues } : {}; + this.renderState = renderState; + this.parent = parent; + this.props = props; + this.presenceContext = presenceContext; + this.depth = parent ? parent.depth + 1 : 0; + this.reducedMotionConfig = reducedMotionConfig; + this.skipAnimationsConfig = skipAnimations; + this.options = options; + this.blockInitialAnimation = Boolean(blockInitialAnimation); + this.isControllingVariants = isControllingVariants(props); + this.isVariantNode = isVariantNode(props); + if (this.isVariantNode) { + this.variantChildren = new Set(); + } + this.manuallyAnimateOnMount = Boolean(parent && parent.current); + /** + * Any motion values that are provided to the element when created + * aren't yet bound to the element, as this would technically be impure. + * However, we iterate through the motion values and set them to the + * initial values for this component. + * + * TODO: This is impure and we should look at changing this to run on mount. + * Doing so will break some tests but this isn't necessarily a breaking change, + * more a reflection of the test. + */ + const { willChange, ...initialMotionValues } = this.scrapeMotionValuesFromProps(props, {}, this); + for (const key in initialMotionValues) { + const value = initialMotionValues[key]; + if (latestValues[key] !== undefined && isMotionValue(value)) { + value.set(latestValues[key]); + } + } + } + mount(instance) { + /** + * If this element has been mounted before (e.g. after a Suspense + * unmount/remount), reset motion values to their initial state + * so animations replay correctly from initial → animate. + */ + if (this.hasBeenMounted) { + for (const key in this.initialValues) { + this.values.get(key)?.jump(this.initialValues[key]); + this.latestValues[key] = this.initialValues[key]; + } + } + this.current = instance; + visualElementStore.set(instance, this); + if (this.projection && !this.projection.instance) { + this.projection.mount(instance); + } + if (this.parent && this.isVariantNode && !this.isControllingVariants) { + this.removeFromVariantTree = this.parent.addVariantChild(this); + } + this.values.forEach((value, key) => this.bindToMotionValue(key, value)); + /** + * Determine reduced motion preference. Only initialize the matchMedia + * listener if we actually need the dynamic value (i.e., when config + * is neither "never" nor "always"). + */ + if (this.reducedMotionConfig === "never") { + this.shouldReduceMotion = false; + } + else if (this.reducedMotionConfig === "always") { + this.shouldReduceMotion = true; + } + else { + if (!hasReducedMotionListener.current) { + initPrefersReducedMotion(); + } + this.shouldReduceMotion = prefersReducedMotion.current; + } + if (process.env.NODE_ENV !== "production") { + motionUtils.warnOnce(this.shouldReduceMotion !== true, "You have Reduced Motion enabled on your device. Animations may not appear as expected.", "reduced-motion-disabled"); + } + /** + * Set whether animations should be skipped based on the config. + */ + this.shouldSkipAnimations = this.skipAnimationsConfig ?? false; + this.parent?.addChild(this); + this.update(this.props, this.presenceContext); + this.hasBeenMounted = true; + } + unmount() { + this.projection && this.projection.unmount(); + cancelFrame(this.notifyUpdate); + cancelFrame(this.render); + this.valueSubscriptions.forEach((remove) => remove()); + this.valueSubscriptions.clear(); + this.removeFromVariantTree && this.removeFromVariantTree(); + this.parent?.removeChild(this); + for (const key in this.events) { + this.events[key].clear(); + } + for (const key in this.features) { + const feature = this.features[key]; + if (feature) { + feature.unmount(); + feature.isMounted = false; + } + } + this.current = null; + } + addChild(child) { + this.children.add(child); + this.enteringChildren ?? (this.enteringChildren = new Set()); + this.enteringChildren.add(child); + } + removeChild(child) { + this.children.delete(child); + this.enteringChildren && this.enteringChildren.delete(child); + } + bindToMotionValue(key, value) { + if (this.valueSubscriptions.has(key)) { + this.valueSubscriptions.get(key)(); + } + if (value.accelerate && + acceleratedValues.has(key) && + this.current instanceof HTMLElement) { + const { factory, keyframes, times, ease, duration } = value.accelerate; + const animation = new NativeAnimation({ + element: this.current, + name: key, + keyframes, + times, + ease, + duration: motionUtils.secondsToMilliseconds(duration), + }); + const cleanup = factory(animation); + this.valueSubscriptions.set(key, () => { + cleanup(); + animation.cancel(); + }); + return; + } + const valueIsTransform = transformProps.has(key); + if (valueIsTransform && this.onBindTransform) { + this.onBindTransform(); + } + const removeOnChange = value.on("change", (latestValue) => { + this.latestValues[key] = latestValue; + this.props.onUpdate && frame.preRender(this.notifyUpdate); + if (valueIsTransform && this.projection) { + this.projection.isTransformDirty = true; + } + this.scheduleRender(); + }); + let removeSyncCheck; + if (typeof window !== "undefined" && + window.MotionCheckAppearSync) { + removeSyncCheck = window.MotionCheckAppearSync(this, key, value); + } + this.valueSubscriptions.set(key, () => { + removeOnChange(); + if (removeSyncCheck) + removeSyncCheck(); + // Defer to MotionValue.on("change") auto-stop so React 19 remounts + // can resubscribe before the animation is cancelled (#3315). + }); + } + sortNodePosition(other) { + /** + * If these nodes aren't even of the same type we can't compare their depth. + */ + if (!this.current || + !this.sortInstanceNodePosition || + this.type !== other.type) { + return 0; + } + return this.sortInstanceNodePosition(this.current, other.current); + } + updateFeatures() { + let key = "animation"; + for (key in featureDefinitions) { + const featureDefinition = featureDefinitions[key]; + if (!featureDefinition) + continue; + const { isEnabled, Feature: FeatureConstructor } = featureDefinition; + /** + * If this feature is enabled but not active, make a new instance. + */ + if (!this.features[key] && + FeatureConstructor && + isEnabled(this.props)) { + this.features[key] = new FeatureConstructor(this); + } + /** + * If we have a feature, mount or update it. + */ + if (this.features[key]) { + const feature = this.features[key]; + if (feature.isMounted) { + feature.update(); + } + else { + feature.mount(); + feature.isMounted = true; + } + } + } + } + triggerBuild() { + this.build(this.renderState, this.latestValues, this.props); + } + /** + * Measure the current viewport box with or without transforms. + * Only measures axis-aligned boxes, rotate and skew must be manually + * removed with a re-render to work. + */ + measureViewportBox() { + return this.current + ? this.measureInstanceViewportBox(this.current, this.props) + : createBox(); + } + getStaticValue(key) { + return this.latestValues[key]; + } + setStaticValue(key, value) { + this.latestValues[key] = value; + } + /** + * Update the provided props. Ensure any newly-added motion values are + * added to our map, old ones removed, and listeners updated. + */ + update(props, presenceContext) { + if (props.transformTemplate || this.props.transformTemplate) { + this.scheduleRender(); + } + this.prevProps = this.props; + this.props = props; + this.prevPresenceContext = this.presenceContext; + this.presenceContext = presenceContext; + /** + * Update prop event handlers ie onAnimationStart, onAnimationComplete + */ + for (let i = 0; i < propEventHandlers.length; i++) { + const key = propEventHandlers[i]; + if (this.propEventSubscriptions[key]) { + this.propEventSubscriptions[key](); + delete this.propEventSubscriptions[key]; + } + const listenerName = ("on" + key); + const listener = props[listenerName]; + if (listener) { + this.propEventSubscriptions[key] = this.on(key, listener); + } + } + this.prevMotionValues = updateMotionValuesFromProps(this, this.scrapeMotionValuesFromProps(props, this.prevProps || {}, this), this.prevMotionValues); + if (this.handleChildMotionValue) { + this.handleChildMotionValue(); + } + } + getProps() { + return this.props; + } + /** + * Returns the variant definition with a given name. + */ + getVariant(name) { + return this.props.variants ? this.props.variants[name] : undefined; + } + /** + * Returns the defined default transition on this component. + */ + getDefaultTransition() { + return this.props.transition; + } + getTransformPagePoint() { + return this.props.transformPagePoint; + } + getClosestVariantNode() { + return this.isVariantNode + ? this + : this.parent + ? this.parent.getClosestVariantNode() + : undefined; + } + /** + * Add a child visual element to our set of children. + */ + addVariantChild(child) { + const closestVariantNode = this.getClosestVariantNode(); + if (closestVariantNode) { + closestVariantNode.variantChildren && + closestVariantNode.variantChildren.add(child); + return () => closestVariantNode.variantChildren.delete(child); + } + } + /** + * Add a motion value and bind it to this visual element. + */ + addValue(key, value) { + // Remove existing value if it exists + const existingValue = this.values.get(key); + if (value !== existingValue) { + if (existingValue) + this.removeValue(key); + this.bindToMotionValue(key, value); + this.values.set(key, value); + this.latestValues[key] = value.get(); + } + } + /** + * Remove a motion value and unbind any active subscriptions. + */ + removeValue(key) { + this.values.delete(key); + const unsubscribe = this.valueSubscriptions.get(key); + if (unsubscribe) { + unsubscribe(); + this.valueSubscriptions.delete(key); + } + delete this.latestValues[key]; + this.removeValueFromRenderState(key, this.renderState); + } + /** + * Check whether we have a motion value for this key + */ + hasValue(key) { + return this.values.has(key); + } + getValue(key, defaultValue) { + if (this.props.values && this.props.values[key]) { + return this.props.values[key]; + } + let value = this.values.get(key); + if (value === undefined && defaultValue !== undefined) { + value = motionValue(defaultValue === null ? undefined : defaultValue, { owner: this }); + this.addValue(key, value); + } + return value; + } + /** + * If we're trying to animate to a previously unencountered value, + * we need to check for it in our state and as a last resort read it + * directly from the instance (which might have performance implications). + */ + readValue(key, target) { + let value = this.latestValues[key] !== undefined || !this.current + ? this.latestValues[key] + : this.getBaseTargetFromProps(this.props, key) ?? + this.readValueFromInstance(this.current, key, this.options); + if (value !== undefined && value !== null) { + if (typeof value === "string" && + (motionUtils.isNumericalString(value) || motionUtils.isZeroValueString(value))) { + // If this is a number read as a string, ie "0" or "200", convert it to a number + value = parseFloat(value); + } + else if (!findValueType(value) && complex.test(target)) { + value = getAnimatableNone(key, target); + } + this.setBaseTarget(key, isMotionValue(value) ? value.get() : value); + } + return isMotionValue(value) ? value.get() : value; + } + /** + * Set the base target to later animate back to. This is currently + * only hydrated on creation and when we first read a value. + */ + setBaseTarget(key, value) { + this.baseTarget[key] = value; + } + /** + * Find the base target for a value thats been removed from all animation + * props. + */ + getBaseTarget(key) { + const { initial } = this.props; + let valueFromInitial; + if (typeof initial === "string" || typeof initial === "object") { + const variant = resolveVariantFromProps(this.props, initial, this.presenceContext?.custom); + if (variant) { + valueFromInitial = variant[key]; + } + } + /** + * If this value still exists in the current initial variant, read that. + */ + if (initial && valueFromInitial !== undefined) { + return valueFromInitial; + } + /** + * Alternatively, if this VisualElement config has defined a getBaseTarget + * so we can read the value from an alternative source, try that. + */ + const target = this.getBaseTargetFromProps(this.props, key); + if (target !== undefined && !isMotionValue(target)) + return target; + /** + * If the value was initially defined on initial, but it doesn't any more, + * return undefined. Otherwise return the value as initially read from the DOM. + */ + return this.initialValues[key] !== undefined && + valueFromInitial === undefined + ? undefined + : this.baseTarget[key]; + } + on(eventName, callback) { + if (!this.events[eventName]) { + this.events[eventName] = new motionUtils.SubscriptionManager(); + } + return this.events[eventName].add(callback); + } + notify(eventName, ...args) { + if (this.events[eventName]) { + this.events[eventName].notify(...args); + } + } + scheduleRenderMicrotask() { + microtask.render(this.render); + } +} + +class DOMVisualElement extends VisualElement { + constructor() { + super(...arguments); + this.KeyframeResolver = DOMKeyframesResolver; + } + sortInstanceNodePosition(a, b) { + /** + * compareDocumentPosition returns a bitmask, by using the bitwise & + * we're returning true if 2 in that bitmask is set to true. 2 is set + * to true if b preceeds a. + */ + return a.compareDocumentPosition(b) & 2 ? 1 : -1; + } + getBaseTargetFromProps(props, key) { + const style = props.style; + return style ? style[key] : undefined; + } + removeValueFromRenderState(key, { vars, style }) { + delete vars[key]; + delete style[key]; + } + handleChildMotionValue() { + if (this.childSubscription) { + this.childSubscription(); + delete this.childSubscription; + } + const { children } = this.props; + if (isMotionValue(children)) { + this.childSubscription = children.on("change", (latest) => { + if (this.current) { + this.current.textContent = `${latest}`; + } + }); + } + } +} + +/** + * Feature base class for extending VisualElement functionality. + * Features are plugins that can be mounted/unmounted to add behavior + * like gestures, animations, or layout tracking. + */ +class Feature { + constructor(node) { + this.isMounted = false; + this.node = node; + } + update() { } +} + +/** + * Bounding boxes tend to be defined as top, left, right, bottom. For various operations + * it's easier to consider each axis individually. This function returns a bounding box + * as a map of single-axis min/max values. + */ +function convertBoundingBoxToBox({ top, left, right, bottom, }) { + return { + x: { min: left, max: right }, + y: { min: top, max: bottom }, + }; +} +function convertBoxToBoundingBox({ x, y }) { + return { top: y.min, right: x.max, bottom: y.max, left: x.min }; +} +/** + * Applies a TransformPoint function to a bounding box. TransformPoint is usually a function + * provided by Framer to allow measured points to be corrected for device scaling. This is used + * when measuring DOM elements and DOM event points. + */ +function transformBoxPoints(point, transformPoint) { + if (!transformPoint) + return point; + const topLeft = transformPoint({ x: point.left, y: point.top }); + const bottomRight = transformPoint({ x: point.right, y: point.bottom }); + return { + top: topLeft.y, + left: topLeft.x, + bottom: bottomRight.y, + right: bottomRight.x, + }; +} + +function isIdentityScale(scale) { + return scale === undefined || scale === 1; +} +function hasScale({ scale, scaleX, scaleY }) { + return (!isIdentityScale(scale) || + !isIdentityScale(scaleX) || + !isIdentityScale(scaleY)); +} +function hasTransform(values) { + return (hasScale(values) || + has2DTranslate(values) || + values.z || + values.rotate || + values.rotateX || + values.rotateY || + values.skewX || + values.skewY); +} +function has2DTranslate(values) { + return is2DTranslate(values.x) || is2DTranslate(values.y); +} +function is2DTranslate(value) { + return value && value !== "0%"; +} + +/** + * Scales a point based on a factor and an originPoint + */ +function scalePoint(point, scale, originPoint) { + const distanceFromOrigin = point - originPoint; + const scaled = scale * distanceFromOrigin; + return originPoint + scaled; +} +/** + * Applies a translate/scale delta to a point + */ +function applyPointDelta(point, translate, scale, originPoint, boxScale) { + if (boxScale !== undefined) { + point = scalePoint(point, boxScale, originPoint); + } + return scalePoint(point, scale, originPoint) + translate; +} +/** + * Applies a translate/scale delta to an axis + */ +function applyAxisDelta(axis, translate = 0, scale = 1, originPoint, boxScale) { + axis.min = applyPointDelta(axis.min, translate, scale, originPoint, boxScale); + axis.max = applyPointDelta(axis.max, translate, scale, originPoint, boxScale); +} +/** + * Applies a translate/scale delta to a box + */ +function applyBoxDelta(box, { x, y }) { + applyAxisDelta(box.x, x.translate, x.scale, x.originPoint); + applyAxisDelta(box.y, y.translate, y.scale, y.originPoint); +} +const TREE_SCALE_SNAP_MIN = 0.999999999999; +const TREE_SCALE_SNAP_MAX = 1.0000000000001; +/** + * Apply a tree of deltas to a box. We do this to calculate the effect of all the transforms + * in a tree upon our box before then calculating how to project it into our desired viewport-relative box + * + * This is the final nested loop within updateLayoutDelta for future refactoring + */ +function applyTreeDeltas(box, treeScale, treePath, isSharedTransition = false) { + const treeLength = treePath.length; + if (!treeLength) + return; + // Reset the treeScale + treeScale.x = treeScale.y = 1; + let node; + let delta; + for (let i = 0; i < treeLength; i++) { + node = treePath[i]; + delta = node.projectionDelta; + /** + * TODO: Prefer to remove this, but currently we have motion components with + * display: contents in Framer. + */ + const { visualElement } = node.options; + if (visualElement && + visualElement.props.style && + visualElement.props.style.display === "contents") { + continue; + } + if (isSharedTransition && + node.options.layoutScroll && + node.scroll && + node !== node.root) { + translateAxis(box.x, -node.scroll.offset.x); + translateAxis(box.y, -node.scroll.offset.y); + } + if (delta) { + // Incoporate each ancestor's scale into a cumulative treeScale for this component + treeScale.x *= delta.x.scale; + treeScale.y *= delta.y.scale; + // Apply each ancestor's calculated delta into this component's recorded layout box + applyBoxDelta(box, delta); + } + if (isSharedTransition && hasTransform(node.latestValues)) { + transformBox(box, node.latestValues, node.layout?.layoutBox); + } + } + /** + * Snap tree scale back to 1 if it's within a non-perceivable threshold. + * This will help reduce useless scales getting rendered. + */ + if (treeScale.x < TREE_SCALE_SNAP_MAX && + treeScale.x > TREE_SCALE_SNAP_MIN) { + treeScale.x = 1.0; + } + if (treeScale.y < TREE_SCALE_SNAP_MAX && + treeScale.y > TREE_SCALE_SNAP_MIN) { + treeScale.y = 1.0; + } +} +function translateAxis(axis, distance) { + axis.min += distance; + axis.max += distance; +} +/** + * Apply a transform to an axis from the latest resolved motion values. + * This function basically acts as a bridge between a flat motion value map + * and applyAxisDelta + */ +function transformAxis(axis, axisTranslate, axisScale, boxScale, axisOrigin = 0.5) { + const originPoint = mixNumber$1(axis.min, axis.max, axisOrigin); + // Apply the axis delta to the final axis + applyAxisDelta(axis, axisTranslate, axisScale, originPoint, boxScale); +} +function resolveAxisTranslate(value, axis) { + if (typeof value === "string") { + return (parseFloat(value) / 100) * (axis.max - axis.min); + } + return value; +} +/** + * Apply a transform to a box from the latest resolved motion values. + */ +function transformBox(box, transform, sourceBox) { + const resolveBox = sourceBox ?? box; + transformAxis(box.x, resolveAxisTranslate(transform.x, resolveBox.x), transform.scaleX, transform.scale, transform.originX); + transformAxis(box.y, resolveAxisTranslate(transform.y, resolveBox.y), transform.scaleY, transform.scale, transform.originY); +} + +function measureViewportBox(instance, transformPoint) { + return convertBoundingBoxToBox(transformBoxPoints(instance.getBoundingClientRect(), transformPoint)); +} +function measurePageBox(element, rootProjectionNode, transformPagePoint) { + const viewportBox = measureViewportBox(element, transformPagePoint); + const { scroll } = rootProjectionNode; + if (scroll) { + translateAxis(viewportBox.x, scroll.offset.x); + translateAxis(viewportBox.y, scroll.offset.y); + } + return viewportBox; +} + +const translateAlias = { + x: "translateX", + y: "translateY", + z: "translateZ", + transformPerspective: "perspective", +}; +const numTransforms = transformPropOrder.length; +/** + * Build a CSS transform style from individual x/y/scale etc properties. + * + * This outputs with a default order of transforms/scales/rotations, this can be customised by + * providing a transformTemplate function. + */ +function buildTransform(latestValues, transform, transformTemplate) { + // The transform string we're going to build into. + let transformString = ""; + let transformIsDefault = true; + /** + * Loop over all possible transforms in order, adding the ones that + * are present to the transform string. + */ + for (let i = 0; i < numTransforms; i++) { + const key = transformPropOrder[i]; + const value = latestValues[key]; + if (value === undefined) + continue; + let valueIsDefault = true; + if (typeof value === "number") { + valueIsDefault = value === (key.startsWith("scale") ? 1 : 0); + } + else { + const parsed = parseFloat(value); + valueIsDefault = key.startsWith("scale") ? parsed === 1 : parsed === 0; + } + if (!valueIsDefault || transformTemplate) { + const valueAsType = getValueAsType(value, numberValueTypes[key]); + if (!valueIsDefault) { + transformIsDefault = false; + const transformName = translateAlias[key] || key; + transformString += `${transformName}(${valueAsType}) `; + } + if (transformTemplate) { + transform[key] = valueAsType; + } + } + } + // `pathRotation` composes onto `rotate` as a separate additive term so + // the user's `rotate` is never clobbered. Deliberately not a slot in + // `transformPropOrder`. + const pathRotation = latestValues.pathRotation; + if (pathRotation) { + transformIsDefault = false; + transformString += `rotate(${getValueAsType(pathRotation, numberValueTypes.pathRotation)}) `; + } + transformString = transformString.trim(); + // If we have a custom `transform` template, pass our transform values and + // generated transformString to that before returning + if (transformTemplate) { + transformString = transformTemplate(transform, transformIsDefault ? "" : transformString); + } + else if (transformIsDefault) { + transformString = "none"; + } + return transformString; +} + +function buildHTMLStyles(state, latestValues, transformTemplate) { + const { style, vars, transformOrigin } = state; + // Track whether we encounter any transform or transformOrigin values. + let hasTransform = false; + let hasTransformOrigin = false; + /** + * Loop over all our latest animated values and decide whether to handle them + * as a style or CSS variable. + * + * Transforms and transform origins are kept separately for further processing. + */ + for (const key in latestValues) { + const value = latestValues[key]; + if (transformProps.has(key)) { + // If this is a transform, flag to enable further transform processing + hasTransform = true; + continue; + } + else if (isCSSVariableName(key)) { + vars[key] = value; + continue; + } + else { + // Convert the value to its default value type, ie 0 -> "0px" + const valueAsType = getValueAsType(value, numberValueTypes[key]); + if (key.startsWith("origin")) { + // If this is a transform origin, flag and enable further transform-origin processing + hasTransformOrigin = true; + transformOrigin[key] = + valueAsType; + } + else { + style[key] = valueAsType; + } + } + } + if (!latestValues.transform) { + if (hasTransform || transformTemplate) { + style.transform = buildTransform(latestValues, state.transform, transformTemplate); + } + else if (style.transform) { + /** + * If we have previously created a transform but currently don't have any, + * reset transform style to none. + */ + style.transform = "none"; + } + } + /** + * Build a transformOrigin style. Uses the same defaults as the browser for + * undefined origins. + */ + if (hasTransformOrigin) { + const { originX = "50%", originY = "50%", originZ = 0, } = transformOrigin; + style.transformOrigin = `${originX} ${originY} ${originZ}`; + } +} + +function renderHTML(element, { style, vars }, styleProp, projection) { + const elementStyle = element.style; + let key; + for (key in style) { + // CSSStyleDeclaration has [index: number]: string; in the types, so we use that as key type. + elementStyle[key] = style[key]; + } + // Write projection styles directly to element style + projection?.applyProjectionStyles(elementStyle, styleProp); + for (key in vars) { + // Loop over any CSS variables and assign those. + // They can only be assigned using `setProperty`. + elementStyle.setProperty(key, vars[key]); + } +} + +function pixelsToPercent(pixels, axis) { + if (axis.max === axis.min) + return 0; + return (pixels / (axis.max - axis.min)) * 100; +} +/** + * We always correct borderRadius as a percentage rather than pixels to reduce paints. + * For example, if you are projecting a box that is 100px wide with a 10px borderRadius + * into a box that is 200px wide with a 20px borderRadius, that is actually a 10% + * borderRadius in both states. If we animate between the two in pixels that will trigger + * a paint each time. If we animate between the two in percentage we'll avoid a paint. + */ +const correctBorderRadius = { + correct: (latest, node) => { + if (!node.target) + return latest; + /** + * If latest is a string, if it's a percentage we can return immediately as it's + * going to be stretched appropriately. Otherwise, if it's a pixel, convert it to a number. + */ + if (typeof latest === "string") { + if (px.test(latest)) { + latest = parseFloat(latest); + } + else { + return latest; + } + } + /** + * If latest is a number, it's a pixel value. We use the current viewportBox to calculate that + * pixel value as a percentage of each axis + */ + const x = pixelsToPercent(latest, node.target.x); + const y = pixelsToPercent(latest, node.target.y); + return `${x}% ${y}%`; + }, +}; + +const correctBoxShadow = { + correct: (latest, { treeScale, projectionDelta }) => { + const original = latest; + const shadow = complex.parse(latest); + // TODO: Doesn't support multiple shadows + if (shadow.length > 5) + return original; + const template = complex.createTransformer(latest); + const offset = typeof shadow[0] !== "number" ? 1 : 0; + // Calculate the overall context scale + const xScale = projectionDelta.x.scale * treeScale.x; + const yScale = projectionDelta.y.scale * treeScale.y; + shadow[0 + offset] /= xScale; + shadow[1 + offset] /= yScale; + /** + * Ideally we'd correct x and y scales individually, but because blur and + * spread apply to both we have to take a scale average and apply that instead. + * We could potentially improve the outcome of this by incorporating the ratio between + * the two scales. + */ + const averageScale = mixNumber$1(xScale, yScale, 0.5); + // Blur + if (typeof shadow[2 + offset] === "number") + shadow[2 + offset] /= averageScale; + // Spread + if (typeof shadow[3 + offset] === "number") + shadow[3 + offset] /= averageScale; + return template(shadow); + }, +}; + +const scaleCorrectors = { + borderRadius: { + ...correctBorderRadius, + applyTo: [...cornerRadiusProps], + }, + borderTopLeftRadius: correctBorderRadius, + borderTopRightRadius: correctBorderRadius, + borderBottomLeftRadius: correctBorderRadius, + borderBottomRightRadius: correctBorderRadius, + boxShadow: correctBoxShadow, +}; +function addScaleCorrector(correctors) { + for (const key in correctors) { + scaleCorrectors[key] = correctors[key]; + if (isCSSVariableName(key)) { + scaleCorrectors[key].isCSSVariable = true; + } + } +} + +function isForcedMotionValue(key, { layout, layoutId }) { + return (transformProps.has(key) || + key.startsWith("origin") || + ((layout || layoutId !== undefined) && + (!!scaleCorrectors[key] || key === "opacity"))); +} + +function scrapeMotionValuesFromProps$1(props, prevProps, visualElement) { + const style = props.style; + const prevStyle = prevProps?.style; + const newValues = {}; + if (!style) + return newValues; + for (const key in style) { + if (isMotionValue(style[key]) || + (prevStyle && isMotionValue(prevStyle[key])) || + isForcedMotionValue(key, props) || + visualElement?.getValue(key)?.liveStyle !== undefined) { + newValues[key] = style[key]; + } + } + return newValues; +} + +function getComputedStyle$1(element) { + return window.getComputedStyle(element); +} +class HTMLVisualElement extends DOMVisualElement { + constructor() { + super(...arguments); + this.type = "html"; + this.renderInstance = renderHTML; + } + mount(instance) { + /** + * If a custom component forwards its ref to something other than a + * HTML/SVG element (a class instance, an imperative handle) there's + * nothing for Motion to style, measure or attach gestures to. #2777 + */ + motionUtils.invariant(Boolean(instance.style), "motion.create() components must forward their ref to a HTML or SVG element", "custom-component-ref"); + super.mount(instance); + } + readValueFromInstance(instance, key) { + if (transformProps.has(key)) { + return this.projection?.isProjecting + ? defaultTransformValue(key) + : readTransformValue(instance, key); + } + else { + const computedStyle = getComputedStyle$1(instance); + const value = (isCSSVariableName(key) + ? computedStyle.getPropertyValue(key) + : computedStyle[key]) || 0; + return typeof value === "string" ? value.trim() : value; + } + } + measureInstanceViewportBox(instance, { transformPagePoint }) { + return measureViewportBox(instance, transformPagePoint); + } + build(renderState, latestValues, props) { + buildHTMLStyles(renderState, latestValues, props.transformTemplate); + } + scrapeMotionValuesFromProps(props, prevProps, visualElement) { + return scrapeMotionValuesFromProps$1(props, prevProps, visualElement); + } +} + +function isObjectKey(key, object) { + return key in object; +} +class ObjectVisualElement extends VisualElement { + constructor() { + super(...arguments); + this.type = "object"; + } + readValueFromInstance(instance, key) { + if (isObjectKey(key, instance)) { + const value = instance[key]; + if (typeof value === "string" || typeof value === "number") { + return value; + } + } + return undefined; + } + getBaseTargetFromProps() { + return undefined; + } + removeValueFromRenderState(key, renderState) { + delete renderState.output[key]; + } + measureInstanceViewportBox() { + return createBox(); + } + build(renderState, latestValues) { + Object.assign(renderState.output, latestValues); + } + renderInstance(instance, { output }) { + Object.assign(instance, output); + } + sortInstanceNodePosition() { + return 0; + } +} + +const dashKeys = { + offset: "stroke-dashoffset", + array: "stroke-dasharray", +}; +const camelKeys = { + offset: "strokeDashoffset", + array: "strokeDasharray", +}; +/** + * Build SVG path properties. Uses the path's measured length to convert + * our custom pathLength, pathSpacing and pathOffset into stroke-dashoffset + * and stroke-dasharray attributes. + * + * This function is mutative to reduce per-frame GC. + * + * Note: We use unitless values for stroke-dasharray and stroke-dashoffset + * because Safari incorrectly scales px values when the page is zoomed. + */ +function buildSVGPath(attrs, length, spacing = 1, offset = 0, useDashCase = true) { + // Normalise path length by setting SVG attribute pathLength to 1 + attrs.pathLength = 1; + // We use dash case when setting attributes directly to the DOM node and camel case + // when defining props on a React component. + const keys = useDashCase ? dashKeys : camelKeys; + // Build the dash offset (unitless to avoid Safari zoom bug) + attrs[keys.offset] = `${-offset}`; + // Build the dash array (unitless to avoid Safari zoom bug) + attrs[keys.array] = `${length} ${spacing}`; +} + +const cssStyleProperties = [ + "transform", + "opacity", + "offsetDistance", + "offsetPath", + "offsetRotate", + "offsetAnchor", +]; +/** + * Build SVG visual attributes, like cx and style.transform + */ +function buildSVGAttrs(state, { attrX, attrY, attrScale, pathLength, pathSpacing = 1, pathOffset = 0, +// This is object creation, which we try to avoid per-frame. +...latest }, isSVGTag, transformTemplate, styleProp) { + buildHTMLStyles(state, latest, transformTemplate); + /** + * For svg tags we just want to make sure viewBox is animatable and treat all the styles + * as normal HTML tags. + */ + if (isSVGTag) { + if (state.style.viewBox) { + state.attrs.viewBox = state.style.viewBox; + } + return; + } + state.attrs = state.style; + state.style = {}; + const { attrs, style } = state; + for (const key of cssStyleProperties) { + if (attrs[key] !== undefined) { + style[key] = attrs[key]; + delete attrs[key]; + } + } + if (style.transform || attrs.transformOrigin) { + style.transformOrigin = attrs.transformOrigin ?? "50% 50%"; + delete attrs.transformOrigin; + } + if (style.transform) { + /** + * SVG's element transform-origin uses its own median as a reference. + * Therefore, transformBox becomes a fill-box + */ + style.transformBox = styleProp?.transformBox ?? "fill-box"; + delete attrs.transformBox; + } + // Render attrX/attrY/attrScale as attributes + if (attrX !== undefined) + attrs.x = attrX; + if (attrY !== undefined) + attrs.y = attrY; + if (attrScale !== undefined) + attrs.scale = attrScale; + // Build SVG path if one has been defined + if (pathLength !== undefined) { + buildSVGPath(attrs, pathLength, pathSpacing, pathOffset, false); + } +} + +/** + * A set of attribute names that are always read/written as camel case. + */ +const camelCaseAttributes = new Set([ + "baseFrequency", + "diffuseConstant", + "kernelMatrix", + "kernelUnitLength", + "keySplines", + "keyTimes", + "limitingConeAngle", + "markerHeight", + "markerWidth", + "numOctaves", + "targetX", + "targetY", + "surfaceScale", + "specularConstant", + "specularExponent", + "stdDeviation", + "tableValues", + "viewBox", + "gradientTransform", + "pathLength", + "startOffset", + "textLength", + "lengthAdjust", +]); + +const isSVGTag = (tag) => typeof tag === "string" && tag.toLowerCase() === "svg"; + +function renderSVG(element, renderState, _styleProp, projection) { + renderHTML(element, renderState, undefined, projection); + for (const key in renderState.attrs) { + element.setAttribute(!camelCaseAttributes.has(key) ? camelToDash(key) : key, renderState.attrs[key]); + } +} + +function scrapeMotionValuesFromProps(props, prevProps, visualElement) { + const newValues = scrapeMotionValuesFromProps$1(props, prevProps, visualElement); + for (const key in props) { + if (isMotionValue(props[key]) || + isMotionValue(prevProps[key])) { + const targetKey = transformPropOrder.indexOf(key) !== -1 + ? "attr" + key.charAt(0).toUpperCase() + key.substring(1) + : key; + newValues[targetKey] = props[key]; + } + } + return newValues; +} + +class SVGVisualElement extends DOMVisualElement { + constructor() { + super(...arguments); + this.type = "svg"; + this.isSVGTag = false; + this.measureInstanceViewportBox = createBox; + } + getBaseTargetFromProps(props, key) { + return props[key]; + } + readValueFromInstance(instance, key) { + if (transformProps.has(key)) { + const defaultType = getDefaultValueType(key); + return defaultType ? defaultType.default || 0 : 0; + } + if (cssStyleProperties.includes(key)) { + const computedStyle = getComputedStyle(instance); + const value = computedStyle[key]; + if (typeof value === "string" && value) + return value.trim(); + } + key = !camelCaseAttributes.has(key) ? camelToDash(key) : key; + return instance.getAttribute(key); + } + scrapeMotionValuesFromProps(props, prevProps, visualElement) { + return scrapeMotionValuesFromProps(props, prevProps, visualElement); + } + build(renderState, latestValues, props) { + buildSVGAttrs(renderState, latestValues, this.isSVGTag, props.transformTemplate, props.style); + } + renderInstance(instance, renderState, styleProp, projection) { + renderSVG(instance, renderState, styleProp, projection); + } + mount(instance) { + this.isSVGTag = isSVGTag(instance.tagName); + super.mount(instance); + } +} + +const numVariantProps = variantProps.length; +/** + * Get variant context from a visual element's parent chain. + * Uses `any` type for visualElement to avoid circular dependencies. + */ +function getVariantContext(visualElement) { + if (!visualElement) + return undefined; + if (!visualElement.isControllingVariants) { + const context = visualElement.parent + ? getVariantContext(visualElement.parent) || {} + : {}; + if (visualElement.props.initial !== undefined) { + context.initial = visualElement.props.initial; + } + return context; + } + const context = {}; + for (let i = 0; i < numVariantProps; i++) { + const name = variantProps[i]; + const prop = visualElement.props[name]; + if (isVariantLabel(prop) || prop === false) { + context[name] = prop; + } + } + return context; +} + +function shallowCompare(next, prev) { + if (!Array.isArray(prev)) + return false; + const prevLength = prev.length; + if (prevLength !== next.length) + return false; + for (let i = 0; i < prevLength; i++) { + if (prev[i] !== next[i]) + return false; + } + return true; +} + +const reversePriorityOrder = [...variantPriorityOrder].reverse(); +const numAnimationTypes = variantPriorityOrder.length; +function createAnimateFunction(visualElement) { + return (animations) => { + return Promise.all(animations.map(({ animation, options }) => animateVisualElement(visualElement, animation, options))); + }; +} +function createAnimationState(visualElement) { + let animate = createAnimateFunction(visualElement); + let state = createState(); + let isInitialRender = true; + /** + * Track whether the animation state has been reset (e.g. via StrictMode + * double-invocation or Suspense unmount/remount). On the first + * animateChanges() call after a reset we need to behave like the initial + * render for variant-inheritance checks, even though isInitialRender is + * already false. + */ + let wasReset = false; + /** + * This function will be used to reduce the animation definitions for + * each active animation type into an object of resolved values for it. + */ + const buildResolvedTypeValues = (type) => (acc, definition) => { + const resolved = resolveVariant(visualElement, definition, type === "exit" + ? visualElement.presenceContext?.custom + : undefined); + if (resolved) { + const { transition, transitionEnd, ...target } = resolved; + acc = { ...acc, ...target, ...transitionEnd }; + } + return acc; + }; + /** + * This just allows us to inject mocked animation functions + * @internal + */ + function setAnimateFunction(makeAnimator) { + animate = makeAnimator(visualElement); + } + /** + * When we receive new props, we need to: + * 1. Create a list of protected keys for each type. This is a directory of + * value keys that are currently being "handled" by types of a higher priority + * so that whenever an animation is played of a given type, these values are + * protected from being animated. + * 2. Determine if an animation type needs animating. + * 3. Determine if any values have been removed from a type and figure out + * what to animate those to. + */ + function animateChanges(changedActiveType) { + const { props } = visualElement; + const context = getVariantContext(visualElement.parent) || {}; + /** + * A list of animations that we'll build into as we iterate through the animation + * types. This will get executed at the end of the function. + */ + const animations = []; + /** + * Keep track of which values have been removed. Then, as we hit lower priority + * animation types, we can check if they contain removed values and animate to that. + */ + const removedKeys = new Set(); + /** + * A dictionary of all encountered keys. This is an object to let us build into and + * copy it without iteration. Each time we hit an animation type we set its protected + * keys - the keys its not allowed to animate - to the latest version of this object. + */ + let encounteredKeys = {}; + /** + * If a variant has been removed at a given index, and this component is controlling + * variant animations, we want to ensure lower-priority variants are forced to animate. + */ + let removedVariantIndex = Infinity; + /** + * Iterate through all animation types in reverse priority order. For each, we want to + * detect which values it's handling and whether or not they've changed (and therefore + * need to be animated). If any values have been removed, we want to detect those in + * lower priority props and flag for animation. + */ + for (let i = 0; i < numAnimationTypes; i++) { + const type = reversePriorityOrder[i]; + const typeState = state[type]; + const prop = props[type] !== undefined + ? props[type] + : context[type]; + const propIsVariant = isVariantLabel(prop); + /** + * If this type has *just* changed isActive status, set activeDelta + * to that status. Otherwise set to null. + */ + const activeDelta = type === changedActiveType ? typeState.isActive : null; + if (activeDelta === false) + removedVariantIndex = i; + /** + * If this prop is an inherited variant, rather than been set directly on the + * component itself, we want to make sure we allow the parent to trigger animations. + * + * TODO: Can probably change this to a !isControllingVariants check + */ + let isInherited = prop === context[type] && + prop !== props[type] && + propIsVariant; + if (isInherited && + (isInitialRender || wasReset) && + visualElement.manuallyAnimateOnMount) { + isInherited = false; + } + /** + * Set all encountered keys so far as the protected keys for this type. This will + * be any key that has been animated or otherwise handled by active, higher-priortiy types. + */ + typeState.protectedKeys = { ...encounteredKeys }; + // Check if we can skip analysing this prop early + if ( + // If it isn't active and hasn't *just* been set as inactive + (!typeState.isActive && activeDelta === null) || + // If we didn't and don't have any defined prop for this animation type + (!prop && !typeState.prevProp) || + // Or if the prop doesn't define an animation + isAnimationControls(prop) || + typeof prop === "boolean") { + continue; + } + /** + * If exit is already active and wasn't just activated, skip + * re-processing to prevent interrupting running exit animations. + * Re-resolving exit with a changed custom value can start new + * value animations that stop the originals, leaving the exit + * animation promise unresolved and the component stuck in the DOM. + */ + if (type === "exit" && typeState.isActive && activeDelta !== true) { + if (typeState.prevResolvedValues) { + encounteredKeys = { + ...encounteredKeys, + ...typeState.prevResolvedValues, + }; + } + continue; + } + /** + * As we go look through the values defined on this type, if we detect + * a changed value or a value that was removed in a higher priority, we set + * this to true and add this prop to the animation list. + */ + const variantDidChange = checkVariantsDidChange(typeState.prevProp, prop); + let shouldAnimateType = variantDidChange || + // If we're making this variant active, we want to always make it active + (type === changedActiveType && + typeState.isActive && + !isInherited && + propIsVariant) || + // If we removed a higher-priority variant (i is in reverse order) + (i > removedVariantIndex && propIsVariant); + let handledRemovedValues = false; + /** + * As animations can be set as variant lists, variants or target objects, we + * coerce everything to an array if it isn't one already + */ + const definitionList = Array.isArray(prop) ? prop : [prop]; + /** + * Build an object of all the resolved values. We'll use this in the subsequent + * animateChanges calls to determine whether a value has changed. + */ + let resolvedValues = definitionList.reduce(buildResolvedTypeValues(type), {}); + if (activeDelta === false) + resolvedValues = {}; + /** + * Now we need to loop through all the keys in the prev prop and this prop, + * and decide: + * 1. If the value has changed, and needs animating + * 2. If it has been removed, and needs adding to the removedKeys set + * 3. If it has been removed in a higher priority type and needs animating + * 4. If it hasn't been removed in a higher priority but hasn't changed, and + * needs adding to the type's protectedKeys list. + */ + const { prevResolvedValues = {} } = typeState; + const allKeys = { + ...prevResolvedValues, + ...resolvedValues, + }; + const markToAnimate = (key) => { + shouldAnimateType = true; + if (removedKeys.has(key)) { + handledRemovedValues = true; + removedKeys.delete(key); + } + typeState.needsAnimating[key] = true; + const motionValue = visualElement.getValue(key); + if (motionValue) + motionValue.liveStyle = false; + }; + for (const key in allKeys) { + const next = resolvedValues[key]; + const prev = prevResolvedValues[key]; + // If we've already handled this we can just skip ahead + if (encounteredKeys.hasOwnProperty(key)) + continue; + /** + * If the value has changed, we probably want to animate it. + */ + let valueHasChanged = false; + if (isKeyframesTarget(next) && isKeyframesTarget(prev)) { + valueHasChanged = + !shallowCompare(next, prev) || variantDidChange; + } + else { + valueHasChanged = next !== prev; + } + if (valueHasChanged) { + if (next !== undefined && next !== null) { + // If next is defined and doesn't equal prev, it needs animating + markToAnimate(key); + } + else { + // If it's undefined, it's been removed. + removedKeys.add(key); + } + } + else if (next !== undefined && removedKeys.has(key)) { + /** + * If next hasn't changed and it isn't undefined, we want to check if it's + * been removed by a higher priority + */ + markToAnimate(key); + } + else { + /** + * If it hasn't changed, we add it to the list of protected values + * to ensure it doesn't get animated. + */ + typeState.protectedKeys[key] = true; + } + } + /** + * Update the typeState so next time animateChanges is called we can compare the + * latest prop and resolvedValues to these. + */ + typeState.prevProp = prop; + typeState.prevResolvedValues = resolvedValues; + if (typeState.isActive) { + encounteredKeys = { ...encounteredKeys, ...resolvedValues }; + } + if ((isInitialRender || wasReset) && + visualElement.blockInitialAnimation) { + shouldAnimateType = false; + } + /** + * If this is an inherited prop we want to skip this animation + * unless the inherited variants haven't changed on this render. + */ + const willAnimateViaParent = isInherited && variantDidChange; + const needsAnimating = !willAnimateViaParent || handledRemovedValues; + if (shouldAnimateType && needsAnimating) { + animations.push(...definitionList.map((animation) => { + const options = { type }; + /** + * If we're performing the initial animation, but we're not + * rendering at the same time as the variant-controlling parent, + * we want to use the parent's transition to calculate the stagger. + */ + if (typeof animation === "string" && + (isInitialRender || wasReset) && + !willAnimateViaParent && + visualElement.manuallyAnimateOnMount && + visualElement.parent) { + const { parent } = visualElement; + const parentVariant = resolveVariant(parent, animation); + if (parent.enteringChildren && parentVariant) { + const { delayChildren } = parentVariant.transition || {}; + options.delay = calcChildStagger(parent.enteringChildren, visualElement, delayChildren); + } + } + return { + animation: animation, + options, + }; + })); + } + } + /** + * If there are some removed value that haven't been dealt with, + * we need to create a new animation that falls back either to the value + * defined in the style prop, or the last read value. + */ + if (removedKeys.size) { + const fallbackAnimation = {}; + /** + * If the initial prop contains a transition we can use that, otherwise + * allow the animation function to use the visual element's default. + */ + if (typeof props.initial !== "boolean") { + const initialTransition = resolveVariant(visualElement, Array.isArray(props.initial) + ? props.initial[0] + : props.initial); + if (initialTransition && initialTransition.transition) { + fallbackAnimation.transition = initialTransition.transition; + } + } + removedKeys.forEach((key) => { + const fallbackTarget = visualElement.getBaseTarget(key); + const motionValue = visualElement.getValue(key); + if (motionValue) + motionValue.liveStyle = true; + // @ts-expect-error - @mattgperry to figure if we should do something here + fallbackAnimation[key] = fallbackTarget ?? null; + }); + animations.push({ animation: fallbackAnimation }); + } + let shouldAnimate = Boolean(animations.length); + if (isInitialRender && + (props.initial === false || props.initial === props.animate) && + !visualElement.manuallyAnimateOnMount) { + shouldAnimate = false; + } + isInitialRender = false; + wasReset = false; + return shouldAnimate ? animate(animations) : Promise.resolve(); + } + /** + * Change whether a certain animation type is active. + */ + function setActive(type, isActive) { + // If the active state hasn't changed, we can safely do nothing here + if (state[type].isActive === isActive) + return Promise.resolve(); + // Propagate active change to children + visualElement.variantChildren?.forEach((child) => child.animationState?.setActive(type, isActive)); + state[type].isActive = isActive; + const animations = animateChanges(type); + for (const key in state) { + state[key].protectedKeys = {}; + } + return animations; + } + return { + animateChanges, + setActive, + setAnimateFunction, + getState: () => state, + reset: () => { + state = createState(); + wasReset = true; + }, + }; +} +function checkVariantsDidChange(prev, next) { + if (typeof next === "string") { + return next !== prev; + } + else if (Array.isArray(next)) { + return !shallowCompare(next, prev); + } + return false; +} +function createTypeState(isActive = false) { + return { + isActive, + protectedKeys: {}, + needsAnimating: {}, + prevResolvedValues: {}, + }; +} +function createState() { + return { + animate: createTypeState(true), + whileInView: createTypeState(), + whileHover: createTypeState(), + whileTap: createTypeState(), + whileDrag: createTypeState(), + whileFocus: createTypeState(), + exit: createTypeState(), + }; +} + +/** + * Reset an axis to the provided origin box. + * + * This is a mutative operation. + */ +function copyAxisInto(axis, originAxis) { + axis.min = originAxis.min; + axis.max = originAxis.max; +} +/** + * Reset a box to the provided origin box. + * + * This is a mutative operation. + */ +function copyBoxInto(box, originBox) { + copyAxisInto(box.x, originBox.x); + copyAxisInto(box.y, originBox.y); +} +/** + * Reset a delta to the provided origin box. + * + * This is a mutative operation. + */ +function copyAxisDeltaInto(delta, originDelta) { + delta.translate = originDelta.translate; + delta.scale = originDelta.scale; + delta.originPoint = originDelta.originPoint; + delta.origin = originDelta.origin; +} + +const SCALE_PRECISION = 0.0001; +const SCALE_MIN = 1 - SCALE_PRECISION; +const SCALE_MAX = 1 + SCALE_PRECISION; +const TRANSLATE_PRECISION = 0.01; +const TRANSLATE_MIN = 0 - TRANSLATE_PRECISION; +const TRANSLATE_MAX = 0 + TRANSLATE_PRECISION; +function calcLength(axis) { + return axis.max - axis.min; +} +function isNear(value, target, maxDistance) { + return Math.abs(value - target) <= maxDistance; +} +function calcAxisDelta(delta, source, target, origin = 0.5) { + delta.origin = origin; + delta.originPoint = mixNumber$1(source.min, source.max, delta.origin); + delta.scale = calcLength(target) / calcLength(source); + delta.translate = + mixNumber$1(target.min, target.max, delta.origin) - delta.originPoint; + if ((delta.scale >= SCALE_MIN && delta.scale <= SCALE_MAX) || + isNaN(delta.scale)) { + delta.scale = 1.0; + } + if ((delta.translate >= TRANSLATE_MIN && + delta.translate <= TRANSLATE_MAX) || + isNaN(delta.translate)) { + delta.translate = 0.0; + } +} +function calcBoxDelta(delta, source, target, origin) { + calcAxisDelta(delta.x, source.x, target.x, origin ? origin.originX : undefined); + calcAxisDelta(delta.y, source.y, target.y, origin ? origin.originY : undefined); +} +function calcRelativeAxis(target, relative, parent, anchor = 0) { + const anchorPoint = anchor + ? mixNumber$1(parent.min, parent.max, anchor) + : parent.min; + target.min = anchorPoint + relative.min; + target.max = target.min + calcLength(relative); +} +function calcRelativeBox(target, relative, parent, anchor) { + calcRelativeAxis(target.x, relative.x, parent.x, anchor?.x); + calcRelativeAxis(target.y, relative.y, parent.y, anchor?.y); +} +function calcRelativeAxisPosition(target, layout, parent, anchor = 0) { + const anchorPoint = anchor + ? mixNumber$1(parent.min, parent.max, anchor) + : parent.min; + target.min = layout.min - anchorPoint; + target.max = target.min + calcLength(layout); +} +function calcRelativePosition(target, layout, parent, anchor) { + calcRelativeAxisPosition(target.x, layout.x, parent.x, anchor?.x); + calcRelativeAxisPosition(target.y, layout.y, parent.y, anchor?.y); +} + +/** + * Remove a delta from a point. This is essentially the steps of applyPointDelta in reverse + */ +function removePointDelta(point, translate, scale, originPoint, boxScale) { + point -= translate; + point = scalePoint(point, 1 / scale, originPoint); + if (boxScale !== undefined) { + point = scalePoint(point, 1 / boxScale, originPoint); + } + return point; +} +/** + * Remove a delta from an axis. This is essentially the steps of applyAxisDelta in reverse + */ +function removeAxisDelta(axis, translate = 0, scale = 1, origin = 0.5, boxScale, originAxis = axis, sourceAxis = axis) { + if (percent.test(translate)) { + translate = parseFloat(translate); + const relativeProgress = mixNumber$1(sourceAxis.min, sourceAxis.max, translate / 100); + translate = relativeProgress - sourceAxis.min; + } + if (typeof translate !== "number") + return; + let originPoint = mixNumber$1(originAxis.min, originAxis.max, origin); + if (axis === originAxis) + originPoint -= translate; + axis.min = removePointDelta(axis.min, translate, scale, originPoint, boxScale); + axis.max = removePointDelta(axis.max, translate, scale, originPoint, boxScale); +} +/** + * Remove a transforms from an axis. This is essentially the steps of applyAxisTransforms in reverse + * and acts as a bridge between motion values and removeAxisDelta + */ +function removeAxisTransforms(axis, transforms, [key, scaleKey, originKey], origin, sourceAxis) { + removeAxisDelta(axis, transforms[key], transforms[scaleKey], transforms[originKey], transforms.scale, origin, sourceAxis); +} +/** + * The names of the motion values we want to apply as translation, scale and origin. + */ +const xKeys = ["x", "scaleX", "originX"]; +const yKeys = ["y", "scaleY", "originY"]; +/** + * Remove a transforms from an box. This is essentially the steps of applyAxisBox in reverse + * and acts as a bridge between motion values and removeAxisDelta + */ +function removeBoxTransforms(box, transforms, originBox, sourceBox) { + removeAxisTransforms(box.x, transforms, xKeys, originBox ? originBox.x : undefined, sourceBox ? sourceBox.x : undefined); + removeAxisTransforms(box.y, transforms, yKeys, originBox ? originBox.y : undefined, sourceBox ? sourceBox.y : undefined); +} + +function isAxisDeltaZero(delta) { + return delta.translate === 0 && delta.scale === 1; +} +function isDeltaZero(delta) { + return isAxisDeltaZero(delta.x) && isAxisDeltaZero(delta.y); +} +function axisEquals(a, b) { + return a.min === b.min && a.max === b.max; +} +function boxEquals(a, b) { + return axisEquals(a.x, b.x) && axisEquals(a.y, b.y); +} +function axisEqualsRounded(a, b) { + return (Math.round(a.min) === Math.round(b.min) && + Math.round(a.max) === Math.round(b.max)); +} +function boxEqualsRounded(a, b) { + return axisEqualsRounded(a.x, b.x) && axisEqualsRounded(a.y, b.y); +} +function aspectRatio(box) { + return calcLength(box.x) / calcLength(box.y); +} +function axisDeltaEquals(a, b) { + return (a.translate === b.translate && + a.scale === b.scale && + a.originPoint === b.originPoint); +} + +function eachAxis(callback) { + return [callback("x"), callback("y")]; +} + +function buildProjectionTransform(delta, treeScale, latestTransform) { + let transform = ""; + /** + * The translations we use to calculate are always relative to the viewport coordinate space. + * But when we apply scales, we also scale the coordinate space of an element and its children. + * For instance if we have a treeScale (the culmination of all parent scales) of 0.5 and we need + * to move an element 100 pixels, we actually need to move it 200 in within that scaled space. + */ + const xTranslate = delta.x.translate / treeScale.x; + const yTranslate = delta.y.translate / treeScale.y; + const zTranslate = latestTransform?.z || 0; + if (xTranslate || yTranslate || zTranslate) { + transform = `translate3d(${xTranslate}px, ${yTranslate}px, ${zTranslate}px) `; + } + /** + * Apply scale correction for the tree transform. + * This will apply scale to the screen-orientated axes. + */ + if (treeScale.x !== 1 || treeScale.y !== 1) { + transform += `scale(${1 / treeScale.x}, ${1 / treeScale.y}) `; + } + if (latestTransform) { + const { transformPerspective, rotate, pathRotation, rotateX, rotateY, skewX, skewY, } = latestTransform; + if (transformPerspective) + transform = `perspective(${transformPerspective}px) ${transform}`; + if (rotate) + transform += `rotate(${rotate}deg) `; + // Additive `rotate()` so user `rotate` isn't clobbered. + if (pathRotation) + transform += `rotate(${pathRotation}deg) `; + if (rotateX) + transform += `rotateX(${rotateX}deg) `; + if (rotateY) + transform += `rotateY(${rotateY}deg) `; + if (skewX) + transform += `skewX(${skewX}deg) `; + if (skewY) + transform += `skewY(${skewY}deg) `; + } + /** + * Apply scale to match the size of the element to the size we want it. + * This will apply scale to the element-orientated axes. + */ + const elementScaleX = delta.x.scale * treeScale.x; + const elementScaleY = delta.y.scale * treeScale.y; + if (elementScaleX !== 1 || elementScaleY !== 1) { + transform += `scale(${elementScaleX}, ${elementScaleY})`; + } + return transform || "none"; +} + +const numBorders = cornerRadiusProps.length; +const asNumber = (value) => typeof value === "string" ? parseFloat(value) : value; +const isPx = (value) => typeof value === "number" || px.test(value); +function mixValues(target, follow, lead, progress, shouldCrossfadeOpacity, isOnlyMember) { + if (shouldCrossfadeOpacity) { + target.opacity = mixNumber$1(0, lead.opacity ?? 1, easeCrossfadeIn(progress)); + target.opacityExit = mixNumber$1(follow.opacity ?? 1, 0, easeCrossfadeOut(progress)); + } + else if (isOnlyMember) { + target.opacity = mixNumber$1(follow.opacity ?? 1, lead.opacity ?? 1, progress); + } + /** + * Mix border radius + */ + for (let i = 0; i < numBorders; i++) { + const borderLabel = cornerRadiusProps[i]; + let followRadius = getRadius(follow, borderLabel); + let leadRadius = getRadius(lead, borderLabel); + if (followRadius === undefined && leadRadius === undefined) + continue; + followRadius || (followRadius = 0); + leadRadius || (leadRadius = 0); + const canMix = followRadius === 0 || + leadRadius === 0 || + isPx(followRadius) === isPx(leadRadius); + if (canMix) { + target[borderLabel] = Math.max(mixNumber$1(asNumber(followRadius), asNumber(leadRadius), progress), 0); + if (percent.test(leadRadius) || percent.test(followRadius)) { + target[borderLabel] += "%"; + } + } + else { + target[borderLabel] = leadRadius; + } + } + /** + * Mix rotation + */ + if (follow.rotate || lead.rotate) { + target.rotate = mixNumber$1(follow.rotate || 0, lead.rotate || 0, progress); + } +} +function getRadius(values, radiusName) { + return values[radiusName] !== undefined + ? values[radiusName] + : values.borderRadius; +} +const easeCrossfadeIn = /*@__PURE__*/ compress(0, 0.5, motionUtils.circOut); +const easeCrossfadeOut = /*@__PURE__*/ compress(0.5, 0.95, motionUtils.noop); +function compress(min, max, easing) { + return (p) => { + // Could replace ifs with clamp + if (p < min) + return 0; + if (p > max) + return 1; + return easing(motionUtils.progress(min, max, p)); + }; +} + +function animateSingleValue(value, keyframes, options) { + const motionValue$1 = isMotionValue(value) ? value : motionValue(value); + motionValue$1.start(animateMotionValue("", motionValue$1, keyframes, options)); + return motionValue$1.animation; +} + +function addDomEvent(target, eventName, handler, options = { passive: true }) { + target.addEventListener(eventName, handler, options); + return () => target.removeEventListener(eventName, handler, options); +} + +const compareByDepth = (a, b) => a.depth - b.depth; + +class FlatTree { + constructor() { + this.children = []; + this.isDirty = false; + } + add(child) { + motionUtils.addUniqueItem(this.children, child); + this.isDirty = true; + } + remove(child) { + motionUtils.removeItem(this.children, child); + this.isDirty = true; + } + forEach(callback) { + this.isDirty && this.children.sort(compareByDepth); + this.isDirty = false; + this.children.forEach(callback); + } +} + +/** + * Timeout defined in ms + */ +function delay(callback, timeout) { + const start = time.now(); + const checkElapsed = ({ timestamp }) => { + const elapsed = timestamp - start; + if (elapsed >= timeout) { + cancelFrame(checkElapsed); + callback(elapsed - timeout); + } + }; + frame.setup(checkElapsed, true); + return () => cancelFrame(checkElapsed); +} +function delayInSeconds(callback, timeout) { + return delay(callback, motionUtils.secondsToMilliseconds(timeout)); +} + +/** + * If the provided value is a MotionValue, this returns the actual value, otherwise just the value itself + */ +function resolveMotionValue(value) { + return isMotionValue(value) ? value.get() : value; +} + +class NodeStack { + constructor() { + this.members = []; + } + add(node) { + motionUtils.addUniqueItem(this.members, node); + for (let i = this.members.length - 1; i >= 0; i--) { + const member = this.members[i]; + if (member === node || member === this.lead || member === this.prevLead) + continue; + const inst = member.instance; + if ((!inst || inst.isConnected === false) && !member.snapshot) { + motionUtils.removeItem(this.members, member); + member.unmount(); + } + } + node.scheduleRender(); + } + remove(node) { + motionUtils.removeItem(this.members, node); + if (node === this.prevLead) + this.prevLead = undefined; + if (node === this.lead) { + const prevLead = this.members[this.members.length - 1]; + if (prevLead) + this.promote(prevLead); + } + } + relegate(node) { + for (let i = this.members.indexOf(node) - 1; i >= 0; i--) { + const member = this.members[i]; + if (member.isPresent !== false && member.instance?.isConnected !== false) { + this.promote(member); + return true; + } + } + return false; + } + promote(node, preserveFollowOpacity) { + const prevLead = this.lead; + if (node === prevLead) + return; + this.prevLead = prevLead; + this.lead = node; + node.show(); + if (prevLead) { + prevLead.updateSnapshot(); + node.scheduleRender(); + const { layoutDependency: prevDep } = prevLead.options; + const { layoutDependency: nextDep } = node.options; + if (prevDep === undefined || prevDep !== nextDep) { + node.resumeFrom = prevLead; + if (preserveFollowOpacity) + prevLead.preserveOpacity = true; + if (prevLead.snapshot) { + node.snapshot = prevLead.snapshot; + node.snapshot.latestValues = + prevLead.animationValues || prevLead.latestValues; + } + if (node.root?.isUpdating) + node.isLayoutDirty = true; + } + if (node.options.crossfade === false) + prevLead.hide(); + } + } + exitAnimationComplete() { + this.members.forEach((member) => { + member.options.onExitComplete?.(); + member.resumingFrom?.options.onExitComplete?.(); + }); + } + scheduleRender() { + this.members.forEach((member) => member.instance && member.scheduleRender(false)); + } + removeLeadSnapshot() { + if (this.lead?.snapshot) + this.lead.snapshot = undefined; + } +} + +/** + * This should only ever be modified on the client otherwise it'll + * persist through server requests. If we need instanced states we + * could lazy-init via root. + */ +const globalProjectionState = { + /** + * Global flag as to whether the tree has animated since the last time + * we resized the window + */ + hasAnimatedSinceResize: true, + /** + * We set this to true once, on the first update. Any nodes added to the tree beyond that + * update will be given a `data-projection-id` attribute. + */ + hasEverUpdated: false, +}; + +const metrics = { + nodes: 0, + calculatedTargetDeltas: 0, + calculatedProjections: 0, +}; +const transformAxes = ["", "X", "Y", "Z"]; +/** + * We use 1000 as the animation target as 0-1000 maps better to pixels than 0-1 + * which has a noticeable difference in spring animations + */ +const animationTarget = 1000; +let id = 0; +function resetDistortingTransform(key, visualElement, values, sharedAnimationValues) { + const { latestValues } = visualElement; + // Record the distorting transform and then temporarily set it to 0 + if (latestValues[key]) { + values[key] = latestValues[key]; + visualElement.setStaticValue(key, 0); + if (sharedAnimationValues) { + sharedAnimationValues[key] = 0; + } + } +} +function cancelTreeOptimisedTransformAnimations(projectionNode) { + projectionNode.hasCheckedOptimisedAppear = true; + if (projectionNode.root === projectionNode) + return; + const { visualElement } = projectionNode.options; + if (!visualElement) + return; + const appearId = getOptimisedAppearId(visualElement); + if (window.MotionHasOptimisedAnimation(appearId, "transform")) { + const { layout, layoutId } = projectionNode.options; + window.MotionCancelOptimisedAnimation(appearId, "transform", frame, !(layout || layoutId)); + } + const { parent } = projectionNode; + if (parent && !parent.hasCheckedOptimisedAppear) { + cancelTreeOptimisedTransformAnimations(parent); + } +} +function createProjectionNode({ attachResizeListener, defaultParent, measureScroll, checkIsScrollRoot, resetTransform, }) { + return class ProjectionNode { + constructor(latestValues = {}, parent = defaultParent?.()) { + /** + * A unique ID generated for every projection node. + */ + this.id = id++; + /** + * An id that represents a unique session instigated by startUpdate. + */ + this.animationId = 0; + this.animationCommitId = 0; + /** + * A Set containing all this component's children. This is used to iterate + * through the children. + * + * TODO: This could be faster to iterate as a flat array stored on the root node. + */ + this.children = new Set(); + /** + * Options for the node. We use this to configure what kind of layout animations + * we should perform (if any). + */ + this.options = {}; + /** + * We use this to detect when its safe to shut down part of a projection tree. + * We have to keep projecting children for scale correction and relative projection + * until all their parents stop performing layout animations. + */ + this.isTreeAnimating = false; + this.isAnimationBlocked = false; + /** + * Flag to true if we think this layout has been changed. We can't always know this, + * currently we set it to true every time a component renders, or if it has a layoutDependency + * if that has changed between renders. Additionally, components can be grouped by LayoutGroup + * and if one node is dirtied, they all are. + */ + this.isLayoutDirty = false; + /** + * Flag to true if we think the projection calculations for this node needs + * recalculating as a result of an updated transform or layout animation. + */ + this.isProjectionDirty = false; + /** + * Flag to true if the layout *or* transform has changed. This then gets propagated + * throughout the projection tree, forcing any element below to recalculate on the next frame. + */ + this.isSharedProjectionDirty = false; + /** + * Flag transform dirty. This gets propagated throughout the whole tree but is only + * respected by shared nodes. + */ + this.isTransformDirty = false; + /** + * Block layout updates for instant layout transitions throughout the tree. + */ + this.updateManuallyBlocked = false; + this.updateBlockedByResize = false; + /** + * Set to true between the start of the first `willUpdate` call and the end of the `didUpdate` + * call. + */ + this.isUpdating = false; + /** + * If this is an SVG element we currently disable projection transforms + */ + this.isSVG = false; + /** + * Flag to true (during promotion) if a node doing an instant layout transition needs to reset + * its projection styles. + */ + this.needsReset = false; + /** + * Flags whether this node should have its transform reset prior to measuring. + */ + this.shouldResetTransform = false; + /** + * Store whether this node has been checked for optimised appear animations. As + * effects fire bottom-up, and we want to look up the tree for appear animations, + * this makes sure we only check each path once, stopping at nodes that + * have already been checked. + */ + this.hasCheckedOptimisedAppear = false; + /** + * An object representing the calculated contextual/accumulated/tree scale. + * This will be used to scale calculcated projection transforms, as these are + * calculated in screen-space but need to be scaled for elements to layoutly + * make it to their calculated destinations. + * + * TODO: Lazy-init + */ + this.treeScale = { x: 1, y: 1 }; + /** + * + */ + this.eventHandlers = new Map(); + this.hasTreeAnimated = false; + this.layoutVersion = 0; + // Note: Currently only running on root node + this.updateScheduled = false; + this.scheduleUpdate = () => this.update(); + this.projectionUpdateScheduled = false; + this.checkUpdateFailed = () => { + if (this.isUpdating) { + this.isUpdating = false; + this.clearAllSnapshots(); + } + }; + /** + * This is a multi-step process as shared nodes might be of different depths. Nodes + * are sorted by depth order, so we need to resolve the entire tree before moving to + * the next step. + */ + this.updateProjection = () => { + this.projectionUpdateScheduled = false; + /** + * Reset debug counts. Manually resetting rather than creating a new + * object each frame. + */ + if (statsBuffer.value) { + metrics.nodes = + metrics.calculatedTargetDeltas = + metrics.calculatedProjections = + 0; + } + this.nodes.forEach(propagateDirtyNodes); + this.nodes.forEach(resolveTargetDelta); + this.nodes.forEach(calcProjection); + this.nodes.forEach(cleanDirtyNodes); + if (statsBuffer.addProjectionMetrics) { + statsBuffer.addProjectionMetrics(metrics); + } + }; + /** + * Frame calculations + */ + this.resolvedRelativeTargetAt = 0.0; + this.linkedParentVersion = 0; + this.hasProjected = false; + this.isVisible = true; + this.animationProgress = 0; + /** + * Shared layout + */ + // TODO Only running on root node + this.sharedNodes = new Map(); + this.latestValues = latestValues; + this.root = parent ? parent.root || parent : this; + this.path = parent ? [...parent.path, parent] : []; + this.parent = parent; + this.depth = parent ? parent.depth + 1 : 0; + for (let i = 0; i < this.path.length; i++) { + this.path[i].shouldResetTransform = true; + } + if (this.root === this) + this.nodes = new FlatTree(); + } + addEventListener(name, handler) { + if (!this.eventHandlers.has(name)) { + this.eventHandlers.set(name, new motionUtils.SubscriptionManager()); + } + return this.eventHandlers.get(name).add(handler); + } + notifyListeners(name, ...args) { + const subscriptionManager = this.eventHandlers.get(name); + subscriptionManager && subscriptionManager.notify(...args); + } + hasListeners(name) { + return this.eventHandlers.has(name); + } + /** + * Lifecycles + */ + mount(instance) { + if (this.instance) + return; + this.isSVG = isSVGElement(instance) && !isSVGSVGElement(instance); + this.instance = instance; + const { layoutId, layout, visualElement } = this.options; + if (visualElement && !visualElement.current) { + visualElement.mount(instance); + } + this.root.nodes.add(this); + this.parent && this.parent.children.add(this); + if (this.root.hasTreeAnimated && (layout || layoutId)) { + this.isLayoutDirty = true; + } + if (attachResizeListener) { + let cancelDelay; + let innerWidth = 0; + const resizeUnblockUpdate = () => (this.root.updateBlockedByResize = false); + // Set initial innerWidth in a frame.read callback to batch the read + frame.read(() => { + innerWidth = window.innerWidth; + }); + attachResizeListener(instance, () => { + const newInnerWidth = window.innerWidth; + if (newInnerWidth === innerWidth) + return; + innerWidth = newInnerWidth; + this.root.updateBlockedByResize = true; + cancelDelay && cancelDelay(); + cancelDelay = delay(resizeUnblockUpdate, 250); + if (globalProjectionState.hasAnimatedSinceResize) { + globalProjectionState.hasAnimatedSinceResize = false; + this.nodes.forEach(finishAnimation); + } + }); + } + if (layoutId) { + this.root.registerSharedNode(layoutId, this); + } + // Only register the handler if it requires layout animation + if (this.options.animate !== false && + visualElement && + (layoutId || layout)) { + this.addEventListener("didUpdate", ({ delta, hasLayoutChanged, hasRelativeLayoutChanged, layout: newLayout, }) => { + if (this.isTreeAnimationBlocked()) { + this.target = undefined; + this.relativeTarget = undefined; + return; + } + // TODO: Check here if an animation exists + const layoutTransition = this.options.transition || + visualElement.getDefaultTransition() || + defaultLayoutTransition; + const { onLayoutAnimationStart, onLayoutAnimationComplete, } = visualElement.getProps(); + /** + * The target layout of the element might stay the same, + * but its position relative to its parent has changed. + */ + const hasTargetChanged = !this.targetLayout || + !boxEqualsRounded(this.targetLayout, newLayout); + /* + * Note: Disabled to fix relative animations always triggering new + * layout animations. If this causes further issues, we can try + * a different approach to detecting relative target changes. + */ + // || hasRelativeLayoutChanged + /** + * If the layout hasn't seemed to have changed, it might be that the + * element is visually in the same place in the document but its position + * relative to its parent has indeed changed. So here we check for that. + */ + const hasOnlyRelativeTargetChanged = !hasLayoutChanged && hasRelativeLayoutChanged; + if (this.options.layoutRoot || + this.resumeFrom || + hasOnlyRelativeTargetChanged || + (hasLayoutChanged && + (hasTargetChanged || !this.currentAnimation))) { + if (this.resumeFrom) { + this.resumingFrom = this.resumeFrom; + this.resumingFrom.resumingFrom = undefined; + } + const animationOptions = { + ...getValueTransition(layoutTransition, "layout"), + onPlay: onLayoutAnimationStart, + onComplete: onLayoutAnimationComplete, + }; + if (visualElement.shouldReduceMotion || + this.options.layoutRoot) { + animationOptions.delay = 0; + animationOptions.type = false; + } + this.startAnimation(animationOptions); + /** + * Set animation origin after starting animation to avoid layout jump + * caused by stopping previous layout animation + */ + this.setAnimationOrigin(delta, hasOnlyRelativeTargetChanged, animationOptions + .path); + } + else { + /** + * If the layout hasn't changed and we have an animation that hasn't started yet, + * finish it immediately. Otherwise it will be animating from a location + * that was probably never committed to screen and look like a jumpy box. + */ + if (!hasLayoutChanged) { + finishAnimation(this); + } + if (this.isLead() && this.options.onExitComplete) { + this.options.onExitComplete(); + } + } + this.targetLayout = newLayout; + }); + } + } + unmount() { + this.options.layoutId && this.willUpdate(); + this.root.nodes.remove(this); + const stack = this.getStack(); + stack && stack.remove(this); + this.parent && this.parent.children.delete(this); + this.instance = undefined; + this.eventHandlers.clear(); + cancelFrame(this.updateProjection); + } + // only on the root + blockUpdate() { + this.updateManuallyBlocked = true; + } + unblockUpdate() { + this.updateManuallyBlocked = false; + } + isUpdateBlocked() { + return this.updateManuallyBlocked || this.updateBlockedByResize; + } + isTreeAnimationBlocked() { + return (this.isAnimationBlocked || + (this.parent && this.parent.isTreeAnimationBlocked()) || + false); + } + // Note: currently only running on root node + startUpdate() { + if (this.isUpdateBlocked()) + return; + this.isUpdating = true; + this.nodes && this.nodes.forEach(resetSkewAndRotation); + this.animationId++; + } + getTransformTemplate() { + const { visualElement } = this.options; + return visualElement && visualElement.getProps().transformTemplate; + } + willUpdate(shouldNotifyListeners = true) { + this.root.hasTreeAnimated = true; + if (this.root.isUpdateBlocked()) { + this.options.onExitComplete && this.options.onExitComplete(); + return; + } + /** + * If we're running optimised appear animations then these must be + * cancelled before measuring the DOM. This is so we can measure + * the true layout of the element rather than the WAAPI animation + * which will be unaffected by the resetSkewAndRotate step. + * + * Note: This is a DOM write. Worst case scenario is this is sandwiched + * between other snapshot reads which will cause unnecessary style recalculations. + * This has to happen here though, as we don't yet know which nodes will need + * snapshots in startUpdate(), but we only want to cancel optimised animations + * if a layout animation measurement is actually going to be affected by them. + */ + if (window.MotionCancelOptimisedAnimation && + !this.hasCheckedOptimisedAppear) { + cancelTreeOptimisedTransformAnimations(this); + } + !this.root.isUpdating && this.root.startUpdate(); + if (this.isLayoutDirty) + return; + this.isLayoutDirty = true; + for (let i = 0; i < this.path.length; i++) { + const node = this.path[i]; + node.shouldResetTransform = true; + /** + * Percentage translates resolve against layoutBox dimensions, + * so ancestors with them must be re-measured after transform reset. + */ + if (typeof node.latestValues.x === "string" || + typeof node.latestValues.y === "string") { + node.isLayoutDirty = true; + } + node.updateScroll("snapshot"); + if (node.options.layoutRoot) { + node.willUpdate(false); + } + } + const { layoutId, layout } = this.options; + if (layoutId === undefined && !layout) + return; + const transformTemplate = this.getTransformTemplate(); + this.prevTransformTemplateValue = transformTemplate + ? transformTemplate(this.latestValues, "") + : undefined; + this.updateSnapshot(); + shouldNotifyListeners && this.notifyListeners("willUpdate"); + } + update() { + this.updateScheduled = false; + const updateWasBlocked = this.isUpdateBlocked(); + // When doing an instant transition, we skip the layout update, + // but should still clean up the measurements so that the next + // snapshot could be taken correctly. + if (updateWasBlocked) { + const wasBlockedByResize = this.updateBlockedByResize; + this.unblockUpdate(); + this.updateBlockedByResize = false; + this.clearAllSnapshots(); + /** + * When blocked by resize, still measure layouts so + * callbacks like onLayoutMeasure fire (e.g. Reorder). + * Skip notifyLayoutUpdate to prevent animations. + */ + if (wasBlockedByResize) { + this.nodes.forEach(forceLayoutMeasure); + } + this.nodes.forEach(clearMeasurements); + return; + } + /** + * If this is a repeat of didUpdate then ignore the animation. + */ + if (this.animationId <= this.animationCommitId) { + this.nodes.forEach(clearIsLayoutDirty); + return; + } + this.animationCommitId = this.animationId; + if (!this.isUpdating) { + this.nodes.forEach(clearIsLayoutDirty); + } + else { + this.isUpdating = false; + /** + * Ensure animation-blocked nodes (e.g. during drag) + * get measured even when memoized (willUpdate skipped). + */ + this.nodes.forEach(ensureDraggedNodesSnapshotted); + /** + * Write + */ + this.nodes.forEach(resetTransformStyle); + /** + * Read ================== + */ + // Update layout measurements of updated children + this.nodes.forEach(updateLayout); + /** + * Write + */ + // Notify listeners that the layout is updated + this.nodes.forEach(notifyLayoutUpdate); + } + this.clearAllSnapshots(); + /** + * Manually flush any pending updates. Ideally + * we could leave this to the following requestAnimationFrame but this seems + * to leave a flash of incorrectly styled content. + */ + const now = time.now(); + frameData.delta = motionUtils.clamp(0, 1000 / 60, now - frameData.timestamp); + frameData.timestamp = now; + frameData.isProcessing = true; + frameSteps.update.process(frameData); + frameSteps.preRender.process(frameData); + frameSteps.render.process(frameData); + frameData.isProcessing = false; + } + didUpdate() { + if (!this.updateScheduled) { + this.updateScheduled = true; + microtask.read(this.scheduleUpdate); + } + } + clearAllSnapshots() { + this.nodes.forEach(clearSnapshot); + this.sharedNodes.forEach(removeLeadSnapshots); + } + scheduleUpdateProjection() { + if (!this.projectionUpdateScheduled) { + this.projectionUpdateScheduled = true; + frame.preRender(this.updateProjection, false, true); + } + } + scheduleCheckAfterUnmount() { + /** + * If the unmounting node is in a layoutGroup and did trigger a willUpdate, + * we manually call didUpdate to give a chance to the siblings to animate. + * Otherwise, cleanup all snapshots to prevents future nodes from reusing them. + */ + frame.postRender(() => { + if (this.isLayoutDirty) { + this.root.didUpdate(); + } + else { + this.root.checkUpdateFailed(); + } + }); + } + /** + * Update measurements + */ + updateSnapshot() { + if (this.snapshot || !this.instance) + return; + this.snapshot = this.measure(); + if (this.snapshot && + !calcLength(this.snapshot.measuredBox.x) && + !calcLength(this.snapshot.measuredBox.y)) { + this.snapshot = undefined; + } + } + updateLayout() { + if (!this.instance) + return; + this.updateScroll(); + if (!(this.options.alwaysMeasureLayout && this.isLead()) && + !this.isLayoutDirty) { + return; + } + /** + * When a node is mounted, it simply resumes from the prevLead's + * snapshot instead of taking a new one, but the ancestors scroll + * might have updated while the prevLead is unmounted. We need to + * update the scroll again to make sure the layout we measure is + * up to date. + */ + if (this.resumeFrom && !this.resumeFrom.instance) { + for (let i = 0; i < this.path.length; i++) { + const node = this.path[i]; + node.updateScroll(); + } + } + const prevLayout = this.layout; + this.layout = this.measure(false); + this.layoutVersion++; + if (!this.layoutCorrected) + this.layoutCorrected = createBox(); + this.isLayoutDirty = false; + this.projectionDelta = undefined; + this.notifyListeners("measure", this.layout.layoutBox); + const { visualElement } = this.options; + visualElement && + visualElement.notify("LayoutMeasure", this.layout.layoutBox, prevLayout ? prevLayout.layoutBox : undefined); + } + updateScroll(phase = "measure") { + let needsMeasurement = Boolean(this.options.layoutScroll && this.instance); + if (this.scroll && + this.scroll.animationId === this.root.animationId && + this.scroll.phase === phase) { + needsMeasurement = false; + } + if (needsMeasurement && this.instance) { + const isRoot = checkIsScrollRoot(this.instance); + this.scroll = { + animationId: this.root.animationId, + phase, + isRoot, + offset: measureScroll(this.instance), + wasRoot: this.scroll ? this.scroll.isRoot : isRoot, + }; + } + } + resetTransform() { + if (!resetTransform) + return; + const isResetRequested = this.isLayoutDirty || + this.shouldResetTransform || + this.options.alwaysMeasureLayout; + const hasProjection = this.projectionDelta && !isDeltaZero(this.projectionDelta); + const transformTemplate = this.getTransformTemplate(); + const transformTemplateValue = transformTemplate + ? transformTemplate(this.latestValues, "") + : undefined; + const transformTemplateHasChanged = transformTemplateValue !== this.prevTransformTemplateValue; + if (isResetRequested && + this.instance && + (hasProjection || + hasTransform(this.latestValues) || + transformTemplateHasChanged)) { + resetTransform(this.instance, transformTemplateValue); + this.shouldResetTransform = false; + this.scheduleRender(); + } + } + measure(removeTransform = true) { + const pageBox = this.measurePageBox(); + let layoutBox = this.removeElementScroll(pageBox); + /** + * Measurements taken during the pre-render stage + * still have transforms applied so we remove them + * via calculation. + */ + if (removeTransform) { + layoutBox = this.removeTransform(layoutBox); + } + roundBox(layoutBox); + return { + animationId: this.root.animationId, + measuredBox: pageBox, + layoutBox, + latestValues: {}, + source: this.id, + }; + } + measurePageBox() { + const { visualElement } = this.options; + if (!visualElement) + return createBox(); + const box = visualElement.measureViewportBox(); + const wasInScrollRoot = this.scroll?.wasRoot || this.path.some(checkNodeWasScrollRoot); + if (!wasInScrollRoot) { + // Remove viewport scroll to give page-relative coordinates + const { scroll } = this.root; + if (scroll) { + translateAxis(box.x, scroll.offset.x); + translateAxis(box.y, scroll.offset.y); + } + } + return box; + } + removeElementScroll(box) { + const boxWithoutScroll = createBox(); + copyBoxInto(boxWithoutScroll, box); + if (this.scroll?.wasRoot) { + return boxWithoutScroll; + } + /** + * Performance TODO: Keep a cumulative scroll offset down the tree + * rather than loop back up the path. + */ + for (let i = 0; i < this.path.length; i++) { + const node = this.path[i]; + const { scroll, options } = node; + if (node !== this.root && scroll && options.layoutScroll) { + /** + * If this is a new scroll root, we want to remove all previous scrolls + * from the viewport box. + */ + if (scroll.wasRoot) { + copyBoxInto(boxWithoutScroll, box); + } + translateAxis(boxWithoutScroll.x, scroll.offset.x); + translateAxis(boxWithoutScroll.y, scroll.offset.y); + } + } + return boxWithoutScroll; + } + applyTransform(box, transformOnly = false, output) { + const withTransforms = output || createBox(); + copyBoxInto(withTransforms, box); + for (let i = 0; i < this.path.length; i++) { + const node = this.path[i]; + if (!transformOnly && + node.options.layoutScroll && + node.scroll && + node !== node.root) { + translateAxis(withTransforms.x, -node.scroll.offset.x); + translateAxis(withTransforms.y, -node.scroll.offset.y); + } + if (!hasTransform(node.latestValues)) + continue; + transformBox(withTransforms, node.latestValues, node.layout?.layoutBox); + } + if (hasTransform(this.latestValues)) { + transformBox(withTransforms, this.latestValues, this.layout?.layoutBox); + } + return withTransforms; + } + removeTransform(box) { + const boxWithoutTransform = createBox(); + copyBoxInto(boxWithoutTransform, box); + for (let i = 0; i < this.path.length; i++) { + const node = this.path[i]; + if (!hasTransform(node.latestValues)) + continue; + let sourceBox; + if (node.instance) { + hasScale(node.latestValues) && node.updateSnapshot(); + sourceBox = createBox(); + copyBoxInto(sourceBox, node.measurePageBox()); + } + removeBoxTransforms(boxWithoutTransform, node.latestValues, node.snapshot?.layoutBox, sourceBox); + } + if (hasTransform(this.latestValues)) { + removeBoxTransforms(boxWithoutTransform, this.latestValues); + } + return boxWithoutTransform; + } + setTargetDelta(delta) { + this.targetDelta = delta; + this.root.scheduleUpdateProjection(); + this.isProjectionDirty = true; + } + setOptions(options) { + this.options = { + ...this.options, + ...options, + crossfade: options.crossfade !== undefined ? options.crossfade : true, + }; + } + clearMeasurements() { + this.scroll = undefined; + this.layout = undefined; + this.snapshot = undefined; + this.prevTransformTemplateValue = undefined; + this.targetDelta = undefined; + this.target = undefined; + this.isLayoutDirty = false; + } + forceRelativeParentToResolveTarget() { + if (!this.relativeParent) + return; + /** + * If the parent target isn't up-to-date, force it to update. + * This is an unfortunate de-optimisation as it means any updating relative + * projection will cause all the relative parents to recalculate back + * up the tree. + */ + if (this.relativeParent.resolvedRelativeTargetAt !== + frameData.timestamp) { + this.relativeParent.resolveTargetDelta(true); + } + } + resolveTargetDelta(forceRecalculation = false) { + /** + * Once the dirty status of nodes has been spread through the tree, we also + * need to check if we have a shared node of a different depth that has itself + * been dirtied. + */ + const lead = this.getLead(); + this.isProjectionDirty || (this.isProjectionDirty = lead.isProjectionDirty); + this.isTransformDirty || (this.isTransformDirty = lead.isTransformDirty); + this.isSharedProjectionDirty || (this.isSharedProjectionDirty = lead.isSharedProjectionDirty); + const isShared = Boolean(this.resumingFrom) || this !== lead; + /** + * We don't use transform for this step of processing so we don't + * need to check whether any nodes have changed transform. + */ + const canSkip = !(forceRecalculation || + (isShared && this.isSharedProjectionDirty) || + this.isProjectionDirty || + this.parent?.isProjectionDirty || + this.attemptToResolveRelativeTarget || + this.root.updateBlockedByResize); + if (canSkip) + return; + const { layout, layoutId } = this.options; + /** + * If we have no layout, we can't perform projection, so early return + */ + if (!this.layout || !(layout || layoutId)) + return; + this.resolvedRelativeTargetAt = frameData.timestamp; + const relativeParent = this.getClosestProjectingParent(); + if (relativeParent && + this.linkedParentVersion !== relativeParent.layoutVersion && + !relativeParent.options.layoutRoot) { + this.removeRelativeTarget(); + } + /** + * If we don't have a targetDelta but do have a layout, we can attempt to resolve + * a relativeParent. This will allow a component to perform scale correction + * even if no animation has started. + */ + if (!this.targetDelta && !this.relativeTarget) { + if (this.options.layoutAnchor !== false && + relativeParent && + relativeParent.layout) { + this.createRelativeTarget(relativeParent, this.layout.layoutBox, relativeParent.layout.layoutBox); + } + else { + this.removeRelativeTarget(); + } + } + /** + * If we have no relative target or no target delta our target isn't valid + * for this frame. + */ + if (!this.relativeTarget && !this.targetDelta) + return; + /** + * Lazy-init target data structure + */ + if (!this.target) { + this.target = createBox(); + this.targetWithTransforms = createBox(); + } + /** + * If we've got a relative box for this component, resolve it into a target relative to the parent. + */ + if (this.relativeTarget && + this.relativeTargetOrigin && + this.relativeParent && + this.relativeParent.target) { + this.forceRelativeParentToResolveTarget(); + calcRelativeBox(this.target, this.relativeTarget, this.relativeParent.target, this.options.layoutAnchor || undefined); + /** + * If we've only got a targetDelta, resolve it into a target + */ + } + else if (this.targetDelta) { + if (Boolean(this.resumingFrom)) { + this.applyTransform(this.layout.layoutBox, false, this.target); + } + else { + copyBoxInto(this.target, this.layout.layoutBox); + } + applyBoxDelta(this.target, this.targetDelta); + } + else { + /** + * If no target, use own layout as target + */ + copyBoxInto(this.target, this.layout.layoutBox); + } + /** + * If we've been told to attempt to resolve a relative target, do so. + */ + if (this.attemptToResolveRelativeTarget) { + this.attemptToResolveRelativeTarget = false; + if (this.options.layoutAnchor !== false && + relativeParent && + Boolean(relativeParent.resumingFrom) === + Boolean(this.resumingFrom) && + !relativeParent.options.layoutScroll && + relativeParent.target && + this.animationProgress !== 1) { + this.createRelativeTarget(relativeParent, this.target, relativeParent.target); + } + else { + this.relativeParent = this.relativeTarget = undefined; + } + } + /** + * Increase debug counter for resolved target deltas + */ + if (statsBuffer.value) { + metrics.calculatedTargetDeltas++; + } + } + getClosestProjectingParent() { + if (!this.parent || + hasScale(this.parent.latestValues) || + has2DTranslate(this.parent.latestValues)) { + return undefined; + } + if (this.parent.isProjecting()) { + return this.parent; + } + else { + return this.parent.getClosestProjectingParent(); + } + } + isProjecting() { + return Boolean((this.relativeTarget || + this.targetDelta || + this.options.layoutRoot) && + this.layout); + } + createRelativeTarget(relativeParent, layout, parentLayout) { + this.relativeParent = relativeParent; + this.linkedParentVersion = relativeParent.layoutVersion; + this.forceRelativeParentToResolveTarget(); + this.relativeTarget = createBox(); + this.relativeTargetOrigin = createBox(); + calcRelativePosition(this.relativeTargetOrigin, layout, parentLayout, this.options.layoutAnchor || undefined); + copyBoxInto(this.relativeTarget, this.relativeTargetOrigin); + } + removeRelativeTarget() { + this.relativeParent = this.relativeTarget = undefined; + } + calcProjection() { + const lead = this.getLead(); + const isShared = Boolean(this.resumingFrom) || this !== lead; + let canSkip = true; + /** + * If this is a normal layout animation and neither this node nor its nearest projecting + * is dirty then we can't skip. + */ + if (this.isProjectionDirty || this.parent?.isProjectionDirty) { + canSkip = false; + } + /** + * If this is a shared layout animation and this node's shared projection is dirty then + * we can't skip. + */ + if (isShared && + (this.isSharedProjectionDirty || this.isTransformDirty)) { + canSkip = false; + } + /** + * If we have resolved the target this frame we must recalculate the + * projection to ensure it visually represents the internal calculations. + */ + if (this.resolvedRelativeTargetAt === frameData.timestamp) { + canSkip = false; + } + if (canSkip) + return; + const { layout, layoutId } = this.options; + /** + * If this section of the tree isn't animating we can + * delete our target sources for the following frame. + */ + this.isTreeAnimating = Boolean((this.parent && this.parent.isTreeAnimating) || + this.currentAnimation || + this.pendingAnimation); + if (!this.isTreeAnimating) { + this.targetDelta = this.relativeTarget = undefined; + } + if (!this.layout || !(layout || layoutId)) + return; + /** + * Reset the corrected box with the latest values from box, as we're then going + * to perform mutative operations on it. + */ + copyBoxInto(this.layoutCorrected, this.layout.layoutBox); + /** + * Record previous tree scales before updating. + */ + const prevTreeScaleX = this.treeScale.x; + const prevTreeScaleY = this.treeScale.y; + /** + * Apply all the parent deltas to this box to produce the corrected box. This + * is the layout box, as it will appear on screen as a result of the transforms of its parents. + */ + applyTreeDeltas(this.layoutCorrected, this.treeScale, this.path, isShared); + /** + * If this layer needs to perform scale correction but doesn't have a target, + * use the layout as the target. + */ + if (lead.layout && + !lead.target && + (this.treeScale.x !== 1 || this.treeScale.y !== 1)) { + lead.target = lead.layout.layoutBox; + lead.targetWithTransforms = createBox(); + } + const { target } = lead; + if (!target) { + /** + * If we don't have a target to project into, but we were previously + * projecting, we want to remove the stored transform and schedule + * a render to ensure the elements reflect the removed transform. + */ + if (this.prevProjectionDelta) { + this.createProjectionDeltas(); + this.scheduleRender(); + } + return; + } + if (!this.projectionDelta || !this.prevProjectionDelta) { + this.createProjectionDeltas(); + } + else { + copyAxisDeltaInto(this.prevProjectionDelta.x, this.projectionDelta.x); + copyAxisDeltaInto(this.prevProjectionDelta.y, this.projectionDelta.y); + } + /** + * Update the delta between the corrected box and the target box before user-set transforms were applied. + * This will allow us to calculate the corrected borderRadius and boxShadow to compensate + * for our layout reprojection, but still allow them to be scaled correctly by the user. + * It might be that to simplify this we may want to accept that user-set scale is also corrected + * and we wouldn't have to keep and calc both deltas, OR we could support a user setting + * to allow people to choose whether these styles are corrected based on just the + * layout reprojection or the final bounding box. + */ + calcBoxDelta(this.projectionDelta, this.layoutCorrected, target, this.latestValues); + if (this.treeScale.x !== prevTreeScaleX || + this.treeScale.y !== prevTreeScaleY || + !axisDeltaEquals(this.projectionDelta.x, this.prevProjectionDelta.x) || + !axisDeltaEquals(this.projectionDelta.y, this.prevProjectionDelta.y)) { + this.hasProjected = true; + this.scheduleRender(); + this.notifyListeners("projectionUpdate", target); + } + /** + * Increase debug counter for recalculated projections + */ + if (statsBuffer.value) { + metrics.calculatedProjections++; + } + } + hide() { + this.isVisible = false; + // TODO: Schedule render + } + show() { + this.isVisible = true; + // TODO: Schedule render + } + scheduleRender(notifyAll = true) { + this.options.visualElement?.scheduleRender(); + if (notifyAll) { + const stack = this.getStack(); + stack && stack.scheduleRender(); + } + if (this.resumingFrom && !this.resumingFrom.instance) { + this.resumingFrom = undefined; + } + } + createProjectionDeltas() { + this.prevProjectionDelta = createDelta(); + this.projectionDelta = createDelta(); + this.projectionDeltaWithTransform = createDelta(); + } + setAnimationOrigin(delta, hasOnlyRelativeTargetChanged = false, pathFn) { + const snapshot = this.snapshot; + const snapshotLatestValues = snapshot ? snapshot.latestValues : {}; + const mixedValues = { ...this.latestValues }; + const targetDelta = createDelta(); + if (!this.relativeParent || + !this.relativeParent.options.layoutRoot) { + this.relativeTarget = this.relativeTargetOrigin = undefined; + } + this.attemptToResolveRelativeTarget = !hasOnlyRelativeTargetChanged; + const relativeLayout = createBox(); + const snapshotSource = snapshot ? snapshot.source : undefined; + const layoutSource = this.layout ? this.layout.source : undefined; + const isSharedLayoutAnimation = snapshotSource !== layoutSource; + const stack = this.getStack(); + const isOnlyMember = !stack || stack.members.length <= 1; + const shouldCrossfadeOpacity = Boolean(isSharedLayoutAnimation && + !isOnlyMember && + this.options.crossfade === true && + !this.path.some(hasOpacityCrossfade)); + this.animationProgress = 0; + let prevRelativeTarget; + // The path decides whether the layout shift is worth curving + // (distance floor) and resolves the interpolator from the delta. + const interpolate = pathFn?.interpolateProjection(delta); + this.mixTargetDelta = (latest) => { + const progress = latest / 1000; + const point = interpolate?.(progress); + if (point) { + targetDelta.x.translate = point.x; + targetDelta.x.scale = mixNumber$1(delta.x.scale, 1, progress); + targetDelta.x.origin = delta.x.origin; + targetDelta.x.originPoint = delta.x.originPoint; + targetDelta.y.translate = point.y; + targetDelta.y.scale = mixNumber$1(delta.y.scale, 1, progress); + targetDelta.y.origin = delta.y.origin; + targetDelta.y.originPoint = delta.y.originPoint; + } + else { + mixAxisDeltaLinear(targetDelta.x, delta.x, progress); + mixAxisDeltaLinear(targetDelta.y, delta.y, progress); + } + this.setTargetDelta(targetDelta); + if (this.relativeTarget && + this.relativeTargetOrigin && + this.layout && + this.relativeParent && + this.relativeParent.layout) { + calcRelativePosition(relativeLayout, this.layout.layoutBox, this.relativeParent.layout.layoutBox, this.options.layoutAnchor || undefined); + mixBox(this.relativeTarget, this.relativeTargetOrigin, relativeLayout, progress); + /** + * If this is an unchanged relative target we can consider the + * projection not dirty. + */ + if (prevRelativeTarget && + boxEquals(this.relativeTarget, prevRelativeTarget)) { + this.isProjectionDirty = false; + } + if (!prevRelativeTarget) + prevRelativeTarget = createBox(); + copyBoxInto(prevRelativeTarget, this.relativeTarget); + } + if (isSharedLayoutAnimation) { + this.animationValues = mixedValues; + mixValues(mixedValues, snapshotLatestValues, this.latestValues, progress, shouldCrossfadeOpacity, isOnlyMember); + } + if (point && point.rotate !== undefined) { + // Dedicated `pathRotation` channel, not `rotate`, so an + // animating `rotate` is composed with, never clobbered. + if (!this.animationValues) + this.animationValues = mixedValues; + this.animationValues.pathRotation = point.rotate; + } + this.root.scheduleUpdateProjection(); + this.scheduleRender(); + this.animationProgress = progress; + }; + this.mixTargetDelta(this.options.layoutRoot ? 1000 : 0); + } + startAnimation(options) { + this.notifyListeners("animationStart"); + this.currentAnimation?.stop(); + this.resumingFrom?.currentAnimation?.stop(); + if (this.pendingAnimation) { + cancelFrame(this.pendingAnimation); + this.pendingAnimation = undefined; + } + /** + * Start the animation in the next frame to have a frame with progress 0, + * where the target is the same as when the animation started, so we can + * calculate the relative positions correctly for instant transitions. + */ + this.pendingAnimation = frame.update(() => { + globalProjectionState.hasAnimatedSinceResize = true; + this.motionValue || (this.motionValue = motionValue(0)); + this.motionValue.jump(0, false); + this.currentAnimation = animateSingleValue(this.motionValue, [0, 1000], { + ...options, + velocity: 0, + isSync: true, + onUpdate: (latest) => { + this.mixTargetDelta(latest); + options.onUpdate && options.onUpdate(latest); + }, + onComplete: () => { + options.onComplete && options.onComplete(); + this.completeAnimation(); + }, + }); + if (this.resumingFrom) { + this.resumingFrom.currentAnimation = this.currentAnimation; + } + this.pendingAnimation = undefined; + }); + } + completeAnimation() { + if (this.resumingFrom) { + this.resumingFrom.currentAnimation = undefined; + this.resumingFrom.preserveOpacity = undefined; + } + const stack = this.getStack(); + stack && stack.exitAnimationComplete(); + this.resumingFrom = + this.currentAnimation = + this.animationValues = + undefined; + this.notifyListeners("animationComplete"); + } + finishAnimation() { + if (this.currentAnimation) { + this.mixTargetDelta && this.mixTargetDelta(animationTarget); + this.currentAnimation.stop(); + } + this.completeAnimation(); + } + applyTransformsToTarget() { + const lead = this.getLead(); + let { targetWithTransforms, target, layout, latestValues } = lead; + if (!targetWithTransforms || !target || !layout) + return; + /** + * If we're only animating position, and this element isn't the lead element, + * then instead of projecting into the lead box we instead want to calculate + * a new target that aligns the two boxes but maintains the layout shape. + */ + if (this !== lead && + this.layout && + layout && + shouldAnimatePositionOnly(this.options.animationType, this.layout.layoutBox, layout.layoutBox)) { + target = this.target || createBox(); + const xLength = calcLength(this.layout.layoutBox.x); + target.x.min = lead.target.x.min; + target.x.max = target.x.min + xLength; + const yLength = calcLength(this.layout.layoutBox.y); + target.y.min = lead.target.y.min; + target.y.max = target.y.min + yLength; + } + copyBoxInto(targetWithTransforms, target); + /** + * Apply the latest user-set transforms to the targetBox to produce the targetBoxFinal. + * This is the final box that we will then project into by calculating a transform delta and + * applying it to the corrected box. + */ + transformBox(targetWithTransforms, latestValues); + /** + * Update the delta between the corrected box and the final target box, after + * user-set transforms are applied to it. This will be used by the renderer to + * create a transform style that will reproject the element from its layout layout + * into the desired bounding box. + */ + calcBoxDelta(this.projectionDeltaWithTransform, this.layoutCorrected, targetWithTransforms, latestValues); + } + registerSharedNode(layoutId, node) { + if (!this.sharedNodes.has(layoutId)) { + this.sharedNodes.set(layoutId, new NodeStack()); + } + const stack = this.sharedNodes.get(layoutId); + stack.add(node); + const config = node.options.initialPromotionConfig; + node.promote({ + transition: config ? config.transition : undefined, + preserveFollowOpacity: config && config.shouldPreserveFollowOpacity + ? config.shouldPreserveFollowOpacity(node) + : undefined, + }); + } + isLead() { + const stack = this.getStack(); + return stack ? stack.lead === this : true; + } + getLead() { + const { layoutId } = this.options; + return layoutId ? this.getStack()?.lead || this : this; + } + getPrevLead() { + const { layoutId } = this.options; + return layoutId ? this.getStack()?.prevLead : undefined; + } + getStack() { + const { layoutId } = this.options; + if (layoutId) + return this.root.sharedNodes.get(layoutId); + } + promote({ needsReset, transition, preserveFollowOpacity, } = {}) { + const stack = this.getStack(); + if (stack) + stack.promote(this, preserveFollowOpacity); + if (needsReset) { + this.projectionDelta = undefined; + this.needsReset = true; + } + if (transition) + this.setOptions({ transition }); + } + relegate() { + const stack = this.getStack(); + if (stack) { + return stack.relegate(this); + } + else { + return false; + } + } + resetSkewAndRotation() { + const { visualElement } = this.options; + if (!visualElement) + return; + // If there's no detected skew or rotation values, we can early return without a forced render. + let hasDistortingTransform = false; + /** + * An unrolled check for rotation values. Most elements don't have any rotation and + * skipping the nested loop and new object creation is 50% faster. + */ + const { latestValues } = visualElement; + if (latestValues.z || + latestValues.rotate || + latestValues.rotateX || + latestValues.rotateY || + latestValues.rotateZ || + latestValues.skewX || + latestValues.skewY) { + hasDistortingTransform = true; + } + // If there's no distorting values, we don't need to do any more. + if (!hasDistortingTransform) + return; + const resetValues = {}; + if (latestValues.z) { + resetDistortingTransform("z", visualElement, resetValues, this.animationValues); + } + // Check the skew and rotate value of all axes and reset to 0 + for (let i = 0; i < transformAxes.length; i++) { + resetDistortingTransform(`rotate${transformAxes[i]}`, visualElement, resetValues, this.animationValues); + resetDistortingTransform(`skew${transformAxes[i]}`, visualElement, resetValues, this.animationValues); + } + // Force a render of this element to apply the transform with all skews and rotations + // set to 0. + visualElement.render(); + // Put back all the values we reset + for (const key in resetValues) { + visualElement.setStaticValue(key, resetValues[key]); + if (this.animationValues) { + this.animationValues[key] = resetValues[key]; + } + } + // Schedule a render for the next frame. This ensures we won't visually + // see the element with the reset rotate value applied. + visualElement.scheduleRender(); + } + applyProjectionStyles(targetStyle, // CSSStyleDeclaration - doesn't allow numbers to be assigned to properties + styleProp) { + if (!this.instance || this.isSVG) + return; + if (!this.isVisible) { + targetStyle.visibility = "hidden"; + return; + } + const transformTemplate = this.getTransformTemplate(); + if (this.needsReset) { + this.needsReset = false; + targetStyle.visibility = ""; + targetStyle.opacity = ""; + targetStyle.pointerEvents = + resolveMotionValue(styleProp?.pointerEvents) || ""; + targetStyle.transform = transformTemplate + ? transformTemplate(this.latestValues, "") + : "none"; + return; + } + const lead = this.getLead(); + if (!this.projectionDelta || !this.layout || !lead.target) { + if (this.options.layoutId) { + targetStyle.opacity = + this.latestValues.opacity !== undefined + ? this.latestValues.opacity + : 1; + targetStyle.pointerEvents = + resolveMotionValue(styleProp?.pointerEvents) || ""; + } + if (this.hasProjected && !hasTransform(this.latestValues)) { + targetStyle.transform = transformTemplate + ? transformTemplate({}, "") + : "none"; + this.hasProjected = false; + } + return; + } + targetStyle.visibility = ""; + const valuesToRender = lead.animationValues || lead.latestValues; + this.applyTransformsToTarget(); + let transform = buildProjectionTransform(this.projectionDeltaWithTransform, this.treeScale, valuesToRender); + if (transformTemplate) { + transform = transformTemplate(valuesToRender, transform); + } + targetStyle.transform = transform; + const { x, y } = this.projectionDelta; + targetStyle.transformOrigin = `${x.origin * 100}% ${y.origin * 100}% 0`; + if (lead.animationValues) { + /** + * If the lead component is animating, assign this either the entering/leaving + * opacity + */ + targetStyle.opacity = + lead === this + ? valuesToRender.opacity ?? + this.latestValues.opacity ?? + 1 + : this.preserveOpacity + ? this.latestValues.opacity + : valuesToRender.opacityExit; + } + else { + /** + * Or we're not animating at all, set the lead component to its layout + * opacity and other components to hidden. + */ + targetStyle.opacity = + lead === this + ? valuesToRender.opacity !== undefined + ? valuesToRender.opacity + : "" + : valuesToRender.opacityExit !== undefined + ? valuesToRender.opacityExit + : 0; + } + /** + * Apply scale correction + */ + for (const key in scaleCorrectors) { + if (valuesToRender[key] === undefined) + continue; + const { correct, applyTo, isCSSVariable } = scaleCorrectors[key]; + /** + * Only apply scale correction to the value if we have an + * active projection transform. Otherwise these values become + * vulnerable to distortion if the element changes size without + * a corresponding layout animation. + */ + const corrected = transform === "none" + ? valuesToRender[key] + : correct(valuesToRender[key], lead); + if (applyTo) { + const num = applyTo.length; + for (let i = 0; i < num; i++) { + targetStyle[applyTo[i]] = corrected; + } + } + else { + // If this is a CSS variable, set it directly on the instance. + // Replacing this function from creating styles to setting them + // would be a good place to remove per frame object creation + if (isCSSVariable) { + this.options.visualElement.renderState.vars[key] = corrected; + } + else { + targetStyle[key] = corrected; + } + } + } + /** + * Disable pointer events on follow components. This is to ensure + * that if a follow component covers a lead component it doesn't block + * pointer events on the lead. + */ + if (this.options.layoutId) { + targetStyle.pointerEvents = + lead === this + ? resolveMotionValue(styleProp?.pointerEvents) || "" + : "none"; + } + } + clearSnapshot() { + this.resumeFrom = this.snapshot = undefined; + } + // Only run on root + resetTree() { + this.root.nodes.forEach((node) => node.currentAnimation?.stop()); + this.root.nodes.forEach(clearMeasurements); + this.root.sharedNodes.clear(); + } + }; +} +function updateLayout(node) { + node.updateLayout(); +} +function notifyLayoutUpdate(node) { + const snapshot = node.resumeFrom?.snapshot || node.snapshot; + if (node.isLead() && + node.layout && + snapshot && + node.hasListeners("didUpdate")) { + const { layoutBox: layout, measuredBox: measuredLayout } = node.layout; + const { animationType } = node.options; + const isShared = snapshot.source !== node.layout.source; + // TODO Maybe we want to also resize the layout snapshot so we don't trigger + // animations for instance if layout="size" and an element has only changed position + if (animationType === "size") { + eachAxis((axis) => { + const axisSnapshot = isShared + ? snapshot.measuredBox[axis] + : snapshot.layoutBox[axis]; + const length = calcLength(axisSnapshot); + axisSnapshot.min = layout[axis].min; + axisSnapshot.max = axisSnapshot.min + length; + }); + } + else if (animationType === "x" || animationType === "y") { + const snapAxis = animationType === "x" ? "y" : "x"; + copyAxisInto(isShared + ? snapshot.measuredBox[snapAxis] + : snapshot.layoutBox[snapAxis], layout[snapAxis]); + } + else if (shouldAnimatePositionOnly(animationType, snapshot.layoutBox, layout)) { + eachAxis((axis) => { + const axisSnapshot = isShared + ? snapshot.measuredBox[axis] + : snapshot.layoutBox[axis]; + const length = calcLength(layout[axis]); + axisSnapshot.max = axisSnapshot.min + length; + /** + * Ensure relative target gets resized and rerendererd + */ + if (node.relativeTarget && !node.currentAnimation) { + node.isProjectionDirty = true; + node.relativeTarget[axis].max = + node.relativeTarget[axis].min + length; + } + }); + } + const layoutDelta = createDelta(); + calcBoxDelta(layoutDelta, layout, snapshot.layoutBox); + const visualDelta = createDelta(); + if (isShared) { + calcBoxDelta(visualDelta, node.applyTransform(measuredLayout, true), snapshot.measuredBox); + } + else { + calcBoxDelta(visualDelta, layout, snapshot.layoutBox); + } + const hasLayoutChanged = !isDeltaZero(layoutDelta); + let hasRelativeLayoutChanged = false; + if (!node.resumeFrom) { + const relativeParent = node.getClosestProjectingParent(); + /** + * If the relativeParent is itself resuming from a different element then + * the relative snapshot is not relavent + */ + if (relativeParent && !relativeParent.resumeFrom) { + const { snapshot: parentSnapshot, layout: parentLayout } = relativeParent; + if (parentSnapshot && parentLayout) { + const anchor = node.options.layoutAnchor || undefined; + const relativeSnapshot = createBox(); + calcRelativePosition(relativeSnapshot, snapshot.layoutBox, parentSnapshot.layoutBox, anchor); + const relativeLayout = createBox(); + calcRelativePosition(relativeLayout, layout, parentLayout.layoutBox, anchor); + if (!boxEqualsRounded(relativeSnapshot, relativeLayout)) { + hasRelativeLayoutChanged = true; + } + if (relativeParent.options.layoutRoot) { + node.relativeTarget = relativeLayout; + node.relativeTargetOrigin = relativeSnapshot; + node.relativeParent = relativeParent; + } + } + } + } + node.notifyListeners("didUpdate", { + layout, + snapshot, + delta: visualDelta, + layoutDelta, + hasLayoutChanged, + hasRelativeLayoutChanged, + }); + } + else if (node.isLead()) { + const { onExitComplete } = node.options; + onExitComplete && onExitComplete(); + } + /** + * Clearing transition + * TODO: Investigate why this transition is being passed in as {type: false } from Framer + * and why we need it at all + */ + node.options.transition = undefined; +} +function propagateDirtyNodes(node) { + /** + * Increase debug counter for nodes encountered this frame + */ + if (statsBuffer.value) { + metrics.nodes++; + } + if (!node.parent) + return; + /** + * If this node isn't projecting, propagate isProjectionDirty. It will have + * no performance impact but it will allow the next child that *is* projecting + * but *isn't* dirty to just check its parent to see if *any* ancestor needs + * correcting. + */ + if (!node.isProjecting()) { + node.isProjectionDirty = node.parent.isProjectionDirty; + } + /** + * Propagate isSharedProjectionDirty and isTransformDirty + * throughout the whole tree. A future revision can take another look at + * this but for safety we still recalcualte shared nodes. + */ + node.isSharedProjectionDirty || (node.isSharedProjectionDirty = Boolean(node.isProjectionDirty || + node.parent.isProjectionDirty || + node.parent.isSharedProjectionDirty)); + node.isTransformDirty || (node.isTransformDirty = node.parent.isTransformDirty); +} +function cleanDirtyNodes(node) { + node.isProjectionDirty = + node.isSharedProjectionDirty = + node.isTransformDirty = + false; +} +function clearSnapshot(node) { + node.clearSnapshot(); +} +function clearMeasurements(node) { + node.clearMeasurements(); +} +function forceLayoutMeasure(node) { + node.isLayoutDirty = true; + node.updateLayout(); +} +function clearIsLayoutDirty(node) { + node.isLayoutDirty = false; +} +/** + * When a node is animation-blocked (e.g. during drag) and its component + * didn't re-render (memoized), willUpdate() is never called so there's + * no snapshot. Use the previous layout as a snapshot and mark dirty so + * resetTransform/updateLayout/notifyLayoutUpdate process it normally. + */ +function ensureDraggedNodesSnapshotted(node) { + if (node.isAnimationBlocked && node.layout && !node.isLayoutDirty) { + node.snapshot = node.layout; + node.isLayoutDirty = true; + } +} +function resetTransformStyle(node) { + const { visualElement } = node.options; + if (visualElement && visualElement.getProps().onBeforeLayoutMeasure) { + visualElement.notify("BeforeLayoutMeasure"); + } + node.resetTransform(); +} +function finishAnimation(node) { + node.finishAnimation(); + node.targetDelta = node.relativeTarget = node.target = undefined; + node.isProjectionDirty = true; +} +function resolveTargetDelta(node) { + node.resolveTargetDelta(); +} +function calcProjection(node) { + node.calcProjection(); +} +function resetSkewAndRotation(node) { + node.resetSkewAndRotation(); +} +function removeLeadSnapshots(stack) { + stack.removeLeadSnapshot(); +} +function mixAxisDeltaLinear(output, delta, p) { + output.translate = mixNumber$1(delta.translate, 0, p); + output.scale = mixNumber$1(delta.scale, 1, p); + output.origin = delta.origin; + output.originPoint = delta.originPoint; +} +function mixAxis(output, from, to, p) { + output.min = mixNumber$1(from.min, to.min, p); + output.max = mixNumber$1(from.max, to.max, p); +} +function mixBox(output, from, to, p) { + mixAxis(output.x, from.x, to.x, p); + mixAxis(output.y, from.y, to.y, p); +} +function hasOpacityCrossfade(node) { + return (node.animationValues && node.animationValues.opacityExit !== undefined); +} +const defaultLayoutTransition = { + duration: 0.45, + ease: [0.4, 0, 0.1, 1], +}; +const userAgentContains = (string) => typeof navigator !== "undefined" && + navigator.userAgent && + navigator.userAgent.toLowerCase().includes(string); +/** + * Measured bounding boxes must be rounded in Safari and + * left untouched in Chrome, otherwise non-integer layouts within scaled-up elements + * can appear to jump. + */ +const roundPoint = userAgentContains("applewebkit/") && !userAgentContains("chrome/") + ? Math.round + : motionUtils.noop; +function roundAxis(axis) { + // Round to the nearest .5 pixels to support subpixel layouts + axis.min = roundPoint(axis.min); + axis.max = roundPoint(axis.max); +} +function roundBox(box) { + roundAxis(box.x); + roundAxis(box.y); +} +function shouldAnimatePositionOnly(animationType, snapshot, layout) { + return (animationType === "position" || + (animationType === "preserve-aspect" && + !isNear(aspectRatio(snapshot), aspectRatio(layout), 0.2))); +} +function checkNodeWasScrollRoot(node) { + return node !== node.root && node.scroll?.wasRoot; +} + +const DocumentProjectionNode = createProjectionNode({ + attachResizeListener: (ref, notify) => addDomEvent(ref, "resize", notify), + measureScroll: () => ({ + x: document.documentElement.scrollLeft || document.body?.scrollLeft || 0, + y: document.documentElement.scrollTop || document.body?.scrollTop || 0, + }), + checkIsScrollRoot: () => true, +}); + +const notify = (node) => !node.isLayoutDirty && node.willUpdate(false); +function nodeGroup() { + const nodes = new Set(); + const subscriptions = new WeakMap(); + const dirtyAll = () => nodes.forEach(notify); + return { + add: (node) => { + nodes.add(node); + subscriptions.set(node, node.addEventListener("willUpdate", dirtyAll)); + }, + remove: (node) => { + nodes.delete(node); + const unsubscribe = subscriptions.get(node); + if (unsubscribe) { + unsubscribe(); + subscriptions.delete(node); + } + dirtyAll(); + }, + dirty: dirtyAll, + }; +} + +const rootProjectionNode = { + current: undefined, +}; +const HTMLProjectionNode = createProjectionNode({ + measureScroll: (instance) => ({ + x: instance.scrollLeft, + y: instance.scrollTop, + }), + defaultParent: () => { + if (!rootProjectionNode.current) { + const documentNode = new DocumentProjectionNode({}); + documentNode.mount(window); + documentNode.setOptions({ layoutScroll: true }); + rootProjectionNode.current = documentNode; + } + return rootProjectionNode.current; + }, + resetTransform: (instance, value) => { + instance.style.transform = value !== undefined ? value : "none"; + }, + checkIsScrollRoot: (instance) => Boolean(window.getComputedStyle(instance).position === "fixed"), +}); + +const layoutSelector = "[data-layout],[data-layout-id]"; +/** + * All imperatively-created projection nodes live in one persistent tree, + * shared across animateLayout() calls (and with any React-created nodes, + * via the singleton document root). Keyed by element for reuse. + */ +const layoutNodes = new WeakMap(); +/** + * Builders created within the same synchronous tick are flushed together + * as a single "commit": every node is snapshotted before any updateDom + * runs, mirroring React batching renders from different parts of the tree. + */ +let pendingBuilders; +function collectLayoutElements(scope) { + const elements = []; + if (scope instanceof HTMLElement && scope.matches(layoutSelector)) { + elements.push(scope); + } + scope.querySelectorAll(layoutSelector).forEach((element) => { + if (element instanceof HTMLElement) + elements.push(element); + }); + return elements; +} +/** + * Process any work scheduled on the frameloop now. A previous animation + * may have been seeked while paused (controls.time = x) without a frame + * having rendered it - we must materialise that state into the DOM + * before taking snapshots. + */ +function flushPendingFrame() { + if (frameData.isProcessing) + return; + const now = time.now(); + frameData.delta = motionUtils.clamp(0, 1000 / 60, now - frameData.timestamp); + frameData.timestamp = now; + frameData.isProcessing = true; + frameSteps.update.process(frameData); + frameSteps.preRender.process(frameData); + frameSteps.render.process(frameData); + frameData.isProcessing = false; +} +function getProjectionParent(element) { + let ancestor = element.parentElement; + while (ancestor) { + const node = layoutNodes.get(ancestor); + if (node && node.instance) + return node; + ancestor = ancestor.parentElement; + } + return undefined; +} +function createVisualElement() { + return new HTMLVisualElement({ + props: {}, + presenceContext: null, + visualState: { + latestValues: {}, + renderState: { + transform: {}, + transformOrigin: {}, + style: {}, + vars: {}, + }, + }, + }, { allowProjection: true }); +} +function readNodeOptions(element, transition) { + const layoutAttr = element.getAttribute("data-layout"); + const layoutId = element.getAttribute("data-layout-id") ?? undefined; + return { + layoutId, + layout: layoutAttr !== null ? true : undefined, + animationType: (!layoutAttr || layoutAttr === "true" + ? "both" + : layoutAttr), + transition, + }; +} +function prepareNode(element, transition) { + let node = layoutNodes.get(element); + if (!node) { + let visualElement = visualElementStore.get(element); + if (!visualElement) + visualElement = createVisualElement(); + /** + * A first-time element may carry a projection transform in its + * inline style (e.g. it was cloned from an element mid-animation). + * That transform isn't tracked in latestValues so the engine can't + * reset it before measuring - clear it now so the first layout + * measurement isn't inflated. + */ + if (element.style.transform && + !hasTransform(visualElement.latestValues)) { + element.style.transform = ""; + } + node = new HTMLProjectionNode(visualElement.latestValues, getProjectionParent(element)); + visualElement.projection = node; + node.setOptions({ + ...readNodeOptions(element, transition), + visualElement, + }); + node.mount(element); + layoutNodes.set(element, node); + } + else { + node.setOptions(readNodeOptions(element, transition)); + } + node.isPresent = true; + if (node.options.onExitComplete) { + node.setOptions({ onExitComplete: undefined }); + } + return node; +} +function sortDocumentOrder(elements) { + return [...elements].sort((a, b) => a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1); +} +function dropNode(element, node) { + node.setOptions({ onExitComplete: undefined }); + /** + * Stop any lingering animation so it can't leak into future updates. + * A follow node can share its currentAnimation with a surviving lead + * (via resumingFrom), in which case it isn't ours to stop. + */ + const stack = node.getStack(); + if (!stack || node.isLead()) + node.currentAnimation?.stop(); + node.unmount(); + layoutNodes.delete(element); +} +function flushPendingBuilders() { + const builders = pendingBuilders; + pendingBuilders = undefined; + flushPendingFrame(); + /** + * Discover and mount every node across all builders before snapshotting + * any of them. Mounting during an active update flags isLayoutDirty, + * which would make that node's own willUpdate skip its snapshot. + * Document order guarantees ancestors mount before descendants, even + * when they're discovered by different builders. + */ + const targets = new Map(); + for (const builder of builders) { + for (const element of builder.collectTargets()) { + const owners = targets.get(element); + owners ? owners.push(builder) : targets.set(element, [builder]); + } + } + const union = new Map(); + for (const element of sortDocumentOrder(targets.keys())) { + const owners = targets.get(element); + const node = prepareNode(element, owners[owners.length - 1].transitionFor(element)); + for (const owner of owners) + owner.adopt(element, node); + union.set(element, node); + } + union.forEach((node) => { + node.isLayoutDirty = false; + node.willUpdate(); + }); + const updatePromises = []; + for (const builder of builders) { + const result = builder.runUpdate(); + if (result) + updatePromises.push(result); + } + const commit = () => { + /** + * Process all additions before any removals so that, even across + * builders, a removed member knows whether a replacement with the + * same layoutId was added in this commit. + */ + const newMemberIds = new Set(); + for (const builder of builders) { + builder.reconcileAdditions(newMemberIds); + } + for (const builder of builders) { + builder.reconcileRemovals(newMemberIds); + } + let root; + union.forEach((node) => (root || (root = node.root))); + for (const builder of builders) + root || (root = builder.getRoot()); + root?.didUpdate(); + /** + * The root flushes the update on a microtask, synchronously + * processing the frame that creates the layout animations. Collect + * them in a later microtask step of the same pass. + */ + microtask.render(() => { + for (const builder of builders) + builder.finalize(); + }); + }; + updatePromises.length ? Promise.all(updatePromises).then(commit) : commit(); +} +class LayoutAnimationBuilder { + constructor(scope, updateDom, defaultOptions) { + this.scope = scope; + this.updateDom = updateDom; + this.defaultOptions = defaultOptions; + this.sharedTransitions = new Map(); + this.notifyReady = () => { }; + this.rejectReady = () => { }; + this.tracked = new Map(); + this.restorePoints = new Map(); + this.readyPromise = new Promise((resolve, reject) => { + this.notifyReady = resolve; + this.rejectReady = reject; + }); + if (!pendingBuilders) { + pendingBuilders = []; + queueMicrotask(flushPendingBuilders); + } + pendingBuilders.push(this); + } + shared(id, transition) { + this.sharedTransitions.set(id, transition); + return this; + } + then(resolve, reject) { + return this.readyPromise.then(resolve, reject); + } + transitionFor(element) { + const layoutId = element.getAttribute("data-layout-id"); + return ((layoutId && this.sharedTransitions.get(layoutId)) || + this.defaultOptions); + } + adopt(element, node) { + this.tracked.set(element, node); + this.restorePoints.set(element, { + parent: element.parentElement, + next: element.nextSibling, + }); + } + collectTargets() { + return collectLayoutElements(this.scope); + } + runUpdate() { + try { + const result = this.updateDom(); + if (result && typeof result.then === "function") { + return result.then(undefined, (error) => { + this.updateError = error; + }); + } + } + catch (error) { + this.updateError = error; + } + return undefined; + } + reconcileAdditions(newMemberIds) { + for (const element of collectLayoutElements(this.scope)) { + if (this.tracked.has(element)) + continue; + const node = prepareNode(element, this.transitionFor(element)); + this.adopt(element, node); + node.options.layoutId && newMemberIds.add(node.options.layoutId); + } + } + reconcileRemovals(newMemberIds) { + this.tracked.forEach((node, element) => { + if (element.isConnected) + return; + const restore = this.restorePoints.get(element); + this.restorePoints.delete(element); + const { layoutId } = node.options; + const stack = node.getStack(); + const hasSurvivor = stack && + stack.members.some((member) => member !== node && + member.instance + ?.isConnected); + /** + * A removed lead with a surviving stack member - and no + * replacement member added this commit - runs an exit + * crossfade: restore the element to its old position in the + * DOM, relegate it and let the survivor take over. It's + * removed again once the animation completes. + */ + if (layoutId && + node.isLead() && + hasSurvivor && + !newMemberIds.has(layoutId)) { + if (restore && restore.parent.isConnected) { + restore.parent.insertBefore(element, restore.next && restore.next.parentNode === restore.parent + ? restore.next + : null); + node.isPresent = false; + node.setOptions({ + onExitComplete: () => { + element.remove(); + dropNode(element, node); + }, + }); + if (node.relegate()) + return; + element.remove(); + } + } + dropNode(element, node); + this.tracked.delete(element); + }); + } + getRoot() { + let root; + this.tracked.forEach((node) => (root || (root = node.root))); + return root; + } + finalize() { + if (this.updateError) { + this.rejectReady(this.updateError); + return; + } + const animations = new Set(); + this.tracked.forEach((node) => { + if (node.instance && node.currentAnimation) { + animations.add(node.currentAnimation); + } + }); + this.notifyReady(new GroupAnimation([...animations])); + } +} +function parseAnimateLayoutArgs(scopeOrUpdateDom, updateDomOrOptions, options) { + if (typeof scopeOrUpdateDom === "function") { + return { + scope: document, + updateDom: scopeOrUpdateDom, + defaultOptions: updateDomOrOptions, + }; + } + const scope = scopeOrUpdateDom instanceof Document + ? scopeOrUpdateDom + : resolveElements(scopeOrUpdateDom)[0] ?? document; + return { + scope, + updateDom: updateDomOrOptions, + defaultOptions: options, + }; +} + +/** + * @deprecated + * + * Import as `frame` instead. + */ +const sync = frame; +/** + * @deprecated + * + * Use cancelFrame(callback) instead. + */ +const cancelSync = stepsOrder.reduce((acc, key) => { + acc[key] = (process) => cancelFrame(process); + return acc; +}, {}); + +exports.AsyncMotionValueAnimation = AsyncMotionValueAnimation; +exports.DOMKeyframesResolver = DOMKeyframesResolver; +exports.DOMVisualElement = DOMVisualElement; +exports.DocumentProjectionNode = DocumentProjectionNode; +exports.Feature = Feature; +exports.FlatTree = FlatTree; +exports.GroupAnimation = GroupAnimation; +exports.GroupAnimationWithThen = GroupAnimationWithThen; +exports.HTMLProjectionNode = HTMLProjectionNode; +exports.HTMLVisualElement = HTMLVisualElement; +exports.JSAnimation = JSAnimation; +exports.KeyframeResolver = KeyframeResolver; +exports.LayoutAnimationBuilder = LayoutAnimationBuilder; +exports.MotionValue = MotionValue; +exports.NativeAnimation = NativeAnimation; +exports.NativeAnimationExtended = NativeAnimationExtended; +exports.NativeAnimationWrapper = NativeAnimationWrapper; +exports.NodeStack = NodeStack; +exports.ObjectVisualElement = ObjectVisualElement; +exports.SVGVisualElement = SVGVisualElement; +exports.ViewTransitionBuilder = ViewTransitionBuilder; +exports.VisualElement = VisualElement; +exports.acceleratedValues = acceleratedValues; +exports.addAttrValue = addAttrValue; +exports.addDomEvent = addDomEvent; +exports.addScaleCorrector = addScaleCorrector; +exports.addStyleValue = addStyleValue; +exports.addValueToWillChange = addValueToWillChange; +exports.alpha = alpha; +exports.analyseComplexValue = analyseComplexValue; +exports.animateMotionValue = animateMotionValue; +exports.animateSingleValue = animateSingleValue; +exports.animateTarget = animateTarget; +exports.animateValue = animateValue; +exports.animateVariant = animateVariant; +exports.animateView = animateView; +exports.animateVisualElement = animateVisualElement; +exports.animationMapKey = animationMapKey; +exports.applyAxisDelta = applyAxisDelta; +exports.applyBoxDelta = applyBoxDelta; +exports.applyGeneratorOptions = applyGeneratorOptions; +exports.applyPointDelta = applyPointDelta; +exports.applyPxDefaults = applyPxDefaults; +exports.applyTreeDeltas = applyTreeDeltas; +exports.arc = arc; +exports.aspectRatio = aspectRatio; +exports.attachFollow = attachFollow; +exports.attachSpring = attachSpring; +exports.attrEffect = attrEffect; +exports.axisDeltaEquals = axisDeltaEquals; +exports.axisEquals = axisEquals; +exports.axisEqualsRounded = axisEqualsRounded; +exports.boxEquals = boxEquals; +exports.boxEqualsRounded = boxEqualsRounded; +exports.buildHTMLStyles = buildHTMLStyles; +exports.buildProjectionTransform = buildProjectionTransform; +exports.buildSVGAttrs = buildSVGAttrs; +exports.buildSVGPath = buildSVGPath; +exports.buildTransform = buildTransform; +exports.calcAxisDelta = calcAxisDelta; +exports.calcBoxDelta = calcBoxDelta; +exports.calcChildStagger = calcChildStagger; +exports.calcGeneratorDuration = calcGeneratorDuration; +exports.calcLength = calcLength; +exports.calcRelativeAxis = calcRelativeAxis; +exports.calcRelativeAxisPosition = calcRelativeAxisPosition; +exports.calcRelativeBox = calcRelativeBox; +exports.calcRelativePosition = calcRelativePosition; +exports.camelCaseAttributes = camelCaseAttributes; +exports.camelToDash = camelToDash; +exports.cancelFrame = cancelFrame; +exports.cancelMicrotask = cancelMicrotask; +exports.cancelSync = cancelSync; +exports.checkVariantsDidChange = checkVariantsDidChange; +exports.cleanDirtyNodes = cleanDirtyNodes; +exports.collectMotionValues = collectMotionValues; +exports.color = color; +exports.compareByDepth = compareByDepth; +exports.complex = complex; +exports.containsCSSVariable = containsCSSVariable; +exports.convertBoundingBoxToBox = convertBoundingBoxToBox; +exports.convertBoxToBoundingBox = convertBoxToBoundingBox; +exports.convertOffsetToTimes = convertOffsetToTimes; +exports.copyAxisDeltaInto = copyAxisDeltaInto; +exports.copyAxisInto = copyAxisInto; +exports.copyBoxInto = copyBoxInto; +exports.correctBorderRadius = correctBorderRadius; +exports.correctBoxShadow = correctBoxShadow; +exports.createAnimationState = createAnimationState; +exports.createAxis = createAxis; +exports.createAxisDelta = createAxisDelta; +exports.createBox = createBox; +exports.createDelta = createDelta; +exports.createGeneratorEasing = createGeneratorEasing; +exports.createProjectionNode = createProjectionNode; +exports.createRenderBatcher = createRenderBatcher; +exports.cubicBezierAsString = cubicBezierAsString; +exports.defaultEasing = defaultEasing; +exports.defaultOffset = defaultOffset; +exports.defaultTransformValue = defaultTransformValue; +exports.defaultValueTypes = defaultValueTypes; +exports.degrees = degrees; +exports.delay = delay; +exports.delayInSeconds = delayInSeconds; +exports.dimensionValueTypes = dimensionValueTypes; +exports.eachAxis = eachAxis; +exports.fillOffset = fillOffset; +exports.fillWildcards = fillWildcards; +exports.findDimensionValueType = findDimensionValueType; +exports.findValueType = findValueType; +exports.flushKeyframeResolvers = flushKeyframeResolvers; +exports.followValue = followValue; +exports.frame = frame; +exports.frameData = frameData; +exports.frameSteps = frameSteps; +exports.generateLinearEasing = generateLinearEasing; +exports.getAnimatableNone = getAnimatableNone; +exports.getAnimationMap = getAnimationMap; +exports.getComputedStyle = getComputedStyle$2; +exports.getDefaultTransition = getDefaultTransition; +exports.getDefaultValueType = getDefaultValueType; +exports.getFeatureDefinitions = getFeatureDefinitions; +exports.getFinalKeyframe = getFinalKeyframe; +exports.getMixer = getMixer; +exports.getOptimisedAppearId = getOptimisedAppearId; +exports.getOriginIndex = getOriginIndex; +exports.getValueAsType = getValueAsType; +exports.getValueTransition = getValueTransition; +exports.getVariableValue = getVariableValue; +exports.getVariantContext = getVariantContext; +exports.getViewAnimationLayerInfo = getViewAnimationLayerInfo; +exports.getViewAnimations = getViewAnimations; +exports.globalProjectionState = globalProjectionState; +exports.has2DTranslate = has2DTranslate; +exports.hasReducedMotionListener = hasReducedMotionListener; +exports.hasScale = hasScale; +exports.hasTransform = hasTransform; +exports.hex = hex; +exports.hover = hover; +exports.hsla = hsla; +exports.hslaToRgba = hslaToRgba; +exports.inertia = inertia; +exports.initPrefersReducedMotion = initPrefersReducedMotion; +exports.interpolate = interpolate; +exports.invisibleValues = invisibleValues; +exports.isAnimationControls = isAnimationControls; +exports.isCSSVariableName = isCSSVariableName; +exports.isCSSVariableToken = isCSSVariableToken; +exports.isControllingVariants = isControllingVariants; +exports.isDeltaZero = isDeltaZero; +exports.isDragActive = isDragActive; +exports.isDragging = isDragging; +exports.isElementKeyboardAccessible = isElementKeyboardAccessible; +exports.isElementTextInput = isElementTextInput; +exports.isForcedMotionValue = isForcedMotionValue; +exports.isGenerator = isGenerator; +exports.isHTMLElement = isHTMLElement; +exports.isKeyframesTarget = isKeyframesTarget; +exports.isMotionValue = isMotionValue; +exports.isNear = isNear; +exports.isNodeOrChild = isNodeOrChild; +exports.isPrimaryPointer = isPrimaryPointer; +exports.isSVGElement = isSVGElement; +exports.isSVGSVGElement = isSVGSVGElement; +exports.isSVGTag = isSVGTag; +exports.isTransitionDefined = isTransitionDefined; +exports.isVariantLabel = isVariantLabel; +exports.isVariantNode = isVariantNode; +exports.isWaapiSupportedEasing = isWaapiSupportedEasing; +exports.isWillChangeMotionValue = isWillChangeMotionValue; +exports.keyframes = keyframes; +exports.makeAnimationInstant = makeAnimationInstant; +exports.mapEasingToNativeEasing = mapEasingToNativeEasing; +exports.mapValue = mapValue; +exports.maxGeneratorDuration = maxGeneratorDuration; +exports.measurePageBox = measurePageBox; +exports.measureViewportBox = measureViewportBox; +exports.microtask = microtask; +exports.mix = mix; +exports.mixArray = mixArray; +exports.mixColor = mixColor; +exports.mixComplex = mixComplex; +exports.mixImmediate = mixImmediate; +exports.mixLinearColor = mixLinearColor; +exports.mixNumber = mixNumber$1; +exports.mixObject = mixObject; +exports.mixValues = mixValues; +exports.mixVisibility = mixVisibility; +exports.motionValue = motionValue; +exports.nodeGroup = nodeGroup; +exports.number = number; +exports.numberValueTypes = numberValueTypes; +exports.observeTimeline = observeTimeline; +exports.optimizedAppearDataAttribute = optimizedAppearDataAttribute; +exports.optimizedAppearDataId = optimizedAppearDataId; +exports.parseAnimateLayoutArgs = parseAnimateLayoutArgs; +exports.parseCSSVariable = parseCSSVariable; +exports.parseValueFromTransform = parseValueFromTransform; +exports.percent = percent; +exports.pixelsToPercent = pixelsToPercent; +exports.positionalKeys = positionalKeys; +exports.prefersReducedMotion = prefersReducedMotion; +exports.press = press; +exports.progressPercentage = progressPercentage; +exports.propEffect = propEffect; +exports.propagateDirtyNodes = propagateDirtyNodes; +exports.px = px; +exports.readTransformValue = readTransformValue; +exports.recordStats = recordStats; +exports.removeAxisDelta = removeAxisDelta; +exports.removeAxisTransforms = removeAxisTransforms; +exports.removeBoxTransforms = removeBoxTransforms; +exports.removePointDelta = removePointDelta; +exports.renderHTML = renderHTML; +exports.renderSVG = renderSVG; +exports.resize = resize; +exports.resolveElements = resolveElements; +exports.resolveMotionValue = resolveMotionValue; +exports.resolveTransition = resolveTransition; +exports.resolveVariant = resolveVariant; +exports.resolveVariantFromProps = resolveVariantFromProps; +exports.rgbUnit = rgbUnit; +exports.rgba = rgba; +exports.rootProjectionNode = rootProjectionNode; +exports.scale = scale; +exports.scaleCorrectors = scaleCorrectors; +exports.scalePoint = scalePoint; +exports.scrapeHTMLMotionValuesFromProps = scrapeMotionValuesFromProps$1; +exports.scrapeSVGMotionValuesFromProps = scrapeMotionValuesFromProps; +exports.setDragLock = setDragLock; +exports.setFeatureDefinitions = setFeatureDefinitions; +exports.setStyle = setStyle; +exports.setTarget = setTarget; +exports.spring = spring; +exports.springValue = springValue; +exports.stagger = stagger; +exports.startWaapiAnimation = startWaapiAnimation; +exports.statsBuffer = statsBuffer; +exports.styleEffect = styleEffect; +exports.supportedWaapiEasing = supportedWaapiEasing; +exports.supportsBrowserAnimation = supportsBrowserAnimation; +exports.supportsFlags = supportsFlags; +exports.supportsLinearEasing = supportsLinearEasing; +exports.supportsPartialKeyframes = supportsPartialKeyframes; +exports.supportsScrollTimeline = supportsScrollTimeline; +exports.supportsViewTimeline = supportsViewTimeline; +exports.svgEffect = svgEffect; +exports.sync = sync; +exports.testValueType = testValueType; +exports.time = time; +exports.transform = transform; +exports.transformAxis = transformAxis; +exports.transformBox = transformBox; +exports.transformBoxPoints = transformBoxPoints; +exports.transformPropOrder = transformPropOrder; +exports.transformProps = transformProps; +exports.transformValue = transformValue; +exports.transformValueTypes = transformValueTypes; +exports.translateAxis = translateAxis; +exports.updateMotionValuesFromProps = updateMotionValuesFromProps; +exports.variantPriorityOrder = variantPriorityOrder; +exports.variantProps = variantProps; +exports.vh = vh; +exports.visualElementStore = visualElementStore; +exports.vw = vw; +//# sourceMappingURL=index.js.map diff --git a/node_modules/motion-dom/dist/cjs/index.js.map b/node_modules/motion-dom/dist/cjs/index.js.map new file mode 100644 index 0000000..5339345 --- /dev/null +++ b/node_modules/motion-dom/dist/cjs/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sources":["../../src/frameloop/order.ts","../../src/frameloop/render-step.ts","../../src/frameloop/batcher.ts","../../src/frameloop/frame.ts","../../src/frameloop/sync-time.ts","../../src/animation/utils/is-css-variable.ts","../../src/value/types/numbers/index.ts","../../src/value/types/utils/sanitize.ts","../../src/value/types/utils/float-regex.ts","../../src/value/types/utils/is-nullish.ts","../../src/value/types/utils/single-color-regex.ts","../../src/value/types/color/utils.ts","../../src/value/types/color/rgba.ts","../../src/value/types/color/hex.ts","../../src/value/types/numbers/units.ts","../../src/value/types/color/hsla.ts","../../src/value/types/color/index.ts","../../src/value/types/utils/color-regex.ts","../../src/value/types/complex/index.ts","../../src/value/types/color/hsla-to-rgba.ts","../../src/utils/mix/immediate.ts","../../src/utils/mix/number.ts","../../src/utils/mix/color.ts","../../src/utils/mix/visibility.ts","../../src/utils/mix/complex.ts","../../src/utils/mix/index.ts","../../src/animation/drivers/frame.ts","../../src/animation/waapi/utils/linear.ts","../../src/animation/generators/utils/calc-duration.ts","../../src/animation/generators/utils/create-generator-easing.ts","../../src/animation/generators/spring.ts","../../src/animation/generators/utils/velocity.ts","../../src/animation/generators/inertia.ts","../../src/utils/interpolate.ts","../../src/animation/keyframes/offsets/fill.ts","../../src/animation/keyframes/offsets/default.ts","../../src/animation/keyframes/offsets/time.ts","../../src/animation/generators/keyframes.ts","../../src/animation/keyframes/get-final.ts","../../src/animation/utils/replace-transition-type.ts","../../src/animation/utils/WithPromise.ts","../../src/animation/JSAnimation.ts","../../src/animation/keyframes/utils/fill-wildcards.ts","../../src/render/dom/parse-transform.ts","../../src/render/utils/keys-transform.ts","../../src/animation/keyframes/utils/unit-conversion.ts","../../src/animation/keyframes/KeyframesResolver.ts","../../src/render/dom/is-css-var.ts","../../src/render/dom/style-set.ts","../../src/utils/supports/flags.ts","../../src/utils/supports/memo.ts","../../src/utils/supports/scroll-timeline.ts","../../src/utils/supports/linear-easing.ts","../../src/animation/waapi/easing/cubic-bezier.ts","../../src/animation/waapi/easing/supported.ts","../../src/animation/waapi/easing/map-easing.ts","../../src/animation/waapi/start-waapi-animation.ts","../../src/animation/generators/utils/is-generator.ts","../../src/animation/waapi/utils/apply-generator.ts","../../src/animation/NativeAnimation.ts","../../src/animation/waapi/utils/unsupported-easing.ts","../../src/animation/NativeAnimationExtended.ts","../../src/animation/utils/is-animatable.ts","../../src/animation/utils/can-animate.ts","../../src/animation/utils/make-animation-instant.ts","../../src/animation/waapi/utils/accelerated-values.ts","../../src/animation/waapi/utils/is-browser-color.ts","../../src/animation/waapi/supports/waapi.ts","../../src/animation/AsyncMotionValueAnimation.ts","../../src/animation/GroupAnimation.ts","../../src/animation/GroupAnimationWithThen.ts","../../src/animation/NativeAnimationWrapper.ts","../../src/animation/utils/active-animations.ts","../../src/animation/utils/calc-child-stagger.ts","../../src/value/index.ts","../../src/animation/utils/resolve-transition.ts","../../src/animation/utils/get-value-transition.ts","../../src/animation/utils/default-transitions.ts","../../src/animation/utils/is-transition-defined.ts","../../src/animation/interfaces/motion-value.ts","../../src/animation/utils/arc.ts","../../src/animation/utils/css-variables-conversion.ts","../../src/render/utils/resolve-variants.ts","../../src/render/utils/resolve-dynamic-variants.ts","../../src/render/utils/keys-position.ts","../../src/render/utils/is-keyframes-target.ts","../../src/render/utils/setters.ts","../../src/value/utils/is-motion-value.ts","../../src/value/will-change/is.ts","../../src/value/will-change/add-will-change.ts","../../src/render/dom/utils/camel-to-dash.ts","../../src/animation/optimized-appear/data-id.ts","../../src/animation/optimized-appear/get-appear-id.ts","../../src/animation/interfaces/visual-element-target.ts","../../src/animation/interfaces/visual-element-variant.ts","../../src/animation/interfaces/visual-element.ts","../../src/value/types/auto.ts","../../src/value/types/test.ts","../../src/value/types/dimensions.ts","../../src/animation/keyframes/utils/is-none.ts","../../src/value/types/complex/filter.ts","../../src/value/types/complex/mask.ts","../../src/value/types/int.ts","../../src/value/types/maps/transform.ts","../../src/value/types/maps/number.ts","../../src/value/types/maps/defaults.ts","../../src/value/types/utils/animatable-none.ts","../../src/animation/keyframes/utils/make-none-animatable.ts","../../src/animation/keyframes/DOMKeyframesResolver.ts","../../src/utils/border-radius.ts","../../src/animation/waapi/utils/px-values.ts","../../src/animation/keyframes/utils/apply-px-defaults.ts","../../src/animation/waapi/easing/is-supported.ts","../../src/animation/waapi/supports/partial-keyframes.ts","../../src/utils/resolve-elements.ts","../../src/effects/utils/create-dom-effect.ts","../../src/value/types/utils/get-as-type.ts","../../src/effects/MotionValueState.ts","../../src/effects/utils/create-effect.ts","../../src/effects/attr/index.ts","../../src/effects/prop/index.ts","../../src/utils/is-html-element.ts","../../src/effects/style/transform.ts","../../src/effects/style/index.ts","../../src/effects/svg/index.ts","../../src/frameloop/microtask.ts","../../src/gestures/drag/state/is-active.ts","../../src/gestures/drag/state/set-active.ts","../../src/gestures/utils/setup.ts","../../src/gestures/hover.ts","../../src/gestures/utils/is-node-or-child.ts","../../src/gestures/utils/is-primary-pointer.ts","../../src/gestures/press/utils/is-keyboard-accessible.ts","../../src/gestures/press/utils/state.ts","../../src/gestures/press/utils/keyboard.ts","../../src/gestures/press/index.ts","../../src/render/dom/style-computed.ts","../../src/utils/is-svg-element.ts","../../src/resize/handle-element.ts","../../src/resize/handle-window.ts","../../src/resize/index.ts","../../src/scroll/observe.ts","../../src/stats/buffer.ts","../../src/stats/index.ts","../../src/utils/is-svg-svg-element.ts","../../src/utils/stagger.ts","../../src/utils/transform.ts","../../src/value/follow-value.ts","../../src/value/subscribe-value.ts","../../src/value/transform-value.ts","../../src/value/map-value.ts","../../src/value/spring-value.ts","../../src/value/types/utils/find.ts","../../src/view/utils/assign-names.ts","../../src/view/utils/choose-layer-type.ts","../../src/view/utils/css.ts","../../src/view/utils/get-layer-info.ts","../../src/view/utils/get-view-animations.ts","../../src/view/utils/has-target.ts","../../src/view/start.ts","../../src/view/queue.ts","../../src/view/index.ts","../../src/projection/geometry/models.ts","../../src/render/store.ts","../../src/render/utils/is-animation-controls.ts","../../src/render/utils/is-variant-label.ts","../../src/render/utils/variant-props.ts","../../src/render/utils/is-controlling-variants.ts","../../src/render/utils/motion-values.ts","../../src/render/utils/reduced-motion/state.ts","../../src/render/utils/reduced-motion/index.ts","../../src/render/VisualElement.ts","../../src/render/dom/DOMVisualElement.ts","../../src/render/Feature.ts","../../src/projection/geometry/conversion.ts","../../src/projection/utils/has-transform.ts","../../src/projection/geometry/delta-apply.ts","../../src/projection/utils/measure.ts","../../src/render/html/utils/build-transform.ts","../../src/render/html/utils/build-styles.ts","../../src/render/html/utils/render.ts","../../src/projection/styles/scale-border-radius.ts","../../src/projection/styles/scale-box-shadow.ts","../../src/projection/styles/scale-correction.ts","../../src/render/utils/is-forced-motion-value.ts","../../src/render/html/utils/scrape-motion-values.ts","../../src/render/html/HTMLVisualElement.ts","../../src/render/object/ObjectVisualElement.ts","../../src/render/svg/utils/path.ts","../../src/render/svg/utils/build-attrs.ts","../../src/render/svg/utils/camel-case-attrs.ts","../../src/render/svg/utils/is-svg-tag.ts","../../src/render/svg/utils/render.ts","../../src/render/svg/utils/scrape-motion-values.ts","../../src/render/svg/SVGVisualElement.ts","../../src/render/utils/get-variant-context.ts","../../src/render/utils/shallow-compare.ts","../../src/render/utils/animation-state.ts","../../src/projection/geometry/copy.ts","../../src/projection/geometry/delta-calc.ts","../../src/projection/geometry/delta-remove.ts","../../src/projection/geometry/utils.ts","../../src/projection/utils/each-axis.ts","../../src/projection/styles/transform.ts","../../src/projection/animation/mix-values.ts","../../src/animation/animate/single-value.ts","../../src/events/add-dom-event.ts","../../src/projection/utils/compare-by-depth.ts","../../src/projection/utils/flat-tree.ts","../../src/utils/delay.ts","../../src/value/utils/resolve-motion-value.ts","../../src/projection/shared/stack.ts","../../src/projection/node/state.ts","../../src/projection/node/create-projection-node.ts","../../src/projection/node/DocumentProjectionNode.ts","../../src/projection/node/group.ts","../../src/projection/node/HTMLProjectionNode.ts","../../src/layout/LayoutAnimationBuilder.ts","../../src/frameloop/index-legacy.ts"],"sourcesContent":["import { StepId } from \"./types\"\n\nexport const stepsOrder: StepId[] = [\n \"setup\", // Compute\n \"read\", // Read\n \"resolveKeyframes\", // Write/Read/Write/Read\n \"preUpdate\", // Compute\n \"update\", // Compute\n \"preRender\", // Compute\n \"render\", // Write\n \"postRender\", // Compute\n] as const\n\nexport type StepNames = (typeof stepsOrder)[number]\n","import { FrameData, Process, Step } from \"./types\"\n\nexport function createRenderStep(runNextFrame: () => void): Step {\n /**\n * We create and reuse two queues, one to queue jobs for the current frame\n * and one for the next. We reuse to avoid triggering GC after x frames.\n */\n let thisFrame = new Set()\n let nextFrame = new Set()\n\n /**\n * Track whether we're currently processing jobs in this step. This way\n * we can decide whether to schedule new jobs for this frame or next.\n */\n let isProcessing = false\n\n let flushNextFrame = false\n\n /**\n * A set of processes which were marked keepAlive when scheduled.\n */\n const toKeepAlive = new WeakSet()\n\n let latestFrameData: FrameData = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n }\n\n function triggerCallback(callback: Process) {\n if (toKeepAlive.has(callback)) {\n step.schedule(callback)\n runNextFrame()\n }\n\n callback(latestFrameData)\n }\n\n const step: Step = {\n /**\n * Schedule a process to run on the next frame.\n */\n schedule: (callback, keepAlive = false, immediate = false) => {\n const addToCurrentFrame = immediate && isProcessing\n const queue = addToCurrentFrame ? thisFrame : nextFrame\n\n if (keepAlive) toKeepAlive.add(callback)\n\n queue.add(callback)\n\n return callback\n },\n\n /**\n * Cancel the provided callback from running on the next frame.\n */\n cancel: (callback) => {\n nextFrame.delete(callback)\n toKeepAlive.delete(callback)\n },\n\n /**\n * Execute all schedule callbacks.\n */\n process: (frameData) => {\n latestFrameData = frameData\n\n /**\n * If we're already processing we've probably been triggered by a flushSync\n * inside an existing process. Instead of executing, mark flushNextFrame\n * as true and ensure we flush the following frame at the end of this one.\n */\n if (isProcessing) {\n flushNextFrame = true\n return\n }\n\n isProcessing = true\n\n // Swap this frame and the next to avoid GC\n const prevFrame = thisFrame\n thisFrame = nextFrame\n nextFrame = prevFrame\n\n // Execute this frame\n thisFrame.forEach(triggerCallback)\n\n // Clear the frame so no callbacks remain. This is to avoid\n // memory leaks should this render step not run for a while.\n thisFrame.clear()\n\n isProcessing = false\n\n if (flushNextFrame) {\n flushNextFrame = false\n step.process(frameData)\n }\n },\n }\n\n return step\n}\n","import { MotionGlobalConfig } from \"motion-utils\"\nimport { stepsOrder } from \"./order\"\nimport { createRenderStep } from \"./render-step\"\nimport { Batcher, FrameData, Process, Steps } from \"./types\"\n\nconst maxElapsed = 40\n\nexport function createRenderBatcher(\n scheduleNextBatch: (callback: Function) => void,\n allowKeepAlive: boolean\n) {\n let runNextFrame = false\n let useDefaultElapsed = true\n\n const state: FrameData = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n }\n\n const flagRunNextFrame = () => (runNextFrame = true)\n\n const steps = stepsOrder.reduce((acc, key) => {\n acc[key] = createRenderStep(flagRunNextFrame)\n return acc\n }, {} as Steps)\n\n const {\n setup,\n read,\n resolveKeyframes,\n preUpdate,\n update,\n preRender,\n render,\n postRender,\n } = steps\n\n const processBatch = () => {\n const useManualTiming = MotionGlobalConfig.useManualTiming\n const timestamp = useManualTiming\n ? state.timestamp\n : performance.now()\n runNextFrame = false\n\n if (!useManualTiming) {\n state.delta = useDefaultElapsed\n ? 1000 / 60\n : Math.max(Math.min(timestamp - state.timestamp, maxElapsed), 1)\n }\n\n state.timestamp = timestamp\n state.isProcessing = true\n\n // Unrolled render loop for better per-frame performance\n setup.process(state)\n read.process(state)\n resolveKeyframes.process(state)\n preUpdate.process(state)\n update.process(state)\n preRender.process(state)\n render.process(state)\n postRender.process(state)\n\n state.isProcessing = false\n\n if (runNextFrame && allowKeepAlive) {\n useDefaultElapsed = false\n scheduleNextBatch(processBatch)\n }\n }\n\n const wake = () => {\n runNextFrame = true\n useDefaultElapsed = true\n\n if (!state.isProcessing) {\n scheduleNextBatch(processBatch)\n }\n }\n\n const schedule = stepsOrder.reduce((acc, key) => {\n const step = steps[key]\n acc[key] = (process: Process, keepAlive = false, immediate = false) => {\n if (!runNextFrame) wake()\n\n return step.schedule(process, keepAlive, immediate)\n }\n return acc\n }, {} as Batcher)\n\n const cancel = (process: Process) => {\n for (let i = 0; i < stepsOrder.length; i++) {\n steps[stepsOrder[i]].cancel(process)\n }\n }\n\n return { schedule, cancel, state, steps }\n}\n","import { noop } from \"motion-utils\"\nimport { createRenderBatcher } from \"./batcher\"\n\nexport const {\n schedule: frame,\n cancel: cancelFrame,\n state: frameData,\n steps: frameSteps,\n} = /* @__PURE__ */ createRenderBatcher(\n typeof requestAnimationFrame !== \"undefined\" ? requestAnimationFrame : noop,\n true\n)\n","import { MotionGlobalConfig } from \"motion-utils\"\nimport { frameData } from \"./frame\"\n\nlet now: number | undefined\n\nfunction clearTime() {\n now = undefined\n}\n\n/**\n * An eventloop-synchronous alternative to performance.now().\n *\n * Ensures that time measurements remain consistent within a synchronous context.\n * Usually calling performance.now() twice within the same synchronous context\n * will return different values which isn't useful for animations when we're usually\n * trying to sync animations to the same frame.\n */\nexport const time = {\n now: (): number => {\n if (now === undefined) {\n time.set(\n frameData.isProcessing || MotionGlobalConfig.useManualTiming\n ? frameData.timestamp\n : performance.now()\n )\n }\n\n return now!\n },\n set: (newTime: number) => {\n now = newTime\n queueMicrotask(clearTime)\n },\n}\n","import { AnyResolvedKeyframe } from \"../types\"\n\nexport type CSSVariableName = `--${string}`\n\nexport type CSSVariableToken = `var(${CSSVariableName})`\n\nconst checkStringStartsWith =\n (token: string) =>\n (key?: AnyResolvedKeyframe | null): key is T =>\n typeof key === \"string\" && key.startsWith(token)\n\nexport const isCSSVariableName =\n /*@__PURE__*/ checkStringStartsWith(\"--\")\n\nconst startsAsVariableToken =\n /*@__PURE__*/ checkStringStartsWith(\"var(--\")\nexport const isCSSVariableToken = (\n value?: string\n): value is CSSVariableToken => {\n const startsWithToken = startsAsVariableToken(value)\n\n if (!startsWithToken) return false\n\n // Ensure any comments are stripped from the value as this can harm performance of the regex.\n return singleCssVariableRegex.test(value.split(\"/*\")[0].trim())\n}\n\nconst singleCssVariableRegex =\n /var\\(--(?:[\\w-]+\\s*|[\\w-]+\\s*,(?:\\s*[^)(\\s]|\\s*\\((?:[^)(]|\\([^)(]*\\))*\\))+\\s*)\\)$/iu\n\n/**\n * Check if a value contains a CSS variable anywhere (e.g. inside calc()).\n * Unlike isCSSVariableToken which checks if the value IS a var() token,\n * this checks if the value CONTAINS var() somewhere in the string.\n */\nexport function containsCSSVariable(\n value?: AnyResolvedKeyframe | null\n): boolean {\n if (typeof value !== \"string\") return false\n // Strip comments to avoid false positives\n return value.split(\"/*\")[0].includes(\"var(--\")\n}\n","import { clamp } from \"motion-utils\"\n\nexport const number = {\n test: (v: number) => typeof v === \"number\",\n parse: parseFloat,\n transform: (v: number) => v,\n}\n\nexport const alpha = {\n ...number,\n transform: (v: number) => clamp(0, 1, v),\n}\n\nexport const scale = {\n ...number,\n default: 1,\n}\n","// If this number is a decimal, make it just five decimal places\n// to avoid exponents\nexport const sanitize = (v: number) => Math.round(v * 100000) / 100000\n","export const floatRegex = /-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)/gu\n","export function isNullish(v: any): v is null | undefined {\n return v == null\n}\n","export const singleColorRegex =\n /^(?:#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\))$/iu\n","import { Color, HSLA, RGBA } from \"../types\"\nimport { floatRegex } from \"../utils/float-regex\"\nimport { isNullish } from \"../utils/is-nullish\"\nimport { singleColorRegex } from \"../utils/single-color-regex\"\n\n/**\n * Returns true if the provided string is a color, ie rgba(0,0,0,0) or #000,\n * but false if a number or multiple colors\n */\nexport const isColorString = (type: string, testProp?: string) => (v: any) => {\n return Boolean(\n (typeof v === \"string\" &&\n singleColorRegex.test(v) &&\n v.startsWith(type)) ||\n (testProp &&\n !isNullish(v) &&\n Object.prototype.hasOwnProperty.call(v, testProp))\n )\n}\n\nexport const splitColor =\n (aName: string, bName: string, cName: string) =>\n (v: string | Color): V => {\n if (typeof v !== \"string\") return v as any\n\n const [a, b, c, alpha] = v.match(floatRegex) as any\n\n return {\n [aName]: parseFloat(a),\n [bName]: parseFloat(b),\n [cName]: parseFloat(c),\n alpha: alpha !== undefined ? parseFloat(alpha) : 1,\n } as V\n }\n","import { clamp } from \"motion-utils\"\nimport { alpha as alphaType, number } from \"../numbers\"\nimport { RGBA } from \"../types\"\nimport { sanitize } from \"../utils/sanitize\"\nimport { isColorString, splitColor } from \"./utils\"\n\nconst clampRgbUnit = (v: number) => clamp(0, 255, v)\nexport const rgbUnit = {\n ...number,\n transform: (v: number) => Math.round(clampRgbUnit(v)),\n}\n\nexport const rgba = {\n test: /*@__PURE__*/ isColorString(\"rgb\", \"red\"),\n parse: /*@__PURE__*/ splitColor(\"red\", \"green\", \"blue\"),\n transform: ({ red, green, blue, alpha = 1 }: RGBA) =>\n \"rgba(\" +\n rgbUnit.transform(red) +\n \", \" +\n rgbUnit.transform(green) +\n \", \" +\n rgbUnit.transform(blue) +\n \", \" +\n sanitize(alphaType.transform(alpha)) +\n \")\",\n}\n","import { RGBA } from \"../types\"\nimport { rgba } from \"./rgba\"\nimport { isColorString } from \"./utils\"\n\nfunction parseHex(v: string): RGBA {\n let r = \"\"\n let g = \"\"\n let b = \"\"\n let a = \"\"\n\n // If we have 6 characters, ie #FF0000\n if (v.length > 5) {\n r = v.substring(1, 3)\n g = v.substring(3, 5)\n b = v.substring(5, 7)\n a = v.substring(7, 9)\n\n // Or we have 3 characters, ie #F00\n } else {\n r = v.substring(1, 2)\n g = v.substring(2, 3)\n b = v.substring(3, 4)\n a = v.substring(4, 5)\n r += r\n g += g\n b += b\n a += a\n }\n\n return {\n red: parseInt(r, 16),\n green: parseInt(g, 16),\n blue: parseInt(b, 16),\n alpha: a ? parseInt(a, 16) / 255 : 1,\n }\n}\n\nexport const hex = {\n test: /*@__PURE__*/ isColorString(\"#\"),\n parse: parseHex,\n transform: rgba.transform,\n}\n","import { AnyResolvedKeyframe } from \"../../../animation/types\"\n\n/*#__NO_SIDE_EFFECTS__*/\nconst createUnitType = (unit: string) => ({\n test: (v: AnyResolvedKeyframe) =>\n typeof v === \"string\" && v.endsWith(unit) && v.split(\" \").length === 1,\n parse: parseFloat,\n transform: (v: number | string) => `${v}${unit}`,\n})\n\nexport const degrees = /*@__PURE__*/ createUnitType(\"deg\")\nexport const percent = /*@__PURE__*/ createUnitType(\"%\")\nexport const px = /*@__PURE__*/ createUnitType(\"px\")\nexport const vh = /*@__PURE__*/ createUnitType(\"vh\")\nexport const vw = /*@__PURE__*/ createUnitType(\"vw\")\n\nexport const progressPercentage = /*@__PURE__*/ (() => ({\n ...percent,\n parse: (v: string) => percent.parse(v) / 100,\n transform: (v: number) => percent.transform(v * 100),\n}))()\n","import { alpha as alphaType } from \"../numbers\"\nimport { percent } from \"../numbers/units\"\nimport { HSLA } from \"../types\"\nimport { sanitize } from \"../utils/sanitize\"\nimport { isColorString, splitColor } from \"./utils\"\n\nexport const hsla = {\n test: /*@__PURE__*/ isColorString(\"hsl\", \"hue\"),\n parse: /*@__PURE__*/ splitColor(\"hue\", \"saturation\", \"lightness\"),\n transform: ({ hue, saturation, lightness, alpha = 1 }: HSLA) => {\n return (\n \"hsla(\" +\n Math.round(hue) +\n \", \" +\n percent.transform(sanitize(saturation)) +\n \", \" +\n percent.transform(sanitize(lightness)) +\n \", \" +\n sanitize(alphaType.transform(alpha)) +\n \")\"\n )\n },\n}\n","import { HSLA, RGBA } from \"../types\"\nimport { hex } from \"./hex\"\nimport { hsla } from \"./hsla\"\nimport { rgba } from \"./rgba\"\n\nexport const color = {\n test: (v: any) => rgba.test(v) || hex.test(v) || hsla.test(v),\n parse: (v: any): RGBA | HSLA => {\n if (rgba.test(v)) {\n return rgba.parse(v)\n } else if (hsla.test(v)) {\n return hsla.parse(v)\n } else {\n return hex.parse(v)\n }\n },\n transform: (v: HSLA | RGBA | string) => {\n return typeof v === \"string\"\n ? v\n : v.hasOwnProperty(\"red\")\n ? rgba.transform(v as RGBA)\n : hsla.transform(v as HSLA)\n },\n getAnimatableNone: (v: string) => {\n const parsed = color.parse(v)\n parsed.alpha = 0\n return color.transform(parsed)\n },\n}\n","export const colorRegex =\n /(?:#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\))/giu\n","import { AnyResolvedKeyframe } from \"../../../animation/types\"\nimport { CSSVariableToken } from \"../../../animation/utils/is-css-variable\"\nimport { color } from \"../color\"\nimport { Color } from \"../types\"\nimport { colorRegex } from \"../utils/color-regex\"\nimport { floatRegex } from \"../utils/float-regex\"\nimport { sanitize } from \"../utils/sanitize\"\n\nfunction test(v: any) {\n return (\n isNaN(v) &&\n typeof v === \"string\" &&\n (v.match(floatRegex)?.length || 0) +\n (v.match(colorRegex)?.length || 0) >\n 0\n )\n}\n\nconst NUMBER_TOKEN = \"number\"\nconst COLOR_TOKEN = \"color\"\nconst VAR_TOKEN = \"var\"\nconst VAR_FUNCTION_TOKEN = \"var(\"\nconst SPLIT_TOKEN = \"${}\"\n\nexport type ComplexValues = Array<\n CSSVariableToken | AnyResolvedKeyframe | Color\n>\n\nexport interface ValueIndexes {\n color: number[]\n number: number[]\n var: number[]\n}\n\nexport interface ComplexValueInfo {\n values: ComplexValues\n split: string[]\n indexes: ValueIndexes\n types: Array\n}\n\n// this regex consists of the `singleCssVariableRegex|rgbHSLValueRegex|digitRegex`\nconst complexRegex =\n /var\\s*\\(\\s*--(?:[\\w-]+\\s*|[\\w-]+\\s*,(?:\\s*[^)(\\s]|\\s*\\((?:[^)(]|\\([^)(]*\\))*\\))+\\s*)\\)|#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\)|-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)/giu\n\nexport function analyseComplexValue(\n value: AnyResolvedKeyframe\n): ComplexValueInfo {\n const originalValue = value.toString()\n\n const values: ComplexValues = []\n const indexes: ValueIndexes = {\n color: [],\n number: [],\n var: [],\n }\n const types: Array = []\n\n let i = 0\n const tokenised = originalValue.replace(complexRegex, (parsedValue) => {\n if (color.test(parsedValue)) {\n indexes.color.push(i)\n types.push(COLOR_TOKEN)\n values.push(color.parse(parsedValue))\n } else if (parsedValue.startsWith(VAR_FUNCTION_TOKEN)) {\n indexes.var.push(i)\n types.push(VAR_TOKEN)\n values.push(parsedValue)\n } else {\n indexes.number.push(i)\n types.push(NUMBER_TOKEN)\n values.push(parseFloat(parsedValue))\n }\n ++i\n return SPLIT_TOKEN\n })\n const split = tokenised.split(SPLIT_TOKEN)\n\n return { values, split, indexes, types }\n}\n\nfunction parseComplexValue(v: AnyResolvedKeyframe) {\n return analyseComplexValue(v).values\n}\n\nfunction buildTransformer({ split, types }: ComplexValueInfo) {\n const numSections = split.length\n return (v: Array) => {\n let output = \"\"\n for (let i = 0; i < numSections; i++) {\n output += split[i]\n if (v[i] !== undefined) {\n const type = types[i]\n if (type === NUMBER_TOKEN) {\n output += sanitize(v[i] as number)\n } else if (type === COLOR_TOKEN) {\n output += color.transform(v[i] as Color)\n } else {\n output += v[i]\n }\n }\n }\n\n return output\n }\n}\n\nfunction createTransformer(source: AnyResolvedKeyframe) {\n return buildTransformer(analyseComplexValue(source))\n}\n\nconst convertNumbersToZero = (v: number | string) =>\n typeof v === \"number\" ? 0 : color.test(v) ? color.getAnimatableNone(v) : v\n\n/**\n * Convert a parsed value to its zero equivalent, but preserve numbers\n * that act as divisors in CSS calc() expressions.\n *\n * analyseComplexValue extracts numbers from CSS strings and puts the\n * surrounding text into a `split` template array. For example:\n * \"calc(var(--gap) / 5)\" → values: [var(--gap), 5]\n * split: [\"calc(\", \" / \", \")\"]\n *\n * When building a zero-equivalent for animation, naively zeroing all\n * numbers turns the divisor into 0 → \"calc(var(--gap) / 0)\" → NaN.\n * We detect this by checking whether the text preceding a number\n * (split[i]) ends with \"/\" — the CSS calc division operator.\n */\nconst convertToZero = (\n value: ComplexValues[number],\n splitBefore: string\n): ComplexValues[number] => {\n if (typeof value === \"number\") {\n return splitBefore?.trim().endsWith(\"/\") ? value : 0\n }\n return convertNumbersToZero(value as string)\n}\n\nfunction getAnimatableNone(v: AnyResolvedKeyframe) {\n const info = analyseComplexValue(v)\n const transformer = buildTransformer(info)\n return transformer(\n info.values.map((value, i) => convertToZero(value, info.split[i]))\n )\n}\n\nexport const complex = {\n test,\n parse: parseComplexValue,\n createTransformer,\n getAnimatableNone,\n}\n","import { HSLA, RGBA } from \"../types\"\n\n// Adapted from https://gist.github.com/mjackson/5311256\nfunction hueToRgb(p: number, q: number, t: number) {\n if (t < 0) t += 1\n if (t > 1) t -= 1\n if (t < 1 / 6) return p + (q - p) * 6 * t\n if (t < 1 / 2) return q\n if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6\n return p\n}\n\nexport function hslaToRgba({ hue, saturation, lightness, alpha }: HSLA): RGBA {\n hue /= 360\n saturation /= 100\n lightness /= 100\n\n let red = 0\n let green = 0\n let blue = 0\n\n if (!saturation) {\n red = green = blue = lightness\n } else {\n const q =\n lightness < 0.5\n ? lightness * (1 + saturation)\n : lightness + saturation - lightness * saturation\n const p = 2 * lightness - q\n\n red = hueToRgb(p, q, hue + 1 / 3)\n green = hueToRgb(p, q, hue)\n blue = hueToRgb(p, q, hue - 1 / 3)\n }\n\n return {\n red: Math.round(red * 255),\n green: Math.round(green * 255),\n blue: Math.round(blue * 255),\n alpha,\n }\n}\n","export function mixImmediate(a: T, b: T) {\n return (p: number) => (p > 0 ? b : a)\n}\n","/*\n Value in range from progress\n\n Given a lower limit and an upper limit, we return the value within\n that range as expressed by progress (usually a number from 0 to 1)\n\n So progress = 0.5 would change\n\n from -------- to\n\n to\n\n from ---- to\n\n E.g. from = 10, to = 20, progress = 0.5 => 15\n\n @param [number]: Lower limit of range\n @param [number]: Upper limit of range\n @param [number]: The progress between lower and upper limits expressed 0-1\n @return [number]: Value as calculated from progress within range (not limited within range)\n*/\nexport const mixNumber = (from: number, to: number, progress: number) => {\n return from + (to - from) * progress\n}\n","import { warning } from \"motion-utils\"\nimport { hex } from \"../../value/types/color/hex\"\nimport { hsla } from \"../../value/types/color/hsla\"\nimport { hslaToRgba } from \"../../value/types/color/hsla-to-rgba\"\nimport { rgba } from \"../../value/types/color/rgba\"\nimport { Color, HSLA, RGBA } from \"../../value/types/types\"\nimport { mixImmediate } from \"./immediate\"\nimport { mixNumber } from \"./number\"\n\n// Linear color space blending\n// Explained https://www.youtube.com/watch?v=LKnqECcg6Gw\n// Demonstrated http://codepen.io/osublake/pen/xGVVaN\nexport const mixLinearColor = (from: number, to: number, v: number) => {\n const fromExpo = from * from\n const expo = v * (to * to - fromExpo) + fromExpo\n return expo < 0 ? 0 : Math.sqrt(expo)\n}\n\nconst colorTypes = [hex, rgba, hsla]\nconst getColorType = (v: Color | string) =>\n colorTypes.find((type) => type.test(v))\n\nfunction asRGBA(color: Color | string) {\n const type = getColorType(color)\n\n warning(\n Boolean(type),\n `'${color}' is not an animatable color. Use the equivalent color code instead.`,\n \"color-not-animatable\"\n )\n\n if (!Boolean(type)) return false\n\n let model = type!.parse(color)\n\n if (type === hsla) {\n // TODO Remove this cast - needed since Motion's stricter typing\n model = hslaToRgba(model as HSLA)\n }\n\n return model as RGBA\n}\n\nexport const mixColor = (from: Color | string, to: Color | string) => {\n const fromRGBA = asRGBA(from)\n const toRGBA = asRGBA(to)\n\n if (!fromRGBA || !toRGBA) {\n return mixImmediate(from, to)\n }\n\n const blended = { ...fromRGBA }\n\n return (v: number) => {\n blended.red = mixLinearColor(fromRGBA.red, toRGBA.red, v)\n blended.green = mixLinearColor(fromRGBA.green, toRGBA.green, v)\n blended.blue = mixLinearColor(fromRGBA.blue, toRGBA.blue, v)\n blended.alpha = mixNumber(fromRGBA.alpha, toRGBA.alpha, v)\n return rgba.transform!(blended)\n }\n}\n","export const invisibleValues = new Set([\"none\", \"hidden\"])\n\n/**\n * Returns a function that, when provided a progress value between 0 and 1,\n * will return the \"none\" or \"hidden\" string only when the progress is that of\n * the origin or target.\n */\nexport function mixVisibility(origin: string, target: string) {\n if (invisibleValues.has(origin)) {\n return (p: number) => (p <= 0 ? origin : target)\n } else {\n return (p: number) => (p >= 1 ? target : origin)\n }\n}\n","import { pipe, warning } from \"motion-utils\"\nimport { AnyResolvedKeyframe } from \"../../animation/types\"\nimport { isCSSVariableToken } from \"../../animation/utils/is-css-variable\"\nimport { color } from \"../../value/types/color\"\nimport {\n analyseComplexValue,\n complex,\n ComplexValueInfo,\n ComplexValues,\n} from \"../../value/types/complex\"\nimport { HSLA, RGBA } from \"../../value/types/types\"\nimport { mixColor } from \"./color\"\nimport { mixImmediate } from \"./immediate\"\nimport { mixNumber as mixNumberImmediate } from \"./number\"\nimport { invisibleValues, mixVisibility } from \"./visibility\"\n\ntype MixableArray = Array\ninterface MixableObject {\n [key: string]: AnyResolvedKeyframe | RGBA | HSLA\n}\n\nfunction mixNumber(a: number, b: number) {\n return (p: number) => mixNumberImmediate(a, b, p)\n}\n\nexport function getMixer(a: T) {\n if (typeof a === \"number\") {\n return mixNumber\n } else if (typeof a === \"string\") {\n return isCSSVariableToken(a)\n ? mixImmediate\n : color.test(a)\n ? mixColor\n : mixComplex\n } else if (Array.isArray(a)) {\n return mixArray\n } else if (typeof a === \"object\") {\n return color.test(a) ? mixColor : mixObject\n }\n\n return mixImmediate\n}\n\nexport function mixArray(a: MixableArray, b: MixableArray) {\n const output = [...a]\n const numValues = output.length\n\n const blendValue = a.map((v, i) => getMixer(v)(v as any, b[i] as any))\n\n return (p: number) => {\n for (let i = 0; i < numValues; i++) {\n output[i] = blendValue[i](p) as any\n }\n return output\n }\n}\n\nexport function mixObject(a: MixableObject, b: MixableObject) {\n const output = { ...a, ...b }\n const blendValue: { [key: string]: (v: number) => any } = {}\n\n for (const key in output) {\n if (a[key] !== undefined && b[key] !== undefined) {\n blendValue[key] = getMixer(a[key])(\n a[key] as any,\n b[key] as any\n ) as any\n }\n }\n\n return (v: number) => {\n for (const key in blendValue) {\n output[key] = blendValue[key](v)\n }\n return output\n }\n}\n\nfunction matchOrder(\n origin: ComplexValueInfo,\n target: ComplexValueInfo\n): ComplexValues {\n const orderedOrigin: ComplexValues = []\n\n const pointers = { color: 0, var: 0, number: 0 }\n\n for (let i = 0; i < target.values.length; i++) {\n const type = target.types[i]\n const originIndex = origin.indexes[type][pointers[type]]\n const originValue = origin.values[originIndex] ?? 0\n\n orderedOrigin[i] = originValue\n\n pointers[type]++\n }\n\n return orderedOrigin\n}\n\nexport const mixComplex = (\n origin: AnyResolvedKeyframe,\n target: AnyResolvedKeyframe\n) => {\n const template = complex.createTransformer(target)\n const originStats = analyseComplexValue(origin)\n const targetStats = analyseComplexValue(target)\n const canInterpolate =\n originStats.indexes.var.length === targetStats.indexes.var.length &&\n originStats.indexes.color.length === targetStats.indexes.color.length &&\n originStats.indexes.number.length >= targetStats.indexes.number.length\n\n if (canInterpolate) {\n if (\n (invisibleValues.has(origin as string) &&\n !targetStats.values.length) ||\n (invisibleValues.has(target as string) &&\n !originStats.values.length)\n ) {\n return mixVisibility(origin as string, target as string)\n }\n\n return pipe(\n mixArray(matchOrder(originStats, targetStats), targetStats.values),\n template\n )\n } else {\n warning(\n true,\n `Complex values '${origin}' and '${target}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,\n \"complex-values-different\"\n )\n\n return mixImmediate(origin, target)\n }\n}\n","import { getMixer } from \"./complex\"\nimport { mixNumber as mixNumberImmediate } from \"./number\"\nimport { Mixer } from \"./types\"\n\nexport function mix(from: T, to: T): Mixer\nexport function mix(from: number, to: number, p: number): number\nexport function mix(from: T, to: T, p?: T): Mixer | number {\n if (\n typeof from === \"number\" &&\n typeof to === \"number\" &&\n typeof p === \"number\"\n ) {\n return mixNumberImmediate(from, to, p)\n }\n\n const mixer = getMixer(from)\n return mixer(from as any, to as any) as Mixer\n}\n","import { cancelFrame, frame, frameData } from \"../../frameloop\"\nimport { time } from \"../../frameloop/sync-time\"\nimport { FrameData } from \"../../frameloop/types\"\nimport { Driver } from \"./types\"\n\nexport const frameloopDriver: Driver = (update) => {\n const passTimestamp = ({ timestamp }: FrameData) => update(timestamp)\n\n return {\n start: (keepAlive = true) => frame.update(passTimestamp, keepAlive),\n stop: () => cancelFrame(passTimestamp),\n /**\n * If we're processing this frame we can use the\n * framelocked timestamp to keep things in sync.\n */\n now: () => (frameData.isProcessing ? frameData.timestamp : time.now()),\n }\n}\n","import { EasingFunction } from \"motion-utils\"\n\nexport const generateLinearEasing = (\n easing: EasingFunction,\n duration: number, // as milliseconds\n resolution: number = 10 // as milliseconds\n): string => {\n let points = \"\"\n const numPoints = Math.max(Math.round(duration / resolution), 2)\n\n for (let i = 0; i < numPoints; i++) {\n points += Math.round(easing(i / (numPoints - 1)) * 10000) / 10000 + \", \"\n }\n\n return `linear(${points.substring(0, points.length - 2)})`\n}\n","import { KeyframeGenerator } from \"../../types\"\n\n/**\n * Implement a practical max duration for keyframe generation\n * to prevent infinite loops\n */\nexport const maxGeneratorDuration = 20_000\nexport function calcGeneratorDuration(\n generator: KeyframeGenerator\n): number {\n let duration = 0\n const timeStep = 50\n let state = generator.next(duration)\n while (!state.done && duration < maxGeneratorDuration) {\n duration += timeStep\n state = generator.next(duration)\n }\n\n return duration >= maxGeneratorDuration ? Infinity : duration\n}\n","import { millisecondsToSeconds } from \"motion-utils\"\nimport { GeneratorFactory, Transition } from \"../../types\"\nimport { calcGeneratorDuration, maxGeneratorDuration } from \"./calc-duration\"\n\n/**\n * Create a progress => progress easing function from a generator.\n */\nexport function createGeneratorEasing(\n options: Transition,\n scale = 100,\n createGenerator: GeneratorFactory\n) {\n const generator = createGenerator({ ...options, keyframes: [0, scale] })\n const duration = Math.min(\n calcGeneratorDuration(generator),\n maxGeneratorDuration\n )\n\n return {\n type: \"keyframes\",\n ease: (progress: number) => {\n return generator.next(duration * progress).value / scale\n },\n duration: millisecondsToSeconds(duration),\n }\n}\n","import {\n clamp,\n millisecondsToSeconds,\n secondsToMilliseconds,\n warning,\n} from \"motion-utils\"\nimport {\n AnimationState,\n KeyframeGenerator,\n SpringOptions,\n Transition,\n ValueAnimationOptions,\n} from \"../types\"\nimport { generateLinearEasing } from \"../waapi/utils/linear\"\nimport {\n calcGeneratorDuration,\n maxGeneratorDuration,\n} from \"./utils/calc-duration\"\nimport { createGeneratorEasing } from \"./utils/create-generator-easing\"\n\nconst springDefaults = {\n // Default spring physics\n stiffness: 100,\n damping: 10,\n mass: 1.0,\n velocity: 0.0,\n\n // Default duration/bounce-based options\n duration: 800, // in ms\n bounce: 0.3,\n visualDuration: 0.3, // in seconds\n\n // Rest thresholds\n restSpeed: {\n granular: 0.01,\n default: 2,\n },\n restDelta: {\n granular: 0.005,\n default: 0.5,\n },\n\n // Limits\n minDuration: 0.01, // in seconds\n maxDuration: 10.0, // in seconds\n minDamping: 0.05,\n maxDamping: 1,\n}\n\nfunction calcAngularFreq(undampedFreq: number, dampingRatio: number) {\n return undampedFreq * Math.sqrt(1 - dampingRatio * dampingRatio)\n}\n\nconst rootIterations = 12\nfunction approximateRoot(\n envelope: (num: number) => number,\n derivative: (num: number) => number,\n initialGuess: number\n): number {\n let result = initialGuess\n for (let i = 1; i < rootIterations; i++) {\n result = result - envelope(result) / derivative(result)\n }\n return result\n}\n\n/**\n * This is ported from the Framer implementation of duration-based spring resolution.\n */\nconst safeMin = 0.001\n\nfunction findSpring({\n duration = springDefaults.duration,\n bounce = springDefaults.bounce,\n velocity = springDefaults.velocity,\n mass = springDefaults.mass,\n}: SpringOptions) {\n let envelope: (num: number) => number\n let derivative: (num: number) => number\n\n warning(\n duration <= secondsToMilliseconds(springDefaults.maxDuration),\n \"Spring duration must be 10 seconds or less\",\n \"spring-duration-limit\"\n )\n\n let dampingRatio = 1 - bounce\n\n /**\n * Restrict dampingRatio and duration to within acceptable ranges.\n */\n dampingRatio = clamp(\n springDefaults.minDamping,\n springDefaults.maxDamping,\n dampingRatio\n )\n duration = clamp(\n springDefaults.minDuration,\n springDefaults.maxDuration,\n millisecondsToSeconds(duration)\n )\n\n if (dampingRatio < 1) {\n /**\n * Underdamped spring\n */\n envelope = (undampedFreq) => {\n const exponentialDecay = undampedFreq * dampingRatio\n const delta = exponentialDecay * duration\n const a = exponentialDecay - velocity\n const b = calcAngularFreq(undampedFreq, dampingRatio)\n const c = Math.exp(-delta)\n return safeMin - (a / b) * c\n }\n\n derivative = (undampedFreq) => {\n const exponentialDecay = undampedFreq * dampingRatio\n const delta = exponentialDecay * duration\n const d = delta * velocity + velocity\n const e =\n Math.pow(dampingRatio, 2) * Math.pow(undampedFreq, 2) * duration\n const f = Math.exp(-delta)\n const g = calcAngularFreq(Math.pow(undampedFreq, 2), dampingRatio)\n const factor = -envelope(undampedFreq) + safeMin > 0 ? -1 : 1\n return (factor * ((d - e) * f)) / g\n }\n } else {\n /**\n * Critically-damped spring\n */\n envelope = (undampedFreq) => {\n const a = Math.exp(-undampedFreq * duration)\n const b = (undampedFreq - velocity) * duration + 1\n return -safeMin + a * b\n }\n\n derivative = (undampedFreq) => {\n const a = Math.exp(-undampedFreq * duration)\n const b = (velocity - undampedFreq) * (duration * duration)\n return a * b\n }\n }\n\n const initialGuess = 5 / duration\n const undampedFreq = approximateRoot(envelope, derivative, initialGuess)\n\n duration = secondsToMilliseconds(duration)\n if (isNaN(undampedFreq)) {\n return {\n stiffness: springDefaults.stiffness,\n damping: springDefaults.damping,\n duration,\n }\n } else {\n const stiffness = Math.pow(undampedFreq, 2) * mass\n return {\n stiffness,\n damping: dampingRatio * 2 * Math.sqrt(mass * stiffness),\n duration,\n }\n }\n}\n\nconst durationKeys = [\"duration\", \"bounce\"]\nconst physicsKeys = [\"stiffness\", \"damping\", \"mass\"]\n\nfunction isSpringType(options: SpringOptions, keys: string[]) {\n return keys.some((key) => (options as any)[key] !== undefined)\n}\n\nfunction getSpringOptions(options: SpringOptions) {\n let springOptions = {\n velocity: springDefaults.velocity,\n stiffness: springDefaults.stiffness,\n damping: springDefaults.damping,\n mass: springDefaults.mass,\n isResolvedFromDuration: false,\n ...options,\n }\n // stiffness/damping/mass overrides duration/bounce\n if (\n !isSpringType(options, physicsKeys) &&\n isSpringType(options, durationKeys)\n ) {\n // Time-defined springs should ignore inherited velocity.\n // Velocity from interrupted animations can cause findSpring()\n // to compute wildly different spring parameters, leading to\n // massive oscillation on small-range animations.\n springOptions.velocity = 0\n\n if (options.visualDuration) {\n const visualDuration = options.visualDuration\n const root = (2 * Math.PI) / (visualDuration * 1.2)\n const stiffness = root * root\n const damping =\n 2 *\n clamp(0.05, 1, 1 - (options.bounce || 0)) *\n Math.sqrt(stiffness)\n\n springOptions = {\n ...springOptions,\n mass: springDefaults.mass,\n stiffness,\n damping,\n }\n } else {\n const derived = findSpring({ ...options, velocity: 0 })\n\n springOptions = {\n ...springOptions,\n ...derived,\n mass: springDefaults.mass,\n }\n springOptions.isResolvedFromDuration = true\n }\n }\n\n return springOptions\n}\n\nfunction spring(\n optionsOrVisualDuration:\n | ValueAnimationOptions\n | number = springDefaults.visualDuration,\n bounce = springDefaults.bounce\n): KeyframeGenerator {\n const options =\n typeof optionsOrVisualDuration !== \"object\"\n ? ({\n visualDuration: optionsOrVisualDuration,\n keyframes: [0, 1],\n bounce,\n } as ValueAnimationOptions)\n : optionsOrVisualDuration\n\n let { restSpeed, restDelta } = options\n\n const origin = options.keyframes[0]\n const target = options.keyframes[options.keyframes.length - 1]\n\n /**\n * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator\n * to reduce GC during animation.\n */\n const state: AnimationState = { done: false, value: origin }\n\n const {\n stiffness,\n damping,\n mass,\n duration,\n velocity,\n isResolvedFromDuration,\n } = getSpringOptions({\n ...options,\n velocity: -millisecondsToSeconds(options.velocity || 0),\n })\n\n const initialVelocity = velocity || 0.0\n const dampingRatio = damping / (2 * Math.sqrt(stiffness * mass))\n\n const initialDelta = target - origin\n const undampedAngularFreq = millisecondsToSeconds(\n Math.sqrt(stiffness / mass)\n )\n\n /**\n * If we're working on a granular scale, use smaller defaults for determining\n * when the spring is finished.\n *\n * These defaults have been selected emprically based on what strikes a good\n * ratio between feeling good and finishing as soon as changes are imperceptible.\n */\n const isGranularScale = Math.abs(initialDelta) < 5\n restSpeed ||= isGranularScale\n ? springDefaults.restSpeed.granular\n : springDefaults.restSpeed.default\n restDelta ||= isGranularScale\n ? springDefaults.restDelta.granular\n : springDefaults.restDelta.default\n\n let resolveSpring: (v: number) => number\n let resolveVelocity: (t: number) => number\n\n // Underdamped coefficients, hoisted for use in the inlined next() hot path\n let angularFreq: number\n let A: number\n let sinCoeff: number\n let cosCoeff: number\n\n if (dampingRatio < 1) {\n angularFreq = calcAngularFreq(undampedAngularFreq, dampingRatio)\n\n A =\n (initialVelocity +\n dampingRatio * undampedAngularFreq * initialDelta) /\n angularFreq\n\n // Underdamped spring\n resolveSpring = (t: number) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t)\n\n return (\n target -\n envelope *\n (A * Math.sin(angularFreq * t) +\n initialDelta * Math.cos(angularFreq * t))\n )\n }\n\n // Analytical derivative of underdamped spring (px/ms)\n sinCoeff =\n dampingRatio * undampedAngularFreq * A + initialDelta * angularFreq\n cosCoeff =\n dampingRatio * undampedAngularFreq * initialDelta - A * angularFreq\n resolveVelocity = (t: number) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t)\n return envelope *\n (sinCoeff * Math.sin(angularFreq * t) +\n cosCoeff * Math.cos(angularFreq * t))\n }\n } else if (dampingRatio === 1) {\n // Critically damped spring\n resolveSpring = (t: number) =>\n target -\n Math.exp(-undampedAngularFreq * t) *\n (initialDelta +\n (initialVelocity + undampedAngularFreq * initialDelta) * t)\n\n // Analytical derivative of critically damped spring (px/ms)\n const C = initialVelocity + undampedAngularFreq * initialDelta\n resolveVelocity = (t: number) =>\n Math.exp(-undampedAngularFreq * t) *\n (undampedAngularFreq * C * t - initialVelocity)\n } else {\n // Overdamped spring\n const dampedAngularFreq =\n undampedAngularFreq * Math.sqrt(dampingRatio * dampingRatio - 1)\n\n resolveSpring = (t: number) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t)\n\n // When performing sinh or cosh values can hit Infinity so we cap them here\n const freqForT = Math.min(dampedAngularFreq * t, 300)\n\n return (\n target -\n (envelope *\n ((initialVelocity +\n dampingRatio * undampedAngularFreq * initialDelta) *\n Math.sinh(freqForT) +\n dampedAngularFreq *\n initialDelta *\n Math.cosh(freqForT))) /\n dampedAngularFreq\n )\n }\n\n // Analytical derivative of overdamped spring (px/ms)\n const P =\n (initialVelocity +\n dampingRatio * undampedAngularFreq * initialDelta) /\n dampedAngularFreq\n const sinhCoeff =\n dampingRatio * undampedAngularFreq * P - initialDelta * dampedAngularFreq\n const coshCoeff =\n dampingRatio * undampedAngularFreq * initialDelta - P * dampedAngularFreq\n resolveVelocity = (t: number) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t)\n const freqForT = Math.min(dampedAngularFreq * t, 300)\n return envelope *\n (sinhCoeff * Math.sinh(freqForT) +\n coshCoeff * Math.cosh(freqForT))\n }\n }\n\n const generator = {\n calculatedDuration: isResolvedFromDuration ? duration || null : null,\n velocity: (t: number) => secondsToMilliseconds(resolveVelocity(t)),\n next: (t: number) => {\n /**\n * For underdamped physics springs we need both position and\n * velocity each tick. Compute shared trig values once to avoid\n * duplicate Math.exp/sin/cos calls on the hot path.\n */\n if (!isResolvedFromDuration && dampingRatio < 1) {\n const envelope = Math.exp(\n -dampingRatio * undampedAngularFreq * t\n )\n const sin = Math.sin(angularFreq * t)\n const cos = Math.cos(angularFreq * t)\n\n const current =\n target -\n envelope *\n (A * sin + initialDelta * cos)\n const currentVelocity = secondsToMilliseconds(\n envelope *\n (sinCoeff * sin + cosCoeff * cos)\n )\n\n state.done =\n Math.abs(currentVelocity) <= restSpeed! &&\n Math.abs(target - current) <= restDelta!\n state.value = state.done ? target : current\n\n return state\n }\n\n const current = resolveSpring(t)\n\n if (!isResolvedFromDuration) {\n const currentVelocity = secondsToMilliseconds(\n resolveVelocity(t)\n )\n state.done =\n Math.abs(currentVelocity) <= restSpeed! &&\n Math.abs(target - current) <= restDelta!\n } else {\n state.done = t >= duration!\n }\n\n state.value = state.done ? target : current\n\n return state\n },\n toString: () => {\n const calculatedDuration = Math.min(\n calcGeneratorDuration(generator),\n maxGeneratorDuration\n )\n\n const easing = generateLinearEasing(\n (progress: number) =>\n generator.next(calculatedDuration * progress).value,\n calculatedDuration,\n 30\n )\n\n return calculatedDuration + \"ms \" + easing\n },\n toTransition: () => {},\n }\n\n return generator\n}\n\nspring.applyToOptions = (options: Transition) => {\n const generatorOptions = createGeneratorEasing(options as any, 100, spring)\n\n options.ease = generatorOptions.ease\n options.duration = secondsToMilliseconds(generatorOptions.duration)\n options.type = \"keyframes\"\n return options\n}\n\nexport { spring }\n","import { velocityPerSecond } from \"motion-utils\"\n\nconst velocitySampleDuration = 5 // ms\n\nexport function getGeneratorVelocity(\n resolveValue: (v: number) => number,\n t: number,\n current: number\n) {\n const prevT = Math.max(t - velocitySampleDuration, 0)\n return velocityPerSecond(current - resolveValue(prevT), t - prevT)\n}\n","import {\n AnimationState,\n KeyframeGenerator,\n ValueAnimationOptions,\n} from \"../types\"\nimport { spring as createSpring } from \"./spring\"\nimport { getGeneratorVelocity } from \"./utils/velocity\"\n\nexport function inertia({\n keyframes,\n velocity = 0.0,\n power = 0.8,\n timeConstant = 325,\n bounceDamping = 10,\n bounceStiffness = 500,\n modifyTarget,\n min,\n max,\n restDelta = 0.5,\n restSpeed,\n}: ValueAnimationOptions): KeyframeGenerator {\n const origin = keyframes[0]\n\n const state: AnimationState = {\n done: false,\n value: origin,\n }\n\n const isOutOfBounds = (v: number) =>\n (min !== undefined && v < min) || (max !== undefined && v > max)\n\n const nearestBoundary = (v: number) => {\n if (min === undefined) return max\n if (max === undefined) return min\n\n return Math.abs(min - v) < Math.abs(max - v) ? min : max\n }\n\n let amplitude = power * velocity\n const ideal = origin + amplitude\n const target = modifyTarget === undefined ? ideal : modifyTarget(ideal)\n\n /**\n * If the target has changed we need to re-calculate the amplitude, otherwise\n * the animation will start from the wrong position.\n */\n if (target !== ideal) amplitude = target - origin\n\n const calcDelta = (t: number) => -amplitude * Math.exp(-t / timeConstant)\n\n const calcLatest = (t: number) => target + calcDelta(t)\n\n const applyFriction = (t: number) => {\n const delta = calcDelta(t)\n const latest = calcLatest(t)\n state.done = Math.abs(delta) <= restDelta\n state.value = state.done ? target : latest\n }\n\n /**\n * Ideally this would resolve for t in a stateless way, we could\n * do that by always precalculating the animation but as we know\n * this will be done anyway we can assume that spring will\n * be discovered during that.\n */\n let timeReachedBoundary: number | undefined\n let spring: KeyframeGenerator | undefined\n\n const checkCatchBoundary = (t: number) => {\n if (!isOutOfBounds(state.value)) return\n\n timeReachedBoundary = t\n\n spring = createSpring({\n keyframes: [state.value, nearestBoundary(state.value)!],\n velocity: getGeneratorVelocity(calcLatest, t, state.value), // TODO: This should be passing * 1000\n damping: bounceDamping,\n stiffness: bounceStiffness,\n restDelta,\n restSpeed,\n })\n }\n\n checkCatchBoundary(0)\n\n return {\n calculatedDuration: null,\n next: (t: number) => {\n /**\n * We need to resolve the friction to figure out if we need a\n * spring but we don't want to do this twice per frame. So here\n * we flag if we updated for this frame and later if we did\n * we can skip doing it again.\n */\n let hasUpdatedFrame = false\n if (!spring && timeReachedBoundary === undefined) {\n hasUpdatedFrame = true\n applyFriction(t)\n checkCatchBoundary(t)\n }\n\n /**\n * If we have a spring and the provided t is beyond the moment the friction\n * animation crossed the min/max boundary, use the spring.\n */\n if (timeReachedBoundary !== undefined && t >= timeReachedBoundary) {\n return spring!.next(t - timeReachedBoundary)\n } else {\n !hasUpdatedFrame && applyFriction(t)\n return state\n }\n },\n }\n}\n","import {\n clamp,\n EasingFunction,\n invariant,\n MotionGlobalConfig,\n noop,\n pipe,\n progress,\n} from \"motion-utils\"\nimport { mix } from \"./mix\"\nimport { Mixer, MixerFactory } from \"./mix/types\"\n\nexport interface InterpolateOptions {\n clamp?: boolean\n ease?: EasingFunction | EasingFunction[]\n mixer?: MixerFactory\n}\n\nfunction createMixers(\n output: T[],\n ease?: EasingFunction | EasingFunction[],\n customMixer?: MixerFactory\n) {\n const mixers: Array> = []\n const mixerFactory: MixerFactory =\n customMixer || MotionGlobalConfig.mix || mix\n const numMixers = output.length - 1\n\n for (let i = 0; i < numMixers; i++) {\n let mixer = mixerFactory(output[i], output[i + 1])\n\n if (ease) {\n const easingFunction = Array.isArray(ease) ? ease[i] || noop : ease\n mixer = pipe(easingFunction, mixer) as Mixer\n }\n\n mixers.push(mixer)\n }\n\n return mixers\n}\n\n/**\n * Create a function that maps from a numerical input array to a generic output array.\n *\n * Accepts:\n * - Numbers\n * - Colors (hex, hsl, hsla, rgb, rgba)\n * - Complex (combinations of one or more numbers or strings)\n *\n * ```jsx\n * const mixColor = interpolate([0, 1], ['#fff', '#000'])\n *\n * mixColor(0.5) // 'rgba(128, 128, 128, 1)'\n * ```\n *\n * TODO Revisit this approach once we've moved to data models for values,\n * probably not needed to pregenerate mixer functions.\n *\n * @public\n */\nexport function interpolate(\n input: number[],\n output: T[],\n { clamp: isClamp = true, ease, mixer }: InterpolateOptions = {}\n): (v: number) => T {\n const inputLength = input.length\n\n invariant(\n inputLength === output.length,\n \"Both input and output ranges must be the same length\",\n \"range-length\"\n )\n\n /**\n * If we're only provided a single input, we can just make a function\n * that returns the output.\n */\n if (inputLength === 1) return () => output[0]\n if (inputLength === 2 && output[0] === output[1]) return () => output[1]\n\n const isZeroDeltaRange = input[0] === input[1]\n\n // If input runs highest -> lowest, reverse both arrays\n if (input[0] > input[inputLength - 1]) {\n input = [...input].reverse()\n output = [...output].reverse()\n }\n\n const mixers = createMixers(output, ease, mixer)\n const numMixers = mixers.length\n\n const interpolator = (v: number): T => {\n if (isZeroDeltaRange && v < input[0]) return output[0]\n\n let i = 0\n\n if (numMixers > 1) {\n for (; i < input.length - 2; i++) {\n if (v < input[i + 1]) break\n }\n }\n\n const progressInRange = progress(input[i], input[i + 1], v)\n\n return mixers[i](progressInRange)\n }\n\n return isClamp\n ? (v: number) =>\n interpolator(clamp(input[0], input[inputLength - 1], v))\n : interpolator\n}\n","import { progress } from \"motion-utils\"\nimport { mixNumber } from \"../../../utils/mix/number\"\n\nexport function fillOffset(offset: number[], remaining: number): void {\n const min = offset[offset.length - 1]\n for (let i = 1; i <= remaining; i++) {\n const offsetProgress = progress(0, remaining, i)\n offset.push(mixNumber(min, 1, offsetProgress))\n }\n}\n","import { fillOffset } from \"./fill\"\n\nexport function defaultOffset(arr: any[]): number[] {\n const offset = [0]\n fillOffset(offset, arr.length - 1)\n return offset\n}\n","export function convertOffsetToTimes(offset: number[], duration: number) {\n return offset.map((o) => o * duration)\n}\n","import {\n easeInOut,\n easingDefinitionToFunction,\n EasingFunction,\n isEasingArray,\n} from \"motion-utils\"\nimport { interpolate } from \"../../utils/interpolate\"\nimport { defaultOffset } from \"../keyframes/offsets/default\"\nimport { convertOffsetToTimes } from \"../keyframes/offsets/time\"\nimport {\n AnimationState,\n AnyResolvedKeyframe,\n KeyframeGenerator,\n ValueAnimationOptions,\n} from \"../types\"\n\nexport function defaultEasing(\n values: any[],\n easing?: EasingFunction\n): EasingFunction[] {\n return values.map(() => easing || easeInOut).splice(0, values.length - 1)\n}\n\nexport function keyframes({\n duration = 300,\n keyframes: keyframeValues,\n times,\n ease = \"easeInOut\",\n}: ValueAnimationOptions): KeyframeGenerator {\n /**\n * Easing functions can be externally defined as strings. Here we convert them\n * into actual functions.\n */\n const easingFunctions = isEasingArray(ease)\n ? ease.map(easingDefinitionToFunction)\n : easingDefinitionToFunction(ease)\n\n /**\n * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator\n * to reduce GC during animation.\n */\n const state: AnimationState = {\n done: false,\n value: keyframeValues[0],\n }\n\n /**\n * Create a times array based on the provided 0-1 offsets\n */\n const absoluteTimes = convertOffsetToTimes(\n // Only use the provided offsets if they're the correct length\n // TODO Maybe we should warn here if there's a length mismatch\n times && times.length === keyframeValues.length\n ? times\n : defaultOffset(keyframeValues),\n duration\n )\n\n const mapTimeToKeyframe = interpolate(absoluteTimes, keyframeValues, {\n ease: Array.isArray(easingFunctions)\n ? easingFunctions\n : defaultEasing(keyframeValues, easingFunctions),\n })\n\n return {\n calculatedDuration: duration,\n next: (t: number) => {\n state.value = mapTimeToKeyframe(t)\n state.done = t >= duration\n return state\n },\n }\n}\n","import { AnimationPlaybackOptions } from \"../types\"\n\nconst isNotNull = (value: unknown) => value !== null\n\nexport function getFinalKeyframe(\n keyframes: T[],\n { repeat, repeatType = \"loop\" }: AnimationPlaybackOptions,\n finalKeyframe?: T,\n speed: number = 1\n): T {\n const resolvedKeyframes = keyframes.filter(isNotNull)\n const useFirstKeyframe =\n speed < 0 || (repeat && repeatType !== \"loop\" && repeat % 2 === 1)\n const index = useFirstKeyframe ? 0 : resolvedKeyframes.length - 1\n\n return !index || finalKeyframe === undefined\n ? resolvedKeyframes[index]\n : finalKeyframe\n}\n","import { inertia } from \"../generators/inertia\"\nimport { keyframes } from \"../generators/keyframes\"\nimport { spring } from \"../generators/spring\"\nimport { GeneratorFactory, ValueAnimationTransition } from \"../types\"\n\nconst transitionTypeMap: { [key: string]: GeneratorFactory } = {\n decay: inertia,\n inertia,\n tween: keyframes,\n keyframes: keyframes,\n spring,\n}\n\nexport function replaceTransitionType(transition: ValueAnimationTransition) {\n if (typeof transition.type === \"string\") {\n transition.type = transitionTypeMap[transition.type]\n }\n}\n","export class WithPromise {\n protected _finished: Promise\n\n resolve: VoidFunction\n\n constructor() {\n this.updateFinished()\n }\n\n get finished() {\n return this._finished\n }\n\n protected updateFinished() {\n this._finished = new Promise((resolve) => {\n this.resolve = resolve\n })\n }\n\n protected notifyFinished() {\n this.resolve()\n }\n\n /**\n * Allows the animation to be awaited.\n *\n * @deprecated Use `finished` instead.\n */\n then(onResolve: VoidFunction, onReject?: VoidFunction) {\n return this.finished.then(onResolve, onReject)\n }\n}\n","import {\n clamp,\n invariant,\n millisecondsToSeconds,\n pipe,\n secondsToMilliseconds,\n} from \"motion-utils\"\nimport { time } from \"../frameloop/sync-time\"\nimport { mix } from \"../utils/mix\"\nimport { Mixer } from \"../utils/mix/types\"\nimport { frameloopDriver } from \"./drivers/frame\"\nimport { DriverControls } from \"./drivers/types\"\nimport { inertia } from \"./generators/inertia\"\nimport { keyframes as keyframesGenerator } from \"./generators/keyframes\"\nimport { calcGeneratorDuration } from \"./generators/utils/calc-duration\"\nimport { getGeneratorVelocity } from \"./generators/utils/velocity\"\nimport { getFinalKeyframe } from \"./keyframes/get-final\"\nimport {\n AnimationPlaybackControlsWithThen,\n AnimationState,\n GeneratorFactory,\n KeyframeGenerator,\n TimelineWithFallback,\n ValueAnimationOptions,\n} from \"./types\"\nimport { replaceTransitionType } from \"./utils/replace-transition-type\"\nimport { WithPromise } from \"./utils/WithPromise\"\n\nconst percentToProgress = (percent: number) => percent / 100\n\nexport class JSAnimation\n extends WithPromise\n implements AnimationPlaybackControlsWithThen\n{\n state: AnimationPlayState = \"idle\"\n\n startTime: number | null = null\n\n /**\n * The driver that's controlling the animation loop. Normally this is a requestAnimationFrame loop\n * but in tests we can pass in a synchronous loop.\n */\n private driver?: DriverControls\n\n private isStopped = false\n\n private generator: KeyframeGenerator\n\n private calculatedDuration: number\n\n private resolvedDuration: number\n\n private totalDuration: number\n\n private options: ValueAnimationOptions\n\n /**\n * The current time of the animation.\n */\n private currentTime: number = 0\n\n /**\n * The time at which the animation was paused.\n */\n private holdTime: number | null = null\n\n /**\n * Playback speed as a factor. 0 would be stopped, -1 reverse and 2 double speed.\n */\n private playbackSpeed = 1\n\n /*\n * If our generator doesn't support mixing numbers, we need to replace keyframes with\n * [0, 100] and then make a function that maps that to the actual keyframes.\n *\n * 100 is chosen instead of 1 as it works nicer with spring animations.\n */\n private mixKeyframes: Mixer | undefined\n\n private mirroredGenerator: KeyframeGenerator | undefined\n\n /**\n * Reusable state object for the delay phase to avoid\n * allocating a new object every frame.\n */\n private delayState: AnimationState = {\n done: false,\n value: undefined as unknown as T,\n }\n\n constructor(options: ValueAnimationOptions) {\n super()\n\n this.options = options\n this.initAnimation()\n this.play()\n\n if (options.autoplay === false) this.pause()\n }\n\n initAnimation() {\n const { options } = this\n\n replaceTransitionType(options)\n\n const {\n type = keyframesGenerator,\n repeat = 0,\n repeatDelay = 0,\n repeatType,\n velocity = 0,\n } = options\n let { keyframes } = options\n\n const generatorFactory =\n (type as GeneratorFactory) || keyframesGenerator\n\n if (\n process.env.NODE_ENV !== \"production\" &&\n generatorFactory !== keyframesGenerator\n ) {\n invariant(\n keyframes.length <= 2,\n `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${keyframes}`,\n \"spring-two-frames\"\n )\n }\n\n if (\n generatorFactory !== keyframesGenerator &&\n typeof keyframes[0] !== \"number\"\n ) {\n this.mixKeyframes = pipe(\n percentToProgress,\n mix(keyframes[0], keyframes[1])\n ) as (t: number) => T\n\n keyframes = [0 as T, 100 as T]\n }\n\n const generator = generatorFactory({ ...options, keyframes })\n\n /**\n * If we have a mirror repeat type we need to create a second generator that outputs the\n * mirrored (not reversed) animation and later ping pong between the two generators.\n */\n if (repeatType === \"mirror\") {\n this.mirroredGenerator = generatorFactory({\n ...options,\n keyframes: [...keyframes].reverse(),\n velocity: -velocity,\n })\n }\n\n /**\n * If duration is undefined and we have repeat options,\n * we need to calculate a duration from the generator.\n *\n * We set it to the generator itself to cache the duration.\n * Any timeline resolver will need to have already precalculated\n * the duration by this step.\n */\n if (generator.calculatedDuration === null) {\n generator.calculatedDuration = calcGeneratorDuration(generator)\n }\n\n const { calculatedDuration } = generator\n this.calculatedDuration = calculatedDuration\n this.resolvedDuration = calculatedDuration + repeatDelay\n this.totalDuration = this.resolvedDuration * (repeat + 1) - repeatDelay\n this.generator = generator\n }\n\n updateTime(timestamp: number) {\n const animationTime =\n Math.round(timestamp - this.startTime!) * this.playbackSpeed\n\n // Update currentTime\n if (this.holdTime !== null) {\n this.currentTime = this.holdTime\n } else {\n // Rounding the time because floating point arithmetic is not always accurate, e.g. 3000.367 - 1000.367 =\n // 2000.0000000000002. This is a problem when we are comparing the currentTime with the duration, for\n // example.\n this.currentTime = animationTime\n }\n }\n\n tick(timestamp: number, sample = false) {\n const {\n generator,\n totalDuration,\n mixKeyframes,\n mirroredGenerator,\n resolvedDuration,\n calculatedDuration,\n } = this\n\n if (this.startTime === null) return generator.next(0)\n\n const {\n delay = 0,\n keyframes,\n repeat,\n repeatType,\n repeatDelay,\n type,\n onUpdate,\n finalKeyframe,\n } = this.options\n\n /**\n * requestAnimationFrame timestamps can come through as lower than\n * the startTime as set by performance.now(). Here we prevent this,\n * though in the future it could be possible to make setting startTime\n * a pending operation that gets resolved here.\n */\n if (this.speed > 0) {\n this.startTime = Math.min(this.startTime, timestamp)\n } else if (this.speed < 0) {\n this.startTime = Math.min(\n timestamp - totalDuration / this.speed,\n this.startTime\n )\n }\n\n if (sample) {\n this.currentTime = timestamp\n } else {\n this.updateTime(timestamp)\n }\n\n // Rebase on delay\n const timeWithoutDelay =\n this.currentTime - delay * (this.playbackSpeed >= 0 ? 1 : -1)\n const isInDelayPhase =\n this.playbackSpeed >= 0\n ? timeWithoutDelay < 0\n : timeWithoutDelay > totalDuration\n this.currentTime = Math.max(timeWithoutDelay, 0)\n\n // If this animation has finished, set the current time to the total duration.\n if (this.state === \"finished\" && this.holdTime === null) {\n this.currentTime = totalDuration\n }\n\n let elapsed = this.currentTime\n let frameGenerator = generator\n\n if (repeat) {\n /**\n * Get the current progress (0-1) of the animation. If t is >\n * than duration we'll get values like 2.5 (midway through the\n * third iteration)\n */\n const progress =\n Math.min(this.currentTime, totalDuration) / resolvedDuration\n\n /**\n * Get the current iteration (0 indexed). For instance the floor of\n * 2.5 is 2.\n */\n let currentIteration = Math.floor(progress)\n\n /**\n * Get the current progress of the iteration by taking the remainder\n * so 2.5 is 0.5 through iteration 2\n */\n let iterationProgress = progress % 1.0\n\n /**\n * If iteration progress is 1 we count that as the end\n * of the previous iteration.\n */\n if (!iterationProgress && progress >= 1) {\n iterationProgress = 1\n }\n\n iterationProgress === 1 && currentIteration--\n\n currentIteration = Math.min(currentIteration, repeat + 1)\n\n /**\n * Reverse progress if we're not running in \"normal\" direction\n */\n\n const isOddIteration = Boolean(currentIteration % 2)\n if (isOddIteration) {\n if (repeatType === \"reverse\") {\n iterationProgress = 1 - iterationProgress\n if (repeatDelay) {\n iterationProgress -= repeatDelay / resolvedDuration\n }\n } else if (repeatType === \"mirror\") {\n frameGenerator = mirroredGenerator!\n }\n }\n\n elapsed = clamp(0, 1, iterationProgress) * resolvedDuration\n }\n\n /**\n * If we're in negative time, set state as the initial keyframe.\n * This prevents delay: x, duration: 0 animations from finishing\n * instantly.\n */\n let state: AnimationState\n if (isInDelayPhase) {\n this.delayState.value = keyframes[0]\n state = this.delayState\n } else {\n state = frameGenerator.next(elapsed)\n }\n\n if (mixKeyframes && !isInDelayPhase) {\n state.value = mixKeyframes(state.value as number)\n }\n\n let { done } = state\n\n if (!isInDelayPhase && calculatedDuration !== null) {\n done =\n this.playbackSpeed >= 0\n ? this.currentTime >= totalDuration\n : this.currentTime <= 0\n }\n\n const isAnimationFinished =\n this.holdTime === null &&\n (this.state === \"finished\" || (this.state === \"running\" && done))\n\n // TODO: The exception for inertia could be cleaner here\n if (isAnimationFinished && type !== inertia) {\n state.value = getFinalKeyframe(\n keyframes,\n this.options,\n finalKeyframe,\n this.speed\n )\n }\n\n if (onUpdate) {\n onUpdate(state.value)\n }\n\n if (isAnimationFinished) {\n this.finish()\n }\n\n return state\n }\n\n /**\n * Allows the returned animation to be awaited or promise-chained. Currently\n * resolves when the animation finishes at all but in a future update could/should\n * reject if its cancels.\n */\n then(resolve: VoidFunction, reject?: VoidFunction) {\n return this.finished.then(resolve, reject)\n }\n\n get duration() {\n return millisecondsToSeconds(this.calculatedDuration)\n }\n\n get iterationDuration() {\n const { delay = 0 } = this.options || {}\n return this.duration + millisecondsToSeconds(delay)\n }\n\n get time() {\n return millisecondsToSeconds(this.currentTime)\n }\n\n set time(newTime: number) {\n newTime = secondsToMilliseconds(newTime)\n this.currentTime = newTime\n\n if (\n this.startTime === null ||\n this.holdTime !== null ||\n this.playbackSpeed === 0\n ) {\n this.holdTime = newTime\n } else if (this.driver) {\n this.startTime = this.driver.now() - newTime / this.playbackSpeed\n }\n\n if (this.driver) {\n this.driver.start(false)\n } else {\n this.startTime = 0\n this.state = \"paused\"\n this.holdTime = newTime\n this.tick(newTime)\n }\n }\n\n /**\n * Returns the generator's velocity at the current time in units/second.\n * Uses the analytical derivative when available (springs), avoiding\n * the MotionValue's frame-dependent velocity estimation.\n */\n getGeneratorVelocity(): number {\n const t = this.currentTime\n if (t <= 0) return this.options.velocity || 0\n\n if (this.generator.velocity) {\n return this.generator.velocity(t)\n }\n\n // Fallback: finite difference\n const current = this.generator.next(t).value as number\n return getGeneratorVelocity(\n (s) => this.generator.next(s).value as number,\n t,\n current\n )\n }\n\n get speed() {\n return this.playbackSpeed\n }\n\n set speed(newSpeed: number) {\n const hasChanged = this.playbackSpeed !== newSpeed\n\n if (hasChanged && this.driver) {\n this.updateTime(time.now())\n }\n\n this.playbackSpeed = newSpeed\n\n if (hasChanged && this.driver) {\n this.time = millisecondsToSeconds(this.currentTime)\n }\n }\n\n play() {\n if (this.isStopped) return\n\n const { driver = frameloopDriver, startTime } = this.options\n\n if (!this.driver) {\n this.driver = driver((timestamp) => this.tick(timestamp))\n }\n\n this.options.onPlay?.()\n\n const now = this.driver.now()\n\n if (this.state === \"finished\") {\n this.updateFinished()\n this.startTime = now\n } else if (this.holdTime !== null) {\n this.startTime = now - this.holdTime\n } else if (!this.startTime) {\n this.startTime = startTime ?? now\n }\n\n if (this.state === \"finished\" && this.speed < 0) {\n this.startTime += this.calculatedDuration\n }\n\n this.holdTime = null\n\n /**\n * Set playState to running only after we've used it in\n * the previous logic.\n */\n this.state = \"running\"\n\n this.driver.start()\n }\n\n pause() {\n this.state = \"paused\"\n this.updateTime(time.now())\n this.holdTime = this.currentTime\n }\n\n /**\n * This method is bound to the instance to fix a pattern where\n * animation.stop is returned as a reference from a useEffect.\n */\n stop = () => {\n const { motionValue } = this.options\n if (motionValue && motionValue.updatedAt !== time.now()) {\n this.tick(time.now())\n }\n\n this.isStopped = true\n if (this.state === \"idle\") return\n this.teardown()\n this.options.onStop?.()\n }\n\n complete() {\n if (this.state !== \"running\") {\n this.play()\n }\n\n this.state = \"finished\"\n this.holdTime = null\n }\n\n finish() {\n this.notifyFinished()\n this.teardown()\n this.state = \"finished\"\n\n this.options.onComplete?.()\n }\n\n cancel() {\n this.holdTime = null\n this.startTime = 0\n this.tick(0)\n this.teardown()\n this.options.onCancel?.()\n }\n\n private teardown() {\n this.state = \"idle\"\n this.stopDriver()\n this.startTime = this.holdTime = null\n }\n\n private stopDriver() {\n if (!this.driver) return\n this.driver.stop()\n this.driver = undefined\n }\n\n sample(sampleTime: number): AnimationState {\n this.startTime = 0\n return this.tick(sampleTime, true)\n }\n\n attachTimeline(timeline: TimelineWithFallback): VoidFunction {\n if (this.options.allowFlatten) {\n this.options.type = \"keyframes\"\n this.options.ease = \"linear\"\n this.initAnimation()\n }\n\n this.driver?.stop()\n return timeline.observe(this)\n }\n}\n\n// Legacy function support\nexport function animateValue(\n options: ValueAnimationOptions\n) {\n return new JSAnimation(options)\n}\n","import { UnresolvedValueKeyframe, ValueKeyframe } from \"../../types\"\n\nexport function fillWildcards(\n keyframes: ValueKeyframe[] | UnresolvedValueKeyframe[]\n) {\n for (let i = 1; i < keyframes.length; i++) {\n keyframes[i] ??= keyframes[i - 1]\n }\n}\n","import { transformPropOrder } from \"../utils/keys-transform\"\n\nconst radToDeg = (rad: number) => (rad * 180) / Math.PI\n\ntype MatrixParser = (values: number[]) => number\n\ntype MatrixParsers = Record<\n (typeof transformPropOrder)[number],\n number | MatrixParser\n>\n\nconst rotate = (v: number[]) => {\n const angle = radToDeg(Math.atan2(v[1], v[0]))\n return rebaseAngle(angle)\n}\n\nconst matrix2dParsers: MatrixParsers = {\n x: 4,\n y: 5,\n translateX: 4,\n translateY: 5,\n scaleX: 0,\n scaleY: 3,\n scale: (v) => (Math.abs(v[0]) + Math.abs(v[3])) / 2,\n rotate,\n rotateZ: rotate,\n skewX: (v) => radToDeg(Math.atan(v[1])),\n skewY: (v) => radToDeg(Math.atan(v[2])),\n skew: (v) => (Math.abs(v[1]) + Math.abs(v[2])) / 2,\n} as const\n\nconst rebaseAngle = (angle: number) => {\n angle = angle % 360\n if (angle < 0) angle += 360\n return angle\n}\n\nconst rotateZ = rotate\n\nconst scaleX = (v: number[]) => Math.sqrt(v[0] * v[0] + v[1] * v[1])\nconst scaleY = (v: number[]) => Math.sqrt(v[4] * v[4] + v[5] * v[5])\n\nconst matrix3dParsers: MatrixParsers = {\n x: 12,\n y: 13,\n z: 14,\n translateX: 12,\n translateY: 13,\n translateZ: 14,\n scaleX,\n scaleY,\n scale: (v) => (scaleX(v) + scaleY(v)) / 2,\n rotateX: (v) => rebaseAngle(radToDeg(Math.atan2(v[6], v[5]))),\n rotateY: (v) => rebaseAngle(radToDeg(Math.atan2(-v[2], v[0]))),\n rotateZ,\n rotate: rotateZ,\n skewX: (v) => radToDeg(Math.atan(v[4])),\n skewY: (v) => radToDeg(Math.atan(v[1])),\n skew: (v) => (Math.abs(v[1]) + Math.abs(v[4])) / 2,\n} as const\n\nexport function defaultTransformValue(name: string): number {\n return name.includes(\"scale\") ? 1 : 0\n}\n\nexport function parseValueFromTransform(\n transform: string | undefined,\n name: string\n): number {\n if (!transform || transform === \"none\") {\n return defaultTransformValue(name)\n }\n\n const matrix3dMatch = transform.match(/^matrix3d\\(([-\\d.e\\s,]+)\\)$/u)\n\n let parsers: MatrixParsers\n let match: RegExpMatchArray | null\n\n if (matrix3dMatch) {\n parsers = matrix3dParsers\n match = matrix3dMatch\n } else {\n const matrix2dMatch = transform.match(/^matrix\\(([-\\d.e\\s,]+)\\)$/u)\n\n parsers = matrix2dParsers\n match = matrix2dMatch\n }\n\n if (!match) {\n return defaultTransformValue(name)\n }\n\n const valueParser = parsers[name]\n const values = match[1].split(\",\").map(convertTransformToNumber)\n\n return typeof valueParser === \"function\"\n ? valueParser(values)\n : values[valueParser]\n}\n\nexport const readTransformValue = (instance: HTMLElement, name: string) => {\n const { transform = \"none\" } = getComputedStyle(instance)\n return parseValueFromTransform(transform, name)\n}\n\nfunction convertTransformToNumber(value: string): number {\n return parseFloat(value.trim())\n}\n","/**\n * Generate a list of every possible transform key.\n */\nexport const transformPropOrder = [\n \"transformPerspective\",\n \"x\",\n \"y\",\n \"z\",\n \"translateX\",\n \"translateY\",\n \"translateZ\",\n \"scale\",\n \"scaleX\",\n \"scaleY\",\n \"rotate\",\n \"rotateX\",\n \"rotateY\",\n \"rotateZ\",\n \"skew\",\n \"skewX\",\n \"skewY\",\n]\n\n/**\n * A quick lookup for transform props.\n *\n * `pathRotation` is a transform for routing purposes (skipped from raw\n * style application, wired to the transform composite, flags transform\n * dirty) but is intentionally NOT in `transformPropOrder` — it is\n * composed onto `rotate` at the build sites, not serialized in its own\n * slot, and must stay out of the order-array consumers (parse-transform,\n * unit-conversion, keys-position).\n */\nexport const transformProps = /*@__PURE__*/ (() =>\n new Set([...transformPropOrder, \"pathRotation\"]))()\n","import type { Box } from \"motion-utils\"\nimport { parseValueFromTransform } from \"../../../render/dom/parse-transform\"\nimport { transformPropOrder } from \"../../../render/utils/keys-transform\"\nimport { MotionValue } from \"../../../value\"\nimport { number } from \"../../../value/types/numbers\"\nimport { px } from \"../../../value/types/numbers/units\"\nimport { ValueType } from \"../../../value/types/types\"\nimport { AnyResolvedKeyframe } from \"../../types\"\nimport { WithRender } from \"../types\"\n\nexport const isNumOrPxType = (v?: ValueType): v is ValueType =>\n v === number || v === px\n\ntype GetActualMeasurementInPixels = (\n bbox: Box,\n computedStyle: Partial\n) => number\n\nconst transformKeys = new Set([\"x\", \"y\", \"z\"])\nconst nonTranslationalTransformKeys = transformPropOrder.filter(\n (key) => !transformKeys.has(key)\n)\n\ntype RemovedTransforms = [string, AnyResolvedKeyframe][]\nexport function removeNonTranslationalTransform(visualElement: WithRender) {\n const removedTransforms: RemovedTransforms = []\n\n nonTranslationalTransformKeys.forEach((key) => {\n const value: MotionValue | undefined =\n visualElement.getValue(key)\n if (value !== undefined) {\n removedTransforms.push([key, value.get()])\n value.set(key.startsWith(\"scale\") ? 1 : 0)\n }\n })\n\n return removedTransforms\n}\n\nexport const positionalValues: { [key: string]: GetActualMeasurementInPixels } =\n {\n // Dimensions\n width: (\n { x },\n { paddingLeft = \"0\", paddingRight = \"0\", boxSizing }\n ) => {\n const width = x.max - x.min\n return boxSizing === \"border-box\"\n ? width\n : width - parseFloat(paddingLeft) - parseFloat(paddingRight)\n },\n height: (\n { y },\n { paddingTop = \"0\", paddingBottom = \"0\", boxSizing }\n ) => {\n const height = y.max - y.min\n return boxSizing === \"border-box\"\n ? height\n : height - parseFloat(paddingTop) - parseFloat(paddingBottom)\n },\n\n top: (_bbox, { top }) => parseFloat(top as string),\n left: (_bbox, { left }) => parseFloat(left as string),\n bottom: ({ y }, { top }) => parseFloat(top as string) + (y.max - y.min),\n right: ({ x }, { left }) =>\n parseFloat(left as string) + (x.max - x.min),\n\n // Transform\n x: (_bbox, { transform }) => parseValueFromTransform(transform, \"x\"),\n y: (_bbox, { transform }) => parseValueFromTransform(transform, \"y\"),\n }\n\n// Alias translate longform names\npositionalValues.translateX = positionalValues.x\npositionalValues.translateY = positionalValues.y\n","import { frame } from \"../../frameloop\"\nimport { MotionValue } from \"../../value\"\nimport { AnyResolvedKeyframe } from \"../types\"\nimport { WithRender } from \"./types\"\nimport { fillWildcards } from \"./utils/fill-wildcards\"\nimport { removeNonTranslationalTransform } from \"./utils/unit-conversion\"\n\nexport type UnresolvedKeyframes = Array\n\nexport type ResolvedKeyframes = Array\n\nconst toResolve = new Set()\nlet isScheduled = false\nlet anyNeedsMeasurement = false\nlet isForced = false\n\nfunction measureAllKeyframes() {\n if (anyNeedsMeasurement) {\n const resolversToMeasure = Array.from(toResolve).filter(\n (resolver: KeyframeResolver) => resolver.needsMeasurement\n )\n const elementsToMeasure = new Set(\n resolversToMeasure.map((resolver) => resolver.element)\n )\n const transformsToRestore = new Map<\n WithRender,\n [string, AnyResolvedKeyframe][]\n >()\n\n /**\n * Write pass\n * If we're measuring elements we want to remove bounding box-changing transforms.\n */\n elementsToMeasure.forEach((element: WithRender) => {\n const removedTransforms = removeNonTranslationalTransform(\n element as any\n )\n\n if (!removedTransforms.length) return\n\n transformsToRestore.set(element, removedTransforms)\n\n element.render()\n })\n\n // Read\n resolversToMeasure.forEach((resolver) => resolver.measureInitialState())\n\n // Write\n elementsToMeasure.forEach((element: WithRender) => {\n element.render()\n\n const restore = transformsToRestore.get(element)\n if (restore) {\n restore.forEach(([key, value]) => {\n element.getValue(key)?.set(value)\n })\n }\n })\n\n // Read\n resolversToMeasure.forEach((resolver) => resolver.measureEndState())\n\n // Write\n resolversToMeasure.forEach((resolver) => {\n if (resolver.suspendedScrollY !== undefined) {\n window.scrollTo(0, resolver.suspendedScrollY)\n }\n })\n }\n\n anyNeedsMeasurement = false\n isScheduled = false\n\n toResolve.forEach((resolver) => resolver.complete(isForced))\n toResolve.clear()\n}\n\nfunction readAllKeyframes() {\n toResolve.forEach((resolver) => {\n resolver.readKeyframes()\n\n if (resolver.needsMeasurement) {\n anyNeedsMeasurement = true\n }\n })\n}\n\nexport function flushKeyframeResolvers() {\n isForced = true\n readAllKeyframes()\n measureAllKeyframes()\n isForced = false\n}\n\nexport type OnKeyframesResolved = (\n resolvedKeyframes: ResolvedKeyframes,\n finalKeyframe: T,\n forced: boolean\n) => void\n\nexport class KeyframeResolver {\n name?: string\n element?: WithRender\n finalKeyframe?: T\n suspendedScrollY?: number\n\n protected unresolvedKeyframes: UnresolvedKeyframes\n\n private motionValue?: MotionValue\n private onComplete: OnKeyframesResolved\n\n state: \"pending\" | \"scheduled\" | \"complete\" = \"pending\"\n\n /**\n * Track whether this resolver is async. If it is, it'll be added to the\n * resolver queue and flushed in the next frame. Resolvers that aren't going\n * to trigger read/write thrashing don't need to be async.\n */\n private isAsync = false\n\n /**\n * Track whether this resolver needs to perform a measurement\n * to resolve its keyframes.\n */\n needsMeasurement = false\n\n constructor(\n unresolvedKeyframes: UnresolvedKeyframes,\n onComplete: OnKeyframesResolved,\n name?: string,\n motionValue?: MotionValue,\n element?: WithRender,\n isAsync = false\n ) {\n this.unresolvedKeyframes = [...unresolvedKeyframes]\n this.onComplete = onComplete\n this.name = name\n this.motionValue = motionValue\n this.element = element\n this.isAsync = isAsync\n }\n\n scheduleResolve() {\n this.state = \"scheduled\"\n\n if (this.isAsync) {\n toResolve.add(this)\n\n if (!isScheduled) {\n isScheduled = true\n frame.read(readAllKeyframes)\n frame.resolveKeyframes(measureAllKeyframes)\n }\n } else {\n this.readKeyframes()\n this.complete()\n }\n }\n\n readKeyframes() {\n const { unresolvedKeyframes, name, element, motionValue } = this\n\n // If initial keyframe is null we need to read it from the DOM\n if (unresolvedKeyframes[0] === null) {\n const currentValue = motionValue?.get()\n\n // TODO: This doesn't work if the final keyframe is a wildcard\n const finalKeyframe =\n unresolvedKeyframes[unresolvedKeyframes.length - 1]\n\n if (currentValue !== undefined) {\n unresolvedKeyframes[0] = currentValue\n } else if (element && name) {\n const valueAsRead = element.readValue(name, finalKeyframe)\n\n if (valueAsRead !== undefined && valueAsRead !== null) {\n unresolvedKeyframes[0] = valueAsRead\n }\n }\n\n if (unresolvedKeyframes[0] === undefined) {\n unresolvedKeyframes[0] = finalKeyframe\n }\n\n if (motionValue && currentValue === undefined) {\n motionValue.set(unresolvedKeyframes[0] as T)\n }\n }\n\n fillWildcards(unresolvedKeyframes)\n }\n\n setFinalKeyframe() {}\n measureInitialState() {}\n renderEndStyles() {}\n measureEndState() {}\n\n complete(isForcedComplete = false) {\n this.state = \"complete\"\n\n this.onComplete(\n this.unresolvedKeyframes as ResolvedKeyframes,\n this.finalKeyframe as T,\n isForcedComplete\n )\n\n toResolve.delete(this)\n }\n\n cancel() {\n if (this.state === \"scheduled\") {\n toResolve.delete(this)\n this.state = \"pending\"\n }\n }\n\n resume() {\n if (this.state === \"pending\") this.scheduleResolve()\n }\n}\n","export const isCSSVar = (name: string) => name.startsWith(\"--\")\n","import { AnyResolvedKeyframe } from \"../../animation/types\"\nimport { isCSSVar } from \"./is-css-var\"\n\nexport function setStyle(\n element: HTMLElement | SVGElement,\n name: string,\n value: AnyResolvedKeyframe\n) {\n isCSSVar(name)\n ? element.style.setProperty(name, value as string)\n : (element.style[name as any] = value as string)\n}\n","/**\n * Add the ability for test suites to manually set support flags\n * to better test more environments.\n */\nexport const supportsFlags: Record = {}\n","import { memo } from \"motion-utils\"\nimport { supportsFlags } from \"./flags\"\n\nexport function memoSupports(\n callback: () => T,\n supportsFlag: keyof typeof supportsFlags\n) {\n const memoized = memo(callback)\n return () => supportsFlags[supportsFlag] ?? memoized()\n}\n","import { ProgressTimeline } from \"../..\"\nimport { memoSupports } from \"./memo\"\n\ndeclare global {\n interface Window {\n ScrollTimeline: ScrollTimeline\n ViewTimeline: ViewTimeline\n }\n}\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\nexport const supportsScrollTimeline = /* @__PURE__ */ memoSupports(\n () => window.ScrollTimeline !== undefined,\n \"scrollTimeline\"\n)\n\nexport const supportsViewTimeline = /* @__PURE__ */ memoSupports(\n () => window.ViewTimeline !== undefined,\n \"viewTimeline\"\n)\n","import { memoSupports } from \"./memo\"\n\nexport const supportsLinearEasing = /*@__PURE__*/ memoSupports(() => {\n try {\n document\n .createElement(\"div\")\n .animate({ opacity: 0 }, { easing: \"linear(0, 1)\" })\n } catch (e) {\n return false\n }\n return true\n}, \"linearEasing\")\n","import { BezierDefinition } from \"motion-utils\"\n\nexport const cubicBezierAsString = ([a, b, c, d]: BezierDefinition) =>\n `cubic-bezier(${a}, ${b}, ${c}, ${d})`\n","import { cubicBezierAsString } from \"./cubic-bezier\"\n\nexport const supportedWaapiEasing = {\n linear: \"linear\",\n ease: \"ease\",\n easeIn: \"ease-in\",\n easeOut: \"ease-out\",\n easeInOut: \"ease-in-out\",\n circIn: /*@__PURE__*/ cubicBezierAsString([0, 0.65, 0.55, 1]),\n circOut: /*@__PURE__*/ cubicBezierAsString([0.55, 0, 1, 0.45]),\n backIn: /*@__PURE__*/ cubicBezierAsString([0.31, 0.01, 0.66, -0.59]),\n backOut: /*@__PURE__*/ cubicBezierAsString([0.33, 1.53, 0.69, 0.99]),\n}\n","import { Easing, isBezierDefinition } from \"motion-utils\"\nimport { supportsLinearEasing } from \"../../../utils/supports/linear-easing\"\nimport { generateLinearEasing } from \"../utils/linear\"\nimport { cubicBezierAsString } from \"./cubic-bezier\"\nimport { supportedWaapiEasing } from \"./supported\"\n\nexport function mapEasingToNativeEasing(\n easing: Easing | Easing[] | undefined,\n duration: number\n): undefined | string | string[] {\n if (!easing) {\n return undefined\n } else if (typeof easing === \"function\") {\n return supportsLinearEasing()\n ? generateLinearEasing(easing, duration)\n : \"ease-out\"\n } else if (isBezierDefinition(easing)) {\n return cubicBezierAsString(easing)\n } else if (Array.isArray(easing)) {\n return easing.map(\n (segmentEasing) =>\n (mapEasingToNativeEasing(segmentEasing, duration) as string) ||\n supportedWaapiEasing.easeOut\n )\n } else {\n return supportedWaapiEasing[easing as keyof typeof supportedWaapiEasing]\n }\n}\n","import { ValueKeyframesDefinition, ValueTransition } from \"../types\"\nimport { mapEasingToNativeEasing } from \"./easing/map-easing\"\n\nexport function startWaapiAnimation(\n element: Element,\n valueName: string,\n keyframes: ValueKeyframesDefinition,\n {\n delay = 0,\n duration = 300,\n repeat = 0,\n repeatType = \"loop\",\n ease = \"easeOut\",\n times,\n }: ValueTransition = {},\n pseudoElement: string | undefined = undefined\n) {\n const keyframeOptions: PropertyIndexedKeyframes = {\n [valueName]: keyframes as string[],\n }\n if (times) keyframeOptions.offset = times\n\n const easing = mapEasingToNativeEasing(ease, duration)\n\n /**\n * If this is an easing array, apply to keyframes, not animation as a whole\n */\n if (Array.isArray(easing)) keyframeOptions.easing = easing\n\n const options: KeyframeAnimationOptions = {\n delay,\n duration,\n easing: !Array.isArray(easing) ? easing : \"linear\",\n fill: \"both\",\n iterations: repeat + 1,\n direction: repeatType === \"reverse\" ? \"alternate\" : \"normal\",\n }\n\n if (pseudoElement) options.pseudoElement = pseudoElement\n\n return element.animate(keyframeOptions, options)\n}\n","import { AnimationGeneratorType, GeneratorFactory } from \"../../types\"\n\nexport function isGenerator(\n type?: AnimationGeneratorType\n): type is GeneratorFactory {\n return typeof type === \"function\" && \"applyToOptions\" in type\n}\n","import { ValueTransition } from \"../../../animation/types\"\nimport { supportsLinearEasing } from \"../../../utils/supports/linear-easing\"\nimport { isGenerator } from \"../../generators/utils/is-generator\"\n\nexport function applyGeneratorOptions({\n type,\n ...options\n}: ValueTransition): ValueTransition {\n if (isGenerator(type) && supportsLinearEasing()) {\n return type.applyToOptions!(options)\n } else {\n options.duration ??= 300\n options.ease ??= \"easeOut\"\n }\n\n return options\n}\n","import {\n invariant,\n millisecondsToSeconds,\n noop,\n secondsToMilliseconds,\n} from \"motion-utils\"\nimport { setStyle } from \"../render/dom/style-set\"\nimport { supportsScrollTimeline } from \"../utils/supports/scroll-timeline\"\nimport { getFinalKeyframe } from \"./keyframes/get-final\"\nimport {\n AnimationPlaybackControlsWithThen,\n AnyResolvedKeyframe,\n DOMValueAnimationOptions,\n TimelineWithFallback,\n} from \"./types\"\nimport { WithPromise } from \"./utils/WithPromise\"\nimport { startWaapiAnimation } from \"./waapi/start-waapi-animation\"\nimport { applyGeneratorOptions } from \"./waapi/utils/apply-generator\"\n\nexport interface NativeAnimationOptions\n extends DOMValueAnimationOptions {\n pseudoElement?: string\n startTime?: number\n}\n\n/**\n * NativeAnimation implements AnimationPlaybackControls for the browser's Web Animations API.\n */\nexport class NativeAnimation\n extends WithPromise\n implements AnimationPlaybackControlsWithThen\n{\n /**\n * The interfaced Web Animation API animation\n */\n protected animation: Animation\n\n protected finishedTime: number | null = null\n\n protected options: NativeAnimationOptions\n\n private allowFlatten: boolean\n\n private isStopped = false\n\n private isPseudoElement: boolean\n\n /**\n * Tracks a manually-set start time that takes precedence over WAAPI's\n * dynamic startTime. This is cleared when play() or time setter is called,\n * allowing WAAPI to take over timing.\n */\n protected manualStartTime: number | null = null\n\n constructor(options?: NativeAnimationOptions) {\n super()\n\n if (!options) return\n\n const {\n element,\n name,\n keyframes,\n pseudoElement,\n allowFlatten = false,\n finalKeyframe,\n onComplete,\n } = options as any\n\n this.isPseudoElement = Boolean(pseudoElement)\n\n this.allowFlatten = allowFlatten\n this.options = options\n\n invariant(\n typeof options.type !== \"string\",\n `Mini animate() doesn't support \"type\" as a string.`,\n \"mini-spring\"\n )\n\n const transition = applyGeneratorOptions(options)\n\n this.animation = startWaapiAnimation(\n element,\n name,\n keyframes,\n transition,\n pseudoElement\n )\n\n if (transition.autoplay === false) {\n this.animation.pause()\n }\n\n this.animation.onfinish = () => {\n this.finishedTime = this.time\n\n if (!pseudoElement) {\n const keyframe = getFinalKeyframe(\n keyframes as any,\n this.options as any,\n finalKeyframe,\n this.speed\n )\n if (this.updateMotionValue) {\n this.updateMotionValue(keyframe)\n }\n\n /**\n * If we can, we want to commit the final style as set by the user,\n * rather than the computed keyframe value supplied by the animation.\n * We always do this, even when a motion value is present, to prevent\n * a visual flash in Firefox where the WAAPI animation's fill is removed\n * during cancel() before the scheduled render can apply the correct value.\n */\n setStyle(element, name, keyframe)\n\n this.animation.cancel()\n }\n\n onComplete?.()\n this.notifyFinished()\n }\n }\n\n updateMotionValue?(value?: T): void\n\n play() {\n if (this.isStopped) return\n\n this.manualStartTime = null\n this.animation.play()\n\n if (this.state === \"finished\") {\n this.updateFinished()\n }\n }\n\n pause() {\n this.animation.pause()\n }\n\n complete() {\n this.animation.finish?.()\n }\n\n cancel() {\n try {\n this.animation.cancel()\n } catch (e) {}\n }\n\n stop() {\n if (this.isStopped) return\n this.isStopped = true\n const { state } = this\n\n if (state === \"idle\" || state === \"finished\") {\n return\n }\n\n if (this.updateMotionValue) {\n this.updateMotionValue()\n } else {\n this.commitStyles()\n }\n\n if (!this.isPseudoElement) this.cancel()\n }\n\n /**\n * WAAPI doesn't natively have any interruption capabilities.\n *\n * In this method, we commit styles back to the DOM before cancelling\n * the animation.\n *\n * This is designed to be overridden by NativeAnimationExtended, which\n * will create a renderless JS animation and sample it twice to calculate\n * its current value, \"previous\" value, and therefore allow\n * Motion to also correctly calculate velocity for any subsequent animation\n * while deferring the commit until the next animation frame.\n */\n protected commitStyles() {\n const element = this.options?.element\n if (!this.isPseudoElement && element?.isConnected) {\n this.animation.commitStyles?.()\n }\n }\n\n get duration() {\n const duration =\n this.animation.effect?.getComputedTiming?.().duration || 0\n\n return millisecondsToSeconds(Number(duration))\n }\n\n get iterationDuration() {\n const { delay = 0 } = this.options || {}\n return this.duration + millisecondsToSeconds(delay)\n }\n\n get time() {\n return millisecondsToSeconds(Number(this.animation.currentTime) || 0)\n }\n\n set time(newTime: number) {\n const wasFinished = this.finishedTime !== null\n this.manualStartTime = null\n this.finishedTime = null\n this.animation.currentTime = secondsToMilliseconds(newTime)\n\n if (wasFinished) {\n this.animation.pause()\n }\n }\n\n /**\n * The playback speed of the animation.\n * 1 = normal speed, 2 = double speed, 0.5 = half speed.\n */\n get speed() {\n return this.animation.playbackRate\n }\n\n set speed(newSpeed: number) {\n // Allow backwards playback after finishing\n if (newSpeed < 0) this.finishedTime = null\n\n this.animation.playbackRate = newSpeed\n }\n\n get state() {\n return this.finishedTime !== null\n ? \"finished\"\n : this.animation.playState\n }\n\n get startTime() {\n return this.manualStartTime ?? Number(this.animation.startTime)\n }\n\n set startTime(newStartTime: number) {\n this.manualStartTime = this.animation.startTime = newStartTime\n }\n\n /**\n * Attaches a timeline to the animation, for instance the `ScrollTimeline`.\n */\n attachTimeline({\n timeline,\n rangeStart,\n rangeEnd,\n observe,\n }: TimelineWithFallback): VoidFunction {\n if (this.allowFlatten) {\n this.animation.effect?.updateTiming({ easing: \"linear\" })\n }\n\n this.animation.onfinish = null\n\n if (timeline && supportsScrollTimeline()) {\n this.animation.timeline = timeline as any\n\n if (rangeStart) (this.animation as any).rangeStart = rangeStart\n if (rangeEnd) (this.animation as any).rangeEnd = rangeEnd\n\n return noop\n } else {\n return observe(this)\n }\n }\n}\n","import { anticipate, backInOut, circInOut } from \"motion-utils\"\nimport { ValueAnimationTransition } from \"../../types\"\n\nconst unsupportedEasingFunctions = {\n anticipate,\n backInOut,\n circInOut,\n}\n\nfunction isUnsupportedEase(\n key: string\n): key is keyof typeof unsupportedEasingFunctions {\n return key in unsupportedEasingFunctions\n}\n\nexport function replaceStringEasing(transition: ValueAnimationTransition) {\n if (\n typeof transition.ease === \"string\" &&\n isUnsupportedEase(transition.ease)\n ) {\n transition.ease = unsupportedEasingFunctions[transition.ease]\n }\n}\n","import { clamp } from \"motion-utils\"\nimport { time } from \"../frameloop/sync-time\"\nimport { setStyle } from \"../render/dom/style-set\"\nimport { JSAnimation } from \"./JSAnimation\"\nimport { NativeAnimation, NativeAnimationOptions } from \"./NativeAnimation\"\nimport { AnyResolvedKeyframe, ValueAnimationOptions } from \"./types\"\nimport { replaceTransitionType } from \"./utils/replace-transition-type\"\nimport { replaceStringEasing } from \"./waapi/utils/unsupported-easing\"\n\nexport type NativeAnimationOptionsExtended =\n NativeAnimationOptions & ValueAnimationOptions & NativeAnimationOptions\n\n/**\n * 10ms is chosen here as it strikes a balance between smooth\n * results (more than one keyframe per frame at 60fps) and\n * keyframe quantity.\n */\nconst sampleDelta = 10 //ms\n\nexport class NativeAnimationExtended<\n T extends AnyResolvedKeyframe\n> extends NativeAnimation {\n options: NativeAnimationOptionsExtended\n\n constructor(options: NativeAnimationOptionsExtended) {\n /**\n * The base NativeAnimation function only supports a subset\n * of Motion easings, and WAAPI also only supports some\n * easing functions via string/cubic-bezier definitions.\n *\n * This function replaces those unsupported easing functions\n * with a JS easing function. This will later get compiled\n * to a linear() easing function.\n */\n replaceStringEasing(options)\n\n /**\n * Ensure we replace the transition type with a generator function\n * before passing to WAAPI.\n *\n * TODO: Does this have a better home? It could be shared with\n * JSAnimation.\n */\n replaceTransitionType(options)\n\n super(options)\n\n /**\n * Only set startTime when the animation should autoplay.\n * Setting startTime on a paused WAAPI animation unpauses it\n * (per the WAAPI spec), which breaks autoplay: false.\n */\n if (options.startTime !== undefined && options.autoplay !== false) {\n this.startTime = options.startTime\n }\n\n this.options = options\n }\n\n /**\n * WAAPI doesn't natively have any interruption capabilities.\n *\n * Rather than read committed styles back out of the DOM, we can\n * create a renderless JS animation and sample it twice to calculate\n * its current value, \"previous\" value, and therefore allow\n * Motion to calculate velocity for any subsequent animation.\n */\n updateMotionValue(value?: T) {\n const { motionValue, onUpdate, onComplete, element, ...options } =\n this.options\n\n if (!motionValue) return\n\n if (value !== undefined) {\n motionValue.set(value)\n return\n }\n\n const sampleAnimation = new JSAnimation({\n ...options,\n autoplay: false,\n })\n\n /**\n * Use wall-clock elapsed time for sampling.\n * Under CPU load, WAAPI's currentTime may not reflect actual\n * elapsed time, causing incorrect sampling and visual jumps.\n */\n const sampleTime = Math.max(sampleDelta, time.now() - this.startTime)\n const delta = clamp(0, sampleDelta, sampleTime - sampleDelta)\n const current = sampleAnimation.sample(sampleTime).value\n\n /**\n * Write the estimated value to inline style so it persists\n * after cancel(), covering the async gap before the next\n * animation starts.\n */\n const { name } = this.options\n if (element && name) setStyle(element, name, current)\n\n motionValue.setWithVelocity(\n sampleAnimation.sample(Math.max(0, sampleTime - delta)).value,\n current,\n delta\n )\n\n sampleAnimation.stop()\n }\n}\n","import { complex } from \"../../value/types/complex\"\nimport { ValueKeyframesDefinition } from \"../types\"\n\n/**\n * Check if a value is animatable. Examples:\n *\n * ✅: 100, \"100px\", \"#fff\"\n * ❌: \"block\", \"url(2.jpg)\"\n * @param value\n *\n * @internal\n */\nexport const isAnimatable = (\n value: ValueKeyframesDefinition,\n name?: string\n) => {\n // If the list of keys that might be non-animatable grows, replace with Set\n if (name === \"zIndex\") return false\n\n // If it's a number or a keyframes array, we can animate it. We might at some point\n // need to do a deep isAnimatable check of keyframes, or let Popmotion handle this,\n // but for now lets leave it like this for performance reasons\n if (typeof value === \"number\" || Array.isArray(value)) return true\n\n if (\n typeof value === \"string\" && // It's animatable if we have a string\n (complex.test(value) || value === \"0\") && // And it contains numbers and/or colors\n !value.startsWith(\"url(\") // Unless it starts with \"url(\"\n ) {\n return true\n }\n\n return false\n}\n","import { warning } from \"motion-utils\"\nimport { isGenerator } from \"../generators/utils/is-generator\"\nimport { ResolvedKeyframes } from \"../keyframes/KeyframesResolver\"\nimport { AnimationGeneratorType } from \"../types\"\nimport { isAnimatable } from \"./is-animatable\"\n\nfunction hasKeyframesChanged(keyframes: ResolvedKeyframes) {\n const current = keyframes[0]\n if (keyframes.length === 1) return true\n for (let i = 0; i < keyframes.length; i++) {\n if (keyframes[i] !== current) return true\n }\n}\n\nexport function canAnimate(\n keyframes: ResolvedKeyframes,\n name?: string,\n type?: AnimationGeneratorType,\n velocity?: number\n) {\n /**\n * Check if we're able to animate between the start and end keyframes,\n * and throw a warning if we're attempting to animate between one that's\n * animatable and another that isn't.\n */\n const originKeyframe = keyframes[0]\n if (originKeyframe === null) {\n return false\n }\n\n /**\n * These aren't traditionally animatable but we do support them.\n * In future we could look into making this more generic or replacing\n * this function with mix() === mixImmediate\n */\n if (name === \"display\" || name === \"visibility\") return true\n\n const targetKeyframe = keyframes[keyframes.length - 1]\n const isOriginAnimatable = isAnimatable(originKeyframe, name)\n const isTargetAnimatable = isAnimatable(targetKeyframe, name)\n\n warning(\n isOriginAnimatable === isTargetAnimatable,\n `You are trying to animate ${name} from \"${originKeyframe}\" to \"${targetKeyframe}\". \"${\n isOriginAnimatable ? targetKeyframe : originKeyframe\n }\" is not an animatable value.`,\n \"value-not-animatable\"\n )\n\n // Always skip if any of these are true\n if (!isOriginAnimatable || !isTargetAnimatable) {\n return false\n }\n\n return (\n hasKeyframesChanged(keyframes) ||\n ((type === \"spring\" || isGenerator(type)) && velocity)\n )\n}\n","import { ValueAnimationOptions } from \"../types\"\n\nexport function makeAnimationInstant(\n options: Partial<{\n duration: ValueAnimationOptions[\"duration\"]\n type: ValueAnimationOptions[\"type\"]\n }>\n): void {\n options.duration = 0\n options.type = \"keyframes\"\n}\n","/**\n * A list of values that can be hardware-accelerated.\n */\nexport const acceleratedValues = new Set([\n \"opacity\",\n \"clipPath\",\n \"filter\",\n \"transform\",\n \"backgroundColor\",\n])\n","const browserColorFunctions =\n /^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\\(/\n\nexport function hasBrowserOnlyColors(keyframes: any[]): boolean {\n for (let i = 0; i < keyframes.length; i++) {\n if (\n typeof keyframes[i] === \"string\" &&\n browserColorFunctions.test(keyframes[i])\n ) {\n return true\n }\n }\n return false\n}\n","import { memo } from \"motion-utils\"\nimport {\n AnyResolvedKeyframe,\n ValueAnimationOptionsWithRenderContext,\n} from \"../../types\"\nimport { acceleratedValues } from \"../utils/accelerated-values\"\nimport { hasBrowserOnlyColors } from \"../utils/is-browser-color\"\n\nconst colorProperties = new Set([\n \"color\",\n \"backgroundColor\",\n \"outlineColor\",\n \"fill\",\n \"stroke\",\n \"borderColor\",\n \"borderTopColor\",\n \"borderRightColor\",\n \"borderBottomColor\",\n \"borderLeftColor\",\n])\n\nconst supportsWaapi = /*@__PURE__*/ memo(() =>\n Object.hasOwnProperty.call(Element.prototype, \"animate\")\n)\n\nexport function supportsBrowserAnimation(\n options: ValueAnimationOptionsWithRenderContext\n) {\n const {\n motionValue,\n name,\n repeatDelay,\n repeatType,\n damping,\n type,\n keyframes,\n } = options\n\n const subject = motionValue?.owner?.current\n\n /**\n * We use instanceof checks instead of isHTMLElement()/isSVGElement()\n * because we explicitly **don't** want elements in different timing\n * contexts (i.e. popups) to be accelerated, as it's not possible to sync\n * these animations properly with those driven from the main window\n * frameloop.\n */\n if (\n !(subject instanceof HTMLElement) &&\n !(subject instanceof SVGElement)\n ) {\n return false\n }\n\n const { onUpdate, transformTemplate } = motionValue!.owner!.getProps()\n\n return (\n supportsWaapi() &&\n name &&\n /**\n * Force WAAPI for color properties with browser-only color formats\n * (oklch, oklab, lab, lch, etc.) that the JS animation path can't parse.\n */\n (acceleratedValues.has(name) ||\n (colorProperties.has(name) &&\n hasBrowserOnlyColors(keyframes))) &&\n (name !== \"transform\" || !transformTemplate) &&\n /**\n * If we're outputting values to onUpdate then we can't use WAAPI as there's\n * no way to read the value from WAAPI every frame.\n */\n !onUpdate &&\n !repeatDelay &&\n repeatType !== \"mirror\" &&\n damping !== 0 &&\n type !== \"inertia\"\n )\n}\n","import { MotionGlobalConfig, noop } from \"motion-utils\"\nimport { time } from \"../frameloop/sync-time\"\nimport { JSAnimation } from \"./JSAnimation\"\nimport { getFinalKeyframe } from \"./keyframes/get-final\"\nimport {\n KeyframeResolver as DefaultKeyframeResolver,\n flushKeyframeResolvers,\n ResolvedKeyframes,\n} from \"./keyframes/KeyframesResolver\"\nimport { NativeAnimationExtended } from \"./NativeAnimationExtended\"\nimport {\n AnimationPlaybackControls,\n AnyResolvedKeyframe,\n TimelineWithFallback,\n ValueAnimationOptions,\n} from \"./types\"\nimport { canAnimate } from \"./utils/can-animate\"\nimport { makeAnimationInstant } from \"./utils/make-animation-instant\"\nimport { WithPromise } from \"./utils/WithPromise\"\nimport { supportsBrowserAnimation } from \"./waapi/supports/waapi\"\n\n/**\n * Maximum time allowed between an animation being created and it being\n * resolved for us to use the latter as the start time.\n *\n * This is to ensure that while we prefer to \"start\" an animation as soon\n * as it's triggered, we also want to avoid a visual jump if there's a big delay\n * between these two moments.\n */\nconst MAX_RESOLVE_DELAY = 40\n\ntype OptionsWithoutKeyframes = Omit<\n ValueAnimationOptions,\n \"keyframes\"\n>\n\nexport class AsyncMotionValueAnimation\n extends WithPromise\n implements AnimationPlaybackControls\n{\n private createdAt: number\n\n private resolvedAt: number | undefined\n\n private _animation: AnimationPlaybackControls | undefined\n\n private pendingTimeline: TimelineWithFallback | undefined\n\n private keyframeResolver: DefaultKeyframeResolver | undefined\n\n private stopTimeline: VoidFunction | undefined\n\n constructor({\n autoplay = true,\n delay = 0,\n type = \"keyframes\",\n repeat = 0,\n repeatDelay = 0,\n repeatType = \"loop\",\n keyframes,\n name,\n motionValue,\n element,\n ...options\n }: ValueAnimationOptions) {\n super()\n\n this.createdAt = time.now()\n\n const optionsWithDefaults: OptionsWithoutKeyframes = {\n autoplay,\n delay,\n type,\n repeat,\n repeatDelay,\n repeatType,\n name,\n motionValue,\n element,\n ...options,\n }\n\n const KeyframeResolver =\n element?.KeyframeResolver || DefaultKeyframeResolver\n\n this.keyframeResolver = new KeyframeResolver(\n keyframes,\n (\n resolvedKeyframes: ResolvedKeyframes,\n finalKeyframe: T,\n forced: boolean\n ) =>\n this.onKeyframesResolved(\n resolvedKeyframes,\n finalKeyframe,\n optionsWithDefaults,\n !forced\n ),\n name,\n motionValue,\n element\n )\n this.keyframeResolver?.scheduleResolve()\n }\n\n onKeyframesResolved(\n keyframes: ResolvedKeyframes,\n finalKeyframe: T,\n options: OptionsWithoutKeyframes,\n sync: boolean\n ) {\n this.keyframeResolver = undefined\n\n const { name, type, velocity, delay, isHandoff, onUpdate } = options\n this.resolvedAt = time.now()\n\n /**\n * If we can't animate this value with the resolved keyframes\n * then we should complete it immediately.\n */\n let canAnimateValue = true\n if (!canAnimate(keyframes, name, type, velocity)) {\n canAnimateValue = false\n\n if (MotionGlobalConfig.instantAnimations || !delay) {\n onUpdate?.(getFinalKeyframe(keyframes, options, finalKeyframe))\n }\n\n keyframes[0] = keyframes[keyframes.length - 1]\n\n makeAnimationInstant(options)\n options.repeat = 0\n }\n\n /**\n * Resolve startTime for the animation.\n *\n * This method uses the createdAt and resolvedAt to calculate the\n * animation startTime. *Ideally*, we would use the createdAt time as t=0\n * as the following frame would then be the first frame of the animation in\n * progress, which would feel snappier.\n *\n * However, if there's a delay (main thread work) between the creation of\n * the animation and the first committed frame, we prefer to use resolvedAt\n * to avoid a sudden jump into the animation.\n */\n const startTime = sync\n ? !this.resolvedAt\n ? this.createdAt\n : this.resolvedAt - this.createdAt > MAX_RESOLVE_DELAY\n ? this.resolvedAt\n : this.createdAt\n : undefined\n\n const resolvedOptions = {\n startTime,\n finalKeyframe,\n ...options,\n keyframes,\n }\n\n /**\n * Animate via WAAPI if possible. If this is a handoff animation, the optimised animation will be running via\n * WAAPI. Therefore, this animation must be JS to ensure it runs \"under\" the\n * optimised animation.\n *\n * Also skip WAAPI when keyframes aren't animatable, as the resolved\n * values may not be valid CSS and would trigger browser warnings.\n */\n const useWaapi =\n canAnimateValue &&\n !isHandoff &&\n supportsBrowserAnimation(resolvedOptions)\n const element = resolvedOptions.motionValue?.owner?.current\n\n let animation: AnimationPlaybackControls\n if (useWaapi) {\n try {\n animation = new NativeAnimationExtended({\n ...resolvedOptions,\n element,\n } as any)\n } catch {\n animation = new JSAnimation(resolvedOptions)\n }\n } else {\n animation = new JSAnimation(resolvedOptions)\n }\n\n animation.finished.then(() => {\n this.notifyFinished()\n }).catch(noop)\n\n if (this.pendingTimeline) {\n this.stopTimeline = animation.attachTimeline(this.pendingTimeline)\n this.pendingTimeline = undefined\n }\n\n this._animation = animation\n }\n\n get finished() {\n if (!this._animation) {\n return this._finished\n } else {\n return this.animation.finished\n }\n }\n\n then(onResolve: VoidFunction, _onReject?: VoidFunction) {\n return this.finished.finally(onResolve).then(() => {})\n }\n\n get animation(): AnimationPlaybackControls {\n if (!this._animation) {\n this.keyframeResolver?.resume()\n flushKeyframeResolvers()\n }\n\n return this._animation!\n }\n\n get duration() {\n return this.animation.duration\n }\n\n get iterationDuration() {\n return this.animation.iterationDuration\n }\n\n get time() {\n return this.animation.time\n }\n\n set time(newTime: number) {\n this.animation.time = newTime\n }\n\n get speed() {\n return this.animation.speed\n }\n\n get state() {\n return this.animation.state\n }\n\n set speed(newSpeed: number) {\n this.animation.speed = newSpeed\n }\n\n get startTime() {\n return this.animation.startTime\n }\n\n attachTimeline(timeline: TimelineWithFallback) {\n if (this._animation) {\n this.stopTimeline = this.animation.attachTimeline(timeline)\n } else {\n this.pendingTimeline = timeline\n }\n\n return () => this.stop()\n }\n\n play() {\n this.animation.play()\n }\n\n pause() {\n this.animation.pause()\n }\n\n complete() {\n this.animation.complete()\n }\n\n cancel() {\n if (this._animation) {\n this.animation.cancel()\n }\n\n this.keyframeResolver?.cancel()\n }\n\n /**\n * Bound to support return animation.stop pattern\n */\n stop = () => {\n if (this._animation) {\n this._animation.stop()\n this.stopTimeline?.()\n }\n\n this.keyframeResolver?.cancel()\n }\n}\n","import { AnimationPlaybackControls, TimelineWithFallback } from \"./types\"\n\ntype PropNames =\n | \"time\"\n | \"speed\"\n | \"duration\"\n | \"attachTimeline\"\n | \"startTime\"\n | \"state\"\n\nexport type AcceptedAnimations = AnimationPlaybackControls\n\nexport type GroupedAnimations = AcceptedAnimations[]\n\nexport class GroupAnimation implements AnimationPlaybackControls {\n animations: GroupedAnimations\n\n constructor(animations: Array) {\n this.animations = animations.filter(Boolean) as GroupedAnimations\n }\n\n get finished() {\n return Promise.all(\n this.animations.map((animation) => animation.finished)\n )\n }\n\n /**\n * TODO: Filter out cancelled or stopped animations before returning\n */\n private getAll(propName: PropNames) {\n return this.animations[0][propName] as any\n }\n\n private setAll(propName: PropNames, newValue: any) {\n for (let i = 0; i < this.animations.length; i++) {\n ;(this.animations[i][propName] as any) = newValue\n }\n }\n\n attachTimeline(timeline: TimelineWithFallback) {\n const subscriptions = this.animations.map((animation) =>\n animation.attachTimeline(timeline)\n )\n\n return () => {\n subscriptions.forEach((cancel, i) => {\n cancel && cancel()\n this.animations[i].stop()\n })\n }\n }\n\n get time() {\n return this.getAll(\"time\")\n }\n\n set time(time: number) {\n this.setAll(\"time\", time)\n }\n\n get speed() {\n return this.getAll(\"speed\")\n }\n\n set speed(speed: number) {\n this.setAll(\"speed\", speed)\n }\n\n get state() {\n return this.getAll(\"state\")\n }\n\n get startTime() {\n return this.getAll(\"startTime\")\n }\n\n get duration() {\n return getMax(this.animations, \"duration\")\n }\n\n get iterationDuration() {\n return getMax(this.animations, \"iterationDuration\")\n }\n\n private runAll(\n methodName: keyof Omit<\n AnimationPlaybackControls,\n PropNames | \"then\" | \"finished\" | \"iterationDuration\"\n >\n ) {\n this.animations.forEach((controls) => controls[methodName]())\n }\n\n play() {\n this.runAll(\"play\")\n }\n\n pause() {\n this.runAll(\"pause\")\n }\n\n // Bound to accomadate common `return animation.stop` pattern\n stop = () => this.runAll(\"stop\")\n\n cancel() {\n this.runAll(\"cancel\")\n }\n\n complete() {\n this.runAll(\"complete\")\n }\n}\n\nfunction getMax(\n animations: GroupedAnimations,\n propName: \"iterationDuration\" | \"duration\"\n): number {\n let max = 0\n\n for (let i = 0; i < animations.length; i++) {\n const value = animations[i][propName]\n if (value !== null && value > max) {\n max = value\n }\n }\n return max\n}\n","import { GroupAnimation } from \"./GroupAnimation\"\nimport { AnimationPlaybackControlsWithThen } from \"./types\"\n\nexport class GroupAnimationWithThen\n extends GroupAnimation\n implements AnimationPlaybackControlsWithThen\n{\n then(onResolve: VoidFunction, _onReject?: VoidFunction) {\n return this.finished.finally(onResolve).then(() => {})\n }\n}\n","import { NativeAnimation } from \"./NativeAnimation\"\nimport { AnyResolvedKeyframe } from \"./types\"\n\nexport class NativeAnimationWrapper<\n T extends AnyResolvedKeyframe\n> extends NativeAnimation {\n constructor(animation: Animation) {\n super()\n\n this.animation = animation\n animation.onfinish = () => {\n this.finishedTime = this.time\n this.notifyFinished()\n }\n }\n}\n","import { NativeAnimation } from \"../NativeAnimation\"\nimport { AnyResolvedKeyframe } from \"../types\"\n\nconst animationMaps = new WeakMap<\n Element,\n Map>\n>()\nexport const animationMapKey = (name: string, pseudoElement: string = \"\") =>\n `${name}:${pseudoElement}`\n\nexport function getAnimationMap(element: Element) {\n let map = animationMaps.get(element)\n if (!map) {\n map = new Map()\n animationMaps.set(element, map)\n }\n return map\n}\n","import type { DynamicOption } from \"../types\"\nimport type { VisualElement } from \"../../render/VisualElement\"\n\nexport function calcChildStagger(\n children: Set,\n child: VisualElement,\n delayChildren?: number | DynamicOption,\n staggerChildren: number = 0,\n staggerDirection: number = 1\n): number {\n const index = Array.from(children)\n .sort((a, b) => a.sortNodePosition(b))\n .indexOf(child)\n const numChildren = children.size\n const maxStaggerDuration = (numChildren - 1) * staggerChildren\n const delayIsFunction = typeof delayChildren === \"function\"\n\n return delayIsFunction\n ? delayChildren(index, numChildren)\n : staggerDirection === 1\n ? index * staggerChildren\n : maxStaggerDuration - index * staggerChildren\n}\n","import {\n EasingFunction,\n SubscriptionManager,\n velocityPerSecond,\n warnOnce,\n} from \"motion-utils\"\nimport {\n AnimationPlaybackControlsWithThen,\n AnyResolvedKeyframe,\n TransformProperties,\n} from \"../animation/types\"\nimport { frame } from \"../frameloop\"\nimport { time } from \"../frameloop/sync-time\"\n\n/**\n * @public\n */\nexport type Subscriber = (v: T) => void\n\n/**\n * @public\n */\nexport type PassiveEffect = (v: T, safeSetter: (v: T) => void) => void\n\nexport type StartAnimation = (\n complete: () => void\n) => AnimationPlaybackControlsWithThen | undefined\n\nexport interface MotionValueEventCallbacks {\n animationStart: () => void\n animationComplete: () => void\n animationCancel: () => void\n change: (latestValue: V) => void\n destroy: () => void\n}\n\n/**\n * Maximum time between the value of two frames, beyond which we\n * assume the velocity has since been 0.\n */\nconst MAX_VELOCITY_DELTA = 30\n\nconst isFloat = (value: any): value is string => {\n return !isNaN(parseFloat(value))\n}\n\ninterface ResolvedValues {\n [key: string]: AnyResolvedKeyframe\n}\n\nexport interface Owner {\n current: HTMLElement | unknown\n getProps: () => {\n onUpdate?: (latest: ResolvedValues) => void\n transformTemplate?: (\n transform: TransformProperties,\n generatedTransform: string\n ) => string\n }\n}\n\nexport interface AccelerateConfig {\n factory: (animation: AnimationPlaybackControlsWithThen) => VoidFunction\n times: number[]\n keyframes: any[]\n ease?: EasingFunction | EasingFunction[]\n duration: number\n isTransformed?: boolean\n}\n\nexport interface MotionValueOptions {\n owner?: Owner\n}\n\nexport const collectMotionValues: { current: MotionValue[] | undefined } = {\n current: undefined,\n}\n\n/**\n * `MotionValue` is used to track the state and velocity of motion values.\n *\n * @public\n */\nexport class MotionValue {\n /**\n * If a MotionValue has an owner, it was created internally within Motion\n * and therefore has no external listeners. It is therefore safe to animate via WAAPI.\n */\n owner?: Owner\n\n /**\n * The current state of the `MotionValue`.\n */\n private current: V | undefined\n\n /**\n * The previous state of the `MotionValue`.\n */\n private prev: V | undefined\n\n /**\n * The previous state of the `MotionValue` at the end of the previous frame.\n */\n private prevFrameValue: V | undefined\n\n /**\n * The last time the `MotionValue` was updated.\n */\n updatedAt: number\n\n /**\n * The time `prevFrameValue` was updated.\n */\n prevUpdatedAt: number | undefined\n\n /**\n * Add a passive effect to this `MotionValue`.\n *\n * A passive effect intercepts calls to `set`. For instance, `useSpring` adds\n * a passive effect that attaches a `spring` to the latest\n * set value. Hypothetically there could be a `useSmooth` that attaches an input smoothing effect.\n *\n * @internal\n */\n private passiveEffect?: PassiveEffect\n private stopPassiveEffect?: VoidFunction\n\n /**\n * Whether the passive effect is active.\n */\n isEffectActive?: boolean\n\n /**\n * A reference to the currently-controlling animation.\n */\n animation?: AnimationPlaybackControlsWithThen\n\n /**\n * Tracks whether this value can output a velocity. Currently this is only true\n * if the value is numerical, but we might be able to widen the scope here and support\n * other value types.\n *\n * @internal\n */\n private canTrackVelocity: boolean | null = null\n\n /**\n * A list of MotionValues whose values are computed from this one.\n * This is a rough start to a proper signal-like dirtying system.\n */\n private dependents: Set | undefined\n\n /**\n * Tracks whether this value should be removed\n */\n liveStyle?: boolean\n\n /**\n * Scroll timeline acceleration metadata. When set, VisualElement\n * can create a native WAAPI animation attached to a scroll timeline\n * instead of driving updates through JS.\n */\n accelerate?: AccelerateConfig\n\n /**\n * @param init - The initiating value\n * @param config - Optional configuration options\n *\n * - `transformer`: A function to transform incoming values with.\n */\n constructor(init: V, options: MotionValueOptions = {}) {\n this.setCurrent(init)\n this.owner = options.owner\n }\n\n setCurrent(current: V) {\n this.current = current\n this.updatedAt = time.now()\n\n if (this.canTrackVelocity === null && current !== undefined) {\n this.canTrackVelocity = isFloat(this.current)\n }\n }\n\n setPrevFrameValue(prevFrameValue: V | undefined = this.current) {\n this.prevFrameValue = prevFrameValue\n this.prevUpdatedAt = this.updatedAt\n }\n\n /**\n * Adds a function that will be notified when the `MotionValue` is updated.\n *\n * It returns a function that, when called, will cancel the subscription.\n *\n * When calling `onChange` inside a React component, it should be wrapped with the\n * `useEffect` hook. As it returns an unsubscribe function, this should be returned\n * from the `useEffect` function to ensure you don't add duplicate subscribers..\n *\n * ```jsx\n * export const MyComponent = () => {\n * const x = useMotionValue(0)\n * const y = useMotionValue(0)\n * const opacity = useMotionValue(1)\n *\n * useEffect(() => {\n * function updateOpacity() {\n * const maxXY = Math.max(x.get(), y.get())\n * const newOpacity = transform(maxXY, [0, 100], [1, 0])\n * opacity.set(newOpacity)\n * }\n *\n * const unsubscribeX = x.on(\"change\", updateOpacity)\n * const unsubscribeY = y.on(\"change\", updateOpacity)\n *\n * return () => {\n * unsubscribeX()\n * unsubscribeY()\n * }\n * }, [])\n *\n * return \n * }\n * ```\n *\n * @param subscriber - A function that receives the latest value.\n * @returns A function that, when called, will cancel this subscription.\n *\n * @deprecated\n */\n onChange(subscription: Subscriber): () => void {\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(\n false,\n `value.onChange(callback) is deprecated. Switch to value.on(\"change\", callback).`\n )\n }\n return this.on(\"change\", subscription)\n }\n\n /**\n * An object containing a SubscriptionManager for each active event.\n */\n private events: {\n [key: string]: SubscriptionManager\n } = {}\n\n on>(\n eventName: EventName,\n callback: MotionValueEventCallbacks[EventName]\n ) {\n if (!this.events[eventName]) {\n this.events[eventName] = new SubscriptionManager()\n }\n\n const unsubscribe = this.events[eventName].add(callback)\n\n if (eventName === \"change\") {\n return () => {\n unsubscribe()\n\n /**\n * If we have no more change listeners by the start\n * of the next frame, stop active animations.\n */\n frame.read(() => {\n if (!this.events.change.getSize()) {\n this.stop()\n }\n })\n }\n }\n\n return unsubscribe\n }\n\n clearListeners() {\n for (const eventManagers in this.events) {\n this.events[eventManagers].clear()\n }\n }\n\n /**\n * Attaches a passive effect to the `MotionValue`.\n */\n attach(passiveEffect: PassiveEffect, stopPassiveEffect: VoidFunction) {\n this.passiveEffect = passiveEffect\n this.stopPassiveEffect = stopPassiveEffect\n }\n\n /**\n * Sets the state of the `MotionValue`.\n *\n * @remarks\n *\n * ```jsx\n * const x = useMotionValue(0)\n * x.set(10)\n * ```\n *\n * @param latest - Latest value to set.\n * @param render - Whether to notify render subscribers. Defaults to `true`\n *\n * @public\n */\n set(v: V) {\n if (!this.passiveEffect) {\n this.updateAndNotify(v)\n } else {\n this.passiveEffect(v, this.updateAndNotify)\n }\n }\n\n setWithVelocity(prev: V, current: V, delta: number) {\n this.set(current)\n this.prev = undefined\n this.prevFrameValue = prev\n this.prevUpdatedAt = this.updatedAt - delta\n }\n\n /**\n * Set the state of the `MotionValue`, stopping any active animations,\n * effects, and resets velocity to `0`.\n */\n jump(v: V, endAnimation = true) {\n this.updateAndNotify(v)\n this.prev = v\n this.prevUpdatedAt = this.prevFrameValue = undefined\n endAnimation && this.stop()\n if (this.stopPassiveEffect) this.stopPassiveEffect()\n }\n\n dirty() {\n this.events.change?.notify(this.current)\n }\n\n addDependent(dependent: MotionValue) {\n if (!this.dependents) {\n this.dependents = new Set()\n }\n this.dependents.add(dependent)\n }\n\n removeDependent(dependent: MotionValue) {\n if (this.dependents) {\n this.dependents.delete(dependent)\n }\n }\n\n updateAndNotify = (v: V) => {\n const currentTime = time.now()\n\n /**\n * If we're updating the value during another frame or eventloop\n * than the previous frame, then the we set the previous frame value\n * to current.\n */\n if (this.updatedAt !== currentTime) {\n this.setPrevFrameValue()\n }\n\n this.prev = this.current\n\n this.setCurrent(v)\n\n // Update update subscribers\n if (this.current !== this.prev) {\n this.events.change?.notify(this.current)\n\n if (this.dependents) {\n for (const dependent of this.dependents) {\n dependent.dirty()\n }\n }\n }\n }\n\n /**\n * Returns the latest state of `MotionValue`\n *\n * @returns - The latest state of `MotionValue`\n *\n * @public\n */\n get() {\n if (collectMotionValues.current) {\n collectMotionValues.current.push(this)\n }\n\n return this.current!\n }\n\n /**\n * @public\n */\n getPrevious() {\n return this.prev\n }\n\n /**\n * Returns the latest velocity of `MotionValue`\n *\n * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical.\n *\n * @public\n */\n getVelocity() {\n const currentTime = time.now()\n\n if (\n !this.canTrackVelocity ||\n this.prevFrameValue === undefined ||\n currentTime - this.updatedAt > MAX_VELOCITY_DELTA\n ) {\n return 0\n }\n\n const delta = Math.min(\n this.updatedAt - this.prevUpdatedAt!,\n MAX_VELOCITY_DELTA\n )\n\n // Casts because of parseFloat's poor typing\n return velocityPerSecond(\n parseFloat(this.current as any) -\n parseFloat(this.prevFrameValue as any),\n delta\n )\n }\n\n hasAnimated = false\n\n /**\n * Registers a new animation to control this `MotionValue`. Only one\n * animation can drive a `MotionValue` at one time.\n *\n * ```jsx\n * value.start()\n * ```\n *\n * @param animation - A function that starts the provided animation\n */\n start(startAnimation: StartAnimation) {\n this.stop()\n\n return new Promise((resolve) => {\n this.hasAnimated = true\n this.animation = startAnimation(resolve)\n\n if (this.events.animationStart) {\n this.events.animationStart.notify()\n }\n }).then(() => {\n if (this.events.animationComplete) {\n this.events.animationComplete.notify()\n }\n this.clearAnimation()\n })\n }\n\n /**\n * Stop the currently active animation.\n *\n * @public\n */\n stop() {\n if (this.animation) {\n this.animation.stop()\n if (this.events.animationCancel) {\n this.events.animationCancel.notify()\n }\n }\n this.clearAnimation()\n }\n\n /**\n * Returns `true` if this value is currently animating.\n *\n * @public\n */\n isAnimating() {\n return !!this.animation\n }\n\n private clearAnimation() {\n delete this.animation\n }\n\n /**\n * Destroy and clean up subscribers to this `MotionValue`.\n *\n * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically\n * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually\n * created a `MotionValue` via the `motionValue` function.\n *\n * @public\n */\n destroy() {\n this.dependents?.clear()\n this.events.destroy?.notify()\n this.clearListeners()\n this.stop()\n\n if (this.stopPassiveEffect) {\n this.stopPassiveEffect()\n }\n }\n}\n\nexport function motionValue(init: V, options?: MotionValueOptions) {\n return new MotionValue(init, options)\n}\n","/**\n * If `transition` has `inherit: true`, shallow-merge it with\n * `parentTransition` (child keys win) and strip the `inherit` key.\n * Otherwise return `transition` unchanged.\n */\nexport function resolveTransition(\n transition: any,\n parentTransition?: any\n) {\n if (transition?.inherit && parentTransition) {\n const { inherit: _, ...rest } = transition\n return { ...parentTransition, ...rest }\n }\n\n return transition\n}\n","import { resolveTransition } from \"./resolve-transition\"\n\nexport function getValueTransition(transition: any, key: string) {\n const valueTransition =\n transition?.[key as keyof typeof transition] ??\n transition?.[\"default\"] ??\n transition\n\n if (valueTransition !== transition) {\n return resolveTransition(valueTransition, transition)\n }\n\n return valueTransition\n}\n","import { transformProps } from \"../../render/utils/keys-transform\"\nimport type { ValueAnimationOptions } from \"../types\"\n\nconst underDampedSpring: Partial = {\n type: \"spring\",\n stiffness: 500,\n damping: 25,\n restSpeed: 10,\n}\n\nconst criticallyDampedSpring = (\n target: unknown\n): Partial => ({\n type: \"spring\",\n stiffness: 550,\n damping: target === 0 ? 2 * Math.sqrt(550) : 30,\n restSpeed: 10,\n})\n\nconst keyframesTransition: Partial = {\n type: \"keyframes\",\n duration: 0.8,\n}\n\n/**\n * Default easing curve is a slightly shallower version of\n * the default browser easing curve.\n */\nconst ease: Partial = {\n type: \"keyframes\",\n ease: [0.25, 0.1, 0.35, 1],\n duration: 0.3,\n}\n\nexport const getDefaultTransition = (\n valueKey: string,\n { keyframes }: ValueAnimationOptions\n): Partial => {\n if (keyframes.length > 2) {\n return keyframesTransition\n } else if (transformProps.has(valueKey)) {\n return valueKey.startsWith(\"scale\")\n ? criticallyDampedSpring(keyframes[1])\n : underDampedSpring\n }\n\n return ease\n}\n","import type { AnyResolvedKeyframe } from \"../types\"\nimport type { Transition } from \"../types\"\n\nconst orchestrationKeys = new Set([\n \"when\",\n \"delay\",\n \"delayChildren\",\n \"staggerChildren\",\n \"staggerDirection\",\n \"repeat\",\n \"repeatType\",\n \"repeatDelay\",\n \"from\",\n \"elapsed\",\n])\n\n/**\n * Decide whether a transition is defined on a given Transition.\n * This filters out orchestration options and returns true\n * if any options are left.\n */\nexport function isTransitionDefined(\n transition: Transition & { elapsed?: number; from?: AnyResolvedKeyframe }\n) {\n for (const key in transition) {\n if (!orchestrationKeys.has(key)) return true\n }\n return false\n}\n","import { MotionGlobalConfig, secondsToMilliseconds } from \"motion-utils\"\nimport { AsyncMotionValueAnimation } from \"../AsyncMotionValueAnimation\"\nimport { JSAnimation } from \"../JSAnimation\"\nimport type {\n AnyResolvedKeyframe,\n ValueAnimationOptions,\n ValueTransition,\n} from \"../types\"\nimport type { UnresolvedKeyframes } from \"../keyframes/KeyframesResolver\"\nimport { getValueTransition } from \"../utils/get-value-transition\"\nimport { makeAnimationInstant } from \"../utils/make-animation-instant\"\nimport { getDefaultTransition } from \"../utils/default-transitions\"\nimport { getFinalKeyframe } from \"../keyframes/get-final\"\nimport { isTransitionDefined } from \"../utils/is-transition-defined\"\nimport { frame } from \"../../frameloop\"\nimport type { MotionValue, StartAnimation } from \"../../value\"\nimport type { VisualElement } from \"../../render/VisualElement\"\n\nexport const animateMotionValue =\n (\n name: string,\n value: MotionValue,\n target: V | UnresolvedKeyframes,\n transition: ValueTransition & { elapsed?: number } = {},\n element?: VisualElement,\n isHandoff?: boolean\n ): StartAnimation =>\n (onComplete) => {\n const valueTransition = getValueTransition(transition, name) || {}\n\n /**\n * Most transition values are currently completely overwritten by value-specific\n * transitions. In the future it'd be nicer to blend these transitions. But for now\n * delay actually does inherit from the root transition if not value-specific.\n */\n const delay = valueTransition.delay || transition.delay || 0\n\n /**\n * Elapsed isn't a public transition option but can be passed through from\n * optimized appear effects in milliseconds.\n */\n let { elapsed = 0 } = transition\n elapsed = elapsed - secondsToMilliseconds(delay)\n\n const options: ValueAnimationOptions = {\n keyframes: Array.isArray(target) ? target : [null, target],\n ease: \"easeOut\",\n velocity: value.getVelocity(),\n ...valueTransition,\n delay: -elapsed,\n onUpdate: (v) => {\n value.set(v)\n valueTransition.onUpdate && valueTransition.onUpdate(v)\n },\n onComplete: () => {\n onComplete()\n valueTransition.onComplete && valueTransition.onComplete()\n },\n name,\n motionValue: value,\n element: isHandoff ? undefined : element,\n }\n\n /**\n * If there's no transition defined for this value, we can generate\n * unique transition settings for this value.\n */\n if (!isTransitionDefined(valueTransition)) {\n Object.assign(options, getDefaultTransition(name, options))\n }\n\n /**\n * Both WAAPI and our internal animation functions use durations\n * as defined by milliseconds, while our external API defines them\n * as seconds.\n */\n options.duration &&= secondsToMilliseconds(options.duration)\n options.repeatDelay &&= secondsToMilliseconds(options.repeatDelay)\n\n /**\n * Support deprecated way to set initial value. Prefer keyframe syntax.\n */\n if (options.from !== undefined) {\n options.keyframes[0] = options.from as any\n }\n\n let shouldSkip = false\n\n if (\n (options as any).type === false ||\n (options.duration === 0 && !options.repeatDelay)\n ) {\n makeAnimationInstant(options)\n\n if (options.delay === 0) {\n shouldSkip = true\n }\n }\n\n if (\n MotionGlobalConfig.instantAnimations ||\n MotionGlobalConfig.skipAnimations ||\n element?.shouldSkipAnimations ||\n valueTransition.skipAnimations\n ) {\n shouldSkip = true\n makeAnimationInstant(options)\n options.delay = 0\n }\n\n /**\n * If the transition type or easing has been explicitly set by the user\n * then we don't want to allow flattening the animation.\n */\n options.allowFlatten = !valueTransition.type && !valueTransition.ease\n\n /**\n * If we can or must skip creating the animation, and apply only\n * the final keyframe, do so. We also check once keyframes are resolved but\n * this early check prevents the need to create an animation at all.\n */\n if (shouldSkip && !isHandoff && value.get() !== undefined) {\n const finalKeyframe = getFinalKeyframe(\n options.keyframes as V[],\n valueTransition\n )\n\n if (finalKeyframe !== undefined) {\n frame.update(() => {\n options.onUpdate!(finalKeyframe)\n options.onComplete!()\n })\n\n return\n }\n }\n\n return valueTransition.isSync\n ? new JSAnimation(options)\n : new AsyncMotionValueAnimation(options)\n }\n","import { wrap } from \"motion-utils\"\nimport { motionValue } from \"../../value\"\nimport { animateMotionValue } from \"../interfaces/motion-value\"\nimport type { MotionPath, PathInterpolator, Point2D } from \"../types\"\nimport { getValueTransition } from \"./get-value-transition\"\n\nexport interface ArcOptions {\n /**\n * How far the arc bulges perpendicular to the straight-line path,\n * as a fraction of the total distance. A value of `1` means the arc\n * peaks at a height equal to the full travel distance. Default `0.5`.\n */\n strength?: number\n /**\n * Where along the path (0–1) the arc reaches its maximum height.\n * Default `0.5` (symmetric).\n */\n peak?: number\n /**\n * Which side the arc bulges toward.\n * - `\"cw\"` / `\"ccw\"` — locked relative to direction of travel\n * - unset — auto-pick a stable screen-space side\n */\n direction?: \"cw\" | \"ccw\"\n /**\n * Rotates the element to follow the tangent of the arc path.\n * - `true` — full tangent following (1.0)\n * - number 0–1 — scale factor\n */\n rotate?: boolean | number\n}\n\nconst MIN_LAYOUT_DISTANCE = 20\n\nfunction bezierPoint(\n t: number,\n origin: number,\n control: number,\n target: number\n): number {\n const inv = 1 - t\n return inv * inv * origin + 2 * inv * t * control + t * t * target\n}\n\nfunction bezierTangentAngle(\n t: number,\n originX: number,\n controlX: number,\n targetX: number,\n originY: number,\n controlY: number,\n targetY: number\n): number {\n const dx =\n 2 * (1 - t) * (controlX - originX) + 2 * t * (targetX - controlX)\n const dy =\n 2 * (1 - t) * (controlY - originY) + 2 * t * (targetY - controlY)\n return Math.atan2(dy, dx) * (180 / Math.PI)\n}\n\nfunction computeArcControlPoint(\n fromX: number,\n fromY: number,\n toX: number,\n toY: number,\n strength: number,\n peak: number\n): { x: number; y: number } {\n const deltaX = toX - fromX\n const deltaY = toY - fromY\n const distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY)\n\n if (distance > 0) {\n const normalPerpX = -deltaY / distance\n const normalPerpY = deltaX / distance\n const desiredHeight = strength * distance\n\n return {\n x: fromX + deltaX * peak + normalPerpX * desiredHeight,\n y: fromY + deltaY * peak + normalPerpY * desiredHeight,\n }\n }\n\n return { x: fromX, y: fromY }\n}\n\n/**\n * The pure sampling factory: `(from, to) => (t) => point`. Internal —\n * used by {@link arc} and the unit tests. Not part of the public surface.\n */\nexport function createArcPath({\n strength = 0.5,\n peak = 0.5,\n direction,\n rotate = false,\n}: ArcOptions = {}): (from: Point2D, to: Point2D) => PathInterpolator {\n const rotationScale =\n rotate === true ? 1 : typeof rotate === \"number\" ? rotate : 0\n\n // Auto-direction only: persists across calls to flip the bulge back\n // onto the same screen side when the dominant axis changes between\n // calls. Reuse the factory (module scope / useMemo) to keep this alive.\n let prevBulgeSign: number | undefined\n\n const createInterpolator = (\n from: Point2D,\n to: Point2D\n ): PathInterpolator => {\n const dx = to.x - from.x\n const dy = to.y - from.y\n\n let signed: number\n if (direction === \"cw\") {\n signed = -strength\n } else if (direction === \"ccw\") {\n signed = strength\n } else {\n const dom = Math.abs(dx) >= Math.abs(dy) ? dx : dy\n signed = dom < 0 ? -strength : strength\n }\n\n let control = computeArcControlPoint(\n from.x,\n from.y,\n to.x,\n to.y,\n signed,\n peak\n )\n\n if (direction === undefined) {\n const isVertical = Math.abs(dx) < Math.abs(dy)\n const midX = from.x + dx * peak\n const midY = from.y + dy * peak\n const bulgeSign = isVertical\n ? Math.sign(control.x - midX)\n : Math.sign(control.y - midY)\n\n if (\n prevBulgeSign !== undefined &&\n bulgeSign !== 0 &&\n bulgeSign !== prevBulgeSign\n ) {\n signed = -signed\n control = computeArcControlPoint(\n from.x,\n from.y,\n to.x,\n to.y,\n signed,\n peak\n )\n } else if (bulgeSign !== 0) {\n prevBulgeSign = bulgeSign\n }\n }\n\n const tangent0 = rotationScale\n ? bezierTangentAngle(\n 0,\n from.x,\n control.x,\n to.x,\n from.y,\n control.y,\n to.y\n )\n : 0\n const tangent1 = rotationScale\n ? bezierTangentAngle(\n 1,\n from.x,\n control.x,\n to.x,\n from.y,\n control.y,\n to.y\n )\n : 0\n const tangentDelta = rotationScale\n ? wrap(-180, 180, tangent1 - tangent0)\n : 0\n\n return (t: number) => {\n const out: { x: number; y: number; rotate?: number } = {\n x: bezierPoint(t, from.x, control.x, to.x),\n y: bezierPoint(t, from.y, control.y, to.y),\n }\n if (rotationScale) {\n const raw = bezierTangentAngle(\n t,\n from.x,\n control.x,\n to.x,\n from.y,\n control.y,\n to.y\n )\n const baseline = tangent0 + tangentDelta * t\n out.rotate = wrap(-180, 180, raw - baseline) * rotationScale\n }\n return out\n }\n }\n\n return createInterpolator\n}\n\n/**\n * Creates a curved path for `transition.path`:\n *\n * ```ts\n * \n * ```\n *\n * Reuse the returned value (module scope / useMemo / useRef) so its\n * continuity closure survives re-renders — a fresh `arc()` has no memory.\n */\nexport function arc(options: ArcOptions = {}): MotionPath {\n const sample = createArcPath(options)\n\n const path: MotionPath = {\n interpolateProjection(delta) {\n // `from` is the current translate offset (carries any in-flight\n // displacement when interrupted); `to` is the new layout origin.\n // The distance floor avoids visible wobble on tiny shifts.\n const tx = delta.x.translate\n const ty = delta.y.translate\n if (Math.sqrt(tx * tx + ty * ty) < MIN_LAYOUT_DISTANCE) {\n return undefined\n }\n return sample({ x: tx, y: ty }, { x: 0, y: 0 })\n },\n\n animateVisualElement(\n visualElement,\n target,\n transition,\n delay,\n animations\n ) {\n if (!(\"x\" in target || \"y\" in target)) return\n\n const xValue = visualElement.getValue(\n \"x\",\n visualElement.latestValues[\"x\"] ?? 0\n )\n const yValue = visualElement.getValue(\n \"y\",\n visualElement.latestValues[\"y\"] ?? 0\n )\n\n const xRaw = target.x as number | number[] | undefined\n const yRaw = target.y as number | number[] | undefined\n\n const xFrom = ((Array.isArray(xRaw) && xRaw[0] != null\n ? xRaw[0]\n : xValue?.get()) as number) ?? 0\n const yFrom = ((Array.isArray(yRaw) && yRaw[0] != null\n ? yRaw[0]\n : yValue?.get()) as number) ?? 0\n const xTo = (Array.isArray(xRaw)\n ? xRaw[xRaw.length - 1]\n : xRaw ?? xFrom) as number\n const yTo = (Array.isArray(yRaw)\n ? yRaw[yRaw.length - 1]\n : yRaw ?? yFrom) as number\n\n // Interruption needs no flag: x/y already hold the displaced\n // mid-arc position, so xFrom/yFrom carry the continuity geometry.\n const interpolate = sample(\n { x: xFrom, y: yFrom },\n { x: xTo, y: yTo }\n )\n\n // Drive a dedicated `pathRotation` value (composed onto `rotate`\n // at the build sites) rather than `rotate` itself, so a\n // concurrent rotate animation composes and nothing accumulates\n // on interrupt.\n const pathRotationValue =\n interpolate(0).rotate !== undefined\n ? visualElement.getValue(\"pathRotation\", 0)\n : undefined\n\n const pathTransition = {\n delay,\n ...getValueTransition(transition || {}, \"x\"),\n }\n delete (pathTransition as { path?: unknown }).path\n\n const progress = motionValue(0)\n progress.start(\n animateMotionValue(\"\", progress, [0, 1000] as any, {\n ...pathTransition,\n isSync: true,\n velocity: 0,\n onUpdate: (latest: number) => {\n const point = interpolate(latest / 1000)\n xValue?.set(point.x)\n yValue?.set(point.y)\n if (pathRotationValue && point.rotate !== undefined) {\n pathRotationValue.set(point.rotate)\n }\n },\n onComplete: () => {\n xValue?.set(xTo)\n yValue?.set(yTo)\n pathRotationValue?.set(0)\n },\n // Interrupt/cancel must clear our additive contribution\n // so it can't linger on top of the user's `rotate`.\n onStop: () => pathRotationValue?.set(0),\n onCancel: () => pathRotationValue?.set(0),\n })\n )\n\n if (progress.animation) animations.push(progress.animation)\n\n delete (target as { x?: unknown }).x\n delete (target as { y?: unknown }).y\n },\n }\n\n return path\n}\n","import { invariant, isNumericalString } from \"motion-utils\"\nimport { AnyResolvedKeyframe } from \"../types\"\nimport { CSSVariableToken, isCSSVariableToken } from \"./is-css-variable\"\n\n/**\n * Parse Framer's special CSS variable format into a CSS token and a fallback.\n *\n * ```\n * `var(--foo, #fff)` => [`--foo`, '#fff']\n * ```\n *\n * @param current\n */\n\nconst splitCSSVariableRegex =\n // eslint-disable-next-line redos-detector/no-unsafe-regex -- false positive, as it can match a lot of words\n /^var\\(--(?:([\\w-]+)|([\\w-]+), ?([a-zA-Z\\d ()%#.,-]+))\\)/u\nexport function parseCSSVariable(current: string) {\n const match = splitCSSVariableRegex.exec(current)\n if (!match) return [,]\n\n const [, token1, token2, fallback] = match\n return [`--${token1 ?? token2}`, fallback]\n}\n\nconst maxDepth = 4\nexport function getVariableValue(\n current: CSSVariableToken,\n element: Element,\n depth = 1\n): AnyResolvedKeyframe | undefined {\n invariant(\n depth <= maxDepth,\n `Max CSS variable fallback depth detected in property \"${current}\". This may indicate a circular fallback dependency.`,\n \"max-css-var-depth\"\n )\n\n const [token, fallback] = parseCSSVariable(current)\n\n // No CSS variable detected\n if (!token) return\n\n // Attempt to read this CSS variable off the element\n const resolved = window.getComputedStyle(element).getPropertyValue(token)\n\n if (resolved) {\n const trimmed = resolved.trim()\n return isNumericalString(trimmed) ? parseFloat(trimmed) : trimmed\n }\n\n return isCSSVariableToken(fallback)\n ? getVariableValue(fallback, element, depth + 1)\n : fallback\n}\n","import type {\n AnimationDefinition,\n MotionNodeOptions,\n TargetAndTransition,\n TargetResolver,\n} from \"../../node/types\"\nimport type { ResolvedValues } from \"../types\"\n\nfunction getValueState(visualElement?: any): [ResolvedValues, ResolvedValues] {\n const state: [ResolvedValues, ResolvedValues] = [{}, {}]\n\n visualElement?.values.forEach((value: any, key: string) => {\n state[0][key] = value.get()\n state[1][key] = value.getVelocity()\n })\n\n return state\n}\n\nexport function resolveVariantFromProps(\n props: MotionNodeOptions,\n definition: TargetAndTransition | TargetResolver,\n custom?: any,\n visualElement?: any\n): TargetAndTransition\nexport function resolveVariantFromProps(\n props: MotionNodeOptions,\n definition?: AnimationDefinition,\n custom?: any,\n visualElement?: any\n): undefined | TargetAndTransition\nexport function resolveVariantFromProps(\n props: MotionNodeOptions,\n definition?: AnimationDefinition,\n custom?: any,\n visualElement?: any\n) {\n /**\n * If the variant definition is a function, resolve.\n */\n if (typeof definition === \"function\") {\n const [current, velocity] = getValueState(visualElement)\n definition = definition(\n custom !== undefined ? custom : props.custom,\n current,\n velocity\n )\n }\n\n /**\n * If the variant definition is a variant label, or\n * the function returned a variant label, resolve.\n */\n if (typeof definition === \"string\") {\n definition = props.variants && props.variants[definition]\n }\n\n /**\n * At this point we've resolved both functions and variant labels,\n * but the resolved variant label might itself have been a function.\n * If so, resolve. This can only have returned a valid target object.\n */\n if (typeof definition === \"function\") {\n const [current, velocity] = getValueState(visualElement)\n definition = definition(\n custom !== undefined ? custom : props.custom,\n current,\n velocity\n )\n }\n\n return definition\n}\n","import type {\n AnimationDefinition,\n TargetAndTransition,\n TargetResolver,\n} from \"../../node/types\"\nimport { resolveVariantFromProps } from \"./resolve-variants\"\n\n/**\n * Resolves a variant if it's a variant resolver.\n * Uses `any` type for visualElement to avoid circular dependencies.\n */\nexport function resolveVariant(\n visualElement: any,\n definition?: TargetAndTransition | TargetResolver,\n custom?: any\n): TargetAndTransition\nexport function resolveVariant(\n visualElement: any,\n definition?: AnimationDefinition,\n custom?: any\n): TargetAndTransition | undefined\nexport function resolveVariant(\n visualElement: any,\n definition?: AnimationDefinition,\n custom?: any\n) {\n const props = visualElement.getProps()\n return resolveVariantFromProps(\n props,\n definition,\n custom !== undefined ? custom : props.custom,\n visualElement\n )\n}\n","import { transformPropOrder } from \"./keys-transform\"\n\nexport const positionalKeys = new Set([\n \"width\",\n \"height\",\n \"top\",\n \"left\",\n \"right\",\n \"bottom\",\n ...transformPropOrder,\n])\n","import type { UnresolvedValueKeyframe, ValueKeyframesDefinition } from \"../../animation/types\"\n\nexport const isKeyframesTarget = (\n v: ValueKeyframesDefinition\n): v is UnresolvedValueKeyframe[] => {\n return Array.isArray(v)\n}\n","import { motionValue } from \"../../value\"\nimport { resolveVariant } from \"./resolve-dynamic-variants\"\nimport { isKeyframesTarget } from \"./is-keyframes-target\"\nimport type { AnimationDefinition } from \"../../node/types\"\nimport type {\n AnyResolvedKeyframe,\n UnresolvedValueKeyframe,\n ValueKeyframesDefinition,\n} from \"../../animation/types\"\nimport type { VisualElement } from \"../VisualElement\"\n\n/**\n * Set VisualElement's MotionValue, creating a new MotionValue for it if\n * it doesn't exist.\n */\nfunction setMotionValue(\n visualElement: VisualElement,\n key: string,\n value: AnyResolvedKeyframe\n) {\n if (visualElement.hasValue(key)) {\n visualElement.getValue(key)!.set(value)\n } else {\n visualElement.addValue(key, motionValue(value))\n }\n}\n\nfunction resolveFinalValueInKeyframes(\n v: ValueKeyframesDefinition\n): UnresolvedValueKeyframe {\n // TODO maybe throw if v.length - 1 is placeholder token?\n return isKeyframesTarget(v) ? v[v.length - 1] || 0 : v\n}\n\nexport function setTarget(\n visualElement: VisualElement,\n definition: AnimationDefinition\n) {\n const resolved = resolveVariant(visualElement, definition)\n let { transitionEnd = {}, transition = {}, ...target } = resolved || {}\n\n target = { ...target, ...transitionEnd }\n\n for (const key in target) {\n const value = resolveFinalValueInKeyframes(\n target[key as keyof typeof target] as any\n )\n setMotionValue(visualElement, key, value as AnyResolvedKeyframe)\n }\n}\n","import type { MotionValue } from \"..\"\n\nexport const isMotionValue = (value: any): value is MotionValue =>\n Boolean(value && value.getVelocity)\n","import { isMotionValue } from \"../utils/is-motion-value\"\nimport type { WillChange } from \"./types\"\n\nexport function isWillChangeMotionValue(value: any): value is WillChange {\n return Boolean(isMotionValue(value) && (value as WillChange).add)\n}\n","import { MotionGlobalConfig } from \"motion-utils\"\nimport type { VisualElement } from \"../../render/VisualElement\"\nimport { isWillChangeMotionValue } from \"./is\"\n\nexport function addValueToWillChange(\n visualElement: VisualElement,\n key: string\n) {\n const willChange = visualElement.getValue(\"willChange\")\n\n /**\n * It could be that a user has set willChange to a regular MotionValue,\n * in which case we can't add the value to it.\n */\n if (isWillChangeMotionValue(willChange)) {\n return willChange.add(key)\n } else if (!willChange && MotionGlobalConfig.WillChange) {\n const newWillChange = new MotionGlobalConfig.WillChange(\"auto\")\n\n visualElement.addValue(\"willChange\", newWillChange)\n newWillChange.add(key)\n }\n}\n","export function camelToDash(str: string): string {\n return str.replace(/([A-Z])/g, (match) => `-${match.toLowerCase()}`)\n}\n","import { camelToDash } from \"../../render/dom/utils/camel-to-dash\"\n\nexport const optimizedAppearDataId = \"framerAppearId\"\n\nexport const optimizedAppearDataAttribute =\n \"data-\" + camelToDash(optimizedAppearDataId) as \"data-framer-appear-id\"\n","import { optimizedAppearDataAttribute } from \"./data-id\"\nimport type { WithAppearProps } from \"./types\"\n\nexport function getOptimisedAppearId(\n visualElement: WithAppearProps\n): string | undefined {\n return visualElement.props[optimizedAppearDataAttribute]\n}\n","import { frame } from \"../../frameloop\"\nimport { getValueTransition } from \"../utils/get-value-transition\"\nimport { resolveTransition } from \"../utils/resolve-transition\"\nimport { positionalKeys } from \"../../render/utils/keys-position\"\nimport { setTarget } from \"../../render/utils/setters\"\nimport { addValueToWillChange } from \"../../value/will-change/add-will-change\"\nimport { getOptimisedAppearId } from \"../optimized-appear/get-appear-id\"\nimport { animateMotionValue } from \"./motion-value\"\nimport type { MotionPath } from \"../types\"\nimport type { VisualElementAnimationOptions } from \"./types\"\nimport type { AnimationPlaybackControlsWithThen } from \"../types\"\nimport type { TargetAndTransition } from \"../../node/types\"\nimport type { AnimationTypeState } from \"../../render/utils/animation-state\"\nimport type { VisualElement } from \"../../render/VisualElement\"\n\n/**\n * Decide whether we should block this animation. Previously, we achieved this\n * just by checking whether the key was listed in protectedKeys, but this\n * posed problems if an animation was triggered by afterChildren and protectedKeys\n * had been set to true in the meantime.\n */\nfunction shouldBlockAnimation(\n { protectedKeys, needsAnimating }: AnimationTypeState,\n key: string\n) {\n const shouldBlock =\n protectedKeys.hasOwnProperty(key) && needsAnimating[key] !== true\n\n needsAnimating[key] = false\n return shouldBlock\n}\n\nexport function animateTarget(\n visualElement: VisualElement,\n targetAndTransition: TargetAndTransition,\n { delay = 0, transitionOverride, type }: VisualElementAnimationOptions = {}\n): AnimationPlaybackControlsWithThen[] {\n let {\n transition,\n transitionEnd,\n ...target\n } = targetAndTransition\n\n const defaultTransition = visualElement.getDefaultTransition()\n transition = transition\n ? resolveTransition(transition, defaultTransition)\n : defaultTransition\n\n const reduceMotion = (transition as { reduceMotion?: boolean })?.reduceMotion\n const skipAnimations = transition?.skipAnimations\n\n if (transitionOverride) transition = transitionOverride\n\n const animations: AnimationPlaybackControlsWithThen[] = []\n\n const animationTypeState =\n type &&\n visualElement.animationState &&\n visualElement.animationState.getState()[type]\n\n const path = (transition as { path?: MotionPath } | undefined)?.path\n if (path) {\n // path mutates `target` to claim x/y; loop below skips them.\n path.animateVisualElement(\n visualElement,\n target,\n transition,\n delay,\n animations\n )\n }\n\n for (const key in target) {\n const value = visualElement.getValue(\n key,\n visualElement.latestValues[key] ?? null\n )\n const valueTarget = target[key as keyof typeof target]\n\n if (\n valueTarget === undefined ||\n (animationTypeState &&\n shouldBlockAnimation(animationTypeState, key))\n ) {\n continue\n }\n\n const valueTransition = {\n delay,\n ...getValueTransition(transition || {}, key),\n }\n\n if (skipAnimations) valueTransition.skipAnimations = true\n\n /**\n * If the value is already at the defined target, skip the animation.\n * We still re-assert the value via frame.update to take precedence\n * over any stale transitionEnd callbacks from previous animations.\n */\n const currentValue = value.get()\n if (\n currentValue !== undefined &&\n !value.isAnimating() &&\n !Array.isArray(valueTarget) &&\n valueTarget === currentValue &&\n !valueTransition.velocity\n ) {\n frame.update(() => value.set(valueTarget as any))\n continue\n }\n\n /**\n * If this is the first time a value is being animated, check\n * to see if we're handling off from an existing animation.\n */\n let isHandoff = false\n if (window.MotionHandoffAnimation) {\n const appearId = getOptimisedAppearId(visualElement)\n\n if (appearId) {\n const startTime = window.MotionHandoffAnimation(\n appearId,\n key,\n frame\n )\n\n if (startTime !== null) {\n valueTransition.startTime = startTime\n isHandoff = true\n }\n }\n }\n\n addValueToWillChange(visualElement, key)\n\n const shouldReduceMotion =\n reduceMotion ?? visualElement.shouldReduceMotion\n\n value.start(\n animateMotionValue(\n key,\n value,\n valueTarget,\n shouldReduceMotion && positionalKeys.has(key)\n ? { type: false }\n : valueTransition,\n visualElement,\n isHandoff\n )\n )\n\n const animation = value.animation\n\n if (animation) {\n animations.push(animation)\n }\n }\n\n if (transitionEnd) {\n const applyTransitionEnd = () =>\n frame.update(() => {\n transitionEnd && setTarget(visualElement, transitionEnd)\n })\n\n if (animations.length) {\n Promise.all(animations).then(applyTransitionEnd)\n } else {\n applyTransitionEnd()\n }\n }\n\n return animations\n}\n","import { resolveVariant } from \"../../render/utils/resolve-dynamic-variants\"\nimport { calcChildStagger } from \"../utils/calc-child-stagger\"\nimport type { VisualElementAnimationOptions } from \"./types\"\nimport { animateTarget } from \"./visual-element-target\"\nimport type { DynamicOption } from \"../types\"\nimport type { VisualElement } from \"../../render/VisualElement\"\n\nexport function animateVariant(\n visualElement: VisualElement,\n variant: string,\n options: VisualElementAnimationOptions = {}\n): Promise {\n const resolved = resolveVariant(\n visualElement,\n variant,\n options.type === \"exit\"\n ? visualElement.presenceContext?.custom\n : undefined\n )\n\n let { transition = visualElement.getDefaultTransition() || {} } =\n resolved || {}\n\n if (options.transitionOverride) {\n transition = options.transitionOverride\n }\n\n /**\n * If we have a variant, create a callback that runs it as an animation.\n * Otherwise, we resolve a Promise immediately for a composable no-op.\n */\n const getAnimation: () => Promise = resolved\n ? () => Promise.all(animateTarget(visualElement, resolved, options))\n : () => Promise.resolve()\n\n /**\n * If we have children, create a callback that runs all their animations.\n * Otherwise, we resolve a Promise immediately for a composable no-op.\n */\n const getChildAnimations =\n visualElement.variantChildren && visualElement.variantChildren.size\n ? (forwardDelay = 0) => {\n const {\n delayChildren = 0,\n staggerChildren,\n staggerDirection,\n } = transition\n\n return animateChildren(\n visualElement,\n variant,\n forwardDelay,\n delayChildren,\n staggerChildren,\n staggerDirection,\n options\n )\n }\n : () => Promise.resolve()\n\n /**\n * If the transition explicitly defines a \"when\" option, we need to resolve either\n * this animation or all children animations before playing the other.\n */\n const { when } = transition\n if (when) {\n const [first, last] =\n when === \"beforeChildren\"\n ? [getAnimation, getChildAnimations]\n : [getChildAnimations, getAnimation]\n\n return first().then(() => last())\n } else {\n return Promise.all([getAnimation(), getChildAnimations(options.delay)])\n }\n}\n\nfunction animateChildren(\n visualElement: VisualElement,\n variant: string,\n delay: number = 0,\n delayChildren: number | DynamicOption = 0,\n staggerChildren = 0,\n staggerDirection = 1,\n options: VisualElementAnimationOptions\n) {\n const animations: Promise[] = []\n\n for (const child of visualElement.variantChildren!) {\n child.notify(\"AnimationStart\", variant)\n animations.push(\n animateVariant(child, variant, {\n ...options,\n delay:\n delay +\n (typeof delayChildren === \"function\" ? 0 : delayChildren) +\n calcChildStagger(\n visualElement.variantChildren!,\n child,\n delayChildren,\n staggerChildren,\n staggerDirection\n ),\n }).then(() => child.notify(\"AnimationComplete\", variant))\n )\n }\n\n return Promise.all(animations)\n}\n","import { resolveVariant } from \"../../render/utils/resolve-dynamic-variants\"\nimport type { AnimationDefinition } from \"../../node/types\"\nimport type { VisualElement } from \"../../render/VisualElement\"\nimport type { VisualElementAnimationOptions } from \"./types\"\nimport { animateTarget } from \"./visual-element-target\"\nimport { animateVariant } from \"./visual-element-variant\"\n\nexport function animateVisualElement(\n visualElement: VisualElement,\n definition: AnimationDefinition,\n options: VisualElementAnimationOptions = {}\n) {\n visualElement.notify(\"AnimationStart\", definition)\n let animation: Promise\n\n if (Array.isArray(definition)) {\n const animations = definition.map((variant) =>\n animateVariant(visualElement, variant, options)\n )\n animation = Promise.all(animations)\n } else if (typeof definition === \"string\") {\n animation = animateVariant(visualElement, definition, options)\n } else {\n const resolvedDefinition =\n typeof definition === \"function\"\n ? resolveVariant(visualElement, definition, options.custom)\n : definition\n\n animation = Promise.all(\n animateTarget(visualElement, resolvedDefinition, options)\n )\n }\n\n return animation.then(() => {\n visualElement.notify(\"AnimationComplete\", definition)\n })\n}\n","import { ValueType } from \"./types\"\n\n/**\n * ValueType for \"auto\"\n */\nexport const auto: ValueType = {\n test: (v: any) => v === \"auto\",\n parse: (v) => v,\n}\n","import { ValueType } from \"./types\"\n\n/**\n * Tests a provided value against a ValueType\n */\nexport const testValueType = (v: any) => (type: ValueType) => type.test(v)\n","import { auto } from \"./auto\"\nimport { number } from \"./numbers\"\nimport { degrees, percent, px, vh, vw } from \"./numbers/units\"\nimport { testValueType } from \"./test\"\n\n/**\n * A list of value types commonly used for dimensions\n */\nexport const dimensionValueTypes = [number, px, percent, degrees, vw, vh, auto]\n\n/**\n * Tests a dimensional value against the list of dimension ValueTypes\n */\nexport const findDimensionValueType = (v: any) =>\n dimensionValueTypes.find(testValueType(v))\n","import { isZeroValueString } from \"motion-utils\"\nimport { AnyResolvedKeyframe } from \"../../types\"\n\nexport function isNone(value: AnyResolvedKeyframe | null) {\n if (typeof value === \"number\") {\n return value === 0\n } else if (value !== null) {\n return value === \"none\" || value === \"0\" || isZeroValueString(value)\n } else {\n return true\n }\n}\n","import { complex } from \".\"\nimport { floatRegex } from \"../utils/float-regex\"\n\n/**\n * Properties that should default to 1 or 100%\n */\nconst maxDefaults = new Set([\"brightness\", \"contrast\", \"saturate\", \"opacity\"])\n\nfunction applyDefaultFilter(v: string) {\n const [name, value] = v.slice(0, -1).split(\"(\")\n\n if (name === \"drop-shadow\") return v\n\n const [number] = value.match(floatRegex) || []\n if (!number) return v\n\n const unit = value.replace(number, \"\")\n let defaultValue = maxDefaults.has(name) ? 1 : 0\n if (number !== value) defaultValue *= 100\n\n return name + \"(\" + defaultValue + unit + \")\"\n}\n\nconst functionRegex = /\\b([a-z-]*)\\(.*?\\)/gu\n\nexport const filter = {\n ...complex,\n getAnimatableNone: (v: string) => {\n const functions = v.match(functionRegex)\n return functions ? functions.map(applyDefaultFilter).join(\" \") : v\n },\n}\n","import { complex } from \".\"\nimport { AnyResolvedKeyframe } from \"../../../animation/types\"\n\nexport const mask = {\n ...complex,\n getAnimatableNone: (v: AnyResolvedKeyframe) => {\n const parsed = complex.parse(v)\n const transformer = complex.createTransformer(v)\n return transformer(\n parsed.map((v) =>\n typeof v === \"number\" ? 0 : typeof v === \"object\" ? { ...v, alpha: 1 } : v\n )\n )\n },\n}\n","import { number } from \"./numbers\"\n\nexport const int = {\n ...number,\n transform: Math.round,\n}\n","import { alpha, scale } from \"../numbers\"\nimport { degrees, progressPercentage, px } from \"../numbers/units\"\nimport { ValueTypeMap } from \"./types\"\n\nexport const transformValueTypes: ValueTypeMap = {\n rotate: degrees,\n /**\n * Internal channel for `transition.path` orientToPath. Composed onto\n * `rotate` at the transform-build sites so the user's `rotate` is\n * never read or overwritten. Not part of `transformPropOrder`.\n */\n pathRotation: degrees,\n rotateX: degrees,\n rotateY: degrees,\n rotateZ: degrees,\n scale,\n scaleX: scale,\n scaleY: scale,\n scaleZ: scale,\n skew: degrees,\n skewX: degrees,\n skewY: degrees,\n distance: px,\n translateX: px,\n translateY: px,\n translateZ: px,\n x: px,\n y: px,\n z: px,\n perspective: px,\n transformPerspective: px,\n opacity: alpha,\n originX: progressPercentage,\n originY: progressPercentage,\n originZ: px,\n}\n","import { int } from \"../int\"\nimport { alpha } from \"../numbers\"\nimport { px } from \"../numbers/units\"\nimport { transformValueTypes } from \"./transform\"\nimport { ValueTypeMap } from \"./types\"\n\nexport const numberValueTypes: ValueTypeMap = {\n // Border props\n borderWidth: px,\n borderTopWidth: px,\n borderRightWidth: px,\n borderBottomWidth: px,\n borderLeftWidth: px,\n borderRadius: px,\n borderTopLeftRadius: px,\n borderTopRightRadius: px,\n borderBottomRightRadius: px,\n borderBottomLeftRadius: px,\n\n // Positioning props\n width: px,\n maxWidth: px,\n height: px,\n maxHeight: px,\n top: px,\n right: px,\n bottom: px,\n left: px,\n inset: px,\n insetBlock: px,\n insetBlockStart: px,\n insetBlockEnd: px,\n insetInline: px,\n insetInlineStart: px,\n insetInlineEnd: px,\n\n // Spacing props\n padding: px,\n paddingTop: px,\n paddingRight: px,\n paddingBottom: px,\n paddingLeft: px,\n paddingBlock: px,\n paddingBlockStart: px,\n paddingBlockEnd: px,\n paddingInline: px,\n paddingInlineStart: px,\n paddingInlineEnd: px,\n margin: px,\n marginTop: px,\n marginRight: px,\n marginBottom: px,\n marginLeft: px,\n marginBlock: px,\n marginBlockStart: px,\n marginBlockEnd: px,\n marginInline: px,\n marginInlineStart: px,\n marginInlineEnd: px,\n\n // Typography\n fontSize: px,\n\n // Misc\n backgroundPositionX: px,\n backgroundPositionY: px,\n\n ...transformValueTypes,\n zIndex: int,\n\n // SVG\n fillOpacity: alpha,\n strokeOpacity: alpha,\n numOctaves: int,\n}\n","import { color } from \"../color\"\nimport { filter } from \"../complex/filter\"\nimport { mask } from \"../complex/mask\"\nimport { numberValueTypes } from \"./number\"\nimport { ValueTypeMap } from \"./types\"\n\n/**\n * A map of default value types for common values\n */\nexport const defaultValueTypes: ValueTypeMap = {\n ...numberValueTypes,\n\n // Color props\n color,\n backgroundColor: color,\n outlineColor: color,\n fill: color,\n stroke: color,\n\n // Border props\n borderColor: color,\n borderTopColor: color,\n borderRightColor: color,\n borderBottomColor: color,\n borderLeftColor: color,\n filter,\n WebkitFilter: filter,\n mask,\n WebkitMask: mask,\n}\n\n/**\n * Gets the default ValueType for the provided value key\n */\nexport const getDefaultValueType = (key: string) => defaultValueTypes[key]\n","import { complex } from \"../complex\"\nimport { filter } from \"../complex/filter\"\nimport { mask } from \"../complex/mask\"\nimport { getDefaultValueType } from \"../maps/defaults\"\n\nconst customTypes = /*@__PURE__*/ new Set([filter, mask])\n\nexport function getAnimatableNone(key: string, value: string) {\n let defaultValueType = getDefaultValueType(key)\n if (!customTypes.has(defaultValueType as any)) defaultValueType = complex\n // If value is not recognised as animatable, ie \"none\", create an animatable version origin based on the target\n return defaultValueType.getAnimatableNone\n ? defaultValueType.getAnimatableNone(value)\n : undefined\n}\n","import { analyseComplexValue } from \"../../../value/types/complex\"\nimport { getAnimatableNone } from \"../../../value/types/utils/animatable-none\"\nimport { AnyResolvedKeyframe } from \"../../types\"\nimport { UnresolvedKeyframes } from \"../KeyframesResolver\"\n\n/**\n * If we encounter keyframes like \"none\" or \"0\" and we also have keyframes like\n * \"#fff\" or \"200px 200px\" we want to find a keyframe to serve as a template for\n * the \"none\" keyframes. In this case \"#fff\" or \"200px 200px\" - then these get turned into\n * zero equivalents, i.e. \"#fff0\" or \"0px 0px\".\n */\nconst invalidTemplates = new Set([\"auto\", \"none\", \"0\"])\n\nexport function makeNoneKeyframesAnimatable(\n unresolvedKeyframes: UnresolvedKeyframes,\n noneKeyframeIndexes: number[],\n name?: string\n) {\n let i = 0\n let animatableTemplate: string | undefined = undefined\n while (i < unresolvedKeyframes.length && !animatableTemplate) {\n const keyframe = unresolvedKeyframes[i]\n if (\n typeof keyframe === \"string\" &&\n !invalidTemplates.has(keyframe) &&\n analyseComplexValue(keyframe).values.length\n ) {\n animatableTemplate = unresolvedKeyframes[i] as string\n }\n i++\n }\n\n if (animatableTemplate && name) {\n for (const noneIndex of noneKeyframeIndexes) {\n unresolvedKeyframes[noneIndex] = getAnimatableNone(\n name,\n animatableTemplate\n )\n }\n }\n}\n","import { positionalKeys } from \"../../render/utils/keys-position\"\nimport { MotionValue } from \"../../value\"\nimport { findDimensionValueType } from \"../../value/types/dimensions\"\nimport { AnyResolvedKeyframe } from \"../types\"\nimport { getVariableValue } from \"../utils/css-variables-conversion\"\nimport {\n containsCSSVariable,\n isCSSVariableToken,\n} from \"../utils/is-css-variable\"\nimport {\n KeyframeResolver,\n OnKeyframesResolved,\n UnresolvedKeyframes,\n} from \"./KeyframesResolver\"\nimport { WithRender } from \"./types\"\nimport { isNone } from \"./utils/is-none\"\nimport { makeNoneKeyframesAnimatable } from \"./utils/make-none-animatable\"\nimport { isNumOrPxType, positionalValues } from \"./utils/unit-conversion\"\n\nexport class DOMKeyframesResolver<\n T extends AnyResolvedKeyframe\n> extends KeyframeResolver {\n name: string\n element?: WithRender\n\n private removedTransforms?: [string, AnyResolvedKeyframe][]\n private measuredOrigin?: AnyResolvedKeyframe\n\n constructor(\n unresolvedKeyframes: UnresolvedKeyframes,\n onComplete: OnKeyframesResolved,\n name?: string,\n motionValue?: MotionValue,\n element?: WithRender\n ) {\n super(unresolvedKeyframes, onComplete, name, motionValue, element, true)\n }\n\n readKeyframes() {\n const { unresolvedKeyframes, element, name } = this\n\n if (!element || !element.current) return\n\n super.readKeyframes()\n\n /**\n * If any keyframe is a CSS variable, we need to find its value by sampling the element\n */\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n let keyframe = unresolvedKeyframes[i]\n\n if (typeof keyframe === \"string\") {\n keyframe = keyframe.trim()\n\n if (isCSSVariableToken(keyframe)) {\n const resolved = getVariableValue(keyframe, element.current)\n\n if (resolved !== undefined) {\n unresolvedKeyframes[i] = resolved as T\n }\n\n if (i === unresolvedKeyframes.length - 1) {\n this.finalKeyframe = keyframe as T\n }\n }\n }\n }\n\n /**\n * Resolve \"none\" values. We do this potentially twice - once before and once after measuring keyframes.\n * This could be seen as inefficient but it's a trade-off to avoid measurements in more situations, which\n * have a far bigger performance impact.\n */\n this.resolveNoneKeyframes()\n\n /**\n * Check to see if unit type has changed. If so schedule jobs that will\n * temporarily set styles to the destination keyframes.\n * Skip if we have more than two keyframes or this isn't a positional value.\n * TODO: We can throw if there are multiple keyframes and the value type changes.\n */\n if (!positionalKeys.has(name) || unresolvedKeyframes.length !== 2) {\n return\n }\n\n const [origin, target] = unresolvedKeyframes\n const originType = findDimensionValueType(origin)\n const targetType = findDimensionValueType(target)\n\n /**\n * If one keyframe contains embedded CSS variables (e.g. in calc()) and the other\n * doesn't, we need to measure to convert to pixels. This handles GitHub issue #3410.\n */\n const originHasVar = containsCSSVariable(origin)\n const targetHasVar = containsCSSVariable(target)\n\n if (originHasVar !== targetHasVar && positionalValues[name]) {\n this.needsMeasurement = true\n return\n }\n\n /**\n * Either we don't recognise these value types or we can animate between them.\n */\n if (originType === targetType) return\n\n /**\n * If both values are numbers or pixels, we can animate between them by\n * converting them to numbers.\n */\n if (isNumOrPxType(originType) && isNumOrPxType(targetType)) {\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n const value = unresolvedKeyframes[i]\n if (typeof value === \"string\") {\n unresolvedKeyframes[i] = parseFloat(value as string)\n }\n }\n } else if (positionalValues[name]) {\n /**\n * Else, the only way to resolve this is by measuring the element.\n */\n this.needsMeasurement = true\n }\n }\n\n resolveNoneKeyframes() {\n const { unresolvedKeyframes, name } = this\n\n const noneKeyframeIndexes: number[] = []\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n if (\n unresolvedKeyframes[i] === null ||\n isNone(unresolvedKeyframes[i])\n ) {\n noneKeyframeIndexes.push(i)\n }\n }\n\n if (noneKeyframeIndexes.length) {\n makeNoneKeyframesAnimatable(\n unresolvedKeyframes,\n noneKeyframeIndexes,\n name\n )\n }\n }\n\n measureInitialState() {\n const { element, unresolvedKeyframes, name } = this\n\n if (!element || !element.current) return\n\n if (name === \"height\") {\n this.suspendedScrollY = window.pageYOffset\n }\n\n this.measuredOrigin = positionalValues[name](\n element.measureViewportBox(),\n window.getComputedStyle(element.current)\n )\n\n unresolvedKeyframes[0] = this.measuredOrigin\n\n // Set final key frame to measure after next render\n const measureKeyframe =\n unresolvedKeyframes[unresolvedKeyframes.length - 1]\n\n if (measureKeyframe !== undefined) {\n element.getValue(name, measureKeyframe).jump(measureKeyframe, false)\n }\n }\n\n measureEndState() {\n const { element, name, unresolvedKeyframes } = this\n\n if (!element || !element.current) return\n\n const value = element.getValue(name)\n value && value.jump(this.measuredOrigin, false)\n\n const finalKeyframeIndex = unresolvedKeyframes.length - 1\n const finalKeyframe = unresolvedKeyframes[finalKeyframeIndex]\n\n unresolvedKeyframes[finalKeyframeIndex] = positionalValues[name](\n element.measureViewportBox(),\n window.getComputedStyle(element.current)\n ) as any\n\n if (finalKeyframe !== null && this.finalKeyframe === undefined) {\n this.finalKeyframe = finalKeyframe as T\n }\n\n // If we removed transform values, reapply them before the next render\n if (this.removedTransforms?.length) {\n this.removedTransforms.forEach(\n ([unsetTransformName, unsetTransformValue]) => {\n element\n .getValue(unsetTransformName)!\n .set(unsetTransformValue)\n }\n )\n }\n\n this.resolveNoneKeyframes()\n }\n}\n","/**\n * The four corner-radius longhands. Shared so the projection mixer, scale\n * corrector, WAAPI px-value set and view-transition crop pass don't each carry\n * their own copy. Order is irrelevant - every consumer mixes/corrects/animates\n * each corner independently.\n */\nexport const cornerRadiusProps = [\n \"borderTopLeftRadius\",\n \"borderTopRightRadius\",\n \"borderBottomRightRadius\",\n \"borderBottomLeftRadius\",\n] as const\n","import { cornerRadiusProps } from \"../../../utils/border-radius\"\n\nexport const pxValues = new Set([\n // Border props\n \"borderWidth\",\n \"borderTopWidth\",\n \"borderRightWidth\",\n \"borderBottomWidth\",\n \"borderLeftWidth\",\n \"borderRadius\",\n ...cornerRadiusProps,\n // Positioning props\n \"width\",\n \"maxWidth\",\n \"height\",\n \"maxHeight\",\n \"top\",\n \"right\",\n \"bottom\",\n \"left\",\n \"inset\",\n \"insetBlock\",\n \"insetBlockStart\",\n \"insetBlockEnd\",\n \"insetInline\",\n \"insetInlineStart\",\n \"insetInlineEnd\",\n // Spacing props\n \"padding\",\n \"paddingTop\",\n \"paddingRight\",\n \"paddingBottom\",\n \"paddingLeft\",\n \"paddingBlock\",\n \"paddingBlockStart\",\n \"paddingBlockEnd\",\n \"paddingInline\",\n \"paddingInlineStart\",\n \"paddingInlineEnd\",\n \"margin\",\n \"marginTop\",\n \"marginRight\",\n \"marginBottom\",\n \"marginLeft\",\n \"marginBlock\",\n \"marginBlockStart\",\n \"marginBlockEnd\",\n \"marginInline\",\n \"marginInlineStart\",\n \"marginInlineEnd\",\n // Typography\n \"fontSize\",\n // Misc\n \"backgroundPositionX\",\n \"backgroundPositionY\",\n])\n","import { UnresolvedValueKeyframe, ValueKeyframe } from \"../../types\"\nimport { pxValues } from \"../../waapi/utils/px-values\"\n\nexport function applyPxDefaults(\n keyframes: ValueKeyframe[] | UnresolvedValueKeyframe[],\n name: string\n) {\n for (let i = 0; i < keyframes.length; i++) {\n if (typeof keyframes[i] === \"number\" && pxValues.has(name)) {\n keyframes[i] = keyframes[i] + \"px\"\n }\n }\n}\n","import { Easing, isBezierDefinition } from \"motion-utils\"\nimport { supportsLinearEasing } from \"../../../utils/supports/linear-easing\"\nimport { supportedWaapiEasing } from \"./supported\"\n\nexport function isWaapiSupportedEasing(easing?: Easing | Easing[]): boolean {\n return Boolean(\n (typeof easing === \"function\" && supportsLinearEasing()) ||\n !easing ||\n (typeof easing === \"string\" &&\n (easing in supportedWaapiEasing || supportsLinearEasing())) ||\n isBezierDefinition(easing) ||\n (Array.isArray(easing) && easing.every(isWaapiSupportedEasing))\n )\n}\n","import { memo } from \"motion-utils\"\n\nexport const supportsPartialKeyframes = /*@__PURE__*/ memo(() => {\n try {\n document.createElement(\"div\").animate({ opacity: [1] })\n } catch (e) {\n return false\n }\n return true\n})\n","export type ElementOrSelector =\n | Element\n | Element[]\n | NodeListOf\n | string\n | null\n | undefined\n\nexport interface WithQuerySelectorAll {\n querySelectorAll: Element[\"querySelectorAll\"]\n}\n\nexport interface AnimationScope {\n readonly current: T\n animations: any[] // TODO: Refactor to types package AnimationPlaybackControls[]\n}\n\nexport interface SelectorCache {\n [key: string]: NodeListOf\n}\n\nexport function resolveElements(\n elementOrSelector: ElementOrSelector,\n scope?: AnimationScope,\n selectorCache?: SelectorCache\n): Element[] {\n if (elementOrSelector == null) {\n return []\n }\n\n if (elementOrSelector instanceof EventTarget) {\n return [elementOrSelector]\n } else if (typeof elementOrSelector === \"string\") {\n let root: WithQuerySelectorAll = document\n\n if (scope) {\n root = scope.current\n }\n\n const elements =\n selectorCache?.[elementOrSelector] ??\n root.querySelectorAll(elementOrSelector)\n\n return elements ? Array.from(elements) : []\n }\n\n return Array.from(elementOrSelector).filter(\n (element): element is Element => element != null\n )\n}\n","import {\n ElementOrSelector,\n resolveElements,\n} from \"../../utils/resolve-elements\"\nimport { MotionValue } from \"../../value\"\n\nexport function createSelectorEffect(\n subjectEffect: (\n subject: T,\n values: Record\n ) => VoidFunction\n) {\n return (\n subject: ElementOrSelector,\n values: Record\n ) => {\n const elements = resolveElements(subject)\n const subscriptions: VoidFunction[] = []\n\n for (const element of elements) {\n const remove = subjectEffect(element as T, values)\n subscriptions.push(remove)\n }\n\n return () => {\n for (const remove of subscriptions) remove()\n }\n }\n}\n","import { ValueType } from \"../types\"\n\n/**\n * Provided a value and a ValueType, returns the value as that value type.\n */\nexport const getValueAsType = (value: any, type?: ValueType) => {\n return type && typeof value === \"number\"\n ? (type as any).transform(value)\n : value\n}\n","import { AnyResolvedKeyframe } from \"../animation/types\"\nimport { cancelFrame, frame } from \"../frameloop/frame\"\nimport { MotionValue } from \"../value\"\nimport { numberValueTypes } from \"../value/types/maps/number\"\nimport { getValueAsType } from \"../value/types/utils/get-as-type\"\n\nexport class MotionValueState {\n latest: { [name: string]: AnyResolvedKeyframe } = {}\n\n private values = new Map<\n string,\n { value: MotionValue; onRemove: VoidFunction }\n >()\n\n set(\n name: string,\n value: MotionValue,\n render?: VoidFunction,\n computed?: MotionValue,\n useDefaultValueType = true\n ) {\n const existingValue = this.values.get(name)\n\n if (existingValue) {\n existingValue.onRemove()\n }\n\n const onChange = () => {\n const v = value.get()\n\n if (useDefaultValueType) {\n this.latest[name] = getValueAsType(v, numberValueTypes[name])\n } else {\n this.latest[name] = v\n }\n\n render && frame.render(render)\n }\n\n onChange()\n\n const cancelOnChange = value.on(\"change\", onChange)\n\n computed && value.addDependent(computed)\n\n const remove = () => {\n cancelOnChange()\n render && cancelFrame(render)\n this.values.delete(name)\n computed && value.removeDependent(computed)\n }\n\n this.values.set(name, { value, onRemove: remove })\n\n return remove\n }\n\n get(name: string): MotionValue | undefined {\n return this.values.get(name)?.value\n }\n}\n","import { MotionValue } from \"../../value\"\nimport { MotionValueState } from \"../MotionValueState\"\n\nexport function createEffect(\n addValue: (\n subject: Subject,\n state: MotionValueState,\n key: string,\n value: MotionValue\n ) => VoidFunction\n) {\n const stateCache = new WeakMap()\n\n return (\n subject: Subject,\n values: Record\n ): VoidFunction => {\n const state = stateCache.get(subject) ?? new MotionValueState()\n\n stateCache.set(subject, state)\n\n const subscriptions: VoidFunction[] = []\n\n for (const key in values) {\n const value = values[key]\n const remove = addValue(subject, state, key, value)\n subscriptions.push(remove)\n }\n\n return () => {\n for (const cancel of subscriptions) cancel()\n }\n }\n}\n","import { camelToDash } from \"../../render/dom/utils/camel-to-dash\"\nimport { MotionValue } from \"../../value\"\nimport { MotionValueState } from \"../MotionValueState\"\nimport { createSelectorEffect } from \"../utils/create-dom-effect\"\nimport { createEffect } from \"../utils/create-effect\"\n\nfunction canSetAsProperty(element: HTMLElement | SVGElement, name: string) {\n if (!(name in element)) return false\n\n const descriptor =\n Object.getOwnPropertyDescriptor(Object.getPrototypeOf(element), name) ||\n Object.getOwnPropertyDescriptor(element, name)\n\n // Check if it has a setter\n return descriptor && typeof descriptor.set === \"function\"\n}\n\nexport const addAttrValue = (\n element: HTMLElement | SVGElement,\n state: MotionValueState,\n key: string,\n value: MotionValue\n) => {\n const isProp = canSetAsProperty(element, key)\n const name = isProp\n ? key\n : key.startsWith(\"data\") || key.startsWith(\"aria\")\n ? camelToDash(key)\n : key\n\n /**\n * Set attribute directly via property if available\n */\n const render = isProp\n ? () => {\n ;(element as any)[name] = state.latest[key]\n }\n : () => {\n const v = state.latest[key]\n if (v === null || v === undefined) {\n element.removeAttribute(name)\n } else {\n element.setAttribute(name, String(v))\n }\n }\n\n return state.set(key, value, render)\n}\n\nexport const attrEffect = /*@__PURE__*/ createSelectorEffect(\n /*@__PURE__*/ createEffect(addAttrValue)\n)\n","import { MotionValue } from \"../../value\"\nimport { MotionValueState } from \"../MotionValueState\"\nimport { createEffect } from \"../utils/create-effect\"\n\nexport const propEffect = /*@__PURE__*/ createEffect(\n (\n subject: { [key: string]: any },\n state: MotionValueState,\n key: string,\n value: MotionValue\n ) => {\n return state.set(\n key,\n value,\n () => {\n subject[key] = state.latest[key]\n },\n undefined,\n false\n )\n }\n)\n","import { isObject } from \"motion-utils\"\n\n/**\n * Checks if an element is an HTML element in a way\n * that works across iframes\n */\nexport function isHTMLElement(element: unknown): element is HTMLElement {\n return (\n isObject(element) &&\n \"offsetHeight\" in element &&\n !(\"ownerSVGElement\" in element)\n )\n}\n","import { transformPropOrder } from \"../../render/utils/keys-transform\"\nimport { MotionValueState } from \"../MotionValueState\"\n\nconst translateAlias = {\n x: \"translateX\",\n y: \"translateY\",\n z: \"translateZ\",\n transformPerspective: \"perspective\",\n}\n\nexport function buildTransform(state: MotionValueState) {\n let transform = \"\"\n let transformIsDefault = true\n\n /**\n * Loop over all possible transforms in order, adding the ones that\n * are present to the transform string.\n */\n for (let i = 0; i < transformPropOrder.length; i++) {\n const key = transformPropOrder[i] as keyof typeof translateAlias\n const value = state.latest[key]\n\n if (value === undefined) continue\n\n let valueIsDefault = true\n if (typeof value === \"number\") {\n valueIsDefault = value === (key.startsWith(\"scale\") ? 1 : 0)\n } else {\n const parsed = parseFloat(value)\n valueIsDefault = key.startsWith(\"scale\") ? parsed === 1 : parsed === 0\n }\n\n if (!valueIsDefault) {\n transformIsDefault = false\n const transformName = translateAlias[key] || key\n transform += `${transformName}(${value}) `\n }\n }\n\n // See build-transform.ts: additive `rotate()` so user `rotate` isn't\n // clobbered. Not a `transformPropOrder` slot.\n const pathRotation = state.latest.pathRotation\n if (pathRotation) {\n transformIsDefault = false\n transform += `rotate(${\n typeof pathRotation === \"number\"\n ? `${pathRotation}deg`\n : pathRotation\n }) `\n }\n\n return transformIsDefault ? \"none\" : transform.trim()\n}\n","import { isCSSVar } from \"../../render/dom/is-css-var\"\nimport { transformProps } from \"../../render/utils/keys-transform\"\nimport { isHTMLElement } from \"../../utils/is-html-element\"\nimport { MotionValue } from \"../../value\"\nimport { MotionValueState } from \"../MotionValueState\"\nimport { createSelectorEffect } from \"../utils/create-dom-effect\"\nimport { createEffect } from \"../utils/create-effect\"\nimport { buildTransform } from \"./transform\"\n\nconst originProps = new Set([\"originX\", \"originY\", \"originZ\"])\n\nexport const addStyleValue = (\n element: HTMLElement | SVGElement,\n state: MotionValueState,\n key: string,\n value: MotionValue\n) => {\n let render: VoidFunction | undefined = undefined\n let computed: MotionValue | undefined = undefined\n\n if (transformProps.has(key)) {\n if (!state.get(\"transform\")) {\n // If this is an HTML element, we need to set the transform-box to fill-box\n // to normalise the transform relative to the element's bounding box\n if (!isHTMLElement(element) && !state.get(\"transformBox\")) {\n addStyleValue(\n element,\n state,\n \"transformBox\",\n new MotionValue(\"fill-box\")\n )\n }\n\n state.set(\"transform\", new MotionValue(\"none\"), () => {\n element.style.transform = buildTransform(state)\n })\n }\n\n computed = state.get(\"transform\")\n } else if (originProps.has(key)) {\n if (!state.get(\"transformOrigin\")) {\n state.set(\"transformOrigin\", new MotionValue(\"\"), () => {\n const originX = state.latest.originX ?? \"50%\"\n const originY = state.latest.originY ?? \"50%\"\n const originZ = state.latest.originZ ?? 0\n element.style.transformOrigin = `${originX} ${originY} ${originZ}`\n })\n }\n\n computed = state.get(\"transformOrigin\")\n } else if (isCSSVar(key)) {\n render = () => {\n element.style.setProperty(key, state.latest[key] as string)\n }\n } else {\n render = () => {\n element.style[key as any] = state.latest[key] as string\n }\n }\n\n return state.set(key, value, render, computed)\n}\n\nexport const styleEffect = /*@__PURE__*/ createSelectorEffect(\n /*@__PURE__*/ createEffect(addStyleValue)\n)\n","import { frame } from \"../../frameloop\"\nimport { MotionValue } from \"../../value\"\nimport { addAttrValue } from \"../attr\"\nimport { MotionValueState } from \"../MotionValueState\"\nimport { addStyleValue } from \"../style\"\nimport { createSelectorEffect } from \"../utils/create-dom-effect\"\nimport { createEffect } from \"../utils/create-effect\"\n\nfunction addSVGPathValue(\n element: SVGElement,\n state: MotionValueState,\n key: string,\n value: MotionValue\n) {\n frame.render(() => element.setAttribute(\"pathLength\", \"1\"))\n\n if (key === \"pathOffset\") {\n return state.set(key, value, () => {\n // Use unitless value to avoid Safari zoom bug\n const offset = state.latest[key]\n element.setAttribute(\"stroke-dashoffset\", `${-offset}`)\n })\n } else {\n if (!state.get(\"stroke-dasharray\")) {\n state.set(\"stroke-dasharray\", new MotionValue(\"1 1\"), () => {\n const { pathLength = 1, pathSpacing } = state.latest\n\n // Use unitless values to avoid Safari zoom bug\n element.setAttribute(\n \"stroke-dasharray\",\n `${pathLength} ${pathSpacing ?? 1 - Number(pathLength)}`\n )\n })\n }\n\n return state.set(key, value, undefined, state.get(\"stroke-dasharray\"))\n }\n}\n\nconst addSVGValue = (\n element: SVGElement,\n state: MotionValueState,\n key: string,\n value: MotionValue\n) => {\n if (key.startsWith(\"path\")) {\n return addSVGPathValue(element, state, key, value)\n } else if (key.startsWith(\"attr\")) {\n return addAttrValue(element, state, convertAttrKey(key), value)\n }\n\n const handler = key in element.style ? addStyleValue : addAttrValue\n return handler(element, state, key, value)\n}\n\nexport const svgEffect = /*@__PURE__*/ createSelectorEffect(\n /*@__PURE__*/ createEffect(addSVGValue)\n)\n\nfunction convertAttrKey(key: string) {\n return key.replace(/^attr([A-Z])/, (_, firstChar) =>\n firstChar.toLowerCase()\n )\n}\n","import { createRenderBatcher } from \"./batcher\"\n\nexport const { schedule: microtask, cancel: cancelMicrotask } =\n /* @__PURE__ */ createRenderBatcher(queueMicrotask, false)\n","export const isDragging = {\n x: false,\n y: false,\n}\n\nexport function isDragActive() {\n return isDragging.x || isDragging.y\n}\n","import { isDragging } from \"./is-active\"\n\nexport function setDragLock(axis: boolean | \"x\" | \"y\" | \"lockDirection\") {\n if (axis === \"x\" || axis === \"y\") {\n if (isDragging[axis]) {\n return null\n } else {\n isDragging[axis] = true\n return () => {\n isDragging[axis] = false\n }\n }\n } else {\n if (isDragging.x || isDragging.y) {\n return null\n } else {\n isDragging.x = isDragging.y = true\n return () => {\n isDragging.x = isDragging.y = false\n }\n }\n }\n}\n","import {\n ElementOrSelector,\n resolveElements,\n} from \"../../utils/resolve-elements\"\nimport { EventOptions } from \"../types\"\n\nexport function setupGesture(\n elementOrSelector: ElementOrSelector,\n options: EventOptions\n): [Element[], AddEventListenerOptions, VoidFunction] {\n const elements = resolveElements(elementOrSelector)\n\n const gestureAbortController = new AbortController()\n\n const eventOptions = {\n passive: true,\n ...options,\n signal: gestureAbortController.signal,\n }\n\n const cancel = () => gestureAbortController.abort()\n\n return [elements, eventOptions, cancel]\n}\n","import { ElementOrSelector } from \"../utils/resolve-elements\"\nimport { isDragActive } from \"./drag/state/is-active\"\nimport { EventOptions } from \"./types\"\nimport { setupGesture } from \"./utils/setup\"\n\n/**\n * A function to be called when a hover gesture starts.\n *\n * This function can optionally return a function that will be called\n * when the hover gesture ends.\n *\n * @public\n */\nexport type OnHoverStartEvent = (\n element: Element,\n event: PointerEvent\n) => void | OnHoverEndEvent\n\n/**\n * A function to be called when a hover gesture ends.\n *\n * @public\n */\nexport type OnHoverEndEvent = (event: PointerEvent) => void\n\nfunction isValidHover(event: PointerEvent) {\n return !(event.pointerType === \"touch\" || isDragActive())\n}\n\n/**\n * Create a hover gesture. hover() is different to .addEventListener(\"pointerenter\")\n * in that it has an easier syntax, filters out polyfilled touch events, interoperates\n * with drag gestures, and automatically removes the \"pointerennd\" event listener when the hover ends.\n *\n * @public\n */\nexport function hover(\n elementOrSelector: ElementOrSelector,\n onHoverStart: OnHoverStartEvent,\n options: EventOptions = {}\n): VoidFunction {\n const [elements, eventOptions, cancel] = setupGesture(\n elementOrSelector,\n options\n )\n\n elements.forEach((element) => {\n let isPressed = false\n let deferredHoverEnd = false\n let hoverEndCallback: OnHoverEndEvent | undefined\n\n const removePointerLeave = () => {\n element.removeEventListener(\n \"pointerleave\",\n onPointerLeave as EventListener\n )\n }\n\n const endHover = (event: PointerEvent) => {\n if (hoverEndCallback) {\n hoverEndCallback(event)\n hoverEndCallback = undefined\n }\n removePointerLeave()\n }\n\n const onPointerUp = (event: Event) => {\n isPressed = false\n window.removeEventListener(\n \"pointerup\",\n onPointerUp as EventListener\n )\n window.removeEventListener(\n \"pointercancel\",\n onPointerUp as EventListener\n )\n\n if (deferredHoverEnd) {\n deferredHoverEnd = false\n endHover(event as PointerEvent)\n }\n }\n\n const onPointerDown = () => {\n isPressed = true\n window.addEventListener(\n \"pointerup\",\n onPointerUp as EventListener,\n eventOptions\n )\n window.addEventListener(\n \"pointercancel\",\n onPointerUp as EventListener,\n eventOptions\n )\n }\n\n const onPointerLeave = (leaveEvent: PointerEvent) => {\n if (leaveEvent.pointerType === \"touch\") return\n\n if (isPressed) {\n deferredHoverEnd = true\n return\n }\n\n endHover(leaveEvent)\n }\n\n const onPointerEnter = (enterEvent: PointerEvent) => {\n if (!isValidHover(enterEvent)) return\n\n deferredHoverEnd = false\n\n const onHoverEnd = onHoverStart(\n element as Element,\n enterEvent\n )\n\n if (typeof onHoverEnd !== \"function\") return\n\n hoverEndCallback = onHoverEnd\n\n element.addEventListener(\n \"pointerleave\",\n onPointerLeave as EventListener,\n eventOptions\n )\n }\n\n element.addEventListener(\n \"pointerenter\",\n onPointerEnter as EventListener,\n eventOptions\n )\n element.addEventListener(\n \"pointerdown\",\n onPointerDown as EventListener,\n eventOptions\n )\n })\n\n return cancel\n}\n","/**\n * Recursively traverse up the tree to check whether the provided child node\n * is the parent or a descendant of it.\n *\n * @param parent - Element to find\n * @param child - Element to test against parent\n */\nexport const isNodeOrChild = (\n parent: Element | null,\n child?: Element | null\n): boolean => {\n if (!child) {\n return false\n } else if (parent === child) {\n return true\n } else {\n return isNodeOrChild(parent, child.parentElement)\n }\n}\n","export const isPrimaryPointer = (event: PointerEvent) => {\n if (event.pointerType === \"mouse\") {\n return typeof event.button !== \"number\" || event.button <= 0\n } else {\n /**\n * isPrimary is true for all mice buttons, whereas every touch point\n * is regarded as its own input. So subsequent concurrent touch points\n * will be false.\n *\n * Specifically match against false here as incomplete versions of\n * PointerEvents in very old browser might have it set as undefined.\n */\n return event.isPrimary !== false\n }\n}\n","const keyboardAccessibleElements = new Set([\n \"BUTTON\",\n \"INPUT\",\n \"SELECT\",\n \"TEXTAREA\",\n \"A\",\n])\n\n/**\n * Checks if an element is natively keyboard accessible (focusable).\n * Used by the press gesture to determine if we need to add tabIndex.\n */\nexport function isElementKeyboardAccessible(element: Element) {\n return (\n keyboardAccessibleElements.has(element.tagName) ||\n (element as HTMLElement).isContentEditable === true\n )\n}\n\nconst textInputElements = new Set([\"INPUT\", \"SELECT\", \"TEXTAREA\"])\n\n/**\n * Checks if an element has text selection or direct interaction behavior\n * that should block drag gestures from starting.\n *\n * This specifically targets form controls where the user might want to select\n * text or interact with the control (e.g., sliders, dropdowns).\n *\n * Buttons and links are NOT included because they don't have click-and-move\n * actions of their own - they only respond to click events, so dragging\n * should still work when initiated from these elements.\n */\nexport function isElementTextInput(element: Element) {\n return (\n textInputElements.has(element.tagName) ||\n (element as HTMLElement).isContentEditable === true\n )\n}\n","export const isPressing = new WeakSet()\n","import { isPressing } from \"./state\"\n\n/**\n * Filter out events that are not \"Enter\" keys.\n */\nfunction filterEvents(callback: (event: KeyboardEvent) => void) {\n return (event: KeyboardEvent) => {\n if (event.key !== \"Enter\") return\n callback(event)\n }\n}\n\nfunction firePointerEvent(target: EventTarget, type: \"down\" | \"up\" | \"cancel\") {\n target.dispatchEvent(\n new PointerEvent(\"pointer\" + type, { isPrimary: true, bubbles: true })\n )\n}\n\nexport const enableKeyboardPress = (\n focusEvent: FocusEvent,\n eventOptions: AddEventListenerOptions\n) => {\n const element = focusEvent.currentTarget as HTMLElement\n if (!element) return\n\n const handleKeydown = filterEvents(() => {\n if (isPressing.has(element)) return\n\n firePointerEvent(element, \"down\")\n\n const handleKeyup = filterEvents(() => {\n firePointerEvent(element, \"up\")\n })\n\n const handleBlur = () => firePointerEvent(element, \"cancel\")\n\n element.addEventListener(\"keyup\", handleKeyup, eventOptions)\n element.addEventListener(\"blur\", handleBlur, eventOptions)\n })\n\n element.addEventListener(\"keydown\", handleKeydown, eventOptions)\n\n /**\n * Add an event listener that fires on blur to remove the keydown events.\n */\n element.addEventListener(\n \"blur\",\n () => element.removeEventListener(\"keydown\", handleKeydown),\n eventOptions\n )\n}\n","import { isHTMLElement } from \"../../utils/is-html-element\"\nimport { ElementOrSelector } from \"../../utils/resolve-elements\"\nimport { isDragActive } from \"../drag/state/is-active\"\nimport { EventOptions } from \"../types\"\nimport { isNodeOrChild } from \"../utils/is-node-or-child\"\nimport { isPrimaryPointer } from \"../utils/is-primary-pointer\"\nimport { setupGesture } from \"../utils/setup\"\nimport { OnPressStartEvent } from \"./types\"\nimport { isElementKeyboardAccessible } from \"./utils/is-keyboard-accessible\"\nimport { enableKeyboardPress } from \"./utils/keyboard\"\nimport { isPressing } from \"./utils/state\"\n\n/**\n * Filter out events that are not primary pointer events, or are triggering\n * while a Motion gesture is active.\n */\nfunction isValidPressEvent(event: PointerEvent) {\n return isPrimaryPointer(event) && !isDragActive()\n}\n\nconst claimedPointerDownEvents = new WeakSet()\n\nexport interface PointerEventOptions extends EventOptions {\n useGlobalTarget?: boolean\n stopPropagation?: boolean\n}\n\n/**\n * Create a press gesture.\n *\n * Press is different to `\"pointerdown\"`, `\"pointerup\"` in that it\n * automatically filters out secondary pointer events like right\n * click and multitouch.\n *\n * It also adds accessibility support for keyboards, where\n * an element with a press gesture will receive focus and\n * trigger on Enter `\"keydown\"` and `\"keyup\"` events.\n *\n * This is different to a browser's `\"click\"` event, which does\n * respond to keyboards but only for the `\"click\"` itself, rather\n * than the press start and end/cancel. The element also needs\n * to be focusable for this to work, whereas a press gesture will\n * make an element focusable by default.\n *\n * @public\n */\nexport function press(\n targetOrSelector: ElementOrSelector,\n onPressStart: OnPressStartEvent,\n options: PointerEventOptions = {}\n): VoidFunction {\n const [targets, eventOptions, cancelEvents] = setupGesture(\n targetOrSelector,\n options\n )\n\n const startPress = (startEvent: PointerEvent) => {\n const target = startEvent.currentTarget as Element\n\n if (!isValidPressEvent(startEvent)) return\n if (claimedPointerDownEvents.has(startEvent)) return\n\n isPressing.add(target)\n\n if (options.stopPropagation) {\n claimedPointerDownEvents.add(startEvent)\n }\n\n const onPressEnd = onPressStart(target, startEvent)\n\n /**\n * End listeners run in the capture phase so a descendant calling\n * stopPropagation() in its own pointerup handler can't prevent the\n * press gesture from ending. This also keeps the gesture-end\n * ordering consistent with the drag gesture. See #2794.\n */\n const endEventOptions = { ...eventOptions, capture: true }\n\n const onPointerEnd = (endEvent: PointerEvent, success: boolean) => {\n window.removeEventListener(\n \"pointerup\",\n onPointerUp,\n endEventOptions\n )\n window.removeEventListener(\n \"pointercancel\",\n onPointerCancel,\n endEventOptions\n )\n\n if (isPressing.has(target)) {\n isPressing.delete(target)\n }\n\n if (!isValidPressEvent(endEvent)) {\n return\n }\n\n if (typeof onPressEnd === \"function\") {\n onPressEnd(endEvent, { success })\n }\n }\n\n const onPointerUp = (upEvent: PointerEvent) => {\n onPointerEnd(\n upEvent,\n (target as any) === window ||\n (target as any) === document ||\n options.useGlobalTarget ||\n isNodeOrChild(target, upEvent.target as Element)\n )\n }\n\n const onPointerCancel = (cancelEvent: PointerEvent) => {\n onPointerEnd(cancelEvent, false)\n }\n\n window.addEventListener(\"pointerup\", onPointerUp, endEventOptions)\n window.addEventListener(\n \"pointercancel\",\n onPointerCancel,\n endEventOptions\n )\n }\n\n targets.forEach((target: EventTarget) => {\n const pointerDownTarget = options.useGlobalTarget ? window : target\n pointerDownTarget.addEventListener(\n \"pointerdown\",\n startPress as EventListener,\n eventOptions\n )\n\n if (isHTMLElement(target)) {\n target.addEventListener(\"focus\", (event) =>\n enableKeyboardPress(event as FocusEvent, eventOptions)\n )\n\n if (\n !isElementKeyboardAccessible(target) &&\n !target.hasAttribute(\"tabindex\")\n ) {\n target.tabIndex = 0\n }\n }\n })\n\n return cancelEvents\n}\n","import { isCSSVar } from \"./is-css-var\"\n\nexport function getComputedStyle(\n element: HTMLElement | SVGElement,\n name: string\n) {\n const computedStyle = window.getComputedStyle(element)\n return isCSSVar(name)\n ? computedStyle.getPropertyValue(name)\n : computedStyle[name as any]\n}\n","import { isObject } from \"motion-utils\"\n\n/**\n * Checks if an element is an SVG element in a way\n * that works across iframes\n */\nexport function isSVGElement(element: unknown): element is SVGElement {\n return isObject(element) && \"ownerSVGElement\" in element\n}\n","import { isSVGElement } from \"../utils/is-svg-element\"\nimport { ElementOrSelector, resolveElements } from \"../utils/resolve-elements\"\nimport { ResizeHandler } from \"./types\"\n\nconst resizeHandlers = new WeakMap>>()\n\nlet observer: ResizeObserver | undefined\n\nconst getSize =\n (\n borderBoxAxis: \"inline\" | \"block\",\n svgAxis: \"width\" | \"height\",\n htmlAxis: \"offsetWidth\" | \"offsetHeight\"\n ) =>\n (target: Element, borderBoxSize?: ReadonlyArray) => {\n if (borderBoxSize && borderBoxSize[0]) {\n return borderBoxSize[0][\n (borderBoxAxis + \"Size\") as keyof ResizeObserverSize\n ]\n } else if (isSVGElement(target) && \"getBBox\" in target) {\n return (target as SVGGraphicsElement).getBBox()[svgAxis]\n } else {\n return (target as HTMLElement)[htmlAxis]\n }\n }\n\nconst getWidth = /*@__PURE__*/ getSize(\"inline\", \"width\", \"offsetWidth\")\nconst getHeight = /*@__PURE__*/ getSize(\"block\", \"height\", \"offsetHeight\")\n\nfunction notifyTarget({ target, borderBoxSize }: ResizeObserverEntry) {\n resizeHandlers.get(target)?.forEach((handler) => {\n handler(target, {\n get width() {\n return getWidth(target, borderBoxSize)\n },\n get height() {\n return getHeight(target, borderBoxSize)\n },\n })\n })\n}\n\nfunction notifyAll(entries: ResizeObserverEntry[]) {\n entries.forEach(notifyTarget)\n}\n\nfunction createResizeObserver() {\n if (typeof ResizeObserver === \"undefined\") return\n\n observer = new ResizeObserver(notifyAll)\n}\n\nexport function resizeElement(\n target: ElementOrSelector,\n handler: ResizeHandler\n) {\n if (!observer) createResizeObserver()\n\n const elements = resolveElements(target)\n\n elements.forEach((element) => {\n let elementHandlers = resizeHandlers.get(element)\n\n if (!elementHandlers) {\n elementHandlers = new Set()\n resizeHandlers.set(element, elementHandlers)\n }\n\n elementHandlers.add(handler)\n observer?.observe(element)\n })\n\n return () => {\n elements.forEach((element) => {\n const elementHandlers = resizeHandlers.get(element)\n\n elementHandlers?.delete(handler)\n\n if (!elementHandlers?.size) {\n observer?.unobserve(element)\n }\n })\n }\n}\n","import { WindowResizeHandler } from \"./types\"\n\nconst windowCallbacks = new Set()\n\nlet windowResizeHandler: VoidFunction | undefined\n\nfunction createWindowResizeHandler() {\n windowResizeHandler = () => {\n const info = {\n get width() {\n return window.innerWidth\n },\n get height() {\n return window.innerHeight\n },\n }\n\n windowCallbacks.forEach((callback) => callback(info))\n }\n\n window.addEventListener(\"resize\", windowResizeHandler)\n}\n\nexport function resizeWindow(callback: WindowResizeHandler) {\n windowCallbacks.add(callback)\n\n if (!windowResizeHandler) createWindowResizeHandler()\n\n return () => {\n windowCallbacks.delete(callback)\n\n if (\n !windowCallbacks.size &&\n typeof windowResizeHandler === \"function\"\n ) {\n window.removeEventListener(\"resize\", windowResizeHandler)\n windowResizeHandler = undefined\n }\n }\n}\n","import { ElementOrSelector } from \"../utils/resolve-elements\"\nimport { resizeElement } from \"./handle-element\"\nimport { resizeWindow } from \"./handle-window\"\nimport { ResizeHandler, WindowResizeHandler } from \"./types\"\n\nexport function resize(onResize: WindowResizeHandler): VoidFunction\nexport function resize(\n target: ElementOrSelector,\n onResize: ResizeHandler\n): VoidFunction\nexport function resize(\n a: WindowResizeHandler | ElementOrSelector,\n b?: ResizeHandler\n) {\n return typeof a === \"function\" ? resizeWindow(a) : resizeElement(a, b!)\n}\n","import { ProgressTimeline } from \"../animation/types\"\nimport { cancelFrame, frame } from \"../frameloop\"\n\ntype Update = (progress: number) => void\n\nexport function observeTimeline(update: Update, timeline: ProgressTimeline) {\n let prevProgress: number\n\n const onFrame = () => {\n const { currentTime } = timeline\n const percentage = currentTime === null ? 0 : currentTime.value\n const progress = percentage / 100\n\n if (prevProgress !== progress) {\n update(progress)\n }\n\n prevProgress = progress\n }\n\n frame.preUpdate(onFrame, true)\n\n return () => cancelFrame(onFrame)\n}\n","import type { LayoutProjectionMetrics, StatsRecording } from \"./types\"\n\nexport type InactiveStatsBuffer = {\n value: null\n addProjectionMetrics: null\n}\n\nexport type ActiveStatsBuffer = {\n value: StatsRecording\n addProjectionMetrics: (metrics: LayoutProjectionMetrics) => void\n}\n\nexport const statsBuffer: InactiveStatsBuffer | ActiveStatsBuffer = {\n value: null,\n addProjectionMetrics: null,\n}\n","import { ActiveStatsBuffer, statsBuffer } from \"./buffer\"\n\nfunction clearStatsBuffer() {\n statsBuffer.value = null\n statsBuffer.addProjectionMetrics = null\n}\n\nexport function recordStats() {\n if (statsBuffer.value) {\n clearStatsBuffer()\n throw new Error(\"Stats are already being measured\")\n }\n\n const buffer = statsBuffer as unknown as ActiveStatsBuffer\n\n buffer.value = {\n layoutProjection: {\n nodes: [],\n calculatedTargetDeltas: [],\n calculatedProjections: [],\n },\n }\n\n buffer.addProjectionMetrics = (metrics) => {\n const { layoutProjection } = buffer.value\n layoutProjection.nodes.push(metrics.nodes)\n layoutProjection.calculatedTargetDeltas.push(\n metrics.calculatedTargetDeltas\n )\n layoutProjection.calculatedProjections.push(\n metrics.calculatedProjections\n )\n }\n}\n","import { isSVGElement } from \"./is-svg-element\"\n\n/**\n * Checks if an element is specifically an SVGSVGElement (the root SVG element)\n * in a way that works across iframes\n */\nexport function isSVGSVGElement(element: unknown): element is SVGSVGElement {\n return isSVGElement(element) && element.tagName === \"svg\"\n}\n","import { Easing, easingDefinitionToFunction } from \"motion-utils\"\nimport { DynamicOption } from \"../animation/types\"\n\nexport type StaggerOrigin = \"first\" | \"last\" | \"center\" | number\n\nexport type StaggerOptions = {\n startDelay?: number\n from?: StaggerOrigin\n ease?: Easing\n}\n\nexport function getOriginIndex(from: StaggerOrigin, total: number) {\n if (from === \"first\") {\n return 0\n } else {\n const lastIndex = total - 1\n return from === \"last\" ? lastIndex : lastIndex / 2\n }\n}\n\nexport function stagger(\n duration: number = 0.1,\n { startDelay = 0, from = 0, ease }: StaggerOptions = {}\n): DynamicOption {\n return (i: number, total: number) => {\n const fromIndex =\n typeof from === \"number\" ? from : getOriginIndex(from, total)\n const distance = Math.abs(fromIndex - i)\n let delay = duration * distance\n\n if (ease) {\n const maxDelay = total * duration\n const easingFunction = easingDefinitionToFunction(ease)\n delay = easingFunction(delay / maxDelay) * maxDelay\n }\n\n return startDelay + delay\n }\n}\n","import { EasingFunction } from \"motion-utils\"\nimport { interpolate } from \"./interpolate\"\n\n/**\n * @public\n */\nexport interface TransformOptions {\n /**\n * Clamp values to within the given range. Defaults to `true`\n *\n * @public\n */\n clamp?: boolean\n\n /**\n * Easing functions to use on the interpolations between each value in the input and output ranges.\n *\n * If provided as an array, the array must be one item shorter than the input and output ranges, as the easings apply to the transition **between** each.\n *\n * @public\n */\n ease?: EasingFunction | EasingFunction[]\n\n /**\n * Provide a function that can interpolate between any two values in the provided range.\n *\n * @public\n */\n mixer?: (from: T, to: T) => (v: number) => any\n}\n\n/**\n * Transforms numbers into other values by mapping them from an input range to an output range.\n * Returns the type of the input provided.\n *\n * @remarks\n *\n * Given an input range of `[0, 200]` and an output range of\n * `[0, 1]`, this function will return a value between `0` and `1`.\n * The input range must be a linear series of numbers. The output range\n * can be any supported value type, such as numbers, colors, shadows, arrays, objects and more.\n * Every value in the output range must be of the same type and in the same format.\n *\n * ```jsx\n * export function MyComponent() {\n * const inputRange = [0, 200]\n * const outputRange = [0, 1]\n * const output = transform(100, inputRange, outputRange)\n *\n * // Returns 0.5\n * return
{output}
\n * }\n * ```\n *\n * @param inputValue - A number to transform between the input and output ranges.\n * @param inputRange - A linear series of numbers (either all increasing or decreasing).\n * @param outputRange - A series of numbers, colors, strings, or arrays/objects of those. Must be the same length as `inputRange`.\n * @param options - Clamp: Clamp values to within the given range. Defaults to `true`.\n *\n * @public\n */\nexport function transform(\n inputValue: number,\n inputRange: number[],\n outputRange: T[],\n options?: TransformOptions\n): T\n/**\n *\n * Transforms numbers into other values by mapping them from an input range to an output range.\n *\n * Given an input range of `[0, 200]` and an output range of\n * `[0, 1]`, this function will return a value between `0` and `1`.\n * The input range must be a linear series of numbers. The output range\n * can be any supported value type, such as numbers, colors, shadows, arrays, objects and more.\n * Every value in the output range must be of the same type and in the same format.\n *\n * ```jsx\n * export function MyComponent() {\n * const inputRange = [-200, -100, 100, 200]\n * const outputRange = [0, 1, 1, 0]\n * const convertRange = transform(inputRange, outputRange)\n * const output = convertRange(-150)\n *\n * // Returns 0.5\n * return
{output}
\n * }\n *\n * ```\n *\n * @param inputRange - A linear series of numbers (either all increasing or decreasing).\n * @param outputRange - A series of numbers, colors or strings. Must be the same length as `inputRange`.\n * @param options - Clamp: clamp values to within the given range. Defaults to `true`.\n *\n * @public\n */\nexport function transform(\n inputRange: number[],\n outputRange: T[],\n options?: TransformOptions\n): (inputValue: number) => T\nexport function transform(\n ...args:\n | [number, number[], T[], TransformOptions?]\n | [number[], T[], TransformOptions?]\n) {\n const useImmediate = !Array.isArray(args[0])\n const argOffset = useImmediate ? 0 : -1\n const inputValue = args[0 + argOffset] as number\n const inputRange = args[1 + argOffset] as number[]\n const outputRange = args[2 + argOffset] as T[]\n const options = args[3 + argOffset] as TransformOptions\n\n const interpolator = interpolate(inputRange, outputRange, options)\n\n return useImmediate ? interpolator(inputValue) : interpolator\n}\n","import { MotionValue, motionValue } from \".\"\nimport { JSAnimation } from \"../animation/JSAnimation\"\nimport { AnyResolvedKeyframe, ValueAnimationTransition } from \"../animation/types\"\nimport { frame } from \"../frameloop\"\nimport { isMotionValue } from \"./utils/is-motion-value\"\n\n/**\n * Options for useFollowValue hook, extending ValueAnimationTransition\n * but excluding lifecycle callbacks that don't make sense for the hook pattern.\n */\nexport type FollowValueOptions = Omit<\n ValueAnimationTransition,\n \"onUpdate\" | \"onComplete\" | \"onPlay\" | \"onRepeat\" | \"onStop\"\n> & {\n /**\n * When true, the first change from a tracked `MotionValue` source\n * will jump to the new value instead of animating. Subsequent\n * changes animate normally. This prevents unwanted animations\n * on page refresh or back navigation (e.g. `useScroll` + `useSpring`).\n *\n * @default false\n */\n skipInitialAnimation?: boolean\n}\n\n/**\n * Create a `MotionValue` that animates to its latest value using any transition type.\n * Can either be a value or track another `MotionValue`.\n *\n * ```jsx\n * const x = motionValue(0)\n * const y = followValue(x, { type: \"spring\", stiffness: 300 })\n * // or with tween\n * const z = followValue(x, { type: \"tween\", duration: 0.5, ease: \"easeOut\" })\n * ```\n *\n * @param source - Initial value or MotionValue to track\n * @param options - Animation transition options\n * @returns `MotionValue`\n *\n * @public\n */\nexport function followValue(\n source: T | MotionValue,\n options?: FollowValueOptions\n) {\n const initialValue = isMotionValue(source) ? source.get() : source\n const value = motionValue(initialValue)\n\n attachFollow(value, source, options)\n\n return value\n}\n\n/**\n * Attach an animation to a MotionValue that will animate whenever the value changes.\n * Similar to attachSpring but supports any transition type (spring, tween, inertia, etc.)\n *\n * @param value - The MotionValue to animate\n * @param source - Initial value or MotionValue to track\n * @param options - Animation transition options\n * @returns Cleanup function\n *\n * @public\n */\nexport function attachFollow(\n value: MotionValue,\n source: T | MotionValue,\n options: FollowValueOptions = {}\n): VoidFunction {\n const initialValue = value.get()\n\n let activeAnimation: JSAnimation | null = null\n let latestValue = initialValue\n let latestSetter: (v: T) => void\n\n const unit =\n typeof initialValue === \"string\"\n ? initialValue.replace(/[\\d.-]/g, \"\")\n : undefined\n\n const stopAnimation = () => {\n if (activeAnimation) {\n activeAnimation.stop()\n activeAnimation = null\n }\n value.animation = undefined\n }\n\n const startAnimation = () => {\n const currentValue = asNumber(value.get())\n const targetValue = asNumber(latestValue)\n\n // Don't animate if we're already at the target\n if (currentValue === targetValue) {\n stopAnimation()\n return\n }\n\n // Use the running animation's analytical velocity for accuracy,\n // falling back to the MotionValue's velocity for the initial animation.\n // This prevents systematic velocity loss at high frame rates (240hz+).\n const velocity = activeAnimation\n ? activeAnimation.getGeneratorVelocity()\n : value.getVelocity()\n\n stopAnimation()\n\n activeAnimation = new JSAnimation({\n keyframes: [currentValue, targetValue],\n velocity,\n // Default to spring if no type specified (matches useSpring behavior)\n type: \"spring\",\n restDelta: 0.001,\n restSpeed: 0.01,\n ...options,\n onUpdate: latestSetter,\n })\n }\n\n // Use a stable function reference so the frame loop Set deduplicates\n // multiple calls within the same frame (e.g. rapid mouse events)\n const scheduleAnimation = () => {\n startAnimation()\n value.animation = activeAnimation ?? undefined\n value[\"events\"].animationStart?.notify()\n activeAnimation?.then(() => {\n value.animation = undefined\n value[\"events\"].animationComplete?.notify()\n })\n }\n\n value.attach((v, set) => {\n latestValue = v\n latestSetter = (latest) => set(parseValue(latest, unit) as T)\n frame.postRender(scheduleAnimation)\n }, stopAnimation)\n\n if (isMotionValue(source)) {\n let skipNextAnimation = options.skipInitialAnimation === true\n\n const removeSourceOnChange = source.on(\"change\", (v) => {\n if (skipNextAnimation) {\n skipNextAnimation = false\n value.jump(parseValue(v, unit) as T, false)\n } else {\n value.set(parseValue(v, unit) as T)\n }\n })\n\n const removeValueOnDestroy = value.on(\"destroy\", removeSourceOnChange)\n\n return () => {\n removeSourceOnChange()\n removeValueOnDestroy()\n }\n }\n\n return stopAnimation\n}\n\nfunction parseValue(v: AnyResolvedKeyframe, unit?: string) {\n return unit ? v + unit : v\n}\n\nfunction asNumber(v: AnyResolvedKeyframe) {\n return typeof v === \"number\" ? v : parseFloat(v)\n}\n","import { MotionValue } from \".\"\nimport { cancelFrame, frame } from \"../frameloop\"\n\nexport function subscribeValue(\n inputValues: MotionValue[],\n outputValue: MotionValue,\n getLatest: () => O\n) {\n const update = () => outputValue.set(getLatest())\n const scheduleUpdate = () => frame.preRender(update, false, true)\n\n const subscriptions = inputValues.map((v) => v.on(\"change\", scheduleUpdate))\n\n outputValue.on(\"destroy\", () => {\n subscriptions.forEach((unsubscribe) => unsubscribe())\n cancelFrame(update)\n })\n}\n","import { MotionValue, collectMotionValues, motionValue } from \".\"\nimport { subscribeValue } from \"./subscribe-value\"\n\nexport type TransformInputRange = number[]\nexport type SingleTransformer = (input: I) => O\nexport type MultiTransformer = (input: I[]) => O\nexport type ValueTransformer =\n | SingleTransformer\n | MultiTransformer\n\n/**\n * Create a `MotionValue` that transforms the output of other `MotionValue`s by\n * passing their latest values through a transform function.\n *\n * Whenever a `MotionValue` referred to in the provided function is updated,\n * it will be re-evaluated.\n *\n * ```jsx\n * const x = motionValue(0)\n * const y = transformValue(() => x.get() * 2) // double x\n * ```\n *\n * @param transformer - A transform function. This function must be pure with no side-effects or conditional statements.\n * @returns `MotionValue`\n *\n * @public\n */\nexport function transformValue(transform: () => O): MotionValue {\n const collectedValues: MotionValue[] = []\n\n /**\n * Open session of collectMotionValues. Any MotionValue that calls get()\n * inside transform will be saved into this array.\n */\n collectMotionValues.current = collectedValues\n const initialValue = transform()\n collectMotionValues.current = undefined\n\n const value = motionValue(initialValue)\n\n subscribeValue(collectedValues, value, transform)\n\n return value\n}\n","import { MotionValue } from \".\"\nimport { transform, TransformOptions } from \"../utils/transform\"\nimport { transformValue } from \"./transform-value\"\n\nexport type MapInputRange = number[]\n\n/**\n * Create a `MotionValue` that maps the output of another `MotionValue` by\n * mapping it from one range of values into another.\n *\n * @remarks\n *\n * Given an input range of `[-200, -100, 100, 200]` and an output range of\n * `[0, 1, 1, 0]`, the returned `MotionValue` will:\n *\n * - When provided a value between `-200` and `-100`, will return a value between `0` and `1`.\n * - When provided a value between `-100` and `100`, will return `1`.\n * - When provided a value between `100` and `200`, will return a value between `1` and `0`\n *\n * The input range must be a linear series of numbers. The output range\n * can be any value type supported by Motion: numbers, colors, shadows, etc.\n *\n * Every value in the output range must be of the same type and in the same format.\n *\n * ```jsx\n * const x = motionValue(0)\n * const xRange = [-200, -100, 100, 200]\n * const opacityRange = [0, 1, 1, 0]\n * const opacity = mapValue(x, xRange, opacityRange)\n * ```\n *\n * @param inputValue - `MotionValue`\n * @param inputRange - A linear series of numbers (either all increasing or decreasing)\n * @param outputRange - A series of numbers, colors or strings. Must be the same length as `inputRange`.\n * @param options -\n *\n * - clamp: boolean. Clamp values to within the given range. Defaults to `true`\n * - ease: EasingFunction[]. Easing functions to use on the interpolations between each value in the input and output ranges. If provided as an array, the array must be one item shorter than the input and output ranges, as the easings apply to the transition between each.\n *\n * @returns `MotionValue`\n *\n * @public\n */\nexport function mapValue(\n inputValue: MotionValue,\n inputRange: MapInputRange,\n outputRange: O[],\n options?: TransformOptions\n): MotionValue {\n const map = transform(inputRange, outputRange, options)\n return transformValue(() => map(inputValue.get()))\n}\n","import { MotionValue } from \".\"\nimport { AnyResolvedKeyframe, SpringOptions } from \"../animation/types\"\nimport { attachFollow, followValue } from \"./follow-value\"\n\n/**\n * Create a `MotionValue` that animates to its latest value using a spring.\n * Can either be a value or track another `MotionValue`.\n *\n * ```jsx\n * const x = motionValue(0)\n * const y = springValue(x, { stiffness: 300 })\n * ```\n *\n * @param source - Initial value or MotionValue to track\n * @param options - Spring configuration options\n * @returns `MotionValue`\n *\n * @public\n */\nexport function springValue(\n source: T | MotionValue,\n options?: SpringOptions\n) {\n return followValue(source, { type: \"spring\", ...options })\n}\n\n/**\n * Attach a spring animation to a MotionValue that will animate whenever the value changes.\n *\n * @param value - The MotionValue to animate\n * @param source - Initial value or MotionValue to track\n * @param options - Spring configuration options\n * @returns Cleanup function\n *\n * @public\n */\nexport function attachSpring(\n value: MotionValue,\n source: T | MotionValue,\n options?: SpringOptions\n): VoidFunction {\n return attachFollow(value, source, { type: \"spring\", ...options })\n}\n","import { color } from \"../color\"\nimport { complex } from \"../complex\"\nimport { dimensionValueTypes } from \"../dimensions\"\nimport { testValueType } from \"../test\"\n\n/**\n * A list of all ValueTypes\n */\nconst valueTypes = [...dimensionValueTypes, color, complex]\n\n/**\n * Tests a value against the list of ValueTypes\n */\nexport const findValueType = (v: any) => valueTypes.find(testValueType(v))\n","import { ElementOrSelector, resolveElements } from \"../../utils/resolve-elements\"\n\nlet nameCount = 0\n\n/**\n * Generated names live in their own namespace so we can tell a name we own\n * (and must clean up) from an author-defined one - and so a stale generated\n * name left behind by an interrupted transition is re-owned, not mistaken for\n * the author's and leaked.\n */\nconst generatedName = () => `motion-view-${nameCount++}`\n\nconst isGeneratedName = (name: string) => name.startsWith(\"motion-view-\")\n\n/**\n * Tag a captured element with a `view-transition-class` so authors can target\n * its generated layer from CSS (e.g. `::view-transition-group(.hero)`) without\n * the opaque generated name. Tracked in `classed` - separate from the generated\n * names in `assigned` - so cleanup removes the class without ever stripping an\n * author's own inline `view-transition-name`.\n */\nfunction tagClass(\n element: Element,\n className: string | undefined,\n classed: Element[]\n) {\n if (!className) return\n ;(element as HTMLElement).style?.setProperty(\n \"view-transition-class\",\n className\n )\n classed.push(element)\n}\n\n/**\n * Set the element's `view-transition-group` so its layer reconstructs the DOM\n * hierarchy in the pseudo-tree (`contain`) - or stays flat (`none`). Tracked in\n * `grouped` for cleanup. When the element clips (any non-`visible` overflow) its\n * name is recorded in `clipChildren` so the caller can clip the nested children\n * (`::view-transition-group-children(name)`), mirroring the live clip through\n * the whole transition rather than only at the live-DOM handoff.\n *\n * Ignored by browsers without nested view-transition groups, where it harmlessly\n * degrades to the flat default.\n */\nfunction applyGroup(\n element: Element,\n name: string,\n group: string | undefined,\n grouped: Element[],\n clipChildren?: Set\n) {\n if (!group) return\n ;(element as HTMLElement).style?.setProperty(\"view-transition-group\", group)\n grouped.push(element)\n\n if (group !== \"none\" && clipChildren) {\n const style = getComputedStyle(element)\n if (style.overflowX !== \"visible\" || style.overflowY !== \"visible\") {\n clipChildren.add(name)\n }\n }\n}\n\n/**\n * Resolve a selector/Element to elements and ensure each one carries a\n * `view-transition-name` we can target from script.\n *\n * Author-defined names are reused as-is. Elements that are unnamed (or use\n * the browser's `auto`/`match-element`, whose generated name is not exposed\n * to script) are given a unique generated name, set inline so it's captured,\n * and tracked in `assigned` for later cleanup.\n *\n * `registry` maps each Element to its name so the same element keeps its name\n * across both captures (before and after the update), which is what allows a\n * persistent element to animate as a single `group` layer.\n */\nexport function assignViewTransitionNames(\n definition: ElementOrSelector,\n registry: Map,\n assigned: Element[],\n forcedNames?: string[],\n className?: string,\n classed: Element[] = [],\n group?: string,\n grouped: Element[] = [],\n clipChildren?: Set\n): string[] {\n const elements = resolveElements(definition)\n\n /**\n * The new end of a paired morph: give each element the matching name from\n * the old end (by index) so the two share one layer and morph. If the new\n * end resolves to *more* elements than the old end named, the extras have no\n * counterpart - give them a fresh name so they animate as newcomers rather\n * than being silently left unnamed. We return the names actually assigned\n * (sized to the resolved elements), not the raw `forcedNames`, so stagger\n * totals and the layer set stay in step with what's on the page.\n */\n if (forcedNames) {\n return elements.map((element, i) => {\n const existing = registry.get(element)\n if (existing) return existing\n\n const name = forcedNames[i] ?? generatedName()\n ;(element as HTMLElement).style?.setProperty(\n \"view-transition-name\",\n name\n )\n assigned.push(element)\n registry.set(element, name)\n tagClass(element, className, classed)\n applyGroup(element, name, group, grouped, clipChildren)\n\n return name\n })\n }\n\n /**\n * Read every current name up front, before assigning any. Interleaving the\n * reads with the inline `setProperty` writes below would dirty styles\n * between reads and force a style recalc per element; batching the reads\n * keeps it to one. Elements already in the registry keep their name and\n * need no read.\n */\n const currentNames = elements.map((element) =>\n registry.has(element)\n ? undefined\n : getComputedStyle(element).getPropertyValue(\"view-transition-name\")\n )\n\n return elements.map((element, i) => {\n const existing = registry.get(element)\n if (existing) return existing\n\n const current = currentNames[i]\n\n let name: string\n if (\n current &&\n current !== \"none\" &&\n current !== \"auto\" &&\n current !== \"match-element\" &&\n !isGeneratedName(current)\n ) {\n /**\n * The author already named this layer - target it as-is and leave\n * it to them to clean up. `auto`/`match-element` are overridden\n * because their generated name is not exposed to script, and a\n * stale `motion-view-*` (e.g. left by an interrupted transition) is\n * re-owned rather than adopted as an author name and leaked.\n */\n name = current\n } else {\n name = generatedName()\n ;(element as HTMLElement).style?.setProperty(\n \"view-transition-name\",\n name\n )\n assigned.push(element)\n }\n\n registry.set(element, name)\n tagClass(element, className, classed)\n applyGroup(element, name, group, grouped, clipChildren)\n\n return name\n })\n}\n\n/**\n * Remove the `view-transition-name`s we generated and the\n * `view-transition-class`es we applied. Author-defined names are never touched\n * (they're not in `assigned`). Safe to call more than once (e.g. on both a\n * finished and an interrupted transition).\n */\nexport function releaseViewTransitionNames(\n assigned: Element[],\n classed: Element[] = [],\n grouped: Element[] = []\n): void {\n for (const element of assigned) {\n ;(element as HTMLElement).style?.removeProperty(\"view-transition-name\")\n }\n for (const element of classed) {\n ;(element as HTMLElement).style?.removeProperty(\"view-transition-class\")\n }\n for (const element of grouped) {\n ;(element as HTMLElement).style?.removeProperty(\"view-transition-group\")\n }\n}\n","export function chooseLayerType(\n valueName: \"layout\" | \"enter\" | \"exit\" | \"new\" | \"old\"\n): \"group\" | \"old\" | \"new\" {\n if (valueName === \"layout\") return \"group\"\n if (valueName === \"enter\" || valueName === \"new\") return \"new\"\n return \"old\"\n}\n","let pendingRules: Record> = {}\n\nlet style: HTMLStyleElement | null = null\n\nexport const css = {\n set: (selector: string, values: Record) => {\n pendingRules[selector] = values\n },\n\n commit: () => {\n if (!style) {\n style = document.createElement(\"style\")\n style.id = \"motion-view\"\n }\n\n let cssText = \"\"\n\n for (const selector in pendingRules) {\n const rule = pendingRules[selector]\n cssText += `${selector} {\\n`\n for (const [property, value] of Object.entries(rule)) {\n cssText += ` ${property}: ${value};\\n`\n }\n cssText += \"}\\n\"\n }\n\n style.textContent = cssText\n document.head.appendChild(style)\n\n pendingRules = {}\n },\n\n remove: () => {\n if (style && style.parentElement) {\n style.parentElement.removeChild(style)\n }\n },\n}\n","export function getViewAnimationLayerInfo(pseudoElement: string) {\n const match = pseudoElement.match(\n // `group-children` (nested transitions) before `group` so it wins.\n /::view-transition-(old|new|group-children|group|image-pair)\\((.*?)\\)/\n )\n if (!match) return null\n\n return { layer: match[2], type: match[1] }\n}\n","export function getViewAnimations() {\n return document.getAnimations().filter((animation) => {\n const { effect } = animation\n return (\n !!effect &&\n effect.target === document.documentElement &&\n (effect as KeyframeEffect).pseudoElement?.startsWith(\n \"::view-transition\"\n )\n )\n })\n}\n","import { ViewTransitionTarget, ViewTransitionTargetDefinition } from \"../types\"\n\nexport function hasTarget(\n target: ViewTransitionTargetDefinition,\n targets: Map\n) {\n return targets.has(target) && Object.keys(targets.get(target)!).length > 0\n}\n","import { secondsToMilliseconds, warnOnce } from \"motion-utils\"\nimport { GroupAnimation } from \"../animation/GroupAnimation\"\nimport { NativeAnimation } from \"../animation/NativeAnimation\"\nimport { NativeAnimationWrapper } from \"../animation/NativeAnimationWrapper\"\nimport { AnimationPlaybackControls, DOMKeyframesDefinition } from \"../animation/types\"\nimport { getValueTransition } from \"../animation/utils/get-value-transition\"\nimport { mapEasingToNativeEasing } from \"../animation/waapi/easing/map-easing\"\nimport { applyGeneratorOptions } from \"../animation/waapi/utils/apply-generator\"\nimport { cornerRadiusProps } from \"../utils/border-radius\"\nimport { ElementOrSelector, resolveElements } from \"../utils/resolve-elements\"\nimport type { ViewTransitionBuilder } from \"./index\"\nimport { ViewTransitionTarget, ViewTransitionTargetDefinition } from \"./types\"\nimport {\n assignViewTransitionNames,\n releaseViewTransitionNames,\n} from \"./utils/assign-names\"\nimport { chooseLayerType } from \"./utils/choose-layer-type\"\nimport { css } from \"./utils/css\"\nimport { getViewAnimationLayerInfo } from \"./utils/get-layer-info\"\nimport { getViewAnimations } from \"./utils/get-view-animations\"\nimport { hasTarget } from \"./utils/has-target\"\n\nconst definitionNames = [\"layout\", \"enter\", \"exit\", \"new\", \"old\"] as const\n\ntype CornerRadii = Record<(typeof cornerRadiusProps)[number], string>\n\n/**\n * Whether a computed border-radius is square (every component zero). Splitting\n * on whitespace handles two-value/elliptical radii like \"0px 20px\" - a leading\n * `parseFloat` alone would misread the non-zero vertical radius as square.\n */\nconst isSquareRadius = (radius: string) =>\n radius.split(\" \").every((value) => parseFloat(value) === 0)\n\n/**\n * The `ViewTransitionTarget` buckets driving each generated layer type, in\n * priority order - the inverse of `chooseLayerType`. The new view is driven by\n * `new`/`enter`, the old by `old`/`exit`. `group-children`/`image-pair` have no\n * bucket; they follow the default layout timing.\n */\nconst typeBuckets: Record = {\n group: [\"layout\"],\n new: [\"new\", \"enter\"],\n old: [\"old\", \"exit\"],\n}\n\n/**\n * Default \"absent\" origin for a single-value keyframe, by pseudo type, so e.g.\n * `enter({ scale: 1 })` grows in from 0.85 and `exit({ opacity: 0 })` fades\n * from 1. `enter` prefers the matching `exit` value over these (see below).\n */\nconst ORIGIN_DEFAULTS: Record> = {\n new: { opacity: 0, scale: 0.85 },\n old: { opacity: 1, scale: 1 },\n}\n\n/**\n * How much two box aspect ratios must differ before a morph is treated as\n * aspect-changing (and so worth cropping). Matches the projection engine's\n * `preserve-aspect` threshold, so small layout jitter doesn't trigger a crop.\n */\nconst ASPECT_TOLERANCE = 0.2\n\nexport function startViewAnimation(\n builder: ViewTransitionBuilder\n): Promise {\n const {\n update,\n targets,\n resolveDefs,\n cropOverride,\n pairs,\n classNames,\n flatGroups,\n options: defaultOptions,\n } = builder\n\n if (!document.startViewTransition) {\n // An async IIFE (not `new Promise(async …)`) so a throwing/rejecting\n // update rejects this promise rather than leaving it unsettled.\n return (async () => {\n await update()\n return new GroupAnimation([])\n })()\n }\n\n /**\n * Resolve any selector/Element targets to layer names, assigning a\n * `view-transition-name` to each element as we go. We run this before the\n * update (so the elements are captured in the old snapshot) and again\n * after it (for the new snapshot). An element present in both keeps the\n * same name and animates as a single `group` layer.\n */\n const nameRegistry = new Map()\n const assigned: Element[] = []\n /**\n * Elements we tagged with a `view-transition-class` (via `.class()`),\n * tracked separately from `assigned` so cleanup removes the class without\n * ever stripping an author's own inline `view-transition-name`.\n */\n const classed: Element[] = []\n /**\n * Elements we set a `view-transition-group` on (for nesting), tracked for\n * cleanup. `clipChildren` collects the names of nested parents that clip in\n * the live layout, so their `::view-transition-group-children` is clipped\n * through the transition - not just once the live DOM takes back over.\n */\n const grouped: Element[] = []\n const clipChildren = new Set()\n const layerTargets = new Map()\n const croppedNames = new Set()\n /**\n * Each layer's explicit `.crop(true | false)` override (by resolved name),\n * so `finalizeCrop` can let an author's choice win over the morph default.\n */\n const cropForName = new Map()\n /**\n * Each layer's stagger position (index + total) within its subject, per\n * snapshot. Resolving against the snapshot the layer belongs to keeps\n * stagger correct when `update()` replaces the matched elements, and lets\n * us skip a layer that's absent from a snapshot (e.g. an exited element\n * has no `new` pseudo-element).\n */\n const layerStagger = new Map<\n string,\n { old?: [number, number]; new?: [number, number] }\n >()\n /**\n * Names allocated for a paired subject in the old snapshot, replayed onto\n * its new-snapshot target so both ends share a layer and morph.\n */\n const pairNames = new Map()\n /**\n * The old (`from`) elements of each paired subject, so their names can be\n * transferred off before the new (`to`) elements inherit them.\n */\n const pairFrom = new Map()\n\n const resolveLayers = (phase: \"old\" | \"new\") => {\n targets.forEach((target, definition) => {\n const className = classNames.get(definition)\n /**\n * Nest each resolved layer under its DOM-ancestor layer by default\n * (`contain`), so an ancestor's clip/transform/opacity reach it\n * through the transition; `.group(false)` opts a subject out (`none`)\n * to stay flat and escape. Skipped for root / pre-named layers, which\n * aren't elements we resolve and style.\n */\n const group =\n definition === \"root\" || !resolveDefs.has(definition)\n ? undefined\n : flatGroups.has(definition)\n ? \"none\"\n : \"contain\"\n let names: string[]\n if (definition === \"root\" || !resolveDefs.has(definition)) {\n names = [definition as string]\n } else if (pairs.has(definition)) {\n /**\n * Paired morph: name the old target in the old snapshot, then\n * force the same name(s) onto the new target in the new one, so\n * two different elements morph as a single layer.\n */\n if (phase === \"old\") {\n pairFrom.set(\n definition,\n resolveElements(definition as ElementOrSelector)\n )\n names = assignViewTransitionNames(\n definition as ElementOrSelector,\n nameRegistry,\n assigned,\n undefined,\n className,\n classed,\n group,\n grouped,\n clipChildren\n )\n pairNames.set(definition, names)\n } else {\n /**\n * Transfer the name(s) off the `from` elements before the\n * `to` elements inherit them. A `from` that survives into\n * the new snapshot (e.g. hidden with `visibility: hidden`\n * rather than removed) would otherwise keep the name and\n * collide - \"duplicate view-transition-name\".\n */\n for (const el of pairFrom.get(definition) ?? []) {\n ;(el as HTMLElement).style?.removeProperty(\n \"view-transition-name\"\n )\n /**\n * Drop the old end from the registry too, so the new\n * end alone supplies this name's `new` crop radii - we\n * neither re-measure nor get ordered by a stale element.\n */\n nameRegistry.delete(el)\n }\n names = assignViewTransitionNames(\n pairs.get(definition) as ElementOrSelector,\n nameRegistry,\n assigned,\n pairNames.get(definition),\n className,\n classed,\n group,\n grouped,\n clipChildren\n )\n }\n } else {\n names = assignViewTransitionNames(\n definition as ElementOrSelector,\n nameRegistry,\n assigned,\n undefined,\n className,\n classed,\n group,\n grouped,\n clipChildren\n )\n }\n\n // Record any explicit `.crop(true | false)` per resolved name; the\n // crop set itself is computed later by `finalizeCrop` (it needs both\n // snapshots to know which morphs change aspect ratio).\n const override = cropOverride.get(definition)\n\n names.forEach((name, index) => {\n /**\n * If two subjects resolve to the same element, merge their\n * definitions so neither subject's animations are dropped.\n */\n const existing = layerTargets.get(name)\n layerTargets.set(\n name,\n existing && existing !== target\n ? { ...existing, ...target }\n : target\n )\n\n if (override !== undefined) cropForName.set(name, override)\n\n const stagger = layerStagger.get(name) ?? {}\n stagger[phase] = [index, names.length]\n layerStagger.set(name, stagger)\n })\n })\n }\n\n /**\n * The stagger index/total for a layer, resolved against the snapshot it\n * belongs to. Returns index -1 when the layer is absent from that snapshot\n * so the caller can skip a pseudo-element that doesn't exist.\n */\n const staggerPosition = (name: string, type: string) => {\n const stagger = layerStagger.get(name)\n const position =\n type === \"old\"\n ? stagger?.old\n : type === \"new\"\n ? stagger?.new\n : // group / group-children / image-pair persist across both.\n stagger?.new ?? stagger?.old\n return position ?? ([-1, 1] as const)\n }\n\n /**\n * Merge default + per-layer transition options for a generated layer and\n * resolve any stagger/delay function against this element's position. Used\n * by both the morph-retiming and crop corner-radius passes.\n */\n const resolveLayerTransition = (\n target: ViewTransitionTarget | undefined,\n type: string,\n transitionName: string,\n index: number,\n total: number\n ) => {\n const transition = mergeTransition(\n getValueTransition(defaultOptions, transitionName),\n getValueTransition(\n (layerOptions(target, type) ?? {}) as any,\n transitionName\n )\n )\n\n if (typeof transition.delay === \"function\") {\n transition.delay = transition.delay(index, total)\n }\n\n return transition\n }\n\n /**\n * Resolve a layer's group (`layout`) timing to plain WAAPI values: native\n * ms `delay`/`duration` and a baked `ease`. The single source of group\n * timing, shared by the generated-group retiming and the crop corner-radius\n * pass so the rounded clip animates on exactly the box's timing. It returns\n * no generator `type` (the WAAPI-only `NativeAnimation` rejects a string\n * type) nor `repeat`/`times` (which the group's `updateTiming` ignores), so\n * none of them can leak into the radius animation and desync it.\n */\n const resolveGroupTiming = (name: string) => {\n const [index, total] = staggerPosition(name, \"group\")\n const transition = resolveLayerTransition(\n layerTargets.get(name),\n \"group\",\n \"layout\",\n index === -1 ? 0 : index,\n total\n )\n transition.duration &&= secondsToMilliseconds(transition.duration)\n const { delay = 0, duration, ease } = applyGeneratorOptions(transition)\n return { delay: secondsToMilliseconds(delay), duration, ease }\n }\n\n /**\n * Each layer's measured box + corner radii per snapshot. The box lets\n * `finalizeCrop` tell whether a morph's aspect ratio changed (the only case\n * worth cropping); the radii let a cropped morph's group clip animate each\n * corner from the old element's radius to the new element's, keeping it\n * rounded where `overflow: clip` would otherwise square the corners.\n *\n * We never flatten the source for capture (a snapshot is a paint of the live\n * DOM, so squaring an element just for its capture would flash one real\n * square frame). For an aspect-changing morph `object-fit: cover` crops each\n * snapshot's own baked corners off-screen mid-morph, so the animated clip is\n * the only visible corner; a near-same-aspect forced crop (`.crop(true)`)\n * can't hide the outgoing snapshot's silhouette, but the endpoints coincide.\n */\n const cropMeasurements = new Map<\n string,\n {\n old?: { width: number; height: number; radii: CornerRadii }\n new?: { width: number; height: number; radii: CornerRadii }\n }\n >()\n\n const measureLayers = (phase: \"old\" | \"new\") =>\n nameRegistry.forEach((name, element) => {\n const el = element as HTMLElement\n const rect = el.getBoundingClientRect?.()\n if (rect && rect.height) {\n const style = getComputedStyle(el)\n const radii = {} as CornerRadii\n for (const corner of cornerRadiusProps) {\n radii[corner] = style[corner]\n }\n const entry = cropMeasurements.get(name) ?? {}\n entry[phase] = { width: rect.width, height: rect.height, radii }\n cropMeasurements.set(name, entry)\n }\n })\n\n /**\n * With both snapshots measured, settle which layers crop. The default crops\n * only a morph whose aspect ratio *changes* between snapshots - the one case\n * where `object-fit: cover` does real work. A same-aspect morph or a\n * fade-only layer is left uncropped: its corners scale naturally (no flash\n * from squaring, no `overflow: clip` eating its shadow) and a backdrop can't\n * be clipped to nothing. An explicit `.crop(true | false)` overrides either\n * way. Runs after both snapshots are measured, since aspect needs both.\n */\n const finalizeCrop = () => {\n croppedNames.clear()\n for (const name of layerStagger.keys()) {\n if (name === \"root\") continue\n // An explicit `.crop(true | false)` wins; otherwise crop a morph\n // whose aspect ratio changed.\n if (cropForName.get(name) ?? aspectChanged(name)) {\n croppedNames.add(name)\n }\n }\n }\n\n /**\n * Whether a layer is a morph whose box aspect ratio changed between\n * snapshots (beyond a small tolerance). Fade-only layers (one snapshot) are\n * never \"changed\".\n */\n const aspectChanged = (name: string) => {\n const box = cropMeasurements.get(name)\n if (!box?.old || !box?.new || !box.old.height || !box.new.height) {\n return false\n }\n return (\n Math.abs(\n box.old.width / box.old.height -\n box.new.width / box.new.height\n ) > ASPECT_TOLERANCE\n )\n }\n\n /**\n * Write the persistent view-transition CSS: suppress root capture when the\n * root has no animations of its own; force linear timing (baked into the\n * keyframes, so we can retime later via updateTiming); and clip +\n * object-fit: cover every cropped morph (the UA default overflows on\n * aspect-ratio change).\n *\n * `css.commit` replaces rather than appends, so we re-set the full rule set\n * each call - the crop rules are only known after `finalizeCrop` runs in the\n * update callback, so the second call writes them.\n */\n const commitViewCSS = () => {\n if (!hasTarget(\"root\", targets)) {\n css.set(\":root\", { \"view-transition-name\": \"none\" })\n }\n\n css.set(\n \"::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)\",\n { \"animation-timing-function\": \"linear !important\" }\n )\n\n croppedNames.forEach((name) => {\n css.set(`::view-transition-group(${name})`, { overflow: \"clip\" })\n css.set(\n `::view-transition-old(${name}), ::view-transition-new(${name})`,\n { width: \"100%\", height: \"100%\", \"object-fit\": \"cover\" }\n )\n })\n\n /**\n * Clip the nested children of any layer that clips in the live layout,\n * so a wrapper crops its child for the whole morph (mirroring the DOM)\n * rather than only at the live-DOM handoff. No-op on browsers without\n * nested view-transition groups.\n */\n clipChildren.forEach((name) => {\n css.set(`::view-transition-group-children(${name})`, {\n overflow: \"clip\",\n })\n })\n\n css.commit() // Write\n }\n\n const cleanup = () => {\n releaseViewTransitionNames(assigned, classed, grouped)\n css.remove() // Write\n }\n\n const callback = async () => {\n await update()\n\n /**\n * Re-resolve so elements created by the update are named for the new\n * snapshot, then measure them. With both snapshots measured we can\n * settle the crop set (aspect-changing morphs + forced).\n */\n resolveLayers(\"new\")\n measureLayers(\"new\")\n finalizeCrop()\n\n /**\n * Re-commit the crop CSS unconditionally: `finalizeCrop` is computed\n * here (after both snapshots are measured), so the clip rules must be\n * (re)written to match the settled set.\n */\n commitViewCSS()\n }\n\n let transition: ViewTransition\n try {\n resolveLayers(\"old\")\n /**\n * Measure the old snapshot against the optimistic crop set (the new\n * snapshot doesn't exist yet, so aspect change can't be known here;\n * `finalizeCrop` settles it post-update).\n */\n measureLayers(\"old\")\n commitViewCSS()\n transition = document.startViewTransition(callback)\n } catch (error) {\n /**\n * The prelude writes inline names before the transition exists. If it\n * throws (e.g. startViewTransition rejects in a bad UA state), release\n * them so we neither leak DOM state nor stall the queue on a promise\n * that never settles - hand back a rejection it can advance past.\n */\n cleanup()\n return Promise.reject(error)\n }\n\n transition.finished.finally(cleanup)\n\n return new Promise((resolve, reject) => {\n transition.ready\n .then(() => {\n const generatedViewAnimations = getViewAnimations()\n\n const animations: AnimationPlaybackControls[] = []\n\n /**\n * Create animations for each of our explicitly-defined subjects.\n * `opacityAnimated` additionally tracks which `${name}:${type}`\n * we faded, so we can keep the UA `plus-lighter` blend only for a\n * genuine opacity crossfade (both sides fading) and drop it for a\n * slide/transform, where additive compositing would flash bright.\n */\n const explicitlyAnimated = new Set()\n const opacityAnimated = new Set()\n layerTargets.forEach((target, name) => {\n const stagger = layerStagger.get(name)\n /**\n * Presence: `enter` only fires for a pure newcomer (a new\n * view with no old), `exit` only for a pure leaver. A\n * survivor (both) gets neither - it just morphs.\n */\n const enterApplies = !!stagger?.new && !stagger?.old\n const exitApplies = !!stagger?.old && !stagger?.new\n\n for (const key of definitionNames) {\n if (!target[key]) continue\n if (key === \"enter\" && !enterApplies) continue\n if (key === \"exit\" && !exitApplies) continue\n\n const type = chooseLayerType(\n key as keyof ViewTransitionTarget\n )\n const [index, total] = staggerPosition(name, type)\n // Skip a layer absent from its snapshot.\n if (index === -1) continue\n\n const { keyframes, options } =\n target[key as keyof ViewTransitionTarget]!\n\n for (let [valueName, valueKeyframes] of Object.entries(\n keyframes\n )) {\n // Skip only missing values - `0` (e.g. opacity: 0)\n // is valid and must reach the from-value inference.\n if (valueKeyframes == null) continue\n\n /**\n * The view path hands keyframes straight to WAAPI,\n * so Motion's `x`/`y` shorthands (compiled to\n * `transform` only via the value pipeline) have no\n * effect. Warn and skip - use `transform`/`translate`.\n */\n if (valueName === \"x\" || valueName === \"y\") {\n warnOnce(\n false,\n `animateView() animates view-transition layers with CSS properties; the \"${valueName}\" shorthand has no effect - use transform, e.g. { transform: \"translateX(40px)\" }.`\n )\n continue\n }\n\n /**\n * enter/exit win over new/old on a shared property -\n * skip it here when the gated bucket also defines it.\n */\n if (\n key === \"new\" &&\n enterApplies &&\n target.enter?.keyframes[\n valueName as keyof DOMKeyframesDefinition\n ] != null\n ) {\n continue\n }\n if (\n key === \"old\" &&\n exitApplies &&\n target.exit?.keyframes[\n valueName as keyof DOMKeyframesDefinition\n ] != null\n ) {\n continue\n }\n\n const valueOptions = mergeTransition(\n getValueTransition(\n defaultOptions as any,\n valueName\n ),\n getValueTransition(options as any, valueName)\n )\n\n /**\n * Infer an origin for a single-value keyframe. An\n * `enter` mirrors the matching `exit` value (a\n * defined exit reverses into the enter for free);\n * otherwise the per-type default (opacity 0/1, scale\n * 0.85). No default -> left as-is (animates from the\n * live value).\n *\n * `new`/`old` fire for survivors too, where only the\n * opacity crossfade default applies - a transform\n * default like scale 0.85 would pop a persisting\n * element, so gate it on the layer actually\n * entering/leaving.\n */\n if (!Array.isArray(valueKeyframes)) {\n const exitValue =\n key === \"enter\"\n ? target.exit?.keyframes[\n valueName as keyof DOMKeyframesDefinition\n ]\n : undefined\n const allowDefault =\n valueName === \"opacity\" ||\n (type === \"new\" ? enterApplies : exitApplies)\n const from =\n exitValue != null\n ? Array.isArray(exitValue)\n ? exitValue[exitValue.length - 1]\n : exitValue\n : allowDefault\n ? ORIGIN_DEFAULTS[type]?.[valueName]\n : undefined\n if (from !== undefined) {\n valueKeyframes = [from, valueKeyframes]\n }\n }\n\n /**\n * Resolve stagger function if provided, per element\n * across this subject's resolved layers.\n */\n if (typeof valueOptions.delay === \"function\") {\n valueOptions.delay = valueOptions.delay(\n index,\n total\n )\n }\n\n valueOptions.duration &&= secondsToMilliseconds(\n valueOptions.duration\n )\n\n valueOptions.delay &&= secondsToMilliseconds(\n valueOptions.delay\n )\n\n animations.push(\n new NativeAnimation({\n ...valueOptions,\n element: document.documentElement,\n name: valueName,\n pseudoElement: `::view-transition-${type}(${name})`,\n keyframes: valueKeyframes,\n })\n )\n explicitlyAnimated.add(`${name}:${type}`)\n if (valueName === \"opacity\") {\n opacityAnimated.add(`${name}:${type}`)\n }\n }\n }\n })\n\n /**\n * Handle browser generated animations\n */\n for (const animation of generatedViewAnimations) {\n if (animation.playState === \"finished\") continue\n\n const { effect } = animation\n if (!effect || !(effect instanceof KeyframeEffect)) continue\n\n const { pseudoElement } = effect\n if (!pseudoElement) continue\n\n const name = getViewAnimationLayerInfo(pseudoElement)\n if (!name) continue\n\n const targetDefinition = layerTargets.get(name.layer)\n\n /**\n * We built our own animation for this layer, so drop the\n * browser-generated fade we're replacing. The UA\n * `plus-lighter` blend is a *separate* generated animation on\n * the same pseudo (it sets `mix-blend-mode` in its keyframes):\n * keep it *only* for a true opacity crossfade - both sides\n * fading - so a symmetric crossfade composites without\n * darkening, but a slide/transform (where both layers stay\n * opaque and overlap) doesn't flash bright from the addition.\n */\n if (explicitlyAnimated.has(`${name.layer}:${name.type}`)) {\n const isCrossfade =\n opacityAnimated.has(`${name.layer}:new`) &&\n opacityAnimated.has(`${name.layer}:old`)\n if (\n isCrossfade &&\n effect\n .getKeyframes()\n .some((keyframe) => keyframe.mixBlendMode)\n ) {\n animations.push(new NativeAnimationWrapper(animation))\n } else {\n animation.cancel()\n }\n continue\n }\n\n /**\n * Drop the orphaned half of the default crossfade. The UA\n * fades old out and new in as a *pair*; if the opposing half\n * was explicitly overridden with something other than an\n * opacity fade (a clip or transform reveal), this side's\n * default opacity fade has no partner - left to run it would\n * dissolve what should be a static backdrop (e.g.\n * `.new({ clipPath })` should reveal over a still old view,\n * not fade the old out around the growing clip). Cancel it -\n * and its `plus-lighter` sibling on the same pseudo, which\n * would otherwise flash bright where the two opaque layers\n * overlap. A genuine crossfade (the opposing side also fading\n * opacity) keeps both halves and is handled above.\n */\n const opposite =\n name.type === \"old\"\n ? \"new\"\n : name.type === \"new\"\n ? \"old\"\n : undefined\n if (\n opposite &&\n explicitlyAnimated.has(\n `${name.layer}:${opposite}`\n ) &&\n !opacityAnimated.has(`${name.layer}:${opposite}`)\n ) {\n animation.cancel()\n continue\n }\n\n /**\n * Otherwise retime the browser-generated animation to\n * Motion's timing. This auto-enables the layout (group)\n * morph for any resolved/named target, and applies the\n * default timing to old/new layers we haven't explicitly\n * overridden.\n *\n * group + group-children both follow the layout timing so\n * the nesting container stays in sync with the morph.\n */\n /**\n * A survivor's old + new are the two halves of one\n * `plus-lighter` crossfade. They must share identical timing\n * (so their opacities stay mirrored and sum to 1 - else the\n * additive blend flashes bright wherever both are partly\n * visible) and fade linearly (the bounce belongs on the\n * group's geometry, not the opacity). So time them as the\n * group, rather than via their own - potentially staggered,\n * or enter/exit-derived - old/new options.\n */\n const stagger = layerStagger.get(name.layer)\n const isMorphCrossfade =\n (name.type === \"old\" || name.type === \"new\") &&\n !!stagger?.old &&\n !!stagger?.new\n\n let timing: {\n delay: number\n duration?: number\n easing: string\n }\n if (name.type.startsWith(\"group\")) {\n // group + group-children follow the resolved group\n // timing - the single source shared with the crop\n // corner-radius pass below.\n const { delay, duration, ease } = resolveGroupTiming(\n name.layer\n )\n timing = {\n delay,\n duration,\n easing: mapEasingToNativeEasing(\n ease,\n duration!\n ) as string,\n }\n } else {\n const timingType = isMorphCrossfade ? \"group\" : name.type\n const [index, total] = staggerPosition(\n name.layer,\n timingType\n )\n const transitionName =\n timingType === \"group\" ? \"layout\" : \"\"\n let animationTransition = resolveLayerTransition(\n targetDefinition,\n timingType,\n transitionName,\n index === -1 ? 0 : index,\n total\n )\n\n /**\n * The crossfade should resolve at the spring's\n * *perceptual* (visual) duration - the geometry can keep\n * bouncing, but the opacity shouldn't drag through the\n * settle. So capture `visualDuration` before\n * `applyGeneratorOptions` replaces it with the full\n * overshoot duration, and use it for the fade.\n */\n const visualDuration = animationTransition.visualDuration\n\n animationTransition.duration &&= secondsToMilliseconds(\n animationTransition.duration\n )\n\n animationTransition =\n applyGeneratorOptions(animationTransition)\n\n timing = {\n delay: secondsToMilliseconds(\n animationTransition.delay ?? 0\n ),\n duration:\n isMorphCrossfade && visualDuration !== undefined\n ? secondsToMilliseconds(visualDuration)\n : animationTransition.duration,\n easing: isMorphCrossfade\n ? \"linear\"\n : (mapEasingToNativeEasing(\n animationTransition.ease,\n animationTransition.duration!\n ) as string),\n }\n }\n\n effect.updateTiming(timing)\n\n animations.push(new NativeAnimationWrapper(animation))\n }\n\n /**\n * Round each cropped layer's clip. Its `::view-transition-group`\n * has `overflow: clip`, which would otherwise square the corners\n * mid-morph; animate each corner from the old element's radius to\n * the new element's so the crop stays rounded. Timed as the group\n * (`layout`) so the radius tracks the morphing box.\n */\n cropMeasurements.forEach((entry, name) => {\n if (!croppedNames.has(name)) return\n\n // Reuse the group's resolved timing - native ms delay/\n // duration + a baked ease, with no generator `type` or\n // repeat/times to leak into (or throw inside) NativeAnimation.\n const { delay, duration, ease } = resolveGroupTiming(name)\n\n for (const corner of cornerRadiusProps) {\n // `||` (not `??`) so an empty measurement falls back to\n // the other snapshot rather than an invalid keyframe.\n const from =\n entry.old?.radii[corner] ||\n entry.new?.radii[corner] ||\n \"0px\"\n const to =\n entry.new?.radii[corner] ||\n entry.old?.radii[corner] ||\n \"0px\"\n // Nothing to round if the corner is square at both ends.\n if (isSquareRadius(from) && isSquareRadius(to)) continue\n\n animations.push(\n new NativeAnimation({\n element: document.documentElement,\n name: corner,\n pseudoElement: `::view-transition-group(${name})`,\n keyframes: [from, to],\n delay,\n duration,\n ease,\n })\n )\n }\n })\n\n resolve(new GroupAnimation(animations))\n })\n .catch(() =>\n /**\n * `ready` rejects when the transition is skipped - no visual\n * change, or superseded by an interrupting transition. The DOM\n * update still applied, so settle with no animations rather than\n * surfacing it as an error to an awaiting caller. A genuine\n * failure in `update()` rejects `updateCallbackDone` (already\n * settled by now), so propagate that instead.\n */\n transition.updateCallbackDone.then(\n () => resolve(new GroupAnimation([])),\n reject\n )\n )\n })\n}\n\n/**\n * The options that should time a given generated layer type, so a retimed\n * group/old/new picks up any per-target transition the user provided. Checks\n * the type's buckets in priority order (e.g. `new` before `enter`).\n */\nfunction layerOptions(target: ViewTransitionTarget | undefined, type: string) {\n for (const bucket of typeBuckets[type] ?? []) {\n const options = target?.[bucket]?.options\n if (options) return options\n }\n}\n\n/**\n * Merge a base transition (e.g. the default `options`) with a per-layer/value\n * override. An explicit `duration` on the override must win over an inherited\n * generator's own timing: a spring prefers `visualDuration`, and\n * `spring.applyToOptions` overwrites `duration` with the computed settle time -\n * so without this the override is silently discarded. Dropping the inherited\n * `type`/`visualDuration` makes the layer a plain tween of that duration, unless\n * it asked for its own generator `type`/`visualDuration`.\n */\nfunction mergeTransition(base: any, override: any) {\n const merged = { ...base, ...override }\n\n if (override.duration !== undefined) {\n if (override.visualDuration === undefined) delete merged.visualDuration\n if (override.type === undefined) delete merged.type\n }\n\n return merged\n}\n","import { removeItem } from \"motion-utils\"\nimport type { ViewTransitionBuilder } from \".\"\nimport { microtask } from \"../frameloop/microtask\"\nimport { startViewAnimation } from \"./start\"\n\nlet builders: ViewTransitionBuilder[] = []\n\nlet current: ViewTransitionBuilder | null = null\n\nfunction next() {\n current = null\n const [nextBuilder] = builders\n if (nextBuilder) start(nextBuilder)\n}\n\nfunction start(builder: ViewTransitionBuilder) {\n removeItem(builders, builder)\n current = builder\n startViewAnimation(builder)\n .then((animation) => {\n builder.notifyReady(animation)\n return animation.finished\n })\n // A genuinely failed transition (a throwing update) rejects the\n // builder; a skipped/interrupted one resolves with no animations (see\n // start.ts). Either way, advance the queue - else later transitions hang.\n .catch((error) => builder.notifyReject(error))\n .finally(next)\n}\n\nfunction processQueue() {\n /**\n * Iterate backwards over the builders array. We can ignore the\n * \"wait\" animations. If we have an interrupting animation in the\n * queue then we need to batch all preceeding animations into it.\n * Currently this only batches the update functions but will also\n * need to batch the targets.\n */\n for (let i = builders.length - 1; i >= 0; i--) {\n const builder = builders[i]\n const { interrupt } = builder.options\n\n if (interrupt === \"immediate\") {\n const batchedUpdates = builders.slice(0, i + 1).map((b) => b.update)\n const remaining = builders.slice(i + 1)\n\n builder.update = () => {\n batchedUpdates.forEach((update) => update())\n }\n\n // Put the current builder at the front, followed by any \"wait\" builders\n builders = [builder, ...remaining]\n\n break\n }\n }\n\n if (!current || builders[0]?.options.interrupt === \"immediate\") {\n next()\n }\n}\n\nexport function addToQueue(builder: ViewTransitionBuilder) {\n builders.push(builder)\n microtask.render(processQueue)\n}\n","import { noop } from \"motion-utils\"\nimport type { GroupAnimation } from \"../animation/GroupAnimation\"\nimport { AnimationOptions, DOMKeyframesDefinition } from \"../animation/types\"\nimport { addToQueue } from \"./queue\"\nimport {\n ViewTransitionOptions,\n ViewTransitionTarget,\n ViewTransitionTargetDefinition,\n} from \"./types\"\nimport \"./types.global\"\n\n// Re-export the public view-transition types so they flow out through\n// motion-dom -> framer-motion -> motion alongside `animateView`.\nexport type * from \"./types\"\n\nexport class ViewTransitionBuilder {\n private currentSubject: ViewTransitionTargetDefinition = \"root\"\n\n targets = new Map()\n\n /**\n * Definitions that must be resolved to elements (and assigned a\n * `view-transition-name`) rather than treated as pre-named layers.\n */\n resolveDefs = new Set()\n\n /**\n * Per-subject crop override: `true` forces the crop (clip + object-fit:\n * cover + animated corner radii) on, `false` forces it off. A subject with\n * no entry uses the default - crop only a genuine morph (a layer present in\n * both snapshots), so a fade-only enter/exit isn't clipped to nothing.\n */\n cropOverride = new Map()\n\n /**\n * Subjects paired with a different new-snapshot target (the second `.add()`\n * argument), so two distinct elements share one name and morph into each\n * other - a shared-element transition.\n */\n pairs = new Map<\n ViewTransitionTargetDefinition,\n ViewTransitionTargetDefinition\n >()\n\n /**\n * A `view-transition-class` to apply to each subject's resolved elements,\n * so authors can target the generated layers from CSS by class rather than\n * the opaque generated name.\n */\n classNames = new Map()\n\n /**\n * Subjects opted out of automatic group nesting via `.group(false)`. Their\n * layer stays a flat top-level group (`view-transition-group: none`) instead\n * of nesting under its DOM-ancestor layer - so it animates independently and\n * escapes an ancestor's clip/transform (e.g. an element that lifts out of a\n * card and flies across, which nesting would clip to the card).\n */\n flatGroups = new Set()\n\n update: () => void | Promise\n\n options: ViewTransitionOptions\n\n notifyReady: (value: GroupAnimation) => void = noop\n\n notifyReject: (error: unknown) => void = noop\n\n private readyPromise = new Promise((resolve, reject) => {\n this.notifyReady = resolve\n this.notifyReject = reject\n })\n\n constructor(\n update: () => void | Promise,\n options: ViewTransitionOptions = {}\n ) {\n this.update = update\n this.options = {\n interrupt: \"wait\",\n ...options,\n }\n // Avoid an unhandled rejection when a failed transition has no\n // `.then(_, reject)` handler attached (e.g. fire-and-forget).\n this.readyPromise.catch(noop)\n addToQueue(this)\n }\n\n /**\n * Target elements resolved from a selector or Element, each assigned a\n * `view-transition-name` automatically.\n *\n * Passing a second target pairs them: the first is resolved in the old\n * snapshot and the second in the new, sharing one name so two *different*\n * elements morph into each other (e.g. `.add(card, \".modal\")`). Symmetric -\n * pass them the other way round to morph back.\n */\n add(\n subject: ViewTransitionTargetDefinition,\n newSubject?: ViewTransitionTargetDefinition\n ) {\n this.currentSubject = subject\n this.resolveDefs.add(subject)\n if (newSubject !== undefined) this.pairs.set(subject, newSubject)\n // Register the subject so it participates (and gets an automatic\n // layout/morph animation) even without an explicit enter/exit/layout.\n if (!this.targets.has(subject)) this.targets.set(subject, {})\n\n return this\n }\n\n /**\n * Control this subject's crop (clip + `object-fit: cover` + animated\n * corners). By default a subject auto-crops only when it actually morphs -\n * present in both snapshots (a survivor, or an `.add(a, b)` pair). A\n * fade-only enter/exit has no second box to crop against, so it's left to\n * the browser default; in particular the `overflow: clip` a crop adds would\n * otherwise clip a mis-sized enter/exit layer to nothing.\n *\n * `.crop(false)` forces the crop off (e.g. a text morph, where\n * `object-fit: cover` clips glyphs as the box grows); `.crop(true)` forces\n * it on for a non-morph the default wouldn't otherwise crop.\n */\n crop(enabled = true) {\n this.cropOverride.set(this.currentSubject, enabled)\n\n return this\n }\n\n /**\n * By default a subject's layer nests under its nearest DOM-ancestor layer\n * (`view-transition-group: contain`), so the ancestor's clip/transform/opacity\n * apply to it through the transition - mirroring how the DOM actually paints,\n * and letting a wrapper crop its child for the whole morph rather than only\n * once the live DOM takes back over. (Needs a browser that supports nested\n * view-transition groups; elsewhere it degrades to the flat default.)\n *\n * Call `.group(false)` to opt out: the layer stays flat and top-level, so it\n * animates independently and escapes an ancestor's clip - e.g. an element\n * that should lift out of a card and fly across, which nesting would clip.\n */\n group(enabled = true) {\n enabled\n ? this.flatGroups.delete(this.currentSubject)\n : this.flatGroups.add(this.currentSubject)\n\n return this\n }\n\n /**\n * Tag this subject's generated layers with a `view-transition-class`, so\n * they can be targeted from CSS - `::view-transition-group(.name)`,\n * `::view-transition-old/new(.name)`, `::view-transition-image-pair(.name)`\n * - without the opaque generated `view-transition-name`. Because `.add()`\n * can match many elements, a shared class targets them all at once (and,\n * for a pair, both ends). The escape hatch for z-index / custom keyframes\n * on a morph layer.\n */\n class(name: string) {\n this.classNames.set(this.currentSubject, name)\n\n return this\n }\n\n /**\n * Set the transition for this subject's morph. The morph is enabled\n * automatically by `.add()`; this just customises its timing (duration,\n * easing, a `delay`/`stagger`, …). On the implicit `root` subject it also\n * opts the page into the transition (the root crossfade).\n */\n layout(options: AnimationOptions = {}) {\n this.updateTarget(\"layout\", {}, options)\n\n return this\n }\n\n enter(keyframes: DOMKeyframesDefinition, options?: AnimationOptions) {\n this.updateTarget(\"enter\", keyframes, options)\n\n return this\n }\n\n exit(keyframes: DOMKeyframesDefinition, options?: AnimationOptions) {\n this.updateTarget(\"exit\", keyframes, options)\n\n return this\n }\n\n /**\n * Animate the new view directly, whether the element is appearing or\n * persisting (unlike `.enter()`, which only fires for a pure newcomer).\n * Pair with `.old()` for a crossfade or slide-through.\n */\n new(keyframes: DOMKeyframesDefinition, options?: AnimationOptions) {\n this.updateTarget(\"new\", keyframes, options)\n\n return this\n }\n\n /**\n * Animate the old view directly, whether the element is leaving or\n * persisting (unlike `.exit()`, which only fires for a pure leaver).\n */\n old(keyframes: DOMKeyframesDefinition, options?: AnimationOptions) {\n this.updateTarget(\"old\", keyframes, options)\n\n return this\n }\n\n updateTarget(\n target: \"enter\" | \"exit\" | \"layout\" | \"new\" | \"old\",\n keyframes: DOMKeyframesDefinition,\n options: AnimationOptions = {}\n ) {\n const { currentSubject, targets } = this\n\n if (!targets.has(currentSubject)) {\n targets.set(currentSubject, {})\n }\n\n const targetData = targets.get(currentSubject)!\n\n targetData[target] = { keyframes, options }\n }\n\n then(resolve: () => void, reject?: () => void) {\n return this.readyPromise.then(resolve, reject)\n }\n}\n\nexport function animateView(\n update: () => void | Promise,\n options: ViewTransitionOptions = {}\n) {\n return new ViewTransitionBuilder(update, options)\n}\n","import { Axis, AxisDelta, Box, Delta } from \"motion-utils\"\n\nexport const createAxisDelta = (): AxisDelta => ({\n translate: 0,\n scale: 1,\n origin: 0,\n originPoint: 0,\n})\n\nexport const createDelta = (): Delta => ({\n x: createAxisDelta(),\n y: createAxisDelta(),\n})\n\nexport const createAxis = (): Axis => ({ min: 0, max: 0 })\n\nexport const createBox = (): Box => ({\n x: createAxis(),\n y: createAxis(),\n})\n","import type { VisualElement } from \"./VisualElement\"\n\nexport const visualElementStore = new WeakMap()\n","import type { LegacyAnimationControls } from \"../../node/types\"\n\nexport function isAnimationControls(v?: unknown): v is LegacyAnimationControls {\n return (\n v !== null &&\n typeof v === \"object\" &&\n typeof (v as LegacyAnimationControls).start === \"function\"\n )\n}\n","/**\n * Decides if the supplied variable is variant label\n */\nexport function isVariantLabel(v: unknown): v is string | string[] {\n return typeof v === \"string\" || Array.isArray(v)\n}\n","import type { AnimationType } from \"../types\"\n\nexport const variantPriorityOrder: AnimationType[] = [\n \"animate\",\n \"whileInView\",\n \"whileFocus\",\n \"whileHover\",\n \"whileTap\",\n \"whileDrag\",\n \"exit\",\n]\n\nexport const variantProps = [\"initial\", ...variantPriorityOrder]\n","import type { MotionNodeOptions } from \"../../node/types\"\nimport { isAnimationControls } from \"./is-animation-controls\"\nimport { isVariantLabel } from \"./is-variant-label\"\nimport { variantProps } from \"./variant-props\"\n\nexport function isControllingVariants(props: MotionNodeOptions) {\n return (\n isAnimationControls(props.animate) ||\n variantProps.some((name) =>\n isVariantLabel(props[name as keyof typeof props])\n )\n )\n}\n\nexport function isVariantNode(props: MotionNodeOptions) {\n return Boolean(isControllingVariants(props) || props.variants)\n}\n","import { motionValue } from \"../../value\"\nimport { isMotionValue } from \"../../value/utils/is-motion-value\"\n\ntype MotionStyleLike = Record\n\n/**\n * Updates motion values from props changes.\n * Uses `any` type for element to avoid circular dependencies with VisualElement.\n */\nexport function updateMotionValuesFromProps(\n element: any,\n next: MotionStyleLike,\n prev: MotionStyleLike\n) {\n for (const key in next) {\n const nextValue = next[key]\n const prevValue = prev[key]\n\n if (isMotionValue(nextValue)) {\n /**\n * If this is a motion value found in props or style, we want to add it\n * to our visual element's motion value map.\n */\n element.addValue(key, nextValue)\n } else if (isMotionValue(prevValue)) {\n /**\n * If we're swapping from a motion value to a static value,\n * create a new motion value from that\n */\n element.addValue(key, motionValue(nextValue, { owner: element }))\n } else if (prevValue !== nextValue) {\n /**\n * If this is a flat value that has changed, update the motion value\n * or create one if it doesn't exist. We only want to do this if we're\n * not handling the value with our animation state.\n */\n if (element.hasValue(key)) {\n const existingValue = element.getValue(key)!\n\n if (existingValue.liveStyle === true) {\n existingValue.jump(nextValue)\n } else if (!existingValue.hasAnimated) {\n existingValue.set(nextValue)\n }\n } else {\n const latestValue = element.getStaticValue(key)\n element.addValue(\n key,\n motionValue(\n latestValue !== undefined ? latestValue : nextValue,\n { owner: element }\n )\n )\n }\n }\n }\n\n // Handle removed values\n for (const key in prev) {\n if (next[key] === undefined) element.removeValue(key)\n }\n\n return next\n}\n","interface ReducedMotionState {\n current: boolean | null\n}\n\n// Does this device prefer reduced motion? Returns `null` server-side.\nexport const prefersReducedMotion: ReducedMotionState = { current: null }\n\nexport const hasReducedMotionListener = { current: false }\n","import { hasReducedMotionListener, prefersReducedMotion } from \"./state\"\n\nconst isBrowser = typeof window !== \"undefined\"\n\nexport function initPrefersReducedMotion() {\n hasReducedMotionListener.current = true\n if (!isBrowser) return\n\n if (window.matchMedia) {\n const motionMediaQuery = window.matchMedia(\"(prefers-reduced-motion)\")\n\n const setReducedMotionPreferences = () =>\n (prefersReducedMotion.current = motionMediaQuery.matches)\n\n motionMediaQuery.addEventListener(\"change\", setReducedMotionPreferences)\n\n setReducedMotionPreferences()\n } else {\n prefersReducedMotion.current = false\n }\n}\n\nexport { prefersReducedMotion, hasReducedMotionListener }\n","import {\n Box,\n isNumericalString,\n isZeroValueString,\n secondsToMilliseconds,\n SubscriptionManager,\n warnOnce,\n} from \"motion-utils\"\nimport { KeyframeResolver } from \"../animation/keyframes/KeyframesResolver\"\nimport { NativeAnimation } from \"../animation/NativeAnimation\"\nimport type { AnyResolvedKeyframe } from \"../animation/types\"\nimport { acceleratedValues } from \"../animation/waapi/utils/accelerated-values\"\nimport { cancelFrame, frame } from \"../frameloop\"\nimport { microtask } from \"../frameloop/microtask\"\nimport { time } from \"../frameloop/sync-time\"\nimport type { MotionNodeOptions } from \"../node/types\"\nimport { createBox } from \"../projection/geometry/models\"\nimport { motionValue, MotionValue } from \"../value\"\nimport { complex } from \"../value/types/complex\"\nimport { getAnimatableNone } from \"../value/types/utils/animatable-none\"\nimport { findValueType } from \"../value/types/utils/find\"\nimport { isMotionValue } from \"../value/utils/is-motion-value\"\nimport { Feature } from \"./Feature\"\nimport { visualElementStore } from \"./store\"\nimport {\n FeatureDefinitions,\n MotionConfigContextProps,\n PresenceContextProps,\n ReducedMotionConfig,\n ResolvedValues,\n VisualElementEventCallbacks,\n VisualElementOptions,\n} from \"./types\"\nimport { AnimationState } from \"./utils/animation-state\"\nimport {\n isControllingVariants as checkIsControllingVariants,\n isVariantNode as checkIsVariantNode,\n} from \"./utils/is-controlling-variants\"\nimport { transformProps } from \"./utils/keys-transform\"\nimport { updateMotionValuesFromProps } from \"./utils/motion-values\"\nimport {\n hasReducedMotionListener,\n initPrefersReducedMotion,\n prefersReducedMotion,\n} from \"./utils/reduced-motion\"\nimport { resolveVariantFromProps } from \"./utils/resolve-variants\"\n\nconst propEventHandlers = [\n \"AnimationStart\",\n \"AnimationComplete\",\n \"Update\",\n \"BeforeLayoutMeasure\",\n \"LayoutMeasure\",\n \"LayoutAnimationStart\",\n \"LayoutAnimationComplete\",\n] as const\n\n/**\n * Static feature definitions - can be injected by framework layer\n */\nlet featureDefinitions: Partial = {}\n\n/**\n * Set feature definitions for all VisualElements.\n * This should be called by the framework layer (e.g., framer-motion) during initialization.\n */\nexport function setFeatureDefinitions(\n definitions: Partial\n) {\n featureDefinitions = definitions\n}\n\n/**\n * Get the current feature definitions\n */\nexport function getFeatureDefinitions(): Partial {\n return featureDefinitions\n}\n\n/**\n * Motion style type - a subset of CSS properties that can contain motion values\n */\nexport type MotionStyle = {\n [K: string]: AnyResolvedKeyframe | MotionValue | undefined\n}\n\n/**\n * A VisualElement is an imperative abstraction around UI elements such as\n * HTMLElement, SVGElement, Three.Object3D etc.\n */\nexport abstract class VisualElement<\n Instance = unknown,\n RenderState = unknown,\n Options extends {} = {}\n> {\n /**\n * VisualElements are arranged in trees mirroring that of the React tree.\n * Each type of VisualElement has a unique name, to detect when we're crossing\n * type boundaries within that tree.\n */\n abstract type: string\n\n /**\n * An `Array.sort` compatible function that will compare two Instances and\n * compare their respective positions within the tree.\n */\n abstract sortInstanceNodePosition(a: Instance, b: Instance): number\n\n /**\n * Measure the viewport-relative bounding box of the Instance.\n */\n abstract measureInstanceViewportBox(\n instance: Instance,\n props: MotionNodeOptions & Partial\n ): Box\n\n /**\n * When a value has been removed from all animation props we need to\n * pick a target to animate back to. For instance, for HTMLElements\n * we can look in the style prop.\n */\n abstract getBaseTargetFromProps(\n props: MotionNodeOptions,\n key: string\n ): AnyResolvedKeyframe | undefined | MotionValue\n\n /**\n * When we first animate to a value we need to animate it *from* a value.\n * Often this have been specified via the initial prop but it might be\n * that the value needs to be read from the Instance.\n */\n abstract readValueFromInstance(\n instance: Instance,\n key: string,\n options: Options\n ): AnyResolvedKeyframe | null | undefined\n\n /**\n * When a value has been removed from the VisualElement we use this to remove\n * it from the inherting class' unique render state.\n */\n abstract removeValueFromRenderState(\n key: string,\n renderState: RenderState\n ): void\n\n /**\n * Run before a React or VisualElement render, builds the latest motion\n * values into an Instance-specific format. For example, HTMLVisualElement\n * will use this step to build `style` and `var` values.\n */\n abstract build(\n renderState: RenderState,\n latestValues: ResolvedValues,\n props: MotionNodeOptions\n ): void\n\n /**\n * Apply the built values to the Instance. For example, HTMLElements will have\n * styles applied via `setProperty` and the style attribute, whereas SVGElements\n * will have values applied to attributes.\n */\n abstract renderInstance(\n instance: Instance,\n renderState: RenderState,\n styleProp?: MotionStyle,\n projection?: any\n ): void\n\n /**\n * This method is called when a transform property is bound to a motion value.\n * It's currently used to measure SVG elements when a new transform property is bound.\n */\n onBindTransform?(): void\n\n /**\n * If the component child is provided as a motion value, handle subscriptions\n * with the renderer-specific VisualElement.\n */\n handleChildMotionValue?(): void\n\n /**\n * This method takes React props and returns found MotionValues. For example, HTML\n * MotionValues will be found within the style prop, whereas for Three.js within attribute arrays.\n *\n * This isn't an abstract method as it needs calling in the constructor, but it is\n * intended to be one.\n */\n scrapeMotionValuesFromProps(\n _props: MotionNodeOptions,\n _prevProps: MotionNodeOptions,\n _visualElement: VisualElement\n ): {\n [key: string]: MotionValue | AnyResolvedKeyframe\n } {\n return {}\n }\n\n /**\n * A reference to the current underlying Instance, e.g. a HTMLElement\n * or Three.Mesh etc.\n */\n current: Instance | null = null\n\n /**\n * A reference to the parent VisualElement (if exists).\n */\n parent: VisualElement | undefined\n\n /**\n * A set containing references to this VisualElement's children.\n */\n children = new Set()\n\n /**\n * A set containing the latest children of this VisualElement. This is flushed\n * at the start of every commit. We use it to calculate the stagger delay\n * for newly-added children.\n */\n enteringChildren?: Set\n\n /**\n * The depth of this VisualElement within the overall VisualElement tree.\n */\n depth: number\n\n /**\n * The current render state of this VisualElement. Defined by inherting VisualElements.\n */\n renderState: RenderState\n\n /**\n * An object containing the latest static values for each of this VisualElement's\n * MotionValues.\n */\n latestValues: ResolvedValues\n\n /**\n * Determine what role this visual element should take in the variant tree.\n */\n isVariantNode: boolean = false\n isControllingVariants: boolean = false\n\n /**\n * If this component is part of the variant tree, it should track\n * any children that are also part of the tree. This is essentially\n * a shadow tree to simplify logic around how to stagger over children.\n */\n variantChildren?: Set\n\n /**\n * Decides whether this VisualElement should animate in reduced motion\n * mode.\n *\n * TODO: This is currently set on every individual VisualElement but feels\n * like it could be set globally.\n */\n shouldReduceMotion: boolean | null = null\n\n /**\n * Decides whether animations should be skipped for this VisualElement.\n * Useful for E2E tests and visual regression testing.\n */\n shouldSkipAnimations: boolean = false\n\n /**\n * Normally, if a component is controlled by a parent's variants, it can\n * rely on that ancestor to trigger animations further down the tree.\n * However, if a component is created after its parent is mounted, the parent\n * won't trigger that mount animation so the child needs to.\n *\n * TODO: This might be better replaced with a method isParentMounted\n */\n manuallyAnimateOnMount: boolean\n\n /**\n * This can be set by AnimatePresence to force components that mount\n * at the same time as it to mount as if they have initial={false} set.\n */\n blockInitialAnimation: boolean\n\n /**\n * A reference to this VisualElement's projection node, used in layout animations.\n */\n projection?: any\n\n /**\n * A map of all motion values attached to this visual element. Motion\n * values are source of truth for any given animated value. A motion\n * value might be provided externally by the component via props.\n */\n values = new Map()\n\n /**\n * The AnimationState, this is hydrated by the animation Feature.\n */\n animationState?: AnimationState\n\n KeyframeResolver = KeyframeResolver\n\n /**\n * The options used to create this VisualElement. The Options type is defined\n * by the inheriting VisualElement and is passed straight through to the render functions.\n */\n readonly options: Options\n\n /**\n * A reference to the latest props provided to the VisualElement's host React component.\n */\n props: MotionNodeOptions\n prevProps?: MotionNodeOptions\n\n presenceContext: PresenceContextProps | null\n prevPresenceContext?: PresenceContextProps | null\n\n /**\n * Cleanup functions for active features (hover/tap/exit etc)\n */\n private features: {\n [K in keyof FeatureDefinitions]?: Feature\n } = {}\n\n /**\n * A map of every subscription that binds the provided or generated\n * motion values onChange listeners to this visual element.\n */\n private valueSubscriptions = new Map()\n\n /**\n * A reference to the ReducedMotionConfig passed to the VisualElement's host React component.\n */\n private reducedMotionConfig: ReducedMotionConfig | undefined\n\n /**\n * A reference to the skipAnimations config passed to the VisualElement's host React component.\n */\n private skipAnimationsConfig: boolean | undefined\n\n /**\n * On mount, this will be hydrated with a callback to disconnect\n * this visual element from its parent on unmount.\n */\n private removeFromVariantTree: undefined | VoidFunction\n\n /**\n * A reference to the previously-provided motion values as returned\n * from scrapeMotionValuesFromProps. We use the keys in here to determine\n * if any motion values need to be removed after props are updated.\n */\n private prevMotionValues: MotionStyle = {}\n\n /**\n * When values are removed from all animation props we need to search\n * for a fallback value to animate to. These values are tracked in baseTarget.\n */\n private baseTarget: ResolvedValues\n\n /**\n * Create an object of the values we initially animated from (if initial prop present).\n */\n private initialValues: ResolvedValues\n\n /**\n * Track whether this element has been mounted before, to detect\n * remounts after Suspense unmount/remount cycles.\n */\n private hasBeenMounted = false\n\n /**\n * An object containing a SubscriptionManager for each active event.\n */\n private events: {\n [key: string]: SubscriptionManager\n } = {}\n\n /**\n * An object containing an unsubscribe function for each prop event subscription.\n * For example, every \"Update\" event can have multiple subscribers via\n * VisualElement.on(), but only one of those can be defined via the onUpdate prop.\n */\n private propEventSubscriptions: {\n [key: string]: VoidFunction\n } = {}\n\n constructor(\n {\n parent,\n props,\n presenceContext,\n reducedMotionConfig,\n skipAnimations,\n blockInitialAnimation,\n visualState,\n }: VisualElementOptions,\n options: Options = {} as any\n ) {\n const { latestValues, renderState } = visualState\n this.latestValues = latestValues\n this.baseTarget = { ...latestValues }\n this.initialValues = props.initial ? { ...latestValues } : {}\n this.renderState = renderState\n this.parent = parent\n this.props = props\n this.presenceContext = presenceContext\n this.depth = parent ? parent.depth + 1 : 0\n this.reducedMotionConfig = reducedMotionConfig\n this.skipAnimationsConfig = skipAnimations\n this.options = options\n this.blockInitialAnimation = Boolean(blockInitialAnimation)\n\n this.isControllingVariants = checkIsControllingVariants(props)\n this.isVariantNode = checkIsVariantNode(props)\n if (this.isVariantNode) {\n this.variantChildren = new Set()\n }\n\n this.manuallyAnimateOnMount = Boolean(parent && parent.current)\n\n /**\n * Any motion values that are provided to the element when created\n * aren't yet bound to the element, as this would technically be impure.\n * However, we iterate through the motion values and set them to the\n * initial values for this component.\n *\n * TODO: This is impure and we should look at changing this to run on mount.\n * Doing so will break some tests but this isn't necessarily a breaking change,\n * more a reflection of the test.\n */\n const { willChange, ...initialMotionValues } =\n this.scrapeMotionValuesFromProps(props, {}, this)\n\n for (const key in initialMotionValues) {\n const value = initialMotionValues[key]\n\n if (latestValues[key] !== undefined && isMotionValue(value)) {\n value.set(latestValues[key])\n }\n }\n }\n\n mount(instance: Instance) {\n /**\n * If this element has been mounted before (e.g. after a Suspense\n * unmount/remount), reset motion values to their initial state\n * so animations replay correctly from initial → animate.\n */\n if (this.hasBeenMounted) {\n for (const key in this.initialValues) {\n this.values.get(key)?.jump(this.initialValues[key])\n this.latestValues[key] = this.initialValues[key]\n }\n }\n\n this.current = instance\n\n visualElementStore.set(instance, this)\n\n if (this.projection && !this.projection.instance) {\n this.projection.mount(instance)\n }\n\n if (this.parent && this.isVariantNode && !this.isControllingVariants) {\n this.removeFromVariantTree = this.parent.addVariantChild(this)\n }\n\n this.values.forEach((value, key) => this.bindToMotionValue(key, value))\n\n /**\n * Determine reduced motion preference. Only initialize the matchMedia\n * listener if we actually need the dynamic value (i.e., when config\n * is neither \"never\" nor \"always\").\n */\n if (this.reducedMotionConfig === \"never\") {\n this.shouldReduceMotion = false\n } else if (this.reducedMotionConfig === \"always\") {\n this.shouldReduceMotion = true\n } else {\n if (!hasReducedMotionListener.current) {\n initPrefersReducedMotion()\n }\n this.shouldReduceMotion = prefersReducedMotion.current\n }\n\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(\n this.shouldReduceMotion !== true,\n \"You have Reduced Motion enabled on your device. Animations may not appear as expected.\",\n \"reduced-motion-disabled\"\n )\n }\n\n /**\n * Set whether animations should be skipped based on the config.\n */\n this.shouldSkipAnimations = this.skipAnimationsConfig ?? false\n\n this.parent?.addChild(this)\n\n this.update(this.props, this.presenceContext)\n\n this.hasBeenMounted = true\n }\n\n unmount() {\n this.projection && this.projection.unmount()\n cancelFrame(this.notifyUpdate)\n cancelFrame(this.render)\n this.valueSubscriptions.forEach((remove) => remove())\n this.valueSubscriptions.clear()\n this.removeFromVariantTree && this.removeFromVariantTree()\n this.parent?.removeChild(this)\n\n for (const key in this.events) {\n this.events[key].clear()\n }\n\n for (const key in this.features) {\n const feature = this.features[key as keyof typeof this.features]\n if (feature) {\n feature.unmount()\n feature.isMounted = false\n }\n }\n this.current = null\n }\n\n addChild(child: VisualElement) {\n this.children.add(child)\n this.enteringChildren ??= new Set()\n this.enteringChildren.add(child)\n }\n\n removeChild(child: VisualElement) {\n this.children.delete(child)\n this.enteringChildren && this.enteringChildren.delete(child)\n }\n\n private bindToMotionValue(key: string, value: MotionValue) {\n if (this.valueSubscriptions.has(key)) {\n this.valueSubscriptions.get(key)!()\n }\n\n if (\n value.accelerate &&\n acceleratedValues.has(key) &&\n this.current instanceof HTMLElement\n ) {\n const { factory, keyframes, times, ease, duration } =\n value.accelerate\n\n const animation = new NativeAnimation({\n element: this.current,\n name: key,\n keyframes,\n times,\n ease,\n duration: secondsToMilliseconds(duration),\n })\n\n const cleanup = factory(animation)\n\n this.valueSubscriptions.set(key, () => {\n cleanup()\n animation.cancel()\n })\n return\n }\n\n const valueIsTransform = transformProps.has(key)\n\n if (valueIsTransform && this.onBindTransform) {\n this.onBindTransform()\n }\n\n const removeOnChange = value.on(\n \"change\",\n (latestValue: AnyResolvedKeyframe) => {\n this.latestValues[key] = latestValue\n\n this.props.onUpdate && frame.preRender(this.notifyUpdate)\n\n if (valueIsTransform && this.projection) {\n this.projection.isTransformDirty = true\n }\n\n this.scheduleRender()\n }\n )\n\n let removeSyncCheck: VoidFunction | void\n if (\n typeof window !== \"undefined\" &&\n (window as any).MotionCheckAppearSync\n ) {\n removeSyncCheck = (window as any).MotionCheckAppearSync(\n this,\n key,\n value\n )\n }\n\n this.valueSubscriptions.set(key, () => {\n removeOnChange()\n if (removeSyncCheck) removeSyncCheck()\n // Defer to MotionValue.on(\"change\") auto-stop so React 19 remounts\n // can resubscribe before the animation is cancelled (#3315).\n })\n }\n\n sortNodePosition(other: VisualElement) {\n /**\n * If these nodes aren't even of the same type we can't compare their depth.\n */\n if (\n !this.current ||\n !this.sortInstanceNodePosition ||\n this.type !== other.type\n ) {\n return 0\n }\n\n return this.sortInstanceNodePosition(\n this.current as Instance,\n other.current as Instance\n )\n }\n\n updateFeatures() {\n let key: keyof typeof featureDefinitions = \"animation\"\n\n for (key in featureDefinitions) {\n const featureDefinition = featureDefinitions[key]\n\n if (!featureDefinition) continue\n\n const { isEnabled, Feature: FeatureConstructor } = featureDefinition\n\n /**\n * If this feature is enabled but not active, make a new instance.\n */\n if (\n !this.features[key] &&\n FeatureConstructor &&\n isEnabled(this.props)\n ) {\n this.features[key] = new FeatureConstructor(this) as any\n }\n\n /**\n * If we have a feature, mount or update it.\n */\n if (this.features[key]) {\n const feature = this.features[key]!\n if (feature.isMounted) {\n feature.update()\n } else {\n feature.mount()\n feature.isMounted = true\n }\n }\n }\n }\n\n notifyUpdate = () => this.notify(\"Update\", this.latestValues)\n\n triggerBuild() {\n this.build(this.renderState, this.latestValues, this.props)\n }\n\n render = () => {\n if (!this.current) return\n this.triggerBuild()\n this.renderInstance(\n this.current,\n this.renderState,\n (this.props as any).style,\n this.projection\n )\n }\n\n private renderScheduledAt = 0.0\n scheduleRender = () => {\n const now = time.now()\n if (this.renderScheduledAt < now) {\n this.renderScheduledAt = now\n frame.render(this.render, false, true)\n }\n }\n\n /**\n * Measure the current viewport box with or without transforms.\n * Only measures axis-aligned boxes, rotate and skew must be manually\n * removed with a re-render to work.\n */\n measureViewportBox() {\n return this.current\n ? this.measureInstanceViewportBox(this.current, this.props)\n : createBox()\n }\n\n getStaticValue(key: string) {\n return this.latestValues[key]\n }\n\n setStaticValue(key: string, value: AnyResolvedKeyframe) {\n this.latestValues[key] = value\n }\n\n /**\n * Update the provided props. Ensure any newly-added motion values are\n * added to our map, old ones removed, and listeners updated.\n */\n update(\n props: MotionNodeOptions,\n presenceContext: PresenceContextProps | null\n ) {\n if (props.transformTemplate || this.props.transformTemplate) {\n this.scheduleRender()\n }\n\n this.prevProps = this.props\n this.props = props\n\n this.prevPresenceContext = this.presenceContext\n this.presenceContext = presenceContext\n\n /**\n * Update prop event handlers ie onAnimationStart, onAnimationComplete\n */\n for (let i = 0; i < propEventHandlers.length; i++) {\n const key = propEventHandlers[i]\n if (this.propEventSubscriptions[key]) {\n this.propEventSubscriptions[key]()\n delete this.propEventSubscriptions[key]\n }\n\n const listenerName = (\"on\" + key) as keyof typeof props\n const listener = props[listenerName]\n if (listener) {\n this.propEventSubscriptions[key] = this.on(key as any, listener)\n }\n }\n\n this.prevMotionValues = updateMotionValuesFromProps(\n this,\n this.scrapeMotionValuesFromProps(props, this.prevProps || {}, this),\n this.prevMotionValues\n )\n\n if (this.handleChildMotionValue) {\n this.handleChildMotionValue()\n }\n }\n\n getProps() {\n return this.props\n }\n\n /**\n * Returns the variant definition with a given name.\n */\n getVariant(name: string) {\n return this.props.variants ? this.props.variants[name] : undefined\n }\n\n /**\n * Returns the defined default transition on this component.\n */\n getDefaultTransition() {\n return this.props.transition\n }\n\n getTransformPagePoint() {\n return (this.props as any).transformPagePoint\n }\n\n getClosestVariantNode(): VisualElement | undefined {\n return this.isVariantNode\n ? this\n : this.parent\n ? this.parent.getClosestVariantNode()\n : undefined\n }\n\n /**\n * Add a child visual element to our set of children.\n */\n addVariantChild(child: VisualElement) {\n const closestVariantNode = this.getClosestVariantNode()\n if (closestVariantNode) {\n closestVariantNode.variantChildren &&\n closestVariantNode.variantChildren.add(child)\n return () => closestVariantNode.variantChildren!.delete(child)\n }\n }\n\n /**\n * Add a motion value and bind it to this visual element.\n */\n addValue(key: string, value: MotionValue) {\n // Remove existing value if it exists\n const existingValue = this.values.get(key)\n\n if (value !== existingValue) {\n if (existingValue) this.removeValue(key)\n this.bindToMotionValue(key, value)\n this.values.set(key, value)\n this.latestValues[key] = value.get()\n }\n }\n\n /**\n * Remove a motion value and unbind any active subscriptions.\n */\n removeValue(key: string) {\n this.values.delete(key)\n const unsubscribe = this.valueSubscriptions.get(key)\n if (unsubscribe) {\n unsubscribe()\n this.valueSubscriptions.delete(key)\n }\n delete this.latestValues[key]\n this.removeValueFromRenderState(key, this.renderState)\n }\n\n /**\n * Check whether we have a motion value for this key\n */\n hasValue(key: string) {\n return this.values.has(key)\n }\n\n /**\n * Get a motion value for this key. If called with a default\n * value, we'll create one if none exists.\n */\n getValue(key: string): MotionValue | undefined\n getValue(key: string, defaultValue: AnyResolvedKeyframe | null): MotionValue\n getValue(\n key: string,\n defaultValue?: AnyResolvedKeyframe | null\n ): MotionValue | undefined {\n if (this.props.values && this.props.values[key]) {\n return this.props.values[key]\n }\n\n let value = this.values.get(key)\n\n if (value === undefined && defaultValue !== undefined) {\n value = motionValue(\n defaultValue === null ? undefined : defaultValue,\n { owner: this }\n )\n this.addValue(key, value)\n }\n\n return value\n }\n\n /**\n * If we're trying to animate to a previously unencountered value,\n * we need to check for it in our state and as a last resort read it\n * directly from the instance (which might have performance implications).\n */\n readValue(key: string, target?: AnyResolvedKeyframe | null) {\n let value =\n this.latestValues[key] !== undefined || !this.current\n ? this.latestValues[key]\n : this.getBaseTargetFromProps(this.props, key) ??\n this.readValueFromInstance(this.current, key, this.options)\n\n if (value !== undefined && value !== null) {\n if (\n typeof value === \"string\" &&\n (isNumericalString(value) || isZeroValueString(value))\n ) {\n // If this is a number read as a string, ie \"0\" or \"200\", convert it to a number\n value = parseFloat(value)\n } else if (!findValueType(value) && complex.test(target)) {\n value = getAnimatableNone(key, target as string)\n }\n\n this.setBaseTarget(key, isMotionValue(value) ? value.get() : value)\n }\n\n return isMotionValue(value) ? value.get() : value\n }\n\n /**\n * Set the base target to later animate back to. This is currently\n * only hydrated on creation and when we first read a value.\n */\n setBaseTarget(key: string, value: AnyResolvedKeyframe) {\n this.baseTarget[key] = value\n }\n\n /**\n * Find the base target for a value thats been removed from all animation\n * props.\n */\n getBaseTarget(key: string): ResolvedValues[string] | undefined | null {\n const { initial } = this.props\n\n let valueFromInitial: ResolvedValues[string] | undefined | null\n\n if (typeof initial === \"string\" || typeof initial === \"object\") {\n const variant = resolveVariantFromProps(\n this.props,\n initial as any,\n this.presenceContext?.custom\n )\n if (variant) {\n valueFromInitial = variant[\n key as keyof typeof variant\n ] as string\n }\n }\n\n /**\n * If this value still exists in the current initial variant, read that.\n */\n if (initial && valueFromInitial !== undefined) {\n return valueFromInitial\n }\n\n /**\n * Alternatively, if this VisualElement config has defined a getBaseTarget\n * so we can read the value from an alternative source, try that.\n */\n const target = this.getBaseTargetFromProps(this.props, key)\n if (target !== undefined && !isMotionValue(target)) return target\n\n /**\n * If the value was initially defined on initial, but it doesn't any more,\n * return undefined. Otherwise return the value as initially read from the DOM.\n */\n return this.initialValues[key] !== undefined &&\n valueFromInitial === undefined\n ? undefined\n : this.baseTarget[key]\n }\n\n on(\n eventName: EventName,\n callback: VisualElementEventCallbacks[EventName]\n ) {\n if (!this.events[eventName]) {\n this.events[eventName] = new SubscriptionManager()\n }\n\n return this.events[eventName].add(callback)\n }\n\n notify(\n eventName: EventName,\n ...args: any\n ) {\n if (this.events[eventName]) {\n this.events[eventName].notify(...args)\n }\n }\n\n scheduleRenderMicrotask() {\n microtask.render(this.render)\n }\n}\n","import { isMotionValue } from \"../../value/utils/is-motion-value\"\nimport type { MotionValue } from \"../../value\"\nimport type { AnyResolvedKeyframe } from \"../../animation/types\"\nimport { DOMKeyframesResolver } from \"../../animation/keyframes/DOMKeyframesResolver\"\nimport type { MotionNodeOptions } from \"../../node/types\"\nimport type { DOMVisualElementOptions } from \"./types\"\nimport type { HTMLRenderState } from \"../html/types\"\nimport { VisualElement, MotionStyle } from \"../VisualElement\"\n\nexport abstract class DOMVisualElement<\n Instance extends HTMLElement | SVGElement = HTMLElement,\n State extends HTMLRenderState = HTMLRenderState,\n Options extends DOMVisualElementOptions = DOMVisualElementOptions\n> extends VisualElement {\n sortInstanceNodePosition(a: Instance, b: Instance): number {\n /**\n * compareDocumentPosition returns a bitmask, by using the bitwise &\n * we're returning true if 2 in that bitmask is set to true. 2 is set\n * to true if b preceeds a.\n */\n return a.compareDocumentPosition(b) & 2 ? 1 : -1\n }\n\n getBaseTargetFromProps(\n props: MotionNodeOptions,\n key: string\n ): AnyResolvedKeyframe | MotionValue | undefined {\n const style = (props as MotionNodeOptions & { style?: MotionStyle }).style\n return style ? (style[key] as string) : undefined\n }\n\n removeValueFromRenderState(\n key: string,\n { vars, style }: HTMLRenderState\n ): void {\n delete vars[key]\n delete style[key]\n }\n\n KeyframeResolver = DOMKeyframesResolver\n\n childSubscription?: VoidFunction\n handleChildMotionValue() {\n if (this.childSubscription) {\n this.childSubscription()\n delete this.childSubscription\n }\n\n const { children } = this.props as MotionNodeOptions & { children?: MotionValue | any }\n if (isMotionValue(children)) {\n this.childSubscription = children.on(\"change\", (latest) => {\n if (this.current) {\n this.current.textContent = `${latest}`\n }\n })\n }\n }\n}\n","import type { VisualElement } from \"./VisualElement\"\n\n/**\n * Feature base class for extending VisualElement functionality.\n * Features are plugins that can be mounted/unmounted to add behavior\n * like gestures, animations, or layout tracking.\n */\nexport abstract class Feature {\n isMounted = false\n\n node: VisualElement\n\n constructor(node: VisualElement) {\n this.node = node\n }\n\n abstract mount(): void\n\n abstract unmount(): void\n\n update(): void {}\n}\n","import { BoundingBox, Box, TransformPoint } from \"motion-utils\"\n\n/**\n * Bounding boxes tend to be defined as top, left, right, bottom. For various operations\n * it's easier to consider each axis individually. This function returns a bounding box\n * as a map of single-axis min/max values.\n */\nexport function convertBoundingBoxToBox({\n top,\n left,\n right,\n bottom,\n}: BoundingBox): Box {\n return {\n x: { min: left, max: right },\n y: { min: top, max: bottom },\n }\n}\n\nexport function convertBoxToBoundingBox({ x, y }: Box): BoundingBox {\n return { top: y.min, right: x.max, bottom: y.max, left: x.min }\n}\n\n/**\n * Applies a TransformPoint function to a bounding box. TransformPoint is usually a function\n * provided by Framer to allow measured points to be corrected for device scaling. This is used\n * when measuring DOM elements and DOM event points.\n */\nexport function transformBoxPoints(\n point: BoundingBox,\n transformPoint?: TransformPoint\n) {\n if (!transformPoint) return point\n const topLeft = transformPoint({ x: point.left, y: point.top })\n const bottomRight = transformPoint({ x: point.right, y: point.bottom })\n\n return {\n top: topLeft.y,\n left: topLeft.x,\n bottom: bottomRight.y,\n right: bottomRight.x,\n }\n}\n","import { type AnyResolvedKeyframe } from \"../../animation/types\"\nimport { ResolvedValues } from \"../../render/types\"\n\nfunction isIdentityScale(scale: AnyResolvedKeyframe | undefined) {\n return scale === undefined || scale === 1\n}\n\nexport function hasScale({ scale, scaleX, scaleY }: ResolvedValues) {\n return (\n !isIdentityScale(scale) ||\n !isIdentityScale(scaleX) ||\n !isIdentityScale(scaleY)\n )\n}\n\nexport function hasTransform(values: ResolvedValues) {\n return (\n hasScale(values) ||\n has2DTranslate(values) ||\n values.z ||\n values.rotate ||\n values.rotateX ||\n values.rotateY ||\n values.skewX ||\n values.skewY\n )\n}\n\nexport function has2DTranslate(values: ResolvedValues) {\n return is2DTranslate(values.x) || is2DTranslate(values.y)\n}\n\nfunction is2DTranslate(value: AnyResolvedKeyframe | undefined) {\n return value && value !== \"0%\"\n}\n","import { Axis, Box, Delta, Point } from \"motion-utils\"\nimport { mixNumber } from \"../../utils/mix/number\"\nimport { ResolvedValues } from \"../../render/types\"\nimport { hasTransform } from \"../utils/has-transform\"\n\n/**\n * Scales a point based on a factor and an originPoint\n */\nexport function scalePoint(point: number, scale: number, originPoint: number) {\n const distanceFromOrigin = point - originPoint\n const scaled = scale * distanceFromOrigin\n return originPoint + scaled\n}\n\n/**\n * Applies a translate/scale delta to a point\n */\nexport function applyPointDelta(\n point: number,\n translate: number,\n scale: number,\n originPoint: number,\n boxScale?: number\n): number {\n if (boxScale !== undefined) {\n point = scalePoint(point, boxScale, originPoint)\n }\n\n return scalePoint(point, scale, originPoint) + translate\n}\n\n/**\n * Applies a translate/scale delta to an axis\n */\nexport function applyAxisDelta(\n axis: Axis,\n translate: number = 0,\n scale: number = 1,\n originPoint: number,\n boxScale?: number\n): void {\n axis.min = applyPointDelta(\n axis.min,\n translate,\n scale,\n originPoint,\n boxScale\n )\n\n axis.max = applyPointDelta(\n axis.max,\n translate,\n scale,\n originPoint,\n boxScale\n )\n}\n\n/**\n * Applies a translate/scale delta to a box\n */\nexport function applyBoxDelta(box: Box, { x, y }: Delta): void {\n applyAxisDelta(box.x, x.translate, x.scale, x.originPoint)\n applyAxisDelta(box.y, y.translate, y.scale, y.originPoint)\n}\n\nconst TREE_SCALE_SNAP_MIN = 0.999999999999\nconst TREE_SCALE_SNAP_MAX = 1.0000000000001\n\n/**\n * Apply a tree of deltas to a box. We do this to calculate the effect of all the transforms\n * in a tree upon our box before then calculating how to project it into our desired viewport-relative box\n *\n * This is the final nested loop within updateLayoutDelta for future refactoring\n */\nexport function applyTreeDeltas(\n box: Box,\n treeScale: Point,\n treePath: any[],\n isSharedTransition: boolean = false\n) {\n const treeLength = treePath.length\n if (!treeLength) return\n\n // Reset the treeScale\n treeScale.x = treeScale.y = 1\n\n let node: any\n let delta: Delta | undefined\n\n for (let i = 0; i < treeLength; i++) {\n node = treePath[i]\n delta = node.projectionDelta\n\n /**\n * TODO: Prefer to remove this, but currently we have motion components with\n * display: contents in Framer.\n */\n const { visualElement } = node.options\n if (\n visualElement &&\n visualElement.props.style &&\n visualElement.props.style.display === \"contents\"\n ) {\n continue\n }\n\n if (\n isSharedTransition &&\n node.options.layoutScroll &&\n node.scroll &&\n node !== node.root\n ) {\n translateAxis(box.x, -node.scroll.offset.x)\n translateAxis(box.y, -node.scroll.offset.y)\n }\n\n if (delta) {\n // Incoporate each ancestor's scale into a cumulative treeScale for this component\n treeScale.x *= delta.x.scale\n treeScale.y *= delta.y.scale\n\n // Apply each ancestor's calculated delta into this component's recorded layout box\n applyBoxDelta(box, delta)\n }\n\n if (isSharedTransition && hasTransform(node.latestValues)) {\n transformBox(box, node.latestValues, node.layout?.layoutBox)\n }\n }\n\n /**\n * Snap tree scale back to 1 if it's within a non-perceivable threshold.\n * This will help reduce useless scales getting rendered.\n */\n if (\n treeScale.x < TREE_SCALE_SNAP_MAX &&\n treeScale.x > TREE_SCALE_SNAP_MIN\n ) {\n treeScale.x = 1.0\n }\n if (\n treeScale.y < TREE_SCALE_SNAP_MAX &&\n treeScale.y > TREE_SCALE_SNAP_MIN\n ) {\n treeScale.y = 1.0\n }\n}\n\nexport function translateAxis(axis: Axis, distance: number) {\n axis.min += distance\n axis.max += distance\n}\n\n/**\n * Apply a transform to an axis from the latest resolved motion values.\n * This function basically acts as a bridge between a flat motion value map\n * and applyAxisDelta\n */\nexport function transformAxis(\n axis: Axis,\n axisTranslate?: number,\n axisScale?: number,\n boxScale?: number,\n axisOrigin: number = 0.5\n): void {\n const originPoint = mixNumber(axis.min, axis.max, axisOrigin)\n\n // Apply the axis delta to the final axis\n applyAxisDelta(axis, axisTranslate, axisScale, originPoint, boxScale)\n}\n\nfunction resolveAxisTranslate(\n value: number | string | undefined,\n axis: Axis\n): number | undefined {\n if (typeof value === \"string\") {\n return (parseFloat(value) / 100) * (axis.max - axis.min)\n }\n return value as number | undefined\n}\n\n/**\n * Apply a transform to a box from the latest resolved motion values.\n */\nexport function transformBox(\n box: Box,\n transform: ResolvedValues,\n sourceBox?: Box\n) {\n const resolveBox = sourceBox ?? box\n transformAxis(\n box.x,\n resolveAxisTranslate(transform.x, resolveBox.x),\n transform.scaleX as number,\n transform.scale as number,\n transform.originX as number\n )\n transformAxis(\n box.y,\n resolveAxisTranslate(transform.y, resolveBox.y),\n transform.scaleY as number,\n transform.scale as number,\n transform.originY as number\n )\n}\n","import { TransformPoint } from \"motion-utils\"\nimport {\n convertBoundingBoxToBox,\n transformBoxPoints,\n} from \"../geometry/conversion\"\nimport { translateAxis } from \"../geometry/delta-apply\"\n\nexport function measureViewportBox(\n instance: HTMLElement,\n transformPoint?: TransformPoint\n) {\n return convertBoundingBoxToBox(\n transformBoxPoints(instance.getBoundingClientRect(), transformPoint)\n )\n}\n\nexport function measurePageBox(\n element: HTMLElement,\n rootProjectionNode: any,\n transformPagePoint?: TransformPoint\n) {\n const viewportBox = measureViewportBox(element, transformPagePoint)\n const { scroll } = rootProjectionNode\n\n if (scroll) {\n translateAxis(viewportBox.x, scroll.offset.x)\n translateAxis(viewportBox.y, scroll.offset.y)\n }\n\n return viewportBox\n}\n","import { getValueAsType } from \"../../../value/types/utils/get-as-type\"\nimport { numberValueTypes } from \"../../../value/types/maps/number\"\nimport { transformPropOrder } from \"../../utils/keys-transform\"\nimport { ResolvedValues } from \"../../types\"\nimport { HTMLRenderState } from \"../types\"\nimport type { MotionNodeOptions } from \"../../../node/types\"\n\nconst translateAlias = {\n x: \"translateX\",\n y: \"translateY\",\n z: \"translateZ\",\n transformPerspective: \"perspective\",\n}\n\nconst numTransforms = transformPropOrder.length\n\n/**\n * Build a CSS transform style from individual x/y/scale etc properties.\n *\n * This outputs with a default order of transforms/scales/rotations, this can be customised by\n * providing a transformTemplate function.\n */\nexport function buildTransform(\n latestValues: ResolvedValues,\n transform: HTMLRenderState[\"transform\"],\n transformTemplate?: MotionNodeOptions[\"transformTemplate\"]\n) {\n // The transform string we're going to build into.\n let transformString = \"\"\n let transformIsDefault = true\n\n /**\n * Loop over all possible transforms in order, adding the ones that\n * are present to the transform string.\n */\n for (let i = 0; i < numTransforms; i++) {\n const key = transformPropOrder[i] as keyof typeof translateAlias\n const value = latestValues[key]\n\n if (value === undefined) continue\n\n let valueIsDefault = true\n if (typeof value === \"number\") {\n valueIsDefault = value === (key.startsWith(\"scale\") ? 1 : 0)\n } else {\n const parsed = parseFloat(value)\n valueIsDefault = key.startsWith(\"scale\") ? parsed === 1 : parsed === 0\n }\n\n if (!valueIsDefault || transformTemplate) {\n const valueAsType = getValueAsType(value, numberValueTypes[key])\n\n if (!valueIsDefault) {\n transformIsDefault = false\n const transformName = translateAlias[key] || key\n transformString += `${transformName}(${valueAsType}) `\n }\n\n if (transformTemplate) {\n transform[key] = valueAsType\n }\n }\n }\n\n // `pathRotation` composes onto `rotate` as a separate additive term so\n // the user's `rotate` is never clobbered. Deliberately not a slot in\n // `transformPropOrder`.\n const pathRotation = latestValues.pathRotation\n if (pathRotation) {\n transformIsDefault = false\n transformString += `rotate(${getValueAsType(\n pathRotation,\n numberValueTypes.pathRotation\n )}) `\n }\n\n transformString = transformString.trim()\n\n // If we have a custom `transform` template, pass our transform values and\n // generated transformString to that before returning\n if (transformTemplate) {\n transformString = transformTemplate(\n transform,\n transformIsDefault ? \"\" : transformString\n )\n } else if (transformIsDefault) {\n transformString = \"none\"\n }\n\n return transformString\n}\n","import { getValueAsType } from \"../../../value/types/utils/get-as-type\"\nimport { numberValueTypes } from \"../../../value/types/maps/number\"\nimport { transformProps } from \"../../utils/keys-transform\"\nimport { isCSSVariableName } from \"../../../animation/utils/is-css-variable\"\nimport { ResolvedValues } from \"../../types\"\nimport { HTMLRenderState } from \"../types\"\nimport { buildTransform } from \"./build-transform\"\nimport type { MotionNodeOptions } from \"../../../node/types\"\n\nexport function buildHTMLStyles(\n state: HTMLRenderState,\n latestValues: ResolvedValues,\n transformTemplate?: MotionNodeOptions[\"transformTemplate\"]\n) {\n const { style, vars, transformOrigin } = state\n\n // Track whether we encounter any transform or transformOrigin values.\n let hasTransform = false\n let hasTransformOrigin = false\n\n /**\n * Loop over all our latest animated values and decide whether to handle them\n * as a style or CSS variable.\n *\n * Transforms and transform origins are kept separately for further processing.\n */\n for (const key in latestValues) {\n const value = latestValues[key]\n\n if (transformProps.has(key)) {\n // If this is a transform, flag to enable further transform processing\n hasTransform = true\n continue\n } else if (isCSSVariableName(key)) {\n vars[key] = value\n continue\n } else {\n // Convert the value to its default value type, ie 0 -> \"0px\"\n const valueAsType = getValueAsType(value, numberValueTypes[key])\n\n if (key.startsWith(\"origin\")) {\n // If this is a transform origin, flag and enable further transform-origin processing\n hasTransformOrigin = true\n transformOrigin[key as keyof typeof transformOrigin] =\n valueAsType\n } else {\n style[key] = valueAsType\n }\n }\n }\n\n if (!latestValues.transform) {\n if (hasTransform || transformTemplate) {\n style.transform = buildTransform(\n latestValues,\n state.transform,\n transformTemplate\n )\n } else if (style.transform) {\n /**\n * If we have previously created a transform but currently don't have any,\n * reset transform style to none.\n */\n style.transform = \"none\"\n }\n }\n\n /**\n * Build a transformOrigin style. Uses the same defaults as the browser for\n * undefined origins.\n */\n if (hasTransformOrigin) {\n const {\n originX = \"50%\",\n originY = \"50%\",\n originZ = 0,\n } = transformOrigin\n style.transformOrigin = `${originX} ${originY} ${originZ}`\n }\n}\n","import type { MotionStyle } from \"../../VisualElement\"\nimport { HTMLRenderState } from \"../types\"\n\nexport function renderHTML(\n element: HTMLElement,\n { style, vars }: HTMLRenderState,\n styleProp?: MotionStyle,\n projection?: any\n) {\n const elementStyle = element.style\n\n let key: string\n for (key in style) {\n // CSSStyleDeclaration has [index: number]: string; in the types, so we use that as key type.\n elementStyle[key as unknown as number] = style[key] as string\n }\n\n // Write projection styles directly to element style\n projection?.applyProjectionStyles(elementStyle, styleProp)\n\n for (key in vars) {\n // Loop over any CSS variables and assign those.\n // They can only be assigned using `setProperty`.\n elementStyle.setProperty(key, vars[key] as string)\n }\n}\n","import { px } from \"../../value/types/numbers/units\"\nimport type { Axis } from \"motion-utils\"\nimport type { ScaleCorrectorDefinition } from \"./types\"\n\nexport function pixelsToPercent(pixels: number, axis: Axis): number {\n if (axis.max === axis.min) return 0\n return (pixels / (axis.max - axis.min)) * 100\n}\n\n/**\n * We always correct borderRadius as a percentage rather than pixels to reduce paints.\n * For example, if you are projecting a box that is 100px wide with a 10px borderRadius\n * into a box that is 200px wide with a 20px borderRadius, that is actually a 10%\n * borderRadius in both states. If we animate between the two in pixels that will trigger\n * a paint each time. If we animate between the two in percentage we'll avoid a paint.\n */\nexport const correctBorderRadius: ScaleCorrectorDefinition = {\n correct: (latest, node) => {\n if (!node.target) return latest\n\n /**\n * If latest is a string, if it's a percentage we can return immediately as it's\n * going to be stretched appropriately. Otherwise, if it's a pixel, convert it to a number.\n */\n if (typeof latest === \"string\") {\n if (px.test(latest)) {\n latest = parseFloat(latest)\n } else {\n return latest\n }\n }\n\n /**\n * If latest is a number, it's a pixel value. We use the current viewportBox to calculate that\n * pixel value as a percentage of each axis\n */\n const x = pixelsToPercent(latest, node.target.x)\n const y = pixelsToPercent(latest, node.target.y)\n\n return `${x}% ${y}%`\n },\n}\n","import { complex } from \"../../value/types/complex\"\nimport { mixNumber } from \"../../utils/mix/number\"\nimport type { ScaleCorrectorDefinition } from \"./types\"\n\nexport const correctBoxShadow: ScaleCorrectorDefinition = {\n correct: (latest: string, { treeScale, projectionDelta }) => {\n const original = latest\n const shadow = complex.parse(latest)\n\n // TODO: Doesn't support multiple shadows\n if (shadow.length > 5) return original\n\n const template = complex.createTransformer(latest)\n const offset = typeof shadow[0] !== \"number\" ? 1 : 0\n\n // Calculate the overall context scale\n const xScale = projectionDelta!.x.scale * treeScale!.x\n const yScale = projectionDelta!.y.scale * treeScale!.y\n\n // Scale x/y\n ;(shadow[0 + offset] as number) /= xScale\n ;(shadow[1 + offset] as number) /= yScale\n\n /**\n * Ideally we'd correct x and y scales individually, but because blur and\n * spread apply to both we have to take a scale average and apply that instead.\n * We could potentially improve the outcome of this by incorporating the ratio between\n * the two scales.\n */\n const averageScale = mixNumber(xScale, yScale, 0.5)\n\n // Blur\n if (typeof shadow[2 + offset] === \"number\")\n (shadow[2 + offset] as number) /= averageScale\n\n // Spread\n if (typeof shadow[3 + offset] === \"number\")\n (shadow[3 + offset] as number) /= averageScale\n\n return template(shadow)\n },\n}\n","import { isCSSVariableName } from \"../../animation/utils/is-css-variable\"\nimport { cornerRadiusProps } from \"../../utils/border-radius\"\nimport { correctBorderRadius } from \"./scale-border-radius\"\nimport { correctBoxShadow } from \"./scale-box-shadow\"\nimport type { ScaleCorrectorMap } from \"./types\"\n\nexport const scaleCorrectors: ScaleCorrectorMap = {\n borderRadius: {\n ...correctBorderRadius,\n applyTo: [...cornerRadiusProps],\n },\n borderTopLeftRadius: correctBorderRadius,\n borderTopRightRadius: correctBorderRadius,\n borderBottomLeftRadius: correctBorderRadius,\n borderBottomRightRadius: correctBorderRadius,\n boxShadow: correctBoxShadow,\n}\n\nexport function addScaleCorrector(correctors: ScaleCorrectorMap) {\n for (const key in correctors) {\n scaleCorrectors[key] = correctors[key]\n if (isCSSVariableName(key)) {\n scaleCorrectors[key].isCSSVariable = true\n }\n }\n}\n","import { transformProps } from \"./keys-transform\"\nimport type { MotionNodeOptions } from \"../../node/types\"\nimport {\n scaleCorrectors,\n addScaleCorrector,\n} from \"../../projection/styles/scale-correction\"\n\nexport { scaleCorrectors, addScaleCorrector }\n\nexport function isForcedMotionValue(\n key: string,\n { layout, layoutId }: MotionNodeOptions\n) {\n return (\n transformProps.has(key) ||\n key.startsWith(\"origin\") ||\n ((layout || layoutId !== undefined) &&\n (!!scaleCorrectors[key] || key === \"opacity\"))\n )\n}\n","import { isMotionValue } from \"../../../value/utils/is-motion-value\"\nimport type { MotionNodeOptions } from \"../../../node/types\"\nimport { isForcedMotionValue } from \"../../utils/is-forced-motion-value\"\nimport type { VisualElement } from \"../../VisualElement\"\n\nexport function scrapeMotionValuesFromProps(\n props: MotionNodeOptions,\n prevProps: MotionNodeOptions,\n visualElement?: VisualElement\n) {\n const style = (props as any).style\n const prevStyle = (prevProps as any)?.style\n const newValues: { [key: string]: any } = {}\n\n if (!style) return newValues\n\n for (const key in style) {\n if (\n isMotionValue(style[key]) ||\n (prevStyle && isMotionValue(prevStyle[key])) ||\n isForcedMotionValue(key, props) ||\n visualElement?.getValue(key)?.liveStyle !== undefined\n ) {\n newValues[key] = style[key]\n }\n }\n\n return newValues\n}\n","import { invariant, type Box } from \"motion-utils\"\nimport type { AnyResolvedKeyframe } from \"../../animation/types\"\nimport { isCSSVariableName } from \"../../animation/utils/is-css-variable\"\nimport type { MotionNodeOptions } from \"../../node/types\"\nimport { transformProps } from \"../utils/keys-transform\"\nimport {\n defaultTransformValue,\n readTransformValue,\n} from \"../dom/parse-transform\"\nimport { measureViewportBox } from \"../../projection/utils/measure\"\nimport { DOMVisualElement } from \"../dom/DOMVisualElement\"\nimport type { DOMVisualElementOptions } from \"../dom/types\"\nimport type { ResolvedValues, MotionConfigContextProps } from \"../types\"\nimport type { VisualElement } from \"../VisualElement\"\nimport { HTMLRenderState } from \"./types\"\nimport { buildHTMLStyles } from \"./utils/build-styles\"\nimport { renderHTML } from \"./utils/render\"\nimport { scrapeMotionValuesFromProps } from \"./utils/scrape-motion-values\"\n\nexport function getComputedStyle(element: HTMLElement) {\n return window.getComputedStyle(element)\n}\n\nexport class HTMLVisualElement extends DOMVisualElement<\n HTMLElement,\n HTMLRenderState,\n DOMVisualElementOptions\n> {\n type = \"html\"\n\n mount(instance: HTMLElement) {\n /**\n * If a custom component forwards its ref to something other than a\n * HTML/SVG element (a class instance, an imperative handle) there's\n * nothing for Motion to style, measure or attach gestures to. #2777\n */\n invariant(\n Boolean(instance.style),\n \"motion.create() components must forward their ref to a HTML or SVG element\",\n \"custom-component-ref\"\n )\n\n super.mount(instance)\n }\n\n readValueFromInstance(\n instance: HTMLElement,\n key: string\n ): AnyResolvedKeyframe | null | undefined {\n if (transformProps.has(key)) {\n return this.projection?.isProjecting\n ? defaultTransformValue(key)\n : readTransformValue(instance, key)\n } else {\n const computedStyle = getComputedStyle(instance)\n const value =\n (isCSSVariableName(key)\n ? computedStyle.getPropertyValue(key)\n : computedStyle[key as keyof typeof computedStyle]) || 0\n\n return typeof value === \"string\" ? value.trim() : (value as number)\n }\n }\n\n measureInstanceViewportBox(\n instance: HTMLElement,\n { transformPagePoint }: MotionNodeOptions & Partial\n ): Box {\n return measureViewportBox(instance, transformPagePoint)\n }\n\n build(\n renderState: HTMLRenderState,\n latestValues: ResolvedValues,\n props: MotionNodeOptions\n ) {\n buildHTMLStyles(renderState, latestValues, props.transformTemplate)\n }\n\n scrapeMotionValuesFromProps(\n props: MotionNodeOptions,\n prevProps: MotionNodeOptions,\n visualElement: VisualElement\n ) {\n return scrapeMotionValuesFromProps(props, prevProps, visualElement)\n }\n\n renderInstance = renderHTML\n}\n","import { createBox } from \"../../projection/geometry/models\"\nimport { ResolvedValues } from \"../types\"\nimport { VisualElement } from \"../VisualElement\"\n\ninterface ObjectRenderState {\n output: ResolvedValues\n}\n\nfunction isObjectKey(key: string, object: Object): key is keyof Object {\n return key in object\n}\n\nexport class ObjectVisualElement extends VisualElement<\n Object,\n ObjectRenderState\n> {\n type = \"object\"\n\n readValueFromInstance(instance: Object, key: string) {\n if (isObjectKey(key, instance)) {\n const value = instance[key]\n if (typeof value === \"string\" || typeof value === \"number\") {\n return value\n }\n }\n\n return undefined\n }\n\n getBaseTargetFromProps() {\n return undefined\n }\n\n removeValueFromRenderState(\n key: string,\n renderState: ObjectRenderState\n ): void {\n delete renderState.output[key]\n }\n\n measureInstanceViewportBox() {\n return createBox()\n }\n\n build(renderState: ObjectRenderState, latestValues: ResolvedValues) {\n Object.assign(renderState.output, latestValues)\n }\n\n renderInstance(instance: Object, { output }: ObjectRenderState) {\n Object.assign(instance, output)\n }\n\n sortInstanceNodePosition() {\n return 0\n }\n}\n","import { ResolvedValues } from \"../../types\"\n\nconst dashKeys = {\n offset: \"stroke-dashoffset\",\n array: \"stroke-dasharray\",\n}\n\nconst camelKeys = {\n offset: \"strokeDashoffset\",\n array: \"strokeDasharray\",\n}\n\n/**\n * Build SVG path properties. Uses the path's measured length to convert\n * our custom pathLength, pathSpacing and pathOffset into stroke-dashoffset\n * and stroke-dasharray attributes.\n *\n * This function is mutative to reduce per-frame GC.\n *\n * Note: We use unitless values for stroke-dasharray and stroke-dashoffset\n * because Safari incorrectly scales px values when the page is zoomed.\n */\nexport function buildSVGPath(\n attrs: ResolvedValues,\n length: number,\n spacing = 1,\n offset = 0,\n useDashCase: boolean = true\n): void {\n // Normalise path length by setting SVG attribute pathLength to 1\n attrs.pathLength = 1\n\n // We use dash case when setting attributes directly to the DOM node and camel case\n // when defining props on a React component.\n const keys = useDashCase ? dashKeys : camelKeys\n\n // Build the dash offset (unitless to avoid Safari zoom bug)\n attrs[keys.offset] = `${-offset}`\n\n // Build the dash array (unitless to avoid Safari zoom bug)\n attrs[keys.array] = `${length} ${spacing}`\n}\n","import type { MotionNodeOptions } from \"../../../node/types\"\nimport { buildHTMLStyles } from \"../../html/utils/build-styles\"\nimport { ResolvedValues } from \"../../types\"\nimport { SVGRenderState } from \"../types\"\nimport { buildSVGPath } from \"./path\"\n\nexport const cssStyleProperties = [\n \"transform\",\n \"opacity\",\n \"offsetDistance\",\n \"offsetPath\",\n \"offsetRotate\",\n \"offsetAnchor\",\n]\n\n/**\n * Build SVG visual attributes, like cx and style.transform\n */\nexport function buildSVGAttrs(\n state: SVGRenderState,\n {\n attrX,\n attrY,\n attrScale,\n pathLength,\n pathSpacing = 1,\n pathOffset = 0,\n // This is object creation, which we try to avoid per-frame.\n ...latest\n }: ResolvedValues,\n isSVGTag: boolean,\n transformTemplate?: MotionNodeOptions[\"transformTemplate\"],\n styleProp?: Record\n) {\n buildHTMLStyles(state, latest, transformTemplate)\n\n /**\n * For svg tags we just want to make sure viewBox is animatable and treat all the styles\n * as normal HTML tags.\n */\n if (isSVGTag) {\n if (state.style.viewBox) {\n state.attrs.viewBox = state.style.viewBox\n }\n return\n }\n\n state.attrs = state.style\n state.style = {}\n const { attrs, style } = state\n\n for (const key of cssStyleProperties) {\n if (attrs[key] !== undefined) {\n style[key] = attrs[key]\n delete attrs[key]\n }\n }\n\n if (style.transform || attrs.transformOrigin) {\n style.transformOrigin = attrs.transformOrigin ?? \"50% 50%\"\n delete attrs.transformOrigin\n }\n\n if (style.transform) {\n /**\n * SVG's element transform-origin uses its own median as a reference.\n * Therefore, transformBox becomes a fill-box\n */\n style.transformBox = (styleProp?.transformBox as string) ?? \"fill-box\"\n delete attrs.transformBox\n }\n\n // Render attrX/attrY/attrScale as attributes\n if (attrX !== undefined) attrs.x = attrX\n if (attrY !== undefined) attrs.y = attrY\n if (attrScale !== undefined) attrs.scale = attrScale\n\n // Build SVG path if one has been defined\n if (pathLength !== undefined) {\n buildSVGPath(\n attrs,\n pathLength as number,\n pathSpacing as number,\n pathOffset as number,\n false\n )\n }\n}\n","/**\n * A set of attribute names that are always read/written as camel case.\n */\nexport const camelCaseAttributes = new Set([\n \"baseFrequency\",\n \"diffuseConstant\",\n \"kernelMatrix\",\n \"kernelUnitLength\",\n \"keySplines\",\n \"keyTimes\",\n \"limitingConeAngle\",\n \"markerHeight\",\n \"markerWidth\",\n \"numOctaves\",\n \"targetX\",\n \"targetY\",\n \"surfaceScale\",\n \"specularConstant\",\n \"specularExponent\",\n \"stdDeviation\",\n \"tableValues\",\n \"viewBox\",\n \"gradientTransform\",\n \"pathLength\",\n \"startOffset\",\n \"textLength\",\n \"lengthAdjust\",\n])\n","export const isSVGTag = (tag: unknown) =>\n typeof tag === \"string\" && tag.toLowerCase() === \"svg\"\n","import type { MotionStyle } from \"../../VisualElement\"\nimport { camelToDash } from \"../../dom/utils/camel-to-dash\"\nimport { renderHTML } from \"../../html/utils/render\"\nimport { SVGRenderState } from \"../types\"\nimport { camelCaseAttributes } from \"./camel-case-attrs\"\n\nexport function renderSVG(\n element: SVGElement,\n renderState: SVGRenderState,\n _styleProp?: MotionStyle,\n projection?: any\n) {\n renderHTML(element as any, renderState, undefined, projection)\n\n for (const key in renderState.attrs) {\n element.setAttribute(\n !camelCaseAttributes.has(key) ? camelToDash(key) : key,\n renderState.attrs[key] as string\n )\n }\n}\n","import { isMotionValue } from \"../../../value/utils/is-motion-value\"\nimport type { MotionNodeOptions } from \"../../../node/types\"\nimport { transformPropOrder } from \"../../utils/keys-transform\"\nimport { scrapeMotionValuesFromProps as scrapeHTMLMotionValuesFromProps } from \"../../html/utils/scrape-motion-values\"\nimport type { VisualElement } from \"../../VisualElement\"\n\nexport function scrapeMotionValuesFromProps(\n props: MotionNodeOptions,\n prevProps: MotionNodeOptions,\n visualElement?: VisualElement\n) {\n const newValues = scrapeHTMLMotionValuesFromProps(\n props,\n prevProps,\n visualElement\n )\n\n for (const key in props) {\n if (\n isMotionValue(props[key as keyof typeof props]) ||\n isMotionValue(prevProps[key as keyof typeof prevProps])\n ) {\n const targetKey =\n transformPropOrder.indexOf(key) !== -1\n ? \"attr\" + key.charAt(0).toUpperCase() + key.substring(1)\n : key\n\n newValues[targetKey] = props[key as keyof typeof props]\n }\n }\n\n return newValues\n}\n","import type { AnyResolvedKeyframe } from \"../../animation/types\"\nimport type { MotionValue } from \"../../value\"\nimport type { MotionNodeOptions } from \"../../node/types\"\nimport { transformProps } from \"../utils/keys-transform\"\nimport { getDefaultValueType } from \"../../value/types/maps/defaults\"\nimport { createBox } from \"../../projection/geometry/models\"\nimport { DOMVisualElement } from \"../dom/DOMVisualElement\"\nimport type { DOMVisualElementOptions } from \"../dom/types\"\nimport { camelToDash } from \"../dom/utils/camel-to-dash\"\nimport type { ResolvedValues } from \"../types\"\nimport type { VisualElement, MotionStyle } from \"../VisualElement\"\nimport { SVGRenderState } from \"./types\"\nimport { buildSVGAttrs, cssStyleProperties } from \"./utils/build-attrs\"\nimport { camelCaseAttributes } from \"./utils/camel-case-attrs\"\nimport { isSVGTag } from \"./utils/is-svg-tag\"\nimport { renderSVG } from \"./utils/render\"\nimport { scrapeMotionValuesFromProps } from \"./utils/scrape-motion-values\"\nexport class SVGVisualElement extends DOMVisualElement<\n SVGElement,\n SVGRenderState,\n DOMVisualElementOptions\n> {\n type = \"svg\"\n\n isSVGTag = false\n\n getBaseTargetFromProps(\n props: MotionNodeOptions,\n key: string\n ): AnyResolvedKeyframe | MotionValue | undefined {\n return props[key as keyof MotionNodeOptions]\n }\n\n readValueFromInstance(instance: SVGElement, key: string) {\n if (transformProps.has(key)) {\n const defaultType = getDefaultValueType(key)\n return defaultType ? defaultType.default || 0 : 0\n }\n\n if (cssStyleProperties.includes(key)) {\n const computedStyle = getComputedStyle(instance)\n const value = computedStyle[key as keyof typeof computedStyle]\n if (typeof value === \"string\" && value) return value.trim()\n }\n\n key = !camelCaseAttributes.has(key) ? camelToDash(key) : key\n return instance.getAttribute(key)\n }\n\n measureInstanceViewportBox = createBox\n\n scrapeMotionValuesFromProps(\n props: MotionNodeOptions,\n prevProps: MotionNodeOptions,\n visualElement: VisualElement\n ) {\n return scrapeMotionValuesFromProps(props, prevProps, visualElement)\n }\n\n build(\n renderState: SVGRenderState,\n latestValues: ResolvedValues,\n props: MotionNodeOptions\n ) {\n buildSVGAttrs(\n renderState,\n latestValues,\n this.isSVGTag,\n props.transformTemplate,\n (props as any).style\n )\n }\n\n renderInstance(\n instance: SVGElement,\n renderState: SVGRenderState,\n styleProp?: MotionStyle | undefined,\n projection?: any\n ): void {\n renderSVG(instance, renderState, styleProp, projection)\n }\n\n mount(instance: SVGElement) {\n this.isSVGTag = isSVGTag(instance.tagName)\n super.mount(instance)\n }\n}\n","import { isVariantLabel } from \"./is-variant-label\"\nimport { variantProps } from \"./variant-props\"\n\nconst numVariantProps = variantProps.length\n\ntype VariantStateContext = {\n initial?: string | string[]\n animate?: string | string[]\n exit?: string | string[]\n whileHover?: string | string[]\n whileDrag?: string | string[]\n whileFocus?: string | string[]\n whileTap?: string | string[]\n}\n\n/**\n * Get variant context from a visual element's parent chain.\n * Uses `any` type for visualElement to avoid circular dependencies.\n */\nexport function getVariantContext(\n visualElement?: any\n): undefined | VariantStateContext {\n if (!visualElement) return undefined\n\n if (!visualElement.isControllingVariants) {\n const context = visualElement.parent\n ? getVariantContext(visualElement.parent) || {}\n : {}\n if (visualElement.props.initial !== undefined) {\n context.initial = visualElement.props.initial as any\n }\n return context\n }\n\n const context: VariantStateContext = {}\n for (let i = 0; i < numVariantProps; i++) {\n const name = variantProps[i] as keyof typeof context\n const prop = visualElement.props[name]\n\n if (isVariantLabel(prop) || prop === false) {\n ;(context as any)[name] = prop\n }\n }\n\n return context\n}\n","export function shallowCompare(next: any[], prev: any[] | null) {\n if (!Array.isArray(prev)) return false\n\n const prevLength = prev.length\n\n if (prevLength !== next.length) return false\n\n for (let i = 0; i < prevLength; i++) {\n if (prev[i] !== next[i]) return false\n }\n\n return true\n}\n","import type {\n AnimationDefinition,\n TargetAndTransition,\n VariantLabels,\n} from \"../../node/types\"\nimport type { AnimationType } from \"../types\"\nimport type { VisualElementAnimationOptions } from \"../../animation/interfaces/types\"\nimport { animateVisualElement } from \"../../animation/interfaces/visual-element\"\nimport { calcChildStagger } from \"../../animation/utils/calc-child-stagger\"\nimport { getVariantContext } from \"./get-variant-context\"\nimport { isAnimationControls } from \"./is-animation-controls\"\nimport { isKeyframesTarget } from \"./is-keyframes-target\"\nimport { isVariantLabel } from \"./is-variant-label\"\nimport { resolveVariant } from \"./resolve-dynamic-variants\"\nimport { shallowCompare } from \"./shallow-compare\"\nimport { variantPriorityOrder } from \"./variant-props\"\n\nexport type { VisualElementAnimationOptions }\n\nexport interface AnimationState {\n animateChanges: (type?: AnimationType) => Promise\n setActive: (\n type: AnimationType,\n isActive: boolean,\n options?: VisualElementAnimationOptions\n ) => Promise\n setAnimateFunction: (fn: any) => void\n getState: () => { [key: string]: AnimationTypeState }\n reset: () => void\n}\n\ninterface DefinitionAndOptions {\n animation: AnimationDefinition\n options?: VisualElementAnimationOptions\n}\n\nexport type AnimationList = string[] | TargetAndTransition[]\n\nconst reversePriorityOrder = [...variantPriorityOrder].reverse()\nconst numAnimationTypes = variantPriorityOrder.length\n\n/**\n * Type for the animate function that can be injected.\n * This allows the animation implementation to be provided by the framework layer.\n */\nexport type AnimateFunction = (animations: DefinitionAndOptions[]) => Promise\n\nfunction createAnimateFunction(visualElement: any): AnimateFunction {\n return (animations: DefinitionAndOptions[]) => {\n return Promise.all(\n animations.map(({ animation, options }) =>\n animateVisualElement(visualElement, animation, options)\n )\n )\n }\n}\n\nexport function createAnimationState(visualElement: any): AnimationState {\n let animate = createAnimateFunction(visualElement)\n let state = createState()\n let isInitialRender = true\n /**\n * Track whether the animation state has been reset (e.g. via StrictMode\n * double-invocation or Suspense unmount/remount). On the first\n * animateChanges() call after a reset we need to behave like the initial\n * render for variant-inheritance checks, even though isInitialRender is\n * already false.\n */\n let wasReset = false\n\n /**\n * This function will be used to reduce the animation definitions for\n * each active animation type into an object of resolved values for it.\n */\n const buildResolvedTypeValues =\n (type: AnimationType) =>\n (\n acc: { [key: string]: any },\n definition: string | TargetAndTransition | undefined\n ) => {\n const resolved = resolveVariant(\n visualElement,\n definition,\n type === \"exit\"\n ? visualElement.presenceContext?.custom\n : undefined\n )\n\n if (resolved) {\n const { transition, transitionEnd, ...target } = resolved\n acc = { ...acc, ...target, ...transitionEnd }\n }\n\n return acc\n }\n\n /**\n * This just allows us to inject mocked animation functions\n * @internal\n */\n function setAnimateFunction(\n makeAnimator: (visualElement: any) => AnimateFunction\n ) {\n animate = makeAnimator(visualElement)\n }\n\n /**\n * When we receive new props, we need to:\n * 1. Create a list of protected keys for each type. This is a directory of\n * value keys that are currently being \"handled\" by types of a higher priority\n * so that whenever an animation is played of a given type, these values are\n * protected from being animated.\n * 2. Determine if an animation type needs animating.\n * 3. Determine if any values have been removed from a type and figure out\n * what to animate those to.\n */\n function animateChanges(changedActiveType?: AnimationType) {\n const { props } = visualElement\n const context = getVariantContext(visualElement.parent) || {}\n\n /**\n * A list of animations that we'll build into as we iterate through the animation\n * types. This will get executed at the end of the function.\n */\n const animations: DefinitionAndOptions[] = []\n\n /**\n * Keep track of which values have been removed. Then, as we hit lower priority\n * animation types, we can check if they contain removed values and animate to that.\n */\n const removedKeys = new Set()\n\n /**\n * A dictionary of all encountered keys. This is an object to let us build into and\n * copy it without iteration. Each time we hit an animation type we set its protected\n * keys - the keys its not allowed to animate - to the latest version of this object.\n */\n let encounteredKeys: { [key: string]: any } = {}\n\n /**\n * If a variant has been removed at a given index, and this component is controlling\n * variant animations, we want to ensure lower-priority variants are forced to animate.\n */\n let removedVariantIndex = Infinity\n\n /**\n * Iterate through all animation types in reverse priority order. For each, we want to\n * detect which values it's handling and whether or not they've changed (and therefore\n * need to be animated). If any values have been removed, we want to detect those in\n * lower priority props and flag for animation.\n */\n for (let i = 0; i < numAnimationTypes; i++) {\n const type = reversePriorityOrder[i]\n const typeState = state[type]\n const prop =\n props[type] !== undefined\n ? props[type]\n : context[type as keyof typeof context]\n const propIsVariant = isVariantLabel(prop)\n\n /**\n * If this type has *just* changed isActive status, set activeDelta\n * to that status. Otherwise set to null.\n */\n const activeDelta =\n type === changedActiveType ? typeState.isActive : null\n\n if (activeDelta === false) removedVariantIndex = i\n\n /**\n * If this prop is an inherited variant, rather than been set directly on the\n * component itself, we want to make sure we allow the parent to trigger animations.\n *\n * TODO: Can probably change this to a !isControllingVariants check\n */\n let isInherited =\n prop === context[type as keyof typeof context] &&\n prop !== props[type] &&\n propIsVariant\n\n if (\n isInherited &&\n (isInitialRender || wasReset) &&\n visualElement.manuallyAnimateOnMount\n ) {\n isInherited = false\n }\n\n /**\n * Set all encountered keys so far as the protected keys for this type. This will\n * be any key that has been animated or otherwise handled by active, higher-priortiy types.\n */\n typeState.protectedKeys = { ...encounteredKeys }\n\n // Check if we can skip analysing this prop early\n if (\n // If it isn't active and hasn't *just* been set as inactive\n (!typeState.isActive && activeDelta === null) ||\n // If we didn't and don't have any defined prop for this animation type\n (!prop && !typeState.prevProp) ||\n // Or if the prop doesn't define an animation\n isAnimationControls(prop) ||\n typeof prop === \"boolean\"\n ) {\n continue\n }\n\n /**\n * If exit is already active and wasn't just activated, skip\n * re-processing to prevent interrupting running exit animations.\n * Re-resolving exit with a changed custom value can start new\n * value animations that stop the originals, leaving the exit\n * animation promise unresolved and the component stuck in the DOM.\n */\n if (type === \"exit\" && typeState.isActive && activeDelta !== true) {\n if (typeState.prevResolvedValues) {\n encounteredKeys = {\n ...encounteredKeys,\n ...typeState.prevResolvedValues,\n }\n }\n continue\n }\n\n /**\n * As we go look through the values defined on this type, if we detect\n * a changed value or a value that was removed in a higher priority, we set\n * this to true and add this prop to the animation list.\n */\n const variantDidChange = checkVariantsDidChange(\n typeState.prevProp,\n prop\n )\n\n let shouldAnimateType =\n variantDidChange ||\n // If we're making this variant active, we want to always make it active\n (type === changedActiveType &&\n typeState.isActive &&\n !isInherited &&\n propIsVariant) ||\n // If we removed a higher-priority variant (i is in reverse order)\n (i > removedVariantIndex && propIsVariant)\n\n let handledRemovedValues = false\n\n /**\n * As animations can be set as variant lists, variants or target objects, we\n * coerce everything to an array if it isn't one already\n */\n const definitionList = Array.isArray(prop) ? prop : [prop]\n\n /**\n * Build an object of all the resolved values. We'll use this in the subsequent\n * animateChanges calls to determine whether a value has changed.\n */\n let resolvedValues = definitionList.reduce(\n buildResolvedTypeValues(type),\n {}\n )\n\n if (activeDelta === false) resolvedValues = {}\n\n /**\n * Now we need to loop through all the keys in the prev prop and this prop,\n * and decide:\n * 1. If the value has changed, and needs animating\n * 2. If it has been removed, and needs adding to the removedKeys set\n * 3. If it has been removed in a higher priority type and needs animating\n * 4. If it hasn't been removed in a higher priority but hasn't changed, and\n * needs adding to the type's protectedKeys list.\n */\n const { prevResolvedValues = {} } = typeState\n\n const allKeys = {\n ...prevResolvedValues,\n ...resolvedValues,\n }\n const markToAnimate = (key: string) => {\n shouldAnimateType = true\n if (removedKeys.has(key)) {\n handledRemovedValues = true\n removedKeys.delete(key)\n }\n typeState.needsAnimating[key] = true\n\n const motionValue = visualElement.getValue(key)\n if (motionValue) motionValue.liveStyle = false\n }\n\n for (const key in allKeys) {\n const next = resolvedValues[key]\n const prev = prevResolvedValues[key]\n\n // If we've already handled this we can just skip ahead\n if (encounteredKeys.hasOwnProperty(key)) continue\n\n /**\n * If the value has changed, we probably want to animate it.\n */\n let valueHasChanged = false\n if (isKeyframesTarget(next) && isKeyframesTarget(prev)) {\n valueHasChanged =\n !shallowCompare(next, prev) || variantDidChange\n } else {\n valueHasChanged = next !== prev\n }\n\n if (valueHasChanged) {\n if (next !== undefined && next !== null) {\n // If next is defined and doesn't equal prev, it needs animating\n markToAnimate(key)\n } else {\n // If it's undefined, it's been removed.\n removedKeys.add(key)\n }\n } else if (next !== undefined && removedKeys.has(key)) {\n /**\n * If next hasn't changed and it isn't undefined, we want to check if it's\n * been removed by a higher priority\n */\n markToAnimate(key)\n } else {\n /**\n * If it hasn't changed, we add it to the list of protected values\n * to ensure it doesn't get animated.\n */\n typeState.protectedKeys[key] = true\n }\n }\n\n /**\n * Update the typeState so next time animateChanges is called we can compare the\n * latest prop and resolvedValues to these.\n */\n typeState.prevProp = prop\n typeState.prevResolvedValues = resolvedValues\n\n if (typeState.isActive) {\n encounteredKeys = { ...encounteredKeys, ...resolvedValues }\n }\n\n if (\n (isInitialRender || wasReset) &&\n visualElement.blockInitialAnimation\n ) {\n shouldAnimateType = false\n }\n\n /**\n * If this is an inherited prop we want to skip this animation\n * unless the inherited variants haven't changed on this render.\n */\n const willAnimateViaParent = isInherited && variantDidChange\n const needsAnimating = !willAnimateViaParent || handledRemovedValues\n if (shouldAnimateType && needsAnimating) {\n animations.push(\n ...definitionList.map((animation) => {\n const options: VisualElementAnimationOptions = { type }\n\n /**\n * If we're performing the initial animation, but we're not\n * rendering at the same time as the variant-controlling parent,\n * we want to use the parent's transition to calculate the stagger.\n */\n if (\n typeof animation === \"string\" &&\n (isInitialRender || wasReset) &&\n !willAnimateViaParent &&\n visualElement.manuallyAnimateOnMount &&\n visualElement.parent\n ) {\n const { parent } = visualElement\n const parentVariant = resolveVariant(\n parent,\n animation\n )\n\n if (parent.enteringChildren && parentVariant) {\n const { delayChildren } =\n parentVariant.transition || {}\n options.delay = calcChildStagger(\n parent.enteringChildren,\n visualElement,\n delayChildren\n )\n }\n }\n\n return {\n animation: animation as AnimationDefinition,\n options,\n }\n })\n )\n }\n }\n\n /**\n * If there are some removed value that haven't been dealt with,\n * we need to create a new animation that falls back either to the value\n * defined in the style prop, or the last read value.\n */\n if (removedKeys.size) {\n const fallbackAnimation: TargetAndTransition = {}\n\n /**\n * If the initial prop contains a transition we can use that, otherwise\n * allow the animation function to use the visual element's default.\n */\n if (typeof props.initial !== \"boolean\") {\n const initialTransition = resolveVariant(\n visualElement,\n Array.isArray(props.initial)\n ? props.initial[0]\n : props.initial\n )\n\n if (initialTransition && initialTransition.transition) {\n fallbackAnimation.transition = initialTransition.transition\n }\n }\n\n removedKeys.forEach((key) => {\n const fallbackTarget = visualElement.getBaseTarget(key)\n\n const motionValue = visualElement.getValue(key)\n if (motionValue) motionValue.liveStyle = true\n\n // @ts-expect-error - @mattgperry to figure if we should do something here\n fallbackAnimation[key] = fallbackTarget ?? null\n })\n\n animations.push({ animation: fallbackAnimation })\n }\n\n let shouldAnimate = Boolean(animations.length)\n\n if (\n isInitialRender &&\n (props.initial === false || props.initial === props.animate) &&\n !visualElement.manuallyAnimateOnMount\n ) {\n shouldAnimate = false\n }\n\n isInitialRender = false\n wasReset = false\n return shouldAnimate ? animate(animations) : Promise.resolve()\n }\n\n /**\n * Change whether a certain animation type is active.\n */\n function setActive(type: AnimationType, isActive: boolean) {\n // If the active state hasn't changed, we can safely do nothing here\n if (state[type].isActive === isActive) return Promise.resolve()\n\n // Propagate active change to children\n visualElement.variantChildren?.forEach((child: any) =>\n child.animationState?.setActive(type, isActive)\n )\n\n state[type].isActive = isActive\n\n const animations = animateChanges(type)\n\n for (const key in state) {\n state[key as keyof typeof state].protectedKeys = {}\n }\n\n return animations\n }\n\n return {\n animateChanges,\n setActive,\n setAnimateFunction,\n getState: () => state,\n reset: () => {\n state = createState()\n wasReset = true\n },\n }\n}\n\nexport function checkVariantsDidChange(prev: any, next: any) {\n if (typeof next === \"string\") {\n return next !== prev\n } else if (Array.isArray(next)) {\n return !shallowCompare(next, prev)\n }\n\n return false\n}\n\nexport interface AnimationTypeState {\n isActive: boolean\n protectedKeys: { [key: string]: true }\n needsAnimating: { [key: string]: boolean }\n prevResolvedValues: { [key: string]: any }\n prevProp?: VariantLabels | TargetAndTransition\n}\n\nfunction createTypeState(isActive = false): AnimationTypeState {\n return {\n isActive,\n protectedKeys: {},\n needsAnimating: {},\n prevResolvedValues: {},\n }\n}\n\nfunction createState() {\n return {\n animate: createTypeState(true),\n whileInView: createTypeState(),\n whileHover: createTypeState(),\n whileTap: createTypeState(),\n whileDrag: createTypeState(),\n whileFocus: createTypeState(),\n exit: createTypeState(),\n }\n}\n","import { Axis, AxisDelta, Box } from \"motion-utils\"\n\n/**\n * Reset an axis to the provided origin box.\n *\n * This is a mutative operation.\n */\nexport function copyAxisInto(axis: Axis, originAxis: Axis) {\n axis.min = originAxis.min\n axis.max = originAxis.max\n}\n\n/**\n * Reset a box to the provided origin box.\n *\n * This is a mutative operation.\n */\nexport function copyBoxInto(box: Box, originBox: Box) {\n copyAxisInto(box.x, originBox.x)\n copyAxisInto(box.y, originBox.y)\n}\n\n/**\n * Reset a delta to the provided origin box.\n *\n * This is a mutative operation.\n */\nexport function copyAxisDeltaInto(delta: AxisDelta, originDelta: AxisDelta) {\n delta.translate = originDelta.translate\n delta.scale = originDelta.scale\n delta.originPoint = originDelta.originPoint\n delta.origin = originDelta.origin\n}\n","import { Axis, AxisDelta, Box, Delta, Point } from \"motion-utils\"\nimport { mixNumber } from \"../../utils/mix/number\"\nimport { ResolvedValues } from \"../../render/types\"\n\nconst SCALE_PRECISION = 0.0001\nconst SCALE_MIN = 1 - SCALE_PRECISION\nconst SCALE_MAX = 1 + SCALE_PRECISION\nconst TRANSLATE_PRECISION = 0.01\nconst TRANSLATE_MIN = 0 - TRANSLATE_PRECISION\nconst TRANSLATE_MAX = 0 + TRANSLATE_PRECISION\n\nexport function calcLength(axis: Axis) {\n return axis.max - axis.min\n}\n\nexport function isNear(\n value: number,\n target: number,\n maxDistance: number\n): boolean {\n return Math.abs(value - target) <= maxDistance\n}\n\nexport function calcAxisDelta(\n delta: AxisDelta,\n source: Axis,\n target: Axis,\n origin: number = 0.5\n) {\n delta.origin = origin\n delta.originPoint = mixNumber(source.min, source.max, delta.origin)\n delta.scale = calcLength(target) / calcLength(source)\n delta.translate =\n mixNumber(target.min, target.max, delta.origin) - delta.originPoint\n\n if (\n (delta.scale >= SCALE_MIN && delta.scale <= SCALE_MAX) ||\n isNaN(delta.scale)\n ) {\n delta.scale = 1.0\n }\n\n if (\n (delta.translate >= TRANSLATE_MIN &&\n delta.translate <= TRANSLATE_MAX) ||\n isNaN(delta.translate)\n ) {\n delta.translate = 0.0\n }\n}\n\nexport function calcBoxDelta(\n delta: Delta,\n source: Box,\n target: Box,\n origin?: ResolvedValues\n): void {\n calcAxisDelta(\n delta.x,\n source.x,\n target.x,\n origin ? (origin.originX as number) : undefined\n )\n calcAxisDelta(\n delta.y,\n source.y,\n target.y,\n origin ? (origin.originY as number) : undefined\n )\n}\n\nexport function calcRelativeAxis(\n target: Axis,\n relative: Axis,\n parent: Axis,\n anchor: number = 0\n) {\n const anchorPoint = anchor\n ? mixNumber(parent.min, parent.max, anchor)\n : parent.min\n target.min = anchorPoint + relative.min\n target.max = target.min + calcLength(relative)\n}\n\nexport function calcRelativeBox(\n target: Box,\n relative: Box,\n parent: Box,\n anchor?: Point\n) {\n calcRelativeAxis(target.x, relative.x, parent.x, anchor?.x)\n calcRelativeAxis(target.y, relative.y, parent.y, anchor?.y)\n}\n\nexport function calcRelativeAxisPosition(\n target: Axis,\n layout: Axis,\n parent: Axis,\n anchor: number = 0\n) {\n const anchorPoint = anchor\n ? mixNumber(parent.min, parent.max, anchor)\n : parent.min\n target.min = layout.min - anchorPoint\n target.max = target.min + calcLength(layout)\n}\n\nexport function calcRelativePosition(\n target: Box,\n layout: Box,\n parent: Box,\n anchor?: Point\n) {\n calcRelativeAxisPosition(target.x, layout.x, parent.x, anchor?.x)\n calcRelativeAxisPosition(target.y, layout.y, parent.y, anchor?.y)\n}\n","import { Axis, Box } from \"motion-utils\"\nimport { mixNumber } from \"../../utils/mix/number\"\nimport { percent } from \"../../value/types/numbers/units\"\nimport { ResolvedValues } from \"../../render/types\"\nimport { scalePoint } from \"./delta-apply\"\n\n/**\n * Remove a delta from a point. This is essentially the steps of applyPointDelta in reverse\n */\nexport function removePointDelta(\n point: number,\n translate: number,\n scale: number,\n originPoint: number,\n boxScale?: number\n): number {\n point -= translate\n point = scalePoint(point, 1 / scale, originPoint)\n\n if (boxScale !== undefined) {\n point = scalePoint(point, 1 / boxScale, originPoint)\n }\n\n return point\n}\n\n/**\n * Remove a delta from an axis. This is essentially the steps of applyAxisDelta in reverse\n */\nexport function removeAxisDelta(\n axis: Axis,\n translate: number | string = 0,\n scale: number = 1,\n origin: number = 0.5,\n boxScale?: number,\n originAxis: Axis = axis,\n sourceAxis: Axis = axis\n): void {\n if (percent.test(translate)) {\n translate = parseFloat(translate as string)\n const relativeProgress = mixNumber(\n sourceAxis.min,\n sourceAxis.max,\n translate / 100\n )\n translate = relativeProgress - sourceAxis.min\n }\n\n if (typeof translate !== \"number\") return\n\n let originPoint = mixNumber(originAxis.min, originAxis.max, origin)\n if (axis === originAxis) originPoint -= translate\n\n axis.min = removePointDelta(\n axis.min,\n translate,\n scale,\n originPoint,\n boxScale\n )\n\n axis.max = removePointDelta(\n axis.max,\n translate,\n scale,\n originPoint,\n boxScale\n )\n}\n\n/**\n * Remove a transforms from an axis. This is essentially the steps of applyAxisTransforms in reverse\n * and acts as a bridge between motion values and removeAxisDelta\n */\nexport function removeAxisTransforms(\n axis: Axis,\n transforms: ResolvedValues,\n [key, scaleKey, originKey]: string[],\n origin?: Axis,\n sourceAxis?: Axis\n) {\n removeAxisDelta(\n axis,\n transforms[key] as number,\n transforms[scaleKey] as number,\n transforms[originKey] as number,\n transforms.scale as number,\n origin,\n sourceAxis\n )\n}\n\n/**\n * The names of the motion values we want to apply as translation, scale and origin.\n */\nconst xKeys = [\"x\", \"scaleX\", \"originX\"]\nconst yKeys = [\"y\", \"scaleY\", \"originY\"]\n\n/**\n * Remove a transforms from an box. This is essentially the steps of applyAxisBox in reverse\n * and acts as a bridge between motion values and removeAxisDelta\n */\nexport function removeBoxTransforms(\n box: Box,\n transforms: ResolvedValues,\n originBox?: Box,\n sourceBox?: Box\n): void {\n removeAxisTransforms(\n box.x,\n transforms,\n xKeys,\n originBox ? originBox.x : undefined,\n sourceBox ? sourceBox.x : undefined\n )\n removeAxisTransforms(\n box.y,\n transforms,\n yKeys,\n originBox ? originBox.y : undefined,\n sourceBox ? sourceBox.y : undefined\n )\n}\n","import { Axis, AxisDelta, Box, Delta } from \"motion-utils\"\nimport { calcLength } from \"./delta-calc\"\n\nfunction isAxisDeltaZero(delta: AxisDelta) {\n return delta.translate === 0 && delta.scale === 1\n}\n\nexport function isDeltaZero(delta: Delta) {\n return isAxisDeltaZero(delta.x) && isAxisDeltaZero(delta.y)\n}\n\nexport function axisEquals(a: Axis, b: Axis) {\n return a.min === b.min && a.max === b.max\n}\n\nexport function boxEquals(a: Box, b: Box) {\n return axisEquals(a.x, b.x) && axisEquals(a.y, b.y)\n}\n\nexport function axisEqualsRounded(a: Axis, b: Axis) {\n return (\n Math.round(a.min) === Math.round(b.min) &&\n Math.round(a.max) === Math.round(b.max)\n )\n}\n\nexport function boxEqualsRounded(a: Box, b: Box) {\n return axisEqualsRounded(a.x, b.x) && axisEqualsRounded(a.y, b.y)\n}\n\nexport function aspectRatio(box: Box): number {\n return calcLength(box.x) / calcLength(box.y)\n}\n\nexport function axisDeltaEquals(a: AxisDelta, b: AxisDelta) {\n return (\n a.translate === b.translate &&\n a.scale === b.scale &&\n a.originPoint === b.originPoint\n )\n}\n","type Callback = (axis: \"x\" | \"y\") => void\n\nexport function eachAxis(callback: Callback) {\n return [callback(\"x\"), callback(\"y\")]\n}\n","import type { Delta, Point } from \"motion-utils\"\nimport type { ResolvedValues } from \"../../node/types\"\n\nexport function buildProjectionTransform(\n delta: Delta,\n treeScale: Point,\n latestTransform?: ResolvedValues\n): string {\n let transform = \"\"\n\n /**\n * The translations we use to calculate are always relative to the viewport coordinate space.\n * But when we apply scales, we also scale the coordinate space of an element and its children.\n * For instance if we have a treeScale (the culmination of all parent scales) of 0.5 and we need\n * to move an element 100 pixels, we actually need to move it 200 in within that scaled space.\n */\n const xTranslate = delta.x.translate / treeScale.x\n const yTranslate = delta.y.translate / treeScale.y\n const zTranslate = latestTransform?.z || 0\n if (xTranslate || yTranslate || zTranslate) {\n transform = `translate3d(${xTranslate}px, ${yTranslate}px, ${zTranslate}px) `\n }\n\n /**\n * Apply scale correction for the tree transform.\n * This will apply scale to the screen-orientated axes.\n */\n if (treeScale.x !== 1 || treeScale.y !== 1) {\n transform += `scale(${1 / treeScale.x}, ${1 / treeScale.y}) `\n }\n\n if (latestTransform) {\n const {\n transformPerspective,\n rotate,\n pathRotation,\n rotateX,\n rotateY,\n skewX,\n skewY,\n } = latestTransform\n if (transformPerspective)\n transform = `perspective(${transformPerspective}px) ${transform}`\n if (rotate) transform += `rotate(${rotate}deg) `\n // Additive `rotate()` so user `rotate` isn't clobbered.\n if (pathRotation) transform += `rotate(${pathRotation}deg) `\n if (rotateX) transform += `rotateX(${rotateX}deg) `\n if (rotateY) transform += `rotateY(${rotateY}deg) `\n if (skewX) transform += `skewX(${skewX}deg) `\n if (skewY) transform += `skewY(${skewY}deg) `\n }\n\n /**\n * Apply scale to match the size of the element to the size we want it.\n * This will apply scale to the element-orientated axes.\n */\n const elementScaleX = delta.x.scale * treeScale.x\n const elementScaleY = delta.y.scale * treeScale.y\n if (elementScaleX !== 1 || elementScaleY !== 1) {\n transform += `scale(${elementScaleX}, ${elementScaleY})`\n }\n\n return transform || \"none\"\n}\n","import { mixNumber } from \"../../utils/mix/number\"\nimport { percent, px } from \"../../value/types/numbers/units\"\nimport type { AnyResolvedKeyframe } from \"../../animation/types\"\nimport {\n progress as calcProgress,\n circOut,\n EasingFunction,\n noop,\n} from \"motion-utils\"\nimport type { ResolvedValues } from \"../../node/types\"\nimport { cornerRadiusProps } from \"../../utils/border-radius\"\n\nconst numBorders = cornerRadiusProps.length\n\nconst asNumber = (value: AnyResolvedKeyframe) =>\n typeof value === \"string\" ? parseFloat(value) : value\n\nconst isPx = (value: AnyResolvedKeyframe) =>\n typeof value === \"number\" || px.test(value)\n\nexport function mixValues(\n target: ResolvedValues,\n follow: ResolvedValues,\n lead: ResolvedValues,\n progress: number,\n shouldCrossfadeOpacity: boolean,\n isOnlyMember: boolean\n) {\n if (shouldCrossfadeOpacity) {\n target.opacity = mixNumber(\n 0,\n (lead.opacity as number) ?? 1,\n easeCrossfadeIn(progress)\n )\n target.opacityExit = mixNumber(\n (follow.opacity as number) ?? 1,\n 0,\n easeCrossfadeOut(progress)\n )\n } else if (isOnlyMember) {\n target.opacity = mixNumber(\n (follow.opacity as number) ?? 1,\n (lead.opacity as number) ?? 1,\n progress\n )\n }\n\n /**\n * Mix border radius\n */\n for (let i = 0; i < numBorders; i++) {\n const borderLabel = cornerRadiusProps[i]\n let followRadius = getRadius(follow, borderLabel)\n let leadRadius = getRadius(lead, borderLabel)\n\n if (followRadius === undefined && leadRadius === undefined) continue\n\n followRadius ||= 0\n leadRadius ||= 0\n\n const canMix =\n followRadius === 0 ||\n leadRadius === 0 ||\n isPx(followRadius) === isPx(leadRadius)\n\n if (canMix) {\n target[borderLabel] = Math.max(\n mixNumber(\n asNumber(followRadius),\n asNumber(leadRadius),\n progress\n ),\n 0\n )\n\n if (percent.test(leadRadius) || percent.test(followRadius)) {\n target[borderLabel] += \"%\"\n }\n } else {\n target[borderLabel] = leadRadius\n }\n }\n\n /**\n * Mix rotation\n */\n if (follow.rotate || lead.rotate) {\n target.rotate = mixNumber(\n (follow.rotate as number) || 0,\n (lead.rotate as number) || 0,\n progress\n )\n }\n}\n\nfunction getRadius(values: ResolvedValues, radiusName: string) {\n return values[radiusName] !== undefined\n ? values[radiusName]\n : values.borderRadius\n}\n\nconst easeCrossfadeIn = /*@__PURE__*/ compress(0, 0.5, circOut)\nconst easeCrossfadeOut = /*@__PURE__*/ compress(0.5, 0.95, noop)\n\nfunction compress(\n min: number,\n max: number,\n easing: EasingFunction\n): EasingFunction {\n return (p: number) => {\n // Could replace ifs with clamp\n if (p < min) return 0\n if (p > max) return 1\n return easing(calcProgress(min, max, p))\n }\n}\n","import { animateMotionValue } from \"../interfaces/motion-value\"\nimport type {\n AnimationPlaybackControlsWithThen,\n AnyResolvedKeyframe,\n UnresolvedValueKeyframe,\n ValueAnimationTransition,\n} from \"../types\"\nimport {\n motionValue as createMotionValue,\n MotionValue,\n} from \"../../value\"\nimport { isMotionValue } from \"../../value/utils/is-motion-value\"\n\nexport function animateSingleValue(\n value: MotionValue | V,\n keyframes: V | UnresolvedValueKeyframe[],\n options?: ValueAnimationTransition\n): AnimationPlaybackControlsWithThen {\n const motionValue = isMotionValue(value) ? value : createMotionValue(value)\n\n motionValue.start(animateMotionValue(\"\", motionValue, keyframes, options))\n\n return motionValue.animation!\n}\n","export function addDomEvent(\n target: EventTarget,\n eventName: string,\n handler: EventListener,\n options: AddEventListenerOptions = { passive: true }\n) {\n target.addEventListener(eventName, handler, options)\n\n return () => target.removeEventListener(eventName, handler, options)\n}\n","import type { VisualElement } from \"../../render/VisualElement\"\n\nexport interface WithDepth {\n depth: number\n}\n\nexport const compareByDepth = (a: VisualElement, b: VisualElement) =>\n a.depth - b.depth\n","import { addUniqueItem, removeItem } from \"motion-utils\"\nimport { compareByDepth, WithDepth } from \"./compare-by-depth\"\n\nexport class FlatTree {\n private children: WithDepth[] = []\n\n private isDirty: boolean = false\n\n add(child: WithDepth) {\n addUniqueItem(this.children, child)\n this.isDirty = true\n }\n\n remove(child: WithDepth) {\n removeItem(this.children, child)\n this.isDirty = true\n }\n\n forEach(callback: (child: WithDepth) => void) {\n this.isDirty && this.children.sort(compareByDepth)\n this.isDirty = false\n this.children.forEach(callback)\n }\n}\n","import { cancelFrame, frame } from \"../frameloop\"\nimport { time } from \"../frameloop/sync-time\"\nimport type { FrameData } from \"../frameloop/types\"\nimport { secondsToMilliseconds } from \"motion-utils\"\n\nexport type DelayedFunction = (overshoot: number) => void\n\n/**\n * Timeout defined in ms\n */\nexport function delay(callback: DelayedFunction, timeout: number) {\n const start = time.now()\n\n const checkElapsed = ({ timestamp }: FrameData) => {\n const elapsed = timestamp - start\n\n if (elapsed >= timeout) {\n cancelFrame(checkElapsed)\n callback(elapsed - timeout)\n }\n }\n\n frame.setup(checkElapsed, true)\n\n return () => cancelFrame(checkElapsed)\n}\n\nexport function delayInSeconds(callback: DelayedFunction, timeout: number) {\n return delay(callback, secondsToMilliseconds(timeout))\n}\n","import type { AnyResolvedKeyframe } from \"../../animation/types\"\nimport { isMotionValue } from \"./is-motion-value\"\nimport type { MotionValue } from \"../index\"\n\n/**\n * If the provided value is a MotionValue, this returns the actual value, otherwise just the value itself\n */\nexport function resolveMotionValue(\n value?: AnyResolvedKeyframe | MotionValue\n): AnyResolvedKeyframe {\n return isMotionValue(value) ? value.get() : value\n}\n","import { addUniqueItem, removeItem } from \"motion-utils\"\nimport type { IProjectionNode } from \"../node/types\"\n\nexport class NodeStack {\n lead?: IProjectionNode\n prevLead?: IProjectionNode\n members: IProjectionNode[] = []\n\n add(node: IProjectionNode) {\n addUniqueItem(this.members, node)\n\n for (let i = this.members.length - 1; i >= 0; i--) {\n const member = this.members[i]\n if (member === node || member === this.lead || member === this.prevLead) continue\n const inst = member.instance as HTMLElement | undefined\n if ((!inst || inst.isConnected === false) && !member.snapshot) {\n removeItem(this.members, member)\n member.unmount()\n }\n }\n\n node.scheduleRender()\n }\n\n remove(node: IProjectionNode) {\n removeItem(this.members, node)\n if (node === this.prevLead) this.prevLead = undefined\n if (node === this.lead) {\n const prevLead = this.members[this.members.length - 1]\n if (prevLead) this.promote(prevLead)\n }\n }\n\n relegate(node: IProjectionNode) {\n for (let i = this.members.indexOf(node) - 1; i >= 0; i--) {\n const member = this.members[i]\n if (member.isPresent !== false && (member.instance as HTMLElement)?.isConnected !== false) {\n this.promote(member)\n return true\n }\n }\n return false\n }\n\n promote(node: IProjectionNode, preserveFollowOpacity?: boolean) {\n const prevLead = this.lead\n if (node === prevLead) return\n\n this.prevLead = prevLead\n this.lead = node\n node.show()\n\n if (prevLead) {\n prevLead.updateSnapshot()\n node.scheduleRender()\n\n const { layoutDependency: prevDep } = prevLead.options\n const { layoutDependency: nextDep } = node.options\n\n if (prevDep === undefined || prevDep !== nextDep) {\n node.resumeFrom = prevLead\n if (preserveFollowOpacity) prevLead.preserveOpacity = true\n\n if (prevLead.snapshot) {\n node.snapshot = prevLead.snapshot\n node.snapshot.latestValues =\n prevLead.animationValues || prevLead.latestValues\n }\n\n if (node.root?.isUpdating) node.isLayoutDirty = true\n }\n if (node.options.crossfade === false) prevLead.hide()\n }\n }\n\n exitAnimationComplete() {\n this.members.forEach((member) => {\n member.options.onExitComplete?.()\n member.resumingFrom?.options.onExitComplete?.()\n })\n }\n\n scheduleRender() {\n this.members.forEach(\n (member) => member.instance && member.scheduleRender(false)\n )\n }\n\n removeLeadSnapshot() {\n if (this.lead?.snapshot) this.lead.snapshot = undefined\n }\n}\n","/**\n * This should only ever be modified on the client otherwise it'll\n * persist through server requests. If we need instanced states we\n * could lazy-init via root.\n */\nexport const globalProjectionState = {\n /**\n * Global flag as to whether the tree has animated since the last time\n * we resized the window\n */\n hasAnimatedSinceResize: true,\n\n /**\n * We set this to true once, on the first update. Any nodes added to the tree beyond that\n * update will be given a `data-projection-id` attribute.\n */\n hasEverUpdated: false,\n}\n","import {\n Axis,\n AxisDelta,\n Box,\n clamp,\n Delta,\n noop,\n Point,\n SubscriptionManager,\n} from \"motion-utils\"\nimport { animateSingleValue } from \"../../animation/animate/single-value\"\nimport { JSAnimation } from \"../../animation/JSAnimation\"\nimport { getOptimisedAppearId } from \"../../animation/optimized-appear/get-appear-id\"\nimport {\n MotionPath,\n PathInterpolator,\n Transition,\n ValueAnimationOptions,\n} from \"../../animation/types\"\nimport { getValueTransition } from \"../../animation/utils/get-value-transition\"\nimport { cancelFrame, frame, frameData, frameSteps } from \"../../frameloop\"\nimport { microtask } from \"../../frameloop/microtask\"\nimport { time } from \"../../frameloop/sync-time\"\nimport type { Process } from \"../../frameloop/types\"\nimport { HTMLVisualElement } from \"../../render/html/HTMLVisualElement\"\nimport type { ResolvedValues } from \"../../render/types\"\nimport { scaleCorrectors } from \"../../render/utils/is-forced-motion-value\"\nimport type { MotionStyle, VisualElement } from \"../../render/VisualElement\"\nimport { statsBuffer } from \"../../stats/buffer\"\nimport { delay } from \"../../utils/delay\"\nimport { isSVGElement } from \"../../utils/is-svg-element\"\nimport { isSVGSVGElement } from \"../../utils/is-svg-svg-element\"\nimport { mixNumber } from \"../../utils/mix/number\"\nimport { MotionValue, motionValue } from \"../../value\"\nimport { resolveMotionValue } from \"../../value/utils/resolve-motion-value\"\nimport { mixValues } from \"../animation/mix-values\"\nimport { copyAxisDeltaInto, copyAxisInto, copyBoxInto } from \"../geometry/copy\"\nimport {\n applyBoxDelta,\n applyTreeDeltas,\n transformBox,\n translateAxis,\n} from \"../geometry/delta-apply\"\nimport {\n calcBoxDelta,\n calcLength,\n calcRelativeBox,\n calcRelativePosition,\n isNear,\n} from \"../geometry/delta-calc\"\nimport { removeBoxTransforms } from \"../geometry/delta-remove\"\nimport { createBox, createDelta } from \"../geometry/models\"\nimport {\n aspectRatio,\n axisDeltaEquals,\n boxEquals,\n boxEqualsRounded,\n isDeltaZero,\n} from \"../geometry/utils\"\nimport { NodeStack } from \"../shared/stack\"\nimport { buildProjectionTransform } from \"../styles/transform\"\nimport { eachAxis } from \"../utils/each-axis\"\nimport { FlatTree } from \"../utils/flat-tree\"\nimport { has2DTranslate, hasScale, hasTransform } from \"../utils/has-transform\"\nimport { globalProjectionState } from \"./state\"\nimport {\n IProjectionNode,\n LayoutEvents,\n LayoutUpdateData,\n Measurements,\n Phase,\n ProjectionNodeConfig,\n ProjectionNodeOptions,\n ScrollMeasurements,\n} from \"./types\"\n\nconst metrics = {\n nodes: 0,\n calculatedTargetDeltas: 0,\n calculatedProjections: 0,\n}\n\nconst transformAxes = [\"\", \"X\", \"Y\", \"Z\"]\n\n/**\n * We use 1000 as the animation target as 0-1000 maps better to pixels than 0-1\n * which has a noticeable difference in spring animations\n */\nconst animationTarget = 1000\n\nlet id = 0\n\nfunction resetDistortingTransform(\n key: string,\n visualElement: VisualElement,\n values: ResolvedValues,\n sharedAnimationValues?: ResolvedValues\n) {\n const { latestValues } = visualElement\n\n // Record the distorting transform and then temporarily set it to 0\n if (latestValues[key]) {\n values[key] = latestValues[key]\n visualElement.setStaticValue(key, 0)\n if (sharedAnimationValues) {\n sharedAnimationValues[key] = 0\n }\n }\n}\n\nfunction cancelTreeOptimisedTransformAnimations(\n projectionNode: IProjectionNode\n) {\n projectionNode.hasCheckedOptimisedAppear = true\n if (projectionNode.root === projectionNode) return\n\n const { visualElement } = projectionNode.options\n\n if (!visualElement) return\n\n const appearId = getOptimisedAppearId(visualElement)\n\n if (window.MotionHasOptimisedAnimation!(appearId, \"transform\")) {\n const { layout, layoutId } = projectionNode.options\n window.MotionCancelOptimisedAnimation!(\n appearId,\n \"transform\",\n frame,\n !(layout || layoutId)\n )\n }\n\n const { parent } = projectionNode\n if (parent && !parent.hasCheckedOptimisedAppear) {\n cancelTreeOptimisedTransformAnimations(parent)\n }\n}\n\nexport function createProjectionNode({\n attachResizeListener,\n defaultParent,\n measureScroll,\n checkIsScrollRoot,\n resetTransform,\n}: ProjectionNodeConfig) {\n return class ProjectionNode implements IProjectionNode {\n /**\n * A unique ID generated for every projection node.\n */\n id: number = id++\n\n /**\n * An id that represents a unique session instigated by startUpdate.\n */\n animationId: number = 0\n\n animationCommitId = 0\n\n /**\n * A reference to the platform-native node (currently this will be a HTMLElement).\n */\n instance: I | undefined\n\n /**\n * A reference to the root projection node. There'll only ever be one tree and one root.\n */\n root: IProjectionNode\n\n /**\n * A reference to this node's parent.\n */\n parent?: IProjectionNode\n\n /**\n * A path from this node to the root node. This provides a fast way to iterate\n * back up the tree.\n */\n path: IProjectionNode[]\n\n /**\n * A Set containing all this component's children. This is used to iterate\n * through the children.\n *\n * TODO: This could be faster to iterate as a flat array stored on the root node.\n */\n children = new Set()\n\n /**\n * Options for the node. We use this to configure what kind of layout animations\n * we should perform (if any).\n */\n options: ProjectionNodeOptions = {}\n\n /**\n * A snapshot of the element's state just before the current update. This is\n * hydrated when this node's `willUpdate` method is called and scrubbed at the\n * end of the tree's `didUpdate` method.\n */\n snapshot: Measurements | undefined\n\n /**\n * A box defining the element's layout relative to the page. This will have been\n * captured with all parent scrolls and projection transforms unset.\n */\n layout: Measurements | undefined\n\n /**\n * The layout used to calculate the previous layout animation. We use this to compare\n * layouts between renders and decide whether we need to trigger a new layout animation\n * or just let the current one play out.\n */\n targetLayout?: Box\n\n /**\n * A mutable data structure we use to apply all parent transforms currently\n * acting on the element's layout. It's from here we can calculate the projectionDelta\n * required to get the element from its layout into its calculated target box.\n */\n layoutCorrected: Box\n\n /**\n * An ideal projection transform we want to apply to the element. This is calculated,\n * usually when an element's layout has changed, and we want the element to look as though\n * its in its previous layout on the next frame. From there, we animated it down to 0\n * to animate the element to its new layout.\n */\n targetDelta?: Delta\n\n /**\n * A mutable structure representing the visual bounding box on the page where we want\n * and element to appear. This can be set directly but is currently derived once a frame\n * from apply targetDelta to layout.\n */\n target?: Box\n\n /**\n * A mutable structure describing a visual bounding box relative to the element's\n * projected parent. If defined, target will be derived from this rather than targetDelta.\n * If not defined, we'll attempt to calculate on the first layout animation frame\n * based on the targets calculated from targetDelta. This will transfer a layout animation\n * from viewport-relative to parent-relative.\n */\n relativeTarget?: Box\n\n relativeTargetOrigin?: Box\n relativeParent?: IProjectionNode\n\n /**\n * We use this to detect when its safe to shut down part of a projection tree.\n * We have to keep projecting children for scale correction and relative projection\n * until all their parents stop performing layout animations.\n */\n isTreeAnimating = false\n\n isAnimationBlocked = false\n\n /**\n * If true, attempt to resolve relativeTarget.\n */\n attemptToResolveRelativeTarget?: boolean\n\n /**\n * A mutable structure that represents the target as transformed by the element's\n * latest user-set transforms (ie scale, x)\n */\n targetWithTransforms?: Box\n\n /**\n * The previous projection delta, which we can compare with the newly calculated\n * projection delta to see if we need to render.\n */\n prevProjectionDelta?: Delta\n\n /**\n * A calculated transform that will project an element from its layoutCorrected\n * into the target. This will be used by children to calculate their own layoutCorrect boxes.\n */\n projectionDelta?: Delta\n\n /**\n * A calculated transform that will project an element from its layoutCorrected\n * into the targetWithTransforms.\n */\n projectionDeltaWithTransform?: Delta\n\n /**\n * If we're tracking the scroll of this element, we store it here.\n */\n scroll?: ScrollMeasurements\n\n /**\n * Flag to true if we think this layout has been changed. We can't always know this,\n * currently we set it to true every time a component renders, or if it has a layoutDependency\n * if that has changed between renders. Additionally, components can be grouped by LayoutGroup\n * and if one node is dirtied, they all are.\n */\n isLayoutDirty = false\n\n /**\n * Flag to true if we think the projection calculations for this node needs\n * recalculating as a result of an updated transform or layout animation.\n */\n isProjectionDirty = false\n\n /**\n * Flag to true if the layout *or* transform has changed. This then gets propagated\n * throughout the projection tree, forcing any element below to recalculate on the next frame.\n */\n isSharedProjectionDirty = false\n\n /**\n * Flag transform dirty. This gets propagated throughout the whole tree but is only\n * respected by shared nodes.\n */\n isTransformDirty = false\n\n /**\n * Block layout updates for instant layout transitions throughout the tree.\n */\n updateManuallyBlocked = false\n\n updateBlockedByResize = false\n\n /**\n * Set to true between the start of the first `willUpdate` call and the end of the `didUpdate`\n * call.\n */\n isUpdating = false\n\n /**\n * If this is an SVG element we currently disable projection transforms\n */\n isSVG = false\n\n /**\n * Flag to true (during promotion) if a node doing an instant layout transition needs to reset\n * its projection styles.\n */\n needsReset = false\n\n /**\n * Flags whether this node should have its transform reset prior to measuring.\n */\n shouldResetTransform = false\n\n /**\n * Store whether this node has been checked for optimised appear animations. As\n * effects fire bottom-up, and we want to look up the tree for appear animations,\n * this makes sure we only check each path once, stopping at nodes that\n * have already been checked.\n */\n hasCheckedOptimisedAppear = false\n\n /**\n * An object representing the calculated contextual/accumulated/tree scale.\n * This will be used to scale calculcated projection transforms, as these are\n * calculated in screen-space but need to be scaled for elements to layoutly\n * make it to their calculated destinations.\n *\n * TODO: Lazy-init\n */\n treeScale: Point = { x: 1, y: 1 }\n\n /**\n * Is hydrated with a projection node if an element is animating from another.\n */\n resumeFrom?: IProjectionNode\n\n /**\n * Is hydrated with a projection node if an element is animating from another.\n */\n resumingFrom?: IProjectionNode\n\n /**\n * A reference to the element's latest animated values. This is a reference shared\n * between the element's VisualElement and the ProjectionNode.\n */\n latestValues: ResolvedValues\n\n /**\n *\n */\n eventHandlers = new Map>()\n\n nodes?: FlatTree\n\n depth: number\n\n /**\n * If transformTemplate generates a different value before/after the\n * update, we need to reset the transform.\n */\n prevTransformTemplateValue: string | undefined\n\n preserveOpacity?: boolean\n\n hasTreeAnimated = false\n\n layoutVersion: number = 0\n\n constructor(\n latestValues: ResolvedValues = {},\n parent: IProjectionNode | undefined = defaultParent?.()\n ) {\n this.latestValues = latestValues\n this.root = parent ? parent.root || parent : this\n this.path = parent ? [...parent.path, parent] : []\n this.parent = parent\n\n this.depth = parent ? parent.depth + 1 : 0\n\n for (let i = 0; i < this.path.length; i++) {\n this.path[i].shouldResetTransform = true\n }\n\n if (this.root === this) this.nodes = new FlatTree()\n }\n\n addEventListener(name: LayoutEvents, handler: any) {\n if (!this.eventHandlers.has(name)) {\n this.eventHandlers.set(name, new SubscriptionManager())\n }\n\n return this.eventHandlers.get(name)!.add(handler)\n }\n\n notifyListeners(name: LayoutEvents, ...args: any) {\n const subscriptionManager = this.eventHandlers.get(name)\n subscriptionManager && subscriptionManager.notify(...args)\n }\n\n hasListeners(name: LayoutEvents) {\n return this.eventHandlers.has(name)\n }\n\n /**\n * Lifecycles\n */\n mount(instance: I) {\n if (this.instance) return\n\n this.isSVG = isSVGElement(instance) && !isSVGSVGElement(instance)\n\n this.instance = instance\n\n const { layoutId, layout, visualElement } = this.options\n if (visualElement && !visualElement.current) {\n visualElement.mount(instance)\n }\n\n this.root.nodes!.add(this)\n this.parent && this.parent.children.add(this)\n\n if (this.root.hasTreeAnimated && (layout || layoutId)) {\n this.isLayoutDirty = true\n }\n\n if (attachResizeListener) {\n let cancelDelay: VoidFunction\n let innerWidth = 0\n\n const resizeUnblockUpdate = () =>\n (this.root.updateBlockedByResize = false)\n\n // Set initial innerWidth in a frame.read callback to batch the read\n frame.read(() => {\n innerWidth = window.innerWidth\n })\n\n attachResizeListener(instance, () => {\n const newInnerWidth = window.innerWidth\n if (newInnerWidth === innerWidth) return\n\n innerWidth = newInnerWidth\n\n this.root.updateBlockedByResize = true\n\n cancelDelay && cancelDelay()\n cancelDelay = delay(resizeUnblockUpdate, 250)\n\n if (globalProjectionState.hasAnimatedSinceResize) {\n globalProjectionState.hasAnimatedSinceResize = false\n this.nodes!.forEach(finishAnimation)\n }\n })\n }\n\n if (layoutId) {\n this.root.registerSharedNode(layoutId, this)\n }\n\n // Only register the handler if it requires layout animation\n if (\n this.options.animate !== false &&\n visualElement &&\n (layoutId || layout)\n ) {\n this.addEventListener(\n \"didUpdate\",\n ({\n delta,\n hasLayoutChanged,\n hasRelativeLayoutChanged,\n layout: newLayout,\n }: LayoutUpdateData) => {\n if (this.isTreeAnimationBlocked()) {\n this.target = undefined\n this.relativeTarget = undefined\n return\n }\n\n // TODO: Check here if an animation exists\n const layoutTransition =\n this.options.transition ||\n visualElement.getDefaultTransition() ||\n defaultLayoutTransition\n\n const {\n onLayoutAnimationStart,\n onLayoutAnimationComplete,\n } = visualElement.getProps()\n\n /**\n * The target layout of the element might stay the same,\n * but its position relative to its parent has changed.\n */\n const hasTargetChanged =\n !this.targetLayout ||\n !boxEqualsRounded(this.targetLayout, newLayout)\n /*\n * Note: Disabled to fix relative animations always triggering new\n * layout animations. If this causes further issues, we can try\n * a different approach to detecting relative target changes.\n */\n // || hasRelativeLayoutChanged\n\n /**\n * If the layout hasn't seemed to have changed, it might be that the\n * element is visually in the same place in the document but its position\n * relative to its parent has indeed changed. So here we check for that.\n */\n const hasOnlyRelativeTargetChanged =\n !hasLayoutChanged && hasRelativeLayoutChanged\n\n if (\n this.options.layoutRoot ||\n this.resumeFrom ||\n hasOnlyRelativeTargetChanged ||\n (hasLayoutChanged &&\n (hasTargetChanged || !this.currentAnimation))\n ) {\n if (this.resumeFrom) {\n this.resumingFrom = this.resumeFrom\n this.resumingFrom.resumingFrom = undefined\n }\n\n const animationOptions = {\n ...getValueTransition(\n layoutTransition,\n \"layout\"\n ),\n onPlay: onLayoutAnimationStart,\n onComplete: onLayoutAnimationComplete,\n }\n\n if (\n visualElement.shouldReduceMotion ||\n this.options.layoutRoot\n ) {\n animationOptions.delay = 0\n animationOptions.type = false\n }\n\n this.startAnimation(animationOptions)\n /**\n * Set animation origin after starting animation to avoid layout jump\n * caused by stopping previous layout animation\n */\n this.setAnimationOrigin(\n delta,\n hasOnlyRelativeTargetChanged,\n (animationOptions as { path?: MotionPath })\n .path\n )\n } else {\n /**\n * If the layout hasn't changed and we have an animation that hasn't started yet,\n * finish it immediately. Otherwise it will be animating from a location\n * that was probably never committed to screen and look like a jumpy box.\n */\n\n if (!hasLayoutChanged) {\n finishAnimation(this)\n }\n\n if (this.isLead() && this.options.onExitComplete) {\n this.options.onExitComplete()\n }\n }\n\n this.targetLayout = newLayout\n }\n )\n }\n }\n\n unmount() {\n this.options.layoutId && this.willUpdate()\n this.root.nodes!.remove(this)\n const stack = this.getStack()\n stack && stack.remove(this)\n this.parent && this.parent.children.delete(this)\n this.instance = undefined\n this.eventHandlers.clear()\n\n cancelFrame(this.updateProjection)\n }\n\n // only on the root\n blockUpdate() {\n this.updateManuallyBlocked = true\n }\n\n unblockUpdate() {\n this.updateManuallyBlocked = false\n }\n\n isUpdateBlocked() {\n return this.updateManuallyBlocked || this.updateBlockedByResize\n }\n\n isTreeAnimationBlocked() {\n return (\n this.isAnimationBlocked ||\n (this.parent && this.parent.isTreeAnimationBlocked()) ||\n false\n )\n }\n\n // Note: currently only running on root node\n startUpdate() {\n if (this.isUpdateBlocked()) return\n\n this.isUpdating = true\n\n this.nodes && this.nodes.forEach(resetSkewAndRotation)\n this.animationId++\n }\n\n getTransformTemplate() {\n const { visualElement } = this.options\n return visualElement && visualElement.getProps().transformTemplate\n }\n\n willUpdate(shouldNotifyListeners = true) {\n this.root.hasTreeAnimated = true\n\n if (this.root.isUpdateBlocked()) {\n this.options.onExitComplete && this.options.onExitComplete()\n return\n }\n\n /**\n * If we're running optimised appear animations then these must be\n * cancelled before measuring the DOM. This is so we can measure\n * the true layout of the element rather than the WAAPI animation\n * which will be unaffected by the resetSkewAndRotate step.\n *\n * Note: This is a DOM write. Worst case scenario is this is sandwiched\n * between other snapshot reads which will cause unnecessary style recalculations.\n * This has to happen here though, as we don't yet know which nodes will need\n * snapshots in startUpdate(), but we only want to cancel optimised animations\n * if a layout animation measurement is actually going to be affected by them.\n */\n if (\n window.MotionCancelOptimisedAnimation &&\n !this.hasCheckedOptimisedAppear\n ) {\n cancelTreeOptimisedTransformAnimations(this)\n }\n\n !this.root.isUpdating && this.root.startUpdate()\n\n if (this.isLayoutDirty) return\n\n this.isLayoutDirty = true\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i]\n node.shouldResetTransform = true\n\n /**\n * Percentage translates resolve against layoutBox dimensions,\n * so ancestors with them must be re-measured after transform reset.\n */\n if (\n typeof node.latestValues.x === \"string\" ||\n typeof node.latestValues.y === \"string\"\n ) {\n node.isLayoutDirty = true\n }\n\n node.updateScroll(\"snapshot\")\n\n if (node.options.layoutRoot) {\n node.willUpdate(false)\n }\n }\n\n const { layoutId, layout } = this.options\n if (layoutId === undefined && !layout) return\n\n const transformTemplate = this.getTransformTemplate()\n this.prevTransformTemplateValue = transformTemplate\n ? transformTemplate(this.latestValues, \"\")\n : undefined\n\n this.updateSnapshot()\n shouldNotifyListeners && this.notifyListeners(\"willUpdate\")\n }\n\n // Note: Currently only running on root node\n updateScheduled = false\n\n update() {\n this.updateScheduled = false\n\n const updateWasBlocked = this.isUpdateBlocked()\n\n // When doing an instant transition, we skip the layout update,\n // but should still clean up the measurements so that the next\n // snapshot could be taken correctly.\n if (updateWasBlocked) {\n const wasBlockedByResize = this.updateBlockedByResize\n\n this.unblockUpdate()\n this.updateBlockedByResize = false\n this.clearAllSnapshots()\n\n /**\n * When blocked by resize, still measure layouts so\n * callbacks like onLayoutMeasure fire (e.g. Reorder).\n * Skip notifyLayoutUpdate to prevent animations.\n */\n if (wasBlockedByResize) {\n this.nodes!.forEach(forceLayoutMeasure)\n }\n\n this.nodes!.forEach(clearMeasurements)\n return\n }\n\n /**\n * If this is a repeat of didUpdate then ignore the animation.\n */\n if (this.animationId <= this.animationCommitId) {\n this.nodes!.forEach(clearIsLayoutDirty)\n return\n }\n\n this.animationCommitId = this.animationId\n\n if (!this.isUpdating) {\n this.nodes!.forEach(clearIsLayoutDirty)\n } else {\n this.isUpdating = false\n\n /**\n * Ensure animation-blocked nodes (e.g. during drag)\n * get measured even when memoized (willUpdate skipped).\n */\n this.nodes!.forEach(ensureDraggedNodesSnapshotted)\n\n /**\n * Write\n */\n this.nodes!.forEach(resetTransformStyle)\n\n /**\n * Read ==================\n */\n // Update layout measurements of updated children\n this.nodes!.forEach(updateLayout)\n\n /**\n * Write\n */\n // Notify listeners that the layout is updated\n this.nodes!.forEach(notifyLayoutUpdate)\n }\n\n this.clearAllSnapshots()\n\n /**\n * Manually flush any pending updates. Ideally\n * we could leave this to the following requestAnimationFrame but this seems\n * to leave a flash of incorrectly styled content.\n */\n const now = time.now()\n frameData.delta = clamp(0, 1000 / 60, now - frameData.timestamp)\n frameData.timestamp = now\n frameData.isProcessing = true\n frameSteps.update.process(frameData)\n frameSteps.preRender.process(frameData)\n frameSteps.render.process(frameData)\n frameData.isProcessing = false\n }\n\n scheduleUpdate = () => this.update()\n\n didUpdate() {\n if (!this.updateScheduled) {\n this.updateScheduled = true\n microtask.read(this.scheduleUpdate)\n }\n }\n\n clearAllSnapshots() {\n this.nodes!.forEach(clearSnapshot)\n this.sharedNodes.forEach(removeLeadSnapshots)\n }\n\n projectionUpdateScheduled = false\n scheduleUpdateProjection() {\n if (!this.projectionUpdateScheduled) {\n this.projectionUpdateScheduled = true\n frame.preRender(this.updateProjection, false, true)\n }\n }\n\n scheduleCheckAfterUnmount() {\n /**\n * If the unmounting node is in a layoutGroup and did trigger a willUpdate,\n * we manually call didUpdate to give a chance to the siblings to animate.\n * Otherwise, cleanup all snapshots to prevents future nodes from reusing them.\n */\n frame.postRender(() => {\n if (this.isLayoutDirty) {\n this.root.didUpdate()\n } else {\n this.root.checkUpdateFailed()\n }\n })\n }\n\n checkUpdateFailed = () => {\n if (this.isUpdating) {\n this.isUpdating = false\n this.clearAllSnapshots()\n }\n }\n\n /**\n * This is a multi-step process as shared nodes might be of different depths. Nodes\n * are sorted by depth order, so we need to resolve the entire tree before moving to\n * the next step.\n */\n updateProjection = () => {\n this.projectionUpdateScheduled = false\n\n /**\n * Reset debug counts. Manually resetting rather than creating a new\n * object each frame.\n */\n if (statsBuffer.value) {\n metrics.nodes =\n metrics.calculatedTargetDeltas =\n metrics.calculatedProjections =\n 0\n }\n\n this.nodes!.forEach(propagateDirtyNodes)\n this.nodes!.forEach(resolveTargetDelta)\n this.nodes!.forEach(calcProjection)\n this.nodes!.forEach(cleanDirtyNodes)\n\n if (statsBuffer.addProjectionMetrics) {\n statsBuffer.addProjectionMetrics(metrics)\n }\n }\n\n /**\n * Update measurements\n */\n updateSnapshot() {\n if (this.snapshot || !this.instance) return\n\n this.snapshot = this.measure()\n\n if (\n this.snapshot &&\n !calcLength(this.snapshot.measuredBox.x) &&\n !calcLength(this.snapshot.measuredBox.y)\n ) {\n this.snapshot = undefined\n }\n }\n\n updateLayout() {\n if (!this.instance) return\n\n this.updateScroll()\n\n if (\n !(this.options.alwaysMeasureLayout && this.isLead()) &&\n !this.isLayoutDirty\n ) {\n return\n }\n\n /**\n * When a node is mounted, it simply resumes from the prevLead's\n * snapshot instead of taking a new one, but the ancestors scroll\n * might have updated while the prevLead is unmounted. We need to\n * update the scroll again to make sure the layout we measure is\n * up to date.\n */\n if (this.resumeFrom && !this.resumeFrom.instance) {\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i]\n node.updateScroll()\n }\n }\n\n const prevLayout = this.layout\n this.layout = this.measure(false)\n this.layoutVersion++\n if (!this.layoutCorrected) this.layoutCorrected = createBox()\n this.isLayoutDirty = false\n this.projectionDelta = undefined\n this.notifyListeners(\"measure\", this.layout.layoutBox)\n\n const { visualElement } = this.options\n visualElement &&\n visualElement.notify(\n \"LayoutMeasure\",\n this.layout.layoutBox,\n prevLayout ? prevLayout.layoutBox : undefined\n )\n }\n\n updateScroll(phase: Phase = \"measure\") {\n let needsMeasurement = Boolean(\n this.options.layoutScroll && this.instance\n )\n\n if (\n this.scroll &&\n this.scroll.animationId === this.root.animationId &&\n this.scroll.phase === phase\n ) {\n needsMeasurement = false\n }\n\n if (needsMeasurement && this.instance) {\n const isRoot = checkIsScrollRoot(this.instance)\n this.scroll = {\n animationId: this.root.animationId,\n phase,\n isRoot,\n offset: measureScroll(this.instance),\n wasRoot: this.scroll ? this.scroll.isRoot : isRoot,\n }\n }\n }\n\n resetTransform() {\n if (!resetTransform) return\n\n const isResetRequested =\n this.isLayoutDirty ||\n this.shouldResetTransform ||\n this.options.alwaysMeasureLayout\n\n const hasProjection =\n this.projectionDelta && !isDeltaZero(this.projectionDelta)\n\n const transformTemplate = this.getTransformTemplate()\n const transformTemplateValue = transformTemplate\n ? transformTemplate(this.latestValues, \"\")\n : undefined\n\n const transformTemplateHasChanged =\n transformTemplateValue !== this.prevTransformTemplateValue\n\n if (\n isResetRequested &&\n this.instance &&\n (hasProjection ||\n hasTransform(this.latestValues) ||\n transformTemplateHasChanged)\n ) {\n resetTransform(this.instance, transformTemplateValue)\n this.shouldResetTransform = false\n this.scheduleRender()\n }\n }\n\n measure(removeTransform = true) {\n const pageBox = this.measurePageBox()\n\n let layoutBox = this.removeElementScroll(pageBox)\n\n /**\n * Measurements taken during the pre-render stage\n * still have transforms applied so we remove them\n * via calculation.\n */\n if (removeTransform) {\n layoutBox = this.removeTransform(layoutBox)\n }\n\n roundBox(layoutBox)\n\n return {\n animationId: this.root.animationId,\n measuredBox: pageBox,\n layoutBox,\n latestValues: {},\n source: this.id,\n }\n }\n\n measurePageBox() {\n const { visualElement } = this.options\n if (!visualElement) return createBox()\n\n const box = visualElement.measureViewportBox()\n\n const wasInScrollRoot =\n this.scroll?.wasRoot || this.path.some(checkNodeWasScrollRoot)\n\n if (!wasInScrollRoot) {\n // Remove viewport scroll to give page-relative coordinates\n const { scroll } = this.root\n if (scroll) {\n translateAxis(box.x, scroll.offset.x)\n translateAxis(box.y, scroll.offset.y)\n }\n }\n\n return box\n }\n\n removeElementScroll(box: Box): Box {\n const boxWithoutScroll = createBox()\n copyBoxInto(boxWithoutScroll, box)\n\n if (this.scroll?.wasRoot) {\n return boxWithoutScroll\n }\n\n /**\n * Performance TODO: Keep a cumulative scroll offset down the tree\n * rather than loop back up the path.\n */\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i]\n const { scroll, options } = node\n\n if (node !== this.root && scroll && options.layoutScroll) {\n /**\n * If this is a new scroll root, we want to remove all previous scrolls\n * from the viewport box.\n */\n if (scroll.wasRoot) {\n copyBoxInto(boxWithoutScroll, box)\n }\n\n translateAxis(boxWithoutScroll.x, scroll.offset.x)\n translateAxis(boxWithoutScroll.y, scroll.offset.y)\n }\n }\n\n return boxWithoutScroll\n }\n\n applyTransform(box: Box, transformOnly = false, output?: Box): Box {\n const withTransforms = output || createBox()\n copyBoxInto(withTransforms, box)\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i]\n\n if (\n !transformOnly &&\n node.options.layoutScroll &&\n node.scroll &&\n node !== node.root\n ) {\n translateAxis(withTransforms.x, -node.scroll.offset.x)\n translateAxis(withTransforms.y, -node.scroll.offset.y)\n }\n\n if (!hasTransform(node.latestValues)) continue\n transformBox(\n withTransforms,\n node.latestValues,\n node.layout?.layoutBox\n )\n }\n\n if (hasTransform(this.latestValues)) {\n transformBox(\n withTransforms,\n this.latestValues,\n this.layout?.layoutBox\n )\n }\n\n return withTransforms\n }\n\n removeTransform(box: Box): Box {\n const boxWithoutTransform = createBox()\n copyBoxInto(boxWithoutTransform, box)\n\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i]\n if (!hasTransform(node.latestValues)) continue\n\n let sourceBox: Box | undefined\n\n if (node.instance) {\n hasScale(node.latestValues) && node.updateSnapshot()\n sourceBox = createBox()\n copyBoxInto(sourceBox, node.measurePageBox())\n }\n\n removeBoxTransforms(\n boxWithoutTransform,\n node.latestValues,\n node.snapshot?.layoutBox,\n sourceBox\n )\n }\n\n if (hasTransform(this.latestValues)) {\n removeBoxTransforms(boxWithoutTransform, this.latestValues)\n }\n\n return boxWithoutTransform\n }\n\n setTargetDelta(delta: Delta) {\n this.targetDelta = delta\n this.root.scheduleUpdateProjection()\n this.isProjectionDirty = true\n }\n\n setOptions(options: ProjectionNodeOptions) {\n this.options = {\n ...this.options,\n ...options,\n crossfade:\n options.crossfade !== undefined ? options.crossfade : true,\n }\n }\n\n clearMeasurements() {\n this.scroll = undefined\n this.layout = undefined\n this.snapshot = undefined\n this.prevTransformTemplateValue = undefined\n this.targetDelta = undefined\n this.target = undefined\n this.isLayoutDirty = false\n }\n\n forceRelativeParentToResolveTarget() {\n if (!this.relativeParent) return\n\n /**\n * If the parent target isn't up-to-date, force it to update.\n * This is an unfortunate de-optimisation as it means any updating relative\n * projection will cause all the relative parents to recalculate back\n * up the tree.\n */\n if (\n this.relativeParent.resolvedRelativeTargetAt !==\n frameData.timestamp\n ) {\n this.relativeParent.resolveTargetDelta(true)\n }\n }\n\n /**\n * Frame calculations\n */\n resolvedRelativeTargetAt: number = 0.0\n resolveTargetDelta(forceRecalculation = false) {\n /**\n * Once the dirty status of nodes has been spread through the tree, we also\n * need to check if we have a shared node of a different depth that has itself\n * been dirtied.\n */\n const lead = this.getLead()\n this.isProjectionDirty ||= lead.isProjectionDirty\n this.isTransformDirty ||= lead.isTransformDirty\n this.isSharedProjectionDirty ||= lead.isSharedProjectionDirty\n\n const isShared = Boolean(this.resumingFrom) || this !== lead\n\n /**\n * We don't use transform for this step of processing so we don't\n * need to check whether any nodes have changed transform.\n */\n const canSkip = !(\n forceRecalculation ||\n (isShared && this.isSharedProjectionDirty) ||\n this.isProjectionDirty ||\n this.parent?.isProjectionDirty ||\n this.attemptToResolveRelativeTarget ||\n this.root.updateBlockedByResize\n )\n\n if (canSkip) return\n\n const { layout, layoutId } = this.options\n\n /**\n * If we have no layout, we can't perform projection, so early return\n */\n if (!this.layout || !(layout || layoutId)) return\n\n this.resolvedRelativeTargetAt = frameData.timestamp\n\n const relativeParent = this.getClosestProjectingParent()\n\n if (\n relativeParent &&\n this.linkedParentVersion !== relativeParent.layoutVersion &&\n !relativeParent.options.layoutRoot\n ) {\n this.removeRelativeTarget()\n }\n\n /**\n * If we don't have a targetDelta but do have a layout, we can attempt to resolve\n * a relativeParent. This will allow a component to perform scale correction\n * even if no animation has started.\n */\n if (!this.targetDelta && !this.relativeTarget) {\n if (\n this.options.layoutAnchor !== false &&\n relativeParent &&\n relativeParent.layout\n ) {\n this.createRelativeTarget(\n relativeParent,\n this.layout.layoutBox,\n relativeParent.layout.layoutBox\n )\n } else {\n this.removeRelativeTarget()\n }\n }\n\n /**\n * If we have no relative target or no target delta our target isn't valid\n * for this frame.\n */\n if (!this.relativeTarget && !this.targetDelta) return\n\n /**\n * Lazy-init target data structure\n */\n if (!this.target) {\n this.target = createBox()\n this.targetWithTransforms = createBox()\n }\n\n /**\n * If we've got a relative box for this component, resolve it into a target relative to the parent.\n */\n if (\n this.relativeTarget &&\n this.relativeTargetOrigin &&\n this.relativeParent &&\n this.relativeParent.target\n ) {\n this.forceRelativeParentToResolveTarget()\n\n calcRelativeBox(\n this.target,\n this.relativeTarget,\n this.relativeParent.target,\n this.options.layoutAnchor || undefined\n )\n\n /**\n * If we've only got a targetDelta, resolve it into a target\n */\n } else if (this.targetDelta) {\n if (Boolean(this.resumingFrom)) {\n this.applyTransform(\n this.layout.layoutBox,\n false,\n this.target\n )\n } else {\n copyBoxInto(this.target, this.layout.layoutBox)\n }\n\n applyBoxDelta(this.target, this.targetDelta)\n } else {\n /**\n * If no target, use own layout as target\n */\n copyBoxInto(this.target, this.layout.layoutBox)\n }\n\n /**\n * If we've been told to attempt to resolve a relative target, do so.\n */\n if (this.attemptToResolveRelativeTarget) {\n this.attemptToResolveRelativeTarget = false\n\n if (\n this.options.layoutAnchor !== false &&\n relativeParent &&\n Boolean(relativeParent.resumingFrom) ===\n Boolean(this.resumingFrom) &&\n !relativeParent.options.layoutScroll &&\n relativeParent.target &&\n this.animationProgress !== 1\n ) {\n this.createRelativeTarget(\n relativeParent,\n this.target,\n relativeParent.target\n )\n } else {\n this.relativeParent = this.relativeTarget = undefined\n }\n }\n\n /**\n * Increase debug counter for resolved target deltas\n */\n if (statsBuffer.value) {\n metrics.calculatedTargetDeltas++\n }\n }\n\n getClosestProjectingParent() {\n if (\n !this.parent ||\n hasScale(this.parent.latestValues) ||\n has2DTranslate(this.parent.latestValues)\n ) {\n return undefined\n }\n\n if (this.parent.isProjecting()) {\n return this.parent\n } else {\n return this.parent.getClosestProjectingParent()\n }\n }\n\n isProjecting() {\n return Boolean(\n (this.relativeTarget ||\n this.targetDelta ||\n this.options.layoutRoot) &&\n this.layout\n )\n }\n\n linkedParentVersion: number = 0\n createRelativeTarget(\n relativeParent: IProjectionNode,\n layout: Box,\n parentLayout: Box\n ) {\n this.relativeParent = relativeParent\n this.linkedParentVersion = relativeParent.layoutVersion\n this.forceRelativeParentToResolveTarget()\n this.relativeTarget = createBox()\n this.relativeTargetOrigin = createBox()\n calcRelativePosition(\n this.relativeTargetOrigin,\n layout,\n parentLayout,\n this.options.layoutAnchor || undefined\n )\n\n copyBoxInto(this.relativeTarget, this.relativeTargetOrigin)\n }\n\n removeRelativeTarget() {\n this.relativeParent = this.relativeTarget = undefined\n }\n\n hasProjected: boolean = false\n\n calcProjection() {\n const lead = this.getLead()\n const isShared = Boolean(this.resumingFrom) || this !== lead\n\n let canSkip = true\n\n /**\n * If this is a normal layout animation and neither this node nor its nearest projecting\n * is dirty then we can't skip.\n */\n if (this.isProjectionDirty || this.parent?.isProjectionDirty) {\n canSkip = false\n }\n\n /**\n * If this is a shared layout animation and this node's shared projection is dirty then\n * we can't skip.\n */\n if (\n isShared &&\n (this.isSharedProjectionDirty || this.isTransformDirty)\n ) {\n canSkip = false\n }\n\n /**\n * If we have resolved the target this frame we must recalculate the\n * projection to ensure it visually represents the internal calculations.\n */\n if (this.resolvedRelativeTargetAt === frameData.timestamp) {\n canSkip = false\n }\n\n if (canSkip) return\n\n const { layout, layoutId } = this.options\n\n /**\n * If this section of the tree isn't animating we can\n * delete our target sources for the following frame.\n */\n this.isTreeAnimating = Boolean(\n (this.parent && this.parent.isTreeAnimating) ||\n this.currentAnimation ||\n this.pendingAnimation\n )\n if (!this.isTreeAnimating) {\n this.targetDelta = this.relativeTarget = undefined\n }\n\n if (!this.layout || !(layout || layoutId)) return\n\n /**\n * Reset the corrected box with the latest values from box, as we're then going\n * to perform mutative operations on it.\n */\n copyBoxInto(this.layoutCorrected, this.layout.layoutBox)\n\n /**\n * Record previous tree scales before updating.\n */\n const prevTreeScaleX = this.treeScale.x\n const prevTreeScaleY = this.treeScale.y\n /**\n * Apply all the parent deltas to this box to produce the corrected box. This\n * is the layout box, as it will appear on screen as a result of the transforms of its parents.\n */\n applyTreeDeltas(\n this.layoutCorrected,\n this.treeScale,\n this.path,\n isShared\n )\n\n /**\n * If this layer needs to perform scale correction but doesn't have a target,\n * use the layout as the target.\n */\n if (\n lead.layout &&\n !lead.target &&\n (this.treeScale.x !== 1 || this.treeScale.y !== 1)\n ) {\n lead.target = lead.layout.layoutBox\n lead.targetWithTransforms = createBox()\n }\n\n const { target } = lead\n\n if (!target) {\n /**\n * If we don't have a target to project into, but we were previously\n * projecting, we want to remove the stored transform and schedule\n * a render to ensure the elements reflect the removed transform.\n */\n if (this.prevProjectionDelta) {\n this.createProjectionDeltas()\n this.scheduleRender()\n }\n\n return\n }\n\n if (!this.projectionDelta || !this.prevProjectionDelta) {\n this.createProjectionDeltas()\n } else {\n copyAxisDeltaInto(\n this.prevProjectionDelta.x,\n this.projectionDelta.x\n )\n copyAxisDeltaInto(\n this.prevProjectionDelta.y,\n this.projectionDelta.y\n )\n }\n\n /**\n * Update the delta between the corrected box and the target box before user-set transforms were applied.\n * This will allow us to calculate the corrected borderRadius and boxShadow to compensate\n * for our layout reprojection, but still allow them to be scaled correctly by the user.\n * It might be that to simplify this we may want to accept that user-set scale is also corrected\n * and we wouldn't have to keep and calc both deltas, OR we could support a user setting\n * to allow people to choose whether these styles are corrected based on just the\n * layout reprojection or the final bounding box.\n */\n calcBoxDelta(\n this.projectionDelta!,\n this.layoutCorrected,\n target,\n this.latestValues\n )\n\n if (\n this.treeScale.x !== prevTreeScaleX ||\n this.treeScale.y !== prevTreeScaleY ||\n !axisDeltaEquals(\n this.projectionDelta!.x,\n this.prevProjectionDelta!.x\n ) ||\n !axisDeltaEquals(\n this.projectionDelta!.y,\n this.prevProjectionDelta!.y\n )\n ) {\n this.hasProjected = true\n this.scheduleRender()\n this.notifyListeners(\"projectionUpdate\", target)\n }\n\n /**\n * Increase debug counter for recalculated projections\n */\n if (statsBuffer.value) {\n metrics.calculatedProjections++\n }\n }\n\n isVisible = true\n hide() {\n this.isVisible = false\n // TODO: Schedule render\n }\n show() {\n this.isVisible = true\n // TODO: Schedule render\n }\n\n scheduleRender(notifyAll = true) {\n this.options.visualElement?.scheduleRender()\n if (notifyAll) {\n const stack = this.getStack()\n stack && stack.scheduleRender()\n }\n if (this.resumingFrom && !this.resumingFrom.instance) {\n this.resumingFrom = undefined\n }\n }\n\n createProjectionDeltas() {\n this.prevProjectionDelta = createDelta()\n this.projectionDelta = createDelta()\n this.projectionDeltaWithTransform = createDelta()\n }\n\n /**\n * Animation\n */\n animationValues?: ResolvedValues\n pendingAnimation?: Process\n currentAnimation?: JSAnimation\n mixTargetDelta: (progress: number) => void\n animationProgress = 0\n\n setAnimationOrigin(\n delta: Delta,\n hasOnlyRelativeTargetChanged: boolean = false,\n pathFn?: MotionPath\n ) {\n const snapshot = this.snapshot\n const snapshotLatestValues = snapshot ? snapshot.latestValues : {}\n const mixedValues = { ...this.latestValues }\n\n const targetDelta = createDelta()\n if (\n !this.relativeParent ||\n !this.relativeParent.options.layoutRoot\n ) {\n this.relativeTarget = this.relativeTargetOrigin = undefined\n }\n this.attemptToResolveRelativeTarget = !hasOnlyRelativeTargetChanged\n\n const relativeLayout = createBox()\n\n const snapshotSource = snapshot ? snapshot.source : undefined\n const layoutSource = this.layout ? this.layout.source : undefined\n const isSharedLayoutAnimation = snapshotSource !== layoutSource\n const stack = this.getStack()\n const isOnlyMember = !stack || stack.members.length <= 1\n const shouldCrossfadeOpacity = Boolean(\n isSharedLayoutAnimation &&\n !isOnlyMember &&\n this.options.crossfade === true &&\n !this.path.some(hasOpacityCrossfade)\n )\n\n this.animationProgress = 0\n\n let prevRelativeTarget: Box\n\n // The path decides whether the layout shift is worth curving\n // (distance floor) and resolves the interpolator from the delta.\n const interpolate: PathInterpolator | undefined =\n pathFn?.interpolateProjection(delta)\n\n this.mixTargetDelta = (latest: number) => {\n const progress = latest / 1000\n const point = interpolate?.(progress)\n\n if (point) {\n targetDelta.x.translate = point.x\n targetDelta.x.scale = mixNumber(delta.x.scale, 1, progress)\n targetDelta.x.origin = delta.x.origin\n targetDelta.x.originPoint = delta.x.originPoint\n targetDelta.y.translate = point.y\n targetDelta.y.scale = mixNumber(delta.y.scale, 1, progress)\n targetDelta.y.origin = delta.y.origin\n targetDelta.y.originPoint = delta.y.originPoint\n } else {\n mixAxisDeltaLinear(targetDelta.x, delta.x, progress)\n mixAxisDeltaLinear(targetDelta.y, delta.y, progress)\n }\n\n this.setTargetDelta(targetDelta)\n\n if (\n this.relativeTarget &&\n this.relativeTargetOrigin &&\n this.layout &&\n this.relativeParent &&\n this.relativeParent.layout\n ) {\n calcRelativePosition(\n relativeLayout,\n this.layout.layoutBox,\n this.relativeParent.layout.layoutBox,\n this.options.layoutAnchor || undefined\n )\n mixBox(\n this.relativeTarget,\n this.relativeTargetOrigin,\n relativeLayout,\n progress\n )\n\n /**\n * If this is an unchanged relative target we can consider the\n * projection not dirty.\n */\n if (\n prevRelativeTarget &&\n boxEquals(this.relativeTarget, prevRelativeTarget)\n ) {\n this.isProjectionDirty = false\n }\n\n if (!prevRelativeTarget) prevRelativeTarget = createBox()\n copyBoxInto(prevRelativeTarget, this.relativeTarget)\n }\n\n if (isSharedLayoutAnimation) {\n this.animationValues = mixedValues\n\n mixValues(\n mixedValues,\n snapshotLatestValues,\n this.latestValues,\n progress,\n shouldCrossfadeOpacity,\n isOnlyMember\n )\n }\n\n if (point && point.rotate !== undefined) {\n // Dedicated `pathRotation` channel, not `rotate`, so an\n // animating `rotate` is composed with, never clobbered.\n if (!this.animationValues)\n this.animationValues = mixedValues\n this.animationValues.pathRotation = point.rotate\n }\n\n this.root.scheduleUpdateProjection()\n this.scheduleRender()\n\n this.animationProgress = progress\n }\n\n this.mixTargetDelta(this.options.layoutRoot ? 1000 : 0)\n }\n\n motionValue?: MotionValue\n startAnimation(options: ValueAnimationOptions) {\n this.notifyListeners(\"animationStart\")\n\n this.currentAnimation?.stop()\n this.resumingFrom?.currentAnimation?.stop()\n\n if (this.pendingAnimation) {\n cancelFrame(this.pendingAnimation)\n this.pendingAnimation = undefined\n }\n\n /**\n * Start the animation in the next frame to have a frame with progress 0,\n * where the target is the same as when the animation started, so we can\n * calculate the relative positions correctly for instant transitions.\n */\n this.pendingAnimation = frame.update(() => {\n globalProjectionState.hasAnimatedSinceResize = true\n\n this.motionValue ||= motionValue(0)\n this.motionValue.jump(0, false)\n\n this.currentAnimation = animateSingleValue(\n this.motionValue,\n [0, 1000],\n {\n ...(options as any),\n velocity: 0,\n isSync: true,\n onUpdate: (latest: number) => {\n this.mixTargetDelta(latest)\n options.onUpdate && options.onUpdate(latest)\n },\n onComplete: () => {\n options.onComplete && options.onComplete()\n this.completeAnimation()\n },\n }\n ) as JSAnimation\n\n if (this.resumingFrom) {\n this.resumingFrom.currentAnimation = this.currentAnimation\n }\n\n this.pendingAnimation = undefined\n })\n }\n\n completeAnimation() {\n if (this.resumingFrom) {\n this.resumingFrom.currentAnimation = undefined\n this.resumingFrom.preserveOpacity = undefined\n }\n\n const stack = this.getStack()\n stack && stack.exitAnimationComplete()\n this.resumingFrom =\n this.currentAnimation =\n this.animationValues =\n undefined\n\n this.notifyListeners(\"animationComplete\")\n }\n\n finishAnimation() {\n if (this.currentAnimation) {\n this.mixTargetDelta && this.mixTargetDelta(animationTarget)\n this.currentAnimation.stop()\n }\n\n this.completeAnimation()\n }\n\n applyTransformsToTarget() {\n const lead = this.getLead()\n let { targetWithTransforms, target, layout, latestValues } = lead\n\n if (!targetWithTransforms || !target || !layout) return\n\n /**\n * If we're only animating position, and this element isn't the lead element,\n * then instead of projecting into the lead box we instead want to calculate\n * a new target that aligns the two boxes but maintains the layout shape.\n */\n if (\n this !== lead &&\n this.layout &&\n layout &&\n shouldAnimatePositionOnly(\n this.options.animationType,\n this.layout.layoutBox,\n layout.layoutBox\n )\n ) {\n target = this.target || createBox()\n\n const xLength = calcLength(this.layout!.layoutBox.x)\n target!.x.min = lead.target!.x.min\n target!.x.max = target.x.min + xLength\n\n const yLength = calcLength(this.layout!.layoutBox.y)\n target!.y.min = lead.target!.y.min\n target!.y.max = target.y.min + yLength\n }\n\n copyBoxInto(targetWithTransforms, target)\n\n /**\n * Apply the latest user-set transforms to the targetBox to produce the targetBoxFinal.\n * This is the final box that we will then project into by calculating a transform delta and\n * applying it to the corrected box.\n */\n transformBox(targetWithTransforms, latestValues)\n\n /**\n * Update the delta between the corrected box and the final target box, after\n * user-set transforms are applied to it. This will be used by the renderer to\n * create a transform style that will reproject the element from its layout layout\n * into the desired bounding box.\n */\n calcBoxDelta(\n this.projectionDeltaWithTransform!,\n this.layoutCorrected,\n targetWithTransforms!,\n latestValues\n )\n }\n\n /**\n * Shared layout\n */\n // TODO Only running on root node\n sharedNodes: Map = new Map()\n registerSharedNode(layoutId: string, node: IProjectionNode) {\n if (!this.sharedNodes.has(layoutId)) {\n this.sharedNodes.set(layoutId, new NodeStack())\n }\n\n const stack = this.sharedNodes.get(layoutId)!\n stack.add(node)\n\n const config = node.options.initialPromotionConfig\n node.promote({\n transition: config ? config.transition : undefined,\n preserveFollowOpacity:\n config && config.shouldPreserveFollowOpacity\n ? config.shouldPreserveFollowOpacity(node)\n : undefined,\n })\n }\n\n isLead(): boolean {\n const stack = this.getStack()\n return stack ? stack.lead === this : true\n }\n\n getLead() {\n const { layoutId } = this.options\n return layoutId ? this.getStack()?.lead || this : this\n }\n\n getPrevLead() {\n const { layoutId } = this.options\n return layoutId ? this.getStack()?.prevLead : undefined\n }\n\n getStack() {\n const { layoutId } = this.options\n if (layoutId) return this.root.sharedNodes.get(layoutId)\n }\n\n promote({\n needsReset,\n transition,\n preserveFollowOpacity,\n }: {\n needsReset?: boolean\n transition?: Transition\n preserveFollowOpacity?: boolean\n } = {}) {\n const stack = this.getStack()\n if (stack) stack.promote(this, preserveFollowOpacity)\n\n if (needsReset) {\n this.projectionDelta = undefined\n this.needsReset = true\n }\n if (transition) this.setOptions({ transition })\n }\n\n relegate(): boolean {\n const stack = this.getStack()\n if (stack) {\n return stack.relegate(this)\n } else {\n return false\n }\n }\n\n resetSkewAndRotation() {\n const { visualElement } = this.options\n\n if (!visualElement) return\n\n // If there's no detected skew or rotation values, we can early return without a forced render.\n let hasDistortingTransform = false\n\n /**\n * An unrolled check for rotation values. Most elements don't have any rotation and\n * skipping the nested loop and new object creation is 50% faster.\n */\n const { latestValues } = visualElement\n if (\n latestValues.z ||\n latestValues.rotate ||\n latestValues.rotateX ||\n latestValues.rotateY ||\n latestValues.rotateZ ||\n latestValues.skewX ||\n latestValues.skewY\n ) {\n hasDistortingTransform = true\n }\n\n // If there's no distorting values, we don't need to do any more.\n if (!hasDistortingTransform) return\n\n const resetValues: ResolvedValues = {}\n\n if (latestValues.z) {\n resetDistortingTransform(\n \"z\",\n visualElement,\n resetValues,\n this.animationValues\n )\n }\n\n // Check the skew and rotate value of all axes and reset to 0\n for (let i = 0; i < transformAxes.length; i++) {\n resetDistortingTransform(\n `rotate${transformAxes[i]}`,\n visualElement,\n resetValues,\n this.animationValues\n )\n resetDistortingTransform(\n `skew${transformAxes[i]}`,\n visualElement,\n resetValues,\n this.animationValues\n )\n }\n\n // Force a render of this element to apply the transform with all skews and rotations\n // set to 0.\n visualElement.render()\n\n // Put back all the values we reset\n for (const key in resetValues) {\n visualElement.setStaticValue(key, resetValues[key])\n if (this.animationValues) {\n this.animationValues[key] = resetValues[key]\n }\n }\n\n // Schedule a render for the next frame. This ensures we won't visually\n // see the element with the reset rotate value applied.\n visualElement.scheduleRender()\n }\n\n applyProjectionStyles(\n targetStyle: any, // CSSStyleDeclaration - doesn't allow numbers to be assigned to properties\n styleProp?: MotionStyle\n ) {\n if (!this.instance || this.isSVG) return\n\n if (!this.isVisible) {\n targetStyle.visibility = \"hidden\"\n return\n }\n\n const transformTemplate = this.getTransformTemplate()\n\n if (this.needsReset) {\n this.needsReset = false\n\n targetStyle.visibility = \"\"\n targetStyle.opacity = \"\"\n targetStyle.pointerEvents =\n resolveMotionValue(styleProp?.pointerEvents) || \"\"\n targetStyle.transform = transformTemplate\n ? transformTemplate(this.latestValues, \"\")\n : \"none\"\n return\n }\n\n const lead = this.getLead()\n if (!this.projectionDelta || !this.layout || !lead.target) {\n if (this.options.layoutId) {\n targetStyle.opacity =\n this.latestValues.opacity !== undefined\n ? this.latestValues.opacity\n : 1\n targetStyle.pointerEvents =\n resolveMotionValue(styleProp?.pointerEvents) || \"\"\n }\n if (this.hasProjected && !hasTransform(this.latestValues)) {\n targetStyle.transform = transformTemplate\n ? transformTemplate({}, \"\")\n : \"none\"\n this.hasProjected = false\n }\n\n return\n }\n\n targetStyle.visibility = \"\"\n\n const valuesToRender = lead.animationValues || lead.latestValues\n this.applyTransformsToTarget()\n\n let transform = buildProjectionTransform(\n this.projectionDeltaWithTransform!,\n this.treeScale,\n valuesToRender\n )\n\n if (transformTemplate) {\n transform = transformTemplate(valuesToRender, transform)\n }\n\n targetStyle.transform = transform\n\n const { x, y } = this.projectionDelta\n targetStyle.transformOrigin = `${x.origin * 100}% ${\n y.origin * 100\n }% 0`\n\n if (lead.animationValues) {\n /**\n * If the lead component is animating, assign this either the entering/leaving\n * opacity\n */\n targetStyle.opacity =\n lead === this\n ? valuesToRender.opacity ??\n this.latestValues.opacity ??\n 1\n : this.preserveOpacity\n ? this.latestValues.opacity\n : valuesToRender.opacityExit\n } else {\n /**\n * Or we're not animating at all, set the lead component to its layout\n * opacity and other components to hidden.\n */\n targetStyle.opacity =\n lead === this\n ? valuesToRender.opacity !== undefined\n ? valuesToRender.opacity\n : \"\"\n : valuesToRender.opacityExit !== undefined\n ? valuesToRender.opacityExit\n : 0\n }\n\n /**\n * Apply scale correction\n */\n for (const key in scaleCorrectors) {\n if (valuesToRender[key] === undefined) continue\n\n const { correct, applyTo, isCSSVariable } = scaleCorrectors[key]\n\n /**\n * Only apply scale correction to the value if we have an\n * active projection transform. Otherwise these values become\n * vulnerable to distortion if the element changes size without\n * a corresponding layout animation.\n */\n const corrected =\n transform === \"none\"\n ? valuesToRender[key]\n : correct(valuesToRender[key], lead)\n\n if (applyTo) {\n const num = applyTo.length\n for (let i = 0; i < num; i++) {\n targetStyle[applyTo[i] as any] = corrected\n }\n } else {\n // If this is a CSS variable, set it directly on the instance.\n // Replacing this function from creating styles to setting them\n // would be a good place to remove per frame object creation\n if (isCSSVariable) {\n ;(\n this.options.visualElement as HTMLVisualElement\n ).renderState.vars[key] = corrected\n } else {\n targetStyle[key as any] = corrected\n }\n }\n }\n\n /**\n * Disable pointer events on follow components. This is to ensure\n * that if a follow component covers a lead component it doesn't block\n * pointer events on the lead.\n */\n if (this.options.layoutId) {\n targetStyle.pointerEvents =\n lead === this\n ? resolveMotionValue(styleProp?.pointerEvents) || \"\"\n : \"none\"\n }\n }\n\n clearSnapshot() {\n this.resumeFrom = this.snapshot = undefined\n }\n\n // Only run on root\n resetTree() {\n this.root.nodes!.forEach((node: IProjectionNode) =>\n node.currentAnimation?.stop()\n )\n this.root.nodes!.forEach(clearMeasurements)\n this.root.sharedNodes.clear()\n }\n }\n}\n\nfunction updateLayout(node: IProjectionNode) {\n node.updateLayout()\n}\n\nfunction notifyLayoutUpdate(node: IProjectionNode) {\n const snapshot = node.resumeFrom?.snapshot || node.snapshot\n\n if (\n node.isLead() &&\n node.layout &&\n snapshot &&\n node.hasListeners(\"didUpdate\")\n ) {\n const { layoutBox: layout, measuredBox: measuredLayout } = node.layout\n const { animationType } = node.options\n\n const isShared = snapshot.source !== node.layout.source\n\n // TODO Maybe we want to also resize the layout snapshot so we don't trigger\n // animations for instance if layout=\"size\" and an element has only changed position\n if (animationType === \"size\") {\n eachAxis((axis) => {\n const axisSnapshot = isShared\n ? snapshot.measuredBox[axis]\n : snapshot.layoutBox[axis]\n const length = calcLength(axisSnapshot)\n axisSnapshot.min = layout[axis].min\n axisSnapshot.max = axisSnapshot.min + length\n })\n } else if (animationType === \"x\" || animationType === \"y\") {\n const snapAxis = animationType === \"x\" ? \"y\" : \"x\"\n copyAxisInto(\n isShared\n ? snapshot.measuredBox[snapAxis]\n : snapshot.layoutBox[snapAxis],\n layout[snapAxis]\n )\n } else if (\n shouldAnimatePositionOnly(animationType, snapshot.layoutBox, layout)\n ) {\n eachAxis((axis) => {\n const axisSnapshot = isShared\n ? snapshot.measuredBox[axis]\n : snapshot.layoutBox[axis]\n const length = calcLength(layout[axis])\n axisSnapshot.max = axisSnapshot.min + length\n\n /**\n * Ensure relative target gets resized and rerendererd\n */\n if (node.relativeTarget && !node.currentAnimation) {\n node.isProjectionDirty = true\n node.relativeTarget[axis].max =\n node.relativeTarget[axis].min + length\n }\n })\n }\n\n const layoutDelta = createDelta()\n\n calcBoxDelta(layoutDelta, layout, snapshot.layoutBox)\n const visualDelta = createDelta()\n if (isShared) {\n calcBoxDelta(\n visualDelta,\n node.applyTransform(measuredLayout, true),\n snapshot.measuredBox\n )\n } else {\n calcBoxDelta(visualDelta, layout, snapshot.layoutBox)\n }\n\n const hasLayoutChanged = !isDeltaZero(layoutDelta)\n let hasRelativeLayoutChanged = false\n\n if (!node.resumeFrom) {\n const relativeParent = node.getClosestProjectingParent()\n\n /**\n * If the relativeParent is itself resuming from a different element then\n * the relative snapshot is not relavent\n */\n if (relativeParent && !relativeParent.resumeFrom) {\n const { snapshot: parentSnapshot, layout: parentLayout } =\n relativeParent\n\n if (parentSnapshot && parentLayout) {\n const anchor =\n node.options.layoutAnchor || undefined\n\n const relativeSnapshot = createBox()\n calcRelativePosition(\n relativeSnapshot,\n snapshot.layoutBox,\n parentSnapshot.layoutBox,\n anchor\n )\n\n const relativeLayout = createBox()\n calcRelativePosition(\n relativeLayout,\n layout,\n parentLayout.layoutBox,\n anchor\n )\n\n if (!boxEqualsRounded(relativeSnapshot, relativeLayout)) {\n hasRelativeLayoutChanged = true\n }\n\n if (relativeParent.options.layoutRoot) {\n node.relativeTarget = relativeLayout\n node.relativeTargetOrigin = relativeSnapshot\n node.relativeParent = relativeParent\n }\n }\n }\n }\n\n node.notifyListeners(\"didUpdate\", {\n layout,\n snapshot,\n delta: visualDelta,\n layoutDelta,\n hasLayoutChanged,\n hasRelativeLayoutChanged,\n })\n } else if (node.isLead()) {\n const { onExitComplete } = node.options\n onExitComplete && onExitComplete()\n }\n\n /**\n * Clearing transition\n * TODO: Investigate why this transition is being passed in as {type: false } from Framer\n * and why we need it at all\n */\n node.options.transition = undefined\n}\n\nexport function propagateDirtyNodes(node: IProjectionNode) {\n /**\n * Increase debug counter for nodes encountered this frame\n */\n if (statsBuffer.value) {\n metrics.nodes++\n }\n\n if (!node.parent) return\n\n /**\n * If this node isn't projecting, propagate isProjectionDirty. It will have\n * no performance impact but it will allow the next child that *is* projecting\n * but *isn't* dirty to just check its parent to see if *any* ancestor needs\n * correcting.\n */\n if (!node.isProjecting()) {\n node.isProjectionDirty = node.parent.isProjectionDirty\n }\n\n /**\n * Propagate isSharedProjectionDirty and isTransformDirty\n * throughout the whole tree. A future revision can take another look at\n * this but for safety we still recalcualte shared nodes.\n */\n node.isSharedProjectionDirty ||= Boolean(\n node.isProjectionDirty ||\n node.parent.isProjectionDirty ||\n node.parent.isSharedProjectionDirty\n )\n\n node.isTransformDirty ||= node.parent.isTransformDirty\n}\n\nexport function cleanDirtyNodes(node: IProjectionNode) {\n node.isProjectionDirty =\n node.isSharedProjectionDirty =\n node.isTransformDirty =\n false\n}\n\nfunction clearSnapshot(node: IProjectionNode) {\n node.clearSnapshot()\n}\n\nfunction clearMeasurements(node: IProjectionNode) {\n node.clearMeasurements()\n}\n\nfunction forceLayoutMeasure(node: IProjectionNode) {\n node.isLayoutDirty = true\n node.updateLayout()\n}\n\nfunction clearIsLayoutDirty(node: IProjectionNode) {\n node.isLayoutDirty = false\n}\n\n/**\n * When a node is animation-blocked (e.g. during drag) and its component\n * didn't re-render (memoized), willUpdate() is never called so there's\n * no snapshot. Use the previous layout as a snapshot and mark dirty so\n * resetTransform/updateLayout/notifyLayoutUpdate process it normally.\n */\nfunction ensureDraggedNodesSnapshotted(node: IProjectionNode) {\n if (node.isAnimationBlocked && node.layout && !node.isLayoutDirty) {\n node.snapshot = node.layout\n node.isLayoutDirty = true\n }\n}\n\nfunction resetTransformStyle(node: IProjectionNode) {\n const { visualElement } = node.options\n if (visualElement && visualElement.getProps().onBeforeLayoutMeasure) {\n visualElement.notify(\"BeforeLayoutMeasure\")\n }\n\n node.resetTransform()\n}\n\nfunction finishAnimation(node: IProjectionNode) {\n node.finishAnimation()\n node.targetDelta = node.relativeTarget = node.target = undefined\n node.isProjectionDirty = true\n}\n\nfunction resolveTargetDelta(node: IProjectionNode) {\n node.resolveTargetDelta()\n}\n\nfunction calcProjection(node: IProjectionNode) {\n node.calcProjection()\n}\n\nfunction resetSkewAndRotation(node: IProjectionNode) {\n node.resetSkewAndRotation()\n}\n\nfunction removeLeadSnapshots(stack: NodeStack) {\n stack.removeLeadSnapshot()\n}\n\nfunction mixAxisDeltaLinear(output: AxisDelta, delta: AxisDelta, p: number) {\n output.translate = mixNumber(delta.translate, 0, p)\n output.scale = mixNumber(delta.scale, 1, p)\n output.origin = delta.origin\n output.originPoint = delta.originPoint\n}\n\nexport function mixAxis(output: Axis, from: Axis, to: Axis, p: number) {\n output.min = mixNumber(from.min, to.min, p)\n output.max = mixNumber(from.max, to.max, p)\n}\n\nexport function mixBox(output: Box, from: Box, to: Box, p: number) {\n mixAxis(output.x, from.x, to.x, p)\n mixAxis(output.y, from.y, to.y, p)\n}\n\nfunction hasOpacityCrossfade(node: IProjectionNode) {\n return (\n node.animationValues && node.animationValues.opacityExit !== undefined\n )\n}\n\nconst defaultLayoutTransition = {\n duration: 0.45,\n ease: [0.4, 0, 0.1, 1],\n}\n\nconst userAgentContains = (string: string) =>\n typeof navigator !== \"undefined\" &&\n navigator.userAgent &&\n navigator.userAgent.toLowerCase().includes(string)\n\n/**\n * Measured bounding boxes must be rounded in Safari and\n * left untouched in Chrome, otherwise non-integer layouts within scaled-up elements\n * can appear to jump.\n */\nconst roundPoint =\n userAgentContains(\"applewebkit/\") && !userAgentContains(\"chrome/\")\n ? Math.round\n : noop\n\nfunction roundAxis(axis: Axis): void {\n // Round to the nearest .5 pixels to support subpixel layouts\n axis.min = roundPoint(axis.min)\n axis.max = roundPoint(axis.max)\n}\n\nfunction roundBox(box: Box): void {\n roundAxis(box.x)\n roundAxis(box.y)\n}\n\nfunction shouldAnimatePositionOnly(\n animationType: string | undefined,\n snapshot: Box,\n layout: Box\n) {\n return (\n animationType === \"position\" ||\n (animationType === \"preserve-aspect\" &&\n !isNear(aspectRatio(snapshot), aspectRatio(layout), 0.2))\n )\n}\n\nfunction checkNodeWasScrollRoot(node: IProjectionNode) {\n return node !== node.root && node.scroll?.wasRoot\n}\n","import { addDomEvent } from \"../../events/add-dom-event\"\nimport { createProjectionNode } from \"./create-projection-node\"\n\nexport const DocumentProjectionNode = createProjectionNode({\n attachResizeListener: (\n ref: Window | Element,\n notify: VoidFunction\n ): VoidFunction => addDomEvent(ref, \"resize\", notify),\n measureScroll: () => ({\n x: document.documentElement.scrollLeft || document.body?.scrollLeft || 0,\n y: document.documentElement.scrollTop || document.body?.scrollTop || 0,\n }),\n checkIsScrollRoot: () => true,\n})\n","import { IProjectionNode } from \"./types\"\n\nconst notify = (node: IProjectionNode) =>\n !node.isLayoutDirty && node.willUpdate(false)\n\nexport interface NodeGroup {\n add: (node: IProjectionNode) => void\n remove: (node: IProjectionNode) => void\n dirty: VoidFunction\n}\n\nexport function nodeGroup(): NodeGroup {\n const nodes = new Set()\n const subscriptions = new WeakMap void>()\n\n const dirtyAll = () => nodes.forEach(notify)\n\n return {\n add: (node) => {\n nodes.add(node)\n subscriptions.set(\n node,\n node.addEventListener(\"willUpdate\", dirtyAll)\n )\n },\n remove: (node) => {\n nodes.delete(node)\n const unsubscribe = subscriptions.get(node)\n if (unsubscribe) {\n unsubscribe()\n subscriptions.delete(node)\n }\n dirtyAll()\n },\n dirty: dirtyAll,\n }\n}\n","import { createProjectionNode } from \"./create-projection-node\"\nimport { DocumentProjectionNode } from \"./DocumentProjectionNode\"\nimport { IProjectionNode } from \"./types\"\n\nexport const rootProjectionNode: { current: IProjectionNode | undefined } = {\n current: undefined,\n}\n\nexport const HTMLProjectionNode = createProjectionNode({\n measureScroll: (instance) => ({\n x: instance.scrollLeft,\n y: instance.scrollTop,\n }),\n defaultParent: () => {\n if (!rootProjectionNode.current) {\n const documentNode = new DocumentProjectionNode({})\n documentNode.mount(window)\n documentNode.setOptions({ layoutScroll: true })\n rootProjectionNode.current = documentNode\n }\n return rootProjectionNode.current\n },\n resetTransform: (instance, value) => {\n instance.style.transform = value !== undefined ? value : \"none\"\n },\n checkIsScrollRoot: (instance) =>\n Boolean(window.getComputedStyle(instance).position === \"fixed\"),\n})\n","import { clamp } from \"motion-utils\"\nimport { GroupAnimation } from \"../animation/GroupAnimation\"\nimport type { AnimationOptions, Transition } from \"../animation/types\"\nimport { frameData, frameSteps } from \"../frameloop\"\nimport { microtask } from \"../frameloop/microtask\"\nimport { time } from \"../frameloop/sync-time\"\nimport { HTMLProjectionNode } from \"../projection/node/HTMLProjectionNode\"\nimport type { IProjectionNode } from \"../projection/node/types\"\nimport { HTMLVisualElement } from \"../render/html/HTMLVisualElement\"\nimport { visualElementStore } from \"../render/store\"\nimport { hasTransform } from \"../projection/utils/has-transform\"\nimport {\n resolveElements,\n type ElementOrSelector,\n} from \"../utils/resolve-elements\"\n\ntype LayoutAnimationScope = Element | Document\ntype LayoutBuilderResolve = (animation: GroupAnimation) => void\ntype LayoutBuilderReject = (error: unknown) => void\n\ninterface RestorePoint {\n parent: Element\n next: ChildNode | null\n}\n\nconst layoutSelector = \"[data-layout],[data-layout-id]\"\n\n/**\n * All imperatively-created projection nodes live in one persistent tree,\n * shared across animateLayout() calls (and with any React-created nodes,\n * via the singleton document root). Keyed by element for reuse.\n */\nconst layoutNodes = new WeakMap()\n\n/**\n * Builders created within the same synchronous tick are flushed together\n * as a single \"commit\": every node is snapshotted before any updateDom\n * runs, mirroring React batching renders from different parts of the tree.\n */\nlet pendingBuilders: LayoutAnimationBuilder[] | undefined\n\nfunction collectLayoutElements(scope: LayoutAnimationScope): HTMLElement[] {\n const elements: HTMLElement[] = []\n\n if (scope instanceof HTMLElement && scope.matches(layoutSelector)) {\n elements.push(scope)\n }\n\n scope.querySelectorAll(layoutSelector).forEach((element) => {\n if (element instanceof HTMLElement) elements.push(element)\n })\n\n return elements\n}\n\n/**\n * Process any work scheduled on the frameloop now. A previous animation\n * may have been seeked while paused (controls.time = x) without a frame\n * having rendered it - we must materialise that state into the DOM\n * before taking snapshots.\n */\nfunction flushPendingFrame() {\n if (frameData.isProcessing) return\n\n const now = time.now()\n frameData.delta = clamp(0, 1000 / 60, now - frameData.timestamp)\n frameData.timestamp = now\n frameData.isProcessing = true\n frameSteps.update.process(frameData)\n frameSteps.preRender.process(frameData)\n frameSteps.render.process(frameData)\n frameData.isProcessing = false\n}\n\nfunction getProjectionParent(element: Element): IProjectionNode | undefined {\n let ancestor = element.parentElement\n while (ancestor) {\n const node = layoutNodes.get(ancestor)\n if (node && node.instance) return node\n ancestor = ancestor.parentElement\n }\n return undefined\n}\n\nfunction createVisualElement() {\n return new HTMLVisualElement(\n {\n props: {},\n presenceContext: null,\n visualState: {\n latestValues: {},\n renderState: {\n transform: {},\n transformOrigin: {},\n style: {},\n vars: {},\n },\n },\n },\n { allowProjection: true }\n )\n}\n\nfunction readNodeOptions(element: HTMLElement, transition?: Transition) {\n const layoutAttr = element.getAttribute(\"data-layout\")\n const layoutId = element.getAttribute(\"data-layout-id\") ?? undefined\n\n return {\n layoutId,\n layout: layoutAttr !== null ? true : undefined,\n animationType: (!layoutAttr || layoutAttr === \"true\"\n ? \"both\"\n : layoutAttr) as \"both\",\n transition,\n }\n}\n\nfunction prepareNode(\n element: HTMLElement,\n transition?: Transition\n): IProjectionNode {\n let node = layoutNodes.get(element)\n\n if (!node) {\n let visualElement = visualElementStore.get(element) as\n | HTMLVisualElement\n | undefined\n\n if (!visualElement) visualElement = createVisualElement()\n\n /**\n * A first-time element may carry a projection transform in its\n * inline style (e.g. it was cloned from an element mid-animation).\n * That transform isn't tracked in latestValues so the engine can't\n * reset it before measuring - clear it now so the first layout\n * measurement isn't inflated.\n */\n if (\n element.style.transform &&\n !hasTransform(visualElement.latestValues)\n ) {\n element.style.transform = \"\"\n }\n\n node = new HTMLProjectionNode(\n visualElement.latestValues,\n getProjectionParent(element)\n )\n visualElement.projection = node\n\n node.setOptions({\n ...readNodeOptions(element, transition),\n visualElement,\n })\n node.mount(element)\n layoutNodes.set(element, node)\n } else {\n node.setOptions(readNodeOptions(element, transition))\n }\n\n node.isPresent = true\n if (node.options.onExitComplete) {\n node.setOptions({ onExitComplete: undefined })\n }\n\n return node\n}\n\nfunction sortDocumentOrder(elements: Iterable) {\n return [...elements].sort((a, b) =>\n a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1\n )\n}\n\nfunction dropNode(element: Element, node: IProjectionNode) {\n node.setOptions({ onExitComplete: undefined })\n\n /**\n * Stop any lingering animation so it can't leak into future updates.\n * A follow node can share its currentAnimation with a surviving lead\n * (via resumingFrom), in which case it isn't ours to stop.\n */\n const stack = node.getStack()\n if (!stack || node.isLead()) node.currentAnimation?.stop()\n\n node.unmount()\n layoutNodes.delete(element)\n}\n\nfunction flushPendingBuilders() {\n const builders = pendingBuilders!\n pendingBuilders = undefined\n\n flushPendingFrame()\n\n /**\n * Discover and mount every node across all builders before snapshotting\n * any of them. Mounting during an active update flags isLayoutDirty,\n * which would make that node's own willUpdate skip its snapshot.\n * Document order guarantees ancestors mount before descendants, even\n * when they're discovered by different builders.\n */\n const targets = new Map()\n for (const builder of builders) {\n for (const element of builder.collectTargets()) {\n const owners = targets.get(element)\n owners ? owners.push(builder) : targets.set(element, [builder])\n }\n }\n\n const union = new Map()\n for (const element of sortDocumentOrder(targets.keys())) {\n const owners = targets.get(element)!\n const node = prepareNode(\n element,\n owners[owners.length - 1].transitionFor(element)\n )\n for (const owner of owners) owner.adopt(element, node)\n union.set(element, node)\n }\n\n union.forEach((node) => {\n node.isLayoutDirty = false\n node.willUpdate()\n })\n\n const updatePromises: Promise[] = []\n for (const builder of builders) {\n const result = builder.runUpdate()\n if (result) updatePromises.push(result)\n }\n\n const commit = () => {\n /**\n * Process all additions before any removals so that, even across\n * builders, a removed member knows whether a replacement with the\n * same layoutId was added in this commit.\n */\n const newMemberIds = new Set()\n for (const builder of builders) {\n builder.reconcileAdditions(newMemberIds)\n }\n for (const builder of builders) {\n builder.reconcileRemovals(newMemberIds)\n }\n\n let root: IProjectionNode | undefined\n union.forEach((node) => (root ||= node.root))\n for (const builder of builders) root ||= builder.getRoot()\n\n root?.didUpdate()\n\n /**\n * The root flushes the update on a microtask, synchronously\n * processing the frame that creates the layout animations. Collect\n * them in a later microtask step of the same pass.\n */\n microtask.render(() => {\n for (const builder of builders) builder.finalize()\n })\n }\n\n updatePromises.length ? Promise.all(updatePromises).then(commit) : commit()\n}\n\nexport class LayoutAnimationBuilder {\n private sharedTransitions = new Map()\n\n private notifyReady: LayoutBuilderResolve = () => {}\n private rejectReady: LayoutBuilderReject = () => {}\n private readyPromise: Promise\n\n private tracked = new Map()\n private restorePoints = new Map()\n private updateError: unknown\n\n constructor(\n private scope: LayoutAnimationScope,\n private updateDom: () => void | Promise,\n private defaultOptions?: AnimationOptions\n ) {\n this.readyPromise = new Promise((resolve, reject) => {\n this.notifyReady = resolve\n this.rejectReady = reject\n })\n\n if (!pendingBuilders) {\n pendingBuilders = []\n queueMicrotask(flushPendingBuilders)\n }\n pendingBuilders.push(this)\n }\n\n shared(id: string, transition: AnimationOptions): this {\n this.sharedTransitions.set(id, transition)\n return this\n }\n\n then(resolve: LayoutBuilderResolve, reject?: LayoutBuilderReject) {\n return this.readyPromise.then(resolve, reject)\n }\n\n transitionFor(element: HTMLElement): Transition | undefined {\n const layoutId = element.getAttribute(\"data-layout-id\")\n return ((layoutId && this.sharedTransitions.get(layoutId)) ||\n this.defaultOptions) as Transition | undefined\n }\n\n adopt(element: HTMLElement, node: IProjectionNode) {\n this.tracked.set(element, node)\n this.restorePoints.set(element, {\n parent: element.parentElement!,\n next: element.nextSibling,\n })\n }\n\n collectTargets() {\n return collectLayoutElements(this.scope)\n }\n\n runUpdate(): Promise | undefined {\n try {\n const result = this.updateDom()\n if (result && typeof result.then === \"function\") {\n return result.then(undefined, (error: unknown) => {\n this.updateError = error\n })\n }\n } catch (error) {\n this.updateError = error\n }\n return undefined\n }\n\n reconcileAdditions(newMemberIds: Set) {\n for (const element of collectLayoutElements(this.scope)) {\n if (this.tracked.has(element)) continue\n const node = prepareNode(element, this.transitionFor(element))\n this.adopt(element, node)\n node.options.layoutId && newMemberIds.add(node.options.layoutId)\n }\n }\n\n reconcileRemovals(newMemberIds: Set) {\n this.tracked.forEach((node, element) => {\n if (element.isConnected) return\n\n const restore = this.restorePoints.get(element)\n this.restorePoints.delete(element)\n\n const { layoutId } = node.options\n const stack = node.getStack()\n const hasSurvivor =\n stack &&\n stack.members.some(\n (member) =>\n member !== node &&\n (member.instance as HTMLElement | undefined)\n ?.isConnected\n )\n\n /**\n * A removed lead with a surviving stack member - and no\n * replacement member added this commit - runs an exit\n * crossfade: restore the element to its old position in the\n * DOM, relegate it and let the survivor take over. It's\n * removed again once the animation completes.\n */\n if (\n layoutId &&\n node.isLead() &&\n hasSurvivor &&\n !newMemberIds.has(layoutId)\n ) {\n if (restore && restore.parent.isConnected) {\n restore.parent.insertBefore(\n element,\n restore.next && restore.next.parentNode === restore.parent\n ? restore.next\n : null\n )\n node.isPresent = false\n node.setOptions({\n onExitComplete: () => {\n element.remove()\n dropNode(element, node)\n },\n })\n if (node.relegate()) return\n\n element.remove()\n }\n }\n\n dropNode(element, node)\n this.tracked.delete(element)\n })\n }\n\n getRoot(): IProjectionNode | undefined {\n let root: IProjectionNode | undefined\n this.tracked.forEach((node) => (root ||= node.root))\n return root\n }\n\n finalize() {\n if (this.updateError) {\n this.rejectReady(this.updateError)\n return\n }\n\n const animations = new Set()\n this.tracked.forEach((node) => {\n if (node.instance && node.currentAnimation) {\n animations.add(node.currentAnimation)\n }\n })\n\n this.notifyReady(new GroupAnimation([...animations]))\n }\n}\n\nexport function parseAnimateLayoutArgs(\n scopeOrUpdateDom: ElementOrSelector | (() => void),\n updateDomOrOptions?: (() => void) | AnimationOptions,\n options?: AnimationOptions\n): {\n scope: Element | Document\n updateDom: () => void\n defaultOptions?: AnimationOptions\n} {\n if (typeof scopeOrUpdateDom === \"function\") {\n return {\n scope: document,\n updateDom: scopeOrUpdateDom,\n defaultOptions: updateDomOrOptions as AnimationOptions | undefined,\n }\n }\n\n const scope =\n scopeOrUpdateDom instanceof Document\n ? scopeOrUpdateDom\n : resolveElements(scopeOrUpdateDom)[0] ?? document\n\n return {\n scope,\n updateDom: updateDomOrOptions as () => void,\n defaultOptions: options,\n }\n}\n","import { cancelFrame, frame } from \".\"\nimport { stepsOrder } from \"./order\"\nimport { Process } from \"./types\"\n\n/**\n * @deprecated\n *\n * Import as `frame` instead.\n */\nexport const sync = frame\n\n/**\n * @deprecated\n *\n * Use cancelFrame(callback) instead.\n */\nexport const cancelSync = stepsOrder.reduce((acc, key) => {\n acc[key] = (process: Process) => cancelFrame(process)\n return acc\n}, {} as Record void>)\n"],"names":["MotionGlobalConfig","noop","clamp","alpha","alphaType","getAnimatableNone","mixNumber","warning","mixNumberImmediate","pipe","millisecondsToSeconds","secondsToMilliseconds","velocityPerSecond","spring","createSpring","invariant","progress","easeInOut","isEasingArray","easingDefinitionToFunction","keyframesGenerator","keyframes","memo","isBezierDefinition","anticipate","backInOut","circInOut","KeyframeResolver","DefaultKeyframeResolver","warnOnce","SubscriptionManager","wrap","isNumericalString","isZeroValueString","isObject","translateAlias","buildTransform","getComputedStyle","asNumber","removeItem","checkIsControllingVariants","checkIsVariantNode","scrapeMotionValuesFromProps","scrapeHTMLMotionValuesFromProps","circOut","calcProgress","motionValue","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AAK,EAAE,QAAQ;AACf,YAAA,SAAS,EAAE,gBAAgB;AAC3B,YAAA,cAAc,EAAE,kBAAkD;SACrE;IACL;AAEA,IAAA,MAAM,KAAK,GACP,gBAAgB,YAAY;AACxB,UAAE;UACA,eAAe,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,IAAI,QAAQ;IAE1D,OAAO;QACH,KAAK;AACL,QAAA,SAAS,EAAE,kBAAgC;AAC3C,QAAA,cAAc,EAAE,OAAO;KAC1B;AACL;;AC7bA;;;;AAIG;AACI,MAAM,IAAI,GAAG;AAEpB;;;;AAIG;AACI,MAAM,UAAU,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,KAAI;AACrD,IAAA,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,OAAgB,KAAK,WAAW,CAAC,OAAO,CAAC;AACrD,IAAA,OAAO,GAAG;AACd,CAAC,EAAE,EAAgD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.mjs b/node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.mjs new file mode 100644 index 0000000..ef66494 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.mjs @@ -0,0 +1,199 @@ +import { MotionGlobalConfig, noop } from 'motion-utils'; +import { time } from '../frameloop/sync-time.mjs'; +import { JSAnimation } from './JSAnimation.mjs'; +import { getFinalKeyframe } from './keyframes/get-final.mjs'; +import { KeyframeResolver, flushKeyframeResolvers } from './keyframes/KeyframesResolver.mjs'; +import { NativeAnimationExtended } from './NativeAnimationExtended.mjs'; +import { canAnimate } from './utils/can-animate.mjs'; +import { makeAnimationInstant } from './utils/make-animation-instant.mjs'; +import { WithPromise } from './utils/WithPromise.mjs'; +import { supportsBrowserAnimation } from './waapi/supports/waapi.mjs'; + +/** + * Maximum time allowed between an animation being created and it being + * resolved for us to use the latter as the start time. + * + * This is to ensure that while we prefer to "start" an animation as soon + * as it's triggered, we also want to avoid a visual jump if there's a big delay + * between these two moments. + */ +const MAX_RESOLVE_DELAY = 40; +class AsyncMotionValueAnimation extends WithPromise { + constructor({ autoplay = true, delay = 0, type = "keyframes", repeat = 0, repeatDelay = 0, repeatType = "loop", keyframes, name, motionValue, element, ...options }) { + super(); + /** + * Bound to support return animation.stop pattern + */ + this.stop = () => { + if (this._animation) { + this._animation.stop(); + this.stopTimeline?.(); + } + this.keyframeResolver?.cancel(); + }; + this.createdAt = time.now(); + const optionsWithDefaults = { + autoplay, + delay, + type, + repeat, + repeatDelay, + repeatType, + name, + motionValue, + element, + ...options, + }; + const KeyframeResolver$1 = element?.KeyframeResolver || KeyframeResolver; + this.keyframeResolver = new KeyframeResolver$1(keyframes, (resolvedKeyframes, finalKeyframe, forced) => this.onKeyframesResolved(resolvedKeyframes, finalKeyframe, optionsWithDefaults, !forced), name, motionValue, element); + this.keyframeResolver?.scheduleResolve(); + } + onKeyframesResolved(keyframes, finalKeyframe, options, sync) { + this.keyframeResolver = undefined; + const { name, type, velocity, delay, isHandoff, onUpdate } = options; + this.resolvedAt = time.now(); + /** + * If we can't animate this value with the resolved keyframes + * then we should complete it immediately. + */ + let canAnimateValue = true; + if (!canAnimate(keyframes, name, type, velocity)) { + canAnimateValue = false; + if (MotionGlobalConfig.instantAnimations || !delay) { + onUpdate?.(getFinalKeyframe(keyframes, options, finalKeyframe)); + } + keyframes[0] = keyframes[keyframes.length - 1]; + makeAnimationInstant(options); + options.repeat = 0; + } + /** + * Resolve startTime for the animation. + * + * This method uses the createdAt and resolvedAt to calculate the + * animation startTime. *Ideally*, we would use the createdAt time as t=0 + * as the following frame would then be the first frame of the animation in + * progress, which would feel snappier. + * + * However, if there's a delay (main thread work) between the creation of + * the animation and the first committed frame, we prefer to use resolvedAt + * to avoid a sudden jump into the animation. + */ + const startTime = sync + ? !this.resolvedAt + ? this.createdAt + : this.resolvedAt - this.createdAt > MAX_RESOLVE_DELAY + ? this.resolvedAt + : this.createdAt + : undefined; + const resolvedOptions = { + startTime, + finalKeyframe, + ...options, + keyframes, + }; + /** + * Animate via WAAPI if possible. If this is a handoff animation, the optimised animation will be running via + * WAAPI. Therefore, this animation must be JS to ensure it runs "under" the + * optimised animation. + * + * Also skip WAAPI when keyframes aren't animatable, as the resolved + * values may not be valid CSS and would trigger browser warnings. + */ + const useWaapi = canAnimateValue && + !isHandoff && + supportsBrowserAnimation(resolvedOptions); + const element = resolvedOptions.motionValue?.owner?.current; + let animation; + if (useWaapi) { + try { + animation = new NativeAnimationExtended({ + ...resolvedOptions, + element, + }); + } + catch { + animation = new JSAnimation(resolvedOptions); + } + } + else { + animation = new JSAnimation(resolvedOptions); + } + animation.finished.then(() => { + this.notifyFinished(); + }).catch(noop); + if (this.pendingTimeline) { + this.stopTimeline = animation.attachTimeline(this.pendingTimeline); + this.pendingTimeline = undefined; + } + this._animation = animation; + } + get finished() { + if (!this._animation) { + return this._finished; + } + else { + return this.animation.finished; + } + } + then(onResolve, _onReject) { + return this.finished.finally(onResolve).then(() => { }); + } + get animation() { + if (!this._animation) { + this.keyframeResolver?.resume(); + flushKeyframeResolvers(); + } + return this._animation; + } + get duration() { + return this.animation.duration; + } + get iterationDuration() { + return this.animation.iterationDuration; + } + get time() { + return this.animation.time; + } + set time(newTime) { + this.animation.time = newTime; + } + get speed() { + return this.animation.speed; + } + get state() { + return this.animation.state; + } + set speed(newSpeed) { + this.animation.speed = newSpeed; + } + get startTime() { + return this.animation.startTime; + } + attachTimeline(timeline) { + if (this._animation) { + this.stopTimeline = this.animation.attachTimeline(timeline); + } + else { + this.pendingTimeline = timeline; + } + return () => this.stop(); + } + play() { + this.animation.play(); + } + pause() { + this.animation.pause(); + } + complete() { + this.animation.complete(); + } + cancel() { + if (this._animation) { + this.animation.cancel(); + } + this.keyframeResolver?.cancel(); + } +} + +export { AsyncMotionValueAnimation }; +//# sourceMappingURL=AsyncMotionValueAnimation.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.mjs.map b/node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.mjs.map new file mode 100644 index 0000000..1c6cdf5 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"AsyncMotionValueAnimation.mjs","sources":["../../../src/animation/AsyncMotionValueAnimation.ts"],"sourcesContent":["import { MotionGlobalConfig, noop } from \"motion-utils\"\nimport { time } from \"../frameloop/sync-time\"\nimport { JSAnimation } from \"./JSAnimation\"\nimport { getFinalKeyframe } from \"./keyframes/get-final\"\nimport {\n KeyframeResolver as DefaultKeyframeResolver,\n flushKeyframeResolvers,\n ResolvedKeyframes,\n} from \"./keyframes/KeyframesResolver\"\nimport { NativeAnimationExtended } from \"./NativeAnimationExtended\"\nimport {\n AnimationPlaybackControls,\n AnyResolvedKeyframe,\n TimelineWithFallback,\n ValueAnimationOptions,\n} from \"./types\"\nimport { canAnimate } from \"./utils/can-animate\"\nimport { makeAnimationInstant } from \"./utils/make-animation-instant\"\nimport { WithPromise } from \"./utils/WithPromise\"\nimport { supportsBrowserAnimation } from \"./waapi/supports/waapi\"\n\n/**\n * Maximum time allowed between an animation being created and it being\n * resolved for us to use the latter as the start time.\n *\n * This is to ensure that while we prefer to \"start\" an animation as soon\n * as it's triggered, we also want to avoid a visual jump if there's a big delay\n * between these two moments.\n */\nconst MAX_RESOLVE_DELAY = 40\n\ntype OptionsWithoutKeyframes = Omit<\n ValueAnimationOptions,\n \"keyframes\"\n>\n\nexport class AsyncMotionValueAnimation\n extends WithPromise\n implements AnimationPlaybackControls\n{\n private createdAt: number\n\n private resolvedAt: number | undefined\n\n private _animation: AnimationPlaybackControls | undefined\n\n private pendingTimeline: TimelineWithFallback | undefined\n\n private keyframeResolver: DefaultKeyframeResolver | undefined\n\n private stopTimeline: VoidFunction | undefined\n\n constructor({\n autoplay = true,\n delay = 0,\n type = \"keyframes\",\n repeat = 0,\n repeatDelay = 0,\n repeatType = \"loop\",\n keyframes,\n name,\n motionValue,\n element,\n ...options\n }: ValueAnimationOptions) {\n super()\n\n this.createdAt = time.now()\n\n const optionsWithDefaults: OptionsWithoutKeyframes = {\n autoplay,\n delay,\n type,\n repeat,\n repeatDelay,\n repeatType,\n name,\n motionValue,\n element,\n ...options,\n }\n\n const KeyframeResolver =\n element?.KeyframeResolver || DefaultKeyframeResolver\n\n this.keyframeResolver = new KeyframeResolver(\n keyframes,\n (\n resolvedKeyframes: ResolvedKeyframes,\n finalKeyframe: T,\n forced: boolean\n ) =>\n this.onKeyframesResolved(\n resolvedKeyframes,\n finalKeyframe,\n optionsWithDefaults,\n !forced\n ),\n name,\n motionValue,\n element\n )\n this.keyframeResolver?.scheduleResolve()\n }\n\n onKeyframesResolved(\n keyframes: ResolvedKeyframes,\n finalKeyframe: T,\n options: OptionsWithoutKeyframes,\n sync: boolean\n ) {\n this.keyframeResolver = undefined\n\n const { name, type, velocity, delay, isHandoff, onUpdate } = options\n this.resolvedAt = time.now()\n\n /**\n * If we can't animate this value with the resolved keyframes\n * then we should complete it immediately.\n */\n let canAnimateValue = true\n if (!canAnimate(keyframes, name, type, velocity)) {\n canAnimateValue = false\n\n if (MotionGlobalConfig.instantAnimations || !delay) {\n onUpdate?.(getFinalKeyframe(keyframes, options, finalKeyframe))\n }\n\n keyframes[0] = keyframes[keyframes.length - 1]\n\n makeAnimationInstant(options)\n options.repeat = 0\n }\n\n /**\n * Resolve startTime for the animation.\n *\n * This method uses the createdAt and resolvedAt to calculate the\n * animation startTime. *Ideally*, we would use the createdAt time as t=0\n * as the following frame would then be the first frame of the animation in\n * progress, which would feel snappier.\n *\n * However, if there's a delay (main thread work) between the creation of\n * the animation and the first committed frame, we prefer to use resolvedAt\n * to avoid a sudden jump into the animation.\n */\n const startTime = sync\n ? !this.resolvedAt\n ? this.createdAt\n : this.resolvedAt - this.createdAt > MAX_RESOLVE_DELAY\n ? this.resolvedAt\n : this.createdAt\n : undefined\n\n const resolvedOptions = {\n startTime,\n finalKeyframe,\n ...options,\n keyframes,\n }\n\n /**\n * Animate via WAAPI if possible. If this is a handoff animation, the optimised animation will be running via\n * WAAPI. Therefore, this animation must be JS to ensure it runs \"under\" the\n * optimised animation.\n *\n * Also skip WAAPI when keyframes aren't animatable, as the resolved\n * values may not be valid CSS and would trigger browser warnings.\n */\n const useWaapi =\n canAnimateValue &&\n !isHandoff &&\n supportsBrowserAnimation(resolvedOptions)\n const element = resolvedOptions.motionValue?.owner?.current\n\n let animation: AnimationPlaybackControls\n if (useWaapi) {\n try {\n animation = new NativeAnimationExtended({\n ...resolvedOptions,\n element,\n } as any)\n } catch {\n animation = new JSAnimation(resolvedOptions)\n }\n } else {\n animation = new JSAnimation(resolvedOptions)\n }\n\n animation.finished.then(() => {\n this.notifyFinished()\n }).catch(noop)\n\n if (this.pendingTimeline) {\n this.stopTimeline = animation.attachTimeline(this.pendingTimeline)\n this.pendingTimeline = undefined\n }\n\n this._animation = animation\n }\n\n get finished() {\n if (!this._animation) {\n return this._finished\n } else {\n return this.animation.finished\n }\n }\n\n then(onResolve: VoidFunction, _onReject?: VoidFunction) {\n return this.finished.finally(onResolve).then(() => {})\n }\n\n get animation(): AnimationPlaybackControls {\n if (!this._animation) {\n this.keyframeResolver?.resume()\n flushKeyframeResolvers()\n }\n\n return this._animation!\n }\n\n get duration() {\n return this.animation.duration\n }\n\n get iterationDuration() {\n return this.animation.iterationDuration\n }\n\n get time() {\n return this.animation.time\n }\n\n set time(newTime: number) {\n this.animation.time = newTime\n }\n\n get speed() {\n return this.animation.speed\n }\n\n get state() {\n return this.animation.state\n }\n\n set speed(newSpeed: number) {\n this.animation.speed = newSpeed\n }\n\n get startTime() {\n return this.animation.startTime\n }\n\n attachTimeline(timeline: TimelineWithFallback) {\n if (this._animation) {\n this.stopTimeline = this.animation.attachTimeline(timeline)\n } else {\n this.pendingTimeline = timeline\n }\n\n return () => this.stop()\n }\n\n play() {\n this.animation.play()\n }\n\n pause() {\n this.animation.pause()\n }\n\n complete() {\n this.animation.complete()\n }\n\n cancel() {\n if (this._animation) {\n this.animation.cancel()\n }\n\n this.keyframeResolver?.cancel()\n }\n\n /**\n * Bound to support return animation.stop pattern\n */\n stop = () => {\n if (this._animation) {\n this._animation.stop()\n this.stopTimeline?.()\n }\n\n this.keyframeResolver?.cancel()\n }\n}\n"],"names":["KeyframeResolver","DefaultKeyframeResolver"],"mappings":";;;;;;;;;;;AAqBA;;;;;;;AAOG;AACH,MAAM,iBAAiB,GAAG,EAAE;AAOtB,MAAO,yBACT,SAAQ,WAAW,CAAA;AAenB,IAAA,WAAA,CAAY,EACR,QAAQ,GAAG,IAAI,EACf,KAAK,GAAG,CAAC,EACT,IAAI,GAAG,WAAW,EAClB,MAAM,GAAG,CAAC,EACV,WAAW,GAAG,CAAC,EACf,UAAU,GAAG,MAAM,EACnB,SAAS,EACT,IAAI,EACJ,WAAW,EACX,OAAO,EACP,GAAG,OAAO,EACa,EAAA;AACvB,QAAA,KAAK,EAAE;AA2NX;;AAEG;QACH,IAAA,CAAA,IAAI,GAAG,MAAK;AACR,YAAA,IAAI,IAAI,CAAC,UAAU,EAAE;AACjB,gBAAA,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE;AACtB,gBAAA,IAAI,CAAC,YAAY,IAAI;YACzB;AAEA,YAAA,IAAI,CAAC,gBAAgB,EAAE,MAAM,EAAE;AACnC,QAAA,CAAC;AAnOG,QAAA,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE;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AA,cAAc,CAAC,QAA8B,EAAA;AACzC,QAAA,IAAI,IAAI,CAAC,UAAU,EAAE;YACjB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,QAAQ,CAAC;QAC/D;aAAO;AACH,YAAA,IAAI,CAAC,eAAe,GAAG,QAAQ;QACnC;AAEA,QAAA,OAAO,MAAM,IAAI,CAAC,IAAI,EAAE;IAC5B;IAEA,IAAI,GAAA;AACA,QAAA,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE;IACzB;IAEA,KAAK,GAAA;AACD,QAAA,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE;IAC1B;IAEA,QAAQ,GAAA;AACJ,QAAA,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE;IAC7B;IAEA,MAAM,GAAA;AACF,QAAA,IAAI,IAAI,CAAC,UAAU,EAAE;AACjB,YAAA,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE;QAC3B;AAEA,QAAA,IAAI,CAAC,gBAAgB,EAAE,MAAM,EAAE;IACnC;AAaH;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/GroupAnimation.mjs b/node_modules/motion-dom/dist/es/animation/GroupAnimation.mjs new file mode 100644 index 0000000..a959b95 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/GroupAnimation.mjs @@ -0,0 +1,82 @@ +class GroupAnimation { + constructor(animations) { + // Bound to accomadate common `return animation.stop` pattern + this.stop = () => this.runAll("stop"); + this.animations = animations.filter(Boolean); + } + get finished() { + return Promise.all(this.animations.map((animation) => animation.finished)); + } + /** + * TODO: Filter out cancelled or stopped animations before returning + */ + getAll(propName) { + return this.animations[0][propName]; + } + setAll(propName, newValue) { + for (let i = 0; i < this.animations.length; i++) { + this.animations[i][propName] = newValue; + } + } + attachTimeline(timeline) { + const subscriptions = this.animations.map((animation) => animation.attachTimeline(timeline)); + return () => { + subscriptions.forEach((cancel, i) => { + cancel && cancel(); + this.animations[i].stop(); + }); + }; + } + get time() { + return this.getAll("time"); + } + set time(time) { + this.setAll("time", time); + } + get speed() { + return this.getAll("speed"); + } + set speed(speed) { + this.setAll("speed", speed); + } + get state() { + return this.getAll("state"); + } + get startTime() { + return this.getAll("startTime"); + } + get duration() { + return getMax(this.animations, "duration"); + } + get iterationDuration() { + return getMax(this.animations, "iterationDuration"); + } + runAll(methodName) { + this.animations.forEach((controls) => controls[methodName]()); + } + play() { + this.runAll("play"); + } + pause() { + this.runAll("pause"); + } + cancel() { + this.runAll("cancel"); + } + complete() { + this.runAll("complete"); + } +} +function getMax(animations, propName) { + let max = 0; + for (let i = 0; i < animations.length; i++) { + const value = animations[i][propName]; + if (value !== null && value > max) { + max = value; + } + } + return max; +} + +export { GroupAnimation }; +//# sourceMappingURL=GroupAnimation.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/GroupAnimation.mjs.map b/node_modules/motion-dom/dist/es/animation/GroupAnimation.mjs.map new file mode 100644 index 0000000..d88a38d --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/GroupAnimation.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"GroupAnimation.mjs","sources":["../../../src/animation/GroupAnimation.ts"],"sourcesContent":["import { AnimationPlaybackControls, TimelineWithFallback } from \"./types\"\n\ntype PropNames =\n | \"time\"\n | \"speed\"\n | \"duration\"\n | \"attachTimeline\"\n | \"startTime\"\n | \"state\"\n\nexport type AcceptedAnimations = AnimationPlaybackControls\n\nexport type GroupedAnimations = AcceptedAnimations[]\n\nexport class GroupAnimation implements AnimationPlaybackControls {\n animations: GroupedAnimations\n\n constructor(animations: Array) {\n this.animations = animations.filter(Boolean) as GroupedAnimations\n }\n\n get finished() {\n return Promise.all(\n this.animations.map((animation) => animation.finished)\n )\n }\n\n /**\n * TODO: Filter out cancelled or stopped animations before returning\n */\n private getAll(propName: PropNames) {\n return this.animations[0][propName] as any\n }\n\n private setAll(propName: PropNames, newValue: any) {\n for (let i = 0; i < this.animations.length; i++) {\n ;(this.animations[i][propName] as any) = newValue\n }\n }\n\n attachTimeline(timeline: TimelineWithFallback) {\n const subscriptions = this.animations.map((animation) =>\n animation.attachTimeline(timeline)\n )\n\n return () => {\n subscriptions.forEach((cancel, i) => {\n cancel && cancel()\n this.animations[i].stop()\n })\n }\n }\n\n get time() {\n return this.getAll(\"time\")\n }\n\n set time(time: number) {\n this.setAll(\"time\", time)\n }\n\n get speed() {\n return this.getAll(\"speed\")\n }\n\n set speed(speed: number) {\n this.setAll(\"speed\", speed)\n }\n\n get state() {\n return this.getAll(\"state\")\n }\n\n get startTime() {\n return this.getAll(\"startTime\")\n }\n\n get duration() {\n return getMax(this.animations, \"duration\")\n }\n\n get iterationDuration() {\n return getMax(this.animations, \"iterationDuration\")\n }\n\n private runAll(\n methodName: keyof Omit<\n AnimationPlaybackControls,\n PropNames | \"then\" | \"finished\" | \"iterationDuration\"\n >\n ) {\n this.animations.forEach((controls) => controls[methodName]())\n }\n\n play() {\n this.runAll(\"play\")\n }\n\n pause() {\n this.runAll(\"pause\")\n }\n\n // Bound to accomadate common `return animation.stop` pattern\n stop = () => this.runAll(\"stop\")\n\n cancel() {\n this.runAll(\"cancel\")\n }\n\n complete() {\n this.runAll(\"complete\")\n }\n}\n\nfunction getMax(\n animations: GroupedAnimations,\n propName: \"iterationDuration\" | \"duration\"\n): number {\n let max = 0\n\n for (let i = 0; i < animations.length; i++) {\n const value = animations[i][propName]\n if (value !== null && value > max) {\n max = value\n }\n }\n return max\n}\n"],"names":[],"mappings":"MAca,cAAc,CAAA;AAGvB,IAAA,WAAA,CAAY,UAAiD,EAAA;;QAsF7D,IAAA,CAAA,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;QArF5B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC,MAAM,CAAC,OAAO,CAAsB;IACrE;AAEA,IAAA,IAAI,QAAQ,GAAA;QACR,OAAO,OAAO,CAAC,GAAG,CACd,IAAI,CAAC,UAAU,CAAC,GAAG,CAA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motion-dom/dist/es/animation/GroupAnimationWithThen.mjs new file mode 100644 index 0000000..7d8a536 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/GroupAnimationWithThen.mjs @@ -0,0 +1,10 @@ +import { GroupAnimation } from './GroupAnimation.mjs'; + +class GroupAnimationWithThen extends GroupAnimation { + then(onResolve, _onReject) { + return this.finished.finally(onResolve).then(() => { }); + } +} + +export { GroupAnimationWithThen }; +//# sourceMappingURL=GroupAnimationWithThen.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/GroupAnimationWithThen.mjs.map b/node_modules/motion-dom/dist/es/animation/GroupAnimationWithThen.mjs.map new file mode 100644 index 0000000..7dc17fa --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/GroupAnimationWithThen.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"GroupAnimationWithThen.mjs","sources":["../../../src/animation/GroupAnimationWithThen.ts"],"sourcesContent":["import { GroupAnimation } from \"./GroupAnimation\"\nimport { AnimationPlaybackControlsWithThen } from \"./types\"\n\nexport class GroupAnimationWithThen\n extends GroupAnimation\n implements AnimationPlaybackControlsWithThen\n{\n then(onResolve: VoidFunction, _onReject?: VoidFunction) {\n return this.finished.finally(onResolve).then(() => {})\n }\n}\n"],"names":[],"mappings":";;AAGM,MAAO,sBACT,SAAQ,cAAc,CAAA;IAGtB,IAAI,CAAC,SAAuB,EAAE,SAAwB,EAAA;AAClD,QAAA,OAAO,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,MAAK,EAAE,CAAC,CAAC;IAC1D;AACH;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/JSAnimation.mjs b/node_modules/motion-dom/dist/es/animation/JSAnimation.mjs new file mode 100644 index 0000000..8f8ee03 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/JSAnimation.mjs @@ -0,0 +1,387 @@ +import { invariant, pipe, clamp, millisecondsToSeconds, secondsToMilliseconds } from 'motion-utils'; +import { time } from '../frameloop/sync-time.mjs'; +import { mix } from '../utils/mix/index.mjs'; +import { frameloopDriver } from './drivers/frame.mjs'; +import { inertia } from './generators/inertia.mjs'; +import { keyframes } from './generators/keyframes.mjs'; +import { calcGeneratorDuration } from './generators/utils/calc-duration.mjs'; +import { getGeneratorVelocity } from './generators/utils/velocity.mjs'; +import { getFinalKeyframe } from './keyframes/get-final.mjs'; +import { replaceTransitionType } from './utils/replace-transition-type.mjs'; +import { WithPromise } from './utils/WithPromise.mjs'; + +const percentToProgress = (percent) => percent / 100; +class JSAnimation extends WithPromise { + constructor(options) { + super(); + this.state = "idle"; + this.startTime = null; + this.isStopped = false; + /** + * The current time of the animation. + */ + this.currentTime = 0; + /** + * The time at which the animation was paused. + */ + this.holdTime = null; + /** + * Playback speed as a factor. 0 would be stopped, -1 reverse and 2 double speed. + */ + this.playbackSpeed = 1; + /** + * Reusable state object for the delay phase to avoid + * allocating a new object every frame. + */ + this.delayState = { + done: false, + value: undefined, + }; + /** + * This method is bound to the instance to fix a pattern where + * animation.stop is returned as a reference from a useEffect. + */ + this.stop = () => { + const { motionValue } = this.options; + if (motionValue && motionValue.updatedAt !== time.now()) { + this.tick(time.now()); + } + this.isStopped = true; + if (this.state === "idle") + return; + this.teardown(); + this.options.onStop?.(); + }; + this.options = options; + this.initAnimation(); + this.play(); + if (options.autoplay === false) + this.pause(); + } + initAnimation() { + const { options } = this; + replaceTransitionType(options); + const { type = keyframes, repeat = 0, repeatDelay = 0, repeatType, velocity = 0, } = options; + let { keyframes: keyframes$1 } = options; + const generatorFactory = type || keyframes; + if (process.env.NODE_ENV !== "production" && + generatorFactory !== keyframes) { + invariant(keyframes$1.length <= 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${keyframes$1}`, "spring-two-frames"); + } + if (generatorFactory !== keyframes && + typeof keyframes$1[0] !== "number") { + this.mixKeyframes = pipe(percentToProgress, mix(keyframes$1[0], keyframes$1[1])); + keyframes$1 = [0, 100]; + } + const generator = generatorFactory({ ...options, keyframes: keyframes$1 }); + /** + * If we have a mirror repeat type we need to create a second generator that outputs the + * mirrored (not reversed) animation and later ping pong between the two generators. + */ + if (repeatType === "mirror") { + this.mirroredGenerator = generatorFactory({ + ...options, + keyframes: [...keyframes$1].reverse(), + velocity: -velocity, + }); + } + /** + * If duration is undefined and we have repeat options, + * we need to calculate a duration from the generator. + * + * We set it to the generator itself to cache the duration. + * Any timeline resolver will need to have already precalculated + * the duration by this step. + */ + if (generator.calculatedDuration === null) { + generator.calculatedDuration = calcGeneratorDuration(generator); + } + const { calculatedDuration } = generator; + this.calculatedDuration = calculatedDuration; + this.resolvedDuration = calculatedDuration + repeatDelay; + this.totalDuration = this.resolvedDuration * (repeat + 1) - repeatDelay; + this.generator = generator; + } + updateTime(timestamp) { + const animationTime = Math.round(timestamp - this.startTime) * this.playbackSpeed; + // Update currentTime + if (this.holdTime !== null) { + this.currentTime = this.holdTime; + } + else { + // Rounding the time because floating point arithmetic is not always accurate, e.g. 3000.367 - 1000.367 = + // 2000.0000000000002. This is a problem when we are comparing the currentTime with the duration, for + // example. + this.currentTime = animationTime; + } + } + tick(timestamp, sample = false) { + const { generator, totalDuration, mixKeyframes, mirroredGenerator, resolvedDuration, calculatedDuration, } = this; + if (this.startTime === null) + return generator.next(0); + const { delay = 0, keyframes, repeat, repeatType, repeatDelay, type, onUpdate, finalKeyframe, } = this.options; + /** + * requestAnimationFrame timestamps can come through as lower than + * the startTime as set by performance.now(). Here we prevent this, + * though in the future it could be possible to make setting startTime + * a pending operation that gets resolved here. + */ + if (this.speed > 0) { + this.startTime = Math.min(this.startTime, timestamp); + } + else if (this.speed < 0) { + this.startTime = Math.min(timestamp - totalDuration / this.speed, this.startTime); + } + if (sample) { + this.currentTime = timestamp; + } + else { + this.updateTime(timestamp); + } + // Rebase on delay + const timeWithoutDelay = this.currentTime - delay * (this.playbackSpeed >= 0 ? 1 : -1); + const isInDelayPhase = this.playbackSpeed >= 0 + ? timeWithoutDelay < 0 + : timeWithoutDelay > totalDuration; + this.currentTime = Math.max(timeWithoutDelay, 0); + // If this animation has finished, set the current time to the total duration. + if (this.state === "finished" && this.holdTime === null) { + this.currentTime = totalDuration; + } + let elapsed = this.currentTime; + let frameGenerator = generator; + if (repeat) { + /** + * Get the current progress (0-1) of the animation. If t is > + * than duration we'll get values like 2.5 (midway through the + * third iteration) + */ + const progress = Math.min(this.currentTime, totalDuration) / resolvedDuration; + /** + * Get the current iteration (0 indexed). For instance the floor of + * 2.5 is 2. + */ + let currentIteration = Math.floor(progress); + /** + * Get the current progress of the iteration by taking the remainder + * so 2.5 is 0.5 through iteration 2 + */ + let iterationProgress = progress % 1.0; + /** + * If iteration progress is 1 we count that as the end + * of the previous iteration. + */ + if (!iterationProgress && progress >= 1) { + iterationProgress = 1; + } + iterationProgress === 1 && currentIteration--; + currentIteration = Math.min(currentIteration, repeat + 1); + /** + * Reverse progress if we're not running in "normal" direction + */ + const isOddIteration = Boolean(currentIteration % 2); + if (isOddIteration) { + if (repeatType === "reverse") { + iterationProgress = 1 - iterationProgress; + if (repeatDelay) { + iterationProgress -= repeatDelay / resolvedDuration; + } + } + else if (repeatType === "mirror") { + frameGenerator = mirroredGenerator; + } + } + elapsed = clamp(0, 1, iterationProgress) * resolvedDuration; + } + /** + * If we're in negative time, set state as the initial keyframe. + * This prevents delay: x, duration: 0 animations from finishing + * instantly. + */ + let state; + if (isInDelayPhase) { + this.delayState.value = keyframes[0]; + state = this.delayState; + } + else { + state = frameGenerator.next(elapsed); + } + if (mixKeyframes && !isInDelayPhase) { + state.value = mixKeyframes(state.value); + } + let { done } = state; + if (!isInDelayPhase && calculatedDuration !== null) { + done = + this.playbackSpeed >= 0 + ? this.currentTime >= totalDuration + : this.currentTime <= 0; + } + const isAnimationFinished = this.holdTime === null && + (this.state === "finished" || (this.state === "running" && done)); + // TODO: The exception for inertia could be cleaner here + if (isAnimationFinished && type !== inertia) { + state.value = getFinalKeyframe(keyframes, this.options, finalKeyframe, this.speed); + } + if (onUpdate) { + onUpdate(state.value); + } + if (isAnimationFinished) { + this.finish(); + } + return state; + } + /** + * Allows the returned animation to be awaited or promise-chained. Currently + * resolves when the animation finishes at all but in a future update could/should + * reject if its cancels. + */ + then(resolve, reject) { + return this.finished.then(resolve, reject); + } + get duration() { + return millisecondsToSeconds(this.calculatedDuration); + } + get iterationDuration() { + const { delay = 0 } = this.options || {}; + return this.duration + millisecondsToSeconds(delay); + } + get time() { + return millisecondsToSeconds(this.currentTime); + } + set time(newTime) { + newTime = secondsToMilliseconds(newTime); + this.currentTime = newTime; + if (this.startTime === null || + this.holdTime !== null || + this.playbackSpeed === 0) { + this.holdTime = newTime; + } + else if (this.driver) { + this.startTime = this.driver.now() - newTime / this.playbackSpeed; + } + if (this.driver) { + this.driver.start(false); + } + else { + this.startTime = 0; + this.state = "paused"; + this.holdTime = newTime; + this.tick(newTime); + } + } + /** + * Returns the generator's velocity at the current time in units/second. + * Uses the analytical derivative when available (springs), avoiding + * the MotionValue's frame-dependent velocity estimation. + */ + getGeneratorVelocity() { + const t = this.currentTime; + if (t <= 0) + return this.options.velocity || 0; + if (this.generator.velocity) { + return this.generator.velocity(t); + } + // Fallback: finite difference + const current = this.generator.next(t).value; + return getGeneratorVelocity((s) => this.generator.next(s).value, t, current); + } + get speed() { + return this.playbackSpeed; + } + set speed(newSpeed) { + const hasChanged = this.playbackSpeed !== newSpeed; + if (hasChanged && this.driver) { + this.updateTime(time.now()); + } + this.playbackSpeed = newSpeed; + if (hasChanged && this.driver) { + this.time = millisecondsToSeconds(this.currentTime); + } + } + play() { + if (this.isStopped) + return; + const { driver = frameloopDriver, startTime } = this.options; + if (!this.driver) { + this.driver = driver((timestamp) => this.tick(timestamp)); + } + this.options.onPlay?.(); + const now = this.driver.now(); + if (this.state === "finished") { + this.updateFinished(); + this.startTime = now; + } + else if (this.holdTime !== null) { + this.startTime = now - this.holdTime; + } + else if (!this.startTime) { + this.startTime = startTime ?? now; + } + if (this.state === "finished" && this.speed < 0) { + this.startTime += this.calculatedDuration; + } + this.holdTime = null; + /** + * Set playState to running only after we've used it in + * the previous logic. + */ + this.state = "running"; + this.driver.start(); + } + pause() { + this.state = "paused"; + this.updateTime(time.now()); + this.holdTime = this.currentTime; + } + complete() { + if (this.state !== "running") { + this.play(); + } + this.state = "finished"; + this.holdTime = null; + } + finish() { + this.notifyFinished(); + this.teardown(); + this.state = "finished"; + this.options.onComplete?.(); + } + cancel() { + this.holdTime = null; + this.startTime = 0; + this.tick(0); + this.teardown(); + this.options.onCancel?.(); + } + teardown() { + this.state = "idle"; + this.stopDriver(); + this.startTime = this.holdTime = null; + } + stopDriver() { + if (!this.driver) + return; + this.driver.stop(); + this.driver = undefined; + } + sample(sampleTime) { + this.startTime = 0; + return this.tick(sampleTime, true); + } + attachTimeline(timeline) { + if (this.options.allowFlatten) { + this.options.type = "keyframes"; + this.options.ease = "linear"; + this.initAnimation(); + } + this.driver?.stop(); + return timeline.observe(this); + } +} +// Legacy function support +function animateValue(options) { + return new JSAnimation(options); +} + +export { JSAnimation, animateValue }; +//# sourceMappingURL=JSAnimation.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/JSAnimation.mjs.map b/node_modules/motion-dom/dist/es/animation/JSAnimation.mjs.map new file mode 100644 index 0000000..b2c52df --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/JSAnimation.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"JSAnimation.mjs","sources":["../../../src/animation/JSAnimation.ts"],"sourcesContent":["import {\n clamp,\n invariant,\n millisecondsToSeconds,\n pipe,\n secondsToMilliseconds,\n} from \"motion-utils\"\nimport { time } from \"../frameloop/sync-time\"\nimport { mix } from \"../utils/mix\"\nimport { Mixer } from \"../utils/mix/types\"\nimport { frameloopDriver } from \"./drivers/frame\"\nimport { DriverControls } from \"./drivers/types\"\nimport { inertia } from \"./generators/inertia\"\nimport { keyframes as keyframesGenerator } from \"./generators/keyframes\"\nimport { calcGeneratorDuration } from \"./generators/utils/calc-duration\"\nimport { getGeneratorVelocity } from \"./generators/utils/velocity\"\nimport { getFinalKeyframe } from \"./keyframes/get-final\"\nimport {\n AnimationPlaybackControlsWithThen,\n AnimationState,\n GeneratorFactory,\n KeyframeGenerator,\n TimelineWithFallback,\n ValueAnimationOptions,\n} from \"./types\"\nimport { replaceTransitionType } from \"./utils/replace-transition-type\"\nimport { WithPromise } from \"./utils/WithPromise\"\n\nconst percentToProgress = (percent: number) => percent / 100\n\nexport class JSAnimation\n extends WithPromise\n implements AnimationPlaybackControlsWithThen\n{\n state: AnimationPlayState = \"idle\"\n\n startTime: number | null = null\n\n /**\n * The driver that's controlling the animation loop. Normally this is a requestAnimationFrame loop\n * but in tests we can pass in a synchronous loop.\n */\n private driver?: DriverControls\n\n private isStopped = false\n\n private generator: KeyframeGenerator\n\n private calculatedDuration: number\n\n private resolvedDuration: number\n\n private totalDuration: number\n\n private options: ValueAnimationOptions\n\n /**\n * The current time of the animation.\n */\n private currentTime: number = 0\n\n /**\n * The time at which the animation was paused.\n */\n private holdTime: number | null = null\n\n /**\n * Playback speed as a factor. 0 would be stopped, -1 reverse and 2 double speed.\n */\n private playbackSpeed = 1\n\n /*\n * If our generator doesn't support mixing numbers, we need to replace keyframes with\n * [0, 100] and then make a function that maps that to the actual keyframes.\n *\n * 100 is chosen instead of 1 as it works nicer with spring animations.\n */\n private mixKeyframes: Mixer | undefined\n\n private mirroredGenerator: KeyframeGenerator | undefined\n\n /**\n * Reusable state object for the delay phase to avoid\n * allocating a new object every frame.\n */\n private delayState: AnimationState = {\n done: false,\n value: undefined as unknown as T,\n }\n\n constructor(options: ValueAnimationOptions) {\n super()\n\n this.options = options\n this.initAnimation()\n this.play()\n\n if (options.autoplay === false) this.pause()\n }\n\n initAnimation() {\n const { options } = this\n\n replaceTransitionType(options)\n\n const {\n type = keyframesGenerator,\n repeat = 0,\n repeatDelay = 0,\n repeatType,\n velocity = 0,\n } = options\n let { keyframes } = options\n\n const generatorFactory =\n (type as GeneratorFactory) || keyframesGenerator\n\n if (\n process.env.NODE_ENV !== \"production\" &&\n generatorFactory !== keyframesGenerator\n ) {\n invariant(\n keyframes.length <= 2,\n `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${keyframes}`,\n \"spring-two-frames\"\n )\n }\n\n if (\n generatorFactory !== keyframesGenerator &&\n typeof keyframes[0] !== \"number\"\n ) {\n this.mixKeyframes = pipe(\n percentToProgress,\n mix(keyframes[0], keyframes[1])\n ) as (t: number) => T\n\n keyframes = [0 as T, 100 as T]\n }\n\n const generator = generatorFactory({ ...options, keyframes })\n\n /**\n * If we have a mirror repeat type we need to create a second generator that outputs the\n * mirrored (not reversed) animation and later ping pong between the two generators.\n */\n if (repeatType === \"mirror\") {\n this.mirroredGenerator = generatorFactory({\n ...options,\n keyframes: [...keyframes].reverse(),\n velocity: -velocity,\n })\n }\n\n /**\n * If duration is undefined and we have repeat options,\n * we need to calculate a duration from the generator.\n *\n * We set it to the generator itself to cache the duration.\n * Any timeline resolver will need to have already precalculated\n * the duration by this step.\n */\n if (generator.calculatedDuration === null) {\n generator.calculatedDuration = calcGeneratorDuration(generator)\n }\n\n const { calculatedDuration } = generator\n this.calculatedDuration = calculatedDuration\n this.resolvedDuration = calculatedDuration + repeatDelay\n this.totalDuration = this.resolvedDuration * (repeat + 1) - repeatDelay\n this.generator = generator\n }\n\n updateTime(timestamp: number) {\n const animationTime =\n Math.round(timestamp - this.startTime!) * this.playbackSpeed\n\n // Update currentTime\n if (this.holdTime !== null) {\n this.currentTime = this.holdTime\n } else {\n // Rounding the time because floating point arithmetic is not always accurate, e.g. 3000.367 - 1000.367 =\n // 2000.0000000000002. This is a problem when we are comparing the currentTime with the duration, for\n // example.\n this.currentTime = animationTime\n }\n }\n\n tick(timestamp: number, sample = false) {\n const {\n generator,\n totalDuration,\n mixKeyframes,\n mirroredGenerator,\n resolvedDuration,\n calculatedDuration,\n } = this\n\n if (this.startTime === null) return generator.next(0)\n\n const {\n delay = 0,\n keyframes,\n repeat,\n repeatType,\n repeatDelay,\n type,\n onUpdate,\n finalKeyframe,\n } = this.options\n\n /**\n * requestAnimationFrame timestamps can come through as lower than\n * the startTime as set by performance.now(). Here we prevent this,\n * though in the future it could be possible to make setting startTime\n * a pending operation that gets resolved here.\n */\n if (this.speed > 0) {\n this.startTime = Math.min(this.startTime, timestamp)\n } else if (this.speed < 0) {\n this.startTime = Math.min(\n timestamp - totalDuration / this.speed,\n this.startTime\n )\n }\n\n if (sample) {\n this.currentTime = timestamp\n } else {\n this.updateTime(timestamp)\n }\n\n // Rebase on delay\n const timeWithoutDelay =\n this.currentTime - delay * (this.playbackSpeed >= 0 ? 1 : -1)\n const isInDelayPhase =\n this.playbackSpeed >= 0\n ? timeWithoutDelay < 0\n : timeWithoutDelay > totalDuration\n this.currentTime = Math.max(timeWithoutDelay, 0)\n\n // If this animation has finished, set the current time to the total duration.\n if (this.state === \"finished\" && this.holdTime === null) {\n this.currentTime = totalDuration\n }\n\n let elapsed = this.currentTime\n let frameGenerator = generator\n\n if (repeat) {\n /**\n * Get the current progress (0-1) of the animation. If t is >\n * than duration we'll get values like 2.5 (midway through the\n * third iteration)\n */\n const progress =\n Math.min(this.currentTime, totalDuration) / resolvedDuration\n\n /**\n * Get the current iteration (0 indexed). For instance the floor of\n * 2.5 is 2.\n */\n let currentIteration = Math.floor(progress)\n\n /**\n * Get the current progress of the iteration by taking the remainder\n * so 2.5 is 0.5 through iteration 2\n */\n let iterationProgress = progress % 1.0\n\n /**\n * If iteration progress is 1 we count that as the end\n * of the previous iteration.\n */\n if (!iterationProgress && progress >= 1) {\n iterationProgress = 1\n }\n\n iterationProgress === 1 && currentIteration--\n\n currentIteration = Math.min(currentIteration, repeat + 1)\n\n /**\n * Reverse progress if we're not running in \"normal\" direction\n */\n\n const isOddIteration = Boolean(currentIteration % 2)\n if (isOddIteration) {\n if (repeatType === \"reverse\") {\n iterationProgress = 1 - iterationProgress\n if (repeatDelay) {\n iterationProgress -= repeatDelay / resolvedDuration\n }\n } else if (repeatType === \"mirror\") {\n frameGenerator = mirroredGenerator!\n }\n }\n\n elapsed = clamp(0, 1, iterationProgress) * resolvedDuration\n }\n\n /**\n * If we're in negative time, set state as the initial keyframe.\n * This prevents delay: x, duration: 0 animations from finishing\n * instantly.\n */\n let state: AnimationState\n if (isInDelayPhase) {\n this.delayState.value = keyframes[0]\n state = this.delayState\n } else {\n state = frameGenerator.next(elapsed)\n }\n\n if (mixKeyframes && !isInDelayPhase) {\n state.value = mixKeyframes(state.value as number)\n }\n\n let { done } = state\n\n if (!isInDelayPhase && calculatedDuration !== null) {\n done =\n this.playbackSpeed >= 0\n ? this.currentTime >= totalDuration\n : this.currentTime <= 0\n }\n\n const isAnimationFinished =\n this.holdTime === null &&\n (this.state === \"finished\" || (this.state === \"running\" && done))\n\n // TODO: The exception for inertia could be cleaner here\n if (isAnimationFinished && type !== inertia) {\n state.value = getFinalKeyframe(\n keyframes,\n this.options,\n finalKeyframe,\n this.speed\n )\n }\n\n if (onUpdate) {\n onUpdate(state.value)\n }\n\n if (isAnimationFinished) {\n this.finish()\n }\n\n return state\n }\n\n /**\n * Allows the returned animation to be awaited or promise-chained. Currently\n * resolves when the animation finishes at all but in a future update could/should\n * reject if its cancels.\n */\n then(resolve: VoidFunction, reject?: VoidFunction) {\n return this.finished.then(resolve, reject)\n }\n\n get duration() {\n return millisecondsToSeconds(this.calculatedDuration)\n }\n\n get iterationDuration() {\n const { delay = 0 } = this.options || {}\n return this.duration + millisecondsToSeconds(delay)\n }\n\n get time() {\n return millisecondsToSeconds(this.currentTime)\n }\n\n set time(newTime: number) {\n newTime = secondsToMilliseconds(newTime)\n this.currentTime = newTime\n\n if (\n this.startTime === null ||\n this.holdTime !== null ||\n this.playbackSpeed === 0\n ) {\n this.holdTime = newTime\n } else if (this.driver) {\n this.startTime = this.driver.now() - newTime / this.playbackSpeed\n }\n\n if (this.driver) {\n this.driver.start(false)\n } else {\n this.startTime = 0\n this.state = \"paused\"\n this.holdTime = newTime\n this.tick(newTime)\n }\n }\n\n /**\n * Returns the generator's velocity at the current time in units/second.\n * Uses the analytical derivative when available (springs), avoiding\n * the MotionValue's frame-dependent velocity estimation.\n */\n getGeneratorVelocity(): number {\n const t = this.currentTime\n if (t <= 0) return this.options.velocity || 0\n\n if (this.generator.velocity) {\n return this.generator.velocity(t)\n }\n\n // Fallback: finite difference\n const current = this.generator.next(t).value as number\n return getGeneratorVelocity(\n (s) => this.generator.next(s).value as number,\n t,\n current\n )\n }\n\n get speed() {\n return this.playbackSpeed\n }\n\n set speed(newSpeed: number) {\n const hasChanged = this.playbackSpeed !== newSpeed\n\n if (hasChanged && this.driver) {\n this.updateTime(time.now())\n }\n\n this.playbackSpeed = newSpeed\n\n if (hasChanged && this.driver) {\n this.time = millisecondsToSeconds(this.currentTime)\n }\n }\n\n play() {\n if (this.isStopped) return\n\n const { driver = frameloopDriver, startTime } = this.options\n\n if (!this.driver) {\n this.driver = driver((timestamp) => this.tick(timestamp))\n }\n\n this.options.onPlay?.()\n\n const now = this.driver.now()\n\n if (this.state === \"finished\") {\n this.updateFinished()\n this.startTime = now\n } else if (this.holdTime !== null) {\n this.startTime = now - this.holdTime\n } else if (!this.startTime) {\n this.startTime = startTime ?? now\n }\n\n if (this.state === \"finished\" && this.speed < 0) {\n this.startTime += this.calculatedDuration\n }\n\n this.holdTime = null\n\n /**\n * Set playState to running only after we've used it in\n * the previous logic.\n */\n this.state = \"running\"\n\n this.driver.start()\n }\n\n pause() {\n this.state = \"paused\"\n this.updateTime(time.now())\n this.holdTime = this.currentTime\n }\n\n /**\n * This method is bound to the instance to fix a pattern where\n * animation.stop is returned as a reference from a useEffect.\n */\n stop = () => {\n const { motionValue } = this.options\n if (motionValue && motionValue.updatedAt !== time.now()) {\n this.tick(time.now())\n }\n\n this.isStopped = true\n if (this.state === \"idle\") return\n this.teardown()\n this.options.onStop?.()\n }\n\n complete() {\n if (this.state !== \"running\") {\n this.play()\n }\n\n this.state = \"finished\"\n this.holdTime = null\n }\n\n finish() {\n this.notifyFinished()\n this.teardown()\n this.state = \"finished\"\n\n this.options.onComplete?.()\n }\n\n cancel() {\n this.holdTime = null\n this.startTime = 0\n this.tick(0)\n this.teardown()\n this.options.onCancel?.()\n }\n\n private teardown() {\n this.state = \"idle\"\n this.stopDriver()\n this.startTime = this.holdTime = null\n }\n\n private stopDriver() {\n if (!this.driver) return\n this.driver.stop()\n this.driver = undefined\n }\n\n sample(sampleTime: number): AnimationState {\n this.startTime = 0\n return this.tick(sampleTime, true)\n }\n\n attachTimeline(timeline: TimelineWithFallback): VoidFunction {\n if (this.options.allowFlatten) {\n this.options.type = \"keyframes\"\n this.options.ease = \"linear\"\n this.initAnimation()\n }\n\n this.driver?.stop()\n return timeline.observe(this)\n }\n}\n\n// Legacy function support\nexport function animateValue(\n options: ValueAnimationOptions\n) {\n return new JSAnimation(options)\n}\n"],"names":["keyframesGenerator","keyframes"],"mappings":";;;;;;;;;;;;AA4BA,MAAM,iBAAiB,GAAG,CAAC,OAAe,KAAK,OAAO,GAAG,GAAG;AAEtD,MAAO,WACT,SAAQ,WAAW,CAAA;AA2DnB,IAAA,WAAA,CAAY,OAAiC,EAAA;AACzC,QAAA,KAAK,EAAE;QAzDX,IAAA,CAAA,KAAK,GAAuB,MAAM;QAElC,IAAA,CAAA,SAAS,GAAkB,IAAI;QAQvB,IAAA,CAAA,SAAS,GAAG,KAAK;AAYzB;;AAEG;QACK,IAAA,CAAA,WAAW,GAAW,CAAC;AAE/B;;AAEG;QACK,IAAA,CAAA,QAAQ,GAAkB,IAAI;AAEtC;;AAEG;QACK,IAAA,CAAA,aAAa,GAAG,CAAC;AAYzB;;;AAGG;AACK,QAAA,IAAA,CAAA,UAAU,GAAsB;AACpC,YAAA,IAAI,EAAE,KAAK;AACX,YAAA,KAAK,EAAE,SAAyB;SACnC;AAyYD;;;AAGG;QACH,IAAA,CAAA,IAAI,GAAG,MAAK;AACR,YAAA,MAAM,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,OAAO;YACpC,IAAI,WAA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C,IAAA,OAAO,IAAI,WAAW,CAAC,OAAO,CAAC;AACnC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/NativeAnimation.mjs b/node_modules/motion-dom/dist/es/animation/NativeAnimation.mjs new file mode 100644 index 0000000..aecdd88 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/NativeAnimation.mjs @@ -0,0 +1,179 @@ +import { invariant, millisecondsToSeconds, secondsToMilliseconds, noop } from 'motion-utils'; +import { setStyle } from '../render/dom/style-set.mjs'; +import { supportsScrollTimeline } from '../utils/supports/scroll-timeline.mjs'; +import { getFinalKeyframe } from './keyframes/get-final.mjs'; +import { WithPromise } from './utils/WithPromise.mjs'; +import { startWaapiAnimation } from './waapi/start-waapi-animation.mjs'; +import { applyGeneratorOptions } from './waapi/utils/apply-generator.mjs'; + +/** + * NativeAnimation implements AnimationPlaybackControls for the browser's Web Animations API. + */ +class NativeAnimation extends WithPromise { + constructor(options) { + super(); + this.finishedTime = null; + this.isStopped = false; + /** + * Tracks a manually-set start time that takes precedence over WAAPI's + * dynamic startTime. This is cleared when play() or time setter is called, + * allowing WAAPI to take over timing. + */ + this.manualStartTime = null; + if (!options) + return; + const { element, name, keyframes, pseudoElement, allowFlatten = false, finalKeyframe, onComplete, } = options; + this.isPseudoElement = Boolean(pseudoElement); + this.allowFlatten = allowFlatten; + this.options = options; + invariant(typeof options.type !== "string", `Mini animate() doesn't support "type" as a string.`, "mini-spring"); + const transition = applyGeneratorOptions(options); + this.animation = startWaapiAnimation(element, name, keyframes, transition, pseudoElement); + if (transition.autoplay === false) { + this.animation.pause(); + } + this.animation.onfinish = () => { + this.finishedTime = this.time; + if (!pseudoElement) { + const keyframe = getFinalKeyframe(keyframes, this.options, finalKeyframe, this.speed); + if (this.updateMotionValue) { + this.updateMotionValue(keyframe); + } + /** + * If we can, we want to commit the final style as set by the user, + * rather than the computed keyframe value supplied by the animation. + * We always do this, even when a motion value is present, to prevent + * a visual flash in Firefox where the WAAPI animation's fill is removed + * during cancel() before the scheduled render can apply the correct value. + */ + setStyle(element, name, keyframe); + this.animation.cancel(); + } + onComplete?.(); + this.notifyFinished(); + }; + } + play() { + if (this.isStopped) + return; + this.manualStartTime = null; + this.animation.play(); + if (this.state === "finished") { + this.updateFinished(); + } + } + pause() { + this.animation.pause(); + } + complete() { + this.animation.finish?.(); + } + cancel() { + try { + this.animation.cancel(); + } + catch (e) { } + } + stop() { + if (this.isStopped) + return; + this.isStopped = true; + const { state } = this; + if (state === "idle" || state === "finished") { + return; + } + if (this.updateMotionValue) { + this.updateMotionValue(); + } + else { + this.commitStyles(); + } + if (!this.isPseudoElement) + this.cancel(); + } + /** + * WAAPI doesn't natively have any interruption capabilities. + * + * In this method, we commit styles back to the DOM before cancelling + * the animation. + * + * This is designed to be overridden by NativeAnimationExtended, which + * will create a renderless JS animation and sample it twice to calculate + * its current value, "previous" value, and therefore allow + * Motion to also correctly calculate velocity for any subsequent animation + * while deferring the commit until the next animation frame. + */ + commitStyles() { + const element = this.options?.element; + if (!this.isPseudoElement && element?.isConnected) { + this.animation.commitStyles?.(); + } + } + get duration() { + const duration = this.animation.effect?.getComputedTiming?.().duration || 0; + return millisecondsToSeconds(Number(duration)); + } + get iterationDuration() { + const { delay = 0 } = this.options || {}; + return this.duration + millisecondsToSeconds(delay); + } + get time() { + return millisecondsToSeconds(Number(this.animation.currentTime) || 0); + } + set time(newTime) { + const wasFinished = this.finishedTime !== null; + this.manualStartTime = null; + this.finishedTime = null; + this.animation.currentTime = secondsToMilliseconds(newTime); + if (wasFinished) { + this.animation.pause(); + } + } + /** + * The playback speed of the animation. + * 1 = normal speed, 2 = double speed, 0.5 = half speed. + */ + get speed() { + return this.animation.playbackRate; + } + set speed(newSpeed) { + // Allow backwards playback after finishing + if (newSpeed < 0) + this.finishedTime = null; + this.animation.playbackRate = newSpeed; + } + get state() { + return this.finishedTime !== null + ? "finished" + : this.animation.playState; + } + get startTime() { + return this.manualStartTime ?? Number(this.animation.startTime); + } + set startTime(newStartTime) { + this.manualStartTime = this.animation.startTime = newStartTime; + } + /** + * Attaches a timeline to the animation, for instance the `ScrollTimeline`. + */ + attachTimeline({ timeline, rangeStart, rangeEnd, observe, }) { + if (this.allowFlatten) { + this.animation.effect?.updateTiming({ easing: "linear" }); + } + this.animation.onfinish = null; + if (timeline && supportsScrollTimeline()) { + this.animation.timeline = timeline; + if (rangeStart) + this.animation.rangeStart = rangeStart; + if (rangeEnd) + this.animation.rangeEnd = rangeEnd; + return noop; + } + else { + return observe(this); + } + } +} + +export { NativeAnimation }; +//# sourceMappingURL=NativeAnimation.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/NativeAnimation.mjs.map b/node_modules/motion-dom/dist/es/animation/NativeAnimation.mjs.map new file mode 100644 index 0000000..e37651e --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/NativeAnimation.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"NativeAnimation.mjs","sources":["../../../src/animation/NativeAnimation.ts"],"sourcesContent":["import {\n invariant,\n millisecondsToSeconds,\n noop,\n secondsToMilliseconds,\n} from \"motion-utils\"\nimport { setStyle } from \"../render/dom/style-set\"\nimport { supportsScrollTimeline } from \"../utils/supports/scroll-timeline\"\nimport { getFinalKeyframe } from \"./keyframes/get-final\"\nimport {\n AnimationPlaybackControlsWithThen,\n AnyResolvedKeyframe,\n DOMValueAnimationOptions,\n TimelineWithFallback,\n} from \"./types\"\nimport { WithPromise } from \"./utils/WithPromise\"\nimport { startWaapiAnimation } from \"./waapi/start-waapi-animation\"\nimport { applyGeneratorOptions } from \"./waapi/utils/apply-generator\"\n\nexport interface NativeAnimationOptions\n extends DOMValueAnimationOptions {\n pseudoElement?: string\n startTime?: number\n}\n\n/**\n * NativeAnimation implements AnimationPlaybackControls for the browser's Web Animations API.\n */\nexport class NativeAnimation\n extends WithPromise\n implements AnimationPlaybackControlsWithThen\n{\n /**\n * The interfaced Web Animation API animation\n */\n protected animation: Animation\n\n protected finishedTime: number | null = null\n\n protected options: NativeAnimationOptions\n\n private allowFlatten: boolean\n\n private isStopped = false\n\n private isPseudoElement: boolean\n\n /**\n * Tracks a manually-set start time that takes precedence over WAAPI's\n * dynamic startTime. This is cleared when play() or time setter is called,\n * allowing WAAPI to take over timing.\n */\n protected manualStartTime: number | null = null\n\n constructor(options?: NativeAnimationOptions) {\n super()\n\n if (!options) return\n\n const {\n element,\n name,\n keyframes,\n pseudoElement,\n allowFlatten = false,\n finalKeyframe,\n onComplete,\n } = options as any\n\n this.isPseudoElement = Boolean(pseudoElement)\n\n this.allowFlatten = allowFlatten\n this.options = options\n\n invariant(\n typeof options.type !== \"string\",\n `Mini animate() doesn't support \"type\" as a string.`,\n \"mini-spring\"\n )\n\n const transition = applyGeneratorOptions(options)\n\n this.animation = startWaapiAnimation(\n element,\n name,\n keyframes,\n transition,\n pseudoElement\n )\n\n if (transition.autoplay === false) {\n this.animation.pause()\n }\n\n this.animation.onfinish = () => {\n this.finishedTime = this.time\n\n if (!pseudoElement) {\n const keyframe = getFinalKeyframe(\n keyframes as any,\n this.options as any,\n finalKeyframe,\n this.speed\n )\n if (this.updateMotionValue) {\n this.updateMotionValue(keyframe)\n }\n\n /**\n * If we can, we want to commit the final style as set by the user,\n * rather than the computed keyframe value supplied by the animation.\n * We always do this, even when a motion value is present, to prevent\n * a visual flash in Firefox where the WAAPI animation's fill is removed\n * during cancel() before the scheduled render can apply the correct value.\n */\n setStyle(element, name, keyframe)\n\n this.animation.cancel()\n }\n\n onComplete?.()\n this.notifyFinished()\n }\n }\n\n updateMotionValue?(value?: T): void\n\n play() {\n if (this.isStopped) return\n\n this.manualStartTime = null\n this.animation.play()\n\n if (this.state === \"finished\") {\n this.updateFinished()\n }\n }\n\n pause() {\n this.animation.pause()\n }\n\n complete() {\n this.animation.finish?.()\n }\n\n cancel() {\n try {\n this.animation.cancel()\n } catch (e) {}\n }\n\n stop() {\n if (this.isStopped) return\n this.isStopped = true\n const { state } = this\n\n if (state === \"idle\" || state === \"finished\") {\n return\n }\n\n if (this.updateMotionValue) {\n this.updateMotionValue()\n } else {\n this.commitStyles()\n }\n\n if (!this.isPseudoElement) this.cancel()\n }\n\n /**\n * WAAPI doesn't natively have any interruption capabilities.\n *\n * In this method, we commit styles back to the DOM before cancelling\n * the animation.\n *\n * This is designed to be overridden by NativeAnimationExtended, which\n * will create a renderless JS animation and sample it twice to calculate\n * its current value, \"previous\" value, and therefore allow\n * Motion to also correctly calculate velocity for any subsequent animation\n * while deferring the commit until the next animation frame.\n */\n protected commitStyles() {\n const element = this.options?.element\n if (!this.isPseudoElement && element?.isConnected) {\n this.animation.commitStyles?.()\n }\n }\n\n get duration() {\n const duration =\n this.animation.effect?.getComputedTiming?.().duration || 0\n\n return millisecondsToSeconds(Number(duration))\n }\n\n get iterationDuration() {\n const { delay = 0 } = this.options || {}\n return this.duration + millisecondsToSeconds(delay)\n }\n\n get time() {\n return millisecondsToSeconds(Number(this.animation.currentTime) || 0)\n }\n\n set time(newTime: number) {\n const wasFinished = this.finishedTime !== null\n this.manualStartTime = null\n this.finishedTime = null\n this.animation.currentTime = secondsToMilliseconds(newTime)\n\n if (wasFinished) {\n this.animation.pause()\n }\n }\n\n /**\n * The playback speed of the animation.\n * 1 = normal speed, 2 = double speed, 0.5 = half speed.\n */\n get speed() {\n return this.animation.playbackRate\n }\n\n set speed(newSpeed: number) {\n // Allow backwards playback after finishing\n if (newSpeed < 0) this.finishedTime = null\n\n this.animation.playbackRate = newSpeed\n }\n\n get state() {\n return this.finishedTime !== null\n ? \"finished\"\n : this.animation.playState\n }\n\n get startTime() {\n return this.manualStartTime ?? Number(this.animation.startTime)\n }\n\n set startTime(newStartTime: number) {\n this.manualStartTime = this.animation.startTime = newStartTime\n }\n\n /**\n * Attaches a timeline to the animation, for instance the `ScrollTimeline`.\n */\n attachTimeline({\n timeline,\n rangeStart,\n rangeEnd,\n observe,\n }: TimelineWithFallback): VoidFunction {\n if (this.allowFlatten) {\n this.animation.effect?.updateTiming({ easing: \"linear\" })\n }\n\n this.animation.onfinish = null\n\n if (timeline && supportsScrollTimeline()) {\n this.animation.timeline = timeline as any\n\n if (rangeStart) (this.animation as any).rangeStart = rangeStart\n if (rangeEnd) (this.animation as any).rangeEnd = rangeEnd\n\n return noop\n } else {\n return observe(this)\n }\n }\n}\n"],"names":[],"mappings":";;;;;;;;AAyBA;;AAEG;AACG,MAAO,eACT,SAAQ,WAAW,CAAA;AAyBnB,IAAA,WAAA,CAAY,OAAgC,EAAA;AACxC,QAAA,KAAK,EAAE;QAlBD,IAAA,CAAA,YAAY,GAAkB,IAAI;QAMpC,IAAA,CAAA,SAAS,GAAG,KAAK;AAIzB;;;;AAIG;QACO,IAAA,CAAA,eAAe,GAAkB,IAAI;AAK3C,QAAA,IAAI,CAAC,OAAO;YAAE;AAEd,QAAA,MAAM,EACF,OAAO,EACP,IAAI,EACJ,SAAS,EACT,aAAa,EACb,YAAY,GAAG,KAAK,EACpB,aAAa,EACb,UAAU,GACb,GAAG,OAAc;AAElB,QAAA,IAAI,CAAC,eAAe,GAAG,OAAO,CAAC,aAAa,CAAC;AAE7C,QAAA,IAAI,CAAC,YAAY,GAAG,YAAY;AAChC,QAAA,IAAI,CAAC,OAAO,GAAG,OAAO;AAEtB,QAAA,SAAS,CACL,OAAO,OAAO,CAAC,IAAI,KAAK,QAAQ,EAChC,CAAA,kDAAA,CAAoD,EACpD,aAAa,CAChB;AAED,QAAA,MAAM,UAAU,GAAG,qBAAqB,CAAC,OAAO,CAAC;AAEjD,QAAA,IAAI,CAAC,SAAS,GAAG,mBAAmB,CAChC,OAAO,EACP,IAAI,EACJ,SAAS,EACT,UAAU,EACV,aAAa,CAChB;AAED,QAAA,IAAI,UAAU,CAAC,QAAQ,KAAK,KAAK,EAAE;AAC/B,YAAA,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE;QAC1B;AAEA,QAAA,IAAI,CAAC,SAAS,CAAC,QAAQ,GAAG,MAAK;AAC3B,YAAA,IAAI,CAAC,YAAY,GAAG,IAAI,CA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AG,QAAQ;AAEzD,YAAA,OAAO,IAAU;QACrB;aAAO;AACH,YAAA,OAAO,OAAO,CAAC,IAAI,CAAC;QACxB;IACJ;AACH;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/NativeAnimationExtended.mjs b/node_modules/motion-dom/dist/es/animation/NativeAnimationExtended.mjs new file mode 100644 index 0000000..06ece95 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/NativeAnimationExtended.mjs @@ -0,0 +1,88 @@ +import { clamp } from 'motion-utils'; +import { time } from '../frameloop/sync-time.mjs'; +import { setStyle } from '../render/dom/style-set.mjs'; +import { JSAnimation } from './JSAnimation.mjs'; +import { NativeAnimation } from './NativeAnimation.mjs'; +import { replaceTransitionType } from './utils/replace-transition-type.mjs'; +import { replaceStringEasing } from './waapi/utils/unsupported-easing.mjs'; + +/** + * 10ms is chosen here as it strikes a balance between smooth + * results (more than one keyframe per frame at 60fps) and + * keyframe quantity. + */ +const sampleDelta = 10; //ms +class NativeAnimationExtended extends NativeAnimation { + constructor(options) { + /** + * The base NativeAnimation function only supports a subset + * of Motion easings, and WAAPI also only supports some + * easing functions via string/cubic-bezier definitions. + * + * This function replaces those unsupported easing functions + * with a JS easing function. This will later get compiled + * to a linear() easing function. + */ + replaceStringEasing(options); + /** + * Ensure we replace the transition type with a generator function + * before passing to WAAPI. + * + * TODO: Does this have a better home? It could be shared with + * JSAnimation. + */ + replaceTransitionType(options); + super(options); + /** + * Only set startTime when the animation should autoplay. + * Setting startTime on a paused WAAPI animation unpauses it + * (per the WAAPI spec), which breaks autoplay: false. + */ + if (options.startTime !== undefined && options.autoplay !== false) { + this.startTime = options.startTime; + } + this.options = options; + } + /** + * WAAPI doesn't natively have any interruption capabilities. + * + * Rather than read committed styles back out of the DOM, we can + * create a renderless JS animation and sample it twice to calculate + * its current value, "previous" value, and therefore allow + * Motion to calculate velocity for any subsequent animation. + */ + updateMotionValue(value) { + const { motionValue, onUpdate, onComplete, element, ...options } = this.options; + if (!motionValue) + return; + if (value !== undefined) { + motionValue.set(value); + return; + } + const sampleAnimation = new JSAnimation({ + ...options, + autoplay: false, + }); + /** + * Use wall-clock elapsed time for sampling. + * Under CPU load, WAAPI's currentTime may not reflect actual + * elapsed time, causing incorrect sampling and visual jumps. + */ + const sampleTime = Math.max(sampleDelta, time.now() - this.startTime); + const delta = clamp(0, sampleDelta, sampleTime - sampleDelta); + const current = sampleAnimation.sample(sampleTime).value; + /** + * Write the estimated value to inline style so it persists + * after cancel(), covering the async gap before the next + * animation starts. + */ + const { name } = this.options; + if (element && name) + setStyle(element, name, current); + motionValue.setWithVelocity(sampleAnimation.sample(Math.max(0, sampleTime - delta)).value, current, delta); + sampleAnimation.stop(); + } +} + +export { NativeAnimationExtended }; +//# sourceMappingURL=NativeAnimationExtended.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/NativeAnimationExtended.mjs.map b/node_modules/motion-dom/dist/es/animation/NativeAnimationExtended.mjs.map new file mode 100644 index 0000000..9b2fb9c --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/NativeAnimationExtended.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"NativeAnimationExtended.mjs","sources":["../../../src/animation/NativeAnimationExtended.ts"],"sourcesContent":["import { clamp } from \"motion-utils\"\nimport { time } from \"../frameloop/sync-time\"\nimport { setStyle } from \"../render/dom/style-set\"\nimport { JSAnimation } from \"./JSAnimation\"\nimport { NativeAnimation, NativeAnimationOptions } from \"./NativeAnimation\"\nimport { AnyResolvedKeyframe, ValueAnimationOptions } from \"./types\"\nimport { replaceTransitionType } from \"./utils/replace-transition-type\"\nimport { replaceStringEasing } from \"./waapi/utils/unsupported-easing\"\n\nexport type NativeAnimationOptionsExtended =\n NativeAnimationOptions & ValueAnimationOptions & NativeAnimationOptions\n\n/**\n * 10ms is chosen here as it strikes a balance between smooth\n * results (more than one keyframe per frame at 60fps) and\n * keyframe quantity.\n */\nconst sampleDelta = 10 //ms\n\nexport class NativeAnimationExtended<\n T extends AnyResolvedKeyframe\n> extends NativeAnimation {\n options: NativeAnimationOptionsExtended\n\n constructor(options: NativeAnimationOptionsExtended) {\n /**\n * The base NativeAnimation function only supports a subset\n * of Motion easings, and WAAPI also only supports some\n * easing functions via string/cubic-bezier definitions.\n *\n * This function replaces those unsupported easing functions\n * with a JS easing function. This will later get compiled\n * to a linear() easing function.\n */\n replaceStringEasing(options)\n\n /**\n * Ensure we replace the transition type with a generator function\n * before passing to WAAPI.\n *\n * TODO: Does this have a better home? It could be shared with\n * JSAnimation.\n */\n replaceTransitionType(options)\n\n super(options)\n\n /**\n * Only set startTime when the animation should autoplay.\n * Setting startTime on a paused WAAPI animation unpauses it\n * (per the WAAPI spec), which breaks autoplay: false.\n */\n if (options.startTime !== undefined && options.autoplay !== false) {\n this.startTime = options.startTime\n }\n\n this.options = options\n }\n\n /**\n * WAAPI doesn't natively have any interruption capabilities.\n *\n * Rather than read committed styles back out of the DOM, we can\n * create a renderless JS animation and sample it twice to calculate\n * its current value, \"previous\" value, and therefore allow\n * Motion to calculate velocity for any subsequent animation.\n */\n updateMotionValue(value?: T) {\n const { motionValue, onUpdate, onComplete, element, ...options } =\n this.options\n\n if (!motionValue) return\n\n if (value !== undefined) {\n motionValue.set(value)\n return\n }\n\n const sampleAnimation = new JSAnimation({\n ...options,\n autoplay: false,\n })\n\n /**\n * Use wall-clock elapsed time for sampling.\n * Under CPU load, WAAPI's currentTime may not reflect actual\n * elapsed time, causing incorrect sampling and visual jumps.\n */\n const sampleTime = Math.max(sampleDelta, time.now() - this.startTime)\n const delta = clamp(0, sampleDelta, sampleTime - sampleDelta)\n const current = sampleAnimation.sample(sampleTime).value\n\n /**\n * Write the estimated value to inline style so it persists\n * after cancel(), covering the async gap before the next\n * animation starts.\n */\n const { name } = this.options\n if (element && name) setStyle(element, name, current)\n\n motionValue.setWithVelocity(\n sampleAnimation.sample(Math.max(0, sampleTime - delta)).value,\n current,\n delta\n )\n\n sampleAnimation.stop()\n }\n}\n"],"names":[],"m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;;AAIG;AACH,QAAA,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC,OAAO;QAC7B,IAAI,OAAO,IAAI,IAAI;AAAE,YAAA,QAAQ,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC;QAErD,WAAW,CAAC,eAAe,CACvB,eAAe,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,UAAU,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,EAC7D,OAAO,EACP,KAAK,CACR;QAED,eAAe,CAAC,IAAI,EAAE;IAC1B;AACH;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/NativeAnimationWrapper.mjs b/node_modules/motion-dom/dist/es/animation/NativeAnimationWrapper.mjs new file mode 100644 index 0000000..797a913 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/NativeAnimationWrapper.mjs @@ -0,0 +1,15 @@ +import { NativeAnimation } from './NativeAnimation.mjs'; + +class NativeAnimationWrapper extends NativeAnimation { + constructor(animation) { + super(); + this.animation = animation; + animation.onfinish = () => { + this.finishedTime = this.time; + this.notifyFinished(); + }; + } +} + +export { NativeAnimationWrapper }; +//# sourceMappingURL=NativeAnimationWrapper.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/NativeAnimationWrapper.mjs.map b/node_modules/motion-dom/dist/es/animation/NativeAnimationWrapper.mjs.map new file mode 100644 index 0000000..7990d58 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/NativeAnimationWrapper.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"NativeAnimationWrapper.mjs","sources":["../../../src/animation/NativeAnimationWrapper.ts"],"sourcesContent":["import { NativeAnimation } from \"./NativeAnimation\"\nimport { AnyResolvedKeyframe } from \"./types\"\n\nexport class NativeAnimationWrapper<\n T extends AnyResolvedKeyframe\n> extends NativeAnimation {\n constructor(animation: Animation) {\n super()\n\n this.animation = animation\n animation.onfinish = () => {\n this.finishedTime = this.time\n this.notifyFinished()\n }\n }\n}\n"],"names":[],"mappings":";;AAGM,MAAO,sBAEX,SAAQ,eAAkB,CAAA;AACxB,IAAA,WAAA,CAAY,SAAoB,EAAA;AAC5B,QAAA,KAAK,EAAE;AAEP,QAAA,IAAI,CAAC,SAAS,GAAG,SAAS;AAC1B,QAAA,SAAS,CAAC,QAAQ,GAAG,MAAK;AACtB,YAAA,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,IAAI;YAC7B,IAAI,CAAC,cAAc,EAAE;AACzB,QAAA,CAAC;IACL;AACH;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/animate/single-value.mjs b/node_modules/motion-dom/dist/es/animation/animate/single-value.mjs new file mode 100644 index 0000000..45767f1 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/animate/single-value.mjs @@ -0,0 +1,12 @@ +import { animateMotionValue } from '../interfaces/motion-value.mjs'; +import { motionValue } from '../../value/index.mjs'; +import { isMotionValue } from '../../value/utils/is-motion-value.mjs'; + +function animateSingleValue(value, keyframes, options) { + const motionValue$1 = isMotionValue(value) ? value : motionValue(value); + motionValue$1.start(animateMotionValue("", motionValue$1, keyframes, options)); + return motionValue$1.animation; +} + +export { animateSingleValue }; +//# sourceMappingURL=single-value.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/animate/single-value.mjs.map b/node_modules/motion-dom/dist/es/animation/animate/single-value.mjs.map new file mode 100644 index 0000000..64d11eb --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/animate/single-value.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"single-value.mjs","sources":["../../../../src/animation/animate/single-value.ts"],"sourcesContent":["import { animateMotionValue } from \"../interfaces/motion-value\"\nimport type {\n AnimationPlaybackControlsWithThen,\n AnyResolvedKeyframe,\n UnresolvedValueKeyframe,\n ValueAnimationTransition,\n} from \"../types\"\nimport {\n motionValue as createMotionValue,\n MotionValue,\n} from \"../../value\"\nimport { isMotionValue } from \"../../value/utils/is-motion-value\"\n\nexport function animateSingleValue(\n value: MotionValue | V,\n keyframes: V | UnresolvedValueKeyframe[],\n options?: ValueAnimationTransition\n): AnimationPlaybackControlsWithThen {\n const motionValue = isMotionValue(value) ? value : createMotionValue(value)\n\n motionValue.start(animateMotionValue(\"\", motionValue, keyframes, options))\n\n return motionValue.animation!\n}\n"],"names":["motionValue","createMotionValue"],"mappings":";;;;SAagB,kBAAkB,CAC9B,KAAyB,EACzB,SAA2C,EAC3C,OAAkC,EAAA;AAElC,IAAA,MAAMA,aAAW,GAAG,aAAa,CAAC,KAAK,CAAC,GAAG,KAAK,GAAGC,WAAiB,CAAC,KAAK,CAAC;AAE3E,IAAAD,aAAW,CAAC,KAAK,CAAC,kBAAkB,CAAC,EAAE,EAAEA,aAAW,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;IAE1E,OAAOA,aAAW,CAAC,SAAU;AACjC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/drivers/frame.mjs b/node_modules/motion-dom/dist/es/animation/drivers/frame.mjs new file mode 100644 index 0000000..92eecd8 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/drivers/frame.mjs @@ -0,0 +1,18 @@ +import { time } from '../../frameloop/sync-time.mjs'; +import { frameData, cancelFrame, frame } from '../../frameloop/frame.mjs'; + +const frameloopDriver = (update) => { + const passTimestamp = ({ timestamp }) => update(timestamp); + return { + start: (keepAlive = true) => frame.update(passTimestamp, keepAlive), + stop: () => cancelFrame(passTimestamp), + /** + * If we're processing this frame we can use the + * framelocked timestamp to keep things in sync. + */ + now: () => (frameData.isProcessing ? frameData.timestamp : time.now()), + }; +}; + +export { frameloopDriver }; +//# sourceMappingURL=frame.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/drivers/frame.mjs.map b/node_modules/motion-dom/dist/es/animation/drivers/frame.mjs.map new file mode 100644 index 0000000..99f6315 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/drivers/frame.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"frame.mjs","sources":["../../../../src/animation/drivers/frame.ts"],"sourcesContent":["import { cancelFrame, frame, frameData } from \"../../frameloop\"\nimport { time } from \"../../frameloop/sync-time\"\nimport { FrameData } from \"../../frameloop/types\"\nimport { Driver } from \"./types\"\n\nexport const frameloopDriver: Driver = (update) => {\n const passTimestamp = ({ timestamp }: FrameData) => update(timestamp)\n\n return {\n start: (keepAlive = true) => frame.update(passTimestamp, keepAlive),\n stop: () => cancelFrame(passTimestamp),\n /**\n * If we're processing this frame we can use the\n * framelocked timestamp to keep things in sync.\n */\n now: () => (frameData.isProcessing ? frameData.timestamp : time.now()),\n }\n}\n"],"names":[],"mappings":";;;AAKO,MAAM,eAAe,GAAW,CAAC,MAAM,KAAI;AAC9C,IAAA,MAAM,aAAa,GAAG,CAAC,EAAE,SAAS,EAAa,KAAK,MAAM,CAAC,SAAS,CAAC;IAErE,OAAO;AACH,QAAA,KAAK,EAAE,CAAC,SAAS,GAAG,IAAI,KAAK,KAAK,CAAC,MAAM,CAAC,aAAa,EAAE,SAAS,CAAC;AACnE,QAAA,IAAI,EAAE,MAAM,WAAW,CAAC,aAAa,CAAC;AACtC;;;AAGG;QACH,GAAG,EAAE,OAAO,SAAS,CAAC,YAAY,GAAG,SAAS,CAAC,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;KACzE;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/generators/inertia.mjs b/node_modules/motion-dom/dist/es/animation/generators/inertia.mjs new file mode 100644 index 0000000..dc6789a --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/generators/inertia.mjs @@ -0,0 +1,88 @@ +import { spring } from './spring.mjs'; +import { getGeneratorVelocity } from './utils/velocity.mjs'; + +function inertia({ keyframes, velocity = 0.0, power = 0.8, timeConstant = 325, bounceDamping = 10, bounceStiffness = 500, modifyTarget, min, max, restDelta = 0.5, restSpeed, }) { + const origin = keyframes[0]; + const state = { + done: false, + value: origin, + }; + const isOutOfBounds = (v) => (min !== undefined && v < min) || (max !== undefined && v > max); + const nearestBoundary = (v) => { + if (min === undefined) + return max; + if (max === undefined) + return min; + return Math.abs(min - v) < Math.abs(max - v) ? min : max; + }; + let amplitude = power * velocity; + const ideal = origin + amplitude; + const target = modifyTarget === undefined ? ideal : modifyTarget(ideal); + /** + * If the target has changed we need to re-calculate the amplitude, otherwise + * the animation will start from the wrong position. + */ + if (target !== ideal) + amplitude = target - origin; + const calcDelta = (t) => -amplitude * Math.exp(-t / timeConstant); + const calcLatest = (t) => target + calcDelta(t); + const applyFriction = (t) => { + const delta = calcDelta(t); + const latest = calcLatest(t); + state.done = Math.abs(delta) <= restDelta; + state.value = state.done ? target : latest; + }; + /** + * Ideally this would resolve for t in a stateless way, we could + * do that by always precalculating the animation but as we know + * this will be done anyway we can assume that spring will + * be discovered during that. + */ + let timeReachedBoundary; + let spring$1; + const checkCatchBoundary = (t) => { + if (!isOutOfBounds(state.value)) + return; + timeReachedBoundary = t; + spring$1 = spring({ + keyframes: [state.value, nearestBoundary(state.value)], + velocity: getGeneratorVelocity(calcLatest, t, state.value), // TODO: This should be passing * 1000 + damping: bounceDamping, + stiffness: bounceStiffness, + restDelta, + restSpeed, + }); + }; + checkCatchBoundary(0); + return { + calculatedDuration: null, + next: (t) => { + /** + * We need to resolve the friction to figure out if we need a + * spring but we don't want to do this twice per frame. So here + * we flag if we updated for this frame and later if we did + * we can skip doing it again. + */ + let hasUpdatedFrame = false; + if (!spring$1 && timeReachedBoundary === undefined) { + hasUpdatedFrame = true; + applyFriction(t); + checkCatchBoundary(t); + } + /** + * If we have a spring and the provided t is beyond the moment the friction + * animation crossed the min/max boundary, use the spring. + */ + if (timeReachedBoundary !== undefined && t >= timeReachedBoundary) { + return spring$1.next(t - timeReachedBoundary); + } + else { + !hasUpdatedFrame && applyFriction(t); + return state; + } + }, + }; +} + +export { inertia }; +//# sourceMappingURL=inertia.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/generators/inertia.mjs.map b/node_modules/motion-dom/dist/es/animation/generators/inertia.mjs.map new file mode 100644 index 0000000..11402a7 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/generators/inertia.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"inertia.mjs","sources":["../../../../src/animation/generators/inertia.ts"],"sourcesContent":["import {\n AnimationState,\n KeyframeGenerator,\n ValueAnimationOptions,\n} from \"../types\"\nimport { spring as createSpring } from \"./spring\"\nimport { getGeneratorVelocity } from \"./utils/velocity\"\n\nexport function inertia({\n keyframes,\n velocity = 0.0,\n power = 0.8,\n timeConstant = 325,\n bounceDamping = 10,\n bounceStiffness = 500,\n modifyTarget,\n min,\n max,\n restDelta = 0.5,\n restSpeed,\n}: ValueAnimationOptions): KeyframeGenerator {\n const origin = keyframes[0]\n\n const state: AnimationState = {\n done: false,\n value: origin,\n }\n\n const isOutOfBounds = (v: number) =>\n (min !== undefined && v < min) || (max !== undefined && v > max)\n\n const nearestBoundary = (v: number) => {\n if (min === undefined) return max\n if (max === undefined) return min\n\n return Math.abs(min - v) < Math.abs(max - v) ? min : max\n }\n\n let amplitude = power * velocity\n const ideal = origin + amplitude\n const target = modifyTarget === undefined ? ideal : modifyTarget(ideal)\n\n /**\n * If the target has changed we need to re-calculate the amplitude, otherwise\n * the animation will start from the wrong position.\n */\n if (target !== ideal) amplitude = target - origin\n\n const calcDelta = (t: number) => -amplitude * Math.exp(-t / timeConstant)\n\n const calcLatest = (t: number) => target + calcDelta(t)\n\n const applyFriction = (t: number) => {\n const delta = calcDelta(t)\n const latest = calcLatest(t)\n state.done = Math.abs(delta) <= restDelta\n state.value = state.done ? target : latest\n }\n\n /**\n * Ideally this would resolve for t in a stateless way, we could\n * do that by always precalculating the animation but as we know\n * this will be done anyway we can assume that spring will\n * be discovered during that.\n */\n let timeReachedBoundary: number | undefined\n let spring: KeyframeGenerator | undefined\n\n const checkCatchBoundary = (t: number) => {\n if (!isOutOfBounds(state.value)) return\n\n timeReachedBoundary = t\n\n spring = createSpring({\n keyframes: [state.value, nearestBoundary(state.value)!],\n velocity: getGeneratorVelocity(calcLatest, t, state.value), // TODO: This should be passing * 1000\n damping: bounceDamping,\n stiffness: bounceStiffness,\n restDelta,\n restSpeed,\n })\n }\n\n checkCatchBoundary(0)\n\n return {\n calculatedDuration: null,\n next: (t: number) => {\n /**\n * We need to resolve the friction to figure out if we need a\n * spring but we don't want to do this twice per frame. So here\n * we flag if we updated for this frame and later if we did\n * we can skip doing it again.\n */\n let hasUpdatedFrame = false\n if (!spring && timeReachedBoundary === undefined) {\n hasUpdatedFrame = true\n applyFriction(t)\n checkCatchBoundary(t)\n }\n\n /**\n * If we have a spring and the provided t is beyond the moment the friction\n * animation crossed the min/max boundary, use the spring.\n */\n if (timeReachedBoundary !== undefined && t >= timeReachedBoundary) {\n return spring!.next(t - timeReachedBoundary)\n } else {\n !hasUpdatedFrame && applyFriction(t)\n return state\n }\n },\n }\n}\n"],"names":["spring","createSpring"],"mappings":";;;SAQgB,OAAO,CAAC,EACpB,SAAS,EACT,QAAQ,GAAG,GAAG,EACd,KAAK,GAAG,GAAG,EACX,YAAY,GAAG,GAAG,EAClB,aAAa,GAAG,EAAE,EAClB,eAAe,GAAG,GAAG,EACrB,YAAY,EACZ,GAAG,EACH,GAAG,EACH,SAAS,GAAG,GAAG,EACf,SAAS,GACmB,EAAA;AAC5B,IAAA,MAAM,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;AAE3B,IAAA,MAAM,KAAK,GAA2B;AAClC,QAAA,IAAI,EAAE,KAAK;AACX,QAAA,KAAK,EAAE,MAAM;KAChB;IAED,MAAM,aAAa,GAAG,CAAC,CAAS,KAC5B,CAAC,GAAG,KAAK,SAAS,IAAI,CAAC,GAAG,GAAG,MAAM,GAAG,KAAK,SAAS,IAAI,CAAC,GAAG,GAAG,CAAC;AAEpE,IAAA,MAAM,eAAe,GAAG,CAAC,CAAS,KAAI;QAClC,IAAI,GAAG,KAAK,SAAS;AAAE,YAAA,OAAO,GAAG;QACjC,IAAI,GAAG,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,QAAM,GAAGC,MAAY,CAAC;AAClB,YAAA,SAAS,EAAE,CAAC,KAAK,CAAC,KAAK,EAAE,eAAe,CAAC,KAAK,CAAC,KAAK,CAAE,CAAC;AACvD,YAAA,QAAQ,EAAE,oBAAoB,CAAC,UAAU,EAAE,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC;AAC1D,YAAA,OAAO,EAAE,aAAa;AACtB,YAAA,SAAS,EAAE,eAAe;YAC1B,SAAS;YACT,SAAS;AACZ,SAAA,CAAC;AACN,IAAA,CAAC;IAED,kBAAkB,CAAC,CAAC,CAAC;IAErB,OAAO;AACH,QAAA,kBAAkB,EAAE,IAAI;AACxB,QAAA,IAAI,EAAE,CAAC,CAAS,KAAI;AAChB;;;;;AAKG;YACH,IAAI,eAAe,GAAG,KAAK;AAC3B,YAAA,IAAI,CAACD,QAAM,IAAI,mBAAmB,KAAK,SAAS,EAAE;gBAC9C,eAAe,GAAG,IAAI;gBACtB,aAAa,CAAC,CAAC,CAAC;gBAChB,kBAAkB,CAAC,CAAC,CAAC;YACzB;AAEA;;;AAGG;YACH,IAAI,mBAAmB,KAAK,SAAS,IAAI,CAAC,IAAI,mBAAmB,EAAE;gBAC/D,OAAOA,QAAO,CAAC,IAAI,CAAC,CAAC,GAAG,mBAAmB,CAAC;YAChD;iBAAO;AACH,gBAAA,CAAC,eAAe,IAAI,aAAa,CAAC,CAAC,CAAC;AACpC,gBAAA,OAAO,KAAK;YAChB;QACJ,CAAC;KACJ;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/generators/keyframes.mjs b/node_modules/motion-dom/dist/es/animation/generators/keyframes.mjs new file mode 100644 index 0000000..aeca916 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/generators/keyframes.mjs @@ -0,0 +1,50 @@ +import { easeInOut, isEasingArray, easingDefinitionToFunction } from 'motion-utils'; +import { interpolate } from '../../utils/interpolate.mjs'; +import { defaultOffset } from '../keyframes/offsets/default.mjs'; +import { convertOffsetToTimes } from '../keyframes/offsets/time.mjs'; + +function defaultEasing(values, easing) { + return values.map(() => easing || easeInOut).splice(0, values.length - 1); +} +function keyframes({ duration = 300, keyframes: keyframeValues, times, ease = "easeInOut", }) { + /** + * Easing functions can be externally defined as strings. Here we convert them + * into actual functions. + */ + const easingFunctions = isEasingArray(ease) + ? ease.map(easingDefinitionToFunction) + : easingDefinitionToFunction(ease); + /** + * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator + * to reduce GC during animation. + */ + const state = { + done: false, + value: keyframeValues[0], + }; + /** + * Create a times array based on the provided 0-1 offsets + */ + const absoluteTimes = convertOffsetToTimes( + // Only use the provided offsets if they're the correct length + // TODO Maybe we should warn here if there's a length mismatch + times && times.length === keyframeValues.length + ? times + : defaultOffset(keyframeValues), duration); + const mapTimeToKeyframe = interpolate(absoluteTimes, keyframeValues, { + ease: Array.isArray(easingFunctions) + ? easingFunctions + : defaultEasing(keyframeValues, easingFunctions), + }); + return { + calculatedDuration: duration, + next: (t) => { + state.value = mapTimeToKeyframe(t); + state.done = t >= duration; + return state; + }, + }; +} + +export { defaultEasing, keyframes }; +//# sourceMappingURL=keyframes.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/generators/keyframes.mjs.map b/node_modules/motion-dom/dist/es/animation/generators/keyframes.mjs.map new file mode 100644 index 0000000..0cb3bdc --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/generators/keyframes.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"keyframes.mjs","sources":["../../../../src/animation/generators/keyframes.ts"],"sourcesContent":["import {\n easeInOut,\n easingDefinitionToFunction,\n EasingFunction,\n isEasingArray,\n} from \"motion-utils\"\nimport { interpolate } from \"../../utils/interpolate\"\nimport { defaultOffset } from \"../keyframes/offsets/default\"\nimport { convertOffsetToTimes } from \"../keyframes/offsets/time\"\nimport {\n AnimationState,\n AnyResolvedKeyframe,\n KeyframeGenerator,\n ValueAnimationOptions,\n} from \"../types\"\n\nexport function defaultEasing(\n values: any[],\n easing?: EasingFunction\n): EasingFunction[] {\n return values.map(() => easing || easeInOut).splice(0, values.length - 1)\n}\n\nexport function keyframes({\n duration = 300,\n keyframes: keyframeValues,\n times,\n ease = \"easeInOut\",\n}: ValueAnimationOptions): KeyframeGenerator {\n /**\n * Easing functions can be externally defined as strings. Here we convert them\n * into actual functions.\n */\n const easingFunctions = isEasingArray(ease)\n ? ease.map(easingDefinitionToFunction)\n : easingDefinitionToFunction(ease)\n\n /**\n * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator\n * to reduce GC during animation.\n */\n const state: AnimationState = {\n done: false,\n value: keyframeValues[0],\n }\n\n /**\n * Create a times array based on the provided 0-1 offsets\n */\n const absoluteTimes = convertOffsetToTimes(\n // Only use the provided offsets if they're the correct length\n // TODO Maybe we should warn here if there's a length mismatch\n times && times.length === keyframeValues.length\n ? times\n : defaultOffset(keyframeValues),\n duration\n )\n\n const mapTimeToKeyframe = interpolate(absoluteTimes, keyframeValues, {\n ease: Array.isArray(easingFunctions)\n ? easingFunctions\n : defaultEasing(keyframeValues, easingFunctions),\n })\n\n return {\n calculatedDuration: duration,\n next: (t: number) => {\n state.value = mapTimeToKeyframe(t)\n state.done = t >= duration\n return state\n },\n }\n}\n"],"names":[],"mappings":";;;;;AAgBM,SAAU,aAAa,CACzB,MAAa,EACb,MAAuB,EAAA;IAEvB,OAAO,MAAM,CAAC,GAAG,CAAC,MAAM,MAAM,IAAI,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;AAC7E;SAEgB,SAAS,CAAgC,EACrD,QAAQ,GAAG,GAAG,EACd,SAAS,EAAE,cAAc,EACzB,KAAK,EACL,IAAI,GAAG,WAAW,GACK,EAAA;AACvB;;;AAGG;AACH,IAAA,MAAM,eAAe,GAAG,aAAa,CAAC,IAAI;AACtC,UAAE,IAAI,CAAC,GAAG,CAAC,0BAA0B;AACrC,UAAE,0BAA0B,CAAC,IAAI,CAAC;AAEtC;;;AAGG;AACH,IAAA,MAAM,KAAK,GAAsB;AAC7B,QAAA,IAAI,EAAE,KAAK;AACX,QAAA,KAAK,EAAE,cAAc,CAAC,CAAC,CAAC;KAC3B;AAED;;AAEG;IACH,MAAM,aAAa,GAAG,oBAAoB;;;AAGtC,IAAA,KAAK,IAAI,KAAK,CAAC,MAAM,KAAK,cAAc,CAAC;AACrC,UAAE;UACA,aAAa,CAAC,cAAc,CAAC,EACnC,QAAQ,CACX;AAED,IAAA,MAAM,iBAAiB,GAAG,WAAW,CAAI,aAAa,EAAE,cAAc,EAAE;AACpE,QAAA,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,eAAe;AAC/B,cAAE;AACF,cAAE,aAAa,CAAC,cAAc,EAAE,eAAe,CAAC;AACvD,KAAA,CAAC;IAEF,OAAO;AACH,QAAA,kBAAkB,EAAE,QAAQ;AAC5B,QAAA,IAAI,EAAE,CAAC,CAAS,KAAI;AAChB,YAAA,KAAK,CAAC,KAAK,GAAG,iBAAiB,CAAC,CAAC,CAAC;AAClC,YAAA,KAAK,CAAC,IAAI,GAAG,CAAC,IAAI,QAAQ;AAC1B,YAAA,OAAO,KAAK;QAChB,CAAC;KACJ;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/generators/spring.mjs b/node_modules/motion-dom/dist/es/animation/generators/spring.mjs new file mode 100644 index 0000000..2615a91 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/generators/spring.mjs @@ -0,0 +1,329 @@ +import { millisecondsToSeconds, clamp, secondsToMilliseconds, warning } from 'motion-utils'; +import { generateLinearEasing } from '../waapi/utils/linear.mjs'; +import { calcGeneratorDuration, maxGeneratorDuration } from './utils/calc-duration.mjs'; +import { createGeneratorEasing } from './utils/create-generator-easing.mjs'; + +const springDefaults = { + // Default spring physics + stiffness: 100, + damping: 10, + mass: 1.0, + velocity: 0.0, + // Default duration/bounce-based options + duration: 800, // in ms + bounce: 0.3, + visualDuration: 0.3, // in seconds + // Rest thresholds + restSpeed: { + granular: 0.01, + default: 2, + }, + restDelta: { + granular: 0.005, + default: 0.5, + }, + // Limits + minDuration: 0.01, // in seconds + maxDuration: 10.0, // in seconds + minDamping: 0.05, + maxDamping: 1, +}; +function calcAngularFreq(undampedFreq, dampingRatio) { + return undampedFreq * Math.sqrt(1 - dampingRatio * dampingRatio); +} +const rootIterations = 12; +function approximateRoot(envelope, derivative, initialGuess) { + let result = initialGuess; + for (let i = 1; i < rootIterations; i++) { + result = result - envelope(result) / derivative(result); + } + return result; +} +/** + * This is ported from the Framer implementation of duration-based spring resolution. + */ +const safeMin = 0.001; +function findSpring({ duration = springDefaults.duration, bounce = springDefaults.bounce, velocity = springDefaults.velocity, mass = springDefaults.mass, }) { + let envelope; + let derivative; + warning(duration <= secondsToMilliseconds(springDefaults.maxDuration), "Spring duration must be 10 seconds or less", "spring-duration-limit"); + let dampingRatio = 1 - bounce; + /** + * Restrict dampingRatio and duration to within acceptable ranges. + */ + dampingRatio = clamp(springDefaults.minDamping, springDefaults.maxDamping, dampingRatio); + duration = clamp(springDefaults.minDuration, springDefaults.maxDuration, millisecondsToSeconds(duration)); + if (dampingRatio < 1) { + /** + * Underdamped spring + */ + envelope = (undampedFreq) => { + const exponentialDecay = undampedFreq * dampingRatio; + const delta = exponentialDecay * duration; + const a = exponentialDecay - velocity; + const b = calcAngularFreq(undampedFreq, dampingRatio); + const c = Math.exp(-delta); + return safeMin - (a / b) * c; + }; + derivative = (undampedFreq) => { + const exponentialDecay = undampedFreq * dampingRatio; + const delta = exponentialDecay * duration; + const d = delta * velocity + velocity; + const e = Math.pow(dampingRatio, 2) * Math.pow(undampedFreq, 2) * duration; + const f = Math.exp(-delta); + const g = calcAngularFreq(Math.pow(undampedFreq, 2), dampingRatio); + const factor = -envelope(undampedFreq) + safeMin > 0 ? -1 : 1; + return (factor * ((d - e) * f)) / g; + }; + } + else { + /** + * Critically-damped spring + */ + envelope = (undampedFreq) => { + const a = Math.exp(-undampedFreq * duration); + const b = (undampedFreq - velocity) * duration + 1; + return -safeMin + a * b; + }; + derivative = (undampedFreq) => { + const a = Math.exp(-undampedFreq * duration); + const b = (velocity - undampedFreq) * (duration * duration); + return a * b; + }; + } + const initialGuess = 5 / duration; + const undampedFreq = approximateRoot(envelope, derivative, initialGuess); + duration = secondsToMilliseconds(duration); + if (isNaN(undampedFreq)) { + return { + stiffness: springDefaults.stiffness, + damping: springDefaults.damping, + duration, + }; + } + else { + const stiffness = Math.pow(undampedFreq, 2) * mass; + return { + stiffness, + damping: dampingRatio * 2 * Math.sqrt(mass * stiffness), + duration, + }; + } +} +const durationKeys = ["duration", "bounce"]; +const physicsKeys = ["stiffness", "damping", "mass"]; +function isSpringType(options, keys) { + return keys.some((key) => options[key] !== undefined); +} +function getSpringOptions(options) { + let springOptions = { + velocity: springDefaults.velocity, + stiffness: springDefaults.stiffness, + damping: springDefaults.damping, + mass: springDefaults.mass, + isResolvedFromDuration: false, + ...options, + }; + // stiffness/damping/mass overrides duration/bounce + if (!isSpringType(options, physicsKeys) && + isSpringType(options, durationKeys)) { + // Time-defined springs should ignore inherited velocity. + // Velocity from interrupted animations can cause findSpring() + // to compute wildly different spring parameters, leading to + // massive oscillation on small-range animations. + springOptions.velocity = 0; + if (options.visualDuration) { + const visualDuration = options.visualDuration; + const root = (2 * Math.PI) / (visualDuration * 1.2); + const stiffness = root * root; + const damping = 2 * + clamp(0.05, 1, 1 - (options.bounce || 0)) * + Math.sqrt(stiffness); + springOptions = { + ...springOptions, + mass: springDefaults.mass, + stiffness, + damping, + }; + } + else { + const derived = findSpring({ ...options, velocity: 0 }); + springOptions = { + ...springOptions, + ...derived, + mass: springDefaults.mass, + }; + springOptions.isResolvedFromDuration = true; + } + } + return springOptions; +} +function spring(optionsOrVisualDuration = springDefaults.visualDuration, bounce = springDefaults.bounce) { + const options = typeof optionsOrVisualDuration !== "object" + ? { + visualDuration: optionsOrVisualDuration, + keyframes: [0, 1], + bounce, + } + : optionsOrVisualDuration; + let { restSpeed, restDelta } = options; + const origin = options.keyframes[0]; + const target = options.keyframes[options.keyframes.length - 1]; + /** + * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator + * to reduce GC during animation. + */ + const state = { done: false, value: origin }; + const { stiffness, damping, mass, duration, velocity, isResolvedFromDuration, } = getSpringOptions({ + ...options, + velocity: -millisecondsToSeconds(options.velocity || 0), + }); + const initialVelocity = velocity || 0.0; + const dampingRatio = damping / (2 * Math.sqrt(stiffness * mass)); + const initialDelta = target - origin; + const undampedAngularFreq = millisecondsToSeconds(Math.sqrt(stiffness / mass)); + /** + * If we're working on a granular scale, use smaller defaults for determining + * when the spring is finished. + * + * These defaults have been selected emprically based on what strikes a good + * ratio between feeling good and finishing as soon as changes are imperceptible. + */ + const isGranularScale = Math.abs(initialDelta) < 5; + restSpeed || (restSpeed = isGranularScale + ? springDefaults.restSpeed.granular + : springDefaults.restSpeed.default); + restDelta || (restDelta = isGranularScale + ? springDefaults.restDelta.granular + : springDefaults.restDelta.default); + let resolveSpring; + let resolveVelocity; + // Underdamped coefficients, hoisted for use in the inlined next() hot path + let angularFreq; + let A; + let sinCoeff; + let cosCoeff; + if (dampingRatio < 1) { + angularFreq = calcAngularFreq(undampedAngularFreq, dampingRatio); + A = + (initialVelocity + + dampingRatio * undampedAngularFreq * initialDelta) / + angularFreq; + // Underdamped spring + resolveSpring = (t) => { + const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); + return (target - + envelope * + (A * Math.sin(angularFreq * t) + + initialDelta * Math.cos(angularFreq * t))); + }; + // Analytical derivative of underdamped spring (px/ms) + sinCoeff = + dampingRatio * undampedAngularFreq * A + initialDelta * angularFreq; + cosCoeff = + dampingRatio * undampedAngularFreq * initialDelta - A * angularFreq; + resolveVelocity = (t) => { + const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); + return envelope * + (sinCoeff * Math.sin(angularFreq * t) + + cosCoeff * Math.cos(angularFreq * t)); + }; + } + else if (dampingRatio === 1) { + // Critically damped spring + resolveSpring = (t) => target - + Math.exp(-undampedAngularFreq * t) * + (initialDelta + + (initialVelocity + undampedAngularFreq * initialDelta) * t); + // Analytical derivative of critically damped spring (px/ms) + const C = initialVelocity + undampedAngularFreq * initialDelta; + resolveVelocity = (t) => Math.exp(-undampedAngularFreq * t) * + (undampedAngularFreq * C * t - initialVelocity); + } + else { + // Overdamped spring + const dampedAngularFreq = undampedAngularFreq * Math.sqrt(dampingRatio * dampingRatio - 1); + resolveSpring = (t) => { + const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); + // When performing sinh or cosh values can hit Infinity so we cap them here + const freqForT = Math.min(dampedAngularFreq * t, 300); + return (target - + (envelope * + ((initialVelocity + + dampingRatio * undampedAngularFreq * initialDelta) * + Math.sinh(freqForT) + + dampedAngularFreq * + initialDelta * + Math.cosh(freqForT))) / + dampedAngularFreq); + }; + // Analytical derivative of overdamped spring (px/ms) + const P = (initialVelocity + + dampingRatio * undampedAngularFreq * initialDelta) / + dampedAngularFreq; + const sinhCoeff = dampingRatio * undampedAngularFreq * P - initialDelta * dampedAngularFreq; + const coshCoeff = dampingRatio * undampedAngularFreq * initialDelta - P * dampedAngularFreq; + resolveVelocity = (t) => { + const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); + const freqForT = Math.min(dampedAngularFreq * t, 300); + return envelope * + (sinhCoeff * Math.sinh(freqForT) + + coshCoeff * Math.cosh(freqForT)); + }; + } + const generator = { + calculatedDuration: isResolvedFromDuration ? duration || null : null, + velocity: (t) => secondsToMilliseconds(resolveVelocity(t)), + next: (t) => { + /** + * For underdamped physics springs we need both position and + * velocity each tick. Compute shared trig values once to avoid + * duplicate Math.exp/sin/cos calls on the hot path. + */ + if (!isResolvedFromDuration && dampingRatio < 1) { + const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); + const sin = Math.sin(angularFreq * t); + const cos = Math.cos(angularFreq * t); + const current = target - + envelope * + (A * sin + initialDelta * cos); + const currentVelocity = secondsToMilliseconds(envelope * + (sinCoeff * sin + cosCoeff * cos)); + state.done = + Math.abs(currentVelocity) <= restSpeed && + Math.abs(target - current) <= restDelta; + state.value = state.done ? target : current; + return state; + } + const current = resolveSpring(t); + if (!isResolvedFromDuration) { + const currentVelocity = secondsToMilliseconds(resolveVelocity(t)); + state.done = + Math.abs(currentVelocity) <= restSpeed && + Math.abs(target - current) <= restDelta; + } + else { + state.done = t >= duration; + } + state.value = state.done ? target : current; + return state; + }, + toString: () => { + const calculatedDuration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration); + const easing = generateLinearEasing((progress) => generator.next(calculatedDuration * progress).value, calculatedDuration, 30); + return calculatedDuration + "ms " + easing; + }, + toTransition: () => { }, + }; + return generator; +} +spring.applyToOptions = (options) => { + const generatorOptions = createGeneratorEasing(options, 100, spring); + options.ease = generatorOptions.ease; + options.duration = secondsToMilliseconds(generatorOptions.duration); + options.type = "keyframes"; + return options; +}; + +export { spring }; +//# sourceMappingURL=spring.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/generators/spring.mjs.map b/node_modules/motion-dom/dist/es/animation/generators/spring.mjs.map new file mode 100644 index 0000000..5c18f97 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/generators/spring.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"spring.mjs","sources":["../../../../src/animation/generators/spring.ts"],"sourcesContent":["import {\n clamp,\n millisecondsToSeconds,\n secondsToMilliseconds,\n warning,\n} from \"motion-utils\"\nimport {\n AnimationState,\n KeyframeGenerator,\n SpringOptions,\n Transition,\n ValueAnimationOptions,\n} from \"../types\"\nimport { generateLinearEasing } from \"../waapi/utils/linear\"\nimport {\n calcGeneratorDuration,\n maxGeneratorDuration,\n} from \"./utils/calc-duration\"\nimport { createGeneratorEasing } from \"./utils/create-generator-easing\"\n\nconst springDefaults = {\n // Default spring physics\n stiffness: 100,\n damping: 10,\n mass: 1.0,\n velocity: 0.0,\n\n // Default duration/bounce-based options\n duration: 800, // in ms\n bounce: 0.3,\n visualDuration: 0.3, // in seconds\n\n // Rest thresholds\n restSpeed: {\n granular: 0.01,\n default: 2,\n },\n restDelta: {\n granular: 0.005,\n default: 0.5,\n },\n\n // Limits\n minDuration: 0.01, // in seconds\n maxDuration: 10.0, // in seconds\n minDamping: 0.05,\n maxDamping: 1,\n}\n\nfunction calcAngularFreq(undampedFreq: number, dampingRatio: number) {\n return undampedFreq * Math.sqrt(1 - dampingRatio * dampingRatio)\n}\n\nconst rootIterations = 12\nfunction approximateRoot(\n envelope: (num: number) => number,\n derivative: (num: number) => number,\n initialGuess: number\n): number {\n let result = initialGuess\n for (let i = 1; i < rootIterations; i++) {\n result = result - envelope(result) / derivative(result)\n }\n return result\n}\n\n/**\n * This is ported from the Framer implementation of duration-based spring resolution.\n */\nconst safeMin = 0.001\n\nfunction findSpring({\n duration = springDefaults.duration,\n bounce = springDefaults.bounce,\n velocity = springDefaults.velocity,\n mass = springDefaults.mass,\n}: SpringOptions) {\n let envelope: (num: number) => number\n let derivative: (num: number) => number\n\n warning(\n duration <= secondsToMilliseconds(springDefaults.maxDuration),\n \"Spring duration must be 10 seconds or less\",\n \"spring-duration-limit\"\n )\n\n let dampingRatio = 1 - bounce\n\n /**\n * Restrict dampingRatio and duration to within acceptable ranges.\n */\n dampingRatio = clamp(\n springDefaults.minDamping,\n springDefaults.maxDamping,\n dampingRatio\n )\n duration = clamp(\n springDefaults.minDuration,\n springDefaults.maxDuration,\n millisecondsToSeconds(duration)\n )\n\n if (dampingRatio < 1) {\n /**\n * Underdamped spring\n */\n envelope = (undampedFreq) => {\n const exponentialDecay = undampedFreq * dampingRatio\n const delta = exponentialDecay * duration\n const a = exponentialDecay - velocity\n const b = calcAngularFreq(undampedFreq, dampingRatio)\n const c = Math.exp(-delta)\n return safeMin - (a / b) * c\n }\n\n derivative = (undampedFreq) => {\n const exponentialDecay = undampedFreq * dampingRatio\n const delta = exponentialDecay * duration\n const d = delta * velocity + velocity\n const e =\n Math.pow(dampingRatio, 2) * Math.pow(undampedFreq, 2) * duration\n const f = Math.exp(-delta)\n const g = calcAngularFreq(Math.pow(undampedFreq, 2), dampingRatio)\n const factor = -envelope(undampedFreq) + safeMin > 0 ? -1 : 1\n return (factor * ((d - e) * f)) / g\n }\n } else {\n /**\n * Critically-damped spring\n */\n envelope = (undampedFreq) => {\n const a = Math.exp(-undampedFreq * duration)\n const b = (undampedFreq - velocity) * duration + 1\n return -safeMin + a * b\n }\n\n derivative = (undampedFreq) => {\n const a = Math.exp(-undampedFreq * duration)\n const b = (velocity - undampedFreq) * (duration * duration)\n return a * b\n }\n }\n\n const initialGuess = 5 / duration\n const undampedFreq = approximateRoot(envelope, derivative, initialGuess)\n\n duration = secondsToMilliseconds(duration)\n if (isNaN(undampedFreq)) {\n return {\n stiffness: springDefaults.stiffness,\n damping: springDefaults.damping,\n duration,\n }\n } else {\n const stiffness = Math.pow(undampedFreq, 2) * mass\n return {\n stiffness,\n damping: dampingRatio * 2 * Math.sqrt(mass * stiffness),\n duration,\n }\n }\n}\n\nconst durationKeys = [\"duration\", \"bounce\"]\nconst physicsKeys = [\"stiffness\", \"damping\", \"mass\"]\n\nfunction isSpringType(options: SpringOptions, keys: string[]) {\n return keys.some((key) => (options as any)[key] !== undefined)\n}\n\nfunction getSpringOptions(options: SpringOptions) {\n let springOptions = {\n velocity: springDefaults.velocity,\n stiffness: springDefaults.stiffness,\n damping: springDefaults.damping,\n mass: springDefaults.mass,\n isResolvedFromDuration: false,\n ...options,\n }\n // stiffness/damping/mass overrides duration/bounce\n if (\n !isSpringType(options, physicsKeys) &&\n isSpringType(options, durationKeys)\n ) {\n // Time-defined springs should ignore inherited velocity.\n // Velocity from interrupted animations can cause findSpring()\n // to compute wildly different spring parameters, leading to\n // massive oscillation on small-range animations.\n springOptions.velocity = 0\n\n if (options.visualDuration) {\n const visualDuration = options.visualDuration\n const root = (2 * Math.PI) / (visualDuration * 1.2)\n const stiffness = root * root\n const damping =\n 2 *\n clamp(0.05, 1, 1 - (options.bounce || 0)) *\n Math.sqrt(stiffness)\n\n springOptions = {\n ...springOptions,\n mass: springDefaults.mass,\n stiffness,\n damping,\n }\n } else {\n const derived = findSpring({ ...options, velocity: 0 })\n\n springOptions = {\n ...springOptions,\n ...derived,\n mass: springDefaults.mass,\n }\n springOptions.isResolvedFromDuration = true\n }\n }\n\n return springOptions\n}\n\nfunction spring(\n optionsOrVisualDuration:\n | ValueAnimationOptions\n | number = springDefaults.visualDuration,\n bounce = springDefaults.bounce\n): KeyframeGenerator {\n const options =\n typeof optionsOrVisualDuration !== \"object\"\n ? ({\n visualDuration: optionsOrVisualDuration,\n keyframes: [0, 1],\n bounce,\n } as ValueAnimationOptions)\n : optionsOrVisualDuration\n\n let { restSpeed, restDelta } = options\n\n const origin = options.keyframes[0]\n const target = options.keyframes[options.keyframes.length - 1]\n\n /**\n * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator\n * to reduce GC during animation.\n */\n const state: AnimationState = { done: false, value: origin }\n\n const {\n stiffness,\n damping,\n mass,\n duration,\n velocity,\n isResolvedFromDuration,\n } = getSpringOptions({\n ...options,\n velocity: -millisecondsToSeconds(options.velocity || 0),\n })\n\n const initialVelocity = velocity || 0.0\n const dampingRatio = damping / (2 * Math.sqrt(stiffness * mass))\n\n const initialDelta = target - origin\n const undampedAngularFreq = millisecondsToSeconds(\n Math.sqrt(stiffness / mass)\n )\n\n /**\n * If we're working on a granular scale, use smaller defaults for determining\n * when the spring is finished.\n *\n * These defaults have been selected emprically based on what strikes a good\n * ratio between feeling good and finishing as soon as changes are imperceptible.\n */\n const isGranularScale = Math.abs(initialDelta) < 5\n restSpeed ||= isGranularScale\n ? springDefaults.restSpeed.granular\n : springDefaults.restSpeed.default\n restDelta ||= isGranularScale\n ? springDefaults.restDelta.granular\n : springDefaults.restDelta.default\n\n let resolveSpring: (v: number) => number\n let resolveVelocity: (t: number) => number\n\n // Underdamped coefficients, hoisted for use in the inlined next() hot path\n let angularFreq: number\n let A: number\n let sinCoeff: number\n let cosCoeff: number\n\n if (dampingRatio < 1) {\n angularFreq = calcAngularFreq(undampedAngularFreq, dampingRatio)\n\n A =\n (initialVelocity +\n dampingRatio * undampedAngularFreq * initialDelta) /\n angularFreq\n\n // Underdamped spring\n resolveSpring = (t: number) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t)\n\n return (\n target -\n envelope *\n (A * Math.sin(angularFreq * t) +\n initialDelta * Math.cos(angularFreq * t))\n )\n }\n\n // Analytical derivative of underdamped spring (px/ms)\n sinCoeff =\n dampingRatio * undampedAngularFreq * A + initialDelta * angularFreq\n cosCoeff =\n dampingRatio * undampedAngularFreq * initialDelta - A * angularFreq\n resolveVelocity = (t: number) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t)\n return envelope *\n (sinCoeff * Math.sin(angularFreq * t) +\n cosCoeff * Math.cos(angularFreq * t))\n }\n } else if (dampingRatio === 1) {\n // Critically damped spring\n resolveSpring = (t: number) =>\n target -\n Math.exp(-undampedAngularFreq * t) *\n (initialDelta +\n (initialVelocity + undampedAngularFreq * initialDelta) * t)\n\n // Analytical derivative of critically damped spring (px/ms)\n const C = initialVelocity + undampedAngularFreq * initialDelta\n resolveVelocity = (t: number) =>\n Math.exp(-undampedAngularFreq * t) *\n (undampedAngularFreq * C * t - initialVelocity)\n } else {\n // Overdamped spring\n const dampedAngularFreq =\n undampedAngularFreq * Math.sqrt(dampingRatio * dampingRatio - 1)\n\n resolveSpring = (t: number) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t)\n\n // When performing sinh or cosh values can hit Infinity so we cap them here\n const freqForT = Math.min(dampedAngularFreq * t, 300)\n\n return (\n target -\n (envelope *\n ((initialVelocity +\n dampingRatio * undampedAngularFreq * initialDelta) *\n Math.sinh(freqForT) +\n dampedAngularFreq *\n initialDelta *\n Math.cosh(freqForT))) /\n dampedAngularFreq\n )\n }\n\n // Analytical derivative of overdamped spring (px/ms)\n const P =\n (initialVelocity +\n dampingRatio * undampedAngularFreq * initialDelta) /\n dampedAngularFreq\n const sinhCoeff =\n dampingRatio * undampedAngularFreq * P - initialDelta * dampedAngularFreq\n const coshCoeff =\n dampingRatio * undampedAngularFreq * initialDelta - P * dampedAngularFreq\n resolveVelocity = (t: number) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t)\n const freqForT = Math.min(dampedAngularFreq * t, 300)\n return envelope *\n (sinhCoeff * Math.sinh(freqForT) +\n coshCoeff * Math.cosh(freqForT))\n }\n }\n\n const generator = {\n calculatedDuration: isResolvedFromDuration ? duration || null : null,\n velocity: (t: number) => secondsToMilliseconds(resolveVelocity(t)),\n next: (t: number) => {\n /**\n * For underdamped physics springs we need both position and\n * velocity each tick. Compute shared trig values once to avoid\n * duplicate Math.exp/sin/cos calls on the hot path.\n */\n if (!isResolvedFromDuration && dampingRatio < 1) {\n const envelope = Math.exp(\n -dampingRatio * undampedAngularFreq * t\n )\n const sin = Math.sin(angularFreq * t)\n const cos = Math.cos(angularFreq * t)\n\n const current =\n target -\n envelope *\n (A * sin + initialDelta * cos)\n const currentVelocity = secondsToMilliseconds(\n envelope *\n (sinCoeff * sin + cosCoeff * cos)\n )\n\n state.done =\n Math.abs(currentVelocity) <= restSpeed! &&\n Math.abs(target - current) <= restDelta!\n state.value = state.done ? target : current\n\n return state\n }\n\n const current = resolveSpring(t)\n\n if (!isResolvedFromDuration) {\n const currentVelocity = secondsToMilliseconds(\n resolveVelocity(t)\n )\n state.done =\n Math.abs(currentVelocity) <= restSpeed! &&\n Math.abs(target - current) <= restDelta!\n } else {\n state.done = t >= duration!\n }\n\n state.value = state.done ? target : current\n\n return state\n },\n toString: () => {\n const calculatedDuration = Math.min(\n calcGeneratorDuration(generator),\n maxGeneratorDuration\n )\n\n const easing = generateLinearEasing(\n (progress: number) =>\n generator.next(calculatedDuration * progress).value,\n calculatedDuration,\n 30\n )\n\n return calculatedDuration + \"ms \" + easing\n },\n toTransition: () => {},\n }\n\n return generator\n}\n\nspring.applyToOptions = (options: Transition) => {\n const generatorOptions = createGeneratorEasing(options as any, 100, spring)\n\n options.ease = generatorOptions.ease\n options.duration = secondsToMilliseconds(generatorOptions.duration)\n options.type = \"keyframes\"\n return options\n}\n\nexport { spring }\n"],"names":[],"mappings":";;;;;AAoBA,MAAM,cAAc,GAAG;;AAEnB,IAAA,SAAS,EAAE,GAAG;AACd,IAAA,OAAO,EAAE,EAAE;AACX,IAAA,IAAI,EAAE,GAAG;AACT,IAAA,QAAQ,EAAE,GAAG;;IAGb,QAAQ,EAAE,GAAG;AACb,IAAA,MAAM,EAAE,GAAG;IACX,cAAc,EAAE,GAAG;;AAGnB,IAAA,SAAS,EAAE;AACP,QAAA,QAAQ,EAAE,IAAI;AACd,QAAA,OAAO,EAAE,CAAC;AACb,KAAA;AACD,IAAA,SAAS,EAAE;AACP,QAAA,QAAQ,EAAE,KAAK;AACf,QAAA,OAAO,EAAE,GAAG;AACf,KAAA;;IAGD,WAAW,EAAE,IAAI;IACjB,WAAW,EAAE,IAAI;AACjB,IAAA,UAAU,EAAE,IAAI;AAChB,IAAA,UAAU,EAAE,CAAC;CAChB;AAED,SAAS,eAAe,CAAC,YAAoB,EAAE,YAAoB,EAAA;AAC/D,IAAA,OAAO,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,YAAY,GAAG,YAAY,CAAC;AACpE;AAEA,MAAM,cAAc,GAAG,EAAE;AACzB,SAAS,eAAe,CACpB,QAAiC,EACjC,UAAmC,EACnC,YAAoB,EAAA;IAEpB,IAAI,MAAM,GAAG,YAAY;AACzB,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,cAAc,EAAE,CAAC,EAAE,EAAE;AACrC,QAAA,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,GAAG,UAAU,CAAC,MAAM,CAAC;IAC3D;AACA,IAAA,OAAO,MAAM;AACjB;AAEA;;AAEG;AACH,MAAM,OAAO,GAAG,KAAK;AAErB,SAAS,UAAU,CAAC,EAChB,QAAQ,GAAG,cAA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GAAG,qBAAqB,CAAC,gBAAgB,CAAC,QAAQ,CAAC;AACnE,IAAA,OAAO,CAAC,IAAI,GAAG,WAAW;AAC1B,IAAA,OAAO,OAAO;AAClB,CAAC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/generators/utils/calc-duration.mjs b/node_modules/motion-dom/dist/es/animation/generators/utils/calc-duration.mjs new file mode 100644 index 0000000..03d8077 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/generators/utils/calc-duration.mjs @@ -0,0 +1,18 @@ +/** + * Implement a practical max duration for keyframe generation + * to prevent infinite loops + */ +const maxGeneratorDuration = 20000; +function calcGeneratorDuration(generator) { + let duration = 0; + const timeStep = 50; + let state = generator.next(duration); + while (!state.done && duration < maxGeneratorDuration) { + duration += timeStep; + state = generator.next(duration); + } + return duration >= maxGeneratorDuration ? Infinity : duration; +} + +export { calcGeneratorDuration, maxGeneratorDuration }; +//# sourceMappingURL=calc-duration.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/generators/utils/calc-duration.mjs.map b/node_modules/motion-dom/dist/es/animation/generators/utils/calc-duration.mjs.map new file mode 100644 index 0000000..b2c3d50 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/generators/utils/calc-duration.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"calc-duration.mjs","sources":["../../../../../src/animation/generators/utils/calc-duration.ts"],"sourcesContent":["import { KeyframeGenerator } from \"../../types\"\n\n/**\n * Implement a practical max duration for keyframe generation\n * to prevent infinite loops\n */\nexport const maxGeneratorDuration = 20_000\nexport function calcGeneratorDuration(\n generator: KeyframeGenerator\n): number {\n let duration = 0\n const timeStep = 50\n let state = generator.next(duration)\n while (!state.done && duration < maxGeneratorDuration) {\n duration += timeStep\n state = generator.next(duration)\n }\n\n return duration >= maxGeneratorDuration ? Infinity : duration\n}\n"],"names":[],"mappings":"AAEA;;;AAGG;AACI,MAAM,oBAAoB,GAAG;AAC9B,SAAU,qBAAqB,CACjC,SAAqC,EAAA;IAErC,IAAI,QAAQ,GAAG,CAAC;IAChB,MAAM,QAAQ,GAAG,EAAE;IACnB,IAAI,KAAK,GAAG,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC;IACpC,OAAO,CAAC,KAAK,CAAC,IAAI,IAAI,QAAQ,GAAG,oBAAoB,EAAE;QACnD,QAAQ,IAAI,QAAQ;AACpB,QAAA,KAAK,GAAG,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC;IACpC;IAEA,OAAO,QAAQ,IAAI,oBAAoB,GAAG,QAAQ,GAAG,QAAQ;AACjE;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.mjs b/node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.mjs new file mode 100644 index 0000000..7609efe --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.mjs @@ -0,0 +1,20 @@ +import { millisecondsToSeconds } from 'motion-utils'; +import { calcGeneratorDuration, maxGeneratorDuration } from './calc-duration.mjs'; + +/** + * Create a progress => progress easing function from a generator. + */ +function createGeneratorEasing(options, scale = 100, createGenerator) { + const generator = createGenerator({ ...options, keyframes: [0, scale] }); + const duration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration); + return { + type: "keyframes", + ease: (progress) => { + return generator.next(duration * progress).value / scale; + }, + duration: millisecondsToSeconds(duration), + }; +} + +export { createGeneratorEasing }; +//# sourceMappingURL=create-generator-easing.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.mjs.map b/node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.mjs.map new file mode 100644 index 0000000..86fbc80 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"create-generator-easing.mjs","sources":["../../../../../src/animation/generators/utils/create-generator-easing.ts"],"sourcesContent":["import { millisecondsToSeconds } from \"motion-utils\"\nimport { GeneratorFactory, Transition } from \"../../types\"\nimport { calcGeneratorDuration, maxGeneratorDuration } from \"./calc-duration\"\n\n/**\n * Create a progress => progress easing function from a generator.\n */\nexport function createGeneratorEasing(\n options: Transition,\n scale = 100,\n createGenerator: GeneratorFactory\n) {\n const generator = createGenerator({ ...options, keyframes: [0, scale] })\n const duration = Math.min(\n calcGeneratorDuration(generator),\n maxGeneratorDuration\n )\n\n return {\n type: \"keyframes\",\n ease: (progress: number) => {\n return generator.next(duration * progress).value / scale\n },\n duration: millisecondsToSeconds(duration),\n }\n}\n"],"names":[],"mappings":";;;AAIA;;AAEG;AACG,SAAU,qBAAqB,CACjC,OAAmB,EACnB,KAAK,GAAG,GAAG,EACX,eAAiC,EAAA;AAEjC,IAAA,MAAM,SAAS,GAAG,eAAe,CAAC,EAAE,GAAG,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC;AACxE,IAAA,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CACrB,qBAAqB,CAAC,SAAS,CAAC,EAChC,oBAAoB,CACvB;IAED,OAAO;AACH,QAAA,IAAI,EAAE,WAAW;AACjB,QAAA,IAAI,EAAE,CAAC,QAAgB,KAAI;AACvB,YAAA,OAAO,SAAS,CAAC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC,CAAC,KAAK,GAAG,KAAK;QAC5D,CAAC;AACD,QAAA,QAAQ,EAAE,qBAAqB,CAAC,QAAQ,CAAC;KAC5C;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/generators/utils/is-generator.mjs b/node_modules/motion-dom/dist/es/animation/generators/utils/is-generator.mjs new file mode 100644 index 0000000..e240fd2 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/generators/utils/is-generator.mjs @@ -0,0 +1,6 @@ +function isGenerator(type) { + return typeof type === "function" && "applyToOptions" in type; +} + +export { isGenerator }; +//# sourceMappingURL=is-generator.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/generators/utils/is-generator.mjs.map b/node_modules/motion-dom/dist/es/animation/generators/utils/is-generator.mjs.map new file mode 100644 index 0000000..e54cc1c --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/generators/utils/is-generator.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"is-generator.mjs","sources":["../../../../../src/animation/generators/utils/is-generator.ts"],"sourcesContent":["import { AnimationGeneratorType, GeneratorFactory } from \"../../types\"\n\nexport function isGenerator(\n type?: AnimationGeneratorType\n): type is GeneratorFactory {\n return typeof type === \"function\" && \"applyToOptions\" in type\n}\n"],"names":[],"mappings":"AAEM,SAAU,WAAW,CACvB,IAA6B,EAAA;IAE7B,OAAO,OAAO,IAAI,KAAK,UAAU,IAAI,gBAAgB,IAAI,IAAI;AACjE;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/generators/utils/velocity.mjs b/node_modules/motion-dom/dist/es/animation/generators/utils/velocity.mjs new file mode 100644 index 0000000..d697ac0 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/generators/utils/velocity.mjs @@ -0,0 +1,10 @@ +import { velocityPerSecond } from 'motion-utils'; + +const velocitySampleDuration = 5; // ms +function getGeneratorVelocity(resolveValue, t, current) { + const prevT = Math.max(t - velocitySampleDuration, 0); + return velocityPerSecond(current - resolveValue(prevT), t - prevT); +} + +export { getGeneratorVelocity }; +//# sourceMappingURL=velocity.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/generators/utils/velocity.mjs.map b/node_modules/motion-dom/dist/es/animation/generators/utils/velocity.mjs.map new file mode 100644 index 0000000..2800cf1 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/generators/utils/velocity.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"velocity.mjs","sources":["../../../../../src/animation/generators/utils/velocity.ts"],"sourcesContent":["import { velocityPerSecond } from \"motion-utils\"\n\nconst velocitySampleDuration = 5 // ms\n\nexport function getGeneratorVelocity(\n resolveValue: (v: number) => number,\n t: number,\n current: number\n) {\n const prevT = Math.max(t - velocitySampleDuration, 0)\n return velocityPerSecond(current - resolveValue(prevT), t - prevT)\n}\n"],"names":[],"mappings":";;AAEA,MAAM,sBAAsB,GAAG,CAAC,CAAA;SAEhB,oBAAoB,CAChC,YAAmC,EACnC,CAAS,EACT,OAAe,EAAA;AAEf,IAAA,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,sBAAsB,EAAE,CAAC,CAAC;AACrD,IAAA,OAAO,iBAAiB,CAAC,OAAO,GAAG,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC;AACtE;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/interfaces/motion-value.mjs b/node_modules/motion-dom/dist/es/animation/interfaces/motion-value.mjs new file mode 100644 index 0000000..36cc86b --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/interfaces/motion-value.mjs @@ -0,0 +1,105 @@ +import { secondsToMilliseconds, MotionGlobalConfig } from 'motion-utils'; +import { AsyncMotionValueAnimation } from '../AsyncMotionValueAnimation.mjs'; +import { JSAnimation } from '../JSAnimation.mjs'; +import { getValueTransition } from '../utils/get-value-transition.mjs'; +import { makeAnimationInstant } from '../utils/make-animation-instant.mjs'; +import { getDefaultTransition } from '../utils/default-transitions.mjs'; +import { getFinalKeyframe } from '../keyframes/get-final.mjs'; +import { isTransitionDefined } from '../utils/is-transition-defined.mjs'; +import { frame } from '../../frameloop/frame.mjs'; + +const animateMotionValue = (name, value, target, transition = {}, element, isHandoff) => (onComplete) => { + const valueTransition = getValueTransition(transition, name) || {}; + /** + * Most transition values are currently completely overwritten by value-specific + * transitions. In the future it'd be nicer to blend these transitions. But for now + * delay actually does inherit from the root transition if not value-specific. + */ + const delay = valueTransition.delay || transition.delay || 0; + /** + * Elapsed isn't a public transition option but can be passed through from + * optimized appear effects in milliseconds. + */ + let { elapsed = 0 } = transition; + elapsed = elapsed - secondsToMilliseconds(delay); + const options = { + keyframes: Array.isArray(target) ? target : [null, target], + ease: "easeOut", + velocity: value.getVelocity(), + ...valueTransition, + delay: -elapsed, + onUpdate: (v) => { + value.set(v); + valueTransition.onUpdate && valueTransition.onUpdate(v); + }, + onComplete: () => { + onComplete(); + valueTransition.onComplete && valueTransition.onComplete(); + }, + name, + motionValue: value, + element: isHandoff ? undefined : element, + }; + /** + * If there's no transition defined for this value, we can generate + * unique transition settings for this value. + */ + if (!isTransitionDefined(valueTransition)) { + Object.assign(options, getDefaultTransition(name, options)); + } + /** + * Both WAAPI and our internal animation functions use durations + * as defined by milliseconds, while our external API defines them + * as seconds. + */ + options.duration && (options.duration = secondsToMilliseconds(options.duration)); + options.repeatDelay && (options.repeatDelay = secondsToMilliseconds(options.repeatDelay)); + /** + * Support deprecated way to set initial value. Prefer keyframe syntax. + */ + if (options.from !== undefined) { + options.keyframes[0] = options.from; + } + let shouldSkip = false; + if (options.type === false || + (options.duration === 0 && !options.repeatDelay)) { + makeAnimationInstant(options); + if (options.delay === 0) { + shouldSkip = true; + } + } + if (MotionGlobalConfig.instantAnimations || + MotionGlobalConfig.skipAnimations || + element?.shouldSkipAnimations || + valueTransition.skipAnimations) { + shouldSkip = true; + makeAnimationInstant(options); + options.delay = 0; + } + /** + * If the transition type or easing has been explicitly set by the user + * then we don't want to allow flattening the animation. + */ + options.allowFlatten = !valueTransition.type && !valueTransition.ease; + /** + * If we can or must skip creating the animation, and apply only + * the final keyframe, do so. We also check once keyframes are resolved but + * this early check prevents the need to create an animation at all. + */ + if (shouldSkip && !isHandoff && value.get() !== undefined) { + const finalKeyframe = getFinalKeyframe(options.keyframes, valueTransition); + if (finalKeyframe !== undefined) { + frame.update(() => { + options.onUpdate(finalKeyframe); + options.onComplete(); + }); + return; + } + } + return valueTransition.isSync + ? new JSAnimation(options) + : new AsyncMotionValueAnimation(options); +}; + +export { animateMotionValue }; +//# sourceMappingURL=motion-value.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/interfaces/motion-value.mjs.map b/node_modules/motion-dom/dist/es/animation/interfaces/motion-value.mjs.map new file mode 100644 index 0000000..97a7cac --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/interfaces/motion-value.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"motion-value.mjs","sources":["../../../../src/animation/interfaces/motion-value.ts"],"sourcesContent":["import { MotionGlobalConfig, secondsToMilliseconds } from \"motion-utils\"\nimport { AsyncMotionValueAnimation } from \"../AsyncMotionValueAnimation\"\nimport { JSAnimation } from \"../JSAnimation\"\nimport type {\n AnyResolvedKeyframe,\n ValueAnimationOptions,\n ValueTransition,\n} from \"../types\"\nimport type { UnresolvedKeyframes } from \"../keyframes/KeyframesResolver\"\nimport { getValueTransition } from \"../utils/get-value-transition\"\nimport { makeAnimationInstant } from \"../utils/make-animation-instant\"\nimport { getDefaultTransition } from \"../utils/default-transitions\"\nimport { getFinalKeyframe } from \"../keyframes/get-final\"\nimport { isTransitionDefined } from \"../utils/is-transition-defined\"\nimport { frame } from \"../../frameloop\"\nimport type { MotionValue, StartAnimation } from \"../../value\"\nimport type { VisualElement } from \"../../render/VisualElement\"\n\nexport const animateMotionValue =\n (\n name: string,\n value: MotionValue,\n target: V | UnresolvedKeyframes,\n transition: ValueTransition & { elapsed?: number } = {},\n element?: VisualElement,\n isHandoff?: boolean\n ): StartAnimation =>\n (onComplete) => {\n const valueTransition = getValueTransition(transition, name) || {}\n\n /**\n * Most transition values are currently completely overwritten by value-specific\n * transitions. In the future it'd be nicer to blend these transitions. But for now\n * delay actually does inherit from the root transition if not value-specific.\n */\n const delay = valueTransition.delay || transition.delay || 0\n\n /**\n * Elapsed isn't a public transition option but can be passed through from\n * optimized appear effects in milliseconds.\n */\n let { elapsed = 0 } = transition\n elapsed = elapsed - secondsToMilliseconds(delay)\n\n const options: ValueAnimationOptions = {\n keyframes: Array.isArray(target) ? target : [null, target],\n ease: \"easeOut\",\n velocity: value.getVelocity(),\n ...valueTransition,\n delay: -elapsed,\n onUpdate: (v) => {\n value.set(v)\n valueTransition.onUpdate && valueTransition.onUpdate(v)\n },\n onComplete: () => {\n onComplete()\n valueTransition.onComplete && valueTransition.onComplete()\n },\n name,\n motionValue: value,\n element: isHandoff ? undefined : element,\n }\n\n /**\n * If there's no transition defined for this value, we can generate\n * unique transition settings for this value.\n */\n if (!isTransitionDefined(valueTransition)) {\n Object.assign(options, getDefaultTransition(name, options))\n }\n\n /**\n * Both WAAPI and our internal animation functions use durations\n * as defined by milliseconds, while our external API defines them\n * as seconds.\n */\n options.duration &&= secondsToMilliseconds(options.duration)\n options.repeatDelay &&= secondsToMilliseconds(options.repeatDelay)\n\n /**\n * Support deprecated way to set initial value. Prefer keyframe syntax.\n */\n if (options.from !== undefined) {\n options.keyframes[0] = options.from as any\n }\n\n let shouldSkip = false\n\n if (\n (options as any).type === false ||\n (options.duration === 0 && !options.repeatDelay)\n ) {\n makeAnimationInstant(options)\n\n if (options.delay === 0) {\n shouldSkip = true\n }\n }\n\n if (\n MotionGlobalConfig.instantAnimations ||\n MotionGlobalConfig.skipAnimations ||\n element?.shouldSkipAnimations ||\n valueTransition.skipAnimations\n ) {\n shouldSkip = true\n makeAnimationInstant(options)\n options.delay = 0\n }\n\n /**\n * If the transition type or easing has been explicitly set by the user\n * then we don't want to allow flattening the animation.\n */\n options.allowFlatten = !valueTransition.type && !valueTransition.ease\n\n /**\n * If we can or must skip creating the animation, and apply only\n * the final keyframe, do so. We also check once keyframes are resolved but\n * this early check prevents the need to create an animation at all.\n */\n if (shouldSkip && !isHandoff && value.get() !== undefined) {\n const finalKeyframe = getFinalKeyframe(\n options.keyframes as V[],\n valueTransition\n )\n\n if (finalKeyframe !== undefined) {\n frame.update(() => {\n options.onUpdate!(finalKeyframe)\n options.onComplete!()\n })\n\n return\n }\n }\n\n return valueTransition.isSync\n ? new JSAnimation(options)\n : new AsyncMotionValueAnimation(options)\n }\n"],"names":[],"mappings":";;;;;;;;;;MAkBa,kBAAkB,GAC3B,CACI,IAAY,EACZ,KAAqB,EACrB,M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AAC,MAAK;AACd,gBAAA,OAAO,CAAC,QAAS,CAAC,aAAa,CAAC;gBAChC,OAAO,CAAC,UAAW,EAAE;AACzB,YAAA,CAAC,CAAC;YAEF;QACJ;IACJ;IAEA,OAAO,eAAe,CAAC;AACnB,UAAE,IAAI,WAAW,CAAC,OAAO;AACzB,UAAE,IAAI,yBAAyB,CAAC,OAAO,CAAC;AAChD;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-target.mjs b/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-target.mjs new file mode 100644 index 0000000..836bb0c --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-target.mjs @@ -0,0 +1,108 @@ +import { getValueTransition } from '../utils/get-value-transition.mjs'; +import { resolveTransition } from '../utils/resolve-transition.mjs'; +import { positionalKeys } from '../../render/utils/keys-position.mjs'; +import { setTarget } from '../../render/utils/setters.mjs'; +import { addValueToWillChange } from '../../value/will-change/add-will-change.mjs'; +import { getOptimisedAppearId } from '../optimized-appear/get-appear-id.mjs'; +import { animateMotionValue } from './motion-value.mjs'; +import { frame } from '../../frameloop/frame.mjs'; + +/** + * Decide whether we should block this animation. Previously, we achieved this + * just by checking whether the key was listed in protectedKeys, but this + * posed problems if an animation was triggered by afterChildren and protectedKeys + * had been set to true in the meantime. + */ +function shouldBlockAnimation({ protectedKeys, needsAnimating }, key) { + const shouldBlock = protectedKeys.hasOwnProperty(key) && needsAnimating[key] !== true; + needsAnimating[key] = false; + return shouldBlock; +} +function animateTarget(visualElement, targetAndTransition, { delay = 0, transitionOverride, type } = {}) { + let { transition, transitionEnd, ...target } = targetAndTransition; + const defaultTransition = visualElement.getDefaultTransition(); + transition = transition + ? resolveTransition(transition, defaultTransition) + : defaultTransition; + const reduceMotion = transition?.reduceMotion; + const skipAnimations = transition?.skipAnimations; + if (transitionOverride) + transition = transitionOverride; + const animations = []; + const animationTypeState = type && + visualElement.animationState && + visualElement.animationState.getState()[type]; + const path = transition?.path; + if (path) { + // path mutates `target` to claim x/y; loop below skips them. + path.animateVisualElement(visualElement, target, transition, delay, animations); + } + for (const key in target) { + const value = visualElement.getValue(key, visualElement.latestValues[key] ?? null); + const valueTarget = target[key]; + if (valueTarget === undefined || + (animationTypeState && + shouldBlockAnimation(animationTypeState, key))) { + continue; + } + const valueTransition = { + delay, + ...getValueTransition(transition || {}, key), + }; + if (skipAnimations) + valueTransition.skipAnimations = true; + /** + * If the value is already at the defined target, skip the animation. + * We still re-assert the value via frame.update to take precedence + * over any stale transitionEnd callbacks from previous animations. + */ + const currentValue = value.get(); + if (currentValue !== undefined && + !value.isAnimating() && + !Array.isArray(valueTarget) && + valueTarget === currentValue && + !valueTransition.velocity) { + frame.update(() => value.set(valueTarget)); + continue; + } + /** + * If this is the first time a value is being animated, check + * to see if we're handling off from an existing animation. + */ + let isHandoff = false; + if (window.MotionHandoffAnimation) { + const appearId = getOptimisedAppearId(visualElement); + if (appearId) { + const startTime = window.MotionHandoffAnimation(appearId, key, frame); + if (startTime !== null) { + valueTransition.startTime = startTime; + isHandoff = true; + } + } + } + addValueToWillChange(visualElement, key); + const shouldReduceMotion = reduceMotion ?? visualElement.shouldReduceMotion; + value.start(animateMotionValue(key, value, valueTarget, shouldReduceMotion && positionalKeys.has(key) + ? { type: false } + : valueTransition, visualElement, isHandoff)); + const animation = value.animation; + if (animation) { + animations.push(animation); + } + } + if (transitionEnd) { + const applyTransitionEnd = () => frame.update(() => { + transitionEnd && setTarget(visualElement, transitionEnd); + }); + if (animations.length) { + Promise.all(animations).then(applyTransitionEnd); + } + else { + applyTransitionEnd(); + } + } + return animations; +} + +export { animateTarget }; +//# sourceMappingURL=visual-element-target.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-target.mjs.map b/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-target.mjs.map new file mode 100644 index 0000000..eb87d59 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-target.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"visual-element-target.mjs","sources":["../../../../src/animation/interfaces/visual-element-target.ts"],"sourcesContent":["import { frame } from \"../../frameloop\"\nimport { getValueTransition } from \"../utils/get-value-transition\"\nimport { resolveTransition } from \"../utils/resolve-transition\"\nimport { positionalKeys } from \"../../render/utils/keys-position\"\nimport { setTarget } from \"../../render/utils/setters\"\nimport { addValueToWillChange } from \"../../value/will-change/add-will-change\"\nimport { getOptimisedAppearId } from \"../optimized-appear/get-appear-id\"\nimport { animateMotionValue } from \"./motion-value\"\nimport type { MotionPath } from \"../types\"\nimport type { VisualElementAnimationOptions } from \"./types\"\nimport type { AnimationPlaybackControlsWithThen } from \"../types\"\nimport type { TargetAndTransition } from \"../../node/types\"\nimport type { AnimationTypeState } from \"../../render/utils/animation-state\"\nimport type { VisualElement } from \"../../render/VisualElement\"\n\n/**\n * Decide whether we should block this animation. Previously, we achieved this\n * just by checking whether the key was listed in protectedKeys, but this\n * posed problems if an animation was triggered by afterChildren and protectedKeys\n * had been set to true in the meantime.\n */\nfunction shouldBlockAnimation(\n { protectedKeys, needsAnimating }: AnimationTypeState,\n key: string\n) {\n const shouldBlock =\n protectedKeys.hasOwnProperty(key) && needsAnimating[key] !== true\n\n needsAnimating[key] = false\n return shouldBlock\n}\n\nexport function animateTarget(\n visualElement: VisualElement,\n targetAndTransition: TargetAndTransition,\n { delay = 0, transitionOverride, type }: VisualElementAnimationOptions = {}\n): AnimationPlaybackControlsWithThen[] {\n let {\n transition,\n transitionEnd,\n ...target\n } = targetAndTransition\n\n const defaultTransition = visualElement.getDefaultTransition()\n transition = transition\n ? resolveTransition(transition, defaultTransition)\n : defaultTransition\n\n const reduceMotion = (transition as { reduceMotion?: boolean })?.reduceMotion\n const skipAnimations = transition?.skipAnimations\n\n if (transitionOverride) transition = transitionOverride\n\n const animations: AnimationPlaybackControlsWithThen[] = []\n\n const animationTypeState =\n type &&\n visualElement.animationState &&\n visualElement.animationState.getState()[type]\n\n const path = (transition as { path?: MotionPath } | undefined)?.path\n if (path) {\n // path mutates `target` to claim x/y; loop below skips them.\n path.animateVisualElement(\n visualElement,\n target,\n transition,\n delay,\n animations\n )\n }\n\n for (const key in target) {\n const value = visualElement.getValue(\n key,\n visualElement.latestValues[key] ?? null\n )\n const valueTarget = target[key as keyof typeof target]\n\n if (\n valueTarget === undefined ||\n (animationTypeState &&\n shouldBlockAnimation(animationTypeState, key))\n ) {\n continue\n }\n\n const valueTransition = {\n delay,\n ...getValueTransition(transition || {}, key),\n }\n\n if (skipAnimations) valueTransition.skipAnimations = true\n\n /**\n * If the value is already at the defined target, skip the animation.\n * We still re-assert the value via frame.update to take precedence\n * over any stale transitionEnd callbacks from previous animations.\n */\n const currentValue = value.get()\n if (\n currentValue !== undefined &&\n !value.isAnimating() &&\n !Array.isArray(valueTarget) &&\n valueTarget === currentValue &&\n !valueTransition.velocity\n ) {\n frame.update(() => value.set(valueTarget as any))\n continue\n }\n\n /**\n * If this is the first time a value is being animated, check\n * to see if we're handling off from an existing animation.\n */\n let isHandoff = false\n if (window.MotionHandoffAnimation) {\n const appearId = getOptimisedAppearId(visualElement)\n\n if (appearId) {\n const startTime = window.MotionHandoffAnimation(\n appearId,\n key,\n frame\n )\n\n if (startTime !== null) {\n valueTransition.startTime = startTime\n isHandoff = true\n }\n }\n }\n\n addValueToWillChange(visualElement, key)\n\n const shouldReduceMotion =\n reduceMotion ?? visualElement.shouldReduceMotion\n\n value.start(\n animateMotionValue(\n key,\n value,\n valueTarget,\n shouldReduceMotion && positionalKeys.has(key)\n ? { type: false }\n : valueTransition,\n visualElement,\n isHandoff\n )\n )\n\n const animation = value.animation\n\n if (animation) {\n animations.push(animation)\n }\n }\n\n if (transitionEnd) {\n const applyTransitionEnd = () =>\n frame.update(() => {\n transitionEnd && setTarget(visualElement, transitionEnd)\n })\n\n if (animations.length) {\n Promise.all(animations).then(applyTransitionEnd)\n } else {\n applyTransitionEnd()\n }\n }\n\n return animations\n}\n"],"names":[],"mappings":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MAAM,kBAAkB,GACpB,YAAY,IAAI,aAAa,CAAC,kBAAkB;AAEpD,QAAA,KAAK,CAAC,KAAK,CACP,kBAAkB,CACd,GAAG,EACH,KAAK,EACL,WAAW,EACX,kBAAkB,IAAI,cAAc,CAAC,GAAG,CAAC,GAAG;AACxC,cAAE,EAAE,IAAI,EAAE,KAAK;cACb,eAAe,EACrB,aAAa,EACb,SAAS,CACZ,CACJ;AAED,QAAA,MAAM,SAAS,GAAG,KAAK,CAAC,SAAS;QAEjC,IAAI,SAAS,EAAE;AACX,YAAA,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC;QAC9B;IACJ;IAEA,IAAI,aAAa,EAAE;QACf,MAAM,kBAAkB,GAAG,MACvB,KAAK,CAAC,MAAM,CAAC,MAAK;AACd,YAAA,aAAa,IAAI,SAAS,CAAC,aAAa,EAAE,aAAa,CAAC;AAC5D,QAAA,CAAC,CAAC;AAEN,QAAA,IAAI,UAAU,CAAC,MAAM,EAAE;YACnB,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC;QACpD;aAAO;AACH,YAAA,kBAAkB,EAAE;QACxB;IACJ;AAEA,IAAA,OAAO,UAAU;AACrB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-variant.mjs b/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-variant.mjs new file mode 100644 index 0000000..65af372 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-variant.mjs @@ -0,0 +1,60 @@ +import { resolveVariant } from '../../render/utils/resolve-dynamic-variants.mjs'; +import { calcChildStagger } from '../utils/calc-child-stagger.mjs'; +import { animateTarget } from './visual-element-target.mjs'; + +function animateVariant(visualElement, variant, options = {}) { + const resolved = resolveVariant(visualElement, variant, options.type === "exit" + ? visualElement.presenceContext?.custom + : undefined); + let { transition = visualElement.getDefaultTransition() || {} } = resolved || {}; + if (options.transitionOverride) { + transition = options.transitionOverride; + } + /** + * If we have a variant, create a callback that runs it as an animation. + * Otherwise, we resolve a Promise immediately for a composable no-op. + */ + const getAnimation = resolved + ? () => Promise.all(animateTarget(visualElement, resolved, options)) + : () => Promise.resolve(); + /** + * If we have children, create a callback that runs all their animations. + * Otherwise, we resolve a Promise immediately for a composable no-op. + */ + const getChildAnimations = visualElement.variantChildren && visualElement.variantChildren.size + ? (forwardDelay = 0) => { + const { delayChildren = 0, staggerChildren, staggerDirection, } = transition; + return animateChildren(visualElement, variant, forwardDelay, delayChildren, staggerChildren, staggerDirection, options); + } + : () => Promise.resolve(); + /** + * If the transition explicitly defines a "when" option, we need to resolve either + * this animation or all children animations before playing the other. + */ + const { when } = transition; + if (when) { + const [first, last] = when === "beforeChildren" + ? [getAnimation, getChildAnimations] + : [getChildAnimations, getAnimation]; + return first().then(() => last()); + } + else { + return Promise.all([getAnimation(), getChildAnimations(options.delay)]); + } +} +function animateChildren(visualElement, variant, delay = 0, delayChildren = 0, staggerChildren = 0, staggerDirection = 1, options) { + const animations = []; + for (const child of visualElement.variantChildren) { + child.notify("AnimationStart", variant); + animations.push(animateVariant(child, variant, { + ...options, + delay: delay + + (typeof delayChildren === "function" ? 0 : delayChildren) + + calcChildStagger(visualElement.variantChildren, child, delayChildren, staggerChildren, staggerDirection), + }).then(() => child.notify("AnimationComplete", variant))); + } + return Promise.all(animations); +} + +export { animateVariant }; +//# sourceMappingURL=visual-element-variant.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-variant.mjs.map b/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-variant.mjs.map new file mode 100644 index 0000000..76b006c --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-variant.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"visual-element-variant.mjs","sources":["../../../../src/animation/interfaces/visual-element-variant.ts"],"sourcesContent":["import { resolveVariant } from \"../../render/utils/resolve-dynamic-variants\"\nimport { calcChildStagger } from \"../utils/calc-child-stagger\"\nimport type { VisualElementAnimationOptions } from \"./types\"\nimport { animateTarget } from \"./visual-element-target\"\nimport type { DynamicOption } from \"../types\"\nimport type { VisualElement } from \"../../render/VisualElement\"\n\nexport function animateVariant(\n visualElement: VisualElement,\n variant: string,\n options: VisualElementAnimationOptions = {}\n): Promise {\n const resolved = resolveVariant(\n visualElement,\n variant,\n options.type === \"exit\"\n ? visualElement.presenceContext?.custom\n : undefined\n )\n\n let { transition = visualElement.getDefaultTransition() || {} } =\n resolved || {}\n\n if (options.transitionOverride) {\n transition = options.transitionOverride\n }\n\n /**\n * If we have a variant, create a callback that runs it as an animation.\n * Otherwise, we resolve a Promise immediately for a composable no-op.\n */\n const getAnimation: () => Promise = resolved\n ? () => Promise.all(animateTarget(visualElement, resolved, options))\n : () => Promise.resolve()\n\n /**\n * If we have children, create a callback that runs all their animations.\n * Otherwise, we resolve a Promise immediately for a composable no-op.\n */\n const getChildAnimations =\n visualElement.variantChildren && visualElement.variantChildren.size\n ? (forwardDelay = 0) => {\n const {\n delayChildren = 0,\n staggerChildren,\n staggerDirection,\n } = transition\n\n return animateChildren(\n visualElement,\n variant,\n forwardDelay,\n delayChildren,\n staggerChildren,\n staggerDirection,\n options\n )\n }\n : () => Promise.resolve()\n\n /**\n * If the transition explicitly defines a \"when\" option, we need to resolve either\n * this animation or all children animations before playing the other.\n */\n const { when } = transition\n if (when) {\n const [first, last] =\n when === \"beforeChildren\"\n ? [getAnimation, getChildAnimations]\n : [getChildAnimations, getAnimation]\n\n return first().then(() => last())\n } else {\n return Promise.all([getAnimation(), getChildAnimations(options.delay)])\n }\n}\n\nfunction animateChildren(\n visualElement: VisualElement,\n variant: string,\n delay: number = 0,\n delayChildren: number | DynamicOption = 0,\n staggerChildren = 0,\n staggerDirection = 1,\n options: VisualElementAnimationOptions\n) {\n const animations: Promise[] = []\n\n for (const child of visualElement.variantChildren!) {\n child.notify(\"AnimationStart\", variant)\n animations.push(\n animateVariant(child, variant, {\n ...options,\n delay:\n delay +\n (typeof delayChildren === \"function\" ? 0 : delayChildren) +\n calcChildStagger(\n visualElement.variantChildren!,\n child,\n delayChildren,\n staggerChildren,\n staggerDirection\n ),\n }).then(() => child.notify(\"AnimationComplete\", variant))\n )\n }\n\n return Promise.all(animations)\n}\n"],"names":[],"mappings":";;;;AAOM,SAAU,cAAc,CAC1B,aAA4B,EAC5B,OAAe,EACf,UAAyC,EAAE,EAAA;AAE3C,IAAA,MAAM,QAAQ,GAAG,cAAc,CAC3B,aAAa,EACb,OAAO,EACP,OAAO,CAAC,IAAI,KAAK;AACb,UAAE,aAAa,CAAC,eAAe,EAAE;UAC/B,SAAS,CAClB;AAED,IAAA,IAAI,EAAE,UAAU,GAAG,aAAa,CAAC,oBAAoB,EAAE,IAAI,EAAE,EAAE,GAC3D,QAAQ,IAAI,EAAE;AAElB,IAAA,IAAI,OAAO,CAAC,kBAAkB,EAAE;AAC5B,QAAA,UAAU,GAAG,OAAO,CAAC,kBAAkB;IAC3C;AAEA;;;AAGG;IACH,MAAM,YAAY,GAAuB;AACrC,UAAE,MAAM,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,aAAa,EAAE,QAAQ,EAAE,OAAO,CAAC;UACjE,MAAM,OAAO,CAAC,OAAO,EAAE;AAE7B;;;AAGG;IACH,MAAM,kBAAkB,GACpB,aAAa,CAAC,eAAe,IAAI,aAAa,CAAC,eAAe,CAAC;AAC3D,UAAE,CAAC,YAAY,GAAG,CAAC,KAAI;YACjB,MAAM,EACF,aAAa,GAAG,CAAC,EACjB,eAAe,EACf,gBAAgB,GACnB,GAAG,UAAU;AAEd,YAAA,OAAO,eAAe,CAClB,aAAa,EACb,OAAO,EACP,YAAY,EACZ,aAAa,EACb,eAAe,EACf,gBAAgB,EAChB,OAAO,CACV;QACL;UACA,MAAM,OAAO,CAAC,OAAO,EAAE;AAEjC;;;AAGG;AACH,IAAA,MAAM,EAAE,IAAI,EAAE,GAAG,UAAU;IAC3B,IAAI,IAAI,EAAE;QACN,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,GACf,IAAI,KAAK;AACL,cAAE,CAAC,YAAY,EAAE,kBAAkB;AACnC,cAAE,CAAC,kBAAkB,EAAE,YAAY,CAAC;QAE5C,OAAO,KAAK,EAAE,CAAC,IAAI,CAAC,MAAM,IAAI,EAAE,CAAC;IACrC;SAAO;AACH,QAAA,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,YAAY,EAAE,EAAE,kBAAkB,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;IAC3E;AACJ;AAEA,SAAS,eAAe,CACpB,aAA4B,EAC5B,OAAe,EACf,KAAA,GAAgB,CAAC,EACjB,aAAA,GAAgD,CAAC,EACjD,eAAe,GAAG,CAAC,EACnB,gBAAgB,GAAG,CAAC,EACpB,OAAsC,EAAA;IAEtC,MAAM,UAAU,GAAmB,EAAE;AAErC,IAAA,KAAK,MAAM,KAAK,IAAI,aAAa,CAAC,eAAgB,EAAE;AAChD,QAAA,KAAK,CAAC,MAAM,CAAC,gBAAgB,EAAE,OAAO,CAAC;QACvC,UAAU,CAAC,IAAI,CACX,cAAc,CAAC,KAAK,EAAE,OAAO,EAAE;AAC3B,YAAA,GAAG,OAAO;AACV,YAAA,KAAK,EACD,KAAK;AACL,iBAAC,OAAO,aAAa,KAAK,UAAU,GAAG,CAAC,GAAG,aAAa,CAAC;AACzD,gBAAA,gBAAgB,CACZ,aAAa,CAAC,eAAgB,EAC9B,KAAK,EACL,aAAa,EACb,eAAe,EACf,gBAAgB,CACnB;AACR,SAAA,CAAC,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,MAAM,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC,CAC5D;IACL;AAEA,IAAA,OAAO,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC;AAClC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/interfaces/visual-element.mjs b/node_modules/motion-dom/dist/es/animation/interfaces/visual-element.mjs new file mode 100644 index 0000000..ecf983b --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/interfaces/visual-element.mjs @@ -0,0 +1,27 @@ +import { resolveVariant } from '../../render/utils/resolve-dynamic-variants.mjs'; +import { animateTarget } from './visual-element-target.mjs'; +import { animateVariant } from './visual-element-variant.mjs'; + +function animateVisualElement(visualElement, definition, options = {}) { + visualElement.notify("AnimationStart", definition); + let animation; + if (Array.isArray(definition)) { + const animations = definition.map((variant) => animateVariant(visualElement, variant, options)); + animation = Promise.all(animations); + } + else if (typeof definition === "string") { + animation = animateVariant(visualElement, definition, options); + } + else { + const resolvedDefinition = typeof definition === "function" + ? resolveVariant(visualElement, definition, options.custom) + : definition; + animation = Promise.all(animateTarget(visualElement, resolvedDefinition, options)); + } + return animation.then(() => { + visualElement.notify("AnimationComplete", definition); + }); +} + +export { animateVisualElement }; +//# sourceMappingURL=visual-element.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/interfaces/visual-element.mjs.map b/node_modules/motion-dom/dist/es/animation/interfaces/visual-element.mjs.map new file mode 100644 index 0000000..487dabb --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/interfaces/visual-element.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"visual-element.mjs","sources":["../../../../src/animation/interfaces/visual-element.ts"],"sourcesContent":["import { resolveVariant } from \"../../render/utils/resolve-dynamic-variants\"\nimport type { AnimationDefinition } from \"../../node/types\"\nimport type { VisualElement } from \"../../render/VisualElement\"\nimport type { VisualElementAnimationOptions } from \"./types\"\nimport { animateTarget } from \"./visual-element-target\"\nimport { animateVariant } from \"./visual-element-variant\"\n\nexport function animateVisualElement(\n visualElement: VisualElement,\n definition: AnimationDefinition,\n options: VisualElementAnimationOptions = {}\n) {\n visualElement.notify(\"AnimationStart\", definition)\n let animation: Promise\n\n if (Array.isArray(definition)) {\n const animations = definition.map((variant) =>\n animateVariant(visualElement, variant, options)\n )\n animation = Promise.all(animations)\n } else if (typeof definition === \"string\") {\n animation = animateVariant(visualElement, definition, options)\n } else {\n const resolvedDefinition =\n typeof definition === \"function\"\n ? resolveVariant(visualElement, definition, options.custom)\n : definition\n\n animation = Promise.all(\n animateTarget(visualElement, resolvedDefinition, options)\n )\n }\n\n return animation.then(() => {\n visualElement.notify(\"AnimationComplete\", definition)\n })\n}\n"],"names":[],"mappings":";;;;AAOM,SAAU,oBAAoB,CAChC,aAA4B,EAC5B,UAA+B,EAC/B,UAAyC,EAAE,EAAA;AAE3C,IAAA,aAAa,CAAC,MAAM,CAAC,gBAAgB,EAAE,UAAU,CAAC;AAClD,IAAA,IAAI,SAAuB;AAE3B,IAAA,IAAI,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;QAC3B,MAAM,UAAU,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,OAAO,KACtC,cAAc,CAAC,aAAa,EAAE,OAAO,EAAE,OAAO,CAAC,CAClD;AACD,QAAA,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC;IACvC;AAAO,SAAA,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE;QACvC,SAAS,GAAG,cAAc,CAAC,aAAa,EAAE,UAAU,EAAE,OAAO,CAAC;IAClE;SAAO;AACH,QAAA,MAAM,kBAAkB,GACpB,OAAO,UAAU,KAAK;cAChB,cAAc,CAAC,aAAa,EAAE,UAAU,EAAE,OAAO,CAAC,MAAM;cACxD,UAAU;AAEpB,QAAA,SAAS,GAAG,OAAO,CAAC,GAAG,CACnB,aAAa,CAAC,aAAa,EAAE,kBAAkB,EAAE,OAAO,CAAC,CAC5D;IACL;AAEA,IAAA,OAAO,SAAS,CAAC,IAAI,CAAC,MAAK;AACvB,QAAA,aAAa,CAAC,MAAM,CAAC,mBAAmB,EAAE,UAAU,CAAC;AACzD,IAAA,CAAC,CAAC;AACN;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.mjs b/node_modules/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.mjs new file mode 100644 index 0000000..efd2f77 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.mjs @@ -0,0 +1,142 @@ +import { positionalKeys } from '../../render/utils/keys-position.mjs'; +import { findDimensionValueType } from '../../value/types/dimensions.mjs'; +import { getVariableValue } from '../utils/css-variables-conversion.mjs'; +import { isCSSVariableToken, containsCSSVariable } from '../utils/is-css-variable.mjs'; +import { KeyframeResolver } from './KeyframesResolver.mjs'; +import { isNone } from './utils/is-none.mjs'; +import { makeNoneKeyframesAnimatable } from './utils/make-none-animatable.mjs'; +import { positionalValues, isNumOrPxType } from './utils/unit-conversion.mjs'; + +class DOMKeyframesResolver extends KeyframeResolver { + constructor(unresolvedKeyframes, onComplete, name, motionValue, element) { + super(unresolvedKeyframes, onComplete, name, motionValue, element, true); + } + readKeyframes() { + const { unresolvedKeyframes, element, name } = this; + if (!element || !element.current) + return; + super.readKeyframes(); + /** + * If any keyframe is a CSS variable, we need to find its value by sampling the element + */ + for (let i = 0; i < unresolvedKeyframes.length; i++) { + let keyframe = unresolvedKeyframes[i]; + if (typeof keyframe === "string") { + keyframe = keyframe.trim(); + if (isCSSVariableToken(keyframe)) { + const resolved = getVariableValue(keyframe, element.current); + if (resolved !== undefined) { + unresolvedKeyframes[i] = resolved; + } + if (i === unresolvedKeyframes.length - 1) { + this.finalKeyframe = keyframe; + } + } + } + } + /** + * Resolve "none" values. We do this potentially twice - once before and once after measuring keyframes. + * This could be seen as inefficient but it's a trade-off to avoid measurements in more situations, which + * have a far bigger performance impact. + */ + this.resolveNoneKeyframes(); + /** + * Check to see if unit type has changed. If so schedule jobs that will + * temporarily set styles to the destination keyframes. + * Skip if we have more than two keyframes or this isn't a positional value. + * TODO: We can throw if there are multiple keyframes and the value type changes. + */ + if (!positionalKeys.has(name) || unresolvedKeyframes.length !== 2) { + return; + } + const [origin, target] = unresolvedKeyframes; + const originType = findDimensionValueType(origin); + const targetType = findDimensionValueType(target); + /** + * If one keyframe contains embedded CSS variables (e.g. in calc()) and the other + * doesn't, we need to measure to convert to pixels. This handles GitHub issue #3410. + */ + const originHasVar = containsCSSVariable(origin); + const targetHasVar = containsCSSVariable(target); + if (originHasVar !== targetHasVar && positionalValues[name]) { + this.needsMeasurement = true; + return; + } + /** + * Either we don't recognise these value types or we can animate between them. + */ + if (originType === targetType) + return; + /** + * If both values are numbers or pixels, we can animate between them by + * converting them to numbers. + */ + if (isNumOrPxType(originType) && isNumOrPxType(targetType)) { + for (let i = 0; i < unresolvedKeyframes.length; i++) { + const value = unresolvedKeyframes[i]; + if (typeof value === "string") { + unresolvedKeyframes[i] = parseFloat(value); + } + } + } + else if (positionalValues[name]) { + /** + * Else, the only way to resolve this is by measuring the element. + */ + this.needsMeasurement = true; + } + } + resolveNoneKeyframes() { + const { unresolvedKeyframes, name } = this; + const noneKeyframeIndexes = []; + for (let i = 0; i < unresolvedKeyframes.length; i++) { + if (unresolvedKeyframes[i] === null || + isNone(unresolvedKeyframes[i])) { + noneKeyframeIndexes.push(i); + } + } + if (noneKeyframeIndexes.length) { + makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, name); + } + } + measureInitialState() { + const { element, unresolvedKeyframes, name } = this; + if (!element || !element.current) + return; + if (name === "height") { + this.suspendedScrollY = window.pageYOffset; + } + this.measuredOrigin = positionalValues[name](element.measureViewportBox(), window.getComputedStyle(element.current)); + unresolvedKeyframes[0] = this.measuredOrigin; + // Set final key frame to measure after next render + const measureKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1]; + if (measureKeyframe !== undefined) { + element.getValue(name, measureKeyframe).jump(measureKeyframe, false); + } + } + measureEndState() { + const { element, name, unresolvedKeyframes } = this; + if (!element || !element.current) + return; + const value = element.getValue(name); + value && value.jump(this.measuredOrigin, false); + const finalKeyframeIndex = unresolvedKeyframes.length - 1; + const finalKeyframe = unresolvedKeyframes[finalKeyframeIndex]; + unresolvedKeyframes[finalKeyframeIndex] = positionalValues[name](element.measureViewportBox(), window.getComputedStyle(element.current)); + if (finalKeyframe !== null && this.finalKeyframe === undefined) { + this.finalKeyframe = finalKeyframe; + } + // If we removed transform values, reapply them before the next render + if (this.removedTransforms?.length) { + this.removedTransforms.forEach(([unsetTransformName, unsetTransformValue]) => { + element + .getValue(unsetTransformName) + .set(unsetTransformValue); + }); + } + this.resolveNoneKeyframes(); + } +} + +export { DOMKeyframesResolver }; +//# sourceMappingURL=DOMKeyframesResolver.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.mjs.map b/node_modules/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.mjs.map new file mode 100644 index 0000000..4d5ea9e --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"DOMKeyframesResolver.mjs","sources":["../../../../src/animation/keyframes/DOMKeyframesResolver.ts"],"sourcesContent":["import { positionalKeys } from \"../../render/utils/keys-position\"\nimport { MotionValue } from \"../../value\"\nimport { findDimensionValueType } from \"../../value/types/dimensions\"\nimport { AnyResolvedKeyframe } from \"../types\"\nimport { getVariableValue } from \"../utils/css-variables-conversion\"\nimport {\n containsCSSVariable,\n isCSSVariableToken,\n} from \"../utils/is-css-variable\"\nimport {\n KeyframeResolver,\n OnKeyframesResolved,\n UnresolvedKeyframes,\n} from \"./KeyframesResolver\"\nimport { WithRender } from \"./types\"\nimport { isNone } from \"./utils/is-none\"\nimport { makeNoneKeyframesAnimatable } from \"./utils/make-none-animatable\"\nimport { isNumOrPxType, positionalValues } from \"./utils/unit-conversion\"\n\nexport class DOMKeyframesResolver<\n T extends AnyResolvedKeyframe\n> extends KeyframeResolver {\n name: string\n element?: WithRender\n\n private removedTransforms?: [string, AnyResolvedKeyframe][]\n private measuredOrigin?: AnyResolvedKeyframe\n\n constructor(\n unresolvedKeyframes: UnresolvedKeyframes,\n onComplete: OnKeyframesResolved,\n name?: string,\n motionValue?: MotionValue,\n element?: WithRender\n ) {\n super(unresolvedKeyframes, onComplete, name, motionValue, element, true)\n }\n\n readKeyframes() {\n const { unresolvedKeyframes, element, name } = this\n\n if (!element || !element.current) return\n\n super.readKeyframes()\n\n /**\n * If any keyframe is a CSS variable, we need to find its value by sampling the element\n */\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n let keyframe = unresolvedKeyframes[i]\n\n if (typeof keyframe === \"string\") {\n keyframe = keyframe.trim()\n\n if (isCSSVariableToken(keyframe)) {\n const resolved = getVariableValue(keyframe, element.current)\n\n if (resolved !== undefined) {\n unresolvedKeyframes[i] = resolved as T\n }\n\n if (i === unresolvedKeyframes.length - 1) {\n this.finalKeyframe = keyframe as T\n }\n }\n }\n }\n\n /**\n * Resolve \"none\" values. We do this potentially twice - once before and once after measuring keyframes.\n * This could be seen as inefficient but it's a trade-off to avoid measurements in more situations, which\n * have a far bigger performance impact.\n */\n this.resolveNoneKeyframes()\n\n /**\n * Check to see if unit type has changed. If so schedule jobs that will\n * temporarily set styles to the destination keyframes.\n * Skip if we have more than two keyframes or this isn't a positional value.\n * TODO: We can throw if there are multiple keyframes and the value type changes.\n */\n if (!positionalKeys.has(name) || unresolvedKeyframes.length !== 2) {\n return\n }\n\n const [origin, target] = unresolvedKeyframes\n const originType = findDimensionValueType(origin)\n const targetType = findDimensionValueType(target)\n\n /**\n * If one keyframe contains embedded CSS variables (e.g. in calc()) and the other\n * doesn't, we need to measure to convert to pixels. This handles GitHub issue #3410.\n */\n const originHasVar = containsCSSVariable(origin)\n const targetHasVar = containsCSSVariable(target)\n\n if (originHasVar !== targetHasVar && positionalValues[name]) {\n this.needsMeasurement = true\n return\n }\n\n /**\n * Either we don't recognise these value types or we can animate between them.\n */\n if (originType === targetType) return\n\n /**\n * If both values are numbers or pixels, we can animate between them by\n * converting them to numbers.\n */\n if (isNumOrPxType(originType) && isNumOrPxType(targetType)) {\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n const value = unresolvedKeyframes[i]\n if (typeof value === \"string\") {\n unresolvedKeyframes[i] = parseFloat(value as string)\n }\n }\n } else if (positionalValues[name]) {\n /**\n * Else, the only way to resolve this is by measuring the element.\n */\n this.needsMeasurement = true\n }\n }\n\n resolveNoneKeyframes() {\n const { unresolvedKeyframes, name } = this\n\n const noneKeyframeIndexes: number[] = []\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n if (\n unresolvedKeyframes[i] === null ||\n isNone(unresolvedKeyframes[i])\n ) {\n noneKeyframeIndexes.push(i)\n }\n }\n\n if (noneKeyframeIndexes.length) {\n makeNoneKeyframesAnimatable(\n unresolvedKeyframes,\n noneKeyframeIndexes,\n name\n )\n }\n }\n\n measureInitialState() {\n const { element, unresolvedKeyframes, name } = this\n\n if (!element || !element.current) return\n\n if (name === \"height\") {\n this.suspendedScrollY = window.pageYOffset\n }\n\n this.measuredOrigin = positionalValues[name](\n element.measureViewportBox(),\n window.getComputedStyle(element.current)\n )\n\n unresolvedKeyframes[0] = this.measuredOrigin\n\n // Set final key frame to measure after next render\n const measureKeyframe =\n unresolvedKeyframes[unresolvedKeyframes.length - 1]\n\n if (measureKeyframe !== undefined) {\n element.getValue(name, measureKeyframe).jump(measureKeyframe, false)\n }\n }\n\n measureEndState() {\n const { element, name, unresolvedKeyframes } = this\n\n if (!element || !element.current) return\n\n const value = element.getValue(name)\n value && value.jump(this.measuredOrigin, false)\n\n const finalKeyframeIndex = unresolvedKeyframes.length - 1\n const finalKeyframe = unresolvedKeyframes[finalKeyframeIndex]\n\n unresolvedKeyframes[finalKeyframeIndex] = positionalValues[name](\n element.measureViewportBox(),\n window.getComputedStyle(element.current)\n ) as any\n\n if (finalKeyframe !== null && this.finalKeyframe === undefined) {\n this.finalKeyframe = finalKeyframe as T\n }\n\n // If we removed transform values, reapply them before the next render\n if (this.removedTransforms?.length) {\n this.removedTransforms.forEach(\n ([unsetTransformName, unsetTransformValue]) => {\n element\n .getValue(unsetTransformName)!\n .set(unsetTransformValue)\n }\n )\n }\n\n this.resolveNoneKeyframes()\n }\n}\n"],"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,CAAC,IAAI,CAAC;QACpC,KAAK,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,KAAK,CAAC;AAE/C,QAAA,MAAM,kBAAkB,GAAG,mBAAmB,CAAC,MAAM,GAAG,CAAC;AACzD,QAAA,MAAM,aAAa,GAAG,mBAAmB,CAAC,kBAAkB,CAAC;QAE7D,mBAAmB,CAAC,kBAAkB,CAAC,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAC5D,OAAO,CAAC,kBAAkB,EAAE,EAC5B,MAAM,CAAC,gBAAgB,CAAC,OAAO,CAAC,OAAO,CAAC,CACpC;QAER,IAAI,aAAa,KAAK,IAAI,IAAI,IAAI,CAAC,aAAa,KAAK,SAAS,EAAE;AAC5D,YAAA,IAAI,CAAC,aAAa,GAAG,aAAkB;QAC3C;;AAGA,QAAA,IAAI,IAAI,CAAC,iBAAiB,EAAE,MAAM,EAAE;AAChC,YAAA,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAC1B,CAAC,CAAC,kBAAkB,EAAE,mBAAmB,CAAC,KAAI;gBAC1C;qBACK,QAAQ,CAAC,kBAAkB;qBAC3B,GAAG,CAAC,mBAAmB,CAAC;AACjC,YAAA,CAAC,CACJ;QACL;QAEA,IAAI,CAAC,oBAAoB,EAAE;IAC/B;AACH;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/keyframes/KeyframesResolver.mjs b/node_modules/motion-dom/dist/es/animation/keyframes/KeyframesResolver.mjs new file mode 100644 index 0000000..262a2f3 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/keyframes/KeyframesResolver.mjs @@ -0,0 +1,148 @@ +import { fillWildcards } from './utils/fill-wildcards.mjs'; +import { removeNonTranslationalTransform } from './utils/unit-conversion.mjs'; +import { frame } from '../../frameloop/frame.mjs'; + +const toResolve = new Set(); +let isScheduled = false; +let anyNeedsMeasurement = false; +let isForced = false; +function measureAllKeyframes() { + if (anyNeedsMeasurement) { + const resolversToMeasure = Array.from(toResolve).filter((resolver) => resolver.needsMeasurement); + const elementsToMeasure = new Set(resolversToMeasure.map((resolver) => resolver.element)); + const transformsToRestore = new Map(); + /** + * Write pass + * If we're measuring elements we want to remove bounding box-changing transforms. + */ + elementsToMeasure.forEach((element) => { + const removedTransforms = removeNonTranslationalTransform(element); + if (!removedTransforms.length) + return; + transformsToRestore.set(element, removedTransforms); + element.render(); + }); + // Read + resolversToMeasure.forEach((resolver) => resolver.measureInitialState()); + // Write + elementsToMeasure.forEach((element) => { + element.render(); + const restore = transformsToRestore.get(element); + if (restore) { + restore.forEach(([key, value]) => { + element.getValue(key)?.set(value); + }); + } + }); + // Read + resolversToMeasure.forEach((resolver) => resolver.measureEndState()); + // Write + resolversToMeasure.forEach((resolver) => { + if (resolver.suspendedScrollY !== undefined) { + window.scrollTo(0, resolver.suspendedScrollY); + } + }); + } + anyNeedsMeasurement = false; + isScheduled = false; + toResolve.forEach((resolver) => resolver.complete(isForced)); + toResolve.clear(); +} +function readAllKeyframes() { + toResolve.forEach((resolver) => { + resolver.readKeyframes(); + if (resolver.needsMeasurement) { + anyNeedsMeasurement = true; + } + }); +} +function flushKeyframeResolvers() { + isForced = true; + readAllKeyframes(); + measureAllKeyframes(); + isForced = false; +} +class KeyframeResolver { + constructor(unresolvedKeyframes, onComplete, name, motionValue, element, isAsync = false) { + this.state = "pending"; + /** + * Track whether this resolver is async. If it is, it'll be added to the + * resolver queue and flushed in the next frame. Resolvers that aren't going + * to trigger read/write thrashing don't need to be async. + */ + this.isAsync = false; + /** + * Track whether this resolver needs to perform a measurement + * to resolve its keyframes. + */ + this.needsMeasurement = false; + this.unresolvedKeyframes = [...unresolvedKeyframes]; + this.onComplete = onComplete; + this.name = name; + this.motionValue = motionValue; + this.element = element; + this.isAsync = isAsync; + } + scheduleResolve() { + this.state = "scheduled"; + if (this.isAsync) { + toResolve.add(this); + if (!isScheduled) { + isScheduled = true; + frame.read(readAllKeyframes); + frame.resolveKeyframes(measureAllKeyframes); + } + } + else { + this.readKeyframes(); + this.complete(); + } + } + readKeyframes() { + const { unresolvedKeyframes, name, element, motionValue } = this; + // If initial keyframe is null we need to read it from the DOM + if (unresolvedKeyframes[0] === null) { + const currentValue = motionValue?.get(); + // TODO: This doesn't work if the final keyframe is a wildcard + const finalKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1]; + if (currentValue !== undefined) { + unresolvedKeyframes[0] = currentValue; + } + else if (element && name) { + const valueAsRead = element.readValue(name, finalKeyframe); + if (valueAsRead !== undefined && valueAsRead !== null) { + unresolvedKeyframes[0] = valueAsRead; + } + } + if (unresolvedKeyframes[0] === undefined) { + unresolvedKeyframes[0] = finalKeyframe; + } + if (motionValue && currentValue === undefined) { + motionValue.set(unresolvedKeyframes[0]); + } + } + fillWildcards(unresolvedKeyframes); + } + setFinalKeyframe() { } + measureInitialState() { } + renderEndStyles() { } + measureEndState() { } + complete(isForcedComplete = false) { + this.state = "complete"; + this.onComplete(this.unresolvedKeyframes, this.finalKeyframe, isForcedComplete); + toResolve.delete(this); + } + cancel() { + if (this.state === "scheduled") { + toResolve.delete(this); + this.state = "pending"; + } + } + resume() { + if (this.state === "pending") + this.scheduleResolve(); + } +} + +export { KeyframeResolver, flushKeyframeResolvers }; +//# sourceMappingURL=KeyframesResolver.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/keyframes/KeyframesResolver.mjs.map b/node_modules/motion-dom/dist/es/animation/keyframes/KeyframesResolver.mjs.map new file mode 100644 index 0000000..32e68e2 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/keyframes/KeyframesResolver.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"KeyframesResolver.mjs","sources":["../../../../src/animation/keyframes/KeyframesResolver.ts"],"sourcesContent":["import { frame } from \"../../frameloop\"\nimport { MotionValue } from \"../../value\"\nimport { AnyResolvedKeyframe } from \"../types\"\nimport { WithRender } from \"./types\"\nimport { fillWildcards } from \"./utils/fill-wildcards\"\nimport { removeNonTranslationalTransform } from \"./utils/unit-conversion\"\n\nexport type UnresolvedKeyframes = Array\n\nexport type ResolvedKeyframes = Array\n\nconst toResolve = new Set()\nlet isScheduled = false\nlet anyNeedsMeasurement = false\nlet isForced = false\n\nfunction measureAllKeyframes() {\n if (anyNeedsMeasurement) {\n const resolversToMeasure = Array.from(toResolve).filter(\n (resolver: KeyframeResolver) => resolver.needsMeasurement\n )\n const elementsToMeasure = new Set(\n resolversToMeasure.map((resolver) => resolver.element)\n )\n const transformsToRestore = new Map<\n WithRender,\n [string, AnyResolvedKeyframe][]\n >()\n\n /**\n * Write pass\n * If we're measuring elements we want to remove bounding box-changing transforms.\n */\n elementsToMeasure.forEach((element: WithRender) => {\n const removedTransforms = removeNonTranslationalTransform(\n element as any\n )\n\n if (!removedTransforms.length) return\n\n transformsToRestore.set(element, removedTransforms)\n\n element.render()\n })\n\n // Read\n resolversToMeasure.forEach((resolver) => resolver.measureInitialState())\n\n // Write\n elementsToMeasure.forEach((element: WithRender) => {\n element.render()\n\n const restore = transformsToRestore.get(element)\n if (restore) {\n restore.forEach(([key, value]) => {\n element.getValue(key)?.set(value)\n })\n }\n })\n\n // Read\n resolversToMeasure.forEach((resolver) => resolver.measureEndState())\n\n // Write\n resolversToMeasure.forEach((resolver) => {\n if (resolver.suspendedScrollY !== undefined) {\n window.scrollTo(0, resolver.suspendedScrollY)\n }\n })\n }\n\n anyNeedsMeasurement = false\n isScheduled = false\n\n toResolve.forEach((resolver) => resolver.complete(isForced))\n toResolve.clear()\n}\n\nfunction readAllKeyframes() {\n toResolve.forEach((resolver) => {\n resolver.readKeyframes()\n\n if (resolver.needsMeasurement) {\n anyNeedsMeasurement = true\n }\n })\n}\n\nexport function flushKeyframeResolvers() {\n isForced = true\n readAllKeyframes()\n measureAllKeyframes()\n isForced = false\n}\n\nexport type OnKeyframesResolved = (\n resolvedKeyframes: ResolvedKeyframes,\n finalKeyframe: T,\n forced: boolean\n) => void\n\nexport class KeyframeResolver {\n name?: string\n element?: WithRender\n finalKeyframe?: T\n suspendedScrollY?: number\n\n protected unresolvedKeyframes: UnresolvedKeyframes\n\n private motionValue?: MotionValue\n private onComplete: OnKeyframesResolved\n\n state: \"pending\" | \"scheduled\" | \"complete\" = \"pending\"\n\n /**\n * Track whether this resolver is async. If it is, it'll be added to the\n * resolver queue and flushed in the next frame. Resolvers that aren't going\n * to trigger read/write thrashing don't need to be async.\n */\n private isAsync = false\n\n /**\n * Track whether this resolver needs to perform a measurement\n * to resolve its keyframes.\n */\n needsMeasurement = false\n\n constructor(\n unresolvedKeyframes: UnresolvedKeyframes,\n onComplete: OnKeyframesResolved,\n name?: string,\n motionValue?: MotionValue,\n element?: WithRender,\n isAsync = false\n ) {\n this.unresolvedKeyframes = [...unresolvedKeyframes]\n this.onComplete = onComplete\n this.name = name\n this.motionValue = motionValue\n this.element = element\n this.isAsync = isAsync\n }\n\n scheduleResolve() {\n this.state = \"scheduled\"\n\n if (this.isAsync) {\n toResolve.add(this)\n\n if (!isScheduled) {\n isScheduled = true\n frame.read(readAllKeyframes)\n frame.resolveKeyframes(measureAllKeyframes)\n }\n } else {\n this.readKeyframes()\n this.complete()\n }\n }\n\n readKeyframes() {\n const { unresolvedKeyframes, name, element, motionValue } = this\n\n // If initial keyframe is null we need to read it from the DOM\n if (unresolvedKeyframes[0] === null) {\n const currentValue = motionValue?.get()\n\n // TODO: This doesn't work if the final keyframe is a wildcard\n const finalKeyframe =\n unresolvedKeyframes[unresolvedKeyframes.length - 1]\n\n if (currentValue !== undefined) {\n unresolvedKeyframes[0] = currentValue\n } else if (element && name) {\n const valueAsRead = element.readValue(name, finalKeyframe)\n\n if (valueAsRead !== undefined && valueAsRead !== null) {\n unresolvedKeyframes[0] = valueAsRead\n }\n }\n\n if (unresolvedKeyframes[0] === undefined) {\n unresolvedKeyframes[0] = finalKeyframe\n }\n\n if (motionValue && currentValue === undefined) {\n motionValue.set(unresolvedKeyframes[0] as T)\n }\n }\n\n fillWildcards(unresolvedKeyframes)\n }\n\n setFinalKeyframe() {}\n measureInitialState() {}\n renderEndStyles() {}\n measureEndState() {}\n\n complete(isForcedComplete = false) {\n this.state = \"complete\"\n\n this.onComplete(\n this.unresolvedKeyframes as ResolvedKeyframes,\n this.finalKeyframe as T,\n isForcedComplete\n )\n\n toResolve.delete(this)\n }\n\n cancel() {\n if (this.state === \"scheduled\") {\n toResolve.delete(this)\n this.state = \"pending\"\n }\n }\n\n resume() {\n if (this.state === \"pending\") this.scheduleResolve()\n }\n}\n"],"names":[],"mappings":";;;;AAWA,MAAM,SAAS,GAAG,IAAI,GAAG,EAAoB;AAC7C,IAAI,WAAW,GAAG,KAAK;AACvB,IAAI,mBAAmB,GAAG,KAAK;AAC/B,IAAI,QAAQ,GAAG,KAAK;AAEpB,SAAS,mBAAmB,GAAA;IACxB,IAAI,mBAAmB,EAAE;QACrB,MAAM,kBAAkB,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,MAAM,CACnD,CAAC,QAA0B,KAAK,QAAQ,CAAC,gBAAgB,CAC5D;AACD,QAAA,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAC7B,kBAAkB,CAAC,GAAG,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC,OAAO,CAAC,CACzD;AACD,QAAA,MAAM,mBAAmB,GAAG,IAAI,GAAG,EAGhC;AAEH;;;AAGG;AACH,QAAA,iBAAiB,CAAC,OAAO,CAAC,CAAC,OAAmB,KAAI;AAC9C,YAAA,MAAM,iBAAiB,GAAG,+BAA+B,CACrD,OAAc,CACjB;YAED,IAAI,CAAC,iBAAiB,CAAC,MAAM;gBAAE;AAE/B,YAAA,mBAAmB,CAAC,GAAG,CAAC,OAAO,EAAE,iBAAiB,CAAC;YAEnD,OAAO,CAAC,MAAM,EAAE;AACpB,QAAA,CAAC,CAAC;;AAGF,QAAA,kBAAkB,CAAC,OAAO,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC,mBAAmB,EAAE,CAAC;;AAGxE,QAAA,iBAAiB,CAAC,OAAO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;YAAE,IAAI,CAAC,eAAe,EAAE;IACxD;AACH;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/keyframes/get-final.mjs b/node_modules/motion-dom/dist/es/animation/keyframes/get-final.mjs new file mode 100644 index 0000000..4306bd8 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/keyframes/get-final.mjs @@ -0,0 +1,12 @@ +const isNotNull = (value) => value !== null; +function getFinalKeyframe(keyframes, { repeat, repeatType = "loop" }, finalKeyframe, speed = 1) { + const resolvedKeyframes = keyframes.filter(isNotNull); + const useFirstKeyframe = speed < 0 || (repeat && repeatType !== "loop" && repeat % 2 === 1); + const index = useFirstKeyframe ? 0 : resolvedKeyframes.length - 1; + return !index || finalKeyframe === undefined + ? resolvedKeyframes[index] + : finalKeyframe; +} + +export { getFinalKeyframe }; +//# sourceMappingURL=get-final.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/keyframes/get-final.mjs.map b/node_modules/motion-dom/dist/es/animation/keyframes/get-final.mjs.map new file mode 100644 index 0000000..e364cbf --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/keyframes/get-final.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"get-final.mjs","sources":["../../../../src/animation/keyframes/get-final.ts"],"sourcesContent":["import { AnimationPlaybackOptions } from \"../types\"\n\nconst isNotNull = (value: unknown) => value !== null\n\nexport function getFinalKeyframe(\n keyframes: T[],\n { repeat, repeatType = \"loop\" }: AnimationPlaybackOptions,\n finalKeyframe?: T,\n speed: number = 1\n): T {\n const resolvedKeyframes = keyframes.filter(isNotNull)\n const useFirstKeyframe =\n speed < 0 || (repeat && repeatType !== \"loop\" && repeat % 2 === 1)\n const index = useFirstKeyframe ? 0 : resolvedKeyframes.length - 1\n\n return !index || finalKeyframe === undefined\n ? resolvedKeyframes[index]\n : finalKeyframe\n}\n"],"names":[],"mappings":"AAEA,MAAM,SAAS,GAAG,CAAC,KAAc,KAAK,KAAK,KAAK,IAAI;SAEpC,gBAAgB,CAC5B,SAAc,EACd,EAAE,MAAM,EAAE,UAAU,GAAG,MAAM,EAA4B,EACzD,aAAiB,EACjB,QAAgB,CAAC,EAAA;IAEjB,MAAM,iBAAiB,GAAG,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC;AACrD,IAAA,MAAM,gBAAgB,GAClB,KAAK,GAAG,CAAC,KAAK,MAAM,IAAI,UAAU,KAAK,MAAM,IAAI,MAAM,GAAG,CAAC,KAAK,CAAC,CAAC;AACtE,IAAA,MAAM,KAAK,GAAG,gBAAgB,GAAG,CAAC,GAAG,iBAAiB,CAAC,MAAM,GAAG,CAAC;AAEjE,IAAA,OAAO,CAAC,KAAK,IAAI,aAAa,KAAK;AAC/B,UAAE,iBAAiB,CAAC,KAAK;UACvB,aAAa;AACvB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/keyframes/offsets/default.mjs b/node_modules/motion-dom/dist/es/animation/keyframes/offsets/default.mjs new file mode 100644 index 0000000..c2735fe --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/keyframes/offsets/default.mjs @@ -0,0 +1,10 @@ +import { fillOffset } from './fill.mjs'; + +function defaultOffset(arr) { + const offset = [0]; + fillOffset(offset, arr.length - 1); + return offset; +} + +export { defaultOffset }; +//# sourceMappingURL=default.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/keyframes/offsets/default.mjs.map b/node_modules/motion-dom/dist/es/animation/keyframes/offsets/default.mjs.map new file mode 100644 index 0000000..108037c --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/keyframes/offsets/default.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"default.mjs","sources":["../../../../../src/animation/keyframes/offsets/default.ts"],"sourcesContent":["import { fillOffset } from \"./fill\"\n\nexport function defaultOffset(arr: any[]): number[] {\n const offset = [0]\n fillOffset(offset, arr.length - 1)\n return offset\n}\n"],"names":[],"mappings":";;AAEM,SAAU,aAAa,CAAC,GAAU,EAAA;AACpC,IAAA,MAAM,MAAM,GAAG,CAAC,CAAC,CAAC;IAClB,UAAU,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC;AAClC,IAAA,OAAO,MAAM;AACjB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/keyframes/offsets/fill.mjs b/node_modules/motion-dom/dist/es/animation/keyframes/offsets/fill.mjs new file mode 100644 index 0000000..9f1f783 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/keyframes/offsets/fill.mjs @@ -0,0 +1,13 @@ +import { progress } from 'motion-utils'; +import { mixNumber } from '../../../utils/mix/number.mjs'; + +function fillOffset(offset, remaining) { + const min = offset[offset.length - 1]; + for (let i = 1; i <= remaining; i++) { + const offsetProgress = progress(0, remaining, i); + offset.push(mixNumber(min, 1, offsetProgress)); + } +} + +export { fillOffset }; +//# sourceMappingURL=fill.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/keyframes/offsets/fill.mjs.map b/node_modules/motion-dom/dist/es/animation/keyframes/offsets/fill.mjs.map new file mode 100644 index 0000000..6c2896a --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/keyframes/offsets/fill.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"fill.mjs","sources":["../../../../../src/animation/keyframes/offsets/fill.ts"],"sourcesContent":["import { progress } from \"motion-utils\"\nimport { mixNumber } from \"../../../utils/mix/number\"\n\nexport function fillOffset(offset: number[], remaining: number): void {\n const min = offset[offset.length - 1]\n for (let i = 1; i <= remaining; i++) {\n const offsetProgress = progress(0, remaining, i)\n offset.push(mixNumber(min, 1, offsetProgress))\n }\n}\n"],"names":[],"mappings":";;;AAGM,SAAU,UAAU,CAAC,MAAgB,EAAE,SAAiB,EAAA;IAC1D,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;AACrC,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,SAAS,EAAE,CAAC,EAAE,EAAE;QACjC,MAAM,cAAc,GAAG,QAAQ,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC;AAChD,QAAA,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,EAAE,cAAc,CAAC,CAAC;IAClD;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/keyframes/offsets/time.mjs b/node_modules/motion-dom/dist/es/animation/keyframes/offsets/time.mjs new file mode 100644 index 0000000..9c2a8cf --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/keyframes/offsets/time.mjs @@ -0,0 +1,6 @@ +function convertOffsetToTimes(offset, duration) { + return offset.map((o) => o * duration); +} + +export { convertOffsetToTimes }; +//# sourceMappingURL=time.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/keyframes/offsets/time.mjs.map b/node_modules/motion-dom/dist/es/animation/keyframes/offsets/time.mjs.map new file mode 100644 index 0000000..f79b799 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/keyframes/offsets/time.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"time.mjs","sources":["../../../../../src/animation/keyframes/offsets/time.ts"],"sourcesContent":["export function convertOffsetToTimes(offset: number[], duration: number) {\n return offset.map((o) => o * duration)\n}\n"],"names":[],"mappings":"AAAM,SAAU,oBAAoB,CAAC,MAAgB,EAAE,QAAgB,EAAA;AACnE,IAAA,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,QAAQ,CAAC;AAC1C;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/keyframes/utils/apply-px-defaults.mjs b/node_modules/motion-dom/dist/es/animation/keyframes/utils/apply-px-defaults.mjs new file mode 100644 index 0000000..1f37035 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/keyframes/utils/apply-px-defaults.mjs @@ -0,0 +1,12 @@ +import { pxValues } from '../../waapi/utils/px-values.mjs'; + +function applyPxDefaults(keyframes, name) { + for (let i = 0; i < keyframes.length; i++) { + if (typeof keyframes[i] === "number" && pxValues.has(name)) { + keyframes[i] = keyframes[i] + "px"; + } + } +} + +export { applyPxDefaults }; +//# sourceMappingURL=apply-px-defaults.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/keyframes/utils/apply-px-defaults.mjs.map b/node_modules/motion-dom/dist/es/animation/keyframes/utils/apply-px-defaults.mjs.map new file mode 100644 index 0000000..b5894c2 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/keyframes/utils/apply-px-defaults.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"apply-px-defaults.mjs","sources":["../../../../../src/animation/keyframes/utils/apply-px-defaults.ts"],"sourcesContent":["import { UnresolvedValueKeyframe, ValueKeyframe } from \"../../types\"\nimport { pxValues } from \"../../waapi/utils/px-values\"\n\nexport function applyPxDefaults(\n keyframes: ValueKeyframe[] | UnresolvedValueKeyframe[],\n name: string\n) {\n for (let i = 0; i < keyframes.length; i++) {\n if (typeof keyframes[i] === \"number\" && pxValues.has(name)) {\n keyframes[i] = keyframes[i] + \"px\"\n }\n }\n}\n"],"names":[],"mappings":";;AAGM,SAAU,eAAe,CAC3B,SAAsD,EACtD,IAAY,EAAA;AAEZ,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AACvC,QAAA,IAAI,OAAO,SAAS,CAAC,CAAC,CAAC,KAAK,QAAQ,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;YACxD,SAAS,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,GAAG,IAAI;QACtC;IACJ;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.mjs b/node_modules/motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.mjs new file mode 100644 index 0000000..3875853 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.mjs @@ -0,0 +1,8 @@ +function fillWildcards(keyframes) { + for (let i = 1; i < keyframes.length; i++) { + keyframes[i] ?? (keyframes[i] = keyframes[i - 1]); + } +} + +export { fillWildcards }; +//# sourceMappingURL=fill-wildcards.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.mjs.map b/node_modules/motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.mjs.map new file mode 100644 index 0000000..9dd7452 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"fill-wildcards.mjs","sources":["../../../../../src/animation/keyframes/utils/fill-wildcards.ts"],"sourcesContent":["import { UnresolvedValueKeyframe, ValueKeyframe } from \"../../types\"\n\nexport function fillWildcards(\n keyframes: ValueKeyframe[] | UnresolvedValueKeyframe[]\n) {\n for (let i = 1; i < keyframes.length; i++) {\n keyframes[i] ??= keyframes[i - 1]\n }\n}\n"],"names":[],"mappings":"AAEM,SAAU,aAAa,CACzB,SAAsD,EAAA;AAEtD,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AACvC,QAAA,SAAS,CAAC,CAAC,CAAA,KAAX,SAAS,CAAC,CAAC,CAAA,GAAM,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,CAAA;IACrC;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/keyframes/utils/is-none.mjs b/node_modules/motion-dom/dist/es/animation/keyframes/utils/is-none.mjs new file mode 100644 index 0000000..70b7539 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/keyframes/utils/is-none.mjs @@ -0,0 +1,16 @@ +import { isZeroValueString } from 'motion-utils'; + +function isNone(value) { + if (typeof value === "number") { + return value === 0; + } + else if (value !== null) { + return value === "none" || value === "0" || isZeroValueString(value); + } + else { + return true; + } +} + +export { isNone }; +//# sourceMappingURL=is-none.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/keyframes/utils/is-none.mjs.map b/node_modules/motion-dom/dist/es/animation/keyframes/utils/is-none.mjs.map new file mode 100644 index 0000000..bcb4eac --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/keyframes/utils/is-none.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"is-none.mjs","sources":["../../../../../src/animation/keyframes/utils/is-none.ts"],"sourcesContent":["import { isZeroValueString } from \"motion-utils\"\nimport { AnyResolvedKeyframe } from \"../../types\"\n\nexport function isNone(value: AnyResolvedKeyframe | null) {\n if (typeof value === \"number\") {\n return value === 0\n } else if (value !== null) {\n return value === \"none\" || value === \"0\" || isZeroValueString(value)\n } else {\n return true\n }\n}\n"],"names":[],"mappings":";;AAGM,SAAU,MAAM,CAAC,KAAiC,EAAA;AACpD,IAAA,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAC3B,OAAO,KAAK,KAAK,CAAC;IACtB;AAAO,SAAA,IAAI,KAAK,KAAK,IAAI,EAAE;AACvB,QAAA,OAAO,KAAK,KAAK,MAAM,IAAI,KAAK,KAAK,GAAG,IAAI,iBAAiB,CAAC,KAAK,CAAC;IACxE;SAAO;AACH,QAAA,OAAO,IAAI;IACf;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/keyframes/utils/make-none-animatable.mjs b/node_modules/motion-dom/dist/es/animation/keyframes/utils/make-none-animatable.mjs new file mode 100644 index 0000000..878d19f --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/keyframes/utils/make-none-animatable.mjs @@ -0,0 +1,31 @@ +import { analyseComplexValue } from '../../../value/types/complex/index.mjs'; +import { getAnimatableNone } from '../../../value/types/utils/animatable-none.mjs'; + +/** + * If we encounter keyframes like "none" or "0" and we also have keyframes like + * "#fff" or "200px 200px" we want to find a keyframe to serve as a template for + * the "none" keyframes. In this case "#fff" or "200px 200px" - then these get turned into + * zero equivalents, i.e. "#fff0" or "0px 0px". + */ +const invalidTemplates = new Set(["auto", "none", "0"]); +function makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, name) { + let i = 0; + let animatableTemplate = undefined; + while (i < unresolvedKeyframes.length && !animatableTemplate) { + const keyframe = unresolvedKeyframes[i]; + if (typeof keyframe === "string" && + !invalidTemplates.has(keyframe) && + analyseComplexValue(keyframe).values.length) { + animatableTemplate = unresolvedKeyframes[i]; + } + i++; + } + if (animatableTemplate && name) { + for (const noneIndex of noneKeyframeIndexes) { + unresolvedKeyframes[noneIndex] = getAnimatableNone(name, animatableTemplate); + } + } +} + +export { makeNoneKeyframesAnimatable }; +//# sourceMappingURL=make-none-animatable.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/keyframes/utils/make-none-animatable.mjs.map b/node_modules/motion-dom/dist/es/animation/keyframes/utils/make-none-animatable.mjs.map new file mode 100644 index 0000000..44ce2ff --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/keyframes/utils/make-none-animatable.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"make-none-animatable.mjs","sources":["../../../../../src/animation/keyframes/utils/make-none-animatable.ts"],"sourcesContent":["import { analyseComplexValue } from \"../../../value/types/complex\"\nimport { getAnimatableNone } from \"../../../value/types/utils/animatable-none\"\nimport { AnyResolvedKeyframe } from \"../../types\"\nimport { UnresolvedKeyframes } from \"../KeyframesResolver\"\n\n/**\n * If we encounter keyframes like \"none\" or \"0\" and we also have keyframes like\n * \"#fff\" or \"200px 200px\" we want to find a keyframe to serve as a template for\n * the \"none\" keyframes. In this case \"#fff\" or \"200px 200px\" - then these get turned into\n * zero equivalents, i.e. \"#fff0\" or \"0px 0px\".\n */\nconst invalidTemplates = new Set([\"auto\", \"none\", \"0\"])\n\nexport function makeNoneKeyframesAnimatable(\n unresolvedKeyframes: UnresolvedKeyframes,\n noneKeyframeIndexes: number[],\n name?: string\n) {\n let i = 0\n let animatableTemplate: string | undefined = undefined\n while (i < unresolvedKeyframes.length && !animatableTemplate) {\n const keyframe = unresolvedKeyframes[i]\n if (\n typeof keyframe === \"string\" &&\n !invalidTemplates.has(keyframe) &&\n analyseComplexValue(keyframe).values.length\n ) {\n animatableTemplate = unresolvedKeyframes[i] as string\n }\n i++\n }\n\n if (animatableTemplate && name) {\n for (const noneIndex of noneKeyframeIndexes) {\n unresolvedKeyframes[noneIndex] = getAnimatableNone(\n name,\n animatableTemplate\n )\n }\n }\n}\n"],"names":[],"mappings":";;;AAKA;;;;;AAKG;AACH,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC;SAEvC,2BAA2B,CACvC,mBAA6D,EAC7D,mBAA6B,EAC7B,IAAa,EAAA;IAEb,IAAI,CAAC,GAAG,CAAC;IACT,IAAI,kBAAkB,GAAuB,SAAS;IACtD,OAAO,CAAC,GAAG,mBAAmB,CAAC,MAAM,IAAI,CAAC,kBAAkB,EAAE;AAC1D,QAAA,MAAM,QAAQ,GAAG,mBAAmB,CAAC,CAAC,CAAC;QACvC,IACI,OAAO,QAAQ,KAAK,QAAQ;AAC5B,YAAA,CAAC,gBAAgB,CAAC,GAAG,CAAC,QAAQ,CAAC;YAC/B,mBAAmB,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,MAAM,EAC7C;AACE,YAAA,kBAAkB,GAAG,mBAAmB,CAAC,CAAC,CAAW;QACzD;AACA,QAAA,CAAC,EAAE;IACP;AAEA,IAAA,IAAI,kBAAkB,IAAI,IAAI,EAAE;AAC5B,QAAA,KAAK,MAAM,SAAS,IAAI,mBAAmB,EAAE;YACzC,mBAAmB,CAAC,SAAS,CAAC,GAAG,iBAAiB,CAC9C,IAAI,EACJ,kBAAkB,CACrB;QACL;IACJ;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/keyframes/utils/unit-conversion.mjs b/node_modules/motion-dom/dist/es/animation/keyframes/utils/unit-conversion.mjs new file mode 100644 index 0000000..b76cfc3 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/keyframes/utils/unit-conversion.mjs @@ -0,0 +1,47 @@ +import { parseValueFromTransform } from '../../../render/dom/parse-transform.mjs'; +import { transformPropOrder } from '../../../render/utils/keys-transform.mjs'; +import { number } from '../../../value/types/numbers/index.mjs'; +import { px } from '../../../value/types/numbers/units.mjs'; + +const isNumOrPxType = (v) => v === number || v === px; +const transformKeys = new Set(["x", "y", "z"]); +const nonTranslationalTransformKeys = transformPropOrder.filter((key) => !transformKeys.has(key)); +function removeNonTranslationalTransform(visualElement) { + const removedTransforms = []; + nonTranslationalTransformKeys.forEach((key) => { + const value = visualElement.getValue(key); + if (value !== undefined) { + removedTransforms.push([key, value.get()]); + value.set(key.startsWith("scale") ? 1 : 0); + } + }); + return removedTransforms; +} +const positionalValues = { + // Dimensions + width: ({ x }, { paddingLeft = "0", paddingRight = "0", boxSizing }) => { + const width = x.max - x.min; + return boxSizing === "border-box" + ? width + : width - parseFloat(paddingLeft) - parseFloat(paddingRight); + }, + height: ({ y }, { paddingTop = "0", paddingBottom = "0", boxSizing }) => { + const height = y.max - y.min; + return boxSizing === "border-box" + ? height + : height - parseFloat(paddingTop) - parseFloat(paddingBottom); + }, + top: (_bbox, { top }) => parseFloat(top), + left: (_bbox, { left }) => parseFloat(left), + bottom: ({ y }, { top }) => parseFloat(top) + (y.max - y.min), + right: ({ x }, { left }) => parseFloat(left) + (x.max - x.min), + // Transform + x: (_bbox, { transform }) => parseValueFromTransform(transform, "x"), + y: (_bbox, { transform }) => parseValueFromTransform(transform, "y"), +}; +// Alias translate longform names +positionalValues.translateX = positionalValues.x; +positionalValues.translateY = positionalValues.y; + +export { isNumOrPxType, positionalValues, removeNonTranslationalTransform }; +//# sourceMappingURL=unit-conversion.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/keyframes/utils/unit-conversion.mjs.map b/node_modules/motion-dom/dist/es/animation/keyframes/utils/unit-conversion.mjs.map new file mode 100644 index 0000000..361ab89 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/keyframes/utils/unit-conversion.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"unit-conversion.mjs","sources":["../../../../../src/animation/keyframes/utils/unit-conversion.ts"],"sourcesContent":["import type { Box } from \"motion-utils\"\nimport { parseValueFromTransform } from \"../../../render/dom/parse-transform\"\nimport { transformPropOrder } from \"../../../render/utils/keys-transform\"\nimport { MotionValue } from \"../../../value\"\nimport { number } from \"../../../value/types/numbers\"\nimport { px } from \"../../../value/types/numbers/units\"\nimport { ValueType } from \"../../../value/types/types\"\nimport { AnyResolvedKeyframe } from \"../../types\"\nimport { WithRender } from \"../types\"\n\nexport const isNumOrPxType = (v?: ValueType): v is ValueType =>\n v === number || v === px\n\ntype GetActualMeasurementInPixels = (\n bbox: Box,\n computedStyle: Partial\n) => number\n\nconst transformKeys = new Set([\"x\", \"y\", \"z\"])\nconst nonTranslationalTransformKeys = transformPropOrder.filter(\n (key) => !transformKeys.has(key)\n)\n\ntype RemovedTransforms = [string, AnyResolvedKeyframe][]\nexport function removeNonTranslationalTransform(visualElement: WithRender) {\n const removedTransforms: RemovedTransforms = []\n\n nonTranslationalTransformKeys.forEach((key) => {\n const value: MotionValue | undefined =\n visualElement.getValue(key)\n if (value !== undefined) {\n removedTransforms.push([key, value.get()])\n value.set(key.startsWith(\"scale\") ? 1 : 0)\n }\n })\n\n return removedTransforms\n}\n\nexport const positionalValues: { [key: string]: GetActualMeasurementInPixels } =\n {\n // Dimensions\n width: (\n { x },\n { paddingLeft = \"0\", paddingRight = \"0\", boxSizing }\n ) => {\n const width = x.max - x.min\n return boxSizing === \"border-box\"\n ? width\n : width - parseFloat(paddingLeft) - parseFloat(paddingRight)\n },\n height: (\n { y },\n { paddingTop = \"0\", paddingBottom = \"0\", boxSizing }\n ) => {\n const height = y.max - y.min\n return boxSizing === \"border-box\"\n ? height\n : height - parseFloat(paddingTop) - parseFloat(paddingBottom)\n },\n\n top: (_bbox, { top }) => parseFloat(top as string),\n left: (_bbox, { left }) => parseFloat(left as string),\n bottom: ({ y }, { top }) => parseFloat(top as string) + (y.max - y.min),\n right: ({ x }, { left }) =>\n parseFloat(left as string) + (x.max - x.min),\n\n // Transform\n x: (_bbox, { transform }) => parseValueFromTransform(transform, \"x\"),\n y: (_bbox, { transform }) => parseValueFromTransform(transform, \"y\"),\n }\n\n// Alias translate longform names\npositionalValues.translateX = positionalValues.x\npositionalValues.translateY = positionalValues.y\n"],"names":[],"mappings":";;;;;AAUO,MAAM,aAAa,GAAG,CAAC,CAAa,KACvC,CAAC,KAAK,MAAM,IAAI,CAAC,KAAK;AAO1B,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AAC9C,MAAM,6BAA6B,GAAG,kBAAkB,CAAC,MAAM,CAC3D,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,GAAG,CAAC,CACnC;AAGK,SAAU,+BAA+B,CAAC,aAAyB,EAAA;IACrE,MAAM,iBAAiB,GAAsB,EAAE;AAE/C,IAAA,6BAA6B,CAAC,OAAO,CAAC,CAAC,GAAG,KAAI;QAC1C,MAAM,KAAK,GACP,aAAa,CAAC,QAAQ,CAAC,GAAG,CAAC;AAC/B,QAAA,IAAI,KAAK,KAAK,SAAS,EAAE;AACrB,YAAA,iBAAiB,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC;AAC1C,YAAA,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAC9C;AACJ,IAAA,CAAC,CAAC;AAEF,IAAA,OAAO,iBAAiB;AAC5B;AAEO,MAAM,gBAAgB,GACzB;;AAEI,IAAA,KAAK,EAAE,CACH,EAAE,CAAC,EAAE,EACL,EAAE,WAAW,GAAG,GAAG,EAAE,YAAY,GAAG,GAAG,EAAE,SAAS,EA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AC,UAAU,GAAG,gBAAgB,CAAC,CAAC;AAChD,gBAAgB,CAAC,UAAU,GAAG,gBAAgB,CAAC,CAAC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/optimized-appear/data-id.mjs b/node_modules/motion-dom/dist/es/animation/optimized-appear/data-id.mjs new file mode 100644 index 0000000..a15a511 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/optimized-appear/data-id.mjs @@ -0,0 +1,7 @@ +import { camelToDash } from '../../render/dom/utils/camel-to-dash.mjs'; + +const optimizedAppearDataId = "framerAppearId"; +const optimizedAppearDataAttribute = "data-" + camelToDash(optimizedAppearDataId); + +export { optimizedAppearDataAttribute, optimizedAppearDataId }; +//# sourceMappingURL=data-id.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/optimized-appear/data-id.mjs.map b/node_modules/motion-dom/dist/es/animation/optimized-appear/data-id.mjs.map new file mode 100644 index 0000000..387ed16 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/optimized-appear/data-id.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"data-id.mjs","sources":["../../../../src/animation/optimized-appear/data-id.ts"],"sourcesContent":["import { camelToDash } from \"../../render/dom/utils/camel-to-dash\"\n\nexport const optimizedAppearDataId = \"framerAppearId\"\n\nexport const optimizedAppearDataAttribute =\n \"data-\" + camelToDash(optimizedAppearDataId) as \"data-framer-appear-id\"\n"],"names":[],"mappings":";;AAEO,MAAM,qBAAqB,GAAG;AAE9B,MAAM,4BAA4B,GACrC,OAAO,GAAG,WAAW,CAAC,qBAAqB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/optimized-appear/get-appear-id.mjs b/node_modules/motion-dom/dist/es/animation/optimized-appear/get-appear-id.mjs new file mode 100644 index 0000000..7026149 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/optimized-appear/get-appear-id.mjs @@ -0,0 +1,8 @@ +import { optimizedAppearDataAttribute } from './data-id.mjs'; + +function getOptimisedAppearId(visualElement) { + return visualElement.props[optimizedAppearDataAttribute]; +} + +export { getOptimisedAppearId }; +//# sourceMappingURL=get-appear-id.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/optimized-appear/get-appear-id.mjs.map b/node_modules/motion-dom/dist/es/animation/optimized-appear/get-appear-id.mjs.map new file mode 100644 index 0000000..1b18bdf --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/optimized-appear/get-appear-id.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"get-appear-id.mjs","sources":["../../../../src/animation/optimized-appear/get-appear-id.ts"],"sourcesContent":["import { optimizedAppearDataAttribute } from \"./data-id\"\nimport type { WithAppearProps } from \"./types\"\n\nexport function getOptimisedAppearId(\n visualElement: WithAppearProps\n): string | undefined {\n return visualElement.props[optimizedAppearDataAttribute]\n}\n"],"names":[],"mappings":";;AAGM,SAAU,oBAAoB,CAChC,aAA8B,EAAA;AAE9B,IAAA,OAAO,aAAa,CAAC,KAAK,CAAC,4BAA4B,CAAC;AAC5D;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/utils/WithPromise.mjs b/node_modules/motion-dom/dist/es/animation/utils/WithPromise.mjs new file mode 100644 index 0000000..54a42a1 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/utils/WithPromise.mjs @@ -0,0 +1,27 @@ +class WithPromise { + constructor() { + this.updateFinished(); + } + get finished() { + return this._finished; + } + updateFinished() { + this._finished = new Promise((resolve) => { + this.resolve = resolve; + }); + } + notifyFinished() { + this.resolve(); + } + /** + * Allows the animation to be awaited. + * + * @deprecated Use `finished` instead. + */ + then(onResolve, onReject) { + return this.finished.then(onResolve, onReject); + } +} + +export { WithPromise }; +//# sourceMappingURL=WithPromise.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/utils/WithPromise.mjs.map b/node_modules/motion-dom/dist/es/animation/utils/WithPromise.mjs.map new file mode 100644 index 0000000..7a80df3 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/utils/WithPromise.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"WithPromise.mjs","sources":["../../../../src/animation/utils/WithPromise.ts"],"sourcesContent":["export class WithPromise {\n protected _finished: Promise\n\n resolve: VoidFunction\n\n constructor() {\n this.updateFinished()\n }\n\n get finished() {\n return this._finished\n }\n\n protected updateFinished() {\n this._finished = new Promise((resolve) => {\n this.resolve = resolve\n })\n }\n\n protected notifyFinished() {\n this.resolve()\n }\n\n /**\n * Allows the animation to be awaited.\n *\n * @deprecated Use `finished` instead.\n */\n then(onResolve: VoidFunction, onReject?: VoidFunction) {\n return this.finished.then(onResolve, onReject)\n }\n}\n"],"names":[],"mappings":"MAAa,WAAW,CAAA;AAKpB,IAAA,WAAA,GAAA;QACI,IAAI,CAAC,cAAc,EAAE;IACzB;AAEA,IAAA,IAAI,QAAQ,GAAA;QACR,OAAO,IAAI,CAAC,SAAS;IACzB;IAEU,cAAc,GAAA;QACpB,IAAI,CAAC,SAAS,GAAG,IAAI,OAAO,CAAO,CAAC,OAAO,KAAI;AAC3C,YAAA,IAAI,CAAC,OAAO,GAAG,OAAO;AAC1B,QAAA,CAAC,CAAC;IACN;IAEU,cAAc,GAAA;QACpB,IAAI,CAAC,OAAO,EAAE;IAClB;AAEA;;;;AAIG;IACH,IAAI,CAAC,SAAuB,EAAE,QAAuB,EAAA;QACjD,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC;IAClD;AACH;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/utils/active-animations.mjs b/node_modules/motion-dom/dist/es/animation/utils/active-animations.mjs new file mode 100644 index 0000000..e548994 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/utils/active-animations.mjs @@ -0,0 +1,13 @@ +const animationMaps = new WeakMap(); +const animationMapKey = (name, pseudoElement = "") => `${name}:${pseudoElement}`; +function getAnimationMap(element) { + let map = animationMaps.get(element); + if (!map) { + map = new Map(); + animationMaps.set(element, map); + } + return map; +} + +export { animationMapKey, getAnimationMap }; +//# sourceMappingURL=active-animations.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/utils/active-animations.mjs.map b/node_modules/motion-dom/dist/es/animation/utils/active-animations.mjs.map new file mode 100644 index 0000000..7fb8326 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/utils/active-animations.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"active-animations.mjs","sources":["../../../../src/animation/utils/active-animations.ts"],"sourcesContent":["import { NativeAnimation } from \"../NativeAnimation\"\nimport { AnyResolvedKeyframe } from \"../types\"\n\nconst animationMaps = new WeakMap<\n Element,\n Map>\n>()\nexport const animationMapKey = (name: string, pseudoElement: string = \"\") =>\n `${name}:${pseudoElement}`\n\nexport function getAnimationMap(element: Element) {\n let map = animationMaps.get(element)\n if (!map) {\n map = new Map()\n animationMaps.set(element, map)\n }\n return map\n}\n"],"names":[],"mappings":"AAGA,MAAM,aAAa,GAAG,IAAI,OAAO,EAG9B;AACI,MAAM,eAAe,GAAG,CAAC,IAAY,EAAE,aAAA,GAAwB,EAAE,KACpE,CAAA,EAAG,IAAI,CAAA,CAAA,EAAI,aAAa;AAEtB,SAAU,eAAe,CAAC,OAAgB,EAAA;IAC5C,IAAI,GAAG,GAAG,aAAa,CAAC,GAAG,CAAC,OAAO,CAAC;IACpC,IAAI,CAAC,GAAG,EAAE;AACN,QAAA,GAAG,GAAG,IAAI,GAAG,EAAE;AACf,QAAA,aAAa,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC;IACnC;AACA,IAAA,OAAO,GAAG;AACd;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/utils/arc.mjs b/node_modules/motion-dom/dist/es/animation/utils/arc.mjs new file mode 100644 index 0000000..df08205 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/utils/arc.mjs @@ -0,0 +1,188 @@ +import { wrap } from 'motion-utils'; +import { motionValue } from '../../value/index.mjs'; +import { animateMotionValue } from '../interfaces/motion-value.mjs'; +import { getValueTransition } from './get-value-transition.mjs'; + +const MIN_LAYOUT_DISTANCE = 20; +function bezierPoint(t, origin, control, target) { + const inv = 1 - t; + return inv * inv * origin + 2 * inv * t * control + t * t * target; +} +function bezierTangentAngle(t, originX, controlX, targetX, originY, controlY, targetY) { + const dx = 2 * (1 - t) * (controlX - originX) + 2 * t * (targetX - controlX); + const dy = 2 * (1 - t) * (controlY - originY) + 2 * t * (targetY - controlY); + return Math.atan2(dy, dx) * (180 / Math.PI); +} +function computeArcControlPoint(fromX, fromY, toX, toY, strength, peak) { + const deltaX = toX - fromX; + const deltaY = toY - fromY; + const distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY); + if (distance > 0) { + const normalPerpX = -deltaY / distance; + const normalPerpY = deltaX / distance; + const desiredHeight = strength * distance; + return { + x: fromX + deltaX * peak + normalPerpX * desiredHeight, + y: fromY + deltaY * peak + normalPerpY * desiredHeight, + }; + } + return { x: fromX, y: fromY }; +} +/** + * The pure sampling factory: `(from, to) => (t) => point`. Internal — + * used by {@link arc} and the unit tests. Not part of the public surface. + */ +function createArcPath({ strength = 0.5, peak = 0.5, direction, rotate = false, } = {}) { + const rotationScale = rotate === true ? 1 : typeof rotate === "number" ? rotate : 0; + // Auto-direction only: persists across calls to flip the bulge back + // onto the same screen side when the dominant axis changes between + // calls. Reuse the factory (module scope / useMemo) to keep this alive. + let prevBulgeSign; + const createInterpolator = (from, to) => { + const dx = to.x - from.x; + const dy = to.y - from.y; + let signed; + if (direction === "cw") { + signed = -strength; + } + else if (direction === "ccw") { + signed = strength; + } + else { + const dom = Math.abs(dx) >= Math.abs(dy) ? dx : dy; + signed = dom < 0 ? -strength : strength; + } + let control = computeArcControlPoint(from.x, from.y, to.x, to.y, signed, peak); + if (direction === undefined) { + const isVertical = Math.abs(dx) < Math.abs(dy); + const midX = from.x + dx * peak; + const midY = from.y + dy * peak; + const bulgeSign = isVertical + ? Math.sign(control.x - midX) + : Math.sign(control.y - midY); + if (prevBulgeSign !== undefined && + bulgeSign !== 0 && + bulgeSign !== prevBulgeSign) { + signed = -signed; + control = computeArcControlPoint(from.x, from.y, to.x, to.y, signed, peak); + } + else if (bulgeSign !== 0) { + prevBulgeSign = bulgeSign; + } + } + const tangent0 = rotationScale + ? bezierTangentAngle(0, from.x, control.x, to.x, from.y, control.y, to.y) + : 0; + const tangent1 = rotationScale + ? bezierTangentAngle(1, from.x, control.x, to.x, from.y, control.y, to.y) + : 0; + const tangentDelta = rotationScale + ? wrap(-180, 180, tangent1 - tangent0) + : 0; + return (t) => { + const out = { + x: bezierPoint(t, from.x, control.x, to.x), + y: bezierPoint(t, from.y, control.y, to.y), + }; + if (rotationScale) { + const raw = bezierTangentAngle(t, from.x, control.x, to.x, from.y, control.y, to.y); + const baseline = tangent0 + tangentDelta * t; + out.rotate = wrap(-180, 180, raw - baseline) * rotationScale; + } + return out; + }; + }; + return createInterpolator; +} +/** + * Creates a curved path for `transition.path`: + * + * ```ts + * + * ``` + * + * Reuse the returned value (module scope / useMemo / useRef) so its + * continuity closure survives re-renders — a fresh `arc()` has no memory. + */ +function arc(options = {}) { + const sample = createArcPath(options); + const path = { + interpolateProjection(delta) { + // `from` is the current translate offset (carries any in-flight + // displacement when interrupted); `to` is the new layout origin. + // The distance floor avoids visible wobble on tiny shifts. + const tx = delta.x.translate; + const ty = delta.y.translate; + if (Math.sqrt(tx * tx + ty * ty) < MIN_LAYOUT_DISTANCE) { + return undefined; + } + return sample({ x: tx, y: ty }, { x: 0, y: 0 }); + }, + animateVisualElement(visualElement, target, transition, delay, animations) { + if (!("x" in target || "y" in target)) + return; + const xValue = visualElement.getValue("x", visualElement.latestValues["x"] ?? 0); + const yValue = visualElement.getValue("y", visualElement.latestValues["y"] ?? 0); + const xRaw = target.x; + const yRaw = target.y; + const xFrom = (Array.isArray(xRaw) && xRaw[0] != null + ? xRaw[0] + : xValue?.get()) ?? 0; + const yFrom = (Array.isArray(yRaw) && yRaw[0] != null + ? yRaw[0] + : yValue?.get()) ?? 0; + const xTo = (Array.isArray(xRaw) + ? xRaw[xRaw.length - 1] + : xRaw ?? xFrom); + const yTo = (Array.isArray(yRaw) + ? yRaw[yRaw.length - 1] + : yRaw ?? yFrom); + // Interruption needs no flag: x/y already hold the displaced + // mid-arc position, so xFrom/yFrom carry the continuity geometry. + const interpolate = sample({ x: xFrom, y: yFrom }, { x: xTo, y: yTo }); + // Drive a dedicated `pathRotation` value (composed onto `rotate` + // at the build sites) rather than `rotate` itself, so a + // concurrent rotate animation composes and nothing accumulates + // on interrupt. + const pathRotationValue = interpolate(0).rotate !== undefined + ? visualElement.getValue("pathRotation", 0) + : undefined; + const pathTransition = { + delay, + ...getValueTransition(transition || {}, "x"), + }; + delete pathTransition.path; + const progress = motionValue(0); + progress.start(animateMotionValue("", progress, [0, 1000], { + ...pathTransition, + isSync: true, + velocity: 0, + onUpdate: (latest) => { + const point = interpolate(latest / 1000); + xValue?.set(point.x); + yValue?.set(point.y); + if (pathRotationValue && point.rotate !== undefined) { + pathRotationValue.set(point.rotate); + } + }, + onComplete: () => { + xValue?.set(xTo); + yValue?.set(yTo); + pathRotationValue?.set(0); + }, + // Interrupt/cancel must clear our additive contribution + // so it can't linger on top of the user's `rotate`. + onStop: () => pathRotationValue?.set(0), + onCancel: () => pathRotationValue?.set(0), + })); + if (progress.animation) + animations.push(progress.animation); + delete target.x; + delete target.y; + }, + }; + return path; +} + +export { arc, createArcPath }; +//# sourceMappingURL=arc.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/utils/arc.mjs.map b/node_modules/motion-dom/dist/es/animation/utils/arc.mjs.map new file mode 100644 index 0000000..ef5bfdd --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/utils/arc.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"arc.mjs","sources":["../../../../src/animation/utils/arc.ts"],"sourcesContent":["import { wrap } from \"motion-utils\"\nimport { motionValue } from \"../../value\"\nimport { animateMotionValue } from \"../interfaces/motion-value\"\nimport type { MotionPath, PathInterpolator, Point2D } from \"../types\"\nimport { getValueTransition } from \"./get-value-transition\"\n\nexport interface ArcOptions {\n /**\n * How far the arc bulges perpendicular to the straight-line path,\n * as a fraction of the total distance. A value of `1` means the arc\n * peaks at a height equal to the full travel distance. Default `0.5`.\n */\n strength?: number\n /**\n * Where along the path (0–1) the arc reaches its maximum height.\n * Default `0.5` (symmetric).\n */\n peak?: number\n /**\n * Which side the arc bulges toward.\n * - `\"cw\"` / `\"ccw\"` — locked relative to direction of travel\n * - unset — auto-pick a stable screen-space side\n */\n direction?: \"cw\" | \"ccw\"\n /**\n * Rotates the element to follow the tangent of the arc path.\n * - `true` — full tangent following (1.0)\n * - number 0–1 — scale factor\n */\n rotate?: boolean | number\n}\n\nconst MIN_LAYOUT_DISTANCE = 20\n\nfunction bezierPoint(\n t: number,\n origin: number,\n control: number,\n target: number\n): number {\n const inv = 1 - t\n return inv * inv * origin + 2 * inv * t * control + t * t * target\n}\n\nfunction bezierTangentAngle(\n t: number,\n originX: number,\n controlX: number,\n targetX: number,\n originY: number,\n controlY: number,\n targetY: number\n): number {\n const dx =\n 2 * (1 - t) * (controlX - originX) + 2 * t * (targetX - controlX)\n const dy =\n 2 * (1 - t) * (controlY - originY) + 2 * t * (targetY - controlY)\n return Math.atan2(dy, dx) * (180 / Math.PI)\n}\n\nfunction computeArcControlPoint(\n fromX: number,\n fromY: number,\n toX: number,\n toY: number,\n strength: number,\n peak: number\n): { x: number; y: number } {\n const deltaX = toX - fromX\n const deltaY = toY - fromY\n const distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY)\n\n if (distance > 0) {\n const normalPerpX = -deltaY / distance\n const normalPerpY = deltaX / distance\n const desiredHeight = strength * distance\n\n return {\n x: fromX + deltaX * peak + normalPerpX * desiredHeight,\n y: fromY + deltaY * peak + normalPerpY * desiredHeight,\n }\n }\n\n return { x: fromX, y: fromY }\n}\n\n/**\n * The pure sampling factory: `(from, to) => (t) => point`. Internal —\n * used by {@link arc} and the unit tests. Not part of the public surface.\n */\nexport function createArcPath({\n strength = 0.5,\n peak = 0.5,\n direction,\n rotate = false,\n}: ArcOptions = {}): (from: Point2D, to: Point2D) => PathInterpolator {\n const rotationScale =\n rotate === true ? 1 : typeof rotate === \"number\" ? rotate : 0\n\n // Auto-direction only: persists across calls to flip the bulge back\n // onto the same screen side when the dominant axis changes between\n // calls. Reuse the factory (module scope / useMemo) to keep this alive.\n let prevBulgeSign: number | undefined\n\n const createInterpolator = (\n from: Point2D,\n to: Point2D\n ): PathInterpolator => {\n const dx = to.x - from.x\n const dy = to.y - from.y\n\n let signed: number\n if (direction === \"cw\") {\n signed = -strength\n } else if (direction === \"ccw\") {\n signed = strength\n } else {\n const dom = Math.abs(dx) >= Math.abs(dy) ? dx : dy\n signed = dom < 0 ? -strength : strength\n }\n\n let control = computeArcControlPoint(\n from.x,\n from.y,\n to.x,\n to.y,\n signed,\n peak\n )\n\n if (direction === undefined) {\n const isVertical = Math.abs(dx) < Math.abs(dy)\n const midX = from.x + dx * peak\n const midY = from.y + dy * peak\n const bulgeSign = isVertical\n ? Math.sign(control.x - midX)\n : Math.sign(control.y - midY)\n\n if (\n prevBulgeSign !== undefined &&\n bulgeSign !== 0 &&\n bulgeSign !== prevBulgeSign\n ) {\n signed = -signed\n control = computeArcControlPoint(\n from.x,\n from.y,\n to.x,\n to.y,\n signed,\n peak\n )\n } else if (bulgeSign !== 0) {\n prevBulgeSign = bulgeSign\n }\n }\n\n const tangent0 = rotationScale\n ? bezierTangentAngle(\n 0,\n from.x,\n control.x,\n to.x,\n from.y,\n control.y,\n to.y\n )\n : 0\n const tangent1 = rotationScale\n ? bezierTangentAngle(\n 1,\n from.x,\n control.x,\n to.x,\n from.y,\n control.y,\n to.y\n )\n : 0\n const tangentDelta = rotationScale\n ? wrap(-180, 180, tangent1 - tangent0)\n : 0\n\n return (t: number) => {\n const out: { x: number; y: number; rotate?: number } = {\n x: bezierPoint(t, from.x, control.x, to.x),\n y: bezierPoint(t, from.y, control.y, to.y),\n }\n if (rotationScale) {\n const raw = bezierTangentAngle(\n t,\n from.x,\n control.x,\n to.x,\n from.y,\n control.y,\n to.y\n )\n const baseline = tangent0 + tangentDelta * t\n out.rotate = wrap(-180, 180, raw - baseline) * rotationScale\n }\n return out\n }\n }\n\n return createInterpolator\n}\n\n/**\n * Creates a curved path for `transition.path`:\n *\n * ```ts\n * \n * ```\n *\n * Reuse the returned value (module scope / useMemo / useRef) so its\n * continuity closure survives re-renders — a fresh `arc()` has no memory.\n */\nexport function arc(options: ArcOptions = {}): MotionPath {\n const sample = createArcPath(options)\n\n const path: MotionPath = {\n interpolateProjection(delta) {\n // `from` is the current translate offset (carries any in-flight\n // displacement when interrupted); `to` is the new layout origin.\n // The distance floor avoids visible wobble on tiny shifts.\n const tx = delta.x.translate\n const ty = delta.y.translate\n if (Math.sqrt(tx * tx + ty * ty) < MIN_LAYOUT_DISTANCE) {\n return undefined\n }\n return sample({ x: tx, y: ty }, { x: 0, y: 0 })\n },\n\n animateVisualElement(\n visualElement,\n target,\n transition,\n delay,\n animations\n ) {\n if (!(\"x\" in target || \"y\" in target)) return\n\n const xValue = visualElement.getValue(\n \"x\",\n visualElement.latestValues[\"x\"] ?? 0\n )\n const yValue = visualElement.getValue(\n \"y\",\n visualElement.latestValues[\"y\"] ?? 0\n )\n\n const xRaw = target.x as number | number[] | undefined\n const yRaw = target.y as number | number[] | undefined\n\n const xFrom = ((Array.isArray(xRaw) && xRaw[0] != null\n ? xRaw[0]\n : xValue?.get()) as number) ?? 0\n const yFrom = ((Array.isArray(yRaw) && yRaw[0] != null\n ? yRaw[0]\n : yValue?.get()) as number) ?? 0\n const xTo = (Array.isArray(xRaw)\n ? xRaw[xRaw.length - 1]\n : xRaw ?? xFrom) as number\n const yTo = (Array.isArray(yRaw)\n ? yRaw[yRaw.length - 1]\n : yRaw ?? yFrom) as number\n\n // Interruption needs no flag: x/y already hold the displaced\n // mid-arc position, so xFrom/yFrom carry the continuity geometry.\n const interpolate = sample(\n { x: xFrom, y: yFrom },\n { x: xTo, y: yTo }\n )\n\n // Drive a dedicated `pathRotation` value (composed onto `rotate`\n // at the build sites) rather than `rotate` itself, so a\n // concurrent rotate animation composes and nothing accumulates\n // on interrupt.\n const pathRotationValue =\n interpolate(0).rotate !== undefined\n ? visualElement.getValue(\"pathRotation\", 0)\n : undefined\n\n const pathTransition = {\n delay,\n ...getValueTransition(transition || {}, \"x\"),\n }\n delete (pathTransition as { path?: unknown }).path\n\n const progress = motionValue(0)\n progress.start(\n animateMotionValue(\"\", progress, [0, 1000] as any, {\n ...pathTransition,\n isSync: true,\n velocity: 0,\n onUpdate: (latest: number) => {\n const point = interpolate(latest / 1000)\n xValue?.set(point.x)\n yValue?.set(point.y)\n if (pathRotationValue && point.rotate !== undefined) {\n pathRotationValue.set(point.rotate)\n }\n },\n onComplete: () => {\n xValue?.set(xTo)\n yValue?.set(yTo)\n pathRotationValue?.set(0)\n },\n // Interrupt/cancel must clear our additive contribution\n // so it can't linger on top of the user's `rotate`.\n onStop: () => pathRotationValue?.set(0),\n onCancel: () => pathRotationValue?.set(0),\n })\n )\n\n if (progress.animation) animations.push(progress.animation)\n\n delete (target as { x?: unknown }).x\n delete (target as { y?: unknown }).y\n },\n }\n\n return path\n}\n"],"names":[],"mappings":";;;;;AAgCA,MAAM,mBAAmB,GAAG,EAAE;AAE9B,SAAS,WAAW,CAChB,CAAS,EACT,MAAc,EACd,OAAe,EACf,MAAc,EAAA;AAEd,IAAA,MAAM,GAAG,GAAG,CAAC,GAAG,CAAC;AACjB,IAAA,OAAO,GAAG,GAAG,GAAG,GAAG,MAAM,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,OAAO,GAAG,CAAC,GAAG,CAAC,GAAG,MAAM;AACtE;AAEA,SAAS,kBAAkB,CACvB,CAAS,EACT,OAAe,EACf,QAAgB,EAChB,OAAe,EACf,OAAe,EACf,QAAgB,EAChB,OAAe,EAAA;IAEf,MAAM,EAAE,GACJ,CAAC,IAAI,CAAC,GAA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YAED,IAAI,QAAQ,CAAC,SAAS;AAAE,gBAAA,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC;YAE3D,OAAQ,MAA0B,CAAC,CAAC;YACpC,OAAQ,MAA0B,CAAC,CAAC;QACxC,CAAC;KACJ;AAED,IAAA,OAAO,IAAI;AACf;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/utils/calc-child-stagger.mjs b/node_modules/motion-dom/dist/es/animation/utils/calc-child-stagger.mjs new file mode 100644 index 0000000..4ddf789 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/utils/calc-child-stagger.mjs @@ -0,0 +1,16 @@ +function calcChildStagger(children, child, delayChildren, staggerChildren = 0, staggerDirection = 1) { + const index = Array.from(children) + .sort((a, b) => a.sortNodePosition(b)) + .indexOf(child); + const numChildren = children.size; + const maxStaggerDuration = (numChildren - 1) * staggerChildren; + const delayIsFunction = typeof delayChildren === "function"; + return delayIsFunction + ? delayChildren(index, numChildren) + : staggerDirection === 1 + ? index * staggerChildren + : maxStaggerDuration - index * staggerChildren; +} + +export { calcChildStagger }; +//# sourceMappingURL=calc-child-stagger.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/utils/calc-child-stagger.mjs.map b/node_modules/motion-dom/dist/es/animation/utils/calc-child-stagger.mjs.map new file mode 100644 index 0000000..0a44c64 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/utils/calc-child-stagger.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"calc-child-stagger.mjs","sources":["../../../../src/animation/utils/calc-child-stagger.ts"],"sourcesContent":["import type { DynamicOption } from \"../types\"\nimport type { VisualElement } from \"../../render/VisualElement\"\n\nexport function calcChildStagger(\n children: Set,\n child: VisualElement,\n delayChildren?: number | DynamicOption,\n staggerChildren: number = 0,\n staggerDirection: number = 1\n): number {\n const index = Array.from(children)\n .sort((a, b) => a.sortNodePosition(b))\n .indexOf(child)\n const numChildren = children.size\n const maxStaggerDuration = (numChildren - 1) * staggerChildren\n const delayIsFunction = typeof delayChildren === \"function\"\n\n return delayIsFunction\n ? delayChildren(index, numChildren)\n : staggerDirection === 1\n ? index * staggerChildren\n : maxStaggerDuration - index * staggerChildren\n}\n"],"names":[],"mappings":"AAGM,SAAU,gBAAgB,CAC5B,QAA4B,EAC5B,KAAoB,EACpB,aAA8C,EAC9C,eAAA,GAA0B,CAAC,EAC3B,mBAA2B,CAAC,EAAA;AAE5B,IAAA,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,QAAQ;AAC5B,SAAA,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC;SACpC,OAAO,CAAC,KAAK,CAAC;AACnB,IAAA,MAAM,WAAW,GAAG,QAAQ,CAAC,IAAI;IACjC,MAAM,kBAAkB,GAAG,CAAC,WAAW,GAAG,CAAC,IAAI,eAAe;AAC9D,IAAA,MAAM,eAAe,GAAG,OAAO,aAAa,KAAK,UAAU;AAE3D,IAAA,OAAO;AACH,UAAE,aAAa,CAAC,KAAK,EAAE,WAAW;UAChC,gBAAgB,KAAK;cACrB,KAAK,GAAG;AACV,cAAE,kBAAkB,GAAG,KAAK,GAAG,eAAe;AACtD;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/utils/can-animate.mjs b/node_modules/motion-dom/dist/es/animation/utils/can-animate.mjs new file mode 100644 index 0000000..0df4172 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/utils/can-animate.mjs @@ -0,0 +1,44 @@ +import { warning } from 'motion-utils'; +import { isGenerator } from '../generators/utils/is-generator.mjs'; +import { isAnimatable } from './is-animatable.mjs'; + +function hasKeyframesChanged(keyframes) { + const current = keyframes[0]; + if (keyframes.length === 1) + return true; + for (let i = 0; i < keyframes.length; i++) { + if (keyframes[i] !== current) + return true; + } +} +function canAnimate(keyframes, name, type, velocity) { + /** + * Check if we're able to animate between the start and end keyframes, + * and throw a warning if we're attempting to animate between one that's + * animatable and another that isn't. + */ + const originKeyframe = keyframes[0]; + if (originKeyframe === null) { + return false; + } + /** + * These aren't traditionally animatable but we do support them. + * In future we could look into making this more generic or replacing + * this function with mix() === mixImmediate + */ + if (name === "display" || name === "visibility") + return true; + const targetKeyframe = keyframes[keyframes.length - 1]; + const isOriginAnimatable = isAnimatable(originKeyframe, name); + const isTargetAnimatable = isAnimatable(targetKeyframe, name); + warning(isOriginAnimatable === isTargetAnimatable, `You are trying to animate ${name} from "${originKeyframe}" to "${targetKeyframe}". "${isOriginAnimatable ? targetKeyframe : originKeyframe}" is not an animatable value.`, "value-not-animatable"); + // Always skip if any of these are true + if (!isOriginAnimatable || !isTargetAnimatable) { + return false; + } + return (hasKeyframesChanged(keyframes) || + ((type === "spring" || isGenerator(type)) && velocity)); +} + +export { canAnimate }; +//# sourceMappingURL=can-animate.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/utils/can-animate.mjs.map b/node_modules/motion-dom/dist/es/animation/utils/can-animate.mjs.map new file mode 100644 index 0000000..09c1c48 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/utils/can-animate.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"can-animate.mjs","sources":["../../../../src/animation/utils/can-animate.ts"],"sourcesContent":["import { warning } from \"motion-utils\"\nimport { isGenerator } from \"../generators/utils/is-generator\"\nimport { ResolvedKeyframes } from \"../keyframes/KeyframesResolver\"\nimport { AnimationGeneratorType } from \"../types\"\nimport { isAnimatable } from \"./is-animatable\"\n\nfunction hasKeyframesChanged(keyframes: ResolvedKeyframes) {\n const current = keyframes[0]\n if (keyframes.length === 1) return true\n for (let i = 0; i < keyframes.length; i++) {\n if (keyframes[i] !== current) return true\n }\n}\n\nexport function canAnimate(\n keyframes: ResolvedKeyframes,\n name?: string,\n type?: AnimationGeneratorType,\n velocity?: number\n) {\n /**\n * Check if we're able to animate between the start and end keyframes,\n * and throw a warning if we're attempting to animate between one that's\n * animatable and another that isn't.\n */\n const originKeyframe = keyframes[0]\n if (originKeyframe === null) {\n return false\n }\n\n /**\n * These aren't traditionally animatable but we do support them.\n * In future we could look into making this more generic or replacing\n * this function with mix() === mixImmediate\n */\n if (name === \"display\" || name === \"visibility\") return true\n\n const targetKeyframe = keyframes[keyframes.length - 1]\n const isOriginAnimatable = isAnimatable(originKeyframe, name)\n const isTargetAnimatable = isAnimatable(targetKeyframe, name)\n\n warning(\n isOriginAnimatable === isTargetAnimatable,\n `You are trying to animate ${name} from \"${originKeyframe}\" to \"${targetKeyframe}\". \"${\n isOriginAnimatable ? targetKeyframe : originKeyframe\n }\" is not an animatable value.`,\n \"value-not-animatable\"\n )\n\n // Always skip if any of these are true\n if (!isOriginAnimatable || !isTargetAnimatable) {\n return false\n }\n\n return (\n hasKeyframesChanged(keyframes) ||\n ((type === \"spring\" || isGenerator(type)) && velocity)\n )\n}\n"],"names":[],"mappings":";;;;AAMA,SAAS,mBAAmB,CAAC,SAAiC,EAAA;AAC1D,IAAA,MAAM,OAAO,GAAG,SAAS,CAAC,CAAC,CAAC;AAC5B,IAAA,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC;AAAE,QAAA,OAAO,IAAI;AACvC,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AACvC,QAAA,IAAI,SAAS,CAAC,CAAC,CAAC,KAAK,OAAO;AAAE,YAAA,OAAO,IAAI;IAC7C;AACJ;AAEM,SAAU,UAAU,CACtB,SAAiC,EACjC,IAAa,EACb,IAA6B,EAC7B,QAAiB,EAAA;AAEjB;;;;AAIG;AACH,IAAA,MAAM,cAAc,GAAG,SAAS,CAAC,CAAC,CAAC;AACnC,IAAA,IAAI,cAAc,KAAK,IAAI,EAAE;AACzB,QAAA,OAAO,KAAK;IAChB;AAEA;;;;AAIG;AACH,IAAA,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,YAAY;AAAE,QAAA,OAAO,IAAI;IAE5D,MAAM,cAAc,GAAG,SAAS,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC;IACtD,MAAM,kBAAkB,GAAG,YAAY,CAAC,cAAc,EAAE,IAAI,CAAC;IAC7D,MAAM,kBAAkB,GAAG,YAAY,CAAC,cAAc,EAAE,IAAI,CAAC;IAE7D,OAAO,CACH,kBAAkB,KAAK,kBAAkB,EACzC,6BAA6B,IAAI,CAAA,OAAA,EAAU,cAAc,CAAA,MAAA,EAAS,cAAc,CAAA,IAAA,EAC5E,kBAAkB,GAAG,cAAc,GAAG,cAC1C,CAAA,6BAAA,CAA+B,EAC/B,sBAAsB,CACzB;;AAGD,IAAA,IAAI,CAAC,kBAAkB,IAAI,CAAC,kBAAkB,EAAE;AAC5C,QAAA,OAAO,KAAK;IAChB;AAEA,IAAA,QACI,mBAAmB,CAAC,SAAS,CAAC;AAC9B,SAAC,CAAC,IAAI,KAAK,QAAQ,IAAI,WAAW,CAAC,IAAI,CAAC,KAAK,QAAQ,CAAC;AAE9D;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/utils/css-variables-conversion.mjs b/node_modules/motion-dom/dist/es/animation/utils/css-variables-conversion.mjs new file mode 100644 index 0000000..78c8b40 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/utils/css-variables-conversion.mjs @@ -0,0 +1,42 @@ +import { invariant, isNumericalString } from 'motion-utils'; +import { isCSSVariableToken } from './is-css-variable.mjs'; + +/** + * Parse Framer's special CSS variable format into a CSS token and a fallback. + * + * ``` + * `var(--foo, #fff)` => [`--foo`, '#fff'] + * ``` + * + * @param current + */ +const splitCSSVariableRegex = +// eslint-disable-next-line redos-detector/no-unsafe-regex -- false positive, as it can match a lot of words +/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u; +function parseCSSVariable(current) { + const match = splitCSSVariableRegex.exec(current); + if (!match) + return [,]; + const [, token1, token2, fallback] = match; + return [`--${token1 ?? token2}`, fallback]; +} +const maxDepth = 4; +function getVariableValue(current, element, depth = 1) { + invariant(depth <= maxDepth, `Max CSS variable fallback depth detected in property "${current}". This may indicate a circular fallback dependency.`, "max-css-var-depth"); + const [token, fallback] = parseCSSVariable(current); + // No CSS variable detected + if (!token) + return; + // Attempt to read this CSS variable off the element + const resolved = window.getComputedStyle(element).getPropertyValue(token); + if (resolved) { + const trimmed = resolved.trim(); + return isNumericalString(trimmed) ? parseFloat(trimmed) : trimmed; + } + return isCSSVariableToken(fallback) + ? getVariableValue(fallback, element, depth + 1) + : fallback; +} + +export { getVariableValue, parseCSSVariable }; +//# sourceMappingURL=css-variables-conversion.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/utils/css-variables-conversion.mjs.map b/node_modules/motion-dom/dist/es/animation/utils/css-variables-conversion.mjs.map new file mode 100644 index 0000000..6b17497 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/utils/css-variables-conversion.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"css-variables-conversion.mjs","sources":["../../../../src/animation/utils/css-variables-conversion.ts"],"sourcesContent":["import { invariant, isNumericalString } from \"motion-utils\"\nimport { AnyResolvedKeyframe } from \"../types\"\nimport { CSSVariableToken, isCSSVariableToken } from \"./is-css-variable\"\n\n/**\n * Parse Framer's special CSS variable format into a CSS token and a fallback.\n *\n * ```\n * `var(--foo, #fff)` => [`--foo`, '#fff']\n * ```\n *\n * @param current\n */\n\nconst splitCSSVariableRegex =\n // eslint-disable-next-line redos-detector/no-unsafe-regex -- false positive, as it can match a lot of words\n /^var\\(--(?:([\\w-]+)|([\\w-]+), ?([a-zA-Z\\d ()%#.,-]+))\\)/u\nexport function parseCSSVariable(current: string) {\n const match = splitCSSVariableRegex.exec(current)\n if (!match) return [,]\n\n const [, token1, token2, fallback] = match\n return [`--${token1 ?? token2}`, fallback]\n}\n\nconst maxDepth = 4\nexport function getVariableValue(\n current: CSSVariableToken,\n element: Element,\n depth = 1\n): AnyResolvedKeyframe | undefined {\n invariant(\n depth <= maxDepth,\n `Max CSS variable fallback depth detected in property \"${current}\". This may indicate a circular fallback dependency.`,\n \"max-css-var-depth\"\n )\n\n const [token, fallback] = parseCSSVariable(current)\n\n // No CSS variable detected\n if (!token) return\n\n // Attempt to read this CSS variable off the element\n const resolved = window.getComputedStyle(element).getPropertyValue(token)\n\n if (resolved) {\n const trimmed = resolved.trim()\n return isNumericalString(trimmed) ? parseFloat(trimmed) : trimmed\n }\n\n return isCSSVariableToken(fallback)\n ? getVariableValue(fallback, element, depth + 1)\n : fallback\n}\n"],"names":[],"mappings":";;;AAIA;;;;;;;;AAQG;AAEH,MAAM,qBAAqB;AACvB;AACA,0DAA0D;AACxD,SAAU,gBAAgB,CAAC,OAAe,EAAA;IAC5C,MAAM,KAAK,GAAG,qBAAqB,CAAC,IAAI,CAAC,OAAO,CAAC;AACjD,IAAA,IAAI,CAAC,KAAK;QAAE,OAAO,GAAG;IAEtB,MAAM,GAAG,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,GAAG,KAAK;IAC1C,OAAO,CAAC,KAAK,MAAM,IAAI,MAAM,CAAA,CAAE,EAAE,QAAQ,CAAC;AAC9C;AAEA,MAAM,QAAQ,GAAG,CAAC;AACZ,SAAU,gBAAgB,CAC5B,OAAyB,EACzB,OAAgB,EAChB,KAAK,GAAG,CAAC,EAAA;IAET,SAAS,CACL,KAAK,IAAI,QAAQ,EACjB,CAAA,sDAAA,EAAyD,OAAO,CAAA,oDAAA,CAAsD,EACtH,mBAAmB,CACtB;IAED,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,gBAAgB,CAAC,OAAO,CAAC;;AAGnD,IAAA,IAAI,CAAC,KAAK;QAAE;;AAGZ,IAAA,MAAM,QAAQ,GAAG,MAAM,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC;IAEzE,IAAI,QAAQ,EAAE;AACV,QAAA,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,EAAE;AAC/B,QAAA,OAAO,iBAAiB,CAAC,OAAO,CAAC,GAAG,UAAU,CAAC,OAAO,CAAC,GAAG,OAAO;IACrE;IAEA,OAAO,kBAAkB,CAAC,QAAQ;UAC5B,gBAAgB,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,GAAG,CAAC;UAC7C,QAAQ;AAClB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/utils/default-transitions.mjs b/node_modules/motion-dom/dist/es/animation/utils/default-transitions.mjs new file mode 100644 index 0000000..00ca169 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/utils/default-transitions.mjs @@ -0,0 +1,41 @@ +import { transformProps } from '../../render/utils/keys-transform.mjs'; + +const underDampedSpring = { + type: "spring", + stiffness: 500, + damping: 25, + restSpeed: 10, +}; +const criticallyDampedSpring = (target) => ({ + type: "spring", + stiffness: 550, + damping: target === 0 ? 2 * Math.sqrt(550) : 30, + restSpeed: 10, +}); +const keyframesTransition = { + type: "keyframes", + duration: 0.8, +}; +/** + * Default easing curve is a slightly shallower version of + * the default browser easing curve. + */ +const ease = { + type: "keyframes", + ease: [0.25, 0.1, 0.35, 1], + duration: 0.3, +}; +const getDefaultTransition = (valueKey, { keyframes }) => { + if (keyframes.length > 2) { + return keyframesTransition; + } + else if (transformProps.has(valueKey)) { + return valueKey.startsWith("scale") + ? criticallyDampedSpring(keyframes[1]) + : underDampedSpring; + } + return ease; +}; + +export { getDefaultTransition }; +//# sourceMappingURL=default-transitions.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/utils/default-transitions.mjs.map b/node_modules/motion-dom/dist/es/animation/utils/default-transitions.mjs.map new file mode 100644 index 0000000..f7ef1ae --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/utils/default-transitions.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"default-transitions.mjs","sources":["../../../../src/animation/utils/default-transitions.ts"],"sourcesContent":["import { transformProps } from \"../../render/utils/keys-transform\"\nimport type { ValueAnimationOptions } from \"../types\"\n\nconst underDampedSpring: Partial = {\n type: \"spring\",\n stiffness: 500,\n damping: 25,\n restSpeed: 10,\n}\n\nconst criticallyDampedSpring = (\n target: unknown\n): Partial => ({\n type: \"spring\",\n stiffness: 550,\n damping: target === 0 ? 2 * Math.sqrt(550) : 30,\n restSpeed: 10,\n})\n\nconst keyframesTransition: Partial = {\n type: \"keyframes\",\n duration: 0.8,\n}\n\n/**\n * Default easing curve is a slightly shallower version of\n * the default browser easing curve.\n */\nconst ease: Partial = {\n type: \"keyframes\",\n ease: [0.25, 0.1, 0.35, 1],\n duration: 0.3,\n}\n\nexport const getDefaultTransition = (\n valueKey: string,\n { keyframes }: ValueAnimationOptions\n): Partial => {\n if (keyframes.length > 2) {\n return keyframesTransition\n } else if (transformProps.has(valueKey)) {\n return valueKey.startsWith(\"scale\")\n ? criticallyDampedSpring(keyframes[1])\n : underDampedSpring\n }\n\n return ease\n}\n"],"names":[],"mappings":";;AAGA,MAAM,iBAAiB,GAAmC;AACtD,IAAA,IAAI,EAAE,QAAQ;AACd,IAAA,SAAS,EAAE,GAAG;AACd,IAAA,OAAO,EAAE,EAAE;AACX,IAAA,SAAS,EAAE,EAAE;CAChB;AAED,MAAM,sBAAsB,GAAG,CAC3B,MAAe,MACmB;AAClC,IAAA,IAAI,EAAE,QAAQ;AACd,IAAA,SAAS,EAAE,GAAG;AACd,IAAA,OAAO,EAAE,MAAM,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE;AAC/C,IAAA,SAAS,EAAE,EAAE;AAChB,CAAA,CAAC;AAEF,MAAM,mBAAmB,GAAmC;AACxD,IAAA,IAAI,EAAE,WAAW;AACjB,IAAA,QAAQ,EAAE,GAAG;CAChB;AAED;;;AAGG;AACH,MAAM,IAAI,GAAmC;AACzC,IAAA,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC;AAC1B,IAAA,QAAQ,EAAE,GAAG;CAChB;AAEM,MAAM,oBAAoB,GAAG,CAChC,QAAgB,EAChB,EAAE,SAAS,EAAyB,KACJ;AAChC,IAAA,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE;AACtB,QAAA,OAAO,mBAAmB;IAC9B;AAAO,SAAA,IAAI,cAAc,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE;AACrC,QAAA,OAAO,QAAQ,CAAC,UAAU,CAAC,OAAO;AAC9B,cAAE,sBAAsB,CAAC,SAAS,CAAC,CAAC,CAAC;cACnC,iBAAiB;IAC3B;AAEA,IAAA,OAAO,IAAI;AACf;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/utils/get-value-transition.mjs b/node_modules/motion-dom/dist/es/animation/utils/get-value-transition.mjs new file mode 100644 index 0000000..d616d23 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/utils/get-value-transition.mjs @@ -0,0 +1,14 @@ +import { resolveTransition } from './resolve-transition.mjs'; + +function getValueTransition(transition, key) { + const valueTransition = transition?.[key] ?? + transition?.["default"] ?? + transition; + if (valueTransition !== transition) { + return resolveTransition(valueTransition, transition); + } + return valueTransition; +} + +export { getValueTransition }; +//# sourceMappingURL=get-value-transition.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/utils/get-value-transition.mjs.map b/node_modules/motion-dom/dist/es/animation/utils/get-value-transition.mjs.map new file mode 100644 index 0000000..4e9313c --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/utils/get-value-transition.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"get-value-transition.mjs","sources":["../../../../src/animation/utils/get-value-transition.ts"],"sourcesContent":["import { resolveTransition } from \"./resolve-transition\"\n\nexport function getValueTransition(transition: any, key: string) {\n const valueTransition =\n transition?.[key as keyof typeof transition] ??\n transition?.[\"default\"] ??\n transition\n\n if (valueTransition !== transition) {\n return resolveTransition(valueTransition, transition)\n }\n\n return valueTransition\n}\n"],"names":[],"mappings":";;AAEM,SAAU,kBAAkB,CAAC,UAAe,EAAE,GAAW,EAAA;AAC3D,IAAA,MAAM,eAAe,GACjB,UAAU,GAAG,GAA8B,CAAC;QAC5C,UAAU,GAAG,SAAS,CAAC;AACvB,QAAA,UAAU;AAEd,IAAA,IAAI,eAAe,KAAK,UAAU,EAAE;AAChC,QAAA,OAAO,iBAAiB,CAAC,eAAe,EAAE,UAAU,CAAC;IACzD;AAEA,IAAA,OAAO,eAAe;AAC1B;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/utils/is-animatable.mjs b/node_modules/motion-dom/dist/es/animation/utils/is-animatable.mjs new file mode 100644 index 0000000..b1ca0da --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/utils/is-animatable.mjs @@ -0,0 +1,31 @@ +import { complex } from '../../value/types/complex/index.mjs'; + +/** + * Check if a value is animatable. Examples: + * + * ✅: 100, "100px", "#fff" + * ❌: "block", "url(2.jpg)" + * @param value + * + * @internal + */ +const isAnimatable = (value, name) => { + // If the list of keys that might be non-animatable grows, replace with Set + if (name === "zIndex") + return false; + // If it's a number or a keyframes array, we can animate it. We might at some point + // need to do a deep isAnimatable check of keyframes, or let Popmotion handle this, + // but for now lets leave it like this for performance reasons + if (typeof value === "number" || Array.isArray(value)) + return true; + if (typeof value === "string" && // It's animatable if we have a string + (complex.test(value) || value === "0") && // And it contains numbers and/or colors + !value.startsWith("url(") // Unless it starts with "url(" + ) { + return true; + } + return false; +}; + +export { isAnimatable }; +//# sourceMappingURL=is-animatable.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/utils/is-animatable.mjs.map b/node_modules/motion-dom/dist/es/animation/utils/is-animatable.mjs.map new file mode 100644 index 0000000..6e0d955 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/utils/is-animatable.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"is-animatable.mjs","sources":["../../../../src/animation/utils/is-animatable.ts"],"sourcesContent":["import { complex } from \"../../value/types/complex\"\nimport { ValueKeyframesDefinition } from \"../types\"\n\n/**\n * Check if a value is animatable. Examples:\n *\n * ✅: 100, \"100px\", \"#fff\"\n * ❌: \"block\", \"url(2.jpg)\"\n * @param value\n *\n * @internal\n */\nexport const isAnimatable = (\n value: ValueKeyframesDefinition,\n name?: string\n) => {\n // If the list of keys that might be non-animatable grows, replace with Set\n if (name === \"zIndex\") return false\n\n // If it's a number or a keyframes array, we can animate it. We might at some point\n // need to do a deep isAnimatable check of keyframes, or let Popmotion handle this,\n // but for now lets leave it like this for performance reasons\n if (typeof value === \"number\" || Array.isArray(value)) return true\n\n if (\n typeof value === \"string\" && // It's animatable if we have a string\n (complex.test(value) || value === \"0\") && // And it contains numbers and/or colors\n !value.startsWith(\"url(\") // Unless it starts with \"url(\"\n ) {\n return true\n }\n\n return false\n}\n"],"names":[],"mappings":";;AAGA;;;;;;;;AAQG;MACU,YAAY,GAAG,CACxB,KAA+B,EAC/B,IAAa,KACb;;IAEA,IAAI,IAAI,KAAK,QAAQ;AAAE,QAAA,OAAO,KAAK;;;;IAKnC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;AAAE,QAAA,OAAO,IAAI;AAElE,IAAA,IACI,OAAO,KAAK,KAAK,QAAQ;AACzB,SAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,KAAK,GAAG,CAAC;AACtC,QAAA,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC;MAC3B;AACE,QAAA,OAAO,IAAI;IACf;AAEA,IAAA,OAAO,KAAK;AAChB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/utils/is-css-variable.mjs b/node_modules/motion-dom/dist/es/animation/utils/is-css-variable.mjs new file mode 100644 index 0000000..f0d3618 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/utils/is-css-variable.mjs @@ -0,0 +1,27 @@ +const checkStringStartsWith = (token) => (key) => typeof key === "string" && key.startsWith(token); +const isCSSVariableName = +/*@__PURE__*/ checkStringStartsWith("--"); +const startsAsVariableToken = +/*@__PURE__*/ checkStringStartsWith("var(--"); +const isCSSVariableToken = (value) => { + const startsWithToken = startsAsVariableToken(value); + if (!startsWithToken) + return false; + // Ensure any comments are stripped from the value as this can harm performance of the regex. + return singleCssVariableRegex.test(value.split("/*")[0].trim()); +}; +const singleCssVariableRegex = /var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu; +/** + * Check if a value contains a CSS variable anywhere (e.g. inside calc()). + * Unlike isCSSVariableToken which checks if the value IS a var() token, + * this checks if the value CONTAINS var() somewhere in the string. + */ +function containsCSSVariable(value) { + if (typeof value !== "string") + return false; + // Strip comments to avoid false positives + return value.split("/*")[0].includes("var(--"); +} + +export { containsCSSVariable, isCSSVariableName, isCSSVariableToken }; +//# sourceMappingURL=is-css-variable.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/utils/is-css-variable.mjs.map b/node_modules/motion-dom/dist/es/animation/utils/is-css-variable.mjs.map new file mode 100644 index 0000000..24aaa22 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/utils/is-css-variable.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"is-css-variable.mjs","sources":["../../../../src/animation/utils/is-css-variable.ts"],"sourcesContent":["import { AnyResolvedKeyframe } from \"../types\"\n\nexport type CSSVariableName = `--${string}`\n\nexport type CSSVariableToken = `var(${CSSVariableName})`\n\nconst checkStringStartsWith =\n (token: string) =>\n (key?: AnyResolvedKeyframe | null): key is T =>\n typeof key === \"string\" && key.startsWith(token)\n\nexport const isCSSVariableName =\n /*@__PURE__*/ checkStringStartsWith(\"--\")\n\nconst startsAsVariableToken =\n /*@__PURE__*/ checkStringStartsWith(\"var(--\")\nexport const isCSSVariableToken = (\n value?: string\n): value is CSSVariableToken => {\n const startsWithToken = startsAsVariableToken(value)\n\n if (!startsWithToken) return false\n\n // Ensure any comments are stripped from the value as this can harm performance of the regex.\n return singleCssVariableRegex.test(value.split(\"/*\")[0].trim())\n}\n\nconst singleCssVariableRegex =\n /var\\(--(?:[\\w-]+\\s*|[\\w-]+\\s*,(?:\\s*[^)(\\s]|\\s*\\((?:[^)(]|\\([^)(]*\\))*\\))+\\s*)\\)$/iu\n\n/**\n * Check if a value contains a CSS variable anywhere (e.g. inside calc()).\n * Unlike isCSSVariableToken which checks if the value IS a var() token,\n * this checks if the value CONTAINS var() somewhere in the string.\n */\nexport function containsCSSVariable(\n value?: AnyResolvedKeyframe | null\n): boolean {\n if (typeof value !== \"string\") return false\n // Strip comments to avoid false positives\n return value.split(\"/*\")[0].includes(\"var(--\")\n}\n"],"names":[],"mappings":"AAMA,MAAM,qBAAqB,GACvB,CAAmB,KAAa,KAChC,CAAC,GAAgC,KAC7B,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,CAAC,UAAU,CAAC,KAAK,CAAC;MAE3C,iBAAiB;AAC1B,cAAc,qBAAqB,CAAkB,IAAI;AAE7D,MAAM,qBAAqB;AACvB,cAAc,qBAAqB,CAAmB,QAAQ,CAAC;AAC5D,MAAM,kBAAkB,GAAG,CAC9B,KAAc,KACa;AAC3B,IAAA,MAAM,eAAe,GAAG,qBAAqB,CAAC,KAAK,CAAC;AAEpD,IAAA,IAAI,CAAC,eAAe;AAAE,QAAA,OAAO,KAAK;;AAGlC,IAAA,OAAO,sBAAsB,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;AACnE;AAEA,MAAM,sBAAsB,GACxB,qFAAqF;AAEzF;;;;AAIG;AACG,SAAU,mBAAmB,CAC/B,KAAkC,EAAA;IAElC,IAAI,OAAO,KAAK,KAAK,QAAQ;AAAE,QAAA,OAAO,KAAK;;AAE3C,IAAA,OAAO,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC;AAClD;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/utils/is-transition-defined.mjs b/node_modules/motion-dom/dist/es/animation/utils/is-transition-defined.mjs new file mode 100644 index 0000000..394fca4 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/utils/is-transition-defined.mjs @@ -0,0 +1,27 @@ +const orchestrationKeys = new Set([ + "when", + "delay", + "delayChildren", + "staggerChildren", + "staggerDirection", + "repeat", + "repeatType", + "repeatDelay", + "from", + "elapsed", +]); +/** + * Decide whether a transition is defined on a given Transition. + * This filters out orchestration options and returns true + * if any options are left. + */ +function isTransitionDefined(transition) { + for (const key in transition) { + if (!orchestrationKeys.has(key)) + return true; + } + return false; +} + +export { isTransitionDefined }; +//# sourceMappingURL=is-transition-defined.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/utils/is-transition-defined.mjs.map b/node_modules/motion-dom/dist/es/animation/utils/is-transition-defined.mjs.map new file mode 100644 index 0000000..619fcce --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/utils/is-transition-defined.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"is-transition-defined.mjs","sources":["../../../../src/animation/utils/is-transition-defined.ts"],"sourcesContent":["import type { AnyResolvedKeyframe } from \"../types\"\nimport type { Transition } from \"../types\"\n\nconst orchestrationKeys = new Set([\n \"when\",\n \"delay\",\n \"delayChildren\",\n \"staggerChildren\",\n \"staggerDirection\",\n \"repeat\",\n \"repeatType\",\n \"repeatDelay\",\n \"from\",\n \"elapsed\",\n])\n\n/**\n * Decide whether a transition is defined on a given Transition.\n * This filters out orchestration options and returns true\n * if any options are left.\n */\nexport function isTransitionDefined(\n transition: Transition & { elapsed?: number; from?: AnyResolvedKeyframe }\n) {\n for (const key in transition) {\n if (!orchestrationKeys.has(key)) return true\n }\n return false\n}\n"],"names":[],"mappings":"AAGA,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAC;IAC9B,MAAM;IACN,OAAO;IACP,eAAe;IACf,iBAAiB;IACjB,kBAAkB;IAClB,QAAQ;IACR,YAAY;IACZ,aAAa;IACb,MAAM;IACN,SAAS;AACZ,CAAA,CAAC;AAEF;;;;AAIG;AACG,SAAU,mBAAmB,CAC/B,UAAyE,EAAA;AAEzE,IAAA,KAAK,MAAM,GAAG,IAAI,UAAU,EAAE;AAC1B,QAAA,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,GAAG,CAAC;AAAE,YAAA,OAAO,IAAI;IAChD;AACA,IAAA,OAAO,KAAK;AAChB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/utils/make-animation-instant.mjs b/node_modules/motion-dom/dist/es/animation/utils/make-animation-instant.mjs new file mode 100644 index 0000000..2c66615 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/utils/make-animation-instant.mjs @@ -0,0 +1,7 @@ +function makeAnimationInstant(options) { + options.duration = 0; + options.type = "keyframes"; +} + +export { makeAnimationInstant }; +//# sourceMappingURL=make-animation-instant.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/utils/make-animation-instant.mjs.map b/node_modules/motion-dom/dist/es/animation/utils/make-animation-instant.mjs.map new file mode 100644 index 0000000..38fa574 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/utils/make-animation-instant.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"make-animation-instant.mjs","sources":["../../../../src/animation/utils/make-animation-instant.ts"],"sourcesContent":["import { ValueAnimationOptions } from \"../types\"\n\nexport function makeAnimationInstant(\n options: Partial<{\n duration: ValueAnimationOptions[\"duration\"]\n type: ValueAnimationOptions[\"type\"]\n }>\n): void {\n options.duration = 0\n options.type = \"keyframes\"\n}\n"],"names":[],"mappings":"AAEM,SAAU,oBAAoB,CAChC,OAGE,EAAA;AAEF,IAAA,OAAO,CAAC,QAAQ,GAAG,CAAC;AACpB,IAAA,OAAO,CAAC,IAAI,GAAG,WAAW;AAC9B;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/utils/replace-transition-type.mjs b/node_modules/motion-dom/dist/es/animation/utils/replace-transition-type.mjs new file mode 100644 index 0000000..5d06ecb --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/utils/replace-transition-type.mjs @@ -0,0 +1,19 @@ +import { inertia } from '../generators/inertia.mjs'; +import { keyframes } from '../generators/keyframes.mjs'; +import { spring } from '../generators/spring.mjs'; + +const transitionTypeMap = { + decay: inertia, + inertia, + tween: keyframes, + keyframes: keyframes, + spring, +}; +function replaceTransitionType(transition) { + if (typeof transition.type === "string") { + transition.type = transitionTypeMap[transition.type]; + } +} + +export { replaceTransitionType }; +//# sourceMappingURL=replace-transition-type.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/utils/replace-transition-type.mjs.map b/node_modules/motion-dom/dist/es/animation/utils/replace-transition-type.mjs.map new file mode 100644 index 0000000..f196392 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/utils/replace-transition-type.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"replace-transition-type.mjs","sources":["../../../../src/animation/utils/replace-transition-type.ts"],"sourcesContent":["import { inertia } from \"../generators/inertia\"\nimport { keyframes } from \"../generators/keyframes\"\nimport { spring } from \"../generators/spring\"\nimport { GeneratorFactory, ValueAnimationTransition } from \"../types\"\n\nconst transitionTypeMap: { [key: string]: GeneratorFactory } = {\n decay: inertia,\n inertia,\n tween: keyframes,\n keyframes: keyframes,\n spring,\n}\n\nexport function replaceTransitionType(transition: ValueAnimationTransition) {\n if (typeof transition.type === \"string\") {\n transition.type = transitionTypeMap[transition.type]\n }\n}\n"],"names":[],"mappings":";;;;AAKA,MAAM,iBAAiB,GAAwC;AAC3D,IAAA,KAAK,EAAE,OAAO;IACd,OAAO;AACP,IAAA,KAAK,EAAE,SAAS;AAChB,IAAA,SAAS,EAAE,SAAS;IACpB,MAAM;CACT;AAEK,SAAU,qBAAqB,CAAC,UAAoC,EAAA;AACtE,IAAA,IAAI,OAAO,UAAU,CAAC,IAAI,KAAK,QAAQ,EAAE;QACrC,UAAU,CAAC,IAAI,GAAG,iBAAiB,CAAC,UAAU,CAAC,IAAI,CAAC;IACxD;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/utils/resolve-transition.mjs b/node_modules/motion-dom/dist/es/animation/utils/resolve-transition.mjs new file mode 100644 index 0000000..c49df0b --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/utils/resolve-transition.mjs @@ -0,0 +1,15 @@ +/** + * If `transition` has `inherit: true`, shallow-merge it with + * `parentTransition` (child keys win) and strip the `inherit` key. + * Otherwise return `transition` unchanged. + */ +function resolveTransition(transition, parentTransition) { + if (transition?.inherit && parentTransition) { + const { inherit: _, ...rest } = transition; + return { ...parentTransition, ...rest }; + } + return transition; +} + +export { resolveTransition }; +//# sourceMappingURL=resolve-transition.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/utils/resolve-transition.mjs.map b/node_modules/motion-dom/dist/es/animation/utils/resolve-transition.mjs.map new file mode 100644 index 0000000..1e54351 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/utils/resolve-transition.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"resolve-transition.mjs","sources":["../../../../src/animation/utils/resolve-transition.ts"],"sourcesContent":["/**\n * If `transition` has `inherit: true`, shallow-merge it with\n * `parentTransition` (child keys win) and strip the `inherit` key.\n * Otherwise return `transition` unchanged.\n */\nexport function resolveTransition(\n transition: any,\n parentTransition?: any\n) {\n if (transition?.inherit && parentTransition) {\n const { inherit: _, ...rest } = transition\n return { ...parentTransition, ...rest }\n }\n\n return transition\n}\n"],"names":[],"mappings":"AAAA;;;;AAIG;AACG,SAAU,iBAAiB,CAC7B,UAAe,EACf,gBAAsB,EAAA;AAEtB,IAAA,IAAI,UAAU,EAAE,OAAO,IAAI,gBAAgB,EAAE;QACzC,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,GAAG,IAAI,EAAE,GAAG,UAAU;AAC1C,QAAA,OAAO,EAAE,GAAG,gBAAgB,EAAE,GAAG,IAAI,EAAE;IAC3C;AAEA,IAAA,OAAO,UAAU;AACrB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/waapi/easing/cubic-bezier.mjs b/node_modules/motion-dom/dist/es/animation/waapi/easing/cubic-bezier.mjs new file mode 100644 index 0000000..3b9c686 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/waapi/easing/cubic-bezier.mjs @@ -0,0 +1,4 @@ +const cubicBezierAsString = ([a, b, c, d]) => `cubic-bezier(${a}, ${b}, ${c}, ${d})`; + +export { cubicBezierAsString }; +//# sourceMappingURL=cubic-bezier.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/waapi/easing/cubic-bezier.mjs.map b/node_modules/motion-dom/dist/es/animation/waapi/easing/cubic-bezier.mjs.map new file mode 100644 index 0000000..dc2f3e4 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/waapi/easing/cubic-bezier.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"cubic-bezier.mjs","sources":["../../../../../src/animation/waapi/easing/cubic-bezier.ts"],"sourcesContent":["import { BezierDefinition } from \"motion-utils\"\n\nexport const cubicBezierAsString = ([a, b, c, d]: BezierDefinition) =>\n `cubic-bezier(${a}, ${b}, ${c}, ${d})`\n"],"names":[],"mappings":"AAEO,MAAM,mBAAmB,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAmB,KAC9D,CAAA,aAAA,EAAgB,CAAC,CAAA,EAAA,EAAK,CAAC,CAAA,EAAA,EAAK,CAAC,CAAA,EAAA,EAAK,CAAC,CAAA,CAAA;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/waapi/easing/is-supported.mjs b/node_modules/motion-dom/dist/es/animation/waapi/easing/is-supported.mjs new file mode 100644 index 0000000..73ec416 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/waapi/easing/is-supported.mjs @@ -0,0 +1,15 @@ +import { isBezierDefinition } from 'motion-utils'; +import { supportsLinearEasing } from '../../../utils/supports/linear-easing.mjs'; +import { supportedWaapiEasing } from './supported.mjs'; + +function isWaapiSupportedEasing(easing) { + return Boolean((typeof easing === "function" && supportsLinearEasing()) || + !easing || + (typeof easing === "string" && + (easing in supportedWaapiEasing || supportsLinearEasing())) || + isBezierDefinition(easing) || + (Array.isArray(easing) && easing.every(isWaapiSupportedEasing))); +} + +export { isWaapiSupportedEasing }; +//# sourceMappingURL=is-supported.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/waapi/easing/is-supported.mjs.map b/node_modules/motion-dom/dist/es/animation/waapi/easing/is-supported.mjs.map new file mode 100644 index 0000000..67bd993 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/waapi/easing/is-supported.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"is-supported.mjs","sources":["../../../../../src/animation/waapi/easing/is-supported.ts"],"sourcesContent":["import { Easing, isBezierDefinition } from \"motion-utils\"\nimport { supportsLinearEasing } from \"../../../utils/supports/linear-easing\"\nimport { supportedWaapiEasing } from \"./supported\"\n\nexport function isWaapiSupportedEasing(easing?: Easing | Easing[]): boolean {\n return Boolean(\n (typeof easing === \"function\" && supportsLinearEasing()) ||\n !easing ||\n (typeof easing === \"string\" &&\n (easing in supportedWaapiEasing || supportsLinearEasing())) ||\n isBezierDefinition(easing) ||\n (Array.isArray(easing) && easing.every(isWaapiSupportedEasing))\n )\n}\n"],"names":[],"mappings":";;;;AAIM,SAAU,sBAAsB,CAAC,MAA0B,EAAA;IAC7D,OAAO,OAAO,CACV,CAAC,OAAO,MAAM,KAAK,UAAU,IAAI,oBAAoB,EAAE;AACnD,QAAA,CAAC,MAAM;SACN,OAAO,MAAM,KAAK,QAAQ;AACvB,aAAC,MAAM,IAAI,oBAAoB,IAAI,oBAAoB,EAAE,CAAC,CAAC;QAC/D,kBAAkB,CAAC,MAAM,CAAC;AAC1B,SAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC,CACtE;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/waapi/easing/map-easing.mjs b/node_modules/motion-dom/dist/es/animation/waapi/easing/map-easing.mjs new file mode 100644 index 0000000..4928688 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/waapi/easing/map-easing.mjs @@ -0,0 +1,29 @@ +import { isBezierDefinition } from 'motion-utils'; +import { supportsLinearEasing } from '../../../utils/supports/linear-easing.mjs'; +import { generateLinearEasing } from '../utils/linear.mjs'; +import { cubicBezierAsString } from './cubic-bezier.mjs'; +import { supportedWaapiEasing } from './supported.mjs'; + +function mapEasingToNativeEasing(easing, duration) { + if (!easing) { + return undefined; + } + else if (typeof easing === "function") { + return supportsLinearEasing() + ? generateLinearEasing(easing, duration) + : "ease-out"; + } + else if (isBezierDefinition(easing)) { + return cubicBezierAsString(easing); + } + else if (Array.isArray(easing)) { + return easing.map((segmentEasing) => mapEasingToNativeEasing(segmentEasing, duration) || + supportedWaapiEasing.easeOut); + } + else { + return supportedWaapiEasing[easing]; + } +} + +export { mapEasingToNativeEasing }; +//# sourceMappingURL=map-easing.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/waapi/easing/map-easing.mjs.map b/node_modules/motion-dom/dist/es/animation/waapi/easing/map-easing.mjs.map new file mode 100644 index 0000000..8a0e028 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/waapi/easing/map-easing.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"map-easing.mjs","sources":["../../../../../src/animation/waapi/easing/map-easing.ts"],"sourcesContent":["import { Easing, isBezierDefinition } from \"motion-utils\"\nimport { supportsLinearEasing } from \"../../../utils/supports/linear-easing\"\nimport { generateLinearEasing } from \"../utils/linear\"\nimport { cubicBezierAsString } from \"./cubic-bezier\"\nimport { supportedWaapiEasing } from \"./supported\"\n\nexport function mapEasingToNativeEasing(\n easing: Easing | Easing[] | undefined,\n duration: number\n): undefined | string | string[] {\n if (!easing) {\n return undefined\n } else if (typeof easing === \"function\") {\n return supportsLinearEasing()\n ? generateLinearEasing(easing, duration)\n : \"ease-out\"\n } else if (isBezierDefinition(easing)) {\n return cubicBezierAsString(easing)\n } else if (Array.isArray(easing)) {\n return easing.map(\n (segmentEasing) =>\n (mapEasingToNativeEasing(segmentEasing, duration) as string) ||\n supportedWaapiEasing.easeOut\n )\n } else {\n return supportedWaapiEasing[easing as keyof typeof supportedWaapiEasing]\n }\n}\n"],"names":[],"mappings":";;;;;;AAMM,SAAU,uBAAuB,CACnC,MAAqC,EACrC,QAAgB,EAAA;IAEhB,IAAI,CAAC,MAAM,EAAE;AACT,QAAA,OAAO,SAAS;IACpB;AAAO,SAAA,IAAI,OAAO,MAAM,KAAK,UAAU,EAAE;AACrC,QAAA,OAAO,oBAAoB;AACvB,cAAE,oBAAoB,CAAC,MAAM,EAAE,QAAQ;cACrC,UAAU;IACpB;AAAO,SAAA,IAAI,kBAAkB,CAAC,MAAM,CAAC,EAAE;AACnC,QAAA,OAAO,mBAAmB,CAAC,MAAM,CAAC;IACtC;AAAO,SAAA,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;AAC9B,QAAA,OAAO,MAAM,CAAC,GAAG,CACb,CAAC,aAAa,KACT,uBAAuB,CAAC,aAAa,EAAE,QAAQ,CAAY;YAC5D,oBAAoB,CAAC,OAAO,CACnC;IACL;SAAO;AACH,QAAA,OAAO,oBAAoB,CAAC,MAA2C,CAAC;IAC5E;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/waapi/easing/supported.mjs b/node_modules/motion-dom/dist/es/animation/waapi/easing/supported.mjs new file mode 100644 index 0000000..ae315b0 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/waapi/easing/supported.mjs @@ -0,0 +1,16 @@ +import { cubicBezierAsString } from './cubic-bezier.mjs'; + +const supportedWaapiEasing = { + linear: "linear", + ease: "ease", + easeIn: "ease-in", + easeOut: "ease-out", + easeInOut: "ease-in-out", + circIn: /*@__PURE__*/ cubicBezierAsString([0, 0.65, 0.55, 1]), + circOut: /*@__PURE__*/ cubicBezierAsString([0.55, 0, 1, 0.45]), + backIn: /*@__PURE__*/ cubicBezierAsString([0.31, 0.01, 0.66, -0.59]), + backOut: /*@__PURE__*/ cubicBezierAsString([0.33, 1.53, 0.69, 0.99]), +}; + +export { supportedWaapiEasing }; +//# sourceMappingURL=supported.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/waapi/easing/supported.mjs.map b/node_modules/motion-dom/dist/es/animation/waapi/easing/supported.mjs.map new file mode 100644 index 0000000..686bcd7 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/waapi/easing/supported.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"supported.mjs","sources":["../../../../../src/animation/waapi/easing/supported.ts"],"sourcesContent":["import { cubicBezierAsString } from \"./cubic-bezier\"\n\nexport const supportedWaapiEasing = {\n linear: \"linear\",\n ease: \"ease\",\n easeIn: \"ease-in\",\n easeOut: \"ease-out\",\n easeInOut: \"ease-in-out\",\n circIn: /*@__PURE__*/ cubicBezierAsString([0, 0.65, 0.55, 1]),\n circOut: /*@__PURE__*/ cubicBezierAsString([0.55, 0, 1, 0.45]),\n backIn: /*@__PURE__*/ cubicBezierAsString([0.31, 0.01, 0.66, -0.59]),\n backOut: /*@__PURE__*/ cubicBezierAsString([0.33, 1.53, 0.69, 0.99]),\n}\n"],"names":[],"mappings":";;AAEO,MAAM,oBAAoB,GAAG;AAChC,IAAA,MAAM,EAAE,QAAQ;AAChB,IAAA,IAAI,EAAE,MAAM;AACZ,IAAA,MAAM,EAAE,SAAS;AACjB,IAAA,OAAO,EAAE,UAAU;AACnB,IAAA,SAAS,EAAE,aAAa;AACxB,IAAA,MAAM,gBAAgB,mBAAmB,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AAC7D,IAAA,OAAO,gBAAgB,mBAAmB,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC;AAC9D,IAAA,MAAM,gBAAgB,mBAAmB,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;AACpE,IAAA,OAAO,gBAAgB,mBAAmB,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/waapi/start-waapi-animation.mjs b/node_modules/motion-dom/dist/es/animation/waapi/start-waapi-animation.mjs new file mode 100644 index 0000000..8f46e1b --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/waapi/start-waapi-animation.mjs @@ -0,0 +1,29 @@ +import { mapEasingToNativeEasing } from './easing/map-easing.mjs'; + +function startWaapiAnimation(element, valueName, keyframes, { delay = 0, duration = 300, repeat = 0, repeatType = "loop", ease = "easeOut", times, } = {}, pseudoElement = undefined) { + const keyframeOptions = { + [valueName]: keyframes, + }; + if (times) + keyframeOptions.offset = times; + const easing = mapEasingToNativeEasing(ease, duration); + /** + * If this is an easing array, apply to keyframes, not animation as a whole + */ + if (Array.isArray(easing)) + keyframeOptions.easing = easing; + const options = { + delay, + duration, + easing: !Array.isArray(easing) ? easing : "linear", + fill: "both", + iterations: repeat + 1, + direction: repeatType === "reverse" ? "alternate" : "normal", + }; + if (pseudoElement) + options.pseudoElement = pseudoElement; + return element.animate(keyframeOptions, options); +} + +export { startWaapiAnimation }; +//# sourceMappingURL=start-waapi-animation.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/waapi/start-waapi-animation.mjs.map b/node_modules/motion-dom/dist/es/animation/waapi/start-waapi-animation.mjs.map new file mode 100644 index 0000000..22d6d49 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/waapi/start-waapi-animation.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"start-waapi-animation.mjs","sources":["../../../../src/animation/waapi/start-waapi-animation.ts"],"sourcesContent":["import { ValueKeyframesDefinition, ValueTransition } from \"../types\"\nimport { mapEasingToNativeEasing } from \"./easing/map-easing\"\n\nexport function startWaapiAnimation(\n element: Element,\n valueName: string,\n keyframes: ValueKeyframesDefinition,\n {\n delay = 0,\n duration = 300,\n repeat = 0,\n repeatType = \"loop\",\n ease = \"easeOut\",\n times,\n }: ValueTransition = {},\n pseudoElement: string | undefined = undefined\n) {\n const keyframeOptions: PropertyIndexedKeyframes = {\n [valueName]: keyframes as string[],\n }\n if (times) keyframeOptions.offset = times\n\n const easing = mapEasingToNativeEasing(ease, duration)\n\n /**\n * If this is an easing array, apply to keyframes, not animation as a whole\n */\n if (Array.isArray(easing)) keyframeOptions.easing = easing\n\n const options: KeyframeAnimationOptions = {\n delay,\n duration,\n easing: !Array.isArray(easing) ? easing : \"linear\",\n fill: \"both\",\n iterations: repeat + 1,\n direction: repeatType === \"reverse\" ? \"alternate\" : \"normal\",\n }\n\n if (pseudoElement) options.pseudoElement = pseudoElement\n\n return element.animate(keyframeOptions, options)\n}\n"],"names":[],"mappings":";;AAGM,SAAU,mBAAmB,CAC/B,OAAgB,EAChB,SAAiB,EACjB,SAAmC,EACnC,EACI,KAAK,GAAG,CAAC,EACT,QAAQ,GAAG,GAAG,EACd,MAAM,GAAG,CAAC,EACV,UAAU,GAAG,MAAM,EACnB,IAAI,GAAG,SAAS,EAChB,KAAK,GAAA,GACY,EAAE,EACvB,gBAAoC,SAAS,EAAA;AAE7C,IAAA,MAAM,eAAe,GAA6B;QAC9C,CAAC,SAAS,GAAG,SAAqB;KACrC;AACD,IAAA,IAAI,KAAK;AAAE,QAAA,eAAe,CAAC,MAAM,GAAG,KAAK;IAEzC,MAAM,MAAM,GAAG,uBAAuB,CAAC,IAAI,EAAE,QAAQ,CAAC;AAEtD;;AAEG;AACH,IAAA,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;AAAE,QAAA,eAAe,CAAC,MAAM,GAAG,MAAM;AAE1D,IAAA,MAAM,OAAO,GAA6B;QACtC,KAAK;QACL,QAAQ;AACR,QAAA,MAAM,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,GAAG,QAAQ;AAClD,QAAA,IAAI,EAAE,MAAM;QACZ,UAAU,EAAE,MAAM,GAAG,CAAC;QACtB,SAAS,EAAE,UAAU,KAAK,SAAS,GAAG,WAAW,GAAG,QAAQ;KAC/D;AAED,IAAA,IAAI,aAAa;AAAE,QAAA,OAAO,CAAC,aAAa,GAAG,aAAa;IAExD,OAAO,OAAO,CAAC,OAAO,CAAC,eAAe,EAAE,OAAO,CAAC;AACpD;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/waapi/supports/partial-keyframes.mjs b/node_modules/motion-dom/dist/es/animation/waapi/supports/partial-keyframes.mjs new file mode 100644 index 0000000..8250ebb --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/waapi/supports/partial-keyframes.mjs @@ -0,0 +1,14 @@ +import { memo } from 'motion-utils'; + +const supportsPartialKeyframes = /*@__PURE__*/ memo(() => { + try { + document.createElement("div").animate({ opacity: [1] }); + } + catch (e) { + return false; + } + return true; +}); + +export { supportsPartialKeyframes }; +//# sourceMappingURL=partial-keyframes.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/waapi/supports/partial-keyframes.mjs.map b/node_modules/motion-dom/dist/es/animation/waapi/supports/partial-keyframes.mjs.map new file mode 100644 index 0000000..f345259 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/waapi/supports/partial-keyframes.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"partial-keyframes.mjs","sources":["../../../../../src/animation/waapi/supports/partial-keyframes.ts"],"sourcesContent":["import { memo } from \"motion-utils\"\n\nexport const supportsPartialKeyframes = /*@__PURE__*/ memo(() => {\n try {\n document.createElement(\"div\").animate({ opacity: [1] })\n } catch (e) {\n return false\n }\n return true\n})\n"],"names":[],"mappings":";;MAEa,wBAAwB,iBAAiB,IAAI,CAAC,MAAK;AAC5D,IAAA,IAAI;AACA,QAAA,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAC3D;IAAE,OAAO,CAAC,EAAE;AACR,QAAA,OAAO,KAAK;IAChB;AACA,IAAA,OAAO,IAAI;AACf,CAAC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/waapi/supports/waapi.mjs b/node_modules/motion-dom/dist/es/animation/waapi/supports/waapi.mjs new file mode 100644 index 0000000..65c5bcc --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/waapi/supports/waapi.mjs @@ -0,0 +1,55 @@ +import { memo } from 'motion-utils'; +import { acceleratedValues } from '../utils/accelerated-values.mjs'; +import { hasBrowserOnlyColors } from '../utils/is-browser-color.mjs'; + +const colorProperties = new Set([ + "color", + "backgroundColor", + "outlineColor", + "fill", + "stroke", + "borderColor", + "borderTopColor", + "borderRightColor", + "borderBottomColor", + "borderLeftColor", +]); +const supportsWaapi = /*@__PURE__*/ memo(() => Object.hasOwnProperty.call(Element.prototype, "animate")); +function supportsBrowserAnimation(options) { + const { motionValue, name, repeatDelay, repeatType, damping, type, keyframes, } = options; + const subject = motionValue?.owner?.current; + /** + * We use instanceof checks instead of isHTMLElement()/isSVGElement() + * because we explicitly **don't** want elements in different timing + * contexts (i.e. popups) to be accelerated, as it's not possible to sync + * these animations properly with those driven from the main window + * frameloop. + */ + if (!(subject instanceof HTMLElement) && + !(subject instanceof SVGElement)) { + return false; + } + const { onUpdate, transformTemplate } = motionValue.owner.getProps(); + return (supportsWaapi() && + name && + /** + * Force WAAPI for color properties with browser-only color formats + * (oklch, oklab, lab, lch, etc.) that the JS animation path can't parse. + */ + (acceleratedValues.has(name) || + (colorProperties.has(name) && + hasBrowserOnlyColors(keyframes))) && + (name !== "transform" || !transformTemplate) && + /** + * If we're outputting values to onUpdate then we can't use WAAPI as there's + * no way to read the value from WAAPI every frame. + */ + !onUpdate && + !repeatDelay && + repeatType !== "mirror" && + damping !== 0 && + type !== "inertia"); +} + +export { supportsBrowserAnimation }; +//# sourceMappingURL=waapi.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/waapi/supports/waapi.mjs.map b/node_modules/motion-dom/dist/es/animation/waapi/supports/waapi.mjs.map new file mode 100644 index 0000000..7faffb7 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/waapi/supports/waapi.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"waapi.mjs","sources":["../../../../../src/animation/waapi/supports/waapi.ts"],"sourcesContent":["import { memo } from \"motion-utils\"\nimport {\n AnyResolvedKeyframe,\n ValueAnimationOptionsWithRenderContext,\n} from \"../../types\"\nimport { acceleratedValues } from \"../utils/accelerated-values\"\nimport { hasBrowserOnlyColors } from \"../utils/is-browser-color\"\n\nconst colorProperties = new Set([\n \"color\",\n \"backgroundColor\",\n \"outlineColor\",\n \"fill\",\n \"stroke\",\n \"borderColor\",\n \"borderTopColor\",\n \"borderRightColor\",\n \"borderBottomColor\",\n \"borderLeftColor\",\n])\n\nconst supportsWaapi = /*@__PURE__*/ memo(() =>\n Object.hasOwnProperty.call(Element.prototype, \"animate\")\n)\n\nexport function supportsBrowserAnimation(\n options: ValueAnimationOptionsWithRenderContext\n) {\n const {\n motionValue,\n name,\n repeatDelay,\n repeatType,\n damping,\n type,\n keyframes,\n } = options\n\n const subject = motionValue?.owner?.current\n\n /**\n * We use instanceof checks instead of isHTMLElement()/isSVGElement()\n * because we explicitly **don't** want elements in different timing\n * contexts (i.e. popups) to be accelerated, as it's not possible to sync\n * these animations properly with those driven from the main window\n * frameloop.\n */\n if (\n !(subject instanceof HTMLElement) &&\n !(subject instanceof SVGElement)\n ) {\n return false\n }\n\n const { onUpdate, transformTemplate } = motionValue!.owner!.getProps()\n\n return (\n supportsWaapi() &&\n name &&\n /**\n * Force WAAPI for color properties with browser-only color formats\n * (oklch, oklab, lab, lch, etc.) that the JS animation path can't parse.\n */\n (acceleratedValues.has(name) ||\n (colorProperties.has(name) &&\n hasBrowserOnlyColors(keyframes))) &&\n (name !== \"transform\" || !transformTemplate) &&\n /**\n * If we're outputting values to onUpdate then we can't use WAAPI as there's\n * no way to read the value from WAAPI every frame.\n */\n !onUpdate &&\n !repeatDelay &&\n repeatType !== \"mirror\" &&\n damping !== 0 &&\n type !== \"inertia\"\n )\n}\n"],"names":[],"mappings":";;;;AAQA,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC;IAC5B,OAAO;IACP,iBAAiB;IACjB,cAAc;IACd,MAAM;IACN,QAAQ;IACR,aAAa;IACb,gBAAgB;IAChB,kBAAkB;IAClB,mBAAmB;IACnB,iBAAiB;AACpB,CAAA,CAAC;AAEF,MAAM,aAAa,iBAAiB,IAAI,CAAC,MACrC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,CAC3D;AAEK,SAAU,wBAAwB,CACpC,OAAkD,EAAA;AAElD,IAAA,MAAM,EACF,WAAW,EACX,IAAI,EACJ,WAAW,EACX,UAAU,EACV,OAAO,EACP,IAAI,EACJ,SAAS,GACZ,GAAG,OAAO;AAEX,IAAA,MAAM,OAAO,GAAG,WAAW,EAAE,KAAK,EAAE,OAAO;AAE3C;;;;;;AAMG;AACH,IAAA,IACI,EAAE,OAAO,YAAY,WAAW,CAAC;AACjC,QAAA,EAAE,OAAO,YAAY,UAAU,CAAC,EAClC;AACE,QAAA,OAAO,KAAK;IAChB;AAEA,IAAA,MAAM,EAAE,QAAQ,EAAE,iBAAiB,EAAE,GAAG,WAAY,CAAC,KAAM,CAAC,QAAQ,EAAE;IAEtE,QACI,aAAa,EAAE;QACf,IAAI;AACJ;;;AAGG;AACH,SAAC,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC;AACxB,aAAC,eAAe,CAAC,GAAG,CAAC,IAAI,CAAC;AACtB,gBAAA,oBAAoB,CAAC,SAAS,CAAC,CAAC,CAAC;AACzC,SAAC,IAAI,KAAK,WAAW,IAAI,CAAC,iBAAiB,CAAC;AAC5C;;;AAGG;AACH,QAAA,CAAC,QAAQ;AACT,QAAA,CAAC,WAAW;AACZ,QAAA,UAAU,KAAK,QAAQ;AACvB,QAAA,OAAO,KAAK,CAAC;QACb,IAAI,KAAK,SAAS;AAE1B;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/waapi/utils/accelerated-values.mjs b/node_modules/motion-dom/dist/es/animation/waapi/utils/accelerated-values.mjs new file mode 100644 index 0000000..37c36f1 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/waapi/utils/accelerated-values.mjs @@ -0,0 +1,13 @@ +/** + * A list of values that can be hardware-accelerated. + */ +const acceleratedValues = new Set([ + "opacity", + "clipPath", + "filter", + "transform", + "backgroundColor", +]); + +export { acceleratedValues }; +//# sourceMappingURL=accelerated-values.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/waapi/utils/accelerated-values.mjs.map b/node_modules/motion-dom/dist/es/animation/waapi/utils/accelerated-values.mjs.map new file mode 100644 index 0000000..46b6d51 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/waapi/utils/accelerated-values.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"accelerated-values.mjs","sources":["../../../../../src/animation/waapi/utils/accelerated-values.ts"],"sourcesContent":["/**\n * A list of values that can be hardware-accelerated.\n */\nexport const acceleratedValues = new Set([\n \"opacity\",\n \"clipPath\",\n \"filter\",\n \"transform\",\n \"backgroundColor\",\n])\n"],"names":[],"mappings":"AAAA;;AAEG;AACI,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAS;IAC7C,SAAS;IACT,UAAU;IACV,QAAQ;IACR,WAAW;IACX,iBAAiB;AACpB,CAAA;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/waapi/utils/apply-generator.mjs b/node_modules/motion-dom/dist/es/animation/waapi/utils/apply-generator.mjs new file mode 100644 index 0000000..6a828d7 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/waapi/utils/apply-generator.mjs @@ -0,0 +1,16 @@ +import { supportsLinearEasing } from '../../../utils/supports/linear-easing.mjs'; +import { isGenerator } from '../../generators/utils/is-generator.mjs'; + +function applyGeneratorOptions({ type, ...options }) { + if (isGenerator(type) && supportsLinearEasing()) { + return type.applyToOptions(options); + } + else { + options.duration ?? (options.duration = 300); + options.ease ?? (options.ease = "easeOut"); + } + return options; +} + +export { applyGeneratorOptions }; +//# sourceMappingURL=apply-generator.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/waapi/utils/apply-generator.mjs.map b/node_modules/motion-dom/dist/es/animation/waapi/utils/apply-generator.mjs.map new file mode 100644 index 0000000..27221ed --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/waapi/utils/apply-generator.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"apply-generator.mjs","sources":["../../../../../src/animation/waapi/utils/apply-generator.ts"],"sourcesContent":["import { ValueTransition } from \"../../../animation/types\"\nimport { supportsLinearEasing } from \"../../../utils/supports/linear-easing\"\nimport { isGenerator } from \"../../generators/utils/is-generator\"\n\nexport function applyGeneratorOptions({\n type,\n ...options\n}: ValueTransition): ValueTransition {\n if (isGenerator(type) && supportsLinearEasing()) {\n return type.applyToOptions!(options)\n } else {\n options.duration ??= 300\n options.ease ??= \"easeOut\"\n }\n\n return options\n}\n"],"names":[],"mappings":";;;AAIM,SAAU,qBAAqB,CAAC,EAClC,IAAI,EACJ,GAAG,OAAO,EACI,EAAA;IACd,IAAI,WAAW,CAAC,IAAI,CAAC,IAAI,oBAAoB,EAAE,EAAE;AAC7C,QAAA,OAAO,IAAI,CAAC,cAAe,CAAC,OAAO,CAAC;IACxC;SAAO;QACH,OAAO,CAAC,QAAQ,KAAhB,OAAO,CAAC,QAAQ,GAAK,GAAG,CAAA;QACxB,OAAO,CAAC,IAAI,KAAZ,OAAO,CAAC,IAAI,GAAK,SAAS,CAAA;IAC9B;AAEA,IAAA,OAAO,OAAO;AAClB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/waapi/utils/is-browser-color.mjs b/node_modules/motion-dom/dist/es/animation/waapi/utils/is-browser-color.mjs new file mode 100644 index 0000000..fa9eca8 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/waapi/utils/is-browser-color.mjs @@ -0,0 +1,13 @@ +const browserColorFunctions = /^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/; +function hasBrowserOnlyColors(keyframes) { + for (let i = 0; i < keyframes.length; i++) { + if (typeof keyframes[i] === "string" && + browserColorFunctions.test(keyframes[i])) { + return true; + } + } + return false; +} + +export { hasBrowserOnlyColors }; +//# sourceMappingURL=is-browser-color.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/waapi/utils/is-browser-color.mjs.map b/node_modules/motion-dom/dist/es/animation/waapi/utils/is-browser-color.mjs.map new file mode 100644 index 0000000..d54d58e --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/waapi/utils/is-browser-color.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"is-browser-color.mjs","sources":["../../../../../src/animation/waapi/utils/is-browser-color.ts"],"sourcesContent":["const browserColorFunctions =\n /^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\\(/\n\nexport function hasBrowserOnlyColors(keyframes: any[]): boolean {\n for (let i = 0; i < keyframes.length; i++) {\n if (\n typeof keyframes[i] === \"string\" &&\n browserColorFunctions.test(keyframes[i])\n ) {\n return true\n }\n }\n return false\n}\n"],"names":[],"mappings":"AAAA,MAAM,qBAAqB,GACvB,uDAAuD;AAErD,SAAU,oBAAoB,CAAC,SAAgB,EAAA;AACjD,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AACvC,QAAA,IACI,OAAO,SAAS,CAAC,CAAC,CAAC,KAAK,QAAQ;YAChC,qBAAqB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAC1C;AACE,YAAA,OAAO,IAAI;QACf;IACJ;AACA,IAAA,OAAO,KAAK;AAChB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/waapi/utils/linear.mjs b/node_modules/motion-dom/dist/es/animation/waapi/utils/linear.mjs new file mode 100644 index 0000000..7cb72e2 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/waapi/utils/linear.mjs @@ -0,0 +1,13 @@ +const generateLinearEasing = (easing, duration, // as milliseconds +resolution = 10 // as milliseconds +) => { + let points = ""; + const numPoints = Math.max(Math.round(duration / resolution), 2); + for (let i = 0; i < numPoints; i++) { + points += Math.round(easing(i / (numPoints - 1)) * 10000) / 10000 + ", "; + } + return `linear(${points.substring(0, points.length - 2)})`; +}; + +export { generateLinearEasing }; +//# sourceMappingURL=linear.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/waapi/utils/linear.mjs.map b/node_modules/motion-dom/dist/es/animation/waapi/utils/linear.mjs.map new file mode 100644 index 0000000..5de407c --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/waapi/utils/linear.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"linear.mjs","sources":["../../../../../src/animation/waapi/utils/linear.ts"],"sourcesContent":["import { EasingFunction } from \"motion-utils\"\n\nexport const generateLinearEasing = (\n easing: EasingFunction,\n duration: number, // as milliseconds\n resolution: number = 10 // as milliseconds\n): string => {\n let points = \"\"\n const numPoints = Math.max(Math.round(duration / resolution), 2)\n\n for (let i = 0; i < numPoints; i++) {\n points += Math.round(easing(i / (numPoints - 1)) * 10000) / 10000 + \", \"\n }\n\n return `linear(${points.substring(0, points.length - 2)})`\n}\n"],"names":[],"mappings":"MAEa,oBAAoB,GAAG,CAChC,MAAsB,EACtB,QAAgB;AAChB,UAAA,GAAqB,EAAE;KACf;IACR,IAAI,MAAM,GAAG,EAAE;AACf,IAAA,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,UAAU,CAAC,EAAE,CAAC,CAAC;AAEhE,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,EAAE,CAAC,EAAE,EAAE;QAChC,MAAM,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,SAAS,GAAG,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,GAAG,KAAK,GAAG,IAAI;IAC5E;AAEA,IAAA,OAAO,CAAA,OAAA,EAAU,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG;AAC9D;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/waapi/utils/px-values.mjs b/node_modules/motion-dom/dist/es/animation/waapi/utils/px-values.mjs new file mode 100644 index 0000000..f4282b4 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/waapi/utils/px-values.mjs @@ -0,0 +1,59 @@ +import { cornerRadiusProps } from '../../../utils/border-radius.mjs'; + +const pxValues = new Set([ + // Border props + "borderWidth", + "borderTopWidth", + "borderRightWidth", + "borderBottomWidth", + "borderLeftWidth", + "borderRadius", + ...cornerRadiusProps, + // Positioning props + "width", + "maxWidth", + "height", + "maxHeight", + "top", + "right", + "bottom", + "left", + "inset", + "insetBlock", + "insetBlockStart", + "insetBlockEnd", + "insetInline", + "insetInlineStart", + "insetInlineEnd", + // Spacing props + "padding", + "paddingTop", + "paddingRight", + "paddingBottom", + "paddingLeft", + "paddingBlock", + "paddingBlockStart", + "paddingBlockEnd", + "paddingInline", + "paddingInlineStart", + "paddingInlineEnd", + "margin", + "marginTop", + "marginRight", + "marginBottom", + "marginLeft", + "marginBlock", + "marginBlockStart", + "marginBlockEnd", + "marginInline", + "marginInlineStart", + "marginInlineEnd", + // Typography + "fontSize", + // Misc + "backgroundPositionX", + "backgroundPositionY", +]); + +export { pxValues }; +//# sourceMappingURL=px-values.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/waapi/utils/px-values.mjs.map b/node_modules/motion-dom/dist/es/animation/waapi/utils/px-values.mjs.map new file mode 100644 index 0000000..58cc8d4 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/waapi/utils/px-values.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"px-values.mjs","sources":["../../../../../src/animation/waapi/utils/px-values.ts"],"sourcesContent":["import { cornerRadiusProps } from \"../../../utils/border-radius\"\n\nexport const pxValues = new Set([\n // Border props\n \"borderWidth\",\n \"borderTopWidth\",\n \"borderRightWidth\",\n \"borderBottomWidth\",\n \"borderLeftWidth\",\n \"borderRadius\",\n ...cornerRadiusProps,\n // Positioning props\n \"width\",\n \"maxWidth\",\n \"height\",\n \"maxHeight\",\n \"top\",\n \"right\",\n \"bottom\",\n \"left\",\n \"inset\",\n \"insetBlock\",\n \"insetBlockStart\",\n \"insetBlockEnd\",\n \"insetInline\",\n \"insetInlineStart\",\n \"insetInlineEnd\",\n // Spacing props\n \"padding\",\n \"paddingTop\",\n \"paddingRight\",\n \"paddingBottom\",\n \"paddingLeft\",\n \"paddingBlock\",\n \"paddingBlockStart\",\n \"paddingBlockEnd\",\n \"paddingInline\",\n \"paddingInlineStart\",\n \"paddingInlineEnd\",\n \"margin\",\n \"marginTop\",\n \"marginRight\",\n \"marginBottom\",\n \"marginLeft\",\n \"marginBlock\",\n \"marginBlockStart\",\n \"marginBlockEnd\",\n \"marginInline\",\n \"marginInlineStart\",\n \"marginInlineEnd\",\n // Typography\n \"fontSize\",\n // Misc\n \"backgroundPositionX\",\n \"backgroundPositionY\",\n])\n"],"names":[],"mappings":";;AAEO,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC;;IAE5B,aAAa;IACb,gBAAgB;IAChB,kBAAkB;IAClB,mBAAmB;IACnB,iBAAiB;IACjB,cAAc;AACd,IAAA,GAAG,iBAAiB;;IAEpB,OAAO;IACP,UAAU;IACV,QAAQ;IACR,WAAW;IACX,KAAK;IACL,OAAO;IACP,QAAQ;IACR,MAAM;IACN,OAAO;IACP,YAAY;IACZ,iBAAiB;IACjB,eAAe;IACf,aAAa;IACb,kBAAkB;IAClB,gBAAgB;;IAEhB,SAAS;IACT,YAAY;IACZ,cAAc;IACd,eAAe;IACf,aAAa;IACb,cAAc;IACd,mBAAmB;IACnB,iBAAiB;IACjB,eAAe;IACf,oBAAoB;IACpB,kBAAkB;IAClB,QAAQ;IACR,WAAW;IACX,aAAa;IACb,cAAc;IACd,YAAY;IACZ,aAAa;IACb,kBAAkB;IAClB,gBAAgB;IAChB,cAAc;IACd,mBAAmB;IACnB,iBAAiB;;IAEjB,UAAU;;IAEV,qBAAqB;IACrB,qBAAqB;AACxB,CAAA;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/waapi/utils/unsupported-easing.mjs b/node_modules/motion-dom/dist/es/animation/waapi/utils/unsupported-easing.mjs new file mode 100644 index 0000000..b641587 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/waapi/utils/unsupported-easing.mjs @@ -0,0 +1,19 @@ +import { circInOut, backInOut, anticipate } from 'motion-utils'; + +const unsupportedEasingFunctions = { + anticipate, + backInOut, + circInOut, +}; +function isUnsupportedEase(key) { + return key in unsupportedEasingFunctions; +} +function replaceStringEasing(transition) { + if (typeof transition.ease === "string" && + isUnsupportedEase(transition.ease)) { + transition.ease = unsupportedEasingFunctions[transition.ease]; + } +} + +export { replaceStringEasing }; +//# sourceMappingURL=unsupported-easing.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/waapi/utils/unsupported-easing.mjs.map b/node_modules/motion-dom/dist/es/animation/waapi/utils/unsupported-easing.mjs.map new file mode 100644 index 0000000..de1539f --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/waapi/utils/unsupported-easing.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"unsupported-easing.mjs","sources":["../../../../../src/animation/waapi/utils/unsupported-easing.ts"],"sourcesContent":["import { anticipate, backInOut, circInOut } from \"motion-utils\"\nimport { ValueAnimationTransition } from \"../../types\"\n\nconst unsupportedEasingFunctions = {\n anticipate,\n backInOut,\n circInOut,\n}\n\nfunction isUnsupportedEase(\n key: string\n): key is keyof typeof unsupportedEasingFunctions {\n return key in unsupportedEasingFunctions\n}\n\nexport function replaceStringEasing(transition: ValueAnimationTransition) {\n if (\n typeof transition.ease === \"string\" &&\n isUnsupportedEase(transition.ease)\n ) {\n transition.ease = unsupportedEasingFunctions[transition.ease]\n }\n}\n"],"names":[],"mappings":";;AAGA,MAAM,0BAA0B,GAAG;IAC/B,UAAU;IACV,SAAS;IACT,SAAS;CACZ;AAED,SAAS,iBAAiB,CACtB,GAAW,EAAA;IAEX,OAAO,GAAG,IAAI,0BAA0B;AAC5C;AAEM,SAAU,mBAAmB,CAAC,UAAoC,EAAA;AACpE,IAAA,IACI,OAAO,UAAU,CAAC,IAAI,KAAK,QAAQ;AACnC,QAAA,iBAAiB,CAAC,UAAU,CAAC,IAAI,CAAC,EACpC;QACE,UAAU,CAAC,IAAI,GAAG,0BAA0B,CAAC,UAAU,CAAC,IAAI,CAAC;IACjE;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/effects/MotionValueState.mjs b/node_modules/motion-dom/dist/es/effects/MotionValueState.mjs new file mode 100644 index 0000000..908922d --- /dev/null +++ b/node_modules/motion-dom/dist/es/effects/MotionValueState.mjs @@ -0,0 +1,43 @@ +import { frame, cancelFrame } from '../frameloop/frame.mjs'; +import { numberValueTypes } from '../value/types/maps/number.mjs'; +import { getValueAsType } from '../value/types/utils/get-as-type.mjs'; + +class MotionValueState { + constructor() { + this.latest = {}; + this.values = new Map(); + } + set(name, value, render, computed, useDefaultValueType = true) { + const existingValue = this.values.get(name); + if (existingValue) { + existingValue.onRemove(); + } + const onChange = () => { + const v = value.get(); + if (useDefaultValueType) { + this.latest[name] = getValueAsType(v, numberValueTypes[name]); + } + else { + this.latest[name] = v; + } + render && frame.render(render); + }; + onChange(); + const cancelOnChange = value.on("change", onChange); + computed && value.addDependent(computed); + const remove = () => { + cancelOnChange(); + render && cancelFrame(render); + this.values.delete(name); + computed && value.removeDependent(computed); + }; + this.values.set(name, { value, onRemove: remove }); + return remove; + } + get(name) { + return this.values.get(name)?.value; + } +} + +export { MotionValueState }; +//# sourceMappingURL=MotionValueState.mjs.map diff --git a/node_modules/motion-dom/dist/es/effects/MotionValueState.mjs.map b/node_modules/motion-dom/dist/es/effects/MotionValueState.mjs.map new file mode 100644 index 0000000..c59b390 --- /dev/null +++ b/node_modules/motion-dom/dist/es/effects/MotionValueState.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"MotionValueState.mjs","sources":["../../../src/effects/MotionValueState.ts"],"sourcesContent":["import { AnyResolvedKeyframe } from \"../animation/types\"\nimport { cancelFrame, frame } from \"../frameloop/frame\"\nimport { MotionValue } from \"../value\"\nimport { numberValueTypes } from \"../value/types/maps/number\"\nimport { getValueAsType } from \"../value/types/utils/get-as-type\"\n\nexport class MotionValueState {\n latest: { [name: string]: AnyResolvedKeyframe } = {}\n\n private values = new Map<\n string,\n { value: MotionValue; onRemove: VoidFunction }\n >()\n\n set(\n name: string,\n value: MotionValue,\n render?: VoidFunction,\n computed?: MotionValue,\n useDefaultValueType = true\n ) {\n const existingValue = this.values.get(name)\n\n if (existingValue) {\n existingValue.onRemove()\n }\n\n const onChange = () => {\n const v = value.get()\n\n if (useDefaultValueType) {\n this.latest[name] = getValueAsType(v, numberValueTypes[name])\n } else {\n this.latest[name] = v\n }\n\n render && frame.render(render)\n }\n\n onChange()\n\n const cancelOnChange = value.on(\"change\", onChange)\n\n computed && value.addDependent(computed)\n\n const remove = () => {\n cancelOnChange()\n render && cancelFrame(render)\n this.values.delete(name)\n computed && value.removeDependent(computed)\n }\n\n this.values.set(name, { value, onRemove: remove })\n\n return remove\n }\n\n get(name: string): MotionValue | undefined {\n return this.values.get(name)?.value\n }\n}\n"],"names":[],"mappings":";;;;MAMa,gBAAgB,CAAA;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AAE,MAAM,EAAE,CAAC;AAElD,QAAA,OAAO,MAAM;IACjB;AAEA,IAAA,GAAG,CAAC,IAAY,EAAA;QACZ,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,KAAK;IACvC;AACH;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/effects/attr/index.mjs b/node_modules/motion-dom/dist/es/effects/attr/index.mjs new file mode 100644 index 0000000..08067fd --- /dev/null +++ b/node_modules/motion-dom/dist/es/effects/attr/index.mjs @@ -0,0 +1,42 @@ +import { camelToDash } from '../../render/dom/utils/camel-to-dash.mjs'; +import { createSelectorEffect } from '../utils/create-dom-effect.mjs'; +import { createEffect } from '../utils/create-effect.mjs'; + +function canSetAsProperty(element, name) { + if (!(name in element)) + return false; + const descriptor = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(element), name) || + Object.getOwnPropertyDescriptor(element, name); + // Check if it has a setter + return descriptor && typeof descriptor.set === "function"; +} +const addAttrValue = (element, state, key, value) => { + const isProp = canSetAsProperty(element, key); + const name = isProp + ? key + : key.startsWith("data") || key.startsWith("aria") + ? camelToDash(key) + : key; + /** + * Set attribute directly via property if available + */ + const render = isProp + ? () => { + element[name] = state.latest[key]; + } + : () => { + const v = state.latest[key]; + if (v === null || v === undefined) { + element.removeAttribute(name); + } + else { + element.setAttribute(name, String(v)); + } + }; + return state.set(key, value, render); +}; +const attrEffect = /*@__PURE__*/ createSelectorEffect( +/*@__PURE__*/ createEffect(addAttrValue)); + +export { addAttrValue, attrEffect }; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/motion-dom/dist/es/effects/attr/index.mjs.map b/node_modules/motion-dom/dist/es/effects/attr/index.mjs.map new file mode 100644 index 0000000..da48db2 --- /dev/null +++ b/node_modules/motion-dom/dist/es/effects/attr/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../../../../src/effects/attr/index.ts"],"sourcesContent":["import { camelToDash } from \"../../render/dom/utils/camel-to-dash\"\nimport { MotionValue } from \"../../value\"\nimport { MotionValueState } from \"../MotionValueState\"\nimport { createSelectorEffect } from \"../utils/create-dom-effect\"\nimport { createEffect } from \"../utils/create-effect\"\n\nfunction canSetAsProperty(element: HTMLElement | SVGElement, name: string) {\n if (!(name in element)) return false\n\n const descriptor =\n Object.getOwnPropertyDescriptor(Object.getPrototypeOf(element), name) ||\n Object.getOwnPropertyDescriptor(element, name)\n\n // Check if it has a setter\n return descriptor && typeof descriptor.set === \"function\"\n}\n\nexport const addAttrValue = (\n element: HTMLElement | SVGElement,\n state: MotionValueState,\n key: string,\n value: MotionValue\n) => {\n const isProp = canSetAsProperty(element, key)\n const name = isProp\n ? key\n : key.startsWith(\"data\") || key.startsWith(\"aria\")\n ? camelToDash(key)\n : key\n\n /**\n * Set attribute directly via property if available\n */\n const render = isProp\n ? () => {\n ;(element as any)[name] = state.latest[key]\n }\n : () => {\n const v = state.latest[key]\n if (v === null || v === undefined) {\n element.removeAttribute(name)\n } else {\n element.setAttribute(name, String(v))\n }\n }\n\n return state.set(key, value, render)\n}\n\nexport const attrEffect = /*@__PURE__*/ createSelectorEffect(\n /*@__PURE__*/ createEffect(addAttrValue)\n)\n"],"names":[],"mappings":";;;;AAMA,SAAS,gBAAgB,CAAC,OAAiC,EAAE,IAAY,EAAA;AACrE,IAAA,IAAI,EAAE,IAAI,IAAI,OAAO,CAAC;AAAE,QAAA,OAAO,KAAK;AAEpC,IAAA,MAAM,UAAU,GACZ,MAAM,CAAC,wBAAwB,CAAC,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC;AACrE,QAAA,MAAM,CAAC,wBAAwB,CAAC,OAAO,EAAE,IAAI,CAAC;;IAGlD,OAAO,UAAU,IAAI,OAAO,UAAU,CAAC,GAAG,KAAK,UAAU;AAC7D;AAEO,MAAM,YAAY,GAAG,CACxB,OAAiC,EACjC,KAAuB,EACvB,GAAW,EACX,KAAkB,KAClB;IACA,MAAM,MAAM,GAAG,gBAAgB,CAAC,OAAO,EAAE,GAAG,CAAC;IAC7C,MAAM,IAAI,GAAG;AACT,UAAE;AACF,UAAE,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,UAAU,CAAC,MAAM;AACjD,cAAE,WAAW,CAAC,GAAG;cACf,GAAG;AAET;;AAEG;IACH,MAAM,MAAM,GAAG;UACT,MAAK;YACC,OAAe,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC;QAC/C;UACA,MAAK;YACD,MAAM,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC;YAC3B,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,SAAS,EAAE;AAC/B,gBAAA,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC;YACjC;iBAAO;gBACH,OAAO,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;YACzC;AACJ,QAAA,CAAC;IAEP,OAAO,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,EAAE,MAAM,CAAC;AACxC;AAEO,MAAM,UAAU,iBAAiB,oBAAoB;AACxD,cAAc,YAAY,CAAC,YAAY,CAAC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/effects/prop/index.mjs b/node_modules/motion-dom/dist/es/effects/prop/index.mjs new file mode 100644 index 0000000..2b5e988 --- /dev/null +++ b/node_modules/motion-dom/dist/es/effects/prop/index.mjs @@ -0,0 +1,10 @@ +import { createEffect } from '../utils/create-effect.mjs'; + +const propEffect = /*@__PURE__*/ createEffect((subject, state, key, value) => { + return state.set(key, value, () => { + subject[key] = state.latest[key]; + }, undefined, false); +}); + +export { propEffect }; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/motion-dom/dist/es/effects/prop/index.mjs.map b/node_modules/motion-dom/dist/es/effects/prop/index.mjs.map new file mode 100644 index 0000000..b1705c0 --- /dev/null +++ b/node_modules/motion-dom/dist/es/effects/prop/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../../../../src/effects/prop/index.ts"],"sourcesContent":["import { MotionValue } from \"../../value\"\nimport { MotionValueState } from \"../MotionValueState\"\nimport { createEffect } from \"../utils/create-effect\"\n\nexport const propEffect = /*@__PURE__*/ createEffect(\n (\n subject: { [key: string]: any },\n state: MotionValueState,\n key: string,\n value: MotionValue\n ) => {\n return state.set(\n key,\n value,\n () => {\n subject[key] = state.latest[key]\n },\n undefined,\n false\n )\n }\n)\n"],"names":[],"mappings":";;AAIO,MAAM,UAAU,iBAAiB,YAAY,CAChD,CACI,OAA+B,EAC/B,KAAuB,EACvB,GAAW,EACX,KAAkB,KAClB;IACA,OAAO,KAAK,CAAC,GAAG,CACZ,GAAG,EACH,KAAK,EACL,MAAK;QACD,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC;AACpC,IAAA,CAAC,EACD,SAAS,EACT,KAAK,CACR;AACL,CAAC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/effects/style/index.mjs b/node_modules/motion-dom/dist/es/effects/style/index.mjs new file mode 100644 index 0000000..a7e290c --- /dev/null +++ b/node_modules/motion-dom/dist/es/effects/style/index.mjs @@ -0,0 +1,53 @@ +import { isCSSVar } from '../../render/dom/is-css-var.mjs'; +import { transformProps } from '../../render/utils/keys-transform.mjs'; +import { isHTMLElement } from '../../utils/is-html-element.mjs'; +import { MotionValue } from '../../value/index.mjs'; +import { createSelectorEffect } from '../utils/create-dom-effect.mjs'; +import { createEffect } from '../utils/create-effect.mjs'; +import { buildTransform } from './transform.mjs'; + +const originProps = new Set(["originX", "originY", "originZ"]); +const addStyleValue = (element, state, key, value) => { + let render = undefined; + let computed = undefined; + if (transformProps.has(key)) { + if (!state.get("transform")) { + // If this is an HTML element, we need to set the transform-box to fill-box + // to normalise the transform relative to the element's bounding box + if (!isHTMLElement(element) && !state.get("transformBox")) { + addStyleValue(element, state, "transformBox", new MotionValue("fill-box")); + } + state.set("transform", new MotionValue("none"), () => { + element.style.transform = buildTransform(state); + }); + } + computed = state.get("transform"); + } + else if (originProps.has(key)) { + if (!state.get("transformOrigin")) { + state.set("transformOrigin", new MotionValue(""), () => { + const originX = state.latest.originX ?? "50%"; + const originY = state.latest.originY ?? "50%"; + const originZ = state.latest.originZ ?? 0; + element.style.transformOrigin = `${originX} ${originY} ${originZ}`; + }); + } + computed = state.get("transformOrigin"); + } + else if (isCSSVar(key)) { + render = () => { + element.style.setProperty(key, state.latest[key]); + }; + } + else { + render = () => { + element.style[key] = state.latest[key]; + }; + } + return state.set(key, value, render, computed); +}; +const styleEffect = /*@__PURE__*/ createSelectorEffect( +/*@__PURE__*/ createEffect(addStyleValue)); + +export { addStyleValue, styleEffect }; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/motion-dom/dist/es/effects/style/index.mjs.map b/node_modules/motion-dom/dist/es/effects/style/index.mjs.map new file mode 100644 index 0000000..7e53ba0 --- /dev/null +++ b/node_modules/motion-dom/dist/es/effects/style/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../../../../src/effects/style/index.ts"],"sourcesContent":["import { isCSSVar } from \"../../render/dom/is-css-var\"\nimport { transformProps } from \"../../render/utils/keys-transform\"\nimport { isHTMLElement } from \"../../utils/is-html-element\"\nimport { MotionValue } from \"../../value\"\nimport { MotionValueState } from \"../MotionValueState\"\nimport { createSelectorEffect } from \"../utils/create-dom-effect\"\nimport { createEffect } from \"../utils/create-effect\"\nimport { buildTransform } from \"./transform\"\n\nconst originProps = new Set([\"originX\", \"originY\", \"originZ\"])\n\nexport const addStyleValue = (\n element: HTMLElement | SVGElement,\n state: MotionValueState,\n key: string,\n value: MotionValue\n) => {\n let render: VoidFunction | undefined = undefined\n let computed: MotionValue | undefined = undefined\n\n if (transformProps.has(key)) {\n if (!state.get(\"transform\")) {\n // If this is an HTML element, we need to set the transform-box to fill-box\n // to normalise the transform relative to the element's bounding box\n if (!isHTMLElement(element) && !state.get(\"transformBox\")) {\n addStyleValue(\n element,\n state,\n \"transformBox\",\n new MotionValue(\"fill-box\")\n )\n }\n\n state.set(\"transform\", new MotionValue(\"none\"), () => {\n element.style.transform = buildTransform(state)\n })\n }\n\n computed = state.get(\"transform\")\n } else if (originProps.has(key)) {\n if (!state.get(\"transformOrigin\")) {\n state.set(\"transformOrigin\", new MotionValue(\"\"), () => {\n const originX = state.latest.originX ?? \"50%\"\n const originY = state.latest.originY ?? \"50%\"\n const originZ = state.latest.originZ ?? 0\n element.style.transformOrigin = `${originX} ${originY} ${originZ}`\n })\n }\n\n computed = state.get(\"transformOrigin\")\n } else if (isCSSVar(key)) {\n render = () => {\n element.style.setProperty(key, state.latest[key] as string)\n }\n } else {\n render = () => {\n element.style[key as any] = state.latest[key] as string\n }\n }\n\n return state.set(key, value, render, computed)\n}\n\nexport const styleEffect = /*@__PURE__*/ createSelectorEffect(\n /*@__PURE__*/ createEffect(addStyleValue)\n)\n"],"names":[],"mappings":";;;;;;;;AASA,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;AAEvD,MAAM,aAAa,GAAG,CACzB,OAAiC,EACjC,KAAuB,EACvB,GAAW,EACX,KAAkB,KAClB;IACA,IAAI,MAAM,GAA6B,SAAS;IAChD,IAAI,QAAQ,GAA4B,SAAS;AAEjD,IAAA,IAAI,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;QACzB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE;;;AAGzB,YAAA,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,EAAE;AACvD,gBAAA,aAAa,CACT,OAAO,EACP,KAAK,EACL,cAAc,EACd,IAAI,WAAW,CAAC,UAAU,CAAC,CAC9B;YACL;AAEA,YAAA,KAAK,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IAAA,OAAO,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC;AAClD;AAEO,MAAM,WAAW,iBAAiB,oBAAoB;AACzD,cAAc,YAAY,CAAC,aAAa,CAAC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/effects/style/transform.mjs b/node_modules/motion-dom/dist/es/effects/style/transform.mjs new file mode 100644 index 0000000..ccb5c63 --- /dev/null +++ b/node_modules/motion-dom/dist/es/effects/style/transform.mjs @@ -0,0 +1,48 @@ +import { transformPropOrder } from '../../render/utils/keys-transform.mjs'; + +const translateAlias = { + x: "translateX", + y: "translateY", + z: "translateZ", + transformPerspective: "perspective", +}; +function buildTransform(state) { + let transform = ""; + let transformIsDefault = true; + /** + * Loop over all possible transforms in order, adding the ones that + * are present to the transform string. + */ + for (let i = 0; i < transformPropOrder.length; i++) { + const key = transformPropOrder[i]; + const value = state.latest[key]; + if (value === undefined) + continue; + let valueIsDefault = true; + if (typeof value === "number") { + valueIsDefault = value === (key.startsWith("scale") ? 1 : 0); + } + else { + const parsed = parseFloat(value); + valueIsDefault = key.startsWith("scale") ? parsed === 1 : parsed === 0; + } + if (!valueIsDefault) { + transformIsDefault = false; + const transformName = translateAlias[key] || key; + transform += `${transformName}(${value}) `; + } + } + // See build-transform.ts: additive `rotate()` so user `rotate` isn't + // clobbered. Not a `transformPropOrder` slot. + const pathRotation = state.latest.pathRotation; + if (pathRotation) { + transformIsDefault = false; + transform += `rotate(${typeof pathRotation === "number" + ? `${pathRotation}deg` + : pathRotation}) `; + } + return transformIsDefault ? "none" : transform.trim(); +} + +export { buildTransform }; +//# sourceMappingURL=transform.mjs.map diff --git a/node_modules/motion-dom/dist/es/effects/style/transform.mjs.map b/node_modules/motion-dom/dist/es/effects/style/transform.mjs.map new file mode 100644 index 0000000..8553fb4 --- /dev/null +++ b/node_modules/motion-dom/dist/es/effects/style/transform.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"transform.mjs","sources":["../../../../src/effects/style/transform.ts"],"sourcesContent":["import { transformPropOrder } from \"../../render/utils/keys-transform\"\nimport { MotionValueState } from \"../MotionValueState\"\n\nconst translateAlias = {\n x: \"translateX\",\n y: \"translateY\",\n z: \"translateZ\",\n transformPerspective: \"perspective\",\n}\n\nexport function buildTransform(state: MotionValueState) {\n let transform = \"\"\n let transformIsDefault = true\n\n /**\n * Loop over all possible transforms in order, adding the ones that\n * are present to the transform string.\n */\n for (let i = 0; i < transformPropOrder.length; i++) {\n const key = transformPropOrder[i] as keyof typeof translateAlias\n const value = state.latest[key]\n\n if (value === undefined) continue\n\n let valueIsDefault = true\n if (typeof value === \"number\") {\n valueIsDefault = value === (key.startsWith(\"scale\") ? 1 : 0)\n } else {\n const parsed = parseFloat(value)\n valueIsDefault = key.startsWith(\"scale\") ? parsed === 1 : parsed === 0\n }\n\n if (!valueIsDefault) {\n transformIsDefault = false\n const transformName = translateAlias[key] || key\n transform += `${transformName}(${value}) `\n }\n }\n\n // See build-transform.ts: additive `rotate()` so user `rotate` isn't\n // clobbered. Not a `transformPropOrder` slot.\n const pathRotation = state.latest.pathRotation\n if (pathRotation) {\n transformIsDefault = false\n transform += `rotate(${\n typeof pathRotation === \"number\"\n ? `${pathRotation}deg`\n : pathRotation\n }) `\n }\n\n return transformIsDefault ? \"none\" : transform.trim()\n}\n"],"names":[],"mappings":";;AAGA,MAAM,cAAc,GAAG;AACnB,IAAA,CAAC,EAAE,YAAY;AACf,IAAA,CAAC,EAAE,YAAY;AACf,IAAA,CAAC,EAAE,YAAY;AACf,IAAA,oBAAoB,EAAE,aAAa;CACtC;AAEK,SAAU,cAAc,CAAC,KAAuB,EAAA;IAClD,IAAI,SAAS,GAAG,EAAE;IAClB,IAAI,kBAAkB,GAAG,IAAI;AAE7B;;;AAGG;AACH,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,kBAAkB,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AAChD,QAAA,MAAM,GAAG,GAAG,kBAAkB,CAAC,CAAC,CAAgC;QAChE,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC;QAE/B,IAAI,KAAK,KAAK,SAAS;YAAE;QAEzB,IAAI,cAAc,GAAG,IAAI;AACzB,QAAA,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AAC3B,YAAA,cAAc,GAAG,KAAK,MAAM,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAChE;aAAO;AACH,YAAA,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK,CAAC;AAChC,YAAA,cAAc,GAAG,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,MAAM,KAAK,CAAC,GAAG,MAAM,KAAK,CAAC;QAC1E;QAEA,IAAI,CAAC,cAAc,EAAE;YACjB,kBAAkB,GAAG,KAAK;YAC1B,MAAM,aAAa,GAAG,cAAc,CAAC,GAAG,CAAC,IAAI,GAAG;AAChD,YAAA,SAAS,IAAI,CAAA,EAAG,aAAa,CAAA,CAAA,EAAI,KAAK,IAAI;QAC9C;IACJ;;;AAIA,IAAA,MAAM,YAAY,GAAG,KAAK,CAAC,MAAM,CAAC,YAAY;IAC9C,IAAI,YAAY,EAAE;QACd,kBAAkB,GAAG,KAAK;AAC1B,QAAA,SAAS,IAAI,CAAA,OAAA,EACT,OAAO,YAAY,KAAK;cAClB,CAAA,EAAG,YAAY,CAAA,GAAA;cACf,YACV,CAAA,EAAA,CAAI;IACR;AAEA,IAAA,OAAO,kBAAkB,GAAG,MAAM,GAAG,SAAS,CAAC,IAAI,EAAE;AACzD;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/effects/svg/index.mjs b/node_modules/motion-dom/dist/es/effects/svg/index.mjs new file mode 100644 index 0000000..83bc656 --- /dev/null +++ b/node_modules/motion-dom/dist/es/effects/svg/index.mjs @@ -0,0 +1,45 @@ +import { MotionValue } from '../../value/index.mjs'; +import { addAttrValue } from '../attr/index.mjs'; +import { addStyleValue } from '../style/index.mjs'; +import { createSelectorEffect } from '../utils/create-dom-effect.mjs'; +import { createEffect } from '../utils/create-effect.mjs'; +import { frame } from '../../frameloop/frame.mjs'; + +function addSVGPathValue(element, state, key, value) { + frame.render(() => element.setAttribute("pathLength", "1")); + if (key === "pathOffset") { + return state.set(key, value, () => { + // Use unitless value to avoid Safari zoom bug + const offset = state.latest[key]; + element.setAttribute("stroke-dashoffset", `${-offset}`); + }); + } + else { + if (!state.get("stroke-dasharray")) { + state.set("stroke-dasharray", new MotionValue("1 1"), () => { + const { pathLength = 1, pathSpacing } = state.latest; + // Use unitless values to avoid Safari zoom bug + element.setAttribute("stroke-dasharray", `${pathLength} ${pathSpacing ?? 1 - Number(pathLength)}`); + }); + } + return state.set(key, value, undefined, state.get("stroke-dasharray")); + } +} +const addSVGValue = (element, state, key, value) => { + if (key.startsWith("path")) { + return addSVGPathValue(element, state, key, value); + } + else if (key.startsWith("attr")) { + return addAttrValue(element, state, convertAttrKey(key), value); + } + const handler = key in element.style ? addStyleValue : addAttrValue; + return handler(element, state, key, value); +}; +const svgEffect = /*@__PURE__*/ createSelectorEffect( +/*@__PURE__*/ createEffect(addSVGValue)); +function convertAttrKey(key) { + return key.replace(/^attr([A-Z])/, (_, firstChar) => firstChar.toLowerCase()); +} + +export { svgEffect }; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/motion-dom/dist/es/effects/svg/index.mjs.map b/node_modules/motion-dom/dist/es/effects/svg/index.mjs.map new file mode 100644 index 0000000..8548e1f --- /dev/null +++ b/node_modules/motion-dom/dist/es/effects/svg/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../../../../src/effects/svg/index.ts"],"sourcesContent":["import { frame } from \"../../frameloop\"\nimport { MotionValue } from \"../../value\"\nimport { addAttrValue } from \"../attr\"\nimport { MotionValueState } from \"../MotionValueState\"\nimport { addStyleValue } from \"../style\"\nimport { createSelectorEffect } from \"../utils/create-dom-effect\"\nimport { createEffect } from \"../utils/create-effect\"\n\nfunction addSVGPathValue(\n element: SVGElement,\n state: MotionValueState,\n key: string,\n value: MotionValue\n) {\n frame.render(() => element.setAttribute(\"pathLength\", \"1\"))\n\n if (key === \"pathOffset\") {\n return state.set(key, value, () => {\n // Use unitless value to avoid Safari zoom bug\n const offset = state.latest[key]\n element.setAttribute(\"stroke-dashoffset\", `${-offset}`)\n })\n } else {\n if (!state.get(\"stroke-dasharray\")) {\n state.set(\"stroke-dasharray\", new MotionValue(\"1 1\"), () => {\n const { pathLength = 1, pathSpacing } = state.latest\n\n // Use unitless values to avoid Safari zoom bug\n element.setAttribute(\n \"stroke-dasharray\",\n `${pathLength} ${pathSpacing ?? 1 - Number(pathLength)}`\n )\n })\n }\n\n return state.set(key, value, undefined, state.get(\"stroke-dasharray\"))\n }\n}\n\nconst addSVGValue = (\n element: SVGElement,\n state: MotionValueState,\n key: string,\n value: MotionValue\n) => {\n if (key.startsWith(\"path\")) {\n return addSVGPathValue(element, state, key, value)\n } else if (key.startsWith(\"attr\")) {\n return addAttrValue(element, state, convertAttrKey(key), value)\n }\n\n const handler = key in element.style ? addStyleValue : addAttrValue\n return handler(element, state, key, value)\n}\n\nexport const svgEffect = /*@__PURE__*/ createSelectorEffect(\n /*@__PURE__*/ createEffect(addSVGValue)\n)\n\nfunction convertAttrKey(key: string) {\n return key.replace(/^attr([A-Z])/, (_, firstChar) =>\n firstChar.toLowerCase()\n )\n}\n"],"names":[],"mappings":";;;;;;;AAQA,SAAS,eAAe,CACpB,OAAmB,EACnB,KAAuB,EACvB,GAAW,EACX,KAAkB,EAAA;AAElB,IAAA,KAAK,CAAC,MAAM,CAAC,MAAM,OAAO,CAAC,YAAY,CAAC,YAAY,EAAE,GAAG,CAAC,CAAC;AAE3D,IAAA,IAAI,GAAG,KAAK,YAAY,EAAE;QACtB,OAAO,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,EAAE,MAAK;;YA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KAAK,EAAE,GAAG,EAAE,KAAK,CAAC;AAC9C,CAAC;AAEM,MAAM,SAAS,iBAAiB,oBAAoB;AACvD,cAAc,YAAY,CAAC,WAAW,CAAC;AAG3C,SAAS,cAAc,CAAC,GAAW,EAAA;AAC/B,IAAA,OAAO,GAAG,CAAC,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC,EAAE,SAAS,KAC5C,SAAS,CAAC,WAAW,EAAE,CAC1B;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/effects/utils/create-dom-effect.mjs b/node_modules/motion-dom/dist/es/effects/utils/create-dom-effect.mjs new file mode 100644 index 0000000..ede6a43 --- /dev/null +++ b/node_modules/motion-dom/dist/es/effects/utils/create-dom-effect.mjs @@ -0,0 +1,19 @@ +import { resolveElements } from '../../utils/resolve-elements.mjs'; + +function createSelectorEffect(subjectEffect) { + return (subject, values) => { + const elements = resolveElements(subject); + const subscriptions = []; + for (const element of elements) { + const remove = subjectEffect(element, values); + subscriptions.push(remove); + } + return () => { + for (const remove of subscriptions) + remove(); + }; + }; +} + +export { createSelectorEffect }; +//# sourceMappingURL=create-dom-effect.mjs.map diff --git a/node_modules/motion-dom/dist/es/effects/utils/create-dom-effect.mjs.map b/node_modules/motion-dom/dist/es/effects/utils/create-dom-effect.mjs.map new file mode 100644 index 0000000..f750c00 --- /dev/null +++ b/node_modules/motion-dom/dist/es/effects/utils/create-dom-effect.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"create-dom-effect.mjs","sources":["../../../../src/effects/utils/create-dom-effect.ts"],"sourcesContent":["import {\n ElementOrSelector,\n resolveElements,\n} from \"../../utils/resolve-elements\"\nimport { MotionValue } from \"../../value\"\n\nexport function createSelectorEffect(\n subjectEffect: (\n subject: T,\n values: Record\n ) => VoidFunction\n) {\n return (\n subject: ElementOrSelector,\n values: Record\n ) => {\n const elements = resolveElements(subject)\n const subscriptions: VoidFunction[] = []\n\n for (const element of elements) {\n const remove = subjectEffect(element as T, values)\n subscriptions.push(remove)\n }\n\n return () => {\n for (const remove of subscriptions) remove()\n }\n }\n}\n"],"names":[],"mappings":";;AAMM,SAAU,oBAAoB,CAChC,aAGiB,EAAA;AAEjB,IAAA,OAAO,CACH,OAA0B,EAC1B,MAAmC,KACnC;AACA,QAAA,MAAM,QAAQ,GAAG,eAAe,CAAC,OAAO,CAAC;QACzC,MAAM,aAAa,GAAmB,EAAE;AAExC,QAAA,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE;YAC5B,MAAM,MAAM,GAAG,aAAa,CAAC,OAAY,EAAE,MAAM,CAAC;AAClD,YAAA,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC;QAC9B;AAEA,QAAA,OAAO,MAAK;YACR,KAAK,MAAM,MAAM,IAAI,aAAa;AAAE,gBAAA,MAAM,EAAE;AAChD,QAAA,CAAC;AACL,IAAA,CAAC;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/effects/utils/create-effect.mjs b/node_modules/motion-dom/dist/es/effects/utils/create-effect.mjs new file mode 100644 index 0000000..7bd4599 --- /dev/null +++ b/node_modules/motion-dom/dist/es/effects/utils/create-effect.mjs @@ -0,0 +1,22 @@ +import { MotionValueState } from '../MotionValueState.mjs'; + +function createEffect(addValue) { + const stateCache = new WeakMap(); + return (subject, values) => { + const state = stateCache.get(subject) ?? new MotionValueState(); + stateCache.set(subject, state); + const subscriptions = []; + for (const key in values) { + const value = values[key]; + const remove = addValue(subject, state, key, value); + subscriptions.push(remove); + } + return () => { + for (const cancel of subscriptions) + cancel(); + }; + }; +} + +export { createEffect }; +//# sourceMappingURL=create-effect.mjs.map diff --git a/node_modules/motion-dom/dist/es/effects/utils/create-effect.mjs.map b/node_modules/motion-dom/dist/es/effects/utils/create-effect.mjs.map new file mode 100644 index 0000000..10631da --- /dev/null +++ b/node_modules/motion-dom/dist/es/effects/utils/create-effect.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"create-effect.mjs","sources":["../../../../src/effects/utils/create-effect.ts"],"sourcesContent":["import { MotionValue } from \"../../value\"\nimport { MotionValueState } from \"../MotionValueState\"\n\nexport function createEffect(\n addValue: (\n subject: Subject,\n state: MotionValueState,\n key: string,\n value: MotionValue\n ) => VoidFunction\n) {\n const stateCache = new WeakMap()\n\n return (\n subject: Subject,\n values: Record\n ): VoidFunction => {\n const state = stateCache.get(subject) ?? new MotionValueState()\n\n stateCache.set(subject, state)\n\n const subscriptions: VoidFunction[] = []\n\n for (const key in values) {\n const value = values[key]\n const remove = addValue(subject, state, key, value)\n subscriptions.push(remove)\n }\n\n return () => {\n for (const cancel of subscriptions) cancel()\n }\n }\n}\n"],"names":[],"mappings":";;AAGM,SAAU,YAAY,CACxB,QAKiB,EAAA;AAEjB,IAAA,MAAM,UAAU,GAAG,IAAI,OAAO,EAA6B;AAE3D,IAAA,OAAO,CACH,OAAgB,EAChB,MAAmC,KACrB;AACd,QAAA,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,IAAI,gBAAgB,EAAE;AAE/D,QAAA,UAAU,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC;QAE9B,MAAM,aAAa,GAAmB,EAAE;AAExC,QAAA,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE;AACtB,YAAA,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC;AACzB,YAAA,MAAM,MAAM,GAAG,QAAQ,CAAC,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,CAAC;AACnD,YAAA,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC;QAC9B;AAEA,QAAA,OAAO,MAAK;YACR,KAAK,MAAM,MAAM,IAAI,aAAa;AAAE,gBAAA,MAAM,EAAE;AAChD,QAAA,CAAC;AACL,IAAA,CAAC;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/events/add-dom-event.mjs b/node_modules/motion-dom/dist/es/events/add-dom-event.mjs new file mode 100644 index 0000000..af9a3c7 --- /dev/null +++ b/node_modules/motion-dom/dist/es/events/add-dom-event.mjs @@ -0,0 +1,7 @@ +function addDomEvent(target, eventName, handler, options = { passive: true }) { + target.addEventListener(eventName, handler, options); + return () => target.removeEventListener(eventName, handler, options); +} + +export { addDomEvent }; +//# sourceMappingURL=add-dom-event.mjs.map diff --git a/node_modules/motion-dom/dist/es/events/add-dom-event.mjs.map b/node_modules/motion-dom/dist/es/events/add-dom-event.mjs.map new file mode 100644 index 0000000..207eadb --- /dev/null +++ b/node_modules/motion-dom/dist/es/events/add-dom-event.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"add-dom-event.mjs","sources":["../../../src/events/add-dom-event.ts"],"sourcesContent":["export function addDomEvent(\n target: EventTarget,\n eventName: string,\n handler: EventListener,\n options: AddEventListenerOptions = { passive: true }\n) {\n target.addEventListener(eventName, handler, options)\n\n return () => target.removeEventListener(eventName, handler, options)\n}\n"],"names":[],"mappings":"AAAM,SAAU,WAAW,CACvB,MAAmB,EACnB,SAAiB,EACjB,OAAsB,EACtB,OAAA,GAAmC,EAAE,OAAO,EAAE,IAAI,EAAE,EAAA;IAEpD,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC;AAEpD,IAAA,OAAO,MAAM,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC;AACxE;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/frameloop/batcher.mjs b/node_modules/motion-dom/dist/es/frameloop/batcher.mjs new file mode 100644 index 0000000..5e72a6c --- /dev/null +++ b/node_modules/motion-dom/dist/es/frameloop/batcher.mjs @@ -0,0 +1,73 @@ +import { MotionGlobalConfig } from 'motion-utils'; +import { stepsOrder } from './order.mjs'; +import { createRenderStep } from './render-step.mjs'; + +const maxElapsed = 40; +function createRenderBatcher(scheduleNextBatch, allowKeepAlive) { + let runNextFrame = false; + let useDefaultElapsed = true; + const state = { + delta: 0.0, + timestamp: 0.0, + isProcessing: false, + }; + const flagRunNextFrame = () => (runNextFrame = true); + const steps = stepsOrder.reduce((acc, key) => { + acc[key] = createRenderStep(flagRunNextFrame); + return acc; + }, {}); + const { setup, read, resolveKeyframes, preUpdate, update, preRender, render, postRender, } = steps; + const processBatch = () => { + const useManualTiming = MotionGlobalConfig.useManualTiming; + const timestamp = useManualTiming + ? state.timestamp + : performance.now(); + runNextFrame = false; + if (!useManualTiming) { + state.delta = useDefaultElapsed + ? 1000 / 60 + : Math.max(Math.min(timestamp - state.timestamp, maxElapsed), 1); + } + state.timestamp = timestamp; + state.isProcessing = true; + // Unrolled render loop for better per-frame performance + setup.process(state); + read.process(state); + resolveKeyframes.process(state); + preUpdate.process(state); + update.process(state); + preRender.process(state); + render.process(state); + postRender.process(state); + state.isProcessing = false; + if (runNextFrame && allowKeepAlive) { + useDefaultElapsed = false; + scheduleNextBatch(processBatch); + } + }; + const wake = () => { + runNextFrame = true; + useDefaultElapsed = true; + if (!state.isProcessing) { + scheduleNextBatch(processBatch); + } + }; + const schedule = stepsOrder.reduce((acc, key) => { + const step = steps[key]; + acc[key] = (process, keepAlive = false, immediate = false) => { + if (!runNextFrame) + wake(); + return step.schedule(process, keepAlive, immediate); + }; + return acc; + }, {}); + const cancel = (process) => { + for (let i = 0; i < stepsOrder.length; i++) { + steps[stepsOrder[i]].cancel(process); + } + }; + return { schedule, cancel, state, steps }; +} + +export { createRenderBatcher }; +//# sourceMappingURL=batcher.mjs.map diff --git a/node_modules/motion-dom/dist/es/frameloop/batcher.mjs.map b/node_modules/motion-dom/dist/es/frameloop/batcher.mjs.map new file mode 100644 index 0000000..505435b --- /dev/null +++ b/node_modules/motion-dom/dist/es/frameloop/batcher.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"batcher.mjs","sources":["../../../src/frameloop/batcher.ts"],"sourcesContent":["import { MotionGlobalConfig } from \"motion-utils\"\nimport { stepsOrder } from \"./order\"\nimport { createRenderStep } from \"./render-step\"\nimport { Batcher, FrameData, Process, Steps } from \"./types\"\n\nconst maxElapsed = 40\n\nexport function createRenderBatcher(\n scheduleNextBatch: (callback: Function) => void,\n allowKeepAlive: boolean\n) {\n let runNextFrame = false\n let useDefaultElapsed = true\n\n const state: FrameData = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n }\n\n const flagRunNextFrame = () => (runNextFrame = true)\n\n const steps = stepsOrder.reduce((acc, key) => {\n acc[key] = createRenderStep(flagRunNextFrame)\n return acc\n }, {} as Steps)\n\n const {\n setup,\n read,\n resolveKeyframes,\n preUpdate,\n update,\n preRender,\n render,\n postRender,\n } = steps\n\n const processBatch = () => {\n const useManualTiming = MotionGlobalConfig.useManualTiming\n const timestamp = useManualTiming\n ? state.timestamp\n : performance.now()\n runNextFrame = false\n\n if (!useManualTiming) {\n state.delta = useDefaultElapsed\n ? 1000 / 60\n : Math.max(Math.min(timestamp - state.timestamp, maxElapsed), 1)\n }\n\n state.timestamp = timestamp\n state.isProcessing = true\n\n // Unrolled render loop for better per-frame performance\n setup.process(state)\n read.process(state)\n resolveKeyframes.process(state)\n preUpdate.process(state)\n update.process(state)\n preRender.process(state)\n render.process(state)\n postRender.process(state)\n\n state.isProcessing = false\n\n if (runNextFrame && allowKeepAlive) {\n useDefaultElapsed = false\n scheduleNextBatch(processBatch)\n }\n }\n\n const wake = () => {\n runNextFrame = true\n useDefaultElapsed = true\n\n if (!state.isProcessing) {\n scheduleNextBatch(processBatch)\n }\n }\n\n const schedule = stepsOrder.reduce((acc, key) => {\n const step = steps[key]\n acc[key] = (process: Process, keepAlive = false, immediate = false) => {\n if (!runNextFrame) wake()\n\n return step.schedule(process, keepAlive, immediate)\n }\n return acc\n }, {} as Batcher)\n\n const cancel = (process: Process) => {\n for (let i = 0; i < stepsOrder.length; i++) {\n steps[stepsOrder[i]].cancel(process)\n }\n }\n\n return { schedule, cancel, state, steps }\n}\n"],"names":[],"mappings":";;;;AAKA,MAAM,UAAU,GAAG,EAAE;AAEf,SAAU,mBAAmB,CAC/B,iB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AM,CAAC,OAAO,CAAC;QACxC;AACJ,IAAA,CAAC;IAED,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE;AAC7C;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/frameloop/frame.mjs b/node_modules/motion-dom/dist/es/frameloop/frame.mjs new file mode 100644 index 0000000..fa001b1 --- /dev/null +++ b/node_modules/motion-dom/dist/es/frameloop/frame.mjs @@ -0,0 +1,7 @@ +import { noop } from 'motion-utils'; +import { createRenderBatcher } from './batcher.mjs'; + +const { schedule: frame, cancel: cancelFrame, state: frameData, steps: frameSteps, } = /* @__PURE__ */ createRenderBatcher(typeof requestAnimationFrame !== "undefined" ? requestAnimationFrame : noop, true); + +export { cancelFrame, frame, frameData, frameSteps }; +//# sourceMappingURL=frame.mjs.map diff --git a/node_modules/motion-dom/dist/es/frameloop/frame.mjs.map b/node_modules/motion-dom/dist/es/frameloop/frame.mjs.map new file mode 100644 index 0000000..37d67b0 --- /dev/null +++ b/node_modules/motion-dom/dist/es/frameloop/frame.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"frame.mjs","sources":["../../../src/frameloop/frame.ts"],"sourcesContent":["import { noop } from \"motion-utils\"\nimport { createRenderBatcher } from \"./batcher\"\n\nexport const {\n schedule: frame,\n cancel: cancelFrame,\n state: frameData,\n steps: frameSteps,\n} = /* @__PURE__ */ createRenderBatcher(\n typeof requestAnimationFrame !== \"undefined\" ? requestAnimationFrame : noop,\n true\n)\n"],"names":[],"mappings":";;;AAGO,MAAM,EACT,QAAQ,EAAE,KAAK,EACf,MAAM,EAAE,WAAW,EACnB,KAAK,EAAE,SAAS,EAChB,KAAK,EAAE,UAAU,GACpB,mBAAmB,mBAAmB,CACnC,OAAO,qBAAqB,KAAK,WAAW,GAAG,qBAAqB,GAAG,IAAI,EAC3E,IAAI;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/frameloop/index-legacy.mjs b/node_modules/motion-dom/dist/es/frameloop/index-legacy.mjs new file mode 100644 index 0000000..aa3de45 --- /dev/null +++ b/node_modules/motion-dom/dist/es/frameloop/index-legacy.mjs @@ -0,0 +1,21 @@ +import { stepsOrder } from './order.mjs'; +import { frame, cancelFrame } from './frame.mjs'; + +/** + * @deprecated + * + * Import as `frame` instead. + */ +const sync = frame; +/** + * @deprecated + * + * Use cancelFrame(callback) instead. + */ +const cancelSync = stepsOrder.reduce((acc, key) => { + acc[key] = (process) => cancelFrame(process); + return acc; +}, {}); + +export { cancelSync, sync }; +//# sourceMappingURL=index-legacy.mjs.map diff --git a/node_modules/motion-dom/dist/es/frameloop/index-legacy.mjs.map b/node_modules/motion-dom/dist/es/frameloop/index-legacy.mjs.map new file mode 100644 index 0000000..26f7d7e --- /dev/null +++ b/node_modules/motion-dom/dist/es/frameloop/index-legacy.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index-legacy.mjs","sources":["../../../src/frameloop/index-legacy.ts"],"sourcesContent":["import { cancelFrame, frame } from \".\"\nimport { stepsOrder } from \"./order\"\nimport { Process } from \"./types\"\n\n/**\n * @deprecated\n *\n * Import as `frame` instead.\n */\nexport const sync = frame\n\n/**\n * @deprecated\n *\n * Use cancelFrame(callback) instead.\n */\nexport const cancelSync = stepsOrder.reduce((acc, key) => {\n acc[key] = (process: Process) => cancelFrame(process)\n return acc\n}, {} as Record void>)\n"],"names":[],"mappings":";;;AAIA;;;;AAIG;AACI,MAAM,IAAI,GAAG;AAEpB;;;;AAIG;AACI,MAAM,UAAU,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,KAAI;AACrD,IAAA,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,OAAgB,KAAK,WAAW,CAAC,OAAO,CAAC;AACrD,IAAA,OAAO,GAAG;AACd,CAAC,EAAE,EAAgD;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/frameloop/microtask.mjs b/node_modules/motion-dom/dist/es/frameloop/microtask.mjs new file mode 100644 index 0000000..d81e76c --- /dev/null +++ b/node_modules/motion-dom/dist/es/frameloop/microtask.mjs @@ -0,0 +1,7 @@ +import { createRenderBatcher } from './batcher.mjs'; + +const { schedule: microtask, cancel: cancelMicrotask } = +/* @__PURE__ */ createRenderBatcher(queueMicrotask, false); + +export { cancelMicrotask, microtask }; +//# sourceMappingURL=microtask.mjs.map diff --git a/node_modules/motion-dom/dist/es/frameloop/microtask.mjs.map b/node_modules/motion-dom/dist/es/frameloop/microtask.mjs.map new file mode 100644 index 0000000..8e8e7cd --- /dev/null +++ b/node_modules/motion-dom/dist/es/frameloop/microtask.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"microtask.mjs","sources":["../../../src/frameloop/microtask.ts"],"sourcesContent":["import { createRenderBatcher } from \"./batcher\"\n\nexport const { schedule: microtask, cancel: cancelMicrotask } =\n /* @__PURE__ */ createRenderBatcher(queueMicrotask, false)\n"],"names":[],"mappings":";;AAEO,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,EAAE;AACzD,gBAAgB,mBAAmB,CAAC,cAAc,EAAE,KAAK;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/frameloop/order.mjs b/node_modules/motion-dom/dist/es/frameloop/order.mjs new file mode 100644 index 0000000..f2fb09f --- /dev/null +++ b/node_modules/motion-dom/dist/es/frameloop/order.mjs @@ -0,0 +1,13 @@ +const stepsOrder = [ + "setup", // Compute + "read", // Read + "resolveKeyframes", // Write/Read/Write/Read + "preUpdate", // Compute + "update", // Compute + "preRender", // Compute + "render", // Write + "postRender", // Compute +]; + +export { stepsOrder }; +//# sourceMappingURL=order.mjs.map diff --git a/node_modules/motion-dom/dist/es/frameloop/order.mjs.map b/node_modules/motion-dom/dist/es/frameloop/order.mjs.map new file mode 100644 index 0000000..19ceee3 --- /dev/null +++ b/node_modules/motion-dom/dist/es/frameloop/order.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"order.mjs","sources":["../../../src/frameloop/order.ts"],"sourcesContent":["import { StepId } from \"./types\"\n\nexport const stepsOrder: StepId[] = [\n \"setup\", // Compute\n \"read\", // Read\n \"resolveKeyframes\", // Write/Read/Write/Read\n \"preUpdate\", // Compute\n \"update\", // Compute\n \"preRender\", // Compute\n \"render\", // Write\n \"postRender\", // Compute\n] as const\n\nexport type StepNames = (typeof stepsOrder)[number]\n"],"names":[],"mappings":"AAEO,MAAM,UAAU,GAAa;AAChC,IAAA,OAAO;AACP,IAAA,MAAM;AACN,IAAA,kBAAkB;AAClB,IAAA,WAAW;AACX,IAAA,QAAQ;AACR,IAAA,WAAW;AACX,IAAA,QAAQ;AACR,IAAA,YAAY;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/frameloop/render-step.mjs b/node_modules/motion-dom/dist/es/frameloop/render-step.mjs new file mode 100644 index 0000000..34f5542 --- /dev/null +++ b/node_modules/motion-dom/dist/es/frameloop/render-step.mjs @@ -0,0 +1,84 @@ +function createRenderStep(runNextFrame) { + /** + * We create and reuse two queues, one to queue jobs for the current frame + * and one for the next. We reuse to avoid triggering GC after x frames. + */ + let thisFrame = new Set(); + let nextFrame = new Set(); + /** + * Track whether we're currently processing jobs in this step. This way + * we can decide whether to schedule new jobs for this frame or next. + */ + let isProcessing = false; + let flushNextFrame = false; + /** + * A set of processes which were marked keepAlive when scheduled. + */ + const toKeepAlive = new WeakSet(); + let latestFrameData = { + delta: 0.0, + timestamp: 0.0, + isProcessing: false, + }; + function triggerCallback(callback) { + if (toKeepAlive.has(callback)) { + step.schedule(callback); + runNextFrame(); + } + callback(latestFrameData); + } + const step = { + /** + * Schedule a process to run on the next frame. + */ + schedule: (callback, keepAlive = false, immediate = false) => { + const addToCurrentFrame = immediate && isProcessing; + const queue = addToCurrentFrame ? thisFrame : nextFrame; + if (keepAlive) + toKeepAlive.add(callback); + queue.add(callback); + return callback; + }, + /** + * Cancel the provided callback from running on the next frame. + */ + cancel: (callback) => { + nextFrame.delete(callback); + toKeepAlive.delete(callback); + }, + /** + * Execute all schedule callbacks. + */ + process: (frameData) => { + latestFrameData = frameData; + /** + * If we're already processing we've probably been triggered by a flushSync + * inside an existing process. Instead of executing, mark flushNextFrame + * as true and ensure we flush the following frame at the end of this one. + */ + if (isProcessing) { + flushNextFrame = true; + return; + } + isProcessing = true; + // Swap this frame and the next to avoid GC + const prevFrame = thisFrame; + thisFrame = nextFrame; + nextFrame = prevFrame; + // Execute this frame + thisFrame.forEach(triggerCallback); + // Clear the frame so no callbacks remain. This is to avoid + // memory leaks should this render step not run for a while. + thisFrame.clear(); + isProcessing = false; + if (flushNextFrame) { + flushNextFrame = false; + step.process(frameData); + } + }, + }; + return step; +} + +export { createRenderStep }; +//# sourceMappingURL=render-step.mjs.map diff --git a/node_modules/motion-dom/dist/es/frameloop/render-step.mjs.map b/node_modules/motion-dom/dist/es/frameloop/render-step.mjs.map new file mode 100644 index 0000000..463153f --- /dev/null +++ b/node_modules/motion-dom/dist/es/frameloop/render-step.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"render-step.mjs","sources":["../../../src/frameloop/render-step.ts"],"sourcesContent":["import { FrameData, Process, Step } from \"./types\"\n\nexport function createRenderStep(runNextFrame: () => void): Step {\n /**\n * We create and reuse two queues, one to queue jobs for the current frame\n * and one for the next. We reuse to avoid triggering GC after x frames.\n */\n let thisFrame = new Set()\n let nextFrame = new Set()\n\n /**\n * Track whether we're currently processing jobs in this step. This way\n * we can decide whether to schedule new jobs for this frame or next.\n */\n let isProcessing = false\n\n let flushNextFrame = false\n\n /**\n * A set of processes which were marked keepAlive when scheduled.\n */\n const toKeepAlive = new WeakSet()\n\n let latestFrameData: FrameData = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n }\n\n function triggerCallback(callback: Process) {\n if (toKeepAlive.has(callback)) {\n step.schedule(callback)\n runNextFrame()\n }\n\n callback(latestFrameData)\n }\n\n const step: Step = {\n /**\n * Schedule a process to run on the next frame.\n */\n schedule: (callback, keepAlive = false, immediate = false) => {\n const addToCurrentFrame = immediate && isProcessing\n const queue = addToCurrentFrame ? thisFrame : nextFrame\n\n if (keepAlive) toKeepAlive.add(callback)\n\n queue.add(callback)\n\n return callback\n },\n\n /**\n * Cancel the provided callback from running on the next frame.\n */\n cancel: (callback) => {\n nextFrame.delete(callback)\n toKeepAlive.delete(callback)\n },\n\n /**\n * Execute all schedule callbacks.\n */\n process: (frameData) => {\n latestFrameData = frameData\n\n /**\n * If we're already processing we've probably been triggered by a flushSync\n * inside an existing process. Instead of executing, mark flushNextFrame\n * as true and ensure we flush the following frame at the end of this one.\n */\n if (isProcessing) {\n flushNextFrame = true\n return\n }\n\n isProcessing = true\n\n // Swap this frame and the next to avoid GC\n const prevFrame = thisFrame\n thisFrame = nextFrame\n nextFrame = prevFrame\n\n // Execute this frame\n thisFrame.forEach(triggerCallback)\n\n // Clear the frame so no callbacks remain. This is to avoid\n // memory leaks should this render step not run for a while.\n thisFrame.clear()\n\n isProcessing = false\n\n if (flushNextFrame) {\n flushNextFrame = false\n step.process(frameData)\n }\n },\n }\n\n return step\n}\n"],"names":[],"mappings":"AAEM,SAAU,gBAAgB,CAAC,YAAwB,EAAA;AACrD;;;AAGG;AACH,IAAA,IAAI,SAAS,GAAG,IAAI,GAAG,EAAW;AAClC,IAAA,IAAI,SAAS,GAAG,IAAI,GAAG,EAAW;AAElC;;;AAGG;IACH,IAAI,YAAY,GAAG,KAAK;IAExB,IAAI,cAAc,GAAG,KAAK;AAE1B;;AAEG;AACH,IAAA,MAAM,WAAW,GAAG,IAAI,OAAO,EAAW;AAE1C,IAAA,IAAI,eAAe,GAAc;AAC7B,QAAA,KAAK,EAAE,GAAG;AACV,QAAA,SAAS,EAAE,GAAG;AACd,QAAA,YAAY,EAAE,KAAK;KACtB;IAED,SAAS,eAAe,CAAC,QAAiB,EAAA;AACtC,QAAA,IAAI,WAAW,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE;AAC3B,YAAA,IAAI,CAAC,QAAQ,CAAC,QAAQ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_modules/motion-dom/dist/es/frameloop/sync-time.mjs new file mode 100644 index 0000000..e24804c --- /dev/null +++ b/node_modules/motion-dom/dist/es/frameloop/sync-time.mjs @@ -0,0 +1,32 @@ +import { MotionGlobalConfig } from 'motion-utils'; +import { frameData } from './frame.mjs'; + +let now; +function clearTime() { + now = undefined; +} +/** + * An eventloop-synchronous alternative to performance.now(). + * + * Ensures that time measurements remain consistent within a synchronous context. + * Usually calling performance.now() twice within the same synchronous context + * will return different values which isn't useful for animations when we're usually + * trying to sync animations to the same frame. + */ +const time = { + now: () => { + if (now === undefined) { + time.set(frameData.isProcessing || MotionGlobalConfig.useManualTiming + ? frameData.timestamp + : performance.now()); + } + return now; + }, + set: (newTime) => { + now = newTime; + queueMicrotask(clearTime); + }, +}; + +export { time }; +//# sourceMappingURL=sync-time.mjs.map diff --git a/node_modules/motion-dom/dist/es/frameloop/sync-time.mjs.map b/node_modules/motion-dom/dist/es/frameloop/sync-time.mjs.map new file mode 100644 index 0000000..55cb987 --- /dev/null +++ b/node_modules/motion-dom/dist/es/frameloop/sync-time.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"sync-time.mjs","sources":["../../../src/frameloop/sync-time.ts"],"sourcesContent":["import { MotionGlobalConfig } from \"motion-utils\"\nimport { frameData } from \"./frame\"\n\nlet now: number | undefined\n\nfunction clearTime() {\n now = undefined\n}\n\n/**\n * An eventloop-synchronous alternative to performance.now().\n *\n * Ensures that time measurements remain consistent within a synchronous context.\n * Usually calling performance.now() twice within the same synchronous context\n * will return different values which isn't useful for animations when we're usually\n * trying to sync animations to the same frame.\n */\nexport const time = {\n now: (): number => {\n if (now === undefined) {\n time.set(\n frameData.isProcessing || MotionGlobalConfig.useManualTiming\n ? frameData.timestamp\n : performance.now()\n )\n }\n\n return now!\n },\n set: (newTime: number) => {\n now = newTime\n queueMicrotask(clearTime)\n },\n}\n"],"names":[],"mappings":";;;AAGA,IAAI,GAAuB;AAE3B,SAAS,SAAS,GAAA;IACd,GAAG,GAAG,SAAS;AACnB;AAEA;;;;;;;AAOG;AACI,MAAM,IAAI,GAAG;IAChB,GAAG,EAAE,MAAa;AACd,QAAA,IAAI,GAAG,KAAK,SAAS,EAAE;YACnB,IAAI,CAAC,GAAG,CACJ,SAAS,CAAC,YAAY,IAAI,kBAAkB,CAAC;kBACvC,SAAS,CAAC;AACZ,kBAAE,WAAW,CAAC,GAAG,EAAE,CAC1B;QACL;AAEA,QAAA,OAAO,GAAI;IACf,CAAC;AACD,IAAA,GAAG,EAAE,CAAC,OAAe,KAAI;QACrB,GAAG,GAAG,OAAO;QACb,cAAc,CAAC,SAAS,CAAC;IAC7B,CAAC;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/gestures/drag/state/is-active.mjs b/node_modules/motion-dom/dist/es/gestures/drag/state/is-active.mjs new file mode 100644 index 0000000..f5bfa77 --- /dev/null +++ b/node_modules/motion-dom/dist/es/gestures/drag/state/is-active.mjs @@ -0,0 +1,10 @@ +const isDragging = { + x: false, + y: false, +}; +function isDragActive() { + return isDragging.x || isDragging.y; +} + +export { isDragActive, isDragging }; +//# sourceMappingURL=is-active.mjs.map diff --git a/node_modules/motion-dom/dist/es/gestures/drag/state/is-active.mjs.map b/node_modules/motion-dom/dist/es/gestures/drag/state/is-active.mjs.map new file mode 100644 index 0000000..80f56c4 --- /dev/null +++ b/node_modules/motion-dom/dist/es/gestures/drag/state/is-active.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"is-active.mjs","sources":["../../../../../src/gestures/drag/state/is-active.ts"],"sourcesContent":["export const isDragging = {\n x: false,\n y: false,\n}\n\nexport function isDragActive() {\n return isDragging.x || isDragging.y\n}\n"],"names":[],"mappings":"AAAO,MAAM,UAAU,GAAG;AACtB,IAAA,CAAC,EAAE,KAAK;AACR,IAAA,CAAC,EAAE,KAAK;;SAGI,YAAY,GAAA;AACxB,IAAA,OAAO,UAAU,CAAC,CAAC,IAAI,UAAU,CAAC,CAAC;AACvC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/gestures/drag/state/set-active.mjs b/node_modules/motion-dom/dist/es/gestures/drag/state/set-active.mjs new file mode 100644 index 0000000..78e2661 --- /dev/null +++ b/node_modules/motion-dom/dist/es/gestures/drag/state/set-active.mjs @@ -0,0 +1,29 @@ +import { isDragging } from './is-active.mjs'; + +function setDragLock(axis) { + if (axis === "x" || axis === "y") { + if (isDragging[axis]) { + return null; + } + else { + isDragging[axis] = true; + return () => { + isDragging[axis] = false; + }; + } + } + else { + if (isDragging.x || isDragging.y) { + return null; + } + else { + isDragging.x = isDragging.y = true; + return () => { + isDragging.x = isDragging.y = false; + }; + } + } +} + +export { setDragLock }; +//# sourceMappingURL=set-active.mjs.map diff --git a/node_modules/motion-dom/dist/es/gestures/drag/state/set-active.mjs.map b/node_modules/motion-dom/dist/es/gestures/drag/state/set-active.mjs.map new file mode 100644 index 0000000..b3c08e3 --- /dev/null +++ b/node_modules/motion-dom/dist/es/gestures/drag/state/set-active.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"set-active.mjs","sources":["../../../../../src/gestures/drag/state/set-active.ts"],"sourcesContent":["import { isDragging } from \"./is-active\"\n\nexport function setDragLock(axis: boolean | \"x\" | \"y\" | \"lockDirection\") {\n if (axis === \"x\" || axis === \"y\") {\n if (isDragging[axis]) {\n return null\n } else {\n isDragging[axis] = true\n return () => {\n isDragging[axis] = false\n }\n }\n } else {\n if (isDragging.x || isDragging.y) {\n return null\n } else {\n isDragging.x = isDragging.y = true\n return () => {\n isDragging.x = isDragging.y = false\n }\n }\n }\n}\n"],"names":[],"mappings":";;AAEM,SAAU,WAAW,CAAC,IAA2C,EAAA;IACnE,IAAI,IAAI,KAAK,GAAG,IAAI,IAAI,KAAK,GAAG,EAAE;AAC9B,QAAA,IAAI,UAAU,CAAC,IAAI,CAAC,EAAE;AAClB,YAAA,OAAO,IAAI;QACf;aAAO;AACH,YAAA,UAAU,CAAC,IAAI,CAAC,GAAG,IAAI;AACvB,YAAA,OAAO,MAAK;AACR,gBAAA,UAAU,CAAC,IAAI,CAAC,GAAG,KAAK;AAC5B,YAAA,CAAC;QACL;IACJ;SAAO;QACH,IAAI,UAAU,CAAC,CAAC,IAAI,UAAU,CAAC,CAAC,EAAE;AAC9B,YAAA,OAAO,IAAI;QACf;aAAO;YACH,UAAU,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,GAAG,IAAI;AAClC,YAAA,OAAO,MAAK;gBACR,UAAU,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,GAAG,KAAK;AACvC,YAAA,CAAC;QACL;IACJ;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/gestures/hover.mjs b/node_modules/motion-dom/dist/es/gestures/hover.mjs new file mode 100644 index 0000000..2d540e9 --- /dev/null +++ b/node_modules/motion-dom/dist/es/gestures/hover.mjs @@ -0,0 +1,70 @@ +import { isDragActive } from './drag/state/is-active.mjs'; +import { setupGesture } from './utils/setup.mjs'; + +function isValidHover(event) { + return !(event.pointerType === "touch" || isDragActive()); +} +/** + * Create a hover gesture. hover() is different to .addEventListener("pointerenter") + * in that it has an easier syntax, filters out polyfilled touch events, interoperates + * with drag gestures, and automatically removes the "pointerennd" event listener when the hover ends. + * + * @public + */ +function hover(elementOrSelector, onHoverStart, options = {}) { + const [elements, eventOptions, cancel] = setupGesture(elementOrSelector, options); + elements.forEach((element) => { + let isPressed = false; + let deferredHoverEnd = false; + let hoverEndCallback; + const removePointerLeave = () => { + element.removeEventListener("pointerleave", onPointerLeave); + }; + const endHover = (event) => { + if (hoverEndCallback) { + hoverEndCallback(event); + hoverEndCallback = undefined; + } + removePointerLeave(); + }; + const onPointerUp = (event) => { + isPressed = false; + window.removeEventListener("pointerup", onPointerUp); + window.removeEventListener("pointercancel", onPointerUp); + if (deferredHoverEnd) { + deferredHoverEnd = false; + endHover(event); + } + }; + const onPointerDown = () => { + isPressed = true; + window.addEventListener("pointerup", onPointerUp, eventOptions); + window.addEventListener("pointercancel", onPointerUp, eventOptions); + }; + const onPointerLeave = (leaveEvent) => { + if (leaveEvent.pointerType === "touch") + return; + if (isPressed) { + deferredHoverEnd = true; + return; + } + endHover(leaveEvent); + }; + const onPointerEnter = (enterEvent) => { + if (!isValidHover(enterEvent)) + return; + deferredHoverEnd = false; + const onHoverEnd = onHoverStart(element, enterEvent); + if (typeof onHoverEnd !== "function") + return; + hoverEndCallback = onHoverEnd; + element.addEventListener("pointerleave", onPointerLeave, eventOptions); + }; + element.addEventListener("pointerenter", onPointerEnter, eventOptions); + element.addEventListener("pointerdown", onPointerDown, eventOptions); + }); + return cancel; +} + +export { hover }; +//# sourceMappingURL=hover.mjs.map diff --git a/node_modules/motion-dom/dist/es/gestures/hover.mjs.map b/node_modules/motion-dom/dist/es/gestures/hover.mjs.map new file mode 100644 index 0000000..78e6f7e --- /dev/null +++ b/node_modules/motion-dom/dist/es/gestures/hover.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"hover.mjs","sources":["../../../src/gestures/hover.ts"],"sourcesContent":["import { ElementOrSelector } from \"../utils/resolve-elements\"\nimport { isDragActive } from \"./drag/state/is-active\"\nimport { EventOptions } from \"./types\"\nimport { setupGesture } from \"./utils/setup\"\n\n/**\n * A function to be called when a hover gesture starts.\n *\n * This function can optionally return a function that will be called\n * when the hover gesture ends.\n *\n * @public\n */\nexport type OnHoverStartEvent = (\n element: Element,\n event: PointerEvent\n) => void | OnHoverEndEvent\n\n/**\n * A function to be called when a hover gesture ends.\n *\n * @public\n */\nexport type OnHoverEndEvent = (event: PointerEvent) => void\n\nfunction isValidHover(event: PointerEvent) {\n return !(event.pointerType === \"touch\" || isDragActive())\n}\n\n/**\n * Create a hover gesture. hover() is different to .addEventListener(\"pointerenter\")\n * in that it has an easier syntax, filters out polyfilled touch events, interoperates\n * with drag gestures, and automatically removes the \"pointerennd\" event listener when the hover ends.\n *\n * @public\n */\nexport function hover(\n elementOrSelector: ElementOrSelector,\n onHoverStart: OnHoverStartEvent,\n options: EventOptions = {}\n): VoidFunction {\n const [elements, eventOptions, cancel] = setupGesture(\n elementOrSelector,\n options\n )\n\n elements.forEach((element) => {\n let isPressed = false\n let deferredHoverEnd = false\n let hoverEndCallback: OnHoverEndEvent | undefined\n\n const removePointerLeave = () => {\n element.removeEventListener(\n \"pointerleave\",\n onPointerLeave as EventListener\n )\n }\n\n const endHover = (event: PointerEvent) => {\n if (hoverEndCallback) {\n hoverEndCallback(event)\n hoverEndCallback = undefined\n }\n removePointerLeave()\n }\n\n const onPointerUp = (event: Event) => {\n isPressed = false\n window.removeEventListener(\n \"pointerup\",\n onPointerUp as EventListener\n )\n window.removeEventListener(\n \"pointercancel\",\n onPointerUp as EventListener\n )\n\n if (deferredHoverEnd) {\n deferredHoverEnd = false\n endHover(event as PointerEvent)\n }\n }\n\n const onPointerDown = () => {\n isPressed = true\n window.addEventListener(\n \"pointerup\",\n onPointerUp as EventListener,\n eventOptions\n )\n window.addEventListener(\n \"pointercancel\",\n onPointerUp as EventListener,\n eventOptions\n )\n }\n\n const onPointerLeave = (leaveEvent: PointerEvent) => {\n if (leaveEvent.pointerType === \"touch\") return\n\n if (isPressed) {\n deferredHoverEnd = true\n return\n }\n\n endHover(leaveEvent)\n }\n\n const onPointerEnter = (enterEvent: PointerEvent) => {\n if (!isValidHover(enterEvent)) return\n\n deferredHoverEnd = false\n\n const onHoverEnd = onHoverStart(\n element as Element,\n enterEvent\n )\n\n if (typeof onHoverEnd !== \"function\") return\n\n hoverEndCallback = onHoverEnd\n\n element.addEventListener(\n \"pointerleave\",\n onPointerLeave as EventListener,\n eventOptions\n )\n }\n\n element.addEventListener(\n \"pointerenter\",\n onPointerEnter as EventListener,\n eventOptions\n )\n element.addEventListener(\n \"pointerdown\",\n onPointerDown as EventListener,\n eventOptions\n )\n })\n\n return cancel\n}\n"],"names":[],"mappings":";;;AAyBA,SAAS,YAAY,CAAC,KAAmB,EAAA;IACrC,OAAO,EAAE,KAAK,CAAC,WAAW,KAAK,OAAO,IAAI,YAAY,EAAE,CA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AAU,CAAC,WAAW,KAAK,OAAO;gBAAE;YAExC,IAAI,SAAS,EAAE;gBACX,gBAAgB,GAAG,IAAI;gBACvB;YACJ;YAEA,QAAQ,CAAC,UAAU,CAAC;AACxB,QAAA,CAAC;AAED,QAAA,MAAM,cAAc,GAAG,CAAC,UAAwB,KAAI;AAChD,YAAA,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC;gBAAE;YAE/B,gBAAgB,GAAG,KAAK;YAExB,MAAM,UAAU,GAAG,YAAY,CAC3B,OAAkB,EAClB,UAAU,CACb;YAED,IAAI,OAAO,UAAU,KAAK,UAAU;gBAAE;YAEtC,gBAAgB,GAAG,UAAU;YAE7B,OAAO,CAAC,gBAAgB,CACpB,cAAc,EACd,cAA+B,EAC/B,YAAY,CACf;AACL,QAAA,CAAC;QAED,OAAO,CAAC,gBAAgB,CACpB,cAAc,EACd,cAA+B,EAC/B,YAAY,CACf;QACD,OAAO,CAAC,gBAAgB,CACpB,aAAa,EACb,aAA8B,EAC9B,YAAY,CACf;AACL,IAAA,CAAC,CAAC;AAEF,IAAA,OAAO,MAAM;AACjB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/gestures/press/index.mjs b/node_modules/motion-dom/dist/es/gestures/press/index.mjs new file mode 100644 index 0000000..b46a409 --- /dev/null +++ b/node_modules/motion-dom/dist/es/gestures/press/index.mjs @@ -0,0 +1,97 @@ +import { isHTMLElement } from '../../utils/is-html-element.mjs'; +import { isDragActive } from '../drag/state/is-active.mjs'; +import { isNodeOrChild } from '../utils/is-node-or-child.mjs'; +import { isPrimaryPointer } from '../utils/is-primary-pointer.mjs'; +import { setupGesture } from '../utils/setup.mjs'; +import { isElementKeyboardAccessible } from './utils/is-keyboard-accessible.mjs'; +import { enableKeyboardPress } from './utils/keyboard.mjs'; +import { isPressing } from './utils/state.mjs'; + +/** + * Filter out events that are not primary pointer events, or are triggering + * while a Motion gesture is active. + */ +function isValidPressEvent(event) { + return isPrimaryPointer(event) && !isDragActive(); +} +const claimedPointerDownEvents = new WeakSet(); +/** + * Create a press gesture. + * + * Press is different to `"pointerdown"`, `"pointerup"` in that it + * automatically filters out secondary pointer events like right + * click and multitouch. + * + * It also adds accessibility support for keyboards, where + * an element with a press gesture will receive focus and + * trigger on Enter `"keydown"` and `"keyup"` events. + * + * This is different to a browser's `"click"` event, which does + * respond to keyboards but only for the `"click"` itself, rather + * than the press start and end/cancel. The element also needs + * to be focusable for this to work, whereas a press gesture will + * make an element focusable by default. + * + * @public + */ +function press(targetOrSelector, onPressStart, options = {}) { + const [targets, eventOptions, cancelEvents] = setupGesture(targetOrSelector, options); + const startPress = (startEvent) => { + const target = startEvent.currentTarget; + if (!isValidPressEvent(startEvent)) + return; + if (claimedPointerDownEvents.has(startEvent)) + return; + isPressing.add(target); + if (options.stopPropagation) { + claimedPointerDownEvents.add(startEvent); + } + const onPressEnd = onPressStart(target, startEvent); + /** + * End listeners run in the capture phase so a descendant calling + * stopPropagation() in its own pointerup handler can't prevent the + * press gesture from ending. This also keeps the gesture-end + * ordering consistent with the drag gesture. See #2794. + */ + const endEventOptions = { ...eventOptions, capture: true }; + const onPointerEnd = (endEvent, success) => { + window.removeEventListener("pointerup", onPointerUp, endEventOptions); + window.removeEventListener("pointercancel", onPointerCancel, endEventOptions); + if (isPressing.has(target)) { + isPressing.delete(target); + } + if (!isValidPressEvent(endEvent)) { + return; + } + if (typeof onPressEnd === "function") { + onPressEnd(endEvent, { success }); + } + }; + const onPointerUp = (upEvent) => { + onPointerEnd(upEvent, target === window || + target === document || + options.useGlobalTarget || + isNodeOrChild(target, upEvent.target)); + }; + const onPointerCancel = (cancelEvent) => { + onPointerEnd(cancelEvent, false); + }; + window.addEventListener("pointerup", onPointerUp, endEventOptions); + window.addEventListener("pointercancel", onPointerCancel, endEventOptions); + }; + targets.forEach((target) => { + const pointerDownTarget = options.useGlobalTarget ? window : target; + pointerDownTarget.addEventListener("pointerdown", startPress, eventOptions); + if (isHTMLElement(target)) { + target.addEventListener("focus", (event) => enableKeyboardPress(event, eventOptions)); + if (!isElementKeyboardAccessible(target) && + !target.hasAttribute("tabindex")) { + target.tabIndex = 0; + } + } + }); + return cancelEvents; +} + +export { press }; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/motion-dom/dist/es/gestures/press/index.mjs.map b/node_modules/motion-dom/dist/es/gestures/press/index.mjs.map new file mode 100644 index 0000000..e614a5e --- /dev/null +++ b/node_modules/motion-dom/dist/es/gestures/press/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../../../../src/gestures/press/index.ts"],"sourcesContent":["import { isHTMLElement } from \"../../utils/is-html-element\"\nimport { ElementOrSelector } from \"../../utils/resolve-elements\"\nimport { isDragActive } from \"../drag/state/is-active\"\nimport { EventOptions } from \"../types\"\nimport { isNodeOrChild } from \"../utils/is-node-or-child\"\nimport { isPrimaryPointer } from \"../utils/is-primary-pointer\"\nimport { setupGesture } from \"../utils/setup\"\nimport { OnPressStartEvent } from \"./types\"\nimport { isElementKeyboardAccessible } from \"./utils/is-keyboard-accessible\"\nimport { enableKeyboardPress } from \"./utils/keyboard\"\nimport { isPressing } from \"./utils/state\"\n\n/**\n * Filter out events that are not primary pointer events, or are triggering\n * while a Motion gesture is active.\n */\nfunction isValidPressEvent(event: PointerEvent) {\n return isPrimaryPointer(event) && !isDragActive()\n}\n\nconst claimedPointerDownEvents = new WeakSet()\n\nexport interface PointerEventOptions extends EventOptions {\n useGlobalTarget?: boolean\n stopPropagation?: boolean\n}\n\n/**\n * Create a press gesture.\n *\n * Press is different to `\"pointerdown\"`, `\"pointerup\"` in that it\n * automatically filters out secondary pointer events like right\n * click and multitouch.\n *\n * It also adds accessibility support for keyboards, where\n * an element with a press gesture will receive focus and\n * trigger on Enter `\"keydown\"` and `\"keyup\"` events.\n *\n * This is different to a browser's `\"click\"` event, which does\n * respond to keyboards but only for the `\"click\"` itself, rather\n * than the press start and end/cancel. The element also needs\n * to be focusable for this to work, whereas a press gesture will\n * make an element focusable by default.\n *\n * @public\n */\nexport function press(\n targetOrSelector: ElementOrSelector,\n onPressStart: OnPressStartEvent,\n options: PointerEventOptions = {}\n): VoidFunction {\n const [targets, eventOptions, cancelEvents] = setupGesture(\n targetOrSelector,\n options\n )\n\n const startPress = (startEvent: PointerEvent) => {\n const target = startEvent.currentTarget as Element\n\n if (!isValidPressEvent(startEvent)) return\n if (claimedPointerDownEvents.has(startEvent)) return\n\n isPressing.add(target)\n\n if (options.stopPropagation) {\n claimedPointerDownEvents.add(startEvent)\n }\n\n const onPressEnd = onPressStart(target, startEvent)\n\n /**\n * End listeners run in the capture phase so a descendant calling\n * stopPropagation() in its own pointerup handler can't prevent the\n * press gesture from ending. This also keeps the gesture-end\n * ordering consistent with the drag gesture. See #2794.\n */\n const endEventOptions = { ...eventOptions, capture: true }\n\n const onPointerEnd = (endEvent: PointerEvent, success: boolean) => {\n window.removeEventListener(\n \"pointerup\",\n onPointerUp,\n endEventOptions\n )\n window.removeEventListener(\n \"pointercancel\",\n onPointerCancel,\n endEventOptions\n )\n\n if (isPressing.has(target)) {\n isPressing.delete(target)\n }\n\n if (!isValidPressEvent(endEvent)) {\n return\n }\n\n if (typeof onPressEnd === \"function\") {\n onPressEnd(endEvent, { success })\n }\n }\n\n const onPointerUp = (upEvent: PointerEvent) => {\n onPointerEnd(\n upEvent,\n (target as any) === window ||\n (target as any) === document ||\n options.useGlobalTarget ||\n isNodeOrChild(target, upEvent.target as Element)\n )\n }\n\n const onPointerCancel = (cancelEvent: PointerEvent) => {\n onPointerEnd(cancelEvent, false)\n }\n\n window.addEventListener(\"pointerup\", onPointerUp, endEventOptions)\n window.addEventListener(\n \"pointercancel\",\n onPointerCancel,\n endEventOptions\n )\n }\n\n targets.forEach((target: EventTarget) => {\n const pointerDownTarget = options.useGlobalTarget ? window : target\n pointerDownTarget.addEventListener(\n \"pointerdown\",\n startPress as EventListener,\n eventOptions\n )\n\n if (isHTMLElement(target)) {\n target.addEventListener(\"focus\", (event) =>\n enableKeyboardPress(event as FocusEvent, eventOptions)\n )\n\n if (\n !isElementKeyboardAccessible(target) &&\n !target.hasAttribute(\"tabindex\")\n ) {\n target.tabIndex = 0\n }\n }\n })\n\n return cancelEvents\n}\n"],"names":[],"mappings":";;;;;;;;;AAYA;;;AAGG;AACH,SAAS,iBAAiB,CAAC,KAAmB,EAAA;IAC1C,OAAO,gBAAgB,CAAC,KAAK,CAAC,IAAI,CAAC,YAAY,EAAE;AACrD;AAEA,MAAM,wBAAwB,GAAG,IAAI,OAAO,EAAS;AAOrD;;;;;;;;;;;;;;;;;;AAkBG;AACG,SAAU,KAAK,CACjB,gBAAmC,EACnC,YAA+B,EAC/B,UAA+B,EAAE,EAAA;AAEjC,IAAA,MAAM,CAAC,OAAO,EAAE,YAAY,EAAE,YAAY,CAAC,GAAG,YAAY,CACtD,gBAAgB,EAChB,OAAO,CACV;AAED,IAAA,MAAM,UAAU,GAAG,CAAC,UAAwB,KAAI;AAC5C,QAAA,MAAM,MAAM,GAAG,UAAU,CAAC,aAAwB;AAElD,QAAA,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC;YAAE;AACpC,QAAA,IAAI,wBAAwB,CAAC,GAAG,CAAC,UAAU,CAAC;YAAE;AAE9C,QAAA,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC;AAEtB,QAAA,IAAI,OAAO,CAAC,eAAe,EAAE;AACzB,YAAA,wBAAwB,CAAC,GAAG,CAAC,UAAU,CAAC;QAC5C;QAEA,MAAM,UAAU,GAAG,YAAY,CAAC,MAAM,EAAE,UAAU,CAAC;AAEnD;;;;;AAKG;QACH,MAAM,eAAe,GAAG,EAAE,GAAG,YAAY,EAAE,OAAO,EAAE,IAAI,EAAE;AAE1D,QAAA,MAAM,YAAY,GAAG,CAAC,QAAsB,EAAE,OAAgB,KAAI;YAC9D,MAAM,CAAC,mBAAmB,CACtB,WAAW,EACX,WAAW,EACX,eAAe,CAClB;YACD,MAAM,CAAC,mBAAmB,CACtB,eAAe,EACf,eAAe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C,2BAA2B,CAAC,MAAM,CAAC;AACpC,gBAAA,CAAC,MAAM,CAAC,YAAY,CAAC,UAAU,CAAC,EAClC;AACE,gBAAA,MAAM,CAAC,QAAQ,GAAG,CAAC;YACvB;QACJ;AACJ,IAAA,CAAC,CAAC;AAEF,IAAA,OAAO,YAAY;AACvB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.mjs b/node_modules/motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.mjs new file mode 100644 index 0000000..defa4bf --- /dev/null +++ b/node_modules/motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.mjs @@ -0,0 +1,34 @@ +const keyboardAccessibleElements = new Set([ + "BUTTON", + "INPUT", + "SELECT", + "TEXTAREA", + "A", +]); +/** + * Checks if an element is natively keyboard accessible (focusable). + * Used by the press gesture to determine if we need to add tabIndex. + */ +function isElementKeyboardAccessible(element) { + return (keyboardAccessibleElements.has(element.tagName) || + element.isContentEditable === true); +} +const textInputElements = new Set(["INPUT", "SELECT", "TEXTAREA"]); +/** + * Checks if an element has text selection or direct interaction behavior + * that should block drag gestures from starting. + * + * This specifically targets form controls where the user might want to select + * text or interact with the control (e.g., sliders, dropdowns). + * + * Buttons and links are NOT included because they don't have click-and-move + * actions of their own - they only respond to click events, so dragging + * should still work when initiated from these elements. + */ +function isElementTextInput(element) { + return (textInputElements.has(element.tagName) || + element.isContentEditable === true); +} + +export { isElementKeyboardAccessible, isElementTextInput }; +//# sourceMappingURL=is-keyboard-accessible.mjs.map diff --git a/node_modules/motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.mjs.map b/node_modules/motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.mjs.map new file mode 100644 index 0000000..cc94517 --- /dev/null +++ b/node_modules/motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"is-keyboard-accessible.mjs","sources":["../../../../../src/gestures/press/utils/is-keyboard-accessible.ts"],"sourcesContent":["const keyboardAccessibleElements = new Set([\n \"BUTTON\",\n \"INPUT\",\n \"SELECT\",\n \"TEXTAREA\",\n \"A\",\n])\n\n/**\n * Checks if an element is natively keyboard accessible (focusable).\n * Used by the press gesture to determine if we need to add tabIndex.\n */\nexport function isElementKeyboardAccessible(element: Element) {\n return (\n keyboardAccessibleElements.has(element.tagName) ||\n (element as HTMLElement).isContentEditable === true\n )\n}\n\nconst textInputElements = new Set([\"INPUT\", \"SELECT\", \"TEXTAREA\"])\n\n/**\n * Checks if an element has text selection or direct interaction behavior\n * that should block drag gestures from starting.\n *\n * This specifically targets form controls where the user might want to select\n * text or interact with the control (e.g., sliders, dropdowns).\n *\n * Buttons and links are NOT included because they don't have click-and-move\n * actions of their own - they only respond to click events, so dragging\n * should still work when initiated from these elements.\n */\nexport function isElementTextInput(element: Element) {\n return (\n textInputElements.has(element.tagName) ||\n (element as HTMLElement).isContentEditable === true\n )\n}\n"],"names":[],"mappings":"AAAA,MAAM,0BAA0B,GAAG,IAAI,GAAG,CAAC;IACvC,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,UAAU;IACV,GAAG;AACN,CAAA,CAAC;AAEF;;;AAGG;AACG,SAAU,2BAA2B,CAAC,OAAgB,EAAA;IACxD,QACI,0BAA0B,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC;AAC9C,QAAA,OAAuB,CAAC,iBAAiB,KAAK,IAAI;AAE3D;AAEA,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC;AAElE;;;;;;;;;;AAUG;AACG,SAAU,kBAAkB,CAAC,OAAgB,EAAA;IAC/C,QACI,iBAAiB,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC;AACrC,QAAA,OAAuB,CAAC,iBAAiB,KAAK,IAAI;AAE3D;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/gestures/press/utils/keyboard.mjs b/node_modules/motion-dom/dist/es/gestures/press/utils/keyboard.mjs new file mode 100644 index 0000000..8186599 --- /dev/null +++ b/node_modules/motion-dom/dist/es/gestures/press/utils/keyboard.mjs @@ -0,0 +1,39 @@ +import { isPressing } from './state.mjs'; + +/** + * Filter out events that are not "Enter" keys. + */ +function filterEvents(callback) { + return (event) => { + if (event.key !== "Enter") + return; + callback(event); + }; +} +function firePointerEvent(target, type) { + target.dispatchEvent(new PointerEvent("pointer" + type, { isPrimary: true, bubbles: true })); +} +const enableKeyboardPress = (focusEvent, eventOptions) => { + const element = focusEvent.currentTarget; + if (!element) + return; + const handleKeydown = filterEvents(() => { + if (isPressing.has(element)) + return; + firePointerEvent(element, "down"); + const handleKeyup = filterEvents(() => { + firePointerEvent(element, "up"); + }); + const handleBlur = () => firePointerEvent(element, "cancel"); + element.addEventListener("keyup", handleKeyup, eventOptions); + element.addEventListener("blur", handleBlur, eventOptions); + }); + element.addEventListener("keydown", handleKeydown, eventOptions); + /** + * Add an event listener that fires on blur to remove the keydown events. + */ + element.addEventListener("blur", () => element.removeEventListener("keydown", handleKeydown), eventOptions); +}; + +export { enableKeyboardPress }; +//# sourceMappingURL=keyboard.mjs.map diff --git a/node_modules/motion-dom/dist/es/gestures/press/utils/keyboard.mjs.map b/node_modules/motion-dom/dist/es/gestures/press/utils/keyboard.mjs.map new file mode 100644 index 0000000..d83f7b6 --- /dev/null +++ b/node_modules/motion-dom/dist/es/gestures/press/utils/keyboard.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"keyboard.mjs","sources":["../../../../../src/gestures/press/utils/keyboard.ts"],"sourcesContent":["import { isPressing } from \"./state\"\n\n/**\n * Filter out events that are not \"Enter\" keys.\n */\nfunction filterEvents(callback: (event: KeyboardEvent) => void) {\n return (event: KeyboardEvent) => {\n if (event.key !== \"Enter\") return\n callback(event)\n }\n}\n\nfunction firePointerEvent(target: EventTarget, type: \"down\" | \"up\" | \"cancel\") {\n target.dispatchEvent(\n new PointerEvent(\"pointer\" + type, { isPrimary: true, bubbles: true })\n )\n}\n\nexport const enableKeyboardPress = (\n focusEvent: FocusEvent,\n eventOptions: AddEventListenerOptions\n) => {\n const element = focusEvent.currentTarget as HTMLElement\n if (!element) return\n\n const handleKeydown = filterEvents(() => {\n if (isPressing.has(element)) return\n\n firePointerEvent(element, \"down\")\n\n const handleKeyup = filterEvents(() => {\n firePointerEvent(element, \"up\")\n })\n\n const handleBlur = () => firePointerEvent(element, \"cancel\")\n\n element.addEventListener(\"keyup\", handleKeyup, eventOptions)\n element.addEventListener(\"blur\", handleBlur, eventOptions)\n })\n\n element.addEventListener(\"keydown\", handleKeydown, eventOptions)\n\n /**\n * Add an event listener that fires on blur to remove the keydown events.\n */\n element.addEventListener(\n \"blur\",\n () => element.removeEventListener(\"keydown\", handleKeydown),\n eventOptions\n )\n}\n"],"names":[],"mappings":";;AAEA;;AAEG;AACH,SAAS,YAAY,CAAC,QAAwC,EAAA;IAC1D,OAAO,CAAC,KAAoB,KAAI;AAC5B,QAAA,IAAI,KAAK,CAAC,GAAG,KAAK,OAAO;YAAE;QAC3B,QAAQ,CAAC,KAAK,CAAC;AACnB,IAAA,CAAC;AACL;AAEA,SAAS,gBAAgB,CAAC,MAAmB,EAAE,IAA8B,EAAA;IACzE,MAAM,CAAC,aAAa,CAChB,IAAI,YAAY,CAAC,SAAS,GAAG,IAAI,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CACzE;AACL;MAEa,mBAAmB,GAAG,CAC/B,UAAsB,EACtB,YAAqC,KACrC;AACA,IAAA,MAAM,OAAO,GAAG,UAAU,CAAC,aAA4B;AACvD,IAAA,IAAI,CAAC,OAAO;QAAE;AAEd,IAAA,MAAM,aAAa,GAAG,YAAY,CAAC,MAAK;AACpC,QAAA,IAAI,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC;YAAE;AAE7B,QAAA,gBAAgB,CAAC,OAAO,EAAE,MAAM,CAAC;AAEjC,QAAA,MAAM,WAAW,GAAG,YAAY,CAAC,MAAK;AAClC,YAAA,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC;AACnC,QAAA,CAAC,CAAC;QAEF,MAAM,UAAU,GAAG,MAAM,gBAAgB,CAAC,OAAO,EAAE,QAAQ,CAAC;QAE5D,OAAO,CAAC,gBAAgB,CAAC,OAAO,EAAE,WAAW,EAAE,YAAY,CAAC;QAC5D,OAAO,CAAC,gBAAgB,CAAC,MAAM,EAAE,UAAU,EAAE,YAAY,CAAC;AAC9D,IAAA,CAAC,CAAC;IAEF,OAAO,CAAC,gBAAgB,CAAC,SAAS,EAAE,aAAa,EAAE,YAAY,CAAC;AAEhE;;AAEG;AACH,IAAA,OAAO,CAAC,gBAAgB,CACpB,MAAM,EACN,MAAM,OAAO,CAAC,mBAAmB,CAAC,SAAS,EAAE,aAAa,CAAC,EAC3D,YAAY,CACf;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/gestures/press/utils/state.mjs b/node_modules/motion-dom/dist/es/gestures/press/utils/state.mjs new file mode 100644 index 0000000..ac86eab --- /dev/null +++ b/node_modules/motion-dom/dist/es/gestures/press/utils/state.mjs @@ -0,0 +1,4 @@ +const isPressing = new WeakSet(); + +export { isPressing }; +//# sourceMappingURL=state.mjs.map diff --git a/node_modules/motion-dom/dist/es/gestures/press/utils/state.mjs.map b/node_modules/motion-dom/dist/es/gestures/press/utils/state.mjs.map new file mode 100644 index 0000000..ee9c7c1 --- /dev/null +++ b/node_modules/motion-dom/dist/es/gestures/press/utils/state.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"state.mjs","sources":["../../../../../src/gestures/press/utils/state.ts"],"sourcesContent":["export const isPressing = new WeakSet()\n"],"names":[],"mappings":"AAAO,MAAM,UAAU,GAAG,IAAI,OAAO;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/gestures/utils/is-node-or-child.mjs b/node_modules/motion-dom/dist/es/gestures/utils/is-node-or-child.mjs new file mode 100644 index 0000000..7cc1da6 --- /dev/null +++ b/node_modules/motion-dom/dist/es/gestures/utils/is-node-or-child.mjs @@ -0,0 +1,21 @@ +/** + * Recursively traverse up the tree to check whether the provided child node + * is the parent or a descendant of it. + * + * @param parent - Element to find + * @param child - Element to test against parent + */ +const isNodeOrChild = (parent, child) => { + if (!child) { + return false; + } + else if (parent === child) { + return true; + } + else { + return isNodeOrChild(parent, child.parentElement); + } +}; + +export { isNodeOrChild }; +//# sourceMappingURL=is-node-or-child.mjs.map diff --git a/node_modules/motion-dom/dist/es/gestures/utils/is-node-or-child.mjs.map b/node_modules/motion-dom/dist/es/gestures/utils/is-node-or-child.mjs.map new file mode 100644 index 0000000..9160375 --- /dev/null +++ b/node_modules/motion-dom/dist/es/gestures/utils/is-node-or-child.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"is-node-or-child.mjs","sources":["../../../../src/gestures/utils/is-node-or-child.ts"],"sourcesContent":["/**\n * Recursively traverse up the tree to check whether the provided child node\n * is the parent or a descendant of it.\n *\n * @param parent - Element to find\n * @param child - Element to test against parent\n */\nexport const isNodeOrChild = (\n parent: Element | null,\n child?: Element | null\n): boolean => {\n if (!child) {\n return false\n } else if (parent === child) {\n return true\n } else {\n return isNodeOrChild(parent, child.parentElement)\n }\n}\n"],"names":[],"mappings":"AAAA;;;;;;AAMG;MACU,aAAa,GAAG,CACzB,MAAsB,EACtB,KAAsB,KACb;IACT,IAAI,CAAC,KAAK,EAAE;AACR,QAAA,OAAO,KAAK;IAChB;AAAO,SAAA,IAAI,MAAM,KAAK,KAAK,EAAE;AACzB,QAAA,OAAO,IAAI;IACf;SAAO;QACH,OAAO,aAAa,CAAC,MAAM,EAAE,KAAK,CAAC,aAAa,CAAC;IACrD;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/gestures/utils/is-primary-pointer.mjs b/node_modules/motion-dom/dist/es/gestures/utils/is-primary-pointer.mjs new file mode 100644 index 0000000..c013d7e --- /dev/null +++ b/node_modules/motion-dom/dist/es/gestures/utils/is-primary-pointer.mjs @@ -0,0 +1,19 @@ +const isPrimaryPointer = (event) => { + if (event.pointerType === "mouse") { + return typeof event.button !== "number" || event.button <= 0; + } + else { + /** + * isPrimary is true for all mice buttons, whereas every touch point + * is regarded as its own input. So subsequent concurrent touch points + * will be false. + * + * Specifically match against false here as incomplete versions of + * PointerEvents in very old browser might have it set as undefined. + */ + return event.isPrimary !== false; + } +}; + +export { isPrimaryPointer }; +//# sourceMappingURL=is-primary-pointer.mjs.map diff --git a/node_modules/motion-dom/dist/es/gestures/utils/is-primary-pointer.mjs.map b/node_modules/motion-dom/dist/es/gestures/utils/is-primary-pointer.mjs.map new file mode 100644 index 0000000..d391a32 --- /dev/null +++ b/node_modules/motion-dom/dist/es/gestures/utils/is-primary-pointer.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"is-primary-pointer.mjs","sources":["../../../../src/gestures/utils/is-primary-pointer.ts"],"sourcesContent":["export const isPrimaryPointer = (event: PointerEvent) => {\n if (event.pointerType === \"mouse\") {\n return typeof event.button !== \"number\" || event.button <= 0\n } else {\n /**\n * isPrimary is true for all mice buttons, whereas every touch point\n * is regarded as its own input. So subsequent concurrent touch points\n * will be false.\n *\n * Specifically match against false here as incomplete versions of\n * PointerEvents in very old browser might have it set as undefined.\n */\n return event.isPrimary !== false\n }\n}\n"],"names":[],"mappings":"AAAO,MAAM,gBAAgB,GAAG,CAAC,KAAmB,KAAI;AACpD,IAAA,IAAI,KAAK,CAAC,WAAW,KAAK,OAAO,EAAE;AAC/B,QAAA,OAAO,OAAO,KAAK,CAAC,MAAM,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,IAAI,CAAC;IAChE;SAAO;AACH;;;;;;;AAOG;AACH,QAAA,OAAO,KAAK,CAAC,SAAS,KAAK,KAAK;IACpC;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/gestures/utils/setup.mjs b/node_modules/motion-dom/dist/es/gestures/utils/setup.mjs new file mode 100644 index 0000000..9505c06 --- /dev/null +++ b/node_modules/motion-dom/dist/es/gestures/utils/setup.mjs @@ -0,0 +1,16 @@ +import { resolveElements } from '../../utils/resolve-elements.mjs'; + +function setupGesture(elementOrSelector, options) { + const elements = resolveElements(elementOrSelector); + const gestureAbortController = new AbortController(); + const eventOptions = { + passive: true, + ...options, + signal: gestureAbortController.signal, + }; + const cancel = () => gestureAbortController.abort(); + return [elements, eventOptions, cancel]; +} + +export { setupGesture }; +//# sourceMappingURL=setup.mjs.map diff --git a/node_modules/motion-dom/dist/es/gestures/utils/setup.mjs.map b/node_modules/motion-dom/dist/es/gestures/utils/setup.mjs.map new file mode 100644 index 0000000..5bfea58 --- /dev/null +++ b/node_modules/motion-dom/dist/es/gestures/utils/setup.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"setup.mjs","sources":["../../../../src/gestures/utils/setup.ts"],"sourcesContent":["import {\n ElementOrSelector,\n resolveElements,\n} from \"../../utils/resolve-elements\"\nimport { EventOptions } from \"../types\"\n\nexport function setupGesture(\n elementOrSelector: ElementOrSelector,\n options: EventOptions\n): [Element[], AddEventListenerOptions, VoidFunction] {\n const elements = resolveElements(elementOrSelector)\n\n const gestureAbortController = new AbortController()\n\n const eventOptions = {\n passive: true,\n ...options,\n signal: gestureAbortController.signal,\n }\n\n const cancel = () => gestureAbortController.abort()\n\n return [elements, eventOptions, cancel]\n}\n"],"names":[],"mappings":";;AAMM,SAAU,YAAY,CACxB,iBAAoC,EACpC,OAAqB,EAAA;AAErB,IAAA,MAAM,QAAQ,GAAG,eAAe,CAAC,iBAAiB,CAAC;AAEnD,IAAA,MAAM,sBAAsB,GAAG,IAAI,eAAe,EAAE;AAEpD,IAAA,MAAM,YAAY,GAAG;AACjB,QAAA,OAAO,EAAE,IAAI;AACb,QAAA,GAAG,OAAO;QACV,MAAM,EAAE,sBAAsB,CAAC,MAAM;KACxC;IAED,MAAM,MAAM,GAAG,MAAM,sBAAsB,CAAC,KAAK,EAAE;AAEnD,IAAA,OAAO,CAAC,QAAQ,EAAE,YAAY,EAAE,MAAM,CAAC;AAC3C;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/index.mjs b/node_modules/motion-dom/dist/es/index.mjs new file mode 100644 index 0000000..b7d94a4 --- /dev/null +++ b/node_modules/motion-dom/dist/es/index.mjs @@ -0,0 +1,176 @@ +export { AsyncMotionValueAnimation } from './animation/AsyncMotionValueAnimation.mjs'; +export { GroupAnimation } from './animation/GroupAnimation.mjs'; +export { GroupAnimationWithThen } from './animation/GroupAnimationWithThen.mjs'; +export { JSAnimation, animateValue } from './animation/JSAnimation.mjs'; +export { NativeAnimation } from './animation/NativeAnimation.mjs'; +export { NativeAnimationExtended } from './animation/NativeAnimationExtended.mjs'; +export { NativeAnimationWrapper } from './animation/NativeAnimationWrapper.mjs'; +export { animationMapKey, getAnimationMap } from './animation/utils/active-animations.mjs'; +export { calcChildStagger } from './animation/utils/calc-child-stagger.mjs'; +export { arc } from './animation/utils/arc.mjs'; +export { getVariableValue, parseCSSVariable } from './animation/utils/css-variables-conversion.mjs'; +export { getDefaultTransition } from './animation/utils/default-transitions.mjs'; +export { getFinalKeyframe } from './animation/keyframes/get-final.mjs'; +export { getValueTransition } from './animation/utils/get-value-transition.mjs'; +export { resolveTransition } from './animation/utils/resolve-transition.mjs'; +export { containsCSSVariable, isCSSVariableName, isCSSVariableToken } from './animation/utils/is-css-variable.mjs'; +export { isTransitionDefined } from './animation/utils/is-transition-defined.mjs'; +export { makeAnimationInstant } from './animation/utils/make-animation-instant.mjs'; +export { animateMotionValue } from './animation/interfaces/motion-value.mjs'; +export { animateVisualElement } from './animation/interfaces/visual-element.mjs'; +export { animateTarget } from './animation/interfaces/visual-element-target.mjs'; +export { animateVariant } from './animation/interfaces/visual-element-variant.mjs'; +export { optimizedAppearDataAttribute, optimizedAppearDataId } from './animation/optimized-appear/data-id.mjs'; +export { getOptimisedAppearId } from './animation/optimized-appear/get-appear-id.mjs'; +export { inertia } from './animation/generators/inertia.mjs'; +export { defaultEasing, keyframes } from './animation/generators/keyframes.mjs'; +export { spring } from './animation/generators/spring.mjs'; +export { calcGeneratorDuration, maxGeneratorDuration } from './animation/generators/utils/calc-duration.mjs'; +export { createGeneratorEasing } from './animation/generators/utils/create-generator-easing.mjs'; +export { isGenerator } from './animation/generators/utils/is-generator.mjs'; +export { DOMKeyframesResolver } from './animation/keyframes/DOMKeyframesResolver.mjs'; +export { KeyframeResolver, flushKeyframeResolvers } from './animation/keyframes/KeyframesResolver.mjs'; +export { defaultOffset } from './animation/keyframes/offsets/default.mjs'; +export { fillOffset } from './animation/keyframes/offsets/fill.mjs'; +export { convertOffsetToTimes } from './animation/keyframes/offsets/time.mjs'; +export { applyPxDefaults } from './animation/keyframes/utils/apply-px-defaults.mjs'; +export { fillWildcards } from './animation/keyframes/utils/fill-wildcards.mjs'; +export { cubicBezierAsString } from './animation/waapi/easing/cubic-bezier.mjs'; +export { isWaapiSupportedEasing } from './animation/waapi/easing/is-supported.mjs'; +export { mapEasingToNativeEasing } from './animation/waapi/easing/map-easing.mjs'; +export { supportedWaapiEasing } from './animation/waapi/easing/supported.mjs'; +export { startWaapiAnimation } from './animation/waapi/start-waapi-animation.mjs'; +export { supportsPartialKeyframes } from './animation/waapi/supports/partial-keyframes.mjs'; +export { supportsBrowserAnimation } from './animation/waapi/supports/waapi.mjs'; +export { acceleratedValues } from './animation/waapi/utils/accelerated-values.mjs'; +export { applyGeneratorOptions } from './animation/waapi/utils/apply-generator.mjs'; +export { generateLinearEasing } from './animation/waapi/utils/linear.mjs'; +export { addAttrValue, attrEffect } from './effects/attr/index.mjs'; +export { propEffect } from './effects/prop/index.mjs'; +export { addStyleValue, styleEffect } from './effects/style/index.mjs'; +export { svgEffect } from './effects/svg/index.mjs'; +export { createRenderBatcher } from './frameloop/batcher.mjs'; +export { cancelMicrotask, microtask } from './frameloop/microtask.mjs'; +export { time } from './frameloop/sync-time.mjs'; +export { isDragActive, isDragging } from './gestures/drag/state/is-active.mjs'; +export { setDragLock } from './gestures/drag/state/set-active.mjs'; +export { hover } from './gestures/hover.mjs'; +export { press } from './gestures/press/index.mjs'; +export { isElementKeyboardAccessible, isElementTextInput } from './gestures/press/utils/is-keyboard-accessible.mjs'; +export { isNodeOrChild } from './gestures/utils/is-node-or-child.mjs'; +export { isPrimaryPointer } from './gestures/utils/is-primary-pointer.mjs'; +export { defaultTransformValue, parseValueFromTransform, readTransformValue } from './render/dom/parse-transform.mjs'; +export { getComputedStyle } from './render/dom/style-computed.mjs'; +export { setStyle } from './render/dom/style-set.mjs'; +export { isKeyframesTarget } from './render/utils/is-keyframes-target.mjs'; +export { positionalKeys } from './render/utils/keys-position.mjs'; +export { transformPropOrder, transformProps } from './render/utils/keys-transform.mjs'; +export { resize } from './resize/index.mjs'; +export { observeTimeline } from './scroll/observe.mjs'; +export { recordStats } from './stats/index.mjs'; +export { statsBuffer } from './stats/buffer.mjs'; +export { interpolate } from './utils/interpolate.mjs'; +export { isHTMLElement } from './utils/is-html-element.mjs'; +export { isSVGElement } from './utils/is-svg-element.mjs'; +export { isSVGSVGElement } from './utils/is-svg-svg-element.mjs'; +export { mix } from './utils/mix/index.mjs'; +export { mixColor, mixLinearColor } from './utils/mix/color.mjs'; +export { getMixer, mixArray, mixComplex, mixObject } from './utils/mix/complex.mjs'; +export { mixImmediate } from './utils/mix/immediate.mjs'; +export { mixNumber } from './utils/mix/number.mjs'; +export { invisibleValues, mixVisibility } from './utils/mix/visibility.mjs'; +export { resolveElements } from './utils/resolve-elements.mjs'; +export { getOriginIndex, stagger } from './utils/stagger.mjs'; +export { supportsFlags } from './utils/supports/flags.mjs'; +export { supportsLinearEasing } from './utils/supports/linear-easing.mjs'; +export { supportsScrollTimeline, supportsViewTimeline } from './utils/supports/scroll-timeline.mjs'; +export { transform } from './utils/transform.mjs'; +export { MotionValue, collectMotionValues, motionValue } from './value/index.mjs'; +export { attachFollow, followValue } from './value/follow-value.mjs'; +export { mapValue } from './value/map-value.mjs'; +export { attachSpring, springValue } from './value/spring-value.mjs'; +export { transformValue } from './value/transform-value.mjs'; +export { color } from './value/types/color/index.mjs'; +export { hex } from './value/types/color/hex.mjs'; +export { hsla } from './value/types/color/hsla.mjs'; +export { hslaToRgba } from './value/types/color/hsla-to-rgba.mjs'; +export { rgbUnit, rgba } from './value/types/color/rgba.mjs'; +export { analyseComplexValue, complex } from './value/types/complex/index.mjs'; +export { dimensionValueTypes, findDimensionValueType } from './value/types/dimensions.mjs'; +export { defaultValueTypes, getDefaultValueType } from './value/types/maps/defaults.mjs'; +export { numberValueTypes } from './value/types/maps/number.mjs'; +export { transformValueTypes } from './value/types/maps/transform.mjs'; +export { alpha, number, scale } from './value/types/numbers/index.mjs'; +export { degrees, percent, progressPercentage, px, vh, vw } from './value/types/numbers/units.mjs'; +export { testValueType } from './value/types/test.mjs'; +export { getAnimatableNone } from './value/types/utils/animatable-none.mjs'; +export { findValueType } from './value/types/utils/find.mjs'; +export { getValueAsType } from './value/types/utils/get-as-type.mjs'; +export { isMotionValue } from './value/utils/is-motion-value.mjs'; +export { addValueToWillChange } from './value/will-change/add-will-change.mjs'; +export { isWillChangeMotionValue } from './value/will-change/is.mjs'; +export { ViewTransitionBuilder, animateView } from './view/index.mjs'; +export { getViewAnimationLayerInfo } from './view/utils/get-layer-info.mjs'; +export { getViewAnimations } from './view/utils/get-view-animations.mjs'; +export { DOMVisualElement } from './render/dom/DOMVisualElement.mjs'; +export { Feature } from './render/Feature.mjs'; +export { HTMLVisualElement } from './render/html/HTMLVisualElement.mjs'; +export { ObjectVisualElement } from './render/object/ObjectVisualElement.mjs'; +export { visualElementStore } from './render/store.mjs'; +export { SVGVisualElement } from './render/svg/SVGVisualElement.mjs'; +export { VisualElement, getFeatureDefinitions, setFeatureDefinitions } from './render/VisualElement.mjs'; +export { checkVariantsDidChange, createAnimationState } from './render/utils/animation-state.mjs'; +export { getVariantContext } from './render/utils/get-variant-context.mjs'; +export { isAnimationControls } from './render/utils/is-animation-controls.mjs'; +export { isControllingVariants, isVariantNode } from './render/utils/is-controlling-variants.mjs'; +export { isForcedMotionValue } from './render/utils/is-forced-motion-value.mjs'; +export { isVariantLabel } from './render/utils/is-variant-label.mjs'; +export { updateMotionValuesFromProps } from './render/utils/motion-values.mjs'; +export { resolveVariant } from './render/utils/resolve-dynamic-variants.mjs'; +export { resolveVariantFromProps } from './render/utils/resolve-variants.mjs'; +export { setTarget } from './render/utils/setters.mjs'; +export { variantPriorityOrder, variantProps } from './render/utils/variant-props.mjs'; +export { initPrefersReducedMotion } from './render/utils/reduced-motion/index.mjs'; +export { convertBoundingBoxToBox, convertBoxToBoundingBox, transformBoxPoints } from './projection/geometry/conversion.mjs'; +export { copyAxisDeltaInto, copyAxisInto, copyBoxInto } from './projection/geometry/copy.mjs'; +export { applyAxisDelta, applyBoxDelta, applyPointDelta, applyTreeDeltas, scalePoint, transformAxis, transformBox, translateAxis } from './projection/geometry/delta-apply.mjs'; +export { calcAxisDelta, calcBoxDelta, calcLength, calcRelativeAxis, calcRelativeAxisPosition, calcRelativeBox, calcRelativePosition, isNear } from './projection/geometry/delta-calc.mjs'; +export { removeAxisDelta, removeAxisTransforms, removeBoxTransforms, removePointDelta } from './projection/geometry/delta-remove.mjs'; +export { createAxis, createAxisDelta, createBox, createDelta } from './projection/geometry/models.mjs'; +export { aspectRatio, axisDeltaEquals, axisEquals, axisEqualsRounded, boxEquals, boxEqualsRounded, isDeltaZero } from './projection/geometry/utils.mjs'; +export { eachAxis } from './projection/utils/each-axis.mjs'; +export { has2DTranslate, hasScale, hasTransform } from './projection/utils/has-transform.mjs'; +export { measurePageBox, measureViewportBox } from './projection/utils/measure.mjs'; +export { correctBorderRadius, pixelsToPercent } from './projection/styles/scale-border-radius.mjs'; +export { correctBoxShadow } from './projection/styles/scale-box-shadow.mjs'; +export { buildProjectionTransform } from './projection/styles/transform.mjs'; +export { mixValues } from './projection/animation/mix-values.mjs'; +export { animateSingleValue } from './animation/animate/single-value.mjs'; +export { addDomEvent } from './events/add-dom-event.mjs'; +export { compareByDepth } from './projection/utils/compare-by-depth.mjs'; +export { FlatTree } from './projection/utils/flat-tree.mjs'; +export { delay, delayInSeconds } from './utils/delay.mjs'; +export { resolveMotionValue } from './value/utils/resolve-motion-value.mjs'; +export { cleanDirtyNodes, createProjectionNode, propagateDirtyNodes } from './projection/node/create-projection-node.mjs'; +export { DocumentProjectionNode } from './projection/node/DocumentProjectionNode.mjs'; +export { nodeGroup } from './projection/node/group.mjs'; +export { HTMLProjectionNode, rootProjectionNode } from './projection/node/HTMLProjectionNode.mjs'; +export { globalProjectionState } from './projection/node/state.mjs'; +export { NodeStack } from './projection/shared/stack.mjs'; +export { camelToDash } from './render/dom/utils/camel-to-dash.mjs'; +export { buildHTMLStyles } from './render/html/utils/build-styles.mjs'; +export { buildTransform } from './render/html/utils/build-transform.mjs'; +export { renderHTML } from './render/html/utils/render.mjs'; +export { scrapeMotionValuesFromProps as scrapeHTMLMotionValuesFromProps } from './render/html/utils/scrape-motion-values.mjs'; +export { buildSVGAttrs } from './render/svg/utils/build-attrs.mjs'; +export { camelCaseAttributes } from './render/svg/utils/camel-case-attrs.mjs'; +export { isSVGTag } from './render/svg/utils/is-svg-tag.mjs'; +export { buildSVGPath } from './render/svg/utils/path.mjs'; +export { renderSVG } from './render/svg/utils/render.mjs'; +export { scrapeMotionValuesFromProps as scrapeSVGMotionValuesFromProps } from './render/svg/utils/scrape-motion-values.mjs'; +export { LayoutAnimationBuilder, parseAnimateLayoutArgs } from './layout/LayoutAnimationBuilder.mjs'; +export { cancelSync, sync } from './frameloop/index-legacy.mjs'; +export { addScaleCorrector, scaleCorrectors } from './projection/styles/scale-correction.mjs'; +export { cancelFrame, frame, frameData, frameSteps } from './frameloop/frame.mjs'; +export { hasReducedMotionListener, prefersReducedMotion } from './render/utils/reduced-motion/state.mjs'; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/motion-dom/dist/es/index.mjs.map b/node_modules/motion-dom/dist/es/index.mjs.map new file mode 100644 index 0000000..0dd9c36 --- /dev/null +++ b/node_modules/motion-dom/dist/es/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/layout/LayoutAnimationBuilder.mjs b/node_modules/motion-dom/dist/es/layout/LayoutAnimationBuilder.mjs new file mode 100644 index 0000000..1a7c533 --- /dev/null +++ b/node_modules/motion-dom/dist/es/layout/LayoutAnimationBuilder.mjs @@ -0,0 +1,354 @@ +import { clamp } from 'motion-utils'; +import { GroupAnimation } from '../animation/GroupAnimation.mjs'; +import { microtask } from '../frameloop/microtask.mjs'; +import { time } from '../frameloop/sync-time.mjs'; +import { HTMLProjectionNode } from '../projection/node/HTMLProjectionNode.mjs'; +import { HTMLVisualElement } from '../render/html/HTMLVisualElement.mjs'; +import { visualElementStore } from '../render/store.mjs'; +import { hasTransform } from '../projection/utils/has-transform.mjs'; +import { resolveElements } from '../utils/resolve-elements.mjs'; +import { frameData, frameSteps } from '../frameloop/frame.mjs'; + +const layoutSelector = "[data-layout],[data-layout-id]"; +/** + * All imperatively-created projection nodes live in one persistent tree, + * shared across animateLayout() calls (and with any React-created nodes, + * via the singleton document root). Keyed by element for reuse. + */ +const layoutNodes = new WeakMap(); +/** + * Builders created within the same synchronous tick are flushed together + * as a single "commit": every node is snapshotted before any updateDom + * runs, mirroring React batching renders from different parts of the tree. + */ +let pendingBuilders; +function collectLayoutElements(scope) { + const elements = []; + if (scope instanceof HTMLElement && scope.matches(layoutSelector)) { + elements.push(scope); + } + scope.querySelectorAll(layoutSelector).forEach((element) => { + if (element instanceof HTMLElement) + elements.push(element); + }); + return elements; +} +/** + * Process any work scheduled on the frameloop now. A previous animation + * may have been seeked while paused (controls.time = x) without a frame + * having rendered it - we must materialise that state into the DOM + * before taking snapshots. + */ +function flushPendingFrame() { + if (frameData.isProcessing) + return; + const now = time.now(); + frameData.delta = clamp(0, 1000 / 60, now - frameData.timestamp); + frameData.timestamp = now; + frameData.isProcessing = true; + frameSteps.update.process(frameData); + frameSteps.preRender.process(frameData); + frameSteps.render.process(frameData); + frameData.isProcessing = false; +} +function getProjectionParent(element) { + let ancestor = element.parentElement; + while (ancestor) { + const node = layoutNodes.get(ancestor); + if (node && node.instance) + return node; + ancestor = ancestor.parentElement; + } + return undefined; +} +function createVisualElement() { + return new HTMLVisualElement({ + props: {}, + presenceContext: null, + visualState: { + latestValues: {}, + renderState: { + transform: {}, + transformOrigin: {}, + style: {}, + vars: {}, + }, + }, + }, { allowProjection: true }); +} +function readNodeOptions(element, transition) { + const layoutAttr = element.getAttribute("data-layout"); + const layoutId = element.getAttribute("data-layout-id") ?? undefined; + return { + layoutId, + layout: layoutAttr !== null ? true : undefined, + animationType: (!layoutAttr || layoutAttr === "true" + ? "both" + : layoutAttr), + transition, + }; +} +function prepareNode(element, transition) { + let node = layoutNodes.get(element); + if (!node) { + let visualElement = visualElementStore.get(element); + if (!visualElement) + visualElement = createVisualElement(); + /** + * A first-time element may carry a projection transform in its + * inline style (e.g. it was cloned from an element mid-animation). + * That transform isn't tracked in latestValues so the engine can't + * reset it before measuring - clear it now so the first layout + * measurement isn't inflated. + */ + if (element.style.transform && + !hasTransform(visualElement.latestValues)) { + element.style.transform = ""; + } + node = new HTMLProjectionNode(visualElement.latestValues, getProjectionParent(element)); + visualElement.projection = node; + node.setOptions({ + ...readNodeOptions(element, transition), + visualElement, + }); + node.mount(element); + layoutNodes.set(element, node); + } + else { + node.setOptions(readNodeOptions(element, transition)); + } + node.isPresent = true; + if (node.options.onExitComplete) { + node.setOptions({ onExitComplete: undefined }); + } + return node; +} +function sortDocumentOrder(elements) { + return [...elements].sort((a, b) => a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1); +} +function dropNode(element, node) { + node.setOptions({ onExitComplete: undefined }); + /** + * Stop any lingering animation so it can't leak into future updates. + * A follow node can share its currentAnimation with a surviving lead + * (via resumingFrom), in which case it isn't ours to stop. + */ + const stack = node.getStack(); + if (!stack || node.isLead()) + node.currentAnimation?.stop(); + node.unmount(); + layoutNodes.delete(element); +} +function flushPendingBuilders() { + const builders = pendingBuilders; + pendingBuilders = undefined; + flushPendingFrame(); + /** + * Discover and mount every node across all builders before snapshotting + * any of them. Mounting during an active update flags isLayoutDirty, + * which would make that node's own willUpdate skip its snapshot. + * Document order guarantees ancestors mount before descendants, even + * when they're discovered by different builders. + */ + const targets = new Map(); + for (const builder of builders) { + for (const element of builder.collectTargets()) { + const owners = targets.get(element); + owners ? owners.push(builder) : targets.set(element, [builder]); + } + } + const union = new Map(); + for (const element of sortDocumentOrder(targets.keys())) { + const owners = targets.get(element); + const node = prepareNode(element, owners[owners.length - 1].transitionFor(element)); + for (const owner of owners) + owner.adopt(element, node); + union.set(element, node); + } + union.forEach((node) => { + node.isLayoutDirty = false; + node.willUpdate(); + }); + const updatePromises = []; + for (const builder of builders) { + const result = builder.runUpdate(); + if (result) + updatePromises.push(result); + } + const commit = () => { + /** + * Process all additions before any removals so that, even across + * builders, a removed member knows whether a replacement with the + * same layoutId was added in this commit. + */ + const newMemberIds = new Set(); + for (const builder of builders) { + builder.reconcileAdditions(newMemberIds); + } + for (const builder of builders) { + builder.reconcileRemovals(newMemberIds); + } + let root; + union.forEach((node) => (root || (root = node.root))); + for (const builder of builders) + root || (root = builder.getRoot()); + root?.didUpdate(); + /** + * The root flushes the update on a microtask, synchronously + * processing the frame that creates the layout animations. Collect + * them in a later microtask step of the same pass. + */ + microtask.render(() => { + for (const builder of builders) + builder.finalize(); + }); + }; + updatePromises.length ? Promise.all(updatePromises).then(commit) : commit(); +} +class LayoutAnimationBuilder { + constructor(scope, updateDom, defaultOptions) { + this.scope = scope; + this.updateDom = updateDom; + this.defaultOptions = defaultOptions; + this.sharedTransitions = new Map(); + this.notifyReady = () => { }; + this.rejectReady = () => { }; + this.tracked = new Map(); + this.restorePoints = new Map(); + this.readyPromise = new Promise((resolve, reject) => { + this.notifyReady = resolve; + this.rejectReady = reject; + }); + if (!pendingBuilders) { + pendingBuilders = []; + queueMicrotask(flushPendingBuilders); + } + pendingBuilders.push(this); + } + shared(id, transition) { + this.sharedTransitions.set(id, transition); + return this; + } + then(resolve, reject) { + return this.readyPromise.then(resolve, reject); + } + transitionFor(element) { + const layoutId = element.getAttribute("data-layout-id"); + return ((layoutId && this.sharedTransitions.get(layoutId)) || + this.defaultOptions); + } + adopt(element, node) { + this.tracked.set(element, node); + this.restorePoints.set(element, { + parent: element.parentElement, + next: element.nextSibling, + }); + } + collectTargets() { + return collectLayoutElements(this.scope); + } + runUpdate() { + try { + const result = this.updateDom(); + if (result && typeof result.then === "function") { + return result.then(undefined, (error) => { + this.updateError = error; + }); + } + } + catch (error) { + this.updateError = error; + } + return undefined; + } + reconcileAdditions(newMemberIds) { + for (const element of collectLayoutElements(this.scope)) { + if (this.tracked.has(element)) + continue; + const node = prepareNode(element, this.transitionFor(element)); + this.adopt(element, node); + node.options.layoutId && newMemberIds.add(node.options.layoutId); + } + } + reconcileRemovals(newMemberIds) { + this.tracked.forEach((node, element) => { + if (element.isConnected) + return; + const restore = this.restorePoints.get(element); + this.restorePoints.delete(element); + const { layoutId } = node.options; + const stack = node.getStack(); + const hasSurvivor = stack && + stack.members.some((member) => member !== node && + member.instance + ?.isConnected); + /** + * A removed lead with a surviving stack member - and no + * replacement member added this commit - runs an exit + * crossfade: restore the element to its old position in the + * DOM, relegate it and let the survivor take over. It's + * removed again once the animation completes. + */ + if (layoutId && + node.isLead() && + hasSurvivor && + !newMemberIds.has(layoutId)) { + if (restore && restore.parent.isConnected) { + restore.parent.insertBefore(element, restore.next && restore.next.parentNode === restore.parent + ? restore.next + : null); + node.isPresent = false; + node.setOptions({ + onExitComplete: () => { + element.remove(); + dropNode(element, node); + }, + }); + if (node.relegate()) + return; + element.remove(); + } + } + dropNode(element, node); + this.tracked.delete(element); + }); + } + getRoot() { + let root; + this.tracked.forEach((node) => (root || (root = node.root))); + return root; + } + finalize() { + if (this.updateError) { + this.rejectReady(this.updateError); + return; + } + const animations = new Set(); + this.tracked.forEach((node) => { + if (node.instance && node.currentAnimation) { + animations.add(node.currentAnimation); + } + }); + this.notifyReady(new GroupAnimation([...animations])); + } +} +function parseAnimateLayoutArgs(scopeOrUpdateDom, updateDomOrOptions, options) { + if (typeof scopeOrUpdateDom === "function") { + return { + scope: document, + updateDom: scopeOrUpdateDom, + defaultOptions: updateDomOrOptions, + }; + } + const scope = scopeOrUpdateDom instanceof Document + ? scopeOrUpdateDom + : resolveElements(scopeOrUpdateDom)[0] ?? document; + return { + scope, + updateDom: updateDomOrOptions, + defaultOptions: options, + }; +} + +export { LayoutAnimationBuilder, parseAnimateLayoutArgs }; +//# sourceMappingURL=LayoutAnimationBuilder.mjs.map diff --git a/node_modules/motion-dom/dist/es/layout/LayoutAnimationBuilder.mjs.map b/node_modules/motion-dom/dist/es/layout/LayoutAnimationBuilder.mjs.map new file mode 100644 index 0000000..7189e3f --- /dev/null +++ b/node_modules/motion-dom/dist/es/layout/LayoutAnimationBuilder.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"LayoutAnimationBuilder.mjs","sources":["../../../src/layout/LayoutAnimationBuilder.ts"],"sourcesContent":["import { clamp } from \"motion-utils\"\nimport { GroupAnimation } from \"../animation/GroupAnimation\"\nimport type { AnimationOptions, Transition } from \"../animation/types\"\nimport { frameData, frameSteps } from \"../frameloop\"\nimport { microtask } from \"../frameloop/microtask\"\nimport { time } from \"../frameloop/sync-time\"\nimport { HTMLProjectionNode } from \"../projection/node/HTMLProjectionNode\"\nimport type { IProjectionNode } from \"../projection/node/types\"\nimport { HTMLVisualElement } from \"../render/html/HTMLVisualElement\"\nimport { visualElementStore } from \"../render/store\"\nimport { hasTransform } from \"../projection/utils/has-transform\"\nimport {\n resolveElements,\n type ElementOrSelector,\n} from \"../utils/resolve-elements\"\n\ntype LayoutAnimationScope = Element | Document\ntype LayoutBuilderResolve = (animation: GroupAnimation) => void\ntype LayoutBuilderReject = (error: unknown) => void\n\ninterface RestorePoint {\n parent: Element\n next: ChildNode | null\n}\n\nconst layoutSelector = \"[data-layout],[data-layout-id]\"\n\n/**\n * All imperatively-created projection nodes live in one persistent tree,\n * shared across animateLayout() calls (and with any React-created nodes,\n * via the singleton document root). Keyed by element for reuse.\n */\nconst layoutNodes = new WeakMap()\n\n/**\n * Builders created within the same synchronous tick are flushed together\n * as a single \"commit\": every node is snapshotted before any updateDom\n * runs, mirroring React batching renders from different parts of the tree.\n */\nlet pendingBuilders: LayoutAnimationBuilder[] | undefined\n\nfunction collectLayoutElements(scope: LayoutAnimationScope): HTMLElement[] {\n const elements: HTMLElement[] = []\n\n if (scope instanceof HTMLElement && scope.matches(layoutSelector)) {\n elements.push(scope)\n }\n\n scope.querySelectorAll(layoutSelector).forEach((element) => {\n if (element instanceof HTMLElement) elements.push(element)\n })\n\n return elements\n}\n\n/**\n * Process any work scheduled on the frameloop now. A previous animation\n * may have been seeked while paused (controls.time = x) without a frame\n * having rendered it - we must materialise that state into the DOM\n * before taking snapshots.\n */\nfunction flushPendingFrame() {\n if (frameData.isProcessing) return\n\n const now = time.now()\n frameData.delta = clamp(0, 1000 / 60, now - frameData.timestamp)\n frameData.timestamp = now\n frameData.isProcessing = true\n frameSteps.update.process(frameData)\n frameSteps.preRender.process(frameData)\n frameSteps.render.process(frameData)\n frameData.isProcessing = false\n}\n\nfunction getProjectionParent(element: Element): IProjectionNode | undefined {\n let ancestor = element.parentElement\n while (ancestor) {\n const node = layoutNodes.get(ancestor)\n if (node && node.instance) return node\n ancestor = ancestor.parentElement\n }\n return undefined\n}\n\nfunction createVisualElement() {\n return new HTMLVisualElement(\n {\n props: {},\n presenceContext: null,\n visualState: {\n latestValues: {},\n renderState: {\n transform: {},\n transformOrigin: {},\n style: {},\n vars: {},\n },\n },\n },\n { allowProjection: true }\n )\n}\n\nfunction readNodeOptions(element: HTMLElement, transition?: Transition) {\n const layoutAttr = element.getAttribute(\"data-layout\")\n const layoutId = element.getAttribute(\"data-layout-id\") ?? undefined\n\n return {\n layoutId,\n layout: layoutAttr !== null ? true : undefined,\n animationType: (!layoutAttr || layoutAttr === \"true\"\n ? \"both\"\n : layoutAttr) as \"both\",\n transition,\n }\n}\n\nfunction prepareNode(\n element: HTMLElement,\n transition?: Transition\n): IProjectionNode {\n let node = layoutNodes.get(element)\n\n if (!node) {\n let visualElement = visualElementStore.get(element) as\n | HTMLVisualElement\n | undefined\n\n if (!visualElement) visualElement = createVisualElement()\n\n /**\n * A first-time element may carry a projection transform in its\n * inline style (e.g. it was cloned from an element mid-animation).\n * That transform isn't tracked in latestValues so the engine can't\n * reset it before measuring - clear it now so the first layout\n * measurement isn't inflated.\n */\n if (\n element.style.transform &&\n !hasTransform(visualElement.latestValues)\n ) {\n element.style.transform = \"\"\n }\n\n node = new HTMLProjectionNode(\n visualElement.latestValues,\n getProjectionParent(element)\n )\n visualElement.projection = node\n\n node.setOptions({\n ...readNodeOptions(element, transition),\n visualElement,\n })\n node.mount(element)\n layoutNodes.set(element, node)\n } else {\n node.setOptions(readNodeOptions(element, transition))\n }\n\n node.isPresent = true\n if (node.options.onExitComplete) {\n node.setOptions({ onExitComplete: undefined })\n }\n\n return node\n}\n\nfunction sortDocumentOrder(elements: Iterable) {\n return [...elements].sort((a, b) =>\n a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1\n )\n}\n\nfunction dropNode(element: Element, node: IProjectionNode) {\n node.setOptions({ onExitComplete: undefined })\n\n /**\n * Stop any lingering animation so it can't leak into future updates.\n * A follow node can share its currentAnimation with a surviving lead\n * (via resumingFrom), in which case it isn't ours to stop.\n */\n const stack = node.getStack()\n if (!stack || node.isLead()) node.currentAnimation?.stop()\n\n node.unmount()\n layoutNodes.delete(element)\n}\n\nfunction flushPendingBuilders() {\n const builders = pendingBuilders!\n pendingBuilders = undefined\n\n flushPendingFrame()\n\n /**\n * Discover and mount every node across all builders before snapshotting\n * any of them. Mounting during an active update flags isLayoutDirty,\n * which would make that node's own willUpdate skip its snapshot.\n * Document order guarantees ancestors mount before descendants, even\n * when they're discovered by different builders.\n */\n const targets = new Map()\n for (const builder of builders) {\n for (const element of builder.collectTargets()) {\n const owners = targets.get(element)\n owners ? owners.push(builder) : targets.set(element, [builder])\n }\n }\n\n const union = new Map()\n for (const element of sortDocumentOrder(targets.keys())) {\n const owners = targets.get(element)!\n const node = prepareNode(\n element,\n owners[owners.length - 1].transitionFor(element)\n )\n for (const owner of owners) owner.adopt(element, node)\n union.set(element, node)\n }\n\n union.forEach((node) => {\n node.isLayoutDirty = false\n node.willUpdate()\n })\n\n const updatePromises: Promise[] = []\n for (const builder of builders) {\n const result = builder.runUpdate()\n if (result) updatePromises.push(result)\n }\n\n const commit = () => {\n /**\n * Process all additions before any removals so that, even across\n * builders, a removed member knows whether a replacement with the\n * same layoutId was added in this commit.\n */\n const newMemberIds = new Set()\n for (const builder of builders) {\n builder.reconcileAdditions(newMemberIds)\n }\n for (const builder of builders) {\n builder.reconcileRemovals(newMemberIds)\n }\n\n let root: IProjectionNode | undefined\n union.forEach((node) => (root ||= node.root))\n for (const builder of builders) root ||= builder.getRoot()\n\n root?.didUpdate()\n\n /**\n * The root flushes the update on a microtask, synchronously\n * processing the frame that creates the layout animations. Collect\n * them in a later microtask step of the same pass.\n */\n microtask.render(() => {\n for (const builder of builders) builder.finalize()\n })\n }\n\n updatePromises.length ? Promise.all(updatePromises).then(commit) : commit()\n}\n\nexport class LayoutAnimationBuilder {\n private sharedTransitions = new Map()\n\n private notifyReady: LayoutBuilderResolve = () => {}\n private rejectReady: LayoutBuilderReject = () => {}\n private readyPromise: Promise\n\n private tracked = new Map()\n private restorePoints = new Map()\n private updateError: unknown\n\n constructor(\n private scope: LayoutAnimationScope,\n private updateDom: () => void | Promise,\n private defaultOptions?: AnimationOptions\n ) {\n this.readyPromise = new Promise((resolve, reject) => {\n this.notifyReady = resolve\n this.rejectReady = reject\n })\n\n if (!pendingBuilders) {\n pendingBuilders = []\n queueMicrotask(flushPendingBuilders)\n }\n pendingBuilders.push(this)\n }\n\n shared(id: string, transition: AnimationOptions): this {\n this.sharedTransitions.set(id, transition)\n return this\n }\n\n then(resolve: LayoutBuilderResolve, reject?: LayoutBuilderReject) {\n return this.readyPromise.then(resolve, reject)\n }\n\n transitionFor(element: HTMLElement): Transition | undefined {\n const layoutId = element.getAttribute(\"data-layout-id\")\n return ((layoutId && this.sharedTransitions.get(layoutId)) ||\n this.defaultOptions) as Transition | undefined\n }\n\n adopt(element: HTMLElement, node: IProjectionNode) {\n this.tracked.set(element, node)\n this.restorePoints.set(element, {\n parent: element.parentElement!,\n next: element.nextSibling,\n })\n }\n\n collectTargets() {\n return collectLayoutElements(this.scope)\n }\n\n runUpdate(): Promise | undefined {\n try {\n const result = this.updateDom()\n if (result && typeof result.then === \"function\") {\n return result.then(undefined, (error: unknown) => {\n this.updateError = error\n })\n }\n } catch (error) {\n this.updateError = error\n }\n return undefined\n }\n\n reconcileAdditions(newMemberIds: Set) {\n for (const element of collectLayoutElements(this.scope)) {\n if (this.tracked.has(element)) continue\n const node = prepareNode(element, this.transitionFor(element))\n this.adopt(element, node)\n node.options.layoutId && newMemberIds.add(node.options.layoutId)\n }\n }\n\n reconcileRemovals(newMemberIds: Set) {\n this.tracked.forEach((node, element) => {\n if (element.isConnected) return\n\n const restore = this.restorePoints.get(element)\n this.restorePoints.delete(element)\n\n const { layoutId } = node.options\n const stack = node.getStack()\n const hasSurvivor =\n stack &&\n stack.members.some(\n (member) =>\n member !== node &&\n (member.instance as HTMLElement | undefined)\n ?.isConnected\n )\n\n /**\n * A removed lead with a surviving stack member - and no\n * replacement member added this commit - runs an exit\n * crossfade: restore the element to its old position in the\n * DOM, relegate it and let the survivor take over. It's\n * removed again once the animation completes.\n */\n if (\n layoutId &&\n node.isLead() &&\n hasSurvivor &&\n !newMemberIds.has(layoutId)\n ) {\n if (restore && restore.parent.isConnected) {\n restore.parent.insertBefore(\n element,\n restore.next && restore.next.parentNode === restore.parent\n ? restore.next\n : null\n )\n node.isPresent = false\n node.setOptions({\n onExitComplete: () => {\n element.remove()\n dropNode(element, node)\n },\n })\n if (node.relegate()) return\n\n element.remove()\n }\n }\n\n dropNode(element, node)\n this.tracked.delete(element)\n })\n }\n\n getRoot(): IProjectionNode | undefined {\n let root: IProjectionNode | undefined\n this.tracked.forEach((node) => (root ||= node.root))\n return root\n }\n\n finalize() {\n if (this.updateError) {\n this.rejectReady(this.updateError)\n return\n }\n\n const animations = new Set()\n this.tracked.forEach((node) => {\n if (node.instance && node.currentAnimation) {\n animations.add(node.currentAnimation)\n }\n })\n\n this.notifyReady(new GroupAnimation([...animations]))\n }\n}\n\nexport function parseAnimateLayoutArgs(\n scopeOrUpdateDom: ElementOrSelector | (() => void),\n updateDomOrOptions?: (() => void) | AnimationOptions,\n options?: AnimationOptions\n): {\n scope: Element | Document\n updateDom: () => void\n defaultOptions?: AnimationOptions\n} {\n if (typeof scopeOrUpdateDom === \"function\") {\n return {\n scope: document,\n updateDom: scopeOrUpdateDom,\n defaultOptions: updateDomOrOptions as AnimationOptions | undefined,\n }\n }\n\n const scope =\n scopeOrUpdateDom instanceof Document\n ? scopeOrUpdateDom\n : resolveElements(scopeOrUpdateDom)[0] ?? document\n\n return {\n scope,\n updateDom: updateDomOrOptions as () => void,\n defaultOptions: options,\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAyBA,MAAM,cAAc,GAAG,gCAAgC;AAEvD;;;;AAIG;AACH,MAAM,WAAW,GAAG,IAAI,OAAO,EAA4B;AAE3D;;;;AAIG;AACH,IAAI,eAAqD;AAEzD,SAAS,qBAAqB,CAAC,KAA2B,EAAA;IAC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/mix-values.mjs b/node_modules/motion-dom/dist/es/projection/animation/mix-values.mjs new file mode 100644 index 0000000..c336f1f --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/animation/mix-values.mjs @@ -0,0 +1,67 @@ +import { mixNumber } from '../../utils/mix/number.mjs'; +import { percent, px } from '../../value/types/numbers/units.mjs'; +import { progress, circOut, noop } from 'motion-utils'; +import { cornerRadiusProps } from '../../utils/border-radius.mjs'; + +const numBorders = cornerRadiusProps.length; +const asNumber = (value) => typeof value === "string" ? parseFloat(value) : value; +const isPx = (value) => typeof value === "number" || px.test(value); +function mixValues(target, follow, lead, progress, shouldCrossfadeOpacity, isOnlyMember) { + if (shouldCrossfadeOpacity) { + target.opacity = mixNumber(0, lead.opacity ?? 1, easeCrossfadeIn(progress)); + target.opacityExit = mixNumber(follow.opacity ?? 1, 0, easeCrossfadeOut(progress)); + } + else if (isOnlyMember) { + target.opacity = mixNumber(follow.opacity ?? 1, lead.opacity ?? 1, progress); + } + /** + * Mix border radius + */ + for (let i = 0; i < numBorders; i++) { + const borderLabel = cornerRadiusProps[i]; + let followRadius = getRadius(follow, borderLabel); + let leadRadius = getRadius(lead, borderLabel); + if (followRadius === undefined && leadRadius === undefined) + continue; + followRadius || (followRadius = 0); + leadRadius || (leadRadius = 0); + const canMix = followRadius === 0 || + leadRadius === 0 || + isPx(followRadius) === isPx(leadRadius); + if (canMix) { + target[borderLabel] = Math.max(mixNumber(asNumber(followRadius), asNumber(leadRadius), progress), 0); + if (percent.test(leadRadius) || percent.test(followRadius)) { + target[borderLabel] += "%"; + } + } + else { + target[borderLabel] = leadRadius; + } + } + /** + * Mix rotation + */ + if (follow.rotate || lead.rotate) { + target.rotate = mixNumber(follow.rotate || 0, lead.rotate || 0, progress); + } +} +function getRadius(values, radiusName) { + return values[radiusName] !== undefined + ? values[radiusName] + : values.borderRadius; +} +const easeCrossfadeIn = /*@__PURE__*/ compress(0, 0.5, circOut); +const easeCrossfadeOut = /*@__PURE__*/ compress(0.5, 0.95, noop); +function compress(min, max, easing) { + return (p) => { + // Could replace ifs with clamp + if (p < min) + return 0; + if (p > max) + return 1; + return easing(progress(min, max, p)); + }; +} + +export { mixValues }; +//# sourceMappingURL=mix-values.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/animation/mix-values.mjs.map b/node_modules/motion-dom/dist/es/projection/animation/mix-values.mjs.map new file mode 100644 index 0000000..4559e57 --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/animation/mix-values.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"mix-values.mjs","sources":["../../../../src/projection/animation/mix-values.ts"],"sourcesContent":["import { mixNumber } from \"../../utils/mix/number\"\nimport { percent, px } from \"../../value/types/numbers/units\"\nimport type { AnyResolvedKeyframe } from \"../../animation/types\"\nimport {\n progress as calcProgress,\n circOut,\n EasingFunction,\n noop,\n} from \"motion-utils\"\nimport type { ResolvedValues } from \"../../node/types\"\nimport { cornerRadiusProps } from \"../../utils/border-radius\"\n\nconst numBorders = cornerRadiusProps.length\n\nconst asNumber = (value: AnyResolvedKeyframe) =>\n typeof value === \"string\" ? parseFloat(value) : value\n\nconst isPx = (value: AnyResolvedKeyframe) =>\n typeof value === \"number\" || px.test(value)\n\nexport function mixValues(\n target: ResolvedValues,\n follow: ResolvedValues,\n lead: ResolvedValues,\n progress: number,\n shouldCrossfadeOpacity: boolean,\n isOnlyMember: boolean\n) {\n if (shouldCrossfadeOpacity) {\n target.opacity = mixNumber(\n 0,\n (lead.opacity as number) ?? 1,\n easeCrossfadeIn(progress)\n )\n target.opacityExit = mixNumber(\n (follow.opacity as number) ?? 1,\n 0,\n easeCrossfadeOut(progress)\n )\n } else if (isOnlyMember) {\n target.opacity = mixNumber(\n (follow.opacity as number) ?? 1,\n (lead.opacity as number) ?? 1,\n progress\n )\n }\n\n /**\n * Mix border radius\n */\n for (let i = 0; i < numBorders; i++) {\n const borderLabel = cornerRadiusProps[i]\n let followRadius = getRadius(follow, borderLabel)\n let leadRadius = getRadius(lead, borderLabel)\n\n if (followRadius === undefined && leadRadius === undefined) continue\n\n followRadius ||= 0\n leadRadius ||= 0\n\n const canMix =\n followRadius === 0 ||\n leadRadius === 0 ||\n isPx(followRadius) === isPx(leadRadius)\n\n if (canMix) {\n target[borderLabel] = Math.max(\n mixNumber(\n asNumber(followRadius),\n asNumber(leadRadius),\n progress\n ),\n 0\n )\n\n if (percent.test(leadRadius) || percent.test(followRadius)) {\n target[borderLabel] += \"%\"\n }\n } else {\n target[borderLabel] = leadRadius\n }\n }\n\n /**\n * Mix rotation\n */\n if (follow.rotate || lead.rotate) {\n target.rotate = mixNumber(\n (follow.rotate as number) || 0,\n (lead.rotate as number) || 0,\n progress\n )\n }\n}\n\nfunction getRadius(values: ResolvedValues, radiusName: string) {\n return values[radiusName] !== undefined\n ? values[radiusName]\n : values.borderRadius\n}\n\nconst easeCrossfadeIn = /*@__PURE__*/ compress(0, 0.5, circOut)\nconst easeCrossfadeOut = /*@__PURE__*/ compress(0.5, 0.95, noop)\n\nfunction compress(\n min: number,\n max: number,\n easing: EasingFunction\n): EasingFunction {\n return (p: number) => {\n // Could replace ifs with clamp\n if (p < min) return 0\n if (p > max) return 1\n return easing(calcProgress(min, max, p))\n }\n}\n"],"names":["calcProgress"],"mappings":";;;;;AAYA,MAAM,UAAU,GAAG,iBAAiB,CAAC,MAAM;AAE3C,MAAM,QAAQ,GAAG,CAAC,KAA0B,KACxC,OAAO,KAAK,KAAK,QAAQ,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,KAAK;AAEzD,MAAM,IAAI,GAAG,CAAC,KAA0B,KACpC,OAAO,KAAK,KAAK,QAAQ,IAAI,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC;AAEzC,SAAU,SAAS,CACrB,MAAsB,EACtB,MAAsB,EACtB,IAAoB,EACpB,QAAgB,EAChB,sBAA+B,EAC/B,YAAqB,EAAA;IAErB,IAAI,sBAAsB,EAAE;AACxB,QAAA,MAAM,CAAC,OAAO,GAAG,SAAS,CACtB,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CAAC,YAAY,CAAC,EAAE;AACxD,gBAAA,MAAM,CAAC,WAAW,CAAC,IAAI,GAAG;YAC9B;QACJ;aAAO;AACH,YAAA,MAAM,CAAC,WAAW,CAAC,GAAG,UAAU;QACpC;IACJ;AAEA;;AAEG;IACH,IAAI,MAAM,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,EAAE;AAC9B,QAAA,MAAM,CAAC,MAAM,GAAG,SAAS,CACpB,MAAM,CAAC,MAAiB,IAAI,CAAC,EAC7B,IAAI,CAAC,MAAiB,IAAI,CAAC,EAC5B,QAAQ,CACX;IACL;AACJ;AAEA,SAAS,SAAS,CAAC,MAAsB,EAAE,UAAkB,EAAA;AACzD,IAAA,OAAO,MAAM,CAAC,UAAU,CAAC,KAAK;AAC1B,UAAE,MAAM,CAAC,UAAU;AACnB,UAAE,MAAM,CAAC,YAAY;AAC7B;AAEA,MAAM,eAAe,iBAAiB,QAAQ,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC;AAC/D,MAAM,gBAAgB,iBAAiB,QAAQ,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC;AAEhE,SAAS,QAAQ,CACb,GAAW,EACX,GAAW,EACX,MAAsB,EAAA;IAEtB,OAAO,CAAC,CAAS,KAAI;;QAEjB,IAAI,CAAC,GAAG,GAAG;AAAE,YAAA,OAAO,CAAC;QACrB,IAAI,CAAC,GAAG,GAAG;AAAE,YAAA,OAAO,CAAC;QACrB,OAAO,MAAM,CAACA,QAAY,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;AAC5C,IAAA,CAAC;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/projection/geometry/conversion.mjs b/node_modules/motion-dom/dist/es/projection/geometry/conversion.mjs new file mode 100644 index 0000000..fa9b9a0 --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/geometry/conversion.mjs @@ -0,0 +1,34 @@ +/** + * Bounding boxes tend to be defined as top, left, right, bottom. For various operations + * it's easier to consider each axis individually. This function returns a bounding box + * as a map of single-axis min/max values. + */ +function convertBoundingBoxToBox({ top, left, right, bottom, }) { + return { + x: { min: left, max: right }, + y: { min: top, max: bottom }, + }; +} +function convertBoxToBoundingBox({ x, y }) { + return { top: y.min, right: x.max, bottom: y.max, left: x.min }; +} +/** + * Applies a TransformPoint function to a bounding box. TransformPoint is usually a function + * provided by Framer to allow measured points to be corrected for device scaling. This is used + * when measuring DOM elements and DOM event points. + */ +function transformBoxPoints(point, transformPoint) { + if (!transformPoint) + return point; + const topLeft = transformPoint({ x: point.left, y: point.top }); + const bottomRight = transformPoint({ x: point.right, y: point.bottom }); + return { + top: topLeft.y, + left: topLeft.x, + bottom: bottomRight.y, + right: bottomRight.x, + }; +} + +export { convertBoundingBoxToBox, convertBoxToBoundingBox, transformBoxPoints }; +//# sourceMappingURL=conversion.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/geometry/conversion.mjs.map b/node_modules/motion-dom/dist/es/projection/geometry/conversion.mjs.map new file mode 100644 index 0000000..6d31dea --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/geometry/conversion.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"conversion.mjs","sources":["../../../../src/projection/geometry/conversion.ts"],"sourcesContent":["import { BoundingBox, Box, TransformPoint } from \"motion-utils\"\n\n/**\n * Bounding boxes tend to be defined as top, left, right, bottom. For various operations\n * it's easier to consider each axis individually. This function returns a bounding box\n * as a map of single-axis min/max values.\n */\nexport function convertBoundingBoxToBox({\n top,\n left,\n right,\n bottom,\n}: BoundingBox): Box {\n return {\n x: { min: left, max: right },\n y: { min: top, max: bottom },\n }\n}\n\nexport function convertBoxToBoundingBox({ x, y }: Box): BoundingBox {\n return { top: y.min, right: x.max, bottom: y.max, left: x.min }\n}\n\n/**\n * Applies a TransformPoint function to a bounding box. TransformPoint is usually a function\n * provided by Framer to allow measured points to be corrected for device scaling. This is used\n * when measuring DOM elements and DOM event points.\n */\nexport function transformBoxPoints(\n point: BoundingBox,\n transformPoint?: TransformPoint\n) {\n if (!transformPoint) return point\n const topLeft = transformPoint({ x: point.left, y: point.top })\n const bottomRight = transformPoint({ x: point.right, y: point.bottom })\n\n return {\n top: topLeft.y,\n left: topLeft.x,\n bottom: bottomRight.y,\n right: bottomRight.x,\n }\n}\n"],"names":[],"mappings":"AAEA;;;;AAIG;AACG,SAAU,uBAAuB,CAAC,EACpC,GAAG,EACH,IAAI,EACJ,KAAK,EACL,MAAM,GACI,EAAA;IACV,OAAO;QACH,CAAC,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE;QAC5B,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE;KAC/B;AACL;SAEgB,uBAAuB,CAAC,EAAE,CAAC,EAAE,CAAC,EAAO,EAAA;IACjD,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,CAAC,CAAC,GAAG,EAAE,MAAM,EAAE,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,EAAE;AACnE;AAEA;;;;AAIG;AACG,SAAU,kBAAkB,CAC9B,KAAkB,EAClB,cAA+B,EAAA;AAE/B,IAAA,IAAI,CAAC,cAAc;AAAE,QAAA,OAAO,KAAK;AACjC,IAAA,MAAM,OAAO,GAAG,cAAc,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,CAAC,GAAG,EAAE,CAAC;AAC/D,IAAA,MAAM,WAAW,GAAG,cAAc,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC;IAEvE,OAAO;QACH,GAAG,EAAE,OAAO,CAAC,CAAC;QACd,IAAI,EAAE,OAAO,CAAC,CAAC;QACf,MAAM,EAAE,WAAW,CAAC,CAAC;QACrB,KAAK,EAAE,WAAW,CAAC,CAAC;KACvB;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/projection/geometry/copy.mjs b/node_modules/motion-dom/dist/es/projection/geometry/copy.mjs new file mode 100644 index 0000000..5269ba1 --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/geometry/copy.mjs @@ -0,0 +1,32 @@ +/** + * Reset an axis to the provided origin box. + * + * This is a mutative operation. + */ +function copyAxisInto(axis, originAxis) { + axis.min = originAxis.min; + axis.max = originAxis.max; +} +/** + * Reset a box to the provided origin box. + * + * This is a mutative operation. + */ +function copyBoxInto(box, originBox) { + copyAxisInto(box.x, originBox.x); + copyAxisInto(box.y, originBox.y); +} +/** + * Reset a delta to the provided origin box. + * + * This is a mutative operation. + */ +function copyAxisDeltaInto(delta, originDelta) { + delta.translate = originDelta.translate; + delta.scale = originDelta.scale; + delta.originPoint = originDelta.originPoint; + delta.origin = originDelta.origin; +} + +export { copyAxisDeltaInto, copyAxisInto, copyBoxInto }; +//# sourceMappingURL=copy.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/geometry/copy.mjs.map b/node_modules/motion-dom/dist/es/projection/geometry/copy.mjs.map new file mode 100644 index 0000000..310e797 --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/geometry/copy.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"copy.mjs","sources":["../../../../src/projection/geometry/copy.ts"],"sourcesContent":["import { Axis, AxisDelta, Box } from \"motion-utils\"\n\n/**\n * Reset an axis to the provided origin box.\n *\n * This is a mutative operation.\n */\nexport function copyAxisInto(axis: Axis, originAxis: Axis) {\n axis.min = originAxis.min\n axis.max = originAxis.max\n}\n\n/**\n * Reset a box to the provided origin box.\n *\n * This is a mutative operation.\n */\nexport function copyBoxInto(box: Box, originBox: Box) {\n copyAxisInto(box.x, originBox.x)\n copyAxisInto(box.y, originBox.y)\n}\n\n/**\n * Reset a delta to the provided origin box.\n *\n * This is a mutative operation.\n */\nexport function copyAxisDeltaInto(delta: AxisDelta, originDelta: AxisDelta) {\n delta.translate = originDelta.translate\n delta.scale = originDelta.scale\n delta.originPoint = originDelta.originPoint\n delta.origin = originDelta.origin\n}\n"],"names":[],"mappings":"AAEA;;;;AAIG;AACG,SAAU,YAAY,CAAC,IAAU,EAAE,UAAgB,EAAA;AACrD,IAAA,IAAI,CAAC,GAAG,GAAG,UAAU,CAAC,GAAG;AACzB,IAAA,IAAI,CAAC,GAAG,GAAG,UAAU,CAAC,GAAG;AAC7B;AAEA;;;;AAIG;AACG,SAAU,WAAW,CAAC,GAAQ,EAAE,SAAc,EAAA;IAChD,YAAY,CAAC,GAAG,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC;IAChC,YAAY,CAAC,GAAG,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC;AACpC;AAEA;;;;AAIG;AACG,SAAU,iBAAiB,CAAC,KAAgB,EAAE,WAAsB,EAAA;AACtE,IAAA,KAAK,CAAC,SAAS,GAAG,WAAW,CAAC,SAAS;AACvC,IAAA,KAAK,CAAC,KAAK,GAAG,WAAW,CAAC,KAAK;AAC/B,IAAA,KAAK,CAAC,WAAW,GAAG,WAAW,CAAC,WAAW;AAC3C,IAAA,KAAK,CAAC,MAAM,GAAG,WAAW,CAAC,MAAM;AACrC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/projection/geometry/delta-apply.mjs b/node_modules/motion-dom/dist/es/projection/geometry/delta-apply.mjs new file mode 100644 index 0000000..f60e7c8 --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/geometry/delta-apply.mjs @@ -0,0 +1,125 @@ +import { mixNumber } from '../../utils/mix/number.mjs'; +import { hasTransform } from '../utils/has-transform.mjs'; + +/** + * Scales a point based on a factor and an originPoint + */ +function scalePoint(point, scale, originPoint) { + const distanceFromOrigin = point - originPoint; + const scaled = scale * distanceFromOrigin; + return originPoint + scaled; +} +/** + * Applies a translate/scale delta to a point + */ +function applyPointDelta(point, translate, scale, originPoint, boxScale) { + if (boxScale !== undefined) { + point = scalePoint(point, boxScale, originPoint); + } + return scalePoint(point, scale, originPoint) + translate; +} +/** + * Applies a translate/scale delta to an axis + */ +function applyAxisDelta(axis, translate = 0, scale = 1, originPoint, boxScale) { + axis.min = applyPointDelta(axis.min, translate, scale, originPoint, boxScale); + axis.max = applyPointDelta(axis.max, translate, scale, originPoint, boxScale); +} +/** + * Applies a translate/scale delta to a box + */ +function applyBoxDelta(box, { x, y }) { + applyAxisDelta(box.x, x.translate, x.scale, x.originPoint); + applyAxisDelta(box.y, y.translate, y.scale, y.originPoint); +} +const TREE_SCALE_SNAP_MIN = 0.999999999999; +const TREE_SCALE_SNAP_MAX = 1.0000000000001; +/** + * Apply a tree of deltas to a box. We do this to calculate the effect of all the transforms + * in a tree upon our box before then calculating how to project it into our desired viewport-relative box + * + * This is the final nested loop within updateLayoutDelta for future refactoring + */ +function applyTreeDeltas(box, treeScale, treePath, isSharedTransition = false) { + const treeLength = treePath.length; + if (!treeLength) + return; + // Reset the treeScale + treeScale.x = treeScale.y = 1; + let node; + let delta; + for (let i = 0; i < treeLength; i++) { + node = treePath[i]; + delta = node.projectionDelta; + /** + * TODO: Prefer to remove this, but currently we have motion components with + * display: contents in Framer. + */ + const { visualElement } = node.options; + if (visualElement && + visualElement.props.style && + visualElement.props.style.display === "contents") { + continue; + } + if (isSharedTransition && + node.options.layoutScroll && + node.scroll && + node !== node.root) { + translateAxis(box.x, -node.scroll.offset.x); + translateAxis(box.y, -node.scroll.offset.y); + } + if (delta) { + // Incoporate each ancestor's scale into a cumulative treeScale for this component + treeScale.x *= delta.x.scale; + treeScale.y *= delta.y.scale; + // Apply each ancestor's calculated delta into this component's recorded layout box + applyBoxDelta(box, delta); + } + if (isSharedTransition && hasTransform(node.latestValues)) { + transformBox(box, node.latestValues, node.layout?.layoutBox); + } + } + /** + * Snap tree scale back to 1 if it's within a non-perceivable threshold. + * This will help reduce useless scales getting rendered. + */ + if (treeScale.x < TREE_SCALE_SNAP_MAX && + treeScale.x > TREE_SCALE_SNAP_MIN) { + treeScale.x = 1.0; + } + if (treeScale.y < TREE_SCALE_SNAP_MAX && + treeScale.y > TREE_SCALE_SNAP_MIN) { + treeScale.y = 1.0; + } +} +function translateAxis(axis, distance) { + axis.min += distance; + axis.max += distance; +} +/** + * Apply a transform to an axis from the latest resolved motion values. + * This function basically acts as a bridge between a flat motion value map + * and applyAxisDelta + */ +function transformAxis(axis, axisTranslate, axisScale, boxScale, axisOrigin = 0.5) { + const originPoint = mixNumber(axis.min, axis.max, axisOrigin); + // Apply the axis delta to the final axis + applyAxisDelta(axis, axisTranslate, axisScale, originPoint, boxScale); +} +function resolveAxisTranslate(value, axis) { + if (typeof value === "string") { + return (parseFloat(value) / 100) * (axis.max - axis.min); + } + return value; +} +/** + * Apply a transform to a box from the latest resolved motion values. + */ +function transformBox(box, transform, sourceBox) { + const resolveBox = sourceBox ?? box; + transformAxis(box.x, resolveAxisTranslate(transform.x, resolveBox.x), transform.scaleX, transform.scale, transform.originX); + transformAxis(box.y, resolveAxisTranslate(transform.y, resolveBox.y), transform.scaleY, transform.scale, transform.originY); +} + +export { applyAxisDelta, applyBoxDelta, applyPointDelta, applyTreeDeltas, scalePoint, transformAxis, transformBox, translateAxis }; +//# sourceMappingURL=delta-apply.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/geometry/delta-apply.mjs.map b/node_modules/motion-dom/dist/es/projection/geometry/delta-apply.mjs.map new file mode 100644 index 0000000..a2eae43 --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/geometry/delta-apply.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"delta-apply.mjs","sources":["../../../../src/projection/geometry/delta-apply.ts"],"sourcesContent":["import { Axis, Box, Delta, Point } from \"motion-utils\"\nimport { mixNumber } from \"../../utils/mix/number\"\nimport { ResolvedValues } from \"../../render/types\"\nimport { hasTransform } from \"../utils/has-transform\"\n\n/**\n * Scales a point based on a factor and an originPoint\n */\nexport function scalePoint(point: number, scale: number, originPoint: number) {\n const distanceFromOrigin = point - originPoint\n const scaled = scale * distanceFromOrigin\n return originPoint + scaled\n}\n\n/**\n * Applies a translate/scale delta to a point\n */\nexport function applyPointDelta(\n point: number,\n translate: number,\n scale: number,\n originPoint: number,\n boxScale?: number\n): number {\n if (boxScale !== undefined) {\n point = scalePoint(point, boxScale, originPoint)\n }\n\n return scalePoint(point, scale, originPoint) + translate\n}\n\n/**\n * Applies a translate/scale delta to an axis\n */\nexport function applyAxisDelta(\n axis: Axis,\n translate: number = 0,\n scale: number = 1,\n originPoint: number,\n boxScale?: number\n): void {\n axis.min = applyPointDelta(\n axis.min,\n translate,\n scale,\n originPoint,\n boxScale\n )\n\n axis.max = applyPointDelta(\n axis.max,\n translate,\n scale,\n originPoint,\n boxScale\n )\n}\n\n/**\n * Applies a translate/scale delta to a box\n */\nexport function applyBoxDelta(box: Box, { x, y }: Delta): void {\n applyAxisDelta(box.x, x.translate, x.scale, x.originPoint)\n applyAxisDelta(box.y, y.translate, y.scale, y.originPoint)\n}\n\nconst TREE_SCALE_SNAP_MIN = 0.999999999999\nconst TREE_SCALE_SNAP_MAX = 1.0000000000001\n\n/**\n * Apply a tree of deltas to a box. We do this to calculate the effect of all the transforms\n * in a tree upon our box before then calculating how to project it into our desired viewport-relative box\n *\n * This is the final nested loop within updateLayoutDelta for future refactoring\n */\nexport function applyTreeDeltas(\n box: Box,\n treeScale: Point,\n treePath: any[],\n isSharedTransition: boolean = false\n) {\n const treeLength = treePath.length\n if (!treeLength) return\n\n // Reset the treeScale\n treeScale.x = treeScale.y = 1\n\n let node: any\n let delta: Delta | undefined\n\n for (let i = 0; i < treeLength; i++) {\n node = treePath[i]\n delta = node.projectionDelta\n\n /**\n * TODO: Prefer to remove this, but currently we have motion components with\n * display: contents in Framer.\n */\n const { visualElement } = node.options\n if (\n visualElement &&\n visualElement.props.style &&\n visualElement.props.style.display === \"contents\"\n ) {\n continue\n }\n\n if (\n isSharedTransition &&\n node.options.layoutScroll &&\n node.scroll &&\n node !== node.root\n ) {\n translateAxis(box.x, -node.scroll.offset.x)\n translateAxis(box.y, -node.scroll.offset.y)\n }\n\n if (delta) {\n // Incoporate each ancestor's scale into a cumulative treeScale for this component\n treeScale.x *= delta.x.scale\n treeScale.y *= delta.y.scale\n\n // Apply each ancestor's calculated delta into this component's recorded layout box\n applyBoxDelta(box, delta)\n }\n\n if (isSharedTransition && hasTransform(node.latestValues)) {\n transformBox(box, node.latestValues, node.layout?.layoutBox)\n }\n }\n\n /**\n * Snap tree scale back to 1 if it's within a non-perceivable threshold.\n * This will help reduce useless scales getting rendered.\n */\n if (\n treeScale.x < TREE_SCALE_SNAP_MAX &&\n treeScale.x > TREE_SCALE_SNAP_MIN\n ) {\n treeScale.x = 1.0\n }\n if (\n treeScale.y < TREE_SCALE_SNAP_MAX &&\n treeScale.y > TREE_SCALE_SNAP_MIN\n ) {\n treeScale.y = 1.0\n }\n}\n\nexport function translateAxis(axis: Axis, distance: number) {\n axis.min += distance\n axis.max += distance\n}\n\n/**\n * Apply a transform to an axis from the latest resolved motion values.\n * This function basically acts as a bridge between a flat motion value map\n * and applyAxisDelta\n */\nexport function transformAxis(\n axis: Axis,\n axisTranslate?: number,\n axisScale?: number,\n boxScale?: number,\n axisOrigin: number = 0.5\n): void {\n const originPoint = mixNumber(axis.min, axis.max, axisOrigin)\n\n // Apply the axis delta to the final axis\n applyAxisDelta(axis, axisTranslate, axisScale, originPoint, boxScale)\n}\n\nfunction resolveAxisTranslate(\n value: number | string | undefined,\n axis: Axis\n): number | undefined {\n if (typeof value === \"string\") {\n return (parseFloat(value) / 100) * (axis.max - axis.min)\n }\n return value as number | undefined\n}\n\n/**\n * Apply a transform to a box from the latest resolved motion values.\n */\nexport function transformBox(\n box: Box,\n transform: ResolvedValues,\n sourceBox?: Box\n) {\n const resolveBox = sourceBox ?? box\n transformAxis(\n box.x,\n resolveAxisTranslate(transform.x, resolveBox.x),\n transform.scaleX as number,\n transform.scale as number,\n transform.originX as number\n )\n transformAxis(\n box.y,\n resolveAxisTranslate(transform.y, resolveBox.y),\n transform.scaleY as number,\n transform.scale as number,\n transform.originY as number\n )\n}\n"],"names":[],"mappings":";;;AAKA;;AAEG;SACa,UAAU,CAAC,KAAa,EAAE,KAAa,EAAE,WAAmB,EAAA;AACxE,IAAA,MAAM,kBAAkB,GAAG,KAAK,GAAG,WAAW;AAC9C,IAAA,MAAM,MAAM,GAAG,KAAK,GAAG,kBAAkB;IACzC,OAAO,WAAW,GAAG,MAAM;AAC/B;AAEA;;AAEG;AACG,SAAU,eAAe,CAC3B,KAAa,EACb,SAAiB,EACjB,KAAa,EACb,WAAmB,EACnB,QAAiB,EAAA;AAEjB,IAAA,IAAI,QAAQ,KAAK,SAAS,EAAE;QACxB,KAAK,GAAG,UAAU,CAAC,KAAK,EAAE,QAAQ,EAAE,WAAW,CAAC;IACpD;IAEA,OAAO,UAAU,CAAC,KAAK,EAAE,KAAK,EAAE,WAAW,CAAC,GAAG,SAAS;AAC5D;AAEA;;AAEG;AACG,SAAU,cAAc,CAC1B,IAAU,EACV,SAAA,GAAoB,CAAC,EACrB,KAAA,GAAgB,CAAC,EACjB,WAAmB,EACnB,QAAiB,EAAA;AAEjB,IAAA,IAAI,CAAC,GAAG,GAAG,eAAe,CACtB,IAAI,CAAC,GAAG,EACR,SAAS,EACT,KAAK,EACL,WAAW,EACX,QAAQ,CACX;AAED,IAAA,IAAI,CAAC,GAAG,GAAG,eAAe,CACtB,IAAI,CAAC,GAAG,EACR,SAAS,EACT,KAAK,EACL,WAAW,EACX,QAAQ,CACX;AACL;AAEA;;AAEG;AACG,SAAU,aAAa,CAAC,GAAQ,EAAE,EAAE,CAAC,EAAE,CAAC,EAAS,EAAA;AACnD,IAAA,cAAc,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,WAAW,CAAC;AAC1D,IAAA,cAAc,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,SAAS,EAAE,CAA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,KAAK,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC;IAC5D;AACA,IAAA,OAAO,KAA2B;AACtC;AAEA;;AAEG;SACa,YAAY,CACxB,GAAQ,EACR,SAAyB,EACzB,SAAe,EAAA;AAEf,IAAA,MAAM,UAAU,GAAG,SAAS,IAAI,GAAG;AACnC,IAAA,aAAa,CACT,GAAG,CAAC,CAAC,EACL,oBAAoB,CAAC,SAAS,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,EAC/C,SAAS,CAAC,MAAgB,EAC1B,SAAS,CAAC,KAAe,EACzB,SAAS,CAAC,OAAiB,CAC9B;AACD,IAAA,aAAa,CACT,GAAG,CAAC,CAAC,EACL,oBAAoB,CAAC,SAAS,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,EAC/C,SAAS,CAAC,MAAgB,EAC1B,SAAS,CAAC,KAAe,EACzB,SAAS,CAAC,OAAiB,CAC9B;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/projection/geometry/delta-calc.mjs b/node_modules/motion-dom/dist/es/projection/geometry/delta-calc.mjs new file mode 100644 index 0000000..39e0f7b --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/geometry/delta-calc.mjs @@ -0,0 +1,59 @@ +import { mixNumber } from '../../utils/mix/number.mjs'; + +const SCALE_PRECISION = 0.0001; +const SCALE_MIN = 1 - SCALE_PRECISION; +const SCALE_MAX = 1 + SCALE_PRECISION; +const TRANSLATE_PRECISION = 0.01; +const TRANSLATE_MIN = 0 - TRANSLATE_PRECISION; +const TRANSLATE_MAX = 0 + TRANSLATE_PRECISION; +function calcLength(axis) { + return axis.max - axis.min; +} +function isNear(value, target, maxDistance) { + return Math.abs(value - target) <= maxDistance; +} +function calcAxisDelta(delta, source, target, origin = 0.5) { + delta.origin = origin; + delta.originPoint = mixNumber(source.min, source.max, delta.origin); + delta.scale = calcLength(target) / calcLength(source); + delta.translate = + mixNumber(target.min, target.max, delta.origin) - delta.originPoint; + if ((delta.scale >= SCALE_MIN && delta.scale <= SCALE_MAX) || + isNaN(delta.scale)) { + delta.scale = 1.0; + } + if ((delta.translate >= TRANSLATE_MIN && + delta.translate <= TRANSLATE_MAX) || + isNaN(delta.translate)) { + delta.translate = 0.0; + } +} +function calcBoxDelta(delta, source, target, origin) { + calcAxisDelta(delta.x, source.x, target.x, origin ? origin.originX : undefined); + calcAxisDelta(delta.y, source.y, target.y, origin ? origin.originY : undefined); +} +function calcRelativeAxis(target, relative, parent, anchor = 0) { + const anchorPoint = anchor + ? mixNumber(parent.min, parent.max, anchor) + : parent.min; + target.min = anchorPoint + relative.min; + target.max = target.min + calcLength(relative); +} +function calcRelativeBox(target, relative, parent, anchor) { + calcRelativeAxis(target.x, relative.x, parent.x, anchor?.x); + calcRelativeAxis(target.y, relative.y, parent.y, anchor?.y); +} +function calcRelativeAxisPosition(target, layout, parent, anchor = 0) { + const anchorPoint = anchor + ? mixNumber(parent.min, parent.max, anchor) + : parent.min; + target.min = layout.min - anchorPoint; + target.max = target.min + calcLength(layout); +} +function calcRelativePosition(target, layout, parent, anchor) { + calcRelativeAxisPosition(target.x, layout.x, parent.x, anchor?.x); + calcRelativeAxisPosition(target.y, layout.y, parent.y, anchor?.y); +} + +export { calcAxisDelta, calcBoxDelta, calcLength, calcRelativeAxis, calcRelativeAxisPosition, calcRelativeBox, calcRelativePosition, isNear }; +//# sourceMappingURL=delta-calc.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/geometry/delta-calc.mjs.map b/node_modules/motion-dom/dist/es/projection/geometry/delta-calc.mjs.map new file mode 100644 index 0000000..b9b53e0 --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/geometry/delta-calc.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"delta-calc.mjs","sources":["../../../../src/projection/geometry/delta-calc.ts"],"sourcesContent":["import { Axis, AxisDelta, Box, Delta, Point } from \"motion-utils\"\nimport { mixNumber } from \"../../utils/mix/number\"\nimport { ResolvedValues } from \"../../render/types\"\n\nconst SCALE_PRECISION = 0.0001\nconst SCALE_MIN = 1 - SCALE_PRECISION\nconst SCALE_MAX = 1 + SCALE_PRECISION\nconst TRANSLATE_PRECISION = 0.01\nconst TRANSLATE_MIN = 0 - TRANSLATE_PRECISION\nconst TRANSLATE_MAX = 0 + TRANSLATE_PRECISION\n\nexport function calcLength(axis: Axis) {\n return axis.max - axis.min\n}\n\nexport function isNear(\n value: number,\n target: number,\n maxDistance: number\n): boolean {\n return Math.abs(value - target) <= maxDistance\n}\n\nexport function calcAxisDelta(\n delta: AxisDelta,\n source: Axis,\n target: Axis,\n origin: number = 0.5\n) {\n delta.origin = origin\n delta.originPoint = mixNumber(source.min, source.max, delta.origin)\n delta.scale = calcLength(target) / calcLength(source)\n delta.translate =\n mixNumber(target.min, target.max, delta.origin) - delta.originPoint\n\n if (\n (delta.scale >= SCALE_MIN && delta.scale <= SCALE_MAX) ||\n isNaN(delta.scale)\n ) {\n delta.scale = 1.0\n }\n\n if (\n (delta.translate >= TRANSLATE_MIN &&\n delta.translate <= TRANSLATE_MAX) ||\n isNaN(delta.translate)\n ) {\n delta.translate = 0.0\n }\n}\n\nexport function calcBoxDelta(\n delta: Delta,\n source: Box,\n target: Box,\n origin?: ResolvedValues\n): void {\n calcAxisDelta(\n delta.x,\n source.x,\n target.x,\n origin ? (origin.originX as number) : undefined\n )\n calcAxisDelta(\n delta.y,\n source.y,\n target.y,\n origin ? (origin.originY as number) : undefined\n )\n}\n\nexport function calcRelativeAxis(\n target: Axis,\n relative: Axis,\n parent: Axis,\n anchor: number = 0\n) {\n const anchorPoint = anchor\n ? mixNumber(parent.min, parent.max, anchor)\n : parent.min\n target.min = anchorPoint + relative.min\n target.max = target.min + calcLength(relative)\n}\n\nexport function calcRelativeBox(\n target: Box,\n relative: Box,\n parent: Box,\n anchor?: Point\n) {\n calcRelativeAxis(target.x, relative.x, parent.x, anchor?.x)\n calcRelativeAxis(target.y, relative.y, parent.y, anchor?.y)\n}\n\nexport function calcRelativeAxisPosition(\n target: Axis,\n layout: Axis,\n parent: Axis,\n anchor: number = 0\n) {\n const anchorPoint = anchor\n ? mixNumber(parent.min, parent.max, anchor)\n : parent.min\n target.min = layout.min - anchorPoint\n target.max = target.min + calcLength(layout)\n}\n\nexport function calcRelativePosition(\n target: Box,\n layout: Box,\n parent: Box,\n anchor?: Point\n) {\n calcRelativeAxisPosition(target.x, layout.x, parent.x, anchor?.x)\n calcRelativeAxisPosition(target.y, layout.y, parent.y, anchor?.y)\n}\n"],"names":[],"mappings":";;AAIA,MAAM,eAAe,GAAG,MAAM;AAC9B,MAAM,SAAS,GAAG,CAAC,GAAG,eAAe;AACrC,MAAM,SAAS,GAAG,CAAC,GAAG,eAAe;AACrC,MAAM,mBAAmB,GAAG,IAAI;AAChC,MAAM,aAAa,GAAG,CAAC,GAAG,mBAAmB;AAC7C,MAAM,aAAa,GAAG,CAAC,GAAG,mBAAmB;AAEvC,SAAU,UAAU,CAAC,IAAU,EAAA;AACjC,IAAA,OAAO,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG;AAC9B;SAEgB,MAAM,CAClB,KAAa,EACb,MAAc,EACd,WAAmB,EAAA;IAEnB,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,GAAG,MAAM,CAAC,IAAI,WAAW;AAClD;AAEM,SAAU,aAAa,CACzB,KAAgB,EAChB,MAAY,EACZ,MAAY,EACZ,MAAA,GAAiB,GAAG,EAAA;AAEpB,IAAA,KAAK,CAAC,MAAM,GAAG,MAAM;AACrB,IAAA,KAAK,CAAC,WAAW,GAAG,SAAS,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,MAAM,CAAC;AACnE,IAAA,KAAK,CAAC,KAAK,GAAG,UAAU,CAAC,MAAM,CAAC,GAAG,UAAU,CAAC,MAAM,CAAC;AACrD,IAAA,KAAK,CAAC,SAAS;AACX,QAAA,SAAS,CAAC,MAAM,CAAC,GAAG,E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MAAW,EACX,MAAc,EAAA;AAEd,IAAA,gBAAgB,CAAC,MAAM,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;AAC3D,IAAA,gBAAgB,CAAC,MAAM,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;AAC/D;AAEM,SAAU,wBAAwB,CACpC,MAAY,EACZ,MAAY,EACZ,MAAY,EACZ,MAAA,GAAiB,CAAC,EAAA;IAElB,MAAM,WAAW,GAAG;AAChB,UAAE,SAAS,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,EAAE,MAAM;AAC1C,UAAE,MAAM,CAAC,GAAG;IAChB,MAAM,CAAC,GAAG,GAAG,MAAM,CAAC,GAAG,GAAG,WAAW;IACrC,MAAM,CAAC,GAAG,GAAG,MAAM,CAAC,GAAG,GAAG,UAAU,CAAC,MAAM,CAAC;AAChD;AAEM,SAAU,oBAAoB,CAChC,MAAW,EACX,MAAW,EACX,MAAW,EACX,MAAc,EAAA;AAEd,IAAA,wBAAwB,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;AACjE,IAAA,wBAAwB,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;AACrE;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/projection/geometry/delta-remove.mjs b/node_modules/motion-dom/dist/es/projection/geometry/delta-remove.mjs new file mode 100644 index 0000000..59915ad --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/geometry/delta-remove.mjs @@ -0,0 +1,55 @@ +import { mixNumber } from '../../utils/mix/number.mjs'; +import { percent } from '../../value/types/numbers/units.mjs'; +import { scalePoint } from './delta-apply.mjs'; + +/** + * Remove a delta from a point. This is essentially the steps of applyPointDelta in reverse + */ +function removePointDelta(point, translate, scale, originPoint, boxScale) { + point -= translate; + point = scalePoint(point, 1 / scale, originPoint); + if (boxScale !== undefined) { + point = scalePoint(point, 1 / boxScale, originPoint); + } + return point; +} +/** + * Remove a delta from an axis. This is essentially the steps of applyAxisDelta in reverse + */ +function removeAxisDelta(axis, translate = 0, scale = 1, origin = 0.5, boxScale, originAxis = axis, sourceAxis = axis) { + if (percent.test(translate)) { + translate = parseFloat(translate); + const relativeProgress = mixNumber(sourceAxis.min, sourceAxis.max, translate / 100); + translate = relativeProgress - sourceAxis.min; + } + if (typeof translate !== "number") + return; + let originPoint = mixNumber(originAxis.min, originAxis.max, origin); + if (axis === originAxis) + originPoint -= translate; + axis.min = removePointDelta(axis.min, translate, scale, originPoint, boxScale); + axis.max = removePointDelta(axis.max, translate, scale, originPoint, boxScale); +} +/** + * Remove a transforms from an axis. This is essentially the steps of applyAxisTransforms in reverse + * and acts as a bridge between motion values and removeAxisDelta + */ +function removeAxisTransforms(axis, transforms, [key, scaleKey, originKey], origin, sourceAxis) { + removeAxisDelta(axis, transforms[key], transforms[scaleKey], transforms[originKey], transforms.scale, origin, sourceAxis); +} +/** + * The names of the motion values we want to apply as translation, scale and origin. + */ +const xKeys = ["x", "scaleX", "originX"]; +const yKeys = ["y", "scaleY", "originY"]; +/** + * Remove a transforms from an box. This is essentially the steps of applyAxisBox in reverse + * and acts as a bridge between motion values and removeAxisDelta + */ +function removeBoxTransforms(box, transforms, originBox, sourceBox) { + removeAxisTransforms(box.x, transforms, xKeys, originBox ? originBox.x : undefined, sourceBox ? sourceBox.x : undefined); + removeAxisTransforms(box.y, transforms, yKeys, originBox ? originBox.y : undefined, sourceBox ? sourceBox.y : undefined); +} + +export { removeAxisDelta, removeAxisTransforms, removeBoxTransforms, removePointDelta }; +//# sourceMappingURL=delta-remove.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/geometry/delta-remove.mjs.map b/node_modules/motion-dom/dist/es/projection/geometry/delta-remove.mjs.map new file mode 100644 index 0000000..f413dde --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/geometry/delta-remove.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"delta-remove.mjs","sources":["../../../../src/projection/geometry/delta-remove.ts"],"sourcesContent":["import { Axis, Box } from \"motion-utils\"\nimport { mixNumber } from \"../../utils/mix/number\"\nimport { percent } from \"../../value/types/numbers/units\"\nimport { ResolvedValues } from \"../../render/types\"\nimport { scalePoint } from \"./delta-apply\"\n\n/**\n * Remove a delta from a point. This is essentially the steps of applyPointDelta in reverse\n */\nexport function removePointDelta(\n point: number,\n translate: number,\n scale: number,\n originPoint: number,\n boxScale?: number\n): number {\n point -= translate\n point = scalePoint(point, 1 / scale, originPoint)\n\n if (boxScale !== undefined) {\n point = scalePoint(point, 1 / boxScale, originPoint)\n }\n\n return point\n}\n\n/**\n * Remove a delta from an axis. This is essentially the steps of applyAxisDelta in reverse\n */\nexport function removeAxisDelta(\n axis: Axis,\n translate: number | string = 0,\n scale: number = 1,\n origin: number = 0.5,\n boxScale?: number,\n originAxis: Axis = axis,\n sourceAxis: Axis = axis\n): void {\n if (percent.test(translate)) {\n translate = parseFloat(translate as string)\n const relativeProgress = mixNumber(\n sourceAxis.min,\n sourceAxis.max,\n translate / 100\n )\n translate = relativeProgress - sourceAxis.min\n }\n\n if (typeof translate !== \"number\") return\n\n let originPoint = mixNumber(originAxis.min, originAxis.max, origin)\n if (axis === originAxis) originPoint -= translate\n\n axis.min = removePointDelta(\n axis.min,\n translate,\n scale,\n originPoint,\n boxScale\n )\n\n axis.max = removePointDelta(\n axis.max,\n translate,\n scale,\n originPoint,\n boxScale\n )\n}\n\n/**\n * Remove a transforms from an axis. This is essentially the steps of applyAxisTransforms in reverse\n * and acts as a bridge between motion values and removeAxisDelta\n */\nexport function removeAxisTransforms(\n axis: Axis,\n transforms: ResolvedValues,\n [key, scaleKey, originKey]: string[],\n origin?: Axis,\n sourceAxis?: Axis\n) {\n removeAxisDelta(\n axis,\n transforms[key] as number,\n transforms[scaleKey] as number,\n transforms[originKey] as number,\n transforms.scale as number,\n origin,\n sourceAxis\n )\n}\n\n/**\n * The names of the motion values we want to apply as translation, scale and origin.\n */\nconst xKeys = [\"x\", \"scaleX\", \"originX\"]\nconst yKeys = [\"y\", \"scaleY\", \"originY\"]\n\n/**\n * Remove a transforms from an box. This is essentially the steps of applyAxisBox in reverse\n * and acts as a bridge between motion values and removeAxisDelta\n */\nexport function removeBoxTransforms(\n box: Box,\n transforms: ResolvedValues,\n originBox?: Box,\n sourceBox?: Box\n): void {\n removeAxisTransforms(\n box.x,\n transforms,\n xKeys,\n originBox ? originBox.x : undefined,\n sourceBox ? sourceBox.x : undefined\n )\n removeAxisTransforms(\n box.y,\n transforms,\n yKeys,\n originBox ? originBox.y : undefined,\n sourceBox ? sourceBox.y : undefined\n )\n}\n"],"names":[],"mappings":";;;;AAMA;;AAEG;AACG,SAAU,gBAAgB,CAC5B,KAAa,EACb,SAAiB,EACjB,KAAa,EACb,WAAmB,EACnB,QAAiB,EAAA;IAEjB,KAAK,IAAI,SAAS;IAClB,KAAK,GAAG,UAAU,CAAC,KAAK,EAAE,CAAC,GAAG,KAAK,EAAE,WAAW,CAAC;AAEjD,IAAA,IAAI,QAAQ,KAAK,SAAS,EAAE;QACxB,KAAK,GAAG,UAAU,CAAC,KAAK,EAAE,CAAC,GAAG,QAAQ,EAAE,WAAW,CAAC;IACxD;AAEA,IAAA,OAAO,KAAK;AAChB;AAEA;;AAEG;AACG,SAAU,eAAe,CAC3B,IAAU,EACV,SAAA,GAA6B,CAAC,EAC9B,KAAA,GAAgB,CAAC,EACjB,MAAA,GAAiB,GAAG,EACpB,QAAiB,EACjB,aAAmB,IAAI,EACvB,aAAmB,IAAI,EAAA;AAEvB,IAAA,IAAI,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE;AACzB,QAAA,SAAS,GAAG,UAAU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L,UAAU,EACV,KAAK,EACL,SAAS,GAAG,SAAS,CAAC,CAAC,GAAG,SAAS,EACnC,SAAS,GAAG,SAAS,CAAC,CAAC,GAAG,SAAS,CACtC;AACD,IAAA,oBAAoB,CAChB,GAAG,CAAC,CAAC,EACL,UAAU,EACV,KAAK,EACL,SAAS,GAAG,SAAS,CAAC,CAAC,GAAG,SAAS,EACnC,SAAS,GAAG,SAAS,CAAC,CAAC,GAAG,SAAS,CACtC;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/projection/geometry/models.mjs b/node_modules/motion-dom/dist/es/projection/geometry/models.mjs new file mode 100644 index 0000000..f6ca4f0 --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/geometry/models.mjs @@ -0,0 +1,18 @@ +const createAxisDelta = () => ({ + translate: 0, + scale: 1, + origin: 0, + originPoint: 0, +}); +const createDelta = () => ({ + x: createAxisDelta(), + y: createAxisDelta(), +}); +const createAxis = () => ({ min: 0, max: 0 }); +const createBox = () => ({ + x: createAxis(), + y: createAxis(), +}); + +export { createAxis, createAxisDelta, createBox, createDelta }; +//# sourceMappingURL=models.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/geometry/models.mjs.map b/node_modules/motion-dom/dist/es/projection/geometry/models.mjs.map new file mode 100644 index 0000000..5e571a9 --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/geometry/models.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"models.mjs","sources":["../../../../src/projection/geometry/models.ts"],"sourcesContent":["import { Axis, AxisDelta, Box, Delta } from \"motion-utils\"\n\nexport const createAxisDelta = (): AxisDelta => ({\n translate: 0,\n scale: 1,\n origin: 0,\n originPoint: 0,\n})\n\nexport const createDelta = (): Delta => ({\n x: createAxisDelta(),\n y: createAxisDelta(),\n})\n\nexport const createAxis = (): Axis => ({ min: 0, max: 0 })\n\nexport const createBox = (): Box => ({\n x: createAxis(),\n y: createAxis(),\n})\n"],"names":[],"mappings":"AAEO,MAAM,eAAe,GAAG,OAAkB;AAC7C,IAAA,SAAS,EAAE,CAAC;AACZ,IAAA,KAAK,EAAE,CAAC;AACR,IAAA,MAAM,EAAE,CAAC;AACT,IAAA,WAAW,EAAE,CAAC;AACjB,CAAA;AAEM,MAAM,WAAW,GAAG,OAAc;IACrC,CAAC,EAAE,eAAe,EAAE;IACpB,CAAC,EAAE,eAAe,EAAE;AACvB,CAAA;AAEM,MAAM,UAAU,GAAG,OAAa,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE;AAElD,MAAM,SAAS,GAAG,OAAY;IACjC,CAAC,EAAE,UAAU,EAAE;IACf,CAAC,EAAE,UAAU,EAAE;AAClB,CAAA;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/projection/geometry/utils.mjs b/node_modules/motion-dom/dist/es/projection/geometry/utils.mjs new file mode 100644 index 0000000..807d96d --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/geometry/utils.mjs @@ -0,0 +1,32 @@ +import { calcLength } from './delta-calc.mjs'; + +function isAxisDeltaZero(delta) { + return delta.translate === 0 && delta.scale === 1; +} +function isDeltaZero(delta) { + return isAxisDeltaZero(delta.x) && isAxisDeltaZero(delta.y); +} +function axisEquals(a, b) { + return a.min === b.min && a.max === b.max; +} +function boxEquals(a, b) { + return axisEquals(a.x, b.x) && axisEquals(a.y, b.y); +} +function axisEqualsRounded(a, b) { + return (Math.round(a.min) === Math.round(b.min) && + Math.round(a.max) === Math.round(b.max)); +} +function boxEqualsRounded(a, b) { + return axisEqualsRounded(a.x, b.x) && axisEqualsRounded(a.y, b.y); +} +function aspectRatio(box) { + return calcLength(box.x) / calcLength(box.y); +} +function axisDeltaEquals(a, b) { + return (a.translate === b.translate && + a.scale === b.scale && + a.originPoint === b.originPoint); +} + +export { aspectRatio, axisDeltaEquals, axisEquals, axisEqualsRounded, boxEquals, boxEqualsRounded, isDeltaZero }; +//# sourceMappingURL=utils.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/geometry/utils.mjs.map b/node_modules/motion-dom/dist/es/projection/geometry/utils.mjs.map new file mode 100644 index 0000000..2cb527d --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/geometry/utils.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"utils.mjs","sources":["../../../../src/projection/geometry/utils.ts"],"sourcesContent":["import { Axis, AxisDelta, Box, Delta } from \"motion-utils\"\nimport { calcLength } from \"./delta-calc\"\n\nfunction isAxisDeltaZero(delta: AxisDelta) {\n return delta.translate === 0 && delta.scale === 1\n}\n\nexport function isDeltaZero(delta: Delta) {\n return isAxisDeltaZero(delta.x) && isAxisDeltaZero(delta.y)\n}\n\nexport function axisEquals(a: Axis, b: Axis) {\n return a.min === b.min && a.max === b.max\n}\n\nexport function boxEquals(a: Box, b: Box) {\n return axisEquals(a.x, b.x) && axisEquals(a.y, b.y)\n}\n\nexport function axisEqualsRounded(a: Axis, b: Axis) {\n return (\n Math.round(a.min) === Math.round(b.min) &&\n Math.round(a.max) === Math.round(b.max)\n )\n}\n\nexport function boxEqualsRounded(a: Box, b: Box) {\n return axisEqualsRounded(a.x, b.x) && axisEqualsRounded(a.y, b.y)\n}\n\nexport function aspectRatio(box: Box): number {\n return calcLength(box.x) / calcLength(box.y)\n}\n\nexport function axisDeltaEquals(a: AxisDelta, b: AxisDelta) {\n return (\n a.translate === b.translate &&\n a.scale === b.scale &&\n a.originPoint === b.originPoint\n )\n}\n"],"names":[],"mappings":";;AAGA,SAAS,eAAe,CAAC,KAAgB,EAAA;IACrC,OAAO,KAAK,CAAC,SAAS,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,KAAK,CAAC;AACrD;AAEM,SAAU,WAAW,CAAC,KAAY,EAAA;AACpC,IAAA,OAAO,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC;AAC/D;AAEM,SAAU,UAAU,CAAC,CAAO,EAAE,CAAO,EAAA;AACvC,IAAA,OAAO,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es/projection/node/DocumentProjectionNode.mjs new file mode 100644 index 0000000..e6755c8 --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/node/DocumentProjectionNode.mjs @@ -0,0 +1,14 @@ +import { addDomEvent } from '../../events/add-dom-event.mjs'; +import { createProjectionNode } from './create-projection-node.mjs'; + +const DocumentProjectionNode = createProjectionNode({ + attachResizeListener: (ref, notify) => addDomEvent(ref, "resize", notify), + measureScroll: () => ({ + x: document.documentElement.scrollLeft || document.body?.scrollLeft || 0, + y: document.documentElement.scrollTop || document.body?.scrollTop || 0, + }), + checkIsScrollRoot: () => true, +}); + +export { DocumentProjectionNode }; +//# sourceMappingURL=DocumentProjectionNode.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/node/DocumentProjectionNode.mjs.map b/node_modules/motion-dom/dist/es/projection/node/DocumentProjectionNode.mjs.map new file mode 100644 index 0000000..aaa5c4d --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/node/DocumentProjectionNode.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"DocumentProjectionNode.mjs","sources":["../../../../src/projection/node/DocumentProjectionNode.ts"],"sourcesContent":["import { addDomEvent } from \"../../events/add-dom-event\"\nimport { createProjectionNode } from \"./create-projection-node\"\n\nexport const DocumentProjectionNode = createProjectionNode({\n attachResizeListener: (\n ref: Window | Element,\n notify: VoidFunction\n ): VoidFunction => addDomEvent(ref, \"resize\", notify),\n measureScroll: () => ({\n x: document.documentElement.scrollLeft || document.body?.scrollLeft || 0,\n y: document.documentElement.scrollTop || document.body?.scrollTop || 0,\n }),\n checkIsScrollRoot: () => true,\n})\n"],"names":[],"mappings":";;;AAGO,MAAM,sBAAsB,GAAG,oBAAoB,CAAS;AAC/D,IAAA,oBAAoB,EAAE,CAClB,GAAqB,EACrB,MAAoB,KACL,WAAW,CAAC,GAAG,EAAE,QAAQ,EAAE,MAAM,CAAC;AACrD,IAAA,aAAa,EAAE,OAAO;AAClB,QAAA,CAAC,EAAE,QAAQ,CAAC,eAAe,CAAC,UAAU,IAAI,QAAQ,CAAC,IAAI,EAAE,UAAU,IAAI,CAAC;AACxE,QAAA,CAAC,EAAE,QAAQ,CAAC,eAAe,CAAC,SAAS,IAAI,QAAQ,CAAC,IAAI,EAAE,SAAS,IAAI,CAAC;KACzE,CAAC;AACF,IAAA,iBAAiB,EAAE,MAAM,IAAI;AAChC,CAAA;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/projection/node/HTMLProjectionNode.mjs b/node_modules/motion-dom/dist/es/projection/node/HTMLProjectionNode.mjs new file mode 100644 index 0000000..2fb7f4c --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/node/HTMLProjectionNode.mjs @@ -0,0 +1,28 @@ +import { createProjectionNode } from './create-projection-node.mjs'; +import { DocumentProjectionNode } from './DocumentProjectionNode.mjs'; + +const rootProjectionNode = { + current: undefined, +}; +const HTMLProjectionNode = createProjectionNode({ + measureScroll: (instance) => ({ + x: instance.scrollLeft, + y: instance.scrollTop, + }), + defaultParent: () => { + if (!rootProjectionNode.current) { + const documentNode = new DocumentProjectionNode({}); + documentNode.mount(window); + documentNode.setOptions({ layoutScroll: true }); + rootProjectionNode.current = documentNode; + } + return rootProjectionNode.current; + }, + resetTransform: (instance, value) => { + instance.style.transform = value !== undefined ? value : "none"; + }, + checkIsScrollRoot: (instance) => Boolean(window.getComputedStyle(instance).position === "fixed"), +}); + +export { HTMLProjectionNode, rootProjectionNode }; +//# sourceMappingURL=HTMLProjectionNode.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/node/HTMLProjectionNode.mjs.map b/node_modules/motion-dom/dist/es/projection/node/HTMLProjectionNode.mjs.map new file mode 100644 index 0000000..57d847d --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/node/HTMLProjectionNode.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"HTMLProjectionNode.mjs","sources":["../../../../src/projection/node/HTMLProjectionNode.ts"],"sourcesContent":["import { createProjectionNode } from \"./create-projection-node\"\nimport { DocumentProjectionNode } from \"./DocumentProjectionNode\"\nimport { IProjectionNode } from \"./types\"\n\nexport const rootProjectionNode: { current: IProjectionNode | undefined } = {\n current: undefined,\n}\n\nexport const HTMLProjectionNode = createProjectionNode({\n measureScroll: (instance) => ({\n x: instance.scrollLeft,\n y: instance.scrollTop,\n }),\n defaultParent: () => {\n if (!rootProjectionNode.current) {\n const documentNode = new DocumentProjectionNode({})\n documentNode.mount(window)\n documentNode.setOptions({ layoutScroll: true })\n rootProjectionNode.current = documentNode\n }\n return rootProjectionNode.current\n },\n resetTransform: (instance, value) => {\n instance.style.transform = value !== undefined ? value : \"none\"\n },\n checkIsScrollRoot: (instance) =>\n Boolean(window.getComputedStyle(instance).position === \"fixed\"),\n})\n"],"names":[],"mappings":";;;AAIO,MAAM,kBAAkB,GAA6C;AACxE,IAAA,OAAO,EAAE,SAAS;;AAGf,MAAM,kBAAkB,GAAG,oBAAoB,CAAc;AAChE,IAAA,aAAa,EAAE,CAAC,QAAQ,MAAM;QAC1B,CAAC,EAAE,QAAQ,CAAC,UAAU;QACtB,CAAC,EAAE,QAAQ,CAAC,SAAS;KACxB,CAAC;IACF,aAAa,EAAE,MAAK;AAChB,QAAA,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE;AAC7B,YAAA,MAAM,YAAY,GAAG,IAAI,sBAAsB,CAAC,EAAE,CAAC;AACnD,YAAA,YAAY,CAAC,KAAK,CAAC,MAAM,CAAC;YAC1B,YAAY,CAAC,UAAU,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC;AAC/C,YAAA,kBAAkB,CAAC,OAAO,GAAG,YAAY;QAC7C;QACA,OAAO,kBAAkB,CAAC,OAAO;IACrC,CAAC;AACD,IAAA,cAAc,EAAE,CAAC,QAAQ,EAAE,KAAK,KAAI;AAChC,QAAA,QAAQ,CAAC,KAAK,CAAC,SAAS,GAAG,KAAK,KAAK,SAAS,GAAG,KAAK,GAAG,MAAM;IACnE,CAAC;AACD,IAAA,iBAAiB,EAAE,CAAC,QAAQ,KACxB,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,QAAQ,KAAK,OAAO,CAAC;AACtE,CAAA;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/projection/node/create-projection-node.mjs b/node_modules/motion-dom/dist/es/projection/node/create-projection-node.mjs new file mode 100644 index 0000000..93311ce --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/node/create-projection-node.mjs @@ -0,0 +1,1695 @@ +import { SubscriptionManager, clamp, noop } from 'motion-utils'; +import { animateSingleValue } from '../../animation/animate/single-value.mjs'; +import { getOptimisedAppearId } from '../../animation/optimized-appear/get-appear-id.mjs'; +import { getValueTransition } from '../../animation/utils/get-value-transition.mjs'; +import { microtask } from '../../frameloop/microtask.mjs'; +import { time } from '../../frameloop/sync-time.mjs'; +import { scaleCorrectors } from '../styles/scale-correction.mjs'; +import { statsBuffer } from '../../stats/buffer.mjs'; +import { delay } from '../../utils/delay.mjs'; +import { isSVGElement } from '../../utils/is-svg-element.mjs'; +import { isSVGSVGElement } from '../../utils/is-svg-svg-element.mjs'; +import { mixNumber } from '../../utils/mix/number.mjs'; +import { motionValue } from '../../value/index.mjs'; +import { resolveMotionValue } from '../../value/utils/resolve-motion-value.mjs'; +import { mixValues } from '../animation/mix-values.mjs'; +import { copyBoxInto, copyAxisDeltaInto, copyAxisInto } from '../geometry/copy.mjs'; +import { translateAxis, transformBox, applyBoxDelta, applyTreeDeltas } from '../geometry/delta-apply.mjs'; +import { calcLength, calcRelativeBox, calcRelativePosition, calcBoxDelta, isNear } from '../geometry/delta-calc.mjs'; +import { removeBoxTransforms } from '../geometry/delta-remove.mjs'; +import { createBox, createDelta } from '../geometry/models.mjs'; +import { boxEqualsRounded, isDeltaZero, axisDeltaEquals, boxEquals, aspectRatio } from '../geometry/utils.mjs'; +import { NodeStack } from '../shared/stack.mjs'; +import { buildProjectionTransform } from '../styles/transform.mjs'; +import { eachAxis } from '../utils/each-axis.mjs'; +import { FlatTree } from '../utils/flat-tree.mjs'; +import { hasTransform, hasScale, has2DTranslate } from '../utils/has-transform.mjs'; +import { globalProjectionState } from './state.mjs'; +import { frame, cancelFrame, frameData, frameSteps } from '../../frameloop/frame.mjs'; + +const metrics = { + nodes: 0, + calculatedTargetDeltas: 0, + calculatedProjections: 0, +}; +const transformAxes = ["", "X", "Y", "Z"]; +/** + * We use 1000 as the animation target as 0-1000 maps better to pixels than 0-1 + * which has a noticeable difference in spring animations + */ +const animationTarget = 1000; +let id = 0; +function resetDistortingTransform(key, visualElement, values, sharedAnimationValues) { + const { latestValues } = visualElement; + // Record the distorting transform and then temporarily set it to 0 + if (latestValues[key]) { + values[key] = latestValues[key]; + visualElement.setStaticValue(key, 0); + if (sharedAnimationValues) { + sharedAnimationValues[key] = 0; + } + } +} +function cancelTreeOptimisedTransformAnimations(projectionNode) { + projectionNode.hasCheckedOptimisedAppear = true; + if (projectionNode.root === projectionNode) + return; + const { visualElement } = projectionNode.options; + if (!visualElement) + return; + const appearId = getOptimisedAppearId(visualElement); + if (window.MotionHasOptimisedAnimation(appearId, "transform")) { + const { layout, layoutId } = projectionNode.options; + window.MotionCancelOptimisedAnimation(appearId, "transform", frame, !(layout || layoutId)); + } + const { parent } = projectionNode; + if (parent && !parent.hasCheckedOptimisedAppear) { + cancelTreeOptimisedTransformAnimations(parent); + } +} +function createProjectionNode({ attachResizeListener, defaultParent, measureScroll, checkIsScrollRoot, resetTransform, }) { + return class ProjectionNode { + constructor(latestValues = {}, parent = defaultParent?.()) { + /** + * A unique ID generated for every projection node. + */ + this.id = id++; + /** + * An id that represents a unique session instigated by startUpdate. + */ + this.animationId = 0; + this.animationCommitId = 0; + /** + * A Set containing all this component's children. This is used to iterate + * through the children. + * + * TODO: This could be faster to iterate as a flat array stored on the root node. + */ + this.children = new Set(); + /** + * Options for the node. We use this to configure what kind of layout animations + * we should perform (if any). + */ + this.options = {}; + /** + * We use this to detect when its safe to shut down part of a projection tree. + * We have to keep projecting children for scale correction and relative projection + * until all their parents stop performing layout animations. + */ + this.isTreeAnimating = false; + this.isAnimationBlocked = false; + /** + * Flag to true if we think this layout has been changed. We can't always know this, + * currently we set it to true every time a component renders, or if it has a layoutDependency + * if that has changed between renders. Additionally, components can be grouped by LayoutGroup + * and if one node is dirtied, they all are. + */ + this.isLayoutDirty = false; + /** + * Flag to true if we think the projection calculations for this node needs + * recalculating as a result of an updated transform or layout animation. + */ + this.isProjectionDirty = false; + /** + * Flag to true if the layout *or* transform has changed. This then gets propagated + * throughout the projection tree, forcing any element below to recalculate on the next frame. + */ + this.isSharedProjectionDirty = false; + /** + * Flag transform dirty. This gets propagated throughout the whole tree but is only + * respected by shared nodes. + */ + this.isTransformDirty = false; + /** + * Block layout updates for instant layout transitions throughout the tree. + */ + this.updateManuallyBlocked = false; + this.updateBlockedByResize = false; + /** + * Set to true between the start of the first `willUpdate` call and the end of the `didUpdate` + * call. + */ + this.isUpdating = false; + /** + * If this is an SVG element we currently disable projection transforms + */ + this.isSVG = false; + /** + * Flag to true (during promotion) if a node doing an instant layout transition needs to reset + * its projection styles. + */ + this.needsReset = false; + /** + * Flags whether this node should have its transform reset prior to measuring. + */ + this.shouldResetTransform = false; + /** + * Store whether this node has been checked for optimised appear animations. As + * effects fire bottom-up, and we want to look up the tree for appear animations, + * this makes sure we only check each path once, stopping at nodes that + * have already been checked. + */ + this.hasCheckedOptimisedAppear = false; + /** + * An object representing the calculated contextual/accumulated/tree scale. + * This will be used to scale calculcated projection transforms, as these are + * calculated in screen-space but need to be scaled for elements to layoutly + * make it to their calculated destinations. + * + * TODO: Lazy-init + */ + this.treeScale = { x: 1, y: 1 }; + /** + * + */ + this.eventHandlers = new Map(); + this.hasTreeAnimated = false; + this.layoutVersion = 0; + // Note: Currently only running on root node + this.updateScheduled = false; + this.scheduleUpdate = () => this.update(); + this.projectionUpdateScheduled = false; + this.checkUpdateFailed = () => { + if (this.isUpdating) { + this.isUpdating = false; + this.clearAllSnapshots(); + } + }; + /** + * This is a multi-step process as shared nodes might be of different depths. Nodes + * are sorted by depth order, so we need to resolve the entire tree before moving to + * the next step. + */ + this.updateProjection = () => { + this.projectionUpdateScheduled = false; + /** + * Reset debug counts. Manually resetting rather than creating a new + * object each frame. + */ + if (statsBuffer.value) { + metrics.nodes = + metrics.calculatedTargetDeltas = + metrics.calculatedProjections = + 0; + } + this.nodes.forEach(propagateDirtyNodes); + this.nodes.forEach(resolveTargetDelta); + this.nodes.forEach(calcProjection); + this.nodes.forEach(cleanDirtyNodes); + if (statsBuffer.addProjectionMetrics) { + statsBuffer.addProjectionMetrics(metrics); + } + }; + /** + * Frame calculations + */ + this.resolvedRelativeTargetAt = 0.0; + this.linkedParentVersion = 0; + this.hasProjected = false; + this.isVisible = true; + this.animationProgress = 0; + /** + * Shared layout + */ + // TODO Only running on root node + this.sharedNodes = new Map(); + this.latestValues = latestValues; + this.root = parent ? parent.root || parent : this; + this.path = parent ? [...parent.path, parent] : []; + this.parent = parent; + this.depth = parent ? parent.depth + 1 : 0; + for (let i = 0; i < this.path.length; i++) { + this.path[i].shouldResetTransform = true; + } + if (this.root === this) + this.nodes = new FlatTree(); + } + addEventListener(name, handler) { + if (!this.eventHandlers.has(name)) { + this.eventHandlers.set(name, new SubscriptionManager()); + } + return this.eventHandlers.get(name).add(handler); + } + notifyListeners(name, ...args) { + const subscriptionManager = this.eventHandlers.get(name); + subscriptionManager && subscriptionManager.notify(...args); + } + hasListeners(name) { + return this.eventHandlers.has(name); + } + /** + * Lifecycles + */ + mount(instance) { + if (this.instance) + return; + this.isSVG = isSVGElement(instance) && !isSVGSVGElement(instance); + this.instance = instance; + const { layoutId, layout, visualElement } = this.options; + if (visualElement && !visualElement.current) { + visualElement.mount(instance); + } + this.root.nodes.add(this); + this.parent && this.parent.children.add(this); + if (this.root.hasTreeAnimated && (layout || layoutId)) { + this.isLayoutDirty = true; + } + if (attachResizeListener) { + let cancelDelay; + let innerWidth = 0; + const resizeUnblockUpdate = () => (this.root.updateBlockedByResize = false); + // Set initial innerWidth in a frame.read callback to batch the read + frame.read(() => { + innerWidth = window.innerWidth; + }); + attachResizeListener(instance, () => { + const newInnerWidth = window.innerWidth; + if (newInnerWidth === innerWidth) + return; + innerWidth = newInnerWidth; + this.root.updateBlockedByResize = true; + cancelDelay && cancelDelay(); + cancelDelay = delay(resizeUnblockUpdate, 250); + if (globalProjectionState.hasAnimatedSinceResize) { + globalProjectionState.hasAnimatedSinceResize = false; + this.nodes.forEach(finishAnimation); + } + }); + } + if (layoutId) { + this.root.registerSharedNode(layoutId, this); + } + // Only register the handler if it requires layout animation + if (this.options.animate !== false && + visualElement && + (layoutId || layout)) { + this.addEventListener("didUpdate", ({ delta, hasLayoutChanged, hasRelativeLayoutChanged, layout: newLayout, }) => { + if (this.isTreeAnimationBlocked()) { + this.target = undefined; + this.relativeTarget = undefined; + return; + } + // TODO: Check here if an animation exists + const layoutTransition = this.options.transition || + visualElement.getDefaultTransition() || + defaultLayoutTransition; + const { onLayoutAnimationStart, onLayoutAnimationComplete, } = visualElement.getProps(); + /** + * The target layout of the element might stay the same, + * but its position relative to its parent has changed. + */ + const hasTargetChanged = !this.targetLayout || + !boxEqualsRounded(this.targetLayout, newLayout); + /* + * Note: Disabled to fix relative animations always triggering new + * layout animations. If this causes further issues, we can try + * a different approach to detecting relative target changes. + */ + // || hasRelativeLayoutChanged + /** + * If the layout hasn't seemed to have changed, it might be that the + * element is visually in the same place in the document but its position + * relative to its parent has indeed changed. So here we check for that. + */ + const hasOnlyRelativeTargetChanged = !hasLayoutChanged && hasRelativeLayoutChanged; + if (this.options.layoutRoot || + this.resumeFrom || + hasOnlyRelativeTargetChanged || + (hasLayoutChanged && + (hasTargetChanged || !this.currentAnimation))) { + if (this.resumeFrom) { + this.resumingFrom = this.resumeFrom; + this.resumingFrom.resumingFrom = undefined; + } + const animationOptions = { + ...getValueTransition(layoutTransition, "layout"), + onPlay: onLayoutAnimationStart, + onComplete: onLayoutAnimationComplete, + }; + if (visualElement.shouldReduceMotion || + this.options.layoutRoot) { + animationOptions.delay = 0; + animationOptions.type = false; + } + this.startAnimation(animationOptions); + /** + * Set animation origin after starting animation to avoid layout jump + * caused by stopping previous layout animation + */ + this.setAnimationOrigin(delta, hasOnlyRelativeTargetChanged, animationOptions + .path); + } + else { + /** + * If the layout hasn't changed and we have an animation that hasn't started yet, + * finish it immediately. Otherwise it will be animating from a location + * that was probably never committed to screen and look like a jumpy box. + */ + if (!hasLayoutChanged) { + finishAnimation(this); + } + if (this.isLead() && this.options.onExitComplete) { + this.options.onExitComplete(); + } + } + this.targetLayout = newLayout; + }); + } + } + unmount() { + this.options.layoutId && this.willUpdate(); + this.root.nodes.remove(this); + const stack = this.getStack(); + stack && stack.remove(this); + this.parent && this.parent.children.delete(this); + this.instance = undefined; + this.eventHandlers.clear(); + cancelFrame(this.updateProjection); + } + // only on the root + blockUpdate() { + this.updateManuallyBlocked = true; + } + unblockUpdate() { + this.updateManuallyBlocked = false; + } + isUpdateBlocked() { + return this.updateManuallyBlocked || this.updateBlockedByResize; + } + isTreeAnimationBlocked() { + return (this.isAnimationBlocked || + (this.parent && this.parent.isTreeAnimationBlocked()) || + false); + } + // Note: currently only running on root node + startUpdate() { + if (this.isUpdateBlocked()) + return; + this.isUpdating = true; + this.nodes && this.nodes.forEach(resetSkewAndRotation); + this.animationId++; + } + getTransformTemplate() { + const { visualElement } = this.options; + return visualElement && visualElement.getProps().transformTemplate; + } + willUpdate(shouldNotifyListeners = true) { + this.root.hasTreeAnimated = true; + if (this.root.isUpdateBlocked()) { + this.options.onExitComplete && this.options.onExitComplete(); + return; + } + /** + * If we're running optimised appear animations then these must be + * cancelled before measuring the DOM. This is so we can measure + * the true layout of the element rather than the WAAPI animation + * which will be unaffected by the resetSkewAndRotate step. + * + * Note: This is a DOM write. Worst case scenario is this is sandwiched + * between other snapshot reads which will cause unnecessary style recalculations. + * This has to happen here though, as we don't yet know which nodes will need + * snapshots in startUpdate(), but we only want to cancel optimised animations + * if a layout animation measurement is actually going to be affected by them. + */ + if (window.MotionCancelOptimisedAnimation && + !this.hasCheckedOptimisedAppear) { + cancelTreeOptimisedTransformAnimations(this); + } + !this.root.isUpdating && this.root.startUpdate(); + if (this.isLayoutDirty) + return; + this.isLayoutDirty = true; + for (let i = 0; i < this.path.length; i++) { + const node = this.path[i]; + node.shouldResetTransform = true; + /** + * Percentage translates resolve against layoutBox dimensions, + * so ancestors with them must be re-measured after transform reset. + */ + if (typeof node.latestValues.x === "string" || + typeof node.latestValues.y === "string") { + node.isLayoutDirty = true; + } + node.updateScroll("snapshot"); + if (node.options.layoutRoot) { + node.willUpdate(false); + } + } + const { layoutId, layout } = this.options; + if (layoutId === undefined && !layout) + return; + const transformTemplate = this.getTransformTemplate(); + this.prevTransformTemplateValue = transformTemplate + ? transformTemplate(this.latestValues, "") + : undefined; + this.updateSnapshot(); + shouldNotifyListeners && this.notifyListeners("willUpdate"); + } + update() { + this.updateScheduled = false; + const updateWasBlocked = this.isUpdateBlocked(); + // When doing an instant transition, we skip the layout update, + // but should still clean up the measurements so that the next + // snapshot could be taken correctly. + if (updateWasBlocked) { + const wasBlockedByResize = this.updateBlockedByResize; + this.unblockUpdate(); + this.updateBlockedByResize = false; + this.clearAllSnapshots(); + /** + * When blocked by resize, still measure layouts so + * callbacks like onLayoutMeasure fire (e.g. Reorder). + * Skip notifyLayoutUpdate to prevent animations. + */ + if (wasBlockedByResize) { + this.nodes.forEach(forceLayoutMeasure); + } + this.nodes.forEach(clearMeasurements); + return; + } + /** + * If this is a repeat of didUpdate then ignore the animation. + */ + if (this.animationId <= this.animationCommitId) { + this.nodes.forEach(clearIsLayoutDirty); + return; + } + this.animationCommitId = this.animationId; + if (!this.isUpdating) { + this.nodes.forEach(clearIsLayoutDirty); + } + else { + this.isUpdating = false; + /** + * Ensure animation-blocked nodes (e.g. during drag) + * get measured even when memoized (willUpdate skipped). + */ + this.nodes.forEach(ensureDraggedNodesSnapshotted); + /** + * Write + */ + this.nodes.forEach(resetTransformStyle); + /** + * Read ================== + */ + // Update layout measurements of updated children + this.nodes.forEach(updateLayout); + /** + * Write + */ + // Notify listeners that the layout is updated + this.nodes.forEach(notifyLayoutUpdate); + } + this.clearAllSnapshots(); + /** + * Manually flush any pending updates. Ideally + * we could leave this to the following requestAnimationFrame but this seems + * to leave a flash of incorrectly styled content. + */ + const now = time.now(); + frameData.delta = clamp(0, 1000 / 60, now - frameData.timestamp); + frameData.timestamp = now; + frameData.isProcessing = true; + frameSteps.update.process(frameData); + frameSteps.preRender.process(frameData); + frameSteps.render.process(frameData); + frameData.isProcessing = false; + } + didUpdate() { + if (!this.updateScheduled) { + this.updateScheduled = true; + microtask.read(this.scheduleUpdate); + } + } + clearAllSnapshots() { + this.nodes.forEach(clearSnapshot); + this.sharedNodes.forEach(removeLeadSnapshots); + } + scheduleUpdateProjection() { + if (!this.projectionUpdateScheduled) { + this.projectionUpdateScheduled = true; + frame.preRender(this.updateProjection, false, true); + } + } + scheduleCheckAfterUnmount() { + /** + * If the unmounting node is in a layoutGroup and did trigger a willUpdate, + * we manually call didUpdate to give a chance to the siblings to animate. + * Otherwise, cleanup all snapshots to prevents future nodes from reusing them. + */ + frame.postRender(() => { + if (this.isLayoutDirty) { + this.root.didUpdate(); + } + else { + this.root.checkUpdateFailed(); + } + }); + } + /** + * Update measurements + */ + updateSnapshot() { + if (this.snapshot || !this.instance) + return; + this.snapshot = this.measure(); + if (this.snapshot && + !calcLength(this.snapshot.measuredBox.x) && + !calcLength(this.snapshot.measuredBox.y)) { + this.snapshot = undefined; + } + } + updateLayout() { + if (!this.instance) + return; + this.updateScroll(); + if (!(this.options.alwaysMeasureLayout && this.isLead()) && + !this.isLayoutDirty) { + return; + } + /** + * When a node is mounted, it simply resumes from the prevLead's + * snapshot instead of taking a new one, but the ancestors scroll + * might have updated while the prevLead is unmounted. We need to + * update the scroll again to make sure the layout we measure is + * up to date. + */ + if (this.resumeFrom && !this.resumeFrom.instance) { + for (let i = 0; i < this.path.length; i++) { + const node = this.path[i]; + node.updateScroll(); + } + } + const prevLayout = this.layout; + this.layout = this.measure(false); + this.layoutVersion++; + if (!this.layoutCorrected) + this.layoutCorrected = createBox(); + this.isLayoutDirty = false; + this.projectionDelta = undefined; + this.notifyListeners("measure", this.layout.layoutBox); + const { visualElement } = this.options; + visualElement && + visualElement.notify("LayoutMeasure", this.layout.layoutBox, prevLayout ? prevLayout.layoutBox : undefined); + } + updateScroll(phase = "measure") { + let needsMeasurement = Boolean(this.options.layoutScroll && this.instance); + if (this.scroll && + this.scroll.animationId === this.root.animationId && + this.scroll.phase === phase) { + needsMeasurement = false; + } + if (needsMeasurement && this.instance) { + const isRoot = checkIsScrollRoot(this.instance); + this.scroll = { + animationId: this.root.animationId, + phase, + isRoot, + offset: measureScroll(this.instance), + wasRoot: this.scroll ? this.scroll.isRoot : isRoot, + }; + } + } + resetTransform() { + if (!resetTransform) + return; + const isResetRequested = this.isLayoutDirty || + this.shouldResetTransform || + this.options.alwaysMeasureLayout; + const hasProjection = this.projectionDelta && !isDeltaZero(this.projectionDelta); + const transformTemplate = this.getTransformTemplate(); + const transformTemplateValue = transformTemplate + ? transformTemplate(this.latestValues, "") + : undefined; + const transformTemplateHasChanged = transformTemplateValue !== this.prevTransformTemplateValue; + if (isResetRequested && + this.instance && + (hasProjection || + hasTransform(this.latestValues) || + transformTemplateHasChanged)) { + resetTransform(this.instance, transformTemplateValue); + this.shouldResetTransform = false; + this.scheduleRender(); + } + } + measure(removeTransform = true) { + const pageBox = this.measurePageBox(); + let layoutBox = this.removeElementScroll(pageBox); + /** + * Measurements taken during the pre-render stage + * still have transforms applied so we remove them + * via calculation. + */ + if (removeTransform) { + layoutBox = this.removeTransform(layoutBox); + } + roundBox(layoutBox); + return { + animationId: this.root.animationId, + measuredBox: pageBox, + layoutBox, + latestValues: {}, + source: this.id, + }; + } + measurePageBox() { + const { visualElement } = this.options; + if (!visualElement) + return createBox(); + const box = visualElement.measureViewportBox(); + const wasInScrollRoot = this.scroll?.wasRoot || this.path.some(checkNodeWasScrollRoot); + if (!wasInScrollRoot) { + // Remove viewport scroll to give page-relative coordinates + const { scroll } = this.root; + if (scroll) { + translateAxis(box.x, scroll.offset.x); + translateAxis(box.y, scroll.offset.y); + } + } + return box; + } + removeElementScroll(box) { + const boxWithoutScroll = createBox(); + copyBoxInto(boxWithoutScroll, box); + if (this.scroll?.wasRoot) { + return boxWithoutScroll; + } + /** + * Performance TODO: Keep a cumulative scroll offset down the tree + * rather than loop back up the path. + */ + for (let i = 0; i < this.path.length; i++) { + const node = this.path[i]; + const { scroll, options } = node; + if (node !== this.root && scroll && options.layoutScroll) { + /** + * If this is a new scroll root, we want to remove all previous scrolls + * from the viewport box. + */ + if (scroll.wasRoot) { + copyBoxInto(boxWithoutScroll, box); + } + translateAxis(boxWithoutScroll.x, scroll.offset.x); + translateAxis(boxWithoutScroll.y, scroll.offset.y); + } + } + return boxWithoutScroll; + } + applyTransform(box, transformOnly = false, output) { + const withTransforms = output || createBox(); + copyBoxInto(withTransforms, box); + for (let i = 0; i < this.path.length; i++) { + const node = this.path[i]; + if (!transformOnly && + node.options.layoutScroll && + node.scroll && + node !== node.root) { + translateAxis(withTransforms.x, -node.scroll.offset.x); + translateAxis(withTransforms.y, -node.scroll.offset.y); + } + if (!hasTransform(node.latestValues)) + continue; + transformBox(withTransforms, node.latestValues, node.layout?.layoutBox); + } + if (hasTransform(this.latestValues)) { + transformBox(withTransforms, this.latestValues, this.layout?.layoutBox); + } + return withTransforms; + } + removeTransform(box) { + const boxWithoutTransform = createBox(); + copyBoxInto(boxWithoutTransform, box); + for (let i = 0; i < this.path.length; i++) { + const node = this.path[i]; + if (!hasTransform(node.latestValues)) + continue; + let sourceBox; + if (node.instance) { + hasScale(node.latestValues) && node.updateSnapshot(); + sourceBox = createBox(); + copyBoxInto(sourceBox, node.measurePageBox()); + } + removeBoxTransforms(boxWithoutTransform, node.latestValues, node.snapshot?.layoutBox, sourceBox); + } + if (hasTransform(this.latestValues)) { + removeBoxTransforms(boxWithoutTransform, this.latestValues); + } + return boxWithoutTransform; + } + setTargetDelta(delta) { + this.targetDelta = delta; + this.root.scheduleUpdateProjection(); + this.isProjectionDirty = true; + } + setOptions(options) { + this.options = { + ...this.options, + ...options, + crossfade: options.crossfade !== undefined ? options.crossfade : true, + }; + } + clearMeasurements() { + this.scroll = undefined; + this.layout = undefined; + this.snapshot = undefined; + this.prevTransformTemplateValue = undefined; + this.targetDelta = undefined; + this.target = undefined; + this.isLayoutDirty = false; + } + forceRelativeParentToResolveTarget() { + if (!this.relativeParent) + return; + /** + * If the parent target isn't up-to-date, force it to update. + * This is an unfortunate de-optimisation as it means any updating relative + * projection will cause all the relative parents to recalculate back + * up the tree. + */ + if (this.relativeParent.resolvedRelativeTargetAt !== + frameData.timestamp) { + this.relativeParent.resolveTargetDelta(true); + } + } + resolveTargetDelta(forceRecalculation = false) { + /** + * Once the dirty status of nodes has been spread through the tree, we also + * need to check if we have a shared node of a different depth that has itself + * been dirtied. + */ + const lead = this.getLead(); + this.isProjectionDirty || (this.isProjectionDirty = lead.isProjectionDirty); + this.isTransformDirty || (this.isTransformDirty = lead.isTransformDirty); + this.isSharedProjectionDirty || (this.isSharedProjectionDirty = lead.isSharedProjectionDirty); + const isShared = Boolean(this.resumingFrom) || this !== lead; + /** + * We don't use transform for this step of processing so we don't + * need to check whether any nodes have changed transform. + */ + const canSkip = !(forceRecalculation || + (isShared && this.isSharedProjectionDirty) || + this.isProjectionDirty || + this.parent?.isProjectionDirty || + this.attemptToResolveRelativeTarget || + this.root.updateBlockedByResize); + if (canSkip) + return; + const { layout, layoutId } = this.options; + /** + * If we have no layout, we can't perform projection, so early return + */ + if (!this.layout || !(layout || layoutId)) + return; + this.resolvedRelativeTargetAt = frameData.timestamp; + const relativeParent = this.getClosestProjectingParent(); + if (relativeParent && + this.linkedParentVersion !== relativeParent.layoutVersion && + !relativeParent.options.layoutRoot) { + this.removeRelativeTarget(); + } + /** + * If we don't have a targetDelta but do have a layout, we can attempt to resolve + * a relativeParent. This will allow a component to perform scale correction + * even if no animation has started. + */ + if (!this.targetDelta && !this.relativeTarget) { + if (this.options.layoutAnchor !== false && + relativeParent && + relativeParent.layout) { + this.createRelativeTarget(relativeParent, this.layout.layoutBox, relativeParent.layout.layoutBox); + } + else { + this.removeRelativeTarget(); + } + } + /** + * If we have no relative target or no target delta our target isn't valid + * for this frame. + */ + if (!this.relativeTarget && !this.targetDelta) + return; + /** + * Lazy-init target data structure + */ + if (!this.target) { + this.target = createBox(); + this.targetWithTransforms = createBox(); + } + /** + * If we've got a relative box for this component, resolve it into a target relative to the parent. + */ + if (this.relativeTarget && + this.relativeTargetOrigin && + this.relativeParent && + this.relativeParent.target) { + this.forceRelativeParentToResolveTarget(); + calcRelativeBox(this.target, this.relativeTarget, this.relativeParent.target, this.options.layoutAnchor || undefined); + /** + * If we've only got a targetDelta, resolve it into a target + */ + } + else if (this.targetDelta) { + if (Boolean(this.resumingFrom)) { + this.applyTransform(this.layout.layoutBox, false, this.target); + } + else { + copyBoxInto(this.target, this.layout.layoutBox); + } + applyBoxDelta(this.target, this.targetDelta); + } + else { + /** + * If no target, use own layout as target + */ + copyBoxInto(this.target, this.layout.layoutBox); + } + /** + * If we've been told to attempt to resolve a relative target, do so. + */ + if (this.attemptToResolveRelativeTarget) { + this.attemptToResolveRelativeTarget = false; + if (this.options.layoutAnchor !== false && + relativeParent && + Boolean(relativeParent.resumingFrom) === + Boolean(this.resumingFrom) && + !relativeParent.options.layoutScroll && + relativeParent.target && + this.animationProgress !== 1) { + this.createRelativeTarget(relativeParent, this.target, relativeParent.target); + } + else { + this.relativeParent = this.relativeTarget = undefined; + } + } + /** + * Increase debug counter for resolved target deltas + */ + if (statsBuffer.value) { + metrics.calculatedTargetDeltas++; + } + } + getClosestProjectingParent() { + if (!this.parent || + hasScale(this.parent.latestValues) || + has2DTranslate(this.parent.latestValues)) { + return undefined; + } + if (this.parent.isProjecting()) { + return this.parent; + } + else { + return this.parent.getClosestProjectingParent(); + } + } + isProjecting() { + return Boolean((this.relativeTarget || + this.targetDelta || + this.options.layoutRoot) && + this.layout); + } + createRelativeTarget(relativeParent, layout, parentLayout) { + this.relativeParent = relativeParent; + this.linkedParentVersion = relativeParent.layoutVersion; + this.forceRelativeParentToResolveTarget(); + this.relativeTarget = createBox(); + this.relativeTargetOrigin = createBox(); + calcRelativePosition(this.relativeTargetOrigin, layout, parentLayout, this.options.layoutAnchor || undefined); + copyBoxInto(this.relativeTarget, this.relativeTargetOrigin); + } + removeRelativeTarget() { + this.relativeParent = this.relativeTarget = undefined; + } + calcProjection() { + const lead = this.getLead(); + const isShared = Boolean(this.resumingFrom) || this !== lead; + let canSkip = true; + /** + * If this is a normal layout animation and neither this node nor its nearest projecting + * is dirty then we can't skip. + */ + if (this.isProjectionDirty || this.parent?.isProjectionDirty) { + canSkip = false; + } + /** + * If this is a shared layout animation and this node's shared projection is dirty then + * we can't skip. + */ + if (isShared && + (this.isSharedProjectionDirty || this.isTransformDirty)) { + canSkip = false; + } + /** + * If we have resolved the target this frame we must recalculate the + * projection to ensure it visually represents the internal calculations. + */ + if (this.resolvedRelativeTargetAt === frameData.timestamp) { + canSkip = false; + } + if (canSkip) + return; + const { layout, layoutId } = this.options; + /** + * If this section of the tree isn't animating we can + * delete our target sources for the following frame. + */ + this.isTreeAnimating = Boolean((this.parent && this.parent.isTreeAnimating) || + this.currentAnimation || + this.pendingAnimation); + if (!this.isTreeAnimating) { + this.targetDelta = this.relativeTarget = undefined; + } + if (!this.layout || !(layout || layoutId)) + return; + /** + * Reset the corrected box with the latest values from box, as we're then going + * to perform mutative operations on it. + */ + copyBoxInto(this.layoutCorrected, this.layout.layoutBox); + /** + * Record previous tree scales before updating. + */ + const prevTreeScaleX = this.treeScale.x; + const prevTreeScaleY = this.treeScale.y; + /** + * Apply all the parent deltas to this box to produce the corrected box. This + * is the layout box, as it will appear on screen as a result of the transforms of its parents. + */ + applyTreeDeltas(this.layoutCorrected, this.treeScale, this.path, isShared); + /** + * If this layer needs to perform scale correction but doesn't have a target, + * use the layout as the target. + */ + if (lead.layout && + !lead.target && + (this.treeScale.x !== 1 || this.treeScale.y !== 1)) { + lead.target = lead.layout.layoutBox; + lead.targetWithTransforms = createBox(); + } + const { target } = lead; + if (!target) { + /** + * If we don't have a target to project into, but we were previously + * projecting, we want to remove the stored transform and schedule + * a render to ensure the elements reflect the removed transform. + */ + if (this.prevProjectionDelta) { + this.createProjectionDeltas(); + this.scheduleRender(); + } + return; + } + if (!this.projectionDelta || !this.prevProjectionDelta) { + this.createProjectionDeltas(); + } + else { + copyAxisDeltaInto(this.prevProjectionDelta.x, this.projectionDelta.x); + copyAxisDeltaInto(this.prevProjectionDelta.y, this.projectionDelta.y); + } + /** + * Update the delta between the corrected box and the target box before user-set transforms were applied. + * This will allow us to calculate the corrected borderRadius and boxShadow to compensate + * for our layout reprojection, but still allow them to be scaled correctly by the user. + * It might be that to simplify this we may want to accept that user-set scale is also corrected + * and we wouldn't have to keep and calc both deltas, OR we could support a user setting + * to allow people to choose whether these styles are corrected based on just the + * layout reprojection or the final bounding box. + */ + calcBoxDelta(this.projectionDelta, this.layoutCorrected, target, this.latestValues); + if (this.treeScale.x !== prevTreeScaleX || + this.treeScale.y !== prevTreeScaleY || + !axisDeltaEquals(this.projectionDelta.x, this.prevProjectionDelta.x) || + !axisDeltaEquals(this.projectionDelta.y, this.prevProjectionDelta.y)) { + this.hasProjected = true; + this.scheduleRender(); + this.notifyListeners("projectionUpdate", target); + } + /** + * Increase debug counter for recalculated projections + */ + if (statsBuffer.value) { + metrics.calculatedProjections++; + } + } + hide() { + this.isVisible = false; + // TODO: Schedule render + } + show() { + this.isVisible = true; + // TODO: Schedule render + } + scheduleRender(notifyAll = true) { + this.options.visualElement?.scheduleRender(); + if (notifyAll) { + const stack = this.getStack(); + stack && stack.scheduleRender(); + } + if (this.resumingFrom && !this.resumingFrom.instance) { + this.resumingFrom = undefined; + } + } + createProjectionDeltas() { + this.prevProjectionDelta = createDelta(); + this.projectionDelta = createDelta(); + this.projectionDeltaWithTransform = createDelta(); + } + setAnimationOrigin(delta, hasOnlyRelativeTargetChanged = false, pathFn) { + const snapshot = this.snapshot; + const snapshotLatestValues = snapshot ? snapshot.latestValues : {}; + const mixedValues = { ...this.latestValues }; + const targetDelta = createDelta(); + if (!this.relativeParent || + !this.relativeParent.options.layoutRoot) { + this.relativeTarget = this.relativeTargetOrigin = undefined; + } + this.attemptToResolveRelativeTarget = !hasOnlyRelativeTargetChanged; + const relativeLayout = createBox(); + const snapshotSource = snapshot ? snapshot.source : undefined; + const layoutSource = this.layout ? this.layout.source : undefined; + const isSharedLayoutAnimation = snapshotSource !== layoutSource; + const stack = this.getStack(); + const isOnlyMember = !stack || stack.members.length <= 1; + const shouldCrossfadeOpacity = Boolean(isSharedLayoutAnimation && + !isOnlyMember && + this.options.crossfade === true && + !this.path.some(hasOpacityCrossfade)); + this.animationProgress = 0; + let prevRelativeTarget; + // The path decides whether the layout shift is worth curving + // (distance floor) and resolves the interpolator from the delta. + const interpolate = pathFn?.interpolateProjection(delta); + this.mixTargetDelta = (latest) => { + const progress = latest / 1000; + const point = interpolate?.(progress); + if (point) { + targetDelta.x.translate = point.x; + targetDelta.x.scale = mixNumber(delta.x.scale, 1, progress); + targetDelta.x.origin = delta.x.origin; + targetDelta.x.originPoint = delta.x.originPoint; + targetDelta.y.translate = point.y; + targetDelta.y.scale = mixNumber(delta.y.scale, 1, progress); + targetDelta.y.origin = delta.y.origin; + targetDelta.y.originPoint = delta.y.originPoint; + } + else { + mixAxisDeltaLinear(targetDelta.x, delta.x, progress); + mixAxisDeltaLinear(targetDelta.y, delta.y, progress); + } + this.setTargetDelta(targetDelta); + if (this.relativeTarget && + this.relativeTargetOrigin && + this.layout && + this.relativeParent && + this.relativeParent.layout) { + calcRelativePosition(relativeLayout, this.layout.layoutBox, this.relativeParent.layout.layoutBox, this.options.layoutAnchor || undefined); + mixBox(this.relativeTarget, this.relativeTargetOrigin, relativeLayout, progress); + /** + * If this is an unchanged relative target we can consider the + * projection not dirty. + */ + if (prevRelativeTarget && + boxEquals(this.relativeTarget, prevRelativeTarget)) { + this.isProjectionDirty = false; + } + if (!prevRelativeTarget) + prevRelativeTarget = createBox(); + copyBoxInto(prevRelativeTarget, this.relativeTarget); + } + if (isSharedLayoutAnimation) { + this.animationValues = mixedValues; + mixValues(mixedValues, snapshotLatestValues, this.latestValues, progress, shouldCrossfadeOpacity, isOnlyMember); + } + if (point && point.rotate !== undefined) { + // Dedicated `pathRotation` channel, not `rotate`, so an + // animating `rotate` is composed with, never clobbered. + if (!this.animationValues) + this.animationValues = mixedValues; + this.animationValues.pathRotation = point.rotate; + } + this.root.scheduleUpdateProjection(); + this.scheduleRender(); + this.animationProgress = progress; + }; + this.mixTargetDelta(this.options.layoutRoot ? 1000 : 0); + } + startAnimation(options) { + this.notifyListeners("animationStart"); + this.currentAnimation?.stop(); + this.resumingFrom?.currentAnimation?.stop(); + if (this.pendingAnimation) { + cancelFrame(this.pendingAnimation); + this.pendingAnimation = undefined; + } + /** + * Start the animation in the next frame to have a frame with progress 0, + * where the target is the same as when the animation started, so we can + * calculate the relative positions correctly for instant transitions. + */ + this.pendingAnimation = frame.update(() => { + globalProjectionState.hasAnimatedSinceResize = true; + this.motionValue || (this.motionValue = motionValue(0)); + this.motionValue.jump(0, false); + this.currentAnimation = animateSingleValue(this.motionValue, [0, 1000], { + ...options, + velocity: 0, + isSync: true, + onUpdate: (latest) => { + this.mixTargetDelta(latest); + options.onUpdate && options.onUpdate(latest); + }, + onComplete: () => { + options.onComplete && options.onComplete(); + this.completeAnimation(); + }, + }); + if (this.resumingFrom) { + this.resumingFrom.currentAnimation = this.currentAnimation; + } + this.pendingAnimation = undefined; + }); + } + completeAnimation() { + if (this.resumingFrom) { + this.resumingFrom.currentAnimation = undefined; + this.resumingFrom.preserveOpacity = undefined; + } + const stack = this.getStack(); + stack && stack.exitAnimationComplete(); + this.resumingFrom = + this.currentAnimation = + this.animationValues = + undefined; + this.notifyListeners("animationComplete"); + } + finishAnimation() { + if (this.currentAnimation) { + this.mixTargetDelta && this.mixTargetDelta(animationTarget); + this.currentAnimation.stop(); + } + this.completeAnimation(); + } + applyTransformsToTarget() { + const lead = this.getLead(); + let { targetWithTransforms, target, layout, latestValues } = lead; + if (!targetWithTransforms || !target || !layout) + return; + /** + * If we're only animating position, and this element isn't the lead element, + * then instead of projecting into the lead box we instead want to calculate + * a new target that aligns the two boxes but maintains the layout shape. + */ + if (this !== lead && + this.layout && + layout && + shouldAnimatePositionOnly(this.options.animationType, this.layout.layoutBox, layout.layoutBox)) { + target = this.target || createBox(); + const xLength = calcLength(this.layout.layoutBox.x); + target.x.min = lead.target.x.min; + target.x.max = target.x.min + xLength; + const yLength = calcLength(this.layout.layoutBox.y); + target.y.min = lead.target.y.min; + target.y.max = target.y.min + yLength; + } + copyBoxInto(targetWithTransforms, target); + /** + * Apply the latest user-set transforms to the targetBox to produce the targetBoxFinal. + * This is the final box that we will then project into by calculating a transform delta and + * applying it to the corrected box. + */ + transformBox(targetWithTransforms, latestValues); + /** + * Update the delta between the corrected box and the final target box, after + * user-set transforms are applied to it. This will be used by the renderer to + * create a transform style that will reproject the element from its layout layout + * into the desired bounding box. + */ + calcBoxDelta(this.projectionDeltaWithTransform, this.layoutCorrected, targetWithTransforms, latestValues); + } + registerSharedNode(layoutId, node) { + if (!this.sharedNodes.has(layoutId)) { + this.sharedNodes.set(layoutId, new NodeStack()); + } + const stack = this.sharedNodes.get(layoutId); + stack.add(node); + const config = node.options.initialPromotionConfig; + node.promote({ + transition: config ? config.transition : undefined, + preserveFollowOpacity: config && config.shouldPreserveFollowOpacity + ? config.shouldPreserveFollowOpacity(node) + : undefined, + }); + } + isLead() { + const stack = this.getStack(); + return stack ? stack.lead === this : true; + } + getLead() { + const { layoutId } = this.options; + return layoutId ? this.getStack()?.lead || this : this; + } + getPrevLead() { + const { layoutId } = this.options; + return layoutId ? this.getStack()?.prevLead : undefined; + } + getStack() { + const { layoutId } = this.options; + if (layoutId) + return this.root.sharedNodes.get(layoutId); + } + promote({ needsReset, transition, preserveFollowOpacity, } = {}) { + const stack = this.getStack(); + if (stack) + stack.promote(this, preserveFollowOpacity); + if (needsReset) { + this.projectionDelta = undefined; + this.needsReset = true; + } + if (transition) + this.setOptions({ transition }); + } + relegate() { + const stack = this.getStack(); + if (stack) { + return stack.relegate(this); + } + else { + return false; + } + } + resetSkewAndRotation() { + const { visualElement } = this.options; + if (!visualElement) + return; + // If there's no detected skew or rotation values, we can early return without a forced render. + let hasDistortingTransform = false; + /** + * An unrolled check for rotation values. Most elements don't have any rotation and + * skipping the nested loop and new object creation is 50% faster. + */ + const { latestValues } = visualElement; + if (latestValues.z || + latestValues.rotate || + latestValues.rotateX || + latestValues.rotateY || + latestValues.rotateZ || + latestValues.skewX || + latestValues.skewY) { + hasDistortingTransform = true; + } + // If there's no distorting values, we don't need to do any more. + if (!hasDistortingTransform) + return; + const resetValues = {}; + if (latestValues.z) { + resetDistortingTransform("z", visualElement, resetValues, this.animationValues); + } + // Check the skew and rotate value of all axes and reset to 0 + for (let i = 0; i < transformAxes.length; i++) { + resetDistortingTransform(`rotate${transformAxes[i]}`, visualElement, resetValues, this.animationValues); + resetDistortingTransform(`skew${transformAxes[i]}`, visualElement, resetValues, this.animationValues); + } + // Force a render of this element to apply the transform with all skews and rotations + // set to 0. + visualElement.render(); + // Put back all the values we reset + for (const key in resetValues) { + visualElement.setStaticValue(key, resetValues[key]); + if (this.animationValues) { + this.animationValues[key] = resetValues[key]; + } + } + // Schedule a render for the next frame. This ensures we won't visually + // see the element with the reset rotate value applied. + visualElement.scheduleRender(); + } + applyProjectionStyles(targetStyle, // CSSStyleDeclaration - doesn't allow numbers to be assigned to properties + styleProp) { + if (!this.instance || this.isSVG) + return; + if (!this.isVisible) { + targetStyle.visibility = "hidden"; + return; + } + const transformTemplate = this.getTransformTemplate(); + if (this.needsReset) { + this.needsReset = false; + targetStyle.visibility = ""; + targetStyle.opacity = ""; + targetStyle.pointerEvents = + resolveMotionValue(styleProp?.pointerEvents) || ""; + targetStyle.transform = transformTemplate + ? transformTemplate(this.latestValues, "") + : "none"; + return; + } + const lead = this.getLead(); + if (!this.projectionDelta || !this.layout || !lead.target) { + if (this.options.layoutId) { + targetStyle.opacity = + this.latestValues.opacity !== undefined + ? this.latestValues.opacity + : 1; + targetStyle.pointerEvents = + resolveMotionValue(styleProp?.pointerEvents) || ""; + } + if (this.hasProjected && !hasTransform(this.latestValues)) { + targetStyle.transform = transformTemplate + ? transformTemplate({}, "") + : "none"; + this.hasProjected = false; + } + return; + } + targetStyle.visibility = ""; + const valuesToRender = lead.animationValues || lead.latestValues; + this.applyTransformsToTarget(); + let transform = buildProjectionTransform(this.projectionDeltaWithTransform, this.treeScale, valuesToRender); + if (transformTemplate) { + transform = transformTemplate(valuesToRender, transform); + } + targetStyle.transform = transform; + const { x, y } = this.projectionDelta; + targetStyle.transformOrigin = `${x.origin * 100}% ${y.origin * 100}% 0`; + if (lead.animationValues) { + /** + * If the lead component is animating, assign this either the entering/leaving + * opacity + */ + targetStyle.opacity = + lead === this + ? valuesToRender.opacity ?? + this.latestValues.opacity ?? + 1 + : this.preserveOpacity + ? this.latestValues.opacity + : valuesToRender.opacityExit; + } + else { + /** + * Or we're not animating at all, set the lead component to its layout + * opacity and other components to hidden. + */ + targetStyle.opacity = + lead === this + ? valuesToRender.opacity !== undefined + ? valuesToRender.opacity + : "" + : valuesToRender.opacityExit !== undefined + ? valuesToRender.opacityExit + : 0; + } + /** + * Apply scale correction + */ + for (const key in scaleCorrectors) { + if (valuesToRender[key] === undefined) + continue; + const { correct, applyTo, isCSSVariable } = scaleCorrectors[key]; + /** + * Only apply scale correction to the value if we have an + * active projection transform. Otherwise these values become + * vulnerable to distortion if the element changes size without + * a corresponding layout animation. + */ + const corrected = transform === "none" + ? valuesToRender[key] + : correct(valuesToRender[key], lead); + if (applyTo) { + const num = applyTo.length; + for (let i = 0; i < num; i++) { + targetStyle[applyTo[i]] = corrected; + } + } + else { + // If this is a CSS variable, set it directly on the instance. + // Replacing this function from creating styles to setting them + // would be a good place to remove per frame object creation + if (isCSSVariable) { + this.options.visualElement.renderState.vars[key] = corrected; + } + else { + targetStyle[key] = corrected; + } + } + } + /** + * Disable pointer events on follow components. This is to ensure + * that if a follow component covers a lead component it doesn't block + * pointer events on the lead. + */ + if (this.options.layoutId) { + targetStyle.pointerEvents = + lead === this + ? resolveMotionValue(styleProp?.pointerEvents) || "" + : "none"; + } + } + clearSnapshot() { + this.resumeFrom = this.snapshot = undefined; + } + // Only run on root + resetTree() { + this.root.nodes.forEach((node) => node.currentAnimation?.stop()); + this.root.nodes.forEach(clearMeasurements); + this.root.sharedNodes.clear(); + } + }; +} +function updateLayout(node) { + node.updateLayout(); +} +function notifyLayoutUpdate(node) { + const snapshot = node.resumeFrom?.snapshot || node.snapshot; + if (node.isLead() && + node.layout && + snapshot && + node.hasListeners("didUpdate")) { + const { layoutBox: layout, measuredBox: measuredLayout } = node.layout; + const { animationType } = node.options; + const isShared = snapshot.source !== node.layout.source; + // TODO Maybe we want to also resize the layout snapshot so we don't trigger + // animations for instance if layout="size" and an element has only changed position + if (animationType === "size") { + eachAxis((axis) => { + const axisSnapshot = isShared + ? snapshot.measuredBox[axis] + : snapshot.layoutBox[axis]; + const length = calcLength(axisSnapshot); + axisSnapshot.min = layout[axis].min; + axisSnapshot.max = axisSnapshot.min + length; + }); + } + else if (animationType === "x" || animationType === "y") { + const snapAxis = animationType === "x" ? "y" : "x"; + copyAxisInto(isShared + ? snapshot.measuredBox[snapAxis] + : snapshot.layoutBox[snapAxis], layout[snapAxis]); + } + else if (shouldAnimatePositionOnly(animationType, snapshot.layoutBox, layout)) { + eachAxis((axis) => { + const axisSnapshot = isShared + ? snapshot.measuredBox[axis] + : snapshot.layoutBox[axis]; + const length = calcLength(layout[axis]); + axisSnapshot.max = axisSnapshot.min + length; + /** + * Ensure relative target gets resized and rerendererd + */ + if (node.relativeTarget && !node.currentAnimation) { + node.isProjectionDirty = true; + node.relativeTarget[axis].max = + node.relativeTarget[axis].min + length; + } + }); + } + const layoutDelta = createDelta(); + calcBoxDelta(layoutDelta, layout, snapshot.layoutBox); + const visualDelta = createDelta(); + if (isShared) { + calcBoxDelta(visualDelta, node.applyTransform(measuredLayout, true), snapshot.measuredBox); + } + else { + calcBoxDelta(visualDelta, layout, snapshot.layoutBox); + } + const hasLayoutChanged = !isDeltaZero(layoutDelta); + let hasRelativeLayoutChanged = false; + if (!node.resumeFrom) { + const relativeParent = node.getClosestProjectingParent(); + /** + * If the relativeParent is itself resuming from a different element then + * the relative snapshot is not relavent + */ + if (relativeParent && !relativeParent.resumeFrom) { + const { snapshot: parentSnapshot, layout: parentLayout } = relativeParent; + if (parentSnapshot && parentLayout) { + const anchor = node.options.layoutAnchor || undefined; + const relativeSnapshot = createBox(); + calcRelativePosition(relativeSnapshot, snapshot.layoutBox, parentSnapshot.layoutBox, anchor); + const relativeLayout = createBox(); + calcRelativePosition(relativeLayout, layout, parentLayout.layoutBox, anchor); + if (!boxEqualsRounded(relativeSnapshot, relativeLayout)) { + hasRelativeLayoutChanged = true; + } + if (relativeParent.options.layoutRoot) { + node.relativeTarget = relativeLayout; + node.relativeTargetOrigin = relativeSnapshot; + node.relativeParent = relativeParent; + } + } + } + } + node.notifyListeners("didUpdate", { + layout, + snapshot, + delta: visualDelta, + layoutDelta, + hasLayoutChanged, + hasRelativeLayoutChanged, + }); + } + else if (node.isLead()) { + const { onExitComplete } = node.options; + onExitComplete && onExitComplete(); + } + /** + * Clearing transition + * TODO: Investigate why this transition is being passed in as {type: false } from Framer + * and why we need it at all + */ + node.options.transition = undefined; +} +function propagateDirtyNodes(node) { + /** + * Increase debug counter for nodes encountered this frame + */ + if (statsBuffer.value) { + metrics.nodes++; + } + if (!node.parent) + return; + /** + * If this node isn't projecting, propagate isProjectionDirty. It will have + * no performance impact but it will allow the next child that *is* projecting + * but *isn't* dirty to just check its parent to see if *any* ancestor needs + * correcting. + */ + if (!node.isProjecting()) { + node.isProjectionDirty = node.parent.isProjectionDirty; + } + /** + * Propagate isSharedProjectionDirty and isTransformDirty + * throughout the whole tree. A future revision can take another look at + * this but for safety we still recalcualte shared nodes. + */ + node.isSharedProjectionDirty || (node.isSharedProjectionDirty = Boolean(node.isProjectionDirty || + node.parent.isProjectionDirty || + node.parent.isSharedProjectionDirty)); + node.isTransformDirty || (node.isTransformDirty = node.parent.isTransformDirty); +} +function cleanDirtyNodes(node) { + node.isProjectionDirty = + node.isSharedProjectionDirty = + node.isTransformDirty = + false; +} +function clearSnapshot(node) { + node.clearSnapshot(); +} +function clearMeasurements(node) { + node.clearMeasurements(); +} +function forceLayoutMeasure(node) { + node.isLayoutDirty = true; + node.updateLayout(); +} +function clearIsLayoutDirty(node) { + node.isLayoutDirty = false; +} +/** + * When a node is animation-blocked (e.g. during drag) and its component + * didn't re-render (memoized), willUpdate() is never called so there's + * no snapshot. Use the previous layout as a snapshot and mark dirty so + * resetTransform/updateLayout/notifyLayoutUpdate process it normally. + */ +function ensureDraggedNodesSnapshotted(node) { + if (node.isAnimationBlocked && node.layout && !node.isLayoutDirty) { + node.snapshot = node.layout; + node.isLayoutDirty = true; + } +} +function resetTransformStyle(node) { + const { visualElement } = node.options; + if (visualElement && visualElement.getProps().onBeforeLayoutMeasure) { + visualElement.notify("BeforeLayoutMeasure"); + } + node.resetTransform(); +} +function finishAnimation(node) { + node.finishAnimation(); + node.targetDelta = node.relativeTarget = node.target = undefined; + node.isProjectionDirty = true; +} +function resolveTargetDelta(node) { + node.resolveTargetDelta(); +} +function calcProjection(node) { + node.calcProjection(); +} +function resetSkewAndRotation(node) { + node.resetSkewAndRotation(); +} +function removeLeadSnapshots(stack) { + stack.removeLeadSnapshot(); +} +function mixAxisDeltaLinear(output, delta, p) { + output.translate = mixNumber(delta.translate, 0, p); + output.scale = mixNumber(delta.scale, 1, p); + output.origin = delta.origin; + output.originPoint = delta.originPoint; +} +function mixAxis(output, from, to, p) { + output.min = mixNumber(from.min, to.min, p); + output.max = mixNumber(from.max, to.max, p); +} +function mixBox(output, from, to, p) { + mixAxis(output.x, from.x, to.x, p); + mixAxis(output.y, from.y, to.y, p); +} +function hasOpacityCrossfade(node) { + return (node.animationValues && node.animationValues.opacityExit !== undefined); +} +const defaultLayoutTransition = { + duration: 0.45, + ease: [0.4, 0, 0.1, 1], +}; +const userAgentContains = (string) => typeof navigator !== "undefined" && + navigator.userAgent && + navigator.userAgent.toLowerCase().includes(string); +/** + * Measured bounding boxes must be rounded in Safari and + * left untouched in Chrome, otherwise non-integer layouts within scaled-up elements + * can appear to jump. + */ +const roundPoint = userAgentContains("applewebkit/") && !userAgentContains("chrome/") + ? Math.round + : noop; +function roundAxis(axis) { + // Round to the nearest .5 pixels to support subpixel layouts + axis.min = roundPoint(axis.min); + axis.max = roundPoint(axis.max); +} +function roundBox(box) { + roundAxis(box.x); + roundAxis(box.y); +} +function shouldAnimatePositionOnly(animationType, snapshot, layout) { + return (animationType === "position" || + (animationType === "preserve-aspect" && + !isNear(aspectRatio(snapshot), aspectRatio(layout), 0.2))); +} +function checkNodeWasScrollRoot(node) { + return node !== node.root && node.scroll?.wasRoot; +} + +export { cleanDirtyNodes, createProjectionNode, mixAxis, mixBox, propagateDirtyNodes }; +//# sourceMappingURL=create-projection-node.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/node/create-projection-node.mjs.map b/node_modules/motion-dom/dist/es/projection/node/create-projection-node.mjs.map new file mode 100644 index 0000000..20479b7 --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/node/create-projection-node.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"create-projection-node.mjs","sources":["../../../../src/projection/node/create-projection-node.ts"],"sourcesContent":["import {\n Axis,\n AxisDelta,\n Box,\n clamp,\n Delta,\n noop,\n Point,\n SubscriptionManager,\n} from \"motion-utils\"\nimport { animateSingleValue } from \"../../animation/animate/single-value\"\nimport { JSAnimation } from \"../../animation/JSAnimation\"\nimport { getOptimisedAppearId } from \"../../animation/optimized-appear/get-appear-id\"\nimport {\n MotionPath,\n PathInterpolator,\n Transition,\n ValueAnimationOptions,\n} from \"../../animation/types\"\nimport { getValueTransition } from \"../../animation/utils/get-value-transition\"\nimport { cancelFrame, frame, frameData, frameSteps } from \"../../frameloop\"\nimport { microtask } from \"../../frameloop/microtask\"\nimport { time } from \"../../frameloop/sync-time\"\nimport type { Process } from \"../../frameloop/types\"\nimport { HTMLVisualElement } from \"../../render/html/HTMLVisualElement\"\nimport type { ResolvedValues } from \"../../render/types\"\nimport { scaleCorrectors } from \"../../render/utils/is-forced-motion-value\"\nimport type { MotionStyle, VisualElement } from \"../../render/VisualElement\"\nimport { statsBuffer } from \"../../stats/buffer\"\nimport { delay } from \"../../utils/delay\"\nimport { isSVGElement } from \"../../utils/is-svg-element\"\nimport { isSVGSVGElement } from \"../../utils/is-svg-svg-element\"\nimport { mixNumber } from \"../../utils/mix/number\"\nimport { MotionValue, motionValue } from \"../../value\"\nimport { resolveMotionValue } from \"../../value/utils/resolve-motion-value\"\nimport { mixValues } from \"../animation/mix-values\"\nimport { copyAxisDeltaInto, copyAxisInto, copyBoxInto } from \"../geometry/copy\"\nimport {\n applyBoxDelta,\n applyTreeDeltas,\n transformBox,\n translateAxis,\n} from \"../geometry/delta-apply\"\nimport {\n calcBoxDelta,\n calcLength,\n calcRelativeBox,\n calcRelativePosition,\n isNear,\n} from \"../geometry/delta-calc\"\nimport { removeBoxTransforms } from \"../geometry/delta-remove\"\nimport { createBox, createDelta } from \"../geometry/models\"\nimport {\n aspectRatio,\n axisDeltaEquals,\n boxEquals,\n boxEqualsRounded,\n isDeltaZero,\n} from \"../geometry/utils\"\nimport { NodeStack } from \"../shared/stack\"\nimport { buildProjectionTransform } from \"../styles/transform\"\nimport { eachAxis } from \"../utils/each-axis\"\nimport { FlatTree } from \"../utils/flat-tree\"\nimport { has2DTranslate, hasScale, hasTransform } from \"../utils/has-transform\"\nimport { globalProjectionState } from \"./state\"\nimport {\n IProjectionNode,\n LayoutEvents,\n LayoutUpdateData,\n Measurements,\n Phase,\n ProjectionNodeConfig,\n ProjectionNodeOptions,\n ScrollMeasurements,\n} from \"./types\"\n\nconst metrics = {\n nodes: 0,\n calculatedTargetDeltas: 0,\n calculatedProjections: 0,\n}\n\nconst transformAxes = [\"\", \"X\", \"Y\", \"Z\"]\n\n/**\n * We use 1000 as the animation target as 0-1000 maps better to pixels than 0-1\n * which has a noticeable difference in spring animations\n */\nconst animationTarget = 1000\n\nlet id = 0\n\nfunction resetDistortingTransform(\n key: string,\n visualElement: VisualElement,\n values: ResolvedValues,\n sharedAnimationValues?: ResolvedValues\n) {\n const { latestValues } = visualElement\n\n // Record the distorting transform and then temporarily set it to 0\n if (latestValues[key]) {\n values[key] = latestValues[key]\n visualElement.setStaticValue(key, 0)\n if (sharedAnimationValues) {\n sharedAnimationValues[key] = 0\n }\n }\n}\n\nfunction cancelTreeOptimisedTransformAnimations(\n projectionNode: IProjectionNode\n) {\n projectionNode.hasCheckedOptimisedAppear = true\n if (projectionNode.root === projectionNode) return\n\n const { visualElement } = projectionNode.options\n\n if (!visualElement) return\n\n const appearId = getOptimisedAppearId(visualElement)\n\n if (window.MotionHasOptimisedAnimation!(appearId, \"transform\")) {\n const { layout, layoutId } = projectionNode.options\n window.MotionCancelOptimisedAnimation!(\n appearId,\n \"transform\",\n frame,\n !(layout || layoutId)\n )\n }\n\n const { parent } = projectionNode\n if (parent && !parent.hasCheckedOptimisedAppear) {\n cancelTreeOptimisedTransformAnimations(parent)\n }\n}\n\nexport function createProjectionNode({\n attachResizeListener,\n defaultParent,\n measureScroll,\n checkIsScrollRoot,\n resetTransform,\n}: ProjectionNodeConfig) {\n return class ProjectionNode implements IProjectionNode {\n /**\n * A unique ID generated for every projection node.\n */\n id: number = id++\n\n /**\n * An id that represents a unique session instigated by startUpdate.\n */\n animationId: number = 0\n\n animationCommitId = 0\n\n /**\n * A reference to the platform-native node (currently this will be a HTMLElement).\n */\n instance: I | undefined\n\n /**\n * A reference to the root projection node. There'll only ever be one tree and one root.\n */\n root: IProjectionNode\n\n /**\n * A reference to this node's parent.\n */\n parent?: IProjectionNode\n\n /**\n * A path from this node to the root node. This provides a fast way to iterate\n * back up the tree.\n */\n path: IProjectionNode[]\n\n /**\n * A Set containing all this component's children. This is used to iterate\n * through the children.\n *\n * TODO: This could be faster to iterate as a flat array stored on the root node.\n */\n children = new Set()\n\n /**\n * Options for the node. We use this to configure what kind of layout animations\n * we should perform (if any).\n */\n options: ProjectionNodeOptions = {}\n\n /**\n * A snapshot of the element's state just before the current update. This is\n * hydrated when this node's `willUpdate` method is called and scrubbed at the\n * end of the tree's `didUpdate` method.\n */\n snapshot: Measurements | undefined\n\n /**\n * A box defining the element's layout relative to the page. This will have been\n * captured with all parent scrolls and projection transforms unset.\n */\n layout: Measurements | undefined\n\n /**\n * The layout used to calculate the previous layout animation. We use this to compare\n * layouts between renders and decide whether we need to trigger a new layout animation\n * or just let the current one play out.\n */\n targetLayout?: Box\n\n /**\n * A mutable data structure we use to apply all parent transforms currently\n * acting on the element's layout. It's from here we can calculate the projectionDelta\n * required to get the element from its layout into its calculated target box.\n */\n layoutCorrected: Box\n\n /**\n * An ideal projection transform we want to apply to the element. This is calculated,\n * usually when an element's layout has changed, and we want the element to look as though\n * its in its previous layout on the next frame. From there, we animated it down to 0\n * to animate the element to its new layout.\n */\n targetDelta?: Delta\n\n /**\n * A mutable structure representing the visual bounding box on the page where we want\n * and element to appear. This can be set directly but is currently derived once a frame\n * from apply targetDelta to layout.\n */\n target?: Box\n\n /**\n * A mutable structure describing a visual bounding box relative to the element's\n * projected parent. If defined, target will be derived from this rather than targetDelta.\n * If not defined, we'll attempt to calculate on the first layout animation frame\n * based on the targets calculated from targetDelta. This will transfer a layout animation\n * from viewport-relative to parent-relative.\n */\n relativeTarget?: Box\n\n relativeTargetOrigin?: Box\n relativeParent?: IProjectionNode\n\n /**\n * We use this to detect when its safe to shut down part of a projection tree.\n * We have to keep projecting children for scale correction and relative projection\n * until all their parents stop performing layout animations.\n */\n isTreeAnimating = false\n\n isAnimationBlocked = false\n\n /**\n * If true, attempt to resolve relativeTarget.\n */\n attemptToResolveRelativeTarget?: boolean\n\n /**\n * A mutable structure that represents the target as transformed by the element's\n * latest user-set transforms (ie scale, x)\n */\n targetWithTransforms?: Box\n\n /**\n * The previous projection delta, which we can compare with the newly calculated\n * projection delta to see if we need to render.\n */\n prevProjectionDelta?: Delta\n\n /**\n * A calculated transform that will project an element from its layoutCorrected\n * into the target. This will be used by children to calculate their own layoutCorrect boxes.\n */\n projectionDelta?: Delta\n\n /**\n * A calculated transform that will project an element from its layoutCorrected\n * into the targetWithTransforms.\n */\n projectionDeltaWithTransform?: Delta\n\n /**\n * If we're tracking the scroll of this element, we store it here.\n */\n scroll?: ScrollMeasurements\n\n /**\n * Flag to true if we think this layout has been changed. We can't always know this,\n * currently we set it to true every time a component renders, or if it has a layoutDependency\n * if that has changed between renders. Additionally, components can be grouped by LayoutGroup\n * and if one node is dirtied, they all are.\n */\n isLayoutDirty = false\n\n /**\n * Flag to true if we think the projection calculations for this node needs\n * recalculating as a result of an updated transform or layout animation.\n */\n isProjectionDirty = false\n\n /**\n * Flag to true if the layout *or* transform has changed. This then gets propagated\n * throughout the projection tree, forcing any element below to recalculate on the next frame.\n */\n isSharedProjectionDirty = false\n\n /**\n * Flag transform dirty. This gets propagated throughout the whole tree but is only\n * respected by shared nodes.\n */\n isTransformDirty = false\n\n /**\n * Block layout updates for instant layout transitions throughout the tree.\n */\n updateManuallyBlocked = false\n\n updateBlockedByResize = false\n\n /**\n * Set to true between the start of the first `willUpdate` call and the end of the `didUpdate`\n * call.\n */\n isUpdating = false\n\n /**\n * If this is an SVG element we currently disable projection transforms\n */\n isSVG = false\n\n /**\n * Flag to true (during promotion) if a node doing an instant layout transition needs to reset\n * its projection styles.\n */\n needsReset = false\n\n /**\n * Flags whether this node should have its transform reset prior to measuring.\n */\n shouldResetTransform = false\n\n /**\n * Store whether this node has been checked for optimised appear animations. As\n * effects fire bottom-up, and we want to look up the tree for appear animations,\n * this makes sure we only check each path once, stopping at nodes that\n * have already been checked.\n */\n hasCheckedOptimisedAppear = false\n\n /**\n * An object representing the calculated contextual/accumulated/tree scale.\n * This will be used to scale calculcated projection transforms, as these are\n * calculated in screen-space but need to be scaled for elements to layoutly\n * make it to their calculated destinations.\n *\n * TODO: Lazy-init\n */\n treeScale: Point = { x: 1, y: 1 }\n\n /**\n * Is hydrated with a projection node if an element is animating from another.\n */\n resumeFrom?: IProjectionNode\n\n /**\n * Is hydrated with a projection node if an element is animating from another.\n */\n resumingFrom?: IProjectionNode\n\n /**\n * A reference to the element's latest animated values. This is a reference shared\n * between the element's VisualElement and the ProjectionNode.\n */\n latestValues: ResolvedValues\n\n /**\n *\n */\n eventHandlers = new Map>()\n\n nodes?: FlatTree\n\n depth: number\n\n /**\n * If transformTemplate generates a different value before/after the\n * update, we need to reset the transform.\n */\n prevTransformTemplateValue: string | undefined\n\n preserveOpacity?: boolean\n\n hasTreeAnimated = false\n\n layoutVersion: number = 0\n\n constructor(\n latestValues: ResolvedValues = {},\n parent: IProjectionNode | undefined = defaultParent?.()\n ) {\n this.latestValues = latestValues\n this.root = parent ? parent.root || parent : this\n this.path = parent ? [...parent.path, parent] : []\n this.parent = parent\n\n this.depth = parent ? parent.depth + 1 : 0\n\n for (let i = 0; i < this.path.length; i++) {\n this.path[i].shouldResetTransform = true\n }\n\n if (this.root === this) this.nodes = new FlatTree()\n }\n\n addEventListener(name: LayoutEvents, handler: any) {\n if (!this.eventHandlers.has(name)) {\n this.eventHandlers.set(name, new SubscriptionManager())\n }\n\n return this.eventHandlers.get(name)!.add(handler)\n }\n\n notifyListeners(name: LayoutEvents, ...args: any) {\n const subscriptionManager = this.eventHandlers.get(name)\n subscriptionManager && subscriptionManager.notify(...args)\n }\n\n hasListeners(name: LayoutEvents) {\n return this.eventHandlers.has(name)\n }\n\n /**\n * Lifecycles\n */\n mount(instance: I) {\n if (this.instance) return\n\n this.isSVG = isSVGElement(instance) && !isSVGSVGElement(instance)\n\n this.instance = instance\n\n const { layoutId, layout, visualElement } = this.options\n if (visualElement && !visualElement.current) {\n visualElement.mount(instance)\n }\n\n this.root.nodes!.add(this)\n this.parent && this.parent.children.add(this)\n\n if (this.root.hasTreeAnimated && (layout || layoutId)) {\n this.isLayoutDirty = true\n }\n\n if (attachResizeListener) {\n let cancelDelay: VoidFunction\n let innerWidth = 0\n\n const resizeUnblockUpdate = () =>\n (this.root.updateBlockedByResize = false)\n\n // Set initial innerWidth in a frame.read callback to batch the read\n frame.read(() => {\n innerWidth = window.innerWidth\n })\n\n attachResizeListener(instance, () => {\n const newInnerWidth = window.innerWidth\n if (newInnerWidth === innerWidth) return\n\n innerWidth = newInnerWidth\n\n this.root.updateBlockedByResize = true\n\n cancelDelay && cancelDelay()\n cancelDelay = delay(resizeUnblockUpdate, 250)\n\n if (globalProjectionState.hasAnimatedSinceResize) {\n globalProjectionState.hasAnimatedSinceResize = false\n this.nodes!.forEach(finishAnimation)\n }\n })\n }\n\n if (layoutId) {\n this.root.registerSharedNode(layoutId, this)\n }\n\n // Only register the handler if it requires layout animation\n if (\n this.options.animate !== false &&\n visualElement &&\n (layoutId || layout)\n ) {\n this.addEventListener(\n \"didUpdate\",\n ({\n delta,\n hasLayoutChanged,\n hasRelativeLayoutChanged,\n layout: newLayout,\n }: LayoutUpdateData) => {\n if (this.isTreeAnimationBlocked()) {\n this.target = undefined\n this.relativeTarget = undefined\n return\n }\n\n // TODO: Check here if an animation exists\n const layoutTransition =\n this.options.transition ||\n visualElement.getDefaultTransition() ||\n defaultLayoutTransition\n\n const {\n onLayoutAnimationStart,\n onLayoutAnimationComplete,\n } = visualElement.getProps()\n\n /**\n * The target layout of the element might stay the same,\n * but its position relative to its parent has changed.\n */\n const hasTargetChanged =\n !this.targetLayout ||\n !boxEqualsRounded(this.targetLayout, newLayout)\n /*\n * Note: Disabled to fix relative animations always triggering new\n * layout animations. If this causes further issues, we can try\n * a different approach to detecting relative target changes.\n */\n // || hasRelativeLayoutChanged\n\n /**\n * If the layout hasn't seemed to have changed, it might be that the\n * element is visually in the same place in the document but its position\n * relative to its parent has indeed changed. So here we check for that.\n */\n const hasOnlyRelativeTargetChanged =\n !hasLayoutChanged && hasRelativeLayoutChanged\n\n if (\n this.options.layoutRoot ||\n this.resumeFrom ||\n hasOnlyRelativeTargetChanged ||\n (hasLayoutChanged &&\n (hasTargetChanged || !this.currentAnimation))\n ) {\n if (this.resumeFrom) {\n this.resumingFrom = this.resumeFrom\n this.resumingFrom.resumingFrom = undefined\n }\n\n const animationOptions = {\n ...getValueTransition(\n layoutTransition,\n \"layout\"\n ),\n onPlay: onLayoutAnimationStart,\n onComplete: onLayoutAnimationComplete,\n }\n\n if (\n visualElement.shouldReduceMotion ||\n this.options.layoutRoot\n ) {\n animationOptions.delay = 0\n animationOptions.type = false\n }\n\n this.startAnimation(animationOptions)\n /**\n * Set animation origin after starting animation to avoid layout jump\n * caused by stopping previous layout animation\n */\n this.setAnimationOrigin(\n delta,\n hasOnlyRelativeTargetChanged,\n (animationOptions as { path?: MotionPath })\n .path\n )\n } else {\n /**\n * If the layout hasn't changed and we have an animation that hasn't started yet,\n * finish it immediately. Otherwise it will be animating from a location\n * that was probably never committed to screen and look like a jumpy box.\n */\n\n if (!hasLayoutChanged) {\n finishAnimation(this)\n }\n\n if (this.isLead() && this.options.onExitComplete) {\n this.options.onExitComplete()\n }\n }\n\n this.targetLayout = newLayout\n }\n )\n }\n }\n\n unmount() {\n this.options.layoutId && this.willUpdate()\n this.root.nodes!.remove(this)\n const stack = this.getStack()\n stack && stack.remove(this)\n this.parent && this.parent.children.delete(this)\n this.instance = undefined\n this.eventHandlers.clear()\n\n cancelFrame(this.updateProjection)\n }\n\n // only on the root\n blockUpdate() {\n this.updateManuallyBlocked = true\n }\n\n unblockUpdate() {\n this.updateManuallyBlocked = false\n }\n\n isUpdateBlocked() {\n return this.updateManuallyBlocked || this.updateBlockedByResize\n }\n\n isTreeAnimationBlocked() {\n return (\n this.isAnimationBlocked ||\n (this.parent && this.parent.isTreeAnimationBlocked()) ||\n false\n )\n }\n\n // Note: currently only running on root node\n startUpdate() {\n if (this.isUpdateBlocked()) return\n\n this.isUpdating = true\n\n this.nodes && this.nodes.forEach(resetSkewAndRotation)\n this.animationId++\n }\n\n getTransformTemplate() {\n const { visualElement } = this.options\n return visualElement && visualElement.getProps().transformTemplate\n }\n\n willUpdate(shouldNotifyListeners = true) {\n this.root.hasTreeAnimated = true\n\n if (this.root.isUpdateBlocked()) {\n this.options.onExitComplete && this.options.onExitComplete()\n return\n }\n\n /**\n * If we're running optimised appear animations then these must be\n * cancelled before measuring the DOM. This is so we can measure\n * the true layout of the element rather than the WAAPI animation\n * which will be unaffected by the resetSkewAndRotate step.\n *\n * Note: This is a DOM write. Worst case scenario is this is sandwiched\n * between other snapshot reads which will cause unnecessary style recalculations.\n * This has to happen here though, as we don't yet know which nodes will need\n * snapshots in startUpdate(), but we only want to cancel optimised animations\n * if a layout animation measurement is actually going to be affected by them.\n */\n if (\n window.MotionCancelOptimisedAnimation &&\n !this.hasCheckedOptimisedAppear\n ) {\n cancelTreeOptimisedTransformAnimations(this)\n }\n\n !this.root.isUpdating && this.root.startUpdate()\n\n if (this.isLayoutDirty) return\n\n this.isLayoutDirty = true\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i]\n node.shouldResetTransform = true\n\n /**\n * Percentage translates resolve against layoutBox dimensions,\n * so ancestors with them must be re-measured after transform reset.\n */\n if (\n typeof node.latestValues.x === \"string\" ||\n typeof node.latestValues.y === \"string\"\n ) {\n node.isLayoutDirty = true\n }\n\n node.updateScroll(\"snapshot\")\n\n if (node.options.layoutRoot) {\n node.willUpdate(false)\n }\n }\n\n const { layoutId, layout } = this.options\n if (layoutId === undefined && !layout) return\n\n const transformTemplate = this.getTransformTemplate()\n this.prevTransformTemplateValue = transformTemplate\n ? transformTemplate(this.latestValues, \"\")\n : undefined\n\n this.updateSnapshot()\n shouldNotifyListeners && this.notifyListeners(\"willUpdate\")\n }\n\n // Note: Currently only running on root node\n updateScheduled = false\n\n update() {\n this.updateScheduled = false\n\n const updateWasBlocked = this.isUpdateBlocked()\n\n // When doing an instant transition, we skip the layout update,\n // but should still clean up the measurements so that the next\n // snapshot could be taken correctly.\n if (updateWasBlocked) {\n const wasBlockedByResize = this.updateBlockedByResize\n\n this.unblockUpdate()\n this.updateBlockedByResize = false\n this.clearAllSnapshots()\n\n /**\n * When blocked by resize, still measure layouts so\n * callbacks like onLayoutMeasure fire (e.g. Reorder).\n * Skip notifyLayoutUpdate to prevent animations.\n */\n if (wasBlockedByResize) {\n this.nodes!.forEach(forceLayoutMeasure)\n }\n\n this.nodes!.forEach(clearMeasurements)\n return\n }\n\n /**\n * If this is a repeat of didUpdate then ignore the animation.\n */\n if (this.animationId <= this.animationCommitId) {\n this.nodes!.forEach(clearIsLayoutDirty)\n return\n }\n\n this.animationCommitId = this.animationId\n\n if (!this.isUpdating) {\n this.nodes!.forEach(clearIsLayoutDirty)\n } else {\n this.isUpdating = false\n\n /**\n * Ensure animation-blocked nodes (e.g. during drag)\n * get measured even when memoized (willUpdate skipped).\n */\n this.nodes!.forEach(ensureDraggedNodesSnapshotted)\n\n /**\n * Write\n */\n this.nodes!.forEach(resetTransformStyle)\n\n /**\n * Read ==================\n */\n // Update layout measurements of updated children\n this.nodes!.forEach(updateLayout)\n\n /**\n * Write\n */\n // Notify listeners that the layout is updated\n this.nodes!.forEach(notifyLayoutUpdate)\n }\n\n this.clearAllSnapshots()\n\n /**\n * Manually flush any pending updates. Ideally\n * we could leave this to the following requestAnimationFrame but this seems\n * to leave a flash of incorrectly styled content.\n */\n const now = time.now()\n frameData.delta = clamp(0, 1000 / 60, now - frameData.timestamp)\n frameData.timestamp = now\n frameData.isProcessing = true\n frameSteps.update.process(frameData)\n frameSteps.preRender.process(frameData)\n frameSteps.render.process(frameData)\n frameData.isProcessing = false\n }\n\n scheduleUpdate = () => this.update()\n\n didUpdate() {\n if (!this.updateScheduled) {\n this.updateScheduled = true\n microtask.read(this.scheduleUpdate)\n }\n }\n\n clearAllSnapshots() {\n this.nodes!.forEach(clearSnapshot)\n this.sharedNodes.forEach(removeLeadSnapshots)\n }\n\n projectionUpdateScheduled = false\n scheduleUpdateProjection() {\n if (!this.projectionUpdateScheduled) {\n this.projectionUpdateScheduled = true\n frame.preRender(this.updateProjection, false, true)\n }\n }\n\n scheduleCheckAfterUnmount() {\n /**\n * If the unmounting node is in a layoutGroup and did trigger a willUpdate,\n * we manually call didUpdate to give a chance to the siblings to animate.\n * Otherwise, cleanup all snapshots to prevents future nodes from reusing them.\n */\n frame.postRender(() => {\n if (this.isLayoutDirty) {\n this.root.didUpdate()\n } else {\n this.root.checkUpdateFailed()\n }\n })\n }\n\n checkUpdateFailed = () => {\n if (this.isUpdating) {\n this.isUpdating = false\n this.clearAllSnapshots()\n }\n }\n\n /**\n * This is a multi-step process as shared nodes might be of different depths. Nodes\n * are sorted by depth order, so we need to resolve the entire tree before moving to\n * the next step.\n */\n updateProjection = () => {\n this.projectionUpdateScheduled = false\n\n /**\n * Reset debug counts. Manually resetting rather than creating a new\n * object each frame.\n */\n if (statsBuffer.value) {\n metrics.nodes =\n metrics.calculatedTargetDeltas =\n metrics.calculatedProjections =\n 0\n }\n\n this.nodes!.forEach(propagateDirtyNodes)\n this.nodes!.forEach(resolveTargetDelta)\n this.nodes!.forEach(calcProjection)\n this.nodes!.forEach(cleanDirtyNodes)\n\n if (statsBuffer.addProjectionMetrics) {\n statsBuffer.addProjectionMetrics(metrics)\n }\n }\n\n /**\n * Update measurements\n */\n updateSnapshot() {\n if (this.snapshot || !this.instance) return\n\n this.snapshot = this.measure()\n\n if (\n this.snapshot &&\n !calcLength(this.snapshot.measuredBox.x) &&\n !calcLength(this.snapshot.measuredBox.y)\n ) {\n this.snapshot = undefined\n }\n }\n\n updateLayout() {\n if (!this.instance) return\n\n this.updateScroll()\n\n if (\n !(this.options.alwaysMeasureLayout && this.isLead()) &&\n !this.isLayoutDirty\n ) {\n return\n }\n\n /**\n * When a node is mounted, it simply resumes from the prevLead's\n * snapshot instead of taking a new one, but the ancestors scroll\n * might have updated while the prevLead is unmounted. We need to\n * update the scroll again to make sure the layout we measure is\n * up to date.\n */\n if (this.resumeFrom && !this.resumeFrom.instance) {\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i]\n node.updateScroll()\n }\n }\n\n const prevLayout = this.layout\n this.layout = this.measure(false)\n this.layoutVersion++\n if (!this.layoutCorrected) this.layoutCorrected = createBox()\n this.isLayoutDirty = false\n this.projectionDelta = undefined\n this.notifyListeners(\"measure\", this.layout.layoutBox)\n\n const { visualElement } = this.options\n visualElement &&\n visualElement.notify(\n \"LayoutMeasure\",\n this.layout.layoutBox,\n prevLayout ? prevLayout.layoutBox : undefined\n )\n }\n\n updateScroll(phase: Phase = \"measure\") {\n let needsMeasurement = Boolean(\n this.options.layoutScroll && this.instance\n )\n\n if (\n this.scroll &&\n this.scroll.animationId === this.root.animationId &&\n this.scroll.phase === phase\n ) {\n needsMeasurement = false\n }\n\n if (needsMeasurement && this.instance) {\n const isRoot = checkIsScrollRoot(this.instance)\n this.scroll = {\n animationId: this.root.animationId,\n phase,\n isRoot,\n offset: measureScroll(this.instance),\n wasRoot: this.scroll ? this.scroll.isRoot : isRoot,\n }\n }\n }\n\n resetTransform() {\n if (!resetTransform) return\n\n const isResetRequested =\n this.isLayoutDirty ||\n this.shouldResetTransform ||\n this.options.alwaysMeasureLayout\n\n const hasProjection =\n this.projectionDelta && !isDeltaZero(this.projectionDelta)\n\n const transformTemplate = this.getTransformTemplate()\n const transformTemplateValue = transformTemplate\n ? transformTemplate(this.latestValues, \"\")\n : undefined\n\n const transformTemplateHasChanged =\n transformTemplateValue !== this.prevTransformTemplateValue\n\n if (\n isResetRequested &&\n this.instance &&\n (hasProjection ||\n hasTransform(this.latestValues) ||\n transformTemplateHasChanged)\n ) {\n resetTransform(this.instance, transformTemplateValue)\n this.shouldResetTransform = false\n this.scheduleRender()\n }\n }\n\n measure(removeTransform = true) {\n const pageBox = this.measurePageBox()\n\n let layoutBox = this.removeElementScroll(pageBox)\n\n /**\n * Measurements taken during the pre-render stage\n * still have transforms applied so we remove them\n * via calculation.\n */\n if (removeTransform) {\n layoutBox = this.removeTransform(layoutBox)\n }\n\n roundBox(layoutBox)\n\n return {\n animationId: this.root.animationId,\n measuredBox: pageBox,\n layoutBox,\n latestValues: {},\n source: this.id,\n }\n }\n\n measurePageBox() {\n const { visualElement } = this.options\n if (!visualElement) return createBox()\n\n const box = visualElement.measureViewportBox()\n\n const wasInScrollRoot =\n this.scroll?.wasRoot || this.path.some(checkNodeWasScrollRoot)\n\n if (!wasInScrollRoot) {\n // Remove viewport scroll to give page-relative coordinates\n const { scroll } = this.root\n if (scroll) {\n translateAxis(box.x, scroll.offset.x)\n translateAxis(box.y, scroll.offset.y)\n }\n }\n\n return box\n }\n\n removeElementScroll(box: Box): Box {\n const boxWithoutScroll = createBox()\n copyBoxInto(boxWithoutScroll, box)\n\n if (this.scroll?.wasRoot) {\n return boxWithoutScroll\n }\n\n /**\n * Performance TODO: Keep a cumulative scroll offset down the tree\n * rather than loop back up the path.\n */\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i]\n const { scroll, options } = node\n\n if (node !== this.root && scroll && options.layoutScroll) {\n /**\n * If this is a new scroll root, we want to remove all previous scrolls\n * from the viewport box.\n */\n if (scroll.wasRoot) {\n copyBoxInto(boxWithoutScroll, box)\n }\n\n translateAxis(boxWithoutScroll.x, scroll.offset.x)\n translateAxis(boxWithoutScroll.y, scroll.offset.y)\n }\n }\n\n return boxWithoutScroll\n }\n\n applyTransform(box: Box, transformOnly = false, output?: Box): Box {\n const withTransforms = output || createBox()\n copyBoxInto(withTransforms, box)\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i]\n\n if (\n !transformOnly &&\n node.options.layoutScroll &&\n node.scroll &&\n node !== node.root\n ) {\n translateAxis(withTransforms.x, -node.scroll.offset.x)\n translateAxis(withTransforms.y, -node.scroll.offset.y)\n }\n\n if (!hasTransform(node.latestValues)) continue\n transformBox(\n withTransforms,\n node.latestValues,\n node.layout?.layoutBox\n )\n }\n\n if (hasTransform(this.latestValues)) {\n transformBox(\n withTransforms,\n this.latestValues,\n this.layout?.layoutBox\n )\n }\n\n return withTransforms\n }\n\n removeTransform(box: Box): Box {\n const boxWithoutTransform = createBox()\n copyBoxInto(boxWithoutTransform, box)\n\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i]\n if (!hasTransform(node.latestValues)) continue\n\n let sourceBox: Box | undefined\n\n if (node.instance) {\n hasScale(node.latestValues) && node.updateSnapshot()\n sourceBox = createBox()\n copyBoxInto(sourceBox, node.measurePageBox())\n }\n\n removeBoxTransforms(\n boxWithoutTransform,\n node.latestValues,\n node.snapshot?.layoutBox,\n sourceBox\n )\n }\n\n if (hasTransform(this.latestValues)) {\n removeBoxTransforms(boxWithoutTransform, this.latestValues)\n }\n\n return boxWithoutTransform\n }\n\n setTargetDelta(delta: Delta) {\n this.targetDelta = delta\n this.root.scheduleUpdateProjection()\n this.isProjectionDirty = true\n }\n\n setOptions(options: ProjectionNodeOptions) {\n this.options = {\n ...this.options,\n ...options,\n crossfade:\n options.crossfade !== undefined ? options.crossfade : true,\n }\n }\n\n clearMeasurements() {\n this.scroll = undefined\n this.layout = undefined\n this.snapshot = undefined\n this.prevTransformTemplateValue = undefined\n this.targetDelta = undefined\n this.target = undefined\n this.isLayoutDirty = false\n }\n\n forceRelativeParentToResolveTarget() {\n if (!this.relativeParent) return\n\n /**\n * If the parent target isn't up-to-date, force it to update.\n * This is an unfortunate de-optimisation as it means any updating relative\n * projection will cause all the relative parents to recalculate back\n * up the tree.\n */\n if (\n this.relativeParent.resolvedRelativeTargetAt !==\n frameData.timestamp\n ) {\n this.relativeParent.resolveTargetDelta(true)\n }\n }\n\n /**\n * Frame calculations\n */\n resolvedRelativeTargetAt: number = 0.0\n resolveTargetDelta(forceRecalculation = false) {\n /**\n * Once the dirty status of nodes has been spread through the tree, we also\n * need to check if we have a shared node of a different depth that has itself\n * been dirtied.\n */\n const lead = this.getLead()\n this.isProjectionDirty ||= lead.isProjectionDirty\n this.isTransformDirty ||= lead.isTransformDirty\n this.isSharedProjectionDirty ||= lead.isSharedProjectionDirty\n\n const isShared = Boolean(this.resumingFrom) || this !== lead\n\n /**\n * We don't use transform for this step of processing so we don't\n * need to check whether any nodes have changed transform.\n */\n const canSkip = !(\n forceRecalculation ||\n (isShared && this.isSharedProjectionDirty) ||\n this.isProjectionDirty ||\n this.parent?.isProjectionDirty ||\n this.attemptToResolveRelativeTarget ||\n this.root.updateBlockedByResize\n )\n\n if (canSkip) return\n\n const { layout, layoutId } = this.options\n\n /**\n * If we have no layout, we can't perform projection, so early return\n */\n if (!this.layout || !(layout || layoutId)) return\n\n this.resolvedRelativeTargetAt = frameData.timestamp\n\n const relativeParent = this.getClosestProjectingParent()\n\n if (\n relativeParent &&\n this.linkedParentVersion !== relativeParent.layoutVersion &&\n !relativeParent.options.layoutRoot\n ) {\n this.removeRelativeTarget()\n }\n\n /**\n * If we don't have a targetDelta but do have a layout, we can attempt to resolve\n * a relativeParent. This will allow a component to perform scale correction\n * even if no animation has started.\n */\n if (!this.targetDelta && !this.relativeTarget) {\n if (\n this.options.layoutAnchor !== false &&\n relativeParent &&\n relativeParent.layout\n ) {\n this.createRelativeTarget(\n relativeParent,\n this.layout.layoutBox,\n relativeParent.layout.layoutBox\n )\n } else {\n this.removeRelativeTarget()\n }\n }\n\n /**\n * If we have no relative target or no target delta our target isn't valid\n * for this frame.\n */\n if (!this.relativeTarget && !this.targetDelta) return\n\n /**\n * Lazy-init target data structure\n */\n if (!this.target) {\n this.target = createBox()\n this.targetWithTransforms = createBox()\n }\n\n /**\n * If we've got a relative box for this component, resolve it into a target relative to the parent.\n */\n if (\n this.relativeTarget &&\n this.relativeTargetOrigin &&\n this.relativeParent &&\n this.relativeParent.target\n ) {\n this.forceRelativeParentToResolveTarget()\n\n calcRelativeBox(\n this.target,\n this.relativeTarget,\n this.relativeParent.target,\n this.options.layoutAnchor || undefined\n )\n\n /**\n * If we've only got a targetDelta, resolve it into a target\n */\n } else if (this.targetDelta) {\n if (Boolean(this.resumingFrom)) {\n this.applyTransform(\n this.layout.layoutBox,\n false,\n this.target\n )\n } else {\n copyBoxInto(this.target, this.layout.layoutBox)\n }\n\n applyBoxDelta(this.target, this.targetDelta)\n } else {\n /**\n * If no target, use own layout as target\n */\n copyBoxInto(this.target, this.layout.layoutBox)\n }\n\n /**\n * If we've been told to attempt to resolve a relative target, do so.\n */\n if (this.attemptToResolveRelativeTarget) {\n this.attemptToResolveRelativeTarget = false\n\n if (\n this.options.layoutAnchor !== false &&\n relativeParent &&\n Boolean(relativeParent.resumingFrom) ===\n Boolean(this.resumingFrom) &&\n !relativeParent.options.layoutScroll &&\n relativeParent.target &&\n this.animationProgress !== 1\n ) {\n this.createRelativeTarget(\n relativeParent,\n this.target,\n relativeParent.target\n )\n } else {\n this.relativeParent = this.relativeTarget = undefined\n }\n }\n\n /**\n * Increase debug counter for resolved target deltas\n */\n if (statsBuffer.value) {\n metrics.calculatedTargetDeltas++\n }\n }\n\n getClosestProjectingParent() {\n if (\n !this.parent ||\n hasScale(this.parent.latestValues) ||\n has2DTranslate(this.parent.latestValues)\n ) {\n return undefined\n }\n\n if (this.parent.isProjecting()) {\n return this.parent\n } else {\n return this.parent.getClosestProjectingParent()\n }\n }\n\n isProjecting() {\n return Boolean(\n (this.relativeTarget ||\n this.targetDelta ||\n this.options.layoutRoot) &&\n this.layout\n )\n }\n\n linkedParentVersion: number = 0\n createRelativeTarget(\n relativeParent: IProjectionNode,\n layout: Box,\n parentLayout: Box\n ) {\n this.relativeParent = relativeParent\n this.linkedParentVersion = relativeParent.layoutVersion\n this.forceRelativeParentToResolveTarget()\n this.relativeTarget = createBox()\n this.relativeTargetOrigin = createBox()\n calcRelativePosition(\n this.relativeTargetOrigin,\n layout,\n parentLayout,\n this.options.layoutAnchor || undefined\n )\n\n copyBoxInto(this.relativeTarget, this.relativeTargetOrigin)\n }\n\n removeRelativeTarget() {\n this.relativeParent = this.relativeTarget = undefined\n }\n\n hasProjected: boolean = false\n\n calcProjection() {\n const lead = this.getLead()\n const isShared = Boolean(this.resumingFrom) || this !== lead\n\n let canSkip = true\n\n /**\n * If this is a normal layout animation and neither this node nor its nearest projecting\n * is dirty then we can't skip.\n */\n if (this.isProjectionDirty || this.parent?.isProjectionDirty) {\n canSkip = false\n }\n\n /**\n * If this is a shared layout animation and this node's shared projection is dirty then\n * we can't skip.\n */\n if (\n isShared &&\n (this.isSharedProjectionDirty || this.isTransformDirty)\n ) {\n canSkip = false\n }\n\n /**\n * If we have resolved the target this frame we must recalculate the\n * projection to ensure it visually represents the internal calculations.\n */\n if (this.resolvedRelativeTargetAt === frameData.timestamp) {\n canSkip = false\n }\n\n if (canSkip) return\n\n const { layout, layoutId } = this.options\n\n /**\n * If this section of the tree isn't animating we can\n * delete our target sources for the following frame.\n */\n this.isTreeAnimating = Boolean(\n (this.parent && this.parent.isTreeAnimating) ||\n this.currentAnimation ||\n this.pendingAnimation\n )\n if (!this.isTreeAnimating) {\n this.targetDelta = this.relativeTarget = undefined\n }\n\n if (!this.layout || !(layout || layoutId)) return\n\n /**\n * Reset the corrected box with the latest values from box, as we're then going\n * to perform mutative operations on it.\n */\n copyBoxInto(this.layoutCorrected, this.layout.layoutBox)\n\n /**\n * Record previous tree scales before updating.\n */\n const prevTreeScaleX = this.treeScale.x\n const prevTreeScaleY = this.treeScale.y\n /**\n * Apply all the parent deltas to this box to produce the corrected box. This\n * is the layout box, as it will appear on screen as a result of the transforms of its parents.\n */\n applyTreeDeltas(\n this.layoutCorrected,\n this.treeScale,\n this.path,\n isShared\n )\n\n /**\n * If this layer needs to perform scale correction but doesn't have a target,\n * use the layout as the target.\n */\n if (\n lead.layout &&\n !lead.target &&\n (this.treeScale.x !== 1 || this.treeScale.y !== 1)\n ) {\n lead.target = lead.layout.layoutBox\n lead.targetWithTransforms = createBox()\n }\n\n const { target } = lead\n\n if (!target) {\n /**\n * If we don't have a target to project into, but we were previously\n * projecting, we want to remove the stored transform and schedule\n * a render to ensure the elements reflect the removed transform.\n */\n if (this.prevProjectionDelta) {\n this.createProjectionDeltas()\n this.scheduleRender()\n }\n\n return\n }\n\n if (!this.projectionDelta || !this.prevProjectionDelta) {\n this.createProjectionDeltas()\n } else {\n copyAxisDeltaInto(\n this.prevProjectionDelta.x,\n this.projectionDelta.x\n )\n copyAxisDeltaInto(\n this.prevProjectionDelta.y,\n this.projectionDelta.y\n )\n }\n\n /**\n * Update the delta between the corrected box and the target box before user-set transforms were applied.\n * This will allow us to calculate the corrected borderRadius and boxShadow to compensate\n * for our layout reprojection, but still allow them to be scaled correctly by the user.\n * It might be that to simplify this we may want to accept that user-set scale is also corrected\n * and we wouldn't have to keep and calc both deltas, OR we could support a user setting\n * to allow people to choose whether these styles are corrected based on just the\n * layout reprojection or the final bounding box.\n */\n calcBoxDelta(\n this.projectionDelta!,\n this.layoutCorrected,\n target,\n this.latestValues\n )\n\n if (\n this.treeScale.x !== prevTreeScaleX ||\n this.treeScale.y !== prevTreeScaleY ||\n !axisDeltaEquals(\n this.projectionDelta!.x,\n this.prevProjectionDelta!.x\n ) ||\n !axisDeltaEquals(\n this.projectionDelta!.y,\n this.prevProjectionDelta!.y\n )\n ) {\n this.hasProjected = true\n this.scheduleRender()\n this.notifyListeners(\"projectionUpdate\", target)\n }\n\n /**\n * Increase debug counter for recalculated projections\n */\n if (statsBuffer.value) {\n metrics.calculatedProjections++\n }\n }\n\n isVisible = true\n hide() {\n this.isVisible = false\n // TODO: Schedule render\n }\n show() {\n this.isVisible = true\n // TODO: Schedule render\n }\n\n scheduleRender(notifyAll = true) {\n this.options.visualElement?.scheduleRender()\n if (notifyAll) {\n const stack = this.getStack()\n stack && stack.scheduleRender()\n }\n if (this.resumingFrom && !this.resumingFrom.instance) {\n this.resumingFrom = undefined\n }\n }\n\n createProjectionDeltas() {\n this.prevProjectionDelta = createDelta()\n this.projectionDelta = createDelta()\n this.projectionDeltaWithTransform = createDelta()\n }\n\n /**\n * Animation\n */\n animationValues?: ResolvedValues\n pendingAnimation?: Process\n currentAnimation?: JSAnimation\n mixTargetDelta: (progress: number) => void\n animationProgress = 0\n\n setAnimationOrigin(\n delta: Delta,\n hasOnlyRelativeTargetChanged: boolean = false,\n pathFn?: MotionPath\n ) {\n const snapshot = this.snapshot\n const snapshotLatestValues = snapshot ? snapshot.latestValues : {}\n const mixedValues = { ...this.latestValues }\n\n const targetDelta = createDelta()\n if (\n !this.relativeParent ||\n !this.relativeParent.options.layoutRoot\n ) {\n this.relativeTarget = this.relativeTargetOrigin = undefined\n }\n this.attemptToResolveRelativeTarget = !hasOnlyRelativeTargetChanged\n\n const relativeLayout = createBox()\n\n const snapshotSource = snapshot ? snapshot.source : undefined\n const layoutSource = this.layout ? this.layout.source : undefined\n const isSharedLayoutAnimation = snapshotSource !== layoutSource\n const stack = this.getStack()\n const isOnlyMember = !stack || stack.members.length <= 1\n const shouldCrossfadeOpacity = Boolean(\n isSharedLayoutAnimation &&\n !isOnlyMember &&\n this.options.crossfade === true &&\n !this.path.some(hasOpacityCrossfade)\n )\n\n this.animationProgress = 0\n\n let prevRelativeTarget: Box\n\n // The path decides whether the layout shift is worth curving\n // (distance floor) and resolves the interpolator from the delta.\n const interpolate: PathInterpolator | undefined =\n pathFn?.interpolateProjection(delta)\n\n this.mixTargetDelta = (latest: number) => {\n const progress = latest / 1000\n const point = interpolate?.(progress)\n\n if (point) {\n targetDelta.x.translate = point.x\n targetDelta.x.scale = mixNumber(delta.x.scale, 1, progress)\n targetDelta.x.origin = delta.x.origin\n targetDelta.x.originPoint = delta.x.originPoint\n targetDelta.y.translate = point.y\n targetDelta.y.scale = mixNumber(delta.y.scale, 1, progress)\n targetDelta.y.origin = delta.y.origin\n targetDelta.y.originPoint = delta.y.originPoint\n } else {\n mixAxisDeltaLinear(targetDelta.x, delta.x, progress)\n mixAxisDeltaLinear(targetDelta.y, delta.y, progress)\n }\n\n this.setTargetDelta(targetDelta)\n\n if (\n this.relativeTarget &&\n this.relativeTargetOrigin &&\n this.layout &&\n this.relativeParent &&\n this.relativeParent.layout\n ) {\n calcRelativePosition(\n relativeLayout,\n this.layout.layoutBox,\n this.relativeParent.layout.layoutBox,\n this.options.layoutAnchor || undefined\n )\n mixBox(\n this.relativeTarget,\n this.relativeTargetOrigin,\n relativeLayout,\n progress\n )\n\n /**\n * If this is an unchanged relative target we can consider the\n * projection not dirty.\n */\n if (\n prevRelativeTarget &&\n boxEquals(this.relativeTarget, prevRelativeTarget)\n ) {\n this.isProjectionDirty = false\n }\n\n if (!prevRelativeTarget) prevRelativeTarget = createBox()\n copyBoxInto(prevRelativeTarget, this.relativeTarget)\n }\n\n if (isSharedLayoutAnimation) {\n this.animationValues = mixedValues\n\n mixValues(\n mixedValues,\n snapshotLatestValues,\n this.latestValues,\n progress,\n shouldCrossfadeOpacity,\n isOnlyMember\n )\n }\n\n if (point && point.rotate !== undefined) {\n // Dedicated `pathRotation` channel, not `rotate`, so an\n // animating `rotate` is composed with, never clobbered.\n if (!this.animationValues)\n this.animationValues = mixedValues\n this.animationValues.pathRotation = point.rotate\n }\n\n this.root.scheduleUpdateProjection()\n this.scheduleRender()\n\n this.animationProgress = progress\n }\n\n this.mixTargetDelta(this.options.layoutRoot ? 1000 : 0)\n }\n\n motionValue?: MotionValue\n startAnimation(options: ValueAnimationOptions) {\n this.notifyListeners(\"animationStart\")\n\n this.currentAnimation?.stop()\n this.resumingFrom?.currentAnimation?.stop()\n\n if (this.pendingAnimation) {\n cancelFrame(this.pendingAnimation)\n this.pendingAnimation = undefined\n }\n\n /**\n * Start the animation in the next frame to have a frame with progress 0,\n * where the target is the same as when the animation started, so we can\n * calculate the relative positions correctly for instant transitions.\n */\n this.pendingAnimation = frame.update(() => {\n globalProjectionState.hasAnimatedSinceResize = true\n\n this.motionValue ||= motionValue(0)\n this.motionValue.jump(0, false)\n\n this.currentAnimation = animateSingleValue(\n this.motionValue,\n [0, 1000],\n {\n ...(options as any),\n velocity: 0,\n isSync: true,\n onUpdate: (latest: number) => {\n this.mixTargetDelta(latest)\n options.onUpdate && options.onUpdate(latest)\n },\n onComplete: () => {\n options.onComplete && options.onComplete()\n this.completeAnimation()\n },\n }\n ) as JSAnimation\n\n if (this.resumingFrom) {\n this.resumingFrom.currentAnimation = this.currentAnimation\n }\n\n this.pendingAnimation = undefined\n })\n }\n\n completeAnimation() {\n if (this.resumingFrom) {\n this.resumingFrom.currentAnimation = undefined\n this.resumingFrom.preserveOpacity = undefined\n }\n\n const stack = this.getStack()\n stack && stack.exitAnimationComplete()\n this.resumingFrom =\n this.currentAnimation =\n this.animationValues =\n undefined\n\n this.notifyListeners(\"animationComplete\")\n }\n\n finishAnimation() {\n if (this.currentAnimation) {\n this.mixTargetDelta && this.mixTargetDelta(animationTarget)\n this.currentAnimation.stop()\n }\n\n this.completeAnimation()\n }\n\n applyTransformsToTarget() {\n const lead = this.getLead()\n let { targetWithTransforms, target, layout, latestValues } = lead\n\n if (!targetWithTransforms || !target || !layout) return\n\n /**\n * If we're only animating position, and this element isn't the lead element,\n * then instead of projecting into the lead box we instead want to calculate\n * a new target that aligns the two boxes but maintains the layout shape.\n */\n if (\n this !== lead &&\n this.layout &&\n layout &&\n shouldAnimatePositionOnly(\n this.options.animationType,\n this.layout.layoutBox,\n layout.layoutBox\n )\n ) {\n target = this.target || createBox()\n\n const xLength = calcLength(this.layout!.layoutBox.x)\n target!.x.min = lead.target!.x.min\n target!.x.max = target.x.min + xLength\n\n const yLength = calcLength(this.layout!.layoutBox.y)\n target!.y.min = lead.target!.y.min\n target!.y.max = target.y.min + yLength\n }\n\n copyBoxInto(targetWithTransforms, target)\n\n /**\n * Apply the latest user-set transforms to the targetBox to produce the targetBoxFinal.\n * This is the final box that we will then project into by calculating a transform delta and\n * applying it to the corrected box.\n */\n transformBox(targetWithTransforms, latestValues)\n\n /**\n * Update the delta between the corrected box and the final target box, after\n * user-set transforms are applied to it. This will be used by the renderer to\n * create a transform style that will reproject the element from its layout layout\n * into the desired bounding box.\n */\n calcBoxDelta(\n this.projectionDeltaWithTransform!,\n this.layoutCorrected,\n targetWithTransforms!,\n latestValues\n )\n }\n\n /**\n * Shared layout\n */\n // TODO Only running on root node\n sharedNodes: Map = new Map()\n registerSharedNode(layoutId: string, node: IProjectionNode) {\n if (!this.sharedNodes.has(layoutId)) {\n this.sharedNodes.set(layoutId, new NodeStack())\n }\n\n const stack = this.sharedNodes.get(layoutId)!\n stack.add(node)\n\n const config = node.options.initialPromotionConfig\n node.promote({\n transition: config ? config.transition : undefined,\n preserveFollowOpacity:\n config && config.shouldPreserveFollowOpacity\n ? config.shouldPreserveFollowOpacity(node)\n : undefined,\n })\n }\n\n isLead(): boolean {\n const stack = this.getStack()\n return stack ? stack.lead === this : true\n }\n\n getLead() {\n const { layoutId } = this.options\n return layoutId ? this.getStack()?.lead || this : this\n }\n\n getPrevLead() {\n const { layoutId } = this.options\n return layoutId ? this.getStack()?.prevLead : undefined\n }\n\n getStack() {\n const { layoutId } = this.options\n if (layoutId) return this.root.sharedNodes.get(layoutId)\n }\n\n promote({\n needsReset,\n transition,\n preserveFollowOpacity,\n }: {\n needsReset?: boolean\n transition?: Transition\n preserveFollowOpacity?: boolean\n } = {}) {\n const stack = this.getStack()\n if (stack) stack.promote(this, preserveFollowOpacity)\n\n if (needsReset) {\n this.projectionDelta = undefined\n this.needsReset = true\n }\n if (transition) this.setOptions({ transition })\n }\n\n relegate(): boolean {\n const stack = this.getStack()\n if (stack) {\n return stack.relegate(this)\n } else {\n return false\n }\n }\n\n resetSkewAndRotation() {\n const { visualElement } = this.options\n\n if (!visualElement) return\n\n // If there's no detected skew or rotation values, we can early return without a forced render.\n let hasDistortingTransform = false\n\n /**\n * An unrolled check for rotation values. Most elements don't have any rotation and\n * skipping the nested loop and new object creation is 50% faster.\n */\n const { latestValues } = visualElement\n if (\n latestValues.z ||\n latestValues.rotate ||\n latestValues.rotateX ||\n latestValues.rotateY ||\n latestValues.rotateZ ||\n latestValues.skewX ||\n latestValues.skewY\n ) {\n hasDistortingTransform = true\n }\n\n // If there's no distorting values, we don't need to do any more.\n if (!hasDistortingTransform) return\n\n const resetValues: ResolvedValues = {}\n\n if (latestValues.z) {\n resetDistortingTransform(\n \"z\",\n visualElement,\n resetValues,\n this.animationValues\n )\n }\n\n // Check the skew and rotate value of all axes and reset to 0\n for (let i = 0; i < transformAxes.length; i++) {\n resetDistortingTransform(\n `rotate${transformAxes[i]}`,\n visualElement,\n resetValues,\n this.animationValues\n )\n resetDistortingTransform(\n `skew${transformAxes[i]}`,\n visualElement,\n resetValues,\n this.animationValues\n )\n }\n\n // Force a render of this element to apply the transform with all skews and rotations\n // set to 0.\n visualElement.render()\n\n // Put back all the values we reset\n for (const key in resetValues) {\n visualElement.setStaticValue(key, resetValues[key])\n if (this.animationValues) {\n this.animationValues[key] = resetValues[key]\n }\n }\n\n // Schedule a render for the next frame. This ensures we won't visually\n // see the element with the reset rotate value applied.\n visualElement.scheduleRender()\n }\n\n applyProjectionStyles(\n targetStyle: any, // CSSStyleDeclaration - doesn't allow numbers to be assigned to properties\n styleProp?: MotionStyle\n ) {\n if (!this.instance || this.isSVG) return\n\n if (!this.isVisible) {\n targetStyle.visibility = \"hidden\"\n return\n }\n\n const transformTemplate = this.getTransformTemplate()\n\n if (this.needsReset) {\n this.needsReset = false\n\n targetStyle.visibility = \"\"\n targetStyle.opacity = \"\"\n targetStyle.pointerEvents =\n resolveMotionValue(styleProp?.pointerEvents) || \"\"\n targetStyle.transform = transformTemplate\n ? transformTemplate(this.latestValues, \"\")\n : \"none\"\n return\n }\n\n const lead = this.getLead()\n if (!this.projectionDelta || !this.layout || !lead.target) {\n if (this.options.layoutId) {\n targetStyle.opacity =\n this.latestValues.opacity !== undefined\n ? this.latestValues.opacity\n : 1\n targetStyle.pointerEvents =\n resolveMotionValue(styleProp?.pointerEvents) || \"\"\n }\n if (this.hasProjected && !hasTransform(this.latestValues)) {\n targetStyle.transform = transformTemplate\n ? transformTemplate({}, \"\")\n : \"none\"\n this.hasProjected = false\n }\n\n return\n }\n\n targetStyle.visibility = \"\"\n\n const valuesToRender = lead.animationValues || lead.latestValues\n this.applyTransformsToTarget()\n\n let transform = buildProjectionTransform(\n this.projectionDeltaWithTransform!,\n this.treeScale,\n valuesToRender\n )\n\n if (transformTemplate) {\n transform = transformTemplate(valuesToRender, transform)\n }\n\n targetStyle.transform = transform\n\n const { x, y } = this.projectionDelta\n targetStyle.transformOrigin = `${x.origin * 100}% ${\n y.origin * 100\n }% 0`\n\n if (lead.animationValues) {\n /**\n * If the lead component is animating, assign this either the entering/leaving\n * opacity\n */\n targetStyle.opacity =\n lead === this\n ? valuesToRender.opacity ??\n this.latestValues.opacity ??\n 1\n : this.preserveOpacity\n ? this.latestValues.opacity\n : valuesToRender.opacityExit\n } else {\n /**\n * Or we're not animating at all, set the lead component to its layout\n * opacity and other components to hidden.\n */\n targetStyle.opacity =\n lead === this\n ? valuesToRender.opacity !== undefined\n ? valuesToRender.opacity\n : \"\"\n : valuesToRender.opacityExit !== undefined\n ? valuesToRender.opacityExit\n : 0\n }\n\n /**\n * Apply scale correction\n */\n for (const key in scaleCorrectors) {\n if (valuesToRender[key] === undefined) continue\n\n const { correct, applyTo, isCSSVariable } = scaleCorrectors[key]\n\n /**\n * Only apply scale correction to the value if we have an\n * active projection transform. Otherwise these values become\n * vulnerable to distortion if the element changes size without\n * a corresponding layout animation.\n */\n const corrected =\n transform === \"none\"\n ? valuesToRender[key]\n : correct(valuesToRender[key], lead)\n\n if (applyTo) {\n const num = applyTo.length\n for (let i = 0; i < num; i++) {\n targetStyle[applyTo[i] as any] = corrected\n }\n } else {\n // If this is a CSS variable, set it directly on the instance.\n // Replacing this function from creating styles to setting them\n // would be a good place to remove per frame object creation\n if (isCSSVariable) {\n ;(\n this.options.visualElement as HTMLVisualElement\n ).renderState.vars[key] = corrected\n } else {\n targetStyle[key as any] = corrected\n }\n }\n }\n\n /**\n * Disable pointer events on follow components. This is to ensure\n * that if a follow component covers a lead component it doesn't block\n * pointer events on the lead.\n */\n if (this.options.layoutId) {\n targetStyle.pointerEvents =\n lead === this\n ? resolveMotionValue(styleProp?.pointerEvents) || \"\"\n : \"none\"\n }\n }\n\n clearSnapshot() {\n this.resumeFrom = this.snapshot = undefined\n }\n\n // Only run on root\n resetTree() {\n this.root.nodes!.forEach((node: IProjectionNode) =>\n node.currentAnimation?.stop()\n )\n this.root.nodes!.forEach(clearMeasurements)\n this.root.sharedNodes.clear()\n }\n }\n}\n\nfunction updateLayout(node: IProjectionNode) {\n node.updateLayout()\n}\n\nfunction notifyLayoutUpdate(node: IProjectionNode) {\n const snapshot = node.resumeFrom?.snapshot || node.snapshot\n\n if (\n node.isLead() &&\n node.layout &&\n snapshot &&\n node.hasListeners(\"didUpdate\")\n ) {\n const { layoutBox: layout, measuredBox: measuredLayout } = node.layout\n const { animationType } = node.options\n\n const isShared = snapshot.source !== node.layout.source\n\n // TODO Maybe we want to also resize the layout snapshot so we don't trigger\n // animations for instance if layout=\"size\" and an element has only changed position\n if (animationType === \"size\") {\n eachAxis((axis) => {\n const axisSnapshot = isShared\n ? snapshot.measuredBox[axis]\n : snapshot.layoutBox[axis]\n const length = calcLength(axisSnapshot)\n axisSnapshot.min = layout[axis].min\n axisSnapshot.max = axisSnapshot.min + length\n })\n } else if (animationType === \"x\" || animationType === \"y\") {\n const snapAxis = animationType === \"x\" ? \"y\" : \"x\"\n copyAxisInto(\n isShared\n ? snapshot.measuredBox[snapAxis]\n : snapshot.layoutBox[snapAxis],\n layout[snapAxis]\n )\n } else if (\n shouldAnimatePositionOnly(animationType, snapshot.layoutBox, layout)\n ) {\n eachAxis((axis) => {\n const axisSnapshot = isShared\n ? snapshot.measuredBox[axis]\n : snapshot.layoutBox[axis]\n const length = calcLength(layout[axis])\n axisSnapshot.max = axisSnapshot.min + length\n\n /**\n * Ensure relative target gets resized and rerendererd\n */\n if (node.relativeTarget && !node.currentAnimation) {\n node.isProjectionDirty = true\n node.relativeTarget[axis].max =\n node.relativeTarget[axis].min + length\n }\n })\n }\n\n const layoutDelta = createDelta()\n\n calcBoxDelta(layoutDelta, layout, snapshot.layoutBox)\n const visualDelta = createDelta()\n if (isShared) {\n calcBoxDelta(\n visualDelta,\n node.applyTransform(measuredLayout, true),\n snapshot.measuredBox\n )\n } else {\n calcBoxDelta(visualDelta, layout, snapshot.layoutBox)\n }\n\n const hasLayoutChanged = !isDeltaZero(layoutDelta)\n let hasRelativeLayoutChanged = false\n\n if (!node.resumeFrom) {\n const relativeParent = node.getClosestProjectingParent()\n\n /**\n * If the relativeParent is itself resuming from a different element then\n * the relative snapshot is not relavent\n */\n if (relativeParent && !relativeParent.resumeFrom) {\n const { snapshot: parentSnapshot, layout: parentLayout } =\n relativeParent\n\n if (parentSnapshot && parentLayout) {\n const anchor =\n node.options.layoutAnchor || undefined\n\n const relativeSnapshot = createBox()\n calcRelativePosition(\n relativeSnapshot,\n snapshot.layoutBox,\n parentSnapshot.layoutBox,\n anchor\n )\n\n const relativeLayout = createBox()\n calcRelativePosition(\n relativeLayout,\n layout,\n parentLayout.layoutBox,\n anchor\n )\n\n if (!boxEqualsRounded(relativeSnapshot, relativeLayout)) {\n hasRelativeLayoutChanged = true\n }\n\n if (relativeParent.options.layoutRoot) {\n node.relativeTarget = relativeLayout\n node.relativeTargetOrigin = relativeSnapshot\n node.relativeParent = relativeParent\n }\n }\n }\n }\n\n node.notifyListeners(\"didUpdate\", {\n layout,\n snapshot,\n delta: visualDelta,\n layoutDelta,\n hasLayoutChanged,\n hasRelativeLayoutChanged,\n })\n } else if (node.isLead()) {\n const { onExitComplete } = node.options\n onExitComplete && onExitComplete()\n }\n\n /**\n * Clearing transition\n * TODO: Investigate why this transition is being passed in as {type: false } from Framer\n * and why we need it at all\n */\n node.options.transition = undefined\n}\n\nexport function propagateDirtyNodes(node: IProjectionNode) {\n /**\n * Increase debug counter for nodes encountered this frame\n */\n if (statsBuffer.value) {\n metrics.nodes++\n }\n\n if (!node.parent) return\n\n /**\n * If this node isn't projecting, propagate isProjectionDirty. It will have\n * no performance impact but it will allow the next child that *is* projecting\n * but *isn't* dirty to just check its parent to see if *any* ancestor needs\n * correcting.\n */\n if (!node.isProjecting()) {\n node.isProjectionDirty = node.parent.isProjectionDirty\n }\n\n /**\n * Propagate isSharedProjectionDirty and isTransformDirty\n * throughout the whole tree. A future revision can take another look at\n * this but for safety we still recalcualte shared nodes.\n */\n node.isSharedProjectionDirty ||= Boolean(\n node.isProjectionDirty ||\n node.parent.isProjectionDirty ||\n node.parent.isSharedProjectionDirty\n )\n\n node.isTransformDirty ||= node.parent.isTransformDirty\n}\n\nexport function cleanDirtyNodes(node: IProjectionNode) {\n node.isProjectionDirty =\n node.isSharedProjectionDirty =\n node.isTransformDirty =\n false\n}\n\nfunction clearSnapshot(node: IProjectionNode) {\n node.clearSnapshot()\n}\n\nfunction clearMeasurements(node: IProjectionNode) {\n node.clearMeasurements()\n}\n\nfunction forceLayoutMeasure(node: IProjectionNode) {\n node.isLayoutDirty = true\n node.updateLayout()\n}\n\nfunction clearIsLayoutDirty(node: IProjectionNode) {\n node.isLayoutDirty = false\n}\n\n/**\n * When a node is animation-blocked (e.g. during drag) and its component\n * didn't re-render (memoized), willUpdate() is never called so there's\n * no snapshot. Use the previous layout as a snapshot and mark dirty so\n * resetTransform/updateLayout/notifyLayoutUpdate process it normally.\n */\nfunction ensureDraggedNodesSnapshotted(node: IProjectionNode) {\n if (node.isAnimationBlocked && node.layout && !node.isLayoutDirty) {\n node.snapshot = node.layout\n node.isLayoutDirty = true\n }\n}\n\nfunction resetTransformStyle(node: IProjectionNode) {\n const { visualElement } = node.options\n if (visualElement && visualElement.getProps().onBeforeLayoutMeasure) {\n visualElement.notify(\"BeforeLayoutMeasure\")\n }\n\n node.resetTransform()\n}\n\nfunction finishAnimation(node: IProjectionNode) {\n node.finishAnimation()\n node.targetDelta = node.relativeTarget = node.target = undefined\n node.isProjectionDirty = true\n}\n\nfunction resolveTargetDelta(node: IProjectionNode) {\n node.resolveTargetDelta()\n}\n\nfunction calcProjection(node: IProjectionNode) {\n node.calcProjection()\n}\n\nfunction resetSkewAndRotation(node: IProjectionNode) {\n node.resetSkewAndRotation()\n}\n\nfunction removeLeadSnapshots(stack: NodeStack) {\n stack.removeLeadSnapshot()\n}\n\nfunction mixAxisDeltaLinear(output: AxisDelta, delta: AxisDelta, p: number) {\n output.translate = mixNumber(delta.translate, 0, p)\n output.scale = mixNumber(delta.scale, 1, p)\n output.origin = delta.origin\n output.originPoint = delta.originPoint\n}\n\nexport function mixAxis(output: Axis, from: Axis, to: Axis, p: number) {\n output.min = mixNumber(from.min, to.min, p)\n output.max = mixNumber(from.max, to.max, p)\n}\n\nexport function mixBox(output: Box, from: Box, to: Box, p: number) {\n mixAxis(output.x, from.x, to.x, p)\n mixAxis(output.y, from.y, to.y, p)\n}\n\nfunction hasOpacityCrossfade(node: IProjectionNode) {\n return (\n node.animationValues && node.animationValues.opacityExit !== undefined\n )\n}\n\nconst defaultLayoutTransition = {\n duration: 0.45,\n ease: [0.4, 0, 0.1, 1],\n}\n\nconst userAgentContains = (string: string) =>\n typeof navigator !== \"undefined\" &&\n navigator.userAgent &&\n navigator.userAgent.toLowerCase().includes(string)\n\n/**\n * Measured bounding boxes must be rounded in Safari and\n * left untouched in Chrome, otherwise non-integer layouts within scaled-up elements\n * can appear to jump.\n */\nconst roundPoint =\n userAgentContains(\"applewebkit/\") && !userAgentContains(\"chrome/\")\n ? Math.round\n : noop\n\nfunction roundAxis(axis: Axis): void {\n // Round to the nearest .5 pixels to support subpixel layouts\n axis.min = roundPoint(axis.min)\n axis.max = roundPoint(axis.max)\n}\n\nfunction roundBox(box: Box): void {\n roundAxis(box.x)\n roundAxis(box.y)\n}\n\nfunction shouldAnimatePositionOnly(\n animationType: string | undefined,\n snapshot: Box,\n layout: Box\n) {\n return (\n animationType === \"position\" ||\n (animationType === \"preserve-aspect\" &&\n !isNear(aspectRatio(snapshot), aspectRatio(layout), 0.2))\n )\n}\n\nfunction checkNodeWasScrollRoot(node: IProjectionNode) {\n return node !== node.root && node.scroll?.wasRoot\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4EA,MAAM,OAAO,GAAG;AACZ,IAAA,KAAK,EAAE,CAAC;AACR,IAAA,sBAAsB,EAAE,CAAC;AACzB,IAAA,qBAAqB,EAAE,CAAC;CAC3B;AAED,MAAM,aAAa,GAAG,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;AAEzC;;;AAGG;AACH,MAAM,eAAe,GAAG,IAAI;AAE5B,IAAI,EAAE,GAAG,CAAC;AAEV,SAAS,wBAAwB,CAC7B,GAAW,EACX,aAA4B,EAC5B,MAAsB,EACtB,qBAAsC,EAAA;AAEtC,IAAA,MAAM,EAAE,YAAY,EAAE,GAAG,aAAa;;AAGtC,IAAA,IAAI,YAAY,CAAC,GAAG,CAAC,EAAE;QACnB,MAAM,CAAC,GAAG,CAAC,GAAG,YAAY,CAAC,GAAG,CAAC;AAC/B,QAAA,aAAa,CAAC,cAAc,CAAC,GAAG,EAAE,CAAC,CAAC;QACpC,IAAI,qBAAqB,EAAE;AACvB,YAAA,qBAAqB,CAAC,GAAG,CAAC,GAAG,CAAC;QAClC;IACJ;AACJ;AAEA,SAAS,sCAAsC,CAC3C,cAA+B,EAAA;AAE/B,IAAA,cAAc,CAAC,yBAAyB,GAAG,IAAI;AAC/C,IAAA,IAAI,cAAc,CAAC,IAAI,KAAK,cAAc;QAAE;AAE5C,IAAA,MAAM,EAAE,aAAa,EAAE,GAAG,cAAc,CAAC,OAAO;AAEhD,IAAA,IAAI,CAAC,aAAa;QAAE;AAEpB,IAAA,MAAM,QAAQ,GAAG,oBAAoB,CAAC,aAAa,CAAC;IAEpD,IAAI,MAAM,CAAC,2BAA4B,CAAC,QAAQ,EAAE,WAAW,CAAC,EAAE;QAC5D,MAAM,EAAE,MAAM,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,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,EAAE,GAAG,CAAC,CAAC;AAErE;AAEA,SAAS,sBAAsB,CAAC,IAAqB,EAAA;IACjD,OAAO,IAAI,KAAK,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,EAAE,OAAO;AACrD;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/projection/node/group.mjs b/node_modules/motion-dom/dist/es/projection/node/group.mjs new file mode 100644 index 0000000..ad789a5 --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/node/group.mjs @@ -0,0 +1,25 @@ +const notify = (node) => !node.isLayoutDirty && node.willUpdate(false); +function nodeGroup() { + const nodes = new Set(); + const subscriptions = new WeakMap(); + const dirtyAll = () => nodes.forEach(notify); + return { + add: (node) => { + nodes.add(node); + subscriptions.set(node, node.addEventListener("willUpdate", dirtyAll)); + }, + remove: (node) => { + nodes.delete(node); + const unsubscribe = subscriptions.get(node); + if (unsubscribe) { + unsubscribe(); + subscriptions.delete(node); + } + dirtyAll(); + }, + dirty: dirtyAll, + }; +} + +export { nodeGroup }; +//# sourceMappingURL=group.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/node/group.mjs.map b/node_modules/motion-dom/dist/es/projection/node/group.mjs.map new file mode 100644 index 0000000..11aadc9 --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/node/group.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"group.mjs","sources":["../../../../src/projection/node/group.ts"],"sourcesContent":["import { IProjectionNode } from \"./types\"\n\nconst notify = (node: IProjectionNode) =>\n !node.isLayoutDirty && node.willUpdate(false)\n\nexport interface NodeGroup {\n add: (node: IProjectionNode) => void\n remove: (node: IProjectionNode) => void\n dirty: VoidFunction\n}\n\nexport function nodeGroup(): NodeGroup {\n const nodes = new Set()\n const subscriptions = new WeakMap void>()\n\n const dirtyAll = () => nodes.forEach(notify)\n\n return {\n add: (node) => {\n nodes.add(node)\n subscriptions.set(\n node,\n node.addEventListener(\"willUpdate\", dirtyAll)\n )\n },\n remove: (node) => {\n nodes.delete(node)\n const unsubscribe = subscriptions.get(node)\n if (unsubscribe) {\n unsubscribe()\n subscriptions.delete(node)\n }\n dirtyAll()\n },\n dirty: dirtyAll,\n }\n}\n"],"names":[],"mappings":"AAEA,MAAM,MAAM,GAAG,CAAC,IAAqB,KACjC,CAAC,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC;SAQjC,SAAS,GAAA;AACrB,IAAA,MAAM,KAAK,GAAG,IAAI,GAAG,EAAmB;AACxC,IAAA,MAAM,aAAa,GAAG,IAAI,OAAO,EAA+B;IAEhE,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;IAE5C,OAAO;AACH,QAAA,GAAG,EAAE,CAAC,IAAI,KAAI;AACV,YAAA,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC;AACf,YAAA,aAAa,CAAC,GAAG,CACb,IAAI,EACJ,IAAI,CAAC,gBAAgB,CAAC,YAAY,EAAE,QAAQ,CAAC,CAChD;QACL,CAAC;AACD,QAAA,MAAM,EAAE,CAAC,IAAI,KAAI;AACb,YAAA,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC;YAClB,MAAM,WAAW,GAAG,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC;YAC3C,IAAI,WAAW,EAAE;AACb,gBAAA,WAAW,EAAE;AACb,gBAAA,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC;YAC9B;AACA,YAAA,QAAQ,EAAE;QACd,CAAC;AACD,QAAA,KAAK,EAAE,QAAQ;KAClB;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/projection/node/state.mjs b/node_modules/motion-dom/dist/es/projection/node/state.mjs new file mode 100644 index 0000000..5ad856c --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/node/state.mjs @@ -0,0 +1,20 @@ +/** + * This should only ever be modified on the client otherwise it'll + * persist through server requests. If we need instanced states we + * could lazy-init via root. + */ +const globalProjectionState = { + /** + * Global flag as to whether the tree has animated since the last time + * we resized the window + */ + hasAnimatedSinceResize: true, + /** + * We set this to true once, on the first update. Any nodes added to the tree beyond that + * update will be given a `data-projection-id` attribute. + */ + hasEverUpdated: false, +}; + +export { globalProjectionState }; +//# sourceMappingURL=state.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/node/state.mjs.map b/node_modules/motion-dom/dist/es/projection/node/state.mjs.map new file mode 100644 index 0000000..1597f76 --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/node/state.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"state.mjs","sources":["../../../../src/projection/node/state.ts"],"sourcesContent":["/**\n * This should only ever be modified on the client otherwise it'll\n * persist through server requests. If we need instanced states we\n * could lazy-init via root.\n */\nexport const globalProjectionState = {\n /**\n * Global flag as to whether the tree has animated since the last time\n * we resized the window\n */\n hasAnimatedSinceResize: true,\n\n /**\n * We set this to true once, on the first update. Any nodes added to the tree beyond that\n * update will be given a `data-projection-id` attribute.\n */\n hasEverUpdated: false,\n}\n"],"names":[],"mappings":"AAAA;;;;AAIG;AACI,MAAM,qBAAqB,GAAG;AACjC;;;AAGG;AACH,IAAA,sBAAsB,EAAE,IAAI;AAE5B;;;AAGG;AACH,IAAA,cAAc,EAAE,KAAK;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/projection/shared/stack.mjs b/node_modules/motion-dom/dist/es/projection/shared/stack.mjs new file mode 100644 index 0000000..3dd23ec --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/shared/stack.mjs @@ -0,0 +1,85 @@ +import { addUniqueItem, removeItem } from 'motion-utils'; + +class NodeStack { + constructor() { + this.members = []; + } + add(node) { + addUniqueItem(this.members, node); + for (let i = this.members.length - 1; i >= 0; i--) { + const member = this.members[i]; + if (member === node || member === this.lead || member === this.prevLead) + continue; + const inst = member.instance; + if ((!inst || inst.isConnected === false) && !member.snapshot) { + removeItem(this.members, member); + member.unmount(); + } + } + node.scheduleRender(); + } + remove(node) { + removeItem(this.members, node); + if (node === this.prevLead) + this.prevLead = undefined; + if (node === this.lead) { + const prevLead = this.members[this.members.length - 1]; + if (prevLead) + this.promote(prevLead); + } + } + relegate(node) { + for (let i = this.members.indexOf(node) - 1; i >= 0; i--) { + const member = this.members[i]; + if (member.isPresent !== false && member.instance?.isConnected !== false) { + this.promote(member); + return true; + } + } + return false; + } + promote(node, preserveFollowOpacity) { + const prevLead = this.lead; + if (node === prevLead) + return; + this.prevLead = prevLead; + this.lead = node; + node.show(); + if (prevLead) { + prevLead.updateSnapshot(); + node.scheduleRender(); + const { layoutDependency: prevDep } = prevLead.options; + const { layoutDependency: nextDep } = node.options; + if (prevDep === undefined || prevDep !== nextDep) { + node.resumeFrom = prevLead; + if (preserveFollowOpacity) + prevLead.preserveOpacity = true; + if (prevLead.snapshot) { + node.snapshot = prevLead.snapshot; + node.snapshot.latestValues = + prevLead.animationValues || prevLead.latestValues; + } + if (node.root?.isUpdating) + node.isLayoutDirty = true; + } + if (node.options.crossfade === false) + prevLead.hide(); + } + } + exitAnimationComplete() { + this.members.forEach((member) => { + member.options.onExitComplete?.(); + member.resumingFrom?.options.onExitComplete?.(); + }); + } + scheduleRender() { + this.members.forEach((member) => member.instance && member.scheduleRender(false)); + } + removeLeadSnapshot() { + if (this.lead?.snapshot) + this.lead.snapshot = undefined; + } +} + +export { NodeStack }; +//# sourceMappingURL=stack.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/shared/stack.mjs.map b/node_modules/motion-dom/dist/es/projection/shared/stack.mjs.map new file mode 100644 index 0000000..c1b7470 --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/shared/stack.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"stack.mjs","sources":["../../../../src/projection/shared/stack.ts"],"sourcesContent":["import { addUniqueItem, removeItem } from \"motion-utils\"\nimport type { IProjectionNode } from \"../node/types\"\n\nexport class NodeStack {\n lead?: IProjectionNode\n prevLead?: IProjectionNode\n members: IProjectionNode[] = []\n\n add(node: IProjectionNode) {\n addUniqueItem(this.members, node)\n\n for (let i = this.members.length - 1; i >= 0; i--) {\n const member = this.members[i]\n if (member === node || member === this.lead || member === this.prevLead) continue\n const inst = member.instance as HTMLElement | undefined\n if ((!inst || inst.isConnected === false) && !member.snapshot) {\n removeItem(this.members, member)\n member.unmount()\n }\n }\n\n node.scheduleRender()\n }\n\n remove(node: IProjectionNode) {\n removeItem(this.members, node)\n if (node === this.prevLead) this.prevLead = undefined\n if (node === this.lead) {\n const prevLead = this.members[this.members.length - 1]\n if (prevLead) this.promote(prevLead)\n }\n }\n\n relegate(node: IProjectionNode) {\n for (let i = this.members.indexOf(node) - 1; i >= 0; i--) {\n const member = this.members[i]\n if (member.isPresent !== false && (member.instance as HTMLElement)?.isConnected !== false) {\n this.promote(member)\n return true\n }\n }\n return false\n }\n\n promote(node: IProjectionNode, preserveFollowOpacity?: boolean) {\n const prevLead = this.lead\n if (node === prevLead) return\n\n this.prevLead = prevLead\n this.lead = node\n node.show()\n\n if (prevLead) {\n prevLead.updateSnapshot()\n node.scheduleRender()\n\n const { layoutDependency: prevDep } = prevLead.options\n const { layoutDependency: nextDep } = node.options\n\n if (prevDep === undefined || prevDep !== nextDep) {\n node.resumeFrom = prevLead\n if (preserveFollowOpacity) prevLead.preserveOpacity = true\n\n if (prevLead.snapshot) {\n node.snapshot = prevLead.snapshot\n node.snapshot.latestValues =\n prevLead.animationValues || prevLead.latestValues\n }\n\n if (node.root?.isUpdating) node.isLayoutDirty = true\n }\n if (node.options.crossfade === false) prevLead.hide()\n }\n }\n\n exitAnimationComplete() {\n this.members.forEach((member) => {\n member.options.onExitComplete?.()\n member.resumingFrom?.options.onExitComplete?.()\n })\n }\n\n scheduleRender() {\n this.members.forEach(\n (member) => member.instance && member.scheduleRender(false)\n )\n }\n\n removeLeadSnapshot() {\n if (this.lead?.snapshot) this.lead.snapshot = undefined\n }\n}\n"],"names":[],"mappings":";;MAGa,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QAAQ,CAAC,YAAY;AACtB,wBAAA,QAAQ,CAAC,eAAe,IAAI,QAAQ,CAAC,YAAY;gBACzD;AAEA,gBAAA,IAAI,IAAI,CAAC,IAAI,EAAE,UAAU;AAAE,oBAAA,IAAI,CAAC,aAAa,GAAG,IAAI;YACxD;AACA,YAAA,IAAI,IAAI,CAAC,OAAO,CAAC,SAAS,KAAK,KAAK;gBAAE,QAAQ,CAAC,IAAI,EAAE;QACzD;IACJ;IAEA,qBAAqB,GAAA;QACjB,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,KAAI;AAC5B,YAAA,MAAM,CAAC,OAAO,CAAC,cAAc,IAAI;YACjC,MAAM,CAAC,YAAY,EAAE,OAAO,CAAC,cAAc,IAAI;AACnD,QAAA,CAAC,CAAC;IACN;IAEA,cAAc,GAAA;QACV,IAAI,CAAC,OAAO,CAAC,OAAO,CAChB,CAAC,MAAM,KAAK,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,CAC9D;IACL;IAEA,kBAAkB,GAAA;AACd,QAAA,IAAI,IAAI,CAAC,IAAI,EAAE,QAAQ;AAAE,YAAA,IAAI,CAAC,IAAI,CAAC,QAAQ,GAAG,SAAS;IAC3D;AACH;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/projection/styles/scale-border-radius.mjs b/node_modules/motion-dom/dist/es/projection/styles/scale-border-radius.mjs new file mode 100644 index 0000000..769cd50 --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/styles/scale-border-radius.mjs @@ -0,0 +1,42 @@ +import { px } from '../../value/types/numbers/units.mjs'; + +function pixelsToPercent(pixels, axis) { + if (axis.max === axis.min) + return 0; + return (pixels / (axis.max - axis.min)) * 100; +} +/** + * We always correct borderRadius as a percentage rather than pixels to reduce paints. + * For example, if you are projecting a box that is 100px wide with a 10px borderRadius + * into a box that is 200px wide with a 20px borderRadius, that is actually a 10% + * borderRadius in both states. If we animate between the two in pixels that will trigger + * a paint each time. If we animate between the two in percentage we'll avoid a paint. + */ +const correctBorderRadius = { + correct: (latest, node) => { + if (!node.target) + return latest; + /** + * If latest is a string, if it's a percentage we can return immediately as it's + * going to be stretched appropriately. Otherwise, if it's a pixel, convert it to a number. + */ + if (typeof latest === "string") { + if (px.test(latest)) { + latest = parseFloat(latest); + } + else { + return latest; + } + } + /** + * If latest is a number, it's a pixel value. We use the current viewportBox to calculate that + * pixel value as a percentage of each axis + */ + const x = pixelsToPercent(latest, node.target.x); + const y = pixelsToPercent(latest, node.target.y); + return `${x}% ${y}%`; + }, +}; + +export { correctBorderRadius, pixelsToPercent }; +//# sourceMappingURL=scale-border-radius.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/styles/scale-border-radius.mjs.map b/node_modules/motion-dom/dist/es/projection/styles/scale-border-radius.mjs.map new file mode 100644 index 0000000..4e1f220 --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/styles/scale-border-radius.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"scale-border-radius.mjs","sources":["../../../../src/projection/styles/scale-border-radius.ts"],"sourcesContent":["import { px } from \"../../value/types/numbers/units\"\nimport type { Axis } from \"motion-utils\"\nimport type { ScaleCorrectorDefinition } from \"./types\"\n\nexport function pixelsToPercent(pixels: number, axis: Axis): number {\n if (axis.max === axis.min) return 0\n return (pixels / (axis.max - axis.min)) * 100\n}\n\n/**\n * We always correct borderRadius as a percentage rather than pixels to reduce paints.\n * For example, if you are projecting a box that is 100px wide with a 10px borderRadius\n * into a box that is 200px wide with a 20px borderRadius, that is actually a 10%\n * borderRadius in both states. If we animate between the two in pixels that will trigger\n * a paint each time. If we animate between the two in percentage we'll avoid a paint.\n */\nexport const correctBorderRadius: ScaleCorrectorDefinition = {\n correct: (latest, node) => {\n if (!node.target) return latest\n\n /**\n * If latest is a string, if it's a percentage we can return immediately as it's\n * going to be stretched appropriately. Otherwise, if it's a pixel, convert it to a number.\n */\n if (typeof latest === \"string\") {\n if (px.test(latest)) {\n latest = parseFloat(latest)\n } else {\n return latest\n }\n }\n\n /**\n * If latest is a number, it's a pixel value. We use the current viewportBox to calculate that\n * pixel value as a percentage of each axis\n */\n const x = pixelsToPercent(latest, node.target.x)\n const y = pixelsToPercent(latest, node.target.y)\n\n return `${x}% ${y}%`\n },\n}\n"],"names":[],"mappings":";;AAIM,SAAU,eAAe,CAAC,MAAc,EAAE,IAAU,EAAA;AACtD,IAAA,IAAI,IAAI,CAAC,GAAG,KAAK,IAAI,CAAC,GAAG;AAAE,QAAA,OAAO,CAAC;AACnC,IAAA,OAAO,CAAC,MAAM,IAAI,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,GAAG;AACjD;AAEA;;;;;;AAMG;AACI,MAAM,mBAAmB,GAA6B;AACzD,IAAA,OAAO,EAAE,CAAC,MAAM,EAAE,IAAI,KAAI;QACtB,IAAI,CAAC,IAAI,CAAC,MAAM;AAAE,YAAA,OAAO,MAAM;AAE/B;;;AAGG;AACH,QAAA,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;AAC5B,YAAA,IAAI,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;AACjB,gBAAA,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;YAC/B;iBAAO;AACH,gBAAA,OAAO,MAAM;YACjB;QACJ;AAEA;;;AAGG;AACH,QAAA,MAAM,CAAC,GAAG,eAAe,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;AAChD,QAAA,MAAM,CAAC,GAAG,eAAe,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;AAEhD,QAAA,OAAO,CAAA,EAAG,CAAC,CAAA,EAAA,EAAK,CAAC,GAAG;IACxB,CAAC;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/projection/styles/scale-box-shadow.mjs b/node_modules/motion-dom/dist/es/projection/styles/scale-box-shadow.mjs new file mode 100644 index 0000000..8d6464f --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/styles/scale-box-shadow.mjs @@ -0,0 +1,36 @@ +import { complex } from '../../value/types/complex/index.mjs'; +import { mixNumber } from '../../utils/mix/number.mjs'; + +const correctBoxShadow = { + correct: (latest, { treeScale, projectionDelta }) => { + const original = latest; + const shadow = complex.parse(latest); + // TODO: Doesn't support multiple shadows + if (shadow.length > 5) + return original; + const template = complex.createTransformer(latest); + const offset = typeof shadow[0] !== "number" ? 1 : 0; + // Calculate the overall context scale + const xScale = projectionDelta.x.scale * treeScale.x; + const yScale = projectionDelta.y.scale * treeScale.y; + shadow[0 + offset] /= xScale; + shadow[1 + offset] /= yScale; + /** + * Ideally we'd correct x and y scales individually, but because blur and + * spread apply to both we have to take a scale average and apply that instead. + * We could potentially improve the outcome of this by incorporating the ratio between + * the two scales. + */ + const averageScale = mixNumber(xScale, yScale, 0.5); + // Blur + if (typeof shadow[2 + offset] === "number") + shadow[2 + offset] /= averageScale; + // Spread + if (typeof shadow[3 + offset] === "number") + shadow[3 + offset] /= averageScale; + return template(shadow); + }, +}; + +export { correctBoxShadow }; +//# sourceMappingURL=scale-box-shadow.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/styles/scale-box-shadow.mjs.map b/node_modules/motion-dom/dist/es/projection/styles/scale-box-shadow.mjs.map new file mode 100644 index 0000000..2498366 --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/styles/scale-box-shadow.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"scale-box-shadow.mjs","sources":["../../../../src/projection/styles/scale-box-shadow.ts"],"sourcesContent":["import { complex } from \"../../value/types/complex\"\nimport { mixNumber } from \"../../utils/mix/number\"\nimport type { ScaleCorrectorDefinition } from \"./types\"\n\nexport const correctBoxShadow: ScaleCorrectorDefinition = {\n correct: (latest: string, { treeScale, projectionDelta }) => {\n const original = latest\n const shadow = complex.parse(latest)\n\n // TODO: Doesn't support multiple shadows\n if (shadow.length > 5) return original\n\n const template = complex.createTransformer(latest)\n const offset = typeof shadow[0] !== \"number\" ? 1 : 0\n\n // Calculate the overall context scale\n const xScale = projectionDelta!.x.scale * treeScale!.x\n const yScale = projectionDelta!.y.scale * treeScale!.y\n\n // Scale x/y\n ;(shadow[0 + offset] as number) /= xScale\n ;(shadow[1 + offset] as number) /= yScale\n\n /**\n * Ideally we'd correct x and y scales individually, but because blur and\n * spread apply to both we have to take a scale average and apply that instead.\n * We could potentially improve the outcome of this by incorporating the ratio between\n * the two scales.\n */\n const averageScale = mixNumber(xScale, yScale, 0.5)\n\n // Blur\n if (typeof shadow[2 + offset] === \"number\")\n (shadow[2 + offset] as number) /= averageScale\n\n // Spread\n if (typeof shadow[3 + offset] === \"number\")\n (shadow[3 + offset] as number) /= averageScale\n\n return template(shadow)\n },\n}\n"],"names":[],"mappings":";;;AAIO,MAAM,gBAAgB,GAA6B;IACtD,OAAO,EAAE,CAAC,MAAc,EAAE,EAAE,SAAS,EAAE,eAAe,EAAE,KAAI;QACxD,MAAM,QAAQ,GAAG,MAAM;QACvB,MAAM,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC;;AAGpC,QAAA,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC;AAAE,YAAA,OAAO,QAAQ;QAEtC,MAAM,QAAQ,GAAG,OAAO,CAAC,iBAAiB,CAAC,MAAM,CAAC;AAClD,QAAA,MAAM,MAAM,GAAG,OAAO,MAAM,CAAC,CAAC,CAAC,KAAK,QAAQ,GAAG,CAAC,GAAG,CAAC;;QAGpD,MAAM,MAAM,GAAG,eAAgB,CAAC,CAAC,CAAC,KAAK,GAAG,SAAU,CAAC,CAAC;QACtD,MAAM,MAAM,GAAG,eAAgB,CAAC,CAAC,CAAC,KAAK,GAAG,SAAU,CAAC,CAAC;AAGpD,QAAA,MAAM,CAAC,CAAC,GAAG,MAAM,CAAY,IAAI,MAAM;AACvC,QAAA,MAAM,CAAC,CAAC,GAAG,MAAM,CAAY,IAAI,MAAM;AAEzC;;;;;AAKG;QACH,MAAM,YAAY,GAAG,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,CAAC;;QAGnD,IAAI,OAAO,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,KAAK,QAAQ;AACrC,YAAA,MAAM,CAAC,CAAC,GAAG,MAAM,CAAY,IAAI,YAAY;;QAGlD,IAAI,OAAO,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,KAAK,QAAQ;AACrC,YAAA,MAAM,CAAC,CAAC,GAAG,MAAM,CAAY,IAAI,YAAY;AAElD,QAAA,OAAO,QAAQ,CAAC,MAAM,CAAC;IAC3B,CAAC;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/projection/styles/scale-correction.mjs b/node_modules/motion-dom/dist/es/projection/styles/scale-correction.mjs new file mode 100644 index 0000000..7ae2e4e --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/styles/scale-correction.mjs @@ -0,0 +1,27 @@ +import { isCSSVariableName } from '../../animation/utils/is-css-variable.mjs'; +import { cornerRadiusProps } from '../../utils/border-radius.mjs'; +import { correctBorderRadius } from './scale-border-radius.mjs'; +import { correctBoxShadow } from './scale-box-shadow.mjs'; + +const scaleCorrectors = { + borderRadius: { + ...correctBorderRadius, + applyTo: [...cornerRadiusProps], + }, + borderTopLeftRadius: correctBorderRadius, + borderTopRightRadius: correctBorderRadius, + borderBottomLeftRadius: correctBorderRadius, + borderBottomRightRadius: correctBorderRadius, + boxShadow: correctBoxShadow, +}; +function addScaleCorrector(correctors) { + for (const key in correctors) { + scaleCorrectors[key] = correctors[key]; + if (isCSSVariableName(key)) { + scaleCorrectors[key].isCSSVariable = true; + } + } +} + +export { addScaleCorrector, scaleCorrectors }; +//# sourceMappingURL=scale-correction.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/styles/scale-correction.mjs.map b/node_modules/motion-dom/dist/es/projection/styles/scale-correction.mjs.map new file mode 100644 index 0000000..00f23b4 --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/styles/scale-correction.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"scale-correction.mjs","sources":["../../../../src/projection/styles/scale-correction.ts"],"sourcesContent":["import { isCSSVariableName } from \"../../animation/utils/is-css-variable\"\nimport { cornerRadiusProps } from \"../../utils/border-radius\"\nimport { correctBorderRadius } from \"./scale-border-radius\"\nimport { correctBoxShadow } from \"./scale-box-shadow\"\nimport type { ScaleCorrectorMap } from \"./types\"\n\nexport const scaleCorrectors: ScaleCorrectorMap = {\n borderRadius: {\n ...correctBorderRadius,\n applyTo: [...cornerRadiusProps],\n },\n borderTopLeftRadius: correctBorderRadius,\n borderTopRightRadius: correctBorderRadius,\n borderBottomLeftRadius: correctBorderRadius,\n borderBottomRightRadius: correctBorderRadius,\n boxShadow: correctBoxShadow,\n}\n\nexport function addScaleCorrector(correctors: ScaleCorrectorMap) {\n for (const key in correctors) {\n scaleCorrectors[key] = correctors[key]\n if (isCSSVariableName(key)) {\n scaleCorrectors[key].isCSSVariable = true\n }\n }\n}\n"],"names":[],"mappings":";;;;;AAMO,MAAM,eAAe,GAAsB;AAC9C,IAAA,YAAY,EAAE;AACV,QAAA,GAAG,mBAAmB;AACtB,QAAA,OAAO,EAAE,CAAC,GAAG,iBAAiB,CAAC;AAClC,KAAA;AACD,IAAA,mBAAmB,EAAE,mBAAmB;AACxC,IAAA,oBAAoB,EAAE,mBAAmB;AACzC,IAAA,sBAAsB,EAAE,mBAAmB;AAC3C,IAAA,uBAAuB,EAAE,mBAAmB;AAC5C,IAAA,SAAS,EAAE,gBAAgB;;AAGzB,SAAU,iBAAiB,CAAC,UAA6B,EAAA;AAC3D,IAAA,KAAK,MAAM,GAAG,IAAI,UAAU,EAAE;QAC1B,eAAe,CAAC,GAAG,CAAC,GAAG,UAAU,CAAC,GAAG,CAAC;AACtC,QAAA,IAAI,iBAAiB,CAAC,GAAG,CAAC,EAAE;AACxB,YAAA,eAAe,CAAC,GAAG,CAAC,CAAC,aAAa,GAAG,IAAI;QAC7C;IACJ;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/projection/styles/transform.mjs b/node_modules/motion-dom/dist/es/projection/styles/transform.mjs new file mode 100644 index 0000000..aba77bf --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/styles/transform.mjs @@ -0,0 +1,53 @@ +function buildProjectionTransform(delta, treeScale, latestTransform) { + let transform = ""; + /** + * The translations we use to calculate are always relative to the viewport coordinate space. + * But when we apply scales, we also scale the coordinate space of an element and its children. + * For instance if we have a treeScale (the culmination of all parent scales) of 0.5 and we need + * to move an element 100 pixels, we actually need to move it 200 in within that scaled space. + */ + const xTranslate = delta.x.translate / treeScale.x; + const yTranslate = delta.y.translate / treeScale.y; + const zTranslate = latestTransform?.z || 0; + if (xTranslate || yTranslate || zTranslate) { + transform = `translate3d(${xTranslate}px, ${yTranslate}px, ${zTranslate}px) `; + } + /** + * Apply scale correction for the tree transform. + * This will apply scale to the screen-orientated axes. + */ + if (treeScale.x !== 1 || treeScale.y !== 1) { + transform += `scale(${1 / treeScale.x}, ${1 / treeScale.y}) `; + } + if (latestTransform) { + const { transformPerspective, rotate, pathRotation, rotateX, rotateY, skewX, skewY, } = latestTransform; + if (transformPerspective) + transform = `perspective(${transformPerspective}px) ${transform}`; + if (rotate) + transform += `rotate(${rotate}deg) `; + // Additive `rotate()` so user `rotate` isn't clobbered. + if (pathRotation) + transform += `rotate(${pathRotation}deg) `; + if (rotateX) + transform += `rotateX(${rotateX}deg) `; + if (rotateY) + transform += `rotateY(${rotateY}deg) `; + if (skewX) + transform += `skewX(${skewX}deg) `; + if (skewY) + transform += `skewY(${skewY}deg) `; + } + /** + * Apply scale to match the size of the element to the size we want it. + * This will apply scale to the element-orientated axes. + */ + const elementScaleX = delta.x.scale * treeScale.x; + const elementScaleY = delta.y.scale * treeScale.y; + if (elementScaleX !== 1 || elementScaleY !== 1) { + transform += `scale(${elementScaleX}, ${elementScaleY})`; + } + return transform || "none"; +} + +export { buildProjectionTransform }; +//# sourceMappingURL=transform.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/styles/transform.mjs.map b/node_modules/motion-dom/dist/es/projection/styles/transform.mjs.map new file mode 100644 index 0000000..2ef27a9 --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/styles/transform.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"transform.mjs","sources":["../../../../src/projection/styles/transform.ts"],"sourcesContent":["import type { Delta, Point } from \"motion-utils\"\nimport type { ResolvedValues } from \"../../node/types\"\n\nexport function buildProjectionTransform(\n delta: Delta,\n treeScale: Point,\n latestTransform?: ResolvedValues\n): string {\n let transform = \"\"\n\n /**\n * The translations we use to calculate are always relative to the viewport coordinate space.\n * But when we apply scales, we also scale the coordinate space of an element and its children.\n * For instance if we have a treeScale (the culmination of all parent scales) of 0.5 and we need\n * to move an element 100 pixels, we actually need to move it 200 in within that scaled space.\n */\n const xTranslate = delta.x.translate / treeScale.x\n const yTranslate = delta.y.translate / treeScale.y\n const zTranslate = latestTransform?.z || 0\n if (xTranslate || yTranslate || zTranslate) {\n transform = `translate3d(${xTranslate}px, ${yTranslate}px, ${zTranslate}px) `\n }\n\n /**\n * Apply scale correction for the tree transform.\n * This will apply scale to the screen-orientated axes.\n */\n if (treeScale.x !== 1 || treeScale.y !== 1) {\n transform += `scale(${1 / treeScale.x}, ${1 / treeScale.y}) `\n }\n\n if (latestTransform) {\n const {\n transformPerspective,\n rotate,\n pathRotation,\n rotateX,\n rotateY,\n skewX,\n skewY,\n } = latestTransform\n if (transformPerspective)\n transform = `perspective(${transformPerspective}px) ${transform}`\n if (rotate) transform += `rotate(${rotate}deg) `\n // Additive `rotate()` so user `rotate` isn't clobbered.\n if (pathRotation) transform += `rotate(${pathRotation}deg) `\n if (rotateX) transform += `rotateX(${rotateX}deg) `\n if (rotateY) transform += `rotateY(${rotateY}deg) `\n if (skewX) transform += `skewX(${skewX}deg) `\n if (skewY) transform += `skewY(${skewY}deg) `\n }\n\n /**\n * Apply scale to match the size of the element to the size we want it.\n * This will apply scale to the element-orientated axes.\n */\n const elementScaleX = delta.x.scale * treeScale.x\n const elementScaleY = delta.y.scale * treeScale.y\n if (elementScaleX !== 1 || elementScaleY !== 1) {\n transform += `scale(${elementScaleX}, ${elementScaleY})`\n }\n\n return transform || \"none\"\n}\n"],"names":[],"mappings":"SAGgB,wBAAwB,CACpC,KAAY,EACZ,SAAgB,EAChB,eAAgC,EAAA;IAEhC,IAAI,SAAS,GAAG,EAAE;AAElB;;;;;AAKG;IACH,MAAM,UAAU,GAAG,KAAK,CAAC,CAAC,CAAC,SAAS,GAAG,SAAS,CAAC,CAAC;IAClD,MAAM,UAAU,GAAG,KAAK,CAAC,CAAC,CAAC,SAAS,GAAG,SAAS,CAAC,CAAC;AAClD,IAAA,MAAM,UAAU,GAAG,eAAe,EAAE,CAAC,IAAI,CAAC;AAC1C,IAAA,IAAI,UAAU,IAAI,UAAU,IAAI,UAAU,EAAE;QACxC,SAAS,GAAG,eAAe,UAAU,CAAA,IAAA,EAAO,UAAU,CAAA,IAAA,EAAO,UAAU,MAAM;IACjF;AAEA;;;AAGG;AACH,IAAA,IAAI,SAAS,CAAC,CAAC,KAAK,CAAC,IAAI,SAAS,CAAC,CAAC,KAAK,CAAC,EAAE;AACxC,QAAA,SAAS,IAAI,CAAA,MAAA,EAAS,CAAC,GAAG,SAAS,CAAC,CAAC,CAAA,EAAA,EAAK,CAAC,GAAG,SAAS,CAAC,CAAC,IAAI;IACjE;IAEA,IAAI,eAAe,EAAE;AACjB,QAAA,MAAM,EACF,oBAAoB,EACpB,MAAM,EACN,YAAY,EACZ,OAAO,EACP,OAAO,EACP,KAAK,EACL,KAAK,GACR,GAAG,eAAe;AACnB,QAAA,IAAI,oBAAoB;AACpB,YAAA,SAAS,GAAG,CAAA,YAAA,EAAe,oBAAoB,CAAA,IAAA,EAAO,SAAS,EAAE;AACrE,QAAA,IAAI,MAAM;AAAE,YAAA,SAAS,IAAI,CAAA,OAAA,EAAU,MAAM,CAAA,KAAA,CAAO;;AAEhD,QAAA,IAAI,YAAY;AAAE,YAAA,SAAS,IAAI,CAAA,OAAA,EAAU,YAAY,CAAA,KAAA,CAAO;AAC5D,QAAA,IAAI,OAAO;AAAE,YAAA,SAAS,IAAI,CAAA,QAAA,EAAW,OAAO,CAAA,KAAA,CAAO;AACnD,QAAA,IAAI,OAAO;AAAE,YAAA,SAAS,IAAI,CAAA,QAAA,EAAW,OAAO,CAAA,KAAA,CAAO;AACnD,QAAA,IAAI,KAAK;AAAE,YAAA,SAAS,IAAI,CAAA,MAAA,EAAS,KAAK,CAAA,KAAA,CAAO;AAC7C,QAAA,IAAI,KAAK;AAAE,YAAA,SAAS,IAAI,CAAA,MAAA,EAAS,KAAK,CAAA,KAAA,CAAO;IACjD;AAEA;;;AAGG;IACH,MAAM,aAAa,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,GAAG,SAAS,CAAC,CAAC;IACjD,MAAM,aAAa,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,GAAG,SAAS,CAAC,CAAC;IACjD,IAAI,aAAa,KAAK,CAAC,IAAI,aAAa,KAAK,CAAC,EAAE;AAC5C,QAAA,SAAS,IAAI,CAAA,MAAA,EAAS,aAAa,CAAA,EAAA,EAAK,aAAa,GAAG;IAC5D;IAEA,OAAO,SAAS,IAAI,MAAM;AAC9B;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/projection/utils/compare-by-depth.mjs b/node_modules/motion-dom/dist/es/projection/utils/compare-by-depth.mjs new file mode 100644 index 0000000..463a184 --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/utils/compare-by-depth.mjs @@ -0,0 +1,4 @@ +const compareByDepth = (a, b) => a.depth - b.depth; + +export { compareByDepth }; +//# sourceMappingURL=compare-by-depth.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/utils/compare-by-depth.mjs.map b/node_modules/motion-dom/dist/es/projection/utils/compare-by-depth.mjs.map new file mode 100644 index 0000000..789454d --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/utils/compare-by-depth.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"compare-by-depth.mjs","sources":["../../../../src/projection/utils/compare-by-depth.ts"],"sourcesContent":["import type { VisualElement } from \"../../render/VisualElement\"\n\nexport interface WithDepth {\n depth: number\n}\n\nexport const compareByDepth = (a: VisualElement, b: VisualElement) =>\n a.depth - b.depth\n"],"names":[],"mappings":"AAMO,MAAM,cAAc,GAAG,CAAC,CAAgB,EAAE,CAAgB,KAC7D,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/projection/utils/each-axis.mjs b/node_modules/motion-dom/dist/es/projection/utils/each-axis.mjs new file mode 100644 index 0000000..00e4c66 --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/utils/each-axis.mjs @@ -0,0 +1,6 @@ +function eachAxis(callback) { + return [callback("x"), callback("y")]; +} + +export { eachAxis }; +//# sourceMappingURL=each-axis.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/utils/each-axis.mjs.map b/node_modules/motion-dom/dist/es/projection/utils/each-axis.mjs.map new file mode 100644 index 0000000..c3cb6c4 --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/utils/each-axis.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"each-axis.mjs","sources":["../../../../src/projection/utils/each-axis.ts"],"sourcesContent":["type Callback = (axis: \"x\" | \"y\") => void\n\nexport function eachAxis(callback: Callback) {\n return [callback(\"x\"), callback(\"y\")]\n}\n"],"names":[],"mappings":"AAEM,SAAU,QAAQ,CAAC,QAAkB,EAAA;IACvC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC;AACzC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/projection/utils/flat-tree.mjs b/node_modules/motion-dom/dist/es/projection/utils/flat-tree.mjs new file mode 100644 index 0000000..d9d6817 --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/utils/flat-tree.mjs @@ -0,0 +1,25 @@ +import { addUniqueItem, removeItem } from 'motion-utils'; +import { compareByDepth } from './compare-by-depth.mjs'; + +class FlatTree { + constructor() { + this.children = []; + this.isDirty = false; + } + add(child) { + addUniqueItem(this.children, child); + this.isDirty = true; + } + remove(child) { + removeItem(this.children, child); + this.isDirty = true; + } + forEach(callback) { + this.isDirty && this.children.sort(compareByDepth); + this.isDirty = false; + this.children.forEach(callback); + } +} + +export { FlatTree }; +//# sourceMappingURL=flat-tree.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/utils/flat-tree.mjs.map b/node_modules/motion-dom/dist/es/projection/utils/flat-tree.mjs.map new file mode 100644 index 0000000..c9d0b75 --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/utils/flat-tree.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"flat-tree.mjs","sources":["../../../../src/projection/utils/flat-tree.ts"],"sourcesContent":["import { addUniqueItem, removeItem } from \"motion-utils\"\nimport { compareByDepth, WithDepth } from \"./compare-by-depth\"\n\nexport class FlatTree {\n private children: WithDepth[] = []\n\n private isDirty: boolean = false\n\n add(child: WithDepth) {\n addUniqueItem(this.children, child)\n this.isDirty = true\n }\n\n remove(child: WithDepth) {\n removeItem(this.children, child)\n this.isDirty = true\n }\n\n forEach(callback: (child: WithDepth) => void) {\n this.isDirty && this.children.sort(compareByDepth)\n this.isDirty = false\n this.children.forEach(callback)\n }\n}\n"],"names":[],"mappings":";;;MAGa,QAAQ,CAAA;AAArB,IAAA,WAAA,GAAA;QACY,IAAA,CAAA,QAAQ,GAAgB,EAAE;QAE1B,IAAA,CAAA,OAAO,GAAY,KAAK;IAiBpC;AAfI,IAAA,GAAG,CAAC,KAAgB,EAAA;AAChB,QAAA,aAAa,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC;AACnC,QAAA,IAAI,CAAC,OAAO,GAAG,IAAI;IACvB;AAEA,IAAA,MAAM,CAAC,KAAgB,EAAA;AACnB,QAAA,UAAU,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC;AAChC,QAAA,IAAI,CAAC,OAAO,GAAG,IAAI;IACvB;AAEA,IAAA,OAAO,CAAC,QAAoC,EAAA;QACxC,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,cAAc,CAAC;AAClD,QAAA,IAAI,CAAC,OAAO,GAAG,KAAK;AACpB,QAAA,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC;IACnC;AACH;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/projection/utils/has-transform.mjs b/node_modules/motion-dom/dist/es/projection/utils/has-transform.mjs new file mode 100644 index 0000000..bf5d324 --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/utils/has-transform.mjs @@ -0,0 +1,27 @@ +function isIdentityScale(scale) { + return scale === undefined || scale === 1; +} +function hasScale({ scale, scaleX, scaleY }) { + return (!isIdentityScale(scale) || + !isIdentityScale(scaleX) || + !isIdentityScale(scaleY)); +} +function hasTransform(values) { + return (hasScale(values) || + has2DTranslate(values) || + values.z || + values.rotate || + values.rotateX || + values.rotateY || + values.skewX || + values.skewY); +} +function has2DTranslate(values) { + return is2DTranslate(values.x) || is2DTranslate(values.y); +} +function is2DTranslate(value) { + return value && value !== "0%"; +} + +export { has2DTranslate, hasScale, hasTransform }; +//# sourceMappingURL=has-transform.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/utils/has-transform.mjs.map b/node_modules/motion-dom/dist/es/projection/utils/has-transform.mjs.map new file mode 100644 index 0000000..40ba0e5 --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/utils/has-transform.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"has-transform.mjs","sources":["../../../../src/projection/utils/has-transform.ts"],"sourcesContent":["import { type AnyResolvedKeyframe } from \"../../animation/types\"\nimport { ResolvedValues } from \"../../render/types\"\n\nfunction isIdentityScale(scale: AnyResolvedKeyframe | undefined) {\n return scale === undefined || scale === 1\n}\n\nexport function hasScale({ scale, scaleX, scaleY }: ResolvedValues) {\n return (\n !isIdentityScale(scale) ||\n !isIdentityScale(scaleX) ||\n !isIdentityScale(scaleY)\n )\n}\n\nexport function hasTransform(values: ResolvedValues) {\n return (\n hasScale(values) ||\n has2DTranslate(values) ||\n values.z ||\n values.rotate ||\n values.rotateX ||\n values.rotateY ||\n values.skewX ||\n values.skewY\n )\n}\n\nexport function has2DTranslate(values: ResolvedValues) {\n return is2DTranslate(values.x) || is2DTranslate(values.y)\n}\n\nfunction is2DTranslate(value: AnyResolvedKeyframe | undefined) {\n return value && value !== \"0%\"\n}\n"],"names":[],"mappings":"AAGA,SAAS,eAAe,CAAC,KAAsC,EAAA;AAC3D,IAAA,OAAO,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,CAAC;AAC7C;AAEM,SAAU,QAAQ,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAkB,EAAA;AAC9D,IAAA,QACI,CAAC,eAAe,CAAC,KAAK,CAAC;QACvB,CAAC,eAAe,CAAC,MAAM,CAAC;AACxB,QAAA,CAAC,eAAe,CAAC,MAAM,CAAC;AAEhC;AAEM,SAAU,YAAY,CAAC,MAAsB,EAAA;AAC/C,IAAA,QACI,QAAQ,CAAC,MAAM,CAAC;QAChB,cAAc,CAAC,MAAM,CAAC;AACtB,QAAA,MAAM,CAAC,CAAC;AACR,QAAA,MAAM,CAAC,MAAM;AACb,QAAA,MAAM,CAAC,OAAO;AACd,QAAA,MAAM,CAAC,OAAO;AACd,QAAA,MAAM,CAAC,KAAK;QACZ,MAAM,CAAC,KAAK;AAEpB;AAEM,SAAU,cAAc,CAAC,MAAsB,EAAA;AACjD,IAAA,OAAO,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC;AAC7D;AAEA,SAAS,aAAa,CAAC,KAAsC,EAAA;AACzD,IAAA,OAAO,KAAK,IAAI,KAAK,KAAK,IAAI;AAClC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/projection/utils/measure.mjs b/node_modules/motion-dom/dist/es/projection/utils/measure.mjs new file mode 100644 index 0000000..33e0a65 --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/utils/measure.mjs @@ -0,0 +1,18 @@ +import { convertBoundingBoxToBox, transformBoxPoints } from '../geometry/conversion.mjs'; +import { translateAxis } from '../geometry/delta-apply.mjs'; + +function measureViewportBox(instance, transformPoint) { + return convertBoundingBoxToBox(transformBoxPoints(instance.getBoundingClientRect(), transformPoint)); +} +function measurePageBox(element, rootProjectionNode, transformPagePoint) { + const viewportBox = measureViewportBox(element, transformPagePoint); + const { scroll } = rootProjectionNode; + if (scroll) { + translateAxis(viewportBox.x, scroll.offset.x); + translateAxis(viewportBox.y, scroll.offset.y); + } + return viewportBox; +} + +export { measurePageBox, measureViewportBox }; +//# sourceMappingURL=measure.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/utils/measure.mjs.map b/node_modules/motion-dom/dist/es/projection/utils/measure.mjs.map new file mode 100644 index 0000000..d1c0d8d --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/utils/measure.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"measure.mjs","sources":["../../../../src/projection/utils/measure.ts"],"sourcesContent":["import { TransformPoint } from \"motion-utils\"\nimport {\n convertBoundingBoxToBox,\n transformBoxPoints,\n} from \"../geometry/conversion\"\nimport { translateAxis } from \"../geometry/delta-apply\"\n\nexport function measureViewportBox(\n instance: HTMLElement,\n transformPoint?: TransformPoint\n) {\n return convertBoundingBoxToBox(\n transformBoxPoints(instance.getBoundingClientRect(), transformPoint)\n )\n}\n\nexport function measurePageBox(\n element: HTMLElement,\n rootProjectionNode: any,\n transformPagePoint?: TransformPoint\n) {\n const viewportBox = measureViewportBox(element, transformPagePoint)\n const { scroll } = rootProjectionNode\n\n if (scroll) {\n translateAxis(viewportBox.x, scroll.offset.x)\n translateAxis(viewportBox.y, scroll.offset.y)\n }\n\n return viewportBox\n}\n"],"names":[],"mappings":";;;AAOM,SAAU,kBAAkB,CAC9B,QAAqB,EACrB,cAA+B,EAAA;AAE/B,IAAA,OAAO,uBAAuB,CAC1B,kBAAkB,CAAC,QAAQ,CAAC,qBAAqB,EAAE,EAAE,cAAc,CAAC,CACvE;AACL;SAEgB,cAAc,CAC1B,OAAoB,EACpB,kBAAuB,EACvB,kBAAmC,EAAA;IAEnC,MAAM,WAAW,GAAG,kBAAkB,CAAC,OAAO,EAAE,kBAAkB,CAAC;AACnE,IAAA,MAAM,EAAE,MAAM,EAAE,GAAG,kBAAkB;IAErC,IAAI,MAAM,EAAE;QACR,aAAa,CAAC,WAAW,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;QAC7C,aAAa,CAAC,WAAW,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;IACjD;AAEA,IAAA,OAAO,WAAW;AACtB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/Feature.mjs b/node_modules/motion-dom/dist/es/render/Feature.mjs new file mode 100644 index 0000000..d614c3c --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/Feature.mjs @@ -0,0 +1,15 @@ +/** + * Feature base class for extending VisualElement functionality. + * Features are plugins that can be mounted/unmounted to add behavior + * like gestures, animations, or layout tracking. + */ +class Feature { + constructor(node) { + this.isMounted = false; + this.node = node; + } + update() { } +} + +export { Feature }; +//# sourceMappingURL=Feature.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/Feature.mjs.map b/node_modules/motion-dom/dist/es/render/Feature.mjs.map new file mode 100644 index 0000000..c627149 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/Feature.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"Feature.mjs","sources":["../../../src/render/Feature.ts"],"sourcesContent":["import type { VisualElement } from \"./VisualElement\"\n\n/**\n * Feature base class for extending VisualElement functionality.\n * Features are plugins that can be mounted/unmounted to add behavior\n * like gestures, animations, or layout tracking.\n */\nexport abstract class Feature {\n isMounted = false\n\n node: VisualElement\n\n constructor(node: VisualElement) {\n this.node = node\n }\n\n abstract mount(): void\n\n abstract unmount(): void\n\n update(): void {}\n}\n"],"names":[],"mappings":"AAEA;;;;AAIG;MACmB,OAAO,CAAA;AAKzB,IAAA,WAAA,CAAY,IAAsB,EAAA;QAJlC,IAAA,CAAA,SAAS,GAAG,KAAK;AAKb,QAAA,IAAI,CAAC,IAAI,GAAG,IAAI;IACpB;AAMA,IAAA,MAAM,KAAU;AACnB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/VisualElement.mjs b/node_modules/motion-dom/dist/es/render/VisualElement.mjs new file mode 100644 index 0000000..fba5cd3 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/VisualElement.mjs @@ -0,0 +1,560 @@ +import { warnOnce, secondsToMilliseconds, isNumericalString, isZeroValueString, SubscriptionManager } from 'motion-utils'; +import { KeyframeResolver } from '../animation/keyframes/KeyframesResolver.mjs'; +import { NativeAnimation } from '../animation/NativeAnimation.mjs'; +import { acceleratedValues } from '../animation/waapi/utils/accelerated-values.mjs'; +import { microtask } from '../frameloop/microtask.mjs'; +import { time } from '../frameloop/sync-time.mjs'; +import { createBox } from '../projection/geometry/models.mjs'; +import { motionValue } from '../value/index.mjs'; +import { complex } from '../value/types/complex/index.mjs'; +import { getAnimatableNone } from '../value/types/utils/animatable-none.mjs'; +import { findValueType } from '../value/types/utils/find.mjs'; +import { isMotionValue } from '../value/utils/is-motion-value.mjs'; +import { visualElementStore } from './store.mjs'; +import { isControllingVariants, isVariantNode } from './utils/is-controlling-variants.mjs'; +import { transformProps } from './utils/keys-transform.mjs'; +import { updateMotionValuesFromProps } from './utils/motion-values.mjs'; +import { initPrefersReducedMotion } from './utils/reduced-motion/index.mjs'; +import { resolveVariantFromProps } from './utils/resolve-variants.mjs'; +import { hasReducedMotionListener, prefersReducedMotion } from './utils/reduced-motion/state.mjs'; +import { frame, cancelFrame } from '../frameloop/frame.mjs'; + +const propEventHandlers = [ + "AnimationStart", + "AnimationComplete", + "Update", + "BeforeLayoutMeasure", + "LayoutMeasure", + "LayoutAnimationStart", + "LayoutAnimationComplete", +]; +/** + * Static feature definitions - can be injected by framework layer + */ +let featureDefinitions = {}; +/** + * Set feature definitions for all VisualElements. + * This should be called by the framework layer (e.g., framer-motion) during initialization. + */ +function setFeatureDefinitions(definitions) { + featureDefinitions = definitions; +} +/** + * Get the current feature definitions + */ +function getFeatureDefinitions() { + return featureDefinitions; +} +/** + * A VisualElement is an imperative abstraction around UI elements such as + * HTMLElement, SVGElement, Three.Object3D etc. + */ +class VisualElement { + /** + * This method takes React props and returns found MotionValues. For example, HTML + * MotionValues will be found within the style prop, whereas for Three.js within attribute arrays. + * + * This isn't an abstract method as it needs calling in the constructor, but it is + * intended to be one. + */ + scrapeMotionValuesFromProps(_props, _prevProps, _visualElement) { + return {}; + } + constructor({ parent, props, presenceContext, reducedMotionConfig, skipAnimations, blockInitialAnimation, visualState, }, options = {}) { + /** + * A reference to the current underlying Instance, e.g. a HTMLElement + * or Three.Mesh etc. + */ + this.current = null; + /** + * A set containing references to this VisualElement's children. + */ + this.children = new Set(); + /** + * Determine what role this visual element should take in the variant tree. + */ + this.isVariantNode = false; + this.isControllingVariants = false; + /** + * Decides whether this VisualElement should animate in reduced motion + * mode. + * + * TODO: This is currently set on every individual VisualElement but feels + * like it could be set globally. + */ + this.shouldReduceMotion = null; + /** + * Decides whether animations should be skipped for this VisualElement. + * Useful for E2E tests and visual regression testing. + */ + this.shouldSkipAnimations = false; + /** + * A map of all motion values attached to this visual element. Motion + * values are source of truth for any given animated value. A motion + * value might be provided externally by the component via props. + */ + this.values = new Map(); + this.KeyframeResolver = KeyframeResolver; + /** + * Cleanup functions for active features (hover/tap/exit etc) + */ + this.features = {}; + /** + * A map of every subscription that binds the provided or generated + * motion values onChange listeners to this visual element. + */ + this.valueSubscriptions = new Map(); + /** + * A reference to the previously-provided motion values as returned + * from scrapeMotionValuesFromProps. We use the keys in here to determine + * if any motion values need to be removed after props are updated. + */ + this.prevMotionValues = {}; + /** + * Track whether this element has been mounted before, to detect + * remounts after Suspense unmount/remount cycles. + */ + this.hasBeenMounted = false; + /** + * An object containing a SubscriptionManager for each active event. + */ + this.events = {}; + /** + * An object containing an unsubscribe function for each prop event subscription. + * For example, every "Update" event can have multiple subscribers via + * VisualElement.on(), but only one of those can be defined via the onUpdate prop. + */ + this.propEventSubscriptions = {}; + this.notifyUpdate = () => this.notify("Update", this.latestValues); + this.render = () => { + if (!this.current) + return; + this.triggerBuild(); + this.renderInstance(this.current, this.renderState, this.props.style, this.projection); + }; + this.renderScheduledAt = 0.0; + this.scheduleRender = () => { + const now = time.now(); + if (this.renderScheduledAt < now) { + this.renderScheduledAt = now; + frame.render(this.render, false, true); + } + }; + const { latestValues, renderState } = visualState; + this.latestValues = latestValues; + this.baseTarget = { ...latestValues }; + this.initialValues = props.initial ? { ...latestValues } : {}; + this.renderState = renderState; + this.parent = parent; + this.props = props; + this.presenceContext = presenceContext; + this.depth = parent ? parent.depth + 1 : 0; + this.reducedMotionConfig = reducedMotionConfig; + this.skipAnimationsConfig = skipAnimations; + this.options = options; + this.blockInitialAnimation = Boolean(blockInitialAnimation); + this.isControllingVariants = isControllingVariants(props); + this.isVariantNode = isVariantNode(props); + if (this.isVariantNode) { + this.variantChildren = new Set(); + } + this.manuallyAnimateOnMount = Boolean(parent && parent.current); + /** + * Any motion values that are provided to the element when created + * aren't yet bound to the element, as this would technically be impure. + * However, we iterate through the motion values and set them to the + * initial values for this component. + * + * TODO: This is impure and we should look at changing this to run on mount. + * Doing so will break some tests but this isn't necessarily a breaking change, + * more a reflection of the test. + */ + const { willChange, ...initialMotionValues } = this.scrapeMotionValuesFromProps(props, {}, this); + for (const key in initialMotionValues) { + const value = initialMotionValues[key]; + if (latestValues[key] !== undefined && isMotionValue(value)) { + value.set(latestValues[key]); + } + } + } + mount(instance) { + /** + * If this element has been mounted before (e.g. after a Suspense + * unmount/remount), reset motion values to their initial state + * so animations replay correctly from initial → animate. + */ + if (this.hasBeenMounted) { + for (const key in this.initialValues) { + this.values.get(key)?.jump(this.initialValues[key]); + this.latestValues[key] = this.initialValues[key]; + } + } + this.current = instance; + visualElementStore.set(instance, this); + if (this.projection && !this.projection.instance) { + this.projection.mount(instance); + } + if (this.parent && this.isVariantNode && !this.isControllingVariants) { + this.removeFromVariantTree = this.parent.addVariantChild(this); + } + this.values.forEach((value, key) => this.bindToMotionValue(key, value)); + /** + * Determine reduced motion preference. Only initialize the matchMedia + * listener if we actually need the dynamic value (i.e., when config + * is neither "never" nor "always"). + */ + if (this.reducedMotionConfig === "never") { + this.shouldReduceMotion = false; + } + else if (this.reducedMotionConfig === "always") { + this.shouldReduceMotion = true; + } + else { + if (!hasReducedMotionListener.current) { + initPrefersReducedMotion(); + } + this.shouldReduceMotion = prefersReducedMotion.current; + } + if (process.env.NODE_ENV !== "production") { + warnOnce(this.shouldReduceMotion !== true, "You have Reduced Motion enabled on your device. Animations may not appear as expected.", "reduced-motion-disabled"); + } + /** + * Set whether animations should be skipped based on the config. + */ + this.shouldSkipAnimations = this.skipAnimationsConfig ?? false; + this.parent?.addChild(this); + this.update(this.props, this.presenceContext); + this.hasBeenMounted = true; + } + unmount() { + this.projection && this.projection.unmount(); + cancelFrame(this.notifyUpdate); + cancelFrame(this.render); + this.valueSubscriptions.forEach((remove) => remove()); + this.valueSubscriptions.clear(); + this.removeFromVariantTree && this.removeFromVariantTree(); + this.parent?.removeChild(this); + for (const key in this.events) { + this.events[key].clear(); + } + for (const key in this.features) { + const feature = this.features[key]; + if (feature) { + feature.unmount(); + feature.isMounted = false; + } + } + this.current = null; + } + addChild(child) { + this.children.add(child); + this.enteringChildren ?? (this.enteringChildren = new Set()); + this.enteringChildren.add(child); + } + removeChild(child) { + this.children.delete(child); + this.enteringChildren && this.enteringChildren.delete(child); + } + bindToMotionValue(key, value) { + if (this.valueSubscriptions.has(key)) { + this.valueSubscriptions.get(key)(); + } + if (value.accelerate && + acceleratedValues.has(key) && + this.current instanceof HTMLElement) { + const { factory, keyframes, times, ease, duration } = value.accelerate; + const animation = new NativeAnimation({ + element: this.current, + name: key, + keyframes, + times, + ease, + duration: secondsToMilliseconds(duration), + }); + const cleanup = factory(animation); + this.valueSubscriptions.set(key, () => { + cleanup(); + animation.cancel(); + }); + return; + } + const valueIsTransform = transformProps.has(key); + if (valueIsTransform && this.onBindTransform) { + this.onBindTransform(); + } + const removeOnChange = value.on("change", (latestValue) => { + this.latestValues[key] = latestValue; + this.props.onUpdate && frame.preRender(this.notifyUpdate); + if (valueIsTransform && this.projection) { + this.projection.isTransformDirty = true; + } + this.scheduleRender(); + }); + let removeSyncCheck; + if (typeof window !== "undefined" && + window.MotionCheckAppearSync) { + removeSyncCheck = window.MotionCheckAppearSync(this, key, value); + } + this.valueSubscriptions.set(key, () => { + removeOnChange(); + if (removeSyncCheck) + removeSyncCheck(); + // Defer to MotionValue.on("change") auto-stop so React 19 remounts + // can resubscribe before the animation is cancelled (#3315). + }); + } + sortNodePosition(other) { + /** + * If these nodes aren't even of the same type we can't compare their depth. + */ + if (!this.current || + !this.sortInstanceNodePosition || + this.type !== other.type) { + return 0; + } + return this.sortInstanceNodePosition(this.current, other.current); + } + updateFeatures() { + let key = "animation"; + for (key in featureDefinitions) { + const featureDefinition = featureDefinitions[key]; + if (!featureDefinition) + continue; + const { isEnabled, Feature: FeatureConstructor } = featureDefinition; + /** + * If this feature is enabled but not active, make a new instance. + */ + if (!this.features[key] && + FeatureConstructor && + isEnabled(this.props)) { + this.features[key] = new FeatureConstructor(this); + } + /** + * If we have a feature, mount or update it. + */ + if (this.features[key]) { + const feature = this.features[key]; + if (feature.isMounted) { + feature.update(); + } + else { + feature.mount(); + feature.isMounted = true; + } + } + } + } + triggerBuild() { + this.build(this.renderState, this.latestValues, this.props); + } + /** + * Measure the current viewport box with or without transforms. + * Only measures axis-aligned boxes, rotate and skew must be manually + * removed with a re-render to work. + */ + measureViewportBox() { + return this.current + ? this.measureInstanceViewportBox(this.current, this.props) + : createBox(); + } + getStaticValue(key) { + return this.latestValues[key]; + } + setStaticValue(key, value) { + this.latestValues[key] = value; + } + /** + * Update the provided props. Ensure any newly-added motion values are + * added to our map, old ones removed, and listeners updated. + */ + update(props, presenceContext) { + if (props.transformTemplate || this.props.transformTemplate) { + this.scheduleRender(); + } + this.prevProps = this.props; + this.props = props; + this.prevPresenceContext = this.presenceContext; + this.presenceContext = presenceContext; + /** + * Update prop event handlers ie onAnimationStart, onAnimationComplete + */ + for (let i = 0; i < propEventHandlers.length; i++) { + const key = propEventHandlers[i]; + if (this.propEventSubscriptions[key]) { + this.propEventSubscriptions[key](); + delete this.propEventSubscriptions[key]; + } + const listenerName = ("on" + key); + const listener = props[listenerName]; + if (listener) { + this.propEventSubscriptions[key] = this.on(key, listener); + } + } + this.prevMotionValues = updateMotionValuesFromProps(this, this.scrapeMotionValuesFromProps(props, this.prevProps || {}, this), this.prevMotionValues); + if (this.handleChildMotionValue) { + this.handleChildMotionValue(); + } + } + getProps() { + return this.props; + } + /** + * Returns the variant definition with a given name. + */ + getVariant(name) { + return this.props.variants ? this.props.variants[name] : undefined; + } + /** + * Returns the defined default transition on this component. + */ + getDefaultTransition() { + return this.props.transition; + } + getTransformPagePoint() { + return this.props.transformPagePoint; + } + getClosestVariantNode() { + return this.isVariantNode + ? this + : this.parent + ? this.parent.getClosestVariantNode() + : undefined; + } + /** + * Add a child visual element to our set of children. + */ + addVariantChild(child) { + const closestVariantNode = this.getClosestVariantNode(); + if (closestVariantNode) { + closestVariantNode.variantChildren && + closestVariantNode.variantChildren.add(child); + return () => closestVariantNode.variantChildren.delete(child); + } + } + /** + * Add a motion value and bind it to this visual element. + */ + addValue(key, value) { + // Remove existing value if it exists + const existingValue = this.values.get(key); + if (value !== existingValue) { + if (existingValue) + this.removeValue(key); + this.bindToMotionValue(key, value); + this.values.set(key, value); + this.latestValues[key] = value.get(); + } + } + /** + * Remove a motion value and unbind any active subscriptions. + */ + removeValue(key) { + this.values.delete(key); + const unsubscribe = this.valueSubscriptions.get(key); + if (unsubscribe) { + unsubscribe(); + this.valueSubscriptions.delete(key); + } + delete this.latestValues[key]; + this.removeValueFromRenderState(key, this.renderState); + } + /** + * Check whether we have a motion value for this key + */ + hasValue(key) { + return this.values.has(key); + } + getValue(key, defaultValue) { + if (this.props.values && this.props.values[key]) { + return this.props.values[key]; + } + let value = this.values.get(key); + if (value === undefined && defaultValue !== undefined) { + value = motionValue(defaultValue === null ? undefined : defaultValue, { owner: this }); + this.addValue(key, value); + } + return value; + } + /** + * If we're trying to animate to a previously unencountered value, + * we need to check for it in our state and as a last resort read it + * directly from the instance (which might have performance implications). + */ + readValue(key, target) { + let value = this.latestValues[key] !== undefined || !this.current + ? this.latestValues[key] + : this.getBaseTargetFromProps(this.props, key) ?? + this.readValueFromInstance(this.current, key, this.options); + if (value !== undefined && value !== null) { + if (typeof value === "string" && + (isNumericalString(value) || isZeroValueString(value))) { + // If this is a number read as a string, ie "0" or "200", convert it to a number + value = parseFloat(value); + } + else if (!findValueType(value) && complex.test(target)) { + value = getAnimatableNone(key, target); + } + this.setBaseTarget(key, isMotionValue(value) ? value.get() : value); + } + return isMotionValue(value) ? value.get() : value; + } + /** + * Set the base target to later animate back to. This is currently + * only hydrated on creation and when we first read a value. + */ + setBaseTarget(key, value) { + this.baseTarget[key] = value; + } + /** + * Find the base target for a value thats been removed from all animation + * props. + */ + getBaseTarget(key) { + const { initial } = this.props; + let valueFromInitial; + if (typeof initial === "string" || typeof initial === "object") { + const variant = resolveVariantFromProps(this.props, initial, this.presenceContext?.custom); + if (variant) { + valueFromInitial = variant[key]; + } + } + /** + * If this value still exists in the current initial variant, read that. + */ + if (initial && valueFromInitial !== undefined) { + return valueFromInitial; + } + /** + * Alternatively, if this VisualElement config has defined a getBaseTarget + * so we can read the value from an alternative source, try that. + */ + const target = this.getBaseTargetFromProps(this.props, key); + if (target !== undefined && !isMotionValue(target)) + return target; + /** + * If the value was initially defined on initial, but it doesn't any more, + * return undefined. Otherwise return the value as initially read from the DOM. + */ + return this.initialValues[key] !== undefined && + valueFromInitial === undefined + ? undefined + : this.baseTarget[key]; + } + on(eventName, callback) { + if (!this.events[eventName]) { + this.events[eventName] = new SubscriptionManager(); + } + return this.events[eventName].add(callback); + } + notify(eventName, ...args) { + if (this.events[eventName]) { + this.events[eventName].notify(...args); + } + } + scheduleRenderMicrotask() { + microtask.render(this.render); + } +} + +export { VisualElement, getFeatureDefinitions, setFeatureDefinitions }; +//# sourceMappingURL=VisualElement.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/VisualElement.mjs.map b/node_modules/motion-dom/dist/es/render/VisualElement.mjs.map new file mode 100644 index 0000000..5ea221b --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/VisualElement.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"VisualElement.mjs","sources":["../../../src/render/VisualElement.ts"],"sourcesContent":["import {\n Box,\n isNumericalString,\n isZeroValueString,\n secondsToMilliseconds,\n SubscriptionManager,\n warnOnce,\n} from \"motion-utils\"\nimport { KeyframeResolver } from \"../animation/keyframes/KeyframesResolver\"\nimport { NativeAnimation } from \"../animation/NativeAnimation\"\nimport type { AnyResolvedKeyframe } from \"../animation/types\"\nimport { acceleratedValues } from \"../animation/waapi/utils/accelerated-values\"\nimport { cancelFrame, frame } from \"../frameloop\"\nimport { microtask } from \"../frameloop/microtask\"\nimport { time } from \"../frameloop/sync-time\"\nimport type { MotionNodeOptions } from \"../node/types\"\nimport { createBox } from \"../projection/geometry/models\"\nimport { motionValue, MotionValue } from \"../value\"\nimport { complex } from \"../value/types/complex\"\nimport { getAnimatableNone } from \"../value/types/utils/animatable-none\"\nimport { findValueType } from \"../value/types/utils/find\"\nimport { isMotionValue } from \"../value/utils/is-motion-value\"\nimport { Feature } from \"./Feature\"\nimport { visualElementStore } from \"./store\"\nimport {\n FeatureDefinitions,\n MotionConfigContextProps,\n PresenceContextProps,\n ReducedMotionConfig,\n ResolvedValues,\n VisualElementEventCallbacks,\n VisualElementOptions,\n} from \"./types\"\nimport { AnimationState } from \"./utils/animation-state\"\nimport {\n isControllingVariants as checkIsControllingVariants,\n isVariantNode as checkIsVariantNode,\n} from \"./utils/is-controlling-variants\"\nimport { transformProps } from \"./utils/keys-transform\"\nimport { updateMotionValuesFromProps } from \"./utils/motion-values\"\nimport {\n hasReducedMotionListener,\n initPrefersReducedMotion,\n prefersReducedMotion,\n} from \"./utils/reduced-motion\"\nimport { resolveVariantFromProps } from \"./utils/resolve-variants\"\n\nconst propEventHandlers = [\n \"AnimationStart\",\n \"AnimationComplete\",\n \"Update\",\n \"BeforeLayoutMeasure\",\n \"LayoutMeasure\",\n \"LayoutAnimationStart\",\n \"LayoutAnimationComplete\",\n] as const\n\n/**\n * Static feature definitions - can be injected by framework layer\n */\nlet featureDefinitions: Partial = {}\n\n/**\n * Set feature definitions for all VisualElements.\n * This should be called by the framework layer (e.g., framer-motion) during initialization.\n */\nexport function setFeatureDefinitions(\n definitions: Partial\n) {\n featureDefinitions = definitions\n}\n\n/**\n * Get the current feature definitions\n */\nexport function getFeatureDefinitions(): Partial {\n return featureDefinitions\n}\n\n/**\n * Motion style type - a subset of CSS properties that can contain motion values\n */\nexport type MotionStyle = {\n [K: string]: AnyResolvedKeyframe | MotionValue | undefined\n}\n\n/**\n * A VisualElement is an imperative abstraction around UI elements such as\n * HTMLElement, SVGElement, Three.Object3D etc.\n */\nexport abstract class VisualElement<\n Instance = unknown,\n RenderState = unknown,\n Options extends {} = {}\n> {\n /**\n * VisualElements are arranged in trees mirroring that of the React tree.\n * Each type of VisualElement has a unique name, to detect when we're crossing\n * type boundaries within that tree.\n */\n abstract type: string\n\n /**\n * An `Array.sort` compatible function that will compare two Instances and\n * compare their respective positions within the tree.\n */\n abstract sortInstanceNodePosition(a: Instance, b: Instance): number\n\n /**\n * Measure the viewport-relative bounding box of the Instance.\n */\n abstract measureInstanceViewportBox(\n instance: Instance,\n props: MotionNodeOptions & Partial\n ): Box\n\n /**\n * When a value has been removed from all animation props we need to\n * pick a target to animate back to. For instance, for HTMLElements\n * we can look in the style prop.\n */\n abstract getBaseTargetFromProps(\n props: MotionNodeOptions,\n key: string\n ): AnyResolvedKeyframe | undefined | MotionValue\n\n /**\n * When we first animate to a value we need to animate it *from* a value.\n * Often this have been specified via the initial prop but it might be\n * that the value needs to be read from the Instance.\n */\n abstract readValueFromInstance(\n instance: Instance,\n key: string,\n options: Options\n ): AnyResolvedKeyframe | null | undefined\n\n /**\n * When a value has been removed from the VisualElement we use this to remove\n * it from the inherting class' unique render state.\n */\n abstract removeValueFromRenderState(\n key: string,\n renderState: RenderState\n ): void\n\n /**\n * Run before a React or VisualElement render, builds the latest motion\n * values into an Instance-specific format. For example, HTMLVisualElement\n * will use this step to build `style` and `var` values.\n */\n abstract build(\n renderState: RenderState,\n latestValues: ResolvedValues,\n props: MotionNodeOptions\n ): void\n\n /**\n * Apply the built values to the Instance. For example, HTMLElements will have\n * styles applied via `setProperty` and the style attribute, whereas SVGElements\n * will have values applied to attributes.\n */\n abstract renderInstance(\n instance: Instance,\n renderState: RenderState,\n styleProp?: MotionStyle,\n projection?: any\n ): void\n\n /**\n * This method is called when a transform property is bound to a motion value.\n * It's currently used to measure SVG elements when a new transform property is bound.\n */\n onBindTransform?(): void\n\n /**\n * If the component child is provided as a motion value, handle subscriptions\n * with the renderer-specific VisualElement.\n */\n handleChildMotionValue?(): void\n\n /**\n * This method takes React props and returns found MotionValues. For example, HTML\n * MotionValues will be found within the style prop, whereas for Three.js within attribute arrays.\n *\n * This isn't an abstract method as it needs calling in the constructor, but it is\n * intended to be one.\n */\n scrapeMotionValuesFromProps(\n _props: MotionNodeOptions,\n _prevProps: MotionNodeOptions,\n _visualElement: VisualElement\n ): {\n [key: string]: MotionValue | AnyResolvedKeyframe\n } {\n return {}\n }\n\n /**\n * A reference to the current underlying Instance, e.g. a HTMLElement\n * or Three.Mesh etc.\n */\n current: Instance | null = null\n\n /**\n * A reference to the parent VisualElement (if exists).\n */\n parent: VisualElement | undefined\n\n /**\n * A set containing references to this VisualElement's children.\n */\n children = new Set()\n\n /**\n * A set containing the latest children of this VisualElement. This is flushed\n * at the start of every commit. We use it to calculate the stagger delay\n * for newly-added children.\n */\n enteringChildren?: Set\n\n /**\n * The depth of this VisualElement within the overall VisualElement tree.\n */\n depth: number\n\n /**\n * The current render state of this VisualElement. Defined by inherting VisualElements.\n */\n renderState: RenderState\n\n /**\n * An object containing the latest static values for each of this VisualElement's\n * MotionValues.\n */\n latestValues: ResolvedValues\n\n /**\n * Determine what role this visual element should take in the variant tree.\n */\n isVariantNode: boolean = false\n isControllingVariants: boolean = false\n\n /**\n * If this component is part of the variant tree, it should track\n * any children that are also part of the tree. This is essentially\n * a shadow tree to simplify logic around how to stagger over children.\n */\n variantChildren?: Set\n\n /**\n * Decides whether this VisualElement should animate in reduced motion\n * mode.\n *\n * TODO: This is currently set on every individual VisualElement but feels\n * like it could be set globally.\n */\n shouldReduceMotion: boolean | null = null\n\n /**\n * Decides whether animations should be skipped for this VisualElement.\n * Useful for E2E tests and visual regression testing.\n */\n shouldSkipAnimations: boolean = false\n\n /**\n * Normally, if a component is controlled by a parent's variants, it can\n * rely on that ancestor to trigger animations further down the tree.\n * However, if a component is created after its parent is mounted, the parent\n * won't trigger that mount animation so the child needs to.\n *\n * TODO: This might be better replaced with a method isParentMounted\n */\n manuallyAnimateOnMount: boolean\n\n /**\n * This can be set by AnimatePresence to force components that mount\n * at the same time as it to mount as if they have initial={false} set.\n */\n blockInitialAnimation: boolean\n\n /**\n * A reference to this VisualElement's projection node, used in layout animations.\n */\n projection?: any\n\n /**\n * A map of all motion values attached to this visual element. Motion\n * values are source of truth for any given animated value. A motion\n * value might be provided externally by the component via props.\n */\n values = new Map()\n\n /**\n * The AnimationState, this is hydrated by the animation Feature.\n */\n animationState?: AnimationState\n\n KeyframeResolver = KeyframeResolver\n\n /**\n * The options used to create this VisualElement. The Options type is defined\n * by the inheriting VisualElement and is passed straight through to the render functions.\n */\n readonly options: Options\n\n /**\n * A reference to the latest props provided to the VisualElement's host React component.\n */\n props: MotionNodeOptions\n prevProps?: MotionNodeOptions\n\n presenceContext: PresenceContextProps | null\n prevPresenceContext?: PresenceContextProps | null\n\n /**\n * Cleanup functions for active features (hover/tap/exit etc)\n */\n private features: {\n [K in keyof FeatureDefinitions]?: Feature\n } = {}\n\n /**\n * A map of every subscription that binds the provided or generated\n * motion values onChange listeners to this visual element.\n */\n private valueSubscriptions = new Map()\n\n /**\n * A reference to the ReducedMotionConfig passed to the VisualElement's host React component.\n */\n private reducedMotionConfig: ReducedMotionConfig | undefined\n\n /**\n * A reference to the skipAnimations config passed to the VisualElement's host React component.\n */\n private skipAnimationsConfig: boolean | undefined\n\n /**\n * On mount, this will be hydrated with a callback to disconnect\n * this visual element from its parent on unmount.\n */\n private removeFromVariantTree: undefined | VoidFunction\n\n /**\n * A reference to the previously-provided motion values as returned\n * from scrapeMotionValuesFromProps. We use the keys in here to determine\n * if any motion values need to be removed after props are updated.\n */\n private prevMotionValues: MotionStyle = {}\n\n /**\n * When values are removed from all animation props we need to search\n * for a fallback value to animate to. These values are tracked in baseTarget.\n */\n private baseTarget: ResolvedValues\n\n /**\n * Create an object of the values we initially animated from (if initial prop present).\n */\n private initialValues: ResolvedValues\n\n /**\n * Track whether this element has been mounted before, to detect\n * remounts after Suspense unmount/remount cycles.\n */\n private hasBeenMounted = false\n\n /**\n * An object containing a SubscriptionManager for each active event.\n */\n private events: {\n [key: string]: SubscriptionManager\n } = {}\n\n /**\n * An object containing an unsubscribe function for each prop event subscription.\n * For example, every \"Update\" event can have multiple subscribers via\n * VisualElement.on(), but only one of those can be defined via the onUpdate prop.\n */\n private propEventSubscriptions: {\n [key: string]: VoidFunction\n } = {}\n\n constructor(\n {\n parent,\n props,\n presenceContext,\n reducedMotionConfig,\n skipAnimations,\n blockInitialAnimation,\n visualState,\n }: VisualElementOptions,\n options: Options = {} as any\n ) {\n const { latestValues, renderState } = visualState\n this.latestValues = latestValues\n this.baseTarget = { ...latestValues }\n this.initialValues = props.initial ? { ...latestValues } : {}\n this.renderState = renderState\n this.parent = parent\n this.props = props\n this.presenceContext = presenceContext\n this.depth = parent ? parent.depth + 1 : 0\n this.reducedMotionConfig = reducedMotionConfig\n this.skipAnimationsConfig = skipAnimations\n this.options = options\n this.blockInitialAnimation = Boolean(blockInitialAnimation)\n\n this.isControllingVariants = checkIsControllingVariants(props)\n this.isVariantNode = checkIsVariantNode(props)\n if (this.isVariantNode) {\n this.variantChildren = new Set()\n }\n\n this.manuallyAnimateOnMount = Boolean(parent && parent.current)\n\n /**\n * Any motion values that are provided to the element when created\n * aren't yet bound to the element, as this would technically be impure.\n * However, we iterate through the motion values and set them to the\n * initial values for this component.\n *\n * TODO: This is impure and we should look at changing this to run on mount.\n * Doing so will break some tests but this isn't necessarily a breaking change,\n * more a reflection of the test.\n */\n const { willChange, ...initialMotionValues } =\n this.scrapeMotionValuesFromProps(props, {}, this)\n\n for (const key in initialMotionValues) {\n const value = initialMotionValues[key]\n\n if (latestValues[key] !== undefined && isMotionValue(value)) {\n value.set(latestValues[key])\n }\n }\n }\n\n mount(instance: Instance) {\n /**\n * If this element has been mounted before (e.g. after a Suspense\n * unmount/remount), reset motion values to their initial state\n * so animations replay correctly from initial → animate.\n */\n if (this.hasBeenMounted) {\n for (const key in this.initialValues) {\n this.values.get(key)?.jump(this.initialValues[key])\n this.latestValues[key] = this.initialValues[key]\n }\n }\n\n this.current = instance\n\n visualElementStore.set(instance, this)\n\n if (this.projection && !this.projection.instance) {\n this.projection.mount(instance)\n }\n\n if (this.parent && this.isVariantNode && !this.isControllingVariants) {\n this.removeFromVariantTree = this.parent.addVariantChild(this)\n }\n\n this.values.forEach((value, key) => this.bindToMotionValue(key, value))\n\n /**\n * Determine reduced motion preference. Only initialize the matchMedia\n * listener if we actually need the dynamic value (i.e., when config\n * is neither \"never\" nor \"always\").\n */\n if (this.reducedMotionConfig === \"never\") {\n this.shouldReduceMotion = false\n } else if (this.reducedMotionConfig === \"always\") {\n this.shouldReduceMotion = true\n } else {\n if (!hasReducedMotionListener.current) {\n initPrefersReducedMotion()\n }\n this.shouldReduceMotion = prefersReducedMotion.current\n }\n\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(\n this.shouldReduceMotion !== true,\n \"You have Reduced Motion enabled on your device. Animations may not appear as expected.\",\n \"reduced-motion-disabled\"\n )\n }\n\n /**\n * Set whether animations should be skipped based on the config.\n */\n this.shouldSkipAnimations = this.skipAnimationsConfig ?? false\n\n this.parent?.addChild(this)\n\n this.update(this.props, this.presenceContext)\n\n this.hasBeenMounted = true\n }\n\n unmount() {\n this.projection && this.projection.unmount()\n cancelFrame(this.notifyUpdate)\n cancelFrame(this.render)\n this.valueSubscriptions.forEach((remove) => remove())\n this.valueSubscriptions.clear()\n this.removeFromVariantTree && this.removeFromVariantTree()\n this.parent?.removeChild(this)\n\n for (const key in this.events) {\n this.events[key].clear()\n }\n\n for (const key in this.features) {\n const feature = this.features[key as keyof typeof this.features]\n if (feature) {\n feature.unmount()\n feature.isMounted = false\n }\n }\n this.current = null\n }\n\n addChild(child: VisualElement) {\n this.children.add(child)\n this.enteringChildren ??= new Set()\n this.enteringChildren.add(child)\n }\n\n removeChild(child: VisualElement) {\n this.children.delete(child)\n this.enteringChildren && this.enteringChildren.delete(child)\n }\n\n private bindToMotionValue(key: string, value: MotionValue) {\n if (this.valueSubscriptions.has(key)) {\n this.valueSubscriptions.get(key)!()\n }\n\n if (\n value.accelerate &&\n acceleratedValues.has(key) &&\n this.current instanceof HTMLElement\n ) {\n const { factory, keyframes, times, ease, duration } =\n value.accelerate\n\n const animation = new NativeAnimation({\n element: this.current,\n name: key,\n keyframes,\n times,\n ease,\n duration: secondsToMilliseconds(duration),\n })\n\n const cleanup = factory(animation)\n\n this.valueSubscriptions.set(key, () => {\n cleanup()\n animation.cancel()\n })\n return\n }\n\n const valueIsTransform = transformProps.has(key)\n\n if (valueIsTransform && this.onBindTransform) {\n this.onBindTransform()\n }\n\n const removeOnChange = value.on(\n \"change\",\n (latestValue: AnyResolvedKeyframe) => {\n this.latestValues[key] = latestValue\n\n this.props.onUpdate && frame.preRender(this.notifyUpdate)\n\n if (valueIsTransform && this.projection) {\n this.projection.isTransformDirty = true\n }\n\n this.scheduleRender()\n }\n )\n\n let removeSyncCheck: VoidFunction | void\n if (\n typeof window !== \"undefined\" &&\n (window as any).MotionCheckAppearSync\n ) {\n removeSyncCheck = (window as any).MotionCheckAppearSync(\n this,\n key,\n value\n )\n }\n\n this.valueSubscriptions.set(key, () => {\n removeOnChange()\n if (removeSyncCheck) removeSyncCheck()\n // Defer to MotionValue.on(\"change\") auto-stop so React 19 remounts\n // can resubscribe before the animation is cancelled (#3315).\n })\n }\n\n sortNodePosition(other: VisualElement) {\n /**\n * If these nodes aren't even of the same type we can't compare their depth.\n */\n if (\n !this.current ||\n !this.sortInstanceNodePosition ||\n this.type !== other.type\n ) {\n return 0\n }\n\n return this.sortInstanceNodePosition(\n this.current as Instance,\n other.current as Instance\n )\n }\n\n updateFeatures() {\n let key: keyof typeof featureDefinitions = \"animation\"\n\n for (key in featureDefinitions) {\n const featureDefinition = featureDefinitions[key]\n\n if (!featureDefinition) continue\n\n const { isEnabled, Feature: FeatureConstructor } = featureDefinition\n\n /**\n * If this feature is enabled but not active, make a new instance.\n */\n if (\n !this.features[key] &&\n FeatureConstructor &&\n isEnabled(this.props)\n ) {\n this.features[key] = new FeatureConstructor(this) as any\n }\n\n /**\n * If we have a feature, mount or update it.\n */\n if (this.features[key]) {\n const feature = this.features[key]!\n if (feature.isMounted) {\n feature.update()\n } else {\n feature.mount()\n feature.isMounted = true\n }\n }\n }\n }\n\n notifyUpdate = () => this.notify(\"Update\", this.latestValues)\n\n triggerBuild() {\n this.build(this.renderState, this.latestValues, this.props)\n }\n\n render = () => {\n if (!this.current) return\n this.triggerBuild()\n this.renderInstance(\n this.current,\n this.renderState,\n (this.props as any).style,\n this.projection\n )\n }\n\n private renderScheduledAt = 0.0\n scheduleRender = () => {\n const now = time.now()\n if (this.renderScheduledAt < now) {\n this.renderScheduledAt = now\n frame.render(this.render, false, true)\n }\n }\n\n /**\n * Measure the current viewport box with or without transforms.\n * Only measures axis-aligned boxes, rotate and skew must be manually\n * removed with a re-render to work.\n */\n measureViewportBox() {\n return this.current\n ? this.measureInstanceViewportBox(this.current, this.props)\n : createBox()\n }\n\n getStaticValue(key: string) {\n return this.latestValues[key]\n }\n\n setStaticValue(key: string, value: AnyResolvedKeyframe) {\n this.latestValues[key] = value\n }\n\n /**\n * Update the provided props. Ensure any newly-added motion values are\n * added to our map, old ones removed, and listeners updated.\n */\n update(\n props: MotionNodeOptions,\n presenceContext: PresenceContextProps | null\n ) {\n if (props.transformTemplate || this.props.transformTemplate) {\n this.scheduleRender()\n }\n\n this.prevProps = this.props\n this.props = props\n\n this.prevPresenceContext = this.presenceContext\n this.presenceContext = presenceContext\n\n /**\n * Update prop event handlers ie onAnimationStart, onAnimationComplete\n */\n for (let i = 0; i < propEventHandlers.length; i++) {\n const key = propEventHandlers[i]\n if (this.propEventSubscriptions[key]) {\n this.propEventSubscriptions[key]()\n delete this.propEventSubscriptions[key]\n }\n\n const listenerName = (\"on\" + key) as keyof typeof props\n const listener = props[listenerName]\n if (listener) {\n this.propEventSubscriptions[key] = this.on(key as any, listener)\n }\n }\n\n this.prevMotionValues = updateMotionValuesFromProps(\n this,\n this.scrapeMotionValuesFromProps(props, this.prevProps || {}, this),\n this.prevMotionValues\n )\n\n if (this.handleChildMotionValue) {\n this.handleChildMotionValue()\n }\n }\n\n getProps() {\n return this.props\n }\n\n /**\n * Returns the variant definition with a given name.\n */\n getVariant(name: string) {\n return this.props.variants ? this.props.variants[name] : undefined\n }\n\n /**\n * Returns the defined default transition on this component.\n */\n getDefaultTransition() {\n return this.props.transition\n }\n\n getTransformPagePoint() {\n return (this.props as any).transformPagePoint\n }\n\n getClosestVariantNode(): VisualElement | undefined {\n return this.isVariantNode\n ? this\n : this.parent\n ? this.parent.getClosestVariantNode()\n : undefined\n }\n\n /**\n * Add a child visual element to our set of children.\n */\n addVariantChild(child: VisualElement) {\n const closestVariantNode = this.getClosestVariantNode()\n if (closestVariantNode) {\n closestVariantNode.variantChildren &&\n closestVariantNode.variantChildren.add(child)\n return () => closestVariantNode.variantChildren!.delete(child)\n }\n }\n\n /**\n * Add a motion value and bind it to this visual element.\n */\n addValue(key: string, value: MotionValue) {\n // Remove existing value if it exists\n const existingValue = this.values.get(key)\n\n if (value !== existingValue) {\n if (existingValue) this.removeValue(key)\n this.bindToMotionValue(key, value)\n this.values.set(key, value)\n this.latestValues[key] = value.get()\n }\n }\n\n /**\n * Remove a motion value and unbind any active subscriptions.\n */\n removeValue(key: string) {\n this.values.delete(key)\n const unsubscribe = this.valueSubscriptions.get(key)\n if (unsubscribe) {\n unsubscribe()\n this.valueSubscriptions.delete(key)\n }\n delete this.latestValues[key]\n this.removeValueFromRenderState(key, this.renderState)\n }\n\n /**\n * Check whether we have a motion value for this key\n */\n hasValue(key: string) {\n return this.values.has(key)\n }\n\n /**\n * Get a motion value for this key. If called with a default\n * value, we'll create one if none exists.\n */\n getValue(key: string): MotionValue | undefined\n getValue(key: string, defaultValue: AnyResolvedKeyframe | null): MotionValue\n getValue(\n key: string,\n defaultValue?: AnyResolvedKeyframe | null\n ): MotionValue | undefined {\n if (this.props.values && this.props.values[key]) {\n return this.props.values[key]\n }\n\n let value = this.values.get(key)\n\n if (value === undefined && defaultValue !== undefined) {\n value = motionValue(\n defaultValue === null ? undefined : defaultValue,\n { owner: this }\n )\n this.addValue(key, value)\n }\n\n return value\n }\n\n /**\n * If we're trying to animate to a previously unencountered value,\n * we need to check for it in our state and as a last resort read it\n * directly from the instance (which might have performance implications).\n */\n readValue(key: string, target?: AnyResolvedKeyframe | null) {\n let value =\n this.latestValues[key] !== undefined || !this.current\n ? this.latestValues[key]\n : this.getBaseTargetFromProps(this.props, key) ??\n this.readValueFromInstance(this.current, key, this.options)\n\n if (value !== undefined && value !== null) {\n if (\n typeof value === \"string\" &&\n (isNumericalString(value) || isZeroValueString(value))\n ) {\n // If this is a number read as a string, ie \"0\" or \"200\", convert it to a number\n value = parseFloat(value)\n } else if (!findValueType(value) && complex.test(target)) {\n value = getAnimatableNone(key, target as string)\n }\n\n this.setBaseTarget(key, isMotionValue(value) ? value.get() : value)\n }\n\n return isMotionValue(value) ? value.get() : value\n }\n\n /**\n * Set the base target to later animate back to. This is currently\n * only hydrated on creation and when we first read a value.\n */\n setBaseTarget(key: string, value: AnyResolvedKeyframe) {\n this.baseTarget[key] = value\n }\n\n /**\n * Find the base target for a value thats been removed from all animation\n * props.\n */\n getBaseTarget(key: string): ResolvedValues[string] | undefined | null {\n const { initial } = this.props\n\n let valueFromInitial: ResolvedValues[string] | undefined | null\n\n if (typeof initial === \"string\" || typeof initial === \"object\") {\n const variant = resolveVariantFromProps(\n this.props,\n initial as any,\n this.presenceContext?.custom\n )\n if (variant) {\n valueFromInitial = variant[\n key as keyof typeof variant\n ] as string\n }\n }\n\n /**\n * If this value still exists in the current initial variant, read that.\n */\n if (initial && valueFromInitial !== undefined) {\n return valueFromInitial\n }\n\n /**\n * Alternatively, if this VisualElement config has defined a getBaseTarget\n * so we can read the value from an alternative source, try that.\n */\n const target = this.getBaseTargetFromProps(this.props, key)\n if (target !== undefined && !isMotionValue(target)) return target\n\n /**\n * If the value was initially defined on initial, but it doesn't any more,\n * return undefined. Otherwise return the value as initially read from the DOM.\n */\n return this.initialValues[key] !== undefined &&\n valueFromInitial === undefined\n ? undefined\n : this.baseTarget[key]\n }\n\n on(\n eventName: EventName,\n callback: VisualElementEventCallbacks[EventName]\n ) {\n if (!this.events[eventName]) {\n this.events[eventName] = new SubscriptionManager()\n }\n\n return this.events[eventName].add(callback)\n }\n\n notify(\n eventName: EventName,\n ...args: any\n ) {\n if (this.events[eventName]) {\n this.events[eventName].notify(...args)\n }\n }\n\n scheduleRenderMicrotask() {\n microtask.render(this.render)\n }\n}\n"],"names":["checkIsControllingVariants","checkIsVariantNode"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA+CA,MAAM,iBAAiB,GAAG;IACtB,gBAAgB;IAChB,mBAAmB;IACnB,QAAQ;IACR,qBAAqB;IACrB,eAAe;IACf,sBAAsB;IACtB,yBAAyB;CACnB;AAEV;;AAEG;AACH,IAAI,kBAAkB,GAAgC,EAAE;AAExD;;;AAGG;AACG,SAAU,qBAAqB,CACjC,WAAwC,EAAA;IAExC,kBAAkB,GAAG,WAAW;AACpC;AAEA;;AAEG;SACa,qBAAqB,GAAA;AACjC,IAAA,OAAO,kBAAkB;AAC7B;AASA;;;AAGG;MACmB,aAAa,CAAA;AA2F/B;;;;;;AAMG;AACH,IAAA,2BAA2B,CACvB,MAAyB,EACzB,UAA6B,EAC7B,cAA6B,EAAA;AAI7B,QAAA,OAAO,EAAE;IACb;AA4LA,IAAA,WAAA,CACI,EACI,MAAM,EACN,KAAK,EACL,eAAe,EACf,mBAAmB,EACnB,cAAc,EACd,qBAAqB,EACrB,WAAW,GAC+B,EAC9C,UAAmB,EAAS,EAAA;AApMhC;;;AAGG;QACH,IAAA,CAAA,OAAO,GAAoB,IAAI;AAO/B;;AAEG;AACH,QAAA,IAAA,CAAA,QAAQ,GAAG,IAAI,GAAG,EAAiB;AAyBnC;;AAEG;QACH,IAAA,CAAA,aAAa,GAAY,KAAK;QAC9B,IAAA,CAAA,qBAAqB,GAAY,KAAK;AAStC;;;;;;AAMG;QACH,IAAA,CAAA,kBAAkB,GAAmB,IAAI;AAEzC;;;AAGG;QACH,IAAA,CAAA,oBAAoB,GAAY,KAAK;AAuBrC;;;;AAIG;AACH,QAAA,IAAA,CAAA,MAAM,GAAG,IAAI,GAAG,EAAuB;QAOvC,IAAA,CAAA,gBAAgB,GAAG,gBAAgB;AAiBnC;;AAEG;QACK,IAAA,CAAA,QAAQ,GAEZ,EAAE;AAEN;;;AAGG;AACK,QAAA,IAAA,C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C,QAAQ,CAAC;IAC/C;AAEA,IAAA,MAAM,CACF,SAAoB,EACpB,GAAG,IAAS,EAAA;AAEZ,QAAA,IAAI,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE;YACxB,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;QAC1C;IACJ;IAEA,uBAAuB,GAAA;AACnB,QAAA,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;IACjC;AACH;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/dom/DOMVisualElement.mjs b/node_modules/motion-dom/dist/es/render/dom/DOMVisualElement.mjs new file mode 100644 index 0000000..ee72b5e --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/dom/DOMVisualElement.mjs @@ -0,0 +1,43 @@ +import { isMotionValue } from '../../value/utils/is-motion-value.mjs'; +import { DOMKeyframesResolver } from '../../animation/keyframes/DOMKeyframesResolver.mjs'; +import { VisualElement } from '../VisualElement.mjs'; + +class DOMVisualElement extends VisualElement { + constructor() { + super(...arguments); + this.KeyframeResolver = DOMKeyframesResolver; + } + sortInstanceNodePosition(a, b) { + /** + * compareDocumentPosition returns a bitmask, by using the bitwise & + * we're returning true if 2 in that bitmask is set to true. 2 is set + * to true if b preceeds a. + */ + return a.compareDocumentPosition(b) & 2 ? 1 : -1; + } + getBaseTargetFromProps(props, key) { + const style = props.style; + return style ? style[key] : undefined; + } + removeValueFromRenderState(key, { vars, style }) { + delete vars[key]; + delete style[key]; + } + handleChildMotionValue() { + if (this.childSubscription) { + this.childSubscription(); + delete this.childSubscription; + } + const { children } = this.props; + if (isMotionValue(children)) { + this.childSubscription = children.on("change", (latest) => { + if (this.current) { + this.current.textContent = `${latest}`; + } + }); + } + } +} + +export { DOMVisualElement }; +//# sourceMappingURL=DOMVisualElement.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/dom/DOMVisualElement.mjs.map b/node_modules/motion-dom/dist/es/render/dom/DOMVisualElement.mjs.map new file mode 100644 index 0000000..99b2be9 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/dom/DOMVisualElement.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"DOMVisualElement.mjs","sources":["../../../../src/render/dom/DOMVisualElement.ts"],"sourcesContent":["import { isMotionValue } from \"../../value/utils/is-motion-value\"\nimport type { MotionValue } from \"../../value\"\nimport type { AnyResolvedKeyframe } from \"../../animation/types\"\nimport { DOMKeyframesResolver } from \"../../animation/keyframes/DOMKeyframesResolver\"\nimport type { MotionNodeOptions } from \"../../node/types\"\nimport type { DOMVisualElementOptions } from \"./types\"\nimport type { HTMLRenderState } from \"../html/types\"\nimport { VisualElement, MotionStyle } from \"../VisualElement\"\n\nexport abstract class DOMVisualElement<\n Instance extends HTMLElement | SVGElement = HTMLElement,\n State extends HTMLRenderState = HTMLRenderState,\n Options extends DOMVisualElementOptions = DOMVisualElementOptions\n> extends VisualElement {\n sortInstanceNodePosition(a: Instance, b: Instance): number {\n /**\n * compareDocumentPosition returns a bitmask, by using the bitwise &\n * we're returning true if 2 in that bitmask is set to true. 2 is set\n * to true if b preceeds a.\n */\n return a.compareDocumentPosition(b) & 2 ? 1 : -1\n }\n\n getBaseTargetFromProps(\n props: MotionNodeOptions,\n key: string\n ): AnyResolvedKeyframe | MotionValue | undefined {\n const style = (props as MotionNodeOptions & { style?: MotionStyle }).style\n return style ? (style[key] as string) : undefined\n }\n\n removeValueFromRenderState(\n key: string,\n { vars, style }: HTMLRenderState\n ): void {\n delete vars[key]\n delete style[key]\n }\n\n KeyframeResolver = DOMKeyframesResolver\n\n childSubscription?: VoidFunction\n handleChildMotionValue() {\n if (this.childSubscription) {\n this.childSubscription()\n delete this.childSubscription\n }\n\n const { children } = this.props as MotionNodeOptions & { children?: MotionValue | any }\n if (isMotionValue(children)) {\n this.childSubscription = children.on(\"change\", (latest) => {\n if (this.current) {\n this.current.textContent = `${latest}`\n }\n })\n }\n }\n}\n"],"names":[],"mappings":";;;;AASM,MAAgB,gBAIpB,SAAQ,aAAuC,CAAA;AAJjD,IAAA,WAAA,GAAA;;QA8BI,IAAA,CAAA,gBAAgB,GAAG,oBAAoB;IAkB3C;IA3CI,wBAAwB,CAAC,CAAW,EAAE,CAAW,EAAA;AAC7C;;;;AAIG;AACH,QAAA,OAAO,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE;IACpD;IAEA,sBAAsB,CAClB,KAAwB,EACxB,GAAW,EAAA;AAEX,QAAA,MAAM,KAAK,GAAI,KAAqD,CAAC,KAAK;AAC1E,QAAA,OAAO,KAAK,GAAI,KAAK,CAAC,GAAG,CAAY,GAAG,SAAS;IACrD;AAEA,IAAA,0BAA0B,CACtB,GAAW,EACX,EAAE,IAAI,EAAE,KAAK,EAAmB,EAAA;AAEhC,QAAA,OAAO,IAAI,CAAC,GAAG,CAAC;AAChB,QAAA,OAAO,KAAK,CAAC,GAAG,CAAC;IACrB;IAKA,sBAAsB,GAAA;AAClB,QAAA,IAAI,IAAI,CAAC,iBAAiB,EAAE;YACxB,IAAI,CAAC,iBAAiB,EAAE;YACxB,OAAO,IAAI,CAAC,iBAAiB;QACjC;AAEA,QAAA,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC,KAA6D;AACvF,QAAA,IAAI,aAAa,CAAC,QAAQ,CAAC,EAAE;AACzB,YAAA,IAAI,CAAC,iBAAiB,GAAG,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,MAAM,KAAI;AACtD,gBAAA,IAAI,IAAI,CAAC,OAAO,EAAE;oBACd,IAAI,CAAC,OAAO,CAAC,WAAW,GAAG,CAAA,EAAG,MAAM,EAAE;gBAC1C;AACJ,YAAA,CAAC,CAAC;QACN;IACJ;AACH;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/dom/is-css-var.mjs b/node_modules/motion-dom/dist/es/render/dom/is-css-var.mjs new file mode 100644 index 0000000..7ee34f4 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/dom/is-css-var.mjs @@ -0,0 +1,4 @@ +const isCSSVar = (name) => name.startsWith("--"); + +export { isCSSVar }; +//# sourceMappingURL=is-css-var.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/dom/is-css-var.mjs.map b/node_modules/motion-dom/dist/es/render/dom/is-css-var.mjs.map new file mode 100644 index 0000000..55eaadb --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/dom/is-css-var.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"is-css-var.mjs","sources":["../../../../src/render/dom/is-css-var.ts"],"sourcesContent":["export const isCSSVar = (name: string) => name.startsWith(\"--\")\n"],"names":[],"mappings":"AAAO,MAAM,QAAQ,GAAG,CAAC,IAAY,KAAK,IAAI,CAAC,UAAU,CAAC,IAAI;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/dom/parse-transform.mjs b/node_modules/motion-dom/dist/es/render/dom/parse-transform.mjs new file mode 100644 index 0000000..414bdf3 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/dom/parse-transform.mjs @@ -0,0 +1,84 @@ +const radToDeg = (rad) => (rad * 180) / Math.PI; +const rotate = (v) => { + const angle = radToDeg(Math.atan2(v[1], v[0])); + return rebaseAngle(angle); +}; +const matrix2dParsers = { + x: 4, + y: 5, + translateX: 4, + translateY: 5, + scaleX: 0, + scaleY: 3, + scale: (v) => (Math.abs(v[0]) + Math.abs(v[3])) / 2, + rotate, + rotateZ: rotate, + skewX: (v) => radToDeg(Math.atan(v[1])), + skewY: (v) => radToDeg(Math.atan(v[2])), + skew: (v) => (Math.abs(v[1]) + Math.abs(v[2])) / 2, +}; +const rebaseAngle = (angle) => { + angle = angle % 360; + if (angle < 0) + angle += 360; + return angle; +}; +const rotateZ = rotate; +const scaleX = (v) => Math.sqrt(v[0] * v[0] + v[1] * v[1]); +const scaleY = (v) => Math.sqrt(v[4] * v[4] + v[5] * v[5]); +const matrix3dParsers = { + x: 12, + y: 13, + z: 14, + translateX: 12, + translateY: 13, + translateZ: 14, + scaleX, + scaleY, + scale: (v) => (scaleX(v) + scaleY(v)) / 2, + rotateX: (v) => rebaseAngle(radToDeg(Math.atan2(v[6], v[5]))), + rotateY: (v) => rebaseAngle(radToDeg(Math.atan2(-v[2], v[0]))), + rotateZ, + rotate: rotateZ, + skewX: (v) => radToDeg(Math.atan(v[4])), + skewY: (v) => radToDeg(Math.atan(v[1])), + skew: (v) => (Math.abs(v[1]) + Math.abs(v[4])) / 2, +}; +function defaultTransformValue(name) { + return name.includes("scale") ? 1 : 0; +} +function parseValueFromTransform(transform, name) { + if (!transform || transform === "none") { + return defaultTransformValue(name); + } + const matrix3dMatch = transform.match(/^matrix3d\(([-\d.e\s,]+)\)$/u); + let parsers; + let match; + if (matrix3dMatch) { + parsers = matrix3dParsers; + match = matrix3dMatch; + } + else { + const matrix2dMatch = transform.match(/^matrix\(([-\d.e\s,]+)\)$/u); + parsers = matrix2dParsers; + match = matrix2dMatch; + } + if (!match) { + return defaultTransformValue(name); + } + const valueParser = parsers[name]; + const values = match[1].split(",").map(convertTransformToNumber); + return typeof valueParser === "function" + ? valueParser(values) + : values[valueParser]; +} +const readTransformValue = (instance, name) => { + const { transform = "none" } = getComputedStyle(instance); + return parseValueFromTransform(transform, name); +}; +function convertTransformToNumber(value) { + return parseFloat(value.trim()); +} + +export { defaultTransformValue, parseValueFromTransform, readTransformValue }; +//# sourceMappingURL=parse-transform.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/dom/parse-transform.mjs.map b/node_modules/motion-dom/dist/es/render/dom/parse-transform.mjs.map new file mode 100644 index 0000000..0a97a8c --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/dom/parse-transform.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"parse-transform.mjs","sources":["../../../../src/render/dom/parse-transform.ts"],"sourcesContent":["import { transformPropOrder } from \"../utils/keys-transform\"\n\nconst radToDeg = (rad: number) => (rad * 180) / Math.PI\n\ntype MatrixParser = (values: number[]) => number\n\ntype MatrixParsers = Record<\n (typeof transformPropOrder)[number],\n number | MatrixParser\n>\n\nconst rotate = (v: number[]) => {\n const angle = radToDeg(Math.atan2(v[1], v[0]))\n return rebaseAngle(angle)\n}\n\nconst matrix2dParsers: MatrixParsers = {\n x: 4,\n y: 5,\n translateX: 4,\n translateY: 5,\n scaleX: 0,\n scaleY: 3,\n scale: (v) => (Math.abs(v[0]) + Math.abs(v[3])) / 2,\n rotate,\n rotateZ: rotate,\n skewX: (v) => radToDeg(Math.atan(v[1])),\n skewY: (v) => radToDeg(Math.atan(v[2])),\n skew: (v) => (Math.abs(v[1]) + Math.abs(v[2])) / 2,\n} as const\n\nconst rebaseAngle = (angle: number) => {\n angle = angle % 360\n if (angle < 0) angle += 360\n return angle\n}\n\nconst rotateZ = rotate\n\nconst scaleX = (v: number[]) => Math.sqrt(v[0] * v[0] + v[1] * v[1])\nconst scaleY = (v: number[]) => Math.sqrt(v[4] * v[4] + v[5] * v[5])\n\nconst matrix3dParsers: MatrixParsers = {\n x: 12,\n y: 13,\n z: 14,\n translateX: 12,\n translateY: 13,\n translateZ: 14,\n scaleX,\n scaleY,\n scale: (v) => (scaleX(v) + scaleY(v)) / 2,\n rotateX: (v) => rebaseAngle(radToDeg(Math.atan2(v[6], v[5]))),\n rotateY: (v) => rebaseAngle(radToDeg(Math.atan2(-v[2], v[0]))),\n rotateZ,\n rotate: rotateZ,\n skewX: (v) => radToDeg(Math.atan(v[4])),\n skewY: (v) => radToDeg(Math.atan(v[1])),\n skew: (v) => (Math.abs(v[1]) + Math.abs(v[4])) / 2,\n} as const\n\nexport function defaultTransformValue(name: string): number {\n return name.includes(\"scale\") ? 1 : 0\n}\n\nexport function parseValueFromTransform(\n transform: string | undefined,\n name: string\n): number {\n if (!transform || transform === \"none\") {\n return defaultTransformValue(name)\n }\n\n const matrix3dMatch = transform.match(/^matrix3d\\(([-\\d.e\\s,]+)\\)$/u)\n\n let parsers: MatrixParsers\n let match: RegExpMatchArray | null\n\n if (matrix3dMatch) {\n parsers = matrix3dParsers\n match = matrix3dMatch\n } else {\n const matrix2dMatch = transform.match(/^matrix\\(([-\\d.e\\s,]+)\\)$/u)\n\n parsers = matrix2dParsers\n match = matrix2dMatch\n }\n\n if (!match) {\n return defaultTransformValue(name)\n }\n\n const valueParser = parsers[name]\n const values = match[1].split(\",\").map(convertTransformToNumber)\n\n return typeof valueParser === \"function\"\n ? valueParser(values)\n : values[valueParser]\n}\n\nexport const readTransformValue = (instance: HTMLElement, name: string) => {\n const { transform = \"none\" } = getComputedStyle(instance)\n return parseValueFromTransform(transform, name)\n}\n\nfunction convertTransformToNumber(value: string): number {\n return parseFloat(value.trim())\n}\n"],"names":[],"mappings":"AAEA,MAAM,QAAQ,GAAG,CAAC,GAAW,KAAK,CAAC,GAAG,GAAG,GAAG,IAAI,IAAI,CAAC,EAAE;AASvD,MAAM,MAAM,GAAG,CAAC,CAAW,KAAI;AAC3B,IAAA,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC9C,IAAA,OAAO,WAAW,CAAC,KAAK,CAAC;AAC7B,CAAC;AAED,MAAM,eAAe,GAAkB;AACnC,IAAA,CAAC,EAAE,CAAC;AACJ,IAAA,CAAC,EAAE,CAAC;AACJ,IAAA,UAAU,EAAE,CAAC;AACb,IAAA,UAAU,EAAE,CAAC;AACb,IAAA,MAAM,EAAE,CAAC;AACT,IAAA,MAAM,EAAE,CAAC;AACT,IAAA,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACnD,MAAM;AACN,IAAA,OAAO,EAAE,MAAM;AACf,IAAA,KAAK,EAAE,CAA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AA,IAAI,KAA8B;IAElC,IAAI,aAAa,EAAE;QACf,OAAO,GAAG,eAAe;QACzB,KAAK,GAAG,aAAa;IACzB;SAAO;QACH,MAAM,aAAa,GAAG,SAAS,CAAC,KAAK,CAAC,4BAA4B,CAAC;QAEnE,OAAO,GAAG,eAAe;QACzB,KAAK,GAAG,aAAa;IACzB;IAEA,IAAI,CAAC,KAAK,EAAE;AACR,QAAA,OAAO,qBAAqB,CAAC,IAAI,CAAC;IACtC;AAEA,IAAA,MAAM,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;AACjC,IAAA,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,wBAAwB,CAAC;IAEhE,OAAO,OAAO,WAAW,KAAK;AAC1B,UAAE,WAAW,CAAC,MAAM;AACpB,UAAE,MAAM,CAAC,WAAW,CAAC;AAC7B;MAEa,kBAAkB,GAAG,CAAC,QAAqB,EAAE,IAAY,KAAI;IACtE,MAAM,EAAE,SAAS,GAAG,MAAM,EAAE,GAAG,gBAAgB,CAAC,QAAQ,CAAC;AACzD,IAAA,OAAO,uBAAuB,CAAC,SAAS,EAAE,IAAI,CAAC;AACnD;AAEA,SAAS,wBAAwB,CAAC,KAAa,EAAA;AAC3C,IAAA,OAAO,UAAU,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;AACnC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/dom/style-computed.mjs b/node_modules/motion-dom/dist/es/render/dom/style-computed.mjs new file mode 100644 index 0000000..73002fb --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/dom/style-computed.mjs @@ -0,0 +1,11 @@ +import { isCSSVar } from './is-css-var.mjs'; + +function getComputedStyle(element, name) { + const computedStyle = window.getComputedStyle(element); + return isCSSVar(name) + ? computedStyle.getPropertyValue(name) + : computedStyle[name]; +} + +export { getComputedStyle }; +//# sourceMappingURL=style-computed.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/dom/style-computed.mjs.map b/node_modules/motion-dom/dist/es/render/dom/style-computed.mjs.map new file mode 100644 index 0000000..4a930db --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/dom/style-computed.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"style-computed.mjs","sources":["../../../../src/render/dom/style-computed.ts"],"sourcesContent":["import { isCSSVar } from \"./is-css-var\"\n\nexport function getComputedStyle(\n element: HTMLElement | SVGElement,\n name: string\n) {\n const computedStyle = window.getComputedStyle(element)\n return isCSSVar(name)\n ? computedStyle.getPropertyValue(name)\n : computedStyle[name as any]\n}\n"],"names":[],"mappings":";;AAEM,SAAU,gBAAgB,CAC5B,OAAiC,EACjC,IAAY,EAAA;IAEZ,MAAM,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC,OAAO,CAAC;IACtD,OAAO,QAAQ,CAAC,IAAI;AAChB,UAAE,aAAa,CAAC,gBAAgB,CAAC,IAAI;AACrC,UAAE,aAAa,CAAC,IAAW,CAAC;AACpC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/dom/style-set.mjs b/node_modules/motion-dom/dist/es/render/dom/style-set.mjs new file mode 100644 index 0000000..e4389cc --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/dom/style-set.mjs @@ -0,0 +1,10 @@ +import { isCSSVar } from './is-css-var.mjs'; + +function setStyle(element, name, value) { + isCSSVar(name) + ? element.style.setProperty(name, value) + : (element.style[name] = value); +} + +export { setStyle }; +//# sourceMappingURL=style-set.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/dom/style-set.mjs.map b/node_modules/motion-dom/dist/es/render/dom/style-set.mjs.map new file mode 100644 index 0000000..68ee566 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/dom/style-set.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"style-set.mjs","sources":["../../../../src/render/dom/style-set.ts"],"sourcesContent":["import { AnyResolvedKeyframe } from \"../../animation/types\"\nimport { isCSSVar } from \"./is-css-var\"\n\nexport function setStyle(\n element: HTMLElement | SVGElement,\n name: string,\n value: AnyResolvedKeyframe\n) {\n isCSSVar(name)\n ? element.style.setProperty(name, value as string)\n : (element.style[name as any] = value as string)\n}\n"],"names":[],"mappings":";;SAGgB,QAAQ,CACpB,OAAiC,EACjC,IAAY,EACZ,KAA0B,EAAA;IAE1B,QAAQ,CAAC,IAAI;UACP,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,EAAE,KAAe;WAC9C,OAAO,CAAC,KAAK,CAAC,IAAW,CAAC,GAAG,KAAe,CAAC;AACxD;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/dom/utils/camel-to-dash.mjs b/node_modules/motion-dom/dist/es/render/dom/utils/camel-to-dash.mjs new file mode 100644 index 0000000..aa8caef --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/dom/utils/camel-to-dash.mjs @@ -0,0 +1,6 @@ +function camelToDash(str) { + return str.replace(/([A-Z])/g, (match) => `-${match.toLowerCase()}`); +} + +export { camelToDash }; +//# sourceMappingURL=camel-to-dash.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/dom/utils/camel-to-dash.mjs.map b/node_modules/motion-dom/dist/es/render/dom/utils/camel-to-dash.mjs.map new file mode 100644 index 0000000..6942af2 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/dom/utils/camel-to-dash.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"camel-to-dash.mjs","sources":["../../../../../src/render/dom/utils/camel-to-dash.ts"],"sourcesContent":["export function camelToDash(str: string): string {\n return str.replace(/([A-Z])/g, (match) => `-${match.toLowerCase()}`)\n}\n"],"names":[],"mappings":"AAAM,SAAU,WAAW,CAAC,GAAW,EAAA;AACnC,IAAA,OAAO,GAAG,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC,KAAK,KAAK,IAAI,KAAK,CAAC,WAAW,EAAE,CAAA,CAAE,CAAC;AACxE;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/html/HTMLVisualElement.mjs b/node_modules/motion-dom/dist/es/render/html/HTMLVisualElement.mjs new file mode 100644 index 0000000..80604c6 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/html/HTMLVisualElement.mjs @@ -0,0 +1,55 @@ +import { invariant } from 'motion-utils'; +import { isCSSVariableName } from '../../animation/utils/is-css-variable.mjs'; +import { transformProps } from '../utils/keys-transform.mjs'; +import { defaultTransformValue, readTransformValue } from '../dom/parse-transform.mjs'; +import { measureViewportBox } from '../../projection/utils/measure.mjs'; +import { DOMVisualElement } from '../dom/DOMVisualElement.mjs'; +import { buildHTMLStyles } from './utils/build-styles.mjs'; +import { renderHTML } from './utils/render.mjs'; +import { scrapeMotionValuesFromProps } from './utils/scrape-motion-values.mjs'; + +function getComputedStyle(element) { + return window.getComputedStyle(element); +} +class HTMLVisualElement extends DOMVisualElement { + constructor() { + super(...arguments); + this.type = "html"; + this.renderInstance = renderHTML; + } + mount(instance) { + /** + * If a custom component forwards its ref to something other than a + * HTML/SVG element (a class instance, an imperative handle) there's + * nothing for Motion to style, measure or attach gestures to. #2777 + */ + invariant(Boolean(instance.style), "motion.create() components must forward their ref to a HTML or SVG element", "custom-component-ref"); + super.mount(instance); + } + readValueFromInstance(instance, key) { + if (transformProps.has(key)) { + return this.projection?.isProjecting + ? defaultTransformValue(key) + : readTransformValue(instance, key); + } + else { + const computedStyle = getComputedStyle(instance); + const value = (isCSSVariableName(key) + ? computedStyle.getPropertyValue(key) + : computedStyle[key]) || 0; + return typeof value === "string" ? value.trim() : value; + } + } + measureInstanceViewportBox(instance, { transformPagePoint }) { + return measureViewportBox(instance, transformPagePoint); + } + build(renderState, latestValues, props) { + buildHTMLStyles(renderState, latestValues, props.transformTemplate); + } + scrapeMotionValuesFromProps(props, prevProps, visualElement) { + return scrapeMotionValuesFromProps(props, prevProps, visualElement); + } +} + +export { HTMLVisualElement, getComputedStyle }; +//# sourceMappingURL=HTMLVisualElement.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/html/HTMLVisualElement.mjs.map b/node_modules/motion-dom/dist/es/render/html/HTMLVisualElement.mjs.map new file mode 100644 index 0000000..05755b5 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/html/HTMLVisualElement.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"HTMLVisualElement.mjs","sources":["../../../../src/render/html/HTMLVisualElement.ts"],"sourcesContent":["import { invariant, type Box } from \"motion-utils\"\nimport type { AnyResolvedKeyframe } from \"../../animation/types\"\nimport { isCSSVariableName } from \"../../animation/utils/is-css-variable\"\nimport type { MotionNodeOptions } from \"../../node/types\"\nimport { transformProps } from \"../utils/keys-transform\"\nimport {\n defaultTransformValue,\n readTransformValue,\n} from \"../dom/parse-transform\"\nimport { measureViewportBox } from \"../../projection/utils/measure\"\nimport { DOMVisualElement } from \"../dom/DOMVisualElement\"\nimport type { DOMVisualElementOptions } from \"../dom/types\"\nimport type { ResolvedValues, MotionConfigContextProps } from \"../types\"\nimport type { VisualElement } from \"../VisualElement\"\nimport { HTMLRenderState } from \"./types\"\nimport { buildHTMLStyles } from \"./utils/build-styles\"\nimport { renderHTML } from \"./utils/render\"\nimport { scrapeMotionValuesFromProps } from \"./utils/scrape-motion-values\"\n\nexport function getComputedStyle(element: HTMLElement) {\n return window.getComputedStyle(element)\n}\n\nexport class HTMLVisualElement extends DOMVisualElement<\n HTMLElement,\n HTMLRenderState,\n DOMVisualElementOptions\n> {\n type = \"html\"\n\n mount(instance: HTMLElement) {\n /**\n * If a custom component forwards its ref to something other than a\n * HTML/SVG element (a class instance, an imperative handle) there's\n * nothing for Motion to style, measure or attach gestures to. #2777\n */\n invariant(\n Boolean(instance.style),\n \"motion.create() components must forward their ref to a HTML or SVG element\",\n \"custom-component-ref\"\n )\n\n super.mount(instance)\n }\n\n readValueFromInstance(\n instance: HTMLElement,\n key: string\n ): AnyResolvedKeyframe | null | undefined {\n if (transformProps.has(key)) {\n return this.projection?.isProjecting\n ? defaultTransformValue(key)\n : readTransformValue(instance, key)\n } else {\n const computedStyle = getComputedStyle(instance)\n const value =\n (isCSSVariableName(key)\n ? computedStyle.getPropertyValue(key)\n : computedStyle[key as keyof typeof computedStyle]) || 0\n\n return typeof value === \"string\" ? value.trim() : (value as number)\n }\n }\n\n measureInstanceViewportBox(\n instance: HTMLElement,\n { transformPagePoint }: MotionNodeOptions & Partial\n ): Box {\n return measureViewportBox(instance, transformPagePoint)\n }\n\n build(\n renderState: HTMLRenderState,\n latestValues: ResolvedValues,\n props: MotionNodeOptions\n ) {\n buildHTMLStyles(renderState, latestValues, props.transformTemplate)\n }\n\n scrapeMotionValuesFromProps(\n props: MotionNodeOptions,\n prevProps: MotionNodeOptions,\n visualElement: VisualElement\n ) {\n return scrapeMotionValuesFromProps(props, prevProps, visualElement)\n }\n\n renderInstance = renderHTML\n}\n"],"names":[],"mappings":";;;;;;;;;;AAmBM,SAAU,gBAAgB,CAAC,OAAoB,EAAA;AACjD,IAAA,OAAO,MAAM,CAAC,gBAAgB,CAAC,OAAO,CAAC;AAC3C;AAEM,MAAO,iBAAkB,SAAQ,gBAItC,CAAA;AAJD,IAAA,WAAA,GAAA;;QAKI,IAAA,CAAA,IAAI,GAAG,MAAM;QA2Db,IAAA,CAAA,cAAc,GAAG,UAAU;IAC/B;AA1DI,IAAA,KAAK,CAAC,QAAqB,EAAA;AACvB;;;;AAIG;AACH,QAAA,SAAS,CACL,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,EACvB,4EAA4E,EAC5E,sBAAsB,CACzB;AAED,QAAA,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC;IACzB;IAEA,qBAAqB,CACjB,QAAqB,EACrB,GAAW,EAAA;AAEX,QAAA,IAAI,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;AACzB,YAAA,OAAO,IAAI,CAAC,UAAU,EAAE;AACpB,kBAAE,qBAAqB,CAAC,GAAG;AAC3B,kBAAE,kBAAkB,CAAC,QAAQ,EAAE,GAAG,CAAC;QAC3C;aAAO;AACH,YAAA,MAAM,aAAa,GAAG,gBAAgB,CAAC,QAAQ,CAAC;AAChD,YAAA,MAAM,KAAK,GACP,CAAC,iBAAiB,CAAC,GAAG;AAClB,kBAAE,aAAa,CAAC,gBAAgB,CAAC,GAAG;kBAClC,aAAa,CAAC,GAAiC,CAAC,KAAK,CAAC;AAEhE,YAAA,OAAO,OAAO,KAAK,KAAK,QAAQ,GAAG,KAAK,CAAC,IAAI,EAAE,GAAI,KAAgB;QACvE;IACJ;AAEA,IAAA,0BAA0B,CACtB,QAAqB,EACrB,EAAE,kBAAkB,EAAyD,EAAA;AAE7E,QAAA,OAAO,kBAAkB,CAAC,QAAQ,EAAE,kBAAkB,CAAC;IAC3D;AAEA,IAAA,KAAK,CACD,WAA4B,EAC5B,YAA4B,EAC5B,KAAwB,EAAA;QAExB,eAAe,CAAC,WAAW,EAAE,YAAY,EAAE,KAAK,CAAC,iBAAiB,CAAC;IACvE;AAEA,IAAA,2BAA2B,CACvB,KAAwB,EACxB,SAA4B,EAC5B,aAA4B,EAAA;QAE5B,OAAO,2BAA2B,CAAC,KAAK,EAAE,SAAS,EAAE,aAAa,CAAC;IACvE;AAGH;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/html/utils/build-styles.mjs b/node_modules/motion-dom/dist/es/render/html/utils/build-styles.mjs new file mode 100644 index 0000000..bd068f2 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/html/utils/build-styles.mjs @@ -0,0 +1,66 @@ +import { getValueAsType } from '../../../value/types/utils/get-as-type.mjs'; +import { numberValueTypes } from '../../../value/types/maps/number.mjs'; +import { transformProps } from '../../utils/keys-transform.mjs'; +import { isCSSVariableName } from '../../../animation/utils/is-css-variable.mjs'; +import { buildTransform } from './build-transform.mjs'; + +function buildHTMLStyles(state, latestValues, transformTemplate) { + const { style, vars, transformOrigin } = state; + // Track whether we encounter any transform or transformOrigin values. + let hasTransform = false; + let hasTransformOrigin = false; + /** + * Loop over all our latest animated values and decide whether to handle them + * as a style or CSS variable. + * + * Transforms and transform origins are kept separately for further processing. + */ + for (const key in latestValues) { + const value = latestValues[key]; + if (transformProps.has(key)) { + // If this is a transform, flag to enable further transform processing + hasTransform = true; + continue; + } + else if (isCSSVariableName(key)) { + vars[key] = value; + continue; + } + else { + // Convert the value to its default value type, ie 0 -> "0px" + const valueAsType = getValueAsType(value, numberValueTypes[key]); + if (key.startsWith("origin")) { + // If this is a transform origin, flag and enable further transform-origin processing + hasTransformOrigin = true; + transformOrigin[key] = + valueAsType; + } + else { + style[key] = valueAsType; + } + } + } + if (!latestValues.transform) { + if (hasTransform || transformTemplate) { + style.transform = buildTransform(latestValues, state.transform, transformTemplate); + } + else if (style.transform) { + /** + * If we have previously created a transform but currently don't have any, + * reset transform style to none. + */ + style.transform = "none"; + } + } + /** + * Build a transformOrigin style. Uses the same defaults as the browser for + * undefined origins. + */ + if (hasTransformOrigin) { + const { originX = "50%", originY = "50%", originZ = 0, } = transformOrigin; + style.transformOrigin = `${originX} ${originY} ${originZ}`; + } +} + +export { buildHTMLStyles }; +//# sourceMappingURL=build-styles.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/html/utils/build-styles.mjs.map b/node_modules/motion-dom/dist/es/render/html/utils/build-styles.mjs.map new file mode 100644 index 0000000..cb0f620 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/html/utils/build-styles.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"build-styles.mjs","sources":["../../../../../src/render/html/utils/build-styles.ts"],"sourcesContent":["import { getValueAsType } from \"../../../value/types/utils/get-as-type\"\nimport { numberValueTypes } from \"../../../value/types/maps/number\"\nimport { transformProps } from \"../../utils/keys-transform\"\nimport { isCSSVariableName } from \"../../../animation/utils/is-css-variable\"\nimport { ResolvedValues } from \"../../types\"\nimport { HTMLRenderState } from \"../types\"\nimport { buildTransform } from \"./build-transform\"\nimport type { MotionNodeOptions } from \"../../../node/types\"\n\nexport function buildHTMLStyles(\n state: HTMLRenderState,\n latestValues: ResolvedValues,\n transformTemplate?: MotionNodeOptions[\"transformTemplate\"]\n) {\n const { style, vars, transformOrigin } = state\n\n // Track whether we encounter any transform or transformOrigin values.\n let hasTransform = false\n let hasTransformOrigin = false\n\n /**\n * Loop over all our latest animated values and decide whether to handle them\n * as a style or CSS variable.\n *\n * Transforms and transform origins are kept separately for further processing.\n */\n for (const key in latestValues) {\n const value = latestValues[key]\n\n if (transformProps.has(key)) {\n // If this is a transform, flag to enable further transform processing\n hasTransform = true\n continue\n } else if (isCSSVariableName(key)) {\n vars[key] = value\n continue\n } else {\n // Convert the value to its default value type, ie 0 -> \"0px\"\n const valueAsType = getValueAsType(value, numberValueTypes[key])\n\n if (key.startsWith(\"origin\")) {\n // If this is a transform origin, flag and enable further transform-origin processing\n hasTransformOrigin = true\n transformOrigin[key as keyof typeof transformOrigin] =\n valueAsType\n } else {\n style[key] = valueAsType\n }\n }\n }\n\n if (!latestValues.transform) {\n if (hasTransform || transformTemplate) {\n style.transform = buildTransform(\n latestValues,\n state.transform,\n transformTemplate\n )\n } else if (style.transform) {\n /**\n * If we have previously created a transform but currently don't have any,\n * reset transform style to none.\n */\n style.transform = \"none\"\n }\n }\n\n /**\n * Build a transformOrigin style. Uses the same defaults as the browser for\n * undefined origins.\n */\n if (hasTransformOrigin) {\n const {\n originX = \"50%\",\n originY = \"50%\",\n originZ = 0,\n } = transformOrigin\n style.transformOrigin = `${originX} ${originY} ${originZ}`\n }\n}\n"],"names":[],"mappings":";;;;;;SASgB,eAAe,CAC3B,KAAsB,EACtB,YAA4B,EAC5B,iBAA0D,EAAA;IAE1D,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,eAAe,EAAE,GAAG,KAAK;;IAG9C,IAAI,YAAY,GAAG,KAAK;IACxB,IAAI,kBAAkB,GAAG,KAAK;AAE9B;;;;;AAKG;AACH,IAAA,KAAK,MAAM,GAAG,IAAI,YAAY,EAAE;AAC5B,QAAA,MAAM,KAAK,GAAG,YAAY,CAAC,GAAG,CAAC;AAE/B,QAAA,IAAI,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;;YAEzB,YAAY,GAAG,IAAI;YACnB;QACJ;AAAO,aAAA,IAAI,iBAAiB,CAAC,GAAG,CAAC,EAAE;AAC/B,YAAA,IAAI,CAAC,GAAG,CAAC,GAAG,KAAK;YACjB;QACJ;aAAO;;YAEH,MAAM,WAAW,GAAG,cAAc,CAAC,KAAK,EAAE,gBAAgB,CAAC,GAAG,CAAC,CAAC;AAEhE,YAAA,IAAI,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE;;gBAE1B,kBAAkB,GAAG,IAAI;gBACzB,eAAe,CAAC,GAAmC,CAAC;AAChD,oBAAA,WAAW;YACnB;iBAAO;AACH,gBAAA,KAAK,CAAC,GAAG,CAAC,GAAG,WAAW;YAC5B;QACJ;IACJ;AAEA,IAAA,IAAI,CAAC,YAAY,CAAC,SAAS,EAAE;AACzB,QAAA,IAAI,YAAY,IAAI,iBAAiB,EAAE;AACnC,YAAA,KAAK,CAAC,SAAS,GAAG,cAAc,CAC5B,YAAY,EACZ,KAAK,CAAC,SAAS,EACf,iBAAiB,CACpB;QACL;AAAO,aAAA,IAAI,KAAK,CAAC,SAAS,EAAE;AACxB;;;AAGG;AACH,YAAA,KAAK,CAAC,SAAS,GAAG,MAAM;QAC5B;IACJ;AAEA;;;AAGG;IACH,IAAI,kBAAkB,EAAE;AACpB,QAAA,MAAM,EACF,OAAO,GAAG,KAAK,EACf,OAAO,GAAG,KAAK,EACf,OAAO,GAAG,CAAC,GACd,GAAG,eAAe;QACnB,KAAK,CAAC,eAAe,GAAG,CAAA,EAAG,OAAO,IAAI,OAAO,CAAA,CAAA,EAAI,OAAO,CAAA,CAAE;IAC9D;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/html/utils/build-transform.mjs b/node_modules/motion-dom/dist/es/render/html/utils/build-transform.mjs new file mode 100644 index 0000000..30f8a57 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/html/utils/build-transform.mjs @@ -0,0 +1,72 @@ +import { getValueAsType } from '../../../value/types/utils/get-as-type.mjs'; +import { numberValueTypes } from '../../../value/types/maps/number.mjs'; +import { transformPropOrder } from '../../utils/keys-transform.mjs'; + +const translateAlias = { + x: "translateX", + y: "translateY", + z: "translateZ", + transformPerspective: "perspective", +}; +const numTransforms = transformPropOrder.length; +/** + * Build a CSS transform style from individual x/y/scale etc properties. + * + * This outputs with a default order of transforms/scales/rotations, this can be customised by + * providing a transformTemplate function. + */ +function buildTransform(latestValues, transform, transformTemplate) { + // The transform string we're going to build into. + let transformString = ""; + let transformIsDefault = true; + /** + * Loop over all possible transforms in order, adding the ones that + * are present to the transform string. + */ + for (let i = 0; i < numTransforms; i++) { + const key = transformPropOrder[i]; + const value = latestValues[key]; + if (value === undefined) + continue; + let valueIsDefault = true; + if (typeof value === "number") { + valueIsDefault = value === (key.startsWith("scale") ? 1 : 0); + } + else { + const parsed = parseFloat(value); + valueIsDefault = key.startsWith("scale") ? parsed === 1 : parsed === 0; + } + if (!valueIsDefault || transformTemplate) { + const valueAsType = getValueAsType(value, numberValueTypes[key]); + if (!valueIsDefault) { + transformIsDefault = false; + const transformName = translateAlias[key] || key; + transformString += `${transformName}(${valueAsType}) `; + } + if (transformTemplate) { + transform[key] = valueAsType; + } + } + } + // `pathRotation` composes onto `rotate` as a separate additive term so + // the user's `rotate` is never clobbered. Deliberately not a slot in + // `transformPropOrder`. + const pathRotation = latestValues.pathRotation; + if (pathRotation) { + transformIsDefault = false; + transformString += `rotate(${getValueAsType(pathRotation, numberValueTypes.pathRotation)}) `; + } + transformString = transformString.trim(); + // If we have a custom `transform` template, pass our transform values and + // generated transformString to that before returning + if (transformTemplate) { + transformString = transformTemplate(transform, transformIsDefault ? "" : transformString); + } + else if (transformIsDefault) { + transformString = "none"; + } + return transformString; +} + +export { buildTransform }; +//# sourceMappingURL=build-transform.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/html/utils/build-transform.mjs.map b/node_modules/motion-dom/dist/es/render/html/utils/build-transform.mjs.map new file mode 100644 index 0000000..fe879d2 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/html/utils/build-transform.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"build-transform.mjs","sources":["../../../../../src/render/html/utils/build-transform.ts"],"sourcesContent":["import { getValueAsType } from \"../../../value/types/utils/get-as-type\"\nimport { numberValueTypes } from \"../../../value/types/maps/number\"\nimport { transformPropOrder } from \"../../utils/keys-transform\"\nimport { ResolvedValues } from \"../../types\"\nimport { HTMLRenderState } from \"../types\"\nimport type { MotionNodeOptions } from \"../../../node/types\"\n\nconst translateAlias = {\n x: \"translateX\",\n y: \"translateY\",\n z: \"translateZ\",\n transformPerspective: \"perspective\",\n}\n\nconst numTransforms = transformPropOrder.length\n\n/**\n * Build a CSS transform style from individual x/y/scale etc properties.\n *\n * This outputs with a default order of transforms/scales/rotations, this can be customised by\n * providing a transformTemplate function.\n */\nexport function buildTransform(\n latestValues: ResolvedValues,\n transform: HTMLRenderState[\"transform\"],\n transformTemplate?: MotionNodeOptions[\"transformTemplate\"]\n) {\n // The transform string we're going to build into.\n let transformString = \"\"\n let transformIsDefault = true\n\n /**\n * Loop over all possible transforms in order, adding the ones that\n * are present to the transform string.\n */\n for (let i = 0; i < numTransforms; i++) {\n const key = transformPropOrder[i] as keyof typeof translateAlias\n const value = latestValues[key]\n\n if (value === undefined) continue\n\n let valueIsDefault = true\n if (typeof value === \"number\") {\n valueIsDefault = value === (key.startsWith(\"scale\") ? 1 : 0)\n } else {\n const parsed = parseFloat(value)\n valueIsDefault = key.startsWith(\"scale\") ? parsed === 1 : parsed === 0\n }\n\n if (!valueIsDefault || transformTemplate) {\n const valueAsType = getValueAsType(value, numberValueTypes[key])\n\n if (!valueIsDefault) {\n transformIsDefault = false\n const transformName = translateAlias[key] || key\n transformString += `${transformName}(${valueAsType}) `\n }\n\n if (transformTemplate) {\n transform[key] = valueAsType\n }\n }\n }\n\n // `pathRotation` composes onto `rotate` as a separate additive term so\n // the user's `rotate` is never clobbered. Deliberately not a slot in\n // `transformPropOrder`.\n const pathRotation = latestValues.pathRotation\n if (pathRotation) {\n transformIsDefault = false\n transformString += `rotate(${getValueAsType(\n pathRotation,\n numberValueTypes.pathRotation\n )}) `\n }\n\n transformString = transformString.trim()\n\n // If we have a custom `transform` template, pass our transform values and\n // generated transformString to that before returning\n if (transformTemplate) {\n transformString = transformTemplate(\n transform,\n transformIsDefault ? \"\" : transformString\n )\n } else if (transformIsDefault) {\n transformString = \"none\"\n }\n\n return transformString\n}\n"],"names":[],"mappings":";;;;AAOA,MAAM,cAAc,GAAG;AACnB,IAAA,CAAC,EAAE,YAAY;AACf,IAAA,CAAC,EAAE,YAAY;AACf,IAAA,CAAC,EAAE,YAAY;AACf,IAAA,oBAAoB,EAAE,aAAa;CACtC;AAED,MAAM,aAAa,GAAG,kBAAkB,CAAC,MAAM;AAE/C;;;;;AAKG;SACa,cAAc,CAC1B,YAA4B,EAC5B,SAAuC,EACvC,iBAA0D,EAAA;;IAG1D,IAAI,eAAe,GAAG,EAAE;IACxB,IAAI,kBAAkB,GAAG,IAAI;AAE7B;;;AAGG;AACH,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,aAAa,EAAE,CAAC,EAAE,EAAE;AACpC,QAAA,MAAM,GAAG,GAAG,kBAAkB,CAAC,CAAC,CAAgC;AAChE,QAAA,MAAM,KAAK,GAAG,YAAY,CAAC,GAAG,CAAC;QAE/B,IAAI,KAAK,KAAK,SAAS;YAAE;QAEzB,IAAI,cAAc,GAAG,IAAI;AACzB,QAAA,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AAC3B,YAAA,cAAc,GAAG,KAAK,MAAM,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAChE;aAAO;AACH,YAAA,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK,CAAC;AAChC,YAAA,cAAc,GAAG,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,MAAM,KAAK,CAAC,GAAG,MAAM,KAAK,CAAC;QAC1E;AAEA,QAAA,IAAI,CAAC,cAAc,IAAI,iBAAiB,EAAE;YACtC,MAAM,WAAW,GAAG,cAAc,CAAC,KAAK,EAAE,gBAAgB,CAAC,GAAG,CAAC,CAAC;YAEhE,IAAI,CAAC,cAAc,EAAE;gBACjB,kBAAkB,GAAG,KAAK;gBAC1B,MAAM,aAAa,GAAG,cAAc,CAAC,GAAG,CAAC,IAAI,GAAG;AAChD,gBAAA,eAAe,IAAI,CAAA,EAAG,aAAa,CAAA,CAAA,EAAI,WAAW,IAAI;YAC1D;YAEA,IAAI,iBAAiB,EAAE;AACnB,gBAAA,SAAS,CAAC,GAAG,CAAC,GAAG,WAAW;YAChC;QACJ;IACJ;;;;AAKA,IAAA,MAAM,YAAY,GAAG,YAAY,CAAC,YAAY;IAC9C,IAAI,YAAY,EAAE;QACd,kBAAkB,GAAG,KAAK;QAC1B,eAAe,IAAI,CAAA,OAAA,EAAU,cAAc,CACvC,YAAY,EACZ,gBAAgB,CAAC,YAAY,CAChC,CAAA,EAAA,CAAI;IACT;AAEA,IAAA,eAAe,GAAG,eAAe,CAAC,IAAI,EAAE;;;IAIxC,IAAI,iBAAiB,EAAE;AACnB,QAAA,eAAe,GAAG,iBAAiB,CAC/B,SAAS,EACT,kBAAkB,GAAG,EAAE,GAAG,eAAe,CAC5C;IACL;SAAO,IAAI,kBAAkB,EAAE;QAC3B,eAAe,GAAG,MAAM;IAC5B;AAEA,IAAA,OAAO,eAAe;AAC1B;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/html/utils/render.mjs b/node_modules/motion-dom/dist/es/render/html/utils/render.mjs new file mode 100644 index 0000000..d5e5241 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/html/utils/render.mjs @@ -0,0 +1,18 @@ +function renderHTML(element, { style, vars }, styleProp, projection) { + const elementStyle = element.style; + let key; + for (key in style) { + // CSSStyleDeclaration has [index: number]: string; in the types, so we use that as key type. + elementStyle[key] = style[key]; + } + // Write projection styles directly to element style + projection?.applyProjectionStyles(elementStyle, styleProp); + for (key in vars) { + // Loop over any CSS variables and assign those. + // They can only be assigned using `setProperty`. + elementStyle.setProperty(key, vars[key]); + } +} + +export { renderHTML }; +//# sourceMappingURL=render.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/html/utils/render.mjs.map b/node_modules/motion-dom/dist/es/render/html/utils/render.mjs.map new file mode 100644 index 0000000..c825249 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/html/utils/render.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"render.mjs","sources":["../../../../../src/render/html/utils/render.ts"],"sourcesContent":["import type { MotionStyle } from \"../../VisualElement\"\nimport { HTMLRenderState } from \"../types\"\n\nexport function renderHTML(\n element: HTMLElement,\n { style, vars }: HTMLRenderState,\n styleProp?: MotionStyle,\n projection?: any\n) {\n const elementStyle = element.style\n\n let key: string\n for (key in style) {\n // CSSStyleDeclaration has [index: number]: string; in the types, so we use that as key type.\n elementStyle[key as unknown as number] = style[key] as string\n }\n\n // Write projection styles directly to element style\n projection?.applyProjectionStyles(elementStyle, styleProp)\n\n for (key in vars) {\n // Loop over any CSS variables and assign those.\n // They can only be assigned using `setProperty`.\n elementStyle.setProperty(key, vars[key] as string)\n }\n}\n"],"names":[],"mappings":"AAGM,SAAU,UAAU,CACtB,OAAoB,EACpB,EAAE,KAAK,EAAE,IAAI,EAAmB,EAChC,SAAuB,EACvB,UAAgB,EAAA;AAEhB,IAAA,MAAM,YAAY,GAAG,OAAO,CAAC,KAAK;AAElC,IAAA,IAAI,GAAW;AACf,IAAA,KAAK,GAAG,IAAI,KAAK,EAAE;;QAEf,YAAY,CAAC,GAAwB,CAAC,GAAG,KAAK,CAAC,GAAG,CAAW;IACjE;;AAGA,IAAA,UAAU,EAAE,qBAAqB,CAAC,YAAY,EAAE,SAAS,CAAC;AAE1D,IAAA,KAAK,GAAG,IAAI,IAAI,EAAE;;;QAGd,YAAY,CAAC,WAAW,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAW,CAAC;IACtD;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/html/utils/scrape-motion-values.mjs b/node_modules/motion-dom/dist/es/render/html/utils/scrape-motion-values.mjs new file mode 100644 index 0000000..fa40038 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/html/utils/scrape-motion-values.mjs @@ -0,0 +1,22 @@ +import { isMotionValue } from '../../../value/utils/is-motion-value.mjs'; +import { isForcedMotionValue } from '../../utils/is-forced-motion-value.mjs'; + +function scrapeMotionValuesFromProps(props, prevProps, visualElement) { + const style = props.style; + const prevStyle = prevProps?.style; + const newValues = {}; + if (!style) + return newValues; + for (const key in style) { + if (isMotionValue(style[key]) || + (prevStyle && isMotionValue(prevStyle[key])) || + isForcedMotionValue(key, props) || + visualElement?.getValue(key)?.liveStyle !== undefined) { + newValues[key] = style[key]; + } + } + return newValues; +} + +export { scrapeMotionValuesFromProps }; +//# sourceMappingURL=scrape-motion-values.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/html/utils/scrape-motion-values.mjs.map b/node_modules/motion-dom/dist/es/render/html/utils/scrape-motion-values.mjs.map new file mode 100644 index 0000000..e8a85c5 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/html/utils/scrape-motion-values.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"scrape-motion-values.mjs","sources":["../../../../../src/render/html/utils/scrape-motion-values.ts"],"sourcesContent":["import { isMotionValue } from \"../../../value/utils/is-motion-value\"\nimport type { MotionNodeOptions } from \"../../../node/types\"\nimport { isForcedMotionValue } from \"../../utils/is-forced-motion-value\"\nimport type { VisualElement } from \"../../VisualElement\"\n\nexport function scrapeMotionValuesFromProps(\n props: MotionNodeOptions,\n prevProps: MotionNodeOptions,\n visualElement?: VisualElement\n) {\n const style = (props as any).style\n const prevStyle = (prevProps as any)?.style\n const newValues: { [key: string]: any } = {}\n\n if (!style) return newValues\n\n for (const key in style) {\n if (\n isMotionValue(style[key]) ||\n (prevStyle && isMotionValue(prevStyle[key])) ||\n isForcedMotionValue(key, props) ||\n visualElement?.getValue(key)?.liveStyle !== undefined\n ) {\n newValues[key] = style[key]\n }\n }\n\n return newValues\n}\n"],"names":[],"mappings":";;;SAKgB,2BAA2B,CACvC,KAAwB,EACxB,SAA4B,EAC5B,aAA6B,EAAA;AAE7B,IAAA,MAAM,KAAK,GAAI,KAAa,CAAC,KAAK;AAClC,IAAA,MAAM,SAAS,GAAI,SAAiB,EAAE,KAAK;IAC3C,MAAM,SAAS,GAA2B,EAAE;AAE5C,IAAA,IAAI,CAAC,KAAK;AAAE,QAAA,OAAO,SAAS;AAE5B,IAAA,KAAK,MAAM,GAAG,IAAI,KAAK,EAAE;AACrB,QAAA,IACI,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;aACxB,SAAS,IAAI,aAAa,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;AAC5C,YAAA,mBAAmB,CAAC,GAAG,EAAE,KAAK,CAAC;YAC/B,aAAa,EAAE,QAAQ,CAAC,GAAG,CAAC,EAAE,SAAS,KAAK,SAAS,EACvD;YACE,SAAS,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC;QAC/B;IACJ;AAEA,IAAA,OAAO,SAAS;AACpB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/object/ObjectVisualElement.mjs b/node_modules/motion-dom/dist/es/render/object/ObjectVisualElement.mjs new file mode 100644 index 0000000..d2dedf7 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/object/ObjectVisualElement.mjs @@ -0,0 +1,42 @@ +import { createBox } from '../../projection/geometry/models.mjs'; +import { VisualElement } from '../VisualElement.mjs'; + +function isObjectKey(key, object) { + return key in object; +} +class ObjectVisualElement extends VisualElement { + constructor() { + super(...arguments); + this.type = "object"; + } + readValueFromInstance(instance, key) { + if (isObjectKey(key, instance)) { + const value = instance[key]; + if (typeof value === "string" || typeof value === "number") { + return value; + } + } + return undefined; + } + getBaseTargetFromProps() { + return undefined; + } + removeValueFromRenderState(key, renderState) { + delete renderState.output[key]; + } + measureInstanceViewportBox() { + return createBox(); + } + build(renderState, latestValues) { + Object.assign(renderState.output, latestValues); + } + renderInstance(instance, { output }) { + Object.assign(instance, output); + } + sortInstanceNodePosition() { + return 0; + } +} + +export { ObjectVisualElement }; +//# sourceMappingURL=ObjectVisualElement.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/object/ObjectVisualElement.mjs.map b/node_modules/motion-dom/dist/es/render/object/ObjectVisualElement.mjs.map new file mode 100644 index 0000000..8c1b18b --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/object/ObjectVisualElement.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"ObjectVisualElement.mjs","sources":["../../../../src/render/object/ObjectVisualElement.ts"],"sourcesContent":["import { createBox } from \"../../projection/geometry/models\"\nimport { ResolvedValues } from \"../types\"\nimport { VisualElement } from \"../VisualElement\"\n\ninterface ObjectRenderState {\n output: ResolvedValues\n}\n\nfunction isObjectKey(key: string, object: Object): key is keyof Object {\n return key in object\n}\n\nexport class ObjectVisualElement extends VisualElement<\n Object,\n ObjectRenderState\n> {\n type = \"object\"\n\n readValueFromInstance(instance: Object, key: string) {\n if (isObjectKey(key, instance)) {\n const value = instance[key]\n if (typeof value === \"string\" || typeof value === \"number\") {\n return value\n }\n }\n\n return undefined\n }\n\n getBaseTargetFromProps() {\n return undefined\n }\n\n removeValueFromRenderState(\n key: string,\n renderState: ObjectRenderState\n ): void {\n delete renderState.output[key]\n }\n\n measureInstanceViewportBox() {\n return createBox()\n }\n\n build(renderState: ObjectRenderState, latestValues: ResolvedValues) {\n Object.assign(renderState.output, latestValues)\n }\n\n renderInstance(instance: Object, { output }: ObjectRenderState) {\n Object.assign(instance, output)\n }\n\n sortInstanceNodePosition() {\n return 0\n }\n}\n"],"names":[],"mappings":";;;AAQA,SAAS,WAAW,CAAC,GAAW,EAAE,MAAc,EAAA;IAC5C,OAAO,GAAG,IAAI,MAAM;AACxB;AAEM,MAAO,mBAAoB,SAAQ,aAGxC,CAAA;AAHD,IAAA,WAAA,GAAA;;QAII,IAAA,CAAA,IAAI,GAAG,QAAQ;IAuCnB;IArCI,qBAAqB,CAAC,QAAgB,EAAE,GAAW,EAAA;AAC/C,QAAA,IAAI,WAAW,CAAC,GAAG,EAAE,QAAQ,CAAC,EAAE;AAC5B,YAAA,MAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC;YAC3B,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AACxD,gBAAA,OAAO,KAAK;YAChB;QACJ;AAEA,QAAA,OAAO,SAAS;IACpB;IAEA,sBAAsB,GAAA;AAClB,QAAA,OAAO,SAAS;IACpB;IAEA,0BAA0B,CACtB,GAAW,EACX,WAA8B,EAAA;AAE9B,QAAA,OAAO,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC;IAClC;IAEA,0BAA0B,GAAA;QACtB,OAAO,SAAS,EAAE;IACtB;IAEA,KAAK,CAAC,WAA8B,EAAE,YAA4B,EAAA;QAC9D,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,YAAY,CAAC;IACnD;AAEA,IAAA,cAAc,CAAC,QAAgB,EAAE,EAAE,MAAM,EAAqB,EAAA;AAC1D,QAAA,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC;IACnC;IAEA,wBAAwB,GAAA;AACpB,QAAA,OAAO,CAAC;IACZ;AACH;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/store.mjs b/node_modules/motion-dom/dist/es/render/store.mjs new file mode 100644 index 0000000..9a65634 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/store.mjs @@ -0,0 +1,4 @@ +const visualElementStore = new WeakMap(); + +export { visualElementStore }; +//# sourceMappingURL=store.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/store.mjs.map b/node_modules/motion-dom/dist/es/render/store.mjs.map new file mode 100644 index 0000000..cad62f9 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/store.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"store.mjs","sources":["../../../src/render/store.ts"],"sourcesContent":["import type { VisualElement } from \"./VisualElement\"\n\nexport const visualElementStore = new WeakMap()\n"],"names":[],"mappings":"AAEO,MAAM,kBAAkB,GAAG,IAAI,OAAO;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/svg/SVGVisualElement.mjs b/node_modules/motion-dom/dist/es/render/svg/SVGVisualElement.mjs new file mode 100644 index 0000000..d219a07 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/svg/SVGVisualElement.mjs @@ -0,0 +1,52 @@ +import { transformProps } from '../utils/keys-transform.mjs'; +import { getDefaultValueType } from '../../value/types/maps/defaults.mjs'; +import { createBox } from '../../projection/geometry/models.mjs'; +import { DOMVisualElement } from '../dom/DOMVisualElement.mjs'; +import { camelToDash } from '../dom/utils/camel-to-dash.mjs'; +import { cssStyleProperties, buildSVGAttrs } from './utils/build-attrs.mjs'; +import { camelCaseAttributes } from './utils/camel-case-attrs.mjs'; +import { isSVGTag } from './utils/is-svg-tag.mjs'; +import { renderSVG } from './utils/render.mjs'; +import { scrapeMotionValuesFromProps } from './utils/scrape-motion-values.mjs'; + +class SVGVisualElement extends DOMVisualElement { + constructor() { + super(...arguments); + this.type = "svg"; + this.isSVGTag = false; + this.measureInstanceViewportBox = createBox; + } + getBaseTargetFromProps(props, key) { + return props[key]; + } + readValueFromInstance(instance, key) { + if (transformProps.has(key)) { + const defaultType = getDefaultValueType(key); + return defaultType ? defaultType.default || 0 : 0; + } + if (cssStyleProperties.includes(key)) { + const computedStyle = getComputedStyle(instance); + const value = computedStyle[key]; + if (typeof value === "string" && value) + return value.trim(); + } + key = !camelCaseAttributes.has(key) ? camelToDash(key) : key; + return instance.getAttribute(key); + } + scrapeMotionValuesFromProps(props, prevProps, visualElement) { + return scrapeMotionValuesFromProps(props, prevProps, visualElement); + } + build(renderState, latestValues, props) { + buildSVGAttrs(renderState, latestValues, this.isSVGTag, props.transformTemplate, props.style); + } + renderInstance(instance, renderState, styleProp, projection) { + renderSVG(instance, renderState, styleProp, projection); + } + mount(instance) { + this.isSVGTag = isSVGTag(instance.tagName); + super.mount(instance); + } +} + +export { SVGVisualElement }; +//# sourceMappingURL=SVGVisualElement.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/svg/SVGVisualElement.mjs.map b/node_modules/motion-dom/dist/es/render/svg/SVGVisualElement.mjs.map new file mode 100644 index 0000000..1f43cbc --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/svg/SVGVisualElement.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"SVGVisualElement.mjs","sources":["../../../../src/render/svg/SVGVisualElement.ts"],"sourcesContent":["import type { AnyResolvedKeyframe } from \"../../animation/types\"\nimport type { MotionValue } from \"../../value\"\nimport type { MotionNodeOptions } from \"../../node/types\"\nimport { transformProps } from \"../utils/keys-transform\"\nimport { getDefaultValueType } from \"../../value/types/maps/defaults\"\nimport { createBox } from \"../../projection/geometry/models\"\nimport { DOMVisualElement } from \"../dom/DOMVisualElement\"\nimport type { DOMVisualElementOptions } from \"../dom/types\"\nimport { camelToDash } from \"../dom/utils/camel-to-dash\"\nimport type { ResolvedValues } from \"../types\"\nimport type { VisualElement, MotionStyle } from \"../VisualElement\"\nimport { SVGRenderState } from \"./types\"\nimport { buildSVGAttrs, cssStyleProperties } from \"./utils/build-attrs\"\nimport { camelCaseAttributes } from \"./utils/camel-case-attrs\"\nimport { isSVGTag } from \"./utils/is-svg-tag\"\nimport { renderSVG } from \"./utils/render\"\nimport { scrapeMotionValuesFromProps } from \"./utils/scrape-motion-values\"\nexport class SVGVisualElement extends DOMVisualElement<\n SVGElement,\n SVGRenderState,\n DOMVisualElementOptions\n> {\n type = \"svg\"\n\n isSVGTag = false\n\n getBaseTargetFromProps(\n props: MotionNodeOptions,\n key: string\n ): AnyResolvedKeyframe | MotionValue | undefined {\n return props[key as keyof MotionNodeOptions]\n }\n\n readValueFromInstance(instance: SVGElement, key: string) {\n if (transformProps.has(key)) {\n const defaultType = getDefaultValueType(key)\n return defaultType ? defaultType.default || 0 : 0\n }\n\n if (cssStyleProperties.includes(key)) {\n const computedStyle = getComputedStyle(instance)\n const value = computedStyle[key as keyof typeof computedStyle]\n if (typeof value === \"string\" && value) return value.trim()\n }\n\n key = !camelCaseAttributes.has(key) ? camelToDash(key) : key\n return instance.getAttribute(key)\n }\n\n measureInstanceViewportBox = createBox\n\n scrapeMotionValuesFromProps(\n props: MotionNodeOptions,\n prevProps: MotionNodeOptions,\n visualElement: VisualElement\n ) {\n return scrapeMotionValuesFromProps(props, prevProps, visualElement)\n }\n\n build(\n renderState: SVGRenderState,\n latestValues: ResolvedValues,\n props: MotionNodeOptions\n ) {\n buildSVGAttrs(\n renderState,\n latestValues,\n this.isSVGTag,\n props.transformTemplate,\n (props as any).style\n )\n }\n\n renderInstance(\n instance: SVGElement,\n renderState: SVGRenderState,\n styleProp?: MotionStyle | undefined,\n projection?: any\n ): void {\n renderSVG(instance, renderState, styleProp, projection)\n }\n\n mount(instance: SVGElement) {\n this.isSVGTag = isSVGTag(instance.tagName)\n super.mount(instance)\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAiBM,MAAO,gBAAiB,SAAQ,gBAIrC,CAAA;AAJD,IAAA,WAAA,GAAA;;QAKI,IAAA,CAAA,IAAI,GAAG,KAAK;QAEZ,IAAA,CAAA,QAAQ,GAAG,KAAK;QAyBhB,IAAA,CAAA,0BAA0B,GAAG,SAAS;IAqC1C;IA5DI,sBAAsB,CAClB,KAAwB,EACxB,GAAW,EAAA;AAEX,QAAA,OAAO,KAAK,CAAC,GAA8B,CAAC;IAChD;IAEA,qBAAqB,CAAC,QAAoB,EAAE,GAAW,EA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OAAO,CAAC;AAC1C,QAAA,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC;IACzB;AACH;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/svg/utils/build-attrs.mjs b/node_modules/motion-dom/dist/es/render/svg/utils/build-attrs.mjs new file mode 100644 index 0000000..de2891a --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/svg/utils/build-attrs.mjs @@ -0,0 +1,64 @@ +import { buildHTMLStyles } from '../../html/utils/build-styles.mjs'; +import { buildSVGPath } from './path.mjs'; + +const cssStyleProperties = [ + "transform", + "opacity", + "offsetDistance", + "offsetPath", + "offsetRotate", + "offsetAnchor", +]; +/** + * Build SVG visual attributes, like cx and style.transform + */ +function buildSVGAttrs(state, { attrX, attrY, attrScale, pathLength, pathSpacing = 1, pathOffset = 0, +// This is object creation, which we try to avoid per-frame. +...latest }, isSVGTag, transformTemplate, styleProp) { + buildHTMLStyles(state, latest, transformTemplate); + /** + * For svg tags we just want to make sure viewBox is animatable and treat all the styles + * as normal HTML tags. + */ + if (isSVGTag) { + if (state.style.viewBox) { + state.attrs.viewBox = state.style.viewBox; + } + return; + } + state.attrs = state.style; + state.style = {}; + const { attrs, style } = state; + for (const key of cssStyleProperties) { + if (attrs[key] !== undefined) { + style[key] = attrs[key]; + delete attrs[key]; + } + } + if (style.transform || attrs.transformOrigin) { + style.transformOrigin = attrs.transformOrigin ?? "50% 50%"; + delete attrs.transformOrigin; + } + if (style.transform) { + /** + * SVG's element transform-origin uses its own median as a reference. + * Therefore, transformBox becomes a fill-box + */ + style.transformBox = styleProp?.transformBox ?? "fill-box"; + delete attrs.transformBox; + } + // Render attrX/attrY/attrScale as attributes + if (attrX !== undefined) + attrs.x = attrX; + if (attrY !== undefined) + attrs.y = attrY; + if (attrScale !== undefined) + attrs.scale = attrScale; + // Build SVG path if one has been defined + if (pathLength !== undefined) { + buildSVGPath(attrs, pathLength, pathSpacing, pathOffset, false); + } +} + +export { buildSVGAttrs, cssStyleProperties }; +//# sourceMappingURL=build-attrs.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/svg/utils/build-attrs.mjs.map b/node_modules/motion-dom/dist/es/render/svg/utils/build-attrs.mjs.map new file mode 100644 index 0000000..d186868 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/svg/utils/build-attrs.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"build-attrs.mjs","sources":["../../../../../src/render/svg/utils/build-attrs.ts"],"sourcesContent":["import type { MotionNodeOptions } from \"../../../node/types\"\nimport { buildHTMLStyles } from \"../../html/utils/build-styles\"\nimport { ResolvedValues } from \"../../types\"\nimport { SVGRenderState } from \"../types\"\nimport { buildSVGPath } from \"./path\"\n\nexport const cssStyleProperties = [\n \"transform\",\n \"opacity\",\n \"offsetDistance\",\n \"offsetPath\",\n \"offsetRotate\",\n \"offsetAnchor\",\n]\n\n/**\n * Build SVG visual attributes, like cx and style.transform\n */\nexport function buildSVGAttrs(\n state: SVGRenderState,\n {\n attrX,\n attrY,\n attrScale,\n pathLength,\n pathSpacing = 1,\n pathOffset = 0,\n // This is object creation, which we try to avoid per-frame.\n ...latest\n }: ResolvedValues,\n isSVGTag: boolean,\n transformTemplate?: MotionNodeOptions[\"transformTemplate\"],\n styleProp?: Record\n) {\n buildHTMLStyles(state, latest, transformTemplate)\n\n /**\n * For svg tags we just want to make sure viewBox is animatable and treat all the styles\n * as normal HTML tags.\n */\n if (isSVGTag) {\n if (state.style.viewBox) {\n state.attrs.viewBox = state.style.viewBox\n }\n return\n }\n\n state.attrs = state.style\n state.style = {}\n const { attrs, style } = state\n\n for (const key of cssStyleProperties) {\n if (attrs[key] !== undefined) {\n style[key] = attrs[key]\n delete attrs[key]\n }\n }\n\n if (style.transform || attrs.transformOrigin) {\n style.transformOrigin = attrs.transformOrigin ?? \"50% 50%\"\n delete attrs.transformOrigin\n }\n\n if (style.transform) {\n /**\n * SVG's element transform-origin uses its own median as a reference.\n * Therefore, transformBox becomes a fill-box\n */\n style.transformBox = (styleProp?.transformBox as string) ?? \"fill-box\"\n delete attrs.transformBox\n }\n\n // Render attrX/attrY/attrScale as attributes\n if (attrX !== undefined) attrs.x = attrX\n if (attrY !== undefined) attrs.y = attrY\n if (attrScale !== undefined) attrs.scale = attrScale\n\n // Build SVG path if one has been defined\n if (pathLength !== undefined) {\n buildSVGPath(\n attrs,\n pathLength as number,\n pathSpacing as number,\n pathOffset as number,\n false\n )\n }\n}\n"],"names":[],"mappings":";;;AAMO,MAAM,kBAAkB,GAAG;IAC9B,WAAW;IACX,SAAS;IACT,gBAAgB;IAChB,YAAY;IACZ,cAAc;IACd,cAAc;;AAGlB;;AAEG;AACG,SAAU,aAAa,CACzB,KAAqB,EACrB,EACI,KAAK,EACL,KAAK,EACL,SAAS,EACT,UAAU,EACV,WAAW,GAAG,CAAC,EACf,UAAU,GAAG,CAAC;AACd;AACA,GAAG,MAAM,EACI,EACjB,QAAiB,EACjB,iBAA0D,EAC1D,SAA+B,EAAA;AAE/B,IAAA,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,iBAAiB,CAAC;AAEjD;;;AAGG;IACH,IAAI,QAAQ,EAAE;AACV,QAAA,IAAI,KAAK,CAAC,KAAK,CAAC,OAAO,EAAE;YACrB,KAAK,CAAC,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,OAAO;QAC7C;QACA;IACJ;AAEA,IAAA,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK;AACzB,IAAA,KAAK,CAAC,KAAK,GAAG,EAAE;AAChB,IAAA,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,KAAK;AAE9B,IAAA,KAAK,MAAM,GAAG,IAAI,kBAAkB,EAAE;AAClC,QAAA,IAAI,KAAK,CAAC,GAAG,CAAC,KAAK,SAAS,EAAE;YAC1B,KAAK,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC;AACvB,YAAA,OAAO,KAAK,CAAC,GAAG,CAAC;QACrB;IACJ;IAEA,IAAI,KAAK,CAAC,SAAS,IAAI,KAAK,CAAC,eAAe,EAAE;QAC1C,KAAK,CAAC,eAAe,GAAG,KAAK,CAAC,eAAe,IAAI,SAAS;QAC1D,OAAO,KAAK,CAAC,eAAe;IAChC;AAEA,IAAA,IAAI,KAAK,CAAC,SAAS,EAAE;AACjB;;;AAGG;QACH,KAAK,CAAC,YAAY,GAAI,SAAS,EAAE,YAAuB,IAAI,UAAU;QACtE,OAAO,KAAK,CAAC,YAAY;IAC7B;;IAGA,IAAI,KAAK,KAAK,SAAS;AAAE,QAAA,KAAK,CAAC,CAAC,GAAG,KAAK;IACxC,IAAI,KAAK,KAAK,SAAS;AAAE,QAAA,KAAK,CAAC,CAAC,GAAG,KAAK;IACxC,IAAI,SAAS,KAAK,SAAS;AAAE,QAAA,KAAK,CAAC,KAAK,GAAG,SAAS;;AAGpD,IAAA,IAAI,UAAU,KAAK,SAAS,EAAE;QAC1B,YAAY,CACR,KAAK,EACL,UAAoB,EACpB,WAAqB,EACrB,UAAoB,EACpB,KAAK,CACR;IACL;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/svg/utils/camel-case-attrs.mjs b/node_modules/motion-dom/dist/es/render/svg/utils/camel-case-attrs.mjs new file mode 100644 index 0000000..4885a9b --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/svg/utils/camel-case-attrs.mjs @@ -0,0 +1,31 @@ +/** + * A set of attribute names that are always read/written as camel case. + */ +const camelCaseAttributes = new Set([ + "baseFrequency", + "diffuseConstant", + "kernelMatrix", + "kernelUnitLength", + "keySplines", + "keyTimes", + "limitingConeAngle", + "markerHeight", + "markerWidth", + "numOctaves", + "targetX", + "targetY", + "surfaceScale", + "specularConstant", + "specularExponent", + "stdDeviation", + "tableValues", + "viewBox", + "gradientTransform", + "pathLength", + "startOffset", + "textLength", + "lengthAdjust", +]); + +export { camelCaseAttributes }; +//# sourceMappingURL=camel-case-attrs.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/svg/utils/camel-case-attrs.mjs.map b/node_modules/motion-dom/dist/es/render/svg/utils/camel-case-attrs.mjs.map new file mode 100644 index 0000000..7ca6fe3 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/svg/utils/camel-case-attrs.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"camel-case-attrs.mjs","sources":["../../../../../src/render/svg/utils/camel-case-attrs.ts"],"sourcesContent":["/**\n * A set of attribute names that are always read/written as camel case.\n */\nexport const camelCaseAttributes = new Set([\n \"baseFrequency\",\n \"diffuseConstant\",\n \"kernelMatrix\",\n \"kernelUnitLength\",\n \"keySplines\",\n \"keyTimes\",\n \"limitingConeAngle\",\n \"markerHeight\",\n \"markerWidth\",\n \"numOctaves\",\n \"targetX\",\n \"targetY\",\n \"surfaceScale\",\n \"specularConstant\",\n \"specularExponent\",\n \"stdDeviation\",\n \"tableValues\",\n \"viewBox\",\n \"gradientTransform\",\n \"pathLength\",\n \"startOffset\",\n \"textLength\",\n \"lengthAdjust\",\n])\n"],"names":[],"mappings":"AAAA;;AAEG;AACI,MAAM,mBAAmB,GAAG,IAAI,GAAG,CAAC;IACvC,eAAe;IACf,iBAAiB;IACjB,cAAc;IACd,kBAAkB;IAClB,YAAY;IACZ,UAAU;IACV,mBAAmB;IACnB,cAAc;IACd,aAAa;IACb,YAAY;IACZ,SAAS;IACT,SAAS;IACT,cAAc;IACd,kBAAkB;IAClB,kBAAkB;IAClB,cAAc;IACd,aAAa;IACb,SAAS;IACT,mBAAmB;IACnB,YAAY;IACZ,aAAa;IACb,YAAY;IACZ,cAAc;AACjB,CAAA;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/svg/utils/is-svg-tag.mjs b/node_modules/motion-dom/dist/es/render/svg/utils/is-svg-tag.mjs new file mode 100644 index 0000000..37ab448 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/svg/utils/is-svg-tag.mjs @@ -0,0 +1,4 @@ +const isSVGTag = (tag) => typeof tag === "string" && tag.toLowerCase() === "svg"; + +export { isSVGTag }; +//# sourceMappingURL=is-svg-tag.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/svg/utils/is-svg-tag.mjs.map b/node_modules/motion-dom/dist/es/render/svg/utils/is-svg-tag.mjs.map new file mode 100644 index 0000000..ce8c3ac --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/svg/utils/is-svg-tag.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"is-svg-tag.mjs","sources":["../../../../../src/render/svg/utils/is-svg-tag.ts"],"sourcesContent":["export const isSVGTag = (tag: unknown) =>\n typeof tag === \"string\" && tag.toLowerCase() === \"svg\"\n"],"names":[],"mappings":"MAAa,QAAQ,GAAG,CAAC,GAAY,KACjC,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,CAAC,WAAW,EAAE,KAAK;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/svg/utils/path.mjs b/node_modules/motion-dom/dist/es/render/svg/utils/path.mjs new file mode 100644 index 0000000..02aff41 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/svg/utils/path.mjs @@ -0,0 +1,32 @@ +const dashKeys = { + offset: "stroke-dashoffset", + array: "stroke-dasharray", +}; +const camelKeys = { + offset: "strokeDashoffset", + array: "strokeDasharray", +}; +/** + * Build SVG path properties. Uses the path's measured length to convert + * our custom pathLength, pathSpacing and pathOffset into stroke-dashoffset + * and stroke-dasharray attributes. + * + * This function is mutative to reduce per-frame GC. + * + * Note: We use unitless values for stroke-dasharray and stroke-dashoffset + * because Safari incorrectly scales px values when the page is zoomed. + */ +function buildSVGPath(attrs, length, spacing = 1, offset = 0, useDashCase = true) { + // Normalise path length by setting SVG attribute pathLength to 1 + attrs.pathLength = 1; + // We use dash case when setting attributes directly to the DOM node and camel case + // when defining props on a React component. + const keys = useDashCase ? dashKeys : camelKeys; + // Build the dash offset (unitless to avoid Safari zoom bug) + attrs[keys.offset] = `${-offset}`; + // Build the dash array (unitless to avoid Safari zoom bug) + attrs[keys.array] = `${length} ${spacing}`; +} + +export { buildSVGPath }; +//# sourceMappingURL=path.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/svg/utils/path.mjs.map b/node_modules/motion-dom/dist/es/render/svg/utils/path.mjs.map new file mode 100644 index 0000000..8bf0885 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/svg/utils/path.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"path.mjs","sources":["../../../../../src/render/svg/utils/path.ts"],"sourcesContent":["import { ResolvedValues } from \"../../types\"\n\nconst dashKeys = {\n offset: \"stroke-dashoffset\",\n array: \"stroke-dasharray\",\n}\n\nconst camelKeys = {\n offset: \"strokeDashoffset\",\n array: \"strokeDasharray\",\n}\n\n/**\n * Build SVG path properties. Uses the path's measured length to convert\n * our custom pathLength, pathSpacing and pathOffset into stroke-dashoffset\n * and stroke-dasharray attributes.\n *\n * This function is mutative to reduce per-frame GC.\n *\n * Note: We use unitless values for stroke-dasharray and stroke-dashoffset\n * because Safari incorrectly scales px values when the page is zoomed.\n */\nexport function buildSVGPath(\n attrs: ResolvedValues,\n length: number,\n spacing = 1,\n offset = 0,\n useDashCase: boolean = true\n): void {\n // Normalise path length by setting SVG attribute pathLength to 1\n attrs.pathLength = 1\n\n // We use dash case when setting attributes directly to the DOM node and camel case\n // when defining props on a React component.\n const keys = useDashCase ? dashKeys : camelKeys\n\n // Build the dash offset (unitless to avoid Safari zoom bug)\n attrs[keys.offset] = `${-offset}`\n\n // Build the dash array (unitless to avoid Safari zoom bug)\n attrs[keys.array] = `${length} ${spacing}`\n}\n"],"names":[],"mappings":"AAEA,MAAM,QAAQ,GAAG;AACb,IAAA,MAAM,EAAE,mBAAmB;AAC3B,IAAA,KAAK,EAAE,kBAAkB;CAC5B;AAED,MAAM,SAAS,GAAG;AACd,IAAA,MAAM,EAAE,kBAAkB;AAC1B,IAAA,KAAK,EAAE,iBAAiB;CAC3B;AAED;;;;;;;;;AASG;SACa,YAAY,CACxB,KAAqB,EACrB,MAAc,EACd,OAAO,GAAG,CAAC,EACX,MAAM,GAAG,CAAC,EACV,cAAuB,IAAI,EAAA;;AAG3B,IAAA,KAAK,CAAC,UAAU,GAAG,CAAC;;;IAIpB,MAAM,IAAI,GAAG,WAAW,GAAG,QAAQ,GAAG,SAAS;;IAG/C,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAA,EAAG,CAAC,MAAM,CAAA,CAAE;;IAGjC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAA,EAAG,MAAM,CAAA,CAAA,EAAI,OAAO,CAAA,CAAE;AAC9C;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/svg/utils/render.mjs b/node_modules/motion-dom/dist/es/render/svg/utils/render.mjs new file mode 100644 index 0000000..8171361 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/svg/utils/render.mjs @@ -0,0 +1,13 @@ +import { camelToDash } from '../../dom/utils/camel-to-dash.mjs'; +import { renderHTML } from '../../html/utils/render.mjs'; +import { camelCaseAttributes } from './camel-case-attrs.mjs'; + +function renderSVG(element, renderState, _styleProp, projection) { + renderHTML(element, renderState, undefined, projection); + for (const key in renderState.attrs) { + element.setAttribute(!camelCaseAttributes.has(key) ? camelToDash(key) : key, renderState.attrs[key]); + } +} + +export { renderSVG }; +//# sourceMappingURL=render.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/svg/utils/render.mjs.map b/node_modules/motion-dom/dist/es/render/svg/utils/render.mjs.map new file mode 100644 index 0000000..8fcd12e --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/svg/utils/render.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"render.mjs","sources":["../../../../../src/render/svg/utils/render.ts"],"sourcesContent":["import type { MotionStyle } from \"../../VisualElement\"\nimport { camelToDash } from \"../../dom/utils/camel-to-dash\"\nimport { renderHTML } from \"../../html/utils/render\"\nimport { SVGRenderState } from \"../types\"\nimport { camelCaseAttributes } from \"./camel-case-attrs\"\n\nexport function renderSVG(\n element: SVGElement,\n renderState: SVGRenderState,\n _styleProp?: MotionStyle,\n projection?: any\n) {\n renderHTML(element as any, renderState, undefined, projection)\n\n for (const key in renderState.attrs) {\n element.setAttribute(\n !camelCaseAttributes.has(key) ? camelToDash(key) : key,\n renderState.attrs[key] as string\n )\n }\n}\n"],"names":[],"mappings":";;;;AAMM,SAAU,SAAS,CACrB,OAAmB,EACnB,WAA2B,EAC3B,UAAwB,EACxB,UAAgB,EAAA;IAEhB,UAAU,CAAC,OAAc,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,CAAC;AAE9D,IAAA,KAAK,MAAM,GAAG,IAAI,WAAW,CAAC,KAAK,EAAE;AACjC,QAAA,OAAO,CAAC,YAAY,CAChB,CAAC,mBAAmB,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC,GAAG,CAAC,GAAG,GAAG,EACtD,WAAW,CAAC,KAAK,CAAC,GAAG,CAAW,CACnC;IACL;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/svg/utils/scrape-motion-values.mjs b/node_modules/motion-dom/dist/es/render/svg/utils/scrape-motion-values.mjs new file mode 100644 index 0000000..9c83e3d --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/svg/utils/scrape-motion-values.mjs @@ -0,0 +1,20 @@ +import { isMotionValue } from '../../../value/utils/is-motion-value.mjs'; +import { transformPropOrder } from '../../utils/keys-transform.mjs'; +import { scrapeMotionValuesFromProps as scrapeMotionValuesFromProps$1 } from '../../html/utils/scrape-motion-values.mjs'; + +function scrapeMotionValuesFromProps(props, prevProps, visualElement) { + const newValues = scrapeMotionValuesFromProps$1(props, prevProps, visualElement); + for (const key in props) { + if (isMotionValue(props[key]) || + isMotionValue(prevProps[key])) { + const targetKey = transformPropOrder.indexOf(key) !== -1 + ? "attr" + key.charAt(0).toUpperCase() + key.substring(1) + : key; + newValues[targetKey] = props[key]; + } + } + return newValues; +} + +export { scrapeMotionValuesFromProps }; +//# sourceMappingURL=scrape-motion-values.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/svg/utils/scrape-motion-values.mjs.map b/node_modules/motion-dom/dist/es/render/svg/utils/scrape-motion-values.mjs.map new file mode 100644 index 0000000..70be008 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/svg/utils/scrape-motion-values.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"scrape-motion-values.mjs","sources":["../../../../../src/render/svg/utils/scrape-motion-values.ts"],"sourcesContent":["import { isMotionValue } from \"../../../value/utils/is-motion-value\"\nimport type { MotionNodeOptions } from \"../../../node/types\"\nimport { transformPropOrder } from \"../../utils/keys-transform\"\nimport { scrapeMotionValuesFromProps as scrapeHTMLMotionValuesFromProps } from \"../../html/utils/scrape-motion-values\"\nimport type { VisualElement } from \"../../VisualElement\"\n\nexport function scrapeMotionValuesFromProps(\n props: MotionNodeOptions,\n prevProps: MotionNodeOptions,\n visualElement?: VisualElement\n) {\n const newValues = scrapeHTMLMotionValuesFromProps(\n props,\n prevProps,\n visualElement\n )\n\n for (const key in props) {\n if (\n isMotionValue(props[key as keyof typeof props]) ||\n isMotionValue(prevProps[key as keyof typeof prevProps])\n ) {\n const targetKey =\n transformPropOrder.indexOf(key) !== -1\n ? \"attr\" + key.charAt(0).toUpperCase() + key.substring(1)\n : key\n\n newValues[targetKey] = props[key as keyof typeof props]\n }\n }\n\n return newValues\n}\n"],"names":["scrapeHTMLMotionValuesFromProps"],"mappings":";;;;SAMgB,2BAA2B,CACvC,KAAwB,EACxB,SAA4B,EAC5B,aAA6B,EAAA;IAE7B,MAAM,SAAS,GAAGA,6BAA+B,CAC7C,KAAK,EACL,SAAS,EACT,aAAa,CAChB;AAED,IAAA,KAAK,MAAM,GAAG,IAAI,KAAK,EAAE;AACrB,QAAA,IACI,aAAa,CAAC,KAAK,CAAC,GAAyB,CAAC,CAAC;AAC/C,YAAA,aAAa,CAAC,SAAS,CAAC,GAA6B,CAAC,CAAC,EACzD;YACE,MAAM,SAAS,GACX,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK;AAChC,kBAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,SAAS,CAAC,CAAC;kBACtD,GAAG;YAEb,SAAS,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC,GAAyB,CAAC;QAC3D;IACJ;AAEA,IAAA,OAAO,SAAS;AACpB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/utils/animation-state.mjs b/node_modules/motion-dom/dist/es/render/utils/animation-state.mjs new file mode 100644 index 0000000..9d7b206 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/utils/animation-state.mjs @@ -0,0 +1,387 @@ +import { animateVisualElement } from '../../animation/interfaces/visual-element.mjs'; +import { calcChildStagger } from '../../animation/utils/calc-child-stagger.mjs'; +import { getVariantContext } from './get-variant-context.mjs'; +import { isAnimationControls } from './is-animation-controls.mjs'; +import { isKeyframesTarget } from './is-keyframes-target.mjs'; +import { isVariantLabel } from './is-variant-label.mjs'; +import { resolveVariant } from './resolve-dynamic-variants.mjs'; +import { shallowCompare } from './shallow-compare.mjs'; +import { variantPriorityOrder } from './variant-props.mjs'; + +const reversePriorityOrder = [...variantPriorityOrder].reverse(); +const numAnimationTypes = variantPriorityOrder.length; +function createAnimateFunction(visualElement) { + return (animations) => { + return Promise.all(animations.map(({ animation, options }) => animateVisualElement(visualElement, animation, options))); + }; +} +function createAnimationState(visualElement) { + let animate = createAnimateFunction(visualElement); + let state = createState(); + let isInitialRender = true; + /** + * Track whether the animation state has been reset (e.g. via StrictMode + * double-invocation or Suspense unmount/remount). On the first + * animateChanges() call after a reset we need to behave like the initial + * render for variant-inheritance checks, even though isInitialRender is + * already false. + */ + let wasReset = false; + /** + * This function will be used to reduce the animation definitions for + * each active animation type into an object of resolved values for it. + */ + const buildResolvedTypeValues = (type) => (acc, definition) => { + const resolved = resolveVariant(visualElement, definition, type === "exit" + ? visualElement.presenceContext?.custom + : undefined); + if (resolved) { + const { transition, transitionEnd, ...target } = resolved; + acc = { ...acc, ...target, ...transitionEnd }; + } + return acc; + }; + /** + * This just allows us to inject mocked animation functions + * @internal + */ + function setAnimateFunction(makeAnimator) { + animate = makeAnimator(visualElement); + } + /** + * When we receive new props, we need to: + * 1. Create a list of protected keys for each type. This is a directory of + * value keys that are currently being "handled" by types of a higher priority + * so that whenever an animation is played of a given type, these values are + * protected from being animated. + * 2. Determine if an animation type needs animating. + * 3. Determine if any values have been removed from a type and figure out + * what to animate those to. + */ + function animateChanges(changedActiveType) { + const { props } = visualElement; + const context = getVariantContext(visualElement.parent) || {}; + /** + * A list of animations that we'll build into as we iterate through the animation + * types. This will get executed at the end of the function. + */ + const animations = []; + /** + * Keep track of which values have been removed. Then, as we hit lower priority + * animation types, we can check if they contain removed values and animate to that. + */ + const removedKeys = new Set(); + /** + * A dictionary of all encountered keys. This is an object to let us build into and + * copy it without iteration. Each time we hit an animation type we set its protected + * keys - the keys its not allowed to animate - to the latest version of this object. + */ + let encounteredKeys = {}; + /** + * If a variant has been removed at a given index, and this component is controlling + * variant animations, we want to ensure lower-priority variants are forced to animate. + */ + let removedVariantIndex = Infinity; + /** + * Iterate through all animation types in reverse priority order. For each, we want to + * detect which values it's handling and whether or not they've changed (and therefore + * need to be animated). If any values have been removed, we want to detect those in + * lower priority props and flag for animation. + */ + for (let i = 0; i < numAnimationTypes; i++) { + const type = reversePriorityOrder[i]; + const typeState = state[type]; + const prop = props[type] !== undefined + ? props[type] + : context[type]; + const propIsVariant = isVariantLabel(prop); + /** + * If this type has *just* changed isActive status, set activeDelta + * to that status. Otherwise set to null. + */ + const activeDelta = type === changedActiveType ? typeState.isActive : null; + if (activeDelta === false) + removedVariantIndex = i; + /** + * If this prop is an inherited variant, rather than been set directly on the + * component itself, we want to make sure we allow the parent to trigger animations. + * + * TODO: Can probably change this to a !isControllingVariants check + */ + let isInherited = prop === context[type] && + prop !== props[type] && + propIsVariant; + if (isInherited && + (isInitialRender || wasReset) && + visualElement.manuallyAnimateOnMount) { + isInherited = false; + } + /** + * Set all encountered keys so far as the protected keys for this type. This will + * be any key that has been animated or otherwise handled by active, higher-priortiy types. + */ + typeState.protectedKeys = { ...encounteredKeys }; + // Check if we can skip analysing this prop early + if ( + // If it isn't active and hasn't *just* been set as inactive + (!typeState.isActive && activeDelta === null) || + // If we didn't and don't have any defined prop for this animation type + (!prop && !typeState.prevProp) || + // Or if the prop doesn't define an animation + isAnimationControls(prop) || + typeof prop === "boolean") { + continue; + } + /** + * If exit is already active and wasn't just activated, skip + * re-processing to prevent interrupting running exit animations. + * Re-resolving exit with a changed custom value can start new + * value animations that stop the originals, leaving the exit + * animation promise unresolved and the component stuck in the DOM. + */ + if (type === "exit" && typeState.isActive && activeDelta !== true) { + if (typeState.prevResolvedValues) { + encounteredKeys = { + ...encounteredKeys, + ...typeState.prevResolvedValues, + }; + } + continue; + } + /** + * As we go look through the values defined on this type, if we detect + * a changed value or a value that was removed in a higher priority, we set + * this to true and add this prop to the animation list. + */ + const variantDidChange = checkVariantsDidChange(typeState.prevProp, prop); + let shouldAnimateType = variantDidChange || + // If we're making this variant active, we want to always make it active + (type === changedActiveType && + typeState.isActive && + !isInherited && + propIsVariant) || + // If we removed a higher-priority variant (i is in reverse order) + (i > removedVariantIndex && propIsVariant); + let handledRemovedValues = false; + /** + * As animations can be set as variant lists, variants or target objects, we + * coerce everything to an array if it isn't one already + */ + const definitionList = Array.isArray(prop) ? prop : [prop]; + /** + * Build an object of all the resolved values. We'll use this in the subsequent + * animateChanges calls to determine whether a value has changed. + */ + let resolvedValues = definitionList.reduce(buildResolvedTypeValues(type), {}); + if (activeDelta === false) + resolvedValues = {}; + /** + * Now we need to loop through all the keys in the prev prop and this prop, + * and decide: + * 1. If the value has changed, and needs animating + * 2. If it has been removed, and needs adding to the removedKeys set + * 3. If it has been removed in a higher priority type and needs animating + * 4. If it hasn't been removed in a higher priority but hasn't changed, and + * needs adding to the type's protectedKeys list. + */ + const { prevResolvedValues = {} } = typeState; + const allKeys = { + ...prevResolvedValues, + ...resolvedValues, + }; + const markToAnimate = (key) => { + shouldAnimateType = true; + if (removedKeys.has(key)) { + handledRemovedValues = true; + removedKeys.delete(key); + } + typeState.needsAnimating[key] = true; + const motionValue = visualElement.getValue(key); + if (motionValue) + motionValue.liveStyle = false; + }; + for (const key in allKeys) { + const next = resolvedValues[key]; + const prev = prevResolvedValues[key]; + // If we've already handled this we can just skip ahead + if (encounteredKeys.hasOwnProperty(key)) + continue; + /** + * If the value has changed, we probably want to animate it. + */ + let valueHasChanged = false; + if (isKeyframesTarget(next) && isKeyframesTarget(prev)) { + valueHasChanged = + !shallowCompare(next, prev) || variantDidChange; + } + else { + valueHasChanged = next !== prev; + } + if (valueHasChanged) { + if (next !== undefined && next !== null) { + // If next is defined and doesn't equal prev, it needs animating + markToAnimate(key); + } + else { + // If it's undefined, it's been removed. + removedKeys.add(key); + } + } + else if (next !== undefined && removedKeys.has(key)) { + /** + * If next hasn't changed and it isn't undefined, we want to check if it's + * been removed by a higher priority + */ + markToAnimate(key); + } + else { + /** + * If it hasn't changed, we add it to the list of protected values + * to ensure it doesn't get animated. + */ + typeState.protectedKeys[key] = true; + } + } + /** + * Update the typeState so next time animateChanges is called we can compare the + * latest prop and resolvedValues to these. + */ + typeState.prevProp = prop; + typeState.prevResolvedValues = resolvedValues; + if (typeState.isActive) { + encounteredKeys = { ...encounteredKeys, ...resolvedValues }; + } + if ((isInitialRender || wasReset) && + visualElement.blockInitialAnimation) { + shouldAnimateType = false; + } + /** + * If this is an inherited prop we want to skip this animation + * unless the inherited variants haven't changed on this render. + */ + const willAnimateViaParent = isInherited && variantDidChange; + const needsAnimating = !willAnimateViaParent || handledRemovedValues; + if (shouldAnimateType && needsAnimating) { + animations.push(...definitionList.map((animation) => { + const options = { type }; + /** + * If we're performing the initial animation, but we're not + * rendering at the same time as the variant-controlling parent, + * we want to use the parent's transition to calculate the stagger. + */ + if (typeof animation === "string" && + (isInitialRender || wasReset) && + !willAnimateViaParent && + visualElement.manuallyAnimateOnMount && + visualElement.parent) { + const { parent } = visualElement; + const parentVariant = resolveVariant(parent, animation); + if (parent.enteringChildren && parentVariant) { + const { delayChildren } = parentVariant.transition || {}; + options.delay = calcChildStagger(parent.enteringChildren, visualElement, delayChildren); + } + } + return { + animation: animation, + options, + }; + })); + } + } + /** + * If there are some removed value that haven't been dealt with, + * we need to create a new animation that falls back either to the value + * defined in the style prop, or the last read value. + */ + if (removedKeys.size) { + const fallbackAnimation = {}; + /** + * If the initial prop contains a transition we can use that, otherwise + * allow the animation function to use the visual element's default. + */ + if (typeof props.initial !== "boolean") { + const initialTransition = resolveVariant(visualElement, Array.isArray(props.initial) + ? props.initial[0] + : props.initial); + if (initialTransition && initialTransition.transition) { + fallbackAnimation.transition = initialTransition.transition; + } + } + removedKeys.forEach((key) => { + const fallbackTarget = visualElement.getBaseTarget(key); + const motionValue = visualElement.getValue(key); + if (motionValue) + motionValue.liveStyle = true; + // @ts-expect-error - @mattgperry to figure if we should do something here + fallbackAnimation[key] = fallbackTarget ?? null; + }); + animations.push({ animation: fallbackAnimation }); + } + let shouldAnimate = Boolean(animations.length); + if (isInitialRender && + (props.initial === false || props.initial === props.animate) && + !visualElement.manuallyAnimateOnMount) { + shouldAnimate = false; + } + isInitialRender = false; + wasReset = false; + return shouldAnimate ? animate(animations) : Promise.resolve(); + } + /** + * Change whether a certain animation type is active. + */ + function setActive(type, isActive) { + // If the active state hasn't changed, we can safely do nothing here + if (state[type].isActive === isActive) + return Promise.resolve(); + // Propagate active change to children + visualElement.variantChildren?.forEach((child) => child.animationState?.setActive(type, isActive)); + state[type].isActive = isActive; + const animations = animateChanges(type); + for (const key in state) { + state[key].protectedKeys = {}; + } + return animations; + } + return { + animateChanges, + setActive, + setAnimateFunction, + getState: () => state, + reset: () => { + state = createState(); + wasReset = true; + }, + }; +} +function checkVariantsDidChange(prev, next) { + if (typeof next === "string") { + return next !== prev; + } + else if (Array.isArray(next)) { + return !shallowCompare(next, prev); + } + return false; +} +function createTypeState(isActive = false) { + return { + isActive, + protectedKeys: {}, + needsAnimating: {}, + prevResolvedValues: {}, + }; +} +function createState() { + return { + animate: createTypeState(true), + whileInView: createTypeState(), + whileHover: createTypeState(), + whileTap: createTypeState(), + whileDrag: createTypeState(), + whileFocus: createTypeState(), + exit: createTypeState(), + }; +} + +export { checkVariantsDidChange, createAnimationState }; +//# sourceMappingURL=animation-state.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/utils/animation-state.mjs.map b/node_modules/motion-dom/dist/es/render/utils/animation-state.mjs.map new file mode 100644 index 0000000..7786bfd --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/utils/animation-state.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"animation-state.mjs","sources":["../../../../src/render/utils/animation-state.ts"],"sourcesContent":["import type {\n AnimationDefinition,\n TargetAndTransition,\n VariantLabels,\n} from \"../../node/types\"\nimport type { AnimationType } from \"../types\"\nimport type { VisualElementAnimationOptions } from \"../../animation/interfaces/types\"\nimport { animateVisualElement } from \"../../animation/interfaces/visual-element\"\nimport { calcChildStagger } from \"../../animation/utils/calc-child-stagger\"\nimport { getVariantContext } from \"./get-variant-context\"\nimport { isAnimationControls } from \"./is-animation-controls\"\nimport { isKeyframesTarget } from \"./is-keyframes-target\"\nimport { isVariantLabel } from \"./is-variant-label\"\nimport { resolveVariant } from \"./resolve-dynamic-variants\"\nimport { shallowCompare } from \"./shallow-compare\"\nimport { variantPriorityOrder } from \"./variant-props\"\n\nexport type { VisualElementAnimationOptions }\n\nexport interface AnimationState {\n animateChanges: (type?: AnimationType) => Promise\n setActive: (\n type: AnimationType,\n isActive: boolean,\n options?: VisualElementAnimationOptions\n ) => Promise\n setAnimateFunction: (fn: any) => void\n getState: () => { [key: string]: AnimationTypeState }\n reset: () => void\n}\n\ninterface DefinitionAndOptions {\n animation: AnimationDefinition\n options?: VisualElementAnimationOptions\n}\n\nexport type AnimationList = string[] | TargetAndTransition[]\n\nconst reversePriorityOrder = [...variantPriorityOrder].reverse()\nconst numAnimationTypes = variantPriorityOrder.length\n\n/**\n * Type for the animate function that can be injected.\n * This allows the animation implementation to be provided by the framework layer.\n */\nexport type AnimateFunction = (animations: DefinitionAndOptions[]) => Promise\n\nfunction createAnimateFunction(visualElement: any): AnimateFunction {\n return (animations: DefinitionAndOptions[]) => {\n return Promise.all(\n animations.map(({ animation, options }) =>\n animateVisualElement(visualElement, animation, options)\n )\n )\n }\n}\n\nexport function createAnimationState(visualElement: any): AnimationState {\n let animate = createAnimateFunction(visualElement)\n let state = createState()\n let isInitialRender = true\n /**\n * Track whether the animation state has been reset (e.g. via StrictMode\n * double-invocation or Suspense unmount/remount). On the first\n * animateChanges() call after a reset we need to behave like the initial\n * render for variant-inheritance checks, even though isInitialRender is\n * already false.\n */\n let wasReset = false\n\n /**\n * This function will be used to reduce the animation definitions for\n * each active animation type into an object of resolved values for it.\n */\n const buildResolvedTypeValues =\n (type: AnimationType) =>\n (\n acc: { [key: string]: any },\n definition: string | TargetAndTransition | undefined\n ) => {\n const resolved = resolveVariant(\n visualElement,\n definition,\n type === \"exit\"\n ? visualElement.presenceContext?.custom\n : undefined\n )\n\n if (resolved) {\n const { transition, transitionEnd, ...target } = resolved\n acc = { ...acc, ...target, ...transitionEnd }\n }\n\n return acc\n }\n\n /**\n * This just allows us to inject mocked animation functions\n * @internal\n */\n function setAnimateFunction(\n makeAnimator: (visualElement: any) => AnimateFunction\n ) {\n animate = makeAnimator(visualElement)\n }\n\n /**\n * When we receive new props, we need to:\n * 1. Create a list of protected keys for each type. This is a directory of\n * value keys that are currently being \"handled\" by types of a higher priority\n * so that whenever an animation is played of a given type, these values are\n * protected from being animated.\n * 2. Determine if an animation type needs animating.\n * 3. Determine if any values have been removed from a type and figure out\n * what to animate those to.\n */\n function animateChanges(changedActiveType?: AnimationType) {\n const { props } = visualElement\n const context = getVariantContext(visualElement.parent) || {}\n\n /**\n * A list of animations that we'll build into as we iterate through the animation\n * types. This will get executed at the end of the function.\n */\n const animations: DefinitionAndOptions[] = []\n\n /**\n * Keep track of which values have been removed. Then, as we hit lower priority\n * animation types, we can check if they contain removed values and animate to that.\n */\n const removedKeys = new Set()\n\n /**\n * A dictionary of all encountered keys. This is an object to let us build into and\n * copy it without iteration. Each time we hit an animation type we set its protected\n * keys - the keys its not allowed to animate - to the latest version of this object.\n */\n let encounteredKeys: { [key: string]: any } = {}\n\n /**\n * If a variant has been removed at a given index, and this component is controlling\n * variant animations, we want to ensure lower-priority variants are forced to animate.\n */\n let removedVariantIndex = Infinity\n\n /**\n * Iterate through all animation types in reverse priority order. For each, we want to\n * detect which values it's handling and whether or not they've changed (and therefore\n * need to be animated). If any values have been removed, we want to detect those in\n * lower priority props and flag for animation.\n */\n for (let i = 0; i < numAnimationTypes; i++) {\n const type = reversePriorityOrder[i]\n const typeState = state[type]\n const prop =\n props[type] !== undefined\n ? props[type]\n : context[type as keyof typeof context]\n const propIsVariant = isVariantLabel(prop)\n\n /**\n * If this type has *just* changed isActive status, set activeDelta\n * to that status. Otherwise set to null.\n */\n const activeDelta =\n type === changedActiveType ? typeState.isActive : null\n\n if (activeDelta === false) removedVariantIndex = i\n\n /**\n * If this prop is an inherited variant, rather than been set directly on the\n * component itself, we want to make sure we allow the parent to trigger animations.\n *\n * TODO: Can probably change this to a !isControllingVariants check\n */\n let isInherited =\n prop === context[type as keyof typeof context] &&\n prop !== props[type] &&\n propIsVariant\n\n if (\n isInherited &&\n (isInitialRender || wasReset) &&\n visualElement.manuallyAnimateOnMount\n ) {\n isInherited = false\n }\n\n /**\n * Set all encountered keys so far as the protected keys for this type. This will\n * be any key that has been animated or otherwise handled by active, higher-priortiy types.\n */\n typeState.protectedKeys = { ...encounteredKeys }\n\n // Check if we can skip analysing this prop early\n if (\n // If it isn't active and hasn't *just* been set as inactive\n (!typeState.isActive && activeDelta === null) ||\n // If we didn't and don't have any defined prop for this animation type\n (!prop && !typeState.prevProp) ||\n // Or if the prop doesn't define an animation\n isAnimationControls(prop) ||\n typeof prop === \"boolean\"\n ) {\n continue\n }\n\n /**\n * If exit is already active and wasn't just activated, skip\n * re-processing to prevent interrupting running exit animations.\n * Re-resolving exit with a changed custom value can start new\n * value animations that stop the originals, leaving the exit\n * animation promise unresolved and the component stuck in the DOM.\n */\n if (type === \"exit\" && typeState.isActive && activeDelta !== true) {\n if (typeState.prevResolvedValues) {\n encounteredKeys = {\n ...encounteredKeys,\n ...typeState.prevResolvedValues,\n }\n }\n continue\n }\n\n /**\n * As we go look through the values defined on this type, if we detect\n * a changed value or a value that was removed in a higher priority, we set\n * this to true and add this prop to the animation list.\n */\n const variantDidChange = checkVariantsDidChange(\n typeState.prevProp,\n prop\n )\n\n let shouldAnimateType =\n variantDidChange ||\n // If we're making this variant active, we want to always make it active\n (type === changedActiveType &&\n typeState.isActive &&\n !isInherited &&\n propIsVariant) ||\n // If we removed a higher-priority variant (i is in reverse order)\n (i > removedVariantIndex && propIsVariant)\n\n let handledRemovedValues = false\n\n /**\n * As animations can be set as variant lists, variants or target objects, we\n * coerce everything to an array if it isn't one already\n */\n const definitionList = Array.isArray(prop) ? prop : [prop]\n\n /**\n * Build an object of all the resolved values. We'll use this in the subsequent\n * animateChanges calls to determine whether a value has changed.\n */\n let resolvedValues = definitionList.reduce(\n buildResolvedTypeValues(type),\n {}\n )\n\n if (activeDelta === false) resolvedValues = {}\n\n /**\n * Now we need to loop through all the keys in the prev prop and this prop,\n * and decide:\n * 1. If the value has changed, and needs animating\n * 2. If it has been removed, and needs adding to the removedKeys set\n * 3. If it has been removed in a higher priority type and needs animating\n * 4. If it hasn't been removed in a higher priority but hasn't changed, and\n * needs adding to the type's protectedKeys list.\n */\n const { prevResolvedValues = {} } = typeState\n\n const allKeys = {\n ...prevResolvedValues,\n ...resolvedValues,\n }\n const markToAnimate = (key: string) => {\n shouldAnimateType = true\n if (removedKeys.has(key)) {\n handledRemovedValues = true\n removedKeys.delete(key)\n }\n typeState.needsAnimating[key] = true\n\n const motionValue = visualElement.getValue(key)\n if (motionValue) motionValue.liveStyle = false\n }\n\n for (const key in allKeys) {\n const next = resolvedValues[key]\n const prev = prevResolvedValues[key]\n\n // If we've already handled this we can just skip ahead\n if (encounteredKeys.hasOwnProperty(key)) continue\n\n /**\n * If the value has changed, we probably want to animate it.\n */\n let valueHasChanged = false\n if (isKeyframesTarget(next) && isKeyframesTarget(prev)) {\n valueHasChanged =\n !shallowCompare(next, prev) || variantDidChange\n } else {\n valueHasChanged = next !== prev\n }\n\n if (valueHasChanged) {\n if (next !== undefined && next !== null) {\n // If next is defined and doesn't equal prev, it needs animating\n markToAnimate(key)\n } else {\n // If it's undefined, it's been removed.\n removedKeys.add(key)\n }\n } else if (next !== undefined && removedKeys.has(key)) {\n /**\n * If next hasn't changed and it isn't undefined, we want to check if it's\n * been removed by a higher priority\n */\n markToAnimate(key)\n } else {\n /**\n * If it hasn't changed, we add it to the list of protected values\n * to ensure it doesn't get animated.\n */\n typeState.protectedKeys[key] = true\n }\n }\n\n /**\n * Update the typeState so next time animateChanges is called we can compare the\n * latest prop and resolvedValues to these.\n */\n typeState.prevProp = prop\n typeState.prevResolvedValues = resolvedValues\n\n if (typeState.isActive) {\n encounteredKeys = { ...encounteredKeys, ...resolvedValues }\n }\n\n if (\n (isInitialRender || wasReset) &&\n visualElement.blockInitialAnimation\n ) {\n shouldAnimateType = false\n }\n\n /**\n * If this is an inherited prop we want to skip this animation\n * unless the inherited variants haven't changed on this render.\n */\n const willAnimateViaParent = isInherited && variantDidChange\n const needsAnimating = !willAnimateViaParent || handledRemovedValues\n if (shouldAnimateType && needsAnimating) {\n animations.push(\n ...definitionList.map((animation) => {\n const options: VisualElementAnimationOptions = { type }\n\n /**\n * If we're performing the initial animation, but we're not\n * rendering at the same time as the variant-controlling parent,\n * we want to use the parent's transition to calculate the stagger.\n */\n if (\n typeof animation === \"string\" &&\n (isInitialRender || wasReset) &&\n !willAnimateViaParent &&\n visualElement.manuallyAnimateOnMount &&\n visualElement.parent\n ) {\n const { parent } = visualElement\n const parentVariant = resolveVariant(\n parent,\n animation\n )\n\n if (parent.enteringChildren && parentVariant) {\n const { delayChildren } =\n parentVariant.transition || {}\n options.delay = calcChildStagger(\n parent.enteringChildren,\n visualElement,\n delayChildren\n )\n }\n }\n\n return {\n animation: animation as AnimationDefinition,\n options,\n }\n })\n )\n }\n }\n\n /**\n * If there are some removed value that haven't been dealt with,\n * we need to create a new animation that falls back either to the value\n * defined in the style prop, or the last read value.\n */\n if (removedKeys.size) {\n const fallbackAnimation: TargetAndTransition = {}\n\n /**\n * If the initial prop contains a transition we can use that, otherwise\n * allow the animation function to use the visual element's default.\n */\n if (typeof props.initial !== \"boolean\") {\n const initialTransition = resolveVariant(\n visualElement,\n Array.isArray(props.initial)\n ? props.initial[0]\n : props.initial\n )\n\n if (initialTransition && initialTransition.transition) {\n fallbackAnimation.transition = initialTransition.transition\n }\n }\n\n removedKeys.forEach((key) => {\n const fallbackTarget = visualElement.getBaseTarget(key)\n\n const motionValue = visualElement.getValue(key)\n if (motionValue) motionValue.liveStyle = true\n\n // @ts-expect-error - @mattgperry to figure if we should do something here\n fallbackAnimation[key] = fallbackTarget ?? null\n })\n\n animations.push({ animation: fallbackAnimation })\n }\n\n let shouldAnimate = Boolean(animations.length)\n\n if (\n isInitialRender &&\n (props.initial === false || props.initial === props.animate) &&\n !visualElement.manuallyAnimateOnMount\n ) {\n shouldAnimate = false\n }\n\n isInitialRender = false\n wasReset = false\n return shouldAnimate ? animate(animations) : Promise.resolve()\n }\n\n /**\n * Change whether a certain animation type is active.\n */\n function setActive(type: AnimationType, isActive: boolean) {\n // If the active state hasn't changed, we can safely do nothing here\n if (state[type].isActive === isActive) return Promise.resolve()\n\n // Propagate active change to children\n visualElement.variantChildren?.forEach((child: any) =>\n child.animationState?.setActive(type, isActive)\n )\n\n state[type].isActive = isActive\n\n const animations = animateChanges(type)\n\n for (const key in state) {\n state[key as keyof typeof state].protectedKeys = {}\n }\n\n return animations\n }\n\n return {\n animateChanges,\n setActive,\n setAnimateFunction,\n getState: () => state,\n reset: () => {\n state = createState()\n wasReset = true\n },\n }\n}\n\nexport function checkVariantsDidChange(prev: any, next: any) {\n if (typeof next === \"string\") {\n return next !== prev\n } else if (Array.isArray(next)) {\n return !shallowCompare(next, prev)\n }\n\n return false\n}\n\nexport interface AnimationTypeState {\n isActive: boolean\n protectedKeys: { [key: string]: true }\n needsAnimating: { [key: string]: boolean }\n prevResolvedValues: { [key: string]: any }\n prevProp?: VariantLabels | TargetAndTransition\n}\n\nfunction createTypeState(isActive = false): AnimationTypeState {\n return {\n isActive,\n protectedKeys: {},\n needsAnimating: {},\n prevResolvedValues: {},\n }\n}\n\nfunction createState() {\n return {\n animate: createTypeState(true),\n whileInView: createTypeState(),\n whileHover: createTypeState(),\n whileTap: createTypeState(),\n whileDrag: createTypeState(),\n whileFocus: createTypeState(),\n exit: createTypeState(),\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;AAsCA,MAAM,oBAAoB,GAAG,CAAC,GAAG,oBAAoB,CAAC,CAAC,OAAO,EAAE;AAChE,MAAM,iBAAiB,GAAG,oBAAoB,CAAC,MAAM;AAQrD,SAAS,qBAAqB,CAAC,aAAkB,EAAA;IAC7C,OAAO,CAAC,UAAkC,KAAI;QAC1C,OAAO,OAAO,CAAC,GAAG,CACd,UAAU,CAAC,GAAG,CAAC,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,KAClC,oBAAoB,CAAC,aAAa,EAAE,SAAS,EAAE,OAAO,CAAC,CAC1D,CACJ;AACL,IAAA,CAAC;AACL;AAEM,SAAU,oBAAoB,CAAC,aAAkB,EAAA;AACnD,IAAA,IAAI,OAAO,GAAG,qBAAqB,CAAC,aAAa,CAAC;AAClD,IAAA,IAAI,KAAK,GAAG,WAAW,EAAE;IACzB,IAAI,eAAe,GAAG,IAAI;AAC1B;;;;;;AAMG;IACH,IAAI,QAAQ,GAAG,KAAK;AAEpB;;;AAGG;AACH,IAAA,MAAM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AC,IAAI,CAAC;AAEvC,QAAA,KAAK,MAAM,GAAG,IAAI,KAAK,EAAE;AACrB,YAAA,KAAK,CAAC,GAAyB,CAAC,CAAC,aAAa,GAAG,EAAE;QACvD;AAEA,QAAA,OAAO,UAAU;IACrB;IAEA,OAAO;QACH,cAAc;QACd,SAAS;QACT,kBAAkB;AAClB,QAAA,QAAQ,EAAE,MAAM,KAAK;QACrB,KAAK,EAAE,MAAK;YACR,KAAK,GAAG,WAAW,EAAE;YACrB,QAAQ,GAAG,IAAI;QACnB,CAAC;KACJ;AACL;AAEM,SAAU,sBAAsB,CAAC,IAAS,EAAE,IAAS,EAAA;AACvD,IAAA,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;QAC1B,OAAO,IAAI,KAAK,IAAI;IACxB;AAAO,SAAA,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;AAC5B,QAAA,OAAO,CAAC,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC;IACtC;AAEA,IAAA,OAAO,KAAK;AAChB;AAUA,SAAS,eAAe,CAAC,QAAQ,GAAG,KAAK,EAAA;IACrC,OAAO;QACH,QAAQ;AACR,QAAA,aAAa,EAAE,EAAE;AACjB,QAAA,cAAc,EAAE,EAAE;AAClB,QAAA,kBAAkB,EAAE,EAAE;KACzB;AACL;AAEA,SAAS,WAAW,GAAA;IAChB,OAAO;AACH,QAAA,OAAO,EAAE,eAAe,CAAC,IAAI,CAAC;QAC9B,WAAW,EAAE,eAAe,EAAE;QAC9B,UAAU,EAAE,eAAe,EAAE;QAC7B,QAAQ,EAAE,eAAe,EAAE;QAC3B,SAAS,EAAE,eAAe,EAAE;QAC5B,UAAU,EAAE,eAAe,EAAE;QAC7B,IAAI,EAAE,eAAe,EAAE;KAC1B;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/utils/get-variant-context.mjs b/node_modules/motion-dom/dist/es/render/utils/get-variant-context.mjs new file mode 100644 index 0000000..6866d11 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/utils/get-variant-context.mjs @@ -0,0 +1,33 @@ +import { isVariantLabel } from './is-variant-label.mjs'; +import { variantProps } from './variant-props.mjs'; + +const numVariantProps = variantProps.length; +/** + * Get variant context from a visual element's parent chain. + * Uses `any` type for visualElement to avoid circular dependencies. + */ +function getVariantContext(visualElement) { + if (!visualElement) + return undefined; + if (!visualElement.isControllingVariants) { + const context = visualElement.parent + ? getVariantContext(visualElement.parent) || {} + : {}; + if (visualElement.props.initial !== undefined) { + context.initial = visualElement.props.initial; + } + return context; + } + const context = {}; + for (let i = 0; i < numVariantProps; i++) { + const name = variantProps[i]; + const prop = visualElement.props[name]; + if (isVariantLabel(prop) || prop === false) { + context[name] = prop; + } + } + return context; +} + +export { getVariantContext }; +//# sourceMappingURL=get-variant-context.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/utils/get-variant-context.mjs.map b/node_modules/motion-dom/dist/es/render/utils/get-variant-context.mjs.map new file mode 100644 index 0000000..08e36cd --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/utils/get-variant-context.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"get-variant-context.mjs","sources":["../../../../src/render/utils/get-variant-context.ts"],"sourcesContent":["import { isVariantLabel } from \"./is-variant-label\"\nimport { variantProps } from \"./variant-props\"\n\nconst numVariantProps = variantProps.length\n\ntype VariantStateContext = {\n initial?: string | string[]\n animate?: string | string[]\n exit?: string | string[]\n whileHover?: string | string[]\n whileDrag?: string | string[]\n whileFocus?: string | string[]\n whileTap?: string | string[]\n}\n\n/**\n * Get variant context from a visual element's parent chain.\n * Uses `any` type for visualElement to avoid circular dependencies.\n */\nexport function getVariantContext(\n visualElement?: any\n): undefined | VariantStateContext {\n if (!visualElement) return undefined\n\n if (!visualElement.isControllingVariants) {\n const context = visualElement.parent\n ? getVariantContext(visualElement.parent) || {}\n : {}\n if (visualElement.props.initial !== undefined) {\n context.initial = visualElement.props.initial as any\n }\n return context\n }\n\n const context: VariantStateContext = {}\n for (let i = 0; i < numVariantProps; i++) {\n const name = variantProps[i] as keyof typeof context\n const prop = visualElement.props[name]\n\n if (isVariantLabel(prop) || prop === false) {\n ;(context as any)[name] = prop\n }\n }\n\n return context\n}\n"],"names":[],"mappings":";;;AAGA,MAAM,eAAe,GAAG,YAAY,CAAC,MAAM;AAY3C;;;AAGG;AACG,SAAU,iBAAiB,CAC7B,aAAmB,EAAA;AAEnB,IAAA,IAAI,CAAC,aAAa;AAAE,QAAA,OAAO,SAAS;AAEpC,IAAA,IAAI,CAAC,aAAa,CAAC,qBAAqB,EAAE;AACtC,QAAA,MAAM,OAAO,GAAG,aAAa,CAAC;cACxB,iBAAiB,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI;cAC3C,EAAE;QACR,IAAI,aAAa,CAAC,KAAK,CAAC,OAAO,KAAK,SAAS,EAAE;YAC3C,OAAO,CAAC,OAAO,GAAG,aAAa,CAAC,KAAK,CAAC,OAAc;QACxD;AACA,QAAA,OAAO,OAAO;IAClB;IAEA,MAAM,OAAO,GAAwB,EAAE;AACvC,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,eAAe,EAAE,CAAC,EAAE,EAAE;AACtC,QAAA,MAAM,IAAI,GAAG,YAAY,CAAC,CAAC,CAAyB;QACpD,MAAM,IAAI,GAAG,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC;QAEtC,IAAI,cAAc,CAAC,IAAI,CAAC,IAAI,IAAI,KAAK,KAAK,EAAE;AACtC,YAAA,OAAe,CAAC,IAAI,CAAC,GAAG,IAAI;QAClC;IACJ;AAEA,IAAA,OAAO,OAAO;AAClB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/utils/is-animation-controls.mjs b/node_modules/motion-dom/dist/es/render/utils/is-animation-controls.mjs new file mode 100644 index 0000000..17f587f --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/utils/is-animation-controls.mjs @@ -0,0 +1,8 @@ +function isAnimationControls(v) { + return (v !== null && + typeof v === "object" && + typeof v.start === "function"); +} + +export { isAnimationControls }; +//# sourceMappingURL=is-animation-controls.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/utils/is-animation-controls.mjs.map b/node_modules/motion-dom/dist/es/render/utils/is-animation-controls.mjs.map new file mode 100644 index 0000000..985f804 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/utils/is-animation-controls.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"is-animation-controls.mjs","sources":["../../../../src/render/utils/is-animation-controls.ts"],"sourcesContent":["import type { LegacyAnimationControls } from \"../../node/types\"\n\nexport function isAnimationControls(v?: unknown): v is LegacyAnimationControls {\n return (\n v !== null &&\n typeof v === \"object\" &&\n typeof (v as LegacyAnimationControls).start === \"function\"\n )\n}\n"],"names":[],"mappings":"AAEM,SAAU,mBAAmB,CAAC,CAAW,EAAA;IAC3C,QACI,CAAC,KAAK,IAAI;QACV,OAAO,CAAC,KAAK,QAAQ;AACrB,QAAA,OAAQ,CAA6B,CAAC,KAAK,KAAK,UAAU;AAElE;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/utils/is-controlling-variants.mjs b/node_modules/motion-dom/dist/es/render/utils/is-controlling-variants.mjs new file mode 100644 index 0000000..724ace7 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/utils/is-controlling-variants.mjs @@ -0,0 +1,14 @@ +import { isAnimationControls } from './is-animation-controls.mjs'; +import { isVariantLabel } from './is-variant-label.mjs'; +import { variantProps } from './variant-props.mjs'; + +function isControllingVariants(props) { + return (isAnimationControls(props.animate) || + variantProps.some((name) => isVariantLabel(props[name]))); +} +function isVariantNode(props) { + return Boolean(isControllingVariants(props) || props.variants); +} + +export { isControllingVariants, isVariantNode }; +//# sourceMappingURL=is-controlling-variants.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/utils/is-controlling-variants.mjs.map b/node_modules/motion-dom/dist/es/render/utils/is-controlling-variants.mjs.map new file mode 100644 index 0000000..8476a49 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/utils/is-controlling-variants.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"is-controlling-variants.mjs","sources":["../../../../src/render/utils/is-controlling-variants.ts"],"sourcesContent":["import type { MotionNodeOptions } from \"../../node/types\"\nimport { isAnimationControls } from \"./is-animation-controls\"\nimport { isVariantLabel } from \"./is-variant-label\"\nimport { variantProps } from \"./variant-props\"\n\nexport function isControllingVariants(props: MotionNodeOptions) {\n return (\n isAnimationControls(props.animate) ||\n variantProps.some((name) =>\n isVariantLabel(props[name as keyof typeof props])\n )\n )\n}\n\nexport function isVariantNode(props: MotionNodeOptions) {\n return Boolean(isControllingVariants(props) || props.variants)\n}\n"],"names":[],"mappings":";;;;AAKM,SAAU,qBAAqB,CAAC,KAAwB,EAAA;AAC1D,IAAA,QACI,mBAAmB,CAAC,KAAK,CAAC,OAAO,CAAC;AAClC,QAAA,YAAY,CAAC,IAAI,CAAC,CAAC,IAAI,KACnB,cAAc,CAAC,KAAK,CAAC,IAA0B,CAAC,CAAC,CACpD;AAET;AAEM,SAAU,aAAa,CAAC,KAAwB,EAAA;IAClD,OAAO,OAAO,CAAC,qBAAqB,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC;AAClE;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/utils/is-forced-motion-value.mjs b/node_modules/motion-dom/dist/es/render/utils/is-forced-motion-value.mjs new file mode 100644 index 0000000..e9bb0bd --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/utils/is-forced-motion-value.mjs @@ -0,0 +1,13 @@ +import { transformProps } from './keys-transform.mjs'; +import { scaleCorrectors } from '../../projection/styles/scale-correction.mjs'; +export { addScaleCorrector } from '../../projection/styles/scale-correction.mjs'; + +function isForcedMotionValue(key, { layout, layoutId }) { + return (transformProps.has(key) || + key.startsWith("origin") || + ((layout || layoutId !== undefined) && + (!!scaleCorrectors[key] || key === "opacity"))); +} + +export { isForcedMotionValue, scaleCorrectors }; +//# sourceMappingURL=is-forced-motion-value.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/utils/is-forced-motion-value.mjs.map b/node_modules/motion-dom/dist/es/render/utils/is-forced-motion-value.mjs.map new file mode 100644 index 0000000..5ecd4e6 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/utils/is-forced-motion-value.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"is-forced-motion-value.mjs","sources":["../../../../src/render/utils/is-forced-motion-value.ts"],"sourcesContent":["import { transformProps } from \"./keys-transform\"\nimport type { MotionNodeOptions } from \"../../node/types\"\nimport {\n scaleCorrectors,\n addScaleCorrector,\n} from \"../../projection/styles/scale-correction\"\n\nexport { scaleCorrectors, addScaleCorrector }\n\nexport function isForcedMotionValue(\n key: string,\n { layout, layoutId }: MotionNodeOptions\n) {\n return (\n transformProps.has(key) ||\n key.startsWith(\"origin\") ||\n ((layout || layoutId !== undefined) &&\n (!!scaleCorrectors[key] || key === \"opacity\"))\n )\n}\n"],"names":[],"mappings":";;;;AASM,SAAU,mBAAmB,CAC/B,GAAW,EACX,EAAE,MAAM,EAAE,QAAQ,EAAqB,EAAA;AAEvC,IAAA,QACI,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC;AACvB,QAAA,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC;AACxB,SAAC,CAAC,MAAM,IAAI,QAAQ,KAAK,SAAS;AAC9B,aAAC,CAAC,CAAC,eAAe,CAAC,GAAG,CAAC,IAAI,GAAG,KAAK,SAAS,CAAC,CAAC;AAE1D;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/utils/is-keyframes-target.mjs b/node_modules/motion-dom/dist/es/render/utils/is-keyframes-target.mjs new file mode 100644 index 0000000..9e01dbe --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/utils/is-keyframes-target.mjs @@ -0,0 +1,6 @@ +const isKeyframesTarget = (v) => { + return Array.isArray(v); +}; + +export { isKeyframesTarget }; +//# sourceMappingURL=is-keyframes-target.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/utils/is-keyframes-target.mjs.map b/node_modules/motion-dom/dist/es/render/utils/is-keyframes-target.mjs.map new file mode 100644 index 0000000..7c69a6a --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/utils/is-keyframes-target.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"is-keyframes-target.mjs","sources":["../../../../src/render/utils/is-keyframes-target.ts"],"sourcesContent":["import type { UnresolvedValueKeyframe, ValueKeyframesDefinition } from \"../../animation/types\"\n\nexport const isKeyframesTarget = (\n v: ValueKeyframesDefinition\n): v is UnresolvedValueKeyframe[] => {\n return Array.isArray(v)\n}\n"],"names":[],"mappings":"AAEO,MAAM,iBAAiB,GAAG,CAC7B,CAA2B,KACK;AAChC,IAAA,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AAC3B;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/utils/is-variant-label.mjs b/node_modules/motion-dom/dist/es/render/utils/is-variant-label.mjs new file mode 100644 index 0000000..1064983 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/utils/is-variant-label.mjs @@ -0,0 +1,9 @@ +/** + * Decides if the supplied variable is variant label + */ +function isVariantLabel(v) { + return typeof v === "string" || Array.isArray(v); +} + +export { isVariantLabel }; +//# sourceMappingURL=is-variant-label.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/utils/is-variant-label.mjs.map b/node_modules/motion-dom/dist/es/render/utils/is-variant-label.mjs.map new file mode 100644 index 0000000..154c8c7 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/utils/is-variant-label.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"is-variant-label.mjs","sources":["../../../../src/render/utils/is-variant-label.ts"],"sourcesContent":["/**\n * Decides if the supplied variable is variant label\n */\nexport function isVariantLabel(v: unknown): v is string | string[] {\n return typeof v === \"string\" || Array.isArray(v)\n}\n"],"names":[],"mappings":"AAAA;;AAEG;AACG,SAAU,cAAc,CAAC,CAAU,EAAA;IACrC,OAAO,OAAO,CAAC,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AACpD;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/utils/keys-position.mjs b/node_modules/motion-dom/dist/es/render/utils/keys-position.mjs new file mode 100644 index 0000000..d000529 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/utils/keys-position.mjs @@ -0,0 +1,14 @@ +import { transformPropOrder } from './keys-transform.mjs'; + +const positionalKeys = new Set([ + "width", + "height", + "top", + "left", + "right", + "bottom", + ...transformPropOrder, +]); + +export { positionalKeys }; +//# sourceMappingURL=keys-position.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/utils/keys-position.mjs.map b/node_modules/motion-dom/dist/es/render/utils/keys-position.mjs.map new file mode 100644 index 0000000..12f42fd --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/utils/keys-position.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"keys-position.mjs","sources":["../../../../src/render/utils/keys-position.ts"],"sourcesContent":["import { transformPropOrder } from \"./keys-transform\"\n\nexport const positionalKeys = new Set([\n \"width\",\n \"height\",\n \"top\",\n \"left\",\n \"right\",\n \"bottom\",\n ...transformPropOrder,\n])\n"],"names":[],"mappings":";;AAEO,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC;IAClC,OAAO;IACP,QAAQ;IACR,KAAK;IACL,MAAM;IACN,OAAO;IACP,QAAQ;AACR,IAAA,GAAG,kBAAkB;AACxB,CAAA;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/utils/keys-transform.mjs b/node_modules/motion-dom/dist/es/render/utils/keys-transform.mjs new file mode 100644 index 0000000..8a2b687 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/utils/keys-transform.mjs @@ -0,0 +1,36 @@ +/** + * Generate a list of every possible transform key. + */ +const transformPropOrder = [ + "transformPerspective", + "x", + "y", + "z", + "translateX", + "translateY", + "translateZ", + "scale", + "scaleX", + "scaleY", + "rotate", + "rotateX", + "rotateY", + "rotateZ", + "skew", + "skewX", + "skewY", +]; +/** + * A quick lookup for transform props. + * + * `pathRotation` is a transform for routing purposes (skipped from raw + * style application, wired to the transform composite, flags transform + * dirty) but is intentionally NOT in `transformPropOrder` — it is + * composed onto `rotate` at the build sites, not serialized in its own + * slot, and must stay out of the order-array consumers (parse-transform, + * unit-conversion, keys-position). + */ +const transformProps = /*@__PURE__*/ (() => new Set([...transformPropOrder, "pathRotation"]))(); + +export { transformPropOrder, transformProps }; +//# sourceMappingURL=keys-transform.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/utils/keys-transform.mjs.map b/node_modules/motion-dom/dist/es/render/utils/keys-transform.mjs.map new file mode 100644 index 0000000..aec5e45 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/utils/keys-transform.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"keys-transform.mjs","sources":["../../../../src/render/utils/keys-transform.ts"],"sourcesContent":["/**\n * Generate a list of every possible transform key.\n */\nexport const transformPropOrder = [\n \"transformPerspective\",\n \"x\",\n \"y\",\n \"z\",\n \"translateX\",\n \"translateY\",\n \"translateZ\",\n \"scale\",\n \"scaleX\",\n \"scaleY\",\n \"rotate\",\n \"rotateX\",\n \"rotateY\",\n \"rotateZ\",\n \"skew\",\n \"skewX\",\n \"skewY\",\n]\n\n/**\n * A quick lookup for transform props.\n *\n * `pathRotation` is a transform for routing purposes (skipped from raw\n * style application, wired to the transform composite, flags transform\n * dirty) but is intentionally NOT in `transformPropOrder` — it is\n * composed onto `rotate` at the build sites, not serialized in its own\n * slot, and must stay out of the order-array consumers (parse-transform,\n * unit-conversion, keys-position).\n */\nexport const transformProps = /*@__PURE__*/ (() =>\n new Set([...transformPropOrder, \"pathRotation\"]))()\n"],"names":[],"mappings":"AAAA;;AAEG;AACI,MAAM,kBAAkB,GAAG;IAC9B,sBAAsB;IACtB,GAAG;IACH,GAAG;IACH,GAAG;IACH,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,OAAO;IACP,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,SAAS;IACT,SAAS;IACT,SAAS;IACT,MAAM;IACN,OAAO;IACP,OAAO;;AAGX;;;;;;;;;AASG;MACU,cAAc,iBAAiB,CAAC,MACzC,IAAI,GAAG,CAAC,CAAC,GAAG,kBAAkB,EAAE,cAAc,CAAC,CAAC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/utils/motion-values.mjs b/node_modules/motion-dom/dist/es/render/utils/motion-values.mjs new file mode 100644 index 0000000..be01fdf --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/utils/motion-values.mjs @@ -0,0 +1,56 @@ +import { motionValue } from '../../value/index.mjs'; +import { isMotionValue } from '../../value/utils/is-motion-value.mjs'; + +/** + * Updates motion values from props changes. + * Uses `any` type for element to avoid circular dependencies with VisualElement. + */ +function updateMotionValuesFromProps(element, next, prev) { + for (const key in next) { + const nextValue = next[key]; + const prevValue = prev[key]; + if (isMotionValue(nextValue)) { + /** + * If this is a motion value found in props or style, we want to add it + * to our visual element's motion value map. + */ + element.addValue(key, nextValue); + } + else if (isMotionValue(prevValue)) { + /** + * If we're swapping from a motion value to a static value, + * create a new motion value from that + */ + element.addValue(key, motionValue(nextValue, { owner: element })); + } + else if (prevValue !== nextValue) { + /** + * If this is a flat value that has changed, update the motion value + * or create one if it doesn't exist. We only want to do this if we're + * not handling the value with our animation state. + */ + if (element.hasValue(key)) { + const existingValue = element.getValue(key); + if (existingValue.liveStyle === true) { + existingValue.jump(nextValue); + } + else if (!existingValue.hasAnimated) { + existingValue.set(nextValue); + } + } + else { + const latestValue = element.getStaticValue(key); + element.addValue(key, motionValue(latestValue !== undefined ? latestValue : nextValue, { owner: element })); + } + } + } + // Handle removed values + for (const key in prev) { + if (next[key] === undefined) + element.removeValue(key); + } + return next; +} + +export { updateMotionValuesFromProps }; +//# sourceMappingURL=motion-values.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/utils/motion-values.mjs.map b/node_modules/motion-dom/dist/es/render/utils/motion-values.mjs.map new file mode 100644 index 0000000..30b05c5 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/utils/motion-values.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"motion-values.mjs","sources":["../../../../src/render/utils/motion-values.ts"],"sourcesContent":["import { motionValue } from \"../../value\"\nimport { isMotionValue } from \"../../value/utils/is-motion-value\"\n\ntype MotionStyleLike = Record\n\n/**\n * Updates motion values from props changes.\n * Uses `any` type for element to avoid circular dependencies with VisualElement.\n */\nexport function updateMotionValuesFromProps(\n element: any,\n next: MotionStyleLike,\n prev: MotionStyleLike\n) {\n for (const key in next) {\n const nextValue = next[key]\n const prevValue = prev[key]\n\n if (isMotionValue(nextValue)) {\n /**\n * If this is a motion value found in props or style, we want to add it\n * to our visual element's motion value map.\n */\n element.addValue(key, nextValue)\n } else if (isMotionValue(prevValue)) {\n /**\n * If we're swapping from a motion value to a static value,\n * create a new motion value from that\n */\n element.addValue(key, motionValue(nextValue, { owner: element }))\n } else if (prevValue !== nextValue) {\n /**\n * If this is a flat value that has changed, update the motion value\n * or create one if it doesn't exist. We only want to do this if we're\n * not handling the value with our animation state.\n */\n if (element.hasValue(key)) {\n const existingValue = element.getValue(key)!\n\n if (existingValue.liveStyle === true) {\n existingValue.jump(nextValue)\n } else if (!existingValue.hasAnimated) {\n existingValue.set(nextValue)\n }\n } else {\n const latestValue = element.getStaticValue(key)\n element.addValue(\n key,\n motionValue(\n latestValue !== undefined ? latestValue : nextValue,\n { owner: element }\n )\n )\n }\n }\n }\n\n // Handle removed values\n for (const key in prev) {\n if (next[key] === undefined) element.removeValue(key)\n }\n\n return next\n}\n"],"names":[],"mappings":";;;AAKA;;;AAGG;SACa,2BAA2B,CACvC,OAAY,EACZ,IAAqB,EACrB,IAAqB,EAAA;AAErB,IAAA,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE;AACpB,QAAA,MAAM,SAAS,GAA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of file diff --git a/node_modules/motion-dom/dist/es/render/utils/reduced-motion/index.mjs b/node_modules/motion-dom/dist/es/render/utils/reduced-motion/index.mjs new file mode 100644 index 0000000..a9550a2 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/utils/reduced-motion/index.mjs @@ -0,0 +1,20 @@ +import { hasReducedMotionListener, prefersReducedMotion } from './state.mjs'; + +const isBrowser = typeof window !== "undefined"; +function initPrefersReducedMotion() { + hasReducedMotionListener.current = true; + if (!isBrowser) + return; + if (window.matchMedia) { + const motionMediaQuery = window.matchMedia("(prefers-reduced-motion)"); + const setReducedMotionPreferences = () => (prefersReducedMotion.current = motionMediaQuery.matches); + motionMediaQuery.addEventListener("change", setReducedMotionPreferences); + setReducedMotionPreferences(); + } + else { + prefersReducedMotion.current = false; + } +} + +export { hasReducedMotionListener, initPrefersReducedMotion, prefersReducedMotion }; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/utils/reduced-motion/index.mjs.map b/node_modules/motion-dom/dist/es/render/utils/reduced-motion/index.mjs.map new file mode 100644 index 0000000..2fb891c --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/utils/reduced-motion/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../../../../../src/render/utils/reduced-motion/index.ts"],"sourcesContent":["import { hasReducedMotionListener, prefersReducedMotion } from \"./state\"\n\nconst isBrowser = typeof window !== \"undefined\"\n\nexport function initPrefersReducedMotion() {\n hasReducedMotionListener.current = true\n if (!isBrowser) return\n\n if (window.matchMedia) {\n const motionMediaQuery = window.matchMedia(\"(prefers-reduced-motion)\")\n\n const setReducedMotionPreferences = () =>\n (prefersReducedMotion.current = motionMediaQuery.matches)\n\n motionMediaQuery.addEventListener(\"change\", setReducedMotionPreferences)\n\n setReducedMotionPreferences()\n } else {\n prefersReducedMotion.current = false\n }\n}\n\nexport { prefersReducedMotion, hasReducedMotionListener }\n"],"names":[],"mappings":";;AAEA,MAAM,SAAS,GAAG,OAAO,MAAM,KAAK,WAAW;SAE/B,wBAAwB,GAAA;AACpC,IAAA,wBAAwB,CAAC,OAAO,GAAG,IAAI;AACvC,IAAA,IAAI,CAAC,SAAS;QAAE;AAEhB,IAAA,IAAI,MAAM,CAAC,UAAU,EAAE;QACnB,MAAM,gBAAgB,GAAG,MAAM,CAAC,UAAU,CAAC,0BAA0B,CAAC;AAEtE,QAAA,MAAM,2BAA2B,GAAG,OAC/B,oBAAoB,CAAC,OAAO,GAAG,gBAAgB,CAAC,OAAO,CAAC;AAE7D,QAAA,gBAAgB,CAAC,gBAAgB,CAAC,QAAQ,EAAE,2BAA2B,CAAC;AAExE,QAAA,2BAA2B,EAAE;IACjC;SAAO;AACH,QAAA,oBAAoB,CAAC,OAAO,GAAG,KAAK;IACxC;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/utils/reduced-motion/state.mjs b/node_modules/motion-dom/dist/es/render/utils/reduced-motion/state.mjs new file mode 100644 index 0000000..c846f8f --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/utils/reduced-motion/state.mjs @@ -0,0 +1,6 @@ +// Does this device prefer reduced motion? Returns `null` server-side. +const prefersReducedMotion = { current: null }; +const hasReducedMotionListener = { current: false }; + +export { hasReducedMotionListener, prefersReducedMotion }; +//# sourceMappingURL=state.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/utils/reduced-motion/state.mjs.map b/node_modules/motion-dom/dist/es/render/utils/reduced-motion/state.mjs.map new file mode 100644 index 0000000..33df383 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/utils/reduced-motion/state.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"state.mjs","sources":["../../../../../src/render/utils/reduced-motion/state.ts"],"sourcesContent":["interface ReducedMotionState {\n current: boolean | null\n}\n\n// Does this device prefer reduced motion? Returns `null` server-side.\nexport const prefersReducedMotion: ReducedMotionState = { current: null }\n\nexport const hasReducedMotionListener = { current: false }\n"],"names":[],"mappings":"AAIA;MACa,oBAAoB,GAAuB,EAAE,OAAO,EAAE,IAAI;MAE1D,wBAAwB,GAAG,EAAE,OAAO,EAAE,KAAK;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/utils/resolve-dynamic-variants.mjs b/node_modules/motion-dom/dist/es/render/utils/resolve-dynamic-variants.mjs new file mode 100644 index 0000000..e7b6fc4 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/utils/resolve-dynamic-variants.mjs @@ -0,0 +1,9 @@ +import { resolveVariantFromProps } from './resolve-variants.mjs'; + +function resolveVariant(visualElement, definition, custom) { + const props = visualElement.getProps(); + return resolveVariantFromProps(props, definition, custom !== undefined ? custom : props.custom, visualElement); +} + +export { resolveVariant }; +//# sourceMappingURL=resolve-dynamic-variants.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/utils/resolve-dynamic-variants.mjs.map b/node_modules/motion-dom/dist/es/render/utils/resolve-dynamic-variants.mjs.map new file mode 100644 index 0000000..ceef8b4 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/utils/resolve-dynamic-variants.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"resolve-dynamic-variants.mjs","sources":["../../../../src/render/utils/resolve-dynamic-variants.ts"],"sourcesContent":["import type {\n AnimationDefinition,\n TargetAndTransition,\n TargetResolver,\n} from \"../../node/types\"\nimport { resolveVariantFromProps } from \"./resolve-variants\"\n\n/**\n * Resolves a variant if it's a variant resolver.\n * Uses `any` type for visualElement to avoid circular dependencies.\n */\nexport function resolveVariant(\n visualElement: any,\n definition?: TargetAndTransition | TargetResolver,\n custom?: any\n): TargetAndTransition\nexport function resolveVariant(\n visualElement: any,\n definition?: AnimationDefinition,\n custom?: any\n): TargetAndTransition | undefined\nexport function resolveVariant(\n visualElement: any,\n definition?: AnimationDefinition,\n custom?: any\n) {\n const props = visualElement.getProps()\n return resolveVariantFromProps(\n props,\n definition,\n custom !== undefined ? custom : props.custom,\n visualElement\n )\n}\n"],"names":[],"mappings":";;SAqBgB,cAAc,CAC1B,aAAkB,EAClB,UAAgC,EAChC,MAAY,EAAA;AAEZ,IAAA,MAAM,KAAK,GAAG,aAAa,CAAC,QAAQ,EAAE;IACtC,OAAO,uBAAuB,CAC1B,KAAK,EACL,UAAU,EACV,MAAM,KAAK,SAAS,GAAG,MAAM,GAAG,KAAK,CAAC,MAAM,EAC5C,aAAa,CAChB;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/utils/resolve-variants.mjs b/node_modules/motion-dom/dist/es/render/utils/resolve-variants.mjs new file mode 100644 index 0000000..61756dd --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/utils/resolve-variants.mjs @@ -0,0 +1,37 @@ +function getValueState(visualElement) { + const state = [{}, {}]; + visualElement?.values.forEach((value, key) => { + state[0][key] = value.get(); + state[1][key] = value.getVelocity(); + }); + return state; +} +function resolveVariantFromProps(props, definition, custom, visualElement) { + /** + * If the variant definition is a function, resolve. + */ + if (typeof definition === "function") { + const [current, velocity] = getValueState(visualElement); + definition = definition(custom !== undefined ? custom : props.custom, current, velocity); + } + /** + * If the variant definition is a variant label, or + * the function returned a variant label, resolve. + */ + if (typeof definition === "string") { + definition = props.variants && props.variants[definition]; + } + /** + * At this point we've resolved both functions and variant labels, + * but the resolved variant label might itself have been a function. + * If so, resolve. This can only have returned a valid target object. + */ + if (typeof definition === "function") { + const [current, velocity] = getValueState(visualElement); + definition = definition(custom !== undefined ? custom : props.custom, current, velocity); + } + return definition; +} + +export { resolveVariantFromProps }; +//# sourceMappingURL=resolve-variants.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/utils/resolve-variants.mjs.map b/node_modules/motion-dom/dist/es/render/utils/resolve-variants.mjs.map new file mode 100644 index 0000000..740741f --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/utils/resolve-variants.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"resolve-variants.mjs","sources":["../../../../src/render/utils/resolve-variants.ts"],"sourcesContent":["import type {\n AnimationDefinition,\n MotionNodeOptions,\n TargetAndTransition,\n TargetResolver,\n} from \"../../node/types\"\nimport type { ResolvedValues } from \"../types\"\n\nfunction getValueState(visualElement?: any): [ResolvedValues, ResolvedValues] {\n const state: [ResolvedValues, ResolvedValues] = [{}, {}]\n\n visualElement?.values.forEach((value: any, key: string) => {\n state[0][key] = value.get()\n state[1][key] = value.getVelocity()\n })\n\n return state\n}\n\nexport function resolveVariantFromProps(\n props: MotionNodeOptions,\n definition: TargetAndTransition | TargetResolver,\n custom?: any,\n visualElement?: any\n): TargetAndTransition\nexport function resolveVariantFromProps(\n props: MotionNodeOptions,\n definition?: AnimationDefinition,\n custom?: any,\n visualElement?: any\n): undefined | TargetAndTransition\nexport function resolveVariantFromProps(\n props: MotionNodeOptions,\n definition?: AnimationDefinition,\n custom?: any,\n visualElement?: any\n) {\n /**\n * If the variant definition is a function, resolve.\n */\n if (typeof definition === \"function\") {\n const [current, velocity] = getValueState(visualElement)\n definition = definition(\n custom !== undefined ? custom : props.custom,\n current,\n velocity\n )\n }\n\n /**\n * If the variant definition is a variant label, or\n * the function returned a variant label, resolve.\n */\n if (typeof definition === \"string\") {\n definition = props.variants && props.variants[definition]\n }\n\n /**\n * At this point we've resolved both functions and variant labels,\n * but the resolved variant label might itself have been a function.\n * If so, resolve. This can only have returned a valid target object.\n */\n if (typeof definition === \"function\") {\n const [current, velocity] = getValueState(visualElement)\n definition = definition(\n custom !== undefined ? custom : props.custom,\n current,\n velocity\n )\n }\n\n return definition\n}\n"],"names":[],"mappings":"AAQA,SAAS,aAAa,CAAC,aAAmB,EAAA;AACtC,IAAA,MAAM,KAAK,GAAqC,CAAC,EAAE,EAAE,EAAE,CAAC;IAExD,aAAa,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,KAAU,EAAE,GAAW,KAAI;QACtD,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,EAAE;QAC3B,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,WAAW,EAAE;AACvC,IAAA,CAAC,CAAC;AAEF,IAAA,OAAO,KAAK;AAChB;AAcM,SAAU,uBAAuB,CACnC,KAAwB,EACxB,UAAgC,EAChC,MAAY,EACZ,aAAmB,EAAA;AAEnB;;AAEG;AACH,IAAA,IAAI,OAAO,UAAU,KAAK,UAAU,EAAE;QAClC,MAAM,CAAC,OAAO,EAAE,QAAQ,CAAC,GAAG,aAAa,CAAC,aAAa,CAAC;QACxD,UAAU,GAAG,UAAU,CACnB,MAAM,KAAK,SAAS,GAAG,MAAM,GAAG,KAAK,CAAC,MAAM,EAC5C,OAAO,EACP,QAAQ,CACX;IACL;AAEA;;;AAGG;AACH,IAAA,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE;QAChC,UAAU,GAAG,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,QAAQ,CAAC,UAAU,CAAC;IAC7D;AAEA;;;;AAIG;AACH,IAAA,IAAI,OAAO,UAAU,KAAK,UAAU,EAAE;QAClC,MAAM,CAAC,OAAO,EAAE,QAAQ,CAAC,GAAG,aAAa,CAAC,aAAa,CAAC;QACxD,UAAU,GAAG,UAAU,CACnB,MAAM,KAAK,SAAS,GAAG,MAAM,GAAG,KAAK,CAAC,MAAM,EAC5C,OAAO,EACP,QAAQ,CACX;IACL;AAEA,IAAA,OAAO,UAAU;AACrB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/utils/setters.mjs b/node_modules/motion-dom/dist/es/render/utils/setters.mjs new file mode 100644 index 0000000..9c94d6e --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/utils/setters.mjs @@ -0,0 +1,32 @@ +import { motionValue } from '../../value/index.mjs'; +import { resolveVariant } from './resolve-dynamic-variants.mjs'; +import { isKeyframesTarget } from './is-keyframes-target.mjs'; + +/** + * Set VisualElement's MotionValue, creating a new MotionValue for it if + * it doesn't exist. + */ +function setMotionValue(visualElement, key, value) { + if (visualElement.hasValue(key)) { + visualElement.getValue(key).set(value); + } + else { + visualElement.addValue(key, motionValue(value)); + } +} +function resolveFinalValueInKeyframes(v) { + // TODO maybe throw if v.length - 1 is placeholder token? + return isKeyframesTarget(v) ? v[v.length - 1] || 0 : v; +} +function setTarget(visualElement, definition) { + const resolved = resolveVariant(visualElement, definition); + let { transitionEnd = {}, transition = {}, ...target } = resolved || {}; + target = { ...target, ...transitionEnd }; + for (const key in target) { + const value = resolveFinalValueInKeyframes(target[key]); + setMotionValue(visualElement, key, value); + } +} + +export { setTarget }; +//# sourceMappingURL=setters.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/utils/setters.mjs.map b/node_modules/motion-dom/dist/es/render/utils/setters.mjs.map new file mode 100644 index 0000000..c7e9915 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/utils/setters.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"setters.mjs","sources":["../../../../src/render/utils/setters.ts"],"sourcesContent":["import { motionValue } from \"../../value\"\nimport { resolveVariant } from \"./resolve-dynamic-variants\"\nimport { isKeyframesTarget } from \"./is-keyframes-target\"\nimport type { AnimationDefinition } from \"../../node/types\"\nimport type {\n AnyResolvedKeyframe,\n UnresolvedValueKeyframe,\n ValueKeyframesDefinition,\n} from \"../../animation/types\"\nimport type { VisualElement } from \"../VisualElement\"\n\n/**\n * Set VisualElement's MotionValue, creating a new MotionValue for it if\n * it doesn't exist.\n */\nfunction setMotionValue(\n visualElement: VisualElement,\n key: string,\n value: AnyResolvedKeyframe\n) {\n if (visualElement.hasValue(key)) {\n visualElement.getValue(key)!.set(value)\n } else {\n visualElement.addValue(key, motionValue(value))\n }\n}\n\nfunction resolveFinalValueInKeyframes(\n v: ValueKeyframesDefinition\n): UnresolvedValueKeyframe {\n // TODO maybe throw if v.length - 1 is placeholder token?\n return isKeyframesTarget(v) ? v[v.length - 1] || 0 : v\n}\n\nexport function setTarget(\n visualElement: VisualElement,\n definition: AnimationDefinition\n) {\n const resolved = resolveVariant(visualElement, definition)\n let { transitionEnd = {}, transition = {}, ...target } = resolved || {}\n\n target = { ...target, ...transitionEnd }\n\n for (const key in target) {\n const value = resolveFinalValueInKeyframes(\n target[key as keyof typeof target] as any\n )\n setMotionValue(visualElement, key, value as AnyResolvedKeyframe)\n }\n}\n"],"names":[],"mappings":";;;;AAWA;;;AAGG;AACH,SAAS,cAAc,CACnB,aAA4B,EAC5B,GAAW,EACX,KAA0B,EAAA;AAE1B,IAAA,IAAI,aAAa,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;QAC7B,aAAa,CAAC,QAAQ,CAAC,GAAG,CAAE,CAAC,GAAG,CAAC,KAAK,CAAC;IAC3C;SAAO;QACH,aAAa,CAAC,QAAQ,CAAC,GAAG,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;IACnD;AACJ;AAEA,SAAS,4BAA4B,CACjC,CAA2B,EAAA;;IAG3B,OAAO,iBAAiB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;AAC1D;AAEM,SAAU,SAAS,CACrB,aAA4B,EAC5B,UAA+B,EAAA;IAE/B,MAAM,QAAQ,GAAG,cAAc,CAAC,aAAa,EAAE,UAAU,CAAC;AAC1D,IAAA,IAAI,EAAE,aAAa,GAAG,EAAE,EAAE,UAAU,GAAG,EAAE,EAAE,GAAG,MAAM,EAAE,GAAG,QAAQ,IAAI,EAAE;IAEvE,MAAM,GAAG,EAAE,GAAG,MAAM,EAAE,GAAG,aAAa,EAAE;AAExC,IAAA,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE;QACtB,MAAM,KAAK,GAAG,4BAA4B,CACtC,MAAM,CAAC,GAA0B,CAAQ,CAC5C;AACD,QAAA,cAAc,CAAC,aAAa,EAAE,GAAG,EAAE,KAA4B,CAAC;IACpE;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/utils/shallow-compare.mjs b/node_modules/motion-dom/dist/es/render/utils/shallow-compare.mjs new file mode 100644 index 0000000..a6bf308 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/utils/shallow-compare.mjs @@ -0,0 +1,15 @@ +function shallowCompare(next, prev) { + if (!Array.isArray(prev)) + return false; + const prevLength = prev.length; + if (prevLength !== next.length) + return false; + for (let i = 0; i < prevLength; i++) { + if (prev[i] !== next[i]) + return false; + } + return true; +} + +export { shallowCompare }; +//# sourceMappingURL=shallow-compare.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/utils/shallow-compare.mjs.map b/node_modules/motion-dom/dist/es/render/utils/shallow-compare.mjs.map new file mode 100644 index 0000000..a76ba4e --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/utils/shallow-compare.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"shallow-compare.mjs","sources":["../../../../src/render/utils/shallow-compare.ts"],"sourcesContent":["export function shallowCompare(next: any[], prev: any[] | null) {\n if (!Array.isArray(prev)) return false\n\n const prevLength = prev.length\n\n if (prevLength !== next.length) return false\n\n for (let i = 0; i < prevLength; i++) {\n if (prev[i] !== next[i]) return false\n }\n\n return true\n}\n"],"names":[],"mappings":"AAAM,SAAU,cAAc,CAAC,IAAW,EAAE,IAAkB,EAAA;AAC1D,IAAA,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;AAAE,QAAA,OAAO,KAAK;AAEtC,IAAA,MAAM,UAAU,GAAG,IAAI,CAAC,MAAM;AAE9B,IAAA,IAAI,UAAU,KAAK,IAAI,CAAC,MAAM;AAAE,QAAA,OAAO,KAAK;AAE5C,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,EAAE,CAAC,EAAE,EAAE;QACjC,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC;AAAE,YAAA,OAAO,KAAK;IACzC;AAEA,IAAA,OAAO,IAAI;AACf;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/utils/variant-props.mjs b/node_modules/motion-dom/dist/es/render/utils/variant-props.mjs new file mode 100644 index 0000000..56a3899 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/utils/variant-props.mjs @@ -0,0 +1,13 @@ +const variantPriorityOrder = [ + "animate", + "whileInView", + "whileFocus", + "whileHover", + "whileTap", + "whileDrag", + "exit", +]; +const variantProps = ["initial", ...variantPriorityOrder]; + +export { variantPriorityOrder, variantProps }; +//# sourceMappingURL=variant-props.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/utils/variant-props.mjs.map b/node_modules/motion-dom/dist/es/render/utils/variant-props.mjs.map new file mode 100644 index 0000000..86915c1 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/utils/variant-props.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"variant-props.mjs","sources":["../../../../src/render/utils/variant-props.ts"],"sourcesContent":["import type { AnimationType } from \"../types\"\n\nexport const variantPriorityOrder: AnimationType[] = [\n \"animate\",\n \"whileInView\",\n \"whileFocus\",\n \"whileHover\",\n \"whileTap\",\n \"whileDrag\",\n \"exit\",\n]\n\nexport const variantProps = [\"initial\", ...variantPriorityOrder]\n"],"names":[],"mappings":"AAEO,MAAM,oBAAoB,GAAoB;IACjD,SAAS;IACT,aAAa;IACb,YAAY;IACZ,YAAY;IACZ,UAAU;IACV,WAAW;IACX,MAAM;;AAGH,MAAM,YAAY,GAAG,CAAC,SAAS,EAAE,GAAG,oBAAoB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/resize/handle-element.mjs b/node_modules/motion-dom/dist/es/resize/handle-element.mjs new file mode 100644 index 0000000..7b4abe3 --- /dev/null +++ b/node_modules/motion-dom/dist/es/resize/handle-element.mjs @@ -0,0 +1,64 @@ +import { isSVGElement } from '../utils/is-svg-element.mjs'; +import { resolveElements } from '../utils/resolve-elements.mjs'; + +const resizeHandlers = new WeakMap(); +let observer; +const getSize = (borderBoxAxis, svgAxis, htmlAxis) => (target, borderBoxSize) => { + if (borderBoxSize && borderBoxSize[0]) { + return borderBoxSize[0][(borderBoxAxis + "Size")]; + } + else if (isSVGElement(target) && "getBBox" in target) { + return target.getBBox()[svgAxis]; + } + else { + return target[htmlAxis]; + } +}; +const getWidth = /*@__PURE__*/ getSize("inline", "width", "offsetWidth"); +const getHeight = /*@__PURE__*/ getSize("block", "height", "offsetHeight"); +function notifyTarget({ target, borderBoxSize }) { + resizeHandlers.get(target)?.forEach((handler) => { + handler(target, { + get width() { + return getWidth(target, borderBoxSize); + }, + get height() { + return getHeight(target, borderBoxSize); + }, + }); + }); +} +function notifyAll(entries) { + entries.forEach(notifyTarget); +} +function createResizeObserver() { + if (typeof ResizeObserver === "undefined") + return; + observer = new ResizeObserver(notifyAll); +} +function resizeElement(target, handler) { + if (!observer) + createResizeObserver(); + const elements = resolveElements(target); + elements.forEach((element) => { + let elementHandlers = resizeHandlers.get(element); + if (!elementHandlers) { + elementHandlers = new Set(); + resizeHandlers.set(element, elementHandlers); + } + elementHandlers.add(handler); + observer?.observe(element); + }); + return () => { + elements.forEach((element) => { + const elementHandlers = resizeHandlers.get(element); + elementHandlers?.delete(handler); + if (!elementHandlers?.size) { + observer?.unobserve(element); + } + }); + }; +} + +export { resizeElement }; +//# sourceMappingURL=handle-element.mjs.map diff --git a/node_modules/motion-dom/dist/es/resize/handle-element.mjs.map b/node_modules/motion-dom/dist/es/resize/handle-element.mjs.map new file mode 100644 index 0000000..b86aac0 --- /dev/null +++ b/node_modules/motion-dom/dist/es/resize/handle-element.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"handle-element.mjs","sources":["../../../src/resize/handle-element.ts"],"sourcesContent":["import { isSVGElement } from \"../utils/is-svg-element\"\nimport { ElementOrSelector, resolveElements } from \"../utils/resolve-elements\"\nimport { ResizeHandler } from \"./types\"\n\nconst resizeHandlers = new WeakMap>>()\n\nlet observer: ResizeObserver | undefined\n\nconst getSize =\n (\n borderBoxAxis: \"inline\" | \"block\",\n svgAxis: \"width\" | \"height\",\n htmlAxis: \"offsetWidth\" | \"offsetHeight\"\n ) =>\n (target: Element, borderBoxSize?: ReadonlyArray) => {\n if (borderBoxSize && borderBoxSize[0]) {\n return borderBoxSize[0][\n (borderBoxAxis + \"Size\") as keyof ResizeObserverSize\n ]\n } else if (isSVGElement(target) && \"getBBox\" in target) {\n return (target as SVGGraphicsElement).getBBox()[svgAxis]\n } else {\n return (target as HTMLElement)[htmlAxis]\n }\n }\n\nconst getWidth = /*@__PURE__*/ getSize(\"inline\", \"width\", \"offsetWidth\")\nconst getHeight = /*@__PURE__*/ getSize(\"block\", \"height\", \"offsetHeight\")\n\nfunction notifyTarget({ target, borderBoxSize }: ResizeObserverEntry) {\n resizeHandlers.get(target)?.forEach((handler) => {\n handler(target, {\n get width() {\n return getWidth(target, borderBoxSize)\n },\n get height() {\n return getHeight(target, borderBoxSize)\n },\n })\n })\n}\n\nfunction notifyAll(entries: ResizeObserverEntry[]) {\n entries.forEach(notifyTarget)\n}\n\nfunction createResizeObserver() {\n if (typeof ResizeObserver === \"undefined\") return\n\n observer = new ResizeObserver(notifyAll)\n}\n\nexport function resizeElement(\n target: ElementOrSelector,\n handler: ResizeHandler\n) {\n if (!observer) createResizeObserver()\n\n const elements = resolveElements(target)\n\n elements.forEach((element) => {\n let elementHandlers = resizeHandlers.get(element)\n\n if (!elementHandlers) {\n elementHandlers = new Set()\n resizeHandlers.set(element, elementHandlers)\n }\n\n elementHandlers.add(handler)\n observer?.observe(element)\n })\n\n return () => {\n elements.forEach((element) => {\n const elementHandlers = resizeHandlers.get(element)\n\n elementHandlers?.delete(handler)\n\n if (!elementHandlers?.size) {\n observer?.unobserve(element)\n }\n })\n }\n}\n"],"names":[],"mappings":";;;AAIA,MAAM,cAAc,GAAG,IAAI,OAAO,EAAwC;AAE1E,IAAI,QAAoC;AAExC,MAAM,OAAO,GACT,CACI,aAAiC,EACjC,OAA2B,EAC3B,QAAwC,KAE5C,CAAC,MAAe,EAAE,aAAiD,KAAI;AACnE,IAAA,IAAI,aAAa,IAAI,aAAa,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,eAAe,CAAC,MAAM,CAAC;AAExC,IAAA,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,KAAI;QACzB,IAAI,eAAe,GAAG,cAAc,CAAC,GAAG,CAAC,OAAO,CAAC;QAEjD,IAAI,CAAC,eAAe,EAAE;AAClB,YAAA,eAAe,GAAG,IAAI,GAAG,EAAE;AAC3B,YAAA,cAAc,CAAC,GAAG,CAAC,OAAO,EAAE,eAAe,CAAC;QAChD;AAEA,QAAA,eAAe,CAAC,GAAG,CAAC,OAAO,CAAC;AAC5B,QAAA,QAAQ,EAAE,OAAO,CAAC,OAAO,CAAC;AAC9B,IAAA,CAAC,CAAC;AAEF,IAAA,OAAO,MAAK;AACR,QAAA,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,KAAI;YACzB,MAAM,eAAe,GAAG,cAAc,CAAC,GAAG,CAAC,OAAO,CAAC;AAEnD,YAAA,eAAe,EAAE,MAAM,CAAC,OAAO,CAAC;AAEhC,YAAA,IAAI,CAAC,eAAe,EAAE,IAAI,EAAE;AACxB,gBAAA,QAAQ,EAAE,SAAS,CAAC,OAAO,CAAC;YAChC;AACJ,QAAA,CAAC,CAAC;AACN,IAAA,CAAC;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/resize/handle-window.mjs b/node_modules/motion-dom/dist/es/resize/handle-window.mjs new file mode 100644 index 0000000..cdc8977 --- /dev/null +++ b/node_modules/motion-dom/dist/es/resize/handle-window.mjs @@ -0,0 +1,32 @@ +const windowCallbacks = new Set(); +let windowResizeHandler; +function createWindowResizeHandler() { + windowResizeHandler = () => { + const info = { + get width() { + return window.innerWidth; + }, + get height() { + return window.innerHeight; + }, + }; + windowCallbacks.forEach((callback) => callback(info)); + }; + window.addEventListener("resize", windowResizeHandler); +} +function resizeWindow(callback) { + windowCallbacks.add(callback); + if (!windowResizeHandler) + createWindowResizeHandler(); + return () => { + windowCallbacks.delete(callback); + if (!windowCallbacks.size && + typeof windowResizeHandler === "function") { + window.removeEventListener("resize", windowResizeHandler); + windowResizeHandler = undefined; + } + }; +} + +export { resizeWindow }; +//# sourceMappingURL=handle-window.mjs.map diff --git a/node_modules/motion-dom/dist/es/resize/handle-window.mjs.map b/node_modules/motion-dom/dist/es/resize/handle-window.mjs.map new file mode 100644 index 0000000..59fb9b6 --- /dev/null +++ b/node_modules/motion-dom/dist/es/resize/handle-window.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"handle-window.mjs","sources":["../../../src/resize/handle-window.ts"],"sourcesContent":["import { WindowResizeHandler } from \"./types\"\n\nconst windowCallbacks = new Set()\n\nlet windowResizeHandler: VoidFunction | undefined\n\nfunction createWindowResizeHandler() {\n windowResizeHandler = () => {\n const info = {\n get width() {\n return window.innerWidth\n },\n get height() {\n return window.innerHeight\n },\n }\n\n windowCallbacks.forEach((callback) => callback(info))\n }\n\n window.addEventListener(\"resize\", windowResizeHandler)\n}\n\nexport function resizeWindow(callback: WindowResizeHandler) {\n windowCallbacks.add(callback)\n\n if (!windowResizeHandler) createWindowResizeHandler()\n\n return () => {\n windowCallbacks.delete(callback)\n\n if (\n !windowCallbacks.size &&\n typeof windowResizeHandler === \"function\"\n ) {\n window.removeEventListener(\"resize\", windowResizeHandler)\n windowResizeHandler = undefined\n }\n }\n}\n"],"names":[],"mappings":"AAEA,MAAM,eAAe,GAAG,IAAI,GAAG,EAAuB;AAEtD,IAAI,mBAA6C;AAEjD,SAAS,yBAAyB,GAAA;IAC9B,mBAAmB,GAAG,MAAK;AACvB,QAAA,MAAM,IAAI,GAAG;AACT,YAAA,IAAI,KAAK,GAAA;gBACL,OAAO,MAAM,CAAC,UAAU;YAC5B,CAAC;AACD,YAAA,IAAI,MAAM,GAAA;gBACN,OAAO,MAAM,CAAC,WAAW;YAC7B,CAAC;SACJ;AAED,QAAA,eAAe,CAAC,OAAO,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC,IAAI,CAAC,CAAC;AACzD,IAAA,CAAC;AAED,IAAA,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,mBAAmB,CAAC;AAC1D;AAEM,SAAU,YAAY,CAAC,QAA6B,EAAA;AACtD,IAAA,eAAe,CAAC,GAAG,CAAC,QAAQ,CAAC;AAE7B,IAAA,IAAI,CAAC,mBAAmB;AAAE,QAAA,yBAAyB,EAAE;AAErD,IAAA,OAAO,MAAK;AACR,QAAA,eAAe,CAAC,MAAM,CAAC,QAAQ,CAAC;QAEhC,IACI,CAAC,eAAe,CAAC,IAAI;AACrB,YAAA,OAAO,mBAAmB,KAAK,UAAU,EAC3C;AACE,YAAA,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,mBAAmB,CAAC;YACzD,mBAAmB,GAAG,SAAS;QACnC;AACJ,IAAA,CAAC;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/resize/index.mjs b/node_modules/motion-dom/dist/es/resize/index.mjs new file mode 100644 index 0000000..5d871a6 --- /dev/null +++ b/node_modules/motion-dom/dist/es/resize/index.mjs @@ -0,0 +1,9 @@ +import { resizeElement } from './handle-element.mjs'; +import { resizeWindow } from './handle-window.mjs'; + +function resize(a, b) { + return typeof a === "function" ? resizeWindow(a) : resizeElement(a, b); +} + +export { resize }; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/motion-dom/dist/es/resize/index.mjs.map b/node_modules/motion-dom/dist/es/resize/index.mjs.map new file mode 100644 index 0000000..5622721 --- /dev/null +++ b/node_modules/motion-dom/dist/es/resize/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../../../src/resize/index.ts"],"sourcesContent":["import { ElementOrSelector } from \"../utils/resolve-elements\"\nimport { resizeElement } from \"./handle-element\"\nimport { resizeWindow } from \"./handle-window\"\nimport { ResizeHandler, WindowResizeHandler } from \"./types\"\n\nexport function resize(onResize: WindowResizeHandler): VoidFunction\nexport function resize(\n target: ElementOrSelector,\n onResize: ResizeHandler\n): VoidFunction\nexport function resize(\n a: WindowResizeHandler | ElementOrSelector,\n b?: ResizeHandler\n) {\n return typeof a === \"function\" ? resizeWindow(a) : resizeElement(a, b!)\n}\n"],"names":[],"mappings":";;;AAUM,SAAU,MAAM,CAClB,CAA0C,EAC1C,CAA0B,EAAA;IAE1B,OAAO,OAAO,CAAC,KAAK,UAAU,GAAG,YAAY,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,EAAE,CAAE,CAAC;AAC3E;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/scroll/observe.mjs b/node_modules/motion-dom/dist/es/scroll/observe.mjs new file mode 100644 index 0000000..52c4a84 --- /dev/null +++ b/node_modules/motion-dom/dist/es/scroll/observe.mjs @@ -0,0 +1,19 @@ +import { frame, cancelFrame } from '../frameloop/frame.mjs'; + +function observeTimeline(update, timeline) { + let prevProgress; + const onFrame = () => { + const { currentTime } = timeline; + const percentage = currentTime === null ? 0 : currentTime.value; + const progress = percentage / 100; + if (prevProgress !== progress) { + update(progress); + } + prevProgress = progress; + }; + frame.preUpdate(onFrame, true); + return () => cancelFrame(onFrame); +} + +export { observeTimeline }; +//# sourceMappingURL=observe.mjs.map diff --git a/node_modules/motion-dom/dist/es/scroll/observe.mjs.map b/node_modules/motion-dom/dist/es/scroll/observe.mjs.map new file mode 100644 index 0000000..3af2572 --- /dev/null +++ b/node_modules/motion-dom/dist/es/scroll/observe.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"observe.mjs","sources":["../../../src/scroll/observe.ts"],"sourcesContent":["import { ProgressTimeline } from \"../animation/types\"\nimport { cancelFrame, frame } from \"../frameloop\"\n\ntype Update = (progress: number) => void\n\nexport function observeTimeline(update: Update, timeline: ProgressTimeline) {\n let prevProgress: number\n\n const onFrame = () => {\n const { currentTime } = timeline\n const percentage = currentTime === null ? 0 : currentTime.value\n const progress = percentage / 100\n\n if (prevProgress !== progress) {\n update(progress)\n }\n\n prevProgress = progress\n }\n\n frame.preUpdate(onFrame, true)\n\n return () => cancelFrame(onFrame)\n}\n"],"names":[],"mappings":";;AAKM,SAAU,eAAe,CAAC,MAAc,EAAE,QAA0B,EAAA;AACtE,IAAA,IAAI,YAAoB;IAExB,MAAM,OAAO,GAAG,MAAK;AACjB,QAAA,MAAM,EAAE,WAAW,EAAE,GAAG,QAAQ;AAChC,QAAA,MAAM,UAAU,GAAG,WAAW,KAAK,IAAI,GAAG,CAAC,GAAG,WAAW,CAAC,KAAK;AAC/D,QAAA,MAAM,QAAQ,GAAG,UAAU,GAAG,GAAG;AAEjC,QAAA,IAAI,YAAY,KAAK,QAAQ,EAAE;YAC3B,MAAM,CAAC,QAAQ,CAAC;QACpB;QAEA,YAAY,GAAG,QAAQ;AAC3B,IAAA,CAAC;AAED,IAAA,KAAK,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,CAAC;AAE9B,IAAA,OAAO,MAAM,WAAW,CAAC,OAAO,CAAC;AACrC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/stats/buffer.mjs b/node_modules/motion-dom/dist/es/stats/buffer.mjs new file mode 100644 index 0000000..6349d90 --- /dev/null +++ b/node_modules/motion-dom/dist/es/stats/buffer.mjs @@ -0,0 +1,7 @@ +const statsBuffer = { + value: null, + addProjectionMetrics: null, +}; + +export { statsBuffer }; +//# sourceMappingURL=buffer.mjs.map diff --git a/node_modules/motion-dom/dist/es/stats/buffer.mjs.map b/node_modules/motion-dom/dist/es/stats/buffer.mjs.map new file mode 100644 index 0000000..9863699 --- /dev/null +++ b/node_modules/motion-dom/dist/es/stats/buffer.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"buffer.mjs","sources":["../../../src/stats/buffer.ts"],"sourcesContent":["import type { LayoutProjectionMetrics, StatsRecording } from \"./types\"\n\nexport type InactiveStatsBuffer = {\n value: null\n addProjectionMetrics: null\n}\n\nexport type ActiveStatsBuffer = {\n value: StatsRecording\n addProjectionMetrics: (metrics: LayoutProjectionMetrics) => void\n}\n\nexport const statsBuffer: InactiveStatsBuffer | ActiveStatsBuffer = {\n value: null,\n addProjectionMetrics: null,\n}\n"],"names":[],"mappings":"AAYO,MAAM,WAAW,GAA4C;AAChE,IAAA,KAAK,EAAE,IAAI;AACX,IAAA,oBAAoB,EAAE,IAAI;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/stats/index.mjs b/node_modules/motion-dom/dist/es/stats/index.mjs new file mode 100644 index 0000000..9a78f93 --- /dev/null +++ b/node_modules/motion-dom/dist/es/stats/index.mjs @@ -0,0 +1,29 @@ +import { statsBuffer } from './buffer.mjs'; + +function clearStatsBuffer() { + statsBuffer.value = null; + statsBuffer.addProjectionMetrics = null; +} +function recordStats() { + if (statsBuffer.value) { + clearStatsBuffer(); + throw new Error("Stats are already being measured"); + } + const buffer = statsBuffer; + buffer.value = { + layoutProjection: { + nodes: [], + calculatedTargetDeltas: [], + calculatedProjections: [], + }, + }; + buffer.addProjectionMetrics = (metrics) => { + const { layoutProjection } = buffer.value; + layoutProjection.nodes.push(metrics.nodes); + layoutProjection.calculatedTargetDeltas.push(metrics.calculatedTargetDeltas); + layoutProjection.calculatedProjections.push(metrics.calculatedProjections); + }; +} + +export { recordStats }; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/motion-dom/dist/es/stats/index.mjs.map b/node_modules/motion-dom/dist/es/stats/index.mjs.map new file mode 100644 index 0000000..7b45403 --- /dev/null +++ b/node_modules/motion-dom/dist/es/stats/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../../../src/stats/index.ts"],"sourcesContent":["import { ActiveStatsBuffer, statsBuffer } from \"./buffer\"\n\nfunction clearStatsBuffer() {\n statsBuffer.value = null\n statsBuffer.addProjectionMetrics = null\n}\n\nexport function recordStats() {\n if (statsBuffer.value) {\n clearStatsBuffer()\n throw new Error(\"Stats are already being measured\")\n }\n\n const buffer = statsBuffer as unknown as ActiveStatsBuffer\n\n buffer.value = {\n layoutProjection: {\n nodes: [],\n calculatedTargetDeltas: [],\n calculatedProjections: [],\n },\n }\n\n buffer.addProjectionMetrics = (metrics) => {\n const { layoutProjection } = buffer.value\n layoutProjection.nodes.push(metrics.nodes)\n layoutProjection.calculatedTargetDeltas.push(\n metrics.calculatedTargetDeltas\n )\n layoutProjection.calculatedProjections.push(\n metrics.calculatedProjections\n )\n }\n}\n"],"names":[],"mappings":";;AAEA,SAAS,gBAAgB,GAAA;AACrB,IAAA,WAAW,CAAC,KAAK,GAAG,IAAI;AACxB,IAAA,WAAW,CAAC,oBAAoB,GAAG,IAAI;AAC3C;SAEgB,WAAW,GAAA;AACvB,IAAA,IAAI,WAAW,CAAC,KAAK,EAAE;AACnB,QAAA,gBAAgB,EAAE;AAClB,QAAA,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC;IACvD;IAEA,MAAM,MAAM,GAAG,WAA2C;IAE1D,MAAM,CAAC,KAAK,GAAG;AACX,QAAA,gBAAgB,EAAE;AACd,YAAA,KAAK,EAAE,EAAE;AACT,YAAA,sBAAsB,EAAE,EAAE;AAC1B,YAAA,qBAAqB,EAAE,EAAE;AAC5B,SAAA;KACJ;AAED,IAAA,MAAM,CAAC,oBAAoB,GAAG,CAAC,OAAO,KAAI;AACtC,QAAA,MAAM,EAAE,gBAAgB,EAAE,GAAG,MAAM,CAAC,KAAK;QACzC,gBAAgB,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;QAC1C,gBAAgB,CAAC,sBAAsB,CAAC,IAAI,CACxC,OAAO,CAAC,sBAAsB,CACjC;QACD,gBAAgB,CAAC,qBAAqB,CAAC,IAAI,CACvC,OAAO,CAAC,qBAAqB,CAChC;AACL,IAAA,CAAC;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/utils/border-radius.mjs b/node_modules/motion-dom/dist/es/utils/border-radius.mjs new file mode 100644 index 0000000..8fc6f60 --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/border-radius.mjs @@ -0,0 +1,15 @@ +/** + * The four corner-radius longhands. Shared so the projection mixer, scale + * corrector, WAAPI px-value set and view-transition crop pass don't each carry + * their own copy. Order is irrelevant - every consumer mixes/corrects/animates + * each corner independently. + */ +const cornerRadiusProps = [ + "borderTopLeftRadius", + "borderTopRightRadius", + "borderBottomRightRadius", + "borderBottomLeftRadius", +]; + +export { cornerRadiusProps }; +//# sourceMappingURL=border-radius.mjs.map diff --git a/node_modules/motion-dom/dist/es/utils/border-radius.mjs.map b/node_modules/motion-dom/dist/es/utils/border-radius.mjs.map new file mode 100644 index 0000000..485e22b --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/border-radius.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"border-radius.mjs","sources":["../../../src/utils/border-radius.ts"],"sourcesContent":["/**\n * The four corner-radius longhands. Shared so the projection mixer, scale\n * corrector, WAAPI px-value set and view-transition crop pass don't each carry\n * their own copy. Order is irrelevant - every consumer mixes/corrects/animates\n * each corner independently.\n */\nexport const cornerRadiusProps = [\n \"borderTopLeftRadius\",\n \"borderTopRightRadius\",\n \"borderBottomRightRadius\",\n \"borderBottomLeftRadius\",\n] as const\n"],"names":[],"mappings":"AAAA;;;;;AAKG;AACI,MAAM,iBAAiB,GAAG;IAC7B,qBAAqB;IACrB,sBAAsB;IACtB,yBAAyB;IACzB,wBAAwB;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/utils/delay.mjs b/node_modules/motion-dom/dist/es/utils/delay.mjs new file mode 100644 index 0000000..55bfdf8 --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/delay.mjs @@ -0,0 +1,25 @@ +import { time } from '../frameloop/sync-time.mjs'; +import { secondsToMilliseconds } from 'motion-utils'; +import { frame, cancelFrame } from '../frameloop/frame.mjs'; + +/** + * Timeout defined in ms + */ +function delay(callback, timeout) { + const start = time.now(); + const checkElapsed = ({ timestamp }) => { + const elapsed = timestamp - start; + if (elapsed >= timeout) { + cancelFrame(checkElapsed); + callback(elapsed - timeout); + } + }; + frame.setup(checkElapsed, true); + return () => cancelFrame(checkElapsed); +} +function delayInSeconds(callback, timeout) { + return delay(callback, secondsToMilliseconds(timeout)); +} + +export { delay, delayInSeconds }; +//# sourceMappingURL=delay.mjs.map diff --git a/node_modules/motion-dom/dist/es/utils/delay.mjs.map b/node_modules/motion-dom/dist/es/utils/delay.mjs.map new file mode 100644 index 0000000..7520457 --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/delay.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"delay.mjs","sources":["../../../src/utils/delay.ts"],"sourcesContent":["import { cancelFrame, frame } from \"../frameloop\"\nimport { time } from \"../frameloop/sync-time\"\nimport type { FrameData } from \"../frameloop/types\"\nimport { secondsToMilliseconds } from \"motion-utils\"\n\nexport type DelayedFunction = (overshoot: number) => void\n\n/**\n * Timeout defined in ms\n */\nexport function delay(callback: DelayedFunction, timeout: number) {\n const start = time.now()\n\n const checkElapsed = ({ timestamp }: FrameData) => {\n const elapsed = timestamp - start\n\n if (elapsed >= timeout) {\n cancelFrame(checkElapsed)\n callback(elapsed - timeout)\n }\n }\n\n frame.setup(checkElapsed, true)\n\n return () => cancelFrame(checkElapsed)\n}\n\nexport function delayInSeconds(callback: DelayedFunction, timeout: number) {\n return delay(callback, secondsToMilliseconds(timeout))\n}\n"],"names":[],"mappings":";;;;AAOA;;AAEG;AACG,SAAU,KAAK,CAAC,QAAyB,EAAE,OAAe,EAAA;AAC5D,IAAA,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,EAAE;AAExB,IAAA,MAAM,YAAY,GAAG,CAAC,EAAE,SAAS,EAAa,KAAI;AAC9C,QAAA,MAAM,OAAO,GAAG,SAAS,GAAG,KAAK;AAEjC,QAAA,IAAI,OAAO,IAAI,OAAO,EAAE;YACpB,WAAW,CAAC,YAAY,CAAC;AACzB,YAAA,QAAQ,CAAC,OAAO,GAAG,OAAO,CAAC;QAC/B;AACJ,IAAA,CAAC;AAED,IAAA,KAAK,CAAC,KAAK,CAAC,YAAY,EAAE,IAAI,CAAC;AAE/B,IAAA,OAAO,MAAM,WAAW,CAAC,YAAY,CAAC;AAC1C;AAEM,SAAU,cAAc,CAAC,QAAyB,EAAE,OAAe,EAAA;IACrE,OAAO,KAAK,CAAC,QAAQ,EAAE,qBAAqB,CAAC,OAAO,CAAC,CAAC;AAC1D;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/utils/interpolate.mjs b/node_modules/motion-dom/dist/es/utils/interpolate.mjs new file mode 100644 index 0000000..a7260c7 --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/interpolate.mjs @@ -0,0 +1,75 @@ +import { invariant, clamp, MotionGlobalConfig, noop, pipe, progress } from 'motion-utils'; +import { mix } from './mix/index.mjs'; + +function createMixers(output, ease, customMixer) { + const mixers = []; + const mixerFactory = customMixer || MotionGlobalConfig.mix || mix; + const numMixers = output.length - 1; + for (let i = 0; i < numMixers; i++) { + let mixer = mixerFactory(output[i], output[i + 1]); + if (ease) { + const easingFunction = Array.isArray(ease) ? ease[i] || noop : ease; + mixer = pipe(easingFunction, mixer); + } + mixers.push(mixer); + } + return mixers; +} +/** + * Create a function that maps from a numerical input array to a generic output array. + * + * Accepts: + * - Numbers + * - Colors (hex, hsl, hsla, rgb, rgba) + * - Complex (combinations of one or more numbers or strings) + * + * ```jsx + * const mixColor = interpolate([0, 1], ['#fff', '#000']) + * + * mixColor(0.5) // 'rgba(128, 128, 128, 1)' + * ``` + * + * TODO Revisit this approach once we've moved to data models for values, + * probably not needed to pregenerate mixer functions. + * + * @public + */ +function interpolate(input, output, { clamp: isClamp = true, ease, mixer } = {}) { + const inputLength = input.length; + invariant(inputLength === output.length, "Both input and output ranges must be the same length", "range-length"); + /** + * If we're only provided a single input, we can just make a function + * that returns the output. + */ + if (inputLength === 1) + return () => output[0]; + if (inputLength === 2 && output[0] === output[1]) + return () => output[1]; + const isZeroDeltaRange = input[0] === input[1]; + // If input runs highest -> lowest, reverse both arrays + if (input[0] > input[inputLength - 1]) { + input = [...input].reverse(); + output = [...output].reverse(); + } + const mixers = createMixers(output, ease, mixer); + const numMixers = mixers.length; + const interpolator = (v) => { + if (isZeroDeltaRange && v < input[0]) + return output[0]; + let i = 0; + if (numMixers > 1) { + for (; i < input.length - 2; i++) { + if (v < input[i + 1]) + break; + } + } + const progressInRange = progress(input[i], input[i + 1], v); + return mixers[i](progressInRange); + }; + return isClamp + ? (v) => interpolator(clamp(input[0], input[inputLength - 1], v)) + : interpolator; +} + +export { interpolate }; +//# sourceMappingURL=interpolate.mjs.map diff --git a/node_modules/motion-dom/dist/es/utils/interpolate.mjs.map b/node_modules/motion-dom/dist/es/utils/interpolate.mjs.map new file mode 100644 index 0000000..c5dcae1 --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/interpolate.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"interpolate.mjs","sources":["../../../src/utils/interpolate.ts"],"sourcesContent":["import {\n clamp,\n EasingFunction,\n invariant,\n MotionGlobalConfig,\n noop,\n pipe,\n progress,\n} from \"motion-utils\"\nimport { mix } from \"./mix\"\nimport { Mixer, MixerFactory } from \"./mix/types\"\n\nexport interface InterpolateOptions {\n clamp?: boolean\n ease?: EasingFunction | EasingFunction[]\n mixer?: MixerFactory\n}\n\nfunction createMixers(\n output: T[],\n ease?: EasingFunction | EasingFunction[],\n customMixer?: MixerFactory\n) {\n const mixers: Array> = []\n const mixerFactory: MixerFactory =\n customMixer || MotionGlobalConfig.mix || mix\n const numMixers = output.length - 1\n\n for (let i = 0; i < numMixers; i++) {\n let mixer = mixerFactory(output[i], output[i + 1])\n\n if (ease) {\n const easingFunction = Array.isArray(ease) ? ease[i] || noop : ease\n mixer = pipe(easingFunction, mixer) as Mixer\n }\n\n mixers.push(mixer)\n }\n\n return mixers\n}\n\n/**\n * Create a function that maps from a numerical input array to a generic output array.\n *\n * Accepts:\n * - Numbers\n * - Colors (hex, hsl, hsla, rgb, rgba)\n * - Complex (combinations of one or more numbers or strings)\n *\n * ```jsx\n * const mixColor = interpolate([0, 1], ['#fff', '#000'])\n *\n * mixColor(0.5) // 'rgba(128, 128, 128, 1)'\n * ```\n *\n * TODO Revisit this approach once we've moved to data models for values,\n * probably not needed to pregenerate mixer functions.\n *\n * @public\n */\nexport function interpolate(\n input: number[],\n output: T[],\n { clamp: isClamp = true, ease, mixer }: InterpolateOptions = {}\n): (v: number) => T {\n const inputLength = input.length\n\n invariant(\n inputLength === output.length,\n \"Both input and output ranges must be the same length\",\n \"range-length\"\n )\n\n /**\n * If we're only provided a single input, we can just make a function\n * that returns the output.\n */\n if (inputLength === 1) return () => output[0]\n if (inputLength === 2 && output[0] === output[1]) return () => output[1]\n\n const isZeroDeltaRange = input[0] === input[1]\n\n // If input runs highest -> lowest, reverse both arrays\n if (input[0] > input[inputLength - 1]) {\n input = [...input].reverse()\n output = [...output].reverse()\n }\n\n const mixers = createMixers(output, ease, mixer)\n const numMixers = mixers.length\n\n const interpolator = (v: number): T => {\n if (isZeroDeltaRange && v < input[0]) return output[0]\n\n let i = 0\n\n if (numMixers > 1) {\n for (; i < input.length - 2; i++) {\n if (v < input[i + 1]) break\n }\n }\n\n const progressInRange = progress(input[i], input[i + 1], v)\n\n return mixers[i](progressInRange)\n }\n\n return isClamp\n ? (v: number) =>\n interpolator(clamp(input[0], input[inputLength - 1], v))\n : interpolator\n}\n"],"names":[],"mappings":";;;AAkBA,SAAS,YAAY,CACjB,MAAW,EACX,IAAwC,EACxC,WAA6B,EAAA;IAE7B,MAAM,MAAM,GAAoB,EAAE;IAClC,MAAM,YAAY,GACd,WAAW,IAAI,kBAAkB,CAAC,GAAG,IAAI,GAAG;AAChD,IAAA,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,GAAG,CAAC;AAEnC,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,EAAE,CAAC,EAAE,EAAE;AAChC,QAAA,IAAI,KAAK,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QAElD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A,MAAM,YAAY,GAAG,CAAC,CAAS,KAAO;AAClC,QAAA,IAAI,gBAAgB,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC;AAAE,YAAA,OAAO,MAAM,CAAC,CAAC,CAAC;QAEtD,IAAI,CAAC,GAAG,CAAC;AAET,QAAA,IAAI,SAAS,GAAG,CAAC,EAAE;YACf,OAAO,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;AAC9B,gBAAA,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC;oBAAE;YAC1B;QACJ;AAEA,QAAA,MAAM,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;AAE3D,QAAA,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC;AACrC,IAAA,CAAC;AAED,IAAA,OAAO;UACD,CAAC,CAAS,KACN,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,WAAW,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;UAC3D,YAAY;AACtB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/utils/is-html-element.mjs b/node_modules/motion-dom/dist/es/utils/is-html-element.mjs new file mode 100644 index 0000000..9ead44d --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/is-html-element.mjs @@ -0,0 +1,14 @@ +import { isObject } from 'motion-utils'; + +/** + * Checks if an element is an HTML element in a way + * that works across iframes + */ +function isHTMLElement(element) { + return (isObject(element) && + "offsetHeight" in element && + !("ownerSVGElement" in element)); +} + +export { isHTMLElement }; +//# sourceMappingURL=is-html-element.mjs.map diff --git a/node_modules/motion-dom/dist/es/utils/is-html-element.mjs.map b/node_modules/motion-dom/dist/es/utils/is-html-element.mjs.map new file mode 100644 index 0000000..3e9f032 --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/is-html-element.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"is-html-element.mjs","sources":["../../../src/utils/is-html-element.ts"],"sourcesContent":["import { isObject } from \"motion-utils\"\n\n/**\n * Checks if an element is an HTML element in a way\n * that works across iframes\n */\nexport function isHTMLElement(element: unknown): element is HTMLElement {\n return (\n isObject(element) &&\n \"offsetHeight\" in element &&\n !(\"ownerSVGElement\" in element)\n )\n}\n"],"names":[],"mappings":";;AAEA;;;AAGG;AACG,SAAU,aAAa,CAAC,OAAgB,EAAA;AAC1C,IAAA,QACI,QAAQ,CAAC,OAAO,CAAC;AACjB,QAAA,cAAc,IAAI,OAAO;AACzB,QAAA,EAAE,iBAAiB,IAAI,OAAO,CAAC;AAEvC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/utils/is-svg-element.mjs b/node_modules/motion-dom/dist/es/utils/is-svg-element.mjs new file mode 100644 index 0000000..f529a49 --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/is-svg-element.mjs @@ -0,0 +1,12 @@ +import { isObject } from 'motion-utils'; + +/** + * Checks if an element is an SVG element in a way + * that works across iframes + */ +function isSVGElement(element) { + return isObject(element) && "ownerSVGElement" in element; +} + +export { isSVGElement }; +//# sourceMappingURL=is-svg-element.mjs.map diff --git a/node_modules/motion-dom/dist/es/utils/is-svg-element.mjs.map b/node_modules/motion-dom/dist/es/utils/is-svg-element.mjs.map new file mode 100644 index 0000000..bf9056c --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/is-svg-element.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"is-svg-element.mjs","sources":["../../../src/utils/is-svg-element.ts"],"sourcesContent":["import { isObject } from \"motion-utils\"\n\n/**\n * Checks if an element is an SVG element in a way\n * that works across iframes\n */\nexport function isSVGElement(element: unknown): element is SVGElement {\n return isObject(element) && \"ownerSVGElement\" in element\n}\n"],"names":[],"mappings":";;AAEA;;;AAGG;AACG,SAAU,YAAY,CAAC,OAAgB,EAAA;IACzC,OAAO,QAAQ,CAAC,OAAO,CAAC,IAAI,iBAAiB,IAAI,OAAO;AAC5D;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/utils/is-svg-svg-element.mjs b/node_modules/motion-dom/dist/es/utils/is-svg-svg-element.mjs new file mode 100644 index 0000000..e61de12 --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/is-svg-svg-element.mjs @@ -0,0 +1,12 @@ +import { isSVGElement } from './is-svg-element.mjs'; + +/** + * Checks if an element is specifically an SVGSVGElement (the root SVG element) + * in a way that works across iframes + */ +function isSVGSVGElement(element) { + return isSVGElement(element) && element.tagName === "svg"; +} + +export { isSVGSVGElement }; +//# sourceMappingURL=is-svg-svg-element.mjs.map diff --git a/node_modules/motion-dom/dist/es/utils/is-svg-svg-element.mjs.map b/node_modules/motion-dom/dist/es/utils/is-svg-svg-element.mjs.map new file mode 100644 index 0000000..80b46cf --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/is-svg-svg-element.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"is-svg-svg-element.mjs","sources":["../../../src/utils/is-svg-svg-element.ts"],"sourcesContent":["import { isSVGElement } from \"./is-svg-element\"\n\n/**\n * Checks if an element is specifically an SVGSVGElement (the root SVG element)\n * in a way that works across iframes\n */\nexport function isSVGSVGElement(element: unknown): element is SVGSVGElement {\n return isSVGElement(element) && element.tagName === \"svg\"\n}\n"],"names":[],"mappings":";;AAEA;;;AAGG;AACG,SAAU,eAAe,CAAC,OAAgB,EAAA;IAC5C,OAAO,YAAY,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC,OAAO,KAAK,KAAK;AAC7D;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/utils/mix/color.mjs b/node_modules/motion-dom/dist/es/utils/mix/color.mjs new file mode 100644 index 0000000..5c1bc4b --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/mix/color.mjs @@ -0,0 +1,48 @@ +import { warning } from 'motion-utils'; +import { hex } from '../../value/types/color/hex.mjs'; +import { hsla } from '../../value/types/color/hsla.mjs'; +import { hslaToRgba } from '../../value/types/color/hsla-to-rgba.mjs'; +import { rgba } from '../../value/types/color/rgba.mjs'; +import { mixImmediate } from './immediate.mjs'; +import { mixNumber } from './number.mjs'; + +// Linear color space blending +// Explained https://www.youtube.com/watch?v=LKnqECcg6Gw +// Demonstrated http://codepen.io/osublake/pen/xGVVaN +const mixLinearColor = (from, to, v) => { + const fromExpo = from * from; + const expo = v * (to * to - fromExpo) + fromExpo; + return expo < 0 ? 0 : Math.sqrt(expo); +}; +const colorTypes = [hex, rgba, hsla]; +const getColorType = (v) => colorTypes.find((type) => type.test(v)); +function asRGBA(color) { + const type = getColorType(color); + warning(Boolean(type), `'${color}' is not an animatable color. Use the equivalent color code instead.`, "color-not-animatable"); + if (!Boolean(type)) + return false; + let model = type.parse(color); + if (type === hsla) { + // TODO Remove this cast - needed since Motion's stricter typing + model = hslaToRgba(model); + } + return model; +} +const mixColor = (from, to) => { + const fromRGBA = asRGBA(from); + const toRGBA = asRGBA(to); + if (!fromRGBA || !toRGBA) { + return mixImmediate(from, to); + } + const blended = { ...fromRGBA }; + return (v) => { + blended.red = mixLinearColor(fromRGBA.red, toRGBA.red, v); + blended.green = mixLinearColor(fromRGBA.green, toRGBA.green, v); + blended.blue = mixLinearColor(fromRGBA.blue, toRGBA.blue, v); + blended.alpha = mixNumber(fromRGBA.alpha, toRGBA.alpha, v); + return rgba.transform(blended); + }; +}; + +export { mixColor, mixLinearColor }; +//# sourceMappingURL=color.mjs.map diff --git a/node_modules/motion-dom/dist/es/utils/mix/color.mjs.map b/node_modules/motion-dom/dist/es/utils/mix/color.mjs.map new file mode 100644 index 0000000..e5228d6 --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/mix/color.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"color.mjs","sources":["../../../../src/utils/mix/color.ts"],"sourcesContent":["import { warning } from \"motion-utils\"\nimport { hex } from \"../../value/types/color/hex\"\nimport { hsla } from \"../../value/types/color/hsla\"\nimport { hslaToRgba } from \"../../value/types/color/hsla-to-rgba\"\nimport { rgba } from \"../../value/types/color/rgba\"\nimport { Color, HSLA, RGBA } from \"../../value/types/types\"\nimport { mixImmediate } from \"./immediate\"\nimport { mixNumber } from \"./number\"\n\n// Linear color space blending\n// Explained https://www.youtube.com/watch?v=LKnqECcg6Gw\n// Demonstrated http://codepen.io/osublake/pen/xGVVaN\nexport const mixLinearColor = (from: number, to: number, v: number) => {\n const fromExpo = from * from\n const expo = v * (to * to - fromExpo) + fromExpo\n return expo < 0 ? 0 : Math.sqrt(expo)\n}\n\nconst colorTypes = [hex, rgba, hsla]\nconst getColorType = (v: Color | string) =>\n colorTypes.find((type) => type.test(v))\n\nfunction asRGBA(color: Color | string) {\n const type = getColorType(color)\n\n warning(\n Boolean(type),\n `'${color}' is not an animatable color. Use the equivalent color code instead.`,\n \"color-not-animatable\"\n )\n\n if (!Boolean(type)) return false\n\n let model = type!.parse(color)\n\n if (type === hsla) {\n // TODO Remove this cast - needed since Motion's stricter typing\n model = hslaToRgba(model as HSLA)\n }\n\n return model as RGBA\n}\n\nexport const mixColor = (from: Color | string, to: Color | string) => {\n const fromRGBA = asRGBA(from)\n const toRGBA = asRGBA(to)\n\n if (!fromRGBA || !toRGBA) {\n return mixImmediate(from, to)\n }\n\n const blended = { ...fromRGBA }\n\n return (v: number) => {\n blended.red = mixLinearColor(fromRGBA.red, toRGBA.red, v)\n blended.green = mixLinearColor(fromRGBA.green, toRGBA.green, v)\n blended.blue = mixLinearColor(fromRGBA.blue, toRGBA.blue, v)\n blended.alpha = mixNumber(fromRGBA.alpha, toRGBA.alpha, v)\n return rgba.transform!(blended)\n }\n}\n"],"names":[],"mappings":";;;;;;;;AASA;AACA;AACA;AACO,MAAM,cAAc,GAAG,CAAC,IAAY,EAAE,EAAU,EAAE,CAAS,KAAI;AAClE,IAAA,MAAM,QAAQ,GAAG,IAAI,GAAG,IAAI;AAC5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AO,CAAC,GAAG,GAAG,cAAc,CAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC;AACzD,QAAA,OAAO,CAAC,KAAK,GAAG,cAAc,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;AAC/D,QAAA,OAAO,CAAC,IAAI,GAAG,cAAc,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;AAC5D,QAAA,OAAO,CAAC,KAAK,GAAG,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;AAC1D,QAAA,OAAO,IAAI,CAAC,SAAU,CAAC,OAAO,CAAC;AACnC,IAAA,CAAC;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/utils/mix/complex.mjs b/node_modules/motion-dom/dist/es/utils/mix/complex.mjs new file mode 100644 index 0000000..687a641 --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/mix/complex.mjs @@ -0,0 +1,93 @@ +import { pipe, warning } from 'motion-utils'; +import { isCSSVariableToken } from '../../animation/utils/is-css-variable.mjs'; +import { color } from '../../value/types/color/index.mjs'; +import { complex, analyseComplexValue } from '../../value/types/complex/index.mjs'; +import { mixColor } from './color.mjs'; +import { mixImmediate } from './immediate.mjs'; +import { mixNumber as mixNumber$1 } from './number.mjs'; +import { invisibleValues, mixVisibility } from './visibility.mjs'; + +function mixNumber(a, b) { + return (p) => mixNumber$1(a, b, p); +} +function getMixer(a) { + if (typeof a === "number") { + return mixNumber; + } + else if (typeof a === "string") { + return isCSSVariableToken(a) + ? mixImmediate + : color.test(a) + ? mixColor + : mixComplex; + } + else if (Array.isArray(a)) { + return mixArray; + } + else if (typeof a === "object") { + return color.test(a) ? mixColor : mixObject; + } + return mixImmediate; +} +function mixArray(a, b) { + const output = [...a]; + const numValues = output.length; + const blendValue = a.map((v, i) => getMixer(v)(v, b[i])); + return (p) => { + for (let i = 0; i < numValues; i++) { + output[i] = blendValue[i](p); + } + return output; + }; +} +function mixObject(a, b) { + const output = { ...a, ...b }; + const blendValue = {}; + for (const key in output) { + if (a[key] !== undefined && b[key] !== undefined) { + blendValue[key] = getMixer(a[key])(a[key], b[key]); + } + } + return (v) => { + for (const key in blendValue) { + output[key] = blendValue[key](v); + } + return output; + }; +} +function matchOrder(origin, target) { + const orderedOrigin = []; + const pointers = { color: 0, var: 0, number: 0 }; + for (let i = 0; i < target.values.length; i++) { + const type = target.types[i]; + const originIndex = origin.indexes[type][pointers[type]]; + const originValue = origin.values[originIndex] ?? 0; + orderedOrigin[i] = originValue; + pointers[type]++; + } + return orderedOrigin; +} +const mixComplex = (origin, target) => { + const template = complex.createTransformer(target); + const originStats = analyseComplexValue(origin); + const targetStats = analyseComplexValue(target); + const canInterpolate = originStats.indexes.var.length === targetStats.indexes.var.length && + originStats.indexes.color.length === targetStats.indexes.color.length && + originStats.indexes.number.length >= targetStats.indexes.number.length; + if (canInterpolate) { + if ((invisibleValues.has(origin) && + !targetStats.values.length) || + (invisibleValues.has(target) && + !originStats.values.length)) { + return mixVisibility(origin, target); + } + return pipe(mixArray(matchOrder(originStats, targetStats), targetStats.values), template); + } + else { + warning(true, `Complex values '${origin}' and '${target}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`, "complex-values-different"); + return mixImmediate(origin, target); + } +}; + +export { getMixer, mixArray, mixComplex, mixObject }; +//# sourceMappingURL=complex.mjs.map diff --git a/node_modules/motion-dom/dist/es/utils/mix/complex.mjs.map b/node_modules/motion-dom/dist/es/utils/mix/complex.mjs.map new file mode 100644 index 0000000..61d8812 --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/mix/complex.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"complex.mjs","sources":["../../../../src/utils/mix/complex.ts"],"sourcesContent":["import { pipe, warning } from \"motion-utils\"\nimport { AnyResolvedKeyframe } from \"../../animation/types\"\nimport { isCSSVariableToken } from \"../../animation/utils/is-css-variable\"\nimport { color } from \"../../value/types/color\"\nimport {\n analyseComplexValue,\n complex,\n ComplexValueInfo,\n ComplexValues,\n} from \"../../value/types/complex\"\nimport { HSLA, RGBA } from \"../../value/types/types\"\nimport { mixColor } from \"./color\"\nimport { mixImmediate } from \"./immediate\"\nimport { mixNumber as mixNumberImmediate } from \"./number\"\nimport { invisibleValues, mixVisibility } from \"./visibility\"\n\ntype MixableArray = Array\ninterface MixableObject {\n [key: string]: AnyResolvedKeyframe | RGBA | HSLA\n}\n\nfunction mixNumber(a: number, b: number) {\n return (p: number) => mixNumberImmediate(a, b, p)\n}\n\nexport function getMixer(a: T) {\n if (typeof a === \"number\") {\n return mixNumber\n } else if (typeof a === \"string\") {\n return isCSSVariableToken(a)\n ? mixImmediate\n : color.test(a)\n ? mixColor\n : mixComplex\n } else if (Array.isArray(a)) {\n return mixArray\n } else if (typeof a === \"object\") {\n return color.test(a) ? mixColor : mixObject\n }\n\n return mixImmediate\n}\n\nexport function mixArray(a: MixableArray, b: MixableArray) {\n const output = [...a]\n const numValues = output.length\n\n const blendValue = a.map((v, i) => getMixer(v)(v as any, b[i] as any))\n\n return (p: number) => {\n for (let i = 0; i < numValues; i++) {\n output[i] = blendValue[i](p) as any\n }\n return output\n }\n}\n\nexport function mixObject(a: MixableObject, b: MixableObject) {\n const output = { ...a, ...b }\n const blendValue: { [key: string]: (v: number) => any } = {}\n\n for (const key in output) {\n if (a[key] !== undefined && b[key] !== undefined) {\n blendValue[key] = getMixer(a[key])(\n a[key] as any,\n b[key] as any\n ) as any\n }\n }\n\n return (v: number) => {\n for (const key in blendValue) {\n output[key] = blendValue[key](v)\n }\n return output\n }\n}\n\nfunction matchOrder(\n origin: ComplexValueInfo,\n target: ComplexValueInfo\n): ComplexValues {\n const orderedOrigin: ComplexValues = []\n\n const pointers = { color: 0, var: 0, number: 0 }\n\n for (let i = 0; i < target.values.length; i++) {\n const type = target.types[i]\n const originIndex = origin.indexes[type][pointers[type]]\n const originValue = origin.values[originIndex] ?? 0\n\n orderedOrigin[i] = originValue\n\n pointers[type]++\n }\n\n return orderedOrigin\n}\n\nexport const mixComplex = (\n origin: AnyResolvedKeyframe,\n target: AnyResolvedKeyframe\n) => {\n const template = complex.createTransformer(target)\n const originStats = analyseComplexValue(origin)\n const targetStats = analyseComplexValue(target)\n const canInterpolate =\n originStats.indexes.var.length === targetStats.indexes.var.length &&\n originStats.indexes.color.length === targetStats.indexes.color.length &&\n originStats.indexes.number.length >= targetStats.indexes.number.length\n\n if (canInterpolate) {\n if (\n (invisibleValues.has(origin as string) &&\n !targetStats.values.length) ||\n (invisibleValues.has(target as string) &&\n !originStats.values.length)\n ) {\n return mixVisibility(origin as string, target as string)\n }\n\n return pipe(\n mixArray(matchOrder(originStats, targetStats), targetStats.values),\n template\n )\n } else {\n warning(\n true,\n `Complex values '${origin}' and '${target}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,\n \"complex-values-different\"\n )\n\n return mixImmediate(origin, target)\n }\n}\n"],"names":["mixNumberImmediate"],"mappings":";;;;;;;;;AAqBA,SAAS,SAAS,CAAC,CAAS,EAAE,CAAS,EAAA;AACnC,IAAA,OAAO,CAAC,CAAS,KAAKA,WAAkB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;AACrD;AAEM,SAAU,QAAQ,CAAI,CAAI,EAAA;AAC5B,IAAA,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE;AACvB,QAAA,OAAO,SAAS;IACpB;AAAO,SAAA,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE;QAC9B,OAAO,kBAAkB,CAAC,CAAC;AACvB,cAAE;AACF,cAAE,KAAK,CAAC,IAAI,CAAC,CAAC;AACd,kBAAE;kBACA,UAAU;IACpB;AAAO,SAAA,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;AACzB,QAAA,OAAO,QAAQ;I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CAAC,KAAK,CAAC,MAAM,KAAK,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM;AACrE,QAAA,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,IAAI,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM;IAE1E,IAAI,cAAc,EAAE;AAChB,QAAA,IACI,CAAC,eAAe,CAAC,GAAG,CAAC,MAAgB,CAAC;AAClC,YAAA,CAAC,WAAW,CAAC,MAAM,CAAC,MAAM;AAC9B,aAAC,eAAe,CAAC,GAAG,CAAC,MAAgB,CAAC;AAClC,gBAAA,CAAC,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,EACjC;AACE,YAAA,OAAO,aAAa,CAAC,MAAgB,EAAE,MAAgB,CAAC;QAC5D;AAEA,QAAA,OAAO,IAAI,CACP,QAAQ,CAAC,UAAU,CAAC,WAAW,EAAE,WAAW,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,EAClE,QAAQ,CACX;IACL;SAAO;QACH,OAAO,CACH,IAAI,EACJ,CAAA,gBAAA,EAAmB,MAAM,CAAA,OAAA,EAAU,MAAM,CAAA,wKAAA,CAA0K,EACnN,0BAA0B,CAC7B;AAED,QAAA,OAAO,YAAY,CAAC,MAAM,EAAE,MAAM,CAAC;IACvC;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/utils/mix/immediate.mjs b/node_modules/motion-dom/dist/es/utils/mix/immediate.mjs new file mode 100644 index 0000000..12ca872 --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/mix/immediate.mjs @@ -0,0 +1,6 @@ +function mixImmediate(a, b) { + return (p) => (p > 0 ? b : a); +} + +export { mixImmediate }; +//# sourceMappingURL=immediate.mjs.map diff --git a/node_modules/motion-dom/dist/es/utils/mix/immediate.mjs.map b/node_modules/motion-dom/dist/es/utils/mix/immediate.mjs.map new file mode 100644 index 0000000..7b75737 --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/mix/immediate.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"immediate.mjs","sources":["../../../../src/utils/mix/immediate.ts"],"sourcesContent":["export function mixImmediate(a: T, b: T) {\n return (p: number) => (p > 0 ? b : a)\n}\n"],"names":[],"mappings":"AAAM,SAAU,YAAY,CAAI,CAAI,EAAE,CAAI,EAAA;AACtC,IAAA,OAAO,CAAC,CAAS,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AACzC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/utils/mix/index.mjs b/node_modules/motion-dom/dist/es/utils/mix/index.mjs new file mode 100644 index 0000000..e41e103 --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/mix/index.mjs @@ -0,0 +1,15 @@ +import { getMixer } from './complex.mjs'; +import { mixNumber } from './number.mjs'; + +function mix(from, to, p) { + if (typeof from === "number" && + typeof to === "number" && + typeof p === "number") { + return mixNumber(from, to, p); + } + const mixer = getMixer(from); + return mixer(from, to); +} + +export { mix }; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/motion-dom/dist/es/utils/mix/index.mjs.map b/node_modules/motion-dom/dist/es/utils/mix/index.mjs.map new file mode 100644 index 0000000..3b7d1d9 --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/mix/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../../../../src/utils/mix/index.ts"],"sourcesContent":["import { getMixer } from \"./complex\"\nimport { mixNumber as mixNumberImmediate } from \"./number\"\nimport { Mixer } from \"./types\"\n\nexport function mix(from: T, to: T): Mixer\nexport function mix(from: number, to: number, p: number): number\nexport function mix(from: T, to: T, p?: T): Mixer | number {\n if (\n typeof from === \"number\" &&\n typeof to === \"number\" &&\n typeof p === \"number\"\n ) {\n return mixNumberImmediate(from, to, p)\n }\n\n const mixer = getMixer(from)\n return mixer(from as any, to as any) as Mixer\n}\n"],"names":["mixNumberImmediate"],"mappings":";;;SAMgB,GAAG,CAAI,IAAO,EAAE,EAAK,EAAE,CAAK,EAAA;IACxC,IACI,OAAO,IAAI,KAAK,QAAQ;QACxB,OAAO,EAAE,KAAK,QAAQ;AACtB,QAAA,OAAO,CAAC,KAAK,QAAQ,EACvB;QACE,OAAOA,SAAkB,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;IAC1C;AAEA,IAAA,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC;AAC5B,IAAA,OAAO,KAAK,CAAC,IAAW,EAAE,EAAS,CAAa;AACpD;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/utils/mix/number.mjs b/node_modules/motion-dom/dist/es/utils/mix/number.mjs new file mode 100644 index 0000000..1e19dfc --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/mix/number.mjs @@ -0,0 +1,27 @@ +/* + Value in range from progress + + Given a lower limit and an upper limit, we return the value within + that range as expressed by progress (usually a number from 0 to 1) + + So progress = 0.5 would change + + from -------- to + + to + + from ---- to + + E.g. from = 10, to = 20, progress = 0.5 => 15 + + @param [number]: Lower limit of range + @param [number]: Upper limit of range + @param [number]: The progress between lower and upper limits expressed 0-1 + @return [number]: Value as calculated from progress within range (not limited within range) +*/ +const mixNumber = (from, to, progress) => { + return from + (to - from) * progress; +}; + +export { mixNumber }; +//# sourceMappingURL=number.mjs.map diff --git a/node_modules/motion-dom/dist/es/utils/mix/number.mjs.map b/node_modules/motion-dom/dist/es/utils/mix/number.mjs.map new file mode 100644 index 0000000..c4414bc --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/mix/number.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"number.mjs","sources":["../../../../src/utils/mix/number.ts"],"sourcesContent":["/*\n Value in range from progress\n\n Given a lower limit and an upper limit, we return the value within\n that range as expressed by progress (usually a number from 0 to 1)\n\n So progress = 0.5 would change\n\n from -------- to\n\n to\n\n from ---- to\n\n E.g. from = 10, to = 20, progress = 0.5 => 15\n\n @param [number]: Lower limit of range\n @param [number]: Upper limit of range\n @param [number]: The progress between lower and upper limits expressed 0-1\n @return [number]: Value as calculated from progress within range (not limited within range)\n*/\nexport const mixNumber = (from: number, to: number, progress: number) => {\n return from + (to - from) * progress\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;AAoBE;AACK,MAAM,SAAS,GAAG,CAAC,IAAY,EAAE,EAAU,EAAE,QAAgB,KAAI;IACpE,OAAO,IAAI,GAAG,CAAC,EAAE,GAAG,IAAI,IAAI,QAAQ;AACxC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/utils/mix/visibility.mjs b/node_modules/motion-dom/dist/es/utils/mix/visibility.mjs new file mode 100644 index 0000000..3810ffe --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/mix/visibility.mjs @@ -0,0 +1,17 @@ +const invisibleValues = new Set(["none", "hidden"]); +/** + * Returns a function that, when provided a progress value between 0 and 1, + * will return the "none" or "hidden" string only when the progress is that of + * the origin or target. + */ +function mixVisibility(origin, target) { + if (invisibleValues.has(origin)) { + return (p) => (p <= 0 ? origin : target); + } + else { + return (p) => (p >= 1 ? target : origin); + } +} + +export { invisibleValues, mixVisibility }; +//# sourceMappingURL=visibility.mjs.map diff --git a/node_modules/motion-dom/dist/es/utils/mix/visibility.mjs.map b/node_modules/motion-dom/dist/es/utils/mix/visibility.mjs.map new file mode 100644 index 0000000..76ac7b6 --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/mix/visibility.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"visibility.mjs","sources":["../../../../src/utils/mix/visibility.ts"],"sourcesContent":["export const invisibleValues = new Set([\"none\", \"hidden\"])\n\n/**\n * Returns a function that, when provided a progress value between 0 and 1,\n * will return the \"none\" or \"hidden\" string only when the progress is that of\n * the origin or target.\n */\nexport function mixVisibility(origin: string, target: string) {\n if (invisibleValues.has(origin)) {\n return (p: number) => (p <= 0 ? origin : target)\n } else {\n return (p: number) => (p >= 1 ? target : origin)\n }\n}\n"],"names":[],"mappings":"AAAO,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,QAAQ,CAAC;AAEzD;;;;AAIG;AACG,SAAU,aAAa,CAAC,MAAc,EAAE,MAAc,EAAA;AACxD,IAAA,IAAI,eAAe,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;AAC7B,QAAA,OAAO,CAAC,CAAS,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,GAAG,MAAM,CAAC;IACpD;SAAO;AACH,QAAA,OAAO,CAAC,CAAS,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,GAAG,MAAM,CAAC;IACpD;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/utils/resolve-elements.mjs b/node_modules/motion-dom/dist/es/utils/resolve-elements.mjs new file mode 100644 index 0000000..a90b0c3 --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/resolve-elements.mjs @@ -0,0 +1,21 @@ +function resolveElements(elementOrSelector, scope, selectorCache) { + if (elementOrSelector == null) { + return []; + } + if (elementOrSelector instanceof EventTarget) { + return [elementOrSelector]; + } + else if (typeof elementOrSelector === "string") { + let root = document; + if (scope) { + root = scope.current; + } + const elements = selectorCache?.[elementOrSelector] ?? + root.querySelectorAll(elementOrSelector); + return elements ? Array.from(elements) : []; + } + return Array.from(elementOrSelector).filter((element) => element != null); +} + +export { resolveElements }; +//# sourceMappingURL=resolve-elements.mjs.map diff --git a/node_modules/motion-dom/dist/es/utils/resolve-elements.mjs.map b/node_modules/motion-dom/dist/es/utils/resolve-elements.mjs.map new file mode 100644 index 0000000..3944813 --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/resolve-elements.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"resolve-elements.mjs","sources":["../../../src/utils/resolve-elements.ts"],"sourcesContent":["export type ElementOrSelector =\n | Element\n | Element[]\n | NodeListOf\n | string\n | null\n | undefined\n\nexport interface WithQuerySelectorAll {\n querySelectorAll: Element[\"querySelectorAll\"]\n}\n\nexport interface AnimationScope {\n readonly current: T\n animations: any[] // TODO: Refactor to types package AnimationPlaybackControls[]\n}\n\nexport interface SelectorCache {\n [key: string]: NodeListOf\n}\n\nexport function resolveElements(\n elementOrSelector: ElementOrSelector,\n scope?: AnimationScope,\n selectorCache?: SelectorCache\n): Element[] {\n if (elementOrSelector == null) {\n return []\n }\n\n if (elementOrSelector instanceof EventTarget) {\n return [elementOrSelector]\n } else if (typeof elementOrSelector === \"string\") {\n let root: WithQuerySelectorAll = document\n\n if (scope) {\n root = scope.current\n }\n\n const elements =\n selectorCache?.[elementOrSelector] ??\n root.querySelectorAll(elementOrSelector)\n\n return elements ? Array.from(elements) : []\n }\n\n return Array.from(elementOrSelector).filter(\n (element): element is Element => element != null\n )\n}\n"],"names":[],"mappings":"SAqBgB,eAAe,CAC3B,iBAAoC,EACpC,KAAsB,EACtB,aAA6B,EAAA;AAE7B,IAAA,IAAI,iBAAiB,IAAI,IAAI,EAAE;AAC3B,QAAA,OAAO,EAAE;IACb;AAEA,IAAA,IAAI,iBAAiB,YAAY,WAAW,EAAE;QAC1C,OAAO,CAAC,iBAAiB,CAAC;IAC9B;AAAO,SAAA,IAAI,OAAO,iBAAiB,KAAK,QAAQ,EAAE;QAC9C,IAAI,IAAI,GAAyB,QAAQ;QAEzC,IAAI,KAAK,EAAE;AACP,YAAA,IAAI,GAAG,KAAK,CAAC,OAAO;QACxB;AAEA,QAAA,MAAM,QAAQ,GACV,aAAa,GAAG,iBAAiB,CAAC;AAClC,YAAA,IAAI,CAAC,gBAAgB,CAAC,iBAAiB,CAAC;AAE5C,QAAA,OAAO,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE;IAC/C;AAEA,IAAA,OAAO,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,MAAM,CACvC,CAAC,OAAO,KAAyB,OAAO,IAAI,IAAI,CACnD;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/utils/stagger.mjs b/node_modules/motion-dom/dist/es/utils/stagger.mjs new file mode 100644 index 0000000..ed9b469 --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/stagger.mjs @@ -0,0 +1,27 @@ +import { easingDefinitionToFunction } from 'motion-utils'; + +function getOriginIndex(from, total) { + if (from === "first") { + return 0; + } + else { + const lastIndex = total - 1; + return from === "last" ? lastIndex : lastIndex / 2; + } +} +function stagger(duration = 0.1, { startDelay = 0, from = 0, ease } = {}) { + return (i, total) => { + const fromIndex = typeof from === "number" ? from : getOriginIndex(from, total); + const distance = Math.abs(fromIndex - i); + let delay = duration * distance; + if (ease) { + const maxDelay = total * duration; + const easingFunction = easingDefinitionToFunction(ease); + delay = easingFunction(delay / maxDelay) * maxDelay; + } + return startDelay + delay; + }; +} + +export { getOriginIndex, stagger }; +//# sourceMappingURL=stagger.mjs.map diff --git a/node_modules/motion-dom/dist/es/utils/stagger.mjs.map b/node_modules/motion-dom/dist/es/utils/stagger.mjs.map new file mode 100644 index 0000000..96d6e9c --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/stagger.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"stagger.mjs","sources":["../../../src/utils/stagger.ts"],"sourcesContent":["import { Easing, easingDefinitionToFunction } from \"motion-utils\"\nimport { DynamicOption } from \"../animation/types\"\n\nexport type StaggerOrigin = \"first\" | \"last\" | \"center\" | number\n\nexport type StaggerOptions = {\n startDelay?: number\n from?: StaggerOrigin\n ease?: Easing\n}\n\nexport function getOriginIndex(from: StaggerOrigin, total: number) {\n if (from === \"first\") {\n return 0\n } else {\n const lastIndex = total - 1\n return from === \"last\" ? lastIndex : lastIndex / 2\n }\n}\n\nexport function stagger(\n duration: number = 0.1,\n { startDelay = 0, from = 0, ease }: StaggerOptions = {}\n): DynamicOption {\n return (i: number, total: number) => {\n const fromIndex =\n typeof from === \"number\" ? from : getOriginIndex(from, total)\n const distance = Math.abs(fromIndex - i)\n let delay = duration * distance\n\n if (ease) {\n const maxDelay = total * duration\n const easingFunction = easingDefinitionToFunction(ease)\n delay = easingFunction(delay / maxDelay) * maxDelay\n }\n\n return startDelay + delay\n }\n}\n"],"names":[],"mappings":";;AAWM,SAAU,cAAc,CAAC,IAAmB,EAAE,KAAa,EAAA;AAC7D,IAAA,IAAI,IAAI,KAAK,OAAO,EAAE;AAClB,QAAA,OAAO,CAAC;IACZ;SAAO;AACH,QAAA,MAAM,SAAS,GAAG,KAAK,GAAG,CAAC;AAC3B,QAAA,OAAO,IAAI,KAAK,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,CAAC;IACtD;AACJ;SAEgB,OAAO,CACnB,QAAA,GAAmB,GAAG,EACtB,EAAE,UAAU,GAAG,CAAC,EAAE,IAAI,GAAG,CAAC,EAAE,IAAI,KAAqB,EAAE,EAAA;AAEvD,IAAA,OAAO,CAAC,CAAS,EAAE,KAAa,KAAI;AAChC,QAAA,MAAM,SAAS,GACX,OAAO,IAAI,KAAK,QAAQ,GAAG,IAAI,GAAG,cAAc,CAAC,IAAI,EAAE,KAAK,CAAC;QACjE,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,GAAG,CAAC,CAAC;AACxC,QAAA,IAAI,KAAK,GAAG,QAAQ,GAAG,QAAQ;QAE/B,IAAI,IAAI,EAAE;AACN,YAAA,MAAM,QAAQ,GAAG,KAAK,GAAG,QAAQ;AACjC,YAAA,MAAM,cAAc,GAAG,0BAA0B,CAAC,IAAI,CAAC;YACvD,KAAK,GAAG,cAAc,CAAC,KAAK,GAAG,QAAQ,CAAC,GAAG,QAAQ;QACvD;QAEA,OAAO,UAAU,GAAG,KAAK;AAC7B,IAAA,CAAC;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/utils/supports/flags.mjs b/node_modules/motion-dom/dist/es/utils/supports/flags.mjs new file mode 100644 index 0000000..e0682b1 --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/supports/flags.mjs @@ -0,0 +1,8 @@ +/** + * Add the ability for test suites to manually set support flags + * to better test more environments. + */ +const supportsFlags = {}; + +export { supportsFlags }; +//# sourceMappingURL=flags.mjs.map diff --git a/node_modules/motion-dom/dist/es/utils/supports/flags.mjs.map b/node_modules/motion-dom/dist/es/utils/supports/flags.mjs.map new file mode 100644 index 0000000..bd44b30 --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/supports/flags.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"flags.mjs","sources":["../../../../src/utils/supports/flags.ts"],"sourcesContent":["/**\n * Add the ability for test suites to manually set support flags\n * to better test more environments.\n */\nexport const supportsFlags: Record = {}\n"],"names":[],"mappings":"AAAA;;;AAGG;AACI,MAAM,aAAa,GAAwC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/utils/supports/linear-easing.mjs b/node_modules/motion-dom/dist/es/utils/supports/linear-easing.mjs new file mode 100644 index 0000000..38f3729 --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/supports/linear-easing.mjs @@ -0,0 +1,16 @@ +import { memoSupports } from './memo.mjs'; + +const supportsLinearEasing = /*@__PURE__*/ memoSupports(() => { + try { + document + .createElement("div") + .animate({ opacity: 0 }, { easing: "linear(0, 1)" }); + } + catch (e) { + return false; + } + return true; +}, "linearEasing"); + +export { supportsLinearEasing }; +//# sourceMappingURL=linear-easing.mjs.map diff --git a/node_modules/motion-dom/dist/es/utils/supports/linear-easing.mjs.map b/node_modules/motion-dom/dist/es/utils/supports/linear-easing.mjs.map new file mode 100644 index 0000000..e44c3a6 --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/supports/linear-easing.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"linear-easing.mjs","sources":["../../../../src/utils/supports/linear-easing.ts"],"sourcesContent":["import { memoSupports } from \"./memo\"\n\nexport const supportsLinearEasing = /*@__PURE__*/ memoSupports(() => {\n try {\n document\n .createElement(\"div\")\n .animate({ opacity: 0 }, { easing: \"linear(0, 1)\" })\n } catch (e) {\n return false\n }\n return true\n}, \"linearEasing\")\n"],"names":[],"mappings":";;MAEa,oBAAoB,iBAAiB,YAAY,CAAC,MAAK;AAChE,IAAA,IAAI;QACA;aACK,aAAa,CAAC,KAAK;AACnB,aAAA,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC;IAC5D;IAAE,OAAO,CAAC,EAAE;AACR,QAAA,OAAO,KAAK;IAChB;AACA,IAAA,OAAO,IAAI;AACf,CAAC,EAAE,cAAc;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/utils/supports/memo.mjs b/node_modules/motion-dom/dist/es/utils/supports/memo.mjs new file mode 100644 index 0000000..e8dd26a --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/supports/memo.mjs @@ -0,0 +1,10 @@ +import { memo } from 'motion-utils'; +import { supportsFlags } from './flags.mjs'; + +function memoSupports(callback, supportsFlag) { + const memoized = memo(callback); + return () => supportsFlags[supportsFlag] ?? memoized(); +} + +export { memoSupports }; +//# sourceMappingURL=memo.mjs.map diff --git a/node_modules/motion-dom/dist/es/utils/supports/memo.mjs.map b/node_modules/motion-dom/dist/es/utils/supports/memo.mjs.map new file mode 100644 index 0000000..285c529 --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/supports/memo.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"memo.mjs","sources":["../../../../src/utils/supports/memo.ts"],"sourcesContent":["import { memo } from \"motion-utils\"\nimport { supportsFlags } from \"./flags\"\n\nexport function memoSupports(\n callback: () => T,\n supportsFlag: keyof typeof supportsFlags\n) {\n const memoized = memo(callback)\n return () => supportsFlags[supportsFlag] ?? memoized()\n}\n"],"names":[],"mappings":";;;AAGM,SAAU,YAAY,CACxB,QAAiB,EACjB,YAAwC,EAAA;AAExC,IAAA,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;IAC/B,OAAO,MAAM,aAAa,CAAC,YAAY,CAAC,IAAI,QAAQ,EAAE;AAC1D;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/utils/supports/scroll-timeline.mjs b/node_modules/motion-dom/dist/es/utils/supports/scroll-timeline.mjs new file mode 100644 index 0000000..59d9549 --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/supports/scroll-timeline.mjs @@ -0,0 +1,7 @@ +import { memoSupports } from './memo.mjs'; + +const supportsScrollTimeline = /* @__PURE__ */ memoSupports(() => window.ScrollTimeline !== undefined, "scrollTimeline"); +const supportsViewTimeline = /* @__PURE__ */ memoSupports(() => window.ViewTimeline !== undefined, "viewTimeline"); + +export { supportsScrollTimeline, supportsViewTimeline }; +//# sourceMappingURL=scroll-timeline.mjs.map diff --git a/node_modules/motion-dom/dist/es/utils/supports/scroll-timeline.mjs.map b/node_modules/motion-dom/dist/es/utils/supports/scroll-timeline.mjs.map new file mode 100644 index 0000000..f05adaa --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/supports/scroll-timeline.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"scroll-timeline.mjs","sources":["../../../../src/utils/supports/scroll-timeline.ts"],"sourcesContent":["import { ProgressTimeline } from \"../..\"\nimport { memoSupports } from \"./memo\"\n\ndeclare global {\n interface Window {\n ScrollTimeline: ScrollTimeline\n ViewTimeline: ViewTimeline\n }\n}\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\nexport const supportsScrollTimeline = /* @__PURE__ */ memoSupports(\n () => window.ScrollTimeline !== undefined,\n \"scrollTimeline\"\n)\n\nexport const supportsViewTimeline = /* @__PURE__ */ memoSupports(\n () => window.ViewTimeline !== undefined,\n \"viewTimeline\"\n)\n"],"names":[],"mappings":";;AA0BO,MAAM,sBAAsB,mBAAmB,YAAY,CAC9D,MAAM,MAAM,CAAC,cAAc,KAAK,SAAS,EACzC,gBAAgB;AAGb,MAAM,oBAAoB,mBAAmB,YAAY,CAC5D,MAAM,MAAM,CAAC,YAAY,KAAK,SAAS,EACvC,cAAc;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/utils/transform.mjs b/node_modules/motion-dom/dist/es/utils/transform.mjs new file mode 100644 index 0000000..74b624e --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/transform.mjs @@ -0,0 +1,15 @@ +import { interpolate } from './interpolate.mjs'; + +function transform(...args) { + const useImmediate = !Array.isArray(args[0]); + const argOffset = useImmediate ? 0 : -1; + const inputValue = args[0 + argOffset]; + const inputRange = args[1 + argOffset]; + const outputRange = args[2 + argOffset]; + const options = args[3 + argOffset]; + const interpolator = interpolate(inputRange, outputRange, options); + return useImmediate ? interpolator(inputValue) : interpolator; +} + +export { transform }; +//# sourceMappingURL=transform.mjs.map diff --git a/node_modules/motion-dom/dist/es/utils/transform.mjs.map b/node_modules/motion-dom/dist/es/utils/transform.mjs.map new file mode 100644 index 0000000..462be81 --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/transform.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"transform.mjs","sources":["../../../src/utils/transform.ts"],"sourcesContent":["import { EasingFunction } from \"motion-utils\"\nimport { interpolate } from \"./interpolate\"\n\n/**\n * @public\n */\nexport interface TransformOptions {\n /**\n * Clamp values to within the given range. Defaults to `true`\n *\n * @public\n */\n clamp?: boolean\n\n /**\n * Easing functions to use on the interpolations between each value in the input and output ranges.\n *\n * If provided as an array, the array must be one item shorter than the input and output ranges, as the easings apply to the transition **between** each.\n *\n * @public\n */\n ease?: EasingFunction | EasingFunction[]\n\n /**\n * Provide a function that can interpolate between any two values in the provided range.\n *\n * @public\n */\n mixer?: (from: T, to: T) => (v: number) => any\n}\n\n/**\n * Transforms numbers into other values by mapping them from an input range to an output range.\n * Returns the type of the input provided.\n *\n * @remarks\n *\n * Given an input range of `[0, 200]` and an output range of\n * `[0, 1]`, this function will return a value between `0` and `1`.\n * The input range must be a linear series of numbers. The output range\n * can be any supported value type, such as numbers, colors, shadows, arrays, objects and more.\n * Every value in the output range must be of the same type and in the same format.\n *\n * ```jsx\n * export function MyComponent() {\n * const inputRange = [0, 200]\n * const outputRange = [0, 1]\n * const output = transform(100, inputRange, outputRange)\n *\n * // Returns 0.5\n * return
{output}
\n * }\n * ```\n *\n * @param inputValue - A number to transform between the input and output ranges.\n * @param inputRange - A linear series of numbers (either all increasing or decreasing).\n * @param outputRange - A series of numbers, colors, strings, or arrays/objects of those. Must be the same length as `inputRange`.\n * @param options - Clamp: Clamp values to within the given range. Defaults to `true`.\n *\n * @public\n */\nexport function transform(\n inputValue: number,\n inputRange: number[],\n outputRange: T[],\n options?: TransformOptions\n): T\n/**\n *\n * Transforms numbers into other values by mapping them from an input range to an output range.\n *\n * Given an input range of `[0, 200]` and an output range of\n * `[0, 1]`, this function will return a value between `0` and `1`.\n * The input range must be a linear series of numbers. The output range\n * can be any supported value type, such as numbers, colors, shadows, arrays, objects and more.\n * Every value in the output range must be of the same type and in the same format.\n *\n * ```jsx\n * export function MyComponent() {\n * const inputRange = [-200, -100, 100, 200]\n * const outputRange = [0, 1, 1, 0]\n * const convertRange = transform(inputRange, outputRange)\n * const output = convertRange(-150)\n *\n * // Returns 0.5\n * return
{output}
\n * }\n *\n * ```\n *\n * @param inputRange - A linear series of numbers (either all increasing or decreasing).\n * @param outputRange - A series of numbers, colors or strings. Must be the same length as `inputRange`.\n * @param options - Clamp: clamp values to within the given range. Defaults to `true`.\n *\n * @public\n */\nexport function transform(\n inputRange: number[],\n outputRange: T[],\n options?: TransformOptions\n): (inputValue: number) => T\nexport function transform(\n ...args:\n | [number, number[], T[], TransformOptions?]\n | [number[], T[], TransformOptions?]\n) {\n const useImmediate = !Array.isArray(args[0])\n const argOffset = useImmediate ? 0 : -1\n const inputValue = args[0 + argOffset] as number\n const inputRange = args[1 + argOffset] as number[]\n const outputRange = args[2 + argOffset] as T[]\n const options = args[3 + argOffset] as TransformOptions\n\n const interpolator = interpolate(inputRange, outputRange, options)\n\n return useImmediate ? interpolator(inputValue) : interpolator\n}\n"],"names":[],"mappings":";;AAqGM,SAAU,SAAS,CACrB,GAAG,IAEwC,EAAA;AAE3C,IAAA,MAAM,YAAY,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAC5C,IAAA,MAAM,SAAS,GAAG,YAAY,GAAG,CAAC,GAAG,EAAE;IACvC,MAAM,UAAU,GAAG,IAAI,CAAC,CAAC,GAAG,SAAS,CAAW;IAChD,MAAM,UAAU,GAAG,IAAI,CAAC,CAAC,GAAG,SAAS,CAAa;IAClD,MAAM,WAAW,GAAG,IAAI,CAAC,CAAC,GAAG,SAAS,CAAQ;IAC9C,MAAM,OAAO,GAAG,IAAI,CAAC,CAAC,GAAG,SAAS,CAAwB;IAE1D,MAAM,YAAY,GAAG,WAAW,CAAC,UAAU,EAAE,WAAW,EAAE,OAAO,CAAC;AAElE,IAAA,OAAO,YAAY,GAAG,YAAY,CAAC,UAAU,CAAC,GAAG,YAAY;AACjE;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/follow-value.mjs b/node_modules/motion-dom/dist/es/value/follow-value.mjs new file mode 100644 index 0000000..8a23743 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/follow-value.mjs @@ -0,0 +1,124 @@ +import { motionValue } from './index.mjs'; +import { JSAnimation } from '../animation/JSAnimation.mjs'; +import { isMotionValue } from './utils/is-motion-value.mjs'; +import { frame } from '../frameloop/frame.mjs'; + +/** + * Create a `MotionValue` that animates to its latest value using any transition type. + * Can either be a value or track another `MotionValue`. + * + * ```jsx + * const x = motionValue(0) + * const y = followValue(x, { type: "spring", stiffness: 300 }) + * // or with tween + * const z = followValue(x, { type: "tween", duration: 0.5, ease: "easeOut" }) + * ``` + * + * @param source - Initial value or MotionValue to track + * @param options - Animation transition options + * @returns `MotionValue` + * + * @public + */ +function followValue(source, options) { + const initialValue = isMotionValue(source) ? source.get() : source; + const value = motionValue(initialValue); + attachFollow(value, source, options); + return value; +} +/** + * Attach an animation to a MotionValue that will animate whenever the value changes. + * Similar to attachSpring but supports any transition type (spring, tween, inertia, etc.) + * + * @param value - The MotionValue to animate + * @param source - Initial value or MotionValue to track + * @param options - Animation transition options + * @returns Cleanup function + * + * @public + */ +function attachFollow(value, source, options = {}) { + const initialValue = value.get(); + let activeAnimation = null; + let latestValue = initialValue; + let latestSetter; + const unit = typeof initialValue === "string" + ? initialValue.replace(/[\d.-]/g, "") + : undefined; + const stopAnimation = () => { + if (activeAnimation) { + activeAnimation.stop(); + activeAnimation = null; + } + value.animation = undefined; + }; + const startAnimation = () => { + const currentValue = asNumber(value.get()); + const targetValue = asNumber(latestValue); + // Don't animate if we're already at the target + if (currentValue === targetValue) { + stopAnimation(); + return; + } + // Use the running animation's analytical velocity for accuracy, + // falling back to the MotionValue's velocity for the initial animation. + // This prevents systematic velocity loss at high frame rates (240hz+). + const velocity = activeAnimation + ? activeAnimation.getGeneratorVelocity() + : value.getVelocity(); + stopAnimation(); + activeAnimation = new JSAnimation({ + keyframes: [currentValue, targetValue], + velocity, + // Default to spring if no type specified (matches useSpring behavior) + type: "spring", + restDelta: 0.001, + restSpeed: 0.01, + ...options, + onUpdate: latestSetter, + }); + }; + // Use a stable function reference so the frame loop Set deduplicates + // multiple calls within the same frame (e.g. rapid mouse events) + const scheduleAnimation = () => { + startAnimation(); + value.animation = activeAnimation ?? undefined; + value["events"].animationStart?.notify(); + activeAnimation?.then(() => { + value.animation = undefined; + value["events"].animationComplete?.notify(); + }); + }; + value.attach((v, set) => { + latestValue = v; + latestSetter = (latest) => set(parseValue(latest, unit)); + frame.postRender(scheduleAnimation); + }, stopAnimation); + if (isMotionValue(source)) { + let skipNextAnimation = options.skipInitialAnimation === true; + const removeSourceOnChange = source.on("change", (v) => { + if (skipNextAnimation) { + skipNextAnimation = false; + value.jump(parseValue(v, unit), false); + } + else { + value.set(parseValue(v, unit)); + } + }); + const removeValueOnDestroy = value.on("destroy", removeSourceOnChange); + return () => { + removeSourceOnChange(); + removeValueOnDestroy(); + }; + } + return stopAnimation; +} +function parseValue(v, unit) { + return unit ? v + unit : v; +} +function asNumber(v) { + return typeof v === "number" ? v : parseFloat(v); +} + +export { attachFollow, followValue }; +//# sourceMappingURL=follow-value.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/follow-value.mjs.map b/node_modules/motion-dom/dist/es/value/follow-value.mjs.map new file mode 100644 index 0000000..ed56786 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/follow-value.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"follow-value.mjs","sources":["../../../src/value/follow-value.ts"],"sourcesContent":["import { MotionValue, motionValue } from \".\"\nimport { JSAnimation } from \"../animation/JSAnimation\"\nimport { AnyResolvedKeyframe, ValueAnimationTransition } from \"../animation/types\"\nimport { frame } from \"../frameloop\"\nimport { isMotionValue } from \"./utils/is-motion-value\"\n\n/**\n * Options for useFollowValue hook, extending ValueAnimationTransition\n * but excluding lifecycle callbacks that don't make sense for the hook pattern.\n */\nexport type FollowValueOptions = Omit<\n ValueAnimationTransition,\n \"onUpdate\" | \"onComplete\" | \"onPlay\" | \"onRepeat\" | \"onStop\"\n> & {\n /**\n * When true, the first change from a tracked `MotionValue` source\n * will jump to the new value instead of animating. Subsequent\n * changes animate normally. This prevents unwanted animations\n * on page refresh or back navigation (e.g. `useScroll` + `useSpring`).\n *\n * @default false\n */\n skipInitialAnimation?: boolean\n}\n\n/**\n * Create a `MotionValue` that animates to its latest value using any transition type.\n * Can either be a value or track another `MotionValue`.\n *\n * ```jsx\n * const x = motionValue(0)\n * const y = followValue(x, { type: \"spring\", stiffness: 300 })\n * // or with tween\n * const z = followValue(x, { type: \"tween\", duration: 0.5, ease: \"easeOut\" })\n * ```\n *\n * @param source - Initial value or MotionValue to track\n * @param options - Animation transition options\n * @returns `MotionValue`\n *\n * @public\n */\nexport function followValue(\n source: T | MotionValue,\n options?: FollowValueOptions\n) {\n const initialValue = isMotionValue(source) ? source.get() : source\n const value = motionValue(initialValue)\n\n attachFollow(value, source, options)\n\n return value\n}\n\n/**\n * Attach an animation to a MotionValue that will animate whenever the value changes.\n * Similar to attachSpring but supports any transition type (spring, tween, inertia, etc.)\n *\n * @param value - The MotionValue to animate\n * @param source - Initial value or MotionValue to track\n * @param options - Animation transition options\n * @returns Cleanup function\n *\n * @public\n */\nexport function attachFollow(\n value: MotionValue,\n source: T | MotionValue,\n options: FollowValueOptions = {}\n): VoidFunction {\n const initialValue = value.get()\n\n let activeAnimation: JSAnimation | null = null\n let latestValue = initialValue\n let latestSetter: (v: T) => void\n\n const unit =\n typeof initialValue === \"string\"\n ? initialValue.replace(/[\\d.-]/g, \"\")\n : undefined\n\n const stopAnimation = () => {\n if (activeAnimation) {\n activeAnimation.stop()\n activeAnimation = null\n }\n value.animation = undefined\n }\n\n const startAnimation = () => {\n const currentValue = asNumber(value.get())\n const targetValue = asNumber(latestValue)\n\n // Don't animate if we're already at the target\n if (currentValue === targetValue) {\n stopAnimation()\n return\n }\n\n // Use the running animation's analytical velocity for accuracy,\n // falling back to the MotionValue's velocity for the initial animation.\n // This prevents systematic velocity loss at high frame rates (240hz+).\n const velocity = activeAnimation\n ? activeAnimation.getGeneratorVelocity()\n : value.getVelocity()\n\n stopAnimation()\n\n activeAnimation = new JSAnimation({\n keyframes: [currentValue, targetValue],\n velocity,\n // Default to spring if no type specified (matches useSpring behavior)\n type: \"spring\",\n restDelta: 0.001,\n restSpeed: 0.01,\n ...options,\n onUpdate: latestSetter,\n })\n }\n\n // Use a stable function reference so the frame loop Set deduplicates\n // multiple calls within the same frame (e.g. rapid mouse events)\n const scheduleAnimation = () => {\n startAnimation()\n value.animation = activeAnimation ?? undefined\n value[\"events\"].animationStart?.notify()\n activeAnimation?.then(() => {\n value.animation = undefined\n value[\"events\"].animationComplete?.notify()\n })\n }\n\n value.attach((v, set) => {\n latestValue = v\n latestSetter = (latest) => set(parseValue(latest, unit) as T)\n frame.postRender(scheduleAnimation)\n }, stopAnimation)\n\n if (isMotionValue(source)) {\n let skipNextAnimation = options.skipInitialAnimation === true\n\n const removeSourceOnChange = source.on(\"change\", (v) => {\n if (skipNextAnimation) {\n skipNextAnimation = false\n value.jump(parseValue(v, unit) as T, false)\n } else {\n value.set(parseValue(v, unit) as T)\n }\n })\n\n const removeValueOnDestroy = value.on(\"destroy\", removeSourceOnChange)\n\n return () => {\n removeSourceOnChange()\n removeValueOnDestroy()\n }\n }\n\n return stopAnimation\n}\n\nfunction parseValue(v: AnyResolvedKeyframe, unit?: string) {\n return unit ? v + unit : v\n}\n\nfunction asNumber(v: AnyResolvedKeyframe) {\n return typeof v === \"number\" ? v : parseFloat(v)\n}\n"],"names":[],"mappings":";;;;;AAyBA;;;;;;;;;;;;;;;;AAgBG;AACG,SAAU,WAAW,CACvB,MAA0B,EAC1B,OAA4B,EAAA;AAE5B,IAAA,MAAM,YAAY,GAAG,aAAa,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,GAAG,EAAE,GAAG,MAAM;AAClE,IAAA,MAAM,KAAK,GAAG,WAAW,CAAC,YAAY,CAAC;AAEvC,IAAA,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC;AAEpC,IAAA,OAAO,KAAK;AAChB;AAEA;;;;;;;;;;AAUG;AACG,SAAU,YAAY,CACxB,KAAqB,EACrB,MAA0B,EAC1B,UAA8B,EAAE,EAAA;AAEhC,IAAA,MAAM,YAAY,GAAG,KAAK,CAAC,GAAG,EAAE;IAEhC,IAAI,eAAe,GAA+B,IAAI;IACtD,IAAI,WAAW,GAAG,YAAY;AAC9B,IAAA,IAAI,YAA4B;AAEhC,IAAA,MAAM,IAAI,GACN,OAAO,YAAY,KAAK;UAClB,YAAY,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE;UAClC,SAAS;IAEnB,MAAM,aAAa,GAAG,MAAK;QACvB,IAAI,e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AAY,GAAG,CAAC,MAAM,KAAK,GAAG,CAAC,UAAU,CAAC,MAAM,EAAE,IAAI,CAAM,CAAC;AAC7D,QAAA,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC;IACvC,CAAC,EAAE,aAAa,CAAC;AAEjB,IAAA,IAAI,aAAa,CAAC,MAAM,CAAC,EAAE;AACvB,QAAA,IAAI,iBAAiB,GAAG,OAAO,CAAC,oBAAoB,KAAK,IAAI;QAE7D,MAAM,oBAAoB,GAAG,MAAM,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC,KAAI;YACnD,IAAI,iBAAiB,EAAE;gBACnB,iBAAiB,GAAG,KAAK;AACzB,gBAAA,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,EAAE,IAAI,CAAM,EAAE,KAAK,CAAC;YAC/C;iBAAO;gBACH,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,EAAE,IAAI,CAAM,CAAC;YACvC;AACJ,QAAA,CAAC,CAAC;QAEF,MAAM,oBAAoB,GAAG,KAAK,CAAC,EAAE,CAAC,SAAS,EAAE,oBAAoB,CAAC;AAEtE,QAAA,OAAO,MAAK;AACR,YAAA,oBAAoB,EAAE;AACtB,YAAA,oBAAoB,EAAE;AAC1B,QAAA,CAAC;IACL;AAEA,IAAA,OAAO,aAAa;AACxB;AAEA,SAAS,UAAU,CAAC,CAAsB,EAAE,IAAa,EAAA;IACrD,OAAO,IAAI,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC;AAC9B;AAEA,SAAS,QAAQ,CAAC,CAAsB,EAAA;AACpC,IAAA,OAAO,OAAO,CAAC,KAAK,QAAQ,GAAG,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC;AACpD;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/index.mjs b/node_modules/motion-dom/dist/es/value/index.mjs new file mode 100644 index 0000000..3699391 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/index.mjs @@ -0,0 +1,324 @@ +import { warnOnce, SubscriptionManager, velocityPerSecond } from 'motion-utils'; +import { time } from '../frameloop/sync-time.mjs'; +import { frame } from '../frameloop/frame.mjs'; + +/** + * Maximum time between the value of two frames, beyond which we + * assume the velocity has since been 0. + */ +const MAX_VELOCITY_DELTA = 30; +const isFloat = (value) => { + return !isNaN(parseFloat(value)); +}; +const collectMotionValues = { + current: undefined, +}; +/** + * `MotionValue` is used to track the state and velocity of motion values. + * + * @public + */ +class MotionValue { + /** + * @param init - The initiating value + * @param config - Optional configuration options + * + * - `transformer`: A function to transform incoming values with. + */ + constructor(init, options = {}) { + /** + * Tracks whether this value can output a velocity. Currently this is only true + * if the value is numerical, but we might be able to widen the scope here and support + * other value types. + * + * @internal + */ + this.canTrackVelocity = null; + /** + * An object containing a SubscriptionManager for each active event. + */ + this.events = {}; + this.updateAndNotify = (v) => { + const currentTime = time.now(); + /** + * If we're updating the value during another frame or eventloop + * than the previous frame, then the we set the previous frame value + * to current. + */ + if (this.updatedAt !== currentTime) { + this.setPrevFrameValue(); + } + this.prev = this.current; + this.setCurrent(v); + // Update update subscribers + if (this.current !== this.prev) { + this.events.change?.notify(this.current); + if (this.dependents) { + for (const dependent of this.dependents) { + dependent.dirty(); + } + } + } + }; + this.hasAnimated = false; + this.setCurrent(init); + this.owner = options.owner; + } + setCurrent(current) { + this.current = current; + this.updatedAt = time.now(); + if (this.canTrackVelocity === null && current !== undefined) { + this.canTrackVelocity = isFloat(this.current); + } + } + setPrevFrameValue(prevFrameValue = this.current) { + this.prevFrameValue = prevFrameValue; + this.prevUpdatedAt = this.updatedAt; + } + /** + * Adds a function that will be notified when the `MotionValue` is updated. + * + * It returns a function that, when called, will cancel the subscription. + * + * When calling `onChange` inside a React component, it should be wrapped with the + * `useEffect` hook. As it returns an unsubscribe function, this should be returned + * from the `useEffect` function to ensure you don't add duplicate subscribers.. + * + * ```jsx + * export const MyComponent = () => { + * const x = useMotionValue(0) + * const y = useMotionValue(0) + * const opacity = useMotionValue(1) + * + * useEffect(() => { + * function updateOpacity() { + * const maxXY = Math.max(x.get(), y.get()) + * const newOpacity = transform(maxXY, [0, 100], [1, 0]) + * opacity.set(newOpacity) + * } + * + * const unsubscribeX = x.on("change", updateOpacity) + * const unsubscribeY = y.on("change", updateOpacity) + * + * return () => { + * unsubscribeX() + * unsubscribeY() + * } + * }, []) + * + * return + * } + * ``` + * + * @param subscriber - A function that receives the latest value. + * @returns A function that, when called, will cancel this subscription. + * + * @deprecated + */ + onChange(subscription) { + if (process.env.NODE_ENV !== "production") { + warnOnce(false, `value.onChange(callback) is deprecated. Switch to value.on("change", callback).`); + } + return this.on("change", subscription); + } + on(eventName, callback) { + if (!this.events[eventName]) { + this.events[eventName] = new SubscriptionManager(); + } + const unsubscribe = this.events[eventName].add(callback); + if (eventName === "change") { + return () => { + unsubscribe(); + /** + * If we have no more change listeners by the start + * of the next frame, stop active animations. + */ + frame.read(() => { + if (!this.events.change.getSize()) { + this.stop(); + } + }); + }; + } + return unsubscribe; + } + clearListeners() { + for (const eventManagers in this.events) { + this.events[eventManagers].clear(); + } + } + /** + * Attaches a passive effect to the `MotionValue`. + */ + attach(passiveEffect, stopPassiveEffect) { + this.passiveEffect = passiveEffect; + this.stopPassiveEffect = stopPassiveEffect; + } + /** + * Sets the state of the `MotionValue`. + * + * @remarks + * + * ```jsx + * const x = useMotionValue(0) + * x.set(10) + * ``` + * + * @param latest - Latest value to set. + * @param render - Whether to notify render subscribers. Defaults to `true` + * + * @public + */ + set(v) { + if (!this.passiveEffect) { + this.updateAndNotify(v); + } + else { + this.passiveEffect(v, this.updateAndNotify); + } + } + setWithVelocity(prev, current, delta) { + this.set(current); + this.prev = undefined; + this.prevFrameValue = prev; + this.prevUpdatedAt = this.updatedAt - delta; + } + /** + * Set the state of the `MotionValue`, stopping any active animations, + * effects, and resets velocity to `0`. + */ + jump(v, endAnimation = true) { + this.updateAndNotify(v); + this.prev = v; + this.prevUpdatedAt = this.prevFrameValue = undefined; + endAnimation && this.stop(); + if (this.stopPassiveEffect) + this.stopPassiveEffect(); + } + dirty() { + this.events.change?.notify(this.current); + } + addDependent(dependent) { + if (!this.dependents) { + this.dependents = new Set(); + } + this.dependents.add(dependent); + } + removeDependent(dependent) { + if (this.dependents) { + this.dependents.delete(dependent); + } + } + /** + * Returns the latest state of `MotionValue` + * + * @returns - The latest state of `MotionValue` + * + * @public + */ + get() { + if (collectMotionValues.current) { + collectMotionValues.current.push(this); + } + return this.current; + } + /** + * @public + */ + getPrevious() { + return this.prev; + } + /** + * Returns the latest velocity of `MotionValue` + * + * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical. + * + * @public + */ + getVelocity() { + const currentTime = time.now(); + if (!this.canTrackVelocity || + this.prevFrameValue === undefined || + currentTime - this.updatedAt > MAX_VELOCITY_DELTA) { + return 0; + } + const delta = Math.min(this.updatedAt - this.prevUpdatedAt, MAX_VELOCITY_DELTA); + // Casts because of parseFloat's poor typing + return velocityPerSecond(parseFloat(this.current) - + parseFloat(this.prevFrameValue), delta); + } + /** + * Registers a new animation to control this `MotionValue`. Only one + * animation can drive a `MotionValue` at one time. + * + * ```jsx + * value.start() + * ``` + * + * @param animation - A function that starts the provided animation + */ + start(startAnimation) { + this.stop(); + return new Promise((resolve) => { + this.hasAnimated = true; + this.animation = startAnimation(resolve); + if (this.events.animationStart) { + this.events.animationStart.notify(); + } + }).then(() => { + if (this.events.animationComplete) { + this.events.animationComplete.notify(); + } + this.clearAnimation(); + }); + } + /** + * Stop the currently active animation. + * + * @public + */ + stop() { + if (this.animation) { + this.animation.stop(); + if (this.events.animationCancel) { + this.events.animationCancel.notify(); + } + } + this.clearAnimation(); + } + /** + * Returns `true` if this value is currently animating. + * + * @public + */ + isAnimating() { + return !!this.animation; + } + clearAnimation() { + delete this.animation; + } + /** + * Destroy and clean up subscribers to this `MotionValue`. + * + * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically + * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually + * created a `MotionValue` via the `motionValue` function. + * + * @public + */ + destroy() { + this.dependents?.clear(); + this.events.destroy?.notify(); + this.clearListeners(); + this.stop(); + if (this.stopPassiveEffect) { + this.stopPassiveEffect(); + } + } +} +function motionValue(init, options) { + return new MotionValue(init, options); +} + +export { MotionValue, collectMotionValues, motionValue }; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/index.mjs.map b/node_modules/motion-dom/dist/es/value/index.mjs.map new file mode 100644 index 0000000..f8a3c4e --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../../../src/value/index.ts"],"sourcesContent":["import {\n EasingFunction,\n SubscriptionManager,\n velocityPerSecond,\n warnOnce,\n} from \"motion-utils\"\nimport {\n AnimationPlaybackControlsWithThen,\n AnyResolvedKeyframe,\n TransformProperties,\n} from \"../animation/types\"\nimport { frame } from \"../frameloop\"\nimport { time } from \"../frameloop/sync-time\"\n\n/**\n * @public\n */\nexport type Subscriber = (v: T) => void\n\n/**\n * @public\n */\nexport type PassiveEffect = (v: T, safeSetter: (v: T) => void) => void\n\nexport type StartAnimation = (\n complete: () => void\n) => AnimationPlaybackControlsWithThen | undefined\n\nexport interface MotionValueEventCallbacks {\n animationStart: () => void\n animationComplete: () => void\n animationCancel: () => void\n change: (latestValue: V) => void\n destroy: () => void\n}\n\n/**\n * Maximum time between the value of two frames, beyond which we\n * assume the velocity has since been 0.\n */\nconst MAX_VELOCITY_DELTA = 30\n\nconst isFloat = (value: any): value is string => {\n return !isNaN(parseFloat(value))\n}\n\ninterface ResolvedValues {\n [key: string]: AnyResolvedKeyframe\n}\n\nexport interface Owner {\n current: HTMLElement | unknown\n getProps: () => {\n onUpdate?: (latest: ResolvedValues) => void\n transformTemplate?: (\n transform: TransformProperties,\n generatedTransform: string\n ) => string\n }\n}\n\nexport interface AccelerateConfig {\n factory: (animation: AnimationPlaybackControlsWithThen) => VoidFunction\n times: number[]\n keyframes: any[]\n ease?: EasingFunction | EasingFunction[]\n duration: number\n isTransformed?: boolean\n}\n\nexport interface MotionValueOptions {\n owner?: Owner\n}\n\nexport const collectMotionValues: { current: MotionValue[] | undefined } = {\n current: undefined,\n}\n\n/**\n * `MotionValue` is used to track the state and velocity of motion values.\n *\n * @public\n */\nexport class MotionValue {\n /**\n * If a MotionValue has an owner, it was created internally within Motion\n * and therefore has no external listeners. It is therefore safe to animate via WAAPI.\n */\n owner?: Owner\n\n /**\n * The current state of the `MotionValue`.\n */\n private current: V | undefined\n\n /**\n * The previous state of the `MotionValue`.\n */\n private prev: V | undefined\n\n /**\n * The previous state of the `MotionValue` at the end of the previous frame.\n */\n private prevFrameValue: V | undefined\n\n /**\n * The last time the `MotionValue` was updated.\n */\n updatedAt: number\n\n /**\n * The time `prevFrameValue` was updated.\n */\n prevUpdatedAt: number | undefined\n\n /**\n * Add a passive effect to this `MotionValue`.\n *\n * A passive effect intercepts calls to `set`. For instance, `useSpring` adds\n * a passive effect that attaches a `spring` to the latest\n * set value. Hypothetically there could be a `useSmooth` that attaches an input smoothing effect.\n *\n * @internal\n */\n private passiveEffect?: PassiveEffect\n private stopPassiveEffect?: VoidFunction\n\n /**\n * Whether the passive effect is active.\n */\n isEffectActive?: boolean\n\n /**\n * A reference to the currently-controlling animation.\n */\n animation?: AnimationPlaybackControlsWithThen\n\n /**\n * Tracks whether this value can output a velocity. Currently this is only true\n * if the value is numerical, but we might be able to widen the scope here and support\n * other value types.\n *\n * @internal\n */\n private canTrackVelocity: boolean | null = null\n\n /**\n * A list of MotionValues whose values are computed from this one.\n * This is a rough start to a proper signal-like dirtying system.\n */\n private dependents: Set | undefined\n\n /**\n * Tracks whether this value should be removed\n */\n liveStyle?: boolean\n\n /**\n * Scroll timeline acceleration metadata. When set, VisualElement\n * can create a native WAAPI animation attached to a scroll timeline\n * instead of driving updates through JS.\n */\n accelerate?: AccelerateConfig\n\n /**\n * @param init - The initiating value\n * @param config - Optional configuration options\n *\n * - `transformer`: A function to transform incoming values with.\n */\n constructor(init: V, options: MotionValueOptions = {}) {\n this.setCurrent(init)\n this.owner = options.owner\n }\n\n setCurrent(current: V) {\n this.current = current\n this.updatedAt = time.now()\n\n if (this.canTrackVelocity === null && current !== undefined) {\n this.canTrackVelocity = isFloat(this.current)\n }\n }\n\n setPrevFrameValue(prevFrameValue: V | undefined = this.current) {\n this.prevFrameValue = prevFrameValue\n this.prevUpdatedAt = this.updatedAt\n }\n\n /**\n * Adds a function that will be notified when the `MotionValue` is updated.\n *\n * It returns a function that, when called, will cancel the subscription.\n *\n * When calling `onChange` inside a React component, it should be wrapped with the\n * `useEffect` hook. As it returns an unsubscribe function, this should be returned\n * from the `useEffect` function to ensure you don't add duplicate subscribers..\n *\n * ```jsx\n * export const MyComponent = () => {\n * const x = useMotionValue(0)\n * const y = useMotionValue(0)\n * const opacity = useMotionValue(1)\n *\n * useEffect(() => {\n * function updateOpacity() {\n * const maxXY = Math.max(x.get(), y.get())\n * const newOpacity = transform(maxXY, [0, 100], [1, 0])\n * opacity.set(newOpacity)\n * }\n *\n * const unsubscribeX = x.on(\"change\", updateOpacity)\n * const unsubscribeY = y.on(\"change\", updateOpacity)\n *\n * return () => {\n * unsubscribeX()\n * unsubscribeY()\n * }\n * }, [])\n *\n * return \n * }\n * ```\n *\n * @param subscriber - A function that receives the latest value.\n * @returns A function that, when called, will cancel this subscription.\n *\n * @deprecated\n */\n onChange(subscription: Subscriber): () => void {\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(\n false,\n `value.onChange(callback) is deprecated. Switch to value.on(\"change\", callback).`\n )\n }\n return this.on(\"change\", subscription)\n }\n\n /**\n * An object containing a SubscriptionManager for each active event.\n */\n private events: {\n [key: string]: SubscriptionManager\n } = {}\n\n on>(\n eventName: EventName,\n callback: MotionValueEventCallbacks[EventName]\n ) {\n if (!this.events[eventName]) {\n this.events[eventName] = new SubscriptionManager()\n }\n\n const unsubscribe = this.events[eventName].add(callback)\n\n if (eventName === \"change\") {\n return () => {\n unsubscribe()\n\n /**\n * If we have no more change listeners by the start\n * of the next frame, stop active animations.\n */\n frame.read(() => {\n if (!this.events.change.getSize()) {\n this.stop()\n }\n })\n }\n }\n\n return unsubscribe\n }\n\n clearListeners() {\n for (const eventManagers in this.events) {\n this.events[eventManagers].clear()\n }\n }\n\n /**\n * Attaches a passive effect to the `MotionValue`.\n */\n attach(passiveEffect: PassiveEffect, stopPassiveEffect: VoidFunction) {\n this.passiveEffect = passiveEffect\n this.stopPassiveEffect = stopPassiveEffect\n }\n\n /**\n * Sets the state of the `MotionValue`.\n *\n * @remarks\n *\n * ```jsx\n * const x = useMotionValue(0)\n * x.set(10)\n * ```\n *\n * @param latest - Latest value to set.\n * @param render - Whether to notify render subscribers. Defaults to `true`\n *\n * @public\n */\n set(v: V) {\n if (!this.passiveEffect) {\n this.updateAndNotify(v)\n } else {\n this.passiveEffect(v, this.updateAndNotify)\n }\n }\n\n setWithVelocity(prev: V, current: V, delta: number) {\n this.set(current)\n this.prev = undefined\n this.prevFrameValue = prev\n this.prevUpdatedAt = this.updatedAt - delta\n }\n\n /**\n * Set the state of the `MotionValue`, stopping any active animations,\n * effects, and resets velocity to `0`.\n */\n jump(v: V, endAnimation = true) {\n this.updateAndNotify(v)\n this.prev = v\n this.prevUpdatedAt = this.prevFrameValue = undefined\n endAnimation && this.stop()\n if (this.stopPassiveEffect) this.stopPassiveEffect()\n }\n\n dirty() {\n this.events.change?.notify(this.current)\n }\n\n addDependent(dependent: MotionValue) {\n if (!this.dependents) {\n this.dependents = new Set()\n }\n this.dependents.add(dependent)\n }\n\n removeDependent(dependent: MotionValue) {\n if (this.dependents) {\n this.dependents.delete(dependent)\n }\n }\n\n updateAndNotify = (v: V) => {\n const currentTime = time.now()\n\n /**\n * If we're updating the value during another frame or eventloop\n * than the previous frame, then the we set the previous frame value\n * to current.\n */\n if (this.updatedAt !== currentTime) {\n this.setPrevFrameValue()\n }\n\n this.prev = this.current\n\n this.setCurrent(v)\n\n // Update update subscribers\n if (this.current !== this.prev) {\n this.events.change?.notify(this.current)\n\n if (this.dependents) {\n for (const dependent of this.dependents) {\n dependent.dirty()\n }\n }\n }\n }\n\n /**\n * Returns the latest state of `MotionValue`\n *\n * @returns - The latest state of `MotionValue`\n *\n * @public\n */\n get() {\n if (collectMotionValues.current) {\n collectMotionValues.current.push(this)\n }\n\n return this.current!\n }\n\n /**\n * @public\n */\n getPrevious() {\n return this.prev\n }\n\n /**\n * Returns the latest velocity of `MotionValue`\n *\n * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical.\n *\n * @public\n */\n getVelocity() {\n const currentTime = time.now()\n\n if (\n !this.canTrackVelocity ||\n this.prevFrameValue === undefined ||\n currentTime - this.updatedAt > MAX_VELOCITY_DELTA\n ) {\n return 0\n }\n\n const delta = Math.min(\n this.updatedAt - this.prevUpdatedAt!,\n MAX_VELOCITY_DELTA\n )\n\n // Casts because of parseFloat's poor typing\n return velocityPerSecond(\n parseFloat(this.current as any) -\n parseFloat(this.prevFrameValue as any),\n delta\n )\n }\n\n hasAnimated = false\n\n /**\n * Registers a new animation to control this `MotionValue`. Only one\n * animation can drive a `MotionValue` at one time.\n *\n * ```jsx\n * value.start()\n * ```\n *\n * @param animation - A function that starts the provided animation\n */\n start(startAnimation: StartAnimation) {\n this.stop()\n\n return new Promise((resolve) => {\n this.hasAnimated = true\n this.animation = startAnimation(resolve)\n\n if (this.events.animationStart) {\n this.events.animationStart.notify()\n }\n }).then(() => {\n if (this.events.animationComplete) {\n this.events.animationComplete.notify()\n }\n this.clearAnimation()\n })\n }\n\n /**\n * Stop the currently active animation.\n *\n * @public\n */\n stop() {\n if (this.animation) {\n this.animation.stop()\n if (this.events.animationCancel) {\n this.events.animationCancel.notify()\n }\n }\n this.clearAnimation()\n }\n\n /**\n * Returns `true` if this value is currently animating.\n *\n * @public\n */\n isAnimating() {\n return !!this.animation\n }\n\n private clearAnimation() {\n delete this.animation\n }\n\n /**\n * Destroy and clean up subscribers to this `MotionValue`.\n *\n * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically\n * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually\n * created a `MotionValue` via the `motionValue` function.\n *\n * @public\n */\n destroy() {\n this.dependents?.clear()\n this.events.destroy?.notify()\n this.clearListeners()\n this.stop()\n\n if (this.stopPassiveEffect) {\n this.stopPassiveEffect()\n }\n }\n}\n\nexport function motionValue(init: V, options?: MotionValueOptions) {\n return new MotionValue(init, options)\n}\n"],"names":[],"mappings":";;;;AAoCA;;;AAGG;AACH,MAAM,kBAAkB,GAAG,EAAE;AAE7B,MAAM,OAAO,GAAG,CAAC,KAAU,KAAqB;IAC5C,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;AACpC,CAAC;AA8BM,MAAM,mBAAmB,GAA2C;AACvE,IAAA,OAAO,EAAE,SAAS;;AAGtB;;;;AAIG;MACU,WAAW,CAAA;AAiFpB;;;;;AAKG;IACH,WAAA,CAAY,IAAO,EAAE,OAAA,GAA8B,EAAE,EAAA;AAjCrD;;;;;;AAMG;QACK,IAAA,CAAA,gBAAgB,GAAmB,IAAI;AA+F/C;;AAEG;QACK,IAAA,CAAA,MAAM,GAEV,EAAE;AAwGN,QAAA,IAAA,CAAA,eAAe,GAAG,CAAC,CAAI,KAAI;AACvB,YAAA,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,EAAE;AAE9B;;;;AAIG;AACH,YAAA,IAAI,IAAI,CAAC,SAAS,KAAK,WAAW,EAAE;gBAChC,IAAI,CAAC,iBAAiB,EAAE;YAC5B;AAEA,YAAA,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,OAAO;AAExB,YAAA,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;;YAGlB,IAAI,IAAI,CAAC,OAAO,KAAK,IAAI,CAAC,IAAI,EAAE;gBAC5B,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC;AAExC,gBAA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AC,cAAc,EAAE;IACzB;AAEA;;;;AAIG;IACH,WAAW,GAAA;AACP,QAAA,OAAO,CAAC,CAAC,IAAI,CAAC,SAAS;IAC3B;IAEQ,cAAc,GAAA;QAClB,OAAO,IAAI,CAAC,SAAS;IACzB;AAEA;;;;;;;;AAQG;IACH,OAAO,GAAA;AACH,QAAA,IAAI,CAAC,UAAU,EAAE,KAAK,EAAE;AACxB,QAAA,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE;QAC7B,IAAI,CAAC,cAAc,EAAE;QACrB,IAAI,CAAC,IAAI,EAAE;AAEX,QAAA,IAAI,IAAI,CAAC,iBAAiB,EAAE;YACxB,IAAI,CAAC,iBAAiB,EAAE;QAC5B;IACJ;AACH;AAEK,SAAU,WAAW,CAAI,IAAO,EAAE,OAA4B,EAAA;AAChE,IAAA,OAAO,IAAI,WAAW,CAAI,IAAI,EAAE,OAAO,CAAC;AAC5C;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/map-value.mjs b/node_modules/motion-dom/dist/es/value/map-value.mjs new file mode 100644 index 0000000..d3eb12f --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/map-value.mjs @@ -0,0 +1,47 @@ +import { transform } from '../utils/transform.mjs'; +import { transformValue } from './transform-value.mjs'; + +/** + * Create a `MotionValue` that maps the output of another `MotionValue` by + * mapping it from one range of values into another. + * + * @remarks + * + * Given an input range of `[-200, -100, 100, 200]` and an output range of + * `[0, 1, 1, 0]`, the returned `MotionValue` will: + * + * - When provided a value between `-200` and `-100`, will return a value between `0` and `1`. + * - When provided a value between `-100` and `100`, will return `1`. + * - When provided a value between `100` and `200`, will return a value between `1` and `0` + * + * The input range must be a linear series of numbers. The output range + * can be any value type supported by Motion: numbers, colors, shadows, etc. + * + * Every value in the output range must be of the same type and in the same format. + * + * ```jsx + * const x = motionValue(0) + * const xRange = [-200, -100, 100, 200] + * const opacityRange = [0, 1, 1, 0] + * const opacity = mapValue(x, xRange, opacityRange) + * ``` + * + * @param inputValue - `MotionValue` + * @param inputRange - A linear series of numbers (either all increasing or decreasing) + * @param outputRange - A series of numbers, colors or strings. Must be the same length as `inputRange`. + * @param options - + * + * - clamp: boolean. Clamp values to within the given range. Defaults to `true` + * - ease: EasingFunction[]. Easing functions to use on the interpolations between each value in the input and output ranges. If provided as an array, the array must be one item shorter than the input and output ranges, as the easings apply to the transition between each. + * + * @returns `MotionValue` + * + * @public + */ +function mapValue(inputValue, inputRange, outputRange, options) { + const map = transform(inputRange, outputRange, options); + return transformValue(() => map(inputValue.get())); +} + +export { mapValue }; +//# sourceMappingURL=map-value.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/map-value.mjs.map b/node_modules/motion-dom/dist/es/value/map-value.mjs.map new file mode 100644 index 0000000..02c07cd --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/map-value.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"map-value.mjs","sources":["../../../src/value/map-value.ts"],"sourcesContent":["import { MotionValue } from \".\"\nimport { transform, TransformOptions } from \"../utils/transform\"\nimport { transformValue } from \"./transform-value\"\n\nexport type MapInputRange = number[]\n\n/**\n * Create a `MotionValue` that maps the output of another `MotionValue` by\n * mapping it from one range of values into another.\n *\n * @remarks\n *\n * Given an input range of `[-200, -100, 100, 200]` and an output range of\n * `[0, 1, 1, 0]`, the returned `MotionValue` will:\n *\n * - When provided a value between `-200` and `-100`, will return a value between `0` and `1`.\n * - When provided a value between `-100` and `100`, will return `1`.\n * - When provided a value between `100` and `200`, will return a value between `1` and `0`\n *\n * The input range must be a linear series of numbers. The output range\n * can be any value type supported by Motion: numbers, colors, shadows, etc.\n *\n * Every value in the output range must be of the same type and in the same format.\n *\n * ```jsx\n * const x = motionValue(0)\n * const xRange = [-200, -100, 100, 200]\n * const opacityRange = [0, 1, 1, 0]\n * const opacity = mapValue(x, xRange, opacityRange)\n * ```\n *\n * @param inputValue - `MotionValue`\n * @param inputRange - A linear series of numbers (either all increasing or decreasing)\n * @param outputRange - A series of numbers, colors or strings. Must be the same length as `inputRange`.\n * @param options -\n *\n * - clamp: boolean. Clamp values to within the given range. Defaults to `true`\n * - ease: EasingFunction[]. Easing functions to use on the interpolations between each value in the input and output ranges. If provided as an array, the array must be one item shorter than the input and output ranges, as the easings apply to the transition between each.\n *\n * @returns `MotionValue`\n *\n * @public\n */\nexport function mapValue(\n inputValue: MotionValue,\n inputRange: MapInputRange,\n outputRange: O[],\n options?: TransformOptions\n): MotionValue {\n const map = transform(inputRange, outputRange, options)\n return transformValue(() => map(inputValue.get()))\n}\n"],"names":[],"mappings":";;;AAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCG;AACG,SAAU,QAAQ,CACpB,UAA+B,EAC/B,UAAyB,EACzB,WAAgB,EAChB,OAA6B,EAAA;IAE7B,MAAM,GAAG,GAAG,SAAS,CAAC,UAAU,EAAE,WAAW,EAAE,OAAO,CAAC;AACvD,IAAA,OAAO,cAAc,CAAC,MAAM,GAAG,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC,CAAC;AACtD;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/spring-value.mjs b/node_modules/motion-dom/dist/es/value/spring-value.mjs new file mode 100644 index 0000000..72b28b1 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/spring-value.mjs @@ -0,0 +1,36 @@ +import { attachFollow, followValue } from './follow-value.mjs'; + +/** + * Create a `MotionValue` that animates to its latest value using a spring. + * Can either be a value or track another `MotionValue`. + * + * ```jsx + * const x = motionValue(0) + * const y = springValue(x, { stiffness: 300 }) + * ``` + * + * @param source - Initial value or MotionValue to track + * @param options - Spring configuration options + * @returns `MotionValue` + * + * @public + */ +function springValue(source, options) { + return followValue(source, { type: "spring", ...options }); +} +/** + * Attach a spring animation to a MotionValue that will animate whenever the value changes. + * + * @param value - The MotionValue to animate + * @param source - Initial value or MotionValue to track + * @param options - Spring configuration options + * @returns Cleanup function + * + * @public + */ +function attachSpring(value, source, options) { + return attachFollow(value, source, { type: "spring", ...options }); +} + +export { attachSpring, springValue }; +//# sourceMappingURL=spring-value.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/spring-value.mjs.map b/node_modules/motion-dom/dist/es/value/spring-value.mjs.map new file mode 100644 index 0000000..7b9b761 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/spring-value.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"spring-value.mjs","sources":["../../../src/value/spring-value.ts"],"sourcesContent":["import { MotionValue } from \".\"\nimport { AnyResolvedKeyframe, SpringOptions } from \"../animation/types\"\nimport { attachFollow, followValue } from \"./follow-value\"\n\n/**\n * Create a `MotionValue` that animates to its latest value using a spring.\n * Can either be a value or track another `MotionValue`.\n *\n * ```jsx\n * const x = motionValue(0)\n * const y = springValue(x, { stiffness: 300 })\n * ```\n *\n * @param source - Initial value or MotionValue to track\n * @param options - Spring configuration options\n * @returns `MotionValue`\n *\n * @public\n */\nexport function springValue(\n source: T | MotionValue,\n options?: SpringOptions\n) {\n return followValue(source, { type: \"spring\", ...options })\n}\n\n/**\n * Attach a spring animation to a MotionValue that will animate whenever the value changes.\n *\n * @param value - The MotionValue to animate\n * @param source - Initial value or MotionValue to track\n * @param options - Spring configuration options\n * @returns Cleanup function\n *\n * @public\n */\nexport function attachSpring(\n value: MotionValue,\n source: T | MotionValue,\n options?: SpringOptions\n): VoidFunction {\n return attachFollow(value, source, { type: \"spring\", ...options })\n}\n"],"names":[],"mappings":";;AAIA;;;;;;;;;;;;;;AAcG;AACG,SAAU,WAAW,CACvB,MAA0B,EAC1B,OAAuB,EAAA;AAEvB,IAAA,OAAO,WAAW,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,OAAO,EAAE,CAAC;AAC9D;AAEA;;;;;;;;;AASG;SACa,YAAY,CACxB,KAAqB,EACrB,MAA0B,EAC1B,OAAuB,EAAA;AAEvB,IAAA,OAAO,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,OAAO,EAAE,CAAC;AACtE;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/subscribe-value.mjs b/node_modules/motion-dom/dist/es/value/subscribe-value.mjs new file mode 100644 index 0000000..166c874 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/subscribe-value.mjs @@ -0,0 +1,14 @@ +import { cancelFrame, frame } from '../frameloop/frame.mjs'; + +function subscribeValue(inputValues, outputValue, getLatest) { + const update = () => outputValue.set(getLatest()); + const scheduleUpdate = () => frame.preRender(update, false, true); + const subscriptions = inputValues.map((v) => v.on("change", scheduleUpdate)); + outputValue.on("destroy", () => { + subscriptions.forEach((unsubscribe) => unsubscribe()); + cancelFrame(update); + }); +} + +export { subscribeValue }; +//# sourceMappingURL=subscribe-value.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/subscribe-value.mjs.map b/node_modules/motion-dom/dist/es/value/subscribe-value.mjs.map new file mode 100644 index 0000000..1678e50 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/subscribe-value.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"subscribe-value.mjs","sources":["../../../src/value/subscribe-value.ts"],"sourcesContent":["import { MotionValue } from \".\"\nimport { cancelFrame, frame } from \"../frameloop\"\n\nexport function subscribeValue(\n inputValues: MotionValue[],\n outputValue: MotionValue,\n getLatest: () => O\n) {\n const update = () => outputValue.set(getLatest())\n const scheduleUpdate = () => frame.preRender(update, false, true)\n\n const subscriptions = inputValues.map((v) => v.on(\"change\", scheduleUpdate))\n\n outputValue.on(\"destroy\", () => {\n subscriptions.forEach((unsubscribe) => unsubscribe())\n cancelFrame(update)\n })\n}\n"],"names":[],"mappings":";;SAGgB,cAAc,CAC1B,WAA0B,EAC1B,WAA2B,EAC3B,SAAkB,EAAA;AAElB,IAAA,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC;AACjD,IAAA,MAAM,cAAc,GAAG,MAAM,KAAK,CAAC,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC;IAEjE,MAAM,aAAa,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;AAE5E,IAAA,WAAW,CAAC,EAAE,CAAC,SAAS,EAAE,MAAK;QAC3B,aAAa,CAAC,OAAO,CAAC,CAAC,WAAW,KAAK,WAAW,EAAE,CAAC;QACrD,WAAW,CAAC,MAAM,CAAC;AACvB,IAAA,CAAC,CAAC;AACN;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/transform-value.mjs b/node_modules/motion-dom/dist/es/value/transform-value.mjs new file mode 100644 index 0000000..fd2c4e0 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/transform-value.mjs @@ -0,0 +1,36 @@ +import { collectMotionValues, motionValue } from './index.mjs'; +import { subscribeValue } from './subscribe-value.mjs'; + +/** + * Create a `MotionValue` that transforms the output of other `MotionValue`s by + * passing their latest values through a transform function. + * + * Whenever a `MotionValue` referred to in the provided function is updated, + * it will be re-evaluated. + * + * ```jsx + * const x = motionValue(0) + * const y = transformValue(() => x.get() * 2) // double x + * ``` + * + * @param transformer - A transform function. This function must be pure with no side-effects or conditional statements. + * @returns `MotionValue` + * + * @public + */ +function transformValue(transform) { + const collectedValues = []; + /** + * Open session of collectMotionValues. Any MotionValue that calls get() + * inside transform will be saved into this array. + */ + collectMotionValues.current = collectedValues; + const initialValue = transform(); + collectMotionValues.current = undefined; + const value = motionValue(initialValue); + subscribeValue(collectedValues, value, transform); + return value; +} + +export { transformValue }; +//# sourceMappingURL=transform-value.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/transform-value.mjs.map b/node_modules/motion-dom/dist/es/value/transform-value.mjs.map new file mode 100644 index 0000000..3f5c525 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/transform-value.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"transform-value.mjs","sources":["../../../src/value/transform-value.ts"],"sourcesContent":["import { MotionValue, collectMotionValues, motionValue } from \".\"\nimport { subscribeValue } from \"./subscribe-value\"\n\nexport type TransformInputRange = number[]\nexport type SingleTransformer = (input: I) => O\nexport type MultiTransformer = (input: I[]) => O\nexport type ValueTransformer =\n | SingleTransformer\n | MultiTransformer\n\n/**\n * Create a `MotionValue` that transforms the output of other `MotionValue`s by\n * passing their latest values through a transform function.\n *\n * Whenever a `MotionValue` referred to in the provided function is updated,\n * it will be re-evaluated.\n *\n * ```jsx\n * const x = motionValue(0)\n * const y = transformValue(() => x.get() * 2) // double x\n * ```\n *\n * @param transformer - A transform function. This function must be pure with no side-effects or conditional statements.\n * @returns `MotionValue`\n *\n * @public\n */\nexport function transformValue(transform: () => O): MotionValue {\n const collectedValues: MotionValue[] = []\n\n /**\n * Open session of collectMotionValues. Any MotionValue that calls get()\n * inside transform will be saved into this array.\n */\n collectMotionValues.current = collectedValues\n const initialValue = transform()\n collectMotionValues.current = undefined\n\n const value = motionValue(initialValue)\n\n subscribeValue(collectedValues, value, transform)\n\n return value\n}\n"],"names":[],"mappings":";;;AAUA;;;;;;;;;;;;;;;;AAgBG;AACG,SAAU,cAAc,CAAI,SAAkB,EAAA;IAChD,MAAM,eAAe,GAAkB,EAAE;AAEzC;;;AAGG;AACH,IAAA,mBAAmB,CAAC,OAAO,GAAG,eAAe;AAC7C,IAAA,MAAM,YAAY,GAAG,SAAS,EAAE;AAChC,IAAA,mBAAmB,CAAC,OAAO,GAAG,SAAS;AAEvC,IAAA,MAAM,KAAK,GAAG,WAAW,CAAC,YAAY,CAAC;AAEvC,IAAA,cAAc,CAAC,eAAe,EAAE,KAAK,EAAE,SAAS,CAAC;AAEjD,IAAA,OAAO,KAAK;AAChB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/auto.mjs b/node_modules/motion-dom/dist/es/value/types/auto.mjs new file mode 100644 index 0000000..b514b87 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/auto.mjs @@ -0,0 +1,10 @@ +/** + * ValueType for "auto" + */ +const auto = { + test: (v) => v === "auto", + parse: (v) => v, +}; + +export { auto }; +//# sourceMappingURL=auto.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/auto.mjs.map b/node_modules/motion-dom/dist/es/value/types/auto.mjs.map new file mode 100644 index 0000000..3f0517d --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/auto.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"auto.mjs","sources":["../../../../src/value/types/auto.ts"],"sourcesContent":["import { ValueType } from \"./types\"\n\n/**\n * ValueType for \"auto\"\n */\nexport const auto: ValueType = {\n test: (v: any) => v === \"auto\",\n parse: (v) => v,\n}\n"],"names":[],"mappings":"AAEA;;AAEG;AACI,MAAM,IAAI,GAAc;IAC3B,IAAI,EAAE,CAAC,CAAM,KAAK,CAAC,KAAK,MAAM;AAC9B,IAAA,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/color/hex.mjs b/node_modules/motion-dom/dist/es/value/types/color/hex.mjs new file mode 100644 index 0000000..1ec7840 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/color/hex.mjs @@ -0,0 +1,41 @@ +import { rgba } from './rgba.mjs'; +import { isColorString } from './utils.mjs'; + +function parseHex(v) { + let r = ""; + let g = ""; + let b = ""; + let a = ""; + // If we have 6 characters, ie #FF0000 + if (v.length > 5) { + r = v.substring(1, 3); + g = v.substring(3, 5); + b = v.substring(5, 7); + a = v.substring(7, 9); + // Or we have 3 characters, ie #F00 + } + else { + r = v.substring(1, 2); + g = v.substring(2, 3); + b = v.substring(3, 4); + a = v.substring(4, 5); + r += r; + g += g; + b += b; + a += a; + } + return { + red: parseInt(r, 16), + green: parseInt(g, 16), + blue: parseInt(b, 16), + alpha: a ? parseInt(a, 16) / 255 : 1, + }; +} +const hex = { + test: /*@__PURE__*/ isColorString("#"), + parse: parseHex, + transform: rgba.transform, +}; + +export { hex }; +//# sourceMappingURL=hex.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/color/hex.mjs.map b/node_modules/motion-dom/dist/es/value/types/color/hex.mjs.map new file mode 100644 index 0000000..1ae6fff --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/color/hex.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"hex.mjs","sources":["../../../../../src/value/types/color/hex.ts"],"sourcesContent":["import { RGBA } from \"../types\"\nimport { rgba } from \"./rgba\"\nimport { isColorString } from \"./utils\"\n\nfunction parseHex(v: string): RGBA {\n let r = \"\"\n let g = \"\"\n let b = \"\"\n let a = \"\"\n\n // If we have 6 characters, ie #FF0000\n if (v.length > 5) {\n r = v.substring(1, 3)\n g = v.substring(3, 5)\n b = v.substring(5, 7)\n a = v.substring(7, 9)\n\n // Or we have 3 characters, ie #F00\n } else {\n r = v.substring(1, 2)\n g = v.substring(2, 3)\n b = v.substring(3, 4)\n a = v.substring(4, 5)\n r += r\n g += g\n b += b\n a += a\n }\n\n return {\n red: parseInt(r, 16),\n green: parseInt(g, 16),\n blue: parseInt(b, 16),\n alpha: a ? parseInt(a, 16) / 255 : 1,\n }\n}\n\nexport const hex = {\n test: /*@__PURE__*/ isColorString(\"#\"),\n parse: parseHex,\n transform: rgba.transform,\n}\n"],"names":[],"mappings":";;;AAIA,SAAS,QAAQ,CAAC,CAAS,EAAA;IACvB,IAAI,CAAC,GAAG,EAAE;IACV,IAAI,CAAC,GAAG,EAAE;IACV,IAAI,CAAC,GAAG,EAAE;IACV,IAAI,CAAC,GAAG,EAAE;;AAGV,IAAA,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE;QACd,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC;QACrB,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC;QACrB,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC;QACrB,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC;;IAGzB;SAAO;QACH,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC;QACrB,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC;QACrB,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC;QACrB,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC;QACrB,CAAC,IAAI,CAAC;QACN,CAAC,IAAI,CAAC;QACN,CAAC,IAAI,CAAC;QACN,CAAC,IAAI,CAAC;IACV;IAEA,OAAO;AACH,QAAA,GAAG,EAAE,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC;AACpB,QAAA,KAAK,EAAE,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC;AACtB,QAAA,IAAI,EAAE,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC;AACrB,QAAA,KAAK,EAAE,CAAC,GAAG,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,GAAG,CAAC;KACvC;AACL;AAEO,MAAM,GAAG,GAAG;AACf,IAAA,IAAI,gBAAgB,aAAa,CAAC,GAAG,CAAC;AACtC,IAAA,KAAK,EAAE,QAAQ;IACf,SAAS,EAAE,IAAI,CAAC,SAAS;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/color/hsla-to-rgba.mjs b/node_modules/motion-dom/dist/es/value/types/color/hsla-to-rgba.mjs new file mode 100644 index 0000000..75a4e52 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/color/hsla-to-rgba.mjs @@ -0,0 +1,43 @@ +// Adapted from https://gist.github.com/mjackson/5311256 +function hueToRgb(p, q, t) { + if (t < 0) + t += 1; + if (t > 1) + t -= 1; + if (t < 1 / 6) + return p + (q - p) * 6 * t; + if (t < 1 / 2) + return q; + if (t < 2 / 3) + return p + (q - p) * (2 / 3 - t) * 6; + return p; +} +function hslaToRgba({ hue, saturation, lightness, alpha }) { + hue /= 360; + saturation /= 100; + lightness /= 100; + let red = 0; + let green = 0; + let blue = 0; + if (!saturation) { + red = green = blue = lightness; + } + else { + const q = lightness < 0.5 + ? lightness * (1 + saturation) + : lightness + saturation - lightness * saturation; + const p = 2 * lightness - q; + red = hueToRgb(p, q, hue + 1 / 3); + green = hueToRgb(p, q, hue); + blue = hueToRgb(p, q, hue - 1 / 3); + } + return { + red: Math.round(red * 255), + green: Math.round(green * 255), + blue: Math.round(blue * 255), + alpha, + }; +} + +export { hslaToRgba }; +//# sourceMappingURL=hsla-to-rgba.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/color/hsla-to-rgba.mjs.map b/node_modules/motion-dom/dist/es/value/types/color/hsla-to-rgba.mjs.map new file mode 100644 index 0000000..eebe3a0 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/color/hsla-to-rgba.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"hsla-to-rgba.mjs","sources":["../../../../../src/value/types/color/hsla-to-rgba.ts"],"sourcesContent":["import { HSLA, RGBA } from \"../types\"\n\n// Adapted from https://gist.github.com/mjackson/5311256\nfunction hueToRgb(p: number, q: number, t: number) {\n if (t < 0) t += 1\n if (t > 1) t -= 1\n if (t < 1 / 6) return p + (q - p) * 6 * t\n if (t < 1 / 2) return q\n if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6\n return p\n}\n\nexport function hslaToRgba({ hue, saturation, lightness, alpha }: HSLA): RGBA {\n hue /= 360\n saturation /= 100\n lightness /= 100\n\n let red = 0\n let green = 0\n let blue = 0\n\n if (!saturation) {\n red = green = blue = lightness\n } else {\n const q =\n lightness < 0.5\n ? lightness * (1 + saturation)\n : lightness + saturation - lightness * saturation\n const p = 2 * lightness - q\n\n red = hueToRgb(p, q, hue + 1 / 3)\n green = hueToRgb(p, q, hue)\n blue = hueToRgb(p, q, hue - 1 / 3)\n }\n\n return {\n red: Math.round(red * 255),\n green: Math.round(green * 255),\n blue: Math.round(blue * 255),\n alpha,\n }\n}\n"],"names":[],"mappings":"AAEA;AACA,SAAS,QAAQ,CAAC,CAAS,EAAE,CAAS,EAAE,CAAS,EAAA;IAC7C,IAAI,CAAC,GAAG,CAAC;QAAE,CAAC,IAAI,CAAC;IACjB,IAAI,CAAC,GAAG,CAAC;QAAE,CAAC,IAAI,CAAC;AACjB,IAAA,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;QAAE,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC;AACzC,IAAA,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;AAAE,QAAA,OAAO,CAAC;AACvB,IAAA,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;AAAE,QAAA,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC;AACnD,IAAA,OAAO,CAAC;AACZ;AAEM,SAAU,UAAU,CAAC,EAAE,GAAG,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,EAAQ,EAAA;IAClE,GAAG,IAAI,GAAG;IACV,UAAU,IAAI,GAAG;IACjB,SAAS,IAAI,GAAG;IAEhB,IAAI,GAAG,GAAG,CAAC;IACX,IAAI,KAAK,GAAG,CAAC;IACb,IAAI,IAAI,GAAG,CAAC;IAEZ,IAAI,CAAC,UAAU,EAAE;AACb,QAAA,GAAG,GAAG,KAAK,GAAG,IAAI,GAAG,SAAS;IAClC;SAAO;AACH,QAAA,MAAM,CAAC,GACH,SAAS,GAAG;AACR,cAAE,SAAS,IAAI,CAAC,GAAG,UAAU;cAC3B,SAAS,GAAG,UAAU,GAAG,SAAS,GAAG,UAAU;AACzD,QAAA,MAAM,CAAC,GAAG,CAAC,GAAG,SAAS,GAAG,CAAC;AAE3B,QAAA,GAAG,GAAG,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;QACjC,KAAK,GAAG,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC;AAC3B,QAAA,IAAI,GAAG,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;IACtC;IAEA,OAAO;QACH,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,GAAG,CAAC;QAC1B,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,GAAG,CAAC;QAC9B,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,GAAG,CAAC;QAC5B,KAAK;KACR;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/color/hsla.mjs b/node_modules/motion-dom/dist/es/value/types/color/hsla.mjs new file mode 100644 index 0000000..d1af665 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/color/hsla.mjs @@ -0,0 +1,23 @@ +import { alpha } from '../numbers/index.mjs'; +import { percent } from '../numbers/units.mjs'; +import { sanitize } from '../utils/sanitize.mjs'; +import { splitColor, isColorString } from './utils.mjs'; + +const hsla = { + test: /*@__PURE__*/ isColorString("hsl", "hue"), + parse: /*@__PURE__*/ splitColor("hue", "saturation", "lightness"), + transform: ({ hue, saturation, lightness, alpha: alpha$1 = 1 }) => { + return ("hsla(" + + Math.round(hue) + + ", " + + percent.transform(sanitize(saturation)) + + ", " + + percent.transform(sanitize(lightness)) + + ", " + + sanitize(alpha.transform(alpha$1)) + + ")"); + }, +}; + +export { hsla }; +//# sourceMappingURL=hsla.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/color/hsla.mjs.map b/node_modules/motion-dom/dist/es/value/types/color/hsla.mjs.map new file mode 100644 index 0000000..a67baaa --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/color/hsla.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"hsla.mjs","sources":["../../../../../src/value/types/color/hsla.ts"],"sourcesContent":["import { alpha as alphaType } from \"../numbers\"\nimport { percent } from \"../numbers/units\"\nimport { HSLA } from \"../types\"\nimport { sanitize } from \"../utils/sanitize\"\nimport { isColorString, splitColor } from \"./utils\"\n\nexport const hsla = {\n test: /*@__PURE__*/ isColorString(\"hsl\", \"hue\"),\n parse: /*@__PURE__*/ splitColor(\"hue\", \"saturation\", \"lightness\"),\n transform: ({ hue, saturation, lightness, alpha = 1 }: HSLA) => {\n return (\n \"hsla(\" +\n Math.round(hue) +\n \", \" +\n percent.transform(sanitize(saturation)) +\n \", \" +\n percent.transform(sanitize(lightness)) +\n \", \" +\n sanitize(alphaType.transform(alpha)) +\n \")\"\n )\n },\n}\n"],"names":["alpha","alphaType"],"mappings":";;;;;AAMO,MAAM,IAAI,GAAG;IAChB,IAAI,gBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,CAAC;IAC/C,KAAK,gBAAgB,UAAU,CAAO,KAAK,EAAE,YAAY,EAAE,WAAW,CAAC;AACvE,IAAA,SAAS,EAAE,CAAC,EAAE,GAAG,EAAE,UAAU,EAAE,SAAS,SAAEA,OAAK,GAAG,CAAC,EAAQ,KAAI;AAC3D,QAAA,QACI,OAAO;AACP,YAAA,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC;YACf,IAAI;AACJ,YAAA,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;YACvC,IAAI;AACJ,YAAA,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;YACtC,IAAI;AACJ,YAAA,QAAQ,CAACC,KAAS,CAAC,SAAS,CAACD,OAAK,CAAC,CAAC;AACpC,YAAA,GAAG;IAEX,CAAC;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/color/index.mjs b/node_modules/motion-dom/dist/es/value/types/color/index.mjs new file mode 100644 index 0000000..8de642b --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/color/index.mjs @@ -0,0 +1,33 @@ +import { hex } from './hex.mjs'; +import { hsla } from './hsla.mjs'; +import { rgba } from './rgba.mjs'; + +const color = { + test: (v) => rgba.test(v) || hex.test(v) || hsla.test(v), + parse: (v) => { + if (rgba.test(v)) { + return rgba.parse(v); + } + else if (hsla.test(v)) { + return hsla.parse(v); + } + else { + return hex.parse(v); + } + }, + transform: (v) => { + return typeof v === "string" + ? v + : v.hasOwnProperty("red") + ? rgba.transform(v) + : hsla.transform(v); + }, + getAnimatableNone: (v) => { + const parsed = color.parse(v); + parsed.alpha = 0; + return color.transform(parsed); + }, +}; + +export { color }; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/color/index.mjs.map b/node_modules/motion-dom/dist/es/value/types/color/index.mjs.map new file mode 100644 index 0000000..d2c99a9 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/color/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../../../../../src/value/types/color/index.ts"],"sourcesContent":["import { HSLA, RGBA } from \"../types\"\nimport { hex } from \"./hex\"\nimport { hsla } from \"./hsla\"\nimport { rgba } from \"./rgba\"\n\nexport const color = {\n test: (v: any) => rgba.test(v) || hex.test(v) || hsla.test(v),\n parse: (v: any): RGBA | HSLA => {\n if (rgba.test(v)) {\n return rgba.parse(v)\n } else if (hsla.test(v)) {\n return hsla.parse(v)\n } else {\n return hex.parse(v)\n }\n },\n transform: (v: HSLA | RGBA | string) => {\n return typeof v === \"string\"\n ? v\n : v.hasOwnProperty(\"red\")\n ? rgba.transform(v as RGBA)\n : hsla.transform(v as HSLA)\n },\n getAnimatableNone: (v: string) => {\n const parsed = color.parse(v)\n parsed.alpha = 0\n return color.transform(parsed)\n },\n}\n"],"names":[],"mappings":";;;;AAKO,MAAM,KAAK,GAAG;IACjB,IAAI,EAAE,CAAC,CAAM,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;AAC7D,IAAA,KAAK,EAAE,CAAC,CAAM,KAAiB;AAC3B,QAAA,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE;AACd,YAAA,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;QACxB;AAAO,aAAA,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE;AACrB,YAAA,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;QACxB;aAAO;AACH,YAAA,OAAO,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;QACvB;IACJ,CAAC;AACD,IAAA,SAAS,EAAE,CAAC,CAAuB,KAAI;QACnC,OAAO,OAAO,CAAC,KAAK;AAChB,cAAE;AACF,cAAE,CAAC,CAAC,cAAc,CAAC,KAAK;AACxB,kBAAE,IAAI,CAAC,SAAS,CAAC,CAAS;AAC1B,kBAAE,IAAI,CAAC,SAAS,CAAC,CAAS,CAAC;IACnC,CAAC;AACD,IAAA,iBAAiB,EAAE,CAAC,CAAS,KAAI;QAC7B,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;AAC7B,QAAA,MAAM,CAAC,KAAK,GAAG,CAAC;AAChB,QAAA,OAAO,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC;IAClC,CAAC;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/color/rgba.mjs b/node_modules/motion-dom/dist/es/value/types/color/rgba.mjs new file mode 100644 index 0000000..8c27af7 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/color/rgba.mjs @@ -0,0 +1,26 @@ +import { clamp } from 'motion-utils'; +import { number, alpha } from '../numbers/index.mjs'; +import { sanitize } from '../utils/sanitize.mjs'; +import { splitColor, isColorString } from './utils.mjs'; + +const clampRgbUnit = (v) => clamp(0, 255, v); +const rgbUnit = { + ...number, + transform: (v) => Math.round(clampRgbUnit(v)), +}; +const rgba = { + test: /*@__PURE__*/ isColorString("rgb", "red"), + parse: /*@__PURE__*/ splitColor("red", "green", "blue"), + transform: ({ red, green, blue, alpha: alpha$1 = 1 }) => "rgba(" + + rgbUnit.transform(red) + + ", " + + rgbUnit.transform(green) + + ", " + + rgbUnit.transform(blue) + + ", " + + sanitize(alpha.transform(alpha$1)) + + ")", +}; + +export { rgbUnit, rgba }; +//# sourceMappingURL=rgba.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/color/rgba.mjs.map b/node_modules/motion-dom/dist/es/value/types/color/rgba.mjs.map new file mode 100644 index 0000000..57b3f0b --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/color/rgba.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"rgba.mjs","sources":["../../../../../src/value/types/color/rgba.ts"],"sourcesContent":["import { clamp } from \"motion-utils\"\nimport { alpha as alphaType, number } from \"../numbers\"\nimport { RGBA } from \"../types\"\nimport { sanitize } from \"../utils/sanitize\"\nimport { isColorString, splitColor } from \"./utils\"\n\nconst clampRgbUnit = (v: number) => clamp(0, 255, v)\nexport const rgbUnit = {\n ...number,\n transform: (v: number) => Math.round(clampRgbUnit(v)),\n}\n\nexport const rgba = {\n test: /*@__PURE__*/ isColorString(\"rgb\", \"red\"),\n parse: /*@__PURE__*/ splitColor(\"red\", \"green\", \"blue\"),\n transform: ({ red, green, blue, alpha = 1 }: RGBA) =>\n \"rgba(\" +\n rgbUnit.transform(red) +\n \", \" +\n rgbUnit.transform(green) +\n \", \" +\n rgbUnit.transform(blue) +\n \", \" +\n sanitize(alphaType.transform(alpha)) +\n \")\",\n}\n"],"names":["alpha","alphaType"],"mappings":";;;;;AAMA,MAAM,YAAY,GAAG,CAAC,CAAS,KAAK,KAAK,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;AAC7C,MAAM,OAAO,GAAG;AACnB,IAAA,GAAG,MAAM;AACT,IAAA,SAAS,EAAE,CAAC,CAAS,KAAK,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;;AAGlD,MAAM,IAAI,GAAG;IAChB,IAAI,gBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,CAAC;IAC/C,KAAK,gBAAgB,UAAU,CAAO,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC;AAC7D,IAAA,SAAS,EAAE,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,SAAEA,OAAK,GAAG,CAAC,EAAQ,KAC7C,OAAO;AACP,QAAA,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC;QACtB,IAAI;AACJ,QAAA,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC;QACxB,IAAI;AACJ,QAAA,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC;QACvB,IAAI;AACJ,QAAA,QAAQ,CAACC,KAAS,CAAC,SAAS,CAACD,OAAK,CAAC,CAAC;QACpC,GAAG;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/color/utils.mjs b/node_modules/motion-dom/dist/es/value/types/color/utils.mjs new file mode 100644 index 0000000..cc4bd12 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/color/utils.mjs @@ -0,0 +1,30 @@ +import { floatRegex } from '../utils/float-regex.mjs'; +import { isNullish } from '../utils/is-nullish.mjs'; +import { singleColorRegex } from '../utils/single-color-regex.mjs'; + +/** + * Returns true if the provided string is a color, ie rgba(0,0,0,0) or #000, + * but false if a number or multiple colors + */ +const isColorString = (type, testProp) => (v) => { + return Boolean((typeof v === "string" && + singleColorRegex.test(v) && + v.startsWith(type)) || + (testProp && + !isNullish(v) && + Object.prototype.hasOwnProperty.call(v, testProp))); +}; +const splitColor = (aName, bName, cName) => (v) => { + if (typeof v !== "string") + return v; + const [a, b, c, alpha] = v.match(floatRegex); + return { + [aName]: parseFloat(a), + [bName]: parseFloat(b), + [cName]: parseFloat(c), + alpha: alpha !== undefined ? parseFloat(alpha) : 1, + }; +}; + +export { isColorString, splitColor }; +//# sourceMappingURL=utils.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/color/utils.mjs.map b/node_modules/motion-dom/dist/es/value/types/color/utils.mjs.map new file mode 100644 index 0000000..7b9b54a --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/color/utils.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"utils.mjs","sources":["../../../../../src/value/types/color/utils.ts"],"sourcesContent":["import { Color, HSLA, RGBA } from \"../types\"\nimport { floatRegex } from \"../utils/float-regex\"\nimport { isNullish } from \"../utils/is-nullish\"\nimport { singleColorRegex } from \"../utils/single-color-regex\"\n\n/**\n * Returns true if the provided string is a color, ie rgba(0,0,0,0) or #000,\n * but false if a number or multiple colors\n */\nexport const isColorString = (type: string, testProp?: string) => (v: any) => {\n return Boolean(\n (typeof v === \"string\" &&\n singleColorRegex.test(v) &&\n v.startsWith(type)) ||\n (testProp &&\n !isNullish(v) &&\n Object.prototype.hasOwnProperty.call(v, testProp))\n )\n}\n\nexport const splitColor =\n (aName: string, bName: string, cName: string) =>\n (v: string | Color): V => {\n if (typeof v !== \"string\") return v as any\n\n const [a, b, c, alpha] = v.match(floatRegex) as any\n\n return {\n [aName]: parseFloat(a),\n [bName]: parseFloat(b),\n [cName]: parseFloat(c),\n alpha: alpha !== undefined ? parseFloat(alpha) : 1,\n } as V\n }\n"],"names":[],"mappings":";;;;AAKA;;;AAGG;AACI,MAAM,aAAa,GAAG,CAAC,IAAY,EAAE,QAAiB,KAAK,CAAC,CAAM,KAAI;AACzE,IAAA,OAAO,OAAO,CACV,CAAC,OAAO,CAAC,KAAK,QAAQ;AAClB,QAAA,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC;AACxB,QAAA,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC;AAClB,SAAC,QAAQ;YACL,CAAC,SAAS,CAAC,CAAC,CAAC;AACb,YAAA,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAC7D;AACL;AAEO,MAAM,UAAU,GACnB,CAAwB,KAAa,EAAE,KAAa,EAAE,KAAa,KACnE,CAAC,CAAiB,KAAO;IACrB,IAAI,OAAO,CAAC,KAAK,QAAQ;AAAE,QAAA,OAAO,CAAQ;AAE1C,IAAA,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,UAAU,CAAQ;IAEnD,OAAO;AACH,QAAA,CAAC,KAAK,GAAG,UAAU,CAAC,CAAC,CAAC;AACtB,QAAA,CAAC,KAAK,GAAG,UAAU,CAAC,CAAC,CAAC;AACtB,QAAA,CAAC,KAAK,GAAG,UAAU,CAAC,CAAC,CAAC;AACtB,QAAA,KAAK,EAAE,KAAK,KAAK,SAAS,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC;KAChD;AACV;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/complex/filter.mjs b/node_modules/motion-dom/dist/es/value/types/complex/filter.mjs new file mode 100644 index 0000000..c0237bc --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/complex/filter.mjs @@ -0,0 +1,31 @@ +import { complex } from './index.mjs'; +import { floatRegex } from '../utils/float-regex.mjs'; + +/** + * Properties that should default to 1 or 100% + */ +const maxDefaults = new Set(["brightness", "contrast", "saturate", "opacity"]); +function applyDefaultFilter(v) { + const [name, value] = v.slice(0, -1).split("("); + if (name === "drop-shadow") + return v; + const [number] = value.match(floatRegex) || []; + if (!number) + return v; + const unit = value.replace(number, ""); + let defaultValue = maxDefaults.has(name) ? 1 : 0; + if (number !== value) + defaultValue *= 100; + return name + "(" + defaultValue + unit + ")"; +} +const functionRegex = /\b([a-z-]*)\(.*?\)/gu; +const filter = { + ...complex, + getAnimatableNone: (v) => { + const functions = v.match(functionRegex); + return functions ? functions.map(applyDefaultFilter).join(" ") : v; + }, +}; + +export { filter }; +//# sourceMappingURL=filter.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/complex/filter.mjs.map b/node_modules/motion-dom/dist/es/value/types/complex/filter.mjs.map new file mode 100644 index 0000000..6df1c29 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/complex/filter.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"filter.mjs","sources":["../../../../../src/value/types/complex/filter.ts"],"sourcesContent":["import { complex } from \".\"\nimport { floatRegex } from \"../utils/float-regex\"\n\n/**\n * Properties that should default to 1 or 100%\n */\nconst maxDefaults = new Set([\"brightness\", \"contrast\", \"saturate\", \"opacity\"])\n\nfunction applyDefaultFilter(v: string) {\n const [name, value] = v.slice(0, -1).split(\"(\")\n\n if (name === \"drop-shadow\") return v\n\n const [number] = value.match(floatRegex) || []\n if (!number) return v\n\n const unit = value.replace(number, \"\")\n let defaultValue = maxDefaults.has(name) ? 1 : 0\n if (number !== value) defaultValue *= 100\n\n return name + \"(\" + defaultValue + unit + \")\"\n}\n\nconst functionRegex = /\\b([a-z-]*)\\(.*?\\)/gu\n\nexport const filter = {\n ...complex,\n getAnimatableNone: (v: string) => {\n const functions = v.match(functionRegex)\n return functions ? functions.map(applyDefaultFilter).join(\" \") : v\n },\n}\n"],"names":[],"mappings":";;;AAGA;;AAEG;AACH,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,CAAC,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC;AAE9E,SAAS,kBAAkB,CAAC,CAAS,EAAA;IACjC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC;IAE/C,IAAI,IAAI,KAAK,aAAa;AAAE,QAAA,OAAO,CAAC;AAEpC,IAAA,MAAM,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,EAAE;AAC9C,IAAA,IAAI,CAAC,MAAM;AAAE,QAAA,OAAO,CAAC;IAErB,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;AACtC,IAAA,IAAI,YAAY,GAAG,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;IAChD,IAAI,MAAM,KAAK,KAAK;QAAE,YAAY,IAAI,GAAG;IAEzC,OAAO,IAAI,GAAG,GAAG,GAAG,YAAY,GAAG,IAAI,GAAG,GAAG;AACjD;AAEA,MAAM,aAAa,GAAG,sBAAsB;AAErC,MAAM,MAAM,GAAG;AAClB,IAAA,GAAG,OAAO;AACV,IAAA,iBAAiB,EAAE,CAAC,CAAS,KAAI;QAC7B,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC;AACxC,QAAA,OAAO,SAAS,GAAG,SAAS,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;IACtE,CAAC;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/complex/index.mjs b/node_modules/motion-dom/dist/es/value/types/complex/index.mjs new file mode 100644 index 0000000..66f4c01 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/complex/index.mjs @@ -0,0 +1,114 @@ +import { color } from '../color/index.mjs'; +import { colorRegex } from '../utils/color-regex.mjs'; +import { floatRegex } from '../utils/float-regex.mjs'; +import { sanitize } from '../utils/sanitize.mjs'; + +function test(v) { + return (isNaN(v) && + typeof v === "string" && + (v.match(floatRegex)?.length || 0) + + (v.match(colorRegex)?.length || 0) > + 0); +} +const NUMBER_TOKEN = "number"; +const COLOR_TOKEN = "color"; +const VAR_TOKEN = "var"; +const VAR_FUNCTION_TOKEN = "var("; +const SPLIT_TOKEN = "${}"; +// this regex consists of the `singleCssVariableRegex|rgbHSLValueRegex|digitRegex` +const complexRegex = /var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu; +function analyseComplexValue(value) { + const originalValue = value.toString(); + const values = []; + const indexes = { + color: [], + number: [], + var: [], + }; + const types = []; + let i = 0; + const tokenised = originalValue.replace(complexRegex, (parsedValue) => { + if (color.test(parsedValue)) { + indexes.color.push(i); + types.push(COLOR_TOKEN); + values.push(color.parse(parsedValue)); + } + else if (parsedValue.startsWith(VAR_FUNCTION_TOKEN)) { + indexes.var.push(i); + types.push(VAR_TOKEN); + values.push(parsedValue); + } + else { + indexes.number.push(i); + types.push(NUMBER_TOKEN); + values.push(parseFloat(parsedValue)); + } + ++i; + return SPLIT_TOKEN; + }); + const split = tokenised.split(SPLIT_TOKEN); + return { values, split, indexes, types }; +} +function parseComplexValue(v) { + return analyseComplexValue(v).values; +} +function buildTransformer({ split, types }) { + const numSections = split.length; + return (v) => { + let output = ""; + for (let i = 0; i < numSections; i++) { + output += split[i]; + if (v[i] !== undefined) { + const type = types[i]; + if (type === NUMBER_TOKEN) { + output += sanitize(v[i]); + } + else if (type === COLOR_TOKEN) { + output += color.transform(v[i]); + } + else { + output += v[i]; + } + } + } + return output; + }; +} +function createTransformer(source) { + return buildTransformer(analyseComplexValue(source)); +} +const convertNumbersToZero = (v) => typeof v === "number" ? 0 : color.test(v) ? color.getAnimatableNone(v) : v; +/** + * Convert a parsed value to its zero equivalent, but preserve numbers + * that act as divisors in CSS calc() expressions. + * + * analyseComplexValue extracts numbers from CSS strings and puts the + * surrounding text into a `split` template array. For example: + * "calc(var(--gap) / 5)" → values: [var(--gap), 5] + * split: ["calc(", " / ", ")"] + * + * When building a zero-equivalent for animation, naively zeroing all + * numbers turns the divisor into 0 → "calc(var(--gap) / 0)" → NaN. + * We detect this by checking whether the text preceding a number + * (split[i]) ends with "/" — the CSS calc division operator. + */ +const convertToZero = (value, splitBefore) => { + if (typeof value === "number") { + return splitBefore?.trim().endsWith("/") ? value : 0; + } + return convertNumbersToZero(value); +}; +function getAnimatableNone(v) { + const info = analyseComplexValue(v); + const transformer = buildTransformer(info); + return transformer(info.values.map((value, i) => convertToZero(value, info.split[i]))); +} +const complex = { + test, + parse: parseComplexValue, + createTransformer, + getAnimatableNone, +}; + +export { analyseComplexValue, complex }; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/complex/index.mjs.map b/node_modules/motion-dom/dist/es/value/types/complex/index.mjs.map new file mode 100644 index 0000000..fc24e81 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/complex/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../../../../../src/value/types/complex/index.ts"],"sourcesContent":["import { AnyResolvedKeyframe } from \"../../../animation/types\"\nimport { CSSVariableToken } from \"../../../animation/utils/is-css-variable\"\nimport { color } from \"../color\"\nimport { Color } from \"../types\"\nimport { colorRegex } from \"../utils/color-regex\"\nimport { floatRegex } from \"../utils/float-regex\"\nimport { sanitize } from \"../utils/sanitize\"\n\nfunction test(v: any) {\n return (\n isNaN(v) &&\n typeof v === \"string\" &&\n (v.match(floatRegex)?.length || 0) +\n (v.match(colorRegex)?.length || 0) >\n 0\n )\n}\n\nconst NUMBER_TOKEN = \"number\"\nconst COLOR_TOKEN = \"color\"\nconst VAR_TOKEN = \"var\"\nconst VAR_FUNCTION_TOKEN = \"var(\"\nconst SPLIT_TOKEN = \"${}\"\n\nexport type ComplexValues = Array<\n CSSVariableToken | AnyResolvedKeyframe | Color\n>\n\nexport interface ValueIndexes {\n color: number[]\n number: number[]\n var: number[]\n}\n\nexport interface ComplexValueInfo {\n values: ComplexValues\n split: string[]\n indexes: ValueIndexes\n types: Array\n}\n\n// this regex consists of the `singleCssVariableRegex|rgbHSLValueRegex|digitRegex`\nconst complexRegex =\n /var\\s*\\(\\s*--(?:[\\w-]+\\s*|[\\w-]+\\s*,(?:\\s*[^)(\\s]|\\s*\\((?:[^)(]|\\([^)(]*\\))*\\))+\\s*)\\)|#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\)|-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)/giu\n\nexport function analyseComplexValue(\n value: AnyResolvedKeyframe\n): ComplexValueInfo {\n const originalValue = value.toString()\n\n const values: ComplexValues = []\n const indexes: ValueIndexes = {\n color: [],\n number: [],\n var: [],\n }\n const types: Array = []\n\n let i = 0\n const tokenised = originalValue.replace(complexRegex, (parsedValue) => {\n if (color.test(parsedValue)) {\n indexes.color.push(i)\n types.push(COLOR_TOKEN)\n values.push(color.parse(parsedValue))\n } else if (parsedValue.startsWith(VAR_FUNCTION_TOKEN)) {\n indexes.var.push(i)\n types.push(VAR_TOKEN)\n values.push(parsedValue)\n } else {\n indexes.number.push(i)\n types.push(NUMBER_TOKEN)\n values.push(parseFloat(parsedValue))\n }\n ++i\n return SPLIT_TOKEN\n })\n const split = tokenised.split(SPLIT_TOKEN)\n\n return { values, split, indexes, types }\n}\n\nfunction parseComplexValue(v: AnyResolvedKeyframe) {\n return analyseComplexValue(v).values\n}\n\nfunction buildTransformer({ split, types }: ComplexValueInfo) {\n const numSections = split.length\n return (v: Array) => {\n let output = \"\"\n for (let i = 0; i < numSections; i++) {\n output += split[i]\n if (v[i] !== undefined) {\n const type = types[i]\n if (type === NUMBER_TOKEN) {\n output += sanitize(v[i] as number)\n } else if (type === COLOR_TOKEN) {\n output += color.transform(v[i] as Color)\n } else {\n output += v[i]\n }\n }\n }\n\n return output\n }\n}\n\nfunction createTransformer(source: AnyResolvedKeyframe) {\n return buildTransformer(analyseComplexValue(source))\n}\n\nconst convertNumbersToZero = (v: number | string) =>\n typeof v === \"number\" ? 0 : color.test(v) ? color.getAnimatableNone(v) : v\n\n/**\n * Convert a parsed value to its zero equivalent, but preserve numbers\n * that act as divisors in CSS calc() expressions.\n *\n * analyseComplexValue extracts numbers from CSS strings and puts the\n * surrounding text into a `split` template array. For example:\n * \"calc(var(--gap) / 5)\" → values: [var(--gap), 5]\n * split: [\"calc(\", \" / \", \")\"]\n *\n * When building a zero-equivalent for animation, naively zeroing all\n * numbers turns the divisor into 0 → \"calc(var(--gap) / 0)\" → NaN.\n * We detect this by checking whether the text preceding a number\n * (split[i]) ends with \"/\" — the CSS calc division operator.\n */\nconst convertToZero = (\n value: ComplexValues[number],\n splitBefore: string\n): ComplexValues[number] => {\n if (typeof value === \"number\") {\n return splitBefore?.trim().endsWith(\"/\") ? value : 0\n }\n return convertNumbersToZero(value as string)\n}\n\nfunction getAnimatableNone(v: AnyResolvedKeyframe) {\n const info = analyseComplexValue(v)\n const transformer = buildTransformer(info)\n return transformer(\n info.values.map((value, i) => convertToZero(value, info.split[i]))\n )\n}\n\nexport const complex = {\n test,\n parse: parseComplexValue,\n createTransformer,\n getAnimatableNone,\n}\n"],"names":[],"mappings":";;;;;AAQA,SAAS,IAAI,CAAC,CAAM,EAAA;AAChB,IAAA,QACI,KAAK,CAAC,CAAC,CAAC;QACR,OAAO,CAAC,KAAK,QAAQ;QACrB,CAAC,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;aAC5B,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC,CAAC;AAClC,YAAA,CAAC;AAEb;AAEA,MAAM,YAAY,GAAG,QAAQ;AAC7B,MAAM,WAAW,GAAG,OAAO;AAC3B,MAAM,SAAS,GAAG,KAAK;AACvB,MAAM,kBAAkB,GAAG,MAAM;AACjC,MAAM,WAAW,GAAG,KAAK;AAmBzB;AACA,MAAM,YAAY,GACd,iOAAi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;AACH,MAAM,aAAa,GAAG,CAClB,KAA4B,EAC5B,WAAmB,KACI;AACvB,IAAA,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AAC3B,QAAA,OAAO,WAAW,EAAE,IAAI,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,KAAK,GAAG,CAAC;IACxD;AACA,IAAA,OAAO,oBAAoB,CAAC,KAAe,CAAC;AAChD,CAAC;AAED,SAAS,iBAAiB,CAAC,CAAsB,EAAA;AAC7C,IAAA,MAAM,IAAI,GAAG,mBAAmB,CAAC,CAAC,CAAC;AACnC,IAAA,MAAM,WAAW,GAAG,gBAAgB,CAAC,IAAI,CAAC;AAC1C,IAAA,OAAO,WAAW,CACd,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,KAAK,aAAa,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CACrE;AACL;AAEO,MAAM,OAAO,GAAG;IACnB,IAAI;AACJ,IAAA,KAAK,EAAE,iBAAiB;IACxB,iBAAiB;IACjB,iBAAiB;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/complex/mask.mjs b/node_modules/motion-dom/dist/es/value/types/complex/mask.mjs new file mode 100644 index 0000000..2a3bb77 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/complex/mask.mjs @@ -0,0 +1,13 @@ +import { complex } from './index.mjs'; + +const mask = { + ...complex, + getAnimatableNone: (v) => { + const parsed = complex.parse(v); + const transformer = complex.createTransformer(v); + return transformer(parsed.map((v) => typeof v === "number" ? 0 : typeof v === "object" ? { ...v, alpha: 1 } : v)); + }, +}; + +export { mask }; +//# sourceMappingURL=mask.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/complex/mask.mjs.map b/node_modules/motion-dom/dist/es/value/types/complex/mask.mjs.map new file mode 100644 index 0000000..e287f1e --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/complex/mask.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"mask.mjs","sources":["../../../../../src/value/types/complex/mask.ts"],"sourcesContent":["import { complex } from \".\"\nimport { AnyResolvedKeyframe } from \"../../../animation/types\"\n\nexport const mask = {\n ...complex,\n getAnimatableNone: (v: AnyResolvedKeyframe) => {\n const parsed = complex.parse(v)\n const transformer = complex.createTransformer(v)\n return transformer(\n parsed.map((v) =>\n typeof v === \"number\" ? 0 : typeof v === \"object\" ? { ...v, alpha: 1 } : v\n )\n )\n },\n}\n"],"names":[],"mappings":";;AAGO,MAAM,IAAI,GAAG;AAChB,IAAA,GAAG,OAAO;AACV,IAAA,iBAAiB,EAAE,CAAC,CAAsB,KAAI;QAC1C,MAAM,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;QAC/B,MAAM,WAAW,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC;AAChD,QAAA,OAAO,WAAW,CACd,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,KACT,OAAO,CAAC,KAAK,QAAQ,GAAG,CAAC,GAAG,OAAO,CAAC,KAAK,QAAQ,GAAG,EAAE,GAAG,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,CAAC,CAC7E,CACJ;IACL,CAAC;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/dimensions.mjs b/node_modules/motion-dom/dist/es/value/types/dimensions.mjs new file mode 100644 index 0000000..de40047 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/dimensions.mjs @@ -0,0 +1,16 @@ +import { auto } from './auto.mjs'; +import { number } from './numbers/index.mjs'; +import { px, percent, degrees, vw, vh } from './numbers/units.mjs'; +import { testValueType } from './test.mjs'; + +/** + * A list of value types commonly used for dimensions + */ +const dimensionValueTypes = [number, px, percent, degrees, vw, vh, auto]; +/** + * Tests a dimensional value against the list of dimension ValueTypes + */ +const findDimensionValueType = (v) => dimensionValueTypes.find(testValueType(v)); + +export { dimensionValueTypes, findDimensionValueType }; +//# sourceMappingURL=dimensions.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/dimensions.mjs.map b/node_modules/motion-dom/dist/es/value/types/dimensions.mjs.map new file mode 100644 index 0000000..79f7dc1 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/dimensions.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"dimensions.mjs","sources":["../../../../src/value/types/dimensions.ts"],"sourcesContent":["import { auto } from \"./auto\"\nimport { number } from \"./numbers\"\nimport { degrees, percent, px, vh, vw } from \"./numbers/units\"\nimport { testValueType } from \"./test\"\n\n/**\n * A list of value types commonly used for dimensions\n */\nexport const dimensionValueTypes = [number, px, percent, degrees, vw, vh, auto]\n\n/**\n * Tests a dimensional value against the list of dimension ValueTypes\n */\nexport const findDimensionValueType = (v: any) =>\n dimensionValueTypes.find(testValueType(v))\n"],"names":[],"mappings":";;;;;AAKA;;AAEG;AACI,MAAM,mBAAmB,GAAG,CAAC,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE,IAAI;AAE9E;;AAEG;AACI,MAAM,sBAAsB,GAAG,CAAC,CAAM,KACzC,mBAAmB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/int.mjs b/node_modules/motion-dom/dist/es/value/types/int.mjs new file mode 100644 index 0000000..065c6ad --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/int.mjs @@ -0,0 +1,9 @@ +import { number } from './numbers/index.mjs'; + +const int = { + ...number, + transform: Math.round, +}; + +export { int }; +//# sourceMappingURL=int.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/int.mjs.map b/node_modules/motion-dom/dist/es/value/types/int.mjs.map new file mode 100644 index 0000000..8a3a6e8 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/int.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"int.mjs","sources":["../../../../src/value/types/int.ts"],"sourcesContent":["import { number } from \"./numbers\"\n\nexport const int = {\n ...number,\n transform: Math.round,\n}\n"],"names":[],"mappings":";;AAEO,MAAM,GAAG,GAAG;AACf,IAAA,GAAG,MAAM;IACT,SAAS,EAAE,IAAI,CAAC,KAAK;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/maps/defaults.mjs b/node_modules/motion-dom/dist/es/value/types/maps/defaults.mjs new file mode 100644 index 0000000..ebca742 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/maps/defaults.mjs @@ -0,0 +1,34 @@ +import { color } from '../color/index.mjs'; +import { filter } from '../complex/filter.mjs'; +import { mask } from '../complex/mask.mjs'; +import { numberValueTypes } from './number.mjs'; + +/** + * A map of default value types for common values + */ +const defaultValueTypes = { + ...numberValueTypes, + // Color props + color, + backgroundColor: color, + outlineColor: color, + fill: color, + stroke: color, + // Border props + borderColor: color, + borderTopColor: color, + borderRightColor: color, + borderBottomColor: color, + borderLeftColor: color, + filter, + WebkitFilter: filter, + mask, + WebkitMask: mask, +}; +/** + * Gets the default ValueType for the provided value key + */ +const getDefaultValueType = (key) => defaultValueTypes[key]; + +export { defaultValueTypes, getDefaultValueType }; +//# sourceMappingURL=defaults.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/maps/defaults.mjs.map b/node_modules/motion-dom/dist/es/value/types/maps/defaults.mjs.map new file mode 100644 index 0000000..1e279cc --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/maps/defaults.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"defaults.mjs","sources":["../../../../../src/value/types/maps/defaults.ts"],"sourcesContent":["import { color } from \"../color\"\nimport { filter } from \"../complex/filter\"\nimport { mask } from \"../complex/mask\"\nimport { numberValueTypes } from \"./number\"\nimport { ValueTypeMap } from \"./types\"\n\n/**\n * A map of default value types for common values\n */\nexport const defaultValueTypes: ValueTypeMap = {\n ...numberValueTypes,\n\n // Color props\n color,\n backgroundColor: color,\n outlineColor: color,\n fill: color,\n stroke: color,\n\n // Border props\n borderColor: color,\n borderTopColor: color,\n borderRightColor: color,\n borderBottomColor: color,\n borderLeftColor: color,\n filter,\n WebkitFilter: filter,\n mask,\n WebkitMask: mask,\n}\n\n/**\n * Gets the default ValueType for the provided value key\n */\nexport const getDefaultValueType = (key: string) => defaultValueTypes[key]\n"],"names":[],"mappings":";;;;;AAMA;;AAEG;AACI,MAAM,iBAAiB,GAAiB;AAC3C,IAAA,GAAG,gBAAgB;;IAGnB,KAAK;AACL,IAAA,eAAe,EAAE,KAAK;AACtB,IAAA,YAAY,EAAE,KAAK;AACnB,IAAA,IAAI,EAAE,KAAK;AACX,IAAA,MAAM,EAAE,KAAK;;AAGb,IAAA,WAAW,EAAE,KAAK;AAClB,IAAA,cAAc,EAAE,KAAK;AACrB,IAAA,gBAAgB,EAAE,KAAK;AACvB,IAAA,iBAAiB,EAAE,KAAK;AACxB,IAAA,eAAe,EAAE,KAAK;IACtB,MAAM;AACN,IAAA,YAAY,EAAE,MAAM;IACpB,IAAI;AACJ,IAAA,UAAU,EAAE,IAAI;;AAGpB;;AAEG;AACI,MAAM,mBAAmB,GAAG,CAAC,GAAW,KAAK,iBAAiB,CAAC,GAAG;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/maps/number.mjs b/node_modules/motion-dom/dist/es/value/types/maps/number.mjs new file mode 100644 index 0000000..e3ee5a2 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/maps/number.mjs @@ -0,0 +1,71 @@ +import { int } from '../int.mjs'; +import { alpha } from '../numbers/index.mjs'; +import { px } from '../numbers/units.mjs'; +import { transformValueTypes } from './transform.mjs'; + +const numberValueTypes = { + // Border props + borderWidth: px, + borderTopWidth: px, + borderRightWidth: px, + borderBottomWidth: px, + borderLeftWidth: px, + borderRadius: px, + borderTopLeftRadius: px, + borderTopRightRadius: px, + borderBottomRightRadius: px, + borderBottomLeftRadius: px, + // Positioning props + width: px, + maxWidth: px, + height: px, + maxHeight: px, + top: px, + right: px, + bottom: px, + left: px, + inset: px, + insetBlock: px, + insetBlockStart: px, + insetBlockEnd: px, + insetInline: px, + insetInlineStart: px, + insetInlineEnd: px, + // Spacing props + padding: px, + paddingTop: px, + paddingRight: px, + paddingBottom: px, + paddingLeft: px, + paddingBlock: px, + paddingBlockStart: px, + paddingBlockEnd: px, + paddingInline: px, + paddingInlineStart: px, + paddingInlineEnd: px, + margin: px, + marginTop: px, + marginRight: px, + marginBottom: px, + marginLeft: px, + marginBlock: px, + marginBlockStart: px, + marginBlockEnd: px, + marginInline: px, + marginInlineStart: px, + marginInlineEnd: px, + // Typography + fontSize: px, + // Misc + backgroundPositionX: px, + backgroundPositionY: px, + ...transformValueTypes, + zIndex: int, + // SVG + fillOpacity: alpha, + strokeOpacity: alpha, + numOctaves: int, +}; + +export { numberValueTypes }; +//# sourceMappingURL=number.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/maps/number.mjs.map b/node_modules/motion-dom/dist/es/value/types/maps/number.mjs.map new file mode 100644 index 0000000..4c9cc78 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/maps/number.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"number.mjs","sources":["../../../../../src/value/types/maps/number.ts"],"sourcesContent":["import { int } from \"../int\"\nimport { alpha } from \"../numbers\"\nimport { px } from \"../numbers/units\"\nimport { transformValueTypes } from \"./transform\"\nimport { ValueTypeMap } from \"./types\"\n\nexport const numberValueTypes: ValueTypeMap = {\n // Border props\n borderWidth: px,\n borderTopWidth: px,\n borderRightWidth: px,\n borderBottomWidth: px,\n borderLeftWidth: px,\n borderRadius: px,\n borderTopLeftRadius: px,\n borderTopRightRadius: px,\n borderBottomRightRadius: px,\n borderBottomLeftRadius: px,\n\n // Positioning props\n width: px,\n maxWidth: px,\n height: px,\n maxHeight: px,\n top: px,\n right: px,\n bottom: px,\n left: px,\n inset: px,\n insetBlock: px,\n insetBlockStart: px,\n insetBlockEnd: px,\n insetInline: px,\n insetInlineStart: px,\n insetInlineEnd: px,\n\n // Spacing props\n padding: px,\n paddingTop: px,\n paddingRight: px,\n paddingBottom: px,\n paddingLeft: px,\n paddingBlock: px,\n paddingBlockStart: px,\n paddingBlockEnd: px,\n paddingInline: px,\n paddingInlineStart: px,\n paddingInlineEnd: px,\n margin: px,\n marginTop: px,\n marginRight: px,\n marginBottom: px,\n marginLeft: px,\n marginBlock: px,\n marginBlockStart: px,\n marginBlockEnd: px,\n marginInline: px,\n marginInlineStart: px,\n marginInlineEnd: px,\n\n // Typography\n fontSize: px,\n\n // Misc\n backgroundPositionX: px,\n backgroundPositionY: px,\n\n ...transformValueTypes,\n zIndex: int,\n\n // SVG\n fillOpacity: alpha,\n strokeOpacity: alpha,\n numOctaves: int,\n}\n"],"names":[],"mappings":";;;;;AAMO,MAAM,gBAAgB,GAAiB;;AAE1C,IAAA,WAAW,EAAE,EAAE;AACf,IAAA,cAAc,EAAE,EAAE;AAClB,IAAA,gBAAgB,EAAE,EAAE;AACpB,IAAA,iBAAiB,EAAE,EAAE;AACrB,IAAA,eAAe,EAAE,EAAE;AACnB,IAAA,YAAY,EAAE,EAAE;AAChB,IAAA,mBAAmB,EAAE,EAAE;AACvB,IAAA,oBAAoB,EAAE,EAAE;AACxB,IAAA,uBAAuB,EAAE,EAAE;AAC3B,IAAA,sBAAsB,EAAE,EAAE;;AAG1B,IAAA,KAAK,EAAE,EAAE;AACT,IAAA,QAAQ,EAAE,EAAE;AACZ,IAAA,MAAM,EAAE,EAAE;AACV,IAAA,SAAS,EAAE,EAAE;AACb,IAAA,GAAG,EAAE,EAAE;AACP,IAAA,KAAK,EAAE,EAAE;AACT,IAAA,MAAM,EAAE,EAAE;AACV,IAAA,IAAI,EAAE,EAAE;AACR,IAAA,KAAK,EAAE,EAAE;AACT,IAAA,UAAU,EAAE,EAAE;AACd,IAAA,eAAe,EAAE,EAAE;AACnB,IAAA,aAAa,EAAE,EAAE;AACjB,IAAA,WAAW,EAAE,EAAE;AACf,IAAA,gBAAgB,EAAE,EAAE;AACpB,IAAA,cAAc,EAAE,EAAE;;AAGlB,IAAA,OAAO,EAAE,EAAE;AACX,IAAA,UAAU,EAAE,EAAE;AACd,IAAA,YAAY,EAAE,EAAE;AAChB,IAAA,aAAa,EAAE,EAAE;AACjB,IAAA,WAAW,EAAE,EAAE;AACf,IAAA,YAAY,EAAE,EAAE;AAChB,IAAA,iBAAiB,EAAE,EAAE;AACrB,IAAA,eAAe,EAAE,EAAE;AACnB,IAAA,aAAa,EAAE,EAAE;AACjB,IAAA,kBAAkB,EAAE,EAAE;AACtB,IAAA,gBAAgB,EAAE,EAAE;AACpB,IAAA,MAAM,EAAE,EAAE;AACV,IAAA,SAAS,EAAE,EAAE;AACb,IAAA,WAAW,EAAE,EAAE;AACf,IAAA,YAAY,EAAE,EAAE;AAChB,IAAA,UAAU,EAAE,EAAE;AACd,IAAA,WAAW,EAAE,EAAE;AACf,IAAA,gBAAgB,EAAE,EAAE;AACpB,IAAA,cAAc,EAAE,EAAE;AAClB,IAAA,YAAY,EAAE,EAAE;AAChB,IAAA,iBAAiB,EAAE,EAAE;AACrB,IAAA,eAAe,EAAE,EAAE;;AAGnB,IAAA,QAAQ,EAAE,EAAE;;AAGZ,IAAA,mBAAmB,EAAE,EAAE;AACvB,IAAA,mBAAmB,EAAE,EAAE;AAEvB,IAAA,GAAG,mBAAmB;AACtB,IAAA,MAAM,EAAE,GAAG;;AAGX,IAAA,WAAW,EAAE,KAAK;AAClB,IAAA,aAAa,EAAE,KAAK;AACpB,IAAA,UAAU,EAAE,GAAG;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/maps/transform.mjs b/node_modules/motion-dom/dist/es/value/types/maps/transform.mjs new file mode 100644 index 0000000..b5cc0d9 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/maps/transform.mjs @@ -0,0 +1,38 @@ +import { alpha, scale } from '../numbers/index.mjs'; +import { px, progressPercentage, degrees } from '../numbers/units.mjs'; + +const transformValueTypes = { + rotate: degrees, + /** + * Internal channel for `transition.path` orientToPath. Composed onto + * `rotate` at the transform-build sites so the user's `rotate` is + * never read or overwritten. Not part of `transformPropOrder`. + */ + pathRotation: degrees, + rotateX: degrees, + rotateY: degrees, + rotateZ: degrees, + scale, + scaleX: scale, + scaleY: scale, + scaleZ: scale, + skew: degrees, + skewX: degrees, + skewY: degrees, + distance: px, + translateX: px, + translateY: px, + translateZ: px, + x: px, + y: px, + z: px, + perspective: px, + transformPerspective: px, + opacity: alpha, + originX: progressPercentage, + originY: progressPercentage, + originZ: px, +}; + +export { transformValueTypes }; +//# sourceMappingURL=transform.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/maps/transform.mjs.map b/node_modules/motion-dom/dist/es/value/types/maps/transform.mjs.map new file mode 100644 index 0000000..6490b6b --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/maps/transform.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"transform.mjs","sources":["../../../../../src/value/types/maps/transform.ts"],"sourcesContent":["import { alpha, scale } from \"../numbers\"\nimport { degrees, progressPercentage, px } from \"../numbers/units\"\nimport { ValueTypeMap } from \"./types\"\n\nexport const transformValueTypes: ValueTypeMap = {\n rotate: degrees,\n /**\n * Internal channel for `transition.path` orientToPath. Composed onto\n * `rotate` at the transform-build sites so the user's `rotate` is\n * never read or overwritten. Not part of `transformPropOrder`.\n */\n pathRotation: degrees,\n rotateX: degrees,\n rotateY: degrees,\n rotateZ: degrees,\n scale,\n scaleX: scale,\n scaleY: scale,\n scaleZ: scale,\n skew: degrees,\n skewX: degrees,\n skewY: degrees,\n distance: px,\n translateX: px,\n translateY: px,\n translateZ: px,\n x: px,\n y: px,\n z: px,\n perspective: px,\n transformPerspective: px,\n opacity: alpha,\n originX: progressPercentage,\n originY: progressPercentage,\n originZ: px,\n}\n"],"names":[],"mappings":";;;AAIO,MAAM,mBAAmB,GAAiB;AAC7C,IAAA,MAAM,EAAE,OAAO;AACf;;;;AAIG;AACH,IAAA,YAAY,EAAE,OAAO;AACrB,IAAA,OAAO,EAAE,OAAO;AAChB,IAAA,OAAO,EAAE,OAAO;AAChB,IAAA,OAAO,EAAE,OAAO;IAChB,KAAK;AACL,IAAA,MAAM,EAAE,KAAK;AACb,IAAA,MAAM,EAAE,KAAK;AACb,IAAA,MAAM,EAAE,KAAK;AACb,IAAA,IAAI,EAAE,OAAO;AACb,IAAA,KAAK,EAAE,OAAO;AACd,IAAA,KAAK,EAAE,OAAO;AACd,IAAA,QAAQ,EAAE,EAAE;AACZ,IAAA,UAAU,EAAE,EAAE;AACd,IAAA,UAAU,EAAE,EAAE;AACd,IAAA,UAAU,EAAE,EAAE;AACd,IAAA,CAAC,EAAE,EAAE;AACL,IAAA,CAAC,EAAE,EAAE;AACL,IAAA,CAAC,EAAE,EAAE;AACL,IAAA,WAAW,EAAE,EAAE;AACf,IAAA,oBAAoB,EAAE,EAAE;AACxB,IAAA,OAAO,EAAE,KAAK;AACd,IAAA,OAAO,EAAE,kBAAkB;AAC3B,IAAA,OAAO,EAAE,kBAAkB;AAC3B,IAAA,OAAO,EAAE,EAAE;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/numbers/index.mjs b/node_modules/motion-dom/dist/es/value/types/numbers/index.mjs new file mode 100644 index 0000000..9639305 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/numbers/index.mjs @@ -0,0 +1,18 @@ +import { clamp } from 'motion-utils'; + +const number = { + test: (v) => typeof v === "number", + parse: parseFloat, + transform: (v) => v, +}; +const alpha = { + ...number, + transform: (v) => clamp(0, 1, v), +}; +const scale = { + ...number, + default: 1, +}; + +export { alpha, number, scale }; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/numbers/index.mjs.map b/node_modules/motion-dom/dist/es/value/types/numbers/index.mjs.map new file mode 100644 index 0000000..d4ca6a2 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/numbers/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../../../../../src/value/types/numbers/index.ts"],"sourcesContent":["import { clamp } from \"motion-utils\"\n\nexport const number = {\n test: (v: number) => typeof v === \"number\",\n parse: parseFloat,\n transform: (v: number) => v,\n}\n\nexport const alpha = {\n ...number,\n transform: (v: number) => clamp(0, 1, v),\n}\n\nexport const scale = {\n ...number,\n default: 1,\n}\n"],"names":[],"mappings":";;AAEO,MAAM,MAAM,GAAG;IAClB,IAAI,EAAE,CAAC,CAAS,KAAK,OAAO,CAAC,KAAK,QAAQ;AAC1C,IAAA,KAAK,EAAE,UAAU;AACjB,IAAA,SAAS,EAAE,CAAC,CAAS,KAAK,CAAC;;AAGxB,MAAM,KAAK,GAAG;AACjB,IAAA,GAAG,MAAM;AACT,IAAA,SAAS,EAAE,CAAC,CAAS,KAAK,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;;AAGrC,MAAM,KAAK,GAAG;AACjB,IAAA,GAAG,MAAM;AACT,IAAA,OAAO,EAAE,CAAC;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/numbers/units.mjs b/node_modules/motion-dom/dist/es/value/types/numbers/units.mjs new file mode 100644 index 0000000..5f59238 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/numbers/units.mjs @@ -0,0 +1,19 @@ +/*#__NO_SIDE_EFFECTS__*/ +const createUnitType = (unit) => ({ + test: (v) => typeof v === "string" && v.endsWith(unit) && v.split(" ").length === 1, + parse: parseFloat, + transform: (v) => `${v}${unit}`, +}); +const degrees = /*@__PURE__*/ createUnitType("deg"); +const percent = /*@__PURE__*/ createUnitType("%"); +const px = /*@__PURE__*/ createUnitType("px"); +const vh = /*@__PURE__*/ createUnitType("vh"); +const vw = /*@__PURE__*/ createUnitType("vw"); +const progressPercentage = /*@__PURE__*/ (() => ({ + ...percent, + parse: (v) => percent.parse(v) / 100, + transform: (v) => percent.transform(v * 100), +}))(); + +export { degrees, percent, progressPercentage, px, vh, vw }; +//# sourceMappingURL=units.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/numbers/units.mjs.map b/node_modules/motion-dom/dist/es/value/types/numbers/units.mjs.map new file mode 100644 index 0000000..66cb853 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/numbers/units.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"units.mjs","sources":["../../../../../src/value/types/numbers/units.ts"],"sourcesContent":["import { AnyResolvedKeyframe } from \"../../../animation/types\"\n\n/*#__NO_SIDE_EFFECTS__*/\nconst createUnitType = (unit: string) => ({\n test: (v: AnyResolvedKeyframe) =>\n typeof v === \"string\" && v.endsWith(unit) && v.split(\" \").length === 1,\n parse: parseFloat,\n transform: (v: number | string) => `${v}${unit}`,\n})\n\nexport const degrees = /*@__PURE__*/ createUnitType(\"deg\")\nexport const percent = /*@__PURE__*/ createUnitType(\"%\")\nexport const px = /*@__PURE__*/ createUnitType(\"px\")\nexport const vh = /*@__PURE__*/ createUnitType(\"vh\")\nexport const vw = /*@__PURE__*/ createUnitType(\"vw\")\n\nexport const progressPercentage = /*@__PURE__*/ (() => ({\n ...percent,\n parse: (v: string) => percent.parse(v) / 100,\n transform: (v: number) => percent.transform(v * 100),\n}))()\n"],"names":[],"mappings":"AAEA;AACA,MAAM,cAAc,GAAG,CAAC,IAAY,MAAM;IACtC,IAAI,EAAE,CAAC,CAAsB,KACzB,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,KAAK,CAAC;AAC1E,IAAA,KAAK,EAAE,UAAU;IACjB,SAAS,EAAE,CAAC,CAAkB,KAAK,CAAA,EAAG,CAAC,CAAA,EAAG,IAAI,CAAA,CAAE;AACnD,CAAA,CAAC;AAEK,MAAM,OAAO,iBAAiB,cAAc,CAAC,KAAK;AAClD,MAAM,OAAO,iBAAiB,cAAc,CAAC,GAAG;AAChD,MAAM,EAAE,iBAAiB,cAAc,CAAC,IAAI;AAC5C,MAAM,EAAE,iBAAiB,cAAc,CAAC,IAAI;AAC5C,MAAM,EAAE,iBAAiB,cAAc,CAAC,IAAI;AAE5C,MAAM,kBAAkB,iBAAiB,CAAC,OAAO;AACpD,IAAA,GAAG,OAAO;AACV,IAAA,KAAK,EAAE,CAAC,CAAS,KAAK,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG;AAC5C,IAAA,SAAS,EAAE,CAAC,CAAS,KAAK,OAAO,CAAC,SAAS,CAAC,CAAC,GAAG,GAAG,CAAC;CACvD,CAAC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/test.mjs b/node_modules/motion-dom/dist/es/value/types/test.mjs new file mode 100644 index 0000000..26cb26e --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/test.mjs @@ -0,0 +1,7 @@ +/** + * Tests a provided value against a ValueType + */ +const testValueType = (v) => (type) => type.test(v); + +export { testValueType }; +//# sourceMappingURL=test.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/test.mjs.map b/node_modules/motion-dom/dist/es/value/types/test.mjs.map new file mode 100644 index 0000000..b0ecce0 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/test.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"test.mjs","sources":["../../../../src/value/types/test.ts"],"sourcesContent":["import { ValueType } from \"./types\"\n\n/**\n * Tests a provided value against a ValueType\n */\nexport const testValueType = (v: any) => (type: ValueType) => type.test(v)\n"],"names":[],"mappings":"AAEA;;AAEG;MACU,aAAa,GAAG,CAAC,CAAM,KAAK,CAAC,IAAe,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/utils/animatable-none.mjs b/node_modules/motion-dom/dist/es/value/types/utils/animatable-none.mjs new file mode 100644 index 0000000..c4efbc2 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/utils/animatable-none.mjs @@ -0,0 +1,18 @@ +import { complex } from '../complex/index.mjs'; +import { filter } from '../complex/filter.mjs'; +import { mask } from '../complex/mask.mjs'; +import { getDefaultValueType } from '../maps/defaults.mjs'; + +const customTypes = /*@__PURE__*/ new Set([filter, mask]); +function getAnimatableNone(key, value) { + let defaultValueType = getDefaultValueType(key); + if (!customTypes.has(defaultValueType)) + defaultValueType = complex; + // If value is not recognised as animatable, ie "none", create an animatable version origin based on the target + return defaultValueType.getAnimatableNone + ? defaultValueType.getAnimatableNone(value) + : undefined; +} + +export { getAnimatableNone }; +//# sourceMappingURL=animatable-none.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/utils/animatable-none.mjs.map b/node_modules/motion-dom/dist/es/value/types/utils/animatable-none.mjs.map new file mode 100644 index 0000000..f832871 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/utils/animatable-none.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"animatable-none.mjs","sources":["../../../../../src/value/types/utils/animatable-none.ts"],"sourcesContent":["import { complex } from \"../complex\"\nimport { filter } from \"../complex/filter\"\nimport { mask } from \"../complex/mask\"\nimport { getDefaultValueType } from \"../maps/defaults\"\n\nconst customTypes = /*@__PURE__*/ new Set([filter, mask])\n\nexport function getAnimatableNone(key: string, value: string) {\n let defaultValueType = getDefaultValueType(key)\n if (!customTypes.has(defaultValueType as any)) defaultValueType = complex\n // If value is not recognised as animatable, ie \"none\", create an animatable version origin based on the target\n return defaultValueType.getAnimatableNone\n ? defaultValueType.getAnimatableNone(value)\n : undefined\n}\n"],"names":[],"mappings":";;;;;AAKA,MAAM,WAAW,iBAAiB,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;AAEnD,SAAU,iBAAiB,CAAC,GAAW,EAAE,KAAa,EAAA;AACxD,IAAA,IAAI,gBAAgB,GAAG,mBAAmB,CAAC,GAAG,CAAC;AAC/C,IAAA,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,gBAAuB,CAAC;QAAE,gBAAgB,GAAG,OAAO;;IAEzE,OAAO,gBAAgB,CAAC;AACpB,UAAE,gBAAgB,CAAC,iBAAiB,CAAC,KAAK;UACxC,SAAS;AACnB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/utils/color-regex.mjs b/node_modules/motion-dom/dist/es/value/types/utils/color-regex.mjs new file mode 100644 index 0000000..645be1e --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/utils/color-regex.mjs @@ -0,0 +1,4 @@ +const colorRegex = /(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu; + +export { colorRegex }; +//# sourceMappingURL=color-regex.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/utils/color-regex.mjs.map b/node_modules/motion-dom/dist/es/value/types/utils/color-regex.mjs.map new file mode 100644 index 0000000..fcfdf78 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/utils/color-regex.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"color-regex.mjs","sources":["../../../../../src/value/types/utils/color-regex.ts"],"sourcesContent":["export const colorRegex =\n /(?:#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\))/giu\n"],"names":[],"mappings":"AAAO,MAAM,UAAU,GACnB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/utils/find.mjs b/node_modules/motion-dom/dist/es/value/types/utils/find.mjs new file mode 100644 index 0000000..aac4531 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/utils/find.mjs @@ -0,0 +1,16 @@ +import { color } from '../color/index.mjs'; +import { complex } from '../complex/index.mjs'; +import { dimensionValueTypes } from '../dimensions.mjs'; +import { testValueType } from '../test.mjs'; + +/** + * A list of all ValueTypes + */ +const valueTypes = [...dimensionValueTypes, color, complex]; +/** + * Tests a value against the list of ValueTypes + */ +const findValueType = (v) => valueTypes.find(testValueType(v)); + +export { findValueType }; +//# sourceMappingURL=find.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/utils/find.mjs.map b/node_modules/motion-dom/dist/es/value/types/utils/find.mjs.map new file mode 100644 index 0000000..9de8942 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/utils/find.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"find.mjs","sources":["../../../../../src/value/types/utils/find.ts"],"sourcesContent":["import { color } from \"../color\"\nimport { complex } from \"../complex\"\nimport { dimensionValueTypes } from \"../dimensions\"\nimport { testValueType } from \"../test\"\n\n/**\n * A list of all ValueTypes\n */\nconst valueTypes = [...dimensionValueTypes, color, complex]\n\n/**\n * Tests a value against the list of ValueTypes\n */\nexport const findValueType = (v: any) => valueTypes.find(testValueType(v))\n"],"names":[],"mappings":";;;;;AAKA;;AAEG;AACH,MAAM,UAAU,GAAG,CAAC,GAAG,mBAAmB,EAAE,KAAK,EAAE,OAAO,CAAC;AAE3D;;AAEG;AACI,MAAM,aAAa,GAAG,CAAC,CAAM,KAAK,UAAU,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/utils/float-regex.mjs b/node_modules/motion-dom/dist/es/value/types/utils/float-regex.mjs new file mode 100644 index 0000000..2e1cd7d --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/utils/float-regex.mjs @@ -0,0 +1,4 @@ +const floatRegex = /-?(?:\d+(?:\.\d+)?|\.\d+)/gu; + +export { floatRegex }; +//# sourceMappingURL=float-regex.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/utils/float-regex.mjs.map b/node_modules/motion-dom/dist/es/value/types/utils/float-regex.mjs.map new file mode 100644 index 0000000..76a6c87 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/utils/float-regex.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"float-regex.mjs","sources":["../../../../../src/value/types/utils/float-regex.ts"],"sourcesContent":["export const floatRegex = /-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)/gu\n"],"names":[],"mappings":"AAAO,MAAM,UAAU,GAAG;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/utils/get-as-type.mjs b/node_modules/motion-dom/dist/es/value/types/utils/get-as-type.mjs new file mode 100644 index 0000000..768d566 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/utils/get-as-type.mjs @@ -0,0 +1,11 @@ +/** + * Provided a value and a ValueType, returns the value as that value type. + */ +const getValueAsType = (value, type) => { + return type && typeof value === "number" + ? type.transform(value) + : value; +}; + +export { getValueAsType }; +//# sourceMappingURL=get-as-type.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/utils/get-as-type.mjs.map b/node_modules/motion-dom/dist/es/value/types/utils/get-as-type.mjs.map new file mode 100644 index 0000000..20ce63e --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/utils/get-as-type.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"get-as-type.mjs","sources":["../../../../../src/value/types/utils/get-as-type.ts"],"sourcesContent":["import { ValueType } from \"../types\"\n\n/**\n * Provided a value and a ValueType, returns the value as that value type.\n */\nexport const getValueAsType = (value: any, type?: ValueType) => {\n return type && typeof value === \"number\"\n ? (type as any).transform(value)\n : value\n}\n"],"names":[],"mappings":"AAEA;;AAEG;MACU,cAAc,GAAG,CAAC,KAAU,EAAE,IAAgB,KAAI;AAC3D,IAAA,OAAO,IAAI,IAAI,OAAO,KAAK,KAAK;AAC5B,UAAG,IAAY,CAAC,SAAS,CAAC,KAAK;UAC7B,KAAK;AACf;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/utils/is-nullish.mjs b/node_modules/motion-dom/dist/es/value/types/utils/is-nullish.mjs new file mode 100644 index 0000000..28ccf2f --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/utils/is-nullish.mjs @@ -0,0 +1,6 @@ +function isNullish(v) { + return v == null; +} + +export { isNullish }; +//# sourceMappingURL=is-nullish.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/utils/is-nullish.mjs.map b/node_modules/motion-dom/dist/es/value/types/utils/is-nullish.mjs.map new file mode 100644 index 0000000..d883f28 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/utils/is-nullish.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"is-nullish.mjs","sources":["../../../../../src/value/types/utils/is-nullish.ts"],"sourcesContent":["export function isNullish(v: any): v is null | undefined {\n return v == null\n}\n"],"names":[],"mappings":"AAAM,SAAU,SAAS,CAAC,CAAM,EAAA;IAC5B,OAAO,CAAC,IAAI,IAAI;AACpB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/utils/sanitize.mjs b/node_modules/motion-dom/dist/es/value/types/utils/sanitize.mjs new file mode 100644 index 0000000..8285b23 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/utils/sanitize.mjs @@ -0,0 +1,6 @@ +// If this number is a decimal, make it just five decimal places +// to avoid exponents +const sanitize = (v) => Math.round(v * 100000) / 100000; + +export { sanitize }; +//# sourceMappingURL=sanitize.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/utils/sanitize.mjs.map b/node_modules/motion-dom/dist/es/value/types/utils/sanitize.mjs.map new file mode 100644 index 0000000..2400656 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/utils/sanitize.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"sanitize.mjs","sources":["../../../../../src/value/types/utils/sanitize.ts"],"sourcesContent":["// If this number is a decimal, make it just five decimal places\n// to avoid exponents\nexport const sanitize = (v: number) => Math.round(v * 100000) / 100000\n"],"names":[],"mappings":"AAAA;AACA;AACO,MAAM,QAAQ,GAAG,CAAC,CAAS,KAAK,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,MAAM,CAAC,GAAG;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/utils/single-color-regex.mjs b/node_modules/motion-dom/dist/es/value/types/utils/single-color-regex.mjs new file mode 100644 index 0000000..cf67f20 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/utils/single-color-regex.mjs @@ -0,0 +1,4 @@ +const singleColorRegex = /^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu; + +export { singleColorRegex }; +//# sourceMappingURL=single-color-regex.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/utils/single-color-regex.mjs.map b/node_modules/motion-dom/dist/es/value/types/utils/single-color-regex.mjs.map new file mode 100644 index 0000000..706651b --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/utils/single-color-regex.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"single-color-regex.mjs","sources":["../../../../../src/value/types/utils/single-color-regex.ts"],"sourcesContent":["export const singleColorRegex =\n /^(?:#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\))$/iu\n"],"names":[],"mappings":"AAAO,MAAM,gBAAgB,GACzB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/utils/is-motion-value.mjs b/node_modules/motion-dom/dist/es/value/utils/is-motion-value.mjs new file mode 100644 index 0000000..ae80d22 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/utils/is-motion-value.mjs @@ -0,0 +1,4 @@ +const isMotionValue = (value) => Boolean(value && value.getVelocity); + +export { isMotionValue }; +//# sourceMappingURL=is-motion-value.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/utils/is-motion-value.mjs.map b/node_modules/motion-dom/dist/es/value/utils/is-motion-value.mjs.map new file mode 100644 index 0000000..171e74e --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/utils/is-motion-value.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"is-motion-value.mjs","sources":["../../../../src/value/utils/is-motion-value.ts"],"sourcesContent":["import type { MotionValue } from \"..\"\n\nexport const isMotionValue = (value: any): value is MotionValue =>\n Boolean(value && value.getVelocity)\n"],"names":[],"mappings":"AAEO,MAAM,aAAa,GAAG,CAAC,KAAU,KACpC,OAAO,CAAC,KAAK,IAAI,KAAK,CAAC,WAAW;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/utils/resolve-motion-value.mjs b/node_modules/motion-dom/dist/es/value/utils/resolve-motion-value.mjs new file mode 100644 index 0000000..72614b6 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/utils/resolve-motion-value.mjs @@ -0,0 +1,11 @@ +import { isMotionValue } from './is-motion-value.mjs'; + +/** + * If the provided value is a MotionValue, this returns the actual value, otherwise just the value itself + */ +function resolveMotionValue(value) { + return isMotionValue(value) ? value.get() : value; +} + +export { resolveMotionValue }; +//# sourceMappingURL=resolve-motion-value.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/utils/resolve-motion-value.mjs.map b/node_modules/motion-dom/dist/es/value/utils/resolve-motion-value.mjs.map new file mode 100644 index 0000000..1960b2c --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/utils/resolve-motion-value.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"resolve-motion-value.mjs","sources":["../../../../src/value/utils/resolve-motion-value.ts"],"sourcesContent":["import type { AnyResolvedKeyframe } from \"../../animation/types\"\nimport { isMotionValue } from \"./is-motion-value\"\nimport type { MotionValue } from \"../index\"\n\n/**\n * If the provided value is a MotionValue, this returns the actual value, otherwise just the value itself\n */\nexport function resolveMotionValue(\n value?: AnyResolvedKeyframe | MotionValue\n): AnyResolvedKeyframe {\n return isMotionValue(value) ? value.get() : value\n}\n"],"names":[],"mappings":";;AAIA;;AAEG;AACG,SAAU,kBAAkB,CAC9B,KAAyC,EAAA;AAEzC,IAAA,OAAO,aAAa,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,GAAG,EAAE,GAAG,KAAK;AACrD;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/will-change/add-will-change.mjs b/node_modules/motion-dom/dist/es/value/will-change/add-will-change.mjs new file mode 100644 index 0000000..6c9ab79 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/will-change/add-will-change.mjs @@ -0,0 +1,21 @@ +import { MotionGlobalConfig } from 'motion-utils'; +import { isWillChangeMotionValue } from './is.mjs'; + +function addValueToWillChange(visualElement, key) { + const willChange = visualElement.getValue("willChange"); + /** + * It could be that a user has set willChange to a regular MotionValue, + * in which case we can't add the value to it. + */ + if (isWillChangeMotionValue(willChange)) { + return willChange.add(key); + } + else if (!willChange && MotionGlobalConfig.WillChange) { + const newWillChange = new MotionGlobalConfig.WillChange("auto"); + visualElement.addValue("willChange", newWillChange); + newWillChange.add(key); + } +} + +export { addValueToWillChange }; +//# sourceMappingURL=add-will-change.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/will-change/add-will-change.mjs.map b/node_modules/motion-dom/dist/es/value/will-change/add-will-change.mjs.map new file mode 100644 index 0000000..ef5a237 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/will-change/add-will-change.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"add-will-change.mjs","sources":["../../../../src/value/will-change/add-will-change.ts"],"sourcesContent":["import { MotionGlobalConfig } from \"motion-utils\"\nimport type { VisualElement } from \"../../render/VisualElement\"\nimport { isWillChangeMotionValue } from \"./is\"\n\nexport function addValueToWillChange(\n visualElement: VisualElement,\n key: string\n) {\n const willChange = visualElement.getValue(\"willChange\")\n\n /**\n * It could be that a user has set willChange to a regular MotionValue,\n * in which case we can't add the value to it.\n */\n if (isWillChangeMotionValue(willChange)) {\n return willChange.add(key)\n } else if (!willChange && MotionGlobalConfig.WillChange) {\n const newWillChange = new MotionGlobalConfig.WillChange(\"auto\")\n\n visualElement.addValue(\"willChange\", newWillChange)\n newWillChange.add(key)\n }\n}\n"],"names":[],"mappings":";;;AAIM,SAAU,oBAAoB,CAChC,aAA4B,EAC5B,GAAW,EAAA;IAEX,MAAM,UAAU,GAAG,aAAa,CAAC,QAAQ,CAAC,YAAY,CAAC;AAEvD;;;AAGG;AACH,IAAA,IAAI,uBAAuB,CAAC,UAAU,CAAC,EAAE;AACrC,QAAA,OAAO,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC;IAC9B;AAAO,SAAA,IAAI,CAAC,UAAU,IAAI,kBAAkB,CAAC,UAAU,EAAE;QACrD,MAAM,aAAa,GAAG,IAAI,kBAAkB,CAAC,UAAU,CAAC,MAAM,CAAC;AAE/D,QAAA,aAAa,CAAC,QAAQ,CAAC,YAAY,EAAE,aAAa,CAAC;AACnD,QAAA,aAAa,CAAC,GAAG,CAAC,GAAG,CAAC;IAC1B;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/will-change/is.mjs b/node_modules/motion-dom/dist/es/value/will-change/is.mjs new file mode 100644 index 0000000..b36be11 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/will-change/is.mjs @@ -0,0 +1,8 @@ +import { isMotionValue } from '../utils/is-motion-value.mjs'; + +function isWillChangeMotionValue(value) { + return Boolean(isMotionValue(value) && value.add); +} + +export { isWillChangeMotionValue }; +//# sourceMappingURL=is.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/will-change/is.mjs.map b/node_modules/motion-dom/dist/es/value/will-change/is.mjs.map new file mode 100644 index 0000000..f68ce5f --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/will-change/is.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"is.mjs","sources":["../../../../src/value/will-change/is.ts"],"sourcesContent":["import { isMotionValue } from \"../utils/is-motion-value\"\nimport type { WillChange } from \"./types\"\n\nexport function isWillChangeMotionValue(value: any): value is WillChange {\n return Boolean(isMotionValue(value) && (value as WillChange).add)\n}\n"],"names":[],"mappings":";;AAGM,SAAU,uBAAuB,CAAC,KAAU,EAAA;IAC9C,OAAO,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,IAAK,KAAoB,CAAC,GAAG,CAAC;AACrE;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/view/index.mjs b/node_modules/motion-dom/dist/es/view/index.mjs new file mode 100644 index 0000000..639a694 --- /dev/null +++ b/node_modules/motion-dom/dist/es/view/index.mjs @@ -0,0 +1,175 @@ +import { noop } from 'motion-utils'; +import { addToQueue } from './queue.mjs'; + +class ViewTransitionBuilder { + constructor(update, options = {}) { + this.currentSubject = "root"; + this.targets = new Map(); + /** + * Definitions that must be resolved to elements (and assigned a + * `view-transition-name`) rather than treated as pre-named layers. + */ + this.resolveDefs = new Set(); + /** + * Per-subject crop override: `true` forces the crop (clip + object-fit: + * cover + animated corner radii) on, `false` forces it off. A subject with + * no entry uses the default - crop only a genuine morph (a layer present in + * both snapshots), so a fade-only enter/exit isn't clipped to nothing. + */ + this.cropOverride = new Map(); + /** + * Subjects paired with a different new-snapshot target (the second `.add()` + * argument), so two distinct elements share one name and morph into each + * other - a shared-element transition. + */ + this.pairs = new Map(); + /** + * A `view-transition-class` to apply to each subject's resolved elements, + * so authors can target the generated layers from CSS by class rather than + * the opaque generated name. + */ + this.classNames = new Map(); + /** + * Subjects opted out of automatic group nesting via `.group(false)`. Their + * layer stays a flat top-level group (`view-transition-group: none`) instead + * of nesting under its DOM-ancestor layer - so it animates independently and + * escapes an ancestor's clip/transform (e.g. an element that lifts out of a + * card and flies across, which nesting would clip to the card). + */ + this.flatGroups = new Set(); + this.notifyReady = noop; + this.notifyReject = noop; + this.readyPromise = new Promise((resolve, reject) => { + this.notifyReady = resolve; + this.notifyReject = reject; + }); + this.update = update; + this.options = { + interrupt: "wait", + ...options, + }; + // Avoid an unhandled rejection when a failed transition has no + // `.then(_, reject)` handler attached (e.g. fire-and-forget). + this.readyPromise.catch(noop); + addToQueue(this); + } + /** + * Target elements resolved from a selector or Element, each assigned a + * `view-transition-name` automatically. + * + * Passing a second target pairs them: the first is resolved in the old + * snapshot and the second in the new, sharing one name so two *different* + * elements morph into each other (e.g. `.add(card, ".modal")`). Symmetric - + * pass them the other way round to morph back. + */ + add(subject, newSubject) { + this.currentSubject = subject; + this.resolveDefs.add(subject); + if (newSubject !== undefined) + this.pairs.set(subject, newSubject); + // Register the subject so it participates (and gets an automatic + // layout/morph animation) even without an explicit enter/exit/layout. + if (!this.targets.has(subject)) + this.targets.set(subject, {}); + return this; + } + /** + * Control this subject's crop (clip + `object-fit: cover` + animated + * corners). By default a subject auto-crops only when it actually morphs - + * present in both snapshots (a survivor, or an `.add(a, b)` pair). A + * fade-only enter/exit has no second box to crop against, so it's left to + * the browser default; in particular the `overflow: clip` a crop adds would + * otherwise clip a mis-sized enter/exit layer to nothing. + * + * `.crop(false)` forces the crop off (e.g. a text morph, where + * `object-fit: cover` clips glyphs as the box grows); `.crop(true)` forces + * it on for a non-morph the default wouldn't otherwise crop. + */ + crop(enabled = true) { + this.cropOverride.set(this.currentSubject, enabled); + return this; + } + /** + * By default a subject's layer nests under its nearest DOM-ancestor layer + * (`view-transition-group: contain`), so the ancestor's clip/transform/opacity + * apply to it through the transition - mirroring how the DOM actually paints, + * and letting a wrapper crop its child for the whole morph rather than only + * once the live DOM takes back over. (Needs a browser that supports nested + * view-transition groups; elsewhere it degrades to the flat default.) + * + * Call `.group(false)` to opt out: the layer stays flat and top-level, so it + * animates independently and escapes an ancestor's clip - e.g. an element + * that should lift out of a card and fly across, which nesting would clip. + */ + group(enabled = true) { + enabled + ? this.flatGroups.delete(this.currentSubject) + : this.flatGroups.add(this.currentSubject); + return this; + } + /** + * Tag this subject's generated layers with a `view-transition-class`, so + * they can be targeted from CSS - `::view-transition-group(.name)`, + * `::view-transition-old/new(.name)`, `::view-transition-image-pair(.name)` + * - without the opaque generated `view-transition-name`. Because `.add()` + * can match many elements, a shared class targets them all at once (and, + * for a pair, both ends). The escape hatch for z-index / custom keyframes + * on a morph layer. + */ + class(name) { + this.classNames.set(this.currentSubject, name); + return this; + } + /** + * Set the transition for this subject's morph. The morph is enabled + * automatically by `.add()`; this just customises its timing (duration, + * easing, a `delay`/`stagger`, …). On the implicit `root` subject it also + * opts the page into the transition (the root crossfade). + */ + layout(options = {}) { + this.updateTarget("layout", {}, options); + return this; + } + enter(keyframes, options) { + this.updateTarget("enter", keyframes, options); + return this; + } + exit(keyframes, options) { + this.updateTarget("exit", keyframes, options); + return this; + } + /** + * Animate the new view directly, whether the element is appearing or + * persisting (unlike `.enter()`, which only fires for a pure newcomer). + * Pair with `.old()` for a crossfade or slide-through. + */ + new(keyframes, options) { + this.updateTarget("new", keyframes, options); + return this; + } + /** + * Animate the old view directly, whether the element is leaving or + * persisting (unlike `.exit()`, which only fires for a pure leaver). + */ + old(keyframes, options) { + this.updateTarget("old", keyframes, options); + return this; + } + updateTarget(target, keyframes, options = {}) { + const { currentSubject, targets } = this; + if (!targets.has(currentSubject)) { + targets.set(currentSubject, {}); + } + const targetData = targets.get(currentSubject); + targetData[target] = { keyframes, options }; + } + then(resolve, reject) { + return this.readyPromise.then(resolve, reject); + } +} +function animateView(update, options = {}) { + return new ViewTransitionBuilder(update, options); +} + +export { ViewTransitionBuilder, animateView }; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/motion-dom/dist/es/view/index.mjs.map b/node_modules/motion-dom/dist/es/view/index.mjs.map new file mode 100644 index 0000000..5f15e68 --- /dev/null +++ b/node_modules/motion-dom/dist/es/view/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../../../src/view/index.ts"],"sourcesContent":["import { noop } from \"motion-utils\"\nimport type { GroupAnimation } from \"../animation/GroupAnimation\"\nimport { AnimationOptions, DOMKeyframesDefinition } from \"../animation/types\"\nimport { addToQueue } from \"./queue\"\nimport {\n ViewTransitionOptions,\n ViewTransitionTarget,\n ViewTransitionTargetDefinition,\n} from \"./types\"\nimport \"./types.global\"\n\n// Re-export the public view-transition types so they flow out through\n// motion-dom -> framer-motion -> motion alongside `animateView`.\nexport type * from \"./types\"\n\nexport class ViewTransitionBuilder {\n private currentSubject: ViewTransitionTargetDefinition = \"root\"\n\n targets = new Map()\n\n /**\n * Definitions that must be resolved to elements (and assigned a\n * `view-transition-name`) rather than treated as pre-named layers.\n */\n resolveDefs = new Set()\n\n /**\n * Per-subject crop override: `true` forces the crop (clip + object-fit:\n * cover + animated corner radii) on, `false` forces it off. A subject with\n * no entry uses the default - crop only a genuine morph (a layer present in\n * both snapshots), so a fade-only enter/exit isn't clipped to nothing.\n */\n cropOverride = new Map()\n\n /**\n * Subjects paired with a different new-snapshot target (the second `.add()`\n * argument), so two distinct elements share one name and morph into each\n * other - a shared-element transition.\n */\n pairs = new Map<\n ViewTransitionTargetDefinition,\n ViewTransitionTargetDefinition\n >()\n\n /**\n * A `view-transition-class` to apply to each subject's resolved elements,\n * so authors can target the generated layers from CSS by class rather than\n * the opaque generated name.\n */\n classNames = new Map()\n\n /**\n * Subjects opted out of automatic group nesting via `.group(false)`. Their\n * layer stays a flat top-level group (`view-transition-group: none`) instead\n * of nesting under its DOM-ancestor layer - so it animates independently and\n * escapes an ancestor's clip/transform (e.g. an element that lifts out of a\n * card and flies across, which nesting would clip to the card).\n */\n flatGroups = new Set()\n\n update: () => void | Promise\n\n options: ViewTransitionOptions\n\n notifyReady: (value: GroupAnimation) => void = noop\n\n notifyReject: (error: unknown) => void = noop\n\n private readyPromise = new Promise((resolve, reject) => {\n this.notifyReady = resolve\n this.notifyReject = reject\n })\n\n constructor(\n update: () => void | Promise,\n options: ViewTransitionOptions = {}\n ) {\n this.update = update\n this.options = {\n interrupt: \"wait\",\n ...options,\n }\n // Avoid an unhandled rejection when a failed transition has no\n // `.then(_, reject)` handler attached (e.g. fire-and-forget).\n this.readyPromise.catch(noop)\n addToQueue(this)\n }\n\n /**\n * Target elements resolved from a selector or Element, each assigned a\n * `view-transition-name` automatically.\n *\n * Passing a second target pairs them: the first is resolved in the old\n * snapshot and the second in the new, sharing one name so two *different*\n * elements morph into each other (e.g. `.add(card, \".modal\")`). Symmetric -\n * pass them the other way round to morph back.\n */\n add(\n subject: ViewTransitionTargetDefinition,\n newSubject?: ViewTransitionTargetDefinition\n ) {\n this.currentSubject = subject\n this.resolveDefs.add(subject)\n if (newSubject !== undefined) this.pairs.set(subject, newSubject)\n // Register the subject so it participates (and gets an automatic\n // layout/morph animation) even without an explicit enter/exit/layout.\n if (!this.targets.has(subject)) this.targets.set(subject, {})\n\n return this\n }\n\n /**\n * Control this subject's crop (clip + `object-fit: cover` + animated\n * corners). By default a subject auto-crops only when it actually morphs -\n * present in both snapshots (a survivor, or an `.add(a, b)` pair). A\n * fade-only enter/exit has no second box to crop against, so it's left to\n * the browser default; in particular the `overflow: clip` a crop adds would\n * otherwise clip a mis-sized enter/exit layer to nothing.\n *\n * `.crop(false)` forces the crop off (e.g. a text morph, where\n * `object-fit: cover` clips glyphs as the box grows); `.crop(true)` forces\n * it on for a non-morph the default wouldn't otherwise crop.\n */\n crop(enabled = true) {\n this.cropOverride.set(this.currentSubject, enabled)\n\n return this\n }\n\n /**\n * By default a subject's layer nests under its nearest DOM-ancestor layer\n * (`view-transition-group: contain`), so the ancestor's clip/transform/opacity\n * apply to it through the transition - mirroring how the DOM actually paints,\n * and letting a wrapper crop its child for the whole morph rather than only\n * once the live DOM takes back over. (Needs a browser that supports nested\n * view-transition groups; elsewhere it degrades to the flat default.)\n *\n * Call `.group(false)` to opt out: the layer stays flat and top-level, so it\n * animates independently and escapes an ancestor's clip - e.g. an element\n * that should lift out of a card and fly across, which nesting would clip.\n */\n group(enabled = true) {\n enabled\n ? this.flatGroups.delete(this.currentSubject)\n : this.flatGroups.add(this.currentSubject)\n\n return this\n }\n\n /**\n * Tag this subject's generated layers with a `view-transition-class`, so\n * they can be targeted from CSS - `::view-transition-group(.name)`,\n * `::view-transition-old/new(.name)`, `::view-transition-image-pair(.name)`\n * - without the opaque generated `view-transition-name`. Because `.add()`\n * can match many elements, a shared class targets them all at once (and,\n * for a pair, both ends). The escape hatch for z-index / custom keyframes\n * on a morph layer.\n */\n class(name: string) {\n this.classNames.set(this.currentSubject, name)\n\n return this\n }\n\n /**\n * Set the transition for this subject's morph. The morph is enabled\n * automatically by `.add()`; this just customises its timing (duration,\n * easing, a `delay`/`stagger`, …). On the implicit `root` subject it also\n * opts the page into the transition (the root crossfade).\n */\n layout(options: AnimationOptions = {}) {\n this.updateTarget(\"layout\", {}, options)\n\n return this\n }\n\n enter(keyframes: DOMKeyframesDefinition, options?: AnimationOptions) {\n this.updateTarget(\"enter\", keyframes, options)\n\n return this\n }\n\n exit(keyframes: DOMKeyframesDefinition, options?: AnimationOptions) {\n this.updateTarget(\"exit\", keyframes, options)\n\n return this\n }\n\n /**\n * Animate the new view directly, whether the element is appearing or\n * persisting (unlike `.enter()`, which only fires for a pure newcomer).\n * Pair with `.old()` for a crossfade or slide-through.\n */\n new(keyframes: DOMKeyframesDefinition, options?: AnimationOptions) {\n this.updateTarget(\"new\", keyframes, options)\n\n return this\n }\n\n /**\n * Animate the old view directly, whether the element is leaving or\n * persisting (unlike `.exit()`, which only fires for a pure leaver).\n */\n old(keyframes: DOMKeyframesDefinition, options?: AnimationOptions) {\n this.updateTarget(\"old\", keyframes, options)\n\n return this\n }\n\n updateTarget(\n target: \"enter\" | \"exit\" | \"layout\" | \"new\" | \"old\",\n keyframes: DOMKeyframesDefinition,\n options: AnimationOptions = {}\n ) {\n const { currentSubject, targets } = this\n\n if (!targets.has(currentSubject)) {\n targets.set(currentSubject, {})\n }\n\n const targetData = targets.get(currentSubject)!\n\n targetData[target] = { keyframes, options }\n }\n\n then(resolve: () => void, reject?: () => void) {\n return this.readyPromise.then(resolve, reject)\n }\n}\n\nexport function animateView(\n update: () => void | Promise,\n options: ViewTransitionOptions = {}\n) {\n return new ViewTransition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AAA,OAAO,IAAI;IACf;AAEA;;;;AAIG;IACH,GAAG,CAAC,SAAiC,EAAE,OAA0B,EAAA;QAC7D,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,SAAS,EAAE,OAAO,CAAC;AAE5C,QAAA,OAAO,IAAI;IACf;AAEA;;;AAGG;IACH,GAAG,CAAC,SAAiC,EAAE,OAA0B,EAAA;QAC7D,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,SAAS,EAAE,OAAO,CAAC;AAE5C,QAAA,OAAO,IAAI;IACf;AAEA,IAAA,YAAY,CACR,MAAmD,EACnD,SAAiC,EACjC,UAA4B,EAAE,EAAA;AAE9B,QAAA,MAAM,EAAE,cAAc,EAAE,OAAO,EAAE,GAAG,IAAI;QAExC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,EAAE;AAC9B,YAAA,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,EAAE,CAAC;QACnC;QAEA,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,CAAE;QAE/C,UAAU,CAAC,MAAM,CAAC,GAAG,EAAE,SAAS,EAAE,OAAO,EAAE;IAC/C;IAEA,IAAI,CAAC,OAAmB,EAAE,MAAmB,EAAA;QACzC,OAAO,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC;IAClD;AACH;SAEe,WAAW,CACvB,MAAkC,EAClC,UAAiC,EAAE,EAAA;AAEnC,IAAA,OAAO,IAAI,qBAAqB,CAAC,MAAM,EAAE,OAAO,CAAC;AACrD;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/view/queue.mjs b/node_modules/motion-dom/dist/es/view/queue.mjs new file mode 100644 index 0000000..80439b6 --- /dev/null +++ b/node_modules/motion-dom/dist/es/view/queue.mjs @@ -0,0 +1,59 @@ +import { removeItem } from 'motion-utils'; +import { microtask } from '../frameloop/microtask.mjs'; +import { startViewAnimation } from './start.mjs'; + +let builders = []; +let current = null; +function next() { + current = null; + const [nextBuilder] = builders; + if (nextBuilder) + start(nextBuilder); +} +function start(builder) { + removeItem(builders, builder); + current = builder; + startViewAnimation(builder) + .then((animation) => { + builder.notifyReady(animation); + return animation.finished; + }) + // A genuinely failed transition (a throwing update) rejects the + // builder; a skipped/interrupted one resolves with no animations (see + // start.ts). Either way, advance the queue - else later transitions hang. + .catch((error) => builder.notifyReject(error)) + .finally(next); +} +function processQueue() { + /** + * Iterate backwards over the builders array. We can ignore the + * "wait" animations. If we have an interrupting animation in the + * queue then we need to batch all preceeding animations into it. + * Currently this only batches the update functions but will also + * need to batch the targets. + */ + for (let i = builders.length - 1; i >= 0; i--) { + const builder = builders[i]; + const { interrupt } = builder.options; + if (interrupt === "immediate") { + const batchedUpdates = builders.slice(0, i + 1).map((b) => b.update); + const remaining = builders.slice(i + 1); + builder.update = () => { + batchedUpdates.forEach((update) => update()); + }; + // Put the current builder at the front, followed by any "wait" builders + builders = [builder, ...remaining]; + break; + } + } + if (!current || builders[0]?.options.interrupt === "immediate") { + next(); + } +} +function addToQueue(builder) { + builders.push(builder); + microtask.render(processQueue); +} + +export { addToQueue }; +//# sourceMappingURL=queue.mjs.map diff --git a/node_modules/motion-dom/dist/es/view/queue.mjs.map b/node_modules/motion-dom/dist/es/view/queue.mjs.map new file mode 100644 index 0000000..03f5d6d --- /dev/null +++ b/node_modules/motion-dom/dist/es/view/queue.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"queue.mjs","sources":["../../../src/view/queue.ts"],"sourcesContent":["import { removeItem } from \"motion-utils\"\nimport type { ViewTransitionBuilder } from \".\"\nimport { microtask } from \"../frameloop/microtask\"\nimport { startViewAnimation } from \"./start\"\n\nlet builders: ViewTransitionBuilder[] = []\n\nlet current: ViewTransitionBuilder | null = null\n\nfunction next() {\n current = null\n const [nextBuilder] = builders\n if (nextBuilder) start(nextBuilder)\n}\n\nfunction start(builder: ViewTransitionBuilder) {\n removeItem(builders, builder)\n current = builder\n startViewAnimation(builder)\n .then((animation) => {\n builder.notifyReady(animation)\n return animation.finished\n })\n // A genuinely failed transition (a throwing update) rejects the\n // builder; a skipped/interrupted one resolves with no animations (see\n // start.ts). Either way, advance the queue - else later transitions hang.\n .catch((error) => builder.notifyReject(error))\n .finally(next)\n}\n\nfunction processQueue() {\n /**\n * Iterate backwards over the builders array. We can ignore the\n * \"wait\" animations. If we have an interrupting animation in the\n * queue then we need to batch all preceeding animations into it.\n * Currently this only batches the update functions but will also\n * need to batch the targets.\n */\n for (let i = builders.length - 1; i >= 0; i--) {\n const builder = builders[i]\n const { interrupt } = builder.options\n\n if (interrupt === \"immediate\") {\n const batchedUpdates = builders.slice(0, i + 1).map((b) => b.update)\n const remaining = builders.slice(i + 1)\n\n builder.update = () => {\n batchedUpdates.forEach((update) => update())\n }\n\n // Put the current builder at the front, followed by any \"wait\" builders\n builders = [builder, ...remaining]\n\n break\n }\n }\n\n if (!current || builders[0]?.options.interrupt === \"immediate\") {\n next()\n }\n}\n\nexport function addToQueue(builder: ViewTransitionBuilder) {\n builders.push(builder)\n microtask.render(processQueue)\n}\n"],"names":[],"mappings":";;;;AAKA,IAAI,QAAQ,GAA4B,EAAE;AAE1C,IAAI,OAAO,GAAiC,IAAI;AAEhD,SAAS,IAAI,GAAA;IACT,OAAO,GAAG,IAAI;AACd,IAAA,MAAM,CAAC,WAAW,CAAC,GAAG,QAAQ;AAC9B,IAAA,IAAI,WAAW;QAAE,KAAK,CAAC,WAAW,CAAC;AACvC;AAEA,SAAS,KAAK,CAAC,OAA8B,EAAA;AACzC,IAAA,UAAU,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC7B,OAAO,GAAG,OAAO;IACjB,kBAAkB,CAAC,OAAO;AACrB,SAAA,IAAI,CAAC,CAAC,SAAS,KAAI;AAChB,QAAA,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC;QAC9B,OAAO,SAAS,CAAC,QAAQ;AAC7B,IAAA,CAAC;;;;AAIA,SAAA,KAAK,CAAC,CAAC,KAAK,KAAK,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC;SAC5C,OAAO,CAAC,IAAI,CAAC;AACtB;AAEA,SAAS,YAAY,GAAA;AACjB;;;;;;AAMG;AACH,IAAA,KAAK,IAAI,CAAC,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE;AAC3C,QAAA,MAAM,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC;AAC3B,QAAA,MAAM,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,OAAO;AAErC,QAAA,IAAI,SAAS,KAAK,WAAW,EAAE;YAC3B,MAAM,cAAc,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC;YACpE,MAAM,SAAS,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC;AAEvC,YAAA,OAAO,CAAC,MAAM,GAAG,MAAK;gBAClB,cAAc,CAAC,OAAO,CAAC,CAAC,MAAM,KAAK,MAAM,EAAE,CAAC;AAChD,YAAA,CAAC;;AAGD,YAAA,QAAQ,GAAG,CAAC,OAAO,EAAE,GAAG,SAAS,CAAC;YAElC;QACJ;IACJ;AAEA,IAAA,IAAI,CAAC,OAAO,IAAI,QAAQ,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,SAAS,KAAK,WAAW,EAAE;AAC5D,QAAA,IAAI,EAAE;IACV;AACJ;AAEM,SAAU,UAAU,CAAC,OAA8B,EAAA;AACrD,IAAA,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC;AACtB,IAAA,SAAS,CAAC,MAAM,CAAC,YAAY,CAAC;AAClC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/view/start.mjs b/node_modules/motion-dom/dist/es/view/start.mjs new file mode 100644 index 0000000..869be6c --- /dev/null +++ b/node_modules/motion-dom/dist/es/view/start.mjs @@ -0,0 +1,700 @@ +import { warnOnce, secondsToMilliseconds } from 'motion-utils'; +import { GroupAnimation } from '../animation/GroupAnimation.mjs'; +import { NativeAnimation } from '../animation/NativeAnimation.mjs'; +import { NativeAnimationWrapper } from '../animation/NativeAnimationWrapper.mjs'; +import { getValueTransition } from '../animation/utils/get-value-transition.mjs'; +import { mapEasingToNativeEasing } from '../animation/waapi/easing/map-easing.mjs'; +import { applyGeneratorOptions } from '../animation/waapi/utils/apply-generator.mjs'; +import { cornerRadiusProps } from '../utils/border-radius.mjs'; +import { resolveElements } from '../utils/resolve-elements.mjs'; +import { assignViewTransitionNames, releaseViewTransitionNames } from './utils/assign-names.mjs'; +import { chooseLayerType } from './utils/choose-layer-type.mjs'; +import { css } from './utils/css.mjs'; +import { getViewAnimationLayerInfo } from './utils/get-layer-info.mjs'; +import { getViewAnimations } from './utils/get-view-animations.mjs'; +import { hasTarget } from './utils/has-target.mjs'; + +const definitionNames = ["layout", "enter", "exit", "new", "old"]; +/** + * Whether a computed border-radius is square (every component zero). Splitting + * on whitespace handles two-value/elliptical radii like "0px 20px" - a leading + * `parseFloat` alone would misread the non-zero vertical radius as square. + */ +const isSquareRadius = (radius) => radius.split(" ").every((value) => parseFloat(value) === 0); +/** + * The `ViewTransitionTarget` buckets driving each generated layer type, in + * priority order - the inverse of `chooseLayerType`. The new view is driven by + * `new`/`enter`, the old by `old`/`exit`. `group-children`/`image-pair` have no + * bucket; they follow the default layout timing. + */ +const typeBuckets = { + group: ["layout"], + new: ["new", "enter"], + old: ["old", "exit"], +}; +/** + * Default "absent" origin for a single-value keyframe, by pseudo type, so e.g. + * `enter({ scale: 1 })` grows in from 0.85 and `exit({ opacity: 0 })` fades + * from 1. `enter` prefers the matching `exit` value over these (see below). + */ +const ORIGIN_DEFAULTS = { + new: { opacity: 0, scale: 0.85 }, + old: { opacity: 1, scale: 1 }, +}; +/** + * How much two box aspect ratios must differ before a morph is treated as + * aspect-changing (and so worth cropping). Matches the projection engine's + * `preserve-aspect` threshold, so small layout jitter doesn't trigger a crop. + */ +const ASPECT_TOLERANCE = 0.2; +function startViewAnimation(builder) { + const { update, targets, resolveDefs, cropOverride, pairs, classNames, flatGroups, options: defaultOptions, } = builder; + if (!document.startViewTransition) { + // An async IIFE (not `new Promise(async …)`) so a throwing/rejecting + // update rejects this promise rather than leaving it unsettled. + return (async () => { + await update(); + return new GroupAnimation([]); + })(); + } + /** + * Resolve any selector/Element targets to layer names, assigning a + * `view-transition-name` to each element as we go. We run this before the + * update (so the elements are captured in the old snapshot) and again + * after it (for the new snapshot). An element present in both keeps the + * same name and animates as a single `group` layer. + */ + const nameRegistry = new Map(); + const assigned = []; + /** + * Elements we tagged with a `view-transition-class` (via `.class()`), + * tracked separately from `assigned` so cleanup removes the class without + * ever stripping an author's own inline `view-transition-name`. + */ + const classed = []; + /** + * Elements we set a `view-transition-group` on (for nesting), tracked for + * cleanup. `clipChildren` collects the names of nested parents that clip in + * the live layout, so their `::view-transition-group-children` is clipped + * through the transition - not just once the live DOM takes back over. + */ + const grouped = []; + const clipChildren = new Set(); + const layerTargets = new Map(); + const croppedNames = new Set(); + /** + * Each layer's explicit `.crop(true | false)` override (by resolved name), + * so `finalizeCrop` can let an author's choice win over the morph default. + */ + const cropForName = new Map(); + /** + * Each layer's stagger position (index + total) within its subject, per + * snapshot. Resolving against the snapshot the layer belongs to keeps + * stagger correct when `update()` replaces the matched elements, and lets + * us skip a layer that's absent from a snapshot (e.g. an exited element + * has no `new` pseudo-element). + */ + const layerStagger = new Map(); + /** + * Names allocated for a paired subject in the old snapshot, replayed onto + * its new-snapshot target so both ends share a layer and morph. + */ + const pairNames = new Map(); + /** + * The old (`from`) elements of each paired subject, so their names can be + * transferred off before the new (`to`) elements inherit them. + */ + const pairFrom = new Map(); + const resolveLayers = (phase) => { + targets.forEach((target, definition) => { + const className = classNames.get(definition); + /** + * Nest each resolved layer under its DOM-ancestor layer by default + * (`contain`), so an ancestor's clip/transform/opacity reach it + * through the transition; `.group(false)` opts a subject out (`none`) + * to stay flat and escape. Skipped for root / pre-named layers, which + * aren't elements we resolve and style. + */ + const group = definition === "root" || !resolveDefs.has(definition) + ? undefined + : flatGroups.has(definition) + ? "none" + : "contain"; + let names; + if (definition === "root" || !resolveDefs.has(definition)) { + names = [definition]; + } + else if (pairs.has(definition)) { + /** + * Paired morph: name the old target in the old snapshot, then + * force the same name(s) onto the new target in the new one, so + * two different elements morph as a single layer. + */ + if (phase === "old") { + pairFrom.set(definition, resolveElements(definition)); + names = assignViewTransitionNames(definition, nameRegistry, assigned, undefined, className, classed, group, grouped, clipChildren); + pairNames.set(definition, names); + } + else { + /** + * Transfer the name(s) off the `from` elements before the + * `to` elements inherit them. A `from` that survives into + * the new snapshot (e.g. hidden with `visibility: hidden` + * rather than removed) would otherwise keep the name and + * collide - "duplicate view-transition-name". + */ + for (const el of pairFrom.get(definition) ?? []) { + el.style?.removeProperty("view-transition-name"); + /** + * Drop the old end from the registry too, so the new + * end alone supplies this name's `new` crop radii - we + * neither re-measure nor get ordered by a stale element. + */ + nameRegistry.delete(el); + } + names = assignViewTransitionNames(pairs.get(definition), nameRegistry, assigned, pairNames.get(definition), className, classed, group, grouped, clipChildren); + } + } + else { + names = assignViewTransitionNames(definition, nameRegistry, assigned, undefined, className, classed, group, grouped, clipChildren); + } + // Record any explicit `.crop(true | false)` per resolved name; the + // crop set itself is computed later by `finalizeCrop` (it needs both + // snapshots to know which morphs change aspect ratio). + const override = cropOverride.get(definition); + names.forEach((name, index) => { + /** + * If two subjects resolve to the same element, merge their + * definitions so neither subject's animations are dropped. + */ + const existing = layerTargets.get(name); + layerTargets.set(name, existing && existing !== target + ? { ...existing, ...target } + : target); + if (override !== undefined) + cropForName.set(name, override); + const stagger = layerStagger.get(name) ?? {}; + stagger[phase] = [index, names.length]; + layerStagger.set(name, stagger); + }); + }); + }; + /** + * The stagger index/total for a layer, resolved against the snapshot it + * belongs to. Returns index -1 when the layer is absent from that snapshot + * so the caller can skip a pseudo-element that doesn't exist. + */ + const staggerPosition = (name, type) => { + const stagger = layerStagger.get(name); + const position = type === "old" + ? stagger?.old + : type === "new" + ? stagger?.new + : // group / group-children / image-pair persist across both. + stagger?.new ?? stagger?.old; + return position ?? [-1, 1]; + }; + /** + * Merge default + per-layer transition options for a generated layer and + * resolve any stagger/delay function against this element's position. Used + * by both the morph-retiming and crop corner-radius passes. + */ + const resolveLayerTransition = (target, type, transitionName, index, total) => { + const transition = mergeTransition(getValueTransition(defaultOptions, transitionName), getValueTransition((layerOptions(target, type) ?? {}), transitionName)); + if (typeof transition.delay === "function") { + transition.delay = transition.delay(index, total); + } + return transition; + }; + /** + * Resolve a layer's group (`layout`) timing to plain WAAPI values: native + * ms `delay`/`duration` and a baked `ease`. The single source of group + * timing, shared by the generated-group retiming and the crop corner-radius + * pass so the rounded clip animates on exactly the box's timing. It returns + * no generator `type` (the WAAPI-only `NativeAnimation` rejects a string + * type) nor `repeat`/`times` (which the group's `updateTiming` ignores), so + * none of them can leak into the radius animation and desync it. + */ + const resolveGroupTiming = (name) => { + const [index, total] = staggerPosition(name, "group"); + const transition = resolveLayerTransition(layerTargets.get(name), "group", "layout", index === -1 ? 0 : index, total); + transition.duration && (transition.duration = secondsToMilliseconds(transition.duration)); + const { delay = 0, duration, ease } = applyGeneratorOptions(transition); + return { delay: secondsToMilliseconds(delay), duration, ease }; + }; + /** + * Each layer's measured box + corner radii per snapshot. The box lets + * `finalizeCrop` tell whether a morph's aspect ratio changed (the only case + * worth cropping); the radii let a cropped morph's group clip animate each + * corner from the old element's radius to the new element's, keeping it + * rounded where `overflow: clip` would otherwise square the corners. + * + * We never flatten the source for capture (a snapshot is a paint of the live + * DOM, so squaring an element just for its capture would flash one real + * square frame). For an aspect-changing morph `object-fit: cover` crops each + * snapshot's own baked corners off-screen mid-morph, so the animated clip is + * the only visible corner; a near-same-aspect forced crop (`.crop(true)`) + * can't hide the outgoing snapshot's silhouette, but the endpoints coincide. + */ + const cropMeasurements = new Map(); + const measureLayers = (phase) => nameRegistry.forEach((name, element) => { + const el = element; + const rect = el.getBoundingClientRect?.(); + if (rect && rect.height) { + const style = getComputedStyle(el); + const radii = {}; + for (const corner of cornerRadiusProps) { + radii[corner] = style[corner]; + } + const entry = cropMeasurements.get(name) ?? {}; + entry[phase] = { width: rect.width, height: rect.height, radii }; + cropMeasurements.set(name, entry); + } + }); + /** + * With both snapshots measured, settle which layers crop. The default crops + * only a morph whose aspect ratio *changes* between snapshots - the one case + * where `object-fit: cover` does real work. A same-aspect morph or a + * fade-only layer is left uncropped: its corners scale naturally (no flash + * from squaring, no `overflow: clip` eating its shadow) and a backdrop can't + * be clipped to nothing. An explicit `.crop(true | false)` overrides either + * way. Runs after both snapshots are measured, since aspect needs both. + */ + const finalizeCrop = () => { + croppedNames.clear(); + for (const name of layerStagger.keys()) { + if (name === "root") + continue; + // An explicit `.crop(true | false)` wins; otherwise crop a morph + // whose aspect ratio changed. + if (cropForName.get(name) ?? aspectChanged(name)) { + croppedNames.add(name); + } + } + }; + /** + * Whether a layer is a morph whose box aspect ratio changed between + * snapshots (beyond a small tolerance). Fade-only layers (one snapshot) are + * never "changed". + */ + const aspectChanged = (name) => { + const box = cropMeasurements.get(name); + if (!box?.old || !box?.new || !box.old.height || !box.new.height) { + return false; + } + return (Math.abs(box.old.width / box.old.height - + box.new.width / box.new.height) > ASPECT_TOLERANCE); + }; + /** + * Write the persistent view-transition CSS: suppress root capture when the + * root has no animations of its own; force linear timing (baked into the + * keyframes, so we can retime later via updateTiming); and clip + + * object-fit: cover every cropped morph (the UA default overflows on + * aspect-ratio change). + * + * `css.commit` replaces rather than appends, so we re-set the full rule set + * each call - the crop rules are only known after `finalizeCrop` runs in the + * update callback, so the second call writes them. + */ + const commitViewCSS = () => { + if (!hasTarget("root", targets)) { + css.set(":root", { "view-transition-name": "none" }); + } + css.set("::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)", { "animation-timing-function": "linear !important" }); + croppedNames.forEach((name) => { + css.set(`::view-transition-group(${name})`, { overflow: "clip" }); + css.set(`::view-transition-old(${name}), ::view-transition-new(${name})`, { width: "100%", height: "100%", "object-fit": "cover" }); + }); + /** + * Clip the nested children of any layer that clips in the live layout, + * so a wrapper crops its child for the whole morph (mirroring the DOM) + * rather than only at the live-DOM handoff. No-op on browsers without + * nested view-transition groups. + */ + clipChildren.forEach((name) => { + css.set(`::view-transition-group-children(${name})`, { + overflow: "clip", + }); + }); + css.commit(); // Write + }; + const cleanup = () => { + releaseViewTransitionNames(assigned, classed, grouped); + css.remove(); // Write + }; + const callback = async () => { + await update(); + /** + * Re-resolve so elements created by the update are named for the new + * snapshot, then measure them. With both snapshots measured we can + * settle the crop set (aspect-changing morphs + forced). + */ + resolveLayers("new"); + measureLayers("new"); + finalizeCrop(); + /** + * Re-commit the crop CSS unconditionally: `finalizeCrop` is computed + * here (after both snapshots are measured), so the clip rules must be + * (re)written to match the settled set. + */ + commitViewCSS(); + }; + let transition; + try { + resolveLayers("old"); + /** + * Measure the old snapshot against the optimistic crop set (the new + * snapshot doesn't exist yet, so aspect change can't be known here; + * `finalizeCrop` settles it post-update). + */ + measureLayers("old"); + commitViewCSS(); + transition = document.startViewTransition(callback); + } + catch (error) { + /** + * The prelude writes inline names before the transition exists. If it + * throws (e.g. startViewTransition rejects in a bad UA state), release + * them so we neither leak DOM state nor stall the queue on a promise + * that never settles - hand back a rejection it can advance past. + */ + cleanup(); + return Promise.reject(error); + } + transition.finished.finally(cleanup); + return new Promise((resolve, reject) => { + transition.ready + .then(() => { + const generatedViewAnimations = getViewAnimations(); + const animations = []; + /** + * Create animations for each of our explicitly-defined subjects. + * `opacityAnimated` additionally tracks which `${name}:${type}` + * we faded, so we can keep the UA `plus-lighter` blend only for a + * genuine opacity crossfade (both sides fading) and drop it for a + * slide/transform, where additive compositing would flash bright. + */ + const explicitlyAnimated = new Set(); + const opacityAnimated = new Set(); + layerTargets.forEach((target, name) => { + const stagger = layerStagger.get(name); + /** + * Presence: `enter` only fires for a pure newcomer (a new + * view with no old), `exit` only for a pure leaver. A + * survivor (both) gets neither - it just morphs. + */ + const enterApplies = !!stagger?.new && !stagger?.old; + const exitApplies = !!stagger?.old && !stagger?.new; + for (const key of definitionNames) { + if (!target[key]) + continue; + if (key === "enter" && !enterApplies) + continue; + if (key === "exit" && !exitApplies) + continue; + const type = chooseLayerType(key); + const [index, total] = staggerPosition(name, type); + // Skip a layer absent from its snapshot. + if (index === -1) + continue; + const { keyframes, options } = target[key]; + for (let [valueName, valueKeyframes] of Object.entries(keyframes)) { + // Skip only missing values - `0` (e.g. opacity: 0) + // is valid and must reach the from-value inference. + if (valueKeyframes == null) + continue; + /** + * The view path hands keyframes straight to WAAPI, + * so Motion's `x`/`y` shorthands (compiled to + * `transform` only via the value pipeline) have no + * effect. Warn and skip - use `transform`/`translate`. + */ + if (valueName === "x" || valueName === "y") { + warnOnce(false, `animateView() animates view-transition layers with CSS properties; the "${valueName}" shorthand has no effect - use transform, e.g. { transform: "translateX(40px)" }.`); + continue; + } + /** + * enter/exit win over new/old on a shared property - + * skip it here when the gated bucket also defines it. + */ + if (key === "new" && + enterApplies && + target.enter?.keyframes[valueName] != null) { + continue; + } + if (key === "old" && + exitApplies && + target.exit?.keyframes[valueName] != null) { + continue; + } + const valueOptions = mergeTransition(getValueTransition(defaultOptions, valueName), getValueTransition(options, valueName)); + /** + * Infer an origin for a single-value keyframe. An + * `enter` mirrors the matching `exit` value (a + * defined exit reverses into the enter for free); + * otherwise the per-type default (opacity 0/1, scale + * 0.85). No default -> left as-is (animates from the + * live value). + * + * `new`/`old` fire for survivors too, where only the + * opacity crossfade default applies - a transform + * default like scale 0.85 would pop a persisting + * element, so gate it on the layer actually + * entering/leaving. + */ + if (!Array.isArray(valueKeyframes)) { + const exitValue = key === "enter" + ? target.exit?.keyframes[valueName] + : undefined; + const allowDefault = valueName === "opacity" || + (type === "new" ? enterApplies : exitApplies); + const from = exitValue != null + ? Array.isArray(exitValue) + ? exitValue[exitValue.length - 1] + : exitValue + : allowDefault + ? ORIGIN_DEFAULTS[type]?.[valueName] + : undefined; + if (from !== undefined) { + valueKeyframes = [from, valueKeyframes]; + } + } + /** + * Resolve stagger function if provided, per element + * across this subject's resolved layers. + */ + if (typeof valueOptions.delay === "function") { + valueOptions.delay = valueOptions.delay(index, total); + } + valueOptions.duration && (valueOptions.duration = secondsToMilliseconds(valueOptions.duration)); + valueOptions.delay && (valueOptions.delay = secondsToMilliseconds(valueOptions.delay)); + animations.push(new NativeAnimation({ + ...valueOptions, + element: document.documentElement, + name: valueName, + pseudoElement: `::view-transition-${type}(${name})`, + keyframes: valueKeyframes, + })); + explicitlyAnimated.add(`${name}:${type}`); + if (valueName === "opacity") { + opacityAnimated.add(`${name}:${type}`); + } + } + } + }); + /** + * Handle browser generated animations + */ + for (const animation of generatedViewAnimations) { + if (animation.playState === "finished") + continue; + const { effect } = animation; + if (!effect || !(effect instanceof KeyframeEffect)) + continue; + const { pseudoElement } = effect; + if (!pseudoElement) + continue; + const name = getViewAnimationLayerInfo(pseudoElement); + if (!name) + continue; + const targetDefinition = layerTargets.get(name.layer); + /** + * We built our own animation for this layer, so drop the + * browser-generated fade we're replacing. The UA + * `plus-lighter` blend is a *separate* generated animation on + * the same pseudo (it sets `mix-blend-mode` in its keyframes): + * keep it *only* for a true opacity crossfade - both sides + * fading - so a symmetric crossfade composites without + * darkening, but a slide/transform (where both layers stay + * opaque and overlap) doesn't flash bright from the addition. + */ + if (explicitlyAnimated.has(`${name.layer}:${name.type}`)) { + const isCrossfade = opacityAnimated.has(`${name.layer}:new`) && + opacityAnimated.has(`${name.layer}:old`); + if (isCrossfade && + effect + .getKeyframes() + .some((keyframe) => keyframe.mixBlendMode)) { + animations.push(new NativeAnimationWrapper(animation)); + } + else { + animation.cancel(); + } + continue; + } + /** + * Drop the orphaned half of the default crossfade. The UA + * fades old out and new in as a *pair*; if the opposing half + * was explicitly overridden with something other than an + * opacity fade (a clip or transform reveal), this side's + * default opacity fade has no partner - left to run it would + * dissolve what should be a static backdrop (e.g. + * `.new({ clipPath })` should reveal over a still old view, + * not fade the old out around the growing clip). Cancel it - + * and its `plus-lighter` sibling on the same pseudo, which + * would otherwise flash bright where the two opaque layers + * overlap. A genuine crossfade (the opposing side also fading + * opacity) keeps both halves and is handled above. + */ + const opposite = name.type === "old" + ? "new" + : name.type === "new" + ? "old" + : undefined; + if (opposite && + explicitlyAnimated.has(`${name.layer}:${opposite}`) && + !opacityAnimated.has(`${name.layer}:${opposite}`)) { + animation.cancel(); + continue; + } + /** + * Otherwise retime the browser-generated animation to + * Motion's timing. This auto-enables the layout (group) + * morph for any resolved/named target, and applies the + * default timing to old/new layers we haven't explicitly + * overridden. + * + * group + group-children both follow the layout timing so + * the nesting container stays in sync with the morph. + */ + /** + * A survivor's old + new are the two halves of one + * `plus-lighter` crossfade. They must share identical timing + * (so their opacities stay mirrored and sum to 1 - else the + * additive blend flashes bright wherever both are partly + * visible) and fade linearly (the bounce belongs on the + * group's geometry, not the opacity). So time them as the + * group, rather than via their own - potentially staggered, + * or enter/exit-derived - old/new options. + */ + const stagger = layerStagger.get(name.layer); + const isMorphCrossfade = (name.type === "old" || name.type === "new") && + !!stagger?.old && + !!stagger?.new; + let timing; + if (name.type.startsWith("group")) { + // group + group-children follow the resolved group + // timing - the single source shared with the crop + // corner-radius pass below. + const { delay, duration, ease } = resolveGroupTiming(name.layer); + timing = { + delay, + duration, + easing: mapEasingToNativeEasing(ease, duration), + }; + } + else { + const timingType = isMorphCrossfade ? "group" : name.type; + const [index, total] = staggerPosition(name.layer, timingType); + const transitionName = timingType === "group" ? "layout" : ""; + let animationTransition = resolveLayerTransition(targetDefinition, timingType, transitionName, index === -1 ? 0 : index, total); + /** + * The crossfade should resolve at the spring's + * *perceptual* (visual) duration - the geometry can keep + * bouncing, but the opacity shouldn't drag through the + * settle. So capture `visualDuration` before + * `applyGeneratorOptions` replaces it with the full + * overshoot duration, and use it for the fade. + */ + const visualDuration = animationTransition.visualDuration; + animationTransition.duration && (animationTransition.duration = secondsToMilliseconds(animationTransition.duration)); + animationTransition = + applyGeneratorOptions(animationTransition); + timing = { + delay: secondsToMilliseconds(animationTransition.delay ?? 0), + duration: isMorphCrossfade && visualDuration !== undefined + ? secondsToMilliseconds(visualDuration) + : animationTransition.duration, + easing: isMorphCrossfade + ? "linear" + : mapEasingToNativeEasing(animationTransition.ease, animationTransition.duration), + }; + } + effect.updateTiming(timing); + animations.push(new NativeAnimationWrapper(animation)); + } + /** + * Round each cropped layer's clip. Its `::view-transition-group` + * has `overflow: clip`, which would otherwise square the corners + * mid-morph; animate each corner from the old element's radius to + * the new element's so the crop stays rounded. Timed as the group + * (`layout`) so the radius tracks the morphing box. + */ + cropMeasurements.forEach((entry, name) => { + if (!croppedNames.has(name)) + return; + // Reuse the group's resolved timing - native ms delay/ + // duration + a baked ease, with no generator `type` or + // repeat/times to leak into (or throw inside) NativeAnimation. + const { delay, duration, ease } = resolveGroupTiming(name); + for (const corner of cornerRadiusProps) { + // `||` (not `??`) so an empty measurement falls back to + // the other snapshot rather than an invalid keyframe. + const from = entry.old?.radii[corner] || + entry.new?.radii[corner] || + "0px"; + const to = entry.new?.radii[corner] || + entry.old?.radii[corner] || + "0px"; + // Nothing to round if the corner is square at both ends. + if (isSquareRadius(from) && isSquareRadius(to)) + continue; + animations.push(new NativeAnimation({ + element: document.documentElement, + name: corner, + pseudoElement: `::view-transition-group(${name})`, + keyframes: [from, to], + delay, + duration, + ease, + })); + } + }); + resolve(new GroupAnimation(animations)); + }) + .catch(() => + /** + * `ready` rejects when the transition is skipped - no visual + * change, or superseded by an interrupting transition. The DOM + * update still applied, so settle with no animations rather than + * surfacing it as an error to an awaiting caller. A genuine + * failure in `update()` rejects `updateCallbackDone` (already + * settled by now), so propagate that instead. + */ + transition.updateCallbackDone.then(() => resolve(new GroupAnimation([])), reject)); + }); +} +/** + * The options that should time a given generated layer type, so a retimed + * group/old/new picks up any per-target transition the user provided. Checks + * the type's buckets in priority order (e.g. `new` before `enter`). + */ +function layerOptions(target, type) { + for (const bucket of typeBuckets[type] ?? []) { + const options = target?.[bucket]?.options; + if (options) + return options; + } +} +/** + * Merge a base transition (e.g. the default `options`) with a per-layer/value + * override. An explicit `duration` on the override must win over an inherited + * generator's own timing: a spring prefers `visualDuration`, and + * `spring.applyToOptions` overwrites `duration` with the computed settle time - + * so without this the override is silently discarded. Dropping the inherited + * `type`/`visualDuration` makes the layer a plain tween of that duration, unless + * it asked for its own generator `type`/`visualDuration`. + */ +function mergeTransition(base, override) { + const merged = { ...base, ...override }; + if (override.duration !== undefined) { + if (override.visualDuration === undefined) + delete merged.visualDuration; + if (override.type === undefined) + delete merged.type; + } + return merged; +} + +export { startViewAnimation }; +//# sourceMappingURL=start.mjs.map diff --git a/node_modules/motion-dom/dist/es/view/start.mjs.map b/node_modules/motion-dom/dist/es/view/start.mjs.map new file mode 100644 index 0000000..9e58043 --- /dev/null +++ b/node_modules/motion-dom/dist/es/view/start.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"start.mjs","sources":["../../../src/view/start.ts"],"sourcesContent":["import { secondsToMilliseconds, warnOnce } from \"motion-utils\"\nimport { GroupAnimation } from \"../animation/GroupAnimation\"\nimport { NativeAnimation } from \"../animation/NativeAnimation\"\nimport { NativeAnimationWrapper } from \"../animation/NativeAnimationWrapper\"\nimport { AnimationPlaybackControls, DOMKeyframesDefinition } from \"../animation/types\"\nimport { getValueTransition } from \"../animation/utils/get-value-transition\"\nimport { mapEasingToNativeEasing } from \"../animation/waapi/easing/map-easing\"\nimport { applyGeneratorOptions } from \"../animation/waapi/utils/apply-generator\"\nimport { cornerRadiusProps } from \"../utils/border-radius\"\nimport { ElementOrSelector, resolveElements } from \"../utils/resolve-elements\"\nimport type { ViewTransitionBuilder } from \"./index\"\nimport { ViewTransitionTarget, ViewTransitionTargetDefinition } from \"./types\"\nimport {\n assignViewTransitionNames,\n releaseViewTransitionNames,\n} from \"./utils/assign-names\"\nimport { chooseLayerType } from \"./utils/choose-layer-type\"\nimport { css } from \"./utils/css\"\nimport { getViewAnimationLayerInfo } from \"./utils/get-layer-info\"\nimport { getViewAnimations } from \"./utils/get-view-animations\"\nimport { hasTarget } from \"./utils/has-target\"\n\nconst definitionNames = [\"layout\", \"enter\", \"exit\", \"new\", \"old\"] as const\n\ntype CornerRadii = Record<(typeof cornerRadiusProps)[number], string>\n\n/**\n * Whether a computed border-radius is square (every component zero). Splitting\n * on whitespace handles two-value/elliptical radii like \"0px 20px\" - a leading\n * `parseFloat` alone would misread the non-zero vertical radius as square.\n */\nconst isSquareRadius = (radius: string) =>\n radius.split(\" \").every((value) => parseFloat(value) === 0)\n\n/**\n * The `ViewTransitionTarget` buckets driving each generated layer type, in\n * priority order - the inverse of `chooseLayerType`. The new view is driven by\n * `new`/`enter`, the old by `old`/`exit`. `group-children`/`image-pair` have no\n * bucket; they follow the default layout timing.\n */\nconst typeBuckets: Record = {\n group: [\"layout\"],\n new: [\"new\", \"enter\"],\n old: [\"old\", \"exit\"],\n}\n\n/**\n * Default \"absent\" origin for a single-value keyframe, by pseudo type, so e.g.\n * `enter({ scale: 1 })` grows in from 0.85 and `exit({ opacity: 0 })` fades\n * from 1. `enter` prefers the matching `exit` value over these (see below).\n */\nconst ORIGIN_DEFAULTS: Record> = {\n new: { opacity: 0, scale: 0.85 },\n old: { opacity: 1, scale: 1 },\n}\n\n/**\n * How much two box aspect ratios must differ before a morph is treated as\n * aspect-changing (and so worth cropping). Matches the projection engine's\n * `preserve-aspect` threshold, so small layout jitter doesn't trigger a crop.\n */\nconst ASPECT_TOLERANCE = 0.2\n\nexport function startViewAnimation(\n builder: ViewTransitionBuilder\n): Promise {\n const {\n update,\n targets,\n resolveDefs,\n cropOverride,\n pairs,\n classNames,\n flatGroups,\n options: defaultOptions,\n } = builder\n\n if (!document.startViewTransition) {\n // An async IIFE (not `new Promise(async …)`) so a throwing/rejecting\n // update rejects this promise rather than leaving it unsettled.\n return (async () => {\n await update()\n return new GroupAnimation([])\n })()\n }\n\n /**\n * Resolve any selector/Element targets to layer names, assigning a\n * `view-transition-name` to each element as we go. We run this before the\n * update (so the elements are captured in the old snapshot) and again\n * after it (for the new snapshot). An element present in both keeps the\n * same name and animates as a single `group` layer.\n */\n const nameRegistry = new Map()\n const assigned: Element[] = []\n /**\n * Elements we tagged with a `view-transition-class` (via `.class()`),\n * tracked separately from `assigned` so cleanup removes the class without\n * ever stripping an author's own inline `view-transition-name`.\n */\n const classed: Element[] = []\n /**\n * Elements we set a `view-transition-group` on (for nesting), tracked for\n * cleanup. `clipChildren` collects the names of nested parents that clip in\n * the live layout, so their `::view-transition-group-children` is clipped\n * through the transition - not just once the live DOM takes back over.\n */\n const grouped: Element[] = []\n const clipChildren = new Set()\n const layerTargets = new Map()\n const croppedNames = new Set()\n /**\n * Each layer's explicit `.crop(true | false)` override (by resolved name),\n * so `finalizeCrop` can let an author's choice win over the morph default.\n */\n const cropForName = new Map()\n /**\n * Each layer's stagger position (index + total) within its subject, per\n * snapshot. Resolving against the snapshot the layer belongs to keeps\n * stagger correct when `update()` replaces the matched elements, and lets\n * us skip a layer that's absent from a snapshot (e.g. an exited element\n * has no `new` pseudo-element).\n */\n const layerStagger = new Map<\n string,\n { old?: [number, number]; new?: [number, number] }\n >()\n /**\n * Names allocated for a paired subject in the old snapshot, replayed onto\n * its new-snapshot target so both ends share a layer and morph.\n */\n const pairNames = new Map()\n /**\n * The old (`from`) elements of each paired subject, so their names can be\n * transferred off before the new (`to`) elements inherit them.\n */\n const pairFrom = new Map()\n\n const resolveLayers = (phase: \"old\" | \"new\") => {\n targets.forEach((target, definition) => {\n const className = classNames.get(definition)\n /**\n * Nest each resolved layer under its DOM-ancestor layer by default\n * (`contain`), so an ancestor's clip/transform/opacity reach it\n * through the transition; `.group(false)` opts a subject out (`none`)\n * to stay flat and escape. Skipped for root / pre-named layers, which\n * aren't elements we resolve and style.\n */\n const group =\n definition === \"root\" || !resolveDefs.has(definition)\n ? undefined\n : flatGroups.has(definition)\n ? \"none\"\n : \"contain\"\n let names: string[]\n if (definition === \"root\" || !resolveDefs.has(definition)) {\n names = [definition as string]\n } else if (pairs.has(definition)) {\n /**\n * Paired morph: name the old target in the old snapshot, then\n * force the same name(s) onto the new target in the new one, so\n * two different elements morph as a single layer.\n */\n if (phase === \"old\") {\n pairFrom.set(\n definition,\n resolveElements(definition as ElementOrSelector)\n )\n names = assignViewTransitionNames(\n definition as ElementOrSelector,\n nameRegistry,\n assigned,\n undefined,\n className,\n classed,\n group,\n grouped,\n clipChildren\n )\n pairNames.set(definition, names)\n } else {\n /**\n * Transfer the name(s) off the `from` elements before the\n * `to` elements inherit them. A `from` that survives into\n * the new snapshot (e.g. hidden with `visibility: hidden`\n * rather than removed) would otherwise keep the name and\n * collide - \"duplicate view-transition-name\".\n */\n for (const el of pairFrom.get(definition) ?? []) {\n ;(el as HTMLElement).style?.removeProperty(\n \"view-transition-name\"\n )\n /**\n * Drop the old end from the registry too, so the new\n * end alone supplies this name's `new` crop radii - we\n * neither re-measure nor get ordered by a stale element.\n */\n nameRegistry.delete(el)\n }\n names = assignViewTransitionNames(\n pairs.get(definition) as ElementOrSelector,\n nameRegistry,\n assigned,\n pairNames.get(definition),\n className,\n classed,\n group,\n grouped,\n clipChildren\n )\n }\n } else {\n names = assignViewTransitionNames(\n definition as ElementOrSelector,\n nameRegistry,\n assigned,\n undefined,\n className,\n classed,\n group,\n grouped,\n clipChildren\n )\n }\n\n // Record any explicit `.crop(true | false)` per resolved name; the\n // crop set itself is computed later by `finalizeCrop` (it needs both\n // snapshots to know which morphs change aspect ratio).\n const override = cropOverride.get(definition)\n\n names.forEach((name, index) => {\n /**\n * If two subjects resolve to the same element, merge their\n * definitions so neither subject's animations are dropped.\n */\n const existing = layerTargets.get(name)\n layerTargets.set(\n name,\n existing && existing !== target\n ? { ...existing, ...target }\n : target\n )\n\n if (override !== undefined) cropForName.set(name, override)\n\n const stagger = layerStagger.get(name) ?? {}\n stagger[phase] = [index, names.length]\n layerStagger.set(name, stagger)\n })\n })\n }\n\n /**\n * The stagger index/total for a layer, resolved against the snapshot it\n * belongs to. Returns index -1 when the layer is absent from that snapshot\n * so the caller can skip a pseudo-element that doesn't exist.\n */\n const staggerPosition = (name: string, type: string) => {\n const stagger = layerStagger.get(name)\n const position =\n type === \"old\"\n ? stagger?.old\n : type === \"new\"\n ? stagger?.new\n : // group / group-children / image-pair persist across both.\n stagger?.new ?? stagger?.old\n return position ?? ([-1, 1] as const)\n }\n\n /**\n * Merge default + per-layer transition options for a generated layer and\n * resolve any stagger/delay function against this element's position. Used\n * by both the morph-retiming and crop corner-radius passes.\n */\n const resolveLayerTransition = (\n target: ViewTransitionTarget | undefined,\n type: string,\n transitionName: string,\n index: number,\n total: number\n ) => {\n const transition = mergeTransition(\n getValueTransition(defaultOptions, transitionName),\n getValueTransition(\n (layerOptions(target, type) ?? {}) as any,\n transitionName\n )\n )\n\n if (typeof transition.delay === \"function\") {\n transition.delay = transition.delay(index, total)\n }\n\n return transition\n }\n\n /**\n * Resolve a layer's group (`layout`) timing to plain WAAPI values: native\n * ms `delay`/`duration` and a baked `ease`. The single source of group\n * timing, shared by the generated-group retiming and the crop corner-radius\n * pass so the rounded clip animates on exactly the box's timing. It returns\n * no generator `type` (the WAAPI-only `NativeAnimation` rejects a string\n * type) nor `repeat`/`times` (which the group's `updateTiming` ignores), so\n * none of them can leak into the radius animation and desync it.\n */\n const resolveGroupTiming = (name: string) => {\n const [index, total] = staggerPosition(name, \"group\")\n const transition = resolveLayerTransition(\n layerTargets.get(name),\n \"group\",\n \"layout\",\n index === -1 ? 0 : index,\n total\n )\n transition.duration &&= secondsToMilliseconds(transition.duration)\n const { delay = 0, duration, ease } = applyGeneratorOptions(transition)\n return { delay: secondsToMilliseconds(delay), duration, ease }\n }\n\n /**\n * Each layer's measured box + corner radii per snapshot. The box lets\n * `finalizeCrop` tell whether a morph's aspect ratio changed (the only case\n * worth cropping); the radii let a cropped morph's group clip animate each\n * corner from the old element's radius to the new element's, keeping it\n * rounded where `overflow: clip` would otherwise square the corners.\n *\n * We never flatten the source for capture (a snapshot is a paint of the live\n * DOM, so squaring an element just for its capture would flash one real\n * square frame). For an aspect-changing morph `object-fit: cover` crops each\n * snapshot's own baked corners off-screen mid-morph, so the animated clip is\n * the only visible corner; a near-same-aspect forced crop (`.crop(true)`)\n * can't hide the outgoing snapshot's silhouette, but the endpoints coincide.\n */\n const cropMeasurements = new Map<\n string,\n {\n old?: { width: number; height: number; radii: CornerRadii }\n new?: { width: number; height: number; radii: CornerRadii }\n }\n >()\n\n const measureLayers = (phase: \"old\" | \"new\") =>\n nameRegistry.forEach((name, element) => {\n const el = element as HTMLElement\n const rect = el.getBoundingClientRect?.()\n if (rect && rect.height) {\n const style = getComputedStyle(el)\n const radii = {} as CornerRadii\n for (const corner of cornerRadiusProps) {\n radii[corner] = style[corner]\n }\n const entry = cropMeasurements.get(name) ?? {}\n entry[phase] = { width: rect.width, height: rect.height, radii }\n cropMeasurements.set(name, entry)\n }\n })\n\n /**\n * With both snapshots measured, settle which layers crop. The default crops\n * only a morph whose aspect ratio *changes* between snapshots - the one case\n * where `object-fit: cover` does real work. A same-aspect morph or a\n * fade-only layer is left uncropped: its corners scale naturally (no flash\n * from squaring, no `overflow: clip` eating its shadow) and a backdrop can't\n * be clipped to nothing. An explicit `.crop(true | false)` overrides either\n * way. Runs after both snapshots are measured, since aspect needs both.\n */\n const finalizeCrop = () => {\n croppedNames.clear()\n for (const name of layerStagger.keys()) {\n if (name === \"root\") continue\n // An explicit `.crop(true | false)` wins; otherwise crop a morph\n // whose aspect ratio changed.\n if (cropForName.get(name) ?? aspectChanged(name)) {\n croppedNames.add(name)\n }\n }\n }\n\n /**\n * Whether a layer is a morph whose box aspect ratio changed between\n * snapshots (beyond a small tolerance). Fade-only layers (one snapshot) are\n * never \"changed\".\n */\n const aspectChanged = (name: string) => {\n const box = cropMeasurements.get(name)\n if (!box?.old || !box?.new || !box.old.height || !box.new.height) {\n return false\n }\n return (\n Math.abs(\n box.old.width / box.old.height -\n box.new.width / box.new.height\n ) > ASPECT_TOLERANCE\n )\n }\n\n /**\n * Write the persistent view-transition CSS: suppress root capture when the\n * root has no animations of its own; force linear timing (baked into the\n * keyframes, so we can retime later via updateTiming); and clip +\n * object-fit: cover every cropped morph (the UA default overflows on\n * aspect-ratio change).\n *\n * `css.commit` replaces rather than appends, so we re-set the full rule set\n * each call - the crop rules are only known after `finalizeCrop` runs in the\n * update callback, so the second call writes them.\n */\n const commitViewCSS = () => {\n if (!hasTarget(\"root\", targets)) {\n css.set(\":root\", { \"view-transition-name\": \"none\" })\n }\n\n css.set(\n \"::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)\",\n { \"animation-timing-function\": \"linear !important\" }\n )\n\n croppedNames.forEach((name) => {\n css.set(`::view-transition-group(${name})`, { overflow: \"clip\" })\n css.set(\n `::view-transition-old(${name}), ::view-transition-new(${name})`,\n { width: \"100%\", height: \"100%\", \"object-fit\": \"cover\" }\n )\n })\n\n /**\n * Clip the nested children of any layer that clips in the live layout,\n * so a wrapper crops its child for the whole morph (mirroring the DOM)\n * rather than only at the live-DOM handoff. No-op on browsers without\n * nested view-transition groups.\n */\n clipChildren.forEach((name) => {\n css.set(`::view-transition-group-children(${name})`, {\n overflow: \"clip\",\n })\n })\n\n css.commit() // Write\n }\n\n const cleanup = () => {\n releaseViewTransitionNames(assigned, classed, grouped)\n css.remove() // Write\n }\n\n const callback = async () => {\n await update()\n\n /**\n * Re-resolve so elements created by the update are named for the new\n * snapshot, then measure them. With both snapshots measured we can\n * settle the crop set (aspect-changing morphs + forced).\n */\n resolveLayers(\"new\")\n measureLayers(\"new\")\n finalizeCrop()\n\n /**\n * Re-commit the crop CSS unconditionally: `finalizeCrop` is computed\n * here (after both snapshots are measured), so the clip rules must be\n * (re)written to match the settled set.\n */\n commitViewCSS()\n }\n\n let transition: ViewTransition\n try {\n resolveLayers(\"old\")\n /**\n * Measure the old snapshot against the optimistic crop set (the new\n * snapshot doesn't exist yet, so aspect change can't be known here;\n * `finalizeCrop` settles it post-update).\n */\n measureLayers(\"old\")\n commitViewCSS()\n transition = document.startViewTransition(callback)\n } catch (error) {\n /**\n * The prelude writes inline names before the transition exists. If it\n * throws (e.g. startViewTransition rejects in a bad UA state), release\n * them so we neither leak DOM state nor stall the queue on a promise\n * that never settles - hand back a rejection it can advance past.\n */\n cleanup()\n return Promise.reject(error)\n }\n\n transition.finished.finally(cleanup)\n\n return new Promise((resolve, reject) => {\n transition.ready\n .then(() => {\n const generatedViewAnimations = getViewAnimations()\n\n const animations: AnimationPlaybackControls[] = []\n\n /**\n * Create animations for each of our explicitly-defined subjects.\n * `opacityAnimated` additionally tracks which `${name}:${type}`\n * we faded, so we can keep the UA `plus-lighter` blend only for a\n * genuine opacity crossfade (both sides fading) and drop it for a\n * slide/transform, where additive compositing would flash bright.\n */\n const explicitlyAnimated = new Set()\n const opacityAnimated = new Set()\n layerTargets.forEach((target, name) => {\n const stagger = layerStagger.get(name)\n /**\n * Presence: `enter` only fires for a pure newcomer (a new\n * view with no old), `exit` only for a pure leaver. A\n * survivor (both) gets neither - it just morphs.\n */\n const enterApplies = !!stagger?.new && !stagger?.old\n const exitApplies = !!stagger?.old && !stagger?.new\n\n for (const key of definitionNames) {\n if (!target[key]) continue\n if (key === \"enter\" && !enterApplies) continue\n if (key === \"exit\" && !exitApplies) continue\n\n const type = chooseLayerType(\n key as keyof ViewTransitionTarget\n )\n const [index, total] = staggerPosition(name, type)\n // Skip a layer absent from its snapshot.\n if (index === -1) continue\n\n const { keyframes, options } =\n target[key as keyof ViewTransitionTarget]!\n\n for (let [valueName, valueKeyframes] of Object.entries(\n keyframes\n )) {\n // Skip only missing values - `0` (e.g. opacity: 0)\n // is valid and must reach the from-value inference.\n if (valueKeyframes == null) continue\n\n /**\n * The view path hands keyframes straight to WAAPI,\n * so Motion's `x`/`y` shorthands (compiled to\n * `transform` only via the value pipeline) have no\n * effect. Warn and skip - use `transform`/`translate`.\n */\n if (valueName === \"x\" || valueName === \"y\") {\n warnOnce(\n false,\n `animateView() animates view-transition layers with CSS properties; the \"${valueName}\" shorthand has no effect - use transform, e.g. { transform: \"translateX(40px)\" }.`\n )\n continue\n }\n\n /**\n * enter/exit win over new/old on a shared property -\n * skip it here when the gated bucket also defines it.\n */\n if (\n key === \"new\" &&\n enterApplies &&\n target.enter?.keyframes[\n valueName as keyof DOMKeyframesDefinition\n ] != null\n ) {\n continue\n }\n if (\n key === \"old\" &&\n exitApplies &&\n target.exit?.keyframes[\n valueName as keyof DOMKeyframesDefinition\n ] != null\n ) {\n continue\n }\n\n const valueOptions = mergeTransition(\n getValueTransition(\n defaultOptions as any,\n valueName\n ),\n getValueTransition(options as any, valueName)\n )\n\n /**\n * Infer an origin for a single-value keyframe. An\n * `enter` mirrors the matching `exit` value (a\n * defined exit reverses into the enter for free);\n * otherwise the per-type default (opacity 0/1, scale\n * 0.85). No default -> left as-is (animates from the\n * live value).\n *\n * `new`/`old` fire for survivors too, where only the\n * opacity crossfade default applies - a transform\n * default like scale 0.85 would pop a persisting\n * element, so gate it on the layer actually\n * entering/leaving.\n */\n if (!Array.isArray(valueKeyframes)) {\n const exitValue =\n key === \"enter\"\n ? target.exit?.keyframes[\n valueName as keyof DOMKeyframesDefinition\n ]\n : undefined\n const allowDefault =\n valueName === \"opacity\" ||\n (type === \"new\" ? enterApplies : exitApplies)\n const from =\n exitValue != null\n ? Array.isArray(exitValue)\n ? exitValue[exitValue.length - 1]\n : exitValue\n : allowDefault\n ? ORIGIN_DEFAULTS[type]?.[valueName]\n : undefined\n if (from !== undefined) {\n valueKeyframes = [from, valueKeyframes]\n }\n }\n\n /**\n * Resolve stagger function if provided, per element\n * across this subject's resolved layers.\n */\n if (typeof valueOptions.delay === \"function\") {\n valueOptions.delay = valueOptions.delay(\n index,\n total\n )\n }\n\n valueOptions.duration &&= secondsToMilliseconds(\n valueOptions.duration\n )\n\n valueOptions.delay &&= secondsToMilliseconds(\n valueOptions.delay\n )\n\n animations.push(\n new NativeAnimation({\n ...valueOptions,\n element: document.documentElement,\n name: valueName,\n pseudoElement: `::view-transition-${type}(${name})`,\n keyframes: valueKeyframes,\n })\n )\n explicitlyAnimated.add(`${name}:${type}`)\n if (valueName === \"opacity\") {\n opacityAnimated.add(`${name}:${type}`)\n }\n }\n }\n })\n\n /**\n * Handle browser generated animations\n */\n for (const animation of generatedViewAnimations) {\n if (animation.playState === \"finished\") continue\n\n const { effect } = animation\n if (!effect || !(effect instanceof KeyframeEffect)) continue\n\n const { pseudoElement } = effect\n if (!pseudoElement) continue\n\n const name = getViewAnimationLayerInfo(pseudoElement)\n if (!name) continue\n\n const targetDefinition = layerTargets.get(name.layer)\n\n /**\n * We built our own animation for this layer, so drop the\n * browser-generated fade we're replacing. The UA\n * `plus-lighter` blend is a *separate* generated animation on\n * the same pseudo (it sets `mix-blend-mode` in its keyframes):\n * keep it *only* for a true opacity crossfade - both sides\n * fading - so a symmetric crossfade composites without\n * darkening, but a slide/transform (where both layers stay\n * opaque and overlap) doesn't flash bright from the addition.\n */\n if (explicitlyAnimated.has(`${name.layer}:${name.type}`)) {\n const isCrossfade =\n opacityAnimated.has(`${name.layer}:new`) &&\n opacityAnimated.has(`${name.layer}:old`)\n if (\n isCrossfade &&\n effect\n .getKeyframes()\n .some((keyframe) => keyframe.mixBlendMode)\n ) {\n animations.push(new NativeAnimationWrapper(animation))\n } else {\n animation.cancel()\n }\n continue\n }\n\n /**\n * Drop the orphaned half of the default crossfade. The UA\n * fades old out and new in as a *pair*; if the opposing half\n * was explicitly overridden with something other than an\n * opacity fade (a clip or transform reveal), this side's\n * default opacity fade has no partner - left to run it would\n * dissolve what should be a static backdrop (e.g.\n * `.new({ clipPath })` should reveal over a still old view,\n * not fade the old out around the growing clip). Cancel it -\n * and its `plus-lighter` sibling on the same pseudo, which\n * would otherwise flash bright where the two opaque layers\n * overlap. A genuine crossfade (the opposing side also fading\n * opacity) keeps both halves and is handled above.\n */\n const opposite =\n name.type === \"old\"\n ? \"new\"\n : name.type === \"new\"\n ? \"old\"\n : undefined\n if (\n opposite &&\n explicitlyAnimated.has(\n `${name.layer}:${opposite}`\n ) &&\n !opacityAnimated.has(`${name.layer}:${opposite}`)\n ) {\n animation.cancel()\n continue\n }\n\n /**\n * Otherwise retime the browser-generated animation to\n * Motion's timing. This auto-enables the layout (group)\n * morph for any resolved/named target, and applies the\n * default timing to old/new layers we haven't explicitly\n * overridden.\n *\n * group + group-children both follow the layout timing so\n * the nesting container stays in sync with the morph.\n */\n /**\n * A survivor's old + new are the two halves of one\n * `plus-lighter` crossfade. They must share identical timing\n * (so their opacities stay mirrored and sum to 1 - else the\n * additive blend flashes bright wherever both are partly\n * visible) and fade linearly (the bounce belongs on the\n * group's geometry, not the opacity). So time them as the\n * group, rather than via their own - potentially staggered,\n * or enter/exit-derived - old/new options.\n */\n const stagger = layerStagger.get(name.layer)\n const isMorphCrossfade =\n (name.type === \"old\" || name.type === \"new\") &&\n !!stagger?.old &&\n !!stagger?.new\n\n let timing: {\n delay: number\n duration?: number\n easing: string\n }\n if (name.type.startsWith(\"group\")) {\n // group + group-children follow the resolved group\n // timing - the single source shared with the crop\n // corner-radius pass below.\n const { delay, duration, ease } = resolveGroupTiming(\n name.layer\n )\n timing = {\n delay,\n duration,\n easing: mapEasingToNativeEasing(\n ease,\n duration!\n ) as string,\n }\n } else {\n const timingType = isMorphCrossfade ? \"group\" : name.type\n const [index, total] = staggerPosition(\n name.layer,\n timingType\n )\n const transitionName =\n timingType === \"group\" ? \"layout\" : \"\"\n let animationTransition = resolveLayerTransition(\n targetDefinition,\n timingType,\n transitionName,\n index === -1 ? 0 : index,\n total\n )\n\n /**\n * The crossfade should resolve at the spring's\n * *perceptual* (visual) duration - the geometry can keep\n * bouncing, but the opacity shouldn't drag through the\n * settle. So capture `visualDuration` before\n * `applyGeneratorOptions` replaces it with the full\n * overshoot duration, and use it for the fade.\n */\n const visualDuration = animationTransition.visualDuration\n\n animationTransition.duration &&= secondsToMilliseconds(\n animationTransition.duration\n )\n\n animationTransition =\n applyGeneratorOptions(animationTransition)\n\n timing = {\n delay: secondsToMilliseconds(\n animationTransition.delay ?? 0\n ),\n duration:\n isMorphCrossfade && visualDuration !== undefined\n ? secondsToMilliseconds(visualDuration)\n : animationTransition.duration,\n easing: isMorphCrossfade\n ? \"linear\"\n : (mapEasingToNativeEasing(\n animationTransition.ease,\n animationTransition.duration!\n ) as string),\n }\n }\n\n effect.updateTiming(timing)\n\n animations.push(new NativeAnimationWrapper(animation))\n }\n\n /**\n * Round each cropped layer's clip. Its `::view-transition-group`\n * has `overflow: clip`, which would otherwise square the corners\n * mid-morph; animate each corner from the old element's radius to\n * the new element's so the crop stays rounded. Timed as the group\n * (`layout`) so the radius tracks the morphing box.\n */\n cropMeasurements.forEach((entry, name) => {\n if (!croppedNames.has(name)) return\n\n // Reuse the group's resolved timing - native ms delay/\n // duration + a baked ease, with no generator `type` or\n // repeat/times to leak into (or throw inside) NativeAnimation.\n const { delay, duration, ease } = resolveGroupTiming(name)\n\n for (const corner of cornerRadiusProps) {\n // `||` (not `??`) so an empty measurement falls back to\n // the other snapshot rather than an invalid keyframe.\n const from =\n entry.old?.radii[corner] ||\n entry.new?.radii[corner] ||\n \"0px\"\n const to =\n entry.new?.radii[corner] ||\n entry.old?.radii[corner] ||\n \"0px\"\n // Nothing to round if the corner is square at both ends.\n if (isSquareRadius(from) && isSquareRadius(to)) continue\n\n animations.push(\n new NativeAnimation({\n element: document.documentElement,\n name: corner,\n pseudoElement: `::view-transition-group(${name})`,\n keyframes: [from, to],\n delay,\n duration,\n ease,\n })\n )\n }\n })\n\n resolve(new GroupAnimation(animations))\n })\n .catch(() =>\n /**\n * `ready` rejects when the transition is skipped - no visual\n * change, or superseded by an interrupting transition. The DOM\n * update still applied, so settle with no animations rather than\n * surfacing it as an error to an awaiting caller. A genuine\n * failure in `update()` rejects `updateCallbackDone` (already\n * settled by now), so propagate that instead.\n */\n transition.updateCallbackDone.then(\n () => resolve(new GroupAnimation([])),\n reject\n )\n )\n })\n}\n\n/**\n * The options that should time a given generated layer type, so a retimed\n * group/old/new picks up any per-target transition the user provided. Checks\n * the type's buckets in priority order (e.g. `new` before `enter`).\n */\nfunction layerOptions(target: ViewTransitionTarget | undefined, type: string) {\n for (const bucket of typeBuckets[type] ?? []) {\n const options = target?.[bucket]?.options\n if (options) return options\n }\n}\n\n/**\n * Merge a base transition (e.g. the default `options`) with a per-layer/value\n * override. An explicit `duration` on the override must win over an inherited\n * generator's own timing: a spring prefers `visualDuration`, and\n * `spring.applyToOptions` overwrites `duration` with the computed settle time -\n * so without this the override is silently discarded. Dropping the inherited\n * `type`/`visualDuration` makes the layer a plain tween of that duration, unless\n * it asked for its own generator `type`/`visualDuration`.\n */\nfunction mergeTransition(base: any, override: any) {\n const merged = { ...base, ...override }\n\n if (override.duration !== undefined) {\n if (override.visualDuration === undefined) delete merged.visualDuration\n if (override.type === undefined) delete merged.type\n }\n\n return merged\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAsBA,MAAM,eAAe,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAU;AAI1E;;;;AAIG;AACH,MAAM,cAAc,GAAG,CAAC,MAAc,KAClC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,KAAK,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AAE/D;;;;;AAKG;AACH,MAAM,WAAW,GAAmD;IAChE,KAAK,EAAE,CAAC,QAAQ,CAAC;AACjB,IAAA,GAAG,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC;AACrB,IAAA,GAAG,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC;CACvB;AAED;;;;AAIG;AACH,MAAM,eAAe,GAA2C;IAC5D,GAAG,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE;IAChC,GAAG,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,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BAAkB,CAAC,IAAI,CAC9B,MAAM,OAAO,CAAC,IAAI,cAAc,CAAC,EAAE,CAAC,CAAC,EACrC,MAAM,CACT,CACJ;AACT,IAAA,CAAC,CAAC;AACN;AAEA;;;;AAIG;AACH,SAAS,YAAY,CAAC,MAAwC,EAAE,IAAY,EAAA;IACxE,KAAK,MAAM,MAAM,IAAI,WAAW,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE;QAC1C,MAAM,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC,EAAE,OAAO;AACzC,QAAA,IAAI,OAAO;AAAE,YAAA,OAAO,OAAO;IAC/B;AACJ;AAEA;;;;;;;;AAQG;AACH,SAAS,eAAe,CAAC,IAAS,EAAE,QAAa,EAAA;IAC7C,MAAM,MAAM,GAAG,EAAE,GAAG,IAAI,EAAE,GAAG,QAAQ,EAAE;AAEvC,IAAA,IAAI,QAAQ,CAAC,QAAQ,KAAK,SAAS,EAAE;AACjC,QAAA,IAAI,QAAQ,CAAC,cAAc,KAAK,SAAS;YAAE,OAAO,MAAM,CAAC,cAAc;AACvE,QAAA,IAAI,QAAQ,CAAC,IAAI,KAAK,SAAS;YAAE,OAAO,MAAM,CAAC,IAAI;IACvD;AAEA,IAAA,OAAO,MAAM;AACjB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/view/utils/assign-names.mjs b/node_modules/motion-dom/dist/es/view/utils/assign-names.mjs new file mode 100644 index 0000000..c8a17a3 --- /dev/null +++ b/node_modules/motion-dom/dist/es/view/utils/assign-names.mjs @@ -0,0 +1,146 @@ +import { resolveElements } from '../../utils/resolve-elements.mjs'; + +let nameCount = 0; +/** + * Generated names live in their own namespace so we can tell a name we own + * (and must clean up) from an author-defined one - and so a stale generated + * name left behind by an interrupted transition is re-owned, not mistaken for + * the author's and leaked. + */ +const generatedName = () => `motion-view-${nameCount++}`; +const isGeneratedName = (name) => name.startsWith("motion-view-"); +/** + * Tag a captured element with a `view-transition-class` so authors can target + * its generated layer from CSS (e.g. `::view-transition-group(.hero)`) without + * the opaque generated name. Tracked in `classed` - separate from the generated + * names in `assigned` - so cleanup removes the class without ever stripping an + * author's own inline `view-transition-name`. + */ +function tagClass(element, className, classed) { + if (!className) + return; + element.style?.setProperty("view-transition-class", className); + classed.push(element); +} +/** + * Set the element's `view-transition-group` so its layer reconstructs the DOM + * hierarchy in the pseudo-tree (`contain`) - or stays flat (`none`). Tracked in + * `grouped` for cleanup. When the element clips (any non-`visible` overflow) its + * name is recorded in `clipChildren` so the caller can clip the nested children + * (`::view-transition-group-children(name)`), mirroring the live clip through + * the whole transition rather than only at the live-DOM handoff. + * + * Ignored by browsers without nested view-transition groups, where it harmlessly + * degrades to the flat default. + */ +function applyGroup(element, name, group, grouped, clipChildren) { + if (!group) + return; + element.style?.setProperty("view-transition-group", group); + grouped.push(element); + if (group !== "none" && clipChildren) { + const style = getComputedStyle(element); + if (style.overflowX !== "visible" || style.overflowY !== "visible") { + clipChildren.add(name); + } + } +} +/** + * Resolve a selector/Element to elements and ensure each one carries a + * `view-transition-name` we can target from script. + * + * Author-defined names are reused as-is. Elements that are unnamed (or use + * the browser's `auto`/`match-element`, whose generated name is not exposed + * to script) are given a unique generated name, set inline so it's captured, + * and tracked in `assigned` for later cleanup. + * + * `registry` maps each Element to its name so the same element keeps its name + * across both captures (before and after the update), which is what allows a + * persistent element to animate as a single `group` layer. + */ +function assignViewTransitionNames(definition, registry, assigned, forcedNames, className, classed = [], group, grouped = [], clipChildren) { + const elements = resolveElements(definition); + /** + * The new end of a paired morph: give each element the matching name from + * the old end (by index) so the two share one layer and morph. If the new + * end resolves to *more* elements than the old end named, the extras have no + * counterpart - give them a fresh name so they animate as newcomers rather + * than being silently left unnamed. We return the names actually assigned + * (sized to the resolved elements), not the raw `forcedNames`, so stagger + * totals and the layer set stay in step with what's on the page. + */ + if (forcedNames) { + return elements.map((element, i) => { + const existing = registry.get(element); + if (existing) + return existing; + const name = forcedNames[i] ?? generatedName(); + element.style?.setProperty("view-transition-name", name); + assigned.push(element); + registry.set(element, name); + tagClass(element, className, classed); + applyGroup(element, name, group, grouped, clipChildren); + return name; + }); + } + /** + * Read every current name up front, before assigning any. Interleaving the + * reads with the inline `setProperty` writes below would dirty styles + * between reads and force a style recalc per element; batching the reads + * keeps it to one. Elements already in the registry keep their name and + * need no read. + */ + const currentNames = elements.map((element) => registry.has(element) + ? undefined + : getComputedStyle(element).getPropertyValue("view-transition-name")); + return elements.map((element, i) => { + const existing = registry.get(element); + if (existing) + return existing; + const current = currentNames[i]; + let name; + if (current && + current !== "none" && + current !== "auto" && + current !== "match-element" && + !isGeneratedName(current)) { + /** + * The author already named this layer - target it as-is and leave + * it to them to clean up. `auto`/`match-element` are overridden + * because their generated name is not exposed to script, and a + * stale `motion-view-*` (e.g. left by an interrupted transition) is + * re-owned rather than adopted as an author name and leaked. + */ + name = current; + } + else { + name = generatedName(); + element.style?.setProperty("view-transition-name", name); + assigned.push(element); + } + registry.set(element, name); + tagClass(element, className, classed); + applyGroup(element, name, group, grouped, clipChildren); + return name; + }); +} +/** + * Remove the `view-transition-name`s we generated and the + * `view-transition-class`es we applied. Author-defined names are never touched + * (they're not in `assigned`). Safe to call more than once (e.g. on both a + * finished and an interrupted transition). + */ +function releaseViewTransitionNames(assigned, classed = [], grouped = []) { + for (const element of assigned) { + element.style?.removeProperty("view-transition-name"); + } + for (const element of classed) { + element.style?.removeProperty("view-transition-class"); + } + for (const element of grouped) { + element.style?.removeProperty("view-transition-group"); + } +} + +export { assignViewTransitionNames, releaseViewTransitionNames }; +//# sourceMappingURL=assign-names.mjs.map diff --git a/node_modules/motion-dom/dist/es/view/utils/assign-names.mjs.map b/node_modules/motion-dom/dist/es/view/utils/assign-names.mjs.map new file mode 100644 index 0000000..4e77299 --- /dev/null +++ b/node_modules/motion-dom/dist/es/view/utils/assign-names.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"assign-names.mjs","sources":["../../../../src/view/utils/assign-names.ts"],"sourcesContent":["import { ElementOrSelector, resolveElements } from \"../../utils/resolve-elements\"\n\nlet nameCount = 0\n\n/**\n * Generated names live in their own namespace so we can tell a name we own\n * (and must clean up) from an author-defined one - and so a stale generated\n * name left behind by an interrupted transition is re-owned, not mistaken for\n * the author's and leaked.\n */\nconst generatedName = () => `motion-view-${nameCount++}`\n\nconst isGeneratedName = (name: string) => name.startsWith(\"motion-view-\")\n\n/**\n * Tag a captured element with a `view-transition-class` so authors can target\n * its generated layer from CSS (e.g. `::view-transition-group(.hero)`) without\n * the opaque generated name. Tracked in `classed` - separate from the generated\n * names in `assigned` - so cleanup removes the class without ever stripping an\n * author's own inline `view-transition-name`.\n */\nfunction tagClass(\n element: Element,\n className: string | undefined,\n classed: Element[]\n) {\n if (!className) return\n ;(element as HTMLElement).style?.setProperty(\n \"view-transition-class\",\n className\n )\n classed.push(element)\n}\n\n/**\n * Set the element's `view-transition-group` so its layer reconstructs the DOM\n * hierarchy in the pseudo-tree (`contain`) - or stays flat (`none`). Tracked in\n * `grouped` for cleanup. When the element clips (any non-`visible` overflow) its\n * name is recorded in `clipChildren` so the caller can clip the nested children\n * (`::view-transition-group-children(name)`), mirroring the live clip through\n * the whole transition rather than only at the live-DOM handoff.\n *\n * Ignored by browsers without nested view-transition groups, where it harmlessly\n * degrades to the flat default.\n */\nfunction applyGroup(\n element: Element,\n name: string,\n group: string | undefined,\n grouped: Element[],\n clipChildren?: Set\n) {\n if (!group) return\n ;(element as HTMLElement).style?.setProperty(\"view-transition-group\", group)\n grouped.push(element)\n\n if (group !== \"none\" && clipChildren) {\n const style = getComputedStyle(element)\n if (style.overflowX !== \"visible\" || style.overflowY !== \"visible\") {\n clipChildren.add(name)\n }\n }\n}\n\n/**\n * Resolve a selector/Element to elements and ensure each one carries a\n * `view-transition-name` we can target from script.\n *\n * Author-defined names are reused as-is. Elements that are unnamed (or use\n * the browser's `auto`/`match-element`, whose generated name is not exposed\n * to script) are given a unique generated name, set inline so it's captured,\n * and tracked in `assigned` for later cleanup.\n *\n * `registry` maps each Element to its name so the same element keeps its name\n * across both captures (before and after the update), which is what allows a\n * persistent element to animate as a single `group` layer.\n */\nexport function assignViewTransitionNames(\n definition: ElementOrSelector,\n registry: Map,\n assigned: Element[],\n forcedNames?: string[],\n className?: string,\n classed: Element[] = [],\n group?: string,\n grouped: Element[] = [],\n clipChildren?: Set\n): string[] {\n const elements = resolveElements(definition)\n\n /**\n * The new end of a paired morph: give each element the matching name from\n * the old end (by index) so the two share one layer and morph. If the new\n * end resolves to *more* elements than the old end named, the extras have no\n * counterpart - give them a fresh name so they animate as newcomers rather\n * than being silently left unnamed. We return the names actually assigned\n * (sized to the resolved elements), not the raw `forcedNames`, so stagger\n * totals and the layer set stay in step with what's on the page.\n */\n if (forcedNames) {\n return elements.map((element, i) => {\n const existing = registry.get(element)\n if (existing) return existing\n\n const name = forcedNames[i] ?? generatedName()\n ;(element as HTMLElement).style?.setProperty(\n \"view-transition-name\",\n name\n )\n assigned.push(element)\n registry.set(element, name)\n tagClass(element, className, classed)\n applyGroup(element, name, group, grouped, clipChildren)\n\n return name\n })\n }\n\n /**\n * Read every current name up front, before assigning any. Interleaving the\n * reads with the inline `setProperty` writes below would dirty styles\n * between reads and force a style recalc per element; batching the reads\n * keeps it to one. Elements already in the registry keep their name and\n * need no read.\n */\n const currentNames = elements.map((element) =>\n registry.has(element)\n ? undefined\n : getComputedStyle(element).getPropertyValue(\"view-transition-name\")\n )\n\n return elements.map((element, i) => {\n const existing = registry.get(element)\n if (existing) return existing\n\n const current = currentNames[i]\n\n let name: string\n if (\n current &&\n current !== \"none\" &&\n current !== \"auto\" &&\n current !== \"match-element\" &&\n !isGeneratedName(current)\n ) {\n /**\n * The author already named this layer - target it as-is and leave\n * it to them to clean up. `auto`/`match-element` are overridden\n * because their generated name is not exposed to script, and a\n * stale `motion-view-*` (e.g. left by an interrupted transition) is\n * re-owned rather than adopted as an author name and leaked.\n */\n name = current\n } else {\n name = generatedName()\n ;(element as HTMLElement).style?.setProperty(\n \"view-transition-name\",\n name\n )\n assigned.push(element)\n }\n\n registry.set(element, name)\n tagClass(element, className, classed)\n applyGroup(element, name, group, grouped, clipChildren)\n\n return name\n })\n}\n\n/**\n * Remove the `view-transition-name`s we generated and the\n * `view-transition-class`es we applied. Author-defined names are never touched\n * (they're not in `assigned`). Safe to call more than once (e.g. on both a\n * finished and an interrupted transition).\n */\nexport function releaseViewTransitionNames(\n assigned: Element[],\n classed: Element[] = [],\n grouped: Element[] = []\n): void {\n for (const element of assigned) {\n ;(element as HTMLElement).style?.removeProperty(\"view-transition-name\")\n }\n for (const element of classed) {\n ;(element as HTMLElement).style?.removeProperty(\"view-transition-class\")\n }\n for (const element of grouped) {\n ;(element as HTMLElement).style?.removeProperty(\"view-transition-group\")\n }\n}\n"],"names":[],"mappings":";;AAEA,IAAI,SAAS,GAAG,CAAC;AAEjB;;;;;AAKG;AACH,MAAM,aAAa,GAAG,MAAM,CAAA,YAAA,EAAe,SAAS,EAAE,CAAA,CAAE;AAExD,MAAM,eAAe,GAAG,CAAC,IAAY,KAAK,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC;AAEzE;;;;;;AAMG;AACH,SAAS,QAAQ,CACb,OAAgB,EAChB,SAA6B,EAC7B,OAAkB,EAAA;AAElB,IAAA,IAAI,CAAC,SAAS;QAAE;IACd,OAAuB,CAAC,KAAK,EAAE,WAAW,CACxC,uBAAuB,EACvB,SAAS,CACZ;AACD,IAAA,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC;AACzB;AAEA;;;;;;;;;;AAUG;AACH,SAAS,UAAU,CACf,OAAgB,EAChB,IAAY,EACZ,KAAyB,EACzB,OAAkB,EAClB,YAA0B,EAAA;AAE1B,IAAA,IAAI,CAAC,KAAK;QAAE;IACV,OAAuB,CAAC,KAAK,EAAE,WAAW,CAAC,uBAAuB,EAAE,KAAK,CAAC;AAC5E,IAAA,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC;AAErB,IAAA,IAAI,KAAK,KAAK,MAAM,IAAI,YAAY,EAA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AAM,OAAO,IAAI,OAAO,EAAE;AACzB,QAAA,OAAuB,CAAC,KAAK,EAAE,cAAc,CAAC,uBAAuB,CAAC;IAC5E;AACA,IAAA,KAAK,MAAM,OAAO,IAAI,OAAO,EAAE;AACzB,QAAA,OAAuB,CAAC,KAAK,EAAE,cAAc,CAAC,uBAAuB,CAAC;IAC5E;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/view/utils/choose-layer-type.mjs b/node_modules/motion-dom/dist/es/view/utils/choose-layer-type.mjs new file mode 100644 index 0000000..bf7e9e0 --- /dev/null +++ b/node_modules/motion-dom/dist/es/view/utils/choose-layer-type.mjs @@ -0,0 +1,10 @@ +function chooseLayerType(valueName) { + if (valueName === "layout") + return "group"; + if (valueName === "enter" || valueName === "new") + return "new"; + return "old"; +} + +export { chooseLayerType }; +//# sourceMappingURL=choose-layer-type.mjs.map diff --git a/node_modules/motion-dom/dist/es/view/utils/choose-layer-type.mjs.map b/node_modules/motion-dom/dist/es/view/utils/choose-layer-type.mjs.map new file mode 100644 index 0000000..dd303b4 --- /dev/null +++ b/node_modules/motion-dom/dist/es/view/utils/choose-layer-type.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"choose-layer-type.mjs","sources":["../../../../src/view/utils/choose-layer-type.ts"],"sourcesContent":["export function chooseLayerType(\n valueName: \"layout\" | \"enter\" | \"exit\" | \"new\" | \"old\"\n): \"group\" | \"old\" | \"new\" {\n if (valueName === \"layout\") return \"group\"\n if (valueName === \"enter\" || valueName === \"new\") return \"new\"\n return \"old\"\n}\n"],"names":[],"mappings":"AAAM,SAAU,eAAe,CAC3B,SAAsD,EAAA;IAEtD,IAAI,SAAS,KAAK,QAAQ;AAAE,QAAA,OAAO,OAAO;AAC1C,IAAA,IAAI,SAAS,KAAK,OAAO,IAAI,SAAS,KAAK,KAAK;AAAE,QAAA,OAAO,KAAK;AAC9D,IAAA,OAAO,KAAK;AAChB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/view/utils/css.mjs b/node_modules/motion-dom/dist/es/view/utils/css.mjs new file mode 100644 index 0000000..24f9b67 --- /dev/null +++ b/node_modules/motion-dom/dist/es/view/utils/css.mjs @@ -0,0 +1,33 @@ +let pendingRules = {}; +let style = null; +const css = { + set: (selector, values) => { + pendingRules[selector] = values; + }, + commit: () => { + if (!style) { + style = document.createElement("style"); + style.id = "motion-view"; + } + let cssText = ""; + for (const selector in pendingRules) { + const rule = pendingRules[selector]; + cssText += `${selector} {\n`; + for (const [property, value] of Object.entries(rule)) { + cssText += ` ${property}: ${value};\n`; + } + cssText += "}\n"; + } + style.textContent = cssText; + document.head.appendChild(style); + pendingRules = {}; + }, + remove: () => { + if (style && style.parentElement) { + style.parentElement.removeChild(style); + } + }, +}; + +export { css }; +//# sourceMappingURL=css.mjs.map diff --git a/node_modules/motion-dom/dist/es/view/utils/css.mjs.map b/node_modules/motion-dom/dist/es/view/utils/css.mjs.map new file mode 100644 index 0000000..bf16924 --- /dev/null +++ b/node_modules/motion-dom/dist/es/view/utils/css.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"css.mjs","sources":["../../../../src/view/utils/css.ts"],"sourcesContent":["let pendingRules: Record> = {}\n\nlet style: HTMLStyleElement | null = null\n\nexport const css = {\n set: (selector: string, values: Record) => {\n pendingRules[selector] = values\n },\n\n commit: () => {\n if (!style) {\n style = document.createElement(\"style\")\n style.id = \"motion-view\"\n }\n\n let cssText = \"\"\n\n for (const selector in pendingRules) {\n const rule = pendingRules[selector]\n cssText += `${selector} {\\n`\n for (const [property, value] of Object.entries(rule)) {\n cssText += ` ${property}: ${value};\\n`\n }\n cssText += \"}\\n\"\n }\n\n style.textContent = cssText\n document.head.appendChild(style)\n\n pendingRules = {}\n },\n\n remove: () => {\n if (style && style.parentElement) {\n style.parentElement.removeChild(style)\n }\n },\n}\n"],"names":[],"mappings":"AAAA,IAAI,YAAY,GAA2C,EAAE;AAE7D,IAAI,KAAK,GAA4B,IAAI;AAElC,MAAM,GAAG,GAAG;AACf,IAAA,GAAG,EAAE,CAAC,QAAgB,EAAE,MAA8B,KAAI;AACtD,QAAA,YAAY,CAAC,QAAQ,CAAC,GAAG,MAAM;IACnC,CAAC;IAED,MAAM,EAAE,MAAK;QACT,IAAI,CAAC,KAAK,EAAE;AACR,YAAA,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC;AACvC,YAAA,KAAK,CAAC,EAAE,GAAG,aAAa;QAC5B;QAEA,IAAI,OAAO,GAAG,EAAE;AAEhB,QAAA,KAAK,MAAM,QAAQ,IAAI,YAAY,EAAE;AACjC,YAAA,MAAM,IAAI,GAAG,YAAY,CAAC,QAAQ,CAAC;AACnC,YAAA,OAAO,IAAI,CAAA,EAAG,QAAQ,CAAA,IAAA,CAAM;AAC5B,YAAA,KAAK,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;AAClD,gBAAA,OAAO,IAAI,CAAA,EAAA,EAAK,QAAQ,CAAA,EAAA,EAAK,KAAK,KAAK;YAC3C;YACA,OAAO,IAAI,KAAK;QACpB;AAEA,QAAA,KAAK,CAAC,WAAW,GAAG,OAAO;AAC3B,QAAA,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC;QAEhC,YAAY,GAAG,EAAE;IACrB,CAAC;IAED,MAAM,EAAE,MAAK;AACT,QAAA,IAAI,KAAK,IAAI,KAAK,CAAC,aAAa,EAAE;AAC9B,YAAA,KAAK,CAAC,aAAa,CAAC,WAAW,CAAC,KAAK,CAAC;QAC1C;IACJ,CAAC;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/view/utils/get-layer-info.mjs b/node_modules/motion-dom/dist/es/view/utils/get-layer-info.mjs new file mode 100644 index 0000000..3aff9a5 --- /dev/null +++ b/node_modules/motion-dom/dist/es/view/utils/get-layer-info.mjs @@ -0,0 +1,11 @@ +function getViewAnimationLayerInfo(pseudoElement) { + const match = pseudoElement.match( + // `group-children` (nested transitions) before `group` so it wins. + /::view-transition-(old|new|group-children|group|image-pair)\((.*?)\)/); + if (!match) + return null; + return { layer: match[2], type: match[1] }; +} + +export { getViewAnimationLayerInfo }; +//# sourceMappingURL=get-layer-info.mjs.map diff --git a/node_modules/motion-dom/dist/es/view/utils/get-layer-info.mjs.map b/node_modules/motion-dom/dist/es/view/utils/get-layer-info.mjs.map new file mode 100644 index 0000000..7bde2e2 --- /dev/null +++ b/node_modules/motion-dom/dist/es/view/utils/get-layer-info.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"get-layer-info.mjs","sources":["../../../../src/view/utils/get-layer-info.ts"],"sourcesContent":["export function getViewAnimationLayerInfo(pseudoElement: string) {\n const match = pseudoElement.match(\n // `group-children` (nested transitions) before `group` so it wins.\n /::view-transition-(old|new|group-children|group|image-pair)\\((.*?)\\)/\n )\n if (!match) return null\n\n return { layer: match[2], type: match[1] }\n}\n"],"names":[],"mappings":"AAAM,SAAU,yBAAyB,CAAC,aAAqB,EAAA;AAC3D,IAAA,MAAM,KAAK,GAAG,aAAa,CAAC,KAAK;;AAE7B,IAAA,sEAAsE,CACzE;AACD,IAAA,IAAI,CAAC,KAAK;AAAE,QAAA,OAAO,IAAI;AAEvB,IAAA,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE;AAC9C;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/view/utils/get-view-animations.mjs b/node_modules/motion-dom/dist/es/view/utils/get-view-animations.mjs new file mode 100644 index 0000000..a249893 --- /dev/null +++ b/node_modules/motion-dom/dist/es/view/utils/get-view-animations.mjs @@ -0,0 +1,11 @@ +function getViewAnimations() { + return document.getAnimations().filter((animation) => { + const { effect } = animation; + return (!!effect && + effect.target === document.documentElement && + effect.pseudoElement?.startsWith("::view-transition")); + }); +} + +export { getViewAnimations }; +//# sourceMappingURL=get-view-animations.mjs.map diff --git a/node_modules/motion-dom/dist/es/view/utils/get-view-animations.mjs.map b/node_modules/motion-dom/dist/es/view/utils/get-view-animations.mjs.map new file mode 100644 index 0000000..2fd42a6 --- /dev/null +++ b/node_modules/motion-dom/dist/es/view/utils/get-view-animations.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"get-view-animations.mjs","sources":["../../../../src/view/utils/get-view-animations.ts"],"sourcesContent":["export function getViewAnimations() {\n return document.getAnimations().filter((animation) => {\n const { effect } = animation\n return (\n !!effect &&\n effect.target === document.documentElement &&\n (effect as KeyframeEffect).pseudoElement?.startsWith(\n \"::view-transition\"\n )\n )\n })\n}\n"],"names":[],"mappings":"SAAgB,iBAAiB,GAAA;IAC7B,OAAO,QAAQ,CAAC,aAAa,EAAE,CAAC,MAAM,CAAC,CAAC,SAAS,KAAI;AACjD,QAAA,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS;QAC5B,QACI,CAAC,CAAC,MAAM;AACR,YAAA,MAAM,CAAC,MAAM,KAAK,QAAQ,CAAC,eAAe;YACzC,MAAyB,CAAC,aAAa,EAAE,UAAU,CAChD,mBAAmB,CACtB;AAET,IAAA,CAAC,CAAC;AACN;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/view/utils/has-target.mjs b/node_modules/motion-dom/dist/es/view/utils/has-target.mjs new file mode 100644 index 0000000..ae14a10 --- /dev/null +++ b/node_modules/motion-dom/dist/es/view/utils/has-target.mjs @@ -0,0 +1,6 @@ +function hasTarget(target, targets) { + return targets.has(target) && Object.keys(targets.get(target)).length > 0; +} + +export { hasTarget }; +//# sourceMappingURL=has-target.mjs.map diff --git a/node_modules/motion-dom/dist/es/view/utils/has-target.mjs.map b/node_modules/motion-dom/dist/es/view/utils/has-target.mjs.map new file mode 100644 index 0000000..4ef9574 --- /dev/null +++ b/node_modules/motion-dom/dist/es/view/utils/has-target.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"has-target.mjs","sources":["../../../../src/view/utils/has-target.ts"],"sourcesContent":["import { ViewTransitionTarget, ViewTransitionTargetDefinition } from \"../types\"\n\nexport function hasTarget(\n target: ViewTransitionTargetDefinition,\n targets: Map\n) {\n return targets.has(target) && Object.keys(targets.get(target)!).length > 0\n}\n"],"names":[],"mappings":"AAEM,SAAU,SAAS,CACrB,MAAsC,EACtC,OAAkE,EAAA;IAElE,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAE,CAAC,CAAC,MAAM,GAAG,CAAC;AAC9E;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/index.d.ts b/node_modules/motion-dom/dist/index.d.ts new file mode 100644 index 0000000..2114701 --- /dev/null +++ b/node_modules/motion-dom/dist/index.d.ts @@ -0,0 +1,5293 @@ +import * as motion_utils from 'motion-utils'; +import { Point, BoundingBox, Axis, Box, TransformPoint, Easing, Delta, EasingFunction, BezierDefinition, AxisDelta, SubscriptionManager } from 'motion-utils'; + +/** + * Passed in to pan event handlers like `onPan` the `PanInfo` object contains + * information about the current state of the tap gesture such as its + * `point`, `delta`, `offset` and `velocity`. + * + * ```jsx + * { + * console.log(info.point.x, info.point.y) + * }} /> + * ``` + * + * @public + */ +interface PanInfo { + /** + * Contains `x` and `y` values for the current pan position relative + * to the device or page. + * + * ```jsx + * function onPan(event, info) { + * console.log(info.point.x, info.point.y) + * } + * + * + * ``` + * + * @public + */ + point: Point; + /** + * Contains `x` and `y` values for the distance moved since + * the last event. + * + * ```jsx + * function onPan(event, info) { + * console.log(info.delta.x, info.delta.y) + * } + * + * + * ``` + * + * @public + */ + delta: Point; + /** + * Contains `x` and `y` values for the distance moved from + * the first pan event. + * + * ```jsx + * function onPan(event, info) { + * console.log(info.offset.x, info.offset.y) + * } + * + * + * ``` + * + * @public + */ + offset: Point; + /** + * Contains `x` and `y` values for the current velocity of the pointer, in px/ms. + * + * ```jsx + * function onPan(event, info) { + * console.log(info.velocity.x, info.velocity.y) + * } + * + * + * ``` + * + * @public + */ + velocity: Point; +} +type PanHandler = (event: Event, info: PanInfo) => void; + +type DragHandler = (event: MouseEvent | TouchEvent | PointerEvent, info: PanInfo) => void; +type DragElastic = boolean | number | Partial; +interface ResolvedConstraints { + x: Partial; + y: Partial; +} +interface ResolvedElastic { + x: Axis; + y: Axis; +} + +interface EventInfo { + point: Point; +} +/** + * A generic set of string/number values + */ +interface ResolvedValues$1 { + [key: string]: AnyResolvedKeyframe; +} +type AnimationDefinition = VariantLabels | TargetAndTransition | TargetResolver; +/** + * An object that specifies values to animate to. Each value may be set either as + * a single value, or an array of values. + * + * It may also option contain these properties: + * + * - `transition`: Specifies transitions for all or individual values. + * - `transitionEnd`: Specifies values to set when the animation finishes. + * + * ```jsx + * const target = { + * x: "0%", + * opacity: 0, + * transition: { duration: 1 }, + * transitionEnd: { display: "none" } + * } + * ``` + * + * @public + */ +type TargetAndTransition = Target & { + transition?: Transition; + transitionEnd?: ResolvedValues$1; +}; +type TargetResolver = (custom: any, current: ResolvedValues$1, velocity: ResolvedValues$1) => TargetAndTransition | string; +/** + * Either a string, or array of strings, that reference variants defined via the `variants` prop. + * @public + */ +type VariantLabels = string | string[]; +type Variant = TargetAndTransition | TargetResolver; +interface Variants { + [key: string]: Variant; +} +/** + * @deprecated + */ +type LegacyAnimationControls = { + /** + * Subscribes a component's animation controls to this. + * + * @param controls - The controls to subscribe + * @returns An unsubscribe function. + */ + subscribe(visualElement: any): () => void; + /** + * Starts an animation on all linked components. + * + * @remarks + * + * ```jsx + * controls.start("variantLabel") + * controls.start({ + * x: 0, + * transition: { duration: 1 } + * }) + * ``` + * + * @param definition - Properties or variant label to animate to + * @param transition - Optional `transition` to apply to a variant + * @returns - A `Promise` that resolves when all animations have completed. + * + * @public + */ + start(definition: AnimationDefinition, transitionOverride?: Transition): Promise; + /** + * Instantly set to a set of properties or a variant. + * + * ```jsx + * // With properties + * controls.set({ opacity: 0 }) + * + * // With variants + * controls.set("hidden") + * ``` + * + * @privateRemarks + * We could perform a similar trick to `.start` where this can be called before mount + * and we maintain a list of of pending actions that get applied on mount. But the + * expectation of `set` is that it happens synchronously and this would be difficult + * to do before any children have even attached themselves. It's also poor practise + * and we should discourage render-synchronous `.start` calls rather than lean into this. + * + * @public + */ + set(definition: AnimationDefinition): void; + /** + * Stops animations on all linked components. + * + * ```jsx + * controls.stop() + * ``` + * + * @public + */ + stop(): void; + mount(): () => void; +}; +interface MotionNodeAnimationOptions { + /** + * Properties, variant label or array of variant labels to start in. + * + * Set to `false` to initialise with the values in `animate` (disabling the mount animation) + * + * ```jsx + * // As values + * + * + * // As variant + * + * + * // Multiple variants + * + * + * // As false (disable mount animation) + * + * ``` + */ + initial?: TargetAndTransition | VariantLabels | boolean; + /** + * Values to animate to, variant label(s), or `LegacyAnimationControls`. + * + * ```jsx + * // As values + * + * + * // As variant + * + * + * // Multiple variants + * + * + * // LegacyAnimationControls + * + * ``` + */ + animate?: TargetAndTransition | VariantLabels | boolean | LegacyAnimationControls; + /** + * A target to animate to when this component is removed from the tree. + * + * This component **must** be the first animatable child of an `AnimatePresence` to enable this exit animation. + * + * This limitation exists because React doesn't allow components to defer unmounting until after + * an animation is complete. Once this limitation is fixed, the `AnimatePresence` component will be unnecessary. + * + * ```jsx + * import { AnimatePresence, motion } from 'framer-motion' + * + * export const MyComponent = ({ isVisible }) => { + * return ( + * + * {isVisible && ( + * + * )} + * + * ) + * } + * ``` + */ + exit?: TargetAndTransition | VariantLabels; + /** + * Variants allow you to define animation states and organise them by name. They allow + * you to control animations throughout a component tree by switching a single `animate` prop. + * + * Using `transition` options like `delayChildren` and `when`, you can orchestrate + * when children animations play relative to their parent. + + * + * After passing variants to one or more `motion` component's `variants` prop, these variants + * can be used in place of values on the `animate`, `initial`, `whileFocus`, `whileTap` and `whileHover` props. + * + * ```jsx + * const variants = { + * active: { + * backgroundColor: "#f00" + * }, + * inactive: { + * backgroundColor: "#fff", + * transition: { duration: 2 } + * } + * } + * + * + * ``` + */ + variants?: Variants; + /** + * Default transition. If no `transition` is defined in `animate`, it will use the transition defined here. + * ```jsx + * const spring = { + * type: "spring", + * damping: 10, + * stiffness: 100 + * } + * + * + * ``` + */ + transition?: Transition; +} +interface MotionNodeEventOptions { + /** + * Callback with latest motion values, fired max once per frame. + * + * ```jsx + * function onUpdate(latest) { + * console.log(latest.x, latest.opacity) + * } + * + * + * ``` + */ + onUpdate?(latest: ResolvedValues$1): void; + /** + * Callback when animation defined in `animate` begins. + * + * The provided callback will be called with the triggering animation definition. + * If this is a variant, it'll be the variant name, and if a target object + * then it'll be the target object. + * + * This way, it's possible to figure out which animation has started. + * + * ```jsx + * function onStart() { + * console.log("Animation started") + * } + * + * + * ``` + */ + onAnimationStart?(definition: AnimationDefinition): void; + /** + * Callback when animation defined in `animate` is complete. + * + * The provided callback will be called with the triggering animation definition. + * If this is a variant, it'll be the variant name, and if a target object + * then it'll be the target object. + * + * This way, it's possible to figure out which animation has completed. + * + * ```jsx + * function onComplete() { + * console.log("Animation completed") + * } + * + * { + * console.log('Completed animating', definition) + * }} + * /> + * ``` + */ + onAnimationComplete?(definition: AnimationDefinition): void; + onBeforeLayoutMeasure?(box: Box): void; + onLayoutMeasure?(box: Box, prevBox: Box): void; + onLayoutAnimationStart?(): void; + onLayoutAnimationComplete?(): void; +} +interface MotionNodePanHandlers { + /** + * Callback function that fires when the pan gesture is recognised on this element. + * + * **Note:** For pan gestures to work correctly with touch input, the element needs + * touch scrolling to be disabled on either x/y or both axis with the + * [touch-action](https://developer.mozilla.org/en-US/docs/Web/CSS/touch-action) CSS rule. + * + * ```jsx + * function onPan(event, info) { + * console.log(info.point.x, info.point.y) + * } + * + * + * ``` + * + * @param event - The originating pointer event. + * @param info - A {@link PanInfo} object containing `x` and `y` values for: + * + * - `point`: Relative to the device or page. + * - `delta`: Distance moved since the last event. + * - `offset`: Offset from the original pan event. + * - `velocity`: Current velocity of the pointer. + */ + onPan?(event: PointerEvent, info: PanInfo): void; + /** + * Callback function that fires when the pan gesture begins on this element. + * + * ```jsx + * function onPanStart(event, info) { + * console.log(info.point.x, info.point.y) + * } + * + * + * ``` + * + * @param event - The originating pointer event. + * @param info - A {@link PanInfo} object containing `x`/`y` values for: + * + * - `point`: Relative to the device or page. + * - `delta`: Distance moved since the last event. + * - `offset`: Offset from the original pan event. + * - `velocity`: Current velocity of the pointer. + */ + onPanStart?(event: PointerEvent, info: PanInfo): void; + /** + * Callback function that fires when we begin detecting a pan gesture. This + * is analogous to `onMouseStart` or `onTouchStart`. + * + * ```jsx + * function onPanSessionStart(event, info) { + * console.log(info.point.x, info.point.y) + * } + * + * + * ``` + * + * @param event - The originating pointer event. + * @param info - An {@link EventInfo} object containing `x`/`y` values for: + * + * - `point`: Relative to the device or page. + */ + onPanSessionStart?(event: PointerEvent, info: EventInfo): void; + /** + * Callback function that fires when the pan gesture ends on this element. + * + * ```jsx + * function onPanEnd(event, info) { + * console.log(info.point.x, info.point.y) + * } + * + * + * ``` + * + * @param event - The originating pointer event. + * @param info - A {@link PanInfo} object containing `x`/`y` values for: + * + * - `point`: Relative to the device or page. + * - `delta`: Distance moved since the last event. + * - `offset`: Offset from the original pan event. + * - `velocity`: Current velocity of the pointer. + */ + onPanEnd?(event: PointerEvent, info: PanInfo): void; +} +interface MotionNodeHoverHandlers { + /** + * Properties or variant label to animate to while the hover gesture is recognised. + * + * ```jsx + * + * ``` + */ + whileHover?: VariantLabels | TargetAndTransition; + /** + * Callback function that fires when pointer starts hovering over the component. + * + * ```jsx + * console.log('Hover starts')} /> + * ``` + */ + onHoverStart?(event: PointerEvent, info: EventInfo): void; + /** + * Callback function that fires when pointer stops hovering over the component. + * + * ```jsx + * console.log("Hover ends")} /> + * ``` + */ + onHoverEnd?(event: PointerEvent, info: EventInfo): void; +} +/** + * Passed in to tap event handlers like `onTap` the `TapInfo` object contains + * information about the tap gesture such as it‘s location. + * + * ```jsx + * function onTap(event, info) { + * console.log(info.point.x, info.point.y) + * } + * + * + * ``` + * + * @public + */ +interface TapInfo { + /** + * Contains `x` and `y` values for the tap gesture relative to the + * device or page. + * + * ```jsx + * function onTapStart(event, info) { + * console.log(info.point.x, info.point.y) + * } + * + * + * ``` + * + * @public + */ + point: Point; +} +interface MotionNodeTapHandlers { + /** + * Callback when the tap gesture successfully ends on this element. + * + * ```jsx + * function onTap(event, info) { + * console.log(info.point.x, info.point.y) + * } + * + * + * ``` + * + * @param event - The originating pointer event. + * @param info - An {@link TapInfo} object containing `x` and `y` values for the `point` relative to the device or page. + */ + onTap?(event: MouseEvent | TouchEvent | PointerEvent, info: TapInfo): void; + /** + * Callback when the tap gesture starts on this element. + * + * ```jsx + * function onTapStart(event, info) { + * console.log(info.point.x, info.point.y) + * } + * + * + * ``` + * + * @param event - The originating pointer event. + * @param info - An {@link TapInfo} object containing `x` and `y` values for the `point` relative to the device or page. + */ + onTapStart?(event: MouseEvent | TouchEvent | PointerEvent, info: TapInfo): void; + /** + * Callback when the tap gesture ends outside this element. + * + * ```jsx + * function onTapCancel(event, info) { + * console.log(info.point.x, info.point.y) + * } + * + * + * ``` + * + * @param event - The originating pointer event. + * @param info - An {@link TapInfo} object containing `x` and `y` values for the `point` relative to the device or page. + */ + onTapCancel?(event: MouseEvent | TouchEvent | PointerEvent, info: TapInfo): void; + /** + * Properties or variant label to animate to while the component is pressed. + * + * ```jsx + * + * ``` + */ + whileTap?: VariantLabels | TargetAndTransition; + /** + * If `true`, the tap gesture will attach its start listener to window. + * + * Note: This is not supported publically. + */ + globalTapTarget?: boolean; +} +/** + * @deprecated - Use MotionNodeTapHandlers + */ +interface TapHandlers extends MotionNodeTapHandlers { +} +interface MotionNodeFocusHandlers { + /** + * Properties or variant label to animate to while the focus gesture is recognised. + * + * ```jsx + * + * ``` + */ + whileFocus?: VariantLabels | TargetAndTransition; +} +/** + * TODO: Replace with types from inView() + */ +type ViewportEventHandler = (entry: IntersectionObserverEntry | null) => void; +interface ViewportOptions { + root?: { + current: Element | null; + }; + once?: boolean; + margin?: string; + amount?: "some" | "all" | number; +} +interface MotionNodeViewportOptions { + whileInView?: VariantLabels | TargetAndTransition; + onViewportEnter?: ViewportEventHandler; + onViewportLeave?: ViewportEventHandler; + viewport?: ViewportOptions; +} +interface MotionNodeDraggableOptions { + /** + * Enable dragging for this element. Set to `false` by default. + * Set `true` to drag in both directions. + * Set `"x"` or `"y"` to only drag in a specific direction. + * + * ```jsx + * + * ``` + */ + drag?: boolean | "x" | "y"; + /** + * Properties or variant label to animate to while the drag gesture is recognised. + * + * ```jsx + * + * ``` + */ + whileDrag?: VariantLabels | TargetAndTransition; + /** + * If `true`, this will lock dragging to the initially-detected direction. Defaults to `false`. + * + * ```jsx + * + * ``` + */ + dragDirectionLock?: boolean; + /** + * Allows drag gesture propagation to child components. Set to `false` by + * default. + * + * ```jsx + * + * ``` + */ + dragPropagation?: boolean; + /** + * Applies constraints on the permitted draggable area. + * + * It can accept an object of optional `top`, `left`, `right`, and `bottom` values, measured in pixels. + * This will define a distance from the named edge of the draggable component. + * + * Alternatively, it can accept a `ref` to another component created with React's `useRef` hook. + * This `ref` should be passed both to the draggable component's `dragConstraints` prop, and the `ref` + * of the component you want to use as constraints. + * + * ```jsx + * // In pixels + * + * + * // As a ref to another component + * const MyComponent = () => { + * const constraintsRef = useRef(null) + * + * return ( + * + * + * + * ) + * } + * ``` + */ + dragConstraints?: false | Partial | { + current: Element | null; + }; + /** + * The degree of movement allowed outside constraints. 0 = no movement, 1 = + * full movement. + * + * Set to `0.5` by default. Can also be set as `false` to disable movement. + * + * By passing an object of `top`/`right`/`bottom`/`left`, individual values can be set + * per constraint. Any missing values will be set to `0`. + * + * ```jsx + * + * ``` + */ + dragElastic?: DragElastic; + /** + * Apply momentum from the pan gesture to the component when dragging + * finishes. Set to `true` by default. + * + * ```jsx + * + * ``` + */ + dragMomentum?: boolean; + /** + * Allows you to change dragging inertia parameters. + * When releasing a draggable Frame, an animation with type `inertia` starts. The animation is based on your dragging velocity. This property allows you to customize it. + * See {@link https://motion.dev/docs/react-motion-component#dragtransition | Inertia} for all properties you can use. + * + * ```jsx + * + * ``` + */ + dragTransition?: InertiaOptions; + /** + * Usually, dragging is initiated by pressing down on a component and moving it. For some + * use-cases, for instance clicking at an arbitrary point on a video scrubber, we + * might want to initiate dragging from a different component than the draggable one. + * + * By creating a `dragControls` using the `useDragControls` hook, we can pass this into + * the draggable component's `dragControls` prop. It exposes a `start` method + * that can start dragging from pointer events on other components. + * + * ```jsx + * const dragControls = useDragControls() + * + * function startDrag(event) { + * dragControls.start(event, { snapToCursor: true }) + * } + * + * return ( + * <> + *
+ * + * + * ) + * ``` + */ + dragControls?: any; + /** + * If `true`, element will snap back to its origin when dragging ends. + * Set to `"x"` or `"y"` to only snap back on a specific axis. + * + * Enabling this is the equivalent of setting all `dragConstraints` axes to `0` + * with `dragElastic={1}`, but when used together `dragConstraints` can define + * a wider draggable area and `dragSnapToOrigin` will ensure the element + * animates back to its origin on release. + */ + dragSnapToOrigin?: boolean | "x" | "y"; + /** + * By default, if `drag` is defined on a component then an event listener will be attached + * to automatically initiate dragging when a user presses down on it. + * + * By setting `dragListener` to `false`, this event listener will not be created. + * + * ```jsx + * const dragControls = useDragControls() + * + * function startDrag(event) { + * dragControls.start(event, { snapToCursor: true }) + * } + * + * return ( + * <> + *
+ * + * + * ) + * ``` + */ + dragListener?: boolean; + /** + * If `dragConstraints` is set to a React ref, this callback will call with the measured drag constraints. + * + * @public + */ + onMeasureDragConstraints?: (constraints: BoundingBox) => BoundingBox | void; + /** + * Usually, dragging uses the layout project engine, and applies transforms to the underlying VisualElement. + * Passing MotionValues as _dragX and _dragY instead applies drag updates to these motion values. + * This allows you to manually control how updates from a drag gesture on an element is applied. + * + * @public + */ + _dragX?: MotionValue; + /** + * Usually, dragging uses the layout project engine, and applies transforms to the underlying VisualElement. + * Passing MotionValues as _dragX and _dragY instead applies drag updates to these motion values. + * This allows you to manually control how updates from a drag gesture on an element is applied. + * + * @public + */ + _dragY?: MotionValue; +} +interface MotionNodeDragHandlers { + /** + * Callback function that fires when dragging starts. + * + * ```jsx + * console.log(info.point.x, info.point.y) + * } + * /> + * ``` + * + * @public + */ + onDragStart?(event: MouseEvent | TouchEvent | PointerEvent, info: PanInfo): void; + /** + * Callback function that fires when dragging ends. + * + * ```jsx + * console.log(info.point.x, info.point.y) + * } + * /> + * ``` + * + * @public + */ + onDragEnd?(event: MouseEvent | TouchEvent | PointerEvent, info: PanInfo): void; + /** + * Callback function that fires when the component is dragged. + * + * ```jsx + * console.log(info.point.x, info.point.y) + * } + * /> + * ``` + * + * @public + */ + onDrag?(event: MouseEvent | TouchEvent | PointerEvent, info: PanInfo): void; + /** + * Callback function that fires a drag direction is determined. + * + * ```jsx + * console.log(axis)} + * /> + * ``` + * + * @public + */ + onDirectionLock?(axis: "x" | "y"): void; + /** + * Callback function that fires when drag momentum/bounce transition finishes. + * + * ```jsx + * console.log('Drag transition complete')} + * /> + * ``` + * + * @public + */ + onDragTransitionEnd?(): void; +} +interface MotionNodeLayoutOptions { + /** + * If `true`, this component will automatically animate to its new position when + * its layout changes. + * + * ```jsx + * + * ``` + * + * This will perform a layout animation using performant transforms. Part of this technique + * involved animating an element's scale. This can introduce visual distortions on children, + * `boxShadow` and `borderRadius`. + * + * To correct distortion on immediate children, add `layout` to those too. + * + * `boxShadow` and `borderRadius` will automatically be corrected if they are already being + * animated on this component. Otherwise, set them directly via the `initial` prop. + * + * If `layout` is set to `"position"`, the size of the component will change instantly and + * only its position will animate. + * + * If `layout` is set to `"size"`, the position of the component will change instantly and + * only its size will animate. + * + * If `layout` is set to `"preserve-aspect"`, the component will animate size & position if + * the aspect ratio remains the same between renders, and just position if the ratio changes. + * + * @public + */ + layout?: boolean | "position" | "size" | "preserve-aspect" | "x" | "y"; + /** + * Enable shared layout transitions between different components with the same `layoutId`. + * + * When a component with a layoutId is removed from the React tree, and then + * added elsewhere, it will visually animate from the previous component's bounding box + * and its latest animated values. + * + * ```jsx + * {items.map(item => ( + * + * {item.name} + * {item.isSelected && } + * + * ))} + * ``` + * + * If the previous component remains in the tree it will crossfade with the new component. + * + * @public + */ + layoutId?: string; + /** + * A callback that will fire when a layout animation on this component starts. + * + * @public + */ + onLayoutAnimationStart?(): void; + /** + * A callback that will fire when a layout animation on this component completes. + * + * @public + */ + onLayoutAnimationComplete?(): void; + /** + * @public + */ + layoutDependency?: any; + /** + * Whether a projection node should measure its scroll when it or its descendants update their layout. + * + * @public + */ + layoutScroll?: boolean; + /** + * Whether an element should be considered a "layout root", where + * all children will be forced to resolve relatively to it. + * Currently used for `position: sticky` elements in Framer. + */ + layoutRoot?: boolean; + /** + * The anchor point for relative layout projection. This defines which + * point on the parent is used as the reference for the child's position. + * + * `{ x: 0, y: 0 }` (default) anchors to the top-left corner. + * `{ x: 0.5, y: 0.5 }` anchors to the center, useful for centered layouts + * (e.g., flexbox) to prevent drift during parent layout animations. + * `false` disables relative projection entirely. + */ + layoutAnchor?: { + x: number; + y: number; + } | false; + /** + * Attached to a portal root to ensure we attach the child to the document root and don't + * perform scale correction on it. + */ + "data-framer-portal-id"?: string; + /** + * By default, shared layout elements will crossfade. By setting this + * to `false`, this element will take its default opacity throughout the animation. + */ + layoutCrossfade?: boolean; +} +/** + * @deprecated - Use MotionNodeDragHandlers/MotionNodeDraggableOptions + */ +interface DraggableProps extends MotionNodeDragHandlers, MotionNodeDraggableOptions { +} +type TransformTemplate = (transform: TransformProperties, generatedTransform: string) => string; +interface MotionNodeAdvancedOptions { + /** + * Custom data to use to resolve dynamic variants differently for each animating component. + * + * ```jsx + * const variants = { + * visible: (custom) => ({ + * opacity: 1, + * transition: { delay: custom * 0.2 } + * }) + * } + * + * + * + * + * ``` + * + * @public + */ + custom?: any; + /** + * @public + * Set to `false` to prevent inheriting variant changes from its parent. + */ + inherit?: boolean; + /** + * @public + * Set to `false` to prevent throwing an error when a `motion` component is used within a `LazyMotion` set to strict. + */ + ignoreStrict?: boolean; + /** + * Provide a set of motion values to perform animations on. + */ + values?: { + [key: string]: MotionValue | MotionValue; + }; + /** + * By default, Motion generates a `transform` property with a sensible transform order. `transformTemplate` + * can be used to create a different order, or to append/preprend the automatically generated `transform` property. + * + * ```jsx + * `rotate(${rotate}deg) translateX(${x}px)` + * } + * /> + * ``` + * + * @param transform - The latest animated transform props. + * @param generatedTransform - The transform string as automatically generated by Motion + * + * @public + */ + transformTemplate?: TransformTemplate; + "data-framer-appear-id"?: string; +} +interface PropagateOptions { + /** + * If `false`, this element's tap gesture will prevent any parent + * element's tap gesture handlers (`onTap`, `onTapStart`, `whileTap`) + * from firing. Defaults to `true`. + */ + tap?: boolean; +} +interface MotionNodeOptions extends MotionNodeAnimationOptions, MotionNodeEventOptions, MotionNodePanHandlers, MotionNodeTapHandlers, MotionNodeHoverHandlers, MotionNodeFocusHandlers, MotionNodeViewportOptions, MotionNodeDragHandlers, MotionNodeDraggableOptions, MotionNodeLayoutOptions, MotionNodeAdvancedOptions { + /** + * Controls whether gesture events propagate to parent motion components. + * By default all gestures propagate. Set individual gestures to `false` + * to prevent parent handlers from firing. + * + * ```jsx + * + * + * + * ``` + */ + propagate?: PropagateOptions; +} + +/** + * @public + */ +interface PresenceContextProps { + id: string; + isPresent: boolean; + register: (id: string | number) => () => void; + onExitComplete?: (id: string | number) => void; + initial?: false | VariantLabels; + custom?: any; +} +/** + * @public + */ +type ReducedMotionConfig = "always" | "never" | "user"; +/** + * @public + */ +interface MotionConfigContextProps { + /** + * Internal, exported only for usage in Framer + */ + transformPagePoint: TransformPoint; + /** + * Internal. Determines whether this is a static context ie the Framer canvas. If so, + * it'll disable all dynamic functionality. + */ + isStatic: boolean; + /** + * Defines a new default transition for the entire tree. + * + * @public + */ + transition?: Transition; + /** + * If true, will respect the device prefersReducedMotion setting by switching + * transform animations off. + * + * @public + */ + reducedMotion?: ReducedMotionConfig; + /** + * A custom `nonce` attribute used when wanting to enforce a Content Security Policy (CSP). + * For more details see: + * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/style-src#unsafe_inline_styles + * + * @public + */ + nonce?: string; + /** + * If true, all animations will be skipped and values will be set instantly. + * Useful for E2E tests and visual regression testing. + * + * @public + */ + skipAnimations?: boolean; +} +interface VisualState<_Instance, RenderState> { + latestValues: ResolvedValues$1; + renderState: RenderState; +} +interface VisualElementOptions { + visualState: VisualState; + parent?: any; + variantParent?: any; + presenceContext: PresenceContextProps | null; + props: MotionNodeOptions; + blockInitialAnimation?: boolean; + reducedMotionConfig?: ReducedMotionConfig; + /** + * If true, all animations will be skipped and values will be set instantly. + * Useful for E2E tests and visual regression testing. + */ + skipAnimations?: boolean; + /** + * Explicit override for SVG detection. When true, uses SVG rendering; + * when false, uses HTML rendering. If undefined, auto-detects. + */ + isSVG?: boolean; +} +interface VisualElementEventCallbacks { + BeforeLayoutMeasure: () => void; + LayoutMeasure: (layout: Box, prevLayout?: Box) => void; + LayoutUpdate: (layout: Axis, prevLayout: Axis) => void; + Update: (latest: ResolvedValues$1) => void; + AnimationStart: (definition: AnimationDefinition) => void; + AnimationComplete: (definition: AnimationDefinition) => void; + LayoutAnimationStart: () => void; + LayoutAnimationComplete: () => void; + SetAxisTarget: () => void; + Unmount: () => void; +} +interface LayoutLifecycles { + onBeforeLayoutMeasure?(box: Box): void; + onLayoutMeasure?(box: Box, prevBox: Box): void; +} +type ScrapeMotionValuesFromProps = (props: MotionNodeOptions, prevProps: MotionNodeOptions, visualElement?: any) => { + [key: string]: MotionValue | AnyResolvedKeyframe; +}; +type UseRenderState = () => RenderState; +/** + * Animation type for variant state management + */ +type AnimationType = "animate" | "whileHover" | "whileTap" | "whileDrag" | "whileFocus" | "whileInView" | "exit"; +interface FeatureClass { + new (props: Props): any; +} +interface FeatureDefinition { + isEnabled: (props: MotionNodeOptions) => boolean; + Feature?: FeatureClass; + ProjectionNode?: any; + MeasureLayout?: any; +} +type FeatureDefinitions = { + animation?: FeatureDefinition; + exit?: FeatureDefinition; + drag?: FeatureDefinition; + tap?: FeatureDefinition; + focus?: FeatureDefinition; + hover?: FeatureDefinition; + pan?: FeatureDefinition; + inView?: FeatureDefinition; + layout?: FeatureDefinition; +}; + +interface TransformOrigin { + originX?: number | string; + originY?: number | string; + originZ?: number | string; +} +interface HTMLRenderState { + /** + * A mutable record of transforms we want to apply directly to the rendered Element + * every frame. We use a mutable data structure to reduce GC during animations. + */ + transform: ResolvedValues$1; + /** + * A mutable record of transform origins we want to apply directly to the rendered Element + * every frame. We use a mutable data structure to reduce GC during animations. + */ + transformOrigin: TransformOrigin; + /** + * A mutable record of styles we want to apply directly to the rendered Element + * every frame. We use a mutable data structure to reduce GC during animations. + */ + style: ResolvedValues$1; + /** + * A mutable record of CSS variables we want to apply directly to the rendered Element + * every frame. We use a mutable data structure to reduce GC during animations. + */ + vars: ResolvedValues$1; +} + +interface SVGRenderState extends HTMLRenderState { + /** + * A mutable record of attributes we want to apply directly to the rendered Element + * every frame. We use a mutable data structure to reduce GC during animations. + */ + attrs: ResolvedValues$1; +} +interface SVGAttributes { + accentHeight?: AnyResolvedKeyframe | undefined; + accumulate?: "none" | "sum" | undefined; + additive?: "replace" | "sum" | undefined; + alignmentBaseline?: "auto" | "baseline" | "before-edge" | "text-before-edge" | "middle" | "central" | "after-edge" | "text-after-edge" | "ideographic" | "alphabetic" | "hanging" | "mathematical" | "inherit" | undefined; + allowReorder?: "no" | "yes" | undefined; + alphabetic?: AnyResolvedKeyframe | undefined; + amplitude?: AnyResolvedKeyframe | undefined; + arabicForm?: "initial" | "medial" | "terminal" | "isolated" | undefined; + ascent?: AnyResolvedKeyframe | undefined; + attributeName?: string | undefined; + attributeType?: string | undefined; + autoReverse?: boolean | undefined; + azimuth?: AnyResolvedKeyframe | undefined; + baseFrequency?: AnyResolvedKeyframe | undefined; + baselineShift?: AnyResolvedKeyframe | undefined; + baseProfile?: AnyResolvedKeyframe | undefined; + bbox?: AnyResolvedKeyframe | undefined; + begin?: AnyResolvedKeyframe | undefined; + bias?: AnyResolvedKeyframe | undefined; + by?: AnyResolvedKeyframe | undefined; + calcMode?: AnyResolvedKeyframe | undefined; + capHeight?: AnyResolvedKeyframe | undefined; + clip?: AnyResolvedKeyframe | undefined; + clipPath?: string | undefined; + clipPathUnits?: AnyResolvedKeyframe | undefined; + clipRule?: AnyResolvedKeyframe | undefined; + colorInterpolation?: AnyResolvedKeyframe | undefined; + colorInterpolationFilters?: "auto" | "sRGB" | "linearRGB" | "inherit" | undefined; + colorProfile?: AnyResolvedKeyframe | undefined; + colorRendering?: AnyResolvedKeyframe | undefined; + contentScriptType?: AnyResolvedKeyframe | undefined; + contentStyleType?: AnyResolvedKeyframe | undefined; + cursor?: AnyResolvedKeyframe | undefined; + cx?: AnyResolvedKeyframe | undefined; + cy?: AnyResolvedKeyframe | undefined; + d?: string | undefined; + decelerate?: AnyResolvedKeyframe | undefined; + descent?: AnyResolvedKeyframe | undefined; + diffuseConstant?: AnyResolvedKeyframe | undefined; + direction?: AnyResolvedKeyframe | undefined; + display?: AnyResolvedKeyframe | undefined; + divisor?: AnyResolvedKeyframe | undefined; + dominantBaseline?: AnyResolvedKeyframe | undefined; + dur?: AnyResolvedKeyframe | undefined; + dx?: AnyResolvedKeyframe | undefined; + dy?: AnyResolvedKeyframe | undefined; + edgeMode?: AnyResolvedKeyframe | undefined; + elevation?: AnyResolvedKeyframe | undefined; + enableBackground?: AnyResolvedKeyframe | undefined; + end?: AnyResolvedKeyframe | undefined; + exponent?: AnyResolvedKeyframe | undefined; + externalResourcesRequired?: boolean | undefined; + fill?: string | undefined; + fillOpacity?: AnyResolvedKeyframe | undefined; + fillRule?: "nonzero" | "evenodd" | "inherit" | undefined; + filter?: string | undefined; + filterRes?: AnyResolvedKeyframe | undefined; + filterUnits?: AnyResolvedKeyframe | undefined; + floodColor?: AnyResolvedKeyframe | undefined; + floodOpacity?: AnyResolvedKeyframe | undefined; + focusable?: boolean | "auto" | undefined; + fontFamily?: string | undefined; + fontSize?: AnyResolvedKeyframe | undefined; + fontSizeAdjust?: AnyResolvedKeyframe | undefined; + fontStretch?: AnyResolvedKeyframe | undefined; + fontStyle?: AnyResolvedKeyframe | undefined; + fontVariant?: AnyResolvedKeyframe | undefined; + fontWeight?: AnyResolvedKeyframe | undefined; + format?: AnyResolvedKeyframe | undefined; + fr?: AnyResolvedKeyframe | undefined; + from?: AnyResolvedKeyframe | undefined; + fx?: AnyResolvedKeyframe | undefined; + fy?: AnyResolvedKeyframe | undefined; + g1?: AnyResolvedKeyframe | undefined; + g2?: AnyResolvedKeyframe | undefined; + glyphName?: AnyResolvedKeyframe | undefined; + glyphOrientationHorizontal?: AnyResolvedKeyframe | undefined; + glyphOrientationVertical?: AnyResolvedKeyframe | undefined; + glyphRef?: AnyResolvedKeyframe | undefined; + gradientTransform?: string | undefined; + gradientUnits?: string | undefined; + hanging?: AnyResolvedKeyframe | undefined; + horizAdvX?: AnyResolvedKeyframe | undefined; + horizOriginX?: AnyResolvedKeyframe | undefined; + href?: string | undefined; + ideographic?: AnyResolvedKeyframe | undefined; + imageRendering?: AnyResolvedKeyframe | undefined; + in2?: AnyResolvedKeyframe | undefined; + in?: string | undefined; + intercept?: AnyResolvedKeyframe | undefined; + k1?: AnyResolvedKeyframe | undefined; + k2?: AnyResolvedKeyframe | undefined; + k3?: AnyResolvedKeyframe | undefined; + k4?: AnyResolvedKeyframe | undefined; + k?: AnyResolvedKeyframe | undefined; + kernelMatrix?: AnyResolvedKeyframe | undefined; + kernelUnitLength?: AnyResolvedKeyframe | undefined; + kerning?: AnyResolvedKeyframe | undefined; + keyPoints?: AnyResolvedKeyframe | undefined; + keySplines?: AnyResolvedKeyframe | undefined; + keyTimes?: AnyResolvedKeyframe | undefined; + lengthAdjust?: AnyResolvedKeyframe | undefined; + letterSpacing?: AnyResolvedKeyframe | undefined; + lightingColor?: AnyResolvedKeyframe | undefined; + limitingConeAngle?: AnyResolvedKeyframe | undefined; + local?: AnyResolvedKeyframe | undefined; + markerEnd?: string | undefined; + markerHeight?: AnyResolvedKeyframe | undefined; + markerMid?: string | undefined; + markerStart?: string | undefined; + markerUnits?: AnyResolvedKeyframe | undefined; + markerWidth?: AnyResolvedKeyframe | undefined; + mask?: string | undefined; + maskContentUnits?: AnyResolvedKeyframe | undefined; + maskUnits?: AnyResolvedKeyframe | undefined; + mathematical?: AnyResolvedKeyframe | undefined; + mode?: AnyResolvedKeyframe | undefined; + numOctaves?: AnyResolvedKeyframe | undefined; + offset?: AnyResolvedKeyframe | undefined; + opacity?: AnyResolvedKeyframe | undefined; + operator?: AnyResolvedKeyframe | undefined; + order?: AnyResolvedKeyframe | undefined; + orient?: AnyResolvedKeyframe | undefined; + orientation?: AnyResolvedKeyframe | undefined; + origin?: AnyResolvedKeyframe | undefined; + overflow?: AnyResolvedKeyframe | undefined; + overlinePosition?: AnyResolvedKeyframe | undefined; + overlineThickness?: AnyResolvedKeyframe | undefined; + paintOrder?: AnyResolvedKeyframe | undefined; + panose1?: AnyResolvedKeyframe | undefined; + path?: string | undefined; + pathLength?: AnyResolvedKeyframe | undefined; + patternContentUnits?: string | undefined; + patternTransform?: AnyResolvedKeyframe | undefined; + patternUnits?: string | undefined; + pointerEvents?: AnyResolvedKeyframe | undefined; + points?: string | undefined; + pointsAtX?: AnyResolvedKeyframe | undefined; + pointsAtY?: AnyResolvedKeyframe | undefined; + pointsAtZ?: AnyResolvedKeyframe | undefined; + preserveAlpha?: boolean | undefined; + preserveAspectRatio?: string | undefined; + primitiveUnits?: AnyResolvedKeyframe | undefined; + r?: AnyResolvedKeyframe | undefined; + radius?: AnyResolvedKeyframe | undefined; + refX?: AnyResolvedKeyframe | undefined; + refY?: AnyResolvedKeyframe | undefined; + renderingIntent?: AnyResolvedKeyframe | undefined; + repeatCount?: AnyResolvedKeyframe | undefined; + repeatDur?: AnyResolvedKeyframe | undefined; + requiredExtensions?: AnyResolvedKeyframe | undefined; + requiredFeatures?: AnyResolvedKeyframe | undefined; + restart?: AnyResolvedKeyframe | undefined; + result?: string | undefined; + rotate?: AnyResolvedKeyframe | undefined; + rx?: AnyResolvedKeyframe | undefined; + ry?: AnyResolvedKeyframe | undefined; + scale?: AnyResolvedKeyframe | undefined; + seed?: AnyResolvedKeyframe | undefined; + shapeRendering?: AnyResolvedKeyframe | undefined; + slope?: AnyResolvedKeyframe | undefined; + spacing?: AnyResolvedKeyframe | undefined; + specularConstant?: AnyResolvedKeyframe | undefined; + specularExponent?: AnyResolvedKeyframe | undefined; + speed?: AnyResolvedKeyframe | undefined; + spreadMethod?: string | undefined; + startOffset?: AnyResolvedKeyframe | undefined; + stdDeviation?: AnyResolvedKeyframe | undefined; + stemh?: AnyResolvedKeyframe | undefined; + stemv?: AnyResolvedKeyframe | undefined; + stitchTiles?: AnyResolvedKeyframe | undefined; + stopColor?: string | undefined; + stopOpacity?: AnyResolvedKeyframe | undefined; + strikethroughPosition?: AnyResolvedKeyframe | undefined; + strikethroughThickness?: AnyResolvedKeyframe | undefined; + string?: AnyResolvedKeyframe | undefined; + stroke?: string | undefined; + strokeDasharray?: AnyResolvedKeyframe | undefined; + strokeDashoffset?: AnyResolvedKeyframe | undefined; + strokeLinecap?: "butt" | "round" | "square" | "inherit" | undefined; + strokeLinejoin?: "miter" | "round" | "bevel" | "inherit" | undefined; + strokeMiterlimit?: AnyResolvedKeyframe | undefined; + strokeOpacity?: AnyResolvedKeyframe | undefined; + strokeWidth?: AnyResolvedKeyframe | undefined; + surfaceScale?: AnyResolvedKeyframe | undefined; + systemLanguage?: AnyResolvedKeyframe | undefined; + tableValues?: AnyResolvedKeyframe | undefined; + targetX?: AnyResolvedKeyframe | undefined; + targetY?: AnyResolvedKeyframe | undefined; + textAnchor?: string | undefined; + textDecoration?: AnyResolvedKeyframe | undefined; + textLength?: AnyResolvedKeyframe | undefined; + textRendering?: AnyResolvedKeyframe | undefined; + to?: AnyResolvedKeyframe | undefined; + transform?: string | undefined; + u1?: AnyResolvedKeyframe | undefined; + u2?: AnyResolvedKeyframe | undefined; + underlinePosition?: AnyResolvedKeyframe | undefined; + underlineThickness?: AnyResolvedKeyframe | undefined; + unicode?: AnyResolvedKeyframe | undefined; + unicodeBidi?: AnyResolvedKeyframe | undefined; + unicodeRange?: AnyResolvedKeyframe | undefined; + unitsPerEm?: AnyResolvedKeyframe | undefined; + vAlphabetic?: AnyResolvedKeyframe | undefined; + values?: string | undefined; + vectorEffect?: AnyResolvedKeyframe | undefined; + version?: string | undefined; + vertAdvY?: AnyResolvedKeyframe | undefined; + vertOriginX?: AnyResolvedKeyframe | undefined; + vertOriginY?: AnyResolvedKeyframe | undefined; + vHanging?: AnyResolvedKeyframe | undefined; + vIdeographic?: AnyResolvedKeyframe | undefined; + viewBox?: string | undefined; + viewTarget?: AnyResolvedKeyframe | undefined; + visibility?: AnyResolvedKeyframe | undefined; + vMathematical?: AnyResolvedKeyframe | undefined; + widths?: AnyResolvedKeyframe | undefined; + wordSpacing?: AnyResolvedKeyframe | undefined; + writingMode?: AnyResolvedKeyframe | undefined; + x1?: AnyResolvedKeyframe | undefined; + x2?: AnyResolvedKeyframe | undefined; + x?: AnyResolvedKeyframe | undefined; + xChannelSelector?: string | undefined; + xHeight?: AnyResolvedKeyframe | undefined; + xlinkActuate?: string | undefined; + xlinkArcrole?: string | undefined; + xlinkHref?: string | undefined; + xlinkRole?: string | undefined; + xlinkShow?: string | undefined; + xlinkTitle?: string | undefined; + xlinkType?: string | undefined; + xmlBase?: string | undefined; + xmlLang?: string | undefined; + xmlns?: string | undefined; + xmlnsXlink?: string | undefined; + xmlSpace?: string | undefined; + y1?: AnyResolvedKeyframe | undefined; + y2?: AnyResolvedKeyframe | undefined; + y?: AnyResolvedKeyframe | undefined; + yChannelSelector?: string | undefined; + z?: AnyResolvedKeyframe | undefined; + zoomAndPan?: string | undefined; +} + +interface VisualElementAnimationOptions { + delay?: number; + transitionOverride?: Transition; + custom?: any; + type?: AnimationType; +} + +interface AnimationState$1 { + animateChanges: (type?: AnimationType) => Promise; + setActive: (type: AnimationType, isActive: boolean, options?: VisualElementAnimationOptions) => Promise; + setAnimateFunction: (fn: any) => void; + getState: () => { + [key: string]: AnimationTypeState; + }; + reset: () => void; +} +type AnimationList = string[] | TargetAndTransition[]; +declare function createAnimationState(visualElement: any): AnimationState$1; +declare function checkVariantsDidChange(prev: any, next: any): boolean; +interface AnimationTypeState { + isActive: boolean; + protectedKeys: { + [key: string]: true; + }; + needsAnimating: { + [key: string]: boolean; + }; + prevResolvedValues: { + [key: string]: any; + }; + prevProp?: VariantLabels | TargetAndTransition; +} + +/** + * Set feature definitions for all VisualElements. + * This should be called by the framework layer (e.g., framer-motion) during initialization. + */ +declare function setFeatureDefinitions(definitions: Partial): void; +/** + * Get the current feature definitions + */ +declare function getFeatureDefinitions(): Partial; +/** + * Motion style type - a subset of CSS properties that can contain motion values + */ +type MotionStyle = { + [K: string]: AnyResolvedKeyframe | MotionValue | undefined; +}; +/** + * A VisualElement is an imperative abstraction around UI elements such as + * HTMLElement, SVGElement, Three.Object3D etc. + */ +declare abstract class VisualElement { + /** + * VisualElements are arranged in trees mirroring that of the React tree. + * Each type of VisualElement has a unique name, to detect when we're crossing + * type boundaries within that tree. + */ + abstract type: string; + /** + * An `Array.sort` compatible function that will compare two Instances and + * compare their respective positions within the tree. + */ + abstract sortInstanceNodePosition(a: Instance, b: Instance): number; + /** + * Measure the viewport-relative bounding box of the Instance. + */ + abstract measureInstanceViewportBox(instance: Instance, props: MotionNodeOptions & Partial): Box; + /** + * When a value has been removed from all animation props we need to + * pick a target to animate back to. For instance, for HTMLElements + * we can look in the style prop. + */ + abstract getBaseTargetFromProps(props: MotionNodeOptions, key: string): AnyResolvedKeyframe | undefined | MotionValue; + /** + * When we first animate to a value we need to animate it *from* a value. + * Often this have been specified via the initial prop but it might be + * that the value needs to be read from the Instance. + */ + abstract readValueFromInstance(instance: Instance, key: string, options: Options): AnyResolvedKeyframe | null | undefined; + /** + * When a value has been removed from the VisualElement we use this to remove + * it from the inherting class' unique render state. + */ + abstract removeValueFromRenderState(key: string, renderState: RenderState): void; + /** + * Run before a React or VisualElement render, builds the latest motion + * values into an Instance-specific format. For example, HTMLVisualElement + * will use this step to build `style` and `var` values. + */ + abstract build(renderState: RenderState, latestValues: ResolvedValues$1, props: MotionNodeOptions): void; + /** + * Apply the built values to the Instance. For example, HTMLElements will have + * styles applied via `setProperty` and the style attribute, whereas SVGElements + * will have values applied to attributes. + */ + abstract renderInstance(instance: Instance, renderState: RenderState, styleProp?: MotionStyle, projection?: any): void; + /** + * This method is called when a transform property is bound to a motion value. + * It's currently used to measure SVG elements when a new transform property is bound. + */ + onBindTransform?(): void; + /** + * If the component child is provided as a motion value, handle subscriptions + * with the renderer-specific VisualElement. + */ + handleChildMotionValue?(): void; + /** + * This method takes React props and returns found MotionValues. For example, HTML + * MotionValues will be found within the style prop, whereas for Three.js within attribute arrays. + * + * This isn't an abstract method as it needs calling in the constructor, but it is + * intended to be one. + */ + scrapeMotionValuesFromProps(_props: MotionNodeOptions, _prevProps: MotionNodeOptions, _visualElement: VisualElement): { + [key: string]: MotionValue | AnyResolvedKeyframe; + }; + /** + * A reference to the current underlying Instance, e.g. a HTMLElement + * or Three.Mesh etc. + */ + current: Instance | null; + /** + * A reference to the parent VisualElement (if exists). + */ + parent: VisualElement | undefined; + /** + * A set containing references to this VisualElement's children. + */ + children: Set>; + /** + * A set containing the latest children of this VisualElement. This is flushed + * at the start of every commit. We use it to calculate the stagger delay + * for newly-added children. + */ + enteringChildren?: Set; + /** + * The depth of this VisualElement within the overall VisualElement tree. + */ + depth: number; + /** + * The current render state of this VisualElement. Defined by inherting VisualElements. + */ + renderState: RenderState; + /** + * An object containing the latest static values for each of this VisualElement's + * MotionValues. + */ + latestValues: ResolvedValues$1; + /** + * Determine what role this visual element should take in the variant tree. + */ + isVariantNode: boolean; + isControllingVariants: boolean; + /** + * If this component is part of the variant tree, it should track + * any children that are also part of the tree. This is essentially + * a shadow tree to simplify logic around how to stagger over children. + */ + variantChildren?: Set; + /** + * Decides whether this VisualElement should animate in reduced motion + * mode. + * + * TODO: This is currently set on every individual VisualElement but feels + * like it could be set globally. + */ + shouldReduceMotion: boolean | null; + /** + * Decides whether animations should be skipped for this VisualElement. + * Useful for E2E tests and visual regression testing. + */ + shouldSkipAnimations: boolean; + /** + * Normally, if a component is controlled by a parent's variants, it can + * rely on that ancestor to trigger animations further down the tree. + * However, if a component is created after its parent is mounted, the parent + * won't trigger that mount animation so the child needs to. + * + * TODO: This might be better replaced with a method isParentMounted + */ + manuallyAnimateOnMount: boolean; + /** + * This can be set by AnimatePresence to force components that mount + * at the same time as it to mount as if they have initial={false} set. + */ + blockInitialAnimation: boolean; + /** + * A reference to this VisualElement's projection node, used in layout animations. + */ + projection?: any; + /** + * A map of all motion values attached to this visual element. Motion + * values are source of truth for any given animated value. A motion + * value might be provided externally by the component via props. + */ + values: Map>; + /** + * The AnimationState, this is hydrated by the animation Feature. + */ + animationState?: AnimationState$1; + KeyframeResolver: typeof KeyframeResolver; + /** + * The options used to create this VisualElement. The Options type is defined + * by the inheriting VisualElement and is passed straight through to the render functions. + */ + readonly options: Options; + /** + * A reference to the latest props provided to the VisualElement's host React component. + */ + props: MotionNodeOptions; + prevProps?: MotionNodeOptions; + presenceContext: PresenceContextProps | null; + prevPresenceContext?: PresenceContextProps | null; + /** + * Cleanup functions for active features (hover/tap/exit etc) + */ + private features; + /** + * A map of every subscription that binds the provided or generated + * motion values onChange listeners to this visual element. + */ + private valueSubscriptions; + /** + * A reference to the ReducedMotionConfig passed to the VisualElement's host React component. + */ + private reducedMotionConfig; + /** + * A reference to the skipAnimations config passed to the VisualElement's host React component. + */ + private skipAnimationsConfig; + /** + * On mount, this will be hydrated with a callback to disconnect + * this visual element from its parent on unmount. + */ + private removeFromVariantTree; + /** + * A reference to the previously-provided motion values as returned + * from scrapeMotionValuesFromProps. We use the keys in here to determine + * if any motion values need to be removed after props are updated. + */ + private prevMotionValues; + /** + * When values are removed from all animation props we need to search + * for a fallback value to animate to. These values are tracked in baseTarget. + */ + private baseTarget; + /** + * Create an object of the values we initially animated from (if initial prop present). + */ + private initialValues; + /** + * Track whether this element has been mounted before, to detect + * remounts after Suspense unmount/remount cycles. + */ + private hasBeenMounted; + /** + * An object containing a SubscriptionManager for each active event. + */ + private events; + /** + * An object containing an unsubscribe function for each prop event subscription. + * For example, every "Update" event can have multiple subscribers via + * VisualElement.on(), but only one of those can be defined via the onUpdate prop. + */ + private propEventSubscriptions; + constructor({ parent, props, presenceContext, reducedMotionConfig, skipAnimations, blockInitialAnimation, visualState, }: VisualElementOptions, options?: Options); + mount(instance: Instance): void; + unmount(): void; + addChild(child: VisualElement): void; + removeChild(child: VisualElement): void; + private bindToMotionValue; + sortNodePosition(other: VisualElement): number; + updateFeatures(): void; + notifyUpdate: () => void; + triggerBuild(): void; + render: () => void; + private renderScheduledAt; + scheduleRender: () => void; + /** + * Measure the current viewport box with or without transforms. + * Only measures axis-aligned boxes, rotate and skew must be manually + * removed with a re-render to work. + */ + measureViewportBox(): Box; + getStaticValue(key: string): AnyResolvedKeyframe; + setStaticValue(key: string, value: AnyResolvedKeyframe): void; + /** + * Update the provided props. Ensure any newly-added motion values are + * added to our map, old ones removed, and listeners updated. + */ + update(props: MotionNodeOptions, presenceContext: PresenceContextProps | null): void; + getProps(): MotionNodeOptions; + /** + * Returns the variant definition with a given name. + */ + getVariant(name: string): Variant | undefined; + /** + * Returns the defined default transition on this component. + */ + getDefaultTransition(): Transition | undefined; + getTransformPagePoint(): any; + getClosestVariantNode(): VisualElement | undefined; + /** + * Add a child visual element to our set of children. + */ + addVariantChild(child: VisualElement): (() => boolean) | undefined; + /** + * Add a motion value and bind it to this visual element. + */ + addValue(key: string, value: MotionValue): void; + /** + * Remove a motion value and unbind any active subscriptions. + */ + removeValue(key: string): void; + /** + * Check whether we have a motion value for this key + */ + hasValue(key: string): boolean; + /** + * Get a motion value for this key. If called with a default + * value, we'll create one if none exists. + */ + getValue(key: string): MotionValue | undefined; + getValue(key: string, defaultValue: AnyResolvedKeyframe | null): MotionValue; + /** + * If we're trying to animate to a previously unencountered value, + * we need to check for it in our state and as a last resort read it + * directly from the instance (which might have performance implications). + */ + readValue(key: string, target?: AnyResolvedKeyframe | null): any; + /** + * Set the base target to later animate back to. This is currently + * only hydrated on creation and when we first read a value. + */ + setBaseTarget(key: string, value: AnyResolvedKeyframe): void; + /** + * Find the base target for a value thats been removed from all animation + * props. + */ + getBaseTarget(key: string): ResolvedValues$1[string] | undefined | null; + on(eventName: EventName, callback: VisualElementEventCallbacks[EventName]): VoidFunction; + notify(eventName: EventName, ...args: any): void; + scheduleRenderMicrotask(): void; +} + +/** + * An update function. It accepts a timestamp used to advance the animation. + */ +type Update$1 = (timestamp: number) => void; +/** + * Drivers accept a update function and call it at an interval. This interval + * could be a synchronous loop, a setInterval, or tied to the device's framerate. + */ +interface DriverControls { + start: (keepAlive?: boolean) => void; + stop: () => void; + now: () => number; +} +type Driver = (update: Update$1) => DriverControls; + +/** + * Temporary subset of VisualElement until VisualElement is + * moved to motion-dom + */ +interface WithRender { + render: () => void; + readValue: (name: string, keyframe: any) => any; + getValue: (name: string, defaultValue?: any) => any; + current?: HTMLElement | SVGElement; + measureViewportBox: () => Box; +} + +type AnyResolvedKeyframe = string | number; +interface ProgressTimeline { + currentTime: null | { + value: number; + }; + cancel?: VoidFunction; +} +interface ValueAnimationOptionsWithRenderContext extends ValueAnimationOptions { + KeyframeResolver?: typeof KeyframeResolver; + motionValue?: MotionValue; + element?: WithRender; +} +interface TimelineWithFallback { + timeline?: ProgressTimeline; + rangeStart?: string; + rangeEnd?: string; + observe: (animation: AnimationPlaybackControls) => VoidFunction; +} +/** + * Methods to control an animation. + */ +interface AnimationPlaybackControls { + /** + * The current time of the animation, in seconds. + */ + time: number; + /** + * The playback speed of the animation. + * 1 = normal speed, 2 = double speed, 0.5 = half speed. + */ + speed: number; + /** + * The start time of the animation, in milliseconds. + */ + startTime: number | null; + /** + * The state of the animation. + * + * This is currently for internal use only. + */ + state: AnimationPlayState; + duration: number; + /** + * The duration of the animation, including any delay. + */ + iterationDuration: number; + /** + * Stops the animation at its current state, and prevents it from + * resuming when the animation is played again. + */ + stop: () => void; + /** + * Plays the animation. + */ + play: () => void; + /** + * Pauses the animation. + */ + pause: () => void; + /** + * Completes the animation and applies the final state. + */ + complete: () => void; + /** + * Cancels the animation and applies the initial state. + */ + cancel: () => void; + /** + * Attaches a timeline to the animation, for instance the `ScrollTimeline`. + * + * This is currently for internal use only. + */ + attachTimeline: (timeline: TimelineWithFallback) => VoidFunction; + finished: Promise; +} +type AnimationPlaybackControlsWithThen = AnimationPlaybackControls & { + then: (onResolve: VoidFunction, onReject?: VoidFunction) => Promise; +}; +interface AnimationState { + value: V; + done: boolean; +} +interface KeyframeGenerator { + calculatedDuration: null | number; + next: (t: number) => AnimationState; + velocity?: (t: number) => number; + toString: () => string; +} +interface DOMValueAnimationOptions extends ValueAnimationTransition { + element: HTMLElement | SVGElement; + keyframes: ValueKeyframesDefinition; + name: string; + pseudoElement?: string; + allowFlatten?: boolean; +} +interface ValueAnimationOptions extends ValueAnimationTransition { + keyframes: V[]; + element?: any; + name?: string; + motionValue?: MotionValue; + from?: any; + isHandoff?: boolean; + allowFlatten?: boolean; + finalKeyframe?: V; +} +type GeneratorFactoryFunction = (options: ValueAnimationOptions) => KeyframeGenerator; +interface GeneratorFactory extends GeneratorFactoryFunction { + applyToOptions?: (options: Transition) => Transition; +} +type AnimationGeneratorName = "decay" | "spring" | "keyframes" | "tween" | "inertia"; +type AnimationGeneratorType = GeneratorFactory | AnimationGeneratorName | false; +interface AnimationPlaybackLifecycles { + onUpdate?: (latest: V) => void; + onPlay?: () => void; + onComplete?: () => void; + onRepeat?: () => void; + onStop?: () => void; +} +interface ValueAnimationTransition extends ValueTransition, AnimationPlaybackLifecycles { + isSync?: boolean; +} +type RepeatType = "loop" | "reverse" | "mirror"; +interface AnimationPlaybackOptions { + /** + * The number of times to repeat the transition. Set to `Infinity` for perpetual repeating. + * + * Without setting `repeatType`, this will loop the animation. + * + * @public + */ + repeat?: number; + /** + * How to repeat the animation. This can be either: + * + * "loop": Repeats the animation from the start + * + * "reverse": Alternates between forward and backwards playback + * + * "mirror": Switches `from` and `to` alternately + * + * @public + */ + repeatType?: RepeatType; + /** + * When repeating an animation, `repeatDelay` will set the + * duration of the time to wait, in seconds, between each repetition. + * + * @public + */ + repeatDelay?: number; +} +interface VelocityOptions { + velocity?: number; + /** + * End animation if absolute speed (in units per second) drops below this + * value and delta is smaller than `restDelta`. Set to `0.01` by default. + * + * @public + */ + restSpeed?: number; + /** + * End animation if distance is below this value and speed is below + * `restSpeed`. When animation ends, spring gets "snapped" to. Set to + * `0.01` by default. + * + * @public + */ + restDelta?: number; +} +interface DurationSpringOptions { + /** + * The total duration of the animation. Set to `0.3` by default. + * + * @public + */ + duration?: number; + /** + * If visualDuration is set, this will override duration. + * + * The visual duration is a time, set in seconds, that the animation will take to visually appear to reach its target. + * + * In other words, the bulk of the transition will occur before this time, and the "bouncy bit" will mostly happen after. + * + * This makes it easier to edit a spring, as well as visually coordinate it with other time-based animations. + * + * @public + */ + visualDuration?: number; + /** + * `bounce` determines the "bounciness" of a spring animation. + * + * `0` is no bounce, and `1` is extremely bouncy. + * + * If `duration` is set, this defaults to `0.25`. + * + * Note: `bounce` and `duration` will be overridden if `stiffness`, `damping` or `mass` are set. + * + * @public + */ + bounce?: number; +} +interface SpringOptions extends DurationSpringOptions, VelocityOptions { + /** + * Stiffness of the spring. Higher values will create more sudden movement. + * Set to `100` by default. + * + * @default 100 + * + * @public + */ + stiffness?: number; + /** + * Strength of opposing force. If set to 0, spring will oscillate + * indefinitely. Set to `10` by default. + * + * @default 10 + * + * @public + */ + damping?: number; + /** + * Mass of the moving object. Higher values will result in more lethargic + * movement. Set to `1` by default. + * + * @default 1 + * + * @public + */ + mass?: number; +} +/** + * @deprecated Use SpringOptions instead + */ +interface Spring extends SpringOptions { +} +interface DecayOptions extends VelocityOptions { + keyframes?: number[]; + /** + * A higher power value equals a further target. Set to `0.8` by default. + * + * @public + */ + power?: number; + /** + * Adjusting the time constant will change the duration of the + * deceleration, thereby affecting its feel. Set to `700` by default. + * + * @public + */ + timeConstant?: number; + /** + * A function that receives the automatically-calculated target and returns a new one. Useful for snapping the target to a grid. + * + * @public + */ + modifyTarget?: (v: number) => number; +} +interface InertiaOptions extends DecayOptions { + /** + * If `min` or `max` is set, this affects the stiffness of the bounce + * spring. Higher values will create more sudden movement. Set to `500` by + * default. + * + * @public + */ + bounceStiffness?: number; + /** + * If `min` or `max` is set, this affects the damping of the bounce spring. + * If set to `0`, spring will oscillate indefinitely. Set to `10` by + * default. + * + * @public + */ + bounceDamping?: number; + /** + * Minimum constraint. If set, the value will "bump" against this value (or immediately spring to it if the animation starts as less than this value). + * + * @public + */ + min?: number; + /** + * Maximum constraint. If set, the value will "bump" against this value (or immediately snap to it, if the initial animation value exceeds this value). + * + * @public + */ + max?: number; +} +interface AnimationOrchestrationOptions { + /** + * Delay the animation by this duration (in seconds). Defaults to `0`. + * + * @public + */ + delay?: number; + /** + * Describes the relationship between the transition and its children. Set + * to `false` by default. + * + * @remarks + * When using variants, the transition can be scheduled in relation to its + * children with either `"beforeChildren"` to finish this transition before + * starting children transitions, `"afterChildren"` to finish children + * transitions before starting this transition. + * + * @public + */ + when?: false | "beforeChildren" | "afterChildren" | string; + /** + * When using variants, children animations will start after this duration + * (in seconds). You can add the `transition` property to both the `motion.div` and the + * `variant` directly. Adding it to the `variant` generally offers more flexibility, + * as it allows you to customize the delay per visual state. + * + * @public + */ + delayChildren?: number | DynamicOption; + /** + * When using variants, animations of child components can be staggered by this + * duration (in seconds). + * + * For instance, if `staggerChildren` is `0.01`, the first child will be + * delayed by `0` seconds, the second by `0.01`, the third by `0.02` and so + * on. + * + * The calculated stagger delay will be added to `delayChildren`. + * + * @deprecated - Use `delayChildren: stagger(interval)` instead. + */ + staggerChildren?: number; + /** + * The direction in which to stagger children. + * + * A value of `1` staggers from the first to the last while `-1` + * staggers from the last to the first. + * + * @deprecated - Use `delayChildren: stagger(interval, { from: "last" })` instead. + */ + staggerDirection?: number; +} +interface KeyframeOptions { + /** + * The total duration of the animation. Set to `0.3` by default. + * + * @public + */ + duration?: number; + ease?: Easing | Easing[]; + times?: number[]; +} +interface ValueTransition extends AnimationOrchestrationOptions, AnimationPlaybackOptions, Omit, Omit, KeyframeOptions { + /** + * Delay the animation by this duration (in seconds). Defaults to `0`. + * + * @public + */ + delay?: number; + /** + * The duration of time already elapsed in the animation. Set to `0` by + * default. + */ + elapsed?: number; + driver?: Driver; + /** + * Type of animation to use. + * + * - "tween": Duration-based animation with ease curve + * - "spring": Physics or duration-based spring animation + * - false: Use an instant animation + */ + type?: AnimationGeneratorType; + /** + * The duration of the tween animation. Set to `0.3` by default, 0r `0.8` if animating a series of keyframes. + * + * @public + */ + duration?: number; + autoplay?: boolean; + startTime?: number; + from?: any; + /** + * If true, this transition will shallow-merge with its parent transition + * instead of replacing it. Inner keys win. + * + * @public + */ + inherit?: boolean; + /** + * If true, the animation skips straight to its final value instead of + * tweening. Used by `MotionConfig`'s `skipAnimations` to opt entire + * subtrees out of animation (e.g. for E2E screenshot stability). + * + * @public + */ + skipAnimations?: boolean; + /** + * The path the element travels between its old and new x/y positions. + * Slot in a path factory (e.g. `arc()`) to swap the default + * straight-line interpolation for something curved. + * + * Can be used in keyframe animations (`transition.path`) and layout + * animations (`transition.layout.path`), including with `useAnimate`. + * + * @public + */ + path?: MotionPath; +} +/** + * @deprecated Use KeyframeOptions instead + */ +interface Tween extends KeyframeOptions { +} +type SVGForcedAttrTransitions = { + [K in keyof SVGForcedAttrProperties]: ValueTransition; +}; +type SVGPathTransitions = { + [K in keyof SVGPathProperties]: ValueTransition; +}; +type SVGTransitions = { + [K in keyof Omit]: ValueTransition; +}; +interface VariableTransitions { + [key: `--${string}`]: ValueTransition; +} +type StyleTransitions = { + [K in keyof CSSStyleDeclarationWithTransform]?: ValueTransition; +}; +type ValueKeyframe = T; +type UnresolvedValueKeyframe = ValueKeyframe | null; +type ResolvedValueKeyframe = ValueKeyframe | ValueKeyframe[]; +type ValueKeyframesDefinition = ValueKeyframe | ValueKeyframe[] | UnresolvedValueKeyframe[]; +type StyleKeyframesDefinition = { + [K in keyof CSSStyleDeclarationWithTransform]?: ValueKeyframesDefinition; +}; +type SVGKeyframesDefinition = { + [K in keyof Omit]?: ValueKeyframesDefinition; +}; +interface VariableKeyframesDefinition { + [key: `--${string}`]: ValueKeyframesDefinition; +} +type SVGForcedAttrKeyframesDefinition = { + [K in keyof SVGForcedAttrProperties]?: ValueKeyframesDefinition; +}; +type SVGPathKeyframesDefinition = { + [K in keyof SVGPathProperties]?: ValueKeyframesDefinition; +}; +type DOMKeyframesDefinition = StyleKeyframesDefinition & SVGKeyframesDefinition & SVGPathKeyframesDefinition & SVGForcedAttrKeyframesDefinition & VariableKeyframesDefinition; +interface Target extends DOMKeyframesDefinition { +} +type CSSPropertyKeys = { + [K in keyof CSSStyleDeclaration as K extends string ? CSSStyleDeclaration[K] extends AnyResolvedKeyframe ? K : never : never]: CSSStyleDeclaration[K]; +}; +interface CSSStyleDeclarationWithTransform extends Omit { + x: number | string; + y: number | string; + z: number | string; + originX: number; + originY: number; + originZ: number; + translateX: number | string; + translateY: number | string; + translateZ: number | string; + rotateX: number | string; + rotateY: number | string; + rotateZ: number | string; + scaleX: number; + scaleY: number; + scaleZ: number; + skewX: number | string; + skewY: number | string; + transformPerspective: number; +} +type TransitionWithValueOverrides = ValueAnimationTransition & StyleTransitions & SVGPathTransitions & SVGForcedAttrTransitions & SVGTransitions & VariableTransitions & { + default?: ValueTransition; + layout?: ValueTransition; +}; +type Transition = ValueAnimationTransition | TransitionWithValueOverrides; +interface Point2D { + x: number; + y: number; +} +interface PathState { + x: number; + y: number; + /** + * Optional rotation in degrees. If returned, the engine will apply it + * to the element's `rotate` value for the duration of the animation. + */ + rotate?: number; +} +/** + * Sampling function — returns position (and optionally rotation) at + * progress `t` (0–1). + */ +interface PathInterpolator { + (t: number): PathState; +} +/** + * Returned by a path factory such as `arc()` and passed to `transition.path`. + * Implements both the keyframe-animation hook (`animateVisualElement`) and + * the layout-projection hook (`interpolateProjection`). + */ +interface MotionPath { + animateVisualElement(visualElement: VisualElement, target: TargetAndTransition, transition: Transition | undefined, delay: number, animations: AnimationPlaybackControlsWithThen[]): void; + interpolateProjection(delta: Delta): PathInterpolator | undefined; +} +type DynamicOption = (i: number, total: number) => T; +type ValueAnimationWithDynamicDelay = Omit, "delay"> & { + delay?: number | DynamicOption; +}; +interface ReduceMotionOption { + /** + * Whether to reduce motion for transform/layout animations. + * + * - `true`: Skip transform/layout animations (instant transition) + * - `false`: Always animate transforms/layout + * - `undefined`: Use device preference (default behavior) + */ + reduceMotion?: boolean; +} +type AnimationOptions = (ValueAnimationWithDynamicDelay & ReduceMotionOption) | (ValueAnimationWithDynamicDelay & ReduceMotionOption & StyleTransitions & SVGPathTransitions & SVGForcedAttrTransitions & SVGTransitions & VariableTransitions & { + default?: ValueTransition; + layout?: ValueTransition; +}); +interface TransformProperties { + x?: AnyResolvedKeyframe; + y?: AnyResolvedKeyframe; + z?: AnyResolvedKeyframe; + translateX?: AnyResolvedKeyframe; + translateY?: AnyResolvedKeyframe; + translateZ?: AnyResolvedKeyframe; + rotate?: AnyResolvedKeyframe; + rotateX?: AnyResolvedKeyframe; + rotateY?: AnyResolvedKeyframe; + rotateZ?: AnyResolvedKeyframe; + scale?: AnyResolvedKeyframe; + scaleX?: AnyResolvedKeyframe; + scaleY?: AnyResolvedKeyframe; + scaleZ?: AnyResolvedKeyframe; + skew?: AnyResolvedKeyframe; + skewX?: AnyResolvedKeyframe; + skewY?: AnyResolvedKeyframe; + originX?: AnyResolvedKeyframe; + originY?: AnyResolvedKeyframe; + originZ?: AnyResolvedKeyframe; + perspective?: AnyResolvedKeyframe; + transformPerspective?: AnyResolvedKeyframe; +} +interface SVGForcedAttrProperties { + attrX?: number; + attrY?: number; + attrScale?: number; +} +interface SVGPathProperties { + pathLength?: number; + pathOffset?: number; + pathSpacing?: number; +} + +/** + * @public + */ +type Subscriber = (v: T) => void; +/** + * @public + */ +type PassiveEffect = (v: T, safeSetter: (v: T) => void) => void; +type StartAnimation = (complete: () => void) => AnimationPlaybackControlsWithThen | undefined; +interface MotionValueEventCallbacks { + animationStart: () => void; + animationComplete: () => void; + animationCancel: () => void; + change: (latestValue: V) => void; + destroy: () => void; +} +interface ResolvedValues { + [key: string]: AnyResolvedKeyframe; +} +interface Owner { + current: HTMLElement | unknown; + getProps: () => { + onUpdate?: (latest: ResolvedValues) => void; + transformTemplate?: (transform: TransformProperties, generatedTransform: string) => string; + }; +} +interface AccelerateConfig { + factory: (animation: AnimationPlaybackControlsWithThen) => VoidFunction; + times: number[]; + keyframes: any[]; + ease?: EasingFunction | EasingFunction[]; + duration: number; + isTransformed?: boolean; +} +interface MotionValueOptions { + owner?: Owner; +} +declare const collectMotionValues: { + current: MotionValue[] | undefined; +}; +/** + * `MotionValue` is used to track the state and velocity of motion values. + * + * @public + */ +declare class MotionValue { + /** + * If a MotionValue has an owner, it was created internally within Motion + * and therefore has no external listeners. It is therefore safe to animate via WAAPI. + */ + owner?: Owner; + /** + * The current state of the `MotionValue`. + */ + private current; + /** + * The previous state of the `MotionValue`. + */ + private prev; + /** + * The previous state of the `MotionValue` at the end of the previous frame. + */ + private prevFrameValue; + /** + * The last time the `MotionValue` was updated. + */ + updatedAt: number; + /** + * The time `prevFrameValue` was updated. + */ + prevUpdatedAt: number | undefined; + private stopPassiveEffect?; + /** + * Whether the passive effect is active. + */ + isEffectActive?: boolean; + /** + * A reference to the currently-controlling animation. + */ + animation?: AnimationPlaybackControlsWithThen; + /** + * A list of MotionValues whose values are computed from this one. + * This is a rough start to a proper signal-like dirtying system. + */ + private dependents; + /** + * Tracks whether this value should be removed + */ + liveStyle?: boolean; + /** + * Scroll timeline acceleration metadata. When set, VisualElement + * can create a native WAAPI animation attached to a scroll timeline + * instead of driving updates through JS. + */ + accelerate?: AccelerateConfig; + /** + * @param init - The initiating value + * @param config - Optional configuration options + * + * - `transformer`: A function to transform incoming values with. + */ + constructor(init: V, options?: MotionValueOptions); + setCurrent(current: V): void; + setPrevFrameValue(prevFrameValue?: V | undefined): void; + /** + * Adds a function that will be notified when the `MotionValue` is updated. + * + * It returns a function that, when called, will cancel the subscription. + * + * When calling `onChange` inside a React component, it should be wrapped with the + * `useEffect` hook. As it returns an unsubscribe function, this should be returned + * from the `useEffect` function to ensure you don't add duplicate subscribers.. + * + * ```jsx + * export const MyComponent = () => { + * const x = useMotionValue(0) + * const y = useMotionValue(0) + * const opacity = useMotionValue(1) + * + * useEffect(() => { + * function updateOpacity() { + * const maxXY = Math.max(x.get(), y.get()) + * const newOpacity = transform(maxXY, [0, 100], [1, 0]) + * opacity.set(newOpacity) + * } + * + * const unsubscribeX = x.on("change", updateOpacity) + * const unsubscribeY = y.on("change", updateOpacity) + * + * return () => { + * unsubscribeX() + * unsubscribeY() + * } + * }, []) + * + * return + * } + * ``` + * + * @param subscriber - A function that receives the latest value. + * @returns A function that, when called, will cancel this subscription. + * + * @deprecated + */ + onChange(subscription: Subscriber): () => void; + /** + * An object containing a SubscriptionManager for each active event. + */ + private events; + on>(eventName: EventName, callback: MotionValueEventCallbacks[EventName]): VoidFunction; + clearListeners(): void; + /** + * Attaches a passive effect to the `MotionValue`. + */ + attach(passiveEffect: PassiveEffect, stopPassiveEffect: VoidFunction): void; + /** + * Sets the state of the `MotionValue`. + * + * @remarks + * + * ```jsx + * const x = useMotionValue(0) + * x.set(10) + * ``` + * + * @param latest - Latest value to set. + * @param render - Whether to notify render subscribers. Defaults to `true` + * + * @public + */ + set(v: V): void; + setWithVelocity(prev: V, current: V, delta: number): void; + /** + * Set the state of the `MotionValue`, stopping any active animations, + * effects, and resets velocity to `0`. + */ + jump(v: V, endAnimation?: boolean): void; + dirty(): void; + addDependent(dependent: MotionValue): void; + removeDependent(dependent: MotionValue): void; + updateAndNotify: (v: V) => void; + /** + * Returns the latest state of `MotionValue` + * + * @returns - The latest state of `MotionValue` + * + * @public + */ + get(): NonNullable; + /** + * @public + */ + getPrevious(): V | undefined; + /** + * Returns the latest velocity of `MotionValue` + * + * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical. + * + * @public + */ + getVelocity(): number; + hasAnimated: boolean; + /** + * Registers a new animation to control this `MotionValue`. Only one + * animation can drive a `MotionValue` at one time. + * + * ```jsx + * value.start() + * ``` + * + * @param animation - A function that starts the provided animation + */ + start(startAnimation: StartAnimation): Promise; + /** + * Stop the currently active animation. + * + * @public + */ + stop(): void; + /** + * Returns `true` if this value is currently animating. + * + * @public + */ + isAnimating(): boolean; + private clearAnimation; + /** + * Destroy and clean up subscribers to this `MotionValue`. + * + * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically + * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually + * created a `MotionValue` via the `motionValue` function. + * + * @public + */ + destroy(): void; +} +declare function motionValue(init: V, options?: MotionValueOptions): MotionValue; + +type UnresolvedKeyframes = Array; +type ResolvedKeyframes = Array; +declare function flushKeyframeResolvers(): void; +type OnKeyframesResolved = (resolvedKeyframes: ResolvedKeyframes, finalKeyframe: T, forced: boolean) => void; +declare class KeyframeResolver { + name?: string; + element?: WithRender; + finalKeyframe?: T; + suspendedScrollY?: number; + protected unresolvedKeyframes: UnresolvedKeyframes; + private motionValue?; + private onComplete; + state: "pending" | "scheduled" | "complete"; + /** + * Track whether this resolver is async. If it is, it'll be added to the + * resolver queue and flushed in the next frame. Resolvers that aren't going + * to trigger read/write thrashing don't need to be async. + */ + private isAsync; + /** + * Track whether this resolver needs to perform a measurement + * to resolve its keyframes. + */ + needsMeasurement: boolean; + constructor(unresolvedKeyframes: UnresolvedKeyframes, onComplete: OnKeyframesResolved, name?: string, motionValue?: MotionValue, element?: WithRender, isAsync?: boolean); + scheduleResolve(): void; + readKeyframes(): void; + setFinalKeyframe(): void; + measureInitialState(): void; + renderEndStyles(): void; + measureEndState(): void; + complete(isForcedComplete?: boolean): void; + cancel(): void; + resume(): void; +} + +declare class WithPromise { + protected _finished: Promise; + resolve: VoidFunction; + constructor(); + get finished(): Promise; + protected updateFinished(): void; + protected notifyFinished(): void; + /** + * Allows the animation to be awaited. + * + * @deprecated Use `finished` instead. + */ + then(onResolve: VoidFunction, onReject?: VoidFunction): Promise; +} + +type OptionsWithoutKeyframes = Omit, "keyframes">; +declare class AsyncMotionValueAnimation extends WithPromise implements AnimationPlaybackControls { + private createdAt; + private resolvedAt; + private _animation; + private pendingTimeline; + private keyframeResolver; + private stopTimeline; + constructor({ autoplay, delay, type, repeat, repeatDelay, repeatType, keyframes, name, motionValue, element, ...options }: ValueAnimationOptions); + onKeyframesResolved(keyframes: ResolvedKeyframes, finalKeyframe: T, options: OptionsWithoutKeyframes, sync: boolean): void; + get finished(): Promise; + then(onResolve: VoidFunction, _onReject?: VoidFunction): Promise; + get animation(): AnimationPlaybackControls; + get duration(): number; + get iterationDuration(): number; + get time(): number; + set time(newTime: number); + get speed(): number; + get state(): AnimationPlayState; + set speed(newSpeed: number); + get startTime(): number | null; + attachTimeline(timeline: TimelineWithFallback): () => void; + play(): void; + pause(): void; + complete(): void; + cancel(): void; + /** + * Bound to support return animation.stop pattern + */ + stop: () => void; +} + +type AcceptedAnimations = AnimationPlaybackControls; +type GroupedAnimations = AcceptedAnimations[]; +declare class GroupAnimation implements AnimationPlaybackControls { + animations: GroupedAnimations; + constructor(animations: Array); + get finished(): Promise; + /** + * TODO: Filter out cancelled or stopped animations before returning + */ + private getAll; + private setAll; + attachTimeline(timeline: TimelineWithFallback): () => void; + get time(): number; + set time(time: number); + get speed(): number; + set speed(speed: number); + get state(): any; + get startTime(): any; + get duration(): number; + get iterationDuration(): number; + private runAll; + play(): void; + pause(): void; + stop: () => void; + cancel(): void; + complete(): void; +} + +declare class GroupAnimationWithThen extends GroupAnimation implements AnimationPlaybackControlsWithThen { + then(onResolve: VoidFunction, _onReject?: VoidFunction): Promise; +} + +declare class JSAnimation extends WithPromise implements AnimationPlaybackControlsWithThen { + state: AnimationPlayState; + startTime: number | null; + /** + * The driver that's controlling the animation loop. Normally this is a requestAnimationFrame loop + * but in tests we can pass in a synchronous loop. + */ + private driver?; + private isStopped; + private generator; + private calculatedDuration; + private resolvedDuration; + private totalDuration; + private options; + /** + * The current time of the animation. + */ + private currentTime; + /** + * The time at which the animation was paused. + */ + private holdTime; + /** + * Playback speed as a factor. 0 would be stopped, -1 reverse and 2 double speed. + */ + private playbackSpeed; + private mixKeyframes; + private mirroredGenerator; + /** + * Reusable state object for the delay phase to avoid + * allocating a new object every frame. + */ + private delayState; + constructor(options: ValueAnimationOptions); + initAnimation(): void; + updateTime(timestamp: number): void; + tick(timestamp: number, sample?: boolean): AnimationState; + /** + * Allows the returned animation to be awaited or promise-chained. Currently + * resolves when the animation finishes at all but in a future update could/should + * reject if its cancels. + */ + then(resolve: VoidFunction, reject?: VoidFunction): Promise; + get duration(): number; + get iterationDuration(): number; + get time(): number; + set time(newTime: number); + /** + * Returns the generator's velocity at the current time in units/second. + * Uses the analytical derivative when available (springs), avoiding + * the MotionValue's frame-dependent velocity estimation. + */ + getGeneratorVelocity(): number; + get speed(): number; + set speed(newSpeed: number); + play(): void; + pause(): void; + /** + * This method is bound to the instance to fix a pattern where + * animation.stop is returned as a reference from a useEffect. + */ + stop: () => void; + complete(): void; + finish(): void; + cancel(): void; + private teardown; + private stopDriver; + sample(sampleTime: number): AnimationState; + attachTimeline(timeline: TimelineWithFallback): VoidFunction; +} +declare function animateValue(options: ValueAnimationOptions): JSAnimation; + +interface NativeAnimationOptions extends DOMValueAnimationOptions { + pseudoElement?: string; + startTime?: number; +} +/** + * NativeAnimation implements AnimationPlaybackControls for the browser's Web Animations API. + */ +declare class NativeAnimation extends WithPromise implements AnimationPlaybackControlsWithThen { + /** + * The interfaced Web Animation API animation + */ + protected animation: Animation; + protected finishedTime: number | null; + protected options: NativeAnimationOptions; + private allowFlatten; + private isStopped; + private isPseudoElement; + /** + * Tracks a manually-set start time that takes precedence over WAAPI's + * dynamic startTime. This is cleared when play() or time setter is called, + * allowing WAAPI to take over timing. + */ + protected manualStartTime: number | null; + constructor(options?: NativeAnimationOptions); + updateMotionValue?(value?: T): void; + play(): void; + pause(): void; + complete(): void; + cancel(): void; + stop(): void; + /** + * WAAPI doesn't natively have any interruption capabilities. + * + * In this method, we commit styles back to the DOM before cancelling + * the animation. + * + * This is designed to be overridden by NativeAnimationExtended, which + * will create a renderless JS animation and sample it twice to calculate + * its current value, "previous" value, and therefore allow + * Motion to also correctly calculate velocity for any subsequent animation + * while deferring the commit until the next animation frame. + */ + protected commitStyles(): void; + get duration(): number; + get iterationDuration(): number; + get time(): number; + set time(newTime: number); + /** + * The playback speed of the animation. + * 1 = normal speed, 2 = double speed, 0.5 = half speed. + */ + get speed(): number; + set speed(newSpeed: number); + get state(): AnimationPlayState; + get startTime(): number; + set startTime(newStartTime: number); + /** + * Attaches a timeline to the animation, for instance the `ScrollTimeline`. + */ + attachTimeline({ timeline, rangeStart, rangeEnd, observe, }: TimelineWithFallback): VoidFunction; +} + +type NativeAnimationOptionsExtended = NativeAnimationOptions & ValueAnimationOptions & NativeAnimationOptions; +declare class NativeAnimationExtended extends NativeAnimation { + options: NativeAnimationOptionsExtended; + constructor(options: NativeAnimationOptionsExtended); + /** + * WAAPI doesn't natively have any interruption capabilities. + * + * Rather than read committed styles back out of the DOM, we can + * create a renderless JS animation and sample it twice to calculate + * its current value, "previous" value, and therefore allow + * Motion to calculate velocity for any subsequent animation. + */ + updateMotionValue(value?: T): void; +} + +declare class NativeAnimationWrapper extends NativeAnimation { + constructor(animation: Animation); +} + +declare const animationMapKey: (name: string, pseudoElement?: string) => string; +declare function getAnimationMap(element: Element): Map>; + +declare function calcChildStagger(children: Set, child: VisualElement, delayChildren?: number | DynamicOption, staggerChildren?: number, staggerDirection?: number): number; + +interface ArcOptions { + /** + * How far the arc bulges perpendicular to the straight-line path, + * as a fraction of the total distance. A value of `1` means the arc + * peaks at a height equal to the full travel distance. Default `0.5`. + */ + strength?: number; + /** + * Where along the path (0–1) the arc reaches its maximum height. + * Default `0.5` (symmetric). + */ + peak?: number; + /** + * Which side the arc bulges toward. + * - `"cw"` / `"ccw"` — locked relative to direction of travel + * - unset — auto-pick a stable screen-space side + */ + direction?: "cw" | "ccw"; + /** + * Rotates the element to follow the tangent of the arc path. + * - `true` — full tangent following (1.0) + * - number 0–1 — scale factor + */ + rotate?: boolean | number; +} +/** + * Creates a curved path for `transition.path`: + * + * ```ts + * + * ``` + * + * Reuse the returned value (module scope / useMemo / useRef) so its + * continuity closure survives re-renders — a fresh `arc()` has no memory. + */ +declare function arc(options?: ArcOptions): MotionPath; + +type CSSVariableName = `--${string}`; +type CSSVariableToken = `var(${CSSVariableName})`; +declare const isCSSVariableName: (key?: AnyResolvedKeyframe | null) => key is `--${string}`; +declare const isCSSVariableToken: (value?: string) => value is `var(--${string})`; +/** + * Check if a value contains a CSS variable anywhere (e.g. inside calc()). + * Unlike isCSSVariableToken which checks if the value IS a var() token, + * this checks if the value CONTAINS var() somewhere in the string. + */ +declare function containsCSSVariable(value?: AnyResolvedKeyframe | null): boolean; + +declare function parseCSSVariable(current: string): string[] | undefined[]; +declare function getVariableValue(current: CSSVariableToken, element: Element, depth?: number): AnyResolvedKeyframe | undefined; + +declare const getDefaultTransition: (valueKey: string, { keyframes }: ValueAnimationOptions) => Partial; + +declare function getFinalKeyframe(keyframes: T[], { repeat, repeatType }: AnimationPlaybackOptions, finalKeyframe?: T, speed?: number): T; + +declare function getValueTransition(transition: any, key: string): any; + +/** + * If `transition` has `inherit: true`, shallow-merge it with + * `parentTransition` (child keys win) and strip the `inherit` key. + * Otherwise return `transition` unchanged. + */ +declare function resolveTransition(transition: any, parentTransition?: any): any; + +/** + * Decide whether a transition is defined on a given Transition. + * This filters out orchestration options and returns true + * if any options are left. + */ +declare function isTransitionDefined(transition: Transition & { + elapsed?: number; + from?: AnyResolvedKeyframe; +}): boolean; + +declare function makeAnimationInstant(options: Partial<{ + duration: ValueAnimationOptions["duration"]; + type: ValueAnimationOptions["type"]; +}>): void; + +declare const animateMotionValue: (name: string, value: MotionValue, target: V | UnresolvedKeyframes, transition?: ValueTransition & { + elapsed?: number; +}, element?: VisualElement, isHandoff?: boolean) => StartAnimation; + +declare function animateVisualElement(visualElement: VisualElement, definition: AnimationDefinition, options?: VisualElementAnimationOptions): Promise; + +declare function animateTarget(visualElement: VisualElement, targetAndTransition: TargetAndTransition, { delay, transitionOverride, type }?: VisualElementAnimationOptions): AnimationPlaybackControlsWithThen[]; + +declare function animateVariant(visualElement: VisualElement, variant: string, options?: VisualElementAnimationOptions): Promise; + +declare const optimizedAppearDataId = "framerAppearId"; +declare const optimizedAppearDataAttribute: "data-framer-appear-id"; + +type Process = (data: FrameData) => void; +type Schedule = (process: Process, keepAlive?: boolean, immediate?: boolean) => Process; +interface Step { + schedule: Schedule; + cancel: (process: Process) => void; + process: (data: FrameData) => void; +} +type StepId = "setup" | "read" | "resolveKeyframes" | "preUpdate" | "update" | "preRender" | "render" | "postRender"; +type CancelProcess = (process: Process) => void; +type Batcher = { + [key in StepId]: Schedule; +}; +type Steps = { + [key in StepId]: Step; +}; +interface FrameData { + delta: number; + timestamp: number; + isProcessing: boolean; +} + +/** + * Expose only the needed part of the VisualElement interface to + * ensure React types don't end up in the generic DOM bundle. + */ +interface WithAppearProps { + props: { + [optimizedAppearDataAttribute]?: string; + values?: { + [key: string]: MotionValue | MotionValue; + }; + }; +} +type HandoffFunction = (storeId: string, valueName: string, frame: Batcher) => number | null; +/** + * The window global object acts as a bridge between our inline script + * triggering the optimized appear animations, and Motion. + */ +declare global { + interface Window { + MotionHandoffAnimation?: HandoffFunction; + MotionHandoffMarkAsComplete?: (elementId: string) => void; + MotionHandoffIsComplete?: (elementId: string) => boolean; + MotionHasOptimisedAnimation?: (elementId?: string, valueName?: string) => boolean; + MotionCancelOptimisedAnimation?: (elementId?: string, valueName?: string, frame?: Batcher, canResume?: boolean) => void; + MotionCheckAppearSync?: (visualElement: WithAppearProps, valueName: string, value: MotionValue) => VoidFunction | void; + MotionIsMounted?: boolean; + } +} + +declare function getOptimisedAppearId(visualElement: WithAppearProps): string | undefined; + +declare function inertia({ keyframes, velocity, power, timeConstant, bounceDamping, bounceStiffness, modifyTarget, min, max, restDelta, restSpeed, }: ValueAnimationOptions): KeyframeGenerator; + +declare function defaultEasing(values: any[], easing?: EasingFunction): EasingFunction[]; +declare function keyframes({ duration, keyframes: keyframeValues, times, ease, }: ValueAnimationOptions): KeyframeGenerator; + +declare function spring(optionsOrVisualDuration?: ValueAnimationOptions | number, bounce?: number): KeyframeGenerator; +declare namespace spring { + var applyToOptions: (options: Transition) => Transition; +} + +/** + * Implement a practical max duration for keyframe generation + * to prevent infinite loops + */ +declare const maxGeneratorDuration = 20000; +declare function calcGeneratorDuration(generator: KeyframeGenerator): number; + +/** + * Create a progress => progress easing function from a generator. + */ +declare function createGeneratorEasing(options: Transition, scale: number | undefined, createGenerator: GeneratorFactory): { + type: string; + ease: (progress: number) => number; + duration: number; +}; + +declare function isGenerator(type?: AnimationGeneratorType): type is GeneratorFactory; + +declare class DOMKeyframesResolver extends KeyframeResolver { + name: string; + element?: WithRender; + private removedTransforms?; + private measuredOrigin?; + constructor(unresolvedKeyframes: UnresolvedKeyframes, onComplete: OnKeyframesResolved, name?: string, motionValue?: MotionValue, element?: WithRender); + readKeyframes(): void; + resolveNoneKeyframes(): void; + measureInitialState(): void; + measureEndState(): void; +} + +declare function defaultOffset(arr: any[]): number[]; + +declare function fillOffset(offset: number[], remaining: number): void; + +declare function convertOffsetToTimes(offset: number[], duration: number): number[]; + +declare function applyPxDefaults(keyframes: ValueKeyframe[] | UnresolvedValueKeyframe[], name: string): void; + +declare function fillWildcards(keyframes: ValueKeyframe[] | UnresolvedValueKeyframe[]): void; + +declare const cubicBezierAsString: ([a, b, c, d]: BezierDefinition) => string; + +declare function isWaapiSupportedEasing(easing?: Easing | Easing[]): boolean; + +declare function mapEasingToNativeEasing(easing: Easing | Easing[] | undefined, duration: number): undefined | string | string[]; + +declare const supportedWaapiEasing: { + linear: string; + ease: string; + easeIn: string; + easeOut: string; + easeInOut: string; + circIn: string; + circOut: string; + backIn: string; + backOut: string; +}; + +declare function startWaapiAnimation(element: Element, valueName: string, keyframes: ValueKeyframesDefinition, { delay, duration, repeat, repeatType, ease, times, }?: ValueTransition, pseudoElement?: string | undefined): Animation; + +declare const supportsPartialKeyframes: () => boolean; + +declare function supportsBrowserAnimation(options: ValueAnimationOptionsWithRenderContext): any; + +/** + * A list of values that can be hardware-accelerated. + */ +declare const acceleratedValues: Set; + +declare function applyGeneratorOptions({ type, ...options }: ValueTransition): ValueTransition; + +declare const generateLinearEasing: (easing: EasingFunction, duration: number, resolution?: number) => string; + +declare class MotionValueState { + latest: { + [name: string]: AnyResolvedKeyframe; + }; + private values; + set(name: string, value: MotionValue, render?: VoidFunction, computed?: MotionValue, useDefaultValueType?: boolean): () => void; + get(name: string): MotionValue | undefined; +} + +declare const addAttrValue: (element: HTMLElement | SVGElement, state: MotionValueState, key: string, value: MotionValue) => () => void; +declare const attrEffect: (subject: ElementOrSelector, values: Record>) => () => void; + +declare const propEffect: (subject: { + [key: string]: any; +}, values: Record>) => VoidFunction; + +declare const addStyleValue: (element: HTMLElement | SVGElement, state: MotionValueState, key: string, value: MotionValue) => () => void; +declare const styleEffect: (subject: ElementOrSelector, values: Record>) => () => void; + +declare const svgEffect: (subject: ElementOrSelector, values: Record>) => () => void; + +declare const frame: Batcher; +declare const cancelFrame: (process: Process) => void; +declare const frameData: FrameData; +declare const frameSteps: Steps; + +declare function createRenderBatcher(scheduleNextBatch: (callback: Function) => void, allowKeepAlive: boolean): { + schedule: Batcher; + cancel: (process: Process) => void; + state: FrameData; + steps: Steps; +}; + +declare const microtask: Batcher; +declare const cancelMicrotask: (process: Process) => void; + +/** + * An eventloop-synchronous alternative to performance.now(). + * + * Ensures that time measurements remain consistent within a synchronous context. + * Usually calling performance.now() twice within the same synchronous context + * will return different values which isn't useful for animations when we're usually + * trying to sync animations to the same frame. + */ +declare const time: { + now: () => number; + set: (newTime: number) => void; +}; + +declare const isDragging: { + x: boolean; + y: boolean; +}; +declare function isDragActive(): boolean; + +declare function setDragLock(axis: boolean | "x" | "y" | "lockDirection"): (() => void) | null; + +type ElementOrSelector = Element | Element[] | NodeListOf | string | null | undefined; +interface WithQuerySelectorAll { + querySelectorAll: Element["querySelectorAll"]; +} +interface AnimationScope { + readonly current: T; + animations: any[]; +} +interface SelectorCache { + [key: string]: NodeListOf; +} +declare function resolveElements(elementOrSelector: ElementOrSelector, scope?: AnimationScope, selectorCache?: SelectorCache): Element[]; + +/** + * Options for event listeners. + * + * @public + */ +interface EventOptions { + /** + * Use passive event listeners. Doing so allows the browser to optimize + * scrolling performance by not allowing the use of `preventDefault()`. + * + * @default true + */ + passive?: boolean; + /** + * Remove the event listener after the first event. + * + * @default false + */ + once?: boolean; +} + +/** + * A function to be called when a hover gesture starts. + * + * This function can optionally return a function that will be called + * when the hover gesture ends. + * + * @public + */ +type OnHoverStartEvent = (element: Element, event: PointerEvent) => void | OnHoverEndEvent; +/** + * A function to be called when a hover gesture ends. + * + * @public + */ +type OnHoverEndEvent = (event: PointerEvent) => void; +/** + * Create a hover gesture. hover() is different to .addEventListener("pointerenter") + * in that it has an easier syntax, filters out polyfilled touch events, interoperates + * with drag gestures, and automatically removes the "pointerennd" event listener when the hover ends. + * + * @public + */ +declare function hover(elementOrSelector: ElementOrSelector, onHoverStart: OnHoverStartEvent, options?: EventOptions): VoidFunction; + +interface PressGestureInfo { + success: boolean; +} +type OnPressEndEvent = (event: PointerEvent, info: PressGestureInfo) => void; +type OnPressStartEvent = (element: Element, event: PointerEvent) => OnPressEndEvent | void; + +interface PointerEventOptions extends EventOptions { + useGlobalTarget?: boolean; + stopPropagation?: boolean; +} +/** + * Create a press gesture. + * + * Press is different to `"pointerdown"`, `"pointerup"` in that it + * automatically filters out secondary pointer events like right + * click and multitouch. + * + * It also adds accessibility support for keyboards, where + * an element with a press gesture will receive focus and + * trigger on Enter `"keydown"` and `"keyup"` events. + * + * This is different to a browser's `"click"` event, which does + * respond to keyboards but only for the `"click"` itself, rather + * than the press start and end/cancel. The element also needs + * to be focusable for this to work, whereas a press gesture will + * make an element focusable by default. + * + * @public + */ +declare function press(targetOrSelector: ElementOrSelector, onPressStart: OnPressStartEvent, options?: PointerEventOptions): VoidFunction; + +/** + * Checks if an element is natively keyboard accessible (focusable). + * Used by the press gesture to determine if we need to add tabIndex. + */ +declare function isElementKeyboardAccessible(element: Element): boolean; +/** + * Checks if an element has text selection or direct interaction behavior + * that should block drag gestures from starting. + * + * This specifically targets form controls where the user might want to select + * text or interact with the control (e.g., sliders, dropdowns). + * + * Buttons and links are NOT included because they don't have click-and-move + * actions of their own - they only respond to click events, so dragging + * should still work when initiated from these elements. + */ +declare function isElementTextInput(element: Element): boolean; + +/** + * Recursively traverse up the tree to check whether the provided child node + * is the parent or a descendant of it. + * + * @param parent - Element to find + * @param child - Element to test against parent + */ +declare const isNodeOrChild: (parent: Element | null, child?: Element | null) => boolean; + +declare const isPrimaryPointer: (event: PointerEvent) => boolean; + +declare function defaultTransformValue(name: string): number; +declare function parseValueFromTransform(transform: string | undefined, name: string): number; +declare const readTransformValue: (instance: HTMLElement, name: string) => number; + +declare function getComputedStyle(element: HTMLElement | SVGElement, name: string): string; + +declare function setStyle(element: HTMLElement | SVGElement, name: string, value: AnyResolvedKeyframe): void; + +declare const isKeyframesTarget: (v: ValueKeyframesDefinition) => v is UnresolvedValueKeyframe[]; + +declare const positionalKeys: Set; + +/** + * Generate a list of every possible transform key. + */ +declare const transformPropOrder: string[]; +/** + * A quick lookup for transform props. + * + * `pathRotation` is a transform for routing purposes (skipped from raw + * style application, wired to the transform composite, flags transform + * dirty) but is intentionally NOT in `transformPropOrder` — it is + * composed onto `rotate` at the build sites, not serialized in its own + * slot, and must stay out of the order-array consumers (parse-transform, + * unit-conversion, keys-position). + */ +declare const transformProps: Set; + +interface ResizeInfo { + width: number; + height: number; +} +type ResizeHandler = (element: I, info: ResizeInfo) => void; +type WindowResizeHandler = (info: ResizeInfo) => void; + +declare function resize(onResize: WindowResizeHandler): VoidFunction; +declare function resize(target: ElementOrSelector, onResize: ResizeHandler): VoidFunction; + +type Update = (progress: number) => void; +declare function observeTimeline(update: Update, timeline: ProgressTimeline): () => void; + +declare function recordStats(): void; + +interface LayoutProjectionMetrics { + nodes: number; + calculatedTargetDeltas: number; + calculatedProjections: number; +} +interface LayoutProjectionStats { + nodes: number[]; + calculatedTargetDeltas: number[]; + calculatedProjections: number[]; +} +interface StatsRecording { + layoutProjection: LayoutProjectionStats; +} + +type InactiveStatsBuffer = { + value: null; + addProjectionMetrics: null; +}; +type ActiveStatsBuffer = { + value: StatsRecording; + addProjectionMetrics: (metrics: LayoutProjectionMetrics) => void; +}; +declare const statsBuffer: InactiveStatsBuffer | ActiveStatsBuffer; + +type Mixer = (p: number) => T; +type MixerFactory = (a: T, b: T) => Mixer; + +interface InterpolateOptions { + clamp?: boolean; + ease?: EasingFunction | EasingFunction[]; + mixer?: MixerFactory; +} +/** + * Create a function that maps from a numerical input array to a generic output array. + * + * Accepts: + * - Numbers + * - Colors (hex, hsl, hsla, rgb, rgba) + * - Complex (combinations of one or more numbers or strings) + * + * ```jsx + * const mixColor = interpolate([0, 1], ['#fff', '#000']) + * + * mixColor(0.5) // 'rgba(128, 128, 128, 1)' + * ``` + * + * TODO Revisit this approach once we've moved to data models for values, + * probably not needed to pregenerate mixer functions. + * + * @public + */ +declare function interpolate(input: number[], output: T[], { clamp: isClamp, ease, mixer }?: InterpolateOptions): (v: number) => T; + +/** + * Checks if an element is an HTML element in a way + * that works across iframes + */ +declare function isHTMLElement(element: unknown): element is HTMLElement; + +/** + * Checks if an element is an SVG element in a way + * that works across iframes + */ +declare function isSVGElement(element: unknown): element is SVGElement; + +/** + * Checks if an element is specifically an SVGSVGElement (the root SVG element) + * in a way that works across iframes + */ +declare function isSVGSVGElement(element: unknown): element is SVGSVGElement; + +declare function mix(from: T, to: T): Mixer; +declare function mix(from: number, to: number, p: number): number; + +type Transformer = (v: any) => any; +type ValueType = { + test: (v: any) => boolean; + parse: (v: any) => any; + transform?: Transformer; + createTransformer?: (template: string) => Transformer; + default?: any; + getAnimatableNone?: (v: any) => any; +}; +type NumberMap = { + [key: string]: number; +}; +type RGBA = { + red: number; + green: number; + blue: number; + alpha: number; +}; +type HSLA = { + hue: number; + saturation: number; + lightness: number; + alpha: number; +}; +type Color = HSLA | RGBA; + +declare const mixLinearColor: (from: number, to: number, v: number) => number; +declare const mixColor: (from: Color | string, to: Color | string) => (p: number) => string | Color; + +type MixableArray = Array; +interface MixableObject { + [key: string]: AnyResolvedKeyframe | RGBA | HSLA; +} +declare function getMixer(a: T): ((from: string | Color, to: string | Color) => (p: number) => string | Color) | ((origin: AnyResolvedKeyframe, target: AnyResolvedKeyframe) => Function) | typeof mixArray | typeof mixObject; +declare function mixArray(a: MixableArray, b: MixableArray): (p: number) => (string | number | RGBA | HSLA)[]; +declare function mixObject(a: MixableObject, b: MixableObject): (v: number) => { + [x: string]: AnyResolvedKeyframe | RGBA | HSLA; +}; +declare const mixComplex: (origin: AnyResolvedKeyframe, target: AnyResolvedKeyframe) => Function; + +declare function mixImmediate(a: T, b: T): (p: number) => T; + +declare const mixNumber: (from: number, to: number, progress: number) => number; + +declare const invisibleValues: Set; +/** + * Returns a function that, when provided a progress value between 0 and 1, + * will return the "none" or "hidden" string only when the progress is that of + * the origin or target. + */ +declare function mixVisibility(origin: string, target: string): (p: number) => string; + +type StaggerOrigin = "first" | "last" | "center" | number; +type StaggerOptions = { + startDelay?: number; + from?: StaggerOrigin; + ease?: Easing; +}; +declare function getOriginIndex(from: StaggerOrigin, total: number): number; +declare function stagger(duration?: number, { startDelay, from, ease }?: StaggerOptions): DynamicOption; + +/** + * Add the ability for test suites to manually set support flags + * to better test more environments. + */ +declare const supportsFlags: Record; + +declare const supportsLinearEasing: () => boolean; + +declare global { + interface Window { + ScrollTimeline: ScrollTimeline; + ViewTimeline: ViewTimeline; + } +} +declare class ScrollTimeline implements ProgressTimeline { + constructor(options: ScrollOptions); + currentTime: null | { + value: number; + }; + cancel?: VoidFunction; +} +declare class ViewTimeline implements ProgressTimeline { + constructor(options: { + subject: Element; + axis?: string; + }); + currentTime: null | { + value: number; + }; + cancel?: VoidFunction; +} +declare const supportsScrollTimeline: () => boolean; +declare const supportsViewTimeline: () => boolean; + +/** + * @public + */ +interface TransformOptions { + /** + * Clamp values to within the given range. Defaults to `true` + * + * @public + */ + clamp?: boolean; + /** + * Easing functions to use on the interpolations between each value in the input and output ranges. + * + * If provided as an array, the array must be one item shorter than the input and output ranges, as the easings apply to the transition **between** each. + * + * @public + */ + ease?: EasingFunction | EasingFunction[]; + /** + * Provide a function that can interpolate between any two values in the provided range. + * + * @public + */ + mixer?: (from: T, to: T) => (v: number) => any; +} +/** + * Transforms numbers into other values by mapping them from an input range to an output range. + * Returns the type of the input provided. + * + * @remarks + * + * Given an input range of `[0, 200]` and an output range of + * `[0, 1]`, this function will return a value between `0` and `1`. + * The input range must be a linear series of numbers. The output range + * can be any supported value type, such as numbers, colors, shadows, arrays, objects and more. + * Every value in the output range must be of the same type and in the same format. + * + * ```jsx + * export function MyComponent() { + * const inputRange = [0, 200] + * const outputRange = [0, 1] + * const output = transform(100, inputRange, outputRange) + * + * // Returns 0.5 + * return
{output}
+ * } + * ``` + * + * @param inputValue - A number to transform between the input and output ranges. + * @param inputRange - A linear series of numbers (either all increasing or decreasing). + * @param outputRange - A series of numbers, colors, strings, or arrays/objects of those. Must be the same length as `inputRange`. + * @param options - Clamp: Clamp values to within the given range. Defaults to `true`. + * + * @public + */ +declare function transform(inputValue: number, inputRange: number[], outputRange: T[], options?: TransformOptions): T; +/** + * + * Transforms numbers into other values by mapping them from an input range to an output range. + * + * Given an input range of `[0, 200]` and an output range of + * `[0, 1]`, this function will return a value between `0` and `1`. + * The input range must be a linear series of numbers. The output range + * can be any supported value type, such as numbers, colors, shadows, arrays, objects and more. + * Every value in the output range must be of the same type and in the same format. + * + * ```jsx + * export function MyComponent() { + * const inputRange = [-200, -100, 100, 200] + * const outputRange = [0, 1, 1, 0] + * const convertRange = transform(inputRange, outputRange) + * const output = convertRange(-150) + * + * // Returns 0.5 + * return
{output}
+ * } + * + * ``` + * + * @param inputRange - A linear series of numbers (either all increasing or decreasing). + * @param outputRange - A series of numbers, colors or strings. Must be the same length as `inputRange`. + * @param options - Clamp: clamp values to within the given range. Defaults to `true`. + * + * @public + */ +declare function transform(inputRange: number[], outputRange: T[], options?: TransformOptions): (inputValue: number) => T; + +/** + * Options for useFollowValue hook, extending ValueAnimationTransition + * but excluding lifecycle callbacks that don't make sense for the hook pattern. + */ +type FollowValueOptions = Omit & { + /** + * When true, the first change from a tracked `MotionValue` source + * will jump to the new value instead of animating. Subsequent + * changes animate normally. This prevents unwanted animations + * on page refresh or back navigation (e.g. `useScroll` + `useSpring`). + * + * @default false + */ + skipInitialAnimation?: boolean; +}; +/** + * Create a `MotionValue` that animates to its latest value using any transition type. + * Can either be a value or track another `MotionValue`. + * + * ```jsx + * const x = motionValue(0) + * const y = followValue(x, { type: "spring", stiffness: 300 }) + * // or with tween + * const z = followValue(x, { type: "tween", duration: 0.5, ease: "easeOut" }) + * ``` + * + * @param source - Initial value or MotionValue to track + * @param options - Animation transition options + * @returns `MotionValue` + * + * @public + */ +declare function followValue(source: T | MotionValue, options?: FollowValueOptions): MotionValue; +/** + * Attach an animation to a MotionValue that will animate whenever the value changes. + * Similar to attachSpring but supports any transition type (spring, tween, inertia, etc.) + * + * @param value - The MotionValue to animate + * @param source - Initial value or MotionValue to track + * @param options - Animation transition options + * @returns Cleanup function + * + * @public + */ +declare function attachFollow(value: MotionValue, source: T | MotionValue, options?: FollowValueOptions): VoidFunction; + +type MapInputRange = number[]; +/** + * Create a `MotionValue` that maps the output of another `MotionValue` by + * mapping it from one range of values into another. + * + * @remarks + * + * Given an input range of `[-200, -100, 100, 200]` and an output range of + * `[0, 1, 1, 0]`, the returned `MotionValue` will: + * + * - When provided a value between `-200` and `-100`, will return a value between `0` and `1`. + * - When provided a value between `-100` and `100`, will return `1`. + * - When provided a value between `100` and `200`, will return a value between `1` and `0` + * + * The input range must be a linear series of numbers. The output range + * can be any value type supported by Motion: numbers, colors, shadows, etc. + * + * Every value in the output range must be of the same type and in the same format. + * + * ```jsx + * const x = motionValue(0) + * const xRange = [-200, -100, 100, 200] + * const opacityRange = [0, 1, 1, 0] + * const opacity = mapValue(x, xRange, opacityRange) + * ``` + * + * @param inputValue - `MotionValue` + * @param inputRange - A linear series of numbers (either all increasing or decreasing) + * @param outputRange - A series of numbers, colors or strings. Must be the same length as `inputRange`. + * @param options - + * + * - clamp: boolean. Clamp values to within the given range. Defaults to `true` + * - ease: EasingFunction[]. Easing functions to use on the interpolations between each value in the input and output ranges. If provided as an array, the array must be one item shorter than the input and output ranges, as the easings apply to the transition between each. + * + * @returns `MotionValue` + * + * @public + */ +declare function mapValue(inputValue: MotionValue, inputRange: MapInputRange, outputRange: O[], options?: TransformOptions): MotionValue; + +/** + * Create a `MotionValue` that animates to its latest value using a spring. + * Can either be a value or track another `MotionValue`. + * + * ```jsx + * const x = motionValue(0) + * const y = springValue(x, { stiffness: 300 }) + * ``` + * + * @param source - Initial value or MotionValue to track + * @param options - Spring configuration options + * @returns `MotionValue` + * + * @public + */ +declare function springValue(source: T | MotionValue, options?: SpringOptions): MotionValue; +/** + * Attach a spring animation to a MotionValue that will animate whenever the value changes. + * + * @param value - The MotionValue to animate + * @param source - Initial value or MotionValue to track + * @param options - Spring configuration options + * @returns Cleanup function + * + * @public + */ +declare function attachSpring(value: MotionValue, source: T | MotionValue, options?: SpringOptions): VoidFunction; + +type TransformInputRange = number[]; +type SingleTransformer = (input: I) => O; +type MultiTransformer = (input: I[]) => O; +type ValueTransformer = SingleTransformer | MultiTransformer; +/** + * Create a `MotionValue` that transforms the output of other `MotionValue`s by + * passing their latest values through a transform function. + * + * Whenever a `MotionValue` referred to in the provided function is updated, + * it will be re-evaluated. + * + * ```jsx + * const x = motionValue(0) + * const y = transformValue(() => x.get() * 2) // double x + * ``` + * + * @param transformer - A transform function. This function must be pure with no side-effects or conditional statements. + * @returns `MotionValue` + * + * @public + */ +declare function transformValue(transform: () => O): MotionValue; + +declare const color: { + test: (v: any) => boolean; + parse: (v: any) => RGBA | HSLA; + transform: (v: HSLA | RGBA | string) => string; + getAnimatableNone: (v: string) => string; +}; + +declare function parseHex(v: string): RGBA; +declare const hex: { + test: (v: any) => boolean; + parse: typeof parseHex; + transform: ({ red, green, blue, alpha }: RGBA) => string; +}; + +declare const hsla: { + test: (v: any) => boolean; + parse: (v: string | Color) => HSLA; + transform: ({ hue, saturation, lightness, alpha }: HSLA) => string; +}; + +declare function hslaToRgba({ hue, saturation, lightness, alpha }: HSLA): RGBA; + +declare const rgbUnit: { + transform: (v: number) => number; + test: (v: number) => boolean; + parse: typeof parseFloat; +}; +declare const rgba: { + test: (v: any) => boolean; + parse: (v: string | Color) => RGBA; + transform: ({ red, green, blue, alpha }: RGBA) => string; +}; + +declare function test(v: any): boolean; +type ComplexValues = Array; +interface ValueIndexes { + color: number[]; + number: number[]; + var: number[]; +} +interface ComplexValueInfo { + values: ComplexValues; + split: string[]; + indexes: ValueIndexes; + types: Array; +} +declare function analyseComplexValue(value: AnyResolvedKeyframe): ComplexValueInfo; +declare function parseComplexValue(v: AnyResolvedKeyframe): ComplexValues; +declare function createTransformer(source: AnyResolvedKeyframe): (v: (string | number | Color)[]) => string; +declare function getAnimatableNone$1(v: AnyResolvedKeyframe): string; +declare const complex: { + test: typeof test; + parse: typeof parseComplexValue; + createTransformer: typeof createTransformer; + getAnimatableNone: typeof getAnimatableNone$1; +}; + +/** + * A list of value types commonly used for dimensions + */ +declare const dimensionValueTypes: ({ + test: (v: number) => boolean; + parse: typeof parseFloat; + transform: (v: number) => number; +} | { + test: (v: AnyResolvedKeyframe) => boolean; + parse: typeof parseFloat; + transform: (v: string | number) => string; +} | ValueType)[]; +/** + * Tests a dimensional value against the list of dimension ValueTypes + */ +declare const findDimensionValueType: (v: any) => { + test: (v: number) => boolean; + parse: typeof parseFloat; + transform: (v: number) => number; +} | { + test: (v: AnyResolvedKeyframe) => boolean; + parse: typeof parseFloat; + transform: (v: string | number) => string; +} | ValueType | undefined; + +interface ValueTypeMap { + [key: string]: ValueType; +} + +/** + * A map of default value types for common values + */ +declare const defaultValueTypes: ValueTypeMap; +/** + * Gets the default ValueType for the provided value key + */ +declare const getDefaultValueType: (key: string) => ValueType; + +declare const numberValueTypes: ValueTypeMap; + +declare const transformValueTypes: ValueTypeMap; + +declare const number: { + test: (v: number) => boolean; + parse: typeof parseFloat; + transform: (v: number) => number; +}; +declare const alpha: { + transform: (v: number) => number; + test: (v: number) => boolean; + parse: typeof parseFloat; +}; +declare const scale: { + default: number; + test: (v: number) => boolean; + parse: typeof parseFloat; + transform: (v: number) => number; +}; + +declare const degrees: { + test: (v: AnyResolvedKeyframe) => boolean; + parse: typeof parseFloat; + transform: (v: number | string) => string; +}; +declare const percent: { + test: (v: AnyResolvedKeyframe) => boolean; + parse: typeof parseFloat; + transform: (v: number | string) => string; +}; +declare const px: { + test: (v: AnyResolvedKeyframe) => boolean; + parse: typeof parseFloat; + transform: (v: number | string) => string; +}; +declare const vh: { + test: (v: AnyResolvedKeyframe) => boolean; + parse: typeof parseFloat; + transform: (v: number | string) => string; +}; +declare const vw: { + test: (v: AnyResolvedKeyframe) => boolean; + parse: typeof parseFloat; + transform: (v: number | string) => string; +}; +declare const progressPercentage: { + parse: (v: string) => number; + transform: (v: number) => string; + test: (v: AnyResolvedKeyframe) => boolean; +}; + +/** + * Tests a provided value against a ValueType + */ +declare const testValueType: (v: any) => (type: ValueType) => boolean; + +declare function getAnimatableNone(key: string, value: string): any; + +/** + * Tests a value against the list of ValueTypes + */ +declare const findValueType: (v: any) => { + test: (v: number) => boolean; + parse: typeof parseFloat; + transform: (v: number) => number; +} | { + test: (v: AnyResolvedKeyframe) => boolean; + parse: typeof parseFloat; + transform: (v: string | number) => string; +} | ValueType | { + test: (v: any) => boolean; + parse: (v: any) => RGBA | HSLA; + transform: (v: string | RGBA | HSLA) => string; + getAnimatableNone: (v: string) => string; +} | { + test: (v: any) => boolean; + parse: (v: AnyResolvedKeyframe) => ComplexValues; + createTransformer: (source: AnyResolvedKeyframe) => (v: (string | number | Color)[]) => string; + getAnimatableNone: (v: AnyResolvedKeyframe) => string; +} | undefined; + +/** + * Provided a value and a ValueType, returns the value as that value type. + */ +declare const getValueAsType: (value: any, type?: ValueType) => any; + +declare const isMotionValue: (value: any) => value is MotionValue; + +declare function addValueToWillChange(visualElement: VisualElement, key: string): void; + +interface WillChange extends MotionValue { + add(name: string): void; +} + +declare function isWillChangeMotionValue(value: any): value is WillChange; + +type ViewTransitionAnimationDefinition = { + keyframes: DOMKeyframesDefinition; + options: AnimationOptions; +}; +type ViewTransitionTarget = { + layout?: ViewTransitionAnimationDefinition; + /** + * Presence-gated: `enter` animates a pure newcomer's new view, `exit` a + * pure leaver's old view. A survivor (present in both snapshots) gets + * neither - it just morphs. + */ + enter?: ViewTransitionAnimationDefinition; + exit?: ViewTransitionAnimationDefinition; + /** + * View-targeted (ungated): `new`/`old` animate the new/old view whenever it + * exists - including a survivor's, for crossfades and slide-throughs. + */ + new?: ViewTransitionAnimationDefinition; + old?: ViewTransitionAnimationDefinition; +}; +type ViewTransitionOptions = AnimationOptions & { + interrupt?: "wait" | "immediate"; +}; +type ViewTransitionTargetDefinition = string | Element; + +declare class ViewTransitionBuilder { + private currentSubject; + targets: Map; + /** + * Definitions that must be resolved to elements (and assigned a + * `view-transition-name`) rather than treated as pre-named layers. + */ + resolveDefs: Set; + /** + * Per-subject crop override: `true` forces the crop (clip + object-fit: + * cover + animated corner radii) on, `false` forces it off. A subject with + * no entry uses the default - crop only a genuine morph (a layer present in + * both snapshots), so a fade-only enter/exit isn't clipped to nothing. + */ + cropOverride: Map; + /** + * Subjects paired with a different new-snapshot target (the second `.add()` + * argument), so two distinct elements share one name and morph into each + * other - a shared-element transition. + */ + pairs: Map; + /** + * A `view-transition-class` to apply to each subject's resolved elements, + * so authors can target the generated layers from CSS by class rather than + * the opaque generated name. + */ + classNames: Map; + /** + * Subjects opted out of automatic group nesting via `.group(false)`. Their + * layer stays a flat top-level group (`view-transition-group: none`) instead + * of nesting under its DOM-ancestor layer - so it animates independently and + * escapes an ancestor's clip/transform (e.g. an element that lifts out of a + * card and flies across, which nesting would clip to the card). + */ + flatGroups: Set; + update: () => void | Promise; + options: ViewTransitionOptions; + notifyReady: (value: GroupAnimation) => void; + notifyReject: (error: unknown) => void; + private readyPromise; + constructor(update: () => void | Promise, options?: ViewTransitionOptions); + /** + * Target elements resolved from a selector or Element, each assigned a + * `view-transition-name` automatically. + * + * Passing a second target pairs them: the first is resolved in the old + * snapshot and the second in the new, sharing one name so two *different* + * elements morph into each other (e.g. `.add(card, ".modal")`). Symmetric - + * pass them the other way round to morph back. + */ + add(subject: ViewTransitionTargetDefinition, newSubject?: ViewTransitionTargetDefinition): this; + /** + * Control this subject's crop (clip + `object-fit: cover` + animated + * corners). By default a subject auto-crops only when it actually morphs - + * present in both snapshots (a survivor, or an `.add(a, b)` pair). A + * fade-only enter/exit has no second box to crop against, so it's left to + * the browser default; in particular the `overflow: clip` a crop adds would + * otherwise clip a mis-sized enter/exit layer to nothing. + * + * `.crop(false)` forces the crop off (e.g. a text morph, where + * `object-fit: cover` clips glyphs as the box grows); `.crop(true)` forces + * it on for a non-morph the default wouldn't otherwise crop. + */ + crop(enabled?: boolean): this; + /** + * By default a subject's layer nests under its nearest DOM-ancestor layer + * (`view-transition-group: contain`), so the ancestor's clip/transform/opacity + * apply to it through the transition - mirroring how the DOM actually paints, + * and letting a wrapper crop its child for the whole morph rather than only + * once the live DOM takes back over. (Needs a browser that supports nested + * view-transition groups; elsewhere it degrades to the flat default.) + * + * Call `.group(false)` to opt out: the layer stays flat and top-level, so it + * animates independently and escapes an ancestor's clip - e.g. an element + * that should lift out of a card and fly across, which nesting would clip. + */ + group(enabled?: boolean): this; + /** + * Tag this subject's generated layers with a `view-transition-class`, so + * they can be targeted from CSS - `::view-transition-group(.name)`, + * `::view-transition-old/new(.name)`, `::view-transition-image-pair(.name)` + * - without the opaque generated `view-transition-name`. Because `.add()` + * can match many elements, a shared class targets them all at once (and, + * for a pair, both ends). The escape hatch for z-index / custom keyframes + * on a morph layer. + */ + class(name: string): this; + /** + * Set the transition for this subject's morph. The morph is enabled + * automatically by `.add()`; this just customises its timing (duration, + * easing, a `delay`/`stagger`, …). On the implicit `root` subject it also + * opts the page into the transition (the root crossfade). + */ + layout(options?: AnimationOptions): this; + enter(keyframes: DOMKeyframesDefinition, options?: AnimationOptions): this; + exit(keyframes: DOMKeyframesDefinition, options?: AnimationOptions): this; + /** + * Animate the new view directly, whether the element is appearing or + * persisting (unlike `.enter()`, which only fires for a pure newcomer). + * Pair with `.old()` for a crossfade or slide-through. + */ + new(keyframes: DOMKeyframesDefinition, options?: AnimationOptions): this; + /** + * Animate the old view directly, whether the element is leaving or + * persisting (unlike `.exit()`, which only fires for a pure leaver). + */ + old(keyframes: DOMKeyframesDefinition, options?: AnimationOptions): this; + updateTarget(target: "enter" | "exit" | "layout" | "new" | "old", keyframes: DOMKeyframesDefinition, options?: AnimationOptions): void; + then(resolve: () => void, reject?: () => void): Promise; +} +declare function animateView(update: () => void | Promise, options?: ViewTransitionOptions): ViewTransitionBuilder; + +declare function getViewAnimationLayerInfo(pseudoElement: string): { + layer: string; + type: string; +} | null; + +declare function getViewAnimations(): Animation[]; + +interface DOMVisualElementOptions { + /** + * If `true`, this element will be included in the projection tree. + * + * Default: `true` + * + * @public + */ + allowProjection?: boolean; + /** + * Allow this element to be GPU-accelerated. We currently enable this by + * adding a `translateZ(0)`. + * + * @public + */ + enableHardwareAcceleration?: boolean; +} + +declare abstract class DOMVisualElement extends VisualElement { + sortInstanceNodePosition(a: Instance, b: Instance): number; + getBaseTargetFromProps(props: MotionNodeOptions, key: string): AnyResolvedKeyframe | MotionValue | undefined; + removeValueFromRenderState(key: string, { vars, style }: HTMLRenderState): void; + KeyframeResolver: typeof DOMKeyframesResolver; + childSubscription?: VoidFunction; + handleChildMotionValue(): void; +} + +/** + * Feature base class for extending VisualElement functionality. + * Features are plugins that can be mounted/unmounted to add behavior + * like gestures, animations, or layout tracking. + */ +declare abstract class Feature { + isMounted: boolean; + node: VisualElement; + constructor(node: VisualElement); + abstract mount(): void; + abstract unmount(): void; + update(): void; +} + +declare function renderHTML(element: HTMLElement, { style, vars }: HTMLRenderState, styleProp?: MotionStyle, projection?: any): void; + +declare class HTMLVisualElement extends DOMVisualElement { + type: string; + mount(instance: HTMLElement): void; + readValueFromInstance(instance: HTMLElement, key: string): AnyResolvedKeyframe | null | undefined; + measureInstanceViewportBox(instance: HTMLElement, { transformPagePoint }: MotionNodeOptions & Partial): Box; + build(renderState: HTMLRenderState, latestValues: ResolvedValues$1, props: MotionNodeOptions): void; + scrapeMotionValuesFromProps(props: MotionNodeOptions, prevProps: MotionNodeOptions, visualElement: VisualElement): { + [key: string]: any; + }; + renderInstance: typeof renderHTML; +} + +interface ObjectRenderState { + output: ResolvedValues$1; +} +declare class ObjectVisualElement extends VisualElement { + type: string; + readValueFromInstance(instance: Object, key: string): undefined; + getBaseTargetFromProps(): undefined; + removeValueFromRenderState(key: string, renderState: ObjectRenderState): void; + measureInstanceViewportBox(): motion_utils.Box; + build(renderState: ObjectRenderState, latestValues: ResolvedValues$1): void; + renderInstance(instance: Object, { output }: ObjectRenderState): void; + sortInstanceNodePosition(): number; +} + +declare const visualElementStore: WeakMap>; + +declare class SVGVisualElement extends DOMVisualElement { + type: string; + isSVGTag: boolean; + getBaseTargetFromProps(props: MotionNodeOptions, key: string): AnyResolvedKeyframe | MotionValue | undefined; + readValueFromInstance(instance: SVGElement, key: string): any; + measureInstanceViewportBox: () => motion_utils.Box; + scrapeMotionValuesFromProps(props: MotionNodeOptions, prevProps: MotionNodeOptions, visualElement: VisualElement): { + [key: string]: any; + }; + build(renderState: SVGRenderState, latestValues: ResolvedValues$1, props: MotionNodeOptions): void; + renderInstance(instance: SVGElement, renderState: SVGRenderState, styleProp?: MotionStyle | undefined, projection?: any): void; + mount(instance: SVGElement): void; +} + +type VariantStateContext = { + initial?: string | string[]; + animate?: string | string[]; + exit?: string | string[]; + whileHover?: string | string[]; + whileDrag?: string | string[]; + whileFocus?: string | string[]; + whileTap?: string | string[]; +}; +/** + * Get variant context from a visual element's parent chain. + * Uses `any` type for visualElement to avoid circular dependencies. + */ +declare function getVariantContext(visualElement?: any): undefined | VariantStateContext; + +declare function isAnimationControls(v?: unknown): v is LegacyAnimationControls; + +declare function isControllingVariants(props: MotionNodeOptions): boolean; +declare function isVariantNode(props: MotionNodeOptions): boolean; + +/** + * Minimal interface for projection node properties used by scale correctors. + * This avoids circular dependencies with the full IProjectionNode interface. + */ +interface ScaleCorrectionNode { + target?: Box; + treeScale?: Point; + projectionDelta?: Delta; +} +type ScaleCorrector = (latest: AnyResolvedKeyframe, node: ScaleCorrectionNode) => AnyResolvedKeyframe; +interface ScaleCorrectorDefinition { + correct: ScaleCorrector; + applyTo?: string[]; + isCSSVariable?: boolean; +} +interface ScaleCorrectorMap { + [key: string]: ScaleCorrectorDefinition; +} + +declare const scaleCorrectors: ScaleCorrectorMap; +declare function addScaleCorrector(correctors: ScaleCorrectorMap): void; + +declare function isForcedMotionValue(key: string, { layout, layoutId }: MotionNodeOptions): boolean; + +/** + * Decides if the supplied variable is variant label + */ +declare function isVariantLabel(v: unknown): v is string | string[]; + +type MotionStyleLike = Record; +/** + * Updates motion values from props changes. + * Uses `any` type for element to avoid circular dependencies with VisualElement. + */ +declare function updateMotionValuesFromProps(element: any, next: MotionStyleLike, prev: MotionStyleLike): MotionStyleLike; + +/** + * Resolves a variant if it's a variant resolver. + * Uses `any` type for visualElement to avoid circular dependencies. + */ +declare function resolveVariant(visualElement: any, definition?: TargetAndTransition | TargetResolver, custom?: any): TargetAndTransition; +declare function resolveVariant(visualElement: any, definition?: AnimationDefinition, custom?: any): TargetAndTransition | undefined; + +declare function resolveVariantFromProps(props: MotionNodeOptions, definition: TargetAndTransition | TargetResolver, custom?: any, visualElement?: any): TargetAndTransition; +declare function resolveVariantFromProps(props: MotionNodeOptions, definition?: AnimationDefinition, custom?: any, visualElement?: any): undefined | TargetAndTransition; + +declare function setTarget(visualElement: VisualElement, definition: AnimationDefinition): void; + +declare const variantPriorityOrder: AnimationType[]; +declare const variantProps: string[]; + +interface ReducedMotionState { + current: boolean | null; +} +declare const prefersReducedMotion: ReducedMotionState; +declare const hasReducedMotionListener: { + current: boolean; +}; + +declare function initPrefersReducedMotion(): void; + +/** + * Bounding boxes tend to be defined as top, left, right, bottom. For various operations + * it's easier to consider each axis individually. This function returns a bounding box + * as a map of single-axis min/max values. + */ +declare function convertBoundingBoxToBox({ top, left, right, bottom, }: BoundingBox): Box; +declare function convertBoxToBoundingBox({ x, y }: Box): BoundingBox; +/** + * Applies a TransformPoint function to a bounding box. TransformPoint is usually a function + * provided by Framer to allow measured points to be corrected for device scaling. This is used + * when measuring DOM elements and DOM event points. + */ +declare function transformBoxPoints(point: BoundingBox, transformPoint?: TransformPoint): BoundingBox; + +/** + * Reset an axis to the provided origin box. + * + * This is a mutative operation. + */ +declare function copyAxisInto(axis: Axis, originAxis: Axis): void; +/** + * Reset a box to the provided origin box. + * + * This is a mutative operation. + */ +declare function copyBoxInto(box: Box, originBox: Box): void; +/** + * Reset a delta to the provided origin box. + * + * This is a mutative operation. + */ +declare function copyAxisDeltaInto(delta: AxisDelta, originDelta: AxisDelta): void; + +/** + * Scales a point based on a factor and an originPoint + */ +declare function scalePoint(point: number, scale: number, originPoint: number): number; +/** + * Applies a translate/scale delta to a point + */ +declare function applyPointDelta(point: number, translate: number, scale: number, originPoint: number, boxScale?: number): number; +/** + * Applies a translate/scale delta to an axis + */ +declare function applyAxisDelta(axis: Axis, translate: number | undefined, scale: number | undefined, originPoint: number, boxScale?: number): void; +/** + * Applies a translate/scale delta to a box + */ +declare function applyBoxDelta(box: Box, { x, y }: Delta): void; +/** + * Apply a tree of deltas to a box. We do this to calculate the effect of all the transforms + * in a tree upon our box before then calculating how to project it into our desired viewport-relative box + * + * This is the final nested loop within updateLayoutDelta for future refactoring + */ +declare function applyTreeDeltas(box: Box, treeScale: Point, treePath: any[], isSharedTransition?: boolean): void; +declare function translateAxis(axis: Axis, distance: number): void; +/** + * Apply a transform to an axis from the latest resolved motion values. + * This function basically acts as a bridge between a flat motion value map + * and applyAxisDelta + */ +declare function transformAxis(axis: Axis, axisTranslate?: number, axisScale?: number, boxScale?: number, axisOrigin?: number): void; +/** + * Apply a transform to a box from the latest resolved motion values. + */ +declare function transformBox(box: Box, transform: ResolvedValues$1, sourceBox?: Box): void; + +declare function calcLength(axis: Axis): number; +declare function isNear(value: number, target: number, maxDistance: number): boolean; +declare function calcAxisDelta(delta: AxisDelta, source: Axis, target: Axis, origin?: number): void; +declare function calcBoxDelta(delta: Delta, source: Box, target: Box, origin?: ResolvedValues$1): void; +declare function calcRelativeAxis(target: Axis, relative: Axis, parent: Axis, anchor?: number): void; +declare function calcRelativeBox(target: Box, relative: Box, parent: Box, anchor?: Point): void; +declare function calcRelativeAxisPosition(target: Axis, layout: Axis, parent: Axis, anchor?: number): void; +declare function calcRelativePosition(target: Box, layout: Box, parent: Box, anchor?: Point): void; + +/** + * Remove a delta from a point. This is essentially the steps of applyPointDelta in reverse + */ +declare function removePointDelta(point: number, translate: number, scale: number, originPoint: number, boxScale?: number): number; +/** + * Remove a delta from an axis. This is essentially the steps of applyAxisDelta in reverse + */ +declare function removeAxisDelta(axis: Axis, translate?: number | string, scale?: number, origin?: number, boxScale?: number, originAxis?: Axis, sourceAxis?: Axis): void; +/** + * Remove a transforms from an axis. This is essentially the steps of applyAxisTransforms in reverse + * and acts as a bridge between motion values and removeAxisDelta + */ +declare function removeAxisTransforms(axis: Axis, transforms: ResolvedValues$1, [key, scaleKey, originKey]: string[], origin?: Axis, sourceAxis?: Axis): void; +/** + * Remove a transforms from an box. This is essentially the steps of applyAxisBox in reverse + * and acts as a bridge between motion values and removeAxisDelta + */ +declare function removeBoxTransforms(box: Box, transforms: ResolvedValues$1, originBox?: Box, sourceBox?: Box): void; + +declare const createAxisDelta: () => AxisDelta; +declare const createDelta: () => Delta; +declare const createAxis: () => Axis; +declare const createBox: () => Box; + +declare function isDeltaZero(delta: Delta): boolean; +declare function axisEquals(a: Axis, b: Axis): boolean; +declare function boxEquals(a: Box, b: Box): boolean; +declare function axisEqualsRounded(a: Axis, b: Axis): boolean; +declare function boxEqualsRounded(a: Box, b: Box): boolean; +declare function aspectRatio(box: Box): number; +declare function axisDeltaEquals(a: AxisDelta, b: AxisDelta): boolean; + +type Callback = (axis: "x" | "y") => void; +declare function eachAxis(callback: Callback): void[]; + +declare function hasScale({ scale, scaleX, scaleY }: ResolvedValues$1): boolean; +declare function hasTransform(values: ResolvedValues$1): true | AnyResolvedKeyframe; +declare function has2DTranslate(values: ResolvedValues$1): boolean | "" | 0 | undefined; + +declare function measureViewportBox(instance: HTMLElement, transformPoint?: TransformPoint): motion_utils.Box; +declare function measurePageBox(element: HTMLElement, rootProjectionNode: any, transformPagePoint?: TransformPoint): motion_utils.Box; + +declare function pixelsToPercent(pixels: number, axis: Axis): number; +/** + * We always correct borderRadius as a percentage rather than pixels to reduce paints. + * For example, if you are projecting a box that is 100px wide with a 10px borderRadius + * into a box that is 200px wide with a 20px borderRadius, that is actually a 10% + * borderRadius in both states. If we animate between the two in pixels that will trigger + * a paint each time. If we animate between the two in percentage we'll avoid a paint. + */ +declare const correctBorderRadius: ScaleCorrectorDefinition; + +declare const correctBoxShadow: ScaleCorrectorDefinition; + +declare function buildProjectionTransform(delta: Delta, treeScale: Point, latestTransform?: ResolvedValues$1): string; + +declare function mixValues(target: ResolvedValues$1, follow: ResolvedValues$1, lead: ResolvedValues$1, progress: number, shouldCrossfadeOpacity: boolean, isOnlyMember: boolean): void; + +declare function animateSingleValue(value: MotionValue | V, keyframes: V | UnresolvedValueKeyframe[], options?: ValueAnimationTransition): AnimationPlaybackControlsWithThen; + +declare function addDomEvent(target: EventTarget, eventName: string, handler: EventListener, options?: AddEventListenerOptions): () => void; + +interface WithDepth { + depth: number; +} +declare const compareByDepth: (a: VisualElement, b: VisualElement) => number; + +declare class FlatTree { + private children; + private isDirty; + add(child: WithDepth): void; + remove(child: WithDepth): void; + forEach(callback: (child: WithDepth) => void): void; +} + +type DelayedFunction = (overshoot: number) => void; +/** + * Timeout defined in ms + */ +declare function delay(callback: DelayedFunction, timeout: number): () => void; +declare function delayInSeconds(callback: DelayedFunction, timeout: number): () => void; + +/** + * If the provided value is a MotionValue, this returns the actual value, otherwise just the value itself + */ +declare function resolveMotionValue(value?: AnyResolvedKeyframe | MotionValue): AnyResolvedKeyframe; + +interface Measurements { + animationId: number; + measuredBox: Box; + layoutBox: Box; + latestValues: ResolvedValues$1; + source: number; +} +type Phase = "snapshot" | "measure"; +interface ScrollMeasurements { + animationId: number; + phase: Phase; + offset: Point; + isRoot: boolean; + wasRoot: boolean; +} +type LayoutEvents = "willUpdate" | "didUpdate" | "beforeMeasure" | "measure" | "projectionUpdate" | "animationStart" | "animationComplete"; +interface IProjectionNode { + linkedParentVersion: number; + layoutVersion: number; + id: number; + animationId: number; + animationCommitId: number; + parent?: IProjectionNode; + relativeParent?: IProjectionNode; + root?: IProjectionNode; + children: Set; + path: IProjectionNode[]; + nodes?: FlatTree; + depth: number; + instance: I | undefined; + mount: (node: I, isLayoutDirty?: boolean) => void; + unmount: () => void; + options: ProjectionNodeOptions; + setOptions(options: ProjectionNodeOptions): void; + layout?: Measurements; + snapshot?: Measurements; + target?: Box; + relativeTarget?: Box; + relativeTargetOrigin?: Box; + targetDelta?: Delta; + targetWithTransforms?: Box; + scroll?: ScrollMeasurements; + treeScale?: Point; + projectionDelta?: Delta; + projectionDeltaWithTransform?: Delta; + latestValues: ResolvedValues$1; + isLayoutDirty: boolean; + isProjectionDirty: boolean; + isSharedProjectionDirty: boolean; + isTransformDirty: boolean; + resolvedRelativeTargetAt?: number; + shouldResetTransform: boolean; + prevTransformTemplateValue: string | undefined; + isUpdateBlocked(): boolean; + updateManuallyBlocked: boolean; + updateBlockedByResize: boolean; + blockUpdate(): void; + unblockUpdate(): void; + isUpdating: boolean; + needsReset: boolean; + startUpdate(): void; + willUpdate(notifyListeners?: boolean): void; + didUpdate(): void; + measure(removeTransform?: boolean): Measurements; + measurePageBox(): Box; + updateLayout(): void; + updateSnapshot(): void; + clearSnapshot(): void; + updateScroll(phase?: Phase): void; + scheduleUpdateProjection(): void; + scheduleCheckAfterUnmount(): void; + checkUpdateFailed(): void; + sharedNodes: Map; + registerSharedNode(id: string, node: IProjectionNode): void; + getStack(): NodeStack | undefined; + isVisible: boolean; + hide(): void; + show(): void; + scheduleRender(notifyAll?: boolean): void; + getClosestProjectingParent(): IProjectionNode | undefined; + setTargetDelta(delta: Delta): void; + resetTransform(): void; + resetSkewAndRotation(): void; + applyTransform(box: Box, transformOnly?: boolean, output?: Box): Box; + resolveTargetDelta(force?: boolean): void; + calcProjection(): void; + applyProjectionStyles(targetStyle: CSSStyleDeclaration, styleProp?: MotionStyle): void; + clearMeasurements(): void; + resetTree(): void; + isProjecting(): boolean; + animationValues?: ResolvedValues$1; + currentAnimation?: JSAnimation; + isTreeAnimating?: boolean; + isAnimationBlocked?: boolean; + isTreeAnimationBlocked: () => boolean; + setAnimationOrigin(delta: Delta, hasOnlyRelativeTargetChanged?: boolean, pathFn?: MotionPath): void; + startAnimation(transition: ValueTransition): void; + finishAnimation(): void; + hasCheckedOptimisedAppear: boolean; + isLead(): boolean; + promote(options?: { + needsReset?: boolean; + transition?: Transition; + preserveFollowOpacity?: boolean; + }): void; + relegate(): boolean; + resumeFrom?: IProjectionNode; + resumingFrom?: IProjectionNode; + isPresent?: boolean; + addEventListener(name: LayoutEvents, handler: any): VoidFunction; + notifyListeners(name: LayoutEvents, ...args: any): void; + hasListeners(name: LayoutEvents): boolean; + hasTreeAnimated: boolean; + preserveOpacity?: boolean; +} +interface LayoutUpdateData { + layout: Box; + snapshot: Measurements; + delta: Delta; + layoutDelta: Delta; + hasLayoutChanged: boolean; + hasRelativeLayoutChanged: boolean; +} +type LayoutUpdateHandler = (data: LayoutUpdateData) => void; +interface ProjectionNodeConfig { + defaultParent?: () => IProjectionNode; + attachResizeListener?: (instance: I, notifyResize: VoidFunction) => VoidFunction; + measureScroll: (instance: I) => Point; + checkIsScrollRoot: (instance: I) => boolean; + resetTransform?: (instance: I, value?: string) => void; +} +/** + * Configuration for initial promotion of shared layout elements. + * This was originally in React's SwitchLayoutGroupContext but is now + * framework-agnostic to support vanilla JS usage. + */ +interface InitialPromotionConfig { + /** + * The initial transition to use when the elements in this group mount (and automatically promoted). + * Subsequent updates should provide a transition in the promote method. + */ + transition?: Transition; + /** + * If the follow tree should preserve its opacity when the lead is promoted on mount + */ + shouldPreserveFollowOpacity?: (member: IProjectionNode) => boolean; +} +interface ProjectionNodeOptions { + animate?: boolean; + layoutScroll?: boolean; + layoutRoot?: boolean; + alwaysMeasureLayout?: boolean; + onExitComplete?: VoidFunction; + animationType?: "size" | "position" | "both" | "preserve-aspect" | "x" | "y"; + layoutId?: string; + layout?: boolean | string; + visualElement?: VisualElement; + crossfade?: boolean; + transition?: Transition; + initialPromotionConfig?: InitialPromotionConfig; + layoutDependency?: unknown; + layoutAnchor?: Point | false; +} +type ProjectionEventName = "layoutUpdate" | "projectionUpdate"; + +declare class NodeStack { + lead?: IProjectionNode; + prevLead?: IProjectionNode; + members: IProjectionNode[]; + add(node: IProjectionNode): void; + remove(node: IProjectionNode): void; + relegate(node: IProjectionNode): boolean; + promote(node: IProjectionNode, preserveFollowOpacity?: boolean): void; + exitAnimationComplete(): void; + scheduleRender(): void; + removeLeadSnapshot(): void; +} + +declare function createProjectionNode({ attachResizeListener, defaultParent, measureScroll, checkIsScrollRoot, resetTransform, }: ProjectionNodeConfig): { + new (latestValues?: ResolvedValues$1, parent?: IProjectionNode | undefined): { + /** + * A unique ID generated for every projection node. + */ + id: number; + /** + * An id that represents a unique session instigated by startUpdate. + */ + animationId: number; + animationCommitId: number; + /** + * A reference to the platform-native node (currently this will be a HTMLElement). + */ + instance: I | undefined; + /** + * A reference to the root projection node. There'll only ever be one tree and one root. + */ + root: IProjectionNode; + /** + * A reference to this node's parent. + */ + parent?: IProjectionNode | undefined; + /** + * A path from this node to the root node. This provides a fast way to iterate + * back up the tree. + */ + path: IProjectionNode[]; + /** + * A Set containing all this component's children. This is used to iterate + * through the children. + * + * TODO: This could be faster to iterate as a flat array stored on the root node. + */ + children: Set>; + /** + * Options for the node. We use this to configure what kind of layout animations + * we should perform (if any). + */ + options: ProjectionNodeOptions; + /** + * A snapshot of the element's state just before the current update. This is + * hydrated when this node's `willUpdate` method is called and scrubbed at the + * end of the tree's `didUpdate` method. + */ + snapshot: Measurements | undefined; + /** + * A box defining the element's layout relative to the page. This will have been + * captured with all parent scrolls and projection transforms unset. + */ + layout: Measurements | undefined; + /** + * The layout used to calculate the previous layout animation. We use this to compare + * layouts between renders and decide whether we need to trigger a new layout animation + * or just let the current one play out. + */ + targetLayout?: Box | undefined; + /** + * A mutable data structure we use to apply all parent transforms currently + * acting on the element's layout. It's from here we can calculate the projectionDelta + * required to get the element from its layout into its calculated target box. + */ + layoutCorrected: Box; + /** + * An ideal projection transform we want to apply to the element. This is calculated, + * usually when an element's layout has changed, and we want the element to look as though + * its in its previous layout on the next frame. From there, we animated it down to 0 + * to animate the element to its new layout. + */ + targetDelta?: Delta | undefined; + /** + * A mutable structure representing the visual bounding box on the page where we want + * and element to appear. This can be set directly but is currently derived once a frame + * from apply targetDelta to layout. + */ + target?: Box | undefined; + /** + * A mutable structure describing a visual bounding box relative to the element's + * projected parent. If defined, target will be derived from this rather than targetDelta. + * If not defined, we'll attempt to calculate on the first layout animation frame + * based on the targets calculated from targetDelta. This will transfer a layout animation + * from viewport-relative to parent-relative. + */ + relativeTarget?: Box | undefined; + relativeTargetOrigin?: Box | undefined; + relativeParent?: IProjectionNode | undefined; + /** + * We use this to detect when its safe to shut down part of a projection tree. + * We have to keep projecting children for scale correction and relative projection + * until all their parents stop performing layout animations. + */ + isTreeAnimating: boolean; + isAnimationBlocked: boolean; + /** + * If true, attempt to resolve relativeTarget. + */ + attemptToResolveRelativeTarget?: boolean | undefined; + /** + * A mutable structure that represents the target as transformed by the element's + * latest user-set transforms (ie scale, x) + */ + targetWithTransforms?: Box | undefined; + /** + * The previous projection delta, which we can compare with the newly calculated + * projection delta to see if we need to render. + */ + prevProjectionDelta?: Delta | undefined; + /** + * A calculated transform that will project an element from its layoutCorrected + * into the target. This will be used by children to calculate their own layoutCorrect boxes. + */ + projectionDelta?: Delta | undefined; + /** + * A calculated transform that will project an element from its layoutCorrected + * into the targetWithTransforms. + */ + projectionDeltaWithTransform?: Delta | undefined; + /** + * If we're tracking the scroll of this element, we store it here. + */ + scroll?: ScrollMeasurements | undefined; + /** + * Flag to true if we think this layout has been changed. We can't always know this, + * currently we set it to true every time a component renders, or if it has a layoutDependency + * if that has changed between renders. Additionally, components can be grouped by LayoutGroup + * and if one node is dirtied, they all are. + */ + isLayoutDirty: boolean; + /** + * Flag to true if we think the projection calculations for this node needs + * recalculating as a result of an updated transform or layout animation. + */ + isProjectionDirty: boolean; + /** + * Flag to true if the layout *or* transform has changed. This then gets propagated + * throughout the projection tree, forcing any element below to recalculate on the next frame. + */ + isSharedProjectionDirty: boolean; + /** + * Flag transform dirty. This gets propagated throughout the whole tree but is only + * respected by shared nodes. + */ + isTransformDirty: boolean; + /** + * Block layout updates for instant layout transitions throughout the tree. + */ + updateManuallyBlocked: boolean; + updateBlockedByResize: boolean; + /** + * Set to true between the start of the first `willUpdate` call and the end of the `didUpdate` + * call. + */ + isUpdating: boolean; + /** + * If this is an SVG element we currently disable projection transforms + */ + isSVG: boolean; + /** + * Flag to true (during promotion) if a node doing an instant layout transition needs to reset + * its projection styles. + */ + needsReset: boolean; + /** + * Flags whether this node should have its transform reset prior to measuring. + */ + shouldResetTransform: boolean; + /** + * Store whether this node has been checked for optimised appear animations. As + * effects fire bottom-up, and we want to look up the tree for appear animations, + * this makes sure we only check each path once, stopping at nodes that + * have already been checked. + */ + hasCheckedOptimisedAppear: boolean; + /** + * An object representing the calculated contextual/accumulated/tree scale. + * This will be used to scale calculcated projection transforms, as these are + * calculated in screen-space but need to be scaled for elements to layoutly + * make it to their calculated destinations. + * + * TODO: Lazy-init + */ + treeScale: Point; + /** + * Is hydrated with a projection node if an element is animating from another. + */ + resumeFrom?: IProjectionNode | undefined; + /** + * Is hydrated with a projection node if an element is animating from another. + */ + resumingFrom?: IProjectionNode | undefined; + /** + * A reference to the element's latest animated values. This is a reference shared + * between the element's VisualElement and the ProjectionNode. + */ + latestValues: ResolvedValues$1; + /** + * + */ + eventHandlers: Map>; + nodes?: FlatTree | undefined; + depth: number; + /** + * If transformTemplate generates a different value before/after the + * update, we need to reset the transform. + */ + prevTransformTemplateValue: string | undefined; + preserveOpacity?: boolean | undefined; + hasTreeAnimated: boolean; + layoutVersion: number; + addEventListener(name: LayoutEvents, handler: any): VoidFunction; + notifyListeners(name: LayoutEvents, ...args: any): void; + hasListeners(name: LayoutEvents): boolean; + /** + * Lifecycles + */ + mount(instance: I): void; + unmount(): void; + blockUpdate(): void; + unblockUpdate(): void; + isUpdateBlocked(): boolean; + isTreeAnimationBlocked(): boolean; + startUpdate(): void; + getTransformTemplate(): TransformTemplate | undefined; + willUpdate(shouldNotifyListeners?: boolean): void; + updateScheduled: boolean; + update(): void; + scheduleUpdate: () => void; + didUpdate(): void; + clearAllSnapshots(): void; + projectionUpdateScheduled: boolean; + scheduleUpdateProjection(): void; + scheduleCheckAfterUnmount(): void; + checkUpdateFailed: () => void; + /** + * This is a multi-step process as shared nodes might be of different depths. Nodes + * are sorted by depth order, so we need to resolve the entire tree before moving to + * the next step. + */ + updateProjection: () => void; + /** + * Update measurements + */ + updateSnapshot(): void; + updateLayout(): void; + updateScroll(phase?: Phase): void; + resetTransform(): void; + measure(removeTransform?: boolean): { + animationId: number; + measuredBox: Box; + layoutBox: Box; + latestValues: {}; + source: number; + }; + measurePageBox(): Box; + removeElementScroll(box: Box): Box; + applyTransform(box: Box, transformOnly?: boolean, output?: Box): Box; + removeTransform(box: Box): Box; + setTargetDelta(delta: Delta): void; + setOptions(options: ProjectionNodeOptions): void; + clearMeasurements(): void; + forceRelativeParentToResolveTarget(): void; + /** + * Frame calculations + */ + resolvedRelativeTargetAt: number; + resolveTargetDelta(forceRecalculation?: boolean): void; + getClosestProjectingParent(): IProjectionNode | undefined; + isProjecting(): boolean; + linkedParentVersion: number; + createRelativeTarget(relativeParent: IProjectionNode, layout: Box, parentLayout: Box): void; + removeRelativeTarget(): void; + hasProjected: boolean; + calcProjection(): void; + isVisible: boolean; + hide(): void; + show(): void; + scheduleRender(notifyAll?: boolean): void; + createProjectionDeltas(): void; + /** + * Animation + */ + animationValues?: ResolvedValues$1 | undefined; + pendingAnimation?: Process | undefined; + currentAnimation?: JSAnimation | undefined; + mixTargetDelta: (progress: number) => void; + animationProgress: number; + setAnimationOrigin(delta: Delta, hasOnlyRelativeTargetChanged?: boolean, pathFn?: MotionPath): void; + motionValue?: MotionValue | undefined; + startAnimation(options: ValueAnimationOptions): void; + completeAnimation(): void; + finishAnimation(): void; + applyTransformsToTarget(): void; + /** + * Shared layout + */ + sharedNodes: Map; + registerSharedNode(layoutId: string, node: IProjectionNode): void; + isLead(): boolean; + getLead(): IProjectionNode | any; + getPrevLead(): IProjectionNode | undefined; + getStack(): NodeStack | undefined; + promote({ needsReset, transition, preserveFollowOpacity, }?: { + needsReset?: boolean | undefined; + transition?: Transition | undefined; + preserveFollowOpacity?: boolean | undefined; + }): void; + relegate(): boolean; + resetSkewAndRotation(): void; + applyProjectionStyles(targetStyle: any, styleProp?: MotionStyle): void; + clearSnapshot(): void; + resetTree(): void; + }; +}; +declare function propagateDirtyNodes(node: IProjectionNode): void; +declare function cleanDirtyNodes(node: IProjectionNode): void; + +declare const DocumentProjectionNode: { + new (latestValues?: ResolvedValues$1, parent?: IProjectionNode | undefined): { + id: number; + animationId: number; + animationCommitId: number; + instance: Window | undefined; + root: IProjectionNode; + parent?: IProjectionNode | undefined; + path: IProjectionNode[]; + children: Set>; + options: ProjectionNodeOptions; + snapshot: Measurements | undefined; + layout: Measurements | undefined; + targetLayout?: motion_utils.Box | undefined; + layoutCorrected: motion_utils.Box; + targetDelta?: motion_utils.Delta | undefined; + target?: motion_utils.Box | undefined; + relativeTarget?: motion_utils.Box | undefined; + relativeTargetOrigin?: motion_utils.Box | undefined; + relativeParent?: IProjectionNode | undefined; + isTreeAnimating: boolean; + isAnimationBlocked: boolean; + attemptToResolveRelativeTarget?: boolean | undefined; + targetWithTransforms?: motion_utils.Box | undefined; + prevProjectionDelta?: motion_utils.Delta | undefined; + projectionDelta?: motion_utils.Delta | undefined; + projectionDeltaWithTransform?: motion_utils.Delta | undefined; + scroll?: ScrollMeasurements | undefined; + isLayoutDirty: boolean; + isProjectionDirty: boolean; + isSharedProjectionDirty: boolean; + isTransformDirty: boolean; + updateManuallyBlocked: boolean; + updateBlockedByResize: boolean; + isUpdating: boolean; + isSVG: boolean; + needsReset: boolean; + shouldResetTransform: boolean; + hasCheckedOptimisedAppear: boolean; + treeScale: motion_utils.Point; + resumeFrom?: IProjectionNode | undefined; + resumingFrom?: IProjectionNode | undefined; + latestValues: ResolvedValues$1; + eventHandlers: Map>; + nodes?: FlatTree | undefined; + depth: number; + prevTransformTemplateValue: string | undefined; + preserveOpacity?: boolean | undefined; + hasTreeAnimated: boolean; + layoutVersion: number; + addEventListener(name: LayoutEvents, handler: any): VoidFunction; + notifyListeners(name: LayoutEvents, ...args: any): void; + hasListeners(name: LayoutEvents): boolean; + mount(instance: Window): void; + unmount(): void; + blockUpdate(): void; + unblockUpdate(): void; + isUpdateBlocked(): boolean; + isTreeAnimationBlocked(): boolean; + startUpdate(): void; + getTransformTemplate(): TransformTemplate | undefined; + willUpdate(shouldNotifyListeners?: boolean): void; + updateScheduled: boolean; + update(): void; + scheduleUpdate: () => void; + didUpdate(): void; + clearAllSnapshots(): void; + projectionUpdateScheduled: boolean; + scheduleUpdateProjection(): void; + scheduleCheckAfterUnmount(): void; + checkUpdateFailed: () => void; + updateProjection: () => void; + updateSnapshot(): void; + updateLayout(): void; + updateScroll(phase?: Phase): void; + resetTransform(): void; + measure(removeTransform?: boolean): { + animationId: number; + measuredBox: motion_utils.Box; + layoutBox: motion_utils.Box; + latestValues: {}; + source: number; + }; + measurePageBox(): motion_utils.Box; + removeElementScroll(box: motion_utils.Box): motion_utils.Box; + applyTransform(box: motion_utils.Box, transformOnly?: boolean, output?: motion_utils.Box | undefined): motion_utils.Box; + removeTransform(box: motion_utils.Box): motion_utils.Box; + setTargetDelta(delta: motion_utils.Delta): void; + setOptions(options: ProjectionNodeOptions): void; + clearMeasurements(): void; + forceRelativeParentToResolveTarget(): void; + resolvedRelativeTargetAt: number; + resolveTargetDelta(forceRecalculation?: boolean): void; + getClosestProjectingParent(): IProjectionNode | undefined; + isProjecting(): boolean; + linkedParentVersion: number; + createRelativeTarget(relativeParent: IProjectionNode, layout: motion_utils.Box, parentLayout: motion_utils.Box): void; + removeRelativeTarget(): void; + hasProjected: boolean; + calcProjection(): void; + isVisible: boolean; + hide(): void; + show(): void; + scheduleRender(notifyAll?: boolean): void; + createProjectionDeltas(): void; + animationValues?: ResolvedValues$1 | undefined; + pendingAnimation?: Process | undefined; + currentAnimation?: JSAnimation | undefined; + mixTargetDelta: (progress: number) => void; + animationProgress: number; + setAnimationOrigin(delta: motion_utils.Delta, hasOnlyRelativeTargetChanged?: boolean, pathFn?: MotionPath | undefined): void; + motionValue?: MotionValue | undefined; + startAnimation(options: ValueAnimationOptions): void; + completeAnimation(): void; + finishAnimation(): void; + applyTransformsToTarget(): void; + sharedNodes: Map; + registerSharedNode(layoutId: string, node: IProjectionNode): void; + isLead(): boolean; + getLead(): IProjectionNode | any; + getPrevLead(): IProjectionNode | undefined; + getStack(): NodeStack | undefined; + promote({ needsReset, transition, preserveFollowOpacity, }?: { + needsReset?: boolean | undefined; + transition?: Transition | undefined; + preserveFollowOpacity?: boolean | undefined; + }): void; + relegate(): boolean; + resetSkewAndRotation(): void; + applyProjectionStyles(targetStyle: any, styleProp?: MotionStyle | undefined): void; + clearSnapshot(): void; + resetTree(): void; + }; +}; + +interface NodeGroup { + add: (node: IProjectionNode) => void; + remove: (node: IProjectionNode) => void; + dirty: VoidFunction; +} +declare function nodeGroup(): NodeGroup; + +declare const rootProjectionNode: { + current: IProjectionNode | undefined; +}; +declare const HTMLProjectionNode: { + new (latestValues?: ResolvedValues$1, parent?: IProjectionNode | undefined): { + id: number; + animationId: number; + animationCommitId: number; + instance: HTMLElement | undefined; + root: IProjectionNode; + parent?: IProjectionNode | undefined; + path: IProjectionNode[]; + children: Set>; + options: ProjectionNodeOptions; + snapshot: Measurements | undefined; + layout: Measurements | undefined; + targetLayout?: motion_utils.Box | undefined; + layoutCorrected: motion_utils.Box; + targetDelta?: motion_utils.Delta | undefined; + target?: motion_utils.Box | undefined; + relativeTarget?: motion_utils.Box | undefined; + relativeTargetOrigin?: motion_utils.Box | undefined; + relativeParent?: IProjectionNode | undefined; + isTreeAnimating: boolean; + isAnimationBlocked: boolean; + attemptToResolveRelativeTarget?: boolean | undefined; + targetWithTransforms?: motion_utils.Box | undefined; + prevProjectionDelta?: motion_utils.Delta | undefined; + projectionDelta?: motion_utils.Delta | undefined; + projectionDeltaWithTransform?: motion_utils.Delta | undefined; + scroll?: ScrollMeasurements | undefined; + isLayoutDirty: boolean; + isProjectionDirty: boolean; + isSharedProjectionDirty: boolean; + isTransformDirty: boolean; + updateManuallyBlocked: boolean; + updateBlockedByResize: boolean; + isUpdating: boolean; + isSVG: boolean; + needsReset: boolean; + shouldResetTransform: boolean; + hasCheckedOptimisedAppear: boolean; + treeScale: motion_utils.Point; + resumeFrom?: IProjectionNode | undefined; + resumingFrom?: IProjectionNode | undefined; + latestValues: ResolvedValues$1; + eventHandlers: Map>; + nodes?: FlatTree | undefined; + depth: number; + prevTransformTemplateValue: string | undefined; + preserveOpacity?: boolean | undefined; + hasTreeAnimated: boolean; + layoutVersion: number; + addEventListener(name: LayoutEvents, handler: any): VoidFunction; + notifyListeners(name: LayoutEvents, ...args: any): void; + hasListeners(name: LayoutEvents): boolean; + mount(instance: HTMLElement): void; + unmount(): void; + blockUpdate(): void; + unblockUpdate(): void; + isUpdateBlocked(): boolean; + isTreeAnimationBlocked(): boolean; + startUpdate(): void; + getTransformTemplate(): TransformTemplate | undefined; + willUpdate(shouldNotifyListeners?: boolean): void; + updateScheduled: boolean; + update(): void; + scheduleUpdate: () => void; + didUpdate(): void; + clearAllSnapshots(): void; + projectionUpdateScheduled: boolean; + scheduleUpdateProjection(): void; + scheduleCheckAfterUnmount(): void; + checkUpdateFailed: () => void; + updateProjection: () => void; + updateSnapshot(): void; + updateLayout(): void; + updateScroll(phase?: Phase): void; + resetTransform(): void; + measure(removeTransform?: boolean): { + animationId: number; + measuredBox: motion_utils.Box; + layoutBox: motion_utils.Box; + latestValues: {}; + source: number; + }; + measurePageBox(): motion_utils.Box; + removeElementScroll(box: motion_utils.Box): motion_utils.Box; + applyTransform(box: motion_utils.Box, transformOnly?: boolean, output?: motion_utils.Box | undefined): motion_utils.Box; + removeTransform(box: motion_utils.Box): motion_utils.Box; + setTargetDelta(delta: motion_utils.Delta): void; + setOptions(options: ProjectionNodeOptions): void; + clearMeasurements(): void; + forceRelativeParentToResolveTarget(): void; + resolvedRelativeTargetAt: number; + resolveTargetDelta(forceRecalculation?: boolean): void; + getClosestProjectingParent(): IProjectionNode | undefined; + isProjecting(): boolean; + linkedParentVersion: number; + createRelativeTarget(relativeParent: IProjectionNode, layout: motion_utils.Box, parentLayout: motion_utils.Box): void; + removeRelativeTarget(): void; + hasProjected: boolean; + calcProjection(): void; + isVisible: boolean; + hide(): void; + show(): void; + scheduleRender(notifyAll?: boolean): void; + createProjectionDeltas(): void; + animationValues?: ResolvedValues$1 | undefined; + pendingAnimation?: Process | undefined; + currentAnimation?: JSAnimation | undefined; + mixTargetDelta: (progress: number) => void; + animationProgress: number; + setAnimationOrigin(delta: motion_utils.Delta, hasOnlyRelativeTargetChanged?: boolean, pathFn?: MotionPath | undefined): void; + motionValue?: MotionValue | undefined; + startAnimation(options: ValueAnimationOptions): void; + completeAnimation(): void; + finishAnimation(): void; + applyTransformsToTarget(): void; + sharedNodes: Map; + registerSharedNode(layoutId: string, node: IProjectionNode): void; + isLead(): boolean; + getLead(): IProjectionNode | any; + getPrevLead(): IProjectionNode | undefined; + getStack(): NodeStack | undefined; + promote({ needsReset, transition, preserveFollowOpacity, }?: { + needsReset?: boolean | undefined; + transition?: Transition | undefined; + preserveFollowOpacity?: boolean | undefined; + }): void; + relegate(): boolean; + resetSkewAndRotation(): void; + applyProjectionStyles(targetStyle: any, styleProp?: MotionStyle | undefined): void; + clearSnapshot(): void; + resetTree(): void; + }; +}; + +/** + * This should only ever be modified on the client otherwise it'll + * persist through server requests. If we need instanced states we + * could lazy-init via root. + */ +declare const globalProjectionState: { + /** + * Global flag as to whether the tree has animated since the last time + * we resized the window + */ + hasAnimatedSinceResize: boolean; + /** + * We set this to true once, on the first update. Any nodes added to the tree beyond that + * update will be given a `data-projection-id` attribute. + */ + hasEverUpdated: boolean; +}; + +declare function camelToDash(str: string): string; + +declare function buildHTMLStyles(state: HTMLRenderState, latestValues: ResolvedValues$1, transformTemplate?: MotionNodeOptions["transformTemplate"]): void; + +/** + * Build a CSS transform style from individual x/y/scale etc properties. + * + * This outputs with a default order of transforms/scales/rotations, this can be customised by + * providing a transformTemplate function. + */ +declare function buildTransform(latestValues: ResolvedValues$1, transform: HTMLRenderState["transform"], transformTemplate?: MotionNodeOptions["transformTemplate"]): string; + +declare function scrapeMotionValuesFromProps$1(props: MotionNodeOptions, prevProps: MotionNodeOptions, visualElement?: VisualElement): { + [key: string]: any; +}; + +/** + * Build SVG visual attributes, like cx and style.transform + */ +declare function buildSVGAttrs(state: SVGRenderState, { attrX, attrY, attrScale, pathLength, pathSpacing, pathOffset, ...latest }: ResolvedValues$1, isSVGTag: boolean, transformTemplate?: MotionNodeOptions["transformTemplate"], styleProp?: Record): void; + +/** + * A set of attribute names that are always read/written as camel case. + */ +declare const camelCaseAttributes: Set; + +declare const isSVGTag: (tag: unknown) => boolean; + +/** + * Build SVG path properties. Uses the path's measured length to convert + * our custom pathLength, pathSpacing and pathOffset into stroke-dashoffset + * and stroke-dasharray attributes. + * + * This function is mutative to reduce per-frame GC. + * + * Note: We use unitless values for stroke-dasharray and stroke-dashoffset + * because Safari incorrectly scales px values when the page is zoomed. + */ +declare function buildSVGPath(attrs: ResolvedValues$1, length: number, spacing?: number, offset?: number, useDashCase?: boolean): void; + +declare function renderSVG(element: SVGElement, renderState: SVGRenderState, _styleProp?: MotionStyle, projection?: any): void; + +declare function scrapeMotionValuesFromProps(props: MotionNodeOptions, prevProps: MotionNodeOptions, visualElement?: VisualElement): { + [key: string]: any; +}; + +type LayoutAnimationScope = Element | Document; +type LayoutBuilderResolve = (animation: GroupAnimation) => void; +type LayoutBuilderReject = (error: unknown) => void; +declare class LayoutAnimationBuilder { + private scope; + private updateDom; + private defaultOptions?; + private sharedTransitions; + private notifyReady; + private rejectReady; + private readyPromise; + private tracked; + private restorePoints; + private updateError; + constructor(scope: LayoutAnimationScope, updateDom: () => void | Promise, defaultOptions?: AnimationOptions | undefined); + shared(id: string, transition: AnimationOptions): this; + then(resolve: LayoutBuilderResolve, reject?: LayoutBuilderReject): Promise; + transitionFor(element: HTMLElement): Transition | undefined; + adopt(element: HTMLElement, node: IProjectionNode): void; + collectTargets(): HTMLElement[]; + runUpdate(): Promise | undefined; + reconcileAdditions(newMemberIds: Set): void; + reconcileRemovals(newMemberIds: Set): void; + getRoot(): IProjectionNode | undefined; + finalize(): void; +} +declare function parseAnimateLayoutArgs(scopeOrUpdateDom: ElementOrSelector | (() => void), updateDomOrOptions?: (() => void) | AnimationOptions, options?: AnimationOptions): { + scope: Element | Document; + updateDom: () => void; + defaultOptions?: AnimationOptions; +}; + +/** + * @deprecated + * + * Import as `frame` instead. + */ +declare const sync: Batcher; +/** + * @deprecated + * + * Use cancelFrame(callback) instead. + */ +declare const cancelSync: Record void>; + +export { type AccelerateConfig, type AcceptedAnimations, type ActiveStatsBuffer, type AnimationDefinition, type AnimationGeneratorName, type AnimationGeneratorType, type AnimationList, type AnimationOptions, type AnimationOrchestrationOptions, type AnimationPlaybackControls, type AnimationPlaybackControlsWithThen, type AnimationPlaybackLifecycles, type AnimationPlaybackOptions, type AnimationScope, type AnimationState$1 as AnimationState, type AnimationType, type AnimationTypeState, type AnyResolvedKeyframe, type ArcOptions, AsyncMotionValueAnimation, type Batcher, type CSSStyleDeclarationWithTransform, type CSSVariableName, type CSSVariableToken, type CancelProcess, type Color, type ComplexValueInfo, type ComplexValues, type DOMKeyframesDefinition, DOMKeyframesResolver, type DOMValueAnimationOptions, DOMVisualElement, type DOMVisualElementOptions, type DecayOptions, type DelayedFunction, DocumentProjectionNode, type DragElastic, type DragHandler, type DraggableProps, type DurationSpringOptions, type DynamicOption, type ElementOrSelector, type EventInfo, type EventOptions, Feature, type FeatureClass, FlatTree, type FollowValueOptions, type FrameData, type GeneratorFactory, type GeneratorFactoryFunction, GroupAnimation, GroupAnimationWithThen, type GroupedAnimations, type HSLA, HTMLProjectionNode, type HTMLRenderState, HTMLVisualElement, type HandoffFunction, type IProjectionNode, type InactiveStatsBuffer, type InertiaOptions, type InitialPromotionConfig, type InterpolateOptions, JSAnimation, type KeyframeGenerator, type KeyframeOptions, KeyframeResolver, LayoutAnimationBuilder, type LayoutEvents, type LayoutLifecycles, type LayoutProjectionMetrics, type LayoutProjectionStats, type LayoutUpdateData, type LayoutUpdateHandler, type LegacyAnimationControls, type MapInputRange, type Measurements, type Mixer, type MixerFactory, type MotionConfigContextProps, type MotionNodeAdvancedOptions, type MotionNodeAnimationOptions, type MotionNodeDragHandlers, type MotionNodeDraggableOptions, type MotionNodeEventOptions, type MotionNodeFocusHandlers, type MotionNodeHoverHandlers, type MotionNodeLayoutOptions, type MotionNodeOptions, type MotionNodePanHandlers, type MotionNodeTapHandlers, type MotionNodeViewportOptions, type MotionPath, type MotionStyle, MotionValue, type MotionValueEventCallbacks, type MotionValueOptions, type MultiTransformer, NativeAnimation, NativeAnimationExtended, type NativeAnimationOptions, type NativeAnimationOptionsExtended, NativeAnimationWrapper, type NodeGroup, NodeStack, type NumberMap, ObjectVisualElement, type OnHoverEndEvent, type OnHoverStartEvent, type OnKeyframesResolved, type OnPressEndEvent, type OnPressStartEvent, type Owner, type PanHandler, type PanInfo, type PassiveEffect, type PathInterpolator, type PathState, type Phase, type Point2D, type PointerEventOptions, type PresenceContextProps, type PressGestureInfo, type Process, type ProgressTimeline, type ProjectionEventName, type ProjectionNodeConfig, type ProjectionNodeOptions, type PropagateOptions, type RGBA, type ReducedMotionConfig, type RepeatType, type ResolvedConstraints, type ResolvedElastic, type ResolvedKeyframes, type ResolvedValueKeyframe, type ResolvedValues$1 as ResolvedValues, type SVGAttributes, type SVGForcedAttrKeyframesDefinition, type SVGForcedAttrProperties, type SVGForcedAttrTransitions, type SVGKeyframesDefinition, type SVGPathKeyframesDefinition, type SVGPathProperties, type SVGPathTransitions, type SVGRenderState, type SVGTransitions, SVGVisualElement, type ScaleCorrectionNode, type ScaleCorrector, type ScaleCorrectorDefinition, type ScaleCorrectorMap, type Schedule, type ScrapeMotionValuesFromProps, type ScrollMeasurements, type SelectorCache, type SingleTransformer, type Spring, type SpringOptions, type StaggerOptions, type StaggerOrigin, type StartAnimation, type StatsRecording, type Step, type StepId, type Steps, type StyleKeyframesDefinition, type StyleTransitions, type Subscriber, type TapHandlers, type TapInfo, type Target, type TargetAndTransition, type TargetResolver, type TimelineWithFallback, type TransformInputRange, type TransformOptions, type TransformOrigin, type TransformProperties, type TransformTemplate, type Transformer, type Transition, type TransitionWithValueOverrides, type Tween, type UnresolvedKeyframes, type UnresolvedValueKeyframe, type UseRenderState, type ValueAnimationOptions, type ValueAnimationOptionsWithRenderContext, type ValueAnimationTransition, type ValueAnimationWithDynamicDelay, type ValueIndexes, type ValueKeyframe, type ValueKeyframesDefinition, type ValueTransformer, type ValueTransition, type ValueType, type ValueTypeMap, type VariableKeyframesDefinition, type VariableTransitions, type Variant, type VariantLabels, type Variants, type VelocityOptions, type ViewTransitionAnimationDefinition, ViewTransitionBuilder, type ViewTransitionOptions, type ViewTransitionTarget, type ViewTransitionTargetDefinition, type ViewportEventHandler, type ViewportOptions, VisualElement, type VisualElementAnimationOptions, type VisualElementEventCallbacks, type VisualElementOptions, type VisualState, type WillChange, type WithAppearProps, type WithDepth, type WithQuerySelectorAll, acceleratedValues, addAttrValue, addDomEvent, addScaleCorrector, addStyleValue, addValueToWillChange, alpha, analyseComplexValue, animateMotionValue, animateSingleValue, animateTarget, animateValue, animateVariant, animateView, animateVisualElement, animationMapKey, applyAxisDelta, applyBoxDelta, applyGeneratorOptions, applyPointDelta, applyPxDefaults, applyTreeDeltas, arc, aspectRatio, attachFollow, attachSpring, attrEffect, axisDeltaEquals, axisEquals, axisEqualsRounded, boxEquals, boxEqualsRounded, buildHTMLStyles, buildProjectionTransform, buildSVGAttrs, buildSVGPath, buildTransform, calcAxisDelta, calcBoxDelta, calcChildStagger, calcGeneratorDuration, calcLength, calcRelativeAxis, calcRelativeAxisPosition, calcRelativeBox, calcRelativePosition, camelCaseAttributes, camelToDash, cancelFrame, cancelMicrotask, cancelSync, checkVariantsDidChange, cleanDirtyNodes, collectMotionValues, color, compareByDepth, complex, containsCSSVariable, convertBoundingBoxToBox, convertBoxToBoundingBox, convertOffsetToTimes, copyAxisDeltaInto, copyAxisInto, copyBoxInto, correctBorderRadius, correctBoxShadow, createAnimationState, createAxis, createAxisDelta, createBox, createDelta, createGeneratorEasing, createProjectionNode, createRenderBatcher, cubicBezierAsString, defaultEasing, defaultOffset, defaultTransformValue, defaultValueTypes, degrees, delay, delayInSeconds, dimensionValueTypes, eachAxis, fillOffset, fillWildcards, findDimensionValueType, findValueType, flushKeyframeResolvers, followValue, frame, frameData, frameSteps, generateLinearEasing, getAnimatableNone, getAnimationMap, getComputedStyle, getDefaultTransition, getDefaultValueType, getFeatureDefinitions, getFinalKeyframe, getMixer, getOptimisedAppearId, getOriginIndex, getValueAsType, getValueTransition, getVariableValue, getVariantContext, getViewAnimationLayerInfo, getViewAnimations, globalProjectionState, has2DTranslate, hasReducedMotionListener, hasScale, hasTransform, hex, hover, hsla, hslaToRgba, inertia, initPrefersReducedMotion, interpolate, invisibleValues, isAnimationControls, isCSSVariableName, isCSSVariableToken, isControllingVariants, isDeltaZero, isDragActive, isDragging, isElementKeyboardAccessible, isElementTextInput, isForcedMotionValue, isGenerator, isHTMLElement, isKeyframesTarget, isMotionValue, isNear, isNodeOrChild, isPrimaryPointer, isSVGElement, isSVGSVGElement, isSVGTag, isTransitionDefined, isVariantLabel, isVariantNode, isWaapiSupportedEasing, isWillChangeMotionValue, keyframes, makeAnimationInstant, mapEasingToNativeEasing, mapValue, maxGeneratorDuration, measurePageBox, measureViewportBox, microtask, mix, mixArray, mixColor, mixComplex, mixImmediate, mixLinearColor, mixNumber, mixObject, mixValues, mixVisibility, motionValue, nodeGroup, number, numberValueTypes, observeTimeline, optimizedAppearDataAttribute, optimizedAppearDataId, parseAnimateLayoutArgs, parseCSSVariable, parseValueFromTransform, percent, pixelsToPercent, positionalKeys, prefersReducedMotion, press, progressPercentage, propEffect, propagateDirtyNodes, px, readTransformValue, recordStats, removeAxisDelta, removeAxisTransforms, removeBoxTransforms, removePointDelta, renderHTML, renderSVG, resize, resolveElements, resolveMotionValue, resolveTransition, resolveVariant, resolveVariantFromProps, rgbUnit, rgba, rootProjectionNode, scale, scaleCorrectors, scalePoint, scrapeMotionValuesFromProps$1 as scrapeHTMLMotionValuesFromProps, scrapeMotionValuesFromProps as scrapeSVGMotionValuesFromProps, setDragLock, setFeatureDefinitions, setStyle, setTarget, spring, springValue, stagger, startWaapiAnimation, statsBuffer, styleEffect, supportedWaapiEasing, supportsBrowserAnimation, supportsFlags, supportsLinearEasing, supportsPartialKeyframes, supportsScrollTimeline, supportsViewTimeline, svgEffect, sync, testValueType, time, transform, transformAxis, transformBox, transformBoxPoints, transformPropOrder, transformProps, transformValue, transformValueTypes, translateAxis, updateMotionValuesFromProps, variantPriorityOrder, variantProps, vh, visualElementStore, vw }; diff --git a/node_modules/motion-dom/dist/motion-dom.dev.js b/node_modules/motion-dom/dist/motion-dom.dev.js new file mode 100644 index 0000000..56d6a16 --- /dev/null +++ b/node_modules/motion-dom/dist/motion-dom.dev.js @@ -0,0 +1,11036 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('motion-utils')) : + typeof define === 'function' && define.amd ? define(['exports', 'motion-utils'], factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.MotionDom = {}, global.MotionUtils)); +})(this, (function (exports, motionUtils) { 'use strict'; + + const stepsOrder = [ + "setup", // Compute + "read", // Read + "resolveKeyframes", // Write/Read/Write/Read + "preUpdate", // Compute + "update", // Compute + "preRender", // Compute + "render", // Write + "postRender", // Compute + ]; + + function createRenderStep(runNextFrame) { + /** + * We create and reuse two queues, one to queue jobs for the current frame + * and one for the next. We reuse to avoid triggering GC after x frames. + */ + let thisFrame = new Set(); + let nextFrame = new Set(); + /** + * Track whether we're currently processing jobs in this step. This way + * we can decide whether to schedule new jobs for this frame or next. + */ + let isProcessing = false; + let flushNextFrame = false; + /** + * A set of processes which were marked keepAlive when scheduled. + */ + const toKeepAlive = new WeakSet(); + let latestFrameData = { + delta: 0.0, + timestamp: 0.0, + isProcessing: false, + }; + function triggerCallback(callback) { + if (toKeepAlive.has(callback)) { + step.schedule(callback); + runNextFrame(); + } + callback(latestFrameData); + } + const step = { + /** + * Schedule a process to run on the next frame. + */ + schedule: (callback, keepAlive = false, immediate = false) => { + const addToCurrentFrame = immediate && isProcessing; + const queue = addToCurrentFrame ? thisFrame : nextFrame; + if (keepAlive) + toKeepAlive.add(callback); + queue.add(callback); + return callback; + }, + /** + * Cancel the provided callback from running on the next frame. + */ + cancel: (callback) => { + nextFrame.delete(callback); + toKeepAlive.delete(callback); + }, + /** + * Execute all schedule callbacks. + */ + process: (frameData) => { + latestFrameData = frameData; + /** + * If we're already processing we've probably been triggered by a flushSync + * inside an existing process. Instead of executing, mark flushNextFrame + * as true and ensure we flush the following frame at the end of this one. + */ + if (isProcessing) { + flushNextFrame = true; + return; + } + isProcessing = true; + // Swap this frame and the next to avoid GC + const prevFrame = thisFrame; + thisFrame = nextFrame; + nextFrame = prevFrame; + // Execute this frame + thisFrame.forEach(triggerCallback); + // Clear the frame so no callbacks remain. This is to avoid + // memory leaks should this render step not run for a while. + thisFrame.clear(); + isProcessing = false; + if (flushNextFrame) { + flushNextFrame = false; + step.process(frameData); + } + }, + }; + return step; + } + + const maxElapsed = 40; + function createRenderBatcher(scheduleNextBatch, allowKeepAlive) { + let runNextFrame = false; + let useDefaultElapsed = true; + const state = { + delta: 0.0, + timestamp: 0.0, + isProcessing: false, + }; + const flagRunNextFrame = () => (runNextFrame = true); + const steps = stepsOrder.reduce((acc, key) => { + acc[key] = createRenderStep(flagRunNextFrame); + return acc; + }, {}); + const { setup, read, resolveKeyframes, preUpdate, update, preRender, render, postRender, } = steps; + const processBatch = () => { + const useManualTiming = motionUtils.MotionGlobalConfig.useManualTiming; + const timestamp = useManualTiming + ? state.timestamp + : performance.now(); + runNextFrame = false; + if (!useManualTiming) { + state.delta = useDefaultElapsed + ? 1000 / 60 + : Math.max(Math.min(timestamp - state.timestamp, maxElapsed), 1); + } + state.timestamp = timestamp; + state.isProcessing = true; + // Unrolled render loop for better per-frame performance + setup.process(state); + read.process(state); + resolveKeyframes.process(state); + preUpdate.process(state); + update.process(state); + preRender.process(state); + render.process(state); + postRender.process(state); + state.isProcessing = false; + if (runNextFrame && allowKeepAlive) { + useDefaultElapsed = false; + scheduleNextBatch(processBatch); + } + }; + const wake = () => { + runNextFrame = true; + useDefaultElapsed = true; + if (!state.isProcessing) { + scheduleNextBatch(processBatch); + } + }; + const schedule = stepsOrder.reduce((acc, key) => { + const step = steps[key]; + acc[key] = (process, keepAlive = false, immediate = false) => { + if (!runNextFrame) + wake(); + return step.schedule(process, keepAlive, immediate); + }; + return acc; + }, {}); + const cancel = (process) => { + for (let i = 0; i < stepsOrder.length; i++) { + steps[stepsOrder[i]].cancel(process); + } + }; + return { schedule, cancel, state, steps }; + } + + const { schedule: frame, cancel: cancelFrame, state: frameData, steps: frameSteps, } = /* @__PURE__ */ createRenderBatcher(typeof requestAnimationFrame !== "undefined" ? requestAnimationFrame : motionUtils.noop, true); + + let now; + function clearTime() { + now = undefined; + } + /** + * An eventloop-synchronous alternative to performance.now(). + * + * Ensures that time measurements remain consistent within a synchronous context. + * Usually calling performance.now() twice within the same synchronous context + * will return different values which isn't useful for animations when we're usually + * trying to sync animations to the same frame. + */ + const time = { + now: () => { + if (now === undefined) { + time.set(frameData.isProcessing || motionUtils.MotionGlobalConfig.useManualTiming + ? frameData.timestamp + : performance.now()); + } + return now; + }, + set: (newTime) => { + now = newTime; + queueMicrotask(clearTime); + }, + }; + + const checkStringStartsWith = (token) => (key) => typeof key === "string" && key.startsWith(token); + const isCSSVariableName = + /*@__PURE__*/ checkStringStartsWith("--"); + const startsAsVariableToken = + /*@__PURE__*/ checkStringStartsWith("var(--"); + const isCSSVariableToken = (value) => { + const startsWithToken = startsAsVariableToken(value); + if (!startsWithToken) + return false; + // Ensure any comments are stripped from the value as this can harm performance of the regex. + return singleCssVariableRegex.test(value.split("/*")[0].trim()); + }; + const singleCssVariableRegex = /var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu; + /** + * Check if a value contains a CSS variable anywhere (e.g. inside calc()). + * Unlike isCSSVariableToken which checks if the value IS a var() token, + * this checks if the value CONTAINS var() somewhere in the string. + */ + function containsCSSVariable(value) { + if (typeof value !== "string") + return false; + // Strip comments to avoid false positives + return value.split("/*")[0].includes("var(--"); + } + + const number = { + test: (v) => typeof v === "number", + parse: parseFloat, + transform: (v) => v, + }; + const alpha = { + ...number, + transform: (v) => motionUtils.clamp(0, 1, v), + }; + const scale = { + ...number, + default: 1, + }; + + // If this number is a decimal, make it just five decimal places + // to avoid exponents + const sanitize = (v) => Math.round(v * 100000) / 100000; + + const floatRegex = /-?(?:\d+(?:\.\d+)?|\.\d+)/gu; + + function isNullish(v) { + return v == null; + } + + const singleColorRegex = /^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu; + + /** + * Returns true if the provided string is a color, ie rgba(0,0,0,0) or #000, + * but false if a number or multiple colors + */ + const isColorString = (type, testProp) => (v) => { + return Boolean((typeof v === "string" && + singleColorRegex.test(v) && + v.startsWith(type)) || + (testProp && + !isNullish(v) && + Object.prototype.hasOwnProperty.call(v, testProp))); + }; + const splitColor = (aName, bName, cName) => (v) => { + if (typeof v !== "string") + return v; + const [a, b, c, alpha] = v.match(floatRegex); + return { + [aName]: parseFloat(a), + [bName]: parseFloat(b), + [cName]: parseFloat(c), + alpha: alpha !== undefined ? parseFloat(alpha) : 1, + }; + }; + + const clampRgbUnit = (v) => motionUtils.clamp(0, 255, v); + const rgbUnit = { + ...number, + transform: (v) => Math.round(clampRgbUnit(v)), + }; + const rgba = { + test: /*@__PURE__*/ isColorString("rgb", "red"), + parse: /*@__PURE__*/ splitColor("red", "green", "blue"), + transform: ({ red, green, blue, alpha: alpha$1 = 1 }) => "rgba(" + + rgbUnit.transform(red) + + ", " + + rgbUnit.transform(green) + + ", " + + rgbUnit.transform(blue) + + ", " + + sanitize(alpha.transform(alpha$1)) + + ")", + }; + + function parseHex(v) { + let r = ""; + let g = ""; + let b = ""; + let a = ""; + // If we have 6 characters, ie #FF0000 + if (v.length > 5) { + r = v.substring(1, 3); + g = v.substring(3, 5); + b = v.substring(5, 7); + a = v.substring(7, 9); + // Or we have 3 characters, ie #F00 + } + else { + r = v.substring(1, 2); + g = v.substring(2, 3); + b = v.substring(3, 4); + a = v.substring(4, 5); + r += r; + g += g; + b += b; + a += a; + } + return { + red: parseInt(r, 16), + green: parseInt(g, 16), + blue: parseInt(b, 16), + alpha: a ? parseInt(a, 16) / 255 : 1, + }; + } + const hex = { + test: /*@__PURE__*/ isColorString("#"), + parse: parseHex, + transform: rgba.transform, + }; + + /*#__NO_SIDE_EFFECTS__*/ + const createUnitType = (unit) => ({ + test: (v) => typeof v === "string" && v.endsWith(unit) && v.split(" ").length === 1, + parse: parseFloat, + transform: (v) => `${v}${unit}`, + }); + const degrees = /*@__PURE__*/ createUnitType("deg"); + const percent = /*@__PURE__*/ createUnitType("%"); + const px = /*@__PURE__*/ createUnitType("px"); + const vh = /*@__PURE__*/ createUnitType("vh"); + const vw = /*@__PURE__*/ createUnitType("vw"); + const progressPercentage = /*@__PURE__*/ (() => ({ + ...percent, + parse: (v) => percent.parse(v) / 100, + transform: (v) => percent.transform(v * 100), + }))(); + + const hsla = { + test: /*@__PURE__*/ isColorString("hsl", "hue"), + parse: /*@__PURE__*/ splitColor("hue", "saturation", "lightness"), + transform: ({ hue, saturation, lightness, alpha: alpha$1 = 1 }) => { + return ("hsla(" + + Math.round(hue) + + ", " + + percent.transform(sanitize(saturation)) + + ", " + + percent.transform(sanitize(lightness)) + + ", " + + sanitize(alpha.transform(alpha$1)) + + ")"); + }, + }; + + const color = { + test: (v) => rgba.test(v) || hex.test(v) || hsla.test(v), + parse: (v) => { + if (rgba.test(v)) { + return rgba.parse(v); + } + else if (hsla.test(v)) { + return hsla.parse(v); + } + else { + return hex.parse(v); + } + }, + transform: (v) => { + return typeof v === "string" + ? v + : v.hasOwnProperty("red") + ? rgba.transform(v) + : hsla.transform(v); + }, + getAnimatableNone: (v) => { + const parsed = color.parse(v); + parsed.alpha = 0; + return color.transform(parsed); + }, + }; + + const colorRegex = /(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu; + + function test(v) { + return (isNaN(v) && + typeof v === "string" && + (v.match(floatRegex)?.length || 0) + + (v.match(colorRegex)?.length || 0) > + 0); + } + const NUMBER_TOKEN = "number"; + const COLOR_TOKEN = "color"; + const VAR_TOKEN = "var"; + const VAR_FUNCTION_TOKEN = "var("; + const SPLIT_TOKEN = "${}"; + // this regex consists of the `singleCssVariableRegex|rgbHSLValueRegex|digitRegex` + const complexRegex = /var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu; + function analyseComplexValue(value) { + const originalValue = value.toString(); + const values = []; + const indexes = { + color: [], + number: [], + var: [], + }; + const types = []; + let i = 0; + const tokenised = originalValue.replace(complexRegex, (parsedValue) => { + if (color.test(parsedValue)) { + indexes.color.push(i); + types.push(COLOR_TOKEN); + values.push(color.parse(parsedValue)); + } + else if (parsedValue.startsWith(VAR_FUNCTION_TOKEN)) { + indexes.var.push(i); + types.push(VAR_TOKEN); + values.push(parsedValue); + } + else { + indexes.number.push(i); + types.push(NUMBER_TOKEN); + values.push(parseFloat(parsedValue)); + } + ++i; + return SPLIT_TOKEN; + }); + const split = tokenised.split(SPLIT_TOKEN); + return { values, split, indexes, types }; + } + function parseComplexValue(v) { + return analyseComplexValue(v).values; + } + function buildTransformer({ split, types }) { + const numSections = split.length; + return (v) => { + let output = ""; + for (let i = 0; i < numSections; i++) { + output += split[i]; + if (v[i] !== undefined) { + const type = types[i]; + if (type === NUMBER_TOKEN) { + output += sanitize(v[i]); + } + else if (type === COLOR_TOKEN) { + output += color.transform(v[i]); + } + else { + output += v[i]; + } + } + } + return output; + }; + } + function createTransformer(source) { + return buildTransformer(analyseComplexValue(source)); + } + const convertNumbersToZero = (v) => typeof v === "number" ? 0 : color.test(v) ? color.getAnimatableNone(v) : v; + /** + * Convert a parsed value to its zero equivalent, but preserve numbers + * that act as divisors in CSS calc() expressions. + * + * analyseComplexValue extracts numbers from CSS strings and puts the + * surrounding text into a `split` template array. For example: + * "calc(var(--gap) / 5)" → values: [var(--gap), 5] + * split: ["calc(", " / ", ")"] + * + * When building a zero-equivalent for animation, naively zeroing all + * numbers turns the divisor into 0 → "calc(var(--gap) / 0)" → NaN. + * We detect this by checking whether the text preceding a number + * (split[i]) ends with "/" — the CSS calc division operator. + */ + const convertToZero = (value, splitBefore) => { + if (typeof value === "number") { + return splitBefore?.trim().endsWith("/") ? value : 0; + } + return convertNumbersToZero(value); + }; + function getAnimatableNone$1(v) { + const info = analyseComplexValue(v); + const transformer = buildTransformer(info); + return transformer(info.values.map((value, i) => convertToZero(value, info.split[i]))); + } + const complex = { + test, + parse: parseComplexValue, + createTransformer, + getAnimatableNone: getAnimatableNone$1, + }; + + // Adapted from https://gist.github.com/mjackson/5311256 + function hueToRgb(p, q, t) { + if (t < 0) + t += 1; + if (t > 1) + t -= 1; + if (t < 1 / 6) + return p + (q - p) * 6 * t; + if (t < 1 / 2) + return q; + if (t < 2 / 3) + return p + (q - p) * (2 / 3 - t) * 6; + return p; + } + function hslaToRgba({ hue, saturation, lightness, alpha }) { + hue /= 360; + saturation /= 100; + lightness /= 100; + let red = 0; + let green = 0; + let blue = 0; + if (!saturation) { + red = green = blue = lightness; + } + else { + const q = lightness < 0.5 + ? lightness * (1 + saturation) + : lightness + saturation - lightness * saturation; + const p = 2 * lightness - q; + red = hueToRgb(p, q, hue + 1 / 3); + green = hueToRgb(p, q, hue); + blue = hueToRgb(p, q, hue - 1 / 3); + } + return { + red: Math.round(red * 255), + green: Math.round(green * 255), + blue: Math.round(blue * 255), + alpha, + }; + } + + function mixImmediate(a, b) { + return (p) => (p > 0 ? b : a); + } + + /* + Value in range from progress + + Given a lower limit and an upper limit, we return the value within + that range as expressed by progress (usually a number from 0 to 1) + + So progress = 0.5 would change + + from -------- to + + to + + from ---- to + + E.g. from = 10, to = 20, progress = 0.5 => 15 + + @param [number]: Lower limit of range + @param [number]: Upper limit of range + @param [number]: The progress between lower and upper limits expressed 0-1 + @return [number]: Value as calculated from progress within range (not limited within range) + */ + const mixNumber$1 = (from, to, progress) => { + return from + (to - from) * progress; + }; + + // Linear color space blending + // Explained https://www.youtube.com/watch?v=LKnqECcg6Gw + // Demonstrated http://codepen.io/osublake/pen/xGVVaN + const mixLinearColor = (from, to, v) => { + const fromExpo = from * from; + const expo = v * (to * to - fromExpo) + fromExpo; + return expo < 0 ? 0 : Math.sqrt(expo); + }; + const colorTypes = [hex, rgba, hsla]; + const getColorType = (v) => colorTypes.find((type) => type.test(v)); + function asRGBA(color) { + const type = getColorType(color); + motionUtils.warning(Boolean(type), `'${color}' is not an animatable color. Use the equivalent color code instead.`, "color-not-animatable"); + if (!Boolean(type)) + return false; + let model = type.parse(color); + if (type === hsla) { + // TODO Remove this cast - needed since Motion's stricter typing + model = hslaToRgba(model); + } + return model; + } + const mixColor = (from, to) => { + const fromRGBA = asRGBA(from); + const toRGBA = asRGBA(to); + if (!fromRGBA || !toRGBA) { + return mixImmediate(from, to); + } + const blended = { ...fromRGBA }; + return (v) => { + blended.red = mixLinearColor(fromRGBA.red, toRGBA.red, v); + blended.green = mixLinearColor(fromRGBA.green, toRGBA.green, v); + blended.blue = mixLinearColor(fromRGBA.blue, toRGBA.blue, v); + blended.alpha = mixNumber$1(fromRGBA.alpha, toRGBA.alpha, v); + return rgba.transform(blended); + }; + }; + + const invisibleValues = new Set(["none", "hidden"]); + /** + * Returns a function that, when provided a progress value between 0 and 1, + * will return the "none" or "hidden" string only when the progress is that of + * the origin or target. + */ + function mixVisibility(origin, target) { + if (invisibleValues.has(origin)) { + return (p) => (p <= 0 ? origin : target); + } + else { + return (p) => (p >= 1 ? target : origin); + } + } + + function mixNumber(a, b) { + return (p) => mixNumber$1(a, b, p); + } + function getMixer(a) { + if (typeof a === "number") { + return mixNumber; + } + else if (typeof a === "string") { + return isCSSVariableToken(a) + ? mixImmediate + : color.test(a) + ? mixColor + : mixComplex; + } + else if (Array.isArray(a)) { + return mixArray; + } + else if (typeof a === "object") { + return color.test(a) ? mixColor : mixObject; + } + return mixImmediate; + } + function mixArray(a, b) { + const output = [...a]; + const numValues = output.length; + const blendValue = a.map((v, i) => getMixer(v)(v, b[i])); + return (p) => { + for (let i = 0; i < numValues; i++) { + output[i] = blendValue[i](p); + } + return output; + }; + } + function mixObject(a, b) { + const output = { ...a, ...b }; + const blendValue = {}; + for (const key in output) { + if (a[key] !== undefined && b[key] !== undefined) { + blendValue[key] = getMixer(a[key])(a[key], b[key]); + } + } + return (v) => { + for (const key in blendValue) { + output[key] = blendValue[key](v); + } + return output; + }; + } + function matchOrder(origin, target) { + const orderedOrigin = []; + const pointers = { color: 0, var: 0, number: 0 }; + for (let i = 0; i < target.values.length; i++) { + const type = target.types[i]; + const originIndex = origin.indexes[type][pointers[type]]; + const originValue = origin.values[originIndex] ?? 0; + orderedOrigin[i] = originValue; + pointers[type]++; + } + return orderedOrigin; + } + const mixComplex = (origin, target) => { + const template = complex.createTransformer(target); + const originStats = analyseComplexValue(origin); + const targetStats = analyseComplexValue(target); + const canInterpolate = originStats.indexes.var.length === targetStats.indexes.var.length && + originStats.indexes.color.length === targetStats.indexes.color.length && + originStats.indexes.number.length >= targetStats.indexes.number.length; + if (canInterpolate) { + if ((invisibleValues.has(origin) && + !targetStats.values.length) || + (invisibleValues.has(target) && + !originStats.values.length)) { + return mixVisibility(origin, target); + } + return motionUtils.pipe(mixArray(matchOrder(originStats, targetStats), targetStats.values), template); + } + else { + motionUtils.warning(true, `Complex values '${origin}' and '${target}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`, "complex-values-different"); + return mixImmediate(origin, target); + } + }; + + function mix(from, to, p) { + if (typeof from === "number" && + typeof to === "number" && + typeof p === "number") { + return mixNumber$1(from, to, p); + } + const mixer = getMixer(from); + return mixer(from, to); + } + + const frameloopDriver = (update) => { + const passTimestamp = ({ timestamp }) => update(timestamp); + return { + start: (keepAlive = true) => frame.update(passTimestamp, keepAlive), + stop: () => cancelFrame(passTimestamp), + /** + * If we're processing this frame we can use the + * framelocked timestamp to keep things in sync. + */ + now: () => (frameData.isProcessing ? frameData.timestamp : time.now()), + }; + }; + + const generateLinearEasing = (easing, duration, // as milliseconds + resolution = 10 // as milliseconds + ) => { + let points = ""; + const numPoints = Math.max(Math.round(duration / resolution), 2); + for (let i = 0; i < numPoints; i++) { + points += Math.round(easing(i / (numPoints - 1)) * 10000) / 10000 + ", "; + } + return `linear(${points.substring(0, points.length - 2)})`; + }; + + /** + * Implement a practical max duration for keyframe generation + * to prevent infinite loops + */ + const maxGeneratorDuration = 20000; + function calcGeneratorDuration(generator) { + let duration = 0; + const timeStep = 50; + let state = generator.next(duration); + while (!state.done && duration < maxGeneratorDuration) { + duration += timeStep; + state = generator.next(duration); + } + return duration >= maxGeneratorDuration ? Infinity : duration; + } + + /** + * Create a progress => progress easing function from a generator. + */ + function createGeneratorEasing(options, scale = 100, createGenerator) { + const generator = createGenerator({ ...options, keyframes: [0, scale] }); + const duration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration); + return { + type: "keyframes", + ease: (progress) => { + return generator.next(duration * progress).value / scale; + }, + duration: motionUtils.millisecondsToSeconds(duration), + }; + } + + const springDefaults = { + // Default spring physics + stiffness: 100, + damping: 10, + mass: 1.0, + velocity: 0.0, + // Default duration/bounce-based options + duration: 800, // in ms + bounce: 0.3, + visualDuration: 0.3, // in seconds + // Rest thresholds + restSpeed: { + granular: 0.01, + default: 2, + }, + restDelta: { + granular: 0.005, + default: 0.5, + }, + // Limits + minDuration: 0.01, // in seconds + maxDuration: 10.0, // in seconds + minDamping: 0.05, + maxDamping: 1, + }; + function calcAngularFreq(undampedFreq, dampingRatio) { + return undampedFreq * Math.sqrt(1 - dampingRatio * dampingRatio); + } + const rootIterations = 12; + function approximateRoot(envelope, derivative, initialGuess) { + let result = initialGuess; + for (let i = 1; i < rootIterations; i++) { + result = result - envelope(result) / derivative(result); + } + return result; + } + /** + * This is ported from the Framer implementation of duration-based spring resolution. + */ + const safeMin = 0.001; + function findSpring({ duration = springDefaults.duration, bounce = springDefaults.bounce, velocity = springDefaults.velocity, mass = springDefaults.mass, }) { + let envelope; + let derivative; + motionUtils.warning(duration <= motionUtils.secondsToMilliseconds(springDefaults.maxDuration), "Spring duration must be 10 seconds or less", "spring-duration-limit"); + let dampingRatio = 1 - bounce; + /** + * Restrict dampingRatio and duration to within acceptable ranges. + */ + dampingRatio = motionUtils.clamp(springDefaults.minDamping, springDefaults.maxDamping, dampingRatio); + duration = motionUtils.clamp(springDefaults.minDuration, springDefaults.maxDuration, motionUtils.millisecondsToSeconds(duration)); + if (dampingRatio < 1) { + /** + * Underdamped spring + */ + envelope = (undampedFreq) => { + const exponentialDecay = undampedFreq * dampingRatio; + const delta = exponentialDecay * duration; + const a = exponentialDecay - velocity; + const b = calcAngularFreq(undampedFreq, dampingRatio); + const c = Math.exp(-delta); + return safeMin - (a / b) * c; + }; + derivative = (undampedFreq) => { + const exponentialDecay = undampedFreq * dampingRatio; + const delta = exponentialDecay * duration; + const d = delta * velocity + velocity; + const e = Math.pow(dampingRatio, 2) * Math.pow(undampedFreq, 2) * duration; + const f = Math.exp(-delta); + const g = calcAngularFreq(Math.pow(undampedFreq, 2), dampingRatio); + const factor = -envelope(undampedFreq) + safeMin > 0 ? -1 : 1; + return (factor * ((d - e) * f)) / g; + }; + } + else { + /** + * Critically-damped spring + */ + envelope = (undampedFreq) => { + const a = Math.exp(-undampedFreq * duration); + const b = (undampedFreq - velocity) * duration + 1; + return -safeMin + a * b; + }; + derivative = (undampedFreq) => { + const a = Math.exp(-undampedFreq * duration); + const b = (velocity - undampedFreq) * (duration * duration); + return a * b; + }; + } + const initialGuess = 5 / duration; + const undampedFreq = approximateRoot(envelope, derivative, initialGuess); + duration = motionUtils.secondsToMilliseconds(duration); + if (isNaN(undampedFreq)) { + return { + stiffness: springDefaults.stiffness, + damping: springDefaults.damping, + duration, + }; + } + else { + const stiffness = Math.pow(undampedFreq, 2) * mass; + return { + stiffness, + damping: dampingRatio * 2 * Math.sqrt(mass * stiffness), + duration, + }; + } + } + const durationKeys = ["duration", "bounce"]; + const physicsKeys = ["stiffness", "damping", "mass"]; + function isSpringType(options, keys) { + return keys.some((key) => options[key] !== undefined); + } + function getSpringOptions(options) { + let springOptions = { + velocity: springDefaults.velocity, + stiffness: springDefaults.stiffness, + damping: springDefaults.damping, + mass: springDefaults.mass, + isResolvedFromDuration: false, + ...options, + }; + // stiffness/damping/mass overrides duration/bounce + if (!isSpringType(options, physicsKeys) && + isSpringType(options, durationKeys)) { + // Time-defined springs should ignore inherited velocity. + // Velocity from interrupted animations can cause findSpring() + // to compute wildly different spring parameters, leading to + // massive oscillation on small-range animations. + springOptions.velocity = 0; + if (options.visualDuration) { + const visualDuration = options.visualDuration; + const root = (2 * Math.PI) / (visualDuration * 1.2); + const stiffness = root * root; + const damping = 2 * + motionUtils.clamp(0.05, 1, 1 - (options.bounce || 0)) * + Math.sqrt(stiffness); + springOptions = { + ...springOptions, + mass: springDefaults.mass, + stiffness, + damping, + }; + } + else { + const derived = findSpring({ ...options, velocity: 0 }); + springOptions = { + ...springOptions, + ...derived, + mass: springDefaults.mass, + }; + springOptions.isResolvedFromDuration = true; + } + } + return springOptions; + } + function spring(optionsOrVisualDuration = springDefaults.visualDuration, bounce = springDefaults.bounce) { + const options = typeof optionsOrVisualDuration !== "object" + ? { + visualDuration: optionsOrVisualDuration, + keyframes: [0, 1], + bounce, + } + : optionsOrVisualDuration; + let { restSpeed, restDelta } = options; + const origin = options.keyframes[0]; + const target = options.keyframes[options.keyframes.length - 1]; + /** + * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator + * to reduce GC during animation. + */ + const state = { done: false, value: origin }; + const { stiffness, damping, mass, duration, velocity, isResolvedFromDuration, } = getSpringOptions({ + ...options, + velocity: -motionUtils.millisecondsToSeconds(options.velocity || 0), + }); + const initialVelocity = velocity || 0.0; + const dampingRatio = damping / (2 * Math.sqrt(stiffness * mass)); + const initialDelta = target - origin; + const undampedAngularFreq = motionUtils.millisecondsToSeconds(Math.sqrt(stiffness / mass)); + /** + * If we're working on a granular scale, use smaller defaults for determining + * when the spring is finished. + * + * These defaults have been selected emprically based on what strikes a good + * ratio between feeling good and finishing as soon as changes are imperceptible. + */ + const isGranularScale = Math.abs(initialDelta) < 5; + restSpeed || (restSpeed = isGranularScale + ? springDefaults.restSpeed.granular + : springDefaults.restSpeed.default); + restDelta || (restDelta = isGranularScale + ? springDefaults.restDelta.granular + : springDefaults.restDelta.default); + let resolveSpring; + let resolveVelocity; + // Underdamped coefficients, hoisted for use in the inlined next() hot path + let angularFreq; + let A; + let sinCoeff; + let cosCoeff; + if (dampingRatio < 1) { + angularFreq = calcAngularFreq(undampedAngularFreq, dampingRatio); + A = + (initialVelocity + + dampingRatio * undampedAngularFreq * initialDelta) / + angularFreq; + // Underdamped spring + resolveSpring = (t) => { + const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); + return (target - + envelope * + (A * Math.sin(angularFreq * t) + + initialDelta * Math.cos(angularFreq * t))); + }; + // Analytical derivative of underdamped spring (px/ms) + sinCoeff = + dampingRatio * undampedAngularFreq * A + initialDelta * angularFreq; + cosCoeff = + dampingRatio * undampedAngularFreq * initialDelta - A * angularFreq; + resolveVelocity = (t) => { + const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); + return envelope * + (sinCoeff * Math.sin(angularFreq * t) + + cosCoeff * Math.cos(angularFreq * t)); + }; + } + else if (dampingRatio === 1) { + // Critically damped spring + resolveSpring = (t) => target - + Math.exp(-undampedAngularFreq * t) * + (initialDelta + + (initialVelocity + undampedAngularFreq * initialDelta) * t); + // Analytical derivative of critically damped spring (px/ms) + const C = initialVelocity + undampedAngularFreq * initialDelta; + resolveVelocity = (t) => Math.exp(-undampedAngularFreq * t) * + (undampedAngularFreq * C * t - initialVelocity); + } + else { + // Overdamped spring + const dampedAngularFreq = undampedAngularFreq * Math.sqrt(dampingRatio * dampingRatio - 1); + resolveSpring = (t) => { + const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); + // When performing sinh or cosh values can hit Infinity so we cap them here + const freqForT = Math.min(dampedAngularFreq * t, 300); + return (target - + (envelope * + ((initialVelocity + + dampingRatio * undampedAngularFreq * initialDelta) * + Math.sinh(freqForT) + + dampedAngularFreq * + initialDelta * + Math.cosh(freqForT))) / + dampedAngularFreq); + }; + // Analytical derivative of overdamped spring (px/ms) + const P = (initialVelocity + + dampingRatio * undampedAngularFreq * initialDelta) / + dampedAngularFreq; + const sinhCoeff = dampingRatio * undampedAngularFreq * P - initialDelta * dampedAngularFreq; + const coshCoeff = dampingRatio * undampedAngularFreq * initialDelta - P * dampedAngularFreq; + resolveVelocity = (t) => { + const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); + const freqForT = Math.min(dampedAngularFreq * t, 300); + return envelope * + (sinhCoeff * Math.sinh(freqForT) + + coshCoeff * Math.cosh(freqForT)); + }; + } + const generator = { + calculatedDuration: isResolvedFromDuration ? duration || null : null, + velocity: (t) => motionUtils.secondsToMilliseconds(resolveVelocity(t)), + next: (t) => { + /** + * For underdamped physics springs we need both position and + * velocity each tick. Compute shared trig values once to avoid + * duplicate Math.exp/sin/cos calls on the hot path. + */ + if (!isResolvedFromDuration && dampingRatio < 1) { + const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); + const sin = Math.sin(angularFreq * t); + const cos = Math.cos(angularFreq * t); + const current = target - + envelope * + (A * sin + initialDelta * cos); + const currentVelocity = motionUtils.secondsToMilliseconds(envelope * + (sinCoeff * sin + cosCoeff * cos)); + state.done = + Math.abs(currentVelocity) <= restSpeed && + Math.abs(target - current) <= restDelta; + state.value = state.done ? target : current; + return state; + } + const current = resolveSpring(t); + if (!isResolvedFromDuration) { + const currentVelocity = motionUtils.secondsToMilliseconds(resolveVelocity(t)); + state.done = + Math.abs(currentVelocity) <= restSpeed && + Math.abs(target - current) <= restDelta; + } + else { + state.done = t >= duration; + } + state.value = state.done ? target : current; + return state; + }, + toString: () => { + const calculatedDuration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration); + const easing = generateLinearEasing((progress) => generator.next(calculatedDuration * progress).value, calculatedDuration, 30); + return calculatedDuration + "ms " + easing; + }, + toTransition: () => { }, + }; + return generator; + } + spring.applyToOptions = (options) => { + const generatorOptions = createGeneratorEasing(options, 100, spring); + options.ease = generatorOptions.ease; + options.duration = motionUtils.secondsToMilliseconds(generatorOptions.duration); + options.type = "keyframes"; + return options; + }; + + const velocitySampleDuration = 5; // ms + function getGeneratorVelocity(resolveValue, t, current) { + const prevT = Math.max(t - velocitySampleDuration, 0); + return motionUtils.velocityPerSecond(current - resolveValue(prevT), t - prevT); + } + + function inertia({ keyframes, velocity = 0.0, power = 0.8, timeConstant = 325, bounceDamping = 10, bounceStiffness = 500, modifyTarget, min, max, restDelta = 0.5, restSpeed, }) { + const origin = keyframes[0]; + const state = { + done: false, + value: origin, + }; + const isOutOfBounds = (v) => (min !== undefined && v < min) || (max !== undefined && v > max); + const nearestBoundary = (v) => { + if (min === undefined) + return max; + if (max === undefined) + return min; + return Math.abs(min - v) < Math.abs(max - v) ? min : max; + }; + let amplitude = power * velocity; + const ideal = origin + amplitude; + const target = modifyTarget === undefined ? ideal : modifyTarget(ideal); + /** + * If the target has changed we need to re-calculate the amplitude, otherwise + * the animation will start from the wrong position. + */ + if (target !== ideal) + amplitude = target - origin; + const calcDelta = (t) => -amplitude * Math.exp(-t / timeConstant); + const calcLatest = (t) => target + calcDelta(t); + const applyFriction = (t) => { + const delta = calcDelta(t); + const latest = calcLatest(t); + state.done = Math.abs(delta) <= restDelta; + state.value = state.done ? target : latest; + }; + /** + * Ideally this would resolve for t in a stateless way, we could + * do that by always precalculating the animation but as we know + * this will be done anyway we can assume that spring will + * be discovered during that. + */ + let timeReachedBoundary; + let spring$1; + const checkCatchBoundary = (t) => { + if (!isOutOfBounds(state.value)) + return; + timeReachedBoundary = t; + spring$1 = spring({ + keyframes: [state.value, nearestBoundary(state.value)], + velocity: getGeneratorVelocity(calcLatest, t, state.value), // TODO: This should be passing * 1000 + damping: bounceDamping, + stiffness: bounceStiffness, + restDelta, + restSpeed, + }); + }; + checkCatchBoundary(0); + return { + calculatedDuration: null, + next: (t) => { + /** + * We need to resolve the friction to figure out if we need a + * spring but we don't want to do this twice per frame. So here + * we flag if we updated for this frame and later if we did + * we can skip doing it again. + */ + let hasUpdatedFrame = false; + if (!spring$1 && timeReachedBoundary === undefined) { + hasUpdatedFrame = true; + applyFriction(t); + checkCatchBoundary(t); + } + /** + * If we have a spring and the provided t is beyond the moment the friction + * animation crossed the min/max boundary, use the spring. + */ + if (timeReachedBoundary !== undefined && t >= timeReachedBoundary) { + return spring$1.next(t - timeReachedBoundary); + } + else { + !hasUpdatedFrame && applyFriction(t); + return state; + } + }, + }; + } + + function createMixers(output, ease, customMixer) { + const mixers = []; + const mixerFactory = customMixer || motionUtils.MotionGlobalConfig.mix || mix; + const numMixers = output.length - 1; + for (let i = 0; i < numMixers; i++) { + let mixer = mixerFactory(output[i], output[i + 1]); + if (ease) { + const easingFunction = Array.isArray(ease) ? ease[i] || motionUtils.noop : ease; + mixer = motionUtils.pipe(easingFunction, mixer); + } + mixers.push(mixer); + } + return mixers; + } + /** + * Create a function that maps from a numerical input array to a generic output array. + * + * Accepts: + * - Numbers + * - Colors (hex, hsl, hsla, rgb, rgba) + * - Complex (combinations of one or more numbers or strings) + * + * ```jsx + * const mixColor = interpolate([0, 1], ['#fff', '#000']) + * + * mixColor(0.5) // 'rgba(128, 128, 128, 1)' + * ``` + * + * TODO Revisit this approach once we've moved to data models for values, + * probably not needed to pregenerate mixer functions. + * + * @public + */ + function interpolate(input, output, { clamp: isClamp = true, ease, mixer } = {}) { + const inputLength = input.length; + motionUtils.invariant(inputLength === output.length, "Both input and output ranges must be the same length", "range-length"); + /** + * If we're only provided a single input, we can just make a function + * that returns the output. + */ + if (inputLength === 1) + return () => output[0]; + if (inputLength === 2 && output[0] === output[1]) + return () => output[1]; + const isZeroDeltaRange = input[0] === input[1]; + // If input runs highest -> lowest, reverse both arrays + if (input[0] > input[inputLength - 1]) { + input = [...input].reverse(); + output = [...output].reverse(); + } + const mixers = createMixers(output, ease, mixer); + const numMixers = mixers.length; + const interpolator = (v) => { + if (isZeroDeltaRange && v < input[0]) + return output[0]; + let i = 0; + if (numMixers > 1) { + for (; i < input.length - 2; i++) { + if (v < input[i + 1]) + break; + } + } + const progressInRange = motionUtils.progress(input[i], input[i + 1], v); + return mixers[i](progressInRange); + }; + return isClamp + ? (v) => interpolator(motionUtils.clamp(input[0], input[inputLength - 1], v)) + : interpolator; + } + + function fillOffset(offset, remaining) { + const min = offset[offset.length - 1]; + for (let i = 1; i <= remaining; i++) { + const offsetProgress = motionUtils.progress(0, remaining, i); + offset.push(mixNumber$1(min, 1, offsetProgress)); + } + } + + function defaultOffset(arr) { + const offset = [0]; + fillOffset(offset, arr.length - 1); + return offset; + } + + function convertOffsetToTimes(offset, duration) { + return offset.map((o) => o * duration); + } + + function defaultEasing(values, easing) { + return values.map(() => easing || motionUtils.easeInOut).splice(0, values.length - 1); + } + function keyframes({ duration = 300, keyframes: keyframeValues, times, ease = "easeInOut", }) { + /** + * Easing functions can be externally defined as strings. Here we convert them + * into actual functions. + */ + const easingFunctions = motionUtils.isEasingArray(ease) + ? ease.map(motionUtils.easingDefinitionToFunction) + : motionUtils.easingDefinitionToFunction(ease); + /** + * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator + * to reduce GC during animation. + */ + const state = { + done: false, + value: keyframeValues[0], + }; + /** + * Create a times array based on the provided 0-1 offsets + */ + const absoluteTimes = convertOffsetToTimes( + // Only use the provided offsets if they're the correct length + // TODO Maybe we should warn here if there's a length mismatch + times && times.length === keyframeValues.length + ? times + : defaultOffset(keyframeValues), duration); + const mapTimeToKeyframe = interpolate(absoluteTimes, keyframeValues, { + ease: Array.isArray(easingFunctions) + ? easingFunctions + : defaultEasing(keyframeValues, easingFunctions), + }); + return { + calculatedDuration: duration, + next: (t) => { + state.value = mapTimeToKeyframe(t); + state.done = t >= duration; + return state; + }, + }; + } + + const isNotNull = (value) => value !== null; + function getFinalKeyframe(keyframes, { repeat, repeatType = "loop" }, finalKeyframe, speed = 1) { + const resolvedKeyframes = keyframes.filter(isNotNull); + const useFirstKeyframe = speed < 0 || (repeat && repeatType !== "loop" && repeat % 2 === 1); + const index = useFirstKeyframe ? 0 : resolvedKeyframes.length - 1; + return !index || finalKeyframe === undefined + ? resolvedKeyframes[index] + : finalKeyframe; + } + + const transitionTypeMap = { + decay: inertia, + inertia, + tween: keyframes, + keyframes: keyframes, + spring, + }; + function replaceTransitionType(transition) { + if (typeof transition.type === "string") { + transition.type = transitionTypeMap[transition.type]; + } + } + + class WithPromise { + constructor() { + this.updateFinished(); + } + get finished() { + return this._finished; + } + updateFinished() { + this._finished = new Promise((resolve) => { + this.resolve = resolve; + }); + } + notifyFinished() { + this.resolve(); + } + /** + * Allows the animation to be awaited. + * + * @deprecated Use `finished` instead. + */ + then(onResolve, onReject) { + return this.finished.then(onResolve, onReject); + } + } + + const percentToProgress = (percent) => percent / 100; + class JSAnimation extends WithPromise { + constructor(options) { + super(); + this.state = "idle"; + this.startTime = null; + this.isStopped = false; + /** + * The current time of the animation. + */ + this.currentTime = 0; + /** + * The time at which the animation was paused. + */ + this.holdTime = null; + /** + * Playback speed as a factor. 0 would be stopped, -1 reverse and 2 double speed. + */ + this.playbackSpeed = 1; + /** + * Reusable state object for the delay phase to avoid + * allocating a new object every frame. + */ + this.delayState = { + done: false, + value: undefined, + }; + /** + * This method is bound to the instance to fix a pattern where + * animation.stop is returned as a reference from a useEffect. + */ + this.stop = () => { + const { motionValue } = this.options; + if (motionValue && motionValue.updatedAt !== time.now()) { + this.tick(time.now()); + } + this.isStopped = true; + if (this.state === "idle") + return; + this.teardown(); + this.options.onStop?.(); + }; + this.options = options; + this.initAnimation(); + this.play(); + if (options.autoplay === false) + this.pause(); + } + initAnimation() { + const { options } = this; + replaceTransitionType(options); + const { type = keyframes, repeat = 0, repeatDelay = 0, repeatType, velocity = 0, } = options; + let { keyframes: keyframes$1 } = options; + const generatorFactory = type || keyframes; + if (generatorFactory !== keyframes) { + motionUtils.invariant(keyframes$1.length <= 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${keyframes$1}`, "spring-two-frames"); + } + if (generatorFactory !== keyframes && + typeof keyframes$1[0] !== "number") { + this.mixKeyframes = motionUtils.pipe(percentToProgress, mix(keyframes$1[0], keyframes$1[1])); + keyframes$1 = [0, 100]; + } + const generator = generatorFactory({ ...options, keyframes: keyframes$1 }); + /** + * If we have a mirror repeat type we need to create a second generator that outputs the + * mirrored (not reversed) animation and later ping pong between the two generators. + */ + if (repeatType === "mirror") { + this.mirroredGenerator = generatorFactory({ + ...options, + keyframes: [...keyframes$1].reverse(), + velocity: -velocity, + }); + } + /** + * If duration is undefined and we have repeat options, + * we need to calculate a duration from the generator. + * + * We set it to the generator itself to cache the duration. + * Any timeline resolver will need to have already precalculated + * the duration by this step. + */ + if (generator.calculatedDuration === null) { + generator.calculatedDuration = calcGeneratorDuration(generator); + } + const { calculatedDuration } = generator; + this.calculatedDuration = calculatedDuration; + this.resolvedDuration = calculatedDuration + repeatDelay; + this.totalDuration = this.resolvedDuration * (repeat + 1) - repeatDelay; + this.generator = generator; + } + updateTime(timestamp) { + const animationTime = Math.round(timestamp - this.startTime) * this.playbackSpeed; + // Update currentTime + if (this.holdTime !== null) { + this.currentTime = this.holdTime; + } + else { + // Rounding the time because floating point arithmetic is not always accurate, e.g. 3000.367 - 1000.367 = + // 2000.0000000000002. This is a problem when we are comparing the currentTime with the duration, for + // example. + this.currentTime = animationTime; + } + } + tick(timestamp, sample = false) { + const { generator, totalDuration, mixKeyframes, mirroredGenerator, resolvedDuration, calculatedDuration, } = this; + if (this.startTime === null) + return generator.next(0); + const { delay = 0, keyframes, repeat, repeatType, repeatDelay, type, onUpdate, finalKeyframe, } = this.options; + /** + * requestAnimationFrame timestamps can come through as lower than + * the startTime as set by performance.now(). Here we prevent this, + * though in the future it could be possible to make setting startTime + * a pending operation that gets resolved here. + */ + if (this.speed > 0) { + this.startTime = Math.min(this.startTime, timestamp); + } + else if (this.speed < 0) { + this.startTime = Math.min(timestamp - totalDuration / this.speed, this.startTime); + } + if (sample) { + this.currentTime = timestamp; + } + else { + this.updateTime(timestamp); + } + // Rebase on delay + const timeWithoutDelay = this.currentTime - delay * (this.playbackSpeed >= 0 ? 1 : -1); + const isInDelayPhase = this.playbackSpeed >= 0 + ? timeWithoutDelay < 0 + : timeWithoutDelay > totalDuration; + this.currentTime = Math.max(timeWithoutDelay, 0); + // If this animation has finished, set the current time to the total duration. + if (this.state === "finished" && this.holdTime === null) { + this.currentTime = totalDuration; + } + let elapsed = this.currentTime; + let frameGenerator = generator; + if (repeat) { + /** + * Get the current progress (0-1) of the animation. If t is > + * than duration we'll get values like 2.5 (midway through the + * third iteration) + */ + const progress = Math.min(this.currentTime, totalDuration) / resolvedDuration; + /** + * Get the current iteration (0 indexed). For instance the floor of + * 2.5 is 2. + */ + let currentIteration = Math.floor(progress); + /** + * Get the current progress of the iteration by taking the remainder + * so 2.5 is 0.5 through iteration 2 + */ + let iterationProgress = progress % 1.0; + /** + * If iteration progress is 1 we count that as the end + * of the previous iteration. + */ + if (!iterationProgress && progress >= 1) { + iterationProgress = 1; + } + iterationProgress === 1 && currentIteration--; + currentIteration = Math.min(currentIteration, repeat + 1); + /** + * Reverse progress if we're not running in "normal" direction + */ + const isOddIteration = Boolean(currentIteration % 2); + if (isOddIteration) { + if (repeatType === "reverse") { + iterationProgress = 1 - iterationProgress; + if (repeatDelay) { + iterationProgress -= repeatDelay / resolvedDuration; + } + } + else if (repeatType === "mirror") { + frameGenerator = mirroredGenerator; + } + } + elapsed = motionUtils.clamp(0, 1, iterationProgress) * resolvedDuration; + } + /** + * If we're in negative time, set state as the initial keyframe. + * This prevents delay: x, duration: 0 animations from finishing + * instantly. + */ + let state; + if (isInDelayPhase) { + this.delayState.value = keyframes[0]; + state = this.delayState; + } + else { + state = frameGenerator.next(elapsed); + } + if (mixKeyframes && !isInDelayPhase) { + state.value = mixKeyframes(state.value); + } + let { done } = state; + if (!isInDelayPhase && calculatedDuration !== null) { + done = + this.playbackSpeed >= 0 + ? this.currentTime >= totalDuration + : this.currentTime <= 0; + } + const isAnimationFinished = this.holdTime === null && + (this.state === "finished" || (this.state === "running" && done)); + // TODO: The exception for inertia could be cleaner here + if (isAnimationFinished && type !== inertia) { + state.value = getFinalKeyframe(keyframes, this.options, finalKeyframe, this.speed); + } + if (onUpdate) { + onUpdate(state.value); + } + if (isAnimationFinished) { + this.finish(); + } + return state; + } + /** + * Allows the returned animation to be awaited or promise-chained. Currently + * resolves when the animation finishes at all but in a future update could/should + * reject if its cancels. + */ + then(resolve, reject) { + return this.finished.then(resolve, reject); + } + get duration() { + return motionUtils.millisecondsToSeconds(this.calculatedDuration); + } + get iterationDuration() { + const { delay = 0 } = this.options || {}; + return this.duration + motionUtils.millisecondsToSeconds(delay); + } + get time() { + return motionUtils.millisecondsToSeconds(this.currentTime); + } + set time(newTime) { + newTime = motionUtils.secondsToMilliseconds(newTime); + this.currentTime = newTime; + if (this.startTime === null || + this.holdTime !== null || + this.playbackSpeed === 0) { + this.holdTime = newTime; + } + else if (this.driver) { + this.startTime = this.driver.now() - newTime / this.playbackSpeed; + } + if (this.driver) { + this.driver.start(false); + } + else { + this.startTime = 0; + this.state = "paused"; + this.holdTime = newTime; + this.tick(newTime); + } + } + /** + * Returns the generator's velocity at the current time in units/second. + * Uses the analytical derivative when available (springs), avoiding + * the MotionValue's frame-dependent velocity estimation. + */ + getGeneratorVelocity() { + const t = this.currentTime; + if (t <= 0) + return this.options.velocity || 0; + if (this.generator.velocity) { + return this.generator.velocity(t); + } + // Fallback: finite difference + const current = this.generator.next(t).value; + return getGeneratorVelocity((s) => this.generator.next(s).value, t, current); + } + get speed() { + return this.playbackSpeed; + } + set speed(newSpeed) { + const hasChanged = this.playbackSpeed !== newSpeed; + if (hasChanged && this.driver) { + this.updateTime(time.now()); + } + this.playbackSpeed = newSpeed; + if (hasChanged && this.driver) { + this.time = motionUtils.millisecondsToSeconds(this.currentTime); + } + } + play() { + if (this.isStopped) + return; + const { driver = frameloopDriver, startTime } = this.options; + if (!this.driver) { + this.driver = driver((timestamp) => this.tick(timestamp)); + } + this.options.onPlay?.(); + const now = this.driver.now(); + if (this.state === "finished") { + this.updateFinished(); + this.startTime = now; + } + else if (this.holdTime !== null) { + this.startTime = now - this.holdTime; + } + else if (!this.startTime) { + this.startTime = startTime ?? now; + } + if (this.state === "finished" && this.speed < 0) { + this.startTime += this.calculatedDuration; + } + this.holdTime = null; + /** + * Set playState to running only after we've used it in + * the previous logic. + */ + this.state = "running"; + this.driver.start(); + } + pause() { + this.state = "paused"; + this.updateTime(time.now()); + this.holdTime = this.currentTime; + } + complete() { + if (this.state !== "running") { + this.play(); + } + this.state = "finished"; + this.holdTime = null; + } + finish() { + this.notifyFinished(); + this.teardown(); + this.state = "finished"; + this.options.onComplete?.(); + } + cancel() { + this.holdTime = null; + this.startTime = 0; + this.tick(0); + this.teardown(); + this.options.onCancel?.(); + } + teardown() { + this.state = "idle"; + this.stopDriver(); + this.startTime = this.holdTime = null; + } + stopDriver() { + if (!this.driver) + return; + this.driver.stop(); + this.driver = undefined; + } + sample(sampleTime) { + this.startTime = 0; + return this.tick(sampleTime, true); + } + attachTimeline(timeline) { + if (this.options.allowFlatten) { + this.options.type = "keyframes"; + this.options.ease = "linear"; + this.initAnimation(); + } + this.driver?.stop(); + return timeline.observe(this); + } + } + // Legacy function support + function animateValue(options) { + return new JSAnimation(options); + } + + function fillWildcards(keyframes) { + for (let i = 1; i < keyframes.length; i++) { + keyframes[i] ?? (keyframes[i] = keyframes[i - 1]); + } + } + + const radToDeg = (rad) => (rad * 180) / Math.PI; + const rotate = (v) => { + const angle = radToDeg(Math.atan2(v[1], v[0])); + return rebaseAngle(angle); + }; + const matrix2dParsers = { + x: 4, + y: 5, + translateX: 4, + translateY: 5, + scaleX: 0, + scaleY: 3, + scale: (v) => (Math.abs(v[0]) + Math.abs(v[3])) / 2, + rotate, + rotateZ: rotate, + skewX: (v) => radToDeg(Math.atan(v[1])), + skewY: (v) => radToDeg(Math.atan(v[2])), + skew: (v) => (Math.abs(v[1]) + Math.abs(v[2])) / 2, + }; + const rebaseAngle = (angle) => { + angle = angle % 360; + if (angle < 0) + angle += 360; + return angle; + }; + const rotateZ = rotate; + const scaleX = (v) => Math.sqrt(v[0] * v[0] + v[1] * v[1]); + const scaleY = (v) => Math.sqrt(v[4] * v[4] + v[5] * v[5]); + const matrix3dParsers = { + x: 12, + y: 13, + z: 14, + translateX: 12, + translateY: 13, + translateZ: 14, + scaleX, + scaleY, + scale: (v) => (scaleX(v) + scaleY(v)) / 2, + rotateX: (v) => rebaseAngle(radToDeg(Math.atan2(v[6], v[5]))), + rotateY: (v) => rebaseAngle(radToDeg(Math.atan2(-v[2], v[0]))), + rotateZ, + rotate: rotateZ, + skewX: (v) => radToDeg(Math.atan(v[4])), + skewY: (v) => radToDeg(Math.atan(v[1])), + skew: (v) => (Math.abs(v[1]) + Math.abs(v[4])) / 2, + }; + function defaultTransformValue(name) { + return name.includes("scale") ? 1 : 0; + } + function parseValueFromTransform(transform, name) { + if (!transform || transform === "none") { + return defaultTransformValue(name); + } + const matrix3dMatch = transform.match(/^matrix3d\(([-\d.e\s,]+)\)$/u); + let parsers; + let match; + if (matrix3dMatch) { + parsers = matrix3dParsers; + match = matrix3dMatch; + } + else { + const matrix2dMatch = transform.match(/^matrix\(([-\d.e\s,]+)\)$/u); + parsers = matrix2dParsers; + match = matrix2dMatch; + } + if (!match) { + return defaultTransformValue(name); + } + const valueParser = parsers[name]; + const values = match[1].split(",").map(convertTransformToNumber); + return typeof valueParser === "function" + ? valueParser(values) + : values[valueParser]; + } + const readTransformValue = (instance, name) => { + const { transform = "none" } = getComputedStyle(instance); + return parseValueFromTransform(transform, name); + }; + function convertTransformToNumber(value) { + return parseFloat(value.trim()); + } + + /** + * Generate a list of every possible transform key. + */ + const transformPropOrder = [ + "transformPerspective", + "x", + "y", + "z", + "translateX", + "translateY", + "translateZ", + "scale", + "scaleX", + "scaleY", + "rotate", + "rotateX", + "rotateY", + "rotateZ", + "skew", + "skewX", + "skewY", + ]; + /** + * A quick lookup for transform props. + * + * `pathRotation` is a transform for routing purposes (skipped from raw + * style application, wired to the transform composite, flags transform + * dirty) but is intentionally NOT in `transformPropOrder` — it is + * composed onto `rotate` at the build sites, not serialized in its own + * slot, and must stay out of the order-array consumers (parse-transform, + * unit-conversion, keys-position). + */ + const transformProps = /*@__PURE__*/ (() => new Set([...transformPropOrder, "pathRotation"]))(); + + const isNumOrPxType = (v) => v === number || v === px; + const transformKeys = new Set(["x", "y", "z"]); + const nonTranslationalTransformKeys = transformPropOrder.filter((key) => !transformKeys.has(key)); + function removeNonTranslationalTransform(visualElement) { + const removedTransforms = []; + nonTranslationalTransformKeys.forEach((key) => { + const value = visualElement.getValue(key); + if (value !== undefined) { + removedTransforms.push([key, value.get()]); + value.set(key.startsWith("scale") ? 1 : 0); + } + }); + return removedTransforms; + } + const positionalValues = { + // Dimensions + width: ({ x }, { paddingLeft = "0", paddingRight = "0", boxSizing }) => { + const width = x.max - x.min; + return boxSizing === "border-box" + ? width + : width - parseFloat(paddingLeft) - parseFloat(paddingRight); + }, + height: ({ y }, { paddingTop = "0", paddingBottom = "0", boxSizing }) => { + const height = y.max - y.min; + return boxSizing === "border-box" + ? height + : height - parseFloat(paddingTop) - parseFloat(paddingBottom); + }, + top: (_bbox, { top }) => parseFloat(top), + left: (_bbox, { left }) => parseFloat(left), + bottom: ({ y }, { top }) => parseFloat(top) + (y.max - y.min), + right: ({ x }, { left }) => parseFloat(left) + (x.max - x.min), + // Transform + x: (_bbox, { transform }) => parseValueFromTransform(transform, "x"), + y: (_bbox, { transform }) => parseValueFromTransform(transform, "y"), + }; + // Alias translate longform names + positionalValues.translateX = positionalValues.x; + positionalValues.translateY = positionalValues.y; + + const toResolve = new Set(); + let isScheduled = false; + let anyNeedsMeasurement = false; + let isForced = false; + function measureAllKeyframes() { + if (anyNeedsMeasurement) { + const resolversToMeasure = Array.from(toResolve).filter((resolver) => resolver.needsMeasurement); + const elementsToMeasure = new Set(resolversToMeasure.map((resolver) => resolver.element)); + const transformsToRestore = new Map(); + /** + * Write pass + * If we're measuring elements we want to remove bounding box-changing transforms. + */ + elementsToMeasure.forEach((element) => { + const removedTransforms = removeNonTranslationalTransform(element); + if (!removedTransforms.length) + return; + transformsToRestore.set(element, removedTransforms); + element.render(); + }); + // Read + resolversToMeasure.forEach((resolver) => resolver.measureInitialState()); + // Write + elementsToMeasure.forEach((element) => { + element.render(); + const restore = transformsToRestore.get(element); + if (restore) { + restore.forEach(([key, value]) => { + element.getValue(key)?.set(value); + }); + } + }); + // Read + resolversToMeasure.forEach((resolver) => resolver.measureEndState()); + // Write + resolversToMeasure.forEach((resolver) => { + if (resolver.suspendedScrollY !== undefined) { + window.scrollTo(0, resolver.suspendedScrollY); + } + }); + } + anyNeedsMeasurement = false; + isScheduled = false; + toResolve.forEach((resolver) => resolver.complete(isForced)); + toResolve.clear(); + } + function readAllKeyframes() { + toResolve.forEach((resolver) => { + resolver.readKeyframes(); + if (resolver.needsMeasurement) { + anyNeedsMeasurement = true; + } + }); + } + function flushKeyframeResolvers() { + isForced = true; + readAllKeyframes(); + measureAllKeyframes(); + isForced = false; + } + class KeyframeResolver { + constructor(unresolvedKeyframes, onComplete, name, motionValue, element, isAsync = false) { + this.state = "pending"; + /** + * Track whether this resolver is async. If it is, it'll be added to the + * resolver queue and flushed in the next frame. Resolvers that aren't going + * to trigger read/write thrashing don't need to be async. + */ + this.isAsync = false; + /** + * Track whether this resolver needs to perform a measurement + * to resolve its keyframes. + */ + this.needsMeasurement = false; + this.unresolvedKeyframes = [...unresolvedKeyframes]; + this.onComplete = onComplete; + this.name = name; + this.motionValue = motionValue; + this.element = element; + this.isAsync = isAsync; + } + scheduleResolve() { + this.state = "scheduled"; + if (this.isAsync) { + toResolve.add(this); + if (!isScheduled) { + isScheduled = true; + frame.read(readAllKeyframes); + frame.resolveKeyframes(measureAllKeyframes); + } + } + else { + this.readKeyframes(); + this.complete(); + } + } + readKeyframes() { + const { unresolvedKeyframes, name, element, motionValue } = this; + // If initial keyframe is null we need to read it from the DOM + if (unresolvedKeyframes[0] === null) { + const currentValue = motionValue?.get(); + // TODO: This doesn't work if the final keyframe is a wildcard + const finalKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1]; + if (currentValue !== undefined) { + unresolvedKeyframes[0] = currentValue; + } + else if (element && name) { + const valueAsRead = element.readValue(name, finalKeyframe); + if (valueAsRead !== undefined && valueAsRead !== null) { + unresolvedKeyframes[0] = valueAsRead; + } + } + if (unresolvedKeyframes[0] === undefined) { + unresolvedKeyframes[0] = finalKeyframe; + } + if (motionValue && currentValue === undefined) { + motionValue.set(unresolvedKeyframes[0]); + } + } + fillWildcards(unresolvedKeyframes); + } + setFinalKeyframe() { } + measureInitialState() { } + renderEndStyles() { } + measureEndState() { } + complete(isForcedComplete = false) { + this.state = "complete"; + this.onComplete(this.unresolvedKeyframes, this.finalKeyframe, isForcedComplete); + toResolve.delete(this); + } + cancel() { + if (this.state === "scheduled") { + toResolve.delete(this); + this.state = "pending"; + } + } + resume() { + if (this.state === "pending") + this.scheduleResolve(); + } + } + + const isCSSVar = (name) => name.startsWith("--"); + + function setStyle(element, name, value) { + isCSSVar(name) + ? element.style.setProperty(name, value) + : (element.style[name] = value); + } + + /** + * Add the ability for test suites to manually set support flags + * to better test more environments. + */ + const supportsFlags = {}; + + function memoSupports(callback, supportsFlag) { + const memoized = motionUtils.memo(callback); + return () => supportsFlags[supportsFlag] ?? memoized(); + } + + const supportsScrollTimeline = /* @__PURE__ */ memoSupports(() => window.ScrollTimeline !== undefined, "scrollTimeline"); + const supportsViewTimeline = /* @__PURE__ */ memoSupports(() => window.ViewTimeline !== undefined, "viewTimeline"); + + const supportsLinearEasing = /*@__PURE__*/ memoSupports(() => { + try { + document + .createElement("div") + .animate({ opacity: 0 }, { easing: "linear(0, 1)" }); + } + catch (e) { + return false; + } + return true; + }, "linearEasing"); + + const cubicBezierAsString = ([a, b, c, d]) => `cubic-bezier(${a}, ${b}, ${c}, ${d})`; + + const supportedWaapiEasing = { + linear: "linear", + ease: "ease", + easeIn: "ease-in", + easeOut: "ease-out", + easeInOut: "ease-in-out", + circIn: /*@__PURE__*/ cubicBezierAsString([0, 0.65, 0.55, 1]), + circOut: /*@__PURE__*/ cubicBezierAsString([0.55, 0, 1, 0.45]), + backIn: /*@__PURE__*/ cubicBezierAsString([0.31, 0.01, 0.66, -0.59]), + backOut: /*@__PURE__*/ cubicBezierAsString([0.33, 1.53, 0.69, 0.99]), + }; + + function mapEasingToNativeEasing(easing, duration) { + if (!easing) { + return undefined; + } + else if (typeof easing === "function") { + return supportsLinearEasing() + ? generateLinearEasing(easing, duration) + : "ease-out"; + } + else if (motionUtils.isBezierDefinition(easing)) { + return cubicBezierAsString(easing); + } + else if (Array.isArray(easing)) { + return easing.map((segmentEasing) => mapEasingToNativeEasing(segmentEasing, duration) || + supportedWaapiEasing.easeOut); + } + else { + return supportedWaapiEasing[easing]; + } + } + + function startWaapiAnimation(element, valueName, keyframes, { delay = 0, duration = 300, repeat = 0, repeatType = "loop", ease = "easeOut", times, } = {}, pseudoElement = undefined) { + const keyframeOptions = { + [valueName]: keyframes, + }; + if (times) + keyframeOptions.offset = times; + const easing = mapEasingToNativeEasing(ease, duration); + /** + * If this is an easing array, apply to keyframes, not animation as a whole + */ + if (Array.isArray(easing)) + keyframeOptions.easing = easing; + const options = { + delay, + duration, + easing: !Array.isArray(easing) ? easing : "linear", + fill: "both", + iterations: repeat + 1, + direction: repeatType === "reverse" ? "alternate" : "normal", + }; + if (pseudoElement) + options.pseudoElement = pseudoElement; + return element.animate(keyframeOptions, options); + } + + function isGenerator(type) { + return typeof type === "function" && "applyToOptions" in type; + } + + function applyGeneratorOptions({ type, ...options }) { + if (isGenerator(type) && supportsLinearEasing()) { + return type.applyToOptions(options); + } + else { + options.duration ?? (options.duration = 300); + options.ease ?? (options.ease = "easeOut"); + } + return options; + } + + /** + * NativeAnimation implements AnimationPlaybackControls for the browser's Web Animations API. + */ + class NativeAnimation extends WithPromise { + constructor(options) { + super(); + this.finishedTime = null; + this.isStopped = false; + /** + * Tracks a manually-set start time that takes precedence over WAAPI's + * dynamic startTime. This is cleared when play() or time setter is called, + * allowing WAAPI to take over timing. + */ + this.manualStartTime = null; + if (!options) + return; + const { element, name, keyframes, pseudoElement, allowFlatten = false, finalKeyframe, onComplete, } = options; + this.isPseudoElement = Boolean(pseudoElement); + this.allowFlatten = allowFlatten; + this.options = options; + motionUtils.invariant(typeof options.type !== "string", `Mini animate() doesn't support "type" as a string.`, "mini-spring"); + const transition = applyGeneratorOptions(options); + this.animation = startWaapiAnimation(element, name, keyframes, transition, pseudoElement); + if (transition.autoplay === false) { + this.animation.pause(); + } + this.animation.onfinish = () => { + this.finishedTime = this.time; + if (!pseudoElement) { + const keyframe = getFinalKeyframe(keyframes, this.options, finalKeyframe, this.speed); + if (this.updateMotionValue) { + this.updateMotionValue(keyframe); + } + /** + * If we can, we want to commit the final style as set by the user, + * rather than the computed keyframe value supplied by the animation. + * We always do this, even when a motion value is present, to prevent + * a visual flash in Firefox where the WAAPI animation's fill is removed + * during cancel() before the scheduled render can apply the correct value. + */ + setStyle(element, name, keyframe); + this.animation.cancel(); + } + onComplete?.(); + this.notifyFinished(); + }; + } + play() { + if (this.isStopped) + return; + this.manualStartTime = null; + this.animation.play(); + if (this.state === "finished") { + this.updateFinished(); + } + } + pause() { + this.animation.pause(); + } + complete() { + this.animation.finish?.(); + } + cancel() { + try { + this.animation.cancel(); + } + catch (e) { } + } + stop() { + if (this.isStopped) + return; + this.isStopped = true; + const { state } = this; + if (state === "idle" || state === "finished") { + return; + } + if (this.updateMotionValue) { + this.updateMotionValue(); + } + else { + this.commitStyles(); + } + if (!this.isPseudoElement) + this.cancel(); + } + /** + * WAAPI doesn't natively have any interruption capabilities. + * + * In this method, we commit styles back to the DOM before cancelling + * the animation. + * + * This is designed to be overridden by NativeAnimationExtended, which + * will create a renderless JS animation and sample it twice to calculate + * its current value, "previous" value, and therefore allow + * Motion to also correctly calculate velocity for any subsequent animation + * while deferring the commit until the next animation frame. + */ + commitStyles() { + const element = this.options?.element; + if (!this.isPseudoElement && element?.isConnected) { + this.animation.commitStyles?.(); + } + } + get duration() { + const duration = this.animation.effect?.getComputedTiming?.().duration || 0; + return motionUtils.millisecondsToSeconds(Number(duration)); + } + get iterationDuration() { + const { delay = 0 } = this.options || {}; + return this.duration + motionUtils.millisecondsToSeconds(delay); + } + get time() { + return motionUtils.millisecondsToSeconds(Number(this.animation.currentTime) || 0); + } + set time(newTime) { + const wasFinished = this.finishedTime !== null; + this.manualStartTime = null; + this.finishedTime = null; + this.animation.currentTime = motionUtils.secondsToMilliseconds(newTime); + if (wasFinished) { + this.animation.pause(); + } + } + /** + * The playback speed of the animation. + * 1 = normal speed, 2 = double speed, 0.5 = half speed. + */ + get speed() { + return this.animation.playbackRate; + } + set speed(newSpeed) { + // Allow backwards playback after finishing + if (newSpeed < 0) + this.finishedTime = null; + this.animation.playbackRate = newSpeed; + } + get state() { + return this.finishedTime !== null + ? "finished" + : this.animation.playState; + } + get startTime() { + return this.manualStartTime ?? Number(this.animation.startTime); + } + set startTime(newStartTime) { + this.manualStartTime = this.animation.startTime = newStartTime; + } + /** + * Attaches a timeline to the animation, for instance the `ScrollTimeline`. + */ + attachTimeline({ timeline, rangeStart, rangeEnd, observe, }) { + if (this.allowFlatten) { + this.animation.effect?.updateTiming({ easing: "linear" }); + } + this.animation.onfinish = null; + if (timeline && supportsScrollTimeline()) { + this.animation.timeline = timeline; + if (rangeStart) + this.animation.rangeStart = rangeStart; + if (rangeEnd) + this.animation.rangeEnd = rangeEnd; + return motionUtils.noop; + } + else { + return observe(this); + } + } + } + + const unsupportedEasingFunctions = { + anticipate: motionUtils.anticipate, + backInOut: motionUtils.backInOut, + circInOut: motionUtils.circInOut, + }; + function isUnsupportedEase(key) { + return key in unsupportedEasingFunctions; + } + function replaceStringEasing(transition) { + if (typeof transition.ease === "string" && + isUnsupportedEase(transition.ease)) { + transition.ease = unsupportedEasingFunctions[transition.ease]; + } + } + + /** + * 10ms is chosen here as it strikes a balance between smooth + * results (more than one keyframe per frame at 60fps) and + * keyframe quantity. + */ + const sampleDelta = 10; //ms + class NativeAnimationExtended extends NativeAnimation { + constructor(options) { + /** + * The base NativeAnimation function only supports a subset + * of Motion easings, and WAAPI also only supports some + * easing functions via string/cubic-bezier definitions. + * + * This function replaces those unsupported easing functions + * with a JS easing function. This will later get compiled + * to a linear() easing function. + */ + replaceStringEasing(options); + /** + * Ensure we replace the transition type with a generator function + * before passing to WAAPI. + * + * TODO: Does this have a better home? It could be shared with + * JSAnimation. + */ + replaceTransitionType(options); + super(options); + /** + * Only set startTime when the animation should autoplay. + * Setting startTime on a paused WAAPI animation unpauses it + * (per the WAAPI spec), which breaks autoplay: false. + */ + if (options.startTime !== undefined && options.autoplay !== false) { + this.startTime = options.startTime; + } + this.options = options; + } + /** + * WAAPI doesn't natively have any interruption capabilities. + * + * Rather than read committed styles back out of the DOM, we can + * create a renderless JS animation and sample it twice to calculate + * its current value, "previous" value, and therefore allow + * Motion to calculate velocity for any subsequent animation. + */ + updateMotionValue(value) { + const { motionValue, onUpdate, onComplete, element, ...options } = this.options; + if (!motionValue) + return; + if (value !== undefined) { + motionValue.set(value); + return; + } + const sampleAnimation = new JSAnimation({ + ...options, + autoplay: false, + }); + /** + * Use wall-clock elapsed time for sampling. + * Under CPU load, WAAPI's currentTime may not reflect actual + * elapsed time, causing incorrect sampling and visual jumps. + */ + const sampleTime = Math.max(sampleDelta, time.now() - this.startTime); + const delta = motionUtils.clamp(0, sampleDelta, sampleTime - sampleDelta); + const current = sampleAnimation.sample(sampleTime).value; + /** + * Write the estimated value to inline style so it persists + * after cancel(), covering the async gap before the next + * animation starts. + */ + const { name } = this.options; + if (element && name) + setStyle(element, name, current); + motionValue.setWithVelocity(sampleAnimation.sample(Math.max(0, sampleTime - delta)).value, current, delta); + sampleAnimation.stop(); + } + } + + /** + * Check if a value is animatable. Examples: + * + * ✅: 100, "100px", "#fff" + * ❌: "block", "url(2.jpg)" + * @param value + * + * @internal + */ + const isAnimatable = (value, name) => { + // If the list of keys that might be non-animatable grows, replace with Set + if (name === "zIndex") + return false; + // If it's a number or a keyframes array, we can animate it. We might at some point + // need to do a deep isAnimatable check of keyframes, or let Popmotion handle this, + // but for now lets leave it like this for performance reasons + if (typeof value === "number" || Array.isArray(value)) + return true; + if (typeof value === "string" && // It's animatable if we have a string + (complex.test(value) || value === "0") && // And it contains numbers and/or colors + !value.startsWith("url(") // Unless it starts with "url(" + ) { + return true; + } + return false; + }; + + function hasKeyframesChanged(keyframes) { + const current = keyframes[0]; + if (keyframes.length === 1) + return true; + for (let i = 0; i < keyframes.length; i++) { + if (keyframes[i] !== current) + return true; + } + } + function canAnimate(keyframes, name, type, velocity) { + /** + * Check if we're able to animate between the start and end keyframes, + * and throw a warning if we're attempting to animate between one that's + * animatable and another that isn't. + */ + const originKeyframe = keyframes[0]; + if (originKeyframe === null) { + return false; + } + /** + * These aren't traditionally animatable but we do support them. + * In future we could look into making this more generic or replacing + * this function with mix() === mixImmediate + */ + if (name === "display" || name === "visibility") + return true; + const targetKeyframe = keyframes[keyframes.length - 1]; + const isOriginAnimatable = isAnimatable(originKeyframe, name); + const isTargetAnimatable = isAnimatable(targetKeyframe, name); + motionUtils.warning(isOriginAnimatable === isTargetAnimatable, `You are trying to animate ${name} from "${originKeyframe}" to "${targetKeyframe}". "${isOriginAnimatable ? targetKeyframe : originKeyframe}" is not an animatable value.`, "value-not-animatable"); + // Always skip if any of these are true + if (!isOriginAnimatable || !isTargetAnimatable) { + return false; + } + return (hasKeyframesChanged(keyframes) || + ((type === "spring" || isGenerator(type)) && velocity)); + } + + function makeAnimationInstant(options) { + options.duration = 0; + options.type = "keyframes"; + } + + /** + * A list of values that can be hardware-accelerated. + */ + const acceleratedValues = new Set([ + "opacity", + "clipPath", + "filter", + "transform", + "backgroundColor", + ]); + + const browserColorFunctions = /^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/; + function hasBrowserOnlyColors(keyframes) { + for (let i = 0; i < keyframes.length; i++) { + if (typeof keyframes[i] === "string" && + browserColorFunctions.test(keyframes[i])) { + return true; + } + } + return false; + } + + const colorProperties = new Set([ + "color", + "backgroundColor", + "outlineColor", + "fill", + "stroke", + "borderColor", + "borderTopColor", + "borderRightColor", + "borderBottomColor", + "borderLeftColor", + ]); + const supportsWaapi = /*@__PURE__*/ motionUtils.memo(() => Object.hasOwnProperty.call(Element.prototype, "animate")); + function supportsBrowserAnimation(options) { + const { motionValue, name, repeatDelay, repeatType, damping, type, keyframes, } = options; + const subject = motionValue?.owner?.current; + /** + * We use instanceof checks instead of isHTMLElement()/isSVGElement() + * because we explicitly **don't** want elements in different timing + * contexts (i.e. popups) to be accelerated, as it's not possible to sync + * these animations properly with those driven from the main window + * frameloop. + */ + if (!(subject instanceof HTMLElement) && + !(subject instanceof SVGElement)) { + return false; + } + const { onUpdate, transformTemplate } = motionValue.owner.getProps(); + return (supportsWaapi() && + name && + /** + * Force WAAPI for color properties with browser-only color formats + * (oklch, oklab, lab, lch, etc.) that the JS animation path can't parse. + */ + (acceleratedValues.has(name) || + (colorProperties.has(name) && + hasBrowserOnlyColors(keyframes))) && + (name !== "transform" || !transformTemplate) && + /** + * If we're outputting values to onUpdate then we can't use WAAPI as there's + * no way to read the value from WAAPI every frame. + */ + !onUpdate && + !repeatDelay && + repeatType !== "mirror" && + damping !== 0 && + type !== "inertia"); + } + + /** + * Maximum time allowed between an animation being created and it being + * resolved for us to use the latter as the start time. + * + * This is to ensure that while we prefer to "start" an animation as soon + * as it's triggered, we also want to avoid a visual jump if there's a big delay + * between these two moments. + */ + const MAX_RESOLVE_DELAY = 40; + class AsyncMotionValueAnimation extends WithPromise { + constructor({ autoplay = true, delay = 0, type = "keyframes", repeat = 0, repeatDelay = 0, repeatType = "loop", keyframes, name, motionValue, element, ...options }) { + super(); + /** + * Bound to support return animation.stop pattern + */ + this.stop = () => { + if (this._animation) { + this._animation.stop(); + this.stopTimeline?.(); + } + this.keyframeResolver?.cancel(); + }; + this.createdAt = time.now(); + const optionsWithDefaults = { + autoplay, + delay, + type, + repeat, + repeatDelay, + repeatType, + name, + motionValue, + element, + ...options, + }; + const KeyframeResolver$1 = element?.KeyframeResolver || KeyframeResolver; + this.keyframeResolver = new KeyframeResolver$1(keyframes, (resolvedKeyframes, finalKeyframe, forced) => this.onKeyframesResolved(resolvedKeyframes, finalKeyframe, optionsWithDefaults, !forced), name, motionValue, element); + this.keyframeResolver?.scheduleResolve(); + } + onKeyframesResolved(keyframes, finalKeyframe, options, sync) { + this.keyframeResolver = undefined; + const { name, type, velocity, delay, isHandoff, onUpdate } = options; + this.resolvedAt = time.now(); + /** + * If we can't animate this value with the resolved keyframes + * then we should complete it immediately. + */ + let canAnimateValue = true; + if (!canAnimate(keyframes, name, type, velocity)) { + canAnimateValue = false; + if (motionUtils.MotionGlobalConfig.instantAnimations || !delay) { + onUpdate?.(getFinalKeyframe(keyframes, options, finalKeyframe)); + } + keyframes[0] = keyframes[keyframes.length - 1]; + makeAnimationInstant(options); + options.repeat = 0; + } + /** + * Resolve startTime for the animation. + * + * This method uses the createdAt and resolvedAt to calculate the + * animation startTime. *Ideally*, we would use the createdAt time as t=0 + * as the following frame would then be the first frame of the animation in + * progress, which would feel snappier. + * + * However, if there's a delay (main thread work) between the creation of + * the animation and the first committed frame, we prefer to use resolvedAt + * to avoid a sudden jump into the animation. + */ + const startTime = sync + ? !this.resolvedAt + ? this.createdAt + : this.resolvedAt - this.createdAt > MAX_RESOLVE_DELAY + ? this.resolvedAt + : this.createdAt + : undefined; + const resolvedOptions = { + startTime, + finalKeyframe, + ...options, + keyframes, + }; + /** + * Animate via WAAPI if possible. If this is a handoff animation, the optimised animation will be running via + * WAAPI. Therefore, this animation must be JS to ensure it runs "under" the + * optimised animation. + * + * Also skip WAAPI when keyframes aren't animatable, as the resolved + * values may not be valid CSS and would trigger browser warnings. + */ + const useWaapi = canAnimateValue && + !isHandoff && + supportsBrowserAnimation(resolvedOptions); + const element = resolvedOptions.motionValue?.owner?.current; + let animation; + if (useWaapi) { + try { + animation = new NativeAnimationExtended({ + ...resolvedOptions, + element, + }); + } + catch { + animation = new JSAnimation(resolvedOptions); + } + } + else { + animation = new JSAnimation(resolvedOptions); + } + animation.finished.then(() => { + this.notifyFinished(); + }).catch(motionUtils.noop); + if (this.pendingTimeline) { + this.stopTimeline = animation.attachTimeline(this.pendingTimeline); + this.pendingTimeline = undefined; + } + this._animation = animation; + } + get finished() { + if (!this._animation) { + return this._finished; + } + else { + return this.animation.finished; + } + } + then(onResolve, _onReject) { + return this.finished.finally(onResolve).then(() => { }); + } + get animation() { + if (!this._animation) { + this.keyframeResolver?.resume(); + flushKeyframeResolvers(); + } + return this._animation; + } + get duration() { + return this.animation.duration; + } + get iterationDuration() { + return this.animation.iterationDuration; + } + get time() { + return this.animation.time; + } + set time(newTime) { + this.animation.time = newTime; + } + get speed() { + return this.animation.speed; + } + get state() { + return this.animation.state; + } + set speed(newSpeed) { + this.animation.speed = newSpeed; + } + get startTime() { + return this.animation.startTime; + } + attachTimeline(timeline) { + if (this._animation) { + this.stopTimeline = this.animation.attachTimeline(timeline); + } + else { + this.pendingTimeline = timeline; + } + return () => this.stop(); + } + play() { + this.animation.play(); + } + pause() { + this.animation.pause(); + } + complete() { + this.animation.complete(); + } + cancel() { + if (this._animation) { + this.animation.cancel(); + } + this.keyframeResolver?.cancel(); + } + } + + class GroupAnimation { + constructor(animations) { + // Bound to accomadate common `return animation.stop` pattern + this.stop = () => this.runAll("stop"); + this.animations = animations.filter(Boolean); + } + get finished() { + return Promise.all(this.animations.map((animation) => animation.finished)); + } + /** + * TODO: Filter out cancelled or stopped animations before returning + */ + getAll(propName) { + return this.animations[0][propName]; + } + setAll(propName, newValue) { + for (let i = 0; i < this.animations.length; i++) { + this.animations[i][propName] = newValue; + } + } + attachTimeline(timeline) { + const subscriptions = this.animations.map((animation) => animation.attachTimeline(timeline)); + return () => { + subscriptions.forEach((cancel, i) => { + cancel && cancel(); + this.animations[i].stop(); + }); + }; + } + get time() { + return this.getAll("time"); + } + set time(time) { + this.setAll("time", time); + } + get speed() { + return this.getAll("speed"); + } + set speed(speed) { + this.setAll("speed", speed); + } + get state() { + return this.getAll("state"); + } + get startTime() { + return this.getAll("startTime"); + } + get duration() { + return getMax(this.animations, "duration"); + } + get iterationDuration() { + return getMax(this.animations, "iterationDuration"); + } + runAll(methodName) { + this.animations.forEach((controls) => controls[methodName]()); + } + play() { + this.runAll("play"); + } + pause() { + this.runAll("pause"); + } + cancel() { + this.runAll("cancel"); + } + complete() { + this.runAll("complete"); + } + } + function getMax(animations, propName) { + let max = 0; + for (let i = 0; i < animations.length; i++) { + const value = animations[i][propName]; + if (value !== null && value > max) { + max = value; + } + } + return max; + } + + class GroupAnimationWithThen extends GroupAnimation { + then(onResolve, _onReject) { + return this.finished.finally(onResolve).then(() => { }); + } + } + + class NativeAnimationWrapper extends NativeAnimation { + constructor(animation) { + super(); + this.animation = animation; + animation.onfinish = () => { + this.finishedTime = this.time; + this.notifyFinished(); + }; + } + } + + const animationMaps = new WeakMap(); + const animationMapKey = (name, pseudoElement = "") => `${name}:${pseudoElement}`; + function getAnimationMap(element) { + let map = animationMaps.get(element); + if (!map) { + map = new Map(); + animationMaps.set(element, map); + } + return map; + } + + function calcChildStagger(children, child, delayChildren, staggerChildren = 0, staggerDirection = 1) { + const index = Array.from(children) + .sort((a, b) => a.sortNodePosition(b)) + .indexOf(child); + const numChildren = children.size; + const maxStaggerDuration = (numChildren - 1) * staggerChildren; + const delayIsFunction = typeof delayChildren === "function"; + return delayIsFunction + ? delayChildren(index, numChildren) + : staggerDirection === 1 + ? index * staggerChildren + : maxStaggerDuration - index * staggerChildren; + } + + /** + * Maximum time between the value of two frames, beyond which we + * assume the velocity has since been 0. + */ + const MAX_VELOCITY_DELTA = 30; + const isFloat = (value) => { + return !isNaN(parseFloat(value)); + }; + const collectMotionValues = { + current: undefined, + }; + /** + * `MotionValue` is used to track the state and velocity of motion values. + * + * @public + */ + class MotionValue { + /** + * @param init - The initiating value + * @param config - Optional configuration options + * + * - `transformer`: A function to transform incoming values with. + */ + constructor(init, options = {}) { + /** + * Tracks whether this value can output a velocity. Currently this is only true + * if the value is numerical, but we might be able to widen the scope here and support + * other value types. + * + * @internal + */ + this.canTrackVelocity = null; + /** + * An object containing a SubscriptionManager for each active event. + */ + this.events = {}; + this.updateAndNotify = (v) => { + const currentTime = time.now(); + /** + * If we're updating the value during another frame or eventloop + * than the previous frame, then the we set the previous frame value + * to current. + */ + if (this.updatedAt !== currentTime) { + this.setPrevFrameValue(); + } + this.prev = this.current; + this.setCurrent(v); + // Update update subscribers + if (this.current !== this.prev) { + this.events.change?.notify(this.current); + if (this.dependents) { + for (const dependent of this.dependents) { + dependent.dirty(); + } + } + } + }; + this.hasAnimated = false; + this.setCurrent(init); + this.owner = options.owner; + } + setCurrent(current) { + this.current = current; + this.updatedAt = time.now(); + if (this.canTrackVelocity === null && current !== undefined) { + this.canTrackVelocity = isFloat(this.current); + } + } + setPrevFrameValue(prevFrameValue = this.current) { + this.prevFrameValue = prevFrameValue; + this.prevUpdatedAt = this.updatedAt; + } + /** + * Adds a function that will be notified when the `MotionValue` is updated. + * + * It returns a function that, when called, will cancel the subscription. + * + * When calling `onChange` inside a React component, it should be wrapped with the + * `useEffect` hook. As it returns an unsubscribe function, this should be returned + * from the `useEffect` function to ensure you don't add duplicate subscribers.. + * + * ```jsx + * export const MyComponent = () => { + * const x = useMotionValue(0) + * const y = useMotionValue(0) + * const opacity = useMotionValue(1) + * + * useEffect(() => { + * function updateOpacity() { + * const maxXY = Math.max(x.get(), y.get()) + * const newOpacity = transform(maxXY, [0, 100], [1, 0]) + * opacity.set(newOpacity) + * } + * + * const unsubscribeX = x.on("change", updateOpacity) + * const unsubscribeY = y.on("change", updateOpacity) + * + * return () => { + * unsubscribeX() + * unsubscribeY() + * } + * }, []) + * + * return + * } + * ``` + * + * @param subscriber - A function that receives the latest value. + * @returns A function that, when called, will cancel this subscription. + * + * @deprecated + */ + onChange(subscription) { + { + motionUtils.warnOnce(false, `value.onChange(callback) is deprecated. Switch to value.on("change", callback).`); + } + return this.on("change", subscription); + } + on(eventName, callback) { + if (!this.events[eventName]) { + this.events[eventName] = new motionUtils.SubscriptionManager(); + } + const unsubscribe = this.events[eventName].add(callback); + if (eventName === "change") { + return () => { + unsubscribe(); + /** + * If we have no more change listeners by the start + * of the next frame, stop active animations. + */ + frame.read(() => { + if (!this.events.change.getSize()) { + this.stop(); + } + }); + }; + } + return unsubscribe; + } + clearListeners() { + for (const eventManagers in this.events) { + this.events[eventManagers].clear(); + } + } + /** + * Attaches a passive effect to the `MotionValue`. + */ + attach(passiveEffect, stopPassiveEffect) { + this.passiveEffect = passiveEffect; + this.stopPassiveEffect = stopPassiveEffect; + } + /** + * Sets the state of the `MotionValue`. + * + * @remarks + * + * ```jsx + * const x = useMotionValue(0) + * x.set(10) + * ``` + * + * @param latest - Latest value to set. + * @param render - Whether to notify render subscribers. Defaults to `true` + * + * @public + */ + set(v) { + if (!this.passiveEffect) { + this.updateAndNotify(v); + } + else { + this.passiveEffect(v, this.updateAndNotify); + } + } + setWithVelocity(prev, current, delta) { + this.set(current); + this.prev = undefined; + this.prevFrameValue = prev; + this.prevUpdatedAt = this.updatedAt - delta; + } + /** + * Set the state of the `MotionValue`, stopping any active animations, + * effects, and resets velocity to `0`. + */ + jump(v, endAnimation = true) { + this.updateAndNotify(v); + this.prev = v; + this.prevUpdatedAt = this.prevFrameValue = undefined; + endAnimation && this.stop(); + if (this.stopPassiveEffect) + this.stopPassiveEffect(); + } + dirty() { + this.events.change?.notify(this.current); + } + addDependent(dependent) { + if (!this.dependents) { + this.dependents = new Set(); + } + this.dependents.add(dependent); + } + removeDependent(dependent) { + if (this.dependents) { + this.dependents.delete(dependent); + } + } + /** + * Returns the latest state of `MotionValue` + * + * @returns - The latest state of `MotionValue` + * + * @public + */ + get() { + if (collectMotionValues.current) { + collectMotionValues.current.push(this); + } + return this.current; + } + /** + * @public + */ + getPrevious() { + return this.prev; + } + /** + * Returns the latest velocity of `MotionValue` + * + * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical. + * + * @public + */ + getVelocity() { + const currentTime = time.now(); + if (!this.canTrackVelocity || + this.prevFrameValue === undefined || + currentTime - this.updatedAt > MAX_VELOCITY_DELTA) { + return 0; + } + const delta = Math.min(this.updatedAt - this.prevUpdatedAt, MAX_VELOCITY_DELTA); + // Casts because of parseFloat's poor typing + return motionUtils.velocityPerSecond(parseFloat(this.current) - + parseFloat(this.prevFrameValue), delta); + } + /** + * Registers a new animation to control this `MotionValue`. Only one + * animation can drive a `MotionValue` at one time. + * + * ```jsx + * value.start() + * ``` + * + * @param animation - A function that starts the provided animation + */ + start(startAnimation) { + this.stop(); + return new Promise((resolve) => { + this.hasAnimated = true; + this.animation = startAnimation(resolve); + if (this.events.animationStart) { + this.events.animationStart.notify(); + } + }).then(() => { + if (this.events.animationComplete) { + this.events.animationComplete.notify(); + } + this.clearAnimation(); + }); + } + /** + * Stop the currently active animation. + * + * @public + */ + stop() { + if (this.animation) { + this.animation.stop(); + if (this.events.animationCancel) { + this.events.animationCancel.notify(); + } + } + this.clearAnimation(); + } + /** + * Returns `true` if this value is currently animating. + * + * @public + */ + isAnimating() { + return !!this.animation; + } + clearAnimation() { + delete this.animation; + } + /** + * Destroy and clean up subscribers to this `MotionValue`. + * + * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically + * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually + * created a `MotionValue` via the `motionValue` function. + * + * @public + */ + destroy() { + this.dependents?.clear(); + this.events.destroy?.notify(); + this.clearListeners(); + this.stop(); + if (this.stopPassiveEffect) { + this.stopPassiveEffect(); + } + } + } + function motionValue(init, options) { + return new MotionValue(init, options); + } + + /** + * If `transition` has `inherit: true`, shallow-merge it with + * `parentTransition` (child keys win) and strip the `inherit` key. + * Otherwise return `transition` unchanged. + */ + function resolveTransition(transition, parentTransition) { + if (transition?.inherit && parentTransition) { + const { inherit: _, ...rest } = transition; + return { ...parentTransition, ...rest }; + } + return transition; + } + + function getValueTransition(transition, key) { + const valueTransition = transition?.[key] ?? + transition?.["default"] ?? + transition; + if (valueTransition !== transition) { + return resolveTransition(valueTransition, transition); + } + return valueTransition; + } + + const underDampedSpring = { + type: "spring", + stiffness: 500, + damping: 25, + restSpeed: 10, + }; + const criticallyDampedSpring = (target) => ({ + type: "spring", + stiffness: 550, + damping: target === 0 ? 2 * Math.sqrt(550) : 30, + restSpeed: 10, + }); + const keyframesTransition = { + type: "keyframes", + duration: 0.8, + }; + /** + * Default easing curve is a slightly shallower version of + * the default browser easing curve. + */ + const ease = { + type: "keyframes", + ease: [0.25, 0.1, 0.35, 1], + duration: 0.3, + }; + const getDefaultTransition = (valueKey, { keyframes }) => { + if (keyframes.length > 2) { + return keyframesTransition; + } + else if (transformProps.has(valueKey)) { + return valueKey.startsWith("scale") + ? criticallyDampedSpring(keyframes[1]) + : underDampedSpring; + } + return ease; + }; + + const orchestrationKeys = new Set([ + "when", + "delay", + "delayChildren", + "staggerChildren", + "staggerDirection", + "repeat", + "repeatType", + "repeatDelay", + "from", + "elapsed", + ]); + /** + * Decide whether a transition is defined on a given Transition. + * This filters out orchestration options and returns true + * if any options are left. + */ + function isTransitionDefined(transition) { + for (const key in transition) { + if (!orchestrationKeys.has(key)) + return true; + } + return false; + } + + const animateMotionValue = (name, value, target, transition = {}, element, isHandoff) => (onComplete) => { + const valueTransition = getValueTransition(transition, name) || {}; + /** + * Most transition values are currently completely overwritten by value-specific + * transitions. In the future it'd be nicer to blend these transitions. But for now + * delay actually does inherit from the root transition if not value-specific. + */ + const delay = valueTransition.delay || transition.delay || 0; + /** + * Elapsed isn't a public transition option but can be passed through from + * optimized appear effects in milliseconds. + */ + let { elapsed = 0 } = transition; + elapsed = elapsed - motionUtils.secondsToMilliseconds(delay); + const options = { + keyframes: Array.isArray(target) ? target : [null, target], + ease: "easeOut", + velocity: value.getVelocity(), + ...valueTransition, + delay: -elapsed, + onUpdate: (v) => { + value.set(v); + valueTransition.onUpdate && valueTransition.onUpdate(v); + }, + onComplete: () => { + onComplete(); + valueTransition.onComplete && valueTransition.onComplete(); + }, + name, + motionValue: value, + element: isHandoff ? undefined : element, + }; + /** + * If there's no transition defined for this value, we can generate + * unique transition settings for this value. + */ + if (!isTransitionDefined(valueTransition)) { + Object.assign(options, getDefaultTransition(name, options)); + } + /** + * Both WAAPI and our internal animation functions use durations + * as defined by milliseconds, while our external API defines them + * as seconds. + */ + options.duration && (options.duration = motionUtils.secondsToMilliseconds(options.duration)); + options.repeatDelay && (options.repeatDelay = motionUtils.secondsToMilliseconds(options.repeatDelay)); + /** + * Support deprecated way to set initial value. Prefer keyframe syntax. + */ + if (options.from !== undefined) { + options.keyframes[0] = options.from; + } + let shouldSkip = false; + if (options.type === false || + (options.duration === 0 && !options.repeatDelay)) { + makeAnimationInstant(options); + if (options.delay === 0) { + shouldSkip = true; + } + } + if (motionUtils.MotionGlobalConfig.instantAnimations || + motionUtils.MotionGlobalConfig.skipAnimations || + element?.shouldSkipAnimations || + valueTransition.skipAnimations) { + shouldSkip = true; + makeAnimationInstant(options); + options.delay = 0; + } + /** + * If the transition type or easing has been explicitly set by the user + * then we don't want to allow flattening the animation. + */ + options.allowFlatten = !valueTransition.type && !valueTransition.ease; + /** + * If we can or must skip creating the animation, and apply only + * the final keyframe, do so. We also check once keyframes are resolved but + * this early check prevents the need to create an animation at all. + */ + if (shouldSkip && !isHandoff && value.get() !== undefined) { + const finalKeyframe = getFinalKeyframe(options.keyframes, valueTransition); + if (finalKeyframe !== undefined) { + frame.update(() => { + options.onUpdate(finalKeyframe); + options.onComplete(); + }); + return; + } + } + return valueTransition.isSync + ? new JSAnimation(options) + : new AsyncMotionValueAnimation(options); + }; + + const MIN_LAYOUT_DISTANCE = 20; + function bezierPoint(t, origin, control, target) { + const inv = 1 - t; + return inv * inv * origin + 2 * inv * t * control + t * t * target; + } + function bezierTangentAngle(t, originX, controlX, targetX, originY, controlY, targetY) { + const dx = 2 * (1 - t) * (controlX - originX) + 2 * t * (targetX - controlX); + const dy = 2 * (1 - t) * (controlY - originY) + 2 * t * (targetY - controlY); + return Math.atan2(dy, dx) * (180 / Math.PI); + } + function computeArcControlPoint(fromX, fromY, toX, toY, strength, peak) { + const deltaX = toX - fromX; + const deltaY = toY - fromY; + const distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY); + if (distance > 0) { + const normalPerpX = -deltaY / distance; + const normalPerpY = deltaX / distance; + const desiredHeight = strength * distance; + return { + x: fromX + deltaX * peak + normalPerpX * desiredHeight, + y: fromY + deltaY * peak + normalPerpY * desiredHeight, + }; + } + return { x: fromX, y: fromY }; + } + /** + * The pure sampling factory: `(from, to) => (t) => point`. Internal — + * used by {@link arc} and the unit tests. Not part of the public surface. + */ + function createArcPath({ strength = 0.5, peak = 0.5, direction, rotate = false, } = {}) { + const rotationScale = rotate === true ? 1 : typeof rotate === "number" ? rotate : 0; + // Auto-direction only: persists across calls to flip the bulge back + // onto the same screen side when the dominant axis changes between + // calls. Reuse the factory (module scope / useMemo) to keep this alive. + let prevBulgeSign; + const createInterpolator = (from, to) => { + const dx = to.x - from.x; + const dy = to.y - from.y; + let signed; + if (direction === "cw") { + signed = -strength; + } + else if (direction === "ccw") { + signed = strength; + } + else { + const dom = Math.abs(dx) >= Math.abs(dy) ? dx : dy; + signed = dom < 0 ? -strength : strength; + } + let control = computeArcControlPoint(from.x, from.y, to.x, to.y, signed, peak); + if (direction === undefined) { + const isVertical = Math.abs(dx) < Math.abs(dy); + const midX = from.x + dx * peak; + const midY = from.y + dy * peak; + const bulgeSign = isVertical + ? Math.sign(control.x - midX) + : Math.sign(control.y - midY); + if (prevBulgeSign !== undefined && + bulgeSign !== 0 && + bulgeSign !== prevBulgeSign) { + signed = -signed; + control = computeArcControlPoint(from.x, from.y, to.x, to.y, signed, peak); + } + else if (bulgeSign !== 0) { + prevBulgeSign = bulgeSign; + } + } + const tangent0 = rotationScale + ? bezierTangentAngle(0, from.x, control.x, to.x, from.y, control.y, to.y) + : 0; + const tangent1 = rotationScale + ? bezierTangentAngle(1, from.x, control.x, to.x, from.y, control.y, to.y) + : 0; + const tangentDelta = rotationScale + ? motionUtils.wrap(-180, 180, tangent1 - tangent0) + : 0; + return (t) => { + const out = { + x: bezierPoint(t, from.x, control.x, to.x), + y: bezierPoint(t, from.y, control.y, to.y), + }; + if (rotationScale) { + const raw = bezierTangentAngle(t, from.x, control.x, to.x, from.y, control.y, to.y); + const baseline = tangent0 + tangentDelta * t; + out.rotate = motionUtils.wrap(-180, 180, raw - baseline) * rotationScale; + } + return out; + }; + }; + return createInterpolator; + } + /** + * Creates a curved path for `transition.path`: + * + * ```ts + * + * ``` + * + * Reuse the returned value (module scope / useMemo / useRef) so its + * continuity closure survives re-renders — a fresh `arc()` has no memory. + */ + function arc(options = {}) { + const sample = createArcPath(options); + const path = { + interpolateProjection(delta) { + // `from` is the current translate offset (carries any in-flight + // displacement when interrupted); `to` is the new layout origin. + // The distance floor avoids visible wobble on tiny shifts. + const tx = delta.x.translate; + const ty = delta.y.translate; + if (Math.sqrt(tx * tx + ty * ty) < MIN_LAYOUT_DISTANCE) { + return undefined; + } + return sample({ x: tx, y: ty }, { x: 0, y: 0 }); + }, + animateVisualElement(visualElement, target, transition, delay, animations) { + if (!("x" in target || "y" in target)) + return; + const xValue = visualElement.getValue("x", visualElement.latestValues["x"] ?? 0); + const yValue = visualElement.getValue("y", visualElement.latestValues["y"] ?? 0); + const xRaw = target.x; + const yRaw = target.y; + const xFrom = (Array.isArray(xRaw) && xRaw[0] != null + ? xRaw[0] + : xValue?.get()) ?? 0; + const yFrom = (Array.isArray(yRaw) && yRaw[0] != null + ? yRaw[0] + : yValue?.get()) ?? 0; + const xTo = (Array.isArray(xRaw) + ? xRaw[xRaw.length - 1] + : xRaw ?? xFrom); + const yTo = (Array.isArray(yRaw) + ? yRaw[yRaw.length - 1] + : yRaw ?? yFrom); + // Interruption needs no flag: x/y already hold the displaced + // mid-arc position, so xFrom/yFrom carry the continuity geometry. + const interpolate = sample({ x: xFrom, y: yFrom }, { x: xTo, y: yTo }); + // Drive a dedicated `pathRotation` value (composed onto `rotate` + // at the build sites) rather than `rotate` itself, so a + // concurrent rotate animation composes and nothing accumulates + // on interrupt. + const pathRotationValue = interpolate(0).rotate !== undefined + ? visualElement.getValue("pathRotation", 0) + : undefined; + const pathTransition = { + delay, + ...getValueTransition(transition || {}, "x"), + }; + delete pathTransition.path; + const progress = motionValue(0); + progress.start(animateMotionValue("", progress, [0, 1000], { + ...pathTransition, + isSync: true, + velocity: 0, + onUpdate: (latest) => { + const point = interpolate(latest / 1000); + xValue?.set(point.x); + yValue?.set(point.y); + if (pathRotationValue && point.rotate !== undefined) { + pathRotationValue.set(point.rotate); + } + }, + onComplete: () => { + xValue?.set(xTo); + yValue?.set(yTo); + pathRotationValue?.set(0); + }, + // Interrupt/cancel must clear our additive contribution + // so it can't linger on top of the user's `rotate`. + onStop: () => pathRotationValue?.set(0), + onCancel: () => pathRotationValue?.set(0), + })); + if (progress.animation) + animations.push(progress.animation); + delete target.x; + delete target.y; + }, + }; + return path; + } + + /** + * Parse Framer's special CSS variable format into a CSS token and a fallback. + * + * ``` + * `var(--foo, #fff)` => [`--foo`, '#fff'] + * ``` + * + * @param current + */ + const splitCSSVariableRegex = + // eslint-disable-next-line redos-detector/no-unsafe-regex -- false positive, as it can match a lot of words + /^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u; + function parseCSSVariable(current) { + const match = splitCSSVariableRegex.exec(current); + if (!match) + return [,]; + const [, token1, token2, fallback] = match; + return [`--${token1 ?? token2}`, fallback]; + } + const maxDepth = 4; + function getVariableValue(current, element, depth = 1) { + motionUtils.invariant(depth <= maxDepth, `Max CSS variable fallback depth detected in property "${current}". This may indicate a circular fallback dependency.`, "max-css-var-depth"); + const [token, fallback] = parseCSSVariable(current); + // No CSS variable detected + if (!token) + return; + // Attempt to read this CSS variable off the element + const resolved = window.getComputedStyle(element).getPropertyValue(token); + if (resolved) { + const trimmed = resolved.trim(); + return motionUtils.isNumericalString(trimmed) ? parseFloat(trimmed) : trimmed; + } + return isCSSVariableToken(fallback) + ? getVariableValue(fallback, element, depth + 1) + : fallback; + } + + function getValueState(visualElement) { + const state = [{}, {}]; + visualElement?.values.forEach((value, key) => { + state[0][key] = value.get(); + state[1][key] = value.getVelocity(); + }); + return state; + } + function resolveVariantFromProps(props, definition, custom, visualElement) { + /** + * If the variant definition is a function, resolve. + */ + if (typeof definition === "function") { + const [current, velocity] = getValueState(visualElement); + definition = definition(custom !== undefined ? custom : props.custom, current, velocity); + } + /** + * If the variant definition is a variant label, or + * the function returned a variant label, resolve. + */ + if (typeof definition === "string") { + definition = props.variants && props.variants[definition]; + } + /** + * At this point we've resolved both functions and variant labels, + * but the resolved variant label might itself have been a function. + * If so, resolve. This can only have returned a valid target object. + */ + if (typeof definition === "function") { + const [current, velocity] = getValueState(visualElement); + definition = definition(custom !== undefined ? custom : props.custom, current, velocity); + } + return definition; + } + + function resolveVariant(visualElement, definition, custom) { + const props = visualElement.getProps(); + return resolveVariantFromProps(props, definition, custom !== undefined ? custom : props.custom, visualElement); + } + + const positionalKeys = new Set([ + "width", + "height", + "top", + "left", + "right", + "bottom", + ...transformPropOrder, + ]); + + const isKeyframesTarget = (v) => { + return Array.isArray(v); + }; + + /** + * Set VisualElement's MotionValue, creating a new MotionValue for it if + * it doesn't exist. + */ + function setMotionValue(visualElement, key, value) { + if (visualElement.hasValue(key)) { + visualElement.getValue(key).set(value); + } + else { + visualElement.addValue(key, motionValue(value)); + } + } + function resolveFinalValueInKeyframes(v) { + // TODO maybe throw if v.length - 1 is placeholder token? + return isKeyframesTarget(v) ? v[v.length - 1] || 0 : v; + } + function setTarget(visualElement, definition) { + const resolved = resolveVariant(visualElement, definition); + let { transitionEnd = {}, transition = {}, ...target } = resolved || {}; + target = { ...target, ...transitionEnd }; + for (const key in target) { + const value = resolveFinalValueInKeyframes(target[key]); + setMotionValue(visualElement, key, value); + } + } + + const isMotionValue = (value) => Boolean(value && value.getVelocity); + + function isWillChangeMotionValue(value) { + return Boolean(isMotionValue(value) && value.add); + } + + function addValueToWillChange(visualElement, key) { + const willChange = visualElement.getValue("willChange"); + /** + * It could be that a user has set willChange to a regular MotionValue, + * in which case we can't add the value to it. + */ + if (isWillChangeMotionValue(willChange)) { + return willChange.add(key); + } + else if (!willChange && motionUtils.MotionGlobalConfig.WillChange) { + const newWillChange = new motionUtils.MotionGlobalConfig.WillChange("auto"); + visualElement.addValue("willChange", newWillChange); + newWillChange.add(key); + } + } + + function camelToDash(str) { + return str.replace(/([A-Z])/g, (match) => `-${match.toLowerCase()}`); + } + + const optimizedAppearDataId = "framerAppearId"; + const optimizedAppearDataAttribute = "data-" + camelToDash(optimizedAppearDataId); + + function getOptimisedAppearId(visualElement) { + return visualElement.props[optimizedAppearDataAttribute]; + } + + /** + * Decide whether we should block this animation. Previously, we achieved this + * just by checking whether the key was listed in protectedKeys, but this + * posed problems if an animation was triggered by afterChildren and protectedKeys + * had been set to true in the meantime. + */ + function shouldBlockAnimation({ protectedKeys, needsAnimating }, key) { + const shouldBlock = protectedKeys.hasOwnProperty(key) && needsAnimating[key] !== true; + needsAnimating[key] = false; + return shouldBlock; + } + function animateTarget(visualElement, targetAndTransition, { delay = 0, transitionOverride, type } = {}) { + let { transition, transitionEnd, ...target } = targetAndTransition; + const defaultTransition = visualElement.getDefaultTransition(); + transition = transition + ? resolveTransition(transition, defaultTransition) + : defaultTransition; + const reduceMotion = transition?.reduceMotion; + const skipAnimations = transition?.skipAnimations; + if (transitionOverride) + transition = transitionOverride; + const animations = []; + const animationTypeState = type && + visualElement.animationState && + visualElement.animationState.getState()[type]; + const path = transition?.path; + if (path) { + // path mutates `target` to claim x/y; loop below skips them. + path.animateVisualElement(visualElement, target, transition, delay, animations); + } + for (const key in target) { + const value = visualElement.getValue(key, visualElement.latestValues[key] ?? null); + const valueTarget = target[key]; + if (valueTarget === undefined || + (animationTypeState && + shouldBlockAnimation(animationTypeState, key))) { + continue; + } + const valueTransition = { + delay, + ...getValueTransition(transition || {}, key), + }; + if (skipAnimations) + valueTransition.skipAnimations = true; + /** + * If the value is already at the defined target, skip the animation. + * We still re-assert the value via frame.update to take precedence + * over any stale transitionEnd callbacks from previous animations. + */ + const currentValue = value.get(); + if (currentValue !== undefined && + !value.isAnimating() && + !Array.isArray(valueTarget) && + valueTarget === currentValue && + !valueTransition.velocity) { + frame.update(() => value.set(valueTarget)); + continue; + } + /** + * If this is the first time a value is being animated, check + * to see if we're handling off from an existing animation. + */ + let isHandoff = false; + if (window.MotionHandoffAnimation) { + const appearId = getOptimisedAppearId(visualElement); + if (appearId) { + const startTime = window.MotionHandoffAnimation(appearId, key, frame); + if (startTime !== null) { + valueTransition.startTime = startTime; + isHandoff = true; + } + } + } + addValueToWillChange(visualElement, key); + const shouldReduceMotion = reduceMotion ?? visualElement.shouldReduceMotion; + value.start(animateMotionValue(key, value, valueTarget, shouldReduceMotion && positionalKeys.has(key) + ? { type: false } + : valueTransition, visualElement, isHandoff)); + const animation = value.animation; + if (animation) { + animations.push(animation); + } + } + if (transitionEnd) { + const applyTransitionEnd = () => frame.update(() => { + transitionEnd && setTarget(visualElement, transitionEnd); + }); + if (animations.length) { + Promise.all(animations).then(applyTransitionEnd); + } + else { + applyTransitionEnd(); + } + } + return animations; + } + + function animateVariant(visualElement, variant, options = {}) { + const resolved = resolveVariant(visualElement, variant, options.type === "exit" + ? visualElement.presenceContext?.custom + : undefined); + let { transition = visualElement.getDefaultTransition() || {} } = resolved || {}; + if (options.transitionOverride) { + transition = options.transitionOverride; + } + /** + * If we have a variant, create a callback that runs it as an animation. + * Otherwise, we resolve a Promise immediately for a composable no-op. + */ + const getAnimation = resolved + ? () => Promise.all(animateTarget(visualElement, resolved, options)) + : () => Promise.resolve(); + /** + * If we have children, create a callback that runs all their animations. + * Otherwise, we resolve a Promise immediately for a composable no-op. + */ + const getChildAnimations = visualElement.variantChildren && visualElement.variantChildren.size + ? (forwardDelay = 0) => { + const { delayChildren = 0, staggerChildren, staggerDirection, } = transition; + return animateChildren(visualElement, variant, forwardDelay, delayChildren, staggerChildren, staggerDirection, options); + } + : () => Promise.resolve(); + /** + * If the transition explicitly defines a "when" option, we need to resolve either + * this animation or all children animations before playing the other. + */ + const { when } = transition; + if (when) { + const [first, last] = when === "beforeChildren" + ? [getAnimation, getChildAnimations] + : [getChildAnimations, getAnimation]; + return first().then(() => last()); + } + else { + return Promise.all([getAnimation(), getChildAnimations(options.delay)]); + } + } + function animateChildren(visualElement, variant, delay = 0, delayChildren = 0, staggerChildren = 0, staggerDirection = 1, options) { + const animations = []; + for (const child of visualElement.variantChildren) { + child.notify("AnimationStart", variant); + animations.push(animateVariant(child, variant, { + ...options, + delay: delay + + (typeof delayChildren === "function" ? 0 : delayChildren) + + calcChildStagger(visualElement.variantChildren, child, delayChildren, staggerChildren, staggerDirection), + }).then(() => child.notify("AnimationComplete", variant))); + } + return Promise.all(animations); + } + + function animateVisualElement(visualElement, definition, options = {}) { + visualElement.notify("AnimationStart", definition); + let animation; + if (Array.isArray(definition)) { + const animations = definition.map((variant) => animateVariant(visualElement, variant, options)); + animation = Promise.all(animations); + } + else if (typeof definition === "string") { + animation = animateVariant(visualElement, definition, options); + } + else { + const resolvedDefinition = typeof definition === "function" + ? resolveVariant(visualElement, definition, options.custom) + : definition; + animation = Promise.all(animateTarget(visualElement, resolvedDefinition, options)); + } + return animation.then(() => { + visualElement.notify("AnimationComplete", definition); + }); + } + + /** + * ValueType for "auto" + */ + const auto = { + test: (v) => v === "auto", + parse: (v) => v, + }; + + /** + * Tests a provided value against a ValueType + */ + const testValueType = (v) => (type) => type.test(v); + + /** + * A list of value types commonly used for dimensions + */ + const dimensionValueTypes = [number, px, percent, degrees, vw, vh, auto]; + /** + * Tests a dimensional value against the list of dimension ValueTypes + */ + const findDimensionValueType = (v) => dimensionValueTypes.find(testValueType(v)); + + function isNone(value) { + if (typeof value === "number") { + return value === 0; + } + else if (value !== null) { + return value === "none" || value === "0" || motionUtils.isZeroValueString(value); + } + else { + return true; + } + } + + /** + * Properties that should default to 1 or 100% + */ + const maxDefaults = new Set(["brightness", "contrast", "saturate", "opacity"]); + function applyDefaultFilter(v) { + const [name, value] = v.slice(0, -1).split("("); + if (name === "drop-shadow") + return v; + const [number] = value.match(floatRegex) || []; + if (!number) + return v; + const unit = value.replace(number, ""); + let defaultValue = maxDefaults.has(name) ? 1 : 0; + if (number !== value) + defaultValue *= 100; + return name + "(" + defaultValue + unit + ")"; + } + const functionRegex = /\b([a-z-]*)\(.*?\)/gu; + const filter = { + ...complex, + getAnimatableNone: (v) => { + const functions = v.match(functionRegex); + return functions ? functions.map(applyDefaultFilter).join(" ") : v; + }, + }; + + const mask = { + ...complex, + getAnimatableNone: (v) => { + const parsed = complex.parse(v); + const transformer = complex.createTransformer(v); + return transformer(parsed.map((v) => typeof v === "number" ? 0 : typeof v === "object" ? { ...v, alpha: 1 } : v)); + }, + }; + + const int = { + ...number, + transform: Math.round, + }; + + const transformValueTypes = { + rotate: degrees, + /** + * Internal channel for `transition.path` orientToPath. Composed onto + * `rotate` at the transform-build sites so the user's `rotate` is + * never read or overwritten. Not part of `transformPropOrder`. + */ + pathRotation: degrees, + rotateX: degrees, + rotateY: degrees, + rotateZ: degrees, + scale, + scaleX: scale, + scaleY: scale, + scaleZ: scale, + skew: degrees, + skewX: degrees, + skewY: degrees, + distance: px, + translateX: px, + translateY: px, + translateZ: px, + x: px, + y: px, + z: px, + perspective: px, + transformPerspective: px, + opacity: alpha, + originX: progressPercentage, + originY: progressPercentage, + originZ: px, + }; + + const numberValueTypes = { + // Border props + borderWidth: px, + borderTopWidth: px, + borderRightWidth: px, + borderBottomWidth: px, + borderLeftWidth: px, + borderRadius: px, + borderTopLeftRadius: px, + borderTopRightRadius: px, + borderBottomRightRadius: px, + borderBottomLeftRadius: px, + // Positioning props + width: px, + maxWidth: px, + height: px, + maxHeight: px, + top: px, + right: px, + bottom: px, + left: px, + inset: px, + insetBlock: px, + insetBlockStart: px, + insetBlockEnd: px, + insetInline: px, + insetInlineStart: px, + insetInlineEnd: px, + // Spacing props + padding: px, + paddingTop: px, + paddingRight: px, + paddingBottom: px, + paddingLeft: px, + paddingBlock: px, + paddingBlockStart: px, + paddingBlockEnd: px, + paddingInline: px, + paddingInlineStart: px, + paddingInlineEnd: px, + margin: px, + marginTop: px, + marginRight: px, + marginBottom: px, + marginLeft: px, + marginBlock: px, + marginBlockStart: px, + marginBlockEnd: px, + marginInline: px, + marginInlineStart: px, + marginInlineEnd: px, + // Typography + fontSize: px, + // Misc + backgroundPositionX: px, + backgroundPositionY: px, + ...transformValueTypes, + zIndex: int, + // SVG + fillOpacity: alpha, + strokeOpacity: alpha, + numOctaves: int, + }; + + /** + * A map of default value types for common values + */ + const defaultValueTypes = { + ...numberValueTypes, + // Color props + color, + backgroundColor: color, + outlineColor: color, + fill: color, + stroke: color, + // Border props + borderColor: color, + borderTopColor: color, + borderRightColor: color, + borderBottomColor: color, + borderLeftColor: color, + filter, + WebkitFilter: filter, + mask, + WebkitMask: mask, + }; + /** + * Gets the default ValueType for the provided value key + */ + const getDefaultValueType = (key) => defaultValueTypes[key]; + + const customTypes = /*@__PURE__*/ new Set([filter, mask]); + function getAnimatableNone(key, value) { + let defaultValueType = getDefaultValueType(key); + if (!customTypes.has(defaultValueType)) + defaultValueType = complex; + // If value is not recognised as animatable, ie "none", create an animatable version origin based on the target + return defaultValueType.getAnimatableNone + ? defaultValueType.getAnimatableNone(value) + : undefined; + } + + /** + * If we encounter keyframes like "none" or "0" and we also have keyframes like + * "#fff" or "200px 200px" we want to find a keyframe to serve as a template for + * the "none" keyframes. In this case "#fff" or "200px 200px" - then these get turned into + * zero equivalents, i.e. "#fff0" or "0px 0px". + */ + const invalidTemplates = new Set(["auto", "none", "0"]); + function makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, name) { + let i = 0; + let animatableTemplate = undefined; + while (i < unresolvedKeyframes.length && !animatableTemplate) { + const keyframe = unresolvedKeyframes[i]; + if (typeof keyframe === "string" && + !invalidTemplates.has(keyframe) && + analyseComplexValue(keyframe).values.length) { + animatableTemplate = unresolvedKeyframes[i]; + } + i++; + } + if (animatableTemplate && name) { + for (const noneIndex of noneKeyframeIndexes) { + unresolvedKeyframes[noneIndex] = getAnimatableNone(name, animatableTemplate); + } + } + } + + class DOMKeyframesResolver extends KeyframeResolver { + constructor(unresolvedKeyframes, onComplete, name, motionValue, element) { + super(unresolvedKeyframes, onComplete, name, motionValue, element, true); + } + readKeyframes() { + const { unresolvedKeyframes, element, name } = this; + if (!element || !element.current) + return; + super.readKeyframes(); + /** + * If any keyframe is a CSS variable, we need to find its value by sampling the element + */ + for (let i = 0; i < unresolvedKeyframes.length; i++) { + let keyframe = unresolvedKeyframes[i]; + if (typeof keyframe === "string") { + keyframe = keyframe.trim(); + if (isCSSVariableToken(keyframe)) { + const resolved = getVariableValue(keyframe, element.current); + if (resolved !== undefined) { + unresolvedKeyframes[i] = resolved; + } + if (i === unresolvedKeyframes.length - 1) { + this.finalKeyframe = keyframe; + } + } + } + } + /** + * Resolve "none" values. We do this potentially twice - once before and once after measuring keyframes. + * This could be seen as inefficient but it's a trade-off to avoid measurements in more situations, which + * have a far bigger performance impact. + */ + this.resolveNoneKeyframes(); + /** + * Check to see if unit type has changed. If so schedule jobs that will + * temporarily set styles to the destination keyframes. + * Skip if we have more than two keyframes or this isn't a positional value. + * TODO: We can throw if there are multiple keyframes and the value type changes. + */ + if (!positionalKeys.has(name) || unresolvedKeyframes.length !== 2) { + return; + } + const [origin, target] = unresolvedKeyframes; + const originType = findDimensionValueType(origin); + const targetType = findDimensionValueType(target); + /** + * If one keyframe contains embedded CSS variables (e.g. in calc()) and the other + * doesn't, we need to measure to convert to pixels. This handles GitHub issue #3410. + */ + const originHasVar = containsCSSVariable(origin); + const targetHasVar = containsCSSVariable(target); + if (originHasVar !== targetHasVar && positionalValues[name]) { + this.needsMeasurement = true; + return; + } + /** + * Either we don't recognise these value types or we can animate between them. + */ + if (originType === targetType) + return; + /** + * If both values are numbers or pixels, we can animate between them by + * converting them to numbers. + */ + if (isNumOrPxType(originType) && isNumOrPxType(targetType)) { + for (let i = 0; i < unresolvedKeyframes.length; i++) { + const value = unresolvedKeyframes[i]; + if (typeof value === "string") { + unresolvedKeyframes[i] = parseFloat(value); + } + } + } + else if (positionalValues[name]) { + /** + * Else, the only way to resolve this is by measuring the element. + */ + this.needsMeasurement = true; + } + } + resolveNoneKeyframes() { + const { unresolvedKeyframes, name } = this; + const noneKeyframeIndexes = []; + for (let i = 0; i < unresolvedKeyframes.length; i++) { + if (unresolvedKeyframes[i] === null || + isNone(unresolvedKeyframes[i])) { + noneKeyframeIndexes.push(i); + } + } + if (noneKeyframeIndexes.length) { + makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, name); + } + } + measureInitialState() { + const { element, unresolvedKeyframes, name } = this; + if (!element || !element.current) + return; + if (name === "height") { + this.suspendedScrollY = window.pageYOffset; + } + this.measuredOrigin = positionalValues[name](element.measureViewportBox(), window.getComputedStyle(element.current)); + unresolvedKeyframes[0] = this.measuredOrigin; + // Set final key frame to measure after next render + const measureKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1]; + if (measureKeyframe !== undefined) { + element.getValue(name, measureKeyframe).jump(measureKeyframe, false); + } + } + measureEndState() { + const { element, name, unresolvedKeyframes } = this; + if (!element || !element.current) + return; + const value = element.getValue(name); + value && value.jump(this.measuredOrigin, false); + const finalKeyframeIndex = unresolvedKeyframes.length - 1; + const finalKeyframe = unresolvedKeyframes[finalKeyframeIndex]; + unresolvedKeyframes[finalKeyframeIndex] = positionalValues[name](element.measureViewportBox(), window.getComputedStyle(element.current)); + if (finalKeyframe !== null && this.finalKeyframe === undefined) { + this.finalKeyframe = finalKeyframe; + } + // If we removed transform values, reapply them before the next render + if (this.removedTransforms?.length) { + this.removedTransforms.forEach(([unsetTransformName, unsetTransformValue]) => { + element + .getValue(unsetTransformName) + .set(unsetTransformValue); + }); + } + this.resolveNoneKeyframes(); + } + } + + /** + * The four corner-radius longhands. Shared so the projection mixer, scale + * corrector, WAAPI px-value set and view-transition crop pass don't each carry + * their own copy. Order is irrelevant - every consumer mixes/corrects/animates + * each corner independently. + */ + const cornerRadiusProps = [ + "borderTopLeftRadius", + "borderTopRightRadius", + "borderBottomRightRadius", + "borderBottomLeftRadius", + ]; + + const pxValues = new Set([ + // Border props + "borderWidth", + "borderTopWidth", + "borderRightWidth", + "borderBottomWidth", + "borderLeftWidth", + "borderRadius", + ...cornerRadiusProps, + // Positioning props + "width", + "maxWidth", + "height", + "maxHeight", + "top", + "right", + "bottom", + "left", + "inset", + "insetBlock", + "insetBlockStart", + "insetBlockEnd", + "insetInline", + "insetInlineStart", + "insetInlineEnd", + // Spacing props + "padding", + "paddingTop", + "paddingRight", + "paddingBottom", + "paddingLeft", + "paddingBlock", + "paddingBlockStart", + "paddingBlockEnd", + "paddingInline", + "paddingInlineStart", + "paddingInlineEnd", + "margin", + "marginTop", + "marginRight", + "marginBottom", + "marginLeft", + "marginBlock", + "marginBlockStart", + "marginBlockEnd", + "marginInline", + "marginInlineStart", + "marginInlineEnd", + // Typography + "fontSize", + // Misc + "backgroundPositionX", + "backgroundPositionY", + ]); + + function applyPxDefaults(keyframes, name) { + for (let i = 0; i < keyframes.length; i++) { + if (typeof keyframes[i] === "number" && pxValues.has(name)) { + keyframes[i] = keyframes[i] + "px"; + } + } + } + + function isWaapiSupportedEasing(easing) { + return Boolean((typeof easing === "function" && supportsLinearEasing()) || + !easing || + (typeof easing === "string" && + (easing in supportedWaapiEasing || supportsLinearEasing())) || + motionUtils.isBezierDefinition(easing) || + (Array.isArray(easing) && easing.every(isWaapiSupportedEasing))); + } + + const supportsPartialKeyframes = /*@__PURE__*/ motionUtils.memo(() => { + try { + document.createElement("div").animate({ opacity: [1] }); + } + catch (e) { + return false; + } + return true; + }); + + function resolveElements(elementOrSelector, scope, selectorCache) { + if (elementOrSelector == null) { + return []; + } + if (elementOrSelector instanceof EventTarget) { + return [elementOrSelector]; + } + else if (typeof elementOrSelector === "string") { + let root = document; + if (scope) { + root = scope.current; + } + const elements = selectorCache?.[elementOrSelector] ?? + root.querySelectorAll(elementOrSelector); + return elements ? Array.from(elements) : []; + } + return Array.from(elementOrSelector).filter((element) => element != null); + } + + function createSelectorEffect(subjectEffect) { + return (subject, values) => { + const elements = resolveElements(subject); + const subscriptions = []; + for (const element of elements) { + const remove = subjectEffect(element, values); + subscriptions.push(remove); + } + return () => { + for (const remove of subscriptions) + remove(); + }; + }; + } + + /** + * Provided a value and a ValueType, returns the value as that value type. + */ + const getValueAsType = (value, type) => { + return type && typeof value === "number" + ? type.transform(value) + : value; + }; + + class MotionValueState { + constructor() { + this.latest = {}; + this.values = new Map(); + } + set(name, value, render, computed, useDefaultValueType = true) { + const existingValue = this.values.get(name); + if (existingValue) { + existingValue.onRemove(); + } + const onChange = () => { + const v = value.get(); + if (useDefaultValueType) { + this.latest[name] = getValueAsType(v, numberValueTypes[name]); + } + else { + this.latest[name] = v; + } + render && frame.render(render); + }; + onChange(); + const cancelOnChange = value.on("change", onChange); + computed && value.addDependent(computed); + const remove = () => { + cancelOnChange(); + render && cancelFrame(render); + this.values.delete(name); + computed && value.removeDependent(computed); + }; + this.values.set(name, { value, onRemove: remove }); + return remove; + } + get(name) { + return this.values.get(name)?.value; + } + } + + function createEffect(addValue) { + const stateCache = new WeakMap(); + return (subject, values) => { + const state = stateCache.get(subject) ?? new MotionValueState(); + stateCache.set(subject, state); + const subscriptions = []; + for (const key in values) { + const value = values[key]; + const remove = addValue(subject, state, key, value); + subscriptions.push(remove); + } + return () => { + for (const cancel of subscriptions) + cancel(); + }; + }; + } + + function canSetAsProperty(element, name) { + if (!(name in element)) + return false; + const descriptor = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(element), name) || + Object.getOwnPropertyDescriptor(element, name); + // Check if it has a setter + return descriptor && typeof descriptor.set === "function"; + } + const addAttrValue = (element, state, key, value) => { + const isProp = canSetAsProperty(element, key); + const name = isProp + ? key + : key.startsWith("data") || key.startsWith("aria") + ? camelToDash(key) + : key; + /** + * Set attribute directly via property if available + */ + const render = isProp + ? () => { + element[name] = state.latest[key]; + } + : () => { + const v = state.latest[key]; + if (v === null || v === undefined) { + element.removeAttribute(name); + } + else { + element.setAttribute(name, String(v)); + } + }; + return state.set(key, value, render); + }; + const attrEffect = /*@__PURE__*/ createSelectorEffect( + /*@__PURE__*/ createEffect(addAttrValue)); + + const propEffect = /*@__PURE__*/ createEffect((subject, state, key, value) => { + return state.set(key, value, () => { + subject[key] = state.latest[key]; + }, undefined, false); + }); + + /** + * Checks if an element is an HTML element in a way + * that works across iframes + */ + function isHTMLElement(element) { + return (motionUtils.isObject(element) && + "offsetHeight" in element && + !("ownerSVGElement" in element)); + } + + const translateAlias$1 = { + x: "translateX", + y: "translateY", + z: "translateZ", + transformPerspective: "perspective", + }; + function buildTransform$1(state) { + let transform = ""; + let transformIsDefault = true; + /** + * Loop over all possible transforms in order, adding the ones that + * are present to the transform string. + */ + for (let i = 0; i < transformPropOrder.length; i++) { + const key = transformPropOrder[i]; + const value = state.latest[key]; + if (value === undefined) + continue; + let valueIsDefault = true; + if (typeof value === "number") { + valueIsDefault = value === (key.startsWith("scale") ? 1 : 0); + } + else { + const parsed = parseFloat(value); + valueIsDefault = key.startsWith("scale") ? parsed === 1 : parsed === 0; + } + if (!valueIsDefault) { + transformIsDefault = false; + const transformName = translateAlias$1[key] || key; + transform += `${transformName}(${value}) `; + } + } + // See build-transform.ts: additive `rotate()` so user `rotate` isn't + // clobbered. Not a `transformPropOrder` slot. + const pathRotation = state.latest.pathRotation; + if (pathRotation) { + transformIsDefault = false; + transform += `rotate(${typeof pathRotation === "number" + ? `${pathRotation}deg` + : pathRotation}) `; + } + return transformIsDefault ? "none" : transform.trim(); + } + + const originProps = new Set(["originX", "originY", "originZ"]); + const addStyleValue = (element, state, key, value) => { + let render = undefined; + let computed = undefined; + if (transformProps.has(key)) { + if (!state.get("transform")) { + // If this is an HTML element, we need to set the transform-box to fill-box + // to normalise the transform relative to the element's bounding box + if (!isHTMLElement(element) && !state.get("transformBox")) { + addStyleValue(element, state, "transformBox", new MotionValue("fill-box")); + } + state.set("transform", new MotionValue("none"), () => { + element.style.transform = buildTransform$1(state); + }); + } + computed = state.get("transform"); + } + else if (originProps.has(key)) { + if (!state.get("transformOrigin")) { + state.set("transformOrigin", new MotionValue(""), () => { + const originX = state.latest.originX ?? "50%"; + const originY = state.latest.originY ?? "50%"; + const originZ = state.latest.originZ ?? 0; + element.style.transformOrigin = `${originX} ${originY} ${originZ}`; + }); + } + computed = state.get("transformOrigin"); + } + else if (isCSSVar(key)) { + render = () => { + element.style.setProperty(key, state.latest[key]); + }; + } + else { + render = () => { + element.style[key] = state.latest[key]; + }; + } + return state.set(key, value, render, computed); + }; + const styleEffect = /*@__PURE__*/ createSelectorEffect( + /*@__PURE__*/ createEffect(addStyleValue)); + + function addSVGPathValue(element, state, key, value) { + frame.render(() => element.setAttribute("pathLength", "1")); + if (key === "pathOffset") { + return state.set(key, value, () => { + // Use unitless value to avoid Safari zoom bug + const offset = state.latest[key]; + element.setAttribute("stroke-dashoffset", `${-offset}`); + }); + } + else { + if (!state.get("stroke-dasharray")) { + state.set("stroke-dasharray", new MotionValue("1 1"), () => { + const { pathLength = 1, pathSpacing } = state.latest; + // Use unitless values to avoid Safari zoom bug + element.setAttribute("stroke-dasharray", `${pathLength} ${pathSpacing ?? 1 - Number(pathLength)}`); + }); + } + return state.set(key, value, undefined, state.get("stroke-dasharray")); + } + } + const addSVGValue = (element, state, key, value) => { + if (key.startsWith("path")) { + return addSVGPathValue(element, state, key, value); + } + else if (key.startsWith("attr")) { + return addAttrValue(element, state, convertAttrKey(key), value); + } + const handler = key in element.style ? addStyleValue : addAttrValue; + return handler(element, state, key, value); + }; + const svgEffect = /*@__PURE__*/ createSelectorEffect( + /*@__PURE__*/ createEffect(addSVGValue)); + function convertAttrKey(key) { + return key.replace(/^attr([A-Z])/, (_, firstChar) => firstChar.toLowerCase()); + } + + const { schedule: microtask, cancel: cancelMicrotask } = + /* @__PURE__ */ createRenderBatcher(queueMicrotask, false); + + const isDragging = { + x: false, + y: false, + }; + function isDragActive() { + return isDragging.x || isDragging.y; + } + + function setDragLock(axis) { + if (axis === "x" || axis === "y") { + if (isDragging[axis]) { + return null; + } + else { + isDragging[axis] = true; + return () => { + isDragging[axis] = false; + }; + } + } + else { + if (isDragging.x || isDragging.y) { + return null; + } + else { + isDragging.x = isDragging.y = true; + return () => { + isDragging.x = isDragging.y = false; + }; + } + } + } + + function setupGesture(elementOrSelector, options) { + const elements = resolveElements(elementOrSelector); + const gestureAbortController = new AbortController(); + const eventOptions = { + passive: true, + ...options, + signal: gestureAbortController.signal, + }; + const cancel = () => gestureAbortController.abort(); + return [elements, eventOptions, cancel]; + } + + function isValidHover(event) { + return !(event.pointerType === "touch" || isDragActive()); + } + /** + * Create a hover gesture. hover() is different to .addEventListener("pointerenter") + * in that it has an easier syntax, filters out polyfilled touch events, interoperates + * with drag gestures, and automatically removes the "pointerennd" event listener when the hover ends. + * + * @public + */ + function hover(elementOrSelector, onHoverStart, options = {}) { + const [elements, eventOptions, cancel] = setupGesture(elementOrSelector, options); + elements.forEach((element) => { + let isPressed = false; + let deferredHoverEnd = false; + let hoverEndCallback; + const removePointerLeave = () => { + element.removeEventListener("pointerleave", onPointerLeave); + }; + const endHover = (event) => { + if (hoverEndCallback) { + hoverEndCallback(event); + hoverEndCallback = undefined; + } + removePointerLeave(); + }; + const onPointerUp = (event) => { + isPressed = false; + window.removeEventListener("pointerup", onPointerUp); + window.removeEventListener("pointercancel", onPointerUp); + if (deferredHoverEnd) { + deferredHoverEnd = false; + endHover(event); + } + }; + const onPointerDown = () => { + isPressed = true; + window.addEventListener("pointerup", onPointerUp, eventOptions); + window.addEventListener("pointercancel", onPointerUp, eventOptions); + }; + const onPointerLeave = (leaveEvent) => { + if (leaveEvent.pointerType === "touch") + return; + if (isPressed) { + deferredHoverEnd = true; + return; + } + endHover(leaveEvent); + }; + const onPointerEnter = (enterEvent) => { + if (!isValidHover(enterEvent)) + return; + deferredHoverEnd = false; + const onHoverEnd = onHoverStart(element, enterEvent); + if (typeof onHoverEnd !== "function") + return; + hoverEndCallback = onHoverEnd; + element.addEventListener("pointerleave", onPointerLeave, eventOptions); + }; + element.addEventListener("pointerenter", onPointerEnter, eventOptions); + element.addEventListener("pointerdown", onPointerDown, eventOptions); + }); + return cancel; + } + + /** + * Recursively traverse up the tree to check whether the provided child node + * is the parent or a descendant of it. + * + * @param parent - Element to find + * @param child - Element to test against parent + */ + const isNodeOrChild = (parent, child) => { + if (!child) { + return false; + } + else if (parent === child) { + return true; + } + else { + return isNodeOrChild(parent, child.parentElement); + } + }; + + const isPrimaryPointer = (event) => { + if (event.pointerType === "mouse") { + return typeof event.button !== "number" || event.button <= 0; + } + else { + /** + * isPrimary is true for all mice buttons, whereas every touch point + * is regarded as its own input. So subsequent concurrent touch points + * will be false. + * + * Specifically match against false here as incomplete versions of + * PointerEvents in very old browser might have it set as undefined. + */ + return event.isPrimary !== false; + } + }; + + const keyboardAccessibleElements = new Set([ + "BUTTON", + "INPUT", + "SELECT", + "TEXTAREA", + "A", + ]); + /** + * Checks if an element is natively keyboard accessible (focusable). + * Used by the press gesture to determine if we need to add tabIndex. + */ + function isElementKeyboardAccessible(element) { + return (keyboardAccessibleElements.has(element.tagName) || + element.isContentEditable === true); + } + const textInputElements = new Set(["INPUT", "SELECT", "TEXTAREA"]); + /** + * Checks if an element has text selection or direct interaction behavior + * that should block drag gestures from starting. + * + * This specifically targets form controls where the user might want to select + * text or interact with the control (e.g., sliders, dropdowns). + * + * Buttons and links are NOT included because they don't have click-and-move + * actions of their own - they only respond to click events, so dragging + * should still work when initiated from these elements. + */ + function isElementTextInput(element) { + return (textInputElements.has(element.tagName) || + element.isContentEditable === true); + } + + const isPressing = new WeakSet(); + + /** + * Filter out events that are not "Enter" keys. + */ + function filterEvents(callback) { + return (event) => { + if (event.key !== "Enter") + return; + callback(event); + }; + } + function firePointerEvent(target, type) { + target.dispatchEvent(new PointerEvent("pointer" + type, { isPrimary: true, bubbles: true })); + } + const enableKeyboardPress = (focusEvent, eventOptions) => { + const element = focusEvent.currentTarget; + if (!element) + return; + const handleKeydown = filterEvents(() => { + if (isPressing.has(element)) + return; + firePointerEvent(element, "down"); + const handleKeyup = filterEvents(() => { + firePointerEvent(element, "up"); + }); + const handleBlur = () => firePointerEvent(element, "cancel"); + element.addEventListener("keyup", handleKeyup, eventOptions); + element.addEventListener("blur", handleBlur, eventOptions); + }); + element.addEventListener("keydown", handleKeydown, eventOptions); + /** + * Add an event listener that fires on blur to remove the keydown events. + */ + element.addEventListener("blur", () => element.removeEventListener("keydown", handleKeydown), eventOptions); + }; + + /** + * Filter out events that are not primary pointer events, or are triggering + * while a Motion gesture is active. + */ + function isValidPressEvent(event) { + return isPrimaryPointer(event) && !isDragActive(); + } + const claimedPointerDownEvents = new WeakSet(); + /** + * Create a press gesture. + * + * Press is different to `"pointerdown"`, `"pointerup"` in that it + * automatically filters out secondary pointer events like right + * click and multitouch. + * + * It also adds accessibility support for keyboards, where + * an element with a press gesture will receive focus and + * trigger on Enter `"keydown"` and `"keyup"` events. + * + * This is different to a browser's `"click"` event, which does + * respond to keyboards but only for the `"click"` itself, rather + * than the press start and end/cancel. The element also needs + * to be focusable for this to work, whereas a press gesture will + * make an element focusable by default. + * + * @public + */ + function press(targetOrSelector, onPressStart, options = {}) { + const [targets, eventOptions, cancelEvents] = setupGesture(targetOrSelector, options); + const startPress = (startEvent) => { + const target = startEvent.currentTarget; + if (!isValidPressEvent(startEvent)) + return; + if (claimedPointerDownEvents.has(startEvent)) + return; + isPressing.add(target); + if (options.stopPropagation) { + claimedPointerDownEvents.add(startEvent); + } + const onPressEnd = onPressStart(target, startEvent); + /** + * End listeners run in the capture phase so a descendant calling + * stopPropagation() in its own pointerup handler can't prevent the + * press gesture from ending. This also keeps the gesture-end + * ordering consistent with the drag gesture. See #2794. + */ + const endEventOptions = { ...eventOptions, capture: true }; + const onPointerEnd = (endEvent, success) => { + window.removeEventListener("pointerup", onPointerUp, endEventOptions); + window.removeEventListener("pointercancel", onPointerCancel, endEventOptions); + if (isPressing.has(target)) { + isPressing.delete(target); + } + if (!isValidPressEvent(endEvent)) { + return; + } + if (typeof onPressEnd === "function") { + onPressEnd(endEvent, { success }); + } + }; + const onPointerUp = (upEvent) => { + onPointerEnd(upEvent, target === window || + target === document || + options.useGlobalTarget || + isNodeOrChild(target, upEvent.target)); + }; + const onPointerCancel = (cancelEvent) => { + onPointerEnd(cancelEvent, false); + }; + window.addEventListener("pointerup", onPointerUp, endEventOptions); + window.addEventListener("pointercancel", onPointerCancel, endEventOptions); + }; + targets.forEach((target) => { + const pointerDownTarget = options.useGlobalTarget ? window : target; + pointerDownTarget.addEventListener("pointerdown", startPress, eventOptions); + if (isHTMLElement(target)) { + target.addEventListener("focus", (event) => enableKeyboardPress(event, eventOptions)); + if (!isElementKeyboardAccessible(target) && + !target.hasAttribute("tabindex")) { + target.tabIndex = 0; + } + } + }); + return cancelEvents; + } + + function getComputedStyle$2(element, name) { + const computedStyle = window.getComputedStyle(element); + return isCSSVar(name) + ? computedStyle.getPropertyValue(name) + : computedStyle[name]; + } + + /** + * Checks if an element is an SVG element in a way + * that works across iframes + */ + function isSVGElement(element) { + return motionUtils.isObject(element) && "ownerSVGElement" in element; + } + + const resizeHandlers = new WeakMap(); + let observer; + const getSize = (borderBoxAxis, svgAxis, htmlAxis) => (target, borderBoxSize) => { + if (borderBoxSize && borderBoxSize[0]) { + return borderBoxSize[0][(borderBoxAxis + "Size")]; + } + else if (isSVGElement(target) && "getBBox" in target) { + return target.getBBox()[svgAxis]; + } + else { + return target[htmlAxis]; + } + }; + const getWidth = /*@__PURE__*/ getSize("inline", "width", "offsetWidth"); + const getHeight = /*@__PURE__*/ getSize("block", "height", "offsetHeight"); + function notifyTarget({ target, borderBoxSize }) { + resizeHandlers.get(target)?.forEach((handler) => { + handler(target, { + get width() { + return getWidth(target, borderBoxSize); + }, + get height() { + return getHeight(target, borderBoxSize); + }, + }); + }); + } + function notifyAll(entries) { + entries.forEach(notifyTarget); + } + function createResizeObserver() { + if (typeof ResizeObserver === "undefined") + return; + observer = new ResizeObserver(notifyAll); + } + function resizeElement(target, handler) { + if (!observer) + createResizeObserver(); + const elements = resolveElements(target); + elements.forEach((element) => { + let elementHandlers = resizeHandlers.get(element); + if (!elementHandlers) { + elementHandlers = new Set(); + resizeHandlers.set(element, elementHandlers); + } + elementHandlers.add(handler); + observer?.observe(element); + }); + return () => { + elements.forEach((element) => { + const elementHandlers = resizeHandlers.get(element); + elementHandlers?.delete(handler); + if (!elementHandlers?.size) { + observer?.unobserve(element); + } + }); + }; + } + + const windowCallbacks = new Set(); + let windowResizeHandler; + function createWindowResizeHandler() { + windowResizeHandler = () => { + const info = { + get width() { + return window.innerWidth; + }, + get height() { + return window.innerHeight; + }, + }; + windowCallbacks.forEach((callback) => callback(info)); + }; + window.addEventListener("resize", windowResizeHandler); + } + function resizeWindow(callback) { + windowCallbacks.add(callback); + if (!windowResizeHandler) + createWindowResizeHandler(); + return () => { + windowCallbacks.delete(callback); + if (!windowCallbacks.size && + typeof windowResizeHandler === "function") { + window.removeEventListener("resize", windowResizeHandler); + windowResizeHandler = undefined; + } + }; + } + + function resize(a, b) { + return typeof a === "function" ? resizeWindow(a) : resizeElement(a, b); + } + + function observeTimeline(update, timeline) { + let prevProgress; + const onFrame = () => { + const { currentTime } = timeline; + const percentage = currentTime === null ? 0 : currentTime.value; + const progress = percentage / 100; + if (prevProgress !== progress) { + update(progress); + } + prevProgress = progress; + }; + frame.preUpdate(onFrame, true); + return () => cancelFrame(onFrame); + } + + const statsBuffer = { + value: null, + addProjectionMetrics: null, + }; + + function clearStatsBuffer() { + statsBuffer.value = null; + statsBuffer.addProjectionMetrics = null; + } + function recordStats() { + if (statsBuffer.value) { + clearStatsBuffer(); + throw new Error("Stats are already being measured"); + } + const buffer = statsBuffer; + buffer.value = { + layoutProjection: { + nodes: [], + calculatedTargetDeltas: [], + calculatedProjections: [], + }, + }; + buffer.addProjectionMetrics = (metrics) => { + const { layoutProjection } = buffer.value; + layoutProjection.nodes.push(metrics.nodes); + layoutProjection.calculatedTargetDeltas.push(metrics.calculatedTargetDeltas); + layoutProjection.calculatedProjections.push(metrics.calculatedProjections); + }; + } + + /** + * Checks if an element is specifically an SVGSVGElement (the root SVG element) + * in a way that works across iframes + */ + function isSVGSVGElement(element) { + return isSVGElement(element) && element.tagName === "svg"; + } + + function getOriginIndex(from, total) { + if (from === "first") { + return 0; + } + else { + const lastIndex = total - 1; + return from === "last" ? lastIndex : lastIndex / 2; + } + } + function stagger(duration = 0.1, { startDelay = 0, from = 0, ease } = {}) { + return (i, total) => { + const fromIndex = typeof from === "number" ? from : getOriginIndex(from, total); + const distance = Math.abs(fromIndex - i); + let delay = duration * distance; + if (ease) { + const maxDelay = total * duration; + const easingFunction = motionUtils.easingDefinitionToFunction(ease); + delay = easingFunction(delay / maxDelay) * maxDelay; + } + return startDelay + delay; + }; + } + + function transform(...args) { + const useImmediate = !Array.isArray(args[0]); + const argOffset = useImmediate ? 0 : -1; + const inputValue = args[0 + argOffset]; + const inputRange = args[1 + argOffset]; + const outputRange = args[2 + argOffset]; + const options = args[3 + argOffset]; + const interpolator = interpolate(inputRange, outputRange, options); + return useImmediate ? interpolator(inputValue) : interpolator; + } + + /** + * Create a `MotionValue` that animates to its latest value using any transition type. + * Can either be a value or track another `MotionValue`. + * + * ```jsx + * const x = motionValue(0) + * const y = followValue(x, { type: "spring", stiffness: 300 }) + * // or with tween + * const z = followValue(x, { type: "tween", duration: 0.5, ease: "easeOut" }) + * ``` + * + * @param source - Initial value or MotionValue to track + * @param options - Animation transition options + * @returns `MotionValue` + * + * @public + */ + function followValue(source, options) { + const initialValue = isMotionValue(source) ? source.get() : source; + const value = motionValue(initialValue); + attachFollow(value, source, options); + return value; + } + /** + * Attach an animation to a MotionValue that will animate whenever the value changes. + * Similar to attachSpring but supports any transition type (spring, tween, inertia, etc.) + * + * @param value - The MotionValue to animate + * @param source - Initial value or MotionValue to track + * @param options - Animation transition options + * @returns Cleanup function + * + * @public + */ + function attachFollow(value, source, options = {}) { + const initialValue = value.get(); + let activeAnimation = null; + let latestValue = initialValue; + let latestSetter; + const unit = typeof initialValue === "string" + ? initialValue.replace(/[\d.-]/g, "") + : undefined; + const stopAnimation = () => { + if (activeAnimation) { + activeAnimation.stop(); + activeAnimation = null; + } + value.animation = undefined; + }; + const startAnimation = () => { + const currentValue = asNumber$1(value.get()); + const targetValue = asNumber$1(latestValue); + // Don't animate if we're already at the target + if (currentValue === targetValue) { + stopAnimation(); + return; + } + // Use the running animation's analytical velocity for accuracy, + // falling back to the MotionValue's velocity for the initial animation. + // This prevents systematic velocity loss at high frame rates (240hz+). + const velocity = activeAnimation + ? activeAnimation.getGeneratorVelocity() + : value.getVelocity(); + stopAnimation(); + activeAnimation = new JSAnimation({ + keyframes: [currentValue, targetValue], + velocity, + // Default to spring if no type specified (matches useSpring behavior) + type: "spring", + restDelta: 0.001, + restSpeed: 0.01, + ...options, + onUpdate: latestSetter, + }); + }; + // Use a stable function reference so the frame loop Set deduplicates + // multiple calls within the same frame (e.g. rapid mouse events) + const scheduleAnimation = () => { + startAnimation(); + value.animation = activeAnimation ?? undefined; + value["events"].animationStart?.notify(); + activeAnimation?.then(() => { + value.animation = undefined; + value["events"].animationComplete?.notify(); + }); + }; + value.attach((v, set) => { + latestValue = v; + latestSetter = (latest) => set(parseValue(latest, unit)); + frame.postRender(scheduleAnimation); + }, stopAnimation); + if (isMotionValue(source)) { + let skipNextAnimation = options.skipInitialAnimation === true; + const removeSourceOnChange = source.on("change", (v) => { + if (skipNextAnimation) { + skipNextAnimation = false; + value.jump(parseValue(v, unit), false); + } + else { + value.set(parseValue(v, unit)); + } + }); + const removeValueOnDestroy = value.on("destroy", removeSourceOnChange); + return () => { + removeSourceOnChange(); + removeValueOnDestroy(); + }; + } + return stopAnimation; + } + function parseValue(v, unit) { + return unit ? v + unit : v; + } + function asNumber$1(v) { + return typeof v === "number" ? v : parseFloat(v); + } + + function subscribeValue(inputValues, outputValue, getLatest) { + const update = () => outputValue.set(getLatest()); + const scheduleUpdate = () => frame.preRender(update, false, true); + const subscriptions = inputValues.map((v) => v.on("change", scheduleUpdate)); + outputValue.on("destroy", () => { + subscriptions.forEach((unsubscribe) => unsubscribe()); + cancelFrame(update); + }); + } + + /** + * Create a `MotionValue` that transforms the output of other `MotionValue`s by + * passing their latest values through a transform function. + * + * Whenever a `MotionValue` referred to in the provided function is updated, + * it will be re-evaluated. + * + * ```jsx + * const x = motionValue(0) + * const y = transformValue(() => x.get() * 2) // double x + * ``` + * + * @param transformer - A transform function. This function must be pure with no side-effects or conditional statements. + * @returns `MotionValue` + * + * @public + */ + function transformValue(transform) { + const collectedValues = []; + /** + * Open session of collectMotionValues. Any MotionValue that calls get() + * inside transform will be saved into this array. + */ + collectMotionValues.current = collectedValues; + const initialValue = transform(); + collectMotionValues.current = undefined; + const value = motionValue(initialValue); + subscribeValue(collectedValues, value, transform); + return value; + } + + /** + * Create a `MotionValue` that maps the output of another `MotionValue` by + * mapping it from one range of values into another. + * + * @remarks + * + * Given an input range of `[-200, -100, 100, 200]` and an output range of + * `[0, 1, 1, 0]`, the returned `MotionValue` will: + * + * - When provided a value between `-200` and `-100`, will return a value between `0` and `1`. + * - When provided a value between `-100` and `100`, will return `1`. + * - When provided a value between `100` and `200`, will return a value between `1` and `0` + * + * The input range must be a linear series of numbers. The output range + * can be any value type supported by Motion: numbers, colors, shadows, etc. + * + * Every value in the output range must be of the same type and in the same format. + * + * ```jsx + * const x = motionValue(0) + * const xRange = [-200, -100, 100, 200] + * const opacityRange = [0, 1, 1, 0] + * const opacity = mapValue(x, xRange, opacityRange) + * ``` + * + * @param inputValue - `MotionValue` + * @param inputRange - A linear series of numbers (either all increasing or decreasing) + * @param outputRange - A series of numbers, colors or strings. Must be the same length as `inputRange`. + * @param options - + * + * - clamp: boolean. Clamp values to within the given range. Defaults to `true` + * - ease: EasingFunction[]. Easing functions to use on the interpolations between each value in the input and output ranges. If provided as an array, the array must be one item shorter than the input and output ranges, as the easings apply to the transition between each. + * + * @returns `MotionValue` + * + * @public + */ + function mapValue(inputValue, inputRange, outputRange, options) { + const map = transform(inputRange, outputRange, options); + return transformValue(() => map(inputValue.get())); + } + + /** + * Create a `MotionValue` that animates to its latest value using a spring. + * Can either be a value or track another `MotionValue`. + * + * ```jsx + * const x = motionValue(0) + * const y = springValue(x, { stiffness: 300 }) + * ``` + * + * @param source - Initial value or MotionValue to track + * @param options - Spring configuration options + * @returns `MotionValue` + * + * @public + */ + function springValue(source, options) { + return followValue(source, { type: "spring", ...options }); + } + /** + * Attach a spring animation to a MotionValue that will animate whenever the value changes. + * + * @param value - The MotionValue to animate + * @param source - Initial value or MotionValue to track + * @param options - Spring configuration options + * @returns Cleanup function + * + * @public + */ + function attachSpring(value, source, options) { + return attachFollow(value, source, { type: "spring", ...options }); + } + + /** + * A list of all ValueTypes + */ + const valueTypes = [...dimensionValueTypes, color, complex]; + /** + * Tests a value against the list of ValueTypes + */ + const findValueType = (v) => valueTypes.find(testValueType(v)); + + let nameCount = 0; + /** + * Generated names live in their own namespace so we can tell a name we own + * (and must clean up) from an author-defined one - and so a stale generated + * name left behind by an interrupted transition is re-owned, not mistaken for + * the author's and leaked. + */ + const generatedName = () => `motion-view-${nameCount++}`; + const isGeneratedName = (name) => name.startsWith("motion-view-"); + /** + * Tag a captured element with a `view-transition-class` so authors can target + * its generated layer from CSS (e.g. `::view-transition-group(.hero)`) without + * the opaque generated name. Tracked in `classed` - separate from the generated + * names in `assigned` - so cleanup removes the class without ever stripping an + * author's own inline `view-transition-name`. + */ + function tagClass(element, className, classed) { + if (!className) + return; + element.style?.setProperty("view-transition-class", className); + classed.push(element); + } + /** + * Set the element's `view-transition-group` so its layer reconstructs the DOM + * hierarchy in the pseudo-tree (`contain`) - or stays flat (`none`). Tracked in + * `grouped` for cleanup. When the element clips (any non-`visible` overflow) its + * name is recorded in `clipChildren` so the caller can clip the nested children + * (`::view-transition-group-children(name)`), mirroring the live clip through + * the whole transition rather than only at the live-DOM handoff. + * + * Ignored by browsers without nested view-transition groups, where it harmlessly + * degrades to the flat default. + */ + function applyGroup(element, name, group, grouped, clipChildren) { + if (!group) + return; + element.style?.setProperty("view-transition-group", group); + grouped.push(element); + if (group !== "none" && clipChildren) { + const style = getComputedStyle(element); + if (style.overflowX !== "visible" || style.overflowY !== "visible") { + clipChildren.add(name); + } + } + } + /** + * Resolve a selector/Element to elements and ensure each one carries a + * `view-transition-name` we can target from script. + * + * Author-defined names are reused as-is. Elements that are unnamed (or use + * the browser's `auto`/`match-element`, whose generated name is not exposed + * to script) are given a unique generated name, set inline so it's captured, + * and tracked in `assigned` for later cleanup. + * + * `registry` maps each Element to its name so the same element keeps its name + * across both captures (before and after the update), which is what allows a + * persistent element to animate as a single `group` layer. + */ + function assignViewTransitionNames(definition, registry, assigned, forcedNames, className, classed = [], group, grouped = [], clipChildren) { + const elements = resolveElements(definition); + /** + * The new end of a paired morph: give each element the matching name from + * the old end (by index) so the two share one layer and morph. If the new + * end resolves to *more* elements than the old end named, the extras have no + * counterpart - give them a fresh name so they animate as newcomers rather + * than being silently left unnamed. We return the names actually assigned + * (sized to the resolved elements), not the raw `forcedNames`, so stagger + * totals and the layer set stay in step with what's on the page. + */ + if (forcedNames) { + return elements.map((element, i) => { + const existing = registry.get(element); + if (existing) + return existing; + const name = forcedNames[i] ?? generatedName(); + element.style?.setProperty("view-transition-name", name); + assigned.push(element); + registry.set(element, name); + tagClass(element, className, classed); + applyGroup(element, name, group, grouped, clipChildren); + return name; + }); + } + /** + * Read every current name up front, before assigning any. Interleaving the + * reads with the inline `setProperty` writes below would dirty styles + * between reads and force a style recalc per element; batching the reads + * keeps it to one. Elements already in the registry keep their name and + * need no read. + */ + const currentNames = elements.map((element) => registry.has(element) + ? undefined + : getComputedStyle(element).getPropertyValue("view-transition-name")); + return elements.map((element, i) => { + const existing = registry.get(element); + if (existing) + return existing; + const current = currentNames[i]; + let name; + if (current && + current !== "none" && + current !== "auto" && + current !== "match-element" && + !isGeneratedName(current)) { + /** + * The author already named this layer - target it as-is and leave + * it to them to clean up. `auto`/`match-element` are overridden + * because their generated name is not exposed to script, and a + * stale `motion-view-*` (e.g. left by an interrupted transition) is + * re-owned rather than adopted as an author name and leaked. + */ + name = current; + } + else { + name = generatedName(); + element.style?.setProperty("view-transition-name", name); + assigned.push(element); + } + registry.set(element, name); + tagClass(element, className, classed); + applyGroup(element, name, group, grouped, clipChildren); + return name; + }); + } + /** + * Remove the `view-transition-name`s we generated and the + * `view-transition-class`es we applied. Author-defined names are never touched + * (they're not in `assigned`). Safe to call more than once (e.g. on both a + * finished and an interrupted transition). + */ + function releaseViewTransitionNames(assigned, classed = [], grouped = []) { + for (const element of assigned) { + element.style?.removeProperty("view-transition-name"); + } + for (const element of classed) { + element.style?.removeProperty("view-transition-class"); + } + for (const element of grouped) { + element.style?.removeProperty("view-transition-group"); + } + } + + function chooseLayerType(valueName) { + if (valueName === "layout") + return "group"; + if (valueName === "enter" || valueName === "new") + return "new"; + return "old"; + } + + let pendingRules = {}; + let style = null; + const css = { + set: (selector, values) => { + pendingRules[selector] = values; + }, + commit: () => { + if (!style) { + style = document.createElement("style"); + style.id = "motion-view"; + } + let cssText = ""; + for (const selector in pendingRules) { + const rule = pendingRules[selector]; + cssText += `${selector} {\n`; + for (const [property, value] of Object.entries(rule)) { + cssText += ` ${property}: ${value};\n`; + } + cssText += "}\n"; + } + style.textContent = cssText; + document.head.appendChild(style); + pendingRules = {}; + }, + remove: () => { + if (style && style.parentElement) { + style.parentElement.removeChild(style); + } + }, + }; + + function getViewAnimationLayerInfo(pseudoElement) { + const match = pseudoElement.match( + // `group-children` (nested transitions) before `group` so it wins. + /::view-transition-(old|new|group-children|group|image-pair)\((.*?)\)/); + if (!match) + return null; + return { layer: match[2], type: match[1] }; + } + + function getViewAnimations() { + return document.getAnimations().filter((animation) => { + const { effect } = animation; + return (!!effect && + effect.target === document.documentElement && + effect.pseudoElement?.startsWith("::view-transition")); + }); + } + + function hasTarget(target, targets) { + return targets.has(target) && Object.keys(targets.get(target)).length > 0; + } + + const definitionNames = ["layout", "enter", "exit", "new", "old"]; + /** + * Whether a computed border-radius is square (every component zero). Splitting + * on whitespace handles two-value/elliptical radii like "0px 20px" - a leading + * `parseFloat` alone would misread the non-zero vertical radius as square. + */ + const isSquareRadius = (radius) => radius.split(" ").every((value) => parseFloat(value) === 0); + /** + * The `ViewTransitionTarget` buckets driving each generated layer type, in + * priority order - the inverse of `chooseLayerType`. The new view is driven by + * `new`/`enter`, the old by `old`/`exit`. `group-children`/`image-pair` have no + * bucket; they follow the default layout timing. + */ + const typeBuckets = { + group: ["layout"], + new: ["new", "enter"], + old: ["old", "exit"], + }; + /** + * Default "absent" origin for a single-value keyframe, by pseudo type, so e.g. + * `enter({ scale: 1 })` grows in from 0.85 and `exit({ opacity: 0 })` fades + * from 1. `enter` prefers the matching `exit` value over these (see below). + */ + const ORIGIN_DEFAULTS = { + new: { opacity: 0, scale: 0.85 }, + old: { opacity: 1, scale: 1 }, + }; + /** + * How much two box aspect ratios must differ before a morph is treated as + * aspect-changing (and so worth cropping). Matches the projection engine's + * `preserve-aspect` threshold, so small layout jitter doesn't trigger a crop. + */ + const ASPECT_TOLERANCE = 0.2; + function startViewAnimation(builder) { + const { update, targets, resolveDefs, cropOverride, pairs, classNames, flatGroups, options: defaultOptions, } = builder; + if (!document.startViewTransition) { + // An async IIFE (not `new Promise(async …)`) so a throwing/rejecting + // update rejects this promise rather than leaving it unsettled. + return (async () => { + await update(); + return new GroupAnimation([]); + })(); + } + /** + * Resolve any selector/Element targets to layer names, assigning a + * `view-transition-name` to each element as we go. We run this before the + * update (so the elements are captured in the old snapshot) and again + * after it (for the new snapshot). An element present in both keeps the + * same name and animates as a single `group` layer. + */ + const nameRegistry = new Map(); + const assigned = []; + /** + * Elements we tagged with a `view-transition-class` (via `.class()`), + * tracked separately from `assigned` so cleanup removes the class without + * ever stripping an author's own inline `view-transition-name`. + */ + const classed = []; + /** + * Elements we set a `view-transition-group` on (for nesting), tracked for + * cleanup. `clipChildren` collects the names of nested parents that clip in + * the live layout, so their `::view-transition-group-children` is clipped + * through the transition - not just once the live DOM takes back over. + */ + const grouped = []; + const clipChildren = new Set(); + const layerTargets = new Map(); + const croppedNames = new Set(); + /** + * Each layer's explicit `.crop(true | false)` override (by resolved name), + * so `finalizeCrop` can let an author's choice win over the morph default. + */ + const cropForName = new Map(); + /** + * Each layer's stagger position (index + total) within its subject, per + * snapshot. Resolving against the snapshot the layer belongs to keeps + * stagger correct when `update()` replaces the matched elements, and lets + * us skip a layer that's absent from a snapshot (e.g. an exited element + * has no `new` pseudo-element). + */ + const layerStagger = new Map(); + /** + * Names allocated for a paired subject in the old snapshot, replayed onto + * its new-snapshot target so both ends share a layer and morph. + */ + const pairNames = new Map(); + /** + * The old (`from`) elements of each paired subject, so their names can be + * transferred off before the new (`to`) elements inherit them. + */ + const pairFrom = new Map(); + const resolveLayers = (phase) => { + targets.forEach((target, definition) => { + const className = classNames.get(definition); + /** + * Nest each resolved layer under its DOM-ancestor layer by default + * (`contain`), so an ancestor's clip/transform/opacity reach it + * through the transition; `.group(false)` opts a subject out (`none`) + * to stay flat and escape. Skipped for root / pre-named layers, which + * aren't elements we resolve and style. + */ + const group = definition === "root" || !resolveDefs.has(definition) + ? undefined + : flatGroups.has(definition) + ? "none" + : "contain"; + let names; + if (definition === "root" || !resolveDefs.has(definition)) { + names = [definition]; + } + else if (pairs.has(definition)) { + /** + * Paired morph: name the old target in the old snapshot, then + * force the same name(s) onto the new target in the new one, so + * two different elements morph as a single layer. + */ + if (phase === "old") { + pairFrom.set(definition, resolveElements(definition)); + names = assignViewTransitionNames(definition, nameRegistry, assigned, undefined, className, classed, group, grouped, clipChildren); + pairNames.set(definition, names); + } + else { + /** + * Transfer the name(s) off the `from` elements before the + * `to` elements inherit them. A `from` that survives into + * the new snapshot (e.g. hidden with `visibility: hidden` + * rather than removed) would otherwise keep the name and + * collide - "duplicate view-transition-name". + */ + for (const el of pairFrom.get(definition) ?? []) { + el.style?.removeProperty("view-transition-name"); + /** + * Drop the old end from the registry too, so the new + * end alone supplies this name's `new` crop radii - we + * neither re-measure nor get ordered by a stale element. + */ + nameRegistry.delete(el); + } + names = assignViewTransitionNames(pairs.get(definition), nameRegistry, assigned, pairNames.get(definition), className, classed, group, grouped, clipChildren); + } + } + else { + names = assignViewTransitionNames(definition, nameRegistry, assigned, undefined, className, classed, group, grouped, clipChildren); + } + // Record any explicit `.crop(true | false)` per resolved name; the + // crop set itself is computed later by `finalizeCrop` (it needs both + // snapshots to know which morphs change aspect ratio). + const override = cropOverride.get(definition); + names.forEach((name, index) => { + /** + * If two subjects resolve to the same element, merge their + * definitions so neither subject's animations are dropped. + */ + const existing = layerTargets.get(name); + layerTargets.set(name, existing && existing !== target + ? { ...existing, ...target } + : target); + if (override !== undefined) + cropForName.set(name, override); + const stagger = layerStagger.get(name) ?? {}; + stagger[phase] = [index, names.length]; + layerStagger.set(name, stagger); + }); + }); + }; + /** + * The stagger index/total for a layer, resolved against the snapshot it + * belongs to. Returns index -1 when the layer is absent from that snapshot + * so the caller can skip a pseudo-element that doesn't exist. + */ + const staggerPosition = (name, type) => { + const stagger = layerStagger.get(name); + const position = type === "old" + ? stagger?.old + : type === "new" + ? stagger?.new + : // group / group-children / image-pair persist across both. + stagger?.new ?? stagger?.old; + return position ?? [-1, 1]; + }; + /** + * Merge default + per-layer transition options for a generated layer and + * resolve any stagger/delay function against this element's position. Used + * by both the morph-retiming and crop corner-radius passes. + */ + const resolveLayerTransition = (target, type, transitionName, index, total) => { + const transition = mergeTransition(getValueTransition(defaultOptions, transitionName), getValueTransition((layerOptions(target, type) ?? {}), transitionName)); + if (typeof transition.delay === "function") { + transition.delay = transition.delay(index, total); + } + return transition; + }; + /** + * Resolve a layer's group (`layout`) timing to plain WAAPI values: native + * ms `delay`/`duration` and a baked `ease`. The single source of group + * timing, shared by the generated-group retiming and the crop corner-radius + * pass so the rounded clip animates on exactly the box's timing. It returns + * no generator `type` (the WAAPI-only `NativeAnimation` rejects a string + * type) nor `repeat`/`times` (which the group's `updateTiming` ignores), so + * none of them can leak into the radius animation and desync it. + */ + const resolveGroupTiming = (name) => { + const [index, total] = staggerPosition(name, "group"); + const transition = resolveLayerTransition(layerTargets.get(name), "group", "layout", index === -1 ? 0 : index, total); + transition.duration && (transition.duration = motionUtils.secondsToMilliseconds(transition.duration)); + const { delay = 0, duration, ease } = applyGeneratorOptions(transition); + return { delay: motionUtils.secondsToMilliseconds(delay), duration, ease }; + }; + /** + * Each layer's measured box + corner radii per snapshot. The box lets + * `finalizeCrop` tell whether a morph's aspect ratio changed (the only case + * worth cropping); the radii let a cropped morph's group clip animate each + * corner from the old element's radius to the new element's, keeping it + * rounded where `overflow: clip` would otherwise square the corners. + * + * We never flatten the source for capture (a snapshot is a paint of the live + * DOM, so squaring an element just for its capture would flash one real + * square frame). For an aspect-changing morph `object-fit: cover` crops each + * snapshot's own baked corners off-screen mid-morph, so the animated clip is + * the only visible corner; a near-same-aspect forced crop (`.crop(true)`) + * can't hide the outgoing snapshot's silhouette, but the endpoints coincide. + */ + const cropMeasurements = new Map(); + const measureLayers = (phase) => nameRegistry.forEach((name, element) => { + const el = element; + const rect = el.getBoundingClientRect?.(); + if (rect && rect.height) { + const style = getComputedStyle(el); + const radii = {}; + for (const corner of cornerRadiusProps) { + radii[corner] = style[corner]; + } + const entry = cropMeasurements.get(name) ?? {}; + entry[phase] = { width: rect.width, height: rect.height, radii }; + cropMeasurements.set(name, entry); + } + }); + /** + * With both snapshots measured, settle which layers crop. The default crops + * only a morph whose aspect ratio *changes* between snapshots - the one case + * where `object-fit: cover` does real work. A same-aspect morph or a + * fade-only layer is left uncropped: its corners scale naturally (no flash + * from squaring, no `overflow: clip` eating its shadow) and a backdrop can't + * be clipped to nothing. An explicit `.crop(true | false)` overrides either + * way. Runs after both snapshots are measured, since aspect needs both. + */ + const finalizeCrop = () => { + croppedNames.clear(); + for (const name of layerStagger.keys()) { + if (name === "root") + continue; + // An explicit `.crop(true | false)` wins; otherwise crop a morph + // whose aspect ratio changed. + if (cropForName.get(name) ?? aspectChanged(name)) { + croppedNames.add(name); + } + } + }; + /** + * Whether a layer is a morph whose box aspect ratio changed between + * snapshots (beyond a small tolerance). Fade-only layers (one snapshot) are + * never "changed". + */ + const aspectChanged = (name) => { + const box = cropMeasurements.get(name); + if (!box?.old || !box?.new || !box.old.height || !box.new.height) { + return false; + } + return (Math.abs(box.old.width / box.old.height - + box.new.width / box.new.height) > ASPECT_TOLERANCE); + }; + /** + * Write the persistent view-transition CSS: suppress root capture when the + * root has no animations of its own; force linear timing (baked into the + * keyframes, so we can retime later via updateTiming); and clip + + * object-fit: cover every cropped morph (the UA default overflows on + * aspect-ratio change). + * + * `css.commit` replaces rather than appends, so we re-set the full rule set + * each call - the crop rules are only known after `finalizeCrop` runs in the + * update callback, so the second call writes them. + */ + const commitViewCSS = () => { + if (!hasTarget("root", targets)) { + css.set(":root", { "view-transition-name": "none" }); + } + css.set("::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)", { "animation-timing-function": "linear !important" }); + croppedNames.forEach((name) => { + css.set(`::view-transition-group(${name})`, { overflow: "clip" }); + css.set(`::view-transition-old(${name}), ::view-transition-new(${name})`, { width: "100%", height: "100%", "object-fit": "cover" }); + }); + /** + * Clip the nested children of any layer that clips in the live layout, + * so a wrapper crops its child for the whole morph (mirroring the DOM) + * rather than only at the live-DOM handoff. No-op on browsers without + * nested view-transition groups. + */ + clipChildren.forEach((name) => { + css.set(`::view-transition-group-children(${name})`, { + overflow: "clip", + }); + }); + css.commit(); // Write + }; + const cleanup = () => { + releaseViewTransitionNames(assigned, classed, grouped); + css.remove(); // Write + }; + const callback = async () => { + await update(); + /** + * Re-resolve so elements created by the update are named for the new + * snapshot, then measure them. With both snapshots measured we can + * settle the crop set (aspect-changing morphs + forced). + */ + resolveLayers("new"); + measureLayers("new"); + finalizeCrop(); + /** + * Re-commit the crop CSS unconditionally: `finalizeCrop` is computed + * here (after both snapshots are measured), so the clip rules must be + * (re)written to match the settled set. + */ + commitViewCSS(); + }; + let transition; + try { + resolveLayers("old"); + /** + * Measure the old snapshot against the optimistic crop set (the new + * snapshot doesn't exist yet, so aspect change can't be known here; + * `finalizeCrop` settles it post-update). + */ + measureLayers("old"); + commitViewCSS(); + transition = document.startViewTransition(callback); + } + catch (error) { + /** + * The prelude writes inline names before the transition exists. If it + * throws (e.g. startViewTransition rejects in a bad UA state), release + * them so we neither leak DOM state nor stall the queue on a promise + * that never settles - hand back a rejection it can advance past. + */ + cleanup(); + return Promise.reject(error); + } + transition.finished.finally(cleanup); + return new Promise((resolve, reject) => { + transition.ready + .then(() => { + const generatedViewAnimations = getViewAnimations(); + const animations = []; + /** + * Create animations for each of our explicitly-defined subjects. + * `opacityAnimated` additionally tracks which `${name}:${type}` + * we faded, so we can keep the UA `plus-lighter` blend only for a + * genuine opacity crossfade (both sides fading) and drop it for a + * slide/transform, where additive compositing would flash bright. + */ + const explicitlyAnimated = new Set(); + const opacityAnimated = new Set(); + layerTargets.forEach((target, name) => { + const stagger = layerStagger.get(name); + /** + * Presence: `enter` only fires for a pure newcomer (a new + * view with no old), `exit` only for a pure leaver. A + * survivor (both) gets neither - it just morphs. + */ + const enterApplies = !!stagger?.new && !stagger?.old; + const exitApplies = !!stagger?.old && !stagger?.new; + for (const key of definitionNames) { + if (!target[key]) + continue; + if (key === "enter" && !enterApplies) + continue; + if (key === "exit" && !exitApplies) + continue; + const type = chooseLayerType(key); + const [index, total] = staggerPosition(name, type); + // Skip a layer absent from its snapshot. + if (index === -1) + continue; + const { keyframes, options } = target[key]; + for (let [valueName, valueKeyframes] of Object.entries(keyframes)) { + // Skip only missing values - `0` (e.g. opacity: 0) + // is valid and must reach the from-value inference. + if (valueKeyframes == null) + continue; + /** + * The view path hands keyframes straight to WAAPI, + * so Motion's `x`/`y` shorthands (compiled to + * `transform` only via the value pipeline) have no + * effect. Warn and skip - use `transform`/`translate`. + */ + if (valueName === "x" || valueName === "y") { + motionUtils.warnOnce(false, `animateView() animates view-transition layers with CSS properties; the "${valueName}" shorthand has no effect - use transform, e.g. { transform: "translateX(40px)" }.`); + continue; + } + /** + * enter/exit win over new/old on a shared property - + * skip it here when the gated bucket also defines it. + */ + if (key === "new" && + enterApplies && + target.enter?.keyframes[valueName] != null) { + continue; + } + if (key === "old" && + exitApplies && + target.exit?.keyframes[valueName] != null) { + continue; + } + const valueOptions = mergeTransition(getValueTransition(defaultOptions, valueName), getValueTransition(options, valueName)); + /** + * Infer an origin for a single-value keyframe. An + * `enter` mirrors the matching `exit` value (a + * defined exit reverses into the enter for free); + * otherwise the per-type default (opacity 0/1, scale + * 0.85). No default -> left as-is (animates from the + * live value). + * + * `new`/`old` fire for survivors too, where only the + * opacity crossfade default applies - a transform + * default like scale 0.85 would pop a persisting + * element, so gate it on the layer actually + * entering/leaving. + */ + if (!Array.isArray(valueKeyframes)) { + const exitValue = key === "enter" + ? target.exit?.keyframes[valueName] + : undefined; + const allowDefault = valueName === "opacity" || + (type === "new" ? enterApplies : exitApplies); + const from = exitValue != null + ? Array.isArray(exitValue) + ? exitValue[exitValue.length - 1] + : exitValue + : allowDefault + ? ORIGIN_DEFAULTS[type]?.[valueName] + : undefined; + if (from !== undefined) { + valueKeyframes = [from, valueKeyframes]; + } + } + /** + * Resolve stagger function if provided, per element + * across this subject's resolved layers. + */ + if (typeof valueOptions.delay === "function") { + valueOptions.delay = valueOptions.delay(index, total); + } + valueOptions.duration && (valueOptions.duration = motionUtils.secondsToMilliseconds(valueOptions.duration)); + valueOptions.delay && (valueOptions.delay = motionUtils.secondsToMilliseconds(valueOptions.delay)); + animations.push(new NativeAnimation({ + ...valueOptions, + element: document.documentElement, + name: valueName, + pseudoElement: `::view-transition-${type}(${name})`, + keyframes: valueKeyframes, + })); + explicitlyAnimated.add(`${name}:${type}`); + if (valueName === "opacity") { + opacityAnimated.add(`${name}:${type}`); + } + } + } + }); + /** + * Handle browser generated animations + */ + for (const animation of generatedViewAnimations) { + if (animation.playState === "finished") + continue; + const { effect } = animation; + if (!effect || !(effect instanceof KeyframeEffect)) + continue; + const { pseudoElement } = effect; + if (!pseudoElement) + continue; + const name = getViewAnimationLayerInfo(pseudoElement); + if (!name) + continue; + const targetDefinition = layerTargets.get(name.layer); + /** + * We built our own animation for this layer, so drop the + * browser-generated fade we're replacing. The UA + * `plus-lighter` blend is a *separate* generated animation on + * the same pseudo (it sets `mix-blend-mode` in its keyframes): + * keep it *only* for a true opacity crossfade - both sides + * fading - so a symmetric crossfade composites without + * darkening, but a slide/transform (where both layers stay + * opaque and overlap) doesn't flash bright from the addition. + */ + if (explicitlyAnimated.has(`${name.layer}:${name.type}`)) { + const isCrossfade = opacityAnimated.has(`${name.layer}:new`) && + opacityAnimated.has(`${name.layer}:old`); + if (isCrossfade && + effect + .getKeyframes() + .some((keyframe) => keyframe.mixBlendMode)) { + animations.push(new NativeAnimationWrapper(animation)); + } + else { + animation.cancel(); + } + continue; + } + /** + * Drop the orphaned half of the default crossfade. The UA + * fades old out and new in as a *pair*; if the opposing half + * was explicitly overridden with something other than an + * opacity fade (a clip or transform reveal), this side's + * default opacity fade has no partner - left to run it would + * dissolve what should be a static backdrop (e.g. + * `.new({ clipPath })` should reveal over a still old view, + * not fade the old out around the growing clip). Cancel it - + * and its `plus-lighter` sibling on the same pseudo, which + * would otherwise flash bright where the two opaque layers + * overlap. A genuine crossfade (the opposing side also fading + * opacity) keeps both halves and is handled above. + */ + const opposite = name.type === "old" + ? "new" + : name.type === "new" + ? "old" + : undefined; + if (opposite && + explicitlyAnimated.has(`${name.layer}:${opposite}`) && + !opacityAnimated.has(`${name.layer}:${opposite}`)) { + animation.cancel(); + continue; + } + /** + * Otherwise retime the browser-generated animation to + * Motion's timing. This auto-enables the layout (group) + * morph for any resolved/named target, and applies the + * default timing to old/new layers we haven't explicitly + * overridden. + * + * group + group-children both follow the layout timing so + * the nesting container stays in sync with the morph. + */ + /** + * A survivor's old + new are the two halves of one + * `plus-lighter` crossfade. They must share identical timing + * (so their opacities stay mirrored and sum to 1 - else the + * additive blend flashes bright wherever both are partly + * visible) and fade linearly (the bounce belongs on the + * group's geometry, not the opacity). So time them as the + * group, rather than via their own - potentially staggered, + * or enter/exit-derived - old/new options. + */ + const stagger = layerStagger.get(name.layer); + const isMorphCrossfade = (name.type === "old" || name.type === "new") && + !!stagger?.old && + !!stagger?.new; + let timing; + if (name.type.startsWith("group")) { + // group + group-children follow the resolved group + // timing - the single source shared with the crop + // corner-radius pass below. + const { delay, duration, ease } = resolveGroupTiming(name.layer); + timing = { + delay, + duration, + easing: mapEasingToNativeEasing(ease, duration), + }; + } + else { + const timingType = isMorphCrossfade ? "group" : name.type; + const [index, total] = staggerPosition(name.layer, timingType); + const transitionName = timingType === "group" ? "layout" : ""; + let animationTransition = resolveLayerTransition(targetDefinition, timingType, transitionName, index === -1 ? 0 : index, total); + /** + * The crossfade should resolve at the spring's + * *perceptual* (visual) duration - the geometry can keep + * bouncing, but the opacity shouldn't drag through the + * settle. So capture `visualDuration` before + * `applyGeneratorOptions` replaces it with the full + * overshoot duration, and use it for the fade. + */ + const visualDuration = animationTransition.visualDuration; + animationTransition.duration && (animationTransition.duration = motionUtils.secondsToMilliseconds(animationTransition.duration)); + animationTransition = + applyGeneratorOptions(animationTransition); + timing = { + delay: motionUtils.secondsToMilliseconds(animationTransition.delay ?? 0), + duration: isMorphCrossfade && visualDuration !== undefined + ? motionUtils.secondsToMilliseconds(visualDuration) + : animationTransition.duration, + easing: isMorphCrossfade + ? "linear" + : mapEasingToNativeEasing(animationTransition.ease, animationTransition.duration), + }; + } + effect.updateTiming(timing); + animations.push(new NativeAnimationWrapper(animation)); + } + /** + * Round each cropped layer's clip. Its `::view-transition-group` + * has `overflow: clip`, which would otherwise square the corners + * mid-morph; animate each corner from the old element's radius to + * the new element's so the crop stays rounded. Timed as the group + * (`layout`) so the radius tracks the morphing box. + */ + cropMeasurements.forEach((entry, name) => { + if (!croppedNames.has(name)) + return; + // Reuse the group's resolved timing - native ms delay/ + // duration + a baked ease, with no generator `type` or + // repeat/times to leak into (or throw inside) NativeAnimation. + const { delay, duration, ease } = resolveGroupTiming(name); + for (const corner of cornerRadiusProps) { + // `||` (not `??`) so an empty measurement falls back to + // the other snapshot rather than an invalid keyframe. + const from = entry.old?.radii[corner] || + entry.new?.radii[corner] || + "0px"; + const to = entry.new?.radii[corner] || + entry.old?.radii[corner] || + "0px"; + // Nothing to round if the corner is square at both ends. + if (isSquareRadius(from) && isSquareRadius(to)) + continue; + animations.push(new NativeAnimation({ + element: document.documentElement, + name: corner, + pseudoElement: `::view-transition-group(${name})`, + keyframes: [from, to], + delay, + duration, + ease, + })); + } + }); + resolve(new GroupAnimation(animations)); + }) + .catch(() => + /** + * `ready` rejects when the transition is skipped - no visual + * change, or superseded by an interrupting transition. The DOM + * update still applied, so settle with no animations rather than + * surfacing it as an error to an awaiting caller. A genuine + * failure in `update()` rejects `updateCallbackDone` (already + * settled by now), so propagate that instead. + */ + transition.updateCallbackDone.then(() => resolve(new GroupAnimation([])), reject)); + }); + } + /** + * The options that should time a given generated layer type, so a retimed + * group/old/new picks up any per-target transition the user provided. Checks + * the type's buckets in priority order (e.g. `new` before `enter`). + */ + function layerOptions(target, type) { + for (const bucket of typeBuckets[type] ?? []) { + const options = target?.[bucket]?.options; + if (options) + return options; + } + } + /** + * Merge a base transition (e.g. the default `options`) with a per-layer/value + * override. An explicit `duration` on the override must win over an inherited + * generator's own timing: a spring prefers `visualDuration`, and + * `spring.applyToOptions` overwrites `duration` with the computed settle time - + * so without this the override is silently discarded. Dropping the inherited + * `type`/`visualDuration` makes the layer a plain tween of that duration, unless + * it asked for its own generator `type`/`visualDuration`. + */ + function mergeTransition(base, override) { + const merged = { ...base, ...override }; + if (override.duration !== undefined) { + if (override.visualDuration === undefined) + delete merged.visualDuration; + if (override.type === undefined) + delete merged.type; + } + return merged; + } + + let builders = []; + let current = null; + function next() { + current = null; + const [nextBuilder] = builders; + if (nextBuilder) + start(nextBuilder); + } + function start(builder) { + motionUtils.removeItem(builders, builder); + current = builder; + startViewAnimation(builder) + .then((animation) => { + builder.notifyReady(animation); + return animation.finished; + }) + // A genuinely failed transition (a throwing update) rejects the + // builder; a skipped/interrupted one resolves with no animations (see + // start.ts). Either way, advance the queue - else later transitions hang. + .catch((error) => builder.notifyReject(error)) + .finally(next); + } + function processQueue() { + /** + * Iterate backwards over the builders array. We can ignore the + * "wait" animations. If we have an interrupting animation in the + * queue then we need to batch all preceeding animations into it. + * Currently this only batches the update functions but will also + * need to batch the targets. + */ + for (let i = builders.length - 1; i >= 0; i--) { + const builder = builders[i]; + const { interrupt } = builder.options; + if (interrupt === "immediate") { + const batchedUpdates = builders.slice(0, i + 1).map((b) => b.update); + const remaining = builders.slice(i + 1); + builder.update = () => { + batchedUpdates.forEach((update) => update()); + }; + // Put the current builder at the front, followed by any "wait" builders + builders = [builder, ...remaining]; + break; + } + } + if (!current || builders[0]?.options.interrupt === "immediate") { + next(); + } + } + function addToQueue(builder) { + builders.push(builder); + microtask.render(processQueue); + } + + class ViewTransitionBuilder { + constructor(update, options = {}) { + this.currentSubject = "root"; + this.targets = new Map(); + /** + * Definitions that must be resolved to elements (and assigned a + * `view-transition-name`) rather than treated as pre-named layers. + */ + this.resolveDefs = new Set(); + /** + * Per-subject crop override: `true` forces the crop (clip + object-fit: + * cover + animated corner radii) on, `false` forces it off. A subject with + * no entry uses the default - crop only a genuine morph (a layer present in + * both snapshots), so a fade-only enter/exit isn't clipped to nothing. + */ + this.cropOverride = new Map(); + /** + * Subjects paired with a different new-snapshot target (the second `.add()` + * argument), so two distinct elements share one name and morph into each + * other - a shared-element transition. + */ + this.pairs = new Map(); + /** + * A `view-transition-class` to apply to each subject's resolved elements, + * so authors can target the generated layers from CSS by class rather than + * the opaque generated name. + */ + this.classNames = new Map(); + /** + * Subjects opted out of automatic group nesting via `.group(false)`. Their + * layer stays a flat top-level group (`view-transition-group: none`) instead + * of nesting under its DOM-ancestor layer - so it animates independently and + * escapes an ancestor's clip/transform (e.g. an element that lifts out of a + * card and flies across, which nesting would clip to the card). + */ + this.flatGroups = new Set(); + this.notifyReady = motionUtils.noop; + this.notifyReject = motionUtils.noop; + this.readyPromise = new Promise((resolve, reject) => { + this.notifyReady = resolve; + this.notifyReject = reject; + }); + this.update = update; + this.options = { + interrupt: "wait", + ...options, + }; + // Avoid an unhandled rejection when a failed transition has no + // `.then(_, reject)` handler attached (e.g. fire-and-forget). + this.readyPromise.catch(motionUtils.noop); + addToQueue(this); + } + /** + * Target elements resolved from a selector or Element, each assigned a + * `view-transition-name` automatically. + * + * Passing a second target pairs them: the first is resolved in the old + * snapshot and the second in the new, sharing one name so two *different* + * elements morph into each other (e.g. `.add(card, ".modal")`). Symmetric - + * pass them the other way round to morph back. + */ + add(subject, newSubject) { + this.currentSubject = subject; + this.resolveDefs.add(subject); + if (newSubject !== undefined) + this.pairs.set(subject, newSubject); + // Register the subject so it participates (and gets an automatic + // layout/morph animation) even without an explicit enter/exit/layout. + if (!this.targets.has(subject)) + this.targets.set(subject, {}); + return this; + } + /** + * Control this subject's crop (clip + `object-fit: cover` + animated + * corners). By default a subject auto-crops only when it actually morphs - + * present in both snapshots (a survivor, or an `.add(a, b)` pair). A + * fade-only enter/exit has no second box to crop against, so it's left to + * the browser default; in particular the `overflow: clip` a crop adds would + * otherwise clip a mis-sized enter/exit layer to nothing. + * + * `.crop(false)` forces the crop off (e.g. a text morph, where + * `object-fit: cover` clips glyphs as the box grows); `.crop(true)` forces + * it on for a non-morph the default wouldn't otherwise crop. + */ + crop(enabled = true) { + this.cropOverride.set(this.currentSubject, enabled); + return this; + } + /** + * By default a subject's layer nests under its nearest DOM-ancestor layer + * (`view-transition-group: contain`), so the ancestor's clip/transform/opacity + * apply to it through the transition - mirroring how the DOM actually paints, + * and letting a wrapper crop its child for the whole morph rather than only + * once the live DOM takes back over. (Needs a browser that supports nested + * view-transition groups; elsewhere it degrades to the flat default.) + * + * Call `.group(false)` to opt out: the layer stays flat and top-level, so it + * animates independently and escapes an ancestor's clip - e.g. an element + * that should lift out of a card and fly across, which nesting would clip. + */ + group(enabled = true) { + enabled + ? this.flatGroups.delete(this.currentSubject) + : this.flatGroups.add(this.currentSubject); + return this; + } + /** + * Tag this subject's generated layers with a `view-transition-class`, so + * they can be targeted from CSS - `::view-transition-group(.name)`, + * `::view-transition-old/new(.name)`, `::view-transition-image-pair(.name)` + * - without the opaque generated `view-transition-name`. Because `.add()` + * can match many elements, a shared class targets them all at once (and, + * for a pair, both ends). The escape hatch for z-index / custom keyframes + * on a morph layer. + */ + class(name) { + this.classNames.set(this.currentSubject, name); + return this; + } + /** + * Set the transition for this subject's morph. The morph is enabled + * automatically by `.add()`; this just customises its timing (duration, + * easing, a `delay`/`stagger`, …). On the implicit `root` subject it also + * opts the page into the transition (the root crossfade). + */ + layout(options = {}) { + this.updateTarget("layout", {}, options); + return this; + } + enter(keyframes, options) { + this.updateTarget("enter", keyframes, options); + return this; + } + exit(keyframes, options) { + this.updateTarget("exit", keyframes, options); + return this; + } + /** + * Animate the new view directly, whether the element is appearing or + * persisting (unlike `.enter()`, which only fires for a pure newcomer). + * Pair with `.old()` for a crossfade or slide-through. + */ + new(keyframes, options) { + this.updateTarget("new", keyframes, options); + return this; + } + /** + * Animate the old view directly, whether the element is leaving or + * persisting (unlike `.exit()`, which only fires for a pure leaver). + */ + old(keyframes, options) { + this.updateTarget("old", keyframes, options); + return this; + } + updateTarget(target, keyframes, options = {}) { + const { currentSubject, targets } = this; + if (!targets.has(currentSubject)) { + targets.set(currentSubject, {}); + } + const targetData = targets.get(currentSubject); + targetData[target] = { keyframes, options }; + } + then(resolve, reject) { + return this.readyPromise.then(resolve, reject); + } + } + function animateView(update, options = {}) { + return new ViewTransitionBuilder(update, options); + } + + const createAxisDelta = () => ({ + translate: 0, + scale: 1, + origin: 0, + originPoint: 0, + }); + const createDelta = () => ({ + x: createAxisDelta(), + y: createAxisDelta(), + }); + const createAxis = () => ({ min: 0, max: 0 }); + const createBox = () => ({ + x: createAxis(), + y: createAxis(), + }); + + const visualElementStore = new WeakMap(); + + function isAnimationControls(v) { + return (v !== null && + typeof v === "object" && + typeof v.start === "function"); + } + + /** + * Decides if the supplied variable is variant label + */ + function isVariantLabel(v) { + return typeof v === "string" || Array.isArray(v); + } + + const variantPriorityOrder = [ + "animate", + "whileInView", + "whileFocus", + "whileHover", + "whileTap", + "whileDrag", + "exit", + ]; + const variantProps = ["initial", ...variantPriorityOrder]; + + function isControllingVariants(props) { + return (isAnimationControls(props.animate) || + variantProps.some((name) => isVariantLabel(props[name]))); + } + function isVariantNode(props) { + return Boolean(isControllingVariants(props) || props.variants); + } + + /** + * Updates motion values from props changes. + * Uses `any` type for element to avoid circular dependencies with VisualElement. + */ + function updateMotionValuesFromProps(element, next, prev) { + for (const key in next) { + const nextValue = next[key]; + const prevValue = prev[key]; + if (isMotionValue(nextValue)) { + /** + * If this is a motion value found in props or style, we want to add it + * to our visual element's motion value map. + */ + element.addValue(key, nextValue); + } + else if (isMotionValue(prevValue)) { + /** + * If we're swapping from a motion value to a static value, + * create a new motion value from that + */ + element.addValue(key, motionValue(nextValue, { owner: element })); + } + else if (prevValue !== nextValue) { + /** + * If this is a flat value that has changed, update the motion value + * or create one if it doesn't exist. We only want to do this if we're + * not handling the value with our animation state. + */ + if (element.hasValue(key)) { + const existingValue = element.getValue(key); + if (existingValue.liveStyle === true) { + existingValue.jump(nextValue); + } + else if (!existingValue.hasAnimated) { + existingValue.set(nextValue); + } + } + else { + const latestValue = element.getStaticValue(key); + element.addValue(key, motionValue(latestValue !== undefined ? latestValue : nextValue, { owner: element })); + } + } + } + // Handle removed values + for (const key in prev) { + if (next[key] === undefined) + element.removeValue(key); + } + return next; + } + + // Does this device prefer reduced motion? Returns `null` server-side. + const prefersReducedMotion = { current: null }; + const hasReducedMotionListener = { current: false }; + + const isBrowser = typeof window !== "undefined"; + function initPrefersReducedMotion() { + hasReducedMotionListener.current = true; + if (!isBrowser) + return; + if (window.matchMedia) { + const motionMediaQuery = window.matchMedia("(prefers-reduced-motion)"); + const setReducedMotionPreferences = () => (prefersReducedMotion.current = motionMediaQuery.matches); + motionMediaQuery.addEventListener("change", setReducedMotionPreferences); + setReducedMotionPreferences(); + } + else { + prefersReducedMotion.current = false; + } + } + + const propEventHandlers = [ + "AnimationStart", + "AnimationComplete", + "Update", + "BeforeLayoutMeasure", + "LayoutMeasure", + "LayoutAnimationStart", + "LayoutAnimationComplete", + ]; + /** + * Static feature definitions - can be injected by framework layer + */ + let featureDefinitions = {}; + /** + * Set feature definitions for all VisualElements. + * This should be called by the framework layer (e.g., framer-motion) during initialization. + */ + function setFeatureDefinitions(definitions) { + featureDefinitions = definitions; + } + /** + * Get the current feature definitions + */ + function getFeatureDefinitions() { + return featureDefinitions; + } + /** + * A VisualElement is an imperative abstraction around UI elements such as + * HTMLElement, SVGElement, Three.Object3D etc. + */ + class VisualElement { + /** + * This method takes React props and returns found MotionValues. For example, HTML + * MotionValues will be found within the style prop, whereas for Three.js within attribute arrays. + * + * This isn't an abstract method as it needs calling in the constructor, but it is + * intended to be one. + */ + scrapeMotionValuesFromProps(_props, _prevProps, _visualElement) { + return {}; + } + constructor({ parent, props, presenceContext, reducedMotionConfig, skipAnimations, blockInitialAnimation, visualState, }, options = {}) { + /** + * A reference to the current underlying Instance, e.g. a HTMLElement + * or Three.Mesh etc. + */ + this.current = null; + /** + * A set containing references to this VisualElement's children. + */ + this.children = new Set(); + /** + * Determine what role this visual element should take in the variant tree. + */ + this.isVariantNode = false; + this.isControllingVariants = false; + /** + * Decides whether this VisualElement should animate in reduced motion + * mode. + * + * TODO: This is currently set on every individual VisualElement but feels + * like it could be set globally. + */ + this.shouldReduceMotion = null; + /** + * Decides whether animations should be skipped for this VisualElement. + * Useful for E2E tests and visual regression testing. + */ + this.shouldSkipAnimations = false; + /** + * A map of all motion values attached to this visual element. Motion + * values are source of truth for any given animated value. A motion + * value might be provided externally by the component via props. + */ + this.values = new Map(); + this.KeyframeResolver = KeyframeResolver; + /** + * Cleanup functions for active features (hover/tap/exit etc) + */ + this.features = {}; + /** + * A map of every subscription that binds the provided or generated + * motion values onChange listeners to this visual element. + */ + this.valueSubscriptions = new Map(); + /** + * A reference to the previously-provided motion values as returned + * from scrapeMotionValuesFromProps. We use the keys in here to determine + * if any motion values need to be removed after props are updated. + */ + this.prevMotionValues = {}; + /** + * Track whether this element has been mounted before, to detect + * remounts after Suspense unmount/remount cycles. + */ + this.hasBeenMounted = false; + /** + * An object containing a SubscriptionManager for each active event. + */ + this.events = {}; + /** + * An object containing an unsubscribe function for each prop event subscription. + * For example, every "Update" event can have multiple subscribers via + * VisualElement.on(), but only one of those can be defined via the onUpdate prop. + */ + this.propEventSubscriptions = {}; + this.notifyUpdate = () => this.notify("Update", this.latestValues); + this.render = () => { + if (!this.current) + return; + this.triggerBuild(); + this.renderInstance(this.current, this.renderState, this.props.style, this.projection); + }; + this.renderScheduledAt = 0.0; + this.scheduleRender = () => { + const now = time.now(); + if (this.renderScheduledAt < now) { + this.renderScheduledAt = now; + frame.render(this.render, false, true); + } + }; + const { latestValues, renderState } = visualState; + this.latestValues = latestValues; + this.baseTarget = { ...latestValues }; + this.initialValues = props.initial ? { ...latestValues } : {}; + this.renderState = renderState; + this.parent = parent; + this.props = props; + this.presenceContext = presenceContext; + this.depth = parent ? parent.depth + 1 : 0; + this.reducedMotionConfig = reducedMotionConfig; + this.skipAnimationsConfig = skipAnimations; + this.options = options; + this.blockInitialAnimation = Boolean(blockInitialAnimation); + this.isControllingVariants = isControllingVariants(props); + this.isVariantNode = isVariantNode(props); + if (this.isVariantNode) { + this.variantChildren = new Set(); + } + this.manuallyAnimateOnMount = Boolean(parent && parent.current); + /** + * Any motion values that are provided to the element when created + * aren't yet bound to the element, as this would technically be impure. + * However, we iterate through the motion values and set them to the + * initial values for this component. + * + * TODO: This is impure and we should look at changing this to run on mount. + * Doing so will break some tests but this isn't necessarily a breaking change, + * more a reflection of the test. + */ + const { willChange, ...initialMotionValues } = this.scrapeMotionValuesFromProps(props, {}, this); + for (const key in initialMotionValues) { + const value = initialMotionValues[key]; + if (latestValues[key] !== undefined && isMotionValue(value)) { + value.set(latestValues[key]); + } + } + } + mount(instance) { + /** + * If this element has been mounted before (e.g. after a Suspense + * unmount/remount), reset motion values to their initial state + * so animations replay correctly from initial → animate. + */ + if (this.hasBeenMounted) { + for (const key in this.initialValues) { + this.values.get(key)?.jump(this.initialValues[key]); + this.latestValues[key] = this.initialValues[key]; + } + } + this.current = instance; + visualElementStore.set(instance, this); + if (this.projection && !this.projection.instance) { + this.projection.mount(instance); + } + if (this.parent && this.isVariantNode && !this.isControllingVariants) { + this.removeFromVariantTree = this.parent.addVariantChild(this); + } + this.values.forEach((value, key) => this.bindToMotionValue(key, value)); + /** + * Determine reduced motion preference. Only initialize the matchMedia + * listener if we actually need the dynamic value (i.e., when config + * is neither "never" nor "always"). + */ + if (this.reducedMotionConfig === "never") { + this.shouldReduceMotion = false; + } + else if (this.reducedMotionConfig === "always") { + this.shouldReduceMotion = true; + } + else { + if (!hasReducedMotionListener.current) { + initPrefersReducedMotion(); + } + this.shouldReduceMotion = prefersReducedMotion.current; + } + { + motionUtils.warnOnce(this.shouldReduceMotion !== true, "You have Reduced Motion enabled on your device. Animations may not appear as expected.", "reduced-motion-disabled"); + } + /** + * Set whether animations should be skipped based on the config. + */ + this.shouldSkipAnimations = this.skipAnimationsConfig ?? false; + this.parent?.addChild(this); + this.update(this.props, this.presenceContext); + this.hasBeenMounted = true; + } + unmount() { + this.projection && this.projection.unmount(); + cancelFrame(this.notifyUpdate); + cancelFrame(this.render); + this.valueSubscriptions.forEach((remove) => remove()); + this.valueSubscriptions.clear(); + this.removeFromVariantTree && this.removeFromVariantTree(); + this.parent?.removeChild(this); + for (const key in this.events) { + this.events[key].clear(); + } + for (const key in this.features) { + const feature = this.features[key]; + if (feature) { + feature.unmount(); + feature.isMounted = false; + } + } + this.current = null; + } + addChild(child) { + this.children.add(child); + this.enteringChildren ?? (this.enteringChildren = new Set()); + this.enteringChildren.add(child); + } + removeChild(child) { + this.children.delete(child); + this.enteringChildren && this.enteringChildren.delete(child); + } + bindToMotionValue(key, value) { + if (this.valueSubscriptions.has(key)) { + this.valueSubscriptions.get(key)(); + } + if (value.accelerate && + acceleratedValues.has(key) && + this.current instanceof HTMLElement) { + const { factory, keyframes, times, ease, duration } = value.accelerate; + const animation = new NativeAnimation({ + element: this.current, + name: key, + keyframes, + times, + ease, + duration: motionUtils.secondsToMilliseconds(duration), + }); + const cleanup = factory(animation); + this.valueSubscriptions.set(key, () => { + cleanup(); + animation.cancel(); + }); + return; + } + const valueIsTransform = transformProps.has(key); + if (valueIsTransform && this.onBindTransform) { + this.onBindTransform(); + } + const removeOnChange = value.on("change", (latestValue) => { + this.latestValues[key] = latestValue; + this.props.onUpdate && frame.preRender(this.notifyUpdate); + if (valueIsTransform && this.projection) { + this.projection.isTransformDirty = true; + } + this.scheduleRender(); + }); + let removeSyncCheck; + if (typeof window !== "undefined" && + window.MotionCheckAppearSync) { + removeSyncCheck = window.MotionCheckAppearSync(this, key, value); + } + this.valueSubscriptions.set(key, () => { + removeOnChange(); + if (removeSyncCheck) + removeSyncCheck(); + // Defer to MotionValue.on("change") auto-stop so React 19 remounts + // can resubscribe before the animation is cancelled (#3315). + }); + } + sortNodePosition(other) { + /** + * If these nodes aren't even of the same type we can't compare their depth. + */ + if (!this.current || + !this.sortInstanceNodePosition || + this.type !== other.type) { + return 0; + } + return this.sortInstanceNodePosition(this.current, other.current); + } + updateFeatures() { + let key = "animation"; + for (key in featureDefinitions) { + const featureDefinition = featureDefinitions[key]; + if (!featureDefinition) + continue; + const { isEnabled, Feature: FeatureConstructor } = featureDefinition; + /** + * If this feature is enabled but not active, make a new instance. + */ + if (!this.features[key] && + FeatureConstructor && + isEnabled(this.props)) { + this.features[key] = new FeatureConstructor(this); + } + /** + * If we have a feature, mount or update it. + */ + if (this.features[key]) { + const feature = this.features[key]; + if (feature.isMounted) { + feature.update(); + } + else { + feature.mount(); + feature.isMounted = true; + } + } + } + } + triggerBuild() { + this.build(this.renderState, this.latestValues, this.props); + } + /** + * Measure the current viewport box with or without transforms. + * Only measures axis-aligned boxes, rotate and skew must be manually + * removed with a re-render to work. + */ + measureViewportBox() { + return this.current + ? this.measureInstanceViewportBox(this.current, this.props) + : createBox(); + } + getStaticValue(key) { + return this.latestValues[key]; + } + setStaticValue(key, value) { + this.latestValues[key] = value; + } + /** + * Update the provided props. Ensure any newly-added motion values are + * added to our map, old ones removed, and listeners updated. + */ + update(props, presenceContext) { + if (props.transformTemplate || this.props.transformTemplate) { + this.scheduleRender(); + } + this.prevProps = this.props; + this.props = props; + this.prevPresenceContext = this.presenceContext; + this.presenceContext = presenceContext; + /** + * Update prop event handlers ie onAnimationStart, onAnimationComplete + */ + for (let i = 0; i < propEventHandlers.length; i++) { + const key = propEventHandlers[i]; + if (this.propEventSubscriptions[key]) { + this.propEventSubscriptions[key](); + delete this.propEventSubscriptions[key]; + } + const listenerName = ("on" + key); + const listener = props[listenerName]; + if (listener) { + this.propEventSubscriptions[key] = this.on(key, listener); + } + } + this.prevMotionValues = updateMotionValuesFromProps(this, this.scrapeMotionValuesFromProps(props, this.prevProps || {}, this), this.prevMotionValues); + if (this.handleChildMotionValue) { + this.handleChildMotionValue(); + } + } + getProps() { + return this.props; + } + /** + * Returns the variant definition with a given name. + */ + getVariant(name) { + return this.props.variants ? this.props.variants[name] : undefined; + } + /** + * Returns the defined default transition on this component. + */ + getDefaultTransition() { + return this.props.transition; + } + getTransformPagePoint() { + return this.props.transformPagePoint; + } + getClosestVariantNode() { + return this.isVariantNode + ? this + : this.parent + ? this.parent.getClosestVariantNode() + : undefined; + } + /** + * Add a child visual element to our set of children. + */ + addVariantChild(child) { + const closestVariantNode = this.getClosestVariantNode(); + if (closestVariantNode) { + closestVariantNode.variantChildren && + closestVariantNode.variantChildren.add(child); + return () => closestVariantNode.variantChildren.delete(child); + } + } + /** + * Add a motion value and bind it to this visual element. + */ + addValue(key, value) { + // Remove existing value if it exists + const existingValue = this.values.get(key); + if (value !== existingValue) { + if (existingValue) + this.removeValue(key); + this.bindToMotionValue(key, value); + this.values.set(key, value); + this.latestValues[key] = value.get(); + } + } + /** + * Remove a motion value and unbind any active subscriptions. + */ + removeValue(key) { + this.values.delete(key); + const unsubscribe = this.valueSubscriptions.get(key); + if (unsubscribe) { + unsubscribe(); + this.valueSubscriptions.delete(key); + } + delete this.latestValues[key]; + this.removeValueFromRenderState(key, this.renderState); + } + /** + * Check whether we have a motion value for this key + */ + hasValue(key) { + return this.values.has(key); + } + getValue(key, defaultValue) { + if (this.props.values && this.props.values[key]) { + return this.props.values[key]; + } + let value = this.values.get(key); + if (value === undefined && defaultValue !== undefined) { + value = motionValue(defaultValue === null ? undefined : defaultValue, { owner: this }); + this.addValue(key, value); + } + return value; + } + /** + * If we're trying to animate to a previously unencountered value, + * we need to check for it in our state and as a last resort read it + * directly from the instance (which might have performance implications). + */ + readValue(key, target) { + let value = this.latestValues[key] !== undefined || !this.current + ? this.latestValues[key] + : this.getBaseTargetFromProps(this.props, key) ?? + this.readValueFromInstance(this.current, key, this.options); + if (value !== undefined && value !== null) { + if (typeof value === "string" && + (motionUtils.isNumericalString(value) || motionUtils.isZeroValueString(value))) { + // If this is a number read as a string, ie "0" or "200", convert it to a number + value = parseFloat(value); + } + else if (!findValueType(value) && complex.test(target)) { + value = getAnimatableNone(key, target); + } + this.setBaseTarget(key, isMotionValue(value) ? value.get() : value); + } + return isMotionValue(value) ? value.get() : value; + } + /** + * Set the base target to later animate back to. This is currently + * only hydrated on creation and when we first read a value. + */ + setBaseTarget(key, value) { + this.baseTarget[key] = value; + } + /** + * Find the base target for a value thats been removed from all animation + * props. + */ + getBaseTarget(key) { + const { initial } = this.props; + let valueFromInitial; + if (typeof initial === "string" || typeof initial === "object") { + const variant = resolveVariantFromProps(this.props, initial, this.presenceContext?.custom); + if (variant) { + valueFromInitial = variant[key]; + } + } + /** + * If this value still exists in the current initial variant, read that. + */ + if (initial && valueFromInitial !== undefined) { + return valueFromInitial; + } + /** + * Alternatively, if this VisualElement config has defined a getBaseTarget + * so we can read the value from an alternative source, try that. + */ + const target = this.getBaseTargetFromProps(this.props, key); + if (target !== undefined && !isMotionValue(target)) + return target; + /** + * If the value was initially defined on initial, but it doesn't any more, + * return undefined. Otherwise return the value as initially read from the DOM. + */ + return this.initialValues[key] !== undefined && + valueFromInitial === undefined + ? undefined + : this.baseTarget[key]; + } + on(eventName, callback) { + if (!this.events[eventName]) { + this.events[eventName] = new motionUtils.SubscriptionManager(); + } + return this.events[eventName].add(callback); + } + notify(eventName, ...args) { + if (this.events[eventName]) { + this.events[eventName].notify(...args); + } + } + scheduleRenderMicrotask() { + microtask.render(this.render); + } + } + + class DOMVisualElement extends VisualElement { + constructor() { + super(...arguments); + this.KeyframeResolver = DOMKeyframesResolver; + } + sortInstanceNodePosition(a, b) { + /** + * compareDocumentPosition returns a bitmask, by using the bitwise & + * we're returning true if 2 in that bitmask is set to true. 2 is set + * to true if b preceeds a. + */ + return a.compareDocumentPosition(b) & 2 ? 1 : -1; + } + getBaseTargetFromProps(props, key) { + const style = props.style; + return style ? style[key] : undefined; + } + removeValueFromRenderState(key, { vars, style }) { + delete vars[key]; + delete style[key]; + } + handleChildMotionValue() { + if (this.childSubscription) { + this.childSubscription(); + delete this.childSubscription; + } + const { children } = this.props; + if (isMotionValue(children)) { + this.childSubscription = children.on("change", (latest) => { + if (this.current) { + this.current.textContent = `${latest}`; + } + }); + } + } + } + + /** + * Feature base class for extending VisualElement functionality. + * Features are plugins that can be mounted/unmounted to add behavior + * like gestures, animations, or layout tracking. + */ + class Feature { + constructor(node) { + this.isMounted = false; + this.node = node; + } + update() { } + } + + /** + * Bounding boxes tend to be defined as top, left, right, bottom. For various operations + * it's easier to consider each axis individually. This function returns a bounding box + * as a map of single-axis min/max values. + */ + function convertBoundingBoxToBox({ top, left, right, bottom, }) { + return { + x: { min: left, max: right }, + y: { min: top, max: bottom }, + }; + } + function convertBoxToBoundingBox({ x, y }) { + return { top: y.min, right: x.max, bottom: y.max, left: x.min }; + } + /** + * Applies a TransformPoint function to a bounding box. TransformPoint is usually a function + * provided by Framer to allow measured points to be corrected for device scaling. This is used + * when measuring DOM elements and DOM event points. + */ + function transformBoxPoints(point, transformPoint) { + if (!transformPoint) + return point; + const topLeft = transformPoint({ x: point.left, y: point.top }); + const bottomRight = transformPoint({ x: point.right, y: point.bottom }); + return { + top: topLeft.y, + left: topLeft.x, + bottom: bottomRight.y, + right: bottomRight.x, + }; + } + + function isIdentityScale(scale) { + return scale === undefined || scale === 1; + } + function hasScale({ scale, scaleX, scaleY }) { + return (!isIdentityScale(scale) || + !isIdentityScale(scaleX) || + !isIdentityScale(scaleY)); + } + function hasTransform(values) { + return (hasScale(values) || + has2DTranslate(values) || + values.z || + values.rotate || + values.rotateX || + values.rotateY || + values.skewX || + values.skewY); + } + function has2DTranslate(values) { + return is2DTranslate(values.x) || is2DTranslate(values.y); + } + function is2DTranslate(value) { + return value && value !== "0%"; + } + + /** + * Scales a point based on a factor and an originPoint + */ + function scalePoint(point, scale, originPoint) { + const distanceFromOrigin = point - originPoint; + const scaled = scale * distanceFromOrigin; + return originPoint + scaled; + } + /** + * Applies a translate/scale delta to a point + */ + function applyPointDelta(point, translate, scale, originPoint, boxScale) { + if (boxScale !== undefined) { + point = scalePoint(point, boxScale, originPoint); + } + return scalePoint(point, scale, originPoint) + translate; + } + /** + * Applies a translate/scale delta to an axis + */ + function applyAxisDelta(axis, translate = 0, scale = 1, originPoint, boxScale) { + axis.min = applyPointDelta(axis.min, translate, scale, originPoint, boxScale); + axis.max = applyPointDelta(axis.max, translate, scale, originPoint, boxScale); + } + /** + * Applies a translate/scale delta to a box + */ + function applyBoxDelta(box, { x, y }) { + applyAxisDelta(box.x, x.translate, x.scale, x.originPoint); + applyAxisDelta(box.y, y.translate, y.scale, y.originPoint); + } + const TREE_SCALE_SNAP_MIN = 0.999999999999; + const TREE_SCALE_SNAP_MAX = 1.0000000000001; + /** + * Apply a tree of deltas to a box. We do this to calculate the effect of all the transforms + * in a tree upon our box before then calculating how to project it into our desired viewport-relative box + * + * This is the final nested loop within updateLayoutDelta for future refactoring + */ + function applyTreeDeltas(box, treeScale, treePath, isSharedTransition = false) { + const treeLength = treePath.length; + if (!treeLength) + return; + // Reset the treeScale + treeScale.x = treeScale.y = 1; + let node; + let delta; + for (let i = 0; i < treeLength; i++) { + node = treePath[i]; + delta = node.projectionDelta; + /** + * TODO: Prefer to remove this, but currently we have motion components with + * display: contents in Framer. + */ + const { visualElement } = node.options; + if (visualElement && + visualElement.props.style && + visualElement.props.style.display === "contents") { + continue; + } + if (isSharedTransition && + node.options.layoutScroll && + node.scroll && + node !== node.root) { + translateAxis(box.x, -node.scroll.offset.x); + translateAxis(box.y, -node.scroll.offset.y); + } + if (delta) { + // Incoporate each ancestor's scale into a cumulative treeScale for this component + treeScale.x *= delta.x.scale; + treeScale.y *= delta.y.scale; + // Apply each ancestor's calculated delta into this component's recorded layout box + applyBoxDelta(box, delta); + } + if (isSharedTransition && hasTransform(node.latestValues)) { + transformBox(box, node.latestValues, node.layout?.layoutBox); + } + } + /** + * Snap tree scale back to 1 if it's within a non-perceivable threshold. + * This will help reduce useless scales getting rendered. + */ + if (treeScale.x < TREE_SCALE_SNAP_MAX && + treeScale.x > TREE_SCALE_SNAP_MIN) { + treeScale.x = 1.0; + } + if (treeScale.y < TREE_SCALE_SNAP_MAX && + treeScale.y > TREE_SCALE_SNAP_MIN) { + treeScale.y = 1.0; + } + } + function translateAxis(axis, distance) { + axis.min += distance; + axis.max += distance; + } + /** + * Apply a transform to an axis from the latest resolved motion values. + * This function basically acts as a bridge between a flat motion value map + * and applyAxisDelta + */ + function transformAxis(axis, axisTranslate, axisScale, boxScale, axisOrigin = 0.5) { + const originPoint = mixNumber$1(axis.min, axis.max, axisOrigin); + // Apply the axis delta to the final axis + applyAxisDelta(axis, axisTranslate, axisScale, originPoint, boxScale); + } + function resolveAxisTranslate(value, axis) { + if (typeof value === "string") { + return (parseFloat(value) / 100) * (axis.max - axis.min); + } + return value; + } + /** + * Apply a transform to a box from the latest resolved motion values. + */ + function transformBox(box, transform, sourceBox) { + const resolveBox = sourceBox ?? box; + transformAxis(box.x, resolveAxisTranslate(transform.x, resolveBox.x), transform.scaleX, transform.scale, transform.originX); + transformAxis(box.y, resolveAxisTranslate(transform.y, resolveBox.y), transform.scaleY, transform.scale, transform.originY); + } + + function measureViewportBox(instance, transformPoint) { + return convertBoundingBoxToBox(transformBoxPoints(instance.getBoundingClientRect(), transformPoint)); + } + function measurePageBox(element, rootProjectionNode, transformPagePoint) { + const viewportBox = measureViewportBox(element, transformPagePoint); + const { scroll } = rootProjectionNode; + if (scroll) { + translateAxis(viewportBox.x, scroll.offset.x); + translateAxis(viewportBox.y, scroll.offset.y); + } + return viewportBox; + } + + const translateAlias = { + x: "translateX", + y: "translateY", + z: "translateZ", + transformPerspective: "perspective", + }; + const numTransforms = transformPropOrder.length; + /** + * Build a CSS transform style from individual x/y/scale etc properties. + * + * This outputs with a default order of transforms/scales/rotations, this can be customised by + * providing a transformTemplate function. + */ + function buildTransform(latestValues, transform, transformTemplate) { + // The transform string we're going to build into. + let transformString = ""; + let transformIsDefault = true; + /** + * Loop over all possible transforms in order, adding the ones that + * are present to the transform string. + */ + for (let i = 0; i < numTransforms; i++) { + const key = transformPropOrder[i]; + const value = latestValues[key]; + if (value === undefined) + continue; + let valueIsDefault = true; + if (typeof value === "number") { + valueIsDefault = value === (key.startsWith("scale") ? 1 : 0); + } + else { + const parsed = parseFloat(value); + valueIsDefault = key.startsWith("scale") ? parsed === 1 : parsed === 0; + } + if (!valueIsDefault || transformTemplate) { + const valueAsType = getValueAsType(value, numberValueTypes[key]); + if (!valueIsDefault) { + transformIsDefault = false; + const transformName = translateAlias[key] || key; + transformString += `${transformName}(${valueAsType}) `; + } + if (transformTemplate) { + transform[key] = valueAsType; + } + } + } + // `pathRotation` composes onto `rotate` as a separate additive term so + // the user's `rotate` is never clobbered. Deliberately not a slot in + // `transformPropOrder`. + const pathRotation = latestValues.pathRotation; + if (pathRotation) { + transformIsDefault = false; + transformString += `rotate(${getValueAsType(pathRotation, numberValueTypes.pathRotation)}) `; + } + transformString = transformString.trim(); + // If we have a custom `transform` template, pass our transform values and + // generated transformString to that before returning + if (transformTemplate) { + transformString = transformTemplate(transform, transformIsDefault ? "" : transformString); + } + else if (transformIsDefault) { + transformString = "none"; + } + return transformString; + } + + function buildHTMLStyles(state, latestValues, transformTemplate) { + const { style, vars, transformOrigin } = state; + // Track whether we encounter any transform or transformOrigin values. + let hasTransform = false; + let hasTransformOrigin = false; + /** + * Loop over all our latest animated values and decide whether to handle them + * as a style or CSS variable. + * + * Transforms and transform origins are kept separately for further processing. + */ + for (const key in latestValues) { + const value = latestValues[key]; + if (transformProps.has(key)) { + // If this is a transform, flag to enable further transform processing + hasTransform = true; + continue; + } + else if (isCSSVariableName(key)) { + vars[key] = value; + continue; + } + else { + // Convert the value to its default value type, ie 0 -> "0px" + const valueAsType = getValueAsType(value, numberValueTypes[key]); + if (key.startsWith("origin")) { + // If this is a transform origin, flag and enable further transform-origin processing + hasTransformOrigin = true; + transformOrigin[key] = + valueAsType; + } + else { + style[key] = valueAsType; + } + } + } + if (!latestValues.transform) { + if (hasTransform || transformTemplate) { + style.transform = buildTransform(latestValues, state.transform, transformTemplate); + } + else if (style.transform) { + /** + * If we have previously created a transform but currently don't have any, + * reset transform style to none. + */ + style.transform = "none"; + } + } + /** + * Build a transformOrigin style. Uses the same defaults as the browser for + * undefined origins. + */ + if (hasTransformOrigin) { + const { originX = "50%", originY = "50%", originZ = 0, } = transformOrigin; + style.transformOrigin = `${originX} ${originY} ${originZ}`; + } + } + + function renderHTML(element, { style, vars }, styleProp, projection) { + const elementStyle = element.style; + let key; + for (key in style) { + // CSSStyleDeclaration has [index: number]: string; in the types, so we use that as key type. + elementStyle[key] = style[key]; + } + // Write projection styles directly to element style + projection?.applyProjectionStyles(elementStyle, styleProp); + for (key in vars) { + // Loop over any CSS variables and assign those. + // They can only be assigned using `setProperty`. + elementStyle.setProperty(key, vars[key]); + } + } + + function pixelsToPercent(pixels, axis) { + if (axis.max === axis.min) + return 0; + return (pixels / (axis.max - axis.min)) * 100; + } + /** + * We always correct borderRadius as a percentage rather than pixels to reduce paints. + * For example, if you are projecting a box that is 100px wide with a 10px borderRadius + * into a box that is 200px wide with a 20px borderRadius, that is actually a 10% + * borderRadius in both states. If we animate between the two in pixels that will trigger + * a paint each time. If we animate between the two in percentage we'll avoid a paint. + */ + const correctBorderRadius = { + correct: (latest, node) => { + if (!node.target) + return latest; + /** + * If latest is a string, if it's a percentage we can return immediately as it's + * going to be stretched appropriately. Otherwise, if it's a pixel, convert it to a number. + */ + if (typeof latest === "string") { + if (px.test(latest)) { + latest = parseFloat(latest); + } + else { + return latest; + } + } + /** + * If latest is a number, it's a pixel value. We use the current viewportBox to calculate that + * pixel value as a percentage of each axis + */ + const x = pixelsToPercent(latest, node.target.x); + const y = pixelsToPercent(latest, node.target.y); + return `${x}% ${y}%`; + }, + }; + + const correctBoxShadow = { + correct: (latest, { treeScale, projectionDelta }) => { + const original = latest; + const shadow = complex.parse(latest); + // TODO: Doesn't support multiple shadows + if (shadow.length > 5) + return original; + const template = complex.createTransformer(latest); + const offset = typeof shadow[0] !== "number" ? 1 : 0; + // Calculate the overall context scale + const xScale = projectionDelta.x.scale * treeScale.x; + const yScale = projectionDelta.y.scale * treeScale.y; + shadow[0 + offset] /= xScale; + shadow[1 + offset] /= yScale; + /** + * Ideally we'd correct x and y scales individually, but because blur and + * spread apply to both we have to take a scale average and apply that instead. + * We could potentially improve the outcome of this by incorporating the ratio between + * the two scales. + */ + const averageScale = mixNumber$1(xScale, yScale, 0.5); + // Blur + if (typeof shadow[2 + offset] === "number") + shadow[2 + offset] /= averageScale; + // Spread + if (typeof shadow[3 + offset] === "number") + shadow[3 + offset] /= averageScale; + return template(shadow); + }, + }; + + const scaleCorrectors = { + borderRadius: { + ...correctBorderRadius, + applyTo: [...cornerRadiusProps], + }, + borderTopLeftRadius: correctBorderRadius, + borderTopRightRadius: correctBorderRadius, + borderBottomLeftRadius: correctBorderRadius, + borderBottomRightRadius: correctBorderRadius, + boxShadow: correctBoxShadow, + }; + function addScaleCorrector(correctors) { + for (const key in correctors) { + scaleCorrectors[key] = correctors[key]; + if (isCSSVariableName(key)) { + scaleCorrectors[key].isCSSVariable = true; + } + } + } + + function isForcedMotionValue(key, { layout, layoutId }) { + return (transformProps.has(key) || + key.startsWith("origin") || + ((layout || layoutId !== undefined) && + (!!scaleCorrectors[key] || key === "opacity"))); + } + + function scrapeMotionValuesFromProps$1(props, prevProps, visualElement) { + const style = props.style; + const prevStyle = prevProps?.style; + const newValues = {}; + if (!style) + return newValues; + for (const key in style) { + if (isMotionValue(style[key]) || + (prevStyle && isMotionValue(prevStyle[key])) || + isForcedMotionValue(key, props) || + visualElement?.getValue(key)?.liveStyle !== undefined) { + newValues[key] = style[key]; + } + } + return newValues; + } + + function getComputedStyle$1(element) { + return window.getComputedStyle(element); + } + class HTMLVisualElement extends DOMVisualElement { + constructor() { + super(...arguments); + this.type = "html"; + this.renderInstance = renderHTML; + } + mount(instance) { + /** + * If a custom component forwards its ref to something other than a + * HTML/SVG element (a class instance, an imperative handle) there's + * nothing for Motion to style, measure or attach gestures to. #2777 + */ + motionUtils.invariant(Boolean(instance.style), "motion.create() components must forward their ref to a HTML or SVG element", "custom-component-ref"); + super.mount(instance); + } + readValueFromInstance(instance, key) { + if (transformProps.has(key)) { + return this.projection?.isProjecting + ? defaultTransformValue(key) + : readTransformValue(instance, key); + } + else { + const computedStyle = getComputedStyle$1(instance); + const value = (isCSSVariableName(key) + ? computedStyle.getPropertyValue(key) + : computedStyle[key]) || 0; + return typeof value === "string" ? value.trim() : value; + } + } + measureInstanceViewportBox(instance, { transformPagePoint }) { + return measureViewportBox(instance, transformPagePoint); + } + build(renderState, latestValues, props) { + buildHTMLStyles(renderState, latestValues, props.transformTemplate); + } + scrapeMotionValuesFromProps(props, prevProps, visualElement) { + return scrapeMotionValuesFromProps$1(props, prevProps, visualElement); + } + } + + function isObjectKey(key, object) { + return key in object; + } + class ObjectVisualElement extends VisualElement { + constructor() { + super(...arguments); + this.type = "object"; + } + readValueFromInstance(instance, key) { + if (isObjectKey(key, instance)) { + const value = instance[key]; + if (typeof value === "string" || typeof value === "number") { + return value; + } + } + return undefined; + } + getBaseTargetFromProps() { + return undefined; + } + removeValueFromRenderState(key, renderState) { + delete renderState.output[key]; + } + measureInstanceViewportBox() { + return createBox(); + } + build(renderState, latestValues) { + Object.assign(renderState.output, latestValues); + } + renderInstance(instance, { output }) { + Object.assign(instance, output); + } + sortInstanceNodePosition() { + return 0; + } + } + + const dashKeys = { + offset: "stroke-dashoffset", + array: "stroke-dasharray", + }; + const camelKeys = { + offset: "strokeDashoffset", + array: "strokeDasharray", + }; + /** + * Build SVG path properties. Uses the path's measured length to convert + * our custom pathLength, pathSpacing and pathOffset into stroke-dashoffset + * and stroke-dasharray attributes. + * + * This function is mutative to reduce per-frame GC. + * + * Note: We use unitless values for stroke-dasharray and stroke-dashoffset + * because Safari incorrectly scales px values when the page is zoomed. + */ + function buildSVGPath(attrs, length, spacing = 1, offset = 0, useDashCase = true) { + // Normalise path length by setting SVG attribute pathLength to 1 + attrs.pathLength = 1; + // We use dash case when setting attributes directly to the DOM node and camel case + // when defining props on a React component. + const keys = useDashCase ? dashKeys : camelKeys; + // Build the dash offset (unitless to avoid Safari zoom bug) + attrs[keys.offset] = `${-offset}`; + // Build the dash array (unitless to avoid Safari zoom bug) + attrs[keys.array] = `${length} ${spacing}`; + } + + const cssStyleProperties = [ + "transform", + "opacity", + "offsetDistance", + "offsetPath", + "offsetRotate", + "offsetAnchor", + ]; + /** + * Build SVG visual attributes, like cx and style.transform + */ + function buildSVGAttrs(state, { attrX, attrY, attrScale, pathLength, pathSpacing = 1, pathOffset = 0, + // This is object creation, which we try to avoid per-frame. + ...latest }, isSVGTag, transformTemplate, styleProp) { + buildHTMLStyles(state, latest, transformTemplate); + /** + * For svg tags we just want to make sure viewBox is animatable and treat all the styles + * as normal HTML tags. + */ + if (isSVGTag) { + if (state.style.viewBox) { + state.attrs.viewBox = state.style.viewBox; + } + return; + } + state.attrs = state.style; + state.style = {}; + const { attrs, style } = state; + for (const key of cssStyleProperties) { + if (attrs[key] !== undefined) { + style[key] = attrs[key]; + delete attrs[key]; + } + } + if (style.transform || attrs.transformOrigin) { + style.transformOrigin = attrs.transformOrigin ?? "50% 50%"; + delete attrs.transformOrigin; + } + if (style.transform) { + /** + * SVG's element transform-origin uses its own median as a reference. + * Therefore, transformBox becomes a fill-box + */ + style.transformBox = styleProp?.transformBox ?? "fill-box"; + delete attrs.transformBox; + } + // Render attrX/attrY/attrScale as attributes + if (attrX !== undefined) + attrs.x = attrX; + if (attrY !== undefined) + attrs.y = attrY; + if (attrScale !== undefined) + attrs.scale = attrScale; + // Build SVG path if one has been defined + if (pathLength !== undefined) { + buildSVGPath(attrs, pathLength, pathSpacing, pathOffset, false); + } + } + + /** + * A set of attribute names that are always read/written as camel case. + */ + const camelCaseAttributes = new Set([ + "baseFrequency", + "diffuseConstant", + "kernelMatrix", + "kernelUnitLength", + "keySplines", + "keyTimes", + "limitingConeAngle", + "markerHeight", + "markerWidth", + "numOctaves", + "targetX", + "targetY", + "surfaceScale", + "specularConstant", + "specularExponent", + "stdDeviation", + "tableValues", + "viewBox", + "gradientTransform", + "pathLength", + "startOffset", + "textLength", + "lengthAdjust", + ]); + + const isSVGTag = (tag) => typeof tag === "string" && tag.toLowerCase() === "svg"; + + function renderSVG(element, renderState, _styleProp, projection) { + renderHTML(element, renderState, undefined, projection); + for (const key in renderState.attrs) { + element.setAttribute(!camelCaseAttributes.has(key) ? camelToDash(key) : key, renderState.attrs[key]); + } + } + + function scrapeMotionValuesFromProps(props, prevProps, visualElement) { + const newValues = scrapeMotionValuesFromProps$1(props, prevProps, visualElement); + for (const key in props) { + if (isMotionValue(props[key]) || + isMotionValue(prevProps[key])) { + const targetKey = transformPropOrder.indexOf(key) !== -1 + ? "attr" + key.charAt(0).toUpperCase() + key.substring(1) + : key; + newValues[targetKey] = props[key]; + } + } + return newValues; + } + + class SVGVisualElement extends DOMVisualElement { + constructor() { + super(...arguments); + this.type = "svg"; + this.isSVGTag = false; + this.measureInstanceViewportBox = createBox; + } + getBaseTargetFromProps(props, key) { + return props[key]; + } + readValueFromInstance(instance, key) { + if (transformProps.has(key)) { + const defaultType = getDefaultValueType(key); + return defaultType ? defaultType.default || 0 : 0; + } + if (cssStyleProperties.includes(key)) { + const computedStyle = getComputedStyle(instance); + const value = computedStyle[key]; + if (typeof value === "string" && value) + return value.trim(); + } + key = !camelCaseAttributes.has(key) ? camelToDash(key) : key; + return instance.getAttribute(key); + } + scrapeMotionValuesFromProps(props, prevProps, visualElement) { + return scrapeMotionValuesFromProps(props, prevProps, visualElement); + } + build(renderState, latestValues, props) { + buildSVGAttrs(renderState, latestValues, this.isSVGTag, props.transformTemplate, props.style); + } + renderInstance(instance, renderState, styleProp, projection) { + renderSVG(instance, renderState, styleProp, projection); + } + mount(instance) { + this.isSVGTag = isSVGTag(instance.tagName); + super.mount(instance); + } + } + + const numVariantProps = variantProps.length; + /** + * Get variant context from a visual element's parent chain. + * Uses `any` type for visualElement to avoid circular dependencies. + */ + function getVariantContext(visualElement) { + if (!visualElement) + return undefined; + if (!visualElement.isControllingVariants) { + const context = visualElement.parent + ? getVariantContext(visualElement.parent) || {} + : {}; + if (visualElement.props.initial !== undefined) { + context.initial = visualElement.props.initial; + } + return context; + } + const context = {}; + for (let i = 0; i < numVariantProps; i++) { + const name = variantProps[i]; + const prop = visualElement.props[name]; + if (isVariantLabel(prop) || prop === false) { + context[name] = prop; + } + } + return context; + } + + function shallowCompare(next, prev) { + if (!Array.isArray(prev)) + return false; + const prevLength = prev.length; + if (prevLength !== next.length) + return false; + for (let i = 0; i < prevLength; i++) { + if (prev[i] !== next[i]) + return false; + } + return true; + } + + const reversePriorityOrder = [...variantPriorityOrder].reverse(); + const numAnimationTypes = variantPriorityOrder.length; + function createAnimateFunction(visualElement) { + return (animations) => { + return Promise.all(animations.map(({ animation, options }) => animateVisualElement(visualElement, animation, options))); + }; + } + function createAnimationState(visualElement) { + let animate = createAnimateFunction(visualElement); + let state = createState(); + let isInitialRender = true; + /** + * Track whether the animation state has been reset (e.g. via StrictMode + * double-invocation or Suspense unmount/remount). On the first + * animateChanges() call after a reset we need to behave like the initial + * render for variant-inheritance checks, even though isInitialRender is + * already false. + */ + let wasReset = false; + /** + * This function will be used to reduce the animation definitions for + * each active animation type into an object of resolved values for it. + */ + const buildResolvedTypeValues = (type) => (acc, definition) => { + const resolved = resolveVariant(visualElement, definition, type === "exit" + ? visualElement.presenceContext?.custom + : undefined); + if (resolved) { + const { transition, transitionEnd, ...target } = resolved; + acc = { ...acc, ...target, ...transitionEnd }; + } + return acc; + }; + /** + * This just allows us to inject mocked animation functions + * @internal + */ + function setAnimateFunction(makeAnimator) { + animate = makeAnimator(visualElement); + } + /** + * When we receive new props, we need to: + * 1. Create a list of protected keys for each type. This is a directory of + * value keys that are currently being "handled" by types of a higher priority + * so that whenever an animation is played of a given type, these values are + * protected from being animated. + * 2. Determine if an animation type needs animating. + * 3. Determine if any values have been removed from a type and figure out + * what to animate those to. + */ + function animateChanges(changedActiveType) { + const { props } = visualElement; + const context = getVariantContext(visualElement.parent) || {}; + /** + * A list of animations that we'll build into as we iterate through the animation + * types. This will get executed at the end of the function. + */ + const animations = []; + /** + * Keep track of which values have been removed. Then, as we hit lower priority + * animation types, we can check if they contain removed values and animate to that. + */ + const removedKeys = new Set(); + /** + * A dictionary of all encountered keys. This is an object to let us build into and + * copy it without iteration. Each time we hit an animation type we set its protected + * keys - the keys its not allowed to animate - to the latest version of this object. + */ + let encounteredKeys = {}; + /** + * If a variant has been removed at a given index, and this component is controlling + * variant animations, we want to ensure lower-priority variants are forced to animate. + */ + let removedVariantIndex = Infinity; + /** + * Iterate through all animation types in reverse priority order. For each, we want to + * detect which values it's handling and whether or not they've changed (and therefore + * need to be animated). If any values have been removed, we want to detect those in + * lower priority props and flag for animation. + */ + for (let i = 0; i < numAnimationTypes; i++) { + const type = reversePriorityOrder[i]; + const typeState = state[type]; + const prop = props[type] !== undefined + ? props[type] + : context[type]; + const propIsVariant = isVariantLabel(prop); + /** + * If this type has *just* changed isActive status, set activeDelta + * to that status. Otherwise set to null. + */ + const activeDelta = type === changedActiveType ? typeState.isActive : null; + if (activeDelta === false) + removedVariantIndex = i; + /** + * If this prop is an inherited variant, rather than been set directly on the + * component itself, we want to make sure we allow the parent to trigger animations. + * + * TODO: Can probably change this to a !isControllingVariants check + */ + let isInherited = prop === context[type] && + prop !== props[type] && + propIsVariant; + if (isInherited && + (isInitialRender || wasReset) && + visualElement.manuallyAnimateOnMount) { + isInherited = false; + } + /** + * Set all encountered keys so far as the protected keys for this type. This will + * be any key that has been animated or otherwise handled by active, higher-priortiy types. + */ + typeState.protectedKeys = { ...encounteredKeys }; + // Check if we can skip analysing this prop early + if ( + // If it isn't active and hasn't *just* been set as inactive + (!typeState.isActive && activeDelta === null) || + // If we didn't and don't have any defined prop for this animation type + (!prop && !typeState.prevProp) || + // Or if the prop doesn't define an animation + isAnimationControls(prop) || + typeof prop === "boolean") { + continue; + } + /** + * If exit is already active and wasn't just activated, skip + * re-processing to prevent interrupting running exit animations. + * Re-resolving exit with a changed custom value can start new + * value animations that stop the originals, leaving the exit + * animation promise unresolved and the component stuck in the DOM. + */ + if (type === "exit" && typeState.isActive && activeDelta !== true) { + if (typeState.prevResolvedValues) { + encounteredKeys = { + ...encounteredKeys, + ...typeState.prevResolvedValues, + }; + } + continue; + } + /** + * As we go look through the values defined on this type, if we detect + * a changed value or a value that was removed in a higher priority, we set + * this to true and add this prop to the animation list. + */ + const variantDidChange = checkVariantsDidChange(typeState.prevProp, prop); + let shouldAnimateType = variantDidChange || + // If we're making this variant active, we want to always make it active + (type === changedActiveType && + typeState.isActive && + !isInherited && + propIsVariant) || + // If we removed a higher-priority variant (i is in reverse order) + (i > removedVariantIndex && propIsVariant); + let handledRemovedValues = false; + /** + * As animations can be set as variant lists, variants or target objects, we + * coerce everything to an array if it isn't one already + */ + const definitionList = Array.isArray(prop) ? prop : [prop]; + /** + * Build an object of all the resolved values. We'll use this in the subsequent + * animateChanges calls to determine whether a value has changed. + */ + let resolvedValues = definitionList.reduce(buildResolvedTypeValues(type), {}); + if (activeDelta === false) + resolvedValues = {}; + /** + * Now we need to loop through all the keys in the prev prop and this prop, + * and decide: + * 1. If the value has changed, and needs animating + * 2. If it has been removed, and needs adding to the removedKeys set + * 3. If it has been removed in a higher priority type and needs animating + * 4. If it hasn't been removed in a higher priority but hasn't changed, and + * needs adding to the type's protectedKeys list. + */ + const { prevResolvedValues = {} } = typeState; + const allKeys = { + ...prevResolvedValues, + ...resolvedValues, + }; + const markToAnimate = (key) => { + shouldAnimateType = true; + if (removedKeys.has(key)) { + handledRemovedValues = true; + removedKeys.delete(key); + } + typeState.needsAnimating[key] = true; + const motionValue = visualElement.getValue(key); + if (motionValue) + motionValue.liveStyle = false; + }; + for (const key in allKeys) { + const next = resolvedValues[key]; + const prev = prevResolvedValues[key]; + // If we've already handled this we can just skip ahead + if (encounteredKeys.hasOwnProperty(key)) + continue; + /** + * If the value has changed, we probably want to animate it. + */ + let valueHasChanged = false; + if (isKeyframesTarget(next) && isKeyframesTarget(prev)) { + valueHasChanged = + !shallowCompare(next, prev) || variantDidChange; + } + else { + valueHasChanged = next !== prev; + } + if (valueHasChanged) { + if (next !== undefined && next !== null) { + // If next is defined and doesn't equal prev, it needs animating + markToAnimate(key); + } + else { + // If it's undefined, it's been removed. + removedKeys.add(key); + } + } + else if (next !== undefined && removedKeys.has(key)) { + /** + * If next hasn't changed and it isn't undefined, we want to check if it's + * been removed by a higher priority + */ + markToAnimate(key); + } + else { + /** + * If it hasn't changed, we add it to the list of protected values + * to ensure it doesn't get animated. + */ + typeState.protectedKeys[key] = true; + } + } + /** + * Update the typeState so next time animateChanges is called we can compare the + * latest prop and resolvedValues to these. + */ + typeState.prevProp = prop; + typeState.prevResolvedValues = resolvedValues; + if (typeState.isActive) { + encounteredKeys = { ...encounteredKeys, ...resolvedValues }; + } + if ((isInitialRender || wasReset) && + visualElement.blockInitialAnimation) { + shouldAnimateType = false; + } + /** + * If this is an inherited prop we want to skip this animation + * unless the inherited variants haven't changed on this render. + */ + const willAnimateViaParent = isInherited && variantDidChange; + const needsAnimating = !willAnimateViaParent || handledRemovedValues; + if (shouldAnimateType && needsAnimating) { + animations.push(...definitionList.map((animation) => { + const options = { type }; + /** + * If we're performing the initial animation, but we're not + * rendering at the same time as the variant-controlling parent, + * we want to use the parent's transition to calculate the stagger. + */ + if (typeof animation === "string" && + (isInitialRender || wasReset) && + !willAnimateViaParent && + visualElement.manuallyAnimateOnMount && + visualElement.parent) { + const { parent } = visualElement; + const parentVariant = resolveVariant(parent, animation); + if (parent.enteringChildren && parentVariant) { + const { delayChildren } = parentVariant.transition || {}; + options.delay = calcChildStagger(parent.enteringChildren, visualElement, delayChildren); + } + } + return { + animation: animation, + options, + }; + })); + } + } + /** + * If there are some removed value that haven't been dealt with, + * we need to create a new animation that falls back either to the value + * defined in the style prop, or the last read value. + */ + if (removedKeys.size) { + const fallbackAnimation = {}; + /** + * If the initial prop contains a transition we can use that, otherwise + * allow the animation function to use the visual element's default. + */ + if (typeof props.initial !== "boolean") { + const initialTransition = resolveVariant(visualElement, Array.isArray(props.initial) + ? props.initial[0] + : props.initial); + if (initialTransition && initialTransition.transition) { + fallbackAnimation.transition = initialTransition.transition; + } + } + removedKeys.forEach((key) => { + const fallbackTarget = visualElement.getBaseTarget(key); + const motionValue = visualElement.getValue(key); + if (motionValue) + motionValue.liveStyle = true; + // @ts-expect-error - @mattgperry to figure if we should do something here + fallbackAnimation[key] = fallbackTarget ?? null; + }); + animations.push({ animation: fallbackAnimation }); + } + let shouldAnimate = Boolean(animations.length); + if (isInitialRender && + (props.initial === false || props.initial === props.animate) && + !visualElement.manuallyAnimateOnMount) { + shouldAnimate = false; + } + isInitialRender = false; + wasReset = false; + return shouldAnimate ? animate(animations) : Promise.resolve(); + } + /** + * Change whether a certain animation type is active. + */ + function setActive(type, isActive) { + // If the active state hasn't changed, we can safely do nothing here + if (state[type].isActive === isActive) + return Promise.resolve(); + // Propagate active change to children + visualElement.variantChildren?.forEach((child) => child.animationState?.setActive(type, isActive)); + state[type].isActive = isActive; + const animations = animateChanges(type); + for (const key in state) { + state[key].protectedKeys = {}; + } + return animations; + } + return { + animateChanges, + setActive, + setAnimateFunction, + getState: () => state, + reset: () => { + state = createState(); + wasReset = true; + }, + }; + } + function checkVariantsDidChange(prev, next) { + if (typeof next === "string") { + return next !== prev; + } + else if (Array.isArray(next)) { + return !shallowCompare(next, prev); + } + return false; + } + function createTypeState(isActive = false) { + return { + isActive, + protectedKeys: {}, + needsAnimating: {}, + prevResolvedValues: {}, + }; + } + function createState() { + return { + animate: createTypeState(true), + whileInView: createTypeState(), + whileHover: createTypeState(), + whileTap: createTypeState(), + whileDrag: createTypeState(), + whileFocus: createTypeState(), + exit: createTypeState(), + }; + } + + /** + * Reset an axis to the provided origin box. + * + * This is a mutative operation. + */ + function copyAxisInto(axis, originAxis) { + axis.min = originAxis.min; + axis.max = originAxis.max; + } + /** + * Reset a box to the provided origin box. + * + * This is a mutative operation. + */ + function copyBoxInto(box, originBox) { + copyAxisInto(box.x, originBox.x); + copyAxisInto(box.y, originBox.y); + } + /** + * Reset a delta to the provided origin box. + * + * This is a mutative operation. + */ + function copyAxisDeltaInto(delta, originDelta) { + delta.translate = originDelta.translate; + delta.scale = originDelta.scale; + delta.originPoint = originDelta.originPoint; + delta.origin = originDelta.origin; + } + + const SCALE_PRECISION = 0.0001; + const SCALE_MIN = 1 - SCALE_PRECISION; + const SCALE_MAX = 1 + SCALE_PRECISION; + const TRANSLATE_PRECISION = 0.01; + const TRANSLATE_MIN = 0 - TRANSLATE_PRECISION; + const TRANSLATE_MAX = 0 + TRANSLATE_PRECISION; + function calcLength(axis) { + return axis.max - axis.min; + } + function isNear(value, target, maxDistance) { + return Math.abs(value - target) <= maxDistance; + } + function calcAxisDelta(delta, source, target, origin = 0.5) { + delta.origin = origin; + delta.originPoint = mixNumber$1(source.min, source.max, delta.origin); + delta.scale = calcLength(target) / calcLength(source); + delta.translate = + mixNumber$1(target.min, target.max, delta.origin) - delta.originPoint; + if ((delta.scale >= SCALE_MIN && delta.scale <= SCALE_MAX) || + isNaN(delta.scale)) { + delta.scale = 1.0; + } + if ((delta.translate >= TRANSLATE_MIN && + delta.translate <= TRANSLATE_MAX) || + isNaN(delta.translate)) { + delta.translate = 0.0; + } + } + function calcBoxDelta(delta, source, target, origin) { + calcAxisDelta(delta.x, source.x, target.x, origin ? origin.originX : undefined); + calcAxisDelta(delta.y, source.y, target.y, origin ? origin.originY : undefined); + } + function calcRelativeAxis(target, relative, parent, anchor = 0) { + const anchorPoint = anchor + ? mixNumber$1(parent.min, parent.max, anchor) + : parent.min; + target.min = anchorPoint + relative.min; + target.max = target.min + calcLength(relative); + } + function calcRelativeBox(target, relative, parent, anchor) { + calcRelativeAxis(target.x, relative.x, parent.x, anchor?.x); + calcRelativeAxis(target.y, relative.y, parent.y, anchor?.y); + } + function calcRelativeAxisPosition(target, layout, parent, anchor = 0) { + const anchorPoint = anchor + ? mixNumber$1(parent.min, parent.max, anchor) + : parent.min; + target.min = layout.min - anchorPoint; + target.max = target.min + calcLength(layout); + } + function calcRelativePosition(target, layout, parent, anchor) { + calcRelativeAxisPosition(target.x, layout.x, parent.x, anchor?.x); + calcRelativeAxisPosition(target.y, layout.y, parent.y, anchor?.y); + } + + /** + * Remove a delta from a point. This is essentially the steps of applyPointDelta in reverse + */ + function removePointDelta(point, translate, scale, originPoint, boxScale) { + point -= translate; + point = scalePoint(point, 1 / scale, originPoint); + if (boxScale !== undefined) { + point = scalePoint(point, 1 / boxScale, originPoint); + } + return point; + } + /** + * Remove a delta from an axis. This is essentially the steps of applyAxisDelta in reverse + */ + function removeAxisDelta(axis, translate = 0, scale = 1, origin = 0.5, boxScale, originAxis = axis, sourceAxis = axis) { + if (percent.test(translate)) { + translate = parseFloat(translate); + const relativeProgress = mixNumber$1(sourceAxis.min, sourceAxis.max, translate / 100); + translate = relativeProgress - sourceAxis.min; + } + if (typeof translate !== "number") + return; + let originPoint = mixNumber$1(originAxis.min, originAxis.max, origin); + if (axis === originAxis) + originPoint -= translate; + axis.min = removePointDelta(axis.min, translate, scale, originPoint, boxScale); + axis.max = removePointDelta(axis.max, translate, scale, originPoint, boxScale); + } + /** + * Remove a transforms from an axis. This is essentially the steps of applyAxisTransforms in reverse + * and acts as a bridge between motion values and removeAxisDelta + */ + function removeAxisTransforms(axis, transforms, [key, scaleKey, originKey], origin, sourceAxis) { + removeAxisDelta(axis, transforms[key], transforms[scaleKey], transforms[originKey], transforms.scale, origin, sourceAxis); + } + /** + * The names of the motion values we want to apply as translation, scale and origin. + */ + const xKeys = ["x", "scaleX", "originX"]; + const yKeys = ["y", "scaleY", "originY"]; + /** + * Remove a transforms from an box. This is essentially the steps of applyAxisBox in reverse + * and acts as a bridge between motion values and removeAxisDelta + */ + function removeBoxTransforms(box, transforms, originBox, sourceBox) { + removeAxisTransforms(box.x, transforms, xKeys, originBox ? originBox.x : undefined, sourceBox ? sourceBox.x : undefined); + removeAxisTransforms(box.y, transforms, yKeys, originBox ? originBox.y : undefined, sourceBox ? sourceBox.y : undefined); + } + + function isAxisDeltaZero(delta) { + return delta.translate === 0 && delta.scale === 1; + } + function isDeltaZero(delta) { + return isAxisDeltaZero(delta.x) && isAxisDeltaZero(delta.y); + } + function axisEquals(a, b) { + return a.min === b.min && a.max === b.max; + } + function boxEquals(a, b) { + return axisEquals(a.x, b.x) && axisEquals(a.y, b.y); + } + function axisEqualsRounded(a, b) { + return (Math.round(a.min) === Math.round(b.min) && + Math.round(a.max) === Math.round(b.max)); + } + function boxEqualsRounded(a, b) { + return axisEqualsRounded(a.x, b.x) && axisEqualsRounded(a.y, b.y); + } + function aspectRatio(box) { + return calcLength(box.x) / calcLength(box.y); + } + function axisDeltaEquals(a, b) { + return (a.translate === b.translate && + a.scale === b.scale && + a.originPoint === b.originPoint); + } + + function eachAxis(callback) { + return [callback("x"), callback("y")]; + } + + function buildProjectionTransform(delta, treeScale, latestTransform) { + let transform = ""; + /** + * The translations we use to calculate are always relative to the viewport coordinate space. + * But when we apply scales, we also scale the coordinate space of an element and its children. + * For instance if we have a treeScale (the culmination of all parent scales) of 0.5 and we need + * to move an element 100 pixels, we actually need to move it 200 in within that scaled space. + */ + const xTranslate = delta.x.translate / treeScale.x; + const yTranslate = delta.y.translate / treeScale.y; + const zTranslate = latestTransform?.z || 0; + if (xTranslate || yTranslate || zTranslate) { + transform = `translate3d(${xTranslate}px, ${yTranslate}px, ${zTranslate}px) `; + } + /** + * Apply scale correction for the tree transform. + * This will apply scale to the screen-orientated axes. + */ + if (treeScale.x !== 1 || treeScale.y !== 1) { + transform += `scale(${1 / treeScale.x}, ${1 / treeScale.y}) `; + } + if (latestTransform) { + const { transformPerspective, rotate, pathRotation, rotateX, rotateY, skewX, skewY, } = latestTransform; + if (transformPerspective) + transform = `perspective(${transformPerspective}px) ${transform}`; + if (rotate) + transform += `rotate(${rotate}deg) `; + // Additive `rotate()` so user `rotate` isn't clobbered. + if (pathRotation) + transform += `rotate(${pathRotation}deg) `; + if (rotateX) + transform += `rotateX(${rotateX}deg) `; + if (rotateY) + transform += `rotateY(${rotateY}deg) `; + if (skewX) + transform += `skewX(${skewX}deg) `; + if (skewY) + transform += `skewY(${skewY}deg) `; + } + /** + * Apply scale to match the size of the element to the size we want it. + * This will apply scale to the element-orientated axes. + */ + const elementScaleX = delta.x.scale * treeScale.x; + const elementScaleY = delta.y.scale * treeScale.y; + if (elementScaleX !== 1 || elementScaleY !== 1) { + transform += `scale(${elementScaleX}, ${elementScaleY})`; + } + return transform || "none"; + } + + const numBorders = cornerRadiusProps.length; + const asNumber = (value) => typeof value === "string" ? parseFloat(value) : value; + const isPx = (value) => typeof value === "number" || px.test(value); + function mixValues(target, follow, lead, progress, shouldCrossfadeOpacity, isOnlyMember) { + if (shouldCrossfadeOpacity) { + target.opacity = mixNumber$1(0, lead.opacity ?? 1, easeCrossfadeIn(progress)); + target.opacityExit = mixNumber$1(follow.opacity ?? 1, 0, easeCrossfadeOut(progress)); + } + else if (isOnlyMember) { + target.opacity = mixNumber$1(follow.opacity ?? 1, lead.opacity ?? 1, progress); + } + /** + * Mix border radius + */ + for (let i = 0; i < numBorders; i++) { + const borderLabel = cornerRadiusProps[i]; + let followRadius = getRadius(follow, borderLabel); + let leadRadius = getRadius(lead, borderLabel); + if (followRadius === undefined && leadRadius === undefined) + continue; + followRadius || (followRadius = 0); + leadRadius || (leadRadius = 0); + const canMix = followRadius === 0 || + leadRadius === 0 || + isPx(followRadius) === isPx(leadRadius); + if (canMix) { + target[borderLabel] = Math.max(mixNumber$1(asNumber(followRadius), asNumber(leadRadius), progress), 0); + if (percent.test(leadRadius) || percent.test(followRadius)) { + target[borderLabel] += "%"; + } + } + else { + target[borderLabel] = leadRadius; + } + } + /** + * Mix rotation + */ + if (follow.rotate || lead.rotate) { + target.rotate = mixNumber$1(follow.rotate || 0, lead.rotate || 0, progress); + } + } + function getRadius(values, radiusName) { + return values[radiusName] !== undefined + ? values[radiusName] + : values.borderRadius; + } + const easeCrossfadeIn = /*@__PURE__*/ compress(0, 0.5, motionUtils.circOut); + const easeCrossfadeOut = /*@__PURE__*/ compress(0.5, 0.95, motionUtils.noop); + function compress(min, max, easing) { + return (p) => { + // Could replace ifs with clamp + if (p < min) + return 0; + if (p > max) + return 1; + return easing(motionUtils.progress(min, max, p)); + }; + } + + function animateSingleValue(value, keyframes, options) { + const motionValue$1 = isMotionValue(value) ? value : motionValue(value); + motionValue$1.start(animateMotionValue("", motionValue$1, keyframes, options)); + return motionValue$1.animation; + } + + function addDomEvent(target, eventName, handler, options = { passive: true }) { + target.addEventListener(eventName, handler, options); + return () => target.removeEventListener(eventName, handler, options); + } + + const compareByDepth = (a, b) => a.depth - b.depth; + + class FlatTree { + constructor() { + this.children = []; + this.isDirty = false; + } + add(child) { + motionUtils.addUniqueItem(this.children, child); + this.isDirty = true; + } + remove(child) { + motionUtils.removeItem(this.children, child); + this.isDirty = true; + } + forEach(callback) { + this.isDirty && this.children.sort(compareByDepth); + this.isDirty = false; + this.children.forEach(callback); + } + } + + /** + * Timeout defined in ms + */ + function delay(callback, timeout) { + const start = time.now(); + const checkElapsed = ({ timestamp }) => { + const elapsed = timestamp - start; + if (elapsed >= timeout) { + cancelFrame(checkElapsed); + callback(elapsed - timeout); + } + }; + frame.setup(checkElapsed, true); + return () => cancelFrame(checkElapsed); + } + function delayInSeconds(callback, timeout) { + return delay(callback, motionUtils.secondsToMilliseconds(timeout)); + } + + /** + * If the provided value is a MotionValue, this returns the actual value, otherwise just the value itself + */ + function resolveMotionValue(value) { + return isMotionValue(value) ? value.get() : value; + } + + class NodeStack { + constructor() { + this.members = []; + } + add(node) { + motionUtils.addUniqueItem(this.members, node); + for (let i = this.members.length - 1; i >= 0; i--) { + const member = this.members[i]; + if (member === node || member === this.lead || member === this.prevLead) + continue; + const inst = member.instance; + if ((!inst || inst.isConnected === false) && !member.snapshot) { + motionUtils.removeItem(this.members, member); + member.unmount(); + } + } + node.scheduleRender(); + } + remove(node) { + motionUtils.removeItem(this.members, node); + if (node === this.prevLead) + this.prevLead = undefined; + if (node === this.lead) { + const prevLead = this.members[this.members.length - 1]; + if (prevLead) + this.promote(prevLead); + } + } + relegate(node) { + for (let i = this.members.indexOf(node) - 1; i >= 0; i--) { + const member = this.members[i]; + if (member.isPresent !== false && member.instance?.isConnected !== false) { + this.promote(member); + return true; + } + } + return false; + } + promote(node, preserveFollowOpacity) { + const prevLead = this.lead; + if (node === prevLead) + return; + this.prevLead = prevLead; + this.lead = node; + node.show(); + if (prevLead) { + prevLead.updateSnapshot(); + node.scheduleRender(); + const { layoutDependency: prevDep } = prevLead.options; + const { layoutDependency: nextDep } = node.options; + if (prevDep === undefined || prevDep !== nextDep) { + node.resumeFrom = prevLead; + if (preserveFollowOpacity) + prevLead.preserveOpacity = true; + if (prevLead.snapshot) { + node.snapshot = prevLead.snapshot; + node.snapshot.latestValues = + prevLead.animationValues || prevLead.latestValues; + } + if (node.root?.isUpdating) + node.isLayoutDirty = true; + } + if (node.options.crossfade === false) + prevLead.hide(); + } + } + exitAnimationComplete() { + this.members.forEach((member) => { + member.options.onExitComplete?.(); + member.resumingFrom?.options.onExitComplete?.(); + }); + } + scheduleRender() { + this.members.forEach((member) => member.instance && member.scheduleRender(false)); + } + removeLeadSnapshot() { + if (this.lead?.snapshot) + this.lead.snapshot = undefined; + } + } + + /** + * This should only ever be modified on the client otherwise it'll + * persist through server requests. If we need instanced states we + * could lazy-init via root. + */ + const globalProjectionState = { + /** + * Global flag as to whether the tree has animated since the last time + * we resized the window + */ + hasAnimatedSinceResize: true, + /** + * We set this to true once, on the first update. Any nodes added to the tree beyond that + * update will be given a `data-projection-id` attribute. + */ + hasEverUpdated: false, + }; + + const metrics = { + nodes: 0, + calculatedTargetDeltas: 0, + calculatedProjections: 0, + }; + const transformAxes = ["", "X", "Y", "Z"]; + /** + * We use 1000 as the animation target as 0-1000 maps better to pixels than 0-1 + * which has a noticeable difference in spring animations + */ + const animationTarget = 1000; + let id = 0; + function resetDistortingTransform(key, visualElement, values, sharedAnimationValues) { + const { latestValues } = visualElement; + // Record the distorting transform and then temporarily set it to 0 + if (latestValues[key]) { + values[key] = latestValues[key]; + visualElement.setStaticValue(key, 0); + if (sharedAnimationValues) { + sharedAnimationValues[key] = 0; + } + } + } + function cancelTreeOptimisedTransformAnimations(projectionNode) { + projectionNode.hasCheckedOptimisedAppear = true; + if (projectionNode.root === projectionNode) + return; + const { visualElement } = projectionNode.options; + if (!visualElement) + return; + const appearId = getOptimisedAppearId(visualElement); + if (window.MotionHasOptimisedAnimation(appearId, "transform")) { + const { layout, layoutId } = projectionNode.options; + window.MotionCancelOptimisedAnimation(appearId, "transform", frame, !(layout || layoutId)); + } + const { parent } = projectionNode; + if (parent && !parent.hasCheckedOptimisedAppear) { + cancelTreeOptimisedTransformAnimations(parent); + } + } + function createProjectionNode({ attachResizeListener, defaultParent, measureScroll, checkIsScrollRoot, resetTransform, }) { + return class ProjectionNode { + constructor(latestValues = {}, parent = defaultParent?.()) { + /** + * A unique ID generated for every projection node. + */ + this.id = id++; + /** + * An id that represents a unique session instigated by startUpdate. + */ + this.animationId = 0; + this.animationCommitId = 0; + /** + * A Set containing all this component's children. This is used to iterate + * through the children. + * + * TODO: This could be faster to iterate as a flat array stored on the root node. + */ + this.children = new Set(); + /** + * Options for the node. We use this to configure what kind of layout animations + * we should perform (if any). + */ + this.options = {}; + /** + * We use this to detect when its safe to shut down part of a projection tree. + * We have to keep projecting children for scale correction and relative projection + * until all their parents stop performing layout animations. + */ + this.isTreeAnimating = false; + this.isAnimationBlocked = false; + /** + * Flag to true if we think this layout has been changed. We can't always know this, + * currently we set it to true every time a component renders, or if it has a layoutDependency + * if that has changed between renders. Additionally, components can be grouped by LayoutGroup + * and if one node is dirtied, they all are. + */ + this.isLayoutDirty = false; + /** + * Flag to true if we think the projection calculations for this node needs + * recalculating as a result of an updated transform or layout animation. + */ + this.isProjectionDirty = false; + /** + * Flag to true if the layout *or* transform has changed. This then gets propagated + * throughout the projection tree, forcing any element below to recalculate on the next frame. + */ + this.isSharedProjectionDirty = false; + /** + * Flag transform dirty. This gets propagated throughout the whole tree but is only + * respected by shared nodes. + */ + this.isTransformDirty = false; + /** + * Block layout updates for instant layout transitions throughout the tree. + */ + this.updateManuallyBlocked = false; + this.updateBlockedByResize = false; + /** + * Set to true between the start of the first `willUpdate` call and the end of the `didUpdate` + * call. + */ + this.isUpdating = false; + /** + * If this is an SVG element we currently disable projection transforms + */ + this.isSVG = false; + /** + * Flag to true (during promotion) if a node doing an instant layout transition needs to reset + * its projection styles. + */ + this.needsReset = false; + /** + * Flags whether this node should have its transform reset prior to measuring. + */ + this.shouldResetTransform = false; + /** + * Store whether this node has been checked for optimised appear animations. As + * effects fire bottom-up, and we want to look up the tree for appear animations, + * this makes sure we only check each path once, stopping at nodes that + * have already been checked. + */ + this.hasCheckedOptimisedAppear = false; + /** + * An object representing the calculated contextual/accumulated/tree scale. + * This will be used to scale calculcated projection transforms, as these are + * calculated in screen-space but need to be scaled for elements to layoutly + * make it to their calculated destinations. + * + * TODO: Lazy-init + */ + this.treeScale = { x: 1, y: 1 }; + /** + * + */ + this.eventHandlers = new Map(); + this.hasTreeAnimated = false; + this.layoutVersion = 0; + // Note: Currently only running on root node + this.updateScheduled = false; + this.scheduleUpdate = () => this.update(); + this.projectionUpdateScheduled = false; + this.checkUpdateFailed = () => { + if (this.isUpdating) { + this.isUpdating = false; + this.clearAllSnapshots(); + } + }; + /** + * This is a multi-step process as shared nodes might be of different depths. Nodes + * are sorted by depth order, so we need to resolve the entire tree before moving to + * the next step. + */ + this.updateProjection = () => { + this.projectionUpdateScheduled = false; + /** + * Reset debug counts. Manually resetting rather than creating a new + * object each frame. + */ + if (statsBuffer.value) { + metrics.nodes = + metrics.calculatedTargetDeltas = + metrics.calculatedProjections = + 0; + } + this.nodes.forEach(propagateDirtyNodes); + this.nodes.forEach(resolveTargetDelta); + this.nodes.forEach(calcProjection); + this.nodes.forEach(cleanDirtyNodes); + if (statsBuffer.addProjectionMetrics) { + statsBuffer.addProjectionMetrics(metrics); + } + }; + /** + * Frame calculations + */ + this.resolvedRelativeTargetAt = 0.0; + this.linkedParentVersion = 0; + this.hasProjected = false; + this.isVisible = true; + this.animationProgress = 0; + /** + * Shared layout + */ + // TODO Only running on root node + this.sharedNodes = new Map(); + this.latestValues = latestValues; + this.root = parent ? parent.root || parent : this; + this.path = parent ? [...parent.path, parent] : []; + this.parent = parent; + this.depth = parent ? parent.depth + 1 : 0; + for (let i = 0; i < this.path.length; i++) { + this.path[i].shouldResetTransform = true; + } + if (this.root === this) + this.nodes = new FlatTree(); + } + addEventListener(name, handler) { + if (!this.eventHandlers.has(name)) { + this.eventHandlers.set(name, new motionUtils.SubscriptionManager()); + } + return this.eventHandlers.get(name).add(handler); + } + notifyListeners(name, ...args) { + const subscriptionManager = this.eventHandlers.get(name); + subscriptionManager && subscriptionManager.notify(...args); + } + hasListeners(name) { + return this.eventHandlers.has(name); + } + /** + * Lifecycles + */ + mount(instance) { + if (this.instance) + return; + this.isSVG = isSVGElement(instance) && !isSVGSVGElement(instance); + this.instance = instance; + const { layoutId, layout, visualElement } = this.options; + if (visualElement && !visualElement.current) { + visualElement.mount(instance); + } + this.root.nodes.add(this); + this.parent && this.parent.children.add(this); + if (this.root.hasTreeAnimated && (layout || layoutId)) { + this.isLayoutDirty = true; + } + if (attachResizeListener) { + let cancelDelay; + let innerWidth = 0; + const resizeUnblockUpdate = () => (this.root.updateBlockedByResize = false); + // Set initial innerWidth in a frame.read callback to batch the read + frame.read(() => { + innerWidth = window.innerWidth; + }); + attachResizeListener(instance, () => { + const newInnerWidth = window.innerWidth; + if (newInnerWidth === innerWidth) + return; + innerWidth = newInnerWidth; + this.root.updateBlockedByResize = true; + cancelDelay && cancelDelay(); + cancelDelay = delay(resizeUnblockUpdate, 250); + if (globalProjectionState.hasAnimatedSinceResize) { + globalProjectionState.hasAnimatedSinceResize = false; + this.nodes.forEach(finishAnimation); + } + }); + } + if (layoutId) { + this.root.registerSharedNode(layoutId, this); + } + // Only register the handler if it requires layout animation + if (this.options.animate !== false && + visualElement && + (layoutId || layout)) { + this.addEventListener("didUpdate", ({ delta, hasLayoutChanged, hasRelativeLayoutChanged, layout: newLayout, }) => { + if (this.isTreeAnimationBlocked()) { + this.target = undefined; + this.relativeTarget = undefined; + return; + } + // TODO: Check here if an animation exists + const layoutTransition = this.options.transition || + visualElement.getDefaultTransition() || + defaultLayoutTransition; + const { onLayoutAnimationStart, onLayoutAnimationComplete, } = visualElement.getProps(); + /** + * The target layout of the element might stay the same, + * but its position relative to its parent has changed. + */ + const hasTargetChanged = !this.targetLayout || + !boxEqualsRounded(this.targetLayout, newLayout); + /* + * Note: Disabled to fix relative animations always triggering new + * layout animations. If this causes further issues, we can try + * a different approach to detecting relative target changes. + */ + // || hasRelativeLayoutChanged + /** + * If the layout hasn't seemed to have changed, it might be that the + * element is visually in the same place in the document but its position + * relative to its parent has indeed changed. So here we check for that. + */ + const hasOnlyRelativeTargetChanged = !hasLayoutChanged && hasRelativeLayoutChanged; + if (this.options.layoutRoot || + this.resumeFrom || + hasOnlyRelativeTargetChanged || + (hasLayoutChanged && + (hasTargetChanged || !this.currentAnimation))) { + if (this.resumeFrom) { + this.resumingFrom = this.resumeFrom; + this.resumingFrom.resumingFrom = undefined; + } + const animationOptions = { + ...getValueTransition(layoutTransition, "layout"), + onPlay: onLayoutAnimationStart, + onComplete: onLayoutAnimationComplete, + }; + if (visualElement.shouldReduceMotion || + this.options.layoutRoot) { + animationOptions.delay = 0; + animationOptions.type = false; + } + this.startAnimation(animationOptions); + /** + * Set animation origin after starting animation to avoid layout jump + * caused by stopping previous layout animation + */ + this.setAnimationOrigin(delta, hasOnlyRelativeTargetChanged, animationOptions + .path); + } + else { + /** + * If the layout hasn't changed and we have an animation that hasn't started yet, + * finish it immediately. Otherwise it will be animating from a location + * that was probably never committed to screen and look like a jumpy box. + */ + if (!hasLayoutChanged) { + finishAnimation(this); + } + if (this.isLead() && this.options.onExitComplete) { + this.options.onExitComplete(); + } + } + this.targetLayout = newLayout; + }); + } + } + unmount() { + this.options.layoutId && this.willUpdate(); + this.root.nodes.remove(this); + const stack = this.getStack(); + stack && stack.remove(this); + this.parent && this.parent.children.delete(this); + this.instance = undefined; + this.eventHandlers.clear(); + cancelFrame(this.updateProjection); + } + // only on the root + blockUpdate() { + this.updateManuallyBlocked = true; + } + unblockUpdate() { + this.updateManuallyBlocked = false; + } + isUpdateBlocked() { + return this.updateManuallyBlocked || this.updateBlockedByResize; + } + isTreeAnimationBlocked() { + return (this.isAnimationBlocked || + (this.parent && this.parent.isTreeAnimationBlocked()) || + false); + } + // Note: currently only running on root node + startUpdate() { + if (this.isUpdateBlocked()) + return; + this.isUpdating = true; + this.nodes && this.nodes.forEach(resetSkewAndRotation); + this.animationId++; + } + getTransformTemplate() { + const { visualElement } = this.options; + return visualElement && visualElement.getProps().transformTemplate; + } + willUpdate(shouldNotifyListeners = true) { + this.root.hasTreeAnimated = true; + if (this.root.isUpdateBlocked()) { + this.options.onExitComplete && this.options.onExitComplete(); + return; + } + /** + * If we're running optimised appear animations then these must be + * cancelled before measuring the DOM. This is so we can measure + * the true layout of the element rather than the WAAPI animation + * which will be unaffected by the resetSkewAndRotate step. + * + * Note: This is a DOM write. Worst case scenario is this is sandwiched + * between other snapshot reads which will cause unnecessary style recalculations. + * This has to happen here though, as we don't yet know which nodes will need + * snapshots in startUpdate(), but we only want to cancel optimised animations + * if a layout animation measurement is actually going to be affected by them. + */ + if (window.MotionCancelOptimisedAnimation && + !this.hasCheckedOptimisedAppear) { + cancelTreeOptimisedTransformAnimations(this); + } + !this.root.isUpdating && this.root.startUpdate(); + if (this.isLayoutDirty) + return; + this.isLayoutDirty = true; + for (let i = 0; i < this.path.length; i++) { + const node = this.path[i]; + node.shouldResetTransform = true; + /** + * Percentage translates resolve against layoutBox dimensions, + * so ancestors with them must be re-measured after transform reset. + */ + if (typeof node.latestValues.x === "string" || + typeof node.latestValues.y === "string") { + node.isLayoutDirty = true; + } + node.updateScroll("snapshot"); + if (node.options.layoutRoot) { + node.willUpdate(false); + } + } + const { layoutId, layout } = this.options; + if (layoutId === undefined && !layout) + return; + const transformTemplate = this.getTransformTemplate(); + this.prevTransformTemplateValue = transformTemplate + ? transformTemplate(this.latestValues, "") + : undefined; + this.updateSnapshot(); + shouldNotifyListeners && this.notifyListeners("willUpdate"); + } + update() { + this.updateScheduled = false; + const updateWasBlocked = this.isUpdateBlocked(); + // When doing an instant transition, we skip the layout update, + // but should still clean up the measurements so that the next + // snapshot could be taken correctly. + if (updateWasBlocked) { + const wasBlockedByResize = this.updateBlockedByResize; + this.unblockUpdate(); + this.updateBlockedByResize = false; + this.clearAllSnapshots(); + /** + * When blocked by resize, still measure layouts so + * callbacks like onLayoutMeasure fire (e.g. Reorder). + * Skip notifyLayoutUpdate to prevent animations. + */ + if (wasBlockedByResize) { + this.nodes.forEach(forceLayoutMeasure); + } + this.nodes.forEach(clearMeasurements); + return; + } + /** + * If this is a repeat of didUpdate then ignore the animation. + */ + if (this.animationId <= this.animationCommitId) { + this.nodes.forEach(clearIsLayoutDirty); + return; + } + this.animationCommitId = this.animationId; + if (!this.isUpdating) { + this.nodes.forEach(clearIsLayoutDirty); + } + else { + this.isUpdating = false; + /** + * Ensure animation-blocked nodes (e.g. during drag) + * get measured even when memoized (willUpdate skipped). + */ + this.nodes.forEach(ensureDraggedNodesSnapshotted); + /** + * Write + */ + this.nodes.forEach(resetTransformStyle); + /** + * Read ================== + */ + // Update layout measurements of updated children + this.nodes.forEach(updateLayout); + /** + * Write + */ + // Notify listeners that the layout is updated + this.nodes.forEach(notifyLayoutUpdate); + } + this.clearAllSnapshots(); + /** + * Manually flush any pending updates. Ideally + * we could leave this to the following requestAnimationFrame but this seems + * to leave a flash of incorrectly styled content. + */ + const now = time.now(); + frameData.delta = motionUtils.clamp(0, 1000 / 60, now - frameData.timestamp); + frameData.timestamp = now; + frameData.isProcessing = true; + frameSteps.update.process(frameData); + frameSteps.preRender.process(frameData); + frameSteps.render.process(frameData); + frameData.isProcessing = false; + } + didUpdate() { + if (!this.updateScheduled) { + this.updateScheduled = true; + microtask.read(this.scheduleUpdate); + } + } + clearAllSnapshots() { + this.nodes.forEach(clearSnapshot); + this.sharedNodes.forEach(removeLeadSnapshots); + } + scheduleUpdateProjection() { + if (!this.projectionUpdateScheduled) { + this.projectionUpdateScheduled = true; + frame.preRender(this.updateProjection, false, true); + } + } + scheduleCheckAfterUnmount() { + /** + * If the unmounting node is in a layoutGroup and did trigger a willUpdate, + * we manually call didUpdate to give a chance to the siblings to animate. + * Otherwise, cleanup all snapshots to prevents future nodes from reusing them. + */ + frame.postRender(() => { + if (this.isLayoutDirty) { + this.root.didUpdate(); + } + else { + this.root.checkUpdateFailed(); + } + }); + } + /** + * Update measurements + */ + updateSnapshot() { + if (this.snapshot || !this.instance) + return; + this.snapshot = this.measure(); + if (this.snapshot && + !calcLength(this.snapshot.measuredBox.x) && + !calcLength(this.snapshot.measuredBox.y)) { + this.snapshot = undefined; + } + } + updateLayout() { + if (!this.instance) + return; + this.updateScroll(); + if (!(this.options.alwaysMeasureLayout && this.isLead()) && + !this.isLayoutDirty) { + return; + } + /** + * When a node is mounted, it simply resumes from the prevLead's + * snapshot instead of taking a new one, but the ancestors scroll + * might have updated while the prevLead is unmounted. We need to + * update the scroll again to make sure the layout we measure is + * up to date. + */ + if (this.resumeFrom && !this.resumeFrom.instance) { + for (let i = 0; i < this.path.length; i++) { + const node = this.path[i]; + node.updateScroll(); + } + } + const prevLayout = this.layout; + this.layout = this.measure(false); + this.layoutVersion++; + if (!this.layoutCorrected) + this.layoutCorrected = createBox(); + this.isLayoutDirty = false; + this.projectionDelta = undefined; + this.notifyListeners("measure", this.layout.layoutBox); + const { visualElement } = this.options; + visualElement && + visualElement.notify("LayoutMeasure", this.layout.layoutBox, prevLayout ? prevLayout.layoutBox : undefined); + } + updateScroll(phase = "measure") { + let needsMeasurement = Boolean(this.options.layoutScroll && this.instance); + if (this.scroll && + this.scroll.animationId === this.root.animationId && + this.scroll.phase === phase) { + needsMeasurement = false; + } + if (needsMeasurement && this.instance) { + const isRoot = checkIsScrollRoot(this.instance); + this.scroll = { + animationId: this.root.animationId, + phase, + isRoot, + offset: measureScroll(this.instance), + wasRoot: this.scroll ? this.scroll.isRoot : isRoot, + }; + } + } + resetTransform() { + if (!resetTransform) + return; + const isResetRequested = this.isLayoutDirty || + this.shouldResetTransform || + this.options.alwaysMeasureLayout; + const hasProjection = this.projectionDelta && !isDeltaZero(this.projectionDelta); + const transformTemplate = this.getTransformTemplate(); + const transformTemplateValue = transformTemplate + ? transformTemplate(this.latestValues, "") + : undefined; + const transformTemplateHasChanged = transformTemplateValue !== this.prevTransformTemplateValue; + if (isResetRequested && + this.instance && + (hasProjection || + hasTransform(this.latestValues) || + transformTemplateHasChanged)) { + resetTransform(this.instance, transformTemplateValue); + this.shouldResetTransform = false; + this.scheduleRender(); + } + } + measure(removeTransform = true) { + const pageBox = this.measurePageBox(); + let layoutBox = this.removeElementScroll(pageBox); + /** + * Measurements taken during the pre-render stage + * still have transforms applied so we remove them + * via calculation. + */ + if (removeTransform) { + layoutBox = this.removeTransform(layoutBox); + } + roundBox(layoutBox); + return { + animationId: this.root.animationId, + measuredBox: pageBox, + layoutBox, + latestValues: {}, + source: this.id, + }; + } + measurePageBox() { + const { visualElement } = this.options; + if (!visualElement) + return createBox(); + const box = visualElement.measureViewportBox(); + const wasInScrollRoot = this.scroll?.wasRoot || this.path.some(checkNodeWasScrollRoot); + if (!wasInScrollRoot) { + // Remove viewport scroll to give page-relative coordinates + const { scroll } = this.root; + if (scroll) { + translateAxis(box.x, scroll.offset.x); + translateAxis(box.y, scroll.offset.y); + } + } + return box; + } + removeElementScroll(box) { + const boxWithoutScroll = createBox(); + copyBoxInto(boxWithoutScroll, box); + if (this.scroll?.wasRoot) { + return boxWithoutScroll; + } + /** + * Performance TODO: Keep a cumulative scroll offset down the tree + * rather than loop back up the path. + */ + for (let i = 0; i < this.path.length; i++) { + const node = this.path[i]; + const { scroll, options } = node; + if (node !== this.root && scroll && options.layoutScroll) { + /** + * If this is a new scroll root, we want to remove all previous scrolls + * from the viewport box. + */ + if (scroll.wasRoot) { + copyBoxInto(boxWithoutScroll, box); + } + translateAxis(boxWithoutScroll.x, scroll.offset.x); + translateAxis(boxWithoutScroll.y, scroll.offset.y); + } + } + return boxWithoutScroll; + } + applyTransform(box, transformOnly = false, output) { + const withTransforms = output || createBox(); + copyBoxInto(withTransforms, box); + for (let i = 0; i < this.path.length; i++) { + const node = this.path[i]; + if (!transformOnly && + node.options.layoutScroll && + node.scroll && + node !== node.root) { + translateAxis(withTransforms.x, -node.scroll.offset.x); + translateAxis(withTransforms.y, -node.scroll.offset.y); + } + if (!hasTransform(node.latestValues)) + continue; + transformBox(withTransforms, node.latestValues, node.layout?.layoutBox); + } + if (hasTransform(this.latestValues)) { + transformBox(withTransforms, this.latestValues, this.layout?.layoutBox); + } + return withTransforms; + } + removeTransform(box) { + const boxWithoutTransform = createBox(); + copyBoxInto(boxWithoutTransform, box); + for (let i = 0; i < this.path.length; i++) { + const node = this.path[i]; + if (!hasTransform(node.latestValues)) + continue; + let sourceBox; + if (node.instance) { + hasScale(node.latestValues) && node.updateSnapshot(); + sourceBox = createBox(); + copyBoxInto(sourceBox, node.measurePageBox()); + } + removeBoxTransforms(boxWithoutTransform, node.latestValues, node.snapshot?.layoutBox, sourceBox); + } + if (hasTransform(this.latestValues)) { + removeBoxTransforms(boxWithoutTransform, this.latestValues); + } + return boxWithoutTransform; + } + setTargetDelta(delta) { + this.targetDelta = delta; + this.root.scheduleUpdateProjection(); + this.isProjectionDirty = true; + } + setOptions(options) { + this.options = { + ...this.options, + ...options, + crossfade: options.crossfade !== undefined ? options.crossfade : true, + }; + } + clearMeasurements() { + this.scroll = undefined; + this.layout = undefined; + this.snapshot = undefined; + this.prevTransformTemplateValue = undefined; + this.targetDelta = undefined; + this.target = undefined; + this.isLayoutDirty = false; + } + forceRelativeParentToResolveTarget() { + if (!this.relativeParent) + return; + /** + * If the parent target isn't up-to-date, force it to update. + * This is an unfortunate de-optimisation as it means any updating relative + * projection will cause all the relative parents to recalculate back + * up the tree. + */ + if (this.relativeParent.resolvedRelativeTargetAt !== + frameData.timestamp) { + this.relativeParent.resolveTargetDelta(true); + } + } + resolveTargetDelta(forceRecalculation = false) { + /** + * Once the dirty status of nodes has been spread through the tree, we also + * need to check if we have a shared node of a different depth that has itself + * been dirtied. + */ + const lead = this.getLead(); + this.isProjectionDirty || (this.isProjectionDirty = lead.isProjectionDirty); + this.isTransformDirty || (this.isTransformDirty = lead.isTransformDirty); + this.isSharedProjectionDirty || (this.isSharedProjectionDirty = lead.isSharedProjectionDirty); + const isShared = Boolean(this.resumingFrom) || this !== lead; + /** + * We don't use transform for this step of processing so we don't + * need to check whether any nodes have changed transform. + */ + const canSkip = !(forceRecalculation || + (isShared && this.isSharedProjectionDirty) || + this.isProjectionDirty || + this.parent?.isProjectionDirty || + this.attemptToResolveRelativeTarget || + this.root.updateBlockedByResize); + if (canSkip) + return; + const { layout, layoutId } = this.options; + /** + * If we have no layout, we can't perform projection, so early return + */ + if (!this.layout || !(layout || layoutId)) + return; + this.resolvedRelativeTargetAt = frameData.timestamp; + const relativeParent = this.getClosestProjectingParent(); + if (relativeParent && + this.linkedParentVersion !== relativeParent.layoutVersion && + !relativeParent.options.layoutRoot) { + this.removeRelativeTarget(); + } + /** + * If we don't have a targetDelta but do have a layout, we can attempt to resolve + * a relativeParent. This will allow a component to perform scale correction + * even if no animation has started. + */ + if (!this.targetDelta && !this.relativeTarget) { + if (this.options.layoutAnchor !== false && + relativeParent && + relativeParent.layout) { + this.createRelativeTarget(relativeParent, this.layout.layoutBox, relativeParent.layout.layoutBox); + } + else { + this.removeRelativeTarget(); + } + } + /** + * If we have no relative target or no target delta our target isn't valid + * for this frame. + */ + if (!this.relativeTarget && !this.targetDelta) + return; + /** + * Lazy-init target data structure + */ + if (!this.target) { + this.target = createBox(); + this.targetWithTransforms = createBox(); + } + /** + * If we've got a relative box for this component, resolve it into a target relative to the parent. + */ + if (this.relativeTarget && + this.relativeTargetOrigin && + this.relativeParent && + this.relativeParent.target) { + this.forceRelativeParentToResolveTarget(); + calcRelativeBox(this.target, this.relativeTarget, this.relativeParent.target, this.options.layoutAnchor || undefined); + /** + * If we've only got a targetDelta, resolve it into a target + */ + } + else if (this.targetDelta) { + if (Boolean(this.resumingFrom)) { + this.applyTransform(this.layout.layoutBox, false, this.target); + } + else { + copyBoxInto(this.target, this.layout.layoutBox); + } + applyBoxDelta(this.target, this.targetDelta); + } + else { + /** + * If no target, use own layout as target + */ + copyBoxInto(this.target, this.layout.layoutBox); + } + /** + * If we've been told to attempt to resolve a relative target, do so. + */ + if (this.attemptToResolveRelativeTarget) { + this.attemptToResolveRelativeTarget = false; + if (this.options.layoutAnchor !== false && + relativeParent && + Boolean(relativeParent.resumingFrom) === + Boolean(this.resumingFrom) && + !relativeParent.options.layoutScroll && + relativeParent.target && + this.animationProgress !== 1) { + this.createRelativeTarget(relativeParent, this.target, relativeParent.target); + } + else { + this.relativeParent = this.relativeTarget = undefined; + } + } + /** + * Increase debug counter for resolved target deltas + */ + if (statsBuffer.value) { + metrics.calculatedTargetDeltas++; + } + } + getClosestProjectingParent() { + if (!this.parent || + hasScale(this.parent.latestValues) || + has2DTranslate(this.parent.latestValues)) { + return undefined; + } + if (this.parent.isProjecting()) { + return this.parent; + } + else { + return this.parent.getClosestProjectingParent(); + } + } + isProjecting() { + return Boolean((this.relativeTarget || + this.targetDelta || + this.options.layoutRoot) && + this.layout); + } + createRelativeTarget(relativeParent, layout, parentLayout) { + this.relativeParent = relativeParent; + this.linkedParentVersion = relativeParent.layoutVersion; + this.forceRelativeParentToResolveTarget(); + this.relativeTarget = createBox(); + this.relativeTargetOrigin = createBox(); + calcRelativePosition(this.relativeTargetOrigin, layout, parentLayout, this.options.layoutAnchor || undefined); + copyBoxInto(this.relativeTarget, this.relativeTargetOrigin); + } + removeRelativeTarget() { + this.relativeParent = this.relativeTarget = undefined; + } + calcProjection() { + const lead = this.getLead(); + const isShared = Boolean(this.resumingFrom) || this !== lead; + let canSkip = true; + /** + * If this is a normal layout animation and neither this node nor its nearest projecting + * is dirty then we can't skip. + */ + if (this.isProjectionDirty || this.parent?.isProjectionDirty) { + canSkip = false; + } + /** + * If this is a shared layout animation and this node's shared projection is dirty then + * we can't skip. + */ + if (isShared && + (this.isSharedProjectionDirty || this.isTransformDirty)) { + canSkip = false; + } + /** + * If we have resolved the target this frame we must recalculate the + * projection to ensure it visually represents the internal calculations. + */ + if (this.resolvedRelativeTargetAt === frameData.timestamp) { + canSkip = false; + } + if (canSkip) + return; + const { layout, layoutId } = this.options; + /** + * If this section of the tree isn't animating we can + * delete our target sources for the following frame. + */ + this.isTreeAnimating = Boolean((this.parent && this.parent.isTreeAnimating) || + this.currentAnimation || + this.pendingAnimation); + if (!this.isTreeAnimating) { + this.targetDelta = this.relativeTarget = undefined; + } + if (!this.layout || !(layout || layoutId)) + return; + /** + * Reset the corrected box with the latest values from box, as we're then going + * to perform mutative operations on it. + */ + copyBoxInto(this.layoutCorrected, this.layout.layoutBox); + /** + * Record previous tree scales before updating. + */ + const prevTreeScaleX = this.treeScale.x; + const prevTreeScaleY = this.treeScale.y; + /** + * Apply all the parent deltas to this box to produce the corrected box. This + * is the layout box, as it will appear on screen as a result of the transforms of its parents. + */ + applyTreeDeltas(this.layoutCorrected, this.treeScale, this.path, isShared); + /** + * If this layer needs to perform scale correction but doesn't have a target, + * use the layout as the target. + */ + if (lead.layout && + !lead.target && + (this.treeScale.x !== 1 || this.treeScale.y !== 1)) { + lead.target = lead.layout.layoutBox; + lead.targetWithTransforms = createBox(); + } + const { target } = lead; + if (!target) { + /** + * If we don't have a target to project into, but we were previously + * projecting, we want to remove the stored transform and schedule + * a render to ensure the elements reflect the removed transform. + */ + if (this.prevProjectionDelta) { + this.createProjectionDeltas(); + this.scheduleRender(); + } + return; + } + if (!this.projectionDelta || !this.prevProjectionDelta) { + this.createProjectionDeltas(); + } + else { + copyAxisDeltaInto(this.prevProjectionDelta.x, this.projectionDelta.x); + copyAxisDeltaInto(this.prevProjectionDelta.y, this.projectionDelta.y); + } + /** + * Update the delta between the corrected box and the target box before user-set transforms were applied. + * This will allow us to calculate the corrected borderRadius and boxShadow to compensate + * for our layout reprojection, but still allow them to be scaled correctly by the user. + * It might be that to simplify this we may want to accept that user-set scale is also corrected + * and we wouldn't have to keep and calc both deltas, OR we could support a user setting + * to allow people to choose whether these styles are corrected based on just the + * layout reprojection or the final bounding box. + */ + calcBoxDelta(this.projectionDelta, this.layoutCorrected, target, this.latestValues); + if (this.treeScale.x !== prevTreeScaleX || + this.treeScale.y !== prevTreeScaleY || + !axisDeltaEquals(this.projectionDelta.x, this.prevProjectionDelta.x) || + !axisDeltaEquals(this.projectionDelta.y, this.prevProjectionDelta.y)) { + this.hasProjected = true; + this.scheduleRender(); + this.notifyListeners("projectionUpdate", target); + } + /** + * Increase debug counter for recalculated projections + */ + if (statsBuffer.value) { + metrics.calculatedProjections++; + } + } + hide() { + this.isVisible = false; + // TODO: Schedule render + } + show() { + this.isVisible = true; + // TODO: Schedule render + } + scheduleRender(notifyAll = true) { + this.options.visualElement?.scheduleRender(); + if (notifyAll) { + const stack = this.getStack(); + stack && stack.scheduleRender(); + } + if (this.resumingFrom && !this.resumingFrom.instance) { + this.resumingFrom = undefined; + } + } + createProjectionDeltas() { + this.prevProjectionDelta = createDelta(); + this.projectionDelta = createDelta(); + this.projectionDeltaWithTransform = createDelta(); + } + setAnimationOrigin(delta, hasOnlyRelativeTargetChanged = false, pathFn) { + const snapshot = this.snapshot; + const snapshotLatestValues = snapshot ? snapshot.latestValues : {}; + const mixedValues = { ...this.latestValues }; + const targetDelta = createDelta(); + if (!this.relativeParent || + !this.relativeParent.options.layoutRoot) { + this.relativeTarget = this.relativeTargetOrigin = undefined; + } + this.attemptToResolveRelativeTarget = !hasOnlyRelativeTargetChanged; + const relativeLayout = createBox(); + const snapshotSource = snapshot ? snapshot.source : undefined; + const layoutSource = this.layout ? this.layout.source : undefined; + const isSharedLayoutAnimation = snapshotSource !== layoutSource; + const stack = this.getStack(); + const isOnlyMember = !stack || stack.members.length <= 1; + const shouldCrossfadeOpacity = Boolean(isSharedLayoutAnimation && + !isOnlyMember && + this.options.crossfade === true && + !this.path.some(hasOpacityCrossfade)); + this.animationProgress = 0; + let prevRelativeTarget; + // The path decides whether the layout shift is worth curving + // (distance floor) and resolves the interpolator from the delta. + const interpolate = pathFn?.interpolateProjection(delta); + this.mixTargetDelta = (latest) => { + const progress = latest / 1000; + const point = interpolate?.(progress); + if (point) { + targetDelta.x.translate = point.x; + targetDelta.x.scale = mixNumber$1(delta.x.scale, 1, progress); + targetDelta.x.origin = delta.x.origin; + targetDelta.x.originPoint = delta.x.originPoint; + targetDelta.y.translate = point.y; + targetDelta.y.scale = mixNumber$1(delta.y.scale, 1, progress); + targetDelta.y.origin = delta.y.origin; + targetDelta.y.originPoint = delta.y.originPoint; + } + else { + mixAxisDeltaLinear(targetDelta.x, delta.x, progress); + mixAxisDeltaLinear(targetDelta.y, delta.y, progress); + } + this.setTargetDelta(targetDelta); + if (this.relativeTarget && + this.relativeTargetOrigin && + this.layout && + this.relativeParent && + this.relativeParent.layout) { + calcRelativePosition(relativeLayout, this.layout.layoutBox, this.relativeParent.layout.layoutBox, this.options.layoutAnchor || undefined); + mixBox(this.relativeTarget, this.relativeTargetOrigin, relativeLayout, progress); + /** + * If this is an unchanged relative target we can consider the + * projection not dirty. + */ + if (prevRelativeTarget && + boxEquals(this.relativeTarget, prevRelativeTarget)) { + this.isProjectionDirty = false; + } + if (!prevRelativeTarget) + prevRelativeTarget = createBox(); + copyBoxInto(prevRelativeTarget, this.relativeTarget); + } + if (isSharedLayoutAnimation) { + this.animationValues = mixedValues; + mixValues(mixedValues, snapshotLatestValues, this.latestValues, progress, shouldCrossfadeOpacity, isOnlyMember); + } + if (point && point.rotate !== undefined) { + // Dedicated `pathRotation` channel, not `rotate`, so an + // animating `rotate` is composed with, never clobbered. + if (!this.animationValues) + this.animationValues = mixedValues; + this.animationValues.pathRotation = point.rotate; + } + this.root.scheduleUpdateProjection(); + this.scheduleRender(); + this.animationProgress = progress; + }; + this.mixTargetDelta(this.options.layoutRoot ? 1000 : 0); + } + startAnimation(options) { + this.notifyListeners("animationStart"); + this.currentAnimation?.stop(); + this.resumingFrom?.currentAnimation?.stop(); + if (this.pendingAnimation) { + cancelFrame(this.pendingAnimation); + this.pendingAnimation = undefined; + } + /** + * Start the animation in the next frame to have a frame with progress 0, + * where the target is the same as when the animation started, so we can + * calculate the relative positions correctly for instant transitions. + */ + this.pendingAnimation = frame.update(() => { + globalProjectionState.hasAnimatedSinceResize = true; + this.motionValue || (this.motionValue = motionValue(0)); + this.motionValue.jump(0, false); + this.currentAnimation = animateSingleValue(this.motionValue, [0, 1000], { + ...options, + velocity: 0, + isSync: true, + onUpdate: (latest) => { + this.mixTargetDelta(latest); + options.onUpdate && options.onUpdate(latest); + }, + onComplete: () => { + options.onComplete && options.onComplete(); + this.completeAnimation(); + }, + }); + if (this.resumingFrom) { + this.resumingFrom.currentAnimation = this.currentAnimation; + } + this.pendingAnimation = undefined; + }); + } + completeAnimation() { + if (this.resumingFrom) { + this.resumingFrom.currentAnimation = undefined; + this.resumingFrom.preserveOpacity = undefined; + } + const stack = this.getStack(); + stack && stack.exitAnimationComplete(); + this.resumingFrom = + this.currentAnimation = + this.animationValues = + undefined; + this.notifyListeners("animationComplete"); + } + finishAnimation() { + if (this.currentAnimation) { + this.mixTargetDelta && this.mixTargetDelta(animationTarget); + this.currentAnimation.stop(); + } + this.completeAnimation(); + } + applyTransformsToTarget() { + const lead = this.getLead(); + let { targetWithTransforms, target, layout, latestValues } = lead; + if (!targetWithTransforms || !target || !layout) + return; + /** + * If we're only animating position, and this element isn't the lead element, + * then instead of projecting into the lead box we instead want to calculate + * a new target that aligns the two boxes but maintains the layout shape. + */ + if (this !== lead && + this.layout && + layout && + shouldAnimatePositionOnly(this.options.animationType, this.layout.layoutBox, layout.layoutBox)) { + target = this.target || createBox(); + const xLength = calcLength(this.layout.layoutBox.x); + target.x.min = lead.target.x.min; + target.x.max = target.x.min + xLength; + const yLength = calcLength(this.layout.layoutBox.y); + target.y.min = lead.target.y.min; + target.y.max = target.y.min + yLength; + } + copyBoxInto(targetWithTransforms, target); + /** + * Apply the latest user-set transforms to the targetBox to produce the targetBoxFinal. + * This is the final box that we will then project into by calculating a transform delta and + * applying it to the corrected box. + */ + transformBox(targetWithTransforms, latestValues); + /** + * Update the delta between the corrected box and the final target box, after + * user-set transforms are applied to it. This will be used by the renderer to + * create a transform style that will reproject the element from its layout layout + * into the desired bounding box. + */ + calcBoxDelta(this.projectionDeltaWithTransform, this.layoutCorrected, targetWithTransforms, latestValues); + } + registerSharedNode(layoutId, node) { + if (!this.sharedNodes.has(layoutId)) { + this.sharedNodes.set(layoutId, new NodeStack()); + } + const stack = this.sharedNodes.get(layoutId); + stack.add(node); + const config = node.options.initialPromotionConfig; + node.promote({ + transition: config ? config.transition : undefined, + preserveFollowOpacity: config && config.shouldPreserveFollowOpacity + ? config.shouldPreserveFollowOpacity(node) + : undefined, + }); + } + isLead() { + const stack = this.getStack(); + return stack ? stack.lead === this : true; + } + getLead() { + const { layoutId } = this.options; + return layoutId ? this.getStack()?.lead || this : this; + } + getPrevLead() { + const { layoutId } = this.options; + return layoutId ? this.getStack()?.prevLead : undefined; + } + getStack() { + const { layoutId } = this.options; + if (layoutId) + return this.root.sharedNodes.get(layoutId); + } + promote({ needsReset, transition, preserveFollowOpacity, } = {}) { + const stack = this.getStack(); + if (stack) + stack.promote(this, preserveFollowOpacity); + if (needsReset) { + this.projectionDelta = undefined; + this.needsReset = true; + } + if (transition) + this.setOptions({ transition }); + } + relegate() { + const stack = this.getStack(); + if (stack) { + return stack.relegate(this); + } + else { + return false; + } + } + resetSkewAndRotation() { + const { visualElement } = this.options; + if (!visualElement) + return; + // If there's no detected skew or rotation values, we can early return without a forced render. + let hasDistortingTransform = false; + /** + * An unrolled check for rotation values. Most elements don't have any rotation and + * skipping the nested loop and new object creation is 50% faster. + */ + const { latestValues } = visualElement; + if (latestValues.z || + latestValues.rotate || + latestValues.rotateX || + latestValues.rotateY || + latestValues.rotateZ || + latestValues.skewX || + latestValues.skewY) { + hasDistortingTransform = true; + } + // If there's no distorting values, we don't need to do any more. + if (!hasDistortingTransform) + return; + const resetValues = {}; + if (latestValues.z) { + resetDistortingTransform("z", visualElement, resetValues, this.animationValues); + } + // Check the skew and rotate value of all axes and reset to 0 + for (let i = 0; i < transformAxes.length; i++) { + resetDistortingTransform(`rotate${transformAxes[i]}`, visualElement, resetValues, this.animationValues); + resetDistortingTransform(`skew${transformAxes[i]}`, visualElement, resetValues, this.animationValues); + } + // Force a render of this element to apply the transform with all skews and rotations + // set to 0. + visualElement.render(); + // Put back all the values we reset + for (const key in resetValues) { + visualElement.setStaticValue(key, resetValues[key]); + if (this.animationValues) { + this.animationValues[key] = resetValues[key]; + } + } + // Schedule a render for the next frame. This ensures we won't visually + // see the element with the reset rotate value applied. + visualElement.scheduleRender(); + } + applyProjectionStyles(targetStyle, // CSSStyleDeclaration - doesn't allow numbers to be assigned to properties + styleProp) { + if (!this.instance || this.isSVG) + return; + if (!this.isVisible) { + targetStyle.visibility = "hidden"; + return; + } + const transformTemplate = this.getTransformTemplate(); + if (this.needsReset) { + this.needsReset = false; + targetStyle.visibility = ""; + targetStyle.opacity = ""; + targetStyle.pointerEvents = + resolveMotionValue(styleProp?.pointerEvents) || ""; + targetStyle.transform = transformTemplate + ? transformTemplate(this.latestValues, "") + : "none"; + return; + } + const lead = this.getLead(); + if (!this.projectionDelta || !this.layout || !lead.target) { + if (this.options.layoutId) { + targetStyle.opacity = + this.latestValues.opacity !== undefined + ? this.latestValues.opacity + : 1; + targetStyle.pointerEvents = + resolveMotionValue(styleProp?.pointerEvents) || ""; + } + if (this.hasProjected && !hasTransform(this.latestValues)) { + targetStyle.transform = transformTemplate + ? transformTemplate({}, "") + : "none"; + this.hasProjected = false; + } + return; + } + targetStyle.visibility = ""; + const valuesToRender = lead.animationValues || lead.latestValues; + this.applyTransformsToTarget(); + let transform = buildProjectionTransform(this.projectionDeltaWithTransform, this.treeScale, valuesToRender); + if (transformTemplate) { + transform = transformTemplate(valuesToRender, transform); + } + targetStyle.transform = transform; + const { x, y } = this.projectionDelta; + targetStyle.transformOrigin = `${x.origin * 100}% ${y.origin * 100}% 0`; + if (lead.animationValues) { + /** + * If the lead component is animating, assign this either the entering/leaving + * opacity + */ + targetStyle.opacity = + lead === this + ? valuesToRender.opacity ?? + this.latestValues.opacity ?? + 1 + : this.preserveOpacity + ? this.latestValues.opacity + : valuesToRender.opacityExit; + } + else { + /** + * Or we're not animating at all, set the lead component to its layout + * opacity and other components to hidden. + */ + targetStyle.opacity = + lead === this + ? valuesToRender.opacity !== undefined + ? valuesToRender.opacity + : "" + : valuesToRender.opacityExit !== undefined + ? valuesToRender.opacityExit + : 0; + } + /** + * Apply scale correction + */ + for (const key in scaleCorrectors) { + if (valuesToRender[key] === undefined) + continue; + const { correct, applyTo, isCSSVariable } = scaleCorrectors[key]; + /** + * Only apply scale correction to the value if we have an + * active projection transform. Otherwise these values become + * vulnerable to distortion if the element changes size without + * a corresponding layout animation. + */ + const corrected = transform === "none" + ? valuesToRender[key] + : correct(valuesToRender[key], lead); + if (applyTo) { + const num = applyTo.length; + for (let i = 0; i < num; i++) { + targetStyle[applyTo[i]] = corrected; + } + } + else { + // If this is a CSS variable, set it directly on the instance. + // Replacing this function from creating styles to setting them + // would be a good place to remove per frame object creation + if (isCSSVariable) { + this.options.visualElement.renderState.vars[key] = corrected; + } + else { + targetStyle[key] = corrected; + } + } + } + /** + * Disable pointer events on follow components. This is to ensure + * that if a follow component covers a lead component it doesn't block + * pointer events on the lead. + */ + if (this.options.layoutId) { + targetStyle.pointerEvents = + lead === this + ? resolveMotionValue(styleProp?.pointerEvents) || "" + : "none"; + } + } + clearSnapshot() { + this.resumeFrom = this.snapshot = undefined; + } + // Only run on root + resetTree() { + this.root.nodes.forEach((node) => node.currentAnimation?.stop()); + this.root.nodes.forEach(clearMeasurements); + this.root.sharedNodes.clear(); + } + }; + } + function updateLayout(node) { + node.updateLayout(); + } + function notifyLayoutUpdate(node) { + const snapshot = node.resumeFrom?.snapshot || node.snapshot; + if (node.isLead() && + node.layout && + snapshot && + node.hasListeners("didUpdate")) { + const { layoutBox: layout, measuredBox: measuredLayout } = node.layout; + const { animationType } = node.options; + const isShared = snapshot.source !== node.layout.source; + // TODO Maybe we want to also resize the layout snapshot so we don't trigger + // animations for instance if layout="size" and an element has only changed position + if (animationType === "size") { + eachAxis((axis) => { + const axisSnapshot = isShared + ? snapshot.measuredBox[axis] + : snapshot.layoutBox[axis]; + const length = calcLength(axisSnapshot); + axisSnapshot.min = layout[axis].min; + axisSnapshot.max = axisSnapshot.min + length; + }); + } + else if (animationType === "x" || animationType === "y") { + const snapAxis = animationType === "x" ? "y" : "x"; + copyAxisInto(isShared + ? snapshot.measuredBox[snapAxis] + : snapshot.layoutBox[snapAxis], layout[snapAxis]); + } + else if (shouldAnimatePositionOnly(animationType, snapshot.layoutBox, layout)) { + eachAxis((axis) => { + const axisSnapshot = isShared + ? snapshot.measuredBox[axis] + : snapshot.layoutBox[axis]; + const length = calcLength(layout[axis]); + axisSnapshot.max = axisSnapshot.min + length; + /** + * Ensure relative target gets resized and rerendererd + */ + if (node.relativeTarget && !node.currentAnimation) { + node.isProjectionDirty = true; + node.relativeTarget[axis].max = + node.relativeTarget[axis].min + length; + } + }); + } + const layoutDelta = createDelta(); + calcBoxDelta(layoutDelta, layout, snapshot.layoutBox); + const visualDelta = createDelta(); + if (isShared) { + calcBoxDelta(visualDelta, node.applyTransform(measuredLayout, true), snapshot.measuredBox); + } + else { + calcBoxDelta(visualDelta, layout, snapshot.layoutBox); + } + const hasLayoutChanged = !isDeltaZero(layoutDelta); + let hasRelativeLayoutChanged = false; + if (!node.resumeFrom) { + const relativeParent = node.getClosestProjectingParent(); + /** + * If the relativeParent is itself resuming from a different element then + * the relative snapshot is not relavent + */ + if (relativeParent && !relativeParent.resumeFrom) { + const { snapshot: parentSnapshot, layout: parentLayout } = relativeParent; + if (parentSnapshot && parentLayout) { + const anchor = node.options.layoutAnchor || undefined; + const relativeSnapshot = createBox(); + calcRelativePosition(relativeSnapshot, snapshot.layoutBox, parentSnapshot.layoutBox, anchor); + const relativeLayout = createBox(); + calcRelativePosition(relativeLayout, layout, parentLayout.layoutBox, anchor); + if (!boxEqualsRounded(relativeSnapshot, relativeLayout)) { + hasRelativeLayoutChanged = true; + } + if (relativeParent.options.layoutRoot) { + node.relativeTarget = relativeLayout; + node.relativeTargetOrigin = relativeSnapshot; + node.relativeParent = relativeParent; + } + } + } + } + node.notifyListeners("didUpdate", { + layout, + snapshot, + delta: visualDelta, + layoutDelta, + hasLayoutChanged, + hasRelativeLayoutChanged, + }); + } + else if (node.isLead()) { + const { onExitComplete } = node.options; + onExitComplete && onExitComplete(); + } + /** + * Clearing transition + * TODO: Investigate why this transition is being passed in as {type: false } from Framer + * and why we need it at all + */ + node.options.transition = undefined; + } + function propagateDirtyNodes(node) { + /** + * Increase debug counter for nodes encountered this frame + */ + if (statsBuffer.value) { + metrics.nodes++; + } + if (!node.parent) + return; + /** + * If this node isn't projecting, propagate isProjectionDirty. It will have + * no performance impact but it will allow the next child that *is* projecting + * but *isn't* dirty to just check its parent to see if *any* ancestor needs + * correcting. + */ + if (!node.isProjecting()) { + node.isProjectionDirty = node.parent.isProjectionDirty; + } + /** + * Propagate isSharedProjectionDirty and isTransformDirty + * throughout the whole tree. A future revision can take another look at + * this but for safety we still recalcualte shared nodes. + */ + node.isSharedProjectionDirty || (node.isSharedProjectionDirty = Boolean(node.isProjectionDirty || + node.parent.isProjectionDirty || + node.parent.isSharedProjectionDirty)); + node.isTransformDirty || (node.isTransformDirty = node.parent.isTransformDirty); + } + function cleanDirtyNodes(node) { + node.isProjectionDirty = + node.isSharedProjectionDirty = + node.isTransformDirty = + false; + } + function clearSnapshot(node) { + node.clearSnapshot(); + } + function clearMeasurements(node) { + node.clearMeasurements(); + } + function forceLayoutMeasure(node) { + node.isLayoutDirty = true; + node.updateLayout(); + } + function clearIsLayoutDirty(node) { + node.isLayoutDirty = false; + } + /** + * When a node is animation-blocked (e.g. during drag) and its component + * didn't re-render (memoized), willUpdate() is never called so there's + * no snapshot. Use the previous layout as a snapshot and mark dirty so + * resetTransform/updateLayout/notifyLayoutUpdate process it normally. + */ + function ensureDraggedNodesSnapshotted(node) { + if (node.isAnimationBlocked && node.layout && !node.isLayoutDirty) { + node.snapshot = node.layout; + node.isLayoutDirty = true; + } + } + function resetTransformStyle(node) { + const { visualElement } = node.options; + if (visualElement && visualElement.getProps().onBeforeLayoutMeasure) { + visualElement.notify("BeforeLayoutMeasure"); + } + node.resetTransform(); + } + function finishAnimation(node) { + node.finishAnimation(); + node.targetDelta = node.relativeTarget = node.target = undefined; + node.isProjectionDirty = true; + } + function resolveTargetDelta(node) { + node.resolveTargetDelta(); + } + function calcProjection(node) { + node.calcProjection(); + } + function resetSkewAndRotation(node) { + node.resetSkewAndRotation(); + } + function removeLeadSnapshots(stack) { + stack.removeLeadSnapshot(); + } + function mixAxisDeltaLinear(output, delta, p) { + output.translate = mixNumber$1(delta.translate, 0, p); + output.scale = mixNumber$1(delta.scale, 1, p); + output.origin = delta.origin; + output.originPoint = delta.originPoint; + } + function mixAxis(output, from, to, p) { + output.min = mixNumber$1(from.min, to.min, p); + output.max = mixNumber$1(from.max, to.max, p); + } + function mixBox(output, from, to, p) { + mixAxis(output.x, from.x, to.x, p); + mixAxis(output.y, from.y, to.y, p); + } + function hasOpacityCrossfade(node) { + return (node.animationValues && node.animationValues.opacityExit !== undefined); + } + const defaultLayoutTransition = { + duration: 0.45, + ease: [0.4, 0, 0.1, 1], + }; + const userAgentContains = (string) => typeof navigator !== "undefined" && + navigator.userAgent && + navigator.userAgent.toLowerCase().includes(string); + /** + * Measured bounding boxes must be rounded in Safari and + * left untouched in Chrome, otherwise non-integer layouts within scaled-up elements + * can appear to jump. + */ + const roundPoint = userAgentContains("applewebkit/") && !userAgentContains("chrome/") + ? Math.round + : motionUtils.noop; + function roundAxis(axis) { + // Round to the nearest .5 pixels to support subpixel layouts + axis.min = roundPoint(axis.min); + axis.max = roundPoint(axis.max); + } + function roundBox(box) { + roundAxis(box.x); + roundAxis(box.y); + } + function shouldAnimatePositionOnly(animationType, snapshot, layout) { + return (animationType === "position" || + (animationType === "preserve-aspect" && + !isNear(aspectRatio(snapshot), aspectRatio(layout), 0.2))); + } + function checkNodeWasScrollRoot(node) { + return node !== node.root && node.scroll?.wasRoot; + } + + const DocumentProjectionNode = createProjectionNode({ + attachResizeListener: (ref, notify) => addDomEvent(ref, "resize", notify), + measureScroll: () => ({ + x: document.documentElement.scrollLeft || document.body?.scrollLeft || 0, + y: document.documentElement.scrollTop || document.body?.scrollTop || 0, + }), + checkIsScrollRoot: () => true, + }); + + const notify = (node) => !node.isLayoutDirty && node.willUpdate(false); + function nodeGroup() { + const nodes = new Set(); + const subscriptions = new WeakMap(); + const dirtyAll = () => nodes.forEach(notify); + return { + add: (node) => { + nodes.add(node); + subscriptions.set(node, node.addEventListener("willUpdate", dirtyAll)); + }, + remove: (node) => { + nodes.delete(node); + const unsubscribe = subscriptions.get(node); + if (unsubscribe) { + unsubscribe(); + subscriptions.delete(node); + } + dirtyAll(); + }, + dirty: dirtyAll, + }; + } + + const rootProjectionNode = { + current: undefined, + }; + const HTMLProjectionNode = createProjectionNode({ + measureScroll: (instance) => ({ + x: instance.scrollLeft, + y: instance.scrollTop, + }), + defaultParent: () => { + if (!rootProjectionNode.current) { + const documentNode = new DocumentProjectionNode({}); + documentNode.mount(window); + documentNode.setOptions({ layoutScroll: true }); + rootProjectionNode.current = documentNode; + } + return rootProjectionNode.current; + }, + resetTransform: (instance, value) => { + instance.style.transform = value !== undefined ? value : "none"; + }, + checkIsScrollRoot: (instance) => Boolean(window.getComputedStyle(instance).position === "fixed"), + }); + + const layoutSelector = "[data-layout],[data-layout-id]"; + /** + * All imperatively-created projection nodes live in one persistent tree, + * shared across animateLayout() calls (and with any React-created nodes, + * via the singleton document root). Keyed by element for reuse. + */ + const layoutNodes = new WeakMap(); + /** + * Builders created within the same synchronous tick are flushed together + * as a single "commit": every node is snapshotted before any updateDom + * runs, mirroring React batching renders from different parts of the tree. + */ + let pendingBuilders; + function collectLayoutElements(scope) { + const elements = []; + if (scope instanceof HTMLElement && scope.matches(layoutSelector)) { + elements.push(scope); + } + scope.querySelectorAll(layoutSelector).forEach((element) => { + if (element instanceof HTMLElement) + elements.push(element); + }); + return elements; + } + /** + * Process any work scheduled on the frameloop now. A previous animation + * may have been seeked while paused (controls.time = x) without a frame + * having rendered it - we must materialise that state into the DOM + * before taking snapshots. + */ + function flushPendingFrame() { + if (frameData.isProcessing) + return; + const now = time.now(); + frameData.delta = motionUtils.clamp(0, 1000 / 60, now - frameData.timestamp); + frameData.timestamp = now; + frameData.isProcessing = true; + frameSteps.update.process(frameData); + frameSteps.preRender.process(frameData); + frameSteps.render.process(frameData); + frameData.isProcessing = false; + } + function getProjectionParent(element) { + let ancestor = element.parentElement; + while (ancestor) { + const node = layoutNodes.get(ancestor); + if (node && node.instance) + return node; + ancestor = ancestor.parentElement; + } + return undefined; + } + function createVisualElement() { + return new HTMLVisualElement({ + props: {}, + presenceContext: null, + visualState: { + latestValues: {}, + renderState: { + transform: {}, + transformOrigin: {}, + style: {}, + vars: {}, + }, + }, + }, { allowProjection: true }); + } + function readNodeOptions(element, transition) { + const layoutAttr = element.getAttribute("data-layout"); + const layoutId = element.getAttribute("data-layout-id") ?? undefined; + return { + layoutId, + layout: layoutAttr !== null ? true : undefined, + animationType: (!layoutAttr || layoutAttr === "true" + ? "both" + : layoutAttr), + transition, + }; + } + function prepareNode(element, transition) { + let node = layoutNodes.get(element); + if (!node) { + let visualElement = visualElementStore.get(element); + if (!visualElement) + visualElement = createVisualElement(); + /** + * A first-time element may carry a projection transform in its + * inline style (e.g. it was cloned from an element mid-animation). + * That transform isn't tracked in latestValues so the engine can't + * reset it before measuring - clear it now so the first layout + * measurement isn't inflated. + */ + if (element.style.transform && + !hasTransform(visualElement.latestValues)) { + element.style.transform = ""; + } + node = new HTMLProjectionNode(visualElement.latestValues, getProjectionParent(element)); + visualElement.projection = node; + node.setOptions({ + ...readNodeOptions(element, transition), + visualElement, + }); + node.mount(element); + layoutNodes.set(element, node); + } + else { + node.setOptions(readNodeOptions(element, transition)); + } + node.isPresent = true; + if (node.options.onExitComplete) { + node.setOptions({ onExitComplete: undefined }); + } + return node; + } + function sortDocumentOrder(elements) { + return [...elements].sort((a, b) => a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1); + } + function dropNode(element, node) { + node.setOptions({ onExitComplete: undefined }); + /** + * Stop any lingering animation so it can't leak into future updates. + * A follow node can share its currentAnimation with a surviving lead + * (via resumingFrom), in which case it isn't ours to stop. + */ + const stack = node.getStack(); + if (!stack || node.isLead()) + node.currentAnimation?.stop(); + node.unmount(); + layoutNodes.delete(element); + } + function flushPendingBuilders() { + const builders = pendingBuilders; + pendingBuilders = undefined; + flushPendingFrame(); + /** + * Discover and mount every node across all builders before snapshotting + * any of them. Mounting during an active update flags isLayoutDirty, + * which would make that node's own willUpdate skip its snapshot. + * Document order guarantees ancestors mount before descendants, even + * when they're discovered by different builders. + */ + const targets = new Map(); + for (const builder of builders) { + for (const element of builder.collectTargets()) { + const owners = targets.get(element); + owners ? owners.push(builder) : targets.set(element, [builder]); + } + } + const union = new Map(); + for (const element of sortDocumentOrder(targets.keys())) { + const owners = targets.get(element); + const node = prepareNode(element, owners[owners.length - 1].transitionFor(element)); + for (const owner of owners) + owner.adopt(element, node); + union.set(element, node); + } + union.forEach((node) => { + node.isLayoutDirty = false; + node.willUpdate(); + }); + const updatePromises = []; + for (const builder of builders) { + const result = builder.runUpdate(); + if (result) + updatePromises.push(result); + } + const commit = () => { + /** + * Process all additions before any removals so that, even across + * builders, a removed member knows whether a replacement with the + * same layoutId was added in this commit. + */ + const newMemberIds = new Set(); + for (const builder of builders) { + builder.reconcileAdditions(newMemberIds); + } + for (const builder of builders) { + builder.reconcileRemovals(newMemberIds); + } + let root; + union.forEach((node) => (root || (root = node.root))); + for (const builder of builders) + root || (root = builder.getRoot()); + root?.didUpdate(); + /** + * The root flushes the update on a microtask, synchronously + * processing the frame that creates the layout animations. Collect + * them in a later microtask step of the same pass. + */ + microtask.render(() => { + for (const builder of builders) + builder.finalize(); + }); + }; + updatePromises.length ? Promise.all(updatePromises).then(commit) : commit(); + } + class LayoutAnimationBuilder { + constructor(scope, updateDom, defaultOptions) { + this.scope = scope; + this.updateDom = updateDom; + this.defaultOptions = defaultOptions; + this.sharedTransitions = new Map(); + this.notifyReady = () => { }; + this.rejectReady = () => { }; + this.tracked = new Map(); + this.restorePoints = new Map(); + this.readyPromise = new Promise((resolve, reject) => { + this.notifyReady = resolve; + this.rejectReady = reject; + }); + if (!pendingBuilders) { + pendingBuilders = []; + queueMicrotask(flushPendingBuilders); + } + pendingBuilders.push(this); + } + shared(id, transition) { + this.sharedTransitions.set(id, transition); + return this; + } + then(resolve, reject) { + return this.readyPromise.then(resolve, reject); + } + transitionFor(element) { + const layoutId = element.getAttribute("data-layout-id"); + return ((layoutId && this.sharedTransitions.get(layoutId)) || + this.defaultOptions); + } + adopt(element, node) { + this.tracked.set(element, node); + this.restorePoints.set(element, { + parent: element.parentElement, + next: element.nextSibling, + }); + } + collectTargets() { + return collectLayoutElements(this.scope); + } + runUpdate() { + try { + const result = this.updateDom(); + if (result && typeof result.then === "function") { + return result.then(undefined, (error) => { + this.updateError = error; + }); + } + } + catch (error) { + this.updateError = error; + } + return undefined; + } + reconcileAdditions(newMemberIds) { + for (const element of collectLayoutElements(this.scope)) { + if (this.tracked.has(element)) + continue; + const node = prepareNode(element, this.transitionFor(element)); + this.adopt(element, node); + node.options.layoutId && newMemberIds.add(node.options.layoutId); + } + } + reconcileRemovals(newMemberIds) { + this.tracked.forEach((node, element) => { + if (element.isConnected) + return; + const restore = this.restorePoints.get(element); + this.restorePoints.delete(element); + const { layoutId } = node.options; + const stack = node.getStack(); + const hasSurvivor = stack && + stack.members.some((member) => member !== node && + member.instance + ?.isConnected); + /** + * A removed lead with a surviving stack member - and no + * replacement member added this commit - runs an exit + * crossfade: restore the element to its old position in the + * DOM, relegate it and let the survivor take over. It's + * removed again once the animation completes. + */ + if (layoutId && + node.isLead() && + hasSurvivor && + !newMemberIds.has(layoutId)) { + if (restore && restore.parent.isConnected) { + restore.parent.insertBefore(element, restore.next && restore.next.parentNode === restore.parent + ? restore.next + : null); + node.isPresent = false; + node.setOptions({ + onExitComplete: () => { + element.remove(); + dropNode(element, node); + }, + }); + if (node.relegate()) + return; + element.remove(); + } + } + dropNode(element, node); + this.tracked.delete(element); + }); + } + getRoot() { + let root; + this.tracked.forEach((node) => (root || (root = node.root))); + return root; + } + finalize() { + if (this.updateError) { + this.rejectReady(this.updateError); + return; + } + const animations = new Set(); + this.tracked.forEach((node) => { + if (node.instance && node.currentAnimation) { + animations.add(node.currentAnimation); + } + }); + this.notifyReady(new GroupAnimation([...animations])); + } + } + function parseAnimateLayoutArgs(scopeOrUpdateDom, updateDomOrOptions, options) { + if (typeof scopeOrUpdateDom === "function") { + return { + scope: document, + updateDom: scopeOrUpdateDom, + defaultOptions: updateDomOrOptions, + }; + } + const scope = scopeOrUpdateDom instanceof Document + ? scopeOrUpdateDom + : resolveElements(scopeOrUpdateDom)[0] ?? document; + return { + scope, + updateDom: updateDomOrOptions, + defaultOptions: options, + }; + } + + /** + * @deprecated + * + * Import as `frame` instead. + */ + const sync = frame; + /** + * @deprecated + * + * Use cancelFrame(callback) instead. + */ + const cancelSync = stepsOrder.reduce((acc, key) => { + acc[key] = (process) => cancelFrame(process); + return acc; + }, {}); + + exports.AsyncMotionValueAnimation = AsyncMotionValueAnimation; + exports.DOMKeyframesResolver = DOMKeyframesResolver; + exports.DOMVisualElement = DOMVisualElement; + exports.DocumentProjectionNode = DocumentProjectionNode; + exports.Feature = Feature; + exports.FlatTree = FlatTree; + exports.GroupAnimation = GroupAnimation; + exports.GroupAnimationWithThen = GroupAnimationWithThen; + exports.HTMLProjectionNode = HTMLProjectionNode; + exports.HTMLVisualElement = HTMLVisualElement; + exports.JSAnimation = JSAnimation; + exports.KeyframeResolver = KeyframeResolver; + exports.LayoutAnimationBuilder = LayoutAnimationBuilder; + exports.MotionValue = MotionValue; + exports.NativeAnimation = NativeAnimation; + exports.NativeAnimationExtended = NativeAnimationExtended; + exports.NativeAnimationWrapper = NativeAnimationWrapper; + exports.NodeStack = NodeStack; + exports.ObjectVisualElement = ObjectVisualElement; + exports.SVGVisualElement = SVGVisualElement; + exports.ViewTransitionBuilder = ViewTransitionBuilder; + exports.VisualElement = VisualElement; + exports.acceleratedValues = acceleratedValues; + exports.addAttrValue = addAttrValue; + exports.addDomEvent = addDomEvent; + exports.addScaleCorrector = addScaleCorrector; + exports.addStyleValue = addStyleValue; + exports.addValueToWillChange = addValueToWillChange; + exports.alpha = alpha; + exports.analyseComplexValue = analyseComplexValue; + exports.animateMotionValue = animateMotionValue; + exports.animateSingleValue = animateSingleValue; + exports.animateTarget = animateTarget; + exports.animateValue = animateValue; + exports.animateVariant = animateVariant; + exports.animateView = animateView; + exports.animateVisualElement = animateVisualElement; + exports.animationMapKey = animationMapKey; + exports.applyAxisDelta = applyAxisDelta; + exports.applyBoxDelta = applyBoxDelta; + exports.applyGeneratorOptions = applyGeneratorOptions; + exports.applyPointDelta = applyPointDelta; + exports.applyPxDefaults = applyPxDefaults; + exports.applyTreeDeltas = applyTreeDeltas; + exports.arc = arc; + exports.aspectRatio = aspectRatio; + exports.attachFollow = attachFollow; + exports.attachSpring = attachSpring; + exports.attrEffect = attrEffect; + exports.axisDeltaEquals = axisDeltaEquals; + exports.axisEquals = axisEquals; + exports.axisEqualsRounded = axisEqualsRounded; + exports.boxEquals = boxEquals; + exports.boxEqualsRounded = boxEqualsRounded; + exports.buildHTMLStyles = buildHTMLStyles; + exports.buildProjectionTransform = buildProjectionTransform; + exports.buildSVGAttrs = buildSVGAttrs; + exports.buildSVGPath = buildSVGPath; + exports.buildTransform = buildTransform; + exports.calcAxisDelta = calcAxisDelta; + exports.calcBoxDelta = calcBoxDelta; + exports.calcChildStagger = calcChildStagger; + exports.calcGeneratorDuration = calcGeneratorDuration; + exports.calcLength = calcLength; + exports.calcRelativeAxis = calcRelativeAxis; + exports.calcRelativeAxisPosition = calcRelativeAxisPosition; + exports.calcRelativeBox = calcRelativeBox; + exports.calcRelativePosition = calcRelativePosition; + exports.camelCaseAttributes = camelCaseAttributes; + exports.camelToDash = camelToDash; + exports.cancelFrame = cancelFrame; + exports.cancelMicrotask = cancelMicrotask; + exports.cancelSync = cancelSync; + exports.checkVariantsDidChange = checkVariantsDidChange; + exports.cleanDirtyNodes = cleanDirtyNodes; + exports.collectMotionValues = collectMotionValues; + exports.color = color; + exports.compareByDepth = compareByDepth; + exports.complex = complex; + exports.containsCSSVariable = containsCSSVariable; + exports.convertBoundingBoxToBox = convertBoundingBoxToBox; + exports.convertBoxToBoundingBox = convertBoxToBoundingBox; + exports.convertOffsetToTimes = convertOffsetToTimes; + exports.copyAxisDeltaInto = copyAxisDeltaInto; + exports.copyAxisInto = copyAxisInto; + exports.copyBoxInto = copyBoxInto; + exports.correctBorderRadius = correctBorderRadius; + exports.correctBoxShadow = correctBoxShadow; + exports.createAnimationState = createAnimationState; + exports.createAxis = createAxis; + exports.createAxisDelta = createAxisDelta; + exports.createBox = createBox; + exports.createDelta = createDelta; + exports.createGeneratorEasing = createGeneratorEasing; + exports.createProjectionNode = createProjectionNode; + exports.createRenderBatcher = createRenderBatcher; + exports.cubicBezierAsString = cubicBezierAsString; + exports.defaultEasing = defaultEasing; + exports.defaultOffset = defaultOffset; + exports.defaultTransformValue = defaultTransformValue; + exports.defaultValueTypes = defaultValueTypes; + exports.degrees = degrees; + exports.delay = delay; + exports.delayInSeconds = delayInSeconds; + exports.dimensionValueTypes = dimensionValueTypes; + exports.eachAxis = eachAxis; + exports.fillOffset = fillOffset; + exports.fillWildcards = fillWildcards; + exports.findDimensionValueType = findDimensionValueType; + exports.findValueType = findValueType; + exports.flushKeyframeResolvers = flushKeyframeResolvers; + exports.followValue = followValue; + exports.frame = frame; + exports.frameData = frameData; + exports.frameSteps = frameSteps; + exports.generateLinearEasing = generateLinearEasing; + exports.getAnimatableNone = getAnimatableNone; + exports.getAnimationMap = getAnimationMap; + exports.getComputedStyle = getComputedStyle$2; + exports.getDefaultTransition = getDefaultTransition; + exports.getDefaultValueType = getDefaultValueType; + exports.getFeatureDefinitions = getFeatureDefinitions; + exports.getFinalKeyframe = getFinalKeyframe; + exports.getMixer = getMixer; + exports.getOptimisedAppearId = getOptimisedAppearId; + exports.getOriginIndex = getOriginIndex; + exports.getValueAsType = getValueAsType; + exports.getValueTransition = getValueTransition; + exports.getVariableValue = getVariableValue; + exports.getVariantContext = getVariantContext; + exports.getViewAnimationLayerInfo = getViewAnimationLayerInfo; + exports.getViewAnimations = getViewAnimations; + exports.globalProjectionState = globalProjectionState; + exports.has2DTranslate = has2DTranslate; + exports.hasReducedMotionListener = hasReducedMotionListener; + exports.hasScale = hasScale; + exports.hasTransform = hasTransform; + exports.hex = hex; + exports.hover = hover; + exports.hsla = hsla; + exports.hslaToRgba = hslaToRgba; + exports.inertia = inertia; + exports.initPrefersReducedMotion = initPrefersReducedMotion; + exports.interpolate = interpolate; + exports.invisibleValues = invisibleValues; + exports.isAnimationControls = isAnimationControls; + exports.isCSSVariableName = isCSSVariableName; + exports.isCSSVariableToken = isCSSVariableToken; + exports.isControllingVariants = isControllingVariants; + exports.isDeltaZero = isDeltaZero; + exports.isDragActive = isDragActive; + exports.isDragging = isDragging; + exports.isElementKeyboardAccessible = isElementKeyboardAccessible; + exports.isElementTextInput = isElementTextInput; + exports.isForcedMotionValue = isForcedMotionValue; + exports.isGenerator = isGenerator; + exports.isHTMLElement = isHTMLElement; + exports.isKeyframesTarget = isKeyframesTarget; + exports.isMotionValue = isMotionValue; + exports.isNear = isNear; + exports.isNodeOrChild = isNodeOrChild; + exports.isPrimaryPointer = isPrimaryPointer; + exports.isSVGElement = isSVGElement; + exports.isSVGSVGElement = isSVGSVGElement; + exports.isSVGTag = isSVGTag; + exports.isTransitionDefined = isTransitionDefined; + exports.isVariantLabel = isVariantLabel; + exports.isVariantNode = isVariantNode; + exports.isWaapiSupportedEasing = isWaapiSupportedEasing; + exports.isWillChangeMotionValue = isWillChangeMotionValue; + exports.keyframes = keyframes; + exports.makeAnimationInstant = makeAnimationInstant; + exports.mapEasingToNativeEasing = mapEasingToNativeEasing; + exports.mapValue = mapValue; + exports.maxGeneratorDuration = maxGeneratorDuration; + exports.measurePageBox = measurePageBox; + exports.measureViewportBox = measureViewportBox; + exports.microtask = microtask; + exports.mix = mix; + exports.mixArray = mixArray; + exports.mixColor = mixColor; + exports.mixComplex = mixComplex; + exports.mixImmediate = mixImmediate; + exports.mixLinearColor = mixLinearColor; + exports.mixNumber = mixNumber$1; + exports.mixObject = mixObject; + exports.mixValues = mixValues; + exports.mixVisibility = mixVisibility; + exports.motionValue = motionValue; + exports.nodeGroup = nodeGroup; + exports.number = number; + exports.numberValueTypes = numberValueTypes; + exports.observeTimeline = observeTimeline; + exports.optimizedAppearDataAttribute = optimizedAppearDataAttribute; + exports.optimizedAppearDataId = optimizedAppearDataId; + exports.parseAnimateLayoutArgs = parseAnimateLayoutArgs; + exports.parseCSSVariable = parseCSSVariable; + exports.parseValueFromTransform = parseValueFromTransform; + exports.percent = percent; + exports.pixelsToPercent = pixelsToPercent; + exports.positionalKeys = positionalKeys; + exports.prefersReducedMotion = prefersReducedMotion; + exports.press = press; + exports.progressPercentage = progressPercentage; + exports.propEffect = propEffect; + exports.propagateDirtyNodes = propagateDirtyNodes; + exports.px = px; + exports.readTransformValue = readTransformValue; + exports.recordStats = recordStats; + exports.removeAxisDelta = removeAxisDelta; + exports.removeAxisTransforms = removeAxisTransforms; + exports.removeBoxTransforms = removeBoxTransforms; + exports.removePointDelta = removePointDelta; + exports.renderHTML = renderHTML; + exports.renderSVG = renderSVG; + exports.resize = resize; + exports.resolveElements = resolveElements; + exports.resolveMotionValue = resolveMotionValue; + exports.resolveTransition = resolveTransition; + exports.resolveVariant = resolveVariant; + exports.resolveVariantFromProps = resolveVariantFromProps; + exports.rgbUnit = rgbUnit; + exports.rgba = rgba; + exports.rootProjectionNode = rootProjectionNode; + exports.scale = scale; + exports.scaleCorrectors = scaleCorrectors; + exports.scalePoint = scalePoint; + exports.scrapeHTMLMotionValuesFromProps = scrapeMotionValuesFromProps$1; + exports.scrapeSVGMotionValuesFromProps = scrapeMotionValuesFromProps; + exports.setDragLock = setDragLock; + exports.setFeatureDefinitions = setFeatureDefinitions; + exports.setStyle = setStyle; + exports.setTarget = setTarget; + exports.spring = spring; + exports.springValue = springValue; + exports.stagger = stagger; + exports.startWaapiAnimation = startWaapiAnimation; + exports.statsBuffer = statsBuffer; + exports.styleEffect = styleEffect; + exports.supportedWaapiEasing = supportedWaapiEasing; + exports.supportsBrowserAnimation = supportsBrowserAnimation; + exports.supportsFlags = supportsFlags; + exports.supportsLinearEasing = supportsLinearEasing; + exports.supportsPartialKeyframes = supportsPartialKeyframes; + exports.supportsScrollTimeline = supportsScrollTimeline; + exports.supportsViewTimeline = supportsViewTimeline; + exports.svgEffect = svgEffect; + exports.sync = sync; + exports.testValueType = testValueType; + exports.time = time; + exports.transform = transform; + exports.transformAxis = transformAxis; + exports.transformBox = transformBox; + exports.transformBoxPoints = transformBoxPoints; + exports.transformPropOrder = transformPropOrder; + exports.transformProps = transformProps; + exports.transformValue = transformValue; + exports.transformValueTypes = transformValueTypes; + exports.translateAxis = translateAxis; + exports.updateMotionValuesFromProps = updateMotionValuesFromProps; + exports.variantPriorityOrder = variantPriorityOrder; + exports.variantProps = variantProps; + exports.vh = vh; + exports.visualElementStore = visualElementStore; + exports.vw = vw; + +})); diff --git a/node_modules/motion-dom/dist/motion-dom.js b/node_modules/motion-dom/dist/motion-dom.js new file mode 100644 index 0000000..313be4d --- /dev/null +++ b/node_modules/motion-dom/dist/motion-dom.js @@ -0,0 +1 @@ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("motion-utils")):"function"==typeof define&&define.amd?define(["exports","motion-utils"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).MotionDom={},t.MotionUtils)}(this,function(t,e){"use strict";const n=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function i(t,i){let s=!1,o=!0;const r={delta:0,timestamp:0,isProcessing:!1},a=()=>s=!0,l=n.reduce((t,e)=>(t[e]=function(t){let e=new Set,n=new Set,i=!1,s=!1;const o=new WeakSet;let r={delta:0,timestamp:0,isProcessing:!1};function a(e){o.has(e)&&(l.schedule(e),t()),e(r)}const l={schedule:(t,s=!1,r=!1)=>{const a=r&&i?e:n;return s&&o.add(t),a.add(t),t},cancel:t=>{n.delete(t),o.delete(t)},process:t=>{if(r=t,i)return void(s=!0);i=!0;const o=e;e=n,n=o,e.forEach(a),e.clear(),i=!1,s&&(s=!1,l.process(t))}};return l}(a),t),{}),{setup:c,read:u,resolveKeyframes:h,preUpdate:d,update:p,preRender:m,render:f,postRender:y}=l,g=()=>{const n=e.MotionGlobalConfig.useManualTiming,a=n?r.timestamp:performance.now();s=!1,n||(r.delta=o?1e3/60:Math.max(Math.min(a-r.timestamp,40),1)),r.timestamp=a,r.isProcessing=!0,c.process(r),u.process(r),h.process(r),d.process(r),p.process(r),m.process(r),f.process(r),y.process(r),r.isProcessing=!1,s&&i&&(o=!1,t(g))};return{schedule:n.reduce((e,n)=>{const i=l[n];return e[n]=(e,n=!1,a=!1)=>(s||(s=!0,o=!0,r.isProcessing||t(g)),i.schedule(e,n,a)),e},{}),cancel:t=>{for(let e=0;e(void 0===l&&u.set(r.isProcessing||e.MotionGlobalConfig.useManualTiming?r.timestamp:performance.now()),l),set:t=>{l=t,queueMicrotask(c)}},h=t=>e=>"string"==typeof e&&e.startsWith(t),d=h("--"),p=h("var(--"),m=t=>!!p(t)&&f.test(t.split("/*")[0].trim()),f=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function y(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const g={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},v={...g,transform:t=>e.clamp(0,1,t)},x={...g,default:1},T=t=>Math.round(1e5*t)/1e5,w=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const b=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,S=(t,e)=>n=>Boolean("string"==typeof n&&b.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),V=(t,e,n)=>i=>{if("string"!=typeof i)return i;const[s,o,r,a]=i.match(w);return{[t]:parseFloat(s),[e]:parseFloat(o),[n]:parseFloat(r),alpha:void 0!==a?parseFloat(a):1}},A={...g,transform:t=>Math.round((t=>e.clamp(0,255,t))(t))},P={test:S("rgb","red"),parse:V("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+A.transform(t)+", "+A.transform(e)+", "+A.transform(n)+", "+T(v.transform(i))+")"};const M={test:S("#"),parse:function(t){let e="",n="",i="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),i=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),i=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,i+=i,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:s?parseInt(s,16)/255:1}},transform:P.transform},k=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),E=k("deg"),D=k("%"),C=k("px"),R=k("vh"),B=k("vw"),j=(()=>({...D,parse:t=>D.parse(t)/100,transform:t=>D.transform(100*t)}))(),L={test:S("hsl","hue"),parse:V("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+D.transform(T(e))+", "+D.transform(T(n))+", "+T(v.transform(i))+")"},F={test:t=>P.test(t)||M.test(t)||L.test(t),parse:t=>P.test(t)?P.parse(t):L.test(t)?L.parse(t):M.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?P.transform(t):L.transform(t),getAnimatableNone:t=>{const e=F.parse(t);return e.alpha=0,F.transform(e)}},O=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const I="number",$="color",N=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function U(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},s=[];let o=0;const r=e.replace(N,t=>(F.test(t)?(i.color.push(o),s.push($),n.push(F.parse(t))):t.startsWith("var(")?(i.var.push(o),s.push("var"),n.push(t)):(i.number.push(o),s.push(I),n.push(parseFloat(t))),++o,"${}")).split("${}");return{values:n,split:r,indexes:i,types:s}}function W({split:t,types:e}){const n=t.length;return i=>{let s="";for(let o=0;o{return"number"==typeof t?e?.trim().endsWith("/")?t:0:"number"==typeof(n=t)?0:F.test(n)?F.getAnimatableNone(n):n;var n};const K={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(w)?.length||0)+(t.match(O)?.length||0)>0},parse:function(t){return U(t).values},createTransformer:function(t){return W(U(t))},getAnimatableNone:function(t){const e=U(t);return W(e)(e.values.map((t,n)=>z(t,e.split[n])))}};function Y(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function G({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let s=0,o=0,r=0;if(e/=100){const i=n<.5?n*(1+e):n+e-n*e,a=2*n-i;s=Y(a,i,t+1/3),o=Y(a,i,t),r=Y(a,i,t-1/3)}else s=o=r=n;return{red:Math.round(255*s),green:Math.round(255*o),blue:Math.round(255*r),alpha:i}}function X(t,e){return n=>n>0?e:t}const q=(t,e,n)=>t+(e-t)*n,H=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},Z=[M,P,L];function _(t){const n=(i=t,Z.find(t=>t.test(i)));var i;if(e.warning(Boolean(n),`'${t}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!Boolean(n))return!1;let s=n.parse(t);return n===L&&(s=G(s)),s}const J=(t,e)=>{const n=_(t),i=_(e);if(!n||!i)return X(t,e);const s={...n};return t=>(s.red=H(n.red,i.red,t),s.green=H(n.green,i.green,t),s.blue=H(n.blue,i.blue,t),s.alpha=q(n.alpha,i.alpha,t),P.transform(s))},Q=new Set(["none","hidden"]);function tt(t,e){return Q.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function et(t,e){return n=>q(t,e,n)}function nt(t){return"number"==typeof t?et:"string"==typeof t?m(t)?X:F.test(t)?J:ot:Array.isArray(t)?it:"object"==typeof t?F.test(t)?J:st:X}function it(t,e){const n=[...t],i=n.length,s=t.map((t,n)=>nt(t)(t,e[n]));return t=>{for(let e=0;e{for(const e in i)n[e]=i[e](t);return n}}const ot=(t,n)=>{const i=K.createTransformer(n),s=U(t),o=U(n);return s.indexes.var.length===o.indexes.var.length&&s.indexes.color.length===o.indexes.color.length&&s.indexes.number.length>=o.indexes.number.length?Q.has(t)&&!o.values.length||Q.has(n)&&!s.values.length?tt(t,n):e.pipe(it(function(t,e){const n=[],i={color:0,var:0,number:0};for(let s=0;s{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>s.update(e,t),stop:()=>o(e),now:()=>r.isProcessing?r.timestamp:u.now()}},lt=(t,e,n=10)=>{let i="";const s=Math.max(Math.round(e/n),2);for(let e=0;e=ct?1/0:e}function ht(t,n=100,i){const s=i({...t,keyframes:[0,n]}),o=Math.min(ut(s),ct);return{type:"keyframes",ease:t=>s.next(o*t).value/n,duration:e.millisecondsToSeconds(o)}}const dt=100,pt=10,mt=1,ft=0,yt=800,gt=.3,vt=.3,xt={granular:.01,default:2},Tt={granular:.005,default:.5},wt=.01,bt=10,St=.05,Vt=1;function At(t,e){return t*Math.sqrt(1-e*e)}const Pt=.001;const Mt=["duration","bounce"],kt=["stiffness","damping","mass"];function Et(t,e){return e.some(e=>void 0!==t[e])}function Dt(t){let n={velocity:ft,stiffness:dt,damping:pt,mass:mt,isResolvedFromDuration:!1,...t};if(!Et(t,kt)&&Et(t,Mt))if(n.velocity=0,t.visualDuration){const i=t.visualDuration,s=2*Math.PI/(1.2*i),o=s*s,r=2*e.clamp(.05,1,1-(t.bounce||0))*Math.sqrt(o);n={...n,mass:mt,stiffness:o,damping:r}}else{const i=function({duration:t=yt,bounce:n=gt,velocity:i=ft,mass:s=mt}){let o,r;e.warning(t<=e.secondsToMilliseconds(bt),"Spring duration must be 10 seconds or less","spring-duration-limit");let a=1-n;a=e.clamp(St,Vt,a),t=e.clamp(wt,bt,e.millisecondsToSeconds(t)),a<1?(o=e=>{const n=e*a,s=n*t,o=n-i,r=At(e,a),l=Math.exp(-s);return Pt-o/r*l},r=e=>{const n=e*a*t,s=n*i+i,r=Math.pow(a,2)*Math.pow(e,2)*t,l=Math.exp(-n),c=At(Math.pow(e,2),a);return(-o(e)+Pt>0?-1:1)*((s-r)*l)/c}):(o=e=>Math.exp(-e*t)*((e-i)*t+1)-.001,r=e=>Math.exp(-e*t)*(t*t*(i-e)));const l=function(t,e,n){let i=n;for(let n=1;n<12;n++)i-=t(i)/e(i);return i}(o,r,5/t);if(t=e.secondsToMilliseconds(t),isNaN(l))return{stiffness:dt,damping:pt,duration:t};{const e=Math.pow(l,2)*s;return{stiffness:e,damping:2*a*Math.sqrt(s*e),duration:t}}}({...t,velocity:0});n={...n,...i,mass:mt},n.isResolvedFromDuration=!0}return n}function Ct(t=vt,n=gt){const i="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:n}:t;let{restSpeed:s,restDelta:o}=i;const r=i.keyframes[0],a=i.keyframes[i.keyframes.length-1],l={done:!1,value:r},{stiffness:c,damping:u,mass:h,duration:d,velocity:p,isResolvedFromDuration:m}=Dt({...i,velocity:-e.millisecondsToSeconds(i.velocity||0)}),f=p||0,y=u/(2*Math.sqrt(c*h)),g=a-r,v=e.millisecondsToSeconds(Math.sqrt(c/h)),x=Math.abs(g)<5;let T,w,b,S,V,A;if(s||(s=x?xt.granular:xt.default),o||(o=x?Tt.granular:Tt.default),y<1)b=At(v,y),S=(f+y*v*g)/b,T=t=>{const e=Math.exp(-y*v*t);return a-e*(S*Math.sin(b*t)+g*Math.cos(b*t))},V=y*v*S+g*b,A=y*v*g-S*b,w=t=>Math.exp(-y*v*t)*(V*Math.sin(b*t)+A*Math.cos(b*t));else if(1===y){T=t=>a-Math.exp(-v*t)*(g+(f+v*g)*t);const t=f+v*g;w=e=>Math.exp(-v*e)*(v*t*e-f)}else{const t=v*Math.sqrt(y*y-1);T=e=>{const n=Math.exp(-y*v*e),i=Math.min(t*e,300);return a-n*((f+y*v*g)*Math.sinh(i)+t*g*Math.cosh(i))/t};const e=(f+y*v*g)/t,n=y*v*e-g*t,i=y*v*g-e*t;w=e=>{const s=Math.exp(-y*v*e),o=Math.min(t*e,300);return s*(n*Math.sinh(o)+i*Math.cosh(o))}}const P={calculatedDuration:m&&d||null,velocity:t=>e.secondsToMilliseconds(w(t)),next:t=>{if(!m&&y<1){const n=Math.exp(-y*v*t),i=Math.sin(b*t),r=Math.cos(b*t),c=a-n*(S*i+g*r),u=e.secondsToMilliseconds(n*(V*i+A*r));return l.done=Math.abs(u)<=s&&Math.abs(a-c)<=o,l.value=l.done?a:c,l}const n=T(t);if(m)l.done=t>=d;else{const i=e.secondsToMilliseconds(w(t));l.done=Math.abs(i)<=s&&Math.abs(a-n)<=o}return l.value=l.done?a:n,l},toString:()=>{const t=Math.min(ut(P),ct),e=lt(e=>P.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return P}Ct.applyToOptions=t=>{const n=ht(t,100,Ct);return t.ease=n.ease,t.duration=e.secondsToMilliseconds(n.duration),t.type="keyframes",t};function Rt(t,n,i){const s=Math.max(n-5,0);return e.velocityPerSecond(i-t(s),n-s)}function Bt({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:l,restDelta:c=.5,restSpeed:u}){const h=t[0],d={done:!1,value:h},p=t=>void 0===a?l:void 0===l||Math.abs(a-t)-m*Math.exp(-t/i),v=t=>y+g(t),x=t=>{const e=g(t),n=v(t);d.done=Math.abs(e)<=c,d.value=d.done?y:n};let T,w;const b=t=>{var e;(e=d.value,void 0!==a&&el)&&(T=t,w=Ct({keyframes:[d.value,p(d.value)],velocity:Rt(v,t,d.value),damping:s,stiffness:o,restDelta:c,restSpeed:u}))};return b(0),{calculatedDuration:null,next:t=>{let e=!1;return w||void 0!==T||(e=!0,x(t),b(t)),void 0!==T&&t>=T?w.next(t-T):(!e&&x(t),d)}}}function jt(t,n,{clamp:i=!0,ease:s,mixer:o}={}){const r=t.length;if(e.invariant(r===n.length,"Both input and output ranges must be the same length","range-length"),1===r)return()=>n[0];if(2===r&&n[0]===n[1])return()=>n[1];const a=t[0]===t[1];t[0]>t[r-1]&&(t=[...t].reverse(),n=[...n].reverse());const l=function(t,n,i){const s=[],o=i||e.MotionGlobalConfig.mix||rt,r=t.length-1;for(let i=0;i{if(a&&i1)for(;su(e.clamp(t[0],t[r-1],n)):u}function Lt(t,n){const i=t[t.length-1];for(let s=1;s<=n;s++){const o=e.progress(0,n,s);t.push(q(i,1,o))}}function Ft(t){const e=[0];return Lt(e,t.length-1),e}function Ot(t,e){return t.map(t=>t*e)}function It(t,n){return t.map(()=>n||e.easeInOut).splice(0,t.length-1)}function $t({duration:t=300,keyframes:n,times:i,ease:s="easeInOut"}){const o=e.isEasingArray(s)?s.map(e.easingDefinitionToFunction):e.easingDefinitionToFunction(s),r={done:!1,value:n[0]},a=jt(Ot(i&&i.length===n.length?i:Ft(n),t),n,{ease:Array.isArray(o)?o:It(n,o)});return{calculatedDuration:t,next:e=>(r.value=a(e),r.done=e>=t,r)}}const Nt=t=>null!==t;function Ut(t,{repeat:e,repeatType:n="loop"},i,s=1){const o=t.filter(Nt),r=s<0||e&&"loop"!==n&&e%2==1?0:o.length-1;return r&&void 0!==i?i:o[r]}const Wt={decay:Bt,inertia:Bt,tween:$t,keyframes:$t,spring:Ct};function zt(t){"string"==typeof t.type&&(t.type=Wt[t.type])}class Kt{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const Yt=t=>t/100;class Gt extends Kt{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:t}=this.options;t&&t.updatedAt!==u.now()&&this.tick(u.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;zt(t);const{type:n=$t,repeat:i=0,repeatDelay:s=0,repeatType:o,velocity:r=0}=t;let{keyframes:a}=t;const l=n||$t;l!==$t&&"number"!=typeof a[0]&&(this.mixKeyframes=e.pipe(Yt,rt(a[0],a[1])),a=[0,100]);const c=l({...t,keyframes:a});"mirror"===o&&(this.mirroredGenerator=l({...t,keyframes:[...a].reverse(),velocity:-r})),null===c.calculatedDuration&&(c.calculatedDuration=ut(c));const{calculatedDuration:u}=c;this.calculatedDuration=u,this.resolvedDuration=u+s,this.totalDuration=this.resolvedDuration*(i+1)-s,this.generator=c}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,n=!1){const{generator:i,totalDuration:s,mixKeyframes:o,mirroredGenerator:r,resolvedDuration:a,calculatedDuration:l}=this;if(null===this.startTime)return i.next(0);const{delay:c=0,keyframes:u,repeat:h,repeatType:d,repeatDelay:p,type:m,onUpdate:f,finalKeyframe:y}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?g<0:g>s;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=s);let x,T=this.currentTime,w=i;if(h){const t=Math.min(this.currentTime,s)/a;let n=Math.floor(t),i=t%1;!i&&t>=1&&(i=1),1===i&&n--,n=Math.min(n,h+1);Boolean(n%2)&&("reverse"===d?(i=1-i,p&&(i-=p/a)):"mirror"===d&&(w=r)),T=e.clamp(0,1,i)*a}v?(this.delayState.value=u[0],x=this.delayState):x=w.next(T),o&&!v&&(x.value=o(x.value));let{done:b}=x;v||null===l||(b=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const S=null===this.holdTime&&("finished"===this.state||"running"===this.state&&b);return S&&m!==Bt&&(x.value=Ut(u,this.options,y,this.speed)),f&&f(x.value),S&&this.finish(),x}then(t,e){return this.finished.then(t,e)}get duration(){return e.millisecondsToSeconds(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+e.millisecondsToSeconds(t)}get time(){return e.millisecondsToSeconds(this.currentTime)}set time(t){t=e.secondsToMilliseconds(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);return Rt(t=>this.generator.next(t).value,t,this.generator.next(t).value)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;n&&this.driver&&this.updateTime(u.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=e.millisecondsToSeconds(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=at,startTime:e}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),this.options.onPlay?.();const n=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=n):null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime||(this.startTime=e??n),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(u.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function Xt(t){for(let e=1;e180*t/Math.PI,Ht=t=>{const e=qt(Math.atan2(t[1],t[0]));return _t(e)},Zt={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Ht,rotateZ:Ht,skewX:t=>qt(Math.atan(t[1])),skewY:t=>qt(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},_t=t=>((t%=360)<0&&(t+=360),t),Jt=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Qt=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),te={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Jt,scaleY:Qt,scale:t=>(Jt(t)+Qt(t))/2,rotateX:t=>_t(qt(Math.atan2(t[6],t[5]))),rotateY:t=>_t(qt(Math.atan2(-t[2],t[0]))),rotateZ:Ht,rotate:Ht,skewX:t=>qt(Math.atan(t[4])),skewY:t=>qt(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function ee(t){return t.includes("scale")?1:0}function ne(t,e){if(!t||"none"===t)return ee(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,s;if(n)i=te,s=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=Zt,s=e}if(!s)return ee(e);const o=i[e],r=s[1].split(",").map(se);return"function"==typeof o?o(r):r[o]}const ie=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return ne(n,e)};function se(t){return parseFloat(t.trim())}const oe=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],re=(()=>new Set([...oe,"pathRotation"]))(),ae=t=>t===g||t===C,le=new Set(["x","y","z"]),ce=oe.filter(t=>!le.has(t));const ue={width:({x:t},{paddingLeft:e="0",paddingRight:n="0",boxSizing:i})=>{const s=t.max-t.min;return"border-box"===i?s:s-parseFloat(e)-parseFloat(n)},height:({y:t},{paddingTop:e="0",paddingBottom:n="0",boxSizing:i})=>{const s=t.max-t.min;return"border-box"===i?s:s-parseFloat(e)-parseFloat(n)},top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>ne(e,"x"),y:(t,{transform:e})=>ne(e,"y")};ue.translateX=ue.x,ue.translateY=ue.y;const he=new Set;let de=!1,pe=!1,me=!1;function fe(){if(pe){const t=Array.from(he).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),n=new Map;e.forEach(t=>{const e=function(t){const e=[];return ce.forEach(n=>{const i=t.getValue(n);void 0!==i&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),e}(t);e.length&&(n.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=n.get(t);e&&e.forEach(([e,n])=>{t.getValue(e)?.set(n)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}pe=!1,de=!1,he.forEach(t=>t.complete(me)),he.clear()}function ye(){he.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(pe=!0)})}function ge(){me=!0,ye(),fe(),me=!1}class ve{constructor(t,e,n,i,s,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(he.add(this),de||(de=!0,s.read(ye),s.resolveKeyframes(fe))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:i}=this;if(null===t[0]){const s=i?.get(),o=t[t.length-1];if(void 0!==s)t[0]=s;else if(n&&e){const i=n.readValue(e,o);null!=i&&(t[0]=i)}void 0===t[0]&&(t[0]=o),i&&void 0===s&&i.set(t[0])}Xt(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),he.delete(this)}cancel(){"scheduled"===this.state&&(he.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}const xe=t=>t.startsWith("--");function Te(t,e,n){xe(e)?t.style.setProperty(e,n):t.style[e]=n}const we={};function be(t,n){const i=e.memo(t);return()=>we[n]??i()}const Se=be(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),Ve=be(()=>void 0!==window.ViewTimeline,"viewTimeline"),Ae=be(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),Pe=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,Me={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Pe([0,.65,.55,1]),circOut:Pe([.55,0,1,.45]),backIn:Pe([.31,.01,.66,-.59]),backOut:Pe([.33,1.53,.69,.99])};function ke(t,n){return t?"function"==typeof t?Ae()?lt(t,n):"ease-out":e.isBezierDefinition(t)?Pe(t):Array.isArray(t)?t.map(t=>ke(t,n)||Me.easeOut):Me[t]:void 0}function Ee(t,e,n,{delay:i=0,duration:s=300,repeat:o=0,repeatType:r="loop",ease:a="easeOut",times:l}={},c=void 0){const u={[e]:n};l&&(u.offset=l);const h=ke(a,s);Array.isArray(h)&&(u.easing=h);const d={delay:i,duration:s,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:o+1,direction:"reverse"===r?"alternate":"normal"};return c&&(d.pseudoElement=c),t.animate(u,d)}function De(t){return"function"==typeof t&&"applyToOptions"in t}function Ce({type:t,...e}){return De(t)&&Ae()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class Re extends Kt{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:i,keyframes:s,pseudoElement:o,allowFlatten:r=!1,finalKeyframe:a,onComplete:l}=t;this.isPseudoElement=Boolean(o),this.allowFlatten=r,this.options=t,e.invariant("string"!=typeof t.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const c=Ce(t);this.animation=Ee(n,i,s,c,o),!1===c.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const t=Ut(s,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(t),Te(n,i,t),this.animation.cancel()}l?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return e.millisecondsToSeconds(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+e.millisecondsToSeconds(t)}get time(){return e.millisecondsToSeconds(Number(this.animation.currentTime)||0)}set time(t){const n=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=e.secondsToMilliseconds(t),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:n,rangeEnd:i,observe:s}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&Se()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),i&&(this.animation.rangeEnd=i),e.noop):s(this)}}const Be={anticipate:e.anticipate,backInOut:e.backInOut,circInOut:e.circInOut};function je(t){"string"==typeof t.ease&&t.ease in Be&&(t.ease=Be[t.ease])}class Le extends Re{constructor(t){je(t),zt(t),super(t),void 0!==t.startTime&&!1!==t.autoplay&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:i,onComplete:s,element:o,...r}=this.options;if(!n)return;if(void 0!==t)return void n.set(t);const a=new Gt({...r,autoplay:!1}),l=Math.max(10,u.now()-this.startTime),c=e.clamp(0,10,l-10),h=a.sample(l).value,{name:d}=this.options;o&&d&&Te(o,d,h),n.setWithVelocity(a.sample(Math.max(0,l-c)).value,h,c),a.stop()}}const Fe=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!K.test(t)&&"0"!==t||t.startsWith("url(")));function Oe(t){t.duration=0,t.type="keyframes"}const Ie=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),$e=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;const Ne=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),Ue=e.memo(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function We(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:s,damping:o,type:r,keyframes:a}=t,l=e?.owner?.current;if(!(l instanceof HTMLElement||l instanceof SVGElement))return!1;const{onUpdate:c,transformTemplate:u}=e.owner.getProps();return Ue()&&n&&(Ie.has(n)||Ne.has(n)&&function(t){for(let e=0;e{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=u.now();const d={autoplay:t,delay:e,type:n,repeat:i,repeatDelay:s,repeatType:o,name:a,motionValue:l,element:c,...h},p=c?.KeyframeResolver||ve;this.keyframeResolver=new p(r,(t,e,n)=>this.onKeyframesResolved(t,e,d,!n),a,l,c),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,n,i,s){this.keyframeResolver=void 0;const{name:o,type:r,velocity:a,delay:l,isHandoff:c,onUpdate:h}=i;this.resolvedAt=u.now();let d=!0;(function(t,n,i,s){const o=t[0];if(null===o)return!1;if("display"===n||"visibility"===n)return!0;const r=t[t.length-1],a=Fe(o,n),l=Fe(r,n);return e.warning(a===l,`You are trying to animate ${n} from "${o}" to "${r}". "${a?r:o}" is not an animatable value.`,"value-not-animatable"),!(!a||!l)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:n,...i,keyframes:t},m=d&&!c&&We(p),f=p.motionValue?.owner?.current;let y;if(m)try{y=new Le({...p,element:f})}catch{y=new Gt(p)}else y=new Gt(p);y.finished.then(()=>{this.notifyFinished()}).catch(e.noop),this.pendingTimeline&&(this.stopTimeline=y.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=y}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),ge()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}class Ke{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;ne.attachTimeline(t));return()=>{e.forEach((t,e)=>{t&&t(),this.animations[e].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return Ye(this.animations,"duration")}get iterationDuration(){return Ye(this.animations,"iterationDuration")}runAll(t){this.animations.forEach(e=>e[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function Ye(t,e){let n=0;for(let i=0;in&&(n=s)}return n}class Ge extends Re{constructor(t){super(),this.animation=t,t.onfinish=()=>{this.finishedTime=this.time,this.notifyFinished()}}}const Xe=new WeakMap;function qe(t,e,n,i=0,s=1){const o=Array.from(t).sort((t,e)=>t.sortNodePosition(e)).indexOf(e),r=t.size,a=(r-1)*i;return"function"==typeof n?n(o,r):1===s?o*i:a-o*i}const He={current:void 0};class Ze{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=u.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=u.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new e.SubscriptionManager);const i=this.events[t].add(n);return"change"===t?()=>{i(),s.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return He.current&&He.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=u.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,30);return e.velocityPerSecond(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function _e(t,e){return new Ze(t,e)}function Je(t,e){if(t?.inherit&&e){const{inherit:n,...i}=t;return{...e,...i}}return t}function Qe(t,e){const n=t?.[e]??t?.default??t;return n!==t?Je(n,t):n}const tn={type:"spring",stiffness:500,damping:25,restSpeed:10},en={type:"keyframes",duration:.8},nn={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},sn=(t,{keyframes:e})=>e.length>2?en:re.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:tn:nn,on=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function rn(t){for(const e in t)if(!on.has(e))return!0;return!1}const an=(t,n,i,o={},r,a)=>l=>{const c=Qe(o,t)||{},u=c.delay||o.delay||0;let{elapsed:h=0}=o;h-=e.secondsToMilliseconds(u);const d={keyframes:Array.isArray(i)?i:[null,i],ease:"easeOut",velocity:n.getVelocity(),...c,delay:-h,onUpdate:t=>{n.set(t),c.onUpdate&&c.onUpdate(t)},onComplete:()=>{l(),c.onComplete&&c.onComplete()},name:t,motionValue:n,element:a?void 0:r};rn(c)||Object.assign(d,sn(t,d)),d.duration&&(d.duration=e.secondsToMilliseconds(d.duration)),d.repeatDelay&&(d.repeatDelay=e.secondsToMilliseconds(d.repeatDelay)),void 0!==d.from&&(d.keyframes[0]=d.from);let p=!1;if((!1===d.type||0===d.duration&&!d.repeatDelay)&&(Oe(d),0===d.delay&&(p=!0)),(e.MotionGlobalConfig.instantAnimations||e.MotionGlobalConfig.skipAnimations||r?.shouldSkipAnimations||c.skipAnimations)&&(p=!0,Oe(d),d.delay=0),d.allowFlatten=!c.type&&!c.ease,p&&!a&&void 0!==n.get()){const t=Ut(d.keyframes,c);if(void 0!==t)return void s.update(()=>{d.onUpdate(t),d.onComplete()})}return c.isSync?new Gt(d):new ze(d)};function ln(t,e,n,i){const s=1-t;return s*s*e+2*s*t*n+t*t*i}function cn(t,e,n,i,s,o,r){const a=2*(1-t)*(n-e)+2*t*(i-n),l=2*(1-t)*(o-s)+2*t*(r-o);return Math.atan2(l,a)*(180/Math.PI)}function un(t,e,n,i,s,o){const r=n-t,a=i-e,l=Math.sqrt(r*r+a*a);if(l>0){const n=s*l;return{x:t+r*o+-a/l*n,y:e+a*o+r/l*n}}return{x:t,y:e}}const hn=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function dn(t){const e=hn.exec(t);if(!e)return[,];const[,n,i,s]=e;return[`--${n??i}`,s]}function pn(t,n,i=1){e.invariant(i<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[s,o]=dn(t);if(!s)return;const r=window.getComputedStyle(n).getPropertyValue(s);if(r){const t=r.trim();return e.isNumericalString(t)?parseFloat(t):t}return m(o)?pn(o,n,i+1):o}function mn(t){const e=[{},{}];return t?.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}function fn(t,e,n,i){if("function"==typeof e){const[s,o]=mn(i);e=e(void 0!==n?n:t.custom,s,o)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[s,o]=mn(i);e=e(void 0!==n?n:t.custom,s,o)}return e}function yn(t,e,n){const i=t.getProps();return fn(i,e,void 0!==n?n:i.custom,t)}const gn=new Set(["width","height","top","left","right","bottom",...oe]),vn=t=>Array.isArray(t);function xn(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,_e(n))}function Tn(t){return vn(t)?t[t.length-1]||0:t}function wn(t,e){const n=yn(t,e);let{transitionEnd:i={},transition:s={},...o}=n||{};o={...o,...i};for(const e in o){xn(t,e,Tn(o[e]))}}const bn=t=>Boolean(t&&t.getVelocity);function Sn(t){return Boolean(bn(t)&&t.add)}function Vn(t,n){const i=t.getValue("willChange");if(Sn(i))return i.add(n);if(!i&&e.MotionGlobalConfig.WillChange){const i=new e.MotionGlobalConfig.WillChange("auto");t.addValue("willChange",i),i.add(n)}}function An(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const Pn="framerAppearId",Mn="data-"+An(Pn);function kn(t){return t.props[Mn]}function En({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}function Dn(t,e,{delay:n=0,transitionOverride:i,type:o}={}){let{transition:r,transitionEnd:a,...l}=e;const c=t.getDefaultTransition();r=r?Je(r,c):c;const u=r?.reduceMotion,h=r?.skipAnimations;i&&(r=i);const d=[],p=o&&t.animationState&&t.animationState.getState()[o],m=r?.path;m&&m.animateVisualElement(t,l,r,n,d);for(const e in l){const i=t.getValue(e,t.latestValues[e]??null),o=l[e];if(void 0===o||p&&En(p,e))continue;const a={delay:n,...Qe(r||{},e)};h&&(a.skipAnimations=!0);const c=i.get();if(void 0!==c&&!i.isAnimating()&&!Array.isArray(o)&&o===c&&!a.velocity){s.update(()=>i.set(o));continue}let m=!1;if(window.MotionHandoffAnimation){const n=kn(t);if(n){const t=window.MotionHandoffAnimation(n,e,s);null!==t&&(a.startTime=t,m=!0)}}Vn(t,e);const f=u??t.shouldReduceMotion;i.start(an(e,i,o,f&&gn.has(e)?{type:!1}:a,t,m));const y=i.animation;y&&d.push(y)}if(a){const e=()=>s.update(()=>{a&&wn(t,a)});d.length?Promise.all(d).then(e):e()}return d}function Cn(t,e,n={}){const i=yn(t,e,"exit"===n.type?t.presenceContext?.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const o=i?()=>Promise.all(Dn(t,i,n)):()=>Promise.resolve(),r=t.variantChildren&&t.variantChildren.size?(i=0)=>{const{delayChildren:o=0,staggerChildren:r,staggerDirection:a}=s;return function(t,e,n=0,i=0,s=0,o=1,r){const a=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),a.push(Cn(l,e,{...r,delay:n+("function"==typeof i?0:i)+qe(t.variantChildren,l,i,s,o)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(a)}(t,e,i,o,r,a,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[t,e]="beforeChildren"===a?[o,r]:[r,o];return t().then(()=>e())}return Promise.all([o(),r(n.delay)])}function Rn(t,e,n={}){let i;if(t.notify("AnimationStart",e),Array.isArray(e)){const s=e.map(e=>Cn(t,e,n));i=Promise.all(s)}else if("string"==typeof e)i=Cn(t,e,n);else{const s="function"==typeof e?yn(t,e,n.custom):e;i=Promise.all(Dn(t,s,n))}return i.then(()=>{t.notify("AnimationComplete",e)})}const Bn=t=>e=>e.test(t),jn=[g,C,D,E,B,R,{test:t=>"auto"===t,parse:t=>t}],Ln=t=>jn.find(Bn(t));function Fn(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||e.isZeroValueString(t))}const On=new Set(["brightness","contrast","saturate","opacity"]);function In(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(w)||[];if(!i)return t;const s=n.replace(i,"");let o=On.has(e)?1:0;return i!==n&&(o*=100),e+"("+o+s+")"}const $n=/\b([a-z-]*)\(.*?\)/gu,Nn={...K,getAnimatableNone:t=>{const e=t.match($n);return e?e.map(In).join(" "):t}},Un={...K,getAnimatableNone:t=>{const e=K.parse(t);return K.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},Wn={...g,transform:Math.round},zn={rotate:E,pathRotation:E,rotateX:E,rotateY:E,rotateZ:E,scale:x,scaleX:x,scaleY:x,scaleZ:x,skew:E,skewX:E,skewY:E,distance:C,translateX:C,translateY:C,translateZ:C,x:C,y:C,z:C,perspective:C,transformPerspective:C,opacity:v,originX:j,originY:j,originZ:C},Kn={borderWidth:C,borderTopWidth:C,borderRightWidth:C,borderBottomWidth:C,borderLeftWidth:C,borderRadius:C,borderTopLeftRadius:C,borderTopRightRadius:C,borderBottomRightRadius:C,borderBottomLeftRadius:C,width:C,maxWidth:C,height:C,maxHeight:C,top:C,right:C,bottom:C,left:C,inset:C,insetBlock:C,insetBlockStart:C,insetBlockEnd:C,insetInline:C,insetInlineStart:C,insetInlineEnd:C,padding:C,paddingTop:C,paddingRight:C,paddingBottom:C,paddingLeft:C,paddingBlock:C,paddingBlockStart:C,paddingBlockEnd:C,paddingInline:C,paddingInlineStart:C,paddingInlineEnd:C,margin:C,marginTop:C,marginRight:C,marginBottom:C,marginLeft:C,marginBlock:C,marginBlockStart:C,marginBlockEnd:C,marginInline:C,marginInlineStart:C,marginInlineEnd:C,fontSize:C,backgroundPositionX:C,backgroundPositionY:C,...zn,zIndex:Wn,fillOpacity:v,strokeOpacity:v,numOctaves:Wn},Yn={...Kn,color:F,backgroundColor:F,outlineColor:F,fill:F,stroke:F,borderColor:F,borderTopColor:F,borderRightColor:F,borderBottomColor:F,borderLeftColor:F,filter:Nn,WebkitFilter:Nn,mask:Un,WebkitMask:Un},Gn=t=>Yn[t],Xn=new Set([Nn,Un]);function qn(t,e){let n=Gn(t);return Xn.has(n)||(n=K),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Hn=new Set(["auto","none","0"]);class Zn extends ve{constructor(t,e,n,i,s){super(t,e,n,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n{t.getValue(e).set(n)}),this.resolveNoneKeyframes()}}const _n=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"],Jn=new Set(["borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius",..._n,"width","maxWidth","height","maxHeight","top","right","bottom","left","inset","insetBlock","insetBlockStart","insetBlockEnd","insetInline","insetInlineStart","insetInlineEnd","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingBlock","paddingBlockStart","paddingBlockEnd","paddingInline","paddingInlineStart","paddingInlineEnd","margin","marginTop","marginRight","marginBottom","marginLeft","marginBlock","marginBlockStart","marginBlockEnd","marginInline","marginInlineStart","marginInlineEnd","fontSize","backgroundPositionX","backgroundPositionY"]);const Qn=e.memo(()=>{try{document.createElement("div").animate({opacity:[1]})}catch(t){return!1}return!0});function ti(t,e,n){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){let i=document;e&&(i=e.current);const s=n?.[t]??i.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t).filter(t=>null!=t)}function ei(t){return(e,n)=>{const i=ti(e),s=[];for(const e of i){const i=t(e,n);s.push(i)}return()=>{for(const t of s)t()}}}const ni=(t,e)=>e&&"number"==typeof t?e.transform(t):t;class ii{constructor(){this.latest={},this.values=new Map}set(t,e,n,i,r=!0){const a=this.values.get(t);a&&a.onRemove();const l=()=>{const i=e.get();this.latest[t]=r?ni(i,Kn[t]):i,n&&s.render(n)};l();const c=e.on("change",l);i&&e.addDependent(i);const u=()=>{c(),n&&o(n),this.values.delete(t),i&&e.removeDependent(i)};return this.values.set(t,{value:e,onRemove:u}),u}get(t){return this.values.get(t)?.value}}function si(t){const e=new WeakMap;return(n,i)=>{const s=e.get(n)??new ii;e.set(n,s);const o=[];for(const e in i){const r=i[e],a=t(n,s,e,r);o.push(a)}return()=>{for(const t of o)t()}}}const oi=(t,e,n,i)=>{const s=function(t,e){if(!(e in t))return!1;const n=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(t),e)||Object.getOwnPropertyDescriptor(t,e);return n&&"function"==typeof n.set}(t,n),o=s?n:n.startsWith("data")||n.startsWith("aria")?An(n):n,r=s?()=>{t[o]=e.latest[n]}:()=>{const i=e.latest[n];null==i?t.removeAttribute(o):t.setAttribute(o,String(i))};return e.set(n,i,r)},ri=ei(si(oi)),ai=si((t,e,n,i)=>e.set(n,i,()=>{t[n]=e.latest[n]},void 0,!1));function li(t){return e.isObject(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const ci={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"};const ui=new Set(["originX","originY","originZ"]),hi=(t,e,n,i)=>{let s,o;return re.has(n)?(e.get("transform")||(li(t)||e.get("transformBox")||hi(t,e,"transformBox",new Ze("fill-box")),e.set("transform",new Ze("none"),()=>{t.style.transform=function(t){let e="",n=!0;for(let i=0;i{const n=e.latest.originX??"50%",i=e.latest.originY??"50%",s=e.latest.originZ??0;t.style.transformOrigin=`${n} ${i} ${s}`}),o=e.get("transformOrigin")):s=xe(n)?()=>{t.style.setProperty(n,e.latest[n])}:()=>{t.style[n]=e.latest[n]},e.set(n,i,s,o)},di=ei(si(hi));const pi=ei(si((t,e,n,i)=>{if(n.startsWith("path"))return function(t,e,n,i){return s.render(()=>t.setAttribute("pathLength","1")),"pathOffset"===n?e.set(n,i,()=>{const i=e.latest[n];t.setAttribute("stroke-dashoffset",""+-i)}):(e.get("stroke-dasharray")||e.set("stroke-dasharray",new Ze("1 1"),()=>{const{pathLength:n=1,pathSpacing:i}=e.latest;t.setAttribute("stroke-dasharray",`${n} ${i??1-Number(n)}`)}),e.set(n,i,void 0,e.get("stroke-dasharray")))}(t,e,n,i);if(n.startsWith("attr"))return oi(t,e,function(t){return t.replace(/^attr([A-Z])/,(t,e)=>e.toLowerCase())}(n),i);return(n in t.style?hi:oi)(t,e,n,i)}));const{schedule:mi,cancel:fi}=i(queueMicrotask,!1),yi={x:!1,y:!1};function gi(){return yi.x||yi.y}function vi(t,e){const n=ti(t),i=new AbortController;return[n,{passive:!0,...e,signal:i.signal},()=>i.abort()]}const xi=(t,e)=>!!e&&(t===e||xi(t,e.parentElement)),Ti=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,wi=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function bi(t){return wi.has(t.tagName)||!0===t.isContentEditable}const Si=new Set(["INPUT","SELECT","TEXTAREA"]);const Vi=new WeakSet;function Ai(t){return e=>{"Enter"===e.key&&t(e)}}function Pi(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function Mi(t){return Ti(t)&&!gi()}const ki=new WeakSet;function Ei(t){return e.isObject(t)&&"ownerSVGElement"in t}const Di=new WeakMap;let Ci;const Ri=(t,e,n)=>(i,s)=>s&&s[0]?s[0][t+"Size"]:Ei(i)&&"getBBox"in i?i.getBBox()[e]:i[n],Bi=Ri("inline","width","offsetWidth"),ji=Ri("block","height","offsetHeight");function Li({target:t,borderBoxSize:e}){Di.get(t)?.forEach(n=>{n(t,{get width(){return Bi(t,e)},get height(){return ji(t,e)}})})}function Fi(t){t.forEach(Li)}function Oi(t,e){Ci||"undefined"!=typeof ResizeObserver&&(Ci=new ResizeObserver(Fi));const n=ti(t);return n.forEach(t=>{let n=Di.get(t);n||(n=new Set,Di.set(t,n)),n.add(e),Ci?.observe(t)}),()=>{n.forEach(t=>{const n=Di.get(t);n?.delete(e),n?.size||Ci?.unobserve(t)})}}const Ii=new Set;let $i;function Ni(t){return Ii.add(t),$i||($i=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};Ii.forEach(e=>e(t))},window.addEventListener("resize",$i)),()=>{Ii.delete(t),Ii.size||"function"!=typeof $i||(window.removeEventListener("resize",$i),$i=void 0)}}const Ui={value:null,addProjectionMetrics:null};function Wi(t){return Ei(t)&&"svg"===t.tagName}function zi(t,e){if("first"===t)return 0;{const n=e-1;return"last"===t?n:n/2}}function Ki(...t){const e=!Array.isArray(t[0]),n=e?0:-1,i=t[0+n],s=jt(t[1+n],t[2+n],t[3+n]);return e?s(i):s}function Yi(t,e){const n=_e(bn(t)?t.get():t);return Gi(n,t,e),n}function Gi(t,e,n={}){const i=t.get();let o,r=null,a=i;const l="string"==typeof i?i.replace(/[\d.-]/g,""):void 0,c=()=>{r&&(r.stop(),r=null),t.animation=void 0},u=()=>{(()=>{const e=qi(t.get()),i=qi(a);if(e===i)return void c();const s=r?r.getGeneratorVelocity():t.getVelocity();c(),r=new Gt({keyframes:[e,i],velocity:s,type:"spring",restDelta:.001,restSpeed:.01,...n,onUpdate:o})})(),t.animation=r??void 0,t.events.animationStart?.notify(),r?.then(()=>{t.animation=void 0,t.events.animationComplete?.notify()})};if(t.attach((t,e)=>{a=t,o=t=>e(Xi(t,l)),s.postRender(u)},c),bn(e)){let i=!0===n.skipInitialAnimation;const s=e.on("change",e=>{i?(i=!1,t.jump(Xi(e,l),!1)):t.set(Xi(e,l))}),o=t.on("destroy",s);return()=>{s(),o()}}return c}function Xi(t,e){return e?t+e:t}function qi(t){return"number"==typeof t?t:parseFloat(t)}function Hi(t){const e=[];He.current=e;const n=t();He.current=void 0;const i=_e(n);return function(t,e,n){const i=()=>e.set(n()),r=()=>s.preRender(i,!1,!0),a=t.map(t=>t.on("change",r));e.on("destroy",()=>{a.forEach(t=>t()),o(i)})}(e,i,t),i}const Zi=[...jn,F,K],_i=t=>Zi.find(Bn(t));let Ji=0;const Qi=()=>"motion-view-"+Ji++;function ts(t,e,n){e&&(t.style?.setProperty("view-transition-class",e),n.push(t))}function es(t,e,n,i,s){if(n&&(t.style?.setProperty("view-transition-group",n),i.push(t),"none"!==n&&s)){const n=getComputedStyle(t);"visible"===n.overflowX&&"visible"===n.overflowY||s.add(e)}}function ns(t,e,n,i,s,o=[],r,a=[],l){const c=ti(t);if(i)return c.map((t,c)=>{const u=e.get(t);if(u)return u;const h=i[c]??Qi();return t.style?.setProperty("view-transition-name",h),n.push(t),e.set(t,h),ts(t,s,o),es(t,h,r,a,l),h});const u=c.map(t=>e.has(t)?void 0:getComputedStyle(t).getPropertyValue("view-transition-name"));return c.map((t,i)=>{const c=e.get(t);if(c)return c;const h=u[i];let d;return h&&"none"!==h&&"auto"!==h&&"match-element"!==h&&!(t=>t.startsWith("motion-view-"))(h)?d=h:(d=Qi(),t.style?.setProperty("view-transition-name",d),n.push(t)),e.set(t,d),ts(t,s,o),es(t,d,r,a,l),d})}function is(t){return"layout"===t?"group":"enter"===t||"new"===t?"new":"old"}let ss={},os=null;const rs=(t,e)=>{ss[t]=e},as=()=>{os||(os=document.createElement("style"),os.id="motion-view");let t="";for(const e in ss){const n=ss[e];t+=`${e} {\n`;for(const[e,i]of Object.entries(n))t+=` ${e}: ${i};\n`;t+="}\n"}os.textContent=t,document.head.appendChild(os),ss={}},ls=()=>{os&&os.parentElement&&os.parentElement.removeChild(os)};function cs(t){const e=t.match(/::view-transition-(old|new|group-children|group|image-pair)\((.*?)\)/);return e?{layer:e[2],type:e[1]}:null}function us(){return document.getAnimations().filter(t=>{const{effect:e}=t;return!!e&&e.target===document.documentElement&&e.pseudoElement?.startsWith("::view-transition")})}const hs=["layout","enter","exit","new","old"],ds=t=>t.split(" ").every(t=>0===parseFloat(t)),ps={group:["layout"],new:["new","enter"],old:["old","exit"]},ms={new:{opacity:0,scale:.85},old:{opacity:1,scale:1}};function fs(t){const{update:n,targets:i,resolveDefs:s,cropOverride:o,pairs:r,classNames:a,flatGroups:l,options:c}=t;if(!document.startViewTransition)return(async()=>(await n(),new Ke([])))();const u=new Map,h=[],d=[],p=[],m=new Set,f=new Map,y=new Set,g=new Map,v=new Map,x=new Map,T=new Map,w=t=>{i.forEach((e,n)=>{const i=a.get(n),c="root"!==n&&s.has(n)?l.has(n)?"none":"contain":void 0;let y;if("root"!==n&&s.has(n))if(r.has(n))if("old"===t)T.set(n,ti(n)),y=ns(n,u,h,void 0,i,d,c,p,m),x.set(n,y);else{for(const t of T.get(n)??[])t.style?.removeProperty("view-transition-name"),u.delete(t);y=ns(r.get(n),u,h,x.get(n),i,d,c,p,m)}else y=ns(n,u,h,void 0,i,d,c,p,m);else y=[n];const w=o.get(n);y.forEach((n,i)=>{const s=f.get(n);f.set(n,s&&s!==e?{...s,...e}:e),void 0!==w&&g.set(n,w);const o=v.get(n)??{};o[t]=[i,y.length],v.set(n,o)})})},b=(t,e)=>{const n=v.get(t);return("old"===e?n?.old:"new"===e?n?.new:n?.new??n?.old)??[-1,1]},S=(t,e,n,i,s)=>{const o=ys(Qe(c,n),Qe(function(t,e){for(const n of ps[e]??[]){const e=t?.[n]?.options;if(e)return e}}(t,e)??{},n));return"function"==typeof o.delay&&(o.delay=o.delay(i,s)),o},V=t=>{const[n,i]=b(t,"group"),s=S(f.get(t),"group","layout",-1===n?0:n,i);s.duration&&(s.duration=e.secondsToMilliseconds(s.duration));const{delay:o=0,duration:r,ease:a}=Ce(s);return{delay:e.secondsToMilliseconds(o),duration:r,ease:a}},A=new Map,P=t=>u.forEach((e,n)=>{const i=n,s=i.getBoundingClientRect?.();if(s&&s.height){const n=getComputedStyle(i),o={};for(const t of _n)o[t]=n[t];const r=A.get(e)??{};r[t]={width:s.width,height:s.height,radii:o},A.set(e,r)}}),M=t=>{const e=A.get(t);return!!(e?.old&&e?.new&&e.old.height&&e.new.height)&&Math.abs(e.old.width/e.old.height-e.new.width/e.new.height)>.2},k=()=>{(function(t,e){return e.has(t)&&Object.keys(e.get(t)).length>0})("root",i)||rs(":root",{"view-transition-name":"none"}),rs("::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)",{"animation-timing-function":"linear !important"}),y.forEach(t=>{rs(`::view-transition-group(${t})`,{overflow:"clip"}),rs(`::view-transition-old(${t}), ::view-transition-new(${t})`,{width:"100%",height:"100%","object-fit":"cover"})}),m.forEach(t=>{rs(`::view-transition-group-children(${t})`,{overflow:"clip"})}),as()},E=()=>{!function(t,e=[],n=[]){for(const e of t)e.style?.removeProperty("view-transition-name");for(const t of e)t.style?.removeProperty("view-transition-class");for(const t of n)t.style?.removeProperty("view-transition-group")}(h,d,p),ls()},D=async()=>{await n(),w("new"),P("new"),(()=>{y.clear();for(const t of v.keys())"root"!==t&&(g.get(t)??M(t))&&y.add(t)})(),k()};let C;try{w("old"),P("old"),k(),C=document.startViewTransition(D)}catch(t){return E(),Promise.reject(t)}return C.finished.finally(E),new Promise((t,n)=>{C.ready.then(()=>{const n=us(),i=[],s=new Set,o=new Set;f.forEach((t,n)=>{const r=v.get(n),a=!!r?.new&&!r?.old,l=!!r?.old&&!r?.new;for(const r of hs){if(!t[r])continue;if("enter"===r&&!a)continue;if("exit"===r&&!l)continue;const u=is(r),[h,d]=b(n,u);if(-1===h)continue;const{keyframes:p,options:m}=t[r];for(let[f,y]of Object.entries(p)){if(null==y)continue;if("x"===f||"y"===f){e.warnOnce(!1,`animateView() animates view-transition layers with CSS properties; the "${f}" shorthand has no effect - use transform, e.g. { transform: "translateX(40px)" }.`);continue}if("new"===r&&a&&null!=t.enter?.keyframes[f])continue;if("old"===r&&l&&null!=t.exit?.keyframes[f])continue;const p=ys(Qe(c,f),Qe(m,f));if(!Array.isArray(y)){const e="enter"===r?t.exit?.keyframes[f]:void 0,n="opacity"===f||("new"===u?a:l),i=null!=e?Array.isArray(e)?e[e.length-1]:e:n?ms[u]?.[f]:void 0;void 0!==i&&(y=[i,y])}"function"==typeof p.delay&&(p.delay=p.delay(h,d)),p.duration&&(p.duration=e.secondsToMilliseconds(p.duration)),p.delay&&(p.delay=e.secondsToMilliseconds(p.delay)),i.push(new Re({...p,element:document.documentElement,name:f,pseudoElement:`::view-transition-${u}(${n})`,keyframes:y})),s.add(`${n}:${u}`),"opacity"===f&&o.add(`${n}:${u}`)}}});for(const t of n){if("finished"===t.playState)continue;const{effect:n}=t;if(!(n&&n instanceof KeyframeEffect))continue;const{pseudoElement:r}=n;if(!r)continue;const a=cs(r);if(!a)continue;const l=f.get(a.layer);if(s.has(`${a.layer}:${a.type}`)){o.has(`${a.layer}:new`)&&o.has(`${a.layer}:old`)&&n.getKeyframes().some(t=>t.mixBlendMode)?i.push(new Ge(t)):t.cancel();continue}const c="old"===a.type?"new":"new"===a.type?"old":void 0;if(c&&s.has(`${a.layer}:${c}`)&&!o.has(`${a.layer}:${c}`)){t.cancel();continue}const u=v.get(a.layer),h=!("old"!==a.type&&"new"!==a.type||!u?.old||!u?.new);let d;if(a.type.startsWith("group")){const{delay:t,duration:e,ease:n}=V(a.layer);d={delay:t,duration:e,easing:ke(n,e)}}else{const t=h?"group":a.type,[n,i]=b(a.layer,t);let s=S(l,t,"group"===t?"layout":"",-1===n?0:n,i);const o=s.visualDuration;s.duration&&(s.duration=e.secondsToMilliseconds(s.duration)),s=Ce(s),d={delay:e.secondsToMilliseconds(s.delay??0),duration:h&&void 0!==o?e.secondsToMilliseconds(o):s.duration,easing:h?"linear":ke(s.ease,s.duration)}}n.updateTiming(d),i.push(new Ge(t))}A.forEach((t,e)=>{if(!y.has(e))return;const{delay:n,duration:s,ease:o}=V(e);for(const r of _n){const a=t.old?.radii[r]||t.new?.radii[r]||"0px",l=t.new?.radii[r]||t.old?.radii[r]||"0px";ds(a)&&ds(l)||i.push(new Re({element:document.documentElement,name:r,pseudoElement:`::view-transition-group(${e})`,keyframes:[a,l],delay:n,duration:s,ease:o}))}}),t(new Ke(i))}).catch(()=>C.updateCallbackDone.then(()=>t(new Ke([])),n))})}function ys(t,e){const n={...t,...e};return void 0!==e.duration&&(void 0===e.visualDuration&&delete n.visualDuration,void 0===e.type&&delete n.type),n}let gs=[],vs=null;function xs(){vs=null;const[t]=gs;var n;t&&(n=t,e.removeItem(gs,n),vs=n,fs(n).then(t=>(n.notifyReady(t),t.finished)).catch(t=>n.notifyReject(t)).finally(xs))}function Ts(){for(let t=gs.length-1;t>=0;t--){const e=gs[t],{interrupt:n}=e.options;if("immediate"===n){const n=gs.slice(0,t+1).map(t=>t.update),i=gs.slice(t+1);e.update=()=>{n.forEach(t=>t())},gs=[e,...i];break}}vs&&"immediate"!==gs[0]?.options.interrupt||xs()}class ws{constructor(t,n={}){var i;this.currentSubject="root",this.targets=new Map,this.resolveDefs=new Set,this.cropOverride=new Map,this.pairs=new Map,this.classNames=new Map,this.flatGroups=new Set,this.notifyReady=e.noop,this.notifyReject=e.noop,this.readyPromise=new Promise((t,e)=>{this.notifyReady=t,this.notifyReject=e}),this.update=t,this.options={interrupt:"wait",...n},this.readyPromise.catch(e.noop),i=this,gs.push(i),mi.render(Ts)}add(t,e){return this.currentSubject=t,this.resolveDefs.add(t),void 0!==e&&this.pairs.set(t,e),this.targets.has(t)||this.targets.set(t,{}),this}crop(t=!0){return this.cropOverride.set(this.currentSubject,t),this}group(t=!0){return t?this.flatGroups.delete(this.currentSubject):this.flatGroups.add(this.currentSubject),this}class(t){return this.classNames.set(this.currentSubject,t),this}layout(t={}){return this.updateTarget("layout",{},t),this}enter(t,e){return this.updateTarget("enter",t,e),this}exit(t,e){return this.updateTarget("exit",t,e),this}new(t,e){return this.updateTarget("new",t,e),this}old(t,e){return this.updateTarget("old",t,e),this}updateTarget(t,e,n={}){const{currentSubject:i,targets:s}=this;s.has(i)||s.set(i,{});s.get(i)[t]={keyframes:e,options:n}}then(t,e){return this.readyPromise.then(t,e)}}const bs=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ss=()=>({x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}),Vs=()=>({min:0,max:0}),As=()=>({x:{min:0,max:0},y:{min:0,max:0}}),Ps=new WeakMap;function Ms(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function ks(t){return"string"==typeof t||Array.isArray(t)}const Es=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Ds=["initial",...Es];function Cs(t){return Ms(t.animate)||Ds.some(e=>ks(t[e]))}function Rs(t){return Boolean(Cs(t)||t.variants)}function Bs(t,e,n){for(const i in e){const s=e[i],o=n[i];if(bn(s))t.addValue(i,s);else if(bn(o))t.addValue(i,_e(s,{owner:t}));else if(o!==s)if(t.hasValue(i)){const e=t.getValue(i);!0===e.liveStyle?e.jump(s):e.hasAnimated||e.set(s)}else{const e=t.getStaticValue(i);t.addValue(i,_e(void 0!==e?e:s,{owner:t}))}}for(const i in n)void 0===e[i]&&t.removeValue(i);return e}const js={current:null},Ls={current:!1},Fs="undefined"!=typeof window;function Os(){if(Ls.current=!0,Fs)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>js.current=t.matches;t.addEventListener("change",e),e()}else js.current=!1}const Is=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let $s={};class Ns{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:i,skipAnimations:o,blockInitialAnimation:r,visualState:a},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=ve,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const t=u.now();this.renderScheduledAtthis.bindToMotionValue(e,t)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(Ls.current||Os(),this.shouldReduceMotion=js.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),o(this.notifyUpdate),o(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&Ie.has(t)&&this.current instanceof HTMLElement){const{factory:i,keyframes:s,times:o,ease:r,duration:a}=n.accelerate,l=new Re({element:this.current,name:t,keyframes:s,times:o,ease:r,duration:e.secondsToMilliseconds(a)}),c=i(l);return void this.valueSubscriptions.set(t,()=>{c(),l.cancel()})}const i=re.has(t);i&&this.onBindTransform&&this.onBindTransform();const o=n.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&s.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let r;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{o(),r&&r()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in $s){const e=$s[t];if(!e)continue;const{isEnabled:n,Feature:i}=e;if(!this.features[t]&&i&&n(this.props)&&(this.features[t]=new i(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;ee.variantChildren.delete(t)}addValue(t,e){const n=this.values.get(t);e!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=_e(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,n){let i=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];return null!=i&&("string"==typeof i&&(e.isNumericalString(i)||e.isZeroValueString(i))?i=parseFloat(i):!_i(i)&&K.test(n)&&(i=qn(t,n)),this.setBaseTarget(t,bn(i)?i.get():i)),bn(i)?i.get():i}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let n;if("string"==typeof e||"object"==typeof e){const i=fn(this.props,e,this.presenceContext?.custom);i&&(n=i[t])}if(e&&void 0!==n)return n;const i=this.getBaseTargetFromProps(this.props,t);return void 0===i||bn(i)?void 0!==this.initialValues[t]&&void 0===n?void 0:this.baseTarget[t]:i}on(t,n){return this.events[t]||(this.events[t]=new e.SubscriptionManager),this.events[t].add(n)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){mi.render(this.render)}}class Us extends Ns{constructor(){super(...arguments),this.KeyframeResolver=Zn}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){const n=t.style;return n?n[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;bn(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}function Ws({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function zs(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),i=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}function Ks(t){return void 0===t||1===t}function Ys({scale:t,scaleX:e,scaleY:n}){return!Ks(t)||!Ks(e)||!Ks(n)}function Gs(t){return Ys(t)||Xs(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Xs(t){return qs(t.x)||qs(t.y)}function qs(t){return t&&"0%"!==t}function Hs(t,e,n){return n+e*(t-n)}function Zs(t,e,n,i,s){return void 0!==s&&(t=Hs(t,s,i)),Hs(t,n,i)+e}function _s(t,e=0,n=1,i,s){t.min=Zs(t.min,e,n,i,s),t.max=Zs(t.max,e,n,i,s)}function Js(t,{x:e,y:n}){_s(t.x,e.translate,e.scale,e.originPoint),_s(t.y,n.translate,n.scale,n.originPoint)}const Qs=.999999999999,to=1.0000000000001;function eo(t,e,n,i=!1){const s=n.length;if(!s)return;let o,r;e.x=e.y=1;for(let a=0;aQs&&(e.x=1),e.yQs&&(e.y=1)}function no(t,e){t.min+=e,t.max+=e}function io(t,e,n,i,s=.5){_s(t,e,n,q(t.min,t.max,s),i)}function so(t,e){return"string"==typeof t?parseFloat(t)/100*(e.max-e.min):t}function oo(t,e,n){const i=n??t;io(t.x,so(e.x,i.x),e.scaleX,e.scale,e.originX),io(t.y,so(e.y,i.y),e.scaleY,e.scale,e.originY)}function ro(t,e){return Ws(zs(t.getBoundingClientRect(),e))}const ao={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},lo=oe.length;function co(t,e,n){let i="",s=!0;for(let o=0;o{if(!e.target)return t;if("string"==typeof t){if(!C.test(t))return t;t=parseFloat(t)}return`${po(t,e.target.x)}% ${po(t,e.target.y)}%`}},fo={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,s=K.parse(t);if(s.length>5)return i;const o=K.createTransformer(t),r="number"!=typeof s[0]?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;s[0+r]/=a,s[1+r]/=l;const c=q(a,l,.5);return"number"==typeof s[2+r]&&(s[2+r]/=c),"number"==typeof s[3+r]&&(s[3+r]/=c),o(s)}},yo={borderRadius:{...mo,applyTo:[..._n]},borderTopLeftRadius:mo,borderTopRightRadius:mo,borderBottomLeftRadius:mo,borderBottomRightRadius:mo,boxShadow:fo};function go(t,{layout:e,layoutId:n}){return re.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!yo[t]||"opacity"===t)}function vo(t,e,n){const i=t.style,s=e?.style,o={};if(!i)return o;for(const e in i)(bn(i[e])||s&&bn(s[e])||go(e,t)||void 0!==n?.getValue(e)?.liveStyle)&&(o[e]=i[e]);return o}class xo extends Us{constructor(){super(...arguments),this.type="html",this.renderInstance=ho}mount(t){e.invariant(Boolean(t.style),"motion.create() components must forward their ref to a HTML or SVG element","custom-component-ref"),super.mount(t)}readValueFromInstance(t,e){if(re.has(e))return this.projection?.isProjecting?ee(e):ie(t,e);{const i=(n=t,window.getComputedStyle(n)),s=(d(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof s?s.trim():s}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return ro(t,e)}build(t,e,n){uo(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return vo(t,e,n)}}const To={offset:"stroke-dashoffset",array:"stroke-dasharray"},wo={offset:"strokeDashoffset",array:"strokeDasharray"};function bo(t,e,n=1,i=0,s=!0){t.pathLength=1;const o=s?To:wo;t[o.offset]=""+-i,t[o.array]=`${e} ${n}`}const So=["transform","opacity","offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Vo(t,{attrX:e,attrY:n,attrScale:i,pathLength:s,pathSpacing:o=1,pathOffset:r=0,...a},l,c,u){if(uo(t,a,c),l)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:h,style:d}=t;for(const t of So)void 0!==h[t]&&(d[t]=h[t],delete h[t]);(d.transform||h.transformOrigin)&&(d.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),d.transform&&(d.transformBox=u?.transformBox??"fill-box",delete h.transformBox),void 0!==e&&(h.x=e),void 0!==n&&(h.y=n),void 0!==i&&(h.scale=i),void 0!==s&&bo(h,s,o,r,!1)}const Ao=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),Po=t=>"string"==typeof t&&"svg"===t.toLowerCase();function Mo(t,e,n,i){ho(t,e,void 0,i);for(const n in e.attrs)t.setAttribute(Ao.has(n)?n:An(n),e.attrs[n])}function ko(t,e,n){const i=vo(t,e,n);for(const n in t)if(bn(t[n])||bn(e[n])){i[-1!==oe.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]}return i}const Eo=Ds.length;function Do(t){if(!t)return;if(!t.isControllingVariants){const e=t.parent&&Do(t.parent)||{};return void 0!==t.props.initial&&(e.initial=t.props.initial),e}const e={};for(let n=0;n=.9999&&t.scale<=1.0001||isNaN(t.scale))&&(t.scale=1),(t.translate>=-.01&&t.translate<=.01||isNaN(t.translate))&&(t.translate=0)}function zo(t,e,n,i){Wo(t.x,e.x,n.x,i?i.originX:void 0),Wo(t.y,e.y,n.y,i?i.originY:void 0)}function Ko(t,e,n,i=0){const s=i?q(n.min,n.max,i):n.min;t.min=s+e.min,t.max=t.min+No(e)}function Yo(t,e,n,i){Ko(t.x,e.x,n.x,i?.x),Ko(t.y,e.y,n.y,i?.y)}function Go(t,e,n,i=0){const s=i?q(n.min,n.max,i):n.min;t.min=e.min-s,t.max=t.min+No(e)}function Xo(t,e,n,i){Go(t.x,e.x,n.x,i?.x),Go(t.y,e.y,n.y,i?.y)}function qo(t,e,n,i,s){return t=Hs(t-=e,1/n,i),void 0!==s&&(t=Hs(t,1/s,i)),t}function Ho(t,e=0,n=1,i=.5,s,o=t,r=t){if(D.test(e)){e=parseFloat(e);e=q(r.min,r.max,e/100)-r.min}if("number"!=typeof e)return;let a=q(o.min,o.max,i);t===o&&(a-=e),t.min=qo(t.min,e,n,a,s),t.max=qo(t.max,e,n,a,s)}function Zo(t,e,[n,i,s],o,r){Ho(t,e[n],e[i],e[s],e.scale,o,r)}const _o=["x","scaleX","originX"],Jo=["y","scaleY","originY"];function Qo(t,e,n,i){Zo(t.x,e,_o,n?n.x:void 0,i?i.x:void 0),Zo(t.y,e,Jo,n?n.y:void 0,i?i.y:void 0)}function tr(t){return 0===t.translate&&1===t.scale}function er(t){return tr(t.x)&&tr(t.y)}function nr(t,e){return t.min===e.min&&t.max===e.max}function ir(t,e){return nr(t.x,e.x)&&nr(t.y,e.y)}function sr(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function or(t,e){return sr(t.x,e.x)&&sr(t.y,e.y)}function rr(t){return No(t.x)/No(t.y)}function ar(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function lr(t){return[t("x"),t("y")]}function cr(t,e,n){let i="";const s=t.x.translate/e.x,o=t.y.translate/e.y,r=n?.z||0;if((s||o||r)&&(i=`translate3d(${s}px, ${o}px, ${r}px) `),1===e.x&&1===e.y||(i+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:t,rotate:e,pathRotation:s,rotateX:o,rotateY:r,skewX:a,skewY:l}=n;t&&(i=`perspective(${t}px) ${i}`),e&&(i+=`rotate(${e}deg) `),s&&(i+=`rotate(${s}deg) `),o&&(i+=`rotateX(${o}deg) `),r&&(i+=`rotateY(${r}deg) `),a&&(i+=`skewX(${a}deg) `),l&&(i+=`skewY(${l}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return 1===a&&1===l||(i+=`scale(${a}, ${l})`),i||"none"}const ur=_n.length,hr=t=>"string"==typeof t?parseFloat(t):t,dr=t=>"number"==typeof t||C.test(t);function pr(t,e,n,i,s,o){s?(t.opacity=q(0,n.opacity??1,fr(i)),t.opacityExit=q(e.opacity??1,0,yr(i))):o&&(t.opacity=q(e.opacity??1,n.opacity??1,i));for(let s=0;ssn?1:i(e.progress(t,n,s))}function vr(t,e,n){const i=bn(t)?t:_e(t);return i.start(an("",i,e,n)),i.animation}function xr(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n,i)}const Tr=(t,e)=>t.depth-e.depth;class wr{constructor(){this.children=[],this.isDirty=!1}add(t){e.addUniqueItem(this.children,t),this.isDirty=!0}remove(t){e.removeItem(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Tr),this.isDirty=!1,this.children.forEach(t)}}function br(t,e){const n=u.now(),i=({timestamp:s})=>{const r=s-n;r>=e&&(o(i),t(r-e))};return s.setup(i,!0),()=>o(i)}function Sr(t){return bn(t)?t.get():t}class Vr{constructor(){this.members=[]}add(t){e.addUniqueItem(this.members,t);for(let n=this.members.length-1;n>=0;n--){const i=this.members[n];if(i===t||i===this.lead||i===this.prevLead)continue;const s=i.instance;s&&!1!==s.isConnected||i.snapshot||(e.removeItem(this.members,i),i.unmount())}t.scheduleRender()}remove(t){if(e.removeItem(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){for(let e=this.members.indexOf(t)-1;e>=0;e--){const t=this.members[e];if(!1!==t.isPresent&&!1!==t.instance?.isConnected)return this.promote(t),!0}return!1}promote(t,e){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.updateSnapshot(),t.scheduleRender();const{layoutDependency:i}=n.options,{layoutDependency:s}=t.options;void 0!==i&&i===s||(t.resumeFrom=n,e&&(n.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root?.isUpdating&&(t.isLayoutDirty=!0)),!1===t.options.crossfade&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{t.options.onExitComplete?.(),t.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}const Ar={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Pr={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},Mr=["","X","Y","Z"];let kr=0;function Er(t,e,n,i){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),i&&(i[t]=0))}function Dr(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=kn(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:e,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",s,!(e||i))}const{parent:i}=t;i&&!i.hasCheckedOptimisedAppear&&Dr(i)}function Cr({attachResizeListener:t,defaultParent:n,measureScroll:i,checkIsScrollRoot:l,resetTransform:c}){return class{constructor(t={},e=n?.()){this.id=kr++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Ui.value&&(Pr.nodes=Pr.calculatedTargetDeltas=Pr.calculatedProjections=0),this.nodes.forEach(jr),this.nodes.forEach(zr),this.nodes.forEach(Kr),this.nodes.forEach(Lr),Ui.addProjectionMetrics&&Ui.addProjectionMetrics(Pr)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=t,this.root=e?e.root||e:this,this.path=e?[...e.path,e]:[],this.parent=e,this.depth=e?e.depth+1:0;for(let t=0;tthis.root.updateBlockedByResize=!1;s.read(()=>{i=window.innerWidth}),t(e,()=>{const t=window.innerWidth;t!==i&&(i=t,this.root.updateBlockedByResize=!0,n&&n(),n=br(o,250),Ar.hasAnimatedSinceResize&&(Ar.hasAnimatedSinceResize=!1,this.nodes.forEach(Wr)))})}n&&this.root.registerSharedNode(n,this),!1!==this.options.animate&&o&&(n||i)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeLayoutChanged:n,layout:i})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const s=this.options.transition||o.getDefaultTransition()||Zr,{onLayoutAnimationStart:r,onLayoutAnimationComplete:a}=o.getProps(),l=!this.targetLayout||!or(this.targetLayout,i),c=!e&&n;if(this.options.layoutRoot||this.resumeFrom||c||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const e={...Qe(s,"layout"),onPlay:r,onComplete:a};(o.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e),this.setAnimationOrigin(t,c,e.path)}else e||Wr(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=i})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const t=this.getStack();t&&t.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),o(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Yr),this.animationId++)}getTransformTemplate(){const{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Dr(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||No(this.snapshot.measuredBox.x)||No(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;t{const n=e/1e3,i=p?.(n);var c,m,f,y;i?(r.x.translate=i.x,r.x.scale=q(t.x.scale,1,n),r.x.origin=t.x.origin,r.x.originPoint=t.x.originPoint,r.y.translate=i.y,r.y.scale=q(t.y.scale,1,n),r.y.origin=t.y.origin,r.y.originPoint=t.y.originPoint):(Xr(r.x,t.x,n),Xr(r.y,t.y,n)),this.setTargetDelta(r),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Xo(a,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),c=this.relativeTarget,m=this.relativeTargetOrigin,f=a,y=n,qr(c.x,m.x,f.x,y),qr(c.y,m.y,f.y,y),d&&ir(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||(d={x:{min:0,max:0},y:{min:0,max:0}}),Io(d,this.relativeTarget)),l&&(this.animationValues=o,pr(o,s,this.latestValues,n,h,u)),i&&void 0!==i.rotate&&(this.animationValues||(this.animationValues=o),this.animationValues.pathRotation=i.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(t){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(o(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=s.update(()=>{Ar.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=_e(0)),this.motionValue.jump(0,!1),this.currentAnimation=vr(this.motionValue,[0,1e3],{...t,velocity:0,isSync:!0,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onComplete:()=>{t.onComplete&&t.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const t=this.getStack();t&&t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead();let{targetWithTransforms:e,target:n,layout:i,latestValues:s}=t;if(e&&n&&i){if(this!==t&&this.layout&&i&&ta(this.options.animationType,this.layout.layoutBox,i.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=No(this.layout.layoutBox.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const i=No(this.layout.layoutBox.y);n.y.min=t.target.y.min,n.y.max=n.y.min+i}Io(e,n),oo(e,s),zo(this.projectionDeltaWithTransform,this.layoutCorrected,e,s)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new Vr);this.sharedNodes.get(t).add(e);const n=e.options.initialPromotionConfig;e.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(e):void 0})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){const{layoutId:t}=this.options;return t&&this.getStack()?.lead||this}getPrevLead(){const{layoutId:t}=this.options;return t?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:n}={}){const i=this.getStack();i&&i.promote(this,n),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetSkewAndRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const{latestValues:n}=t;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(e=!0),!e)return;const i={};n.z&&Er("z",t,i,this.animationValues);for(let e=0;et.currentAnimation?.stop()),this.root.nodes.forEach(Or),this.root.sharedNodes.clear()}}}function Rr(t){t.updateLayout()}function Br(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=t.layout,{animationType:s}=t.options,o=e.source!==t.layout.source;if("size"===s)lr(t=>{const i=o?e.measuredBox[t]:e.layoutBox[t],s=No(i);i.min=n[t].min,i.max=i.min+s});else if("x"===s||"y"===s){const t="x"===s?"y":"x";Oo(o?e.measuredBox[t]:e.layoutBox[t],n[t])}else ta(s,e.layoutBox,n)&&lr(i=>{const s=o?e.measuredBox[i]:e.layoutBox[i],r=No(n[i]);s.max=s.min+r,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[i].max=t.relativeTarget[i].min+r)});const r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};zo(r,n,e.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};o?zo(a,t.applyTransform(i,!0),e.measuredBox):zo(a,n,e.layoutBox);const l=!er(r);let c=!1;if(!t.resumeFrom){const i=t.getClosestProjectingParent();if(i&&!i.resumeFrom){const{snapshot:s,layout:o}=i;if(s&&o){const r=t.options.layoutAnchor||void 0,a={x:{min:0,max:0},y:{min:0,max:0}};Xo(a,e.layoutBox,s.layoutBox,r);const l={x:{min:0,max:0},y:{min:0,max:0}};Xo(l,n,o.layoutBox,r),or(a,l)||(c=!0),i.options.layoutRoot&&(t.relativeTarget=l,t.relativeTargetOrigin=a,t.relativeParent=i)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:a,layoutDelta:r,hasLayoutChanged:l,hasRelativeLayoutChanged:c})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function jr(t){Ui.value&&Pr.nodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=Boolean(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function Lr(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Fr(t){t.clearSnapshot()}function Or(t){t.clearMeasurements()}function Ir(t){t.isLayoutDirty=!0,t.updateLayout()}function $r(t){t.isLayoutDirty=!1}function Nr(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function Ur(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Wr(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function zr(t){t.resolveTargetDelta()}function Kr(t){t.calcProjection()}function Yr(t){t.resetSkewAndRotation()}function Gr(t){t.removeLeadSnapshot()}function Xr(t,e,n){t.translate=q(e.translate,0,n),t.scale=q(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function qr(t,e,n,i){t.min=q(e.min,n.min,i),t.max=q(e.max,n.max,i)}function Hr(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const Zr={duration:.45,ease:[.4,0,.1,1]},_r=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Jr=_r("applewebkit/")&&!_r("chrome/")?Math.round:e.noop;function Qr(t){t.min=Jr(t.min),t.max=Jr(t.max)}function ta(t,e,n){return"position"===t||"preserve-aspect"===t&&!Uo(rr(e),rr(n),.2)}function ea(t){return t!==t.root&&t.scroll?.wasRoot}const na=Cr({attachResizeListener:(t,e)=>xr(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),ia=t=>!t.isLayoutDirty&&t.willUpdate(!1);const sa={current:void 0},oa=Cr({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!sa.current){const t=new na({});t.mount(window),t.setOptions({layoutScroll:!0}),sa.current=t}return sa.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),ra="[data-layout],[data-layout-id]",aa=new WeakMap;let la;function ca(t){const e=[];return t instanceof HTMLElement&&t.matches(ra)&&e.push(t),t.querySelectorAll(ra).forEach(t=>{t instanceof HTMLElement&&e.push(t)}),e}function ua(t,e){const n=t.getAttribute("data-layout");return{layoutId:t.getAttribute("data-layout-id")??void 0,layout:null!==n||void 0,animationType:n&&"true"!==n?n:"both",transition:e}}function ha(t,e){let n=aa.get(t);if(n)n.setOptions(ua(t,e));else{let i=Ps.get(t);i||(i=new xo({props:{},presenceContext:null,visualState:{latestValues:{},renderState:{transform:{},transformOrigin:{},style:{},vars:{}}}},{allowProjection:!0})),t.style.transform&&!Gs(i.latestValues)&&(t.style.transform=""),n=new oa(i.latestValues,function(t){let e=t.parentElement;for(;e;){const t=aa.get(e);if(t&&t.instance)return t;e=e.parentElement}}(t)),i.projection=n,n.setOptions({...ua(t,e),visualElement:i}),n.mount(t),aa.set(t,n)}return n.isPresent=!0,n.options.onExitComplete&&n.setOptions({onExitComplete:void 0}),n}function da(t,e){e.setOptions({onExitComplete:void 0});e.getStack()&&!e.isLead()||e.currentAnimation?.stop(),e.unmount(),aa.delete(t)}function pa(){const t=la;la=void 0,function(){if(r.isProcessing)return;const t=u.now();r.delta=e.clamp(0,1e3/60,t-r.timestamp),r.timestamp=t,r.isProcessing=!0,a.update.process(r),a.preRender.process(r),a.render.process(r),r.isProcessing=!1}();const n=new Map;for(const e of t)for(const t of e.collectTargets()){const i=n.get(t);i?i.push(e):n.set(t,[e])}const i=new Map;for(const t of(s=n.keys(),[...s].sort((t,e)=>t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1))){const e=n.get(t),s=ha(t,e[e.length-1].transitionFor(t));for(const n of e)n.adopt(t,s);i.set(t,s)}var s;i.forEach(t=>{t.isLayoutDirty=!1,t.willUpdate()});const o=[];for(const e of t){const t=e.runUpdate();t&&o.push(t)}const l=()=>{const e=new Set;for(const n of t)n.reconcileAdditions(e);for(const n of t)n.reconcileRemovals(e);let n;i.forEach(t=>n||(n=t.root));for(const e of t)n||(n=e.getRoot());n?.didUpdate(),mi.render(()=>{for(const e of t)e.finalize()})};o.length?Promise.all(o).then(l):l()}const ma=s,fa=n.reduce((t,e)=>(t[e]=t=>o(t),t),{});t.AsyncMotionValueAnimation=ze,t.DOMKeyframesResolver=Zn,t.DOMVisualElement=Us,t.DocumentProjectionNode=na,t.Feature=class{constructor(t){this.isMounted=!1,this.node=t}update(){}},t.FlatTree=wr,t.GroupAnimation=Ke,t.GroupAnimationWithThen=class extends Ke{then(t,e){return this.finished.finally(t).then(()=>{})}},t.HTMLProjectionNode=oa,t.HTMLVisualElement=xo,t.JSAnimation=Gt,t.KeyframeResolver=ve,t.LayoutAnimationBuilder=class{constructor(t,e,n){this.scope=t,this.updateDom=e,this.defaultOptions=n,this.sharedTransitions=new Map,this.notifyReady=()=>{},this.rejectReady=()=>{},this.tracked=new Map,this.restorePoints=new Map,this.readyPromise=new Promise((t,e)=>{this.notifyReady=t,this.rejectReady=e}),la||(la=[],queueMicrotask(pa)),la.push(this)}shared(t,e){return this.sharedTransitions.set(t,e),this}then(t,e){return this.readyPromise.then(t,e)}transitionFor(t){const e=t.getAttribute("data-layout-id");return e&&this.sharedTransitions.get(e)||this.defaultOptions}adopt(t,e){this.tracked.set(t,e),this.restorePoints.set(t,{parent:t.parentElement,next:t.nextSibling})}collectTargets(){return ca(this.scope)}runUpdate(){try{const t=this.updateDom();if(t&&"function"==typeof t.then)return t.then(void 0,t=>{this.updateError=t})}catch(t){this.updateError=t}}reconcileAdditions(t){for(const e of ca(this.scope)){if(this.tracked.has(e))continue;const n=ha(e,this.transitionFor(e));this.adopt(e,n),n.options.layoutId&&t.add(n.options.layoutId)}}reconcileRemovals(t){this.tracked.forEach((e,n)=>{if(n.isConnected)return;const i=this.restorePoints.get(n);this.restorePoints.delete(n);const{layoutId:s}=e.options,o=e.getStack(),r=o&&o.members.some(t=>t!==e&&t.instance?.isConnected);if(s&&e.isLead()&&r&&!t.has(s)&&i&&i.parent.isConnected){if(i.parent.insertBefore(n,i.next&&i.next.parentNode===i.parent?i.next:null),e.isPresent=!1,e.setOptions({onExitComplete:()=>{n.remove(),da(n,e)}}),e.relegate())return;n.remove()}da(n,e),this.tracked.delete(n)})}getRoot(){let t;return this.tracked.forEach(e=>t||(t=e.root)),t}finalize(){if(this.updateError)return void this.rejectReady(this.updateError);const t=new Set;this.tracked.forEach(e=>{e.instance&&e.currentAnimation&&t.add(e.currentAnimation)}),this.notifyReady(new Ke([...t]))}},t.MotionValue=Ze,t.NativeAnimation=Re,t.NativeAnimationExtended=Le,t.NativeAnimationWrapper=Ge,t.NodeStack=Vr,t.ObjectVisualElement=class extends Ns{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,e){if(function(t,e){return t in e}(e,t)){const n=t[e];if("string"==typeof n||"number"==typeof n)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(t,e){delete e.output[t]}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}build(t,e){Object.assign(t.output,e)}renderInstance(t,{output:e}){Object.assign(t,e)}sortInstanceNodePosition(){return 0}},t.SVGVisualElement=class extends Us{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=As}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(re.has(e)){const t=Gn(e);return t&&t.default||0}if(So.includes(e)){const n=getComputedStyle(t)[e];if("string"==typeof n&&n)return n.trim()}return e=Ao.has(e)?e:An(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return ko(t,e,n)}build(t,e,n){Vo(t,e,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,e,n,i){Mo(t,e,0,i)}mount(t){this.isSVGTag=Po(t.tagName),super.mount(t)}},t.ViewTransitionBuilder=ws,t.VisualElement=Ns,t.acceleratedValues=Ie,t.addAttrValue=oi,t.addDomEvent=xr,t.addScaleCorrector=function(t){for(const e in t)yo[e]=t[e],d(e)&&(yo[e].isCSSVariable=!0)},t.addStyleValue=hi,t.addValueToWillChange=Vn,t.alpha=v,t.analyseComplexValue=U,t.animateMotionValue=an,t.animateSingleValue=vr,t.animateTarget=Dn,t.animateValue=function(t){return new Gt(t)},t.animateVariant=Cn,t.animateView=function(t,e={}){return new ws(t,e)},t.animateVisualElement=Rn,t.animationMapKey=(t,e="")=>`${t}:${e}`,t.applyAxisDelta=_s,t.applyBoxDelta=Js,t.applyGeneratorOptions=Ce,t.applyPointDelta=Zs,t.applyPxDefaults=function(t,e){for(let n=0;n{const l=a.x-s.x,c=a.y-s.y;let u;u="cw"===i?-t:"ccw"===i?t:(Math.abs(l)>=Math.abs(c)?l:c)<0?-t:t;let h=un(s.x,s.y,a.x,a.y,u,n);if(void 0===i){const t=Math.abs(l){const n={x:ln(t,s.x,h.x,a.x),y:ln(t,s.y,h.y,a.y)};if(o){const i=cn(t,s.x,h.x,a.x,s.y,h.y,a.y),r=d+m*t;n.rotate=e.wrap(-180,180,i-r)*o}return n}}}(t),i={interpolateProjection(t){const e=t.x.translate,i=t.y.translate;if(!(Math.sqrt(e*e+i*i)<20))return n({x:e,y:i},{x:0,y:0})},animateVisualElement(t,e,i,s,o){if(!("x"in e)&&!("y"in e))return;const r=t.getValue("x",t.latestValues.x??0),a=t.getValue("y",t.latestValues.y??0),l=e.x,c=e.y,u=(Array.isArray(l)&&null!=l[0]?l[0]:r?.get())??0,h=(Array.isArray(c)&&null!=c[0]?c[0]:a?.get())??0,d=Array.isArray(l)?l[l.length-1]:l??u,p=Array.isArray(c)?c[c.length-1]:c??h,m=n({x:u,y:h},{x:d,y:p}),f=void 0!==m(0).rotate?t.getValue("pathRotation",0):void 0,y={delay:s,...Qe(i||{},"x")};delete y.path;const g=_e(0);g.start(an("",g,[0,1e3],{...y,isSync:!0,velocity:0,onUpdate:t=>{const e=m(t/1e3);r?.set(e.x),a?.set(e.y),f&&void 0!==e.rotate&&f.set(e.rotate)},onComplete:()=>{r?.set(d),a?.set(p),f?.set(0)},onStop:()=>f?.set(0),onCancel:()=>f?.set(0)})),g.animation&&o.push(g.animation),delete e.x,delete e.y}};return i},t.aspectRatio=rr,t.attachFollow=Gi,t.attachSpring=function(t,e,n){return Gi(t,e,{type:"spring",...n})},t.attrEffect=ri,t.axisDeltaEquals=ar,t.axisEquals=nr,t.axisEqualsRounded=sr,t.boxEquals=ir,t.boxEqualsRounded=or,t.buildHTMLStyles=uo,t.buildProjectionTransform=cr,t.buildSVGAttrs=Vo,t.buildSVGPath=bo,t.buildTransform=co,t.calcAxisDelta=Wo,t.calcBoxDelta=zo,t.calcChildStagger=qe,t.calcGeneratorDuration=ut,t.calcLength=No,t.calcRelativeAxis=Ko,t.calcRelativeAxisPosition=Go,t.calcRelativeBox=Yo,t.calcRelativePosition=Xo,t.camelCaseAttributes=Ao,t.camelToDash=An,t.cancelFrame=o,t.cancelMicrotask=fi,t.cancelSync=fa,t.checkVariantsDidChange=jo,t.cleanDirtyNodes=Lr,t.collectMotionValues=He,t.color=F,t.compareByDepth=Tr,t.complex=K,t.containsCSSVariable=y,t.convertBoundingBoxToBox=Ws,t.convertBoxToBoundingBox=function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}},t.convertOffsetToTimes=Ot,t.copyAxisDeltaInto=$o,t.copyAxisInto=Oo,t.copyBoxInto=Io,t.correctBorderRadius=mo,t.correctBoxShadow=fo,t.createAnimationState=function(t){let e=function(t){return e=>Promise.all(e.map(({animation:e,options:n})=>Rn(t,e,n)))}(t),n=Fo(),i=!0,s=!1;const o=e=>(n,i)=>{const s=yn(t,i,"exit"===e?t.presenceContext?.custom:void 0);if(s){const{transition:t,transitionEnd:e,...i}=s;n={...n,...i,...e}}return n};function r(r){const{props:a}=t,l=Do(t.parent)||{},c=[],u=new Set;let h={},d=1/0;for(let e=0;ed&&y,w=!1;const b=Array.isArray(f)?f:[f];let S=b.reduce(o(p),{});!1===g&&(S={});const{prevResolvedValues:V={}}=m,A={...V,...S},P=e=>{T=!0,u.has(e)&&(w=!0,u.delete(e)),m.needsAnimating[e]=!0;const n=t.getValue(e);n&&(n.liveStyle=!1)};for(const t in A){const e=S[t],n=V[t];if(h.hasOwnProperty(t))continue;let i=!1;i=vn(e)&&vn(n)?!Co(e,n)||x:e!==n,i?null!=e?P(t):u.add(t):void 0!==e&&u.has(t)?P(t):m.protectedKeys[t]=!0}m.prevProp=f,m.prevResolvedValues=S,m.isActive&&(h={...h,...S}),(i||s)&&t.blockInitialAnimation&&(T=!1);const M=v&&x;T&&(!M||w)&&c.push(...b.map(e=>{const n={type:p};if("string"==typeof e&&(i||s)&&!M&&t.manuallyAnimateOnMount&&t.parent){const{parent:i}=t,s=yn(i,e);if(i.enteringChildren&&s){const{delayChildren:e}=s.transition||{};n.delay=qe(i.enteringChildren,t,e)}}return{animation:e,options:n}}))}if(u.size){const e={};if("boolean"!=typeof a.initial){const n=yn(t,Array.isArray(a.initial)?a.initial[0]:a.initial);n&&n.transition&&(e.transition=n.transition)}u.forEach(n=>{const i=t.getBaseTarget(n),s=t.getValue(n);s&&(s.liveStyle=!0),e[n]=i??null}),c.push({animation:e})}let p=Boolean(c.length);return!i||!1!==a.initial&&a.initial!==a.animate||t.manuallyAnimateOnMount||(p=!1),i=!1,s=!1,p?e(c):Promise.resolve()}return{animateChanges:r,setActive:function(e,i){if(n[e].isActive===i)return Promise.resolve();t.variantChildren?.forEach(t=>t.animationState?.setActive(e,i)),n[e].isActive=i;const s=r(e);for(const t in n)n[t].protectedKeys={};return s},setAnimateFunction:function(n){e=n(t)},getState:()=>n,reset:()=>{n=Fo(),s=!0}}},t.createAxis=Vs,t.createAxisDelta=bs,t.createBox=As,t.createDelta=Ss,t.createGeneratorEasing=ht,t.createProjectionNode=Cr,t.createRenderBatcher=i,t.cubicBezierAsString=Pe,t.defaultEasing=It,t.defaultOffset=Ft,t.defaultTransformValue=ee,t.defaultValueTypes=Yn,t.degrees=E,t.delay=br,t.delayInSeconds=function(t,n){return br(t,e.secondsToMilliseconds(n))},t.dimensionValueTypes=jn,t.eachAxis=lr,t.fillOffset=Lt,t.fillWildcards=Xt,t.findDimensionValueType=Ln,t.findValueType=_i,t.flushKeyframeResolvers=ge,t.followValue=Yi,t.frame=s,t.frameData=r,t.frameSteps=a,t.generateLinearEasing=lt,t.getAnimatableNone=qn,t.getAnimationMap=function(t){let e=Xe.get(t);return e||(e=new Map,Xe.set(t,e)),e},t.getComputedStyle=function(t,e){const n=window.getComputedStyle(t);return xe(e)?n.getPropertyValue(e):n[e]},t.getDefaultTransition=sn,t.getDefaultValueType=Gn,t.getFeatureDefinitions=function(){return $s},t.getFinalKeyframe=Ut,t.getMixer=nt,t.getOptimisedAppearId=kn,t.getOriginIndex=zi,t.getValueAsType=ni,t.getValueTransition=Qe,t.getVariableValue=pn,t.getVariantContext=Do,t.getViewAnimationLayerInfo=cs,t.getViewAnimations=us,t.globalProjectionState=Ar,t.has2DTranslate=Xs,t.hasReducedMotionListener=Ls,t.hasScale=Ys,t.hasTransform=Gs,t.hex=M,t.hover=function(t,e,n={}){const[i,s,o]=vi(t,n);return i.forEach(t=>{let n,i=!1,o=!1;const r=e=>{n&&(n(e),n=void 0),t.removeEventListener("pointerleave",l)},a=t=>{i=!1,window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",a),o&&(o=!1,r(t))},l=t=>{"touch"!==t.pointerType&&(i?o=!0:r(t))};t.addEventListener("pointerenter",i=>{if("touch"===i.pointerType||gi())return;o=!1;const r=e(t,i);"function"==typeof r&&(n=r,t.addEventListener("pointerleave",l,s))},s),t.addEventListener("pointerdown",()=>{i=!0,window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",a,s)},s)}),o},t.hsla=L,t.hslaToRgba=G,t.inertia=Bt,t.initPrefersReducedMotion=Os,t.interpolate=jt,t.invisibleValues=Q,t.isAnimationControls=Ms,t.isCSSVariableName=d,t.isCSSVariableToken=m,t.isControllingVariants=Cs,t.isDeltaZero=er,t.isDragActive=gi,t.isDragging=yi,t.isElementKeyboardAccessible=bi,t.isElementTextInput=function(t){return Si.has(t.tagName)||!0===t.isContentEditable},t.isForcedMotionValue=go,t.isGenerator=De,t.isHTMLElement=li,t.isKeyframesTarget=vn,t.isMotionValue=bn,t.isNear=Uo,t.isNodeOrChild=xi,t.isPrimaryPointer=Ti,t.isSVGElement=Ei,t.isSVGSVGElement=Wi,t.isSVGTag=Po,t.isTransitionDefined=rn,t.isVariantLabel=ks,t.isVariantNode=Rs,t.isWaapiSupportedEasing=function t(n){return Boolean("function"==typeof n&&Ae()||!n||"string"==typeof n&&(n in Me||Ae())||e.isBezierDefinition(n)||Array.isArray(n)&&n.every(t))},t.isWillChangeMotionValue=Sn,t.keyframes=$t,t.makeAnimationInstant=Oe,t.mapEasingToNativeEasing=ke,t.mapValue=function(t,e,n,i){const s=Ki(e,n,i);return Hi(()=>s(t.get()))},t.maxGeneratorDuration=ct,t.measurePageBox=function(t,e,n){const i=ro(t,n),{scroll:s}=e;return s&&(no(i.x,s.offset.x),no(i.y,s.offset.y)),i},t.measureViewportBox=ro,t.microtask=mi,t.mix=rt,t.mixArray=it,t.mixColor=J,t.mixComplex=ot,t.mixImmediate=X,t.mixLinearColor=H,t.mixNumber=q,t.mixObject=st,t.mixValues=pr,t.mixVisibility=tt,t.motionValue=_e,t.nodeGroup=function(){const t=new Set,e=new WeakMap,n=()=>t.forEach(ia);return{add:i=>{t.add(i),e.set(i,i.addEventListener("willUpdate",n))},remove:i=>{t.delete(i);const s=e.get(i);s&&(s(),e.delete(i)),n()},dirty:n}},t.number=g,t.numberValueTypes=Kn,t.observeTimeline=function(t,e){let n;const i=()=>{const{currentTime:i}=e,s=(null===i?0:i.value)/100;n!==s&&t(s),n=s};return s.preUpdate(i,!0),()=>o(i)},t.optimizedAppearDataAttribute=Mn,t.optimizedAppearDataId=Pn,t.parseAnimateLayoutArgs=function(t,e,n){return"function"==typeof t?{scope:document,updateDom:t,defaultOptions:e}:{scope:t instanceof Document?t:ti(t)[0]??document,updateDom:e,defaultOptions:n}},t.parseCSSVariable=dn,t.parseValueFromTransform=ne,t.percent=D,t.pixelsToPercent=po,t.positionalKeys=gn,t.prefersReducedMotion=js,t.press=function(t,e,n={}){const[i,s,o]=vi(t,n),r=t=>{const i=t.currentTarget;if(!Mi(t))return;if(ki.has(t))return;Vi.add(i),n.stopPropagation&&ki.add(t);const o=e(i,t),r={...s,capture:!0},a=(t,e)=>{window.removeEventListener("pointerup",l,r),window.removeEventListener("pointercancel",c,r),Vi.has(i)&&Vi.delete(i),Mi(t)&&"function"==typeof o&&o(t,{success:e})},l=t=>{a(t,i===window||i===document||n.useGlobalTarget||xi(i,t.target))},c=t=>{a(t,!1)};window.addEventListener("pointerup",l,r),window.addEventListener("pointercancel",c,r)};return i.forEach(t=>{(n.useGlobalTarget?window:t).addEventListener("pointerdown",r,s),li(t)&&(t.addEventListener("focus",t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const i=Ai(()=>{if(Vi.has(n))return;Pi(n,"down");const t=Ai(()=>{Pi(n,"up")});n.addEventListener("keyup",t,e),n.addEventListener("blur",()=>Pi(n,"cancel"),e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)})(t,s)),bi(t)||t.hasAttribute("tabindex")||(t.tabIndex=0))}),o},t.progressPercentage=j,t.propEffect=ai,t.propagateDirtyNodes=jr,t.px=C,t.readTransformValue=ie,t.recordStats=function(){if(Ui.value)throw Ui.value=null,Ui.addProjectionMetrics=null,new Error("Stats are already being measured");const t=Ui;t.value={layoutProjection:{nodes:[],calculatedTargetDeltas:[],calculatedProjections:[]}},t.addProjectionMetrics=e=>{const{layoutProjection:n}=t.value;n.nodes.push(e.nodes),n.calculatedTargetDeltas.push(e.calculatedTargetDeltas),n.calculatedProjections.push(e.calculatedProjections)}},t.removeAxisDelta=Ho,t.removeAxisTransforms=Zo,t.removeBoxTransforms=Qo,t.removePointDelta=qo,t.renderHTML=ho,t.renderSVG=Mo,t.resize=function(t,e){return"function"==typeof t?Ni(t):Oi(t,e)},t.resolveElements=ti,t.resolveMotionValue=Sr,t.resolveTransition=Je,t.resolveVariant=yn,t.resolveVariantFromProps=fn,t.rgbUnit=A,t.rgba=P,t.rootProjectionNode=sa,t.scale=x,t.scaleCorrectors=yo,t.scalePoint=Hs,t.scrapeHTMLMotionValuesFromProps=vo,t.scrapeSVGMotionValuesFromProps=ko,t.setDragLock=function(t){return"x"===t||"y"===t?yi[t]?null:(yi[t]=!0,()=>{yi[t]=!1}):yi.x||yi.y?null:(yi.x=yi.y=!0,()=>{yi.x=yi.y=!1})},t.setFeatureDefinitions=function(t){$s=t},t.setStyle=Te,t.setTarget=wn,t.spring=Ct,t.springValue=function(t,e){return Yi(t,{type:"spring",...e})},t.stagger=function(t=.1,{startDelay:n=0,from:i=0,ease:s}={}){return(o,r)=>{const a="number"==typeof i?i:zi(i,r),l=Math.abs(a-o);let c=t*l;if(s){const n=r*t;c=e.easingDefinitionToFunction(s)(c/n)*n}return n+c}},t.startWaapiAnimation=Ee,t.statsBuffer=Ui,t.styleEffect=di,t.supportedWaapiEasing=Me,t.supportsBrowserAnimation=We,t.supportsFlags=we,t.supportsLinearEasing=Ae,t.supportsPartialKeyframes=Qn,t.supportsScrollTimeline=Se,t.supportsViewTimeline=Ve,t.svgEffect=pi,t.sync=ma,t.testValueType=Bn,t.time=u,t.transform=Ki,t.transformAxis=io,t.transformBox=oo,t.transformBoxPoints=zs,t.transformPropOrder=oe,t.transformProps=re,t.transformValue=Hi,t.transformValueTypes=zn,t.translateAxis=no,t.updateMotionValuesFromProps=Bs,t.variantPriorityOrder=Es,t.variantProps=Ds,t.vh=R,t.visualElementStore=Ps,t.vw=B}); diff --git a/node_modules/motion-dom/dist/size-rollup-motion-value.js b/node_modules/motion-dom/dist/size-rollup-motion-value.js new file mode 100644 index 0000000..9ecc640 --- /dev/null +++ b/node_modules/motion-dom/dist/size-rollup-motion-value.js @@ -0,0 +1,2 @@ +const t={};class e{constructor(){this.subscriptions=[]}add(t){var e,s;return e=this.subscriptions,s=t,-1===e.indexOf(s)&&e.push(s),()=>function(t,e){const s=t.indexOf(e);s>-1&&t.splice(s,1)}(this.subscriptions,t)}notify(t,e,s){const i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](t,e,s);else for(let n=0;nn=!0,c=s.reduce((t,e)=>(t[e]=function(t){let e=new Set,s=new Set,i=!1,n=!1;const r=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function o(e){r.has(e)&&(c.schedule(e),t()),e(a)}const c={schedule:(t,n=!1,a=!1)=>{const o=a&&i?e:s;return n&&r.add(t),o.add(t),t},cancel:t=>{s.delete(t),r.delete(t)},process:t=>{if(a=t,i)return void(n=!0);i=!0;const r=e;e=s,s=r,e.forEach(o),e.clear(),i=!1,n&&(n=!1,c.process(t))}};return c}(o),t),{}),{setup:h,read:d,resolveKeyframes:p,preUpdate:u,update:l,preRender:v,render:m,postRender:f}=c,g=()=>{const s=t.useManualTiming,o=s?a.timestamp:performance.now();n=!1,s||(a.delta=r?1e3/60:Math.max(Math.min(o-a.timestamp,40),1)),a.timestamp=o,a.isProcessing=!0,h.process(a),d.process(a),p.process(a),u.process(a),l.process(a),v.process(a),m.process(a),f.process(a),a.isProcessing=!1,n&&i&&(r=!1,e(g))};return{schedule:s.reduce((t,s)=>{const i=c[s];return t[s]=(t,s=!1,o=!1)=>(n||(n=!0,r=!0,a.isProcessing||e(g)),i.schedule(t,s,o)),t},{}),cancel:t=>{for(let e=0;et,!0);let a;function o(){a=void 0}const c={now:()=>(void 0===a&&c.set(r.isProcessing||t.useManualTiming?r.timestamp:performance.now()),a),set:t=>{a=t,queueMicrotask(o)}},h={current:void 0};class d{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=c.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=c.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,s){this.events[t]||(this.events[t]=new e);const i=this.events[t].add(s);return"change"===t?()=>{i(),n.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,s){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-s}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return h.current&&h.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=c.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return s=parseFloat(this.current)-parseFloat(this.prevFrameValue),(i=e)?s*(1e3/i):0;var s,i}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function p(t,e){return new d(t,e)}export{d as MotionValue,h as collectMotionValues,p as motionValue}; +//# sourceMappingURL=size-rollup-motion-value.js.map diff --git a/node_modules/motion-dom/dist/size-rollup-motion-value.js.map b/node_modules/motion-dom/dist/size-rollup-motion-value.js.map new file mode 100644 index 0000000..4a69ebd --- /dev/null +++ b/node_modules/motion-dom/dist/size-rollup-motion-value.js.map @@ -0,0 +1 @@ +{"version":3,"file":"size-rollup-motion-value.js","sources":["../../motion-utils/dist/es/global-config.mjs","../../motion-utils/dist/es/subscription-manager.mjs","../../motion-utils/dist/es/array.mjs","../../motion-utils/dist/es/velocity-per-second.mjs","../lib/frameloop/order.js","../lib/frameloop/batcher.js","../lib/frameloop/render-step.js","../lib/frameloop/frame.js","../../motion-utils/dist/es/noop.mjs","../lib/frameloop/sync-time.js","../lib/value/index.js"],"sourcesContent":["const MotionGlobalConfig = {};\n\nexport { MotionGlobalConfig };\n//# sourceMappingURL=global-config.mjs.map\n","import { addUniqueItem, removeItem } from './array.mjs';\n\nclass SubscriptionManager {\n constructor() {\n this.subscriptions = [];\n }\n add(handler) {\n addUniqueItem(this.subscriptions, handler);\n return () => removeItem(this.subscriptions, handler);\n }\n notify(a, b, c) {\n const numSubscriptions = this.subscriptions.length;\n if (!numSubscriptions)\n return;\n if (numSubscriptions === 1) {\n /**\n * If there's only a single handler we can just call it without invoking a loop.\n */\n this.subscriptions[0](a, b, c);\n }\n else {\n for (let i = 0; i < numSubscriptions; i++) {\n /**\n * Check whether the handler exists before firing as it's possible\n * the subscriptions were modified during this loop running.\n */\n const handler = this.subscriptions[i];\n handler && handler(a, b, c);\n }\n }\n }\n getSize() {\n return this.subscriptions.length;\n }\n clear() {\n this.subscriptions.length = 0;\n }\n}\n\nexport { SubscriptionManager };\n//# sourceMappingURL=subscription-manager.mjs.map\n","function addUniqueItem(arr, item) {\n if (arr.indexOf(item) === -1)\n arr.push(item);\n}\nfunction removeItem(arr, item) {\n const index = arr.indexOf(item);\n if (index > -1)\n arr.splice(index, 1);\n}\n// Adapted from array-move\nfunction moveItem([...arr], fromIndex, toIndex) {\n const startIndex = fromIndex < 0 ? arr.length + fromIndex : fromIndex;\n if (startIndex >= 0 && startIndex < arr.length) {\n const endIndex = toIndex < 0 ? arr.length + toIndex : toIndex;\n const [item] = arr.splice(fromIndex, 1);\n arr.splice(endIndex, 0, item);\n }\n return arr;\n}\n\nexport { addUniqueItem, moveItem, removeItem };\n//# sourceMappingURL=array.mjs.map\n","/*\n Convert velocity into velocity per second\n*/\n/*#__NO_SIDE_EFFECTS__*/\nconst velocityPerSecond = (velocity, frameDuration) => frameDuration ? velocity * (1000 / frameDuration) : 0;\n\nexport { velocityPerSecond };\n//# sourceMappingURL=velocity-per-second.mjs.map\n","export const stepsOrder = [\n \"setup\", // Compute\n \"read\", // Read\n \"resolveKeyframes\", // Write/Read/Write/Read\n \"preUpdate\", // Compute\n \"update\", // Compute\n \"preRender\", // Compute\n \"render\", // Write\n \"postRender\", // Compute\n];\n//# sourceMappingURL=order.js.map","import { MotionGlobalConfig } from \"motion-utils\";\nimport { stepsOrder } from \"./order\";\nimport { createRenderStep } from \"./render-step\";\nconst maxElapsed = 40;\nexport function createRenderBatcher(scheduleNextBatch, allowKeepAlive) {\n let runNextFrame = false;\n let useDefaultElapsed = true;\n const state = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n };\n const flagRunNextFrame = () => (runNextFrame = true);\n const steps = stepsOrder.reduce((acc, key) => {\n acc[key] = createRenderStep(flagRunNextFrame);\n return acc;\n }, {});\n const { setup, read, resolveKeyframes, preUpdate, update, preRender, render, postRender, } = steps;\n const processBatch = () => {\n const useManualTiming = MotionGlobalConfig.useManualTiming;\n const timestamp = useManualTiming\n ? state.timestamp\n : performance.now();\n runNextFrame = false;\n if (!useManualTiming) {\n state.delta = useDefaultElapsed\n ? 1000 / 60\n : Math.max(Math.min(timestamp - state.timestamp, maxElapsed), 1);\n }\n state.timestamp = timestamp;\n state.isProcessing = true;\n // Unrolled render loop for better per-frame performance\n setup.process(state);\n read.process(state);\n resolveKeyframes.process(state);\n preUpdate.process(state);\n update.process(state);\n preRender.process(state);\n render.process(state);\n postRender.process(state);\n state.isProcessing = false;\n if (runNextFrame && allowKeepAlive) {\n useDefaultElapsed = false;\n scheduleNextBatch(processBatch);\n }\n };\n const wake = () => {\n runNextFrame = true;\n useDefaultElapsed = true;\n if (!state.isProcessing) {\n scheduleNextBatch(processBatch);\n }\n };\n const schedule = stepsOrder.reduce((acc, key) => {\n const step = steps[key];\n acc[key] = (process, keepAlive = false, immediate = false) => {\n if (!runNextFrame)\n wake();\n return step.schedule(process, keepAlive, immediate);\n };\n return acc;\n }, {});\n const cancel = (process) => {\n for (let i = 0; i < stepsOrder.length; i++) {\n steps[stepsOrder[i]].cancel(process);\n }\n };\n return { schedule, cancel, state, steps };\n}\n//# sourceMappingURL=batcher.js.map","export function createRenderStep(runNextFrame) {\n /**\n * We create and reuse two queues, one to queue jobs for the current frame\n * and one for the next. We reuse to avoid triggering GC after x frames.\n */\n let thisFrame = new Set();\n let nextFrame = new Set();\n /**\n * Track whether we're currently processing jobs in this step. This way\n * we can decide whether to schedule new jobs for this frame or next.\n */\n let isProcessing = false;\n let flushNextFrame = false;\n /**\n * A set of processes which were marked keepAlive when scheduled.\n */\n const toKeepAlive = new WeakSet();\n let latestFrameData = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n };\n function triggerCallback(callback) {\n if (toKeepAlive.has(callback)) {\n step.schedule(callback);\n runNextFrame();\n }\n callback(latestFrameData);\n }\n const step = {\n /**\n * Schedule a process to run on the next frame.\n */\n schedule: (callback, keepAlive = false, immediate = false) => {\n const addToCurrentFrame = immediate && isProcessing;\n const queue = addToCurrentFrame ? thisFrame : nextFrame;\n if (keepAlive)\n toKeepAlive.add(callback);\n queue.add(callback);\n return callback;\n },\n /**\n * Cancel the provided callback from running on the next frame.\n */\n cancel: (callback) => {\n nextFrame.delete(callback);\n toKeepAlive.delete(callback);\n },\n /**\n * Execute all schedule callbacks.\n */\n process: (frameData) => {\n latestFrameData = frameData;\n /**\n * If we're already processing we've probably been triggered by a flushSync\n * inside an existing process. Instead of executing, mark flushNextFrame\n * as true and ensure we flush the following frame at the end of this one.\n */\n if (isProcessing) {\n flushNextFrame = true;\n return;\n }\n isProcessing = true;\n // Swap this frame and the next to avoid GC\n const prevFrame = thisFrame;\n thisFrame = nextFrame;\n nextFrame = prevFrame;\n // Execute this frame\n thisFrame.forEach(triggerCallback);\n // Clear the frame so no callbacks remain. This is to avoid\n // memory leaks should this render step not run for a while.\n thisFrame.clear();\n isProcessing = false;\n if (flushNextFrame) {\n flushNextFrame = false;\n step.process(frameData);\n }\n },\n };\n return step;\n}\n//# sourceMappingURL=render-step.js.map","import { noop } from \"motion-utils\";\nimport { createRenderBatcher } from \"./batcher\";\nexport const { schedule: frame, cancel: cancelFrame, state: frameData, steps: frameSteps, } = /* @__PURE__ */ createRenderBatcher(typeof requestAnimationFrame !== \"undefined\" ? requestAnimationFrame : noop, true);\n//# sourceMappingURL=frame.js.map","/*#__NO_SIDE_EFFECTS__*/\nconst noop = (any) => any;\n\nexport { noop };\n//# sourceMappingURL=noop.mjs.map\n","import { MotionGlobalConfig } from \"motion-utils\";\nimport { frameData } from \"./frame\";\nlet now;\nfunction clearTime() {\n now = undefined;\n}\n/**\n * An eventloop-synchronous alternative to performance.now().\n *\n * Ensures that time measurements remain consistent within a synchronous context.\n * Usually calling performance.now() twice within the same synchronous context\n * will return different values which isn't useful for animations when we're usually\n * trying to sync animations to the same frame.\n */\nexport const time = {\n now: () => {\n if (now === undefined) {\n time.set(frameData.isProcessing || MotionGlobalConfig.useManualTiming\n ? frameData.timestamp\n : performance.now());\n }\n return now;\n },\n set: (newTime) => {\n now = newTime;\n queueMicrotask(clearTime);\n },\n};\n//# sourceMappingURL=sync-time.js.map","import { SubscriptionManager, velocityPerSecond, warnOnce, } from \"motion-utils\";\nimport { frame } from \"../frameloop\";\nimport { time } from \"../frameloop/sync-time\";\n/**\n * Maximum time between the value of two frames, beyond which we\n * assume the velocity has since been 0.\n */\nconst MAX_VELOCITY_DELTA = 30;\nconst isFloat = (value) => {\n return !isNaN(parseFloat(value));\n};\nexport const collectMotionValues = {\n current: undefined,\n};\n/**\n * `MotionValue` is used to track the state and velocity of motion values.\n *\n * @public\n */\nexport class MotionValue {\n /**\n * @param init - The initiating value\n * @param config - Optional configuration options\n *\n * - `transformer`: A function to transform incoming values with.\n */\n constructor(init, options = {}) {\n /**\n * Tracks whether this value can output a velocity. Currently this is only true\n * if the value is numerical, but we might be able to widen the scope here and support\n * other value types.\n *\n * @internal\n */\n this.canTrackVelocity = null;\n /**\n * An object containing a SubscriptionManager for each active event.\n */\n this.events = {};\n this.updateAndNotify = (v) => {\n const currentTime = time.now();\n /**\n * If we're updating the value during another frame or eventloop\n * than the previous frame, then the we set the previous frame value\n * to current.\n */\n if (this.updatedAt !== currentTime) {\n this.setPrevFrameValue();\n }\n this.prev = this.current;\n this.setCurrent(v);\n // Update update subscribers\n if (this.current !== this.prev) {\n this.events.change?.notify(this.current);\n if (this.dependents) {\n for (const dependent of this.dependents) {\n dependent.dirty();\n }\n }\n }\n };\n this.hasAnimated = false;\n this.setCurrent(init);\n this.owner = options.owner;\n }\n setCurrent(current) {\n this.current = current;\n this.updatedAt = time.now();\n if (this.canTrackVelocity === null && current !== undefined) {\n this.canTrackVelocity = isFloat(this.current);\n }\n }\n setPrevFrameValue(prevFrameValue = this.current) {\n this.prevFrameValue = prevFrameValue;\n this.prevUpdatedAt = this.updatedAt;\n }\n /**\n * Adds a function that will be notified when the `MotionValue` is updated.\n *\n * It returns a function that, when called, will cancel the subscription.\n *\n * When calling `onChange` inside a React component, it should be wrapped with the\n * `useEffect` hook. As it returns an unsubscribe function, this should be returned\n * from the `useEffect` function to ensure you don't add duplicate subscribers..\n *\n * ```jsx\n * export const MyComponent = () => {\n * const x = useMotionValue(0)\n * const y = useMotionValue(0)\n * const opacity = useMotionValue(1)\n *\n * useEffect(() => {\n * function updateOpacity() {\n * const maxXY = Math.max(x.get(), y.get())\n * const newOpacity = transform(maxXY, [0, 100], [1, 0])\n * opacity.set(newOpacity)\n * }\n *\n * const unsubscribeX = x.on(\"change\", updateOpacity)\n * const unsubscribeY = y.on(\"change\", updateOpacity)\n *\n * return () => {\n * unsubscribeX()\n * unsubscribeY()\n * }\n * }, [])\n *\n * return \n * }\n * ```\n *\n * @param subscriber - A function that receives the latest value.\n * @returns A function that, when called, will cancel this subscription.\n *\n * @deprecated\n */\n onChange(subscription) {\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(false, `value.onChange(callback) is deprecated. Switch to value.on(\"change\", callback).`);\n }\n return this.on(\"change\", subscription);\n }\n on(eventName, callback) {\n if (!this.events[eventName]) {\n this.events[eventName] = new SubscriptionManager();\n }\n const unsubscribe = this.events[eventName].add(callback);\n if (eventName === \"change\") {\n return () => {\n unsubscribe();\n /**\n * If we have no more change listeners by the start\n * of the next frame, stop active animations.\n */\n frame.read(() => {\n if (!this.events.change.getSize()) {\n this.stop();\n }\n });\n };\n }\n return unsubscribe;\n }\n clearListeners() {\n for (const eventManagers in this.events) {\n this.events[eventManagers].clear();\n }\n }\n /**\n * Attaches a passive effect to the `MotionValue`.\n */\n attach(passiveEffect, stopPassiveEffect) {\n this.passiveEffect = passiveEffect;\n this.stopPassiveEffect = stopPassiveEffect;\n }\n /**\n * Sets the state of the `MotionValue`.\n *\n * @remarks\n *\n * ```jsx\n * const x = useMotionValue(0)\n * x.set(10)\n * ```\n *\n * @param latest - Latest value to set.\n * @param render - Whether to notify render subscribers. Defaults to `true`\n *\n * @public\n */\n set(v) {\n if (!this.passiveEffect) {\n this.updateAndNotify(v);\n }\n else {\n this.passiveEffect(v, this.updateAndNotify);\n }\n }\n setWithVelocity(prev, current, delta) {\n this.set(current);\n this.prev = undefined;\n this.prevFrameValue = prev;\n this.prevUpdatedAt = this.updatedAt - delta;\n }\n /**\n * Set the state of the `MotionValue`, stopping any active animations,\n * effects, and resets velocity to `0`.\n */\n jump(v, endAnimation = true) {\n this.updateAndNotify(v);\n this.prev = v;\n this.prevUpdatedAt = this.prevFrameValue = undefined;\n endAnimation && this.stop();\n if (this.stopPassiveEffect)\n this.stopPassiveEffect();\n }\n dirty() {\n this.events.change?.notify(this.current);\n }\n addDependent(dependent) {\n if (!this.dependents) {\n this.dependents = new Set();\n }\n this.dependents.add(dependent);\n }\n removeDependent(dependent) {\n if (this.dependents) {\n this.dependents.delete(dependent);\n }\n }\n /**\n * Returns the latest state of `MotionValue`\n *\n * @returns - The latest state of `MotionValue`\n *\n * @public\n */\n get() {\n if (collectMotionValues.current) {\n collectMotionValues.current.push(this);\n }\n return this.current;\n }\n /**\n * @public\n */\n getPrevious() {\n return this.prev;\n }\n /**\n * Returns the latest velocity of `MotionValue`\n *\n * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical.\n *\n * @public\n */\n getVelocity() {\n const currentTime = time.now();\n if (!this.canTrackVelocity ||\n this.prevFrameValue === undefined ||\n currentTime - this.updatedAt > MAX_VELOCITY_DELTA) {\n return 0;\n }\n const delta = Math.min(this.updatedAt - this.prevUpdatedAt, MAX_VELOCITY_DELTA);\n // Casts because of parseFloat's poor typing\n return velocityPerSecond(parseFloat(this.current) -\n parseFloat(this.prevFrameValue), delta);\n }\n /**\n * Registers a new animation to control this `MotionValue`. Only one\n * animation can drive a `MotionValue` at one time.\n *\n * ```jsx\n * value.start()\n * ```\n *\n * @param animation - A function that starts the provided animation\n */\n start(startAnimation) {\n this.stop();\n return new Promise((resolve) => {\n this.hasAnimated = true;\n this.animation = startAnimation(resolve);\n if (this.events.animationStart) {\n this.events.animationStart.notify();\n }\n }).then(() => {\n if (this.events.animationComplete) {\n this.events.animationComplete.notify();\n }\n this.clearAnimation();\n });\n }\n /**\n * Stop the currently active animation.\n *\n * @public\n */\n stop() {\n if (this.animation) {\n this.animation.stop();\n if (this.events.animationCancel) {\n this.events.animationCancel.notify();\n }\n }\n this.clearAnimation();\n }\n /**\n * Returns `true` if this value is currently animating.\n *\n * @public\n */\n isAnimating() {\n return !!this.animation;\n }\n clearAnimation() {\n delete this.animation;\n }\n /**\n * Destroy and clean up subscribers to this `MotionValue`.\n *\n * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically\n * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually\n * created a `MotionValue` via the `motionValue` function.\n *\n * @public\n */\n destroy() {\n this.dependents?.clear();\n this.events.destroy?.notify();\n this.clearListeners();\n this.stop();\n if (this.stopPassiveEffect) {\n this.stopPassiveEffect();\n }\n }\n}\nexport function motionValue(init, options) {\n return new MotionValue(init, options);\n}\n//# sourceMappingURL=index.js.map"],"names":["MotionGlobalConfig","SubscriptionManager","constructor","this","subscriptions","add","handler","arr","item","indexOf","push","index","splice","removeItem","notify","a","b","c","numSubscriptions","length","i","getSize","clear","stepsOrder","createRenderBatcher","scheduleNextBatch","allowKeepAlive","runNextFrame","useDefaultElapsed","state","delta","timestamp","isProcessing","flagRunNextFrame","steps","reduce","acc","key","thisFrame","Set","nextFrame","flushNextFrame","toKeepAlive","WeakSet","latestFrameData","triggerCallback","callback","has","step","schedule","keepAlive","immediate","queue","cancel","delete","process","frameData","prevFrame","forEach","createRenderStep","setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender","processBatch","useManualTiming","performance","now","Math","max","min","frame","requestAnimationFrame","any","clearTime","undefined","time","set","newTime","queueMicrotask","collectMotionValues","current","MotionValue","init","options","canTrackVelocity","events","updateAndNotify","v","currentTime","updatedAt","setPrevFrameValue","prev","setCurrent","change","dependents","dependent","dirty","hasAnimated","owner","value","isNaN","parseFloat","prevFrameValue","prevUpdatedAt","onChange","subscription","on","eventName","unsubscribe","stop","clearListeners","eventManagers","attach","passiveEffect","stopPassiveEffect","setWithVelocity","jump","endAnimation","addDependent","removeDependent","get","getPrevious","getVelocity","velocity","frameDuration","start","startAnimation","Promise","resolve","animation","animationStart","then","animationComplete","clearAnimation","animationCancel","isAnimating","destroy","motionValue"],"mappings":"AAAA,MAAMA,EAAqB,CAAA,ECE3B,MAAMC,EAC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KAAKgG,YAAY7E,QACjBnB,KAAKuF,OAAOmD,SAAS/H,SACrBX,KAAKgH,iBACLhH,KAAK+G,OACD/G,KAAKoH,mBACLpH,KAAKoH,mBAEb,EAEG,SAASuB,EAAYvD,EAAMC,GAC9B,OAAO,IAAIF,EAAYC,EAAMC,EACjC"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/size-rollup-style-effect.js b/node_modules/motion-dom/dist/size-rollup-style-effect.js new file mode 100644 index 0000000..0ec672e --- /dev/null +++ b/node_modules/motion-dom/dist/size-rollup-style-effect.js @@ -0,0 +1,2 @@ +const t=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],e=(()=>new Set([...t,"pathRotation"]))();const s={};class n{constructor(){this.subscriptions=[]}add(t){var e,s;return e=this.subscriptions,s=t,-1===e.indexOf(s)&&e.push(s),()=>function(t,e){const s=t.indexOf(e);s>-1&&t.splice(s,1)}(this.subscriptions,t)}notify(t,e,s){const n=this.subscriptions.length;if(n)if(1===n)this.subscriptions[0](t,e,s);else for(let i=0;in=!0,c=i.reduce((t,e)=>(t[e]=function(t){let e=new Set,s=new Set,n=!1,i=!1;const r=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function o(e){r.has(e)&&(c.schedule(e),t()),e(a)}const c={schedule:(t,i=!1,a=!1)=>{const o=a&&n?e:s;return i&&r.add(t),o.add(t),t},cancel:t=>{s.delete(t),r.delete(t)},process:t=>{if(a=t,n)return void(i=!0);n=!0;const r=e;e=s,s=r,e.forEach(o),e.clear(),n=!1,i&&(i=!1,c.process(t))}};return c}(o),t),{}),{setup:d,read:h,resolveKeyframes:p,preUpdate:l,update:u,preRender:f,render:m,postRender:g}=c,v=()=>{const i=s.useManualTiming,o=i?a.timestamp:performance.now();n=!1,i||(a.delta=r?1e3/60:Math.max(Math.min(o-a.timestamp,40),1)),a.timestamp=o,a.isProcessing=!0,d.process(a),h.process(a),p.process(a),l.process(a),u.process(a),f.process(a),m.process(a),g.process(a),a.isProcessing=!1,n&&e&&(r=!1,t(v))};return{schedule:i.reduce((e,s)=>{const i=c[s];return e[s]=(e,s=!1,o=!1)=>(n||(n=!0,r=!0,a.isProcessing||t(v)),i.schedule(e,s,o)),e},{}),cancel:t=>{for(let e=0;et,!0);let d;function h(){d=void 0}const p={now:()=>(void 0===d&&p.set(c.isProcessing||s.useManualTiming?c.timestamp:performance.now()),d),set:t=>{d=t,queueMicrotask(h)}};class l{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=p.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=p.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new n);const s=this.events[t].add(e);return"change"===t?()=>{s(),a.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,s){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-s}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=p.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return s=parseFloat(this.current)-parseFloat(this.prevFrameValue),(n=e)?s*(1e3/n):0;var s,n}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function u(t){return(e,s)=>{const n=function(t){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){const e=document.querySelectorAll(t);return e?Array.from(e):[]}return Array.from(t).filter(t=>null!=t)}(e),i=[];for(const e of n){const n=t(e,s);i.push(n)}return()=>{for(const t of i)t()}}}const f={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},m={...f,transform:t=>((t,e,s)=>s>e?e:s({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),w=y("deg"),b=y("%"),k=y("px"),A=(()=>({...b,parse:t=>b.parse(t)/100,transform:t=>b.transform(100*t)}))(),P={borderWidth:k,borderTopWidth:k,borderRightWidth:k,borderBottomWidth:k,borderLeftWidth:k,borderRadius:k,borderTopLeftRadius:k,borderTopRightRadius:k,borderBottomRightRadius:k,borderBottomLeftRadius:k,width:k,maxWidth:k,height:k,maxHeight:k,top:k,right:k,bottom:k,left:k,inset:k,insetBlock:k,insetBlockStart:k,insetBlockEnd:k,insetInline:k,insetInlineStart:k,insetInlineEnd:k,padding:k,paddingTop:k,paddingRight:k,paddingBottom:k,paddingLeft:k,paddingBlock:k,paddingBlockStart:k,paddingBlockEnd:k,paddingInline:k,paddingInlineStart:k,paddingInlineEnd:k,margin:k,marginTop:k,marginRight:k,marginBottom:k,marginLeft:k,marginBlock:k,marginBlockStart:k,marginBlockEnd:k,marginInline:k,marginInlineStart:k,marginInlineEnd:k,fontSize:k,backgroundPositionX:k,backgroundPositionY:k,...{rotate:w,pathRotation:w,rotateX:w,rotateY:w,rotateZ:w,scale:g,scaleX:g,scaleY:g,scaleZ:g,skew:w,skewX:w,skewY:w,distance:k,translateX:k,translateY:k,translateZ:k,x:k,y:k,z:k,perspective:k,transformPerspective:k,opacity:m,originX:A,originY:A,originZ:k},zIndex:v,fillOpacity:m,strokeOpacity:m,numOctaves:v};class R{constructor(){this.latest={},this.values=new Map}set(t,e,s,n,i=!0){const r=this.values.get(t);r&&r.onRemove();const c=()=>{const n=e.get();this.latest[t]=i?((t,e)=>e&&"number"==typeof t?e.transform(t):t)(n,P[t]):n,s&&a.render(s)};c();const d=e.on("change",c);n&&e.addDependent(n);const h=()=>{d(),s&&o(s),this.values.delete(t),n&&e.removeDependent(n)};return this.values.set(t,{value:e,onRemove:h}),h}get(t){return this.values.get(t)?.value}}function S(t){const e=new WeakMap;return(s,n)=>{const i=e.get(s)??new R;e.set(s,i);const r=[];for(const e in n){const a=n[e],o=t(s,i,e,a);r.push(o)}return()=>{for(const t of r)t()}}}const E={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"};const B=new Set(["originX","originY","originZ"]),F=(s,n,i,r)=>{let a,o;return e.has(i)?(n.get("transform")||(function(t){return"object"==typeof(e=t)&&null!==e&&"offsetHeight"in t&&!("ownerSVGElement"in t);var e}(s)||n.get("transformBox")||F(s,n,"transformBox",new l("fill-box")),n.set("transform",new l("none"),()=>{s.style.transform=function(e){let s="",n=!0;for(let i=0;i{const t=n.latest.originX??"50%",e=n.latest.originY??"50%",i=n.latest.originZ??0;s.style.transformOrigin=`${t} ${e} ${i}`}),o=n.get("transformOrigin")):a=i.startsWith("--")?()=>{s.style.setProperty(i,n.latest[i])}:()=>{s.style[i]=n.latest[i]},n.set(i,r,a,o)},x=u(S(F));export{F as addStyleValue,x as styleEffect}; +//# sourceMappingURL=size-rollup-style-effect.js.map diff --git a/node_modules/motion-dom/dist/size-rollup-style-effect.js.map b/node_modules/motion-dom/dist/size-rollup-style-effect.js.map new file mode 100644 index 0000000..be95fc0 --- /dev/null +++ b/node_modules/motion-dom/dist/size-rollup-style-effect.js.map @@ -0,0 +1 @@ +{"version":3,"file":"size-rollup-style-effect.js","sources":["../lib/render/dom/is-css-var.js","../lib/render/utils/keys-transform.js","../../motion-utils/dist/es/clamp.mjs","../../motion-utils/dist/es/global-config.mjs","../../motion-utils/dist/es/subscription-manager.mjs","../../motion-utils/dist/es/array.mjs","../lib/frameloop/order.js","../lib/frameloop/batcher.js","../lib/frameloop/render-step.js","../lib/frameloop/frame.js","../../motion-utils/dist/es/noop.mjs","../lib/frameloop/sync-time.js","../lib/value/index.js","../../motion-utils/dist/es/velocity-per-second.mjs","../lib/effects/utils/create-dom-effect.js","../lib/utils/resolve-elements.js","../lib/value/types/numbers/index.js","../lib/value/types/int.js","../lib/value/types/numbers/units.js","../lib/value/types/maps/number.js","../lib/value/types/maps/transform.js","../lib/effects/MotionValueState.js","../lib/value/types/utils/get-as-type.js","../lib/effects/utils/create-effect.js","../lib/effects/style/transform.js","../lib/effects/style/index.js","../lib/utils/is-html-element.js","../../motion-utils/dist/es/is-object.mjs"],"sourcesContent":["export const isCSSVar = (name) => name.startsWith(\"--\");\n//# sourceMappingURL=is-css-var.js.map","/**\n * Generate a list of every possible transform key.\n */\nexport const transformPropOrder = [\n \"transformPerspective\",\n \"x\",\n \"y\",\n \"z\",\n \"translateX\",\n \"translateY\",\n \"translateZ\",\n \"scale\",\n \"scaleX\",\n \"scaleY\",\n \"rotate\",\n \"rotateX\",\n \"rotateY\",\n \"rotateZ\",\n \"skew\",\n \"skewX\",\n \"skewY\",\n];\n/**\n * A quick lookup for transform props.\n *\n * `pathRotation` is a transform for routing purposes (skipped from raw\n * style application, wired to the transform composite, flags transform\n * dirty) but is intentionally NOT in `transformPropOrder` — it is\n * composed onto `rotate` at the build sites, not serialized in its own\n * slot, and must stay out of the order-array consumers (parse-transform,\n * unit-conversion, keys-position).\n */\nexport const transformProps = /*@__PURE__*/ (() => new Set([...transformPropOrder, \"pathRotation\"]))();\n//# sourceMappingURL=keys-transform.js.map","const clamp = (min, max, v) => {\n if (v > max)\n return max;\n if (v < min)\n return min;\n return v;\n};\n\nexport { clamp };\n//# sourceMappingURL=clamp.mjs.map\n","const MotionGlobalConfig = {};\n\nexport { MotionGlobalConfig };\n//# sourceMappingURL=global-config.mjs.map\n","import { addUniqueItem, removeItem } from './array.mjs';\n\nclass SubscriptionManager {\n constructor() {\n this.subscriptions = [];\n }\n add(handler) {\n addUniqueItem(this.subscriptions, handler);\n return () => removeItem(this.subscriptions, handler);\n }\n notify(a, b, c) {\n const numSubscriptions = this.subscriptions.length;\n if (!numSubscriptions)\n return;\n if (numSubscriptions === 1) {\n /**\n * If there's only a single handler we can just call it without invoking a loop.\n */\n this.subscriptions[0](a, b, c);\n }\n else {\n for (let i = 0; i < numSubscriptions; i++) {\n /**\n * Check whether the handler exists before firing as it's possible\n * the subscriptions were modified during this loop running.\n */\n const handler = this.subscriptions[i];\n handler && handler(a, b, c);\n }\n }\n }\n getSize() {\n return this.subscriptions.length;\n }\n clear() {\n this.subscriptions.length = 0;\n }\n}\n\nexport { SubscriptionManager };\n//# sourceMappingURL=subscription-manager.mjs.map\n","function addUniqueItem(arr, item) {\n if (arr.indexOf(item) === -1)\n arr.push(item);\n}\nfunction removeItem(arr, item) {\n const index = arr.indexOf(item);\n if (index > -1)\n arr.splice(index, 1);\n}\n// Adapted from array-move\nfunction moveItem([...arr], fromIndex, toIndex) {\n const startIndex = fromIndex < 0 ? arr.length + fromIndex : fromIndex;\n if (startIndex >= 0 && startIndex < arr.length) {\n const endIndex = toIndex < 0 ? arr.length + toIndex : toIndex;\n const [item] = arr.splice(fromIndex, 1);\n arr.splice(endIndex, 0, item);\n }\n return arr;\n}\n\nexport { addUniqueItem, moveItem, removeItem };\n//# sourceMappingURL=array.mjs.map\n","export const stepsOrder = [\n \"setup\", // Compute\n \"read\", // Read\n \"resolveKeyframes\", // Write/Read/Write/Read\n \"preUpdate\", // Compute\n \"update\", // Compute\n \"preRender\", // Compute\n \"render\", // Write\n \"postRender\", // Compute\n];\n//# sourceMappingURL=order.js.map","import { MotionGlobalConfig } from \"motion-utils\";\nimport { stepsOrder } from \"./order\";\nimport { createRenderStep } from \"./render-step\";\nconst maxElapsed = 40;\nexport function createRenderBatcher(scheduleNextBatch, allowKeepAlive) {\n let runNextFrame = false;\n let useDefaultElapsed = true;\n const state = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n };\n const flagRunNextFrame = () => (runNextFrame = true);\n const steps = stepsOrder.reduce((acc, key) => {\n acc[key] = createRenderStep(flagRunNextFrame);\n return acc;\n }, {});\n const { setup, read, resolveKeyframes, preUpdate, update, preRender, render, postRender, } = steps;\n const processBatch = () => {\n const useManualTiming = MotionGlobalConfig.useManualTiming;\n const timestamp = useManualTiming\n ? state.timestamp\n : performance.now();\n runNextFrame = false;\n if (!useManualTiming) {\n state.delta = useDefaultElapsed\n ? 1000 / 60\n : Math.max(Math.min(timestamp - state.timestamp, maxElapsed), 1);\n }\n state.timestamp = timestamp;\n state.isProcessing = true;\n // Unrolled render loop for better per-frame performance\n setup.process(state);\n read.process(state);\n resolveKeyframes.process(state);\n preUpdate.process(state);\n update.process(state);\n preRender.process(state);\n render.process(state);\n postRender.process(state);\n state.isProcessing = false;\n if (runNextFrame && allowKeepAlive) {\n useDefaultElapsed = false;\n scheduleNextBatch(processBatch);\n }\n };\n const wake = () => {\n runNextFrame = true;\n useDefaultElapsed = true;\n if (!state.isProcessing) {\n scheduleNextBatch(processBatch);\n }\n };\n const schedule = stepsOrder.reduce((acc, key) => {\n const step = steps[key];\n acc[key] = (process, keepAlive = false, immediate = false) => {\n if (!runNextFrame)\n wake();\n return step.schedule(process, keepAlive, immediate);\n };\n return acc;\n }, {});\n const cancel = (process) => {\n for (let i = 0; i < stepsOrder.length; i++) {\n steps[stepsOrder[i]].cancel(process);\n }\n };\n return { schedule, cancel, state, steps };\n}\n//# sourceMappingURL=batcher.js.map","export function createRenderStep(runNextFrame) {\n /**\n * We create and reuse two queues, one to queue jobs for the current frame\n * and one for the next. We reuse to avoid triggering GC after x frames.\n */\n let thisFrame = new Set();\n let nextFrame = new Set();\n /**\n * Track whether we're currently processing jobs in this step. This way\n * we can decide whether to schedule new jobs for this frame or next.\n */\n let isProcessing = false;\n let flushNextFrame = false;\n /**\n * A set of processes which were marked keepAlive when scheduled.\n */\n const toKeepAlive = new WeakSet();\n let latestFrameData = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n };\n function triggerCallback(callback) {\n if (toKeepAlive.has(callback)) {\n step.schedule(callback);\n runNextFrame();\n }\n callback(latestFrameData);\n }\n const step = {\n /**\n * Schedule a process to run on the next frame.\n */\n schedule: (callback, keepAlive = false, immediate = false) => {\n const addToCurrentFrame = immediate && isProcessing;\n const queue = addToCurrentFrame ? thisFrame : nextFrame;\n if (keepAlive)\n toKeepAlive.add(callback);\n queue.add(callback);\n return callback;\n },\n /**\n * Cancel the provided callback from running on the next frame.\n */\n cancel: (callback) => {\n nextFrame.delete(callback);\n toKeepAlive.delete(callback);\n },\n /**\n * Execute all schedule callbacks.\n */\n process: (frameData) => {\n latestFrameData = frameData;\n /**\n * If we're already processing we've probably been triggered by a flushSync\n * inside an existing process. Instead of executing, mark flushNextFrame\n * as true and ensure we flush the following frame at the end of this one.\n */\n if (isProcessing) {\n flushNextFrame = true;\n return;\n }\n isProcessing = true;\n // Swap this frame and the next to avoid GC\n const prevFrame = thisFrame;\n thisFrame = nextFrame;\n nextFrame = prevFrame;\n // Execute this frame\n thisFrame.forEach(triggerCallback);\n // Clear the frame so no callbacks remain. This is to avoid\n // memory leaks should this render step not run for a while.\n thisFrame.clear();\n isProcessing = false;\n if (flushNextFrame) {\n flushNextFrame = false;\n step.process(frameData);\n }\n },\n };\n return step;\n}\n//# sourceMappingURL=render-step.js.map","import { noop } from \"motion-utils\";\nimport { createRenderBatcher } from \"./batcher\";\nexport const { schedule: frame, cancel: cancelFrame, state: frameData, steps: frameSteps, } = /* @__PURE__ */ createRenderBatcher(typeof requestAnimationFrame !== \"undefined\" ? requestAnimationFrame : noop, true);\n//# sourceMappingURL=frame.js.map","/*#__NO_SIDE_EFFECTS__*/\nconst noop = (any) => any;\n\nexport { noop };\n//# sourceMappingURL=noop.mjs.map\n","import { MotionGlobalConfig } from \"motion-utils\";\nimport { frameData } from \"./frame\";\nlet now;\nfunction clearTime() {\n now = undefined;\n}\n/**\n * An eventloop-synchronous alternative to performance.now().\n *\n * Ensures that time measurements remain consistent within a synchronous context.\n * Usually calling performance.now() twice within the same synchronous context\n * will return different values which isn't useful for animations when we're usually\n * trying to sync animations to the same frame.\n */\nexport const time = {\n now: () => {\n if (now === undefined) {\n time.set(frameData.isProcessing || MotionGlobalConfig.useManualTiming\n ? frameData.timestamp\n : performance.now());\n }\n return now;\n },\n set: (newTime) => {\n now = newTime;\n queueMicrotask(clearTime);\n },\n};\n//# sourceMappingURL=sync-time.js.map","import { SubscriptionManager, velocityPerSecond, warnOnce, } from \"motion-utils\";\nimport { frame } from \"../frameloop\";\nimport { time } from \"../frameloop/sync-time\";\n/**\n * Maximum time between the value of two frames, beyond which we\n * assume the velocity has since been 0.\n */\nconst MAX_VELOCITY_DELTA = 30;\nconst isFloat = (value) => {\n return !isNaN(parseFloat(value));\n};\nexport const collectMotionValues = {\n current: undefined,\n};\n/**\n * `MotionValue` is used to track the state and velocity of motion values.\n *\n * @public\n */\nexport class MotionValue {\n /**\n * @param init - The initiating value\n * @param config - Optional configuration options\n *\n * - `transformer`: A function to transform incoming values with.\n */\n constructor(init, options = {}) {\n /**\n * Tracks whether this value can output a velocity. Currently this is only true\n * if the value is numerical, but we might be able to widen the scope here and support\n * other value types.\n *\n * @internal\n */\n this.canTrackVelocity = null;\n /**\n * An object containing a SubscriptionManager for each active event.\n */\n this.events = {};\n this.updateAndNotify = (v) => {\n const currentTime = time.now();\n /**\n * If we're updating the value during another frame or eventloop\n * than the previous frame, then the we set the previous frame value\n * to current.\n */\n if (this.updatedAt !== currentTime) {\n this.setPrevFrameValue();\n }\n this.prev = this.current;\n this.setCurrent(v);\n // Update update subscribers\n if (this.current !== this.prev) {\n this.events.change?.notify(this.current);\n if (this.dependents) {\n for (const dependent of this.dependents) {\n dependent.dirty();\n }\n }\n }\n };\n this.hasAnimated = false;\n this.setCurrent(init);\n this.owner = options.owner;\n }\n setCurrent(current) {\n this.current = current;\n this.updatedAt = time.now();\n if (this.canTrackVelocity === null && current !== undefined) {\n this.canTrackVelocity = isFloat(this.current);\n }\n }\n setPrevFrameValue(prevFrameValue = this.current) {\n this.prevFrameValue = prevFrameValue;\n this.prevUpdatedAt = this.updatedAt;\n }\n /**\n * Adds a function that will be notified when the `MotionValue` is updated.\n *\n * It returns a function that, when called, will cancel the subscription.\n *\n * When calling `onChange` inside a React component, it should be wrapped with the\n * `useEffect` hook. As it returns an unsubscribe function, this should be returned\n * from the `useEffect` function to ensure you don't add duplicate subscribers..\n *\n * ```jsx\n * export const MyComponent = () => {\n * const x = useMotionValue(0)\n * const y = useMotionValue(0)\n * const opacity = useMotionValue(1)\n *\n * useEffect(() => {\n * function updateOpacity() {\n * const maxXY = Math.max(x.get(), y.get())\n * const newOpacity = transform(maxXY, [0, 100], [1, 0])\n * opacity.set(newOpacity)\n * }\n *\n * const unsubscribeX = x.on(\"change\", updateOpacity)\n * const unsubscribeY = y.on(\"change\", updateOpacity)\n *\n * return () => {\n * unsubscribeX()\n * unsubscribeY()\n * }\n * }, [])\n *\n * return \n * }\n * ```\n *\n * @param subscriber - A function that receives the latest value.\n * @returns A function that, when called, will cancel this subscription.\n *\n * @deprecated\n */\n onChange(subscription) {\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(false, `value.onChange(callback) is deprecated. Switch to value.on(\"change\", callback).`);\n }\n return this.on(\"change\", subscription);\n }\n on(eventName, callback) {\n if (!this.events[eventName]) {\n this.events[eventName] = new SubscriptionManager();\n }\n const unsubscribe = this.events[eventName].add(callback);\n if (eventName === \"change\") {\n return () => {\n unsubscribe();\n /**\n * If we have no more change listeners by the start\n * of the next frame, stop active animations.\n */\n frame.read(() => {\n if (!this.events.change.getSize()) {\n this.stop();\n }\n });\n };\n }\n return unsubscribe;\n }\n clearListeners() {\n for (const eventManagers in this.events) {\n this.events[eventManagers].clear();\n }\n }\n /**\n * Attaches a passive effect to the `MotionValue`.\n */\n attach(passiveEffect, stopPassiveEffect) {\n this.passiveEffect = passiveEffect;\n this.stopPassiveEffect = stopPassiveEffect;\n }\n /**\n * Sets the state of the `MotionValue`.\n *\n * @remarks\n *\n * ```jsx\n * const x = useMotionValue(0)\n * x.set(10)\n * ```\n *\n * @param latest - Latest value to set.\n * @param render - Whether to notify render subscribers. Defaults to `true`\n *\n * @public\n */\n set(v) {\n if (!this.passiveEffect) {\n this.updateAndNotify(v);\n }\n else {\n this.passiveEffect(v, this.updateAndNotify);\n }\n }\n setWithVelocity(prev, current, delta) {\n this.set(current);\n this.prev = undefined;\n this.prevFrameValue = prev;\n this.prevUpdatedAt = this.updatedAt - delta;\n }\n /**\n * Set the state of the `MotionValue`, stopping any active animations,\n * effects, and resets velocity to `0`.\n */\n jump(v, endAnimation = true) {\n this.updateAndNotify(v);\n this.prev = v;\n this.prevUpdatedAt = this.prevFrameValue = undefined;\n endAnimation && this.stop();\n if (this.stopPassiveEffect)\n this.stopPassiveEffect();\n }\n dirty() {\n this.events.change?.notify(this.current);\n }\n addDependent(dependent) {\n if (!this.dependents) {\n this.dependents = new Set();\n }\n this.dependents.add(dependent);\n }\n removeDependent(dependent) {\n if (this.dependents) {\n this.dependents.delete(dependent);\n }\n }\n /**\n * Returns the latest state of `MotionValue`\n *\n * @returns - The latest state of `MotionValue`\n *\n * @public\n */\n get() {\n if (collectMotionValues.current) {\n collectMotionValues.current.push(this);\n }\n return this.current;\n }\n /**\n * @public\n */\n getPrevious() {\n return this.prev;\n }\n /**\n * Returns the latest velocity of `MotionValue`\n *\n * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical.\n *\n * @public\n */\n getVelocity() {\n const currentTime = time.now();\n if (!this.canTrackVelocity ||\n this.prevFrameValue === undefined ||\n currentTime - this.updatedAt > MAX_VELOCITY_DELTA) {\n return 0;\n }\n const delta = Math.min(this.updatedAt - this.prevUpdatedAt, MAX_VELOCITY_DELTA);\n // Casts because of parseFloat's poor typing\n return velocityPerSecond(parseFloat(this.current) -\n parseFloat(this.prevFrameValue), delta);\n }\n /**\n * Registers a new animation to control this `MotionValue`. Only one\n * animation can drive a `MotionValue` at one time.\n *\n * ```jsx\n * value.start()\n * ```\n *\n * @param animation - A function that starts the provided animation\n */\n start(startAnimation) {\n this.stop();\n return new Promise((resolve) => {\n this.hasAnimated = true;\n this.animation = startAnimation(resolve);\n if (this.events.animationStart) {\n this.events.animationStart.notify();\n }\n }).then(() => {\n if (this.events.animationComplete) {\n this.events.animationComplete.notify();\n }\n this.clearAnimation();\n });\n }\n /**\n * Stop the currently active animation.\n *\n * @public\n */\n stop() {\n if (this.animation) {\n this.animation.stop();\n if (this.events.animationCancel) {\n this.events.animationCancel.notify();\n }\n }\n this.clearAnimation();\n }\n /**\n * Returns `true` if this value is currently animating.\n *\n * @public\n */\n isAnimating() {\n return !!this.animation;\n }\n clearAnimation() {\n delete this.animation;\n }\n /**\n * Destroy and clean up subscribers to this `MotionValue`.\n *\n * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically\n * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually\n * created a `MotionValue` via the `motionValue` function.\n *\n * @public\n */\n destroy() {\n this.dependents?.clear();\n this.events.destroy?.notify();\n this.clearListeners();\n this.stop();\n if (this.stopPassiveEffect) {\n this.stopPassiveEffect();\n }\n }\n}\nexport function motionValue(init, options) {\n return new MotionValue(init, options);\n}\n//# sourceMappingURL=index.js.map","/*\n Convert velocity into velocity per second\n*/\n/*#__NO_SIDE_EFFECTS__*/\nconst velocityPerSecond = (velocity, frameDuration) => frameDuration ? velocity * (1000 / frameDuration) : 0;\n\nexport { velocityPerSecond };\n//# sourceMappingURL=velocity-per-second.mjs.map\n","import { resolveElements, } from \"../../utils/resolve-elements\";\nexport function createSelectorEffect(subjectEffect) {\n return (subject, values) => {\n const elements = resolveElements(subject);\n const subscriptions = [];\n for (const element of elements) {\n const remove = subjectEffect(element, values);\n subscriptions.push(remove);\n }\n return () => {\n for (const remove of subscriptions)\n remove();\n };\n };\n}\n//# sourceMappingURL=create-dom-effect.js.map","export function resolveElements(elementOrSelector, scope, selectorCache) {\n if (elementOrSelector == null) {\n return [];\n }\n if (elementOrSelector instanceof EventTarget) {\n return [elementOrSelector];\n }\n else if (typeof elementOrSelector === \"string\") {\n let root = document;\n if (scope) {\n root = scope.current;\n }\n const elements = selectorCache?.[elementOrSelector] ??\n root.querySelectorAll(elementOrSelector);\n return elements ? Array.from(elements) : [];\n }\n return Array.from(elementOrSelector).filter((element) => element != null);\n}\n//# sourceMappingURL=resolve-elements.js.map","import { clamp } from \"motion-utils\";\nexport const number = {\n test: (v) => typeof v === \"number\",\n parse: parseFloat,\n transform: (v) => v,\n};\nexport const alpha = {\n ...number,\n transform: (v) => clamp(0, 1, v),\n};\nexport const scale = {\n ...number,\n default: 1,\n};\n//# sourceMappingURL=index.js.map","import { number } from \"./numbers\";\nexport const int = {\n ...number,\n transform: Math.round,\n};\n//# sourceMappingURL=int.js.map","/*#__NO_SIDE_EFFECTS__*/\nconst createUnitType = (unit) => ({\n test: (v) => typeof v === \"string\" && v.endsWith(unit) && v.split(\" \").length === 1,\n parse: parseFloat,\n transform: (v) => `${v}${unit}`,\n});\nexport const degrees = /*@__PURE__*/ createUnitType(\"deg\");\nexport const percent = /*@__PURE__*/ createUnitType(\"%\");\nexport const px = /*@__PURE__*/ createUnitType(\"px\");\nexport const vh = /*@__PURE__*/ createUnitType(\"vh\");\nexport const vw = /*@__PURE__*/ createUnitType(\"vw\");\nexport const progressPercentage = /*@__PURE__*/ (() => ({\n ...percent,\n parse: (v) => percent.parse(v) / 100,\n transform: (v) => percent.transform(v * 100),\n}))();\n//# sourceMappingURL=units.js.map","import { int } from \"../int\";\nimport { alpha } from \"../numbers\";\nimport { px } from \"../numbers/units\";\nimport { transformValueTypes } from \"./transform\";\nexport const numberValueTypes = {\n // Border props\n borderWidth: px,\n borderTopWidth: px,\n borderRightWidth: px,\n borderBottomWidth: px,\n borderLeftWidth: px,\n borderRadius: px,\n borderTopLeftRadius: px,\n borderTopRightRadius: px,\n borderBottomRightRadius: px,\n borderBottomLeftRadius: px,\n // Positioning props\n width: px,\n maxWidth: px,\n height: px,\n maxHeight: px,\n top: px,\n right: px,\n bottom: px,\n left: px,\n inset: px,\n insetBlock: px,\n insetBlockStart: px,\n insetBlockEnd: px,\n insetInline: px,\n insetInlineStart: px,\n insetInlineEnd: px,\n // Spacing props\n padding: px,\n paddingTop: px,\n paddingRight: px,\n paddingBottom: px,\n paddingLeft: px,\n paddingBlock: px,\n paddingBlockStart: px,\n paddingBlockEnd: px,\n paddingInline: px,\n paddingInlineStart: px,\n paddingInlineEnd: px,\n margin: px,\n marginTop: px,\n marginRight: px,\n marginBottom: px,\n marginLeft: px,\n marginBlock: px,\n marginBlockStart: px,\n marginBlockEnd: px,\n marginInline: px,\n marginInlineStart: px,\n marginInlineEnd: px,\n // Typography\n fontSize: px,\n // Misc\n backgroundPositionX: px,\n backgroundPositionY: px,\n ...transformValueTypes,\n zIndex: int,\n // SVG\n fillOpacity: alpha,\n strokeOpacity: alpha,\n numOctaves: int,\n};\n//# sourceMappingURL=number.js.map","import { alpha, scale } from \"../numbers\";\nimport { degrees, progressPercentage, px } from \"../numbers/units\";\nexport const transformValueTypes = {\n rotate: degrees,\n /**\n * Internal channel for `transition.path` orientToPath. Composed onto\n * `rotate` at the transform-build sites so the user's `rotate` is\n * never read or overwritten. Not part of `transformPropOrder`.\n */\n pathRotation: degrees,\n rotateX: degrees,\n rotateY: degrees,\n rotateZ: degrees,\n scale,\n scaleX: scale,\n scaleY: scale,\n scaleZ: scale,\n skew: degrees,\n skewX: degrees,\n skewY: degrees,\n distance: px,\n translateX: px,\n translateY: px,\n translateZ: px,\n x: px,\n y: px,\n z: px,\n perspective: px,\n transformPerspective: px,\n opacity: alpha,\n originX: progressPercentage,\n originY: progressPercentage,\n originZ: px,\n};\n//# sourceMappingURL=transform.js.map","import { cancelFrame, frame } from \"../frameloop/frame\";\nimport { numberValueTypes } from \"../value/types/maps/number\";\nimport { getValueAsType } from \"../value/types/utils/get-as-type\";\nexport class MotionValueState {\n constructor() {\n this.latest = {};\n this.values = new Map();\n }\n set(name, value, render, computed, useDefaultValueType = true) {\n const existingValue = this.values.get(name);\n if (existingValue) {\n existingValue.onRemove();\n }\n const onChange = () => {\n const v = value.get();\n if (useDefaultValueType) {\n this.latest[name] = getValueAsType(v, numberValueTypes[name]);\n }\n else {\n this.latest[name] = v;\n }\n render && frame.render(render);\n };\n onChange();\n const cancelOnChange = value.on(\"change\", onChange);\n computed && value.addDependent(computed);\n const remove = () => {\n cancelOnChange();\n render && cancelFrame(render);\n this.values.delete(name);\n computed && value.removeDependent(computed);\n };\n this.values.set(name, { value, onRemove: remove });\n return remove;\n }\n get(name) {\n return this.values.get(name)?.value;\n }\n}\n//# sourceMappingURL=MotionValueState.js.map","/**\n * Provided a value and a ValueType, returns the value as that value type.\n */\nexport const getValueAsType = (value, type) => {\n return type && typeof value === \"number\"\n ? type.transform(value)\n : value;\n};\n//# sourceMappingURL=get-as-type.js.map","import { MotionValueState } from \"../MotionValueState\";\nexport function createEffect(addValue) {\n const stateCache = new WeakMap();\n return (subject, values) => {\n const state = stateCache.get(subject) ?? new MotionValueState();\n stateCache.set(subject, state);\n const subscriptions = [];\n for (const key in values) {\n const value = values[key];\n const remove = addValue(subject, state, key, value);\n subscriptions.push(remove);\n }\n return () => {\n for (const cancel of subscriptions)\n cancel();\n };\n };\n}\n//# sourceMappingURL=create-effect.js.map","import { transformPropOrder } from \"../../render/utils/keys-transform\";\nconst translateAlias = {\n x: \"translateX\",\n y: \"translateY\",\n z: \"translateZ\",\n transformPerspective: \"perspective\",\n};\nexport function buildTransform(state) {\n let transform = \"\";\n let transformIsDefault = true;\n /**\n * Loop over all possible transforms in order, adding the ones that\n * are present to the transform string.\n */\n for (let i = 0; i < transformPropOrder.length; i++) {\n const key = transformPropOrder[i];\n const value = state.latest[key];\n if (value === undefined)\n continue;\n let valueIsDefault = true;\n if (typeof value === \"number\") {\n valueIsDefault = value === (key.startsWith(\"scale\") ? 1 : 0);\n }\n else {\n const parsed = parseFloat(value);\n valueIsDefault = key.startsWith(\"scale\") ? parsed === 1 : parsed === 0;\n }\n if (!valueIsDefault) {\n transformIsDefault = false;\n const transformName = translateAlias[key] || key;\n transform += `${transformName}(${value}) `;\n }\n }\n // See build-transform.ts: additive `rotate()` so user `rotate` isn't\n // clobbered. Not a `transformPropOrder` slot.\n const pathRotation = state.latest.pathRotation;\n if (pathRotation) {\n transformIsDefault = false;\n transform += `rotate(${typeof pathRotation === \"number\"\n ? `${pathRotation}deg`\n : pathRotation}) `;\n }\n return transformIsDefault ? \"none\" : transform.trim();\n}\n//# sourceMappingURL=transform.js.map","import { isCSSVar } from \"../../render/dom/is-css-var\";\nimport { transformProps } from \"../../render/utils/keys-transform\";\nimport { isHTMLElement } from \"../../utils/is-html-element\";\nimport { MotionValue } from \"../../value\";\nimport { createSelectorEffect } from \"../utils/create-dom-effect\";\nimport { createEffect } from \"../utils/create-effect\";\nimport { buildTransform } from \"./transform\";\nconst originProps = new Set([\"originX\", \"originY\", \"originZ\"]);\nexport const addStyleValue = (element, state, key, value) => {\n let render = undefined;\n let computed = undefined;\n if (transformProps.has(key)) {\n if (!state.get(\"transform\")) {\n // If this is an HTML element, we need to set the transform-box to fill-box\n // to normalise the transform relative to the element's bounding box\n if (!isHTMLElement(element) && !state.get(\"transformBox\")) {\n addStyleValue(element, state, \"transformBox\", new MotionValue(\"fill-box\"));\n }\n state.set(\"transform\", new MotionValue(\"none\"), () => {\n element.style.transform = buildTransform(state);\n });\n }\n computed = state.get(\"transform\");\n }\n else if (originProps.has(key)) {\n if (!state.get(\"transformOrigin\")) {\n state.set(\"transformOrigin\", new MotionValue(\"\"), () => {\n const originX = state.latest.originX ?? \"50%\";\n const originY = state.latest.originY ?? \"50%\";\n const originZ = state.latest.originZ ?? 0;\n element.style.transformOrigin = `${originX} ${originY} ${originZ}`;\n });\n }\n computed = state.get(\"transformOrigin\");\n }\n else if (isCSSVar(key)) {\n render = () => {\n element.style.setProperty(key, state.latest[key]);\n };\n }\n else {\n render = () => {\n element.style[key] = state.latest[key];\n };\n }\n return state.set(key, value, render, computed);\n};\nexport const styleEffect = /*@__PURE__*/ createSelectorEffect(\n/*@__PURE__*/ createEffect(addStyleValue));\n//# sourceMappingURL=index.js.map","import { isObject } from \"motion-utils\";\n/**\n * Checks if an element is an HTML element in a way\n * that works across iframes\n */\nexport function isHTMLElement(element) {\n return (isObject(element) &&\n \"offsetHeight\" in element &&\n !(\"ownerSVGElement\" in element));\n}\n//# sourceMappingURL=is-html-element.js.map","const isObject = (value) => typeof value === \"object\" && value !== null;\n\nexport { isObject };\n//# sourceMappingURL=is-object.mjs.map\n"],"names":["transformPropOrder","transformProps","Set","MotionGlobalConfig","SubscriptionManager","constructor","this","subscriptions","add","handler","arr","item","indexOf","push","index","splice","removeItem","notify","a","b","c","numSubscriptions","length","i","getSize","clear","stepsOrder","createRenderBatcher","scheduleNextBatch","allowKeepAlive","runNextFrame","useDefaultElapsed","state","delta","timestamp","isProcessing","flagRunNextFrame","steps","reduce","acc","key","thisFrame","nextFrame","flushNextFrame","toKeepAlive","WeakSet","latestFrameData","triggerCallback","callback","has","step","schedule","keepAlive","immediate","queue","cancel","delete","process","frameData","prevFrame","forEach","createRenderStep","setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender","processBatch","useManualTiming","performance","now","Math","max","min","frame","cancelFrame","requestAnimationFrame","any","clearTime","undefined","time","set","newTime","queueMicrotask","MotionValue","init","options","canTrackVelocity","events","updateAndNotify","v","currentTime","updatedAt","setPrevFrameValue","prev","current","setCurrent","change","dependents","dependent","dirty","hasAnimated","owner","value","isNaN","parseFloat","prevFrameValue","prevUpdatedAt","onChange","subscription","on","eventName","unsubscribe","stop","clearListeners","eventManagers","attach","passiveEffect","stopPassiveEffect","setWithVelocity","jump","endAnimation","addDependent","removeDependent","get","getPrevious","getVelocity","velocity","frameDuration","start","startAnimation","Promise","resolve","animation","animationStart","then","animationComplete","clearAnimation","animationCancel","isAnimating","destroy","createSelectorEffect","subjectEffect","subject","values","elements","elementOrSelector","EventTarget","document","querySelectorAll","Array","from","filter","element","resolveElements","remove","number","test","parse","transform","alpha","clamp","scale","default","int","round","createUnitType","unit","endsWith","split","degrees","percent","px","progressPercentage","numberValueTypes","borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","width","maxWidth","height","maxHeight","top","right","bottom","left","inset","insetBlock","insetBlockStart","insetBlockEnd","insetInline","insetInlineStart","insetInlineEnd","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingBlock","paddingBlockStart","paddingBlockEnd","paddingInline","paddingInlineStart","paddingInlineEnd","margin","marginTop","marginRight","marginBottom","marginLeft","marginBlock","marginBlockStart","marginBlockEnd","marginInline","marginInlineStart","marginInlineEnd","fontSize","backgroundPositionX","backgroundPositionY","rotate","pathRotation","rotateX","rotateY","rotateZ","scaleX","scaleY","scaleZ","skew","skewX","skewY","distance","translateX","translateY","translateZ","x","y","z","perspective","transformPerspective","opacity","originX","originY","originZ","zIndex","fillOpacity","strokeOpacity","numOctaves","MotionValueState","latest","Map","name","computed","useDefaultValueType","existingValue","onRemove","type","getValueAsType","cancelOnChange","createEffect","addValue","stateCache","WeakMap","translateAlias","originProps","addStyleValue","isHTMLElement","style","transformIsDefault","valueIsDefault","startsWith","parsed","trim","buildTransform","transformOrigin","setProperty","styleEffect"],"mappings":"AAAO,MCGMA,EAAqB,CAC9B,uBACA,IACA,IACA,IACA,aACA,aACA,aACA,QACA,SACA,SACA,SACA,UACA,UACA,UACA,OACA,QACA,SAYSC,EAA+B,KAAO,IAAIC,IAAI,IAAIF,EAAoB,iBAAvC,GChC5C,MCAMG,EAAqB,CAAA,ECE3B,MAAMC,EACF,WAAAC,GACIC,KAAKC,cAAgB,EACzB,CACA,GAAAC,CAAIC,GCNR,IAAuBC,EAAKC,EDQpB,OCReD,EDODJ,KAAKC,cCPCI,EDOcF,GCNZ,IAAtBC,EAAIE,QAAQD,IACZD,EAAIG,KAAKF,GDMF,ICJf,SAAoBD,EAAKC,GACrB,MAAMG,EAAQJ,EAAIE,QAAQD,GACtBG,GAAQ,GACRJ,EAAIK,OAAOD,EAAO,EAC1B,CDAqBE,CAAWV,KAAKC,cAAeE,EAChD,CACA,MAAAQ,CAAOC,EAAGC,EAAGC,GACT,MAAMC,EAAmBf,KAAKC,cAAce,OAC5C,GAAKD,EAEL,GAAyB,IAArBA,EAIAf,KAAKC,cAAc,GAAGW,EAAGC,EAAGC,QAG5B,IAAK,IAAIG,EAAI,EAAGA,EAAIF,EAAkBE,IAAK,CAKvC,MAAMd,EAAUH,KAAKC,cAAcgB,GACnCd,GAAWA,EAAQS,EAAGC,EAAGC,EAC7B,CAER,CACA,OAAAI,GACI,OAAOlB,KAAKC,cAAce,MAC9B,CACA,KAAAG,GACInB,KAAKC,cAAce,OAAS,CAChC,EEpCG,MAAMI,EAAa,CACtB,QACA,OACA,mBACA,YACA,SACA,YACA,SACA,cCJG,SAASC,EAAoBC,EAAmBC,GACnD,IAAIC,GAAe,EACfC,GAAoB,EACxB,MAAMC,EAAQ,CACVC,MAAO,EACPC,UAAW,EACXC,cAAc,GAEZC,E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K,KAAWlE,EAAI8O,WAAW,SAAW,EAAI,OAEzD,CACD,MAAMC,EAAS3K,WAAWF,GAC1B2K,EAAiB7O,EAAI8O,WAAW,SAAsB,IAAXC,EAA0B,IAAXA,CAC9D,CACKF,IACDD,GAAqB,EAErBlH,GAAa,GADS6G,EAAevO,IAAQA,KACZkE,MAEzC,CAGA,MAAM2H,EAAerM,EAAMiO,OAAO5B,aAOlC,OANIA,IACA+C,GAAqB,EACrBlH,GAAa,UAAkC,iBAAjBmE,EACxB,GAAGA,OACHA,OAEH+C,EAAqB,OAASlH,EAAUsH,MACnD,CCxB0CC,CAAezP,MAGjDoO,EAAWpO,EAAM+F,IAAI,cAEhBiJ,EAAY/N,IAAIT,IAChBR,EAAM+F,IAAI,oBACX/F,EAAMoD,IAAI,kBAAmB,IAAIG,EAAY,IAAK,KAC9C,MAAMkK,EAAUzN,EAAMiO,OAAOR,SAAW,MAClCC,EAAU1N,EAAMiO,OAAOP,SAAW,MAClCC,EAAU3N,EAAMiO,OAAON,SAAW,EACxC/F,EAAQuH,MAAMO,gBAAkB,GAAGjC,KAAWC,KAAWC,MAGjES,EAAWpO,EAAM+F,IAAI,oBAGrB3D,EADc5B,EzBnCiB8O,WAAW,MyBoCjC,KACL1H,EAAQuH,MAAMQ,YAAYnP,EAAKR,EAAMiO,OAAOzN,KAIvC,KACLoH,EAAQuH,MAAM3O,GAAOR,EAAMiO,OAAOzN,IAGnCR,EAAMoD,IAAI5C,EAAKkE,EAAOtC,EAAQgM,IAE5BwB,EAA4B5I,EAC3B2H,EAAaM"} \ No newline at end of file diff --git a/node_modules/motion-dom/package.json b/node_modules/motion-dom/package.json new file mode 100644 index 0000000..74125d8 --- /dev/null +++ b/node_modules/motion-dom/package.json @@ -0,0 +1,40 @@ +{ + "name": "motion-dom", + "version": "13.0.0", + "author": "Matt Perry", + "license": "MIT", + "repository": "https://github.com/motiondivision/motion", + "main": "./dist/cjs/index.js", + "types": "./dist/index.d.ts", + "module": "./dist/es/index.mjs", + "sideEffects": false, + "exports": { + ".": { + "types": "./dist/index.d.ts", + "require": "./dist/cjs/index.js", + "import": "./dist/es/index.mjs", + "default": "./dist/cjs/index.js" + } + }, + "dependencies": { + "motion-utils": "^13.0.0" + }, + "scripts": { + "clean": "rm -rf types dist lib", + "build": "yarn clean && tsc -p . && rollup -c && node ./scripts/check-bundle.js", + "dev": "concurrently -c blue,red -n tsc,rollup --kill-others \"tsc --watch -p . --preserveWatchOutput\" \"rollup --config --watch --no-watch.clearScreen\"", + "test": "jest --config jest.config.json --max-workers=2", + "measure": "rollup -c ./rollup.size.config.mjs" + }, + "bundlesize": [ + { + "path": "./dist/size-rollup-style-effect.js", + "maxSize": "2.9 kB" + }, + { + "path": "./dist/size-rollup-motion-value.js", + "maxSize": "1.8 kB" + } + ], + "gitHead": "e4029ce071bddaed2a539b861f5d9c509bea40da" +} diff --git a/node_modules/motion-utils/LICENSE.md b/node_modules/motion-utils/LICENSE.md new file mode 100644 index 0000000..8111044 --- /dev/null +++ b/node_modules/motion-utils/LICENSE.md @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2024 [Motion](https://motion.dev) B.V. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/motion-utils/dist/cjs/index.js b/node_modules/motion-utils/dist/cjs/index.js new file mode 100644 index 0000000..a33f3dd --- /dev/null +++ b/node_modules/motion-utils/dist/cjs/index.js @@ -0,0 +1,345 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +function addUniqueItem(arr, item) { + if (arr.indexOf(item) === -1) + arr.push(item); +} +function removeItem(arr, item) { + const index = arr.indexOf(item); + if (index > -1) + arr.splice(index, 1); +} +// Adapted from array-move +function moveItem([...arr], fromIndex, toIndex) { + const startIndex = fromIndex < 0 ? arr.length + fromIndex : fromIndex; + if (startIndex >= 0 && startIndex < arr.length) { + const endIndex = toIndex < 0 ? arr.length + toIndex : toIndex; + const [item] = arr.splice(fromIndex, 1); + arr.splice(endIndex, 0, item); + } + return arr; +} + +const clamp = (min, max, v) => { + if (v > max) + return max; + if (v < min) + return min; + return v; +}; + +function formatErrorMessage(message, errorCode) { + return errorCode + ? `${message}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${errorCode}` + : message; +} + +exports.warning = () => { }; +exports.invariant = () => { }; +if (typeof process !== "undefined" && + process.env?.NODE_ENV !== "production") { + exports.warning = (check, message, errorCode) => { + if (!check && typeof console !== "undefined") { + console.warn(formatErrorMessage(message, errorCode)); + } + }; + exports.invariant = (check, message, errorCode) => { + if (!check) { + throw new Error(formatErrorMessage(message, errorCode)); + } + }; +} + +const MotionGlobalConfig = {}; + +/** + * Check if value is a numerical string, ie a string that is purely a number eg "100" or "-100.1" + */ +const isNumericalString = (v) => /^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(v); + +const isObject = (value) => typeof value === "object" && value !== null; + +/** + * Check if the value is a zero value string like "0px" or "0%" + */ +const isZeroValueString = (v) => /^0[^.\s]+$/u.test(v); + +/*#__NO_SIDE_EFFECTS__*/ +function memo(callback) { + let result; + return () => { + if (result === undefined) + result = callback(); + return result; + }; +} + +/*#__NO_SIDE_EFFECTS__*/ +const noop = (any) => any; + +/** + * Pipe + * Compose other transformers to run linearily + * pipe(min(20), max(40)) + * @param {...functions} transformers + * @return {function} + */ +const pipe = (...transformers) => transformers.reduce((a, b) => (v) => b(a(v))); + +/* + Progress within given range + + Given a lower limit and an upper limit, we return the progress + (expressed as a number 0-1) represented by the given value, and + limit that progress to within 0-1. +*/ +/*#__NO_SIDE_EFFECTS__*/ +const progress = (from, to, value) => { + const range = to - from; + return range ? (value - from) / range : 1; +}; + +class SubscriptionManager { + constructor() { + this.subscriptions = []; + } + add(handler) { + addUniqueItem(this.subscriptions, handler); + return () => removeItem(this.subscriptions, handler); + } + notify(a, b, c) { + const numSubscriptions = this.subscriptions.length; + if (!numSubscriptions) + return; + if (numSubscriptions === 1) { + /** + * If there's only a single handler we can just call it without invoking a loop. + */ + this.subscriptions[0](a, b, c); + } + else { + for (let i = 0; i < numSubscriptions; i++) { + /** + * Check whether the handler exists before firing as it's possible + * the subscriptions were modified during this loop running. + */ + const handler = this.subscriptions[i]; + handler && handler(a, b, c); + } + } + } + getSize() { + return this.subscriptions.length; + } + clear() { + this.subscriptions.length = 0; + } +} + +/** + * Converts seconds to milliseconds + * + * @param seconds - Time in seconds. + * @return milliseconds - Converted time in milliseconds. + */ +/*#__NO_SIDE_EFFECTS__*/ +const secondsToMilliseconds = (seconds) => seconds * 1000; +/*#__NO_SIDE_EFFECTS__*/ +const millisecondsToSeconds = (milliseconds) => milliseconds / 1000; + +/* + Convert velocity into velocity per second +*/ +/*#__NO_SIDE_EFFECTS__*/ +const velocityPerSecond = (velocity, frameDuration) => frameDuration ? velocity * (1000 / frameDuration) : 0; + +const warned = new Set(); +function hasWarned(message) { + return warned.has(message); +} +function warnOnce(condition, message, errorCode) { + if (condition || warned.has(message)) + return; + console.warn(formatErrorMessage(message, errorCode)); + warned.add(message); +} + +const wrap = (min, max, v) => { + const rangeSize = max - min; + return ((((v - min) % rangeSize) + rangeSize) % rangeSize) + min; +}; + +/* + Bezier function generator + This has been modified from Gaëtan Renaudeau's BezierEasing + https://github.com/gre/bezier-easing/blob/master/src/index.js + https://github.com/gre/bezier-easing/blob/master/LICENSE + + I've removed the newtonRaphsonIterate algo because in benchmarking it + wasn't noticeably faster than binarySubdivision, indeed removing it + usually improved times, depending on the curve. + I also removed the lookup table, as for the added bundle size and loop we're + only cutting ~4 or so subdivision iterations. I bumped the max iterations up + to 12 to compensate and this still tended to be faster for no perceivable + loss in accuracy. + Usage + const easeOut = cubicBezier(.17,.67,.83,.67); + const x = easeOut(0.5); // returns 0.627... +*/ +// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2. +const calcBezier = (t, a1, a2) => (((1.0 - 3.0 * a2 + 3.0 * a1) * t + (3.0 * a2 - 6.0 * a1)) * t + 3.0 * a1) * + t; +const subdivisionPrecision = 0.0000001; +const subdivisionMaxIterations = 12; +function binarySubdivide(x, lowerBound, upperBound, mX1, mX2) { + let currentX; + let currentT; + let i = 0; + do { + currentT = lowerBound + (upperBound - lowerBound) / 2.0; + currentX = calcBezier(currentT, mX1, mX2) - x; + if (currentX > 0.0) { + upperBound = currentT; + } + else { + lowerBound = currentT; + } + } while (Math.abs(currentX) > subdivisionPrecision && + ++i < subdivisionMaxIterations); + return currentT; +} +/*#__NO_SIDE_EFFECTS__*/ +function cubicBezier(mX1, mY1, mX2, mY2) { + // If this is a linear gradient, return linear easing + if (mX1 === mY1 && mX2 === mY2) + return noop; + const getTForX = (aX) => binarySubdivide(aX, 0, 1, mX1, mX2); + // If animation is at start/end, return t without easing + return (t) => t === 0 || t === 1 ? t : calcBezier(getTForX(t), mY1, mY2); +} + +// Accepts an easing function and returns a new one that outputs mirrored values for +// the second half of the animation. Turns easeIn into easeInOut. +/*#__NO_SIDE_EFFECTS__*/ +const mirrorEasing = (easing) => (p) => p <= 0.5 ? easing(2 * p) / 2 : (2 - easing(2 * (1 - p))) / 2; + +// Accepts an easing function and returns a new one that outputs reversed values. +// Turns easeIn into easeOut. +/*#__NO_SIDE_EFFECTS__*/ +const reverseEasing = (easing) => (p) => 1 - easing(1 - p); + +const backOut = /*@__PURE__*/ cubicBezier(0.33, 1.53, 0.69, 0.99); +const backIn = /*@__PURE__*/ reverseEasing(backOut); +const backInOut = /*@__PURE__*/ mirrorEasing(backIn); + +const anticipate = (p) => p >= 1 + ? 1 + : (p *= 2) < 1 + ? 0.5 * backIn(p) + : 0.5 * (2 - Math.pow(2, -10 * (p - 1))); + +const circIn = (p) => 1 - Math.sin(Math.acos(p)); +const circOut = reverseEasing(circIn); +const circInOut = mirrorEasing(circIn); + +const easeIn = /*@__PURE__*/ cubicBezier(0.42, 0, 1, 1); +const easeOut = /*@__PURE__*/ cubicBezier(0, 0, 0.58, 1); +const easeInOut = /*@__PURE__*/ cubicBezier(0.42, 0, 0.58, 1); + +/*#__NO_SIDE_EFFECTS__*/ +function steps(numSteps, direction = "end") { + return (progress) => { + progress = + direction === "end" + ? Math.min(progress, 0.999) + : Math.max(progress, 0.001); + const expanded = progress * numSteps; + const rounded = direction === "end" ? Math.floor(expanded) : Math.ceil(expanded); + return clamp(0, 1, rounded / numSteps); + }; +} + +/*#__NO_SIDE_EFFECTS__*/ +const isEasingArray = (ease) => { + return Array.isArray(ease) && typeof ease[0] !== "number"; +}; + +/*#__NO_SIDE_EFFECTS__*/ +function getEasingForSegment(easing, i) { + return isEasingArray(easing) ? easing[wrap(0, easing.length, i)] : easing; +} + +/*#__NO_SIDE_EFFECTS__*/ +const isBezierDefinition = (easing) => Array.isArray(easing) && typeof easing[0] === "number"; + +const easingLookup = { + linear: noop, + easeIn, + easeInOut, + easeOut, + circIn, + circInOut, + circOut, + backIn, + backInOut, + backOut, + anticipate, +}; +const isValidEasing = (easing) => { + return typeof easing === "string"; +}; +const easingDefinitionToFunction = (definition) => { + if (isBezierDefinition(definition)) { + // If cubic bezier definition, create bezier curve + exports.invariant(definition.length === 4, `Cubic bezier arrays must contain four numerical values.`, "cubic-bezier-length"); + const [x1, y1, x2, y2] = definition; + return cubicBezier(x1, y1, x2, y2); + } + else if (isValidEasing(definition)) { + // Else lookup from table + exports.invariant(easingLookup[definition] !== undefined, `Invalid easing type '${definition}'`, "invalid-easing-type"); + return easingLookup[definition]; + } + return definition; +}; + +exports.MotionGlobalConfig = MotionGlobalConfig; +exports.SubscriptionManager = SubscriptionManager; +exports.addUniqueItem = addUniqueItem; +exports.anticipate = anticipate; +exports.backIn = backIn; +exports.backInOut = backInOut; +exports.backOut = backOut; +exports.circIn = circIn; +exports.circInOut = circInOut; +exports.circOut = circOut; +exports.clamp = clamp; +exports.cubicBezier = cubicBezier; +exports.easeIn = easeIn; +exports.easeInOut = easeInOut; +exports.easeOut = easeOut; +exports.easingDefinitionToFunction = easingDefinitionToFunction; +exports.getEasingForSegment = getEasingForSegment; +exports.hasWarned = hasWarned; +exports.isBezierDefinition = isBezierDefinition; +exports.isEasingArray = isEasingArray; +exports.isNumericalString = isNumericalString; +exports.isObject = isObject; +exports.isZeroValueString = isZeroValueString; +exports.memo = memo; +exports.millisecondsToSeconds = millisecondsToSeconds; +exports.mirrorEasing = mirrorEasing; +exports.moveItem = moveItem; +exports.noop = noop; +exports.pipe = pipe; +exports.progress = progress; +exports.removeItem = removeItem; +exports.reverseEasing = reverseEasing; +exports.secondsToMilliseconds = secondsToMilliseconds; +exports.steps = steps; +exports.velocityPerSecond = velocityPerSecond; +exports.warnOnce = warnOnce; +exports.wrap = wrap; +//# sourceMappingURL=index.js.map diff --git a/node_modules/motion-utils/dist/cjs/index.js.map b/node_modules/motion-utils/dist/cjs/index.js.map new file mode 100644 index 0000000..660d213 --- /dev/null +++ b/node_modules/motion-utils/dist/cjs/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sources":["../../src/array.ts","../../src/clamp.ts","../../src/format-error-message.ts","../../src/errors.ts","../../src/global-config.ts","../../src/is-numerical-string.ts","../../src/is-object.ts","../../src/is-zero-value-string.ts","../../src/memo.ts","../../src/noop.ts","../../src/pipe.ts","../../src/progress.ts","../../src/subscription-manager.ts","../../src/time-conversion.ts","../../src/velocity-per-second.ts","../../src/warn-once.ts","../../src/wrap.ts","../../src/easing/cubic-bezier.ts","../../src/easing/modifiers/mirror.ts","../../src/easing/modifiers/reverse.ts","../../src/easing/back.ts","../../src/easing/anticipate.ts","../../src/easing/circ.ts","../../src/easing/ease.ts","../../src/easing/steps.ts","../../src/easing/utils/is-easing-array.ts","../../src/easing/utils/get-easing-for-segment.ts","../../src/easing/utils/is-bezier-definition.ts","../../src/easing/utils/map.ts"],"sourcesContent":["export function addUniqueItem(arr: T[], item: T) {\n if (arr.indexOf(item) === -1) arr.push(item)\n}\n\nexport function removeItem(arr: T[], item: T) {\n const index = arr.indexOf(item)\n if (index > -1) arr.splice(index, 1)\n}\n\n// Adapted from array-move\nexport function moveItem([...arr]: T[], fromIndex: number, toIndex: number) {\n const startIndex = fromIndex < 0 ? arr.length + fromIndex : fromIndex\n\n if (startIndex >= 0 && startIndex < arr.length) {\n const endIndex = toIndex < 0 ? arr.length + toIndex : toIndex\n\n const [item] = arr.splice(fromIndex, 1)\n arr.splice(endIndex, 0, item)\n }\n\n return arr\n}\n","export const clamp = (min: number, max: number, v: number) => {\n if (v > max) return max\n if (v < min) return min\n return v\n}\n","export function formatErrorMessage(message: string, errorCode?: string) {\n return errorCode\n ? `${message}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${errorCode}`\n : message\n}\n","import { formatErrorMessage } from \"./format-error-message\"\n\nexport type DevMessage = (\n check: boolean,\n message: string,\n errorCode?: string\n) => void\n\nlet warning: DevMessage = () => {}\nlet invariant: DevMessage = () => {}\n\nif (\n typeof process !== \"undefined\" &&\n process.env?.NODE_ENV !== \"production\"\n) {\n warning = (check, message, errorCode) => {\n if (!check && typeof console !== \"undefined\") {\n console.warn(formatErrorMessage(message, errorCode))\n }\n }\n\n invariant = (check, message, errorCode) => {\n if (!check) {\n throw new Error(formatErrorMessage(message, errorCode))\n }\n }\n}\n\nexport { invariant, warning }\n","export const MotionGlobalConfig: {\n skipAnimations?: boolean\n instantAnimations?: boolean\n useManualTiming?: boolean\n WillChange?: any\n mix?: (a: T, b: T) => (p: number) => T\n} = {}\n","/**\n * Check if value is a numerical string, ie a string that is purely a number eg \"100\" or \"-100.1\"\n */\nexport const isNumericalString = (v: string) => /^-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)$/u.test(v)\n","export const isObject = (value: unknown): value is object =>\n typeof value === \"object\" && value !== null\n","/**\n * Check if the value is a zero value string like \"0px\" or \"0%\"\n */\nexport const isZeroValueString = (v: string) => /^0[^.\\s]+$/u.test(v)\n","/*#__NO_SIDE_EFFECTS__*/\nexport function memo(callback: () => T) {\n let result: T | undefined\n\n return () => {\n if (result === undefined) result = callback()\n return result\n }\n}\n","/*#__NO_SIDE_EFFECTS__*/\nexport const noop = (any: T): T => any\n","/**\n * Pipe\n * Compose other transformers to run linearily\n * pipe(min(20), max(40))\n * @param {...functions} transformers\n * @return {function}\n */\nexport const pipe = (...transformers: Function[]) =>\n transformers.reduce((a, b) => (v: any) => b(a(v)))\n","/*\n Progress within given range\n\n Given a lower limit and an upper limit, we return the progress\n (expressed as a number 0-1) represented by the given value, and\n limit that progress to within 0-1.\n*/\n/*#__NO_SIDE_EFFECTS__*/\nexport const progress = (from: number, to: number, value: number) => {\n const range = to - from\n return range ? (value - from) / range : 1\n}\n","import { addUniqueItem, removeItem } from \"./array\"\n\ntype GenericHandler = (...args: any) => void\n\nexport class SubscriptionManager {\n private subscriptions: Handler[] = []\n\n add(handler: Handler): VoidFunction {\n addUniqueItem(this.subscriptions, handler)\n return () => removeItem(this.subscriptions, handler)\n }\n\n notify(\n a?: Parameters[0],\n b?: Parameters[1],\n c?: Parameters[2]\n ) {\n const numSubscriptions = this.subscriptions.length\n\n if (!numSubscriptions) return\n\n if (numSubscriptions === 1) {\n /**\n * If there's only a single handler we can just call it without invoking a loop.\n */\n this.subscriptions[0](a, b, c)\n } else {\n for (let i = 0; i < numSubscriptions; i++) {\n /**\n * Check whether the handler exists before firing as it's possible\n * the subscriptions were modified during this loop running.\n */\n const handler = this.subscriptions[i]\n handler && handler(a, b, c)\n }\n }\n }\n\n getSize() {\n return this.subscriptions.length\n }\n\n clear() {\n this.subscriptions.length = 0\n }\n}\n","/**\n * Converts seconds to milliseconds\n *\n * @param seconds - Time in seconds.\n * @return milliseconds - Converted time in milliseconds.\n */\n\n/*#__NO_SIDE_EFFECTS__*/\nexport const secondsToMilliseconds = (seconds: number) => seconds * 1000\n\n/*#__NO_SIDE_EFFECTS__*/\nexport const millisecondsToSeconds = (milliseconds: number) =>\n milliseconds / 1000\n","/*\n Convert velocity into velocity per second\n*/\n/*#__NO_SIDE_EFFECTS__*/\nexport const velocityPerSecond = (velocity: number, frameDuration: number) =>\n frameDuration ? velocity * (1000 / frameDuration) : 0\n","import { formatErrorMessage } from \"./format-error-message\"\n\nconst warned = new Set()\n\nexport function hasWarned(message: string) {\n return warned.has(message)\n}\n\nexport function warnOnce(\n condition: boolean,\n message: string,\n errorCode?: string\n) {\n if (condition || warned.has(message)) return\n\n console.warn(formatErrorMessage(message, errorCode))\n warned.add(message)\n}\n","export const wrap = (min: number, max: number, v: number) => {\n const rangeSize = max - min\n return ((((v - min) % rangeSize) + rangeSize) % rangeSize) + min\n}\n","/*\n Bezier function generator\n This has been modified from Gaëtan Renaudeau's BezierEasing\n https://github.com/gre/bezier-easing/blob/master/src/index.js\n https://github.com/gre/bezier-easing/blob/master/LICENSE\n \n I've removed the newtonRaphsonIterate algo because in benchmarking it\n wasn't noticeably faster than binarySubdivision, indeed removing it\n usually improved times, depending on the curve.\n I also removed the lookup table, as for the added bundle size and loop we're\n only cutting ~4 or so subdivision iterations. I bumped the max iterations up\n to 12 to compensate and this still tended to be faster for no perceivable\n loss in accuracy.\n Usage\n const easeOut = cubicBezier(.17,.67,.83,.67);\n const x = easeOut(0.5); // returns 0.627...\n*/\n\nimport { noop } from \"../noop\"\n\n// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.\nconst calcBezier = (t: number, a1: number, a2: number) =>\n (((1.0 - 3.0 * a2 + 3.0 * a1) * t + (3.0 * a2 - 6.0 * a1)) * t + 3.0 * a1) *\n t\n\nconst subdivisionPrecision = 0.0000001\nconst subdivisionMaxIterations = 12\n\nfunction binarySubdivide(\n x: number,\n lowerBound: number,\n upperBound: number,\n mX1: number,\n mX2: number\n) {\n let currentX: number\n let currentT: number\n let i: number = 0\n\n do {\n currentT = lowerBound + (upperBound - lowerBound) / 2.0\n currentX = calcBezier(currentT, mX1, mX2) - x\n if (currentX > 0.0) {\n upperBound = currentT\n } else {\n lowerBound = currentT\n }\n } while (\n Math.abs(currentX) > subdivisionPrecision &&\n ++i < subdivisionMaxIterations\n )\n\n return currentT\n}\n\n/*#__NO_SIDE_EFFECTS__*/\nexport function cubicBezier(\n mX1: number,\n mY1: number,\n mX2: number,\n mY2: number\n) {\n // If this is a linear gradient, return linear easing\n if (mX1 === mY1 && mX2 === mY2) return noop\n\n const getTForX = (aX: number) => binarySubdivide(aX, 0, 1, mX1, mX2)\n\n // If animation is at start/end, return t without easing\n return (t: number) =>\n t === 0 || t === 1 ? t : calcBezier(getTForX(t), mY1, mY2)\n}\n","// Accepts an easing function and returns a new one that outputs mirrored values for\n\nimport { EasingModifier } from \"../types\"\n\n// the second half of the animation. Turns easeIn into easeInOut.\n/*#__NO_SIDE_EFFECTS__*/\nexport const mirrorEasing: EasingModifier = (easing) => (p) =>\n p <= 0.5 ? easing(2 * p) / 2 : (2 - easing(2 * (1 - p))) / 2\n","// Accepts an easing function and returns a new one that outputs reversed values.\n\nimport { EasingModifier } from \"../types\"\n\n// Turns easeIn into easeOut.\n/*#__NO_SIDE_EFFECTS__*/\nexport const reverseEasing: EasingModifier = (easing) => (p) =>\n 1 - easing(1 - p)\n","import { cubicBezier } from \"./cubic-bezier\"\nimport { mirrorEasing } from \"./modifiers/mirror\"\nimport { reverseEasing } from \"./modifiers/reverse\"\n\nexport const backOut = /*@__PURE__*/ cubicBezier(0.33, 1.53, 0.69, 0.99)\nexport const backIn = /*@__PURE__*/ reverseEasing(backOut)\nexport const backInOut = /*@__PURE__*/ mirrorEasing(backIn)\n","import { backIn } from \"./back\"\n\nexport const anticipate = (p: number) =>\n p >= 1\n ? 1\n : (p *= 2) < 1\n ? 0.5 * backIn(p)\n : 0.5 * (2 - Math.pow(2, -10 * (p - 1)))\n","import { mirrorEasing } from \"./modifiers/mirror\"\nimport { reverseEasing } from \"./modifiers/reverse\"\nimport { EasingFunction } from \"./types\"\n\nexport const circIn: EasingFunction = (p) => 1 - Math.sin(Math.acos(p))\nexport const circOut = reverseEasing(circIn)\nexport const circInOut = mirrorEasing(circIn)\n","import { cubicBezier } from \"./cubic-bezier\"\n\nexport const easeIn = /*@__PURE__*/ cubicBezier(0.42, 0, 1, 1)\nexport const easeOut = /*@__PURE__*/ cubicBezier(0, 0, 0.58, 1)\nexport const easeInOut = /*@__PURE__*/ cubicBezier(0.42, 0, 0.58, 1)\n","import { clamp } from \"../clamp\"\nimport type { EasingFunction } from \"./types\"\n\n/*\n Create stepped version of 0-1 progress\n\n @param [int]: Number of steps\n @param [number]: Current value\n @return [number]: Stepped value\n*/\nexport type Direction = \"start\" | \"end\"\n\n/*#__NO_SIDE_EFFECTS__*/\nexport function steps(\n numSteps: number,\n direction: Direction = \"end\"\n): EasingFunction {\n return (progress: number) => {\n progress =\n direction === \"end\"\n ? Math.min(progress, 0.999)\n : Math.max(progress, 0.001)\n const expanded = progress * numSteps\n const rounded =\n direction === \"end\" ? Math.floor(expanded) : Math.ceil(expanded)\n\n return clamp(0, 1, rounded / numSteps)\n }\n}\n","import { Easing } from \"../types\"\n\n/*#__NO_SIDE_EFFECTS__*/\nexport const isEasingArray = (ease: any): ease is Easing[] => {\n return Array.isArray(ease) && typeof ease[0] !== \"number\"\n}\n","import { wrap } from \"../../wrap\"\nimport { Easing } from \"../types\"\nimport { isEasingArray } from \"./is-easing-array\"\n\n/*#__NO_SIDE_EFFECTS__*/\nexport function getEasingForSegment(\n easing: Easing | Easing[],\n i: number\n): Easing {\n return isEasingArray(easing) ? easing[wrap(0, easing.length, i)] : easing\n}\n","import { BezierDefinition, Easing } from \"../types\"\n\n/*#__NO_SIDE_EFFECTS__*/\nexport const isBezierDefinition = (\n easing: Easing | Easing[]\n): easing is BezierDefinition =>\n Array.isArray(easing) && typeof easing[0] === \"number\"\n","import { invariant } from \"../../errors\"\nimport { noop } from \"../../noop\"\nimport { anticipate } from \"../anticipate\"\nimport { backIn, backInOut, backOut } from \"../back\"\nimport { circIn, circInOut, circOut } from \"../circ\"\nimport { cubicBezier } from \"../cubic-bezier\"\nimport { easeIn, easeInOut, easeOut } from \"../ease\"\nimport { Easing, EasingFunction } from \"../types\"\nimport { isBezierDefinition } from \"./is-bezier-definition\"\n\nconst easingLookup = {\n linear: noop,\n easeIn,\n easeInOut,\n easeOut,\n circIn,\n circInOut,\n circOut,\n backIn,\n backInOut,\n backOut,\n anticipate,\n}\n\nconst isValidEasing = (easing: Easing): easing is keyof typeof easingLookup => {\n return typeof easing === \"string\"\n}\n\nexport const easingDefinitionToFunction = (\n definition: Easing\n): EasingFunction => {\n if (isBezierDefinition(definition)) {\n // If cubic bezier definition, create bezier curve\n invariant(\n definition.length === 4,\n `Cubic bezier arrays must contain four numerical values.`,\n \"cubic-bezier-length\"\n )\n\n const [x1, y1, x2, y2] = definition\n return cubicBezier(x1, y1, x2, y2)\n } else if (isValidEasing(definition)) {\n // Else lookup from table\n invariant(\n easingLookup[definition] !== undefined,\n `Invalid easing type '${definition}'`,\n \"invalid-easing-type\"\n )\n return easingLookup[definition]\n }\n\n return definition\n}\n"],"names":["warning","invariant"],"mappings":";;;;AAAM,SAAU,aAAa,CAAI,GAAQ,EAAE,IAAO,EAAA;IAC9C,IAAI,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE;AAAE,QAAA,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC;AAChD;AAEM,SAAU,UAAU,CAAI,GA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EAAE,EAAE,EAAE,EAAE,CAAC,GAAG,UAAU;QACnC,OAAO,WAAW,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC;IACtC;AAAO,SAAA,IAAI,aAAa,CAAC,UAAU,CAAC,EAAE;;AAElC,QAAAA,iBAAS,CACL,YAAY,CAAC,UAAU,CAAC,KAAK,SAAS,EACtC,CAAA,qBAAA,EAAwB,UAAU,CAAA,CAAA,CAAG,EACrC,qBAAqB,CACxB;AACD,QAAA,OAAO,YAAY,CAAC,UAAU,CAAC;IACnC;AAEA,IAAA,OAAO,UAAU;AACrB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/array.mjs b/node_modules/motion-utils/dist/es/array.mjs new file mode 100644 index 0000000..773d47a --- /dev/null +++ b/node_modules/motion-utils/dist/es/array.mjs @@ -0,0 +1,22 @@ +function addUniqueItem(arr, item) { + if (arr.indexOf(item) === -1) + arr.push(item); +} +function removeItem(arr, item) { + const index = arr.indexOf(item); + if (index > -1) + arr.splice(index, 1); +} +// Adapted from array-move +function moveItem([...arr], fromIndex, toIndex) { + const startIndex = fromIndex < 0 ? arr.length + fromIndex : fromIndex; + if (startIndex >= 0 && startIndex < arr.length) { + const endIndex = toIndex < 0 ? arr.length + toIndex : toIndex; + const [item] = arr.splice(fromIndex, 1); + arr.splice(endIndex, 0, item); + } + return arr; +} + +export { addUniqueItem, moveItem, removeItem }; +//# sourceMappingURL=array.mjs.map diff --git a/node_modules/motion-utils/dist/es/array.mjs.map b/node_modules/motion-utils/dist/es/array.mjs.map new file mode 100644 index 0000000..aaad1ad --- /dev/null +++ b/node_modules/motion-utils/dist/es/array.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"array.mjs","sources":["../../src/array.ts"],"sourcesContent":["export function addUniqueItem(arr: T[], item: T) {\n if (arr.indexOf(item) === -1) arr.push(item)\n}\n\nexport function removeItem(arr: T[], item: T) {\n const index = arr.indexOf(item)\n if (index > -1) arr.splice(index, 1)\n}\n\n// Adapted from array-move\nexport function moveItem([...arr]: T[], fromIndex: number, toIndex: number) {\n const startIndex = fromIndex < 0 ? arr.length + fromIndex : fromIndex\n\n if (startIndex >= 0 && startIndex < arr.length) {\n const endIndex = toIndex < 0 ? arr.length + toIndex : toIndex\n\n const [item] = arr.splice(fromIndex, 1)\n arr.splice(endIndex, 0, item)\n }\n\n return arr\n}\n"],"names":[],"mappings":"AAAM,SAAU,aAAa,CAAI,GAAQ,EAAE,IAAO,EAAA;IAC9C,IAAI,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE;AAAE,QAAA,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC;AAChD;AAEM,SAAU,UAAU,CAAI,GAAQ,EAAE,IAAO,EAAA;IAC3C,MAAM,KAAK,GAAG,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC;IAC/B,IAAI,KAAK,GAAG,EAAE;AAAE,QAAA,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;AACxC;AAEA;AACM,SAAU,QAAQ,CAAI,CAAC,GAAG,GAAG,CAAM,EAAE,SAAiB,EAAE,OAAe,EAAA;AACzE,IAAA,MAAM,UAAU,GAAG,SAAS,GAAG,CAAC,GAAG,GAAG,CAAC,MAAM,GAAG,SAAS,GAAG,SAAS;IAErE,IAAI,UAAU,IAAI,CAAC,IAAI,UAAU,GAAG,GAAG,CAAC,MAAM,EAAE;AAC5C,QAAA,MAAM,QAAQ,GAAG,OAAO,GAAG,CAAC,GAAG,GAAG,CAAC,MAAM,GAAG,OAAO,GAAG,OAAO;AAE7D,QAAA,MAAM,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC;QACvC,GAAG,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,EAAE,IAAI,CAAC;IACjC;AAEA,IAAA,OAAO,GAAG;AACd;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/clamp.mjs b/node_modules/motion-utils/dist/es/clamp.mjs new file mode 100644 index 0000000..1cfe237 --- /dev/null +++ b/node_modules/motion-utils/dist/es/clamp.mjs @@ -0,0 +1,10 @@ +const clamp = (min, max, v) => { + if (v > max) + return max; + if (v < min) + return min; + return v; +}; + +export { clamp }; +//# sourceMappingURL=clamp.mjs.map diff --git a/node_modules/motion-utils/dist/es/clamp.mjs.map b/node_modules/motion-utils/dist/es/clamp.mjs.map new file mode 100644 index 0000000..1613330 --- /dev/null +++ b/node_modules/motion-utils/dist/es/clamp.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"clamp.mjs","sources":["../../src/clamp.ts"],"sourcesContent":["export const clamp = (min: number, max: number, v: number) => {\n if (v > max) return max\n if (v < min) return min\n return v\n}\n"],"names":[],"mappings":"AAAO,MAAM,KAAK,GAAG,CAAC,GAAW,EAAE,GAAW,EAAE,CAAS,KAAI;IACzD,IAAI,CAAC,GAAG,GAAG;AAAE,QAAA,OAAO,GAAG;IACvB,IAAI,CAAC,GAAG,GAAG;AAAE,QAAA,OAAO,GAAG;AACvB,IAAA,OAAO,CAAC;AACZ;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/easing/anticipate.mjs b/node_modules/motion-utils/dist/es/easing/anticipate.mjs new file mode 100644 index 0000000..0367d40 --- /dev/null +++ b/node_modules/motion-utils/dist/es/easing/anticipate.mjs @@ -0,0 +1,10 @@ +import { backIn } from './back.mjs'; + +const anticipate = (p) => p >= 1 + ? 1 + : (p *= 2) < 1 + ? 0.5 * backIn(p) + : 0.5 * (2 - Math.pow(2, -10 * (p - 1))); + +export { anticipate }; +//# sourceMappingURL=anticipate.mjs.map diff --git a/node_modules/motion-utils/dist/es/easing/anticipate.mjs.map b/node_modules/motion-utils/dist/es/easing/anticipate.mjs.map new file mode 100644 index 0000000..28a651e --- /dev/null +++ b/node_modules/motion-utils/dist/es/easing/anticipate.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"anticipate.mjs","sources":["../../../src/easing/anticipate.ts"],"sourcesContent":["import { backIn } from \"./back\"\n\nexport const anticipate = (p: number) =>\n p >= 1\n ? 1\n : (p *= 2) < 1\n ? 0.5 * backIn(p)\n : 0.5 * (2 - Math.pow(2, -10 * (p - 1)))\n"],"names":[],"mappings":";;AAEO,MAAM,UAAU,GAAG,CAAC,CAAS,KAChC,CAAC,IAAI;AACD,MAAE;AACF,MAAE,CAAC,CAAC,IAAI,CAAC,IAAI;AACX,UAAE,GAAG,GAAG,MAAM,CAAC,CAAC;UACd,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/easing/back.mjs b/node_modules/motion-utils/dist/es/easing/back.mjs new file mode 100644 index 0000000..7498800 --- /dev/null +++ b/node_modules/motion-utils/dist/es/easing/back.mjs @@ -0,0 +1,10 @@ +import { cubicBezier } from './cubic-bezier.mjs'; +import { mirrorEasing } from './modifiers/mirror.mjs'; +import { reverseEasing } from './modifiers/reverse.mjs'; + +const backOut = /*@__PURE__*/ cubicBezier(0.33, 1.53, 0.69, 0.99); +const backIn = /*@__PURE__*/ reverseEasing(backOut); +const backInOut = /*@__PURE__*/ mirrorEasing(backIn); + +export { backIn, backInOut, backOut }; +//# sourceMappingURL=back.mjs.map diff --git a/node_modules/motion-utils/dist/es/easing/back.mjs.map b/node_modules/motion-utils/dist/es/easing/back.mjs.map new file mode 100644 index 0000000..de464db --- /dev/null +++ b/node_modules/motion-utils/dist/es/easing/back.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"back.mjs","sources":["../../../src/easing/back.ts"],"sourcesContent":["import { cubicBezier } from \"./cubic-bezier\"\nimport { mirrorEasing } from \"./modifiers/mirror\"\nimport { reverseEasing } from \"./modifiers/reverse\"\n\nexport const backOut = /*@__PURE__*/ cubicBezier(0.33, 1.53, 0.69, 0.99)\nexport const backIn = /*@__PURE__*/ reverseEasing(backOut)\nexport const backInOut = /*@__PURE__*/ mirrorEasing(backIn)\n"],"names":[],"mappings":";;;;AAIO,MAAM,OAAO,iBAAiB,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;AAChE,MAAM,MAAM,iBAAiB,aAAa,CAAC,OAAO;AAClD,MAAM,SAAS,iBAAiB,YAAY,CAAC,MAAM;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/easing/circ.mjs b/node_modules/motion-utils/dist/es/easing/circ.mjs new file mode 100644 index 0000000..5e24dc4 --- /dev/null +++ b/node_modules/motion-utils/dist/es/easing/circ.mjs @@ -0,0 +1,9 @@ +import { mirrorEasing } from './modifiers/mirror.mjs'; +import { reverseEasing } from './modifiers/reverse.mjs'; + +const circIn = (p) => 1 - Math.sin(Math.acos(p)); +const circOut = reverseEasing(circIn); +const circInOut = mirrorEasing(circIn); + +export { circIn, circInOut, circOut }; +//# sourceMappingURL=circ.mjs.map diff --git a/node_modules/motion-utils/dist/es/easing/circ.mjs.map b/node_modules/motion-utils/dist/es/easing/circ.mjs.map new file mode 100644 index 0000000..280b467 --- /dev/null +++ b/node_modules/motion-utils/dist/es/easing/circ.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"circ.mjs","sources":["../../../src/easing/circ.ts"],"sourcesContent":["import { mirrorEasing } from \"./modifiers/mirror\"\nimport { reverseEasing } from \"./modifiers/reverse\"\nimport { EasingFunction } from \"./types\"\n\nexport const circIn: EasingFunction = (p) => 1 - Math.sin(Math.acos(p))\nexport const circOut = reverseEasing(circIn)\nexport const circInOut = mirrorEasing(circIn)\n"],"names":[],"mappings":";;;MAIa,MAAM,GAAmB,CAAC,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;MACzD,OAAO,GAAG,aAAa,CAAC,MAAM;MAC9B,SAAS,GAAG,YAAY,CAAC,MAAM;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/easing/cubic-bezier.mjs b/node_modules/motion-utils/dist/es/easing/cubic-bezier.mjs new file mode 100644 index 0000000..4b13a5d --- /dev/null +++ b/node_modules/motion-utils/dist/es/easing/cubic-bezier.mjs @@ -0,0 +1,53 @@ +import { noop } from '../noop.mjs'; + +/* + Bezier function generator + This has been modified from Gaëtan Renaudeau's BezierEasing + https://github.com/gre/bezier-easing/blob/master/src/index.js + https://github.com/gre/bezier-easing/blob/master/LICENSE + + I've removed the newtonRaphsonIterate algo because in benchmarking it + wasn't noticeably faster than binarySubdivision, indeed removing it + usually improved times, depending on the curve. + I also removed the lookup table, as for the added bundle size and loop we're + only cutting ~4 or so subdivision iterations. I bumped the max iterations up + to 12 to compensate and this still tended to be faster for no perceivable + loss in accuracy. + Usage + const easeOut = cubicBezier(.17,.67,.83,.67); + const x = easeOut(0.5); // returns 0.627... +*/ +// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2. +const calcBezier = (t, a1, a2) => (((1.0 - 3.0 * a2 + 3.0 * a1) * t + (3.0 * a2 - 6.0 * a1)) * t + 3.0 * a1) * + t; +const subdivisionPrecision = 0.0000001; +const subdivisionMaxIterations = 12; +function binarySubdivide(x, lowerBound, upperBound, mX1, mX2) { + let currentX; + let currentT; + let i = 0; + do { + currentT = lowerBound + (upperBound - lowerBound) / 2.0; + currentX = calcBezier(currentT, mX1, mX2) - x; + if (currentX > 0.0) { + upperBound = currentT; + } + else { + lowerBound = currentT; + } + } while (Math.abs(currentX) > subdivisionPrecision && + ++i < subdivisionMaxIterations); + return currentT; +} +/*#__NO_SIDE_EFFECTS__*/ +function cubicBezier(mX1, mY1, mX2, mY2) { + // If this is a linear gradient, return linear easing + if (mX1 === mY1 && mX2 === mY2) + return noop; + const getTForX = (aX) => binarySubdivide(aX, 0, 1, mX1, mX2); + // If animation is at start/end, return t without easing + return (t) => t === 0 || t === 1 ? t : calcBezier(getTForX(t), mY1, mY2); +} + +export { cubicBezier }; +//# sourceMappingURL=cubic-bezier.mjs.map diff --git a/node_modules/motion-utils/dist/es/easing/cubic-bezier.mjs.map b/node_modules/motion-utils/dist/es/easing/cubic-bezier.mjs.map new file mode 100644 index 0000000..711fe2e --- /dev/null +++ b/node_modules/motion-utils/dist/es/easing/cubic-bezier.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"cubic-bezier.mjs","sources":["../../../src/easing/cubic-bezier.ts"],"sourcesContent":["/*\n Bezier function generator\n This has been modified from Gaëtan Renaudeau's BezierEasing\n https://github.com/gre/bezier-easing/blob/master/src/index.js\n https://github.com/gre/bezier-easing/blob/master/LICENSE\n \n I've removed the newtonRaphsonIterate algo because in benchmarking it\n wasn't noticeably faster than binarySubdivision, indeed removing it\n usually improved times, depending on the curve.\n I also removed the lookup table, as for the added bundle size and loop we're\n only cutting ~4 or so subdivision iterations. I bumped the max iterations up\n to 12 to compensate and this still tended to be faster for no perceivable\n loss in accuracy.\n Usage\n const easeOut = cubicBezier(.17,.67,.83,.67);\n const x = easeOut(0.5); // returns 0.627...\n*/\n\nimport { noop } from \"../noop\"\n\n// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.\nconst calcBezier = (t: number, a1: number, a2: number) =>\n (((1.0 - 3.0 * a2 + 3.0 * a1) * t + (3.0 * a2 - 6.0 * a1)) * t + 3.0 * a1) *\n t\n\nconst subdivisionPrecision = 0.0000001\nconst subdivisionMaxIterations = 12\n\nfunction binarySubdivide(\n x: number,\n lowerBound: number,\n upperBound: number,\n mX1: number,\n mX2: number\n) {\n let currentX: number\n let currentT: number\n let i: number = 0\n\n do {\n currentT = lowerBound + (upperBound - lowerBound) / 2.0\n currentX = calcBezier(currentT, mX1, mX2) - x\n if (currentX > 0.0) {\n upperBound = currentT\n } else {\n lowerBound = currentT\n }\n } while (\n Math.abs(currentX) > subdivisionPrecision &&\n ++i < subdivisionMaxIterations\n )\n\n return currentT\n}\n\n/*#__NO_SIDE_EFFECTS__*/\nexport function cubicBezier(\n mX1: number,\n mY1: number,\n mX2: number,\n mY2: number\n) {\n // If this is a linear gradient, return linear easing\n if (mX1 === mY1 && mX2 === mY2) return noop\n\n const getTForX = (aX: number) => binarySubdivide(aX, 0, 1, mX1, mX2)\n\n // If animation is at start/end, return t without easing\n return (t: number) =>\n t === 0 || t === 1 ? t : calcBezier(getTForX(t), mY1, mY2)\n}\n"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;;;AAgBE;AAIF;AACA,MAAM,UAAU,GAAG,CAAC,CAAS,EAAE,EAAU,EAAE,EAAU,KACjD,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,GAAG,EAAE,GAAG,GAAG,GAAG,EAAE,IAAI,CAAC,IAAI,GAAG,GAAG,EAAE,GAAG,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,GAAG,GAAG,EAAE;AACzE,IAAA,CAAC;AAEL,MAAM,oBAAoB,GAAG,SAAS;AACtC,MAAM,wBAAwB,GAAG,EAAE;AAEnC,SAAS,eAAe,CACpB,CAAS,EACT,UAAkB,EAClB,UAAkB,EAClB,GAAW,EACX,GAAW,EAAA;AAEX,IAAA,IAAI,QAAgB;AACpB,IAAA,IAAI,QAAgB;IACpB,IAAI,CAAC,GAAW,CAAC;AAEjB,IAAA,GAAG;QACC,QAAQ,GAAG,UAAU,GAAG,CAAC,UAAU,GAAG,UAAU,IAAI,GAAG;QACvD,QAAQ,GAAG,UAAU,CAAC,QAAQ,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,CAAC;AAC7C,QAAA,IAAI,QAAQ,GAAG,GAAG,EAAE;YAChB,UAAU,GAAG,QAAQ;QACzB;aAAO;YACH,UAAU,GAAG,QAAQ;QACzB;IACJ,CAAC,QACG,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,oBAAoB;QACzC,EAAE,CAAC,GAAG,wBAAwB;AAGlC,IAAA,OAAO,QAAQ;AACnB;AAEA;AACM,SAAU,WAAW,CACvB,GAAW,EACX,GAAW,EACX,GAAW,EACX,GAAW,EAAA;;AAGX,IAAA,IAAI,GAAG,KAAK,GAAG,IAAI,GAAG,KAAK,GAAG;AAAE,QAAA,OAAO,IAAI;AAE3C,IAAA,MAAM,QAAQ,GAAG,CAAC,EAAU,KAAK,eAAe,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC;;AAGpE,IAAA,OAAO,CAAC,CAAS,KACb,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC;AAClE;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/easing/ease.mjs b/node_modules/motion-utils/dist/es/easing/ease.mjs new file mode 100644 index 0000000..10cabac --- /dev/null +++ b/node_modules/motion-utils/dist/es/easing/ease.mjs @@ -0,0 +1,8 @@ +import { cubicBezier } from './cubic-bezier.mjs'; + +const easeIn = /*@__PURE__*/ cubicBezier(0.42, 0, 1, 1); +const easeOut = /*@__PURE__*/ cubicBezier(0, 0, 0.58, 1); +const easeInOut = /*@__PURE__*/ cubicBezier(0.42, 0, 0.58, 1); + +export { easeIn, easeInOut, easeOut }; +//# sourceMappingURL=ease.mjs.map diff --git a/node_modules/motion-utils/dist/es/easing/ease.mjs.map b/node_modules/motion-utils/dist/es/easing/ease.mjs.map new file mode 100644 index 0000000..cb24bf3 --- /dev/null +++ b/node_modules/motion-utils/dist/es/easing/ease.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"ease.mjs","sources":["../../../src/easing/ease.ts"],"sourcesContent":["import { cubicBezier } from \"./cubic-bezier\"\n\nexport const easeIn = /*@__PURE__*/ cubicBezier(0.42, 0, 1, 1)\nexport const easeOut = /*@__PURE__*/ cubicBezier(0, 0, 0.58, 1)\nexport const easeInOut = /*@__PURE__*/ cubicBezier(0.42, 0, 0.58, 1)\n"],"names":[],"mappings":";;AAEO,MAAM,MAAM,iBAAiB,WAAW,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;AACtD,MAAM,OAAO,iBAAiB,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC;AACvD,MAAM,SAAS,iBAAiB,WAAW,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/easing/modifiers/mirror.mjs b/node_modules/motion-utils/dist/es/easing/modifiers/mirror.mjs new file mode 100644 index 0000000..1ed7de1 --- /dev/null +++ b/node_modules/motion-utils/dist/es/easing/modifiers/mirror.mjs @@ -0,0 +1,7 @@ +// Accepts an easing function and returns a new one that outputs mirrored values for +// the second half of the animation. Turns easeIn into easeInOut. +/*#__NO_SIDE_EFFECTS__*/ +const mirrorEasing = (easing) => (p) => p <= 0.5 ? easing(2 * p) / 2 : (2 - easing(2 * (1 - p))) / 2; + +export { mirrorEasing }; +//# sourceMappingURL=mirror.mjs.map diff --git a/node_modules/motion-utils/dist/es/easing/modifiers/mirror.mjs.map b/node_modules/motion-utils/dist/es/easing/modifiers/mirror.mjs.map new file mode 100644 index 0000000..a6b594d --- /dev/null +++ b/node_modules/motion-utils/dist/es/easing/modifiers/mirror.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"mirror.mjs","sources":["../../../../src/easing/modifiers/mirror.ts"],"sourcesContent":["// Accepts an easing function and returns a new one that outputs mirrored values for\n\nimport { EasingModifier } from \"../types\"\n\n// the second half of the animation. Turns easeIn into easeInOut.\n/*#__NO_SIDE_EFFECTS__*/\nexport const mirrorEasing: EasingModifier = (easing) => (p) =>\n p <= 0.5 ? easing(2 * p) / 2 : (2 - easing(2 * (1 - p))) / 2\n"],"names":[],"mappings":"AAAA;AAIA;AACA;MACa,YAAY,GAAmB,CAAC,MAAM,KAAK,CAAC,CAAC,KACtD,CAAC,IAAI,GAAG,GAAG,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/easing/modifiers/reverse.mjs b/node_modules/motion-utils/dist/es/easing/modifiers/reverse.mjs new file mode 100644 index 0000000..3a6d942 --- /dev/null +++ b/node_modules/motion-utils/dist/es/easing/modifiers/reverse.mjs @@ -0,0 +1,7 @@ +// Accepts an easing function and returns a new one that outputs reversed values. +// Turns easeIn into easeOut. +/*#__NO_SIDE_EFFECTS__*/ +const reverseEasing = (easing) => (p) => 1 - easing(1 - p); + +export { reverseEasing }; +//# sourceMappingURL=reverse.mjs.map diff --git a/node_modules/motion-utils/dist/es/easing/modifiers/reverse.mjs.map b/node_modules/motion-utils/dist/es/easing/modifiers/reverse.mjs.map new file mode 100644 index 0000000..613d1de --- /dev/null +++ b/node_modules/motion-utils/dist/es/easing/modifiers/reverse.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"reverse.mjs","sources":["../../../../src/easing/modifiers/reverse.ts"],"sourcesContent":["// Accepts an easing function and returns a new one that outputs reversed values.\n\nimport { EasingModifier } from \"../types\"\n\n// Turns easeIn into easeOut.\n/*#__NO_SIDE_EFFECTS__*/\nexport const reverseEasing: EasingModifier = (easing) => (p) =>\n 1 - easing(1 - p)\n"],"names":[],"mappings":"AAAA;AAIA;AACA;MACa,aAAa,GAAmB,CAAC,MAAM,KAAK,CAAC,CAAC,KACvD,CAAC,GAAG,MAAM,CAAC,CAAC,GAAG,CAAC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/easing/steps.mjs b/node_modules/motion-utils/dist/es/easing/steps.mjs new file mode 100644 index 0000000..3e3961c --- /dev/null +++ b/node_modules/motion-utils/dist/es/easing/steps.mjs @@ -0,0 +1,17 @@ +import { clamp } from '../clamp.mjs'; + +/*#__NO_SIDE_EFFECTS__*/ +function steps(numSteps, direction = "end") { + return (progress) => { + progress = + direction === "end" + ? Math.min(progress, 0.999) + : Math.max(progress, 0.001); + const expanded = progress * numSteps; + const rounded = direction === "end" ? Math.floor(expanded) : Math.ceil(expanded); + return clamp(0, 1, rounded / numSteps); + }; +} + +export { steps }; +//# sourceMappingURL=steps.mjs.map diff --git a/node_modules/motion-utils/dist/es/easing/steps.mjs.map b/node_modules/motion-utils/dist/es/easing/steps.mjs.map new file mode 100644 index 0000000..1beaa69 --- /dev/null +++ b/node_modules/motion-utils/dist/es/easing/steps.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"steps.mjs","sources":["../../../src/easing/steps.ts"],"sourcesContent":["import { clamp } from \"../clamp\"\nimport type { EasingFunction } from \"./types\"\n\n/*\n Create stepped version of 0-1 progress\n\n @param [int]: Number of steps\n @param [number]: Current value\n @return [number]: Stepped value\n*/\nexport type Direction = \"start\" | \"end\"\n\n/*#__NO_SIDE_EFFECTS__*/\nexport function steps(\n numSteps: number,\n direction: Direction = \"end\"\n): EasingFunction {\n return (progress: number) => {\n progress =\n direction === \"end\"\n ? Math.min(progress, 0.999)\n : Math.max(progress, 0.001)\n const expanded = progress * numSteps\n const rounded =\n direction === \"end\" ? Math.floor(expanded) : Math.ceil(expanded)\n\n return clamp(0, 1, rounded / numSteps)\n }\n}\n"],"names":[],"mappings":";;AAYA;SACgB,KAAK,CACjB,QAAgB,EAChB,YAAuB,KAAK,EAAA;IAE5B,OAAO,CAAC,QAAgB,KAAI;QACxB,QAAQ;AACJ,YAAA,SAAS,KAAK;kBACR,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK;kBACxB,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAC;AACnC,QAAA,MAAM,QAAQ,GAAG,QAAQ,GAAG,QAAQ;QACpC,MAAM,OAAO,GACT,SAAS,KAAK,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;QAEpE,OAAO,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;AAC1C,IAAA,CAAC;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/easing/utils/get-easing-for-segment.mjs b/node_modules/motion-utils/dist/es/easing/utils/get-easing-for-segment.mjs new file mode 100644 index 0000000..79a8519 --- /dev/null +++ b/node_modules/motion-utils/dist/es/easing/utils/get-easing-for-segment.mjs @@ -0,0 +1,10 @@ +import { wrap } from '../../wrap.mjs'; +import { isEasingArray } from './is-easing-array.mjs'; + +/*#__NO_SIDE_EFFECTS__*/ +function getEasingForSegment(easing, i) { + return isEasingArray(easing) ? easing[wrap(0, easing.length, i)] : easing; +} + +export { getEasingForSegment }; +//# sourceMappingURL=get-easing-for-segment.mjs.map diff --git a/node_modules/motion-utils/dist/es/easing/utils/get-easing-for-segment.mjs.map b/node_modules/motion-utils/dist/es/easing/utils/get-easing-for-segment.mjs.map new file mode 100644 index 0000000..32b3b48 --- /dev/null +++ b/node_modules/motion-utils/dist/es/easing/utils/get-easing-for-segment.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"get-easing-for-segment.mjs","sources":["../../../../src/easing/utils/get-easing-for-segment.ts"],"sourcesContent":["import { wrap } from \"../../wrap\"\nimport { Easing } from \"../types\"\nimport { isEasingArray } from \"./is-easing-array\"\n\n/*#__NO_SIDE_EFFECTS__*/\nexport function getEasingForSegment(\n easing: Easing | Easing[],\n i: number\n): Easing {\n return isEasingArray(easing) ? easing[wrap(0, easing.length, i)] : easing\n}\n"],"names":[],"mappings":";;;AAIA;AACM,SAAU,mBAAmB,CAC/B,MAAyB,EACzB,CAAS,EAAA;IAET,OAAO,aAAa,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,GAAG,MAAM;AAC7E;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/easing/utils/is-bezier-definition.mjs b/node_modules/motion-utils/dist/es/easing/utils/is-bezier-definition.mjs new file mode 100644 index 0000000..1a3c736 --- /dev/null +++ b/node_modules/motion-utils/dist/es/easing/utils/is-bezier-definition.mjs @@ -0,0 +1,5 @@ +/*#__NO_SIDE_EFFECTS__*/ +const isBezierDefinition = (easing) => Array.isArray(easing) && typeof easing[0] === "number"; + +export { isBezierDefinition }; +//# sourceMappingURL=is-bezier-definition.mjs.map diff --git a/node_modules/motion-utils/dist/es/easing/utils/is-bezier-definition.mjs.map b/node_modules/motion-utils/dist/es/easing/utils/is-bezier-definition.mjs.map new file mode 100644 index 0000000..ffbdd27 --- /dev/null +++ b/node_modules/motion-utils/dist/es/easing/utils/is-bezier-definition.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"is-bezier-definition.mjs","sources":["../../../../src/easing/utils/is-bezier-definition.ts"],"sourcesContent":["import { BezierDefinition, Easing } from \"../types\"\n\n/*#__NO_SIDE_EFFECTS__*/\nexport const isBezierDefinition = (\n easing: Easing | Easing[]\n): easing is BezierDefinition =>\n Array.isArray(easing) && typeof easing[0] === \"number\"\n"],"names":[],"mappings":"AAEA;MACa,kBAAkB,GAAG,CAC9B,MAAyB,KAEzB,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,OAAO,MAAM,CAAC,CAAC,CAAC,KAAK;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/easing/utils/is-easing-array.mjs b/node_modules/motion-utils/dist/es/easing/utils/is-easing-array.mjs new file mode 100644 index 0000000..6b01de0 --- /dev/null +++ b/node_modules/motion-utils/dist/es/easing/utils/is-easing-array.mjs @@ -0,0 +1,7 @@ +/*#__NO_SIDE_EFFECTS__*/ +const isEasingArray = (ease) => { + return Array.isArray(ease) && typeof ease[0] !== "number"; +}; + +export { isEasingArray }; +//# sourceMappingURL=is-easing-array.mjs.map diff --git a/node_modules/motion-utils/dist/es/easing/utils/is-easing-array.mjs.map b/node_modules/motion-utils/dist/es/easing/utils/is-easing-array.mjs.map new file mode 100644 index 0000000..4fd993d --- /dev/null +++ b/node_modules/motion-utils/dist/es/easing/utils/is-easing-array.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"is-easing-array.mjs","sources":["../../../../src/easing/utils/is-easing-array.ts"],"sourcesContent":["import { Easing } from \"../types\"\n\n/*#__NO_SIDE_EFFECTS__*/\nexport const isEasingArray = (ease: any): ease is Easing[] => {\n return Array.isArray(ease) && typeof ease[0] !== \"number\"\n}\n"],"names":[],"mappings":"AAEA;AACO,MAAM,aAAa,GAAG,CAAC,IAAS,KAAsB;AACzD,IAAA,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,OAAO,IAAI,CAAC,CAAC,CAAC,KAAK,QAAQ;AAC7D;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/easing/utils/map.mjs b/node_modules/motion-utils/dist/es/easing/utils/map.mjs new file mode 100644 index 0000000..83b042d --- /dev/null +++ b/node_modules/motion-utils/dist/es/easing/utils/map.mjs @@ -0,0 +1,42 @@ +import { invariant } from '../../errors.mjs'; +import { noop } from '../../noop.mjs'; +import { anticipate } from '../anticipate.mjs'; +import { backOut, backInOut, backIn } from '../back.mjs'; +import { circOut, circInOut, circIn } from '../circ.mjs'; +import { cubicBezier } from '../cubic-bezier.mjs'; +import { easeOut, easeInOut, easeIn } from '../ease.mjs'; +import { isBezierDefinition } from './is-bezier-definition.mjs'; + +const easingLookup = { + linear: noop, + easeIn, + easeInOut, + easeOut, + circIn, + circInOut, + circOut, + backIn, + backInOut, + backOut, + anticipate, +}; +const isValidEasing = (easing) => { + return typeof easing === "string"; +}; +const easingDefinitionToFunction = (definition) => { + if (isBezierDefinition(definition)) { + // If cubic bezier definition, create bezier curve + invariant(definition.length === 4, `Cubic bezier arrays must contain four numerical values.`, "cubic-bezier-length"); + const [x1, y1, x2, y2] = definition; + return cubicBezier(x1, y1, x2, y2); + } + else if (isValidEasing(definition)) { + // Else lookup from table + invariant(easingLookup[definition] !== undefined, `Invalid easing type '${definition}'`, "invalid-easing-type"); + return easingLookup[definition]; + } + return definition; +}; + +export { easingDefinitionToFunction }; +//# sourceMappingURL=map.mjs.map diff --git a/node_modules/motion-utils/dist/es/easing/utils/map.mjs.map b/node_modules/motion-utils/dist/es/easing/utils/map.mjs.map new file mode 100644 index 0000000..c9d19ff --- /dev/null +++ b/node_modules/motion-utils/dist/es/easing/utils/map.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"map.mjs","sources":["../../../../src/easing/utils/map.ts"],"sourcesContent":["import { invariant } from \"../../errors\"\nimport { noop } from \"../../noop\"\nimport { anticipate } from \"../anticipate\"\nimport { backIn, backInOut, backOut } from \"../back\"\nimport { circIn, circInOut, circOut } from \"../circ\"\nimport { cubicBezier } from \"../cubic-bezier\"\nimport { easeIn, easeInOut, easeOut } from \"../ease\"\nimport { Easing, EasingFunction } from \"../types\"\nimport { isBezierDefinition } from \"./is-bezier-definition\"\n\nconst easingLookup = {\n linear: noop,\n easeIn,\n easeInOut,\n easeOut,\n circIn,\n circInOut,\n circOut,\n backIn,\n backInOut,\n backOut,\n anticipate,\n}\n\nconst isValidEasing = (easing: Easing): easing is keyof typeof easingLookup => {\n return typeof easing === \"string\"\n}\n\nexport const easingDefinitionToFunction = (\n definition: Easing\n): EasingFunction => {\n if (isBezierDefinition(definition)) {\n // If cubic bezier definition, create bezier curve\n invariant(\n definition.length === 4,\n `Cubic bezier arrays must contain four numerical values.`,\n \"cubic-bezier-length\"\n )\n\n const [x1, y1, x2, y2] = definition\n return cubicBezier(x1, y1, x2, y2)\n } else if (isValidEasing(definition)) {\n // Else lookup from table\n invariant(\n easingLookup[definition] !== undefined,\n `Invalid easing type '${definition}'`,\n \"invalid-easing-type\"\n )\n return easingLookup[definition]\n }\n\n return definition\n}\n"],"names":[],"mappings":";;;;;;;;;AAUA,MAAM,YAAY,GAAG;AACjB,IAAA,MAAM,EAAE,IAAI;IACZ,MAAM;IACN,SAAS;IACT,OAAO;IACP,MAAM;IACN,SAAS;IACT,OAAO;IACP,MAAM;IACN,SAAS;IACT,OAAO;IACP,UAAU;CACb;AAED,MAAM,aAAa,GAAG,CAAC,MAAc,KAAyC;AAC1E,IAAA,OAAO,OAAO,MAAM,KAAK,QAAQ;AACrC,CAAC;AAEM,MAAM,0BAA0B,GAAG,CACtC,UAAkB,KACF;AAChB,IAAA,IAAI,kBAAkB,CAAC,UAAU,CAAC,EAAE;;QAEhC,SAAS,CACL,UAAU,CAAC,MAAM,KAAK,CAAC,EACvB,CAAA,uDAAA,CAAyD,EACzD,qBAAqB,CACxB;QAED,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,GAAG,UAAU;QACnC,OAAO,WAAW,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC;IACtC;AAAO,SAAA,IAAI,aAAa,CAAC,UAAU,CAAC,EAAE;;AAElC,QAAA,SAAS,CACL,YAAY,CAAC,UAAU,CAAC,KAAK,SAAS,EACtC,CAAA,qBAAA,EAAwB,UAAU,CAAA,CAAA,CAAG,EACrC,qBAAqB,CACxB;AACD,QAAA,OAAO,YAAY,CAAC,UAAU,CAAC;IACnC;AAEA,IAAA,OAAO,UAAU;AACrB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/errors.mjs b/node_modules/motion-utils/dist/es/errors.mjs new file mode 100644 index 0000000..851adc9 --- /dev/null +++ b/node_modules/motion-utils/dist/es/errors.mjs @@ -0,0 +1,20 @@ +import { formatErrorMessage } from './format-error-message.mjs'; + +let warning = () => { }; +let invariant = () => { }; +if (typeof process !== "undefined" && + process.env?.NODE_ENV !== "production") { + warning = (check, message, errorCode) => { + if (!check && typeof console !== "undefined") { + console.warn(formatErrorMessage(message, errorCode)); + } + }; + invariant = (check, message, errorCode) => { + if (!check) { + throw new Error(formatErrorMessage(message, errorCode)); + } + }; +} + +export { invariant, warning }; +//# sourceMappingURL=errors.mjs.map diff --git a/node_modules/motion-utils/dist/es/errors.mjs.map b/node_modules/motion-utils/dist/es/errors.mjs.map new file mode 100644 index 0000000..837d6ef --- /dev/null +++ b/node_modules/motion-utils/dist/es/errors.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"errors.mjs","sources":["../../src/errors.ts"],"sourcesContent":["import { formatErrorMessage } from \"./format-error-message\"\n\nexport type DevMessage = (\n check: boolean,\n message: string,\n errorCode?: string\n) => void\n\nlet warning: DevMessage = () => {}\nlet invariant: DevMessage = () => {}\n\nif (\n typeof process !== \"undefined\" &&\n process.env?.NODE_ENV !== \"production\"\n) {\n warning = (check, message, errorCode) => {\n if (!check && typeof console !== \"undefined\") {\n console.warn(formatErrorMessage(message, errorCode))\n }\n }\n\n invariant = (check, message, errorCode) => {\n if (!check) {\n throw new Error(formatErrorMessage(message, errorCode))\n }\n }\n}\n\nexport { invariant, warning }\n"],"names":[],"mappings":";;AAQA,IAAI,OAAO,GAAe,MAAK,EAAE;AACjC,IAAI,SAAS,GAAe,MAAK,EAAE;AAEnC,IACI,OAAO,OAAO,KAAK,WAAW;AAC9B,IAAA,OAAO,CAAC,GAAG,EAAE,QAAQ,KAAK,YAAY,EACxC;IACE,OAAO,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,SAAS,KAAI;QACpC,IAAI,CAAC,KAAK,IAAI,OAAO,OAAO,KAAK,WAAW,EAAE;YAC1C,OAAO,CAAC,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;QACxD;AACJ,IAAA,CAAC;IAED,SAAS,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,SAAS,KAAI;QACtC,IAAI,CAAC,KAAK,EAAE;YACR,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;QAC3D;AACJ,IAAA,CAAC;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/format-error-message.mjs b/node_modules/motion-utils/dist/es/format-error-message.mjs new file mode 100644 index 0000000..dee97cc --- /dev/null +++ b/node_modules/motion-utils/dist/es/format-error-message.mjs @@ -0,0 +1,8 @@ +function formatErrorMessage(message, errorCode) { + return errorCode + ? `${message}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${errorCode}` + : message; +} + +export { formatErrorMessage }; +//# sourceMappingURL=format-error-message.mjs.map diff --git a/node_modules/motion-utils/dist/es/format-error-message.mjs.map b/node_modules/motion-utils/dist/es/format-error-message.mjs.map new file mode 100644 index 0000000..d2ce8ba --- /dev/null +++ b/node_modules/motion-utils/dist/es/format-error-message.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"format-error-message.mjs","sources":["../../src/format-error-message.ts"],"sourcesContent":["export function formatErrorMessage(message: string, errorCode?: string) {\n return errorCode\n ? `${message}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${errorCode}`\n : message\n}\n"],"names":[],"mappings":"AAAM,SAAU,kBAAkB,CAAC,OAAe,EAAE,SAAkB,EAAA;AAClE,IAAA,OAAO;AACH,UAAE,CAAA,EAAG,OAAO,CAAA,uFAAA,EAA0F,SAAS,CAAA;UAC7G,OAAO;AACjB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/global-config.mjs b/node_modules/motion-utils/dist/es/global-config.mjs new file mode 100644 index 0000000..66ed577 --- /dev/null +++ b/node_modules/motion-utils/dist/es/global-config.mjs @@ -0,0 +1,4 @@ +const MotionGlobalConfig = {}; + +export { MotionGlobalConfig }; +//# sourceMappingURL=global-config.mjs.map diff --git a/node_modules/motion-utils/dist/es/global-config.mjs.map b/node_modules/motion-utils/dist/es/global-config.mjs.map new file mode 100644 index 0000000..664cd85 --- /dev/null +++ b/node_modules/motion-utils/dist/es/global-config.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"global-config.mjs","sources":["../../src/global-config.ts"],"sourcesContent":["export const MotionGlobalConfig: {\n skipAnimations?: boolean\n instantAnimations?: boolean\n useManualTiming?: boolean\n WillChange?: any\n mix?: (a: T, b: T) => (p: number) => T\n} = {}\n"],"names":[],"mappings":"AAAO,MAAM,kBAAkB,GAM3B;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/index.mjs b/node_modules/motion-utils/dist/es/index.mjs new file mode 100644 index 0000000..2f07b9a --- /dev/null +++ b/node_modules/motion-utils/dist/es/index.mjs @@ -0,0 +1,29 @@ +export { addUniqueItem, moveItem, removeItem } from './array.mjs'; +export { clamp } from './clamp.mjs'; +export { invariant, warning } from './errors.mjs'; +export { MotionGlobalConfig } from './global-config.mjs'; +export { isNumericalString } from './is-numerical-string.mjs'; +export { isObject } from './is-object.mjs'; +export { isZeroValueString } from './is-zero-value-string.mjs'; +export { memo } from './memo.mjs'; +export { noop } from './noop.mjs'; +export { pipe } from './pipe.mjs'; +export { progress } from './progress.mjs'; +export { SubscriptionManager } from './subscription-manager.mjs'; +export { millisecondsToSeconds, secondsToMilliseconds } from './time-conversion.mjs'; +export { velocityPerSecond } from './velocity-per-second.mjs'; +export { hasWarned, warnOnce } from './warn-once.mjs'; +export { wrap } from './wrap.mjs'; +export { anticipate } from './easing/anticipate.mjs'; +export { backIn, backInOut, backOut } from './easing/back.mjs'; +export { circIn, circInOut, circOut } from './easing/circ.mjs'; +export { cubicBezier } from './easing/cubic-bezier.mjs'; +export { easeIn, easeInOut, easeOut } from './easing/ease.mjs'; +export { mirrorEasing } from './easing/modifiers/mirror.mjs'; +export { reverseEasing } from './easing/modifiers/reverse.mjs'; +export { steps } from './easing/steps.mjs'; +export { getEasingForSegment } from './easing/utils/get-easing-for-segment.mjs'; +export { isBezierDefinition } from './easing/utils/is-bezier-definition.mjs'; +export { isEasingArray } from './easing/utils/is-easing-array.mjs'; +export { easingDefinitionToFunction } from './easing/utils/map.mjs'; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/motion-utils/dist/es/index.mjs.map b/node_modules/motion-utils/dist/es/index.mjs.map new file mode 100644 index 0000000..9b2660b --- /dev/null +++ b/node_modules/motion-utils/dist/es/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/is-numerical-string.mjs b/node_modules/motion-utils/dist/es/is-numerical-string.mjs new file mode 100644 index 0000000..cb4ce6e --- /dev/null +++ b/node_modules/motion-utils/dist/es/is-numerical-string.mjs @@ -0,0 +1,7 @@ +/** + * Check if value is a numerical string, ie a string that is purely a number eg "100" or "-100.1" + */ +const isNumericalString = (v) => /^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(v); + +export { isNumericalString }; +//# sourceMappingURL=is-numerical-string.mjs.map diff --git a/node_modules/motion-utils/dist/es/is-numerical-string.mjs.map b/node_modules/motion-utils/dist/es/is-numerical-string.mjs.map new file mode 100644 index 0000000..f8a9eae --- /dev/null +++ b/node_modules/motion-utils/dist/es/is-numerical-string.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"is-numerical-string.mjs","sources":["../../src/is-numerical-string.ts"],"sourcesContent":["/**\n * Check if value is a numerical string, ie a string that is purely a number eg \"100\" or \"-100.1\"\n */\nexport const isNumericalString = (v: string) => /^-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)$/u.test(v)\n"],"names":[],"mappings":"AAAA;;AAEG;AACI,MAAM,iBAAiB,GAAG,CAAC,CAAS,KAAK,8BAA8B,CAAC,IAAI,CAAC,CAAC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/is-object.mjs b/node_modules/motion-utils/dist/es/is-object.mjs new file mode 100644 index 0000000..7f9bd3e --- /dev/null +++ b/node_modules/motion-utils/dist/es/is-object.mjs @@ -0,0 +1,4 @@ +const isObject = (value) => typeof value === "object" && value !== null; + +export { isObject }; +//# sourceMappingURL=is-object.mjs.map diff --git a/node_modules/motion-utils/dist/es/is-object.mjs.map b/node_modules/motion-utils/dist/es/is-object.mjs.map new file mode 100644 index 0000000..44b4814 --- /dev/null +++ b/node_modules/motion-utils/dist/es/is-object.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"is-object.mjs","sources":["../../src/is-object.ts"],"sourcesContent":["export const isObject = (value: unknown): value is object =>\n typeof value === \"object\" && value !== null\n"],"names":[],"mappings":"AAAO,MAAM,QAAQ,GAAG,CAAC,KAAc,KACnC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/is-zero-value-string.mjs b/node_modules/motion-utils/dist/es/is-zero-value-string.mjs new file mode 100644 index 0000000..ba89398 --- /dev/null +++ b/node_modules/motion-utils/dist/es/is-zero-value-string.mjs @@ -0,0 +1,7 @@ +/** + * Check if the value is a zero value string like "0px" or "0%" + */ +const isZeroValueString = (v) => /^0[^.\s]+$/u.test(v); + +export { isZeroValueString }; +//# sourceMappingURL=is-zero-value-string.mjs.map diff --git a/node_modules/motion-utils/dist/es/is-zero-value-string.mjs.map b/node_modules/motion-utils/dist/es/is-zero-value-string.mjs.map new file mode 100644 index 0000000..8c7f2af --- /dev/null +++ b/node_modules/motion-utils/dist/es/is-zero-value-string.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"is-zero-value-string.mjs","sources":["../../src/is-zero-value-string.ts"],"sourcesContent":["/**\n * Check if the value is a zero value string like \"0px\" or \"0%\"\n */\nexport const isZeroValueString = (v: string) => /^0[^.\\s]+$/u.test(v)\n"],"names":[],"mappings":"AAAA;;AAEG;AACI,MAAM,iBAAiB,GAAG,CAAC,CAAS,KAAK,aAAa,CAAC,IAAI,CAAC,CAAC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/memo.mjs b/node_modules/motion-utils/dist/es/memo.mjs new file mode 100644 index 0000000..d164ae4 --- /dev/null +++ b/node_modules/motion-utils/dist/es/memo.mjs @@ -0,0 +1,12 @@ +/*#__NO_SIDE_EFFECTS__*/ +function memo(callback) { + let result; + return () => { + if (result === undefined) + result = callback(); + return result; + }; +} + +export { memo }; +//# sourceMappingURL=memo.mjs.map diff --git a/node_modules/motion-utils/dist/es/memo.mjs.map b/node_modules/motion-utils/dist/es/memo.mjs.map new file mode 100644 index 0000000..8b7e888 --- /dev/null +++ b/node_modules/motion-utils/dist/es/memo.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"memo.mjs","sources":["../../src/memo.ts"],"sourcesContent":["/*#__NO_SIDE_EFFECTS__*/\nexport function memo(callback: () => T) {\n let result: T | undefined\n\n return () => {\n if (result === undefined) result = callback()\n return result\n }\n}\n"],"names":[],"mappings":"AAAA;AACM,SAAU,IAAI,CAAgB,QAAiB,EAAA;AACjD,IAAA,IAAI,MAAqB;AAEzB,IAAA,OAAO,MAAK;QACR,IAAI,MAAM,KAAK,SAAS;YAAE,MAAM,GAAG,QAAQ,EAAE;AAC7C,QAAA,OAAO,MAAM;AACjB,IAAA,CAAC;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/noop.mjs b/node_modules/motion-utils/dist/es/noop.mjs new file mode 100644 index 0000000..bd29da3 --- /dev/null +++ b/node_modules/motion-utils/dist/es/noop.mjs @@ -0,0 +1,5 @@ +/*#__NO_SIDE_EFFECTS__*/ +const noop = (any) => any; + +export { noop }; +//# sourceMappingURL=noop.mjs.map diff --git a/node_modules/motion-utils/dist/es/noop.mjs.map b/node_modules/motion-utils/dist/es/noop.mjs.map new file mode 100644 index 0000000..fffdfa8 --- /dev/null +++ b/node_modules/motion-utils/dist/es/noop.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"noop.mjs","sources":["../../src/noop.ts"],"sourcesContent":["/*#__NO_SIDE_EFFECTS__*/\nexport const noop = (any: T): T => any\n"],"names":[],"mappings":"AAAA;AACO,MAAM,IAAI,GAAG,CAAI,GAAM,KAAQ;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/pipe.mjs b/node_modules/motion-utils/dist/es/pipe.mjs new file mode 100644 index 0000000..bd4512c --- /dev/null +++ b/node_modules/motion-utils/dist/es/pipe.mjs @@ -0,0 +1,11 @@ +/** + * Pipe + * Compose other transformers to run linearily + * pipe(min(20), max(40)) + * @param {...functions} transformers + * @return {function} + */ +const pipe = (...transformers) => transformers.reduce((a, b) => (v) => b(a(v))); + +export { pipe }; +//# sourceMappingURL=pipe.mjs.map diff --git a/node_modules/motion-utils/dist/es/pipe.mjs.map b/node_modules/motion-utils/dist/es/pipe.mjs.map new file mode 100644 index 0000000..12dd636 --- /dev/null +++ b/node_modules/motion-utils/dist/es/pipe.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"pipe.mjs","sources":["../../src/pipe.ts"],"sourcesContent":["/**\n * Pipe\n * Compose other transformers to run linearily\n * pipe(min(20), max(40))\n * @param {...functions} transformers\n * @return {function}\n */\nexport const pipe = (...transformers: Function[]) =>\n transformers.reduce((a, b) => (v: any) => b(a(v)))\n"],"names":[],"mappings":"AAAA;;;;;;AAMG;AACI,MAAM,IAAI,GAAG,CAAC,GAAG,YAAwB,KAC5C,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAM,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/progress.mjs b/node_modules/motion-utils/dist/es/progress.mjs new file mode 100644 index 0000000..d964710 --- /dev/null +++ b/node_modules/motion-utils/dist/es/progress.mjs @@ -0,0 +1,15 @@ +/* + Progress within given range + + Given a lower limit and an upper limit, we return the progress + (expressed as a number 0-1) represented by the given value, and + limit that progress to within 0-1. +*/ +/*#__NO_SIDE_EFFECTS__*/ +const progress = (from, to, value) => { + const range = to - from; + return range ? (value - from) / range : 1; +}; + +export { progress }; +//# sourceMappingURL=progress.mjs.map diff --git a/node_modules/motion-utils/dist/es/progress.mjs.map b/node_modules/motion-utils/dist/es/progress.mjs.map new file mode 100644 index 0000000..99c498d --- /dev/null +++ b/node_modules/motion-utils/dist/es/progress.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"progress.mjs","sources":["../../src/progress.ts"],"sourcesContent":["/*\n Progress within given range\n\n Given a lower limit and an upper limit, we return the progress\n (expressed as a number 0-1) represented by the given value, and\n limit that progress to within 0-1.\n*/\n/*#__NO_SIDE_EFFECTS__*/\nexport const progress = (from: number, to: number, value: number) => {\n const range = to - from\n return range ? (value - from) / range : 1\n}\n"],"names":[],"mappings":"AAAA;;;;;;AAME;AACF;AACO,MAAM,QAAQ,GAAG,CAAC,IAAY,EAAE,EAAU,EAAE,KAAa,KAAI;AAChE,IAAA,MAAM,KAAK,GAAG,EAAE,GAAG,IAAI;AACvB,IAAA,OAAO,KAAK,GAAG,CAAC,KAAK,GAAG,IAAI,IAAI,KAAK,GAAG,CAAC;AAC7C;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/subscription-manager.mjs b/node_modules/motion-utils/dist/es/subscription-manager.mjs new file mode 100644 index 0000000..7329b56 --- /dev/null +++ b/node_modules/motion-utils/dist/es/subscription-manager.mjs @@ -0,0 +1,41 @@ +import { addUniqueItem, removeItem } from './array.mjs'; + +class SubscriptionManager { + constructor() { + this.subscriptions = []; + } + add(handler) { + addUniqueItem(this.subscriptions, handler); + return () => removeItem(this.subscriptions, handler); + } + notify(a, b, c) { + const numSubscriptions = this.subscriptions.length; + if (!numSubscriptions) + return; + if (numSubscriptions === 1) { + /** + * If there's only a single handler we can just call it without invoking a loop. + */ + this.subscriptions[0](a, b, c); + } + else { + for (let i = 0; i < numSubscriptions; i++) { + /** + * Check whether the handler exists before firing as it's possible + * the subscriptions were modified during this loop running. + */ + const handler = this.subscriptions[i]; + handler && handler(a, b, c); + } + } + } + getSize() { + return this.subscriptions.length; + } + clear() { + this.subscriptions.length = 0; + } +} + +export { SubscriptionManager }; +//# sourceMappingURL=subscription-manager.mjs.map diff --git a/node_modules/motion-utils/dist/es/subscription-manager.mjs.map b/node_modules/motion-utils/dist/es/subscription-manager.mjs.map new file mode 100644 index 0000000..8a2a74d --- /dev/null +++ b/node_modules/motion-utils/dist/es/subscription-manager.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"subscription-manager.mjs","sources":["../../src/subscription-manager.ts"],"sourcesContent":["import { addUniqueItem, removeItem } from \"./array\"\n\ntype GenericHandler = (...args: any) => void\n\nexport class SubscriptionManager {\n private subscriptions: Handler[] = []\n\n add(handler: Handler): VoidFunction {\n addUniqueItem(this.subscriptions, handler)\n return () => removeItem(this.subscriptions, handler)\n }\n\n notify(\n a?: Parameters[0],\n b?: Parameters[1],\n c?: Parameters[2]\n ) {\n const numSubscriptions = this.subscriptions.length\n\n if (!numSubscriptions) return\n\n if (numSubscriptions === 1) {\n /**\n * If there's only a single handler we can just call it without invoking a loop.\n */\n this.subscriptions[0](a, b, c)\n } else {\n for (let i = 0; i < numSubscriptions; i++) {\n /**\n * Check whether the handler exists before firing as it's possible\n * the subscriptions were modified during this loop running.\n */\n const handler = this.subscriptions[i]\n handler && handler(a, b, c)\n }\n }\n }\n\n getSize() {\n return this.subscriptions.length\n }\n\n clear() {\n this.subscriptions.length = 0\n }\n}\n"],"names":[],"mappings":";;MAIa,mBAAmB,CAAA;AAAhC,IAAA,WAAA,GAAA;QACY,IAAA,CAAA,aAAa,GAAc,EAAE;IAwCzC;AAtCI,IAAA,GAAG,CAAC,OAAgB,EAAA;AAChB,QAAA,aAAa,CAAC,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC;QAC1C,OAAO,MAAM,UAAU,CAAC,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC;IACxD;AAEA,IAAA,MAAM,CACF,CAA0B,EAC1B,CAA0B,EAC1B,CAA0B,EAAA;AAE1B,QAAA,MAAM,gBAAgB,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM;AAElD,QAAA,IAAI,CAAC,gBAAgB;YAAE;AAEvB,QAAA,IAAI,gBAAgB,KAAK,CAAC,EAAE;AACxB;;AAEG;AACH,YAAA,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;QAClC;aAAO;AACH,YAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,gBAAgB,EAAE,CAAC,EAAE,EAAE;AACvC;;;AAGG;gBACH,MAAM,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC;gBACrC,OAAO,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;YAC/B;QACJ;IACJ;IAEA,OAAO,GAAA;AACH,QAAA,OAAO,IAAI,CAAC,aAAa,CAAC,MAAM;IACpC;IAEA,KAAK,GAAA;AACD,QAAA,IAAI,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC;IACjC;AACH;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/time-conversion.mjs b/node_modules/motion-utils/dist/es/time-conversion.mjs new file mode 100644 index 0000000..f770399 --- /dev/null +++ b/node_modules/motion-utils/dist/es/time-conversion.mjs @@ -0,0 +1,13 @@ +/** + * Converts seconds to milliseconds + * + * @param seconds - Time in seconds. + * @return milliseconds - Converted time in milliseconds. + */ +/*#__NO_SIDE_EFFECTS__*/ +const secondsToMilliseconds = (seconds) => seconds * 1000; +/*#__NO_SIDE_EFFECTS__*/ +const millisecondsToSeconds = (milliseconds) => milliseconds / 1000; + +export { millisecondsToSeconds, secondsToMilliseconds }; +//# sourceMappingURL=time-conversion.mjs.map diff --git a/node_modules/motion-utils/dist/es/time-conversion.mjs.map b/node_modules/motion-utils/dist/es/time-conversion.mjs.map new file mode 100644 index 0000000..3b40c54 --- /dev/null +++ b/node_modules/motion-utils/dist/es/time-conversion.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"time-conversion.mjs","sources":["../../src/time-conversion.ts"],"sourcesContent":["/**\n * Converts seconds to milliseconds\n *\n * @param seconds - Time in seconds.\n * @return milliseconds - Converted time in milliseconds.\n */\n\n/*#__NO_SIDE_EFFECTS__*/\nexport const secondsToMilliseconds = (seconds: number) => seconds * 1000\n\n/*#__NO_SIDE_EFFECTS__*/\nexport const millisecondsToSeconds = (milliseconds: number) =>\n milliseconds / 1000\n"],"names":[],"mappings":"AAAA;;;;;AAKG;AAEH;AACO,MAAM,qBAAqB,GAAG,CAAC,OAAe,KAAK,OAAO,GAAG;AAEpE;AACO,MAAM,qBAAqB,GAAG,CAAC,YAAoB,KACtD,YAAY,GAAG;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/velocity-per-second.mjs b/node_modules/motion-utils/dist/es/velocity-per-second.mjs new file mode 100644 index 0000000..6fc328a --- /dev/null +++ b/node_modules/motion-utils/dist/es/velocity-per-second.mjs @@ -0,0 +1,8 @@ +/* + Convert velocity into velocity per second +*/ +/*#__NO_SIDE_EFFECTS__*/ +const velocityPerSecond = (velocity, frameDuration) => frameDuration ? velocity * (1000 / frameDuration) : 0; + +export { velocityPerSecond }; +//# sourceMappingURL=velocity-per-second.mjs.map diff --git a/node_modules/motion-utils/dist/es/velocity-per-second.mjs.map b/node_modules/motion-utils/dist/es/velocity-per-second.mjs.map new file mode 100644 index 0000000..d1a94d7 --- /dev/null +++ b/node_modules/motion-utils/dist/es/velocity-per-second.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"velocity-per-second.mjs","sources":["../../src/velocity-per-second.ts"],"sourcesContent":["/*\n Convert velocity into velocity per second\n*/\n/*#__NO_SIDE_EFFECTS__*/\nexport const velocityPerSecond = (velocity: number, frameDuration: number) =>\n frameDuration ? velocity * (1000 / frameDuration) : 0\n"],"names":[],"mappings":"AAAA;;AAEE;AACF;AACO,MAAM,iBAAiB,GAAG,CAAC,QAAgB,EAAE,aAAqB,KACrE,aAAa,GAAG,QAAQ,IAAI,IAAI,GAAG,aAAa,CAAC,GAAG;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/warn-once.mjs b/node_modules/motion-utils/dist/es/warn-once.mjs new file mode 100644 index 0000000..8d68e96 --- /dev/null +++ b/node_modules/motion-utils/dist/es/warn-once.mjs @@ -0,0 +1,15 @@ +import { formatErrorMessage } from './format-error-message.mjs'; + +const warned = new Set(); +function hasWarned(message) { + return warned.has(message); +} +function warnOnce(condition, message, errorCode) { + if (condition || warned.has(message)) + return; + console.warn(formatErrorMessage(message, errorCode)); + warned.add(message); +} + +export { hasWarned, warnOnce }; +//# sourceMappingURL=warn-once.mjs.map diff --git a/node_modules/motion-utils/dist/es/warn-once.mjs.map b/node_modules/motion-utils/dist/es/warn-once.mjs.map new file mode 100644 index 0000000..6c6b6f7 --- /dev/null +++ b/node_modules/motion-utils/dist/es/warn-once.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"warn-once.mjs","sources":["../../src/warn-once.ts"],"sourcesContent":["import { formatErrorMessage } from \"./format-error-message\"\n\nconst warned = new Set()\n\nexport function hasWarned(message: string) {\n return warned.has(message)\n}\n\nexport function warnOnce(\n condition: boolean,\n message: string,\n errorCode?: string\n) {\n if (condition || warned.has(message)) return\n\n console.warn(formatErrorMessage(message, errorCode))\n warned.add(message)\n}\n"],"names":[],"mappings":";;AAEA,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU;AAE1B,SAAU,SAAS,CAAC,OAAe,EAAA;AACrC,IAAA,OAAO,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC;AAC9B;SAEgB,QAAQ,CACpB,SAAkB,EAClB,OAAe,EACf,SAAkB,EAAA;AAElB,IAAA,IAAI,SAAS,IAAI,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC;QAAE;IAEtC,OAAO,CAAC,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;AACpD,IAAA,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC;AACvB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/wrap.mjs b/node_modules/motion-utils/dist/es/wrap.mjs new file mode 100644 index 0000000..5fc9fba --- /dev/null +++ b/node_modules/motion-utils/dist/es/wrap.mjs @@ -0,0 +1,7 @@ +const wrap = (min, max, v) => { + const rangeSize = max - min; + return ((((v - min) % rangeSize) + rangeSize) % rangeSize) + min; +}; + +export { wrap }; +//# sourceMappingURL=wrap.mjs.map diff --git a/node_modules/motion-utils/dist/es/wrap.mjs.map b/node_modules/motion-utils/dist/es/wrap.mjs.map new file mode 100644 index 0000000..e2fd2d7 --- /dev/null +++ b/node_modules/motion-utils/dist/es/wrap.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"wrap.mjs","sources":["../../src/wrap.ts"],"sourcesContent":["export const wrap = (min: number, max: number, v: number) => {\n const rangeSize = max - min\n return ((((v - min) % rangeSize) + rangeSize) % rangeSize) + min\n}\n"],"names":[],"mappings":"AAAO,MAAM,IAAI,GAAG,CAAC,GAAW,EAAE,GAAW,EAAE,CAAS,KAAI;AACxD,IAAA,MAAM,SAAS,GAAG,GAAG,GAAG,GAAG;AAC3B,IAAA,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,IAAI,SAAS,IAAI,SAAS,IAAI,SAAS,IAAI,GAAG;AACpE;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/index.d.ts b/node_modules/motion-utils/dist/index.d.ts new file mode 100644 index 0000000..5ef1fae --- /dev/null +++ b/node_modules/motion-utils/dist/index.d.ts @@ -0,0 +1,147 @@ +declare function addUniqueItem(arr: T[], item: T): void; +declare function removeItem(arr: T[], item: T): void; +declare function moveItem([...arr]: T[], fromIndex: number, toIndex: number): T[]; + +declare const clamp: (min: number, max: number, v: number) => number; + +type DevMessage = (check: boolean, message: string, errorCode?: string) => void; +declare let warning: DevMessage; +declare let invariant: DevMessage; + +declare const MotionGlobalConfig: { + skipAnimations?: boolean; + instantAnimations?: boolean; + useManualTiming?: boolean; + WillChange?: any; + mix?: (a: T, b: T) => (p: number) => T; +}; + +/** + * Check if value is a numerical string, ie a string that is purely a number eg "100" or "-100.1" + */ +declare const isNumericalString: (v: string) => boolean; + +declare const isObject: (value: unknown) => value is object; + +/** + * Check if the value is a zero value string like "0px" or "0%" + */ +declare const isZeroValueString: (v: string) => boolean; + +declare function memo(callback: () => T): () => T; + +declare const noop: (any: T) => T; + +/** + * Pipe + * Compose other transformers to run linearily + * pipe(min(20), max(40)) + * @param {...functions} transformers + * @return {function} + */ +declare const pipe: (...transformers: Function[]) => Function; + +declare const progress: (from: number, to: number, value: number) => number; + +type GenericHandler = (...args: any) => void; +declare class SubscriptionManager { + private subscriptions; + add(handler: Handler): VoidFunction; + notify(a?: Parameters[0], b?: Parameters[1], c?: Parameters[2]): void; + getSize(): number; + clear(): void; +} + +/** + * Converts seconds to milliseconds + * + * @param seconds - Time in seconds. + * @return milliseconds - Converted time in milliseconds. + */ +declare const secondsToMilliseconds: (seconds: number) => number; +declare const millisecondsToSeconds: (milliseconds: number) => number; + +declare const velocityPerSecond: (velocity: number, frameDuration: number) => number; + +declare function hasWarned(message: string): boolean; +declare function warnOnce(condition: boolean, message: string, errorCode?: string): void; + +declare const wrap: (min: number, max: number, v: number) => number; + +declare const anticipate: (p: number) => number; + +declare const backOut: (t: number) => number; +declare const backIn: EasingFunction; +declare const backInOut: EasingFunction; + +type EasingFunction = (v: number) => number; +type EasingModifier = (easing: EasingFunction) => EasingFunction; +type BezierDefinition = readonly [number, number, number, number]; +type EasingDefinition = BezierDefinition | "linear" | "easeIn" | "easeOut" | "easeInOut" | "circIn" | "circOut" | "circInOut" | "backIn" | "backOut" | "backInOut" | "anticipate"; +/** + * The easing function to use. Set as one of: + * + * - The name of an in-built easing function. + * - An array of four numbers to define a cubic bezier curve. + * - An easing function, that accepts and returns a progress value between `0` and `1`. + * + * @public + */ +type Easing = EasingDefinition | EasingFunction; + +declare const circIn: EasingFunction; +declare const circOut: EasingFunction; +declare const circInOut: EasingFunction; + +declare function cubicBezier(mX1: number, mY1: number, mX2: number, mY2: number): (t: number) => number; + +declare const easeIn: (t: number) => number; +declare const easeOut: (t: number) => number; +declare const easeInOut: (t: number) => number; + +declare const mirrorEasing: EasingModifier; + +declare const reverseEasing: EasingModifier; + +type Direction = "start" | "end"; +declare function steps(numSteps: number, direction?: Direction): EasingFunction; + +declare function getEasingForSegment(easing: Easing | Easing[], i: number): Easing; + +declare const isBezierDefinition: (easing: Easing | Easing[]) => easing is BezierDefinition; + +declare const isEasingArray: (ease: any) => ease is Easing[]; + +declare const easingDefinitionToFunction: (definition: Easing) => EasingFunction; + +interface Point { + x: number; + y: number; +} +interface Axis { + min: number; + max: number; +} +interface Box { + x: Axis; + y: Axis; +} +interface BoundingBox { + top: number; + right: number; + bottom: number; + left: number; +} +interface AxisDelta { + translate: number; + scale: number; + origin: number; + originPoint: number; +} +interface Delta { + x: AxisDelta; + y: AxisDelta; +} +type TransformPoint = (point: Point) => Point; + +export { type Axis, type AxisDelta, type BezierDefinition, type BoundingBox, type Box, type Delta, type DevMessage, type Direction, type Easing, type EasingDefinition, type EasingFunction, type EasingModifier, MotionGlobalConfig, type Point, SubscriptionManager, type TransformPoint, addUniqueItem, anticipate, backIn, backInOut, backOut, circIn, circInOut, circOut, clamp, cubicBezier, easeIn, easeInOut, easeOut, easingDefinitionToFunction, getEasingForSegment, hasWarned, invariant, isBezierDefinition, isEasingArray, isNumericalString, isObject, isZeroValueString, memo, millisecondsToSeconds, mirrorEasing, moveItem, noop, pipe, progress, removeItem, reverseEasing, secondsToMilliseconds, steps, velocityPerSecond, warnOnce, warning, wrap }; diff --git a/node_modules/motion-utils/dist/motion-utils.dev.js b/node_modules/motion-utils/dist/motion-utils.dev.js new file mode 100644 index 0000000..dc5d721 --- /dev/null +++ b/node_modules/motion-utils/dist/motion-utils.dev.js @@ -0,0 +1,348 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.MotionUtils = {})); +})(this, (function (exports) { 'use strict'; + + function addUniqueItem(arr, item) { + if (arr.indexOf(item) === -1) + arr.push(item); + } + function removeItem(arr, item) { + const index = arr.indexOf(item); + if (index > -1) + arr.splice(index, 1); + } + // Adapted from array-move + function moveItem([...arr], fromIndex, toIndex) { + const startIndex = fromIndex < 0 ? arr.length + fromIndex : fromIndex; + if (startIndex >= 0 && startIndex < arr.length) { + const endIndex = toIndex < 0 ? arr.length + toIndex : toIndex; + const [item] = arr.splice(fromIndex, 1); + arr.splice(endIndex, 0, item); + } + return arr; + } + + const clamp = (min, max, v) => { + if (v > max) + return max; + if (v < min) + return min; + return v; + }; + + function formatErrorMessage(message, errorCode) { + return errorCode + ? `${message}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${errorCode}` + : message; + } + + exports.warning = () => { }; + exports.invariant = () => { }; + if (typeof process !== "undefined" && + process.env?.NODE_ENV !== "production") { + exports.warning = (check, message, errorCode) => { + if (!check && typeof console !== "undefined") { + console.warn(formatErrorMessage(message, errorCode)); + } + }; + exports.invariant = (check, message, errorCode) => { + if (!check) { + throw new Error(formatErrorMessage(message, errorCode)); + } + }; + } + + const MotionGlobalConfig = {}; + + /** + * Check if value is a numerical string, ie a string that is purely a number eg "100" or "-100.1" + */ + const isNumericalString = (v) => /^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(v); + + const isObject = (value) => typeof value === "object" && value !== null; + + /** + * Check if the value is a zero value string like "0px" or "0%" + */ + const isZeroValueString = (v) => /^0[^.\s]+$/u.test(v); + + /*#__NO_SIDE_EFFECTS__*/ + function memo(callback) { + let result; + return () => { + if (result === undefined) + result = callback(); + return result; + }; + } + + /*#__NO_SIDE_EFFECTS__*/ + const noop = (any) => any; + + /** + * Pipe + * Compose other transformers to run linearily + * pipe(min(20), max(40)) + * @param {...functions} transformers + * @return {function} + */ + const pipe = (...transformers) => transformers.reduce((a, b) => (v) => b(a(v))); + + /* + Progress within given range + + Given a lower limit and an upper limit, we return the progress + (expressed as a number 0-1) represented by the given value, and + limit that progress to within 0-1. + */ + /*#__NO_SIDE_EFFECTS__*/ + const progress = (from, to, value) => { + const range = to - from; + return range ? (value - from) / range : 1; + }; + + class SubscriptionManager { + constructor() { + this.subscriptions = []; + } + add(handler) { + addUniqueItem(this.subscriptions, handler); + return () => removeItem(this.subscriptions, handler); + } + notify(a, b, c) { + const numSubscriptions = this.subscriptions.length; + if (!numSubscriptions) + return; + if (numSubscriptions === 1) { + /** + * If there's only a single handler we can just call it without invoking a loop. + */ + this.subscriptions[0](a, b, c); + } + else { + for (let i = 0; i < numSubscriptions; i++) { + /** + * Check whether the handler exists before firing as it's possible + * the subscriptions were modified during this loop running. + */ + const handler = this.subscriptions[i]; + handler && handler(a, b, c); + } + } + } + getSize() { + return this.subscriptions.length; + } + clear() { + this.subscriptions.length = 0; + } + } + + /** + * Converts seconds to milliseconds + * + * @param seconds - Time in seconds. + * @return milliseconds - Converted time in milliseconds. + */ + /*#__NO_SIDE_EFFECTS__*/ + const secondsToMilliseconds = (seconds) => seconds * 1000; + /*#__NO_SIDE_EFFECTS__*/ + const millisecondsToSeconds = (milliseconds) => milliseconds / 1000; + + /* + Convert velocity into velocity per second + */ + /*#__NO_SIDE_EFFECTS__*/ + const velocityPerSecond = (velocity, frameDuration) => frameDuration ? velocity * (1000 / frameDuration) : 0; + + const warned = new Set(); + function hasWarned(message) { + return warned.has(message); + } + function warnOnce(condition, message, errorCode) { + if (condition || warned.has(message)) + return; + console.warn(formatErrorMessage(message, errorCode)); + warned.add(message); + } + + const wrap = (min, max, v) => { + const rangeSize = max - min; + return ((((v - min) % rangeSize) + rangeSize) % rangeSize) + min; + }; + + /* + Bezier function generator + This has been modified from Gaëtan Renaudeau's BezierEasing + https://github.com/gre/bezier-easing/blob/master/src/index.js + https://github.com/gre/bezier-easing/blob/master/LICENSE + + I've removed the newtonRaphsonIterate algo because in benchmarking it + wasn't noticeably faster than binarySubdivision, indeed removing it + usually improved times, depending on the curve. + I also removed the lookup table, as for the added bundle size and loop we're + only cutting ~4 or so subdivision iterations. I bumped the max iterations up + to 12 to compensate and this still tended to be faster for no perceivable + loss in accuracy. + Usage + const easeOut = cubicBezier(.17,.67,.83,.67); + const x = easeOut(0.5); // returns 0.627... + */ + // Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2. + const calcBezier = (t, a1, a2) => (((1.0 - 3.0 * a2 + 3.0 * a1) * t + (3.0 * a2 - 6.0 * a1)) * t + 3.0 * a1) * + t; + const subdivisionPrecision = 0.0000001; + const subdivisionMaxIterations = 12; + function binarySubdivide(x, lowerBound, upperBound, mX1, mX2) { + let currentX; + let currentT; + let i = 0; + do { + currentT = lowerBound + (upperBound - lowerBound) / 2.0; + currentX = calcBezier(currentT, mX1, mX2) - x; + if (currentX > 0.0) { + upperBound = currentT; + } + else { + lowerBound = currentT; + } + } while (Math.abs(currentX) > subdivisionPrecision && + ++i < subdivisionMaxIterations); + return currentT; + } + /*#__NO_SIDE_EFFECTS__*/ + function cubicBezier(mX1, mY1, mX2, mY2) { + // If this is a linear gradient, return linear easing + if (mX1 === mY1 && mX2 === mY2) + return noop; + const getTForX = (aX) => binarySubdivide(aX, 0, 1, mX1, mX2); + // If animation is at start/end, return t without easing + return (t) => t === 0 || t === 1 ? t : calcBezier(getTForX(t), mY1, mY2); + } + + // Accepts an easing function and returns a new one that outputs mirrored values for + // the second half of the animation. Turns easeIn into easeInOut. + /*#__NO_SIDE_EFFECTS__*/ + const mirrorEasing = (easing) => (p) => p <= 0.5 ? easing(2 * p) / 2 : (2 - easing(2 * (1 - p))) / 2; + + // Accepts an easing function and returns a new one that outputs reversed values. + // Turns easeIn into easeOut. + /*#__NO_SIDE_EFFECTS__*/ + const reverseEasing = (easing) => (p) => 1 - easing(1 - p); + + const backOut = /*@__PURE__*/ cubicBezier(0.33, 1.53, 0.69, 0.99); + const backIn = /*@__PURE__*/ reverseEasing(backOut); + const backInOut = /*@__PURE__*/ mirrorEasing(backIn); + + const anticipate = (p) => p >= 1 + ? 1 + : (p *= 2) < 1 + ? 0.5 * backIn(p) + : 0.5 * (2 - Math.pow(2, -10 * (p - 1))); + + const circIn = (p) => 1 - Math.sin(Math.acos(p)); + const circOut = reverseEasing(circIn); + const circInOut = mirrorEasing(circIn); + + const easeIn = /*@__PURE__*/ cubicBezier(0.42, 0, 1, 1); + const easeOut = /*@__PURE__*/ cubicBezier(0, 0, 0.58, 1); + const easeInOut = /*@__PURE__*/ cubicBezier(0.42, 0, 0.58, 1); + + /*#__NO_SIDE_EFFECTS__*/ + function steps(numSteps, direction = "end") { + return (progress) => { + progress = + direction === "end" + ? Math.min(progress, 0.999) + : Math.max(progress, 0.001); + const expanded = progress * numSteps; + const rounded = direction === "end" ? Math.floor(expanded) : Math.ceil(expanded); + return clamp(0, 1, rounded / numSteps); + }; + } + + /*#__NO_SIDE_EFFECTS__*/ + const isEasingArray = (ease) => { + return Array.isArray(ease) && typeof ease[0] !== "number"; + }; + + /*#__NO_SIDE_EFFECTS__*/ + function getEasingForSegment(easing, i) { + return isEasingArray(easing) ? easing[wrap(0, easing.length, i)] : easing; + } + + /*#__NO_SIDE_EFFECTS__*/ + const isBezierDefinition = (easing) => Array.isArray(easing) && typeof easing[0] === "number"; + + const easingLookup = { + linear: noop, + easeIn, + easeInOut, + easeOut, + circIn, + circInOut, + circOut, + backIn, + backInOut, + backOut, + anticipate, + }; + const isValidEasing = (easing) => { + return typeof easing === "string"; + }; + const easingDefinitionToFunction = (definition) => { + if (isBezierDefinition(definition)) { + // If cubic bezier definition, create bezier curve + exports.invariant(definition.length === 4, `Cubic bezier arrays must contain four numerical values.`, "cubic-bezier-length"); + const [x1, y1, x2, y2] = definition; + return cubicBezier(x1, y1, x2, y2); + } + else if (isValidEasing(definition)) { + // Else lookup from table + exports.invariant(easingLookup[definition] !== undefined, `Invalid easing type '${definition}'`, "invalid-easing-type"); + return easingLookup[definition]; + } + return definition; + }; + + exports.MotionGlobalConfig = MotionGlobalConfig; + exports.SubscriptionManager = SubscriptionManager; + exports.addUniqueItem = addUniqueItem; + exports.anticipate = anticipate; + exports.backIn = backIn; + exports.backInOut = backInOut; + exports.backOut = backOut; + exports.circIn = circIn; + exports.circInOut = circInOut; + exports.circOut = circOut; + exports.clamp = clamp; + exports.cubicBezier = cubicBezier; + exports.easeIn = easeIn; + exports.easeInOut = easeInOut; + exports.easeOut = easeOut; + exports.easingDefinitionToFunction = easingDefinitionToFunction; + exports.getEasingForSegment = getEasingForSegment; + exports.hasWarned = hasWarned; + exports.isBezierDefinition = isBezierDefinition; + exports.isEasingArray = isEasingArray; + exports.isNumericalString = isNumericalString; + exports.isObject = isObject; + exports.isZeroValueString = isZeroValueString; + exports.memo = memo; + exports.millisecondsToSeconds = millisecondsToSeconds; + exports.mirrorEasing = mirrorEasing; + exports.moveItem = moveItem; + exports.noop = noop; + exports.pipe = pipe; + exports.progress = progress; + exports.removeItem = removeItem; + exports.reverseEasing = reverseEasing; + exports.secondsToMilliseconds = secondsToMilliseconds; + exports.steps = steps; + exports.velocityPerSecond = velocityPerSecond; + exports.warnOnce = warnOnce; + exports.wrap = wrap; + +})); diff --git a/node_modules/motion-utils/dist/motion-utils.js b/node_modules/motion-utils/dist/motion-utils.js new file mode 100644 index 0000000..34f8b07 --- /dev/null +++ b/node_modules/motion-utils/dist/motion-utils.js @@ -0,0 +1 @@ +!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((n="undefined"!=typeof globalThis?globalThis:n||self).MotionUtils={})}(this,function(n){"use strict";function t(n,t){-1===n.indexOf(t)&&n.push(t)}function e(n,t){const e=n.indexOf(t);e>-1&&n.splice(e,1)}const i=(n,t,e)=>e>t?t:e{},n.invariant=()=>{},"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(n.warning=(n,t,e)=>{n||"undefined"==typeof console||console.warn(s(t,e))},n.invariant=(n,t,e)=>{if(!n)throw new Error(s(t,e))});const o=n=>n;const r=new Set;const c=(n,t,e)=>{const i=t-n;return((e-n)%i+i)%i+n},a=(n,t,e)=>(((1-3*e+3*t)*n+(3*e-6*t))*n+3*t)*n;function u(n,t,e,i){if(n===t&&e===i)return o;const s=t=>function(n,t,e,i,s){let o,r,c=0;do{r=t+(e-t)/2,o=a(r,i,s)-n,o>0?e=r:t=r}while(Math.abs(o)>1e-7&&++c<12);return r}(t,0,1,n,e);return n=>0===n||1===n?n:a(s(n),t,i)}const l=n=>t=>t<=.5?n(2*t)/2:(2-n(2*(1-t)))/2,f=n=>t=>1-n(1-t),p=u(.33,1.53,.69,.99),d=f(p),h=l(d),g=n=>n>=1?1:(n*=2)<1?.5*d(n):.5*(2-Math.pow(2,-10*(n-1))),b=n=>1-Math.sin(Math.acos(n)),m=f(b),y=l(b),v=u(.42,0,1,1),O=u(0,0,.58,1),I=u(.42,0,.58,1);const M=n=>Array.isArray(n)&&"number"!=typeof n[0];const w=n=>Array.isArray(n)&&"number"==typeof n[0],S={linear:o,easeIn:v,easeInOut:I,easeOut:O,circIn:b,circInOut:y,circOut:m,backIn:d,backInOut:h,backOut:p,anticipate:g};n.MotionGlobalConfig={},n.SubscriptionManager=class{constructor(){this.subscriptions=[]}add(n){return t(this.subscriptions,n),()=>e(this.subscriptions,n)}notify(n,t,e){const i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](n,t,e);else for(let s=0;s{if(w(t)){n.invariant(4===t.length,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[e,i,s,o]=t;return u(e,i,s,o)}return"string"==typeof t?(n.invariant(void 0!==S[t],`Invalid easing type '${t}'`,"invalid-easing-type"),S[t]):t},n.getEasingForSegment=function(n,t){return M(n)?n[c(0,n.length,t)]:n},n.hasWarned=function(n){return r.has(n)},n.isBezierDefinition=w,n.isEasingArray=M,n.isNumericalString=n=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(n),n.isObject=n=>"object"==typeof n&&null!==n,n.isZeroValueString=n=>/^0[^.\s]+$/u.test(n),n.memo=function(n){let t;return()=>(void 0===t&&(t=n()),t)},n.millisecondsToSeconds=n=>n/1e3,n.mirrorEasing=l,n.moveItem=function([...n],t,e){const i=t<0?n.length+t:t;if(i>=0&&in.reduce((n,t)=>e=>t(n(e))),n.progress=(n,t,e)=>{const i=t-n;return i?(e-n)/i:1},n.removeItem=e,n.reverseEasing=f,n.secondsToMilliseconds=n=>1e3*n,n.steps=function(n,t="end"){return e=>{const s=(e="end"===t?Math.min(e,.999):Math.max(e,.001))*n,o="end"===t?Math.floor(s):Math.ceil(s);return i(0,1,o/n)}},n.velocityPerSecond=(n,t)=>t?n*(1e3/t):0,n.warnOnce=function(n,t,e){n||r.has(t)||(console.warn(s(t,e)),r.add(t))},n.wrap=c}); diff --git a/node_modules/motion-utils/package.json b/node_modules/motion-utils/package.json new file mode 100644 index 0000000..2ed6dff --- /dev/null +++ b/node_modules/motion-utils/package.json @@ -0,0 +1,26 @@ +{ + "name": "motion-utils", + "version": "13.0.0", + "author": "Matt Perry", + "license": "MIT", + "repository": "https://github.com/motiondivision/motion", + "main": "./dist/cjs/index.js", + "types": "./dist/index.d.ts", + "module": "./dist/es/index.mjs", + "sideEffects": false, + "exports": { + ".": { + "types": "./dist/index.d.ts", + "require": "./dist/cjs/index.js", + "import": "./dist/es/index.mjs", + "default": "./dist/cjs/index.js" + } + }, + "scripts": { + "clean": "rm -rf types dist lib", + "build": "yarn clean && tsc -p . && rollup -c", + "dev": "concurrently -c blue,red -n tsc,rollup --kill-others \"tsc --watch -p . --preserveWatchOutput\" \"rollup --config --watch --no-watch.clearScreen\"", + "test": "jest --config jest.config.json --max-workers=2" + }, + "gitHead": "e4029ce071bddaed2a539b861f5d9c509bea40da" +} diff --git a/node_modules/motion/LICENSE.md b/node_modules/motion/LICENSE.md new file mode 100644 index 0000000..8111044 --- /dev/null +++ b/node_modules/motion/LICENSE.md @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2024 [Motion](https://motion.dev) B.V. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/motion/README.md b/node_modules/motion/README.md new file mode 100644 index 0000000..e25e148 --- /dev/null +++ b/node_modules/motion/README.md @@ -0,0 +1,141 @@ +

Motion logo
Motion

+

+ An open source animation library
for JavaScript, React and Vue +

+ +

+ npm version + npm downloads per month + jsDelivr hits (npm) + NPM License + MotionScore grade +

+ +```bash +# React / JavaScript +npm install motion + +# Vue +npm install motion-v +``` + +## Table of Contents + +1. [Why Motion?](#why-motion) +2. [🍦 Platforms](#-platforms) +3. [🎓 Examples](#-examples) +4. [⚡️ Motion+](#-motion) +5. [👩🏻‍⚖️ License](#-license) +6. [💎 Contribute](#-contribute) +7. [✨ Sponsors](#-sponsors) + +## Why Motion? + +- **Simple API:** First-class React, JavaScript, and Vue packages. +- **Hybrid engine:** Power of JavaScript combined with native browser APIs for 120fps, GPU-accelerated animations. +- **Production-ready:** TypeScript, extensive test suite, tree-shakable, tiny footprint. + **Batteries included:** Gestures, springs, layout transitions, scroll-linked effects, timelines. + +## 🍦 Platforms + +Motion is available for [React](https://motion.dev/docs/react), [JavaScript](https://motion.dev/docs/quick-start) and [Vue](https://motion.dev/docs/vue). + +### React + +```jsx +import { motion } from "motion/react" + +function Component() { + return +} +``` + +Get started with [Motion for React](https://motion.dev/docs/react). + +**Note:** Framer Motion is now Motion. Import from `motion/react` instead of `framer-motion`. + +### JS + +```javascript +import { animate } from "motion" + +animate("#box", { x: 100 }) +``` + +Get started with [JavaScript](https://motion.dev/docs/quick-start). + +### Vue + +```html + + + +``` + +Get started with [Motion for Vue](https://motion.dev/docs/vue). + +## 🎓 Examples & tutorials + +Browse 330+ [official examples](https://motion.dev/examples), with copy-paste code that'll level-up your animations whether you're a beginner or an expert. + +Over 100 examples come with a full step-by-step [tutorial](https://motion.dev/tutorials). + +## ⚡️ Motion+ + +A one-time payment, lifetime-updates membership: + +- **330+ examples** +- **100+ tutorials** +- **Premium APIs** like [Cursor](https://motion.dev/docs/cursor) and [Ticker](https://motion.dev/docs/react-ticker) +- **Transition editor** for Cursor and VS Code +- **AI skills** +- **Private Discord** +- **Early access content** + +[Get Motion+](https://motion.dev/plus) + +## 👩🏻‍⚖️ License + +- Motion is MIT licensed. + +## 💎 Contribute + +- Want to contribute to Motion? Our [contributing guide](https://github.com/motiondivision/motion/blob/master/CONTRIBUTING.md) has you covered. + +## ✨ Sponsors + +Motion is sustainable thanks to the kind support of its sponsors. + +[Become a sponsor](https://motion.dev/sponsor) + +### Partners + +Motion powers the animations for all websites built with Framer, the web builder for creative pros. The Motion website itself is built on Framer, for its delightful canvas-based editing and powerful CMS features. + + + Framer + + +Motion drives the animations on the Cursor homepage, and is working with Cursor to bring powerful AI workflows to the Motion examples and docs. + + + Cursor + + +### Platinum + +Linear Figma Sanity Sanity Clerk + +### Gold + +### Silver + +Liveblocks Frontend.fyi Firecrawl Bolt.new + +### Personal + +- [OlegWock](https://sinja.io) +- [Lambert Weller](https://github.com/l-mbert) +- [Jake LeBoeuf](https://jklb.wf) diff --git a/node_modules/motion/dist/cjs/debug.js b/node_modules/motion/dist/cjs/debug.js new file mode 100644 index 0000000..c13331a --- /dev/null +++ b/node_modules/motion/dist/cjs/debug.js @@ -0,0 +1,14 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var debug = require('framer-motion/debug'); + + + +Object.keys(debug).forEach(function (k) { + if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { + enumerable: true, + get: function () { return debug[k]; } + }); +}); diff --git a/node_modules/motion/dist/cjs/index.js b/node_modules/motion/dist/cjs/index.js new file mode 100644 index 0000000..c851699 --- /dev/null +++ b/node_modules/motion/dist/cjs/index.js @@ -0,0 +1,14 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var dom = require('framer-motion/dom'); + + + +Object.keys(dom).forEach(function (k) { + if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { + enumerable: true, + get: function () { return dom[k]; } + }); +}); diff --git a/node_modules/motion/dist/cjs/mini.js b/node_modules/motion/dist/cjs/mini.js new file mode 100644 index 0000000..d4f10a5 --- /dev/null +++ b/node_modules/motion/dist/cjs/mini.js @@ -0,0 +1,14 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var mini = require('framer-motion/dom/mini'); + + + +Object.keys(mini).forEach(function (k) { + if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { + enumerable: true, + get: function () { return mini[k]; } + }); +}); diff --git a/node_modules/motion/dist/cjs/react-client.js b/node_modules/motion/dist/cjs/react-client.js new file mode 100644 index 0000000..6f8722f --- /dev/null +++ b/node_modules/motion/dist/cjs/react-client.js @@ -0,0 +1,14 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var client = require('framer-motion/client'); + + + +Object.keys(client).forEach(function (k) { + if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { + enumerable: true, + get: function () { return client[k]; } + }); +}); diff --git a/node_modules/motion/dist/cjs/react-m.js b/node_modules/motion/dist/cjs/react-m.js new file mode 100644 index 0000000..69f738a --- /dev/null +++ b/node_modules/motion/dist/cjs/react-m.js @@ -0,0 +1,14 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var m = require('framer-motion/m'); + + + +Object.keys(m).forEach(function (k) { + if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { + enumerable: true, + get: function () { return m[k]; } + }); +}); diff --git a/node_modules/motion/dist/cjs/react-mini.js b/node_modules/motion/dist/cjs/react-mini.js new file mode 100644 index 0000000..7c137c9 --- /dev/null +++ b/node_modules/motion/dist/cjs/react-mini.js @@ -0,0 +1,14 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var mini = require('framer-motion/mini'); + + + +Object.keys(mini).forEach(function (k) { + if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { + enumerable: true, + get: function () { return mini[k]; } + }); +}); diff --git a/node_modules/motion/dist/cjs/react.js b/node_modules/motion/dist/cjs/react.js new file mode 100644 index 0000000..9743a9c --- /dev/null +++ b/node_modules/motion/dist/cjs/react.js @@ -0,0 +1,46 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var fm = require('framer-motion'); + +function _interopNamespaceDefault(e) { + var n = Object.create(null); + if (e) { + Object.keys(e).forEach(function (k) { + if (k !== 'default') { + var d = Object.getOwnPropertyDescriptor(e, k); + Object.defineProperty(n, k, d.get ? d : { + enumerable: true, + get: function () { return e[k]; } + }); + } + }); + } + n.default = e; + return Object.freeze(n); +} + +var fm__namespace = /*#__PURE__*/_interopNamespaceDefault(fm); + +// Re-export everything from framer-motion. +// +// `motion` and `m` are aliased through local bindings so the module has +// explicit named exports for IDE auto-import (see #3432). The previous +// `export { motion, m } from "framer-motion"` line — sitting alongside +// `export * from "framer-motion"` — was a duplicate-source re-export pattern +// that caused Next.js Turbopack to OOM during module-graph analysis (#3741). +// Local declarations shadow the wildcard re-export per the ES spec, so +// `motion` and `m` come from the explicit bindings below and the rest from +// `export *`. +const motion = fm__namespace.motion; +const m = fm__namespace.m; + +exports.m = m; +exports.motion = motion; +Object.keys(fm).forEach(function (k) { + if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { + enumerable: true, + get: function () { return fm[k]; } + }); +}); diff --git a/node_modules/motion/dist/debug.d.ts b/node_modules/motion/dist/debug.d.ts new file mode 100644 index 0000000..8c55be2 --- /dev/null +++ b/node_modules/motion/dist/debug.d.ts @@ -0,0 +1 @@ +export * from 'framer-motion/debug'; diff --git a/node_modules/motion/dist/es/debug.mjs b/node_modules/motion/dist/es/debug.mjs new file mode 100644 index 0000000..8c55be2 --- /dev/null +++ b/node_modules/motion/dist/es/debug.mjs @@ -0,0 +1 @@ +export * from 'framer-motion/debug'; diff --git a/node_modules/motion/dist/es/index.mjs b/node_modules/motion/dist/es/index.mjs new file mode 100644 index 0000000..6bcc19b --- /dev/null +++ b/node_modules/motion/dist/es/index.mjs @@ -0,0 +1 @@ +export * from 'framer-motion/dom'; diff --git a/node_modules/motion/dist/es/mini.mjs b/node_modules/motion/dist/es/mini.mjs new file mode 100644 index 0000000..8c6de40 --- /dev/null +++ b/node_modules/motion/dist/es/mini.mjs @@ -0,0 +1 @@ +export * from 'framer-motion/dom/mini'; diff --git a/node_modules/motion/dist/es/react-client.mjs b/node_modules/motion/dist/es/react-client.mjs new file mode 100644 index 0000000..dd39a72 --- /dev/null +++ b/node_modules/motion/dist/es/react-client.mjs @@ -0,0 +1 @@ +export * from 'framer-motion/client'; diff --git a/node_modules/motion/dist/es/react-m.mjs b/node_modules/motion/dist/es/react-m.mjs new file mode 100644 index 0000000..c7ed1b1 --- /dev/null +++ b/node_modules/motion/dist/es/react-m.mjs @@ -0,0 +1 @@ +export * from 'framer-motion/m'; diff --git a/node_modules/motion/dist/es/react-mini.mjs b/node_modules/motion/dist/es/react-mini.mjs new file mode 100644 index 0000000..ef5bdae --- /dev/null +++ b/node_modules/motion/dist/es/react-mini.mjs @@ -0,0 +1 @@ +export * from 'framer-motion/mini'; diff --git a/node_modules/motion/dist/es/react.mjs b/node_modules/motion/dist/es/react.mjs new file mode 100644 index 0000000..8d67cfa --- /dev/null +++ b/node_modules/motion/dist/es/react.mjs @@ -0,0 +1,17 @@ +import * as fm from 'framer-motion'; +export * from 'framer-motion'; + +// Re-export everything from framer-motion. +// +// `motion` and `m` are aliased through local bindings so the module has +// explicit named exports for IDE auto-import (see #3432). The previous +// `export { motion, m } from "framer-motion"` line — sitting alongside +// `export * from "framer-motion"` — was a duplicate-source re-export pattern +// that caused Next.js Turbopack to OOM during module-graph analysis (#3741). +// Local declarations shadow the wildcard re-export per the ES spec, so +// `motion` and `m` come from the explicit bindings below and the rest from +// `export *`. +const motion = fm.motion; +const m = fm.m; + +export { m, motion }; diff --git a/node_modules/motion/dist/index.d.ts b/node_modules/motion/dist/index.d.ts new file mode 100644 index 0000000..6bcc19b --- /dev/null +++ b/node_modules/motion/dist/index.d.ts @@ -0,0 +1 @@ +export * from 'framer-motion/dom'; diff --git a/node_modules/motion/dist/mini.d.ts b/node_modules/motion/dist/mini.d.ts new file mode 100644 index 0000000..8c6de40 --- /dev/null +++ b/node_modules/motion/dist/mini.d.ts @@ -0,0 +1 @@ +export * from 'framer-motion/dom/mini'; diff --git a/node_modules/motion/dist/motion.dev.js b/node_modules/motion/dist/motion.dev.js new file mode 100644 index 0000000..e1d038d --- /dev/null +++ b/node_modules/motion/dist/motion.dev.js @@ -0,0 +1,12706 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Motion = {})); +})(this, (function (exports) { 'use strict'; + + function addUniqueItem(arr, item) { + if (arr.indexOf(item) === -1) + arr.push(item); + } + function removeItem(arr, item) { + const index = arr.indexOf(item); + if (index > -1) + arr.splice(index, 1); + } + // Adapted from array-move + function moveItem([...arr], fromIndex, toIndex) { + const startIndex = fromIndex < 0 ? arr.length + fromIndex : fromIndex; + if (startIndex >= 0 && startIndex < arr.length) { + const endIndex = toIndex < 0 ? arr.length + toIndex : toIndex; + const [item] = arr.splice(fromIndex, 1); + arr.splice(endIndex, 0, item); + } + return arr; + } + + const clamp = (min, max, v) => { + if (v > max) + return max; + if (v < min) + return min; + return v; + }; + + function formatErrorMessage(message, errorCode) { + return errorCode + ? `${message}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${errorCode}` + : message; + } + + exports.warning = () => { }; + exports.invariant = () => { }; + if (typeof process !== "undefined" && + process.env?.NODE_ENV !== "production") { + exports.warning = (check, message, errorCode) => { + if (!check && typeof console !== "undefined") { + console.warn(formatErrorMessage(message, errorCode)); + } + }; + exports.invariant = (check, message, errorCode) => { + if (!check) { + throw new Error(formatErrorMessage(message, errorCode)); + } + }; + } + + const MotionGlobalConfig = {}; + + /** + * Check if value is a numerical string, ie a string that is purely a number eg "100" or "-100.1" + */ + const isNumericalString = (v) => /^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(v); + + const isObject = (value) => typeof value === "object" && value !== null; + + /** + * Check if the value is a zero value string like "0px" or "0%" + */ + const isZeroValueString = (v) => /^0[^.\s]+$/u.test(v); + + /*#__NO_SIDE_EFFECTS__*/ + function memo(callback) { + let result; + return () => { + if (result === undefined) + result = callback(); + return result; + }; + } + + /*#__NO_SIDE_EFFECTS__*/ + const noop = (any) => any; + + /** + * Pipe + * Compose other transformers to run linearily + * pipe(min(20), max(40)) + * @param {...functions} transformers + * @return {function} + */ + const pipe = (...transformers) => transformers.reduce((a, b) => (v) => b(a(v))); + + /* + Progress within given range + + Given a lower limit and an upper limit, we return the progress + (expressed as a number 0-1) represented by the given value, and + limit that progress to within 0-1. + */ + /*#__NO_SIDE_EFFECTS__*/ + const progress = (from, to, value) => { + const range = to - from; + return range ? (value - from) / range : 1; + }; + + class SubscriptionManager { + constructor() { + this.subscriptions = []; + } + add(handler) { + addUniqueItem(this.subscriptions, handler); + return () => removeItem(this.subscriptions, handler); + } + notify(a, b, c) { + const numSubscriptions = this.subscriptions.length; + if (!numSubscriptions) + return; + if (numSubscriptions === 1) { + /** + * If there's only a single handler we can just call it without invoking a loop. + */ + this.subscriptions[0](a, b, c); + } + else { + for (let i = 0; i < numSubscriptions; i++) { + /** + * Check whether the handler exists before firing as it's possible + * the subscriptions were modified during this loop running. + */ + const handler = this.subscriptions[i]; + handler && handler(a, b, c); + } + } + } + getSize() { + return this.subscriptions.length; + } + clear() { + this.subscriptions.length = 0; + } + } + + /** + * Converts seconds to milliseconds + * + * @param seconds - Time in seconds. + * @return milliseconds - Converted time in milliseconds. + */ + /*#__NO_SIDE_EFFECTS__*/ + const secondsToMilliseconds = (seconds) => seconds * 1000; + /*#__NO_SIDE_EFFECTS__*/ + const millisecondsToSeconds = (milliseconds) => milliseconds / 1000; + + /* + Convert velocity into velocity per second + */ + /*#__NO_SIDE_EFFECTS__*/ + const velocityPerSecond = (velocity, frameDuration) => frameDuration ? velocity * (1000 / frameDuration) : 0; + + const warned = new Set(); + function hasWarned(message) { + return warned.has(message); + } + function warnOnce(condition, message, errorCode) { + if (condition || warned.has(message)) + return; + console.warn(formatErrorMessage(message, errorCode)); + warned.add(message); + } + + const wrap = (min, max, v) => { + const rangeSize = max - min; + return ((((v - min) % rangeSize) + rangeSize) % rangeSize) + min; + }; + + /* + Bezier function generator + This has been modified from Gaëtan Renaudeau's BezierEasing + https://github.com/gre/bezier-easing/blob/master/src/index.js + https://github.com/gre/bezier-easing/blob/master/LICENSE + + I've removed the newtonRaphsonIterate algo because in benchmarking it + wasn't noticeably faster than binarySubdivision, indeed removing it + usually improved times, depending on the curve. + I also removed the lookup table, as for the added bundle size and loop we're + only cutting ~4 or so subdivision iterations. I bumped the max iterations up + to 12 to compensate and this still tended to be faster for no perceivable + loss in accuracy. + Usage + const easeOut = cubicBezier(.17,.67,.83,.67); + const x = easeOut(0.5); // returns 0.627... + */ + // Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2. + const calcBezier = (t, a1, a2) => (((1.0 - 3.0 * a2 + 3.0 * a1) * t + (3.0 * a2 - 6.0 * a1)) * t + 3.0 * a1) * + t; + const subdivisionPrecision = 0.0000001; + const subdivisionMaxIterations = 12; + function binarySubdivide(x, lowerBound, upperBound, mX1, mX2) { + let currentX; + let currentT; + let i = 0; + do { + currentT = lowerBound + (upperBound - lowerBound) / 2.0; + currentX = calcBezier(currentT, mX1, mX2) - x; + if (currentX > 0.0) { + upperBound = currentT; + } + else { + lowerBound = currentT; + } + } while (Math.abs(currentX) > subdivisionPrecision && + ++i < subdivisionMaxIterations); + return currentT; + } + /*#__NO_SIDE_EFFECTS__*/ + function cubicBezier(mX1, mY1, mX2, mY2) { + // If this is a linear gradient, return linear easing + if (mX1 === mY1 && mX2 === mY2) + return noop; + const getTForX = (aX) => binarySubdivide(aX, 0, 1, mX1, mX2); + // If animation is at start/end, return t without easing + return (t) => t === 0 || t === 1 ? t : calcBezier(getTForX(t), mY1, mY2); + } + + // Accepts an easing function and returns a new one that outputs mirrored values for + // the second half of the animation. Turns easeIn into easeInOut. + /*#__NO_SIDE_EFFECTS__*/ + const mirrorEasing = (easing) => (p) => p <= 0.5 ? easing(2 * p) / 2 : (2 - easing(2 * (1 - p))) / 2; + + // Accepts an easing function and returns a new one that outputs reversed values. + // Turns easeIn into easeOut. + /*#__NO_SIDE_EFFECTS__*/ + const reverseEasing = (easing) => (p) => 1 - easing(1 - p); + + const backOut = /*@__PURE__*/ cubicBezier(0.33, 1.53, 0.69, 0.99); + const backIn = /*@__PURE__*/ reverseEasing(backOut); + const backInOut = /*@__PURE__*/ mirrorEasing(backIn); + + const anticipate = (p) => p >= 1 + ? 1 + : (p *= 2) < 1 + ? 0.5 * backIn(p) + : 0.5 * (2 - Math.pow(2, -10 * (p - 1))); + + const circIn = (p) => 1 - Math.sin(Math.acos(p)); + const circOut = reverseEasing(circIn); + const circInOut = mirrorEasing(circIn); + + const easeIn = /*@__PURE__*/ cubicBezier(0.42, 0, 1, 1); + const easeOut = /*@__PURE__*/ cubicBezier(0, 0, 0.58, 1); + const easeInOut = /*@__PURE__*/ cubicBezier(0.42, 0, 0.58, 1); + + /*#__NO_SIDE_EFFECTS__*/ + function steps(numSteps, direction = "end") { + return (progress) => { + progress = + direction === "end" + ? Math.min(progress, 0.999) + : Math.max(progress, 0.001); + const expanded = progress * numSteps; + const rounded = direction === "end" ? Math.floor(expanded) : Math.ceil(expanded); + return clamp(0, 1, rounded / numSteps); + }; + } + + /*#__NO_SIDE_EFFECTS__*/ + const isEasingArray = (ease) => { + return Array.isArray(ease) && typeof ease[0] !== "number"; + }; + + /*#__NO_SIDE_EFFECTS__*/ + function getEasingForSegment(easing, i) { + return isEasingArray(easing) ? easing[wrap(0, easing.length, i)] : easing; + } + + /*#__NO_SIDE_EFFECTS__*/ + const isBezierDefinition = (easing) => Array.isArray(easing) && typeof easing[0] === "number"; + + const easingLookup = { + linear: noop, + easeIn, + easeInOut, + easeOut, + circIn, + circInOut, + circOut, + backIn, + backInOut, + backOut, + anticipate, + }; + const isValidEasing = (easing) => { + return typeof easing === "string"; + }; + const easingDefinitionToFunction = (definition) => { + if (isBezierDefinition(definition)) { + // If cubic bezier definition, create bezier curve + exports.invariant(definition.length === 4, `Cubic bezier arrays must contain four numerical values.`, "cubic-bezier-length"); + const [x1, y1, x2, y2] = definition; + return cubicBezier(x1, y1, x2, y2); + } + else if (isValidEasing(definition)) { + // Else lookup from table + exports.invariant(easingLookup[definition] !== undefined, `Invalid easing type '${definition}'`, "invalid-easing-type"); + return easingLookup[definition]; + } + return definition; + }; + + const stepsOrder = [ + "setup", // Compute + "read", // Read + "resolveKeyframes", // Write/Read/Write/Read + "preUpdate", // Compute + "update", // Compute + "preRender", // Compute + "render", // Write + "postRender", // Compute + ]; + + function createRenderStep(runNextFrame) { + /** + * We create and reuse two queues, one to queue jobs for the current frame + * and one for the next. We reuse to avoid triggering GC after x frames. + */ + let thisFrame = new Set(); + let nextFrame = new Set(); + /** + * Track whether we're currently processing jobs in this step. This way + * we can decide whether to schedule new jobs for this frame or next. + */ + let isProcessing = false; + let flushNextFrame = false; + /** + * A set of processes which were marked keepAlive when scheduled. + */ + const toKeepAlive = new WeakSet(); + let latestFrameData = { + delta: 0.0, + timestamp: 0.0, + isProcessing: false, + }; + function triggerCallback(callback) { + if (toKeepAlive.has(callback)) { + step.schedule(callback); + runNextFrame(); + } + callback(latestFrameData); + } + const step = { + /** + * Schedule a process to run on the next frame. + */ + schedule: (callback, keepAlive = false, immediate = false) => { + const addToCurrentFrame = immediate && isProcessing; + const queue = addToCurrentFrame ? thisFrame : nextFrame; + if (keepAlive) + toKeepAlive.add(callback); + queue.add(callback); + return callback; + }, + /** + * Cancel the provided callback from running on the next frame. + */ + cancel: (callback) => { + nextFrame.delete(callback); + toKeepAlive.delete(callback); + }, + /** + * Execute all schedule callbacks. + */ + process: (frameData) => { + latestFrameData = frameData; + /** + * If we're already processing we've probably been triggered by a flushSync + * inside an existing process. Instead of executing, mark flushNextFrame + * as true and ensure we flush the following frame at the end of this one. + */ + if (isProcessing) { + flushNextFrame = true; + return; + } + isProcessing = true; + // Swap this frame and the next to avoid GC + const prevFrame = thisFrame; + thisFrame = nextFrame; + nextFrame = prevFrame; + // Execute this frame + thisFrame.forEach(triggerCallback); + // Clear the frame so no callbacks remain. This is to avoid + // memory leaks should this render step not run for a while. + thisFrame.clear(); + isProcessing = false; + if (flushNextFrame) { + flushNextFrame = false; + step.process(frameData); + } + }, + }; + return step; + } + + const maxElapsed$1 = 40; + function createRenderBatcher(scheduleNextBatch, allowKeepAlive) { + let runNextFrame = false; + let useDefaultElapsed = true; + const state = { + delta: 0.0, + timestamp: 0.0, + isProcessing: false, + }; + const flagRunNextFrame = () => (runNextFrame = true); + const steps = stepsOrder.reduce((acc, key) => { + acc[key] = createRenderStep(flagRunNextFrame); + return acc; + }, {}); + const { setup, read, resolveKeyframes, preUpdate, update, preRender, render, postRender, } = steps; + const processBatch = () => { + const useManualTiming = MotionGlobalConfig.useManualTiming; + const timestamp = useManualTiming + ? state.timestamp + : performance.now(); + runNextFrame = false; + if (!useManualTiming) { + state.delta = useDefaultElapsed + ? 1000 / 60 + : Math.max(Math.min(timestamp - state.timestamp, maxElapsed$1), 1); + } + state.timestamp = timestamp; + state.isProcessing = true; + // Unrolled render loop for better per-frame performance + setup.process(state); + read.process(state); + resolveKeyframes.process(state); + preUpdate.process(state); + update.process(state); + preRender.process(state); + render.process(state); + postRender.process(state); + state.isProcessing = false; + if (runNextFrame && allowKeepAlive) { + useDefaultElapsed = false; + scheduleNextBatch(processBatch); + } + }; + const wake = () => { + runNextFrame = true; + useDefaultElapsed = true; + if (!state.isProcessing) { + scheduleNextBatch(processBatch); + } + }; + const schedule = stepsOrder.reduce((acc, key) => { + const step = steps[key]; + acc[key] = (process, keepAlive = false, immediate = false) => { + if (!runNextFrame) + wake(); + return step.schedule(process, keepAlive, immediate); + }; + return acc; + }, {}); + const cancel = (process) => { + for (let i = 0; i < stepsOrder.length; i++) { + steps[stepsOrder[i]].cancel(process); + } + }; + return { schedule, cancel, state, steps }; + } + + const { schedule: frame, cancel: cancelFrame, state: frameData, steps: frameSteps, } = /* @__PURE__ */ createRenderBatcher(typeof requestAnimationFrame !== "undefined" ? requestAnimationFrame : noop, true); + + let now; + function clearTime() { + now = undefined; + } + /** + * An eventloop-synchronous alternative to performance.now(). + * + * Ensures that time measurements remain consistent within a synchronous context. + * Usually calling performance.now() twice within the same synchronous context + * will return different values which isn't useful for animations when we're usually + * trying to sync animations to the same frame. + */ + const time = { + now: () => { + if (now === undefined) { + time.set(frameData.isProcessing || MotionGlobalConfig.useManualTiming + ? frameData.timestamp + : performance.now()); + } + return now; + }, + set: (newTime) => { + now = newTime; + queueMicrotask(clearTime); + }, + }; + + const checkStringStartsWith = (token) => (key) => typeof key === "string" && key.startsWith(token); + const isCSSVariableName = + /*@__PURE__*/ checkStringStartsWith("--"); + const startsAsVariableToken = + /*@__PURE__*/ checkStringStartsWith("var(--"); + const isCSSVariableToken = (value) => { + const startsWithToken = startsAsVariableToken(value); + if (!startsWithToken) + return false; + // Ensure any comments are stripped from the value as this can harm performance of the regex. + return singleCssVariableRegex.test(value.split("/*")[0].trim()); + }; + const singleCssVariableRegex = /var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu; + /** + * Check if a value contains a CSS variable anywhere (e.g. inside calc()). + * Unlike isCSSVariableToken which checks if the value IS a var() token, + * this checks if the value CONTAINS var() somewhere in the string. + */ + function containsCSSVariable(value) { + if (typeof value !== "string") + return false; + // Strip comments to avoid false positives + return value.split("/*")[0].includes("var(--"); + } + + const number = { + test: (v) => typeof v === "number", + parse: parseFloat, + transform: (v) => v, + }; + const alpha = { + ...number, + transform: (v) => clamp(0, 1, v), + }; + const scale = { + ...number, + default: 1, + }; + + // If this number is a decimal, make it just five decimal places + // to avoid exponents + const sanitize = (v) => Math.round(v * 100000) / 100000; + + const floatRegex = /-?(?:\d+(?:\.\d+)?|\.\d+)/gu; + + function isNullish(v) { + return v == null; + } + + const singleColorRegex = /^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu; + + /** + * Returns true if the provided string is a color, ie rgba(0,0,0,0) or #000, + * but false if a number or multiple colors + */ + const isColorString = (type, testProp) => (v) => { + return Boolean((typeof v === "string" && + singleColorRegex.test(v) && + v.startsWith(type)) || + (testProp && + !isNullish(v) && + Object.prototype.hasOwnProperty.call(v, testProp))); + }; + const splitColor = (aName, bName, cName) => (v) => { + if (typeof v !== "string") + return v; + const [a, b, c, alpha] = v.match(floatRegex); + return { + [aName]: parseFloat(a), + [bName]: parseFloat(b), + [cName]: parseFloat(c), + alpha: alpha !== undefined ? parseFloat(alpha) : 1, + }; + }; + + const clampRgbUnit = (v) => clamp(0, 255, v); + const rgbUnit = { + ...number, + transform: (v) => Math.round(clampRgbUnit(v)), + }; + const rgba = { + test: /*@__PURE__*/ isColorString("rgb", "red"), + parse: /*@__PURE__*/ splitColor("red", "green", "blue"), + transform: ({ red, green, blue, alpha: alpha$1 = 1 }) => "rgba(" + + rgbUnit.transform(red) + + ", " + + rgbUnit.transform(green) + + ", " + + rgbUnit.transform(blue) + + ", " + + sanitize(alpha.transform(alpha$1)) + + ")", + }; + + function parseHex(v) { + let r = ""; + let g = ""; + let b = ""; + let a = ""; + // If we have 6 characters, ie #FF0000 + if (v.length > 5) { + r = v.substring(1, 3); + g = v.substring(3, 5); + b = v.substring(5, 7); + a = v.substring(7, 9); + // Or we have 3 characters, ie #F00 + } + else { + r = v.substring(1, 2); + g = v.substring(2, 3); + b = v.substring(3, 4); + a = v.substring(4, 5); + r += r; + g += g; + b += b; + a += a; + } + return { + red: parseInt(r, 16), + green: parseInt(g, 16), + blue: parseInt(b, 16), + alpha: a ? parseInt(a, 16) / 255 : 1, + }; + } + const hex = { + test: /*@__PURE__*/ isColorString("#"), + parse: parseHex, + transform: rgba.transform, + }; + + /*#__NO_SIDE_EFFECTS__*/ + const createUnitType = (unit) => ({ + test: (v) => typeof v === "string" && v.endsWith(unit) && v.split(" ").length === 1, + parse: parseFloat, + transform: (v) => `${v}${unit}`, + }); + const degrees = /*@__PURE__*/ createUnitType("deg"); + const percent = /*@__PURE__*/ createUnitType("%"); + const px = /*@__PURE__*/ createUnitType("px"); + const vh = /*@__PURE__*/ createUnitType("vh"); + const vw = /*@__PURE__*/ createUnitType("vw"); + const progressPercentage = /*@__PURE__*/ (() => ({ + ...percent, + parse: (v) => percent.parse(v) / 100, + transform: (v) => percent.transform(v * 100), + }))(); + + const hsla = { + test: /*@__PURE__*/ isColorString("hsl", "hue"), + parse: /*@__PURE__*/ splitColor("hue", "saturation", "lightness"), + transform: ({ hue, saturation, lightness, alpha: alpha$1 = 1 }) => { + return ("hsla(" + + Math.round(hue) + + ", " + + percent.transform(sanitize(saturation)) + + ", " + + percent.transform(sanitize(lightness)) + + ", " + + sanitize(alpha.transform(alpha$1)) + + ")"); + }, + }; + + const color = { + test: (v) => rgba.test(v) || hex.test(v) || hsla.test(v), + parse: (v) => { + if (rgba.test(v)) { + return rgba.parse(v); + } + else if (hsla.test(v)) { + return hsla.parse(v); + } + else { + return hex.parse(v); + } + }, + transform: (v) => { + return typeof v === "string" + ? v + : v.hasOwnProperty("red") + ? rgba.transform(v) + : hsla.transform(v); + }, + getAnimatableNone: (v) => { + const parsed = color.parse(v); + parsed.alpha = 0; + return color.transform(parsed); + }, + }; + + const colorRegex = /(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu; + + function test(v) { + return (isNaN(v) && + typeof v === "string" && + (v.match(floatRegex)?.length || 0) + + (v.match(colorRegex)?.length || 0) > + 0); + } + const NUMBER_TOKEN = "number"; + const COLOR_TOKEN = "color"; + const VAR_TOKEN = "var"; + const VAR_FUNCTION_TOKEN = "var("; + const SPLIT_TOKEN = "${}"; + // this regex consists of the `singleCssVariableRegex|rgbHSLValueRegex|digitRegex` + const complexRegex = /var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu; + function analyseComplexValue(value) { + const originalValue = value.toString(); + const values = []; + const indexes = { + color: [], + number: [], + var: [], + }; + const types = []; + let i = 0; + const tokenised = originalValue.replace(complexRegex, (parsedValue) => { + if (color.test(parsedValue)) { + indexes.color.push(i); + types.push(COLOR_TOKEN); + values.push(color.parse(parsedValue)); + } + else if (parsedValue.startsWith(VAR_FUNCTION_TOKEN)) { + indexes.var.push(i); + types.push(VAR_TOKEN); + values.push(parsedValue); + } + else { + indexes.number.push(i); + types.push(NUMBER_TOKEN); + values.push(parseFloat(parsedValue)); + } + ++i; + return SPLIT_TOKEN; + }); + const split = tokenised.split(SPLIT_TOKEN); + return { values, split, indexes, types }; + } + function parseComplexValue(v) { + return analyseComplexValue(v).values; + } + function buildTransformer({ split, types }) { + const numSections = split.length; + return (v) => { + let output = ""; + for (let i = 0; i < numSections; i++) { + output += split[i]; + if (v[i] !== undefined) { + const type = types[i]; + if (type === NUMBER_TOKEN) { + output += sanitize(v[i]); + } + else if (type === COLOR_TOKEN) { + output += color.transform(v[i]); + } + else { + output += v[i]; + } + } + } + return output; + }; + } + function createTransformer(source) { + return buildTransformer(analyseComplexValue(source)); + } + const convertNumbersToZero = (v) => typeof v === "number" ? 0 : color.test(v) ? color.getAnimatableNone(v) : v; + /** + * Convert a parsed value to its zero equivalent, but preserve numbers + * that act as divisors in CSS calc() expressions. + * + * analyseComplexValue extracts numbers from CSS strings and puts the + * surrounding text into a `split` template array. For example: + * "calc(var(--gap) / 5)" → values: [var(--gap), 5] + * split: ["calc(", " / ", ")"] + * + * When building a zero-equivalent for animation, naively zeroing all + * numbers turns the divisor into 0 → "calc(var(--gap) / 0)" → NaN. + * We detect this by checking whether the text preceding a number + * (split[i]) ends with "/" — the CSS calc division operator. + */ + const convertToZero = (value, splitBefore) => { + if (typeof value === "number") { + return splitBefore?.trim().endsWith("/") ? value : 0; + } + return convertNumbersToZero(value); + }; + function getAnimatableNone$1(v) { + const info = analyseComplexValue(v); + const transformer = buildTransformer(info); + return transformer(info.values.map((value, i) => convertToZero(value, info.split[i]))); + } + const complex = { + test, + parse: parseComplexValue, + createTransformer, + getAnimatableNone: getAnimatableNone$1, + }; + + // Adapted from https://gist.github.com/mjackson/5311256 + function hueToRgb(p, q, t) { + if (t < 0) + t += 1; + if (t > 1) + t -= 1; + if (t < 1 / 6) + return p + (q - p) * 6 * t; + if (t < 1 / 2) + return q; + if (t < 2 / 3) + return p + (q - p) * (2 / 3 - t) * 6; + return p; + } + function hslaToRgba({ hue, saturation, lightness, alpha }) { + hue /= 360; + saturation /= 100; + lightness /= 100; + let red = 0; + let green = 0; + let blue = 0; + if (!saturation) { + red = green = blue = lightness; + } + else { + const q = lightness < 0.5 + ? lightness * (1 + saturation) + : lightness + saturation - lightness * saturation; + const p = 2 * lightness - q; + red = hueToRgb(p, q, hue + 1 / 3); + green = hueToRgb(p, q, hue); + blue = hueToRgb(p, q, hue - 1 / 3); + } + return { + red: Math.round(red * 255), + green: Math.round(green * 255), + blue: Math.round(blue * 255), + alpha, + }; + } + + function mixImmediate(a, b) { + return (p) => (p > 0 ? b : a); + } + + /* + Value in range from progress + + Given a lower limit and an upper limit, we return the value within + that range as expressed by progress (usually a number from 0 to 1) + + So progress = 0.5 would change + + from -------- to + + to + + from ---- to + + E.g. from = 10, to = 20, progress = 0.5 => 15 + + @param [number]: Lower limit of range + @param [number]: Upper limit of range + @param [number]: The progress between lower and upper limits expressed 0-1 + @return [number]: Value as calculated from progress within range (not limited within range) + */ + const mixNumber$1 = (from, to, progress) => { + return from + (to - from) * progress; + }; + + // Linear color space blending + // Explained https://www.youtube.com/watch?v=LKnqECcg6Gw + // Demonstrated http://codepen.io/osublake/pen/xGVVaN + const mixLinearColor = (from, to, v) => { + const fromExpo = from * from; + const expo = v * (to * to - fromExpo) + fromExpo; + return expo < 0 ? 0 : Math.sqrt(expo); + }; + const colorTypes = [hex, rgba, hsla]; + const getColorType = (v) => colorTypes.find((type) => type.test(v)); + function asRGBA(color) { + const type = getColorType(color); + exports.warning(Boolean(type), `'${color}' is not an animatable color. Use the equivalent color code instead.`, "color-not-animatable"); + if (!Boolean(type)) + return false; + let model = type.parse(color); + if (type === hsla) { + // TODO Remove this cast - needed since Motion's stricter typing + model = hslaToRgba(model); + } + return model; + } + const mixColor = (from, to) => { + const fromRGBA = asRGBA(from); + const toRGBA = asRGBA(to); + if (!fromRGBA || !toRGBA) { + return mixImmediate(from, to); + } + const blended = { ...fromRGBA }; + return (v) => { + blended.red = mixLinearColor(fromRGBA.red, toRGBA.red, v); + blended.green = mixLinearColor(fromRGBA.green, toRGBA.green, v); + blended.blue = mixLinearColor(fromRGBA.blue, toRGBA.blue, v); + blended.alpha = mixNumber$1(fromRGBA.alpha, toRGBA.alpha, v); + return rgba.transform(blended); + }; + }; + + const invisibleValues = new Set(["none", "hidden"]); + /** + * Returns a function that, when provided a progress value between 0 and 1, + * will return the "none" or "hidden" string only when the progress is that of + * the origin or target. + */ + function mixVisibility(origin, target) { + if (invisibleValues.has(origin)) { + return (p) => (p <= 0 ? origin : target); + } + else { + return (p) => (p >= 1 ? target : origin); + } + } + + function mixNumber(a, b) { + return (p) => mixNumber$1(a, b, p); + } + function getMixer(a) { + if (typeof a === "number") { + return mixNumber; + } + else if (typeof a === "string") { + return isCSSVariableToken(a) + ? mixImmediate + : color.test(a) + ? mixColor + : mixComplex; + } + else if (Array.isArray(a)) { + return mixArray; + } + else if (typeof a === "object") { + return color.test(a) ? mixColor : mixObject; + } + return mixImmediate; + } + function mixArray(a, b) { + const output = [...a]; + const numValues = output.length; + const blendValue = a.map((v, i) => getMixer(v)(v, b[i])); + return (p) => { + for (let i = 0; i < numValues; i++) { + output[i] = blendValue[i](p); + } + return output; + }; + } + function mixObject(a, b) { + const output = { ...a, ...b }; + const blendValue = {}; + for (const key in output) { + if (a[key] !== undefined && b[key] !== undefined) { + blendValue[key] = getMixer(a[key])(a[key], b[key]); + } + } + return (v) => { + for (const key in blendValue) { + output[key] = blendValue[key](v); + } + return output; + }; + } + function matchOrder(origin, target) { + const orderedOrigin = []; + const pointers = { color: 0, var: 0, number: 0 }; + for (let i = 0; i < target.values.length; i++) { + const type = target.types[i]; + const originIndex = origin.indexes[type][pointers[type]]; + const originValue = origin.values[originIndex] ?? 0; + orderedOrigin[i] = originValue; + pointers[type]++; + } + return orderedOrigin; + } + const mixComplex = (origin, target) => { + const template = complex.createTransformer(target); + const originStats = analyseComplexValue(origin); + const targetStats = analyseComplexValue(target); + const canInterpolate = originStats.indexes.var.length === targetStats.indexes.var.length && + originStats.indexes.color.length === targetStats.indexes.color.length && + originStats.indexes.number.length >= targetStats.indexes.number.length; + if (canInterpolate) { + if ((invisibleValues.has(origin) && + !targetStats.values.length) || + (invisibleValues.has(target) && + !originStats.values.length)) { + return mixVisibility(origin, target); + } + return pipe(mixArray(matchOrder(originStats, targetStats), targetStats.values), template); + } + else { + exports.warning(true, `Complex values '${origin}' and '${target}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`, "complex-values-different"); + return mixImmediate(origin, target); + } + }; + + function mix(from, to, p) { + if (typeof from === "number" && + typeof to === "number" && + typeof p === "number") { + return mixNumber$1(from, to, p); + } + const mixer = getMixer(from); + return mixer(from, to); + } + + const frameloopDriver = (update) => { + const passTimestamp = ({ timestamp }) => update(timestamp); + return { + start: (keepAlive = true) => frame.update(passTimestamp, keepAlive), + stop: () => cancelFrame(passTimestamp), + /** + * If we're processing this frame we can use the + * framelocked timestamp to keep things in sync. + */ + now: () => (frameData.isProcessing ? frameData.timestamp : time.now()), + }; + }; + + const generateLinearEasing = (easing, duration, // as milliseconds + resolution = 10 // as milliseconds + ) => { + let points = ""; + const numPoints = Math.max(Math.round(duration / resolution), 2); + for (let i = 0; i < numPoints; i++) { + points += Math.round(easing(i / (numPoints - 1)) * 10000) / 10000 + ", "; + } + return `linear(${points.substring(0, points.length - 2)})`; + }; + + /** + * Implement a practical max duration for keyframe generation + * to prevent infinite loops + */ + const maxGeneratorDuration = 20000; + function calcGeneratorDuration(generator) { + let duration = 0; + const timeStep = 50; + let state = generator.next(duration); + while (!state.done && duration < maxGeneratorDuration) { + duration += timeStep; + state = generator.next(duration); + } + return duration >= maxGeneratorDuration ? Infinity : duration; + } + + /** + * Create a progress => progress easing function from a generator. + */ + function createGeneratorEasing(options, scale = 100, createGenerator) { + const generator = createGenerator({ ...options, keyframes: [0, scale] }); + const duration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration); + return { + type: "keyframes", + ease: (progress) => { + return generator.next(duration * progress).value / scale; + }, + duration: millisecondsToSeconds(duration), + }; + } + + const springDefaults = { + // Default spring physics + stiffness: 100, + damping: 10, + mass: 1.0, + velocity: 0.0, + // Default duration/bounce-based options + duration: 800, // in ms + bounce: 0.3, + visualDuration: 0.3, // in seconds + // Rest thresholds + restSpeed: { + granular: 0.01, + default: 2, + }, + restDelta: { + granular: 0.005, + default: 0.5, + }, + // Limits + minDuration: 0.01, // in seconds + maxDuration: 10.0, // in seconds + minDamping: 0.05, + maxDamping: 1, + }; + function calcAngularFreq(undampedFreq, dampingRatio) { + return undampedFreq * Math.sqrt(1 - dampingRatio * dampingRatio); + } + const rootIterations = 12; + function approximateRoot(envelope, derivative, initialGuess) { + let result = initialGuess; + for (let i = 1; i < rootIterations; i++) { + result = result - envelope(result) / derivative(result); + } + return result; + } + /** + * This is ported from the Framer implementation of duration-based spring resolution. + */ + const safeMin = 0.001; + function findSpring({ duration = springDefaults.duration, bounce = springDefaults.bounce, velocity = springDefaults.velocity, mass = springDefaults.mass, }) { + let envelope; + let derivative; + exports.warning(duration <= secondsToMilliseconds(springDefaults.maxDuration), "Spring duration must be 10 seconds or less", "spring-duration-limit"); + let dampingRatio = 1 - bounce; + /** + * Restrict dampingRatio and duration to within acceptable ranges. + */ + dampingRatio = clamp(springDefaults.minDamping, springDefaults.maxDamping, dampingRatio); + duration = clamp(springDefaults.minDuration, springDefaults.maxDuration, millisecondsToSeconds(duration)); + if (dampingRatio < 1) { + /** + * Underdamped spring + */ + envelope = (undampedFreq) => { + const exponentialDecay = undampedFreq * dampingRatio; + const delta = exponentialDecay * duration; + const a = exponentialDecay - velocity; + const b = calcAngularFreq(undampedFreq, dampingRatio); + const c = Math.exp(-delta); + return safeMin - (a / b) * c; + }; + derivative = (undampedFreq) => { + const exponentialDecay = undampedFreq * dampingRatio; + const delta = exponentialDecay * duration; + const d = delta * velocity + velocity; + const e = Math.pow(dampingRatio, 2) * Math.pow(undampedFreq, 2) * duration; + const f = Math.exp(-delta); + const g = calcAngularFreq(Math.pow(undampedFreq, 2), dampingRatio); + const factor = -envelope(undampedFreq) + safeMin > 0 ? -1 : 1; + return (factor * ((d - e) * f)) / g; + }; + } + else { + /** + * Critically-damped spring + */ + envelope = (undampedFreq) => { + const a = Math.exp(-undampedFreq * duration); + const b = (undampedFreq - velocity) * duration + 1; + return -safeMin + a * b; + }; + derivative = (undampedFreq) => { + const a = Math.exp(-undampedFreq * duration); + const b = (velocity - undampedFreq) * (duration * duration); + return a * b; + }; + } + const initialGuess = 5 / duration; + const undampedFreq = approximateRoot(envelope, derivative, initialGuess); + duration = secondsToMilliseconds(duration); + if (isNaN(undampedFreq)) { + return { + stiffness: springDefaults.stiffness, + damping: springDefaults.damping, + duration, + }; + } + else { + const stiffness = Math.pow(undampedFreq, 2) * mass; + return { + stiffness, + damping: dampingRatio * 2 * Math.sqrt(mass * stiffness), + duration, + }; + } + } + const durationKeys = ["duration", "bounce"]; + const physicsKeys = ["stiffness", "damping", "mass"]; + function isSpringType(options, keys) { + return keys.some((key) => options[key] !== undefined); + } + function getSpringOptions(options) { + let springOptions = { + velocity: springDefaults.velocity, + stiffness: springDefaults.stiffness, + damping: springDefaults.damping, + mass: springDefaults.mass, + isResolvedFromDuration: false, + ...options, + }; + // stiffness/damping/mass overrides duration/bounce + if (!isSpringType(options, physicsKeys) && + isSpringType(options, durationKeys)) { + // Time-defined springs should ignore inherited velocity. + // Velocity from interrupted animations can cause findSpring() + // to compute wildly different spring parameters, leading to + // massive oscillation on small-range animations. + springOptions.velocity = 0; + if (options.visualDuration) { + const visualDuration = options.visualDuration; + const root = (2 * Math.PI) / (visualDuration * 1.2); + const stiffness = root * root; + const damping = 2 * + clamp(0.05, 1, 1 - (options.bounce || 0)) * + Math.sqrt(stiffness); + springOptions = { + ...springOptions, + mass: springDefaults.mass, + stiffness, + damping, + }; + } + else { + const derived = findSpring({ ...options, velocity: 0 }); + springOptions = { + ...springOptions, + ...derived, + mass: springDefaults.mass, + }; + springOptions.isResolvedFromDuration = true; + } + } + return springOptions; + } + function spring(optionsOrVisualDuration = springDefaults.visualDuration, bounce = springDefaults.bounce) { + const options = typeof optionsOrVisualDuration !== "object" + ? { + visualDuration: optionsOrVisualDuration, + keyframes: [0, 1], + bounce, + } + : optionsOrVisualDuration; + let { restSpeed, restDelta } = options; + const origin = options.keyframes[0]; + const target = options.keyframes[options.keyframes.length - 1]; + /** + * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator + * to reduce GC during animation. + */ + const state = { done: false, value: origin }; + const { stiffness, damping, mass, duration, velocity, isResolvedFromDuration, } = getSpringOptions({ + ...options, + velocity: -millisecondsToSeconds(options.velocity || 0), + }); + const initialVelocity = velocity || 0.0; + const dampingRatio = damping / (2 * Math.sqrt(stiffness * mass)); + const initialDelta = target - origin; + const undampedAngularFreq = millisecondsToSeconds(Math.sqrt(stiffness / mass)); + /** + * If we're working on a granular scale, use smaller defaults for determining + * when the spring is finished. + * + * These defaults have been selected emprically based on what strikes a good + * ratio between feeling good and finishing as soon as changes are imperceptible. + */ + const isGranularScale = Math.abs(initialDelta) < 5; + restSpeed || (restSpeed = isGranularScale + ? springDefaults.restSpeed.granular + : springDefaults.restSpeed.default); + restDelta || (restDelta = isGranularScale + ? springDefaults.restDelta.granular + : springDefaults.restDelta.default); + let resolveSpring; + let resolveVelocity; + // Underdamped coefficients, hoisted for use in the inlined next() hot path + let angularFreq; + let A; + let sinCoeff; + let cosCoeff; + if (dampingRatio < 1) { + angularFreq = calcAngularFreq(undampedAngularFreq, dampingRatio); + A = + (initialVelocity + + dampingRatio * undampedAngularFreq * initialDelta) / + angularFreq; + // Underdamped spring + resolveSpring = (t) => { + const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); + return (target - + envelope * + (A * Math.sin(angularFreq * t) + + initialDelta * Math.cos(angularFreq * t))); + }; + // Analytical derivative of underdamped spring (px/ms) + sinCoeff = + dampingRatio * undampedAngularFreq * A + initialDelta * angularFreq; + cosCoeff = + dampingRatio * undampedAngularFreq * initialDelta - A * angularFreq; + resolveVelocity = (t) => { + const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); + return envelope * + (sinCoeff * Math.sin(angularFreq * t) + + cosCoeff * Math.cos(angularFreq * t)); + }; + } + else if (dampingRatio === 1) { + // Critically damped spring + resolveSpring = (t) => target - + Math.exp(-undampedAngularFreq * t) * + (initialDelta + + (initialVelocity + undampedAngularFreq * initialDelta) * t); + // Analytical derivative of critically damped spring (px/ms) + const C = initialVelocity + undampedAngularFreq * initialDelta; + resolveVelocity = (t) => Math.exp(-undampedAngularFreq * t) * + (undampedAngularFreq * C * t - initialVelocity); + } + else { + // Overdamped spring + const dampedAngularFreq = undampedAngularFreq * Math.sqrt(dampingRatio * dampingRatio - 1); + resolveSpring = (t) => { + const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); + // When performing sinh or cosh values can hit Infinity so we cap them here + const freqForT = Math.min(dampedAngularFreq * t, 300); + return (target - + (envelope * + ((initialVelocity + + dampingRatio * undampedAngularFreq * initialDelta) * + Math.sinh(freqForT) + + dampedAngularFreq * + initialDelta * + Math.cosh(freqForT))) / + dampedAngularFreq); + }; + // Analytical derivative of overdamped spring (px/ms) + const P = (initialVelocity + + dampingRatio * undampedAngularFreq * initialDelta) / + dampedAngularFreq; + const sinhCoeff = dampingRatio * undampedAngularFreq * P - initialDelta * dampedAngularFreq; + const coshCoeff = dampingRatio * undampedAngularFreq * initialDelta - P * dampedAngularFreq; + resolveVelocity = (t) => { + const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); + const freqForT = Math.min(dampedAngularFreq * t, 300); + return envelope * + (sinhCoeff * Math.sinh(freqForT) + + coshCoeff * Math.cosh(freqForT)); + }; + } + const generator = { + calculatedDuration: isResolvedFromDuration ? duration || null : null, + velocity: (t) => secondsToMilliseconds(resolveVelocity(t)), + next: (t) => { + /** + * For underdamped physics springs we need both position and + * velocity each tick. Compute shared trig values once to avoid + * duplicate Math.exp/sin/cos calls on the hot path. + */ + if (!isResolvedFromDuration && dampingRatio < 1) { + const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); + const sin = Math.sin(angularFreq * t); + const cos = Math.cos(angularFreq * t); + const current = target - + envelope * + (A * sin + initialDelta * cos); + const currentVelocity = secondsToMilliseconds(envelope * + (sinCoeff * sin + cosCoeff * cos)); + state.done = + Math.abs(currentVelocity) <= restSpeed && + Math.abs(target - current) <= restDelta; + state.value = state.done ? target : current; + return state; + } + const current = resolveSpring(t); + if (!isResolvedFromDuration) { + const currentVelocity = secondsToMilliseconds(resolveVelocity(t)); + state.done = + Math.abs(currentVelocity) <= restSpeed && + Math.abs(target - current) <= restDelta; + } + else { + state.done = t >= duration; + } + state.value = state.done ? target : current; + return state; + }, + toString: () => { + const calculatedDuration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration); + const easing = generateLinearEasing((progress) => generator.next(calculatedDuration * progress).value, calculatedDuration, 30); + return calculatedDuration + "ms " + easing; + }, + toTransition: () => { }, + }; + return generator; + } + spring.applyToOptions = (options) => { + const generatorOptions = createGeneratorEasing(options, 100, spring); + options.ease = generatorOptions.ease; + options.duration = secondsToMilliseconds(generatorOptions.duration); + options.type = "keyframes"; + return options; + }; + + const velocitySampleDuration = 5; // ms + function getGeneratorVelocity(resolveValue, t, current) { + const prevT = Math.max(t - velocitySampleDuration, 0); + return velocityPerSecond(current - resolveValue(prevT), t - prevT); + } + + function inertia({ keyframes, velocity = 0.0, power = 0.8, timeConstant = 325, bounceDamping = 10, bounceStiffness = 500, modifyTarget, min, max, restDelta = 0.5, restSpeed, }) { + const origin = keyframes[0]; + const state = { + done: false, + value: origin, + }; + const isOutOfBounds = (v) => (min !== undefined && v < min) || (max !== undefined && v > max); + const nearestBoundary = (v) => { + if (min === undefined) + return max; + if (max === undefined) + return min; + return Math.abs(min - v) < Math.abs(max - v) ? min : max; + }; + let amplitude = power * velocity; + const ideal = origin + amplitude; + const target = modifyTarget === undefined ? ideal : modifyTarget(ideal); + /** + * If the target has changed we need to re-calculate the amplitude, otherwise + * the animation will start from the wrong position. + */ + if (target !== ideal) + amplitude = target - origin; + const calcDelta = (t) => -amplitude * Math.exp(-t / timeConstant); + const calcLatest = (t) => target + calcDelta(t); + const applyFriction = (t) => { + const delta = calcDelta(t); + const latest = calcLatest(t); + state.done = Math.abs(delta) <= restDelta; + state.value = state.done ? target : latest; + }; + /** + * Ideally this would resolve for t in a stateless way, we could + * do that by always precalculating the animation but as we know + * this will be done anyway we can assume that spring will + * be discovered during that. + */ + let timeReachedBoundary; + let spring$1; + const checkCatchBoundary = (t) => { + if (!isOutOfBounds(state.value)) + return; + timeReachedBoundary = t; + spring$1 = spring({ + keyframes: [state.value, nearestBoundary(state.value)], + velocity: getGeneratorVelocity(calcLatest, t, state.value), // TODO: This should be passing * 1000 + damping: bounceDamping, + stiffness: bounceStiffness, + restDelta, + restSpeed, + }); + }; + checkCatchBoundary(0); + return { + calculatedDuration: null, + next: (t) => { + /** + * We need to resolve the friction to figure out if we need a + * spring but we don't want to do this twice per frame. So here + * we flag if we updated for this frame and later if we did + * we can skip doing it again. + */ + let hasUpdatedFrame = false; + if (!spring$1 && timeReachedBoundary === undefined) { + hasUpdatedFrame = true; + applyFriction(t); + checkCatchBoundary(t); + } + /** + * If we have a spring and the provided t is beyond the moment the friction + * animation crossed the min/max boundary, use the spring. + */ + if (timeReachedBoundary !== undefined && t >= timeReachedBoundary) { + return spring$1.next(t - timeReachedBoundary); + } + else { + !hasUpdatedFrame && applyFriction(t); + return state; + } + }, + }; + } + + function createMixers(output, ease, customMixer) { + const mixers = []; + const mixerFactory = customMixer || MotionGlobalConfig.mix || mix; + const numMixers = output.length - 1; + for (let i = 0; i < numMixers; i++) { + let mixer = mixerFactory(output[i], output[i + 1]); + if (ease) { + const easingFunction = Array.isArray(ease) ? ease[i] || noop : ease; + mixer = pipe(easingFunction, mixer); + } + mixers.push(mixer); + } + return mixers; + } + /** + * Create a function that maps from a numerical input array to a generic output array. + * + * Accepts: + * - Numbers + * - Colors (hex, hsl, hsla, rgb, rgba) + * - Complex (combinations of one or more numbers or strings) + * + * ```jsx + * const mixColor = interpolate([0, 1], ['#fff', '#000']) + * + * mixColor(0.5) // 'rgba(128, 128, 128, 1)' + * ``` + * + * TODO Revisit this approach once we've moved to data models for values, + * probably not needed to pregenerate mixer functions. + * + * @public + */ + function interpolate(input, output, { clamp: isClamp = true, ease, mixer } = {}) { + const inputLength = input.length; + exports.invariant(inputLength === output.length, "Both input and output ranges must be the same length", "range-length"); + /** + * If we're only provided a single input, we can just make a function + * that returns the output. + */ + if (inputLength === 1) + return () => output[0]; + if (inputLength === 2 && output[0] === output[1]) + return () => output[1]; + const isZeroDeltaRange = input[0] === input[1]; + // If input runs highest -> lowest, reverse both arrays + if (input[0] > input[inputLength - 1]) { + input = [...input].reverse(); + output = [...output].reverse(); + } + const mixers = createMixers(output, ease, mixer); + const numMixers = mixers.length; + const interpolator = (v) => { + if (isZeroDeltaRange && v < input[0]) + return output[0]; + let i = 0; + if (numMixers > 1) { + for (; i < input.length - 2; i++) { + if (v < input[i + 1]) + break; + } + } + const progressInRange = progress(input[i], input[i + 1], v); + return mixers[i](progressInRange); + }; + return isClamp + ? (v) => interpolator(clamp(input[0], input[inputLength - 1], v)) + : interpolator; + } + + function fillOffset(offset, remaining) { + const min = offset[offset.length - 1]; + for (let i = 1; i <= remaining; i++) { + const offsetProgress = progress(0, remaining, i); + offset.push(mixNumber$1(min, 1, offsetProgress)); + } + } + + function defaultOffset$1(arr) { + const offset = [0]; + fillOffset(offset, arr.length - 1); + return offset; + } + + function convertOffsetToTimes(offset, duration) { + return offset.map((o) => o * duration); + } + + function defaultEasing(values, easing) { + return values.map(() => easing || easeInOut).splice(0, values.length - 1); + } + function keyframes({ duration = 300, keyframes: keyframeValues, times, ease = "easeInOut", }) { + /** + * Easing functions can be externally defined as strings. Here we convert them + * into actual functions. + */ + const easingFunctions = isEasingArray(ease) + ? ease.map(easingDefinitionToFunction) + : easingDefinitionToFunction(ease); + /** + * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator + * to reduce GC during animation. + */ + const state = { + done: false, + value: keyframeValues[0], + }; + /** + * Create a times array based on the provided 0-1 offsets + */ + const absoluteTimes = convertOffsetToTimes( + // Only use the provided offsets if they're the correct length + // TODO Maybe we should warn here if there's a length mismatch + times && times.length === keyframeValues.length + ? times + : defaultOffset$1(keyframeValues), duration); + const mapTimeToKeyframe = interpolate(absoluteTimes, keyframeValues, { + ease: Array.isArray(easingFunctions) + ? easingFunctions + : defaultEasing(keyframeValues, easingFunctions), + }); + return { + calculatedDuration: duration, + next: (t) => { + state.value = mapTimeToKeyframe(t); + state.done = t >= duration; + return state; + }, + }; + } + + const isNotNull = (value) => value !== null; + function getFinalKeyframe(keyframes, { repeat, repeatType = "loop" }, finalKeyframe, speed = 1) { + const resolvedKeyframes = keyframes.filter(isNotNull); + const useFirstKeyframe = speed < 0 || (repeat && repeatType !== "loop" && repeat % 2 === 1); + const index = useFirstKeyframe ? 0 : resolvedKeyframes.length - 1; + return !index || finalKeyframe === undefined + ? resolvedKeyframes[index] + : finalKeyframe; + } + + const transitionTypeMap = { + decay: inertia, + inertia, + tween: keyframes, + keyframes: keyframes, + spring, + }; + function replaceTransitionType(transition) { + if (typeof transition.type === "string") { + transition.type = transitionTypeMap[transition.type]; + } + } + + class WithPromise { + constructor() { + this.updateFinished(); + } + get finished() { + return this._finished; + } + updateFinished() { + this._finished = new Promise((resolve) => { + this.resolve = resolve; + }); + } + notifyFinished() { + this.resolve(); + } + /** + * Allows the animation to be awaited. + * + * @deprecated Use `finished` instead. + */ + then(onResolve, onReject) { + return this.finished.then(onResolve, onReject); + } + } + + const percentToProgress = (percent) => percent / 100; + class JSAnimation extends WithPromise { + constructor(options) { + super(); + this.state = "idle"; + this.startTime = null; + this.isStopped = false; + /** + * The current time of the animation. + */ + this.currentTime = 0; + /** + * The time at which the animation was paused. + */ + this.holdTime = null; + /** + * Playback speed as a factor. 0 would be stopped, -1 reverse and 2 double speed. + */ + this.playbackSpeed = 1; + /** + * Reusable state object for the delay phase to avoid + * allocating a new object every frame. + */ + this.delayState = { + done: false, + value: undefined, + }; + /** + * This method is bound to the instance to fix a pattern where + * animation.stop is returned as a reference from a useEffect. + */ + this.stop = () => { + const { motionValue } = this.options; + if (motionValue && motionValue.updatedAt !== time.now()) { + this.tick(time.now()); + } + this.isStopped = true; + if (this.state === "idle") + return; + this.teardown(); + this.options.onStop?.(); + }; + this.options = options; + this.initAnimation(); + this.play(); + if (options.autoplay === false) + this.pause(); + } + initAnimation() { + const { options } = this; + replaceTransitionType(options); + const { type = keyframes, repeat = 0, repeatDelay = 0, repeatType, velocity = 0, } = options; + let { keyframes: keyframes$1 } = options; + const generatorFactory = type || keyframes; + if (generatorFactory !== keyframes) { + exports.invariant(keyframes$1.length <= 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${keyframes$1}`, "spring-two-frames"); + } + if (generatorFactory !== keyframes && + typeof keyframes$1[0] !== "number") { + this.mixKeyframes = pipe(percentToProgress, mix(keyframes$1[0], keyframes$1[1])); + keyframes$1 = [0, 100]; + } + const generator = generatorFactory({ ...options, keyframes: keyframes$1 }); + /** + * If we have a mirror repeat type we need to create a second generator that outputs the + * mirrored (not reversed) animation and later ping pong between the two generators. + */ + if (repeatType === "mirror") { + this.mirroredGenerator = generatorFactory({ + ...options, + keyframes: [...keyframes$1].reverse(), + velocity: -velocity, + }); + } + /** + * If duration is undefined and we have repeat options, + * we need to calculate a duration from the generator. + * + * We set it to the generator itself to cache the duration. + * Any timeline resolver will need to have already precalculated + * the duration by this step. + */ + if (generator.calculatedDuration === null) { + generator.calculatedDuration = calcGeneratorDuration(generator); + } + const { calculatedDuration } = generator; + this.calculatedDuration = calculatedDuration; + this.resolvedDuration = calculatedDuration + repeatDelay; + this.totalDuration = this.resolvedDuration * (repeat + 1) - repeatDelay; + this.generator = generator; + } + updateTime(timestamp) { + const animationTime = Math.round(timestamp - this.startTime) * this.playbackSpeed; + // Update currentTime + if (this.holdTime !== null) { + this.currentTime = this.holdTime; + } + else { + // Rounding the time because floating point arithmetic is not always accurate, e.g. 3000.367 - 1000.367 = + // 2000.0000000000002. This is a problem when we are comparing the currentTime with the duration, for + // example. + this.currentTime = animationTime; + } + } + tick(timestamp, sample = false) { + const { generator, totalDuration, mixKeyframes, mirroredGenerator, resolvedDuration, calculatedDuration, } = this; + if (this.startTime === null) + return generator.next(0); + const { delay = 0, keyframes, repeat, repeatType, repeatDelay, type, onUpdate, finalKeyframe, } = this.options; + /** + * requestAnimationFrame timestamps can come through as lower than + * the startTime as set by performance.now(). Here we prevent this, + * though in the future it could be possible to make setting startTime + * a pending operation that gets resolved here. + */ + if (this.speed > 0) { + this.startTime = Math.min(this.startTime, timestamp); + } + else if (this.speed < 0) { + this.startTime = Math.min(timestamp - totalDuration / this.speed, this.startTime); + } + if (sample) { + this.currentTime = timestamp; + } + else { + this.updateTime(timestamp); + } + // Rebase on delay + const timeWithoutDelay = this.currentTime - delay * (this.playbackSpeed >= 0 ? 1 : -1); + const isInDelayPhase = this.playbackSpeed >= 0 + ? timeWithoutDelay < 0 + : timeWithoutDelay > totalDuration; + this.currentTime = Math.max(timeWithoutDelay, 0); + // If this animation has finished, set the current time to the total duration. + if (this.state === "finished" && this.holdTime === null) { + this.currentTime = totalDuration; + } + let elapsed = this.currentTime; + let frameGenerator = generator; + if (repeat) { + /** + * Get the current progress (0-1) of the animation. If t is > + * than duration we'll get values like 2.5 (midway through the + * third iteration) + */ + const progress = Math.min(this.currentTime, totalDuration) / resolvedDuration; + /** + * Get the current iteration (0 indexed). For instance the floor of + * 2.5 is 2. + */ + let currentIteration = Math.floor(progress); + /** + * Get the current progress of the iteration by taking the remainder + * so 2.5 is 0.5 through iteration 2 + */ + let iterationProgress = progress % 1.0; + /** + * If iteration progress is 1 we count that as the end + * of the previous iteration. + */ + if (!iterationProgress && progress >= 1) { + iterationProgress = 1; + } + iterationProgress === 1 && currentIteration--; + currentIteration = Math.min(currentIteration, repeat + 1); + /** + * Reverse progress if we're not running in "normal" direction + */ + const isOddIteration = Boolean(currentIteration % 2); + if (isOddIteration) { + if (repeatType === "reverse") { + iterationProgress = 1 - iterationProgress; + if (repeatDelay) { + iterationProgress -= repeatDelay / resolvedDuration; + } + } + else if (repeatType === "mirror") { + frameGenerator = mirroredGenerator; + } + } + elapsed = clamp(0, 1, iterationProgress) * resolvedDuration; + } + /** + * If we're in negative time, set state as the initial keyframe. + * This prevents delay: x, duration: 0 animations from finishing + * instantly. + */ + let state; + if (isInDelayPhase) { + this.delayState.value = keyframes[0]; + state = this.delayState; + } + else { + state = frameGenerator.next(elapsed); + } + if (mixKeyframes && !isInDelayPhase) { + state.value = mixKeyframes(state.value); + } + let { done } = state; + if (!isInDelayPhase && calculatedDuration !== null) { + done = + this.playbackSpeed >= 0 + ? this.currentTime >= totalDuration + : this.currentTime <= 0; + } + const isAnimationFinished = this.holdTime === null && + (this.state === "finished" || (this.state === "running" && done)); + // TODO: The exception for inertia could be cleaner here + if (isAnimationFinished && type !== inertia) { + state.value = getFinalKeyframe(keyframes, this.options, finalKeyframe, this.speed); + } + if (onUpdate) { + onUpdate(state.value); + } + if (isAnimationFinished) { + this.finish(); + } + return state; + } + /** + * Allows the returned animation to be awaited or promise-chained. Currently + * resolves when the animation finishes at all but in a future update could/should + * reject if its cancels. + */ + then(resolve, reject) { + return this.finished.then(resolve, reject); + } + get duration() { + return millisecondsToSeconds(this.calculatedDuration); + } + get iterationDuration() { + const { delay = 0 } = this.options || {}; + return this.duration + millisecondsToSeconds(delay); + } + get time() { + return millisecondsToSeconds(this.currentTime); + } + set time(newTime) { + newTime = secondsToMilliseconds(newTime); + this.currentTime = newTime; + if (this.startTime === null || + this.holdTime !== null || + this.playbackSpeed === 0) { + this.holdTime = newTime; + } + else if (this.driver) { + this.startTime = this.driver.now() - newTime / this.playbackSpeed; + } + if (this.driver) { + this.driver.start(false); + } + else { + this.startTime = 0; + this.state = "paused"; + this.holdTime = newTime; + this.tick(newTime); + } + } + /** + * Returns the generator's velocity at the current time in units/second. + * Uses the analytical derivative when available (springs), avoiding + * the MotionValue's frame-dependent velocity estimation. + */ + getGeneratorVelocity() { + const t = this.currentTime; + if (t <= 0) + return this.options.velocity || 0; + if (this.generator.velocity) { + return this.generator.velocity(t); + } + // Fallback: finite difference + const current = this.generator.next(t).value; + return getGeneratorVelocity((s) => this.generator.next(s).value, t, current); + } + get speed() { + return this.playbackSpeed; + } + set speed(newSpeed) { + const hasChanged = this.playbackSpeed !== newSpeed; + if (hasChanged && this.driver) { + this.updateTime(time.now()); + } + this.playbackSpeed = newSpeed; + if (hasChanged && this.driver) { + this.time = millisecondsToSeconds(this.currentTime); + } + } + play() { + if (this.isStopped) + return; + const { driver = frameloopDriver, startTime } = this.options; + if (!this.driver) { + this.driver = driver((timestamp) => this.tick(timestamp)); + } + this.options.onPlay?.(); + const now = this.driver.now(); + if (this.state === "finished") { + this.updateFinished(); + this.startTime = now; + } + else if (this.holdTime !== null) { + this.startTime = now - this.holdTime; + } + else if (!this.startTime) { + this.startTime = startTime ?? now; + } + if (this.state === "finished" && this.speed < 0) { + this.startTime += this.calculatedDuration; + } + this.holdTime = null; + /** + * Set playState to running only after we've used it in + * the previous logic. + */ + this.state = "running"; + this.driver.start(); + } + pause() { + this.state = "paused"; + this.updateTime(time.now()); + this.holdTime = this.currentTime; + } + complete() { + if (this.state !== "running") { + this.play(); + } + this.state = "finished"; + this.holdTime = null; + } + finish() { + this.notifyFinished(); + this.teardown(); + this.state = "finished"; + this.options.onComplete?.(); + } + cancel() { + this.holdTime = null; + this.startTime = 0; + this.tick(0); + this.teardown(); + this.options.onCancel?.(); + } + teardown() { + this.state = "idle"; + this.stopDriver(); + this.startTime = this.holdTime = null; + } + stopDriver() { + if (!this.driver) + return; + this.driver.stop(); + this.driver = undefined; + } + sample(sampleTime) { + this.startTime = 0; + return this.tick(sampleTime, true); + } + attachTimeline(timeline) { + if (this.options.allowFlatten) { + this.options.type = "keyframes"; + this.options.ease = "linear"; + this.initAnimation(); + } + this.driver?.stop(); + return timeline.observe(this); + } + } + // Legacy function support + function animateValue(options) { + return new JSAnimation(options); + } + + function fillWildcards(keyframes) { + for (let i = 1; i < keyframes.length; i++) { + keyframes[i] ?? (keyframes[i] = keyframes[i - 1]); + } + } + + const radToDeg = (rad) => (rad * 180) / Math.PI; + const rotate = (v) => { + const angle = radToDeg(Math.atan2(v[1], v[0])); + return rebaseAngle(angle); + }; + const matrix2dParsers = { + x: 4, + y: 5, + translateX: 4, + translateY: 5, + scaleX: 0, + scaleY: 3, + scale: (v) => (Math.abs(v[0]) + Math.abs(v[3])) / 2, + rotate, + rotateZ: rotate, + skewX: (v) => radToDeg(Math.atan(v[1])), + skewY: (v) => radToDeg(Math.atan(v[2])), + skew: (v) => (Math.abs(v[1]) + Math.abs(v[2])) / 2, + }; + const rebaseAngle = (angle) => { + angle = angle % 360; + if (angle < 0) + angle += 360; + return angle; + }; + const rotateZ = rotate; + const scaleX = (v) => Math.sqrt(v[0] * v[0] + v[1] * v[1]); + const scaleY = (v) => Math.sqrt(v[4] * v[4] + v[5] * v[5]); + const matrix3dParsers = { + x: 12, + y: 13, + z: 14, + translateX: 12, + translateY: 13, + translateZ: 14, + scaleX, + scaleY, + scale: (v) => (scaleX(v) + scaleY(v)) / 2, + rotateX: (v) => rebaseAngle(radToDeg(Math.atan2(v[6], v[5]))), + rotateY: (v) => rebaseAngle(radToDeg(Math.atan2(-v[2], v[0]))), + rotateZ, + rotate: rotateZ, + skewX: (v) => radToDeg(Math.atan(v[4])), + skewY: (v) => radToDeg(Math.atan(v[1])), + skew: (v) => (Math.abs(v[1]) + Math.abs(v[4])) / 2, + }; + function defaultTransformValue(name) { + return name.includes("scale") ? 1 : 0; + } + function parseValueFromTransform(transform, name) { + if (!transform || transform === "none") { + return defaultTransformValue(name); + } + const matrix3dMatch = transform.match(/^matrix3d\(([-\d.e\s,]+)\)$/u); + let parsers; + let match; + if (matrix3dMatch) { + parsers = matrix3dParsers; + match = matrix3dMatch; + } + else { + const matrix2dMatch = transform.match(/^matrix\(([-\d.e\s,]+)\)$/u); + parsers = matrix2dParsers; + match = matrix2dMatch; + } + if (!match) { + return defaultTransformValue(name); + } + const valueParser = parsers[name]; + const values = match[1].split(",").map(convertTransformToNumber); + return typeof valueParser === "function" + ? valueParser(values) + : values[valueParser]; + } + const readTransformValue = (instance, name) => { + const { transform = "none" } = getComputedStyle(instance); + return parseValueFromTransform(transform, name); + }; + function convertTransformToNumber(value) { + return parseFloat(value.trim()); + } + + /** + * Generate a list of every possible transform key. + */ + const transformPropOrder = [ + "transformPerspective", + "x", + "y", + "z", + "translateX", + "translateY", + "translateZ", + "scale", + "scaleX", + "scaleY", + "rotate", + "rotateX", + "rotateY", + "rotateZ", + "skew", + "skewX", + "skewY", + ]; + /** + * A quick lookup for transform props. + * + * `pathRotation` is a transform for routing purposes (skipped from raw + * style application, wired to the transform composite, flags transform + * dirty) but is intentionally NOT in `transformPropOrder` — it is + * composed onto `rotate` at the build sites, not serialized in its own + * slot, and must stay out of the order-array consumers (parse-transform, + * unit-conversion, keys-position). + */ + const transformProps = /*@__PURE__*/ (() => new Set([...transformPropOrder, "pathRotation"]))(); + + const isNumOrPxType = (v) => v === number || v === px; + const transformKeys = new Set(["x", "y", "z"]); + const nonTranslationalTransformKeys = transformPropOrder.filter((key) => !transformKeys.has(key)); + function removeNonTranslationalTransform(visualElement) { + const removedTransforms = []; + nonTranslationalTransformKeys.forEach((key) => { + const value = visualElement.getValue(key); + if (value !== undefined) { + removedTransforms.push([key, value.get()]); + value.set(key.startsWith("scale") ? 1 : 0); + } + }); + return removedTransforms; + } + const positionalValues = { + // Dimensions + width: ({ x }, { paddingLeft = "0", paddingRight = "0", boxSizing }) => { + const width = x.max - x.min; + return boxSizing === "border-box" + ? width + : width - parseFloat(paddingLeft) - parseFloat(paddingRight); + }, + height: ({ y }, { paddingTop = "0", paddingBottom = "0", boxSizing }) => { + const height = y.max - y.min; + return boxSizing === "border-box" + ? height + : height - parseFloat(paddingTop) - parseFloat(paddingBottom); + }, + top: (_bbox, { top }) => parseFloat(top), + left: (_bbox, { left }) => parseFloat(left), + bottom: ({ y }, { top }) => parseFloat(top) + (y.max - y.min), + right: ({ x }, { left }) => parseFloat(left) + (x.max - x.min), + // Transform + x: (_bbox, { transform }) => parseValueFromTransform(transform, "x"), + y: (_bbox, { transform }) => parseValueFromTransform(transform, "y"), + }; + // Alias translate longform names + positionalValues.translateX = positionalValues.x; + positionalValues.translateY = positionalValues.y; + + const toResolve = new Set(); + let isScheduled = false; + let anyNeedsMeasurement = false; + let isForced = false; + function measureAllKeyframes() { + if (anyNeedsMeasurement) { + const resolversToMeasure = Array.from(toResolve).filter((resolver) => resolver.needsMeasurement); + const elementsToMeasure = new Set(resolversToMeasure.map((resolver) => resolver.element)); + const transformsToRestore = new Map(); + /** + * Write pass + * If we're measuring elements we want to remove bounding box-changing transforms. + */ + elementsToMeasure.forEach((element) => { + const removedTransforms = removeNonTranslationalTransform(element); + if (!removedTransforms.length) + return; + transformsToRestore.set(element, removedTransforms); + element.render(); + }); + // Read + resolversToMeasure.forEach((resolver) => resolver.measureInitialState()); + // Write + elementsToMeasure.forEach((element) => { + element.render(); + const restore = transformsToRestore.get(element); + if (restore) { + restore.forEach(([key, value]) => { + element.getValue(key)?.set(value); + }); + } + }); + // Read + resolversToMeasure.forEach((resolver) => resolver.measureEndState()); + // Write + resolversToMeasure.forEach((resolver) => { + if (resolver.suspendedScrollY !== undefined) { + window.scrollTo(0, resolver.suspendedScrollY); + } + }); + } + anyNeedsMeasurement = false; + isScheduled = false; + toResolve.forEach((resolver) => resolver.complete(isForced)); + toResolve.clear(); + } + function readAllKeyframes() { + toResolve.forEach((resolver) => { + resolver.readKeyframes(); + if (resolver.needsMeasurement) { + anyNeedsMeasurement = true; + } + }); + } + function flushKeyframeResolvers() { + isForced = true; + readAllKeyframes(); + measureAllKeyframes(); + isForced = false; + } + class KeyframeResolver { + constructor(unresolvedKeyframes, onComplete, name, motionValue, element, isAsync = false) { + this.state = "pending"; + /** + * Track whether this resolver is async. If it is, it'll be added to the + * resolver queue and flushed in the next frame. Resolvers that aren't going + * to trigger read/write thrashing don't need to be async. + */ + this.isAsync = false; + /** + * Track whether this resolver needs to perform a measurement + * to resolve its keyframes. + */ + this.needsMeasurement = false; + this.unresolvedKeyframes = [...unresolvedKeyframes]; + this.onComplete = onComplete; + this.name = name; + this.motionValue = motionValue; + this.element = element; + this.isAsync = isAsync; + } + scheduleResolve() { + this.state = "scheduled"; + if (this.isAsync) { + toResolve.add(this); + if (!isScheduled) { + isScheduled = true; + frame.read(readAllKeyframes); + frame.resolveKeyframes(measureAllKeyframes); + } + } + else { + this.readKeyframes(); + this.complete(); + } + } + readKeyframes() { + const { unresolvedKeyframes, name, element, motionValue } = this; + // If initial keyframe is null we need to read it from the DOM + if (unresolvedKeyframes[0] === null) { + const currentValue = motionValue?.get(); + // TODO: This doesn't work if the final keyframe is a wildcard + const finalKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1]; + if (currentValue !== undefined) { + unresolvedKeyframes[0] = currentValue; + } + else if (element && name) { + const valueAsRead = element.readValue(name, finalKeyframe); + if (valueAsRead !== undefined && valueAsRead !== null) { + unresolvedKeyframes[0] = valueAsRead; + } + } + if (unresolvedKeyframes[0] === undefined) { + unresolvedKeyframes[0] = finalKeyframe; + } + if (motionValue && currentValue === undefined) { + motionValue.set(unresolvedKeyframes[0]); + } + } + fillWildcards(unresolvedKeyframes); + } + setFinalKeyframe() { } + measureInitialState() { } + renderEndStyles() { } + measureEndState() { } + complete(isForcedComplete = false) { + this.state = "complete"; + this.onComplete(this.unresolvedKeyframes, this.finalKeyframe, isForcedComplete); + toResolve.delete(this); + } + cancel() { + if (this.state === "scheduled") { + toResolve.delete(this); + this.state = "pending"; + } + } + resume() { + if (this.state === "pending") + this.scheduleResolve(); + } + } + + const isCSSVar = (name) => name.startsWith("--"); + + function setStyle(element, name, value) { + isCSSVar(name) + ? element.style.setProperty(name, value) + : (element.style[name] = value); + } + + /** + * Add the ability for test suites to manually set support flags + * to better test more environments. + */ + const supportsFlags = {}; + + function memoSupports(callback, supportsFlag) { + const memoized = memo(callback); + return () => supportsFlags[supportsFlag] ?? memoized(); + } + + const supportsScrollTimeline = /* @__PURE__ */ memoSupports(() => window.ScrollTimeline !== undefined, "scrollTimeline"); + const supportsViewTimeline = /* @__PURE__ */ memoSupports(() => window.ViewTimeline !== undefined, "viewTimeline"); + + const supportsLinearEasing = /*@__PURE__*/ memoSupports(() => { + try { + document + .createElement("div") + .animate({ opacity: 0 }, { easing: "linear(0, 1)" }); + } + catch (e) { + return false; + } + return true; + }, "linearEasing"); + + const cubicBezierAsString = ([a, b, c, d]) => `cubic-bezier(${a}, ${b}, ${c}, ${d})`; + + const supportedWaapiEasing = { + linear: "linear", + ease: "ease", + easeIn: "ease-in", + easeOut: "ease-out", + easeInOut: "ease-in-out", + circIn: /*@__PURE__*/ cubicBezierAsString([0, 0.65, 0.55, 1]), + circOut: /*@__PURE__*/ cubicBezierAsString([0.55, 0, 1, 0.45]), + backIn: /*@__PURE__*/ cubicBezierAsString([0.31, 0.01, 0.66, -0.59]), + backOut: /*@__PURE__*/ cubicBezierAsString([0.33, 1.53, 0.69, 0.99]), + }; + + function mapEasingToNativeEasing(easing, duration) { + if (!easing) { + return undefined; + } + else if (typeof easing === "function") { + return supportsLinearEasing() + ? generateLinearEasing(easing, duration) + : "ease-out"; + } + else if (isBezierDefinition(easing)) { + return cubicBezierAsString(easing); + } + else if (Array.isArray(easing)) { + return easing.map((segmentEasing) => mapEasingToNativeEasing(segmentEasing, duration) || + supportedWaapiEasing.easeOut); + } + else { + return supportedWaapiEasing[easing]; + } + } + + function startWaapiAnimation(element, valueName, keyframes, { delay = 0, duration = 300, repeat = 0, repeatType = "loop", ease = "easeOut", times, } = {}, pseudoElement = undefined) { + const keyframeOptions = { + [valueName]: keyframes, + }; + if (times) + keyframeOptions.offset = times; + const easing = mapEasingToNativeEasing(ease, duration); + /** + * If this is an easing array, apply to keyframes, not animation as a whole + */ + if (Array.isArray(easing)) + keyframeOptions.easing = easing; + const options = { + delay, + duration, + easing: !Array.isArray(easing) ? easing : "linear", + fill: "both", + iterations: repeat + 1, + direction: repeatType === "reverse" ? "alternate" : "normal", + }; + if (pseudoElement) + options.pseudoElement = pseudoElement; + return element.animate(keyframeOptions, options); + } + + function isGenerator(type) { + return typeof type === "function" && "applyToOptions" in type; + } + + function applyGeneratorOptions({ type, ...options }) { + if (isGenerator(type) && supportsLinearEasing()) { + return type.applyToOptions(options); + } + else { + options.duration ?? (options.duration = 300); + options.ease ?? (options.ease = "easeOut"); + } + return options; + } + + /** + * NativeAnimation implements AnimationPlaybackControls for the browser's Web Animations API. + */ + class NativeAnimation extends WithPromise { + constructor(options) { + super(); + this.finishedTime = null; + this.isStopped = false; + /** + * Tracks a manually-set start time that takes precedence over WAAPI's + * dynamic startTime. This is cleared when play() or time setter is called, + * allowing WAAPI to take over timing. + */ + this.manualStartTime = null; + if (!options) + return; + const { element, name, keyframes, pseudoElement, allowFlatten = false, finalKeyframe, onComplete, } = options; + this.isPseudoElement = Boolean(pseudoElement); + this.allowFlatten = allowFlatten; + this.options = options; + exports.invariant(typeof options.type !== "string", `Mini animate() doesn't support "type" as a string.`, "mini-spring"); + const transition = applyGeneratorOptions(options); + this.animation = startWaapiAnimation(element, name, keyframes, transition, pseudoElement); + if (transition.autoplay === false) { + this.animation.pause(); + } + this.animation.onfinish = () => { + this.finishedTime = this.time; + if (!pseudoElement) { + const keyframe = getFinalKeyframe(keyframes, this.options, finalKeyframe, this.speed); + if (this.updateMotionValue) { + this.updateMotionValue(keyframe); + } + /** + * If we can, we want to commit the final style as set by the user, + * rather than the computed keyframe value supplied by the animation. + * We always do this, even when a motion value is present, to prevent + * a visual flash in Firefox where the WAAPI animation's fill is removed + * during cancel() before the scheduled render can apply the correct value. + */ + setStyle(element, name, keyframe); + this.animation.cancel(); + } + onComplete?.(); + this.notifyFinished(); + }; + } + play() { + if (this.isStopped) + return; + this.manualStartTime = null; + this.animation.play(); + if (this.state === "finished") { + this.updateFinished(); + } + } + pause() { + this.animation.pause(); + } + complete() { + this.animation.finish?.(); + } + cancel() { + try { + this.animation.cancel(); + } + catch (e) { } + } + stop() { + if (this.isStopped) + return; + this.isStopped = true; + const { state } = this; + if (state === "idle" || state === "finished") { + return; + } + if (this.updateMotionValue) { + this.updateMotionValue(); + } + else { + this.commitStyles(); + } + if (!this.isPseudoElement) + this.cancel(); + } + /** + * WAAPI doesn't natively have any interruption capabilities. + * + * In this method, we commit styles back to the DOM before cancelling + * the animation. + * + * This is designed to be overridden by NativeAnimationExtended, which + * will create a renderless JS animation and sample it twice to calculate + * its current value, "previous" value, and therefore allow + * Motion to also correctly calculate velocity for any subsequent animation + * while deferring the commit until the next animation frame. + */ + commitStyles() { + const element = this.options?.element; + if (!this.isPseudoElement && element?.isConnected) { + this.animation.commitStyles?.(); + } + } + get duration() { + const duration = this.animation.effect?.getComputedTiming?.().duration || 0; + return millisecondsToSeconds(Number(duration)); + } + get iterationDuration() { + const { delay = 0 } = this.options || {}; + return this.duration + millisecondsToSeconds(delay); + } + get time() { + return millisecondsToSeconds(Number(this.animation.currentTime) || 0); + } + set time(newTime) { + const wasFinished = this.finishedTime !== null; + this.manualStartTime = null; + this.finishedTime = null; + this.animation.currentTime = secondsToMilliseconds(newTime); + if (wasFinished) { + this.animation.pause(); + } + } + /** + * The playback speed of the animation. + * 1 = normal speed, 2 = double speed, 0.5 = half speed. + */ + get speed() { + return this.animation.playbackRate; + } + set speed(newSpeed) { + // Allow backwards playback after finishing + if (newSpeed < 0) + this.finishedTime = null; + this.animation.playbackRate = newSpeed; + } + get state() { + return this.finishedTime !== null + ? "finished" + : this.animation.playState; + } + get startTime() { + return this.manualStartTime ?? Number(this.animation.startTime); + } + set startTime(newStartTime) { + this.manualStartTime = this.animation.startTime = newStartTime; + } + /** + * Attaches a timeline to the animation, for instance the `ScrollTimeline`. + */ + attachTimeline({ timeline, rangeStart, rangeEnd, observe, }) { + if (this.allowFlatten) { + this.animation.effect?.updateTiming({ easing: "linear" }); + } + this.animation.onfinish = null; + if (timeline && supportsScrollTimeline()) { + this.animation.timeline = timeline; + if (rangeStart) + this.animation.rangeStart = rangeStart; + if (rangeEnd) + this.animation.rangeEnd = rangeEnd; + return noop; + } + else { + return observe(this); + } + } + } + + const unsupportedEasingFunctions = { + anticipate, + backInOut, + circInOut, + }; + function isUnsupportedEase(key) { + return key in unsupportedEasingFunctions; + } + function replaceStringEasing(transition) { + if (typeof transition.ease === "string" && + isUnsupportedEase(transition.ease)) { + transition.ease = unsupportedEasingFunctions[transition.ease]; + } + } + + /** + * 10ms is chosen here as it strikes a balance between smooth + * results (more than one keyframe per frame at 60fps) and + * keyframe quantity. + */ + const sampleDelta = 10; //ms + class NativeAnimationExtended extends NativeAnimation { + constructor(options) { + /** + * The base NativeAnimation function only supports a subset + * of Motion easings, and WAAPI also only supports some + * easing functions via string/cubic-bezier definitions. + * + * This function replaces those unsupported easing functions + * with a JS easing function. This will later get compiled + * to a linear() easing function. + */ + replaceStringEasing(options); + /** + * Ensure we replace the transition type with a generator function + * before passing to WAAPI. + * + * TODO: Does this have a better home? It could be shared with + * JSAnimation. + */ + replaceTransitionType(options); + super(options); + /** + * Only set startTime when the animation should autoplay. + * Setting startTime on a paused WAAPI animation unpauses it + * (per the WAAPI spec), which breaks autoplay: false. + */ + if (options.startTime !== undefined && options.autoplay !== false) { + this.startTime = options.startTime; + } + this.options = options; + } + /** + * WAAPI doesn't natively have any interruption capabilities. + * + * Rather than read committed styles back out of the DOM, we can + * create a renderless JS animation and sample it twice to calculate + * its current value, "previous" value, and therefore allow + * Motion to calculate velocity for any subsequent animation. + */ + updateMotionValue(value) { + const { motionValue, onUpdate, onComplete, element, ...options } = this.options; + if (!motionValue) + return; + if (value !== undefined) { + motionValue.set(value); + return; + } + const sampleAnimation = new JSAnimation({ + ...options, + autoplay: false, + }); + /** + * Use wall-clock elapsed time for sampling. + * Under CPU load, WAAPI's currentTime may not reflect actual + * elapsed time, causing incorrect sampling and visual jumps. + */ + const sampleTime = Math.max(sampleDelta, time.now() - this.startTime); + const delta = clamp(0, sampleDelta, sampleTime - sampleDelta); + const current = sampleAnimation.sample(sampleTime).value; + /** + * Write the estimated value to inline style so it persists + * after cancel(), covering the async gap before the next + * animation starts. + */ + const { name } = this.options; + if (element && name) + setStyle(element, name, current); + motionValue.setWithVelocity(sampleAnimation.sample(Math.max(0, sampleTime - delta)).value, current, delta); + sampleAnimation.stop(); + } + } + + /** + * Check if a value is animatable. Examples: + * + * ✅: 100, "100px", "#fff" + * ❌: "block", "url(2.jpg)" + * @param value + * + * @internal + */ + const isAnimatable = (value, name) => { + // If the list of keys that might be non-animatable grows, replace with Set + if (name === "zIndex") + return false; + // If it's a number or a keyframes array, we can animate it. We might at some point + // need to do a deep isAnimatable check of keyframes, or let Popmotion handle this, + // but for now lets leave it like this for performance reasons + if (typeof value === "number" || Array.isArray(value)) + return true; + if (typeof value === "string" && // It's animatable if we have a string + (complex.test(value) || value === "0") && // And it contains numbers and/or colors + !value.startsWith("url(") // Unless it starts with "url(" + ) { + return true; + } + return false; + }; + + function hasKeyframesChanged(keyframes) { + const current = keyframes[0]; + if (keyframes.length === 1) + return true; + for (let i = 0; i < keyframes.length; i++) { + if (keyframes[i] !== current) + return true; + } + } + function canAnimate(keyframes, name, type, velocity) { + /** + * Check if we're able to animate between the start and end keyframes, + * and throw a warning if we're attempting to animate between one that's + * animatable and another that isn't. + */ + const originKeyframe = keyframes[0]; + if (originKeyframe === null) { + return false; + } + /** + * These aren't traditionally animatable but we do support them. + * In future we could look into making this more generic or replacing + * this function with mix() === mixImmediate + */ + if (name === "display" || name === "visibility") + return true; + const targetKeyframe = keyframes[keyframes.length - 1]; + const isOriginAnimatable = isAnimatable(originKeyframe, name); + const isTargetAnimatable = isAnimatable(targetKeyframe, name); + exports.warning(isOriginAnimatable === isTargetAnimatable, `You are trying to animate ${name} from "${originKeyframe}" to "${targetKeyframe}". "${isOriginAnimatable ? targetKeyframe : originKeyframe}" is not an animatable value.`, "value-not-animatable"); + // Always skip if any of these are true + if (!isOriginAnimatable || !isTargetAnimatable) { + return false; + } + return (hasKeyframesChanged(keyframes) || + ((type === "spring" || isGenerator(type)) && velocity)); + } + + function makeAnimationInstant(options) { + options.duration = 0; + options.type = "keyframes"; + } + + /** + * A list of values that can be hardware-accelerated. + */ + const acceleratedValues = new Set([ + "opacity", + "clipPath", + "filter", + "transform", + "backgroundColor", + ]); + + const browserColorFunctions = /^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/; + function hasBrowserOnlyColors(keyframes) { + for (let i = 0; i < keyframes.length; i++) { + if (typeof keyframes[i] === "string" && + browserColorFunctions.test(keyframes[i])) { + return true; + } + } + return false; + } + + const colorProperties = new Set([ + "color", + "backgroundColor", + "outlineColor", + "fill", + "stroke", + "borderColor", + "borderTopColor", + "borderRightColor", + "borderBottomColor", + "borderLeftColor", + ]); + const supportsWaapi = /*@__PURE__*/ memo(() => Object.hasOwnProperty.call(Element.prototype, "animate")); + function supportsBrowserAnimation(options) { + const { motionValue, name, repeatDelay, repeatType, damping, type, keyframes, } = options; + const subject = motionValue?.owner?.current; + /** + * We use instanceof checks instead of isHTMLElement()/isSVGElement() + * because we explicitly **don't** want elements in different timing + * contexts (i.e. popups) to be accelerated, as it's not possible to sync + * these animations properly with those driven from the main window + * frameloop. + */ + if (!(subject instanceof HTMLElement) && + !(subject instanceof SVGElement)) { + return false; + } + const { onUpdate, transformTemplate } = motionValue.owner.getProps(); + return (supportsWaapi() && + name && + /** + * Force WAAPI for color properties with browser-only color formats + * (oklch, oklab, lab, lch, etc.) that the JS animation path can't parse. + */ + (acceleratedValues.has(name) || + (colorProperties.has(name) && + hasBrowserOnlyColors(keyframes))) && + (name !== "transform" || !transformTemplate) && + /** + * If we're outputting values to onUpdate then we can't use WAAPI as there's + * no way to read the value from WAAPI every frame. + */ + !onUpdate && + !repeatDelay && + repeatType !== "mirror" && + damping !== 0 && + type !== "inertia"); + } + + /** + * Maximum time allowed between an animation being created and it being + * resolved for us to use the latter as the start time. + * + * This is to ensure that while we prefer to "start" an animation as soon + * as it's triggered, we also want to avoid a visual jump if there's a big delay + * between these two moments. + */ + const MAX_RESOLVE_DELAY = 40; + class AsyncMotionValueAnimation extends WithPromise { + constructor({ autoplay = true, delay = 0, type = "keyframes", repeat = 0, repeatDelay = 0, repeatType = "loop", keyframes, name, motionValue, element, ...options }) { + super(); + /** + * Bound to support return animation.stop pattern + */ + this.stop = () => { + if (this._animation) { + this._animation.stop(); + this.stopTimeline?.(); + } + this.keyframeResolver?.cancel(); + }; + this.createdAt = time.now(); + const optionsWithDefaults = { + autoplay, + delay, + type, + repeat, + repeatDelay, + repeatType, + name, + motionValue, + element, + ...options, + }; + const KeyframeResolver$1 = element?.KeyframeResolver || KeyframeResolver; + this.keyframeResolver = new KeyframeResolver$1(keyframes, (resolvedKeyframes, finalKeyframe, forced) => this.onKeyframesResolved(resolvedKeyframes, finalKeyframe, optionsWithDefaults, !forced), name, motionValue, element); + this.keyframeResolver?.scheduleResolve(); + } + onKeyframesResolved(keyframes, finalKeyframe, options, sync) { + this.keyframeResolver = undefined; + const { name, type, velocity, delay, isHandoff, onUpdate } = options; + this.resolvedAt = time.now(); + /** + * If we can't animate this value with the resolved keyframes + * then we should complete it immediately. + */ + let canAnimateValue = true; + if (!canAnimate(keyframes, name, type, velocity)) { + canAnimateValue = false; + if (MotionGlobalConfig.instantAnimations || !delay) { + onUpdate?.(getFinalKeyframe(keyframes, options, finalKeyframe)); + } + keyframes[0] = keyframes[keyframes.length - 1]; + makeAnimationInstant(options); + options.repeat = 0; + } + /** + * Resolve startTime for the animation. + * + * This method uses the createdAt and resolvedAt to calculate the + * animation startTime. *Ideally*, we would use the createdAt time as t=0 + * as the following frame would then be the first frame of the animation in + * progress, which would feel snappier. + * + * However, if there's a delay (main thread work) between the creation of + * the animation and the first committed frame, we prefer to use resolvedAt + * to avoid a sudden jump into the animation. + */ + const startTime = sync + ? !this.resolvedAt + ? this.createdAt + : this.resolvedAt - this.createdAt > MAX_RESOLVE_DELAY + ? this.resolvedAt + : this.createdAt + : undefined; + const resolvedOptions = { + startTime, + finalKeyframe, + ...options, + keyframes, + }; + /** + * Animate via WAAPI if possible. If this is a handoff animation, the optimised animation will be running via + * WAAPI. Therefore, this animation must be JS to ensure it runs "under" the + * optimised animation. + * + * Also skip WAAPI when keyframes aren't animatable, as the resolved + * values may not be valid CSS and would trigger browser warnings. + */ + const useWaapi = canAnimateValue && + !isHandoff && + supportsBrowserAnimation(resolvedOptions); + const element = resolvedOptions.motionValue?.owner?.current; + let animation; + if (useWaapi) { + try { + animation = new NativeAnimationExtended({ + ...resolvedOptions, + element, + }); + } + catch { + animation = new JSAnimation(resolvedOptions); + } + } + else { + animation = new JSAnimation(resolvedOptions); + } + animation.finished.then(() => { + this.notifyFinished(); + }).catch(noop); + if (this.pendingTimeline) { + this.stopTimeline = animation.attachTimeline(this.pendingTimeline); + this.pendingTimeline = undefined; + } + this._animation = animation; + } + get finished() { + if (!this._animation) { + return this._finished; + } + else { + return this.animation.finished; + } + } + then(onResolve, _onReject) { + return this.finished.finally(onResolve).then(() => { }); + } + get animation() { + if (!this._animation) { + this.keyframeResolver?.resume(); + flushKeyframeResolvers(); + } + return this._animation; + } + get duration() { + return this.animation.duration; + } + get iterationDuration() { + return this.animation.iterationDuration; + } + get time() { + return this.animation.time; + } + set time(newTime) { + this.animation.time = newTime; + } + get speed() { + return this.animation.speed; + } + get state() { + return this.animation.state; + } + set speed(newSpeed) { + this.animation.speed = newSpeed; + } + get startTime() { + return this.animation.startTime; + } + attachTimeline(timeline) { + if (this._animation) { + this.stopTimeline = this.animation.attachTimeline(timeline); + } + else { + this.pendingTimeline = timeline; + } + return () => this.stop(); + } + play() { + this.animation.play(); + } + pause() { + this.animation.pause(); + } + complete() { + this.animation.complete(); + } + cancel() { + if (this._animation) { + this.animation.cancel(); + } + this.keyframeResolver?.cancel(); + } + } + + class GroupAnimation { + constructor(animations) { + // Bound to accomadate common `return animation.stop` pattern + this.stop = () => this.runAll("stop"); + this.animations = animations.filter(Boolean); + } + get finished() { + return Promise.all(this.animations.map((animation) => animation.finished)); + } + /** + * TODO: Filter out cancelled or stopped animations before returning + */ + getAll(propName) { + return this.animations[0][propName]; + } + setAll(propName, newValue) { + for (let i = 0; i < this.animations.length; i++) { + this.animations[i][propName] = newValue; + } + } + attachTimeline(timeline) { + const subscriptions = this.animations.map((animation) => animation.attachTimeline(timeline)); + return () => { + subscriptions.forEach((cancel, i) => { + cancel && cancel(); + this.animations[i].stop(); + }); + }; + } + get time() { + return this.getAll("time"); + } + set time(time) { + this.setAll("time", time); + } + get speed() { + return this.getAll("speed"); + } + set speed(speed) { + this.setAll("speed", speed); + } + get state() { + return this.getAll("state"); + } + get startTime() { + return this.getAll("startTime"); + } + get duration() { + return getMax(this.animations, "duration"); + } + get iterationDuration() { + return getMax(this.animations, "iterationDuration"); + } + runAll(methodName) { + this.animations.forEach((controls) => controls[methodName]()); + } + play() { + this.runAll("play"); + } + pause() { + this.runAll("pause"); + } + cancel() { + this.runAll("cancel"); + } + complete() { + this.runAll("complete"); + } + } + function getMax(animations, propName) { + let max = 0; + for (let i = 0; i < animations.length; i++) { + const value = animations[i][propName]; + if (value !== null && value > max) { + max = value; + } + } + return max; + } + + class GroupAnimationWithThen extends GroupAnimation { + then(onResolve, _onReject) { + return this.finished.finally(onResolve).then(() => { }); + } + } + + class NativeAnimationWrapper extends NativeAnimation { + constructor(animation) { + super(); + this.animation = animation; + animation.onfinish = () => { + this.finishedTime = this.time; + this.notifyFinished(); + }; + } + } + + const animationMaps = new WeakMap(); + const animationMapKey = (name, pseudoElement = "") => `${name}:${pseudoElement}`; + function getAnimationMap(element) { + let map = animationMaps.get(element); + if (!map) { + map = new Map(); + animationMaps.set(element, map); + } + return map; + } + + function calcChildStagger(children, child, delayChildren, staggerChildren = 0, staggerDirection = 1) { + const index = Array.from(children) + .sort((a, b) => a.sortNodePosition(b)) + .indexOf(child); + const numChildren = children.size; + const maxStaggerDuration = (numChildren - 1) * staggerChildren; + const delayIsFunction = typeof delayChildren === "function"; + return delayIsFunction + ? delayChildren(index, numChildren) + : staggerDirection === 1 + ? index * staggerChildren + : maxStaggerDuration - index * staggerChildren; + } + + /** + * Maximum time between the value of two frames, beyond which we + * assume the velocity has since been 0. + */ + const MAX_VELOCITY_DELTA = 30; + const isFloat = (value) => { + return !isNaN(parseFloat(value)); + }; + const collectMotionValues = { + current: undefined, + }; + /** + * `MotionValue` is used to track the state and velocity of motion values. + * + * @public + */ + class MotionValue { + /** + * @param init - The initiating value + * @param config - Optional configuration options + * + * - `transformer`: A function to transform incoming values with. + */ + constructor(init, options = {}) { + /** + * Tracks whether this value can output a velocity. Currently this is only true + * if the value is numerical, but we might be able to widen the scope here and support + * other value types. + * + * @internal + */ + this.canTrackVelocity = null; + /** + * An object containing a SubscriptionManager for each active event. + */ + this.events = {}; + this.updateAndNotify = (v) => { + const currentTime = time.now(); + /** + * If we're updating the value during another frame or eventloop + * than the previous frame, then the we set the previous frame value + * to current. + */ + if (this.updatedAt !== currentTime) { + this.setPrevFrameValue(); + } + this.prev = this.current; + this.setCurrent(v); + // Update update subscribers + if (this.current !== this.prev) { + this.events.change?.notify(this.current); + if (this.dependents) { + for (const dependent of this.dependents) { + dependent.dirty(); + } + } + } + }; + this.hasAnimated = false; + this.setCurrent(init); + this.owner = options.owner; + } + setCurrent(current) { + this.current = current; + this.updatedAt = time.now(); + if (this.canTrackVelocity === null && current !== undefined) { + this.canTrackVelocity = isFloat(this.current); + } + } + setPrevFrameValue(prevFrameValue = this.current) { + this.prevFrameValue = prevFrameValue; + this.prevUpdatedAt = this.updatedAt; + } + /** + * Adds a function that will be notified when the `MotionValue` is updated. + * + * It returns a function that, when called, will cancel the subscription. + * + * When calling `onChange` inside a React component, it should be wrapped with the + * `useEffect` hook. As it returns an unsubscribe function, this should be returned + * from the `useEffect` function to ensure you don't add duplicate subscribers.. + * + * ```jsx + * export const MyComponent = () => { + * const x = useMotionValue(0) + * const y = useMotionValue(0) + * const opacity = useMotionValue(1) + * + * useEffect(() => { + * function updateOpacity() { + * const maxXY = Math.max(x.get(), y.get()) + * const newOpacity = transform(maxXY, [0, 100], [1, 0]) + * opacity.set(newOpacity) + * } + * + * const unsubscribeX = x.on("change", updateOpacity) + * const unsubscribeY = y.on("change", updateOpacity) + * + * return () => { + * unsubscribeX() + * unsubscribeY() + * } + * }, []) + * + * return + * } + * ``` + * + * @param subscriber - A function that receives the latest value. + * @returns A function that, when called, will cancel this subscription. + * + * @deprecated + */ + onChange(subscription) { + { + warnOnce(false, `value.onChange(callback) is deprecated. Switch to value.on("change", callback).`); + } + return this.on("change", subscription); + } + on(eventName, callback) { + if (!this.events[eventName]) { + this.events[eventName] = new SubscriptionManager(); + } + const unsubscribe = this.events[eventName].add(callback); + if (eventName === "change") { + return () => { + unsubscribe(); + /** + * If we have no more change listeners by the start + * of the next frame, stop active animations. + */ + frame.read(() => { + if (!this.events.change.getSize()) { + this.stop(); + } + }); + }; + } + return unsubscribe; + } + clearListeners() { + for (const eventManagers in this.events) { + this.events[eventManagers].clear(); + } + } + /** + * Attaches a passive effect to the `MotionValue`. + */ + attach(passiveEffect, stopPassiveEffect) { + this.passiveEffect = passiveEffect; + this.stopPassiveEffect = stopPassiveEffect; + } + /** + * Sets the state of the `MotionValue`. + * + * @remarks + * + * ```jsx + * const x = useMotionValue(0) + * x.set(10) + * ``` + * + * @param latest - Latest value to set. + * @param render - Whether to notify render subscribers. Defaults to `true` + * + * @public + */ + set(v) { + if (!this.passiveEffect) { + this.updateAndNotify(v); + } + else { + this.passiveEffect(v, this.updateAndNotify); + } + } + setWithVelocity(prev, current, delta) { + this.set(current); + this.prev = undefined; + this.prevFrameValue = prev; + this.prevUpdatedAt = this.updatedAt - delta; + } + /** + * Set the state of the `MotionValue`, stopping any active animations, + * effects, and resets velocity to `0`. + */ + jump(v, endAnimation = true) { + this.updateAndNotify(v); + this.prev = v; + this.prevUpdatedAt = this.prevFrameValue = undefined; + endAnimation && this.stop(); + if (this.stopPassiveEffect) + this.stopPassiveEffect(); + } + dirty() { + this.events.change?.notify(this.current); + } + addDependent(dependent) { + if (!this.dependents) { + this.dependents = new Set(); + } + this.dependents.add(dependent); + } + removeDependent(dependent) { + if (this.dependents) { + this.dependents.delete(dependent); + } + } + /** + * Returns the latest state of `MotionValue` + * + * @returns - The latest state of `MotionValue` + * + * @public + */ + get() { + if (collectMotionValues.current) { + collectMotionValues.current.push(this); + } + return this.current; + } + /** + * @public + */ + getPrevious() { + return this.prev; + } + /** + * Returns the latest velocity of `MotionValue` + * + * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical. + * + * @public + */ + getVelocity() { + const currentTime = time.now(); + if (!this.canTrackVelocity || + this.prevFrameValue === undefined || + currentTime - this.updatedAt > MAX_VELOCITY_DELTA) { + return 0; + } + const delta = Math.min(this.updatedAt - this.prevUpdatedAt, MAX_VELOCITY_DELTA); + // Casts because of parseFloat's poor typing + return velocityPerSecond(parseFloat(this.current) - + parseFloat(this.prevFrameValue), delta); + } + /** + * Registers a new animation to control this `MotionValue`. Only one + * animation can drive a `MotionValue` at one time. + * + * ```jsx + * value.start() + * ``` + * + * @param animation - A function that starts the provided animation + */ + start(startAnimation) { + this.stop(); + return new Promise((resolve) => { + this.hasAnimated = true; + this.animation = startAnimation(resolve); + if (this.events.animationStart) { + this.events.animationStart.notify(); + } + }).then(() => { + if (this.events.animationComplete) { + this.events.animationComplete.notify(); + } + this.clearAnimation(); + }); + } + /** + * Stop the currently active animation. + * + * @public + */ + stop() { + if (this.animation) { + this.animation.stop(); + if (this.events.animationCancel) { + this.events.animationCancel.notify(); + } + } + this.clearAnimation(); + } + /** + * Returns `true` if this value is currently animating. + * + * @public + */ + isAnimating() { + return !!this.animation; + } + clearAnimation() { + delete this.animation; + } + /** + * Destroy and clean up subscribers to this `MotionValue`. + * + * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically + * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually + * created a `MotionValue` via the `motionValue` function. + * + * @public + */ + destroy() { + this.dependents?.clear(); + this.events.destroy?.notify(); + this.clearListeners(); + this.stop(); + if (this.stopPassiveEffect) { + this.stopPassiveEffect(); + } + } + } + function motionValue(init, options) { + return new MotionValue(init, options); + } + + /** + * If `transition` has `inherit: true`, shallow-merge it with + * `parentTransition` (child keys win) and strip the `inherit` key. + * Otherwise return `transition` unchanged. + */ + function resolveTransition(transition, parentTransition) { + if (transition?.inherit && parentTransition) { + const { inherit: _, ...rest } = transition; + return { ...parentTransition, ...rest }; + } + return transition; + } + + function getValueTransition$1(transition, key) { + const valueTransition = transition?.[key] ?? + transition?.["default"] ?? + transition; + if (valueTransition !== transition) { + return resolveTransition(valueTransition, transition); + } + return valueTransition; + } + + const underDampedSpring = { + type: "spring", + stiffness: 500, + damping: 25, + restSpeed: 10, + }; + const criticallyDampedSpring = (target) => ({ + type: "spring", + stiffness: 550, + damping: target === 0 ? 2 * Math.sqrt(550) : 30, + restSpeed: 10, + }); + const keyframesTransition = { + type: "keyframes", + duration: 0.8, + }; + /** + * Default easing curve is a slightly shallower version of + * the default browser easing curve. + */ + const ease = { + type: "keyframes", + ease: [0.25, 0.1, 0.35, 1], + duration: 0.3, + }; + const getDefaultTransition = (valueKey, { keyframes }) => { + if (keyframes.length > 2) { + return keyframesTransition; + } + else if (transformProps.has(valueKey)) { + return valueKey.startsWith("scale") + ? criticallyDampedSpring(keyframes[1]) + : underDampedSpring; + } + return ease; + }; + + const orchestrationKeys = new Set([ + "when", + "delay", + "delayChildren", + "staggerChildren", + "staggerDirection", + "repeat", + "repeatType", + "repeatDelay", + "from", + "elapsed", + ]); + /** + * Decide whether a transition is defined on a given Transition. + * This filters out orchestration options and returns true + * if any options are left. + */ + function isTransitionDefined(transition) { + for (const key in transition) { + if (!orchestrationKeys.has(key)) + return true; + } + return false; + } + + const animateMotionValue = (name, value, target, transition = {}, element, isHandoff) => (onComplete) => { + const valueTransition = getValueTransition$1(transition, name) || {}; + /** + * Most transition values are currently completely overwritten by value-specific + * transitions. In the future it'd be nicer to blend these transitions. But for now + * delay actually does inherit from the root transition if not value-specific. + */ + const delay = valueTransition.delay || transition.delay || 0; + /** + * Elapsed isn't a public transition option but can be passed through from + * optimized appear effects in milliseconds. + */ + let { elapsed = 0 } = transition; + elapsed = elapsed - secondsToMilliseconds(delay); + const options = { + keyframes: Array.isArray(target) ? target : [null, target], + ease: "easeOut", + velocity: value.getVelocity(), + ...valueTransition, + delay: -elapsed, + onUpdate: (v) => { + value.set(v); + valueTransition.onUpdate && valueTransition.onUpdate(v); + }, + onComplete: () => { + onComplete(); + valueTransition.onComplete && valueTransition.onComplete(); + }, + name, + motionValue: value, + element: isHandoff ? undefined : element, + }; + /** + * If there's no transition defined for this value, we can generate + * unique transition settings for this value. + */ + if (!isTransitionDefined(valueTransition)) { + Object.assign(options, getDefaultTransition(name, options)); + } + /** + * Both WAAPI and our internal animation functions use durations + * as defined by milliseconds, while our external API defines them + * as seconds. + */ + options.duration && (options.duration = secondsToMilliseconds(options.duration)); + options.repeatDelay && (options.repeatDelay = secondsToMilliseconds(options.repeatDelay)); + /** + * Support deprecated way to set initial value. Prefer keyframe syntax. + */ + if (options.from !== undefined) { + options.keyframes[0] = options.from; + } + let shouldSkip = false; + if (options.type === false || + (options.duration === 0 && !options.repeatDelay)) { + makeAnimationInstant(options); + if (options.delay === 0) { + shouldSkip = true; + } + } + if (MotionGlobalConfig.instantAnimations || + MotionGlobalConfig.skipAnimations || + element?.shouldSkipAnimations || + valueTransition.skipAnimations) { + shouldSkip = true; + makeAnimationInstant(options); + options.delay = 0; + } + /** + * If the transition type or easing has been explicitly set by the user + * then we don't want to allow flattening the animation. + */ + options.allowFlatten = !valueTransition.type && !valueTransition.ease; + /** + * If we can or must skip creating the animation, and apply only + * the final keyframe, do so. We also check once keyframes are resolved but + * this early check prevents the need to create an animation at all. + */ + if (shouldSkip && !isHandoff && value.get() !== undefined) { + const finalKeyframe = getFinalKeyframe(options.keyframes, valueTransition); + if (finalKeyframe !== undefined) { + frame.update(() => { + options.onUpdate(finalKeyframe); + options.onComplete(); + }); + return; + } + } + return valueTransition.isSync + ? new JSAnimation(options) + : new AsyncMotionValueAnimation(options); + }; + + const MIN_LAYOUT_DISTANCE = 20; + function bezierPoint(t, origin, control, target) { + const inv = 1 - t; + return inv * inv * origin + 2 * inv * t * control + t * t * target; + } + function bezierTangentAngle(t, originX, controlX, targetX, originY, controlY, targetY) { + const dx = 2 * (1 - t) * (controlX - originX) + 2 * t * (targetX - controlX); + const dy = 2 * (1 - t) * (controlY - originY) + 2 * t * (targetY - controlY); + return Math.atan2(dy, dx) * (180 / Math.PI); + } + function computeArcControlPoint(fromX, fromY, toX, toY, strength, peak) { + const deltaX = toX - fromX; + const deltaY = toY - fromY; + const distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY); + if (distance > 0) { + const normalPerpX = -deltaY / distance; + const normalPerpY = deltaX / distance; + const desiredHeight = strength * distance; + return { + x: fromX + deltaX * peak + normalPerpX * desiredHeight, + y: fromY + deltaY * peak + normalPerpY * desiredHeight, + }; + } + return { x: fromX, y: fromY }; + } + /** + * The pure sampling factory: `(from, to) => (t) => point`. Internal — + * used by {@link arc} and the unit tests. Not part of the public surface. + */ + function createArcPath({ strength = 0.5, peak = 0.5, direction, rotate = false, } = {}) { + const rotationScale = rotate === true ? 1 : typeof rotate === "number" ? rotate : 0; + // Auto-direction only: persists across calls to flip the bulge back + // onto the same screen side when the dominant axis changes between + // calls. Reuse the factory (module scope / useMemo) to keep this alive. + let prevBulgeSign; + const createInterpolator = (from, to) => { + const dx = to.x - from.x; + const dy = to.y - from.y; + let signed; + if (direction === "cw") { + signed = -strength; + } + else if (direction === "ccw") { + signed = strength; + } + else { + const dom = Math.abs(dx) >= Math.abs(dy) ? dx : dy; + signed = dom < 0 ? -strength : strength; + } + let control = computeArcControlPoint(from.x, from.y, to.x, to.y, signed, peak); + if (direction === undefined) { + const isVertical = Math.abs(dx) < Math.abs(dy); + const midX = from.x + dx * peak; + const midY = from.y + dy * peak; + const bulgeSign = isVertical + ? Math.sign(control.x - midX) + : Math.sign(control.y - midY); + if (prevBulgeSign !== undefined && + bulgeSign !== 0 && + bulgeSign !== prevBulgeSign) { + signed = -signed; + control = computeArcControlPoint(from.x, from.y, to.x, to.y, signed, peak); + } + else if (bulgeSign !== 0) { + prevBulgeSign = bulgeSign; + } + } + const tangent0 = rotationScale + ? bezierTangentAngle(0, from.x, control.x, to.x, from.y, control.y, to.y) + : 0; + const tangent1 = rotationScale + ? bezierTangentAngle(1, from.x, control.x, to.x, from.y, control.y, to.y) + : 0; + const tangentDelta = rotationScale + ? wrap(-180, 180, tangent1 - tangent0) + : 0; + return (t) => { + const out = { + x: bezierPoint(t, from.x, control.x, to.x), + y: bezierPoint(t, from.y, control.y, to.y), + }; + if (rotationScale) { + const raw = bezierTangentAngle(t, from.x, control.x, to.x, from.y, control.y, to.y); + const baseline = tangent0 + tangentDelta * t; + out.rotate = wrap(-180, 180, raw - baseline) * rotationScale; + } + return out; + }; + }; + return createInterpolator; + } + /** + * Creates a curved path for `transition.path`: + * + * ```ts + * + * ``` + * + * Reuse the returned value (module scope / useMemo / useRef) so its + * continuity closure survives re-renders — a fresh `arc()` has no memory. + */ + function arc(options = {}) { + const sample = createArcPath(options); + const path = { + interpolateProjection(delta) { + // `from` is the current translate offset (carries any in-flight + // displacement when interrupted); `to` is the new layout origin. + // The distance floor avoids visible wobble on tiny shifts. + const tx = delta.x.translate; + const ty = delta.y.translate; + if (Math.sqrt(tx * tx + ty * ty) < MIN_LAYOUT_DISTANCE) { + return undefined; + } + return sample({ x: tx, y: ty }, { x: 0, y: 0 }); + }, + animateVisualElement(visualElement, target, transition, delay, animations) { + if (!("x" in target || "y" in target)) + return; + const xValue = visualElement.getValue("x", visualElement.latestValues["x"] ?? 0); + const yValue = visualElement.getValue("y", visualElement.latestValues["y"] ?? 0); + const xRaw = target.x; + const yRaw = target.y; + const xFrom = (Array.isArray(xRaw) && xRaw[0] != null + ? xRaw[0] + : xValue?.get()) ?? 0; + const yFrom = (Array.isArray(yRaw) && yRaw[0] != null + ? yRaw[0] + : yValue?.get()) ?? 0; + const xTo = (Array.isArray(xRaw) + ? xRaw[xRaw.length - 1] + : xRaw ?? xFrom); + const yTo = (Array.isArray(yRaw) + ? yRaw[yRaw.length - 1] + : yRaw ?? yFrom); + // Interruption needs no flag: x/y already hold the displaced + // mid-arc position, so xFrom/yFrom carry the continuity geometry. + const interpolate = sample({ x: xFrom, y: yFrom }, { x: xTo, y: yTo }); + // Drive a dedicated `pathRotation` value (composed onto `rotate` + // at the build sites) rather than `rotate` itself, so a + // concurrent rotate animation composes and nothing accumulates + // on interrupt. + const pathRotationValue = interpolate(0).rotate !== undefined + ? visualElement.getValue("pathRotation", 0) + : undefined; + const pathTransition = { + delay, + ...getValueTransition$1(transition || {}, "x"), + }; + delete pathTransition.path; + const progress = motionValue(0); + progress.start(animateMotionValue("", progress, [0, 1000], { + ...pathTransition, + isSync: true, + velocity: 0, + onUpdate: (latest) => { + const point = interpolate(latest / 1000); + xValue?.set(point.x); + yValue?.set(point.y); + if (pathRotationValue && point.rotate !== undefined) { + pathRotationValue.set(point.rotate); + } + }, + onComplete: () => { + xValue?.set(xTo); + yValue?.set(yTo); + pathRotationValue?.set(0); + }, + // Interrupt/cancel must clear our additive contribution + // so it can't linger on top of the user's `rotate`. + onStop: () => pathRotationValue?.set(0), + onCancel: () => pathRotationValue?.set(0), + })); + if (progress.animation) + animations.push(progress.animation); + delete target.x; + delete target.y; + }, + }; + return path; + } + + /** + * Parse Framer's special CSS variable format into a CSS token and a fallback. + * + * ``` + * `var(--foo, #fff)` => [`--foo`, '#fff'] + * ``` + * + * @param current + */ + const splitCSSVariableRegex = + // eslint-disable-next-line redos-detector/no-unsafe-regex -- false positive, as it can match a lot of words + /^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u; + function parseCSSVariable(current) { + const match = splitCSSVariableRegex.exec(current); + if (!match) + return [,]; + const [, token1, token2, fallback] = match; + return [`--${token1 ?? token2}`, fallback]; + } + const maxDepth = 4; + function getVariableValue(current, element, depth = 1) { + exports.invariant(depth <= maxDepth, `Max CSS variable fallback depth detected in property "${current}". This may indicate a circular fallback dependency.`, "max-css-var-depth"); + const [token, fallback] = parseCSSVariable(current); + // No CSS variable detected + if (!token) + return; + // Attempt to read this CSS variable off the element + const resolved = window.getComputedStyle(element).getPropertyValue(token); + if (resolved) { + const trimmed = resolved.trim(); + return isNumericalString(trimmed) ? parseFloat(trimmed) : trimmed; + } + return isCSSVariableToken(fallback) + ? getVariableValue(fallback, element, depth + 1) + : fallback; + } + + function getValueState(visualElement) { + const state = [{}, {}]; + visualElement?.values.forEach((value, key) => { + state[0][key] = value.get(); + state[1][key] = value.getVelocity(); + }); + return state; + } + function resolveVariantFromProps(props, definition, custom, visualElement) { + /** + * If the variant definition is a function, resolve. + */ + if (typeof definition === "function") { + const [current, velocity] = getValueState(visualElement); + definition = definition(custom !== undefined ? custom : props.custom, current, velocity); + } + /** + * If the variant definition is a variant label, or + * the function returned a variant label, resolve. + */ + if (typeof definition === "string") { + definition = props.variants && props.variants[definition]; + } + /** + * At this point we've resolved both functions and variant labels, + * but the resolved variant label might itself have been a function. + * If so, resolve. This can only have returned a valid target object. + */ + if (typeof definition === "function") { + const [current, velocity] = getValueState(visualElement); + definition = definition(custom !== undefined ? custom : props.custom, current, velocity); + } + return definition; + } + + function resolveVariant(visualElement, definition, custom) { + const props = visualElement.getProps(); + return resolveVariantFromProps(props, definition, custom !== undefined ? custom : props.custom, visualElement); + } + + const positionalKeys = new Set([ + "width", + "height", + "top", + "left", + "right", + "bottom", + ...transformPropOrder, + ]); + + const isKeyframesTarget = (v) => { + return Array.isArray(v); + }; + + /** + * Set VisualElement's MotionValue, creating a new MotionValue for it if + * it doesn't exist. + */ + function setMotionValue(visualElement, key, value) { + if (visualElement.hasValue(key)) { + visualElement.getValue(key).set(value); + } + else { + visualElement.addValue(key, motionValue(value)); + } + } + function resolveFinalValueInKeyframes(v) { + // TODO maybe throw if v.length - 1 is placeholder token? + return isKeyframesTarget(v) ? v[v.length - 1] || 0 : v; + } + function setTarget(visualElement, definition) { + const resolved = resolveVariant(visualElement, definition); + let { transitionEnd = {}, transition = {}, ...target } = resolved || {}; + target = { ...target, ...transitionEnd }; + for (const key in target) { + const value = resolveFinalValueInKeyframes(target[key]); + setMotionValue(visualElement, key, value); + } + } + + const isMotionValue = (value) => Boolean(value && value.getVelocity); + + function isWillChangeMotionValue(value) { + return Boolean(isMotionValue(value) && value.add); + } + + function addValueToWillChange(visualElement, key) { + const willChange = visualElement.getValue("willChange"); + /** + * It could be that a user has set willChange to a regular MotionValue, + * in which case we can't add the value to it. + */ + if (isWillChangeMotionValue(willChange)) { + return willChange.add(key); + } + else if (!willChange && MotionGlobalConfig.WillChange) { + const newWillChange = new MotionGlobalConfig.WillChange("auto"); + visualElement.addValue("willChange", newWillChange); + newWillChange.add(key); + } + } + + function camelToDash(str) { + return str.replace(/([A-Z])/g, (match) => `-${match.toLowerCase()}`); + } + + const optimizedAppearDataId = "framerAppearId"; + const optimizedAppearDataAttribute = "data-" + camelToDash(optimizedAppearDataId); + + function getOptimisedAppearId(visualElement) { + return visualElement.props[optimizedAppearDataAttribute]; + } + + /** + * Decide whether we should block this animation. Previously, we achieved this + * just by checking whether the key was listed in protectedKeys, but this + * posed problems if an animation was triggered by afterChildren and protectedKeys + * had been set to true in the meantime. + */ + function shouldBlockAnimation({ protectedKeys, needsAnimating }, key) { + const shouldBlock = protectedKeys.hasOwnProperty(key) && needsAnimating[key] !== true; + needsAnimating[key] = false; + return shouldBlock; + } + function animateTarget(visualElement, targetAndTransition, { delay = 0, transitionOverride, type } = {}) { + let { transition, transitionEnd, ...target } = targetAndTransition; + const defaultTransition = visualElement.getDefaultTransition(); + transition = transition + ? resolveTransition(transition, defaultTransition) + : defaultTransition; + const reduceMotion = transition?.reduceMotion; + const skipAnimations = transition?.skipAnimations; + if (transitionOverride) + transition = transitionOverride; + const animations = []; + const animationTypeState = type && + visualElement.animationState && + visualElement.animationState.getState()[type]; + const path = transition?.path; + if (path) { + // path mutates `target` to claim x/y; loop below skips them. + path.animateVisualElement(visualElement, target, transition, delay, animations); + } + for (const key in target) { + const value = visualElement.getValue(key, visualElement.latestValues[key] ?? null); + const valueTarget = target[key]; + if (valueTarget === undefined || + (animationTypeState && + shouldBlockAnimation(animationTypeState, key))) { + continue; + } + const valueTransition = { + delay, + ...getValueTransition$1(transition || {}, key), + }; + if (skipAnimations) + valueTransition.skipAnimations = true; + /** + * If the value is already at the defined target, skip the animation. + * We still re-assert the value via frame.update to take precedence + * over any stale transitionEnd callbacks from previous animations. + */ + const currentValue = value.get(); + if (currentValue !== undefined && + !value.isAnimating() && + !Array.isArray(valueTarget) && + valueTarget === currentValue && + !valueTransition.velocity) { + frame.update(() => value.set(valueTarget)); + continue; + } + /** + * If this is the first time a value is being animated, check + * to see if we're handling off from an existing animation. + */ + let isHandoff = false; + if (window.MotionHandoffAnimation) { + const appearId = getOptimisedAppearId(visualElement); + if (appearId) { + const startTime = window.MotionHandoffAnimation(appearId, key, frame); + if (startTime !== null) { + valueTransition.startTime = startTime; + isHandoff = true; + } + } + } + addValueToWillChange(visualElement, key); + const shouldReduceMotion = reduceMotion ?? visualElement.shouldReduceMotion; + value.start(animateMotionValue(key, value, valueTarget, shouldReduceMotion && positionalKeys.has(key) + ? { type: false } + : valueTransition, visualElement, isHandoff)); + const animation = value.animation; + if (animation) { + animations.push(animation); + } + } + if (transitionEnd) { + const applyTransitionEnd = () => frame.update(() => { + transitionEnd && setTarget(visualElement, transitionEnd); + }); + if (animations.length) { + Promise.all(animations).then(applyTransitionEnd); + } + else { + applyTransitionEnd(); + } + } + return animations; + } + + function animateVariant(visualElement, variant, options = {}) { + const resolved = resolveVariant(visualElement, variant, options.type === "exit" + ? visualElement.presenceContext?.custom + : undefined); + let { transition = visualElement.getDefaultTransition() || {} } = resolved || {}; + if (options.transitionOverride) { + transition = options.transitionOverride; + } + /** + * If we have a variant, create a callback that runs it as an animation. + * Otherwise, we resolve a Promise immediately for a composable no-op. + */ + const getAnimation = resolved + ? () => Promise.all(animateTarget(visualElement, resolved, options)) + : () => Promise.resolve(); + /** + * If we have children, create a callback that runs all their animations. + * Otherwise, we resolve a Promise immediately for a composable no-op. + */ + const getChildAnimations = visualElement.variantChildren && visualElement.variantChildren.size + ? (forwardDelay = 0) => { + const { delayChildren = 0, staggerChildren, staggerDirection, } = transition; + return animateChildren(visualElement, variant, forwardDelay, delayChildren, staggerChildren, staggerDirection, options); + } + : () => Promise.resolve(); + /** + * If the transition explicitly defines a "when" option, we need to resolve either + * this animation or all children animations before playing the other. + */ + const { when } = transition; + if (when) { + const [first, last] = when === "beforeChildren" + ? [getAnimation, getChildAnimations] + : [getChildAnimations, getAnimation]; + return first().then(() => last()); + } + else { + return Promise.all([getAnimation(), getChildAnimations(options.delay)]); + } + } + function animateChildren(visualElement, variant, delay = 0, delayChildren = 0, staggerChildren = 0, staggerDirection = 1, options) { + const animations = []; + for (const child of visualElement.variantChildren) { + child.notify("AnimationStart", variant); + animations.push(animateVariant(child, variant, { + ...options, + delay: delay + + (typeof delayChildren === "function" ? 0 : delayChildren) + + calcChildStagger(visualElement.variantChildren, child, delayChildren, staggerChildren, staggerDirection), + }).then(() => child.notify("AnimationComplete", variant))); + } + return Promise.all(animations); + } + + function animateVisualElement(visualElement, definition, options = {}) { + visualElement.notify("AnimationStart", definition); + let animation; + if (Array.isArray(definition)) { + const animations = definition.map((variant) => animateVariant(visualElement, variant, options)); + animation = Promise.all(animations); + } + else if (typeof definition === "string") { + animation = animateVariant(visualElement, definition, options); + } + else { + const resolvedDefinition = typeof definition === "function" + ? resolveVariant(visualElement, definition, options.custom) + : definition; + animation = Promise.all(animateTarget(visualElement, resolvedDefinition, options)); + } + return animation.then(() => { + visualElement.notify("AnimationComplete", definition); + }); + } + + /** + * ValueType for "auto" + */ + const auto = { + test: (v) => v === "auto", + parse: (v) => v, + }; + + /** + * Tests a provided value against a ValueType + */ + const testValueType = (v) => (type) => type.test(v); + + /** + * A list of value types commonly used for dimensions + */ + const dimensionValueTypes = [number, px, percent, degrees, vw, vh, auto]; + /** + * Tests a dimensional value against the list of dimension ValueTypes + */ + const findDimensionValueType = (v) => dimensionValueTypes.find(testValueType(v)); + + function isNone(value) { + if (typeof value === "number") { + return value === 0; + } + else if (value !== null) { + return value === "none" || value === "0" || isZeroValueString(value); + } + else { + return true; + } + } + + /** + * Properties that should default to 1 or 100% + */ + const maxDefaults = new Set(["brightness", "contrast", "saturate", "opacity"]); + function applyDefaultFilter(v) { + const [name, value] = v.slice(0, -1).split("("); + if (name === "drop-shadow") + return v; + const [number] = value.match(floatRegex) || []; + if (!number) + return v; + const unit = value.replace(number, ""); + let defaultValue = maxDefaults.has(name) ? 1 : 0; + if (number !== value) + defaultValue *= 100; + return name + "(" + defaultValue + unit + ")"; + } + const functionRegex = /\b([a-z-]*)\(.*?\)/gu; + const filter = { + ...complex, + getAnimatableNone: (v) => { + const functions = v.match(functionRegex); + return functions ? functions.map(applyDefaultFilter).join(" ") : v; + }, + }; + + const mask = { + ...complex, + getAnimatableNone: (v) => { + const parsed = complex.parse(v); + const transformer = complex.createTransformer(v); + return transformer(parsed.map((v) => typeof v === "number" ? 0 : typeof v === "object" ? { ...v, alpha: 1 } : v)); + }, + }; + + const int = { + ...number, + transform: Math.round, + }; + + const transformValueTypes = { + rotate: degrees, + /** + * Internal channel for `transition.path` orientToPath. Composed onto + * `rotate` at the transform-build sites so the user's `rotate` is + * never read or overwritten. Not part of `transformPropOrder`. + */ + pathRotation: degrees, + rotateX: degrees, + rotateY: degrees, + rotateZ: degrees, + scale, + scaleX: scale, + scaleY: scale, + scaleZ: scale, + skew: degrees, + skewX: degrees, + skewY: degrees, + distance: px, + translateX: px, + translateY: px, + translateZ: px, + x: px, + y: px, + z: px, + perspective: px, + transformPerspective: px, + opacity: alpha, + originX: progressPercentage, + originY: progressPercentage, + originZ: px, + }; + + const numberValueTypes = { + // Border props + borderWidth: px, + borderTopWidth: px, + borderRightWidth: px, + borderBottomWidth: px, + borderLeftWidth: px, + borderRadius: px, + borderTopLeftRadius: px, + borderTopRightRadius: px, + borderBottomRightRadius: px, + borderBottomLeftRadius: px, + // Positioning props + width: px, + maxWidth: px, + height: px, + maxHeight: px, + top: px, + right: px, + bottom: px, + left: px, + inset: px, + insetBlock: px, + insetBlockStart: px, + insetBlockEnd: px, + insetInline: px, + insetInlineStart: px, + insetInlineEnd: px, + // Spacing props + padding: px, + paddingTop: px, + paddingRight: px, + paddingBottom: px, + paddingLeft: px, + paddingBlock: px, + paddingBlockStart: px, + paddingBlockEnd: px, + paddingInline: px, + paddingInlineStart: px, + paddingInlineEnd: px, + margin: px, + marginTop: px, + marginRight: px, + marginBottom: px, + marginLeft: px, + marginBlock: px, + marginBlockStart: px, + marginBlockEnd: px, + marginInline: px, + marginInlineStart: px, + marginInlineEnd: px, + // Typography + fontSize: px, + // Misc + backgroundPositionX: px, + backgroundPositionY: px, + ...transformValueTypes, + zIndex: int, + // SVG + fillOpacity: alpha, + strokeOpacity: alpha, + numOctaves: int, + }; + + /** + * A map of default value types for common values + */ + const defaultValueTypes = { + ...numberValueTypes, + // Color props + color, + backgroundColor: color, + outlineColor: color, + fill: color, + stroke: color, + // Border props + borderColor: color, + borderTopColor: color, + borderRightColor: color, + borderBottomColor: color, + borderLeftColor: color, + filter, + WebkitFilter: filter, + mask, + WebkitMask: mask, + }; + /** + * Gets the default ValueType for the provided value key + */ + const getDefaultValueType = (key) => defaultValueTypes[key]; + + const customTypes = /*@__PURE__*/ new Set([filter, mask]); + function getAnimatableNone(key, value) { + let defaultValueType = getDefaultValueType(key); + if (!customTypes.has(defaultValueType)) + defaultValueType = complex; + // If value is not recognised as animatable, ie "none", create an animatable version origin based on the target + return defaultValueType.getAnimatableNone + ? defaultValueType.getAnimatableNone(value) + : undefined; + } + + /** + * If we encounter keyframes like "none" or "0" and we also have keyframes like + * "#fff" or "200px 200px" we want to find a keyframe to serve as a template for + * the "none" keyframes. In this case "#fff" or "200px 200px" - then these get turned into + * zero equivalents, i.e. "#fff0" or "0px 0px". + */ + const invalidTemplates = new Set(["auto", "none", "0"]); + function makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, name) { + let i = 0; + let animatableTemplate = undefined; + while (i < unresolvedKeyframes.length && !animatableTemplate) { + const keyframe = unresolvedKeyframes[i]; + if (typeof keyframe === "string" && + !invalidTemplates.has(keyframe) && + analyseComplexValue(keyframe).values.length) { + animatableTemplate = unresolvedKeyframes[i]; + } + i++; + } + if (animatableTemplate && name) { + for (const noneIndex of noneKeyframeIndexes) { + unresolvedKeyframes[noneIndex] = getAnimatableNone(name, animatableTemplate); + } + } + } + + class DOMKeyframesResolver extends KeyframeResolver { + constructor(unresolvedKeyframes, onComplete, name, motionValue, element) { + super(unresolvedKeyframes, onComplete, name, motionValue, element, true); + } + readKeyframes() { + const { unresolvedKeyframes, element, name } = this; + if (!element || !element.current) + return; + super.readKeyframes(); + /** + * If any keyframe is a CSS variable, we need to find its value by sampling the element + */ + for (let i = 0; i < unresolvedKeyframes.length; i++) { + let keyframe = unresolvedKeyframes[i]; + if (typeof keyframe === "string") { + keyframe = keyframe.trim(); + if (isCSSVariableToken(keyframe)) { + const resolved = getVariableValue(keyframe, element.current); + if (resolved !== undefined) { + unresolvedKeyframes[i] = resolved; + } + if (i === unresolvedKeyframes.length - 1) { + this.finalKeyframe = keyframe; + } + } + } + } + /** + * Resolve "none" values. We do this potentially twice - once before and once after measuring keyframes. + * This could be seen as inefficient but it's a trade-off to avoid measurements in more situations, which + * have a far bigger performance impact. + */ + this.resolveNoneKeyframes(); + /** + * Check to see if unit type has changed. If so schedule jobs that will + * temporarily set styles to the destination keyframes. + * Skip if we have more than two keyframes or this isn't a positional value. + * TODO: We can throw if there are multiple keyframes and the value type changes. + */ + if (!positionalKeys.has(name) || unresolvedKeyframes.length !== 2) { + return; + } + const [origin, target] = unresolvedKeyframes; + const originType = findDimensionValueType(origin); + const targetType = findDimensionValueType(target); + /** + * If one keyframe contains embedded CSS variables (e.g. in calc()) and the other + * doesn't, we need to measure to convert to pixels. This handles GitHub issue #3410. + */ + const originHasVar = containsCSSVariable(origin); + const targetHasVar = containsCSSVariable(target); + if (originHasVar !== targetHasVar && positionalValues[name]) { + this.needsMeasurement = true; + return; + } + /** + * Either we don't recognise these value types or we can animate between them. + */ + if (originType === targetType) + return; + /** + * If both values are numbers or pixels, we can animate between them by + * converting them to numbers. + */ + if (isNumOrPxType(originType) && isNumOrPxType(targetType)) { + for (let i = 0; i < unresolvedKeyframes.length; i++) { + const value = unresolvedKeyframes[i]; + if (typeof value === "string") { + unresolvedKeyframes[i] = parseFloat(value); + } + } + } + else if (positionalValues[name]) { + /** + * Else, the only way to resolve this is by measuring the element. + */ + this.needsMeasurement = true; + } + } + resolveNoneKeyframes() { + const { unresolvedKeyframes, name } = this; + const noneKeyframeIndexes = []; + for (let i = 0; i < unresolvedKeyframes.length; i++) { + if (unresolvedKeyframes[i] === null || + isNone(unresolvedKeyframes[i])) { + noneKeyframeIndexes.push(i); + } + } + if (noneKeyframeIndexes.length) { + makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, name); + } + } + measureInitialState() { + const { element, unresolvedKeyframes, name } = this; + if (!element || !element.current) + return; + if (name === "height") { + this.suspendedScrollY = window.pageYOffset; + } + this.measuredOrigin = positionalValues[name](element.measureViewportBox(), window.getComputedStyle(element.current)); + unresolvedKeyframes[0] = this.measuredOrigin; + // Set final key frame to measure after next render + const measureKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1]; + if (measureKeyframe !== undefined) { + element.getValue(name, measureKeyframe).jump(measureKeyframe, false); + } + } + measureEndState() { + const { element, name, unresolvedKeyframes } = this; + if (!element || !element.current) + return; + const value = element.getValue(name); + value && value.jump(this.measuredOrigin, false); + const finalKeyframeIndex = unresolvedKeyframes.length - 1; + const finalKeyframe = unresolvedKeyframes[finalKeyframeIndex]; + unresolvedKeyframes[finalKeyframeIndex] = positionalValues[name](element.measureViewportBox(), window.getComputedStyle(element.current)); + if (finalKeyframe !== null && this.finalKeyframe === undefined) { + this.finalKeyframe = finalKeyframe; + } + // If we removed transform values, reapply them before the next render + if (this.removedTransforms?.length) { + this.removedTransforms.forEach(([unsetTransformName, unsetTransformValue]) => { + element + .getValue(unsetTransformName) + .set(unsetTransformValue); + }); + } + this.resolveNoneKeyframes(); + } + } + + /** + * The four corner-radius longhands. Shared so the projection mixer, scale + * corrector, WAAPI px-value set and view-transition crop pass don't each carry + * their own copy. Order is irrelevant - every consumer mixes/corrects/animates + * each corner independently. + */ + const cornerRadiusProps = [ + "borderTopLeftRadius", + "borderTopRightRadius", + "borderBottomRightRadius", + "borderBottomLeftRadius", + ]; + + const pxValues = new Set([ + // Border props + "borderWidth", + "borderTopWidth", + "borderRightWidth", + "borderBottomWidth", + "borderLeftWidth", + "borderRadius", + ...cornerRadiusProps, + // Positioning props + "width", + "maxWidth", + "height", + "maxHeight", + "top", + "right", + "bottom", + "left", + "inset", + "insetBlock", + "insetBlockStart", + "insetBlockEnd", + "insetInline", + "insetInlineStart", + "insetInlineEnd", + // Spacing props + "padding", + "paddingTop", + "paddingRight", + "paddingBottom", + "paddingLeft", + "paddingBlock", + "paddingBlockStart", + "paddingBlockEnd", + "paddingInline", + "paddingInlineStart", + "paddingInlineEnd", + "margin", + "marginTop", + "marginRight", + "marginBottom", + "marginLeft", + "marginBlock", + "marginBlockStart", + "marginBlockEnd", + "marginInline", + "marginInlineStart", + "marginInlineEnd", + // Typography + "fontSize", + // Misc + "backgroundPositionX", + "backgroundPositionY", + ]); + + function applyPxDefaults(keyframes, name) { + for (let i = 0; i < keyframes.length; i++) { + if (typeof keyframes[i] === "number" && pxValues.has(name)) { + keyframes[i] = keyframes[i] + "px"; + } + } + } + + function isWaapiSupportedEasing(easing) { + return Boolean((typeof easing === "function" && supportsLinearEasing()) || + !easing || + (typeof easing === "string" && + (easing in supportedWaapiEasing || supportsLinearEasing())) || + isBezierDefinition(easing) || + (Array.isArray(easing) && easing.every(isWaapiSupportedEasing))); + } + + const supportsPartialKeyframes = /*@__PURE__*/ memo(() => { + try { + document.createElement("div").animate({ opacity: [1] }); + } + catch (e) { + return false; + } + return true; + }); + + function resolveElements(elementOrSelector, scope, selectorCache) { + if (elementOrSelector == null) { + return []; + } + if (elementOrSelector instanceof EventTarget) { + return [elementOrSelector]; + } + else if (typeof elementOrSelector === "string") { + let root = document; + if (scope) { + root = scope.current; + } + const elements = selectorCache?.[elementOrSelector] ?? + root.querySelectorAll(elementOrSelector); + return elements ? Array.from(elements) : []; + } + return Array.from(elementOrSelector).filter((element) => element != null); + } + + function createSelectorEffect(subjectEffect) { + return (subject, values) => { + const elements = resolveElements(subject); + const subscriptions = []; + for (const element of elements) { + const remove = subjectEffect(element, values); + subscriptions.push(remove); + } + return () => { + for (const remove of subscriptions) + remove(); + }; + }; + } + + /** + * Provided a value and a ValueType, returns the value as that value type. + */ + const getValueAsType = (value, type) => { + return type && typeof value === "number" + ? type.transform(value) + : value; + }; + + class MotionValueState { + constructor() { + this.latest = {}; + this.values = new Map(); + } + set(name, value, render, computed, useDefaultValueType = true) { + const existingValue = this.values.get(name); + if (existingValue) { + existingValue.onRemove(); + } + const onChange = () => { + const v = value.get(); + if (useDefaultValueType) { + this.latest[name] = getValueAsType(v, numberValueTypes[name]); + } + else { + this.latest[name] = v; + } + render && frame.render(render); + }; + onChange(); + const cancelOnChange = value.on("change", onChange); + computed && value.addDependent(computed); + const remove = () => { + cancelOnChange(); + render && cancelFrame(render); + this.values.delete(name); + computed && value.removeDependent(computed); + }; + this.values.set(name, { value, onRemove: remove }); + return remove; + } + get(name) { + return this.values.get(name)?.value; + } + } + + function createEffect(addValue) { + const stateCache = new WeakMap(); + return (subject, values) => { + const state = stateCache.get(subject) ?? new MotionValueState(); + stateCache.set(subject, state); + const subscriptions = []; + for (const key in values) { + const value = values[key]; + const remove = addValue(subject, state, key, value); + subscriptions.push(remove); + } + return () => { + for (const cancel of subscriptions) + cancel(); + }; + }; + } + + function canSetAsProperty(element, name) { + if (!(name in element)) + return false; + const descriptor = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(element), name) || + Object.getOwnPropertyDescriptor(element, name); + // Check if it has a setter + return descriptor && typeof descriptor.set === "function"; + } + const addAttrValue = (element, state, key, value) => { + const isProp = canSetAsProperty(element, key); + const name = isProp + ? key + : key.startsWith("data") || key.startsWith("aria") + ? camelToDash(key) + : key; + /** + * Set attribute directly via property if available + */ + const render = isProp + ? () => { + element[name] = state.latest[key]; + } + : () => { + const v = state.latest[key]; + if (v === null || v === undefined) { + element.removeAttribute(name); + } + else { + element.setAttribute(name, String(v)); + } + }; + return state.set(key, value, render); + }; + const attrEffect = /*@__PURE__*/ createSelectorEffect( + /*@__PURE__*/ createEffect(addAttrValue)); + + const propEffect = /*@__PURE__*/ createEffect((subject, state, key, value) => { + return state.set(key, value, () => { + subject[key] = state.latest[key]; + }, undefined, false); + }); + + /** + * Checks if an element is an HTML element in a way + * that works across iframes + */ + function isHTMLElement(element) { + return (isObject(element) && + "offsetHeight" in element && + !("ownerSVGElement" in element)); + } + + const translateAlias$1 = { + x: "translateX", + y: "translateY", + z: "translateZ", + transformPerspective: "perspective", + }; + function buildTransform$1(state) { + let transform = ""; + let transformIsDefault = true; + /** + * Loop over all possible transforms in order, adding the ones that + * are present to the transform string. + */ + for (let i = 0; i < transformPropOrder.length; i++) { + const key = transformPropOrder[i]; + const value = state.latest[key]; + if (value === undefined) + continue; + let valueIsDefault = true; + if (typeof value === "number") { + valueIsDefault = value === (key.startsWith("scale") ? 1 : 0); + } + else { + const parsed = parseFloat(value); + valueIsDefault = key.startsWith("scale") ? parsed === 1 : parsed === 0; + } + if (!valueIsDefault) { + transformIsDefault = false; + const transformName = translateAlias$1[key] || key; + transform += `${transformName}(${value}) `; + } + } + // See build-transform.ts: additive `rotate()` so user `rotate` isn't + // clobbered. Not a `transformPropOrder` slot. + const pathRotation = state.latest.pathRotation; + if (pathRotation) { + transformIsDefault = false; + transform += `rotate(${typeof pathRotation === "number" + ? `${pathRotation}deg` + : pathRotation}) `; + } + return transformIsDefault ? "none" : transform.trim(); + } + + const originProps = new Set(["originX", "originY", "originZ"]); + const addStyleValue = (element, state, key, value) => { + let render = undefined; + let computed = undefined; + if (transformProps.has(key)) { + if (!state.get("transform")) { + // If this is an HTML element, we need to set the transform-box to fill-box + // to normalise the transform relative to the element's bounding box + if (!isHTMLElement(element) && !state.get("transformBox")) { + addStyleValue(element, state, "transformBox", new MotionValue("fill-box")); + } + state.set("transform", new MotionValue("none"), () => { + element.style.transform = buildTransform$1(state); + }); + } + computed = state.get("transform"); + } + else if (originProps.has(key)) { + if (!state.get("transformOrigin")) { + state.set("transformOrigin", new MotionValue(""), () => { + const originX = state.latest.originX ?? "50%"; + const originY = state.latest.originY ?? "50%"; + const originZ = state.latest.originZ ?? 0; + element.style.transformOrigin = `${originX} ${originY} ${originZ}`; + }); + } + computed = state.get("transformOrigin"); + } + else if (isCSSVar(key)) { + render = () => { + element.style.setProperty(key, state.latest[key]); + }; + } + else { + render = () => { + element.style[key] = state.latest[key]; + }; + } + return state.set(key, value, render, computed); + }; + const styleEffect = /*@__PURE__*/ createSelectorEffect( + /*@__PURE__*/ createEffect(addStyleValue)); + + function addSVGPathValue(element, state, key, value) { + frame.render(() => element.setAttribute("pathLength", "1")); + if (key === "pathOffset") { + return state.set(key, value, () => { + // Use unitless value to avoid Safari zoom bug + const offset = state.latest[key]; + element.setAttribute("stroke-dashoffset", `${-offset}`); + }); + } + else { + if (!state.get("stroke-dasharray")) { + state.set("stroke-dasharray", new MotionValue("1 1"), () => { + const { pathLength = 1, pathSpacing } = state.latest; + // Use unitless values to avoid Safari zoom bug + element.setAttribute("stroke-dasharray", `${pathLength} ${pathSpacing ?? 1 - Number(pathLength)}`); + }); + } + return state.set(key, value, undefined, state.get("stroke-dasharray")); + } + } + const addSVGValue = (element, state, key, value) => { + if (key.startsWith("path")) { + return addSVGPathValue(element, state, key, value); + } + else if (key.startsWith("attr")) { + return addAttrValue(element, state, convertAttrKey(key), value); + } + const handler = key in element.style ? addStyleValue : addAttrValue; + return handler(element, state, key, value); + }; + const svgEffect = /*@__PURE__*/ createSelectorEffect( + /*@__PURE__*/ createEffect(addSVGValue)); + function convertAttrKey(key) { + return key.replace(/^attr([A-Z])/, (_, firstChar) => firstChar.toLowerCase()); + } + + const { schedule: microtask, cancel: cancelMicrotask } = + /* @__PURE__ */ createRenderBatcher(queueMicrotask, false); + + const isDragging = { + x: false, + y: false, + }; + function isDragActive() { + return isDragging.x || isDragging.y; + } + + function setDragLock(axis) { + if (axis === "x" || axis === "y") { + if (isDragging[axis]) { + return null; + } + else { + isDragging[axis] = true; + return () => { + isDragging[axis] = false; + }; + } + } + else { + if (isDragging.x || isDragging.y) { + return null; + } + else { + isDragging.x = isDragging.y = true; + return () => { + isDragging.x = isDragging.y = false; + }; + } + } + } + + function setupGesture(elementOrSelector, options) { + const elements = resolveElements(elementOrSelector); + const gestureAbortController = new AbortController(); + const eventOptions = { + passive: true, + ...options, + signal: gestureAbortController.signal, + }; + const cancel = () => gestureAbortController.abort(); + return [elements, eventOptions, cancel]; + } + + function isValidHover(event) { + return !(event.pointerType === "touch" || isDragActive()); + } + /** + * Create a hover gesture. hover() is different to .addEventListener("pointerenter") + * in that it has an easier syntax, filters out polyfilled touch events, interoperates + * with drag gestures, and automatically removes the "pointerennd" event listener when the hover ends. + * + * @public + */ + function hover(elementOrSelector, onHoverStart, options = {}) { + const [elements, eventOptions, cancel] = setupGesture(elementOrSelector, options); + elements.forEach((element) => { + let isPressed = false; + let deferredHoverEnd = false; + let hoverEndCallback; + const removePointerLeave = () => { + element.removeEventListener("pointerleave", onPointerLeave); + }; + const endHover = (event) => { + if (hoverEndCallback) { + hoverEndCallback(event); + hoverEndCallback = undefined; + } + removePointerLeave(); + }; + const onPointerUp = (event) => { + isPressed = false; + window.removeEventListener("pointerup", onPointerUp); + window.removeEventListener("pointercancel", onPointerUp); + if (deferredHoverEnd) { + deferredHoverEnd = false; + endHover(event); + } + }; + const onPointerDown = () => { + isPressed = true; + window.addEventListener("pointerup", onPointerUp, eventOptions); + window.addEventListener("pointercancel", onPointerUp, eventOptions); + }; + const onPointerLeave = (leaveEvent) => { + if (leaveEvent.pointerType === "touch") + return; + if (isPressed) { + deferredHoverEnd = true; + return; + } + endHover(leaveEvent); + }; + const onPointerEnter = (enterEvent) => { + if (!isValidHover(enterEvent)) + return; + deferredHoverEnd = false; + const onHoverEnd = onHoverStart(element, enterEvent); + if (typeof onHoverEnd !== "function") + return; + hoverEndCallback = onHoverEnd; + element.addEventListener("pointerleave", onPointerLeave, eventOptions); + }; + element.addEventListener("pointerenter", onPointerEnter, eventOptions); + element.addEventListener("pointerdown", onPointerDown, eventOptions); + }); + return cancel; + } + + /** + * Recursively traverse up the tree to check whether the provided child node + * is the parent or a descendant of it. + * + * @param parent - Element to find + * @param child - Element to test against parent + */ + const isNodeOrChild = (parent, child) => { + if (!child) { + return false; + } + else if (parent === child) { + return true; + } + else { + return isNodeOrChild(parent, child.parentElement); + } + }; + + const isPrimaryPointer = (event) => { + if (event.pointerType === "mouse") { + return typeof event.button !== "number" || event.button <= 0; + } + else { + /** + * isPrimary is true for all mice buttons, whereas every touch point + * is regarded as its own input. So subsequent concurrent touch points + * will be false. + * + * Specifically match against false here as incomplete versions of + * PointerEvents in very old browser might have it set as undefined. + */ + return event.isPrimary !== false; + } + }; + + const keyboardAccessibleElements = new Set([ + "BUTTON", + "INPUT", + "SELECT", + "TEXTAREA", + "A", + ]); + /** + * Checks if an element is natively keyboard accessible (focusable). + * Used by the press gesture to determine if we need to add tabIndex. + */ + function isElementKeyboardAccessible(element) { + return (keyboardAccessibleElements.has(element.tagName) || + element.isContentEditable === true); + } + const textInputElements = new Set(["INPUT", "SELECT", "TEXTAREA"]); + /** + * Checks if an element has text selection or direct interaction behavior + * that should block drag gestures from starting. + * + * This specifically targets form controls where the user might want to select + * text or interact with the control (e.g., sliders, dropdowns). + * + * Buttons and links are NOT included because they don't have click-and-move + * actions of their own - they only respond to click events, so dragging + * should still work when initiated from these elements. + */ + function isElementTextInput(element) { + return (textInputElements.has(element.tagName) || + element.isContentEditable === true); + } + + const isPressing = new WeakSet(); + + /** + * Filter out events that are not "Enter" keys. + */ + function filterEvents(callback) { + return (event) => { + if (event.key !== "Enter") + return; + callback(event); + }; + } + function firePointerEvent(target, type) { + target.dispatchEvent(new PointerEvent("pointer" + type, { isPrimary: true, bubbles: true })); + } + const enableKeyboardPress = (focusEvent, eventOptions) => { + const element = focusEvent.currentTarget; + if (!element) + return; + const handleKeydown = filterEvents(() => { + if (isPressing.has(element)) + return; + firePointerEvent(element, "down"); + const handleKeyup = filterEvents(() => { + firePointerEvent(element, "up"); + }); + const handleBlur = () => firePointerEvent(element, "cancel"); + element.addEventListener("keyup", handleKeyup, eventOptions); + element.addEventListener("blur", handleBlur, eventOptions); + }); + element.addEventListener("keydown", handleKeydown, eventOptions); + /** + * Add an event listener that fires on blur to remove the keydown events. + */ + element.addEventListener("blur", () => element.removeEventListener("keydown", handleKeydown), eventOptions); + }; + + /** + * Filter out events that are not primary pointer events, or are triggering + * while a Motion gesture is active. + */ + function isValidPressEvent(event) { + return isPrimaryPointer(event) && !isDragActive(); + } + const claimedPointerDownEvents = new WeakSet(); + /** + * Create a press gesture. + * + * Press is different to `"pointerdown"`, `"pointerup"` in that it + * automatically filters out secondary pointer events like right + * click and multitouch. + * + * It also adds accessibility support for keyboards, where + * an element with a press gesture will receive focus and + * trigger on Enter `"keydown"` and `"keyup"` events. + * + * This is different to a browser's `"click"` event, which does + * respond to keyboards but only for the `"click"` itself, rather + * than the press start and end/cancel. The element also needs + * to be focusable for this to work, whereas a press gesture will + * make an element focusable by default. + * + * @public + */ + function press(targetOrSelector, onPressStart, options = {}) { + const [targets, eventOptions, cancelEvents] = setupGesture(targetOrSelector, options); + const startPress = (startEvent) => { + const target = startEvent.currentTarget; + if (!isValidPressEvent(startEvent)) + return; + if (claimedPointerDownEvents.has(startEvent)) + return; + isPressing.add(target); + if (options.stopPropagation) { + claimedPointerDownEvents.add(startEvent); + } + const onPressEnd = onPressStart(target, startEvent); + /** + * End listeners run in the capture phase so a descendant calling + * stopPropagation() in its own pointerup handler can't prevent the + * press gesture from ending. This also keeps the gesture-end + * ordering consistent with the drag gesture. See #2794. + */ + const endEventOptions = { ...eventOptions, capture: true }; + const onPointerEnd = (endEvent, success) => { + window.removeEventListener("pointerup", onPointerUp, endEventOptions); + window.removeEventListener("pointercancel", onPointerCancel, endEventOptions); + if (isPressing.has(target)) { + isPressing.delete(target); + } + if (!isValidPressEvent(endEvent)) { + return; + } + if (typeof onPressEnd === "function") { + onPressEnd(endEvent, { success }); + } + }; + const onPointerUp = (upEvent) => { + onPointerEnd(upEvent, target === window || + target === document || + options.useGlobalTarget || + isNodeOrChild(target, upEvent.target)); + }; + const onPointerCancel = (cancelEvent) => { + onPointerEnd(cancelEvent, false); + }; + window.addEventListener("pointerup", onPointerUp, endEventOptions); + window.addEventListener("pointercancel", onPointerCancel, endEventOptions); + }; + targets.forEach((target) => { + const pointerDownTarget = options.useGlobalTarget ? window : target; + pointerDownTarget.addEventListener("pointerdown", startPress, eventOptions); + if (isHTMLElement(target)) { + target.addEventListener("focus", (event) => enableKeyboardPress(event, eventOptions)); + if (!isElementKeyboardAccessible(target) && + !target.hasAttribute("tabindex")) { + target.tabIndex = 0; + } + } + }); + return cancelEvents; + } + + function getComputedStyle$2(element, name) { + const computedStyle = window.getComputedStyle(element); + return isCSSVar(name) + ? computedStyle.getPropertyValue(name) + : computedStyle[name]; + } + + /** + * Checks if an element is an SVG element in a way + * that works across iframes + */ + function isSVGElement(element) { + return isObject(element) && "ownerSVGElement" in element; + } + + const resizeHandlers = new WeakMap(); + let observer; + const getSize = (borderBoxAxis, svgAxis, htmlAxis) => (target, borderBoxSize) => { + if (borderBoxSize && borderBoxSize[0]) { + return borderBoxSize[0][(borderBoxAxis + "Size")]; + } + else if (isSVGElement(target) && "getBBox" in target) { + return target.getBBox()[svgAxis]; + } + else { + return target[htmlAxis]; + } + }; + const getWidth = /*@__PURE__*/ getSize("inline", "width", "offsetWidth"); + const getHeight = /*@__PURE__*/ getSize("block", "height", "offsetHeight"); + function notifyTarget({ target, borderBoxSize }) { + resizeHandlers.get(target)?.forEach((handler) => { + handler(target, { + get width() { + return getWidth(target, borderBoxSize); + }, + get height() { + return getHeight(target, borderBoxSize); + }, + }); + }); + } + function notifyAll(entries) { + entries.forEach(notifyTarget); + } + function createResizeObserver() { + if (typeof ResizeObserver === "undefined") + return; + observer = new ResizeObserver(notifyAll); + } + function resizeElement(target, handler) { + if (!observer) + createResizeObserver(); + const elements = resolveElements(target); + elements.forEach((element) => { + let elementHandlers = resizeHandlers.get(element); + if (!elementHandlers) { + elementHandlers = new Set(); + resizeHandlers.set(element, elementHandlers); + } + elementHandlers.add(handler); + observer?.observe(element); + }); + return () => { + elements.forEach((element) => { + const elementHandlers = resizeHandlers.get(element); + elementHandlers?.delete(handler); + if (!elementHandlers?.size) { + observer?.unobserve(element); + } + }); + }; + } + + const windowCallbacks = new Set(); + let windowResizeHandler; + function createWindowResizeHandler() { + windowResizeHandler = () => { + const info = { + get width() { + return window.innerWidth; + }, + get height() { + return window.innerHeight; + }, + }; + windowCallbacks.forEach((callback) => callback(info)); + }; + window.addEventListener("resize", windowResizeHandler); + } + function resizeWindow(callback) { + windowCallbacks.add(callback); + if (!windowResizeHandler) + createWindowResizeHandler(); + return () => { + windowCallbacks.delete(callback); + if (!windowCallbacks.size && + typeof windowResizeHandler === "function") { + window.removeEventListener("resize", windowResizeHandler); + windowResizeHandler = undefined; + } + }; + } + + function resize(a, b) { + return typeof a === "function" ? resizeWindow(a) : resizeElement(a, b); + } + + function observeTimeline(update, timeline) { + let prevProgress; + const onFrame = () => { + const { currentTime } = timeline; + const percentage = currentTime === null ? 0 : currentTime.value; + const progress = percentage / 100; + if (prevProgress !== progress) { + update(progress); + } + prevProgress = progress; + }; + frame.preUpdate(onFrame, true); + return () => cancelFrame(onFrame); + } + + const statsBuffer = { + value: null, + addProjectionMetrics: null, + }; + + function clearStatsBuffer() { + statsBuffer.value = null; + statsBuffer.addProjectionMetrics = null; + } + function recordStats() { + if (statsBuffer.value) { + clearStatsBuffer(); + throw new Error("Stats are already being measured"); + } + const buffer = statsBuffer; + buffer.value = { + layoutProjection: { + nodes: [], + calculatedTargetDeltas: [], + calculatedProjections: [], + }, + }; + buffer.addProjectionMetrics = (metrics) => { + const { layoutProjection } = buffer.value; + layoutProjection.nodes.push(metrics.nodes); + layoutProjection.calculatedTargetDeltas.push(metrics.calculatedTargetDeltas); + layoutProjection.calculatedProjections.push(metrics.calculatedProjections); + }; + } + + /** + * Checks if an element is specifically an SVGSVGElement (the root SVG element) + * in a way that works across iframes + */ + function isSVGSVGElement(element) { + return isSVGElement(element) && element.tagName === "svg"; + } + + function getOriginIndex(from, total) { + if (from === "first") { + return 0; + } + else { + const lastIndex = total - 1; + return from === "last" ? lastIndex : lastIndex / 2; + } + } + function stagger(duration = 0.1, { startDelay = 0, from = 0, ease } = {}) { + return (i, total) => { + const fromIndex = typeof from === "number" ? from : getOriginIndex(from, total); + const distance = Math.abs(fromIndex - i); + let delay = duration * distance; + if (ease) { + const maxDelay = total * duration; + const easingFunction = easingDefinitionToFunction(ease); + delay = easingFunction(delay / maxDelay) * maxDelay; + } + return startDelay + delay; + }; + } + + function transform(...args) { + const useImmediate = !Array.isArray(args[0]); + const argOffset = useImmediate ? 0 : -1; + const inputValue = args[0 + argOffset]; + const inputRange = args[1 + argOffset]; + const outputRange = args[2 + argOffset]; + const options = args[3 + argOffset]; + const interpolator = interpolate(inputRange, outputRange, options); + return useImmediate ? interpolator(inputValue) : interpolator; + } + + /** + * Create a `MotionValue` that animates to its latest value using any transition type. + * Can either be a value or track another `MotionValue`. + * + * ```jsx + * const x = motionValue(0) + * const y = followValue(x, { type: "spring", stiffness: 300 }) + * // or with tween + * const z = followValue(x, { type: "tween", duration: 0.5, ease: "easeOut" }) + * ``` + * + * @param source - Initial value or MotionValue to track + * @param options - Animation transition options + * @returns `MotionValue` + * + * @public + */ + function followValue(source, options) { + const initialValue = isMotionValue(source) ? source.get() : source; + const value = motionValue(initialValue); + attachFollow(value, source, options); + return value; + } + /** + * Attach an animation to a MotionValue that will animate whenever the value changes. + * Similar to attachSpring but supports any transition type (spring, tween, inertia, etc.) + * + * @param value - The MotionValue to animate + * @param source - Initial value or MotionValue to track + * @param options - Animation transition options + * @returns Cleanup function + * + * @public + */ + function attachFollow(value, source, options = {}) { + const initialValue = value.get(); + let activeAnimation = null; + let latestValue = initialValue; + let latestSetter; + const unit = typeof initialValue === "string" + ? initialValue.replace(/[\d.-]/g, "") + : undefined; + const stopAnimation = () => { + if (activeAnimation) { + activeAnimation.stop(); + activeAnimation = null; + } + value.animation = undefined; + }; + const startAnimation = () => { + const currentValue = asNumber$1(value.get()); + const targetValue = asNumber$1(latestValue); + // Don't animate if we're already at the target + if (currentValue === targetValue) { + stopAnimation(); + return; + } + // Use the running animation's analytical velocity for accuracy, + // falling back to the MotionValue's velocity for the initial animation. + // This prevents systematic velocity loss at high frame rates (240hz+). + const velocity = activeAnimation + ? activeAnimation.getGeneratorVelocity() + : value.getVelocity(); + stopAnimation(); + activeAnimation = new JSAnimation({ + keyframes: [currentValue, targetValue], + velocity, + // Default to spring if no type specified (matches useSpring behavior) + type: "spring", + restDelta: 0.001, + restSpeed: 0.01, + ...options, + onUpdate: latestSetter, + }); + }; + // Use a stable function reference so the frame loop Set deduplicates + // multiple calls within the same frame (e.g. rapid mouse events) + const scheduleAnimation = () => { + startAnimation(); + value.animation = activeAnimation ?? undefined; + value["events"].animationStart?.notify(); + activeAnimation?.then(() => { + value.animation = undefined; + value["events"].animationComplete?.notify(); + }); + }; + value.attach((v, set) => { + latestValue = v; + latestSetter = (latest) => set(parseValue(latest, unit)); + frame.postRender(scheduleAnimation); + }, stopAnimation); + if (isMotionValue(source)) { + let skipNextAnimation = options.skipInitialAnimation === true; + const removeSourceOnChange = source.on("change", (v) => { + if (skipNextAnimation) { + skipNextAnimation = false; + value.jump(parseValue(v, unit), false); + } + else { + value.set(parseValue(v, unit)); + } + }); + const removeValueOnDestroy = value.on("destroy", removeSourceOnChange); + return () => { + removeSourceOnChange(); + removeValueOnDestroy(); + }; + } + return stopAnimation; + } + function parseValue(v, unit) { + return unit ? v + unit : v; + } + function asNumber$1(v) { + return typeof v === "number" ? v : parseFloat(v); + } + + function subscribeValue(inputValues, outputValue, getLatest) { + const update = () => outputValue.set(getLatest()); + const scheduleUpdate = () => frame.preRender(update, false, true); + const subscriptions = inputValues.map((v) => v.on("change", scheduleUpdate)); + outputValue.on("destroy", () => { + subscriptions.forEach((unsubscribe) => unsubscribe()); + cancelFrame(update); + }); + } + + /** + * Create a `MotionValue` that transforms the output of other `MotionValue`s by + * passing their latest values through a transform function. + * + * Whenever a `MotionValue` referred to in the provided function is updated, + * it will be re-evaluated. + * + * ```jsx + * const x = motionValue(0) + * const y = transformValue(() => x.get() * 2) // double x + * ``` + * + * @param transformer - A transform function. This function must be pure with no side-effects or conditional statements. + * @returns `MotionValue` + * + * @public + */ + function transformValue(transform) { + const collectedValues = []; + /** + * Open session of collectMotionValues. Any MotionValue that calls get() + * inside transform will be saved into this array. + */ + collectMotionValues.current = collectedValues; + const initialValue = transform(); + collectMotionValues.current = undefined; + const value = motionValue(initialValue); + subscribeValue(collectedValues, value, transform); + return value; + } + + /** + * Create a `MotionValue` that maps the output of another `MotionValue` by + * mapping it from one range of values into another. + * + * @remarks + * + * Given an input range of `[-200, -100, 100, 200]` and an output range of + * `[0, 1, 1, 0]`, the returned `MotionValue` will: + * + * - When provided a value between `-200` and `-100`, will return a value between `0` and `1`. + * - When provided a value between `-100` and `100`, will return `1`. + * - When provided a value between `100` and `200`, will return a value between `1` and `0` + * + * The input range must be a linear series of numbers. The output range + * can be any value type supported by Motion: numbers, colors, shadows, etc. + * + * Every value in the output range must be of the same type and in the same format. + * + * ```jsx + * const x = motionValue(0) + * const xRange = [-200, -100, 100, 200] + * const opacityRange = [0, 1, 1, 0] + * const opacity = mapValue(x, xRange, opacityRange) + * ``` + * + * @param inputValue - `MotionValue` + * @param inputRange - A linear series of numbers (either all increasing or decreasing) + * @param outputRange - A series of numbers, colors or strings. Must be the same length as `inputRange`. + * @param options - + * + * - clamp: boolean. Clamp values to within the given range. Defaults to `true` + * - ease: EasingFunction[]. Easing functions to use on the interpolations between each value in the input and output ranges. If provided as an array, the array must be one item shorter than the input and output ranges, as the easings apply to the transition between each. + * + * @returns `MotionValue` + * + * @public + */ + function mapValue(inputValue, inputRange, outputRange, options) { + const map = transform(inputRange, outputRange, options); + return transformValue(() => map(inputValue.get())); + } + + /** + * Create a `MotionValue` that animates to its latest value using a spring. + * Can either be a value or track another `MotionValue`. + * + * ```jsx + * const x = motionValue(0) + * const y = springValue(x, { stiffness: 300 }) + * ``` + * + * @param source - Initial value or MotionValue to track + * @param options - Spring configuration options + * @returns `MotionValue` + * + * @public + */ + function springValue(source, options) { + return followValue(source, { type: "spring", ...options }); + } + /** + * Attach a spring animation to a MotionValue that will animate whenever the value changes. + * + * @param value - The MotionValue to animate + * @param source - Initial value or MotionValue to track + * @param options - Spring configuration options + * @returns Cleanup function + * + * @public + */ + function attachSpring(value, source, options) { + return attachFollow(value, source, { type: "spring", ...options }); + } + + /** + * A list of all ValueTypes + */ + const valueTypes = [...dimensionValueTypes, color, complex]; + /** + * Tests a value against the list of ValueTypes + */ + const findValueType = (v) => valueTypes.find(testValueType(v)); + + let nameCount = 0; + /** + * Generated names live in their own namespace so we can tell a name we own + * (and must clean up) from an author-defined one - and so a stale generated + * name left behind by an interrupted transition is re-owned, not mistaken for + * the author's and leaked. + */ + const generatedName = () => `motion-view-${nameCount++}`; + const isGeneratedName = (name) => name.startsWith("motion-view-"); + /** + * Tag a captured element with a `view-transition-class` so authors can target + * its generated layer from CSS (e.g. `::view-transition-group(.hero)`) without + * the opaque generated name. Tracked in `classed` - separate from the generated + * names in `assigned` - so cleanup removes the class without ever stripping an + * author's own inline `view-transition-name`. + */ + function tagClass(element, className, classed) { + if (!className) + return; + element.style?.setProperty("view-transition-class", className); + classed.push(element); + } + /** + * Set the element's `view-transition-group` so its layer reconstructs the DOM + * hierarchy in the pseudo-tree (`contain`) - or stays flat (`none`). Tracked in + * `grouped` for cleanup. When the element clips (any non-`visible` overflow) its + * name is recorded in `clipChildren` so the caller can clip the nested children + * (`::view-transition-group-children(name)`), mirroring the live clip through + * the whole transition rather than only at the live-DOM handoff. + * + * Ignored by browsers without nested view-transition groups, where it harmlessly + * degrades to the flat default. + */ + function applyGroup(element, name, group, grouped, clipChildren) { + if (!group) + return; + element.style?.setProperty("view-transition-group", group); + grouped.push(element); + if (group !== "none" && clipChildren) { + const style = getComputedStyle(element); + if (style.overflowX !== "visible" || style.overflowY !== "visible") { + clipChildren.add(name); + } + } + } + /** + * Resolve a selector/Element to elements and ensure each one carries a + * `view-transition-name` we can target from script. + * + * Author-defined names are reused as-is. Elements that are unnamed (or use + * the browser's `auto`/`match-element`, whose generated name is not exposed + * to script) are given a unique generated name, set inline so it's captured, + * and tracked in `assigned` for later cleanup. + * + * `registry` maps each Element to its name so the same element keeps its name + * across both captures (before and after the update), which is what allows a + * persistent element to animate as a single `group` layer. + */ + function assignViewTransitionNames(definition, registry, assigned, forcedNames, className, classed = [], group, grouped = [], clipChildren) { + const elements = resolveElements(definition); + /** + * The new end of a paired morph: give each element the matching name from + * the old end (by index) so the two share one layer and morph. If the new + * end resolves to *more* elements than the old end named, the extras have no + * counterpart - give them a fresh name so they animate as newcomers rather + * than being silently left unnamed. We return the names actually assigned + * (sized to the resolved elements), not the raw `forcedNames`, so stagger + * totals and the layer set stay in step with what's on the page. + */ + if (forcedNames) { + return elements.map((element, i) => { + const existing = registry.get(element); + if (existing) + return existing; + const name = forcedNames[i] ?? generatedName(); + element.style?.setProperty("view-transition-name", name); + assigned.push(element); + registry.set(element, name); + tagClass(element, className, classed); + applyGroup(element, name, group, grouped, clipChildren); + return name; + }); + } + /** + * Read every current name up front, before assigning any. Interleaving the + * reads with the inline `setProperty` writes below would dirty styles + * between reads and force a style recalc per element; batching the reads + * keeps it to one. Elements already in the registry keep their name and + * need no read. + */ + const currentNames = elements.map((element) => registry.has(element) + ? undefined + : getComputedStyle(element).getPropertyValue("view-transition-name")); + return elements.map((element, i) => { + const existing = registry.get(element); + if (existing) + return existing; + const current = currentNames[i]; + let name; + if (current && + current !== "none" && + current !== "auto" && + current !== "match-element" && + !isGeneratedName(current)) { + /** + * The author already named this layer - target it as-is and leave + * it to them to clean up. `auto`/`match-element` are overridden + * because their generated name is not exposed to script, and a + * stale `motion-view-*` (e.g. left by an interrupted transition) is + * re-owned rather than adopted as an author name and leaked. + */ + name = current; + } + else { + name = generatedName(); + element.style?.setProperty("view-transition-name", name); + assigned.push(element); + } + registry.set(element, name); + tagClass(element, className, classed); + applyGroup(element, name, group, grouped, clipChildren); + return name; + }); + } + /** + * Remove the `view-transition-name`s we generated and the + * `view-transition-class`es we applied. Author-defined names are never touched + * (they're not in `assigned`). Safe to call more than once (e.g. on both a + * finished and an interrupted transition). + */ + function releaseViewTransitionNames(assigned, classed = [], grouped = []) { + for (const element of assigned) { + element.style?.removeProperty("view-transition-name"); + } + for (const element of classed) { + element.style?.removeProperty("view-transition-class"); + } + for (const element of grouped) { + element.style?.removeProperty("view-transition-group"); + } + } + + function chooseLayerType(valueName) { + if (valueName === "layout") + return "group"; + if (valueName === "enter" || valueName === "new") + return "new"; + return "old"; + } + + let pendingRules = {}; + let style = null; + const css = { + set: (selector, values) => { + pendingRules[selector] = values; + }, + commit: () => { + if (!style) { + style = document.createElement("style"); + style.id = "motion-view"; + } + let cssText = ""; + for (const selector in pendingRules) { + const rule = pendingRules[selector]; + cssText += `${selector} {\n`; + for (const [property, value] of Object.entries(rule)) { + cssText += ` ${property}: ${value};\n`; + } + cssText += "}\n"; + } + style.textContent = cssText; + document.head.appendChild(style); + pendingRules = {}; + }, + remove: () => { + if (style && style.parentElement) { + style.parentElement.removeChild(style); + } + }, + }; + + function getViewAnimationLayerInfo(pseudoElement) { + const match = pseudoElement.match( + // `group-children` (nested transitions) before `group` so it wins. + /::view-transition-(old|new|group-children|group|image-pair)\((.*?)\)/); + if (!match) + return null; + return { layer: match[2], type: match[1] }; + } + + function getViewAnimations() { + return document.getAnimations().filter((animation) => { + const { effect } = animation; + return (!!effect && + effect.target === document.documentElement && + effect.pseudoElement?.startsWith("::view-transition")); + }); + } + + function hasTarget(target, targets) { + return targets.has(target) && Object.keys(targets.get(target)).length > 0; + } + + const definitionNames = ["layout", "enter", "exit", "new", "old"]; + /** + * Whether a computed border-radius is square (every component zero). Splitting + * on whitespace handles two-value/elliptical radii like "0px 20px" - a leading + * `parseFloat` alone would misread the non-zero vertical radius as square. + */ + const isSquareRadius = (radius) => radius.split(" ").every((value) => parseFloat(value) === 0); + /** + * The `ViewTransitionTarget` buckets driving each generated layer type, in + * priority order - the inverse of `chooseLayerType`. The new view is driven by + * `new`/`enter`, the old by `old`/`exit`. `group-children`/`image-pair` have no + * bucket; they follow the default layout timing. + */ + const typeBuckets = { + group: ["layout"], + new: ["new", "enter"], + old: ["old", "exit"], + }; + /** + * Default "absent" origin for a single-value keyframe, by pseudo type, so e.g. + * `enter({ scale: 1 })` grows in from 0.85 and `exit({ opacity: 0 })` fades + * from 1. `enter` prefers the matching `exit` value over these (see below). + */ + const ORIGIN_DEFAULTS = { + new: { opacity: 0, scale: 0.85 }, + old: { opacity: 1, scale: 1 }, + }; + /** + * How much two box aspect ratios must differ before a morph is treated as + * aspect-changing (and so worth cropping). Matches the projection engine's + * `preserve-aspect` threshold, so small layout jitter doesn't trigger a crop. + */ + const ASPECT_TOLERANCE = 0.2; + function startViewAnimation(builder) { + const { update, targets, resolveDefs, cropOverride, pairs, classNames, flatGroups, options: defaultOptions, } = builder; + if (!document.startViewTransition) { + // An async IIFE (not `new Promise(async …)`) so a throwing/rejecting + // update rejects this promise rather than leaving it unsettled. + return (async () => { + await update(); + return new GroupAnimation([]); + })(); + } + /** + * Resolve any selector/Element targets to layer names, assigning a + * `view-transition-name` to each element as we go. We run this before the + * update (so the elements are captured in the old snapshot) and again + * after it (for the new snapshot). An element present in both keeps the + * same name and animates as a single `group` layer. + */ + const nameRegistry = new Map(); + const assigned = []; + /** + * Elements we tagged with a `view-transition-class` (via `.class()`), + * tracked separately from `assigned` so cleanup removes the class without + * ever stripping an author's own inline `view-transition-name`. + */ + const classed = []; + /** + * Elements we set a `view-transition-group` on (for nesting), tracked for + * cleanup. `clipChildren` collects the names of nested parents that clip in + * the live layout, so their `::view-transition-group-children` is clipped + * through the transition - not just once the live DOM takes back over. + */ + const grouped = []; + const clipChildren = new Set(); + const layerTargets = new Map(); + const croppedNames = new Set(); + /** + * Each layer's explicit `.crop(true | false)` override (by resolved name), + * so `finalizeCrop` can let an author's choice win over the morph default. + */ + const cropForName = new Map(); + /** + * Each layer's stagger position (index + total) within its subject, per + * snapshot. Resolving against the snapshot the layer belongs to keeps + * stagger correct when `update()` replaces the matched elements, and lets + * us skip a layer that's absent from a snapshot (e.g. an exited element + * has no `new` pseudo-element). + */ + const layerStagger = new Map(); + /** + * Names allocated for a paired subject in the old snapshot, replayed onto + * its new-snapshot target so both ends share a layer and morph. + */ + const pairNames = new Map(); + /** + * The old (`from`) elements of each paired subject, so their names can be + * transferred off before the new (`to`) elements inherit them. + */ + const pairFrom = new Map(); + const resolveLayers = (phase) => { + targets.forEach((target, definition) => { + const className = classNames.get(definition); + /** + * Nest each resolved layer under its DOM-ancestor layer by default + * (`contain`), so an ancestor's clip/transform/opacity reach it + * through the transition; `.group(false)` opts a subject out (`none`) + * to stay flat and escape. Skipped for root / pre-named layers, which + * aren't elements we resolve and style. + */ + const group = definition === "root" || !resolveDefs.has(definition) + ? undefined + : flatGroups.has(definition) + ? "none" + : "contain"; + let names; + if (definition === "root" || !resolveDefs.has(definition)) { + names = [definition]; + } + else if (pairs.has(definition)) { + /** + * Paired morph: name the old target in the old snapshot, then + * force the same name(s) onto the new target in the new one, so + * two different elements morph as a single layer. + */ + if (phase === "old") { + pairFrom.set(definition, resolveElements(definition)); + names = assignViewTransitionNames(definition, nameRegistry, assigned, undefined, className, classed, group, grouped, clipChildren); + pairNames.set(definition, names); + } + else { + /** + * Transfer the name(s) off the `from` elements before the + * `to` elements inherit them. A `from` that survives into + * the new snapshot (e.g. hidden with `visibility: hidden` + * rather than removed) would otherwise keep the name and + * collide - "duplicate view-transition-name". + */ + for (const el of pairFrom.get(definition) ?? []) { + el.style?.removeProperty("view-transition-name"); + /** + * Drop the old end from the registry too, so the new + * end alone supplies this name's `new` crop radii - we + * neither re-measure nor get ordered by a stale element. + */ + nameRegistry.delete(el); + } + names = assignViewTransitionNames(pairs.get(definition), nameRegistry, assigned, pairNames.get(definition), className, classed, group, grouped, clipChildren); + } + } + else { + names = assignViewTransitionNames(definition, nameRegistry, assigned, undefined, className, classed, group, grouped, clipChildren); + } + // Record any explicit `.crop(true | false)` per resolved name; the + // crop set itself is computed later by `finalizeCrop` (it needs both + // snapshots to know which morphs change aspect ratio). + const override = cropOverride.get(definition); + names.forEach((name, index) => { + /** + * If two subjects resolve to the same element, merge their + * definitions so neither subject's animations are dropped. + */ + const existing = layerTargets.get(name); + layerTargets.set(name, existing && existing !== target + ? { ...existing, ...target } + : target); + if (override !== undefined) + cropForName.set(name, override); + const stagger = layerStagger.get(name) ?? {}; + stagger[phase] = [index, names.length]; + layerStagger.set(name, stagger); + }); + }); + }; + /** + * The stagger index/total for a layer, resolved against the snapshot it + * belongs to. Returns index -1 when the layer is absent from that snapshot + * so the caller can skip a pseudo-element that doesn't exist. + */ + const staggerPosition = (name, type) => { + const stagger = layerStagger.get(name); + const position = type === "old" + ? stagger?.old + : type === "new" + ? stagger?.new + : // group / group-children / image-pair persist across both. + stagger?.new ?? stagger?.old; + return position ?? [-1, 1]; + }; + /** + * Merge default + per-layer transition options for a generated layer and + * resolve any stagger/delay function against this element's position. Used + * by both the morph-retiming and crop corner-radius passes. + */ + const resolveLayerTransition = (target, type, transitionName, index, total) => { + const transition = mergeTransition(getValueTransition$1(defaultOptions, transitionName), getValueTransition$1((layerOptions(target, type) ?? {}), transitionName)); + if (typeof transition.delay === "function") { + transition.delay = transition.delay(index, total); + } + return transition; + }; + /** + * Resolve a layer's group (`layout`) timing to plain WAAPI values: native + * ms `delay`/`duration` and a baked `ease`. The single source of group + * timing, shared by the generated-group retiming and the crop corner-radius + * pass so the rounded clip animates on exactly the box's timing. It returns + * no generator `type` (the WAAPI-only `NativeAnimation` rejects a string + * type) nor `repeat`/`times` (which the group's `updateTiming` ignores), so + * none of them can leak into the radius animation and desync it. + */ + const resolveGroupTiming = (name) => { + const [index, total] = staggerPosition(name, "group"); + const transition = resolveLayerTransition(layerTargets.get(name), "group", "layout", index === -1 ? 0 : index, total); + transition.duration && (transition.duration = secondsToMilliseconds(transition.duration)); + const { delay = 0, duration, ease } = applyGeneratorOptions(transition); + return { delay: secondsToMilliseconds(delay), duration, ease }; + }; + /** + * Each layer's measured box + corner radii per snapshot. The box lets + * `finalizeCrop` tell whether a morph's aspect ratio changed (the only case + * worth cropping); the radii let a cropped morph's group clip animate each + * corner from the old element's radius to the new element's, keeping it + * rounded where `overflow: clip` would otherwise square the corners. + * + * We never flatten the source for capture (a snapshot is a paint of the live + * DOM, so squaring an element just for its capture would flash one real + * square frame). For an aspect-changing morph `object-fit: cover` crops each + * snapshot's own baked corners off-screen mid-morph, so the animated clip is + * the only visible corner; a near-same-aspect forced crop (`.crop(true)`) + * can't hide the outgoing snapshot's silhouette, but the endpoints coincide. + */ + const cropMeasurements = new Map(); + const measureLayers = (phase) => nameRegistry.forEach((name, element) => { + const el = element; + const rect = el.getBoundingClientRect?.(); + if (rect && rect.height) { + const style = getComputedStyle(el); + const radii = {}; + for (const corner of cornerRadiusProps) { + radii[corner] = style[corner]; + } + const entry = cropMeasurements.get(name) ?? {}; + entry[phase] = { width: rect.width, height: rect.height, radii }; + cropMeasurements.set(name, entry); + } + }); + /** + * With both snapshots measured, settle which layers crop. The default crops + * only a morph whose aspect ratio *changes* between snapshots - the one case + * where `object-fit: cover` does real work. A same-aspect morph or a + * fade-only layer is left uncropped: its corners scale naturally (no flash + * from squaring, no `overflow: clip` eating its shadow) and a backdrop can't + * be clipped to nothing. An explicit `.crop(true | false)` overrides either + * way. Runs after both snapshots are measured, since aspect needs both. + */ + const finalizeCrop = () => { + croppedNames.clear(); + for (const name of layerStagger.keys()) { + if (name === "root") + continue; + // An explicit `.crop(true | false)` wins; otherwise crop a morph + // whose aspect ratio changed. + if (cropForName.get(name) ?? aspectChanged(name)) { + croppedNames.add(name); + } + } + }; + /** + * Whether a layer is a morph whose box aspect ratio changed between + * snapshots (beyond a small tolerance). Fade-only layers (one snapshot) are + * never "changed". + */ + const aspectChanged = (name) => { + const box = cropMeasurements.get(name); + if (!box?.old || !box?.new || !box.old.height || !box.new.height) { + return false; + } + return (Math.abs(box.old.width / box.old.height - + box.new.width / box.new.height) > ASPECT_TOLERANCE); + }; + /** + * Write the persistent view-transition CSS: suppress root capture when the + * root has no animations of its own; force linear timing (baked into the + * keyframes, so we can retime later via updateTiming); and clip + + * object-fit: cover every cropped morph (the UA default overflows on + * aspect-ratio change). + * + * `css.commit` replaces rather than appends, so we re-set the full rule set + * each call - the crop rules are only known after `finalizeCrop` runs in the + * update callback, so the second call writes them. + */ + const commitViewCSS = () => { + if (!hasTarget("root", targets)) { + css.set(":root", { "view-transition-name": "none" }); + } + css.set("::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)", { "animation-timing-function": "linear !important" }); + croppedNames.forEach((name) => { + css.set(`::view-transition-group(${name})`, { overflow: "clip" }); + css.set(`::view-transition-old(${name}), ::view-transition-new(${name})`, { width: "100%", height: "100%", "object-fit": "cover" }); + }); + /** + * Clip the nested children of any layer that clips in the live layout, + * so a wrapper crops its child for the whole morph (mirroring the DOM) + * rather than only at the live-DOM handoff. No-op on browsers without + * nested view-transition groups. + */ + clipChildren.forEach((name) => { + css.set(`::view-transition-group-children(${name})`, { + overflow: "clip", + }); + }); + css.commit(); // Write + }; + const cleanup = () => { + releaseViewTransitionNames(assigned, classed, grouped); + css.remove(); // Write + }; + const callback = async () => { + await update(); + /** + * Re-resolve so elements created by the update are named for the new + * snapshot, then measure them. With both snapshots measured we can + * settle the crop set (aspect-changing morphs + forced). + */ + resolveLayers("new"); + measureLayers("new"); + finalizeCrop(); + /** + * Re-commit the crop CSS unconditionally: `finalizeCrop` is computed + * here (after both snapshots are measured), so the clip rules must be + * (re)written to match the settled set. + */ + commitViewCSS(); + }; + let transition; + try { + resolveLayers("old"); + /** + * Measure the old snapshot against the optimistic crop set (the new + * snapshot doesn't exist yet, so aspect change can't be known here; + * `finalizeCrop` settles it post-update). + */ + measureLayers("old"); + commitViewCSS(); + transition = document.startViewTransition(callback); + } + catch (error) { + /** + * The prelude writes inline names before the transition exists. If it + * throws (e.g. startViewTransition rejects in a bad UA state), release + * them so we neither leak DOM state nor stall the queue on a promise + * that never settles - hand back a rejection it can advance past. + */ + cleanup(); + return Promise.reject(error); + } + transition.finished.finally(cleanup); + return new Promise((resolve, reject) => { + transition.ready + .then(() => { + const generatedViewAnimations = getViewAnimations(); + const animations = []; + /** + * Create animations for each of our explicitly-defined subjects. + * `opacityAnimated` additionally tracks which `${name}:${type}` + * we faded, so we can keep the UA `plus-lighter` blend only for a + * genuine opacity crossfade (both sides fading) and drop it for a + * slide/transform, where additive compositing would flash bright. + */ + const explicitlyAnimated = new Set(); + const opacityAnimated = new Set(); + layerTargets.forEach((target, name) => { + const stagger = layerStagger.get(name); + /** + * Presence: `enter` only fires for a pure newcomer (a new + * view with no old), `exit` only for a pure leaver. A + * survivor (both) gets neither - it just morphs. + */ + const enterApplies = !!stagger?.new && !stagger?.old; + const exitApplies = !!stagger?.old && !stagger?.new; + for (const key of definitionNames) { + if (!target[key]) + continue; + if (key === "enter" && !enterApplies) + continue; + if (key === "exit" && !exitApplies) + continue; + const type = chooseLayerType(key); + const [index, total] = staggerPosition(name, type); + // Skip a layer absent from its snapshot. + if (index === -1) + continue; + const { keyframes, options } = target[key]; + for (let [valueName, valueKeyframes] of Object.entries(keyframes)) { + // Skip only missing values - `0` (e.g. opacity: 0) + // is valid and must reach the from-value inference. + if (valueKeyframes == null) + continue; + /** + * The view path hands keyframes straight to WAAPI, + * so Motion's `x`/`y` shorthands (compiled to + * `transform` only via the value pipeline) have no + * effect. Warn and skip - use `transform`/`translate`. + */ + if (valueName === "x" || valueName === "y") { + warnOnce(false, `animateView() animates view-transition layers with CSS properties; the "${valueName}" shorthand has no effect - use transform, e.g. { transform: "translateX(40px)" }.`); + continue; + } + /** + * enter/exit win over new/old on a shared property - + * skip it here when the gated bucket also defines it. + */ + if (key === "new" && + enterApplies && + target.enter?.keyframes[valueName] != null) { + continue; + } + if (key === "old" && + exitApplies && + target.exit?.keyframes[valueName] != null) { + continue; + } + const valueOptions = mergeTransition(getValueTransition$1(defaultOptions, valueName), getValueTransition$1(options, valueName)); + /** + * Infer an origin for a single-value keyframe. An + * `enter` mirrors the matching `exit` value (a + * defined exit reverses into the enter for free); + * otherwise the per-type default (opacity 0/1, scale + * 0.85). No default -> left as-is (animates from the + * live value). + * + * `new`/`old` fire for survivors too, where only the + * opacity crossfade default applies - a transform + * default like scale 0.85 would pop a persisting + * element, so gate it on the layer actually + * entering/leaving. + */ + if (!Array.isArray(valueKeyframes)) { + const exitValue = key === "enter" + ? target.exit?.keyframes[valueName] + : undefined; + const allowDefault = valueName === "opacity" || + (type === "new" ? enterApplies : exitApplies); + const from = exitValue != null + ? Array.isArray(exitValue) + ? exitValue[exitValue.length - 1] + : exitValue + : allowDefault + ? ORIGIN_DEFAULTS[type]?.[valueName] + : undefined; + if (from !== undefined) { + valueKeyframes = [from, valueKeyframes]; + } + } + /** + * Resolve stagger function if provided, per element + * across this subject's resolved layers. + */ + if (typeof valueOptions.delay === "function") { + valueOptions.delay = valueOptions.delay(index, total); + } + valueOptions.duration && (valueOptions.duration = secondsToMilliseconds(valueOptions.duration)); + valueOptions.delay && (valueOptions.delay = secondsToMilliseconds(valueOptions.delay)); + animations.push(new NativeAnimation({ + ...valueOptions, + element: document.documentElement, + name: valueName, + pseudoElement: `::view-transition-${type}(${name})`, + keyframes: valueKeyframes, + })); + explicitlyAnimated.add(`${name}:${type}`); + if (valueName === "opacity") { + opacityAnimated.add(`${name}:${type}`); + } + } + } + }); + /** + * Handle browser generated animations + */ + for (const animation of generatedViewAnimations) { + if (animation.playState === "finished") + continue; + const { effect } = animation; + if (!effect || !(effect instanceof KeyframeEffect)) + continue; + const { pseudoElement } = effect; + if (!pseudoElement) + continue; + const name = getViewAnimationLayerInfo(pseudoElement); + if (!name) + continue; + const targetDefinition = layerTargets.get(name.layer); + /** + * We built our own animation for this layer, so drop the + * browser-generated fade we're replacing. The UA + * `plus-lighter` blend is a *separate* generated animation on + * the same pseudo (it sets `mix-blend-mode` in its keyframes): + * keep it *only* for a true opacity crossfade - both sides + * fading - so a symmetric crossfade composites without + * darkening, but a slide/transform (where both layers stay + * opaque and overlap) doesn't flash bright from the addition. + */ + if (explicitlyAnimated.has(`${name.layer}:${name.type}`)) { + const isCrossfade = opacityAnimated.has(`${name.layer}:new`) && + opacityAnimated.has(`${name.layer}:old`); + if (isCrossfade && + effect + .getKeyframes() + .some((keyframe) => keyframe.mixBlendMode)) { + animations.push(new NativeAnimationWrapper(animation)); + } + else { + animation.cancel(); + } + continue; + } + /** + * Drop the orphaned half of the default crossfade. The UA + * fades old out and new in as a *pair*; if the opposing half + * was explicitly overridden with something other than an + * opacity fade (a clip or transform reveal), this side's + * default opacity fade has no partner - left to run it would + * dissolve what should be a static backdrop (e.g. + * `.new({ clipPath })` should reveal over a still old view, + * not fade the old out around the growing clip). Cancel it - + * and its `plus-lighter` sibling on the same pseudo, which + * would otherwise flash bright where the two opaque layers + * overlap. A genuine crossfade (the opposing side also fading + * opacity) keeps both halves and is handled above. + */ + const opposite = name.type === "old" + ? "new" + : name.type === "new" + ? "old" + : undefined; + if (opposite && + explicitlyAnimated.has(`${name.layer}:${opposite}`) && + !opacityAnimated.has(`${name.layer}:${opposite}`)) { + animation.cancel(); + continue; + } + /** + * Otherwise retime the browser-generated animation to + * Motion's timing. This auto-enables the layout (group) + * morph for any resolved/named target, and applies the + * default timing to old/new layers we haven't explicitly + * overridden. + * + * group + group-children both follow the layout timing so + * the nesting container stays in sync with the morph. + */ + /** + * A survivor's old + new are the two halves of one + * `plus-lighter` crossfade. They must share identical timing + * (so their opacities stay mirrored and sum to 1 - else the + * additive blend flashes bright wherever both are partly + * visible) and fade linearly (the bounce belongs on the + * group's geometry, not the opacity). So time them as the + * group, rather than via their own - potentially staggered, + * or enter/exit-derived - old/new options. + */ + const stagger = layerStagger.get(name.layer); + const isMorphCrossfade = (name.type === "old" || name.type === "new") && + !!stagger?.old && + !!stagger?.new; + let timing; + if (name.type.startsWith("group")) { + // group + group-children follow the resolved group + // timing - the single source shared with the crop + // corner-radius pass below. + const { delay, duration, ease } = resolveGroupTiming(name.layer); + timing = { + delay, + duration, + easing: mapEasingToNativeEasing(ease, duration), + }; + } + else { + const timingType = isMorphCrossfade ? "group" : name.type; + const [index, total] = staggerPosition(name.layer, timingType); + const transitionName = timingType === "group" ? "layout" : ""; + let animationTransition = resolveLayerTransition(targetDefinition, timingType, transitionName, index === -1 ? 0 : index, total); + /** + * The crossfade should resolve at the spring's + * *perceptual* (visual) duration - the geometry can keep + * bouncing, but the opacity shouldn't drag through the + * settle. So capture `visualDuration` before + * `applyGeneratorOptions` replaces it with the full + * overshoot duration, and use it for the fade. + */ + const visualDuration = animationTransition.visualDuration; + animationTransition.duration && (animationTransition.duration = secondsToMilliseconds(animationTransition.duration)); + animationTransition = + applyGeneratorOptions(animationTransition); + timing = { + delay: secondsToMilliseconds(animationTransition.delay ?? 0), + duration: isMorphCrossfade && visualDuration !== undefined + ? secondsToMilliseconds(visualDuration) + : animationTransition.duration, + easing: isMorphCrossfade + ? "linear" + : mapEasingToNativeEasing(animationTransition.ease, animationTransition.duration), + }; + } + effect.updateTiming(timing); + animations.push(new NativeAnimationWrapper(animation)); + } + /** + * Round each cropped layer's clip. Its `::view-transition-group` + * has `overflow: clip`, which would otherwise square the corners + * mid-morph; animate each corner from the old element's radius to + * the new element's so the crop stays rounded. Timed as the group + * (`layout`) so the radius tracks the morphing box. + */ + cropMeasurements.forEach((entry, name) => { + if (!croppedNames.has(name)) + return; + // Reuse the group's resolved timing - native ms delay/ + // duration + a baked ease, with no generator `type` or + // repeat/times to leak into (or throw inside) NativeAnimation. + const { delay, duration, ease } = resolveGroupTiming(name); + for (const corner of cornerRadiusProps) { + // `||` (not `??`) so an empty measurement falls back to + // the other snapshot rather than an invalid keyframe. + const from = entry.old?.radii[corner] || + entry.new?.radii[corner] || + "0px"; + const to = entry.new?.radii[corner] || + entry.old?.radii[corner] || + "0px"; + // Nothing to round if the corner is square at both ends. + if (isSquareRadius(from) && isSquareRadius(to)) + continue; + animations.push(new NativeAnimation({ + element: document.documentElement, + name: corner, + pseudoElement: `::view-transition-group(${name})`, + keyframes: [from, to], + delay, + duration, + ease, + })); + } + }); + resolve(new GroupAnimation(animations)); + }) + .catch(() => + /** + * `ready` rejects when the transition is skipped - no visual + * change, or superseded by an interrupting transition. The DOM + * update still applied, so settle with no animations rather than + * surfacing it as an error to an awaiting caller. A genuine + * failure in `update()` rejects `updateCallbackDone` (already + * settled by now), so propagate that instead. + */ + transition.updateCallbackDone.then(() => resolve(new GroupAnimation([])), reject)); + }); + } + /** + * The options that should time a given generated layer type, so a retimed + * group/old/new picks up any per-target transition the user provided. Checks + * the type's buckets in priority order (e.g. `new` before `enter`). + */ + function layerOptions(target, type) { + for (const bucket of typeBuckets[type] ?? []) { + const options = target?.[bucket]?.options; + if (options) + return options; + } + } + /** + * Merge a base transition (e.g. the default `options`) with a per-layer/value + * override. An explicit `duration` on the override must win over an inherited + * generator's own timing: a spring prefers `visualDuration`, and + * `spring.applyToOptions` overwrites `duration` with the computed settle time - + * so without this the override is silently discarded. Dropping the inherited + * `type`/`visualDuration` makes the layer a plain tween of that duration, unless + * it asked for its own generator `type`/`visualDuration`. + */ + function mergeTransition(base, override) { + const merged = { ...base, ...override }; + if (override.duration !== undefined) { + if (override.visualDuration === undefined) + delete merged.visualDuration; + if (override.type === undefined) + delete merged.type; + } + return merged; + } + + let builders = []; + let current = null; + function next() { + current = null; + const [nextBuilder] = builders; + if (nextBuilder) + start(nextBuilder); + } + function start(builder) { + removeItem(builders, builder); + current = builder; + startViewAnimation(builder) + .then((animation) => { + builder.notifyReady(animation); + return animation.finished; + }) + // A genuinely failed transition (a throwing update) rejects the + // builder; a skipped/interrupted one resolves with no animations (see + // start.ts). Either way, advance the queue - else later transitions hang. + .catch((error) => builder.notifyReject(error)) + .finally(next); + } + function processQueue() { + /** + * Iterate backwards over the builders array. We can ignore the + * "wait" animations. If we have an interrupting animation in the + * queue then we need to batch all preceeding animations into it. + * Currently this only batches the update functions but will also + * need to batch the targets. + */ + for (let i = builders.length - 1; i >= 0; i--) { + const builder = builders[i]; + const { interrupt } = builder.options; + if (interrupt === "immediate") { + const batchedUpdates = builders.slice(0, i + 1).map((b) => b.update); + const remaining = builders.slice(i + 1); + builder.update = () => { + batchedUpdates.forEach((update) => update()); + }; + // Put the current builder at the front, followed by any "wait" builders + builders = [builder, ...remaining]; + break; + } + } + if (!current || builders[0]?.options.interrupt === "immediate") { + next(); + } + } + function addToQueue(builder) { + builders.push(builder); + microtask.render(processQueue); + } + + class ViewTransitionBuilder { + constructor(update, options = {}) { + this.currentSubject = "root"; + this.targets = new Map(); + /** + * Definitions that must be resolved to elements (and assigned a + * `view-transition-name`) rather than treated as pre-named layers. + */ + this.resolveDefs = new Set(); + /** + * Per-subject crop override: `true` forces the crop (clip + object-fit: + * cover + animated corner radii) on, `false` forces it off. A subject with + * no entry uses the default - crop only a genuine morph (a layer present in + * both snapshots), so a fade-only enter/exit isn't clipped to nothing. + */ + this.cropOverride = new Map(); + /** + * Subjects paired with a different new-snapshot target (the second `.add()` + * argument), so two distinct elements share one name and morph into each + * other - a shared-element transition. + */ + this.pairs = new Map(); + /** + * A `view-transition-class` to apply to each subject's resolved elements, + * so authors can target the generated layers from CSS by class rather than + * the opaque generated name. + */ + this.classNames = new Map(); + /** + * Subjects opted out of automatic group nesting via `.group(false)`. Their + * layer stays a flat top-level group (`view-transition-group: none`) instead + * of nesting under its DOM-ancestor layer - so it animates independently and + * escapes an ancestor's clip/transform (e.g. an element that lifts out of a + * card and flies across, which nesting would clip to the card). + */ + this.flatGroups = new Set(); + this.notifyReady = noop; + this.notifyReject = noop; + this.readyPromise = new Promise((resolve, reject) => { + this.notifyReady = resolve; + this.notifyReject = reject; + }); + this.update = update; + this.options = { + interrupt: "wait", + ...options, + }; + // Avoid an unhandled rejection when a failed transition has no + // `.then(_, reject)` handler attached (e.g. fire-and-forget). + this.readyPromise.catch(noop); + addToQueue(this); + } + /** + * Target elements resolved from a selector or Element, each assigned a + * `view-transition-name` automatically. + * + * Passing a second target pairs them: the first is resolved in the old + * snapshot and the second in the new, sharing one name so two *different* + * elements morph into each other (e.g. `.add(card, ".modal")`). Symmetric - + * pass them the other way round to morph back. + */ + add(subject, newSubject) { + this.currentSubject = subject; + this.resolveDefs.add(subject); + if (newSubject !== undefined) + this.pairs.set(subject, newSubject); + // Register the subject so it participates (and gets an automatic + // layout/morph animation) even without an explicit enter/exit/layout. + if (!this.targets.has(subject)) + this.targets.set(subject, {}); + return this; + } + /** + * Control this subject's crop (clip + `object-fit: cover` + animated + * corners). By default a subject auto-crops only when it actually morphs - + * present in both snapshots (a survivor, or an `.add(a, b)` pair). A + * fade-only enter/exit has no second box to crop against, so it's left to + * the browser default; in particular the `overflow: clip` a crop adds would + * otherwise clip a mis-sized enter/exit layer to nothing. + * + * `.crop(false)` forces the crop off (e.g. a text morph, where + * `object-fit: cover` clips glyphs as the box grows); `.crop(true)` forces + * it on for a non-morph the default wouldn't otherwise crop. + */ + crop(enabled = true) { + this.cropOverride.set(this.currentSubject, enabled); + return this; + } + /** + * By default a subject's layer nests under its nearest DOM-ancestor layer + * (`view-transition-group: contain`), so the ancestor's clip/transform/opacity + * apply to it through the transition - mirroring how the DOM actually paints, + * and letting a wrapper crop its child for the whole morph rather than only + * once the live DOM takes back over. (Needs a browser that supports nested + * view-transition groups; elsewhere it degrades to the flat default.) + * + * Call `.group(false)` to opt out: the layer stays flat and top-level, so it + * animates independently and escapes an ancestor's clip - e.g. an element + * that should lift out of a card and fly across, which nesting would clip. + */ + group(enabled = true) { + enabled + ? this.flatGroups.delete(this.currentSubject) + : this.flatGroups.add(this.currentSubject); + return this; + } + /** + * Tag this subject's generated layers with a `view-transition-class`, so + * they can be targeted from CSS - `::view-transition-group(.name)`, + * `::view-transition-old/new(.name)`, `::view-transition-image-pair(.name)` + * - without the opaque generated `view-transition-name`. Because `.add()` + * can match many elements, a shared class targets them all at once (and, + * for a pair, both ends). The escape hatch for z-index / custom keyframes + * on a morph layer. + */ + class(name) { + this.classNames.set(this.currentSubject, name); + return this; + } + /** + * Set the transition for this subject's morph. The morph is enabled + * automatically by `.add()`; this just customises its timing (duration, + * easing, a `delay`/`stagger`, …). On the implicit `root` subject it also + * opts the page into the transition (the root crossfade). + */ + layout(options = {}) { + this.updateTarget("layout", {}, options); + return this; + } + enter(keyframes, options) { + this.updateTarget("enter", keyframes, options); + return this; + } + exit(keyframes, options) { + this.updateTarget("exit", keyframes, options); + return this; + } + /** + * Animate the new view directly, whether the element is appearing or + * persisting (unlike `.enter()`, which only fires for a pure newcomer). + * Pair with `.old()` for a crossfade or slide-through. + */ + new(keyframes, options) { + this.updateTarget("new", keyframes, options); + return this; + } + /** + * Animate the old view directly, whether the element is leaving or + * persisting (unlike `.exit()`, which only fires for a pure leaver). + */ + old(keyframes, options) { + this.updateTarget("old", keyframes, options); + return this; + } + updateTarget(target, keyframes, options = {}) { + const { currentSubject, targets } = this; + if (!targets.has(currentSubject)) { + targets.set(currentSubject, {}); + } + const targetData = targets.get(currentSubject); + targetData[target] = { keyframes, options }; + } + then(resolve, reject) { + return this.readyPromise.then(resolve, reject); + } + } + function animateView(update, options = {}) { + return new ViewTransitionBuilder(update, options); + } + + const createAxisDelta = () => ({ + translate: 0, + scale: 1, + origin: 0, + originPoint: 0, + }); + const createDelta = () => ({ + x: createAxisDelta(), + y: createAxisDelta(), + }); + const createAxis = () => ({ min: 0, max: 0 }); + const createBox = () => ({ + x: createAxis(), + y: createAxis(), + }); + + const visualElementStore = new WeakMap(); + + function isAnimationControls(v) { + return (v !== null && + typeof v === "object" && + typeof v.start === "function"); + } + + /** + * Decides if the supplied variable is variant label + */ + function isVariantLabel(v) { + return typeof v === "string" || Array.isArray(v); + } + + const variantPriorityOrder = [ + "animate", + "whileInView", + "whileFocus", + "whileHover", + "whileTap", + "whileDrag", + "exit", + ]; + const variantProps = ["initial", ...variantPriorityOrder]; + + function isControllingVariants(props) { + return (isAnimationControls(props.animate) || + variantProps.some((name) => isVariantLabel(props[name]))); + } + function isVariantNode(props) { + return Boolean(isControllingVariants(props) || props.variants); + } + + /** + * Updates motion values from props changes. + * Uses `any` type for element to avoid circular dependencies with VisualElement. + */ + function updateMotionValuesFromProps(element, next, prev) { + for (const key in next) { + const nextValue = next[key]; + const prevValue = prev[key]; + if (isMotionValue(nextValue)) { + /** + * If this is a motion value found in props or style, we want to add it + * to our visual element's motion value map. + */ + element.addValue(key, nextValue); + } + else if (isMotionValue(prevValue)) { + /** + * If we're swapping from a motion value to a static value, + * create a new motion value from that + */ + element.addValue(key, motionValue(nextValue, { owner: element })); + } + else if (prevValue !== nextValue) { + /** + * If this is a flat value that has changed, update the motion value + * or create one if it doesn't exist. We only want to do this if we're + * not handling the value with our animation state. + */ + if (element.hasValue(key)) { + const existingValue = element.getValue(key); + if (existingValue.liveStyle === true) { + existingValue.jump(nextValue); + } + else if (!existingValue.hasAnimated) { + existingValue.set(nextValue); + } + } + else { + const latestValue = element.getStaticValue(key); + element.addValue(key, motionValue(latestValue !== undefined ? latestValue : nextValue, { owner: element })); + } + } + } + // Handle removed values + for (const key in prev) { + if (next[key] === undefined) + element.removeValue(key); + } + return next; + } + + // Does this device prefer reduced motion? Returns `null` server-side. + const prefersReducedMotion = { current: null }; + const hasReducedMotionListener = { current: false }; + + const isBrowser = typeof window !== "undefined"; + function initPrefersReducedMotion() { + hasReducedMotionListener.current = true; + if (!isBrowser) + return; + if (window.matchMedia) { + const motionMediaQuery = window.matchMedia("(prefers-reduced-motion)"); + const setReducedMotionPreferences = () => (prefersReducedMotion.current = motionMediaQuery.matches); + motionMediaQuery.addEventListener("change", setReducedMotionPreferences); + setReducedMotionPreferences(); + } + else { + prefersReducedMotion.current = false; + } + } + + const propEventHandlers = [ + "AnimationStart", + "AnimationComplete", + "Update", + "BeforeLayoutMeasure", + "LayoutMeasure", + "LayoutAnimationStart", + "LayoutAnimationComplete", + ]; + /** + * Static feature definitions - can be injected by framework layer + */ + let featureDefinitions = {}; + /** + * Set feature definitions for all VisualElements. + * This should be called by the framework layer (e.g., framer-motion) during initialization. + */ + function setFeatureDefinitions(definitions) { + featureDefinitions = definitions; + } + /** + * Get the current feature definitions + */ + function getFeatureDefinitions() { + return featureDefinitions; + } + /** + * A VisualElement is an imperative abstraction around UI elements such as + * HTMLElement, SVGElement, Three.Object3D etc. + */ + class VisualElement { + /** + * This method takes React props and returns found MotionValues. For example, HTML + * MotionValues will be found within the style prop, whereas for Three.js within attribute arrays. + * + * This isn't an abstract method as it needs calling in the constructor, but it is + * intended to be one. + */ + scrapeMotionValuesFromProps(_props, _prevProps, _visualElement) { + return {}; + } + constructor({ parent, props, presenceContext, reducedMotionConfig, skipAnimations, blockInitialAnimation, visualState, }, options = {}) { + /** + * A reference to the current underlying Instance, e.g. a HTMLElement + * or Three.Mesh etc. + */ + this.current = null; + /** + * A set containing references to this VisualElement's children. + */ + this.children = new Set(); + /** + * Determine what role this visual element should take in the variant tree. + */ + this.isVariantNode = false; + this.isControllingVariants = false; + /** + * Decides whether this VisualElement should animate in reduced motion + * mode. + * + * TODO: This is currently set on every individual VisualElement but feels + * like it could be set globally. + */ + this.shouldReduceMotion = null; + /** + * Decides whether animations should be skipped for this VisualElement. + * Useful for E2E tests and visual regression testing. + */ + this.shouldSkipAnimations = false; + /** + * A map of all motion values attached to this visual element. Motion + * values are source of truth for any given animated value. A motion + * value might be provided externally by the component via props. + */ + this.values = new Map(); + this.KeyframeResolver = KeyframeResolver; + /** + * Cleanup functions for active features (hover/tap/exit etc) + */ + this.features = {}; + /** + * A map of every subscription that binds the provided or generated + * motion values onChange listeners to this visual element. + */ + this.valueSubscriptions = new Map(); + /** + * A reference to the previously-provided motion values as returned + * from scrapeMotionValuesFromProps. We use the keys in here to determine + * if any motion values need to be removed after props are updated. + */ + this.prevMotionValues = {}; + /** + * Track whether this element has been mounted before, to detect + * remounts after Suspense unmount/remount cycles. + */ + this.hasBeenMounted = false; + /** + * An object containing a SubscriptionManager for each active event. + */ + this.events = {}; + /** + * An object containing an unsubscribe function for each prop event subscription. + * For example, every "Update" event can have multiple subscribers via + * VisualElement.on(), but only one of those can be defined via the onUpdate prop. + */ + this.propEventSubscriptions = {}; + this.notifyUpdate = () => this.notify("Update", this.latestValues); + this.render = () => { + if (!this.current) + return; + this.triggerBuild(); + this.renderInstance(this.current, this.renderState, this.props.style, this.projection); + }; + this.renderScheduledAt = 0.0; + this.scheduleRender = () => { + const now = time.now(); + if (this.renderScheduledAt < now) { + this.renderScheduledAt = now; + frame.render(this.render, false, true); + } + }; + const { latestValues, renderState } = visualState; + this.latestValues = latestValues; + this.baseTarget = { ...latestValues }; + this.initialValues = props.initial ? { ...latestValues } : {}; + this.renderState = renderState; + this.parent = parent; + this.props = props; + this.presenceContext = presenceContext; + this.depth = parent ? parent.depth + 1 : 0; + this.reducedMotionConfig = reducedMotionConfig; + this.skipAnimationsConfig = skipAnimations; + this.options = options; + this.blockInitialAnimation = Boolean(blockInitialAnimation); + this.isControllingVariants = isControllingVariants(props); + this.isVariantNode = isVariantNode(props); + if (this.isVariantNode) { + this.variantChildren = new Set(); + } + this.manuallyAnimateOnMount = Boolean(parent && parent.current); + /** + * Any motion values that are provided to the element when created + * aren't yet bound to the element, as this would technically be impure. + * However, we iterate through the motion values and set them to the + * initial values for this component. + * + * TODO: This is impure and we should look at changing this to run on mount. + * Doing so will break some tests but this isn't necessarily a breaking change, + * more a reflection of the test. + */ + const { willChange, ...initialMotionValues } = this.scrapeMotionValuesFromProps(props, {}, this); + for (const key in initialMotionValues) { + const value = initialMotionValues[key]; + if (latestValues[key] !== undefined && isMotionValue(value)) { + value.set(latestValues[key]); + } + } + } + mount(instance) { + /** + * If this element has been mounted before (e.g. after a Suspense + * unmount/remount), reset motion values to their initial state + * so animations replay correctly from initial → animate. + */ + if (this.hasBeenMounted) { + for (const key in this.initialValues) { + this.values.get(key)?.jump(this.initialValues[key]); + this.latestValues[key] = this.initialValues[key]; + } + } + this.current = instance; + visualElementStore.set(instance, this); + if (this.projection && !this.projection.instance) { + this.projection.mount(instance); + } + if (this.parent && this.isVariantNode && !this.isControllingVariants) { + this.removeFromVariantTree = this.parent.addVariantChild(this); + } + this.values.forEach((value, key) => this.bindToMotionValue(key, value)); + /** + * Determine reduced motion preference. Only initialize the matchMedia + * listener if we actually need the dynamic value (i.e., when config + * is neither "never" nor "always"). + */ + if (this.reducedMotionConfig === "never") { + this.shouldReduceMotion = false; + } + else if (this.reducedMotionConfig === "always") { + this.shouldReduceMotion = true; + } + else { + if (!hasReducedMotionListener.current) { + initPrefersReducedMotion(); + } + this.shouldReduceMotion = prefersReducedMotion.current; + } + { + warnOnce(this.shouldReduceMotion !== true, "You have Reduced Motion enabled on your device. Animations may not appear as expected.", "reduced-motion-disabled"); + } + /** + * Set whether animations should be skipped based on the config. + */ + this.shouldSkipAnimations = this.skipAnimationsConfig ?? false; + this.parent?.addChild(this); + this.update(this.props, this.presenceContext); + this.hasBeenMounted = true; + } + unmount() { + this.projection && this.projection.unmount(); + cancelFrame(this.notifyUpdate); + cancelFrame(this.render); + this.valueSubscriptions.forEach((remove) => remove()); + this.valueSubscriptions.clear(); + this.removeFromVariantTree && this.removeFromVariantTree(); + this.parent?.removeChild(this); + for (const key in this.events) { + this.events[key].clear(); + } + for (const key in this.features) { + const feature = this.features[key]; + if (feature) { + feature.unmount(); + feature.isMounted = false; + } + } + this.current = null; + } + addChild(child) { + this.children.add(child); + this.enteringChildren ?? (this.enteringChildren = new Set()); + this.enteringChildren.add(child); + } + removeChild(child) { + this.children.delete(child); + this.enteringChildren && this.enteringChildren.delete(child); + } + bindToMotionValue(key, value) { + if (this.valueSubscriptions.has(key)) { + this.valueSubscriptions.get(key)(); + } + if (value.accelerate && + acceleratedValues.has(key) && + this.current instanceof HTMLElement) { + const { factory, keyframes, times, ease, duration } = value.accelerate; + const animation = new NativeAnimation({ + element: this.current, + name: key, + keyframes, + times, + ease, + duration: secondsToMilliseconds(duration), + }); + const cleanup = factory(animation); + this.valueSubscriptions.set(key, () => { + cleanup(); + animation.cancel(); + }); + return; + } + const valueIsTransform = transformProps.has(key); + if (valueIsTransform && this.onBindTransform) { + this.onBindTransform(); + } + const removeOnChange = value.on("change", (latestValue) => { + this.latestValues[key] = latestValue; + this.props.onUpdate && frame.preRender(this.notifyUpdate); + if (valueIsTransform && this.projection) { + this.projection.isTransformDirty = true; + } + this.scheduleRender(); + }); + let removeSyncCheck; + if (typeof window !== "undefined" && + window.MotionCheckAppearSync) { + removeSyncCheck = window.MotionCheckAppearSync(this, key, value); + } + this.valueSubscriptions.set(key, () => { + removeOnChange(); + if (removeSyncCheck) + removeSyncCheck(); + // Defer to MotionValue.on("change") auto-stop so React 19 remounts + // can resubscribe before the animation is cancelled (#3315). + }); + } + sortNodePosition(other) { + /** + * If these nodes aren't even of the same type we can't compare their depth. + */ + if (!this.current || + !this.sortInstanceNodePosition || + this.type !== other.type) { + return 0; + } + return this.sortInstanceNodePosition(this.current, other.current); + } + updateFeatures() { + let key = "animation"; + for (key in featureDefinitions) { + const featureDefinition = featureDefinitions[key]; + if (!featureDefinition) + continue; + const { isEnabled, Feature: FeatureConstructor } = featureDefinition; + /** + * If this feature is enabled but not active, make a new instance. + */ + if (!this.features[key] && + FeatureConstructor && + isEnabled(this.props)) { + this.features[key] = new FeatureConstructor(this); + } + /** + * If we have a feature, mount or update it. + */ + if (this.features[key]) { + const feature = this.features[key]; + if (feature.isMounted) { + feature.update(); + } + else { + feature.mount(); + feature.isMounted = true; + } + } + } + } + triggerBuild() { + this.build(this.renderState, this.latestValues, this.props); + } + /** + * Measure the current viewport box with or without transforms. + * Only measures axis-aligned boxes, rotate and skew must be manually + * removed with a re-render to work. + */ + measureViewportBox() { + return this.current + ? this.measureInstanceViewportBox(this.current, this.props) + : createBox(); + } + getStaticValue(key) { + return this.latestValues[key]; + } + setStaticValue(key, value) { + this.latestValues[key] = value; + } + /** + * Update the provided props. Ensure any newly-added motion values are + * added to our map, old ones removed, and listeners updated. + */ + update(props, presenceContext) { + if (props.transformTemplate || this.props.transformTemplate) { + this.scheduleRender(); + } + this.prevProps = this.props; + this.props = props; + this.prevPresenceContext = this.presenceContext; + this.presenceContext = presenceContext; + /** + * Update prop event handlers ie onAnimationStart, onAnimationComplete + */ + for (let i = 0; i < propEventHandlers.length; i++) { + const key = propEventHandlers[i]; + if (this.propEventSubscriptions[key]) { + this.propEventSubscriptions[key](); + delete this.propEventSubscriptions[key]; + } + const listenerName = ("on" + key); + const listener = props[listenerName]; + if (listener) { + this.propEventSubscriptions[key] = this.on(key, listener); + } + } + this.prevMotionValues = updateMotionValuesFromProps(this, this.scrapeMotionValuesFromProps(props, this.prevProps || {}, this), this.prevMotionValues); + if (this.handleChildMotionValue) { + this.handleChildMotionValue(); + } + } + getProps() { + return this.props; + } + /** + * Returns the variant definition with a given name. + */ + getVariant(name) { + return this.props.variants ? this.props.variants[name] : undefined; + } + /** + * Returns the defined default transition on this component. + */ + getDefaultTransition() { + return this.props.transition; + } + getTransformPagePoint() { + return this.props.transformPagePoint; + } + getClosestVariantNode() { + return this.isVariantNode + ? this + : this.parent + ? this.parent.getClosestVariantNode() + : undefined; + } + /** + * Add a child visual element to our set of children. + */ + addVariantChild(child) { + const closestVariantNode = this.getClosestVariantNode(); + if (closestVariantNode) { + closestVariantNode.variantChildren && + closestVariantNode.variantChildren.add(child); + return () => closestVariantNode.variantChildren.delete(child); + } + } + /** + * Add a motion value and bind it to this visual element. + */ + addValue(key, value) { + // Remove existing value if it exists + const existingValue = this.values.get(key); + if (value !== existingValue) { + if (existingValue) + this.removeValue(key); + this.bindToMotionValue(key, value); + this.values.set(key, value); + this.latestValues[key] = value.get(); + } + } + /** + * Remove a motion value and unbind any active subscriptions. + */ + removeValue(key) { + this.values.delete(key); + const unsubscribe = this.valueSubscriptions.get(key); + if (unsubscribe) { + unsubscribe(); + this.valueSubscriptions.delete(key); + } + delete this.latestValues[key]; + this.removeValueFromRenderState(key, this.renderState); + } + /** + * Check whether we have a motion value for this key + */ + hasValue(key) { + return this.values.has(key); + } + getValue(key, defaultValue) { + if (this.props.values && this.props.values[key]) { + return this.props.values[key]; + } + let value = this.values.get(key); + if (value === undefined && defaultValue !== undefined) { + value = motionValue(defaultValue === null ? undefined : defaultValue, { owner: this }); + this.addValue(key, value); + } + return value; + } + /** + * If we're trying to animate to a previously unencountered value, + * we need to check for it in our state and as a last resort read it + * directly from the instance (which might have performance implications). + */ + readValue(key, target) { + let value = this.latestValues[key] !== undefined || !this.current + ? this.latestValues[key] + : this.getBaseTargetFromProps(this.props, key) ?? + this.readValueFromInstance(this.current, key, this.options); + if (value !== undefined && value !== null) { + if (typeof value === "string" && + (isNumericalString(value) || isZeroValueString(value))) { + // If this is a number read as a string, ie "0" or "200", convert it to a number + value = parseFloat(value); + } + else if (!findValueType(value) && complex.test(target)) { + value = getAnimatableNone(key, target); + } + this.setBaseTarget(key, isMotionValue(value) ? value.get() : value); + } + return isMotionValue(value) ? value.get() : value; + } + /** + * Set the base target to later animate back to. This is currently + * only hydrated on creation and when we first read a value. + */ + setBaseTarget(key, value) { + this.baseTarget[key] = value; + } + /** + * Find the base target for a value thats been removed from all animation + * props. + */ + getBaseTarget(key) { + const { initial } = this.props; + let valueFromInitial; + if (typeof initial === "string" || typeof initial === "object") { + const variant = resolveVariantFromProps(this.props, initial, this.presenceContext?.custom); + if (variant) { + valueFromInitial = variant[key]; + } + } + /** + * If this value still exists in the current initial variant, read that. + */ + if (initial && valueFromInitial !== undefined) { + return valueFromInitial; + } + /** + * Alternatively, if this VisualElement config has defined a getBaseTarget + * so we can read the value from an alternative source, try that. + */ + const target = this.getBaseTargetFromProps(this.props, key); + if (target !== undefined && !isMotionValue(target)) + return target; + /** + * If the value was initially defined on initial, but it doesn't any more, + * return undefined. Otherwise return the value as initially read from the DOM. + */ + return this.initialValues[key] !== undefined && + valueFromInitial === undefined + ? undefined + : this.baseTarget[key]; + } + on(eventName, callback) { + if (!this.events[eventName]) { + this.events[eventName] = new SubscriptionManager(); + } + return this.events[eventName].add(callback); + } + notify(eventName, ...args) { + if (this.events[eventName]) { + this.events[eventName].notify(...args); + } + } + scheduleRenderMicrotask() { + microtask.render(this.render); + } + } + + class DOMVisualElement extends VisualElement { + constructor() { + super(...arguments); + this.KeyframeResolver = DOMKeyframesResolver; + } + sortInstanceNodePosition(a, b) { + /** + * compareDocumentPosition returns a bitmask, by using the bitwise & + * we're returning true if 2 in that bitmask is set to true. 2 is set + * to true if b preceeds a. + */ + return a.compareDocumentPosition(b) & 2 ? 1 : -1; + } + getBaseTargetFromProps(props, key) { + const style = props.style; + return style ? style[key] : undefined; + } + removeValueFromRenderState(key, { vars, style }) { + delete vars[key]; + delete style[key]; + } + handleChildMotionValue() { + if (this.childSubscription) { + this.childSubscription(); + delete this.childSubscription; + } + const { children } = this.props; + if (isMotionValue(children)) { + this.childSubscription = children.on("change", (latest) => { + if (this.current) { + this.current.textContent = `${latest}`; + } + }); + } + } + } + + /** + * Feature base class for extending VisualElement functionality. + * Features are plugins that can be mounted/unmounted to add behavior + * like gestures, animations, or layout tracking. + */ + class Feature { + constructor(node) { + this.isMounted = false; + this.node = node; + } + update() { } + } + + /** + * Bounding boxes tend to be defined as top, left, right, bottom. For various operations + * it's easier to consider each axis individually. This function returns a bounding box + * as a map of single-axis min/max values. + */ + function convertBoundingBoxToBox({ top, left, right, bottom, }) { + return { + x: { min: left, max: right }, + y: { min: top, max: bottom }, + }; + } + function convertBoxToBoundingBox({ x, y }) { + return { top: y.min, right: x.max, bottom: y.max, left: x.min }; + } + /** + * Applies a TransformPoint function to a bounding box. TransformPoint is usually a function + * provided by Framer to allow measured points to be corrected for device scaling. This is used + * when measuring DOM elements and DOM event points. + */ + function transformBoxPoints(point, transformPoint) { + if (!transformPoint) + return point; + const topLeft = transformPoint({ x: point.left, y: point.top }); + const bottomRight = transformPoint({ x: point.right, y: point.bottom }); + return { + top: topLeft.y, + left: topLeft.x, + bottom: bottomRight.y, + right: bottomRight.x, + }; + } + + function isIdentityScale(scale) { + return scale === undefined || scale === 1; + } + function hasScale({ scale, scaleX, scaleY }) { + return (!isIdentityScale(scale) || + !isIdentityScale(scaleX) || + !isIdentityScale(scaleY)); + } + function hasTransform(values) { + return (hasScale(values) || + has2DTranslate(values) || + values.z || + values.rotate || + values.rotateX || + values.rotateY || + values.skewX || + values.skewY); + } + function has2DTranslate(values) { + return is2DTranslate(values.x) || is2DTranslate(values.y); + } + function is2DTranslate(value) { + return value && value !== "0%"; + } + + /** + * Scales a point based on a factor and an originPoint + */ + function scalePoint(point, scale, originPoint) { + const distanceFromOrigin = point - originPoint; + const scaled = scale * distanceFromOrigin; + return originPoint + scaled; + } + /** + * Applies a translate/scale delta to a point + */ + function applyPointDelta(point, translate, scale, originPoint, boxScale) { + if (boxScale !== undefined) { + point = scalePoint(point, boxScale, originPoint); + } + return scalePoint(point, scale, originPoint) + translate; + } + /** + * Applies a translate/scale delta to an axis + */ + function applyAxisDelta(axis, translate = 0, scale = 1, originPoint, boxScale) { + axis.min = applyPointDelta(axis.min, translate, scale, originPoint, boxScale); + axis.max = applyPointDelta(axis.max, translate, scale, originPoint, boxScale); + } + /** + * Applies a translate/scale delta to a box + */ + function applyBoxDelta(box, { x, y }) { + applyAxisDelta(box.x, x.translate, x.scale, x.originPoint); + applyAxisDelta(box.y, y.translate, y.scale, y.originPoint); + } + const TREE_SCALE_SNAP_MIN = 0.999999999999; + const TREE_SCALE_SNAP_MAX = 1.0000000000001; + /** + * Apply a tree of deltas to a box. We do this to calculate the effect of all the transforms + * in a tree upon our box before then calculating how to project it into our desired viewport-relative box + * + * This is the final nested loop within updateLayoutDelta for future refactoring + */ + function applyTreeDeltas(box, treeScale, treePath, isSharedTransition = false) { + const treeLength = treePath.length; + if (!treeLength) + return; + // Reset the treeScale + treeScale.x = treeScale.y = 1; + let node; + let delta; + for (let i = 0; i < treeLength; i++) { + node = treePath[i]; + delta = node.projectionDelta; + /** + * TODO: Prefer to remove this, but currently we have motion components with + * display: contents in Framer. + */ + const { visualElement } = node.options; + if (visualElement && + visualElement.props.style && + visualElement.props.style.display === "contents") { + continue; + } + if (isSharedTransition && + node.options.layoutScroll && + node.scroll && + node !== node.root) { + translateAxis(box.x, -node.scroll.offset.x); + translateAxis(box.y, -node.scroll.offset.y); + } + if (delta) { + // Incoporate each ancestor's scale into a cumulative treeScale for this component + treeScale.x *= delta.x.scale; + treeScale.y *= delta.y.scale; + // Apply each ancestor's calculated delta into this component's recorded layout box + applyBoxDelta(box, delta); + } + if (isSharedTransition && hasTransform(node.latestValues)) { + transformBox(box, node.latestValues, node.layout?.layoutBox); + } + } + /** + * Snap tree scale back to 1 if it's within a non-perceivable threshold. + * This will help reduce useless scales getting rendered. + */ + if (treeScale.x < TREE_SCALE_SNAP_MAX && + treeScale.x > TREE_SCALE_SNAP_MIN) { + treeScale.x = 1.0; + } + if (treeScale.y < TREE_SCALE_SNAP_MAX && + treeScale.y > TREE_SCALE_SNAP_MIN) { + treeScale.y = 1.0; + } + } + function translateAxis(axis, distance) { + axis.min += distance; + axis.max += distance; + } + /** + * Apply a transform to an axis from the latest resolved motion values. + * This function basically acts as a bridge between a flat motion value map + * and applyAxisDelta + */ + function transformAxis(axis, axisTranslate, axisScale, boxScale, axisOrigin = 0.5) { + const originPoint = mixNumber$1(axis.min, axis.max, axisOrigin); + // Apply the axis delta to the final axis + applyAxisDelta(axis, axisTranslate, axisScale, originPoint, boxScale); + } + function resolveAxisTranslate(value, axis) { + if (typeof value === "string") { + return (parseFloat(value) / 100) * (axis.max - axis.min); + } + return value; + } + /** + * Apply a transform to a box from the latest resolved motion values. + */ + function transformBox(box, transform, sourceBox) { + const resolveBox = sourceBox ?? box; + transformAxis(box.x, resolveAxisTranslate(transform.x, resolveBox.x), transform.scaleX, transform.scale, transform.originX); + transformAxis(box.y, resolveAxisTranslate(transform.y, resolveBox.y), transform.scaleY, transform.scale, transform.originY); + } + + function measureViewportBox(instance, transformPoint) { + return convertBoundingBoxToBox(transformBoxPoints(instance.getBoundingClientRect(), transformPoint)); + } + function measurePageBox(element, rootProjectionNode, transformPagePoint) { + const viewportBox = measureViewportBox(element, transformPagePoint); + const { scroll } = rootProjectionNode; + if (scroll) { + translateAxis(viewportBox.x, scroll.offset.x); + translateAxis(viewportBox.y, scroll.offset.y); + } + return viewportBox; + } + + const translateAlias = { + x: "translateX", + y: "translateY", + z: "translateZ", + transformPerspective: "perspective", + }; + const numTransforms = transformPropOrder.length; + /** + * Build a CSS transform style from individual x/y/scale etc properties. + * + * This outputs with a default order of transforms/scales/rotations, this can be customised by + * providing a transformTemplate function. + */ + function buildTransform(latestValues, transform, transformTemplate) { + // The transform string we're going to build into. + let transformString = ""; + let transformIsDefault = true; + /** + * Loop over all possible transforms in order, adding the ones that + * are present to the transform string. + */ + for (let i = 0; i < numTransforms; i++) { + const key = transformPropOrder[i]; + const value = latestValues[key]; + if (value === undefined) + continue; + let valueIsDefault = true; + if (typeof value === "number") { + valueIsDefault = value === (key.startsWith("scale") ? 1 : 0); + } + else { + const parsed = parseFloat(value); + valueIsDefault = key.startsWith("scale") ? parsed === 1 : parsed === 0; + } + if (!valueIsDefault || transformTemplate) { + const valueAsType = getValueAsType(value, numberValueTypes[key]); + if (!valueIsDefault) { + transformIsDefault = false; + const transformName = translateAlias[key] || key; + transformString += `${transformName}(${valueAsType}) `; + } + if (transformTemplate) { + transform[key] = valueAsType; + } + } + } + // `pathRotation` composes onto `rotate` as a separate additive term so + // the user's `rotate` is never clobbered. Deliberately not a slot in + // `transformPropOrder`. + const pathRotation = latestValues.pathRotation; + if (pathRotation) { + transformIsDefault = false; + transformString += `rotate(${getValueAsType(pathRotation, numberValueTypes.pathRotation)}) `; + } + transformString = transformString.trim(); + // If we have a custom `transform` template, pass our transform values and + // generated transformString to that before returning + if (transformTemplate) { + transformString = transformTemplate(transform, transformIsDefault ? "" : transformString); + } + else if (transformIsDefault) { + transformString = "none"; + } + return transformString; + } + + function buildHTMLStyles(state, latestValues, transformTemplate) { + const { style, vars, transformOrigin } = state; + // Track whether we encounter any transform or transformOrigin values. + let hasTransform = false; + let hasTransformOrigin = false; + /** + * Loop over all our latest animated values and decide whether to handle them + * as a style or CSS variable. + * + * Transforms and transform origins are kept separately for further processing. + */ + for (const key in latestValues) { + const value = latestValues[key]; + if (transformProps.has(key)) { + // If this is a transform, flag to enable further transform processing + hasTransform = true; + continue; + } + else if (isCSSVariableName(key)) { + vars[key] = value; + continue; + } + else { + // Convert the value to its default value type, ie 0 -> "0px" + const valueAsType = getValueAsType(value, numberValueTypes[key]); + if (key.startsWith("origin")) { + // If this is a transform origin, flag and enable further transform-origin processing + hasTransformOrigin = true; + transformOrigin[key] = + valueAsType; + } + else { + style[key] = valueAsType; + } + } + } + if (!latestValues.transform) { + if (hasTransform || transformTemplate) { + style.transform = buildTransform(latestValues, state.transform, transformTemplate); + } + else if (style.transform) { + /** + * If we have previously created a transform but currently don't have any, + * reset transform style to none. + */ + style.transform = "none"; + } + } + /** + * Build a transformOrigin style. Uses the same defaults as the browser for + * undefined origins. + */ + if (hasTransformOrigin) { + const { originX = "50%", originY = "50%", originZ = 0, } = transformOrigin; + style.transformOrigin = `${originX} ${originY} ${originZ}`; + } + } + + function renderHTML(element, { style, vars }, styleProp, projection) { + const elementStyle = element.style; + let key; + for (key in style) { + // CSSStyleDeclaration has [index: number]: string; in the types, so we use that as key type. + elementStyle[key] = style[key]; + } + // Write projection styles directly to element style + projection?.applyProjectionStyles(elementStyle, styleProp); + for (key in vars) { + // Loop over any CSS variables and assign those. + // They can only be assigned using `setProperty`. + elementStyle.setProperty(key, vars[key]); + } + } + + function pixelsToPercent(pixels, axis) { + if (axis.max === axis.min) + return 0; + return (pixels / (axis.max - axis.min)) * 100; + } + /** + * We always correct borderRadius as a percentage rather than pixels to reduce paints. + * For example, if you are projecting a box that is 100px wide with a 10px borderRadius + * into a box that is 200px wide with a 20px borderRadius, that is actually a 10% + * borderRadius in both states. If we animate between the two in pixels that will trigger + * a paint each time. If we animate between the two in percentage we'll avoid a paint. + */ + const correctBorderRadius = { + correct: (latest, node) => { + if (!node.target) + return latest; + /** + * If latest is a string, if it's a percentage we can return immediately as it's + * going to be stretched appropriately. Otherwise, if it's a pixel, convert it to a number. + */ + if (typeof latest === "string") { + if (px.test(latest)) { + latest = parseFloat(latest); + } + else { + return latest; + } + } + /** + * If latest is a number, it's a pixel value. We use the current viewportBox to calculate that + * pixel value as a percentage of each axis + */ + const x = pixelsToPercent(latest, node.target.x); + const y = pixelsToPercent(latest, node.target.y); + return `${x}% ${y}%`; + }, + }; + + const correctBoxShadow = { + correct: (latest, { treeScale, projectionDelta }) => { + const original = latest; + const shadow = complex.parse(latest); + // TODO: Doesn't support multiple shadows + if (shadow.length > 5) + return original; + const template = complex.createTransformer(latest); + const offset = typeof shadow[0] !== "number" ? 1 : 0; + // Calculate the overall context scale + const xScale = projectionDelta.x.scale * treeScale.x; + const yScale = projectionDelta.y.scale * treeScale.y; + shadow[0 + offset] /= xScale; + shadow[1 + offset] /= yScale; + /** + * Ideally we'd correct x and y scales individually, but because blur and + * spread apply to both we have to take a scale average and apply that instead. + * We could potentially improve the outcome of this by incorporating the ratio between + * the two scales. + */ + const averageScale = mixNumber$1(xScale, yScale, 0.5); + // Blur + if (typeof shadow[2 + offset] === "number") + shadow[2 + offset] /= averageScale; + // Spread + if (typeof shadow[3 + offset] === "number") + shadow[3 + offset] /= averageScale; + return template(shadow); + }, + }; + + const scaleCorrectors = { + borderRadius: { + ...correctBorderRadius, + applyTo: [...cornerRadiusProps], + }, + borderTopLeftRadius: correctBorderRadius, + borderTopRightRadius: correctBorderRadius, + borderBottomLeftRadius: correctBorderRadius, + borderBottomRightRadius: correctBorderRadius, + boxShadow: correctBoxShadow, + }; + function addScaleCorrector(correctors) { + for (const key in correctors) { + scaleCorrectors[key] = correctors[key]; + if (isCSSVariableName(key)) { + scaleCorrectors[key].isCSSVariable = true; + } + } + } + + function isForcedMotionValue(key, { layout, layoutId }) { + return (transformProps.has(key) || + key.startsWith("origin") || + ((layout || layoutId !== undefined) && + (!!scaleCorrectors[key] || key === "opacity"))); + } + + function scrapeMotionValuesFromProps$1(props, prevProps, visualElement) { + const style = props.style; + const prevStyle = prevProps?.style; + const newValues = {}; + if (!style) + return newValues; + for (const key in style) { + if (isMotionValue(style[key]) || + (prevStyle && isMotionValue(prevStyle[key])) || + isForcedMotionValue(key, props) || + visualElement?.getValue(key)?.liveStyle !== undefined) { + newValues[key] = style[key]; + } + } + return newValues; + } + + function getComputedStyle$1(element) { + return window.getComputedStyle(element); + } + class HTMLVisualElement extends DOMVisualElement { + constructor() { + super(...arguments); + this.type = "html"; + this.renderInstance = renderHTML; + } + mount(instance) { + /** + * If a custom component forwards its ref to something other than a + * HTML/SVG element (a class instance, an imperative handle) there's + * nothing for Motion to style, measure or attach gestures to. #2777 + */ + exports.invariant(Boolean(instance.style), "motion.create() components must forward their ref to a HTML or SVG element", "custom-component-ref"); + super.mount(instance); + } + readValueFromInstance(instance, key) { + if (transformProps.has(key)) { + return this.projection?.isProjecting + ? defaultTransformValue(key) + : readTransformValue(instance, key); + } + else { + const computedStyle = getComputedStyle$1(instance); + const value = (isCSSVariableName(key) + ? computedStyle.getPropertyValue(key) + : computedStyle[key]) || 0; + return typeof value === "string" ? value.trim() : value; + } + } + measureInstanceViewportBox(instance, { transformPagePoint }) { + return measureViewportBox(instance, transformPagePoint); + } + build(renderState, latestValues, props) { + buildHTMLStyles(renderState, latestValues, props.transformTemplate); + } + scrapeMotionValuesFromProps(props, prevProps, visualElement) { + return scrapeMotionValuesFromProps$1(props, prevProps, visualElement); + } + } + + function isObjectKey(key, object) { + return key in object; + } + class ObjectVisualElement extends VisualElement { + constructor() { + super(...arguments); + this.type = "object"; + } + readValueFromInstance(instance, key) { + if (isObjectKey(key, instance)) { + const value = instance[key]; + if (typeof value === "string" || typeof value === "number") { + return value; + } + } + return undefined; + } + getBaseTargetFromProps() { + return undefined; + } + removeValueFromRenderState(key, renderState) { + delete renderState.output[key]; + } + measureInstanceViewportBox() { + return createBox(); + } + build(renderState, latestValues) { + Object.assign(renderState.output, latestValues); + } + renderInstance(instance, { output }) { + Object.assign(instance, output); + } + sortInstanceNodePosition() { + return 0; + } + } + + const dashKeys = { + offset: "stroke-dashoffset", + array: "stroke-dasharray", + }; + const camelKeys = { + offset: "strokeDashoffset", + array: "strokeDasharray", + }; + /** + * Build SVG path properties. Uses the path's measured length to convert + * our custom pathLength, pathSpacing and pathOffset into stroke-dashoffset + * and stroke-dasharray attributes. + * + * This function is mutative to reduce per-frame GC. + * + * Note: We use unitless values for stroke-dasharray and stroke-dashoffset + * because Safari incorrectly scales px values when the page is zoomed. + */ + function buildSVGPath(attrs, length, spacing = 1, offset = 0, useDashCase = true) { + // Normalise path length by setting SVG attribute pathLength to 1 + attrs.pathLength = 1; + // We use dash case when setting attributes directly to the DOM node and camel case + // when defining props on a React component. + const keys = useDashCase ? dashKeys : camelKeys; + // Build the dash offset (unitless to avoid Safari zoom bug) + attrs[keys.offset] = `${-offset}`; + // Build the dash array (unitless to avoid Safari zoom bug) + attrs[keys.array] = `${length} ${spacing}`; + } + + const cssStyleProperties = [ + "transform", + "opacity", + "offsetDistance", + "offsetPath", + "offsetRotate", + "offsetAnchor", + ]; + /** + * Build SVG visual attributes, like cx and style.transform + */ + function buildSVGAttrs(state, { attrX, attrY, attrScale, pathLength, pathSpacing = 1, pathOffset = 0, + // This is object creation, which we try to avoid per-frame. + ...latest }, isSVGTag, transformTemplate, styleProp) { + buildHTMLStyles(state, latest, transformTemplate); + /** + * For svg tags we just want to make sure viewBox is animatable and treat all the styles + * as normal HTML tags. + */ + if (isSVGTag) { + if (state.style.viewBox) { + state.attrs.viewBox = state.style.viewBox; + } + return; + } + state.attrs = state.style; + state.style = {}; + const { attrs, style } = state; + for (const key of cssStyleProperties) { + if (attrs[key] !== undefined) { + style[key] = attrs[key]; + delete attrs[key]; + } + } + if (style.transform || attrs.transformOrigin) { + style.transformOrigin = attrs.transformOrigin ?? "50% 50%"; + delete attrs.transformOrigin; + } + if (style.transform) { + /** + * SVG's element transform-origin uses its own median as a reference. + * Therefore, transformBox becomes a fill-box + */ + style.transformBox = styleProp?.transformBox ?? "fill-box"; + delete attrs.transformBox; + } + // Render attrX/attrY/attrScale as attributes + if (attrX !== undefined) + attrs.x = attrX; + if (attrY !== undefined) + attrs.y = attrY; + if (attrScale !== undefined) + attrs.scale = attrScale; + // Build SVG path if one has been defined + if (pathLength !== undefined) { + buildSVGPath(attrs, pathLength, pathSpacing, pathOffset, false); + } + } + + /** + * A set of attribute names that are always read/written as camel case. + */ + const camelCaseAttributes = new Set([ + "baseFrequency", + "diffuseConstant", + "kernelMatrix", + "kernelUnitLength", + "keySplines", + "keyTimes", + "limitingConeAngle", + "markerHeight", + "markerWidth", + "numOctaves", + "targetX", + "targetY", + "surfaceScale", + "specularConstant", + "specularExponent", + "stdDeviation", + "tableValues", + "viewBox", + "gradientTransform", + "pathLength", + "startOffset", + "textLength", + "lengthAdjust", + ]); + + const isSVGTag = (tag) => typeof tag === "string" && tag.toLowerCase() === "svg"; + + function renderSVG(element, renderState, _styleProp, projection) { + renderHTML(element, renderState, undefined, projection); + for (const key in renderState.attrs) { + element.setAttribute(!camelCaseAttributes.has(key) ? camelToDash(key) : key, renderState.attrs[key]); + } + } + + function scrapeMotionValuesFromProps(props, prevProps, visualElement) { + const newValues = scrapeMotionValuesFromProps$1(props, prevProps, visualElement); + for (const key in props) { + if (isMotionValue(props[key]) || + isMotionValue(prevProps[key])) { + const targetKey = transformPropOrder.indexOf(key) !== -1 + ? "attr" + key.charAt(0).toUpperCase() + key.substring(1) + : key; + newValues[targetKey] = props[key]; + } + } + return newValues; + } + + class SVGVisualElement extends DOMVisualElement { + constructor() { + super(...arguments); + this.type = "svg"; + this.isSVGTag = false; + this.measureInstanceViewportBox = createBox; + } + getBaseTargetFromProps(props, key) { + return props[key]; + } + readValueFromInstance(instance, key) { + if (transformProps.has(key)) { + const defaultType = getDefaultValueType(key); + return defaultType ? defaultType.default || 0 : 0; + } + if (cssStyleProperties.includes(key)) { + const computedStyle = getComputedStyle(instance); + const value = computedStyle[key]; + if (typeof value === "string" && value) + return value.trim(); + } + key = !camelCaseAttributes.has(key) ? camelToDash(key) : key; + return instance.getAttribute(key); + } + scrapeMotionValuesFromProps(props, prevProps, visualElement) { + return scrapeMotionValuesFromProps(props, prevProps, visualElement); + } + build(renderState, latestValues, props) { + buildSVGAttrs(renderState, latestValues, this.isSVGTag, props.transformTemplate, props.style); + } + renderInstance(instance, renderState, styleProp, projection) { + renderSVG(instance, renderState, styleProp, projection); + } + mount(instance) { + this.isSVGTag = isSVGTag(instance.tagName); + super.mount(instance); + } + } + + const numVariantProps = variantProps.length; + /** + * Get variant context from a visual element's parent chain. + * Uses `any` type for visualElement to avoid circular dependencies. + */ + function getVariantContext(visualElement) { + if (!visualElement) + return undefined; + if (!visualElement.isControllingVariants) { + const context = visualElement.parent + ? getVariantContext(visualElement.parent) || {} + : {}; + if (visualElement.props.initial !== undefined) { + context.initial = visualElement.props.initial; + } + return context; + } + const context = {}; + for (let i = 0; i < numVariantProps; i++) { + const name = variantProps[i]; + const prop = visualElement.props[name]; + if (isVariantLabel(prop) || prop === false) { + context[name] = prop; + } + } + return context; + } + + function shallowCompare(next, prev) { + if (!Array.isArray(prev)) + return false; + const prevLength = prev.length; + if (prevLength !== next.length) + return false; + for (let i = 0; i < prevLength; i++) { + if (prev[i] !== next[i]) + return false; + } + return true; + } + + const reversePriorityOrder = [...variantPriorityOrder].reverse(); + const numAnimationTypes = variantPriorityOrder.length; + function createAnimateFunction(visualElement) { + return (animations) => { + return Promise.all(animations.map(({ animation, options }) => animateVisualElement(visualElement, animation, options))); + }; + } + function createAnimationState(visualElement) { + let animate = createAnimateFunction(visualElement); + let state = createState(); + let isInitialRender = true; + /** + * Track whether the animation state has been reset (e.g. via StrictMode + * double-invocation or Suspense unmount/remount). On the first + * animateChanges() call after a reset we need to behave like the initial + * render for variant-inheritance checks, even though isInitialRender is + * already false. + */ + let wasReset = false; + /** + * This function will be used to reduce the animation definitions for + * each active animation type into an object of resolved values for it. + */ + const buildResolvedTypeValues = (type) => (acc, definition) => { + const resolved = resolveVariant(visualElement, definition, type === "exit" + ? visualElement.presenceContext?.custom + : undefined); + if (resolved) { + const { transition, transitionEnd, ...target } = resolved; + acc = { ...acc, ...target, ...transitionEnd }; + } + return acc; + }; + /** + * This just allows us to inject mocked animation functions + * @internal + */ + function setAnimateFunction(makeAnimator) { + animate = makeAnimator(visualElement); + } + /** + * When we receive new props, we need to: + * 1. Create a list of protected keys for each type. This is a directory of + * value keys that are currently being "handled" by types of a higher priority + * so that whenever an animation is played of a given type, these values are + * protected from being animated. + * 2. Determine if an animation type needs animating. + * 3. Determine if any values have been removed from a type and figure out + * what to animate those to. + */ + function animateChanges(changedActiveType) { + const { props } = visualElement; + const context = getVariantContext(visualElement.parent) || {}; + /** + * A list of animations that we'll build into as we iterate through the animation + * types. This will get executed at the end of the function. + */ + const animations = []; + /** + * Keep track of which values have been removed. Then, as we hit lower priority + * animation types, we can check if they contain removed values and animate to that. + */ + const removedKeys = new Set(); + /** + * A dictionary of all encountered keys. This is an object to let us build into and + * copy it without iteration. Each time we hit an animation type we set its protected + * keys - the keys its not allowed to animate - to the latest version of this object. + */ + let encounteredKeys = {}; + /** + * If a variant has been removed at a given index, and this component is controlling + * variant animations, we want to ensure lower-priority variants are forced to animate. + */ + let removedVariantIndex = Infinity; + /** + * Iterate through all animation types in reverse priority order. For each, we want to + * detect which values it's handling and whether or not they've changed (and therefore + * need to be animated). If any values have been removed, we want to detect those in + * lower priority props and flag for animation. + */ + for (let i = 0; i < numAnimationTypes; i++) { + const type = reversePriorityOrder[i]; + const typeState = state[type]; + const prop = props[type] !== undefined + ? props[type] + : context[type]; + const propIsVariant = isVariantLabel(prop); + /** + * If this type has *just* changed isActive status, set activeDelta + * to that status. Otherwise set to null. + */ + const activeDelta = type === changedActiveType ? typeState.isActive : null; + if (activeDelta === false) + removedVariantIndex = i; + /** + * If this prop is an inherited variant, rather than been set directly on the + * component itself, we want to make sure we allow the parent to trigger animations. + * + * TODO: Can probably change this to a !isControllingVariants check + */ + let isInherited = prop === context[type] && + prop !== props[type] && + propIsVariant; + if (isInherited && + (isInitialRender || wasReset) && + visualElement.manuallyAnimateOnMount) { + isInherited = false; + } + /** + * Set all encountered keys so far as the protected keys for this type. This will + * be any key that has been animated or otherwise handled by active, higher-priortiy types. + */ + typeState.protectedKeys = { ...encounteredKeys }; + // Check if we can skip analysing this prop early + if ( + // If it isn't active and hasn't *just* been set as inactive + (!typeState.isActive && activeDelta === null) || + // If we didn't and don't have any defined prop for this animation type + (!prop && !typeState.prevProp) || + // Or if the prop doesn't define an animation + isAnimationControls(prop) || + typeof prop === "boolean") { + continue; + } + /** + * If exit is already active and wasn't just activated, skip + * re-processing to prevent interrupting running exit animations. + * Re-resolving exit with a changed custom value can start new + * value animations that stop the originals, leaving the exit + * animation promise unresolved and the component stuck in the DOM. + */ + if (type === "exit" && typeState.isActive && activeDelta !== true) { + if (typeState.prevResolvedValues) { + encounteredKeys = { + ...encounteredKeys, + ...typeState.prevResolvedValues, + }; + } + continue; + } + /** + * As we go look through the values defined on this type, if we detect + * a changed value or a value that was removed in a higher priority, we set + * this to true and add this prop to the animation list. + */ + const variantDidChange = checkVariantsDidChange(typeState.prevProp, prop); + let shouldAnimateType = variantDidChange || + // If we're making this variant active, we want to always make it active + (type === changedActiveType && + typeState.isActive && + !isInherited && + propIsVariant) || + // If we removed a higher-priority variant (i is in reverse order) + (i > removedVariantIndex && propIsVariant); + let handledRemovedValues = false; + /** + * As animations can be set as variant lists, variants or target objects, we + * coerce everything to an array if it isn't one already + */ + const definitionList = Array.isArray(prop) ? prop : [prop]; + /** + * Build an object of all the resolved values. We'll use this in the subsequent + * animateChanges calls to determine whether a value has changed. + */ + let resolvedValues = definitionList.reduce(buildResolvedTypeValues(type), {}); + if (activeDelta === false) + resolvedValues = {}; + /** + * Now we need to loop through all the keys in the prev prop and this prop, + * and decide: + * 1. If the value has changed, and needs animating + * 2. If it has been removed, and needs adding to the removedKeys set + * 3. If it has been removed in a higher priority type and needs animating + * 4. If it hasn't been removed in a higher priority but hasn't changed, and + * needs adding to the type's protectedKeys list. + */ + const { prevResolvedValues = {} } = typeState; + const allKeys = { + ...prevResolvedValues, + ...resolvedValues, + }; + const markToAnimate = (key) => { + shouldAnimateType = true; + if (removedKeys.has(key)) { + handledRemovedValues = true; + removedKeys.delete(key); + } + typeState.needsAnimating[key] = true; + const motionValue = visualElement.getValue(key); + if (motionValue) + motionValue.liveStyle = false; + }; + for (const key in allKeys) { + const next = resolvedValues[key]; + const prev = prevResolvedValues[key]; + // If we've already handled this we can just skip ahead + if (encounteredKeys.hasOwnProperty(key)) + continue; + /** + * If the value has changed, we probably want to animate it. + */ + let valueHasChanged = false; + if (isKeyframesTarget(next) && isKeyframesTarget(prev)) { + valueHasChanged = + !shallowCompare(next, prev) || variantDidChange; + } + else { + valueHasChanged = next !== prev; + } + if (valueHasChanged) { + if (next !== undefined && next !== null) { + // If next is defined and doesn't equal prev, it needs animating + markToAnimate(key); + } + else { + // If it's undefined, it's been removed. + removedKeys.add(key); + } + } + else if (next !== undefined && removedKeys.has(key)) { + /** + * If next hasn't changed and it isn't undefined, we want to check if it's + * been removed by a higher priority + */ + markToAnimate(key); + } + else { + /** + * If it hasn't changed, we add it to the list of protected values + * to ensure it doesn't get animated. + */ + typeState.protectedKeys[key] = true; + } + } + /** + * Update the typeState so next time animateChanges is called we can compare the + * latest prop and resolvedValues to these. + */ + typeState.prevProp = prop; + typeState.prevResolvedValues = resolvedValues; + if (typeState.isActive) { + encounteredKeys = { ...encounteredKeys, ...resolvedValues }; + } + if ((isInitialRender || wasReset) && + visualElement.blockInitialAnimation) { + shouldAnimateType = false; + } + /** + * If this is an inherited prop we want to skip this animation + * unless the inherited variants haven't changed on this render. + */ + const willAnimateViaParent = isInherited && variantDidChange; + const needsAnimating = !willAnimateViaParent || handledRemovedValues; + if (shouldAnimateType && needsAnimating) { + animations.push(...definitionList.map((animation) => { + const options = { type }; + /** + * If we're performing the initial animation, but we're not + * rendering at the same time as the variant-controlling parent, + * we want to use the parent's transition to calculate the stagger. + */ + if (typeof animation === "string" && + (isInitialRender || wasReset) && + !willAnimateViaParent && + visualElement.manuallyAnimateOnMount && + visualElement.parent) { + const { parent } = visualElement; + const parentVariant = resolveVariant(parent, animation); + if (parent.enteringChildren && parentVariant) { + const { delayChildren } = parentVariant.transition || {}; + options.delay = calcChildStagger(parent.enteringChildren, visualElement, delayChildren); + } + } + return { + animation: animation, + options, + }; + })); + } + } + /** + * If there are some removed value that haven't been dealt with, + * we need to create a new animation that falls back either to the value + * defined in the style prop, or the last read value. + */ + if (removedKeys.size) { + const fallbackAnimation = {}; + /** + * If the initial prop contains a transition we can use that, otherwise + * allow the animation function to use the visual element's default. + */ + if (typeof props.initial !== "boolean") { + const initialTransition = resolveVariant(visualElement, Array.isArray(props.initial) + ? props.initial[0] + : props.initial); + if (initialTransition && initialTransition.transition) { + fallbackAnimation.transition = initialTransition.transition; + } + } + removedKeys.forEach((key) => { + const fallbackTarget = visualElement.getBaseTarget(key); + const motionValue = visualElement.getValue(key); + if (motionValue) + motionValue.liveStyle = true; + // @ts-expect-error - @mattgperry to figure if we should do something here + fallbackAnimation[key] = fallbackTarget ?? null; + }); + animations.push({ animation: fallbackAnimation }); + } + let shouldAnimate = Boolean(animations.length); + if (isInitialRender && + (props.initial === false || props.initial === props.animate) && + !visualElement.manuallyAnimateOnMount) { + shouldAnimate = false; + } + isInitialRender = false; + wasReset = false; + return shouldAnimate ? animate(animations) : Promise.resolve(); + } + /** + * Change whether a certain animation type is active. + */ + function setActive(type, isActive) { + // If the active state hasn't changed, we can safely do nothing here + if (state[type].isActive === isActive) + return Promise.resolve(); + // Propagate active change to children + visualElement.variantChildren?.forEach((child) => child.animationState?.setActive(type, isActive)); + state[type].isActive = isActive; + const animations = animateChanges(type); + for (const key in state) { + state[key].protectedKeys = {}; + } + return animations; + } + return { + animateChanges, + setActive, + setAnimateFunction, + getState: () => state, + reset: () => { + state = createState(); + wasReset = true; + }, + }; + } + function checkVariantsDidChange(prev, next) { + if (typeof next === "string") { + return next !== prev; + } + else if (Array.isArray(next)) { + return !shallowCompare(next, prev); + } + return false; + } + function createTypeState(isActive = false) { + return { + isActive, + protectedKeys: {}, + needsAnimating: {}, + prevResolvedValues: {}, + }; + } + function createState() { + return { + animate: createTypeState(true), + whileInView: createTypeState(), + whileHover: createTypeState(), + whileTap: createTypeState(), + whileDrag: createTypeState(), + whileFocus: createTypeState(), + exit: createTypeState(), + }; + } + + /** + * Reset an axis to the provided origin box. + * + * This is a mutative operation. + */ + function copyAxisInto(axis, originAxis) { + axis.min = originAxis.min; + axis.max = originAxis.max; + } + /** + * Reset a box to the provided origin box. + * + * This is a mutative operation. + */ + function copyBoxInto(box, originBox) { + copyAxisInto(box.x, originBox.x); + copyAxisInto(box.y, originBox.y); + } + /** + * Reset a delta to the provided origin box. + * + * This is a mutative operation. + */ + function copyAxisDeltaInto(delta, originDelta) { + delta.translate = originDelta.translate; + delta.scale = originDelta.scale; + delta.originPoint = originDelta.originPoint; + delta.origin = originDelta.origin; + } + + const SCALE_PRECISION = 0.0001; + const SCALE_MIN = 1 - SCALE_PRECISION; + const SCALE_MAX = 1 + SCALE_PRECISION; + const TRANSLATE_PRECISION = 0.01; + const TRANSLATE_MIN = 0 - TRANSLATE_PRECISION; + const TRANSLATE_MAX = 0 + TRANSLATE_PRECISION; + function calcLength(axis) { + return axis.max - axis.min; + } + function isNear(value, target, maxDistance) { + return Math.abs(value - target) <= maxDistance; + } + function calcAxisDelta(delta, source, target, origin = 0.5) { + delta.origin = origin; + delta.originPoint = mixNumber$1(source.min, source.max, delta.origin); + delta.scale = calcLength(target) / calcLength(source); + delta.translate = + mixNumber$1(target.min, target.max, delta.origin) - delta.originPoint; + if ((delta.scale >= SCALE_MIN && delta.scale <= SCALE_MAX) || + isNaN(delta.scale)) { + delta.scale = 1.0; + } + if ((delta.translate >= TRANSLATE_MIN && + delta.translate <= TRANSLATE_MAX) || + isNaN(delta.translate)) { + delta.translate = 0.0; + } + } + function calcBoxDelta(delta, source, target, origin) { + calcAxisDelta(delta.x, source.x, target.x, origin ? origin.originX : undefined); + calcAxisDelta(delta.y, source.y, target.y, origin ? origin.originY : undefined); + } + function calcRelativeAxis(target, relative, parent, anchor = 0) { + const anchorPoint = anchor + ? mixNumber$1(parent.min, parent.max, anchor) + : parent.min; + target.min = anchorPoint + relative.min; + target.max = target.min + calcLength(relative); + } + function calcRelativeBox(target, relative, parent, anchor) { + calcRelativeAxis(target.x, relative.x, parent.x, anchor?.x); + calcRelativeAxis(target.y, relative.y, parent.y, anchor?.y); + } + function calcRelativeAxisPosition(target, layout, parent, anchor = 0) { + const anchorPoint = anchor + ? mixNumber$1(parent.min, parent.max, anchor) + : parent.min; + target.min = layout.min - anchorPoint; + target.max = target.min + calcLength(layout); + } + function calcRelativePosition(target, layout, parent, anchor) { + calcRelativeAxisPosition(target.x, layout.x, parent.x, anchor?.x); + calcRelativeAxisPosition(target.y, layout.y, parent.y, anchor?.y); + } + + /** + * Remove a delta from a point. This is essentially the steps of applyPointDelta in reverse + */ + function removePointDelta(point, translate, scale, originPoint, boxScale) { + point -= translate; + point = scalePoint(point, 1 / scale, originPoint); + if (boxScale !== undefined) { + point = scalePoint(point, 1 / boxScale, originPoint); + } + return point; + } + /** + * Remove a delta from an axis. This is essentially the steps of applyAxisDelta in reverse + */ + function removeAxisDelta(axis, translate = 0, scale = 1, origin = 0.5, boxScale, originAxis = axis, sourceAxis = axis) { + if (percent.test(translate)) { + translate = parseFloat(translate); + const relativeProgress = mixNumber$1(sourceAxis.min, sourceAxis.max, translate / 100); + translate = relativeProgress - sourceAxis.min; + } + if (typeof translate !== "number") + return; + let originPoint = mixNumber$1(originAxis.min, originAxis.max, origin); + if (axis === originAxis) + originPoint -= translate; + axis.min = removePointDelta(axis.min, translate, scale, originPoint, boxScale); + axis.max = removePointDelta(axis.max, translate, scale, originPoint, boxScale); + } + /** + * Remove a transforms from an axis. This is essentially the steps of applyAxisTransforms in reverse + * and acts as a bridge between motion values and removeAxisDelta + */ + function removeAxisTransforms(axis, transforms, [key, scaleKey, originKey], origin, sourceAxis) { + removeAxisDelta(axis, transforms[key], transforms[scaleKey], transforms[originKey], transforms.scale, origin, sourceAxis); + } + /** + * The names of the motion values we want to apply as translation, scale and origin. + */ + const xKeys = ["x", "scaleX", "originX"]; + const yKeys = ["y", "scaleY", "originY"]; + /** + * Remove a transforms from an box. This is essentially the steps of applyAxisBox in reverse + * and acts as a bridge between motion values and removeAxisDelta + */ + function removeBoxTransforms(box, transforms, originBox, sourceBox) { + removeAxisTransforms(box.x, transforms, xKeys, originBox ? originBox.x : undefined, sourceBox ? sourceBox.x : undefined); + removeAxisTransforms(box.y, transforms, yKeys, originBox ? originBox.y : undefined, sourceBox ? sourceBox.y : undefined); + } + + function isAxisDeltaZero(delta) { + return delta.translate === 0 && delta.scale === 1; + } + function isDeltaZero(delta) { + return isAxisDeltaZero(delta.x) && isAxisDeltaZero(delta.y); + } + function axisEquals(a, b) { + return a.min === b.min && a.max === b.max; + } + function boxEquals(a, b) { + return axisEquals(a.x, b.x) && axisEquals(a.y, b.y); + } + function axisEqualsRounded(a, b) { + return (Math.round(a.min) === Math.round(b.min) && + Math.round(a.max) === Math.round(b.max)); + } + function boxEqualsRounded(a, b) { + return axisEqualsRounded(a.x, b.x) && axisEqualsRounded(a.y, b.y); + } + function aspectRatio(box) { + return calcLength(box.x) / calcLength(box.y); + } + function axisDeltaEquals(a, b) { + return (a.translate === b.translate && + a.scale === b.scale && + a.originPoint === b.originPoint); + } + + function eachAxis(callback) { + return [callback("x"), callback("y")]; + } + + function buildProjectionTransform(delta, treeScale, latestTransform) { + let transform = ""; + /** + * The translations we use to calculate are always relative to the viewport coordinate space. + * But when we apply scales, we also scale the coordinate space of an element and its children. + * For instance if we have a treeScale (the culmination of all parent scales) of 0.5 and we need + * to move an element 100 pixels, we actually need to move it 200 in within that scaled space. + */ + const xTranslate = delta.x.translate / treeScale.x; + const yTranslate = delta.y.translate / treeScale.y; + const zTranslate = latestTransform?.z || 0; + if (xTranslate || yTranslate || zTranslate) { + transform = `translate3d(${xTranslate}px, ${yTranslate}px, ${zTranslate}px) `; + } + /** + * Apply scale correction for the tree transform. + * This will apply scale to the screen-orientated axes. + */ + if (treeScale.x !== 1 || treeScale.y !== 1) { + transform += `scale(${1 / treeScale.x}, ${1 / treeScale.y}) `; + } + if (latestTransform) { + const { transformPerspective, rotate, pathRotation, rotateX, rotateY, skewX, skewY, } = latestTransform; + if (transformPerspective) + transform = `perspective(${transformPerspective}px) ${transform}`; + if (rotate) + transform += `rotate(${rotate}deg) `; + // Additive `rotate()` so user `rotate` isn't clobbered. + if (pathRotation) + transform += `rotate(${pathRotation}deg) `; + if (rotateX) + transform += `rotateX(${rotateX}deg) `; + if (rotateY) + transform += `rotateY(${rotateY}deg) `; + if (skewX) + transform += `skewX(${skewX}deg) `; + if (skewY) + transform += `skewY(${skewY}deg) `; + } + /** + * Apply scale to match the size of the element to the size we want it. + * This will apply scale to the element-orientated axes. + */ + const elementScaleX = delta.x.scale * treeScale.x; + const elementScaleY = delta.y.scale * treeScale.y; + if (elementScaleX !== 1 || elementScaleY !== 1) { + transform += `scale(${elementScaleX}, ${elementScaleY})`; + } + return transform || "none"; + } + + const numBorders = cornerRadiusProps.length; + const asNumber = (value) => typeof value === "string" ? parseFloat(value) : value; + const isPx = (value) => typeof value === "number" || px.test(value); + function mixValues(target, follow, lead, progress, shouldCrossfadeOpacity, isOnlyMember) { + if (shouldCrossfadeOpacity) { + target.opacity = mixNumber$1(0, lead.opacity ?? 1, easeCrossfadeIn(progress)); + target.opacityExit = mixNumber$1(follow.opacity ?? 1, 0, easeCrossfadeOut(progress)); + } + else if (isOnlyMember) { + target.opacity = mixNumber$1(follow.opacity ?? 1, lead.opacity ?? 1, progress); + } + /** + * Mix border radius + */ + for (let i = 0; i < numBorders; i++) { + const borderLabel = cornerRadiusProps[i]; + let followRadius = getRadius(follow, borderLabel); + let leadRadius = getRadius(lead, borderLabel); + if (followRadius === undefined && leadRadius === undefined) + continue; + followRadius || (followRadius = 0); + leadRadius || (leadRadius = 0); + const canMix = followRadius === 0 || + leadRadius === 0 || + isPx(followRadius) === isPx(leadRadius); + if (canMix) { + target[borderLabel] = Math.max(mixNumber$1(asNumber(followRadius), asNumber(leadRadius), progress), 0); + if (percent.test(leadRadius) || percent.test(followRadius)) { + target[borderLabel] += "%"; + } + } + else { + target[borderLabel] = leadRadius; + } + } + /** + * Mix rotation + */ + if (follow.rotate || lead.rotate) { + target.rotate = mixNumber$1(follow.rotate || 0, lead.rotate || 0, progress); + } + } + function getRadius(values, radiusName) { + return values[radiusName] !== undefined + ? values[radiusName] + : values.borderRadius; + } + const easeCrossfadeIn = /*@__PURE__*/ compress(0, 0.5, circOut); + const easeCrossfadeOut = /*@__PURE__*/ compress(0.5, 0.95, noop); + function compress(min, max, easing) { + return (p) => { + // Could replace ifs with clamp + if (p < min) + return 0; + if (p > max) + return 1; + return easing(progress(min, max, p)); + }; + } + + function animateSingleValue(value, keyframes, options) { + const motionValue$1 = isMotionValue(value) ? value : motionValue(value); + motionValue$1.start(animateMotionValue("", motionValue$1, keyframes, options)); + return motionValue$1.animation; + } + + function addDomEvent(target, eventName, handler, options = { passive: true }) { + target.addEventListener(eventName, handler, options); + return () => target.removeEventListener(eventName, handler, options); + } + + const compareByDepth = (a, b) => a.depth - b.depth; + + class FlatTree { + constructor() { + this.children = []; + this.isDirty = false; + } + add(child) { + addUniqueItem(this.children, child); + this.isDirty = true; + } + remove(child) { + removeItem(this.children, child); + this.isDirty = true; + } + forEach(callback) { + this.isDirty && this.children.sort(compareByDepth); + this.isDirty = false; + this.children.forEach(callback); + } + } + + /** + * Timeout defined in ms + */ + function delay(callback, timeout) { + const start = time.now(); + const checkElapsed = ({ timestamp }) => { + const elapsed = timestamp - start; + if (elapsed >= timeout) { + cancelFrame(checkElapsed); + callback(elapsed - timeout); + } + }; + frame.setup(checkElapsed, true); + return () => cancelFrame(checkElapsed); + } + function delayInSeconds(callback, timeout) { + return delay(callback, secondsToMilliseconds(timeout)); + } + + /** + * If the provided value is a MotionValue, this returns the actual value, otherwise just the value itself + */ + function resolveMotionValue(value) { + return isMotionValue(value) ? value.get() : value; + } + + class NodeStack { + constructor() { + this.members = []; + } + add(node) { + addUniqueItem(this.members, node); + for (let i = this.members.length - 1; i >= 0; i--) { + const member = this.members[i]; + if (member === node || member === this.lead || member === this.prevLead) + continue; + const inst = member.instance; + if ((!inst || inst.isConnected === false) && !member.snapshot) { + removeItem(this.members, member); + member.unmount(); + } + } + node.scheduleRender(); + } + remove(node) { + removeItem(this.members, node); + if (node === this.prevLead) + this.prevLead = undefined; + if (node === this.lead) { + const prevLead = this.members[this.members.length - 1]; + if (prevLead) + this.promote(prevLead); + } + } + relegate(node) { + for (let i = this.members.indexOf(node) - 1; i >= 0; i--) { + const member = this.members[i]; + if (member.isPresent !== false && member.instance?.isConnected !== false) { + this.promote(member); + return true; + } + } + return false; + } + promote(node, preserveFollowOpacity) { + const prevLead = this.lead; + if (node === prevLead) + return; + this.prevLead = prevLead; + this.lead = node; + node.show(); + if (prevLead) { + prevLead.updateSnapshot(); + node.scheduleRender(); + const { layoutDependency: prevDep } = prevLead.options; + const { layoutDependency: nextDep } = node.options; + if (prevDep === undefined || prevDep !== nextDep) { + node.resumeFrom = prevLead; + if (preserveFollowOpacity) + prevLead.preserveOpacity = true; + if (prevLead.snapshot) { + node.snapshot = prevLead.snapshot; + node.snapshot.latestValues = + prevLead.animationValues || prevLead.latestValues; + } + if (node.root?.isUpdating) + node.isLayoutDirty = true; + } + if (node.options.crossfade === false) + prevLead.hide(); + } + } + exitAnimationComplete() { + this.members.forEach((member) => { + member.options.onExitComplete?.(); + member.resumingFrom?.options.onExitComplete?.(); + }); + } + scheduleRender() { + this.members.forEach((member) => member.instance && member.scheduleRender(false)); + } + removeLeadSnapshot() { + if (this.lead?.snapshot) + this.lead.snapshot = undefined; + } + } + + /** + * This should only ever be modified on the client otherwise it'll + * persist through server requests. If we need instanced states we + * could lazy-init via root. + */ + const globalProjectionState = { + /** + * Global flag as to whether the tree has animated since the last time + * we resized the window + */ + hasAnimatedSinceResize: true, + /** + * We set this to true once, on the first update. Any nodes added to the tree beyond that + * update will be given a `data-projection-id` attribute. + */ + hasEverUpdated: false, + }; + + const metrics = { + nodes: 0, + calculatedTargetDeltas: 0, + calculatedProjections: 0, + }; + const transformAxes = ["", "X", "Y", "Z"]; + /** + * We use 1000 as the animation target as 0-1000 maps better to pixels than 0-1 + * which has a noticeable difference in spring animations + */ + const animationTarget = 1000; + let id = 0; + function resetDistortingTransform(key, visualElement, values, sharedAnimationValues) { + const { latestValues } = visualElement; + // Record the distorting transform and then temporarily set it to 0 + if (latestValues[key]) { + values[key] = latestValues[key]; + visualElement.setStaticValue(key, 0); + if (sharedAnimationValues) { + sharedAnimationValues[key] = 0; + } + } + } + function cancelTreeOptimisedTransformAnimations(projectionNode) { + projectionNode.hasCheckedOptimisedAppear = true; + if (projectionNode.root === projectionNode) + return; + const { visualElement } = projectionNode.options; + if (!visualElement) + return; + const appearId = getOptimisedAppearId(visualElement); + if (window.MotionHasOptimisedAnimation(appearId, "transform")) { + const { layout, layoutId } = projectionNode.options; + window.MotionCancelOptimisedAnimation(appearId, "transform", frame, !(layout || layoutId)); + } + const { parent } = projectionNode; + if (parent && !parent.hasCheckedOptimisedAppear) { + cancelTreeOptimisedTransformAnimations(parent); + } + } + function createProjectionNode({ attachResizeListener, defaultParent, measureScroll, checkIsScrollRoot, resetTransform, }) { + return class ProjectionNode { + constructor(latestValues = {}, parent = defaultParent?.()) { + /** + * A unique ID generated for every projection node. + */ + this.id = id++; + /** + * An id that represents a unique session instigated by startUpdate. + */ + this.animationId = 0; + this.animationCommitId = 0; + /** + * A Set containing all this component's children. This is used to iterate + * through the children. + * + * TODO: This could be faster to iterate as a flat array stored on the root node. + */ + this.children = new Set(); + /** + * Options for the node. We use this to configure what kind of layout animations + * we should perform (if any). + */ + this.options = {}; + /** + * We use this to detect when its safe to shut down part of a projection tree. + * We have to keep projecting children for scale correction and relative projection + * until all their parents stop performing layout animations. + */ + this.isTreeAnimating = false; + this.isAnimationBlocked = false; + /** + * Flag to true if we think this layout has been changed. We can't always know this, + * currently we set it to true every time a component renders, or if it has a layoutDependency + * if that has changed between renders. Additionally, components can be grouped by LayoutGroup + * and if one node is dirtied, they all are. + */ + this.isLayoutDirty = false; + /** + * Flag to true if we think the projection calculations for this node needs + * recalculating as a result of an updated transform or layout animation. + */ + this.isProjectionDirty = false; + /** + * Flag to true if the layout *or* transform has changed. This then gets propagated + * throughout the projection tree, forcing any element below to recalculate on the next frame. + */ + this.isSharedProjectionDirty = false; + /** + * Flag transform dirty. This gets propagated throughout the whole tree but is only + * respected by shared nodes. + */ + this.isTransformDirty = false; + /** + * Block layout updates for instant layout transitions throughout the tree. + */ + this.updateManuallyBlocked = false; + this.updateBlockedByResize = false; + /** + * Set to true between the start of the first `willUpdate` call and the end of the `didUpdate` + * call. + */ + this.isUpdating = false; + /** + * If this is an SVG element we currently disable projection transforms + */ + this.isSVG = false; + /** + * Flag to true (during promotion) if a node doing an instant layout transition needs to reset + * its projection styles. + */ + this.needsReset = false; + /** + * Flags whether this node should have its transform reset prior to measuring. + */ + this.shouldResetTransform = false; + /** + * Store whether this node has been checked for optimised appear animations. As + * effects fire bottom-up, and we want to look up the tree for appear animations, + * this makes sure we only check each path once, stopping at nodes that + * have already been checked. + */ + this.hasCheckedOptimisedAppear = false; + /** + * An object representing the calculated contextual/accumulated/tree scale. + * This will be used to scale calculcated projection transforms, as these are + * calculated in screen-space but need to be scaled for elements to layoutly + * make it to their calculated destinations. + * + * TODO: Lazy-init + */ + this.treeScale = { x: 1, y: 1 }; + /** + * + */ + this.eventHandlers = new Map(); + this.hasTreeAnimated = false; + this.layoutVersion = 0; + // Note: Currently only running on root node + this.updateScheduled = false; + this.scheduleUpdate = () => this.update(); + this.projectionUpdateScheduled = false; + this.checkUpdateFailed = () => { + if (this.isUpdating) { + this.isUpdating = false; + this.clearAllSnapshots(); + } + }; + /** + * This is a multi-step process as shared nodes might be of different depths. Nodes + * are sorted by depth order, so we need to resolve the entire tree before moving to + * the next step. + */ + this.updateProjection = () => { + this.projectionUpdateScheduled = false; + /** + * Reset debug counts. Manually resetting rather than creating a new + * object each frame. + */ + if (statsBuffer.value) { + metrics.nodes = + metrics.calculatedTargetDeltas = + metrics.calculatedProjections = + 0; + } + this.nodes.forEach(propagateDirtyNodes); + this.nodes.forEach(resolveTargetDelta); + this.nodes.forEach(calcProjection); + this.nodes.forEach(cleanDirtyNodes); + if (statsBuffer.addProjectionMetrics) { + statsBuffer.addProjectionMetrics(metrics); + } + }; + /** + * Frame calculations + */ + this.resolvedRelativeTargetAt = 0.0; + this.linkedParentVersion = 0; + this.hasProjected = false; + this.isVisible = true; + this.animationProgress = 0; + /** + * Shared layout + */ + // TODO Only running on root node + this.sharedNodes = new Map(); + this.latestValues = latestValues; + this.root = parent ? parent.root || parent : this; + this.path = parent ? [...parent.path, parent] : []; + this.parent = parent; + this.depth = parent ? parent.depth + 1 : 0; + for (let i = 0; i < this.path.length; i++) { + this.path[i].shouldResetTransform = true; + } + if (this.root === this) + this.nodes = new FlatTree(); + } + addEventListener(name, handler) { + if (!this.eventHandlers.has(name)) { + this.eventHandlers.set(name, new SubscriptionManager()); + } + return this.eventHandlers.get(name).add(handler); + } + notifyListeners(name, ...args) { + const subscriptionManager = this.eventHandlers.get(name); + subscriptionManager && subscriptionManager.notify(...args); + } + hasListeners(name) { + return this.eventHandlers.has(name); + } + /** + * Lifecycles + */ + mount(instance) { + if (this.instance) + return; + this.isSVG = isSVGElement(instance) && !isSVGSVGElement(instance); + this.instance = instance; + const { layoutId, layout, visualElement } = this.options; + if (visualElement && !visualElement.current) { + visualElement.mount(instance); + } + this.root.nodes.add(this); + this.parent && this.parent.children.add(this); + if (this.root.hasTreeAnimated && (layout || layoutId)) { + this.isLayoutDirty = true; + } + if (attachResizeListener) { + let cancelDelay; + let innerWidth = 0; + const resizeUnblockUpdate = () => (this.root.updateBlockedByResize = false); + // Set initial innerWidth in a frame.read callback to batch the read + frame.read(() => { + innerWidth = window.innerWidth; + }); + attachResizeListener(instance, () => { + const newInnerWidth = window.innerWidth; + if (newInnerWidth === innerWidth) + return; + innerWidth = newInnerWidth; + this.root.updateBlockedByResize = true; + cancelDelay && cancelDelay(); + cancelDelay = delay(resizeUnblockUpdate, 250); + if (globalProjectionState.hasAnimatedSinceResize) { + globalProjectionState.hasAnimatedSinceResize = false; + this.nodes.forEach(finishAnimation); + } + }); + } + if (layoutId) { + this.root.registerSharedNode(layoutId, this); + } + // Only register the handler if it requires layout animation + if (this.options.animate !== false && + visualElement && + (layoutId || layout)) { + this.addEventListener("didUpdate", ({ delta, hasLayoutChanged, hasRelativeLayoutChanged, layout: newLayout, }) => { + if (this.isTreeAnimationBlocked()) { + this.target = undefined; + this.relativeTarget = undefined; + return; + } + // TODO: Check here if an animation exists + const layoutTransition = this.options.transition || + visualElement.getDefaultTransition() || + defaultLayoutTransition; + const { onLayoutAnimationStart, onLayoutAnimationComplete, } = visualElement.getProps(); + /** + * The target layout of the element might stay the same, + * but its position relative to its parent has changed. + */ + const hasTargetChanged = !this.targetLayout || + !boxEqualsRounded(this.targetLayout, newLayout); + /* + * Note: Disabled to fix relative animations always triggering new + * layout animations. If this causes further issues, we can try + * a different approach to detecting relative target changes. + */ + // || hasRelativeLayoutChanged + /** + * If the layout hasn't seemed to have changed, it might be that the + * element is visually in the same place in the document but its position + * relative to its parent has indeed changed. So here we check for that. + */ + const hasOnlyRelativeTargetChanged = !hasLayoutChanged && hasRelativeLayoutChanged; + if (this.options.layoutRoot || + this.resumeFrom || + hasOnlyRelativeTargetChanged || + (hasLayoutChanged && + (hasTargetChanged || !this.currentAnimation))) { + if (this.resumeFrom) { + this.resumingFrom = this.resumeFrom; + this.resumingFrom.resumingFrom = undefined; + } + const animationOptions = { + ...getValueTransition$1(layoutTransition, "layout"), + onPlay: onLayoutAnimationStart, + onComplete: onLayoutAnimationComplete, + }; + if (visualElement.shouldReduceMotion || + this.options.layoutRoot) { + animationOptions.delay = 0; + animationOptions.type = false; + } + this.startAnimation(animationOptions); + /** + * Set animation origin after starting animation to avoid layout jump + * caused by stopping previous layout animation + */ + this.setAnimationOrigin(delta, hasOnlyRelativeTargetChanged, animationOptions + .path); + } + else { + /** + * If the layout hasn't changed and we have an animation that hasn't started yet, + * finish it immediately. Otherwise it will be animating from a location + * that was probably never committed to screen and look like a jumpy box. + */ + if (!hasLayoutChanged) { + finishAnimation(this); + } + if (this.isLead() && this.options.onExitComplete) { + this.options.onExitComplete(); + } + } + this.targetLayout = newLayout; + }); + } + } + unmount() { + this.options.layoutId && this.willUpdate(); + this.root.nodes.remove(this); + const stack = this.getStack(); + stack && stack.remove(this); + this.parent && this.parent.children.delete(this); + this.instance = undefined; + this.eventHandlers.clear(); + cancelFrame(this.updateProjection); + } + // only on the root + blockUpdate() { + this.updateManuallyBlocked = true; + } + unblockUpdate() { + this.updateManuallyBlocked = false; + } + isUpdateBlocked() { + return this.updateManuallyBlocked || this.updateBlockedByResize; + } + isTreeAnimationBlocked() { + return (this.isAnimationBlocked || + (this.parent && this.parent.isTreeAnimationBlocked()) || + false); + } + // Note: currently only running on root node + startUpdate() { + if (this.isUpdateBlocked()) + return; + this.isUpdating = true; + this.nodes && this.nodes.forEach(resetSkewAndRotation); + this.animationId++; + } + getTransformTemplate() { + const { visualElement } = this.options; + return visualElement && visualElement.getProps().transformTemplate; + } + willUpdate(shouldNotifyListeners = true) { + this.root.hasTreeAnimated = true; + if (this.root.isUpdateBlocked()) { + this.options.onExitComplete && this.options.onExitComplete(); + return; + } + /** + * If we're running optimised appear animations then these must be + * cancelled before measuring the DOM. This is so we can measure + * the true layout of the element rather than the WAAPI animation + * which will be unaffected by the resetSkewAndRotate step. + * + * Note: This is a DOM write. Worst case scenario is this is sandwiched + * between other snapshot reads which will cause unnecessary style recalculations. + * This has to happen here though, as we don't yet know which nodes will need + * snapshots in startUpdate(), but we only want to cancel optimised animations + * if a layout animation measurement is actually going to be affected by them. + */ + if (window.MotionCancelOptimisedAnimation && + !this.hasCheckedOptimisedAppear) { + cancelTreeOptimisedTransformAnimations(this); + } + !this.root.isUpdating && this.root.startUpdate(); + if (this.isLayoutDirty) + return; + this.isLayoutDirty = true; + for (let i = 0; i < this.path.length; i++) { + const node = this.path[i]; + node.shouldResetTransform = true; + /** + * Percentage translates resolve against layoutBox dimensions, + * so ancestors with them must be re-measured after transform reset. + */ + if (typeof node.latestValues.x === "string" || + typeof node.latestValues.y === "string") { + node.isLayoutDirty = true; + } + node.updateScroll("snapshot"); + if (node.options.layoutRoot) { + node.willUpdate(false); + } + } + const { layoutId, layout } = this.options; + if (layoutId === undefined && !layout) + return; + const transformTemplate = this.getTransformTemplate(); + this.prevTransformTemplateValue = transformTemplate + ? transformTemplate(this.latestValues, "") + : undefined; + this.updateSnapshot(); + shouldNotifyListeners && this.notifyListeners("willUpdate"); + } + update() { + this.updateScheduled = false; + const updateWasBlocked = this.isUpdateBlocked(); + // When doing an instant transition, we skip the layout update, + // but should still clean up the measurements so that the next + // snapshot could be taken correctly. + if (updateWasBlocked) { + const wasBlockedByResize = this.updateBlockedByResize; + this.unblockUpdate(); + this.updateBlockedByResize = false; + this.clearAllSnapshots(); + /** + * When blocked by resize, still measure layouts so + * callbacks like onLayoutMeasure fire (e.g. Reorder). + * Skip notifyLayoutUpdate to prevent animations. + */ + if (wasBlockedByResize) { + this.nodes.forEach(forceLayoutMeasure); + } + this.nodes.forEach(clearMeasurements); + return; + } + /** + * If this is a repeat of didUpdate then ignore the animation. + */ + if (this.animationId <= this.animationCommitId) { + this.nodes.forEach(clearIsLayoutDirty); + return; + } + this.animationCommitId = this.animationId; + if (!this.isUpdating) { + this.nodes.forEach(clearIsLayoutDirty); + } + else { + this.isUpdating = false; + /** + * Ensure animation-blocked nodes (e.g. during drag) + * get measured even when memoized (willUpdate skipped). + */ + this.nodes.forEach(ensureDraggedNodesSnapshotted); + /** + * Write + */ + this.nodes.forEach(resetTransformStyle); + /** + * Read ================== + */ + // Update layout measurements of updated children + this.nodes.forEach(updateLayout); + /** + * Write + */ + // Notify listeners that the layout is updated + this.nodes.forEach(notifyLayoutUpdate); + } + this.clearAllSnapshots(); + /** + * Manually flush any pending updates. Ideally + * we could leave this to the following requestAnimationFrame but this seems + * to leave a flash of incorrectly styled content. + */ + const now = time.now(); + frameData.delta = clamp(0, 1000 / 60, now - frameData.timestamp); + frameData.timestamp = now; + frameData.isProcessing = true; + frameSteps.update.process(frameData); + frameSteps.preRender.process(frameData); + frameSteps.render.process(frameData); + frameData.isProcessing = false; + } + didUpdate() { + if (!this.updateScheduled) { + this.updateScheduled = true; + microtask.read(this.scheduleUpdate); + } + } + clearAllSnapshots() { + this.nodes.forEach(clearSnapshot); + this.sharedNodes.forEach(removeLeadSnapshots); + } + scheduleUpdateProjection() { + if (!this.projectionUpdateScheduled) { + this.projectionUpdateScheduled = true; + frame.preRender(this.updateProjection, false, true); + } + } + scheduleCheckAfterUnmount() { + /** + * If the unmounting node is in a layoutGroup and did trigger a willUpdate, + * we manually call didUpdate to give a chance to the siblings to animate. + * Otherwise, cleanup all snapshots to prevents future nodes from reusing them. + */ + frame.postRender(() => { + if (this.isLayoutDirty) { + this.root.didUpdate(); + } + else { + this.root.checkUpdateFailed(); + } + }); + } + /** + * Update measurements + */ + updateSnapshot() { + if (this.snapshot || !this.instance) + return; + this.snapshot = this.measure(); + if (this.snapshot && + !calcLength(this.snapshot.measuredBox.x) && + !calcLength(this.snapshot.measuredBox.y)) { + this.snapshot = undefined; + } + } + updateLayout() { + if (!this.instance) + return; + this.updateScroll(); + if (!(this.options.alwaysMeasureLayout && this.isLead()) && + !this.isLayoutDirty) { + return; + } + /** + * When a node is mounted, it simply resumes from the prevLead's + * snapshot instead of taking a new one, but the ancestors scroll + * might have updated while the prevLead is unmounted. We need to + * update the scroll again to make sure the layout we measure is + * up to date. + */ + if (this.resumeFrom && !this.resumeFrom.instance) { + for (let i = 0; i < this.path.length; i++) { + const node = this.path[i]; + node.updateScroll(); + } + } + const prevLayout = this.layout; + this.layout = this.measure(false); + this.layoutVersion++; + if (!this.layoutCorrected) + this.layoutCorrected = createBox(); + this.isLayoutDirty = false; + this.projectionDelta = undefined; + this.notifyListeners("measure", this.layout.layoutBox); + const { visualElement } = this.options; + visualElement && + visualElement.notify("LayoutMeasure", this.layout.layoutBox, prevLayout ? prevLayout.layoutBox : undefined); + } + updateScroll(phase = "measure") { + let needsMeasurement = Boolean(this.options.layoutScroll && this.instance); + if (this.scroll && + this.scroll.animationId === this.root.animationId && + this.scroll.phase === phase) { + needsMeasurement = false; + } + if (needsMeasurement && this.instance) { + const isRoot = checkIsScrollRoot(this.instance); + this.scroll = { + animationId: this.root.animationId, + phase, + isRoot, + offset: measureScroll(this.instance), + wasRoot: this.scroll ? this.scroll.isRoot : isRoot, + }; + } + } + resetTransform() { + if (!resetTransform) + return; + const isResetRequested = this.isLayoutDirty || + this.shouldResetTransform || + this.options.alwaysMeasureLayout; + const hasProjection = this.projectionDelta && !isDeltaZero(this.projectionDelta); + const transformTemplate = this.getTransformTemplate(); + const transformTemplateValue = transformTemplate + ? transformTemplate(this.latestValues, "") + : undefined; + const transformTemplateHasChanged = transformTemplateValue !== this.prevTransformTemplateValue; + if (isResetRequested && + this.instance && + (hasProjection || + hasTransform(this.latestValues) || + transformTemplateHasChanged)) { + resetTransform(this.instance, transformTemplateValue); + this.shouldResetTransform = false; + this.scheduleRender(); + } + } + measure(removeTransform = true) { + const pageBox = this.measurePageBox(); + let layoutBox = this.removeElementScroll(pageBox); + /** + * Measurements taken during the pre-render stage + * still have transforms applied so we remove them + * via calculation. + */ + if (removeTransform) { + layoutBox = this.removeTransform(layoutBox); + } + roundBox(layoutBox); + return { + animationId: this.root.animationId, + measuredBox: pageBox, + layoutBox, + latestValues: {}, + source: this.id, + }; + } + measurePageBox() { + const { visualElement } = this.options; + if (!visualElement) + return createBox(); + const box = visualElement.measureViewportBox(); + const wasInScrollRoot = this.scroll?.wasRoot || this.path.some(checkNodeWasScrollRoot); + if (!wasInScrollRoot) { + // Remove viewport scroll to give page-relative coordinates + const { scroll } = this.root; + if (scroll) { + translateAxis(box.x, scroll.offset.x); + translateAxis(box.y, scroll.offset.y); + } + } + return box; + } + removeElementScroll(box) { + const boxWithoutScroll = createBox(); + copyBoxInto(boxWithoutScroll, box); + if (this.scroll?.wasRoot) { + return boxWithoutScroll; + } + /** + * Performance TODO: Keep a cumulative scroll offset down the tree + * rather than loop back up the path. + */ + for (let i = 0; i < this.path.length; i++) { + const node = this.path[i]; + const { scroll, options } = node; + if (node !== this.root && scroll && options.layoutScroll) { + /** + * If this is a new scroll root, we want to remove all previous scrolls + * from the viewport box. + */ + if (scroll.wasRoot) { + copyBoxInto(boxWithoutScroll, box); + } + translateAxis(boxWithoutScroll.x, scroll.offset.x); + translateAxis(boxWithoutScroll.y, scroll.offset.y); + } + } + return boxWithoutScroll; + } + applyTransform(box, transformOnly = false, output) { + const withTransforms = output || createBox(); + copyBoxInto(withTransforms, box); + for (let i = 0; i < this.path.length; i++) { + const node = this.path[i]; + if (!transformOnly && + node.options.layoutScroll && + node.scroll && + node !== node.root) { + translateAxis(withTransforms.x, -node.scroll.offset.x); + translateAxis(withTransforms.y, -node.scroll.offset.y); + } + if (!hasTransform(node.latestValues)) + continue; + transformBox(withTransforms, node.latestValues, node.layout?.layoutBox); + } + if (hasTransform(this.latestValues)) { + transformBox(withTransforms, this.latestValues, this.layout?.layoutBox); + } + return withTransforms; + } + removeTransform(box) { + const boxWithoutTransform = createBox(); + copyBoxInto(boxWithoutTransform, box); + for (let i = 0; i < this.path.length; i++) { + const node = this.path[i]; + if (!hasTransform(node.latestValues)) + continue; + let sourceBox; + if (node.instance) { + hasScale(node.latestValues) && node.updateSnapshot(); + sourceBox = createBox(); + copyBoxInto(sourceBox, node.measurePageBox()); + } + removeBoxTransforms(boxWithoutTransform, node.latestValues, node.snapshot?.layoutBox, sourceBox); + } + if (hasTransform(this.latestValues)) { + removeBoxTransforms(boxWithoutTransform, this.latestValues); + } + return boxWithoutTransform; + } + setTargetDelta(delta) { + this.targetDelta = delta; + this.root.scheduleUpdateProjection(); + this.isProjectionDirty = true; + } + setOptions(options) { + this.options = { + ...this.options, + ...options, + crossfade: options.crossfade !== undefined ? options.crossfade : true, + }; + } + clearMeasurements() { + this.scroll = undefined; + this.layout = undefined; + this.snapshot = undefined; + this.prevTransformTemplateValue = undefined; + this.targetDelta = undefined; + this.target = undefined; + this.isLayoutDirty = false; + } + forceRelativeParentToResolveTarget() { + if (!this.relativeParent) + return; + /** + * If the parent target isn't up-to-date, force it to update. + * This is an unfortunate de-optimisation as it means any updating relative + * projection will cause all the relative parents to recalculate back + * up the tree. + */ + if (this.relativeParent.resolvedRelativeTargetAt !== + frameData.timestamp) { + this.relativeParent.resolveTargetDelta(true); + } + } + resolveTargetDelta(forceRecalculation = false) { + /** + * Once the dirty status of nodes has been spread through the tree, we also + * need to check if we have a shared node of a different depth that has itself + * been dirtied. + */ + const lead = this.getLead(); + this.isProjectionDirty || (this.isProjectionDirty = lead.isProjectionDirty); + this.isTransformDirty || (this.isTransformDirty = lead.isTransformDirty); + this.isSharedProjectionDirty || (this.isSharedProjectionDirty = lead.isSharedProjectionDirty); + const isShared = Boolean(this.resumingFrom) || this !== lead; + /** + * We don't use transform for this step of processing so we don't + * need to check whether any nodes have changed transform. + */ + const canSkip = !(forceRecalculation || + (isShared && this.isSharedProjectionDirty) || + this.isProjectionDirty || + this.parent?.isProjectionDirty || + this.attemptToResolveRelativeTarget || + this.root.updateBlockedByResize); + if (canSkip) + return; + const { layout, layoutId } = this.options; + /** + * If we have no layout, we can't perform projection, so early return + */ + if (!this.layout || !(layout || layoutId)) + return; + this.resolvedRelativeTargetAt = frameData.timestamp; + const relativeParent = this.getClosestProjectingParent(); + if (relativeParent && + this.linkedParentVersion !== relativeParent.layoutVersion && + !relativeParent.options.layoutRoot) { + this.removeRelativeTarget(); + } + /** + * If we don't have a targetDelta but do have a layout, we can attempt to resolve + * a relativeParent. This will allow a component to perform scale correction + * even if no animation has started. + */ + if (!this.targetDelta && !this.relativeTarget) { + if (this.options.layoutAnchor !== false && + relativeParent && + relativeParent.layout) { + this.createRelativeTarget(relativeParent, this.layout.layoutBox, relativeParent.layout.layoutBox); + } + else { + this.removeRelativeTarget(); + } + } + /** + * If we have no relative target or no target delta our target isn't valid + * for this frame. + */ + if (!this.relativeTarget && !this.targetDelta) + return; + /** + * Lazy-init target data structure + */ + if (!this.target) { + this.target = createBox(); + this.targetWithTransforms = createBox(); + } + /** + * If we've got a relative box for this component, resolve it into a target relative to the parent. + */ + if (this.relativeTarget && + this.relativeTargetOrigin && + this.relativeParent && + this.relativeParent.target) { + this.forceRelativeParentToResolveTarget(); + calcRelativeBox(this.target, this.relativeTarget, this.relativeParent.target, this.options.layoutAnchor || undefined); + /** + * If we've only got a targetDelta, resolve it into a target + */ + } + else if (this.targetDelta) { + if (Boolean(this.resumingFrom)) { + this.applyTransform(this.layout.layoutBox, false, this.target); + } + else { + copyBoxInto(this.target, this.layout.layoutBox); + } + applyBoxDelta(this.target, this.targetDelta); + } + else { + /** + * If no target, use own layout as target + */ + copyBoxInto(this.target, this.layout.layoutBox); + } + /** + * If we've been told to attempt to resolve a relative target, do so. + */ + if (this.attemptToResolveRelativeTarget) { + this.attemptToResolveRelativeTarget = false; + if (this.options.layoutAnchor !== false && + relativeParent && + Boolean(relativeParent.resumingFrom) === + Boolean(this.resumingFrom) && + !relativeParent.options.layoutScroll && + relativeParent.target && + this.animationProgress !== 1) { + this.createRelativeTarget(relativeParent, this.target, relativeParent.target); + } + else { + this.relativeParent = this.relativeTarget = undefined; + } + } + /** + * Increase debug counter for resolved target deltas + */ + if (statsBuffer.value) { + metrics.calculatedTargetDeltas++; + } + } + getClosestProjectingParent() { + if (!this.parent || + hasScale(this.parent.latestValues) || + has2DTranslate(this.parent.latestValues)) { + return undefined; + } + if (this.parent.isProjecting()) { + return this.parent; + } + else { + return this.parent.getClosestProjectingParent(); + } + } + isProjecting() { + return Boolean((this.relativeTarget || + this.targetDelta || + this.options.layoutRoot) && + this.layout); + } + createRelativeTarget(relativeParent, layout, parentLayout) { + this.relativeParent = relativeParent; + this.linkedParentVersion = relativeParent.layoutVersion; + this.forceRelativeParentToResolveTarget(); + this.relativeTarget = createBox(); + this.relativeTargetOrigin = createBox(); + calcRelativePosition(this.relativeTargetOrigin, layout, parentLayout, this.options.layoutAnchor || undefined); + copyBoxInto(this.relativeTarget, this.relativeTargetOrigin); + } + removeRelativeTarget() { + this.relativeParent = this.relativeTarget = undefined; + } + calcProjection() { + const lead = this.getLead(); + const isShared = Boolean(this.resumingFrom) || this !== lead; + let canSkip = true; + /** + * If this is a normal layout animation and neither this node nor its nearest projecting + * is dirty then we can't skip. + */ + if (this.isProjectionDirty || this.parent?.isProjectionDirty) { + canSkip = false; + } + /** + * If this is a shared layout animation and this node's shared projection is dirty then + * we can't skip. + */ + if (isShared && + (this.isSharedProjectionDirty || this.isTransformDirty)) { + canSkip = false; + } + /** + * If we have resolved the target this frame we must recalculate the + * projection to ensure it visually represents the internal calculations. + */ + if (this.resolvedRelativeTargetAt === frameData.timestamp) { + canSkip = false; + } + if (canSkip) + return; + const { layout, layoutId } = this.options; + /** + * If this section of the tree isn't animating we can + * delete our target sources for the following frame. + */ + this.isTreeAnimating = Boolean((this.parent && this.parent.isTreeAnimating) || + this.currentAnimation || + this.pendingAnimation); + if (!this.isTreeAnimating) { + this.targetDelta = this.relativeTarget = undefined; + } + if (!this.layout || !(layout || layoutId)) + return; + /** + * Reset the corrected box with the latest values from box, as we're then going + * to perform mutative operations on it. + */ + copyBoxInto(this.layoutCorrected, this.layout.layoutBox); + /** + * Record previous tree scales before updating. + */ + const prevTreeScaleX = this.treeScale.x; + const prevTreeScaleY = this.treeScale.y; + /** + * Apply all the parent deltas to this box to produce the corrected box. This + * is the layout box, as it will appear on screen as a result of the transforms of its parents. + */ + applyTreeDeltas(this.layoutCorrected, this.treeScale, this.path, isShared); + /** + * If this layer needs to perform scale correction but doesn't have a target, + * use the layout as the target. + */ + if (lead.layout && + !lead.target && + (this.treeScale.x !== 1 || this.treeScale.y !== 1)) { + lead.target = lead.layout.layoutBox; + lead.targetWithTransforms = createBox(); + } + const { target } = lead; + if (!target) { + /** + * If we don't have a target to project into, but we were previously + * projecting, we want to remove the stored transform and schedule + * a render to ensure the elements reflect the removed transform. + */ + if (this.prevProjectionDelta) { + this.createProjectionDeltas(); + this.scheduleRender(); + } + return; + } + if (!this.projectionDelta || !this.prevProjectionDelta) { + this.createProjectionDeltas(); + } + else { + copyAxisDeltaInto(this.prevProjectionDelta.x, this.projectionDelta.x); + copyAxisDeltaInto(this.prevProjectionDelta.y, this.projectionDelta.y); + } + /** + * Update the delta between the corrected box and the target box before user-set transforms were applied. + * This will allow us to calculate the corrected borderRadius and boxShadow to compensate + * for our layout reprojection, but still allow them to be scaled correctly by the user. + * It might be that to simplify this we may want to accept that user-set scale is also corrected + * and we wouldn't have to keep and calc both deltas, OR we could support a user setting + * to allow people to choose whether these styles are corrected based on just the + * layout reprojection or the final bounding box. + */ + calcBoxDelta(this.projectionDelta, this.layoutCorrected, target, this.latestValues); + if (this.treeScale.x !== prevTreeScaleX || + this.treeScale.y !== prevTreeScaleY || + !axisDeltaEquals(this.projectionDelta.x, this.prevProjectionDelta.x) || + !axisDeltaEquals(this.projectionDelta.y, this.prevProjectionDelta.y)) { + this.hasProjected = true; + this.scheduleRender(); + this.notifyListeners("projectionUpdate", target); + } + /** + * Increase debug counter for recalculated projections + */ + if (statsBuffer.value) { + metrics.calculatedProjections++; + } + } + hide() { + this.isVisible = false; + // TODO: Schedule render + } + show() { + this.isVisible = true; + // TODO: Schedule render + } + scheduleRender(notifyAll = true) { + this.options.visualElement?.scheduleRender(); + if (notifyAll) { + const stack = this.getStack(); + stack && stack.scheduleRender(); + } + if (this.resumingFrom && !this.resumingFrom.instance) { + this.resumingFrom = undefined; + } + } + createProjectionDeltas() { + this.prevProjectionDelta = createDelta(); + this.projectionDelta = createDelta(); + this.projectionDeltaWithTransform = createDelta(); + } + setAnimationOrigin(delta, hasOnlyRelativeTargetChanged = false, pathFn) { + const snapshot = this.snapshot; + const snapshotLatestValues = snapshot ? snapshot.latestValues : {}; + const mixedValues = { ...this.latestValues }; + const targetDelta = createDelta(); + if (!this.relativeParent || + !this.relativeParent.options.layoutRoot) { + this.relativeTarget = this.relativeTargetOrigin = undefined; + } + this.attemptToResolveRelativeTarget = !hasOnlyRelativeTargetChanged; + const relativeLayout = createBox(); + const snapshotSource = snapshot ? snapshot.source : undefined; + const layoutSource = this.layout ? this.layout.source : undefined; + const isSharedLayoutAnimation = snapshotSource !== layoutSource; + const stack = this.getStack(); + const isOnlyMember = !stack || stack.members.length <= 1; + const shouldCrossfadeOpacity = Boolean(isSharedLayoutAnimation && + !isOnlyMember && + this.options.crossfade === true && + !this.path.some(hasOpacityCrossfade)); + this.animationProgress = 0; + let prevRelativeTarget; + // The path decides whether the layout shift is worth curving + // (distance floor) and resolves the interpolator from the delta. + const interpolate = pathFn?.interpolateProjection(delta); + this.mixTargetDelta = (latest) => { + const progress = latest / 1000; + const point = interpolate?.(progress); + if (point) { + targetDelta.x.translate = point.x; + targetDelta.x.scale = mixNumber$1(delta.x.scale, 1, progress); + targetDelta.x.origin = delta.x.origin; + targetDelta.x.originPoint = delta.x.originPoint; + targetDelta.y.translate = point.y; + targetDelta.y.scale = mixNumber$1(delta.y.scale, 1, progress); + targetDelta.y.origin = delta.y.origin; + targetDelta.y.originPoint = delta.y.originPoint; + } + else { + mixAxisDeltaLinear(targetDelta.x, delta.x, progress); + mixAxisDeltaLinear(targetDelta.y, delta.y, progress); + } + this.setTargetDelta(targetDelta); + if (this.relativeTarget && + this.relativeTargetOrigin && + this.layout && + this.relativeParent && + this.relativeParent.layout) { + calcRelativePosition(relativeLayout, this.layout.layoutBox, this.relativeParent.layout.layoutBox, this.options.layoutAnchor || undefined); + mixBox(this.relativeTarget, this.relativeTargetOrigin, relativeLayout, progress); + /** + * If this is an unchanged relative target we can consider the + * projection not dirty. + */ + if (prevRelativeTarget && + boxEquals(this.relativeTarget, prevRelativeTarget)) { + this.isProjectionDirty = false; + } + if (!prevRelativeTarget) + prevRelativeTarget = createBox(); + copyBoxInto(prevRelativeTarget, this.relativeTarget); + } + if (isSharedLayoutAnimation) { + this.animationValues = mixedValues; + mixValues(mixedValues, snapshotLatestValues, this.latestValues, progress, shouldCrossfadeOpacity, isOnlyMember); + } + if (point && point.rotate !== undefined) { + // Dedicated `pathRotation` channel, not `rotate`, so an + // animating `rotate` is composed with, never clobbered. + if (!this.animationValues) + this.animationValues = mixedValues; + this.animationValues.pathRotation = point.rotate; + } + this.root.scheduleUpdateProjection(); + this.scheduleRender(); + this.animationProgress = progress; + }; + this.mixTargetDelta(this.options.layoutRoot ? 1000 : 0); + } + startAnimation(options) { + this.notifyListeners("animationStart"); + this.currentAnimation?.stop(); + this.resumingFrom?.currentAnimation?.stop(); + if (this.pendingAnimation) { + cancelFrame(this.pendingAnimation); + this.pendingAnimation = undefined; + } + /** + * Start the animation in the next frame to have a frame with progress 0, + * where the target is the same as when the animation started, so we can + * calculate the relative positions correctly for instant transitions. + */ + this.pendingAnimation = frame.update(() => { + globalProjectionState.hasAnimatedSinceResize = true; + this.motionValue || (this.motionValue = motionValue(0)); + this.motionValue.jump(0, false); + this.currentAnimation = animateSingleValue(this.motionValue, [0, 1000], { + ...options, + velocity: 0, + isSync: true, + onUpdate: (latest) => { + this.mixTargetDelta(latest); + options.onUpdate && options.onUpdate(latest); + }, + onComplete: () => { + options.onComplete && options.onComplete(); + this.completeAnimation(); + }, + }); + if (this.resumingFrom) { + this.resumingFrom.currentAnimation = this.currentAnimation; + } + this.pendingAnimation = undefined; + }); + } + completeAnimation() { + if (this.resumingFrom) { + this.resumingFrom.currentAnimation = undefined; + this.resumingFrom.preserveOpacity = undefined; + } + const stack = this.getStack(); + stack && stack.exitAnimationComplete(); + this.resumingFrom = + this.currentAnimation = + this.animationValues = + undefined; + this.notifyListeners("animationComplete"); + } + finishAnimation() { + if (this.currentAnimation) { + this.mixTargetDelta && this.mixTargetDelta(animationTarget); + this.currentAnimation.stop(); + } + this.completeAnimation(); + } + applyTransformsToTarget() { + const lead = this.getLead(); + let { targetWithTransforms, target, layout, latestValues } = lead; + if (!targetWithTransforms || !target || !layout) + return; + /** + * If we're only animating position, and this element isn't the lead element, + * then instead of projecting into the lead box we instead want to calculate + * a new target that aligns the two boxes but maintains the layout shape. + */ + if (this !== lead && + this.layout && + layout && + shouldAnimatePositionOnly(this.options.animationType, this.layout.layoutBox, layout.layoutBox)) { + target = this.target || createBox(); + const xLength = calcLength(this.layout.layoutBox.x); + target.x.min = lead.target.x.min; + target.x.max = target.x.min + xLength; + const yLength = calcLength(this.layout.layoutBox.y); + target.y.min = lead.target.y.min; + target.y.max = target.y.min + yLength; + } + copyBoxInto(targetWithTransforms, target); + /** + * Apply the latest user-set transforms to the targetBox to produce the targetBoxFinal. + * This is the final box that we will then project into by calculating a transform delta and + * applying it to the corrected box. + */ + transformBox(targetWithTransforms, latestValues); + /** + * Update the delta between the corrected box and the final target box, after + * user-set transforms are applied to it. This will be used by the renderer to + * create a transform style that will reproject the element from its layout layout + * into the desired bounding box. + */ + calcBoxDelta(this.projectionDeltaWithTransform, this.layoutCorrected, targetWithTransforms, latestValues); + } + registerSharedNode(layoutId, node) { + if (!this.sharedNodes.has(layoutId)) { + this.sharedNodes.set(layoutId, new NodeStack()); + } + const stack = this.sharedNodes.get(layoutId); + stack.add(node); + const config = node.options.initialPromotionConfig; + node.promote({ + transition: config ? config.transition : undefined, + preserveFollowOpacity: config && config.shouldPreserveFollowOpacity + ? config.shouldPreserveFollowOpacity(node) + : undefined, + }); + } + isLead() { + const stack = this.getStack(); + return stack ? stack.lead === this : true; + } + getLead() { + const { layoutId } = this.options; + return layoutId ? this.getStack()?.lead || this : this; + } + getPrevLead() { + const { layoutId } = this.options; + return layoutId ? this.getStack()?.prevLead : undefined; + } + getStack() { + const { layoutId } = this.options; + if (layoutId) + return this.root.sharedNodes.get(layoutId); + } + promote({ needsReset, transition, preserveFollowOpacity, } = {}) { + const stack = this.getStack(); + if (stack) + stack.promote(this, preserveFollowOpacity); + if (needsReset) { + this.projectionDelta = undefined; + this.needsReset = true; + } + if (transition) + this.setOptions({ transition }); + } + relegate() { + const stack = this.getStack(); + if (stack) { + return stack.relegate(this); + } + else { + return false; + } + } + resetSkewAndRotation() { + const { visualElement } = this.options; + if (!visualElement) + return; + // If there's no detected skew or rotation values, we can early return without a forced render. + let hasDistortingTransform = false; + /** + * An unrolled check for rotation values. Most elements don't have any rotation and + * skipping the nested loop and new object creation is 50% faster. + */ + const { latestValues } = visualElement; + if (latestValues.z || + latestValues.rotate || + latestValues.rotateX || + latestValues.rotateY || + latestValues.rotateZ || + latestValues.skewX || + latestValues.skewY) { + hasDistortingTransform = true; + } + // If there's no distorting values, we don't need to do any more. + if (!hasDistortingTransform) + return; + const resetValues = {}; + if (latestValues.z) { + resetDistortingTransform("z", visualElement, resetValues, this.animationValues); + } + // Check the skew and rotate value of all axes and reset to 0 + for (let i = 0; i < transformAxes.length; i++) { + resetDistortingTransform(`rotate${transformAxes[i]}`, visualElement, resetValues, this.animationValues); + resetDistortingTransform(`skew${transformAxes[i]}`, visualElement, resetValues, this.animationValues); + } + // Force a render of this element to apply the transform with all skews and rotations + // set to 0. + visualElement.render(); + // Put back all the values we reset + for (const key in resetValues) { + visualElement.setStaticValue(key, resetValues[key]); + if (this.animationValues) { + this.animationValues[key] = resetValues[key]; + } + } + // Schedule a render for the next frame. This ensures we won't visually + // see the element with the reset rotate value applied. + visualElement.scheduleRender(); + } + applyProjectionStyles(targetStyle, // CSSStyleDeclaration - doesn't allow numbers to be assigned to properties + styleProp) { + if (!this.instance || this.isSVG) + return; + if (!this.isVisible) { + targetStyle.visibility = "hidden"; + return; + } + const transformTemplate = this.getTransformTemplate(); + if (this.needsReset) { + this.needsReset = false; + targetStyle.visibility = ""; + targetStyle.opacity = ""; + targetStyle.pointerEvents = + resolveMotionValue(styleProp?.pointerEvents) || ""; + targetStyle.transform = transformTemplate + ? transformTemplate(this.latestValues, "") + : "none"; + return; + } + const lead = this.getLead(); + if (!this.projectionDelta || !this.layout || !lead.target) { + if (this.options.layoutId) { + targetStyle.opacity = + this.latestValues.opacity !== undefined + ? this.latestValues.opacity + : 1; + targetStyle.pointerEvents = + resolveMotionValue(styleProp?.pointerEvents) || ""; + } + if (this.hasProjected && !hasTransform(this.latestValues)) { + targetStyle.transform = transformTemplate + ? transformTemplate({}, "") + : "none"; + this.hasProjected = false; + } + return; + } + targetStyle.visibility = ""; + const valuesToRender = lead.animationValues || lead.latestValues; + this.applyTransformsToTarget(); + let transform = buildProjectionTransform(this.projectionDeltaWithTransform, this.treeScale, valuesToRender); + if (transformTemplate) { + transform = transformTemplate(valuesToRender, transform); + } + targetStyle.transform = transform; + const { x, y } = this.projectionDelta; + targetStyle.transformOrigin = `${x.origin * 100}% ${y.origin * 100}% 0`; + if (lead.animationValues) { + /** + * If the lead component is animating, assign this either the entering/leaving + * opacity + */ + targetStyle.opacity = + lead === this + ? valuesToRender.opacity ?? + this.latestValues.opacity ?? + 1 + : this.preserveOpacity + ? this.latestValues.opacity + : valuesToRender.opacityExit; + } + else { + /** + * Or we're not animating at all, set the lead component to its layout + * opacity and other components to hidden. + */ + targetStyle.opacity = + lead === this + ? valuesToRender.opacity !== undefined + ? valuesToRender.opacity + : "" + : valuesToRender.opacityExit !== undefined + ? valuesToRender.opacityExit + : 0; + } + /** + * Apply scale correction + */ + for (const key in scaleCorrectors) { + if (valuesToRender[key] === undefined) + continue; + const { correct, applyTo, isCSSVariable } = scaleCorrectors[key]; + /** + * Only apply scale correction to the value if we have an + * active projection transform. Otherwise these values become + * vulnerable to distortion if the element changes size without + * a corresponding layout animation. + */ + const corrected = transform === "none" + ? valuesToRender[key] + : correct(valuesToRender[key], lead); + if (applyTo) { + const num = applyTo.length; + for (let i = 0; i < num; i++) { + targetStyle[applyTo[i]] = corrected; + } + } + else { + // If this is a CSS variable, set it directly on the instance. + // Replacing this function from creating styles to setting them + // would be a good place to remove per frame object creation + if (isCSSVariable) { + this.options.visualElement.renderState.vars[key] = corrected; + } + else { + targetStyle[key] = corrected; + } + } + } + /** + * Disable pointer events on follow components. This is to ensure + * that if a follow component covers a lead component it doesn't block + * pointer events on the lead. + */ + if (this.options.layoutId) { + targetStyle.pointerEvents = + lead === this + ? resolveMotionValue(styleProp?.pointerEvents) || "" + : "none"; + } + } + clearSnapshot() { + this.resumeFrom = this.snapshot = undefined; + } + // Only run on root + resetTree() { + this.root.nodes.forEach((node) => node.currentAnimation?.stop()); + this.root.nodes.forEach(clearMeasurements); + this.root.sharedNodes.clear(); + } + }; + } + function updateLayout(node) { + node.updateLayout(); + } + function notifyLayoutUpdate(node) { + const snapshot = node.resumeFrom?.snapshot || node.snapshot; + if (node.isLead() && + node.layout && + snapshot && + node.hasListeners("didUpdate")) { + const { layoutBox: layout, measuredBox: measuredLayout } = node.layout; + const { animationType } = node.options; + const isShared = snapshot.source !== node.layout.source; + // TODO Maybe we want to also resize the layout snapshot so we don't trigger + // animations for instance if layout="size" and an element has only changed position + if (animationType === "size") { + eachAxis((axis) => { + const axisSnapshot = isShared + ? snapshot.measuredBox[axis] + : snapshot.layoutBox[axis]; + const length = calcLength(axisSnapshot); + axisSnapshot.min = layout[axis].min; + axisSnapshot.max = axisSnapshot.min + length; + }); + } + else if (animationType === "x" || animationType === "y") { + const snapAxis = animationType === "x" ? "y" : "x"; + copyAxisInto(isShared + ? snapshot.measuredBox[snapAxis] + : snapshot.layoutBox[snapAxis], layout[snapAxis]); + } + else if (shouldAnimatePositionOnly(animationType, snapshot.layoutBox, layout)) { + eachAxis((axis) => { + const axisSnapshot = isShared + ? snapshot.measuredBox[axis] + : snapshot.layoutBox[axis]; + const length = calcLength(layout[axis]); + axisSnapshot.max = axisSnapshot.min + length; + /** + * Ensure relative target gets resized and rerendererd + */ + if (node.relativeTarget && !node.currentAnimation) { + node.isProjectionDirty = true; + node.relativeTarget[axis].max = + node.relativeTarget[axis].min + length; + } + }); + } + const layoutDelta = createDelta(); + calcBoxDelta(layoutDelta, layout, snapshot.layoutBox); + const visualDelta = createDelta(); + if (isShared) { + calcBoxDelta(visualDelta, node.applyTransform(measuredLayout, true), snapshot.measuredBox); + } + else { + calcBoxDelta(visualDelta, layout, snapshot.layoutBox); + } + const hasLayoutChanged = !isDeltaZero(layoutDelta); + let hasRelativeLayoutChanged = false; + if (!node.resumeFrom) { + const relativeParent = node.getClosestProjectingParent(); + /** + * If the relativeParent is itself resuming from a different element then + * the relative snapshot is not relavent + */ + if (relativeParent && !relativeParent.resumeFrom) { + const { snapshot: parentSnapshot, layout: parentLayout } = relativeParent; + if (parentSnapshot && parentLayout) { + const anchor = node.options.layoutAnchor || undefined; + const relativeSnapshot = createBox(); + calcRelativePosition(relativeSnapshot, snapshot.layoutBox, parentSnapshot.layoutBox, anchor); + const relativeLayout = createBox(); + calcRelativePosition(relativeLayout, layout, parentLayout.layoutBox, anchor); + if (!boxEqualsRounded(relativeSnapshot, relativeLayout)) { + hasRelativeLayoutChanged = true; + } + if (relativeParent.options.layoutRoot) { + node.relativeTarget = relativeLayout; + node.relativeTargetOrigin = relativeSnapshot; + node.relativeParent = relativeParent; + } + } + } + } + node.notifyListeners("didUpdate", { + layout, + snapshot, + delta: visualDelta, + layoutDelta, + hasLayoutChanged, + hasRelativeLayoutChanged, + }); + } + else if (node.isLead()) { + const { onExitComplete } = node.options; + onExitComplete && onExitComplete(); + } + /** + * Clearing transition + * TODO: Investigate why this transition is being passed in as {type: false } from Framer + * and why we need it at all + */ + node.options.transition = undefined; + } + function propagateDirtyNodes(node) { + /** + * Increase debug counter for nodes encountered this frame + */ + if (statsBuffer.value) { + metrics.nodes++; + } + if (!node.parent) + return; + /** + * If this node isn't projecting, propagate isProjectionDirty. It will have + * no performance impact but it will allow the next child that *is* projecting + * but *isn't* dirty to just check its parent to see if *any* ancestor needs + * correcting. + */ + if (!node.isProjecting()) { + node.isProjectionDirty = node.parent.isProjectionDirty; + } + /** + * Propagate isSharedProjectionDirty and isTransformDirty + * throughout the whole tree. A future revision can take another look at + * this but for safety we still recalcualte shared nodes. + */ + node.isSharedProjectionDirty || (node.isSharedProjectionDirty = Boolean(node.isProjectionDirty || + node.parent.isProjectionDirty || + node.parent.isSharedProjectionDirty)); + node.isTransformDirty || (node.isTransformDirty = node.parent.isTransformDirty); + } + function cleanDirtyNodes(node) { + node.isProjectionDirty = + node.isSharedProjectionDirty = + node.isTransformDirty = + false; + } + function clearSnapshot(node) { + node.clearSnapshot(); + } + function clearMeasurements(node) { + node.clearMeasurements(); + } + function forceLayoutMeasure(node) { + node.isLayoutDirty = true; + node.updateLayout(); + } + function clearIsLayoutDirty(node) { + node.isLayoutDirty = false; + } + /** + * When a node is animation-blocked (e.g. during drag) and its component + * didn't re-render (memoized), willUpdate() is never called so there's + * no snapshot. Use the previous layout as a snapshot and mark dirty so + * resetTransform/updateLayout/notifyLayoutUpdate process it normally. + */ + function ensureDraggedNodesSnapshotted(node) { + if (node.isAnimationBlocked && node.layout && !node.isLayoutDirty) { + node.snapshot = node.layout; + node.isLayoutDirty = true; + } + } + function resetTransformStyle(node) { + const { visualElement } = node.options; + if (visualElement && visualElement.getProps().onBeforeLayoutMeasure) { + visualElement.notify("BeforeLayoutMeasure"); + } + node.resetTransform(); + } + function finishAnimation(node) { + node.finishAnimation(); + node.targetDelta = node.relativeTarget = node.target = undefined; + node.isProjectionDirty = true; + } + function resolveTargetDelta(node) { + node.resolveTargetDelta(); + } + function calcProjection(node) { + node.calcProjection(); + } + function resetSkewAndRotation(node) { + node.resetSkewAndRotation(); + } + function removeLeadSnapshots(stack) { + stack.removeLeadSnapshot(); + } + function mixAxisDeltaLinear(output, delta, p) { + output.translate = mixNumber$1(delta.translate, 0, p); + output.scale = mixNumber$1(delta.scale, 1, p); + output.origin = delta.origin; + output.originPoint = delta.originPoint; + } + function mixAxis(output, from, to, p) { + output.min = mixNumber$1(from.min, to.min, p); + output.max = mixNumber$1(from.max, to.max, p); + } + function mixBox(output, from, to, p) { + mixAxis(output.x, from.x, to.x, p); + mixAxis(output.y, from.y, to.y, p); + } + function hasOpacityCrossfade(node) { + return (node.animationValues && node.animationValues.opacityExit !== undefined); + } + const defaultLayoutTransition = { + duration: 0.45, + ease: [0.4, 0, 0.1, 1], + }; + const userAgentContains = (string) => typeof navigator !== "undefined" && + navigator.userAgent && + navigator.userAgent.toLowerCase().includes(string); + /** + * Measured bounding boxes must be rounded in Safari and + * left untouched in Chrome, otherwise non-integer layouts within scaled-up elements + * can appear to jump. + */ + const roundPoint = userAgentContains("applewebkit/") && !userAgentContains("chrome/") + ? Math.round + : noop; + function roundAxis(axis) { + // Round to the nearest .5 pixels to support subpixel layouts + axis.min = roundPoint(axis.min); + axis.max = roundPoint(axis.max); + } + function roundBox(box) { + roundAxis(box.x); + roundAxis(box.y); + } + function shouldAnimatePositionOnly(animationType, snapshot, layout) { + return (animationType === "position" || + (animationType === "preserve-aspect" && + !isNear(aspectRatio(snapshot), aspectRatio(layout), 0.2))); + } + function checkNodeWasScrollRoot(node) { + return node !== node.root && node.scroll?.wasRoot; + } + + const DocumentProjectionNode = createProjectionNode({ + attachResizeListener: (ref, notify) => addDomEvent(ref, "resize", notify), + measureScroll: () => ({ + x: document.documentElement.scrollLeft || document.body?.scrollLeft || 0, + y: document.documentElement.scrollTop || document.body?.scrollTop || 0, + }), + checkIsScrollRoot: () => true, + }); + + const notify = (node) => !node.isLayoutDirty && node.willUpdate(false); + function nodeGroup() { + const nodes = new Set(); + const subscriptions = new WeakMap(); + const dirtyAll = () => nodes.forEach(notify); + return { + add: (node) => { + nodes.add(node); + subscriptions.set(node, node.addEventListener("willUpdate", dirtyAll)); + }, + remove: (node) => { + nodes.delete(node); + const unsubscribe = subscriptions.get(node); + if (unsubscribe) { + unsubscribe(); + subscriptions.delete(node); + } + dirtyAll(); + }, + dirty: dirtyAll, + }; + } + + const rootProjectionNode = { + current: undefined, + }; + const HTMLProjectionNode = createProjectionNode({ + measureScroll: (instance) => ({ + x: instance.scrollLeft, + y: instance.scrollTop, + }), + defaultParent: () => { + if (!rootProjectionNode.current) { + const documentNode = new DocumentProjectionNode({}); + documentNode.mount(window); + documentNode.setOptions({ layoutScroll: true }); + rootProjectionNode.current = documentNode; + } + return rootProjectionNode.current; + }, + resetTransform: (instance, value) => { + instance.style.transform = value !== undefined ? value : "none"; + }, + checkIsScrollRoot: (instance) => Boolean(window.getComputedStyle(instance).position === "fixed"), + }); + + const layoutSelector = "[data-layout],[data-layout-id]"; + /** + * All imperatively-created projection nodes live in one persistent tree, + * shared across animateLayout() calls (and with any React-created nodes, + * via the singleton document root). Keyed by element for reuse. + */ + const layoutNodes = new WeakMap(); + /** + * Builders created within the same synchronous tick are flushed together + * as a single "commit": every node is snapshotted before any updateDom + * runs, mirroring React batching renders from different parts of the tree. + */ + let pendingBuilders; + function collectLayoutElements(scope) { + const elements = []; + if (scope instanceof HTMLElement && scope.matches(layoutSelector)) { + elements.push(scope); + } + scope.querySelectorAll(layoutSelector).forEach((element) => { + if (element instanceof HTMLElement) + elements.push(element); + }); + return elements; + } + /** + * Process any work scheduled on the frameloop now. A previous animation + * may have been seeked while paused (controls.time = x) without a frame + * having rendered it - we must materialise that state into the DOM + * before taking snapshots. + */ + function flushPendingFrame() { + if (frameData.isProcessing) + return; + const now = time.now(); + frameData.delta = clamp(0, 1000 / 60, now - frameData.timestamp); + frameData.timestamp = now; + frameData.isProcessing = true; + frameSteps.update.process(frameData); + frameSteps.preRender.process(frameData); + frameSteps.render.process(frameData); + frameData.isProcessing = false; + } + function getProjectionParent(element) { + let ancestor = element.parentElement; + while (ancestor) { + const node = layoutNodes.get(ancestor); + if (node && node.instance) + return node; + ancestor = ancestor.parentElement; + } + return undefined; + } + function createVisualElement() { + return new HTMLVisualElement({ + props: {}, + presenceContext: null, + visualState: { + latestValues: {}, + renderState: { + transform: {}, + transformOrigin: {}, + style: {}, + vars: {}, + }, + }, + }, { allowProjection: true }); + } + function readNodeOptions(element, transition) { + const layoutAttr = element.getAttribute("data-layout"); + const layoutId = element.getAttribute("data-layout-id") ?? undefined; + return { + layoutId, + layout: layoutAttr !== null ? true : undefined, + animationType: (!layoutAttr || layoutAttr === "true" + ? "both" + : layoutAttr), + transition, + }; + } + function prepareNode(element, transition) { + let node = layoutNodes.get(element); + if (!node) { + let visualElement = visualElementStore.get(element); + if (!visualElement) + visualElement = createVisualElement(); + /** + * A first-time element may carry a projection transform in its + * inline style (e.g. it was cloned from an element mid-animation). + * That transform isn't tracked in latestValues so the engine can't + * reset it before measuring - clear it now so the first layout + * measurement isn't inflated. + */ + if (element.style.transform && + !hasTransform(visualElement.latestValues)) { + element.style.transform = ""; + } + node = new HTMLProjectionNode(visualElement.latestValues, getProjectionParent(element)); + visualElement.projection = node; + node.setOptions({ + ...readNodeOptions(element, transition), + visualElement, + }); + node.mount(element); + layoutNodes.set(element, node); + } + else { + node.setOptions(readNodeOptions(element, transition)); + } + node.isPresent = true; + if (node.options.onExitComplete) { + node.setOptions({ onExitComplete: undefined }); + } + return node; + } + function sortDocumentOrder(elements) { + return [...elements].sort((a, b) => a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1); + } + function dropNode(element, node) { + node.setOptions({ onExitComplete: undefined }); + /** + * Stop any lingering animation so it can't leak into future updates. + * A follow node can share its currentAnimation with a surviving lead + * (via resumingFrom), in which case it isn't ours to stop. + */ + const stack = node.getStack(); + if (!stack || node.isLead()) + node.currentAnimation?.stop(); + node.unmount(); + layoutNodes.delete(element); + } + function flushPendingBuilders() { + const builders = pendingBuilders; + pendingBuilders = undefined; + flushPendingFrame(); + /** + * Discover and mount every node across all builders before snapshotting + * any of them. Mounting during an active update flags isLayoutDirty, + * which would make that node's own willUpdate skip its snapshot. + * Document order guarantees ancestors mount before descendants, even + * when they're discovered by different builders. + */ + const targets = new Map(); + for (const builder of builders) { + for (const element of builder.collectTargets()) { + const owners = targets.get(element); + owners ? owners.push(builder) : targets.set(element, [builder]); + } + } + const union = new Map(); + for (const element of sortDocumentOrder(targets.keys())) { + const owners = targets.get(element); + const node = prepareNode(element, owners[owners.length - 1].transitionFor(element)); + for (const owner of owners) + owner.adopt(element, node); + union.set(element, node); + } + union.forEach((node) => { + node.isLayoutDirty = false; + node.willUpdate(); + }); + const updatePromises = []; + for (const builder of builders) { + const result = builder.runUpdate(); + if (result) + updatePromises.push(result); + } + const commit = () => { + /** + * Process all additions before any removals so that, even across + * builders, a removed member knows whether a replacement with the + * same layoutId was added in this commit. + */ + const newMemberIds = new Set(); + for (const builder of builders) { + builder.reconcileAdditions(newMemberIds); + } + for (const builder of builders) { + builder.reconcileRemovals(newMemberIds); + } + let root; + union.forEach((node) => (root || (root = node.root))); + for (const builder of builders) + root || (root = builder.getRoot()); + root?.didUpdate(); + /** + * The root flushes the update on a microtask, synchronously + * processing the frame that creates the layout animations. Collect + * them in a later microtask step of the same pass. + */ + microtask.render(() => { + for (const builder of builders) + builder.finalize(); + }); + }; + updatePromises.length ? Promise.all(updatePromises).then(commit) : commit(); + } + class LayoutAnimationBuilder { + constructor(scope, updateDom, defaultOptions) { + this.scope = scope; + this.updateDom = updateDom; + this.defaultOptions = defaultOptions; + this.sharedTransitions = new Map(); + this.notifyReady = () => { }; + this.rejectReady = () => { }; + this.tracked = new Map(); + this.restorePoints = new Map(); + this.readyPromise = new Promise((resolve, reject) => { + this.notifyReady = resolve; + this.rejectReady = reject; + }); + if (!pendingBuilders) { + pendingBuilders = []; + queueMicrotask(flushPendingBuilders); + } + pendingBuilders.push(this); + } + shared(id, transition) { + this.sharedTransitions.set(id, transition); + return this; + } + then(resolve, reject) { + return this.readyPromise.then(resolve, reject); + } + transitionFor(element) { + const layoutId = element.getAttribute("data-layout-id"); + return ((layoutId && this.sharedTransitions.get(layoutId)) || + this.defaultOptions); + } + adopt(element, node) { + this.tracked.set(element, node); + this.restorePoints.set(element, { + parent: element.parentElement, + next: element.nextSibling, + }); + } + collectTargets() { + return collectLayoutElements(this.scope); + } + runUpdate() { + try { + const result = this.updateDom(); + if (result && typeof result.then === "function") { + return result.then(undefined, (error) => { + this.updateError = error; + }); + } + } + catch (error) { + this.updateError = error; + } + return undefined; + } + reconcileAdditions(newMemberIds) { + for (const element of collectLayoutElements(this.scope)) { + if (this.tracked.has(element)) + continue; + const node = prepareNode(element, this.transitionFor(element)); + this.adopt(element, node); + node.options.layoutId && newMemberIds.add(node.options.layoutId); + } + } + reconcileRemovals(newMemberIds) { + this.tracked.forEach((node, element) => { + if (element.isConnected) + return; + const restore = this.restorePoints.get(element); + this.restorePoints.delete(element); + const { layoutId } = node.options; + const stack = node.getStack(); + const hasSurvivor = stack && + stack.members.some((member) => member !== node && + member.instance + ?.isConnected); + /** + * A removed lead with a surviving stack member - and no + * replacement member added this commit - runs an exit + * crossfade: restore the element to its old position in the + * DOM, relegate it and let the survivor take over. It's + * removed again once the animation completes. + */ + if (layoutId && + node.isLead() && + hasSurvivor && + !newMemberIds.has(layoutId)) { + if (restore && restore.parent.isConnected) { + restore.parent.insertBefore(element, restore.next && restore.next.parentNode === restore.parent + ? restore.next + : null); + node.isPresent = false; + node.setOptions({ + onExitComplete: () => { + element.remove(); + dropNode(element, node); + }, + }); + if (node.relegate()) + return; + element.remove(); + } + } + dropNode(element, node); + this.tracked.delete(element); + }); + } + getRoot() { + let root; + this.tracked.forEach((node) => (root || (root = node.root))); + return root; + } + finalize() { + if (this.updateError) { + this.rejectReady(this.updateError); + return; + } + const animations = new Set(); + this.tracked.forEach((node) => { + if (node.instance && node.currentAnimation) { + animations.add(node.currentAnimation); + } + }); + this.notifyReady(new GroupAnimation([...animations])); + } + } + function parseAnimateLayoutArgs(scopeOrUpdateDom, updateDomOrOptions, options) { + if (typeof scopeOrUpdateDom === "function") { + return { + scope: document, + updateDom: scopeOrUpdateDom, + defaultOptions: updateDomOrOptions, + }; + } + const scope = scopeOrUpdateDom instanceof Document + ? scopeOrUpdateDom + : resolveElements(scopeOrUpdateDom)[0] ?? document; + return { + scope, + updateDom: updateDomOrOptions, + defaultOptions: options, + }; + } + + /** + * @deprecated + * + * Import as `frame` instead. + */ + const sync = frame; + /** + * @deprecated + * + * Use cancelFrame(callback) instead. + */ + const cancelSync = stepsOrder.reduce((acc, key) => { + acc[key] = (process) => cancelFrame(process); + return acc; + }, {}); + + function isDOMKeyframes(keyframes) { + return typeof keyframes === "object" && !Array.isArray(keyframes); + } + + function resolveSubjects(subject, keyframes, scope, selectorCache) { + if (subject == null) { + return []; + } + if (typeof subject === "string" && isDOMKeyframes(keyframes)) { + return resolveElements(subject, scope, selectorCache); + } + else if (subject instanceof NodeList) { + return Array.from(subject); + } + else if (Array.isArray(subject)) { + return subject.filter((s) => s != null); + } + else { + return [subject]; + } + } + + function calculateRepeatDuration(duration, repeat, repeatDelay) { + return duration * (repeat + 1) + repeatDelay * repeat; + } + + /** + * Given a absolute or relative time definition and current/prev time state of the sequence, + * calculate an absolute time for the next keyframes. + */ + function calcNextTime(current, next, prev, labels) { + if (typeof next === "number") { + return next; + } + else if (next.startsWith("-") || next.startsWith("+")) { + return Math.max(0, current + parseFloat(next)); + } + else if (next === "<") { + return prev; + } + else if (next.startsWith("<")) { + return Math.max(0, prev + parseFloat(next.slice(1))); + } + else { + return labels.get(next) ?? current; + } + } + + function eraseKeyframes(sequence, startTime, endTime) { + for (let i = 0; i < sequence.length; i++) { + const keyframe = sequence[i]; + if (keyframe.at > startTime && keyframe.at < endTime) { + removeItem(sequence, keyframe); + // If we remove this item we have to push the pointer back one + i--; + } + } + } + function addKeyframes(sequence, keyframes, easing, offset, startTime, endTime) { + /** + * Erase every existing value between currentTime and targetTime, + * this will essentially splice this timeline into any currently + * defined ones. + */ + eraseKeyframes(sequence, startTime, endTime); + for (let i = 0; i < keyframes.length; i++) { + sequence.push({ + value: keyframes[i], + at: mixNumber$1(startTime, endTime, offset[i]), + easing: getEasingForSegment(easing, i), + }); + } + } + + /** + * Take an array of times that represent repeated keyframes. For instance + * if we have original times of [0, 0.5, 1] then our repeated times will + * be [0, 0.5, 1, 1, 1.5, 2]. Loop over the times and scale them back + * down to a 0-1 scale. + * + * `repeatDelayUnits` is the repeatDelay expressed in units of a single + * iteration's duration, so the total span equals `(repeat + 1) + repeat * repeatDelayUnits`. + */ + function normalizeTimes(times, repeat, repeatDelayUnits = 0) { + const totalUnits = repeat + 1 + repeat * repeatDelayUnits; + for (let i = 0; i < times.length; i++) { + times[i] = times[i] / totalUnits; + } + } + + function compareByTime(a, b) { + if (a.at === b.at) { + if (a.value === null) + return 1; + if (b.value === null) + return -1; + return 0; + } + else { + return a.at - b.at; + } + } + + const defaultSegmentEasing = "easeInOut"; + const MAX_REPEAT = 20; + function createAnimationsFromSequence(sequence, { defaultTransition = {}, ...sequenceTransition } = {}, scope, generators) { + const defaultDuration = defaultTransition.duration || 0.3; + const animationDefinitions = new Map(); + const sequences = new Map(); + const elementCache = {}; + const timeLabels = new Map(); + let prevTime = 0; + let currentTime = 0; + let totalDuration = 0; + /** + * Build the timeline by mapping over the sequence array and converting + * the definitions into keyframes and offsets with absolute time values. + * These will later get converted into relative offsets in a second pass. + */ + for (let i = 0; i < sequence.length; i++) { + const segment = sequence[i]; + /** + * If this is a timeline label, mark it and skip the rest of this iteration. + */ + if (typeof segment === "string") { + timeLabels.set(segment, currentTime); + continue; + } + else if (!Array.isArray(segment)) { + timeLabels.set(segment.name, calcNextTime(currentTime, segment.at, prevTime, timeLabels)); + continue; + } + let [subject, keyframes, transition = {}] = segment; + /** + * If a relative or absolute time value has been specified we need to resolve + * it in relation to the currentTime. + */ + if (transition.at !== undefined) { + currentTime = calcNextTime(currentTime, transition.at, prevTime, timeLabels); + } + /** + * Keep track of the maximum duration in this definition. This will be + * applied to currentTime once the definition has been parsed. + */ + let maxDuration = 0; + const resolveValueSequence = (valueKeyframes, valueTransition, valueSequence, elementIndex = 0, numSubjects = 0) => { + const valueKeyframesAsList = keyframesAsList(valueKeyframes); + const { delay = 0, times = defaultOffset$1(valueKeyframesAsList), type = defaultTransition.type || "keyframes", repeat, repeatType, repeatDelay = 0, ...remainingTransition } = valueTransition; + let { ease = defaultTransition.ease || "easeOut", duration } = valueTransition; + /** + * Resolve stagger() if defined. + */ + const calculatedDelay = typeof delay === "function" + ? delay(elementIndex, numSubjects) + : delay; + /** + * If this animation should and can use a spring, generate a spring easing function. + */ + const numKeyframes = valueKeyframesAsList.length; + const createGenerator = isGenerator(type) + ? type + : generators?.[type || "keyframes"]; + if (numKeyframes <= 2 && createGenerator) { + /** + * As we're creating an easing function from a spring, + * ideally we want to generate it using the real distance + * between the two keyframes. However this isn't always + * possible - in these situations we use 0-100. + */ + let absoluteDelta = 100; + if (numKeyframes === 2 && + isNumberKeyframesArray(valueKeyframesAsList)) { + const delta = valueKeyframesAsList[1] - valueKeyframesAsList[0]; + absoluteDelta = Math.abs(delta); + } + const springTransition = { + ...defaultTransition, + ...remainingTransition, + }; + if (duration !== undefined) { + springTransition.duration = secondsToMilliseconds(duration); + } + const springEasing = createGeneratorEasing(springTransition, absoluteDelta, createGenerator); + ease = springEasing.ease; + duration = springEasing.duration; + } + duration ?? (duration = defaultDuration); + const startTime = currentTime + calculatedDelay; + /** + * If there's only one time offset of 0, fill in a second with length 1 + */ + if (times.length === 1 && times[0] === 0) { + times[1] = 1; + } + /** + * Fill out if offset if fewer offsets than keyframes + */ + const remainder = times.length - valueKeyframesAsList.length; + remainder > 0 && fillOffset(times, remainder); + /** + * If only one value has been set, ie [1], push a null to the start of + * the keyframe array. This will let us mark a keyframe at this point + * that will later be hydrated with the previous value. + */ + valueKeyframesAsList.length === 1 && + valueKeyframesAsList.unshift(null); + /** + * Segments can't express `repeat: Infinity` or very large + * counts — they'd leave dead time after the segment or + * explode the keyframe array. Ignore with a warning. + */ + if (repeat) { + exports.warning(repeat < MAX_REPEAT, `Sequence segments can't repeat ${repeat} times — ignoring repeat option. Use a value below ${MAX_REPEAT} or apply repeat at the sequence level instead.`); + } + if (repeat && repeat < MAX_REPEAT) { + /** + * Express repeatDelay in units of a single iteration's duration + * so it can be added to the per-iteration time offsets below + * before they're normalized to 0-1. + */ + const repeatDelayUnits = duration > 0 ? repeatDelay / duration : 0; + duration = calculateRepeatDuration(duration, repeat, repeatDelay); + const originalKeyframes = [...valueKeyframesAsList]; + const originalTimes = [...times]; + ease = Array.isArray(ease) ? [...ease] : [ease]; + const originalEase = [...ease]; + /** + * For reverse/mirror, alternate iterations play the segment + * backwards. mirror matches JSAnimation's mirroredGenerator: + * reversed keyframes, easings unchanged. reverse matches + * JSAnimation's iterationProgress = 1 - p: reversed + * keyframes, easing array reversed AND each function easing + * mapped through reverseEasing (string easings unchanged — + * they're resolved later by the keyframes engine). + */ + const isFlipping = repeatType === "reverse" || repeatType === "mirror"; + let flippedKeyframes = originalKeyframes; + let flippedEases = originalEase; + if (isFlipping) { + flippedKeyframes = [...originalKeyframes].reverse(); + if (repeatType === "reverse") { + flippedEases = [...originalEase] + .reverse() + .map((e) => typeof e === "function" + ? reverseEasing(e) + : e); + } + } + for (let repeatIndex = 0; repeatIndex < repeat; repeatIndex++) { + const isFlipped = isFlipping && repeatIndex % 2 === 0; + const iterKeyframes = isFlipped + ? flippedKeyframes + : originalKeyframes; + const iterEase = isFlipped ? flippedEases : originalEase; + const iterStartOffset = (repeatIndex + 1) * (1 + repeatDelayUnits); + /** + * If repeatDelay is set, hold the previous iteration's + * final value through the delay by inserting a keyframe + * at the moment the next iteration begins. + */ + if (repeatDelayUnits > 0) { + valueKeyframesAsList.push(valueKeyframesAsList[valueKeyframesAsList.length - 1]); + times.push(iterStartOffset); + ease.push("linear"); + } + valueKeyframesAsList.push(...iterKeyframes); + for (let keyframeIndex = 0; keyframeIndex < iterKeyframes.length; keyframeIndex++) { + times.push(originalTimes[keyframeIndex] + iterStartOffset); + ease.push(keyframeIndex === 0 + ? "linear" + : getEasingForSegment(iterEase, keyframeIndex - 1)); + } + } + normalizeTimes(times, repeat, repeatDelayUnits); + } + const targetTime = startTime + duration; + /** + * Add keyframes, mapping offsets to absolute time. + */ + addKeyframes(valueSequence, valueKeyframesAsList, ease, times, startTime, targetTime); + maxDuration = Math.max(calculatedDelay + duration, maxDuration); + totalDuration = Math.max(targetTime, totalDuration); + }; + if (isMotionValue(subject)) { + const subjectSequence = getSubjectSequence(subject, sequences); + resolveValueSequence(keyframes, transition, getValueSequence("default", subjectSequence)); + } + else { + const subjects = resolveSubjects(subject, keyframes, scope, elementCache); + const numSubjects = subjects.length; + /** + * For every element in this segment, process the defined values. + */ + for (let subjectIndex = 0; subjectIndex < numSubjects; subjectIndex++) { + /** + * Cast necessary, but we know these are of this type + */ + keyframes = keyframes; + transition = transition; + const thisSubject = subjects[subjectIndex]; + const subjectSequence = getSubjectSequence(thisSubject, sequences); + for (const key in keyframes) { + resolveValueSequence(keyframes[key], getValueTransition(transition, key), getValueSequence(key, subjectSequence), subjectIndex, numSubjects); + } + } + } + prevTime = currentTime; + currentTime += maxDuration; + } + /** + * For every element and value combination create a new animation. + */ + sequences.forEach((valueSequences, element) => { + for (const key in valueSequences) { + const valueSequence = valueSequences[key]; + /** + * Arrange all the keyframes in ascending time order. + */ + valueSequence.sort(compareByTime); + const keyframes = []; + const valueOffset = []; + const valueEasing = []; + /** + * For each keyframe, translate absolute times into + * relative offsets based on the total duration of the timeline. + */ + for (let i = 0; i < valueSequence.length; i++) { + const { at, value, easing } = valueSequence[i]; + keyframes.push(value); + valueOffset.push(progress(0, totalDuration, at)); + valueEasing.push(easing || "easeOut"); + } + /** + * If the first keyframe doesn't land on offset: 0 + * provide one by duplicating the initial keyframe. This ensures + * it snaps to the first keyframe when the animation starts. + */ + if (valueOffset[0] !== 0) { + valueOffset.unshift(0); + keyframes.unshift(keyframes[0]); + valueEasing.unshift(defaultSegmentEasing); + } + /** + * If the last keyframe doesn't land on offset: 1 + * provide one with a null wildcard value. This will ensure it + * stays static until the end of the animation. + */ + if (valueOffset[valueOffset.length - 1] !== 1) { + valueOffset.push(1); + keyframes.push(null); + } + if (!animationDefinitions.has(element)) { + animationDefinitions.set(element, { + keyframes: {}, + transition: {}, + }); + } + const definition = animationDefinitions.get(element); + definition.keyframes[key] = keyframes; + /** + * Exclude `type` from defaultTransition since springs have been + * converted to duration-based easing functions in resolveValueSequence. + * Including `type: "spring"` would cause JSAnimation to error when + * the merged keyframes array has more than 2 keyframes. + */ + const { type: _type, ...remainingDefaultTransition } = defaultTransition; + definition.transition[key] = { + ...remainingDefaultTransition, + duration: totalDuration, + ease: valueEasing, + times: valueOffset, + ...sequenceTransition, + }; + } + }); + return animationDefinitions; + } + function getSubjectSequence(subject, sequences) { + !sequences.has(subject) && sequences.set(subject, {}); + return sequences.get(subject); + } + function getValueSequence(name, sequences) { + if (!sequences[name]) + sequences[name] = []; + return sequences[name]; + } + function keyframesAsList(keyframes) { + return Array.isArray(keyframes) ? keyframes : [keyframes]; + } + function getValueTransition(transition, key) { + return transition && transition[key] + ? { + ...transition, + ...transition[key], + } + : { ...transition }; + } + const isNumber = (keyframe) => typeof keyframe === "number"; + const isNumberKeyframesArray = (keyframes) => keyframes.every(isNumber); + + function createDOMVisualElement(element) { + const options = { + presenceContext: null, + props: {}, + visualState: { + renderState: { + transform: {}, + transformOrigin: {}, + style: {}, + vars: {}, + attrs: {}, + }, + latestValues: {}, + }, + }; + const node = isSVGElement(element) && !isSVGSVGElement(element) + ? new SVGVisualElement(options) + : new HTMLVisualElement(options); + node.mount(element); + visualElementStore.set(element, node); + } + function createObjectVisualElement(subject) { + const options = { + presenceContext: null, + props: {}, + visualState: { + renderState: { + output: {}, + }, + latestValues: {}, + }, + }; + const node = new ObjectVisualElement(options); + node.mount(subject); + visualElementStore.set(subject, node); + } + + function isSingleValue(subject, keyframes) { + return (isMotionValue(subject) || + typeof subject === "number" || + (typeof subject === "string" && !isDOMKeyframes(keyframes))); + } + /** + * Implementation + */ + function animateSubject(subject, keyframes, options, scope) { + const animations = []; + if (isSingleValue(subject, keyframes)) { + animations.push(animateSingleValue(subject, isDOMKeyframes(keyframes) + ? keyframes.default || keyframes + : keyframes, options ? options.default || options : options)); + } + else { + // Gracefully handle null/undefined subjects (e.g., from querySelector returning null) + if (subject == null) { + return animations; + } + const subjects = resolveSubjects(subject, keyframes, scope); + const numSubjects = subjects.length; + exports.invariant(Boolean(numSubjects), "No valid elements provided.", "no-valid-elements"); + for (let i = 0; i < numSubjects; i++) { + const thisSubject = subjects[i]; + const createVisualElement = thisSubject instanceof Element + ? createDOMVisualElement + : createObjectVisualElement; + if (!visualElementStore.has(thisSubject)) { + createVisualElement(thisSubject); + } + const visualElement = visualElementStore.get(thisSubject); + const transition = { ...options }; + /** + * Resolve stagger function if provided. + */ + if ("delay" in transition && + typeof transition.delay === "function") { + transition.delay = transition.delay(i, numSubjects); + } + animations.push(...animateTarget(visualElement, { ...keyframes, transition }, {})); + } + } + return animations; + } + + function animateSequence(sequence, options, scope) { + const animations = []; + /** + * Pre-process: replace function segments with MotionValue segments, + * subscribe callbacks immediately + */ + const processedSequence = sequence.map((segment) => { + if (Array.isArray(segment) && typeof segment[0] === "function") { + const callback = segment[0]; + const mv = motionValue(0); + mv.on("change", callback); + if (segment.length === 1) { + return [mv, [0, 1]]; + } + else if (segment.length === 2) { + return [mv, [0, 1], segment[1]]; + } + else { + return [mv, segment[1], segment[2]]; + } + } + return segment; + }); + const animationDefinitions = createAnimationsFromSequence(processedSequence, options, scope, { spring }); + animationDefinitions.forEach(({ keyframes, transition }, subject) => { + animations.push(...animateSubject(subject, keyframes, transition)); + }); + return animations; + } + + function isSequence(value) { + return Array.isArray(value) && value.some(Array.isArray); + } + /** + * Creates an animation function that is optionally scoped + * to a specific element. + */ + function createScopedAnimate(options = {}) { + const { scope, reduceMotion, skipAnimations } = options; + /** + * Implementation + */ + function scopedAnimate(subjectOrSequence, optionsOrKeyframes, options) { + let animations = []; + let animationOnComplete; + const inherited = {}; + if (reduceMotion !== undefined) + inherited.reduceMotion = reduceMotion; + if (skipAnimations !== undefined) + inherited.skipAnimations = skipAnimations; + if (isSequence(subjectOrSequence)) { + const { onComplete, ...sequenceOptions } = optionsOrKeyframes || {}; + if (typeof onComplete === "function") { + animationOnComplete = onComplete; + } + animations = animateSequence(subjectOrSequence, { ...inherited, ...sequenceOptions }, scope); + } + else { + // Extract top-level onComplete so it doesn't get applied per-value + const { onComplete, ...rest } = options || {}; + if (typeof onComplete === "function") { + animationOnComplete = onComplete; + } + animations = animateSubject(subjectOrSequence, optionsOrKeyframes, { ...inherited, ...rest }, scope); + } + const animation = new GroupAnimationWithThen(animations); + if (animationOnComplete) { + animation.finished.then(animationOnComplete); + } + if (scope) { + scope.animations.push(animation); + animation.finished.then(() => { + removeItem(scope.animations, animation); + }); + } + return animation; + } + return scopedAnimate; + } + const animate = createScopedAnimate(); + + function animateElements(elementOrSelector, keyframes, options, scope) { + // Gracefully handle null/undefined elements (e.g., from querySelector returning null) + if (elementOrSelector == null) { + return []; + } + const elements = resolveElements(elementOrSelector, scope); + const numElements = elements.length; + exports.invariant(Boolean(numElements), "No valid elements provided.", "no-valid-elements"); + /** + * WAAPI doesn't support interrupting animations. + * + * Therefore, starting animations requires a three-step process: + * 1. Stop existing animations (write styles to DOM) + * 2. Resolve keyframes (read styles from DOM) + * 3. Create new animations (write styles to DOM) + * + * The hybrid `animate()` function uses AsyncAnimation to resolve + * keyframes before creating new animations, which removes style + * thrashing. Here, we have much stricter filesize constraints. + * Therefore we do this in a synchronous way that ensures that + * at least within `animate()` calls there is no style thrashing. + * + * In the motion-native-animate-mini-interrupt benchmark this + * was 80% faster than a single loop. + */ + const animationDefinitions = []; + /** + * Step 1: Build options and stop existing animations (write) + */ + for (let i = 0; i < numElements; i++) { + const element = elements[i]; + const elementTransition = { ...options }; + /** + * Resolve stagger function if provided. + */ + if (typeof elementTransition.delay === "function") { + elementTransition.delay = elementTransition.delay(i, numElements); + } + for (const valueName in keyframes) { + let valueKeyframes = keyframes[valueName]; + if (!Array.isArray(valueKeyframes)) { + valueKeyframes = [valueKeyframes]; + } + const valueOptions = { + ...getValueTransition$1(elementTransition, valueName), + }; + valueOptions.duration && (valueOptions.duration = secondsToMilliseconds(valueOptions.duration)); + valueOptions.delay && (valueOptions.delay = secondsToMilliseconds(valueOptions.delay)); + /** + * If there's an existing animation playing on this element then stop it + * before creating a new one. + */ + const map = getAnimationMap(element); + const key = animationMapKey(valueName, valueOptions.pseudoElement || ""); + const currentAnimation = map.get(key); + currentAnimation && currentAnimation.stop(); + animationDefinitions.push({ + map, + key, + unresolvedKeyframes: valueKeyframes, + options: { + ...valueOptions, + element, + name: valueName, + allowFlatten: !elementTransition.type && !elementTransition.ease, + }, + }); + } + } + /** + * Step 2: Resolve keyframes (read) + */ + for (let i = 0; i < animationDefinitions.length; i++) { + const { unresolvedKeyframes, options: animationOptions } = animationDefinitions[i]; + const { element, name, pseudoElement } = animationOptions; + if (!pseudoElement && unresolvedKeyframes[0] === null) { + unresolvedKeyframes[0] = getComputedStyle$2(element, name); + } + fillWildcards(unresolvedKeyframes); + applyPxDefaults(unresolvedKeyframes, name); + /** + * If we only have one keyframe, explicitly read the initial keyframe + * from the computed style. This is to ensure consistency with WAAPI behaviour + * for restarting animations, for instance .play() after finish, when it + * has one vs two keyframes. + */ + if (!pseudoElement && unresolvedKeyframes.length < 2) { + unresolvedKeyframes.unshift(getComputedStyle$2(element, name)); + } + animationOptions.keyframes = unresolvedKeyframes; + } + /** + * Step 3: Create new animations (write) + */ + const animations = []; + for (let i = 0; i < animationDefinitions.length; i++) { + const { map, key, options: animationOptions } = animationDefinitions[i]; + const animation = new NativeAnimation(animationOptions); + map.set(key, animation); + animation.finished.finally(() => map.delete(key)); + animations.push(animation); + } + return animations; + } + + const createScopedWaapiAnimate = (scope) => { + function scopedAnimate(elementOrSelector, keyframes, options) { + return new GroupAnimationWithThen(animateElements(elementOrSelector, keyframes, options, scope)); + } + return scopedAnimate; + }; + const animateMini = /*@__PURE__*/ createScopedWaapiAnimate(); + + function canUseNativeTimeline(target) { + if (typeof window === "undefined") + return false; + return target ? supportsViewTimeline() : supportsScrollTimeline(); + } + + /** + * A time in milliseconds, beyond which we consider the scroll velocity to be 0. + */ + const maxElapsed = 50; + const createAxisInfo = () => ({ + current: 0, + offset: [], + progress: 0, + scrollLength: 0, + targetOffset: 0, + targetLength: 0, + containerLength: 0, + velocity: 0, + }); + const createScrollInfo = () => ({ + time: 0, + x: createAxisInfo(), + y: createAxisInfo(), + }); + const keys = { + x: { + length: "Width", + position: "Left", + }, + y: { + length: "Height", + position: "Top", + }, + }; + function updateAxisInfo(element, axisName, info, time) { + const axis = info[axisName]; + const { length, position } = keys[axisName]; + const prev = axis.current; + const prevTime = info.time; + axis.current = Math.abs(element[`scroll${position}`]); + axis.scrollLength = element[`scroll${length}`] - element[`client${length}`]; + axis.offset.length = 0; + axis.offset[0] = 0; + axis.offset[1] = axis.scrollLength; + axis.progress = progress(0, axis.scrollLength, axis.current); + const elapsed = time - prevTime; + axis.velocity = + elapsed > maxElapsed + ? 0 + : velocityPerSecond(axis.current - prev, elapsed); + } + function updateScrollInfo(element, info, time) { + updateAxisInfo(element, "x", info, time); + updateAxisInfo(element, "y", info, time); + info.time = time; + } + + function calcInset(element, container) { + const inset = { x: 0, y: 0 }; + let current = element; + while (current && current !== container) { + if (isHTMLElement(current)) { + inset.x += current.offsetLeft; + inset.y += current.offsetTop; + current = current.offsetParent; + } + else if (current.tagName === "svg") { + /** + * This isn't an ideal approach to measuring the offset of tags. + * It would be preferable, given they behave like HTMLElements in most ways + * to use offsetLeft/Top. But these don't exist on . Likewise we + * can't use .getBBox() like most SVG elements as these provide the offset + * relative to the SVG itself, which for is usually 0x0. + */ + const svgBoundingBox = current.getBoundingClientRect(); + current = current.parentElement; + const parentBoundingBox = current.getBoundingClientRect(); + inset.x += svgBoundingBox.left - parentBoundingBox.left; + inset.y += svgBoundingBox.top - parentBoundingBox.top; + } + else if (current instanceof SVGGraphicsElement) { + const { x, y } = current.getBBox(); + inset.x += x; + inset.y += y; + let svg = null; + let parent = current.parentNode; + while (!svg) { + if (parent.tagName === "svg") { + svg = parent; + } + parent = current.parentNode; + } + current = svg; + } + else { + break; + } + } + return inset; + } + + const namedEdges = { + start: 0, + center: 0.5, + end: 1, + }; + function resolveEdge(edge, length, inset = 0) { + let delta = 0; + /** + * If we have this edge defined as a preset, replace the definition + * with the numerical value. + */ + if (edge in namedEdges) { + edge = namedEdges[edge]; + } + /** + * Handle unit values + */ + if (typeof edge === "string") { + const asNumber = parseFloat(edge); + if (edge.endsWith("px")) { + delta = asNumber; + } + else if (edge.endsWith("%")) { + edge = asNumber / 100; + } + else if (edge.endsWith("vw")) { + delta = (asNumber / 100) * document.documentElement.clientWidth; + } + else if (edge.endsWith("vh")) { + delta = (asNumber / 100) * document.documentElement.clientHeight; + } + else { + edge = asNumber; + } + } + /** + * If the edge is defined as a number, handle as a progress value. + */ + if (typeof edge === "number") { + delta = length * edge; + } + return inset + delta; + } + + const defaultOffset = [0, 0]; + function resolveOffset(offset, containerLength, targetLength, targetInset) { + let offsetDefinition = Array.isArray(offset) ? offset : defaultOffset; + let targetPoint = 0; + let containerPoint = 0; + if (typeof offset === "number") { + /** + * If we're provided offset: [0, 0.5, 1] then each number x should become + * [x, x], so we default to the behaviour of mapping 0 => 0 of both target + * and container etc. + */ + offsetDefinition = [offset, offset]; + } + else if (typeof offset === "string") { + offset = offset.trim(); + if (offset.includes(" ")) { + offsetDefinition = offset.split(" "); + } + else { + /** + * If we're provided a definition like "100px" then we want to apply + * that only to the top of the target point, leaving the container at 0. + * Whereas a named offset like "end" should be applied to both. + */ + offsetDefinition = [offset, namedEdges[offset] ? offset : `0`]; + } + } + targetPoint = resolveEdge(offsetDefinition[0], targetLength, targetInset); + containerPoint = resolveEdge(offsetDefinition[1], containerLength); + return targetPoint - containerPoint; + } + + const ScrollOffset = { + Enter: [ + [0, 1], + [1, 1], + ], + Exit: [ + [0, 0], + [1, 0], + ], + Any: [ + [1, 0], + [0, 1], + ], + All: [ + [0, 0], + [1, 1], + ], + }; + + const point = { x: 0, y: 0 }; + function getTargetSize(target) { + return "getBBox" in target && target.tagName !== "svg" + ? target.getBBox() + : { width: target.clientWidth, height: target.clientHeight }; + } + function resolveOffsets(container, info, options) { + const { offset: offsetDefinition = ScrollOffset.All } = options; + const { target = container, axis = "y" } = options; + const lengthLabel = axis === "y" ? "height" : "width"; + const inset = target !== container ? calcInset(target, container) : point; + /** + * Measure the target and container. If they're the same thing then we + * use the container's scrollWidth/Height as the target, from there + * all other calculations can remain the same. + */ + const targetSize = target === container + ? { width: container.scrollWidth, height: container.scrollHeight } + : getTargetSize(target); + const containerSize = { + width: container.clientWidth, + height: container.clientHeight, + }; + /** + * Reset the length of the resolved offset array rather than creating a new one. + * TODO: More reusable data structures for targetSize/containerSize would also be good. + */ + info[axis].offset.length = 0; + /** + * Populate the offset array by resolving the user's offset definition into + * a list of pixel scroll offets. + */ + let hasChanged = !info[axis].interpolate; + const numOffsets = offsetDefinition.length; + for (let i = 0; i < numOffsets; i++) { + const offset = resolveOffset(offsetDefinition[i], containerSize[lengthLabel], targetSize[lengthLabel], inset[axis]); + if (!hasChanged && offset !== info[axis].interpolatorOffsets[i]) { + hasChanged = true; + } + info[axis].offset[i] = offset; + } + /** + * If the pixel scroll offsets have changed, create a new interpolator function + * to map scroll value into a progress. + */ + if (hasChanged) { + info[axis].interpolate = interpolate(info[axis].offset, defaultOffset$1(offsetDefinition), { clamp: false }); + info[axis].interpolatorOffsets = [...info[axis].offset]; + } + info[axis].progress = clamp(0, 1, info[axis].interpolate(info[axis].current)); + } + + function measure(container, target = container, info) { + /** + * Find inset of target within scrollable container + */ + info.x.targetOffset = 0; + info.y.targetOffset = 0; + if (target !== container) { + let node = target; + while (node && node !== container) { + info.x.targetOffset += node.offsetLeft; + info.y.targetOffset += node.offsetTop; + node = node.offsetParent; + } + } + info.x.targetLength = + target === container ? target.scrollWidth : target.clientWidth; + info.y.targetLength = + target === container ? target.scrollHeight : target.clientHeight; + info.x.containerLength = container.clientWidth; + info.y.containerLength = container.clientHeight; + /** + * In development mode ensure scroll containers aren't position: static as this makes + * it difficult to measure their relative positions. The document scrolling element + * is exempt: offsetParent measurements naturally resolve relative to the document. + */ + { + if (container && + target && + target !== container && + container !== document.documentElement && + container !== document.scrollingElement && + container !== document.body) { + warnOnce(getComputedStyle(container).position !== "static", "Please ensure that the container has a non-static position, like 'relative', 'fixed', or 'absolute' to ensure scroll offset is calculated correctly."); + } + } + } + function createOnScrollHandler(element, onScroll, info, options = {}) { + return { + measure: (time) => { + measure(element, options.target, info); + updateScrollInfo(element, info, time); + if (options.offset || options.target) { + resolveOffsets(element, info, options); + } + }, + notify: () => onScroll(info), + }; + } + + const scrollListeners = new WeakMap(); + const resizeListeners = new WeakMap(); + const onScrollHandlers = new WeakMap(); + const scrollSize = new WeakMap(); + const dimensionCheckProcesses = new WeakMap(); + const getEventTarget = (element) => element === document.scrollingElement ? window : element; + function scrollInfo(onScroll, { container = document.scrollingElement, trackContentSize = false, ...options } = {}) { + if (!container) + return noop; + let containerHandlers = onScrollHandlers.get(container); + /** + * Get the onScroll handlers for this container. + * If one isn't found, create a new one. + */ + if (!containerHandlers) { + containerHandlers = new Set(); + onScrollHandlers.set(container, containerHandlers); + } + /** + * Create a new onScroll handler for the provided callback. + */ + const info = createScrollInfo(); + const containerHandler = createOnScrollHandler(container, onScroll, info, options); + containerHandlers.add(containerHandler); + /** + * Check if there's a scroll event listener for this container. + * If not, create one. + */ + if (!scrollListeners.has(container)) { + const measureAll = () => { + for (const handler of containerHandlers) { + handler.measure(frameData.timestamp); + } + frame.preUpdate(notifyAll); + }; + const notifyAll = () => { + for (const handler of containerHandlers) { + handler.notify(); + } + }; + const listener = () => frame.read(measureAll); + scrollListeners.set(container, listener); + const target = getEventTarget(container); + window.addEventListener("resize", listener); + if (container !== document.documentElement) { + resizeListeners.set(container, resize(container, listener)); + } + target.addEventListener("scroll", listener); + listener(); + } + /** + * Enable content size tracking if requested and not already enabled. + */ + if (trackContentSize && !dimensionCheckProcesses.has(container)) { + const listener = scrollListeners.get(container); + // Store initial scroll dimensions (object is reused to avoid allocation) + const size = { + width: container.scrollWidth, + height: container.scrollHeight, + }; + scrollSize.set(container, size); + // Add frame-based scroll dimension checking to detect content changes + const checkScrollDimensions = () => { + const newWidth = container.scrollWidth; + const newHeight = container.scrollHeight; + if (size.width !== newWidth || size.height !== newHeight) { + listener(); + size.width = newWidth; + size.height = newHeight; + } + }; + // Schedule with keepAlive=true to run every frame + const dimensionCheckProcess = frame.read(checkScrollDimensions, true); + dimensionCheckProcesses.set(container, dimensionCheckProcess); + } + const listener = scrollListeners.get(container); + frame.read(listener, false, true); + return () => { + cancelFrame(listener); + /** + * Check if we even have any handlers for this container. + */ + const currentHandlers = onScrollHandlers.get(container); + if (!currentHandlers) + return; + currentHandlers.delete(containerHandler); + if (currentHandlers.size) + return; + /** + * If no more handlers, remove the scroll listener too. + */ + const scrollListener = scrollListeners.get(container); + scrollListeners.delete(container); + if (scrollListener) { + getEventTarget(container).removeEventListener("scroll", scrollListener); + resizeListeners.get(container)?.(); + window.removeEventListener("resize", scrollListener); + } + // Clean up scroll dimension checking + const dimensionCheckProcess = dimensionCheckProcesses.get(container); + if (dimensionCheckProcess) { + cancelFrame(dimensionCheckProcess); + dimensionCheckProcesses.delete(container); + } + scrollSize.delete(container); + }; + } + + /** + * Maps from ProgressIntersection pairs used by Motion's preset offsets to + * ViewTimeline named ranges. Returns undefined for unrecognised patterns, + * which signals the caller to fall back to JS-based scroll tracking. + */ + const presets = [ + [ScrollOffset.Enter, "entry"], + [ScrollOffset.Exit, "exit"], + [ScrollOffset.Any, "cover"], + [ScrollOffset.All, "contain"], + ]; + const stringToProgress = { + start: 0, + end: 1, + }; + function parseStringOffset(s) { + const parts = s.trim().split(/\s+/); + if (parts.length !== 2) + return undefined; + const a = stringToProgress[parts[0]]; + const b = stringToProgress[parts[1]]; + if (a === undefined || b === undefined) + return undefined; + return [a, b]; + } + function normaliseOffset(offset) { + if (offset.length !== 2) + return undefined; + const result = []; + for (const item of offset) { + if (Array.isArray(item)) { + result.push(item); + } + else if (typeof item === "string") { + const parsed = parseStringOffset(item); + if (!parsed) + return undefined; + result.push(parsed); + } + else { + return undefined; + } + } + return result; + } + function matchesPreset(offset, preset) { + const normalised = normaliseOffset(offset); + if (!normalised) + return false; + for (let i = 0; i < 2; i++) { + const o = normalised[i]; + const p = preset[i]; + if (o[0] !== p[0] || o[1] !== p[1]) + return false; + } + return true; + } + function offsetToViewTimelineRange(offset) { + if (!offset) { + return { rangeStart: "contain 0%", rangeEnd: "contain 100%" }; + } + for (const [preset, name] of presets) { + if (matchesPreset(offset, preset)) { + return { rangeStart: `${name} 0%`, rangeEnd: `${name} 100%` }; + } + } + return undefined; + } + + const timelineCache = new Map(); + function scrollTimelineFallback(options) { + const currentTime = { value: 0 }; + const cancel = scrollInfo((info) => { + currentTime.value = info[options.axis].progress * 100; + }, options); + return { currentTime, cancel }; + } + function getTimeline({ source, container, ...options }) { + const { axis } = options; + if (source) + container = source; + let containerCache = timelineCache.get(container); + if (!containerCache) { + containerCache = new Map(); + timelineCache.set(container, containerCache); + } + const targetKey = options.target ?? "self"; + let targetCache = containerCache.get(targetKey); + if (!targetCache) { + targetCache = {}; + containerCache.set(targetKey, targetCache); + } + const axisKey = axis + (options.offset ?? []).join(","); + if (!targetCache[axisKey]) { + if (options.target && canUseNativeTimeline(options.target)) { + const range = offsetToViewTimelineRange(options.offset); + if (range) { + targetCache[axisKey] = new ViewTimeline({ + subject: options.target, + axis, + }); + } + else { + targetCache[axisKey] = scrollTimelineFallback({ + container, + ...options, + }); + } + } + else if (canUseNativeTimeline()) { + targetCache[axisKey] = new ScrollTimeline({ + source: container, + axis, + }); + } + else { + targetCache[axisKey] = scrollTimelineFallback({ + container, + ...options, + }); + } + } + return targetCache[axisKey]; + } + + function attachToAnimation(animation, options) { + const timeline = getTimeline(options); + const range = options.target + ? offsetToViewTimelineRange(options.offset) + : undefined; + /** + * Use native timeline when: + * - No target: ScrollTimeline (existing behaviour) + * - Target with mappable offset: ViewTimeline with named range + * - Target with unmappable offset: fall back to JS observe + */ + const useNative = options.target + ? canUseNativeTimeline(options.target) && !!range + : canUseNativeTimeline(); + return animation.attachTimeline({ + timeline: useNative ? timeline : undefined, + ...(range && + useNative && { + rangeStart: range.rangeStart, + rangeEnd: range.rangeEnd, + }), + observe: (valueAnimation) => { + valueAnimation.pause(); + return observeTimeline((progress) => { + valueAnimation.time = + valueAnimation.iterationDuration * progress; + }, timeline); + }, + }); + } + + /** + * Currently, we only support element tracking with `scrollInfo`, though in + * the future we can also offer ViewTimeline support. + */ + function isElementTracking(options) { + return options && (options.target || options.offset); + } + + /** + * If the onScroll function has two arguments, it's expecting + * more specific information about the scroll from scrollInfo. + */ + function isOnScrollWithInfo(onScroll) { + return onScroll.length === 2; + } + function attachToFunction(onScroll, options) { + if (isOnScrollWithInfo(onScroll) || isElementTracking(options)) { + return scrollInfo((info) => { + onScroll(info[options.axis].progress, info); + }, options); + } + else { + return observeTimeline(onScroll, getTimeline(options)); + } + } + + function scroll(onScroll, { axis = "y", container = document.scrollingElement, ...options } = {}) { + if (!container) + return noop; + const optionsWithDefaults = { axis, container, ...options }; + return typeof onScroll === "function" + ? attachToFunction(onScroll, optionsWithDefaults) + : attachToAnimation(onScroll, optionsWithDefaults); + } + + const thresholds = { + some: 0, + all: 1, + }; + function inView(elementOrSelector, onStart, { root, margin: rootMargin, amount = "some" } = {}) { + const elements = resolveElements(elementOrSelector); + const activeIntersections = new WeakMap(); + const onIntersectionChange = (entries) => { + entries.forEach((entry) => { + const onEnd = activeIntersections.get(entry.target); + /** + * If there's no change to the intersection, we don't need to + * do anything here. + */ + if (entry.isIntersecting === Boolean(onEnd)) + return; + if (entry.isIntersecting) { + const newOnEnd = onStart(entry.target, entry); + if (typeof newOnEnd === "function") { + activeIntersections.set(entry.target, newOnEnd); + } + else { + observer.unobserve(entry.target); + } + } + else if (typeof onEnd === "function") { + onEnd(entry); + activeIntersections.delete(entry.target); + } + }); + }; + const observer = new IntersectionObserver(onIntersectionChange, { + root, + rootMargin, + threshold: typeof amount === "number" ? amount : thresholds[amount], + }); + elements.forEach((element) => observer.observe(element)); + return () => observer.disconnect(); + } + + const distance = (a, b) => Math.abs(a - b); + function distance2D(a, b) { + // Multi-dimensional + const xDelta = distance(a.x, b.x); + const yDelta = distance(a.y, b.y); + return Math.sqrt(xDelta ** 2 + yDelta ** 2); + } + + exports.AsyncMotionValueAnimation = AsyncMotionValueAnimation; + exports.DOMKeyframesResolver = DOMKeyframesResolver; + exports.DOMVisualElement = DOMVisualElement; + exports.DocumentProjectionNode = DocumentProjectionNode; + exports.Feature = Feature; + exports.FlatTree = FlatTree; + exports.GroupAnimation = GroupAnimation; + exports.GroupAnimationWithThen = GroupAnimationWithThen; + exports.HTMLProjectionNode = HTMLProjectionNode; + exports.HTMLVisualElement = HTMLVisualElement; + exports.JSAnimation = JSAnimation; + exports.KeyframeResolver = KeyframeResolver; + exports.LayoutAnimationBuilder = LayoutAnimationBuilder; + exports.MotionGlobalConfig = MotionGlobalConfig; + exports.MotionValue = MotionValue; + exports.NativeAnimation = NativeAnimation; + exports.NativeAnimationExtended = NativeAnimationExtended; + exports.NativeAnimationWrapper = NativeAnimationWrapper; + exports.NodeStack = NodeStack; + exports.ObjectVisualElement = ObjectVisualElement; + exports.SVGVisualElement = SVGVisualElement; + exports.SubscriptionManager = SubscriptionManager; + exports.ViewTransitionBuilder = ViewTransitionBuilder; + exports.VisualElement = VisualElement; + exports.acceleratedValues = acceleratedValues; + exports.addAttrValue = addAttrValue; + exports.addDomEvent = addDomEvent; + exports.addScaleCorrector = addScaleCorrector; + exports.addStyleValue = addStyleValue; + exports.addUniqueItem = addUniqueItem; + exports.addValueToWillChange = addValueToWillChange; + exports.alpha = alpha; + exports.analyseComplexValue = analyseComplexValue; + exports.animate = animate; + exports.animateMini = animateMini; + exports.animateMotionValue = animateMotionValue; + exports.animateSingleValue = animateSingleValue; + exports.animateTarget = animateTarget; + exports.animateValue = animateValue; + exports.animateVariant = animateVariant; + exports.animateView = animateView; + exports.animateVisualElement = animateVisualElement; + exports.animationMapKey = animationMapKey; + exports.anticipate = anticipate; + exports.applyAxisDelta = applyAxisDelta; + exports.applyBoxDelta = applyBoxDelta; + exports.applyGeneratorOptions = applyGeneratorOptions; + exports.applyPointDelta = applyPointDelta; + exports.applyPxDefaults = applyPxDefaults; + exports.applyTreeDeltas = applyTreeDeltas; + exports.arc = arc; + exports.aspectRatio = aspectRatio; + exports.attachFollow = attachFollow; + exports.attachSpring = attachSpring; + exports.attrEffect = attrEffect; + exports.axisDeltaEquals = axisDeltaEquals; + exports.axisEquals = axisEquals; + exports.axisEqualsRounded = axisEqualsRounded; + exports.backIn = backIn; + exports.backInOut = backInOut; + exports.backOut = backOut; + exports.boxEquals = boxEquals; + exports.boxEqualsRounded = boxEqualsRounded; + exports.buildHTMLStyles = buildHTMLStyles; + exports.buildProjectionTransform = buildProjectionTransform; + exports.buildSVGAttrs = buildSVGAttrs; + exports.buildSVGPath = buildSVGPath; + exports.buildTransform = buildTransform; + exports.calcAxisDelta = calcAxisDelta; + exports.calcBoxDelta = calcBoxDelta; + exports.calcChildStagger = calcChildStagger; + exports.calcGeneratorDuration = calcGeneratorDuration; + exports.calcLength = calcLength; + exports.calcRelativeAxis = calcRelativeAxis; + exports.calcRelativeAxisPosition = calcRelativeAxisPosition; + exports.calcRelativeBox = calcRelativeBox; + exports.calcRelativePosition = calcRelativePosition; + exports.camelCaseAttributes = camelCaseAttributes; + exports.camelToDash = camelToDash; + exports.cancelFrame = cancelFrame; + exports.cancelMicrotask = cancelMicrotask; + exports.cancelSync = cancelSync; + exports.checkVariantsDidChange = checkVariantsDidChange; + exports.circIn = circIn; + exports.circInOut = circInOut; + exports.circOut = circOut; + exports.clamp = clamp; + exports.cleanDirtyNodes = cleanDirtyNodes; + exports.collectMotionValues = collectMotionValues; + exports.color = color; + exports.compareByDepth = compareByDepth; + exports.complex = complex; + exports.containsCSSVariable = containsCSSVariable; + exports.convertBoundingBoxToBox = convertBoundingBoxToBox; + exports.convertBoxToBoundingBox = convertBoxToBoundingBox; + exports.convertOffsetToTimes = convertOffsetToTimes; + exports.copyAxisDeltaInto = copyAxisDeltaInto; + exports.copyAxisInto = copyAxisInto; + exports.copyBoxInto = copyBoxInto; + exports.correctBorderRadius = correctBorderRadius; + exports.correctBoxShadow = correctBoxShadow; + exports.createAnimationState = createAnimationState; + exports.createAxis = createAxis; + exports.createAxisDelta = createAxisDelta; + exports.createBox = createBox; + exports.createDelta = createDelta; + exports.createGeneratorEasing = createGeneratorEasing; + exports.createProjectionNode = createProjectionNode; + exports.createRenderBatcher = createRenderBatcher; + exports.createScopedAnimate = createScopedAnimate; + exports.cubicBezier = cubicBezier; + exports.cubicBezierAsString = cubicBezierAsString; + exports.defaultEasing = defaultEasing; + exports.defaultOffset = defaultOffset$1; + exports.defaultTransformValue = defaultTransformValue; + exports.defaultValueTypes = defaultValueTypes; + exports.degrees = degrees; + exports.delay = delayInSeconds; + exports.delayInSeconds = delayInSeconds; + exports.dimensionValueTypes = dimensionValueTypes; + exports.distance = distance; + exports.distance2D = distance2D; + exports.eachAxis = eachAxis; + exports.easeIn = easeIn; + exports.easeInOut = easeInOut; + exports.easeOut = easeOut; + exports.easingDefinitionToFunction = easingDefinitionToFunction; + exports.fillOffset = fillOffset; + exports.fillWildcards = fillWildcards; + exports.findDimensionValueType = findDimensionValueType; + exports.findValueType = findValueType; + exports.flushKeyframeResolvers = flushKeyframeResolvers; + exports.followValue = followValue; + exports.frame = frame; + exports.frameData = frameData; + exports.frameSteps = frameSteps; + exports.generateLinearEasing = generateLinearEasing; + exports.getAnimatableNone = getAnimatableNone; + exports.getAnimationMap = getAnimationMap; + exports.getComputedStyle = getComputedStyle$2; + exports.getDefaultTransition = getDefaultTransition; + exports.getDefaultValueType = getDefaultValueType; + exports.getEasingForSegment = getEasingForSegment; + exports.getFeatureDefinitions = getFeatureDefinitions; + exports.getFinalKeyframe = getFinalKeyframe; + exports.getMixer = getMixer; + exports.getOptimisedAppearId = getOptimisedAppearId; + exports.getOriginIndex = getOriginIndex; + exports.getValueAsType = getValueAsType; + exports.getValueTransition = getValueTransition$1; + exports.getVariableValue = getVariableValue; + exports.getVariantContext = getVariantContext; + exports.getViewAnimationLayerInfo = getViewAnimationLayerInfo; + exports.getViewAnimations = getViewAnimations; + exports.globalProjectionState = globalProjectionState; + exports.has2DTranslate = has2DTranslate; + exports.hasReducedMotionListener = hasReducedMotionListener; + exports.hasScale = hasScale; + exports.hasTransform = hasTransform; + exports.hasWarned = hasWarned; + exports.hex = hex; + exports.hover = hover; + exports.hsla = hsla; + exports.hslaToRgba = hslaToRgba; + exports.inView = inView; + exports.inertia = inertia; + exports.initPrefersReducedMotion = initPrefersReducedMotion; + exports.interpolate = interpolate; + exports.invisibleValues = invisibleValues; + exports.isAnimationControls = isAnimationControls; + exports.isBezierDefinition = isBezierDefinition; + exports.isCSSVariableName = isCSSVariableName; + exports.isCSSVariableToken = isCSSVariableToken; + exports.isControllingVariants = isControllingVariants; + exports.isDeltaZero = isDeltaZero; + exports.isDragActive = isDragActive; + exports.isDragging = isDragging; + exports.isEasingArray = isEasingArray; + exports.isElementKeyboardAccessible = isElementKeyboardAccessible; + exports.isElementTextInput = isElementTextInput; + exports.isForcedMotionValue = isForcedMotionValue; + exports.isGenerator = isGenerator; + exports.isHTMLElement = isHTMLElement; + exports.isKeyframesTarget = isKeyframesTarget; + exports.isMotionValue = isMotionValue; + exports.isNear = isNear; + exports.isNodeOrChild = isNodeOrChild; + exports.isNumericalString = isNumericalString; + exports.isObject = isObject; + exports.isPrimaryPointer = isPrimaryPointer; + exports.isSVGElement = isSVGElement; + exports.isSVGSVGElement = isSVGSVGElement; + exports.isSVGTag = isSVGTag; + exports.isTransitionDefined = isTransitionDefined; + exports.isVariantLabel = isVariantLabel; + exports.isVariantNode = isVariantNode; + exports.isWaapiSupportedEasing = isWaapiSupportedEasing; + exports.isWillChangeMotionValue = isWillChangeMotionValue; + exports.isZeroValueString = isZeroValueString; + exports.keyframes = keyframes; + exports.makeAnimationInstant = makeAnimationInstant; + exports.mapEasingToNativeEasing = mapEasingToNativeEasing; + exports.mapValue = mapValue; + exports.maxGeneratorDuration = maxGeneratorDuration; + exports.measurePageBox = measurePageBox; + exports.measureViewportBox = measureViewportBox; + exports.memo = memo; + exports.microtask = microtask; + exports.millisecondsToSeconds = millisecondsToSeconds; + exports.mirrorEasing = mirrorEasing; + exports.mix = mix; + exports.mixArray = mixArray; + exports.mixColor = mixColor; + exports.mixComplex = mixComplex; + exports.mixImmediate = mixImmediate; + exports.mixLinearColor = mixLinearColor; + exports.mixNumber = mixNumber$1; + exports.mixObject = mixObject; + exports.mixValues = mixValues; + exports.mixVisibility = mixVisibility; + exports.motionValue = motionValue; + exports.moveItem = moveItem; + exports.nodeGroup = nodeGroup; + exports.noop = noop; + exports.number = number; + exports.numberValueTypes = numberValueTypes; + exports.observeTimeline = observeTimeline; + exports.optimizedAppearDataAttribute = optimizedAppearDataAttribute; + exports.optimizedAppearDataId = optimizedAppearDataId; + exports.parseAnimateLayoutArgs = parseAnimateLayoutArgs; + exports.parseCSSVariable = parseCSSVariable; + exports.parseValueFromTransform = parseValueFromTransform; + exports.percent = percent; + exports.pipe = pipe; + exports.pixelsToPercent = pixelsToPercent; + exports.positionalKeys = positionalKeys; + exports.prefersReducedMotion = prefersReducedMotion; + exports.press = press; + exports.progress = progress; + exports.progressPercentage = progressPercentage; + exports.propEffect = propEffect; + exports.propagateDirtyNodes = propagateDirtyNodes; + exports.px = px; + exports.readTransformValue = readTransformValue; + exports.recordStats = recordStats; + exports.removeAxisDelta = removeAxisDelta; + exports.removeAxisTransforms = removeAxisTransforms; + exports.removeBoxTransforms = removeBoxTransforms; + exports.removeItem = removeItem; + exports.removePointDelta = removePointDelta; + exports.renderHTML = renderHTML; + exports.renderSVG = renderSVG; + exports.resize = resize; + exports.resolveElements = resolveElements; + exports.resolveMotionValue = resolveMotionValue; + exports.resolveTransition = resolveTransition; + exports.resolveVariant = resolveVariant; + exports.resolveVariantFromProps = resolveVariantFromProps; + exports.reverseEasing = reverseEasing; + exports.rgbUnit = rgbUnit; + exports.rgba = rgba; + exports.rootProjectionNode = rootProjectionNode; + exports.scale = scale; + exports.scaleCorrectors = scaleCorrectors; + exports.scalePoint = scalePoint; + exports.scrapeHTMLMotionValuesFromProps = scrapeMotionValuesFromProps$1; + exports.scrapeSVGMotionValuesFromProps = scrapeMotionValuesFromProps; + exports.scroll = scroll; + exports.scrollInfo = scrollInfo; + exports.secondsToMilliseconds = secondsToMilliseconds; + exports.setDragLock = setDragLock; + exports.setFeatureDefinitions = setFeatureDefinitions; + exports.setStyle = setStyle; + exports.setTarget = setTarget; + exports.spring = spring; + exports.springValue = springValue; + exports.stagger = stagger; + exports.startWaapiAnimation = startWaapiAnimation; + exports.statsBuffer = statsBuffer; + exports.steps = steps; + exports.styleEffect = styleEffect; + exports.supportedWaapiEasing = supportedWaapiEasing; + exports.supportsBrowserAnimation = supportsBrowserAnimation; + exports.supportsFlags = supportsFlags; + exports.supportsLinearEasing = supportsLinearEasing; + exports.supportsPartialKeyframes = supportsPartialKeyframes; + exports.supportsScrollTimeline = supportsScrollTimeline; + exports.supportsViewTimeline = supportsViewTimeline; + exports.svgEffect = svgEffect; + exports.sync = sync; + exports.testValueType = testValueType; + exports.time = time; + exports.transform = transform; + exports.transformAxis = transformAxis; + exports.transformBox = transformBox; + exports.transformBoxPoints = transformBoxPoints; + exports.transformPropOrder = transformPropOrder; + exports.transformProps = transformProps; + exports.transformValue = transformValue; + exports.transformValueTypes = transformValueTypes; + exports.translateAxis = translateAxis; + exports.updateMotionValuesFromProps = updateMotionValuesFromProps; + exports.variantPriorityOrder = variantPriorityOrder; + exports.variantProps = variantProps; + exports.velocityPerSecond = velocityPerSecond; + exports.vh = vh; + exports.visualElementStore = visualElementStore; + exports.vw = vw; + exports.warnOnce = warnOnce; + exports.wrap = wrap; + +})); diff --git a/node_modules/motion/dist/motion.js b/node_modules/motion/dist/motion.js new file mode 100644 index 0000000..b31abc4 --- /dev/null +++ b/node_modules/motion/dist/motion.js @@ -0,0 +1 @@ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Motion={})}(this,function(t){"use strict";function e(t,e){-1===t.indexOf(e)&&t.push(e)}function n(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const i=(t,e,n)=>n>e?e:n{},t.invariant=()=>{},"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(t.warning=(t,e,n)=>{t||"undefined"==typeof console||console.warn(s(e,n))},t.invariant=(t,e,n)=>{if(!t)throw new Error(s(e,n))});const o={},r=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),a=t=>"object"==typeof t&&null!==t,l=t=>/^0[^.\s]+$/u.test(t);function c(t){let e;return()=>(void 0===e&&(e=t()),e)}const u=t=>t,h=(...t)=>t.reduce((t,e)=>n=>e(t(n))),d=(t,e,n)=>{const i=e-t;return i?(n-t)/i:1};class p{constructor(){this.subscriptions=[]}add(t){return e(this.subscriptions,t),()=>n(this.subscriptions,t)}notify(t,e,n){const i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](t,e,n);else for(let s=0;s1e3*t,f=t=>t/1e3,y=(t,e)=>e?t*(1e3/e):0,g=new Set;function v(t,e,n){t||g.has(e)||(console.warn(s(e,n)),g.add(e))}const x=(t,e,n)=>{const i=e-t;return((n-t)%i+i)%i+t},w=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function T(t,e,n,i){if(t===e&&n===i)return u;const s=e=>function(t,e,n,i,s){let o,r,a=0;do{r=e+(n-e)/2,o=w(r,i,s)-t,o>0?n=r:e=r}while(Math.abs(o)>1e-7&&++a<12);return r}(e,0,1,t,n);return t=>0===t||1===t?t:w(s(t),e,i)}const b=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,S=t=>e=>1-t(1-e),A=T(.33,1.53,.69,.99),V=S(A),P=b(V),M=t=>t>=1?1:(t*=2)<1?.5*V(t):.5*(2-Math.pow(2,-10*(t-1))),E=t=>1-Math.sin(Math.acos(t)),k=S(E),D=b(E),C=T(.42,0,1,1),B=T(0,0,.58,1),R=T(.42,0,.58,1);const L=t=>Array.isArray(t)&&"number"!=typeof t[0];function j(t,e){return L(t)?t[x(0,t.length,e)]:t}const O=t=>Array.isArray(t)&&"number"==typeof t[0],F={linear:u,easeIn:C,easeInOut:R,easeOut:B,circIn:E,circInOut:D,circOut:k,backIn:V,backInOut:P,backOut:A,anticipate:M},I=e=>{if(O(e)){t.invariant(4===e.length,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[n,i,s,o]=e;return T(n,i,s,o)}return"string"==typeof e?(t.invariant(void 0!==F[e],`Invalid easing type '${e}'`,"invalid-easing-type"),F[e]):e},$=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function N(t,e){let n=!1,i=!0;const s={delta:0,timestamp:0,isProcessing:!1},r=()=>n=!0,a=$.reduce((t,e)=>(t[e]=function(t){let e=new Set,n=new Set,i=!1,s=!1;const o=new WeakSet;let r={delta:0,timestamp:0,isProcessing:!1};function a(e){o.has(e)&&(l.schedule(e),t()),e(r)}const l={schedule:(t,s=!1,r=!1)=>{const a=r&&i?e:n;return s&&o.add(t),a.add(t),t},cancel:t=>{n.delete(t),o.delete(t)},process:t=>{if(r=t,i)return void(s=!0);i=!0;const o=e;e=n,n=o,e.forEach(a),e.clear(),i=!1,s&&(s=!1,l.process(t))}};return l}(r),t),{}),{setup:l,read:c,resolveKeyframes:u,preUpdate:h,update:d,preRender:p,render:m,postRender:f}=a,y=()=>{const r=o.useManualTiming,a=r?s.timestamp:performance.now();n=!1,r||(s.delta=i?1e3/60:Math.max(Math.min(a-s.timestamp,40),1)),s.timestamp=a,s.isProcessing=!0,l.process(s),c.process(s),u.process(s),h.process(s),d.process(s),p.process(s),m.process(s),f.process(s),s.isProcessing=!1,n&&e&&(i=!1,t(y))};return{schedule:$.reduce((e,o)=>{const r=a[o];return e[o]=(e,o=!1,a=!1)=>(n||(n=!0,i=!0,s.isProcessing||t(y)),r.schedule(e,o,a)),e},{}),cancel:t=>{for(let e=0;e<$.length;e++)a[$[e]].cancel(t)},state:s,steps:a}}const{schedule:W,cancel:U,state:z,steps:K}=N("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:u,!0);let Y;function X(){Y=void 0}const G={now:()=>(void 0===Y&&G.set(z.isProcessing||o.useManualTiming?z.timestamp:performance.now()),Y),set:t=>{Y=t,queueMicrotask(X)}},H=t=>e=>"string"==typeof e&&e.startsWith(t),q=H("--"),Z=H("var(--"),_=t=>!!Z(t)&&J.test(t.split("/*")[0].trim()),J=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Q(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const tt={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},et={...tt,transform:t=>i(0,1,t)},nt={...tt,default:1},it=t=>Math.round(1e5*t)/1e5,st=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const ot=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,rt=(t,e)=>n=>Boolean("string"==typeof n&&ot.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),at=(t,e,n)=>i=>{if("string"!=typeof i)return i;const[s,o,r,a]=i.match(st);return{[t]:parseFloat(s),[e]:parseFloat(o),[n]:parseFloat(r),alpha:void 0!==a?parseFloat(a):1}},lt={...tt,transform:t=>Math.round((t=>i(0,255,t))(t))},ct={test:rt("rgb","red"),parse:at("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+lt.transform(t)+", "+lt.transform(e)+", "+lt.transform(n)+", "+it(et.transform(i))+")"};const ut={test:rt("#"),parse:function(t){let e="",n="",i="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),i=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),i=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,i+=i,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:s?parseInt(s,16)/255:1}},transform:ct.transform},ht=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),dt=ht("deg"),pt=ht("%"),mt=ht("px"),ft=ht("vh"),yt=ht("vw"),gt=(()=>({...pt,parse:t=>pt.parse(t)/100,transform:t=>pt.transform(100*t)}))(),vt={test:rt("hsl","hue"),parse:at("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+pt.transform(it(e))+", "+pt.transform(it(n))+", "+it(et.transform(i))+")"},xt={test:t=>ct.test(t)||ut.test(t)||vt.test(t),parse:t=>ct.test(t)?ct.parse(t):vt.test(t)?vt.parse(t):ut.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?ct.transform(t):vt.transform(t),getAnimatableNone:t=>{const e=xt.parse(t);return e.alpha=0,xt.transform(e)}},wt=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const Tt="number",bt="color",St=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function At(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},s=[];let o=0;const r=e.replace(St,t=>(xt.test(t)?(i.color.push(o),s.push(bt),n.push(xt.parse(t))):t.startsWith("var(")?(i.var.push(o),s.push("var"),n.push(t)):(i.number.push(o),s.push(Tt),n.push(parseFloat(t))),++o,"${}")).split("${}");return{values:n,split:r,indexes:i,types:s}}function Vt({split:t,types:e}){const n=t.length;return i=>{let s="";for(let o=0;o{return"number"==typeof t?e?.trim().endsWith("/")?t:0:"number"==typeof(n=t)?0:xt.test(n)?xt.getAnimatableNone(n):n;var n};const Mt={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(st)?.length||0)+(t.match(wt)?.length||0)>0},parse:function(t){return At(t).values},createTransformer:function(t){return Vt(At(t))},getAnimatableNone:function(t){const e=At(t);return Vt(e)(e.values.map((t,n)=>Pt(t,e.split[n])))}};function Et(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function kt({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let s=0,o=0,r=0;if(e/=100){const i=n<.5?n*(1+e):n+e-n*e,a=2*n-i;s=Et(a,i,t+1/3),o=Et(a,i,t),r=Et(a,i,t-1/3)}else s=o=r=n;return{red:Math.round(255*s),green:Math.round(255*o),blue:Math.round(255*r),alpha:i}}function Dt(t,e){return n=>n>0?e:t}const Ct=(t,e,n)=>t+(e-t)*n,Bt=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},Rt=[ut,ct,vt];function Lt(e){const n=(i=e,Rt.find(t=>t.test(i)));var i;if(t.warning(Boolean(n),`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!Boolean(n))return!1;let s=n.parse(e);return n===vt&&(s=kt(s)),s}const jt=(t,e)=>{const n=Lt(t),i=Lt(e);if(!n||!i)return Dt(t,e);const s={...n};return t=>(s.red=Bt(n.red,i.red,t),s.green=Bt(n.green,i.green,t),s.blue=Bt(n.blue,i.blue,t),s.alpha=Ct(n.alpha,i.alpha,t),ct.transform(s))},Ot=new Set(["none","hidden"]);function Ft(t,e){return Ot.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function It(t,e){return n=>Ct(t,e,n)}function $t(t){return"number"==typeof t?It:"string"==typeof t?_(t)?Dt:xt.test(t)?jt:Ut:Array.isArray(t)?Nt:"object"==typeof t?xt.test(t)?jt:Wt:Dt}function Nt(t,e){const n=[...t],i=n.length,s=t.map((t,n)=>$t(t)(t,e[n]));return t=>{for(let e=0;e{for(const e in i)n[e]=i[e](t);return n}}const Ut=(e,n)=>{const i=Mt.createTransformer(n),s=At(e),o=At(n);return s.indexes.var.length===o.indexes.var.length&&s.indexes.color.length===o.indexes.color.length&&s.indexes.number.length>=o.indexes.number.length?Ot.has(e)&&!o.values.length||Ot.has(n)&&!s.values.length?Ft(e,n):h(Nt(function(t,e){const n=[],i={color:0,var:0,number:0};for(let s=0;s{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>W.update(e,t),stop:()=>U(e),now:()=>z.isProcessing?z.timestamp:G.now()}},Yt=(t,e,n=10)=>{let i="";const s=Math.max(Math.round(e/n),2);for(let e=0;e=Xt?1/0:e}function Ht(t,e=100,n){const i=n({...t,keyframes:[0,e]}),s=Math.min(Gt(i),Xt);return{type:"keyframes",ease:t=>i.next(s*t).value/e,duration:f(s)}}const qt=100,Zt=10,_t=1,Jt=0,Qt=800,te=.3,ee=.3,ne={granular:.01,default:2},ie={granular:.005,default:.5},se=.01,oe=10,re=.05,ae=1;function le(t,e){return t*Math.sqrt(1-e*e)}const ce=.001;const ue=["duration","bounce"],he=["stiffness","damping","mass"];function de(t,e){return e.some(e=>void 0!==t[e])}function pe(e){let n={velocity:Jt,stiffness:qt,damping:Zt,mass:_t,isResolvedFromDuration:!1,...e};if(!de(e,he)&&de(e,ue))if(n.velocity=0,e.visualDuration){const t=e.visualDuration,s=2*Math.PI/(1.2*t),o=s*s,r=2*i(.05,1,1-(e.bounce||0))*Math.sqrt(o);n={...n,mass:_t,stiffness:o,damping:r}}else{const s=function({duration:e=Qt,bounce:n=te,velocity:s=Jt,mass:o=_t}){let r,a;t.warning(e<=m(oe),"Spring duration must be 10 seconds or less","spring-duration-limit");let l=1-n;l=i(re,ae,l),e=i(se,oe,f(e)),l<1?(r=t=>{const n=t*l,i=n*e,o=n-s,r=le(t,l),a=Math.exp(-i);return ce-o/r*a},a=t=>{const n=t*l*e,i=n*s+s,o=Math.pow(l,2)*Math.pow(t,2)*e,a=Math.exp(-n),c=le(Math.pow(t,2),l);return(-r(t)+ce>0?-1:1)*((i-o)*a)/c}):(r=t=>Math.exp(-t*e)*((t-s)*e+1)-.001,a=t=>Math.exp(-t*e)*(e*e*(s-t)));const c=function(t,e,n){let i=n;for(let n=1;n<12;n++)i-=t(i)/e(i);return i}(r,a,5/e);if(e=m(e),isNaN(c))return{stiffness:qt,damping:Zt,duration:e};{const t=Math.pow(c,2)*o;return{stiffness:t,damping:2*l*Math.sqrt(o*t),duration:e}}}({...e,velocity:0});n={...n,...s,mass:_t},n.isResolvedFromDuration=!0}return n}function me(t=ee,e=te){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:i,restDelta:s}=n;const o=n.keyframes[0],r=n.keyframes[n.keyframes.length-1],a={done:!1,value:o},{stiffness:l,damping:c,mass:u,duration:h,velocity:d,isResolvedFromDuration:p}=pe({...n,velocity:-f(n.velocity||0)}),y=d||0,g=c/(2*Math.sqrt(l*u)),v=r-o,x=f(Math.sqrt(l/u)),w=Math.abs(v)<5;let T,b,S,A,V,P;if(i||(i=w?ne.granular:ne.default),s||(s=w?ie.granular:ie.default),g<1)S=le(x,g),A=(y+g*x*v)/S,T=t=>{const e=Math.exp(-g*x*t);return r-e*(A*Math.sin(S*t)+v*Math.cos(S*t))},V=g*x*A+v*S,P=g*x*v-A*S,b=t=>Math.exp(-g*x*t)*(V*Math.sin(S*t)+P*Math.cos(S*t));else if(1===g){T=t=>r-Math.exp(-x*t)*(v+(y+x*v)*t);const t=y+x*v;b=e=>Math.exp(-x*e)*(x*t*e-y)}else{const t=x*Math.sqrt(g*g-1);T=e=>{const n=Math.exp(-g*x*e),i=Math.min(t*e,300);return r-n*((y+g*x*v)*Math.sinh(i)+t*v*Math.cosh(i))/t};const e=(y+g*x*v)/t,n=g*x*e-v*t,i=g*x*v-e*t;b=e=>{const s=Math.exp(-g*x*e),o=Math.min(t*e,300);return s*(n*Math.sinh(o)+i*Math.cosh(o))}}const M={calculatedDuration:p&&h||null,velocity:t=>m(b(t)),next:t=>{if(!p&&g<1){const e=Math.exp(-g*x*t),n=Math.sin(S*t),o=Math.cos(S*t),l=r-e*(A*n+v*o),c=m(e*(V*n+P*o));return a.done=Math.abs(c)<=i&&Math.abs(r-l)<=s,a.value=a.done?r:l,a}const e=T(t);if(p)a.done=t>=h;else{const n=m(b(t));a.done=Math.abs(n)<=i&&Math.abs(r-e)<=s}return a.value=a.done?r:e,a},toString:()=>{const t=Math.min(Gt(M),Xt),e=Yt(e=>M.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return M}me.applyToOptions=t=>{const e=Ht(t,100,me);return t.ease=e.ease,t.duration=m(e.duration),t.type="keyframes",t};function fe(t,e,n){const i=Math.max(e-5,0);return y(n-t(i),e-i)}function ye({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:l,restDelta:c=.5,restSpeed:u}){const h=t[0],d={done:!1,value:h},p=t=>void 0===a?l:void 0===l||Math.abs(a-t)-m*Math.exp(-t/i),v=t=>y+g(t),x=t=>{const e=g(t),n=v(t);d.done=Math.abs(e)<=c,d.value=d.done?y:n};let w,T;const b=t=>{var e;(e=d.value,void 0!==a&&el)&&(w=t,T=me({keyframes:[d.value,p(d.value)],velocity:fe(v,t,d.value),damping:s,stiffness:o,restDelta:c,restSpeed:u}))};return b(0),{calculatedDuration:null,next:t=>{let e=!1;return T||void 0!==w||(e=!0,x(t),b(t)),void 0!==w&&t>=w?T.next(t-w):(!e&&x(t),d)}}}function ge(e,n,{clamp:s=!0,ease:r,mixer:a}={}){const l=e.length;if(t.invariant(l===n.length,"Both input and output ranges must be the same length","range-length"),1===l)return()=>n[0];if(2===l&&n[0]===n[1])return()=>n[1];const c=e[0]===e[1];e[0]>e[l-1]&&(e=[...e].reverse(),n=[...n].reverse());const p=function(t,e,n){const i=[],s=n||o.mix||zt,r=t.length-1;for(let n=0;n{if(c&&t1)for(;if(i(e[0],e[l-1],t)):f}function ve(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const s=d(0,e,i);t.push(Ct(n,1,s))}}function xe(t){const e=[0];return ve(e,t.length-1),e}function we(t,e){return t.map(t=>t*e)}function Te(t,e){return t.map(()=>e||R).splice(0,t.length-1)}function be({duration:t=300,keyframes:e,times:n,ease:i="easeInOut"}){const s=L(i)?i.map(I):I(i),o={done:!1,value:e[0]},r=ge(we(n&&n.length===e.length?n:xe(e),t),e,{ease:Array.isArray(s)?s:Te(e,s)});return{calculatedDuration:t,next:e=>(o.value=r(e),o.done=e>=t,o)}}const Se=t=>null!==t;function Ae(t,{repeat:e,repeatType:n="loop"},i,s=1){const o=t.filter(Se),r=s<0||e&&"loop"!==n&&e%2==1?0:o.length-1;return r&&void 0!==i?i:o[r]}const Ve={decay:ye,inertia:ye,tween:be,keyframes:be,spring:me};function Pe(t){"string"==typeof t.type&&(t.type=Ve[t.type])}class Me{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const Ee=t=>t/100;class ke extends Me{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:t}=this.options;t&&t.updatedAt!==G.now()&&this.tick(G.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;Pe(t);const{type:e=be,repeat:n=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=t;let{keyframes:r}=t;const a=e||be;a!==be&&"number"!=typeof r[0]&&(this.mixKeyframes=h(Ee,zt(r[0],r[1])),r=[0,100]);const l=a({...t,keyframes:r});"mirror"===s&&(this.mirroredGenerator=a({...t,keyframes:[...r].reverse(),velocity:-o})),null===l.calculatedDuration&&(l.calculatedDuration=Gt(l));const{calculatedDuration:c}=l;this.calculatedDuration=c,this.resolvedDuration=c+i,this.totalDuration=this.resolvedDuration*(n+1)-i,this.generator=l}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,e=!1){const{generator:n,totalDuration:s,mixKeyframes:o,mirroredGenerator:r,resolvedDuration:a,calculatedDuration:l}=this;if(null===this.startTime)return n.next(0);const{delay:c=0,keyframes:u,repeat:h,repeatType:d,repeatDelay:p,type:m,onUpdate:f,finalKeyframe:y}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?g<0:g>s;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=s);let x,w=this.currentTime,T=n;if(h){const t=Math.min(this.currentTime,s)/a;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,h+1);Boolean(e%2)&&("reverse"===d?(n=1-n,p&&(n-=p/a)):"mirror"===d&&(T=r)),w=i(0,1,n)*a}v?(this.delayState.value=u[0],x=this.delayState):x=T.next(w),o&&!v&&(x.value=o(x.value));let{done:b}=x;v||null===l||(b=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const S=null===this.holdTime&&("finished"===this.state||"running"===this.state&&b);return S&&m!==ye&&(x.value=Ae(u,this.options,y,this.speed)),f&&f(x.value),S&&this.finish(),x}then(t,e){return this.finished.then(t,e)}get duration(){return f(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+f(t)}get time(){return f(this.currentTime)}set time(t){t=m(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);return fe(t=>this.generator.next(t).value,t,this.generator.next(t).value)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;e&&this.driver&&this.updateTime(G.now()),this.playbackSpeed=t,e&&this.driver&&(this.time=f(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=Kt,startTime:e}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),this.options.onPlay?.();const n=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=n):null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime||(this.startTime=e??n),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(G.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function De(t){for(let e=1;e180*t/Math.PI,Be=t=>{const e=Ce(Math.atan2(t[1],t[0]));return Le(e)},Re={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Be,rotateZ:Be,skewX:t=>Ce(Math.atan(t[1])),skewY:t=>Ce(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Le=t=>((t%=360)<0&&(t+=360),t),je=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Oe=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Fe={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:je,scaleY:Oe,scale:t=>(je(t)+Oe(t))/2,rotateX:t=>Le(Ce(Math.atan2(t[6],t[5]))),rotateY:t=>Le(Ce(Math.atan2(-t[2],t[0]))),rotateZ:Be,rotate:Be,skewX:t=>Ce(Math.atan(t[4])),skewY:t=>Ce(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Ie(t){return t.includes("scale")?1:0}function $e(t,e){if(!t||"none"===t)return Ie(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,s;if(n)i=Fe,s=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=Re,s=e}if(!s)return Ie(e);const o=i[e],r=s[1].split(",").map(We);return"function"==typeof o?o(r):r[o]}const Ne=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return $e(n,e)};function We(t){return parseFloat(t.trim())}const Ue=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ze=(()=>new Set([...Ue,"pathRotation"]))(),Ke=t=>t===tt||t===mt,Ye=new Set(["x","y","z"]),Xe=Ue.filter(t=>!Ye.has(t));const Ge={width:({x:t},{paddingLeft:e="0",paddingRight:n="0",boxSizing:i})=>{const s=t.max-t.min;return"border-box"===i?s:s-parseFloat(e)-parseFloat(n)},height:({y:t},{paddingTop:e="0",paddingBottom:n="0",boxSizing:i})=>{const s=t.max-t.min;return"border-box"===i?s:s-parseFloat(e)-parseFloat(n)},top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>$e(e,"x"),y:(t,{transform:e})=>$e(e,"y")};Ge.translateX=Ge.x,Ge.translateY=Ge.y;const He=new Set;let qe=!1,Ze=!1,_e=!1;function Je(){if(Ze){const t=Array.from(He).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),n=new Map;e.forEach(t=>{const e=function(t){const e=[];return Xe.forEach(n=>{const i=t.getValue(n);void 0!==i&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),e}(t);e.length&&(n.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=n.get(t);e&&e.forEach(([e,n])=>{t.getValue(e)?.set(n)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}Ze=!1,qe=!1,He.forEach(t=>t.complete(_e)),He.clear()}function Qe(){He.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Ze=!0)})}function tn(){_e=!0,Qe(),Je(),_e=!1}class en{constructor(t,e,n,i,s,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(He.add(this),qe||(qe=!0,W.read(Qe),W.resolveKeyframes(Je))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:i}=this;if(null===t[0]){const s=i?.get(),o=t[t.length-1];if(void 0!==s)t[0]=s;else if(n&&e){const i=n.readValue(e,o);null!=i&&(t[0]=i)}void 0===t[0]&&(t[0]=o),i&&void 0===s&&i.set(t[0])}De(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),He.delete(this)}cancel(){"scheduled"===this.state&&(He.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}const nn=t=>t.startsWith("--");function sn(t,e,n){nn(e)?t.style.setProperty(e,n):t.style[e]=n}const on={};function rn(t,e){const n=c(t);return()=>on[e]??n()}const an=rn(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),ln=rn(()=>void 0!==window.ViewTimeline,"viewTimeline"),cn=rn(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),un=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,hn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:un([0,.65,.55,1]),circOut:un([.55,0,1,.45]),backIn:un([.31,.01,.66,-.59]),backOut:un([.33,1.53,.69,.99])};function dn(t,e){return t?"function"==typeof t?cn()?Yt(t,e):"ease-out":O(t)?un(t):Array.isArray(t)?t.map(t=>dn(t,e)||hn.easeOut):hn[t]:void 0}function pn(t,e,n,{delay:i=0,duration:s=300,repeat:o=0,repeatType:r="loop",ease:a="easeOut",times:l}={},c=void 0){const u={[e]:n};l&&(u.offset=l);const h=dn(a,s);Array.isArray(h)&&(u.easing=h);const d={delay:i,duration:s,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:o+1,direction:"reverse"===r?"alternate":"normal"};return c&&(d.pseudoElement=c),t.animate(u,d)}function mn(t){return"function"==typeof t&&"applyToOptions"in t}function fn({type:t,...e}){return mn(t)&&cn()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class yn extends Me{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:i,keyframes:s,pseudoElement:o,allowFlatten:r=!1,finalKeyframe:a,onComplete:l}=e;this.isPseudoElement=Boolean(o),this.allowFlatten=r,this.options=e,t.invariant("string"!=typeof e.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const c=fn(e);this.animation=pn(n,i,s,c,o),!1===c.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const t=Ae(s,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(t),sn(n,i,t),this.animation.cancel()}l?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return f(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+f(t)}get time(){return f(Number(this.animation.currentTime)||0)}set time(t){const e=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=m(t),e&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:e,rangeEnd:n,observe:i}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&an()?(this.animation.timeline=t,e&&(this.animation.rangeStart=e),n&&(this.animation.rangeEnd=n),u):i(this)}}const gn={anticipate:M,backInOut:P,circInOut:D};function vn(t){"string"==typeof t.ease&&t.ease in gn&&(t.ease=gn[t.ease])}class xn extends yn{constructor(t){vn(t),Pe(t),super(t),void 0!==t.startTime&&!1!==t.autoplay&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:e,onUpdate:n,onComplete:s,element:o,...r}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);const a=new ke({...r,autoplay:!1}),l=Math.max(10,G.now()-this.startTime),c=i(0,10,l-10),u=a.sample(l).value,{name:h}=this.options;o&&h&&sn(o,h,u),e.setWithVelocity(a.sample(Math.max(0,l-c)).value,u,c),a.stop()}}const wn=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Mt.test(t)&&"0"!==t||t.startsWith("url(")));function Tn(t){t.duration=0,t.type="keyframes"}const bn=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),Sn=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;const An=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),Vn=c(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Pn(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:s,damping:o,type:r,keyframes:a}=t,l=e?.owner?.current;if(!(l instanceof HTMLElement||l instanceof SVGElement))return!1;const{onUpdate:c,transformTemplate:u}=e.owner.getProps();return Vn()&&n&&(bn.has(n)||An.has(n)&&function(t){for(let e=0;e{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=G.now();const h={autoplay:t,delay:e,type:n,repeat:i,repeatDelay:s,repeatType:o,name:a,motionValue:l,element:c,...u},d=c?.KeyframeResolver||en;this.keyframeResolver=new d(r,(t,e,n)=>this.onKeyframesResolved(t,e,h,!n),a,l,c),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,n,i,s){this.keyframeResolver=void 0;const{name:r,type:a,velocity:l,delay:c,isHandoff:h,onUpdate:d}=i;this.resolvedAt=G.now();let p=!0;(function(e,n,i,s){const o=e[0];if(null===o)return!1;if("display"===n||"visibility"===n)return!0;const r=e[e.length-1],a=wn(o,n),l=wn(r,n);return t.warning(a===l,`You are trying to animate ${n} from "${o}" to "${r}". "${a?r:o}" is not an animatable value.`,"value-not-animatable"),!(!a||!l)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:n,...i,keyframes:e},f=p&&!h&&Pn(m),y=m.motionValue?.owner?.current;let g;if(f)try{g=new xn({...m,element:y})}catch{g=new ke(m)}else g=new ke(m);g.finished.then(()=>{this.notifyFinished()}).catch(u),this.pendingTimeline&&(this.stopTimeline=g.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=g}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),tn()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}class En{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;ne.attachTimeline(t));return()=>{e.forEach((t,e)=>{t&&t(),this.animations[e].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return kn(this.animations,"duration")}get iterationDuration(){return kn(this.animations,"iterationDuration")}runAll(t){this.animations.forEach(e=>e[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function kn(t,e){let n=0;for(let i=0;in&&(n=s)}return n}class Dn extends En{then(t,e){return this.finished.finally(t).then(()=>{})}}class Cn extends yn{constructor(t){super(),this.animation=t,t.onfinish=()=>{this.finishedTime=this.time,this.notifyFinished()}}}const Bn=new WeakMap,Rn=(t,e="")=>`${t}:${e}`;function Ln(t){let e=Bn.get(t);return e||(e=new Map,Bn.set(t,e)),e}function jn(t,e,n,i=0,s=1){const o=Array.from(t).sort((t,e)=>t.sortNodePosition(e)).indexOf(e),r=t.size,a=(r-1)*i;return"function"==typeof n?n(o,r):1===s?o*i:a-o*i}const On={current:void 0};class Fn{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=G.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=G.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new p);const n=this.events[t].add(e);return"change"===t?()=>{n(),W.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return On.current&&On.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=G.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return y(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function In(t,e){return new Fn(t,e)}function $n(t,e){if(t?.inherit&&e){const{inherit:n,...i}=t;return{...e,...i}}return t}function Nn(t,e){const n=t?.[e]??t?.default??t;return n!==t?$n(n,t):n}const Wn={type:"spring",stiffness:500,damping:25,restSpeed:10},Un={type:"keyframes",duration:.8},zn={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Kn=(t,{keyframes:e})=>e.length>2?Un:ze.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:Wn:zn,Yn=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function Xn(t){for(const e in t)if(!Yn.has(e))return!0;return!1}const Gn=(t,e,n,i={},s,r)=>a=>{const l=Nn(i,t)||{},c=l.delay||i.delay||0;let{elapsed:u=0}=i;u-=m(c);const h={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...l,delay:-u,onUpdate:t=>{e.set(t),l.onUpdate&&l.onUpdate(t)},onComplete:()=>{a(),l.onComplete&&l.onComplete()},name:t,motionValue:e,element:r?void 0:s};Xn(l)||Object.assign(h,Kn(t,h)),h.duration&&(h.duration=m(h.duration)),h.repeatDelay&&(h.repeatDelay=m(h.repeatDelay)),void 0!==h.from&&(h.keyframes[0]=h.from);let d=!1;if((!1===h.type||0===h.duration&&!h.repeatDelay)&&(Tn(h),0===h.delay&&(d=!0)),(o.instantAnimations||o.skipAnimations||s?.shouldSkipAnimations||l.skipAnimations)&&(d=!0,Tn(h),h.delay=0),h.allowFlatten=!l.type&&!l.ease,d&&!r&&void 0!==e.get()){const t=Ae(h.keyframes,l);if(void 0!==t)return void W.update(()=>{h.onUpdate(t),h.onComplete()})}return l.isSync?new ke(h):new Mn(h)};function Hn(t,e,n,i){const s=1-t;return s*s*e+2*s*t*n+t*t*i}function qn(t,e,n,i,s,o,r){const a=2*(1-t)*(n-e)+2*t*(i-n),l=2*(1-t)*(o-s)+2*t*(r-o);return Math.atan2(l,a)*(180/Math.PI)}function Zn(t,e,n,i,s,o){const r=n-t,a=i-e,l=Math.sqrt(r*r+a*a);if(l>0){const n=s*l;return{x:t+r*o+-a/l*n,y:e+a*o+r/l*n}}return{x:t,y:e}}const _n=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Jn(t){const e=_n.exec(t);if(!e)return[,];const[,n,i,s]=e;return[`--${n??i}`,s]}function Qn(e,n,i=1){t.invariant(i<=4,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[s,o]=Jn(e);if(!s)return;const a=window.getComputedStyle(n).getPropertyValue(s);if(a){const t=a.trim();return r(t)?parseFloat(t):t}return _(o)?Qn(o,n,i+1):o}function ti(t){const e=[{},{}];return t?.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}function ei(t,e,n,i){if("function"==typeof e){const[s,o]=ti(i);e=e(void 0!==n?n:t.custom,s,o)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[s,o]=ti(i);e=e(void 0!==n?n:t.custom,s,o)}return e}function ni(t,e,n){const i=t.getProps();return ei(i,e,void 0!==n?n:i.custom,t)}const ii=new Set(["width","height","top","left","right","bottom",...Ue]),si=t=>Array.isArray(t);function oi(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,In(n))}function ri(t){return si(t)?t[t.length-1]||0:t}function ai(t,e){const n=ni(t,e);let{transitionEnd:i={},transition:s={},...o}=n||{};o={...o,...i};for(const e in o){oi(t,e,ri(o[e]))}}const li=t=>Boolean(t&&t.getVelocity);function ci(t){return Boolean(li(t)&&t.add)}function ui(t,e){const n=t.getValue("willChange");if(ci(n))return n.add(e);if(!n&&o.WillChange){const n=new o.WillChange("auto");t.addValue("willChange",n),n.add(e)}}function hi(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const di="framerAppearId",pi="data-"+hi(di);function mi(t){return t.props[pi]}function fi({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}function yi(t,e,{delay:n=0,transitionOverride:i,type:s}={}){let{transition:o,transitionEnd:r,...a}=e;const l=t.getDefaultTransition();o=o?$n(o,l):l;const c=o?.reduceMotion,u=o?.skipAnimations;i&&(o=i);const h=[],d=s&&t.animationState&&t.animationState.getState()[s],p=o?.path;p&&p.animateVisualElement(t,a,o,n,h);for(const e in a){const i=t.getValue(e,t.latestValues[e]??null),s=a[e];if(void 0===s||d&&fi(d,e))continue;const r={delay:n,...Nn(o||{},e)};u&&(r.skipAnimations=!0);const l=i.get();if(void 0!==l&&!i.isAnimating()&&!Array.isArray(s)&&s===l&&!r.velocity){W.update(()=>i.set(s));continue}let p=!1;if(window.MotionHandoffAnimation){const n=mi(t);if(n){const t=window.MotionHandoffAnimation(n,e,W);null!==t&&(r.startTime=t,p=!0)}}ui(t,e);const m=c??t.shouldReduceMotion;i.start(Gn(e,i,s,m&&ii.has(e)?{type:!1}:r,t,p));const f=i.animation;f&&h.push(f)}if(r){const e=()=>W.update(()=>{r&&ai(t,r)});h.length?Promise.all(h).then(e):e()}return h}function gi(t,e,n={}){const i=ni(t,e,"exit"===n.type?t.presenceContext?.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const o=i?()=>Promise.all(yi(t,i,n)):()=>Promise.resolve(),r=t.variantChildren&&t.variantChildren.size?(i=0)=>{const{delayChildren:o=0,staggerChildren:r,staggerDirection:a}=s;return function(t,e,n=0,i=0,s=0,o=1,r){const a=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),a.push(gi(l,e,{...r,delay:n+("function"==typeof i?0:i)+jn(t.variantChildren,l,i,s,o)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(a)}(t,e,i,o,r,a,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[t,e]="beforeChildren"===a?[o,r]:[r,o];return t().then(()=>e())}return Promise.all([o(),r(n.delay)])}function vi(t,e,n={}){let i;if(t.notify("AnimationStart",e),Array.isArray(e)){const s=e.map(e=>gi(t,e,n));i=Promise.all(s)}else if("string"==typeof e)i=gi(t,e,n);else{const s="function"==typeof e?ni(t,e,n.custom):e;i=Promise.all(yi(t,s,n))}return i.then(()=>{t.notify("AnimationComplete",e)})}const xi=t=>e=>e.test(t),wi=[tt,mt,pt,dt,yt,ft,{test:t=>"auto"===t,parse:t=>t}],Ti=t=>wi.find(xi(t));function bi(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||l(t))}const Si=new Set(["brightness","contrast","saturate","opacity"]);function Ai(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(st)||[];if(!i)return t;const s=n.replace(i,"");let o=Si.has(e)?1:0;return i!==n&&(o*=100),e+"("+o+s+")"}const Vi=/\b([a-z-]*)\(.*?\)/gu,Pi={...Mt,getAnimatableNone:t=>{const e=t.match(Vi);return e?e.map(Ai).join(" "):t}},Mi={...Mt,getAnimatableNone:t=>{const e=Mt.parse(t);return Mt.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},Ei={...tt,transform:Math.round},ki={rotate:dt,pathRotation:dt,rotateX:dt,rotateY:dt,rotateZ:dt,scale:nt,scaleX:nt,scaleY:nt,scaleZ:nt,skew:dt,skewX:dt,skewY:dt,distance:mt,translateX:mt,translateY:mt,translateZ:mt,x:mt,y:mt,z:mt,perspective:mt,transformPerspective:mt,opacity:et,originX:gt,originY:gt,originZ:mt},Di={borderWidth:mt,borderTopWidth:mt,borderRightWidth:mt,borderBottomWidth:mt,borderLeftWidth:mt,borderRadius:mt,borderTopLeftRadius:mt,borderTopRightRadius:mt,borderBottomRightRadius:mt,borderBottomLeftRadius:mt,width:mt,maxWidth:mt,height:mt,maxHeight:mt,top:mt,right:mt,bottom:mt,left:mt,inset:mt,insetBlock:mt,insetBlockStart:mt,insetBlockEnd:mt,insetInline:mt,insetInlineStart:mt,insetInlineEnd:mt,padding:mt,paddingTop:mt,paddingRight:mt,paddingBottom:mt,paddingLeft:mt,paddingBlock:mt,paddingBlockStart:mt,paddingBlockEnd:mt,paddingInline:mt,paddingInlineStart:mt,paddingInlineEnd:mt,margin:mt,marginTop:mt,marginRight:mt,marginBottom:mt,marginLeft:mt,marginBlock:mt,marginBlockStart:mt,marginBlockEnd:mt,marginInline:mt,marginInlineStart:mt,marginInlineEnd:mt,fontSize:mt,backgroundPositionX:mt,backgroundPositionY:mt,...ki,zIndex:Ei,fillOpacity:et,strokeOpacity:et,numOctaves:Ei},Ci={...Di,color:xt,backgroundColor:xt,outlineColor:xt,fill:xt,stroke:xt,borderColor:xt,borderTopColor:xt,borderRightColor:xt,borderBottomColor:xt,borderLeftColor:xt,filter:Pi,WebkitFilter:Pi,mask:Mi,WebkitMask:Mi},Bi=t=>Ci[t],Ri=new Set([Pi,Mi]);function Li(t,e){let n=Bi(t);return Ri.has(n)||(n=Mt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const ji=new Set(["auto","none","0"]);class Oi extends en{constructor(t,e,n,i,s){super(t,e,n,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n{t.getValue(e).set(n)}),this.resolveNoneKeyframes()}}const Fi=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"],Ii=new Set(["borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius",...Fi,"width","maxWidth","height","maxHeight","top","right","bottom","left","inset","insetBlock","insetBlockStart","insetBlockEnd","insetInline","insetInlineStart","insetInlineEnd","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingBlock","paddingBlockStart","paddingBlockEnd","paddingInline","paddingInlineStart","paddingInlineEnd","margin","marginTop","marginRight","marginBottom","marginLeft","marginBlock","marginBlockStart","marginBlockEnd","marginInline","marginInlineStart","marginInlineEnd","fontSize","backgroundPositionX","backgroundPositionY"]);function $i(t,e){for(let n=0;n{try{document.createElement("div").animate({opacity:[1]})}catch(t){return!1}return!0});function Wi(t,e,n){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){let i=document;e&&(i=e.current);const s=n?.[t]??i.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t).filter(t=>null!=t)}function Ui(t){return(e,n)=>{const i=Wi(e),s=[];for(const e of i){const i=t(e,n);s.push(i)}return()=>{for(const t of s)t()}}}const zi=(t,e)=>e&&"number"==typeof t?e.transform(t):t;class Ki{constructor(){this.latest={},this.values=new Map}set(t,e,n,i,s=!0){const o=this.values.get(t);o&&o.onRemove();const r=()=>{const i=e.get();this.latest[t]=s?zi(i,Di[t]):i,n&&W.render(n)};r();const a=e.on("change",r);i&&e.addDependent(i);const l=()=>{a(),n&&U(n),this.values.delete(t),i&&e.removeDependent(i)};return this.values.set(t,{value:e,onRemove:l}),l}get(t){return this.values.get(t)?.value}}function Yi(t){const e=new WeakMap;return(n,i)=>{const s=e.get(n)??new Ki;e.set(n,s);const o=[];for(const e in i){const r=i[e],a=t(n,s,e,r);o.push(a)}return()=>{for(const t of o)t()}}}const Xi=(t,e,n,i)=>{const s=function(t,e){if(!(e in t))return!1;const n=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(t),e)||Object.getOwnPropertyDescriptor(t,e);return n&&"function"==typeof n.set}(t,n),o=s?n:n.startsWith("data")||n.startsWith("aria")?hi(n):n,r=s?()=>{t[o]=e.latest[n]}:()=>{const i=e.latest[n];null==i?t.removeAttribute(o):t.setAttribute(o,String(i))};return e.set(n,i,r)},Gi=Ui(Yi(Xi)),Hi=Yi((t,e,n,i)=>e.set(n,i,()=>{t[n]=e.latest[n]},void 0,!1));function qi(t){return a(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const Zi={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"};const _i=new Set(["originX","originY","originZ"]),Ji=(t,e,n,i)=>{let s,o;return ze.has(n)?(e.get("transform")||(qi(t)||e.get("transformBox")||Ji(t,e,"transformBox",new Fn("fill-box")),e.set("transform",new Fn("none"),()=>{t.style.transform=function(t){let e="",n=!0;for(let i=0;i{const n=e.latest.originX??"50%",i=e.latest.originY??"50%",s=e.latest.originZ??0;t.style.transformOrigin=`${n} ${i} ${s}`}),o=e.get("transformOrigin")):s=nn(n)?()=>{t.style.setProperty(n,e.latest[n])}:()=>{t.style[n]=e.latest[n]},e.set(n,i,s,o)},Qi=Ui(Yi(Ji));const ts=Ui(Yi((t,e,n,i)=>{if(n.startsWith("path"))return function(t,e,n,i){return W.render(()=>t.setAttribute("pathLength","1")),"pathOffset"===n?e.set(n,i,()=>{const i=e.latest[n];t.setAttribute("stroke-dashoffset",""+-i)}):(e.get("stroke-dasharray")||e.set("stroke-dasharray",new Fn("1 1"),()=>{const{pathLength:n=1,pathSpacing:i}=e.latest;t.setAttribute("stroke-dasharray",`${n} ${i??1-Number(n)}`)}),e.set(n,i,void 0,e.get("stroke-dasharray")))}(t,e,n,i);if(n.startsWith("attr"))return Xi(t,e,function(t){return t.replace(/^attr([A-Z])/,(t,e)=>e.toLowerCase())}(n),i);return(n in t.style?Ji:Xi)(t,e,n,i)}));const{schedule:es,cancel:ns}=N(queueMicrotask,!1),is={x:!1,y:!1};function ss(){return is.x||is.y}function os(t,e){const n=Wi(t),i=new AbortController;return[n,{passive:!0,...e,signal:i.signal},()=>i.abort()]}const rs=(t,e)=>!!e&&(t===e||rs(t,e.parentElement)),as=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,ls=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function cs(t){return ls.has(t.tagName)||!0===t.isContentEditable}const us=new Set(["INPUT","SELECT","TEXTAREA"]);const hs=new WeakSet;function ds(t){return e=>{"Enter"===e.key&&t(e)}}function ps(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function ms(t){return as(t)&&!ss()}const fs=new WeakSet;function ys(t,e){const n=window.getComputedStyle(t);return nn(e)?n.getPropertyValue(e):n[e]}function gs(t){return a(t)&&"ownerSVGElement"in t}const vs=new WeakMap;let xs;const ws=(t,e,n)=>(i,s)=>s&&s[0]?s[0][t+"Size"]:gs(i)&&"getBBox"in i?i.getBBox()[e]:i[n],Ts=ws("inline","width","offsetWidth"),bs=ws("block","height","offsetHeight");function Ss({target:t,borderBoxSize:e}){vs.get(t)?.forEach(n=>{n(t,{get width(){return Ts(t,e)},get height(){return bs(t,e)}})})}function As(t){t.forEach(Ss)}function Vs(t,e){xs||"undefined"!=typeof ResizeObserver&&(xs=new ResizeObserver(As));const n=Wi(t);return n.forEach(t=>{let n=vs.get(t);n||(n=new Set,vs.set(t,n)),n.add(e),xs?.observe(t)}),()=>{n.forEach(t=>{const n=vs.get(t);n?.delete(e),n?.size||xs?.unobserve(t)})}}const Ps=new Set;let Ms;function Es(t){return Ps.add(t),Ms||(Ms=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};Ps.forEach(e=>e(t))},window.addEventListener("resize",Ms)),()=>{Ps.delete(t),Ps.size||"function"!=typeof Ms||(window.removeEventListener("resize",Ms),Ms=void 0)}}function ks(t,e){return"function"==typeof t?Es(t):Vs(t,e)}function Ds(t,e){let n;const i=()=>{const{currentTime:i}=e,s=(null===i?0:i.value)/100;n!==s&&t(s),n=s};return W.preUpdate(i,!0),()=>U(i)}const Cs={value:null,addProjectionMetrics:null};function Bs(t){return gs(t)&&"svg"===t.tagName}function Rs(t,e){if("first"===t)return 0;{const n=e-1;return"last"===t?n:n/2}}function Ls(...t){const e=!Array.isArray(t[0]),n=e?0:-1,i=t[0+n],s=ge(t[1+n],t[2+n],t[3+n]);return e?s(i):s}function js(t,e){const n=In(li(t)?t.get():t);return Os(n,t,e),n}function Os(t,e,n={}){const i=t.get();let s,o=null,r=i;const a="string"==typeof i?i.replace(/[\d.-]/g,""):void 0,l=()=>{o&&(o.stop(),o=null),t.animation=void 0},c=()=>{(()=>{const e=Is(t.get()),i=Is(r);if(e===i)return void l();const a=o?o.getGeneratorVelocity():t.getVelocity();l(),o=new ke({keyframes:[e,i],velocity:a,type:"spring",restDelta:.001,restSpeed:.01,...n,onUpdate:s})})(),t.animation=o??void 0,t.events.animationStart?.notify(),o?.then(()=>{t.animation=void 0,t.events.animationComplete?.notify()})};if(t.attach((t,e)=>{r=t,s=t=>e(Fs(t,a)),W.postRender(c)},l),li(e)){let i=!0===n.skipInitialAnimation;const s=e.on("change",e=>{i?(i=!1,t.jump(Fs(e,a),!1)):t.set(Fs(e,a))}),o=t.on("destroy",s);return()=>{s(),o()}}return l}function Fs(t,e){return e?t+e:t}function Is(t){return"number"==typeof t?t:parseFloat(t)}function $s(t){const e=[];On.current=e;const n=t();On.current=void 0;const i=In(n);return function(t,e,n){const i=()=>e.set(n()),s=()=>W.preRender(i,!1,!0),o=t.map(t=>t.on("change",s));e.on("destroy",()=>{o.forEach(t=>t()),U(i)})}(e,i,t),i}const Ns=[...wi,xt,Mt],Ws=t=>Ns.find(xi(t));let Us=0;const zs=()=>"motion-view-"+Us++;function Ks(t,e,n){e&&(t.style?.setProperty("view-transition-class",e),n.push(t))}function Ys(t,e,n,i,s){if(n&&(t.style?.setProperty("view-transition-group",n),i.push(t),"none"!==n&&s)){const n=getComputedStyle(t);"visible"===n.overflowX&&"visible"===n.overflowY||s.add(e)}}function Xs(t,e,n,i,s,o=[],r,a=[],l){const c=Wi(t);if(i)return c.map((t,c)=>{const u=e.get(t);if(u)return u;const h=i[c]??zs();return t.style?.setProperty("view-transition-name",h),n.push(t),e.set(t,h),Ks(t,s,o),Ys(t,h,r,a,l),h});const u=c.map(t=>e.has(t)?void 0:getComputedStyle(t).getPropertyValue("view-transition-name"));return c.map((t,i)=>{const c=e.get(t);if(c)return c;const h=u[i];let d;return h&&"none"!==h&&"auto"!==h&&"match-element"!==h&&!(t=>t.startsWith("motion-view-"))(h)?d=h:(d=zs(),t.style?.setProperty("view-transition-name",d),n.push(t)),e.set(t,d),Ks(t,s,o),Ys(t,d,r,a,l),d})}function Gs(t){return"layout"===t?"group":"enter"===t||"new"===t?"new":"old"}let Hs={},qs=null;const Zs=(t,e)=>{Hs[t]=e},_s=()=>{qs||(qs=document.createElement("style"),qs.id="motion-view");let t="";for(const e in Hs){const n=Hs[e];t+=`${e} {\n`;for(const[e,i]of Object.entries(n))t+=` ${e}: ${i};\n`;t+="}\n"}qs.textContent=t,document.head.appendChild(qs),Hs={}},Js=()=>{qs&&qs.parentElement&&qs.parentElement.removeChild(qs)};function Qs(t){const e=t.match(/::view-transition-(old|new|group-children|group|image-pair)\((.*?)\)/);return e?{layer:e[2],type:e[1]}:null}function to(){return document.getAnimations().filter(t=>{const{effect:e}=t;return!!e&&e.target===document.documentElement&&e.pseudoElement?.startsWith("::view-transition")})}const eo=["layout","enter","exit","new","old"],no=t=>t.split(" ").every(t=>0===parseFloat(t)),io={group:["layout"],new:["new","enter"],old:["old","exit"]},so={new:{opacity:0,scale:.85},old:{opacity:1,scale:1}};function oo(t){const{update:e,targets:n,resolveDefs:i,cropOverride:s,pairs:o,classNames:r,flatGroups:a,options:l}=t;if(!document.startViewTransition)return(async()=>(await e(),new En([])))();const c=new Map,u=[],h=[],d=[],p=new Set,f=new Map,y=new Set,g=new Map,x=new Map,w=new Map,T=new Map,b=t=>{n.forEach((e,n)=>{const l=r.get(n),m="root"!==n&&i.has(n)?a.has(n)?"none":"contain":void 0;let y;if("root"!==n&&i.has(n))if(o.has(n))if("old"===t)T.set(n,Wi(n)),y=Xs(n,c,u,void 0,l,h,m,d,p),w.set(n,y);else{for(const t of T.get(n)??[])t.style?.removeProperty("view-transition-name"),c.delete(t);y=Xs(o.get(n),c,u,w.get(n),l,h,m,d,p)}else y=Xs(n,c,u,void 0,l,h,m,d,p);else y=[n];const v=s.get(n);y.forEach((n,i)=>{const s=f.get(n);f.set(n,s&&s!==e?{...s,...e}:e),void 0!==v&&g.set(n,v);const o=x.get(n)??{};o[t]=[i,y.length],x.set(n,o)})})},S=(t,e)=>{const n=x.get(t);return("old"===e?n?.old:"new"===e?n?.new:n?.new??n?.old)??[-1,1]},A=(t,e,n,i,s)=>{const o=ro(Nn(l,n),Nn(function(t,e){for(const n of io[e]??[]){const e=t?.[n]?.options;if(e)return e}}(t,e)??{},n));return"function"==typeof o.delay&&(o.delay=o.delay(i,s)),o},V=t=>{const[e,n]=S(t,"group"),i=A(f.get(t),"group","layout",-1===e?0:e,n);i.duration&&(i.duration=m(i.duration));const{delay:s=0,duration:o,ease:r}=fn(i);return{delay:m(s),duration:o,ease:r}},P=new Map,M=t=>c.forEach((e,n)=>{const i=n,s=i.getBoundingClientRect?.();if(s&&s.height){const n=getComputedStyle(i),o={};for(const t of Fi)o[t]=n[t];const r=P.get(e)??{};r[t]={width:s.width,height:s.height,radii:o},P.set(e,r)}}),E=t=>{const e=P.get(t);return!!(e?.old&&e?.new&&e.old.height&&e.new.height)&&Math.abs(e.old.width/e.old.height-e.new.width/e.new.height)>.2},k=()=>{(function(t,e){return e.has(t)&&Object.keys(e.get(t)).length>0})("root",n)||Zs(":root",{"view-transition-name":"none"}),Zs("::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)",{"animation-timing-function":"linear !important"}),y.forEach(t=>{Zs(`::view-transition-group(${t})`,{overflow:"clip"}),Zs(`::view-transition-old(${t}), ::view-transition-new(${t})`,{width:"100%",height:"100%","object-fit":"cover"})}),p.forEach(t=>{Zs(`::view-transition-group-children(${t})`,{overflow:"clip"})}),_s()},D=()=>{!function(t,e=[],n=[]){for(const e of t)e.style?.removeProperty("view-transition-name");for(const t of e)t.style?.removeProperty("view-transition-class");for(const t of n)t.style?.removeProperty("view-transition-group")}(u,h,d),Js()},C=async()=>{await e(),b("new"),M("new"),(()=>{y.clear();for(const t of x.keys())"root"!==t&&(g.get(t)??E(t))&&y.add(t)})(),k()};let B;try{b("old"),M("old"),k(),B=document.startViewTransition(C)}catch(t){return D(),Promise.reject(t)}return B.finished.finally(D),new Promise((t,e)=>{B.ready.then(()=>{const e=to(),n=[],i=new Set,s=new Set;f.forEach((t,e)=>{const o=x.get(e),r=!!o?.new&&!o?.old,a=!!o?.old&&!o?.new;for(const o of eo){if(!t[o])continue;if("enter"===o&&!r)continue;if("exit"===o&&!a)continue;const c=Gs(o),[u,h]=S(e,c);if(-1===u)continue;const{keyframes:d,options:p}=t[o];for(let[f,y]of Object.entries(d)){if(null==y)continue;if("x"===f||"y"===f){v(!1,`animateView() animates view-transition layers with CSS properties; the "${f}" shorthand has no effect - use transform, e.g. { transform: "translateX(40px)" }.`);continue}if("new"===o&&r&&null!=t.enter?.keyframes[f])continue;if("old"===o&&a&&null!=t.exit?.keyframes[f])continue;const d=ro(Nn(l,f),Nn(p,f));if(!Array.isArray(y)){const e="enter"===o?t.exit?.keyframes[f]:void 0,n="opacity"===f||("new"===c?r:a),i=null!=e?Array.isArray(e)?e[e.length-1]:e:n?so[c]?.[f]:void 0;void 0!==i&&(y=[i,y])}"function"==typeof d.delay&&(d.delay=d.delay(u,h)),d.duration&&(d.duration=m(d.duration)),d.delay&&(d.delay=m(d.delay)),n.push(new yn({...d,element:document.documentElement,name:f,pseudoElement:`::view-transition-${c}(${e})`,keyframes:y})),i.add(`${e}:${c}`),"opacity"===f&&s.add(`${e}:${c}`)}}});for(const t of e){if("finished"===t.playState)continue;const{effect:e}=t;if(!(e&&e instanceof KeyframeEffect))continue;const{pseudoElement:o}=e;if(!o)continue;const r=Qs(o);if(!r)continue;const a=f.get(r.layer);if(i.has(`${r.layer}:${r.type}`)){s.has(`${r.layer}:new`)&&s.has(`${r.layer}:old`)&&e.getKeyframes().some(t=>t.mixBlendMode)?n.push(new Cn(t)):t.cancel();continue}const l="old"===r.type?"new":"new"===r.type?"old":void 0;if(l&&i.has(`${r.layer}:${l}`)&&!s.has(`${r.layer}:${l}`)){t.cancel();continue}const c=x.get(r.layer),u=!("old"!==r.type&&"new"!==r.type||!c?.old||!c?.new);let h;if(r.type.startsWith("group")){const{delay:t,duration:e,ease:n}=V(r.layer);h={delay:t,duration:e,easing:dn(n,e)}}else{const t=u?"group":r.type,[e,n]=S(r.layer,t);let i=A(a,t,"group"===t?"layout":"",-1===e?0:e,n);const s=i.visualDuration;i.duration&&(i.duration=m(i.duration)),i=fn(i),h={delay:m(i.delay??0),duration:u&&void 0!==s?m(s):i.duration,easing:u?"linear":dn(i.ease,i.duration)}}e.updateTiming(h),n.push(new Cn(t))}P.forEach((t,e)=>{if(!y.has(e))return;const{delay:i,duration:s,ease:o}=V(e);for(const r of Fi){const a=t.old?.radii[r]||t.new?.radii[r]||"0px",l=t.new?.radii[r]||t.old?.radii[r]||"0px";no(a)&&no(l)||n.push(new yn({element:document.documentElement,name:r,pseudoElement:`::view-transition-group(${e})`,keyframes:[a,l],delay:i,duration:s,ease:o}))}}),t(new En(n))}).catch(()=>B.updateCallbackDone.then(()=>t(new En([])),e))})}function ro(t,e){const n={...t,...e};return void 0!==e.duration&&(void 0===e.visualDuration&&delete n.visualDuration,void 0===e.type&&delete n.type),n}let ao=[],lo=null;function co(){lo=null;const[t]=ao;var e;t&&(n(ao,e=t),lo=e,oo(e).then(t=>(e.notifyReady(t),t.finished)).catch(t=>e.notifyReject(t)).finally(co))}function uo(){for(let t=ao.length-1;t>=0;t--){const e=ao[t],{interrupt:n}=e.options;if("immediate"===n){const n=ao.slice(0,t+1).map(t=>t.update),i=ao.slice(t+1);e.update=()=>{n.forEach(t=>t())},ao=[e,...i];break}}lo&&"immediate"!==ao[0]?.options.interrupt||co()}class ho{constructor(t,e={}){var n;this.currentSubject="root",this.targets=new Map,this.resolveDefs=new Set,this.cropOverride=new Map,this.pairs=new Map,this.classNames=new Map,this.flatGroups=new Set,this.notifyReady=u,this.notifyReject=u,this.readyPromise=new Promise((t,e)=>{this.notifyReady=t,this.notifyReject=e}),this.update=t,this.options={interrupt:"wait",...e},this.readyPromise.catch(u),n=this,ao.push(n),es.render(uo)}add(t,e){return this.currentSubject=t,this.resolveDefs.add(t),void 0!==e&&this.pairs.set(t,e),this.targets.has(t)||this.targets.set(t,{}),this}crop(t=!0){return this.cropOverride.set(this.currentSubject,t),this}group(t=!0){return t?this.flatGroups.delete(this.currentSubject):this.flatGroups.add(this.currentSubject),this}class(t){return this.classNames.set(this.currentSubject,t),this}layout(t={}){return this.updateTarget("layout",{},t),this}enter(t,e){return this.updateTarget("enter",t,e),this}exit(t,e){return this.updateTarget("exit",t,e),this}new(t,e){return this.updateTarget("new",t,e),this}old(t,e){return this.updateTarget("old",t,e),this}updateTarget(t,e,n={}){const{currentSubject:i,targets:s}=this;s.has(i)||s.set(i,{});s.get(i)[t]={keyframes:e,options:n}}then(t,e){return this.readyPromise.then(t,e)}}const po=()=>({translate:0,scale:1,origin:0,originPoint:0}),mo=()=>({x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}),fo=()=>({min:0,max:0}),yo=()=>({x:{min:0,max:0},y:{min:0,max:0}}),go=new WeakMap;function vo(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function xo(t){return"string"==typeof t||Array.isArray(t)}const wo=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],To=["initial",...wo];function bo(t){return vo(t.animate)||To.some(e=>xo(t[e]))}function So(t){return Boolean(bo(t)||t.variants)}function Ao(t,e,n){for(const i in e){const s=e[i],o=n[i];if(li(s))t.addValue(i,s);else if(li(o))t.addValue(i,In(s,{owner:t}));else if(o!==s)if(t.hasValue(i)){const e=t.getValue(i);!0===e.liveStyle?e.jump(s):e.hasAnimated||e.set(s)}else{const e=t.getStaticValue(i);t.addValue(i,In(void 0!==e?e:s,{owner:t}))}}for(const i in n)void 0===e[i]&&t.removeValue(i);return e}const Vo={current:null},Po={current:!1},Mo="undefined"!=typeof window;function Eo(){if(Po.current=!0,Mo)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Vo.current=t.matches;t.addEventListener("change",e),e()}else Vo.current=!1}const ko=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Do={};class Co{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:i,skipAnimations:s,blockInitialAnimation:o,visualState:r},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=en,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const t=G.now();this.renderScheduledAtthis.bindToMotionValue(e,t)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(Po.current||Eo(),this.shouldReduceMotion=Vo.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),U(this.notifyUpdate),U(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,e){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),e.accelerate&&bn.has(t)&&this.current instanceof HTMLElement){const{factory:n,keyframes:i,times:s,ease:o,duration:r}=e.accelerate,a=new yn({element:this.current,name:t,keyframes:i,times:s,ease:o,duration:m(r)}),l=n(a);return void this.valueSubscriptions.set(t,()=>{l(),a.cancel()})}const n=ze.has(t);n&&this.onBindTransform&&this.onBindTransform();const i=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&W.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let s;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{i(),s&&s()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in Do){const e=Do[t];if(!e)continue;const{isEnabled:n,Feature:i}=e;if(!this.features[t]&&i&&n(this.props)&&(this.features[t]=new i(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;ee.variantChildren.delete(t)}addValue(t,e){const n=this.values.get(t);e!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=In(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,e){let n=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];return null!=n&&("string"==typeof n&&(r(n)||l(n))?n=parseFloat(n):!Ws(n)&&Mt.test(e)&&(n=Li(t,e)),this.setBaseTarget(t,li(n)?n.get():n)),li(n)?n.get():n}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let n;if("string"==typeof e||"object"==typeof e){const i=ei(this.props,e,this.presenceContext?.custom);i&&(n=i[t])}if(e&&void 0!==n)return n;const i=this.getBaseTargetFromProps(this.props,t);return void 0===i||li(i)?void 0!==this.initialValues[t]&&void 0===n?void 0:this.baseTarget[t]:i}on(t,e){return this.events[t]||(this.events[t]=new p),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){es.render(this.render)}}class Bo extends Co{constructor(){super(...arguments),this.KeyframeResolver=Oi}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){const n=t.style;return n?n[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;li(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}function Ro({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function Lo(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),i=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}function jo(t){return void 0===t||1===t}function Oo({scale:t,scaleX:e,scaleY:n}){return!jo(t)||!jo(e)||!jo(n)}function Fo(t){return Oo(t)||Io(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Io(t){return $o(t.x)||$o(t.y)}function $o(t){return t&&"0%"!==t}function No(t,e,n){return n+e*(t-n)}function Wo(t,e,n,i,s){return void 0!==s&&(t=No(t,s,i)),No(t,n,i)+e}function Uo(t,e=0,n=1,i,s){t.min=Wo(t.min,e,n,i,s),t.max=Wo(t.max,e,n,i,s)}function zo(t,{x:e,y:n}){Uo(t.x,e.translate,e.scale,e.originPoint),Uo(t.y,n.translate,n.scale,n.originPoint)}const Ko=.999999999999,Yo=1.0000000000001;function Xo(t,e,n,i=!1){const s=n.length;if(!s)return;let o,r;e.x=e.y=1;for(let a=0;aKo&&(e.x=1),e.yKo&&(e.y=1)}function Go(t,e){t.min+=e,t.max+=e}function Ho(t,e,n,i,s=.5){Uo(t,e,n,Ct(t.min,t.max,s),i)}function qo(t,e){return"string"==typeof t?parseFloat(t)/100*(e.max-e.min):t}function Zo(t,e,n){const i=n??t;Ho(t.x,qo(e.x,i.x),e.scaleX,e.scale,e.originX),Ho(t.y,qo(e.y,i.y),e.scaleY,e.scale,e.originY)}function _o(t,e){return Ro(Lo(t.getBoundingClientRect(),e))}const Jo={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Qo=Ue.length;function tr(t,e,n){let i="",s=!0;for(let o=0;o{if(!e.target)return t;if("string"==typeof t){if(!mt.test(t))return t;t=parseFloat(t)}return`${ir(t,e.target.x)}% ${ir(t,e.target.y)}%`}},or={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,s=Mt.parse(t);if(s.length>5)return i;const o=Mt.createTransformer(t),r="number"!=typeof s[0]?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;s[0+r]/=a,s[1+r]/=l;const c=Ct(a,l,.5);return"number"==typeof s[2+r]&&(s[2+r]/=c),"number"==typeof s[3+r]&&(s[3+r]/=c),o(s)}},rr={borderRadius:{...sr,applyTo:[...Fi]},borderTopLeftRadius:sr,borderTopRightRadius:sr,borderBottomLeftRadius:sr,borderBottomRightRadius:sr,boxShadow:or};function ar(t,{layout:e,layoutId:n}){return ze.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!rr[t]||"opacity"===t)}function lr(t,e,n){const i=t.style,s=e?.style,o={};if(!i)return o;for(const e in i)(li(i[e])||s&&li(s[e])||ar(e,t)||void 0!==n?.getValue(e)?.liveStyle)&&(o[e]=i[e]);return o}class cr extends Bo{constructor(){super(...arguments),this.type="html",this.renderInstance=nr}mount(e){t.invariant(Boolean(e.style),"motion.create() components must forward their ref to a HTML or SVG element","custom-component-ref"),super.mount(e)}readValueFromInstance(t,e){if(ze.has(e))return this.projection?.isProjecting?Ie(e):Ne(t,e);{const i=(n=t,window.getComputedStyle(n)),s=(q(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof s?s.trim():s}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return _o(t,e)}build(t,e,n){er(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return lr(t,e,n)}}class ur extends Co{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,e){if(function(t,e){return t in e}(e,t)){const n=t[e];if("string"==typeof n||"number"==typeof n)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(t,e){delete e.output[t]}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}build(t,e){Object.assign(t.output,e)}renderInstance(t,{output:e}){Object.assign(t,e)}sortInstanceNodePosition(){return 0}}const hr={offset:"stroke-dashoffset",array:"stroke-dasharray"},dr={offset:"strokeDashoffset",array:"strokeDasharray"};function pr(t,e,n=1,i=0,s=!0){t.pathLength=1;const o=s?hr:dr;t[o.offset]=""+-i,t[o.array]=`${e} ${n}`}const mr=["transform","opacity","offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function fr(t,{attrX:e,attrY:n,attrScale:i,pathLength:s,pathSpacing:o=1,pathOffset:r=0,...a},l,c,u){if(er(t,a,c),l)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:h,style:d}=t;for(const t of mr)void 0!==h[t]&&(d[t]=h[t],delete h[t]);(d.transform||h.transformOrigin)&&(d.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),d.transform&&(d.transformBox=u?.transformBox??"fill-box",delete h.transformBox),void 0!==e&&(h.x=e),void 0!==n&&(h.y=n),void 0!==i&&(h.scale=i),void 0!==s&&pr(h,s,o,r,!1)}const yr=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),gr=t=>"string"==typeof t&&"svg"===t.toLowerCase();function vr(t,e,n,i){nr(t,e,void 0,i);for(const n in e.attrs)t.setAttribute(yr.has(n)?n:hi(n),e.attrs[n])}function xr(t,e,n){const i=lr(t,e,n);for(const n in t)if(li(t[n])||li(e[n])){i[-1!==Ue.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]}return i}class wr extends Bo{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=yo}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(ze.has(e)){const t=Bi(e);return t&&t.default||0}if(mr.includes(e)){const n=getComputedStyle(t)[e];if("string"==typeof n&&n)return n.trim()}return e=yr.has(e)?e:hi(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return xr(t,e,n)}build(t,e,n){fr(t,e,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,e,n,i){vr(t,e,0,i)}mount(t){this.isSVGTag=gr(t.tagName),super.mount(t)}}const Tr=To.length;function br(t){if(!t)return;if(!t.isControllingVariants){const e=t.parent&&br(t.parent)||{};return void 0!==t.props.initial&&(e.initial=t.props.initial),e}const e={};for(let n=0;n=.9999&&t.scale<=1.0001||isNaN(t.scale))&&(t.scale=1),(t.translate>=-.01&&t.translate<=.01||isNaN(t.translate))&&(t.translate=0)}function jr(t,e,n,i){Lr(t.x,e.x,n.x,i?i.originX:void 0),Lr(t.y,e.y,n.y,i?i.originY:void 0)}function Or(t,e,n,i=0){const s=i?Ct(n.min,n.max,i):n.min;t.min=s+e.min,t.max=t.min+Br(e)}function Fr(t,e,n,i){Or(t.x,e.x,n.x,i?.x),Or(t.y,e.y,n.y,i?.y)}function Ir(t,e,n,i=0){const s=i?Ct(n.min,n.max,i):n.min;t.min=e.min-s,t.max=t.min+Br(e)}function $r(t,e,n,i){Ir(t.x,e.x,n.x,i?.x),Ir(t.y,e.y,n.y,i?.y)}function Nr(t,e,n,i,s){return t=No(t-=e,1/n,i),void 0!==s&&(t=No(t,1/s,i)),t}function Wr(t,e=0,n=1,i=.5,s,o=t,r=t){if(pt.test(e)){e=parseFloat(e);e=Ct(r.min,r.max,e/100)-r.min}if("number"!=typeof e)return;let a=Ct(o.min,o.max,i);t===o&&(a-=e),t.min=Nr(t.min,e,n,a,s),t.max=Nr(t.max,e,n,a,s)}function Ur(t,e,[n,i,s],o,r){Wr(t,e[n],e[i],e[s],e.scale,o,r)}const zr=["x","scaleX","originX"],Kr=["y","scaleY","originY"];function Yr(t,e,n,i){Ur(t.x,e,zr,n?n.x:void 0,i?i.x:void 0),Ur(t.y,e,Kr,n?n.y:void 0,i?i.y:void 0)}function Xr(t){return 0===t.translate&&1===t.scale}function Gr(t){return Xr(t.x)&&Xr(t.y)}function Hr(t,e){return t.min===e.min&&t.max===e.max}function qr(t,e){return Hr(t.x,e.x)&&Hr(t.y,e.y)}function Zr(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function _r(t,e){return Zr(t.x,e.x)&&Zr(t.y,e.y)}function Jr(t){return Br(t.x)/Br(t.y)}function Qr(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function ta(t){return[t("x"),t("y")]}function ea(t,e,n){let i="";const s=t.x.translate/e.x,o=t.y.translate/e.y,r=n?.z||0;if((s||o||r)&&(i=`translate3d(${s}px, ${o}px, ${r}px) `),1===e.x&&1===e.y||(i+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:t,rotate:e,pathRotation:s,rotateX:o,rotateY:r,skewX:a,skewY:l}=n;t&&(i=`perspective(${t}px) ${i}`),e&&(i+=`rotate(${e}deg) `),s&&(i+=`rotate(${s}deg) `),o&&(i+=`rotateX(${o}deg) `),r&&(i+=`rotateY(${r}deg) `),a&&(i+=`skewX(${a}deg) `),l&&(i+=`skewY(${l}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return 1===a&&1===l||(i+=`scale(${a}, ${l})`),i||"none"}const na=Fi.length,ia=t=>"string"==typeof t?parseFloat(t):t,sa=t=>"number"==typeof t||mt.test(t);function oa(t,e,n,i,s,o){s?(t.opacity=Ct(0,n.opacity??1,aa(i)),t.opacityExit=Ct(e.opacity??1,0,la(i))):o&&(t.opacity=Ct(e.opacity??1,n.opacity??1,i));for(let s=0;sie?1:n(d(t,e,i))}function ua(t,e,n){const i=li(t)?t:In(t);return i.start(Gn("",i,e,n)),i.animation}function ha(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n,i)}const da=(t,e)=>t.depth-e.depth;class pa{constructor(){this.children=[],this.isDirty=!1}add(t){e(this.children,t),this.isDirty=!0}remove(t){n(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(da),this.isDirty=!1,this.children.forEach(t)}}function ma(t,e){const n=G.now(),i=({timestamp:s})=>{const o=s-n;o>=e&&(U(i),t(o-e))};return W.setup(i,!0),()=>U(i)}function fa(t,e){return ma(t,m(e))}function ya(t){return li(t)?t.get():t}class ga{constructor(){this.members=[]}add(t){e(this.members,t);for(let e=this.members.length-1;e>=0;e--){const i=this.members[e];if(i===t||i===this.lead||i===this.prevLead)continue;const s=i.instance;s&&!1!==s.isConnected||i.snapshot||(n(this.members,i),i.unmount())}t.scheduleRender()}remove(t){if(n(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){for(let e=this.members.indexOf(t)-1;e>=0;e--){const t=this.members[e];if(!1!==t.isPresent&&!1!==t.instance?.isConnected)return this.promote(t),!0}return!1}promote(t,e){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.updateSnapshot(),t.scheduleRender();const{layoutDependency:i}=n.options,{layoutDependency:s}=t.options;void 0!==i&&i===s||(t.resumeFrom=n,e&&(n.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root?.isUpdating&&(t.isLayoutDirty=!0)),!1===t.options.crossfade&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{t.options.onExitComplete?.(),t.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}const va={hasAnimatedSinceResize:!0,hasEverUpdated:!1},xa={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},wa=["","X","Y","Z"];let Ta=0;function ba(t,e,n,i){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),i&&(i[t]=0))}function Sa(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=mi(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:e,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",W,!(e||i))}const{parent:i}=t;i&&!i.hasCheckedOptimisedAppear&&Sa(i)}function Aa({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:o}){return class{constructor(t={},n=e?.()){this.id=Ta++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Cs.value&&(xa.nodes=xa.calculatedTargetDeltas=xa.calculatedProjections=0),this.nodes.forEach(Ma),this.nodes.forEach(Oa),this.nodes.forEach(Fa),this.nodes.forEach(Ea),Cs.addProjectionMetrics&&Cs.addProjectionMetrics(xa)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=t,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let t=0;tthis.root.updateBlockedByResize=!1;W.read(()=>{i=window.innerWidth}),t(e,()=>{const t=window.innerWidth;t!==i&&(i=t,this.root.updateBlockedByResize=!0,n&&n(),n=ma(s,250),va.hasAnimatedSinceResize&&(va.hasAnimatedSinceResize=!1,this.nodes.forEach(ja)))})}n&&this.root.registerSharedNode(n,this),!1!==this.options.animate&&s&&(n||i)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeLayoutChanged:n,layout:i})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const o=this.options.transition||s.getDefaultTransition()||za,{onLayoutAnimationStart:r,onLayoutAnimationComplete:a}=s.getProps(),l=!this.targetLayout||!_r(this.targetLayout,i),c=!e&&n;if(this.options.layoutRoot||this.resumeFrom||c||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const e={...Nn(o,"layout"),onPlay:r,onComplete:a};(s.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e),this.setAnimationOrigin(t,c,e.path)}else e||ja(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=i})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const t=this.getStack();t&&t.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),U(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Ia),this.animationId++)}getTransformTemplate(){const{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Sa(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||Br(this.snapshot.measuredBox.x)||Br(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;t{const n=e/1e3,i=p?.(n);var c,m,f,y;i?(r.x.translate=i.x,r.x.scale=Ct(t.x.scale,1,n),r.x.origin=t.x.origin,r.x.originPoint=t.x.originPoint,r.y.translate=i.y,r.y.scale=Ct(t.y.scale,1,n),r.y.origin=t.y.origin,r.y.originPoint=t.y.originPoint):(Na(r.x,t.x,n),Na(r.y,t.y,n)),this.setTargetDelta(r),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&($r(a,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),c=this.relativeTarget,m=this.relativeTargetOrigin,f=a,y=n,Wa(c.x,m.x,f.x,y),Wa(c.y,m.y,f.y,y),d&&qr(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||(d={x:{min:0,max:0},y:{min:0,max:0}}),Dr(d,this.relativeTarget)),l&&(this.animationValues=o,oa(o,s,this.latestValues,n,h,u)),i&&void 0!==i.rotate&&(this.animationValues||(this.animationValues=o),this.animationValues.pathRotation=i.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(t){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(U(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=W.update(()=>{va.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=In(0)),this.motionValue.jump(0,!1),this.currentAnimation=ua(this.motionValue,[0,1e3],{...t,velocity:0,isSync:!0,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onComplete:()=>{t.onComplete&&t.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const t=this.getStack();t&&t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead();let{targetWithTransforms:e,target:n,layout:i,latestValues:s}=t;if(e&&n&&i){if(this!==t&&this.layout&&i&&Ga(this.options.animationType,this.layout.layoutBox,i.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=Br(this.layout.layoutBox.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const i=Br(this.layout.layoutBox.y);n.y.min=t.target.y.min,n.y.max=n.y.min+i}Dr(e,n),Zo(e,s),jr(this.projectionDeltaWithTransform,this.layoutCorrected,e,s)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new ga);this.sharedNodes.get(t).add(e);const n=e.options.initialPromotionConfig;e.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(e):void 0})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){const{layoutId:t}=this.options;return t&&this.getStack()?.lead||this}getPrevLead(){const{layoutId:t}=this.options;return t?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:n}={}){const i=this.getStack();i&&i.promote(this,n),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetSkewAndRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const{latestValues:n}=t;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(e=!0),!e)return;const i={};n.z&&ba("z",t,i,this.animationValues);for(let e=0;et.currentAnimation?.stop()),this.root.nodes.forEach(Da),this.root.sharedNodes.clear()}}}function Va(t){t.updateLayout()}function Pa(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=t.layout,{animationType:s}=t.options,o=e.source!==t.layout.source;if("size"===s)ta(t=>{const i=o?e.measuredBox[t]:e.layoutBox[t],s=Br(i);i.min=n[t].min,i.max=i.min+s});else if("x"===s||"y"===s){const t="x"===s?"y":"x";kr(o?e.measuredBox[t]:e.layoutBox[t],n[t])}else Ga(s,e.layoutBox,n)&&ta(i=>{const s=o?e.measuredBox[i]:e.layoutBox[i],r=Br(n[i]);s.max=s.min+r,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[i].max=t.relativeTarget[i].min+r)});const r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};jr(r,n,e.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};o?jr(a,t.applyTransform(i,!0),e.measuredBox):jr(a,n,e.layoutBox);const l=!Gr(r);let c=!1;if(!t.resumeFrom){const i=t.getClosestProjectingParent();if(i&&!i.resumeFrom){const{snapshot:s,layout:o}=i;if(s&&o){const r=t.options.layoutAnchor||void 0,a={x:{min:0,max:0},y:{min:0,max:0}};$r(a,e.layoutBox,s.layoutBox,r);const l={x:{min:0,max:0},y:{min:0,max:0}};$r(l,n,o.layoutBox,r),_r(a,l)||(c=!0),i.options.layoutRoot&&(t.relativeTarget=l,t.relativeTargetOrigin=a,t.relativeParent=i)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:a,layoutDelta:r,hasLayoutChanged:l,hasRelativeLayoutChanged:c})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function Ma(t){Cs.value&&xa.nodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=Boolean(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function Ea(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function ka(t){t.clearSnapshot()}function Da(t){t.clearMeasurements()}function Ca(t){t.isLayoutDirty=!0,t.updateLayout()}function Ba(t){t.isLayoutDirty=!1}function Ra(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function La(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function ja(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Oa(t){t.resolveTargetDelta()}function Fa(t){t.calcProjection()}function Ia(t){t.resetSkewAndRotation()}function $a(t){t.removeLeadSnapshot()}function Na(t,e,n){t.translate=Ct(e.translate,0,n),t.scale=Ct(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Wa(t,e,n,i){t.min=Ct(e.min,n.min,i),t.max=Ct(e.max,n.max,i)}function Ua(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const za={duration:.45,ease:[.4,0,.1,1]},Ka=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Ya=Ka("applewebkit/")&&!Ka("chrome/")?Math.round:u;function Xa(t){t.min=Ya(t.min),t.max=Ya(t.max)}function Ga(t,e,n){return"position"===t||"preserve-aspect"===t&&!Rr(Jr(e),Jr(n),.2)}function Ha(t){return t!==t.root&&t.scroll?.wasRoot}const qa=Aa({attachResizeListener:(t,e)=>ha(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Za=t=>!t.isLayoutDirty&&t.willUpdate(!1);const _a={current:void 0},Ja=Aa({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!_a.current){const t=new qa({});t.mount(window),t.setOptions({layoutScroll:!0}),_a.current=t}return _a.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),Qa="[data-layout],[data-layout-id]",tl=new WeakMap;let el;function nl(t){const e=[];return t instanceof HTMLElement&&t.matches(Qa)&&e.push(t),t.querySelectorAll(Qa).forEach(t=>{t instanceof HTMLElement&&e.push(t)}),e}function il(t,e){const n=t.getAttribute("data-layout");return{layoutId:t.getAttribute("data-layout-id")??void 0,layout:null!==n||void 0,animationType:n&&"true"!==n?n:"both",transition:e}}function sl(t,e){let n=tl.get(t);if(n)n.setOptions(il(t,e));else{let i=go.get(t);i||(i=new cr({props:{},presenceContext:null,visualState:{latestValues:{},renderState:{transform:{},transformOrigin:{},style:{},vars:{}}}},{allowProjection:!0})),t.style.transform&&!Fo(i.latestValues)&&(t.style.transform=""),n=new Ja(i.latestValues,function(t){let e=t.parentElement;for(;e;){const t=tl.get(e);if(t&&t.instance)return t;e=e.parentElement}}(t)),i.projection=n,n.setOptions({...il(t,e),visualElement:i}),n.mount(t),tl.set(t,n)}return n.isPresent=!0,n.options.onExitComplete&&n.setOptions({onExitComplete:void 0}),n}function ol(t,e){e.setOptions({onExitComplete:void 0});e.getStack()&&!e.isLead()||e.currentAnimation?.stop(),e.unmount(),tl.delete(t)}function rl(){const t=el;el=void 0,function(){if(z.isProcessing)return;const t=G.now();z.delta=i(0,1e3/60,t-z.timestamp),z.timestamp=t,z.isProcessing=!0,K.update.process(z),K.preRender.process(z),K.render.process(z),z.isProcessing=!1}();const e=new Map;for(const n of t)for(const t of n.collectTargets()){const i=e.get(t);i?i.push(n):e.set(t,[n])}const n=new Map;for(const t of(s=e.keys(),[...s].sort((t,e)=>t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1))){const i=e.get(t),s=sl(t,i[i.length-1].transitionFor(t));for(const e of i)e.adopt(t,s);n.set(t,s)}var s;n.forEach(t=>{t.isLayoutDirty=!1,t.willUpdate()});const o=[];for(const e of t){const t=e.runUpdate();t&&o.push(t)}const r=()=>{const e=new Set;for(const n of t)n.reconcileAdditions(e);for(const n of t)n.reconcileRemovals(e);let i;n.forEach(t=>i||(i=t.root));for(const e of t)i||(i=e.getRoot());i?.didUpdate(),es.render(()=>{for(const e of t)e.finalize()})};o.length?Promise.all(o).then(r):r()}const al=W,ll=$.reduce((t,e)=>(t[e]=t=>U(t),t),{});function cl(t){return"object"==typeof t&&!Array.isArray(t)}function ul(t,e,n,i){return null==t?[]:"string"==typeof t&&cl(e)?Wi(t,n,i):t instanceof NodeList?Array.from(t):Array.isArray(t)?t.filter(t=>null!=t):[t]}function hl(t,e,n){return t*(e+1)+n*e}function dl(t,e,n,i){return"number"==typeof e?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?n:e.startsWith("<")?Math.max(0,n+parseFloat(e.slice(1))):i.get(e)??t}function pl(t,e,i,s,o,r){!function(t,e,i){for(let s=0;se&&o.at"number"==typeof t,Tl=t=>t.every(wl);function bl(t){const e={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=gs(t)&&!Bs(t)?new wr(e):new cr(e);n.mount(t),go.set(t,n)}function Sl(t){const e=new ur({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});e.mount(t),go.set(t,e)}function Al(e,n,i,s){const o=[];if(function(t,e){return li(t)||"number"==typeof t||"string"==typeof t&&!cl(e)}(e,n))o.push(ua(e,cl(n)&&n.default||n,i&&i.default||i));else{if(null==e)return o;const r=ul(e,n,s),a=r.length;t.invariant(Boolean(a),"No valid elements provided.","no-valid-elements");for(let t=0;t{const c=vl(e),{delay:u=0,times:h=xe(c),type:d=n.type||"keyframes",repeat:y,repeatType:g,repeatDelay:x=0,...w}=i;let{ease:T=n.ease||"easeOut",duration:b}=i;const A="function"==typeof u?u(a,l):u,V=c.length,P=mn(d)?d:o?.[d||"keyframes"];if(V<=2&&P){let t=100;if(2===V&&Tl(c)){const e=c[1]-c[0];t=Math.abs(e)}const e={...n,...w};void 0!==b&&(e.duration=m(b));const i=Ht(e,t,P);T=i.ease,b=i.duration}b??(b=r);const M=p+A;1===h.length&&0===h[0]&&(h[1]=1);const E=h.length-c.length;if(E>0&&ve(h,E),1===c.length&&c.unshift(null),y&&t.warning(y<20,`Sequence segments can't repeat ${y} times — ignoring repeat option. Use a value below 20 or apply repeat at the sequence level instead.`),y&&y<20){const t=b>0?x/b:0;b=hl(b,y,x);const e=[...c],n=[...h];T=Array.isArray(T)?[...T]:[T];const i=[...T],s="reverse"===g||"mirror"===g;let o=e,r=i;s&&(o=[...e].reverse(),"reverse"===g&&(r=[...i].reverse().map(t=>"function"==typeof t?S(t):t)));for(let a=0;a0&&(c.push(c[c.length-1]),h.push(p),T.push("linear")),c.push(...u);for(let t=0;t{for(const s in t){const o=t[s];o.sort(fl);const r=[],l=[],c=[];for(let t=0;t{if(Array.isArray(t)&&"function"==typeof t[0]){const e=t[0],n=In(0);return n.on("change",e),1===t.length?[n,[0,1]]:2===t.length?[n,[0,1],t[1]]:[n,t[1],t[2]]}return t}),n,i,{spring:me});return o.forEach(({keyframes:t,transition:e},n)=>{s.push(...Al(n,t,e))}),s}function Pl(t={}){const{scope:e,reduceMotion:i,skipAnimations:s}=t;return function(t,o,r){let a,l=[];const c={};if(void 0!==i&&(c.reduceMotion=i),void 0!==s&&(c.skipAnimations=s),u=t,Array.isArray(u)&&u.some(Array.isArray)){const{onComplete:n,...i}=o||{};"function"==typeof n&&(a=n),l=Vl(t,{...c,...i},e)}else{const{onComplete:n,...i}=r||{};"function"==typeof n&&(a=n),l=Al(t,o,{...c,...i},e)}var u;const h=new Dn(l);return a&&h.finished.then(a),e&&(e.animations.push(h),h.finished.then(()=>{n(e.animations,h)})),h}}const Ml=Pl();const El=e=>function(n,i,s){return new Dn(function(e,n,i,s){if(null==e)return[];const o=Wi(e,s),r=o.length;t.invariant(Boolean(r),"No valid elements provided.","no-valid-elements");const a=[];for(let t=0;te.delete(n)),l.push(s)}return l}(n,i,s,e))},kl=El();function Dl(t){return"undefined"!=typeof window&&(t?ln():an())}const Cl={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function Bl(t,e,n,i){const s=n[e],{length:o,position:r}=Cl[e],a=s.current,l=n.time;s.current=Math.abs(t[`scroll${r}`]),s.scrollLength=t[`scroll${o}`]-t[`client${o}`],s.offset.length=0,s.offset[0]=0,s.offset[1]=s.scrollLength,s.progress=d(0,s.scrollLength,s.current);const c=i-l;s.velocity=c>50?0:y(s.current-a,c)}const Rl={start:0,center:.5,end:1};function Ll(t,e,n=0){let i=0;if(t in Rl&&(t=Rl[t]),"string"==typeof t){const e=parseFloat(t);t.endsWith("px")?i=e:t.endsWith("%")?t=e/100:t.endsWith("vw")?i=e/100*document.documentElement.clientWidth:t.endsWith("vh")?i=e/100*document.documentElement.clientHeight:t=e}return"number"==typeof t&&(i=e*t),n+i}const jl=[0,0];function Ol(t,e,n,i){let s=Array.isArray(t)?t:jl,o=0,r=0;return"number"==typeof t?s=[t,t]:"string"==typeof t&&(s=(t=t.trim()).includes(" ")?t.split(" "):[t,Rl[t]?t:"0"]),o=Ll(s[0],n,i),r=Ll(s[1],e),o-r}const Fl={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},Il={x:0,y:0};function $l(t,e,n){const{offset:s=Fl.All}=n,{target:o=t,axis:r="y"}=n,a="y"===r?"height":"width",l=o!==t?function(t,e){const n={x:0,y:0};let i=t;for(;i&&i!==e;)if(qi(i))n.x+=i.offsetLeft,n.y+=i.offsetTop,i=i.offsetParent;else if("svg"===i.tagName){const t=i.getBoundingClientRect();i=i.parentElement;const e=i.getBoundingClientRect();n.x+=t.left-e.left,n.y+=t.top-e.top}else{if(!(i instanceof SVGGraphicsElement))break;{const{x:t,y:e}=i.getBBox();n.x+=t,n.y+=e;let s=null,o=i.parentNode;for(;!s;)"svg"===o.tagName&&(s=o),o=i.parentNode;i=s}}return n}(o,t):Il,c=o===t?{width:t.scrollWidth,height:t.scrollHeight}:function(t){return"getBBox"in t&&"svg"!==t.tagName?t.getBBox():{width:t.clientWidth,height:t.clientHeight}}(o),u={width:t.clientWidth,height:t.clientHeight};e[r].offset.length=0;let h=!e[r].interpolate;const d=s.length;for(let t=0;t{!function(t,e=t,n){if(n.x.targetOffset=0,n.y.targetOffset=0,e!==t){let i=e;for(;i&&i!==t;)n.x.targetOffset+=i.offsetLeft,n.y.targetOffset+=i.offsetTop,i=i.offsetParent}n.x.targetLength=e===t?e.scrollWidth:e.clientWidth,n.y.targetLength=e===t?e.scrollHeight:e.clientHeight,n.x.containerLength=t.clientWidth,n.y.containerLength=t.clientHeight}(t,i.target,n),function(t,e,n){Bl(t,"x",e,n),Bl(t,"y",e,n),e.time=n}(t,n,e),(i.offset||i.target)&&$l(t,n,i)},notify:()=>e(n)}}const Wl=new WeakMap,Ul=new WeakMap,zl=new WeakMap,Kl=new WeakMap,Yl=new WeakMap,Xl=t=>t===document.scrollingElement?window:t;function Gl(t,{container:e=document.scrollingElement,trackContentSize:n=!1,...i}={}){if(!e)return u;let s=zl.get(e);s||(s=new Set,zl.set(e,s));const o=Nl(e,t,{time:0,x:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0},y:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}},i);if(s.add(o),!Wl.has(e)){const t=()=>{for(const t of s)t.measure(z.timestamp);W.preUpdate(n)},n=()=>{for(const t of s)t.notify()},i=()=>W.read(t);Wl.set(e,i);const o=Xl(e);window.addEventListener("resize",i),e!==document.documentElement&&Ul.set(e,ks(e,i)),o.addEventListener("scroll",i),i()}if(n&&!Yl.has(e)){const t=Wl.get(e),n={width:e.scrollWidth,height:e.scrollHeight};Kl.set(e,n);const i=()=>{const i=e.scrollWidth,s=e.scrollHeight;n.width===i&&n.height===s||(t(),n.width=i,n.height=s)},s=W.read(i,!0);Yl.set(e,s)}const r=Wl.get(e);return W.read(r,!1,!0),()=>{U(r);const t=zl.get(e);if(!t)return;if(t.delete(o),t.size)return;const n=Wl.get(e);Wl.delete(e),n&&(Xl(e).removeEventListener("scroll",n),Ul.get(e)?.(),window.removeEventListener("resize",n));const i=Yl.get(e);i&&(U(i),Yl.delete(e)),Kl.delete(e)}}const Hl=[[Fl.Enter,"entry"],[Fl.Exit,"exit"],[Fl.Any,"cover"],[Fl.All,"contain"]],ql={start:0,end:1};function Zl(t){const e=t.trim().split(/\s+/);if(2!==e.length)return;const n=ql[e[0]],i=ql[e[1]];return void 0!==n&&void 0!==i?[n,i]:void 0}function _l(t,e){const n=function(t){if(2!==t.length)return;const e=[];for(const n of t)if(Array.isArray(n))e.push(n);else{if("string"!=typeof n)return;{const t=Zl(n);if(!t)return;e.push(t)}}return e}(t);if(!n)return!1;for(let t=0;t<2;t++){const i=n[t],s=e[t];if(i[0]!==s[0]||i[1]!==s[1])return!1}return!0}function Jl(t){if(!t)return{rangeStart:"contain 0%",rangeEnd:"contain 100%"};for(const[e,n]of Hl)if(_l(t,e))return{rangeStart:`${n} 0%`,rangeEnd:`${n} 100%`}}const Ql=new Map;function tc(t){const e={value:0},n=Gl(n=>{e.value=100*n[t.axis].progress},t);return{currentTime:e,cancel:n}}function ec({source:t,container:e,...n}){const{axis:i}=n;t&&(e=t);let s=Ql.get(e);s||(s=new Map,Ql.set(e,s));const o=n.target??"self";let r=s.get(o);r||(r={},s.set(o,r));const a=i+(n.offset??[]).join(",");if(!r[a])if(n.target&&Dl(n.target)){const t=Jl(n.offset);r[a]=t?new ViewTimeline({subject:n.target,axis:i}):tc({container:e,...n})}else Dl()?r[a]=new ScrollTimeline({source:e,axis:i}):r[a]=tc({container:e,...n});return r[a]}const nc={some:0,all:1};const ic=(t,e)=>Math.abs(t-e);t.AsyncMotionValueAnimation=Mn,t.DOMKeyframesResolver=Oi,t.DOMVisualElement=Bo,t.DocumentProjectionNode=qa,t.Feature=class{constructor(t){this.isMounted=!1,this.node=t}update(){}},t.FlatTree=pa,t.GroupAnimation=En,t.GroupAnimationWithThen=Dn,t.HTMLProjectionNode=Ja,t.HTMLVisualElement=cr,t.JSAnimation=ke,t.KeyframeResolver=en,t.LayoutAnimationBuilder=class{constructor(t,e,n){this.scope=t,this.updateDom=e,this.defaultOptions=n,this.sharedTransitions=new Map,this.notifyReady=()=>{},this.rejectReady=()=>{},this.tracked=new Map,this.restorePoints=new Map,this.readyPromise=new Promise((t,e)=>{this.notifyReady=t,this.rejectReady=e}),el||(el=[],queueMicrotask(rl)),el.push(this)}shared(t,e){return this.sharedTransitions.set(t,e),this}then(t,e){return this.readyPromise.then(t,e)}transitionFor(t){const e=t.getAttribute("data-layout-id");return e&&this.sharedTransitions.get(e)||this.defaultOptions}adopt(t,e){this.tracked.set(t,e),this.restorePoints.set(t,{parent:t.parentElement,next:t.nextSibling})}collectTargets(){return nl(this.scope)}runUpdate(){try{const t=this.updateDom();if(t&&"function"==typeof t.then)return t.then(void 0,t=>{this.updateError=t})}catch(t){this.updateError=t}}reconcileAdditions(t){for(const e of nl(this.scope)){if(this.tracked.has(e))continue;const n=sl(e,this.transitionFor(e));this.adopt(e,n),n.options.layoutId&&t.add(n.options.layoutId)}}reconcileRemovals(t){this.tracked.forEach((e,n)=>{if(n.isConnected)return;const i=this.restorePoints.get(n);this.restorePoints.delete(n);const{layoutId:s}=e.options,o=e.getStack(),r=o&&o.members.some(t=>t!==e&&t.instance?.isConnected);if(s&&e.isLead()&&r&&!t.has(s)&&i&&i.parent.isConnected){if(i.parent.insertBefore(n,i.next&&i.next.parentNode===i.parent?i.next:null),e.isPresent=!1,e.setOptions({onExitComplete:()=>{n.remove(),ol(n,e)}}),e.relegate())return;n.remove()}ol(n,e),this.tracked.delete(n)})}getRoot(){let t;return this.tracked.forEach(e=>t||(t=e.root)),t}finalize(){if(this.updateError)return void this.rejectReady(this.updateError);const t=new Set;this.tracked.forEach(e=>{e.instance&&e.currentAnimation&&t.add(e.currentAnimation)}),this.notifyReady(new En([...t]))}},t.MotionGlobalConfig=o,t.MotionValue=Fn,t.NativeAnimation=yn,t.NativeAnimationExtended=xn,t.NativeAnimationWrapper=Cn,t.NodeStack=ga,t.ObjectVisualElement=ur,t.SVGVisualElement=wr,t.SubscriptionManager=p,t.ViewTransitionBuilder=ho,t.VisualElement=Co,t.acceleratedValues=bn,t.addAttrValue=Xi,t.addDomEvent=ha,t.addScaleCorrector=function(t){for(const e in t)rr[e]=t[e],q(e)&&(rr[e].isCSSVariable=!0)},t.addStyleValue=Ji,t.addUniqueItem=e,t.addValueToWillChange=ui,t.alpha=et,t.analyseComplexValue=At,t.animate=Ml,t.animateMini=kl,t.animateMotionValue=Gn,t.animateSingleValue=ua,t.animateTarget=yi,t.animateValue=function(t){return new ke(t)},t.animateVariant=gi,t.animateView=function(t,e={}){return new ho(t,e)},t.animateVisualElement=vi,t.animationMapKey=Rn,t.anticipate=M,t.applyAxisDelta=Uo,t.applyBoxDelta=zo,t.applyGeneratorOptions=fn,t.applyPointDelta=Wo,t.applyPxDefaults=$i,t.applyTreeDeltas=Xo,t.arc=function(t={}){const e=function({strength:t=.5,peak:e=.5,direction:n,rotate:i=!1}={}){const s=!0===i?1:"number"==typeof i?i:0;let o;return(i,r)=>{const a=r.x-i.x,l=r.y-i.y;let c;c="cw"===n?-t:"ccw"===n?t:(Math.abs(a)>=Math.abs(l)?a:l)<0?-t:t;let u=Zn(i.x,i.y,r.x,r.y,c,e);if(void 0===n){const t=Math.abs(a){const e={x:Hn(t,i.x,u.x,r.x),y:Hn(t,i.y,u.y,r.y)};if(s){const n=qn(t,i.x,u.x,r.x,i.y,u.y,r.y),o=h+p*t;e.rotate=x(-180,180,n-o)*s}return e}}}(t),n={interpolateProjection(t){const n=t.x.translate,i=t.y.translate;if(!(Math.sqrt(n*n+i*i)<20))return e({x:n,y:i},{x:0,y:0})},animateVisualElement(t,n,i,s,o){if(!("x"in n)&&!("y"in n))return;const r=t.getValue("x",t.latestValues.x??0),a=t.getValue("y",t.latestValues.y??0),l=n.x,c=n.y,u=(Array.isArray(l)&&null!=l[0]?l[0]:r?.get())??0,h=(Array.isArray(c)&&null!=c[0]?c[0]:a?.get())??0,d=Array.isArray(l)?l[l.length-1]:l??u,p=Array.isArray(c)?c[c.length-1]:c??h,m=e({x:u,y:h},{x:d,y:p}),f=void 0!==m(0).rotate?t.getValue("pathRotation",0):void 0,y={delay:s,...Nn(i||{},"x")};delete y.path;const g=In(0);g.start(Gn("",g,[0,1e3],{...y,isSync:!0,velocity:0,onUpdate:t=>{const e=m(t/1e3);r?.set(e.x),a?.set(e.y),f&&void 0!==e.rotate&&f.set(e.rotate)},onComplete:()=>{r?.set(d),a?.set(p),f?.set(0)},onStop:()=>f?.set(0),onCancel:()=>f?.set(0)})),g.animation&&o.push(g.animation),delete n.x,delete n.y}};return n},t.aspectRatio=Jr,t.attachFollow=Os,t.attachSpring=function(t,e,n){return Os(t,e,{type:"spring",...n})},t.attrEffect=Gi,t.axisDeltaEquals=Qr,t.axisEquals=Hr,t.axisEqualsRounded=Zr,t.backIn=V,t.backInOut=P,t.backOut=A,t.boxEquals=qr,t.boxEqualsRounded=_r,t.buildHTMLStyles=er,t.buildProjectionTransform=ea,t.buildSVGAttrs=fr,t.buildSVGPath=pr,t.buildTransform=tr,t.calcAxisDelta=Lr,t.calcBoxDelta=jr,t.calcChildStagger=jn,t.calcGeneratorDuration=Gt,t.calcLength=Br,t.calcRelativeAxis=Or,t.calcRelativeAxisPosition=Ir,t.calcRelativeBox=Fr,t.calcRelativePosition=$r,t.camelCaseAttributes=yr,t.camelToDash=hi,t.cancelFrame=U,t.cancelMicrotask=ns,t.cancelSync=ll,t.checkVariantsDidChange=Pr,t.circIn=E,t.circInOut=D,t.circOut=k,t.clamp=i,t.cleanDirtyNodes=Ea,t.collectMotionValues=On,t.color=xt,t.compareByDepth=da,t.complex=Mt,t.containsCSSVariable=Q,t.convertBoundingBoxToBox=Ro,t.convertBoxToBoundingBox=function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}},t.convertOffsetToTimes=we,t.copyAxisDeltaInto=Cr,t.copyAxisInto=kr,t.copyBoxInto=Dr,t.correctBorderRadius=sr,t.correctBoxShadow=or,t.createAnimationState=function(t){let e=function(t){return e=>Promise.all(e.map(({animation:e,options:n})=>vi(t,e,n)))}(t),n=Er(),i=!0,s=!1;const o=e=>(n,i)=>{const s=ni(t,i,"exit"===e?t.presenceContext?.custom:void 0);if(s){const{transition:t,transitionEnd:e,...i}=s;n={...n,...i,...e}}return n};function r(r){const{props:a}=t,l=br(t.parent)||{},c=[],u=new Set;let h={},d=1/0;for(let e=0;ed&&y,T=!1;const b=Array.isArray(f)?f:[f];let S=b.reduce(o(p),{});!1===g&&(S={});const{prevResolvedValues:A={}}=m,V={...A,...S},P=e=>{w=!0,u.has(e)&&(T=!0,u.delete(e)),m.needsAnimating[e]=!0;const n=t.getValue(e);n&&(n.liveStyle=!1)};for(const t in V){const e=S[t],n=A[t];if(h.hasOwnProperty(t))continue;let i=!1;i=si(e)&&si(n)?!Sr(e,n)||x:e!==n,i?null!=e?P(t):u.add(t):void 0!==e&&u.has(t)?P(t):m.protectedKeys[t]=!0}m.prevProp=f,m.prevResolvedValues=S,m.isActive&&(h={...h,...S}),(i||s)&&t.blockInitialAnimation&&(w=!1);const M=v&&x;w&&(!M||T)&&c.push(...b.map(e=>{const n={type:p};if("string"==typeof e&&(i||s)&&!M&&t.manuallyAnimateOnMount&&t.parent){const{parent:i}=t,s=ni(i,e);if(i.enteringChildren&&s){const{delayChildren:e}=s.transition||{};n.delay=jn(i.enteringChildren,t,e)}}return{animation:e,options:n}}))}if(u.size){const e={};if("boolean"!=typeof a.initial){const n=ni(t,Array.isArray(a.initial)?a.initial[0]:a.initial);n&&n.transition&&(e.transition=n.transition)}u.forEach(n=>{const i=t.getBaseTarget(n),s=t.getValue(n);s&&(s.liveStyle=!0),e[n]=i??null}),c.push({animation:e})}let p=Boolean(c.length);return!i||!1!==a.initial&&a.initial!==a.animate||t.manuallyAnimateOnMount||(p=!1),i=!1,s=!1,p?e(c):Promise.resolve()}return{animateChanges:r,setActive:function(e,i){if(n[e].isActive===i)return Promise.resolve();t.variantChildren?.forEach(t=>t.animationState?.setActive(e,i)),n[e].isActive=i;const s=r(e);for(const t in n)n[t].protectedKeys={};return s},setAnimateFunction:function(n){e=n(t)},getState:()=>n,reset:()=>{n=Er(),s=!0}}},t.createAxis=fo,t.createAxisDelta=po,t.createBox=yo,t.createDelta=mo,t.createGeneratorEasing=Ht,t.createProjectionNode=Aa,t.createRenderBatcher=N,t.createScopedAnimate=Pl,t.cubicBezier=T,t.cubicBezierAsString=un,t.defaultEasing=Te,t.defaultOffset=xe,t.defaultTransformValue=Ie,t.defaultValueTypes=Ci,t.degrees=dt,t.delay=fa,t.delayInSeconds=fa,t.dimensionValueTypes=wi,t.distance=ic,t.distance2D=function(t,e){const n=ic(t.x,e.x),i=ic(t.y,e.y);return Math.sqrt(n**2+i**2)},t.eachAxis=ta,t.easeIn=C,t.easeInOut=R,t.easeOut=B,t.easingDefinitionToFunction=I,t.fillOffset=ve,t.fillWildcards=De,t.findDimensionValueType=Ti,t.findValueType=Ws,t.flushKeyframeResolvers=tn,t.followValue=js,t.frame=W,t.frameData=z,t.frameSteps=K,t.generateLinearEasing=Yt,t.getAnimatableNone=Li,t.getAnimationMap=Ln,t.getComputedStyle=ys,t.getDefaultTransition=Kn,t.getDefaultValueType=Bi,t.getEasingForSegment=j,t.getFeatureDefinitions=function(){return Do},t.getFinalKeyframe=Ae,t.getMixer=$t,t.getOptimisedAppearId=mi,t.getOriginIndex=Rs,t.getValueAsType=zi,t.getValueTransition=Nn,t.getVariableValue=Qn,t.getVariantContext=br,t.getViewAnimationLayerInfo=Qs,t.getViewAnimations=to,t.globalProjectionState=va,t.has2DTranslate=Io,t.hasReducedMotionListener=Po,t.hasScale=Oo,t.hasTransform=Fo,t.hasWarned=function(t){return g.has(t)},t.hex=ut,t.hover=function(t,e,n={}){const[i,s,o]=os(t,n);return i.forEach(t=>{let n,i=!1,o=!1;const r=e=>{n&&(n(e),n=void 0),t.removeEventListener("pointerleave",l)},a=t=>{i=!1,window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",a),o&&(o=!1,r(t))},l=t=>{"touch"!==t.pointerType&&(i?o=!0:r(t))};t.addEventListener("pointerenter",i=>{if("touch"===i.pointerType||ss())return;o=!1;const r=e(t,i);"function"==typeof r&&(n=r,t.addEventListener("pointerleave",l,s))},s),t.addEventListener("pointerdown",()=>{i=!0,window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",a,s)},s)}),o},t.hsla=vt,t.hslaToRgba=kt,t.inView=function(t,e,{root:n,margin:i,amount:s="some"}={}){const o=Wi(t),r=new WeakMap,a=new IntersectionObserver(t=>{t.forEach(t=>{const n=r.get(t.target);if(t.isIntersecting!==Boolean(n))if(t.isIntersecting){const n=e(t.target,t);"function"==typeof n?r.set(t.target,n):a.unobserve(t.target)}else"function"==typeof n&&(n(t),r.delete(t.target))})},{root:n,rootMargin:i,threshold:"number"==typeof s?s:nc[s]});return o.forEach(t=>a.observe(t)),()=>a.disconnect()},t.inertia=ye,t.initPrefersReducedMotion=Eo,t.interpolate=ge,t.invisibleValues=Ot,t.isAnimationControls=vo,t.isBezierDefinition=O,t.isCSSVariableName=q,t.isCSSVariableToken=_,t.isControllingVariants=bo,t.isDeltaZero=Gr,t.isDragActive=ss,t.isDragging=is,t.isEasingArray=L,t.isElementKeyboardAccessible=cs,t.isElementTextInput=function(t){return us.has(t.tagName)||!0===t.isContentEditable},t.isForcedMotionValue=ar,t.isGenerator=mn,t.isHTMLElement=qi,t.isKeyframesTarget=si,t.isMotionValue=li,t.isNear=Rr,t.isNodeOrChild=rs,t.isNumericalString=r,t.isObject=a,t.isPrimaryPointer=as,t.isSVGElement=gs,t.isSVGSVGElement=Bs,t.isSVGTag=gr,t.isTransitionDefined=Xn,t.isVariantLabel=xo,t.isVariantNode=So,t.isWaapiSupportedEasing=function t(e){return Boolean("function"==typeof e&&cn()||!e||"string"==typeof e&&(e in hn||cn())||O(e)||Array.isArray(e)&&e.every(t))},t.isWillChangeMotionValue=ci,t.isZeroValueString=l,t.keyframes=be,t.makeAnimationInstant=Tn,t.mapEasingToNativeEasing=dn,t.mapValue=function(t,e,n,i){const s=Ls(e,n,i);return $s(()=>s(t.get()))},t.maxGeneratorDuration=Xt,t.measurePageBox=function(t,e,n){const i=_o(t,n),{scroll:s}=e;return s&&(Go(i.x,s.offset.x),Go(i.y,s.offset.y)),i},t.measureViewportBox=_o,t.memo=c,t.microtask=es,t.millisecondsToSeconds=f,t.mirrorEasing=b,t.mix=zt,t.mixArray=Nt,t.mixColor=jt,t.mixComplex=Ut,t.mixImmediate=Dt,t.mixLinearColor=Bt,t.mixNumber=Ct,t.mixObject=Wt,t.mixValues=oa,t.mixVisibility=Ft,t.motionValue=In,t.moveItem=function([...t],e,n){const i=e<0?t.length+e:e;if(i>=0&&it.forEach(Za);return{add:i=>{t.add(i),e.set(i,i.addEventListener("willUpdate",n))},remove:i=>{t.delete(i);const s=e.get(i);s&&(s(),e.delete(i)),n()},dirty:n}},t.noop=u,t.number=tt,t.numberValueTypes=Di,t.observeTimeline=Ds,t.optimizedAppearDataAttribute=pi,t.optimizedAppearDataId=di,t.parseAnimateLayoutArgs=function(t,e,n){return"function"==typeof t?{scope:document,updateDom:t,defaultOptions:e}:{scope:t instanceof Document?t:Wi(t)[0]??document,updateDom:e,defaultOptions:n}},t.parseCSSVariable=Jn,t.parseValueFromTransform=$e,t.percent=pt,t.pipe=h,t.pixelsToPercent=ir,t.positionalKeys=ii,t.prefersReducedMotion=Vo,t.press=function(t,e,n={}){const[i,s,o]=os(t,n),r=t=>{const i=t.currentTarget;if(!ms(t))return;if(fs.has(t))return;hs.add(i),n.stopPropagation&&fs.add(t);const o=e(i,t),r={...s,capture:!0},a=(t,e)=>{window.removeEventListener("pointerup",l,r),window.removeEventListener("pointercancel",c,r),hs.has(i)&&hs.delete(i),ms(t)&&"function"==typeof o&&o(t,{success:e})},l=t=>{a(t,i===window||i===document||n.useGlobalTarget||rs(i,t.target))},c=t=>{a(t,!1)};window.addEventListener("pointerup",l,r),window.addEventListener("pointercancel",c,r)};return i.forEach(t=>{(n.useGlobalTarget?window:t).addEventListener("pointerdown",r,s),qi(t)&&(t.addEventListener("focus",t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const i=ds(()=>{if(hs.has(n))return;ps(n,"down");const t=ds(()=>{ps(n,"up")});n.addEventListener("keyup",t,e),n.addEventListener("blur",()=>ps(n,"cancel"),e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)})(t,s)),cs(t)||t.hasAttribute("tabindex")||(t.tabIndex=0))}),o},t.progress=d,t.progressPercentage=gt,t.propEffect=Hi,t.propagateDirtyNodes=Ma,t.px=mt,t.readTransformValue=Ne,t.recordStats=function(){if(Cs.value)throw Cs.value=null,Cs.addProjectionMetrics=null,new Error("Stats are already being measured");const t=Cs;t.value={layoutProjection:{nodes:[],calculatedTargetDeltas:[],calculatedProjections:[]}},t.addProjectionMetrics=e=>{const{layoutProjection:n}=t.value;n.nodes.push(e.nodes),n.calculatedTargetDeltas.push(e.calculatedTargetDeltas),n.calculatedProjections.push(e.calculatedProjections)}},t.removeAxisDelta=Wr,t.removeAxisTransforms=Ur,t.removeBoxTransforms=Yr,t.removeItem=n,t.removePointDelta=Nr,t.renderHTML=nr,t.renderSVG=vr,t.resize=ks,t.resolveElements=Wi,t.resolveMotionValue=ya,t.resolveTransition=$n,t.resolveVariant=ni,t.resolveVariantFromProps=ei,t.reverseEasing=S,t.rgbUnit=lt,t.rgba=ct,t.rootProjectionNode=_a,t.scale=nt,t.scaleCorrectors=rr,t.scalePoint=No,t.scrapeHTMLMotionValuesFromProps=lr,t.scrapeSVGMotionValuesFromProps=xr,t.scroll=function(t,{axis:e="y",container:n=document.scrollingElement,...i}={}){if(!n)return u;const s={axis:e,container:n,...i};return"function"==typeof t?function(t,e){return function(t){return 2===t.length}(t)||function(t){return t&&(t.target||t.offset)}(e)?Gl(n=>{t(n[e.axis].progress,n)},e):Ds(t,ec(e))}(t,s):function(t,e){const n=ec(e),i=e.target?Jl(e.offset):void 0,s=e.target?Dl(e.target)&&!!i:Dl();return t.attachTimeline({timeline:s?n:void 0,...i&&s&&{rangeStart:i.rangeStart,rangeEnd:i.rangeEnd},observe:t=>(t.pause(),Ds(e=>{t.time=t.iterationDuration*e},n))})}(t,s)},t.scrollInfo=Gl,t.secondsToMilliseconds=m,t.setDragLock=function(t){return"x"===t||"y"===t?is[t]?null:(is[t]=!0,()=>{is[t]=!1}):is.x||is.y?null:(is.x=is.y=!0,()=>{is.x=is.y=!1})},t.setFeatureDefinitions=function(t){Do=t},t.setStyle=sn,t.setTarget=ai,t.spring=me,t.springValue=function(t,e){return js(t,{type:"spring",...e})},t.stagger=function(t=.1,{startDelay:e=0,from:n=0,ease:i}={}){return(s,o)=>{const r="number"==typeof n?n:Rs(n,o),a=Math.abs(r-s);let l=t*a;if(i){const e=o*t;l=I(i)(l/e)*e}return e+l}},t.startWaapiAnimation=pn,t.statsBuffer=Cs,t.steps=function(t,e="end"){return n=>{const s=(n="end"===e?Math.min(n,.999):Math.max(n,.001))*t,o="end"===e?Math.floor(s):Math.ceil(s);return i(0,1,o/t)}},t.styleEffect=Qi,t.supportedWaapiEasing=hn,t.supportsBrowserAnimation=Pn,t.supportsFlags=on,t.supportsLinearEasing=cn,t.supportsPartialKeyframes=Ni,t.supportsScrollTimeline=an,t.supportsViewTimeline=ln,t.svgEffect=ts,t.sync=al,t.testValueType=xi,t.time=G,t.transform=Ls,t.transformAxis=Ho,t.transformBox=Zo,t.transformBoxPoints=Lo,t.transformPropOrder=Ue,t.transformProps=ze,t.transformValue=$s,t.transformValueTypes=ki,t.translateAxis=Go,t.updateMotionValuesFromProps=Ao,t.variantPriorityOrder=wo,t.variantProps=To,t.velocityPerSecond=y,t.vh=ft,t.visualElementStore=go,t.vw=yt,t.warnOnce=v,t.wrap=x}); diff --git a/node_modules/motion/dist/react-client.d.ts b/node_modules/motion/dist/react-client.d.ts new file mode 100644 index 0000000..dd39a72 --- /dev/null +++ b/node_modules/motion/dist/react-client.d.ts @@ -0,0 +1 @@ +export * from 'framer-motion/client'; diff --git a/node_modules/motion/dist/react-m.d.ts b/node_modules/motion/dist/react-m.d.ts new file mode 100644 index 0000000..c7ed1b1 --- /dev/null +++ b/node_modules/motion/dist/react-m.d.ts @@ -0,0 +1 @@ +export * from 'framer-motion/m'; diff --git a/node_modules/motion/dist/react-mini.d.ts b/node_modules/motion/dist/react-mini.d.ts new file mode 100644 index 0000000..ef5bdae --- /dev/null +++ b/node_modules/motion/dist/react-mini.d.ts @@ -0,0 +1 @@ +export * from 'framer-motion/mini'; diff --git a/node_modules/motion/dist/react.d.ts b/node_modules/motion/dist/react.d.ts new file mode 100644 index 0000000..4ba03bc --- /dev/null +++ b/node_modules/motion/dist/react.d.ts @@ -0,0 +1,7 @@ +import * as fm from 'framer-motion'; +export * from 'framer-motion'; + +declare const motion: typeof fm.motion; +declare const m: typeof fm.m; + +export { m, motion }; diff --git a/node_modules/motion/mini/package.json b/node_modules/motion/mini/package.json new file mode 100644 index 0000000..1ed4407 --- /dev/null +++ b/node_modules/motion/mini/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "types": "../dist/mini.d.ts", + "main": "../dist/cjs/mini.js", + "module": "../dist/es/mini.mjs" +} diff --git a/node_modules/motion/package.json b/node_modules/motion/package.json new file mode 100644 index 0000000..e3c31c4 --- /dev/null +++ b/node_modules/motion/package.json @@ -0,0 +1,95 @@ +{ + "name": "motion", + "version": "13.1.0", + "description": "An animation library for JavaScript and React.", + "main": "dist/cjs/index.js", + "module": "dist/es/index.mjs", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "require": "./dist/cjs/index.js", + "import": "./dist/es/index.mjs", + "default": "./dist/cjs/index.js" + }, + "./debug": { + "types": "./dist/debug.d.ts", + "require": "./dist/cjs/debug.js", + "import": "./dist/es/debug.mjs", + "default": "./dist/cjs/debug.js" + }, + "./mini": { + "types": "./dist/mini.d.ts", + "require": "./dist/cjs/mini.js", + "import": "./dist/es/mini.mjs", + "default": "./dist/cjs/mini.js" + }, + "./react": { + "types": "./dist/react.d.ts", + "require": "./dist/cjs/react.js", + "import": "./dist/es/react.mjs", + "default": "./dist/cjs/react.js" + }, + "./react-client": { + "types": "./dist/react-client.d.ts", + "require": "./dist/cjs/react-client.js", + "import": "./dist/es/react-client.mjs", + "default": "./dist/cjs/react-client.js" + }, + "./react-m": { + "types": "./dist/react-m.d.ts", + "require": "./dist/cjs/react-m.js", + "import": "./dist/es/react-m.mjs", + "default": "./dist/cjs/react-m.js" + }, + "./react-mini": { + "types": "./dist/react-mini.d.ts", + "require": "./dist/cjs/react-mini.js", + "import": "./dist/es/react-mini.mjs", + "default": "./dist/cjs/react-mini.js" + }, + "./package.json": "./package.json" + }, + "types": "dist/index.d.ts", + "author": "Matt Perry", + "license": "MIT", + "repository": "https://github.com/motiondivision/motion", + "sideEffects": false, + "keywords": [ + "javascript animation", + "react animation", + "react", + "three", + "3d", + "animation", + "gestures", + "drag", + "spring", + "popmotion", + "framer", + "waapi" + ], + "scripts": { + "build": "yarn clean && tsc -p . && rollup -c", + "dev": "concurrently -c blue,red -n tsc,rollup --kill-others \"tsc --watch -p . --preserveWatchOutput\" \"rollup --config --watch --no-watch.clearScreen\"", + "clean": "rm -rf types dist lib", + "prepack": "yarn build", + "postpublish": "git push --tags" + }, + "dependencies": { + "framer-motion": "^13.1.0", + "tslib": "^2.4.0" + }, + "peerDependencies": { + "react": "^18.0.0 || ^19.0.0", + "react-dom": "^18.0.0 || ^19.0.0" + }, + "peerDependenciesMeta": { + "react": { + "optional": true + }, + "react-dom": { + "optional": true + } + }, + "gitHead": "adaf7a4e5368d704ea350669f6ac674fb26ff270" +} diff --git a/node_modules/motion/react-client/package.json b/node_modules/motion/react-client/package.json new file mode 100644 index 0000000..41e0c96 --- /dev/null +++ b/node_modules/motion/react-client/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "types": "../dist/react-client.d.ts", + "main": "../dist/cjs/react-client.js", + "module": "../dist/es/react-client.mjs" +} diff --git a/node_modules/motion/react-m/package.json b/node_modules/motion/react-m/package.json new file mode 100644 index 0000000..45b9dc1 --- /dev/null +++ b/node_modules/motion/react-m/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "types": "../dist/react-m.d.ts", + "main": "../dist/cjs/react-m.js", + "module": "../dist/es/react-m.mjs" +} diff --git a/node_modules/motion/react/package.json b/node_modules/motion/react/package.json new file mode 100644 index 0000000..27ab21c --- /dev/null +++ b/node_modules/motion/react/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "types": "../dist/react.d.ts", + "main": "../dist/cjs/react.js", + "module": "../dist/es/react.mjs" +} diff --git a/node_modules/tslib/CopyrightNotice.txt b/node_modules/tslib/CopyrightNotice.txt new file mode 100644 index 0000000..5d7d2d9 --- /dev/null +++ b/node_modules/tslib/CopyrightNotice.txt @@ -0,0 +1,15 @@ +/****************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ + diff --git a/node_modules/tslib/LICENSE.txt b/node_modules/tslib/LICENSE.txt new file mode 100644 index 0000000..fa7d1bd --- /dev/null +++ b/node_modules/tslib/LICENSE.txt @@ -0,0 +1,12 @@ +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. \ No newline at end of file diff --git a/node_modules/tslib/README.md b/node_modules/tslib/README.md new file mode 100644 index 0000000..14b9a83 --- /dev/null +++ b/node_modules/tslib/README.md @@ -0,0 +1,164 @@ +# tslib + +This is a runtime library for [TypeScript](https://www.typescriptlang.org/) that contains all of the TypeScript helper functions. + +This library is primarily used by the `--importHelpers` flag in TypeScript. +When using `--importHelpers`, a module that uses helper functions like `__extends` and `__assign` in the following emitted file: + +```ts +var __assign = (this && this.__assign) || Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; +}; +exports.x = {}; +exports.y = __assign({}, exports.x); + +``` + +will instead be emitted as something like the following: + +```ts +var tslib_1 = require("tslib"); +exports.x = {}; +exports.y = tslib_1.__assign({}, exports.x); +``` + +Because this can avoid duplicate declarations of things like `__extends`, `__assign`, etc., this means delivering users smaller files on average, as well as less runtime overhead. +For optimized bundles with TypeScript, you should absolutely consider using `tslib` and `--importHelpers`. + +# Installing + +For the latest stable version, run: + +## npm + +```sh +# TypeScript 3.9.2 or later +npm install tslib + +# TypeScript 3.8.4 or earlier +npm install tslib@^1 + +# TypeScript 2.3.2 or earlier +npm install tslib@1.6.1 +``` + +## yarn + +```sh +# TypeScript 3.9.2 or later +yarn add tslib + +# TypeScript 3.8.4 or earlier +yarn add tslib@^1 + +# TypeScript 2.3.2 or earlier +yarn add tslib@1.6.1 +``` + +## bower + +```sh +# TypeScript 3.9.2 or later +bower install tslib + +# TypeScript 3.8.4 or earlier +bower install tslib@^1 + +# TypeScript 2.3.2 or earlier +bower install tslib@1.6.1 +``` + +## JSPM + +```sh +# TypeScript 3.9.2 or later +jspm install tslib + +# TypeScript 3.8.4 or earlier +jspm install tslib@^1 + +# TypeScript 2.3.2 or earlier +jspm install tslib@1.6.1 +``` + +# Usage + +Set the `importHelpers` compiler option on the command line: + +``` +tsc --importHelpers file.ts +``` + +or in your tsconfig.json: + +```json +{ + "compilerOptions": { + "importHelpers": true + } +} +``` + +#### For bower and JSPM users + +You will need to add a `paths` mapping for `tslib`, e.g. For Bower users: + +```json +{ + "compilerOptions": { + "module": "amd", + "importHelpers": true, + "baseUrl": "./", + "paths": { + "tslib" : ["bower_components/tslib/tslib.d.ts"] + } + } +} +``` + +For JSPM users: + +```json +{ + "compilerOptions": { + "module": "system", + "importHelpers": true, + "baseUrl": "./", + "paths": { + "tslib" : ["jspm_packages/npm/tslib@2.x.y/tslib.d.ts"] + } + } +} +``` + +## Deployment + +- Choose your new version number +- Set it in `package.json` and `bower.json` +- Create a tag: `git tag [version]` +- Push the tag: `git push --tags` +- Create a [release in GitHub](https://github.com/microsoft/tslib/releases) +- Run the [publish to npm](https://github.com/microsoft/tslib/actions?query=workflow%3A%22Publish+to+NPM%22) workflow + +Done. + +# Contribute + +There are many ways to [contribute](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md) to TypeScript. + +* [Submit bugs](https://github.com/Microsoft/TypeScript/issues) and help us verify fixes as they are checked in. +* Review the [source code changes](https://github.com/Microsoft/TypeScript/pulls). +* Engage with other TypeScript users and developers on [StackOverflow](http://stackoverflow.com/questions/tagged/typescript). +* Join the [#typescript](http://twitter.com/#!/search/realtime/%23typescript) discussion on Twitter. +* [Contribute bug fixes](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md). + +# Documentation + +* [Quick tutorial](http://www.typescriptlang.org/Tutorial) +* [Programming handbook](http://www.typescriptlang.org/Handbook) +* [Homepage](http://www.typescriptlang.org/) diff --git a/node_modules/tslib/SECURITY.md b/node_modules/tslib/SECURITY.md new file mode 100644 index 0000000..869fdfe --- /dev/null +++ b/node_modules/tslib/SECURITY.md @@ -0,0 +1,41 @@ + + +## Security + +Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/). + +If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/opensource/security/definition), please report it to us as described below. + +## Reporting Security Issues + +**Please do not report security vulnerabilities through public GitHub issues.** + +Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report). + +If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey). + +You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc). + +Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: + + * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) + * Full paths of source file(s) related to the manifestation of the issue + * The location of the affected source code (tag/branch/commit or direct URL) + * Any special configuration required to reproduce the issue + * Step-by-step instructions to reproduce the issue + * Proof-of-concept or exploit code (if possible) + * Impact of the issue, including how an attacker might exploit the issue + +This information will help us triage your report more quickly. + +If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/opensource/security/bounty) page for more details about our active programs. + +## Preferred Languages + +We prefer all communications to be in English. + +## Policy + +Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd). + + diff --git a/node_modules/tslib/modules/index.d.ts b/node_modules/tslib/modules/index.d.ts new file mode 100644 index 0000000..3244fab --- /dev/null +++ b/node_modules/tslib/modules/index.d.ts @@ -0,0 +1,38 @@ +// Note: named reexports are used instead of `export *` because +// TypeScript itself doesn't resolve the `export *` when checking +// if a particular helper exists. +export { + __extends, + __assign, + __rest, + __decorate, + __param, + __esDecorate, + __runInitializers, + __propKey, + __setFunctionName, + __metadata, + __awaiter, + __generator, + __exportStar, + __values, + __read, + __spread, + __spreadArrays, + __spreadArray, + __await, + __asyncGenerator, + __asyncDelegator, + __asyncValues, + __makeTemplateObject, + __importStar, + __importDefault, + __classPrivateFieldGet, + __classPrivateFieldSet, + __classPrivateFieldIn, + __createBinding, + __addDisposableResource, + __disposeResources, + __rewriteRelativeImportExtension, +} from '../tslib.js'; +export * as default from '../tslib.js'; diff --git a/node_modules/tslib/modules/index.js b/node_modules/tslib/modules/index.js new file mode 100644 index 0000000..f4f9a06 --- /dev/null +++ b/node_modules/tslib/modules/index.js @@ -0,0 +1,70 @@ +import tslib from '../tslib.js'; +const { + __extends, + __assign, + __rest, + __decorate, + __param, + __esDecorate, + __runInitializers, + __propKey, + __setFunctionName, + __metadata, + __awaiter, + __generator, + __exportStar, + __createBinding, + __values, + __read, + __spread, + __spreadArrays, + __spreadArray, + __await, + __asyncGenerator, + __asyncDelegator, + __asyncValues, + __makeTemplateObject, + __importStar, + __importDefault, + __classPrivateFieldGet, + __classPrivateFieldSet, + __classPrivateFieldIn, + __addDisposableResource, + __disposeResources, + __rewriteRelativeImportExtension, +} = tslib; +export { + __extends, + __assign, + __rest, + __decorate, + __param, + __esDecorate, + __runInitializers, + __propKey, + __setFunctionName, + __metadata, + __awaiter, + __generator, + __exportStar, + __createBinding, + __values, + __read, + __spread, + __spreadArrays, + __spreadArray, + __await, + __asyncGenerator, + __asyncDelegator, + __asyncValues, + __makeTemplateObject, + __importStar, + __importDefault, + __classPrivateFieldGet, + __classPrivateFieldSet, + __classPrivateFieldIn, + __addDisposableResource, + __disposeResources, + __rewriteRelativeImportExtension, +}; +export default tslib; diff --git a/node_modules/tslib/modules/package.json b/node_modules/tslib/modules/package.json new file mode 100644 index 0000000..96ae6e5 --- /dev/null +++ b/node_modules/tslib/modules/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} \ No newline at end of file diff --git a/node_modules/tslib/package.json b/node_modules/tslib/package.json new file mode 100644 index 0000000..57d0578 --- /dev/null +++ b/node_modules/tslib/package.json @@ -0,0 +1,47 @@ +{ + "name": "tslib", + "author": "Microsoft Corp.", + "homepage": "https://www.typescriptlang.org/", + "version": "2.8.1", + "license": "0BSD", + "description": "Runtime library for TypeScript helper functions", + "keywords": [ + "TypeScript", + "Microsoft", + "compiler", + "language", + "javascript", + "tslib", + "runtime" + ], + "bugs": { + "url": "https://github.com/Microsoft/TypeScript/issues" + }, + "repository": { + "type": "git", + "url": "https://github.com/Microsoft/tslib.git" + }, + "main": "tslib.js", + "module": "tslib.es6.js", + "jsnext:main": "tslib.es6.js", + "typings": "tslib.d.ts", + "sideEffects": false, + "exports": { + ".": { + "module": { + "types": "./modules/index.d.ts", + "default": "./tslib.es6.mjs" + }, + "import": { + "node": "./modules/index.js", + "default": { + "types": "./modules/index.d.ts", + "default": "./tslib.es6.mjs" + } + }, + "default": "./tslib.js" + }, + "./*": "./*", + "./": "./" + } +} diff --git a/node_modules/tslib/tslib.d.ts b/node_modules/tslib/tslib.d.ts new file mode 100644 index 0000000..9c27e05 --- /dev/null +++ b/node_modules/tslib/tslib.d.ts @@ -0,0 +1,460 @@ +/****************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ + +/** + * Used to shim class extends. + * + * @param d The derived class. + * @param b The base class. + */ +export declare function __extends(d: Function, b: Function): void; + +/** + * Copy the values of all of the enumerable own properties from one or more source objects to a + * target object. Returns the target object. + * + * @param t The target object to copy to. + * @param sources One or more source objects from which to copy properties + */ +export declare function __assign(t: any, ...sources: any[]): any; + +/** + * Performs a rest spread on an object. + * + * @param t The source value. + * @param propertyNames The property names excluded from the rest spread. + */ +export declare function __rest(t: any, propertyNames: (string | symbol)[]): any; + +/** + * Applies decorators to a target object + * + * @param decorators The set of decorators to apply. + * @param target The target object. + * @param key If specified, the own property to apply the decorators to. + * @param desc The property descriptor, defaults to fetching the descriptor from the target object. + * @experimental + */ +export declare function __decorate(decorators: Function[], target: any, key?: string | symbol, desc?: any): any; + +/** + * Creates an observing function decorator from a parameter decorator. + * + * @param paramIndex The parameter index to apply the decorator to. + * @param decorator The parameter decorator to apply. Note that the return value is ignored. + * @experimental + */ +export declare function __param(paramIndex: number, decorator: Function): Function; + +/** + * Applies decorators to a class or class member, following the native ECMAScript decorator specification. + * @param ctor For non-field class members, the class constructor. Otherwise, `null`. + * @param descriptorIn The `PropertyDescriptor` to use when unable to look up the property from `ctor`. + * @param decorators The decorators to apply + * @param contextIn The `DecoratorContext` to clone for each decorator application. + * @param initializers An array of field initializer mutation functions into which new initializers are written. + * @param extraInitializers An array of extra initializer functions into which new initializers are written. + */ +export declare function __esDecorate(ctor: Function | null, descriptorIn: object | null, decorators: Function[], contextIn: object, initializers: Function[] | null, extraInitializers: Function[]): void; + +/** + * Runs field initializers or extra initializers generated by `__esDecorate`. + * @param thisArg The `this` argument to use. + * @param initializers The array of initializers to evaluate. + * @param value The initial value to pass to the initializers. + */ +export declare function __runInitializers(thisArg: unknown, initializers: Function[], value?: any): any; + +/** + * Converts a computed property name into a `string` or `symbol` value. + */ +export declare function __propKey(x: any): string | symbol; + +/** + * Assigns the name of a function derived from the left-hand side of an assignment. + * @param f The function to rename. + * @param name The new name for the function. + * @param prefix A prefix (such as `"get"` or `"set"`) to insert before the name. + */ +export declare function __setFunctionName(f: Function, name: string | symbol, prefix?: string): Function; + +/** + * Creates a decorator that sets metadata. + * + * @param metadataKey The metadata key + * @param metadataValue The metadata value + * @experimental + */ +export declare function __metadata(metadataKey: any, metadataValue: any): Function; + +/** + * Converts a generator function into a pseudo-async function, by treating each `yield` as an `await`. + * + * @param thisArg The reference to use as the `this` value in the generator function + * @param _arguments The optional arguments array + * @param P The optional promise constructor argument, defaults to the `Promise` property of the global object. + * @param generator The generator function + */ +export declare function __awaiter(thisArg: any, _arguments: any, P: Function, generator: Function): any; + +/** + * Creates an Iterator object using the body as the implementation. + * + * @param thisArg The reference to use as the `this` value in the function + * @param body The generator state-machine based implementation. + * + * @see [./docs/generator.md] + */ +export declare function __generator(thisArg: any, body: Function): any; + +/** + * Creates bindings for all enumerable properties of `m` on `exports` + * + * @param m The source object + * @param o The `exports` object. + */ +export declare function __exportStar(m: any, o: any): void; + +/** + * Creates a value iterator from an `Iterable` or `ArrayLike` object. + * + * @param o The object. + * @throws {TypeError} If `o` is neither `Iterable`, nor an `ArrayLike`. + */ +export declare function __values(o: any): any; + +/** + * Reads values from an `Iterable` or `ArrayLike` object and returns the resulting array. + * + * @param o The object to read from. + * @param n The maximum number of arguments to read, defaults to `Infinity`. + */ +export declare function __read(o: any, n?: number): any[]; + +/** + * Creates an array from iterable spread. + * + * @param args The Iterable objects to spread. + * @deprecated since TypeScript 4.2 - Use `__spreadArray` + */ +export declare function __spread(...args: any[][]): any[]; + +/** + * Creates an array from array spread. + * + * @param args The ArrayLikes to spread into the resulting array. + * @deprecated since TypeScript 4.2 - Use `__spreadArray` + */ +export declare function __spreadArrays(...args: any[][]): any[]; + +/** + * Spreads the `from` array into the `to` array. + * + * @param pack Replace empty elements with `undefined`. + */ +export declare function __spreadArray(to: any[], from: any[], pack?: boolean): any[]; + +/** + * Creates an object that signals to `__asyncGenerator` that it shouldn't be yielded, + * and instead should be awaited and the resulting value passed back to the generator. + * + * @param v The value to await. + */ +export declare function __await(v: any): any; + +/** + * Converts a generator function into an async generator function, by using `yield __await` + * in place of normal `await`. + * + * @param thisArg The reference to use as the `this` value in the generator function + * @param _arguments The optional arguments array + * @param generator The generator function + */ +export declare function __asyncGenerator(thisArg: any, _arguments: any, generator: Function): any; + +/** + * Used to wrap a potentially async iterator in such a way so that it wraps the result + * of calling iterator methods of `o` in `__await` instances, and then yields the awaited values. + * + * @param o The potentially async iterator. + * @returns A synchronous iterator yielding `__await` instances on every odd invocation + * and returning the awaited `IteratorResult` passed to `next` every even invocation. + */ +export declare function __asyncDelegator(o: any): any; + +/** + * Creates a value async iterator from an `AsyncIterable`, `Iterable` or `ArrayLike` object. + * + * @param o The object. + * @throws {TypeError} If `o` is neither `AsyncIterable`, `Iterable`, nor an `ArrayLike`. + */ +export declare function __asyncValues(o: any): any; + +/** + * Creates a `TemplateStringsArray` frozen object from the `cooked` and `raw` arrays. + * + * @param cooked The cooked possibly-sparse array. + * @param raw The raw string content. + */ +export declare function __makeTemplateObject(cooked: string[], raw: string[]): TemplateStringsArray; + +/** + * Used to shim default and named imports in ECMAScript Modules transpiled to CommonJS. + * + * ```js + * import Default, { Named, Other } from "mod"; + * // or + * import { default as Default, Named, Other } from "mod"; + * ``` + * + * @param mod The CommonJS module exports object. + */ +export declare function __importStar(mod: T): T; + +/** + * Used to shim default imports in ECMAScript Modules transpiled to CommonJS. + * + * ```js + * import Default from "mod"; + * ``` + * + * @param mod The CommonJS module exports object. + */ +export declare function __importDefault(mod: T): T | { default: T }; + +/** + * Emulates reading a private instance field. + * + * @param receiver The instance from which to read the private field. + * @param state A WeakMap containing the private field value for an instance. + * @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method. + * + * @throws {TypeError} If `state` doesn't have an entry for `receiver`. + */ +export declare function __classPrivateFieldGet( + receiver: T, + state: { has(o: T): boolean, get(o: T): V | undefined }, + kind?: "f" +): V; + +/** + * Emulates reading a private static field. + * + * @param receiver The object from which to read the private static field. + * @param state The class constructor containing the definition of the static field. + * @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method. + * @param f The descriptor that holds the static field value. + * + * @throws {TypeError} If `receiver` is not `state`. + */ +export declare function __classPrivateFieldGet unknown, V>( + receiver: T, + state: T, + kind: "f", + f: { value: V } +): V; + +/** + * Emulates evaluating a private instance "get" accessor. + * + * @param receiver The instance on which to evaluate the private "get" accessor. + * @param state A WeakSet used to verify an instance supports the private "get" accessor. + * @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method. + * @param f The "get" accessor function to evaluate. + * + * @throws {TypeError} If `state` doesn't have an entry for `receiver`. + */ +export declare function __classPrivateFieldGet( + receiver: T, + state: { has(o: T): boolean }, + kind: "a", + f: () => V +): V; + +/** + * Emulates evaluating a private static "get" accessor. + * + * @param receiver The object on which to evaluate the private static "get" accessor. + * @param state The class constructor containing the definition of the static "get" accessor. + * @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method. + * @param f The "get" accessor function to evaluate. + * + * @throws {TypeError} If `receiver` is not `state`. + */ +export declare function __classPrivateFieldGet unknown, V>( + receiver: T, + state: T, + kind: "a", + f: () => V +): V; + +/** + * Emulates reading a private instance method. + * + * @param receiver The instance from which to read a private method. + * @param state A WeakSet used to verify an instance supports the private method. + * @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method. + * @param f The function to return as the private instance method. + * + * @throws {TypeError} If `state` doesn't have an entry for `receiver`. + */ +export declare function __classPrivateFieldGet unknown>( + receiver: T, + state: { has(o: T): boolean }, + kind: "m", + f: V +): V; + +/** + * Emulates reading a private static method. + * + * @param receiver The object from which to read the private static method. + * @param state The class constructor containing the definition of the static method. + * @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method. + * @param f The function to return as the private static method. + * + * @throws {TypeError} If `receiver` is not `state`. + */ +export declare function __classPrivateFieldGet unknown, V extends (...args: any[]) => unknown>( + receiver: T, + state: T, + kind: "m", + f: V +): V; + +/** + * Emulates writing to a private instance field. + * + * @param receiver The instance on which to set a private field value. + * @param state A WeakMap used to store the private field value for an instance. + * @param value The value to store in the private field. + * @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method. + * + * @throws {TypeError} If `state` doesn't have an entry for `receiver`. + */ +export declare function __classPrivateFieldSet( + receiver: T, + state: { has(o: T): boolean, set(o: T, value: V): unknown }, + value: V, + kind?: "f" +): V; + +/** + * Emulates writing to a private static field. + * + * @param receiver The object on which to set the private static field. + * @param state The class constructor containing the definition of the private static field. + * @param value The value to store in the private field. + * @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method. + * @param f The descriptor that holds the static field value. + * + * @throws {TypeError} If `receiver` is not `state`. + */ +export declare function __classPrivateFieldSet unknown, V>( + receiver: T, + state: T, + value: V, + kind: "f", + f: { value: V } +): V; + +/** + * Emulates writing to a private instance "set" accessor. + * + * @param receiver The instance on which to evaluate the private instance "set" accessor. + * @param state A WeakSet used to verify an instance supports the private "set" accessor. + * @param value The value to store in the private accessor. + * @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method. + * @param f The "set" accessor function to evaluate. + * + * @throws {TypeError} If `state` doesn't have an entry for `receiver`. + */ +export declare function __classPrivateFieldSet( + receiver: T, + state: { has(o: T): boolean }, + value: V, + kind: "a", + f: (v: V) => void +): V; + +/** + * Emulates writing to a private static "set" accessor. + * + * @param receiver The object on which to evaluate the private static "set" accessor. + * @param state The class constructor containing the definition of the static "set" accessor. + * @param value The value to store in the private field. + * @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method. + * @param f The "set" accessor function to evaluate. + * + * @throws {TypeError} If `receiver` is not `state`. + */ +export declare function __classPrivateFieldSet unknown, V>( + receiver: T, + state: T, + value: V, + kind: "a", + f: (v: V) => void +): V; + +/** + * Checks for the existence of a private field/method/accessor. + * + * @param state The class constructor containing the static member, or the WeakMap or WeakSet associated with a private instance member. + * @param receiver The object for which to test the presence of the private member. + */ +export declare function __classPrivateFieldIn( + state: (new (...args: any[]) => unknown) | { has(o: any): boolean }, + receiver: unknown, +): boolean; + +/** + * Creates a re-export binding on `object` with key `objectKey` that references `target[key]`. + * + * @param object The local `exports` object. + * @param target The object to re-export from. + * @param key The property key of `target` to re-export. + * @param objectKey The property key to re-export as. Defaults to `key`. + */ +export declare function __createBinding(object: object, target: object, key: PropertyKey, objectKey?: PropertyKey): void; + +/** + * Adds a disposable resource to a resource-tracking environment object. + * @param env A resource-tracking environment object. + * @param value Either a Disposable or AsyncDisposable object, `null`, or `undefined`. + * @param async When `true`, `AsyncDisposable` resources can be added. When `false`, `AsyncDisposable` resources cannot be added. + * @returns The {@link value} argument. + * + * @throws {TypeError} If {@link value} is not an object, or if either `Symbol.dispose` or `Symbol.asyncDispose` are not + * defined, or if {@link value} does not have an appropriate `Symbol.dispose` or `Symbol.asyncDispose` method. + */ +export declare function __addDisposableResource(env: { stack: { value?: unknown, dispose?: Function, async: boolean }[]; error: unknown; hasError: boolean; }, value: T, async: boolean): T; + +/** + * Disposes all resources in a resource-tracking environment object. + * @param env A resource-tracking environment object. + * @returns A {@link Promise} if any resources in the environment were marked as `async` when added; otherwise, `void`. + * + * @throws {SuppressedError} if an error thrown during disposal would have suppressed a prior error from disposal or the + * error recorded in the resource-tracking environment object. + * @seealso {@link __addDisposableResource} + */ +export declare function __disposeResources(env: { stack: { value?: unknown, dispose?: Function, async: boolean }[]; error: unknown; hasError: boolean; }): any; + +/** + * Transforms a relative import specifier ending in a non-declaration TypeScript file extension to its JavaScript file extension counterpart. + * @param path The import specifier. + * @param preserveJsx Causes '*.tsx' to transform to '*.jsx' instead of '*.js'. Should be true when `--jsx` is set to `preserve`. + */ +export declare function __rewriteRelativeImportExtension(path: string, preserveJsx?: boolean): string; \ No newline at end of file diff --git a/node_modules/tslib/tslib.es6.html b/node_modules/tslib/tslib.es6.html new file mode 100644 index 0000000..b122e41 --- /dev/null +++ b/node_modules/tslib/tslib.es6.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/node_modules/tslib/tslib.es6.js b/node_modules/tslib/tslib.es6.js new file mode 100644 index 0000000..67ba5c5 --- /dev/null +++ b/node_modules/tslib/tslib.es6.js @@ -0,0 +1,402 @@ +/****************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ +/* global Reflect, Promise, SuppressedError, Symbol, Iterator */ + +var extendStatics = function(d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); +}; + +export function __extends(d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +} + +export var __assign = function() { + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + } + return __assign.apply(this, arguments); +} + +export function __rest(s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; +} + +export function __decorate(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +} + +export function __param(paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +} + +export function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { + function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } + var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; + var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; + var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); + var _, done = false; + for (var i = decorators.length - 1; i >= 0; i--) { + var context = {}; + for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; + for (var p in contextIn.access) context.access[p] = contextIn.access[p]; + context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; + var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); + if (kind === "accessor") { + if (result === void 0) continue; + if (result === null || typeof result !== "object") throw new TypeError("Object expected"); + if (_ = accept(result.get)) descriptor.get = _; + if (_ = accept(result.set)) descriptor.set = _; + if (_ = accept(result.init)) initializers.unshift(_); + } + else if (_ = accept(result)) { + if (kind === "field") initializers.unshift(_); + else descriptor[key] = _; + } + } + if (target) Object.defineProperty(target, contextIn.name, descriptor); + done = true; +}; + +export function __runInitializers(thisArg, initializers, value) { + var useValue = arguments.length > 2; + for (var i = 0; i < initializers.length; i++) { + value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); + } + return useValue ? value : void 0; +}; + +export function __propKey(x) { + return typeof x === "symbol" ? x : "".concat(x); +}; + +export function __setFunctionName(f, name, prefix) { + if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; + return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); +}; + +export function __metadata(metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); +} + +export function __awaiter(thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} + +export function __generator(thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); + return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (g && (g = 0, op[0] && (_ = 0)), _) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +} + +export var __createBinding = Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +}); + +export function __exportStar(m, o) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); +} + +export function __values(o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) return m.call(o); + if (o && typeof o.length === "number") return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); +} + +export function __read(o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; +} + +/** @deprecated */ +export function __spread() { + for (var ar = [], i = 0; i < arguments.length; i++) + ar = ar.concat(__read(arguments[i])); + return ar; +} + +/** @deprecated */ +export function __spreadArrays() { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; +} + +export function __spreadArray(to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); +} + +export function __await(v) { + return this instanceof __await ? (this.v = v, this) : new __await(v); +} + +export function __asyncGenerator(thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i; + function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; } + function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } +} + +export function __asyncDelegator(o) { + var i, p; + return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; + function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } +} + +export function __asyncValues(o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } +} + +export function __makeTemplateObject(cooked, raw) { + if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } + return cooked; +}; + +var __setModuleDefault = Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}; + +var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); +}; + +export function __importStar(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; +} + +export function __importDefault(mod) { + return (mod && mod.__esModule) ? mod : { default: mod }; +} + +export function __classPrivateFieldGet(receiver, state, kind, f) { + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); +} + +export function __classPrivateFieldSet(receiver, state, value, kind, f) { + if (kind === "m") throw new TypeError("Private method is not writable"); + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; +} + +export function __classPrivateFieldIn(state, receiver) { + if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); + return typeof state === "function" ? receiver === state : state.has(receiver); +} + +export function __addDisposableResource(env, value, async) { + if (value !== null && value !== void 0) { + if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); + var dispose, inner; + if (async) { + if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); + dispose = value[Symbol.asyncDispose]; + } + if (dispose === void 0) { + if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); + dispose = value[Symbol.dispose]; + if (async) inner = dispose; + } + if (typeof dispose !== "function") throw new TypeError("Object not disposable."); + if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } }; + env.stack.push({ value: value, dispose: dispose, async: async }); + } + else if (async) { + env.stack.push({ async: true }); + } + return value; + +} + +var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { + var e = new Error(message); + return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; +}; + +export function __disposeResources(env) { + function fail(e) { + env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; + env.hasError = true; + } + var r, s = 0; + function next() { + while (r = env.stack.pop()) { + try { + if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next); + if (r.dispose) { + var result = r.dispose.call(r.value); + if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); + } + else s |= 1; + } + catch (e) { + fail(e); + } + } + if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); + if (env.hasError) throw env.error; + } + return next(); +} + +export function __rewriteRelativeImportExtension(path, preserveJsx) { + if (typeof path === "string" && /^\.\.?\//.test(path)) { + return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) { + return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js"); + }); + } + return path; +} + +export default { + __extends: __extends, + __assign: __assign, + __rest: __rest, + __decorate: __decorate, + __param: __param, + __esDecorate: __esDecorate, + __runInitializers: __runInitializers, + __propKey: __propKey, + __setFunctionName: __setFunctionName, + __metadata: __metadata, + __awaiter: __awaiter, + __generator: __generator, + __createBinding: __createBinding, + __exportStar: __exportStar, + __values: __values, + __read: __read, + __spread: __spread, + __spreadArrays: __spreadArrays, + __spreadArray: __spreadArray, + __await: __await, + __asyncGenerator: __asyncGenerator, + __asyncDelegator: __asyncDelegator, + __asyncValues: __asyncValues, + __makeTemplateObject: __makeTemplateObject, + __importStar: __importStar, + __importDefault: __importDefault, + __classPrivateFieldGet: __classPrivateFieldGet, + __classPrivateFieldSet: __classPrivateFieldSet, + __classPrivateFieldIn: __classPrivateFieldIn, + __addDisposableResource: __addDisposableResource, + __disposeResources: __disposeResources, + __rewriteRelativeImportExtension: __rewriteRelativeImportExtension, +}; diff --git a/node_modules/tslib/tslib.es6.mjs b/node_modules/tslib/tslib.es6.mjs new file mode 100644 index 0000000..c17990a --- /dev/null +++ b/node_modules/tslib/tslib.es6.mjs @@ -0,0 +1,401 @@ +/****************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ +/* global Reflect, Promise, SuppressedError, Symbol, Iterator */ + +var extendStatics = function(d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); +}; + +export function __extends(d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +} + +export var __assign = function() { + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + } + return __assign.apply(this, arguments); +} + +export function __rest(s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; +} + +export function __decorate(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +} + +export function __param(paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +} + +export function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { + function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } + var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; + var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; + var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); + var _, done = false; + for (var i = decorators.length - 1; i >= 0; i--) { + var context = {}; + for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; + for (var p in contextIn.access) context.access[p] = contextIn.access[p]; + context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; + var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); + if (kind === "accessor") { + if (result === void 0) continue; + if (result === null || typeof result !== "object") throw new TypeError("Object expected"); + if (_ = accept(result.get)) descriptor.get = _; + if (_ = accept(result.set)) descriptor.set = _; + if (_ = accept(result.init)) initializers.unshift(_); + } + else if (_ = accept(result)) { + if (kind === "field") initializers.unshift(_); + else descriptor[key] = _; + } + } + if (target) Object.defineProperty(target, contextIn.name, descriptor); + done = true; +}; + +export function __runInitializers(thisArg, initializers, value) { + var useValue = arguments.length > 2; + for (var i = 0; i < initializers.length; i++) { + value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); + } + return useValue ? value : void 0; +}; + +export function __propKey(x) { + return typeof x === "symbol" ? x : "".concat(x); +}; + +export function __setFunctionName(f, name, prefix) { + if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; + return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); +}; + +export function __metadata(metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); +} + +export function __awaiter(thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} + +export function __generator(thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); + return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (g && (g = 0, op[0] && (_ = 0)), _) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +} + +export var __createBinding = Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +}); + +export function __exportStar(m, o) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); +} + +export function __values(o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) return m.call(o); + if (o && typeof o.length === "number") return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); +} + +export function __read(o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; +} + +/** @deprecated */ +export function __spread() { + for (var ar = [], i = 0; i < arguments.length; i++) + ar = ar.concat(__read(arguments[i])); + return ar; +} + +/** @deprecated */ +export function __spreadArrays() { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; +} + +export function __spreadArray(to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); +} + +export function __await(v) { + return this instanceof __await ? (this.v = v, this) : new __await(v); +} + +export function __asyncGenerator(thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i; + function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; } + function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } +} + +export function __asyncDelegator(o) { + var i, p; + return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; + function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } +} + +export function __asyncValues(o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } +} + +export function __makeTemplateObject(cooked, raw) { + if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } + return cooked; +}; + +var __setModuleDefault = Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}; + +var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); +}; + +export function __importStar(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; +} + +export function __importDefault(mod) { + return (mod && mod.__esModule) ? mod : { default: mod }; +} + +export function __classPrivateFieldGet(receiver, state, kind, f) { + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); +} + +export function __classPrivateFieldSet(receiver, state, value, kind, f) { + if (kind === "m") throw new TypeError("Private method is not writable"); + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; +} + +export function __classPrivateFieldIn(state, receiver) { + if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); + return typeof state === "function" ? receiver === state : state.has(receiver); +} + +export function __addDisposableResource(env, value, async) { + if (value !== null && value !== void 0) { + if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); + var dispose, inner; + if (async) { + if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); + dispose = value[Symbol.asyncDispose]; + } + if (dispose === void 0) { + if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); + dispose = value[Symbol.dispose]; + if (async) inner = dispose; + } + if (typeof dispose !== "function") throw new TypeError("Object not disposable."); + if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } }; + env.stack.push({ value: value, dispose: dispose, async: async }); + } + else if (async) { + env.stack.push({ async: true }); + } + return value; +} + +var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { + var e = new Error(message); + return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; +}; + +export function __disposeResources(env) { + function fail(e) { + env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; + env.hasError = true; + } + var r, s = 0; + function next() { + while (r = env.stack.pop()) { + try { + if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next); + if (r.dispose) { + var result = r.dispose.call(r.value); + if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); + } + else s |= 1; + } + catch (e) { + fail(e); + } + } + if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); + if (env.hasError) throw env.error; + } + return next(); +} + +export function __rewriteRelativeImportExtension(path, preserveJsx) { + if (typeof path === "string" && /^\.\.?\//.test(path)) { + return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) { + return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js"); + }); + } + return path; +} + +export default { + __extends, + __assign, + __rest, + __decorate, + __param, + __esDecorate, + __runInitializers, + __propKey, + __setFunctionName, + __metadata, + __awaiter, + __generator, + __createBinding, + __exportStar, + __values, + __read, + __spread, + __spreadArrays, + __spreadArray, + __await, + __asyncGenerator, + __asyncDelegator, + __asyncValues, + __makeTemplateObject, + __importStar, + __importDefault, + __classPrivateFieldGet, + __classPrivateFieldSet, + __classPrivateFieldIn, + __addDisposableResource, + __disposeResources, + __rewriteRelativeImportExtension, +}; diff --git a/node_modules/tslib/tslib.html b/node_modules/tslib/tslib.html new file mode 100644 index 0000000..44c9ba5 --- /dev/null +++ b/node_modules/tslib/tslib.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/node_modules/tslib/tslib.js b/node_modules/tslib/tslib.js new file mode 100644 index 0000000..b6509f7 --- /dev/null +++ b/node_modules/tslib/tslib.js @@ -0,0 +1,484 @@ +/****************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ +/* global global, define, Symbol, Reflect, Promise, SuppressedError, Iterator */ +var __extends; +var __assign; +var __rest; +var __decorate; +var __param; +var __esDecorate; +var __runInitializers; +var __propKey; +var __setFunctionName; +var __metadata; +var __awaiter; +var __generator; +var __exportStar; +var __values; +var __read; +var __spread; +var __spreadArrays; +var __spreadArray; +var __await; +var __asyncGenerator; +var __asyncDelegator; +var __asyncValues; +var __makeTemplateObject; +var __importStar; +var __importDefault; +var __classPrivateFieldGet; +var __classPrivateFieldSet; +var __classPrivateFieldIn; +var __createBinding; +var __addDisposableResource; +var __disposeResources; +var __rewriteRelativeImportExtension; +(function (factory) { + var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; + if (typeof define === "function" && define.amd) { + define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); + } + else if (typeof module === "object" && typeof module.exports === "object") { + factory(createExporter(root, createExporter(module.exports))); + } + else { + factory(createExporter(root)); + } + function createExporter(exports, previous) { + if (exports !== root) { + if (typeof Object.create === "function") { + Object.defineProperty(exports, "__esModule", { value: true }); + } + else { + exports.__esModule = true; + } + } + return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; + } +}) +(function (exporter) { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + + __extends = function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + + __assign = Object.assign || function (t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + }; + + __rest = function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; + }; + + __decorate = function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + + __param = function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } + }; + + __esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { + function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } + var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; + var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; + var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); + var _, done = false; + for (var i = decorators.length - 1; i >= 0; i--) { + var context = {}; + for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; + for (var p in contextIn.access) context.access[p] = contextIn.access[p]; + context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; + var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); + if (kind === "accessor") { + if (result === void 0) continue; + if (result === null || typeof result !== "object") throw new TypeError("Object expected"); + if (_ = accept(result.get)) descriptor.get = _; + if (_ = accept(result.set)) descriptor.set = _; + if (_ = accept(result.init)) initializers.unshift(_); + } + else if (_ = accept(result)) { + if (kind === "field") initializers.unshift(_); + else descriptor[key] = _; + } + } + if (target) Object.defineProperty(target, contextIn.name, descriptor); + done = true; + }; + + __runInitializers = function (thisArg, initializers, value) { + var useValue = arguments.length > 2; + for (var i = 0; i < initializers.length; i++) { + value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); + } + return useValue ? value : void 0; + }; + + __propKey = function (x) { + return typeof x === "symbol" ? x : "".concat(x); + }; + + __setFunctionName = function (f, name, prefix) { + if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; + return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); + }; + + __metadata = function (metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); + }; + + __awaiter = function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + + __generator = function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); + return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (g && (g = 0, op[0] && (_ = 0)), _) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } + }; + + __exportStar = function(m, o) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); + }; + + __createBinding = Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); + }) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); + + __values = function (o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) return m.call(o); + if (o && typeof o.length === "number") return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); + }; + + __read = function (o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; + }; + + /** @deprecated */ + __spread = function () { + for (var ar = [], i = 0; i < arguments.length; i++) + ar = ar.concat(__read(arguments[i])); + return ar; + }; + + /** @deprecated */ + __spreadArrays = function () { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; + }; + + __spreadArray = function (to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); + }; + + __await = function (v) { + return this instanceof __await ? (this.v = v, this) : new __await(v); + }; + + __asyncGenerator = function (thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i; + function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; } + function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } + }; + + __asyncDelegator = function (o) { + var i, p; + return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; + function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } + }; + + __asyncValues = function (o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } + }; + + __makeTemplateObject = function (cooked, raw) { + if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } + return cooked; + }; + + var __setModuleDefault = Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + }) : function(o, v) { + o["default"] = v; + }; + + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + + __importStar = function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; + + __importDefault = function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; + }; + + __classPrivateFieldGet = function (receiver, state, kind, f) { + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); + }; + + __classPrivateFieldSet = function (receiver, state, value, kind, f) { + if (kind === "m") throw new TypeError("Private method is not writable"); + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; + }; + + __classPrivateFieldIn = function (state, receiver) { + if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); + return typeof state === "function" ? receiver === state : state.has(receiver); + }; + + __addDisposableResource = function (env, value, async) { + if (value !== null && value !== void 0) { + if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); + var dispose, inner; + if (async) { + if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); + dispose = value[Symbol.asyncDispose]; + } + if (dispose === void 0) { + if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); + dispose = value[Symbol.dispose]; + if (async) inner = dispose; + } + if (typeof dispose !== "function") throw new TypeError("Object not disposable."); + if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } }; + env.stack.push({ value: value, dispose: dispose, async: async }); + } + else if (async) { + env.stack.push({ async: true }); + } + return value; + }; + + var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { + var e = new Error(message); + return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; + }; + + __disposeResources = function (env) { + function fail(e) { + env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; + env.hasError = true; + } + var r, s = 0; + function next() { + while (r = env.stack.pop()) { + try { + if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next); + if (r.dispose) { + var result = r.dispose.call(r.value); + if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); + } + else s |= 1; + } + catch (e) { + fail(e); + } + } + if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); + if (env.hasError) throw env.error; + } + return next(); + }; + + __rewriteRelativeImportExtension = function (path, preserveJsx) { + if (typeof path === "string" && /^\.\.?\//.test(path)) { + return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) { + return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js"); + }); + } + return path; + }; + + exporter("__extends", __extends); + exporter("__assign", __assign); + exporter("__rest", __rest); + exporter("__decorate", __decorate); + exporter("__param", __param); + exporter("__esDecorate", __esDecorate); + exporter("__runInitializers", __runInitializers); + exporter("__propKey", __propKey); + exporter("__setFunctionName", __setFunctionName); + exporter("__metadata", __metadata); + exporter("__awaiter", __awaiter); + exporter("__generator", __generator); + exporter("__exportStar", __exportStar); + exporter("__createBinding", __createBinding); + exporter("__values", __values); + exporter("__read", __read); + exporter("__spread", __spread); + exporter("__spreadArrays", __spreadArrays); + exporter("__spreadArray", __spreadArray); + exporter("__await", __await); + exporter("__asyncGenerator", __asyncGenerator); + exporter("__asyncDelegator", __asyncDelegator); + exporter("__asyncValues", __asyncValues); + exporter("__makeTemplateObject", __makeTemplateObject); + exporter("__importStar", __importStar); + exporter("__importDefault", __importDefault); + exporter("__classPrivateFieldGet", __classPrivateFieldGet); + exporter("__classPrivateFieldSet", __classPrivateFieldSet); + exporter("__classPrivateFieldIn", __classPrivateFieldIn); + exporter("__addDisposableResource", __addDisposableResource); + exporter("__disposeResources", __disposeResources); + exporter("__rewriteRelativeImportExtension", __rewriteRelativeImportExtension); +}); + +0 && (module.exports = { + __extends: __extends, + __assign: __assign, + __rest: __rest, + __decorate: __decorate, + __param: __param, + __esDecorate: __esDecorate, + __runInitializers: __runInitializers, + __propKey: __propKey, + __setFunctionName: __setFunctionName, + __metadata: __metadata, + __awaiter: __awaiter, + __generator: __generator, + __exportStar: __exportStar, + __createBinding: __createBinding, + __values: __values, + __read: __read, + __spread: __spread, + __spreadArrays: __spreadArrays, + __spreadArray: __spreadArray, + __await: __await, + __asyncGenerator: __asyncGenerator, + __asyncDelegator: __asyncDelegator, + __asyncValues: __asyncValues, + __makeTemplateObject: __makeTemplateObject, + __importStar: __importStar, + __importDefault: __importDefault, + __classPrivateFieldGet: __classPrivateFieldGet, + __classPrivateFieldSet: __classPrivateFieldSet, + __classPrivateFieldIn: __classPrivateFieldIn, + __addDisposableResource: __addDisposableResource, + __disposeResources: __disposeResources, + __rewriteRelativeImportExtension: __rewriteRelativeImportExtension, +}); diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..b0317f1 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,78 @@ +{ + "name": "Devjams26-Frontend", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "dependencies": { + "motion": "^13.1.0" + } + }, + "node_modules/framer-motion": { + "version": "13.1.0", + "resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-13.1.0.tgz", + "integrity": "sha512-QSZrF0Id3QGuHJ+OL+9PSY9pk86C8ERFalwAGSchzTm65+ZoGH/RM26lmEARLljcHj2lqhv0jZOOks+EI3COOw==", + "license": "MIT", + "dependencies": { + "motion-dom": "^13.0.0", + "motion-utils": "^13.0.0", + "tslib": "^2.4.0" + }, + "peerDependencies": { + "react": "^18.0.0 || ^19.0.0", + "react-dom": "^18.0.0 || ^19.0.0" + }, + "peerDependenciesMeta": { + "react": { + "optional": true + }, + "react-dom": { + "optional": true + } + } + }, + "node_modules/motion": { + "version": "13.1.0", + "resolved": "https://registry.npmjs.org/motion/-/motion-13.1.0.tgz", + "integrity": "sha512-qtvscq59uCPdWnNW4SdSkrxR+BS/QYsa923bx7ocA+4p+ZGNbbVQwkSnG4aukB81QWjtl3AxX36plxNyZLmHCA==", + "license": "MIT", + "dependencies": { + "framer-motion": "^13.1.0", + "tslib": "^2.4.0" + }, + "peerDependencies": { + "react": "^18.0.0 || ^19.0.0", + "react-dom": "^18.0.0 || ^19.0.0" + }, + "peerDependenciesMeta": { + "react": { + "optional": true + }, + "react-dom": { + "optional": true + } + } + }, + "node_modules/motion-dom": { + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/motion-dom/-/motion-dom-13.0.0.tgz", + "integrity": "sha512-Xk+SJas70uMAUIApg+m3lZDShxI3LBFHq7mFGbBKoRXc2PVPDyAKmzN64Bbzt4CZdP/CItTiJxWtn4TA0v53Ng==", + "license": "MIT", + "dependencies": { + "motion-utils": "^13.0.0" + } + }, + "node_modules/motion-utils": { + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/motion-utils/-/motion-utils-13.0.0.tgz", + "integrity": "sha512-7DnN7TmbLcYXcG4RVadXIihWlyuM9afoUww8Y5Agg431kGKiuL2/OMyP4mJ5wLz+pvN3t5ySClLOaVXJ+wekRQ==", + "license": "MIT" + }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "license": "0BSD" + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..af2047f --- /dev/null +++ b/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "motion": "^13.1.0" + } +} From b3fc247ee3dcf1aec7f3e2dd215d9ab7f21559d1 Mon Sep 17 00:00:00 2001 From: Aniketh Galla Date: Thu, 13 Aug 2026 23:22:31 +0530 Subject: [PATCH 2/5] Remove node_modules from git tracking Stopped tracking node_modules that were accidentally committed. node_modules is now ignored via .gitignore. --- .gitignore | 4 +- node_modules/.package-lock.json | 73 - node_modules/framer-motion/LICENSE.md | 21 - node_modules/framer-motion/README.md | 137 - node_modules/framer-motion/client/README.md | 1 - .../framer-motion/client/package.json | 6 - node_modules/framer-motion/dist/cjs/client.js | 370 - .../framer-motion/dist/cjs/client.js.map | 1 - node_modules/framer-motion/dist/cjs/debug.js | 13 - .../framer-motion/dist/cjs/debug.js.map | 1 - .../framer-motion/dist/cjs/dom-mini.js | 531 - .../framer-motion/dist/cjs/dom-mini.js.map | 1 - node_modules/framer-motion/dist/cjs/dom.js | 1354 -- .../framer-motion/dist/cjs/dom.js.map | 1 - .../dist/cjs/feature-bundle-BZV7Y7IM.js | 1660 -- .../dist/cjs/feature-bundle-BZV7Y7IM.js.map | 1 - .../framer-motion/dist/cjs/index-BuO47Yrm.js | 771 - .../dist/cjs/index-BuO47Yrm.js.map | 1 - node_modules/framer-motion/dist/cjs/index.js | 3823 ---- .../framer-motion/dist/cjs/index.js.map | 1 - node_modules/framer-motion/dist/cjs/m.js | 403 - node_modules/framer-motion/dist/cjs/m.js.map | 1 - node_modules/framer-motion/dist/cjs/mini.js | 153 - .../framer-motion/dist/cjs/mini.js.map | 1 - node_modules/framer-motion/dist/client.d.ts | 367 - node_modules/framer-motion/dist/debug.d.ts | 2 - node_modules/framer-motion/dist/dom-mini.d.ts | 69 - node_modules/framer-motion/dist/dom-mini.js | 1 - node_modules/framer-motion/dist/dom.d.ts | 304 - node_modules/framer-motion/dist/dom.js | 1 - .../dist/es/animation/animate/index.mjs | 58 - .../dist/es/animation/animate/index.mjs.map | 1 - .../es/animation/animate/resolve-subjects.mjs | 23 - .../animate/resolve-subjects.mjs.map | 1 - .../dist/es/animation/animate/sequence.mjs | 36 - .../es/animation/animate/sequence.mjs.map | 1 - .../dist/es/animation/animate/subject.mjs | 54 - .../dist/es/animation/animate/subject.mjs.map | 1 - .../animators/waapi/animate-elements.mjs | 110 - .../animators/waapi/animate-elements.mjs.map | 1 - .../animators/waapi/animate-sequence.mjs | 14 - .../animators/waapi/animate-sequence.mjs.map | 1 - .../animators/waapi/animate-style.mjs | 13 - .../animators/waapi/animate-style.mjs.map | 1 - .../es/animation/hooks/animation-controls.mjs | 80 - .../hooks/animation-controls.mjs.map | 1 - .../es/animation/hooks/use-animate-style.mjs | 19 - .../animation/hooks/use-animate-style.mjs.map | 1 - .../dist/es/animation/hooks/use-animate.mjs | 25 - .../es/animation/hooks/use-animate.mjs.map | 1 - .../es/animation/hooks/use-animated-state.mjs | 64 - .../hooks/use-animated-state.mjs.map | 1 - .../dist/es/animation/hooks/use-animation.mjs | 43 - .../es/animation/hooks/use-animation.mjs.map | 1 - .../es/animation/optimized-appear/handoff.mjs | 39 - .../optimized-appear/handoff.mjs.map | 1 - .../es/animation/optimized-appear/start.mjs | 170 - .../animation/optimized-appear/start.mjs.map | 1 - .../animation/optimized-appear/store-id.mjs | 9 - .../optimized-appear/store-id.mjs.map | 1 - .../es/animation/optimized-appear/store.mjs | 5 - .../animation/optimized-appear/store.mjs.map | 1 - .../dist/es/animation/sequence/create.mjs | 308 - .../dist/es/animation/sequence/create.mjs.map | 1 - .../sequence/utils/calc-repeat-duration.mjs | 6 - .../utils/calc-repeat-duration.mjs.map | 1 - .../es/animation/sequence/utils/calc-time.mjs | 24 - .../sequence/utils/calc-time.mjs.map | 1 - .../dist/es/animation/sequence/utils/edit.mjs | 31 - .../es/animation/sequence/utils/edit.mjs.map | 1 - .../sequence/utils/normalize-times.mjs | 18 - .../sequence/utils/normalize-times.mjs.map | 1 - .../dist/es/animation/sequence/utils/sort.mjs | 15 - .../es/animation/sequence/utils/sort.mjs.map | 1 - .../animation/utils/create-visual-element.mjs | 41 - .../utils/create-visual-element.mjs.map | 1 - .../es/animation/utils/is-dom-keyframes.mjs | 6 - .../animation/utils/is-dom-keyframes.mjs.map | 1 - node_modules/framer-motion/dist/es/client.mjs | 2 - .../framer-motion/dist/es/client.mjs.map | 1 - .../components/AnimatePresence/PopChild.mjs | 118 - .../AnimatePresence/PopChild.mjs.map | 1 - .../AnimatePresence/PresenceChild.mjs | 77 - .../AnimatePresence/PresenceChild.mjs.map | 1 - .../es/components/AnimatePresence/index.mjs | 181 - .../components/AnimatePresence/index.mjs.map | 1 - .../AnimatePresence/use-presence-data.mjs | 11 - .../AnimatePresence/use-presence-data.mjs.map | 1 - .../AnimatePresence/use-presence.mjs | 72 - .../AnimatePresence/use-presence.mjs.map | 1 - .../es/components/AnimatePresence/utils.mjs | 15 - .../components/AnimatePresence/utils.mjs.map | 1 - .../es/components/AnimateSharedLayout.mjs | 17 - .../es/components/AnimateSharedLayout.mjs.map | 1 - .../dist/es/components/LayoutGroup/index.mjs | 33 - .../es/components/LayoutGroup/index.mjs.map | 1 - .../dist/es/components/LazyMotion/index.mjs | 69 - .../es/components/LazyMotion/index.mjs.map | 1 - .../dist/es/components/MotionConfig/index.mjs | 52 - .../es/components/MotionConfig/index.mjs.map | 1 - .../dist/es/components/Reorder/Group.mjs | 88 - .../dist/es/components/Reorder/Group.mjs.map | 1 - .../dist/es/components/Reorder/Item.mjs | 48 - .../dist/es/components/Reorder/Item.mjs.map | 1 - .../dist/es/components/Reorder/namespace.mjs | 3 - .../es/components/Reorder/namespace.mjs.map | 1 - .../components/Reorder/utils/auto-scroll.mjs | 124 - .../Reorder/utils/auto-scroll.mjs.map | 1 - .../Reorder/utils/check-reorder.mjs | 95 - .../Reorder/utils/check-reorder.mjs.map | 1 - .../components/Reorder/utils/detect-axis.mjs | 17 - .../Reorder/utils/detect-axis.mjs.map | 1 - .../context/DeprecatedLayoutGroupContext.mjs | 12 - .../DeprecatedLayoutGroupContext.mjs.map | 1 - .../dist/es/context/LayoutGroupContext.mjs | 7 - .../es/context/LayoutGroupContext.mjs.map | 1 - .../dist/es/context/LazyContext.mjs | 7 - .../dist/es/context/LazyContext.mjs.map | 1 - .../dist/es/context/MotionConfigContext.mjs | 14 - .../es/context/MotionConfigContext.mjs.map | 1 - .../dist/es/context/MotionContext/create.mjs | 15 - .../es/context/MotionContext/create.mjs.map | 1 - .../dist/es/context/MotionContext/index.mjs | 7 - .../es/context/MotionContext/index.mjs.map | 1 - .../dist/es/context/MotionContext/utils.mjs | 17 - .../es/context/MotionContext/utils.mjs.map | 1 - .../dist/es/context/PresenceContext.mjs | 11 - .../dist/es/context/PresenceContext.mjs.map | 1 - .../dist/es/context/ReorderContext.mjs | 7 - .../dist/es/context/ReorderContext.mjs.map | 1 - .../es/context/SwitchLayoutGroupContext.mjs | 10 - .../context/SwitchLayoutGroupContext.mjs.map | 1 - node_modules/framer-motion/dist/es/debug.mjs | 2 - .../framer-motion/dist/es/debug.mjs.map | 1 - .../framer-motion/dist/es/dom-mini.mjs | 3 - .../framer-motion/dist/es/dom-mini.mjs.map | 1 - node_modules/framer-motion/dist/es/dom.mjs | 10 - .../framer-motion/dist/es/dom.mjs.map | 1 - .../dist/es/events/add-pointer-event.mjs | 9 - .../dist/es/events/add-pointer-event.mjs.map | 1 - .../dist/es/events/event-info.mjs | 14 - .../dist/es/events/event-info.mjs.map | 1 - .../dist/es/events/use-dom-event.mjs | 36 - .../dist/es/events/use-dom-event.mjs.map | 1 - .../drag/VisualElementDragControls.mjs | 573 - .../drag/VisualElementDragControls.mjs.map | 1 - .../dist/es/gestures/drag/index.mjs | 51 - .../dist/es/gestures/drag/index.mjs.map | 1 - .../es/gestures/drag/use-drag-controls.mjs | 117 - .../gestures/drag/use-drag-controls.mjs.map | 1 - .../es/gestures/drag/utils/constraints.mjs | 128 - .../gestures/drag/utils/constraints.mjs.map | 1 - .../framer-motion/dist/es/gestures/focus.mjs | 41 - .../dist/es/gestures/focus.mjs.map | 1 - .../framer-motion/dist/es/gestures/hover.mjs | 29 - .../dist/es/gestures/hover.mjs.map | 1 - .../dist/es/gestures/pan/PanSession.mjs | 283 - .../dist/es/gestures/pan/PanSession.mjs.map | 1 - .../dist/es/gestures/pan/index.mjs | 50 - .../dist/es/gestures/pan/index.mjs.map | 1 - .../framer-motion/dist/es/gestures/press.mjs | 36 - .../dist/es/gestures/press.mjs.map | 1 - node_modules/framer-motion/dist/es/index.mjs | 79 - .../framer-motion/dist/es/index.mjs.map | 1 - node_modules/framer-motion/dist/es/m.mjs | 3 - node_modules/framer-motion/dist/es/m.mjs.map | 1 - node_modules/framer-motion/dist/es/mini.mjs | 2 - .../framer-motion/dist/es/mini.mjs.map | 1 - .../es/motion/features/animation/exit.mjs | 70 - .../es/motion/features/animation/exit.mjs.map | 1 - .../es/motion/features/animation/index.mjs | 39 - .../motion/features/animation/index.mjs.map | 1 - .../dist/es/motion/features/animations.mjs | 14 - .../es/motion/features/animations.mjs.map | 1 - .../dist/es/motion/features/definitions.mjs | 49 - .../es/motion/features/definitions.mjs.map | 1 - .../dist/es/motion/features/drag.mjs | 18 - .../dist/es/motion/features/drag.mjs.map | 1 - .../dist/es/motion/features/gestures.mjs | 22 - .../dist/es/motion/features/gestures.mjs.map | 1 - .../dist/es/motion/features/layout.mjs | 12 - .../dist/es/motion/features/layout.mjs.map | 1 - .../motion/features/layout/MeasureLayout.mjs | 136 - .../features/layout/MeasureLayout.mjs.map | 1 - .../dist/es/motion/features/load-features.mjs | 16 - .../es/motion/features/load-features.mjs.map | 1 - .../es/motion/features/viewport/index.mjs | 77 - .../es/motion/features/viewport/index.mjs.map | 1 - .../es/motion/features/viewport/observers.mjs | 50 - .../features/viewport/observers.mjs.map | 1 - .../framer-motion/dist/es/motion/index.mjs | 113 - .../dist/es/motion/index.mjs.map | 1 - .../es/motion/utils/is-motion-component.mjs | 13 - .../motion/utils/is-motion-component.mjs.map | 1 - .../dist/es/motion/utils/symbol.mjs | 4 - .../dist/es/motion/utils/symbol.mjs.map | 1 - .../motion/utils/unwrap-motion-component.mjs | 18 - .../utils/unwrap-motion-component.mjs.map | 1 - .../dist/es/motion/utils/use-motion-ref.mjs | 52 - .../es/motion/utils/use-motion-ref.mjs.map | 1 - .../es/motion/utils/use-visual-element.mjs | 166 - .../motion/utils/use-visual-element.mjs.map | 1 - .../dist/es/motion/utils/use-visual-state.mjs | 78 - .../es/motion/utils/use-visual-state.mjs.map | 1 - .../dist/es/motion/utils/valid-prop.mjs | 59 - .../dist/es/motion/utils/valid-prop.mjs.map | 1 - .../framer-motion/dist/es/projection.mjs | 2 - .../framer-motion/dist/es/projection.mjs.map | 1 - .../use-instant-layout-transition.mjs | 15 - .../use-instant-layout-transition.mjs.map | 1 - .../es/projection/use-reset-projection.mjs | 15 - .../projection/use-reset-projection.mjs.map | 1 - .../es/render/components/create-proxy.mjs | 46 - .../es/render/components/create-proxy.mjs.map | 1 - .../dist/es/render/components/m/create.mjs | 8 - .../es/render/components/m/create.mjs.map | 1 - .../dist/es/render/components/m/elements.mjs | 228 - .../es/render/components/m/elements.mjs.map | 1 - .../dist/es/render/components/m/proxy.mjs | 6 - .../dist/es/render/components/m/proxy.mjs.map | 1 - .../es/render/components/motion/create.mjs | 10 - .../render/components/motion/create.mjs.map | 1 - .../es/render/components/motion/elements.mjs | 195 - .../render/components/motion/elements.mjs.map | 1 - .../components/motion/feature-bundle.mjs | 14 - .../components/motion/feature-bundle.mjs.map | 1 - .../es/render/components/motion/proxy.mjs | 8 - .../es/render/components/motion/proxy.mjs.map | 1 - .../es/render/dom/create-visual-element.mjs | 18 - .../render/dom/create-visual-element.mjs.map | 1 - .../dist/es/render/dom/features-animation.mjs | 16 - .../es/render/dom/features-animation.mjs.map | 1 - .../dist/es/render/dom/features-max.mjs | 16 - .../dist/es/render/dom/features-max.mjs.map | 1 - .../dist/es/render/dom/features-min.mjs | 14 - .../dist/es/render/dom/features-min.mjs.map | 1 - .../es/render/dom/scroll/attach-animation.mjs | 38 - .../dom/scroll/attach-animation.mjs.map | 1 - .../es/render/dom/scroll/attach-function.mjs | 25 - .../render/dom/scroll/attach-function.mjs.map | 1 - .../dist/es/render/dom/scroll/index.mjs | 15 - .../dist/es/render/dom/scroll/index.mjs.map | 1 - .../dist/es/render/dom/scroll/info.mjs | 56 - .../dist/es/render/dom/scroll/info.mjs.map | 1 - .../es/render/dom/scroll/offsets/edge.mjs | 46 - .../es/render/dom/scroll/offsets/edge.mjs.map | 1 - .../es/render/dom/scroll/offsets/index.mjs | 60 - .../render/dom/scroll/offsets/index.mjs.map | 1 - .../es/render/dom/scroll/offsets/inset.mjs | 48 - .../render/dom/scroll/offsets/inset.mjs.map | 1 - .../es/render/dom/scroll/offsets/offset.mjs | 36 - .../render/dom/scroll/offsets/offset.mjs.map | 1 - .../es/render/dom/scroll/offsets/presets.mjs | 21 - .../render/dom/scroll/offsets/presets.mjs.map | 1 - .../render/dom/scroll/on-scroll-handler.mjs | 55 - .../dom/scroll/on-scroll-handler.mjs.map | 1 - .../dist/es/render/dom/scroll/track.mjs | 115 - .../dist/es/render/dom/scroll/track.mjs.map | 1 - .../scroll/utils/can-use-native-timeline.mjs | 10 - .../utils/can-use-native-timeline.mjs.map | 1 - .../render/dom/scroll/utils/get-timeline.mjs | 62 - .../dom/scroll/utils/get-timeline.mjs.map | 1 - .../dom/scroll/utils/is-element-tracking.mjs | 10 - .../scroll/utils/is-element-tracking.mjs.map | 1 - .../dom/scroll/utils/offset-to-range.mjs | 73 - .../dom/scroll/utils/offset-to-range.mjs.map | 1 - .../dist/es/render/dom/use-render.mjs | 28 - .../dist/es/render/dom/use-render.mjs.map | 1 - .../dist/es/render/dom/utils/filter-props.mjs | 37 - .../es/render/dom/utils/filter-props.mjs.map | 1 - .../es/render/dom/utils/is-svg-component.mjs | 31 - .../render/dom/utils/is-svg-component.mjs.map | 1 - .../dist/es/render/dom/viewport/index.mjs | 44 - .../dist/es/render/dom/viewport/index.mjs.map | 1 - .../es/render/html/use-html-visual-state.mjs | 12 - .../render/html/use-html-visual-state.mjs.map | 1 - .../dist/es/render/html/use-props.mjs | 57 - .../dist/es/render/html/use-props.mjs.map | 1 - .../render/html/utils/create-render-state.mjs | 9 - .../html/utils/create-render-state.mjs.map | 1 - .../dist/es/render/svg/lowercase-elements.mjs | 34 - .../es/render/svg/lowercase-elements.mjs.map | 1 - .../dist/es/render/svg/use-props.mjs | 25 - .../dist/es/render/svg/use-props.mjs.map | 1 - .../es/render/svg/use-svg-visual-state.mjs | 12 - .../render/svg/use-svg-visual-state.mjs.map | 1 - .../render/svg/utils/create-render-state.mjs | 9 - .../svg/utils/create-render-state.mjs.map | 1 - .../framer-motion/dist/es/utils/distance.mjs | 10 - .../dist/es/utils/distance.mjs.map | 1 - .../dist/es/utils/get-context-window.mjs | 7 - .../dist/es/utils/get-context-window.mjs.map | 1 - .../dist/es/utils/is-browser.mjs | 4 - .../dist/es/utils/is-browser.mjs.map | 1 - .../dist/es/utils/is-ref-object.mjs | 8 - .../dist/es/utils/is-ref-object.mjs.map | 1 - .../use-reduced-motion-config.mjs | 21 - .../use-reduced-motion-config.mjs.map | 1 - .../reduced-motion/use-reduced-motion.mjs | 48 - .../reduced-motion/use-reduced-motion.mjs.map | 1 - .../es/utils/transform-rotated-parent.mjs | 72 - .../es/utils/transform-rotated-parent.mjs.map | 1 - .../dist/es/utils/transform-viewbox-point.mjs | 63 - .../es/utils/transform-viewbox-point.mjs.map | 1 - .../dist/es/utils/use-animation-frame.mjs | 23 - .../dist/es/utils/use-animation-frame.mjs.map | 1 - .../dist/es/utils/use-composed-ref.mjs | 61 - .../dist/es/utils/use-composed-ref.mjs.map | 1 - .../dist/es/utils/use-constant.mjs | 20 - .../dist/es/utils/use-constant.mjs.map | 1 - .../framer-motion/dist/es/utils/use-cycle.mjs | 49 - .../dist/es/utils/use-cycle.mjs.map | 1 - .../dist/es/utils/use-force-update.mjs | 21 - .../dist/es/utils/use-force-update.mjs.map | 1 - .../dist/es/utils/use-in-view.mjs | 25 - .../dist/es/utils/use-in-view.mjs.map | 1 - .../dist/es/utils/use-instant-transition.mjs | 43 - .../es/utils/use-instant-transition.mjs.map | 1 - .../dist/es/utils/use-is-mounted.mjs | 17 - .../dist/es/utils/use-is-mounted.mjs.map | 1 - .../dist/es/utils/use-isomorphic-effect.mjs | 8 - .../es/utils/use-isomorphic-effect.mjs.map | 1 - .../dist/es/utils/use-motion-value-event.mjs | 15 - .../es/utils/use-motion-value-event.mjs.map | 1 - .../dist/es/utils/use-page-in-view.mjs | 20 - .../dist/es/utils/use-page-in-view.mjs.map | 1 - .../dist/es/utils/use-unmount-effect.mjs | 9 - .../dist/es/utils/use-unmount-effect.mjs.map | 1 - .../es/value/scroll/use-element-scroll.mjs | 15 - .../value/scroll/use-element-scroll.mjs.map | 1 - .../es/value/scroll/use-viewport-scroll.mjs | 15 - .../value/scroll/use-viewport-scroll.mjs.map | 1 - .../dist/es/value/use-combine-values.mjs | 39 - .../dist/es/value/use-combine-values.mjs.map | 1 - .../dist/es/value/use-computed.mjs | 21 - .../dist/es/value/use-computed.mjs.map | 1 - .../dist/es/value/use-follow-value.mjs | 23 - .../dist/es/value/use-follow-value.mjs.map | 1 - .../dist/es/value/use-inverted-scale.mjs | 54 - .../dist/es/value/use-inverted-scale.mjs.map | 1 - .../dist/es/value/use-motion-template.mjs | 47 - .../dist/es/value/use-motion-template.mjs.map | 1 - .../dist/es/value/use-motion-value.mjs | 40 - .../dist/es/value/use-motion-value.mjs.map | 1 - .../dist/es/value/use-scroll.mjs | 119 - .../dist/es/value/use-scroll.mjs.map | 1 - .../dist/es/value/use-spring.mjs | 9 - .../dist/es/value/use-spring.mjs.map | 1 - .../framer-motion/dist/es/value/use-time.mjs | 12 - .../dist/es/value/use-time.mjs.map | 1 - .../dist/es/value/use-transform.mjs | 70 - .../dist/es/value/use-transform.mjs.map | 1 - .../dist/es/value/use-velocity.mjs | 37 - .../dist/es/value/use-velocity.mjs.map | 1 - .../use-will-change/WillChangeMotionValue.mjs | 20 - .../WillChangeMotionValue.mjs.map | 1 - .../dist/es/value/use-will-change/index.mjs | 10 - .../es/value/use-will-change/index.mjs.map | 1 - .../framer-motion/dist/framer-motion.dev.js | 17543 ---------------- .../framer-motion/dist/framer-motion.js | 1 - node_modules/framer-motion/dist/index.d.ts | 1740 -- node_modules/framer-motion/dist/m.d.ts | 412 - node_modules/framer-motion/dist/mini.d.ts | 6 - node_modules/framer-motion/dist/mini.js | 1 - .../framer-motion/dist/projection.d.ts | 1 - .../framer-motion/dist/size-rollup-animate.js | 2 - .../dist/size-rollup-animate.js.map | 1 - .../dist/size-rollup-dom-animation-assets.js | 1 - .../dist/size-rollup-dom-animation-m.js | 1 - .../dist/size-rollup-dom-animation.js | 1 - .../dist/size-rollup-dom-max-assets.js | 1 - .../framer-motion/dist/size-rollup-dom-max.js | 1 - .../framer-motion/dist/size-rollup-m.js | 2 - .../framer-motion/dist/size-rollup-m.js.map | 1 - .../framer-motion/dist/size-rollup-motion.js | 2 - .../dist/size-rollup-motion.js.map | 1 - .../framer-motion/dist/size-rollup-scroll.js | 2 - .../dist/size-rollup-scroll.js.map | 1 - .../dist/size-rollup-waapi-animate.js | 2 - .../dist/size-rollup-waapi-animate.js.map | 1 - node_modules/framer-motion/dom/README.md | 1 - .../framer-motion/dom/mini/package.json | 6 - node_modules/framer-motion/dom/package.json | 6 - node_modules/framer-motion/m/package.json | 6 - node_modules/framer-motion/mini/package.json | 6 - node_modules/framer-motion/package.json | 144 - node_modules/motion-dom/LICENSE.md | 21 - node_modules/motion-dom/dist/cjs/index.js | 11036 ---------- node_modules/motion-dom/dist/cjs/index.js.map | 1 - .../animation/AsyncMotionValueAnimation.mjs | 199 - .../AsyncMotionValueAnimation.mjs.map | 1 - .../dist/es/animation/GroupAnimation.mjs | 82 - .../dist/es/animation/GroupAnimation.mjs.map | 1 - .../es/animation/GroupAnimationWithThen.mjs | 10 - .../animation/GroupAnimationWithThen.mjs.map | 1 - .../dist/es/animation/JSAnimation.mjs | 387 - .../dist/es/animation/JSAnimation.mjs.map | 1 - .../dist/es/animation/NativeAnimation.mjs | 179 - .../dist/es/animation/NativeAnimation.mjs.map | 1 - .../es/animation/NativeAnimationExtended.mjs | 88 - .../animation/NativeAnimationExtended.mjs.map | 1 - .../es/animation/NativeAnimationWrapper.mjs | 15 - .../animation/NativeAnimationWrapper.mjs.map | 1 - .../es/animation/animate/single-value.mjs | 12 - .../es/animation/animate/single-value.mjs.map | 1 - .../dist/es/animation/drivers/frame.mjs | 18 - .../dist/es/animation/drivers/frame.mjs.map | 1 - .../dist/es/animation/generators/inertia.mjs | 88 - .../es/animation/generators/inertia.mjs.map | 1 - .../es/animation/generators/keyframes.mjs | 50 - .../es/animation/generators/keyframes.mjs.map | 1 - .../dist/es/animation/generators/spring.mjs | 329 - .../es/animation/generators/spring.mjs.map | 1 - .../generators/utils/calc-duration.mjs | 18 - .../generators/utils/calc-duration.mjs.map | 1 - .../utils/create-generator-easing.mjs | 20 - .../utils/create-generator-easing.mjs.map | 1 - .../generators/utils/is-generator.mjs | 6 - .../generators/utils/is-generator.mjs.map | 1 - .../animation/generators/utils/velocity.mjs | 10 - .../generators/utils/velocity.mjs.map | 1 - .../es/animation/interfaces/motion-value.mjs | 105 - .../animation/interfaces/motion-value.mjs.map | 1 - .../interfaces/visual-element-target.mjs | 108 - .../interfaces/visual-element-target.mjs.map | 1 - .../interfaces/visual-element-variant.mjs | 60 - .../interfaces/visual-element-variant.mjs.map | 1 - .../animation/interfaces/visual-element.mjs | 27 - .../interfaces/visual-element.mjs.map | 1 - .../keyframes/DOMKeyframesResolver.mjs | 142 - .../keyframes/DOMKeyframesResolver.mjs.map | 1 - .../animation/keyframes/KeyframesResolver.mjs | 148 - .../keyframes/KeyframesResolver.mjs.map | 1 - .../dist/es/animation/keyframes/get-final.mjs | 12 - .../es/animation/keyframes/get-final.mjs.map | 1 - .../animation/keyframes/offsets/default.mjs | 10 - .../keyframes/offsets/default.mjs.map | 1 - .../es/animation/keyframes/offsets/fill.mjs | 13 - .../animation/keyframes/offsets/fill.mjs.map | 1 - .../es/animation/keyframes/offsets/time.mjs | 6 - .../animation/keyframes/offsets/time.mjs.map | 1 - .../keyframes/utils/apply-px-defaults.mjs | 12 - .../keyframes/utils/apply-px-defaults.mjs.map | 1 - .../keyframes/utils/fill-wildcards.mjs | 8 - .../keyframes/utils/fill-wildcards.mjs.map | 1 - .../es/animation/keyframes/utils/is-none.mjs | 16 - .../animation/keyframes/utils/is-none.mjs.map | 1 - .../keyframes/utils/make-none-animatable.mjs | 31 - .../utils/make-none-animatable.mjs.map | 1 - .../keyframes/utils/unit-conversion.mjs | 47 - .../keyframes/utils/unit-conversion.mjs.map | 1 - .../es/animation/optimized-appear/data-id.mjs | 7 - .../optimized-appear/data-id.mjs.map | 1 - .../optimized-appear/get-appear-id.mjs | 8 - .../optimized-appear/get-appear-id.mjs.map | 1 - .../dist/es/animation/utils/WithPromise.mjs | 27 - .../es/animation/utils/WithPromise.mjs.map | 1 - .../es/animation/utils/active-animations.mjs | 13 - .../animation/utils/active-animations.mjs.map | 1 - .../dist/es/animation/utils/arc.mjs | 188 - .../dist/es/animation/utils/arc.mjs.map | 1 - .../es/animation/utils/calc-child-stagger.mjs | 16 - .../utils/calc-child-stagger.mjs.map | 1 - .../dist/es/animation/utils/can-animate.mjs | 44 - .../es/animation/utils/can-animate.mjs.map | 1 - .../utils/css-variables-conversion.mjs | 42 - .../utils/css-variables-conversion.mjs.map | 1 - .../animation/utils/default-transitions.mjs | 41 - .../utils/default-transitions.mjs.map | 1 - .../animation/utils/get-value-transition.mjs | 14 - .../utils/get-value-transition.mjs.map | 1 - .../dist/es/animation/utils/is-animatable.mjs | 31 - .../es/animation/utils/is-animatable.mjs.map | 1 - .../es/animation/utils/is-css-variable.mjs | 27 - .../animation/utils/is-css-variable.mjs.map | 1 - .../animation/utils/is-transition-defined.mjs | 27 - .../utils/is-transition-defined.mjs.map | 1 - .../utils/make-animation-instant.mjs | 7 - .../utils/make-animation-instant.mjs.map | 1 - .../utils/replace-transition-type.mjs | 19 - .../utils/replace-transition-type.mjs.map | 1 - .../es/animation/utils/resolve-transition.mjs | 15 - .../utils/resolve-transition.mjs.map | 1 - .../animation/waapi/easing/cubic-bezier.mjs | 4 - .../waapi/easing/cubic-bezier.mjs.map | 1 - .../animation/waapi/easing/is-supported.mjs | 15 - .../waapi/easing/is-supported.mjs.map | 1 - .../es/animation/waapi/easing/map-easing.mjs | 29 - .../animation/waapi/easing/map-easing.mjs.map | 1 - .../es/animation/waapi/easing/supported.mjs | 16 - .../animation/waapi/easing/supported.mjs.map | 1 - .../animation/waapi/start-waapi-animation.mjs | 29 - .../waapi/start-waapi-animation.mjs.map | 1 - .../waapi/supports/partial-keyframes.mjs | 14 - .../waapi/supports/partial-keyframes.mjs.map | 1 - .../es/animation/waapi/supports/waapi.mjs | 55 - .../es/animation/waapi/supports/waapi.mjs.map | 1 - .../waapi/utils/accelerated-values.mjs | 13 - .../waapi/utils/accelerated-values.mjs.map | 1 - .../animation/waapi/utils/apply-generator.mjs | 16 - .../waapi/utils/apply-generator.mjs.map | 1 - .../waapi/utils/is-browser-color.mjs | 13 - .../waapi/utils/is-browser-color.mjs.map | 1 - .../dist/es/animation/waapi/utils/linear.mjs | 13 - .../es/animation/waapi/utils/linear.mjs.map | 1 - .../es/animation/waapi/utils/px-values.mjs | 59 - .../animation/waapi/utils/px-values.mjs.map | 1 - .../waapi/utils/unsupported-easing.mjs | 19 - .../waapi/utils/unsupported-easing.mjs.map | 1 - .../dist/es/effects/MotionValueState.mjs | 43 - .../dist/es/effects/MotionValueState.mjs.map | 1 - .../motion-dom/dist/es/effects/attr/index.mjs | 42 - .../dist/es/effects/attr/index.mjs.map | 1 - .../motion-dom/dist/es/effects/prop/index.mjs | 10 - .../dist/es/effects/prop/index.mjs.map | 1 - .../dist/es/effects/style/index.mjs | 53 - .../dist/es/effects/style/index.mjs.map | 1 - .../dist/es/effects/style/transform.mjs | 48 - .../dist/es/effects/style/transform.mjs.map | 1 - .../motion-dom/dist/es/effects/svg/index.mjs | 45 - .../dist/es/effects/svg/index.mjs.map | 1 - .../es/effects/utils/create-dom-effect.mjs | 19 - .../effects/utils/create-dom-effect.mjs.map | 1 - .../dist/es/effects/utils/create-effect.mjs | 22 - .../es/effects/utils/create-effect.mjs.map | 1 - .../dist/es/events/add-dom-event.mjs | 7 - .../dist/es/events/add-dom-event.mjs.map | 1 - .../motion-dom/dist/es/frameloop/batcher.mjs | 73 - .../dist/es/frameloop/batcher.mjs.map | 1 - .../motion-dom/dist/es/frameloop/frame.mjs | 7 - .../dist/es/frameloop/frame.mjs.map | 1 - .../dist/es/frameloop/index-legacy.mjs | 21 - .../dist/es/frameloop/index-legacy.mjs.map | 1 - .../dist/es/frameloop/microtask.mjs | 7 - .../dist/es/frameloop/microtask.mjs.map | 1 - .../motion-dom/dist/es/frameloop/order.mjs | 13 - .../dist/es/frameloop/order.mjs.map | 1 - .../dist/es/frameloop/render-step.mjs | 84 - .../dist/es/frameloop/render-step.mjs.map | 1 - .../dist/es/frameloop/sync-time.mjs | 32 - .../dist/es/frameloop/sync-time.mjs.map | 1 - .../dist/es/gestures/drag/state/is-active.mjs | 10 - .../es/gestures/drag/state/is-active.mjs.map | 1 - .../es/gestures/drag/state/set-active.mjs | 29 - .../es/gestures/drag/state/set-active.mjs.map | 1 - .../motion-dom/dist/es/gestures/hover.mjs | 70 - .../motion-dom/dist/es/gestures/hover.mjs.map | 1 - .../dist/es/gestures/press/index.mjs | 97 - .../dist/es/gestures/press/index.mjs.map | 1 - .../press/utils/is-keyboard-accessible.mjs | 34 - .../utils/is-keyboard-accessible.mjs.map | 1 - .../dist/es/gestures/press/utils/keyboard.mjs | 39 - .../es/gestures/press/utils/keyboard.mjs.map | 1 - .../dist/es/gestures/press/utils/state.mjs | 4 - .../es/gestures/press/utils/state.mjs.map | 1 - .../es/gestures/utils/is-node-or-child.mjs | 21 - .../gestures/utils/is-node-or-child.mjs.map | 1 - .../es/gestures/utils/is-primary-pointer.mjs | 19 - .../gestures/utils/is-primary-pointer.mjs.map | 1 - .../dist/es/gestures/utils/setup.mjs | 16 - .../dist/es/gestures/utils/setup.mjs.map | 1 - node_modules/motion-dom/dist/es/index.mjs | 176 - node_modules/motion-dom/dist/es/index.mjs.map | 1 - .../dist/es/layout/LayoutAnimationBuilder.mjs | 354 - .../es/layout/LayoutAnimationBuilder.mjs.map | 1 - .../es/projection/animation/mix-values.mjs | 67 - .../projection/animation/mix-values.mjs.map | 1 - .../es/projection/geometry/conversion.mjs | 34 - .../es/projection/geometry/conversion.mjs.map | 1 - .../dist/es/projection/geometry/copy.mjs | 32 - .../dist/es/projection/geometry/copy.mjs.map | 1 - .../es/projection/geometry/delta-apply.mjs | 125 - .../projection/geometry/delta-apply.mjs.map | 1 - .../es/projection/geometry/delta-calc.mjs | 59 - .../es/projection/geometry/delta-calc.mjs.map | 1 - .../es/projection/geometry/delta-remove.mjs | 55 - .../projection/geometry/delta-remove.mjs.map | 1 - .../dist/es/projection/geometry/models.mjs | 18 - .../es/projection/geometry/models.mjs.map | 1 - .../dist/es/projection/geometry/utils.mjs | 32 - .../dist/es/projection/geometry/utils.mjs.map | 1 - .../node/DocumentProjectionNode.mjs | 14 - .../node/DocumentProjectionNode.mjs.map | 1 - .../es/projection/node/HTMLProjectionNode.mjs | 28 - .../node/HTMLProjectionNode.mjs.map | 1 - .../node/create-projection-node.mjs | 1695 -- .../node/create-projection-node.mjs.map | 1 - .../dist/es/projection/node/group.mjs | 25 - .../dist/es/projection/node/group.mjs.map | 1 - .../dist/es/projection/node/state.mjs | 20 - .../dist/es/projection/node/state.mjs.map | 1 - .../dist/es/projection/shared/stack.mjs | 85 - .../dist/es/projection/shared/stack.mjs.map | 1 - .../projection/styles/scale-border-radius.mjs | 42 - .../styles/scale-border-radius.mjs.map | 1 - .../es/projection/styles/scale-box-shadow.mjs | 36 - .../styles/scale-box-shadow.mjs.map | 1 - .../es/projection/styles/scale-correction.mjs | 27 - .../styles/scale-correction.mjs.map | 1 - .../dist/es/projection/styles/transform.mjs | 53 - .../es/projection/styles/transform.mjs.map | 1 - .../es/projection/utils/compare-by-depth.mjs | 4 - .../projection/utils/compare-by-depth.mjs.map | 1 - .../dist/es/projection/utils/each-axis.mjs | 6 - .../es/projection/utils/each-axis.mjs.map | 1 - .../dist/es/projection/utils/flat-tree.mjs | 25 - .../es/projection/utils/flat-tree.mjs.map | 1 - .../es/projection/utils/has-transform.mjs | 27 - .../es/projection/utils/has-transform.mjs.map | 1 - .../dist/es/projection/utils/measure.mjs | 18 - .../dist/es/projection/utils/measure.mjs.map | 1 - .../motion-dom/dist/es/render/Feature.mjs | 15 - .../motion-dom/dist/es/render/Feature.mjs.map | 1 - .../dist/es/render/VisualElement.mjs | 560 - .../dist/es/render/VisualElement.mjs.map | 1 - .../dist/es/render/dom/DOMVisualElement.mjs | 43 - .../es/render/dom/DOMVisualElement.mjs.map | 1 - .../dist/es/render/dom/is-css-var.mjs | 4 - .../dist/es/render/dom/is-css-var.mjs.map | 1 - .../dist/es/render/dom/parse-transform.mjs | 84 - .../es/render/dom/parse-transform.mjs.map | 1 - .../dist/es/render/dom/style-computed.mjs | 11 - .../dist/es/render/dom/style-computed.mjs.map | 1 - .../dist/es/render/dom/style-set.mjs | 10 - .../dist/es/render/dom/style-set.mjs.map | 1 - .../es/render/dom/utils/camel-to-dash.mjs | 6 - .../es/render/dom/utils/camel-to-dash.mjs.map | 1 - .../dist/es/render/html/HTMLVisualElement.mjs | 55 - .../es/render/html/HTMLVisualElement.mjs.map | 1 - .../es/render/html/utils/build-styles.mjs | 66 - .../es/render/html/utils/build-styles.mjs.map | 1 - .../es/render/html/utils/build-transform.mjs | 72 - .../render/html/utils/build-transform.mjs.map | 1 - .../dist/es/render/html/utils/render.mjs | 18 - .../dist/es/render/html/utils/render.mjs.map | 1 - .../html/utils/scrape-motion-values.mjs | 22 - .../html/utils/scrape-motion-values.mjs.map | 1 - .../es/render/object/ObjectVisualElement.mjs | 42 - .../render/object/ObjectVisualElement.mjs.map | 1 - .../motion-dom/dist/es/render/store.mjs | 4 - .../motion-dom/dist/es/render/store.mjs.map | 1 - .../dist/es/render/svg/SVGVisualElement.mjs | 52 - .../es/render/svg/SVGVisualElement.mjs.map | 1 - .../dist/es/render/svg/utils/build-attrs.mjs | 64 - .../es/render/svg/utils/build-attrs.mjs.map | 1 - .../es/render/svg/utils/camel-case-attrs.mjs | 31 - .../render/svg/utils/camel-case-attrs.mjs.map | 1 - .../dist/es/render/svg/utils/is-svg-tag.mjs | 4 - .../es/render/svg/utils/is-svg-tag.mjs.map | 1 - .../dist/es/render/svg/utils/path.mjs | 32 - .../dist/es/render/svg/utils/path.mjs.map | 1 - .../dist/es/render/svg/utils/render.mjs | 13 - .../dist/es/render/svg/utils/render.mjs.map | 1 - .../render/svg/utils/scrape-motion-values.mjs | 20 - .../svg/utils/scrape-motion-values.mjs.map | 1 - .../dist/es/render/utils/animation-state.mjs | 387 - .../es/render/utils/animation-state.mjs.map | 1 - .../es/render/utils/get-variant-context.mjs | 33 - .../render/utils/get-variant-context.mjs.map | 1 - .../es/render/utils/is-animation-controls.mjs | 8 - .../utils/is-animation-controls.mjs.map | 1 - .../render/utils/is-controlling-variants.mjs | 14 - .../utils/is-controlling-variants.mjs.map | 1 - .../render/utils/is-forced-motion-value.mjs | 13 - .../utils/is-forced-motion-value.mjs.map | 1 - .../es/render/utils/is-keyframes-target.mjs | 6 - .../render/utils/is-keyframes-target.mjs.map | 1 - .../dist/es/render/utils/is-variant-label.mjs | 9 - .../es/render/utils/is-variant-label.mjs.map | 1 - .../dist/es/render/utils/keys-position.mjs | 14 - .../es/render/utils/keys-position.mjs.map | 1 - .../dist/es/render/utils/keys-transform.mjs | 36 - .../es/render/utils/keys-transform.mjs.map | 1 - .../dist/es/render/utils/motion-values.mjs | 56 - .../es/render/utils/motion-values.mjs.map | 1 - .../es/render/utils/reduced-motion/index.mjs | 20 - .../render/utils/reduced-motion/index.mjs.map | 1 - .../es/render/utils/reduced-motion/state.mjs | 6 - .../render/utils/reduced-motion/state.mjs.map | 1 - .../render/utils/resolve-dynamic-variants.mjs | 9 - .../utils/resolve-dynamic-variants.mjs.map | 1 - .../dist/es/render/utils/resolve-variants.mjs | 37 - .../es/render/utils/resolve-variants.mjs.map | 1 - .../dist/es/render/utils/setters.mjs | 32 - .../dist/es/render/utils/setters.mjs.map | 1 - .../dist/es/render/utils/shallow-compare.mjs | 15 - .../es/render/utils/shallow-compare.mjs.map | 1 - .../dist/es/render/utils/variant-props.mjs | 13 - .../es/render/utils/variant-props.mjs.map | 1 - .../dist/es/resize/handle-element.mjs | 64 - .../dist/es/resize/handle-element.mjs.map | 1 - .../dist/es/resize/handle-window.mjs | 32 - .../dist/es/resize/handle-window.mjs.map | 1 - .../motion-dom/dist/es/resize/index.mjs | 9 - .../motion-dom/dist/es/resize/index.mjs.map | 1 - .../motion-dom/dist/es/scroll/observe.mjs | 19 - .../motion-dom/dist/es/scroll/observe.mjs.map | 1 - .../motion-dom/dist/es/stats/buffer.mjs | 7 - .../motion-dom/dist/es/stats/buffer.mjs.map | 1 - .../motion-dom/dist/es/stats/index.mjs | 29 - .../motion-dom/dist/es/stats/index.mjs.map | 1 - .../dist/es/utils/border-radius.mjs | 15 - .../dist/es/utils/border-radius.mjs.map | 1 - .../motion-dom/dist/es/utils/delay.mjs | 25 - .../motion-dom/dist/es/utils/delay.mjs.map | 1 - .../motion-dom/dist/es/utils/interpolate.mjs | 75 - .../dist/es/utils/interpolate.mjs.map | 1 - .../dist/es/utils/is-html-element.mjs | 14 - .../dist/es/utils/is-html-element.mjs.map | 1 - .../dist/es/utils/is-svg-element.mjs | 12 - .../dist/es/utils/is-svg-element.mjs.map | 1 - .../dist/es/utils/is-svg-svg-element.mjs | 12 - .../dist/es/utils/is-svg-svg-element.mjs.map | 1 - .../motion-dom/dist/es/utils/mix/color.mjs | 48 - .../dist/es/utils/mix/color.mjs.map | 1 - .../motion-dom/dist/es/utils/mix/complex.mjs | 93 - .../dist/es/utils/mix/complex.mjs.map | 1 - .../dist/es/utils/mix/immediate.mjs | 6 - .../dist/es/utils/mix/immediate.mjs.map | 1 - .../motion-dom/dist/es/utils/mix/index.mjs | 15 - .../dist/es/utils/mix/index.mjs.map | 1 - .../motion-dom/dist/es/utils/mix/number.mjs | 27 - .../dist/es/utils/mix/number.mjs.map | 1 - .../dist/es/utils/mix/visibility.mjs | 17 - .../dist/es/utils/mix/visibility.mjs.map | 1 - .../dist/es/utils/resolve-elements.mjs | 21 - .../dist/es/utils/resolve-elements.mjs.map | 1 - .../motion-dom/dist/es/utils/stagger.mjs | 27 - .../motion-dom/dist/es/utils/stagger.mjs.map | 1 - .../dist/es/utils/supports/flags.mjs | 8 - .../dist/es/utils/supports/flags.mjs.map | 1 - .../dist/es/utils/supports/linear-easing.mjs | 16 - .../es/utils/supports/linear-easing.mjs.map | 1 - .../dist/es/utils/supports/memo.mjs | 10 - .../dist/es/utils/supports/memo.mjs.map | 1 - .../es/utils/supports/scroll-timeline.mjs | 7 - .../es/utils/supports/scroll-timeline.mjs.map | 1 - .../motion-dom/dist/es/utils/transform.mjs | 15 - .../dist/es/utils/transform.mjs.map | 1 - .../motion-dom/dist/es/value/follow-value.mjs | 124 - .../dist/es/value/follow-value.mjs.map | 1 - .../motion-dom/dist/es/value/index.mjs | 324 - .../motion-dom/dist/es/value/index.mjs.map | 1 - .../motion-dom/dist/es/value/map-value.mjs | 47 - .../dist/es/value/map-value.mjs.map | 1 - .../motion-dom/dist/es/value/spring-value.mjs | 36 - .../dist/es/value/spring-value.mjs.map | 1 - .../dist/es/value/subscribe-value.mjs | 14 - .../dist/es/value/subscribe-value.mjs.map | 1 - .../dist/es/value/transform-value.mjs | 36 - .../dist/es/value/transform-value.mjs.map | 1 - .../motion-dom/dist/es/value/types/auto.mjs | 10 - .../dist/es/value/types/auto.mjs.map | 1 - .../dist/es/value/types/color/hex.mjs | 41 - .../dist/es/value/types/color/hex.mjs.map | 1 - .../es/value/types/color/hsla-to-rgba.mjs | 43 - .../es/value/types/color/hsla-to-rgba.mjs.map | 1 - .../dist/es/value/types/color/hsla.mjs | 23 - .../dist/es/value/types/color/hsla.mjs.map | 1 - .../dist/es/value/types/color/index.mjs | 33 - .../dist/es/value/types/color/index.mjs.map | 1 - .../dist/es/value/types/color/rgba.mjs | 26 - .../dist/es/value/types/color/rgba.mjs.map | 1 - .../dist/es/value/types/color/utils.mjs | 30 - .../dist/es/value/types/color/utils.mjs.map | 1 - .../dist/es/value/types/complex/filter.mjs | 31 - .../es/value/types/complex/filter.mjs.map | 1 - .../dist/es/value/types/complex/index.mjs | 114 - .../dist/es/value/types/complex/index.mjs.map | 1 - .../dist/es/value/types/complex/mask.mjs | 13 - .../dist/es/value/types/complex/mask.mjs.map | 1 - .../dist/es/value/types/dimensions.mjs | 16 - .../dist/es/value/types/dimensions.mjs.map | 1 - .../motion-dom/dist/es/value/types/int.mjs | 9 - .../dist/es/value/types/int.mjs.map | 1 - .../dist/es/value/types/maps/defaults.mjs | 34 - .../dist/es/value/types/maps/defaults.mjs.map | 1 - .../dist/es/value/types/maps/number.mjs | 71 - .../dist/es/value/types/maps/number.mjs.map | 1 - .../dist/es/value/types/maps/transform.mjs | 38 - .../es/value/types/maps/transform.mjs.map | 1 - .../dist/es/value/types/numbers/index.mjs | 18 - .../dist/es/value/types/numbers/index.mjs.map | 1 - .../dist/es/value/types/numbers/units.mjs | 19 - .../dist/es/value/types/numbers/units.mjs.map | 1 - .../motion-dom/dist/es/value/types/test.mjs | 7 - .../dist/es/value/types/test.mjs.map | 1 - .../es/value/types/utils/animatable-none.mjs | 18 - .../value/types/utils/animatable-none.mjs.map | 1 - .../dist/es/value/types/utils/color-regex.mjs | 4 - .../es/value/types/utils/color-regex.mjs.map | 1 - .../dist/es/value/types/utils/find.mjs | 16 - .../dist/es/value/types/utils/find.mjs.map | 1 - .../dist/es/value/types/utils/float-regex.mjs | 4 - .../es/value/types/utils/float-regex.mjs.map | 1 - .../dist/es/value/types/utils/get-as-type.mjs | 11 - .../es/value/types/utils/get-as-type.mjs.map | 1 - .../dist/es/value/types/utils/is-nullish.mjs | 6 - .../es/value/types/utils/is-nullish.mjs.map | 1 - .../dist/es/value/types/utils/sanitize.mjs | 6 - .../es/value/types/utils/sanitize.mjs.map | 1 - .../value/types/utils/single-color-regex.mjs | 4 - .../types/utils/single-color-regex.mjs.map | 1 - .../dist/es/value/utils/is-motion-value.mjs | 4 - .../es/value/utils/is-motion-value.mjs.map | 1 - .../es/value/utils/resolve-motion-value.mjs | 11 - .../value/utils/resolve-motion-value.mjs.map | 1 - .../es/value/will-change/add-will-change.mjs | 21 - .../value/will-change/add-will-change.mjs.map | 1 - .../dist/es/value/will-change/is.mjs | 8 - .../dist/es/value/will-change/is.mjs.map | 1 - .../motion-dom/dist/es/view/index.mjs | 175 - .../motion-dom/dist/es/view/index.mjs.map | 1 - .../motion-dom/dist/es/view/queue.mjs | 59 - .../motion-dom/dist/es/view/queue.mjs.map | 1 - .../motion-dom/dist/es/view/start.mjs | 700 - .../motion-dom/dist/es/view/start.mjs.map | 1 - .../dist/es/view/utils/assign-names.mjs | 146 - .../dist/es/view/utils/assign-names.mjs.map | 1 - .../dist/es/view/utils/choose-layer-type.mjs | 10 - .../es/view/utils/choose-layer-type.mjs.map | 1 - .../motion-dom/dist/es/view/utils/css.mjs | 33 - .../motion-dom/dist/es/view/utils/css.mjs.map | 1 - .../dist/es/view/utils/get-layer-info.mjs | 11 - .../dist/es/view/utils/get-layer-info.mjs.map | 1 - .../es/view/utils/get-view-animations.mjs | 11 - .../es/view/utils/get-view-animations.mjs.map | 1 - .../dist/es/view/utils/has-target.mjs | 6 - .../dist/es/view/utils/has-target.mjs.map | 1 - node_modules/motion-dom/dist/index.d.ts | 5293 ----- .../motion-dom/dist/motion-dom.dev.js | 11036 ---------- node_modules/motion-dom/dist/motion-dom.js | 1 - .../dist/size-rollup-motion-value.js | 2 - .../dist/size-rollup-motion-value.js.map | 1 - .../dist/size-rollup-style-effect.js | 2 - .../dist/size-rollup-style-effect.js.map | 1 - node_modules/motion-dom/package.json | 40 - node_modules/motion-utils/LICENSE.md | 21 - node_modules/motion-utils/dist/cjs/index.js | 345 - .../motion-utils/dist/cjs/index.js.map | 1 - node_modules/motion-utils/dist/es/array.mjs | 22 - .../motion-utils/dist/es/array.mjs.map | 1 - node_modules/motion-utils/dist/es/clamp.mjs | 10 - .../motion-utils/dist/es/clamp.mjs.map | 1 - .../dist/es/easing/anticipate.mjs | 10 - .../dist/es/easing/anticipate.mjs.map | 1 - .../motion-utils/dist/es/easing/back.mjs | 10 - .../motion-utils/dist/es/easing/back.mjs.map | 1 - .../motion-utils/dist/es/easing/circ.mjs | 9 - .../motion-utils/dist/es/easing/circ.mjs.map | 1 - .../dist/es/easing/cubic-bezier.mjs | 53 - .../dist/es/easing/cubic-bezier.mjs.map | 1 - .../motion-utils/dist/es/easing/ease.mjs | 8 - .../motion-utils/dist/es/easing/ease.mjs.map | 1 - .../dist/es/easing/modifiers/mirror.mjs | 7 - .../dist/es/easing/modifiers/mirror.mjs.map | 1 - .../dist/es/easing/modifiers/reverse.mjs | 7 - .../dist/es/easing/modifiers/reverse.mjs.map | 1 - .../motion-utils/dist/es/easing/steps.mjs | 17 - .../motion-utils/dist/es/easing/steps.mjs.map | 1 - .../easing/utils/get-easing-for-segment.mjs | 10 - .../utils/get-easing-for-segment.mjs.map | 1 - .../es/easing/utils/is-bezier-definition.mjs | 5 - .../easing/utils/is-bezier-definition.mjs.map | 1 - .../dist/es/easing/utils/is-easing-array.mjs | 7 - .../es/easing/utils/is-easing-array.mjs.map | 1 - .../motion-utils/dist/es/easing/utils/map.mjs | 42 - .../dist/es/easing/utils/map.mjs.map | 1 - node_modules/motion-utils/dist/es/errors.mjs | 20 - .../motion-utils/dist/es/errors.mjs.map | 1 - .../dist/es/format-error-message.mjs | 8 - .../dist/es/format-error-message.mjs.map | 1 - .../motion-utils/dist/es/global-config.mjs | 4 - .../dist/es/global-config.mjs.map | 1 - node_modules/motion-utils/dist/es/index.mjs | 29 - .../motion-utils/dist/es/index.mjs.map | 1 - .../dist/es/is-numerical-string.mjs | 7 - .../dist/es/is-numerical-string.mjs.map | 1 - .../motion-utils/dist/es/is-object.mjs | 4 - .../motion-utils/dist/es/is-object.mjs.map | 1 - .../dist/es/is-zero-value-string.mjs | 7 - .../dist/es/is-zero-value-string.mjs.map | 1 - node_modules/motion-utils/dist/es/memo.mjs | 12 - .../motion-utils/dist/es/memo.mjs.map | 1 - node_modules/motion-utils/dist/es/noop.mjs | 5 - .../motion-utils/dist/es/noop.mjs.map | 1 - node_modules/motion-utils/dist/es/pipe.mjs | 11 - .../motion-utils/dist/es/pipe.mjs.map | 1 - .../motion-utils/dist/es/progress.mjs | 15 - .../motion-utils/dist/es/progress.mjs.map | 1 - .../dist/es/subscription-manager.mjs | 41 - .../dist/es/subscription-manager.mjs.map | 1 - .../motion-utils/dist/es/time-conversion.mjs | 13 - .../dist/es/time-conversion.mjs.map | 1 - .../dist/es/velocity-per-second.mjs | 8 - .../dist/es/velocity-per-second.mjs.map | 1 - .../motion-utils/dist/es/warn-once.mjs | 15 - .../motion-utils/dist/es/warn-once.mjs.map | 1 - node_modules/motion-utils/dist/es/wrap.mjs | 7 - .../motion-utils/dist/es/wrap.mjs.map | 1 - node_modules/motion-utils/dist/index.d.ts | 147 - .../motion-utils/dist/motion-utils.dev.js | 348 - .../motion-utils/dist/motion-utils.js | 1 - node_modules/motion-utils/package.json | 26 - node_modules/motion/LICENSE.md | 21 - node_modules/motion/README.md | 141 - node_modules/motion/dist/cjs/debug.js | 14 - node_modules/motion/dist/cjs/index.js | 14 - node_modules/motion/dist/cjs/mini.js | 14 - node_modules/motion/dist/cjs/react-client.js | 14 - node_modules/motion/dist/cjs/react-m.js | 14 - node_modules/motion/dist/cjs/react-mini.js | 14 - node_modules/motion/dist/cjs/react.js | 46 - node_modules/motion/dist/debug.d.ts | 1 - node_modules/motion/dist/es/debug.mjs | 1 - node_modules/motion/dist/es/index.mjs | 1 - node_modules/motion/dist/es/mini.mjs | 1 - node_modules/motion/dist/es/react-client.mjs | 1 - node_modules/motion/dist/es/react-m.mjs | 1 - node_modules/motion/dist/es/react-mini.mjs | 1 - node_modules/motion/dist/es/react.mjs | 17 - node_modules/motion/dist/index.d.ts | 1 - node_modules/motion/dist/mini.d.ts | 1 - node_modules/motion/dist/motion.dev.js | 12706 ----------- node_modules/motion/dist/motion.js | 1 - node_modules/motion/dist/react-client.d.ts | 1 - node_modules/motion/dist/react-m.d.ts | 1 - node_modules/motion/dist/react-mini.d.ts | 1 - node_modules/motion/dist/react.d.ts | 7 - node_modules/motion/mini/package.json | 6 - node_modules/motion/package.json | 95 - node_modules/motion/react-client/package.json | 6 - node_modules/motion/react-m/package.json | 6 - node_modules/motion/react/package.json | 6 - node_modules/tslib/CopyrightNotice.txt | 15 - node_modules/tslib/LICENSE.txt | 12 - node_modules/tslib/README.md | 164 - node_modules/tslib/SECURITY.md | 41 - node_modules/tslib/modules/index.d.ts | 38 - node_modules/tslib/modules/index.js | 70 - node_modules/tslib/modules/package.json | 3 - node_modules/tslib/package.json | 47 - node_modules/tslib/tslib.d.ts | 460 - node_modules/tslib/tslib.es6.html | 1 - node_modules/tslib/tslib.es6.js | 402 - node_modules/tslib/tslib.es6.mjs | 401 - node_modules/tslib/tslib.html | 1 - node_modules/tslib/tslib.js | 484 - 948 files changed, 3 insertions(+), 93861 deletions(-) delete mode 100644 node_modules/.package-lock.json delete mode 100644 node_modules/framer-motion/LICENSE.md delete mode 100644 node_modules/framer-motion/README.md delete mode 100644 node_modules/framer-motion/client/README.md delete mode 100644 node_modules/framer-motion/client/package.json delete mode 100644 node_modules/framer-motion/dist/cjs/client.js delete mode 100644 node_modules/framer-motion/dist/cjs/client.js.map delete mode 100644 node_modules/framer-motion/dist/cjs/debug.js delete mode 100644 node_modules/framer-motion/dist/cjs/debug.js.map delete mode 100644 node_modules/framer-motion/dist/cjs/dom-mini.js delete mode 100644 node_modules/framer-motion/dist/cjs/dom-mini.js.map delete mode 100644 node_modules/framer-motion/dist/cjs/dom.js delete mode 100644 node_modules/framer-motion/dist/cjs/dom.js.map delete mode 100644 node_modules/framer-motion/dist/cjs/feature-bundle-BZV7Y7IM.js delete mode 100644 node_modules/framer-motion/dist/cjs/feature-bundle-BZV7Y7IM.js.map delete mode 100644 node_modules/framer-motion/dist/cjs/index-BuO47Yrm.js delete mode 100644 node_modules/framer-motion/dist/cjs/index-BuO47Yrm.js.map delete mode 100644 node_modules/framer-motion/dist/cjs/index.js delete mode 100644 node_modules/framer-motion/dist/cjs/index.js.map delete mode 100644 node_modules/framer-motion/dist/cjs/m.js delete mode 100644 node_modules/framer-motion/dist/cjs/m.js.map delete mode 100644 node_modules/framer-motion/dist/cjs/mini.js delete mode 100644 node_modules/framer-motion/dist/cjs/mini.js.map delete mode 100644 node_modules/framer-motion/dist/client.d.ts delete mode 100644 node_modules/framer-motion/dist/debug.d.ts delete mode 100644 node_modules/framer-motion/dist/dom-mini.d.ts delete mode 100644 node_modules/framer-motion/dist/dom-mini.js delete mode 100644 node_modules/framer-motion/dist/dom.d.ts delete mode 100644 node_modules/framer-motion/dist/dom.js delete mode 100644 node_modules/framer-motion/dist/es/animation/animate/index.mjs delete mode 100644 node_modules/framer-motion/dist/es/animation/animate/index.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/animation/animate/resolve-subjects.mjs delete mode 100644 node_modules/framer-motion/dist/es/animation/animate/resolve-subjects.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/animation/animate/sequence.mjs delete mode 100644 node_modules/framer-motion/dist/es/animation/animate/sequence.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/animation/animate/subject.mjs delete mode 100644 node_modules/framer-motion/dist/es/animation/animate/subject.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/animation/animators/waapi/animate-elements.mjs delete mode 100644 node_modules/framer-motion/dist/es/animation/animators/waapi/animate-elements.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/animation/animators/waapi/animate-sequence.mjs delete mode 100644 node_modules/framer-motion/dist/es/animation/animators/waapi/animate-sequence.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/animation/animators/waapi/animate-style.mjs delete mode 100644 node_modules/framer-motion/dist/es/animation/animators/waapi/animate-style.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/animation/hooks/animation-controls.mjs delete mode 100644 node_modules/framer-motion/dist/es/animation/hooks/animation-controls.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/animation/hooks/use-animate-style.mjs delete mode 100644 node_modules/framer-motion/dist/es/animation/hooks/use-animate-style.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/animation/hooks/use-animate.mjs delete mode 100644 node_modules/framer-motion/dist/es/animation/hooks/use-animate.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/animation/hooks/use-animated-state.mjs delete mode 100644 node_modules/framer-motion/dist/es/animation/hooks/use-animated-state.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/animation/hooks/use-animation.mjs delete mode 100644 node_modules/framer-motion/dist/es/animation/hooks/use-animation.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/animation/optimized-appear/handoff.mjs delete mode 100644 node_modules/framer-motion/dist/es/animation/optimized-appear/handoff.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/animation/optimized-appear/start.mjs delete mode 100644 node_modules/framer-motion/dist/es/animation/optimized-appear/start.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/animation/optimized-appear/store-id.mjs delete mode 100644 node_modules/framer-motion/dist/es/animation/optimized-appear/store-id.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/animation/optimized-appear/store.mjs delete mode 100644 node_modules/framer-motion/dist/es/animation/optimized-appear/store.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/animation/sequence/create.mjs delete mode 100644 node_modules/framer-motion/dist/es/animation/sequence/create.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/animation/sequence/utils/calc-repeat-duration.mjs delete mode 100644 node_modules/framer-motion/dist/es/animation/sequence/utils/calc-repeat-duration.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/animation/sequence/utils/calc-time.mjs delete mode 100644 node_modules/framer-motion/dist/es/animation/sequence/utils/calc-time.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/animation/sequence/utils/edit.mjs delete mode 100644 node_modules/framer-motion/dist/es/animation/sequence/utils/edit.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/animation/sequence/utils/normalize-times.mjs delete mode 100644 node_modules/framer-motion/dist/es/animation/sequence/utils/normalize-times.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/animation/sequence/utils/sort.mjs delete mode 100644 node_modules/framer-motion/dist/es/animation/sequence/utils/sort.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/animation/utils/create-visual-element.mjs delete mode 100644 node_modules/framer-motion/dist/es/animation/utils/create-visual-element.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/animation/utils/is-dom-keyframes.mjs delete mode 100644 node_modules/framer-motion/dist/es/animation/utils/is-dom-keyframes.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/client.mjs delete mode 100644 node_modules/framer-motion/dist/es/client.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.mjs delete mode 100644 node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs delete mode 100644 node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs delete mode 100644 node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence-data.mjs delete mode 100644 node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence-data.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.mjs delete mode 100644 node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/components/AnimatePresence/utils.mjs delete mode 100644 node_modules/framer-motion/dist/es/components/AnimatePresence/utils.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/components/AnimateSharedLayout.mjs delete mode 100644 node_modules/framer-motion/dist/es/components/AnimateSharedLayout.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/components/LayoutGroup/index.mjs delete mode 100644 node_modules/framer-motion/dist/es/components/LayoutGroup/index.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/components/LazyMotion/index.mjs delete mode 100644 node_modules/framer-motion/dist/es/components/LazyMotion/index.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/components/MotionConfig/index.mjs delete mode 100644 node_modules/framer-motion/dist/es/components/MotionConfig/index.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/components/Reorder/Group.mjs delete mode 100644 node_modules/framer-motion/dist/es/components/Reorder/Group.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/components/Reorder/Item.mjs delete mode 100644 node_modules/framer-motion/dist/es/components/Reorder/Item.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/components/Reorder/namespace.mjs delete mode 100644 node_modules/framer-motion/dist/es/components/Reorder/namespace.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/components/Reorder/utils/auto-scroll.mjs delete mode 100644 node_modules/framer-motion/dist/es/components/Reorder/utils/auto-scroll.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/components/Reorder/utils/check-reorder.mjs delete mode 100644 node_modules/framer-motion/dist/es/components/Reorder/utils/check-reorder.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/components/Reorder/utils/detect-axis.mjs delete mode 100644 node_modules/framer-motion/dist/es/components/Reorder/utils/detect-axis.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/context/DeprecatedLayoutGroupContext.mjs delete mode 100644 node_modules/framer-motion/dist/es/context/DeprecatedLayoutGroupContext.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/context/LayoutGroupContext.mjs delete mode 100644 node_modules/framer-motion/dist/es/context/LayoutGroupContext.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/context/LazyContext.mjs delete mode 100644 node_modules/framer-motion/dist/es/context/LazyContext.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/context/MotionConfigContext.mjs delete mode 100644 node_modules/framer-motion/dist/es/context/MotionConfigContext.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/context/MotionContext/create.mjs delete mode 100644 node_modules/framer-motion/dist/es/context/MotionContext/create.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/context/MotionContext/index.mjs delete mode 100644 node_modules/framer-motion/dist/es/context/MotionContext/index.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/context/MotionContext/utils.mjs delete mode 100644 node_modules/framer-motion/dist/es/context/MotionContext/utils.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/context/PresenceContext.mjs delete mode 100644 node_modules/framer-motion/dist/es/context/PresenceContext.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/context/ReorderContext.mjs delete mode 100644 node_modules/framer-motion/dist/es/context/ReorderContext.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/context/SwitchLayoutGroupContext.mjs delete mode 100644 node_modules/framer-motion/dist/es/context/SwitchLayoutGroupContext.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/debug.mjs delete mode 100644 node_modules/framer-motion/dist/es/debug.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/dom-mini.mjs delete mode 100644 node_modules/framer-motion/dist/es/dom-mini.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/dom.mjs delete mode 100644 node_modules/framer-motion/dist/es/dom.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/events/add-pointer-event.mjs delete mode 100644 node_modules/framer-motion/dist/es/events/add-pointer-event.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/events/event-info.mjs delete mode 100644 node_modules/framer-motion/dist/es/events/event-info.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/events/use-dom-event.mjs delete mode 100644 node_modules/framer-motion/dist/es/events/use-dom-event.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs delete mode 100644 node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/gestures/drag/index.mjs delete mode 100644 node_modules/framer-motion/dist/es/gestures/drag/index.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/gestures/drag/use-drag-controls.mjs delete mode 100644 node_modules/framer-motion/dist/es/gestures/drag/use-drag-controls.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.mjs delete mode 100644 node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/gestures/focus.mjs delete mode 100644 node_modules/framer-motion/dist/es/gestures/focus.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/gestures/hover.mjs delete mode 100644 node_modules/framer-motion/dist/es/gestures/hover.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/gestures/pan/PanSession.mjs delete mode 100644 node_modules/framer-motion/dist/es/gestures/pan/PanSession.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/gestures/pan/index.mjs delete mode 100644 node_modules/framer-motion/dist/es/gestures/pan/index.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/gestures/press.mjs delete mode 100644 node_modules/framer-motion/dist/es/gestures/press.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/index.mjs delete mode 100644 node_modules/framer-motion/dist/es/index.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/m.mjs delete mode 100644 node_modules/framer-motion/dist/es/m.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/mini.mjs delete mode 100644 node_modules/framer-motion/dist/es/mini.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/motion/features/animation/exit.mjs delete mode 100644 node_modules/framer-motion/dist/es/motion/features/animation/exit.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/motion/features/animation/index.mjs delete mode 100644 node_modules/framer-motion/dist/es/motion/features/animation/index.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/motion/features/animations.mjs delete mode 100644 node_modules/framer-motion/dist/es/motion/features/animations.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/motion/features/definitions.mjs delete mode 100644 node_modules/framer-motion/dist/es/motion/features/definitions.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/motion/features/drag.mjs delete mode 100644 node_modules/framer-motion/dist/es/motion/features/drag.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/motion/features/gestures.mjs delete mode 100644 node_modules/framer-motion/dist/es/motion/features/gestures.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/motion/features/layout.mjs delete mode 100644 node_modules/framer-motion/dist/es/motion/features/layout.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.mjs delete mode 100644 node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/motion/features/load-features.mjs delete mode 100644 node_modules/framer-motion/dist/es/motion/features/load-features.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/motion/features/viewport/index.mjs delete mode 100644 node_modules/framer-motion/dist/es/motion/features/viewport/index.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/motion/features/viewport/observers.mjs delete mode 100644 node_modules/framer-motion/dist/es/motion/features/viewport/observers.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/motion/index.mjs delete mode 100644 node_modules/framer-motion/dist/es/motion/index.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/motion/utils/is-motion-component.mjs delete mode 100644 node_modules/framer-motion/dist/es/motion/utils/is-motion-component.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/motion/utils/symbol.mjs delete mode 100644 node_modules/framer-motion/dist/es/motion/utils/symbol.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/motion/utils/unwrap-motion-component.mjs delete mode 100644 node_modules/framer-motion/dist/es/motion/utils/unwrap-motion-component.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.mjs delete mode 100644 node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/motion/utils/use-visual-element.mjs delete mode 100644 node_modules/framer-motion/dist/es/motion/utils/use-visual-element.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/motion/utils/use-visual-state.mjs delete mode 100644 node_modules/framer-motion/dist/es/motion/utils/use-visual-state.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/motion/utils/valid-prop.mjs delete mode 100644 node_modules/framer-motion/dist/es/motion/utils/valid-prop.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/projection.mjs delete mode 100644 node_modules/framer-motion/dist/es/projection.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/projection/use-instant-layout-transition.mjs delete mode 100644 node_modules/framer-motion/dist/es/projection/use-instant-layout-transition.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/projection/use-reset-projection.mjs delete mode 100644 node_modules/framer-motion/dist/es/projection/use-reset-projection.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/render/components/create-proxy.mjs delete mode 100644 node_modules/framer-motion/dist/es/render/components/create-proxy.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/render/components/m/create.mjs delete mode 100644 node_modules/framer-motion/dist/es/render/components/m/create.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/render/components/m/elements.mjs delete mode 100644 node_modules/framer-motion/dist/es/render/components/m/elements.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/render/components/m/proxy.mjs delete mode 100644 node_modules/framer-motion/dist/es/render/components/m/proxy.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/render/components/motion/create.mjs delete mode 100644 node_modules/framer-motion/dist/es/render/components/motion/create.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/render/components/motion/elements.mjs delete mode 100644 node_modules/framer-motion/dist/es/render/components/motion/elements.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/render/components/motion/feature-bundle.mjs delete mode 100644 node_modules/framer-motion/dist/es/render/components/motion/feature-bundle.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/render/components/motion/proxy.mjs delete mode 100644 node_modules/framer-motion/dist/es/render/components/motion/proxy.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/render/dom/create-visual-element.mjs delete mode 100644 node_modules/framer-motion/dist/es/render/dom/create-visual-element.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/render/dom/features-animation.mjs delete mode 100644 node_modules/framer-motion/dist/es/render/dom/features-animation.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/render/dom/features-max.mjs delete mode 100644 node_modules/framer-motion/dist/es/render/dom/features-max.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/render/dom/features-min.mjs delete mode 100644 node_modules/framer-motion/dist/es/render/dom/features-min.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/render/dom/scroll/attach-animation.mjs delete mode 100644 node_modules/framer-motion/dist/es/render/dom/scroll/attach-animation.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/render/dom/scroll/attach-function.mjs delete mode 100644 node_modules/framer-motion/dist/es/render/dom/scroll/attach-function.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/render/dom/scroll/index.mjs delete mode 100644 node_modules/framer-motion/dist/es/render/dom/scroll/index.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/render/dom/scroll/info.mjs delete mode 100644 node_modules/framer-motion/dist/es/render/dom/scroll/info.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/render/dom/scroll/offsets/edge.mjs delete mode 100644 node_modules/framer-motion/dist/es/render/dom/scroll/offsets/edge.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/render/dom/scroll/offsets/index.mjs delete mode 100644 node_modules/framer-motion/dist/es/render/dom/scroll/offsets/index.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/render/dom/scroll/offsets/inset.mjs delete mode 100644 node_modules/framer-motion/dist/es/render/dom/scroll/offsets/inset.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/render/dom/scroll/offsets/offset.mjs delete mode 100644 node_modules/framer-motion/dist/es/render/dom/scroll/offsets/offset.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/render/dom/scroll/offsets/presets.mjs delete mode 100644 node_modules/framer-motion/dist/es/render/dom/scroll/offsets/presets.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/render/dom/scroll/on-scroll-handler.mjs delete mode 100644 node_modules/framer-motion/dist/es/render/dom/scroll/on-scroll-handler.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/render/dom/scroll/track.mjs delete mode 100644 node_modules/framer-motion/dist/es/render/dom/scroll/track.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/render/dom/scroll/utils/can-use-native-timeline.mjs delete mode 100644 node_modules/framer-motion/dist/es/render/dom/scroll/utils/can-use-native-timeline.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/render/dom/scroll/utils/get-timeline.mjs delete mode 100644 node_modules/framer-motion/dist/es/render/dom/scroll/utils/get-timeline.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/render/dom/scroll/utils/is-element-tracking.mjs delete mode 100644 node_modules/framer-motion/dist/es/render/dom/scroll/utils/is-element-tracking.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/render/dom/scroll/utils/offset-to-range.mjs delete mode 100644 node_modules/framer-motion/dist/es/render/dom/scroll/utils/offset-to-range.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/render/dom/use-render.mjs delete mode 100644 node_modules/framer-motion/dist/es/render/dom/use-render.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/render/dom/utils/filter-props.mjs delete mode 100644 node_modules/framer-motion/dist/es/render/dom/utils/filter-props.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/render/dom/utils/is-svg-component.mjs delete mode 100644 node_modules/framer-motion/dist/es/render/dom/utils/is-svg-component.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/render/dom/viewport/index.mjs delete mode 100644 node_modules/framer-motion/dist/es/render/dom/viewport/index.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/render/html/use-html-visual-state.mjs delete mode 100644 node_modules/framer-motion/dist/es/render/html/use-html-visual-state.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/render/html/use-props.mjs delete mode 100644 node_modules/framer-motion/dist/es/render/html/use-props.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/render/html/utils/create-render-state.mjs delete mode 100644 node_modules/framer-motion/dist/es/render/html/utils/create-render-state.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/render/svg/lowercase-elements.mjs delete mode 100644 node_modules/framer-motion/dist/es/render/svg/lowercase-elements.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/render/svg/use-props.mjs delete mode 100644 node_modules/framer-motion/dist/es/render/svg/use-props.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/render/svg/use-svg-visual-state.mjs delete mode 100644 node_modules/framer-motion/dist/es/render/svg/use-svg-visual-state.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.mjs delete mode 100644 node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/utils/distance.mjs delete mode 100644 node_modules/framer-motion/dist/es/utils/distance.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/utils/get-context-window.mjs delete mode 100644 node_modules/framer-motion/dist/es/utils/get-context-window.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/utils/is-browser.mjs delete mode 100644 node_modules/framer-motion/dist/es/utils/is-browser.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/utils/is-ref-object.mjs delete mode 100644 node_modules/framer-motion/dist/es/utils/is-ref-object.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion-config.mjs delete mode 100644 node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion-config.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.mjs delete mode 100644 node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/utils/transform-rotated-parent.mjs delete mode 100644 node_modules/framer-motion/dist/es/utils/transform-rotated-parent.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/utils/transform-viewbox-point.mjs delete mode 100644 node_modules/framer-motion/dist/es/utils/transform-viewbox-point.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/utils/use-animation-frame.mjs delete mode 100644 node_modules/framer-motion/dist/es/utils/use-animation-frame.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/utils/use-composed-ref.mjs delete mode 100644 node_modules/framer-motion/dist/es/utils/use-composed-ref.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/utils/use-constant.mjs delete mode 100644 node_modules/framer-motion/dist/es/utils/use-constant.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/utils/use-cycle.mjs delete mode 100644 node_modules/framer-motion/dist/es/utils/use-cycle.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/utils/use-force-update.mjs delete mode 100644 node_modules/framer-motion/dist/es/utils/use-force-update.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/utils/use-in-view.mjs delete mode 100644 node_modules/framer-motion/dist/es/utils/use-in-view.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/utils/use-instant-transition.mjs delete mode 100644 node_modules/framer-motion/dist/es/utils/use-instant-transition.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/utils/use-is-mounted.mjs delete mode 100644 node_modules/framer-motion/dist/es/utils/use-is-mounted.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.mjs delete mode 100644 node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/utils/use-motion-value-event.mjs delete mode 100644 node_modules/framer-motion/dist/es/utils/use-motion-value-event.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/utils/use-page-in-view.mjs delete mode 100644 node_modules/framer-motion/dist/es/utils/use-page-in-view.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/utils/use-unmount-effect.mjs delete mode 100644 node_modules/framer-motion/dist/es/utils/use-unmount-effect.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/value/scroll/use-element-scroll.mjs delete mode 100644 node_modules/framer-motion/dist/es/value/scroll/use-element-scroll.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/value/scroll/use-viewport-scroll.mjs delete mode 100644 node_modules/framer-motion/dist/es/value/scroll/use-viewport-scroll.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/value/use-combine-values.mjs delete mode 100644 node_modules/framer-motion/dist/es/value/use-combine-values.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/value/use-computed.mjs delete mode 100644 node_modules/framer-motion/dist/es/value/use-computed.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/value/use-follow-value.mjs delete mode 100644 node_modules/framer-motion/dist/es/value/use-follow-value.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/value/use-inverted-scale.mjs delete mode 100644 node_modules/framer-motion/dist/es/value/use-inverted-scale.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/value/use-motion-template.mjs delete mode 100644 node_modules/framer-motion/dist/es/value/use-motion-template.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/value/use-motion-value.mjs delete mode 100644 node_modules/framer-motion/dist/es/value/use-motion-value.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/value/use-scroll.mjs delete mode 100644 node_modules/framer-motion/dist/es/value/use-scroll.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/value/use-spring.mjs delete mode 100644 node_modules/framer-motion/dist/es/value/use-spring.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/value/use-time.mjs delete mode 100644 node_modules/framer-motion/dist/es/value/use-time.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/value/use-transform.mjs delete mode 100644 node_modules/framer-motion/dist/es/value/use-transform.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/value/use-velocity.mjs delete mode 100644 node_modules/framer-motion/dist/es/value/use-velocity.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/value/use-will-change/WillChangeMotionValue.mjs delete mode 100644 node_modules/framer-motion/dist/es/value/use-will-change/WillChangeMotionValue.mjs.map delete mode 100644 node_modules/framer-motion/dist/es/value/use-will-change/index.mjs delete mode 100644 node_modules/framer-motion/dist/es/value/use-will-change/index.mjs.map delete mode 100644 node_modules/framer-motion/dist/framer-motion.dev.js delete mode 100644 node_modules/framer-motion/dist/framer-motion.js delete mode 100644 node_modules/framer-motion/dist/index.d.ts delete mode 100644 node_modules/framer-motion/dist/m.d.ts delete mode 100644 node_modules/framer-motion/dist/mini.d.ts delete mode 100644 node_modules/framer-motion/dist/mini.js delete mode 100644 node_modules/framer-motion/dist/projection.d.ts delete mode 100644 node_modules/framer-motion/dist/size-rollup-animate.js delete mode 100644 node_modules/framer-motion/dist/size-rollup-animate.js.map delete mode 100644 node_modules/framer-motion/dist/size-rollup-dom-animation-assets.js delete mode 100644 node_modules/framer-motion/dist/size-rollup-dom-animation-m.js delete mode 100644 node_modules/framer-motion/dist/size-rollup-dom-animation.js delete mode 100644 node_modules/framer-motion/dist/size-rollup-dom-max-assets.js delete mode 100644 node_modules/framer-motion/dist/size-rollup-dom-max.js delete mode 100644 node_modules/framer-motion/dist/size-rollup-m.js delete mode 100644 node_modules/framer-motion/dist/size-rollup-m.js.map delete mode 100644 node_modules/framer-motion/dist/size-rollup-motion.js delete mode 100644 node_modules/framer-motion/dist/size-rollup-motion.js.map delete mode 100644 node_modules/framer-motion/dist/size-rollup-scroll.js delete mode 100644 node_modules/framer-motion/dist/size-rollup-scroll.js.map delete mode 100644 node_modules/framer-motion/dist/size-rollup-waapi-animate.js delete mode 100644 node_modules/framer-motion/dist/size-rollup-waapi-animate.js.map delete mode 100644 node_modules/framer-motion/dom/README.md delete mode 100644 node_modules/framer-motion/dom/mini/package.json delete mode 100644 node_modules/framer-motion/dom/package.json delete mode 100644 node_modules/framer-motion/m/package.json delete mode 100644 node_modules/framer-motion/mini/package.json delete mode 100644 node_modules/framer-motion/package.json delete mode 100644 node_modules/motion-dom/LICENSE.md delete mode 100644 node_modules/motion-dom/dist/cjs/index.js delete mode 100644 node_modules/motion-dom/dist/cjs/index.js.map delete mode 100644 node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.mjs delete mode 100644 node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/animation/GroupAnimation.mjs delete mode 100644 node_modules/motion-dom/dist/es/animation/GroupAnimation.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/animation/GroupAnimationWithThen.mjs delete mode 100644 node_modules/motion-dom/dist/es/animation/GroupAnimationWithThen.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/animation/JSAnimation.mjs delete mode 100644 node_modules/motion-dom/dist/es/animation/JSAnimation.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/animation/NativeAnimation.mjs delete mode 100644 node_modules/motion-dom/dist/es/animation/NativeAnimation.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/animation/NativeAnimationExtended.mjs delete mode 100644 node_modules/motion-dom/dist/es/animation/NativeAnimationExtended.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/animation/NativeAnimationWrapper.mjs delete mode 100644 node_modules/motion-dom/dist/es/animation/NativeAnimationWrapper.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/animation/animate/single-value.mjs delete mode 100644 node_modules/motion-dom/dist/es/animation/animate/single-value.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/animation/drivers/frame.mjs delete mode 100644 node_modules/motion-dom/dist/es/animation/drivers/frame.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/animation/generators/inertia.mjs delete mode 100644 node_modules/motion-dom/dist/es/animation/generators/inertia.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/animation/generators/keyframes.mjs delete mode 100644 node_modules/motion-dom/dist/es/animation/generators/keyframes.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/animation/generators/spring.mjs delete mode 100644 node_modules/motion-dom/dist/es/animation/generators/spring.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/animation/generators/utils/calc-duration.mjs delete mode 100644 node_modules/motion-dom/dist/es/animation/generators/utils/calc-duration.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.mjs delete mode 100644 node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/animation/generators/utils/is-generator.mjs delete mode 100644 node_modules/motion-dom/dist/es/animation/generators/utils/is-generator.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/animation/generators/utils/velocity.mjs delete mode 100644 node_modules/motion-dom/dist/es/animation/generators/utils/velocity.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/animation/interfaces/motion-value.mjs delete mode 100644 node_modules/motion-dom/dist/es/animation/interfaces/motion-value.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/animation/interfaces/visual-element-target.mjs delete mode 100644 node_modules/motion-dom/dist/es/animation/interfaces/visual-element-target.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/animation/interfaces/visual-element-variant.mjs delete mode 100644 node_modules/motion-dom/dist/es/animation/interfaces/visual-element-variant.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/animation/interfaces/visual-element.mjs delete mode 100644 node_modules/motion-dom/dist/es/animation/interfaces/visual-element.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.mjs delete mode 100644 node_modules/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/animation/keyframes/KeyframesResolver.mjs delete mode 100644 node_modules/motion-dom/dist/es/animation/keyframes/KeyframesResolver.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/animation/keyframes/get-final.mjs delete mode 100644 node_modules/motion-dom/dist/es/animation/keyframes/get-final.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/animation/keyframes/offsets/default.mjs delete mode 100644 node_modules/motion-dom/dist/es/animation/keyframes/offsets/default.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/animation/keyframes/offsets/fill.mjs delete mode 100644 node_modules/motion-dom/dist/es/animation/keyframes/offsets/fill.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/animation/keyframes/offsets/time.mjs delete mode 100644 node_modules/motion-dom/dist/es/animation/keyframes/offsets/time.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/animation/keyframes/utils/apply-px-defaults.mjs delete mode 100644 node_modules/motion-dom/dist/es/animation/keyframes/utils/apply-px-defaults.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.mjs delete mode 100644 node_modules/motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/animation/keyframes/utils/is-none.mjs delete mode 100644 node_modules/motion-dom/dist/es/animation/keyframes/utils/is-none.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/animation/keyframes/utils/make-none-animatable.mjs delete mode 100644 node_modules/motion-dom/dist/es/animation/keyframes/utils/make-none-animatable.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/animation/keyframes/utils/unit-conversion.mjs delete mode 100644 node_modules/motion-dom/dist/es/animation/keyframes/utils/unit-conversion.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/animation/optimized-appear/data-id.mjs delete mode 100644 node_modules/motion-dom/dist/es/animation/optimized-appear/data-id.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/animation/optimized-appear/get-appear-id.mjs delete mode 100644 node_modules/motion-dom/dist/es/animation/optimized-appear/get-appear-id.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/animation/utils/WithPromise.mjs delete mode 100644 node_modules/motion-dom/dist/es/animation/utils/WithPromise.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/animation/utils/active-animations.mjs delete mode 100644 node_modules/motion-dom/dist/es/animation/utils/active-animations.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/animation/utils/arc.mjs delete mode 100644 node_modules/motion-dom/dist/es/animation/utils/arc.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/animation/utils/calc-child-stagger.mjs delete mode 100644 node_modules/motion-dom/dist/es/animation/utils/calc-child-stagger.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/animation/utils/can-animate.mjs delete mode 100644 node_modules/motion-dom/dist/es/animation/utils/can-animate.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/animation/utils/css-variables-conversion.mjs delete mode 100644 node_modules/motion-dom/dist/es/animation/utils/css-variables-conversion.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/animation/utils/default-transitions.mjs delete mode 100644 node_modules/motion-dom/dist/es/animation/utils/default-transitions.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/animation/utils/get-value-transition.mjs delete mode 100644 node_modules/motion-dom/dist/es/animation/utils/get-value-transition.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/animation/utils/is-animatable.mjs delete mode 100644 node_modules/motion-dom/dist/es/animation/utils/is-animatable.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/animation/utils/is-css-variable.mjs delete mode 100644 node_modules/motion-dom/dist/es/animation/utils/is-css-variable.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/animation/utils/is-transition-defined.mjs delete mode 100644 node_modules/motion-dom/dist/es/animation/utils/is-transition-defined.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/animation/utils/make-animation-instant.mjs delete mode 100644 node_modules/motion-dom/dist/es/animation/utils/make-animation-instant.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/animation/utils/replace-transition-type.mjs delete mode 100644 node_modules/motion-dom/dist/es/animation/utils/replace-transition-type.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/animation/utils/resolve-transition.mjs delete mode 100644 node_modules/motion-dom/dist/es/animation/utils/resolve-transition.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/animation/waapi/easing/cubic-bezier.mjs delete mode 100644 node_modules/motion-dom/dist/es/animation/waapi/easing/cubic-bezier.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/animation/waapi/easing/is-supported.mjs delete mode 100644 node_modules/motion-dom/dist/es/animation/waapi/easing/is-supported.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/animation/waapi/easing/map-easing.mjs delete mode 100644 node_modules/motion-dom/dist/es/animation/waapi/easing/map-easing.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/animation/waapi/easing/supported.mjs delete mode 100644 node_modules/motion-dom/dist/es/animation/waapi/easing/supported.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/animation/waapi/start-waapi-animation.mjs delete mode 100644 node_modules/motion-dom/dist/es/animation/waapi/start-waapi-animation.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/animation/waapi/supports/partial-keyframes.mjs delete mode 100644 node_modules/motion-dom/dist/es/animation/waapi/supports/partial-keyframes.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/animation/waapi/supports/waapi.mjs delete mode 100644 node_modules/motion-dom/dist/es/animation/waapi/supports/waapi.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/animation/waapi/utils/accelerated-values.mjs delete mode 100644 node_modules/motion-dom/dist/es/animation/waapi/utils/accelerated-values.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/animation/waapi/utils/apply-generator.mjs delete mode 100644 node_modules/motion-dom/dist/es/animation/waapi/utils/apply-generator.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/animation/waapi/utils/is-browser-color.mjs delete mode 100644 node_modules/motion-dom/dist/es/animation/waapi/utils/is-browser-color.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/animation/waapi/utils/linear.mjs delete mode 100644 node_modules/motion-dom/dist/es/animation/waapi/utils/linear.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/animation/waapi/utils/px-values.mjs delete mode 100644 node_modules/motion-dom/dist/es/animation/waapi/utils/px-values.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/animation/waapi/utils/unsupported-easing.mjs delete mode 100644 node_modules/motion-dom/dist/es/animation/waapi/utils/unsupported-easing.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/effects/MotionValueState.mjs delete mode 100644 node_modules/motion-dom/dist/es/effects/MotionValueState.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/effects/attr/index.mjs delete mode 100644 node_modules/motion-dom/dist/es/effects/attr/index.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/effects/prop/index.mjs delete mode 100644 node_modules/motion-dom/dist/es/effects/prop/index.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/effects/style/index.mjs delete mode 100644 node_modules/motion-dom/dist/es/effects/style/index.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/effects/style/transform.mjs delete mode 100644 node_modules/motion-dom/dist/es/effects/style/transform.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/effects/svg/index.mjs delete mode 100644 node_modules/motion-dom/dist/es/effects/svg/index.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/effects/utils/create-dom-effect.mjs delete mode 100644 node_modules/motion-dom/dist/es/effects/utils/create-dom-effect.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/effects/utils/create-effect.mjs delete mode 100644 node_modules/motion-dom/dist/es/effects/utils/create-effect.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/events/add-dom-event.mjs delete mode 100644 node_modules/motion-dom/dist/es/events/add-dom-event.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/frameloop/batcher.mjs delete mode 100644 node_modules/motion-dom/dist/es/frameloop/batcher.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/frameloop/frame.mjs delete mode 100644 node_modules/motion-dom/dist/es/frameloop/frame.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/frameloop/index-legacy.mjs delete mode 100644 node_modules/motion-dom/dist/es/frameloop/index-legacy.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/frameloop/microtask.mjs delete mode 100644 node_modules/motion-dom/dist/es/frameloop/microtask.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/frameloop/order.mjs delete mode 100644 node_modules/motion-dom/dist/es/frameloop/order.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/frameloop/render-step.mjs delete mode 100644 node_modules/motion-dom/dist/es/frameloop/render-step.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/frameloop/sync-time.mjs delete mode 100644 node_modules/motion-dom/dist/es/frameloop/sync-time.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/gestures/drag/state/is-active.mjs delete mode 100644 node_modules/motion-dom/dist/es/gestures/drag/state/is-active.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/gestures/drag/state/set-active.mjs delete mode 100644 node_modules/motion-dom/dist/es/gestures/drag/state/set-active.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/gestures/hover.mjs delete mode 100644 node_modules/motion-dom/dist/es/gestures/hover.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/gestures/press/index.mjs delete mode 100644 node_modules/motion-dom/dist/es/gestures/press/index.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.mjs delete mode 100644 node_modules/motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/gestures/press/utils/keyboard.mjs delete mode 100644 node_modules/motion-dom/dist/es/gestures/press/utils/keyboard.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/gestures/press/utils/state.mjs delete mode 100644 node_modules/motion-dom/dist/es/gestures/press/utils/state.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/gestures/utils/is-node-or-child.mjs delete mode 100644 node_modules/motion-dom/dist/es/gestures/utils/is-node-or-child.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/gestures/utils/is-primary-pointer.mjs delete mode 100644 node_modules/motion-dom/dist/es/gestures/utils/is-primary-pointer.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/gestures/utils/setup.mjs delete mode 100644 node_modules/motion-dom/dist/es/gestures/utils/setup.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/index.mjs delete mode 100644 node_modules/motion-dom/dist/es/index.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/layout/LayoutAnimationBuilder.mjs delete mode 100644 node_modules/motion-dom/dist/es/layout/LayoutAnimationBuilder.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/projection/animation/mix-values.mjs delete mode 100644 node_modules/motion-dom/dist/es/projection/animation/mix-values.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/projection/geometry/conversion.mjs delete mode 100644 node_modules/motion-dom/dist/es/projection/geometry/conversion.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/projection/geometry/copy.mjs delete mode 100644 node_modules/motion-dom/dist/es/projection/geometry/copy.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/projection/geometry/delta-apply.mjs delete mode 100644 node_modules/motion-dom/dist/es/projection/geometry/delta-apply.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/projection/geometry/delta-calc.mjs delete mode 100644 node_modules/motion-dom/dist/es/projection/geometry/delta-calc.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/projection/geometry/delta-remove.mjs delete mode 100644 node_modules/motion-dom/dist/es/projection/geometry/delta-remove.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/projection/geometry/models.mjs delete mode 100644 node_modules/motion-dom/dist/es/projection/geometry/models.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/projection/geometry/utils.mjs delete mode 100644 node_modules/motion-dom/dist/es/projection/geometry/utils.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/projection/node/DocumentProjectionNode.mjs delete mode 100644 node_modules/motion-dom/dist/es/projection/node/DocumentProjectionNode.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/projection/node/HTMLProjectionNode.mjs delete mode 100644 node_modules/motion-dom/dist/es/projection/node/HTMLProjectionNode.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/projection/node/create-projection-node.mjs delete mode 100644 node_modules/motion-dom/dist/es/projection/node/create-projection-node.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/projection/node/group.mjs delete mode 100644 node_modules/motion-dom/dist/es/projection/node/group.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/projection/node/state.mjs delete mode 100644 node_modules/motion-dom/dist/es/projection/node/state.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/projection/shared/stack.mjs delete mode 100644 node_modules/motion-dom/dist/es/projection/shared/stack.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/projection/styles/scale-border-radius.mjs delete mode 100644 node_modules/motion-dom/dist/es/projection/styles/scale-border-radius.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/projection/styles/scale-box-shadow.mjs delete mode 100644 node_modules/motion-dom/dist/es/projection/styles/scale-box-shadow.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/projection/styles/scale-correction.mjs delete mode 100644 node_modules/motion-dom/dist/es/projection/styles/scale-correction.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/projection/styles/transform.mjs delete mode 100644 node_modules/motion-dom/dist/es/projection/styles/transform.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/projection/utils/compare-by-depth.mjs delete mode 100644 node_modules/motion-dom/dist/es/projection/utils/compare-by-depth.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/projection/utils/each-axis.mjs delete mode 100644 node_modules/motion-dom/dist/es/projection/utils/each-axis.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/projection/utils/flat-tree.mjs delete mode 100644 node_modules/motion-dom/dist/es/projection/utils/flat-tree.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/projection/utils/has-transform.mjs delete mode 100644 node_modules/motion-dom/dist/es/projection/utils/has-transform.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/projection/utils/measure.mjs delete mode 100644 node_modules/motion-dom/dist/es/projection/utils/measure.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/render/Feature.mjs delete mode 100644 node_modules/motion-dom/dist/es/render/Feature.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/render/VisualElement.mjs delete mode 100644 node_modules/motion-dom/dist/es/render/VisualElement.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/render/dom/DOMVisualElement.mjs delete mode 100644 node_modules/motion-dom/dist/es/render/dom/DOMVisualElement.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/render/dom/is-css-var.mjs delete mode 100644 node_modules/motion-dom/dist/es/render/dom/is-css-var.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/render/dom/parse-transform.mjs delete mode 100644 node_modules/motion-dom/dist/es/render/dom/parse-transform.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/render/dom/style-computed.mjs delete mode 100644 node_modules/motion-dom/dist/es/render/dom/style-computed.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/render/dom/style-set.mjs delete mode 100644 node_modules/motion-dom/dist/es/render/dom/style-set.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/render/dom/utils/camel-to-dash.mjs delete mode 100644 node_modules/motion-dom/dist/es/render/dom/utils/camel-to-dash.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/render/html/HTMLVisualElement.mjs delete mode 100644 node_modules/motion-dom/dist/es/render/html/HTMLVisualElement.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/render/html/utils/build-styles.mjs delete mode 100644 node_modules/motion-dom/dist/es/render/html/utils/build-styles.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/render/html/utils/build-transform.mjs delete mode 100644 node_modules/motion-dom/dist/es/render/html/utils/build-transform.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/render/html/utils/render.mjs delete mode 100644 node_modules/motion-dom/dist/es/render/html/utils/render.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/render/html/utils/scrape-motion-values.mjs delete mode 100644 node_modules/motion-dom/dist/es/render/html/utils/scrape-motion-values.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/render/object/ObjectVisualElement.mjs delete mode 100644 node_modules/motion-dom/dist/es/render/object/ObjectVisualElement.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/render/store.mjs delete mode 100644 node_modules/motion-dom/dist/es/render/store.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/render/svg/SVGVisualElement.mjs delete mode 100644 node_modules/motion-dom/dist/es/render/svg/SVGVisualElement.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/render/svg/utils/build-attrs.mjs delete mode 100644 node_modules/motion-dom/dist/es/render/svg/utils/build-attrs.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/render/svg/utils/camel-case-attrs.mjs delete mode 100644 node_modules/motion-dom/dist/es/render/svg/utils/camel-case-attrs.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/render/svg/utils/is-svg-tag.mjs delete mode 100644 node_modules/motion-dom/dist/es/render/svg/utils/is-svg-tag.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/render/svg/utils/path.mjs delete mode 100644 node_modules/motion-dom/dist/es/render/svg/utils/path.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/render/svg/utils/render.mjs delete mode 100644 node_modules/motion-dom/dist/es/render/svg/utils/render.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/render/svg/utils/scrape-motion-values.mjs delete mode 100644 node_modules/motion-dom/dist/es/render/svg/utils/scrape-motion-values.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/render/utils/animation-state.mjs delete mode 100644 node_modules/motion-dom/dist/es/render/utils/animation-state.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/render/utils/get-variant-context.mjs delete mode 100644 node_modules/motion-dom/dist/es/render/utils/get-variant-context.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/render/utils/is-animation-controls.mjs delete mode 100644 node_modules/motion-dom/dist/es/render/utils/is-animation-controls.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/render/utils/is-controlling-variants.mjs delete mode 100644 node_modules/motion-dom/dist/es/render/utils/is-controlling-variants.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/render/utils/is-forced-motion-value.mjs delete mode 100644 node_modules/motion-dom/dist/es/render/utils/is-forced-motion-value.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/render/utils/is-keyframes-target.mjs delete mode 100644 node_modules/motion-dom/dist/es/render/utils/is-keyframes-target.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/render/utils/is-variant-label.mjs delete mode 100644 node_modules/motion-dom/dist/es/render/utils/is-variant-label.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/render/utils/keys-position.mjs delete mode 100644 node_modules/motion-dom/dist/es/render/utils/keys-position.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/render/utils/keys-transform.mjs delete mode 100644 node_modules/motion-dom/dist/es/render/utils/keys-transform.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/render/utils/motion-values.mjs delete mode 100644 node_modules/motion-dom/dist/es/render/utils/motion-values.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/render/utils/reduced-motion/index.mjs delete mode 100644 node_modules/motion-dom/dist/es/render/utils/reduced-motion/index.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/render/utils/reduced-motion/state.mjs delete mode 100644 node_modules/motion-dom/dist/es/render/utils/reduced-motion/state.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/render/utils/resolve-dynamic-variants.mjs delete mode 100644 node_modules/motion-dom/dist/es/render/utils/resolve-dynamic-variants.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/render/utils/resolve-variants.mjs delete mode 100644 node_modules/motion-dom/dist/es/render/utils/resolve-variants.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/render/utils/setters.mjs delete mode 100644 node_modules/motion-dom/dist/es/render/utils/setters.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/render/utils/shallow-compare.mjs delete mode 100644 node_modules/motion-dom/dist/es/render/utils/shallow-compare.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/render/utils/variant-props.mjs delete mode 100644 node_modules/motion-dom/dist/es/render/utils/variant-props.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/resize/handle-element.mjs delete mode 100644 node_modules/motion-dom/dist/es/resize/handle-element.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/resize/handle-window.mjs delete mode 100644 node_modules/motion-dom/dist/es/resize/handle-window.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/resize/index.mjs delete mode 100644 node_modules/motion-dom/dist/es/resize/index.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/scroll/observe.mjs delete mode 100644 node_modules/motion-dom/dist/es/scroll/observe.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/stats/buffer.mjs delete mode 100644 node_modules/motion-dom/dist/es/stats/buffer.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/stats/index.mjs delete mode 100644 node_modules/motion-dom/dist/es/stats/index.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/utils/border-radius.mjs delete mode 100644 node_modules/motion-dom/dist/es/utils/border-radius.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/utils/delay.mjs delete mode 100644 node_modules/motion-dom/dist/es/utils/delay.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/utils/interpolate.mjs delete mode 100644 node_modules/motion-dom/dist/es/utils/interpolate.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/utils/is-html-element.mjs delete mode 100644 node_modules/motion-dom/dist/es/utils/is-html-element.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/utils/is-svg-element.mjs delete mode 100644 node_modules/motion-dom/dist/es/utils/is-svg-element.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/utils/is-svg-svg-element.mjs delete mode 100644 node_modules/motion-dom/dist/es/utils/is-svg-svg-element.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/utils/mix/color.mjs delete mode 100644 node_modules/motion-dom/dist/es/utils/mix/color.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/utils/mix/complex.mjs delete mode 100644 node_modules/motion-dom/dist/es/utils/mix/complex.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/utils/mix/immediate.mjs delete mode 100644 node_modules/motion-dom/dist/es/utils/mix/immediate.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/utils/mix/index.mjs delete mode 100644 node_modules/motion-dom/dist/es/utils/mix/index.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/utils/mix/number.mjs delete mode 100644 node_modules/motion-dom/dist/es/utils/mix/number.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/utils/mix/visibility.mjs delete mode 100644 node_modules/motion-dom/dist/es/utils/mix/visibility.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/utils/resolve-elements.mjs delete mode 100644 node_modules/motion-dom/dist/es/utils/resolve-elements.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/utils/stagger.mjs delete mode 100644 node_modules/motion-dom/dist/es/utils/stagger.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/utils/supports/flags.mjs delete mode 100644 node_modules/motion-dom/dist/es/utils/supports/flags.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/utils/supports/linear-easing.mjs delete mode 100644 node_modules/motion-dom/dist/es/utils/supports/linear-easing.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/utils/supports/memo.mjs delete mode 100644 node_modules/motion-dom/dist/es/utils/supports/memo.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/utils/supports/scroll-timeline.mjs delete mode 100644 node_modules/motion-dom/dist/es/utils/supports/scroll-timeline.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/utils/transform.mjs delete mode 100644 node_modules/motion-dom/dist/es/utils/transform.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/value/follow-value.mjs delete mode 100644 node_modules/motion-dom/dist/es/value/follow-value.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/value/index.mjs delete mode 100644 node_modules/motion-dom/dist/es/value/index.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/value/map-value.mjs delete mode 100644 node_modules/motion-dom/dist/es/value/map-value.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/value/spring-value.mjs delete mode 100644 node_modules/motion-dom/dist/es/value/spring-value.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/value/subscribe-value.mjs delete mode 100644 node_modules/motion-dom/dist/es/value/subscribe-value.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/value/transform-value.mjs delete mode 100644 node_modules/motion-dom/dist/es/value/transform-value.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/value/types/auto.mjs delete mode 100644 node_modules/motion-dom/dist/es/value/types/auto.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/value/types/color/hex.mjs delete mode 100644 node_modules/motion-dom/dist/es/value/types/color/hex.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/value/types/color/hsla-to-rgba.mjs delete mode 100644 node_modules/motion-dom/dist/es/value/types/color/hsla-to-rgba.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/value/types/color/hsla.mjs delete mode 100644 node_modules/motion-dom/dist/es/value/types/color/hsla.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/value/types/color/index.mjs delete mode 100644 node_modules/motion-dom/dist/es/value/types/color/index.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/value/types/color/rgba.mjs delete mode 100644 node_modules/motion-dom/dist/es/value/types/color/rgba.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/value/types/color/utils.mjs delete mode 100644 node_modules/motion-dom/dist/es/value/types/color/utils.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/value/types/complex/filter.mjs delete mode 100644 node_modules/motion-dom/dist/es/value/types/complex/filter.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/value/types/complex/index.mjs delete mode 100644 node_modules/motion-dom/dist/es/value/types/complex/index.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/value/types/complex/mask.mjs delete mode 100644 node_modules/motion-dom/dist/es/value/types/complex/mask.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/value/types/dimensions.mjs delete mode 100644 node_modules/motion-dom/dist/es/value/types/dimensions.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/value/types/int.mjs delete mode 100644 node_modules/motion-dom/dist/es/value/types/int.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/value/types/maps/defaults.mjs delete mode 100644 node_modules/motion-dom/dist/es/value/types/maps/defaults.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/value/types/maps/number.mjs delete mode 100644 node_modules/motion-dom/dist/es/value/types/maps/number.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/value/types/maps/transform.mjs delete mode 100644 node_modules/motion-dom/dist/es/value/types/maps/transform.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/value/types/numbers/index.mjs delete mode 100644 node_modules/motion-dom/dist/es/value/types/numbers/index.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/value/types/numbers/units.mjs delete mode 100644 node_modules/motion-dom/dist/es/value/types/numbers/units.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/value/types/test.mjs delete mode 100644 node_modules/motion-dom/dist/es/value/types/test.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/value/types/utils/animatable-none.mjs delete mode 100644 node_modules/motion-dom/dist/es/value/types/utils/animatable-none.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/value/types/utils/color-regex.mjs delete mode 100644 node_modules/motion-dom/dist/es/value/types/utils/color-regex.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/value/types/utils/find.mjs delete mode 100644 node_modules/motion-dom/dist/es/value/types/utils/find.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/value/types/utils/float-regex.mjs delete mode 100644 node_modules/motion-dom/dist/es/value/types/utils/float-regex.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/value/types/utils/get-as-type.mjs delete mode 100644 node_modules/motion-dom/dist/es/value/types/utils/get-as-type.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/value/types/utils/is-nullish.mjs delete mode 100644 node_modules/motion-dom/dist/es/value/types/utils/is-nullish.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/value/types/utils/sanitize.mjs delete mode 100644 node_modules/motion-dom/dist/es/value/types/utils/sanitize.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/value/types/utils/single-color-regex.mjs delete mode 100644 node_modules/motion-dom/dist/es/value/types/utils/single-color-regex.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/value/utils/is-motion-value.mjs delete mode 100644 node_modules/motion-dom/dist/es/value/utils/is-motion-value.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/value/utils/resolve-motion-value.mjs delete mode 100644 node_modules/motion-dom/dist/es/value/utils/resolve-motion-value.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/value/will-change/add-will-change.mjs delete mode 100644 node_modules/motion-dom/dist/es/value/will-change/add-will-change.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/value/will-change/is.mjs delete mode 100644 node_modules/motion-dom/dist/es/value/will-change/is.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/view/index.mjs delete mode 100644 node_modules/motion-dom/dist/es/view/index.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/view/queue.mjs delete mode 100644 node_modules/motion-dom/dist/es/view/queue.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/view/start.mjs delete mode 100644 node_modules/motion-dom/dist/es/view/start.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/view/utils/assign-names.mjs delete mode 100644 node_modules/motion-dom/dist/es/view/utils/assign-names.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/view/utils/choose-layer-type.mjs delete mode 100644 node_modules/motion-dom/dist/es/view/utils/choose-layer-type.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/view/utils/css.mjs delete mode 100644 node_modules/motion-dom/dist/es/view/utils/css.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/view/utils/get-layer-info.mjs delete mode 100644 node_modules/motion-dom/dist/es/view/utils/get-layer-info.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/view/utils/get-view-animations.mjs delete mode 100644 node_modules/motion-dom/dist/es/view/utils/get-view-animations.mjs.map delete mode 100644 node_modules/motion-dom/dist/es/view/utils/has-target.mjs delete mode 100644 node_modules/motion-dom/dist/es/view/utils/has-target.mjs.map delete mode 100644 node_modules/motion-dom/dist/index.d.ts delete mode 100644 node_modules/motion-dom/dist/motion-dom.dev.js delete mode 100644 node_modules/motion-dom/dist/motion-dom.js delete mode 100644 node_modules/motion-dom/dist/size-rollup-motion-value.js delete mode 100644 node_modules/motion-dom/dist/size-rollup-motion-value.js.map delete mode 100644 node_modules/motion-dom/dist/size-rollup-style-effect.js delete mode 100644 node_modules/motion-dom/dist/size-rollup-style-effect.js.map delete mode 100644 node_modules/motion-dom/package.json delete mode 100644 node_modules/motion-utils/LICENSE.md delete mode 100644 node_modules/motion-utils/dist/cjs/index.js delete mode 100644 node_modules/motion-utils/dist/cjs/index.js.map delete mode 100644 node_modules/motion-utils/dist/es/array.mjs delete mode 100644 node_modules/motion-utils/dist/es/array.mjs.map delete mode 100644 node_modules/motion-utils/dist/es/clamp.mjs delete mode 100644 node_modules/motion-utils/dist/es/clamp.mjs.map delete mode 100644 node_modules/motion-utils/dist/es/easing/anticipate.mjs delete mode 100644 node_modules/motion-utils/dist/es/easing/anticipate.mjs.map delete mode 100644 node_modules/motion-utils/dist/es/easing/back.mjs delete mode 100644 node_modules/motion-utils/dist/es/easing/back.mjs.map delete mode 100644 node_modules/motion-utils/dist/es/easing/circ.mjs delete mode 100644 node_modules/motion-utils/dist/es/easing/circ.mjs.map delete mode 100644 node_modules/motion-utils/dist/es/easing/cubic-bezier.mjs delete mode 100644 node_modules/motion-utils/dist/es/easing/cubic-bezier.mjs.map delete mode 100644 node_modules/motion-utils/dist/es/easing/ease.mjs delete mode 100644 node_modules/motion-utils/dist/es/easing/ease.mjs.map delete mode 100644 node_modules/motion-utils/dist/es/easing/modifiers/mirror.mjs delete mode 100644 node_modules/motion-utils/dist/es/easing/modifiers/mirror.mjs.map delete mode 100644 node_modules/motion-utils/dist/es/easing/modifiers/reverse.mjs delete mode 100644 node_modules/motion-utils/dist/es/easing/modifiers/reverse.mjs.map delete mode 100644 node_modules/motion-utils/dist/es/easing/steps.mjs delete mode 100644 node_modules/motion-utils/dist/es/easing/steps.mjs.map delete mode 100644 node_modules/motion-utils/dist/es/easing/utils/get-easing-for-segment.mjs delete mode 100644 node_modules/motion-utils/dist/es/easing/utils/get-easing-for-segment.mjs.map delete mode 100644 node_modules/motion-utils/dist/es/easing/utils/is-bezier-definition.mjs delete mode 100644 node_modules/motion-utils/dist/es/easing/utils/is-bezier-definition.mjs.map delete mode 100644 node_modules/motion-utils/dist/es/easing/utils/is-easing-array.mjs delete mode 100644 node_modules/motion-utils/dist/es/easing/utils/is-easing-array.mjs.map delete mode 100644 node_modules/motion-utils/dist/es/easing/utils/map.mjs delete mode 100644 node_modules/motion-utils/dist/es/easing/utils/map.mjs.map delete mode 100644 node_modules/motion-utils/dist/es/errors.mjs delete mode 100644 node_modules/motion-utils/dist/es/errors.mjs.map delete mode 100644 node_modules/motion-utils/dist/es/format-error-message.mjs delete mode 100644 node_modules/motion-utils/dist/es/format-error-message.mjs.map delete mode 100644 node_modules/motion-utils/dist/es/global-config.mjs delete mode 100644 node_modules/motion-utils/dist/es/global-config.mjs.map delete mode 100644 node_modules/motion-utils/dist/es/index.mjs delete mode 100644 node_modules/motion-utils/dist/es/index.mjs.map delete mode 100644 node_modules/motion-utils/dist/es/is-numerical-string.mjs delete mode 100644 node_modules/motion-utils/dist/es/is-numerical-string.mjs.map delete mode 100644 node_modules/motion-utils/dist/es/is-object.mjs delete mode 100644 node_modules/motion-utils/dist/es/is-object.mjs.map delete mode 100644 node_modules/motion-utils/dist/es/is-zero-value-string.mjs delete mode 100644 node_modules/motion-utils/dist/es/is-zero-value-string.mjs.map delete mode 100644 node_modules/motion-utils/dist/es/memo.mjs delete mode 100644 node_modules/motion-utils/dist/es/memo.mjs.map delete mode 100644 node_modules/motion-utils/dist/es/noop.mjs delete mode 100644 node_modules/motion-utils/dist/es/noop.mjs.map delete mode 100644 node_modules/motion-utils/dist/es/pipe.mjs delete mode 100644 node_modules/motion-utils/dist/es/pipe.mjs.map delete mode 100644 node_modules/motion-utils/dist/es/progress.mjs delete mode 100644 node_modules/motion-utils/dist/es/progress.mjs.map delete mode 100644 node_modules/motion-utils/dist/es/subscription-manager.mjs delete mode 100644 node_modules/motion-utils/dist/es/subscription-manager.mjs.map delete mode 100644 node_modules/motion-utils/dist/es/time-conversion.mjs delete mode 100644 node_modules/motion-utils/dist/es/time-conversion.mjs.map delete mode 100644 node_modules/motion-utils/dist/es/velocity-per-second.mjs delete mode 100644 node_modules/motion-utils/dist/es/velocity-per-second.mjs.map delete mode 100644 node_modules/motion-utils/dist/es/warn-once.mjs delete mode 100644 node_modules/motion-utils/dist/es/warn-once.mjs.map delete mode 100644 node_modules/motion-utils/dist/es/wrap.mjs delete mode 100644 node_modules/motion-utils/dist/es/wrap.mjs.map delete mode 100644 node_modules/motion-utils/dist/index.d.ts delete mode 100644 node_modules/motion-utils/dist/motion-utils.dev.js delete mode 100644 node_modules/motion-utils/dist/motion-utils.js delete mode 100644 node_modules/motion-utils/package.json delete mode 100644 node_modules/motion/LICENSE.md delete mode 100644 node_modules/motion/README.md delete mode 100644 node_modules/motion/dist/cjs/debug.js delete mode 100644 node_modules/motion/dist/cjs/index.js delete mode 100644 node_modules/motion/dist/cjs/mini.js delete mode 100644 node_modules/motion/dist/cjs/react-client.js delete mode 100644 node_modules/motion/dist/cjs/react-m.js delete mode 100644 node_modules/motion/dist/cjs/react-mini.js delete mode 100644 node_modules/motion/dist/cjs/react.js delete mode 100644 node_modules/motion/dist/debug.d.ts delete mode 100644 node_modules/motion/dist/es/debug.mjs delete mode 100644 node_modules/motion/dist/es/index.mjs delete mode 100644 node_modules/motion/dist/es/mini.mjs delete mode 100644 node_modules/motion/dist/es/react-client.mjs delete mode 100644 node_modules/motion/dist/es/react-m.mjs delete mode 100644 node_modules/motion/dist/es/react-mini.mjs delete mode 100644 node_modules/motion/dist/es/react.mjs delete mode 100644 node_modules/motion/dist/index.d.ts delete mode 100644 node_modules/motion/dist/mini.d.ts delete mode 100644 node_modules/motion/dist/motion.dev.js delete mode 100644 node_modules/motion/dist/motion.js delete mode 100644 node_modules/motion/dist/react-client.d.ts delete mode 100644 node_modules/motion/dist/react-m.d.ts delete mode 100644 node_modules/motion/dist/react-mini.d.ts delete mode 100644 node_modules/motion/dist/react.d.ts delete mode 100644 node_modules/motion/mini/package.json delete mode 100644 node_modules/motion/package.json delete mode 100644 node_modules/motion/react-client/package.json delete mode 100644 node_modules/motion/react-m/package.json delete mode 100644 node_modules/motion/react/package.json delete mode 100644 node_modules/tslib/CopyrightNotice.txt delete mode 100644 node_modules/tslib/LICENSE.txt delete mode 100644 node_modules/tslib/README.md delete mode 100644 node_modules/tslib/SECURITY.md delete mode 100644 node_modules/tslib/modules/index.d.ts delete mode 100644 node_modules/tslib/modules/index.js delete mode 100644 node_modules/tslib/modules/package.json delete mode 100644 node_modules/tslib/package.json delete mode 100644 node_modules/tslib/tslib.d.ts delete mode 100644 node_modules/tslib/tslib.es6.html delete mode 100644 node_modules/tslib/tslib.es6.js delete mode 100644 node_modules/tslib/tslib.es6.mjs delete mode 100644 node_modules/tslib/tslib.html delete mode 100644 node_modules/tslib/tslib.js diff --git a/.gitignore b/.gitignore index 735d94b..c5e9a2f 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ -scrape \ No newline at end of file +scrape +node_modules +.env \ No newline at end of file diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json deleted file mode 100644 index 48f7ae6..0000000 --- a/node_modules/.package-lock.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "name": "Devjams26-Frontend", - "lockfileVersion": 3, - "requires": true, - "packages": { - "node_modules/framer-motion": { - "version": "13.1.0", - "resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-13.1.0.tgz", - "integrity": "sha512-QSZrF0Id3QGuHJ+OL+9PSY9pk86C8ERFalwAGSchzTm65+ZoGH/RM26lmEARLljcHj2lqhv0jZOOks+EI3COOw==", - "license": "MIT", - "dependencies": { - "motion-dom": "^13.0.0", - "motion-utils": "^13.0.0", - "tslib": "^2.4.0" - }, - "peerDependencies": { - "react": "^18.0.0 || ^19.0.0", - "react-dom": "^18.0.0 || ^19.0.0" - }, - "peerDependenciesMeta": { - "react": { - "optional": true - }, - "react-dom": { - "optional": true - } - } - }, - "node_modules/motion": { - "version": "13.1.0", - "resolved": "https://registry.npmjs.org/motion/-/motion-13.1.0.tgz", - "integrity": "sha512-qtvscq59uCPdWnNW4SdSkrxR+BS/QYsa923bx7ocA+4p+ZGNbbVQwkSnG4aukB81QWjtl3AxX36plxNyZLmHCA==", - "license": "MIT", - "dependencies": { - "framer-motion": "^13.1.0", - "tslib": "^2.4.0" - }, - "peerDependencies": { - "react": "^18.0.0 || ^19.0.0", - "react-dom": "^18.0.0 || ^19.0.0" - }, - "peerDependenciesMeta": { - "react": { - "optional": true - }, - "react-dom": { - "optional": true - } - } - }, - "node_modules/motion-dom": { - "version": "13.0.0", - "resolved": "https://registry.npmjs.org/motion-dom/-/motion-dom-13.0.0.tgz", - "integrity": "sha512-Xk+SJas70uMAUIApg+m3lZDShxI3LBFHq7mFGbBKoRXc2PVPDyAKmzN64Bbzt4CZdP/CItTiJxWtn4TA0v53Ng==", - "license": "MIT", - "dependencies": { - "motion-utils": "^13.0.0" - } - }, - "node_modules/motion-utils": { - "version": "13.0.0", - "resolved": "https://registry.npmjs.org/motion-utils/-/motion-utils-13.0.0.tgz", - "integrity": "sha512-7DnN7TmbLcYXcG4RVadXIihWlyuM9afoUww8Y5Agg431kGKiuL2/OMyP4mJ5wLz+pvN3t5ySClLOaVXJ+wekRQ==", - "license": "MIT" - }, - "node_modules/tslib": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", - "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", - "license": "0BSD" - } - } -} diff --git a/node_modules/framer-motion/LICENSE.md b/node_modules/framer-motion/LICENSE.md deleted file mode 100644 index b5b8d6a..0000000 --- a/node_modules/framer-motion/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2018 Framer B.V. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/framer-motion/README.md b/node_modules/framer-motion/README.md deleted file mode 100644 index 6577ebe..0000000 --- a/node_modules/framer-motion/README.md +++ /dev/null @@ -1,137 +0,0 @@ -

Motion logo
Motion for React

-

- An open source animation library
for React -

- -

- npm version - npm downloads per month - jsDelivr hits (npm) - NPM License - MotionScore grade -

- -```bash -npm install motion -``` - -## Table of Contents - -1. [Why Motion?](#why-motion) -2. [🍦 Platforms](#-platforms) -3. [🎓 Examples](#-examples) -4. [⚡️ Motion+](#-motion) -5. [👩🏻‍⚖️ License](#-license) -6. [💎 Contribute](#-contribute) -7. [✨ Sponsors](#-sponsors) - -## Why Motion? - -- **Simple API:** First-class React, JavaScript, and Vue packages. -- **Hybrid engine:** Power of JavaScript combined with native browser APIs for 120fps, GPU-accelerated animations. -- **Production-ready:** TypeScript, extensive test suite, tree-shakable, tiny footprint. - **Batteries included:** Gestures, springs, layout transitions, scroll-linked effects, timelines. - -## 🍦 Platforms - -Motion is available for [React](https://motion.dev/docs/react), [JavaScript](https://motion.dev/docs/quick-start) and [Vue](https://motion.dev/docs/vue). - -### React - -```jsx -import { motion } from "motion/react" - -function Component() { - return -} -``` - -Get started with [Motion for React](https://motion.dev/docs/react). - -**Note:** Framer Motion is now Motion. Import from `motion/react` instead of `framer-motion`. - -### JS - -```javascript -import { animate } from "motion" - -animate("#box", { x: 100 }) -``` - -Get started with [JavaScript](https://motion.dev/docs/quick-start). - -### Vue - -```html - - - -``` - -Get started with [Motion for Vue](https://motion.dev/docs/vue). - -## 🎓 Examples & tutorials - -Browse 330+ [official examples](https://motion.dev/examples), with copy-paste code that'll level-up your animations whether you're a beginner or an expert. - -Over 100 examples come with a full step-by-step [tutorial](https://motion.dev/tutorials). - -## ⚡️ Motion+ - -A one-time payment, lifetime-updates membership: - -- **330+ examples** -- **100+ tutorials** -- **Premium APIs** like [Cursor](https://motion.dev/docs/cursor) and [Ticker](https://motion.dev/docs/react-ticker) -- **Transition editor** for Cursor and VS Code -- **AI skills** -- **Private Discord** -- **Early access content** - -[Get Motion+](https://motion.dev/plus) - -## 👩🏻‍⚖️ License - -- Motion is MIT licensed. - -## 💎 Contribute - -- Want to contribute to Motion? Our [contributing guide](https://github.com/motiondivision/motion/blob/master/CONTRIBUTING.md) has you covered. - -## ✨ Sponsors - -Motion is sustainable thanks to the kind support of its sponsors. - -[Become a sponsor](https://motion.dev/sponsor) - -### Partners - -Motion powers the animations for all websites built with Framer, the web builder for creative pros. The Motion website itself is built on Framer, for its delightful canvas-based editing and powerful CMS features. - - - Framer - - -Motion drives the animations on the Cursor homepage, and is working with Cursor to bring powerful AI workflows to the Motion examples and docs. - - - Cursor - - -### Platinum - -Linear Figma Sanity Sanity Clerk - -### Gold - -### Silver - -Liveblocks Frontend.fyi Firecrawl Bolt.new - -### Personal - -- [OlegWock](https://sinja.io) -- [Lambert Weller](https://github.com/l-mbert) -- [Jake LeBoeuf](https://jklb.wf) diff --git a/node_modules/framer-motion/client/README.md b/node_modules/framer-motion/client/README.md deleted file mode 100644 index 00af8b4..0000000 --- a/node_modules/framer-motion/client/README.md +++ /dev/null @@ -1 +0,0 @@ -This directory is a fallback for `exports["./client"]` in the root `framer-motion` `package.json`. diff --git a/node_modules/framer-motion/client/package.json b/node_modules/framer-motion/client/package.json deleted file mode 100644 index c4eeff4..0000000 --- a/node_modules/framer-motion/client/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "private": true, - "types": "../dist/client.d.ts", - "main": "../dist/cjs/client.js", - "module": "../dist/es/client.mjs" -} diff --git a/node_modules/framer-motion/dist/cjs/client.js b/node_modules/framer-motion/dist/cjs/client.js deleted file mode 100644 index a5b770c..0000000 --- a/node_modules/framer-motion/dist/cjs/client.js +++ /dev/null @@ -1,370 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { value: true }); - -var index = require('./index-BuO47Yrm.js'); -var featureBundle = require('./feature-bundle-BZV7Y7IM.js'); -require('react/jsx-runtime'); -require('motion-utils'); -require('react'); -require('motion-dom'); - -function createMotionComponentWithFeatures(Component, options) { - return index.createMotionComponent(Component, options, featureBundle.featureBundle, featureBundle.createDomVisualElement); -} - -/** - * HTML components - */ -const MotionA = /*@__PURE__*/ createMotionComponentWithFeatures("a"); -const MotionAbbr = /*@__PURE__*/ createMotionComponentWithFeatures("abbr"); -const MotionAddress = /*@__PURE__*/ createMotionComponentWithFeatures("address"); -const MotionArea = /*@__PURE__*/ createMotionComponentWithFeatures("area"); -const MotionArticle = /*@__PURE__*/ createMotionComponentWithFeatures("article"); -const MotionAside = /*@__PURE__*/ createMotionComponentWithFeatures("aside"); -const MotionAudio = /*@__PURE__*/ createMotionComponentWithFeatures("audio"); -const MotionB = /*@__PURE__*/ createMotionComponentWithFeatures("b"); -const MotionBase = /*@__PURE__*/ createMotionComponentWithFeatures("base"); -const MotionBdi = /*@__PURE__*/ createMotionComponentWithFeatures("bdi"); -const MotionBdo = /*@__PURE__*/ createMotionComponentWithFeatures("bdo"); -const MotionBig = /*@__PURE__*/ createMotionComponentWithFeatures("big"); -const MotionBlockquote = -/*@__PURE__*/ createMotionComponentWithFeatures("blockquote"); -const MotionBody = /*@__PURE__*/ createMotionComponentWithFeatures("body"); -const MotionButton = /*@__PURE__*/ createMotionComponentWithFeatures("button"); -const MotionCanvas = /*@__PURE__*/ createMotionComponentWithFeatures("canvas"); -const MotionCaption = /*@__PURE__*/ createMotionComponentWithFeatures("caption"); -const MotionCite = /*@__PURE__*/ createMotionComponentWithFeatures("cite"); -const MotionCode = /*@__PURE__*/ createMotionComponentWithFeatures("code"); -const MotionCol = /*@__PURE__*/ createMotionComponentWithFeatures("col"); -const MotionColgroup = /*@__PURE__*/ createMotionComponentWithFeatures("colgroup"); -const MotionData = /*@__PURE__*/ createMotionComponentWithFeatures("data"); -const MotionDatalist = /*@__PURE__*/ createMotionComponentWithFeatures("datalist"); -const MotionDd = /*@__PURE__*/ createMotionComponentWithFeatures("dd"); -const MotionDel = /*@__PURE__*/ createMotionComponentWithFeatures("del"); -const MotionDetails = /*@__PURE__*/ createMotionComponentWithFeatures("details"); -const MotionDfn = /*@__PURE__*/ createMotionComponentWithFeatures("dfn"); -const MotionDialog = /*@__PURE__*/ createMotionComponentWithFeatures("dialog"); -const MotionDiv = /*@__PURE__*/ createMotionComponentWithFeatures("div"); -const MotionDl = /*@__PURE__*/ createMotionComponentWithFeatures("dl"); -const MotionDt = /*@__PURE__*/ createMotionComponentWithFeatures("dt"); -const MotionEm = /*@__PURE__*/ createMotionComponentWithFeatures("em"); -const MotionEmbed = /*@__PURE__*/ createMotionComponentWithFeatures("embed"); -const MotionFieldset = /*@__PURE__*/ createMotionComponentWithFeatures("fieldset"); -const MotionFigcaption = -/*@__PURE__*/ createMotionComponentWithFeatures("figcaption"); -const MotionFigure = /*@__PURE__*/ createMotionComponentWithFeatures("figure"); -const MotionFooter = /*@__PURE__*/ createMotionComponentWithFeatures("footer"); -const MotionForm = /*@__PURE__*/ createMotionComponentWithFeatures("form"); -const MotionH1 = /*@__PURE__*/ createMotionComponentWithFeatures("h1"); -const MotionH2 = /*@__PURE__*/ createMotionComponentWithFeatures("h2"); -const MotionH3 = /*@__PURE__*/ createMotionComponentWithFeatures("h3"); -const MotionH4 = /*@__PURE__*/ createMotionComponentWithFeatures("h4"); -const MotionH5 = /*@__PURE__*/ createMotionComponentWithFeatures("h5"); -const MotionH6 = /*@__PURE__*/ createMotionComponentWithFeatures("h6"); -const MotionHead = /*@__PURE__*/ createMotionComponentWithFeatures("head"); -const MotionHeader = /*@__PURE__*/ createMotionComponentWithFeatures("header"); -const MotionHgroup = /*@__PURE__*/ createMotionComponentWithFeatures("hgroup"); -const MotionHr = /*@__PURE__*/ createMotionComponentWithFeatures("hr"); -const MotionHtml = /*@__PURE__*/ createMotionComponentWithFeatures("html"); -const MotionI = /*@__PURE__*/ createMotionComponentWithFeatures("i"); -const MotionIframe = /*@__PURE__*/ createMotionComponentWithFeatures("iframe"); -const MotionImg = /*@__PURE__*/ createMotionComponentWithFeatures("img"); -const MotionInput = /*@__PURE__*/ createMotionComponentWithFeatures("input"); -const MotionIns = /*@__PURE__*/ createMotionComponentWithFeatures("ins"); -const MotionKbd = /*@__PURE__*/ createMotionComponentWithFeatures("kbd"); -const MotionKeygen = /*@__PURE__*/ createMotionComponentWithFeatures("keygen"); -const MotionLabel = /*@__PURE__*/ createMotionComponentWithFeatures("label"); -const MotionLegend = /*@__PURE__*/ createMotionComponentWithFeatures("legend"); -const MotionLi = /*@__PURE__*/ createMotionComponentWithFeatures("li"); -const MotionLink = /*@__PURE__*/ createMotionComponentWithFeatures("link"); -const MotionMain = /*@__PURE__*/ createMotionComponentWithFeatures("main"); -const MotionMap = /*@__PURE__*/ createMotionComponentWithFeatures("map"); -const MotionMark = /*@__PURE__*/ createMotionComponentWithFeatures("mark"); -const MotionMenu = /*@__PURE__*/ createMotionComponentWithFeatures("menu"); -const MotionMenuitem = /*@__PURE__*/ createMotionComponentWithFeatures("menuitem"); -const MotionMeter = /*@__PURE__*/ createMotionComponentWithFeatures("meter"); -const MotionNav = /*@__PURE__*/ createMotionComponentWithFeatures("nav"); -const MotionObject = /*@__PURE__*/ createMotionComponentWithFeatures("object"); -const MotionOl = /*@__PURE__*/ createMotionComponentWithFeatures("ol"); -const MotionOptgroup = /*@__PURE__*/ createMotionComponentWithFeatures("optgroup"); -const MotionOption = /*@__PURE__*/ createMotionComponentWithFeatures("option"); -const MotionOutput = /*@__PURE__*/ createMotionComponentWithFeatures("output"); -const MotionP = /*@__PURE__*/ createMotionComponentWithFeatures("p"); -const MotionParam = /*@__PURE__*/ createMotionComponentWithFeatures("param"); -const MotionPicture = /*@__PURE__*/ createMotionComponentWithFeatures("picture"); -const MotionPre = /*@__PURE__*/ createMotionComponentWithFeatures("pre"); -const MotionProgress = /*@__PURE__*/ createMotionComponentWithFeatures("progress"); -const MotionQ = /*@__PURE__*/ createMotionComponentWithFeatures("q"); -const MotionRp = /*@__PURE__*/ createMotionComponentWithFeatures("rp"); -const MotionRt = /*@__PURE__*/ createMotionComponentWithFeatures("rt"); -const MotionRuby = /*@__PURE__*/ createMotionComponentWithFeatures("ruby"); -const MotionS = /*@__PURE__*/ createMotionComponentWithFeatures("s"); -const MotionSamp = /*@__PURE__*/ createMotionComponentWithFeatures("samp"); -const MotionScript = /*@__PURE__*/ createMotionComponentWithFeatures("script"); -const MotionSection = /*@__PURE__*/ createMotionComponentWithFeatures("section"); -const MotionSelect = /*@__PURE__*/ createMotionComponentWithFeatures("select"); -const MotionSmall = /*@__PURE__*/ createMotionComponentWithFeatures("small"); -const MotionSource = /*@__PURE__*/ createMotionComponentWithFeatures("source"); -const MotionSpan = /*@__PURE__*/ createMotionComponentWithFeatures("span"); -const MotionStrong = /*@__PURE__*/ createMotionComponentWithFeatures("strong"); -const MotionStyle = /*@__PURE__*/ createMotionComponentWithFeatures("style"); -const MotionSub = /*@__PURE__*/ createMotionComponentWithFeatures("sub"); -const MotionSummary = /*@__PURE__*/ createMotionComponentWithFeatures("summary"); -const MotionSup = /*@__PURE__*/ createMotionComponentWithFeatures("sup"); -const MotionTable = /*@__PURE__*/ createMotionComponentWithFeatures("table"); -const MotionTbody = /*@__PURE__*/ createMotionComponentWithFeatures("tbody"); -const MotionTd = /*@__PURE__*/ createMotionComponentWithFeatures("td"); -const MotionTextarea = /*@__PURE__*/ createMotionComponentWithFeatures("textarea"); -const MotionTfoot = /*@__PURE__*/ createMotionComponentWithFeatures("tfoot"); -const MotionTh = /*@__PURE__*/ createMotionComponentWithFeatures("th"); -const MotionThead = /*@__PURE__*/ createMotionComponentWithFeatures("thead"); -const MotionTime = /*@__PURE__*/ createMotionComponentWithFeatures("time"); -const MotionTitle = /*@__PURE__*/ createMotionComponentWithFeatures("title"); -const MotionTr = /*@__PURE__*/ createMotionComponentWithFeatures("tr"); -const MotionTrack = /*@__PURE__*/ createMotionComponentWithFeatures("track"); -const MotionU = /*@__PURE__*/ createMotionComponentWithFeatures("u"); -const MotionUl = /*@__PURE__*/ createMotionComponentWithFeatures("ul"); -const MotionVideo = /*@__PURE__*/ createMotionComponentWithFeatures("video"); -const MotionWbr = /*@__PURE__*/ createMotionComponentWithFeatures("wbr"); -const MotionWebview = /*@__PURE__*/ createMotionComponentWithFeatures("webview"); -/** - * SVG components - */ -const MotionAnimate = /*@__PURE__*/ createMotionComponentWithFeatures("animate"); -const MotionCircle = /*@__PURE__*/ createMotionComponentWithFeatures("circle"); -const MotionDefs = /*@__PURE__*/ createMotionComponentWithFeatures("defs"); -const MotionDesc = /*@__PURE__*/ createMotionComponentWithFeatures("desc"); -const MotionEllipse = /*@__PURE__*/ createMotionComponentWithFeatures("ellipse"); -const MotionG = /*@__PURE__*/ createMotionComponentWithFeatures("g"); -const MotionImage = /*@__PURE__*/ createMotionComponentWithFeatures("image"); -const MotionLine = /*@__PURE__*/ createMotionComponentWithFeatures("line"); -const MotionFilter = /*@__PURE__*/ createMotionComponentWithFeatures("filter"); -const MotionMarker = /*@__PURE__*/ createMotionComponentWithFeatures("marker"); -const MotionMask = /*@__PURE__*/ createMotionComponentWithFeatures("mask"); -const MotionMetadata = /*@__PURE__*/ createMotionComponentWithFeatures("metadata"); -const MotionPath = /*@__PURE__*/ createMotionComponentWithFeatures("path"); -const MotionPattern = /*@__PURE__*/ createMotionComponentWithFeatures("pattern"); -const MotionPolygon = /*@__PURE__*/ createMotionComponentWithFeatures("polygon"); -const MotionPolyline = /*@__PURE__*/ createMotionComponentWithFeatures("polyline"); -const MotionRect = /*@__PURE__*/ createMotionComponentWithFeatures("rect"); -const MotionStop = /*@__PURE__*/ createMotionComponentWithFeatures("stop"); -const MotionSvg = /*@__PURE__*/ createMotionComponentWithFeatures("svg"); -const MotionSymbol = /*@__PURE__*/ createMotionComponentWithFeatures("symbol"); -const MotionText = /*@__PURE__*/ createMotionComponentWithFeatures("text"); -const MotionTspan = /*@__PURE__*/ createMotionComponentWithFeatures("tspan"); -const MotionUse = /*@__PURE__*/ createMotionComponentWithFeatures("use"); -const MotionView = /*@__PURE__*/ createMotionComponentWithFeatures("view"); -const MotionClipPath = /*@__PURE__*/ createMotionComponentWithFeatures("clipPath"); -const MotionFeBlend = /*@__PURE__*/ createMotionComponentWithFeatures("feBlend"); -const MotionFeColorMatrix = -/*@__PURE__*/ createMotionComponentWithFeatures("feColorMatrix"); -const MotionFeComponentTransfer = /*@__PURE__*/ createMotionComponentWithFeatures("feComponentTransfer"); -const MotionFeComposite = -/*@__PURE__*/ createMotionComponentWithFeatures("feComposite"); -const MotionFeConvolveMatrix = -/*@__PURE__*/ createMotionComponentWithFeatures("feConvolveMatrix"); -const MotionFeDiffuseLighting = -/*@__PURE__*/ createMotionComponentWithFeatures("feDiffuseLighting"); -const MotionFeDisplacementMap = -/*@__PURE__*/ createMotionComponentWithFeatures("feDisplacementMap"); -const MotionFeDistantLight = -/*@__PURE__*/ createMotionComponentWithFeatures("feDistantLight"); -const MotionFeDropShadow = -/*@__PURE__*/ createMotionComponentWithFeatures("feDropShadow"); -const MotionFeFlood = /*@__PURE__*/ createMotionComponentWithFeatures("feFlood"); -const MotionFeFuncA = /*@__PURE__*/ createMotionComponentWithFeatures("feFuncA"); -const MotionFeFuncB = /*@__PURE__*/ createMotionComponentWithFeatures("feFuncB"); -const MotionFeFuncG = /*@__PURE__*/ createMotionComponentWithFeatures("feFuncG"); -const MotionFeFuncR = /*@__PURE__*/ createMotionComponentWithFeatures("feFuncR"); -const MotionFeGaussianBlur = -/*@__PURE__*/ createMotionComponentWithFeatures("feGaussianBlur"); -const MotionFeImage = /*@__PURE__*/ createMotionComponentWithFeatures("feImage"); -const MotionFeMerge = /*@__PURE__*/ createMotionComponentWithFeatures("feMerge"); -const MotionFeMergeNode = -/*@__PURE__*/ createMotionComponentWithFeatures("feMergeNode"); -const MotionFeMorphology = -/*@__PURE__*/ createMotionComponentWithFeatures("feMorphology"); -const MotionFeOffset = /*@__PURE__*/ createMotionComponentWithFeatures("feOffset"); -const MotionFePointLight = -/*@__PURE__*/ createMotionComponentWithFeatures("fePointLight"); -const MotionFeSpecularLighting = -/*@__PURE__*/ createMotionComponentWithFeatures("feSpecularLighting"); -const MotionFeSpotLight = -/*@__PURE__*/ createMotionComponentWithFeatures("feSpotLight"); -const MotionFeTile = /*@__PURE__*/ createMotionComponentWithFeatures("feTile"); -const MotionFeTurbulence = -/*@__PURE__*/ createMotionComponentWithFeatures("feTurbulence"); -const MotionForeignObject = -/*@__PURE__*/ createMotionComponentWithFeatures("foreignObject"); -const MotionLinearGradient = -/*@__PURE__*/ createMotionComponentWithFeatures("linearGradient"); -const MotionRadialGradient = -/*@__PURE__*/ createMotionComponentWithFeatures("radialGradient"); -const MotionTextPath = /*@__PURE__*/ createMotionComponentWithFeatures("textPath"); - -exports.a = MotionA; -exports.abbr = MotionAbbr; -exports.address = MotionAddress; -exports.animate = MotionAnimate; -exports.area = MotionArea; -exports.article = MotionArticle; -exports.aside = MotionAside; -exports.audio = MotionAudio; -exports.b = MotionB; -exports.base = MotionBase; -exports.bdi = MotionBdi; -exports.bdo = MotionBdo; -exports.big = MotionBig; -exports.blockquote = MotionBlockquote; -exports.body = MotionBody; -exports.button = MotionButton; -exports.canvas = MotionCanvas; -exports.caption = MotionCaption; -exports.circle = MotionCircle; -exports.cite = MotionCite; -exports.clipPath = MotionClipPath; -exports.code = MotionCode; -exports.col = MotionCol; -exports.colgroup = MotionColgroup; -exports.data = MotionData; -exports.datalist = MotionDatalist; -exports.dd = MotionDd; -exports.defs = MotionDefs; -exports.del = MotionDel; -exports.desc = MotionDesc; -exports.details = MotionDetails; -exports.dfn = MotionDfn; -exports.dialog = MotionDialog; -exports.div = MotionDiv; -exports.dl = MotionDl; -exports.dt = MotionDt; -exports.ellipse = MotionEllipse; -exports.em = MotionEm; -exports.embed = MotionEmbed; -exports.feBlend = MotionFeBlend; -exports.feColorMatrix = MotionFeColorMatrix; -exports.feComponentTransfer = MotionFeComponentTransfer; -exports.feComposite = MotionFeComposite; -exports.feConvolveMatrix = MotionFeConvolveMatrix; -exports.feDiffuseLighting = MotionFeDiffuseLighting; -exports.feDisplacementMap = MotionFeDisplacementMap; -exports.feDistantLight = MotionFeDistantLight; -exports.feDropShadow = MotionFeDropShadow; -exports.feFlood = MotionFeFlood; -exports.feFuncA = MotionFeFuncA; -exports.feFuncB = MotionFeFuncB; -exports.feFuncG = MotionFeFuncG; -exports.feFuncR = MotionFeFuncR; -exports.feGaussianBlur = MotionFeGaussianBlur; -exports.feImage = MotionFeImage; -exports.feMerge = MotionFeMerge; -exports.feMergeNode = MotionFeMergeNode; -exports.feMorphology = MotionFeMorphology; -exports.feOffset = MotionFeOffset; -exports.fePointLight = MotionFePointLight; -exports.feSpecularLighting = MotionFeSpecularLighting; -exports.feSpotLight = MotionFeSpotLight; -exports.feTile = MotionFeTile; -exports.feTurbulence = MotionFeTurbulence; -exports.fieldset = MotionFieldset; -exports.figcaption = MotionFigcaption; -exports.figure = MotionFigure; -exports.filter = MotionFilter; -exports.footer = MotionFooter; -exports.foreignObject = MotionForeignObject; -exports.form = MotionForm; -exports.g = MotionG; -exports.h1 = MotionH1; -exports.h2 = MotionH2; -exports.h3 = MotionH3; -exports.h4 = MotionH4; -exports.h5 = MotionH5; -exports.h6 = MotionH6; -exports.head = MotionHead; -exports.header = MotionHeader; -exports.hgroup = MotionHgroup; -exports.hr = MotionHr; -exports.html = MotionHtml; -exports.i = MotionI; -exports.iframe = MotionIframe; -exports.image = MotionImage; -exports.img = MotionImg; -exports.input = MotionInput; -exports.ins = MotionIns; -exports.kbd = MotionKbd; -exports.keygen = MotionKeygen; -exports.label = MotionLabel; -exports.legend = MotionLegend; -exports.li = MotionLi; -exports.line = MotionLine; -exports.linearGradient = MotionLinearGradient; -exports.link = MotionLink; -exports.main = MotionMain; -exports.map = MotionMap; -exports.mark = MotionMark; -exports.marker = MotionMarker; -exports.mask = MotionMask; -exports.menu = MotionMenu; -exports.menuitem = MotionMenuitem; -exports.metadata = MotionMetadata; -exports.meter = MotionMeter; -exports.nav = MotionNav; -exports.object = MotionObject; -exports.ol = MotionOl; -exports.optgroup = MotionOptgroup; -exports.option = MotionOption; -exports.output = MotionOutput; -exports.p = MotionP; -exports.param = MotionParam; -exports.path = MotionPath; -exports.pattern = MotionPattern; -exports.picture = MotionPicture; -exports.polygon = MotionPolygon; -exports.polyline = MotionPolyline; -exports.pre = MotionPre; -exports.progress = MotionProgress; -exports.q = MotionQ; -exports.radialGradient = MotionRadialGradient; -exports.rect = MotionRect; -exports.rp = MotionRp; -exports.rt = MotionRt; -exports.ruby = MotionRuby; -exports.s = MotionS; -exports.samp = MotionSamp; -exports.script = MotionScript; -exports.section = MotionSection; -exports.select = MotionSelect; -exports.small = MotionSmall; -exports.source = MotionSource; -exports.span = MotionSpan; -exports.stop = MotionStop; -exports.strong = MotionStrong; -exports.style = MotionStyle; -exports.sub = MotionSub; -exports.summary = MotionSummary; -exports.sup = MotionSup; -exports.svg = MotionSvg; -exports.symbol = MotionSymbol; -exports.table = MotionTable; -exports.tbody = MotionTbody; -exports.td = MotionTd; -exports.text = MotionText; -exports.textPath = MotionTextPath; -exports.textarea = MotionTextarea; -exports.tfoot = MotionTfoot; -exports.th = MotionTh; -exports.thead = MotionThead; -exports.time = MotionTime; -exports.title = MotionTitle; -exports.tr = MotionTr; -exports.track = MotionTrack; -exports.tspan = MotionTspan; -exports.u = MotionU; -exports.ul = MotionUl; -exports.use = MotionUse; -exports.video = MotionVideo; -exports.view = MotionView; -exports.wbr = MotionWbr; -exports.webview = MotionWebview; -//# sourceMappingURL=client.js.map diff --git a/node_modules/framer-motion/dist/cjs/client.js.map b/node_modules/framer-motion/dist/cjs/client.js.map deleted file mode 100644 index 4663f04..0000000 --- a/node_modules/framer-motion/dist/cjs/client.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"client.js","sources":["../../src/render/components/motion/create.ts","../../src/render/components/motion/elements.ts"],"sourcesContent":["import { createMotionComponent, MotionComponentOptions } from \"../../../motion\"\nimport { createDomVisualElement } from \"../../dom/create-visual-element\"\nimport { DOMMotionComponents } from \"../../dom/types\"\nimport { CreateVisualElement } from \"../../types\"\nimport { featureBundle } from \"./feature-bundle\"\n\nexport function createMotionComponentWithFeatures<\n Props,\n TagName extends keyof DOMMotionComponents | string = \"div\"\n>(\n Component: TagName | string | React.ComponentType,\n options?: MotionComponentOptions\n) {\n return createMotionComponent(\n Component,\n options,\n featureBundle,\n createDomVisualElement as CreateVisualElement\n )\n}\n","\"use client\"\n\nimport { createMotionComponentWithFeatures as createMotionComponent } from \"./create\"\n\n/**\n * HTML components\n */\nexport const MotionA = /*@__PURE__*/ createMotionComponent(\"a\")\nexport const MotionAbbr = /*@__PURE__*/ createMotionComponent(\"abbr\")\nexport const MotionAddress = /*@__PURE__*/ createMotionComponent(\"address\")\nexport const MotionArea = /*@__PURE__*/ createMotionComponent(\"area\")\nexport const MotionArticle = /*@__PURE__*/ createMotionComponent(\"article\")\nexport const MotionAside = /*@__PURE__*/ createMotionComponent(\"aside\")\nexport const MotionAudio = /*@__PURE__*/ createMotionComponent(\"audio\")\nexport const MotionB = /*@__PURE__*/ createMotionComponent(\"b\")\nexport const MotionBase = /*@__PURE__*/ createMotionComponent(\"base\")\nexport const MotionBdi = /*@__PURE__*/ createMotionComponent(\"bdi\")\nexport const MotionBdo = /*@__PURE__*/ createMotionComponent(\"bdo\")\nexport const MotionBig = /*@__PURE__*/ createMotionComponent(\"big\")\nexport const MotionBlockquote =\n /*@__PURE__*/ createMotionComponent(\"blockquote\")\nexport const MotionBody = /*@__PURE__*/ createMotionComponent(\"body\")\nexport const MotionButton = /*@__PURE__*/ createMotionComponent(\"button\")\nexport const MotionCanvas = /*@__PURE__*/ createMotionComponent(\"canvas\")\nexport const MotionCaption = /*@__PURE__*/ createMotionComponent(\"caption\")\nexport const MotionCite = /*@__PURE__*/ createMotionComponent(\"cite\")\nexport const MotionCode = /*@__PURE__*/ createMotionComponent(\"code\")\nexport const MotionCol = /*@__PURE__*/ createMotionComponent(\"col\")\nexport const MotionColgroup = /*@__PURE__*/ createMotionComponent(\"colgroup\")\nexport const MotionData = /*@__PURE__*/ createMotionComponent(\"data\")\nexport const MotionDatalist = /*@__PURE__*/ createMotionComponent(\"datalist\")\nexport const MotionDd = /*@__PURE__*/ createMotionComponent(\"dd\")\nexport const MotionDel = /*@__PURE__*/ createMotionComponent(\"del\")\nexport const MotionDetails = /*@__PURE__*/ createMotionComponent(\"details\")\nexport const MotionDfn = /*@__PURE__*/ createMotionComponent(\"dfn\")\nexport const MotionDialog = /*@__PURE__*/ createMotionComponent(\"dialog\")\nexport const MotionDiv = /*@__PURE__*/ createMotionComponent(\"div\")\nexport const MotionDl = /*@__PURE__*/ createMotionComponent(\"dl\")\nexport const MotionDt = /*@__PURE__*/ createMotionComponent(\"dt\")\nexport const MotionEm = /*@__PURE__*/ createMotionComponent(\"em\")\nexport const MotionEmbed = /*@__PURE__*/ createMotionComponent(\"embed\")\nexport const MotionFieldset = /*@__PURE__*/ createMotionComponent(\"fieldset\")\nexport const MotionFigcaption =\n /*@__PURE__*/ createMotionComponent(\"figcaption\")\nexport const MotionFigure = /*@__PURE__*/ createMotionComponent(\"figure\")\nexport const MotionFooter = /*@__PURE__*/ createMotionComponent(\"footer\")\nexport const MotionForm = /*@__PURE__*/ createMotionComponent(\"form\")\nexport const MotionH1 = /*@__PURE__*/ createMotionComponent(\"h1\")\nexport const MotionH2 = /*@__PURE__*/ createMotionComponent(\"h2\")\nexport const MotionH3 = /*@__PURE__*/ createMotionComponent(\"h3\")\nexport const MotionH4 = /*@__PURE__*/ createMotionComponent(\"h4\")\nexport const MotionH5 = /*@__PURE__*/ createMotionComponent(\"h5\")\nexport const MotionH6 = /*@__PURE__*/ createMotionComponent(\"h6\")\nexport const MotionHead = /*@__PURE__*/ createMotionComponent(\"head\")\nexport const MotionHeader = /*@__PURE__*/ createMotionComponent(\"header\")\nexport const MotionHgroup = /*@__PURE__*/ createMotionComponent(\"hgroup\")\nexport const MotionHr = /*@__PURE__*/ createMotionComponent(\"hr\")\nexport const MotionHtml = /*@__PURE__*/ createMotionComponent(\"html\")\nexport const MotionI = /*@__PURE__*/ createMotionComponent(\"i\")\nexport const MotionIframe = /*@__PURE__*/ createMotionComponent(\"iframe\")\nexport const MotionImg = /*@__PURE__*/ createMotionComponent(\"img\")\nexport const MotionInput = /*@__PURE__*/ createMotionComponent(\"input\")\nexport const MotionIns = /*@__PURE__*/ createMotionComponent(\"ins\")\nexport const MotionKbd = /*@__PURE__*/ createMotionComponent(\"kbd\")\nexport const MotionKeygen = /*@__PURE__*/ createMotionComponent(\"keygen\")\nexport const MotionLabel = /*@__PURE__*/ createMotionComponent(\"label\")\nexport const MotionLegend = /*@__PURE__*/ createMotionComponent(\"legend\")\nexport const MotionLi = /*@__PURE__*/ createMotionComponent(\"li\")\nexport const MotionLink = /*@__PURE__*/ createMotionComponent(\"link\")\nexport const MotionMain = /*@__PURE__*/ createMotionComponent(\"main\")\nexport const MotionMap = /*@__PURE__*/ createMotionComponent(\"map\")\nexport const MotionMark = /*@__PURE__*/ createMotionComponent(\"mark\")\nexport const MotionMenu = /*@__PURE__*/ createMotionComponent(\"menu\")\nexport const MotionMenuitem = /*@__PURE__*/ createMotionComponent(\"menuitem\")\nexport const MotionMeter = /*@__PURE__*/ createMotionComponent(\"meter\")\nexport const MotionNav = /*@__PURE__*/ createMotionComponent(\"nav\")\nexport const MotionObject = /*@__PURE__*/ createMotionComponent(\"object\")\nexport const MotionOl = /*@__PURE__*/ createMotionComponent(\"ol\")\nexport const MotionOptgroup = /*@__PURE__*/ createMotionComponent(\"optgroup\")\nexport const MotionOption = /*@__PURE__*/ createMotionComponent(\"option\")\nexport const MotionOutput = /*@__PURE__*/ createMotionComponent(\"output\")\nexport const MotionP = /*@__PURE__*/ createMotionComponent(\"p\")\nexport const MotionParam = /*@__PURE__*/ createMotionComponent(\"param\")\nexport const MotionPicture = /*@__PURE__*/ createMotionComponent(\"picture\")\nexport const MotionPre = /*@__PURE__*/ createMotionComponent(\"pre\")\nexport const MotionProgress = /*@__PURE__*/ createMotionComponent(\"progress\")\nexport const MotionQ = /*@__PURE__*/ createMotionComponent(\"q\")\nexport const MotionRp = /*@__PURE__*/ createMotionComponent(\"rp\")\nexport const MotionRt = /*@__PURE__*/ createMotionComponent(\"rt\")\nexport const MotionRuby = /*@__PURE__*/ createMotionComponent(\"ruby\")\nexport const MotionS = /*@__PURE__*/ createMotionComponent(\"s\")\nexport const MotionSamp = /*@__PURE__*/ createMotionComponent(\"samp\")\nexport const MotionScript = /*@__PURE__*/ createMotionComponent(\"script\")\nexport const MotionSection = /*@__PURE__*/ createMotionComponent(\"section\")\nexport const MotionSelect = /*@__PURE__*/ createMotionComponent(\"select\")\nexport const MotionSmall = /*@__PURE__*/ createMotionComponent(\"small\")\nexport const MotionSource = /*@__PURE__*/ createMotionComponent(\"source\")\nexport const MotionSpan = /*@__PURE__*/ createMotionComponent(\"span\")\nexport const MotionStrong = /*@__PURE__*/ createMotionComponent(\"strong\")\nexport const MotionStyle = /*@__PURE__*/ createMotionComponent(\"style\")\nexport const MotionSub = /*@__PURE__*/ createMotionComponent(\"sub\")\nexport const MotionSummary = /*@__PURE__*/ createMotionComponent(\"summary\")\nexport const MotionSup = /*@__PURE__*/ createMotionComponent(\"sup\")\nexport const MotionTable = /*@__PURE__*/ createMotionComponent(\"table\")\nexport const MotionTbody = /*@__PURE__*/ createMotionComponent(\"tbody\")\nexport const MotionTd = /*@__PURE__*/ createMotionComponent(\"td\")\nexport const MotionTextarea = /*@__PURE__*/ createMotionComponent(\"textarea\")\nexport const MotionTfoot = /*@__PURE__*/ createMotionComponent(\"tfoot\")\nexport const MotionTh = /*@__PURE__*/ createMotionComponent(\"th\")\nexport const MotionThead = /*@__PURE__*/ createMotionComponent(\"thead\")\nexport const MotionTime = /*@__PURE__*/ createMotionComponent(\"time\")\nexport const MotionTitle = /*@__PURE__*/ createMotionComponent(\"title\")\nexport const MotionTr = /*@__PURE__*/ createMotionComponent(\"tr\")\nexport const MotionTrack = /*@__PURE__*/ createMotionComponent(\"track\")\nexport const MotionU = /*@__PURE__*/ createMotionComponent(\"u\")\nexport const MotionUl = /*@__PURE__*/ createMotionComponent(\"ul\")\nexport const MotionVideo = /*@__PURE__*/ createMotionComponent(\"video\")\nexport const MotionWbr = /*@__PURE__*/ createMotionComponent(\"wbr\")\nexport const MotionWebview = /*@__PURE__*/ createMotionComponent(\"webview\")\n\n/**\n * SVG components\n */\nexport const MotionAnimate = /*@__PURE__*/ createMotionComponent(\"animate\")\nexport const MotionCircle = /*@__PURE__*/ createMotionComponent(\"circle\")\nexport const MotionDefs = /*@__PURE__*/ createMotionComponent(\"defs\")\nexport const MotionDesc = /*@__PURE__*/ createMotionComponent(\"desc\")\nexport const MotionEllipse = /*@__PURE__*/ createMotionComponent(\"ellipse\")\nexport const MotionG = /*@__PURE__*/ createMotionComponent(\"g\")\nexport const MotionImage = /*@__PURE__*/ createMotionComponent(\"image\")\nexport const MotionLine = /*@__PURE__*/ createMotionComponent(\"line\")\nexport const MotionFilter = /*@__PURE__*/ createMotionComponent(\"filter\")\nexport const MotionMarker = /*@__PURE__*/ createMotionComponent(\"marker\")\nexport const MotionMask = /*@__PURE__*/ createMotionComponent(\"mask\")\nexport const MotionMetadata = /*@__PURE__*/ createMotionComponent(\"metadata\")\nexport const MotionPath = /*@__PURE__*/ createMotionComponent(\"path\")\nexport const MotionPattern = /*@__PURE__*/ createMotionComponent(\"pattern\")\nexport const MotionPolygon = /*@__PURE__*/ createMotionComponent(\"polygon\")\nexport const MotionPolyline = /*@__PURE__*/ createMotionComponent(\"polyline\")\nexport const MotionRect = /*@__PURE__*/ createMotionComponent(\"rect\")\nexport const MotionStop = /*@__PURE__*/ createMotionComponent(\"stop\")\nexport const MotionSvg = /*@__PURE__*/ createMotionComponent(\"svg\")\nexport const MotionSymbol = /*@__PURE__*/ createMotionComponent(\"symbol\")\nexport const MotionText = /*@__PURE__*/ createMotionComponent(\"text\")\nexport const MotionTspan = /*@__PURE__*/ createMotionComponent(\"tspan\")\nexport const MotionUse = /*@__PURE__*/ createMotionComponent(\"use\")\nexport const MotionView = /*@__PURE__*/ createMotionComponent(\"view\")\nexport const MotionClipPath = /*@__PURE__*/ createMotionComponent(\"clipPath\")\nexport const MotionFeBlend = /*@__PURE__*/ createMotionComponent(\"feBlend\")\nexport const MotionFeColorMatrix =\n /*@__PURE__*/ createMotionComponent(\"feColorMatrix\")\nexport const MotionFeComponentTransfer = /*@__PURE__*/ createMotionComponent(\n \"feComponentTransfer\"\n)\nexport const MotionFeComposite =\n /*@__PURE__*/ createMotionComponent(\"feComposite\")\nexport const MotionFeConvolveMatrix =\n /*@__PURE__*/ createMotionComponent(\"feConvolveMatrix\")\nexport const MotionFeDiffuseLighting =\n /*@__PURE__*/ createMotionComponent(\"feDiffuseLighting\")\nexport const MotionFeDisplacementMap =\n /*@__PURE__*/ createMotionComponent(\"feDisplacementMap\")\nexport const MotionFeDistantLight =\n /*@__PURE__*/ createMotionComponent(\"feDistantLight\")\nexport const MotionFeDropShadow =\n /*@__PURE__*/ createMotionComponent(\"feDropShadow\")\nexport const MotionFeFlood = /*@__PURE__*/ createMotionComponent(\"feFlood\")\nexport const MotionFeFuncA = /*@__PURE__*/ createMotionComponent(\"feFuncA\")\nexport const MotionFeFuncB = /*@__PURE__*/ createMotionComponent(\"feFuncB\")\nexport const MotionFeFuncG = /*@__PURE__*/ createMotionComponent(\"feFuncG\")\nexport const MotionFeFuncR = /*@__PURE__*/ createMotionComponent(\"feFuncR\")\nexport const MotionFeGaussianBlur =\n /*@__PURE__*/ createMotionComponent(\"feGaussianBlur\")\nexport const MotionFeImage = /*@__PURE__*/ createMotionComponent(\"feImage\")\nexport const MotionFeMerge = /*@__PURE__*/ createMotionComponent(\"feMerge\")\nexport const MotionFeMergeNode =\n /*@__PURE__*/ createMotionComponent(\"feMergeNode\")\nexport const MotionFeMorphology =\n /*@__PURE__*/ createMotionComponent(\"feMorphology\")\nexport const MotionFeOffset = /*@__PURE__*/ createMotionComponent(\"feOffset\")\nexport const MotionFePointLight =\n /*@__PURE__*/ createMotionComponent(\"fePointLight\")\nexport const MotionFeSpecularLighting =\n /*@__PURE__*/ createMotionComponent(\"feSpecularLighting\")\nexport const MotionFeSpotLight =\n /*@__PURE__*/ createMotionComponent(\"feSpotLight\")\nexport const MotionFeTile = /*@__PURE__*/ createMotionComponent(\"feTile\")\nexport const MotionFeTurbulence =\n /*@__PURE__*/ createMotionComponent(\"feTurbulence\")\nexport const MotionForeignObject =\n /*@__PURE__*/ createMotionComponent(\"foreignObject\")\nexport const MotionLinearGradient =\n /*@__PURE__*/ createMotionComponent(\"linearGradient\")\nexport const MotionRadialGradient =\n /*@__PURE__*/ createMotionComponent(\"radialGradient\")\nexport const MotionTextPath = /*@__PURE__*/ createMotionComponent(\"textPath\")\n"],"names":["createMotionComponent","featureBundle","createDom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iBAAiBA,iCAAqB,CAAC,SAAS;AACnE,MAAM,aAAa,iBAAiBA,iCAAqB,CAAC,SAAS;AACnE,MAAM,aAAa,iBAAiBA,iCAAqB,CAAC,SAAS;MAC7D,oBAAoB;AAC7B,cAAcA,iCAAqB,CAAC,gBAAgB;AACjD,MAAM,aAAa,iBAAiBA,iCAAqB,CAAC,SAAS;AACnE,MAAM,aAAa,iBAAiBA,iCAAqB,CAAC,SAAS;MAC7D,iBAAiB;AAC1B,cAAcA,iCAAqB,CAAC,aAAa;MACxC,kBAAkB;AAC3B,cAAcA,iCAAqB,CAAC,cAAc;AAC/C,MAAM,cAAc,iBAAiBA,iCAAqB,CAAC,UAAU;MAC/D,kBAAkB;AAC3B,cAAcA,iCAAqB,CAAC,cAAc;MACzC,wBAAwB;AACjC,cAAcA,iCAAqB,CAAC,oBAAoB;MAC/C,iBAAiB;AAC1B,cAAcA,iCAAqB,CAAC,aAAa;AAC9C,MAAM,YAAY,iBAAiBA,iCAAqB,CAAC,QAAQ;MAC3D,kBAAkB;AAC3B,cAAcA,iCAAqB,CAAC,cAAc;MACzC,mBAAmB;AAC5B,cAAcA,iCAAqB,CAAC,eAAe;MAC1C,oBAAoB;AAC7B,cAAcA,iCAAqB,CAAC,gBAAgB;MAC3C,oBAAoB;AAC7B,cAAcA,iCAAqB,CAAC,gBAAgB;AACjD,MAAM,cAAc,iBAAiBA,iCAAqB,CAAC,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/cjs/debug.js b/node_modules/framer-motion/dist/cjs/debug.js deleted file mode 100644 index 6fb2ed6..0000000 --- a/node_modules/framer-motion/dist/cjs/debug.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { value: true }); - -var motionDom = require('motion-dom'); - - - -Object.defineProperty(exports, "recordStats", { - enumerable: true, - get: function () { return motionDom.recordStats; } -}); -//# sourceMappingURL=debug.js.map diff --git a/node_modules/framer-motion/dist/cjs/debug.js.map b/node_modules/framer-motion/dist/cjs/debug.js.map deleted file mode 100644 index ec4f5cd..0000000 --- a/node_modules/framer-motion/dist/cjs/debug.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"debug.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/cjs/dom-mini.js b/node_modules/framer-motion/dist/cjs/dom-mini.js deleted file mode 100644 index b33c928..0000000 --- a/node_modules/framer-motion/dist/cjs/dom-mini.js +++ /dev/null @@ -1,531 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { value: true }); - -var motionDom = require('motion-dom'); -var motionUtils = require('motion-utils'); - -function isDOMKeyframes(keyframes) { - return typeof keyframes === "object" && !Array.isArray(keyframes); -} - -function resolveSubjects(subject, keyframes, scope, selectorCache) { - if (subject == null) { - return []; - } - if (typeof subject === "string" && isDOMKeyframes(keyframes)) { - return motionDom.resolveElements(subject, scope, selectorCache); - } - else if (subject instanceof NodeList) { - return Array.from(subject); - } - else if (Array.isArray(subject)) { - return subject.filter((s) => s != null); - } - else { - return [subject]; - } -} - -function calculateRepeatDuration(duration, repeat, repeatDelay) { - return duration * (repeat + 1) + repeatDelay * repeat; -} - -/** - * Given a absolute or relative time definition and current/prev time state of the sequence, - * calculate an absolute time for the next keyframes. - */ -function calcNextTime(current, next, prev, labels) { - if (typeof next === "number") { - return next; - } - else if (next.startsWith("-") || next.startsWith("+")) { - return Math.max(0, current + parseFloat(next)); - } - else if (next === "<") { - return prev; - } - else if (next.startsWith("<")) { - return Math.max(0, prev + parseFloat(next.slice(1))); - } - else { - return labels.get(next) ?? current; - } -} - -function eraseKeyframes(sequence, startTime, endTime) { - for (let i = 0; i < sequence.length; i++) { - const keyframe = sequence[i]; - if (keyframe.at > startTime && keyframe.at < endTime) { - motionUtils.removeItem(sequence, keyframe); - // If we remove this item we have to push the pointer back one - i--; - } - } -} -function addKeyframes(sequence, keyframes, easing, offset, startTime, endTime) { - /** - * Erase every existing value between currentTime and targetTime, - * this will essentially splice this timeline into any currently - * defined ones. - */ - eraseKeyframes(sequence, startTime, endTime); - for (let i = 0; i < keyframes.length; i++) { - sequence.push({ - value: keyframes[i], - at: motionDom.mixNumber(startTime, endTime, offset[i]), - easing: motionUtils.getEasingForSegment(easing, i), - }); - } -} - -/** - * Take an array of times that represent repeated keyframes. For instance - * if we have original times of [0, 0.5, 1] then our repeated times will - * be [0, 0.5, 1, 1, 1.5, 2]. Loop over the times and scale them back - * down to a 0-1 scale. - * - * `repeatDelayUnits` is the repeatDelay expressed in units of a single - * iteration's duration, so the total span equals `(repeat + 1) + repeat * repeatDelayUnits`. - */ -function normalizeTimes(times, repeat, repeatDelayUnits = 0) { - const totalUnits = repeat + 1 + repeat * repeatDelayUnits; - for (let i = 0; i < times.length; i++) { - times[i] = times[i] / totalUnits; - } -} - -function compareByTime(a, b) { - if (a.at === b.at) { - if (a.value === null) - return 1; - if (b.value === null) - return -1; - return 0; - } - else { - return a.at - b.at; - } -} - -const defaultSegmentEasing = "easeInOut"; -const MAX_REPEAT = 20; -function createAnimationsFromSequence(sequence, { defaultTransition = {}, ...sequenceTransition } = {}, scope, generators) { - const defaultDuration = defaultTransition.duration || 0.3; - const animationDefinitions = new Map(); - const sequences = new Map(); - const elementCache = {}; - const timeLabels = new Map(); - let prevTime = 0; - let currentTime = 0; - let totalDuration = 0; - /** - * Build the timeline by mapping over the sequence array and converting - * the definitions into keyframes and offsets with absolute time values. - * These will later get converted into relative offsets in a second pass. - */ - for (let i = 0; i < sequence.length; i++) { - const segment = sequence[i]; - /** - * If this is a timeline label, mark it and skip the rest of this iteration. - */ - if (typeof segment === "string") { - timeLabels.set(segment, currentTime); - continue; - } - else if (!Array.isArray(segment)) { - timeLabels.set(segment.name, calcNextTime(currentTime, segment.at, prevTime, timeLabels)); - continue; - } - let [subject, keyframes, transition = {}] = segment; - /** - * If a relative or absolute time value has been specified we need to resolve - * it in relation to the currentTime. - */ - if (transition.at !== undefined) { - currentTime = calcNextTime(currentTime, transition.at, prevTime, timeLabels); - } - /** - * Keep track of the maximum duration in this definition. This will be - * applied to currentTime once the definition has been parsed. - */ - let maxDuration = 0; - const resolveValueSequence = (valueKeyframes, valueTransition, valueSequence, elementIndex = 0, numSubjects = 0) => { - const valueKeyframesAsList = keyframesAsList(valueKeyframes); - const { delay = 0, times = motionDom.defaultOffset(valueKeyframesAsList), type = defaultTransition.type || "keyframes", repeat, repeatType, repeatDelay = 0, ...remainingTransition } = valueTransition; - let { ease = defaultTransition.ease || "easeOut", duration } = valueTransition; - /** - * Resolve stagger() if defined. - */ - const calculatedDelay = typeof delay === "function" - ? delay(elementIndex, numSubjects) - : delay; - /** - * If this animation should and can use a spring, generate a spring easing function. - */ - const numKeyframes = valueKeyframesAsList.length; - const createGenerator = motionDom.isGenerator(type) - ? type - : generators?.[type || "keyframes"]; - if (numKeyframes <= 2 && createGenerator) { - /** - * As we're creating an easing function from a spring, - * ideally we want to generate it using the real distance - * between the two keyframes. However this isn't always - * possible - in these situations we use 0-100. - */ - let absoluteDelta = 100; - if (numKeyframes === 2 && - isNumberKeyframesArray(valueKeyframesAsList)) { - const delta = valueKeyframesAsList[1] - valueKeyframesAsList[0]; - absoluteDelta = Math.abs(delta); - } - const springTransition = { - ...defaultTransition, - ...remainingTransition, - }; - if (duration !== undefined) { - springTransition.duration = motionUtils.secondsToMilliseconds(duration); - } - const springEasing = motionDom.createGeneratorEasing(springTransition, absoluteDelta, createGenerator); - ease = springEasing.ease; - duration = springEasing.duration; - } - duration ?? (duration = defaultDuration); - const startTime = currentTime + calculatedDelay; - /** - * If there's only one time offset of 0, fill in a second with length 1 - */ - if (times.length === 1 && times[0] === 0) { - times[1] = 1; - } - /** - * Fill out if offset if fewer offsets than keyframes - */ - const remainder = times.length - valueKeyframesAsList.length; - remainder > 0 && motionDom.fillOffset(times, remainder); - /** - * If only one value has been set, ie [1], push a null to the start of - * the keyframe array. This will let us mark a keyframe at this point - * that will later be hydrated with the previous value. - */ - valueKeyframesAsList.length === 1 && - valueKeyframesAsList.unshift(null); - /** - * Segments can't express `repeat: Infinity` or very large - * counts — they'd leave dead time after the segment or - * explode the keyframe array. Ignore with a warning. - */ - if (repeat) { - motionUtils.warning(repeat < MAX_REPEAT, `Sequence segments can't repeat ${repeat} times — ignoring repeat option. Use a value below ${MAX_REPEAT} or apply repeat at the sequence level instead.`); - } - if (repeat && repeat < MAX_REPEAT) { - /** - * Express repeatDelay in units of a single iteration's duration - * so it can be added to the per-iteration time offsets below - * before they're normalized to 0-1. - */ - const repeatDelayUnits = duration > 0 ? repeatDelay / duration : 0; - duration = calculateRepeatDuration(duration, repeat, repeatDelay); - const originalKeyframes = [...valueKeyframesAsList]; - const originalTimes = [...times]; - ease = Array.isArray(ease) ? [...ease] : [ease]; - const originalEase = [...ease]; - /** - * For reverse/mirror, alternate iterations play the segment - * backwards. mirror matches JSAnimation's mirroredGenerator: - * reversed keyframes, easings unchanged. reverse matches - * JSAnimation's iterationProgress = 1 - p: reversed - * keyframes, easing array reversed AND each function easing - * mapped through reverseEasing (string easings unchanged — - * they're resolved later by the keyframes engine). - */ - const isFlipping = repeatType === "reverse" || repeatType === "mirror"; - let flippedKeyframes = originalKeyframes; - let flippedEases = originalEase; - if (isFlipping) { - flippedKeyframes = [...originalKeyframes].reverse(); - if (repeatType === "reverse") { - flippedEases = [...originalEase] - .reverse() - .map((e) => typeof e === "function" - ? motionUtils.reverseEasing(e) - : e); - } - } - for (let repeatIndex = 0; repeatIndex < repeat; repeatIndex++) { - const isFlipped = isFlipping && repeatIndex % 2 === 0; - const iterKeyframes = isFlipped - ? flippedKeyframes - : originalKeyframes; - const iterEase = isFlipped ? flippedEases : originalEase; - const iterStartOffset = (repeatIndex + 1) * (1 + repeatDelayUnits); - /** - * If repeatDelay is set, hold the previous iteration's - * final value through the delay by inserting a keyframe - * at the moment the next iteration begins. - */ - if (repeatDelayUnits > 0) { - valueKeyframesAsList.push(valueKeyframesAsList[valueKeyframesAsList.length - 1]); - times.push(iterStartOffset); - ease.push("linear"); - } - valueKeyframesAsList.push(...iterKeyframes); - for (let keyframeIndex = 0; keyframeIndex < iterKeyframes.length; keyframeIndex++) { - times.push(originalTimes[keyframeIndex] + iterStartOffset); - ease.push(keyframeIndex === 0 - ? "linear" - : motionUtils.getEasingForSegment(iterEase, keyframeIndex - 1)); - } - } - normalizeTimes(times, repeat, repeatDelayUnits); - } - const targetTime = startTime + duration; - /** - * Add keyframes, mapping offsets to absolute time. - */ - addKeyframes(valueSequence, valueKeyframesAsList, ease, times, startTime, targetTime); - maxDuration = Math.max(calculatedDelay + duration, maxDuration); - totalDuration = Math.max(targetTime, totalDuration); - }; - if (motionDom.isMotionValue(subject)) { - const subjectSequence = getSubjectSequence(subject, sequences); - resolveValueSequence(keyframes, transition, getValueSequence("default", subjectSequence)); - } - else { - const subjects = resolveSubjects(subject, keyframes, scope, elementCache); - const numSubjects = subjects.length; - /** - * For every element in this segment, process the defined values. - */ - for (let subjectIndex = 0; subjectIndex < numSubjects; subjectIndex++) { - /** - * Cast necessary, but we know these are of this type - */ - keyframes = keyframes; - transition = transition; - const thisSubject = subjects[subjectIndex]; - const subjectSequence = getSubjectSequence(thisSubject, sequences); - for (const key in keyframes) { - resolveValueSequence(keyframes[key], getValueTransition(transition, key), getValueSequence(key, subjectSequence), subjectIndex, numSubjects); - } - } - } - prevTime = currentTime; - currentTime += maxDuration; - } - /** - * For every element and value combination create a new animation. - */ - sequences.forEach((valueSequences, element) => { - for (const key in valueSequences) { - const valueSequence = valueSequences[key]; - /** - * Arrange all the keyframes in ascending time order. - */ - valueSequence.sort(compareByTime); - const keyframes = []; - const valueOffset = []; - const valueEasing = []; - /** - * For each keyframe, translate absolute times into - * relative offsets based on the total duration of the timeline. - */ - for (let i = 0; i < valueSequence.length; i++) { - const { at, value, easing } = valueSequence[i]; - keyframes.push(value); - valueOffset.push(motionUtils.progress(0, totalDuration, at)); - valueEasing.push(easing || "easeOut"); - } - /** - * If the first keyframe doesn't land on offset: 0 - * provide one by duplicating the initial keyframe. This ensures - * it snaps to the first keyframe when the animation starts. - */ - if (valueOffset[0] !== 0) { - valueOffset.unshift(0); - keyframes.unshift(keyframes[0]); - valueEasing.unshift(defaultSegmentEasing); - } - /** - * If the last keyframe doesn't land on offset: 1 - * provide one with a null wildcard value. This will ensure it - * stays static until the end of the animation. - */ - if (valueOffset[valueOffset.length - 1] !== 1) { - valueOffset.push(1); - keyframes.push(null); - } - if (!animationDefinitions.has(element)) { - animationDefinitions.set(element, { - keyframes: {}, - transition: {}, - }); - } - const definition = animationDefinitions.get(element); - definition.keyframes[key] = keyframes; - /** - * Exclude `type` from defaultTransition since springs have been - * converted to duration-based easing functions in resolveValueSequence. - * Including `type: "spring"` would cause JSAnimation to error when - * the merged keyframes array has more than 2 keyframes. - */ - const { type: _type, ...remainingDefaultTransition } = defaultTransition; - definition.transition[key] = { - ...remainingDefaultTransition, - duration: totalDuration, - ease: valueEasing, - times: valueOffset, - ...sequenceTransition, - }; - } - }); - return animationDefinitions; -} -function getSubjectSequence(subject, sequences) { - !sequences.has(subject) && sequences.set(subject, {}); - return sequences.get(subject); -} -function getValueSequence(name, sequences) { - if (!sequences[name]) - sequences[name] = []; - return sequences[name]; -} -function keyframesAsList(keyframes) { - return Array.isArray(keyframes) ? keyframes : [keyframes]; -} -function getValueTransition(transition, key) { - return transition && transition[key] - ? { - ...transition, - ...transition[key], - } - : { ...transition }; -} -const isNumber = (keyframe) => typeof keyframe === "number"; -const isNumberKeyframesArray = (keyframes) => keyframes.every(isNumber); - -function animateElements(elementOrSelector, keyframes, options, scope) { - // Gracefully handle null/undefined elements (e.g., from querySelector returning null) - if (elementOrSelector == null) { - return []; - } - const elements = motionDom.resolveElements(elementOrSelector, scope); - const numElements = elements.length; - motionUtils.invariant(Boolean(numElements), "No valid elements provided.", "no-valid-elements"); - /** - * WAAPI doesn't support interrupting animations. - * - * Therefore, starting animations requires a three-step process: - * 1. Stop existing animations (write styles to DOM) - * 2. Resolve keyframes (read styles from DOM) - * 3. Create new animations (write styles to DOM) - * - * The hybrid `animate()` function uses AsyncAnimation to resolve - * keyframes before creating new animations, which removes style - * thrashing. Here, we have much stricter filesize constraints. - * Therefore we do this in a synchronous way that ensures that - * at least within `animate()` calls there is no style thrashing. - * - * In the motion-native-animate-mini-interrupt benchmark this - * was 80% faster than a single loop. - */ - const animationDefinitions = []; - /** - * Step 1: Build options and stop existing animations (write) - */ - for (let i = 0; i < numElements; i++) { - const element = elements[i]; - const elementTransition = { ...options }; - /** - * Resolve stagger function if provided. - */ - if (typeof elementTransition.delay === "function") { - elementTransition.delay = elementTransition.delay(i, numElements); - } - for (const valueName in keyframes) { - let valueKeyframes = keyframes[valueName]; - if (!Array.isArray(valueKeyframes)) { - valueKeyframes = [valueKeyframes]; - } - const valueOptions = { - ...motionDom.getValueTransition(elementTransition, valueName), - }; - valueOptions.duration && (valueOptions.duration = motionUtils.secondsToMilliseconds(valueOptions.duration)); - valueOptions.delay && (valueOptions.delay = motionUtils.secondsToMilliseconds(valueOptions.delay)); - /** - * If there's an existing animation playing on this element then stop it - * before creating a new one. - */ - const map = motionDom.getAnimationMap(element); - const key = motionDom.animationMapKey(valueName, valueOptions.pseudoElement || ""); - const currentAnimation = map.get(key); - currentAnimation && currentAnimation.stop(); - animationDefinitions.push({ - map, - key, - unresolvedKeyframes: valueKeyframes, - options: { - ...valueOptions, - element, - name: valueName, - allowFlatten: !elementTransition.type && !elementTransition.ease, - }, - }); - } - } - /** - * Step 2: Resolve keyframes (read) - */ - for (let i = 0; i < animationDefinitions.length; i++) { - const { unresolvedKeyframes, options: animationOptions } = animationDefinitions[i]; - const { element, name, pseudoElement } = animationOptions; - if (!pseudoElement && unresolvedKeyframes[0] === null) { - unresolvedKeyframes[0] = motionDom.getComputedStyle(element, name); - } - motionDom.fillWildcards(unresolvedKeyframes); - motionDom.applyPxDefaults(unresolvedKeyframes, name); - /** - * If we only have one keyframe, explicitly read the initial keyframe - * from the computed style. This is to ensure consistency with WAAPI behaviour - * for restarting animations, for instance .play() after finish, when it - * has one vs two keyframes. - */ - if (!pseudoElement && unresolvedKeyframes.length < 2) { - unresolvedKeyframes.unshift(motionDom.getComputedStyle(element, name)); - } - animationOptions.keyframes = unresolvedKeyframes; - } - /** - * Step 3: Create new animations (write) - */ - const animations = []; - for (let i = 0; i < animationDefinitions.length; i++) { - const { map, key, options: animationOptions } = animationDefinitions[i]; - const animation = new motionDom.NativeAnimation(animationOptions); - map.set(key, animation); - animation.finished.finally(() => map.delete(key)); - animations.push(animation); - } - return animations; -} - -function animateSequence(definition, options) { - const animations = []; - createAnimationsFromSequence(definition, options).forEach(({ keyframes, transition }, element) => { - animations.push(...animateElements(element, keyframes, transition)); - }); - return new motionDom.GroupAnimationWithThen(animations); -} - -const createScopedWaapiAnimate = (scope) => { - function scopedAnimate(elementOrSelector, keyframes, options) { - return new motionDom.GroupAnimationWithThen(animateElements(elementOrSelector, keyframes, options, scope)); - } - return scopedAnimate; -}; -const animateMini = /*@__PURE__*/ createScopedWaapiAnimate(); - -exports.animate = animateMini; -exports.animateSequence = animateSequence; -//# sourceMappingURL=dom-mini.js.map diff --git a/node_modules/framer-motion/dist/cjs/dom-mini.js.map b/node_modules/framer-motion/dist/cjs/dom-mini.js.map deleted file mode 100644 index 571da8e..0000000 --- a/node_modules/framer-motion/dist/cjs/dom-mini.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"dom-mini.js","sources":["../../src/animation/utils/is-dom-keyframes.ts","../../src/animation/animate/resolve-subjects.ts","../../src/animation/sequence/utils/calc-repeat-duration.ts","../../src/animation/sequence/utils/calc-time.ts","../../src/animation/sequence/utils/edit.ts","../../src/animation/sequence/utils/normalize-times.ts","../../src/animation/sequence/utils/sort.ts","../../src/animation/sequence/create.ts","../../src/animation/animators/waapi/animate-elements.ts","../../src/animation/animators/waapi/animate-sequence.ts","../../src/animation/animators/waapi/animate-style.ts"],"sourcesContent":["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(\n subject:\n | string\n | Element\n | Element[]\n | NodeListOf\n | O\n | O[]\n | null\n | undefined,\n keyframes: DOMKeyframesDefinition | ObjectTarget,\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\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()\n const elementCache = {}\n const timeLabels = new Map()\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(\n subject: Element | MotionValue | O,\n sequences: Map\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 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>\n key: string\n unresolvedKeyframes: UnresolvedValueKeyframe[]\n options: Omit & {\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 { AnimationPlaybackControls, GroupAnimationWithThen } from \"motion-dom\"\nimport { createAnimationsFromSequence } from \"../../sequence/create\"\nimport { AnimationSequence, SequenceOptions } from \"../../sequence/types\"\nimport { animateElements } from \"./animate-elements\"\n\nexport function animateSequence(\n definition: AnimationSequence,\n options?: SequenceOptions\n) {\n const animations: AnimationPlaybackControls[] = []\n\n createAnimationsFromSequence(definition, options).forEach(\n ({ keyframes, transition }, element: Element) => {\n animations.push(...animateElements(element, keyframes, transition))\n }\n )\n\n return new GroupAnimationWithThen(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"],"names":["resolveElements","removeItem","mixNumber","getEasingForSegment","defaultOffset","isGenerator","secondsToMilliseconds","createGeneratorEasing","fillOffset","warning","reverseEasing","isMotionValue","progress","invariant","getValueTransition","getAnimationMap","animationMapKey","getComputedStyle","fillWildcards","applyPxDefaults","NativeAnimation","GroupAnimationWithThen"],"mappings":";;;;;;;AAEM,SAAU,cAAc,CAC1B,SAAkB,EAAA;AAElB,IAAA,OAAO,OAAO,SAAS,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC;AACrE;;ACGM,SAAU,eAAe,CAC3B,OAQe,EACf,SAAmD,EACnD,KAAsB,EACtB,aAA6B,EAAA;AAE7B,IAAA,IAAI,OAAO,IAAI,IAAI,EAAE;AACjB,QAAA,OAAO,EAAE;IACb;IAEA,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,cAAc,CAAC,SAAS,CAAC,EAAE;QAC1D,OAAOA,yBAAe,CAAC,OAAO,EAAE,KAAK,EAAE,aAAa,CAAC;IACzD;AAAO,SAAA,IAAI,OAAO,YAAY,QAAQ,EAAE;AACpC,QAAA,OAAO,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC;IAC9B;AAAO,SAAA,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;AAC/B,QAAA,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC;IAC3C;SAAO;QACH,OAAO,CAAC,OAAO,CAAC;IACpB;AACJ;;SCpCgB,uBAAuB,CACnC,QAAgB,EACh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AAa;AACxB,CAAC;MAEY,WAAW,iBAAiB,wBAAwB;;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/cjs/dom.js b/node_modules/framer-motion/dist/cjs/dom.js deleted file mode 100644 index 316013a..0000000 --- a/node_modules/framer-motion/dist/cjs/dom.js +++ /dev/null @@ -1,1354 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { value: true }); - -var motionDom = require('motion-dom'); -var motionUtils = require('motion-utils'); - -function isDOMKeyframes(keyframes) { - return typeof keyframes === "object" && !Array.isArray(keyframes); -} - -function resolveSubjects(subject, keyframes, scope, selectorCache) { - if (subject == null) { - return []; - } - if (typeof subject === "string" && isDOMKeyframes(keyframes)) { - return motionDom.resolveElements(subject, scope, selectorCache); - } - else if (subject instanceof NodeList) { - return Array.from(subject); - } - else if (Array.isArray(subject)) { - return subject.filter((s) => s != null); - } - else { - return [subject]; - } -} - -function calculateRepeatDuration(duration, repeat, repeatDelay) { - return duration * (repeat + 1) + repeatDelay * repeat; -} - -/** - * Given a absolute or relative time definition and current/prev time state of the sequence, - * calculate an absolute time for the next keyframes. - */ -function calcNextTime(current, next, prev, labels) { - if (typeof next === "number") { - return next; - } - else if (next.startsWith("-") || next.startsWith("+")) { - return Math.max(0, current + parseFloat(next)); - } - else if (next === "<") { - return prev; - } - else if (next.startsWith("<")) { - return Math.max(0, prev + parseFloat(next.slice(1))); - } - else { - return labels.get(next) ?? current; - } -} - -function eraseKeyframes(sequence, startTime, endTime) { - for (let i = 0; i < sequence.length; i++) { - const keyframe = sequence[i]; - if (keyframe.at > startTime && keyframe.at < endTime) { - motionUtils.removeItem(sequence, keyframe); - // If we remove this item we have to push the pointer back one - i--; - } - } -} -function addKeyframes(sequence, keyframes, easing, offset, startTime, endTime) { - /** - * Erase every existing value between currentTime and targetTime, - * this will essentially splice this timeline into any currently - * defined ones. - */ - eraseKeyframes(sequence, startTime, endTime); - for (let i = 0; i < keyframes.length; i++) { - sequence.push({ - value: keyframes[i], - at: motionDom.mixNumber(startTime, endTime, offset[i]), - easing: motionUtils.getEasingForSegment(easing, i), - }); - } -} - -/** - * Take an array of times that represent repeated keyframes. For instance - * if we have original times of [0, 0.5, 1] then our repeated times will - * be [0, 0.5, 1, 1, 1.5, 2]. Loop over the times and scale them back - * down to a 0-1 scale. - * - * `repeatDelayUnits` is the repeatDelay expressed in units of a single - * iteration's duration, so the total span equals `(repeat + 1) + repeat * repeatDelayUnits`. - */ -function normalizeTimes(times, repeat, repeatDelayUnits = 0) { - const totalUnits = repeat + 1 + repeat * repeatDelayUnits; - for (let i = 0; i < times.length; i++) { - times[i] = times[i] / totalUnits; - } -} - -function compareByTime(a, b) { - if (a.at === b.at) { - if (a.value === null) - return 1; - if (b.value === null) - return -1; - return 0; - } - else { - return a.at - b.at; - } -} - -const defaultSegmentEasing = "easeInOut"; -const MAX_REPEAT = 20; -function createAnimationsFromSequence(sequence, { defaultTransition = {}, ...sequenceTransition } = {}, scope, generators) { - const defaultDuration = defaultTransition.duration || 0.3; - const animationDefinitions = new Map(); - const sequences = new Map(); - const elementCache = {}; - const timeLabels = new Map(); - let prevTime = 0; - let currentTime = 0; - let totalDuration = 0; - /** - * Build the timeline by mapping over the sequence array and converting - * the definitions into keyframes and offsets with absolute time values. - * These will later get converted into relative offsets in a second pass. - */ - for (let i = 0; i < sequence.length; i++) { - const segment = sequence[i]; - /** - * If this is a timeline label, mark it and skip the rest of this iteration. - */ - if (typeof segment === "string") { - timeLabels.set(segment, currentTime); - continue; - } - else if (!Array.isArray(segment)) { - timeLabels.set(segment.name, calcNextTime(currentTime, segment.at, prevTime, timeLabels)); - continue; - } - let [subject, keyframes, transition = {}] = segment; - /** - * If a relative or absolute time value has been specified we need to resolve - * it in relation to the currentTime. - */ - if (transition.at !== undefined) { - currentTime = calcNextTime(currentTime, transition.at, prevTime, timeLabels); - } - /** - * Keep track of the maximum duration in this definition. This will be - * applied to currentTime once the definition has been parsed. - */ - let maxDuration = 0; - const resolveValueSequence = (valueKeyframes, valueTransition, valueSequence, elementIndex = 0, numSubjects = 0) => { - const valueKeyframesAsList = keyframesAsList(valueKeyframes); - const { delay = 0, times = motionDom.defaultOffset(valueKeyframesAsList), type = defaultTransition.type || "keyframes", repeat, repeatType, repeatDelay = 0, ...remainingTransition } = valueTransition; - let { ease = defaultTransition.ease || "easeOut", duration } = valueTransition; - /** - * Resolve stagger() if defined. - */ - const calculatedDelay = typeof delay === "function" - ? delay(elementIndex, numSubjects) - : delay; - /** - * If this animation should and can use a spring, generate a spring easing function. - */ - const numKeyframes = valueKeyframesAsList.length; - const createGenerator = motionDom.isGenerator(type) - ? type - : generators?.[type || "keyframes"]; - if (numKeyframes <= 2 && createGenerator) { - /** - * As we're creating an easing function from a spring, - * ideally we want to generate it using the real distance - * between the two keyframes. However this isn't always - * possible - in these situations we use 0-100. - */ - let absoluteDelta = 100; - if (numKeyframes === 2 && - isNumberKeyframesArray(valueKeyframesAsList)) { - const delta = valueKeyframesAsList[1] - valueKeyframesAsList[0]; - absoluteDelta = Math.abs(delta); - } - const springTransition = { - ...defaultTransition, - ...remainingTransition, - }; - if (duration !== undefined) { - springTransition.duration = motionUtils.secondsToMilliseconds(duration); - } - const springEasing = motionDom.createGeneratorEasing(springTransition, absoluteDelta, createGenerator); - ease = springEasing.ease; - duration = springEasing.duration; - } - duration ?? (duration = defaultDuration); - const startTime = currentTime + calculatedDelay; - /** - * If there's only one time offset of 0, fill in a second with length 1 - */ - if (times.length === 1 && times[0] === 0) { - times[1] = 1; - } - /** - * Fill out if offset if fewer offsets than keyframes - */ - const remainder = times.length - valueKeyframesAsList.length; - remainder > 0 && motionDom.fillOffset(times, remainder); - /** - * If only one value has been set, ie [1], push a null to the start of - * the keyframe array. This will let us mark a keyframe at this point - * that will later be hydrated with the previous value. - */ - valueKeyframesAsList.length === 1 && - valueKeyframesAsList.unshift(null); - /** - * Segments can't express `repeat: Infinity` or very large - * counts — they'd leave dead time after the segment or - * explode the keyframe array. Ignore with a warning. - */ - if (repeat) { - motionUtils.warning(repeat < MAX_REPEAT, `Sequence segments can't repeat ${repeat} times — ignoring repeat option. Use a value below ${MAX_REPEAT} or apply repeat at the sequence level instead.`); - } - if (repeat && repeat < MAX_REPEAT) { - /** - * Express repeatDelay in units of a single iteration's duration - * so it can be added to the per-iteration time offsets below - * before they're normalized to 0-1. - */ - const repeatDelayUnits = duration > 0 ? repeatDelay / duration : 0; - duration = calculateRepeatDuration(duration, repeat, repeatDelay); - const originalKeyframes = [...valueKeyframesAsList]; - const originalTimes = [...times]; - ease = Array.isArray(ease) ? [...ease] : [ease]; - const originalEase = [...ease]; - /** - * For reverse/mirror, alternate iterations play the segment - * backwards. mirror matches JSAnimation's mirroredGenerator: - * reversed keyframes, easings unchanged. reverse matches - * JSAnimation's iterationProgress = 1 - p: reversed - * keyframes, easing array reversed AND each function easing - * mapped through reverseEasing (string easings unchanged — - * they're resolved later by the keyframes engine). - */ - const isFlipping = repeatType === "reverse" || repeatType === "mirror"; - let flippedKeyframes = originalKeyframes; - let flippedEases = originalEase; - if (isFlipping) { - flippedKeyframes = [...originalKeyframes].reverse(); - if (repeatType === "reverse") { - flippedEases = [...originalEase] - .reverse() - .map((e) => typeof e === "function" - ? motionUtils.reverseEasing(e) - : e); - } - } - for (let repeatIndex = 0; repeatIndex < repeat; repeatIndex++) { - const isFlipped = isFlipping && repeatIndex % 2 === 0; - const iterKeyframes = isFlipped - ? flippedKeyframes - : originalKeyframes; - const iterEase = isFlipped ? flippedEases : originalEase; - const iterStartOffset = (repeatIndex + 1) * (1 + repeatDelayUnits); - /** - * If repeatDelay is set, hold the previous iteration's - * final value through the delay by inserting a keyframe - * at the moment the next iteration begins. - */ - if (repeatDelayUnits > 0) { - valueKeyframesAsList.push(valueKeyframesAsList[valueKeyframesAsList.length - 1]); - times.push(iterStartOffset); - ease.push("linear"); - } - valueKeyframesAsList.push(...iterKeyframes); - for (let keyframeIndex = 0; keyframeIndex < iterKeyframes.length; keyframeIndex++) { - times.push(originalTimes[keyframeIndex] + iterStartOffset); - ease.push(keyframeIndex === 0 - ? "linear" - : motionUtils.getEasingForSegment(iterEase, keyframeIndex - 1)); - } - } - normalizeTimes(times, repeat, repeatDelayUnits); - } - const targetTime = startTime + duration; - /** - * Add keyframes, mapping offsets to absolute time. - */ - addKeyframes(valueSequence, valueKeyframesAsList, ease, times, startTime, targetTime); - maxDuration = Math.max(calculatedDelay + duration, maxDuration); - totalDuration = Math.max(targetTime, totalDuration); - }; - if (motionDom.isMotionValue(subject)) { - const subjectSequence = getSubjectSequence(subject, sequences); - resolveValueSequence(keyframes, transition, getValueSequence("default", subjectSequence)); - } - else { - const subjects = resolveSubjects(subject, keyframes, scope, elementCache); - const numSubjects = subjects.length; - /** - * For every element in this segment, process the defined values. - */ - for (let subjectIndex = 0; subjectIndex < numSubjects; subjectIndex++) { - /** - * Cast necessary, but we know these are of this type - */ - keyframes = keyframes; - transition = transition; - const thisSubject = subjects[subjectIndex]; - const subjectSequence = getSubjectSequence(thisSubject, sequences); - for (const key in keyframes) { - resolveValueSequence(keyframes[key], getValueTransition(transition, key), getValueSequence(key, subjectSequence), subjectIndex, numSubjects); - } - } - } - prevTime = currentTime; - currentTime += maxDuration; - } - /** - * For every element and value combination create a new animation. - */ - sequences.forEach((valueSequences, element) => { - for (const key in valueSequences) { - const valueSequence = valueSequences[key]; - /** - * Arrange all the keyframes in ascending time order. - */ - valueSequence.sort(compareByTime); - const keyframes = []; - const valueOffset = []; - const valueEasing = []; - /** - * For each keyframe, translate absolute times into - * relative offsets based on the total duration of the timeline. - */ - for (let i = 0; i < valueSequence.length; i++) { - const { at, value, easing } = valueSequence[i]; - keyframes.push(value); - valueOffset.push(motionUtils.progress(0, totalDuration, at)); - valueEasing.push(easing || "easeOut"); - } - /** - * If the first keyframe doesn't land on offset: 0 - * provide one by duplicating the initial keyframe. This ensures - * it snaps to the first keyframe when the animation starts. - */ - if (valueOffset[0] !== 0) { - valueOffset.unshift(0); - keyframes.unshift(keyframes[0]); - valueEasing.unshift(defaultSegmentEasing); - } - /** - * If the last keyframe doesn't land on offset: 1 - * provide one with a null wildcard value. This will ensure it - * stays static until the end of the animation. - */ - if (valueOffset[valueOffset.length - 1] !== 1) { - valueOffset.push(1); - keyframes.push(null); - } - if (!animationDefinitions.has(element)) { - animationDefinitions.set(element, { - keyframes: {}, - transition: {}, - }); - } - const definition = animationDefinitions.get(element); - definition.keyframes[key] = keyframes; - /** - * Exclude `type` from defaultTransition since springs have been - * converted to duration-based easing functions in resolveValueSequence. - * Including `type: "spring"` would cause JSAnimation to error when - * the merged keyframes array has more than 2 keyframes. - */ - const { type: _type, ...remainingDefaultTransition } = defaultTransition; - definition.transition[key] = { - ...remainingDefaultTransition, - duration: totalDuration, - ease: valueEasing, - times: valueOffset, - ...sequenceTransition, - }; - } - }); - return animationDefinitions; -} -function getSubjectSequence(subject, sequences) { - !sequences.has(subject) && sequences.set(subject, {}); - return sequences.get(subject); -} -function getValueSequence(name, sequences) { - if (!sequences[name]) - sequences[name] = []; - return sequences[name]; -} -function keyframesAsList(keyframes) { - return Array.isArray(keyframes) ? keyframes : [keyframes]; -} -function getValueTransition(transition, key) { - return transition && transition[key] - ? { - ...transition, - ...transition[key], - } - : { ...transition }; -} -const isNumber = (keyframe) => typeof keyframe === "number"; -const isNumberKeyframesArray = (keyframes) => keyframes.every(isNumber); - -function createDOMVisualElement(element) { - const options = { - presenceContext: null, - props: {}, - visualState: { - renderState: { - transform: {}, - transformOrigin: {}, - style: {}, - vars: {}, - attrs: {}, - }, - latestValues: {}, - }, - }; - const node = motionDom.isSVGElement(element) && !motionDom.isSVGSVGElement(element) - ? new motionDom.SVGVisualElement(options) - : new motionDom.HTMLVisualElement(options); - node.mount(element); - motionDom.visualElementStore.set(element, node); -} -function createObjectVisualElement(subject) { - const options = { - presenceContext: null, - props: {}, - visualState: { - renderState: { - output: {}, - }, - latestValues: {}, - }, - }; - const node = new motionDom.ObjectVisualElement(options); - node.mount(subject); - motionDom.visualElementStore.set(subject, node); -} - -function isSingleValue(subject, keyframes) { - return (motionDom.isMotionValue(subject) || - typeof subject === "number" || - (typeof subject === "string" && !isDOMKeyframes(keyframes))); -} -/** - * Implementation - */ -function animateSubject(subject, keyframes, options, scope) { - const animations = []; - if (isSingleValue(subject, keyframes)) { - animations.push(motionDom.animateSingleValue(subject, isDOMKeyframes(keyframes) - ? keyframes.default || keyframes - : keyframes, options ? options.default || options : options)); - } - else { - // Gracefully handle null/undefined subjects (e.g., from querySelector returning null) - if (subject == null) { - return animations; - } - const subjects = resolveSubjects(subject, keyframes, scope); - const numSubjects = subjects.length; - motionUtils.invariant(Boolean(numSubjects), "No valid elements provided.", "no-valid-elements"); - for (let i = 0; i < numSubjects; i++) { - const thisSubject = subjects[i]; - const createVisualElement = thisSubject instanceof Element - ? createDOMVisualElement - : createObjectVisualElement; - if (!motionDom.visualElementStore.has(thisSubject)) { - createVisualElement(thisSubject); - } - const visualElement = motionDom.visualElementStore.get(thisSubject); - const transition = { ...options }; - /** - * Resolve stagger function if provided. - */ - if ("delay" in transition && - typeof transition.delay === "function") { - transition.delay = transition.delay(i, numSubjects); - } - animations.push(...motionDom.animateTarget(visualElement, { ...keyframes, transition }, {})); - } - } - return animations; -} - -function animateSequence(sequence, options, scope) { - const animations = []; - /** - * Pre-process: replace function segments with MotionValue segments, - * subscribe callbacks immediately - */ - const processedSequence = sequence.map((segment) => { - if (Array.isArray(segment) && typeof segment[0] === "function") { - const callback = segment[0]; - const mv = motionDom.motionValue(0); - mv.on("change", callback); - if (segment.length === 1) { - return [mv, [0, 1]]; - } - else if (segment.length === 2) { - return [mv, [0, 1], segment[1]]; - } - else { - return [mv, segment[1], segment[2]]; - } - } - return segment; - }); - const animationDefinitions = createAnimationsFromSequence(processedSequence, options, scope, { spring: motionDom.spring }); - animationDefinitions.forEach(({ keyframes, transition }, subject) => { - animations.push(...animateSubject(subject, keyframes, transition)); - }); - return animations; -} - -function isSequence(value) { - return Array.isArray(value) && value.some(Array.isArray); -} -/** - * Creates an animation function that is optionally scoped - * to a specific element. - */ -function createScopedAnimate(options = {}) { - const { scope, reduceMotion, skipAnimations } = options; - /** - * Implementation - */ - function scopedAnimate(subjectOrSequence, optionsOrKeyframes, options) { - let animations = []; - let animationOnComplete; - const inherited = {}; - if (reduceMotion !== undefined) - inherited.reduceMotion = reduceMotion; - if (skipAnimations !== undefined) - inherited.skipAnimations = skipAnimations; - if (isSequence(subjectOrSequence)) { - const { onComplete, ...sequenceOptions } = optionsOrKeyframes || {}; - if (typeof onComplete === "function") { - animationOnComplete = onComplete; - } - animations = animateSequence(subjectOrSequence, { ...inherited, ...sequenceOptions }, scope); - } - else { - // Extract top-level onComplete so it doesn't get applied per-value - const { onComplete, ...rest } = options || {}; - if (typeof onComplete === "function") { - animationOnComplete = onComplete; - } - animations = animateSubject(subjectOrSequence, optionsOrKeyframes, { ...inherited, ...rest }, scope); - } - const animation = new motionDom.GroupAnimationWithThen(animations); - if (animationOnComplete) { - animation.finished.then(animationOnComplete); - } - if (scope) { - scope.animations.push(animation); - animation.finished.then(() => { - motionUtils.removeItem(scope.animations, animation); - }); - } - return animation; - } - return scopedAnimate; -} -const animate = createScopedAnimate(); - -function animateElements(elementOrSelector, keyframes, options, scope) { - // Gracefully handle null/undefined elements (e.g., from querySelector returning null) - if (elementOrSelector == null) { - return []; - } - const elements = motionDom.resolveElements(elementOrSelector, scope); - const numElements = elements.length; - motionUtils.invariant(Boolean(numElements), "No valid elements provided.", "no-valid-elements"); - /** - * WAAPI doesn't support interrupting animations. - * - * Therefore, starting animations requires a three-step process: - * 1. Stop existing animations (write styles to DOM) - * 2. Resolve keyframes (read styles from DOM) - * 3. Create new animations (write styles to DOM) - * - * The hybrid `animate()` function uses AsyncAnimation to resolve - * keyframes before creating new animations, which removes style - * thrashing. Here, we have much stricter filesize constraints. - * Therefore we do this in a synchronous way that ensures that - * at least within `animate()` calls there is no style thrashing. - * - * In the motion-native-animate-mini-interrupt benchmark this - * was 80% faster than a single loop. - */ - const animationDefinitions = []; - /** - * Step 1: Build options and stop existing animations (write) - */ - for (let i = 0; i < numElements; i++) { - const element = elements[i]; - const elementTransition = { ...options }; - /** - * Resolve stagger function if provided. - */ - if (typeof elementTransition.delay === "function") { - elementTransition.delay = elementTransition.delay(i, numElements); - } - for (const valueName in keyframes) { - let valueKeyframes = keyframes[valueName]; - if (!Array.isArray(valueKeyframes)) { - valueKeyframes = [valueKeyframes]; - } - const valueOptions = { - ...motionDom.getValueTransition(elementTransition, valueName), - }; - valueOptions.duration && (valueOptions.duration = motionUtils.secondsToMilliseconds(valueOptions.duration)); - valueOptions.delay && (valueOptions.delay = motionUtils.secondsToMilliseconds(valueOptions.delay)); - /** - * If there's an existing animation playing on this element then stop it - * before creating a new one. - */ - const map = motionDom.getAnimationMap(element); - const key = motionDom.animationMapKey(valueName, valueOptions.pseudoElement || ""); - const currentAnimation = map.get(key); - currentAnimation && currentAnimation.stop(); - animationDefinitions.push({ - map, - key, - unresolvedKeyframes: valueKeyframes, - options: { - ...valueOptions, - element, - name: valueName, - allowFlatten: !elementTransition.type && !elementTransition.ease, - }, - }); - } - } - /** - * Step 2: Resolve keyframes (read) - */ - for (let i = 0; i < animationDefinitions.length; i++) { - const { unresolvedKeyframes, options: animationOptions } = animationDefinitions[i]; - const { element, name, pseudoElement } = animationOptions; - if (!pseudoElement && unresolvedKeyframes[0] === null) { - unresolvedKeyframes[0] = motionDom.getComputedStyle(element, name); - } - motionDom.fillWildcards(unresolvedKeyframes); - motionDom.applyPxDefaults(unresolvedKeyframes, name); - /** - * If we only have one keyframe, explicitly read the initial keyframe - * from the computed style. This is to ensure consistency with WAAPI behaviour - * for restarting animations, for instance .play() after finish, when it - * has one vs two keyframes. - */ - if (!pseudoElement && unresolvedKeyframes.length < 2) { - unresolvedKeyframes.unshift(motionDom.getComputedStyle(element, name)); - } - animationOptions.keyframes = unresolvedKeyframes; - } - /** - * Step 3: Create new animations (write) - */ - const animations = []; - for (let i = 0; i < animationDefinitions.length; i++) { - const { map, key, options: animationOptions } = animationDefinitions[i]; - const animation = new motionDom.NativeAnimation(animationOptions); - map.set(key, animation); - animation.finished.finally(() => map.delete(key)); - animations.push(animation); - } - return animations; -} - -const createScopedWaapiAnimate = (scope) => { - function scopedAnimate(elementOrSelector, keyframes, options) { - return new motionDom.GroupAnimationWithThen(animateElements(elementOrSelector, keyframes, options, scope)); - } - return scopedAnimate; -}; -const animateMini = /*@__PURE__*/ createScopedWaapiAnimate(); - -function canUseNativeTimeline(target) { - if (typeof window === "undefined") - return false; - return target ? motionDom.supportsViewTimeline() : motionDom.supportsScrollTimeline(); -} - -/** - * A time in milliseconds, beyond which we consider the scroll velocity to be 0. - */ -const maxElapsed = 50; -const createAxisInfo = () => ({ - current: 0, - offset: [], - progress: 0, - scrollLength: 0, - targetOffset: 0, - targetLength: 0, - containerLength: 0, - velocity: 0, -}); -const createScrollInfo = () => ({ - time: 0, - x: createAxisInfo(), - y: createAxisInfo(), -}); -const keys = { - x: { - length: "Width", - position: "Left", - }, - y: { - length: "Height", - position: "Top", - }, -}; -function updateAxisInfo(element, axisName, info, time) { - const axis = info[axisName]; - const { length, position } = keys[axisName]; - const prev = axis.current; - const prevTime = info.time; - axis.current = Math.abs(element[`scroll${position}`]); - axis.scrollLength = element[`scroll${length}`] - element[`client${length}`]; - axis.offset.length = 0; - axis.offset[0] = 0; - axis.offset[1] = axis.scrollLength; - axis.progress = motionUtils.progress(0, axis.scrollLength, axis.current); - const elapsed = time - prevTime; - axis.velocity = - elapsed > maxElapsed - ? 0 - : motionUtils.velocityPerSecond(axis.current - prev, elapsed); -} -function updateScrollInfo(element, info, time) { - updateAxisInfo(element, "x", info, time); - updateAxisInfo(element, "y", info, time); - info.time = time; -} - -function calcInset(element, container) { - const inset = { x: 0, y: 0 }; - let current = element; - while (current && current !== container) { - if (motionDom.isHTMLElement(current)) { - inset.x += current.offsetLeft; - inset.y += current.offsetTop; - current = current.offsetParent; - } - else if (current.tagName === "svg") { - /** - * This isn't an ideal approach to measuring the offset of tags. - * It would be preferable, given they behave like HTMLElements in most ways - * to use offsetLeft/Top. But these don't exist on . Likewise we - * can't use .getBBox() like most SVG elements as these provide the offset - * relative to the SVG itself, which for is usually 0x0. - */ - const svgBoundingBox = current.getBoundingClientRect(); - current = current.parentElement; - const parentBoundingBox = current.getBoundingClientRect(); - inset.x += svgBoundingBox.left - parentBoundingBox.left; - inset.y += svgBoundingBox.top - parentBoundingBox.top; - } - else if (current instanceof SVGGraphicsElement) { - const { x, y } = current.getBBox(); - inset.x += x; - inset.y += y; - let svg = null; - let parent = current.parentNode; - while (!svg) { - if (parent.tagName === "svg") { - svg = parent; - } - parent = current.parentNode; - } - current = svg; - } - else { - break; - } - } - return inset; -} - -const namedEdges = { - start: 0, - center: 0.5, - end: 1, -}; -function resolveEdge(edge, length, inset = 0) { - let delta = 0; - /** - * If we have this edge defined as a preset, replace the definition - * with the numerical value. - */ - if (edge in namedEdges) { - edge = namedEdges[edge]; - } - /** - * Handle unit values - */ - if (typeof edge === "string") { - const asNumber = parseFloat(edge); - if (edge.endsWith("px")) { - delta = asNumber; - } - else if (edge.endsWith("%")) { - edge = asNumber / 100; - } - else if (edge.endsWith("vw")) { - delta = (asNumber / 100) * document.documentElement.clientWidth; - } - else if (edge.endsWith("vh")) { - delta = (asNumber / 100) * document.documentElement.clientHeight; - } - else { - edge = asNumber; - } - } - /** - * If the edge is defined as a number, handle as a progress value. - */ - if (typeof edge === "number") { - delta = length * edge; - } - return inset + delta; -} - -const defaultOffset = [0, 0]; -function resolveOffset(offset, containerLength, targetLength, targetInset) { - let offsetDefinition = Array.isArray(offset) ? offset : defaultOffset; - let targetPoint = 0; - let containerPoint = 0; - if (typeof offset === "number") { - /** - * If we're provided offset: [0, 0.5, 1] then each number x should become - * [x, x], so we default to the behaviour of mapping 0 => 0 of both target - * and container etc. - */ - offsetDefinition = [offset, offset]; - } - else if (typeof offset === "string") { - offset = offset.trim(); - if (offset.includes(" ")) { - offsetDefinition = offset.split(" "); - } - else { - /** - * If we're provided a definition like "100px" then we want to apply - * that only to the top of the target point, leaving the container at 0. - * Whereas a named offset like "end" should be applied to both. - */ - offsetDefinition = [offset, namedEdges[offset] ? offset : `0`]; - } - } - targetPoint = resolveEdge(offsetDefinition[0], targetLength, targetInset); - containerPoint = resolveEdge(offsetDefinition[1], containerLength); - return targetPoint - containerPoint; -} - -const ScrollOffset = { - Enter: [ - [0, 1], - [1, 1], - ], - Exit: [ - [0, 0], - [1, 0], - ], - Any: [ - [1, 0], - [0, 1], - ], - All: [ - [0, 0], - [1, 1], - ], -}; - -const point = { x: 0, y: 0 }; -function getTargetSize(target) { - return "getBBox" in target && target.tagName !== "svg" - ? target.getBBox() - : { width: target.clientWidth, height: target.clientHeight }; -} -function resolveOffsets(container, info, options) { - const { offset: offsetDefinition = ScrollOffset.All } = options; - const { target = container, axis = "y" } = options; - const lengthLabel = axis === "y" ? "height" : "width"; - const inset = target !== container ? calcInset(target, container) : point; - /** - * Measure the target and container. If they're the same thing then we - * use the container's scrollWidth/Height as the target, from there - * all other calculations can remain the same. - */ - const targetSize = target === container - ? { width: container.scrollWidth, height: container.scrollHeight } - : getTargetSize(target); - const containerSize = { - width: container.clientWidth, - height: container.clientHeight, - }; - /** - * Reset the length of the resolved offset array rather than creating a new one. - * TODO: More reusable data structures for targetSize/containerSize would also be good. - */ - info[axis].offset.length = 0; - /** - * Populate the offset array by resolving the user's offset definition into - * a list of pixel scroll offets. - */ - let hasChanged = !info[axis].interpolate; - const numOffsets = offsetDefinition.length; - for (let i = 0; i < numOffsets; i++) { - const offset = resolveOffset(offsetDefinition[i], containerSize[lengthLabel], targetSize[lengthLabel], inset[axis]); - if (!hasChanged && offset !== info[axis].interpolatorOffsets[i]) { - hasChanged = true; - } - info[axis].offset[i] = offset; - } - /** - * If the pixel scroll offsets have changed, create a new interpolator function - * to map scroll value into a progress. - */ - if (hasChanged) { - info[axis].interpolate = motionDom.interpolate(info[axis].offset, motionDom.defaultOffset(offsetDefinition), { clamp: false }); - info[axis].interpolatorOffsets = [...info[axis].offset]; - } - info[axis].progress = motionUtils.clamp(0, 1, info[axis].interpolate(info[axis].current)); -} - -function measure(container, target = container, info) { - /** - * Find inset of target within scrollable container - */ - info.x.targetOffset = 0; - info.y.targetOffset = 0; - if (target !== container) { - let node = target; - while (node && node !== container) { - info.x.targetOffset += node.offsetLeft; - info.y.targetOffset += node.offsetTop; - node = node.offsetParent; - } - } - info.x.targetLength = - target === container ? target.scrollWidth : target.clientWidth; - info.y.targetLength = - target === container ? target.scrollHeight : target.clientHeight; - info.x.containerLength = container.clientWidth; - info.y.containerLength = container.clientHeight; - /** - * In development mode ensure scroll containers aren't position: static as this makes - * it difficult to measure their relative positions. The document scrolling element - * is exempt: offsetParent measurements naturally resolve relative to the document. - */ - if (process.env.NODE_ENV !== "production") { - if (container && - target && - target !== container && - container !== document.documentElement && - container !== document.scrollingElement && - container !== document.body) { - motionUtils.warnOnce(getComputedStyle(container).position !== "static", "Please ensure that the container has a non-static position, like 'relative', 'fixed', or 'absolute' to ensure scroll offset is calculated correctly."); - } - } -} -function createOnScrollHandler(element, onScroll, info, options = {}) { - return { - measure: (time) => { - measure(element, options.target, info); - updateScrollInfo(element, info, time); - if (options.offset || options.target) { - resolveOffsets(element, info, options); - } - }, - notify: () => onScroll(info), - }; -} - -const scrollListeners = new WeakMap(); -const resizeListeners = new WeakMap(); -const onScrollHandlers = new WeakMap(); -const scrollSize = new WeakMap(); -const dimensionCheckProcesses = new WeakMap(); -const getEventTarget = (element) => element === document.scrollingElement ? window : element; -function scrollInfo(onScroll, { container = document.scrollingElement, trackContentSize = false, ...options } = {}) { - if (!container) - return motionUtils.noop; - let containerHandlers = onScrollHandlers.get(container); - /** - * Get the onScroll handlers for this container. - * If one isn't found, create a new one. - */ - if (!containerHandlers) { - containerHandlers = new Set(); - onScrollHandlers.set(container, containerHandlers); - } - /** - * Create a new onScroll handler for the provided callback. - */ - const info = createScrollInfo(); - const containerHandler = createOnScrollHandler(container, onScroll, info, options); - containerHandlers.add(containerHandler); - /** - * Check if there's a scroll event listener for this container. - * If not, create one. - */ - if (!scrollListeners.has(container)) { - const measureAll = () => { - for (const handler of containerHandlers) { - handler.measure(motionDom.frameData.timestamp); - } - motionDom.frame.preUpdate(notifyAll); - }; - const notifyAll = () => { - for (const handler of containerHandlers) { - handler.notify(); - } - }; - const listener = () => motionDom.frame.read(measureAll); - scrollListeners.set(container, listener); - const target = getEventTarget(container); - window.addEventListener("resize", listener); - if (container !== document.documentElement) { - resizeListeners.set(container, motionDom.resize(container, listener)); - } - target.addEventListener("scroll", listener); - listener(); - } - /** - * Enable content size tracking if requested and not already enabled. - */ - if (trackContentSize && !dimensionCheckProcesses.has(container)) { - const listener = scrollListeners.get(container); - // Store initial scroll dimensions (object is reused to avoid allocation) - const size = { - width: container.scrollWidth, - height: container.scrollHeight, - }; - scrollSize.set(container, size); - // Add frame-based scroll dimension checking to detect content changes - const checkScrollDimensions = () => { - const newWidth = container.scrollWidth; - const newHeight = container.scrollHeight; - if (size.width !== newWidth || size.height !== newHeight) { - listener(); - size.width = newWidth; - size.height = newHeight; - } - }; - // Schedule with keepAlive=true to run every frame - const dimensionCheckProcess = motionDom.frame.read(checkScrollDimensions, true); - dimensionCheckProcesses.set(container, dimensionCheckProcess); - } - const listener = scrollListeners.get(container); - motionDom.frame.read(listener, false, true); - return () => { - motionDom.cancelFrame(listener); - /** - * Check if we even have any handlers for this container. - */ - const currentHandlers = onScrollHandlers.get(container); - if (!currentHandlers) - return; - currentHandlers.delete(containerHandler); - if (currentHandlers.size) - return; - /** - * If no more handlers, remove the scroll listener too. - */ - const scrollListener = scrollListeners.get(container); - scrollListeners.delete(container); - if (scrollListener) { - getEventTarget(container).removeEventListener("scroll", scrollListener); - resizeListeners.get(container)?.(); - window.removeEventListener("resize", scrollListener); - } - // Clean up scroll dimension checking - const dimensionCheckProcess = dimensionCheckProcesses.get(container); - if (dimensionCheckProcess) { - motionDom.cancelFrame(dimensionCheckProcess); - dimensionCheckProcesses.delete(container); - } - scrollSize.delete(container); - }; -} - -/** - * Maps from ProgressIntersection pairs used by Motion's preset offsets to - * ViewTimeline named ranges. Returns undefined for unrecognised patterns, - * which signals the caller to fall back to JS-based scroll tracking. - */ -const presets = [ - [ScrollOffset.Enter, "entry"], - [ScrollOffset.Exit, "exit"], - [ScrollOffset.Any, "cover"], - [ScrollOffset.All, "contain"], -]; -const stringToProgress = { - start: 0, - end: 1, -}; -function parseStringOffset(s) { - const parts = s.trim().split(/\s+/); - if (parts.length !== 2) - return undefined; - const a = stringToProgress[parts[0]]; - const b = stringToProgress[parts[1]]; - if (a === undefined || b === undefined) - return undefined; - return [a, b]; -} -function normaliseOffset(offset) { - if (offset.length !== 2) - return undefined; - const result = []; - for (const item of offset) { - if (Array.isArray(item)) { - result.push(item); - } - else if (typeof item === "string") { - const parsed = parseStringOffset(item); - if (!parsed) - return undefined; - result.push(parsed); - } - else { - return undefined; - } - } - return result; -} -function matchesPreset(offset, preset) { - const normalised = normaliseOffset(offset); - if (!normalised) - return false; - for (let i = 0; i < 2; i++) { - const o = normalised[i]; - const p = preset[i]; - if (o[0] !== p[0] || o[1] !== p[1]) - return false; - } - return true; -} -function offsetToViewTimelineRange(offset) { - if (!offset) { - return { rangeStart: "contain 0%", rangeEnd: "contain 100%" }; - } - for (const [preset, name] of presets) { - if (matchesPreset(offset, preset)) { - return { rangeStart: `${name} 0%`, rangeEnd: `${name} 100%` }; - } - } - return undefined; -} - -const timelineCache = new Map(); -function scrollTimelineFallback(options) { - const currentTime = { value: 0 }; - const cancel = scrollInfo((info) => { - currentTime.value = info[options.axis].progress * 100; - }, options); - return { currentTime, cancel }; -} -function getTimeline({ source, container, ...options }) { - const { axis } = options; - if (source) - container = source; - let containerCache = timelineCache.get(container); - if (!containerCache) { - containerCache = new Map(); - timelineCache.set(container, containerCache); - } - const targetKey = options.target ?? "self"; - let targetCache = containerCache.get(targetKey); - if (!targetCache) { - targetCache = {}; - containerCache.set(targetKey, targetCache); - } - const axisKey = axis + (options.offset ?? []).join(","); - if (!targetCache[axisKey]) { - if (options.target && canUseNativeTimeline(options.target)) { - const range = offsetToViewTimelineRange(options.offset); - if (range) { - targetCache[axisKey] = new ViewTimeline({ - subject: options.target, - axis, - }); - } - else { - targetCache[axisKey] = scrollTimelineFallback({ - container, - ...options, - }); - } - } - else if (canUseNativeTimeline()) { - targetCache[axisKey] = new ScrollTimeline({ - source: container, - axis, - }); - } - else { - targetCache[axisKey] = scrollTimelineFallback({ - container, - ...options, - }); - } - } - return targetCache[axisKey]; -} - -function attachToAnimation(animation, options) { - const timeline = getTimeline(options); - const range = options.target - ? offsetToViewTimelineRange(options.offset) - : undefined; - /** - * Use native timeline when: - * - No target: ScrollTimeline (existing behaviour) - * - Target with mappable offset: ViewTimeline with named range - * - Target with unmappable offset: fall back to JS observe - */ - const useNative = options.target - ? canUseNativeTimeline(options.target) && !!range - : canUseNativeTimeline(); - return animation.attachTimeline({ - timeline: useNative ? timeline : undefined, - ...(range && - useNative && { - rangeStart: range.rangeStart, - rangeEnd: range.rangeEnd, - }), - observe: (valueAnimation) => { - valueAnimation.pause(); - return motionDom.observeTimeline((progress) => { - valueAnimation.time = - valueAnimation.iterationDuration * progress; - }, timeline); - }, - }); -} - -/** - * Currently, we only support element tracking with `scrollInfo`, though in - * the future we can also offer ViewTimeline support. - */ -function isElementTracking(options) { - return options && (options.target || options.offset); -} - -/** - * If the onScroll function has two arguments, it's expecting - * more specific information about the scroll from scrollInfo. - */ -function isOnScrollWithInfo(onScroll) { - return onScroll.length === 2; -} -function attachToFunction(onScroll, options) { - if (isOnScrollWithInfo(onScroll) || isElementTracking(options)) { - return scrollInfo((info) => { - onScroll(info[options.axis].progress, info); - }, options); - } - else { - return motionDom.observeTimeline(onScroll, getTimeline(options)); - } -} - -function scroll(onScroll, { axis = "y", container = document.scrollingElement, ...options } = {}) { - if (!container) - return motionUtils.noop; - const optionsWithDefaults = { axis, container, ...options }; - return typeof onScroll === "function" - ? attachToFunction(onScroll, optionsWithDefaults) - : attachToAnimation(onScroll, optionsWithDefaults); -} - -const thresholds = { - some: 0, - all: 1, -}; -function inView(elementOrSelector, onStart, { root, margin: rootMargin, amount = "some" } = {}) { - const elements = motionDom.resolveElements(elementOrSelector); - const activeIntersections = new WeakMap(); - const onIntersectionChange = (entries) => { - entries.forEach((entry) => { - const onEnd = activeIntersections.get(entry.target); - /** - * If there's no change to the intersection, we don't need to - * do anything here. - */ - if (entry.isIntersecting === Boolean(onEnd)) - return; - if (entry.isIntersecting) { - const newOnEnd = onStart(entry.target, entry); - if (typeof newOnEnd === "function") { - activeIntersections.set(entry.target, newOnEnd); - } - else { - observer.unobserve(entry.target); - } - } - else if (typeof onEnd === "function") { - onEnd(entry); - activeIntersections.delete(entry.target); - } - }); - }; - const observer = new IntersectionObserver(onIntersectionChange, { - root, - rootMargin, - threshold: typeof amount === "number" ? amount : thresholds[amount], - }); - elements.forEach((element) => observer.observe(element)); - return () => observer.disconnect(); -} - -const distance = (a, b) => Math.abs(a - b); -function distance2D(a, b) { - // Multi-dimensional - const xDelta = distance(a.x, b.x); - const yDelta = distance(a.y, b.y); - return Math.sqrt(xDelta ** 2 + yDelta ** 2); -} - -Object.defineProperty(exports, "delay", { - enumerable: true, - get: function () { return motionDom.delayInSeconds; } -}); -exports.animate = animate; -exports.animateMini = animateMini; -exports.createScopedAnimate = createScopedAnimate; -exports.distance = distance; -exports.distance2D = distance2D; -exports.inView = inView; -exports.scroll = scroll; -exports.scrollInfo = scrollInfo; -Object.keys(motionDom).forEach(function (k) { - if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { - enumerable: true, - get: function () { return motionDom[k]; } - }); -}); -Object.keys(motionUtils).forEach(function (k) { - if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { - enumerable: true, - get: function () { return motionUtils[k]; } - }); -}); -//# sourceMappingURL=dom.js.map diff --git a/node_modules/framer-motion/dist/cjs/dom.js.map b/node_modules/framer-motion/dist/cjs/dom.js.map deleted file mode 100644 index fe5b9d6..0000000 --- a/node_modules/framer-motion/dist/cjs/dom.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"dom.js","sources":["../../src/animation/utils/is-dom-keyframes.ts","../../src/animation/animate/resolve-subjects.ts","../../src/animation/sequence/utils/calc-repeat-duration.ts","../../src/animation/sequence/utils/calc-time.ts","../../src/animation/sequence/utils/edit.ts","../../src/animation/sequence/utils/normalize-times.ts","../../src/animation/sequence/utils/sort.ts","../../src/animation/sequence/create.ts","../../src/animation/utils/create-visual-element.ts","../../src/animation/animate/subject.ts","../../src/animation/animate/sequence.ts","../../src/animation/animate/index.ts","../../src/animation/animators/waapi/animate-elements.ts","../../src/animation/animators/waapi/animate-style.ts","../../src/render/dom/scroll/utils/can-use-native-timeline.ts","../../src/render/dom/scroll/info.ts","../../src/render/dom/scroll/offsets/inset.ts","../../src/render/dom/scroll/offsets/edge.ts","../../src/render/dom/scroll/offsets/offset.ts","../../src/render/dom/scroll/offsets/presets.ts","../../src/render/dom/scroll/offsets/index.ts","../../src/render/dom/scroll/on-scroll-handler.ts","../../src/render/dom/scroll/track.ts","../../src/render/dom/scroll/utils/offset-to-range.ts","../../src/render/dom/scroll/utils/get-timeline.ts","../../src/render/dom/scroll/attach-animation.ts","../../src/render/dom/scroll/utils/is-element-tracking.ts","../../src/render/dom/scroll/attach-function.ts","../../src/render/dom/scroll/index.ts","../../src/render/dom/viewport/index.ts","../../src/utils/distance.ts"],"sourcesContent":["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(\n subject:\n | string\n | Element\n | Element[]\n | NodeListOf\n | O\n | O[]\n | null\n | undefined,\n keyframes: DOMKeyframesDefinition | ObjectTarget,\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\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()\n const elementCache = {}\n const timeLabels = new Map()\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(\n subject: Element | MotionValue | O,\n sequences: Map\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\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,\n keyframes: string | UnresolvedValueKeyframe[],\n options?: ValueAnimationTransition\n): AnimationPlaybackControlsWithThen[]\n/**\n * Animate a number\n */\nexport function animateSubject(\n value: number | MotionValue,\n keyframes: number | UnresolvedValueKeyframe[],\n options?: ValueAnimationTransition\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(\n object: O | O[],\n keyframes: ObjectTarget,\n options?: DynamicAnimationOptions\n): AnimationPlaybackControlsWithThen[]\n/**\n * Implementation\n */\nexport function animateSubject(\n subject:\n | MotionValue\n | MotionValue\n | number\n | string\n | ElementOrSelector\n | O\n | O[],\n keyframes:\n | number\n | string\n | UnresolvedValueKeyframe[]\n | UnresolvedValueKeyframe[]\n | DOMKeyframesDefinition\n | ObjectTarget,\n options?:\n | ValueAnimationTransition\n | ValueAnimationTransition\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,\n keyframes: string | UnresolvedValueKeyframe[],\n options?: ValueAnimationTransition\n ): AnimationPlaybackControlsWithThen\n /**\n * Animate a number\n */\n function scopedAnimate(\n value: number | MotionValue,\n keyframes: number | UnresolvedValueKeyframe[],\n options?: ValueAnimationTransition\n ): AnimationPlaybackControlsWithThen\n /**\n * Animate a generic motion value\n */\n function scopedAnimate(\n value: V | MotionValue,\n keyframes: V | UnresolvedValueKeyframe[],\n options?: ValueAnimationTransition\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(\n object: O | O[],\n keyframes: ObjectTarget,\n options?: DynamicAnimationOptions\n ): AnimationPlaybackControlsWithThen\n /**\n * Implementation\n */\n function scopedAnimate(\n subjectOrSequence:\n | AnimationSequence\n | MotionValue\n | MotionValue\n | number\n | string\n | ElementOrSelector\n | O\n | O[],\n optionsOrKeyframes?:\n | SequenceOptions\n | number\n | string\n | UnresolvedValueKeyframe[]\n | UnresolvedValueKeyframe[]\n | DOMKeyframesDefinition\n | ObjectTarget,\n options?:\n | ValueAnimationTransition\n | ValueAnimationTransition\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>\n key: string\n unresolvedKeyframes: UnresolvedValueKeyframe[]\n options: Omit & {\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 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 . Likewise we\n * can't use .getBBox() like most SVG elements as these provide the offset\n * relative to the SVG itself, which for 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 = {\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 = {\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()\nconst resizeListeners = new WeakMap()\nconst onScrollHandlers = new WeakMap>()\nconst scrollSize = new WeakMap()\nconst dimensionCheckProcesses = new WeakMap()\n\nexport type ScrollTargets = Array\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 = {\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>\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()\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"],"names":["resolveElements","removeItem","mixNumber","getEasingForSegment","defaultOffset","isGenerator","secondsToMilliseconds","createGeneratorEasing","fillOffset","warning","reverseEasing","isMotionValue","progress","isSVGElement","isSVGSVGElement","SVGVisualElement","HTMLVisualElement","visualElementStore","ObjectVisualElement","animateSingleValue","invariant","animateTarget","motionValue","spring","GroupAnimationWithThen","getValueTransition","getAnimationMap","animationMapKey","getComputedStyle","fillWildcards","applyPxDefaults","NativeAnimation","supportsViewTimeline","supportsScrollTimeline","velocityPerSecond","isHTMLElement","interpolate","clamp","warnOnce","noop","frameData","frame","resize","cancelFrame","ScrollOffsetPresets","observeTimeline"],"mappings":";;;;;;;AAEM,SAAU,cAAc,CAC1B,SAAkB,EAAA;AAElB,IAAA,OAAO,OAAO,SAAS,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC;AACrE;;ACGM,SAAU,eAAe,CAC3B,OAQe,EACf,SAAmD,EACnD,KAAsB,EACtB,aAA6B,EAAA;AAE7B,IAAA,IAAI,OAAO,IAAI,IAAI,EAAE;AACjB,QAAA,OAAO,EAAE;IACb;IAEA,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,cAAc,CAAC,SAAS,CAAC,EAAE;QAC1D,OAAOA,yBAAe,CAAC,OAAO,EAAE,KAAK,EAAE,aAAa,CAAC;IACzD;AAAO,SAAA,IAAI,OAAO,YAAY,QAAQ,EAAE;AACpC,QAAA,OAAO,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC;IAC9B;AAAO,SAAA,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;AAC/B,QAAA,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC;IAC3C;SAAO;QACH,OAAO,CAAC,OAAO,CAAC;IACpB;AACJ;;SCpCgB,uBAAuB,CACnC,QAAgB,EAChB,MAAc,EACd,WAAmB,EAAA;IAEnB,OAAO,QAAQ,IAAI,MAAM,GAAG,CAAC,CAAC,GAAG,WAAW,GAAG,MAAM;AACzD;;ACJA;;;AAGG;AACG,SAAU,YAAY,CACxB,OAAe,EACf,IAAkB,EAClB,IAAY,EACZ,MAA2B,EAAA;AAE3B,IAAA,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;AAC1B,QAAA,OAAO,IAAI;IACf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/framer-motion/dist/cjs/feature-bundle-BZV7Y7IM.js b/node_modules/framer-motion/dist/cjs/feature-bundle-BZV7Y7IM.js deleted file mode 100644 index 0a3ff76..0000000 --- a/node_modules/framer-motion/dist/cjs/feature-bundle-BZV7Y7IM.js +++ /dev/null @@ -1,1660 +0,0 @@ -'use strict'; - -var motionDom = require('motion-dom'); -var React = require('react'); -var index = require('./index-BuO47Yrm.js'); -var motionUtils = require('motion-utils'); -var jsxRuntime = require('react/jsx-runtime'); - -/** - * When a component is the child of `AnimatePresence`, it can use `usePresence` - * to access information about whether it's still present in the React tree. - * - * ```jsx - * import { usePresence } from "framer-motion" - * - * export const Component = () => { - * const [isPresent, safeToRemove] = usePresence() - * - * useEffect(() => { - * !isPresent && setTimeout(safeToRemove, 1000) - * }, [isPresent]) - * - * return
- * } - * ``` - * - * If `isPresent` is `false`, it means that a component has been removed from the tree, - * but `AnimatePresence` won't really remove it until `safeToRemove` has been called. - * - * @public - */ -function usePresence(subscribe = true) { - const context = React.useContext(index.PresenceContext); - if (context === null) - return [true, null]; - const { isPresent, onExitComplete, register } = context; - // It's safe to call the following hooks conditionally (after an early return) because the context will always - // either be null or non-null for the lifespan of the component. - const id = React.useId(); - React.useEffect(() => { - if (subscribe) { - return register(id); - } - }, [subscribe]); - const safeToRemove = React.useCallback(() => subscribe && onExitComplete && onExitComplete(id), [id, onExitComplete, subscribe]); - return !isPresent && onExitComplete ? [false, safeToRemove] : [true]; -} -/** - * Similar to `usePresence`, except `useIsPresent` simply returns whether or not the component is present. - * There is no `safeToRemove` function. - * - * ```jsx - * import { useIsPresent } from "framer-motion" - * - * export const Component = () => { - * const isPresent = useIsPresent() - * - * useEffect(() => { - * !isPresent && console.log("I've been removed!") - * }, [isPresent]) - * - * return
- * } - * ``` - * - * @public - */ -function useIsPresent() { - return isPresent(React.useContext(index.PresenceContext)); -} -function isPresent(context) { - return context === null ? true : context.isPresent; -} - -const createDomVisualElement = (Component, options) => { - /** - * Use explicit isSVG override if provided, otherwise auto-detect - */ - const isSVG = options.isSVG ?? index.isSVGComponent(Component); - return isSVG - ? new motionDom.SVGVisualElement(options) - : new motionDom.HTMLVisualElement(options, { - allowProjection: Component !== React.Fragment, - }); -}; - -class AnimationFeature extends motionDom.Feature { - /** - * We dynamically generate the AnimationState manager as it contains a reference - * to the underlying animation library. We only want to load that if we load this, - * so people can optionally code split it out using the `m` component. - */ - constructor(node) { - super(node); - node.animationState || (node.animationState = motionDom.createAnimationState(node)); - } - updateAnimationControlsSubscription() { - const { animate } = this.node.getProps(); - if (motionDom.isAnimationControls(animate)) { - this.unmountControls = animate.subscribe(this.node); - } - } - /** - * Subscribe any provided AnimationControls to the component's VisualElement - */ - mount() { - this.updateAnimationControlsSubscription(); - } - update() { - const { animate } = this.node.getProps(); - const { animate: prevAnimate } = this.node.prevProps || {}; - if (animate !== prevAnimate) { - this.updateAnimationControlsSubscription(); - } - } - unmount() { - this.node.animationState.reset(); - this.unmountControls?.(); - } -} - -let id = 0; -class ExitAnimationFeature extends motionDom.Feature { - constructor() { - super(...arguments); - this.id = id++; - this.isExitComplete = false; - } - update() { - if (!this.node.presenceContext) - return; - const { isPresent, onExitComplete } = this.node.presenceContext; - const { isPresent: prevIsPresent } = this.node.prevPresenceContext || {}; - if (!this.node.animationState || isPresent === prevIsPresent) { - return; - } - if (isPresent && prevIsPresent === false) { - /** - * When re-entering, if the exit animation already completed - * (element is at rest), reset to initial values so the enter - * animation replays from the correct position. - */ - if (this.isExitComplete) { - const { initial, custom } = this.node.getProps(); - if (typeof initial === "string" || - (typeof initial === "object" && - initial !== null && - !Array.isArray(initial))) { - const resolved = motionDom.resolveVariant(this.node, initial, custom); - if (resolved) { - const { transition, transitionEnd, ...target } = resolved; - for (const key in target) { - this.node - .getValue(key) - ?.jump(target[key]); - } - } - } - this.node.animationState.reset(); - this.node.animationState.animateChanges(); - } - else { - this.node.animationState.setActive("exit", false); - } - this.isExitComplete = false; - return; - } - const exitAnimation = this.node.animationState.setActive("exit", !isPresent); - if (onExitComplete && !isPresent) { - exitAnimation.then(() => { - this.isExitComplete = true; - onExitComplete(this.id); - }); - } - } - mount() { - const { register, onExitComplete } = this.node.presenceContext || {}; - if (onExitComplete) { - onExitComplete(this.id); - } - if (register) { - this.unmount = register(this.id); - } - } - unmount() { } -} - -const animations = { - animation: { - Feature: AnimationFeature, - }, - exit: { - Feature: ExitAnimationFeature, - }, -}; - -function extractEventInfo(event) { - return { - point: { - x: event.pageX, - y: event.pageY, - }, - }; -} -const addPointerInfo = (handler) => (event) => motionDom.isPrimaryPointer(event) && handler(event, extractEventInfo(event)); - -function addPointerEvent(target, eventName, handler, options) { - return motionDom.addDomEvent(target, eventName, addPointerInfo(handler), options); -} - -// Fixes https://github.com/motiondivision/motion/issues/2270 -const getContextWindow = ({ current }) => { - return current ? current.ownerDocument.defaultView : null; -}; - -const distance = (a, b) => Math.abs(a - b); -function distance2D(a, b) { - // Multi-dimensional - const xDelta = distance(a.x, b.x); - const yDelta = distance(a.y, b.y); - return Math.sqrt(xDelta ** 2 + yDelta ** 2); -} - -const overflowStyles = /*#__PURE__*/ new Set(["auto", "scroll"]); -/** - * @internal - */ -class PanSession { - constructor(event, handlers, { transformPagePoint, contextWindow = window, dragSnapToOrigin = false, distanceThreshold = 3, element, } = {}) { - /** - * @internal - */ - this.startEvent = null; - /** - * @internal - */ - this.lastMoveEvent = null; - /** - * @internal - */ - this.lastMoveEventInfo = null; - /** - * Raw (untransformed) event info, re-transformed each frame - * so transformPagePoint sees the current parent matrix. - * @internal - */ - this.lastRawMoveEventInfo = null; - /** - * @internal - */ - this.handlers = {}; - /** - * @internal - */ - this.contextWindow = window; - /** - * Scroll positions of scrollable ancestors and window. - * @internal - */ - this.scrollPositions = new Map(); - /** - * Cleanup function for scroll listeners. - * @internal - */ - this.removeScrollListeners = null; - this.onElementScroll = (event) => { - this.handleScroll(event.target); - }; - this.onWindowScroll = () => { - this.handleScroll(window); - }; - this.updatePoint = () => { - if (!(this.lastMoveEvent && this.lastMoveEventInfo)) - return; - // Re-transform raw point through current transformPagePoint so - // animated parent transforms (e.g. rotation) are picked up each frame - if (this.lastRawMoveEventInfo) { - this.lastMoveEventInfo = transformPoint(this.lastRawMoveEventInfo, this.transformPagePoint); - } - const info = getPanInfo(this.lastMoveEventInfo, this.history); - const isPanStarted = this.startEvent !== null; - // Only start panning if the offset is larger than 3 pixels. If we make it - // any larger than this we'll want to reset the pointer history - // on the first update to avoid visual snapping to the cursor. - const isDistancePastThreshold = distance2D(info.offset, { x: 0, y: 0 }) >= this.distanceThreshold; - if (!isPanStarted && !isDistancePastThreshold) - return; - const { point } = info; - const { timestamp } = motionDom.frameData; - this.history.push({ ...point, timestamp }); - const { onStart, onMove } = this.handlers; - if (!isPanStarted) { - onStart && onStart(this.lastMoveEvent, info); - this.startEvent = this.lastMoveEvent; - } - onMove && onMove(this.lastMoveEvent, info); - }; - this.handlePointerMove = (event, info) => { - this.lastMoveEvent = event; - this.lastRawMoveEventInfo = info; - this.lastMoveEventInfo = transformPoint(info, this.transformPagePoint); - // Throttle mouse move event to once per frame - motionDom.frame.update(this.updatePoint, true); - }; - this.handlePointerUp = (event, info) => { - this.end(); - const { onEnd, onSessionEnd, resumeAnimation } = this.handlers; - // Resume animation if dragSnapToOrigin is set OR if no drag started (user just clicked) - // This ensures constraint animations continue when interrupted by a click - if (this.dragSnapToOrigin || !this.startEvent) { - resumeAnimation && resumeAnimation(); - } - if (!(this.lastMoveEvent && this.lastMoveEventInfo)) - return; - const panInfo = getPanInfo(event.type === "pointercancel" - ? this.lastMoveEventInfo - : transformPoint(info, this.transformPagePoint), this.history); - if (this.startEvent && onEnd) { - onEnd(event, panInfo); - } - onSessionEnd && onSessionEnd(event, panInfo); - }; - // If we have more than one touch, don't start detecting this gesture - if (!motionDom.isPrimaryPointer(event)) - return; - this.dragSnapToOrigin = dragSnapToOrigin; - this.handlers = handlers; - this.transformPagePoint = transformPagePoint; - this.distanceThreshold = distanceThreshold; - this.contextWindow = contextWindow || window; - const info = extractEventInfo(event); - const initialInfo = transformPoint(info, this.transformPagePoint); - const { point } = initialInfo; - const { timestamp } = motionDom.frameData; - this.history = [{ ...point, timestamp }]; - const { onSessionStart } = handlers; - onSessionStart && - onSessionStart(event, getPanInfo(initialInfo, this.history)); - // Listen in the capture phase so a descendant calling - // stopPropagation() (e.g. in its own pointerup handler) can't - // prevent the gesture from ending. See #2794. - const eventOptions = { passive: true, capture: true }; - this.removeListeners = motionUtils.pipe(addPointerEvent(this.contextWindow, "pointermove", this.handlePointerMove, eventOptions), addPointerEvent(this.contextWindow, "pointerup", this.handlePointerUp, eventOptions), addPointerEvent(this.contextWindow, "pointercancel", this.handlePointerUp, eventOptions)); - // Start scroll tracking if element provided - if (element) { - this.startScrollTracking(element); - } - } - /** - * Start tracking scroll on ancestors and window. - */ - startScrollTracking(element) { - // Store initial scroll positions for scrollable ancestors - let current = element.parentElement; - while (current) { - const style = getComputedStyle(current); - if (overflowStyles.has(style.overflowX) || - overflowStyles.has(style.overflowY)) { - this.scrollPositions.set(current, { - x: current.scrollLeft, - y: current.scrollTop, - }); - } - current = current.parentElement; - } - // Track window scroll - this.scrollPositions.set(window, { - x: window.scrollX, - y: window.scrollY, - }); - // Capture listener catches element scroll events as they bubble - window.addEventListener("scroll", this.onElementScroll, { - capture: true, - }); - // Direct window scroll listener (window scroll doesn't bubble) - window.addEventListener("scroll", this.onWindowScroll); - this.removeScrollListeners = () => { - window.removeEventListener("scroll", this.onElementScroll, { - capture: true, - }); - window.removeEventListener("scroll", this.onWindowScroll); - }; - } - /** - * Handle scroll compensation during drag. - * - * For element scroll: adjusts history origin since pageX/pageY doesn't change. - * For window scroll: adjusts lastMoveEventInfo since pageX/pageY would change. - */ - handleScroll(target) { - const initial = this.scrollPositions.get(target); - if (!initial) - return; - const isWindow = target === window; - const current = isWindow - ? { x: window.scrollX, y: window.scrollY } - : { - x: target.scrollLeft, - y: target.scrollTop, - }; - const delta = { x: current.x - initial.x, y: current.y - initial.y }; - if (delta.x === 0 && delta.y === 0) - return; - if (isWindow) { - // Window scroll: pageX/pageY changes, so update lastMoveEventInfo - if (this.lastMoveEventInfo) { - this.lastMoveEventInfo.point.x += delta.x; - this.lastMoveEventInfo.point.y += delta.y; - } - } - else { - // Element scroll: pageX/pageY unchanged, so adjust history origin - if (this.history.length > 0) { - this.history[0].x -= delta.x; - this.history[0].y -= delta.y; - } - } - this.scrollPositions.set(target, current); - motionDom.frame.update(this.updatePoint, true); - } - updateHandlers(handlers) { - this.handlers = handlers; - } - end() { - this.removeListeners && this.removeListeners(); - this.removeScrollListeners && this.removeScrollListeners(); - this.scrollPositions.clear(); - motionDom.cancelFrame(this.updatePoint); - } -} -function transformPoint(info, transformPagePoint) { - return transformPagePoint ? { point: transformPagePoint(info.point) } : info; -} -function subtractPoint(a, b) { - return { x: a.x - b.x, y: a.y - b.y }; -} -function getPanInfo({ point }, history) { - return { - point, - delta: subtractPoint(point, lastDevicePoint(history)), - offset: subtractPoint(point, startDevicePoint(history)), - velocity: getVelocity(history, 0.1), - }; -} -function startDevicePoint(history) { - return history[0]; -} -function lastDevicePoint(history) { - return history[history.length - 1]; -} -function getVelocity(history, timeDelta) { - if (history.length < 2) { - return { x: 0, y: 0 }; - } - let i = history.length - 1; - let timestampedPoint = null; - const lastPoint = lastDevicePoint(history); - while (i >= 0) { - timestampedPoint = history[i]; - if (lastPoint.timestamp - timestampedPoint.timestamp > - motionUtils.secondsToMilliseconds(timeDelta)) { - break; - } - i--; - } - if (!timestampedPoint) { - return { x: 0, y: 0 }; - } - /** - * If the selected point is the pointer-down origin (history[0]), - * there are better movement points available, and the time gap - * is suspiciously large (>2x timeDelta), use the next point instead. - * This prevents stale pointer-down points from diluting velocity - * in hold-then-flick gestures. - */ - if (timestampedPoint === history[0] && - history.length > 2 && - lastPoint.timestamp - timestampedPoint.timestamp > - motionUtils.secondsToMilliseconds(timeDelta) * 2) { - timestampedPoint = history[1]; - } - const time = motionUtils.millisecondsToSeconds(lastPoint.timestamp - timestampedPoint.timestamp); - if (time === 0) { - return { x: 0, y: 0 }; - } - const currentVelocity = { - x: (lastPoint.x - timestampedPoint.x) / time, - y: (lastPoint.y - timestampedPoint.y) / time, - }; - if (currentVelocity.x === Infinity) { - currentVelocity.x = 0; - } - if (currentVelocity.y === Infinity) { - currentVelocity.y = 0; - } - return currentVelocity; -} - -/** - * Apply constraints to a point. These constraints are both physical along an - * axis, and an elastic factor that determines how much to constrain the point - * by if it does lie outside the defined parameters. - */ -function applyConstraints(point, { min, max }, elastic) { - if (min !== undefined && point < min) { - // If we have a min point defined, and this is outside of that, constrain - point = elastic - ? motionDom.mixNumber(min, point, elastic.min) - : Math.max(point, min); - } - else if (max !== undefined && point > max) { - // If we have a max point defined, and this is outside of that, constrain - point = elastic - ? motionDom.mixNumber(max, point, elastic.max) - : Math.min(point, max); - } - return point; -} -/** - * Calculate constraints in terms of the viewport when defined relatively to the - * measured axis. This is measured from the nearest edge, so a max constraint of 200 - * on an axis with a max value of 300 would return a constraint of 500 - axis length - */ -function calcRelativeAxisConstraints(axis, min, max) { - return { - min: min !== undefined ? axis.min + min : undefined, - max: max !== undefined - ? axis.max + max - (axis.max - axis.min) - : undefined, - }; -} -/** - * Calculate constraints in terms of the viewport when - * defined relatively to the measured bounding box. - */ -function calcRelativeConstraints(layoutBox, { top, left, bottom, right }) { - return { - x: calcRelativeAxisConstraints(layoutBox.x, left, right), - y: calcRelativeAxisConstraints(layoutBox.y, top, bottom), - }; -} -/** - * Calculate viewport constraints when defined as another viewport-relative axis - */ -function calcViewportAxisConstraints(layoutAxis, constraintsAxis) { - let min = constraintsAxis.min - layoutAxis.min; - let max = constraintsAxis.max - layoutAxis.max; - // If the constraints axis is actually smaller than the layout axis then we can - // flip the constraints - if (constraintsAxis.max - constraintsAxis.min < - layoutAxis.max - layoutAxis.min) { - [min, max] = [max, min]; - } - return { min, max }; -} -/** - * Calculate viewport constraints when defined as another viewport-relative box - */ -function calcViewportConstraints(layoutBox, constraintsBox) { - return { - x: calcViewportAxisConstraints(layoutBox.x, constraintsBox.x), - y: calcViewportAxisConstraints(layoutBox.y, constraintsBox.y), - }; -} -/** - * Calculate a transform origin relative to the source axis, between 0-1, that results - * in an asthetically pleasing scale/transform needed to project from source to target. - */ -function calcOrigin(source, target) { - let origin = 0.5; - const sourceLength = motionDom.calcLength(source); - const targetLength = motionDom.calcLength(target); - if (targetLength > sourceLength) { - origin = motionUtils.progress(target.min, target.max - sourceLength, source.min); - } - else if (sourceLength > targetLength) { - origin = motionUtils.progress(source.min, source.max - targetLength, target.min); - } - return motionUtils.clamp(0, 1, origin); -} -/** - * Rebase the calculated viewport constraints relative to the layout.min point. - */ -function rebaseAxisConstraints(layout, constraints) { - const relativeConstraints = {}; - if (constraints.min !== undefined) { - relativeConstraints.min = constraints.min - layout.min; - } - if (constraints.max !== undefined) { - relativeConstraints.max = constraints.max - layout.min; - } - return relativeConstraints; -} -const defaultElastic = 0.35; -/** - * Accepts a dragElastic prop and returns resolved elastic values for each axis. - */ -function resolveDragElastic(dragElastic = defaultElastic) { - if (dragElastic === false) { - dragElastic = 0; - } - else if (dragElastic === true) { - dragElastic = defaultElastic; - } - return { - x: resolveAxisElastic(dragElastic, "left", "right"), - y: resolveAxisElastic(dragElastic, "top", "bottom"), - }; -} -function resolveAxisElastic(dragElastic, minLabel, maxLabel) { - return { - min: resolvePointElastic(dragElastic, minLabel), - max: resolvePointElastic(dragElastic, maxLabel), - }; -} -function resolvePointElastic(dragElastic, label) { - return typeof dragElastic === "number" - ? dragElastic - : dragElastic[label] || 0; -} - -const elementDragControls = new WeakMap(); -class VisualElementDragControls { - constructor(visualElement) { - this.openDragLock = null; - this.isDragging = false; - this.currentDirection = null; - this.originPoint = { x: 0, y: 0 }; - /** - * The permitted boundaries of travel, in pixels. - */ - this.constraints = false; - this.hasMutatedConstraints = false; - /** - * The per-axis resolved elastic values. - */ - this.elastic = motionDom.createBox(); - /** - * The latest pointer event. Used as fallback when the `cancel` and `stop` functions are called without arguments. - */ - this.latestPointerEvent = null; - /** - * The latest pan info. Used as fallback when the `cancel` and `stop` functions are called without arguments. - */ - this.latestPanInfo = null; - this.visualElement = visualElement; - } - start(originEvent, { snapToCursor = false, distanceThreshold } = {}) { - /** - * Don't start dragging if this component is exiting - */ - const { presenceContext } = this.visualElement; - if (presenceContext && presenceContext.isPresent === false) - return; - const onSessionStart = (event) => { - if (snapToCursor) { - this.snapToCursor(extractEventInfo(event).point); - } - this.stopAnimation(); - }; - const onStart = (event, info) => { - // Attempt to grab the global drag gesture lock - maybe make this part of PanSession - const { drag, dragPropagation, onDragStart } = this.getProps(); - if (drag && !dragPropagation) { - if (this.openDragLock) - this.openDragLock(); - this.openDragLock = motionDom.setDragLock(drag); - // If we don 't have the lock, don't start dragging - if (!this.openDragLock) - return; - } - this.latestPointerEvent = event; - this.latestPanInfo = info; - this.isDragging = true; - this.currentDirection = null; - this.resolveConstraints(); - if (this.visualElement.projection) { - this.visualElement.projection.isAnimationBlocked = true; - this.visualElement.projection.target = undefined; - } - /** - * Record gesture origin and pointer offset - */ - motionDom.eachAxis((axis) => { - let current = this.getAxisMotionValue(axis).get() || 0; - /** - * If the MotionValue is a percentage value convert to px - */ - if (motionDom.percent.test(current)) { - const { projection } = this.visualElement; - if (projection && projection.layout) { - const measuredAxis = projection.layout.layoutBox[axis]; - if (measuredAxis) { - const length = motionDom.calcLength(measuredAxis); - current = length * (parseFloat(current) / 100); - } - } - } - this.originPoint[axis] = current; - }); - // Fire onDragStart event - if (onDragStart) { - motionDom.frame.update(() => onDragStart(event, info), false, true); - } - motionDom.addValueToWillChange(this.visualElement, "transform"); - const { animationState } = this.visualElement; - animationState && animationState.setActive("whileDrag", true); - }; - const onMove = (event, info) => { - this.latestPointerEvent = event; - this.latestPanInfo = info; - const { dragPropagation, dragDirectionLock, onDirectionLock, onDrag, } = this.getProps(); - // If we didn't successfully receive the gesture lock, early return. - if (!dragPropagation && !this.openDragLock) - return; - const { offset } = info; - // Attempt to detect drag direction if directionLock is true - if (dragDirectionLock && this.currentDirection === null) { - this.currentDirection = getCurrentDirection(offset); - // If we've successfully set a direction, notify listener - if (this.currentDirection !== null) { - onDirectionLock && onDirectionLock(this.currentDirection); - } - return; - } - // Update each point with the latest position - this.updateAxis("x", info.point, offset); - this.updateAxis("y", info.point, offset); - /** - * Ideally we would leave the renderer to fire naturally at the end of - * this frame but if the element is about to change layout as the result - * of a re-render we want to ensure the browser can read the latest - * bounding box to ensure the pointer and element don't fall out of sync. - */ - this.visualElement.render(); - /** - * This must fire after the render call as it might trigger a state - * change which itself might trigger a layout update. - */ - if (onDrag) { - motionDom.frame.update(() => onDrag(event, info), false, true); - } - }; - const onSessionEnd = (event, info) => { - this.latestPointerEvent = event; - this.latestPanInfo = info; - this.stop(event, info); - this.latestPointerEvent = null; - this.latestPanInfo = null; - }; - const resumeAnimation = () => { - const { dragSnapToOrigin: snap } = this.getProps(); - if (snap || this.constraints) { - this.startAnimation({ x: 0, y: 0 }); - } - }; - const { dragSnapToOrigin } = this.getProps(); - this.panSession = new PanSession(originEvent, { - onSessionStart, - onStart, - onMove, - onSessionEnd, - resumeAnimation, - }, { - transformPagePoint: this.visualElement.getTransformPagePoint(), - dragSnapToOrigin, - distanceThreshold, - contextWindow: getContextWindow(this.visualElement), - element: this.visualElement.current, - }); - } - /** - * @internal - */ - stop(event, panInfo) { - const finalEvent = event || this.latestPointerEvent; - const finalPanInfo = panInfo || this.latestPanInfo; - const isDragging = this.isDragging; - this.cancel(); - if (!isDragging || !finalPanInfo || !finalEvent) - return; - const { velocity } = finalPanInfo; - this.startAnimation(velocity); - const { onDragEnd } = this.getProps(); - if (onDragEnd) { - motionDom.frame.postRender(() => onDragEnd(finalEvent, finalPanInfo)); - } - } - /** - * @internal - */ - cancel() { - this.isDragging = false; - const { projection, animationState } = this.visualElement; - if (projection) { - projection.isAnimationBlocked = false; - } - this.endPanSession(); - const { dragPropagation } = this.getProps(); - if (!dragPropagation && this.openDragLock) { - this.openDragLock(); - this.openDragLock = null; - } - animationState && animationState.setActive("whileDrag", false); - } - /** - * Clean up the pan session without modifying other drag state. - * This is used during unmount to ensure event listeners are removed - * without affecting projection animations or drag locks. - * @internal - */ - endPanSession() { - this.panSession && this.panSession.end(); - this.panSession = undefined; - } - updateAxis(axis, _point, offset) { - const { drag } = this.getProps(); - // If we're not dragging this axis, do an early return. - if (!offset || !shouldDrag(axis, drag, this.currentDirection)) - return; - const axisValue = this.getAxisMotionValue(axis); - let next = this.originPoint[axis] + offset[axis]; - // Apply constraints - if (this.constraints && this.constraints[axis]) { - next = applyConstraints(next, this.constraints[axis], this.elastic[axis]); - } - axisValue.set(next); - } - resolveConstraints() { - const { dragConstraints, dragElastic } = this.getProps(); - const layout = this.visualElement.projection && - !this.visualElement.projection.layout - ? this.visualElement.projection.measure(false) - : this.visualElement.projection?.layout; - const prevConstraints = this.constraints; - if (dragConstraints && index.isRefObject(dragConstraints)) { - if (!this.constraints) { - this.constraints = this.resolveRefConstraints(); - } - } - else { - if (dragConstraints && layout) { - this.constraints = calcRelativeConstraints(layout.layoutBox, dragConstraints); - } - else { - this.constraints = false; - } - } - this.elastic = resolveDragElastic(dragElastic); - /** - * If we're outputting to external MotionValues, we want to rebase the measured constraints - * from viewport-relative to component-relative. This only applies to relative (non-ref) - * constraints, as ref-based constraints from calcViewportConstraints are already in the - * correct coordinate space for the motion value transform offset. - */ - if (prevConstraints !== this.constraints && - !index.isRefObject(dragConstraints) && - layout && - this.constraints && - !this.hasMutatedConstraints) { - motionDom.eachAxis((axis) => { - if (this.constraints !== false && - this.getAxisMotionValue(axis)) { - this.constraints[axis] = rebaseAxisConstraints(layout.layoutBox[axis], this.constraints[axis]); - } - }); - } - } - resolveRefConstraints() { - const { dragConstraints: constraints, onMeasureDragConstraints } = this.getProps(); - if (!constraints || !index.isRefObject(constraints)) - return false; - const constraintsElement = constraints.current; - motionUtils.invariant(constraintsElement !== null, "If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.", "drag-constraints-ref"); - const { projection } = this.visualElement; - // TODO - if (!projection || !projection.layout) - return false; - /** - * Refresh the root scroll offset so the constraint's viewport box - * translates to correct page coordinates. The scroll captured at - * drag mount can be stale if the document was scrolled afterwards — - * e.g. via the browser restoring scroll on refresh, or an ancestor - * layout effect running after this element's mount (#2829). - * - * Clear the cached scroll first so `updateScroll` bypasses its - * per-animationId cache and re-reads the live value. - */ - if (projection.root) { - projection.root.scroll = undefined; - projection.root.updateScroll(); - } - const constraintsBox = motionDom.measurePageBox(constraintsElement, projection.root, this.visualElement.getTransformPagePoint()); - let measuredConstraints = calcViewportConstraints(projection.layout.layoutBox, constraintsBox); - /** - * If there's an onMeasureDragConstraints listener we call it and - * if different constraints are returned, set constraints to that - */ - if (onMeasureDragConstraints) { - const userConstraints = onMeasureDragConstraints(motionDom.convertBoxToBoundingBox(measuredConstraints)); - this.hasMutatedConstraints = !!userConstraints; - if (userConstraints) { - measuredConstraints = motionDom.convertBoundingBoxToBox(userConstraints); - } - } - return measuredConstraints; - } - startAnimation(velocity) { - const { drag, dragMomentum, dragElastic, dragTransition, dragSnapToOrigin, onDragTransitionEnd, } = this.getProps(); - const constraints = this.constraints || {}; - const momentumAnimations = motionDom.eachAxis((axis) => { - if (!shouldDrag(axis, drag, this.currentDirection)) { - return; - } - let transition = (constraints && constraints[axis]) || {}; - if (dragSnapToOrigin === true || - dragSnapToOrigin === axis) - transition = { min: 0, max: 0 }; - /** - * Overdamp the boundary spring if `dragElastic` is disabled. There's still a frame - * of spring animations so we should look into adding a disable spring option to `inertia`. - * We could do something here where we affect the `bounceStiffness` and `bounceDamping` - * using the value of `dragElastic`. - */ - const bounceStiffness = dragElastic ? 200 : 1000000; - const bounceDamping = dragElastic ? 40 : 10000000; - const inertia = { - type: "inertia", - velocity: dragMomentum ? velocity[axis] : 0, - bounceStiffness, - bounceDamping, - timeConstant: 750, - restDelta: 1, - restSpeed: 10, - ...dragTransition, - ...transition, - }; - // If we're not animating on an externally-provided `MotionValue` we can use the - // component's animation controls which will handle interactions with whileHover (etc), - // otherwise we just have to animate the `MotionValue` itself. - return this.startAxisValueAnimation(axis, inertia); - }); - // Run all animations and then resolve the new drag constraints. - return Promise.all(momentumAnimations).then(onDragTransitionEnd); - } - startAxisValueAnimation(axis, transition) { - const axisValue = this.getAxisMotionValue(axis); - motionDom.addValueToWillChange(this.visualElement, axis); - return axisValue.start(motionDom.animateMotionValue(axis, axisValue, 0, transition, this.visualElement, false)); - } - stopAnimation() { - motionDom.eachAxis((axis) => this.getAxisMotionValue(axis).stop()); - } - /** - * Drag works differently depending on which props are provided. - * - * - If _dragX and _dragY are provided, we output the gesture delta directly to those motion values. - * - Otherwise, we apply the delta to the x/y motion values. - */ - getAxisMotionValue(axis) { - const dragKey = `_drag${axis.toUpperCase()}`; - const props = this.visualElement.getProps(); - const externalMotionValue = props[dragKey]; - return externalMotionValue - ? externalMotionValue - : this.visualElement.getValue(axis, this.visualElement.latestValues[axis] ?? 0); - } - snapToCursor(point) { - motionDom.eachAxis((axis) => { - const { drag } = this.getProps(); - // If we're not dragging this axis, do an early return. - if (!shouldDrag(axis, drag, this.currentDirection)) - return; - const { projection } = this.visualElement; - const axisValue = this.getAxisMotionValue(axis); - if (projection && projection.layout) { - const { min, max } = projection.layout.layoutBox[axis]; - /** - * The layout measurement includes the current transform value, - * so we need to add it back to get the correct snap position. - * This fixes an issue where elements with initial coordinates - * would snap to the wrong position on the first drag. - */ - const current = axisValue.get() || 0; - axisValue.set(point[axis] - motionDom.mixNumber(min, max, 0.5) + current); - } - }); - } - /** - * When the viewport resizes we want to check if the measured constraints - * have changed and, if so, reposition the element within those new constraints - * relative to where it was before the resize. - */ - scalePositionWithinConstraints() { - if (!this.visualElement.current) - return; - const { drag, dragConstraints } = this.getProps(); - const { projection } = this.visualElement; - if (!index.isRefObject(dragConstraints) || !projection || !this.constraints) - return; - /** - * Stop current animations as there can be visual glitching if we try to do - * this mid-animation - */ - this.stopAnimation(); - /** - * Record the relative position of the dragged element relative to the - * constraints box and save as a progress value. - */ - const boxProgress = { x: 0, y: 0 }; - motionDom.eachAxis((axis) => { - const axisValue = this.getAxisMotionValue(axis); - if (axisValue && this.constraints !== false) { - const latest = axisValue.get(); - boxProgress[axis] = calcOrigin({ min: latest, max: latest }, this.constraints[axis]); - } - }); - /** - * Update the layout of this element and resolve the latest drag constraints - */ - const { transformTemplate } = this.visualElement.getProps(); - this.visualElement.current.style.transform = transformTemplate - ? transformTemplate({}, "") - : "none"; - projection.root && projection.root.updateScroll(); - projection.updateLayout(); - /** - * Reset constraints so resolveConstraints() will recalculate them - * with the freshly measured layout rather than returning the cached value. - */ - this.constraints = false; - this.resolveConstraints(); - /** - * For each axis, calculate the current progress of the layout axis - * within the new constraints. - */ - motionDom.eachAxis((axis) => { - if (!shouldDrag(axis, drag, null)) - return; - /** - * Calculate a new transform based on the previous box progress - */ - const axisValue = this.getAxisMotionValue(axis); - const { min, max } = this.constraints[axis]; - axisValue.set(motionDom.mixNumber(min, max, boxProgress[axis])); - }); - /** - * Flush the updated transform to the DOM synchronously to prevent - * a visual flash at the element's CSS layout position (0,0) when - * the transform was stripped for measurement. - */ - this.visualElement.render(); - } - addListeners() { - if (!this.visualElement.current) - return; - elementDragControls.set(this.visualElement, this); - const element = this.visualElement.current; - /** - * Attach a pointerdown event listener on this DOM element to initiate drag tracking. - */ - const stopPointerListener = addPointerEvent(element, "pointerdown", (event) => { - const { drag, dragListener = true } = this.getProps(); - const target = event.target; - /** - * Only block drag if clicking on a text input child element - * (input, textarea, select, contenteditable) where users might - * want to select text or interact with the control. - * - * Buttons and links don't block drag since they don't have - * click-and-move actions of their own. - */ - const isClickingTextInputChild = target !== element && motionDom.isElementTextInput(target); - if (drag && dragListener && !isClickingTextInputChild) { - this.start(event); - } - }); - /** - * If using ref-based constraints, observe both the draggable element - * and the constraint container for size changes via ResizeObserver. - * Setup is deferred because dragConstraints.current is null when - * addListeners first runs (React hasn't committed the ref yet). - */ - let stopResizeObservers; - const measureDragConstraints = () => { - const { dragConstraints } = this.getProps(); - if (index.isRefObject(dragConstraints) && dragConstraints.current) { - this.constraints = this.resolveRefConstraints(); - if (!stopResizeObservers) { - stopResizeObservers = startResizeObservers(element, dragConstraints.current, () => this.scalePositionWithinConstraints()); - } - } - }; - const { projection } = this.visualElement; - const stopMeasureLayoutListener = projection.addEventListener("measure", measureDragConstraints); - if (projection && !projection.layout) { - projection.root && projection.root.updateScroll(); - projection.updateLayout(); - } - motionDom.frame.read(measureDragConstraints); - /** - * Attach a window resize listener to scale the draggable target within its defined - * constraints as the window resizes. - */ - const stopResizeListener = motionDom.addDomEvent(window, "resize", () => this.scalePositionWithinConstraints()); - /** - * If the element's layout changes, calculate the delta and apply that to - * the drag gesture's origin point. - */ - const stopLayoutUpdateListener = projection.addEventListener("didUpdate", (({ delta, hasLayoutChanged }) => { - if (this.isDragging && hasLayoutChanged) { - motionDom.eachAxis((axis) => { - const motionValue = this.getAxisMotionValue(axis); - if (!motionValue) - return; - this.originPoint[axis] += delta[axis].translate; - motionValue.set(motionValue.get() + delta[axis].translate); - }); - this.visualElement.render(); - } - })); - return () => { - stopResizeListener(); - stopPointerListener(); - stopMeasureLayoutListener(); - stopLayoutUpdateListener && stopLayoutUpdateListener(); - stopResizeObservers && stopResizeObservers(); - }; - } - getProps() { - const props = this.visualElement.getProps(); - const { drag = false, dragDirectionLock = false, dragPropagation = false, dragConstraints = false, dragElastic = defaultElastic, dragMomentum = true, } = props; - return { - ...props, - drag, - dragDirectionLock, - dragPropagation, - dragConstraints, - dragElastic, - dragMomentum, - }; - } -} -function skipFirstCall(callback) { - let isFirst = true; - return () => { - if (isFirst) { - isFirst = false; - return; - } - callback(); - }; -} -function startResizeObservers(element, constraintsElement, onResize) { - const stopElement = motionDom.resize(element, skipFirstCall(onResize)); - const stopContainer = motionDom.resize(constraintsElement, skipFirstCall(onResize)); - return () => { - stopElement(); - stopContainer(); - }; -} -function shouldDrag(direction, drag, currentDirection) { - return ((drag === true || drag === direction) && - (currentDirection === null || currentDirection === direction)); -} -/** - * Based on an x/y offset determine the current drag direction. If both axis' offsets are lower - * than the provided threshold, return `null`. - * - * @param offset - The x/y offset from origin. - * @param lockThreshold - (Optional) - the minimum absolute offset before we can determine a drag direction. - */ -function getCurrentDirection(offset, lockThreshold = 10) { - let direction = null; - if (Math.abs(offset.y) > lockThreshold) { - direction = "y"; - } - else if (Math.abs(offset.x) > lockThreshold) { - direction = "x"; - } - return direction; -} - -class DragGesture extends motionDom.Feature { - constructor(node) { - super(node); - this.removeGroupControls = motionUtils.noop; - this.removeListeners = motionUtils.noop; - this.controls = new VisualElementDragControls(node); - } - mount() { - // If we've been provided a DragControls for manual control over the drag gesture, - // subscribe this component to it on mount. - const { dragControls } = this.node.getProps(); - if (dragControls) { - this.removeGroupControls = dragControls.subscribe(this.controls); - } - this.removeListeners = this.controls.addListeners() || motionUtils.noop; - } - update() { - const { dragControls } = this.node.getProps(); - const { dragControls: prevDragControls } = this.node.prevProps || {}; - if (dragControls !== prevDragControls) { - this.removeGroupControls(); - if (dragControls) { - this.removeGroupControls = dragControls.subscribe(this.controls); - } - } - } - unmount() { - this.removeGroupControls(); - this.removeListeners(); - /** - * In React 19, during list reorder reconciliation, components may - * briefly unmount and remount while the drag is still active. If we're - * actively dragging, we should NOT end the pan session - it will - * continue tracking pointer events via its window-level listeners. - * - * The pan session will be properly cleaned up when: - * 1. The drag ends naturally (pointerup/pointercancel) - * 2. The component is truly removed from the DOM - */ - if (!this.controls.isDragging) { - this.controls.endPanSession(); - } - } -} - -const asyncHandler = (handler) => (event, info) => { - if (handler) { - motionDom.frame.update(() => handler(event, info), false, true); - } -}; -class PanGesture extends motionDom.Feature { - constructor() { - super(...arguments); - this.removePointerDownListener = motionUtils.noop; - } - onPointerDown(pointerDownEvent) { - this.session = new PanSession(pointerDownEvent, this.createPanHandlers(), { - transformPagePoint: this.node.getTransformPagePoint(), - contextWindow: getContextWindow(this.node), - }); - } - createPanHandlers() { - const { onPanSessionStart, onPanStart, onPan, onPanEnd } = this.node.getProps(); - return { - onSessionStart: asyncHandler(onPanSessionStart), - onStart: asyncHandler(onPanStart), - onMove: asyncHandler(onPan), - onEnd: (event, info) => { - delete this.session; - if (onPanEnd) { - motionDom.frame.postRender(() => onPanEnd(event, info)); - } - }, - }; - } - mount() { - this.removePointerDownListener = addPointerEvent(this.node.current, "pointerdown", (event) => this.onPointerDown(event)); - } - update() { - this.session && this.session.updateHandlers(this.createPanHandlers()); - } - unmount() { - this.removePointerDownListener(); - this.session && this.session.end(); - } -} - -/** - * Track whether we've taken any snapshots yet. If not, - * we can safely skip notification of didUpdate. - * - * Difficult to capture in a test but to prevent flickering - * we must set this to true either on update or unmount. - * Running `next-env/layout-id` in Safari will show this behaviour if broken. - */ -let hasTakenAnySnapshot = false; -class MeasureLayoutWithContext extends React.Component { - /** - * This only mounts projection nodes for components that - * need measuring, we might want to do it for all components - * in order to incorporate transforms - */ - componentDidMount() { - const { visualElement, layoutGroup, switchLayoutGroup, layoutId } = this.props; - const { projection } = visualElement; - if (projection) { - if (layoutGroup.group) - layoutGroup.group.add(projection); - if (switchLayoutGroup && switchLayoutGroup.register && layoutId) { - switchLayoutGroup.register(projection); - } - if (hasTakenAnySnapshot) { - projection.root.didUpdate(); - } - projection.addEventListener("animationComplete", () => { - this.safeToRemove(); - }); - projection.setOptions({ - ...projection.options, - layoutDependency: this.props.layoutDependency, - onExitComplete: () => this.safeToRemove(), - }); - } - motionDom.globalProjectionState.hasEverUpdated = true; - } - getSnapshotBeforeUpdate(prevProps) { - const { layoutDependency, visualElement, drag, isPresent } = this.props; - const { projection } = visualElement; - if (!projection) - return null; - /** - * TODO: We use this data in relegate to determine whether to - * promote a previous element. There's no guarantee its presence data - * will have updated by this point - if a bug like this arises it will - * have to be that we markForRelegation and then find a new lead some other way, - * perhaps in didUpdate - */ - projection.isPresent = isPresent; - if (prevProps.layoutDependency !== layoutDependency) { - projection.setOptions({ - ...projection.options, - layoutDependency, - }); - } - hasTakenAnySnapshot = true; - if (drag || - prevProps.layoutDependency !== layoutDependency || - layoutDependency === undefined || - prevProps.isPresent !== isPresent) { - projection.willUpdate(); - } - else { - this.safeToRemove(); - } - if (prevProps.isPresent !== isPresent) { - if (isPresent) { - projection.promote(); - } - else if (!projection.relegate()) { - /** - * If there's another stack member taking over from this one, - * it's in charge of the exit animation and therefore should - * be in charge of the safe to remove. Otherwise we call it here. - */ - motionDom.frame.postRender(() => { - const stack = projection.getStack(); - if (!stack || !stack.members.length) { - this.safeToRemove(); - } - }); - } - } - return null; - } - componentDidUpdate() { - const { visualElement, layoutAnchor } = this.props; - const { projection } = visualElement; - if (projection) { - projection.options.layoutAnchor = layoutAnchor; - projection.root.didUpdate(); - motionDom.microtask.postRender(() => { - if (!projection.currentAnimation && projection.isLead()) { - this.safeToRemove(); - } - }); - } - } - componentWillUnmount() { - const { visualElement, layoutGroup, switchLayoutGroup: promoteContext, } = this.props; - const { projection } = visualElement; - hasTakenAnySnapshot = true; - if (projection) { - projection.scheduleCheckAfterUnmount(); - if (layoutGroup && layoutGroup.group) - layoutGroup.group.remove(projection); - if (promoteContext && promoteContext.deregister) - promoteContext.deregister(projection); - } - } - safeToRemove() { - const { safeToRemove } = this.props; - safeToRemove && safeToRemove(); - } - render() { - return null; - } -} -function MeasureLayout(props) { - const [isPresent, safeToRemove] = usePresence(); - const layoutGroup = React.useContext(index.LayoutGroupContext); - return (jsxRuntime.jsx(MeasureLayoutWithContext, { ...props, layoutGroup: layoutGroup, switchLayoutGroup: React.useContext(index.SwitchLayoutGroupContext), isPresent: isPresent, safeToRemove: safeToRemove })); -} - -const drag = { - pan: { - Feature: PanGesture, - }, - drag: { - Feature: DragGesture, - ProjectionNode: motionDom.HTMLProjectionNode, - MeasureLayout, - }, -}; - -function handleHoverEvent(node, event, lifecycle) { - const { props } = node; - if (node.animationState && props.whileHover) { - node.animationState.setActive("whileHover", lifecycle === "Start"); - } - const eventName = ("onHover" + lifecycle); - const callback = props[eventName]; - if (callback) { - motionDom.frame.postRender(() => callback(event, extractEventInfo(event))); - } -} -class HoverGesture extends motionDom.Feature { - mount() { - const { current } = this.node; - if (!current) - return; - this.unmount = motionDom.hover(current, (_element, startEvent) => { - handleHoverEvent(this.node, startEvent, "Start"); - return (endEvent) => handleHoverEvent(this.node, endEvent, "End"); - }); - } - unmount() { } -} - -class FocusGesture extends motionDom.Feature { - constructor() { - super(...arguments); - this.isActive = false; - } - onFocus() { - let isFocusVisible = false; - /** - * If this element doesn't match focus-visible then don't - * apply whileHover. But, if matches throws that focus-visible - * is not a valid selector then in that browser outline styles will be applied - * to the element by default and we want to match that behaviour with whileFocus. - */ - try { - isFocusVisible = this.node.current.matches(":focus-visible"); - } - catch (e) { - isFocusVisible = true; - } - if (!isFocusVisible || !this.node.animationState) - return; - this.node.animationState.setActive("whileFocus", true); - this.isActive = true; - } - onBlur() { - if (!this.isActive || !this.node.animationState) - return; - this.node.animationState.setActive("whileFocus", false); - this.isActive = false; - } - mount() { - this.unmount = motionUtils.pipe(motionDom.addDomEvent(this.node.current, "focus", () => this.onFocus()), motionDom.addDomEvent(this.node.current, "blur", () => this.onBlur())); - } - unmount() { } -} - -function handlePressEvent(node, event, lifecycle) { - const { props } = node; - if (node.current instanceof HTMLButtonElement && node.current.disabled) { - return; - } - if (node.animationState && props.whileTap) { - node.animationState.setActive("whileTap", lifecycle === "Start"); - } - const eventName = ("onTap" + (lifecycle === "End" ? "" : lifecycle)); - const callback = props[eventName]; - if (callback) { - motionDom.frame.postRender(() => callback(event, extractEventInfo(event))); - } -} -class PressGesture extends motionDom.Feature { - mount() { - const { current } = this.node; - if (!current) - return; - const { globalTapTarget, propagate } = this.node.props; - this.unmount = motionDom.press(current, (_element, startEvent) => { - handlePressEvent(this.node, startEvent, "Start"); - return (endEvent, { success }) => handlePressEvent(this.node, endEvent, success ? "End" : "Cancel"); - }, { - useGlobalTarget: globalTapTarget, - stopPropagation: propagate?.tap === false, - }); - } - unmount() { } -} - -/** - * Map an IntersectionHandler callback to an element. We only ever make one handler for one - * element, so even though these handlers might all be triggered by different - * observers, we can keep them in the same map. - */ -const observerCallbacks = new WeakMap(); -/** - * Multiple observers can be created for multiple element/document roots. Each with - * different settings. So here we store dictionaries of observers to each root, - * using serialised settings (threshold/margin) as lookup keys. - */ -const observers = new WeakMap(); -const fireObserverCallback = (entry) => { - const callback = observerCallbacks.get(entry.target); - callback && callback(entry); -}; -const fireAllObserverCallbacks = (entries) => { - entries.forEach(fireObserverCallback); -}; -function initIntersectionObserver({ root, ...options }) { - const lookupRoot = root || document; - /** - * If we don't have an observer lookup map for this root, create one. - */ - if (!observers.has(lookupRoot)) { - observers.set(lookupRoot, {}); - } - const rootObservers = observers.get(lookupRoot); - const key = JSON.stringify(options); - /** - * If we don't have an observer for this combination of root and settings, - * create one. - */ - if (!rootObservers[key]) { - rootObservers[key] = new IntersectionObserver(fireAllObserverCallbacks, { root, ...options }); - } - return rootObservers[key]; -} -function observeIntersection(element, options, callback) { - const rootInteresectionObserver = initIntersectionObserver(options); - observerCallbacks.set(element, callback); - rootInteresectionObserver.observe(element); - return () => { - observerCallbacks.delete(element); - rootInteresectionObserver.unobserve(element); - }; -} - -const thresholdNames = { - some: 0, - all: 1, -}; -class InViewFeature extends motionDom.Feature { - constructor() { - super(...arguments); - this.hasEnteredView = false; - this.isInView = false; - } - startObserver() { - this.stopObserver?.(); - const { viewport = {} } = this.node.getProps(); - const { root, margin: rootMargin, amount = "some", once } = viewport; - const options = { - root: root ? root.current : undefined, - rootMargin, - threshold: typeof amount === "number" ? amount : thresholdNames[amount], - }; - const onIntersectionUpdate = (entry) => { - const { isIntersecting } = entry; - /** - * If there's been no change in the viewport state, early return. - */ - if (this.isInView === isIntersecting) - return; - this.isInView = isIntersecting; - /** - * Handle hasEnteredView. If this is only meant to run once, and - * element isn't visible, early return. Otherwise set hasEnteredView to true. - */ - if (once && !isIntersecting && this.hasEnteredView) { - return; - } - else if (isIntersecting) { - this.hasEnteredView = true; - } - if (this.node.animationState) { - this.node.animationState.setActive("whileInView", isIntersecting); - } - /** - * Use the latest committed props rather than the ones in scope - * when this observer is created - */ - const { onViewportEnter, onViewportLeave } = this.node.getProps(); - const callback = isIntersecting ? onViewportEnter : onViewportLeave; - callback && callback(entry); - }; - this.stopObserver = observeIntersection(this.node.current, options, onIntersectionUpdate); - } - mount() { - this.startObserver(); - } - update() { - if (typeof IntersectionObserver === "undefined") - return; - const { props, prevProps } = this.node; - const hasOptionsChanged = ["amount", "margin", "root"].some(hasViewportOptionChanged(props, prevProps)); - if (hasOptionsChanged) { - this.startObserver(); - } - } - unmount() { - this.stopObserver?.(); - this.hasEnteredView = false; - this.isInView = false; - } -} -function hasViewportOptionChanged({ viewport = {} }, { viewport: prevViewport = {} } = {}) { - return (name) => viewport[name] !== prevViewport[name]; -} - -const gestureAnimations = { - inView: { - Feature: InViewFeature, - }, - tap: { - Feature: PressGesture, - }, - focus: { - Feature: FocusGesture, - }, - hover: { - Feature: HoverGesture, - }, -}; - -const layout = { - layout: { - ProjectionNode: motionDom.HTMLProjectionNode, - MeasureLayout, - }, -}; - -const featureBundle = { - ...animations, - ...gestureAnimations, - ...drag, - ...layout, -}; - -exports.addPointerEvent = addPointerEvent; -exports.addPointerInfo = addPointerInfo; -exports.animations = animations; -exports.createDomVisualElement = createDomVisualElement; -exports.distance = distance; -exports.distance2D = distance2D; -exports.drag = drag; -exports.featureBundle = featureBundle; -exports.gestureAnimations = gestureAnimations; -exports.layout = layout; -exports.useIsPresent = useIsPresent; -exports.usePresence = usePresence; -//# sourceMappingURL=feature-bundle-BZV7Y7IM.js.map diff --git a/node_modules/framer-motion/dist/cjs/feature-bundle-BZV7Y7IM.js.map b/node_modules/framer-motion/dist/cjs/feature-bundle-BZV7Y7IM.js.map deleted file mode 100644 index b8fe053..0000000 --- a/node_modules/framer-motion/dist/cjs/feature-bundle-BZV7Y7IM.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"feature-bundle-BZV7Y7IM.js","sources":["../../src/components/AnimatePresence/use-presence.ts","../../src/render/dom/create-visual-element.ts","../../src/motion/features/animation/index.ts","../../src/motion/features/animation/exit.ts","../../src/motion/features/animations.ts","../../src/events/event-info.ts","../../src/events/add-pointer-event.ts","../../src/utils/get-context-window.ts","../../src/utils/distance.ts","../../src/gestures/pan/PanSession.ts","../../src/gestures/drag/utils/constraints.ts","../../src/gestures/drag/VisualElementDragControls.ts","../../src/gestures/drag/index.ts","../../src/gestures/pan/index.ts","../../src/motion/features/layout/MeasureLayout.tsx","../../src/motion/features/drag.ts","../../src/gestures/hover.ts","../../src/gestures/focus.ts","../../src/gestures/press.ts","../../src/motion/features/viewport/observers.ts","../../src/motion/features/viewport/index.ts","../../src/motion/features/gestures.ts","../../src/motion/features/layout.ts","../../src/render/components/motion/feature-bundle.ts"],"sourcesContent":["\"use client\"\n\nimport { useCallback, useContext, useEffect, useId } from \"react\"\nimport {\n PresenceContext,\n PresenceContextProps,\n} from \"../../context/PresenceContext\"\n\nexport type SafeToRemove = () => void\n\ntype AlwaysPresent = [true, null]\n\ntype Present = [true]\n\ntype NotPresent = [false, SafeToRemove]\n\n/**\n * When a component is the child of `AnimatePresence`, it can use `usePresence`\n * to access information about whether it's still present in the React tree.\n *\n * ```jsx\n * import { usePresence } from \"framer-motion\"\n *\n * export const Component = () => {\n * const [isPresent, safeToRemove] = usePresence()\n *\n * useEffect(() => {\n * !isPresent && setTimeout(safeToRemove, 1000)\n * }, [isPresent])\n *\n * return
\n * }\n * ```\n *\n * If `isPresent` is `false`, it means that a component has been removed from the tree,\n * but `AnimatePresence` won't really remove it until `safeToRemove` has been called.\n *\n * @public\n */\nexport function usePresence(\n subscribe: boolean = true\n): AlwaysPresent | Present | NotPresent {\n const context = useContext(PresenceContext)\n\n if (context === null) return [true, null]\n\n const { isPresent, onExitComplete, register } = context\n\n // It's safe to call the following hooks conditionally (after an early return) because the context will always\n // either be null or non-null for the lifespan of the component.\n\n const id = useId()\n useEffect(() => {\n if (subscribe) {\n return register(id)\n }\n }, [subscribe])\n\n const safeToRemove = useCallback(\n () => subscribe && onExitComplete && onExitComplete(id),\n [id, onExitComplete, subscribe]\n )\n\n return !isPresent && onExitComplete ? [false, safeToRemove] : [true]\n}\n\n/**\n * Similar to `usePresence`, except `useIsPresent` simply returns whether or not the component is present.\n * There is no `safeToRemove` function.\n *\n * ```jsx\n * import { useIsPresent } from \"framer-motion\"\n *\n * export const Component = () => {\n * const isPresent = useIsPresent()\n *\n * useEffect(() => {\n * !isPresent && console.log(\"I've been removed!\")\n * }, [isPresent])\n *\n * return
\n * }\n * ```\n *\n * @public\n */\nexport function useIsPresent() {\n return isPresent(useContext(PresenceContext))\n}\n\nexport function isPresent(context: PresenceContextProps | null) {\n return context === null ? true : context.isPresent\n}\n","import { HTMLVisualElement, SVGVisualElement } from \"motion-dom\"\nimport { ComponentType, Fragment } from \"react\"\nimport { CreateVisualElement, VisualElementOptions } from \"../types\"\nimport { isSVGComponent } from \"./utils/is-svg-component\"\n\nexport const createDomVisualElement: CreateVisualElement = (\n Component: string | ComponentType>,\n options: VisualElementOptions\n) => {\n /**\n * Use explicit isSVG override if provided, otherwise auto-detect\n */\n const isSVG = options.isSVG ?? isSVGComponent(Component)\n\n return isSVG\n ? new SVGVisualElement(options)\n : new HTMLVisualElement(options, {\n allowProjection: Component !== Fragment,\n })\n}\n","import {\n createAnimationState,\n Feature,\n isAnimationControls,\n type VisualElement,\n} from \"motion-dom\"\n\nexport class AnimationFeature extends Feature {\n unmountControls?: () => void\n\n /**\n * We dynamically generate the AnimationState manager as it contains a reference\n * to the underlying animation library. We only want to load that if we load this,\n * so people can optionally code split it out using the `m` component.\n */\n constructor(node: VisualElement) {\n super(node)\n node.animationState ||= createAnimationState(node)\n }\n\n updateAnimationControlsSubscription() {\n const { animate } = this.node.getProps()\n if (isAnimationControls(animate)) {\n this.unmountControls = animate.subscribe(this.node)\n }\n }\n\n /**\n * Subscribe any provided AnimationControls to the component's VisualElement\n */\n mount() {\n this.updateAnimationControlsSubscription()\n }\n\n update() {\n const { animate } = this.node.getProps()\n const { animate: prevAnimate } = this.node.prevProps || {}\n if (animate !== prevAnimate) {\n this.updateAnimationControlsSubscription()\n }\n }\n\n unmount() {\n this.node.animationState!.reset()\n this.unmountControls?.()\n }\n}\n","import { Feature, resolveVariant } from \"motion-dom\"\n\nlet id = 0\n\nexport class ExitAnimationFeature extends Feature {\n private id: number = id++\n private isExitComplete = false\n\n update() {\n if (!this.node.presenceContext) return\n\n const { isPresent, onExitComplete } = this.node.presenceContext\n const { isPresent: prevIsPresent } = this.node.prevPresenceContext || {}\n\n if (!this.node.animationState || isPresent === prevIsPresent) {\n return\n }\n\n if (isPresent && prevIsPresent === false) {\n /**\n * When re-entering, if the exit animation already completed\n * (element is at rest), reset to initial values so the enter\n * animation replays from the correct position.\n */\n if (this.isExitComplete) {\n const { initial, custom } = this.node.getProps()\n\n if (\n typeof initial === \"string\" ||\n (typeof initial === \"object\" &&\n initial !== null &&\n !Array.isArray(initial))\n ) {\n const resolved = resolveVariant(\n this.node,\n initial,\n custom\n )\n if (resolved) {\n const { transition, transitionEnd, ...target } =\n resolved\n for (const key in target) {\n this.node\n .getValue(key)\n ?.jump(\n target[\n key as keyof typeof target\n ] as any\n )\n }\n }\n }\n\n this.node.animationState.reset()\n this.node.animationState.animateChanges()\n } else {\n this.node.animationState.setActive(\"exit\", false)\n }\n\n this.isExitComplete = false\n return\n }\n\n const exitAnimation = this.node.animationState.setActive(\n \"exit\",\n !isPresent\n )\n\n if (onExitComplete && !isPresent) {\n exitAnimation.then(() => {\n this.isExitComplete = true\n onExitComplete(this.id)\n })\n }\n }\n\n mount() {\n const { register, onExitComplete } = this.node.presenceContext || {}\n\n if (onExitComplete) {\n onExitComplete(this.id)\n }\n\n if (register) {\n this.unmount = register(this.id)\n }\n }\n\n unmount() {}\n}\n","import { AnimationFeature } from \"./animation\"\nimport { ExitAnimationFeature } from \"./animation/exit\"\nimport { FeaturePackages } from \"./types\"\n\nexport const animations: FeaturePackages = {\n animation: {\n Feature: AnimationFeature,\n },\n exit: {\n Feature: ExitAnimationFeature,\n },\n}\n","import { EventInfo, isPrimaryPointer } from \"motion-dom\"\n\nexport type EventListenerWithPointInfo = (\n e: PointerEvent,\n info: EventInfo\n) => void\n\nexport function extractEventInfo(event: PointerEvent): EventInfo {\n return {\n point: {\n x: event.pageX,\n y: event.pageY,\n },\n }\n}\n\nexport const addPointerInfo =\n (handler: EventListenerWithPointInfo): EventListener =>\n (event: PointerEvent) =>\n isPrimaryPointer(event) && handler(event, extractEventInfo(event))\n","import { addDomEvent } from \"motion-dom\"\nimport { addPointerInfo, EventListenerWithPointInfo } from \"./event-info\"\n\nexport function addPointerEvent(\n target: EventTarget,\n eventName: string,\n handler: EventListenerWithPointInfo,\n options?: AddEventListenerOptions\n) {\n return addDomEvent(target, eventName, addPointerInfo(handler), options)\n}\n","import type { VisualElement } from \"motion-dom\"\n\n// Fixes https://github.com/motiondivision/motion/issues/2270\nexport const getContextWindow = ({ current }: VisualElement) => {\n return current ? current.ownerDocument.defaultView : null\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","import type { EventInfo, PanHandler } from \"motion-dom\"\nimport { cancelFrame, frame, frameData, isPrimaryPointer } from \"motion-dom\"\nimport {\n millisecondsToSeconds,\n pipe,\n Point,\n secondsToMilliseconds,\n TransformPoint,\n} from \"motion-utils\"\nimport { addPointerEvent } from \"../../events/add-pointer-event\"\nimport { extractEventInfo } from \"../../events/event-info\"\nimport { distance2D } from \"../../utils/distance\"\n\ninterface PanSessionHandlers {\n onSessionStart: PanHandler\n onStart: PanHandler\n onMove: PanHandler\n onEnd: PanHandler\n onSessionEnd: PanHandler\n resumeAnimation: () => void\n}\n\ninterface PanSessionOptions {\n transformPagePoint?: TransformPoint\n dragSnapToOrigin?: boolean | \"x\" | \"y\"\n distanceThreshold?: number\n contextWindow?: (Window & typeof globalThis) | null\n /**\n * Element being dragged. When provided, scroll events on its\n * ancestors and window are compensated so the gesture continues\n * smoothly during scroll.\n */\n element?: HTMLElement | null\n}\n\ninterface TimestampedPoint extends Point {\n timestamp: number\n}\n\nconst overflowStyles = /*#__PURE__*/ new Set([\"auto\", \"scroll\"])\n\n/**\n * @internal\n */\nexport class PanSession {\n /**\n * @internal\n */\n private history: TimestampedPoint[]\n\n /**\n * @internal\n */\n private startEvent: PointerEvent | null = null\n\n /**\n * @internal\n */\n private lastMoveEvent: PointerEvent | null = null\n\n /**\n * @internal\n */\n private lastMoveEventInfo: EventInfo | null = null\n\n /**\n * Raw (untransformed) event info, re-transformed each frame\n * so transformPagePoint sees the current parent matrix.\n * @internal\n */\n private lastRawMoveEventInfo: EventInfo | null = null\n\n /**\n * @internal\n */\n private transformPagePoint?: TransformPoint\n\n /**\n * @internal\n */\n private handlers: Partial = {}\n\n /**\n * @internal\n */\n private removeListeners: Function\n\n /**\n * For determining if an animation should resume after it is interupted\n *\n * @internal\n */\n private dragSnapToOrigin: boolean | \"x\" | \"y\"\n\n /**\n * The distance after which panning should start.\n *\n * @internal\n */\n private distanceThreshold: number\n\n /**\n * @internal\n */\n private contextWindow: PanSessionOptions[\"contextWindow\"] = window\n\n /**\n * Scroll positions of scrollable ancestors and window.\n * @internal\n */\n private scrollPositions: Map = new Map()\n\n /**\n * Cleanup function for scroll listeners.\n * @internal\n */\n private removeScrollListeners: (() => void) | null = null\n\n constructor(\n event: PointerEvent,\n handlers: Partial,\n {\n transformPagePoint,\n contextWindow = window,\n dragSnapToOrigin = false,\n distanceThreshold = 3,\n element,\n }: PanSessionOptions = {}\n ) {\n // If we have more than one touch, don't start detecting this gesture\n if (!isPrimaryPointer(event)) return\n\n this.dragSnapToOrigin = dragSnapToOrigin\n this.handlers = handlers\n this.transformPagePoint = transformPagePoint\n this.distanceThreshold = distanceThreshold\n this.contextWindow = contextWindow || window\n\n const info = extractEventInfo(event)\n const initialInfo = transformPoint(info, this.transformPagePoint)\n const { point } = initialInfo\n\n const { timestamp } = frameData\n\n this.history = [{ ...point, timestamp }]\n\n const { onSessionStart } = handlers\n onSessionStart &&\n onSessionStart(event, getPanInfo(initialInfo, this.history))\n\n // Listen in the capture phase so a descendant calling\n // stopPropagation() (e.g. in its own pointerup handler) can't\n // prevent the gesture from ending. See #2794.\n const eventOptions = { passive: true, capture: true }\n this.removeListeners = pipe(\n addPointerEvent(\n this.contextWindow,\n \"pointermove\",\n this.handlePointerMove,\n eventOptions\n ),\n addPointerEvent(\n this.contextWindow,\n \"pointerup\",\n this.handlePointerUp,\n eventOptions\n ),\n addPointerEvent(\n this.contextWindow,\n \"pointercancel\",\n this.handlePointerUp,\n eventOptions\n )\n )\n\n // Start scroll tracking if element provided\n if (element) {\n this.startScrollTracking(element)\n }\n }\n\n /**\n * Start tracking scroll on ancestors and window.\n */\n private startScrollTracking(element: HTMLElement): void {\n // Store initial scroll positions for scrollable ancestors\n let current = element.parentElement\n while (current) {\n const style = getComputedStyle(current)\n if (\n overflowStyles.has(style.overflowX) ||\n overflowStyles.has(style.overflowY)\n ) {\n this.scrollPositions.set(current, {\n x: current.scrollLeft,\n y: current.scrollTop,\n })\n }\n current = current.parentElement\n }\n\n // Track window scroll\n this.scrollPositions.set(window, {\n x: window.scrollX,\n y: window.scrollY,\n })\n\n // Capture listener catches element scroll events as they bubble\n window.addEventListener(\"scroll\", this.onElementScroll, {\n capture: true,\n })\n\n // Direct window scroll listener (window scroll doesn't bubble)\n window.addEventListener(\"scroll\", this.onWindowScroll)\n\n this.removeScrollListeners = () => {\n window.removeEventListener(\"scroll\", this.onElementScroll, {\n capture: true,\n })\n window.removeEventListener(\"scroll\", this.onWindowScroll)\n }\n }\n\n private onElementScroll = (event: Event): void => {\n this.handleScroll(event.target as Element)\n }\n\n private onWindowScroll = (): void => {\n this.handleScroll(window)\n }\n\n /**\n * Handle scroll compensation during drag.\n *\n * For element scroll: adjusts history origin since pageX/pageY doesn't change.\n * For window scroll: adjusts lastMoveEventInfo since pageX/pageY would change.\n */\n private handleScroll(target: Element | Window): void {\n const initial = this.scrollPositions.get(target)\n if (!initial) return\n\n const isWindow = target === window\n const current = isWindow\n ? { x: window.scrollX, y: window.scrollY }\n : {\n x: (target as Element).scrollLeft,\n y: (target as Element).scrollTop,\n }\n\n const delta = { x: current.x - initial.x, y: current.y - initial.y }\n if (delta.x === 0 && delta.y === 0) return\n\n if (isWindow) {\n // Window scroll: pageX/pageY changes, so update lastMoveEventInfo\n if (this.lastMoveEventInfo) {\n this.lastMoveEventInfo.point.x += delta.x\n this.lastMoveEventInfo.point.y += delta.y\n }\n } else {\n // Element scroll: pageX/pageY unchanged, so adjust history origin\n if (this.history.length > 0) {\n this.history[0].x -= delta.x\n this.history[0].y -= delta.y\n }\n }\n\n this.scrollPositions.set(target, current)\n frame.update(this.updatePoint, true)\n }\n\n private updatePoint = () => {\n if (!(this.lastMoveEvent && this.lastMoveEventInfo)) return\n\n // Re-transform raw point through current transformPagePoint so\n // animated parent transforms (e.g. rotation) are picked up each frame\n if (this.lastRawMoveEventInfo) {\n this.lastMoveEventInfo = transformPoint(\n this.lastRawMoveEventInfo,\n this.transformPagePoint\n )\n }\n\n const info = getPanInfo(this.lastMoveEventInfo, this.history)\n const isPanStarted = this.startEvent !== null\n\n // Only start panning if the offset is larger than 3 pixels. If we make it\n // any larger than this we'll want to reset the pointer history\n // on the first update to avoid visual snapping to the cursor.\n const isDistancePastThreshold =\n distance2D(info.offset, { x: 0, y: 0 }) >= this.distanceThreshold\n\n if (!isPanStarted && !isDistancePastThreshold) return\n\n const { point } = info\n const { timestamp } = frameData\n this.history.push({ ...point, timestamp })\n\n const { onStart, onMove } = this.handlers\n\n if (!isPanStarted) {\n onStart && onStart(this.lastMoveEvent, info)\n this.startEvent = this.lastMoveEvent\n }\n\n onMove && onMove(this.lastMoveEvent, info)\n }\n\n private handlePointerMove = (event: PointerEvent, info: EventInfo) => {\n this.lastMoveEvent = event\n this.lastRawMoveEventInfo = info\n this.lastMoveEventInfo = transformPoint(info, this.transformPagePoint)\n\n // Throttle mouse move event to once per frame\n frame.update(this.updatePoint, true)\n }\n\n private handlePointerUp = (event: PointerEvent, info: EventInfo) => {\n this.end()\n\n const { onEnd, onSessionEnd, resumeAnimation } = this.handlers\n\n // Resume animation if dragSnapToOrigin is set OR if no drag started (user just clicked)\n // This ensures constraint animations continue when interrupted by a click\n if (this.dragSnapToOrigin || !this.startEvent) {\n resumeAnimation && resumeAnimation()\n }\n if (!(this.lastMoveEvent && this.lastMoveEventInfo)) return\n\n const panInfo = getPanInfo(\n event.type === \"pointercancel\"\n ? this.lastMoveEventInfo\n : transformPoint(info, this.transformPagePoint),\n this.history\n )\n\n if (this.startEvent && onEnd) {\n onEnd(event, panInfo)\n }\n\n onSessionEnd && onSessionEnd(event, panInfo)\n }\n\n updateHandlers(handlers: Partial) {\n this.handlers = handlers\n }\n\n end() {\n this.removeListeners && this.removeListeners()\n this.removeScrollListeners && this.removeScrollListeners()\n this.scrollPositions.clear()\n cancelFrame(this.updatePoint)\n }\n}\n\nfunction transformPoint(\n info: EventInfo,\n transformPagePoint?: (point: Point) => Point\n) {\n return transformPagePoint ? { point: transformPagePoint(info.point) } : info\n}\n\nfunction subtractPoint(a: Point, b: Point): Point {\n return { x: a.x - b.x, y: a.y - b.y }\n}\n\nfunction getPanInfo({ point }: EventInfo, history: TimestampedPoint[]) {\n return {\n point,\n delta: subtractPoint(point, lastDevicePoint(history)),\n offset: subtractPoint(point, startDevicePoint(history)),\n velocity: getVelocity(history, 0.1),\n }\n}\n\nfunction startDevicePoint(history: TimestampedPoint[]): TimestampedPoint {\n return history[0]\n}\n\nfunction lastDevicePoint(history: TimestampedPoint[]): TimestampedPoint {\n return history[history.length - 1]\n}\n\nfunction getVelocity(history: TimestampedPoint[], timeDelta: number): Point {\n if (history.length < 2) {\n return { x: 0, y: 0 }\n }\n\n let i = history.length - 1\n let timestampedPoint: TimestampedPoint | null = null\n const lastPoint = lastDevicePoint(history)\n while (i >= 0) {\n timestampedPoint = history[i]\n if (\n lastPoint.timestamp - timestampedPoint.timestamp >\n secondsToMilliseconds(timeDelta)\n ) {\n break\n }\n i--\n }\n\n if (!timestampedPoint) {\n return { x: 0, y: 0 }\n }\n\n /**\n * If the selected point is the pointer-down origin (history[0]),\n * there are better movement points available, and the time gap\n * is suspiciously large (>2x timeDelta), use the next point instead.\n * This prevents stale pointer-down points from diluting velocity\n * in hold-then-flick gestures.\n */\n if (\n timestampedPoint === history[0] &&\n history.length > 2 &&\n lastPoint.timestamp - timestampedPoint.timestamp >\n secondsToMilliseconds(timeDelta) * 2\n ) {\n timestampedPoint = history[1]\n }\n\n const time = millisecondsToSeconds(\n lastPoint.timestamp - timestampedPoint.timestamp\n )\n if (time === 0) {\n return { x: 0, y: 0 }\n }\n\n const currentVelocity = {\n x: (lastPoint.x - timestampedPoint.x) / time,\n y: (lastPoint.y - timestampedPoint.y) / time,\n }\n\n if (currentVelocity.x === Infinity) {\n currentVelocity.x = 0\n }\n if (currentVelocity.y === Infinity) {\n currentVelocity.y = 0\n }\n\n return currentVelocity\n}\n","import { calcLength, mixNumber, type DragElastic, type ResolvedConstraints } from \"motion-dom\"\nimport {\n Axis,\n BoundingBox,\n Box,\n progress as calcProgress,\n clamp,\n Point,\n} from \"motion-utils\"\n\n/**\n * Apply constraints to a point. These constraints are both physical along an\n * axis, and an elastic factor that determines how much to constrain the point\n * by if it does lie outside the defined parameters.\n */\nexport function applyConstraints(\n point: number,\n { min, max }: Partial,\n elastic?: Axis\n): number {\n if (min !== undefined && point < min) {\n // If we have a min point defined, and this is outside of that, constrain\n point = elastic\n ? mixNumber(min, point, elastic.min)\n : Math.max(point, min)\n } else if (max !== undefined && point > max) {\n // If we have a max point defined, and this is outside of that, constrain\n point = elastic\n ? mixNumber(max, point, elastic.max)\n : Math.min(point, max)\n }\n\n return point\n}\n\n/**\n * Calculates a min projection point based on a pointer, pointer progress\n * within the drag target, and constraints.\n *\n * For instance if an element was 100px width, we were dragging from 0.25\n * along this axis, the pointer is at 200px, and there were no constraints,\n * we would calculate a min projection point of 175px.\n */\nexport function calcConstrainedMinPoint(\n point: number,\n length: number,\n progress: number,\n constraints?: Partial,\n elastic?: Axis\n): number {\n // Calculate a min point for this axis and apply it to the current pointer\n const min = point - length * progress\n\n return constraints ? applyConstraints(min, constraints, elastic) : min\n}\n\n/**\n * Calculate constraints in terms of the viewport when defined relatively to the\n * measured axis. This is measured from the nearest edge, so a max constraint of 200\n * on an axis with a max value of 300 would return a constraint of 500 - axis length\n */\nexport function calcRelativeAxisConstraints(\n axis: Axis,\n min?: number,\n max?: number\n): Partial {\n return {\n min: min !== undefined ? axis.min + min : undefined,\n max:\n max !== undefined\n ? axis.max + max - (axis.max - axis.min)\n : undefined,\n }\n}\n\n/**\n * Calculate constraints in terms of the viewport when\n * defined relatively to the measured bounding box.\n */\nexport function calcRelativeConstraints(\n layoutBox: Box,\n { top, left, bottom, right }: Partial\n): ResolvedConstraints {\n return {\n x: calcRelativeAxisConstraints(layoutBox.x, left, right),\n y: calcRelativeAxisConstraints(layoutBox.y, top, bottom),\n }\n}\n\n/**\n * Calculate viewport constraints when defined as another viewport-relative axis\n */\nexport function calcViewportAxisConstraints(\n layoutAxis: Axis,\n constraintsAxis: Axis\n) {\n let min = constraintsAxis.min - layoutAxis.min\n let max = constraintsAxis.max - layoutAxis.max\n\n // If the constraints axis is actually smaller than the layout axis then we can\n // flip the constraints\n if (\n constraintsAxis.max - constraintsAxis.min <\n layoutAxis.max - layoutAxis.min\n ) {\n ;[min, max] = [max, min]\n }\n\n return { min, max }\n}\n\n/**\n * Calculate viewport constraints when defined as another viewport-relative box\n */\nexport function calcViewportConstraints(layoutBox: Box, constraintsBox: Box) {\n return {\n x: calcViewportAxisConstraints(layoutBox.x, constraintsBox.x),\n y: calcViewportAxisConstraints(layoutBox.y, constraintsBox.y),\n }\n}\n\n/**\n * Calculate a transform origin relative to the source axis, between 0-1, that results\n * in an asthetically pleasing scale/transform needed to project from source to target.\n */\nexport function calcOrigin(source: Axis, target: Axis): number {\n let origin = 0.5\n const sourceLength = calcLength(source)\n const targetLength = calcLength(target)\n\n if (targetLength > sourceLength) {\n origin = calcProgress(target.min, target.max - sourceLength, source.min)\n } else if (sourceLength > targetLength) {\n origin = calcProgress(source.min, source.max - targetLength, target.min)\n }\n\n return clamp(0, 1, origin)\n}\n\n/**\n * Calculate the relative progress of one constraints box relative to another.\n * Imagine a page scroll bar. At the top, this would return 0, at the bottom, 1.\n * Anywhere in-between, a value between 0 and 1.\n *\n * This also handles flipped constraints, for instance a draggable container within\n * a smaller viewport like a scrollable view.\n */\nexport function calcProgressWithinConstraints(\n layoutBox: Box,\n constraintsBox: Box\n): Point {\n return {\n x: calcOrigin(layoutBox.x, constraintsBox.x),\n y: calcOrigin(layoutBox.y, constraintsBox.y),\n }\n}\n\n/**\n * Calculate the an axis position based on two axes and a progress value.\n */\nexport function calcPositionFromProgress(\n axis: Axis,\n constraints: Axis,\n progress: number\n): Axis {\n const axisLength = axis.max - axis.min\n const min = mixNumber(\n constraints.min,\n constraints.max - axisLength,\n progress\n )\n return { min, max: min + axisLength }\n}\n\n/**\n * Rebase the calculated viewport constraints relative to the layout.min point.\n */\nexport function rebaseAxisConstraints(\n layout: Axis,\n constraints: Partial\n): Partial {\n const relativeConstraints: Partial = {}\n\n if (constraints.min !== undefined) {\n relativeConstraints.min = constraints.min - layout.min\n }\n\n if (constraints.max !== undefined) {\n relativeConstraints.max = constraints.max - layout.min\n }\n\n return relativeConstraints\n}\n\nexport const defaultElastic = 0.35\n/**\n * Accepts a dragElastic prop and returns resolved elastic values for each axis.\n */\nexport function resolveDragElastic(\n dragElastic: DragElastic = defaultElastic\n): Box {\n if (dragElastic === false) {\n dragElastic = 0\n } else if (dragElastic === true) {\n dragElastic = defaultElastic\n }\n\n return {\n x: resolveAxisElastic(dragElastic, \"left\", \"right\"),\n y: resolveAxisElastic(dragElastic, \"top\", \"bottom\"),\n }\n}\n\nexport function resolveAxisElastic(\n dragElastic: DragElastic,\n minLabel: string,\n maxLabel: string\n): Axis {\n return {\n min: resolvePointElastic(dragElastic, minLabel),\n max: resolvePointElastic(dragElastic, maxLabel),\n }\n}\n\nexport function resolvePointElastic(\n dragElastic: DragElastic,\n label: string\n): number {\n return typeof dragElastic === \"number\"\n ? dragElastic\n : dragElastic[label as keyof typeof dragElastic] || 0\n}\n","import {\n addValueToWillChange,\n animateMotionValue,\n calcLength,\n convertBoundingBoxToBox,\n convertBoxToBoundingBox,\n createBox,\n eachAxis,\n frame,\n isElementTextInput,\n measurePageBox,\n mixNumber,\n PanInfo,\n percent,\n ResolvedConstraints,\n resize,\n setDragLock,\n Transition,\n type VisualElement,\n} from \"motion-dom\"\nimport { Axis, Point, invariant } from \"motion-utils\"\nimport { addDomEvent, type LayoutUpdateData } from \"motion-dom\"\nimport { addPointerEvent } from \"../../events/add-pointer-event\"\nimport { extractEventInfo } from \"../../events/event-info\"\nimport { MotionProps } from \"../../motion/types\"\nimport { getContextWindow } from \"../../utils/get-context-window\"\nimport { isRefObject } from \"../../utils/is-ref-object\"\nimport { PanSession } from \"../pan/PanSession\"\nimport {\n applyConstraints,\n calcOrigin,\n calcRelativeConstraints,\n calcViewportConstraints,\n defaultElastic,\n rebaseAxisConstraints,\n resolveDragElastic,\n} from \"./utils/constraints\"\n\nexport const elementDragControls = new WeakMap<\n VisualElement,\n VisualElementDragControls\n>()\n\nexport interface DragControlOptions {\n /**\n * This distance after which dragging starts and a direction is locked in.\n *\n * @public\n */\n distanceThreshold?: number\n\n /**\n * Whether to immediately snap to the cursor when dragging starts.\n *\n * @public\n */\n snapToCursor?: boolean\n}\n\ntype DragDirection = \"x\" | \"y\"\n\nexport class VisualElementDragControls {\n private visualElement: VisualElement\n\n private panSession?: PanSession\n\n private openDragLock: VoidFunction | null = null\n\n isDragging = false\n private currentDirection: DragDirection | null = null\n\n private originPoint: Point = { x: 0, y: 0 }\n\n /**\n * The permitted boundaries of travel, in pixels.\n */\n private constraints: ResolvedConstraints | false = false\n\n private hasMutatedConstraints = false\n\n /**\n * The per-axis resolved elastic values.\n */\n private elastic = createBox()\n\n /**\n * The latest pointer event. Used as fallback when the `cancel` and `stop` functions are called without arguments.\n */\n private latestPointerEvent: PointerEvent | null = null\n\n /**\n * The latest pan info. Used as fallback when the `cancel` and `stop` functions are called without arguments.\n */\n private latestPanInfo: PanInfo | null = null\n\n constructor(visualElement: VisualElement) {\n this.visualElement = visualElement\n }\n\n start(\n originEvent: PointerEvent,\n { snapToCursor = false, distanceThreshold }: DragControlOptions = {}\n ) {\n /**\n * Don't start dragging if this component is exiting\n */\n const { presenceContext } = this.visualElement\n if (presenceContext && presenceContext.isPresent === false) return\n\n const onSessionStart = (event: PointerEvent) => {\n if (snapToCursor) {\n this.snapToCursor(extractEventInfo(event).point)\n }\n this.stopAnimation()\n }\n\n const onStart = (event: PointerEvent, info: PanInfo) => {\n // Attempt to grab the global drag gesture lock - maybe make this part of PanSession\n const { drag, dragPropagation, onDragStart } = this.getProps()\n\n if (drag && !dragPropagation) {\n if (this.openDragLock) this.openDragLock()\n\n this.openDragLock = setDragLock(drag)\n\n // If we don 't have the lock, don't start dragging\n if (!this.openDragLock) return\n }\n\n this.latestPointerEvent = event\n this.latestPanInfo = info\n this.isDragging = true\n\n this.currentDirection = null\n\n this.resolveConstraints()\n\n if (this.visualElement.projection) {\n this.visualElement.projection.isAnimationBlocked = true\n this.visualElement.projection.target = undefined\n }\n\n /**\n * Record gesture origin and pointer offset\n */\n eachAxis((axis) => {\n let current = this.getAxisMotionValue(axis).get() || 0\n\n /**\n * If the MotionValue is a percentage value convert to px\n */\n if (percent.test(current)) {\n const { projection } = this.visualElement\n\n if (projection && projection.layout) {\n const measuredAxis = projection.layout.layoutBox[axis]\n\n if (measuredAxis) {\n const length = calcLength(measuredAxis)\n current = length * (parseFloat(current) / 100)\n }\n }\n }\n\n this.originPoint[axis] = current\n })\n\n // Fire onDragStart event\n if (onDragStart) {\n frame.update(() => onDragStart(event, info), false, true)\n }\n\n addValueToWillChange(this.visualElement, \"transform\")\n\n const { animationState } = this.visualElement\n animationState && animationState.setActive(\"whileDrag\", true)\n }\n\n const onMove = (event: PointerEvent, info: PanInfo) => {\n this.latestPointerEvent = event\n this.latestPanInfo = info\n\n const {\n dragPropagation,\n dragDirectionLock,\n onDirectionLock,\n onDrag,\n } = this.getProps()\n\n // If we didn't successfully receive the gesture lock, early return.\n if (!dragPropagation && !this.openDragLock) return\n\n const { offset } = info\n // Attempt to detect drag direction if directionLock is true\n if (dragDirectionLock && this.currentDirection === null) {\n this.currentDirection = getCurrentDirection(offset)\n\n // If we've successfully set a direction, notify listener\n if (this.currentDirection !== null) {\n onDirectionLock && onDirectionLock(this.currentDirection)\n }\n\n return\n }\n\n // Update each point with the latest position\n this.updateAxis(\"x\", info.point, offset)\n this.updateAxis(\"y\", info.point, offset)\n\n /**\n * Ideally we would leave the renderer to fire naturally at the end of\n * this frame but if the element is about to change layout as the result\n * of a re-render we want to ensure the browser can read the latest\n * bounding box to ensure the pointer and element don't fall out of sync.\n */\n this.visualElement.render()\n\n /**\n * This must fire after the render call as it might trigger a state\n * change which itself might trigger a layout update.\n */\n if (onDrag) {\n frame.update(() => onDrag(event, info), false, true)\n }\n }\n\n const onSessionEnd = (event: PointerEvent, info: PanInfo) => {\n this.latestPointerEvent = event\n this.latestPanInfo = info\n\n this.stop(event, info)\n\n this.latestPointerEvent = null\n this.latestPanInfo = null\n }\n\n const resumeAnimation = () => {\n const { dragSnapToOrigin: snap } = this.getProps()\n if (snap || this.constraints) {\n this.startAnimation({ x: 0, y: 0 })\n }\n }\n\n const { dragSnapToOrigin } = this.getProps()\n this.panSession = new PanSession(\n originEvent,\n {\n onSessionStart,\n onStart,\n onMove,\n onSessionEnd,\n resumeAnimation,\n },\n {\n transformPagePoint: this.visualElement.getTransformPagePoint(),\n dragSnapToOrigin,\n distanceThreshold,\n contextWindow: getContextWindow(this.visualElement),\n element: this.visualElement.current,\n }\n )\n }\n\n /**\n * @internal\n */\n stop(event?: PointerEvent, panInfo?: PanInfo) {\n const finalEvent = event || this.latestPointerEvent\n const finalPanInfo = panInfo || this.latestPanInfo\n\n const isDragging = this.isDragging\n this.cancel()\n if (!isDragging || !finalPanInfo || !finalEvent) return\n\n const { velocity } = finalPanInfo\n this.startAnimation(velocity)\n\n const { onDragEnd } = this.getProps()\n if (onDragEnd) {\n frame.postRender(() => onDragEnd(finalEvent, finalPanInfo))\n }\n }\n\n /**\n * @internal\n */\n cancel() {\n this.isDragging = false\n\n const { projection, animationState } = this.visualElement\n\n if (projection) {\n projection.isAnimationBlocked = false\n }\n\n this.endPanSession()\n\n const { dragPropagation } = this.getProps()\n\n if (!dragPropagation && this.openDragLock) {\n this.openDragLock()\n this.openDragLock = null\n }\n\n animationState && animationState.setActive(\"whileDrag\", false)\n }\n\n /**\n * Clean up the pan session without modifying other drag state.\n * This is used during unmount to ensure event listeners are removed\n * without affecting projection animations or drag locks.\n * @internal\n */\n endPanSession() {\n this.panSession && this.panSession.end()\n this.panSession = undefined\n }\n\n private updateAxis(axis: DragDirection, _point: Point, offset?: Point) {\n const { drag } = this.getProps()\n\n // If we're not dragging this axis, do an early return.\n if (!offset || !shouldDrag(axis, drag, this.currentDirection)) return\n\n const axisValue = this.getAxisMotionValue(axis)\n let next = this.originPoint[axis] + offset[axis]\n\n // Apply constraints\n if (this.constraints && this.constraints[axis]) {\n next = applyConstraints(\n next,\n this.constraints[axis],\n this.elastic[axis]\n )\n }\n\n axisValue.set(next)\n }\n\n private resolveConstraints() {\n const { dragConstraints, dragElastic } = this.getProps()\n\n const layout =\n this.visualElement.projection &&\n !this.visualElement.projection.layout\n ? this.visualElement.projection.measure(false)\n : this.visualElement.projection?.layout\n\n const prevConstraints = this.constraints\n\n if (dragConstraints && isRefObject(dragConstraints)) {\n if (!this.constraints) {\n this.constraints = this.resolveRefConstraints()\n }\n } else {\n if (dragConstraints && layout) {\n this.constraints = calcRelativeConstraints(\n layout.layoutBox,\n dragConstraints\n )\n } else {\n this.constraints = false\n }\n }\n\n this.elastic = resolveDragElastic(dragElastic)\n\n /**\n * If we're outputting to external MotionValues, we want to rebase the measured constraints\n * from viewport-relative to component-relative. This only applies to relative (non-ref)\n * constraints, as ref-based constraints from calcViewportConstraints are already in the\n * correct coordinate space for the motion value transform offset.\n */\n if (\n prevConstraints !== this.constraints &&\n !isRefObject(dragConstraints) &&\n layout &&\n this.constraints &&\n !this.hasMutatedConstraints\n ) {\n eachAxis((axis) => {\n if (\n this.constraints !== false &&\n this.getAxisMotionValue(axis)\n ) {\n this.constraints[axis] = rebaseAxisConstraints(\n layout.layoutBox[axis],\n this.constraints[axis]\n )\n }\n })\n }\n }\n\n private resolveRefConstraints() {\n const { dragConstraints: constraints, onMeasureDragConstraints } =\n this.getProps()\n if (!constraints || !isRefObject(constraints)) return false\n\n const constraintsElement = constraints.current as HTMLElement\n\n invariant(\n constraintsElement !== null,\n \"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.\",\n \"drag-constraints-ref\"\n )\n\n const { projection } = this.visualElement\n\n // TODO\n if (!projection || !projection.layout) return false\n\n /**\n * Refresh the root scroll offset so the constraint's viewport box\n * translates to correct page coordinates. The scroll captured at\n * drag mount can be stale if the document was scrolled afterwards —\n * e.g. via the browser restoring scroll on refresh, or an ancestor\n * layout effect running after this element's mount (#2829).\n *\n * Clear the cached scroll first so `updateScroll` bypasses its\n * per-animationId cache and re-reads the live value.\n */\n if (projection.root) {\n projection.root.scroll = undefined\n projection.root.updateScroll()\n }\n\n const constraintsBox = measurePageBox(\n constraintsElement,\n projection.root!,\n this.visualElement.getTransformPagePoint()\n )\n\n let measuredConstraints = calcViewportConstraints(\n projection.layout.layoutBox,\n constraintsBox\n )\n\n /**\n * If there's an onMeasureDragConstraints listener we call it and\n * if different constraints are returned, set constraints to that\n */\n if (onMeasureDragConstraints) {\n const userConstraints = onMeasureDragConstraints(\n convertBoxToBoundingBox(measuredConstraints)\n )\n\n this.hasMutatedConstraints = !!userConstraints\n\n if (userConstraints) {\n measuredConstraints = convertBoundingBoxToBox(userConstraints)\n }\n }\n\n return measuredConstraints\n }\n\n private startAnimation(velocity: Point) {\n const {\n drag,\n dragMomentum,\n dragElastic,\n dragTransition,\n dragSnapToOrigin,\n onDragTransitionEnd,\n } = this.getProps()\n\n const constraints: Partial = this.constraints || {}\n\n const momentumAnimations = eachAxis((axis) => {\n if (!shouldDrag(axis, drag, this.currentDirection)) {\n return\n }\n\n let transition = (constraints && constraints[axis]) || {}\n\n if (\n dragSnapToOrigin === true ||\n (dragSnapToOrigin as unknown) === axis\n )\n transition = { min: 0, max: 0 }\n\n /**\n * Overdamp the boundary spring if `dragElastic` is disabled. There's still a frame\n * of spring animations so we should look into adding a disable spring option to `inertia`.\n * We could do something here where we affect the `bounceStiffness` and `bounceDamping`\n * using the value of `dragElastic`.\n */\n const bounceStiffness = dragElastic ? 200 : 1000000\n const bounceDamping = dragElastic ? 40 : 10000000\n\n const inertia: Transition = {\n type: \"inertia\",\n velocity: dragMomentum ? velocity[axis] : 0,\n bounceStiffness,\n bounceDamping,\n timeConstant: 750,\n restDelta: 1,\n restSpeed: 10,\n ...dragTransition,\n ...transition,\n }\n\n // If we're not animating on an externally-provided `MotionValue` we can use the\n // component's animation controls which will handle interactions with whileHover (etc),\n // otherwise we just have to animate the `MotionValue` itself.\n return this.startAxisValueAnimation(axis, inertia)\n })\n\n // Run all animations and then resolve the new drag constraints.\n return Promise.all(momentumAnimations).then(onDragTransitionEnd)\n }\n\n private startAxisValueAnimation(\n axis: DragDirection,\n transition: Transition\n ) {\n const axisValue = this.getAxisMotionValue(axis)\n\n addValueToWillChange(this.visualElement, axis)\n\n return axisValue.start(\n animateMotionValue(\n axis,\n axisValue,\n 0,\n transition,\n this.visualElement,\n false\n )\n )\n }\n\n private stopAnimation() {\n eachAxis((axis) => this.getAxisMotionValue(axis).stop())\n }\n\n /**\n * Drag works differently depending on which props are provided.\n *\n * - If _dragX and _dragY are provided, we output the gesture delta directly to those motion values.\n * - Otherwise, we apply the delta to the x/y motion values.\n */\n private getAxisMotionValue(axis: DragDirection) {\n const dragKey =\n `_drag${axis.toUpperCase()}` as `_drag${Uppercase}`\n const props = this.visualElement.getProps()\n const externalMotionValue = props[dragKey]\n\n return externalMotionValue\n ? externalMotionValue\n : this.visualElement.getValue(\n axis,\n this.visualElement.latestValues[axis] ?? 0\n )\n }\n\n private snapToCursor(point: Point) {\n eachAxis((axis) => {\n const { drag } = this.getProps()\n\n // If we're not dragging this axis, do an early return.\n if (!shouldDrag(axis, drag, this.currentDirection)) return\n\n const { projection } = this.visualElement\n const axisValue = this.getAxisMotionValue(axis)\n\n if (projection && projection.layout) {\n const { min, max } = projection.layout.layoutBox[axis]\n\n /**\n * The layout measurement includes the current transform value,\n * so we need to add it back to get the correct snap position.\n * This fixes an issue where elements with initial coordinates\n * would snap to the wrong position on the first drag.\n */\n const current = axisValue.get() || 0\n\n axisValue.set(point[axis] - mixNumber(min, max, 0.5) + current)\n }\n })\n }\n\n /**\n * When the viewport resizes we want to check if the measured constraints\n * have changed and, if so, reposition the element within those new constraints\n * relative to where it was before the resize.\n */\n scalePositionWithinConstraints() {\n if (!this.visualElement.current) return\n\n const { drag, dragConstraints } = this.getProps()\n const { projection } = this.visualElement\n if (!isRefObject(dragConstraints) || !projection || !this.constraints)\n return\n\n /**\n * Stop current animations as there can be visual glitching if we try to do\n * this mid-animation\n */\n this.stopAnimation()\n\n /**\n * Record the relative position of the dragged element relative to the\n * constraints box and save as a progress value.\n */\n const boxProgress = { x: 0, y: 0 }\n eachAxis((axis) => {\n const axisValue = this.getAxisMotionValue(axis)\n if (axisValue && this.constraints !== false) {\n const latest = axisValue.get()\n boxProgress[axis] = calcOrigin(\n { min: latest, max: latest },\n this.constraints[axis] as Axis\n )\n }\n })\n\n /**\n * Update the layout of this element and resolve the latest drag constraints\n */\n const { transformTemplate } = this.visualElement.getProps()\n this.visualElement.current.style.transform = transformTemplate\n ? transformTemplate({}, \"\")\n : \"none\"\n projection.root && projection.root.updateScroll()\n projection.updateLayout()\n\n /**\n * Reset constraints so resolveConstraints() will recalculate them\n * with the freshly measured layout rather than returning the cached value.\n */\n this.constraints = false\n this.resolveConstraints()\n\n /**\n * For each axis, calculate the current progress of the layout axis\n * within the new constraints.\n */\n eachAxis((axis) => {\n if (!shouldDrag(axis, drag, null)) return\n\n /**\n * Calculate a new transform based on the previous box progress\n */\n const axisValue = this.getAxisMotionValue(axis)\n const { min, max } = (this.constraints as ResolvedConstraints)[\n axis\n ] as Axis\n axisValue.set(mixNumber(min, max, boxProgress[axis]))\n })\n\n /**\n * Flush the updated transform to the DOM synchronously to prevent\n * a visual flash at the element's CSS layout position (0,0) when\n * the transform was stripped for measurement.\n */\n this.visualElement.render()\n }\n\n addListeners() {\n if (!this.visualElement.current) return\n elementDragControls.set(this.visualElement, this)\n const element = this.visualElement.current\n\n /**\n * Attach a pointerdown event listener on this DOM element to initiate drag tracking.\n */\n const stopPointerListener = addPointerEvent(\n element,\n \"pointerdown\",\n (event) => {\n const { drag, dragListener = true } = this.getProps()\n const target = event.target as Element\n\n /**\n * Only block drag if clicking on a text input child element\n * (input, textarea, select, contenteditable) where users might\n * want to select text or interact with the control.\n *\n * Buttons and links don't block drag since they don't have\n * click-and-move actions of their own.\n */\n const isClickingTextInputChild =\n target !== element && isElementTextInput(target)\n\n if (drag && dragListener && !isClickingTextInputChild) {\n this.start(event)\n }\n }\n )\n\n /**\n * If using ref-based constraints, observe both the draggable element\n * and the constraint container for size changes via ResizeObserver.\n * Setup is deferred because dragConstraints.current is null when\n * addListeners first runs (React hasn't committed the ref yet).\n */\n let stopResizeObservers: VoidFunction | undefined\n\n const measureDragConstraints = () => {\n const { dragConstraints } = this.getProps()\n if (isRefObject(dragConstraints) && dragConstraints.current) {\n this.constraints = this.resolveRefConstraints()\n\n if (!stopResizeObservers) {\n stopResizeObservers = startResizeObservers(\n element,\n dragConstraints.current as HTMLElement,\n () => this.scalePositionWithinConstraints()\n )\n }\n }\n }\n\n const { projection } = this.visualElement\n\n const stopMeasureLayoutListener = projection!.addEventListener(\n \"measure\",\n measureDragConstraints\n )\n\n if (projection && !projection!.layout) {\n projection.root && projection.root.updateScroll()\n projection.updateLayout()\n }\n\n frame.read(measureDragConstraints)\n\n /**\n * Attach a window resize listener to scale the draggable target within its defined\n * constraints as the window resizes.\n */\n const stopResizeListener = addDomEvent(window, \"resize\", () =>\n this.scalePositionWithinConstraints()\n )\n\n /**\n * If the element's layout changes, calculate the delta and apply that to\n * the drag gesture's origin point.\n */\n const stopLayoutUpdateListener = projection!.addEventListener(\n \"didUpdate\",\n (({ delta, hasLayoutChanged }: LayoutUpdateData) => {\n if (this.isDragging && hasLayoutChanged) {\n eachAxis((axis) => {\n const motionValue = this.getAxisMotionValue(axis)\n if (!motionValue) return\n\n this.originPoint[axis] += delta[axis].translate\n motionValue.set(\n motionValue.get() + delta[axis].translate\n )\n })\n\n this.visualElement.render()\n }\n }) as any\n )\n\n return () => {\n stopResizeListener()\n stopPointerListener()\n stopMeasureLayoutListener()\n stopLayoutUpdateListener && stopLayoutUpdateListener()\n stopResizeObservers && stopResizeObservers()\n }\n }\n\n getProps(): MotionProps {\n const props = this.visualElement.getProps()\n const {\n drag = false,\n dragDirectionLock = false,\n dragPropagation = false,\n dragConstraints = false,\n dragElastic = defaultElastic,\n dragMomentum = true,\n } = props\n return {\n ...props,\n drag,\n dragDirectionLock,\n dragPropagation,\n dragConstraints,\n dragElastic,\n dragMomentum,\n }\n }\n}\n\nfunction skipFirstCall(callback: VoidFunction): VoidFunction {\n let isFirst = true\n return () => {\n if (isFirst) {\n isFirst = false\n return\n }\n callback()\n }\n}\n\nfunction startResizeObservers(\n element: HTMLElement,\n constraintsElement: HTMLElement,\n onResize: VoidFunction\n): VoidFunction {\n const stopElement = resize(element, skipFirstCall(onResize))\n const stopContainer = resize(constraintsElement, skipFirstCall(onResize))\n return () => {\n stopElement()\n stopContainer()\n }\n}\n\nfunction shouldDrag(\n direction: DragDirection,\n drag: boolean | DragDirection | undefined,\n currentDirection: null | DragDirection\n) {\n return (\n (drag === true || drag === direction) &&\n (currentDirection === null || currentDirection === direction)\n )\n}\n\n/**\n * Based on an x/y offset determine the current drag direction. If both axis' offsets are lower\n * than the provided threshold, return `null`.\n *\n * @param offset - The x/y offset from origin.\n * @param lockThreshold - (Optional) - the minimum absolute offset before we can determine a drag direction.\n */\nfunction getCurrentDirection(\n offset: Point,\n lockThreshold = 10\n): DragDirection | null {\n let direction: DragDirection | null = null\n\n if (Math.abs(offset.y) > lockThreshold) {\n direction = \"y\"\n } else if (Math.abs(offset.x) > lockThreshold) {\n direction = \"x\"\n }\n\n return direction\n}\n\nexport function expectsResolvedDragConstraints({\n dragConstraints,\n onMeasureDragConstraints,\n}: MotionProps) {\n return isRefObject(dragConstraints) && !!onMeasureDragConstraints\n}\n","import { Feature, type VisualElement } from \"motion-dom\"\nimport { noop } from \"motion-utils\"\nimport { VisualElementDragControls } from \"./VisualElementDragControls\"\n\nexport class DragGesture extends Feature {\n controls: VisualElementDragControls\n\n removeGroupControls: Function = noop\n removeListeners: Function = noop\n\n constructor(node: VisualElement) {\n super(node)\n this.controls = new VisualElementDragControls(node)\n }\n\n mount() {\n // If we've been provided a DragControls for manual control over the drag gesture,\n // subscribe this component to it on mount.\n const { dragControls } = this.node.getProps()\n\n if (dragControls) {\n this.removeGroupControls = dragControls.subscribe(this.controls)\n }\n\n this.removeListeners = this.controls.addListeners() || noop\n }\n\n update() {\n const { dragControls } = this.node.getProps()\n const { dragControls: prevDragControls } = this.node.prevProps || {}\n\n if (dragControls !== prevDragControls) {\n this.removeGroupControls()\n if (dragControls) {\n this.removeGroupControls = dragControls.subscribe(this.controls)\n }\n }\n }\n\n unmount() {\n this.removeGroupControls()\n this.removeListeners()\n /**\n * In React 19, during list reorder reconciliation, components may\n * briefly unmount and remount while the drag is still active. If we're\n * actively dragging, we should NOT end the pan session - it will\n * continue tracking pointer events via its window-level listeners.\n *\n * The pan session will be properly cleaned up when:\n * 1. The drag ends naturally (pointerup/pointercancel)\n * 2. The component is truly removed from the DOM\n */\n if (!this.controls.isDragging) {\n this.controls.endPanSession()\n }\n }\n}\n","import { Feature, frame, type PanInfo } from \"motion-dom\"\nimport { noop } from \"motion-utils\"\nimport { addPointerEvent } from \"../../events/add-pointer-event\"\nimport { getContextWindow } from \"../../utils/get-context-window\"\nimport { PanSession } from \"./PanSession\"\n\ntype PanEventHandler = (event: PointerEvent, info: PanInfo) => void\nconst asyncHandler =\n (handler?: PanEventHandler) => (event: PointerEvent, info: PanInfo) => {\n if (handler) {\n frame.update(() => handler(event, info), false, true)\n }\n }\n\nexport class PanGesture extends Feature {\n private session?: PanSession\n\n private removePointerDownListener: Function = noop\n\n onPointerDown(pointerDownEvent: PointerEvent) {\n this.session = new PanSession(\n pointerDownEvent,\n this.createPanHandlers(),\n {\n transformPagePoint: this.node.getTransformPagePoint(),\n contextWindow: getContextWindow(this.node),\n }\n )\n }\n\n createPanHandlers() {\n const { onPanSessionStart, onPanStart, onPan, onPanEnd } =\n this.node.getProps()\n\n return {\n onSessionStart: asyncHandler(onPanSessionStart),\n onStart: asyncHandler(onPanStart),\n onMove: asyncHandler(onPan),\n onEnd: (event: PointerEvent, info: PanInfo) => {\n delete this.session\n if (onPanEnd) {\n frame.postRender(() => onPanEnd(event, info))\n }\n },\n }\n }\n\n mount() {\n this.removePointerDownListener = addPointerEvent(\n this.node.current!,\n \"pointerdown\",\n (event: PointerEvent) => this.onPointerDown(event)\n )\n }\n\n update() {\n this.session && this.session.updateHandlers(this.createPanHandlers())\n }\n\n unmount() {\n this.removePointerDownListener()\n this.session && this.session.end()\n }\n}\n","\"use client\"\n\nimport { frame, microtask, globalProjectionState, type VisualElement } from \"motion-dom\"\nimport { Component, useContext } from \"react\"\nimport { usePresence } from \"../../../components/AnimatePresence/use-presence\"\nimport {\n LayoutGroupContext,\n LayoutGroupContextProps,\n} from \"../../../context/LayoutGroupContext\"\nimport { SwitchLayoutGroupContext } from \"../../../context/SwitchLayoutGroupContext\"\nimport { MotionProps } from \"../../types\"\n\ninterface MeasureContextProps {\n layoutGroup: LayoutGroupContextProps\n switchLayoutGroup?: SwitchLayoutGroupContext\n isPresent: boolean\n safeToRemove?: VoidFunction | null\n}\n\ntype MeasureProps = MotionProps &\n MeasureContextProps & { visualElement: VisualElement }\n\n/**\n * Track whether we've taken any snapshots yet. If not,\n * we can safely skip notification of didUpdate.\n *\n * Difficult to capture in a test but to prevent flickering\n * we must set this to true either on update or unmount.\n * Running `next-env/layout-id` in Safari will show this behaviour if broken.\n */\nlet hasTakenAnySnapshot = false\n\nclass MeasureLayoutWithContext extends Component {\n /**\n * This only mounts projection nodes for components that\n * need measuring, we might want to do it for all components\n * in order to incorporate transforms\n */\n componentDidMount() {\n const { visualElement, layoutGroup, switchLayoutGroup, layoutId } =\n this.props\n const { projection } = visualElement\n\n if (projection) {\n if (layoutGroup.group) layoutGroup.group.add(projection)\n\n if (switchLayoutGroup && switchLayoutGroup.register && layoutId) {\n switchLayoutGroup.register(projection)\n }\n\n if (hasTakenAnySnapshot) {\n projection.root!.didUpdate()\n }\n\n projection.addEventListener(\"animationComplete\", () => {\n this.safeToRemove()\n })\n projection.setOptions({\n ...projection.options,\n layoutDependency: this.props.layoutDependency,\n onExitComplete: () => this.safeToRemove(),\n })\n }\n\n globalProjectionState.hasEverUpdated = true\n }\n\n getSnapshotBeforeUpdate(prevProps: MeasureProps) {\n const { layoutDependency, visualElement, drag, isPresent } = this.props\n const { projection } = visualElement\n\n if (!projection) return null\n\n /**\n * TODO: We use this data in relegate to determine whether to\n * promote a previous element. There's no guarantee its presence data\n * will have updated by this point - if a bug like this arises it will\n * have to be that we markForRelegation and then find a new lead some other way,\n * perhaps in didUpdate\n */\n projection.isPresent = isPresent\n\n if (prevProps.layoutDependency !== layoutDependency) {\n projection.setOptions({\n ...projection.options,\n layoutDependency,\n })\n }\n\n hasTakenAnySnapshot = true\n\n if (\n drag ||\n prevProps.layoutDependency !== layoutDependency ||\n layoutDependency === undefined ||\n prevProps.isPresent !== isPresent\n ) {\n projection.willUpdate()\n } else {\n this.safeToRemove()\n }\n\n if (prevProps.isPresent !== isPresent) {\n if (isPresent) {\n projection.promote()\n } else if (!projection.relegate()) {\n /**\n * If there's another stack member taking over from this one,\n * it's in charge of the exit animation and therefore should\n * be in charge of the safe to remove. Otherwise we call it here.\n */\n frame.postRender(() => {\n const stack = projection.getStack()\n if (!stack || !stack.members.length) {\n this.safeToRemove()\n }\n })\n }\n }\n\n return null\n }\n\n componentDidUpdate() {\n const { visualElement, layoutAnchor } = this.props\n const { projection } = visualElement\n if (projection) {\n projection.options.layoutAnchor = layoutAnchor\n\n projection.root!.didUpdate()\n\n microtask.postRender(() => {\n if (!projection.currentAnimation && projection.isLead()) {\n this.safeToRemove()\n }\n })\n }\n }\n\n componentWillUnmount() {\n const {\n visualElement,\n layoutGroup,\n switchLayoutGroup: promoteContext,\n } = this.props\n const { projection } = visualElement\n\n hasTakenAnySnapshot = true\n\n if (projection) {\n projection.scheduleCheckAfterUnmount()\n if (layoutGroup && layoutGroup.group)\n layoutGroup.group.remove(projection)\n if (promoteContext && promoteContext.deregister)\n promoteContext.deregister(projection)\n }\n }\n\n safeToRemove() {\n const { safeToRemove } = this.props\n safeToRemove && safeToRemove()\n }\n\n render() {\n return null\n }\n}\n\nexport function MeasureLayout(\n props: MotionProps & { visualElement: VisualElement }\n) {\n const [isPresent, safeToRemove] = usePresence()\n const layoutGroup = useContext(LayoutGroupContext)\n\n return (\n \n )\n}\n","import { DragGesture } from \"../../gestures/drag\"\nimport { PanGesture } from \"../../gestures/pan\"\nimport { HTMLProjectionNode } from \"../../projection\"\nimport { MeasureLayout } from \"./layout/MeasureLayout\"\nimport { FeaturePackages } from \"./types\"\n\nexport const drag: FeaturePackages = {\n pan: {\n Feature: PanGesture,\n },\n drag: {\n Feature: DragGesture,\n ProjectionNode: HTMLProjectionNode,\n MeasureLayout,\n },\n}\n","import { Feature, frame, hover, type VisualElement } from \"motion-dom\"\nimport { extractEventInfo } from \"../events/event-info\"\n\nfunction handleHoverEvent(\n node: VisualElement,\n event: PointerEvent,\n lifecycle: \"Start\" | \"End\"\n) {\n const { props } = node\n\n if (node.animationState && props.whileHover) {\n node.animationState.setActive(\"whileHover\", lifecycle === \"Start\")\n }\n\n const eventName = (\"onHover\" + lifecycle) as \"onHoverStart\" | \"onHoverEnd\"\n const callback = props[eventName]\n if (callback) {\n frame.postRender(() => callback(event, extractEventInfo(event)))\n }\n}\n\nexport class HoverGesture extends Feature {\n mount() {\n const { current } = this.node\n if (!current) return\n\n this.unmount = hover(current, (_element, startEvent) => {\n handleHoverEvent(this.node, startEvent, \"Start\")\n\n return (endEvent) => handleHoverEvent(this.node, endEvent, \"End\")\n })\n }\n\n unmount() {}\n}\n","import { Feature, addDomEvent } from \"motion-dom\"\nimport { pipe } from \"motion-utils\"\n\nexport class FocusGesture extends Feature {\n private isActive = false\n\n onFocus() {\n let isFocusVisible = false\n\n /**\n * If this element doesn't match focus-visible then don't\n * apply whileHover. But, if matches throws that focus-visible\n * is not a valid selector then in that browser outline styles will be applied\n * to the element by default and we want to match that behaviour with whileFocus.\n */\n try {\n isFocusVisible = this.node.current!.matches(\":focus-visible\")\n } catch (e) {\n isFocusVisible = true\n }\n\n if (!isFocusVisible || !this.node.animationState) return\n\n this.node.animationState.setActive(\"whileFocus\", true)\n this.isActive = true\n }\n\n onBlur() {\n if (!this.isActive || !this.node.animationState) return\n this.node.animationState.setActive(\"whileFocus\", false)\n this.isActive = false\n }\n\n mount() {\n this.unmount = pipe(\n addDomEvent(this.node.current!, \"focus\", () => this.onFocus()),\n addDomEvent(this.node.current!, \"blur\", () => this.onBlur())\n ) as VoidFunction\n }\n\n unmount() {}\n}\n","import { Feature, frame, press, type VisualElement } from \"motion-dom\"\nimport { extractEventInfo } from \"../events/event-info\"\n\nfunction handlePressEvent(\n node: VisualElement,\n event: PointerEvent,\n lifecycle: \"Start\" | \"End\" | \"Cancel\"\n) {\n const { props } = node\n\n if (node.current instanceof HTMLButtonElement && node.current.disabled) {\n return\n }\n\n if (node.animationState && props.whileTap) {\n node.animationState.setActive(\"whileTap\", lifecycle === \"Start\")\n }\n\n const eventName = (\"onTap\" + (lifecycle === \"End\" ? \"\" : lifecycle)) as\n | \"onTapStart\"\n | \"onTap\"\n | \"onTapCancel\"\n\n const callback = props[eventName]\n if (callback) {\n frame.postRender(() => callback(event, extractEventInfo(event)))\n }\n}\n\nexport class PressGesture extends Feature {\n mount() {\n const { current } = this.node\n if (!current) return\n\n const { globalTapTarget, propagate } = this.node.props\n\n this.unmount = press(\n current,\n (_element, startEvent) => {\n handlePressEvent(this.node, startEvent, \"Start\")\n\n return (endEvent, { success }) =>\n handlePressEvent(\n this.node,\n endEvent,\n success ? \"End\" : \"Cancel\"\n )\n },\n {\n useGlobalTarget: globalTapTarget,\n stopPropagation: propagate?.tap === false,\n }\n )\n }\n\n unmount() {}\n}\n","type IntersectionHandler = (entry: IntersectionObserverEntry) => void\n\ninterface ElementIntersectionObservers {\n [key: string]: IntersectionObserver\n}\n\n/**\n * Map an IntersectionHandler callback to an element. We only ever make one handler for one\n * element, so even though these handlers might all be triggered by different\n * observers, we can keep them in the same map.\n */\nconst observerCallbacks = new WeakMap()\n\n/**\n * Multiple observers can be created for multiple element/document roots. Each with\n * different settings. So here we store dictionaries of observers to each root,\n * using serialised settings (threshold/margin) as lookup keys.\n */\nconst observers = new WeakMap<\n Element | Document,\n ElementIntersectionObservers\n>()\n\nconst fireObserverCallback = (entry: IntersectionObserverEntry) => {\n const callback = observerCallbacks.get(entry.target)\n callback && callback(entry)\n}\n\nconst fireAllObserverCallbacks: IntersectionObserverCallback = (entries) => {\n entries.forEach(fireObserverCallback)\n}\n\nfunction initIntersectionObserver({\n root,\n ...options\n}: IntersectionObserverInit): IntersectionObserver {\n const lookupRoot = root || document\n\n /**\n * If we don't have an observer lookup map for this root, create one.\n */\n if (!observers.has(lookupRoot)) {\n observers.set(lookupRoot, {})\n }\n const rootObservers = observers.get(lookupRoot)!\n\n const key = JSON.stringify(options)\n\n /**\n * If we don't have an observer for this combination of root and settings,\n * create one.\n */\n if (!rootObservers[key]) {\n rootObservers[key] = new IntersectionObserver(\n fireAllObserverCallbacks,\n { root, ...options }\n )\n }\n\n return rootObservers[key]\n}\n\nexport function observeIntersection(\n element: Element,\n options: IntersectionObserverInit,\n callback: IntersectionHandler\n) {\n const rootInteresectionObserver = initIntersectionObserver(options)\n\n observerCallbacks.set(element, callback)\n rootInteresectionObserver.observe(element)\n\n return () => {\n observerCallbacks.delete(element)\n rootInteresectionObserver.unobserve(element)\n }\n}\n","import { Feature } from \"motion-dom\"\nimport { MotionProps } from \"../../types\"\nimport { observeIntersection } from \"./observers\"\n\nconst thresholdNames = {\n some: 0,\n all: 1,\n}\n\nexport class InViewFeature extends Feature {\n private hasEnteredView = false\n\n private isInView = false\n\n private stopObserver?: () => void\n\n private startObserver() {\n this.stopObserver?.()\n\n const { viewport = {} } = this.node.getProps()\n const { root, margin: rootMargin, amount = \"some\", once } = viewport\n\n const options = {\n root: root ? root.current : undefined,\n rootMargin,\n threshold:\n typeof amount === \"number\" ? amount : thresholdNames[amount],\n }\n\n const onIntersectionUpdate = (entry: IntersectionObserverEntry) => {\n const { isIntersecting } = entry\n\n /**\n * If there's been no change in the viewport state, early return.\n */\n if (this.isInView === isIntersecting) return\n\n this.isInView = isIntersecting\n\n /**\n * Handle hasEnteredView. If this is only meant to run once, and\n * element isn't visible, early return. Otherwise set hasEnteredView to true.\n */\n if (once && !isIntersecting && this.hasEnteredView) {\n return\n } else if (isIntersecting) {\n this.hasEnteredView = true\n }\n\n if (this.node.animationState) {\n this.node.animationState.setActive(\n \"whileInView\",\n isIntersecting\n )\n }\n\n /**\n * Use the latest committed props rather than the ones in scope\n * when this observer is created\n */\n const { onViewportEnter, onViewportLeave } = this.node.getProps()\n const callback = isIntersecting ? onViewportEnter : onViewportLeave\n callback && callback(entry)\n }\n\n this.stopObserver = observeIntersection(\n this.node.current!,\n options,\n onIntersectionUpdate\n )\n }\n\n mount() {\n this.startObserver()\n }\n\n update() {\n if (typeof IntersectionObserver === \"undefined\") return\n\n const { props, prevProps } = this.node\n const hasOptionsChanged = [\"amount\", \"margin\", \"root\"].some(\n hasViewportOptionChanged(props, prevProps)\n )\n\n if (hasOptionsChanged) {\n this.startObserver()\n }\n }\n\n unmount() {\n this.stopObserver?.()\n this.hasEnteredView = false\n this.isInView = false\n }\n}\n\nfunction hasViewportOptionChanged(\n { viewport = {} }: MotionProps,\n { viewport: prevViewport = {} }: MotionProps = {}\n) {\n return (name: keyof typeof viewport) =>\n viewport[name] !== prevViewport[name]\n}\n","import { HoverGesture } from \"../../gestures/hover\"\nimport { FocusGesture } from \"../../gestures/focus\"\nimport { PressGesture } from \"../../gestures/press\"\nimport { InViewFeature } from \"./viewport\"\nimport { FeaturePackages } from \"./types\"\n\nexport const gestureAnimations: FeaturePackages = {\n inView: {\n Feature: InViewFeature,\n },\n tap: {\n Feature: PressGesture,\n },\n focus: {\n Feature: FocusGesture,\n },\n hover: {\n Feature: HoverGesture,\n },\n}\n","import { HTMLProjectionNode } from \"motion-dom\"\nimport { MeasureLayout } from \"./layout/MeasureLayout\"\nimport { FeaturePackages } from \"./types\"\n\nexport const layout: FeaturePackages = {\n layout: {\n ProjectionNode: HTMLProjectionNode,\n MeasureLayout,\n },\n}\n","import { animations } from \"../../../motion/features/animations\"\nimport { drag } from \"../../../motion/features/drag\"\nimport { gestureAnimations } from \"../../../motion/features/gestures\"\nimport { layout } from \"../../../motion/features/layout\"\n\nexport const featureBundle = {\n ...animations,\n ...gestureAnimations,\n ...drag,\n ...layout,\n}\n"],"names":["useContext","PresenceContext","useId","useEffect","useCallback","isSVGComponent","SVGVisualElement","HTMLVisualElement","Fragment","Feature","createAnimationState","isAnimationControls","resolveVariant","isPrimaryPointer","addDomEvent","frameData","frame","pipe","cancelFrame","secondsToMilliseconds","millisecondsToSeconds","mixNumber","calcLength","calcProgress","clamp","createBox","setDragLock","eachAxis","percent","addValueToWillChange","isRefObject","invariant","measurePageBox","convertBoxToBoundingBox","convertBoundingBoxToBox","animateMotionValue","isElementTextInput","resize","noop","Component","globalProjectionState","microtask","LayoutGroupContext","_jsx","SwitchLayoutGroupContext","HTMLProjectionNode","hover","press"],"mappings":";;;;;;;;AAgBA;;;;;;;;;;;;;;;;;;;;;;AAsBG;AACG,SAAU,WAAW,CACvB,SAAA,GAAqB,IAAI,EAAA;AAEzB,IAAA,MAAM,OAAO,GAAGA,gBAAU,CAACC,qBAAe,CAAC;IAE3C,IAAI,OAAO,KAAK,IAAI;AAAE,QAAA,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC;IAEzC,MAAM,EAAE,SAAS,EAAE,cAAc,EAAE,QAAQ,EAAE,GAAG,OAAO;;;AAKvD,IAAA,MAAM,EAAE,GAAGC,WAAK,EAAE;IAClBC,eAAS,CAAC,MAAK;QACX,IAAI,SAAS,EAAE;AACX,YAAA,OAAO,QAAQ,CAAC,EAAE,CAAC;QACvB;AACJ,IAAA,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC;IAEf,MAAM,YAAY,GAAGC,iBAAW,CAC5B,MAAM,SAAS,IAAI,cAAc,IAAI,cAAc,CAAC,EAAE,CAAC,EACvD,CAAC,EAAE,EAAE,cAAc,EAAE,SAAS,CAAC,CAClC;AAED,IAAA,OAAO,CAAC,SAAS,IAAI,cAAc,GAAG,CAAC,KAAK,EAAE,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC;AACxE;AAEA;;;;;;;;;;;;;;;;;;;AAmBG;SACa,YAAY,GAAA;AACxB,IAAA,OAAO,SAAS,CAACJ,gBAAU,CAACC,qBAAe,CAAC,CAAC;AACjD;AAEM,SAAU,SAAS,CAAC,OAAoC,EAAA;AAC1D,IAAA,OAAO,OAAO,KAAK,IAAI,GAAG,IAAI,GAAG,OAAO,CAAC,SAAS;AACtD;;MCvFa,sBAAsB,GAAwB,CACvD,SA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,IAAI,CAAC,YAAY,IAAI;AACrB,QAAA,IAAI,CAAC,cAAc,GAAG,KAAK;AAC3B,QAAA,IAAI,CAAC,QAAQ,GAAG,KAAK;IACzB;AACH;AAED,SAAS,wBAAwB,CAC7B,EAAE,QAAQ,GAAG,EAAE,EAAe,EAC9B,EAAE,QAAQ,EAAE,YAAY,GAAG,EAAE,KAAkB,EAAE,EAAA;AAEjD,IAAA,OAAO,CAAC,IAA2B,KAC/B,QAAQ,CAAC,IAAI,CAAC,KAAK,YAAY,CAAC,IAAI,CAAC;AAC7C;;AChGO,MAAM,iBAAiB,GAAoB;AAC9C,IAAA,MAAM,EAAE;AACJ,QAAA,OAAO,EAAE,aAAa;AACzB,KAAA;AACD,IAAA,GAAG,EAAE;AACD,QAAA,OAAO,EAAE,YAAY;AACxB,KAAA;AACD,IAAA,KAAK,EAAE;AACH,QAAA,OAAO,EAAE,YAAY;AACxB,KAAA;AACD,IAAA,KAAK,EAAE;AACH,QAAA,OAAO,EAAE,YAAY;AACxB,KAAA;;;ACdE,MAAM,MAAM,GAAoB;AACnC,IAAA,MAAM,EAAE;AACJ,QAAA,cAAc,EAAEoC,4BAAkB;QAClC,aAAa;AAChB,KAAA;;;ACHE,MAAM,aAAa,GAAG;AACzB,IAAA,GAAG,UAAU;AACb,IAAA,GAAG,iBAAiB;AACpB,IAAA,GAAG,IAAI;AACP,IAAA,GAAG,MAAM;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/cjs/index-BuO47Yrm.js b/node_modules/framer-motion/dist/cjs/index-BuO47Yrm.js deleted file mode 100644 index eeaf633..0000000 --- a/node_modules/framer-motion/dist/cjs/index-BuO47Yrm.js +++ /dev/null @@ -1,771 +0,0 @@ -'use strict'; - -var jsxRuntime = require('react/jsx-runtime'); -var motionUtils = require('motion-utils'); -var React = require('react'); -var motionDom = require('motion-dom'); - -const LayoutGroupContext = React.createContext({}); - -/** - * Creates a constant value over the lifecycle of a component. - * - * Even if `useMemo` is provided an empty array as its final argument, it doesn't offer - * a guarantee that it won't re-run for performance reasons later on. By using `useConstant` - * you can ensure that initialisers don't execute twice or more. - */ -function useConstant(init) { - const ref = React.useRef(null); - if (ref.current === null) { - ref.current = init(); - } - return ref.current; -} - -const isBrowser = typeof window !== "undefined"; - -const useIsomorphicLayoutEffect = isBrowser ? React.useLayoutEffect : React.useEffect; - -/** - * @public - */ -const PresenceContext = -/* @__PURE__ */ React.createContext(null); - -/** - * @public - */ -const MotionConfigContext = React.createContext({ - transformPagePoint: (p) => p, - isStatic: false, - reducedMotion: "never", -}); - -const LazyContext = React.createContext({ strict: false }); - -const featureProps = { - animation: [ - "animate", - "variants", - "whileHover", - "whileTap", - "exit", - "whileInView", - "whileFocus", - "whileDrag", - ], - exit: ["exit"], - drag: ["drag", "dragControls"], - focus: ["whileFocus"], - hover: ["whileHover", "onHoverStart", "onHoverEnd"], - tap: ["whileTap", "onTap", "onTapStart", "onTapCancel"], - pan: ["onPan", "onPanStart", "onPanSessionStart", "onPanEnd"], - inView: ["whileInView", "onViewportEnter", "onViewportLeave"], - layout: ["layout", "layoutId"], -}; -let isInitialized = false; -/** - * Initialize feature definitions with isEnabled checks. - * This must be called before any motion components are rendered. - */ -function initFeatureDefinitions() { - if (isInitialized) - return; - const initialFeatureDefinitions = {}; - for (const key in featureProps) { - initialFeatureDefinitions[key] = { - isEnabled: (props) => featureProps[key].some((name) => !!props[name]), - }; - } - motionDom.setFeatureDefinitions(initialFeatureDefinitions); - isInitialized = true; -} -/** - * Get the current feature definitions, initializing if needed. - */ -function getInitializedFeatureDefinitions() { - initFeatureDefinitions(); - return motionDom.getFeatureDefinitions(); -} - -function loadFeatures(features) { - const featureDefinitions = getInitializedFeatureDefinitions(); - for (const key in features) { - featureDefinitions[key] = { - ...featureDefinitions[key], - ...features[key], - }; - } - motionDom.setFeatureDefinitions(featureDefinitions); -} - -/** - * We keep these listed separately as we use the lowercase tag names as part - * of the runtime bundle to detect SVG components - */ -const lowercaseSVGElements = [ - "animate", - "circle", - "defs", - "desc", - "ellipse", - "g", - "image", - "line", - "filter", - "marker", - "mask", - "metadata", - "path", - "pattern", - "polygon", - "polyline", - "rect", - "stop", - "switch", - "symbol", - "svg", - "text", - "tspan", - "use", - "view", -]; - -function isSVGComponent(Component) { - if ( - /** - * If it's not a string, it's a custom React component. Currently we only support - * HTML custom React components. - */ - typeof Component !== "string" || - /** - * If it contains a dash, the element is a custom HTML webcomponent. - */ - Component.includes("-")) { - return false; - } - else if ( - /** - * If it's in our list of lowercase SVG tags, it's an SVG component - */ - lowercaseSVGElements.indexOf(Component) > -1 || - /** - * If it contains a capital letter, it's an SVG component - */ - /[A-Z]/u.test(Component)) { - return true; - } - return false; -} - -const MotionContext = /* @__PURE__ */ React.createContext({}); - -function getCurrentTreeVariants(props, context) { - if (motionDom.isControllingVariants(props)) { - const { initial, animate } = props; - return { - initial: initial === false || motionDom.isVariantLabel(initial) - ? initial - : undefined, - animate: motionDom.isVariantLabel(animate) ? animate : undefined, - }; - } - return props.inherit !== false ? context : {}; -} - -function useCreateMotionContext(props) { - const { initial, animate } = getCurrentTreeVariants(props, React.useContext(MotionContext)); - return React.useMemo(() => ({ initial, animate }), [variantLabelsAsDependency(initial), variantLabelsAsDependency(animate)]); -} -function variantLabelsAsDependency(prop) { - return Array.isArray(prop) ? prop.join(" ") : prop; -} - -const createHtmlRenderState = () => ({ - style: {}, - transform: {}, - transformOrigin: {}, - vars: {}, -}); - -function copyRawValuesOnly(target, source, props) { - for (const key in source) { - if (!motionDom.isMotionValue(source[key]) && !motionDom.isForcedMotionValue(key, props)) { - target[key] = source[key]; - } - } -} -function useInitialMotionValues({ transformTemplate }, visualState) { - return React.useMemo(() => { - const state = createHtmlRenderState(); - motionDom.buildHTMLStyles(state, visualState, transformTemplate); - return Object.assign({}, state.vars, state.style); - }, [visualState]); -} -function useStyle(props, visualState) { - const styleProp = props.style || {}; - const style = {}; - /** - * Copy non-Motion Values straight into style - */ - copyRawValuesOnly(style, styleProp, props); - Object.assign(style, useInitialMotionValues(props, visualState)); - return style; -} -function useHTMLProps(props, visualState) { - // The `any` isn't ideal but it is the type of createElement props argument - const htmlProps = {}; - const style = useStyle(props, visualState); - if (props.drag && props.dragListener !== false) { - // Disable the ghost element when a user drags - htmlProps.draggable = false; - // Disable text selection - style.userSelect = - style.WebkitUserSelect = - style.WebkitTouchCallout = - "none"; - // Disable scrolling on the draggable direction - style.touchAction = - props.drag === true - ? "none" - : `pan-${props.drag === "x" ? "y" : "x"}`; - } - if (props.tabIndex === undefined && - (props.onTap || props.onTapStart || props.whileTap)) { - htmlProps.tabIndex = 0; - } - htmlProps.style = style; - return htmlProps; -} - -const createSvgRenderState = () => ({ - ...createHtmlRenderState(), - attrs: {}, -}); - -function useSVGProps(props, visualState, _isStatic, Component) { - const visualProps = React.useMemo(() => { - const state = createSvgRenderState(); - motionDom.buildSVGAttrs(state, visualState, motionDom.isSVGTag(Component), props.transformTemplate, props.style); - return { - ...state.attrs, - style: { ...state.style }, - }; - }, [visualState]); - if (props.style) { - const rawStyles = {}; - copyRawValuesOnly(rawStyles, props.style, props); - visualProps.style = { ...rawStyles, ...visualProps.style }; - } - return visualProps; -} - -/** - * A list of all valid MotionProps. - * - * @privateRemarks - * This doesn't throw if a `MotionProp` name is missing - it should. - */ -const validMotionProps = new Set([ - "animate", - "exit", - "variants", - "initial", - "style", - "values", - "variants", - "transition", - "transformTemplate", - "custom", - "inherit", - "onBeforeLayoutMeasure", - "onAnimationStart", - "onAnimationComplete", - "onUpdate", - "onDragStart", - "onDrag", - "onDragEnd", - "onMeasureDragConstraints", - "onDirectionLock", - "onDragTransitionEnd", - "_dragX", - "_dragY", - "onHoverStart", - "onHoverEnd", - "onViewportEnter", - "onViewportLeave", - "globalTapTarget", - "propagate", - "ignoreStrict", - "viewport", -]); -/** - * Check whether a prop name is a valid `MotionProp` key. - * - * @param key - Name of the property to check - * @returns `true` is key is a valid `MotionProp`. - * - * @public - */ -function isValidMotionProp(key) { - return (key.startsWith("while") || - (key.startsWith("drag") && key !== "draggable") || - key.startsWith("layout") || - key.startsWith("onTap") || - key.startsWith("onPan") || - key.startsWith("onLayout") || - validMotionProps.has(key)); -} - -function shouldForward(key, isValidProp) { - return key.startsWith("on") - ? !isValidMotionProp(key) - : isValidProp?.(key) ?? !isValidMotionProp(key); -} -function filterProps(props, isDom, forwardMotionProps, isValidProp) { - const filteredProps = {}; - for (const key in props) { - /** - * values is considered a valid prop by Emotion, so if it's present - * this will be rendered out to the DOM unless explicitly filtered. - * - * We check the type as it could be used with the `feColorMatrix` - * element, which we support. - */ - if (key === "values" && typeof props.values === "object") - continue; - if (motionDom.isMotionValue(props[key])) - continue; - if (shouldForward(key, isValidProp) || - (forwardMotionProps === true && isValidMotionProp(key)) || - (!isDom && !isValidMotionProp(key)) || - // If trying to use native HTML drag events, forward drag listeners - (props["draggable"] && - key.startsWith("onDrag"))) { - filteredProps[key] = - props[key]; - } - } - return filteredProps; -} - -function useRender(Component, props, ref, { latestValues, }, isStatic, forwardMotionProps = false, isSVG, isValidProp) { - const useVisualProps = (isSVG ?? isSVGComponent(Component)) ? useSVGProps : useHTMLProps; - const visualProps = useVisualProps(props, latestValues, isStatic, Component); - const filteredProps = filterProps(props, typeof Component === "string", forwardMotionProps, isValidProp); - const elementProps = Component !== React.Fragment ? { ...filteredProps, ...visualProps, ref } : {}; - /** - * If component has been handed a motion value as its child, - * memoise its initial value and render that. Subsequent updates - * will be handled by the onChange handler - */ - const { children } = props; - const renderedChildren = React.useMemo(() => (motionDom.isMotionValue(children) ? children.get() : children), [children]); - return React.createElement(Component, { - ...elementProps, - children: renderedChildren, - }); -} - -function makeState({ scrapeMotionValuesFromProps, createRenderState, }, props, context, presenceContext) { - const state = { - latestValues: makeLatestValues(props, context, presenceContext, scrapeMotionValuesFromProps), - renderState: createRenderState(), - }; - return state; -} -function makeLatestValues(props, context, presenceContext, scrapeMotionValues) { - const values = {}; - const motionValues = scrapeMotionValues(props, {}); - for (const key in motionValues) { - values[key] = motionDom.resolveMotionValue(motionValues[key]); - } - let { initial, animate } = props; - const isControllingVariants = motionDom.isControllingVariants(props); - const isVariantNode = motionDom.isVariantNode(props); - if (context && - isVariantNode && - !isControllingVariants && - props.inherit !== false) { - if (initial === undefined) - initial = context.initial; - if (animate === undefined) - animate = context.animate; - } - let isInitialAnimationBlocked = presenceContext - ? presenceContext.initial === false - : false; - isInitialAnimationBlocked = isInitialAnimationBlocked || initial === false; - const variantToSet = isInitialAnimationBlocked ? animate : initial; - if (variantToSet && - typeof variantToSet !== "boolean" && - !motionDom.isAnimationControls(variantToSet)) { - const list = Array.isArray(variantToSet) ? variantToSet : [variantToSet]; - for (let i = 0; i < list.length; i++) { - const resolved = motionDom.resolveVariantFromProps(props, list[i]); - if (resolved) { - const { transitionEnd, transition, ...target } = resolved; - for (const key in target) { - let valueTarget = target[key]; - if (Array.isArray(valueTarget)) { - /** - * Take final keyframe if the initial animation is blocked because - * we want to initialise at the end of that blocked animation. - */ - const index = isInitialAnimationBlocked - ? valueTarget.length - 1 - : 0; - valueTarget = valueTarget[index]; - } - if (valueTarget !== null) { - values[key] = valueTarget; - } - } - for (const key in transitionEnd) { - values[key] = transitionEnd[key]; - } - } - } - } - return values; -} -const makeUseVisualState = (config) => (props, isStatic) => { - const context = React.useContext(MotionContext); - const presenceContext = React.useContext(PresenceContext); - const make = () => makeState(config, props, context, presenceContext); - return isStatic ? make() : useConstant(make); -}; - -const useHTMLVisualState = /*@__PURE__*/ makeUseVisualState({ - scrapeMotionValuesFromProps: motionDom.scrapeHTMLMotionValuesFromProps, - createRenderState: createHtmlRenderState, -}); - -const useSVGVisualState = /*@__PURE__*/ makeUseVisualState({ - scrapeMotionValuesFromProps: motionDom.scrapeSVGMotionValuesFromProps, - createRenderState: createSvgRenderState, -}); - -const motionComponentSymbol = Symbol.for("motionComponentSymbol"); - -/** - * Creates a ref function that, when called, hydrates the provided - * external ref and VisualElement. - */ -function useMotionRef(visualState, visualElement, externalRef) { - /** - * Store externalRef in a ref to avoid including it in the useCallback - * dependency array. Including externalRef in dependencies causes issues - * with libraries like Radix UI that create new callback refs on each render - * when using asChild - this would cause the callback to be recreated, - * triggering element remounts and breaking AnimatePresence exit animations. - */ - const externalRefContainer = React.useRef(externalRef); - React.useInsertionEffect(() => { - externalRefContainer.current = externalRef; - }); - // Store cleanup function returned by callback refs (React 19 feature) - const refCleanup = React.useRef(null); - return React.useCallback((instance) => { - if (instance) { - visualState.onMount?.(instance); - } - if (visualElement) { - instance ? visualElement.mount(instance) : visualElement.unmount(); - } - const ref = externalRefContainer.current; - if (typeof ref === "function") { - if (instance) { - const cleanup = ref(instance); - if (typeof cleanup === "function") { - refCleanup.current = cleanup; - } - } - else if (refCleanup.current) { - refCleanup.current(); - refCleanup.current = null; - } - else { - ref(instance); - } - } - else if (ref) { - ref.current = instance; - } - }, [visualElement]); -} - -/** - * Internal, exported only for usage in Framer - */ -const SwitchLayoutGroupContext = React.createContext({}); - -function isRefObject(ref) { - return (ref && - typeof ref === "object" && - Object.prototype.hasOwnProperty.call(ref, "current")); -} - -function useVisualElement(Component, visualState, props, createVisualElement, ProjectionNodeConstructor, isSVG) { - const { visualElement: parent } = React.useContext(MotionContext); - const lazyContext = React.useContext(LazyContext); - const presenceContext = React.useContext(PresenceContext); - const motionConfig = React.useContext(MotionConfigContext); - const reducedMotionConfig = motionConfig.reducedMotion; - const skipAnimations = motionConfig.skipAnimations; - const visualElementRef = React.useRef(null); - /** - * Track whether the component has been through React's commit phase. - * Used to detect when LazyMotion features load after the component has mounted. - */ - const hasMountedOnce = React.useRef(false); - /** - * If we haven't preloaded a renderer, check to see if we have one lazy-loaded - */ - createVisualElement = - createVisualElement || - lazyContext.renderer; - if (!visualElementRef.current && createVisualElement) { - visualElementRef.current = createVisualElement(Component, { - visualState, - parent, - props, - presenceContext, - blockInitialAnimation: presenceContext - ? presenceContext.initial === false - : false, - reducedMotionConfig, - skipAnimations, - isSVG, - }); - /** - * If the component has already mounted before features loaded (e.g. via - * LazyMotion with async feature loading), we need to force the initial - * animation to run. Otherwise state changes that occurred before features - * loaded will be lost and the element will snap to its final state. - */ - if (hasMountedOnce.current && visualElementRef.current) { - visualElementRef.current.manuallyAnimateOnMount = true; - } - } - const visualElement = visualElementRef.current; - /** - * Load Motion gesture and animation features. These are rendered as renderless - * components so each feature can optionally make use of React lifecycle methods. - */ - const initialLayoutGroupConfig = React.useContext(SwitchLayoutGroupContext); - if (visualElement && - !visualElement.projection && - ProjectionNodeConstructor && - (visualElement.type === "html" || visualElement.type === "svg")) { - createProjectionNode(visualElementRef.current, props, ProjectionNodeConstructor, initialLayoutGroupConfig); - } - const isMounted = React.useRef(false); - React.useInsertionEffect(() => { - /** - * Check the component has already mounted before calling - * `update` unnecessarily. This ensures we skip the initial update. - */ - if (visualElement && isMounted.current) { - visualElement.update(props, presenceContext); - } - }); - /** - * Cache this value as we want to know whether HandoffAppearAnimations - * was present on initial render - it will be deleted after this. - */ - const optimisedAppearId = props[motionDom.optimizedAppearDataAttribute]; - const wantsHandoff = React.useRef(Boolean(optimisedAppearId) && - typeof window !== "undefined" && - !window.MotionHandoffIsComplete?.(optimisedAppearId) && - window.MotionHasOptimisedAnimation?.(optimisedAppearId)); - useIsomorphicLayoutEffect(() => { - /** - * Track that this component has mounted. This is used to detect when - * LazyMotion features load after the component has already committed. - */ - hasMountedOnce.current = true; - if (!visualElement) - return; - isMounted.current = true; - window.MotionIsMounted = true; - visualElement.updateFeatures(); - visualElement.scheduleRenderMicrotask(); - /** - * Ideally this function would always run in a useEffect. - * - * However, if we have optimised appear animations to handoff from, - * it needs to happen synchronously to ensure there's no flash of - * incorrect styles in the event of a hydration error. - * - * So if we detect a situtation where optimised appear animations - * are running, we use useLayoutEffect to trigger animations. - */ - if (wantsHandoff.current && visualElement.animationState) { - visualElement.animationState.animateChanges(); - } - }); - React.useEffect(() => { - if (!visualElement) - return; - if (!wantsHandoff.current && visualElement.animationState) { - visualElement.animationState.animateChanges(); - } - if (wantsHandoff.current) { - // This ensures all future calls to animateChanges() in this component will run in useEffect - queueMicrotask(() => { - window.MotionHandoffMarkAsComplete?.(optimisedAppearId); - }); - wantsHandoff.current = false; - } - /** - * Now we've finished triggering animations for this element we - * can wipe the enteringChildren set for the next render. - */ - visualElement.enteringChildren = undefined; - }); - return visualElement; -} -function createProjectionNode(visualElement, props, ProjectionNodeConstructor, initialPromotionConfig) { - const { layoutId, layout, drag, dragConstraints, layoutScroll, layoutRoot, layoutAnchor, layoutCrossfade, } = props; - visualElement.projection = new ProjectionNodeConstructor(visualElement.latestValues, props["data-framer-portal-id"] - ? undefined - : getClosestProjectingNode(visualElement.parent)); - visualElement.projection.setOptions({ - layoutId, - layout, - alwaysMeasureLayout: Boolean(drag) || (dragConstraints && isRefObject(dragConstraints)), - visualElement, - /** - * TODO: Update options in an effect. This could be tricky as it'll be too late - * to update by the time layout animations run. - * We also need to fix this safeToRemove by linking it up to the one returned by usePresence, - * ensuring it gets called if there's no potential layout animations. - * - */ - animationType: typeof layout === "string" ? layout : "both", - initialPromotionConfig, - crossfade: layoutCrossfade, - layoutScroll, - layoutRoot, - layoutAnchor, - }); -} -function getClosestProjectingNode(visualElement) { - if (!visualElement) - return undefined; - return visualElement.options.allowProjection !== false - ? visualElement.projection - : getClosestProjectingNode(visualElement.parent); -} - -/** - * Create a `motion` component. - * - * This function accepts a Component argument, which can be either a string (ie "div" - * for `motion.div`), or an actual React component. - * - * Alongside this is a config option which provides a way of rendering the provided - * component "offline", or outside the React render cycle. - */ -function createMotionComponent(Component, { forwardMotionProps = false, type } = {}, preloadedFeatures, createVisualElement) { - preloadedFeatures && loadFeatures(preloadedFeatures); - /** - * Determine whether to use SVG or HTML rendering based on: - * 1. Explicit `type` option (highest priority) - * 2. Auto-detection via `isSVGComponent` - */ - const isSVG = type ? type === "svg" : isSVGComponent(Component); - const useVisualState = isSVG ? useSVGVisualState : useHTMLVisualState; - function MotionDOMComponent(props, externalRef) { - /** - * If we need to measure the element we load this functionality in a - * separate class component in order to gain access to getSnapshotBeforeUpdate. - */ - let MeasureLayout; - const configAndProps = { - ...React.useContext(MotionConfigContext), - ...props, - layoutId: useLayoutId(props), - }; - const { isStatic, isValidProp } = configAndProps; - const context = useCreateMotionContext(props); - const visualState = useVisualState(props, isStatic); - if (!isStatic && typeof window !== "undefined") { - useStrictMode(configAndProps, preloadedFeatures); - const layoutProjection = getProjectionFunctionality(configAndProps); - MeasureLayout = layoutProjection.MeasureLayout; - /** - * Create a VisualElement for this component. A VisualElement provides a common - * interface to renderer-specific APIs (ie DOM/Three.js etc) as well as - * providing a way of rendering to these APIs outside of the React render loop - * for more performant animations and interactions - */ - context.visualElement = useVisualElement(Component, visualState, configAndProps, createVisualElement, layoutProjection.ProjectionNode, isSVG); - } - /** - * The mount order and hierarchy is specific to ensure our element ref - * is hydrated by the time features fire their effects. - */ - return (jsxRuntime.jsxs(MotionContext.Provider, { value: context, children: [MeasureLayout && context.visualElement ? (jsxRuntime.jsx(MeasureLayout, { visualElement: context.visualElement, ...configAndProps })) : null, useRender(Component, props, useMotionRef(visualState, context.visualElement, externalRef), visualState, isStatic, forwardMotionProps, isSVG, isValidProp)] })); - } - MotionDOMComponent.displayName = `motion.${typeof Component === "string" - ? Component - : `create(${Component.displayName ?? Component.name ?? ""})`}`; - const ForwardRefMotionComponent = React.forwardRef(MotionDOMComponent); - ForwardRefMotionComponent[motionComponentSymbol] = Component; - return ForwardRefMotionComponent; -} -function useLayoutId({ layoutId }) { - const layoutGroupId = React.useContext(LayoutGroupContext).id; - return layoutGroupId && layoutId !== undefined - ? layoutGroupId + "-" + layoutId - : layoutId; -} -function useStrictMode(configAndProps, preloadedFeatures) { - const isStrict = React.useContext(LazyContext).strict; - /** - * If we're in development mode, check to make sure we're not rendering a motion component - * as a child of LazyMotion, as this will break the file-size benefits of using it. - */ - if (process.env.NODE_ENV !== "production" && - preloadedFeatures && - isStrict) { - const strictMessage = "You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead."; - configAndProps.ignoreStrict - ? motionUtils.warning(false, strictMessage, "lazy-strict-mode") - : motionUtils.invariant(false, strictMessage, "lazy-strict-mode"); - } -} -function getProjectionFunctionality(props) { - const featureDefinitions = getInitializedFeatureDefinitions(); - const { drag, layout } = featureDefinitions; - if (!drag && !layout) - return {}; - const combined = { ...drag, ...layout }; - return { - MeasureLayout: drag?.isEnabled(props) || layout?.isEnabled(props) - ? combined.MeasureLayout - : undefined, - ProjectionNode: combined.ProjectionNode, - }; -} - -exports.LayoutGroupContext = LayoutGroupContext; -exports.LazyContext = LazyContext; -exports.MotionConfigContext = MotionConfigContext; -exports.MotionContext = MotionContext; -exports.PresenceContext = PresenceContext; -exports.SwitchLayoutGroupContext = SwitchLayoutGroupContext; -exports.createMotionComponent = createMotionComponent; -exports.filterProps = filterProps; -exports.isBrowser = isBrowser; -exports.isRefObject = isRefObject; -exports.isSVGComponent = isSVGComponent; -exports.isValidMotionProp = isValidMotionProp; -exports.loadFeatures = loadFeatures; -exports.makeUseVisualState = makeUseVisualState; -exports.motionComponentSymbol = motionComponentSymbol; -exports.useConstant = useConstant; -exports.useIsomorphicLayoutEffect = useIsomorphicLayoutEffect; -//# sourceMappingURL=index-BuO47Yrm.js.map diff --git a/node_modules/framer-motion/dist/cjs/index-BuO47Yrm.js.map b/node_modules/framer-motion/dist/cjs/index-BuO47Yrm.js.map deleted file mode 100644 index 5606aca..0000000 --- a/node_modules/framer-motion/dist/cjs/index-BuO47Yrm.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index-BuO47Yrm.js","sources":["../../src/context/LayoutGroupContext.ts","../../src/utils/use-constant.ts","../../src/utils/is-browser.ts","../../src/utils/use-isomorphic-effect.ts","../../src/context/PresenceContext.ts","../../src/context/MotionConfigContext.tsx","../../src/context/LazyContext.ts","../../src/motion/features/definitions.ts","../../src/motion/features/load-features.ts","../../src/render/svg/lowercase-elements.ts","../../src/render/dom/utils/is-svg-component.ts","../../src/context/MotionContext/index.ts","../../src/context/MotionContext/utils.ts","../../src/context/MotionContext/create.ts","../../src/render/html/utils/create-render-state.ts","../../src/render/html/use-props.ts","../../src/render/svg/utils/create-render-state.ts","../../src/render/svg/use-props.ts","../../src/motion/utils/valid-prop.ts","../../src/render/dom/utils/filter-props.ts","../../src/render/dom/use-render.ts","../../src/motion/utils/use-visual-state.ts","../../src/render/html/use-html-visual-state.ts","../../src/render/svg/use-svg-visual-state.ts","../../src/motion/utils/symbol.ts","../../src/motion/utils/use-motion-ref.ts","../../src/context/SwitchLayoutGroupContext.ts","../../src/utils/is-ref-object.ts","../../src/motion/utils/use-visual-element.ts","../../src/motion/index.tsx"],"sourcesContent":["\"use client\"\n\nimport { createContext } from \"react\"\nimport type { NodeGroup } from \"motion-dom\"\n\nexport interface LayoutGroupContextProps {\n id?: string\n group?: NodeGroup\n forceRender?: VoidFunction\n}\n\nexport const LayoutGroupContext = createContext({})\n","\"use client\"\n\nimport { useRef } from \"react\"\n\ntype Init = () => T\n\n/**\n * Creates a constant value over the lifecycle of a component.\n *\n * Even if `useMemo` is provided an empty array as its final argument, it doesn't offer\n * a guarantee that it won't re-run for performance reasons later on. By using `useConstant`\n * you can ensure that initialisers don't execute twice or more.\n */\nexport function useConstant(init: Init) {\n const ref = useRef(null)\n\n if (ref.current === null) {\n ref.current = init()\n }\n\n return ref.current\n}\n","export const isBrowser = typeof window !== \"undefined\"\n","\"use client\"\n\nimport { useEffect, useLayoutEffect } from \"react\"\nimport { isBrowser } from \"./is-browser\"\n\nexport const useIsomorphicLayoutEffect = isBrowser ? useLayoutEffect : useEffect\n","\"use client\"\n\nimport { createContext } from \"react\"\nimport type { PresenceContextProps } from \"motion-dom\"\n\nexport type { PresenceContextProps }\n\n/**\n * @public\n */\nexport const PresenceContext =\n /* @__PURE__ */ createContext(null)\n","\"use client\"\n\nimport type { Transition } from \"motion-dom\"\nimport { TransformPoint } from \"motion-utils\"\nimport { createContext } from \"react\"\n\nexport type ReducedMotionConfig = \"always\" | \"never\" | \"user\"\nexport type IsValidProp = (key: string) => boolean\n\n/**\n * @public\n */\nexport interface MotionConfigContext {\n /**\n * Internal, exported only for usage in Framer\n */\n transformPagePoint: TransformPoint\n\n /**\n * Internal. Determines whether this is a static context ie the Framer canvas. If so,\n * it'll disable all dynamic functionality.\n */\n isStatic: boolean\n\n /**\n * Defines a new default transition for the entire tree.\n *\n * @public\n */\n transition?: Transition\n\n /**\n * If true, will respect the device prefersReducedMotion setting by switching\n * transform animations off.\n *\n * @public\n */\n reducedMotion?: ReducedMotionConfig\n\n /**\n * A custom `nonce` attribute used when wanting to enforce a Content Security Policy (CSP).\n * For more details see:\n * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/style-src#unsafe_inline_styles\n *\n * @public\n */\n nonce?: string\n\n /**\n * If true, all animations will be skipped and values will be set instantly.\n * Useful for E2E tests and visual regression testing.\n *\n * @public\n */\n skipAnimations?: boolean\n\n /**\n * Determines whether a prop should be forwarded to the DOM.\n * Useful when wrapping Motion components with a styling library.\n *\n * @public\n */\n isValidProp?: IsValidProp\n}\n\n/**\n * @public\n */\nexport const MotionConfigContext = createContext({\n transformPagePoint: (p) => p,\n isStatic: false,\n reducedMotion: \"never\",\n})\n","\"use client\"\n\nimport { createContext } from \"react\"\nimport { CreateVisualElement } from \"../render/types\"\n\nexport interface LazyContextProps {\n renderer?: CreateVisualElement\n strict: boolean\n}\n\nexport const LazyContext = createContext({ strict: false })\n","import { getFeatureDefinitions, setFeatureDefinitions } from \"motion-dom\"\nimport { MotionProps } from \"../types\"\nimport { FeatureDefinitions } from \"./types\"\n\nconst featureProps = {\n animation: [\n \"animate\",\n \"variants\",\n \"whileHover\",\n \"whileTap\",\n \"exit\",\n \"whileInView\",\n \"whileFocus\",\n \"whileDrag\",\n ],\n exit: [\"exit\"],\n drag: [\"drag\", \"dragControls\"],\n focus: [\"whileFocus\"],\n hover: [\"whileHover\", \"onHoverStart\", \"onHoverEnd\"],\n tap: [\"whileTap\", \"onTap\", \"onTapStart\", \"onTapCancel\"],\n pan: [\"onPan\", \"onPanStart\", \"onPanSessionStart\", \"onPanEnd\"],\n inView: [\"whileInView\", \"onViewportEnter\", \"onViewportLeave\"],\n layout: [\"layout\", \"layoutId\"],\n}\n\nlet isInitialized = false\n\n/**\n * Initialize feature definitions with isEnabled checks.\n * This must be called before any motion components are rendered.\n */\nexport function initFeatureDefinitions() {\n if (isInitialized) return\n\n const initialFeatureDefinitions: Partial = {}\n\n for (const key in featureProps) {\n initialFeatureDefinitions[\n key as keyof typeof initialFeatureDefinitions\n ] = {\n isEnabled: (props: MotionProps) =>\n featureProps[key as keyof typeof featureProps].some(\n (name: string) => !!props[name as keyof typeof props]\n ),\n }\n }\n\n setFeatureDefinitions(initialFeatureDefinitions)\n isInitialized = true\n}\n\n/**\n * Get the current feature definitions, initializing if needed.\n */\nexport function getInitializedFeatureDefinitions(): Partial {\n initFeatureDefinitions()\n return getFeatureDefinitions()\n}\n","import { setFeatureDefinitions } from \"motion-dom\"\nimport { getInitializedFeatureDefinitions } from \"./definitions\"\nimport { FeaturePackages } from \"./types\"\n\nexport function loadFeatures(features: FeaturePackages) {\n const featureDefinitions = getInitializedFeatureDefinitions()\n\n for (const key in features) {\n featureDefinitions[key as keyof typeof featureDefinitions] = {\n ...featureDefinitions[key as keyof typeof featureDefinitions],\n ...features[key as keyof typeof features],\n } as any\n }\n\n setFeatureDefinitions(featureDefinitions)\n}\n","/**\n * We keep these listed separately as we use the lowercase tag names as part\n * of the runtime bundle to detect SVG components\n */\nexport const lowercaseSVGElements = [\n \"animate\",\n \"circle\",\n \"defs\",\n \"desc\",\n \"ellipse\",\n \"g\",\n \"image\",\n \"line\",\n \"filter\",\n \"marker\",\n \"mask\",\n \"metadata\",\n \"path\",\n \"pattern\",\n \"polygon\",\n \"polyline\",\n \"rect\",\n \"stop\",\n \"switch\",\n \"symbol\",\n \"svg\",\n \"text\",\n \"tspan\",\n \"use\",\n \"view\",\n]\n","import * as React from \"react\"\nimport { lowercaseSVGElements } from \"../../svg/lowercase-elements\"\n\nexport function isSVGComponent(Component: string | React.ComponentType) {\n if (\n /**\n * If it's not a string, it's a custom React component. Currently we only support\n * HTML custom React components.\n */\n typeof Component !== \"string\" ||\n /**\n * If it contains a dash, the element is a custom HTML webcomponent.\n */\n Component.includes(\"-\")\n ) {\n return false\n } else if (\n /**\n * If it's in our list of lowercase SVG tags, it's an SVG component\n */\n lowercaseSVGElements.indexOf(Component) > -1 ||\n /**\n * If it contains a capital letter, it's an SVG component\n */\n /[A-Z]/u.test(Component)\n ) {\n return true\n }\n\n return false\n}\n","\"use client\"\n\nimport type { VisualElement } from \"motion-dom\"\nimport { createContext } from \"react\"\n\nexport interface MotionContextProps {\n visualElement?: VisualElement\n initial?: false | string | string[]\n animate?: string | string[]\n}\n\nexport const MotionContext = /* @__PURE__ */ createContext(\n {}\n)\n","import { isControllingVariants, isVariantLabel } from \"motion-dom\"\nimport type { MotionContextProps } from \".\"\nimport { MotionProps } from \"../../motion/types\"\n\nexport function getCurrentTreeVariants(\n props: MotionProps,\n context: MotionContextProps\n): MotionContextProps {\n if (isControllingVariants(props)) {\n const { initial, animate } = props\n return {\n initial:\n initial === false || isVariantLabel(initial)\n ? (initial as any)\n : undefined,\n animate: isVariantLabel(animate) ? animate : undefined,\n }\n }\n return props.inherit !== false ? context : {}\n}\n","\"use client\"\n\nimport { useContext, useMemo } from \"react\"\nimport { MotionContext, type MotionContextProps } from \".\"\nimport { MotionProps } from \"../../motion/types\"\nimport { getCurrentTreeVariants } from \"./utils\"\n\nexport function useCreateMotionContext(\n props: MotionProps\n): MotionContextProps {\n const { initial, animate } = getCurrentTreeVariants(\n props,\n useContext(MotionContext)\n )\n\n return useMemo(\n () => ({ initial, animate }),\n [variantLabelsAsDependency(initial), variantLabelsAsDependency(animate)]\n )\n}\n\nfunction variantLabelsAsDependency(\n prop: undefined | string | string[] | boolean\n) {\n return Array.isArray(prop) ? prop.join(\" \") : prop\n}\n","import { HTMLRenderState } from \"../types\"\n\nexport const createHtmlRenderState = (): HTMLRenderState => ({\n style: {},\n transform: {},\n transformOrigin: {},\n vars: {},\n})\n","\"use client\"\n\nimport { AnyResolvedKeyframe, buildHTMLStyles, isForcedMotionValue, isMotionValue, MotionValue } from \"motion-dom\"\nimport { HTMLProps, useMemo } from \"react\"\nimport { MotionProps } from \"../../motion/types\"\nimport { ResolvedValues } from \"../types\"\nimport { createHtmlRenderState } from \"./utils/create-render-state\"\n\nexport function copyRawValuesOnly(\n target: ResolvedValues,\n source: { [key: string]: AnyResolvedKeyframe | MotionValue },\n props: MotionProps\n) {\n for (const key in source) {\n if (!isMotionValue(source[key]) && !isForcedMotionValue(key, props)) {\n target[key] = source[key] as AnyResolvedKeyframe\n }\n }\n}\n\nfunction useInitialMotionValues(\n { transformTemplate }: MotionProps,\n visualState: ResolvedValues\n) {\n return useMemo(() => {\n const state = createHtmlRenderState()\n\n buildHTMLStyles(state, visualState, transformTemplate)\n\n return Object.assign({}, state.vars, state.style)\n }, [visualState])\n}\n\nfunction useStyle(\n props: MotionProps,\n visualState: ResolvedValues\n): ResolvedValues {\n const styleProp = props.style || {}\n const style = {}\n\n /**\n * Copy non-Motion Values straight into style\n */\n copyRawValuesOnly(style, styleProp as any, props)\n\n Object.assign(style, useInitialMotionValues(props, visualState))\n\n return style\n}\n\nexport function useHTMLProps(\n props: MotionProps & HTMLProps,\n visualState: ResolvedValues\n) {\n // The `any` isn't ideal but it is the type of createElement props argument\n const htmlProps: any = {}\n const style = useStyle(props, visualState)\n\n if (props.drag && props.dragListener !== false) {\n // Disable the ghost element when a user drags\n htmlProps.draggable = false\n\n // Disable text selection\n style.userSelect =\n style.WebkitUserSelect =\n style.WebkitTouchCallout =\n \"none\"\n\n // Disable scrolling on the draggable direction\n style.touchAction =\n props.drag === true\n ? \"none\"\n : `pan-${props.drag === \"x\" ? \"y\" : \"x\"}`\n }\n\n if (\n props.tabIndex === undefined &&\n (props.onTap || props.onTapStart || props.whileTap)\n ) {\n htmlProps.tabIndex = 0\n }\n\n htmlProps.style = style\n\n return htmlProps\n}\n","import { createHtmlRenderState } from \"../../html/utils/create-render-state\"\nimport { SVGRenderState } from \"../types\"\n\nexport const createSvgRenderState = (): SVGRenderState => ({\n ...createHtmlRenderState(),\n attrs: {},\n})\n","\"use client\"\n\nimport { buildSVGAttrs, isSVGTag } from \"motion-dom\"\nimport { useMemo } from \"react\"\nimport { MotionProps } from \"../../motion/types\"\nimport { copyRawValuesOnly } from \"../html/use-props\"\nimport { ResolvedValues } from \"../types\"\nimport { createSvgRenderState } from \"./utils/create-render-state\"\n\nexport function useSVGProps(\n props: MotionProps,\n visualState: ResolvedValues,\n _isStatic: boolean,\n Component: string | React.ComponentType>\n) {\n const visualProps = useMemo(() => {\n const state = createSvgRenderState()\n\n buildSVGAttrs(\n state,\n visualState,\n isSVGTag(Component),\n props.transformTemplate,\n props.style\n )\n\n return {\n ...state.attrs,\n style: { ...state.style },\n }\n }, [visualState])\n\n if (props.style) {\n const rawStyles = {}\n copyRawValuesOnly(rawStyles, props.style as any, props)\n visualProps.style = { ...rawStyles, ...visualProps.style }\n }\n\n return visualProps\n}\n","import { MotionProps } from \"../types\"\n\n/**\n * A list of all valid MotionProps.\n *\n * @privateRemarks\n * This doesn't throw if a `MotionProp` name is missing - it should.\n */\nconst validMotionProps = new Set([\n \"animate\",\n \"exit\",\n \"variants\",\n \"initial\",\n \"style\",\n \"values\",\n \"variants\",\n \"transition\",\n \"transformTemplate\",\n \"custom\",\n \"inherit\",\n \"onBeforeLayoutMeasure\",\n \"onAnimationStart\",\n \"onAnimationComplete\",\n \"onUpdate\",\n \"onDragStart\",\n \"onDrag\",\n \"onDragEnd\",\n \"onMeasureDragConstraints\",\n \"onDirectionLock\",\n \"onDragTransitionEnd\",\n \"_dragX\",\n \"_dragY\",\n \"onHoverStart\",\n \"onHoverEnd\",\n \"onViewportEnter\",\n \"onViewportLeave\",\n \"globalTapTarget\",\n \"propagate\",\n \"ignoreStrict\",\n \"viewport\",\n])\n\n/**\n * Check whether a prop name is a valid `MotionProp` key.\n *\n * @param key - Name of the property to check\n * @returns `true` is key is a valid `MotionProp`.\n *\n * @public\n */\nexport function isValidMotionProp(key: string) {\n return (\n key.startsWith(\"while\") ||\n (key.startsWith(\"drag\") && key !== \"draggable\") ||\n key.startsWith(\"layout\") ||\n key.startsWith(\"onTap\") ||\n key.startsWith(\"onPan\") ||\n key.startsWith(\"onLayout\") ||\n validMotionProps.has(key as keyof MotionProps)\n )\n}\n","import { isMotionValue } from \"motion-dom\"\nimport type { IsValidProp } from \"../../../context/MotionConfigContext\"\nimport type { MotionProps } from \"../../../motion/types\"\nimport { isValidMotionProp } from \"../../../motion/utils/valid-prop\"\n\nfunction shouldForward(key: string, isValidProp?: IsValidProp) {\n return key.startsWith(\"on\")\n ? !isValidMotionProp(key)\n : isValidProp?.(key) ?? !isValidMotionProp(key)\n}\n\nexport function filterProps(\n props: MotionProps,\n isDom: boolean,\n forwardMotionProps: boolean,\n isValidProp?: IsValidProp\n) {\n const filteredProps: MotionProps = {}\n\n for (const key in props) {\n /**\n * values is considered a valid prop by Emotion, so if it's present\n * this will be rendered out to the DOM unless explicitly filtered.\n *\n * We check the type as it could be used with the `feColorMatrix`\n * element, which we support.\n */\n if (key === \"values\" && typeof props.values === \"object\") continue\n\n if (isMotionValue(props[key as keyof typeof props])) continue\n\n if (\n shouldForward(key, isValidProp) ||\n (forwardMotionProps === true && isValidMotionProp(key)) ||\n (!isDom && !isValidMotionProp(key)) ||\n // If trying to use native HTML drag events, forward drag listeners\n (props[\"draggable\" as keyof MotionProps] &&\n key.startsWith(\"onDrag\"))\n ) {\n filteredProps[key as keyof MotionProps] =\n props[key as keyof MotionProps]\n }\n }\n\n return filteredProps\n}\n","\"use client\"\n\nimport { isMotionValue } from \"motion-dom\"\nimport { Fragment, createElement, useMemo } from \"react\"\nimport type { IsValidProp } from \"../../context/MotionConfigContext\"\nimport { MotionProps } from \"../../motion/types\"\nimport { VisualState } from \"../../motion/utils/use-visual-state\"\nimport { HTMLRenderState } from \"../html/types\"\nimport { useHTMLProps } from \"../html/use-props\"\nimport { SVGRenderState } from \"../svg/types\"\nimport { useSVGProps } from \"../svg/use-props\"\nimport { DOMMotionComponents } from \"./types\"\nimport { filterProps } from \"./utils/filter-props\"\nimport { isSVGComponent } from \"./utils/is-svg-component\"\n\nexport function useRender<\n Props = {},\n TagName extends keyof DOMMotionComponents | string = \"div\"\n>(\n Component: TagName | string | React.ComponentType,\n props: MotionProps,\n ref: React.Ref,\n {\n latestValues,\n }: VisualState,\n isStatic: boolean,\n forwardMotionProps: boolean = false,\n isSVG?: boolean,\n isValidProp?: IsValidProp\n) {\n const useVisualProps =\n (isSVG ?? isSVGComponent(Component)) ? useSVGProps : useHTMLProps\n\n const visualProps = useVisualProps(\n props as any,\n latestValues,\n isStatic,\n Component as any\n )\n const filteredProps = filterProps(\n props,\n typeof Component === \"string\",\n forwardMotionProps,\n isValidProp\n )\n const elementProps =\n Component !== Fragment ? { ...filteredProps, ...visualProps, ref } : {}\n\n /**\n * If component has been handed a motion value as its child,\n * memoise its initial value and render that. Subsequent updates\n * will be handled by the onChange handler\n */\n const { children } = props\n const renderedChildren = useMemo(\n () => (isMotionValue(children) ? children.get() : children),\n [children]\n )\n\n return createElement(Component, {\n ...elementProps,\n children: renderedChildren,\n })\n}\n","\"use client\"\n\nimport {\n AnyResolvedKeyframe,\n isAnimationControls,\n isControllingVariants as checkIsControllingVariants,\n isVariantNode as checkIsVariantNode,\n ResolvedValues,\n resolveVariantFromProps,\n} from \"motion-dom\"\nimport { useContext } from \"react\"\nimport { MotionContext, MotionContextProps } from \"../../context/MotionContext\"\nimport {\n PresenceContext,\n type PresenceContextProps,\n} from \"../../context/PresenceContext\"\nimport { ScrapeMotionValuesFromProps } from \"../../render/types\"\nimport { useConstant } from \"../../utils/use-constant\"\nimport { resolveMotionValue } from \"motion-dom\"\nimport { MotionProps } from \"../types\"\n\nexport interface VisualState {\n renderState: RenderState\n latestValues: ResolvedValues\n onMount?: (instance: Instance) => void\n}\n\nexport type UseVisualState = (\n props: MotionProps,\n isStatic: boolean\n) => VisualState\n\nexport interface UseVisualStateConfig {\n scrapeMotionValuesFromProps: ScrapeMotionValuesFromProps\n createRenderState: () => RenderState\n}\n\nfunction makeState(\n {\n scrapeMotionValuesFromProps,\n createRenderState,\n }: UseVisualStateConfig,\n props: MotionProps,\n context: MotionContextProps,\n presenceContext: PresenceContextProps | null\n) {\n const state: VisualState = {\n latestValues: makeLatestValues(\n props,\n context,\n presenceContext,\n scrapeMotionValuesFromProps\n ),\n renderState: createRenderState(),\n }\n\n return state\n}\n\nfunction makeLatestValues(\n props: MotionProps,\n context: MotionContextProps,\n presenceContext: PresenceContextProps | null,\n scrapeMotionValues: ScrapeMotionValuesFromProps\n) {\n const values: ResolvedValues = {}\n\n const motionValues = scrapeMotionValues(props, {})\n for (const key in motionValues) {\n values[key] = resolveMotionValue(motionValues[key])\n }\n\n let { initial, animate } = props\n const isControllingVariants = checkIsControllingVariants(props)\n const isVariantNode = checkIsVariantNode(props)\n\n if (\n context &&\n isVariantNode &&\n !isControllingVariants &&\n props.inherit !== false\n ) {\n if (initial === undefined) initial = context.initial\n if (animate === undefined) animate = context.animate\n }\n\n let isInitialAnimationBlocked = presenceContext\n ? presenceContext.initial === false\n : false\n isInitialAnimationBlocked = isInitialAnimationBlocked || initial === false\n\n const variantToSet = isInitialAnimationBlocked ? animate : initial\n\n if (\n variantToSet &&\n typeof variantToSet !== \"boolean\" &&\n !isAnimationControls(variantToSet)\n ) {\n const list = Array.isArray(variantToSet) ? variantToSet : [variantToSet]\n for (let i = 0; i < list.length; i++) {\n const resolved = resolveVariantFromProps(props, list[i] as any)\n if (resolved) {\n const { transitionEnd, transition, ...target } = resolved\n for (const key in target) {\n let valueTarget = target[key as keyof typeof target]\n\n if (Array.isArray(valueTarget)) {\n /**\n * Take final keyframe if the initial animation is blocked because\n * we want to initialise at the end of that blocked animation.\n */\n const index = isInitialAnimationBlocked\n ? valueTarget.length - 1\n : 0\n valueTarget = valueTarget[index] as any\n }\n\n if (valueTarget !== null) {\n values[key] = valueTarget as AnyResolvedKeyframe\n }\n }\n for (const key in transitionEnd) {\n values[key] = transitionEnd[\n key as keyof typeof transitionEnd\n ] as AnyResolvedKeyframe\n }\n }\n }\n }\n\n return values\n}\n\nexport const makeUseVisualState =\n (config: UseVisualStateConfig): UseVisualState =>\n (props: MotionProps, isStatic: boolean): VisualState => {\n const context = useContext(MotionContext)\n const presenceContext = useContext(PresenceContext)\n const make = () => makeState(config, props, context, presenceContext)\n\n return isStatic ? make() : useConstant(make)\n }\n","\"use client\"\n\nimport { scrapeHTMLMotionValuesFromProps } from \"motion-dom\"\nimport { makeUseVisualState } from \"../../motion/utils/use-visual-state\"\nimport { createHtmlRenderState } from \"./utils/create-render-state\"\n\nexport const useHTMLVisualState = /*@__PURE__*/ makeUseVisualState({\n scrapeMotionValuesFromProps: scrapeHTMLMotionValuesFromProps,\n createRenderState: createHtmlRenderState,\n})\n","\"use client\"\n\nimport { scrapeSVGMotionValuesFromProps } from \"motion-dom\"\nimport { makeUseVisualState } from \"../../motion/utils/use-visual-state\"\nimport { createSvgRenderState } from \"./utils/create-render-state\"\n\nexport const useSVGVisualState = /*@__PURE__*/ makeUseVisualState({\n scrapeMotionValuesFromProps: scrapeSVGMotionValuesFromProps,\n createRenderState: createSvgRenderState,\n})\n","export const motionComponentSymbol = Symbol.for(\"motionComponentSymbol\")\n","\"use client\"\n\nimport type { VisualElement } from \"motion-dom\"\nimport * as React from \"react\"\nimport { useCallback, useInsertionEffect, useRef } from \"react\"\nimport { VisualState } from \"./use-visual-state\"\n\n/**\n * Creates a ref function that, when called, hydrates the provided\n * external ref and VisualElement.\n */\nexport function useMotionRef(\n visualState: VisualState,\n visualElement?: VisualElement | null,\n externalRef?: React.Ref\n): React.Ref {\n /**\n * Store externalRef in a ref to avoid including it in the useCallback\n * dependency array. Including externalRef in dependencies causes issues\n * with libraries like Radix UI that create new callback refs on each render\n * when using asChild - this would cause the callback to be recreated,\n * triggering element remounts and breaking AnimatePresence exit animations.\n */\n const externalRefContainer = useRef(externalRef)\n useInsertionEffect(() => {\n externalRefContainer.current = externalRef\n })\n\n // Store cleanup function returned by callback refs (React 19 feature)\n const refCleanup = useRef<(() => void) | null>(null)\n\n return useCallback(\n (instance: Instance) => {\n if (instance) {\n visualState.onMount?.(instance)\n }\n\n if (visualElement) {\n instance ? visualElement.mount(instance) : visualElement.unmount()\n }\n\n const ref = externalRefContainer.current\n if (typeof ref === \"function\") {\n if (instance) {\n const cleanup = ref(instance)\n if (typeof cleanup === \"function\") {\n refCleanup.current = cleanup\n }\n } else if (refCleanup.current) {\n refCleanup.current()\n refCleanup.current = null\n } else {\n ref(instance)\n }\n } else if (ref) {\n ;(ref as React.MutableRefObject).current = instance\n }\n },\n [visualElement]\n )\n}\n","\"use client\"\n\nimport type { Transition, IProjectionNode } from \"motion-dom\"\nimport { createContext } from \"react\"\n\nexport interface SwitchLayoutGroup {\n register?: (member: IProjectionNode) => void\n deregister?: (member: IProjectionNode) => void\n}\n\nexport type SwitchLayoutGroupContext = SwitchLayoutGroup &\n InitialPromotionConfig\n\nexport type InitialPromotionConfig = {\n /**\n * The initial transition to use when the elements in this group mount (and automatically promoted).\n * Subsequent updates should provide a transition in the promote method.\n */\n transition?: Transition\n /**\n * If the follow tree should preserve its opacity when the lead is promoted on mount\n */\n shouldPreserveFollowOpacity?: (member: IProjectionNode) => boolean\n}\n\n/**\n * Internal, exported only for usage in Framer\n */\nexport const SwitchLayoutGroupContext = createContext(\n {}\n)\n","import { MutableRefObject } from \"./safe-react-types\"\n\nexport function isRefObject(ref: any): ref is MutableRefObject {\n return (\n ref &&\n typeof ref === \"object\" &&\n Object.prototype.hasOwnProperty.call(ref, \"current\")\n )\n}\n","\"use client\"\n\nimport {\n optimizedAppearDataAttribute,\n type HTMLRenderState,\n type SVGRenderState,\n type VisualElement,\n} from \"motion-dom\"\nimport * as React from \"react\"\nimport { useContext, useEffect, useInsertionEffect, useRef } from \"react\"\nimport { LazyContext } from \"../../context/LazyContext\"\nimport { MotionConfigContext } from \"../../context/MotionConfigContext\"\nimport { MotionContext } from \"../../context/MotionContext\"\nimport { PresenceContext } from \"../../context/PresenceContext\"\nimport {\n InitialPromotionConfig,\n SwitchLayoutGroupContext,\n} from \"../../context/SwitchLayoutGroupContext\"\nimport { MotionProps } from \"../../motion/types\"\nimport type { IProjectionNode } from \"motion-dom\"\nimport { DOMMotionComponents } from \"../../render/dom/types\"\nimport { CreateVisualElement } from \"../../render/types\"\nimport { isRefObject } from \"../../utils/is-ref-object\"\nimport { useIsomorphicLayoutEffect } from \"../../utils/use-isomorphic-effect\"\nimport { VisualState } from \"./use-visual-state\"\n\nexport function useVisualElement<\n Props,\n TagName extends keyof DOMMotionComponents | string\n>(\n Component: TagName | string | React.ComponentType,\n visualState:\n | VisualState\n | VisualState,\n props: MotionProps & Partial,\n createVisualElement?: CreateVisualElement,\n ProjectionNodeConstructor?: any,\n isSVG?: boolean\n): VisualElement | undefined {\n const { visualElement: parent } = useContext(MotionContext)\n const lazyContext = useContext(LazyContext)\n const presenceContext = useContext(PresenceContext)\n const motionConfig = useContext(MotionConfigContext)\n const reducedMotionConfig = motionConfig.reducedMotion\n const skipAnimations = motionConfig.skipAnimations\n\n const visualElementRef = useRef | null>(null)\n\n /**\n * Track whether the component has been through React's commit phase.\n * Used to detect when LazyMotion features load after the component has mounted.\n */\n const hasMountedOnce = useRef(false)\n\n /**\n * If we haven't preloaded a renderer, check to see if we have one lazy-loaded\n */\n createVisualElement =\n createVisualElement ||\n (lazyContext.renderer as CreateVisualElement)\n\n if (!visualElementRef.current && createVisualElement) {\n visualElementRef.current = createVisualElement(Component, {\n visualState,\n parent,\n props,\n presenceContext,\n blockInitialAnimation: presenceContext\n ? presenceContext.initial === false\n : false,\n reducedMotionConfig,\n skipAnimations,\n isSVG,\n })\n\n /**\n * If the component has already mounted before features loaded (e.g. via\n * LazyMotion with async feature loading), we need to force the initial\n * animation to run. Otherwise state changes that occurred before features\n * loaded will be lost and the element will snap to its final state.\n */\n if (hasMountedOnce.current && visualElementRef.current) {\n visualElementRef.current.manuallyAnimateOnMount = true\n }\n }\n\n const visualElement = visualElementRef.current\n\n /**\n * Load Motion gesture and animation features. These are rendered as renderless\n * components so each feature can optionally make use of React lifecycle methods.\n */\n const initialLayoutGroupConfig = useContext(SwitchLayoutGroupContext)\n\n if (\n visualElement &&\n !visualElement.projection &&\n ProjectionNodeConstructor &&\n (visualElement.type === \"html\" || visualElement.type === \"svg\")\n ) {\n createProjectionNode(\n visualElementRef.current!,\n props,\n ProjectionNodeConstructor,\n initialLayoutGroupConfig\n )\n }\n\n const isMounted = useRef(false)\n useInsertionEffect(() => {\n /**\n * Check the component has already mounted before calling\n * `update` unnecessarily. This ensures we skip the initial update.\n */\n if (visualElement && isMounted.current) {\n visualElement.update(props, presenceContext)\n }\n })\n\n /**\n * Cache this value as we want to know whether HandoffAppearAnimations\n * was present on initial render - it will be deleted after this.\n */\n const optimisedAppearId =\n props[optimizedAppearDataAttribute as keyof typeof props]\n const wantsHandoff = useRef(\n Boolean(optimisedAppearId) &&\n typeof window !== \"undefined\" &&\n !window.MotionHandoffIsComplete?.(optimisedAppearId) &&\n window.MotionHasOptimisedAnimation?.(optimisedAppearId)\n )\n\n useIsomorphicLayoutEffect(() => {\n /**\n * Track that this component has mounted. This is used to detect when\n * LazyMotion features load after the component has already committed.\n */\n hasMountedOnce.current = true\n\n if (!visualElement) return\n\n isMounted.current = true\n window.MotionIsMounted = true\n\n visualElement.updateFeatures()\n visualElement.scheduleRenderMicrotask()\n\n /**\n * Ideally this function would always run in a useEffect.\n *\n * However, if we have optimised appear animations to handoff from,\n * it needs to happen synchronously to ensure there's no flash of\n * incorrect styles in the event of a hydration error.\n *\n * So if we detect a situtation where optimised appear animations\n * are running, we use useLayoutEffect to trigger animations.\n */\n if (wantsHandoff.current && visualElement.animationState) {\n visualElement.animationState.animateChanges()\n }\n })\n\n useEffect(() => {\n if (!visualElement) return\n\n if (!wantsHandoff.current && visualElement.animationState) {\n visualElement.animationState.animateChanges()\n }\n\n if (wantsHandoff.current) {\n // This ensures all future calls to animateChanges() in this component will run in useEffect\n queueMicrotask(() => {\n window.MotionHandoffMarkAsComplete?.(optimisedAppearId)\n })\n\n wantsHandoff.current = false\n }\n\n /**\n * Now we've finished triggering animations for this element we\n * can wipe the enteringChildren set for the next render.\n */\n visualElement.enteringChildren = undefined\n })\n\n return visualElement!\n}\n\nfunction createProjectionNode(\n visualElement: VisualElement,\n props: MotionProps,\n ProjectionNodeConstructor: any,\n initialPromotionConfig?: InitialPromotionConfig\n) {\n const {\n layoutId,\n layout,\n drag,\n dragConstraints,\n layoutScroll,\n layoutRoot,\n layoutAnchor,\n layoutCrossfade,\n } = props\n\n visualElement.projection = new ProjectionNodeConstructor(\n visualElement.latestValues,\n props[\"data-framer-portal-id\"]\n ? undefined\n : getClosestProjectingNode(visualElement.parent)\n ) as IProjectionNode\n\n visualElement.projection.setOptions({\n layoutId,\n layout,\n alwaysMeasureLayout:\n Boolean(drag) || (dragConstraints && isRefObject(dragConstraints)),\n visualElement,\n /**\n * TODO: Update options in an effect. This could be tricky as it'll be too late\n * to update by the time layout animations run.\n * We also need to fix this safeToRemove by linking it up to the one returned by usePresence,\n * ensuring it gets called if there's no potential layout animations.\n *\n */\n animationType: typeof layout === \"string\" ? layout : \"both\",\n initialPromotionConfig,\n crossfade: layoutCrossfade,\n layoutScroll,\n layoutRoot,\n layoutAnchor,\n })\n}\n\nfunction getClosestProjectingNode(\n visualElement?: VisualElement<\n unknown,\n unknown,\n { allowProjection?: boolean }\n >\n): IProjectionNode | undefined {\n if (!visualElement) return undefined\n\n return visualElement.options.allowProjection !== false\n ? visualElement.projection\n : getClosestProjectingNode(visualElement.parent)\n}\n","\"use client\"\n\nimport { invariant, warning } from \"motion-utils\"\nimport * as React from \"react\"\nimport { forwardRef, useContext } from \"react\"\nimport { LayoutGroupContext } from \"../context/LayoutGroupContext\"\nimport { LazyContext } from \"../context/LazyContext\"\nimport { MotionConfigContext } from \"../context/MotionConfigContext\"\nimport { MotionContext } from \"../context/MotionContext\"\nimport { useCreateMotionContext } from \"../context/MotionContext/create\"\nimport { DOMMotionComponents } from \"../render/dom/types\"\nimport { useRender } from \"../render/dom/use-render\"\nimport { isSVGComponent } from \"../render/dom/utils/is-svg-component\"\nimport { HTMLRenderState } from \"../render/html/types\"\nimport { useHTMLVisualState } from \"../render/html/use-html-visual-state\"\nimport { SVGRenderState } from \"../render/svg/types\"\nimport { useSVGVisualState } from \"../render/svg/use-svg-visual-state\"\nimport { CreateVisualElement } from \"../render/types\"\nimport { getInitializedFeatureDefinitions } from \"./features/definitions\"\nimport { loadFeatures } from \"./features/load-features\"\nimport { FeatureBundle, FeaturePackages } from \"./features/types\"\nimport { MotionProps } from \"./types\"\nimport { motionComponentSymbol } from \"./utils/symbol\"\nimport { useMotionRef } from \"./utils/use-motion-ref\"\nimport { useVisualElement } from \"./utils/use-visual-element\"\n\nexport interface MotionComponentConfig<\n TagName extends keyof DOMMotionComponents | string = \"div\"\n> {\n preloadedFeatures?: FeatureBundle\n createVisualElement?: CreateVisualElement\n Component: TagName | React.ComponentType>\n forwardMotionProps?: boolean\n}\n\nexport type MotionComponentProps = {\n [K in Exclude]?: Props[K]\n} & MotionProps\n\nexport type MotionComponent = T extends keyof DOMMotionComponents\n ? DOMMotionComponents[T]\n : React.ComponentType<\n Omit, \"children\"> & {\n children?: \"children\" extends keyof P\n ? P[\"children\"] | MotionComponentProps

[\"children\"]\n : MotionComponentProps

[\"children\"]\n }\n >\n\nexport interface MotionComponentOptions {\n forwardMotionProps?: boolean\n /**\n * Specify whether the component renders an HTML or SVG element.\n * This is useful when wrapping custom SVG components that need\n * SVG-specific attribute handling (like viewBox animation).\n * By default, Motion auto-detects based on the component name,\n * but custom React components are always treated as HTML.\n */\n type?: \"html\" | \"svg\"\n}\n\n/**\n * Create a `motion` component.\n *\n * This function accepts a Component argument, which can be either a string (ie \"div\"\n * for `motion.div`), or an actual React component.\n *\n * Alongside this is a config option which provides a way of rendering the provided\n * component \"offline\", or outside the React render cycle.\n */\nexport function createMotionComponent<\n Props,\n TagName extends keyof DOMMotionComponents | string = \"div\"\n>(\n Component: TagName | string | React.ComponentType,\n { forwardMotionProps = false, type }: MotionComponentOptions = {},\n preloadedFeatures?: FeaturePackages,\n createVisualElement?: CreateVisualElement\n) {\n preloadedFeatures && loadFeatures(preloadedFeatures)\n\n /**\n * Determine whether to use SVG or HTML rendering based on:\n * 1. Explicit `type` option (highest priority)\n * 2. Auto-detection via `isSVGComponent`\n */\n const isSVG = type ? type === \"svg\" : isSVGComponent(Component)\n const useVisualState = isSVG ? useSVGVisualState : useHTMLVisualState\n\n function MotionDOMComponent(\n props: MotionComponentProps,\n externalRef?: React.Ref\n ) {\n /**\n * If we need to measure the element we load this functionality in a\n * separate class component in order to gain access to getSnapshotBeforeUpdate.\n */\n let MeasureLayout: undefined | React.ComponentType\n\n const configAndProps = {\n ...useContext(MotionConfigContext),\n ...props,\n layoutId: useLayoutId(props),\n }\n\n const { isStatic, isValidProp } = configAndProps\n\n const context = useCreateMotionContext(props)\n\n const visualState = useVisualState(props, isStatic)\n\n if (!isStatic && typeof window !== \"undefined\") {\n useStrictMode(configAndProps, preloadedFeatures)\n\n const layoutProjection = getProjectionFunctionality(configAndProps)\n MeasureLayout = layoutProjection.MeasureLayout\n\n /**\n * Create a VisualElement for this component. A VisualElement provides a common\n * interface to renderer-specific APIs (ie DOM/Three.js etc) as well as\n * providing a way of rendering to these APIs outside of the React render loop\n * for more performant animations and interactions\n */\n context.visualElement = useVisualElement(\n Component,\n visualState,\n configAndProps,\n createVisualElement,\n layoutProjection.ProjectionNode,\n isSVG\n )\n }\n\n /**\n * The mount order and hierarchy is specific to ensure our element ref\n * is hydrated by the time features fire their effects.\n */\n return (\n \n {MeasureLayout && context.visualElement ? (\n \n ) : null}\n {useRender(\n Component,\n props,\n useMotionRef<\n HTMLElement | SVGElement,\n HTMLRenderState | SVGRenderState\n >(visualState, context.visualElement, externalRef),\n visualState,\n isStatic,\n forwardMotionProps,\n isSVG,\n isValidProp\n )}\n \n )\n }\n\n MotionDOMComponent.displayName = `motion.${\n typeof Component === \"string\"\n ? Component\n : `create(${Component.displayName ?? Component.name ?? \"\"})`\n }`\n\n const ForwardRefMotionComponent = forwardRef(MotionDOMComponent as any)\n ;(ForwardRefMotionComponent as any)[motionComponentSymbol] = Component\n\n return ForwardRefMotionComponent as MotionComponent\n}\n\nfunction useLayoutId({ layoutId }: MotionProps) {\n const layoutGroupId = useContext(LayoutGroupContext).id\n return layoutGroupId && layoutId !== undefined\n ? layoutGroupId + \"-\" + layoutId\n : layoutId\n}\n\nfunction useStrictMode(\n configAndProps: MotionProps,\n preloadedFeatures?: FeaturePackages\n) {\n const isStrict = useContext(LazyContext).strict\n\n /**\n * If we're in development mode, check to make sure we're not rendering a motion component\n * as a child of LazyMotion, as this will break the file-size benefits of using it.\n */\n if (\n process.env.NODE_ENV !== \"production\" &&\n preloadedFeatures &&\n isStrict\n ) {\n const strictMessage =\n \"You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.\"\n configAndProps.ignoreStrict\n ? warning(false, strictMessage, \"lazy-strict-mode\")\n : invariant(false, strictMessage, \"lazy-strict-mode\")\n }\n}\n\nfunction getProjectionFunctionality(props: MotionProps) {\n const featureDefinitions = getInitializedFeatureDefinitions()\n const { drag, layout } = featureDefinitions\n\n if (!drag && !layout) return {}\n\n const combined = { ...drag, ...layout }\n\n return {\n MeasureLayout:\n drag?.isEnabled(props) || layout?.isEnabled(props)\n ? combined.MeasureLayout\n : undefined,\n ProjectionNode: combined.ProjectionNode,\n }\n}\n"],"names":["createContext","useRef","useLayoutEffect","useEffect","setFeatureDefinitions","getFeatureDefinitions","isControllingVariants","isVariantLabel","useContext","useMemo","isMotionValue","isForcedMotionValue","buildHTMLStyles","buildSVGAttrs","isSVGTag","Fragment","createElement","resolveMotionValue","checkIsControllingVariants","checkIsVariantNode","isAnimationControls","resolveVariantFromProps","scrapeHTMLMotionValuesFromProps","scrapeSVGMotionValuesFromProps","useInsertionEffect","useCallback","optimizedAppearDataAttribute","_jsxs","_jsx","forwardRef","warning","invariant"],"mappings":";;;;;;;MAWa,kBAAkB,GAAGA,mBAAa,CAA0B,EAAE;;ACL3E;;;;;;AAMG;AACG,SAAU,WAAW,CAAI,IAAa,EAAA;AACxC,IAAA,MAAM,GAAG,GAAGC,YAAM,CAAW,IAAI,CAAC;AAElC,IAAA,IAAI,GAAG,CAAC,OAAO,KAAK,IAAI,EAAE;AACtB,QAAA,GAAG,CAAC,OAAO,GAAG,IAAI,EAAE;IACxB;IAEA,OAAO,GAAG,CAAC,OAAO;AACtB;;MCrBa,SAAS,GAAG,OAAO,MAAM,KAAK;;ACKpC,MAAM,yBAAyB,GAAG,SAAS,GAAGC,qBAAe,GAAGC;;ACEvE;;AAEG;MACU,eAAe;AACxB,gBAAgBH,mBAAa,CAA8B,IAAI;;ACsDnE;;AAEG;AACI,MAAM,mBAAmB,GAAGA,mBAAa,CAAsB;AAClE,IAAA,kBAAkB,EAAE,CAAC,CAAC,KAAK,CAAC;AAC5B,IAAA,QAAQ,EAAE,KAAK;AACf,IAAA,aAAa,EAAE,OAAO;AACzB,CAAA;;AC9DM,MAAM,WAAW,GAAGA,mBAAa,CAAmB,EAAE,MAAM,EAAE,KAAK,EAAE;;ACN5E,MAAM,YAAY,GAAG;AACjB,IAAA,SAAS,EAAE;QACP,SAAS;QACT,UAAU;QACV,YAAY;QACZ,UAAU;QACV,MAAM;QACN,aAAa;QACb,YAAY;QACZ,WAAW;AACd,KAAA;IACD,IAAI,EAAE,CAAC,MAAM,CAAC;AACd,IAAA,IAAI,EAAE,CAAC,MAAM,EAAE,cAAc,CAAC;IAC9B,KAAK,EAAE,CAAC,YAAY,CAAC;AACrB,IAAA,KAAK,EAAE,CAAC,YAAY,EAAE,cAAc,EAAE,YAAY,CAAC;IACnD,GAAG,E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C,QAAQ,CAAC;AACX,cAAE,SAAS;QACnB,cAAc,EAAE,QAAQ,CAAC,cAAc;KAC1C;AACL;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/cjs/index.js b/node_modules/framer-motion/dist/cjs/index.js deleted file mode 100644 index 72b8373..0000000 --- a/node_modules/framer-motion/dist/cjs/index.js +++ /dev/null @@ -1,3823 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { value: true }); - -var jsxRuntime = require('react/jsx-runtime'); -var React = require('react'); -var index = require('./index-BuO47Yrm.js'); -var motionDom = require('motion-dom'); -var featureBundle = require('./feature-bundle-BZV7Y7IM.js'); -var motionUtils = require('motion-utils'); - -function _interopNamespaceDefault(e) { - var n = Object.create(null); - if (e) { - Object.keys(e).forEach(function (k) { - if (k !== 'default') { - var d = Object.getOwnPropertyDescriptor(e, k); - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: function () { return e[k]; } - }); - } - }); - } - n.default = e; - return Object.freeze(n); -} - -var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React); - -/** - * Taken from https://github.com/radix-ui/primitives/blob/main/packages/react/compose-refs/src/compose-refs.tsx - */ -/** - * Set a given ref to a given value - * This utility takes care of different types of refs: callback refs and RefObject(s) - */ -function setRef(ref, value) { - if (typeof ref === "function") { - return ref(value); - } - else if (ref !== null && ref !== undefined) { - ref.current = value; - } -} -/** - * A utility to compose multiple refs together - * Accepts callback refs and RefObject(s) - */ -function composeRefs(...refs) { - return (node) => { - let hasCleanup = false; - const cleanups = refs.map((ref) => { - const cleanup = setRef(ref, node); - if (!hasCleanup && typeof cleanup === "function") { - hasCleanup = true; - } - return cleanup; - }); - // React <19 will log an error to the console if a callback ref returns a - // value. We don't use ref cleanups internally so this will only happen if a - // user's ref callback returns a value, which we only expect if they are - // using the cleanup functionality added in React 19. - if (hasCleanup) { - return () => { - for (let i = 0; i < cleanups.length; i++) { - const cleanup = cleanups[i]; - if (typeof cleanup === "function") { - cleanup(); - } - else { - setRef(refs[i], null); - } - } - }; - } - }; -} -/** - * A custom hook that composes multiple refs - * Accepts callback refs and RefObject(s) - */ -function useComposedRefs(...refs) { - // eslint-disable-next-line react-hooks/exhaustive-deps - return React__namespace.useCallback(composeRefs(...refs), refs); -} - -/** - * Measurement functionality has to be within a separate component - * to leverage snapshot lifecycle. - */ -class PopChildMeasure extends React__namespace.Component { - getSnapshotBeforeUpdate(prevProps) { - const element = this.props.childRef.current; - if (motionDom.isHTMLElement(element) && prevProps.isPresent && !this.props.isPresent && this.props.pop !== false) { - const parent = element.offsetParent; - const parentWidth = motionDom.isHTMLElement(parent) - ? parent.offsetWidth || 0 - : 0; - const parentHeight = motionDom.isHTMLElement(parent) - ? parent.offsetHeight || 0 - : 0; - const computedStyle = getComputedStyle(element); - const size = this.props.sizeRef.current; - size.height = parseFloat(computedStyle.height); - size.width = parseFloat(computedStyle.width); - size.top = element.offsetTop; - size.left = element.offsetLeft; - size.right = parentWidth - size.width - size.left; - size.bottom = parentHeight - size.height - size.top; - size.direction = computedStyle.direction; - } - return null; - } - /** - * Required with getSnapshotBeforeUpdate to stop React complaining. - */ - componentDidUpdate() { } - render() { - return this.props.children; - } -} -function PopChild({ children, isPresent, anchorX, anchorY, root, pop }) { - const id = React.useId(); - const ref = React.useRef(null); - const size = React.useRef({ - width: 0, - height: 0, - top: 0, - left: 0, - right: 0, - bottom: 0, - direction: "ltr", - }); - const { nonce } = React.useContext(index.MotionConfigContext); - /** - * In React 19, refs are passed via props.ref instead of element.ref. - * We check props.ref first (React 19) and fall back to element.ref (React 18). - * - * The composed ref is only used when popping the child out (pop !== false), - * so we avoid reading children.props.ref otherwise. In React 18.3 that read - * triggers a spurious "`ref` is not a prop" warning getter (#3745). - */ - const childRef = pop !== false - ? (children.props?.ref ?? - children?.ref) - : undefined; - const composedRef = useComposedRefs(ref, childRef); - /** - * We create and inject a style block so we can apply this explicit - * sizing in a non-destructive manner by just deleting the style block. - * - * We can't apply size via render as the measurement happens - * in getSnapshotBeforeUpdate (post-render), likewise if we apply the - * styles directly on the DOM node, we might be overwriting - * styles set via the style prop. - */ - React.useInsertionEffect(() => { - const { width, height, top, left, right, bottom, direction } = size.current; - if (isPresent || pop === false || !ref.current || !width || !height) - return; - const isRTL = direction === "rtl"; - const x = anchorX === "left" - ? (isRTL ? `right: ${right}` : `left: ${left}`) - : (isRTL ? `left: ${left}` : `right: ${right}`); - const y = anchorY === "bottom" ? `bottom: ${bottom}` : `top: ${top}`; - ref.current.dataset.motionPopId = id; - const style = document.createElement("style"); - if (nonce) - style.nonce = nonce; - const parent = root ?? document.head; - parent.appendChild(style); - if (style.sheet) { - style.sheet.insertRule(` - [data-motion-pop-id="${id}"] { - position: absolute !important; - width: ${width}px !important; - height: ${height}px !important; - ${x}px !important; - ${y}px !important; - } - `); - } - return () => { - ref.current?.removeAttribute("data-motion-pop-id"); - if (parent.contains(style)) { - parent.removeChild(style); - } - }; - }, [isPresent]); - return (jsxRuntime.jsx(PopChildMeasure, { isPresent: isPresent, childRef: ref, sizeRef: size, pop: pop, children: pop === false - ? children - : React__namespace.cloneElement(children, { ref: composedRef }) })); -} - -const PresenceChild = ({ children, initial, isPresent, onExitComplete, custom, presenceAffectsLayout, mode, anchorX, anchorY, root }) => { - const presenceChildren = index.useConstant(newChildrenMap); - const id = React.useId(); - // Written in a layout effect (not render) so discarded concurrent - // renders can't leave the refs pointing at uncommitted state. - const isPresentRef = React.useRef(isPresent); - const onExitCompleteRef = React.useRef(onExitComplete); - index.useIsomorphicLayoutEffect(() => { - isPresentRef.current = isPresent; - onExitCompleteRef.current = onExitComplete; - }); - let isReusedContext = true; - let context = React.useMemo(() => { - isReusedContext = false; - return { - id, - initial, - isPresent, - custom, - onExitComplete: (childId) => { - presenceChildren.set(childId, true); - for (const isComplete of presenceChildren.values()) { - if (!isComplete) - return; // can stop searching when any is incomplete - } - onExitComplete && onExitComplete(); - }, - register: (childId) => { - presenceChildren.set(childId, false); - return () => { - presenceChildren.delete(childId); - !isPresentRef.current && - !presenceChildren.size && - onExitCompleteRef.current?.(); - }; - }, - }; - }, [isPresent, presenceChildren, onExitComplete]); - /** - * If the presence of a child affects the layout of the components around it, - * we want to make a new context value to ensure they get re-rendered - * so they can detect that layout change. - */ - if (presenceAffectsLayout && isReusedContext) { - context = { ...context }; - } - React.useMemo(() => { - presenceChildren.forEach((_, key) => presenceChildren.set(key, false)); - }, [isPresent]); - /** - * If there's no `motion` components to fire exit animations, we want to remove this - * component immediately. - */ - React__namespace.useEffect(() => { - !isPresent && - !presenceChildren.size && - onExitComplete && - onExitComplete(); - }, [isPresent]); - children = (jsxRuntime.jsx(PopChild, { pop: mode === "popLayout", isPresent: isPresent, anchorX: anchorX, anchorY: anchorY, root: root, children: children })); - return (jsxRuntime.jsx(index.PresenceContext.Provider, { value: context, children: children })); -}; -function newChildrenMap() { - return new Map(); -} - -const getChildKey = (child) => child.key || ""; -function onlyElements(children) { - const filtered = []; - // We use forEach here instead of map as map mutates the component key by preprending `.$` - React.Children.forEach(children, (child) => { - if (React.isValidElement(child)) - filtered.push(child); - }); - return filtered; -} - -/** - * `AnimatePresence` enables the animation of components that have been removed from the tree. - * - * When adding/removing more than a single child, every child **must** be given a unique `key` prop. - * - * Any `motion` components that have an `exit` property defined will animate out when removed from - * the tree. - * - * ```jsx - * import { motion, AnimatePresence } from 'framer-motion' - * - * export const Items = ({ items }) => ( - * - * {items.map(item => ( - * - * ))} - * - * ) - * ``` - * - * You can sequence exit animations throughout a tree using variants. - * - * If a child contains multiple `motion` components with `exit` props, it will only unmount the child - * once all `motion` components have finished animating out. Likewise, any components using - * `usePresence` all need to call `safeToRemove`. - * - * @public - */ -const AnimatePresence = ({ children, custom, initial = true, onExitComplete, presenceAffectsLayout = true, mode = "sync", propagate = false, anchorX = "left", anchorY = "top", root }) => { - const [isParentPresent, safeToRemove] = featureBundle.usePresence(propagate); - /** - * Filter any children that aren't ReactElements. We can only track components - * between renders with a props.key. - */ - const presentChildren = React.useMemo(() => onlyElements(children), [children]); - /** - * Track the keys of the currently rendered children. This is used to - * determine which children are exiting. - */ - const presentKeys = propagate && !isParentPresent ? [] : presentChildren.map(getChildKey); - /** - * If `initial={false}` we only want to pass this to components in the first render. - */ - const isInitialRender = React.useRef(true); - /** - * A ref containing the currently present children. When all exit animations - * are complete, we use this to re-render the component with the latest children - * *committed* rather than the latest children *rendered*. - */ - const pendingPresentChildren = React.useRef(presentChildren); - /** - * Track which exiting children have finished animating out. - */ - const exitComplete = index.useConstant(() => new Map()); - /** - * Track which components are currently processing exit to prevent duplicate processing. - */ - const exitingComponents = React.useRef(new Set()); - /** - * Save children to render as React state. To ensure this component is concurrent-safe, - * we check for exiting children via an effect. - */ - const [diffedChildren, setDiffedChildren] = React.useState(presentChildren); - const [renderedChildren, setRenderedChildren] = React.useState(presentChildren); - index.useIsomorphicLayoutEffect(() => { - if (propagate && !isParentPresent && !renderedChildren.length) { - safeToRemove?.(); - } - }, [isParentPresent, propagate, renderedChildren.length, safeToRemove]); - index.useIsomorphicLayoutEffect(() => { - isInitialRender.current = false; - pendingPresentChildren.current = presentChildren; - /** - * Update complete status of exiting children. - */ - for (let i = 0; i < renderedChildren.length; i++) { - const key = getChildKey(renderedChildren[i]); - if (!presentKeys.includes(key)) { - if (exitComplete.get(key) !== true) { - exitComplete.set(key, false); - } - } - else { - exitComplete.delete(key); - exitingComponents.current.delete(key); - } - } - }, [renderedChildren, presentKeys.length, presentKeys.join("-")]); - const exitingChildren = []; - if (presentChildren !== diffedChildren) { - let nextChildren = [...presentChildren]; - /** - * Loop through all the currently rendered components and decide which - * are exiting. - */ - for (let i = 0; i < renderedChildren.length; i++) { - const child = renderedChildren[i]; - const key = getChildKey(child); - if (!presentKeys.includes(key)) { - nextChildren.splice(i, 0, child); - exitingChildren.push(child); - } - } - /** - * If we're in "wait" mode, and we have exiting children, we want to - * only render these until they've all exited. - */ - if (mode === "wait" && exitingChildren.length) { - nextChildren = exitingChildren; - } - setRenderedChildren(onlyElements(nextChildren)); - setDiffedChildren(presentChildren); - /** - * Early return to ensure once we've set state with the latest diffed - * children, we can immediately re-render. - */ - return null; - } - if (process.env.NODE_ENV !== "production" && - mode === "wait" && - renderedChildren.length > 1) { - console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`); - } - /** - * If we've been provided a forceRender function by the LayoutGroupContext, - * we can use it to force a re-render amongst all surrounding components once - * all components have finished animating out. - */ - const { forceRender } = React.useContext(index.LayoutGroupContext); - return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: renderedChildren.map((child) => { - const key = getChildKey(child); - const isPresent = propagate && !isParentPresent - ? false - : presentChildren === renderedChildren || - presentKeys.includes(key); - const onExit = () => { - if (exitingComponents.current.has(key)) { - return; - } - if (exitComplete.has(key)) { - exitingComponents.current.add(key); - exitComplete.set(key, true); - } - else { - return; - } - let isEveryExitComplete = true; - exitComplete.forEach((isExitComplete) => { - if (!isExitComplete) - isEveryExitComplete = false; - }); - if (isEveryExitComplete) { - forceRender?.(); - setRenderedChildren(pendingPresentChildren.current); - propagate && safeToRemove?.(); - onExitComplete && onExitComplete(); - } - }; - return (jsxRuntime.jsx(PresenceChild, { isPresent: isPresent, initial: !isInitialRender.current || initial - ? undefined - : false, custom: custom, presenceAffectsLayout: presenceAffectsLayout, mode: mode, root: root, onExitComplete: isPresent ? undefined : onExit, anchorX: anchorX, anchorY: anchorY, children: child }, key)); - }) })); -}; - -/** - * Note: Still used by components generated by old versions of Framer - * - * @deprecated - */ -const DeprecatedLayoutGroupContext = React.createContext(null); - -function useIsMounted() { - const isMounted = React.useRef(false); - index.useIsomorphicLayoutEffect(() => { - isMounted.current = true; - return () => { - isMounted.current = false; - }; - }, []); - return isMounted; -} - -function useForceUpdate() { - const isMounted = useIsMounted(); - const [forcedRenderCount, setForcedRenderCount] = React.useState(0); - const forceRender = React.useCallback(() => { - isMounted.current && setForcedRenderCount(forcedRenderCount + 1); - }, [forcedRenderCount]); - /** - * Defer this to the end of the next animation frame in case there are multiple - * synchronous calls. - */ - const deferredForceRender = React.useCallback(() => motionDom.frame.postRender(forceRender), [forceRender]); - return [deferredForceRender, forcedRenderCount]; -} - -const shouldInheritGroup = (inherit) => inherit === true; -const shouldInheritId = (inherit) => shouldInheritGroup(inherit === true) || inherit === "id"; -const LayoutGroup = ({ children, id, inherit = true }) => { - const layoutGroupContext = React.useContext(index.LayoutGroupContext); - const deprecatedLayoutGroupContext = React.useContext(DeprecatedLayoutGroupContext); - const [forceRender, key] = useForceUpdate(); - const context = React.useRef(null); - const upstreamId = layoutGroupContext.id || deprecatedLayoutGroupContext; - if (context.current === null) { - if (shouldInheritId(inherit) && upstreamId) { - id = id ? upstreamId + "-" + id : upstreamId; - } - context.current = { - id, - group: shouldInheritGroup(inherit) - ? layoutGroupContext.group || motionDom.nodeGroup() - : motionDom.nodeGroup(), - }; - } - const memoizedContext = React.useMemo(() => ({ ...context.current, forceRender }), [key]); - return (jsxRuntime.jsx(index.LayoutGroupContext.Provider, { value: memoizedContext, children: children })); -}; - -/** - * Used in conjunction with the `m` component to reduce bundle size. - * - * `m` is a version of the `motion` component that only loads functionality - * critical for the initial render. - * - * `LazyMotion` can then be used to either synchronously or asynchronously - * load animation and gesture support. - * - * ```jsx - * // Synchronous loading - * import { LazyMotion, m, domAnimation } from "framer-motion" - * - * function App() { - * return ( - * - * - * - * ) - * } - * - * // Asynchronous loading - * import { LazyMotion, m } from "framer-motion" - * - * function App() { - * return ( - * import('./path/to/domAnimation')}> - * - * - * ) - * } - * ``` - * - * @public - */ -function LazyMotion({ children, features, strict = false }) { - const [, setIsLoaded] = React.useState(!isLazyBundle(features)); - const loadedRenderer = React.useRef(undefined); - /** - * If this is a synchronous load, load features immediately - */ - if (!isLazyBundle(features)) { - const { renderer, ...loadedFeatures } = features; - loadedRenderer.current = renderer; - index.loadFeatures(loadedFeatures); - } - React.useEffect(() => { - if (isLazyBundle(features)) { - features().then(({ renderer, ...loadedFeatures }) => { - index.loadFeatures(loadedFeatures); - loadedRenderer.current = renderer; - setIsLoaded(true); - }); - } - }, []); - return (jsxRuntime.jsx(index.LazyContext.Provider, { value: { renderer: loadedRenderer.current, strict }, children: children })); -} -function isLazyBundle(features) { - return typeof features === "function"; -} - -/** - * `MotionConfig` is used to set configuration options for all children `motion` components. - * - * ```jsx - * import { motion, MotionConfig } from "framer-motion" - * - * export function App() { - * return ( - * - * - * - * ) - * } - * ``` - * - * @public - */ -function MotionConfig({ children, ...config }) { - /** - * Inherit props from any parent MotionConfig components - */ - const parentConfig = React.useContext(index.MotionConfigContext); - config = { ...parentConfig, ...config }; - config.transition = motionDom.resolveTransition(config.transition, parentConfig.transition); - /** - * Don't allow isStatic to change between renders as it affects how many hooks - * motion components fire. - */ - config.isStatic = index.useConstant(() => config.isStatic); - /** - * Creating a new config context object will re-render every `motion` component - * every time it renders. So we only want to create a new one sparingly. - */ - const context = React.useMemo(() => config, [ - JSON.stringify(config.transition), - config.transformPagePoint, - config.reducedMotion, - config.skipAnimations, - config.isValidProp, - ]); - return (jsxRuntime.jsx(index.MotionConfigContext.Provider, { value: context, children: children })); -} - -const ReorderContext = React.createContext(null); - -function createMotionProxy(preloadedFeatures, createVisualElement) { - if (typeof Proxy === "undefined") { - return index.createMotionComponent; - } - /** - * A cache of generated `motion` components, e.g `motion.div`, `motion.input` etc. - * Rather than generating them anew every render. - */ - const componentCache = new Map(); - const factory = (Component, options) => { - return index.createMotionComponent(Component, options, preloadedFeatures, createVisualElement); - }; - /** - * Support for deprecated`motion(Component)` pattern - */ - const deprecatedFactoryFunction = (Component, options) => { - if (process.env.NODE_ENV !== "production") { - motionUtils.warnOnce(false, "motion() is deprecated. Use motion.create() instead."); - } - return factory(Component, options); - }; - return new Proxy(deprecatedFactoryFunction, { - /** - * Called when `motion` is referenced with a prop: `motion.div`, `motion.input` etc. - * The prop name is passed through as `key` and we can use that to generate a `motion` - * DOM component with that name. - */ - get: (_target, key) => { - if (key === "create") - return factory; - /** - * If this element doesn't exist in the component cache, create it and cache. - */ - if (!componentCache.has(key)) { - componentCache.set(key, index.createMotionComponent(key, undefined, preloadedFeatures, createVisualElement)); - } - return componentCache.get(key); - }, - }); -} - -const motion = /*@__PURE__*/ createMotionProxy(featureBundle.featureBundle, featureBundle.createDomVisualElement); - -function checkReorder(order, value, offset, velocity, axis, direction = "ltr") { - const index = order.findIndex((item) => item.value === value); - if (index === -1) - return order; - if (axis === "xy") { - const { layout } = order[index]; - const center = { - x: motionDom.mixNumber(layout.x.min, layout.x.max, 0.5) + offset.x, - y: motionDom.mixNumber(layout.y.min, layout.y.max, 0.5) + offset.y, - }; - const lines = getLines(order); - const sourceLine = lines.find((line) => line.items.includes(order[index])); - const targetLine = lines.reduce((closest, line) => distanceToLine(center.y, line) < distanceToLine(center.y, closest) - ? line - : closest); - if (targetLine !== sourceLine) { - return moveToLine(order, index, center.x, targetLine, direction); - } - const currentDistance = distanceToBox(center, layout); - let target = -1; - let targetDistance = currentDistance; - order.forEach((item, targetIndex) => { - if (targetIndex === index) - return; - const distance = distanceToBox(center, item.layout); - if (distance < targetDistance) { - target = targetIndex; - targetDistance = distance; - } - }); - return target === -1 - ? order - : motionUtils.moveItem(order, index, index + Math.sign(target - index)); - } - if (!velocity[axis]) - return order; - const nextOffset = velocity[axis] > 0 ? 1 : -1; - const nextItem = order[index + nextOffset]; - if (!nextItem) - return order; - const item = order[index]; - const itemLayout = item.layout[axis]; - const nextLayout = nextItem.layout[axis]; - const nextItemCenter = motionDom.mixNumber(nextLayout.min, nextLayout.max, 0.5); - if ((nextOffset === 1 && itemLayout.max + offset[axis] > nextItemCenter) || - (nextOffset === -1 && itemLayout.min + offset[axis] < nextItemCenter)) { - return motionUtils.moveItem(order, index, index + nextOffset); - } - return order; -} -function getLines(order) { - const lines = []; - order.forEach((item) => { - const { min, max } = item.layout.y; - const line = lines[lines.length - 1]; - if (!line || min >= line.max || max <= line.min) { - lines.push({ items: [item], min, max }); - } - else { - line.items.push(item); - line.min = Math.min(line.min, min); - line.max = Math.max(line.max, max); - } - }); - return lines; -} -function distanceToLine(y, line) { - return y < line.min ? line.min - y : y > line.max ? y - line.max : 0; -} -function moveToLine(order, index, x, line, direction) { - const remaining = order.filter((_, itemIndex) => itemIndex !== index); - const before = line.items.find((item) => { - const center = motionDom.mixNumber(item.layout.x.min, item.layout.x.max, 0.5); - return direction === "ltr" ? x < center : x > center; - }); - const targetIndex = before - ? remaining.indexOf(before) - : remaining.indexOf(line.items[line.items.length - 1]) + 1; - const nextOrder = [...remaining]; - nextOrder.splice(targetIndex, 0, order[index]); - return nextOrder.every((item, itemIndex) => item === order[itemIndex]) - ? order - : nextOrder; -} -function distanceToBox(point, box) { - const x = Math.max(box.x.min - point.x, 0, point.x - box.x.max); - const y = Math.max(box.y.min - point.y, 0, point.y - box.y.max); - return x * x + y * y; -} - -const isSeparated = (a, b) => a.max <= b.min || b.max <= a.min; -function detectAxis(layouts) { - let x = false; - let y = false; - for (let i = 0; i < layouts.length; i++) { - for (let j = i + 1; j < layouts.length; j++) { - x || (x = isSeparated(layouts[i].x, layouts[j].x)); - y || (y = isSeparated(layouts[i].y, layouts[j].y)); - if (x && y) - return "xy"; - } - } - return x ? "x" : "y"; -} - -function ReorderGroupComponent({ children, as = "ul", axis: axisOverride, onReorder, values, ...props }, externalRef) { - const Component = index.useConstant(() => motion[as]); - const itemLayouts = React.useRef(new Map()); - const [detectedAxis, setDetectedAxis] = React.useState("y"); - const isReordering = React.useRef(false); - const groupRef = React.useRef(null); - const axis = axisOverride || detectedAxis; - motionUtils.invariant(Boolean(values), "Reorder.Group must be provided a values prop", "reorder-values"); - const valuesSet = new Set(values); - itemLayouts.current.forEach((_, value) => { - if (!valuesSet.has(value)) - itemLayouts.current.delete(value); - }); - const context = { - axis, - groupRef, - registerItem: (value, layout) => { - itemLayouts.current.set(value, layout); - if (!axisOverride) { - const nextAxis = detectAxis(values.flatMap((itemValue) => { - const itemLayout = itemLayouts.current.get(itemValue); - return itemLayout ? [itemLayout] : []; - })); - if (nextAxis !== detectedAxis) - setDetectedAxis(nextAxis); - } - }, - updateOrder: (item, offset, velocity) => { - if (isReordering.current) - return; - const order = values.flatMap((value) => { - const layout = itemLayouts.current.get(value); - return layout ? [{ value, layout }] : []; - }); - const direction = groupRef.current?.ownerDocument.defaultView?.getComputedStyle(groupRef.current).direction === "rtl" - ? "rtl" - : "ltr"; - const newOrder = checkReorder(order, item, offset, velocity, axis, direction); - if (order !== newOrder) { - isReordering.current = true; - const newValues = [...values]; - const measuredIndexes = order.map(({ value }) => values.indexOf(value)); - newOrder.forEach(({ value }, index) => { - newValues[measuredIndexes[index]] = value; - }); - onReorder(newValues); - } - }, - }; - React.useEffect(() => { - isReordering.current = false; - }); - // Combine refs if external ref is provided - const setRef = (element) => { - groupRef.current = element; - if (typeof externalRef === "function") { - externalRef(element); - } - else if (externalRef) { - externalRef.current = - element; - } - }; - /** - * Disable browser scroll anchoring on the group container. - * When items reorder, scroll anchoring can cause the browser to adjust - * the scroll position, which interferes with drag position calculations. - */ - const groupStyle = { - overflowAnchor: "none", - ...props.style, - }; - return (jsxRuntime.jsx(Component, { ...props, style: groupStyle, ref: setRef, ignoreStrict: true, children: jsxRuntime.jsx(ReorderContext.Provider, { value: context, children: children }) })); -} -const ReorderGroup = /*@__PURE__*/ React.forwardRef(ReorderGroupComponent); - -/** - * Creates a `MotionValue` to track the state and velocity of a value. - * - * Usually, these are created automatically. For advanced use-cases, like use with `useTransform`, you can create `MotionValue`s externally and pass them into the animated component via the `style` prop. - * - * ```jsx - * export const MyComponent = () => { - * const scale = useMotionValue(1) - * - * return - * } - * ``` - * - * @param initial - The initial state. - * - * @public - */ -function useMotionValue(initial) { - const value = index.useConstant(() => motionDom.motionValue(initial)); - /** - * If this motion value is being used in static mode, like on - * the Framer canvas, force components to rerender when the motion - * value is updated. - */ - const { isStatic } = React.useContext(index.MotionConfigContext); - if (isStatic) { - const [, setLatest] = React.useState(initial); - React.useEffect(() => value.on("change", setLatest), []); - } - return value; -} - -function useCombineMotionValues(values, combineValues) { - /** - * Initialise the returned motion value. This remains the same between renders. - */ - const value = useMotionValue(combineValues()); - /** - * Create a function that will update the template motion value with the latest values. - * This is pre-bound so whenever a motion value updates it can schedule its - * execution in Framesync. If it's already been scheduled it won't be fired twice - * in a single frame. - */ - const updateValue = () => value.set(combineValues()); - /** - * Synchronously update the motion value with the latest values during the render. - * This ensures that within a React render, the styles applied to the DOM are up-to-date. - */ - updateValue(); - /** - * Subscribe to all motion values found within the template. Whenever any of them change, - * schedule an update. - */ - index.useIsomorphicLayoutEffect(() => { - const scheduleUpdate = () => motionDom.frame.preRender(updateValue, false, true); - const subscriptions = values.map((v) => v.on("change", scheduleUpdate)); - return () => { - subscriptions.forEach((unsubscribe) => unsubscribe()); - motionDom.cancelFrame(updateValue); - }; - }); - return value; -} - -function useComputed(compute) { - /** - * Open session of collectMotionValues. Any MotionValue that calls get() - * will be saved into this array. - */ - motionDom.collectMotionValues.current = []; - compute(); - const value = useCombineMotionValues(motionDom.collectMotionValues.current, compute); - /** - * Synchronously close session of collectMotionValues. - */ - motionDom.collectMotionValues.current = undefined; - return value; -} - -function useTransform(input, inputRangeOrTransformer, outputRangeOrMap, options) { - if (typeof input === "function") { - return useComputed(input); - } - /** - * Detect if outputRangeOrMap is an output map (object with keys) - * rather than an output range (array). - */ - const isOutputMap = outputRangeOrMap !== undefined && - !Array.isArray(outputRangeOrMap) && - typeof inputRangeOrTransformer !== "function"; - if (isOutputMap) { - return useMapTransform(input, inputRangeOrTransformer, outputRangeOrMap, options); - } - const outputRange = outputRangeOrMap; - const transformer = typeof inputRangeOrTransformer === "function" - ? inputRangeOrTransformer - : motionDom.transform(inputRangeOrTransformer, outputRange, options); - const result = Array.isArray(input) - ? useListTransform(input, transformer) - : useListTransform([input], ([latest]) => transformer(latest)); - const inputAccelerate = !Array.isArray(input) - ? input.accelerate - : undefined; - if (inputAccelerate && - !inputAccelerate.isTransformed && - typeof inputRangeOrTransformer !== "function" && - Array.isArray(outputRangeOrMap) && - options?.clamp !== false) { - result.accelerate = { - ...inputAccelerate, - times: inputRangeOrTransformer, - keyframes: outputRangeOrMap, - isTransformed: true, - ...(options?.ease ? { ease: options.ease } : {}), - }; - } - return result; -} -function useListTransform(values, transformer) { - const latest = index.useConstant(() => []); - return useCombineMotionValues(values, () => { - latest.length = 0; - const numValues = values.length; - for (let i = 0; i < numValues; i++) { - latest[i] = values[i].get(); - } - return transformer(latest); - }); -} -function useMapTransform(inputValue, inputRange, outputMap, options) { - /** - * Capture keys once to ensure hooks are called in consistent order. - */ - const keys = index.useConstant(() => Object.keys(outputMap)); - const output = index.useConstant(() => ({})); - for (const key of keys) { - output[key] = useTransform(inputValue, inputRange, outputMap[key], options); - } - return output; -} - -const threshold = 50; -const maxSpeed = 25; -const overflowStyles = new Set(["auto", "scroll"]); -// Track initial scroll limits per scrollable element (Bug 1 fix) -const initialScrollLimits = new WeakMap(); -const activeScrollEdge = new WeakMap(); -// Track which group element is currently dragging to clear state on end -let currentGroupElement = null; -function resetAutoScrollState() { - if (currentGroupElement) { - const scrollableAncestor = findScrollableAncestor(currentGroupElement, "y"); - if (scrollableAncestor) { - activeScrollEdge.delete(scrollableAncestor); - initialScrollLimits.delete(scrollableAncestor); - } - // Also try x axis - const scrollableAncestorX = findScrollableAncestor(currentGroupElement, "x"); - if (scrollableAncestorX && scrollableAncestorX !== scrollableAncestor) { - activeScrollEdge.delete(scrollableAncestorX); - initialScrollLimits.delete(scrollableAncestorX); - } - currentGroupElement = null; - } -} -function isScrollableElement(element, axis) { - const style = getComputedStyle(element); - const overflow = axis === "x" ? style.overflowX : style.overflowY; - const isDocumentScroll = element === document.body || - element === document.documentElement; - return overflowStyles.has(overflow) || isDocumentScroll; -} -function findScrollableAncestor(element, axis) { - let current = element?.parentElement; - while (current) { - if (isScrollableElement(current, axis)) { - return current; - } - current = current.parentElement; - } - return null; -} -function getScrollAmount(pointerPosition, scrollElement, axis) { - const rect = scrollElement.getBoundingClientRect(); - const start = axis === "x" ? Math.max(0, rect.left) : Math.max(0, rect.top); - const end = axis === "x" ? Math.min(window.innerWidth, rect.right) : Math.min(window.innerHeight, rect.bottom); - const distanceFromStart = pointerPosition - start; - const distanceFromEnd = end - pointerPosition; - if (distanceFromStart < threshold) { - const intensity = 1 - distanceFromStart / threshold; - return { amount: -maxSpeed * intensity * intensity, edge: "start" }; - } - else if (distanceFromEnd < threshold) { - const intensity = 1 - distanceFromEnd / threshold; - return { amount: maxSpeed * intensity * intensity, edge: "end" }; - } - return { amount: 0, edge: null }; -} -function autoScrollIfNeeded(groupElement, pointerPosition, axis, velocity) { - if (!groupElement) - return; - // Track the group element for cleanup - currentGroupElement = groupElement; - const scrollableAncestor = findScrollableAncestor(groupElement, axis); - if (!scrollableAncestor) - return; - // Convert pointer position from page coordinates to viewport coordinates. - // The gesture system uses pageX/pageY but getBoundingClientRect() returns - // viewport-relative coordinates, so we need to account for page scroll. - const viewportPointerPosition = pointerPosition - (axis === "x" ? window.scrollX : window.scrollY); - const { amount: scrollAmount, edge } = getScrollAmount(viewportPointerPosition, scrollableAncestor, axis); - // If not in any threshold zone, clear all state - if (edge === null) { - activeScrollEdge.delete(scrollableAncestor); - initialScrollLimits.delete(scrollableAncestor); - return; - } - const currentActiveEdge = activeScrollEdge.get(scrollableAncestor); - const isDocumentScroll = scrollableAncestor === document.body || - scrollableAncestor === document.documentElement; - // If not currently scrolling this edge, check velocity to see if we should start - if (currentActiveEdge !== edge) { - // Only start scrolling if velocity is towards the edge - const shouldStart = (edge === "start" && velocity < 0) || - (edge === "end" && velocity > 0); - if (!shouldStart) - return; - // Activate this edge - activeScrollEdge.set(scrollableAncestor, edge); - // Record initial scroll limit (prevents infinite scroll) - const maxScroll = axis === "x" - ? scrollableAncestor.scrollWidth - (isDocumentScroll ? window.innerWidth : scrollableAncestor.clientWidth) - : scrollableAncestor.scrollHeight - (isDocumentScroll ? window.innerHeight : scrollableAncestor.clientHeight); - initialScrollLimits.set(scrollableAncestor, maxScroll); - } - // Cap scrolling at initial limit (prevents infinite scroll) - if (scrollAmount > 0) { - const initialLimit = initialScrollLimits.get(scrollableAncestor); - const currentScroll = axis === "x" - ? (isDocumentScroll ? window.scrollX : scrollableAncestor.scrollLeft) - : (isDocumentScroll ? window.scrollY : scrollableAncestor.scrollTop); - if (currentScroll >= initialLimit) - return; - } - // Apply scroll - if (axis === "x") { - if (isDocumentScroll) { - window.scrollBy({ left: scrollAmount }); - } - else { - scrollableAncestor.scrollLeft += scrollAmount; - } - } - else { - if (isDocumentScroll) { - window.scrollBy({ top: scrollAmount }); - } - else { - scrollableAncestor.scrollTop += scrollAmount; - } - } -} - -function useDefaultMotionValue(value, defaultValue = 0) { - return motionDom.isMotionValue(value) ? value : useMotionValue(defaultValue); -} -function ReorderItemComponent({ children, style = {}, value, as = "li", onDrag, onDragEnd, layout = true, ...props }, externalRef) { - const Component = index.useConstant(() => motion[as]); - const context = React.useContext(ReorderContext); - const point = { - x: useDefaultMotionValue(style.x), - y: useDefaultMotionValue(style.y), - }; - const zIndex = useTransform([point.x, point.y], ([latestX, latestY]) => latestX || latestY ? 1 : "unset"); - motionUtils.invariant(Boolean(context), "Reorder.Item must be a child of Reorder.Group", "reorder-item-child"); - const { axis, registerItem, updateOrder, groupRef } = context; - const dragAxis = axis === "xy" ? true : axis; - return (jsxRuntime.jsx(Component, { drag: dragAxis, ...props, dragSnapToOrigin: true, style: { ...style, x: point.x, y: point.y, zIndex }, layout: layout, onDrag: (event, gesturePoint) => { - const { velocity, point: pointerPoint } = gesturePoint; - const offset = { x: point.x.get(), y: point.y.get() }; - updateOrder(value, offset, velocity); - const scrollAxis = axis === "xy" - ? Math.abs(velocity.x) > Math.abs(velocity.y) - ? "x" - : "y" - : axis; - autoScrollIfNeeded(groupRef.current, pointerPoint[scrollAxis], scrollAxis, velocity[scrollAxis]); - onDrag && onDrag(event, gesturePoint); - }, onDragEnd: (event, gesturePoint) => { - resetAutoScrollState(); - onDragEnd && onDragEnd(event, gesturePoint); - }, onLayoutMeasure: (measured) => { - registerItem(value, measured); - }, ref: externalRef, ignoreStrict: true, children: children })); -} -const ReorderItem = /*@__PURE__*/ React.forwardRef(ReorderItemComponent); - -var namespace = /*#__PURE__*/Object.freeze({ - __proto__: null, - Group: ReorderGroup, - Item: ReorderItem -}); - -function isDOMKeyframes(keyframes) { - return typeof keyframes === "object" && !Array.isArray(keyframes); -} - -function resolveSubjects(subject, keyframes, scope, selectorCache) { - if (subject == null) { - return []; - } - if (typeof subject === "string" && isDOMKeyframes(keyframes)) { - return motionDom.resolveElements(subject, scope, selectorCache); - } - else if (subject instanceof NodeList) { - return Array.from(subject); - } - else if (Array.isArray(subject)) { - return subject.filter((s) => s != null); - } - else { - return [subject]; - } -} - -function calculateRepeatDuration(duration, repeat, repeatDelay) { - return duration * (repeat + 1) + repeatDelay * repeat; -} - -/** - * Given a absolute or relative time definition and current/prev time state of the sequence, - * calculate an absolute time for the next keyframes. - */ -function calcNextTime(current, next, prev, labels) { - if (typeof next === "number") { - return next; - } - else if (next.startsWith("-") || next.startsWith("+")) { - return Math.max(0, current + parseFloat(next)); - } - else if (next === "<") { - return prev; - } - else if (next.startsWith("<")) { - return Math.max(0, prev + parseFloat(next.slice(1))); - } - else { - return labels.get(next) ?? current; - } -} - -function eraseKeyframes(sequence, startTime, endTime) { - for (let i = 0; i < sequence.length; i++) { - const keyframe = sequence[i]; - if (keyframe.at > startTime && keyframe.at < endTime) { - motionUtils.removeItem(sequence, keyframe); - // If we remove this item we have to push the pointer back one - i--; - } - } -} -function addKeyframes(sequence, keyframes, easing, offset, startTime, endTime) { - /** - * Erase every existing value between currentTime and targetTime, - * this will essentially splice this timeline into any currently - * defined ones. - */ - eraseKeyframes(sequence, startTime, endTime); - for (let i = 0; i < keyframes.length; i++) { - sequence.push({ - value: keyframes[i], - at: motionDom.mixNumber(startTime, endTime, offset[i]), - easing: motionUtils.getEasingForSegment(easing, i), - }); - } -} - -/** - * Take an array of times that represent repeated keyframes. For instance - * if we have original times of [0, 0.5, 1] then our repeated times will - * be [0, 0.5, 1, 1, 1.5, 2]. Loop over the times and scale them back - * down to a 0-1 scale. - * - * `repeatDelayUnits` is the repeatDelay expressed in units of a single - * iteration's duration, so the total span equals `(repeat + 1) + repeat * repeatDelayUnits`. - */ -function normalizeTimes(times, repeat, repeatDelayUnits = 0) { - const totalUnits = repeat + 1 + repeat * repeatDelayUnits; - for (let i = 0; i < times.length; i++) { - times[i] = times[i] / totalUnits; - } -} - -function compareByTime(a, b) { - if (a.at === b.at) { - if (a.value === null) - return 1; - if (b.value === null) - return -1; - return 0; - } - else { - return a.at - b.at; - } -} - -const defaultSegmentEasing = "easeInOut"; -const MAX_REPEAT = 20; -function createAnimationsFromSequence(sequence, { defaultTransition = {}, ...sequenceTransition } = {}, scope, generators) { - const defaultDuration = defaultTransition.duration || 0.3; - const animationDefinitions = new Map(); - const sequences = new Map(); - const elementCache = {}; - const timeLabels = new Map(); - let prevTime = 0; - let currentTime = 0; - let totalDuration = 0; - /** - * Build the timeline by mapping over the sequence array and converting - * the definitions into keyframes and offsets with absolute time values. - * These will later get converted into relative offsets in a second pass. - */ - for (let i = 0; i < sequence.length; i++) { - const segment = sequence[i]; - /** - * If this is a timeline label, mark it and skip the rest of this iteration. - */ - if (typeof segment === "string") { - timeLabels.set(segment, currentTime); - continue; - } - else if (!Array.isArray(segment)) { - timeLabels.set(segment.name, calcNextTime(currentTime, segment.at, prevTime, timeLabels)); - continue; - } - let [subject, keyframes, transition = {}] = segment; - /** - * If a relative or absolute time value has been specified we need to resolve - * it in relation to the currentTime. - */ - if (transition.at !== undefined) { - currentTime = calcNextTime(currentTime, transition.at, prevTime, timeLabels); - } - /** - * Keep track of the maximum duration in this definition. This will be - * applied to currentTime once the definition has been parsed. - */ - let maxDuration = 0; - const resolveValueSequence = (valueKeyframes, valueTransition, valueSequence, elementIndex = 0, numSubjects = 0) => { - const valueKeyframesAsList = keyframesAsList(valueKeyframes); - const { delay = 0, times = motionDom.defaultOffset(valueKeyframesAsList), type = defaultTransition.type || "keyframes", repeat, repeatType, repeatDelay = 0, ...remainingTransition } = valueTransition; - let { ease = defaultTransition.ease || "easeOut", duration } = valueTransition; - /** - * Resolve stagger() if defined. - */ - const calculatedDelay = typeof delay === "function" - ? delay(elementIndex, numSubjects) - : delay; - /** - * If this animation should and can use a spring, generate a spring easing function. - */ - const numKeyframes = valueKeyframesAsList.length; - const createGenerator = motionDom.isGenerator(type) - ? type - : generators?.[type || "keyframes"]; - if (numKeyframes <= 2 && createGenerator) { - /** - * As we're creating an easing function from a spring, - * ideally we want to generate it using the real distance - * between the two keyframes. However this isn't always - * possible - in these situations we use 0-100. - */ - let absoluteDelta = 100; - if (numKeyframes === 2 && - isNumberKeyframesArray(valueKeyframesAsList)) { - const delta = valueKeyframesAsList[1] - valueKeyframesAsList[0]; - absoluteDelta = Math.abs(delta); - } - const springTransition = { - ...defaultTransition, - ...remainingTransition, - }; - if (duration !== undefined) { - springTransition.duration = motionUtils.secondsToMilliseconds(duration); - } - const springEasing = motionDom.createGeneratorEasing(springTransition, absoluteDelta, createGenerator); - ease = springEasing.ease; - duration = springEasing.duration; - } - duration ?? (duration = defaultDuration); - const startTime = currentTime + calculatedDelay; - /** - * If there's only one time offset of 0, fill in a second with length 1 - */ - if (times.length === 1 && times[0] === 0) { - times[1] = 1; - } - /** - * Fill out if offset if fewer offsets than keyframes - */ - const remainder = times.length - valueKeyframesAsList.length; - remainder > 0 && motionDom.fillOffset(times, remainder); - /** - * If only one value has been set, ie [1], push a null to the start of - * the keyframe array. This will let us mark a keyframe at this point - * that will later be hydrated with the previous value. - */ - valueKeyframesAsList.length === 1 && - valueKeyframesAsList.unshift(null); - /** - * Segments can't express `repeat: Infinity` or very large - * counts — they'd leave dead time after the segment or - * explode the keyframe array. Ignore with a warning. - */ - if (repeat) { - motionUtils.warning(repeat < MAX_REPEAT, `Sequence segments can't repeat ${repeat} times — ignoring repeat option. Use a value below ${MAX_REPEAT} or apply repeat at the sequence level instead.`); - } - if (repeat && repeat < MAX_REPEAT) { - /** - * Express repeatDelay in units of a single iteration's duration - * so it can be added to the per-iteration time offsets below - * before they're normalized to 0-1. - */ - const repeatDelayUnits = duration > 0 ? repeatDelay / duration : 0; - duration = calculateRepeatDuration(duration, repeat, repeatDelay); - const originalKeyframes = [...valueKeyframesAsList]; - const originalTimes = [...times]; - ease = Array.isArray(ease) ? [...ease] : [ease]; - const originalEase = [...ease]; - /** - * For reverse/mirror, alternate iterations play the segment - * backwards. mirror matches JSAnimation's mirroredGenerator: - * reversed keyframes, easings unchanged. reverse matches - * JSAnimation's iterationProgress = 1 - p: reversed - * keyframes, easing array reversed AND each function easing - * mapped through reverseEasing (string easings unchanged — - * they're resolved later by the keyframes engine). - */ - const isFlipping = repeatType === "reverse" || repeatType === "mirror"; - let flippedKeyframes = originalKeyframes; - let flippedEases = originalEase; - if (isFlipping) { - flippedKeyframes = [...originalKeyframes].reverse(); - if (repeatType === "reverse") { - flippedEases = [...originalEase] - .reverse() - .map((e) => typeof e === "function" - ? motionUtils.reverseEasing(e) - : e); - } - } - for (let repeatIndex = 0; repeatIndex < repeat; repeatIndex++) { - const isFlipped = isFlipping && repeatIndex % 2 === 0; - const iterKeyframes = isFlipped - ? flippedKeyframes - : originalKeyframes; - const iterEase = isFlipped ? flippedEases : originalEase; - const iterStartOffset = (repeatIndex + 1) * (1 + repeatDelayUnits); - /** - * If repeatDelay is set, hold the previous iteration's - * final value through the delay by inserting a keyframe - * at the moment the next iteration begins. - */ - if (repeatDelayUnits > 0) { - valueKeyframesAsList.push(valueKeyframesAsList[valueKeyframesAsList.length - 1]); - times.push(iterStartOffset); - ease.push("linear"); - } - valueKeyframesAsList.push(...iterKeyframes); - for (let keyframeIndex = 0; keyframeIndex < iterKeyframes.length; keyframeIndex++) { - times.push(originalTimes[keyframeIndex] + iterStartOffset); - ease.push(keyframeIndex === 0 - ? "linear" - : motionUtils.getEasingForSegment(iterEase, keyframeIndex - 1)); - } - } - normalizeTimes(times, repeat, repeatDelayUnits); - } - const targetTime = startTime + duration; - /** - * Add keyframes, mapping offsets to absolute time. - */ - addKeyframes(valueSequence, valueKeyframesAsList, ease, times, startTime, targetTime); - maxDuration = Math.max(calculatedDelay + duration, maxDuration); - totalDuration = Math.max(targetTime, totalDuration); - }; - if (motionDom.isMotionValue(subject)) { - const subjectSequence = getSubjectSequence(subject, sequences); - resolveValueSequence(keyframes, transition, getValueSequence("default", subjectSequence)); - } - else { - const subjects = resolveSubjects(subject, keyframes, scope, elementCache); - const numSubjects = subjects.length; - /** - * For every element in this segment, process the defined values. - */ - for (let subjectIndex = 0; subjectIndex < numSubjects; subjectIndex++) { - /** - * Cast necessary, but we know these are of this type - */ - keyframes = keyframes; - transition = transition; - const thisSubject = subjects[subjectIndex]; - const subjectSequence = getSubjectSequence(thisSubject, sequences); - for (const key in keyframes) { - resolveValueSequence(keyframes[key], getValueTransition(transition, key), getValueSequence(key, subjectSequence), subjectIndex, numSubjects); - } - } - } - prevTime = currentTime; - currentTime += maxDuration; - } - /** - * For every element and value combination create a new animation. - */ - sequences.forEach((valueSequences, element) => { - for (const key in valueSequences) { - const valueSequence = valueSequences[key]; - /** - * Arrange all the keyframes in ascending time order. - */ - valueSequence.sort(compareByTime); - const keyframes = []; - const valueOffset = []; - const valueEasing = []; - /** - * For each keyframe, translate absolute times into - * relative offsets based on the total duration of the timeline. - */ - for (let i = 0; i < valueSequence.length; i++) { - const { at, value, easing } = valueSequence[i]; - keyframes.push(value); - valueOffset.push(motionUtils.progress(0, totalDuration, at)); - valueEasing.push(easing || "easeOut"); - } - /** - * If the first keyframe doesn't land on offset: 0 - * provide one by duplicating the initial keyframe. This ensures - * it snaps to the first keyframe when the animation starts. - */ - if (valueOffset[0] !== 0) { - valueOffset.unshift(0); - keyframes.unshift(keyframes[0]); - valueEasing.unshift(defaultSegmentEasing); - } - /** - * If the last keyframe doesn't land on offset: 1 - * provide one with a null wildcard value. This will ensure it - * stays static until the end of the animation. - */ - if (valueOffset[valueOffset.length - 1] !== 1) { - valueOffset.push(1); - keyframes.push(null); - } - if (!animationDefinitions.has(element)) { - animationDefinitions.set(element, { - keyframes: {}, - transition: {}, - }); - } - const definition = animationDefinitions.get(element); - definition.keyframes[key] = keyframes; - /** - * Exclude `type` from defaultTransition since springs have been - * converted to duration-based easing functions in resolveValueSequence. - * Including `type: "spring"` would cause JSAnimation to error when - * the merged keyframes array has more than 2 keyframes. - */ - const { type: _type, ...remainingDefaultTransition } = defaultTransition; - definition.transition[key] = { - ...remainingDefaultTransition, - duration: totalDuration, - ease: valueEasing, - times: valueOffset, - ...sequenceTransition, - }; - } - }); - return animationDefinitions; -} -function getSubjectSequence(subject, sequences) { - !sequences.has(subject) && sequences.set(subject, {}); - return sequences.get(subject); -} -function getValueSequence(name, sequences) { - if (!sequences[name]) - sequences[name] = []; - return sequences[name]; -} -function keyframesAsList(keyframes) { - return Array.isArray(keyframes) ? keyframes : [keyframes]; -} -function getValueTransition(transition, key) { - return transition && transition[key] - ? { - ...transition, - ...transition[key], - } - : { ...transition }; -} -const isNumber = (keyframe) => typeof keyframe === "number"; -const isNumberKeyframesArray = (keyframes) => keyframes.every(isNumber); - -function createDOMVisualElement(element) { - const options = { - presenceContext: null, - props: {}, - visualState: { - renderState: { - transform: {}, - transformOrigin: {}, - style: {}, - vars: {}, - attrs: {}, - }, - latestValues: {}, - }, - }; - const node = motionDom.isSVGElement(element) && !motionDom.isSVGSVGElement(element) - ? new motionDom.SVGVisualElement(options) - : new motionDom.HTMLVisualElement(options); - node.mount(element); - motionDom.visualElementStore.set(element, node); -} -function createObjectVisualElement(subject) { - const options = { - presenceContext: null, - props: {}, - visualState: { - renderState: { - output: {}, - }, - latestValues: {}, - }, - }; - const node = new motionDom.ObjectVisualElement(options); - node.mount(subject); - motionDom.visualElementStore.set(subject, node); -} - -function isSingleValue(subject, keyframes) { - return (motionDom.isMotionValue(subject) || - typeof subject === "number" || - (typeof subject === "string" && !isDOMKeyframes(keyframes))); -} -/** - * Implementation - */ -function animateSubject(subject, keyframes, options, scope) { - const animations = []; - if (isSingleValue(subject, keyframes)) { - animations.push(motionDom.animateSingleValue(subject, isDOMKeyframes(keyframes) - ? keyframes.default || keyframes - : keyframes, options ? options.default || options : options)); - } - else { - // Gracefully handle null/undefined subjects (e.g., from querySelector returning null) - if (subject == null) { - return animations; - } - const subjects = resolveSubjects(subject, keyframes, scope); - const numSubjects = subjects.length; - motionUtils.invariant(Boolean(numSubjects), "No valid elements provided.", "no-valid-elements"); - for (let i = 0; i < numSubjects; i++) { - const thisSubject = subjects[i]; - const createVisualElement = thisSubject instanceof Element - ? createDOMVisualElement - : createObjectVisualElement; - if (!motionDom.visualElementStore.has(thisSubject)) { - createVisualElement(thisSubject); - } - const visualElement = motionDom.visualElementStore.get(thisSubject); - const transition = { ...options }; - /** - * Resolve stagger function if provided. - */ - if ("delay" in transition && - typeof transition.delay === "function") { - transition.delay = transition.delay(i, numSubjects); - } - animations.push(...motionDom.animateTarget(visualElement, { ...keyframes, transition }, {})); - } - } - return animations; -} - -function animateSequence(sequence, options, scope) { - const animations = []; - /** - * Pre-process: replace function segments with MotionValue segments, - * subscribe callbacks immediately - */ - const processedSequence = sequence.map((segment) => { - if (Array.isArray(segment) && typeof segment[0] === "function") { - const callback = segment[0]; - const mv = motionDom.motionValue(0); - mv.on("change", callback); - if (segment.length === 1) { - return [mv, [0, 1]]; - } - else if (segment.length === 2) { - return [mv, [0, 1], segment[1]]; - } - else { - return [mv, segment[1], segment[2]]; - } - } - return segment; - }); - const animationDefinitions = createAnimationsFromSequence(processedSequence, options, scope, { spring: motionDom.spring }); - animationDefinitions.forEach(({ keyframes, transition }, subject) => { - animations.push(...animateSubject(subject, keyframes, transition)); - }); - return animations; -} - -function isSequence(value) { - return Array.isArray(value) && value.some(Array.isArray); -} -/** - * Creates an animation function that is optionally scoped - * to a specific element. - */ -function createScopedAnimate(options = {}) { - const { scope, reduceMotion, skipAnimations } = options; - /** - * Implementation - */ - function scopedAnimate(subjectOrSequence, optionsOrKeyframes, options) { - let animations = []; - let animationOnComplete; - const inherited = {}; - if (reduceMotion !== undefined) - inherited.reduceMotion = reduceMotion; - if (skipAnimations !== undefined) - inherited.skipAnimations = skipAnimations; - if (isSequence(subjectOrSequence)) { - const { onComplete, ...sequenceOptions } = optionsOrKeyframes || {}; - if (typeof onComplete === "function") { - animationOnComplete = onComplete; - } - animations = animateSequence(subjectOrSequence, { ...inherited, ...sequenceOptions }, scope); - } - else { - // Extract top-level onComplete so it doesn't get applied per-value - const { onComplete, ...rest } = options || {}; - if (typeof onComplete === "function") { - animationOnComplete = onComplete; - } - animations = animateSubject(subjectOrSequence, optionsOrKeyframes, { ...inherited, ...rest }, scope); - } - const animation = new motionDom.GroupAnimationWithThen(animations); - if (animationOnComplete) { - animation.finished.then(animationOnComplete); - } - if (scope) { - scope.animations.push(animation); - animation.finished.then(() => { - motionUtils.removeItem(scope.animations, animation); - }); - } - return animation; - } - return scopedAnimate; -} -const animate = createScopedAnimate(); - -function animateElements(elementOrSelector, keyframes, options, scope) { - // Gracefully handle null/undefined elements (e.g., from querySelector returning null) - if (elementOrSelector == null) { - return []; - } - const elements = motionDom.resolveElements(elementOrSelector, scope); - const numElements = elements.length; - motionUtils.invariant(Boolean(numElements), "No valid elements provided.", "no-valid-elements"); - /** - * WAAPI doesn't support interrupting animations. - * - * Therefore, starting animations requires a three-step process: - * 1. Stop existing animations (write styles to DOM) - * 2. Resolve keyframes (read styles from DOM) - * 3. Create new animations (write styles to DOM) - * - * The hybrid `animate()` function uses AsyncAnimation to resolve - * keyframes before creating new animations, which removes style - * thrashing. Here, we have much stricter filesize constraints. - * Therefore we do this in a synchronous way that ensures that - * at least within `animate()` calls there is no style thrashing. - * - * In the motion-native-animate-mini-interrupt benchmark this - * was 80% faster than a single loop. - */ - const animationDefinitions = []; - /** - * Step 1: Build options and stop existing animations (write) - */ - for (let i = 0; i < numElements; i++) { - const element = elements[i]; - const elementTransition = { ...options }; - /** - * Resolve stagger function if provided. - */ - if (typeof elementTransition.delay === "function") { - elementTransition.delay = elementTransition.delay(i, numElements); - } - for (const valueName in keyframes) { - let valueKeyframes = keyframes[valueName]; - if (!Array.isArray(valueKeyframes)) { - valueKeyframes = [valueKeyframes]; - } - const valueOptions = { - ...motionDom.getValueTransition(elementTransition, valueName), - }; - valueOptions.duration && (valueOptions.duration = motionUtils.secondsToMilliseconds(valueOptions.duration)); - valueOptions.delay && (valueOptions.delay = motionUtils.secondsToMilliseconds(valueOptions.delay)); - /** - * If there's an existing animation playing on this element then stop it - * before creating a new one. - */ - const map = motionDom.getAnimationMap(element); - const key = motionDom.animationMapKey(valueName, valueOptions.pseudoElement || ""); - const currentAnimation = map.get(key); - currentAnimation && currentAnimation.stop(); - animationDefinitions.push({ - map, - key, - unresolvedKeyframes: valueKeyframes, - options: { - ...valueOptions, - element, - name: valueName, - allowFlatten: !elementTransition.type && !elementTransition.ease, - }, - }); - } - } - /** - * Step 2: Resolve keyframes (read) - */ - for (let i = 0; i < animationDefinitions.length; i++) { - const { unresolvedKeyframes, options: animationOptions } = animationDefinitions[i]; - const { element, name, pseudoElement } = animationOptions; - if (!pseudoElement && unresolvedKeyframes[0] === null) { - unresolvedKeyframes[0] = motionDom.getComputedStyle(element, name); - } - motionDom.fillWildcards(unresolvedKeyframes); - motionDom.applyPxDefaults(unresolvedKeyframes, name); - /** - * If we only have one keyframe, explicitly read the initial keyframe - * from the computed style. This is to ensure consistency with WAAPI behaviour - * for restarting animations, for instance .play() after finish, when it - * has one vs two keyframes. - */ - if (!pseudoElement && unresolvedKeyframes.length < 2) { - unresolvedKeyframes.unshift(motionDom.getComputedStyle(element, name)); - } - animationOptions.keyframes = unresolvedKeyframes; - } - /** - * Step 3: Create new animations (write) - */ - const animations = []; - for (let i = 0; i < animationDefinitions.length; i++) { - const { map, key, options: animationOptions } = animationDefinitions[i]; - const animation = new motionDom.NativeAnimation(animationOptions); - map.set(key, animation); - animation.finished.finally(() => map.delete(key)); - animations.push(animation); - } - return animations; -} - -const createScopedWaapiAnimate = (scope) => { - function scopedAnimate(elementOrSelector, keyframes, options) { - return new motionDom.GroupAnimationWithThen(animateElements(elementOrSelector, keyframes, options, scope)); - } - return scopedAnimate; -}; -const animateMini = /*@__PURE__*/ createScopedWaapiAnimate(); - -function canUseNativeTimeline(target) { - if (typeof window === "undefined") - return false; - return target ? motionDom.supportsViewTimeline() : motionDom.supportsScrollTimeline(); -} - -/** - * A time in milliseconds, beyond which we consider the scroll velocity to be 0. - */ -const maxElapsed = 50; -const createAxisInfo = () => ({ - current: 0, - offset: [], - progress: 0, - scrollLength: 0, - targetOffset: 0, - targetLength: 0, - containerLength: 0, - velocity: 0, -}); -const createScrollInfo = () => ({ - time: 0, - x: createAxisInfo(), - y: createAxisInfo(), -}); -const keys = { - x: { - length: "Width", - position: "Left", - }, - y: { - length: "Height", - position: "Top", - }, -}; -function updateAxisInfo(element, axisName, info, time) { - const axis = info[axisName]; - const { length, position } = keys[axisName]; - const prev = axis.current; - const prevTime = info.time; - axis.current = Math.abs(element[`scroll${position}`]); - axis.scrollLength = element[`scroll${length}`] - element[`client${length}`]; - axis.offset.length = 0; - axis.offset[0] = 0; - axis.offset[1] = axis.scrollLength; - axis.progress = motionUtils.progress(0, axis.scrollLength, axis.current); - const elapsed = time - prevTime; - axis.velocity = - elapsed > maxElapsed - ? 0 - : motionUtils.velocityPerSecond(axis.current - prev, elapsed); -} -function updateScrollInfo(element, info, time) { - updateAxisInfo(element, "x", info, time); - updateAxisInfo(element, "y", info, time); - info.time = time; -} - -function calcInset(element, container) { - const inset = { x: 0, y: 0 }; - let current = element; - while (current && current !== container) { - if (motionDom.isHTMLElement(current)) { - inset.x += current.offsetLeft; - inset.y += current.offsetTop; - current = current.offsetParent; - } - else if (current.tagName === "svg") { - /** - * This isn't an ideal approach to measuring the offset of tags. - * It would be preferable, given they behave like HTMLElements in most ways - * to use offsetLeft/Top. But these don't exist on . Likewise we - * can't use .getBBox() like most SVG elements as these provide the offset - * relative to the SVG itself, which for is usually 0x0. - */ - const svgBoundingBox = current.getBoundingClientRect(); - current = current.parentElement; - const parentBoundingBox = current.getBoundingClientRect(); - inset.x += svgBoundingBox.left - parentBoundingBox.left; - inset.y += svgBoundingBox.top - parentBoundingBox.top; - } - else if (current instanceof SVGGraphicsElement) { - const { x, y } = current.getBBox(); - inset.x += x; - inset.y += y; - let svg = null; - let parent = current.parentNode; - while (!svg) { - if (parent.tagName === "svg") { - svg = parent; - } - parent = current.parentNode; - } - current = svg; - } - else { - break; - } - } - return inset; -} - -const namedEdges = { - start: 0, - center: 0.5, - end: 1, -}; -function resolveEdge(edge, length, inset = 0) { - let delta = 0; - /** - * If we have this edge defined as a preset, replace the definition - * with the numerical value. - */ - if (edge in namedEdges) { - edge = namedEdges[edge]; - } - /** - * Handle unit values - */ - if (typeof edge === "string") { - const asNumber = parseFloat(edge); - if (edge.endsWith("px")) { - delta = asNumber; - } - else if (edge.endsWith("%")) { - edge = asNumber / 100; - } - else if (edge.endsWith("vw")) { - delta = (asNumber / 100) * document.documentElement.clientWidth; - } - else if (edge.endsWith("vh")) { - delta = (asNumber / 100) * document.documentElement.clientHeight; - } - else { - edge = asNumber; - } - } - /** - * If the edge is defined as a number, handle as a progress value. - */ - if (typeof edge === "number") { - delta = length * edge; - } - return inset + delta; -} - -const defaultOffset = [0, 0]; -function resolveOffset(offset, containerLength, targetLength, targetInset) { - let offsetDefinition = Array.isArray(offset) ? offset : defaultOffset; - let targetPoint = 0; - let containerPoint = 0; - if (typeof offset === "number") { - /** - * If we're provided offset: [0, 0.5, 1] then each number x should become - * [x, x], so we default to the behaviour of mapping 0 => 0 of both target - * and container etc. - */ - offsetDefinition = [offset, offset]; - } - else if (typeof offset === "string") { - offset = offset.trim(); - if (offset.includes(" ")) { - offsetDefinition = offset.split(" "); - } - else { - /** - * If we're provided a definition like "100px" then we want to apply - * that only to the top of the target point, leaving the container at 0. - * Whereas a named offset like "end" should be applied to both. - */ - offsetDefinition = [offset, namedEdges[offset] ? offset : `0`]; - } - } - targetPoint = resolveEdge(offsetDefinition[0], targetLength, targetInset); - containerPoint = resolveEdge(offsetDefinition[1], containerLength); - return targetPoint - containerPoint; -} - -const ScrollOffset = { - Enter: [ - [0, 1], - [1, 1], - ], - Exit: [ - [0, 0], - [1, 0], - ], - Any: [ - [1, 0], - [0, 1], - ], - All: [ - [0, 0], - [1, 1], - ], -}; - -const point = { x: 0, y: 0 }; -function getTargetSize(target) { - return "getBBox" in target && target.tagName !== "svg" - ? target.getBBox() - : { width: target.clientWidth, height: target.clientHeight }; -} -function resolveOffsets(container, info, options) { - const { offset: offsetDefinition = ScrollOffset.All } = options; - const { target = container, axis = "y" } = options; - const lengthLabel = axis === "y" ? "height" : "width"; - const inset = target !== container ? calcInset(target, container) : point; - /** - * Measure the target and container. If they're the same thing then we - * use the container's scrollWidth/Height as the target, from there - * all other calculations can remain the same. - */ - const targetSize = target === container - ? { width: container.scrollWidth, height: container.scrollHeight } - : getTargetSize(target); - const containerSize = { - width: container.clientWidth, - height: container.clientHeight, - }; - /** - * Reset the length of the resolved offset array rather than creating a new one. - * TODO: More reusable data structures for targetSize/containerSize would also be good. - */ - info[axis].offset.length = 0; - /** - * Populate the offset array by resolving the user's offset definition into - * a list of pixel scroll offets. - */ - let hasChanged = !info[axis].interpolate; - const numOffsets = offsetDefinition.length; - for (let i = 0; i < numOffsets; i++) { - const offset = resolveOffset(offsetDefinition[i], containerSize[lengthLabel], targetSize[lengthLabel], inset[axis]); - if (!hasChanged && offset !== info[axis].interpolatorOffsets[i]) { - hasChanged = true; - } - info[axis].offset[i] = offset; - } - /** - * If the pixel scroll offsets have changed, create a new interpolator function - * to map scroll value into a progress. - */ - if (hasChanged) { - info[axis].interpolate = motionDom.interpolate(info[axis].offset, motionDom.defaultOffset(offsetDefinition), { clamp: false }); - info[axis].interpolatorOffsets = [...info[axis].offset]; - } - info[axis].progress = motionUtils.clamp(0, 1, info[axis].interpolate(info[axis].current)); -} - -function measure(container, target = container, info) { - /** - * Find inset of target within scrollable container - */ - info.x.targetOffset = 0; - info.y.targetOffset = 0; - if (target !== container) { - let node = target; - while (node && node !== container) { - info.x.targetOffset += node.offsetLeft; - info.y.targetOffset += node.offsetTop; - node = node.offsetParent; - } - } - info.x.targetLength = - target === container ? target.scrollWidth : target.clientWidth; - info.y.targetLength = - target === container ? target.scrollHeight : target.clientHeight; - info.x.containerLength = container.clientWidth; - info.y.containerLength = container.clientHeight; - /** - * In development mode ensure scroll containers aren't position: static as this makes - * it difficult to measure their relative positions. The document scrolling element - * is exempt: offsetParent measurements naturally resolve relative to the document. - */ - if (process.env.NODE_ENV !== "production") { - if (container && - target && - target !== container && - container !== document.documentElement && - container !== document.scrollingElement && - container !== document.body) { - motionUtils.warnOnce(getComputedStyle(container).position !== "static", "Please ensure that the container has a non-static position, like 'relative', 'fixed', or 'absolute' to ensure scroll offset is calculated correctly."); - } - } -} -function createOnScrollHandler(element, onScroll, info, options = {}) { - return { - measure: (time) => { - measure(element, options.target, info); - updateScrollInfo(element, info, time); - if (options.offset || options.target) { - resolveOffsets(element, info, options); - } - }, - notify: () => onScroll(info), - }; -} - -const scrollListeners = new WeakMap(); -const resizeListeners = new WeakMap(); -const onScrollHandlers = new WeakMap(); -const scrollSize = new WeakMap(); -const dimensionCheckProcesses = new WeakMap(); -const getEventTarget = (element) => element === document.scrollingElement ? window : element; -function scrollInfo(onScroll, { container = document.scrollingElement, trackContentSize = false, ...options } = {}) { - if (!container) - return motionUtils.noop; - let containerHandlers = onScrollHandlers.get(container); - /** - * Get the onScroll handlers for this container. - * If one isn't found, create a new one. - */ - if (!containerHandlers) { - containerHandlers = new Set(); - onScrollHandlers.set(container, containerHandlers); - } - /** - * Create a new onScroll handler for the provided callback. - */ - const info = createScrollInfo(); - const containerHandler = createOnScrollHandler(container, onScroll, info, options); - containerHandlers.add(containerHandler); - /** - * Check if there's a scroll event listener for this container. - * If not, create one. - */ - if (!scrollListeners.has(container)) { - const measureAll = () => { - for (const handler of containerHandlers) { - handler.measure(motionDom.frameData.timestamp); - } - motionDom.frame.preUpdate(notifyAll); - }; - const notifyAll = () => { - for (const handler of containerHandlers) { - handler.notify(); - } - }; - const listener = () => motionDom.frame.read(measureAll); - scrollListeners.set(container, listener); - const target = getEventTarget(container); - window.addEventListener("resize", listener); - if (container !== document.documentElement) { - resizeListeners.set(container, motionDom.resize(container, listener)); - } - target.addEventListener("scroll", listener); - listener(); - } - /** - * Enable content size tracking if requested and not already enabled. - */ - if (trackContentSize && !dimensionCheckProcesses.has(container)) { - const listener = scrollListeners.get(container); - // Store initial scroll dimensions (object is reused to avoid allocation) - const size = { - width: container.scrollWidth, - height: container.scrollHeight, - }; - scrollSize.set(container, size); - // Add frame-based scroll dimension checking to detect content changes - const checkScrollDimensions = () => { - const newWidth = container.scrollWidth; - const newHeight = container.scrollHeight; - if (size.width !== newWidth || size.height !== newHeight) { - listener(); - size.width = newWidth; - size.height = newHeight; - } - }; - // Schedule with keepAlive=true to run every frame - const dimensionCheckProcess = motionDom.frame.read(checkScrollDimensions, true); - dimensionCheckProcesses.set(container, dimensionCheckProcess); - } - const listener = scrollListeners.get(container); - motionDom.frame.read(listener, false, true); - return () => { - motionDom.cancelFrame(listener); - /** - * Check if we even have any handlers for this container. - */ - const currentHandlers = onScrollHandlers.get(container); - if (!currentHandlers) - return; - currentHandlers.delete(containerHandler); - if (currentHandlers.size) - return; - /** - * If no more handlers, remove the scroll listener too. - */ - const scrollListener = scrollListeners.get(container); - scrollListeners.delete(container); - if (scrollListener) { - getEventTarget(container).removeEventListener("scroll", scrollListener); - resizeListeners.get(container)?.(); - window.removeEventListener("resize", scrollListener); - } - // Clean up scroll dimension checking - const dimensionCheckProcess = dimensionCheckProcesses.get(container); - if (dimensionCheckProcess) { - motionDom.cancelFrame(dimensionCheckProcess); - dimensionCheckProcesses.delete(container); - } - scrollSize.delete(container); - }; -} - -/** - * Maps from ProgressIntersection pairs used by Motion's preset offsets to - * ViewTimeline named ranges. Returns undefined for unrecognised patterns, - * which signals the caller to fall back to JS-based scroll tracking. - */ -const presets = [ - [ScrollOffset.Enter, "entry"], - [ScrollOffset.Exit, "exit"], - [ScrollOffset.Any, "cover"], - [ScrollOffset.All, "contain"], -]; -const stringToProgress = { - start: 0, - end: 1, -}; -function parseStringOffset(s) { - const parts = s.trim().split(/\s+/); - if (parts.length !== 2) - return undefined; - const a = stringToProgress[parts[0]]; - const b = stringToProgress[parts[1]]; - if (a === undefined || b === undefined) - return undefined; - return [a, b]; -} -function normaliseOffset(offset) { - if (offset.length !== 2) - return undefined; - const result = []; - for (const item of offset) { - if (Array.isArray(item)) { - result.push(item); - } - else if (typeof item === "string") { - const parsed = parseStringOffset(item); - if (!parsed) - return undefined; - result.push(parsed); - } - else { - return undefined; - } - } - return result; -} -function matchesPreset(offset, preset) { - const normalised = normaliseOffset(offset); - if (!normalised) - return false; - for (let i = 0; i < 2; i++) { - const o = normalised[i]; - const p = preset[i]; - if (o[0] !== p[0] || o[1] !== p[1]) - return false; - } - return true; -} -function offsetToViewTimelineRange(offset) { - if (!offset) { - return { rangeStart: "contain 0%", rangeEnd: "contain 100%" }; - } - for (const [preset, name] of presets) { - if (matchesPreset(offset, preset)) { - return { rangeStart: `${name} 0%`, rangeEnd: `${name} 100%` }; - } - } - return undefined; -} - -const timelineCache = new Map(); -function scrollTimelineFallback(options) { - const currentTime = { value: 0 }; - const cancel = scrollInfo((info) => { - currentTime.value = info[options.axis].progress * 100; - }, options); - return { currentTime, cancel }; -} -function getTimeline({ source, container, ...options }) { - const { axis } = options; - if (source) - container = source; - let containerCache = timelineCache.get(container); - if (!containerCache) { - containerCache = new Map(); - timelineCache.set(container, containerCache); - } - const targetKey = options.target ?? "self"; - let targetCache = containerCache.get(targetKey); - if (!targetCache) { - targetCache = {}; - containerCache.set(targetKey, targetCache); - } - const axisKey = axis + (options.offset ?? []).join(","); - if (!targetCache[axisKey]) { - if (options.target && canUseNativeTimeline(options.target)) { - const range = offsetToViewTimelineRange(options.offset); - if (range) { - targetCache[axisKey] = new ViewTimeline({ - subject: options.target, - axis, - }); - } - else { - targetCache[axisKey] = scrollTimelineFallback({ - container, - ...options, - }); - } - } - else if (canUseNativeTimeline()) { - targetCache[axisKey] = new ScrollTimeline({ - source: container, - axis, - }); - } - else { - targetCache[axisKey] = scrollTimelineFallback({ - container, - ...options, - }); - } - } - return targetCache[axisKey]; -} - -function attachToAnimation(animation, options) { - const timeline = getTimeline(options); - const range = options.target - ? offsetToViewTimelineRange(options.offset) - : undefined; - /** - * Use native timeline when: - * - No target: ScrollTimeline (existing behaviour) - * - Target with mappable offset: ViewTimeline with named range - * - Target with unmappable offset: fall back to JS observe - */ - const useNative = options.target - ? canUseNativeTimeline(options.target) && !!range - : canUseNativeTimeline(); - return animation.attachTimeline({ - timeline: useNative ? timeline : undefined, - ...(range && - useNative && { - rangeStart: range.rangeStart, - rangeEnd: range.rangeEnd, - }), - observe: (valueAnimation) => { - valueAnimation.pause(); - return motionDom.observeTimeline((progress) => { - valueAnimation.time = - valueAnimation.iterationDuration * progress; - }, timeline); - }, - }); -} - -/** - * Currently, we only support element tracking with `scrollInfo`, though in - * the future we can also offer ViewTimeline support. - */ -function isElementTracking(options) { - return options && (options.target || options.offset); -} - -/** - * If the onScroll function has two arguments, it's expecting - * more specific information about the scroll from scrollInfo. - */ -function isOnScrollWithInfo(onScroll) { - return onScroll.length === 2; -} -function attachToFunction(onScroll, options) { - if (isOnScrollWithInfo(onScroll) || isElementTracking(options)) { - return scrollInfo((info) => { - onScroll(info[options.axis].progress, info); - }, options); - } - else { - return motionDom.observeTimeline(onScroll, getTimeline(options)); - } -} - -function scroll(onScroll, { axis = "y", container = document.scrollingElement, ...options } = {}) { - if (!container) - return motionUtils.noop; - const optionsWithDefaults = { axis, container, ...options }; - return typeof onScroll === "function" - ? attachToFunction(onScroll, optionsWithDefaults) - : attachToAnimation(onScroll, optionsWithDefaults); -} - -const thresholds = { - some: 0, - all: 1, -}; -function inView(elementOrSelector, onStart, { root, margin: rootMargin, amount = "some" } = {}) { - const elements = motionDom.resolveElements(elementOrSelector); - const activeIntersections = new WeakMap(); - const onIntersectionChange = (entries) => { - entries.forEach((entry) => { - const onEnd = activeIntersections.get(entry.target); - /** - * If there's no change to the intersection, we don't need to - * do anything here. - */ - if (entry.isIntersecting === Boolean(onEnd)) - return; - if (entry.isIntersecting) { - const newOnEnd = onStart(entry.target, entry); - if (typeof newOnEnd === "function") { - activeIntersections.set(entry.target, newOnEnd); - } - else { - observer.unobserve(entry.target); - } - } - else if (typeof onEnd === "function") { - onEnd(entry); - activeIntersections.delete(entry.target); - } - }); - }; - const observer = new IntersectionObserver(onIntersectionChange, { - root, - rootMargin, - threshold: typeof amount === "number" ? amount : thresholds[amount], - }); - elements.forEach((element) => observer.observe(element)); - return () => observer.disconnect(); -} - -const m = /*@__PURE__*/ createMotionProxy(); - -function useUnmountEffect(callback) { - return React.useEffect(() => () => callback(), []); -} - -/** - * @public - */ -const domAnimation = { - renderer: featureBundle.createDomVisualElement, - ...featureBundle.animations, - ...featureBundle.gestureAnimations, -}; - -/** - * @public - */ -const domMax = { - ...domAnimation, - ...featureBundle.drag, - ...featureBundle.layout, -}; - -/** - * @public - */ -const domMin = { - renderer: featureBundle.createDomVisualElement, - ...featureBundle.animations, -}; - -function useMotionValueEvent(value, event, callback) { - /** - * useInsertionEffect will create subscriptions before any other - * effects will run. Effects run upwards through the tree so it - * can be that binding a useLayoutEffect higher up the tree can - * miss changes from lower down the tree. - */ - React.useInsertionEffect(() => value.on(event, callback), [value, event, callback]); -} - -const createScrollMotionValues = () => ({ - scrollX: motionDom.motionValue(0), - scrollY: motionDom.motionValue(0), - scrollXProgress: motionDom.motionValue(0), - scrollYProgress: motionDom.motionValue(0), -}); -const isRefPending = (ref) => { - if (!ref) - return false; - return !ref.current; -}; -function makeAccelerateConfig(axis, options, container, target) { - return { - // Refs attach child-first; defer so target.current is populated - // before scroll() reads it. - factory: (animation) => { - let cleanup; - const start = () => { - // A provided ref may be hydrated by an effect declared after - // useScroll (or in a parent). Don't attach to the window - // scroll in the meantime — that result gets cached and would - // permanently mistrack. Wait until the ref resolves. - if (isRefPending(container) || isRefPending(target)) { - motionDom.microtask.read(start); - return; - } - cleanup = scroll(animation, { - ...options, - axis, - container: container?.current || undefined, - target: target?.current || undefined, - }); - }; - motionDom.microtask.read(start); - return () => { - motionDom.cancelMicrotask(start); - cleanup?.(); - }; - }, - times: [0, 1], - keyframes: [0, 1], - ease: (v) => v, - duration: 1, - }; -} -function canAccelerateScroll(target, offset) { - if (typeof window === "undefined") - return false; - return target - ? motionDom.supportsViewTimeline() && !!offsetToViewTimelineRange(offset) - : motionDom.supportsScrollTimeline(); -} -function useScroll({ container, target, ...options } = {}) { - const values = index.useConstant(createScrollMotionValues); - if (canAccelerateScroll(target, options.offset)) { - values.scrollXProgress.accelerate = makeAccelerateConfig("x", options, container, target); - values.scrollYProgress.accelerate = makeAccelerateConfig("y", options, container, target); - } - const scrollAnimation = React.useRef(null); - const needsStart = React.useRef(false); - const start = React.useCallback(() => { - scrollAnimation.current = scroll((_progress, { x, y, }) => { - values.scrollX.set(x.current); - values.scrollXProgress.set(x.progress); - values.scrollY.set(y.current); - values.scrollYProgress.set(y.progress); - }, { - ...options, - container: container?.current || undefined, - target: target?.current || undefined, - }); - return () => { - scrollAnimation.current?.(); - }; - }, [container, target, JSON.stringify(options.offset)]); - index.useIsomorphicLayoutEffect(() => { - needsStart.current = false; - if (isRefPending(container) || isRefPending(target)) { - needsStart.current = true; - return; - } - else { - return start(); - } - }, [start]); - React.useEffect(() => { - if (!needsStart.current) - return; - // Defer to a microtask so any sibling/parent effect that hydrates the - // ref has a chance to run first. - let cleanup; - const tryStart = () => { - const containerPending = isRefPending(container); - const targetPending = isRefPending(target); - motionUtils.invariant(!containerPending, "Container ref is defined but not hydrated", "use-scroll-ref"); - motionUtils.invariant(!targetPending, "Target ref is defined but not hydrated", "use-scroll-ref"); - if (!containerPending && !targetPending) - cleanup = start(); - }; - motionDom.microtask.read(tryStart); - return () => { - motionDom.cancelMicrotask(tryStart); - cleanup?.(); - }; - }, [start]); - return values; -} - -/** - * @deprecated useElementScroll is deprecated. Convert to useScroll({ container: ref }) - */ -function useElementScroll(ref) { - if (process.env.NODE_ENV === "development") { - motionUtils.warnOnce(false, "useElementScroll is deprecated. Convert to useScroll({ container: ref })."); - } - return useScroll({ container: ref }); -} - -/** - * @deprecated useViewportScroll is deprecated. Convert to useScroll() - */ -function useViewportScroll() { - if (process.env.NODE_ENV !== "production") { - motionUtils.warnOnce(false, "useViewportScroll is deprecated. Convert to useScroll()."); - } - return useScroll(); -} - -/** - * Combine multiple motion values into a new one using a string template literal. - * - * ```jsx - * import { - * motion, - * useSpring, - * useMotionValue, - * useMotionTemplate - * } from "framer-motion" - * - * function Component() { - * const shadowX = useSpring(0) - * const shadowY = useMotionValue(0) - * const shadow = useMotionTemplate`drop-shadow(${shadowX}px ${shadowY}px 20px rgba(0,0,0,0.3))` - * - * return - * } - * ``` - * - * @public - */ -function useMotionTemplate(fragments, ...values) { - /** - * Create a function that will build a string from the latest motion values. - */ - const numFragments = fragments.length; - function buildValue() { - let output = ``; - for (let i = 0; i < numFragments; i++) { - output += fragments[i]; - const value = values[i]; - if (value) { - output += motionDom.isMotionValue(value) ? value.get() : value; - } - } - return output; - } - return useCombineMotionValues(values.filter(motionDom.isMotionValue), buildValue); -} - -function useFollowValue(source, options = {}) { - const { isStatic } = React.useContext(index.MotionConfigContext); - const getFromSource = () => (motionDom.isMotionValue(source) ? source.get() : source); - // isStatic will never change, allowing early hooks return - if (isStatic) { - return useTransform(getFromSource); - } - const value = useMotionValue(getFromSource()); - React.useInsertionEffect(() => { - return motionDom.attachFollow(value, source, options); - }, [value, JSON.stringify(options)]); - return value; -} - -function useSpring(source, options = {}) { - return useFollowValue(source, { type: "spring", ...options }); -} - -function useAnimationFrame(callback) { - const initialTimestamp = React.useRef(0); - const { isStatic } = React.useContext(index.MotionConfigContext); - React.useEffect(() => { - if (isStatic) - return; - const provideTimeSinceStart = ({ timestamp, delta }) => { - if (!initialTimestamp.current) - initialTimestamp.current = timestamp; - callback(timestamp - initialTimestamp.current, delta); - }; - motionDom.frame.update(provideTimeSinceStart, true); - return () => motionDom.cancelFrame(provideTimeSinceStart); - }, [callback]); -} - -function useTime() { - const time = useMotionValue(0); - useAnimationFrame((t) => time.set(t)); - return time; -} - -/** - * Creates a `MotionValue` that updates when the velocity of the provided `MotionValue` changes. - * - * ```javascript - * const x = useMotionValue(0) - * const xVelocity = useVelocity(x) - * const xAcceleration = useVelocity(xVelocity) - * ``` - * - * @public - */ -function useVelocity(value) { - const velocity = useMotionValue(value.getVelocity()); - const updateVelocity = () => { - const latest = value.getVelocity(); - velocity.set(latest); - /** - * If we still have velocity, schedule an update for the next frame - * to keep checking until it is zero. - */ - if (latest) - motionDom.frame.update(updateVelocity); - }; - useMotionValueEvent(value, "change", () => { - // Schedule an update to this value at the end of the current frame. - motionDom.frame.update(updateVelocity, false, true); - }); - return velocity; -} - -class WillChangeMotionValue extends motionDom.MotionValue { - constructor() { - super(...arguments); - this.isEnabled = false; - } - add(name) { - if (motionDom.transformProps.has(name) || motionDom.acceleratedValues.has(name)) { - this.isEnabled = true; - this.update(); - } - } - update() { - this.set(this.isEnabled ? "transform" : "auto"); - } -} - -function useWillChange() { - return index.useConstant(() => new WillChangeMotionValue("auto")); -} - -/** - * A hook that returns `true` if we should be using reduced motion based on the current device's Reduced Motion setting. - * - * This can be used to implement changes to your UI based on Reduced Motion. For instance, replacing motion-sickness inducing - * `x`/`y` animations with `opacity`, disabling the autoplay of background videos, or turning off parallax motion. - * - * It will actively respond to changes and re-render your components with the latest setting. - * - * ```jsx - * export function Sidebar({ isOpen }) { - * const shouldReduceMotion = useReducedMotion() - * const closedX = shouldReduceMotion ? 0 : "-100%" - * - * return ( - * - * ) - * } - * ``` - * - * @return boolean - * - * @public - */ -function useReducedMotion() { - /** - * Lazy initialisation of prefersReducedMotion - */ - !motionDom.hasReducedMotionListener.current && motionDom.initPrefersReducedMotion(); - const [shouldReduceMotion] = React.useState(motionDom.prefersReducedMotion.current); - if (process.env.NODE_ENV !== "production") { - motionUtils.warnOnce(shouldReduceMotion !== true, "You have Reduced Motion enabled on your device. Animations may not appear as expected.", "reduced-motion-disabled"); - } - /** - * TODO See if people miss automatically updating shouldReduceMotion setting - */ - return shouldReduceMotion; -} - -function useReducedMotionConfig() { - const reducedMotionPreference = useReducedMotion(); - const { reducedMotion } = React.useContext(index.MotionConfigContext); - if (reducedMotion === "never") { - return false; - } - else if (reducedMotion === "always") { - return true; - } - else { - return reducedMotionPreference; - } -} - -function stopAnimation(visualElement) { - visualElement.values.forEach((value) => value.stop()); -} -function setVariants(visualElement, variantLabels) { - const reversedLabels = [...variantLabels].reverse(); - reversedLabels.forEach((key) => { - const variant = visualElement.getVariant(key); - variant && motionDom.setTarget(visualElement, variant); - if (visualElement.variantChildren) { - visualElement.variantChildren.forEach((child) => { - setVariants(child, variantLabels); - }); - } - }); -} -function setValues(visualElement, definition) { - if (Array.isArray(definition)) { - return setVariants(visualElement, definition); - } - else if (typeof definition === "string") { - return setVariants(visualElement, [definition]); - } - else { - motionDom.setTarget(visualElement, definition); - } -} -/** - * @public - */ -function animationControls() { - /** - * Track whether the host component has mounted. - */ - let hasMounted = false; - /** - * A collection of linked component animation controls. - */ - const subscribers = new Set(); - const controls = { - subscribe(visualElement) { - subscribers.add(visualElement); - return () => void subscribers.delete(visualElement); - }, - start(definition, transitionOverride) { - motionUtils.invariant(hasMounted, "controls.start() should only be called after a component has mounted. Consider calling within a useEffect hook."); - const animations = []; - subscribers.forEach((visualElement) => { - animations.push(motionDom.animateVisualElement(visualElement, definition, { - transitionOverride, - })); - }); - return Promise.all(animations); - }, - set(definition) { - motionUtils.invariant(hasMounted, "controls.set() should only be called after a component has mounted. Consider calling within a useEffect hook."); - return subscribers.forEach((visualElement) => { - setValues(visualElement, definition); - }); - }, - stop() { - subscribers.forEach((visualElement) => { - stopAnimation(visualElement); - }); - }, - mount() { - hasMounted = true; - return () => { - hasMounted = false; - controls.stop(); - }; - }, - }; - return controls; -} - -function useAnimate() { - const scope = index.useConstant(() => ({ - current: null, // Will be hydrated by React - animations: [], - })); - const reduceMotion = useReducedMotionConfig() ?? undefined; - const { skipAnimations } = React.useContext(index.MotionConfigContext); - const animate = React.useMemo(() => createScopedAnimate({ scope, reduceMotion, skipAnimations }), [scope, reduceMotion, skipAnimations]); - useUnmountEffect(() => { - scope.animations.forEach((animation) => animation.stop()); - scope.animations.length = 0; - }); - return [scope, animate]; -} - -function useAnimateMini() { - const scope = index.useConstant(() => ({ - current: null, // Will be hydrated by React - animations: [], - })); - const animate = index.useConstant(() => createScopedWaapiAnimate(scope)); - useUnmountEffect(() => { - scope.animations.forEach((animation) => animation.stop()); - }); - return [scope, animate]; -} - -/** - * Creates `LegacyAnimationControls`, which can be used to manually start, stop - * and sequence animations on one or more components. - * - * The returned `LegacyAnimationControls` should be passed to the `animate` property - * of the components you want to animate. - * - * These components can then be animated with the `start` method. - * - * ```jsx - * import * as React from 'react' - * import { motion, useAnimation } from 'framer-motion' - * - * export function MyComponent(props) { - * const controls = useAnimation() - * - * controls.start({ - * x: 100, - * transition: { duration: 0.5 }, - * }) - * - * return - * } - * ``` - * - * @returns Animation controller with `start` and `stop` methods - * - * @public - */ -function useAnimationControls() { - const controls = index.useConstant(animationControls); - index.useIsomorphicLayoutEffect(controls.mount, []); - return controls; -} -const useAnimation = useAnimationControls; - -function usePresenceData() { - const context = React.useContext(index.PresenceContext); - return context ? context.custom : undefined; -} - -/** - * Attaches an event listener directly to the provided DOM element. - * - * Bypassing React's event system can be desirable, for instance when attaching non-passive - * event handlers. - * - * ```jsx - * const ref = useRef(null) - * - * useDomEvent(ref, 'wheel', onWheel, { passive: false }) - * - * return

- * ``` - * - * @param ref - React.RefObject that's been provided to the element you want to bind the listener to. - * @param eventName - Name of the event you want listen for. - * @param handler - Function to fire when receiving the event. - * @param options - Options to pass to `Event.addEventListener`. - * - * @public - */ -function useDomEvent(ref, eventName, handler, options) { - React.useEffect(() => { - const element = ref.current; - if (handler && element) { - return motionDom.addDomEvent(element, eventName, handler, options); - } - }, [ref, eventName, handler, options]); -} - -/** - * Can manually trigger a drag gesture on one or more `drag`-enabled `motion` components. - * - * ```jsx - * const dragControls = useDragControls() - * - * function startDrag(event) { - * dragControls.start(event, { snapToCursor: true }) - * } - * - * return ( - * <> - *
- * - * - * ) - * ``` - * - * @public - */ -class DragControls { - constructor() { - this.componentControls = new Set(); - } - /** - * Subscribe a component's internal `VisualElementDragControls` to the user-facing API. - * - * @internal - */ - subscribe(controls) { - this.componentControls.add(controls); - return () => this.componentControls.delete(controls); - } - /** - * Start a drag gesture on every `motion` component that has this set of drag controls - * passed into it via the `dragControls` prop. - * - * ```jsx - * dragControls.start(e, { - * snapToCursor: true - * }) - * ``` - * - * @param event - PointerEvent - * @param options - Options - * - * @public - */ - start(event, options) { - this.componentControls.forEach((controls) => { - controls.start(event.nativeEvent || event, options); - }); - } - /** - * Cancels a drag gesture. - * - * ```jsx - * dragControls.cancel() - * ``` - * - * @public - */ - cancel() { - this.componentControls.forEach((controls) => { - controls.cancel(); - }); - } - /** - * Stops a drag gesture. - * - * ```jsx - * dragControls.stop() - * ``` - * - * @public - */ - stop() { - this.componentControls.forEach((controls) => { - controls.stop(); - }); - } -} -const createDragControls = () => new DragControls(); -/** - * Usually, dragging is initiated by pressing down on a `motion` component with a `drag` prop - * and moving it. For some use-cases, for instance clicking at an arbitrary point on a video scrubber, we - * might want to initiate that dragging from a different component than the draggable one. - * - * By creating a `dragControls` using the `useDragControls` hook, we can pass this into - * the draggable component's `dragControls` prop. It exposes a `start` method - * that can start dragging from pointer events on other components. - * - * ```jsx - * const dragControls = useDragControls() - * - * function startDrag(event) { - * dragControls.start(event, { snapToCursor: true }) - * } - * - * return ( - * <> - *
- * - * - * ) - * ``` - * - * @public - */ -function useDragControls() { - return index.useConstant(createDragControls); -} - -/** - * Checks if a component is a `motion` component. - */ -function isMotionComponent(component) { - return (component !== null && - typeof component === "object" && - index.motionComponentSymbol in component); -} - -/** - * Unwraps a `motion` component and returns either a string for `motion.div` or - * the React component for `motion(Component)`. - * - * If the component is not a `motion` component it returns undefined. - */ -function unwrapMotionComponent(component) { - if (isMotionComponent(component)) { - return component[index.motionComponentSymbol]; - } - return undefined; -} - -function useInstantLayoutTransition() { - return startTransition; -} -function startTransition(callback) { - if (!motionDom.rootProjectionNode.current) - return; - motionDom.rootProjectionNode.current.isUpdating = false; - motionDom.rootProjectionNode.current.blockUpdate(); - callback && callback(); -} - -function useResetProjection() { - const reset = React.useCallback(() => { - const root = motionDom.rootProjectionNode.current; - if (!root) - return; - root.resetTree(); - }, []); - return reset; -} - -/** - * Cycles through a series of visual properties. Can be used to toggle between or cycle through animations. It works similar to `useState` in React. It is provided an initial array of possible states, and returns an array of two arguments. - * - * An index value can be passed to the returned `cycle` function to cycle to a specific index. - * - * ```jsx - * import * as React from "react" - * import { motion, useCycle } from "framer-motion" - * - * export const MyComponent = () => { - * const [x, cycleX] = useCycle(0, 50, 100) - * - * return ( - * cycleX()} - * /> - * ) - * } - * ``` - * - * @param items - items to cycle through - * @returns [currentState, cycleState] - * - * @public - */ -function useCycle(...items) { - const index = React.useRef(0); - const [item, setItem] = React.useState(items[index.current]); - const runCycle = React.useCallback((next) => { - index.current = - typeof next !== "number" - ? motionUtils.wrap(0, items.length, index.current + 1) - : next; - setItem(items[index.current]); - }, - // The array will change on each call, but by putting items.length at - // the front of this array, we guarantee the dependency comparison will match up - // eslint-disable-next-line react-hooks/exhaustive-deps - [items.length, ...items]); - return [item, runCycle]; -} - -function useInView(ref, { root, margin, amount, once = false, initial = false, } = {}) { - const [isInView, setInView] = React.useState(initial); - React.useEffect(() => { - if (!ref.current || (once && isInView)) - return; - const onEnter = () => { - setInView(true); - return once ? undefined : () => setInView(false); - }; - const options = { - root: (root && root.current) || undefined, - margin, - amount, - }; - return inView(ref.current, onEnter, options); - }, [root, ref, margin, once, amount]); - return isInView; -} - -function useInstantTransition() { - const [forceUpdate, forcedRenderCount] = useForceUpdate(); - const startInstantLayoutTransition = useInstantLayoutTransition(); - const unlockOnFrameRef = React.useRef(-1); - React.useEffect(() => { - /** - * Unblock after two animation frames, otherwise this will unblock too soon. - */ - motionDom.frame.postRender(() => motionDom.frame.postRender(() => { - /** - * If the callback has been called again after the effect - * triggered this 2 frame delay, don't unblock animations. This - * prevents the previous effect from unblocking the current - * instant transition too soon. This becomes more likely when - * used in conjunction with React.startTransition(). - */ - if (forcedRenderCount !== unlockOnFrameRef.current) - return; - motionUtils.MotionGlobalConfig.instantAnimations = false; - })); - }, [forcedRenderCount]); - return (callback) => { - startInstantLayoutTransition(() => { - motionUtils.MotionGlobalConfig.instantAnimations = true; - forceUpdate(); - callback(); - unlockOnFrameRef.current = forcedRenderCount + 1; - }); - }; -} -function disableInstantTransitions() { - motionUtils.MotionGlobalConfig.instantAnimations = false; -} - -function usePageInView() { - const [isInView, setIsInView] = React.useState(true); - React.useEffect(() => { - const handleVisibilityChange = () => setIsInView(!document.hidden); - if (document.hidden) { - handleVisibilityChange(); - } - document.addEventListener("visibilitychange", handleVisibilityChange); - return () => { - document.removeEventListener("visibilitychange", handleVisibilityChange); - }; - }, []); - return isInView; -} - -/** - * Creates a `transformPagePoint` function that accounts for SVG viewBox scaling. - * - * When dragging SVG elements inside an SVG with a viewBox that differs from - * the rendered dimensions (e.g., `viewBox="0 0 100 100"` but rendered at 500x500 pixels), - * pointer coordinates need to be transformed to match the SVG's coordinate system. - * - * @example - * ```jsx - * function App() { - * const svgRef = useRef(null) - * - * return ( - * - * - * - * - * - * ) - * } - * ``` - * - * @param svgRef - A React ref to the SVG element - * @returns A transformPagePoint function for use with MotionConfig - * - * @public - */ -function transformViewBoxPoint(svgRef) { - return (point) => { - const svg = svgRef.current; - if (!svg) { - return point; - } - // Get the viewBox attribute - const viewBox = svg.viewBox?.baseVal; - if (!viewBox || (viewBox.width === 0 && viewBox.height === 0)) { - // No viewBox or empty viewBox - no transformation needed - return point; - } - // Get the rendered dimensions of the SVG - const bbox = svg.getBoundingClientRect(); - if (bbox.width === 0 || bbox.height === 0) { - return point; - } - // Calculate scale factors - const scaleX = viewBox.width / bbox.width; - const scaleY = viewBox.height / bbox.height; - // Get the SVG's position on the page - const svgX = bbox.left + window.scrollX; - const svgY = bbox.top + window.scrollY; - // Transform the point: - // 1. Calculate position relative to SVG - // 2. Scale by viewBox/viewport ratio - // 3. Add back the SVG position (but in SVG coordinates) - return { - x: (point.x - svgX) * scaleX + svgX, - y: (point.y - svgY) * scaleY + svgY, - }; - }; -} - -/** - * Creates a `transformPagePoint` function that corrects pointer coordinates - * for a parent container with CSS transforms (rotation, scale, skew). - * - * When dragging elements inside a transformed parent, pointer coordinates - * need to be transformed through the inverse of the parent's transform - * so the drag offset is in local space. - * - * Works with both static and continuously animating transforms. - * - * @example - * ```jsx - * function App() { - * const ref = useRef(null) - * - * return ( - * - * - * - * - * - * ) - * } - * ``` - * - * @param parentRef - A React ref to the transformed parent element - * @returns A transformPagePoint function for use with MotionConfig - * - * @public - */ -function correctParentTransform(parentRef) { - return (point) => { - const parent = parentRef.current; - if (!parent) - return point; - const inv = getInverseMatrix(parent); - if (!inv) - return point; - // Get center of rotation in page space - const rect = parent.getBoundingClientRect(); - const cx = rect.left + window.scrollX + rect.width / 2; - const cy = rect.top + window.scrollY + rect.height / 2; - // Transform (point - center) through inverse, then add center back - const dx = point.x - cx; - const dy = point.y - cy; - return { - x: cx + inv.a * dx + inv.c * dy, - y: cy + inv.b * dx + inv.d * dy, - }; - }; -} -function getInverseMatrix(element) { - const { transform } = getComputedStyle(element); - if (!transform || transform === "none") - return null; - const match = transform.match(/^matrix3d\((.*)\)$/u) || - transform.match(/^matrix\((.*)\)$/u); - if (!match) - return null; - const v = match[1].split(",").map(Number); - const is3d = transform.startsWith("matrix3d"); - const a = v[0], b = v[1]; - const c = is3d ? v[4] : v[2]; - const d = is3d ? v[5] : v[3]; - const det = a * d - b * c; - if (Math.abs(det) < 1e-10) - return null; - return { a: d / det, b: -b / det, c: -c / det, d: a / det }; -} - -const appearAnimationStore = new Map(); -const appearComplete = new Map(); - -const appearStoreId = (elementId, valueName) => { - const key = motionDom.transformProps.has(valueName) ? "transform" : valueName; - return `${elementId}: ${key}`; -}; - -function handoffOptimizedAppearAnimation(elementId, valueName, frame) { - const storeId = appearStoreId(elementId, valueName); - const optimisedAnimation = appearAnimationStore.get(storeId); - if (!optimisedAnimation) { - return null; - } - const { animation, startTime } = optimisedAnimation; - function cancelAnimation() { - window.MotionCancelOptimisedAnimation?.(elementId, valueName, frame); - } - /** - * We can cancel the animation once it's finished now that we've synced - * with Motion. - * - * Prefer onfinish over finished as onfinish is backwards compatible with - * older browsers. - */ - animation.onfinish = cancelAnimation; - if (startTime === null || window.MotionHandoffIsComplete?.(elementId)) { - /** - * If the startTime is null, this animation is the Paint Ready detection animation - * and we can cancel it immediately without handoff. - * - * Or if we've already handed off the animation then we're now interrupting it. - * In which case we need to cancel it. - */ - cancelAnimation(); - return null; - } - else { - return startTime; - } -} - -/** - * A single time to use across all animations to manually set startTime - * and ensure they're all in sync. - */ -let startFrameTime; -/** - * A dummy animation to detect when Chrome is ready to start - * painting the page and hold off from triggering the real animation - * until then. We only need one animation to detect paint ready. - * - * https://bugs.chromium.org/p/chromium/issues/detail?id=1406850 - */ -let readyAnimation; -/** - * Keep track of animations that were suspended vs cancelled so we - * can easily resume them when we're done measuring layout. - */ -const suspendedAnimations = new Set(); -function resumeSuspendedAnimations() { - suspendedAnimations.forEach((data) => { - data.animation.play(); - data.animation.startTime = data.startTime; - }); - suspendedAnimations.clear(); -} -function startOptimizedAppearAnimation(element, name, keyframes, options, onReady) { - // Prevent optimised appear animations if Motion has already started animating. - if (window.MotionIsMounted) { - return; - } - const id = element.dataset[motionDom.optimizedAppearDataId]; - if (!id) - return; - window.MotionHandoffAnimation = handoffOptimizedAppearAnimation; - const storeId = appearStoreId(id, name); - if (!readyAnimation) { - readyAnimation = motionDom.startWaapiAnimation(element, name, [keyframes[0], keyframes[0]], - /** - * 10 secs is basically just a super-safe duration to give Chrome - * long enough to get the animation ready. - */ - { duration: 10000, ease: "linear" }); - appearAnimationStore.set(storeId, { - animation: readyAnimation, - startTime: null, - }); - /** - * If there's no readyAnimation then there's been no instantiation - * of handoff animations. - */ - window.MotionHandoffAnimation = handoffOptimizedAppearAnimation; - window.MotionHasOptimisedAnimation = (elementId, valueName) => { - if (!elementId) - return false; - /** - * Keep a map of elementIds that have started animating. We check - * via ID instead of Element because of hydration errors and - * pre-hydration checks. We also actively record IDs as they start - * animating rather than simply checking for data-appear-id as - * this attrbute might be present but not lead to an animation, for - * instance if the element's appear animation is on a different - * breakpoint. - */ - if (!valueName) { - return appearComplete.has(elementId); - } - const animationId = appearStoreId(elementId, valueName); - return Boolean(appearAnimationStore.get(animationId)); - }; - window.MotionHandoffMarkAsComplete = (elementId) => { - if (appearComplete.has(elementId)) { - appearComplete.set(elementId, true); - } - }; - window.MotionHandoffIsComplete = (elementId) => { - return appearComplete.get(elementId) === true; - }; - /** - * We only need to cancel transform animations as - * they're the ones that will interfere with the - * layout animation measurements. - */ - window.MotionCancelOptimisedAnimation = (elementId, valueName, frame, canResume) => { - const animationId = appearStoreId(elementId, valueName); - const data = appearAnimationStore.get(animationId); - if (!data) - return; - if (frame && canResume === undefined) { - /** - * Wait until the end of the subsequent frame to cancel the animation - * to ensure we don't remove the animation before the main thread has - * had a chance to resolve keyframes and render. - */ - frame.postRender(() => { - frame.postRender(() => { - data.animation.cancel(); - }); - }); - } - else { - data.animation.cancel(); - } - if (frame && canResume) { - suspendedAnimations.add(data); - frame.render(resumeSuspendedAnimations); - } - else { - appearAnimationStore.delete(animationId); - /** - * If there are no more animations left, we can remove the cancel function. - * This will let us know when we can stop checking for conflicting layout animations. - */ - if (!appearAnimationStore.size) { - window.MotionCancelOptimisedAnimation = undefined; - } - } - }; - window.MotionCheckAppearSync = (visualElement, valueName, value) => { - const appearId = motionDom.getOptimisedAppearId(visualElement); - if (!appearId) - return; - const valueIsOptimised = window.MotionHasOptimisedAnimation?.(appearId, valueName); - const externalAnimationValue = visualElement.props.values?.[valueName]; - if (!valueIsOptimised || !externalAnimationValue) - return; - const removeSyncCheck = value.on("change", (latestValue) => { - if (externalAnimationValue.get() !== latestValue) { - window.MotionCancelOptimisedAnimation?.(appearId, valueName); - removeSyncCheck(); - } - }); - return removeSyncCheck; - }; - } - const startAnimation = () => { - readyAnimation.cancel(); - const appearAnimation = motionDom.startWaapiAnimation(element, name, keyframes, options); - /** - * Record the time of the first started animation. We call performance.now() once - * here and once in handoff to ensure we're getting - * close to a frame-locked time. This keeps all animations in sync. - */ - if (startFrameTime === undefined) { - startFrameTime = performance.now(); - } - appearAnimation.startTime = startFrameTime; - appearAnimationStore.set(storeId, { - animation: appearAnimation, - startTime: startFrameTime, - }); - if (onReady) - onReady(appearAnimation); - }; - appearComplete.set(id, false); - if (readyAnimation.ready) { - readyAnimation.ready.then(startAnimation).catch(motionUtils.noop); - } - else { - startAnimation(); - } -} - -const createObject = () => ({}); -class StateVisualElement extends motionDom.VisualElement { - constructor() { - super(...arguments); - this.measureInstanceViewportBox = motionDom.createBox; - } - build() { } - resetTransform() { } - restoreTransform() { } - removeValueFromRenderState() { } - renderInstance() { } - scrapeMotionValuesFromProps() { - return createObject(); - } - getBaseTargetFromProps() { - return undefined; - } - readValueFromInstance(_state, key, options) { - return options.initialState[key] || 0; - } - sortInstanceNodePosition() { - return 0; - } -} -const useVisualState = index.makeUseVisualState({ - scrapeMotionValuesFromProps: createObject, - createRenderState: createObject, -}); -/** - * This is not an officially supported API and may be removed - * on any version. - */ -function useAnimatedState(initialState) { - const [animationState, setAnimationState] = React.useState(initialState); - const visualState = useVisualState({}, false); - const element = index.useConstant(() => { - return new StateVisualElement({ - props: { - onUpdate: (v) => { - setAnimationState({ ...v }); - }, - }, - visualState, - presenceContext: null, - }, { initialState }); - }); - React.useLayoutEffect(() => { - element.mount({}); - return () => element.unmount(); - }, [element]); - const startAnimation = index.useConstant(() => (animationDefinition) => { - return motionDom.animateVisualElement(element, animationDefinition); - }); - return [animationState, startAnimation]; -} - -let id = 0; -const AnimateSharedLayout = ({ children }) => { - React__namespace.useEffect(() => { - motionUtils.invariant(false, "AnimateSharedLayout is deprecated: https://www.framer.com/docs/guide-upgrade/##shared-layout-animations"); - }, []); - return (jsxRuntime.jsx(LayoutGroup, { id: index.useConstant(() => `asl-${id++}`), children: children })); -}; - -// Keep things reasonable and avoid scale: Infinity. In practise we might need -// to add another value, opacity, that could interpolate scaleX/Y [0,0.01] => [0,1] -// to simply hide content at unreasonable scales. -const maxScale = 100000; -const invertScale = (scale) => scale > 0.001 ? 1 / scale : maxScale; -let hasWarned = false; -/** - * Returns a `MotionValue` each for `scaleX` and `scaleY` that update with the inverse - * of their respective parent scales. - * - * This is useful for undoing the distortion of content when scaling a parent component. - * - * By default, `useInvertedScale` will automatically fetch `scaleX` and `scaleY` from the nearest parent. - * By passing other `MotionValue`s in as `useInvertedScale({ scaleX, scaleY })`, it will invert the output - * of those instead. - * - * ```jsx - * const MyComponent = () => { - * const { scaleX, scaleY } = useInvertedScale() - * return - * } - * ``` - * - * @deprecated - */ -function useInvertedScale(scale) { - let parentScaleX = useMotionValue(1); - let parentScaleY = useMotionValue(1); - const { visualElement } = React.useContext(index.MotionContext); - motionUtils.invariant(!!(scale || visualElement), "If no scale values are provided, useInvertedScale must be used within a child of another motion component."); - motionUtils.warning(hasWarned, "useInvertedScale is deprecated and will be removed in 3.0. Use the layout prop instead."); - hasWarned = true; - if (scale) { - parentScaleX = scale.scaleX || parentScaleX; - parentScaleY = scale.scaleY || parentScaleY; - } - else if (visualElement) { - parentScaleX = visualElement.getValue("scaleX", 1); - parentScaleY = visualElement.getValue("scaleY", 1); - } - const scaleX = useTransform(parentScaleX, invertScale); - const scaleY = useTransform(parentScaleY, invertScale); - return { scaleX, scaleY }; -} - -exports.LayoutGroupContext = index.LayoutGroupContext; -exports.MotionConfigContext = index.MotionConfigContext; -exports.MotionContext = index.MotionContext; -exports.PresenceContext = index.PresenceContext; -exports.SwitchLayoutGroupContext = index.SwitchLayoutGroupContext; -exports.filterProps = index.filterProps; -exports.isBrowser = index.isBrowser; -exports.isValidMotionProp = index.isValidMotionProp; -exports.makeUseVisualState = index.makeUseVisualState; -exports.useIsomorphicLayoutEffect = index.useIsomorphicLayoutEffect; -Object.defineProperty(exports, "VisualElement", { - enumerable: true, - get: function () { return motionDom.VisualElement; } -}); -Object.defineProperty(exports, "addScaleCorrector", { - enumerable: true, - get: function () { return motionDom.addScaleCorrector; } -}); -Object.defineProperty(exports, "animateVisualElement", { - enumerable: true, - get: function () { return motionDom.animateVisualElement; } -}); -Object.defineProperty(exports, "arc", { - enumerable: true, - get: function () { return motionDom.arc; } -}); -Object.defineProperty(exports, "buildTransform", { - enumerable: true, - get: function () { return motionDom.buildTransform; } -}); -Object.defineProperty(exports, "calcLength", { - enumerable: true, - get: function () { return motionDom.calcLength; } -}); -Object.defineProperty(exports, "createBox", { - enumerable: true, - get: function () { return motionDom.createBox; } -}); -Object.defineProperty(exports, "delay", { - enumerable: true, - get: function () { return motionDom.delay; } -}); -Object.defineProperty(exports, "optimizedAppearDataAttribute", { - enumerable: true, - get: function () { return motionDom.optimizedAppearDataAttribute; } -}); -Object.defineProperty(exports, "resolveMotionValue", { - enumerable: true, - get: function () { return motionDom.resolveMotionValue; } -}); -Object.defineProperty(exports, "visualElementStore", { - enumerable: true, - get: function () { return motionDom.visualElementStore; } -}); -exports.addPointerEvent = featureBundle.addPointerEvent; -exports.addPointerInfo = featureBundle.addPointerInfo; -exports.animations = featureBundle.animations; -exports.distance = featureBundle.distance; -exports.distance2D = featureBundle.distance2D; -exports.useIsPresent = featureBundle.useIsPresent; -exports.usePresence = featureBundle.usePresence; -Object.defineProperty(exports, "MotionGlobalConfig", { - enumerable: true, - get: function () { return motionUtils.MotionGlobalConfig; } -}); -exports.AnimatePresence = AnimatePresence; -exports.AnimateSharedLayout = AnimateSharedLayout; -exports.DeprecatedLayoutGroupContext = DeprecatedLayoutGroupContext; -exports.DragControls = DragControls; -exports.LayoutGroup = LayoutGroup; -exports.LazyMotion = LazyMotion; -exports.MotionConfig = MotionConfig; -exports.PopChild = PopChild; -exports.PresenceChild = PresenceChild; -exports.Reorder = namespace; -exports.WillChangeMotionValue = WillChangeMotionValue; -exports.animate = animate; -exports.animateMini = animateMini; -exports.animationControls = animationControls; -exports.correctParentTransform = correctParentTransform; -exports.createScopedAnimate = createScopedAnimate; -exports.disableInstantTransitions = disableInstantTransitions; -exports.domAnimation = domAnimation; -exports.domMax = domMax; -exports.domMin = domMin; -exports.inView = inView; -exports.isMotionComponent = isMotionComponent; -exports.m = m; -exports.motion = motion; -exports.scroll = scroll; -exports.scrollInfo = scrollInfo; -exports.startOptimizedAppearAnimation = startOptimizedAppearAnimation; -exports.transformViewBoxPoint = transformViewBoxPoint; -exports.unwrapMotionComponent = unwrapMotionComponent; -exports.useAnimate = useAnimate; -exports.useAnimateMini = useAnimateMini; -exports.useAnimation = useAnimation; -exports.useAnimationControls = useAnimationControls; -exports.useAnimationFrame = useAnimationFrame; -exports.useComposedRefs = useComposedRefs; -exports.useCycle = useCycle; -exports.useDeprecatedAnimatedState = useAnimatedState; -exports.useDeprecatedInvertedScale = useInvertedScale; -exports.useDomEvent = useDomEvent; -exports.useDragControls = useDragControls; -exports.useElementScroll = useElementScroll; -exports.useFollowValue = useFollowValue; -exports.useForceUpdate = useForceUpdate; -exports.useInView = useInView; -exports.useInstantLayoutTransition = useInstantLayoutTransition; -exports.useInstantTransition = useInstantTransition; -exports.useMotionTemplate = useMotionTemplate; -exports.useMotionValue = useMotionValue; -exports.useMotionValueEvent = useMotionValueEvent; -exports.usePageInView = usePageInView; -exports.usePresenceData = usePresenceData; -exports.useReducedMotion = useReducedMotion; -exports.useReducedMotionConfig = useReducedMotionConfig; -exports.useResetProjection = useResetProjection; -exports.useScroll = useScroll; -exports.useSpring = useSpring; -exports.useTime = useTime; -exports.useTransform = useTransform; -exports.useUnmountEffect = useUnmountEffect; -exports.useVelocity = useVelocity; -exports.useViewportScroll = useViewportScroll; -exports.useWillChange = useWillChange; -Object.keys(motionDom).forEach(function (k) { - if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { - enumerable: true, - get: function () { return motionDom[k]; } - }); -}); -Object.keys(motionUtils).forEach(function (k) { - if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { - enumerable: true, - get: function () { return motionUtils[k]; } - }); -}); -//# sourceMappingURL=index.js.map diff --git a/node_modules/framer-motion/dist/cjs/index.js.map b/node_modules/framer-motion/dist/cjs/index.js.map deleted file mode 100644 index 4a60412..0000000 --- a/node_modules/framer-motion/dist/cjs/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sources":["../../src/utils/use-composed-ref.ts","../../src/components/AnimatePresence/PopChild.tsx","../../src/components/AnimatePresence/PresenceChild.tsx","../../src/components/AnimatePresence/utils.ts","../../src/components/AnimatePresence/index.tsx","../../src/context/DeprecatedLayoutGroupContext.ts","../../src/utils/use-is-mounted.ts","../../src/utils/use-force-update.ts","../../src/components/LayoutGroup/index.tsx","../../src/components/LazyMotion/index.tsx","../../src/components/MotionConfig/index.tsx","../../src/context/ReorderContext.ts","../../src/render/components/create-proxy.ts","../../src/render/components/motion/proxy.ts","../../src/components/Reorder/utils/check-reorder.ts","../../src/components/Reorder/utils/detect-axis.ts","../../src/components/Reorder/Group.tsx","../../src/value/use-motion-value.ts","../../src/value/use-combine-values.ts","../../src/value/use-computed.ts","../../src/value/use-transform.ts","../../src/components/Reorder/utils/auto-scroll.ts","../../src/components/Reorder/Item.tsx","../../src/animation/utils/is-dom-keyframes.ts","../../src/animation/animate/resolve-subjects.ts","../../src/animation/sequence/utils/calc-repeat-duration.ts","../../src/animation/sequence/utils/calc-time.ts","../../src/animation/sequence/utils/edit.ts","../../src/animation/sequence/utils/normalize-times.ts","../../src/animation/sequence/utils/sort.ts","../../src/animation/sequence/create.ts","../../src/animation/utils/create-visual-element.ts","../../src/animation/animate/subject.ts","../../src/animation/animate/sequence.ts","../../src/animation/animate/index.ts","../../src/animation/animators/waapi/animate-elements.ts","../../src/animation/animators/waapi/animate-style.ts","../../src/render/dom/scroll/utils/can-use-native-timeline.ts","../../src/render/dom/scroll/info.ts","../../src/render/dom/scroll/offsets/inset.ts","../../src/render/dom/scroll/offsets/edge.ts","../../src/render/dom/scroll/offsets/offset.ts","../../src/render/dom/scroll/offsets/presets.ts","../../src/render/dom/scroll/offsets/index.ts","../../src/render/dom/scroll/on-scroll-handler.ts","../../src/render/dom/scroll/track.ts","../../src/render/dom/scroll/utils/offset-to-range.ts","../../src/render/dom/scroll/utils/get-timeline.ts","../../src/render/dom/scroll/attach-animation.ts","../../src/render/dom/scroll/utils/is-element-tracking.ts","../../src/render/dom/scroll/attach-function.ts","../../src/render/dom/scroll/index.ts","../../src/render/dom/viewport/index.ts","../../src/render/components/m/proxy.ts","../../src/utils/use-unmount-effect.ts","../../src/render/dom/features-animation.ts","../../src/render/dom/features-max.ts","../../src/render/dom/features-min.ts","../../src/utils/use-motion-value-event.ts","../../src/value/use-scroll.ts","../../src/value/scroll/use-element-scroll.ts","../../src/value/scroll/use-viewport-scroll.ts","../../src/value/use-motion-template.ts","../../src/value/use-follow-value.ts","../../src/value/use-spring.ts","../../src/utils/use-animation-frame.ts","../../src/value/use-time.ts","../../src/value/use-velocity.ts","../../src/value/use-will-change/WillChangeMotionValue.ts","../../src/value/use-will-change/index.ts","../../src/utils/reduced-motion/use-reduced-motion.ts","../../src/utils/reduced-motion/use-reduced-motion-config.ts","../../src/animation/hooks/animation-controls.ts","../../src/animation/hooks/use-animate.ts","../../src/animation/hooks/use-animate-style.ts","../../src/animation/hooks/use-animation.ts","../../src/components/AnimatePresence/use-presence-data.ts","../../src/events/use-dom-event.ts","../../src/gestures/drag/use-drag-controls.ts","../../src/motion/utils/is-motion-component.ts","../../src/motion/utils/unwrap-motion-component.ts","../../src/projection/use-instant-layout-transition.ts","../../src/projection/use-reset-projection.ts","../../src/utils/use-cycle.ts","../../src/utils/use-in-view.ts","../../src/utils/use-instant-transition.ts","../../src/utils/use-page-in-view.ts","../../src/utils/transform-viewbox-point.ts","../../src/utils/transform-rotated-parent.ts","../../src/animation/optimized-appear/store.ts","../../src/animation/optimized-appear/store-id.ts","../../src/animation/optimized-appear/handoff.ts","../../src/animation/optimized-appear/start.ts","../../src/animation/hooks/use-animated-state.ts","../../src/components/AnimateSharedLayout.tsx","../../src/value/use-inverted-scale.ts"],"sourcesContent":["/**\n * Taken from https://github.com/radix-ui/primitives/blob/main/packages/react/compose-refs/src/compose-refs.tsx\n */\nimport * as React from \"react\"\n\ntype PossibleRef = React.Ref | undefined\n\n/**\n * Set a given ref to a given value\n * This utility takes care of different types of refs: callback refs and RefObject(s)\n */\nfunction setRef(ref: PossibleRef, value: T): void | (() => void) {\n if (typeof ref === \"function\") {\n return ref(value)\n } else if (ref !== null && ref !== undefined) {\n ;(ref as React.MutableRefObject).current = value\n }\n}\n\n/**\n * A utility to compose multiple refs together\n * Accepts callback refs and RefObject(s)\n */\nfunction composeRefs(...refs: PossibleRef[]): React.RefCallback {\n return (node) => {\n let hasCleanup = false\n const cleanups = refs.map((ref) => {\n const cleanup = setRef(ref, node)\n if (!hasCleanup && typeof cleanup === \"function\") {\n hasCleanup = true\n }\n return cleanup\n })\n // React <19 will log an error to the console if a callback ref returns a\n // value. We don't use ref cleanups internally so this will only happen if a\n // user's ref callback returns a value, which we only expect if they are\n // using the cleanup functionality added in React 19.\n if (hasCleanup) {\n return () => {\n for (let i = 0; i < cleanups.length; i++) {\n const cleanup = cleanups[i]\n if (typeof cleanup === \"function\") {\n cleanup()\n } else {\n setRef(refs[i], null)\n }\n }\n }\n }\n }\n}\n\n/**\n * A custom hook that composes multiple refs\n * Accepts callback refs and RefObject(s)\n */\nfunction useComposedRefs(...refs: PossibleRef[]): React.RefCallback {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n return React.useCallback(composeRefs(...refs), refs)\n}\n\nexport { useComposedRefs }\n","\"use client\"\n\nimport { isHTMLElement } from \"motion-dom\"\nimport * as React from \"react\"\nimport { useContext, useId, useInsertionEffect, useRef } from \"react\"\n\nimport { MotionConfigContext } from \"../../context/MotionConfigContext\"\nimport { useComposedRefs } from \"../../utils/use-composed-ref\"\n\ninterface Size {\n width: number\n height: number\n top: number\n left: number\n right: number\n bottom: number\n direction: string\n}\n\ninterface Props {\n children: React.ReactElement\n isPresent: boolean\n anchorX?: \"left\" | \"right\"\n anchorY?: \"top\" | \"bottom\"\n root?: HTMLElement | ShadowRoot\n pop?: boolean\n}\n\ninterface MeasureProps extends Props {\n childRef: React.RefObject\n sizeRef: React.RefObject\n}\n\n/**\n * Measurement functionality has to be within a separate component\n * to leverage snapshot lifecycle.\n */\nclass PopChildMeasure extends React.Component {\n getSnapshotBeforeUpdate(prevProps: MeasureProps) {\n const element = this.props.childRef.current\n if (isHTMLElement(element) && prevProps.isPresent && !this.props.isPresent && this.props.pop !== false) {\n const parent = element.offsetParent\n const parentWidth = isHTMLElement(parent)\n ? parent.offsetWidth || 0\n : 0\n const parentHeight = isHTMLElement(parent)\n ? parent.offsetHeight || 0\n : 0\n\n const computedStyle = getComputedStyle(element)\n const size = this.props.sizeRef.current!\n size.height = parseFloat(computedStyle.height)\n size.width = parseFloat(computedStyle.width)\n size.top = element.offsetTop\n size.left = element.offsetLeft\n size.right = parentWidth - size.width - size.left\n size.bottom = parentHeight - size.height - size.top\n size.direction = computedStyle.direction\n }\n\n return null\n }\n\n /**\n * Required with getSnapshotBeforeUpdate to stop React complaining.\n */\n componentDidUpdate() {}\n\n render() {\n return this.props.children\n }\n}\n\nexport function PopChild({ children, isPresent, anchorX, anchorY, root, pop }: Props) {\n const id = useId()\n const ref = useRef(null)\n const size = useRef({\n width: 0,\n height: 0,\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n direction: \"ltr\",\n })\n const { nonce } = useContext(MotionConfigContext)\n /**\n * In React 19, refs are passed via props.ref instead of element.ref.\n * We check props.ref first (React 19) and fall back to element.ref (React 18).\n *\n * The composed ref is only used when popping the child out (pop !== false),\n * so we avoid reading children.props.ref otherwise. In React 18.3 that read\n * triggers a spurious \"`ref` is not a prop\" warning getter (#3745).\n */\n const childRef =\n pop !== false\n ? ((children.props as { ref?: React.Ref })?.ref ??\n (children as unknown as { ref?: React.Ref })?.ref)\n : undefined\n const composedRef = useComposedRefs(ref, childRef)\n\n /**\n * We create and inject a style block so we can apply this explicit\n * sizing in a non-destructive manner by just deleting the style block.\n *\n * We can't apply size via render as the measurement happens\n * in getSnapshotBeforeUpdate (post-render), likewise if we apply the\n * styles directly on the DOM node, we might be overwriting\n * styles set via the style prop.\n */\n useInsertionEffect(() => {\n const { width, height, top, left, right, bottom, direction } = size.current\n if (isPresent || pop === false || !ref.current || !width || !height) return\n\n const isRTL = direction === \"rtl\"\n const x = anchorX === \"left\"\n ? (isRTL ? `right: ${right}` : `left: ${left}`)\n : (isRTL ? `left: ${left}` : `right: ${right}`)\n const y = anchorY === \"bottom\" ? `bottom: ${bottom}` : `top: ${top}`\n\n ref.current.dataset.motionPopId = id\n\n const style = document.createElement(\"style\")\n if (nonce) style.nonce = nonce\n\n const parent = root ?? document.head\n parent.appendChild(style)\n\n if (style.sheet) {\n style.sheet.insertRule(`\n [data-motion-pop-id=\"${id}\"] {\n position: absolute !important;\n width: ${width}px !important;\n height: ${height}px !important;\n ${x}px !important;\n ${y}px !important;\n }\n `)\n }\n\n return () => {\n ref.current?.removeAttribute(\"data-motion-pop-id\")\n if (parent.contains(style)) {\n parent.removeChild(style)\n }\n }\n }, [isPresent])\n\n return (\n \n {pop === false\n ? children\n : React.cloneElement(children as any, { ref: composedRef })}\n \n )\n}\n","\"use client\"\n\nimport * as React from \"react\"\nimport { useId, useMemo, useRef } from \"react\"\nimport {\n PresenceContext,\n type PresenceContextProps,\n} from \"../../context/PresenceContext\"\nimport { VariantLabels } from \"../../motion/types\"\nimport { useConstant } from \"../../utils/use-constant\"\nimport { useIsomorphicLayoutEffect } from \"../../utils/use-isomorphic-effect\"\nimport { PopChild } from \"./PopChild\"\n\ninterface PresenceChildProps {\n children: React.ReactElement\n isPresent: boolean\n onExitComplete?: () => void\n initial?: false | VariantLabels\n custom?: any\n presenceAffectsLayout: boolean\n mode: \"sync\" | \"popLayout\" | \"wait\"\n anchorX?: \"left\" | \"right\"\n anchorY?: \"top\" | \"bottom\"\n root?: HTMLElement | ShadowRoot\n}\n\nexport const PresenceChild = ({\n children,\n initial,\n isPresent,\n onExitComplete,\n custom,\n presenceAffectsLayout,\n mode,\n anchorX,\n anchorY,\n root\n}: PresenceChildProps) => {\n const presenceChildren = useConstant(newChildrenMap)\n const id = useId()\n\n // Written in a layout effect (not render) so discarded concurrent\n // renders can't leave the refs pointing at uncommitted state.\n const isPresentRef = useRef(isPresent)\n const onExitCompleteRef = useRef(onExitComplete)\n useIsomorphicLayoutEffect(() => {\n isPresentRef.current = isPresent\n onExitCompleteRef.current = onExitComplete\n })\n\n let isReusedContext = true\n let context = useMemo((): PresenceContextProps => {\n isReusedContext = false\n return {\n id,\n initial,\n isPresent,\n custom,\n onExitComplete: (childId: string) => {\n presenceChildren.set(childId, true)\n\n for (const isComplete of presenceChildren.values()) {\n if (!isComplete) return // can stop searching when any is incomplete\n }\n\n onExitComplete && onExitComplete()\n },\n register: (childId: string) => {\n presenceChildren.set(childId, false)\n return () => {\n presenceChildren.delete(childId)\n !isPresentRef.current &&\n !presenceChildren.size &&\n onExitCompleteRef.current?.()\n }\n },\n }\n }, [isPresent, presenceChildren, onExitComplete])\n\n /**\n * If the presence of a child affects the layout of the components around it,\n * we want to make a new context value to ensure they get re-rendered\n * so they can detect that layout change.\n */\n if (presenceAffectsLayout && isReusedContext) {\n context = { ...context }\n }\n\n useMemo(() => {\n presenceChildren.forEach((_, key) => presenceChildren.set(key, false))\n }, [isPresent])\n\n /**\n * If there's no `motion` components to fire exit animations, we want to remove this\n * component immediately.\n */\n React.useEffect(() => {\n !isPresent &&\n !presenceChildren.size &&\n onExitComplete &&\n onExitComplete()\n }, [isPresent])\n\n children = (\n \n {children}\n \n )\n\n return (\n \n {children}\n \n )\n}\n\nfunction newChildrenMap(): Map {\n return new Map()\n}\n","import { isValidElement, Children, ReactElement, ReactNode } from \"react\"\n\nexport type ComponentKey = string | number\n\nexport const getChildKey = (child: ReactElement): ComponentKey =>\n child.key || \"\"\n\nexport function onlyElements(children: ReactNode): ReactElement[] {\n const filtered: ReactElement[] = []\n\n // We use forEach here instead of map as map mutates the component key by preprending `.$`\n Children.forEach(children, (child) => {\n if (isValidElement(child)) filtered.push(child)\n })\n\n return filtered\n}\n","\"use client\"\n\nimport * as React from \"react\"\nimport { useContext, useMemo, useRef, useState } from \"react\"\nimport { LayoutGroupContext } from \"../../context/LayoutGroupContext\"\nimport { useConstant } from \"../../utils/use-constant\"\nimport { useIsomorphicLayoutEffect } from \"../../utils/use-isomorphic-effect\"\nimport { PresenceChild } from \"./PresenceChild\"\nimport { AnimatePresenceProps } from \"./types\"\nimport { usePresence } from \"./use-presence\"\nimport { ComponentKey, getChildKey, onlyElements } from \"./utils\"\n\n/**\n * `AnimatePresence` enables the animation of components that have been removed from the tree.\n *\n * When adding/removing more than a single child, every child **must** be given a unique `key` prop.\n *\n * Any `motion` components that have an `exit` property defined will animate out when removed from\n * the tree.\n *\n * ```jsx\n * import { motion, AnimatePresence } from 'framer-motion'\n *\n * export const Items = ({ items }) => (\n * \n * {items.map(item => (\n * \n * ))}\n * \n * )\n * ```\n *\n * You can sequence exit animations throughout a tree using variants.\n *\n * If a child contains multiple `motion` components with `exit` props, it will only unmount the child\n * once all `motion` components have finished animating out. Likewise, any components using\n * `usePresence` all need to call `safeToRemove`.\n *\n * @public\n */\nexport const AnimatePresence = ({\n children,\n custom,\n initial = true,\n onExitComplete,\n presenceAffectsLayout = true,\n mode = \"sync\",\n propagate = false,\n anchorX = \"left\",\n anchorY = \"top\",\n root\n}: React.PropsWithChildren) => {\n const [isParentPresent, safeToRemove] = usePresence(propagate)\n\n /**\n * Filter any children that aren't ReactElements. We can only track components\n * between renders with a props.key.\n */\n const presentChildren = useMemo(() => onlyElements(children), [children])\n\n /**\n * Track the keys of the currently rendered children. This is used to\n * determine which children are exiting.\n */\n const presentKeys =\n propagate && !isParentPresent ? [] : presentChildren.map(getChildKey)\n\n /**\n * If `initial={false}` we only want to pass this to components in the first render.\n */\n const isInitialRender = useRef(true)\n\n /**\n * A ref containing the currently present children. When all exit animations\n * are complete, we use this to re-render the component with the latest children\n * *committed* rather than the latest children *rendered*.\n */\n const pendingPresentChildren = useRef(presentChildren)\n\n /**\n * Track which exiting children have finished animating out.\n */\n const exitComplete = useConstant(() => new Map())\n\n /**\n * Track which components are currently processing exit to prevent duplicate processing.\n */\n const exitingComponents = useRef(new Set())\n\n /**\n * Save children to render as React state. To ensure this component is concurrent-safe,\n * we check for exiting children via an effect.\n */\n const [diffedChildren, setDiffedChildren] = useState(presentChildren)\n const [renderedChildren, setRenderedChildren] = useState(presentChildren)\n\n useIsomorphicLayoutEffect(() => {\n if (propagate && !isParentPresent && !renderedChildren.length) {\n safeToRemove?.()\n }\n }, [isParentPresent, propagate, renderedChildren.length, safeToRemove])\n\n useIsomorphicLayoutEffect(() => {\n isInitialRender.current = false\n pendingPresentChildren.current = presentChildren\n\n /**\n * Update complete status of exiting children.\n */\n for (let i = 0; i < renderedChildren.length; i++) {\n const key = getChildKey(renderedChildren[i])\n\n if (!presentKeys.includes(key)) {\n if (exitComplete.get(key) !== true) {\n exitComplete.set(key, false)\n }\n } else {\n exitComplete.delete(key)\n exitingComponents.current.delete(key)\n }\n }\n }, [renderedChildren, presentKeys.length, presentKeys.join(\"-\")])\n\n const exitingChildren: any[] = []\n\n if (presentChildren !== diffedChildren) {\n let nextChildren = [...presentChildren]\n\n /**\n * Loop through all the currently rendered components and decide which\n * are exiting.\n */\n for (let i = 0; i < renderedChildren.length; i++) {\n const child = renderedChildren[i]\n const key = getChildKey(child)\n\n if (!presentKeys.includes(key)) {\n nextChildren.splice(i, 0, child)\n exitingChildren.push(child)\n }\n }\n\n /**\n * If we're in \"wait\" mode, and we have exiting children, we want to\n * only render these until they've all exited.\n */\n if (mode === \"wait\" && exitingChildren.length) {\n nextChildren = exitingChildren\n }\n\n setRenderedChildren(onlyElements(nextChildren))\n setDiffedChildren(presentChildren)\n\n /**\n * Early return to ensure once we've set state with the latest diffed\n * children, we can immediately re-render.\n */\n return null\n }\n\n if (\n process.env.NODE_ENV !== \"production\" &&\n mode === \"wait\" &&\n renderedChildren.length > 1\n ) {\n console.warn(\n `You're attempting to animate multiple children within AnimatePresence, but its mode is set to \"wait\". This will lead to odd visual behaviour.`\n )\n }\n\n /**\n * If we've been provided a forceRender function by the LayoutGroupContext,\n * we can use it to force a re-render amongst all surrounding components once\n * all components have finished animating out.\n */\n const { forceRender } = useContext(LayoutGroupContext)\n\n return (\n <>\n {renderedChildren.map((child) => {\n const key = getChildKey(child)\n\n const isPresent =\n propagate && !isParentPresent\n ? false\n : presentChildren === renderedChildren ||\n presentKeys.includes(key)\n\n const onExit = () => {\n if (exitingComponents.current.has(key)) {\n return\n }\n\n if (exitComplete.has(key)) {\n exitingComponents.current.add(key)\n exitComplete.set(key, true)\n } else {\n return\n }\n\n let isEveryExitComplete = true\n exitComplete.forEach((isExitComplete) => {\n if (!isExitComplete) isEveryExitComplete = false\n })\n\n if (isEveryExitComplete) {\n forceRender?.()\n setRenderedChildren(pendingPresentChildren.current)\n\n propagate && safeToRemove?.()\n\n onExitComplete && onExitComplete()\n }\n }\n\n return (\n \n {child}\n \n )\n })}\n \n )\n}\n","\"use client\"\n\nimport { createContext } from \"react\"\n\n/**\n * Note: Still used by components generated by old versions of Framer\n *\n * @deprecated\n */\nexport const DeprecatedLayoutGroupContext = createContext(null)\n","\"use client\"\n\nimport { useRef } from \"react\"\nimport { useIsomorphicLayoutEffect } from \"./use-isomorphic-effect\"\n\nexport function useIsMounted() {\n const isMounted = useRef(false)\n useIsomorphicLayoutEffect(() => {\n isMounted.current = true\n\n return () => {\n isMounted.current = false\n }\n }, [])\n\n return isMounted\n}\n","\"use client\"\n\nimport { frame } from \"motion-dom\"\nimport { useCallback, useState } from \"react\"\nimport { useIsMounted } from \"./use-is-mounted\"\n\nexport function useForceUpdate(): [VoidFunction, number] {\n const isMounted = useIsMounted()\n const [forcedRenderCount, setForcedRenderCount] = useState(0)\n\n const forceRender = useCallback(() => {\n isMounted.current && setForcedRenderCount(forcedRenderCount + 1)\n }, [forcedRenderCount])\n\n /**\n * Defer this to the end of the next animation frame in case there are multiple\n * synchronous calls.\n */\n const deferredForceRender = useCallback(\n () => frame.postRender(forceRender),\n [forceRender]\n )\n\n return [deferredForceRender, forcedRenderCount]\n}\n","\"use client\"\n\nimport * as React from \"react\"\nimport { MutableRefObject, useContext, useMemo, useRef } from \"react\"\nimport {\n LayoutGroupContext,\n LayoutGroupContextProps,\n} from \"../../context/LayoutGroupContext\"\nimport { DeprecatedLayoutGroupContext } from \"../../context/DeprecatedLayoutGroupContext\"\nimport { nodeGroup } from \"../../projection\"\nimport { useForceUpdate } from \"../../utils/use-force-update\"\n\ntype InheritOption = boolean | \"id\"\n\nexport interface Props {\n id?: string\n inherit?: InheritOption\n}\n\nconst shouldInheritGroup = (inherit: InheritOption) => inherit === true\nconst shouldInheritId = (inherit: InheritOption) =>\n shouldInheritGroup(inherit === true) || inherit === \"id\"\n\nexport const LayoutGroup: React.FunctionComponent<\n React.PropsWithChildren\n> = ({ children, id, inherit = true }) => {\n const layoutGroupContext = useContext(LayoutGroupContext)\n const deprecatedLayoutGroupContext = useContext(\n DeprecatedLayoutGroupContext\n )\n const [forceRender, key] = useForceUpdate()\n const context = useRef(\n null\n ) as MutableRefObject\n\n const upstreamId = layoutGroupContext.id || deprecatedLayoutGroupContext\n if (context.current === null) {\n if (shouldInheritId(inherit) && upstreamId) {\n id = id ? upstreamId + \"-\" + id : upstreamId\n }\n\n context.current = {\n id,\n group: shouldInheritGroup(inherit)\n ? layoutGroupContext.group || nodeGroup()\n : nodeGroup(),\n }\n }\n\n const memoizedContext = useMemo(\n () => ({ ...context.current, forceRender }),\n [key]\n )\n\n return (\n \n {children}\n \n )\n}\n","\"use client\"\n\nimport { useEffect, useRef, useState } from \"react\"\nimport { LazyContext } from \"../../context/LazyContext\"\nimport { loadFeatures } from \"../../motion/features/load-features\"\nimport { FeatureBundle, LazyFeatureBundle } from \"../../motion/features/types\"\nimport { CreateVisualElement } from \"../../render/types\"\nimport { LazyProps } from \"./types\"\n\n/**\n * Used in conjunction with the `m` component to reduce bundle size.\n *\n * `m` is a version of the `motion` component that only loads functionality\n * critical for the initial render.\n *\n * `LazyMotion` can then be used to either synchronously or asynchronously\n * load animation and gesture support.\n *\n * ```jsx\n * // Synchronous loading\n * import { LazyMotion, m, domAnimation } from \"framer-motion\"\n *\n * function App() {\n * return (\n * \n * \n * \n * )\n * }\n *\n * // Asynchronous loading\n * import { LazyMotion, m } from \"framer-motion\"\n *\n * function App() {\n * return (\n * import('./path/to/domAnimation')}>\n * \n * \n * )\n * }\n * ```\n *\n * @public\n */\nexport function LazyMotion({ children, features, strict = false }: LazyProps) {\n const [, setIsLoaded] = useState(!isLazyBundle(features))\n const loadedRenderer = useRef(undefined)\n\n /**\n * If this is a synchronous load, load features immediately\n */\n if (!isLazyBundle(features)) {\n const { renderer, ...loadedFeatures } = features\n loadedRenderer.current = renderer\n loadFeatures(loadedFeatures)\n }\n\n useEffect(() => {\n if (isLazyBundle(features)) {\n features().then(({ renderer, ...loadedFeatures }) => {\n loadFeatures(loadedFeatures)\n loadedRenderer.current = renderer\n setIsLoaded(true)\n })\n }\n }, [])\n\n return (\n \n {children}\n \n )\n}\n\nfunction isLazyBundle(\n features: FeatureBundle | LazyFeatureBundle\n): features is LazyFeatureBundle {\n return typeof features === \"function\"\n}\n","\"use client\"\n\nimport * as React from \"react\"\nimport { useContext, useMemo } from \"react\"\nimport { resolveTransition } from \"motion-dom\"\nimport { MotionConfigContext } from \"../../context/MotionConfigContext\"\nimport { useConstant } from \"../../utils/use-constant\"\n\nexport interface MotionConfigProps extends Partial {\n children?: React.ReactNode\n}\n\n/**\n * `MotionConfig` is used to set configuration options for all children `motion` components.\n *\n * ```jsx\n * import { motion, MotionConfig } from \"framer-motion\"\n *\n * export function App() {\n * return (\n * \n * \n * \n * )\n * }\n * ```\n *\n * @public\n */\nexport function MotionConfig({ children, ...config }: MotionConfigProps) {\n /**\n * Inherit props from any parent MotionConfig components\n */\n const parentConfig = useContext(MotionConfigContext)\n config = { ...parentConfig, ...config }\n\n config.transition = resolveTransition(\n config.transition,\n parentConfig.transition\n )\n\n /**\n * Don't allow isStatic to change between renders as it affects how many hooks\n * motion components fire.\n */\n config.isStatic = useConstant(() => config.isStatic)\n\n /**\n * Creating a new config context object will re-render every `motion` component\n * every time it renders. So we only want to create a new one sparingly.\n */\n const context = useMemo(\n () => config,\n [\n JSON.stringify(config.transition),\n config.transformPagePoint,\n config.reducedMotion,\n config.skipAnimations,\n config.isValidProp,\n ]\n )\n\n return (\n \n {children}\n \n )\n}\n","\"use client\"\n\nimport { createContext } from \"react\"\nimport { ReorderContextProps } from \"../components/Reorder/types\"\n\nexport const ReorderContext = createContext | null>(\n null\n)\n","import { warnOnce } from \"motion-utils\"\nimport { createMotionComponent, MotionComponentOptions } from \"../../motion\"\nimport { FeaturePackages } from \"../../motion/features/types\"\nimport { MotionProps } from \"../../motion/types\"\nimport { DOMMotionComponents } from \"../dom/types\"\nimport { CreateVisualElement } from \"../types\"\n\n/**\n * I'd rather the return type of `custom` to be implicit but this throws\n * incorrect relative paths in the exported types and API Extractor throws\n * a wobbly.\n */\ntype ComponentProps = React.PropsWithoutRef &\n React.RefAttributes\nexport type CustomDomComponent = React.ComponentType<\n ComponentProps\n>\n\ntype MotionProxy = typeof createMotionComponent &\n DOMMotionComponents & { create: typeof createMotionComponent }\n\nexport function createMotionProxy(\n preloadedFeatures?: FeaturePackages,\n createVisualElement?: CreateVisualElement\n): MotionProxy {\n if (typeof Proxy === \"undefined\") {\n return createMotionComponent as MotionProxy\n }\n\n /**\n * A cache of generated `motion` components, e.g `motion.div`, `motion.input` etc.\n * Rather than generating them anew every render.\n */\n const componentCache = new Map()\n\n const factory = (Component: string, options?: MotionComponentOptions) => {\n return createMotionComponent(\n Component,\n options,\n preloadedFeatures,\n createVisualElement\n )\n }\n\n /**\n * Support for deprecated`motion(Component)` pattern\n */\n const deprecatedFactoryFunction = (\n Component: string,\n options?: MotionComponentOptions\n ) => {\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(\n false,\n \"motion() is deprecated. Use motion.create() instead.\"\n )\n }\n return factory(Component, options)\n }\n\n return new Proxy(deprecatedFactoryFunction, {\n /**\n * Called when `motion` is referenced with a prop: `motion.div`, `motion.input` etc.\n * The prop name is passed through as `key` and we can use that to generate a `motion`\n * DOM component with that name.\n */\n get: (_target, key: string) => {\n if (key === \"create\") return factory\n\n /**\n * If this element doesn't exist in the component cache, create it and cache.\n */\n if (!componentCache.has(key)) {\n componentCache.set(\n key,\n createMotionComponent(\n key,\n undefined,\n preloadedFeatures,\n createVisualElement\n )\n )\n }\n\n return componentCache.get(key)!\n },\n }) as MotionProxy\n}\n","import { createDomVisualElement } from \"../../dom/create-visual-element\"\nimport { createMotionProxy } from \"../create-proxy\"\nimport { featureBundle } from \"./feature-bundle\"\n\nexport const motion = /*@__PURE__*/ createMotionProxy(\n featureBundle,\n createDomVisualElement\n)\n","import { mixNumber } from \"motion-dom\"\nimport { moveItem, Point } from \"motion-utils\"\nimport { ItemData, ReorderAxis } from \"../types\"\n\nexport function checkReorder(\n order: ItemData[],\n value: T,\n offset: Point,\n velocity: Point,\n axis: ReorderAxis,\n direction: \"ltr\" | \"rtl\" = \"ltr\"\n): ItemData[] {\n const index = order.findIndex((item) => item.value === value)\n\n if (index === -1) return order\n\n if (axis === \"xy\") {\n const { layout } = order[index]\n const center = {\n x: mixNumber(layout.x.min, layout.x.max, 0.5) + offset.x,\n y: mixNumber(layout.y.min, layout.y.max, 0.5) + offset.y,\n }\n const lines = getLines(order)\n const sourceLine = lines.find((line) =>\n line.items.includes(order[index])\n )!\n const targetLine = lines.reduce((closest, line) =>\n distanceToLine(center.y, line) < distanceToLine(center.y, closest)\n ? line\n : closest\n )\n\n if (targetLine !== sourceLine) {\n return moveToLine(order, index, center.x, targetLine, direction)\n }\n\n const currentDistance = distanceToBox(center, layout)\n let target = -1\n let targetDistance = currentDistance\n\n order.forEach((item, targetIndex) => {\n if (targetIndex === index) return\n const distance = distanceToBox(center, item.layout)\n if (distance < targetDistance) {\n target = targetIndex\n targetDistance = distance\n }\n })\n\n return target === -1\n ? order\n : moveItem(order, index, index + Math.sign(target - index))\n }\n\n if (!velocity[axis]) return order\n\n const nextOffset = velocity[axis] > 0 ? 1 : -1\n const nextItem = order[index + nextOffset]\n\n if (!nextItem) return order\n\n const item = order[index]\n const itemLayout = item.layout[axis]\n const nextLayout = nextItem.layout[axis]\n const nextItemCenter = mixNumber(nextLayout.min, nextLayout.max, 0.5)\n\n if (\n (nextOffset === 1 && itemLayout.max + offset[axis] > nextItemCenter) ||\n (nextOffset === -1 && itemLayout.min + offset[axis] < nextItemCenter)\n ) {\n return moveItem(order, index, index + nextOffset)\n }\n\n return order\n}\n\ninterface Line {\n items: ItemData[]\n min: number\n max: number\n}\n\nfunction getLines(order: ItemData[]) {\n const lines: Line[] = []\n\n order.forEach((item) => {\n const { min, max } = item.layout.y\n const line = lines[lines.length - 1]\n\n if (!line || min >= line.max || max <= line.min) {\n lines.push({ items: [item], min, max })\n } else {\n line.items.push(item)\n line.min = Math.min(line.min, min)\n line.max = Math.max(line.max, max)\n }\n })\n\n return lines\n}\n\nfunction distanceToLine(y: number, line: Line) {\n return y < line.min ? line.min - y : y > line.max ? y - line.max : 0\n}\n\nfunction moveToLine(\n order: ItemData[],\n index: number,\n x: number,\n line: Line,\n direction: \"ltr\" | \"rtl\"\n) {\n const remaining = order.filter((_, itemIndex) => itemIndex !== index)\n const before = line.items.find((item) => {\n const center = mixNumber(item.layout.x.min, item.layout.x.max, 0.5)\n return direction === \"ltr\" ? x < center : x > center\n })\n const targetIndex = before\n ? remaining.indexOf(before)\n : remaining.indexOf(line.items[line.items.length - 1]) + 1\n const nextOrder = [...remaining]\n nextOrder.splice(targetIndex, 0, order[index])\n\n return nextOrder.every((item, itemIndex) => item === order[itemIndex])\n ? order\n : nextOrder\n}\n\nfunction distanceToBox(point: Point, box: ItemData[\"layout\"]) {\n const x = Math.max(box.x.min - point.x, 0, point.x - box.x.max)\n const y = Math.max(box.y.min - point.y, 0, point.y - box.y.max)\n return x * x + y * y\n}\n","import { Axis, Box } from \"motion-utils\"\nimport { ReorderAxis } from \"../types\"\n\nconst isSeparated = (a: Axis, b: Axis) => a.max <= b.min || b.max <= a.min\n\nexport function detectAxis(layouts: Box[]): ReorderAxis {\n let x = false\n let y = false\n\n for (let i = 0; i < layouts.length; i++) {\n for (let j = i + 1; j < layouts.length; j++) {\n x ||= isSeparated(layouts[i].x, layouts[j].x)\n y ||= isSeparated(layouts[i].y, layouts[j].y)\n\n if (x && y) return \"xy\"\n }\n }\n\n return x ? \"x\" : \"y\"\n}\n","\"use client\"\n\nimport { invariant } from \"motion-utils\"\nimport * as React from \"react\"\nimport {\n forwardRef,\n FunctionComponent,\n JSX,\n useEffect,\n useRef,\n useState,\n} from \"react\"\nimport { ReorderContext } from \"../../context/ReorderContext\"\nimport { motion } from \"../../render/components/motion/proxy\"\nimport { HTMLMotionProps } from \"../../render/html/types\"\nimport { useConstant } from \"../../utils/use-constant\"\nimport {\n DefaultGroupElement,\n ItemData,\n ReorderAxis,\n ReorderContextProps,\n ReorderElementTag,\n} from \"./types\"\nimport { checkReorder } from \"./utils/check-reorder\"\nimport { detectAxis } from \"./utils/detect-axis\"\n\nexport interface Props<\n V,\n TagName extends ReorderElementTag = DefaultGroupElement\n> {\n /**\n * A HTML element to render this component as. Defaults to `\"ul\"`.\n *\n * @public\n */\n as?: TagName\n\n /**\n * The axis to reorder along. By default, this is detected from the item\n * layout. Use `\"xy\"` to explicitly enable wrapped layout reordering.\n *\n * @public\n */\n axis?: ReorderAxis\n\n /**\n * A callback to fire with the new value order. For instance, if the values\n * are provided as a state from `useState`, this could be the set state function.\n *\n * @public\n */\n onReorder: (newOrder: V[]) => void\n\n /**\n * The latest values state.\n *\n * ```jsx\n * function Component() {\n * const [items, setItems] = useState([0, 1, 2])\n *\n * return (\n * \n * {items.map((item) => )}\n * \n * )\n * }\n * ```\n *\n * @public\n */\n values: V[]\n}\n\ntype ReorderGroupProps<\n V,\n TagName extends ReorderElementTag = DefaultGroupElement\n> = Props &\n Omit, \"values\"> &\n React.PropsWithChildren<{}>\n\nexport function ReorderGroupComponent<\n V,\n TagName extends ReorderElementTag = DefaultGroupElement\n>(\n {\n children,\n as = \"ul\" as TagName,\n axis: axisOverride,\n onReorder,\n values,\n ...props\n }: ReorderGroupProps,\n externalRef?: React.ForwardedRef\n): JSX.Element {\n const Component = useConstant(\n () => motion[as as keyof typeof motion]\n ) as FunctionComponent<\n React.PropsWithChildren & { ref?: React.Ref }>\n >\n\n const itemLayouts = useRef(new Map[\"layout\"]>())\n const [detectedAxis, setDetectedAxis] = useState(\"y\")\n const isReordering = useRef(false)\n const groupRef = useRef(null)\n const axis = axisOverride || detectedAxis\n\n invariant(\n Boolean(values),\n \"Reorder.Group must be provided a values prop\",\n \"reorder-values\"\n )\n\n const valuesSet = new Set(values)\n itemLayouts.current.forEach((_, value) => {\n if (!valuesSet.has(value)) itemLayouts.current.delete(value)\n })\n\n const context: ReorderContextProps = {\n axis,\n groupRef,\n registerItem: (value, layout) => {\n itemLayouts.current.set(value, layout)\n\n if (!axisOverride) {\n const nextAxis = detectAxis(\n values.flatMap((itemValue) => {\n const itemLayout = itemLayouts.current.get(itemValue)\n return itemLayout ? [itemLayout] : []\n })\n )\n\n if (nextAxis !== detectedAxis) setDetectedAxis(nextAxis)\n }\n },\n updateOrder: (item, offset, velocity) => {\n if (isReordering.current) return\n\n const order = values.flatMap((value) => {\n const layout = itemLayouts.current.get(value)\n return layout ? [{ value, layout }] : []\n })\n const direction =\n groupRef.current?.ownerDocument.defaultView?.getComputedStyle(\n groupRef.current\n ).direction === \"rtl\"\n ? \"rtl\"\n : \"ltr\"\n const newOrder = checkReorder(\n order,\n item,\n offset,\n velocity,\n axis,\n direction\n )\n\n if (order !== newOrder) {\n isReordering.current = true\n\n const newValues = [...values]\n const measuredIndexes = order.map(({ value }) =>\n values.indexOf(value)\n )\n newOrder.forEach(({ value }, index) => {\n newValues[measuredIndexes[index]] = value\n })\n onReorder(newValues)\n }\n },\n }\n\n useEffect(() => {\n isReordering.current = false\n })\n\n // Combine refs if external ref is provided\n const setRef = (element: Element | null) => {\n ;(groupRef as React.MutableRefObject).current = element\n if (typeof externalRef === \"function\") {\n externalRef(element)\n } else if (externalRef) {\n ;(externalRef as React.MutableRefObject).current =\n element\n }\n }\n\n /**\n * Disable browser scroll anchoring on the group container.\n * When items reorder, scroll anchoring can cause the browser to adjust\n * the scroll position, which interferes with drag position calculations.\n */\n const groupStyle = {\n overflowAnchor: \"none\" as const,\n ...props.style,\n }\n\n return (\n \n \n {children}\n \n \n )\n}\n\nexport const ReorderGroup = /*@__PURE__*/ forwardRef(ReorderGroupComponent) as <\n Values extends any[],\n TagName extends ReorderElementTag = DefaultGroupElement\n>(\n props: Omit<\n ReorderGroupProps,\n \"values\" | \"onReorder\"\n > & {\n values: Values\n onReorder: (newOrder: Values) => void\n } & { ref?: React.ForwardedRef }\n) => ReturnType\n","\"use client\"\n\nimport { motionValue, MotionValue } from \"motion-dom\"\nimport { useContext, useEffect, useState } from \"react\"\nimport { MotionConfigContext } from \"../context/MotionConfigContext\"\nimport { useConstant } from \"../utils/use-constant\"\n\n/**\n * Creates a `MotionValue` to track the state and velocity of a value.\n *\n * Usually, these are created automatically. For advanced use-cases, like use with `useTransform`, you can create `MotionValue`s externally and pass them into the animated component via the `style` prop.\n *\n * ```jsx\n * export const MyComponent = () => {\n * const scale = useMotionValue(1)\n *\n * return \n * }\n * ```\n *\n * @param initial - The initial state.\n *\n * @public\n */\nexport function useMotionValue(initial: T): MotionValue {\n const value = useConstant(() => motionValue(initial))\n\n /**\n * If this motion value is being used in static mode, like on\n * the Framer canvas, force components to rerender when the motion\n * value is updated.\n */\n const { isStatic } = useContext(MotionConfigContext)\n if (isStatic) {\n const [, setLatest] = useState(initial)\n useEffect(() => value.on(\"change\", setLatest), [])\n }\n\n return value\n}\n","\"use client\"\n\nimport { cancelFrame, frame, MotionValue } from \"motion-dom\"\nimport { useIsomorphicLayoutEffect } from \"../utils/use-isomorphic-effect\"\nimport { useMotionValue } from \"./use-motion-value\"\n\nexport function useCombineMotionValues(\n values: MotionValue[],\n combineValues: () => R\n) {\n /**\n * Initialise the returned motion value. This remains the same between renders.\n */\n const value = useMotionValue(combineValues())\n\n /**\n * Create a function that will update the template motion value with the latest values.\n * This is pre-bound so whenever a motion value updates it can schedule its\n * execution in Framesync. If it's already been scheduled it won't be fired twice\n * in a single frame.\n */\n const updateValue = () => value.set(combineValues())\n\n /**\n * Synchronously update the motion value with the latest values during the render.\n * This ensures that within a React render, the styles applied to the DOM are up-to-date.\n */\n updateValue()\n\n /**\n * Subscribe to all motion values found within the template. Whenever any of them change,\n * schedule an update.\n */\n useIsomorphicLayoutEffect(() => {\n const scheduleUpdate = () => frame.preRender(updateValue, false, true)\n const subscriptions = values.map((v) => v.on(\"change\", scheduleUpdate))\n\n return () => {\n subscriptions.forEach((unsubscribe) => unsubscribe())\n cancelFrame(updateValue)\n }\n })\n\n return value\n}\n","\"use client\"\n\nimport { collectMotionValues, type MotionValue } from \"motion-dom\"\nimport { useCombineMotionValues } from \"./use-combine-values\"\n\nexport function useComputed(compute: () => O): MotionValue {\n /**\n * Open session of collectMotionValues. Any MotionValue that calls get()\n * will be saved into this array.\n */\n collectMotionValues.current = []\n\n compute()\n\n const value = useCombineMotionValues(collectMotionValues.current, compute)\n\n /**\n * Synchronously close session of collectMotionValues.\n */\n collectMotionValues.current = undefined\n\n return value\n}\n","\"use client\"\n\nimport {\n AnyResolvedKeyframe,\n MotionValue,\n transform,\n TransformOptions,\n} from \"motion-dom\"\nimport { useConstant } from \"../utils/use-constant\"\nimport { useCombineMotionValues } from \"./use-combine-values\"\nimport { useComputed } from \"./use-computed\"\n\nexport type InputRange = number[]\ntype SingleTransformer = (input: I) => O\ntype MultiTransformer = (input: I[]) => O\ntype Transformer =\n | SingleTransformer\n /**\n * Ideally, this would be typed in all instances, but to type this\n * more accurately requires the tuple support in TypeScript 4:\n * https://gist.github.com/InventingWithMonster/c4d23752a0fae7888596c4ff6d92733a\n */\n | MultiTransformer\n\ninterface OutputMap {\n [key: string]: O[]\n}\n\n/**\n * Create multiple `MotionValue`s that transform the output of another `MotionValue` by mapping it from one range of values into multiple output ranges.\n *\n * @remarks\n *\n * This is useful when you want to derive multiple values from a single input value.\n * The keys of the output map must remain constant across renders.\n *\n * ```jsx\n * export const MyComponent = () => {\n * const x = useMotionValue(0)\n * const { opacity, scale } = useTransform(x, [0, 100], {\n * opacity: [0, 1],\n * scale: [0.5, 1]\n * })\n *\n * return (\n * \n * )\n * }\n * ```\n *\n * @param inputValue - `MotionValue`\n * @param inputRange - A linear series of numbers (either all increasing or decreasing)\n * @param outputMap - An object where keys map to output ranges. Each output range must be the same length as `inputRange`.\n * @param options - Transform options applied to all outputs\n *\n * @returns An object with the same keys as `outputMap`, where each value is a `MotionValue`\n *\n * @public\n */\nexport function useTransform>(\n inputValue: MotionValue,\n inputRange: InputRange,\n outputMap: T,\n options?: TransformOptions\n): { [K in keyof T]: MotionValue }\n\n/**\n * Create a `MotionValue` that transforms the output of another `MotionValue` by mapping it from one range of values into another.\n *\n * @remarks\n *\n * Given an input range of `[-200, -100, 100, 200]` and an output range of\n * `[0, 1, 1, 0]`, the returned `MotionValue` will:\n *\n * - When provided a value between `-200` and `-100`, will return a value between `0` and `1`.\n * - When provided a value between `-100` and `100`, will return `1`.\n * - When provided a value between `100` and `200`, will return a value between `1` and `0`\n *\n *\n * The input range must be a linear series of numbers. The output range\n * can be any value type supported by Motion: numbers, colors, shadows, etc.\n *\n * Every value in the output range must be of the same type and in the same format.\n *\n * ```jsx\n * export const MyComponent = () => {\n * const x = useMotionValue(0)\n * const xRange = [-200, -100, 100, 200]\n * const opacityRange = [0, 1, 1, 0]\n * const opacity = useTransform(x, xRange, opacityRange)\n *\n * return (\n * \n * )\n * }\n * ```\n *\n * @param inputValue - `MotionValue`\n * @param inputRange - A linear series of numbers (either all increasing or decreasing)\n * @param outputRange - A series of numbers, colors or strings. Must be the same length as `inputRange`.\n * @param options -\n *\n * - clamp: boolean. Clamp values to within the given range. Defaults to `true`\n * - ease: EasingFunction[]. Easing functions to use on the interpolations between each value in the input and output ranges. If provided as an array, the array must be one item shorter than the input and output ranges, as the easings apply to the transition between each.\n *\n * @returns `MotionValue`\n *\n * @public\n */\nexport function useTransform(\n value: MotionValue,\n inputRange: InputRange,\n outputRange: O[],\n options?: TransformOptions\n): MotionValue\n\n/**\n * Create a `MotionValue` that transforms the output of another `MotionValue` through a function.\n * In this example, `y` will always be double `x`.\n *\n * ```jsx\n * export const MyComponent = () => {\n * const x = useMotionValue(10)\n * const y = useTransform(x, value => value * 2)\n *\n * return \n * }\n * ```\n *\n * @param input - A `MotionValue` that will pass its latest value through `transform` to update the returned `MotionValue`.\n * @param transform - A function that accepts the latest value from `input` and returns a new value.\n * @returns `MotionValue`\n *\n * @public\n */\nexport function useTransform(\n input: MotionValue,\n transformer: SingleTransformer\n): MotionValue\n\n/**\n * Pass an array of `MotionValue`s and a function to combine them. In this example, `z` will be the `x` multiplied by `y`.\n *\n * ```jsx\n * export const MyComponent = () => {\n * const x = useMotionValue(0)\n * const y = useMotionValue(0)\n * const z = useTransform([x, y], ([latestX, latestY]) => latestX * latestY)\n *\n * return \n * }\n * ```\n *\n * @param input - An array of `MotionValue`s that will pass their latest values through `transform` to update the returned `MotionValue`.\n * @param transform - A function that accepts the latest values from `input` and returns a new value.\n * @returns `MotionValue`\n *\n * @public\n */\nexport function useTransform(\n input:\n | MotionValue[]\n | MotionValue[]\n | MotionValue[],\n transformer: MultiTransformer\n): MotionValue\nexport function useTransform(transformer: () => O): MotionValue\n\nexport function useTransform(\n input:\n | MotionValue\n | MotionValue[]\n | MotionValue[]\n | MotionValue[]\n | (() => O),\n inputRangeOrTransformer?: InputRange | Transformer,\n outputRangeOrMap?: O[] | OutputMap,\n options?: TransformOptions\n): MotionValue | { [key in K]: MotionValue } {\n if (typeof input === \"function\") {\n return useComputed(input)\n }\n\n /**\n * Detect if outputRangeOrMap is an output map (object with keys)\n * rather than an output range (array).\n */\n const isOutputMap =\n outputRangeOrMap !== undefined &&\n !Array.isArray(outputRangeOrMap) &&\n typeof inputRangeOrTransformer !== \"function\"\n\n if (isOutputMap) {\n return useMapTransform(\n input as MotionValue,\n inputRangeOrTransformer as InputRange,\n outputRangeOrMap as OutputMap,\n options\n ) as { [key in K]: MotionValue }\n }\n\n const outputRange = outputRangeOrMap as O[] | undefined\n const transformer =\n typeof inputRangeOrTransformer === \"function\"\n ? inputRangeOrTransformer\n : transform(inputRangeOrTransformer!, outputRange!, options)\n\n const result = Array.isArray(input)\n ? useListTransform(\n input,\n transformer as MultiTransformer\n )\n : useListTransform([input], ([latest]) =>\n (transformer as SingleTransformer)(latest)\n )\n\n const inputAccelerate = !Array.isArray(input)\n ? (input as MotionValue).accelerate\n : undefined\n\n if (\n inputAccelerate &&\n !inputAccelerate.isTransformed &&\n typeof inputRangeOrTransformer !== \"function\" &&\n Array.isArray(outputRangeOrMap) &&\n options?.clamp !== false\n ) {\n result.accelerate = {\n ...inputAccelerate,\n times: inputRangeOrTransformer as number[],\n keyframes: outputRangeOrMap,\n isTransformed: true,\n ...(options?.ease ? { ease: options.ease } : {}),\n }\n }\n\n return result\n}\n\nfunction useListTransform(\n values: MotionValue[],\n transformer: MultiTransformer\n): MotionValue {\n const latest = useConstant(() => [])\n\n return useCombineMotionValues(values, () => {\n latest.length = 0\n const numValues = values.length\n for (let i = 0; i < numValues; i++) {\n latest[i] = values[i].get()\n }\n\n return transformer(latest)\n })\n}\n\nfunction useMapTransform(\n inputValue: MotionValue,\n inputRange: InputRange,\n outputMap: OutputMap,\n options?: TransformOptions\n): { [key: string]: MotionValue } {\n /**\n * Capture keys once to ensure hooks are called in consistent order.\n */\n const keys = useConstant(() => Object.keys(outputMap))\n const output = useConstant<{ [key: string]: MotionValue }>(() => ({}))\n\n for (const key of keys) {\n output[key] = useTransform(inputValue, inputRange, outputMap[key], options)\n }\n\n return output\n}\n","const threshold = 50\nconst maxSpeed = 25\n\nconst overflowStyles = new Set([\"auto\", \"scroll\"])\n\n// Track initial scroll limits per scrollable element (Bug 1 fix)\nconst initialScrollLimits = new WeakMap()\n\n// Track auto-scroll active state per edge: \"start\" (top/left) or \"end\" (bottom/right)\ntype ActiveEdge = \"start\" | \"end\" | null\nconst activeScrollEdge = new WeakMap()\n\n// Track which group element is currently dragging to clear state on end\nlet currentGroupElement: Element | null = null\n\nexport function resetAutoScrollState(): void {\n if (currentGroupElement) {\n const scrollableAncestor = findScrollableAncestor(\n currentGroupElement,\n \"y\"\n )\n if (scrollableAncestor) {\n activeScrollEdge.delete(scrollableAncestor)\n initialScrollLimits.delete(scrollableAncestor)\n }\n // Also try x axis\n const scrollableAncestorX = findScrollableAncestor(\n currentGroupElement,\n \"x\"\n )\n if (scrollableAncestorX && scrollableAncestorX !== scrollableAncestor) {\n activeScrollEdge.delete(scrollableAncestorX)\n initialScrollLimits.delete(scrollableAncestorX)\n }\n currentGroupElement = null\n }\n}\n\nfunction isScrollableElement(element: Element, axis: \"x\" | \"y\"): boolean {\n const style = getComputedStyle(element)\n const overflow = axis === \"x\" ? style.overflowX : style.overflowY\n\n const isDocumentScroll =\n element === document.body ||\n element === document.documentElement\n\n return overflowStyles.has(overflow) || isDocumentScroll\n}\n\nfunction findScrollableAncestor(\n element: Element | null,\n axis: \"x\" | \"y\"\n): HTMLElement | null {\n let current = element?.parentElement\n while (current) {\n if (isScrollableElement(current, axis)) {\n return current\n }\n current = current.parentElement\n }\n return null\n}\n\nfunction getScrollAmount(\n pointerPosition: number,\n scrollElement: HTMLElement,\n axis: \"x\" | \"y\"\n): { amount: number; edge: ActiveEdge } {\n const rect = scrollElement.getBoundingClientRect()\n\n const start = axis === \"x\" ? Math.max(0, rect.left) : Math.max(0, rect.top)\n const end = axis === \"x\" ? Math.min(window.innerWidth, rect.right) : Math.min(window.innerHeight, rect.bottom)\n\n const distanceFromStart = pointerPosition - start\n const distanceFromEnd = end - pointerPosition\n\n if (distanceFromStart < threshold) {\n const intensity = 1 - distanceFromStart / threshold\n return { amount: -maxSpeed * intensity * intensity, edge: \"start\" }\n } else if (distanceFromEnd < threshold) {\n const intensity = 1 - distanceFromEnd / threshold\n return { amount: maxSpeed * intensity * intensity, edge: \"end\" }\n }\n\n return { amount: 0, edge: null }\n}\n\nexport function autoScrollIfNeeded(\n groupElement: Element | null,\n pointerPosition: number,\n axis: \"x\" | \"y\",\n velocity: number\n): void {\n if (!groupElement) return\n\n // Track the group element for cleanup\n currentGroupElement = groupElement\n\n const scrollableAncestor = findScrollableAncestor(groupElement, axis)\n if (!scrollableAncestor) return\n\n // Convert pointer position from page coordinates to viewport coordinates.\n // The gesture system uses pageX/pageY but getBoundingClientRect() returns\n // viewport-relative coordinates, so we need to account for page scroll.\n const viewportPointerPosition =\n pointerPosition - (axis === \"x\" ? window.scrollX : window.scrollY)\n\n const { amount: scrollAmount, edge } = getScrollAmount(\n viewportPointerPosition,\n scrollableAncestor,\n axis\n )\n\n // If not in any threshold zone, clear all state\n if (edge === null) {\n activeScrollEdge.delete(scrollableAncestor)\n initialScrollLimits.delete(scrollableAncestor)\n return\n }\n\n const currentActiveEdge = activeScrollEdge.get(scrollableAncestor)\n\n const isDocumentScroll =\n scrollableAncestor === document.body ||\n scrollableAncestor === document.documentElement\n\n // If not currently scrolling this edge, check velocity to see if we should start\n if (currentActiveEdge !== edge) {\n // Only start scrolling if velocity is towards the edge\n const shouldStart =\n (edge === \"start\" && velocity < 0) ||\n (edge === \"end\" && velocity > 0)\n if (!shouldStart) return\n\n // Activate this edge\n activeScrollEdge.set(scrollableAncestor, edge)\n\n // Record initial scroll limit (prevents infinite scroll)\n const maxScroll =\n axis === \"x\"\n ? scrollableAncestor.scrollWidth - (isDocumentScroll ? window.innerWidth : scrollableAncestor.clientWidth)\n : scrollableAncestor.scrollHeight - (isDocumentScroll ? window.innerHeight : scrollableAncestor.clientHeight)\n\n initialScrollLimits.set(scrollableAncestor, maxScroll)\n }\n\n // Cap scrolling at initial limit (prevents infinite scroll)\n if (scrollAmount > 0) {\n const initialLimit = initialScrollLimits.get(scrollableAncestor)!\n const currentScroll =\n axis === \"x\"\n ? (isDocumentScroll ? window.scrollX : scrollableAncestor.scrollLeft)\n : (isDocumentScroll ? window.scrollY : scrollableAncestor.scrollTop)\n if (currentScroll >= initialLimit) return\n }\n\n // Apply scroll\n if (axis === \"x\") {\n if (isDocumentScroll) {\n window.scrollBy({ left: scrollAmount })\n } else {\n scrollableAncestor.scrollLeft += scrollAmount\n }\n } else {\n if (isDocumentScroll) {\n window.scrollBy({ top: scrollAmount })\n } else {\n scrollableAncestor.scrollTop += scrollAmount\n }\n }\n}\n","\"use client\"\n\nimport { isMotionValue } from \"motion-dom\"\nimport { invariant } from \"motion-utils\"\nimport * as React from \"react\"\nimport { forwardRef, FunctionComponent, useContext } from \"react\"\nimport { ReorderContext } from \"../../context/ReorderContext\"\nimport { motion } from \"../../render/components/motion/proxy\"\nimport { HTMLMotionProps } from \"../../render/html/types\"\nimport { useConstant } from \"../../utils/use-constant\"\nimport { useMotionValue } from \"../../value/use-motion-value\"\nimport { useTransform } from \"../../value/use-transform\"\n\nimport { DefaultItemElement, ReorderElementTag } from \"./types\"\nimport { autoScrollIfNeeded, resetAutoScrollState } from \"./utils/auto-scroll\"\n\nexport interface Props<\n V,\n TagName extends ReorderElementTag = DefaultItemElement\n> {\n /**\n * A HTML element to render this component as. Defaults to `\"li\"`.\n *\n * @public\n */\n as?: TagName\n\n /**\n * The value in the list that this component represents.\n *\n * @public\n */\n value: V\n\n /**\n * A subset of layout options primarily used to disable layout=\"size\"\n *\n * @public\n * @default true\n */\n layout?: true | \"position\"\n}\n\nfunction useDefaultMotionValue(value: any, defaultValue: number = 0) {\n return isMotionValue(value) ? value : useMotionValue(defaultValue)\n}\n\ntype ReorderItemProps<\n V,\n TagName extends ReorderElementTag = DefaultItemElement\n> = Props &\n Omit, \"value\" | \"layout\"> &\n React.PropsWithChildren<{}>\n\nexport function ReorderItemComponent<\n V,\n TagName extends ReorderElementTag = DefaultItemElement\n>(\n {\n children,\n style = {},\n value,\n as = \"li\" as TagName,\n onDrag,\n onDragEnd,\n layout = true,\n ...props\n }: ReorderItemProps,\n externalRef?: React.ForwardedRef\n): React.JSX.Element {\n const Component = useConstant(\n () => motion[as as keyof typeof motion]\n ) as FunctionComponent<\n React.PropsWithChildren & { ref?: React.Ref }>\n >\n\n const context = useContext(ReorderContext)\n const point = {\n x: useDefaultMotionValue(style.x),\n y: useDefaultMotionValue(style.y),\n }\n\n const zIndex = useTransform([point.x, point.y], ([latestX, latestY]) =>\n latestX || latestY ? 1 : \"unset\"\n )\n\n invariant(\n Boolean(context),\n \"Reorder.Item must be a child of Reorder.Group\",\n \"reorder-item-child\"\n )\n\n const { axis, registerItem, updateOrder, groupRef } = context!\n const dragAxis = axis === \"xy\" ? true : axis\n\n return (\n {\n const { velocity, point: pointerPoint } = gesturePoint\n const offset = { x: point.x.get(), y: point.y.get() }\n\n updateOrder(value, offset, velocity)\n\n const scrollAxis =\n axis === \"xy\"\n ? Math.abs(velocity.x) > Math.abs(velocity.y)\n ? \"x\"\n : \"y\"\n : axis\n autoScrollIfNeeded(\n groupRef.current,\n pointerPoint[scrollAxis],\n scrollAxis,\n velocity[scrollAxis]\n )\n\n onDrag && onDrag(event, gesturePoint)\n }}\n onDragEnd={(event, gesturePoint) => {\n resetAutoScrollState()\n onDragEnd && onDragEnd(event, gesturePoint)\n }}\n onLayoutMeasure={(measured) => {\n registerItem(value, measured)\n }}\n ref={externalRef}\n ignoreStrict\n >\n {children}\n \n )\n}\n\nexport const ReorderItem = /*@__PURE__*/ forwardRef(ReorderItemComponent) as <\n V,\n TagName extends ReorderElementTag = DefaultItemElement\n>(\n props: ReorderItemProps & { ref?: React.ForwardedRef }\n) => ReturnType\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(\n subject:\n | string\n | Element\n | Element[]\n | NodeListOf\n | O\n | O[]\n | null\n | undefined,\n keyframes: DOMKeyframesDefinition | ObjectTarget,\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\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()\n const elementCache = {}\n const timeLabels = new Map()\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(\n subject: Element | MotionValue | O,\n sequences: Map\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\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,\n keyframes: string | UnresolvedValueKeyframe[],\n options?: ValueAnimationTransition\n): AnimationPlaybackControlsWithThen[]\n/**\n * Animate a number\n */\nexport function animateSubject(\n value: number | MotionValue,\n keyframes: number | UnresolvedValueKeyframe[],\n options?: ValueAnimationTransition\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(\n object: O | O[],\n keyframes: ObjectTarget,\n options?: DynamicAnimationOptions\n): AnimationPlaybackControlsWithThen[]\n/**\n * Implementation\n */\nexport function animateSubject(\n subject:\n | MotionValue\n | MotionValue\n | number\n | string\n | ElementOrSelector\n | O\n | O[],\n keyframes:\n | number\n | string\n | UnresolvedValueKeyframe[]\n | UnresolvedValueKeyframe[]\n | DOMKeyframesDefinition\n | ObjectTarget,\n options?:\n | ValueAnimationTransition\n | ValueAnimationTransition\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,\n keyframes: string | UnresolvedValueKeyframe[],\n options?: ValueAnimationTransition\n ): AnimationPlaybackControlsWithThen\n /**\n * Animate a number\n */\n function scopedAnimate(\n value: number | MotionValue,\n keyframes: number | UnresolvedValueKeyframe[],\n options?: ValueAnimationTransition\n ): AnimationPlaybackControlsWithThen\n /**\n * Animate a generic motion value\n */\n function scopedAnimate(\n value: V | MotionValue,\n keyframes: V | UnresolvedValueKeyframe[],\n options?: ValueAnimationTransition\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(\n object: O | O[],\n keyframes: ObjectTarget,\n options?: DynamicAnimationOptions\n ): AnimationPlaybackControlsWithThen\n /**\n * Implementation\n */\n function scopedAnimate(\n subjectOrSequence:\n | AnimationSequence\n | MotionValue\n | MotionValue\n | number\n | string\n | ElementOrSelector\n | O\n | O[],\n optionsOrKeyframes?:\n | SequenceOptions\n | number\n | string\n | UnresolvedValueKeyframe[]\n | UnresolvedValueKeyframe[]\n | DOMKeyframesDefinition\n | ObjectTarget,\n options?:\n | ValueAnimationTransition\n | ValueAnimationTransition\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>\n key: string\n unresolvedKeyframes: UnresolvedValueKeyframe[]\n options: Omit & {\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 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 . Likewise we\n * can't use .getBBox() like most SVG elements as these provide the offset\n * relative to the SVG itself, which for 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 = {\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 = {\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()\nconst resizeListeners = new WeakMap()\nconst onScrollHandlers = new WeakMap>()\nconst scrollSize = new WeakMap()\nconst dimensionCheckProcesses = new WeakMap()\n\nexport type ScrollTargets = Array\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 = {\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>\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()\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 { createMotionProxy } from \"../create-proxy\"\n\nexport const m = /*@__PURE__*/ createMotionProxy()\n","\"use client\"\n\nimport { useEffect } from \"react\"\n\nexport function useUnmountEffect(callback: () => void) {\n return useEffect(() => () => callback(), [])\n}\n","\"use client\"\n\nimport { animations } from \"../../motion/features/animations\"\nimport { gestureAnimations } from \"../../motion/features/gestures\"\nimport { FeatureBundle } from \"../../motion/features/types\"\nimport { createDomVisualElement } from \"./create-visual-element\"\n\n/**\n * @public\n */\nexport const domAnimation: FeatureBundle = {\n renderer: createDomVisualElement,\n ...animations,\n ...gestureAnimations,\n}\n","\"use client\"\n\nimport { drag } from \"../../motion/features/drag\"\nimport { layout } from \"../../motion/features/layout\"\nimport { FeatureBundle } from \"../../motion/features/types\"\nimport { domAnimation } from \"./features-animation\"\n\n/**\n * @public\n */\nexport const domMax: FeatureBundle = {\n ...domAnimation,\n ...drag,\n ...layout,\n}\n","\"use client\"\n\nimport { animations } from \"../../motion/features/animations\"\nimport { FeatureBundle } from \"../../motion/features/types\"\nimport { createDomVisualElement } from \"./create-visual-element\"\n\n/**\n * @public\n */\nexport const domMin: FeatureBundle = {\n renderer: createDomVisualElement,\n ...animations,\n}\n","\"use client\"\n\nimport { MotionValue, MotionValueEventCallbacks } from \"motion-dom\"\nimport { useInsertionEffect } from \"react\"\n\nexport function useMotionValueEvent<\n V,\n EventName extends keyof MotionValueEventCallbacks\n>(\n value: MotionValue,\n event: EventName,\n callback: MotionValueEventCallbacks[EventName]\n) {\n /**\n * useInsertionEffect will create subscriptions before any other\n * effects will run. Effects run upwards through the tree so it\n * can be that binding a useLayoutEffect higher up the tree can\n * miss changes from lower down the tree.\n */\n useInsertionEffect(\n () => value.on(event, callback),\n [value, event, callback]\n )\n}\n","\"use client\"\n\nimport {\n AnimationPlaybackControls,\n cancelMicrotask,\n microtask,\n motionValue,\n supportsScrollTimeline,\n supportsViewTimeline,\n} from \"motion-dom\"\nimport { invariant } from \"motion-utils\"\nimport { RefObject, useCallback, useEffect, useRef } from \"react\"\nimport { scroll } from \"../render/dom/scroll\"\nimport { ScrollInfoOptions } from \"../render/dom/scroll/types\"\nimport { offsetToViewTimelineRange } from \"../render/dom/scroll/utils/offset-to-range\"\nimport { useConstant } from \"../utils/use-constant\"\nimport { useIsomorphicLayoutEffect } from \"../utils/use-isomorphic-effect\"\n\nexport interface UseScrollOptions\n extends Omit {\n container?: RefObject\n target?: RefObject\n}\n\nconst createScrollMotionValues = () => ({\n scrollX: motionValue(0),\n scrollY: motionValue(0),\n scrollXProgress: motionValue(0),\n scrollYProgress: motionValue(0),\n})\n\nconst isRefPending = (ref?: RefObject) => {\n if (!ref) return false\n return !ref.current\n}\n\nfunction makeAccelerateConfig(\n axis: \"x\" | \"y\",\n options: Omit,\n container?: RefObject,\n target?: RefObject\n) {\n return {\n // Refs attach child-first; defer so target.current is populated\n // before scroll() reads it.\n factory: (animation: AnimationPlaybackControls) => {\n let cleanup: VoidFunction | undefined\n const start = () => {\n // A provided ref may be hydrated by an effect declared after\n // useScroll (or in a parent). Don't attach to the window\n // scroll in the meantime — that result gets cached and would\n // permanently mistrack. Wait until the ref resolves.\n if (isRefPending(container) || isRefPending(target)) {\n microtask.read(start)\n return\n }\n cleanup = scroll(animation, {\n ...options,\n axis,\n container: container?.current || undefined,\n target: target?.current || undefined,\n })\n }\n microtask.read(start)\n return () => {\n cancelMicrotask(start)\n cleanup?.()\n }\n },\n times: [0, 1],\n keyframes: [0, 1],\n ease: (v: number) => v,\n duration: 1,\n }\n}\n\nfunction canAccelerateScroll(\n target?: RefObject,\n offset?: ScrollInfoOptions[\"offset\"]\n) {\n if (typeof window === \"undefined\") return false\n return target\n ? supportsViewTimeline() && !!offsetToViewTimelineRange(offset)\n : supportsScrollTimeline()\n}\n\nexport function useScroll({\n container,\n target,\n ...options\n}: UseScrollOptions = {}) {\n const values = useConstant(createScrollMotionValues)\n\n if (canAccelerateScroll(target, options.offset)) {\n values.scrollXProgress.accelerate = makeAccelerateConfig(\n \"x\",\n options,\n container,\n target\n )\n values.scrollYProgress.accelerate = makeAccelerateConfig(\n \"y\",\n options,\n container,\n target\n )\n }\n\n const scrollAnimation = useRef(null)\n const needsStart = useRef(false)\n\n const start = useCallback(() => {\n scrollAnimation.current = scroll(\n (\n _progress: number,\n {\n x,\n y,\n }: {\n x: { current: number; progress: number }\n y: { current: number; progress: number }\n }\n ) => {\n values.scrollX.set(x.current)\n values.scrollXProgress.set(x.progress)\n values.scrollY.set(y.current)\n values.scrollYProgress.set(y.progress)\n },\n {\n ...options,\n container: container?.current || undefined,\n target: target?.current || undefined,\n }\n )\n\n return () => {\n scrollAnimation.current?.()\n }\n }, [container, target, JSON.stringify(options.offset)])\n\n useIsomorphicLayoutEffect(() => {\n needsStart.current = false\n\n if (isRefPending(container) || isRefPending(target)) {\n needsStart.current = true\n return\n } else {\n return start()\n }\n }, [start])\n\n useEffect(() => {\n if (!needsStart.current) return\n\n // Defer to a microtask so any sibling/parent effect that hydrates the\n // ref has a chance to run first.\n let cleanup: VoidFunction | undefined\n const tryStart = () => {\n const containerPending = isRefPending(container)\n const targetPending = isRefPending(target)\n invariant(\n !containerPending,\n \"Container ref is defined but not hydrated\",\n \"use-scroll-ref\"\n )\n invariant(\n !targetPending,\n \"Target ref is defined but not hydrated\",\n \"use-scroll-ref\"\n )\n if (!containerPending && !targetPending) cleanup = start()\n }\n microtask.read(tryStart)\n\n return () => {\n cancelMicrotask(tryStart)\n cleanup?.()\n }\n }, [start])\n\n return values\n}\n","import { warnOnce } from \"motion-utils\"\nimport { RefObject } from \"react\"\nimport { useScroll } from \"../use-scroll\"\n\n/**\n * @deprecated useElementScroll is deprecated. Convert to useScroll({ container: ref })\n */\nexport function useElementScroll(ref: RefObject) {\n if (process.env.NODE_ENV === \"development\") {\n warnOnce(\n false,\n \"useElementScroll is deprecated. Convert to useScroll({ container: ref }).\"\n )\n }\n\n return useScroll({ container: ref })\n}\n","import { warnOnce } from \"motion-utils\"\nimport { useScroll } from \"../use-scroll\"\n\n/**\n * @deprecated useViewportScroll is deprecated. Convert to useScroll()\n */\nexport function useViewportScroll() {\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(\n false,\n \"useViewportScroll is deprecated. Convert to useScroll().\"\n )\n }\n return useScroll()\n}\n","\"use client\"\n\nimport { isMotionValue, MotionValue } from \"motion-dom\"\nimport { useCombineMotionValues } from \"./use-combine-values\"\n\n/**\n * Combine multiple motion values into a new one using a string template literal.\n *\n * ```jsx\n * import {\n * motion,\n * useSpring,\n * useMotionValue,\n * useMotionTemplate\n * } from \"framer-motion\"\n *\n * function Component() {\n * const shadowX = useSpring(0)\n * const shadowY = useMotionValue(0)\n * const shadow = useMotionTemplate`drop-shadow(${shadowX}px ${shadowY}px 20px rgba(0,0,0,0.3))`\n *\n * return \n * }\n * ```\n *\n * @public\n */\nexport function useMotionTemplate(\n fragments: TemplateStringsArray,\n ...values: Array\n) {\n /**\n * Create a function that will build a string from the latest motion values.\n */\n const numFragments = fragments.length\n\n function buildValue() {\n let output = ``\n\n for (let i = 0; i < numFragments; i++) {\n output += fragments[i]\n const value = values[i]\n if (value) {\n output += isMotionValue(value) ? value.get() : value\n }\n }\n\n return output\n }\n\n return useCombineMotionValues(values.filter(isMotionValue), buildValue)\n}\n","\"use client\"\n\nimport {\n AnyResolvedKeyframe,\n attachFollow,\n FollowValueOptions,\n isMotionValue,\n MotionValue,\n} from \"motion-dom\"\nimport { useContext, useInsertionEffect } from \"react\"\nimport { MotionConfigContext } from \"../context/MotionConfigContext\"\nimport { useMotionValue } from \"./use-motion-value\"\nimport { useTransform } from \"./use-transform\"\n\n/**\n * Creates a `MotionValue` that, when `set`, will use the specified animation transition to animate to its new state.\n *\n * Unlike `useSpring` which is limited to spring animations, `useFollowValue` accepts any motion transition\n * including spring, tween, inertia, and keyframes.\n *\n * It can either work as a stand-alone `MotionValue` by initialising it with a value, or as a subscriber\n * to another `MotionValue`.\n *\n * @remarks\n *\n * ```jsx\n * // Spring animation (default)\n * const x = useFollowValue(0, { stiffness: 300 })\n *\n * // Tween animation\n * const y = useFollowValue(0, { type: \"tween\", duration: 0.5, ease: \"easeOut\" })\n *\n * // Track another MotionValue with spring\n * const source = useMotionValue(0)\n * const z = useFollowValue(source, { type: \"spring\", damping: 10 })\n *\n * // Inertia animation\n * const w = useFollowValue(0, { type: \"inertia\", velocity: 100 })\n * ```\n *\n * @param inputValue - `MotionValue` or number. If provided a `MotionValue`, when the input `MotionValue` changes, the created `MotionValue` will animate towards that value using the specified transition.\n * @param options - Animation transition options. Supports all transition types: spring, tween, inertia, keyframes.\n * @returns `MotionValue`\n *\n * @public\n */\nexport function useFollowValue(\n source: MotionValue,\n options?: FollowValueOptions\n): MotionValue\nexport function useFollowValue(\n source: string,\n options?: FollowValueOptions\n): MotionValue\nexport function useFollowValue(\n source: MotionValue,\n options?: FollowValueOptions\n): MotionValue\nexport function useFollowValue(\n source: number,\n options?: FollowValueOptions\n): MotionValue\nexport function useFollowValue(\n source: MotionValue | MotionValue | AnyResolvedKeyframe,\n options: FollowValueOptions = {}\n) {\n const { isStatic } = useContext(MotionConfigContext)\n const getFromSource = () => (isMotionValue(source) ? source.get() : source)\n\n // isStatic will never change, allowing early hooks return\n if (isStatic) {\n return useTransform(getFromSource)\n }\n\n const value = useMotionValue(getFromSource())\n\n useInsertionEffect(() => {\n return attachFollow(value, source, options)\n }, [value, JSON.stringify(options)])\n\n return value\n}\n","\"use client\"\n\nimport { FollowValueOptions, MotionValue, SpringOptions } from \"motion-dom\"\nimport { useFollowValue } from \"./use-follow-value\"\n\ntype UseSpringOptions = SpringOptions &\n Pick\n\n/**\n * Creates a `MotionValue` that, when `set`, will use a spring animation to animate to its new state.\n *\n * It can either work as a stand-alone `MotionValue` by initialising it with a value, or as a subscriber\n * to another `MotionValue`.\n *\n * @remarks\n *\n * ```jsx\n * const x = useSpring(0, { stiffness: 300 })\n * const y = useSpring(x, { damping: 10 })\n * ```\n *\n * @param inputValue - `MotionValue` or number. If provided a `MotionValue`, when the input `MotionValue` changes, the created `MotionValue` will spring towards that value.\n * @param springConfig - Configuration options for the spring.\n * @returns `MotionValue`\n *\n * @public\n */\nexport function useSpring(\n source: MotionValue,\n options?: UseSpringOptions\n): MotionValue\nexport function useSpring(\n source: string,\n options?: UseSpringOptions\n): MotionValue\nexport function useSpring(\n source: MotionValue,\n options?: UseSpringOptions\n): MotionValue\nexport function useSpring(\n source: number,\n options?: UseSpringOptions\n): MotionValue\nexport function useSpring(\n source: MotionValue | MotionValue | string | number,\n options: UseSpringOptions = {}\n): MotionValue | MotionValue {\n return useFollowValue(source as any, { type: \"spring\", ...options })\n}\n","\"use client\"\n\nimport { cancelFrame, frame, FrameData } from \"motion-dom\"\nimport { useContext, useEffect, useRef } from \"react\"\nimport { MotionConfigContext } from \"../context/MotionConfigContext\"\n\nexport type FrameCallback = (timestamp: number, delta: number) => void\n\nexport function useAnimationFrame(callback: FrameCallback) {\n const initialTimestamp = useRef(0)\n const { isStatic } = useContext(MotionConfigContext)\n\n useEffect(() => {\n if (isStatic) return\n\n const provideTimeSinceStart = ({ timestamp, delta }: FrameData) => {\n if (!initialTimestamp.current) initialTimestamp.current = timestamp\n\n callback(timestamp - initialTimestamp.current, delta)\n }\n\n frame.update(provideTimeSinceStart, true)\n return () => cancelFrame(provideTimeSinceStart)\n }, [callback])\n}\n","\"use client\"\n\nimport { useAnimationFrame } from \"../utils/use-animation-frame\"\nimport { useMotionValue } from \"./use-motion-value\"\n\nexport function useTime() {\n const time = useMotionValue(0)\n useAnimationFrame((t) => time.set(t))\n return time\n}\n","\"use client\"\n\nimport { frame, MotionValue } from \"motion-dom\"\nimport { useMotionValueEvent } from \"../utils/use-motion-value-event\"\nimport { useMotionValue } from \"./use-motion-value\"\n/**\n * Creates a `MotionValue` that updates when the velocity of the provided `MotionValue` changes.\n *\n * ```javascript\n * const x = useMotionValue(0)\n * const xVelocity = useVelocity(x)\n * const xAcceleration = useVelocity(xVelocity)\n * ```\n *\n * @public\n */\nexport function useVelocity(value: MotionValue): MotionValue {\n const velocity = useMotionValue(value.getVelocity())\n\n const updateVelocity = () => {\n const latest = value.getVelocity()\n velocity.set(latest)\n\n /**\n * If we still have velocity, schedule an update for the next frame\n * to keep checking until it is zero.\n */\n if (latest) frame.update(updateVelocity)\n }\n\n useMotionValueEvent(value, \"change\", () => {\n // Schedule an update to this value at the end of the current frame.\n frame.update(updateVelocity, false, true)\n })\n\n return velocity\n}\n","import {\n acceleratedValues,\n MotionValue,\n transformProps,\n type WillChange,\n} from \"motion-dom\"\n\nexport class WillChangeMotionValue\n extends MotionValue\n implements WillChange\n{\n private isEnabled = false\n\n add(name: string) {\n if (transformProps.has(name) || acceleratedValues.has(name)) {\n this.isEnabled = true\n this.update()\n }\n }\n\n private update() {\n this.set(this.isEnabled ? \"transform\" : \"auto\")\n }\n}\n","\"use client\"\n\nimport type { WillChange } from \"motion-dom\"\nimport { useConstant } from \"../../utils/use-constant\"\nimport { WillChangeMotionValue } from \"./WillChangeMotionValue\"\n\nexport function useWillChange(): WillChange {\n return useConstant(() => new WillChangeMotionValue(\"auto\"))\n}\n","\"use client\"\n\nimport {\n hasReducedMotionListener,\n initPrefersReducedMotion,\n prefersReducedMotion,\n} from \"motion-dom\"\nimport { warnOnce } from \"motion-utils\"\nimport { useState } from \"react\"\n\n/**\n * A hook that returns `true` if we should be using reduced motion based on the current device's Reduced Motion setting.\n *\n * This can be used to implement changes to your UI based on Reduced Motion. For instance, replacing motion-sickness inducing\n * `x`/`y` animations with `opacity`, disabling the autoplay of background videos, or turning off parallax motion.\n *\n * It will actively respond to changes and re-render your components with the latest setting.\n *\n * ```jsx\n * export function Sidebar({ isOpen }) {\n * const shouldReduceMotion = useReducedMotion()\n * const closedX = shouldReduceMotion ? 0 : \"-100%\"\n *\n * return (\n * \n * )\n * }\n * ```\n *\n * @return boolean\n *\n * @public\n */\nexport function useReducedMotion() {\n /**\n * Lazy initialisation of prefersReducedMotion\n */\n !hasReducedMotionListener.current && initPrefersReducedMotion()\n\n const [shouldReduceMotion] = useState(prefersReducedMotion.current)\n\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(\n shouldReduceMotion !== true,\n \"You have Reduced Motion enabled on your device. Animations may not appear as expected.\",\n \"reduced-motion-disabled\"\n )\n }\n\n /**\n * TODO See if people miss automatically updating shouldReduceMotion setting\n */\n\n return shouldReduceMotion\n}\n","\"use client\"\n\nimport { useContext } from \"react\"\nimport { MotionConfigContext } from \"../../context/MotionConfigContext\"\nimport { useReducedMotion } from \"./use-reduced-motion\"\n\nexport function useReducedMotionConfig() {\n const reducedMotionPreference = useReducedMotion()\n const { reducedMotion } = useContext(MotionConfigContext)\n\n if (reducedMotion === \"never\") {\n return false\n } else if (reducedMotion === \"always\") {\n return true\n } else {\n return reducedMotionPreference\n }\n}\n","import {\n animateVisualElement,\n setTarget,\n type AnimationDefinition,\n type LegacyAnimationControls,\n type VisualElement,\n} from \"motion-dom\"\nimport { invariant } from \"motion-utils\"\n\nfunction stopAnimation(visualElement: VisualElement) {\n visualElement.values.forEach((value) => value.stop())\n}\n\nfunction setVariants(visualElement: VisualElement, variantLabels: string[]) {\n const reversedLabels = [...variantLabels].reverse()\n\n reversedLabels.forEach((key) => {\n const variant = visualElement.getVariant(key)\n variant && setTarget(visualElement, variant)\n\n if (visualElement.variantChildren) {\n visualElement.variantChildren.forEach((child) => {\n setVariants(child, variantLabels)\n })\n }\n })\n}\n\nexport function setValues(\n visualElement: VisualElement,\n definition: AnimationDefinition\n) {\n if (Array.isArray(definition)) {\n return setVariants(visualElement, definition)\n } else if (typeof definition === \"string\") {\n return setVariants(visualElement, [definition])\n } else {\n setTarget(visualElement, definition as any)\n }\n}\n\n/**\n * @public\n */\nexport function animationControls(): LegacyAnimationControls {\n /**\n * Track whether the host component has mounted.\n */\n let hasMounted = false\n\n /**\n * A collection of linked component animation controls.\n */\n const subscribers = new Set()\n\n const controls: LegacyAnimationControls = {\n subscribe(visualElement) {\n subscribers.add(visualElement)\n return () => void subscribers.delete(visualElement)\n },\n\n start(definition, transitionOverride) {\n invariant(\n hasMounted,\n \"controls.start() should only be called after a component has mounted. Consider calling within a useEffect hook.\"\n )\n\n const animations: Array> = []\n subscribers.forEach((visualElement) => {\n animations.push(\n animateVisualElement(visualElement, definition, {\n transitionOverride,\n })\n )\n })\n\n return Promise.all(animations)\n },\n\n set(definition) {\n invariant(\n hasMounted,\n \"controls.set() should only be called after a component has mounted. Consider calling within a useEffect hook.\"\n )\n\n return subscribers.forEach((visualElement) => {\n setValues(visualElement, definition)\n })\n },\n\n stop() {\n subscribers.forEach((visualElement) => {\n stopAnimation(visualElement)\n })\n },\n\n mount() {\n hasMounted = true\n\n return () => {\n hasMounted = false\n controls.stop()\n }\n },\n }\n\n return controls\n}\n","\"use client\"\n\nimport { useContext, useMemo } from \"react\"\nimport { AnimationScope } from \"motion-dom\"\nimport { useConstant } from \"../../utils/use-constant\"\nimport { useUnmountEffect } from \"../../utils/use-unmount-effect\"\nimport { useReducedMotionConfig } from \"../../utils/reduced-motion/use-reduced-motion-config\"\nimport { MotionConfigContext } from \"../../context/MotionConfigContext\"\nimport { createScopedAnimate } from \"../animate\"\n\nexport function useAnimate() {\n const scope: AnimationScope = useConstant(() => ({\n current: null!, // Will be hydrated by React\n animations: [],\n }))\n\n const reduceMotion = useReducedMotionConfig() ?? undefined\n const { skipAnimations } = useContext(MotionConfigContext)\n\n const animate = useMemo(\n () => createScopedAnimate({ scope, reduceMotion, skipAnimations }),\n [scope, reduceMotion, skipAnimations]\n )\n\n useUnmountEffect(() => {\n scope.animations.forEach((animation) => animation.stop())\n scope.animations.length = 0\n })\n\n return [scope, animate] as [AnimationScope, typeof animate]\n}\n","\"use client\"\n\nimport { useConstant } from \"../../utils/use-constant\"\nimport { useUnmountEffect } from \"../../utils/use-unmount-effect\"\nimport { createScopedWaapiAnimate } from \"../animators/waapi/animate-style\"\nimport { AnimationScope } from \"motion-dom\"\n\nexport function useAnimateMini() {\n const scope: AnimationScope = useConstant(() => ({\n current: null!, // Will be hydrated by React\n animations: [],\n }))\n\n const animate = useConstant(() => createScopedWaapiAnimate(scope))\n\n useUnmountEffect(() => {\n scope.animations.forEach((animation) => animation.stop())\n })\n\n return [scope, animate] as [AnimationScope, typeof animate]\n}\n","\"use client\"\n\nimport { LegacyAnimationControls } from \"motion-dom\"\nimport { useConstant } from \"../../utils/use-constant\"\nimport { useIsomorphicLayoutEffect } from \"../../utils/use-isomorphic-effect\"\nimport { animationControls } from \"./animation-controls\"\n\n/**\n * Creates `LegacyAnimationControls`, which can be used to manually start, stop\n * and sequence animations on one or more components.\n *\n * The returned `LegacyAnimationControls` should be passed to the `animate` property\n * of the components you want to animate.\n *\n * These components can then be animated with the `start` method.\n *\n * ```jsx\n * import * as React from 'react'\n * import { motion, useAnimation } from 'framer-motion'\n *\n * export function MyComponent(props) {\n * const controls = useAnimation()\n *\n * controls.start({\n * x: 100,\n * transition: { duration: 0.5 },\n * })\n *\n * return \n * }\n * ```\n *\n * @returns Animation controller with `start` and `stop` methods\n *\n * @public\n */\nexport function useAnimationControls(): LegacyAnimationControls {\n const controls = useConstant(animationControls)\n\n useIsomorphicLayoutEffect(controls.mount, [])\n\n return controls\n}\n\nexport const useAnimation = useAnimationControls\n","\"use client\"\n\nimport { useContext } from \"react\"\nimport { PresenceContext } from \"../../context/PresenceContext\"\n\nexport function usePresenceData() {\n const context = useContext(PresenceContext)\n return context ? context.custom : undefined\n}\n","\"use client\"\n\nimport { RefObject, useEffect } from \"react\"\nimport { addDomEvent } from \"motion-dom\"\n\n/**\n * Attaches an event listener directly to the provided DOM element.\n *\n * Bypassing React's event system can be desirable, for instance when attaching non-passive\n * event handlers.\n *\n * ```jsx\n * const ref = useRef(null)\n *\n * useDomEvent(ref, 'wheel', onWheel, { passive: false })\n *\n * return
\n * ```\n *\n * @param ref - React.RefObject that's been provided to the element you want to bind the listener to.\n * @param eventName - Name of the event you want listen for.\n * @param handler - Function to fire when receiving the event.\n * @param options - Options to pass to `Event.addEventListener`.\n *\n * @public\n */\nexport function useDomEvent(\n ref: RefObject,\n eventName: string,\n handler?: EventListener | undefined,\n options?: AddEventListenerOptions\n) {\n useEffect(() => {\n const element = ref.current\n\n if (handler && element) {\n return addDomEvent(element, eventName, handler, options)\n }\n }, [ref, eventName, handler, options])\n}\n","import * as React from \"react\"\nimport { useConstant } from \"../../utils/use-constant\"\nimport {\n DragControlOptions,\n VisualElementDragControls,\n} from \"./VisualElementDragControls\"\n\n/**\n * Can manually trigger a drag gesture on one or more `drag`-enabled `motion` components.\n *\n * ```jsx\n * const dragControls = useDragControls()\n *\n * function startDrag(event) {\n * dragControls.start(event, { snapToCursor: true })\n * }\n *\n * return (\n * <>\n *
\n * \n * \n * )\n * ```\n *\n * @public\n */\nexport class DragControls {\n private componentControls = new Set()\n\n /**\n * Subscribe a component's internal `VisualElementDragControls` to the user-facing API.\n *\n * @internal\n */\n subscribe(controls: VisualElementDragControls): () => void {\n this.componentControls.add(controls)\n\n return () => this.componentControls.delete(controls)\n }\n\n /**\n * Start a drag gesture on every `motion` component that has this set of drag controls\n * passed into it via the `dragControls` prop.\n *\n * ```jsx\n * dragControls.start(e, {\n * snapToCursor: true\n * })\n * ```\n *\n * @param event - PointerEvent\n * @param options - Options\n *\n * @public\n */\n start(\n event: React.PointerEvent | PointerEvent,\n options?: DragControlOptions\n ) {\n this.componentControls.forEach((controls) => {\n controls.start(\n (event as React.PointerEvent).nativeEvent || event,\n options\n )\n })\n }\n\n /**\n * Cancels a drag gesture.\n *\n * ```jsx\n * dragControls.cancel()\n * ```\n *\n * @public\n */\n cancel() {\n this.componentControls.forEach((controls) => {\n controls.cancel()\n })\n }\n\n /**\n * Stops a drag gesture.\n *\n * ```jsx\n * dragControls.stop()\n * ```\n *\n * @public\n */\n stop() {\n this.componentControls.forEach((controls) => {\n controls.stop()\n })\n }\n}\n\nconst createDragControls = () => new DragControls()\n\n/**\n * Usually, dragging is initiated by pressing down on a `motion` component with a `drag` prop\n * and moving it. For some use-cases, for instance clicking at an arbitrary point on a video scrubber, we\n * might want to initiate that dragging from a different component than the draggable one.\n *\n * By creating a `dragControls` using the `useDragControls` hook, we can pass this into\n * the draggable component's `dragControls` prop. It exposes a `start` method\n * that can start dragging from pointer events on other components.\n *\n * ```jsx\n * const dragControls = useDragControls()\n *\n * function startDrag(event) {\n * dragControls.start(event, { snapToCursor: true })\n * }\n *\n * return (\n * <>\n *
\n * \n * \n * )\n * ```\n *\n * @public\n */\nexport function useDragControls() {\n return useConstant(createDragControls)\n}\n","import { motionComponentSymbol } from \"./symbol\"\n\n/**\n * Checks if a component is a `motion` component.\n */\nexport function isMotionComponent(component: React.ComponentType | string) {\n return (\n component !== null &&\n typeof component === \"object\" &&\n motionComponentSymbol in component\n )\n}\n","import { isMotionComponent } from \"./is-motion-component\"\nimport { motionComponentSymbol } from \"./symbol\"\n\n/**\n * Unwraps a `motion` component and returns either a string for `motion.div` or\n * the React component for `motion(Component)`.\n *\n * If the component is not a `motion` component it returns undefined.\n */\nexport function unwrapMotionComponent(\n component: React.ComponentType | string\n): React.ComponentType | string | undefined {\n if (isMotionComponent(component)) {\n return component[motionComponentSymbol as keyof typeof component]\n }\n\n return undefined\n}\n","import { rootProjectionNode } from \"motion-dom\"\n\nexport function useInstantLayoutTransition(): (\n cb?: (() => void) | undefined\n) => void {\n return startTransition\n}\n\nfunction startTransition(callback?: () => void) {\n if (!rootProjectionNode.current) return\n rootProjectionNode.current.isUpdating = false\n rootProjectionNode.current.blockUpdate()\n callback && callback()\n}\n","import { useCallback } from \"react\";\nimport { rootProjectionNode } from \"motion-dom\"\n\nexport function useResetProjection() {\n const reset = useCallback(() => {\n const root = rootProjectionNode.current\n if (!root) return\n root.resetTree()\n }, [])\n\n return reset\n}\n","\"use client\"\n\nimport { wrap } from \"motion-utils\"\nimport { useCallback, useRef, useState } from \"react\"\n\nexport type Cycle = (i?: number) => void\n\nexport type CycleState = [T, Cycle]\n\n/**\n * Cycles through a series of visual properties. Can be used to toggle between or cycle through animations. It works similar to `useState` in React. It is provided an initial array of possible states, and returns an array of two arguments.\n *\n * An index value can be passed to the returned `cycle` function to cycle to a specific index.\n *\n * ```jsx\n * import * as React from \"react\"\n * import { motion, useCycle } from \"framer-motion\"\n *\n * export const MyComponent = () => {\n * const [x, cycleX] = useCycle(0, 50, 100)\n *\n * return (\n * cycleX()}\n * />\n * )\n * }\n * ```\n *\n * @param items - items to cycle through\n * @returns [currentState, cycleState]\n *\n * @public\n */\nexport function useCycle(...items: T[]): CycleState {\n const index = useRef(0)\n const [item, setItem] = useState(items[index.current])\n\n const runCycle = useCallback(\n (next?: number) => {\n index.current =\n typeof next !== \"number\"\n ? wrap(0, items.length, index.current + 1)\n : next\n\n setItem(items[index.current])\n },\n // The array will change on each call, but by putting items.length at\n // the front of this array, we guarantee the dependency comparison will match up\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [items.length, ...items]\n )\n return [item, runCycle]\n}\n","\"use client\"\n\nimport { RefObject, useEffect, useState } from \"react\"\nimport { inView, InViewOptions } from \"../render/dom/viewport\"\n\nexport interface UseInViewOptions\n extends Omit {\n root?: RefObject\n once?: boolean\n amount?: \"some\" | \"all\" | number\n initial?: boolean\n}\n\nexport function useInView(\n ref: RefObject,\n {\n root,\n margin,\n amount,\n once = false,\n initial = false,\n }: UseInViewOptions = {}\n) {\n const [isInView, setInView] = useState(initial)\n\n useEffect(() => {\n if (!ref.current || (once && isInView)) return\n\n const onEnter = () => {\n setInView(true)\n\n return once ? undefined : () => setInView(false)\n }\n\n const options: InViewOptions = {\n root: (root && root.current) || undefined,\n margin,\n amount,\n }\n\n return inView(ref.current, onEnter, options)\n }, [root, ref, margin, once, amount])\n\n return isInView\n}\n","\"use client\"\n\nimport { frame } from \"motion-dom\"\nimport { MotionGlobalConfig } from \"motion-utils\"\nimport { useEffect, useRef } from \"react\"\nimport { useInstantLayoutTransition } from \"../projection/use-instant-layout-transition\"\nimport { useForceUpdate } from \"./use-force-update\"\n\nexport function useInstantTransition() {\n const [forceUpdate, forcedRenderCount] = useForceUpdate()\n const startInstantLayoutTransition = useInstantLayoutTransition()\n const unlockOnFrameRef = useRef(-1)\n\n useEffect(() => {\n /**\n * Unblock after two animation frames, otherwise this will unblock too soon.\n */\n frame.postRender(() =>\n frame.postRender(() => {\n /**\n * If the callback has been called again after the effect\n * triggered this 2 frame delay, don't unblock animations. This\n * prevents the previous effect from unblocking the current\n * instant transition too soon. This becomes more likely when\n * used in conjunction with React.startTransition().\n */\n if (forcedRenderCount !== unlockOnFrameRef.current) return\n MotionGlobalConfig.instantAnimations = false\n })\n )\n }, [forcedRenderCount])\n\n return (callback: () => void) => {\n startInstantLayoutTransition(() => {\n MotionGlobalConfig.instantAnimations = true\n forceUpdate()\n callback()\n unlockOnFrameRef.current = forcedRenderCount + 1\n })\n }\n}\n\nexport function disableInstantTransitions() {\n MotionGlobalConfig.instantAnimations = false\n}\n","\"use client\"\n\nimport { useEffect, useState } from \"react\"\n\nexport function usePageInView() {\n const [isInView, setIsInView] = useState(true)\n\n useEffect(() => {\n const handleVisibilityChange = () => setIsInView(!document.hidden)\n\n if (document.hidden) {\n handleVisibilityChange()\n }\n\n document.addEventListener(\"visibilitychange\", handleVisibilityChange)\n\n return () => {\n document.removeEventListener(\n \"visibilitychange\",\n handleVisibilityChange\n )\n }\n }, [])\n\n return isInView\n}\n","import type { Point, TransformPoint } from \"motion-utils\"\nimport type { RefObject } from \"react\"\n\n/**\n * Creates a `transformPagePoint` function that accounts for SVG viewBox scaling.\n *\n * When dragging SVG elements inside an SVG with a viewBox that differs from\n * the rendered dimensions (e.g., `viewBox=\"0 0 100 100\"` but rendered at 500x500 pixels),\n * pointer coordinates need to be transformed to match the SVG's coordinate system.\n *\n * @example\n * ```jsx\n * function App() {\n * const svgRef = useRef(null)\n *\n * return (\n * \n * \n * \n * \n * \n * )\n * }\n * ```\n *\n * @param svgRef - A React ref to the SVG element\n * @returns A transformPagePoint function for use with MotionConfig\n *\n * @public\n */\nexport function transformViewBoxPoint(\n svgRef: RefObject\n): TransformPoint {\n return (point: Point): Point => {\n const svg = svgRef.current\n if (!svg) {\n return point\n }\n\n // Get the viewBox attribute\n const viewBox = svg.viewBox?.baseVal\n if (!viewBox || (viewBox.width === 0 && viewBox.height === 0)) {\n // No viewBox or empty viewBox - no transformation needed\n return point\n }\n\n // Get the rendered dimensions of the SVG\n const bbox = svg.getBoundingClientRect()\n if (bbox.width === 0 || bbox.height === 0) {\n return point\n }\n\n // Calculate scale factors\n const scaleX = viewBox.width / bbox.width\n const scaleY = viewBox.height / bbox.height\n\n // Get the SVG's position on the page\n const svgX = bbox.left + window.scrollX\n const svgY = bbox.top + window.scrollY\n\n // Transform the point:\n // 1. Calculate position relative to SVG\n // 2. Scale by viewBox/viewport ratio\n // 3. Add back the SVG position (but in SVG coordinates)\n return {\n x: (point.x - svgX) * scaleX + svgX,\n y: (point.y - svgY) * scaleY + svgY,\n }\n }\n}\n","import type { Point, TransformPoint } from \"motion-utils\"\nimport type { RefObject } from \"react\"\n\n/**\n * Creates a `transformPagePoint` function that corrects pointer coordinates\n * for a parent container with CSS transforms (rotation, scale, skew).\n *\n * When dragging elements inside a transformed parent, pointer coordinates\n * need to be transformed through the inverse of the parent's transform\n * so the drag offset is in local space.\n *\n * Works with both static and continuously animating transforms.\n *\n * @example\n * ```jsx\n * function App() {\n * const ref = useRef(null)\n *\n * return (\n * \n * \n * \n * \n * \n * )\n * }\n * ```\n *\n * @param parentRef - A React ref to the transformed parent element\n * @returns A transformPagePoint function for use with MotionConfig\n *\n * @public\n */\nexport function correctParentTransform(\n parentRef: RefObject\n): TransformPoint {\n return (point: Point): Point => {\n const parent = parentRef.current\n if (!parent) return point\n\n const inv = getInverseMatrix(parent)\n if (!inv) return point\n\n // Get center of rotation in page space\n const rect = parent.getBoundingClientRect()\n const cx = rect.left + window.scrollX + rect.width / 2\n const cy = rect.top + window.scrollY + rect.height / 2\n\n // Transform (point - center) through inverse, then add center back\n const dx = point.x - cx\n const dy = point.y - cy\n return {\n x: cx + inv.a * dx + inv.c * dy,\n y: cy + inv.b * dx + inv.d * dy,\n }\n }\n}\n\ninterface InverseMatrix {\n a: number\n b: number\n c: number\n d: number\n}\n\nfunction getInverseMatrix(element: HTMLElement): InverseMatrix | null {\n const { transform } = getComputedStyle(element)\n if (!transform || transform === \"none\") return null\n\n const match =\n transform.match(/^matrix3d\\((.*)\\)$/u) ||\n transform.match(/^matrix\\((.*)\\)$/u)\n if (!match) return null\n\n const v = match[1].split(\",\").map(Number)\n const is3d = transform.startsWith(\"matrix3d\")\n const a = v[0],\n b = v[1]\n const c = is3d ? v[4] : v[2]\n const d = is3d ? v[5] : v[3]\n\n const det = a * d - b * c\n if (Math.abs(det) < 1e-10) return null\n\n return { a: d / det, b: -b / det, c: -c / det, d: a / det }\n}\n","export interface AppearStoreEntry {\n animation: Animation\n startTime: number | null\n}\n\nexport type AppearElementId = string\n\nexport type IsComplete = boolean\n\nexport const appearAnimationStore = new Map()\n\nexport const appearComplete = new Map()\n","import { transformProps } from \"motion-dom\"\n\nexport const appearStoreId = (elementId: string, valueName: string) => {\n const key = transformProps.has(valueName) ? \"transform\" : valueName\n\n return `${elementId}: ${key}`\n}\n","import type { Batcher } from \"motion-dom\"\nimport { appearAnimationStore } from \"./store\"\nimport { appearStoreId } from \"./store-id\"\n\nexport function handoffOptimizedAppearAnimation(\n elementId: string,\n valueName: string,\n frame: Batcher\n): number | null {\n const storeId = appearStoreId(elementId, valueName)\n const optimisedAnimation = appearAnimationStore.get(storeId)\n\n if (!optimisedAnimation) {\n return null\n }\n\n const { animation, startTime } = optimisedAnimation\n\n function cancelAnimation() {\n window.MotionCancelOptimisedAnimation?.(elementId, valueName, frame)\n }\n\n /**\n * We can cancel the animation once it's finished now that we've synced\n * with Motion.\n *\n * Prefer onfinish over finished as onfinish is backwards compatible with\n * older browsers.\n */\n animation.onfinish = cancelAnimation\n\n if (startTime === null || window.MotionHandoffIsComplete?.(elementId)) {\n /**\n * If the startTime is null, this animation is the Paint Ready detection animation\n * and we can cancel it immediately without handoff.\n *\n * Or if we've already handed off the animation then we're now interrupting it.\n * In which case we need to cancel it.\n */\n cancelAnimation()\n return null\n } else {\n return startTime\n }\n}\n","import {\n AnyResolvedKeyframe,\n Batcher,\n getOptimisedAppearId,\n MotionValue,\n optimizedAppearDataId,\n startWaapiAnimation,\n ValueAnimationTransition,\n type WithAppearProps,\n} from \"motion-dom\"\nimport { noop } from \"motion-utils\"\nimport { handoffOptimizedAppearAnimation } from \"./handoff\"\nimport { appearAnimationStore, appearComplete, AppearStoreEntry } from \"./store\"\nimport { appearStoreId } from \"./store-id\"\n\n/**\n * A single time to use across all animations to manually set startTime\n * and ensure they're all in sync.\n */\nlet startFrameTime: number\n\n/**\n * A dummy animation to detect when Chrome is ready to start\n * painting the page and hold off from triggering the real animation\n * until then. We only need one animation to detect paint ready.\n *\n * https://bugs.chromium.org/p/chromium/issues/detail?id=1406850\n */\nlet readyAnimation: Animation\n\n/**\n * Keep track of animations that were suspended vs cancelled so we\n * can easily resume them when we're done measuring layout.\n */\nconst suspendedAnimations = new Set()\n\nfunction resumeSuspendedAnimations() {\n suspendedAnimations.forEach((data) => {\n data.animation.play()\n data.animation.startTime = data.startTime\n })\n suspendedAnimations.clear()\n}\n\nexport function startOptimizedAppearAnimation(\n element: HTMLElement,\n name: string,\n keyframes: string[] | number[],\n options: ValueAnimationTransition,\n onReady?: (animation: Animation) => void\n): void {\n // Prevent optimised appear animations if Motion has already started animating.\n if (window.MotionIsMounted) {\n return\n }\n\n const id = element.dataset[optimizedAppearDataId]\n if (!id) return\n\n window.MotionHandoffAnimation = handoffOptimizedAppearAnimation\n\n const storeId = appearStoreId(id, name)\n if (!readyAnimation) {\n readyAnimation = startWaapiAnimation(\n element,\n name,\n [keyframes[0] as number, keyframes[0] as number],\n /**\n * 10 secs is basically just a super-safe duration to give Chrome\n * long enough to get the animation ready.\n */\n { duration: 10000, ease: \"linear\" }\n )\n\n appearAnimationStore.set(storeId, {\n animation: readyAnimation,\n startTime: null,\n })\n\n /**\n * If there's no readyAnimation then there's been no instantiation\n * of handoff animations.\n */\n window.MotionHandoffAnimation = handoffOptimizedAppearAnimation\n\n window.MotionHasOptimisedAnimation = (\n elementId?: string,\n valueName?: string\n ) => {\n if (!elementId) return false\n\n /**\n * Keep a map of elementIds that have started animating. We check\n * via ID instead of Element because of hydration errors and\n * pre-hydration checks. We also actively record IDs as they start\n * animating rather than simply checking for data-appear-id as\n * this attrbute might be present but not lead to an animation, for\n * instance if the element's appear animation is on a different\n * breakpoint.\n */\n if (!valueName) {\n return appearComplete.has(elementId)\n }\n\n const animationId = appearStoreId(elementId, valueName)\n return Boolean(appearAnimationStore.get(animationId))\n }\n\n window.MotionHandoffMarkAsComplete = (elementId: string): void => {\n if (appearComplete.has(elementId)) {\n appearComplete.set(elementId, true)\n }\n }\n\n window.MotionHandoffIsComplete = (elementId: string): boolean => {\n return appearComplete.get(elementId) === true\n }\n\n /**\n * We only need to cancel transform animations as\n * they're the ones that will interfere with the\n * layout animation measurements.\n */\n window.MotionCancelOptimisedAnimation = (\n elementId: string,\n valueName: string,\n frame?: Batcher,\n canResume?: boolean\n ) => {\n const animationId = appearStoreId(elementId, valueName)\n const data = appearAnimationStore.get(animationId)\n\n if (!data) return\n\n if (frame && canResume === undefined) {\n /**\n * Wait until the end of the subsequent frame to cancel the animation\n * to ensure we don't remove the animation before the main thread has\n * had a chance to resolve keyframes and render.\n */\n frame.postRender(() => {\n frame.postRender(() => {\n data.animation.cancel()\n })\n })\n } else {\n data.animation.cancel()\n }\n\n if (frame && canResume) {\n suspendedAnimations.add(data)\n frame.render(resumeSuspendedAnimations)\n } else {\n appearAnimationStore.delete(animationId)\n\n /**\n * If there are no more animations left, we can remove the cancel function.\n * This will let us know when we can stop checking for conflicting layout animations.\n */\n if (!appearAnimationStore.size) {\n window.MotionCancelOptimisedAnimation = undefined\n }\n }\n }\n\n window.MotionCheckAppearSync = (\n visualElement: WithAppearProps,\n valueName: string,\n value: MotionValue\n ) => {\n const appearId = getOptimisedAppearId(visualElement)\n\n if (!appearId) return\n\n const valueIsOptimised = window.MotionHasOptimisedAnimation?.(\n appearId,\n valueName\n )\n const externalAnimationValue =\n visualElement.props.values?.[valueName]\n\n if (!valueIsOptimised || !externalAnimationValue) return\n\n const removeSyncCheck = value.on(\n \"change\",\n (latestValue: AnyResolvedKeyframe) => {\n if (externalAnimationValue.get() !== latestValue) {\n window.MotionCancelOptimisedAnimation?.(\n appearId,\n valueName\n )\n removeSyncCheck()\n }\n }\n )\n\n return removeSyncCheck\n }\n }\n\n const startAnimation = () => {\n readyAnimation.cancel()\n\n const appearAnimation = startWaapiAnimation(\n element,\n name,\n keyframes,\n options\n )\n\n /**\n * Record the time of the first started animation. We call performance.now() once\n * here and once in handoff to ensure we're getting\n * close to a frame-locked time. This keeps all animations in sync.\n */\n if (startFrameTime === undefined) {\n startFrameTime = performance.now()\n }\n\n appearAnimation.startTime = startFrameTime\n\n appearAnimationStore.set(storeId, {\n animation: appearAnimation,\n startTime: startFrameTime,\n })\n\n if (onReady) onReady(appearAnimation)\n }\n\n appearComplete.set(id, false)\n\n if (readyAnimation.ready) {\n readyAnimation.ready.then(startAnimation).catch(noop)\n } else {\n startAnimation()\n }\n}\n","\"use client\"\n\nimport {\n animateVisualElement,\n createBox,\n ResolvedValues,\n TargetAndTransition,\n VisualElement,\n} from \"motion-dom\"\nimport { useLayoutEffect, useState } from \"react\"\nimport { makeUseVisualState } from \"../../motion/utils/use-visual-state\"\nimport { useConstant } from \"../../utils/use-constant\"\n\ninterface AnimatedStateOptions {\n initialState: ResolvedValues\n}\n\nconst createObject = () => ({})\n\nclass StateVisualElement extends VisualElement<\n ResolvedValues,\n {},\n AnimatedStateOptions\n> {\n type: \"state\"\n build() {}\n measureInstanceViewportBox = createBox\n resetTransform() {}\n restoreTransform() {}\n removeValueFromRenderState() {}\n renderInstance() {}\n scrapeMotionValuesFromProps() {\n return createObject()\n }\n getBaseTargetFromProps() {\n return undefined\n }\n\n readValueFromInstance(\n _state: ResolvedValues,\n key: string,\n options: AnimatedStateOptions\n ) {\n return options.initialState[key] || 0\n }\n\n sortInstanceNodePosition() {\n return 0\n }\n}\n\nconst useVisualState = makeUseVisualState({\n scrapeMotionValuesFromProps: createObject,\n createRenderState: createObject,\n})\n\n/**\n * This is not an officially supported API and may be removed\n * on any version.\n */\nexport function useAnimatedState(initialState: any) {\n const [animationState, setAnimationState] = useState(initialState)\n const visualState = useVisualState({}, false)\n\n const element = useConstant(() => {\n return new StateVisualElement(\n {\n props: {\n onUpdate: (v) => {\n setAnimationState({ ...v })\n },\n },\n visualState,\n presenceContext: null,\n },\n { initialState }\n )\n })\n\n useLayoutEffect(() => {\n element.mount({})\n return () => element.unmount()\n }, [element])\n\n const startAnimation = useConstant(\n () => (animationDefinition: TargetAndTransition) => {\n return animateVisualElement(element, animationDefinition)\n }\n )\n\n return [animationState, startAnimation]\n}\n","\"use client\"\n\nimport { invariant } from \"motion-utils\"\nimport * as React from \"react\"\nimport { useConstant } from \"../utils/use-constant\"\nimport { LayoutGroup } from \"./LayoutGroup\"\n\nlet id = 0\nexport const AnimateSharedLayout: React.FunctionComponent<\n React.PropsWithChildren\n> = ({ children }: React.PropsWithChildren<{}>) => {\n React.useEffect(() => {\n invariant(\n false,\n \"AnimateSharedLayout is deprecated: https://www.framer.com/docs/guide-upgrade/##shared-layout-animations\"\n )\n }, [])\n\n return (\n `asl-${id++}`)}>\n {children}\n \n )\n}\n","\"use client\"\n\nimport { MotionValue } from \"motion-dom\"\nimport { invariant, warning } from \"motion-utils\"\nimport { useContext } from \"react\"\nimport { MotionContext } from \"../context/MotionContext\"\nimport { useMotionValue } from \"./use-motion-value\"\nimport { useTransform } from \"./use-transform\"\n\ninterface ScaleMotionValues {\n scaleX: MotionValue\n scaleY: MotionValue\n}\n\n// Keep things reasonable and avoid scale: Infinity. In practise we might need\n// to add another value, opacity, that could interpolate scaleX/Y [0,0.01] => [0,1]\n// to simply hide content at unreasonable scales.\nconst maxScale = 100000\nexport const invertScale = (scale: number) =>\n scale > 0.001 ? 1 / scale : maxScale\n\nlet hasWarned = false\n\n/**\n * Returns a `MotionValue` each for `scaleX` and `scaleY` that update with the inverse\n * of their respective parent scales.\n *\n * This is useful for undoing the distortion of content when scaling a parent component.\n *\n * By default, `useInvertedScale` will automatically fetch `scaleX` and `scaleY` from the nearest parent.\n * By passing other `MotionValue`s in as `useInvertedScale({ scaleX, scaleY })`, it will invert the output\n * of those instead.\n *\n * ```jsx\n * const MyComponent = () => {\n * const { scaleX, scaleY } = useInvertedScale()\n * return \n * }\n * ```\n *\n * @deprecated\n */\nexport function useInvertedScale(\n scale?: Partial\n): ScaleMotionValues {\n let parentScaleX = useMotionValue(1)\n let parentScaleY = useMotionValue(1)\n const { visualElement } = useContext(MotionContext)\n\n invariant(\n !!(scale || visualElement),\n \"If no scale values are provided, useInvertedScale must be used within a child of another motion component.\"\n )\n\n warning(\n hasWarned,\n \"useInvertedScale is deprecated and will be removed in 3.0. Use the layout prop instead.\"\n )\n\n hasWarned = true\n\n if (scale) {\n parentScaleX = scale.scaleX || parentScaleX\n parentScaleY = scale.scaleY || parentScaleY\n } else if (visualElement) {\n parentScaleX = visualElement.getValue(\"scaleX\", 1)\n parentScaleY = visualElement.getValue(\"scaleY\", 1)\n }\n\n const scaleX = useTransform(parentScaleX, invertScale)\n const scaleY = useTransform(parentScaleY, invertScale)\n\n return { scaleX, scaleY }\n}\n"],"names":["React","isHTMLElement","useId","useRef","useContext","MotionConfigContext","useInsertionEffect","_jsx","useConstant","useIsomorphicLayoutEffect","useMemo","PresenceContext","Children","isValidElement","usePresence","useState","LayoutGroupContext","createContext","useCallback","frame","nodeGroup","loadFeatures","useEffect","LazyContext","resolveTransition","createMotionComponent","warnOnce","featureBundle","createDomVisualElement","mixNumber","moveItem","invariant","forwardRef","motionValue","cancelFrame","collectMotionValues","transform","isMotionValue","resolveElements","removeItem","getEasingForSegment","defaultOffset","isGenerator","secondsToMilliseconds","createGeneratorEasing","fillOffset","warning","reverseEasing","progress","isSVGElement","isSVGSVGElement","SVGVisualElement","HTMLVisualElement","visualElementStore","ObjectVisualElement","animateSingleValue","animateTarget","spring","GroupAnimationWithThen","getValueTransition","getAnimationMap","animationMapKey","getComputedStyle","fillWildcards","applyPxDefaults","NativeAnimation","supportsViewTimeline","supportsScrollTimeline","velocityPerSecond","interpolate","clamp","noop","frameData","resize","ScrollOffsetPresets","observeTimeline","animations","gestureAnimations","drag","layout","microtask","cancelMicrotask","attachFollow","MotionValue","transformProps","acceleratedValues","hasReducedMotionListener","initPrefersReducedMotion","prefersReducedMotion","setTarget","animateVisualElement","addDomEvent","motionComponentSymbol","rootProjectionNode","wrap","MotionGlobalConfig","optimizedAppearDataId","startWaapiAnimation","getOptimisedAppearId","VisualElement","createBox","makeUseVisualState","useLayoutEffect","MotionContext"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAEG;AAKH;;;AAGG;AACH,SAAS,MAAM,CAAI,GAAmB,EAAE,KAAQ,EAAA;AAC5C,IAAA,IAAI,OAAO,GAAG,KAAK,UAAU,EAAE;AAC3B,QAAA,OAAO,GAAG,CAAC,KAAK,CAAC;IACrB;SAAO,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,SAAS,EAAE;AACxC,QAAA,GAAiC,CAAC,OAAO,GAAG,KAAK;IACvD;AACJ;AAEA;;;AAGG;AACH,SAAS,WAAW,CAAI,GAAG,IAAsB,EAAA;IAC7C,OAAO,CAAC,IAAI,KAAI;QACZ,IAAI,UAAU,GAAG,KAAK;QACtB,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,KAAI;YAC9B,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC;YACjC,IAAI,CAAC,UAAU,IAAI,OAAO,OAAO,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;;AAkBG;AACG,SAAU,gBAAgB,CAC5B,KAAkC,EAAA;AAElC,IAAA,IAAI,YAAY,GAAG,cAAc,CAAC,CAAC,CAAC;AACpC,IAAA,IAAI,YAAY,GAAG,cAAc,CAAC,CAAC,CAAC;IACpC,MAAM,EAAE,aAAa,EAAE,GAAGJ,gBAAU,CAACmG,mBAAa,CAAC;IAEnDxE,qBAAS,CACL,CAAC,EAAE,KAAK,IAAI,aAAa,CAAC,EAC1B,4GAA4G,CAC/G;AAED,IAAAe,mBAAO,CACH,SAAS,EACT,yFAAyF,CAC5F;IAED,SAAS,GAAG,IAAI;IAEhB,IAAI,KAAK,EAAE;AACP,QAAA,YAAY,GAAG,KAAK,CAAC,MAAM,IAAI,YAAY;AAC3C,QAAA,YAAY,GAAG,KAAK,CAAC,MAAM,IAAI,YAAY;IAC/C;SAAO,IAAI,aAAa,EAAE;QACtB,YAAY,GAAG,aAAa,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC;QAClD,YAAY,GAAG,aAAa,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC;IACtD;IAEA,MAAM,MAAM,GAAG,YAAY,CAAC,YAAY,EAAE,WAAW,CAAC;IACtD,MAAM,MAAM,GAAG,YAAY,CAAC,YAAY,EAAE,WAAW,CAAC;AAEtD,IAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE;AAC7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/cjs/m.js b/node_modules/framer-motion/dist/cjs/m.js deleted file mode 100644 index c6db4aa..0000000 --- a/node_modules/framer-motion/dist/cjs/m.js +++ /dev/null @@ -1,403 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { value: true }); - -var index = require('./index-BuO47Yrm.js'); -require('react/jsx-runtime'); -require('motion-utils'); -require('react'); -require('motion-dom'); - -function createMinimalMotionComponent(Component, options) { - return index.createMotionComponent(Component, options); -} - -/** - * HTML components - */ -const MotionA = /*@__PURE__*/ createMinimalMotionComponent("a"); -const MotionAbbr = /*@__PURE__*/ createMinimalMotionComponent("abbr"); -const MotionAddress = -/*@__PURE__*/ createMinimalMotionComponent("address"); -const MotionArea = /*@__PURE__*/ createMinimalMotionComponent("area"); -const MotionArticle = -/*@__PURE__*/ createMinimalMotionComponent("article"); -const MotionAside = /*@__PURE__*/ createMinimalMotionComponent("aside"); -const MotionAudio = /*@__PURE__*/ createMinimalMotionComponent("audio"); -const MotionB = /*@__PURE__*/ createMinimalMotionComponent("b"); -const MotionBase = /*@__PURE__*/ createMinimalMotionComponent("base"); -const MotionBdi = /*@__PURE__*/ createMinimalMotionComponent("bdi"); -const MotionBdo = /*@__PURE__*/ createMinimalMotionComponent("bdo"); -const MotionBig = /*@__PURE__*/ createMinimalMotionComponent("big"); -const MotionBlockquote = -/*@__PURE__*/ createMinimalMotionComponent("blockquote"); -const MotionBody = /*@__PURE__*/ createMinimalMotionComponent("body"); -const MotionButton = /*@__PURE__*/ createMinimalMotionComponent("button"); -const MotionCanvas = /*@__PURE__*/ createMinimalMotionComponent("canvas"); -const MotionCaption = -/*@__PURE__*/ createMinimalMotionComponent("caption"); -const MotionCite = /*@__PURE__*/ createMinimalMotionComponent("cite"); -const MotionCode = /*@__PURE__*/ createMinimalMotionComponent("code"); -const MotionCol = /*@__PURE__*/ createMinimalMotionComponent("col"); -const MotionColgroup = -/*@__PURE__*/ createMinimalMotionComponent("colgroup"); -const MotionData = /*@__PURE__*/ createMinimalMotionComponent("data"); -const MotionDatalist = -/*@__PURE__*/ createMinimalMotionComponent("datalist"); -const MotionDd = /*@__PURE__*/ createMinimalMotionComponent("dd"); -const MotionDel = /*@__PURE__*/ createMinimalMotionComponent("del"); -const MotionDetails = -/*@__PURE__*/ createMinimalMotionComponent("details"); -const MotionDfn = /*@__PURE__*/ createMinimalMotionComponent("dfn"); -const MotionDialog = /*@__PURE__*/ createMinimalMotionComponent("dialog"); -const MotionDiv = /*@__PURE__*/ createMinimalMotionComponent("div"); -const MotionDl = /*@__PURE__*/ createMinimalMotionComponent("dl"); -const MotionDt = /*@__PURE__*/ createMinimalMotionComponent("dt"); -const MotionEm = /*@__PURE__*/ createMinimalMotionComponent("em"); -const MotionEmbed = /*@__PURE__*/ createMinimalMotionComponent("embed"); -const MotionFieldset = -/*@__PURE__*/ createMinimalMotionComponent("fieldset"); -const MotionFigcaption = -/*@__PURE__*/ createMinimalMotionComponent("figcaption"); -const MotionFigure = /*@__PURE__*/ createMinimalMotionComponent("figure"); -const MotionFooter = /*@__PURE__*/ createMinimalMotionComponent("footer"); -const MotionForm = /*@__PURE__*/ createMinimalMotionComponent("form"); -const MotionH1 = /*@__PURE__*/ createMinimalMotionComponent("h1"); -const MotionH2 = /*@__PURE__*/ createMinimalMotionComponent("h2"); -const MotionH3 = /*@__PURE__*/ createMinimalMotionComponent("h3"); -const MotionH4 = /*@__PURE__*/ createMinimalMotionComponent("h4"); -const MotionH5 = /*@__PURE__*/ createMinimalMotionComponent("h5"); -const MotionH6 = /*@__PURE__*/ createMinimalMotionComponent("h6"); -const MotionHead = /*@__PURE__*/ createMinimalMotionComponent("head"); -const MotionHeader = /*@__PURE__*/ createMinimalMotionComponent("header"); -const MotionHgroup = /*@__PURE__*/ createMinimalMotionComponent("hgroup"); -const MotionHr = /*@__PURE__*/ createMinimalMotionComponent("hr"); -const MotionHtml = /*@__PURE__*/ createMinimalMotionComponent("html"); -const MotionI = /*@__PURE__*/ createMinimalMotionComponent("i"); -const MotionIframe = /*@__PURE__*/ createMinimalMotionComponent("iframe"); -const MotionImg = /*@__PURE__*/ createMinimalMotionComponent("img"); -const MotionInput = /*@__PURE__*/ createMinimalMotionComponent("input"); -const MotionIns = /*@__PURE__*/ createMinimalMotionComponent("ins"); -const MotionKbd = /*@__PURE__*/ createMinimalMotionComponent("kbd"); -const MotionKeygen = /*@__PURE__*/ createMinimalMotionComponent("keygen"); -const MotionLabel = /*@__PURE__*/ createMinimalMotionComponent("label"); -const MotionLegend = /*@__PURE__*/ createMinimalMotionComponent("legend"); -const MotionLi = /*@__PURE__*/ createMinimalMotionComponent("li"); -const MotionLink = /*@__PURE__*/ createMinimalMotionComponent("link"); -const MotionMain = /*@__PURE__*/ createMinimalMotionComponent("main"); -const MotionMap = /*@__PURE__*/ createMinimalMotionComponent("map"); -const MotionMark = /*@__PURE__*/ createMinimalMotionComponent("mark"); -const MotionMenu = /*@__PURE__*/ createMinimalMotionComponent("menu"); -const MotionMenuitem = -/*@__PURE__*/ createMinimalMotionComponent("menuitem"); -const MotionMeter = /*@__PURE__*/ createMinimalMotionComponent("meter"); -const MotionNav = /*@__PURE__*/ createMinimalMotionComponent("nav"); -const MotionObject = /*@__PURE__*/ createMinimalMotionComponent("object"); -const MotionOl = /*@__PURE__*/ createMinimalMotionComponent("ol"); -const MotionOptgroup = -/*@__PURE__*/ createMinimalMotionComponent("optgroup"); -const MotionOption = /*@__PURE__*/ createMinimalMotionComponent("option"); -const MotionOutput = /*@__PURE__*/ createMinimalMotionComponent("output"); -const MotionP = /*@__PURE__*/ createMinimalMotionComponent("p"); -const MotionParam = /*@__PURE__*/ createMinimalMotionComponent("param"); -const MotionPicture = -/*@__PURE__*/ createMinimalMotionComponent("picture"); -const MotionPre = /*@__PURE__*/ createMinimalMotionComponent("pre"); -const MotionProgress = -/*@__PURE__*/ createMinimalMotionComponent("progress"); -const MotionQ = /*@__PURE__*/ createMinimalMotionComponent("q"); -const MotionRp = /*@__PURE__*/ createMinimalMotionComponent("rp"); -const MotionRt = /*@__PURE__*/ createMinimalMotionComponent("rt"); -const MotionRuby = /*@__PURE__*/ createMinimalMotionComponent("ruby"); -const MotionS = /*@__PURE__*/ createMinimalMotionComponent("s"); -const MotionSamp = /*@__PURE__*/ createMinimalMotionComponent("samp"); -const MotionScript = /*@__PURE__*/ createMinimalMotionComponent("script"); -const MotionSection = -/*@__PURE__*/ createMinimalMotionComponent("section"); -const MotionSelect = /*@__PURE__*/ createMinimalMotionComponent("select"); -const MotionSmall = /*@__PURE__*/ createMinimalMotionComponent("small"); -const MotionSource = /*@__PURE__*/ createMinimalMotionComponent("source"); -const MotionSpan = /*@__PURE__*/ createMinimalMotionComponent("span"); -const MotionStrong = /*@__PURE__*/ createMinimalMotionComponent("strong"); -const MotionStyle = /*@__PURE__*/ createMinimalMotionComponent("style"); -const MotionSub = /*@__PURE__*/ createMinimalMotionComponent("sub"); -const MotionSummary = -/*@__PURE__*/ createMinimalMotionComponent("summary"); -const MotionSup = /*@__PURE__*/ createMinimalMotionComponent("sup"); -const MotionTable = /*@__PURE__*/ createMinimalMotionComponent("table"); -const MotionTbody = /*@__PURE__*/ createMinimalMotionComponent("tbody"); -const MotionTd = /*@__PURE__*/ createMinimalMotionComponent("td"); -const MotionTextarea = -/*@__PURE__*/ createMinimalMotionComponent("textarea"); -const MotionTfoot = /*@__PURE__*/ createMinimalMotionComponent("tfoot"); -const MotionTh = /*@__PURE__*/ createMinimalMotionComponent("th"); -const MotionThead = /*@__PURE__*/ createMinimalMotionComponent("thead"); -const MotionTime = /*@__PURE__*/ createMinimalMotionComponent("time"); -const MotionTitle = /*@__PURE__*/ createMinimalMotionComponent("title"); -const MotionTr = /*@__PURE__*/ createMinimalMotionComponent("tr"); -const MotionTrack = /*@__PURE__*/ createMinimalMotionComponent("track"); -const MotionU = /*@__PURE__*/ createMinimalMotionComponent("u"); -const MotionUl = /*@__PURE__*/ createMinimalMotionComponent("ul"); -const MotionVideo = /*@__PURE__*/ createMinimalMotionComponent("video"); -const MotionWbr = /*@__PURE__*/ createMinimalMotionComponent("wbr"); -const MotionWebview = -/*@__PURE__*/ createMinimalMotionComponent("webview"); -/** - * SVG components - */ -const MotionAnimate = -/*@__PURE__*/ createMinimalMotionComponent("animate"); -const MotionCircle = /*@__PURE__*/ createMinimalMotionComponent("circle"); -const MotionDefs = /*@__PURE__*/ createMinimalMotionComponent("defs"); -const MotionDesc = /*@__PURE__*/ createMinimalMotionComponent("desc"); -const MotionEllipse = -/*@__PURE__*/ createMinimalMotionComponent("ellipse"); -const MotionG = /*@__PURE__*/ createMinimalMotionComponent("g"); -const MotionImage = /*@__PURE__*/ createMinimalMotionComponent("image"); -const MotionLine = /*@__PURE__*/ createMinimalMotionComponent("line"); -const MotionFilter = /*@__PURE__*/ createMinimalMotionComponent("filter"); -const MotionMarker = /*@__PURE__*/ createMinimalMotionComponent("marker"); -const MotionMask = /*@__PURE__*/ createMinimalMotionComponent("mask"); -const MotionMetadata = -/*@__PURE__*/ createMinimalMotionComponent("metadata"); -const MotionPath = /*@__PURE__*/ createMinimalMotionComponent("path"); -const MotionPattern = -/*@__PURE__*/ createMinimalMotionComponent("pattern"); -const MotionPolygon = -/*@__PURE__*/ createMinimalMotionComponent("polygon"); -const MotionPolyline = -/*@__PURE__*/ createMinimalMotionComponent("polyline"); -const MotionRect = /*@__PURE__*/ createMinimalMotionComponent("rect"); -const MotionStop = /*@__PURE__*/ createMinimalMotionComponent("stop"); -const MotionSvg = /*@__PURE__*/ createMinimalMotionComponent("svg"); -const MotionSymbol = /*@__PURE__*/ createMinimalMotionComponent("symbol"); -const MotionText = /*@__PURE__*/ createMinimalMotionComponent("text"); -const MotionTspan = /*@__PURE__*/ createMinimalMotionComponent("tspan"); -const MotionUse = /*@__PURE__*/ createMinimalMotionComponent("use"); -const MotionView = /*@__PURE__*/ createMinimalMotionComponent("view"); -const MotionClipPath = -/*@__PURE__*/ createMinimalMotionComponent("clipPath"); -const MotionFeBlend = -/*@__PURE__*/ createMinimalMotionComponent("feBlend"); -const MotionFeColorMatrix = -/*@__PURE__*/ createMinimalMotionComponent("feColorMatrix"); -const MotionFeComponentTransfer = -/*@__PURE__*/ createMinimalMotionComponent("feComponentTransfer"); -const MotionFeComposite = -/*@__PURE__*/ createMinimalMotionComponent("feComposite"); -const MotionFeConvolveMatrix = -/*@__PURE__*/ createMinimalMotionComponent("feConvolveMatrix"); -const MotionFeDiffuseLighting = -/*@__PURE__*/ createMinimalMotionComponent("feDiffuseLighting"); -const MotionFeDisplacementMap = -/*@__PURE__*/ createMinimalMotionComponent("feDisplacementMap"); -const MotionFeDistantLight = -/*@__PURE__*/ createMinimalMotionComponent("feDistantLight"); -const MotionFeDropShadow = -/*@__PURE__*/ createMinimalMotionComponent("feDropShadow"); -const MotionFeFlood = -/*@__PURE__*/ createMinimalMotionComponent("feFlood"); -const MotionFeFuncA = -/*@__PURE__*/ createMinimalMotionComponent("feFuncA"); -const MotionFeFuncB = -/*@__PURE__*/ createMinimalMotionComponent("feFuncB"); -const MotionFeFuncG = -/*@__PURE__*/ createMinimalMotionComponent("feFuncG"); -const MotionFeFuncR = -/*@__PURE__*/ createMinimalMotionComponent("feFuncR"); -const MotionFeGaussianBlur = -/*@__PURE__*/ createMinimalMotionComponent("feGaussianBlur"); -const MotionFeImage = -/*@__PURE__*/ createMinimalMotionComponent("feImage"); -const MotionFeMerge = -/*@__PURE__*/ createMinimalMotionComponent("feMerge"); -const MotionFeMergeNode = -/*@__PURE__*/ createMinimalMotionComponent("feMergeNode"); -const MotionFeMorphology = -/*@__PURE__*/ createMinimalMotionComponent("feMorphology"); -const MotionFeOffset = -/*@__PURE__*/ createMinimalMotionComponent("feOffset"); -const MotionFePointLight = -/*@__PURE__*/ createMinimalMotionComponent("fePointLight"); -const MotionFeSpecularLighting = -/*@__PURE__*/ createMinimalMotionComponent("feSpecularLighting"); -const MotionFeSpotLight = -/*@__PURE__*/ createMinimalMotionComponent("feSpotLight"); -const MotionFeTile = /*@__PURE__*/ createMinimalMotionComponent("feTile"); -const MotionFeTurbulence = -/*@__PURE__*/ createMinimalMotionComponent("feTurbulence"); -const MotionForeignObject = -/*@__PURE__*/ createMinimalMotionComponent("foreignObject"); -const MotionLinearGradient = -/*@__PURE__*/ createMinimalMotionComponent("linearGradient"); -const MotionRadialGradient = -/*@__PURE__*/ createMinimalMotionComponent("radialGradient"); -const MotionTextPath = -/*@__PURE__*/ createMinimalMotionComponent("textPath"); - -exports.a = MotionA; -exports.abbr = MotionAbbr; -exports.address = MotionAddress; -exports.animate = MotionAnimate; -exports.area = MotionArea; -exports.article = MotionArticle; -exports.aside = MotionAside; -exports.audio = MotionAudio; -exports.b = MotionB; -exports.base = MotionBase; -exports.bdi = MotionBdi; -exports.bdo = MotionBdo; -exports.big = MotionBig; -exports.blockquote = MotionBlockquote; -exports.body = MotionBody; -exports.button = MotionButton; -exports.canvas = MotionCanvas; -exports.caption = MotionCaption; -exports.circle = MotionCircle; -exports.cite = MotionCite; -exports.clipPath = MotionClipPath; -exports.code = MotionCode; -exports.col = MotionCol; -exports.colgroup = MotionColgroup; -exports.create = createMinimalMotionComponent; -exports.data = MotionData; -exports.datalist = MotionDatalist; -exports.dd = MotionDd; -exports.defs = MotionDefs; -exports.del = MotionDel; -exports.desc = MotionDesc; -exports.details = MotionDetails; -exports.dfn = MotionDfn; -exports.dialog = MotionDialog; -exports.div = MotionDiv; -exports.dl = MotionDl; -exports.dt = MotionDt; -exports.ellipse = MotionEllipse; -exports.em = MotionEm; -exports.embed = MotionEmbed; -exports.feBlend = MotionFeBlend; -exports.feColorMatrix = MotionFeColorMatrix; -exports.feComponentTransfer = MotionFeComponentTransfer; -exports.feComposite = MotionFeComposite; -exports.feConvolveMatrix = MotionFeConvolveMatrix; -exports.feDiffuseLighting = MotionFeDiffuseLighting; -exports.feDisplacementMap = MotionFeDisplacementMap; -exports.feDistantLight = MotionFeDistantLight; -exports.feDropShadow = MotionFeDropShadow; -exports.feFlood = MotionFeFlood; -exports.feFuncA = MotionFeFuncA; -exports.feFuncB = MotionFeFuncB; -exports.feFuncG = MotionFeFuncG; -exports.feFuncR = MotionFeFuncR; -exports.feGaussianBlur = MotionFeGaussianBlur; -exports.feImage = MotionFeImage; -exports.feMerge = MotionFeMerge; -exports.feMergeNode = MotionFeMergeNode; -exports.feMorphology = MotionFeMorphology; -exports.feOffset = MotionFeOffset; -exports.fePointLight = MotionFePointLight; -exports.feSpecularLighting = MotionFeSpecularLighting; -exports.feSpotLight = MotionFeSpotLight; -exports.feTile = MotionFeTile; -exports.feTurbulence = MotionFeTurbulence; -exports.fieldset = MotionFieldset; -exports.figcaption = MotionFigcaption; -exports.figure = MotionFigure; -exports.filter = MotionFilter; -exports.footer = MotionFooter; -exports.foreignObject = MotionForeignObject; -exports.form = MotionForm; -exports.g = MotionG; -exports.h1 = MotionH1; -exports.h2 = MotionH2; -exports.h3 = MotionH3; -exports.h4 = MotionH4; -exports.h5 = MotionH5; -exports.h6 = MotionH6; -exports.head = MotionHead; -exports.header = MotionHeader; -exports.hgroup = MotionHgroup; -exports.hr = MotionHr; -exports.html = MotionHtml; -exports.i = MotionI; -exports.iframe = MotionIframe; -exports.image = MotionImage; -exports.img = MotionImg; -exports.input = MotionInput; -exports.ins = MotionIns; -exports.kbd = MotionKbd; -exports.keygen = MotionKeygen; -exports.label = MotionLabel; -exports.legend = MotionLegend; -exports.li = MotionLi; -exports.line = MotionLine; -exports.linearGradient = MotionLinearGradient; -exports.link = MotionLink; -exports.main = MotionMain; -exports.map = MotionMap; -exports.mark = MotionMark; -exports.marker = MotionMarker; -exports.mask = MotionMask; -exports.menu = MotionMenu; -exports.menuitem = MotionMenuitem; -exports.metadata = MotionMetadata; -exports.meter = MotionMeter; -exports.nav = MotionNav; -exports.object = MotionObject; -exports.ol = MotionOl; -exports.optgroup = MotionOptgroup; -exports.option = MotionOption; -exports.output = MotionOutput; -exports.p = MotionP; -exports.param = MotionParam; -exports.path = MotionPath; -exports.pattern = MotionPattern; -exports.picture = MotionPicture; -exports.polygon = MotionPolygon; -exports.polyline = MotionPolyline; -exports.pre = MotionPre; -exports.progress = MotionProgress; -exports.q = MotionQ; -exports.radialGradient = MotionRadialGradient; -exports.rect = MotionRect; -exports.rp = MotionRp; -exports.rt = MotionRt; -exports.ruby = MotionRuby; -exports.s = MotionS; -exports.samp = MotionSamp; -exports.script = MotionScript; -exports.section = MotionSection; -exports.select = MotionSelect; -exports.small = MotionSmall; -exports.source = MotionSource; -exports.span = MotionSpan; -exports.stop = MotionStop; -exports.strong = MotionStrong; -exports.style = MotionStyle; -exports.sub = MotionSub; -exports.summary = MotionSummary; -exports.sup = MotionSup; -exports.svg = MotionSvg; -exports.symbol = MotionSymbol; -exports.table = MotionTable; -exports.tbody = MotionTbody; -exports.td = MotionTd; -exports.text = MotionText; -exports.textPath = MotionTextPath; -exports.textarea = MotionTextarea; -exports.tfoot = MotionTfoot; -exports.th = MotionTh; -exports.thead = MotionThead; -exports.time = MotionTime; -exports.title = MotionTitle; -exports.tr = MotionTr; -exports.track = MotionTrack; -exports.tspan = MotionTspan; -exports.u = MotionU; -exports.ul = MotionUl; -exports.use = MotionUse; -exports.video = MotionVideo; -exports.view = MotionView; -exports.wbr = MotionWbr; -exports.webview = MotionWebview; -//# sourceMappingURL=m.js.map diff --git a/node_modules/framer-motion/dist/cjs/m.js.map b/node_modules/framer-motion/dist/cjs/m.js.map deleted file mode 100644 index 9fcc06b..0000000 --- a/node_modules/framer-motion/dist/cjs/m.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"m.js","sources":["../../src/render/components/m/create.ts","../../src/render/components/m/elements.ts"],"sourcesContent":["import { createMotionComponent, MotionComponentOptions } from \"../../../motion\"\nimport { DOMMotionComponents } from \"../../dom/types\"\n\nexport function createMinimalMotionComponent<\n Props,\n TagName extends keyof DOMMotionComponents | string = \"div\"\n>(\n Component: TagName | string | React.ComponentType,\n options?: MotionComponentOptions\n) {\n return createMotionComponent(Component, options)\n}\n","\"use client\"\n\nimport { createMinimalMotionComponent } from \"./create\"\n\n/**\n * HTML components\n */\nexport const MotionA = /*@__PURE__*/ createMinimalMotionComponent(\"a\")\nexport const MotionAbbr = /*@__PURE__*/ createMinimalMotionComponent(\"abbr\")\nexport const MotionAddress =\n /*@__PURE__*/ createMinimalMotionComponent(\"address\")\nexport const MotionArea = /*@__PURE__*/ createMinimalMotionComponent(\"area\")\nexport const MotionArticle =\n /*@__PURE__*/ createMinimalMotionComponent(\"article\")\nexport const MotionAside = /*@__PURE__*/ createMinimalMotionComponent(\"aside\")\nexport const MotionAudio = /*@__PURE__*/ createMinimalMotionComponent(\"audio\")\nexport const MotionB = /*@__PURE__*/ createMinimalMotionComponent(\"b\")\nexport const MotionBase = /*@__PURE__*/ createMinimalMotionComponent(\"base\")\nexport const MotionBdi = /*@__PURE__*/ createMinimalMotionComponent(\"bdi\")\nexport const MotionBdo = /*@__PURE__*/ createMinimalMotionComponent(\"bdo\")\nexport const MotionBig = /*@__PURE__*/ createMinimalMotionComponent(\"big\")\nexport const MotionBlockquote =\n /*@__PURE__*/ createMinimalMotionComponent(\"blockquote\")\nexport const MotionBody = /*@__PURE__*/ createMinimalMotionComponent(\"body\")\nexport const MotionButton = /*@__PURE__*/ createMinimalMotionComponent(\"button\")\nexport const MotionCanvas = /*@__PURE__*/ createMinimalMotionComponent(\"canvas\")\nexport const MotionCaption =\n /*@__PURE__*/ createMinimalMotionComponent(\"caption\")\nexport const MotionCite = /*@__PURE__*/ createMinimalMotionComponent(\"cite\")\nexport const MotionCode = /*@__PURE__*/ createMinimalMotionComponent(\"code\")\nexport const MotionCol = /*@__PURE__*/ createMinimalMotionComponent(\"col\")\nexport const MotionColgroup =\n /*@__PURE__*/ createMinimalMotionComponent(\"colgroup\")\nexport const MotionData = /*@__PURE__*/ createMinimalMotionComponent(\"data\")\nexport const MotionDatalist =\n /*@__PURE__*/ createMinimalMotionComponent(\"datalist\")\nexport const MotionDd = /*@__PURE__*/ createMinimalMotionComponent(\"dd\")\nexport const MotionDel = /*@__PURE__*/ createMinimalMotionComponent(\"del\")\nexport const MotionDetails =\n /*@__PURE__*/ createMinimalMotionComponent(\"details\")\nexport const MotionDfn = /*@__PURE__*/ createMinimalMotionComponent(\"dfn\")\nexport const MotionDialog = /*@__PURE__*/ createMinimalMotionComponent(\"dialog\")\nexport const MotionDiv = /*@__PURE__*/ createMinimalMotionComponent(\"div\")\nexport const MotionDl = /*@__PURE__*/ createMinimalMotionComponent(\"dl\")\nexport const MotionDt = /*@__PURE__*/ createMinimalMotionComponent(\"dt\")\nexport const MotionEm = /*@__PURE__*/ createMinimalMotionComponent(\"em\")\nexport const MotionEmbed = /*@__PURE__*/ createMinimalMotionComponent(\"embed\")\nexport const MotionFieldset =\n /*@__PURE__*/ createMinimalMotionComponent(\"fieldset\")\nexport const MotionFigcaption =\n /*@__PURE__*/ createMinimalMotionComponent(\"figcaption\")\nexport const MotionFigure = /*@__PURE__*/ createMinimalMotionComponent(\"figure\")\nexport const MotionFooter = /*@__PURE__*/ createMinimalMotionComponent(\"footer\")\nexport const MotionForm = /*@__PURE__*/ createMinimalMotionComponent(\"form\")\nexport const MotionH1 = /*@__PURE__*/ createMinimalMotionComponent(\"h1\")\nexport const MotionH2 = /*@__PURE__*/ createMinimalMotionComponent(\"h2\")\nexport const MotionH3 = /*@__PURE__*/ createMinimalMotionComponent(\"h3\")\nexport const MotionH4 = /*@__PURE__*/ createMinimalMotionComponent(\"h4\")\nexport const MotionH5 = /*@__PURE__*/ createMinimalMotionComponent(\"h5\")\nexport const MotionH6 = /*@__PURE__*/ createMinimalMotionComponent(\"h6\")\nexport const MotionHead = /*@__PURE__*/ createMinimalMotionComponent(\"head\")\nexport const MotionHeader = /*@__PURE__*/ createMinimalMotionComponent(\"header\")\nexport const MotionHgroup = /*@__PURE__*/ createMinimalMotionComponent(\"hgroup\")\nexport const MotionHr = /*@__PURE__*/ createMinimalMotionComponent(\"hr\")\nexport const MotionHtml = /*@__PURE__*/ createMinimalMotionComponent(\"html\")\nexport const MotionI = /*@__PURE__*/ createMinimalMotionComponent(\"i\")\nexport const MotionIframe = /*@__PURE__*/ createMinimalMotionComponent(\"iframe\")\nexport const MotionImg = /*@__PURE__*/ createMinimalMotionComponent(\"img\")\nexport const MotionInput = /*@__PURE__*/ createMinimalMotionComponent(\"input\")\nexport const MotionIns = /*@__PURE__*/ createMinimalMotionComponent(\"ins\")\nexport const MotionKbd = /*@__PURE__*/ createMinimalMotionComponent(\"kbd\")\nexport const MotionKeygen = /*@__PURE__*/ createMinimalMotionComponent(\"keygen\")\nexport const MotionLabel = /*@__PURE__*/ createMinimalMotionComponent(\"label\")\nexport const MotionLegend = /*@__PURE__*/ createMinimalMotionComponent(\"legend\")\nexport const MotionLi = /*@__PURE__*/ createMinimalMotionComponent(\"li\")\nexport const MotionLink = /*@__PURE__*/ createMinimalMotionComponent(\"link\")\nexport const MotionMain = /*@__PURE__*/ createMinimalMotionComponent(\"main\")\nexport const MotionMap = /*@__PURE__*/ createMinimalMotionComponent(\"map\")\nexport const MotionMark = /*@__PURE__*/ createMinimalMotionComponent(\"mark\")\nexport const MotionMenu = /*@__PURE__*/ createMinimalMotionComponent(\"menu\")\nexport const MotionMenuitem =\n /*@__PURE__*/ createMinimalMotionComponent(\"menuitem\")\nexport const MotionMeter = /*@__PURE__*/ createMinimalMotionComponent(\"meter\")\nexport const MotionNav = /*@__PURE__*/ createMinimalMotionComponent(\"nav\")\nexport const MotionObject = /*@__PURE__*/ createMinimalMotionComponent(\"object\")\nexport const MotionOl = /*@__PURE__*/ createMinimalMotionComponent(\"ol\")\nexport const MotionOptgroup =\n /*@__PURE__*/ createMinimalMotionComponent(\"optgroup\")\nexport const MotionOption = /*@__PURE__*/ createMinimalMotionComponent(\"option\")\nexport const MotionOutput = /*@__PURE__*/ createMinimalMotionComponent(\"output\")\nexport const MotionP = /*@__PURE__*/ createMinimalMotionComponent(\"p\")\nexport const MotionParam = /*@__PURE__*/ createMinimalMotionComponent(\"param\")\nexport const MotionPicture =\n /*@__PURE__*/ createMinimalMotionComponent(\"picture\")\nexport const MotionPre = /*@__PURE__*/ createMinimalMotionComponent(\"pre\")\nexport const MotionProgress =\n /*@__PURE__*/ createMinimalMotionComponent(\"progress\")\nexport const MotionQ = /*@__PURE__*/ createMinimalMotionComponent(\"q\")\nexport const MotionRp = /*@__PURE__*/ createMinimalMotionComponent(\"rp\")\nexport const MotionRt = /*@__PURE__*/ createMinimalMotionComponent(\"rt\")\nexport const MotionRuby = /*@__PURE__*/ createMinimalMotionComponent(\"ruby\")\nexport const MotionS = /*@__PURE__*/ createMinimalMotionComponent(\"s\")\nexport const MotionSamp = /*@__PURE__*/ createMinimalMotionComponent(\"samp\")\nexport const MotionScript = /*@__PURE__*/ createMinimalMotionComponent(\"script\")\nexport const MotionSection =\n /*@__PURE__*/ createMinimalMotionComponent(\"section\")\nexport const MotionSelect = /*@__PURE__*/ createMinimalMotionComponent(\"select\")\nexport const MotionSmall = /*@__PURE__*/ createMinimalMotionComponent(\"small\")\nexport const MotionSource = /*@__PURE__*/ createMinimalMotionComponent(\"source\")\nexport const MotionSpan = /*@__PURE__*/ createMinimalMotionComponent(\"span\")\nexport const MotionStrong = /*@__PURE__*/ createMinimalMotionComponent(\"strong\")\nexport const MotionStyle = /*@__PURE__*/ createMinimalMotionComponent(\"style\")\nexport const MotionSub = /*@__PURE__*/ createMinimalMotionComponent(\"sub\")\nexport const MotionSummary =\n /*@__PURE__*/ createMinimalMotionComponent(\"summary\")\nexport const MotionSup = /*@__PURE__*/ createMinimalMotionComponent(\"sup\")\nexport const MotionTable = /*@__PURE__*/ createMinimalMotionComponent(\"table\")\nexport const MotionTbody = /*@__PURE__*/ createMinimalMotionComponent(\"tbody\")\nexport const MotionTd = /*@__PURE__*/ createMinimalMotionComponent(\"td\")\nexport const MotionTextarea =\n /*@__PURE__*/ createMinimalMotionComponent(\"textarea\")\nexport const MotionTfoot = /*@__PURE__*/ createMinimalMotionComponent(\"tfoot\")\nexport const MotionTh = /*@__PURE__*/ createMinimalMotionComponent(\"th\")\nexport const MotionThead = /*@__PURE__*/ createMinimalMotionComponent(\"thead\")\nexport const MotionTime = /*@__PURE__*/ createMinimalMotionComponent(\"time\")\nexport const MotionTitle = /*@__PURE__*/ createMinimalMotionComponent(\"title\")\nexport const MotionTr = /*@__PURE__*/ createMinimalMotionComponent(\"tr\")\nexport const MotionTrack = /*@__PURE__*/ createMinimalMotionComponent(\"track\")\nexport const MotionU = /*@__PURE__*/ createMinimalMotionComponent(\"u\")\nexport const MotionUl = /*@__PURE__*/ createMinimalMotionComponent(\"ul\")\nexport const MotionVideo = /*@__PURE__*/ createMinimalMotionComponent(\"video\")\nexport const MotionWbr = /*@__PURE__*/ createMinimalMotionComponent(\"wbr\")\nexport const MotionWebview =\n /*@__PURE__*/ createMinimalMotionComponent(\"webview\")\n\n/**\n * SVG components\n */\nexport const MotionAnimate =\n /*@__PURE__*/ createMinimalMotionComponent(\"animate\")\nexport const MotionCircle = /*@__PURE__*/ createMinimalMotionComponent(\"circle\")\nexport const MotionDefs = /*@__PURE__*/ createMinimalMotionComponent(\"defs\")\nexport const MotionDesc = /*@__PURE__*/ createMinimalMotionComponent(\"desc\")\nexport const MotionEllipse =\n /*@__PURE__*/ createMinimalMotionComponent(\"ellipse\")\nexport const MotionG = /*@__PURE__*/ createMinimalMotionComponent(\"g\")\nexport const MotionImage = /*@__PURE__*/ createMinimalMotionComponent(\"image\")\nexport const MotionLine = /*@__PURE__*/ createMinimalMotionComponent(\"line\")\nexport const MotionFilter = /*@__PURE__*/ createMinimalMotionComponent(\"filter\")\nexport const MotionMarker = /*@__PURE__*/ createMinimalMotionComponent(\"marker\")\nexport const MotionMask = /*@__PURE__*/ createMinimalMotionComponent(\"mask\")\nexport const MotionMetadata =\n /*@__PURE__*/ createMinimalMotionComponent(\"metadata\")\nexport const MotionPath = /*@__PURE__*/ createMinimalMotionComponent(\"path\")\nexport const MotionPattern =\n /*@__PURE__*/ createMinimalMotionComponent(\"pattern\")\nexport const MotionPolygon =\n /*@__PURE__*/ createMinimalMotionComponent(\"polygon\")\nexport const MotionPolyline =\n /*@__PURE__*/ createMinimalMotionComponent(\"polyline\")\nexport const MotionRect = /*@__PURE__*/ createMinimalMotionComponent(\"rect\")\nexport const MotionStop = /*@__PURE__*/ createMinimalMotionComponent(\"stop\")\nexport const MotionSvg = /*@__PURE__*/ createMinimalMotionComponent(\"svg\")\nexport const MotionSymbol = /*@__PURE__*/ createMinimalMotionComponent(\"symbol\")\nexport const MotionText = /*@__PURE__*/ createMinimalMotionComponent(\"text\")\nexport const MotionTspan = /*@__PURE__*/ createMinimalMotionComponent(\"tspan\")\nexport const MotionUse = /*@__PURE__*/ createMinimalMotionComponent(\"use\")\nexport const MotionView = /*@__PURE__*/ createMinimalMotionComponent(\"view\")\nexport const MotionClipPath =\n /*@__PURE__*/ createMinimalMotionComponent(\"clipPath\")\nexport const MotionFeBlend =\n /*@__PURE__*/ createMinimalMotionComponent(\"feBlend\")\nexport const MotionFeColorMatrix =\n /*@__PURE__*/ createMinimalMotionComponent(\"feColorMatrix\")\nexport const MotionFeComponentTransfer =\n /*@__PURE__*/ createMinimalMotionComponent(\"feComponentTransfer\")\nexport const MotionFeComposite =\n /*@__PURE__*/ createMinimalMotionComponent(\"feComposite\")\nexport const MotionFeConvolveMatrix =\n /*@__PURE__*/ createMinimalMotionComponent(\"feConvolveMatrix\")\nexport const MotionFeDiffuseLighting =\n /*@__PURE__*/ createMinimalMotionComponent(\"feDiffuseLighting\")\nexport const MotionFeDisplacementMap =\n /*@__PURE__*/ createMinimalMotionComponent(\"feDisplacementMap\")\nexport const MotionFeDistantLight =\n /*@__PURE__*/ createMinimalMotionComponent(\"feDistantLight\")\nexport const MotionFeDropShadow =\n /*@__PURE__*/ createMinimalMotionComponent(\"feDropShadow\")\nexport const MotionFeFlood =\n /*@__PURE__*/ createMinimalMotionComponent(\"feFlood\")\nexport const MotionFeFuncA =\n /*@__PURE__*/ createMinimalMotionComponent(\"feFuncA\")\nexport const MotionFeFuncB =\n /*@__PURE__*/ createMinimalMotionComponent(\"feFuncB\")\nexport const MotionFeFuncG =\n /*@__PURE__*/ createMinimalMotionComponent(\"feFuncG\")\nexport const MotionFeFuncR =\n /*@__PURE__*/ createMinimalMotionComponent(\"feFuncR\")\nexport const MotionFeGaussianBlur =\n /*@__PURE__*/ createMinimalMotionComponent(\"feGaussianBlur\")\nexport const MotionFeImage =\n /*@__PURE__*/ createMinimalMotionComponent(\"feImage\")\nexport const MotionFeMerge =\n /*@__PURE__*/ createMinimalMotionComponent(\"feMerge\")\nexport const MotionFeMergeNode =\n /*@__PURE__*/ createMinimalMotionComponent(\"feMergeNode\")\nexport const MotionFeMorphology =\n /*@__PURE__*/ createMinimalMotionComponent(\"feMorphology\")\nexport const MotionFeOffset =\n /*@__PURE__*/ createMinimalMotionComponent(\"feOffset\")\nexport const MotionFePointLight =\n /*@__PURE__*/ createMinimalMotionComponent(\"fePointLight\")\nexport const MotionFeSpecularLighting =\n /*@__PURE__*/ createMinimalMotionComponent(\"feSpecularLighting\")\nexport const MotionFeSpotLight =\n /*@__PURE__*/ createMinimalMotionComponent(\"feSpotLight\")\nexport const MotionFeTile = /*@__PURE__*/ createMinimalMotionComponent(\"feTile\")\nexport const MotionFeTurbulence =\n /*@__PURE__*/ createMinimalMotionComponent(\"feTurbulence\")\nexport const MotionForeignObject =\n /*@__PURE__*/ createMinimalMotionComponent(\"foreignObject\")\nexport const MotionLinearGradient =\n /*@__PURE__*/ createMinimalMotionComponent(\"linearGradient\")\nexport const MotionRadialGradient =\n /*@__PURE__*/ createMinimalMotionComponent(\"radialGradient\")\nexport const MotionTextPath =\n /*@__PURE__*/ createMinimalMotionComponent(\"textPath\")\n"],"names":["createMotionComponent"],"mappings":";;;;;;;;;;AAGM,SAAU,4BAA4B,CAIxC,SAAwD,EACxD,OAAgC,EAAA;AAEhC,IAAA,OAAOA,2BAAqB,CAAC,SAAS,EAAE,OAAO,CAAC;AACpD;;ACPA;;AAEG;AACI,MAAM,OAAO,iBAAiB,4BAA4B,CAAC,GAAG;AAC9D,MAAM,UAAU,iBAAiB,4BAA4B,CAAC,MAAM;MAC9D,aAAa;AACtB,cAAc,4BAA4B,CAAC,SAAS;AACjD,MAAM,UAAU,iBAAiB,4BAA4B,CAAC,MAAM;MAC9D,a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C5B,cAAc,4BAA4B,CAAC,eAAe;MACjD,oBAAoB;AAC7B,cAAc,4BAA4B,CAAC,gBAAgB;MAClD,oBAAoB;AAC7B,cAAc,4BAA4B,CAAC,gBAAgB;MAClD,cAAc;AACvB,cAAc,4BAA4B,CAAC,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/cjs/mini.js b/node_modules/framer-motion/dist/cjs/mini.js deleted file mode 100644 index d00b5e1..0000000 --- a/node_modules/framer-motion/dist/cjs/mini.js +++ /dev/null @@ -1,153 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { value: true }); - -var react = require('react'); -var motionDom = require('motion-dom'); -var motionUtils = require('motion-utils'); - -/** - * Creates a constant value over the lifecycle of a component. - * - * Even if `useMemo` is provided an empty array as its final argument, it doesn't offer - * a guarantee that it won't re-run for performance reasons later on. By using `useConstant` - * you can ensure that initialisers don't execute twice or more. - */ -function useConstant(init) { - const ref = react.useRef(null); - if (ref.current === null) { - ref.current = init(); - } - return ref.current; -} - -function useUnmountEffect(callback) { - return react.useEffect(() => () => callback(), []); -} - -function animateElements(elementOrSelector, keyframes, options, scope) { - // Gracefully handle null/undefined elements (e.g., from querySelector returning null) - if (elementOrSelector == null) { - return []; - } - const elements = motionDom.resolveElements(elementOrSelector, scope); - const numElements = elements.length; - motionUtils.invariant(Boolean(numElements), "No valid elements provided.", "no-valid-elements"); - /** - * WAAPI doesn't support interrupting animations. - * - * Therefore, starting animations requires a three-step process: - * 1. Stop existing animations (write styles to DOM) - * 2. Resolve keyframes (read styles from DOM) - * 3. Create new animations (write styles to DOM) - * - * The hybrid `animate()` function uses AsyncAnimation to resolve - * keyframes before creating new animations, which removes style - * thrashing. Here, we have much stricter filesize constraints. - * Therefore we do this in a synchronous way that ensures that - * at least within `animate()` calls there is no style thrashing. - * - * In the motion-native-animate-mini-interrupt benchmark this - * was 80% faster than a single loop. - */ - const animationDefinitions = []; - /** - * Step 1: Build options and stop existing animations (write) - */ - for (let i = 0; i < numElements; i++) { - const element = elements[i]; - const elementTransition = { ...options }; - /** - * Resolve stagger function if provided. - */ - if (typeof elementTransition.delay === "function") { - elementTransition.delay = elementTransition.delay(i, numElements); - } - for (const valueName in keyframes) { - let valueKeyframes = keyframes[valueName]; - if (!Array.isArray(valueKeyframes)) { - valueKeyframes = [valueKeyframes]; - } - const valueOptions = { - ...motionDom.getValueTransition(elementTransition, valueName), - }; - valueOptions.duration && (valueOptions.duration = motionUtils.secondsToMilliseconds(valueOptions.duration)); - valueOptions.delay && (valueOptions.delay = motionUtils.secondsToMilliseconds(valueOptions.delay)); - /** - * If there's an existing animation playing on this element then stop it - * before creating a new one. - */ - const map = motionDom.getAnimationMap(element); - const key = motionDom.animationMapKey(valueName, valueOptions.pseudoElement || ""); - const currentAnimation = map.get(key); - currentAnimation && currentAnimation.stop(); - animationDefinitions.push({ - map, - key, - unresolvedKeyframes: valueKeyframes, - options: { - ...valueOptions, - element, - name: valueName, - allowFlatten: !elementTransition.type && !elementTransition.ease, - }, - }); - } - } - /** - * Step 2: Resolve keyframes (read) - */ - for (let i = 0; i < animationDefinitions.length; i++) { - const { unresolvedKeyframes, options: animationOptions } = animationDefinitions[i]; - const { element, name, pseudoElement } = animationOptions; - if (!pseudoElement && unresolvedKeyframes[0] === null) { - unresolvedKeyframes[0] = motionDom.getComputedStyle(element, name); - } - motionDom.fillWildcards(unresolvedKeyframes); - motionDom.applyPxDefaults(unresolvedKeyframes, name); - /** - * If we only have one keyframe, explicitly read the initial keyframe - * from the computed style. This is to ensure consistency with WAAPI behaviour - * for restarting animations, for instance .play() after finish, when it - * has one vs two keyframes. - */ - if (!pseudoElement && unresolvedKeyframes.length < 2) { - unresolvedKeyframes.unshift(motionDom.getComputedStyle(element, name)); - } - animationOptions.keyframes = unresolvedKeyframes; - } - /** - * Step 3: Create new animations (write) - */ - const animations = []; - for (let i = 0; i < animationDefinitions.length; i++) { - const { map, key, options: animationOptions } = animationDefinitions[i]; - const animation = new motionDom.NativeAnimation(animationOptions); - map.set(key, animation); - animation.finished.finally(() => map.delete(key)); - animations.push(animation); - } - return animations; -} - -const createScopedWaapiAnimate = (scope) => { - function scopedAnimate(elementOrSelector, keyframes, options) { - return new motionDom.GroupAnimationWithThen(animateElements(elementOrSelector, keyframes, options, scope)); - } - return scopedAnimate; -}; - -function useAnimateMini() { - const scope = useConstant(() => ({ - current: null, // Will be hydrated by React - animations: [], - })); - const animate = useConstant(() => createScopedWaapiAnimate(scope)); - useUnmountEffect(() => { - scope.animations.forEach((animation) => animation.stop()); - }); - return [scope, animate]; -} - -exports.useAnimate = useAnimateMini; -//# sourceMappingURL=mini.js.map diff --git a/node_modules/framer-motion/dist/cjs/mini.js.map b/node_modules/framer-motion/dist/cjs/mini.js.map deleted file mode 100644 index bc1c077..0000000 --- a/node_modules/framer-motion/dist/cjs/mini.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mini.js","sources":["../../src/utils/use-constant.ts","../../src/utils/use-unmount-effect.ts","../../src/animation/animators/waapi/animate-elements.ts","../../src/animation/animators/waapi/animate-style.ts","../../src/animation/hooks/use-animate-style.ts"],"sourcesContent":["\"use client\"\n\nimport { useRef } from \"react\"\n\ntype Init = () => T\n\n/**\n * Creates a constant value over the lifecycle of a component.\n *\n * Even if `useMemo` is provided an empty array as its final argument, it doesn't offer\n * a guarantee that it won't re-run for performance reasons later on. By using `useConstant`\n * you can ensure that initialisers don't execute twice or more.\n */\nexport function useConstant(init: Init) {\n const ref = useRef(null)\n\n if (ref.current === null) {\n ref.current = init()\n }\n\n return ref.current\n}\n","\"use client\"\n\nimport { useEffect } from \"react\"\n\nexport function useUnmountEffect(callback: () => void) {\n return useEffect(() => () => callback(), [])\n}\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>\n key: string\n unresolvedKeyframes: UnresolvedValueKeyframe[]\n options: Omit & {\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","\"use client\"\n\nimport { useConstant } from \"../../utils/use-constant\"\nimport { useUnmountEffect } from \"../../utils/use-unmount-effect\"\nimport { createScopedWaapiAnimate } from \"../animators/waapi/animate-style\"\nimport { AnimationScope } from \"motion-dom\"\n\nexport function useAnimateMini() {\n const scope: AnimationScope = useConstant(() => ({\n current: null!, // Will be hydrated by React\n animations: [],\n }))\n\n const animate = useConstant(() => createScopedWaapiAnimate(scope))\n\n useUnmountEffect(() => {\n scope.animations.forEach((animation) => animation.stop())\n })\n\n return [scope, animate] as [AnimationScope, typeof animate]\n}\n"],"names":["useRef","useEffect","resolveElements","invariant","getValueTransition","secondsToMilliseconds","getAnimationMap","animationMapKey","getComputedStyle","fillWildcards","applyPxDefaults","NativeAnimation","GroupAnimationWithThen"],"mappings":";;;;;;;;AAMA;;;;;;AAMG;AACG,SAAU,WAAW,CAAI,IAAa,EAAA;AACxC,IAAA,MAAM,GAAG,GAAGA,YAAM,CAAW,IAAI,CAAC;AAElC,IAAA,IAAI,GAAG,CAAC,OAAO,KAAK,IAAI,EAAE;AACtB,QAAA,GAAG,CAAC,OAAO,GAAG,IAAI,EAAE;IACxB;IAEA,OAA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WAAW,CAAC,OAAO;QAChD,OAAO,EAAE,IAAK;AACd,QAAA,UAAU,EAAE,EAAE;AACjB,KAAA,CAAC,CAAC;AAEH,IAAA,MAAM,OAAO,GAAG,WAAW,CAAC,MAAM,wBAAwB,CAAC,KAAK,CAAC,CAAC;IAElE,gBAAgB,CAAC,MAAK;AAClB,QAAA,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,SAAS,KAAK,SAAS,CAAC,IAAI,EAAE,CAAC;AAC7D,IAAA,CAAC,CAAC;AAEF,IAAA,OAAO,CAAC,KAAK,EAAE,OAAO,CAAwC;AAClE;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/client.d.ts b/node_modules/framer-motion/dist/client.d.ts deleted file mode 100644 index 9781baf..0000000 --- a/node_modules/framer-motion/dist/client.d.ts +++ /dev/null @@ -1,367 +0,0 @@ -import { CSSProperties, PropsWithoutRef, RefAttributes, JSX, SVGAttributes } from 'react'; -import { MotionNodeOptions, MotionValue, TransformProperties, SVGPathProperties } from 'motion-dom'; - -type MotionValueString = MotionValue; -type MotionValueNumber = MotionValue; -type MotionValueAny = MotionValue; -type AnyMotionValue = MotionValueNumber | MotionValueString | MotionValueAny; -type MotionValueHelper = T | AnyMotionValue; -type MakeMotionHelper = { - [K in keyof T]: MotionValueHelper; -}; -type MakeCustomValueTypeHelper = MakeMotionHelper; -type MakeMotion = MakeCustomValueTypeHelper; -type MotionCSS = MakeMotion>; -/** - * @public - */ -type MotionTransform = MakeMotion; -type MotionSVGProps = MakeMotion; -/** - * @public - */ -interface MotionStyle$1 extends MotionCSS, MotionTransform, MotionSVGProps { -} -/** - * Props for `motion` components. - * - * @public - */ -interface MotionProps extends MotionNodeOptions { - /** - * - * The React DOM `style` prop, enhanced with support for `MotionValue`s and separate `transform` values. - * - * ```jsx - * export const MyComponent = () => { - * const x = useMotionValue(0) - * - * return - * } - * ``` - */ - style?: MotionStyle$1; - children?: React.ReactNode | MotionValueNumber | MotionValueString; -} - -interface HTMLElements { - a: HTMLAnchorElement; - abbr: HTMLElement; - address: HTMLElement; - area: HTMLAreaElement; - article: HTMLElement; - aside: HTMLElement; - audio: HTMLAudioElement; - b: HTMLElement; - base: HTMLBaseElement; - bdi: HTMLElement; - bdo: HTMLElement; - big: HTMLElement; - blockquote: HTMLQuoteElement; - body: HTMLBodyElement; - br: HTMLBRElement; - button: HTMLButtonElement; - canvas: HTMLCanvasElement; - caption: HTMLElement; - center: HTMLElement; - cite: HTMLElement; - code: HTMLElement; - col: HTMLTableColElement; - colgroup: HTMLTableColElement; - data: HTMLDataElement; - datalist: HTMLDataListElement; - dd: HTMLElement; - del: HTMLModElement; - details: HTMLDetailsElement; - dfn: HTMLElement; - dialog: HTMLDialogElement; - div: HTMLDivElement; - dl: HTMLDListElement; - dt: HTMLElement; - em: HTMLElement; - embed: HTMLEmbedElement; - fieldset: HTMLFieldSetElement; - figcaption: HTMLElement; - figure: HTMLElement; - footer: HTMLElement; - form: HTMLFormElement; - h1: HTMLHeadingElement; - h2: HTMLHeadingElement; - h3: HTMLHeadingElement; - h4: HTMLHeadingElement; - h5: HTMLHeadingElement; - h6: HTMLHeadingElement; - head: HTMLHeadElement; - header: HTMLElement; - hgroup: HTMLElement; - hr: HTMLHRElement; - html: HTMLHtmlElement; - i: HTMLElement; - iframe: HTMLIFrameElement; - img: HTMLImageElement; - input: HTMLInputElement; - ins: HTMLModElement; - kbd: HTMLElement; - keygen: HTMLElement; - label: HTMLLabelElement; - legend: HTMLLegendElement; - li: HTMLLIElement; - link: HTMLLinkElement; - main: HTMLElement; - map: HTMLMapElement; - mark: HTMLElement; - menu: HTMLElement; - menuitem: HTMLElement; - meta: HTMLMetaElement; - meter: HTMLMeterElement; - nav: HTMLElement; - noindex: HTMLElement; - noscript: HTMLElement; - object: HTMLObjectElement; - ol: HTMLOListElement; - optgroup: HTMLOptGroupElement; - option: HTMLOptionElement; - output: HTMLOutputElement; - p: HTMLParagraphElement; - param: HTMLParamElement; - picture: HTMLElement; - pre: HTMLPreElement; - progress: HTMLProgressElement; - q: HTMLQuoteElement; - rp: HTMLElement; - rt: HTMLElement; - ruby: HTMLElement; - s: HTMLElement; - samp: HTMLElement; - search: HTMLElement; - slot: HTMLSlotElement; - script: HTMLScriptElement; - section: HTMLElement; - select: HTMLSelectElement; - small: HTMLElement; - source: HTMLSourceElement; - span: HTMLSpanElement; - strong: HTMLElement; - style: HTMLStyleElement; - sub: HTMLElement; - summary: HTMLElement; - sup: HTMLElement; - table: HTMLTableElement; - template: HTMLTemplateElement; - tbody: HTMLTableSectionElement; - td: HTMLTableDataCellElement; - textarea: HTMLTextAreaElement; - tfoot: HTMLTableSectionElement; - th: HTMLTableHeaderCellElement; - thead: HTMLTableSectionElement; - time: HTMLTimeElement; - title: HTMLTitleElement; - tr: HTMLTableRowElement; - track: HTMLTrackElement; - u: HTMLElement; - ul: HTMLUListElement; - var: HTMLElement; - video: HTMLVideoElement; - wbr: HTMLElement; - webview: HTMLWebViewElement; -} - -/** - * @public - */ -type ForwardRefComponent = { - readonly $$typeof: symbol; -} & ((props: PropsWithoutRef

& RefAttributes) => JSX.Element); -type AttributesWithoutMotionProps = { - [K in Exclude]?: Attributes[K]; -}; -/** - * @public - */ -type HTMLMotionProps = AttributesWithoutMotionProps & MotionProps; - -interface SVGAttributesWithoutMotionProps extends Pick, Exclude, keyof MotionProps>> { -} -/** - * Blanket-accept any SVG attribute as a `MotionValue` - * @public - */ -type SVGAttributesAsMotionValues = MakeMotion>; -/** - * @public - */ -interface SVGMotionProps extends SVGAttributesAsMotionValues, MotionProps { -} - -/** - * HTML components - */ -declare const MotionA: ForwardRefComponent>; -declare const MotionAbbr: ForwardRefComponent>; -declare const MotionAddress: ForwardRefComponent>; -declare const MotionArea: ForwardRefComponent>; -declare const MotionArticle: ForwardRefComponent>; -declare const MotionAside: ForwardRefComponent>; -declare const MotionAudio: ForwardRefComponent>; -declare const MotionB: ForwardRefComponent>; -declare const MotionBase: ForwardRefComponent>; -declare const MotionBdi: ForwardRefComponent>; -declare const MotionBdo: ForwardRefComponent>; -declare const MotionBig: ForwardRefComponent>; -declare const MotionBlockquote: ForwardRefComponent>; -declare const MotionBody: ForwardRefComponent>; -declare const MotionButton: ForwardRefComponent>; -declare const MotionCanvas: ForwardRefComponent>; -declare const MotionCaption: ForwardRefComponent>; -declare const MotionCite: ForwardRefComponent>; -declare const MotionCode: ForwardRefComponent>; -declare const MotionCol: ForwardRefComponent>; -declare const MotionColgroup: ForwardRefComponent>; -declare const MotionData: ForwardRefComponent>; -declare const MotionDatalist: ForwardRefComponent>; -declare const MotionDd: ForwardRefComponent>; -declare const MotionDel: ForwardRefComponent>; -declare const MotionDetails: ForwardRefComponent>; -declare const MotionDfn: ForwardRefComponent>; -declare const MotionDialog: ForwardRefComponent>; -declare const MotionDiv: ForwardRefComponent>; -declare const MotionDl: ForwardRefComponent>; -declare const MotionDt: ForwardRefComponent>; -declare const MotionEm: ForwardRefComponent>; -declare const MotionEmbed: ForwardRefComponent>; -declare const MotionFieldset: ForwardRefComponent>; -declare const MotionFigcaption: ForwardRefComponent>; -declare const MotionFigure: ForwardRefComponent>; -declare const MotionFooter: ForwardRefComponent>; -declare const MotionForm: ForwardRefComponent>; -declare const MotionH1: ForwardRefComponent>; -declare const MotionH2: ForwardRefComponent>; -declare const MotionH3: ForwardRefComponent>; -declare const MotionH4: ForwardRefComponent>; -declare const MotionH5: ForwardRefComponent>; -declare const MotionH6: ForwardRefComponent>; -declare const MotionHead: ForwardRefComponent>; -declare const MotionHeader: ForwardRefComponent>; -declare const MotionHgroup: ForwardRefComponent>; -declare const MotionHr: ForwardRefComponent>; -declare const MotionHtml: ForwardRefComponent>; -declare const MotionI: ForwardRefComponent>; -declare const MotionIframe: ForwardRefComponent>; -declare const MotionImg: ForwardRefComponent>; -declare const MotionInput: ForwardRefComponent>; -declare const MotionIns: ForwardRefComponent>; -declare const MotionKbd: ForwardRefComponent>; -declare const MotionKeygen: ForwardRefComponent>; -declare const MotionLabel: ForwardRefComponent>; -declare const MotionLegend: ForwardRefComponent>; -declare const MotionLi: ForwardRefComponent>; -declare const MotionLink: ForwardRefComponent>; -declare const MotionMain: ForwardRefComponent>; -declare const MotionMap: ForwardRefComponent>; -declare const MotionMark: ForwardRefComponent>; -declare const MotionMenu: ForwardRefComponent>; -declare const MotionMenuitem: ForwardRefComponent>; -declare const MotionMeter: ForwardRefComponent>; -declare const MotionNav: ForwardRefComponent>; -declare const MotionObject: ForwardRefComponent>; -declare const MotionOl: ForwardRefComponent>; -declare const MotionOptgroup: ForwardRefComponent>; -declare const MotionOption: ForwardRefComponent>; -declare const MotionOutput: ForwardRefComponent>; -declare const MotionP: ForwardRefComponent>; -declare const MotionParam: ForwardRefComponent>; -declare const MotionPicture: ForwardRefComponent>; -declare const MotionPre: ForwardRefComponent>; -declare const MotionProgress: ForwardRefComponent>; -declare const MotionQ: ForwardRefComponent>; -declare const MotionRp: ForwardRefComponent>; -declare const MotionRt: ForwardRefComponent>; -declare const MotionRuby: ForwardRefComponent>; -declare const MotionS: ForwardRefComponent>; -declare const MotionSamp: ForwardRefComponent>; -declare const MotionScript: ForwardRefComponent>; -declare const MotionSection: ForwardRefComponent>; -declare const MotionSelect: ForwardRefComponent>; -declare const MotionSmall: ForwardRefComponent>; -declare const MotionSource: ForwardRefComponent>; -declare const MotionSpan: ForwardRefComponent>; -declare const MotionStrong: ForwardRefComponent>; -declare const MotionStyle: ForwardRefComponent>; -declare const MotionSub: ForwardRefComponent>; -declare const MotionSummary: ForwardRefComponent>; -declare const MotionSup: ForwardRefComponent>; -declare const MotionTable: ForwardRefComponent>; -declare const MotionTbody: ForwardRefComponent>; -declare const MotionTd: ForwardRefComponent>; -declare const MotionTextarea: ForwardRefComponent>; -declare const MotionTfoot: ForwardRefComponent>; -declare const MotionTh: ForwardRefComponent>; -declare const MotionThead: ForwardRefComponent>; -declare const MotionTime: ForwardRefComponent>; -declare const MotionTitle: ForwardRefComponent>; -declare const MotionTr: ForwardRefComponent>; -declare const MotionTrack: ForwardRefComponent>; -declare const MotionU: ForwardRefComponent>; -declare const MotionUl: ForwardRefComponent>; -declare const MotionVideo: ForwardRefComponent>; -declare const MotionWbr: ForwardRefComponent>; -declare const MotionWebview: ForwardRefComponent>; -/** - * SVG components - */ -declare const MotionAnimate: ForwardRefComponent>; -declare const MotionCircle: ForwardRefComponent>; -declare const MotionDefs: ForwardRefComponent>; -declare const MotionDesc: ForwardRefComponent>; -declare const MotionEllipse: ForwardRefComponent>; -declare const MotionG: ForwardRefComponent>; -declare const MotionImage: ForwardRefComponent>; -declare const MotionLine: ForwardRefComponent>; -declare const MotionFilter: ForwardRefComponent>; -declare const MotionMarker: ForwardRefComponent>; -declare const MotionMask: ForwardRefComponent>; -declare const MotionMetadata: ForwardRefComponent>; -declare const MotionPath: ForwardRefComponent>; -declare const MotionPattern: ForwardRefComponent>; -declare const MotionPolygon: ForwardRefComponent>; -declare const MotionPolyline: ForwardRefComponent>; -declare const MotionRect: ForwardRefComponent>; -declare const MotionStop: ForwardRefComponent>; -declare const MotionSvg: ForwardRefComponent>; -declare const MotionSymbol: ForwardRefComponent>; -declare const MotionText: ForwardRefComponent>; -declare const MotionTspan: ForwardRefComponent>; -declare const MotionUse: ForwardRefComponent>; -declare const MotionView: ForwardRefComponent>; -declare const MotionClipPath: ForwardRefComponent>; -declare const MotionFeBlend: ForwardRefComponent>; -declare const MotionFeColorMatrix: ForwardRefComponent>; -declare const MotionFeComponentTransfer: ForwardRefComponent>; -declare const MotionFeComposite: ForwardRefComponent>; -declare const MotionFeConvolveMatrix: ForwardRefComponent>; -declare const MotionFeDiffuseLighting: ForwardRefComponent>; -declare const MotionFeDisplacementMap: ForwardRefComponent>; -declare const MotionFeDistantLight: ForwardRefComponent>; -declare const MotionFeDropShadow: ForwardRefComponent>; -declare const MotionFeFlood: ForwardRefComponent>; -declare const MotionFeFuncA: ForwardRefComponent>; -declare const MotionFeFuncB: ForwardRefComponent>; -declare const MotionFeFuncG: ForwardRefComponent>; -declare const MotionFeFuncR: ForwardRefComponent>; -declare const MotionFeGaussianBlur: ForwardRefComponent>; -declare const MotionFeImage: ForwardRefComponent>; -declare const MotionFeMerge: ForwardRefComponent>; -declare const MotionFeMergeNode: ForwardRefComponent>; -declare const MotionFeMorphology: ForwardRefComponent>; -declare const MotionFeOffset: ForwardRefComponent>; -declare const MotionFePointLight: ForwardRefComponent>; -declare const MotionFeSpecularLighting: ForwardRefComponent>; -declare const MotionFeSpotLight: ForwardRefComponent>; -declare const MotionFeTile: ForwardRefComponent>; -declare const MotionFeTurbulence: ForwardRefComponent>; -declare const MotionForeignObject: ForwardRefComponent>; -declare const MotionLinearGradient: ForwardRefComponent>; -declare const MotionRadialGradient: ForwardRefComponent>; -declare const MotionTextPath: ForwardRefComponent>; - -export { MotionA as a, MotionAbbr as abbr, MotionAddress as address, MotionAnimate as animate, MotionArea as area, MotionArticle as article, MotionAside as aside, MotionAudio as audio, MotionB as b, MotionBase as base, MotionBdi as bdi, MotionBdo as bdo, MotionBig as big, MotionBlockquote as blockquote, MotionBody as body, MotionButton as button, MotionCanvas as canvas, MotionCaption as caption, MotionCircle as circle, MotionCite as cite, MotionClipPath as clipPath, MotionCode as code, MotionCol as col, MotionColgroup as colgroup, MotionData as data, MotionDatalist as datalist, MotionDd as dd, MotionDefs as defs, MotionDel as del, MotionDesc as desc, MotionDetails as details, MotionDfn as dfn, MotionDialog as dialog, MotionDiv as div, MotionDl as dl, MotionDt as dt, MotionEllipse as ellipse, MotionEm as em, MotionEmbed as embed, MotionFeBlend as feBlend, MotionFeColorMatrix as feColorMatrix, MotionFeComponentTransfer as feComponentTransfer, MotionFeComposite as feComposite, MotionFeConvolveMatrix as feConvolveMatrix, MotionFeDiffuseLighting as feDiffuseLighting, MotionFeDisplacementMap as feDisplacementMap, MotionFeDistantLight as feDistantLight, MotionFeDropShadow as feDropShadow, MotionFeFlood as feFlood, MotionFeFuncA as feFuncA, MotionFeFuncB as feFuncB, MotionFeFuncG as feFuncG, MotionFeFuncR as feFuncR, MotionFeGaussianBlur as feGaussianBlur, MotionFeImage as feImage, MotionFeMerge as feMerge, MotionFeMergeNode as feMergeNode, MotionFeMorphology as feMorphology, MotionFeOffset as feOffset, MotionFePointLight as fePointLight, MotionFeSpecularLighting as feSpecularLighting, MotionFeSpotLight as feSpotLight, MotionFeTile as feTile, MotionFeTurbulence as feTurbulence, MotionFieldset as fieldset, MotionFigcaption as figcaption, MotionFigure as figure, MotionFilter as filter, MotionFooter as footer, MotionForeignObject as foreignObject, MotionForm as form, MotionG as g, MotionH1 as h1, MotionH2 as h2, MotionH3 as h3, MotionH4 as h4, MotionH5 as h5, MotionH6 as h6, MotionHead as head, MotionHeader as header, MotionHgroup as hgroup, MotionHr as hr, MotionHtml as html, MotionI as i, MotionIframe as iframe, MotionImage as image, MotionImg as img, MotionInput as input, MotionIns as ins, MotionKbd as kbd, MotionKeygen as keygen, MotionLabel as label, MotionLegend as legend, MotionLi as li, MotionLine as line, MotionLinearGradient as linearGradient, MotionLink as link, MotionMain as main, MotionMap as map, MotionMark as mark, MotionMarker as marker, MotionMask as mask, MotionMenu as menu, MotionMenuitem as menuitem, MotionMetadata as metadata, MotionMeter as meter, MotionNav as nav, MotionObject as object, MotionOl as ol, MotionOptgroup as optgroup, MotionOption as option, MotionOutput as output, MotionP as p, MotionParam as param, MotionPath as path, MotionPattern as pattern, MotionPicture as picture, MotionPolygon as polygon, MotionPolyline as polyline, MotionPre as pre, MotionProgress as progress, MotionQ as q, MotionRadialGradient as radialGradient, MotionRect as rect, MotionRp as rp, MotionRt as rt, MotionRuby as ruby, MotionS as s, MotionSamp as samp, MotionScript as script, MotionSection as section, MotionSelect as select, MotionSmall as small, MotionSource as source, MotionSpan as span, MotionStop as stop, MotionStrong as strong, MotionStyle as style, MotionSub as sub, MotionSummary as summary, MotionSup as sup, MotionSvg as svg, MotionSymbol as symbol, MotionTable as table, MotionTbody as tbody, MotionTd as td, MotionText as text, MotionTextPath as textPath, MotionTextarea as textarea, MotionTfoot as tfoot, MotionTh as th, MotionThead as thead, MotionTime as time, MotionTitle as title, MotionTr as tr, MotionTrack as track, MotionTspan as tspan, MotionU as u, MotionUl as ul, MotionUse as use, MotionVideo as video, MotionView as view, MotionWbr as wbr, MotionWebview as webview }; diff --git a/node_modules/framer-motion/dist/debug.d.ts b/node_modules/framer-motion/dist/debug.d.ts deleted file mode 100644 index a4901bc..0000000 --- a/node_modules/framer-motion/dist/debug.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from 'motion-dom'; -export { recordStats } from 'motion-dom'; diff --git a/node_modules/framer-motion/dist/dom-mini.d.ts b/node_modules/framer-motion/dist/dom-mini.d.ts deleted file mode 100644 index 36f39d8..0000000 --- a/node_modules/framer-motion/dist/dom-mini.d.ts +++ /dev/null @@ -1,69 +0,0 @@ -import { UnresolvedValueKeyframe, AnimationOptions, MotionValue, Transition, ElementOrSelector, DOMKeyframesDefinition, AnimationPlaybackOptions, GroupAnimationWithThen, AnimationPlaybackControlsWithThen } from 'motion-dom'; - -/** - * Lifecycle callbacks are not supported on individual sequence segments - * because segments are consolidated into a single animation per subject. - * Use sequence-level options (e.g. SequenceOptions.onComplete) instead. - */ -type LifecycleCallbacks = "onUpdate" | "onPlay" | "onComplete" | "onRepeat" | "onStop"; -/** - * Distributive Omit preserves union branches (unlike plain Omit). - */ -type DistributiveOmit = T extends any ? Omit : never; -type SegmentTransitionOptions = DistributiveOmit & At; -type SegmentValueTransitionOptions = DistributiveOmit & At; -type ObjectTarget = { - [K in keyof O]?: O[K] | UnresolvedValueKeyframe[]; -}; -type SequenceTime = number | "<" | `+${number}` | `-${number}` | `${string}`; -type SequenceLabel = string; -interface SequenceLabelWithTime { - name: SequenceLabel; - at: SequenceTime; -} -interface At { - at?: SequenceTime; -} -type MotionValueSegment = [ - MotionValue, - UnresolvedValueKeyframe | UnresolvedValueKeyframe[] -]; -type MotionValueSegmentWithTransition = [ - MotionValue, - UnresolvedValueKeyframe | UnresolvedValueKeyframe[], - SegmentValueTransitionOptions -]; -type DOMSegment = [ElementOrSelector, DOMKeyframesDefinition]; -type DOMSegmentWithTransition = [ - ElementOrSelector, - DOMKeyframesDefinition, - SegmentTransitionOptions -]; -type ObjectSegment = [O, ObjectTarget]; -type ObjectSegmentWithTransition = [ - O, - ObjectTarget, - SegmentTransitionOptions -]; -type SequenceProgressCallback = (value: any) => void; -type FunctionSegment = [SequenceProgressCallback] | [SequenceProgressCallback, SegmentTransitionOptions] | [ - SequenceProgressCallback, - UnresolvedValueKeyframe | UnresolvedValueKeyframe[], - SegmentTransitionOptions -]; -type Segment = ObjectSegment | ObjectSegmentWithTransition | SequenceLabel | SequenceLabelWithTime | MotionValueSegment | MotionValueSegmentWithTransition | DOMSegment | DOMSegmentWithTransition | FunctionSegment; -type AnimationSequence = Segment[]; -interface SequenceOptions extends AnimationPlaybackOptions { - delay?: number; - duration?: number; - defaultTransition?: Transition; - reduceMotion?: boolean; - skipAnimations?: boolean; - onComplete?: () => void; -} - -declare function animateSequence(definition: AnimationSequence, options?: SequenceOptions): GroupAnimationWithThen; - -declare const animateMini: (elementOrSelector: ElementOrSelector, keyframes: DOMKeyframesDefinition, options?: AnimationOptions) => AnimationPlaybackControlsWithThen; - -export { animateMini as animate, animateSequence }; diff --git a/node_modules/framer-motion/dist/dom-mini.js b/node_modules/framer-motion/dist/dom-mini.js deleted file mode 100644 index 61a0228..0000000 --- a/node_modules/framer-motion/dist/dom-mini.js +++ /dev/null @@ -1 +0,0 @@ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Motion={})}(this,function(t){"use strict";function e(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}function n(t,e){return e?`${t}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:t}let i=()=>{},s=()=>{};"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(i=(t,e,i)=>{t||"undefined"==typeof console||console.warn(n(e,i))},s=(t,e,i)=>{if(!t)throw new Error(n(e,i))});const o=t=>t,a=(t,e,n)=>{const i=e-t;return i?(n-t)/i:1},r=t=>1e3*t,l=t=>t/1e3;function u(t,e){return n=t,Array.isArray(n)&&"number"!=typeof n[0]?t[((t,e,n)=>{const i=e-t;return((n-t)%i+i)%i+t})(0,t.length,e)]:t;var n}const h=(t,e,n)=>t+(e-t)*n,c=2e4;function f(t,e=100,n){const i=n({...t,keyframes:[0,e]}),s=Math.min(function(t){let e=0,n=t.next(e);for(;!n.done&&e=c?1/0:e}(i),c);return{type:"keyframes",ease:t=>i.next(s*t).value/e,duration:l(s)}}function d(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const s=a(0,e,i);t.push(h(n,1,s))}}function m(t){const e=[0];return d(e,t.length-1),e}const p=t=>null!==t;class g{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}function y(t){for(let e=1;et.startsWith("--");const T={};function b(t,e){const n=function(t){let e;return()=>(void 0===e&&(e=t()),e)}(t);return()=>T[e]??n()}const v=b(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),S=b(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),k=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,E={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:k([0,.65,.55,1]),circOut:k([.55,0,1,.45]),backIn:k([.31,.01,.66,-.59]),backOut:k([.33,1.53,.69,.99])};function w(t,e){return t?"function"==typeof t?S()?((t,e,n=10)=>{let i="";const s=Math.max(Math.round(e/n),2);for(let e=0;eArray.isArray(t)&&"number"==typeof t[0])(t)?k(t):Array.isArray(t)?t.map(t=>w(t,e)||E.easeOut):E[t]:void 0}function M(t){return"function"==typeof t&&"applyToOptions"in t}class B extends g{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:e,name:n,keyframes:i,pseudoElement:o,allowFlatten:a=!1,finalKeyframe:r,onComplete:l}=t;this.isPseudoElement=Boolean(o),this.allowFlatten=a,this.options=t,s("string"!=typeof t.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const u=function({type:t,...e}){return M(t)&&S()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=function(t,e,n,{delay:i=0,duration:s=300,repeat:o=0,repeatType:a="loop",ease:r="easeOut",times:l}={},u){const h={[e]:n};l&&(h.offset=l);const c=w(r,s);Array.isArray(c)&&(h.easing=c);const f={delay:i,duration:s,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:o+1,direction:"reverse"===a?"alternate":"normal"};return u&&(f.pseudoElement=u),t.animate(h,f)}(e,n,i,u,o),!1===u.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const t=function(t,{repeat:e,repeatType:n="loop"},i,s=1){const o=t.filter(p),a=s<0||e&&"loop"!==n&&e%2==1?0:o.length-1;return a&&void 0!==i?i:o[a]}(i,this.options,r,this.speed);this.updateMotionValue&&this.updateMotionValue(t),function(t,e,n){A(e)?t.style.setProperty(e,n):t.style[e]=n}(e,n,t),this.animation.cancel()}l?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return l(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+l(t)}get time(){return l(Number(this.animation.currentTime)||0)}set time(t){const e=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=r(t),e&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:e,rangeEnd:n,observe:i}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&v()?(this.animation.timeline=t,e&&(this.animation.rangeStart=e),n&&(this.animation.rangeEnd=n),o):i(this)}}class x{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;ne.attachTimeline(t));return()=>{e.forEach((t,e)=>{t&&t(),this.animations[e].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return I(this.animations,"duration")}get iterationDuration(){return I(this.animations,"iterationDuration")}runAll(t){this.animations.forEach(e=>e[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function I(t,e){let n=0;for(let i=0;in&&(n=s)}return n}class O extends x{then(t,e){return this.finished.finally(t).then(()=>{})}}const F=new WeakMap,R=(t,e="")=>`${t}:${e}`;function W(t){let e=F.get(t);return e||(e=new Map,F.set(t,e)),e}function $(t,e){const n=t?.[e]??t?.default??t;return n!==t?function(t,e){if(t?.inherit&&e){const{inherit:n,...i}=t;return{...e,...i}}return t}(n,t):n}const P=t=>Boolean(t&&t.getVelocity),N=new Set(["borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","width","maxWidth","height","maxHeight","top","right","bottom","left","inset","insetBlock","insetBlockStart","insetBlockEnd","insetInline","insetInlineStart","insetInlineEnd","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingBlock","paddingBlockStart","paddingBlockEnd","paddingInline","paddingInlineStart","paddingInlineEnd","margin","marginTop","marginRight","marginBottom","marginLeft","marginBlock","marginBlockStart","marginBlockEnd","marginInline","marginInlineStart","marginInlineEnd","fontSize","backgroundPositionX","backgroundPositionY"]);function V(t,e){for(let n=0;nnull!=t)}function D(t,e){const n=window.getComputedStyle(t);return A(e)?n.getPropertyValue(e):n[e]}function q(t,e,n,i){return null==t?[]:"string"==typeof t&&function(t){return"object"==typeof t&&!Array.isArray(t)}(e)?L(t,0,i):t instanceof NodeList?Array.from(t):Array.isArray(t)?t.filter(t=>null!=t):[t]}function C(t,e,n){return t*(e+1)+n*e}function K(t,e,n,i){return"number"==typeof e?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?n:e.startsWith("<")?Math.max(0,n+parseFloat(e.slice(1))):i.get(e)??t}function _(t,n,i,s,o,a){!function(t,n,i){for(let s=0;sn&&o.at"number"==typeof t,J=t=>t.every(G);function Q(t,e,n,i){if(null==t)return[];const o=L(t),a=o.length;s(Boolean(a),"No valid elements provided.","no-valid-elements");const l=[];for(let t=0;te.delete(n)),u.push(s)}return u}const Z=(()=>function(t,e,n){return new O(Q(t,e,n))})();t.animate=Z,t.animateSequence=function(t,e){const n=[];return function(t,{defaultTransition:e={},...n}={},s,o){const l=e.duration||.3,h=new Map,c=new Map,p={},g=new Map;let y=0,A=0,T=0;for(let n=0;n{const c=X(t),{delay:p=0,times:g=m(c),type:y=e.type||"keyframes",repeat:b,repeatType:S,repeatDelay:k=0,...E}=n;let{ease:w=e.ease||"easeOut",duration:B}=n;const x="function"==typeof p?p(a,h):p,I=c.length,O=M(y)?y:o?.[y||"keyframes"];if(I<=2&&O){let t=100;if(2===I&&J(c)){const e=c[1]-c[0];t=Math.abs(e)}const n={...e,...E};void 0!==B&&(n.duration=r(B));const i=f(n,t,O);w=i.ease,B=i.duration}B??(B=l);const F=A+x;1===g.length&&0===g[0]&&(g[1]=1);const R=g.length-c.length;if(R>0&&d(g,R),1===c.length&&c.unshift(null),b&&i(b<20,`Sequence segments can't repeat ${b} times — ignoring repeat option. Use a value below 20 or apply repeat at the sequence level instead.`),b&&b<20){const t=B>0?k/B:0;B=C(B,b,k);const e=[...c],n=[...g];w=Array.isArray(w)?[...w]:[w];const i=[...w],s="reverse"===S||"mirror"===S;let o=e,a=i;s&&(o=[...e].reverse(),"reverse"===S&&(a=[...i].reverse().map(t=>{return"function"==typeof t?(e=t,t=>1-e(1-t)):t;var e})));for(let r=0;r0&&(c.push(c[c.length-1]),g.push(d),w.push("linear")),c.push(...h);for(let t=0;t{for(const s in t){const o=t[s];o.sort(z);const r=[],l=[],u=[];for(let t=0;t{n.push(...Q(i,t,e))}),new O(n)}}); diff --git a/node_modules/framer-motion/dist/dom.d.ts b/node_modules/framer-motion/dist/dom.d.ts deleted file mode 100644 index 52de5ea..0000000 --- a/node_modules/framer-motion/dist/dom.d.ts +++ /dev/null @@ -1,304 +0,0 @@ -import { AnyResolvedKeyframe, UnresolvedValueKeyframe, AnimationOptions, MotionValue, Transition, ElementOrSelector, DOMKeyframesDefinition, AnimationPlaybackOptions, AnimationPlaybackControlsWithThen, ValueAnimationTransition, AnimationScope, AnimationPlaybackControls } from 'motion-dom'; -export * from 'motion-dom'; -export { DelayedFunction, delayInSeconds as delay } from 'motion-dom'; -import { Easing, EasingFunction, Point } from 'motion-utils'; -export * from 'motion-utils'; - -/** - * Lifecycle callbacks are not supported on individual sequence segments - * because segments are consolidated into a single animation per subject. - * Use sequence-level options (e.g. SequenceOptions.onComplete) instead. - */ -type LifecycleCallbacks = "onUpdate" | "onPlay" | "onComplete" | "onRepeat" | "onStop"; -/** - * Distributive Omit preserves union branches (unlike plain Omit). - */ -type DistributiveOmit = T extends any ? Omit : never; -type SegmentTransitionOptions = DistributiveOmit & At; -type SegmentValueTransitionOptions = DistributiveOmit & At; -type ObjectTarget = { - [K in keyof O]?: O[K] | UnresolvedValueKeyframe[]; -}; -type SequenceTime = number | "<" | `+${number}` | `-${number}` | `${string}`; -type SequenceLabel = string; -interface SequenceLabelWithTime { - name: SequenceLabel; - at: SequenceTime; -} -interface At { - at?: SequenceTime; -} -type MotionValueSegment = [ - MotionValue, - UnresolvedValueKeyframe | UnresolvedValueKeyframe[] -]; -type MotionValueSegmentWithTransition = [ - MotionValue, - UnresolvedValueKeyframe | UnresolvedValueKeyframe[], - SegmentValueTransitionOptions -]; -type DOMSegment = [ElementOrSelector, DOMKeyframesDefinition]; -type DOMSegmentWithTransition = [ - ElementOrSelector, - DOMKeyframesDefinition, - SegmentTransitionOptions -]; -type ObjectSegment = [O, ObjectTarget]; -type ObjectSegmentWithTransition = [ - O, - ObjectTarget, - SegmentTransitionOptions -]; -type SequenceProgressCallback = (value: any) => void; -type FunctionSegment = [SequenceProgressCallback] | [SequenceProgressCallback, SegmentTransitionOptions] | [ - SequenceProgressCallback, - UnresolvedValueKeyframe | UnresolvedValueKeyframe[], - SegmentTransitionOptions -]; -type Segment = ObjectSegment | ObjectSegmentWithTransition | SequenceLabel | SequenceLabelWithTime | MotionValueSegment | MotionValueSegmentWithTransition | DOMSegment | DOMSegmentWithTransition | FunctionSegment; -type AnimationSequence = Segment[]; -interface SequenceOptions extends AnimationPlaybackOptions { - delay?: number; - duration?: number; - defaultTransition?: Transition; - reduceMotion?: boolean; - skipAnimations?: boolean; - onComplete?: () => void; -} -interface AbsoluteKeyframe { - value: AnyResolvedKeyframe | null; - at: number; - easing?: Easing; -} -type ValueSequence = AbsoluteKeyframe[]; -interface SequenceMap { - [key: string]: ValueSequence; -} -type ResolvedAnimationDefinition = { - keyframes: { - [key: string]: UnresolvedValueKeyframe[]; - }; - transition: { - [key: string]: Transition; - }; -}; -type ResolvedAnimationDefinitions = Map; - -interface ScopedAnimateOptions { - scope?: AnimationScope; - reduceMotion?: boolean; - skipAnimations?: boolean; -} -/** - * Creates an animation function that is optionally scoped - * to a specific element. - */ -declare function createScopedAnimate(options?: ScopedAnimateOptions): { - (sequence: AnimationSequence, options?: SequenceOptions): AnimationPlaybackControlsWithThen; - (value: string | MotionValue, keyframes: string | UnresolvedValueKeyframe[], options?: ValueAnimationTransition): AnimationPlaybackControlsWithThen; - (value: number | MotionValue, keyframes: number | UnresolvedValueKeyframe[], options?: ValueAnimationTransition): AnimationPlaybackControlsWithThen; - (value: V | MotionValue, keyframes: V | UnresolvedValueKeyframe[], options?: ValueAnimationTransition): AnimationPlaybackControlsWithThen; - (element: ElementOrSelector, keyframes: DOMKeyframesDefinition, options?: AnimationOptions): AnimationPlaybackControlsWithThen; - (object: O | O[], keyframes: ObjectTarget, options?: AnimationOptions): AnimationPlaybackControlsWithThen; -}; -declare const animate: { - (sequence: AnimationSequence, options?: SequenceOptions): AnimationPlaybackControlsWithThen; - (value: string | MotionValue, keyframes: string | UnresolvedValueKeyframe[], options?: ValueAnimationTransition): AnimationPlaybackControlsWithThen; - (value: number | MotionValue, keyframes: number | UnresolvedValueKeyframe[], options?: ValueAnimationTransition): AnimationPlaybackControlsWithThen; - (value: V | MotionValue, keyframes: V | UnresolvedValueKeyframe[], options?: ValueAnimationTransition): AnimationPlaybackControlsWithThen; - (element: ElementOrSelector, keyframes: DOMKeyframesDefinition, options?: AnimationOptions): AnimationPlaybackControlsWithThen; - (object: O | O[], keyframes: ObjectTarget, options?: AnimationOptions): AnimationPlaybackControlsWithThen; -}; - -declare const animateMini: (elementOrSelector: ElementOrSelector, keyframes: DOMKeyframesDefinition, options?: AnimationOptions) => AnimationPlaybackControlsWithThen; - -interface ScrollOptions { - source?: HTMLElement; - container?: Element; - target?: Element; - axis?: "x" | "y"; - offset?: ScrollOffset; -} -type OnScrollProgress = (progress: number) => void; -type OnScrollWithInfo = (progress: number, info: ScrollInfo) => void; -type OnScroll = OnScrollProgress | OnScrollWithInfo; -interface AxisScrollInfo { - current: number; - offset: number[]; - progress: number; - scrollLength: number; - velocity: number; - targetOffset: number; - targetLength: number; - containerLength: number; - interpolatorOffsets?: number[]; - interpolate?: EasingFunction; -} -interface ScrollInfo { - time: number; - x: AxisScrollInfo; - y: AxisScrollInfo; -} -type OnScrollInfo = (info: ScrollInfo) => void; -type SupportedEdgeUnit = "px" | "vw" | "vh" | "%"; -type EdgeUnit = `${number}${SupportedEdgeUnit}`; -type NamedEdges = "start" | "end" | "center"; -type EdgeString = NamedEdges | EdgeUnit | `${number}`; -type Edge = EdgeString | number; -type ProgressIntersection = [number, number]; -type Intersection = `${Edge} ${Edge}`; -type ScrollOffset = Array; -interface ScrollInfoOptions { - container?: Element; - target?: Element; - axis?: "x" | "y"; - offset?: ScrollOffset; - /** - * When true, enables per-frame checking of scrollWidth/scrollHeight - * to detect content size changes and recalculate scroll progress. - * - * @default false - */ - trackContentSize?: boolean; -} - -declare function scroll(onScroll: OnScroll | AnimationPlaybackControls, { axis, container, ...options }?: ScrollOptions): VoidFunction; - -declare function scrollInfo(onScroll: OnScrollInfo, { container, trackContentSize, ...options }?: ScrollInfoOptions): VoidFunction; - -type ViewChangeHandler = (entry: IntersectionObserverEntry) => void; -type MarginValue = `${number}${"px" | "%"}`; -type MarginType = MarginValue | `${MarginValue} ${MarginValue}` | `${MarginValue} ${MarginValue} ${MarginValue}` | `${MarginValue} ${MarginValue} ${MarginValue} ${MarginValue}`; -interface InViewOptions { - root?: Element | Document; - margin?: MarginType; - amount?: "some" | "all" | number; -} -declare function inView(elementOrSelector: ElementOrSelector, onStart: (element: Element, entry: IntersectionObserverEntry) => void | ViewChangeHandler, { root, margin: rootMargin, amount }?: InViewOptions): VoidFunction; - -interface HTMLElements { - a: HTMLAnchorElement; - abbr: HTMLElement; - address: HTMLElement; - area: HTMLAreaElement; - article: HTMLElement; - aside: HTMLElement; - audio: HTMLAudioElement; - b: HTMLElement; - base: HTMLBaseElement; - bdi: HTMLElement; - bdo: HTMLElement; - big: HTMLElement; - blockquote: HTMLQuoteElement; - body: HTMLBodyElement; - br: HTMLBRElement; - button: HTMLButtonElement; - canvas: HTMLCanvasElement; - caption: HTMLElement; - center: HTMLElement; - cite: HTMLElement; - code: HTMLElement; - col: HTMLTableColElement; - colgroup: HTMLTableColElement; - data: HTMLDataElement; - datalist: HTMLDataListElement; - dd: HTMLElement; - del: HTMLModElement; - details: HTMLDetailsElement; - dfn: HTMLElement; - dialog: HTMLDialogElement; - div: HTMLDivElement; - dl: HTMLDListElement; - dt: HTMLElement; - em: HTMLElement; - embed: HTMLEmbedElement; - fieldset: HTMLFieldSetElement; - figcaption: HTMLElement; - figure: HTMLElement; - footer: HTMLElement; - form: HTMLFormElement; - h1: HTMLHeadingElement; - h2: HTMLHeadingElement; - h3: HTMLHeadingElement; - h4: HTMLHeadingElement; - h5: HTMLHeadingElement; - h6: HTMLHeadingElement; - head: HTMLHeadElement; - header: HTMLElement; - hgroup: HTMLElement; - hr: HTMLHRElement; - html: HTMLHtmlElement; - i: HTMLElement; - iframe: HTMLIFrameElement; - img: HTMLImageElement; - input: HTMLInputElement; - ins: HTMLModElement; - kbd: HTMLElement; - keygen: HTMLElement; - label: HTMLLabelElement; - legend: HTMLLegendElement; - li: HTMLLIElement; - link: HTMLLinkElement; - main: HTMLElement; - map: HTMLMapElement; - mark: HTMLElement; - menu: HTMLElement; - menuitem: HTMLElement; - meta: HTMLMetaElement; - meter: HTMLMeterElement; - nav: HTMLElement; - noindex: HTMLElement; - noscript: HTMLElement; - object: HTMLObjectElement; - ol: HTMLOListElement; - optgroup: HTMLOptGroupElement; - option: HTMLOptionElement; - output: HTMLOutputElement; - p: HTMLParagraphElement; - param: HTMLParamElement; - picture: HTMLElement; - pre: HTMLPreElement; - progress: HTMLProgressElement; - q: HTMLQuoteElement; - rp: HTMLElement; - rt: HTMLElement; - ruby: HTMLElement; - s: HTMLElement; - samp: HTMLElement; - search: HTMLElement; - slot: HTMLSlotElement; - script: HTMLScriptElement; - section: HTMLElement; - select: HTMLSelectElement; - small: HTMLElement; - source: HTMLSourceElement; - span: HTMLSpanElement; - strong: HTMLElement; - style: HTMLStyleElement; - sub: HTMLElement; - summary: HTMLElement; - sup: HTMLElement; - table: HTMLTableElement; - template: HTMLTemplateElement; - tbody: HTMLTableSectionElement; - td: HTMLTableDataCellElement; - textarea: HTMLTextAreaElement; - tfoot: HTMLTableSectionElement; - th: HTMLTableHeaderCellElement; - thead: HTMLTableSectionElement; - time: HTMLTimeElement; - title: HTMLTitleElement; - tr: HTMLTableRowElement; - track: HTMLTrackElement; - u: HTMLElement; - ul: HTMLUListElement; - var: HTMLElement; - video: HTMLVideoElement; - wbr: HTMLElement; - webview: HTMLWebViewElement; -} - -declare const distance: (a: number, b: number) => number; -declare function distance2D(a: Point, b: Point): number; - -export { type AbsoluteKeyframe, type AnimationSequence, type At, type DOMSegment, type DOMSegmentWithTransition, type FunctionSegment, type HTMLElements, type MotionValueSegment, type MotionValueSegmentWithTransition, type ObjectSegment, type ObjectSegmentWithTransition, type ObjectTarget, type ResolvedAnimationDefinition, type ResolvedAnimationDefinitions, type Segment, type SegmentTransitionOptions, type SegmentValueTransitionOptions, type SequenceLabel, type SequenceLabelWithTime, type SequenceMap, type SequenceOptions, type SequenceProgressCallback, type SequenceTime, type ValueSequence, animate, animateMini, createScopedAnimate, distance, distance2D, inView, scroll, scrollInfo }; diff --git a/node_modules/framer-motion/dist/dom.js b/node_modules/framer-motion/dist/dom.js deleted file mode 100644 index b31abc4..0000000 --- a/node_modules/framer-motion/dist/dom.js +++ /dev/null @@ -1 +0,0 @@ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Motion={})}(this,function(t){"use strict";function e(t,e){-1===t.indexOf(e)&&t.push(e)}function n(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const i=(t,e,n)=>n>e?e:n{},t.invariant=()=>{},"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(t.warning=(t,e,n)=>{t||"undefined"==typeof console||console.warn(s(e,n))},t.invariant=(t,e,n)=>{if(!t)throw new Error(s(e,n))});const o={},r=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),a=t=>"object"==typeof t&&null!==t,l=t=>/^0[^.\s]+$/u.test(t);function c(t){let e;return()=>(void 0===e&&(e=t()),e)}const u=t=>t,h=(...t)=>t.reduce((t,e)=>n=>e(t(n))),d=(t,e,n)=>{const i=e-t;return i?(n-t)/i:1};class p{constructor(){this.subscriptions=[]}add(t){return e(this.subscriptions,t),()=>n(this.subscriptions,t)}notify(t,e,n){const i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](t,e,n);else for(let s=0;s1e3*t,f=t=>t/1e3,y=(t,e)=>e?t*(1e3/e):0,g=new Set;function v(t,e,n){t||g.has(e)||(console.warn(s(e,n)),g.add(e))}const x=(t,e,n)=>{const i=e-t;return((n-t)%i+i)%i+t},w=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function T(t,e,n,i){if(t===e&&n===i)return u;const s=e=>function(t,e,n,i,s){let o,r,a=0;do{r=e+(n-e)/2,o=w(r,i,s)-t,o>0?n=r:e=r}while(Math.abs(o)>1e-7&&++a<12);return r}(e,0,1,t,n);return t=>0===t||1===t?t:w(s(t),e,i)}const b=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,S=t=>e=>1-t(1-e),A=T(.33,1.53,.69,.99),V=S(A),P=b(V),M=t=>t>=1?1:(t*=2)<1?.5*V(t):.5*(2-Math.pow(2,-10*(t-1))),E=t=>1-Math.sin(Math.acos(t)),k=S(E),D=b(E),C=T(.42,0,1,1),B=T(0,0,.58,1),R=T(.42,0,.58,1);const L=t=>Array.isArray(t)&&"number"!=typeof t[0];function j(t,e){return L(t)?t[x(0,t.length,e)]:t}const O=t=>Array.isArray(t)&&"number"==typeof t[0],F={linear:u,easeIn:C,easeInOut:R,easeOut:B,circIn:E,circInOut:D,circOut:k,backIn:V,backInOut:P,backOut:A,anticipate:M},I=e=>{if(O(e)){t.invariant(4===e.length,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[n,i,s,o]=e;return T(n,i,s,o)}return"string"==typeof e?(t.invariant(void 0!==F[e],`Invalid easing type '${e}'`,"invalid-easing-type"),F[e]):e},$=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function N(t,e){let n=!1,i=!0;const s={delta:0,timestamp:0,isProcessing:!1},r=()=>n=!0,a=$.reduce((t,e)=>(t[e]=function(t){let e=new Set,n=new Set,i=!1,s=!1;const o=new WeakSet;let r={delta:0,timestamp:0,isProcessing:!1};function a(e){o.has(e)&&(l.schedule(e),t()),e(r)}const l={schedule:(t,s=!1,r=!1)=>{const a=r&&i?e:n;return s&&o.add(t),a.add(t),t},cancel:t=>{n.delete(t),o.delete(t)},process:t=>{if(r=t,i)return void(s=!0);i=!0;const o=e;e=n,n=o,e.forEach(a),e.clear(),i=!1,s&&(s=!1,l.process(t))}};return l}(r),t),{}),{setup:l,read:c,resolveKeyframes:u,preUpdate:h,update:d,preRender:p,render:m,postRender:f}=a,y=()=>{const r=o.useManualTiming,a=r?s.timestamp:performance.now();n=!1,r||(s.delta=i?1e3/60:Math.max(Math.min(a-s.timestamp,40),1)),s.timestamp=a,s.isProcessing=!0,l.process(s),c.process(s),u.process(s),h.process(s),d.process(s),p.process(s),m.process(s),f.process(s),s.isProcessing=!1,n&&e&&(i=!1,t(y))};return{schedule:$.reduce((e,o)=>{const r=a[o];return e[o]=(e,o=!1,a=!1)=>(n||(n=!0,i=!0,s.isProcessing||t(y)),r.schedule(e,o,a)),e},{}),cancel:t=>{for(let e=0;e<$.length;e++)a[$[e]].cancel(t)},state:s,steps:a}}const{schedule:W,cancel:U,state:z,steps:K}=N("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:u,!0);let Y;function X(){Y=void 0}const G={now:()=>(void 0===Y&&G.set(z.isProcessing||o.useManualTiming?z.timestamp:performance.now()),Y),set:t=>{Y=t,queueMicrotask(X)}},H=t=>e=>"string"==typeof e&&e.startsWith(t),q=H("--"),Z=H("var(--"),_=t=>!!Z(t)&&J.test(t.split("/*")[0].trim()),J=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Q(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const tt={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},et={...tt,transform:t=>i(0,1,t)},nt={...tt,default:1},it=t=>Math.round(1e5*t)/1e5,st=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const ot=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,rt=(t,e)=>n=>Boolean("string"==typeof n&&ot.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),at=(t,e,n)=>i=>{if("string"!=typeof i)return i;const[s,o,r,a]=i.match(st);return{[t]:parseFloat(s),[e]:parseFloat(o),[n]:parseFloat(r),alpha:void 0!==a?parseFloat(a):1}},lt={...tt,transform:t=>Math.round((t=>i(0,255,t))(t))},ct={test:rt("rgb","red"),parse:at("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+lt.transform(t)+", "+lt.transform(e)+", "+lt.transform(n)+", "+it(et.transform(i))+")"};const ut={test:rt("#"),parse:function(t){let e="",n="",i="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),i=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),i=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,i+=i,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:s?parseInt(s,16)/255:1}},transform:ct.transform},ht=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),dt=ht("deg"),pt=ht("%"),mt=ht("px"),ft=ht("vh"),yt=ht("vw"),gt=(()=>({...pt,parse:t=>pt.parse(t)/100,transform:t=>pt.transform(100*t)}))(),vt={test:rt("hsl","hue"),parse:at("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+pt.transform(it(e))+", "+pt.transform(it(n))+", "+it(et.transform(i))+")"},xt={test:t=>ct.test(t)||ut.test(t)||vt.test(t),parse:t=>ct.test(t)?ct.parse(t):vt.test(t)?vt.parse(t):ut.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?ct.transform(t):vt.transform(t),getAnimatableNone:t=>{const e=xt.parse(t);return e.alpha=0,xt.transform(e)}},wt=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const Tt="number",bt="color",St=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function At(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},s=[];let o=0;const r=e.replace(St,t=>(xt.test(t)?(i.color.push(o),s.push(bt),n.push(xt.parse(t))):t.startsWith("var(")?(i.var.push(o),s.push("var"),n.push(t)):(i.number.push(o),s.push(Tt),n.push(parseFloat(t))),++o,"${}")).split("${}");return{values:n,split:r,indexes:i,types:s}}function Vt({split:t,types:e}){const n=t.length;return i=>{let s="";for(let o=0;o{return"number"==typeof t?e?.trim().endsWith("/")?t:0:"number"==typeof(n=t)?0:xt.test(n)?xt.getAnimatableNone(n):n;var n};const Mt={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(st)?.length||0)+(t.match(wt)?.length||0)>0},parse:function(t){return At(t).values},createTransformer:function(t){return Vt(At(t))},getAnimatableNone:function(t){const e=At(t);return Vt(e)(e.values.map((t,n)=>Pt(t,e.split[n])))}};function Et(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function kt({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let s=0,o=0,r=0;if(e/=100){const i=n<.5?n*(1+e):n+e-n*e,a=2*n-i;s=Et(a,i,t+1/3),o=Et(a,i,t),r=Et(a,i,t-1/3)}else s=o=r=n;return{red:Math.round(255*s),green:Math.round(255*o),blue:Math.round(255*r),alpha:i}}function Dt(t,e){return n=>n>0?e:t}const Ct=(t,e,n)=>t+(e-t)*n,Bt=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},Rt=[ut,ct,vt];function Lt(e){const n=(i=e,Rt.find(t=>t.test(i)));var i;if(t.warning(Boolean(n),`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!Boolean(n))return!1;let s=n.parse(e);return n===vt&&(s=kt(s)),s}const jt=(t,e)=>{const n=Lt(t),i=Lt(e);if(!n||!i)return Dt(t,e);const s={...n};return t=>(s.red=Bt(n.red,i.red,t),s.green=Bt(n.green,i.green,t),s.blue=Bt(n.blue,i.blue,t),s.alpha=Ct(n.alpha,i.alpha,t),ct.transform(s))},Ot=new Set(["none","hidden"]);function Ft(t,e){return Ot.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function It(t,e){return n=>Ct(t,e,n)}function $t(t){return"number"==typeof t?It:"string"==typeof t?_(t)?Dt:xt.test(t)?jt:Ut:Array.isArray(t)?Nt:"object"==typeof t?xt.test(t)?jt:Wt:Dt}function Nt(t,e){const n=[...t],i=n.length,s=t.map((t,n)=>$t(t)(t,e[n]));return t=>{for(let e=0;e{for(const e in i)n[e]=i[e](t);return n}}const Ut=(e,n)=>{const i=Mt.createTransformer(n),s=At(e),o=At(n);return s.indexes.var.length===o.indexes.var.length&&s.indexes.color.length===o.indexes.color.length&&s.indexes.number.length>=o.indexes.number.length?Ot.has(e)&&!o.values.length||Ot.has(n)&&!s.values.length?Ft(e,n):h(Nt(function(t,e){const n=[],i={color:0,var:0,number:0};for(let s=0;s{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>W.update(e,t),stop:()=>U(e),now:()=>z.isProcessing?z.timestamp:G.now()}},Yt=(t,e,n=10)=>{let i="";const s=Math.max(Math.round(e/n),2);for(let e=0;e=Xt?1/0:e}function Ht(t,e=100,n){const i=n({...t,keyframes:[0,e]}),s=Math.min(Gt(i),Xt);return{type:"keyframes",ease:t=>i.next(s*t).value/e,duration:f(s)}}const qt=100,Zt=10,_t=1,Jt=0,Qt=800,te=.3,ee=.3,ne={granular:.01,default:2},ie={granular:.005,default:.5},se=.01,oe=10,re=.05,ae=1;function le(t,e){return t*Math.sqrt(1-e*e)}const ce=.001;const ue=["duration","bounce"],he=["stiffness","damping","mass"];function de(t,e){return e.some(e=>void 0!==t[e])}function pe(e){let n={velocity:Jt,stiffness:qt,damping:Zt,mass:_t,isResolvedFromDuration:!1,...e};if(!de(e,he)&&de(e,ue))if(n.velocity=0,e.visualDuration){const t=e.visualDuration,s=2*Math.PI/(1.2*t),o=s*s,r=2*i(.05,1,1-(e.bounce||0))*Math.sqrt(o);n={...n,mass:_t,stiffness:o,damping:r}}else{const s=function({duration:e=Qt,bounce:n=te,velocity:s=Jt,mass:o=_t}){let r,a;t.warning(e<=m(oe),"Spring duration must be 10 seconds or less","spring-duration-limit");let l=1-n;l=i(re,ae,l),e=i(se,oe,f(e)),l<1?(r=t=>{const n=t*l,i=n*e,o=n-s,r=le(t,l),a=Math.exp(-i);return ce-o/r*a},a=t=>{const n=t*l*e,i=n*s+s,o=Math.pow(l,2)*Math.pow(t,2)*e,a=Math.exp(-n),c=le(Math.pow(t,2),l);return(-r(t)+ce>0?-1:1)*((i-o)*a)/c}):(r=t=>Math.exp(-t*e)*((t-s)*e+1)-.001,a=t=>Math.exp(-t*e)*(e*e*(s-t)));const c=function(t,e,n){let i=n;for(let n=1;n<12;n++)i-=t(i)/e(i);return i}(r,a,5/e);if(e=m(e),isNaN(c))return{stiffness:qt,damping:Zt,duration:e};{const t=Math.pow(c,2)*o;return{stiffness:t,damping:2*l*Math.sqrt(o*t),duration:e}}}({...e,velocity:0});n={...n,...s,mass:_t},n.isResolvedFromDuration=!0}return n}function me(t=ee,e=te){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:i,restDelta:s}=n;const o=n.keyframes[0],r=n.keyframes[n.keyframes.length-1],a={done:!1,value:o},{stiffness:l,damping:c,mass:u,duration:h,velocity:d,isResolvedFromDuration:p}=pe({...n,velocity:-f(n.velocity||0)}),y=d||0,g=c/(2*Math.sqrt(l*u)),v=r-o,x=f(Math.sqrt(l/u)),w=Math.abs(v)<5;let T,b,S,A,V,P;if(i||(i=w?ne.granular:ne.default),s||(s=w?ie.granular:ie.default),g<1)S=le(x,g),A=(y+g*x*v)/S,T=t=>{const e=Math.exp(-g*x*t);return r-e*(A*Math.sin(S*t)+v*Math.cos(S*t))},V=g*x*A+v*S,P=g*x*v-A*S,b=t=>Math.exp(-g*x*t)*(V*Math.sin(S*t)+P*Math.cos(S*t));else if(1===g){T=t=>r-Math.exp(-x*t)*(v+(y+x*v)*t);const t=y+x*v;b=e=>Math.exp(-x*e)*(x*t*e-y)}else{const t=x*Math.sqrt(g*g-1);T=e=>{const n=Math.exp(-g*x*e),i=Math.min(t*e,300);return r-n*((y+g*x*v)*Math.sinh(i)+t*v*Math.cosh(i))/t};const e=(y+g*x*v)/t,n=g*x*e-v*t,i=g*x*v-e*t;b=e=>{const s=Math.exp(-g*x*e),o=Math.min(t*e,300);return s*(n*Math.sinh(o)+i*Math.cosh(o))}}const M={calculatedDuration:p&&h||null,velocity:t=>m(b(t)),next:t=>{if(!p&&g<1){const e=Math.exp(-g*x*t),n=Math.sin(S*t),o=Math.cos(S*t),l=r-e*(A*n+v*o),c=m(e*(V*n+P*o));return a.done=Math.abs(c)<=i&&Math.abs(r-l)<=s,a.value=a.done?r:l,a}const e=T(t);if(p)a.done=t>=h;else{const n=m(b(t));a.done=Math.abs(n)<=i&&Math.abs(r-e)<=s}return a.value=a.done?r:e,a},toString:()=>{const t=Math.min(Gt(M),Xt),e=Yt(e=>M.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return M}me.applyToOptions=t=>{const e=Ht(t,100,me);return t.ease=e.ease,t.duration=m(e.duration),t.type="keyframes",t};function fe(t,e,n){const i=Math.max(e-5,0);return y(n-t(i),e-i)}function ye({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:l,restDelta:c=.5,restSpeed:u}){const h=t[0],d={done:!1,value:h},p=t=>void 0===a?l:void 0===l||Math.abs(a-t)-m*Math.exp(-t/i),v=t=>y+g(t),x=t=>{const e=g(t),n=v(t);d.done=Math.abs(e)<=c,d.value=d.done?y:n};let w,T;const b=t=>{var e;(e=d.value,void 0!==a&&el)&&(w=t,T=me({keyframes:[d.value,p(d.value)],velocity:fe(v,t,d.value),damping:s,stiffness:o,restDelta:c,restSpeed:u}))};return b(0),{calculatedDuration:null,next:t=>{let e=!1;return T||void 0!==w||(e=!0,x(t),b(t)),void 0!==w&&t>=w?T.next(t-w):(!e&&x(t),d)}}}function ge(e,n,{clamp:s=!0,ease:r,mixer:a}={}){const l=e.length;if(t.invariant(l===n.length,"Both input and output ranges must be the same length","range-length"),1===l)return()=>n[0];if(2===l&&n[0]===n[1])return()=>n[1];const c=e[0]===e[1];e[0]>e[l-1]&&(e=[...e].reverse(),n=[...n].reverse());const p=function(t,e,n){const i=[],s=n||o.mix||zt,r=t.length-1;for(let n=0;n{if(c&&t1)for(;if(i(e[0],e[l-1],t)):f}function ve(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const s=d(0,e,i);t.push(Ct(n,1,s))}}function xe(t){const e=[0];return ve(e,t.length-1),e}function we(t,e){return t.map(t=>t*e)}function Te(t,e){return t.map(()=>e||R).splice(0,t.length-1)}function be({duration:t=300,keyframes:e,times:n,ease:i="easeInOut"}){const s=L(i)?i.map(I):I(i),o={done:!1,value:e[0]},r=ge(we(n&&n.length===e.length?n:xe(e),t),e,{ease:Array.isArray(s)?s:Te(e,s)});return{calculatedDuration:t,next:e=>(o.value=r(e),o.done=e>=t,o)}}const Se=t=>null!==t;function Ae(t,{repeat:e,repeatType:n="loop"},i,s=1){const o=t.filter(Se),r=s<0||e&&"loop"!==n&&e%2==1?0:o.length-1;return r&&void 0!==i?i:o[r]}const Ve={decay:ye,inertia:ye,tween:be,keyframes:be,spring:me};function Pe(t){"string"==typeof t.type&&(t.type=Ve[t.type])}class Me{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const Ee=t=>t/100;class ke extends Me{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:t}=this.options;t&&t.updatedAt!==G.now()&&this.tick(G.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;Pe(t);const{type:e=be,repeat:n=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=t;let{keyframes:r}=t;const a=e||be;a!==be&&"number"!=typeof r[0]&&(this.mixKeyframes=h(Ee,zt(r[0],r[1])),r=[0,100]);const l=a({...t,keyframes:r});"mirror"===s&&(this.mirroredGenerator=a({...t,keyframes:[...r].reverse(),velocity:-o})),null===l.calculatedDuration&&(l.calculatedDuration=Gt(l));const{calculatedDuration:c}=l;this.calculatedDuration=c,this.resolvedDuration=c+i,this.totalDuration=this.resolvedDuration*(n+1)-i,this.generator=l}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,e=!1){const{generator:n,totalDuration:s,mixKeyframes:o,mirroredGenerator:r,resolvedDuration:a,calculatedDuration:l}=this;if(null===this.startTime)return n.next(0);const{delay:c=0,keyframes:u,repeat:h,repeatType:d,repeatDelay:p,type:m,onUpdate:f,finalKeyframe:y}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?g<0:g>s;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=s);let x,w=this.currentTime,T=n;if(h){const t=Math.min(this.currentTime,s)/a;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,h+1);Boolean(e%2)&&("reverse"===d?(n=1-n,p&&(n-=p/a)):"mirror"===d&&(T=r)),w=i(0,1,n)*a}v?(this.delayState.value=u[0],x=this.delayState):x=T.next(w),o&&!v&&(x.value=o(x.value));let{done:b}=x;v||null===l||(b=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const S=null===this.holdTime&&("finished"===this.state||"running"===this.state&&b);return S&&m!==ye&&(x.value=Ae(u,this.options,y,this.speed)),f&&f(x.value),S&&this.finish(),x}then(t,e){return this.finished.then(t,e)}get duration(){return f(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+f(t)}get time(){return f(this.currentTime)}set time(t){t=m(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);return fe(t=>this.generator.next(t).value,t,this.generator.next(t).value)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;e&&this.driver&&this.updateTime(G.now()),this.playbackSpeed=t,e&&this.driver&&(this.time=f(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=Kt,startTime:e}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),this.options.onPlay?.();const n=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=n):null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime||(this.startTime=e??n),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(G.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function De(t){for(let e=1;e180*t/Math.PI,Be=t=>{const e=Ce(Math.atan2(t[1],t[0]));return Le(e)},Re={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Be,rotateZ:Be,skewX:t=>Ce(Math.atan(t[1])),skewY:t=>Ce(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Le=t=>((t%=360)<0&&(t+=360),t),je=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Oe=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Fe={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:je,scaleY:Oe,scale:t=>(je(t)+Oe(t))/2,rotateX:t=>Le(Ce(Math.atan2(t[6],t[5]))),rotateY:t=>Le(Ce(Math.atan2(-t[2],t[0]))),rotateZ:Be,rotate:Be,skewX:t=>Ce(Math.atan(t[4])),skewY:t=>Ce(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Ie(t){return t.includes("scale")?1:0}function $e(t,e){if(!t||"none"===t)return Ie(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,s;if(n)i=Fe,s=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=Re,s=e}if(!s)return Ie(e);const o=i[e],r=s[1].split(",").map(We);return"function"==typeof o?o(r):r[o]}const Ne=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return $e(n,e)};function We(t){return parseFloat(t.trim())}const Ue=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ze=(()=>new Set([...Ue,"pathRotation"]))(),Ke=t=>t===tt||t===mt,Ye=new Set(["x","y","z"]),Xe=Ue.filter(t=>!Ye.has(t));const Ge={width:({x:t},{paddingLeft:e="0",paddingRight:n="0",boxSizing:i})=>{const s=t.max-t.min;return"border-box"===i?s:s-parseFloat(e)-parseFloat(n)},height:({y:t},{paddingTop:e="0",paddingBottom:n="0",boxSizing:i})=>{const s=t.max-t.min;return"border-box"===i?s:s-parseFloat(e)-parseFloat(n)},top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>$e(e,"x"),y:(t,{transform:e})=>$e(e,"y")};Ge.translateX=Ge.x,Ge.translateY=Ge.y;const He=new Set;let qe=!1,Ze=!1,_e=!1;function Je(){if(Ze){const t=Array.from(He).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),n=new Map;e.forEach(t=>{const e=function(t){const e=[];return Xe.forEach(n=>{const i=t.getValue(n);void 0!==i&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),e}(t);e.length&&(n.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=n.get(t);e&&e.forEach(([e,n])=>{t.getValue(e)?.set(n)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}Ze=!1,qe=!1,He.forEach(t=>t.complete(_e)),He.clear()}function Qe(){He.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Ze=!0)})}function tn(){_e=!0,Qe(),Je(),_e=!1}class en{constructor(t,e,n,i,s,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(He.add(this),qe||(qe=!0,W.read(Qe),W.resolveKeyframes(Je))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:i}=this;if(null===t[0]){const s=i?.get(),o=t[t.length-1];if(void 0!==s)t[0]=s;else if(n&&e){const i=n.readValue(e,o);null!=i&&(t[0]=i)}void 0===t[0]&&(t[0]=o),i&&void 0===s&&i.set(t[0])}De(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),He.delete(this)}cancel(){"scheduled"===this.state&&(He.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}const nn=t=>t.startsWith("--");function sn(t,e,n){nn(e)?t.style.setProperty(e,n):t.style[e]=n}const on={};function rn(t,e){const n=c(t);return()=>on[e]??n()}const an=rn(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),ln=rn(()=>void 0!==window.ViewTimeline,"viewTimeline"),cn=rn(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),un=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,hn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:un([0,.65,.55,1]),circOut:un([.55,0,1,.45]),backIn:un([.31,.01,.66,-.59]),backOut:un([.33,1.53,.69,.99])};function dn(t,e){return t?"function"==typeof t?cn()?Yt(t,e):"ease-out":O(t)?un(t):Array.isArray(t)?t.map(t=>dn(t,e)||hn.easeOut):hn[t]:void 0}function pn(t,e,n,{delay:i=0,duration:s=300,repeat:o=0,repeatType:r="loop",ease:a="easeOut",times:l}={},c=void 0){const u={[e]:n};l&&(u.offset=l);const h=dn(a,s);Array.isArray(h)&&(u.easing=h);const d={delay:i,duration:s,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:o+1,direction:"reverse"===r?"alternate":"normal"};return c&&(d.pseudoElement=c),t.animate(u,d)}function mn(t){return"function"==typeof t&&"applyToOptions"in t}function fn({type:t,...e}){return mn(t)&&cn()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class yn extends Me{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:i,keyframes:s,pseudoElement:o,allowFlatten:r=!1,finalKeyframe:a,onComplete:l}=e;this.isPseudoElement=Boolean(o),this.allowFlatten=r,this.options=e,t.invariant("string"!=typeof e.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const c=fn(e);this.animation=pn(n,i,s,c,o),!1===c.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const t=Ae(s,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(t),sn(n,i,t),this.animation.cancel()}l?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return f(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+f(t)}get time(){return f(Number(this.animation.currentTime)||0)}set time(t){const e=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=m(t),e&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:e,rangeEnd:n,observe:i}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&an()?(this.animation.timeline=t,e&&(this.animation.rangeStart=e),n&&(this.animation.rangeEnd=n),u):i(this)}}const gn={anticipate:M,backInOut:P,circInOut:D};function vn(t){"string"==typeof t.ease&&t.ease in gn&&(t.ease=gn[t.ease])}class xn extends yn{constructor(t){vn(t),Pe(t),super(t),void 0!==t.startTime&&!1!==t.autoplay&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:e,onUpdate:n,onComplete:s,element:o,...r}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);const a=new ke({...r,autoplay:!1}),l=Math.max(10,G.now()-this.startTime),c=i(0,10,l-10),u=a.sample(l).value,{name:h}=this.options;o&&h&&sn(o,h,u),e.setWithVelocity(a.sample(Math.max(0,l-c)).value,u,c),a.stop()}}const wn=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Mt.test(t)&&"0"!==t||t.startsWith("url(")));function Tn(t){t.duration=0,t.type="keyframes"}const bn=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),Sn=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;const An=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),Vn=c(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Pn(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:s,damping:o,type:r,keyframes:a}=t,l=e?.owner?.current;if(!(l instanceof HTMLElement||l instanceof SVGElement))return!1;const{onUpdate:c,transformTemplate:u}=e.owner.getProps();return Vn()&&n&&(bn.has(n)||An.has(n)&&function(t){for(let e=0;e{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=G.now();const h={autoplay:t,delay:e,type:n,repeat:i,repeatDelay:s,repeatType:o,name:a,motionValue:l,element:c,...u},d=c?.KeyframeResolver||en;this.keyframeResolver=new d(r,(t,e,n)=>this.onKeyframesResolved(t,e,h,!n),a,l,c),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,n,i,s){this.keyframeResolver=void 0;const{name:r,type:a,velocity:l,delay:c,isHandoff:h,onUpdate:d}=i;this.resolvedAt=G.now();let p=!0;(function(e,n,i,s){const o=e[0];if(null===o)return!1;if("display"===n||"visibility"===n)return!0;const r=e[e.length-1],a=wn(o,n),l=wn(r,n);return t.warning(a===l,`You are trying to animate ${n} from "${o}" to "${r}". "${a?r:o}" is not an animatable value.`,"value-not-animatable"),!(!a||!l)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:n,...i,keyframes:e},f=p&&!h&&Pn(m),y=m.motionValue?.owner?.current;let g;if(f)try{g=new xn({...m,element:y})}catch{g=new ke(m)}else g=new ke(m);g.finished.then(()=>{this.notifyFinished()}).catch(u),this.pendingTimeline&&(this.stopTimeline=g.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=g}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),tn()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}class En{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;ne.attachTimeline(t));return()=>{e.forEach((t,e)=>{t&&t(),this.animations[e].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return kn(this.animations,"duration")}get iterationDuration(){return kn(this.animations,"iterationDuration")}runAll(t){this.animations.forEach(e=>e[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function kn(t,e){let n=0;for(let i=0;in&&(n=s)}return n}class Dn extends En{then(t,e){return this.finished.finally(t).then(()=>{})}}class Cn extends yn{constructor(t){super(),this.animation=t,t.onfinish=()=>{this.finishedTime=this.time,this.notifyFinished()}}}const Bn=new WeakMap,Rn=(t,e="")=>`${t}:${e}`;function Ln(t){let e=Bn.get(t);return e||(e=new Map,Bn.set(t,e)),e}function jn(t,e,n,i=0,s=1){const o=Array.from(t).sort((t,e)=>t.sortNodePosition(e)).indexOf(e),r=t.size,a=(r-1)*i;return"function"==typeof n?n(o,r):1===s?o*i:a-o*i}const On={current:void 0};class Fn{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=G.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=G.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new p);const n=this.events[t].add(e);return"change"===t?()=>{n(),W.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return On.current&&On.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=G.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return y(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function In(t,e){return new Fn(t,e)}function $n(t,e){if(t?.inherit&&e){const{inherit:n,...i}=t;return{...e,...i}}return t}function Nn(t,e){const n=t?.[e]??t?.default??t;return n!==t?$n(n,t):n}const Wn={type:"spring",stiffness:500,damping:25,restSpeed:10},Un={type:"keyframes",duration:.8},zn={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Kn=(t,{keyframes:e})=>e.length>2?Un:ze.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:Wn:zn,Yn=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function Xn(t){for(const e in t)if(!Yn.has(e))return!0;return!1}const Gn=(t,e,n,i={},s,r)=>a=>{const l=Nn(i,t)||{},c=l.delay||i.delay||0;let{elapsed:u=0}=i;u-=m(c);const h={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...l,delay:-u,onUpdate:t=>{e.set(t),l.onUpdate&&l.onUpdate(t)},onComplete:()=>{a(),l.onComplete&&l.onComplete()},name:t,motionValue:e,element:r?void 0:s};Xn(l)||Object.assign(h,Kn(t,h)),h.duration&&(h.duration=m(h.duration)),h.repeatDelay&&(h.repeatDelay=m(h.repeatDelay)),void 0!==h.from&&(h.keyframes[0]=h.from);let d=!1;if((!1===h.type||0===h.duration&&!h.repeatDelay)&&(Tn(h),0===h.delay&&(d=!0)),(o.instantAnimations||o.skipAnimations||s?.shouldSkipAnimations||l.skipAnimations)&&(d=!0,Tn(h),h.delay=0),h.allowFlatten=!l.type&&!l.ease,d&&!r&&void 0!==e.get()){const t=Ae(h.keyframes,l);if(void 0!==t)return void W.update(()=>{h.onUpdate(t),h.onComplete()})}return l.isSync?new ke(h):new Mn(h)};function Hn(t,e,n,i){const s=1-t;return s*s*e+2*s*t*n+t*t*i}function qn(t,e,n,i,s,o,r){const a=2*(1-t)*(n-e)+2*t*(i-n),l=2*(1-t)*(o-s)+2*t*(r-o);return Math.atan2(l,a)*(180/Math.PI)}function Zn(t,e,n,i,s,o){const r=n-t,a=i-e,l=Math.sqrt(r*r+a*a);if(l>0){const n=s*l;return{x:t+r*o+-a/l*n,y:e+a*o+r/l*n}}return{x:t,y:e}}const _n=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Jn(t){const e=_n.exec(t);if(!e)return[,];const[,n,i,s]=e;return[`--${n??i}`,s]}function Qn(e,n,i=1){t.invariant(i<=4,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[s,o]=Jn(e);if(!s)return;const a=window.getComputedStyle(n).getPropertyValue(s);if(a){const t=a.trim();return r(t)?parseFloat(t):t}return _(o)?Qn(o,n,i+1):o}function ti(t){const e=[{},{}];return t?.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}function ei(t,e,n,i){if("function"==typeof e){const[s,o]=ti(i);e=e(void 0!==n?n:t.custom,s,o)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[s,o]=ti(i);e=e(void 0!==n?n:t.custom,s,o)}return e}function ni(t,e,n){const i=t.getProps();return ei(i,e,void 0!==n?n:i.custom,t)}const ii=new Set(["width","height","top","left","right","bottom",...Ue]),si=t=>Array.isArray(t);function oi(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,In(n))}function ri(t){return si(t)?t[t.length-1]||0:t}function ai(t,e){const n=ni(t,e);let{transitionEnd:i={},transition:s={},...o}=n||{};o={...o,...i};for(const e in o){oi(t,e,ri(o[e]))}}const li=t=>Boolean(t&&t.getVelocity);function ci(t){return Boolean(li(t)&&t.add)}function ui(t,e){const n=t.getValue("willChange");if(ci(n))return n.add(e);if(!n&&o.WillChange){const n=new o.WillChange("auto");t.addValue("willChange",n),n.add(e)}}function hi(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const di="framerAppearId",pi="data-"+hi(di);function mi(t){return t.props[pi]}function fi({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}function yi(t,e,{delay:n=0,transitionOverride:i,type:s}={}){let{transition:o,transitionEnd:r,...a}=e;const l=t.getDefaultTransition();o=o?$n(o,l):l;const c=o?.reduceMotion,u=o?.skipAnimations;i&&(o=i);const h=[],d=s&&t.animationState&&t.animationState.getState()[s],p=o?.path;p&&p.animateVisualElement(t,a,o,n,h);for(const e in a){const i=t.getValue(e,t.latestValues[e]??null),s=a[e];if(void 0===s||d&&fi(d,e))continue;const r={delay:n,...Nn(o||{},e)};u&&(r.skipAnimations=!0);const l=i.get();if(void 0!==l&&!i.isAnimating()&&!Array.isArray(s)&&s===l&&!r.velocity){W.update(()=>i.set(s));continue}let p=!1;if(window.MotionHandoffAnimation){const n=mi(t);if(n){const t=window.MotionHandoffAnimation(n,e,W);null!==t&&(r.startTime=t,p=!0)}}ui(t,e);const m=c??t.shouldReduceMotion;i.start(Gn(e,i,s,m&&ii.has(e)?{type:!1}:r,t,p));const f=i.animation;f&&h.push(f)}if(r){const e=()=>W.update(()=>{r&&ai(t,r)});h.length?Promise.all(h).then(e):e()}return h}function gi(t,e,n={}){const i=ni(t,e,"exit"===n.type?t.presenceContext?.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const o=i?()=>Promise.all(yi(t,i,n)):()=>Promise.resolve(),r=t.variantChildren&&t.variantChildren.size?(i=0)=>{const{delayChildren:o=0,staggerChildren:r,staggerDirection:a}=s;return function(t,e,n=0,i=0,s=0,o=1,r){const a=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),a.push(gi(l,e,{...r,delay:n+("function"==typeof i?0:i)+jn(t.variantChildren,l,i,s,o)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(a)}(t,e,i,o,r,a,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[t,e]="beforeChildren"===a?[o,r]:[r,o];return t().then(()=>e())}return Promise.all([o(),r(n.delay)])}function vi(t,e,n={}){let i;if(t.notify("AnimationStart",e),Array.isArray(e)){const s=e.map(e=>gi(t,e,n));i=Promise.all(s)}else if("string"==typeof e)i=gi(t,e,n);else{const s="function"==typeof e?ni(t,e,n.custom):e;i=Promise.all(yi(t,s,n))}return i.then(()=>{t.notify("AnimationComplete",e)})}const xi=t=>e=>e.test(t),wi=[tt,mt,pt,dt,yt,ft,{test:t=>"auto"===t,parse:t=>t}],Ti=t=>wi.find(xi(t));function bi(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||l(t))}const Si=new Set(["brightness","contrast","saturate","opacity"]);function Ai(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(st)||[];if(!i)return t;const s=n.replace(i,"");let o=Si.has(e)?1:0;return i!==n&&(o*=100),e+"("+o+s+")"}const Vi=/\b([a-z-]*)\(.*?\)/gu,Pi={...Mt,getAnimatableNone:t=>{const e=t.match(Vi);return e?e.map(Ai).join(" "):t}},Mi={...Mt,getAnimatableNone:t=>{const e=Mt.parse(t);return Mt.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},Ei={...tt,transform:Math.round},ki={rotate:dt,pathRotation:dt,rotateX:dt,rotateY:dt,rotateZ:dt,scale:nt,scaleX:nt,scaleY:nt,scaleZ:nt,skew:dt,skewX:dt,skewY:dt,distance:mt,translateX:mt,translateY:mt,translateZ:mt,x:mt,y:mt,z:mt,perspective:mt,transformPerspective:mt,opacity:et,originX:gt,originY:gt,originZ:mt},Di={borderWidth:mt,borderTopWidth:mt,borderRightWidth:mt,borderBottomWidth:mt,borderLeftWidth:mt,borderRadius:mt,borderTopLeftRadius:mt,borderTopRightRadius:mt,borderBottomRightRadius:mt,borderBottomLeftRadius:mt,width:mt,maxWidth:mt,height:mt,maxHeight:mt,top:mt,right:mt,bottom:mt,left:mt,inset:mt,insetBlock:mt,insetBlockStart:mt,insetBlockEnd:mt,insetInline:mt,insetInlineStart:mt,insetInlineEnd:mt,padding:mt,paddingTop:mt,paddingRight:mt,paddingBottom:mt,paddingLeft:mt,paddingBlock:mt,paddingBlockStart:mt,paddingBlockEnd:mt,paddingInline:mt,paddingInlineStart:mt,paddingInlineEnd:mt,margin:mt,marginTop:mt,marginRight:mt,marginBottom:mt,marginLeft:mt,marginBlock:mt,marginBlockStart:mt,marginBlockEnd:mt,marginInline:mt,marginInlineStart:mt,marginInlineEnd:mt,fontSize:mt,backgroundPositionX:mt,backgroundPositionY:mt,...ki,zIndex:Ei,fillOpacity:et,strokeOpacity:et,numOctaves:Ei},Ci={...Di,color:xt,backgroundColor:xt,outlineColor:xt,fill:xt,stroke:xt,borderColor:xt,borderTopColor:xt,borderRightColor:xt,borderBottomColor:xt,borderLeftColor:xt,filter:Pi,WebkitFilter:Pi,mask:Mi,WebkitMask:Mi},Bi=t=>Ci[t],Ri=new Set([Pi,Mi]);function Li(t,e){let n=Bi(t);return Ri.has(n)||(n=Mt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const ji=new Set(["auto","none","0"]);class Oi extends en{constructor(t,e,n,i,s){super(t,e,n,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n{t.getValue(e).set(n)}),this.resolveNoneKeyframes()}}const Fi=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"],Ii=new Set(["borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius",...Fi,"width","maxWidth","height","maxHeight","top","right","bottom","left","inset","insetBlock","insetBlockStart","insetBlockEnd","insetInline","insetInlineStart","insetInlineEnd","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingBlock","paddingBlockStart","paddingBlockEnd","paddingInline","paddingInlineStart","paddingInlineEnd","margin","marginTop","marginRight","marginBottom","marginLeft","marginBlock","marginBlockStart","marginBlockEnd","marginInline","marginInlineStart","marginInlineEnd","fontSize","backgroundPositionX","backgroundPositionY"]);function $i(t,e){for(let n=0;n{try{document.createElement("div").animate({opacity:[1]})}catch(t){return!1}return!0});function Wi(t,e,n){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){let i=document;e&&(i=e.current);const s=n?.[t]??i.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t).filter(t=>null!=t)}function Ui(t){return(e,n)=>{const i=Wi(e),s=[];for(const e of i){const i=t(e,n);s.push(i)}return()=>{for(const t of s)t()}}}const zi=(t,e)=>e&&"number"==typeof t?e.transform(t):t;class Ki{constructor(){this.latest={},this.values=new Map}set(t,e,n,i,s=!0){const o=this.values.get(t);o&&o.onRemove();const r=()=>{const i=e.get();this.latest[t]=s?zi(i,Di[t]):i,n&&W.render(n)};r();const a=e.on("change",r);i&&e.addDependent(i);const l=()=>{a(),n&&U(n),this.values.delete(t),i&&e.removeDependent(i)};return this.values.set(t,{value:e,onRemove:l}),l}get(t){return this.values.get(t)?.value}}function Yi(t){const e=new WeakMap;return(n,i)=>{const s=e.get(n)??new Ki;e.set(n,s);const o=[];for(const e in i){const r=i[e],a=t(n,s,e,r);o.push(a)}return()=>{for(const t of o)t()}}}const Xi=(t,e,n,i)=>{const s=function(t,e){if(!(e in t))return!1;const n=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(t),e)||Object.getOwnPropertyDescriptor(t,e);return n&&"function"==typeof n.set}(t,n),o=s?n:n.startsWith("data")||n.startsWith("aria")?hi(n):n,r=s?()=>{t[o]=e.latest[n]}:()=>{const i=e.latest[n];null==i?t.removeAttribute(o):t.setAttribute(o,String(i))};return e.set(n,i,r)},Gi=Ui(Yi(Xi)),Hi=Yi((t,e,n,i)=>e.set(n,i,()=>{t[n]=e.latest[n]},void 0,!1));function qi(t){return a(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const Zi={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"};const _i=new Set(["originX","originY","originZ"]),Ji=(t,e,n,i)=>{let s,o;return ze.has(n)?(e.get("transform")||(qi(t)||e.get("transformBox")||Ji(t,e,"transformBox",new Fn("fill-box")),e.set("transform",new Fn("none"),()=>{t.style.transform=function(t){let e="",n=!0;for(let i=0;i{const n=e.latest.originX??"50%",i=e.latest.originY??"50%",s=e.latest.originZ??0;t.style.transformOrigin=`${n} ${i} ${s}`}),o=e.get("transformOrigin")):s=nn(n)?()=>{t.style.setProperty(n,e.latest[n])}:()=>{t.style[n]=e.latest[n]},e.set(n,i,s,o)},Qi=Ui(Yi(Ji));const ts=Ui(Yi((t,e,n,i)=>{if(n.startsWith("path"))return function(t,e,n,i){return W.render(()=>t.setAttribute("pathLength","1")),"pathOffset"===n?e.set(n,i,()=>{const i=e.latest[n];t.setAttribute("stroke-dashoffset",""+-i)}):(e.get("stroke-dasharray")||e.set("stroke-dasharray",new Fn("1 1"),()=>{const{pathLength:n=1,pathSpacing:i}=e.latest;t.setAttribute("stroke-dasharray",`${n} ${i??1-Number(n)}`)}),e.set(n,i,void 0,e.get("stroke-dasharray")))}(t,e,n,i);if(n.startsWith("attr"))return Xi(t,e,function(t){return t.replace(/^attr([A-Z])/,(t,e)=>e.toLowerCase())}(n),i);return(n in t.style?Ji:Xi)(t,e,n,i)}));const{schedule:es,cancel:ns}=N(queueMicrotask,!1),is={x:!1,y:!1};function ss(){return is.x||is.y}function os(t,e){const n=Wi(t),i=new AbortController;return[n,{passive:!0,...e,signal:i.signal},()=>i.abort()]}const rs=(t,e)=>!!e&&(t===e||rs(t,e.parentElement)),as=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,ls=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function cs(t){return ls.has(t.tagName)||!0===t.isContentEditable}const us=new Set(["INPUT","SELECT","TEXTAREA"]);const hs=new WeakSet;function ds(t){return e=>{"Enter"===e.key&&t(e)}}function ps(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function ms(t){return as(t)&&!ss()}const fs=new WeakSet;function ys(t,e){const n=window.getComputedStyle(t);return nn(e)?n.getPropertyValue(e):n[e]}function gs(t){return a(t)&&"ownerSVGElement"in t}const vs=new WeakMap;let xs;const ws=(t,e,n)=>(i,s)=>s&&s[0]?s[0][t+"Size"]:gs(i)&&"getBBox"in i?i.getBBox()[e]:i[n],Ts=ws("inline","width","offsetWidth"),bs=ws("block","height","offsetHeight");function Ss({target:t,borderBoxSize:e}){vs.get(t)?.forEach(n=>{n(t,{get width(){return Ts(t,e)},get height(){return bs(t,e)}})})}function As(t){t.forEach(Ss)}function Vs(t,e){xs||"undefined"!=typeof ResizeObserver&&(xs=new ResizeObserver(As));const n=Wi(t);return n.forEach(t=>{let n=vs.get(t);n||(n=new Set,vs.set(t,n)),n.add(e),xs?.observe(t)}),()=>{n.forEach(t=>{const n=vs.get(t);n?.delete(e),n?.size||xs?.unobserve(t)})}}const Ps=new Set;let Ms;function Es(t){return Ps.add(t),Ms||(Ms=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};Ps.forEach(e=>e(t))},window.addEventListener("resize",Ms)),()=>{Ps.delete(t),Ps.size||"function"!=typeof Ms||(window.removeEventListener("resize",Ms),Ms=void 0)}}function ks(t,e){return"function"==typeof t?Es(t):Vs(t,e)}function Ds(t,e){let n;const i=()=>{const{currentTime:i}=e,s=(null===i?0:i.value)/100;n!==s&&t(s),n=s};return W.preUpdate(i,!0),()=>U(i)}const Cs={value:null,addProjectionMetrics:null};function Bs(t){return gs(t)&&"svg"===t.tagName}function Rs(t,e){if("first"===t)return 0;{const n=e-1;return"last"===t?n:n/2}}function Ls(...t){const e=!Array.isArray(t[0]),n=e?0:-1,i=t[0+n],s=ge(t[1+n],t[2+n],t[3+n]);return e?s(i):s}function js(t,e){const n=In(li(t)?t.get():t);return Os(n,t,e),n}function Os(t,e,n={}){const i=t.get();let s,o=null,r=i;const a="string"==typeof i?i.replace(/[\d.-]/g,""):void 0,l=()=>{o&&(o.stop(),o=null),t.animation=void 0},c=()=>{(()=>{const e=Is(t.get()),i=Is(r);if(e===i)return void l();const a=o?o.getGeneratorVelocity():t.getVelocity();l(),o=new ke({keyframes:[e,i],velocity:a,type:"spring",restDelta:.001,restSpeed:.01,...n,onUpdate:s})})(),t.animation=o??void 0,t.events.animationStart?.notify(),o?.then(()=>{t.animation=void 0,t.events.animationComplete?.notify()})};if(t.attach((t,e)=>{r=t,s=t=>e(Fs(t,a)),W.postRender(c)},l),li(e)){let i=!0===n.skipInitialAnimation;const s=e.on("change",e=>{i?(i=!1,t.jump(Fs(e,a),!1)):t.set(Fs(e,a))}),o=t.on("destroy",s);return()=>{s(),o()}}return l}function Fs(t,e){return e?t+e:t}function Is(t){return"number"==typeof t?t:parseFloat(t)}function $s(t){const e=[];On.current=e;const n=t();On.current=void 0;const i=In(n);return function(t,e,n){const i=()=>e.set(n()),s=()=>W.preRender(i,!1,!0),o=t.map(t=>t.on("change",s));e.on("destroy",()=>{o.forEach(t=>t()),U(i)})}(e,i,t),i}const Ns=[...wi,xt,Mt],Ws=t=>Ns.find(xi(t));let Us=0;const zs=()=>"motion-view-"+Us++;function Ks(t,e,n){e&&(t.style?.setProperty("view-transition-class",e),n.push(t))}function Ys(t,e,n,i,s){if(n&&(t.style?.setProperty("view-transition-group",n),i.push(t),"none"!==n&&s)){const n=getComputedStyle(t);"visible"===n.overflowX&&"visible"===n.overflowY||s.add(e)}}function Xs(t,e,n,i,s,o=[],r,a=[],l){const c=Wi(t);if(i)return c.map((t,c)=>{const u=e.get(t);if(u)return u;const h=i[c]??zs();return t.style?.setProperty("view-transition-name",h),n.push(t),e.set(t,h),Ks(t,s,o),Ys(t,h,r,a,l),h});const u=c.map(t=>e.has(t)?void 0:getComputedStyle(t).getPropertyValue("view-transition-name"));return c.map((t,i)=>{const c=e.get(t);if(c)return c;const h=u[i];let d;return h&&"none"!==h&&"auto"!==h&&"match-element"!==h&&!(t=>t.startsWith("motion-view-"))(h)?d=h:(d=zs(),t.style?.setProperty("view-transition-name",d),n.push(t)),e.set(t,d),Ks(t,s,o),Ys(t,d,r,a,l),d})}function Gs(t){return"layout"===t?"group":"enter"===t||"new"===t?"new":"old"}let Hs={},qs=null;const Zs=(t,e)=>{Hs[t]=e},_s=()=>{qs||(qs=document.createElement("style"),qs.id="motion-view");let t="";for(const e in Hs){const n=Hs[e];t+=`${e} {\n`;for(const[e,i]of Object.entries(n))t+=` ${e}: ${i};\n`;t+="}\n"}qs.textContent=t,document.head.appendChild(qs),Hs={}},Js=()=>{qs&&qs.parentElement&&qs.parentElement.removeChild(qs)};function Qs(t){const e=t.match(/::view-transition-(old|new|group-children|group|image-pair)\((.*?)\)/);return e?{layer:e[2],type:e[1]}:null}function to(){return document.getAnimations().filter(t=>{const{effect:e}=t;return!!e&&e.target===document.documentElement&&e.pseudoElement?.startsWith("::view-transition")})}const eo=["layout","enter","exit","new","old"],no=t=>t.split(" ").every(t=>0===parseFloat(t)),io={group:["layout"],new:["new","enter"],old:["old","exit"]},so={new:{opacity:0,scale:.85},old:{opacity:1,scale:1}};function oo(t){const{update:e,targets:n,resolveDefs:i,cropOverride:s,pairs:o,classNames:r,flatGroups:a,options:l}=t;if(!document.startViewTransition)return(async()=>(await e(),new En([])))();const c=new Map,u=[],h=[],d=[],p=new Set,f=new Map,y=new Set,g=new Map,x=new Map,w=new Map,T=new Map,b=t=>{n.forEach((e,n)=>{const l=r.get(n),m="root"!==n&&i.has(n)?a.has(n)?"none":"contain":void 0;let y;if("root"!==n&&i.has(n))if(o.has(n))if("old"===t)T.set(n,Wi(n)),y=Xs(n,c,u,void 0,l,h,m,d,p),w.set(n,y);else{for(const t of T.get(n)??[])t.style?.removeProperty("view-transition-name"),c.delete(t);y=Xs(o.get(n),c,u,w.get(n),l,h,m,d,p)}else y=Xs(n,c,u,void 0,l,h,m,d,p);else y=[n];const v=s.get(n);y.forEach((n,i)=>{const s=f.get(n);f.set(n,s&&s!==e?{...s,...e}:e),void 0!==v&&g.set(n,v);const o=x.get(n)??{};o[t]=[i,y.length],x.set(n,o)})})},S=(t,e)=>{const n=x.get(t);return("old"===e?n?.old:"new"===e?n?.new:n?.new??n?.old)??[-1,1]},A=(t,e,n,i,s)=>{const o=ro(Nn(l,n),Nn(function(t,e){for(const n of io[e]??[]){const e=t?.[n]?.options;if(e)return e}}(t,e)??{},n));return"function"==typeof o.delay&&(o.delay=o.delay(i,s)),o},V=t=>{const[e,n]=S(t,"group"),i=A(f.get(t),"group","layout",-1===e?0:e,n);i.duration&&(i.duration=m(i.duration));const{delay:s=0,duration:o,ease:r}=fn(i);return{delay:m(s),duration:o,ease:r}},P=new Map,M=t=>c.forEach((e,n)=>{const i=n,s=i.getBoundingClientRect?.();if(s&&s.height){const n=getComputedStyle(i),o={};for(const t of Fi)o[t]=n[t];const r=P.get(e)??{};r[t]={width:s.width,height:s.height,radii:o},P.set(e,r)}}),E=t=>{const e=P.get(t);return!!(e?.old&&e?.new&&e.old.height&&e.new.height)&&Math.abs(e.old.width/e.old.height-e.new.width/e.new.height)>.2},k=()=>{(function(t,e){return e.has(t)&&Object.keys(e.get(t)).length>0})("root",n)||Zs(":root",{"view-transition-name":"none"}),Zs("::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)",{"animation-timing-function":"linear !important"}),y.forEach(t=>{Zs(`::view-transition-group(${t})`,{overflow:"clip"}),Zs(`::view-transition-old(${t}), ::view-transition-new(${t})`,{width:"100%",height:"100%","object-fit":"cover"})}),p.forEach(t=>{Zs(`::view-transition-group-children(${t})`,{overflow:"clip"})}),_s()},D=()=>{!function(t,e=[],n=[]){for(const e of t)e.style?.removeProperty("view-transition-name");for(const t of e)t.style?.removeProperty("view-transition-class");for(const t of n)t.style?.removeProperty("view-transition-group")}(u,h,d),Js()},C=async()=>{await e(),b("new"),M("new"),(()=>{y.clear();for(const t of x.keys())"root"!==t&&(g.get(t)??E(t))&&y.add(t)})(),k()};let B;try{b("old"),M("old"),k(),B=document.startViewTransition(C)}catch(t){return D(),Promise.reject(t)}return B.finished.finally(D),new Promise((t,e)=>{B.ready.then(()=>{const e=to(),n=[],i=new Set,s=new Set;f.forEach((t,e)=>{const o=x.get(e),r=!!o?.new&&!o?.old,a=!!o?.old&&!o?.new;for(const o of eo){if(!t[o])continue;if("enter"===o&&!r)continue;if("exit"===o&&!a)continue;const c=Gs(o),[u,h]=S(e,c);if(-1===u)continue;const{keyframes:d,options:p}=t[o];for(let[f,y]of Object.entries(d)){if(null==y)continue;if("x"===f||"y"===f){v(!1,`animateView() animates view-transition layers with CSS properties; the "${f}" shorthand has no effect - use transform, e.g. { transform: "translateX(40px)" }.`);continue}if("new"===o&&r&&null!=t.enter?.keyframes[f])continue;if("old"===o&&a&&null!=t.exit?.keyframes[f])continue;const d=ro(Nn(l,f),Nn(p,f));if(!Array.isArray(y)){const e="enter"===o?t.exit?.keyframes[f]:void 0,n="opacity"===f||("new"===c?r:a),i=null!=e?Array.isArray(e)?e[e.length-1]:e:n?so[c]?.[f]:void 0;void 0!==i&&(y=[i,y])}"function"==typeof d.delay&&(d.delay=d.delay(u,h)),d.duration&&(d.duration=m(d.duration)),d.delay&&(d.delay=m(d.delay)),n.push(new yn({...d,element:document.documentElement,name:f,pseudoElement:`::view-transition-${c}(${e})`,keyframes:y})),i.add(`${e}:${c}`),"opacity"===f&&s.add(`${e}:${c}`)}}});for(const t of e){if("finished"===t.playState)continue;const{effect:e}=t;if(!(e&&e instanceof KeyframeEffect))continue;const{pseudoElement:o}=e;if(!o)continue;const r=Qs(o);if(!r)continue;const a=f.get(r.layer);if(i.has(`${r.layer}:${r.type}`)){s.has(`${r.layer}:new`)&&s.has(`${r.layer}:old`)&&e.getKeyframes().some(t=>t.mixBlendMode)?n.push(new Cn(t)):t.cancel();continue}const l="old"===r.type?"new":"new"===r.type?"old":void 0;if(l&&i.has(`${r.layer}:${l}`)&&!s.has(`${r.layer}:${l}`)){t.cancel();continue}const c=x.get(r.layer),u=!("old"!==r.type&&"new"!==r.type||!c?.old||!c?.new);let h;if(r.type.startsWith("group")){const{delay:t,duration:e,ease:n}=V(r.layer);h={delay:t,duration:e,easing:dn(n,e)}}else{const t=u?"group":r.type,[e,n]=S(r.layer,t);let i=A(a,t,"group"===t?"layout":"",-1===e?0:e,n);const s=i.visualDuration;i.duration&&(i.duration=m(i.duration)),i=fn(i),h={delay:m(i.delay??0),duration:u&&void 0!==s?m(s):i.duration,easing:u?"linear":dn(i.ease,i.duration)}}e.updateTiming(h),n.push(new Cn(t))}P.forEach((t,e)=>{if(!y.has(e))return;const{delay:i,duration:s,ease:o}=V(e);for(const r of Fi){const a=t.old?.radii[r]||t.new?.radii[r]||"0px",l=t.new?.radii[r]||t.old?.radii[r]||"0px";no(a)&&no(l)||n.push(new yn({element:document.documentElement,name:r,pseudoElement:`::view-transition-group(${e})`,keyframes:[a,l],delay:i,duration:s,ease:o}))}}),t(new En(n))}).catch(()=>B.updateCallbackDone.then(()=>t(new En([])),e))})}function ro(t,e){const n={...t,...e};return void 0!==e.duration&&(void 0===e.visualDuration&&delete n.visualDuration,void 0===e.type&&delete n.type),n}let ao=[],lo=null;function co(){lo=null;const[t]=ao;var e;t&&(n(ao,e=t),lo=e,oo(e).then(t=>(e.notifyReady(t),t.finished)).catch(t=>e.notifyReject(t)).finally(co))}function uo(){for(let t=ao.length-1;t>=0;t--){const e=ao[t],{interrupt:n}=e.options;if("immediate"===n){const n=ao.slice(0,t+1).map(t=>t.update),i=ao.slice(t+1);e.update=()=>{n.forEach(t=>t())},ao=[e,...i];break}}lo&&"immediate"!==ao[0]?.options.interrupt||co()}class ho{constructor(t,e={}){var n;this.currentSubject="root",this.targets=new Map,this.resolveDefs=new Set,this.cropOverride=new Map,this.pairs=new Map,this.classNames=new Map,this.flatGroups=new Set,this.notifyReady=u,this.notifyReject=u,this.readyPromise=new Promise((t,e)=>{this.notifyReady=t,this.notifyReject=e}),this.update=t,this.options={interrupt:"wait",...e},this.readyPromise.catch(u),n=this,ao.push(n),es.render(uo)}add(t,e){return this.currentSubject=t,this.resolveDefs.add(t),void 0!==e&&this.pairs.set(t,e),this.targets.has(t)||this.targets.set(t,{}),this}crop(t=!0){return this.cropOverride.set(this.currentSubject,t),this}group(t=!0){return t?this.flatGroups.delete(this.currentSubject):this.flatGroups.add(this.currentSubject),this}class(t){return this.classNames.set(this.currentSubject,t),this}layout(t={}){return this.updateTarget("layout",{},t),this}enter(t,e){return this.updateTarget("enter",t,e),this}exit(t,e){return this.updateTarget("exit",t,e),this}new(t,e){return this.updateTarget("new",t,e),this}old(t,e){return this.updateTarget("old",t,e),this}updateTarget(t,e,n={}){const{currentSubject:i,targets:s}=this;s.has(i)||s.set(i,{});s.get(i)[t]={keyframes:e,options:n}}then(t,e){return this.readyPromise.then(t,e)}}const po=()=>({translate:0,scale:1,origin:0,originPoint:0}),mo=()=>({x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}),fo=()=>({min:0,max:0}),yo=()=>({x:{min:0,max:0},y:{min:0,max:0}}),go=new WeakMap;function vo(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function xo(t){return"string"==typeof t||Array.isArray(t)}const wo=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],To=["initial",...wo];function bo(t){return vo(t.animate)||To.some(e=>xo(t[e]))}function So(t){return Boolean(bo(t)||t.variants)}function Ao(t,e,n){for(const i in e){const s=e[i],o=n[i];if(li(s))t.addValue(i,s);else if(li(o))t.addValue(i,In(s,{owner:t}));else if(o!==s)if(t.hasValue(i)){const e=t.getValue(i);!0===e.liveStyle?e.jump(s):e.hasAnimated||e.set(s)}else{const e=t.getStaticValue(i);t.addValue(i,In(void 0!==e?e:s,{owner:t}))}}for(const i in n)void 0===e[i]&&t.removeValue(i);return e}const Vo={current:null},Po={current:!1},Mo="undefined"!=typeof window;function Eo(){if(Po.current=!0,Mo)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Vo.current=t.matches;t.addEventListener("change",e),e()}else Vo.current=!1}const ko=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Do={};class Co{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:i,skipAnimations:s,blockInitialAnimation:o,visualState:r},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=en,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const t=G.now();this.renderScheduledAtthis.bindToMotionValue(e,t)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(Po.current||Eo(),this.shouldReduceMotion=Vo.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),U(this.notifyUpdate),U(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,e){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),e.accelerate&&bn.has(t)&&this.current instanceof HTMLElement){const{factory:n,keyframes:i,times:s,ease:o,duration:r}=e.accelerate,a=new yn({element:this.current,name:t,keyframes:i,times:s,ease:o,duration:m(r)}),l=n(a);return void this.valueSubscriptions.set(t,()=>{l(),a.cancel()})}const n=ze.has(t);n&&this.onBindTransform&&this.onBindTransform();const i=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&W.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let s;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{i(),s&&s()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in Do){const e=Do[t];if(!e)continue;const{isEnabled:n,Feature:i}=e;if(!this.features[t]&&i&&n(this.props)&&(this.features[t]=new i(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;ee.variantChildren.delete(t)}addValue(t,e){const n=this.values.get(t);e!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=In(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,e){let n=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];return null!=n&&("string"==typeof n&&(r(n)||l(n))?n=parseFloat(n):!Ws(n)&&Mt.test(e)&&(n=Li(t,e)),this.setBaseTarget(t,li(n)?n.get():n)),li(n)?n.get():n}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let n;if("string"==typeof e||"object"==typeof e){const i=ei(this.props,e,this.presenceContext?.custom);i&&(n=i[t])}if(e&&void 0!==n)return n;const i=this.getBaseTargetFromProps(this.props,t);return void 0===i||li(i)?void 0!==this.initialValues[t]&&void 0===n?void 0:this.baseTarget[t]:i}on(t,e){return this.events[t]||(this.events[t]=new p),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){es.render(this.render)}}class Bo extends Co{constructor(){super(...arguments),this.KeyframeResolver=Oi}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){const n=t.style;return n?n[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;li(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}function Ro({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function Lo(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),i=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}function jo(t){return void 0===t||1===t}function Oo({scale:t,scaleX:e,scaleY:n}){return!jo(t)||!jo(e)||!jo(n)}function Fo(t){return Oo(t)||Io(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Io(t){return $o(t.x)||$o(t.y)}function $o(t){return t&&"0%"!==t}function No(t,e,n){return n+e*(t-n)}function Wo(t,e,n,i,s){return void 0!==s&&(t=No(t,s,i)),No(t,n,i)+e}function Uo(t,e=0,n=1,i,s){t.min=Wo(t.min,e,n,i,s),t.max=Wo(t.max,e,n,i,s)}function zo(t,{x:e,y:n}){Uo(t.x,e.translate,e.scale,e.originPoint),Uo(t.y,n.translate,n.scale,n.originPoint)}const Ko=.999999999999,Yo=1.0000000000001;function Xo(t,e,n,i=!1){const s=n.length;if(!s)return;let o,r;e.x=e.y=1;for(let a=0;aKo&&(e.x=1),e.yKo&&(e.y=1)}function Go(t,e){t.min+=e,t.max+=e}function Ho(t,e,n,i,s=.5){Uo(t,e,n,Ct(t.min,t.max,s),i)}function qo(t,e){return"string"==typeof t?parseFloat(t)/100*(e.max-e.min):t}function Zo(t,e,n){const i=n??t;Ho(t.x,qo(e.x,i.x),e.scaleX,e.scale,e.originX),Ho(t.y,qo(e.y,i.y),e.scaleY,e.scale,e.originY)}function _o(t,e){return Ro(Lo(t.getBoundingClientRect(),e))}const Jo={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Qo=Ue.length;function tr(t,e,n){let i="",s=!0;for(let o=0;o{if(!e.target)return t;if("string"==typeof t){if(!mt.test(t))return t;t=parseFloat(t)}return`${ir(t,e.target.x)}% ${ir(t,e.target.y)}%`}},or={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,s=Mt.parse(t);if(s.length>5)return i;const o=Mt.createTransformer(t),r="number"!=typeof s[0]?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;s[0+r]/=a,s[1+r]/=l;const c=Ct(a,l,.5);return"number"==typeof s[2+r]&&(s[2+r]/=c),"number"==typeof s[3+r]&&(s[3+r]/=c),o(s)}},rr={borderRadius:{...sr,applyTo:[...Fi]},borderTopLeftRadius:sr,borderTopRightRadius:sr,borderBottomLeftRadius:sr,borderBottomRightRadius:sr,boxShadow:or};function ar(t,{layout:e,layoutId:n}){return ze.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!rr[t]||"opacity"===t)}function lr(t,e,n){const i=t.style,s=e?.style,o={};if(!i)return o;for(const e in i)(li(i[e])||s&&li(s[e])||ar(e,t)||void 0!==n?.getValue(e)?.liveStyle)&&(o[e]=i[e]);return o}class cr extends Bo{constructor(){super(...arguments),this.type="html",this.renderInstance=nr}mount(e){t.invariant(Boolean(e.style),"motion.create() components must forward their ref to a HTML or SVG element","custom-component-ref"),super.mount(e)}readValueFromInstance(t,e){if(ze.has(e))return this.projection?.isProjecting?Ie(e):Ne(t,e);{const i=(n=t,window.getComputedStyle(n)),s=(q(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof s?s.trim():s}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return _o(t,e)}build(t,e,n){er(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return lr(t,e,n)}}class ur extends Co{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,e){if(function(t,e){return t in e}(e,t)){const n=t[e];if("string"==typeof n||"number"==typeof n)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(t,e){delete e.output[t]}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}build(t,e){Object.assign(t.output,e)}renderInstance(t,{output:e}){Object.assign(t,e)}sortInstanceNodePosition(){return 0}}const hr={offset:"stroke-dashoffset",array:"stroke-dasharray"},dr={offset:"strokeDashoffset",array:"strokeDasharray"};function pr(t,e,n=1,i=0,s=!0){t.pathLength=1;const o=s?hr:dr;t[o.offset]=""+-i,t[o.array]=`${e} ${n}`}const mr=["transform","opacity","offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function fr(t,{attrX:e,attrY:n,attrScale:i,pathLength:s,pathSpacing:o=1,pathOffset:r=0,...a},l,c,u){if(er(t,a,c),l)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:h,style:d}=t;for(const t of mr)void 0!==h[t]&&(d[t]=h[t],delete h[t]);(d.transform||h.transformOrigin)&&(d.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),d.transform&&(d.transformBox=u?.transformBox??"fill-box",delete h.transformBox),void 0!==e&&(h.x=e),void 0!==n&&(h.y=n),void 0!==i&&(h.scale=i),void 0!==s&&pr(h,s,o,r,!1)}const yr=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),gr=t=>"string"==typeof t&&"svg"===t.toLowerCase();function vr(t,e,n,i){nr(t,e,void 0,i);for(const n in e.attrs)t.setAttribute(yr.has(n)?n:hi(n),e.attrs[n])}function xr(t,e,n){const i=lr(t,e,n);for(const n in t)if(li(t[n])||li(e[n])){i[-1!==Ue.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]}return i}class wr extends Bo{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=yo}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(ze.has(e)){const t=Bi(e);return t&&t.default||0}if(mr.includes(e)){const n=getComputedStyle(t)[e];if("string"==typeof n&&n)return n.trim()}return e=yr.has(e)?e:hi(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return xr(t,e,n)}build(t,e,n){fr(t,e,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,e,n,i){vr(t,e,0,i)}mount(t){this.isSVGTag=gr(t.tagName),super.mount(t)}}const Tr=To.length;function br(t){if(!t)return;if(!t.isControllingVariants){const e=t.parent&&br(t.parent)||{};return void 0!==t.props.initial&&(e.initial=t.props.initial),e}const e={};for(let n=0;n=.9999&&t.scale<=1.0001||isNaN(t.scale))&&(t.scale=1),(t.translate>=-.01&&t.translate<=.01||isNaN(t.translate))&&(t.translate=0)}function jr(t,e,n,i){Lr(t.x,e.x,n.x,i?i.originX:void 0),Lr(t.y,e.y,n.y,i?i.originY:void 0)}function Or(t,e,n,i=0){const s=i?Ct(n.min,n.max,i):n.min;t.min=s+e.min,t.max=t.min+Br(e)}function Fr(t,e,n,i){Or(t.x,e.x,n.x,i?.x),Or(t.y,e.y,n.y,i?.y)}function Ir(t,e,n,i=0){const s=i?Ct(n.min,n.max,i):n.min;t.min=e.min-s,t.max=t.min+Br(e)}function $r(t,e,n,i){Ir(t.x,e.x,n.x,i?.x),Ir(t.y,e.y,n.y,i?.y)}function Nr(t,e,n,i,s){return t=No(t-=e,1/n,i),void 0!==s&&(t=No(t,1/s,i)),t}function Wr(t,e=0,n=1,i=.5,s,o=t,r=t){if(pt.test(e)){e=parseFloat(e);e=Ct(r.min,r.max,e/100)-r.min}if("number"!=typeof e)return;let a=Ct(o.min,o.max,i);t===o&&(a-=e),t.min=Nr(t.min,e,n,a,s),t.max=Nr(t.max,e,n,a,s)}function Ur(t,e,[n,i,s],o,r){Wr(t,e[n],e[i],e[s],e.scale,o,r)}const zr=["x","scaleX","originX"],Kr=["y","scaleY","originY"];function Yr(t,e,n,i){Ur(t.x,e,zr,n?n.x:void 0,i?i.x:void 0),Ur(t.y,e,Kr,n?n.y:void 0,i?i.y:void 0)}function Xr(t){return 0===t.translate&&1===t.scale}function Gr(t){return Xr(t.x)&&Xr(t.y)}function Hr(t,e){return t.min===e.min&&t.max===e.max}function qr(t,e){return Hr(t.x,e.x)&&Hr(t.y,e.y)}function Zr(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function _r(t,e){return Zr(t.x,e.x)&&Zr(t.y,e.y)}function Jr(t){return Br(t.x)/Br(t.y)}function Qr(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function ta(t){return[t("x"),t("y")]}function ea(t,e,n){let i="";const s=t.x.translate/e.x,o=t.y.translate/e.y,r=n?.z||0;if((s||o||r)&&(i=`translate3d(${s}px, ${o}px, ${r}px) `),1===e.x&&1===e.y||(i+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:t,rotate:e,pathRotation:s,rotateX:o,rotateY:r,skewX:a,skewY:l}=n;t&&(i=`perspective(${t}px) ${i}`),e&&(i+=`rotate(${e}deg) `),s&&(i+=`rotate(${s}deg) `),o&&(i+=`rotateX(${o}deg) `),r&&(i+=`rotateY(${r}deg) `),a&&(i+=`skewX(${a}deg) `),l&&(i+=`skewY(${l}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return 1===a&&1===l||(i+=`scale(${a}, ${l})`),i||"none"}const na=Fi.length,ia=t=>"string"==typeof t?parseFloat(t):t,sa=t=>"number"==typeof t||mt.test(t);function oa(t,e,n,i,s,o){s?(t.opacity=Ct(0,n.opacity??1,aa(i)),t.opacityExit=Ct(e.opacity??1,0,la(i))):o&&(t.opacity=Ct(e.opacity??1,n.opacity??1,i));for(let s=0;sie?1:n(d(t,e,i))}function ua(t,e,n){const i=li(t)?t:In(t);return i.start(Gn("",i,e,n)),i.animation}function ha(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n,i)}const da=(t,e)=>t.depth-e.depth;class pa{constructor(){this.children=[],this.isDirty=!1}add(t){e(this.children,t),this.isDirty=!0}remove(t){n(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(da),this.isDirty=!1,this.children.forEach(t)}}function ma(t,e){const n=G.now(),i=({timestamp:s})=>{const o=s-n;o>=e&&(U(i),t(o-e))};return W.setup(i,!0),()=>U(i)}function fa(t,e){return ma(t,m(e))}function ya(t){return li(t)?t.get():t}class ga{constructor(){this.members=[]}add(t){e(this.members,t);for(let e=this.members.length-1;e>=0;e--){const i=this.members[e];if(i===t||i===this.lead||i===this.prevLead)continue;const s=i.instance;s&&!1!==s.isConnected||i.snapshot||(n(this.members,i),i.unmount())}t.scheduleRender()}remove(t){if(n(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){for(let e=this.members.indexOf(t)-1;e>=0;e--){const t=this.members[e];if(!1!==t.isPresent&&!1!==t.instance?.isConnected)return this.promote(t),!0}return!1}promote(t,e){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.updateSnapshot(),t.scheduleRender();const{layoutDependency:i}=n.options,{layoutDependency:s}=t.options;void 0!==i&&i===s||(t.resumeFrom=n,e&&(n.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root?.isUpdating&&(t.isLayoutDirty=!0)),!1===t.options.crossfade&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{t.options.onExitComplete?.(),t.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}const va={hasAnimatedSinceResize:!0,hasEverUpdated:!1},xa={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},wa=["","X","Y","Z"];let Ta=0;function ba(t,e,n,i){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),i&&(i[t]=0))}function Sa(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=mi(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:e,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",W,!(e||i))}const{parent:i}=t;i&&!i.hasCheckedOptimisedAppear&&Sa(i)}function Aa({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:o}){return class{constructor(t={},n=e?.()){this.id=Ta++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Cs.value&&(xa.nodes=xa.calculatedTargetDeltas=xa.calculatedProjections=0),this.nodes.forEach(Ma),this.nodes.forEach(Oa),this.nodes.forEach(Fa),this.nodes.forEach(Ea),Cs.addProjectionMetrics&&Cs.addProjectionMetrics(xa)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=t,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let t=0;tthis.root.updateBlockedByResize=!1;W.read(()=>{i=window.innerWidth}),t(e,()=>{const t=window.innerWidth;t!==i&&(i=t,this.root.updateBlockedByResize=!0,n&&n(),n=ma(s,250),va.hasAnimatedSinceResize&&(va.hasAnimatedSinceResize=!1,this.nodes.forEach(ja)))})}n&&this.root.registerSharedNode(n,this),!1!==this.options.animate&&s&&(n||i)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeLayoutChanged:n,layout:i})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const o=this.options.transition||s.getDefaultTransition()||za,{onLayoutAnimationStart:r,onLayoutAnimationComplete:a}=s.getProps(),l=!this.targetLayout||!_r(this.targetLayout,i),c=!e&&n;if(this.options.layoutRoot||this.resumeFrom||c||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const e={...Nn(o,"layout"),onPlay:r,onComplete:a};(s.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e),this.setAnimationOrigin(t,c,e.path)}else e||ja(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=i})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const t=this.getStack();t&&t.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),U(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Ia),this.animationId++)}getTransformTemplate(){const{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Sa(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||Br(this.snapshot.measuredBox.x)||Br(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;t{const n=e/1e3,i=p?.(n);var c,m,f,y;i?(r.x.translate=i.x,r.x.scale=Ct(t.x.scale,1,n),r.x.origin=t.x.origin,r.x.originPoint=t.x.originPoint,r.y.translate=i.y,r.y.scale=Ct(t.y.scale,1,n),r.y.origin=t.y.origin,r.y.originPoint=t.y.originPoint):(Na(r.x,t.x,n),Na(r.y,t.y,n)),this.setTargetDelta(r),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&($r(a,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),c=this.relativeTarget,m=this.relativeTargetOrigin,f=a,y=n,Wa(c.x,m.x,f.x,y),Wa(c.y,m.y,f.y,y),d&&qr(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||(d={x:{min:0,max:0},y:{min:0,max:0}}),Dr(d,this.relativeTarget)),l&&(this.animationValues=o,oa(o,s,this.latestValues,n,h,u)),i&&void 0!==i.rotate&&(this.animationValues||(this.animationValues=o),this.animationValues.pathRotation=i.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(t){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(U(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=W.update(()=>{va.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=In(0)),this.motionValue.jump(0,!1),this.currentAnimation=ua(this.motionValue,[0,1e3],{...t,velocity:0,isSync:!0,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onComplete:()=>{t.onComplete&&t.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const t=this.getStack();t&&t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead();let{targetWithTransforms:e,target:n,layout:i,latestValues:s}=t;if(e&&n&&i){if(this!==t&&this.layout&&i&&Ga(this.options.animationType,this.layout.layoutBox,i.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=Br(this.layout.layoutBox.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const i=Br(this.layout.layoutBox.y);n.y.min=t.target.y.min,n.y.max=n.y.min+i}Dr(e,n),Zo(e,s),jr(this.projectionDeltaWithTransform,this.layoutCorrected,e,s)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new ga);this.sharedNodes.get(t).add(e);const n=e.options.initialPromotionConfig;e.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(e):void 0})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){const{layoutId:t}=this.options;return t&&this.getStack()?.lead||this}getPrevLead(){const{layoutId:t}=this.options;return t?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:n}={}){const i=this.getStack();i&&i.promote(this,n),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetSkewAndRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const{latestValues:n}=t;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(e=!0),!e)return;const i={};n.z&&ba("z",t,i,this.animationValues);for(let e=0;et.currentAnimation?.stop()),this.root.nodes.forEach(Da),this.root.sharedNodes.clear()}}}function Va(t){t.updateLayout()}function Pa(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=t.layout,{animationType:s}=t.options,o=e.source!==t.layout.source;if("size"===s)ta(t=>{const i=o?e.measuredBox[t]:e.layoutBox[t],s=Br(i);i.min=n[t].min,i.max=i.min+s});else if("x"===s||"y"===s){const t="x"===s?"y":"x";kr(o?e.measuredBox[t]:e.layoutBox[t],n[t])}else Ga(s,e.layoutBox,n)&&ta(i=>{const s=o?e.measuredBox[i]:e.layoutBox[i],r=Br(n[i]);s.max=s.min+r,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[i].max=t.relativeTarget[i].min+r)});const r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};jr(r,n,e.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};o?jr(a,t.applyTransform(i,!0),e.measuredBox):jr(a,n,e.layoutBox);const l=!Gr(r);let c=!1;if(!t.resumeFrom){const i=t.getClosestProjectingParent();if(i&&!i.resumeFrom){const{snapshot:s,layout:o}=i;if(s&&o){const r=t.options.layoutAnchor||void 0,a={x:{min:0,max:0},y:{min:0,max:0}};$r(a,e.layoutBox,s.layoutBox,r);const l={x:{min:0,max:0},y:{min:0,max:0}};$r(l,n,o.layoutBox,r),_r(a,l)||(c=!0),i.options.layoutRoot&&(t.relativeTarget=l,t.relativeTargetOrigin=a,t.relativeParent=i)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:a,layoutDelta:r,hasLayoutChanged:l,hasRelativeLayoutChanged:c})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function Ma(t){Cs.value&&xa.nodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=Boolean(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function Ea(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function ka(t){t.clearSnapshot()}function Da(t){t.clearMeasurements()}function Ca(t){t.isLayoutDirty=!0,t.updateLayout()}function Ba(t){t.isLayoutDirty=!1}function Ra(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function La(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function ja(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Oa(t){t.resolveTargetDelta()}function Fa(t){t.calcProjection()}function Ia(t){t.resetSkewAndRotation()}function $a(t){t.removeLeadSnapshot()}function Na(t,e,n){t.translate=Ct(e.translate,0,n),t.scale=Ct(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Wa(t,e,n,i){t.min=Ct(e.min,n.min,i),t.max=Ct(e.max,n.max,i)}function Ua(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const za={duration:.45,ease:[.4,0,.1,1]},Ka=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Ya=Ka("applewebkit/")&&!Ka("chrome/")?Math.round:u;function Xa(t){t.min=Ya(t.min),t.max=Ya(t.max)}function Ga(t,e,n){return"position"===t||"preserve-aspect"===t&&!Rr(Jr(e),Jr(n),.2)}function Ha(t){return t!==t.root&&t.scroll?.wasRoot}const qa=Aa({attachResizeListener:(t,e)=>ha(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Za=t=>!t.isLayoutDirty&&t.willUpdate(!1);const _a={current:void 0},Ja=Aa({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!_a.current){const t=new qa({});t.mount(window),t.setOptions({layoutScroll:!0}),_a.current=t}return _a.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),Qa="[data-layout],[data-layout-id]",tl=new WeakMap;let el;function nl(t){const e=[];return t instanceof HTMLElement&&t.matches(Qa)&&e.push(t),t.querySelectorAll(Qa).forEach(t=>{t instanceof HTMLElement&&e.push(t)}),e}function il(t,e){const n=t.getAttribute("data-layout");return{layoutId:t.getAttribute("data-layout-id")??void 0,layout:null!==n||void 0,animationType:n&&"true"!==n?n:"both",transition:e}}function sl(t,e){let n=tl.get(t);if(n)n.setOptions(il(t,e));else{let i=go.get(t);i||(i=new cr({props:{},presenceContext:null,visualState:{latestValues:{},renderState:{transform:{},transformOrigin:{},style:{},vars:{}}}},{allowProjection:!0})),t.style.transform&&!Fo(i.latestValues)&&(t.style.transform=""),n=new Ja(i.latestValues,function(t){let e=t.parentElement;for(;e;){const t=tl.get(e);if(t&&t.instance)return t;e=e.parentElement}}(t)),i.projection=n,n.setOptions({...il(t,e),visualElement:i}),n.mount(t),tl.set(t,n)}return n.isPresent=!0,n.options.onExitComplete&&n.setOptions({onExitComplete:void 0}),n}function ol(t,e){e.setOptions({onExitComplete:void 0});e.getStack()&&!e.isLead()||e.currentAnimation?.stop(),e.unmount(),tl.delete(t)}function rl(){const t=el;el=void 0,function(){if(z.isProcessing)return;const t=G.now();z.delta=i(0,1e3/60,t-z.timestamp),z.timestamp=t,z.isProcessing=!0,K.update.process(z),K.preRender.process(z),K.render.process(z),z.isProcessing=!1}();const e=new Map;for(const n of t)for(const t of n.collectTargets()){const i=e.get(t);i?i.push(n):e.set(t,[n])}const n=new Map;for(const t of(s=e.keys(),[...s].sort((t,e)=>t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1))){const i=e.get(t),s=sl(t,i[i.length-1].transitionFor(t));for(const e of i)e.adopt(t,s);n.set(t,s)}var s;n.forEach(t=>{t.isLayoutDirty=!1,t.willUpdate()});const o=[];for(const e of t){const t=e.runUpdate();t&&o.push(t)}const r=()=>{const e=new Set;for(const n of t)n.reconcileAdditions(e);for(const n of t)n.reconcileRemovals(e);let i;n.forEach(t=>i||(i=t.root));for(const e of t)i||(i=e.getRoot());i?.didUpdate(),es.render(()=>{for(const e of t)e.finalize()})};o.length?Promise.all(o).then(r):r()}const al=W,ll=$.reduce((t,e)=>(t[e]=t=>U(t),t),{});function cl(t){return"object"==typeof t&&!Array.isArray(t)}function ul(t,e,n,i){return null==t?[]:"string"==typeof t&&cl(e)?Wi(t,n,i):t instanceof NodeList?Array.from(t):Array.isArray(t)?t.filter(t=>null!=t):[t]}function hl(t,e,n){return t*(e+1)+n*e}function dl(t,e,n,i){return"number"==typeof e?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?n:e.startsWith("<")?Math.max(0,n+parseFloat(e.slice(1))):i.get(e)??t}function pl(t,e,i,s,o,r){!function(t,e,i){for(let s=0;se&&o.at"number"==typeof t,Tl=t=>t.every(wl);function bl(t){const e={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=gs(t)&&!Bs(t)?new wr(e):new cr(e);n.mount(t),go.set(t,n)}function Sl(t){const e=new ur({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});e.mount(t),go.set(t,e)}function Al(e,n,i,s){const o=[];if(function(t,e){return li(t)||"number"==typeof t||"string"==typeof t&&!cl(e)}(e,n))o.push(ua(e,cl(n)&&n.default||n,i&&i.default||i));else{if(null==e)return o;const r=ul(e,n,s),a=r.length;t.invariant(Boolean(a),"No valid elements provided.","no-valid-elements");for(let t=0;t{const c=vl(e),{delay:u=0,times:h=xe(c),type:d=n.type||"keyframes",repeat:y,repeatType:g,repeatDelay:x=0,...w}=i;let{ease:T=n.ease||"easeOut",duration:b}=i;const A="function"==typeof u?u(a,l):u,V=c.length,P=mn(d)?d:o?.[d||"keyframes"];if(V<=2&&P){let t=100;if(2===V&&Tl(c)){const e=c[1]-c[0];t=Math.abs(e)}const e={...n,...w};void 0!==b&&(e.duration=m(b));const i=Ht(e,t,P);T=i.ease,b=i.duration}b??(b=r);const M=p+A;1===h.length&&0===h[0]&&(h[1]=1);const E=h.length-c.length;if(E>0&&ve(h,E),1===c.length&&c.unshift(null),y&&t.warning(y<20,`Sequence segments can't repeat ${y} times — ignoring repeat option. Use a value below 20 or apply repeat at the sequence level instead.`),y&&y<20){const t=b>0?x/b:0;b=hl(b,y,x);const e=[...c],n=[...h];T=Array.isArray(T)?[...T]:[T];const i=[...T],s="reverse"===g||"mirror"===g;let o=e,r=i;s&&(o=[...e].reverse(),"reverse"===g&&(r=[...i].reverse().map(t=>"function"==typeof t?S(t):t)));for(let a=0;a0&&(c.push(c[c.length-1]),h.push(p),T.push("linear")),c.push(...u);for(let t=0;t{for(const s in t){const o=t[s];o.sort(fl);const r=[],l=[],c=[];for(let t=0;t{if(Array.isArray(t)&&"function"==typeof t[0]){const e=t[0],n=In(0);return n.on("change",e),1===t.length?[n,[0,1]]:2===t.length?[n,[0,1],t[1]]:[n,t[1],t[2]]}return t}),n,i,{spring:me});return o.forEach(({keyframes:t,transition:e},n)=>{s.push(...Al(n,t,e))}),s}function Pl(t={}){const{scope:e,reduceMotion:i,skipAnimations:s}=t;return function(t,o,r){let a,l=[];const c={};if(void 0!==i&&(c.reduceMotion=i),void 0!==s&&(c.skipAnimations=s),u=t,Array.isArray(u)&&u.some(Array.isArray)){const{onComplete:n,...i}=o||{};"function"==typeof n&&(a=n),l=Vl(t,{...c,...i},e)}else{const{onComplete:n,...i}=r||{};"function"==typeof n&&(a=n),l=Al(t,o,{...c,...i},e)}var u;const h=new Dn(l);return a&&h.finished.then(a),e&&(e.animations.push(h),h.finished.then(()=>{n(e.animations,h)})),h}}const Ml=Pl();const El=e=>function(n,i,s){return new Dn(function(e,n,i,s){if(null==e)return[];const o=Wi(e,s),r=o.length;t.invariant(Boolean(r),"No valid elements provided.","no-valid-elements");const a=[];for(let t=0;te.delete(n)),l.push(s)}return l}(n,i,s,e))},kl=El();function Dl(t){return"undefined"!=typeof window&&(t?ln():an())}const Cl={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function Bl(t,e,n,i){const s=n[e],{length:o,position:r}=Cl[e],a=s.current,l=n.time;s.current=Math.abs(t[`scroll${r}`]),s.scrollLength=t[`scroll${o}`]-t[`client${o}`],s.offset.length=0,s.offset[0]=0,s.offset[1]=s.scrollLength,s.progress=d(0,s.scrollLength,s.current);const c=i-l;s.velocity=c>50?0:y(s.current-a,c)}const Rl={start:0,center:.5,end:1};function Ll(t,e,n=0){let i=0;if(t in Rl&&(t=Rl[t]),"string"==typeof t){const e=parseFloat(t);t.endsWith("px")?i=e:t.endsWith("%")?t=e/100:t.endsWith("vw")?i=e/100*document.documentElement.clientWidth:t.endsWith("vh")?i=e/100*document.documentElement.clientHeight:t=e}return"number"==typeof t&&(i=e*t),n+i}const jl=[0,0];function Ol(t,e,n,i){let s=Array.isArray(t)?t:jl,o=0,r=0;return"number"==typeof t?s=[t,t]:"string"==typeof t&&(s=(t=t.trim()).includes(" ")?t.split(" "):[t,Rl[t]?t:"0"]),o=Ll(s[0],n,i),r=Ll(s[1],e),o-r}const Fl={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},Il={x:0,y:0};function $l(t,e,n){const{offset:s=Fl.All}=n,{target:o=t,axis:r="y"}=n,a="y"===r?"height":"width",l=o!==t?function(t,e){const n={x:0,y:0};let i=t;for(;i&&i!==e;)if(qi(i))n.x+=i.offsetLeft,n.y+=i.offsetTop,i=i.offsetParent;else if("svg"===i.tagName){const t=i.getBoundingClientRect();i=i.parentElement;const e=i.getBoundingClientRect();n.x+=t.left-e.left,n.y+=t.top-e.top}else{if(!(i instanceof SVGGraphicsElement))break;{const{x:t,y:e}=i.getBBox();n.x+=t,n.y+=e;let s=null,o=i.parentNode;for(;!s;)"svg"===o.tagName&&(s=o),o=i.parentNode;i=s}}return n}(o,t):Il,c=o===t?{width:t.scrollWidth,height:t.scrollHeight}:function(t){return"getBBox"in t&&"svg"!==t.tagName?t.getBBox():{width:t.clientWidth,height:t.clientHeight}}(o),u={width:t.clientWidth,height:t.clientHeight};e[r].offset.length=0;let h=!e[r].interpolate;const d=s.length;for(let t=0;t{!function(t,e=t,n){if(n.x.targetOffset=0,n.y.targetOffset=0,e!==t){let i=e;for(;i&&i!==t;)n.x.targetOffset+=i.offsetLeft,n.y.targetOffset+=i.offsetTop,i=i.offsetParent}n.x.targetLength=e===t?e.scrollWidth:e.clientWidth,n.y.targetLength=e===t?e.scrollHeight:e.clientHeight,n.x.containerLength=t.clientWidth,n.y.containerLength=t.clientHeight}(t,i.target,n),function(t,e,n){Bl(t,"x",e,n),Bl(t,"y",e,n),e.time=n}(t,n,e),(i.offset||i.target)&&$l(t,n,i)},notify:()=>e(n)}}const Wl=new WeakMap,Ul=new WeakMap,zl=new WeakMap,Kl=new WeakMap,Yl=new WeakMap,Xl=t=>t===document.scrollingElement?window:t;function Gl(t,{container:e=document.scrollingElement,trackContentSize:n=!1,...i}={}){if(!e)return u;let s=zl.get(e);s||(s=new Set,zl.set(e,s));const o=Nl(e,t,{time:0,x:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0},y:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}},i);if(s.add(o),!Wl.has(e)){const t=()=>{for(const t of s)t.measure(z.timestamp);W.preUpdate(n)},n=()=>{for(const t of s)t.notify()},i=()=>W.read(t);Wl.set(e,i);const o=Xl(e);window.addEventListener("resize",i),e!==document.documentElement&&Ul.set(e,ks(e,i)),o.addEventListener("scroll",i),i()}if(n&&!Yl.has(e)){const t=Wl.get(e),n={width:e.scrollWidth,height:e.scrollHeight};Kl.set(e,n);const i=()=>{const i=e.scrollWidth,s=e.scrollHeight;n.width===i&&n.height===s||(t(),n.width=i,n.height=s)},s=W.read(i,!0);Yl.set(e,s)}const r=Wl.get(e);return W.read(r,!1,!0),()=>{U(r);const t=zl.get(e);if(!t)return;if(t.delete(o),t.size)return;const n=Wl.get(e);Wl.delete(e),n&&(Xl(e).removeEventListener("scroll",n),Ul.get(e)?.(),window.removeEventListener("resize",n));const i=Yl.get(e);i&&(U(i),Yl.delete(e)),Kl.delete(e)}}const Hl=[[Fl.Enter,"entry"],[Fl.Exit,"exit"],[Fl.Any,"cover"],[Fl.All,"contain"]],ql={start:0,end:1};function Zl(t){const e=t.trim().split(/\s+/);if(2!==e.length)return;const n=ql[e[0]],i=ql[e[1]];return void 0!==n&&void 0!==i?[n,i]:void 0}function _l(t,e){const n=function(t){if(2!==t.length)return;const e=[];for(const n of t)if(Array.isArray(n))e.push(n);else{if("string"!=typeof n)return;{const t=Zl(n);if(!t)return;e.push(t)}}return e}(t);if(!n)return!1;for(let t=0;t<2;t++){const i=n[t],s=e[t];if(i[0]!==s[0]||i[1]!==s[1])return!1}return!0}function Jl(t){if(!t)return{rangeStart:"contain 0%",rangeEnd:"contain 100%"};for(const[e,n]of Hl)if(_l(t,e))return{rangeStart:`${n} 0%`,rangeEnd:`${n} 100%`}}const Ql=new Map;function tc(t){const e={value:0},n=Gl(n=>{e.value=100*n[t.axis].progress},t);return{currentTime:e,cancel:n}}function ec({source:t,container:e,...n}){const{axis:i}=n;t&&(e=t);let s=Ql.get(e);s||(s=new Map,Ql.set(e,s));const o=n.target??"self";let r=s.get(o);r||(r={},s.set(o,r));const a=i+(n.offset??[]).join(",");if(!r[a])if(n.target&&Dl(n.target)){const t=Jl(n.offset);r[a]=t?new ViewTimeline({subject:n.target,axis:i}):tc({container:e,...n})}else Dl()?r[a]=new ScrollTimeline({source:e,axis:i}):r[a]=tc({container:e,...n});return r[a]}const nc={some:0,all:1};const ic=(t,e)=>Math.abs(t-e);t.AsyncMotionValueAnimation=Mn,t.DOMKeyframesResolver=Oi,t.DOMVisualElement=Bo,t.DocumentProjectionNode=qa,t.Feature=class{constructor(t){this.isMounted=!1,this.node=t}update(){}},t.FlatTree=pa,t.GroupAnimation=En,t.GroupAnimationWithThen=Dn,t.HTMLProjectionNode=Ja,t.HTMLVisualElement=cr,t.JSAnimation=ke,t.KeyframeResolver=en,t.LayoutAnimationBuilder=class{constructor(t,e,n){this.scope=t,this.updateDom=e,this.defaultOptions=n,this.sharedTransitions=new Map,this.notifyReady=()=>{},this.rejectReady=()=>{},this.tracked=new Map,this.restorePoints=new Map,this.readyPromise=new Promise((t,e)=>{this.notifyReady=t,this.rejectReady=e}),el||(el=[],queueMicrotask(rl)),el.push(this)}shared(t,e){return this.sharedTransitions.set(t,e),this}then(t,e){return this.readyPromise.then(t,e)}transitionFor(t){const e=t.getAttribute("data-layout-id");return e&&this.sharedTransitions.get(e)||this.defaultOptions}adopt(t,e){this.tracked.set(t,e),this.restorePoints.set(t,{parent:t.parentElement,next:t.nextSibling})}collectTargets(){return nl(this.scope)}runUpdate(){try{const t=this.updateDom();if(t&&"function"==typeof t.then)return t.then(void 0,t=>{this.updateError=t})}catch(t){this.updateError=t}}reconcileAdditions(t){for(const e of nl(this.scope)){if(this.tracked.has(e))continue;const n=sl(e,this.transitionFor(e));this.adopt(e,n),n.options.layoutId&&t.add(n.options.layoutId)}}reconcileRemovals(t){this.tracked.forEach((e,n)=>{if(n.isConnected)return;const i=this.restorePoints.get(n);this.restorePoints.delete(n);const{layoutId:s}=e.options,o=e.getStack(),r=o&&o.members.some(t=>t!==e&&t.instance?.isConnected);if(s&&e.isLead()&&r&&!t.has(s)&&i&&i.parent.isConnected){if(i.parent.insertBefore(n,i.next&&i.next.parentNode===i.parent?i.next:null),e.isPresent=!1,e.setOptions({onExitComplete:()=>{n.remove(),ol(n,e)}}),e.relegate())return;n.remove()}ol(n,e),this.tracked.delete(n)})}getRoot(){let t;return this.tracked.forEach(e=>t||(t=e.root)),t}finalize(){if(this.updateError)return void this.rejectReady(this.updateError);const t=new Set;this.tracked.forEach(e=>{e.instance&&e.currentAnimation&&t.add(e.currentAnimation)}),this.notifyReady(new En([...t]))}},t.MotionGlobalConfig=o,t.MotionValue=Fn,t.NativeAnimation=yn,t.NativeAnimationExtended=xn,t.NativeAnimationWrapper=Cn,t.NodeStack=ga,t.ObjectVisualElement=ur,t.SVGVisualElement=wr,t.SubscriptionManager=p,t.ViewTransitionBuilder=ho,t.VisualElement=Co,t.acceleratedValues=bn,t.addAttrValue=Xi,t.addDomEvent=ha,t.addScaleCorrector=function(t){for(const e in t)rr[e]=t[e],q(e)&&(rr[e].isCSSVariable=!0)},t.addStyleValue=Ji,t.addUniqueItem=e,t.addValueToWillChange=ui,t.alpha=et,t.analyseComplexValue=At,t.animate=Ml,t.animateMini=kl,t.animateMotionValue=Gn,t.animateSingleValue=ua,t.animateTarget=yi,t.animateValue=function(t){return new ke(t)},t.animateVariant=gi,t.animateView=function(t,e={}){return new ho(t,e)},t.animateVisualElement=vi,t.animationMapKey=Rn,t.anticipate=M,t.applyAxisDelta=Uo,t.applyBoxDelta=zo,t.applyGeneratorOptions=fn,t.applyPointDelta=Wo,t.applyPxDefaults=$i,t.applyTreeDeltas=Xo,t.arc=function(t={}){const e=function({strength:t=.5,peak:e=.5,direction:n,rotate:i=!1}={}){const s=!0===i?1:"number"==typeof i?i:0;let o;return(i,r)=>{const a=r.x-i.x,l=r.y-i.y;let c;c="cw"===n?-t:"ccw"===n?t:(Math.abs(a)>=Math.abs(l)?a:l)<0?-t:t;let u=Zn(i.x,i.y,r.x,r.y,c,e);if(void 0===n){const t=Math.abs(a){const e={x:Hn(t,i.x,u.x,r.x),y:Hn(t,i.y,u.y,r.y)};if(s){const n=qn(t,i.x,u.x,r.x,i.y,u.y,r.y),o=h+p*t;e.rotate=x(-180,180,n-o)*s}return e}}}(t),n={interpolateProjection(t){const n=t.x.translate,i=t.y.translate;if(!(Math.sqrt(n*n+i*i)<20))return e({x:n,y:i},{x:0,y:0})},animateVisualElement(t,n,i,s,o){if(!("x"in n)&&!("y"in n))return;const r=t.getValue("x",t.latestValues.x??0),a=t.getValue("y",t.latestValues.y??0),l=n.x,c=n.y,u=(Array.isArray(l)&&null!=l[0]?l[0]:r?.get())??0,h=(Array.isArray(c)&&null!=c[0]?c[0]:a?.get())??0,d=Array.isArray(l)?l[l.length-1]:l??u,p=Array.isArray(c)?c[c.length-1]:c??h,m=e({x:u,y:h},{x:d,y:p}),f=void 0!==m(0).rotate?t.getValue("pathRotation",0):void 0,y={delay:s,...Nn(i||{},"x")};delete y.path;const g=In(0);g.start(Gn("",g,[0,1e3],{...y,isSync:!0,velocity:0,onUpdate:t=>{const e=m(t/1e3);r?.set(e.x),a?.set(e.y),f&&void 0!==e.rotate&&f.set(e.rotate)},onComplete:()=>{r?.set(d),a?.set(p),f?.set(0)},onStop:()=>f?.set(0),onCancel:()=>f?.set(0)})),g.animation&&o.push(g.animation),delete n.x,delete n.y}};return n},t.aspectRatio=Jr,t.attachFollow=Os,t.attachSpring=function(t,e,n){return Os(t,e,{type:"spring",...n})},t.attrEffect=Gi,t.axisDeltaEquals=Qr,t.axisEquals=Hr,t.axisEqualsRounded=Zr,t.backIn=V,t.backInOut=P,t.backOut=A,t.boxEquals=qr,t.boxEqualsRounded=_r,t.buildHTMLStyles=er,t.buildProjectionTransform=ea,t.buildSVGAttrs=fr,t.buildSVGPath=pr,t.buildTransform=tr,t.calcAxisDelta=Lr,t.calcBoxDelta=jr,t.calcChildStagger=jn,t.calcGeneratorDuration=Gt,t.calcLength=Br,t.calcRelativeAxis=Or,t.calcRelativeAxisPosition=Ir,t.calcRelativeBox=Fr,t.calcRelativePosition=$r,t.camelCaseAttributes=yr,t.camelToDash=hi,t.cancelFrame=U,t.cancelMicrotask=ns,t.cancelSync=ll,t.checkVariantsDidChange=Pr,t.circIn=E,t.circInOut=D,t.circOut=k,t.clamp=i,t.cleanDirtyNodes=Ea,t.collectMotionValues=On,t.color=xt,t.compareByDepth=da,t.complex=Mt,t.containsCSSVariable=Q,t.convertBoundingBoxToBox=Ro,t.convertBoxToBoundingBox=function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}},t.convertOffsetToTimes=we,t.copyAxisDeltaInto=Cr,t.copyAxisInto=kr,t.copyBoxInto=Dr,t.correctBorderRadius=sr,t.correctBoxShadow=or,t.createAnimationState=function(t){let e=function(t){return e=>Promise.all(e.map(({animation:e,options:n})=>vi(t,e,n)))}(t),n=Er(),i=!0,s=!1;const o=e=>(n,i)=>{const s=ni(t,i,"exit"===e?t.presenceContext?.custom:void 0);if(s){const{transition:t,transitionEnd:e,...i}=s;n={...n,...i,...e}}return n};function r(r){const{props:a}=t,l=br(t.parent)||{},c=[],u=new Set;let h={},d=1/0;for(let e=0;ed&&y,T=!1;const b=Array.isArray(f)?f:[f];let S=b.reduce(o(p),{});!1===g&&(S={});const{prevResolvedValues:A={}}=m,V={...A,...S},P=e=>{w=!0,u.has(e)&&(T=!0,u.delete(e)),m.needsAnimating[e]=!0;const n=t.getValue(e);n&&(n.liveStyle=!1)};for(const t in V){const e=S[t],n=A[t];if(h.hasOwnProperty(t))continue;let i=!1;i=si(e)&&si(n)?!Sr(e,n)||x:e!==n,i?null!=e?P(t):u.add(t):void 0!==e&&u.has(t)?P(t):m.protectedKeys[t]=!0}m.prevProp=f,m.prevResolvedValues=S,m.isActive&&(h={...h,...S}),(i||s)&&t.blockInitialAnimation&&(w=!1);const M=v&&x;w&&(!M||T)&&c.push(...b.map(e=>{const n={type:p};if("string"==typeof e&&(i||s)&&!M&&t.manuallyAnimateOnMount&&t.parent){const{parent:i}=t,s=ni(i,e);if(i.enteringChildren&&s){const{delayChildren:e}=s.transition||{};n.delay=jn(i.enteringChildren,t,e)}}return{animation:e,options:n}}))}if(u.size){const e={};if("boolean"!=typeof a.initial){const n=ni(t,Array.isArray(a.initial)?a.initial[0]:a.initial);n&&n.transition&&(e.transition=n.transition)}u.forEach(n=>{const i=t.getBaseTarget(n),s=t.getValue(n);s&&(s.liveStyle=!0),e[n]=i??null}),c.push({animation:e})}let p=Boolean(c.length);return!i||!1!==a.initial&&a.initial!==a.animate||t.manuallyAnimateOnMount||(p=!1),i=!1,s=!1,p?e(c):Promise.resolve()}return{animateChanges:r,setActive:function(e,i){if(n[e].isActive===i)return Promise.resolve();t.variantChildren?.forEach(t=>t.animationState?.setActive(e,i)),n[e].isActive=i;const s=r(e);for(const t in n)n[t].protectedKeys={};return s},setAnimateFunction:function(n){e=n(t)},getState:()=>n,reset:()=>{n=Er(),s=!0}}},t.createAxis=fo,t.createAxisDelta=po,t.createBox=yo,t.createDelta=mo,t.createGeneratorEasing=Ht,t.createProjectionNode=Aa,t.createRenderBatcher=N,t.createScopedAnimate=Pl,t.cubicBezier=T,t.cubicBezierAsString=un,t.defaultEasing=Te,t.defaultOffset=xe,t.defaultTransformValue=Ie,t.defaultValueTypes=Ci,t.degrees=dt,t.delay=fa,t.delayInSeconds=fa,t.dimensionValueTypes=wi,t.distance=ic,t.distance2D=function(t,e){const n=ic(t.x,e.x),i=ic(t.y,e.y);return Math.sqrt(n**2+i**2)},t.eachAxis=ta,t.easeIn=C,t.easeInOut=R,t.easeOut=B,t.easingDefinitionToFunction=I,t.fillOffset=ve,t.fillWildcards=De,t.findDimensionValueType=Ti,t.findValueType=Ws,t.flushKeyframeResolvers=tn,t.followValue=js,t.frame=W,t.frameData=z,t.frameSteps=K,t.generateLinearEasing=Yt,t.getAnimatableNone=Li,t.getAnimationMap=Ln,t.getComputedStyle=ys,t.getDefaultTransition=Kn,t.getDefaultValueType=Bi,t.getEasingForSegment=j,t.getFeatureDefinitions=function(){return Do},t.getFinalKeyframe=Ae,t.getMixer=$t,t.getOptimisedAppearId=mi,t.getOriginIndex=Rs,t.getValueAsType=zi,t.getValueTransition=Nn,t.getVariableValue=Qn,t.getVariantContext=br,t.getViewAnimationLayerInfo=Qs,t.getViewAnimations=to,t.globalProjectionState=va,t.has2DTranslate=Io,t.hasReducedMotionListener=Po,t.hasScale=Oo,t.hasTransform=Fo,t.hasWarned=function(t){return g.has(t)},t.hex=ut,t.hover=function(t,e,n={}){const[i,s,o]=os(t,n);return i.forEach(t=>{let n,i=!1,o=!1;const r=e=>{n&&(n(e),n=void 0),t.removeEventListener("pointerleave",l)},a=t=>{i=!1,window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",a),o&&(o=!1,r(t))},l=t=>{"touch"!==t.pointerType&&(i?o=!0:r(t))};t.addEventListener("pointerenter",i=>{if("touch"===i.pointerType||ss())return;o=!1;const r=e(t,i);"function"==typeof r&&(n=r,t.addEventListener("pointerleave",l,s))},s),t.addEventListener("pointerdown",()=>{i=!0,window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",a,s)},s)}),o},t.hsla=vt,t.hslaToRgba=kt,t.inView=function(t,e,{root:n,margin:i,amount:s="some"}={}){const o=Wi(t),r=new WeakMap,a=new IntersectionObserver(t=>{t.forEach(t=>{const n=r.get(t.target);if(t.isIntersecting!==Boolean(n))if(t.isIntersecting){const n=e(t.target,t);"function"==typeof n?r.set(t.target,n):a.unobserve(t.target)}else"function"==typeof n&&(n(t),r.delete(t.target))})},{root:n,rootMargin:i,threshold:"number"==typeof s?s:nc[s]});return o.forEach(t=>a.observe(t)),()=>a.disconnect()},t.inertia=ye,t.initPrefersReducedMotion=Eo,t.interpolate=ge,t.invisibleValues=Ot,t.isAnimationControls=vo,t.isBezierDefinition=O,t.isCSSVariableName=q,t.isCSSVariableToken=_,t.isControllingVariants=bo,t.isDeltaZero=Gr,t.isDragActive=ss,t.isDragging=is,t.isEasingArray=L,t.isElementKeyboardAccessible=cs,t.isElementTextInput=function(t){return us.has(t.tagName)||!0===t.isContentEditable},t.isForcedMotionValue=ar,t.isGenerator=mn,t.isHTMLElement=qi,t.isKeyframesTarget=si,t.isMotionValue=li,t.isNear=Rr,t.isNodeOrChild=rs,t.isNumericalString=r,t.isObject=a,t.isPrimaryPointer=as,t.isSVGElement=gs,t.isSVGSVGElement=Bs,t.isSVGTag=gr,t.isTransitionDefined=Xn,t.isVariantLabel=xo,t.isVariantNode=So,t.isWaapiSupportedEasing=function t(e){return Boolean("function"==typeof e&&cn()||!e||"string"==typeof e&&(e in hn||cn())||O(e)||Array.isArray(e)&&e.every(t))},t.isWillChangeMotionValue=ci,t.isZeroValueString=l,t.keyframes=be,t.makeAnimationInstant=Tn,t.mapEasingToNativeEasing=dn,t.mapValue=function(t,e,n,i){const s=Ls(e,n,i);return $s(()=>s(t.get()))},t.maxGeneratorDuration=Xt,t.measurePageBox=function(t,e,n){const i=_o(t,n),{scroll:s}=e;return s&&(Go(i.x,s.offset.x),Go(i.y,s.offset.y)),i},t.measureViewportBox=_o,t.memo=c,t.microtask=es,t.millisecondsToSeconds=f,t.mirrorEasing=b,t.mix=zt,t.mixArray=Nt,t.mixColor=jt,t.mixComplex=Ut,t.mixImmediate=Dt,t.mixLinearColor=Bt,t.mixNumber=Ct,t.mixObject=Wt,t.mixValues=oa,t.mixVisibility=Ft,t.motionValue=In,t.moveItem=function([...t],e,n){const i=e<0?t.length+e:e;if(i>=0&&it.forEach(Za);return{add:i=>{t.add(i),e.set(i,i.addEventListener("willUpdate",n))},remove:i=>{t.delete(i);const s=e.get(i);s&&(s(),e.delete(i)),n()},dirty:n}},t.noop=u,t.number=tt,t.numberValueTypes=Di,t.observeTimeline=Ds,t.optimizedAppearDataAttribute=pi,t.optimizedAppearDataId=di,t.parseAnimateLayoutArgs=function(t,e,n){return"function"==typeof t?{scope:document,updateDom:t,defaultOptions:e}:{scope:t instanceof Document?t:Wi(t)[0]??document,updateDom:e,defaultOptions:n}},t.parseCSSVariable=Jn,t.parseValueFromTransform=$e,t.percent=pt,t.pipe=h,t.pixelsToPercent=ir,t.positionalKeys=ii,t.prefersReducedMotion=Vo,t.press=function(t,e,n={}){const[i,s,o]=os(t,n),r=t=>{const i=t.currentTarget;if(!ms(t))return;if(fs.has(t))return;hs.add(i),n.stopPropagation&&fs.add(t);const o=e(i,t),r={...s,capture:!0},a=(t,e)=>{window.removeEventListener("pointerup",l,r),window.removeEventListener("pointercancel",c,r),hs.has(i)&&hs.delete(i),ms(t)&&"function"==typeof o&&o(t,{success:e})},l=t=>{a(t,i===window||i===document||n.useGlobalTarget||rs(i,t.target))},c=t=>{a(t,!1)};window.addEventListener("pointerup",l,r),window.addEventListener("pointercancel",c,r)};return i.forEach(t=>{(n.useGlobalTarget?window:t).addEventListener("pointerdown",r,s),qi(t)&&(t.addEventListener("focus",t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const i=ds(()=>{if(hs.has(n))return;ps(n,"down");const t=ds(()=>{ps(n,"up")});n.addEventListener("keyup",t,e),n.addEventListener("blur",()=>ps(n,"cancel"),e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)})(t,s)),cs(t)||t.hasAttribute("tabindex")||(t.tabIndex=0))}),o},t.progress=d,t.progressPercentage=gt,t.propEffect=Hi,t.propagateDirtyNodes=Ma,t.px=mt,t.readTransformValue=Ne,t.recordStats=function(){if(Cs.value)throw Cs.value=null,Cs.addProjectionMetrics=null,new Error("Stats are already being measured");const t=Cs;t.value={layoutProjection:{nodes:[],calculatedTargetDeltas:[],calculatedProjections:[]}},t.addProjectionMetrics=e=>{const{layoutProjection:n}=t.value;n.nodes.push(e.nodes),n.calculatedTargetDeltas.push(e.calculatedTargetDeltas),n.calculatedProjections.push(e.calculatedProjections)}},t.removeAxisDelta=Wr,t.removeAxisTransforms=Ur,t.removeBoxTransforms=Yr,t.removeItem=n,t.removePointDelta=Nr,t.renderHTML=nr,t.renderSVG=vr,t.resize=ks,t.resolveElements=Wi,t.resolveMotionValue=ya,t.resolveTransition=$n,t.resolveVariant=ni,t.resolveVariantFromProps=ei,t.reverseEasing=S,t.rgbUnit=lt,t.rgba=ct,t.rootProjectionNode=_a,t.scale=nt,t.scaleCorrectors=rr,t.scalePoint=No,t.scrapeHTMLMotionValuesFromProps=lr,t.scrapeSVGMotionValuesFromProps=xr,t.scroll=function(t,{axis:e="y",container:n=document.scrollingElement,...i}={}){if(!n)return u;const s={axis:e,container:n,...i};return"function"==typeof t?function(t,e){return function(t){return 2===t.length}(t)||function(t){return t&&(t.target||t.offset)}(e)?Gl(n=>{t(n[e.axis].progress,n)},e):Ds(t,ec(e))}(t,s):function(t,e){const n=ec(e),i=e.target?Jl(e.offset):void 0,s=e.target?Dl(e.target)&&!!i:Dl();return t.attachTimeline({timeline:s?n:void 0,...i&&s&&{rangeStart:i.rangeStart,rangeEnd:i.rangeEnd},observe:t=>(t.pause(),Ds(e=>{t.time=t.iterationDuration*e},n))})}(t,s)},t.scrollInfo=Gl,t.secondsToMilliseconds=m,t.setDragLock=function(t){return"x"===t||"y"===t?is[t]?null:(is[t]=!0,()=>{is[t]=!1}):is.x||is.y?null:(is.x=is.y=!0,()=>{is.x=is.y=!1})},t.setFeatureDefinitions=function(t){Do=t},t.setStyle=sn,t.setTarget=ai,t.spring=me,t.springValue=function(t,e){return js(t,{type:"spring",...e})},t.stagger=function(t=.1,{startDelay:e=0,from:n=0,ease:i}={}){return(s,o)=>{const r="number"==typeof n?n:Rs(n,o),a=Math.abs(r-s);let l=t*a;if(i){const e=o*t;l=I(i)(l/e)*e}return e+l}},t.startWaapiAnimation=pn,t.statsBuffer=Cs,t.steps=function(t,e="end"){return n=>{const s=(n="end"===e?Math.min(n,.999):Math.max(n,.001))*t,o="end"===e?Math.floor(s):Math.ceil(s);return i(0,1,o/t)}},t.styleEffect=Qi,t.supportedWaapiEasing=hn,t.supportsBrowserAnimation=Pn,t.supportsFlags=on,t.supportsLinearEasing=cn,t.supportsPartialKeyframes=Ni,t.supportsScrollTimeline=an,t.supportsViewTimeline=ln,t.svgEffect=ts,t.sync=al,t.testValueType=xi,t.time=G,t.transform=Ls,t.transformAxis=Ho,t.transformBox=Zo,t.transformBoxPoints=Lo,t.transformPropOrder=Ue,t.transformProps=ze,t.transformValue=$s,t.transformValueTypes=ki,t.translateAxis=Go,t.updateMotionValuesFromProps=Ao,t.variantPriorityOrder=wo,t.variantProps=To,t.velocityPerSecond=y,t.vh=ft,t.visualElementStore=go,t.vw=yt,t.warnOnce=v,t.wrap=x}); diff --git a/node_modules/framer-motion/dist/es/animation/animate/index.mjs b/node_modules/framer-motion/dist/es/animation/animate/index.mjs deleted file mode 100644 index 0e98ea4..0000000 --- a/node_modules/framer-motion/dist/es/animation/animate/index.mjs +++ /dev/null @@ -1,58 +0,0 @@ -import { GroupAnimationWithThen } from 'motion-dom'; -import { removeItem } from 'motion-utils'; -import { animateSequence } from './sequence.mjs'; -import { animateSubject } from './subject.mjs'; - -function isSequence(value) { - return Array.isArray(value) && value.some(Array.isArray); -} -/** - * Creates an animation function that is optionally scoped - * to a specific element. - */ -function createScopedAnimate(options = {}) { - const { scope, reduceMotion, skipAnimations } = options; - /** - * Implementation - */ - function scopedAnimate(subjectOrSequence, optionsOrKeyframes, options) { - let animations = []; - let animationOnComplete; - const inherited = {}; - if (reduceMotion !== undefined) - inherited.reduceMotion = reduceMotion; - if (skipAnimations !== undefined) - inherited.skipAnimations = skipAnimations; - if (isSequence(subjectOrSequence)) { - const { onComplete, ...sequenceOptions } = optionsOrKeyframes || {}; - if (typeof onComplete === "function") { - animationOnComplete = onComplete; - } - animations = animateSequence(subjectOrSequence, { ...inherited, ...sequenceOptions }, scope); - } - else { - // Extract top-level onComplete so it doesn't get applied per-value - const { onComplete, ...rest } = options || {}; - if (typeof onComplete === "function") { - animationOnComplete = onComplete; - } - animations = animateSubject(subjectOrSequence, optionsOrKeyframes, { ...inherited, ...rest }, scope); - } - const animation = new GroupAnimationWithThen(animations); - if (animationOnComplete) { - animation.finished.then(animationOnComplete); - } - if (scope) { - scope.animations.push(animation); - animation.finished.then(() => { - removeItem(scope.animations, animation); - }); - } - return animation; - } - return scopedAnimate; -} -const animate = createScopedAnimate(); - -export { animate, createScopedAnimate }; -//# sourceMappingURL=index.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/animate/index.mjs.map b/node_modules/framer-motion/dist/es/animation/animate/index.mjs.map deleted file mode 100644 index 9fe05f8..0000000 --- a/node_modules/framer-motion/dist/es/animation/animate/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs","sources":["../../../../src/animation/animate/index.ts"],"sourcesContent":["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,\n keyframes: string | UnresolvedValueKeyframe[],\n options?: ValueAnimationTransition\n ): AnimationPlaybackControlsWithThen\n /**\n * Animate a number\n */\n function scopedAnimate(\n value: number | MotionValue,\n keyframes: number | UnresolvedValueKeyframe[],\n options?: ValueAnimationTransition\n ): AnimationPlaybackControlsWithThen\n /**\n * Animate a generic motion value\n */\n function scopedAnimate(\n value: V | MotionValue,\n keyframes: V | UnresolvedValueKeyframe[],\n options?: ValueAnimationTransition\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(\n object: O | O[],\n keyframes: ObjectTarget,\n options?: DynamicAnimationOptions\n ): AnimationPlaybackControlsWithThen\n /**\n * Implementation\n */\n function scopedAnimate(\n subjectOrSequence:\n | AnimationSequence\n | MotionValue\n | MotionValue\n | number\n | string\n | ElementOrSelector\n | O\n | O[],\n optionsOrKeyframes?:\n | SequenceOptions\n | number\n | string\n | UnresolvedValueKeyframe[]\n | UnresolvedValueKeyframe[]\n | DOMKeyframesDefinition\n | ObjectTarget,\n options?:\n | ValueAnimationTransition\n | ValueAnimationTransition\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"],"names":[],"mappings":";;;;;AAoBA,SAAS,UAAU,CAAC,KAAc,EAAA;AAC9B,IAAA,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;AAC5D;AAQA;;;AAGG;AACG,SAAU,mBAAmB,CAAC,OAAA,GAAgC,EAAE,EAAA;IAClE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,GAAG,OAAO;AAgDvD;;AAEG;AACH,IAAA,SAAS,aAAa,CAClB,iBAQS,EACT,kBAOqB,EACrB,OAG6B,EAAA;QAE7B,IAAI,UAAU,GAAwC,EAAE;AACxD,QAAA,IAAI,mBAA6C;QAEjD,MAAM,SAAS,GACX,EAAE;QACN,IAAI,YAAY,KAAK,SAAS;AAAE,YAAA,SAAS,CAAC,YAAY,GAAG,YAAY;QACrE,IAAI,cAAc,KAAK,SAAS;AAC5B,YAAA,SAAS,CAAC,cAAc,GAAG,cAAc;AAE7C,QAAA,IAAI,UAAU,CAAC,iBAAiB,CAAC,EAAE;YAC/B,MAAM,EAAE,UAAU,EAAE,GAAG,eAAe,EAAE,GACnC,kBAAsC,IAAI,EAAE;AACjD,YAAA,IAAI,OAAO,UAAU,KAAK,UAAU,EAAE;gBAClC,mBAAmB,GAAG,UAA0B;YACpD;AACA,YAAA,UAAU,GAAG,eAAe,CACxB,iBAAiB,EACjB,EAAE,GAAG,SAAS,EAAE,GAAG,eAAe,EAAqB,EACvD,KAAK,CACR;QACL;aAAO;;YAEH,MAAM,EAAE,UAAU,EAAE,GAAG,IAAI,EAAE,GAAG,OAAO,IAAI,EAAE;AAC7C,YAAA,IAAI,OAAO,UAAU,KAAK,UAAU,EAAE;gBAClC,mBAAmB,GAAG,UAA0B;YACpD;AACA,YAAA,UAAU,GAAG,cAAc,CACvB,iBAAsC,EACtC,kBAA4C,EAC5C,EAAE,GAAG,SAAS,EAAE,GAAG,IAAI,EAA6B,EACpD,KAAK,CACR;QACL;AAEA,QAAA,MAAM,SAAS,GAAG,IAAI,sBAAsB,CAAC,UAAU,CAAC;QAExD,IAAI,mBAAmB,EAAE;AACrB,YAAA,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,mBAAmB,CAAC;QAChD;QAEA,IAAI,KAAK,EAAE;AACP,YAAA,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC;AAChC,YAAA,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAK;AACzB,gBAAA,UAAU,CAAC,KAAK,CAAC,UAAU,EAAE,SAAS,CAAC;AAC3C,YAAA,CAAC,CAAC;QACN;AAEA,QAAA,OAAO,SAAS;IACpB;AAEA,IAAA,OAAO,aAAa;AACxB;AAEO,MAAM,OAAO,GAAG,mBAAmB;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/animation/animate/resolve-subjects.mjs b/node_modules/framer-motion/dist/es/animation/animate/resolve-subjects.mjs deleted file mode 100644 index 3888e74..0000000 --- a/node_modules/framer-motion/dist/es/animation/animate/resolve-subjects.mjs +++ /dev/null @@ -1,23 +0,0 @@ -import { resolveElements } from 'motion-dom'; -import { isDOMKeyframes } from '../utils/is-dom-keyframes.mjs'; - -function resolveSubjects(subject, keyframes, scope, selectorCache) { - if (subject == null) { - return []; - } - if (typeof subject === "string" && isDOMKeyframes(keyframes)) { - return resolveElements(subject, scope, selectorCache); - } - else if (subject instanceof NodeList) { - return Array.from(subject); - } - else if (Array.isArray(subject)) { - return subject.filter((s) => s != null); - } - else { - return [subject]; - } -} - -export { resolveSubjects }; -//# sourceMappingURL=resolve-subjects.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/animate/resolve-subjects.mjs.map b/node_modules/framer-motion/dist/es/animation/animate/resolve-subjects.mjs.map deleted file mode 100644 index 0429e09..0000000 --- a/node_modules/framer-motion/dist/es/animation/animate/resolve-subjects.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"resolve-subjects.mjs","sources":["../../../../src/animation/animate/resolve-subjects.ts"],"sourcesContent":["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(\n subject:\n | string\n | Element\n | Element[]\n | NodeListOf\n | O\n | O[]\n | null\n | undefined,\n keyframes: DOMKeyframesDefinition | ObjectTarget,\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"],"names":[],"mappings":";;;AASM,SAAU,eAAe,CAC3B,OAQe,EACf,SAAmD,EACnD,KAAsB,EACtB,aAA6B,EAAA;AAE7B,IAAA,IAAI,OAAO,IAAI,IAAI,EAAE;AACjB,QAAA,OAAO,EAAE;IACb;IAEA,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,cAAc,CAAC,SAAS,CAAC,EAAE;QAC1D,OAAO,eAAe,CAAC,OAAO,EAAE,KAAK,EAAE,aAAa,CAAC;IACzD;AAAO,SAAA,IAAI,OAAO,YAAY,QAAQ,EAAE;AACpC,QAAA,OAAO,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC;IAC9B;AAAO,SAAA,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;AAC/B,QAAA,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC;IAC3C;SAAO;QACH,OAAO,CAAC,OAAO,CAAC;IACpB;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/animation/animate/sequence.mjs b/node_modules/framer-motion/dist/es/animation/animate/sequence.mjs deleted file mode 100644 index c19af7a..0000000 --- a/node_modules/framer-motion/dist/es/animation/animate/sequence.mjs +++ /dev/null @@ -1,36 +0,0 @@ -import { motionValue, spring } from 'motion-dom'; -import { createAnimationsFromSequence } from '../sequence/create.mjs'; -import { animateSubject } from './subject.mjs'; - -function animateSequence(sequence, options, scope) { - const animations = []; - /** - * Pre-process: replace function segments with MotionValue segments, - * subscribe callbacks immediately - */ - const processedSequence = sequence.map((segment) => { - if (Array.isArray(segment) && typeof segment[0] === "function") { - const callback = segment[0]; - const mv = motionValue(0); - mv.on("change", callback); - if (segment.length === 1) { - return [mv, [0, 1]]; - } - else if (segment.length === 2) { - return [mv, [0, 1], segment[1]]; - } - else { - return [mv, segment[1], segment[2]]; - } - } - return segment; - }); - const animationDefinitions = createAnimationsFromSequence(processedSequence, options, scope, { spring }); - animationDefinitions.forEach(({ keyframes, transition }, subject) => { - animations.push(...animateSubject(subject, keyframes, transition)); - }); - return animations; -} - -export { animateSequence }; -//# sourceMappingURL=sequence.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/animate/sequence.mjs.map b/node_modules/framer-motion/dist/es/animation/animate/sequence.mjs.map deleted file mode 100644 index 871f6c3..0000000 --- a/node_modules/framer-motion/dist/es/animation/animate/sequence.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sequence.mjs","sources":["../../../../src/animation/animate/sequence.ts"],"sourcesContent":["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"],"names":[],"mappings":";;;;SAUgB,eAAe,CAC3B,QAA2B,EAC3B,OAAyB,EACzB,KAAsB,EAAA;IAEtB,MAAM,UAAU,GAAwC,EAAE;AAE1D;;;AAGG;IACH,MAAM,iBAAiB,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,KAAI;AAC/C,QAAA,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,OAAO,OAAO,CAAC,CAAC,CAAC,KAAK,UAAU,EAAE;AAC5D,YAAA,MAAM,QAAQ,GAAG,OAAO,CAAC,CAAC,CAAyB;AACnD,YAAA,MAAM,EAAE,GAAG,WAAW,CAAC,CAAC,CAAC;AACzB,YAAA,EAAE,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC;AAEzB,YAAA,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE;gBACtB,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAQ;YAC9B;AAAO,iBAAA,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE;AAC7B,gBAAA,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAQ;YAC1C;iBAAO;AACH,gBAAA,OAAO,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAQ;YAC9C;QACJ;AACA,QAAA,OAAO,OAAO;AAClB,IAAA,CAAC,CAAsB;AAEvB,IAAA,MAAM,oBAAoB,GAAG,4BAA4B,CACrD,iBAAiB,EACjB,OAAO,EACP,KAAK,EACL,EAAE,MAAM,EAAE,CACb;AAED,IAAA,oBAAoB,CAAC,OAAO,CAAC,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,EAAE,OAAO,KAAI;AAChE,QAAA,UAAU,CAAC,IAAI,CAAC,GAAG,cAAc,CAAC,OAAO,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;AACtE,IAAA,CAAC,CAAC;AAEF,IAAA,OAAO,UAAU;AACrB;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/animation/animate/subject.mjs b/node_modules/framer-motion/dist/es/animation/animate/subject.mjs deleted file mode 100644 index c509d68..0000000 --- a/node_modules/framer-motion/dist/es/animation/animate/subject.mjs +++ /dev/null @@ -1,54 +0,0 @@ -import { animateSingleValue, visualElementStore, animateTarget, isMotionValue } from 'motion-dom'; -import { invariant } from 'motion-utils'; -import { createDOMVisualElement, createObjectVisualElement } from '../utils/create-visual-element.mjs'; -import { isDOMKeyframes } from '../utils/is-dom-keyframes.mjs'; -import { resolveSubjects } from './resolve-subjects.mjs'; - -function isSingleValue(subject, keyframes) { - return (isMotionValue(subject) || - typeof subject === "number" || - (typeof subject === "string" && !isDOMKeyframes(keyframes))); -} -/** - * Implementation - */ -function animateSubject(subject, keyframes, options, scope) { - const animations = []; - if (isSingleValue(subject, keyframes)) { - animations.push(animateSingleValue(subject, isDOMKeyframes(keyframes) - ? keyframes.default || keyframes - : keyframes, options ? options.default || options : options)); - } - else { - // Gracefully handle null/undefined subjects (e.g., from querySelector returning null) - if (subject == null) { - return animations; - } - const subjects = resolveSubjects(subject, keyframes, scope); - const numSubjects = subjects.length; - invariant(Boolean(numSubjects), "No valid elements provided.", "no-valid-elements"); - for (let i = 0; i < numSubjects; i++) { - const thisSubject = subjects[i]; - const createVisualElement = thisSubject instanceof Element - ? createDOMVisualElement - : createObjectVisualElement; - if (!visualElementStore.has(thisSubject)) { - createVisualElement(thisSubject); - } - const visualElement = visualElementStore.get(thisSubject); - const transition = { ...options }; - /** - * Resolve stagger function if provided. - */ - if ("delay" in transition && - typeof transition.delay === "function") { - transition.delay = transition.delay(i, numSubjects); - } - animations.push(...animateTarget(visualElement, { ...keyframes, transition }, {})); - } - } - return animations; -} - -export { animateSubject }; -//# sourceMappingURL=subject.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/animate/subject.mjs.map b/node_modules/framer-motion/dist/es/animation/animate/subject.mjs.map deleted file mode 100644 index f366b18..0000000 --- a/node_modules/framer-motion/dist/es/animation/animate/subject.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"subject.mjs","sources":["../../../../src/animation/animate/subject.ts"],"sourcesContent":["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\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,\n keyframes: string | UnresolvedValueKeyframe[],\n options?: ValueAnimationTransition\n): AnimationPlaybackControlsWithThen[]\n/**\n * Animate a number\n */\nexport function animateSubject(\n value: number | MotionValue,\n keyframes: number | UnresolvedValueKeyframe[],\n options?: ValueAnimationTransition\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(\n object: O | O[],\n keyframes: ObjectTarget,\n options?: DynamicAnimationOptions\n): AnimationPlaybackControlsWithThen[]\n/**\n * Implementation\n */\nexport function animateSubject(\n subject:\n | MotionValue\n | MotionValue\n | number\n | string\n | ElementOrSelector\n | O\n | O[],\n keyframes:\n | number\n | string\n | UnresolvedValueKeyframe[]\n | UnresolvedValueKeyframe[]\n | DOMKeyframesDefinition\n | ObjectTarget,\n options?:\n | ValueAnimationTransition\n | ValueAnimationTransition\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"],"names":[],"mappings":";;;;;;AA2BA,SAAS,aAAa,CAClB,OAAgB,EAChB,SAAkB,EAAA;AAElB,IAAA,QACI,aAAa,CAAC,OAAO,CAAC;QACtB,OAAO,OAAO,KAAK,QAAQ;AAC3B,SAAC,OAAO,OAAO,KAAK,QAAQ,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;AAEnE;AAmCA;;AAEG;AACG,SAAU,cAAc,CAC1B,OAOS,EACT,SAMqB,EACrB,OAG6B,EAC7B,KAAsB,EAAA;IAEtB,MAAM,UAAU,GAAwC,EAAE;AAE1D,IAAA,IAAI,aAAa,CAAC,OAAO,EAAE,SAAS,CAAC,EAAE;QACnC,UAAU,CAAC,IAAI,CACX,kBAAkB,CACd,OAAO,EACP,cAAc,CAAC,SAAS;AACpB,cAAG,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/animation/animators/waapi/animate-elements.mjs b/node_modules/framer-motion/dist/es/animation/animators/waapi/animate-elements.mjs deleted file mode 100644 index ce71645..0000000 --- a/node_modules/framer-motion/dist/es/animation/animators/waapi/animate-elements.mjs +++ /dev/null @@ -1,110 +0,0 @@ -import { resolveElements, getValueTransition, getAnimationMap, animationMapKey, getComputedStyle, fillWildcards, applyPxDefaults, NativeAnimation } from 'motion-dom'; -import { invariant, secondsToMilliseconds } from 'motion-utils'; - -function animateElements(elementOrSelector, keyframes, options, scope) { - // Gracefully handle null/undefined elements (e.g., from querySelector returning null) - if (elementOrSelector == null) { - return []; - } - const elements = resolveElements(elementOrSelector, scope); - const numElements = elements.length; - invariant(Boolean(numElements), "No valid elements provided.", "no-valid-elements"); - /** - * WAAPI doesn't support interrupting animations. - * - * Therefore, starting animations requires a three-step process: - * 1. Stop existing animations (write styles to DOM) - * 2. Resolve keyframes (read styles from DOM) - * 3. Create new animations (write styles to DOM) - * - * The hybrid `animate()` function uses AsyncAnimation to resolve - * keyframes before creating new animations, which removes style - * thrashing. Here, we have much stricter filesize constraints. - * Therefore we do this in a synchronous way that ensures that - * at least within `animate()` calls there is no style thrashing. - * - * In the motion-native-animate-mini-interrupt benchmark this - * was 80% faster than a single loop. - */ - const animationDefinitions = []; - /** - * Step 1: Build options and stop existing animations (write) - */ - for (let i = 0; i < numElements; i++) { - const element = elements[i]; - const elementTransition = { ...options }; - /** - * Resolve stagger function if provided. - */ - if (typeof elementTransition.delay === "function") { - elementTransition.delay = elementTransition.delay(i, numElements); - } - for (const valueName in keyframes) { - let valueKeyframes = keyframes[valueName]; - if (!Array.isArray(valueKeyframes)) { - valueKeyframes = [valueKeyframes]; - } - const valueOptions = { - ...getValueTransition(elementTransition, valueName), - }; - valueOptions.duration && (valueOptions.duration = secondsToMilliseconds(valueOptions.duration)); - valueOptions.delay && (valueOptions.delay = secondsToMilliseconds(valueOptions.delay)); - /** - * If there's an existing animation playing on this element then stop it - * before creating a new one. - */ - const map = getAnimationMap(element); - const key = animationMapKey(valueName, valueOptions.pseudoElement || ""); - const currentAnimation = map.get(key); - currentAnimation && currentAnimation.stop(); - animationDefinitions.push({ - map, - key, - unresolvedKeyframes: valueKeyframes, - options: { - ...valueOptions, - element, - name: valueName, - allowFlatten: !elementTransition.type && !elementTransition.ease, - }, - }); - } - } - /** - * Step 2: Resolve keyframes (read) - */ - for (let i = 0; i < animationDefinitions.length; i++) { - const { unresolvedKeyframes, options: animationOptions } = animationDefinitions[i]; - const { element, name, pseudoElement } = animationOptions; - if (!pseudoElement && unresolvedKeyframes[0] === null) { - unresolvedKeyframes[0] = getComputedStyle(element, name); - } - fillWildcards(unresolvedKeyframes); - applyPxDefaults(unresolvedKeyframes, name); - /** - * If we only have one keyframe, explicitly read the initial keyframe - * from the computed style. This is to ensure consistency with WAAPI behaviour - * for restarting animations, for instance .play() after finish, when it - * has one vs two keyframes. - */ - if (!pseudoElement && unresolvedKeyframes.length < 2) { - unresolvedKeyframes.unshift(getComputedStyle(element, name)); - } - animationOptions.keyframes = unresolvedKeyframes; - } - /** - * Step 3: Create new animations (write) - */ - const animations = []; - for (let i = 0; i < animationDefinitions.length; i++) { - const { map, key, options: animationOptions } = animationDefinitions[i]; - const animation = new NativeAnimation(animationOptions); - map.set(key, animation); - animation.finished.finally(() => map.delete(key)); - animations.push(animation); - } - return animations; -} - -export { animateElements }; -//# sourceMappingURL=animate-elements.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/animators/waapi/animate-elements.mjs.map b/node_modules/framer-motion/dist/es/animation/animators/waapi/animate-elements.mjs.map deleted file mode 100644 index ee9f79e..0000000 --- a/node_modules/framer-motion/dist/es/animation/animators/waapi/animate-elements.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"animate-elements.mjs","sources":["../../../../../src/animation/animators/waapi/animate-elements.ts"],"sourcesContent":["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>\n key: string\n unresolvedKeyframes: UnresolvedValueKeyframe[]\n options: Omit & {\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"],"names":[],"mappings":";;;AA6BM,SAAU,eAAe,CAC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AAG,CAAC,EAAE;YAClD,mBAAmB,CAAC,OAAO,CAAC,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QAChE;AAEA,QAAA,gBAAgB,CAAC,SAAS,GAAG,mBAAsC;IACvE;AAEA;;AAEG;IACH,MAAM,UAAU,GAAgC,EAAE;AAClD,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,oBAAoB,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AAClD,QAAA,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,gBAAgB,EAAE,GAAG,oBAAoB,CAAC,CAAC,CAAC;AACvE,QAAA,MAAM,SAAS,GAAG,IAAI,eAAe,CACjC,gBAA0C,CAC7C;AAED,QAAA,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,SAAS,CAAC;AACvB,QAAA,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;AAEjD,QAAA,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC;IAC9B;AAEA,IAAA,OAAO,UAAU;AACrB;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/animation/animators/waapi/animate-sequence.mjs b/node_modules/framer-motion/dist/es/animation/animators/waapi/animate-sequence.mjs deleted file mode 100644 index b4a8bf0..0000000 --- a/node_modules/framer-motion/dist/es/animation/animators/waapi/animate-sequence.mjs +++ /dev/null @@ -1,14 +0,0 @@ -import { GroupAnimationWithThen } from 'motion-dom'; -import { createAnimationsFromSequence } from '../../sequence/create.mjs'; -import { animateElements } from './animate-elements.mjs'; - -function animateSequence(definition, options) { - const animations = []; - createAnimationsFromSequence(definition, options).forEach(({ keyframes, transition }, element) => { - animations.push(...animateElements(element, keyframes, transition)); - }); - return new GroupAnimationWithThen(animations); -} - -export { animateSequence }; -//# sourceMappingURL=animate-sequence.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/animators/waapi/animate-sequence.mjs.map b/node_modules/framer-motion/dist/es/animation/animators/waapi/animate-sequence.mjs.map deleted file mode 100644 index 07108a2..0000000 --- a/node_modules/framer-motion/dist/es/animation/animators/waapi/animate-sequence.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"animate-sequence.mjs","sources":["../../../../../src/animation/animators/waapi/animate-sequence.ts"],"sourcesContent":["import { AnimationPlaybackControls, GroupAnimationWithThen } from \"motion-dom\"\nimport { createAnimationsFromSequence } from \"../../sequence/create\"\nimport { AnimationSequence, SequenceOptions } from \"../../sequence/types\"\nimport { animateElements } from \"./animate-elements\"\n\nexport function animateSequence(\n definition: AnimationSequence,\n options?: SequenceOptions\n) {\n const animations: AnimationPlaybackControls[] = []\n\n createAnimationsFromSequence(definition, options).forEach(\n ({ keyframes, transition }, element: Element) => {\n animations.push(...animateElements(element, keyframes, transition))\n }\n )\n\n return new GroupAnimationWithThen(animations)\n}\n"],"names":[],"mappings":";;;;AAKM,SAAU,eAAe,CAC3B,UAA6B,EAC7B,OAAyB,EAAA;IAEzB,MAAM,UAAU,GAAgC,EAAE;AAElD,IAAA,4BAA4B,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC,OAAO,CACrD,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,EAAE,OAAgB,KAAI;AAC5C,QAAA,UAAU,CAAC,IAAI,CAAC,GAAG,eAAe,CAAC,OAAO,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;AACvE,IAAA,CAAC,CACJ;AAED,IAAA,OAAO,IAAI,sBAAsB,CAAC,UAAU,CAAC;AACjD;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/animation/animators/waapi/animate-style.mjs b/node_modules/framer-motion/dist/es/animation/animators/waapi/animate-style.mjs deleted file mode 100644 index 070daf1..0000000 --- a/node_modules/framer-motion/dist/es/animation/animators/waapi/animate-style.mjs +++ /dev/null @@ -1,13 +0,0 @@ -import { GroupAnimationWithThen } from 'motion-dom'; -import { animateElements } from './animate-elements.mjs'; - -const createScopedWaapiAnimate = (scope) => { - function scopedAnimate(elementOrSelector, keyframes, options) { - return new GroupAnimationWithThen(animateElements(elementOrSelector, keyframes, options, scope)); - } - return scopedAnimate; -}; -const animateMini = /*@__PURE__*/ createScopedWaapiAnimate(); - -export { animateMini, createScopedWaapiAnimate }; -//# sourceMappingURL=animate-style.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/animators/waapi/animate-style.mjs.map b/node_modules/framer-motion/dist/es/animation/animators/waapi/animate-style.mjs.map deleted file mode 100644 index eda8aac..0000000 --- a/node_modules/framer-motion/dist/es/animation/animators/waapi/animate-style.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"animate-style.mjs","sources":["../../../../../src/animation/animators/waapi/animate-style.ts"],"sourcesContent":["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"],"names":[],"mappings":";;;AAUO,MAAM,wBAAwB,GAAG,CAAC,KAAsB,KAAI;AAC/D,IAAA,SAAS,aAAa,CAClB,iBAAoC,EACpC,SAAiC,EACjC,OAAiC,EAAA;AAEjC,QAAA,OAAO,IAAI,sBAAsB,CAC7B,eAAe,CACX,iBAAiB,EACjB,SAAmC,EACnC,OAAO,EACP,KAAK,CACR,CACJ;IACL;AAEA,IAAA,OAAO,aAAa;AACxB;MAEa,WAAW,iBAAiB,wBAAwB;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/animation/hooks/animation-controls.mjs b/node_modules/framer-motion/dist/es/animation/hooks/animation-controls.mjs deleted file mode 100644 index 7fd8c21..0000000 --- a/node_modules/framer-motion/dist/es/animation/hooks/animation-controls.mjs +++ /dev/null @@ -1,80 +0,0 @@ -import { animateVisualElement, setTarget } from 'motion-dom'; -import { invariant } from 'motion-utils'; - -function stopAnimation(visualElement) { - visualElement.values.forEach((value) => value.stop()); -} -function setVariants(visualElement, variantLabels) { - const reversedLabels = [...variantLabels].reverse(); - reversedLabels.forEach((key) => { - const variant = visualElement.getVariant(key); - variant && setTarget(visualElement, variant); - if (visualElement.variantChildren) { - visualElement.variantChildren.forEach((child) => { - setVariants(child, variantLabels); - }); - } - }); -} -function setValues(visualElement, definition) { - if (Array.isArray(definition)) { - return setVariants(visualElement, definition); - } - else if (typeof definition === "string") { - return setVariants(visualElement, [definition]); - } - else { - setTarget(visualElement, definition); - } -} -/** - * @public - */ -function animationControls() { - /** - * Track whether the host component has mounted. - */ - let hasMounted = false; - /** - * A collection of linked component animation controls. - */ - const subscribers = new Set(); - const controls = { - subscribe(visualElement) { - subscribers.add(visualElement); - return () => void subscribers.delete(visualElement); - }, - start(definition, transitionOverride) { - invariant(hasMounted, "controls.start() should only be called after a component has mounted. Consider calling within a useEffect hook."); - const animations = []; - subscribers.forEach((visualElement) => { - animations.push(animateVisualElement(visualElement, definition, { - transitionOverride, - })); - }); - return Promise.all(animations); - }, - set(definition) { - invariant(hasMounted, "controls.set() should only be called after a component has mounted. Consider calling within a useEffect hook."); - return subscribers.forEach((visualElement) => { - setValues(visualElement, definition); - }); - }, - stop() { - subscribers.forEach((visualElement) => { - stopAnimation(visualElement); - }); - }, - mount() { - hasMounted = true; - return () => { - hasMounted = false; - controls.stop(); - }; - }, - }; - return controls; -} - -export { animationControls, setValues }; -//# sourceMappingURL=animation-controls.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/hooks/animation-controls.mjs.map b/node_modules/framer-motion/dist/es/animation/hooks/animation-controls.mjs.map deleted file mode 100644 index 3fd62d2..0000000 --- a/node_modules/framer-motion/dist/es/animation/hooks/animation-controls.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"animation-controls.mjs","sources":["../../../../src/animation/hooks/animation-controls.ts"],"sourcesContent":["import {\n animateVisualElement,\n setTarget,\n type AnimationDefinition,\n type LegacyAnimationControls,\n type VisualElement,\n} from \"motion-dom\"\nimport { invariant } from \"motion-utils\"\n\nfunction stopAnimation(visualElement: VisualElement) {\n visualElement.values.forEach((value) => value.stop())\n}\n\nfunction setVariants(visualElement: VisualElement, variantLabels: string[]) {\n const reversedLabels = [...variantLabels].reverse()\n\n reversedLabels.forEach((key) => {\n const variant = visualElement.getVariant(key)\n variant && setTarget(visualElement, variant)\n\n if (visualElement.variantChildren) {\n visualElement.variantChildren.forEach((child) => {\n setVariants(child, variantLabels)\n })\n }\n })\n}\n\nexport function setValues(\n visualElement: VisualElement,\n definition: AnimationDefinition\n) {\n if (Array.isArray(definition)) {\n return setVariants(visualElement, definition)\n } else if (typeof definition === \"string\") {\n return setVariants(visualElement, [definition])\n } else {\n setTarget(visualElement, definition as any)\n }\n}\n\n/**\n * @public\n */\nexport function animationControls(): LegacyAnimationControls {\n /**\n * Track whether the host component has mounted.\n */\n let hasMounted = false\n\n /**\n * A collection of linked component animation controls.\n */\n const subscribers = new Set()\n\n const controls: LegacyAnimationControls = {\n subscribe(visualElement) {\n subscribers.add(visualElement)\n return () => void subscribers.delete(visualElement)\n },\n\n start(definition, transitionOverride) {\n invariant(\n hasMounted,\n \"controls.start() should only be called after a component has mounted. Consider calling within a useEffect hook.\"\n )\n\n const animations: Array> = []\n subscribers.forEach((visualElement) => {\n animations.push(\n animateVisualElement(visualElement, definition, {\n transitionOverride,\n })\n )\n })\n\n return Promise.all(animations)\n },\n\n set(definition) {\n invariant(\n hasMounted,\n \"controls.set() should only be called after a component has mounted. Consider calling within a useEffect hook.\"\n )\n\n return subscribers.forEach((visualElement) => {\n setValues(visualElement, definition)\n })\n },\n\n stop() {\n subscribers.forEach((visualElement) => {\n stopAnimation(visualElement)\n })\n },\n\n mount() {\n hasMounted = true\n\n return () => {\n hasMounted = false\n controls.stop()\n }\n },\n }\n\n return controls\n}\n"],"names":[],"mappings":";;;AASA,SAAS,aAAa,CAAC,aAA4B,EAAA;AAC/C,IAAA,aAAa,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,IAAI,EAAE,CAAC;AACzD;AAEA,SAAS,WAAW,CAAC,aAA4B,EAAE,aAAuB,EAAA;IACtE,MAAM,cAAc,GAAG,CAAC,GAAG,aAAa,CAAC,CAAC,OAAO,EAAE;AAEnD,IAAA,cAAc,CAAC,OAAO,CAAC,CAAC,GAAG,KAAI;QAC3B,MAAM,OAAO,GAAG,aAAa,CAAC,UAAU,CAAC,GAAG,CAAC;AAC7C,QAAA,OAAO,IAAI,SAAS,CAAC,aAAa,EAAE,OAAO,CAAC;AAE5C,QAAA,IAAI,aAAa,CAAC,eAAe,EAAE;YAC/B,aAAa,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,KAAK,KAAI;AAC5C,gBAAA,WAAW,CAAC,KAAK,EAAE,aAAa,CAAC;AACrC,YAAA,CAAC,CAAC;QACN;AACJ,IAAA,CAAC,CAAC;AACN;AAEM,SAAU,SAAS,CACrB,aAA4B,EAC5B,UAA+B,EAAA;AAE/B,IAAA,IAAI,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;AAC3B,QAAA,OAAO,WAAW,CAAC,aAAa,EAAE,UAAU,CAAC;IACjD;AAAO,SAAA,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE;QACvC,OAAO,WAAW,CAAC,aAAa,EAAE,CAAC,UAAU,CAAC,CAAC;IACnD;SAAO;AACH,QAAA,SAAS,CAAC,aAAa,EAAE,UAAiB,CAAC;IAC/C;AACJ;AAEA;;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QAAQ;AACnB;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/animation/hooks/use-animate-style.mjs b/node_modules/framer-motion/dist/es/animation/hooks/use-animate-style.mjs deleted file mode 100644 index b2715b8..0000000 --- a/node_modules/framer-motion/dist/es/animation/hooks/use-animate-style.mjs +++ /dev/null @@ -1,19 +0,0 @@ -"use client"; -import { useConstant } from '../../utils/use-constant.mjs'; -import { useUnmountEffect } from '../../utils/use-unmount-effect.mjs'; -import { createScopedWaapiAnimate } from '../animators/waapi/animate-style.mjs'; - -function useAnimateMini() { - const scope = useConstant(() => ({ - current: null, // Will be hydrated by React - animations: [], - })); - const animate = useConstant(() => createScopedWaapiAnimate(scope)); - useUnmountEffect(() => { - scope.animations.forEach((animation) => animation.stop()); - }); - return [scope, animate]; -} - -export { useAnimateMini }; -//# sourceMappingURL=use-animate-style.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/hooks/use-animate-style.mjs.map b/node_modules/framer-motion/dist/es/animation/hooks/use-animate-style.mjs.map deleted file mode 100644 index 2ccff9f..0000000 --- a/node_modules/framer-motion/dist/es/animation/hooks/use-animate-style.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"use-animate-style.mjs","sources":["../../../../src/animation/hooks/use-animate-style.ts"],"sourcesContent":["\"use client\"\n\nimport { useConstant } from \"../../utils/use-constant\"\nimport { useUnmountEffect } from \"../../utils/use-unmount-effect\"\nimport { createScopedWaapiAnimate } from \"../animators/waapi/animate-style\"\nimport { AnimationScope } from \"motion-dom\"\n\nexport function useAnimateMini() {\n const scope: AnimationScope = useConstant(() => ({\n current: null!, // Will be hydrated by React\n animations: [],\n }))\n\n const animate = useConstant(() => createScopedWaapiAnimate(scope))\n\n useUnmountEffect(() => {\n scope.animations.forEach((animation) => animation.stop())\n })\n\n return [scope, animate] as [AnimationScope, typeof animate]\n}\n"],"names":[],"mappings":";;;;;;AAQI;;AAEI;AACH;AAED;;AAGI;AACJ;AAEA;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/animation/hooks/use-animate.mjs b/node_modules/framer-motion/dist/es/animation/hooks/use-animate.mjs deleted file mode 100644 index 2bcd19b..0000000 --- a/node_modules/framer-motion/dist/es/animation/hooks/use-animate.mjs +++ /dev/null @@ -1,25 +0,0 @@ -"use client"; -import { useContext, useMemo } from 'react'; -import { useConstant } from '../../utils/use-constant.mjs'; -import { useUnmountEffect } from '../../utils/use-unmount-effect.mjs'; -import { useReducedMotionConfig } from '../../utils/reduced-motion/use-reduced-motion-config.mjs'; -import { MotionConfigContext } from '../../context/MotionConfigContext.mjs'; -import { createScopedAnimate } from '../animate/index.mjs'; - -function useAnimate() { - const scope = useConstant(() => ({ - current: null, // Will be hydrated by React - animations: [], - })); - const reduceMotion = useReducedMotionConfig() ?? undefined; - const { skipAnimations } = useContext(MotionConfigContext); - const animate = useMemo(() => createScopedAnimate({ scope, reduceMotion, skipAnimations }), [scope, reduceMotion, skipAnimations]); - useUnmountEffect(() => { - scope.animations.forEach((animation) => animation.stop()); - scope.animations.length = 0; - }); - return [scope, animate]; -} - -export { useAnimate }; -//# sourceMappingURL=use-animate.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/hooks/use-animate.mjs.map b/node_modules/framer-motion/dist/es/animation/hooks/use-animate.mjs.map deleted file mode 100644 index 8c23b7e..0000000 --- a/node_modules/framer-motion/dist/es/animation/hooks/use-animate.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"use-animate.mjs","sources":["../../../../src/animation/hooks/use-animate.ts"],"sourcesContent":["\"use client\"\n\nimport { useContext, useMemo } from \"react\"\nimport { AnimationScope } from \"motion-dom\"\nimport { useConstant } from \"../../utils/use-constant\"\nimport { useUnmountEffect } from \"../../utils/use-unmount-effect\"\nimport { useReducedMotionConfig } from \"../../utils/reduced-motion/use-reduced-motion-config\"\nimport { MotionConfigContext } from \"../../context/MotionConfigContext\"\nimport { createScopedAnimate } from \"../animate\"\n\nexport function useAnimate() {\n const scope: AnimationScope = useConstant(() => ({\n current: null!, // Will be hydrated by React\n animations: [],\n }))\n\n const reduceMotion = useReducedMotionConfig() ?? undefined\n const { skipAnimations } = useContext(MotionConfigContext)\n\n const animate = useMemo(\n () => createScopedAnimate({ scope, reduceMotion, skipAnimations }),\n [scope, reduceMotion, skipAnimations]\n )\n\n useUnmountEffect(() => {\n scope.animations.forEach((animation) => animation.stop())\n scope.animations.length = 0\n })\n\n return [scope, animate] as [AnimationScope, typeof animate]\n}\n"],"names":[],"mappings":";;;;;;;;;AAWI;;AAEI;AACH;AAED;;;;AASI;AACA;AACJ;AAEA;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/animation/hooks/use-animated-state.mjs b/node_modules/framer-motion/dist/es/animation/hooks/use-animated-state.mjs deleted file mode 100644 index 2f48d0f..0000000 --- a/node_modules/framer-motion/dist/es/animation/hooks/use-animated-state.mjs +++ /dev/null @@ -1,64 +0,0 @@ -"use client"; -import { animateVisualElement, VisualElement, createBox } from 'motion-dom'; -import { useState, useLayoutEffect } from 'react'; -import { makeUseVisualState } from '../../motion/utils/use-visual-state.mjs'; -import { useConstant } from '../../utils/use-constant.mjs'; - -const createObject = () => ({}); -class StateVisualElement extends VisualElement { - constructor() { - super(...arguments); - this.measureInstanceViewportBox = createBox; - } - build() { } - resetTransform() { } - restoreTransform() { } - removeValueFromRenderState() { } - renderInstance() { } - scrapeMotionValuesFromProps() { - return createObject(); - } - getBaseTargetFromProps() { - return undefined; - } - readValueFromInstance(_state, key, options) { - return options.initialState[key] || 0; - } - sortInstanceNodePosition() { - return 0; - } -} -const useVisualState = makeUseVisualState({ - scrapeMotionValuesFromProps: createObject, - createRenderState: createObject, -}); -/** - * This is not an officially supported API and may be removed - * on any version. - */ -function useAnimatedState(initialState) { - const [animationState, setAnimationState] = useState(initialState); - const visualState = useVisualState({}, false); - const element = useConstant(() => { - return new StateVisualElement({ - props: { - onUpdate: (v) => { - setAnimationState({ ...v }); - }, - }, - visualState, - presenceContext: null, - }, { initialState }); - }); - useLayoutEffect(() => { - element.mount({}); - return () => element.unmount(); - }, [element]); - const startAnimation = useConstant(() => (animationDefinition) => { - return animateVisualElement(element, animationDefinition); - }); - return [animationState, startAnimation]; -} - -export { useAnimatedState }; -//# sourceMappingURL=use-animated-state.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/hooks/use-animated-state.mjs.map b/node_modules/framer-motion/dist/es/animation/hooks/use-animated-state.mjs.map deleted file mode 100644 index 480d401..0000000 --- a/node_modules/framer-motion/dist/es/animation/hooks/use-animated-state.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"use-animated-state.mjs","sources":["../../../../src/animation/hooks/use-animated-state.ts"],"sourcesContent":["\"use client\"\n\nimport {\n animateVisualElement,\n createBox,\n ResolvedValues,\n TargetAndTransition,\n VisualElement,\n} from \"motion-dom\"\nimport { useLayoutEffect, useState } from \"react\"\nimport { makeUseVisualState } from \"../../motion/utils/use-visual-state\"\nimport { useConstant } from \"../../utils/use-constant\"\n\ninterface AnimatedStateOptions {\n initialState: ResolvedValues\n}\n\nconst createObject = () => ({})\n\nclass StateVisualElement extends VisualElement<\n ResolvedValues,\n {},\n AnimatedStateOptions\n> {\n type: \"state\"\n build() {}\n measureInstanceViewportBox = createBox\n resetTransform() {}\n restoreTransform() {}\n removeValueFromRenderState() {}\n renderInstance() {}\n scrapeMotionValuesFromProps() {\n return createObject()\n }\n getBaseTargetFromProps() {\n return undefined\n }\n\n readValueFromInstance(\n _state: ResolvedValues,\n key: string,\n options: AnimatedStateOptions\n ) {\n return options.initialState[key] || 0\n }\n\n sortInstanceNodePosition() {\n return 0\n }\n}\n\nconst useVisualState = makeUseVisualState({\n scrapeMotionValuesFromProps: createObject,\n createRenderState: createObject,\n})\n\n/**\n * This is not an officially supported API and may be removed\n * on any version.\n */\nexport function useAnimatedState(initialState: any) {\n const [animationState, setAnimationState] = useState(initialState)\n const visualState = useVisualState({}, false)\n\n const element = useConstant(() => {\n return new StateVisualElement(\n {\n props: {\n onUpdate: (v) => {\n setAnimationState({ ...v })\n },\n },\n visualState,\n presenceContext: null,\n },\n { initialState }\n )\n })\n\n useLayoutEffect(() => {\n element.mount({})\n return () => element.unmount()\n }, [element])\n\n const startAnimation = useConstant(\n () => (animationDefinition: TargetAndTransition) => {\n return animateVisualElement(element, animationDefinition)\n }\n )\n\n return [animationState, startAnimation]\n}\n"],"names":[],"mappings":";;;;;;AAiBA;AAEA;AAAA;;;;AAMI;AAEA;AACA;AACA;AACA;;;;;AAKI;;AAGJ;;;;AASI;;AAEP;AAED;AACI;AACA;AACH;AAED;;;AAGG;AACG;;;AAIF;;AAGY;AACI;AACI;;AAEP;;AAED;AACH;AAGT;;AAGI;AACA;AACJ;;AAIQ;AACJ;AAGJ;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/animation/hooks/use-animation.mjs b/node_modules/framer-motion/dist/es/animation/hooks/use-animation.mjs deleted file mode 100644 index b40fbe9..0000000 --- a/node_modules/framer-motion/dist/es/animation/hooks/use-animation.mjs +++ /dev/null @@ -1,43 +0,0 @@ -"use client"; -import { useConstant } from '../../utils/use-constant.mjs'; -import { useIsomorphicLayoutEffect } from '../../utils/use-isomorphic-effect.mjs'; -import { animationControls } from './animation-controls.mjs'; - -/** - * Creates `LegacyAnimationControls`, which can be used to manually start, stop - * and sequence animations on one or more components. - * - * The returned `LegacyAnimationControls` should be passed to the `animate` property - * of the components you want to animate. - * - * These components can then be animated with the `start` method. - * - * ```jsx - * import * as React from 'react' - * import { motion, useAnimation } from 'framer-motion' - * - * export function MyComponent(props) { - * const controls = useAnimation() - * - * controls.start({ - * x: 100, - * transition: { duration: 0.5 }, - * }) - * - * return - * } - * ``` - * - * @returns Animation controller with `start` and `stop` methods - * - * @public - */ -function useAnimationControls() { - const controls = useConstant(animationControls); - useIsomorphicLayoutEffect(controls.mount, []); - return controls; -} -const useAnimation = useAnimationControls; - -export { useAnimation, useAnimationControls }; -//# sourceMappingURL=use-animation.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/hooks/use-animation.mjs.map b/node_modules/framer-motion/dist/es/animation/hooks/use-animation.mjs.map deleted file mode 100644 index bea4be5..0000000 --- a/node_modules/framer-motion/dist/es/animation/hooks/use-animation.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"use-animation.mjs","sources":["../../../../src/animation/hooks/use-animation.ts"],"sourcesContent":["\"use client\"\n\nimport { LegacyAnimationControls } from \"motion-dom\"\nimport { useConstant } from \"../../utils/use-constant\"\nimport { useIsomorphicLayoutEffect } from \"../../utils/use-isomorphic-effect\"\nimport { animationControls } from \"./animation-controls\"\n\n/**\n * Creates `LegacyAnimationControls`, which can be used to manually start, stop\n * and sequence animations on one or more components.\n *\n * The returned `LegacyAnimationControls` should be passed to the `animate` property\n * of the components you want to animate.\n *\n * These components can then be animated with the `start` method.\n *\n * ```jsx\n * import * as React from 'react'\n * import { motion, useAnimation } from 'framer-motion'\n *\n * export function MyComponent(props) {\n * const controls = useAnimation()\n *\n * controls.start({\n * x: 100,\n * transition: { duration: 0.5 },\n * })\n *\n * return \n * }\n * ```\n *\n * @returns Animation controller with `start` and `stop` methods\n *\n * @public\n */\nexport function useAnimationControls(): LegacyAnimationControls {\n const controls = useConstant(animationControls)\n\n useIsomorphicLayoutEffect(controls.mount, [])\n\n return controls\n}\n\nexport const useAnimation = useAnimationControls\n"],"names":[],"mappings":";;;;;AAOA;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BG;;AAEC;AAEA;AAEA;AACJ;AAEO;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/animation/optimized-appear/handoff.mjs b/node_modules/framer-motion/dist/es/animation/optimized-appear/handoff.mjs deleted file mode 100644 index ebdd478..0000000 --- a/node_modules/framer-motion/dist/es/animation/optimized-appear/handoff.mjs +++ /dev/null @@ -1,39 +0,0 @@ -import { appearAnimationStore } from './store.mjs'; -import { appearStoreId } from './store-id.mjs'; - -function handoffOptimizedAppearAnimation(elementId, valueName, frame) { - const storeId = appearStoreId(elementId, valueName); - const optimisedAnimation = appearAnimationStore.get(storeId); - if (!optimisedAnimation) { - return null; - } - const { animation, startTime } = optimisedAnimation; - function cancelAnimation() { - window.MotionCancelOptimisedAnimation?.(elementId, valueName, frame); - } - /** - * We can cancel the animation once it's finished now that we've synced - * with Motion. - * - * Prefer onfinish over finished as onfinish is backwards compatible with - * older browsers. - */ - animation.onfinish = cancelAnimation; - if (startTime === null || window.MotionHandoffIsComplete?.(elementId)) { - /** - * If the startTime is null, this animation is the Paint Ready detection animation - * and we can cancel it immediately without handoff. - * - * Or if we've already handed off the animation then we're now interrupting it. - * In which case we need to cancel it. - */ - cancelAnimation(); - return null; - } - else { - return startTime; - } -} - -export { handoffOptimizedAppearAnimation }; -//# sourceMappingURL=handoff.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/optimized-appear/handoff.mjs.map b/node_modules/framer-motion/dist/es/animation/optimized-appear/handoff.mjs.map deleted file mode 100644 index 94affb5..0000000 --- a/node_modules/framer-motion/dist/es/animation/optimized-appear/handoff.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"handoff.mjs","sources":["../../../../src/animation/optimized-appear/handoff.ts"],"sourcesContent":["import type { Batcher } from \"motion-dom\"\nimport { appearAnimationStore } from \"./store\"\nimport { appearStoreId } from \"./store-id\"\n\nexport function handoffOptimizedAppearAnimation(\n elementId: string,\n valueName: string,\n frame: Batcher\n): number | null {\n const storeId = appearStoreId(elementId, valueName)\n const optimisedAnimation = appearAnimationStore.get(storeId)\n\n if (!optimisedAnimation) {\n return null\n }\n\n const { animation, startTime } = optimisedAnimation\n\n function cancelAnimation() {\n window.MotionCancelOptimisedAnimation?.(elementId, valueName, frame)\n }\n\n /**\n * We can cancel the animation once it's finished now that we've synced\n * with Motion.\n *\n * Prefer onfinish over finished as onfinish is backwards compatible with\n * older browsers.\n */\n animation.onfinish = cancelAnimation\n\n if (startTime === null || window.MotionHandoffIsComplete?.(elementId)) {\n /**\n * If the startTime is null, this animation is the Paint Ready detection animation\n * and we can cancel it immediately without handoff.\n *\n * Or if we've already handed off the animation then we're now interrupting it.\n * In which case we need to cancel it.\n */\n cancelAnimation()\n return null\n } else {\n return startTime\n }\n}\n"],"names":[],"mappings":";;;SAIgB,+BAA+B,CAC3C,SAAiB,EACjB,SAAiB,EACjB,KAAc,EAAA;IAEd,MAAM,OAAO,GAAG,aAAa,CAAC,SAAS,EAAE,SAAS,CAAC;IACnD,MAAM,kBAAkB,GAAG,oBAAoB,CAAC,GAAG,CAAC,OAAO,CAAC;IAE5D,IAAI,CAAC,kBAAkB,EAAE;AACrB,QAAA,OAAO,IAAI;IACf;AAEA,IAAA,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,kBAAkB;AAEnD,IAAA,SAAS,eAAe,GAAA;QACpB,MAAM,CAAC,8BAA8B,GAAG,SAAS,EAAE,SAAS,EAAE,KAAK,CAAC;IACxE;AAEA;;;;;;AAMG;AACH,IAAA,SAAS,CAAC,QAAQ,GAAG,eAAe;AAEpC,IAAA,IAAI,SAAS,KAAK,IAAI,IAAI,MAAM,CAAC,uBAAuB,GAAG,SAAS,CAAC,EAAE;AACnE;;;;;;AAMG;AACH,QAAA,eAAe,EAAE;AACjB,QAAA,OAAO,IAAI;IACf;SAAO;AACH,QAAA,OAAO,SAAS;IACpB;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/animation/optimized-appear/start.mjs b/node_modules/framer-motion/dist/es/animation/optimized-appear/start.mjs deleted file mode 100644 index e526185..0000000 --- a/node_modules/framer-motion/dist/es/animation/optimized-appear/start.mjs +++ /dev/null @@ -1,170 +0,0 @@ -import { optimizedAppearDataId, startWaapiAnimation, getOptimisedAppearId } from 'motion-dom'; -import { noop } from 'motion-utils'; -import { handoffOptimizedAppearAnimation } from './handoff.mjs'; -import { appearAnimationStore, appearComplete } from './store.mjs'; -import { appearStoreId } from './store-id.mjs'; - -/** - * A single time to use across all animations to manually set startTime - * and ensure they're all in sync. - */ -let startFrameTime; -/** - * A dummy animation to detect when Chrome is ready to start - * painting the page and hold off from triggering the real animation - * until then. We only need one animation to detect paint ready. - * - * https://bugs.chromium.org/p/chromium/issues/detail?id=1406850 - */ -let readyAnimation; -/** - * Keep track of animations that were suspended vs cancelled so we - * can easily resume them when we're done measuring layout. - */ -const suspendedAnimations = new Set(); -function resumeSuspendedAnimations() { - suspendedAnimations.forEach((data) => { - data.animation.play(); - data.animation.startTime = data.startTime; - }); - suspendedAnimations.clear(); -} -function startOptimizedAppearAnimation(element, name, keyframes, options, onReady) { - // Prevent optimised appear animations if Motion has already started animating. - if (window.MotionIsMounted) { - return; - } - const id = element.dataset[optimizedAppearDataId]; - if (!id) - return; - window.MotionHandoffAnimation = handoffOptimizedAppearAnimation; - const storeId = appearStoreId(id, name); - if (!readyAnimation) { - readyAnimation = startWaapiAnimation(element, name, [keyframes[0], keyframes[0]], - /** - * 10 secs is basically just a super-safe duration to give Chrome - * long enough to get the animation ready. - */ - { duration: 10000, ease: "linear" }); - appearAnimationStore.set(storeId, { - animation: readyAnimation, - startTime: null, - }); - /** - * If there's no readyAnimation then there's been no instantiation - * of handoff animations. - */ - window.MotionHandoffAnimation = handoffOptimizedAppearAnimation; - window.MotionHasOptimisedAnimation = (elementId, valueName) => { - if (!elementId) - return false; - /** - * Keep a map of elementIds that have started animating. We check - * via ID instead of Element because of hydration errors and - * pre-hydration checks. We also actively record IDs as they start - * animating rather than simply checking for data-appear-id as - * this attrbute might be present but not lead to an animation, for - * instance if the element's appear animation is on a different - * breakpoint. - */ - if (!valueName) { - return appearComplete.has(elementId); - } - const animationId = appearStoreId(elementId, valueName); - return Boolean(appearAnimationStore.get(animationId)); - }; - window.MotionHandoffMarkAsComplete = (elementId) => { - if (appearComplete.has(elementId)) { - appearComplete.set(elementId, true); - } - }; - window.MotionHandoffIsComplete = (elementId) => { - return appearComplete.get(elementId) === true; - }; - /** - * We only need to cancel transform animations as - * they're the ones that will interfere with the - * layout animation measurements. - */ - window.MotionCancelOptimisedAnimation = (elementId, valueName, frame, canResume) => { - const animationId = appearStoreId(elementId, valueName); - const data = appearAnimationStore.get(animationId); - if (!data) - return; - if (frame && canResume === undefined) { - /** - * Wait until the end of the subsequent frame to cancel the animation - * to ensure we don't remove the animation before the main thread has - * had a chance to resolve keyframes and render. - */ - frame.postRender(() => { - frame.postRender(() => { - data.animation.cancel(); - }); - }); - } - else { - data.animation.cancel(); - } - if (frame && canResume) { - suspendedAnimations.add(data); - frame.render(resumeSuspendedAnimations); - } - else { - appearAnimationStore.delete(animationId); - /** - * If there are no more animations left, we can remove the cancel function. - * This will let us know when we can stop checking for conflicting layout animations. - */ - if (!appearAnimationStore.size) { - window.MotionCancelOptimisedAnimation = undefined; - } - } - }; - window.MotionCheckAppearSync = (visualElement, valueName, value) => { - const appearId = getOptimisedAppearId(visualElement); - if (!appearId) - return; - const valueIsOptimised = window.MotionHasOptimisedAnimation?.(appearId, valueName); - const externalAnimationValue = visualElement.props.values?.[valueName]; - if (!valueIsOptimised || !externalAnimationValue) - return; - const removeSyncCheck = value.on("change", (latestValue) => { - if (externalAnimationValue.get() !== latestValue) { - window.MotionCancelOptimisedAnimation?.(appearId, valueName); - removeSyncCheck(); - } - }); - return removeSyncCheck; - }; - } - const startAnimation = () => { - readyAnimation.cancel(); - const appearAnimation = startWaapiAnimation(element, name, keyframes, options); - /** - * Record the time of the first started animation. We call performance.now() once - * here and once in handoff to ensure we're getting - * close to a frame-locked time. This keeps all animations in sync. - */ - if (startFrameTime === undefined) { - startFrameTime = performance.now(); - } - appearAnimation.startTime = startFrameTime; - appearAnimationStore.set(storeId, { - animation: appearAnimation, - startTime: startFrameTime, - }); - if (onReady) - onReady(appearAnimation); - }; - appearComplete.set(id, false); - if (readyAnimation.ready) { - readyAnimation.ready.then(startAnimation).catch(noop); - } - else { - startAnimation(); - } -} - -export { startOptimizedAppearAnimation }; -//# sourceMappingURL=start.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/optimized-appear/start.mjs.map b/node_modules/framer-motion/dist/es/animation/optimized-appear/start.mjs.map deleted file mode 100644 index 316ebff..0000000 --- a/node_modules/framer-motion/dist/es/animation/optimized-appear/start.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"start.mjs","sources":["../../../../src/animation/optimized-appear/start.ts"],"sourcesContent":["import {\n AnyResolvedKeyframe,\n Batcher,\n getOptimisedAppearId,\n MotionValue,\n optimizedAppearDataId,\n startWaapiAnimation,\n ValueAnimationTransition,\n type WithAppearProps,\n} from \"motion-dom\"\nimport { noop } from \"motion-utils\"\nimport { handoffOptimizedAppearAnimation } from \"./handoff\"\nimport { appearAnimationStore, appearComplete, AppearStoreEntry } from \"./store\"\nimport { appearStoreId } from \"./store-id\"\n\n/**\n * A single time to use across all animations to manually set startTime\n * and ensure they're all in sync.\n */\nlet startFrameTime: number\n\n/**\n * A dummy animation to detect when Chrome is ready to start\n * painting the page and hold off from triggering the real animation\n * until then. We only need one animation to detect paint ready.\n *\n * https://bugs.chromium.org/p/chromium/issues/detail?id=1406850\n */\nlet readyAnimation: Animation\n\n/**\n * Keep track of animations that were suspended vs cancelled so we\n * can easily resume them when we're done measuring layout.\n */\nconst suspendedAnimations = new Set()\n\nfunction resumeSuspendedAnimations() {\n suspendedAnimations.forEach((data) => {\n data.animation.play()\n data.animation.startTime = data.startTime\n })\n suspendedAnimations.clear()\n}\n\nexport function startOptimizedAppearAnimation(\n element: HTMLElement,\n name: string,\n keyframes: string[] | number[],\n options: ValueAnimationTransition,\n onReady?: (animation: Animation) => void\n): void {\n // Prevent optimised appear animations if Motion has already started animating.\n if (window.MotionIsMounted) {\n return\n }\n\n const id = element.dataset[optimizedAppearDataId]\n if (!id) return\n\n window.MotionHandoffAnimation = handoffOptimizedAppearAnimation\n\n const storeId = appearStoreId(id, name)\n if (!readyAnimation) {\n readyAnimation = startWaapiAnimation(\n element,\n name,\n [keyframes[0] as number, keyframes[0] as number],\n /**\n * 10 secs is basically just a super-safe duration to give Chrome\n * long enough to get the animation ready.\n */\n { duration: 10000, ease: \"linear\" }\n )\n\n appearAnimationStore.set(storeId, {\n animation: readyAnimation,\n startTime: null,\n })\n\n /**\n * If there's no readyAnimation then there's been no instantiation\n * of handoff animations.\n */\n window.MotionHandoffAnimation = handoffOptimizedAppearAnimation\n\n window.MotionHasOptimisedAnimation = (\n elementId?: string,\n valueName?: string\n ) => {\n if (!elementId) return false\n\n /**\n * Keep a map of elementIds that have started animating. We check\n * via ID instead of Element because of hydration errors and\n * pre-hydration checks. We also actively record IDs as they start\n * animating rather than simply checking for data-appear-id as\n * this attrbute might be present but not lead to an animation, for\n * instance if the element's appear animation is on a different\n * breakpoint.\n */\n if (!valueName) {\n return appearComplete.has(elementId)\n }\n\n const animationId = appearStoreId(elementId, valueName)\n return Boolean(appearAnimationStore.get(animationId))\n }\n\n window.MotionHandoffMarkAsComplete = (elementId: string): void => {\n if (appearComplete.has(elementId)) {\n appearComplete.set(elementId, true)\n }\n }\n\n window.MotionHandoffIsComplete = (elementId: string): boolean => {\n return appearComplete.get(elementId) === true\n }\n\n /**\n * We only need to cancel transform animations as\n * they're the ones that will interfere with the\n * layout animation measurements.\n */\n window.MotionCancelOptimisedAnimation = (\n elementId: string,\n valueName: string,\n frame?: Batcher,\n canResume?: boolean\n ) => {\n const animationId = appearStoreId(elementId, valueName)\n const data = appearAnimationStore.get(animationId)\n\n if (!data) return\n\n if (frame && canResume === undefined) {\n /**\n * Wait until the end of the subsequent frame to cancel the animation\n * to ensure we don't remove the animation before the main thread has\n * had a chance to resolve keyframes and render.\n */\n frame.postRender(() => {\n frame.postRender(() => {\n data.animation.cancel()\n })\n })\n } else {\n data.animation.cancel()\n }\n\n if (frame && canResume) {\n suspendedAnimations.add(data)\n frame.render(resumeSuspendedAnimations)\n } else {\n appearAnimationStore.delete(animationId)\n\n /**\n * If there are no more animations left, we can remove the cancel function.\n * This will let us know when we can stop checking for conflicting layout animations.\n */\n if (!appearAnimationStore.size) {\n window.MotionCancelOptimisedAnimation = undefined\n }\n }\n }\n\n window.MotionCheckAppearSync = (\n visualElement: WithAppearProps,\n valueName: string,\n value: MotionValue\n ) => {\n const appearId = getOptimisedAppearId(visualElement)\n\n if (!appearId) return\n\n const valueIsOptimised = window.MotionHasOptimisedAnimation?.(\n appearId,\n valueName\n )\n const externalAnimationValue =\n visualElement.props.values?.[valueName]\n\n if (!valueIsOptimised || !externalAnimationValue) return\n\n const removeSyncCheck = value.on(\n \"change\",\n (latestValue: AnyResolvedKeyframe) => {\n if (externalAnimationValue.get() !== latestValue) {\n window.MotionCancelOptimisedAnimation?.(\n appearId,\n valueName\n )\n removeSyncCheck()\n }\n }\n )\n\n return removeSyncCheck\n }\n }\n\n const startAnimation = () => {\n readyAnimation.cancel()\n\n const appearAnimation = startWaapiAnimation(\n element,\n name,\n keyframes,\n options\n )\n\n /**\n * Record the time of the first started animation. We call performance.now() once\n * here and once in handoff to ensure we're getting\n * close to a frame-locked time. This keeps all animations in sync.\n */\n if (startFrameTime === undefined) {\n startFrameTime = performance.now()\n }\n\n appearAnimation.startTime = startFrameTime\n\n appearAnimationStore.set(storeId, {\n animation: appearAnimation,\n startTime: startFrameTime,\n })\n\n if (onReady) onReady(appearAnimation)\n }\n\n appearComplete.set(id, false)\n\n if (readyAnimation.ready) {\n readyAnimation.ready.then(startAnimation).catch(noop)\n } else {\n startAnimation()\n }\n}\n"],"names":[],"mappings":";;;;;;AAeA;;;AAGG;AACH,IAAI,cAAsB;AAE1B;;;;;;AAMG;AACH,IAAI,cAAyB;AAE7B;;;AAGG;AACH,MAAM,mBAAmB,GAAG,IAAI,GAAG,EAAoB;AAEvD,SAAS,yBAAyB,GAAA;AAC9B,IAAA,mBAAmB,CAAC,OAAO,CAAC,CAAC,IAAI,KAAI;AACjC,QAAA,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE;QACrB,IAAI,CAAC,SAAS,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS;AAC7C,IAAA,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AC;AAED,IAAA,cAAc,CAAC,GAAG,CAAC,EAAE,EAAE,KAAK,CAAC;AAE7B,IAAA,IAAI,cAAc,CAAC,KAAK,EAAE;AACtB,QAAA,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC;IACzD;SAAO;AACH,QAAA,cAAc,EAAE;IACpB;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/animation/optimized-appear/store-id.mjs b/node_modules/framer-motion/dist/es/animation/optimized-appear/store-id.mjs deleted file mode 100644 index 3db6ef4..0000000 --- a/node_modules/framer-motion/dist/es/animation/optimized-appear/store-id.mjs +++ /dev/null @@ -1,9 +0,0 @@ -import { transformProps } from 'motion-dom'; - -const appearStoreId = (elementId, valueName) => { - const key = transformProps.has(valueName) ? "transform" : valueName; - return `${elementId}: ${key}`; -}; - -export { appearStoreId }; -//# sourceMappingURL=store-id.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/optimized-appear/store-id.mjs.map b/node_modules/framer-motion/dist/es/animation/optimized-appear/store-id.mjs.map deleted file mode 100644 index 372f254..0000000 --- a/node_modules/framer-motion/dist/es/animation/optimized-appear/store-id.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"store-id.mjs","sources":["../../../../src/animation/optimized-appear/store-id.ts"],"sourcesContent":["import { transformProps } from \"motion-dom\"\n\nexport const appearStoreId = (elementId: string, valueName: string) => {\n const key = transformProps.has(valueName) ? \"transform\" : valueName\n\n return `${elementId}: ${key}`\n}\n"],"names":[],"mappings":";;MAEa,aAAa,GAAG,CAAC,SAAiB,EAAE,SAAiB,KAAI;AAClE,IAAA,MAAM,GAAG,GAAG,cAAc,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,WAAW,GAAG,SAAS;AAEnE,IAAA,OAAO,CAAA,EAAG,SAAS,CAAA,EAAA,EAAK,GAAG,EAAE;AACjC;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/animation/optimized-appear/store.mjs b/node_modules/framer-motion/dist/es/animation/optimized-appear/store.mjs deleted file mode 100644 index a6cfa5e..0000000 --- a/node_modules/framer-motion/dist/es/animation/optimized-appear/store.mjs +++ /dev/null @@ -1,5 +0,0 @@ -const appearAnimationStore = new Map(); -const appearComplete = new Map(); - -export { appearAnimationStore, appearComplete }; -//# sourceMappingURL=store.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/optimized-appear/store.mjs.map b/node_modules/framer-motion/dist/es/animation/optimized-appear/store.mjs.map deleted file mode 100644 index 18a44b3..0000000 --- a/node_modules/framer-motion/dist/es/animation/optimized-appear/store.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"store.mjs","sources":["../../../../src/animation/optimized-appear/store.ts"],"sourcesContent":["export interface AppearStoreEntry {\n animation: Animation\n startTime: number | null\n}\n\nexport type AppearElementId = string\n\nexport type IsComplete = boolean\n\nexport const appearAnimationStore = new Map()\n\nexport const appearComplete = new Map()\n"],"names":[],"mappings":"AASO,MAAM,oBAAoB,GAAG,IAAI,GAAG;AAEpC,MAAM,cAAc,GAAG,IAAI,GAAG;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/animation/sequence/create.mjs b/node_modules/framer-motion/dist/es/animation/sequence/create.mjs deleted file mode 100644 index 0756f04..0000000 --- a/node_modules/framer-motion/dist/es/animation/sequence/create.mjs +++ /dev/null @@ -1,308 +0,0 @@ -import { isMotionValue, defaultOffset, isGenerator, createGeneratorEasing, fillOffset } from 'motion-dom'; -import { progress, secondsToMilliseconds, warning, reverseEasing, getEasingForSegment } from 'motion-utils'; -import { resolveSubjects } from '../animate/resolve-subjects.mjs'; -import { calculateRepeatDuration } from './utils/calc-repeat-duration.mjs'; -import { calcNextTime } from './utils/calc-time.mjs'; -import { addKeyframes } from './utils/edit.mjs'; -import { normalizeTimes } from './utils/normalize-times.mjs'; -import { compareByTime } from './utils/sort.mjs'; - -const defaultSegmentEasing = "easeInOut"; -const MAX_REPEAT = 20; -function createAnimationsFromSequence(sequence, { defaultTransition = {}, ...sequenceTransition } = {}, scope, generators) { - const defaultDuration = defaultTransition.duration || 0.3; - const animationDefinitions = new Map(); - const sequences = new Map(); - const elementCache = {}; - const timeLabels = new Map(); - let prevTime = 0; - let currentTime = 0; - let totalDuration = 0; - /** - * Build the timeline by mapping over the sequence array and converting - * the definitions into keyframes and offsets with absolute time values. - * These will later get converted into relative offsets in a second pass. - */ - for (let i = 0; i < sequence.length; i++) { - const segment = sequence[i]; - /** - * If this is a timeline label, mark it and skip the rest of this iteration. - */ - if (typeof segment === "string") { - timeLabels.set(segment, currentTime); - continue; - } - else if (!Array.isArray(segment)) { - timeLabels.set(segment.name, calcNextTime(currentTime, segment.at, prevTime, timeLabels)); - continue; - } - let [subject, keyframes, transition = {}] = segment; - /** - * If a relative or absolute time value has been specified we need to resolve - * it in relation to the currentTime. - */ - if (transition.at !== undefined) { - currentTime = calcNextTime(currentTime, transition.at, prevTime, timeLabels); - } - /** - * Keep track of the maximum duration in this definition. This will be - * applied to currentTime once the definition has been parsed. - */ - let maxDuration = 0; - const resolveValueSequence = (valueKeyframes, valueTransition, valueSequence, elementIndex = 0, numSubjects = 0) => { - const valueKeyframesAsList = keyframesAsList(valueKeyframes); - const { delay = 0, times = defaultOffset(valueKeyframesAsList), type = defaultTransition.type || "keyframes", repeat, repeatType, repeatDelay = 0, ...remainingTransition } = valueTransition; - let { ease = defaultTransition.ease || "easeOut", duration } = valueTransition; - /** - * Resolve stagger() if defined. - */ - const calculatedDelay = typeof delay === "function" - ? delay(elementIndex, numSubjects) - : delay; - /** - * If this animation should and can use a spring, generate a spring easing function. - */ - const numKeyframes = valueKeyframesAsList.length; - const createGenerator = isGenerator(type) - ? type - : generators?.[type || "keyframes"]; - if (numKeyframes <= 2 && createGenerator) { - /** - * As we're creating an easing function from a spring, - * ideally we want to generate it using the real distance - * between the two keyframes. However this isn't always - * possible - in these situations we use 0-100. - */ - let absoluteDelta = 100; - if (numKeyframes === 2 && - isNumberKeyframesArray(valueKeyframesAsList)) { - const delta = valueKeyframesAsList[1] - valueKeyframesAsList[0]; - absoluteDelta = Math.abs(delta); - } - const springTransition = { - ...defaultTransition, - ...remainingTransition, - }; - if (duration !== undefined) { - springTransition.duration = secondsToMilliseconds(duration); - } - const springEasing = createGeneratorEasing(springTransition, absoluteDelta, createGenerator); - ease = springEasing.ease; - duration = springEasing.duration; - } - duration ?? (duration = defaultDuration); - const startTime = currentTime + calculatedDelay; - /** - * If there's only one time offset of 0, fill in a second with length 1 - */ - if (times.length === 1 && times[0] === 0) { - times[1] = 1; - } - /** - * Fill out if offset if fewer offsets than keyframes - */ - const remainder = times.length - valueKeyframesAsList.length; - remainder > 0 && fillOffset(times, remainder); - /** - * If only one value has been set, ie [1], push a null to the start of - * the keyframe array. This will let us mark a keyframe at this point - * that will later be hydrated with the previous value. - */ - valueKeyframesAsList.length === 1 && - valueKeyframesAsList.unshift(null); - /** - * Segments can't express `repeat: Infinity` or very large - * counts — they'd leave dead time after the segment or - * explode the keyframe array. Ignore with a warning. - */ - if (repeat) { - warning(repeat < MAX_REPEAT, `Sequence segments can't repeat ${repeat} times — ignoring repeat option. Use a value below ${MAX_REPEAT} or apply repeat at the sequence level instead.`); - } - if (repeat && repeat < MAX_REPEAT) { - /** - * Express repeatDelay in units of a single iteration's duration - * so it can be added to the per-iteration time offsets below - * before they're normalized to 0-1. - */ - const repeatDelayUnits = duration > 0 ? repeatDelay / duration : 0; - duration = calculateRepeatDuration(duration, repeat, repeatDelay); - const originalKeyframes = [...valueKeyframesAsList]; - const originalTimes = [...times]; - ease = Array.isArray(ease) ? [...ease] : [ease]; - const originalEase = [...ease]; - /** - * For reverse/mirror, alternate iterations play the segment - * backwards. mirror matches JSAnimation's mirroredGenerator: - * reversed keyframes, easings unchanged. reverse matches - * JSAnimation's iterationProgress = 1 - p: reversed - * keyframes, easing array reversed AND each function easing - * mapped through reverseEasing (string easings unchanged — - * they're resolved later by the keyframes engine). - */ - const isFlipping = repeatType === "reverse" || repeatType === "mirror"; - let flippedKeyframes = originalKeyframes; - let flippedEases = originalEase; - if (isFlipping) { - flippedKeyframes = [...originalKeyframes].reverse(); - if (repeatType === "reverse") { - flippedEases = [...originalEase] - .reverse() - .map((e) => typeof e === "function" - ? reverseEasing(e) - : e); - } - } - for (let repeatIndex = 0; repeatIndex < repeat; repeatIndex++) { - const isFlipped = isFlipping && repeatIndex % 2 === 0; - const iterKeyframes = isFlipped - ? flippedKeyframes - : originalKeyframes; - const iterEase = isFlipped ? flippedEases : originalEase; - const iterStartOffset = (repeatIndex + 1) * (1 + repeatDelayUnits); - /** - * If repeatDelay is set, hold the previous iteration's - * final value through the delay by inserting a keyframe - * at the moment the next iteration begins. - */ - if (repeatDelayUnits > 0) { - valueKeyframesAsList.push(valueKeyframesAsList[valueKeyframesAsList.length - 1]); - times.push(iterStartOffset); - ease.push("linear"); - } - valueKeyframesAsList.push(...iterKeyframes); - for (let keyframeIndex = 0; keyframeIndex < iterKeyframes.length; keyframeIndex++) { - times.push(originalTimes[keyframeIndex] + iterStartOffset); - ease.push(keyframeIndex === 0 - ? "linear" - : getEasingForSegment(iterEase, keyframeIndex - 1)); - } - } - normalizeTimes(times, repeat, repeatDelayUnits); - } - const targetTime = startTime + duration; - /** - * Add keyframes, mapping offsets to absolute time. - */ - addKeyframes(valueSequence, valueKeyframesAsList, ease, times, startTime, targetTime); - maxDuration = Math.max(calculatedDelay + duration, maxDuration); - totalDuration = Math.max(targetTime, totalDuration); - }; - if (isMotionValue(subject)) { - const subjectSequence = getSubjectSequence(subject, sequences); - resolveValueSequence(keyframes, transition, getValueSequence("default", subjectSequence)); - } - else { - const subjects = resolveSubjects(subject, keyframes, scope, elementCache); - const numSubjects = subjects.length; - /** - * For every element in this segment, process the defined values. - */ - for (let subjectIndex = 0; subjectIndex < numSubjects; subjectIndex++) { - /** - * Cast necessary, but we know these are of this type - */ - keyframes = keyframes; - transition = transition; - const thisSubject = subjects[subjectIndex]; - const subjectSequence = getSubjectSequence(thisSubject, sequences); - for (const key in keyframes) { - resolveValueSequence(keyframes[key], getValueTransition(transition, key), getValueSequence(key, subjectSequence), subjectIndex, numSubjects); - } - } - } - prevTime = currentTime; - currentTime += maxDuration; - } - /** - * For every element and value combination create a new animation. - */ - sequences.forEach((valueSequences, element) => { - for (const key in valueSequences) { - const valueSequence = valueSequences[key]; - /** - * Arrange all the keyframes in ascending time order. - */ - valueSequence.sort(compareByTime); - const keyframes = []; - const valueOffset = []; - const valueEasing = []; - /** - * For each keyframe, translate absolute times into - * relative offsets based on the total duration of the timeline. - */ - for (let i = 0; i < valueSequence.length; i++) { - const { at, value, easing } = valueSequence[i]; - keyframes.push(value); - valueOffset.push(progress(0, totalDuration, at)); - valueEasing.push(easing || "easeOut"); - } - /** - * If the first keyframe doesn't land on offset: 0 - * provide one by duplicating the initial keyframe. This ensures - * it snaps to the first keyframe when the animation starts. - */ - if (valueOffset[0] !== 0) { - valueOffset.unshift(0); - keyframes.unshift(keyframes[0]); - valueEasing.unshift(defaultSegmentEasing); - } - /** - * If the last keyframe doesn't land on offset: 1 - * provide one with a null wildcard value. This will ensure it - * stays static until the end of the animation. - */ - if (valueOffset[valueOffset.length - 1] !== 1) { - valueOffset.push(1); - keyframes.push(null); - } - if (!animationDefinitions.has(element)) { - animationDefinitions.set(element, { - keyframes: {}, - transition: {}, - }); - } - const definition = animationDefinitions.get(element); - definition.keyframes[key] = keyframes; - /** - * Exclude `type` from defaultTransition since springs have been - * converted to duration-based easing functions in resolveValueSequence. - * Including `type: "spring"` would cause JSAnimation to error when - * the merged keyframes array has more than 2 keyframes. - */ - const { type: _type, ...remainingDefaultTransition } = defaultTransition; - definition.transition[key] = { - ...remainingDefaultTransition, - duration: totalDuration, - ease: valueEasing, - times: valueOffset, - ...sequenceTransition, - }; - } - }); - return animationDefinitions; -} -function getSubjectSequence(subject, sequences) { - !sequences.has(subject) && sequences.set(subject, {}); - return sequences.get(subject); -} -function getValueSequence(name, sequences) { - if (!sequences[name]) - sequences[name] = []; - return sequences[name]; -} -function keyframesAsList(keyframes) { - return Array.isArray(keyframes) ? keyframes : [keyframes]; -} -function getValueTransition(transition, key) { - return transition && transition[key] - ? { - ...transition, - ...transition[key], - } - : { ...transition }; -} -const isNumber = (keyframe) => typeof keyframe === "number"; -const isNumberKeyframesArray = (keyframes) => keyframes.every(isNumber); - -export { createAnimationsFromSequence, getValueTransition }; -//# sourceMappingURL=create.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/sequence/create.mjs.map b/node_modules/framer-motion/dist/es/animation/sequence/create.mjs.map deleted file mode 100644 index a9abdf0..0000000 --- a/node_modules/framer-motion/dist/es/animation/sequence/create.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"create.mjs","sources":["../../../../src/animation/sequence/create.ts"],"sourcesContent":["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()\n const elementCache = {}\n const timeLabels = new Map()\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(\n subject: Element | MotionValue | O,\n sequences: Map\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: Unres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BAAA,IAAI,EAAE,WAAW;AACjB,gBAAA,KAAK,EAAE,WAAW;AAClB,gBAAA,GAAG,kBAAkB;aACxB;QACL;AACJ,IAAA,CAAC,CAAC;AAEF,IAAA,OAAO,oBAAoB;AAC/B;AAEA,SAAS,kBAAkB,CACvB,OAAkC,EAClC,SAAsD,EAAA;AAEtD,IAAA,CAAC,SAAS,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,SAAS,CAAC,GAAG,CAAC,OAAO,EAAE,EAAE,CAAC;AACrD,IAAA,OAAO,SAAS,CAAC,GAAG,CAAC,OAAO,CAAE;AAClC;AAEA,SAAS,gBAAgB,CAAC,IAAY,EAAE,SAAsB,EAAA;AAC1D,IAAA,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;AAAE,QAAA,SAAS,CAAC,IAAI,CAAC,GAAG,EAAE;AAC1C,IAAA,OAAO,SAAS,CAAC,IAAI,CAAC;AAC1B;AAEA,SAAS,eAAe,CACpB,SAA8D,EAAA;AAE9D,IAAA,OAAO,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,SAAS,GAAG,CAAC,SAAS,CAAC;AAC7D;AAEM,SAAU,kBAAkB,CAC9B,UAAwC,EACxC,GAAW,EAAA;AAEX,IAAA,OAAO,UAAU,IAAI,UAAU,CAAC,GAA8B;AAC1D,UAAE;AACI,YAAA,GAAG,UAAU;YACb,GAAI,UAAU,CAAC,GAA8B,CAAgB;AAChE;AACH,UAAE,EAAE,GAAG,UAAU,EAAE;AAC3B;AAEA,MAAM,QAAQ,GAAG,CAAC,QAAiB,KAAK,OAAO,QAAQ,KAAK,QAAQ;AACpE,MAAM,sBAAsB,GAAG,CAC3B,SAAoC,KACZ,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/animation/sequence/utils/calc-repeat-duration.mjs b/node_modules/framer-motion/dist/es/animation/sequence/utils/calc-repeat-duration.mjs deleted file mode 100644 index 652f6d8..0000000 --- a/node_modules/framer-motion/dist/es/animation/sequence/utils/calc-repeat-duration.mjs +++ /dev/null @@ -1,6 +0,0 @@ -function calculateRepeatDuration(duration, repeat, repeatDelay) { - return duration * (repeat + 1) + repeatDelay * repeat; -} - -export { calculateRepeatDuration }; -//# sourceMappingURL=calc-repeat-duration.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/sequence/utils/calc-repeat-duration.mjs.map b/node_modules/framer-motion/dist/es/animation/sequence/utils/calc-repeat-duration.mjs.map deleted file mode 100644 index 286da81..0000000 --- a/node_modules/framer-motion/dist/es/animation/sequence/utils/calc-repeat-duration.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"calc-repeat-duration.mjs","sources":["../../../../../src/animation/sequence/utils/calc-repeat-duration.ts"],"sourcesContent":["export function calculateRepeatDuration(\n duration: number,\n repeat: number,\n repeatDelay: number\n): number {\n return duration * (repeat + 1) + repeatDelay * repeat\n}\n"],"names":[],"mappings":"SAAgB,uBAAuB,CACnC,QAAgB,EAChB,MAAc,EACd,WAAmB,EAAA;IAEnB,OAAO,QAAQ,IAAI,MAAM,GAAG,CAAC,CAAC,GAAG,WAAW,GAAG,MAAM;AACzD;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/animation/sequence/utils/calc-time.mjs b/node_modules/framer-motion/dist/es/animation/sequence/utils/calc-time.mjs deleted file mode 100644 index 7e600c8..0000000 --- a/node_modules/framer-motion/dist/es/animation/sequence/utils/calc-time.mjs +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Given a absolute or relative time definition and current/prev time state of the sequence, - * calculate an absolute time for the next keyframes. - */ -function calcNextTime(current, next, prev, labels) { - if (typeof next === "number") { - return next; - } - else if (next.startsWith("-") || next.startsWith("+")) { - return Math.max(0, current + parseFloat(next)); - } - else if (next === "<") { - return prev; - } - else if (next.startsWith("<")) { - return Math.max(0, prev + parseFloat(next.slice(1))); - } - else { - return labels.get(next) ?? current; - } -} - -export { calcNextTime }; -//# sourceMappingURL=calc-time.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/sequence/utils/calc-time.mjs.map b/node_modules/framer-motion/dist/es/animation/sequence/utils/calc-time.mjs.map deleted file mode 100644 index 3647333..0000000 --- a/node_modules/framer-motion/dist/es/animation/sequence/utils/calc-time.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"calc-time.mjs","sources":["../../../../../src/animation/sequence/utils/calc-time.ts"],"sourcesContent":["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\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"],"names":[],"mappings":"AAEA;;;AAGG;AACG,SAAU,YAAY,CACxB,OAAe,EACf,IAAkB,EAClB,IAAY,EACZ,MAA2B,EAAA;AAE3B,IAAA,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;AAC1B,QAAA,OAAO,IAAI;IACf;AAAO,SAAA,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;AACrD,QAAA,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;IAClD;AAAO,SAAA,IAAI,IAAI,KAAK,GAAG,EAAE;AACrB,QAAA,OAAO,IAAI;IACf;AAAO,SAAA,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;AAC7B,QAAA,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACxD;SAAO;QACH,OAAO,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,OAAO;IACtC;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/animation/sequence/utils/edit.mjs b/node_modules/framer-motion/dist/es/animation/sequence/utils/edit.mjs deleted file mode 100644 index a140e1b..0000000 --- a/node_modules/framer-motion/dist/es/animation/sequence/utils/edit.mjs +++ /dev/null @@ -1,31 +0,0 @@ -import { mixNumber } from 'motion-dom'; -import { getEasingForSegment, removeItem } from 'motion-utils'; - -function eraseKeyframes(sequence, startTime, endTime) { - for (let i = 0; i < sequence.length; i++) { - const keyframe = sequence[i]; - if (keyframe.at > startTime && keyframe.at < endTime) { - removeItem(sequence, keyframe); - // If we remove this item we have to push the pointer back one - i--; - } - } -} -function addKeyframes(sequence, keyframes, easing, offset, startTime, endTime) { - /** - * Erase every existing value between currentTime and targetTime, - * this will essentially splice this timeline into any currently - * defined ones. - */ - eraseKeyframes(sequence, startTime, endTime); - for (let i = 0; i < keyframes.length; i++) { - sequence.push({ - value: keyframes[i], - at: mixNumber(startTime, endTime, offset[i]), - easing: getEasingForSegment(easing, i), - }); - } -} - -export { addKeyframes, eraseKeyframes }; -//# sourceMappingURL=edit.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/sequence/utils/edit.mjs.map b/node_modules/framer-motion/dist/es/animation/sequence/utils/edit.mjs.map deleted file mode 100644 index f9a56fd..0000000 --- a/node_modules/framer-motion/dist/es/animation/sequence/utils/edit.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"edit.mjs","sources":["../../../../../src/animation/sequence/utils/edit.ts"],"sourcesContent":["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"],"names":[],"mappings":";;;SAIgB,cAAc,CAC1B,QAAuB,EACvB,SAAiB,EACjB,OAAe,EAAA;AAEf,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AACtC,QAAA,MAAM,QAAQ,GAAG,QAAQ,CAAC,CAAC,CAAC;AAE5B,QAAA,IAAI,QAAQ,CAAC,EAAE,GAAG,SAAS,IAAI,QAAQ,CAAC,EAAE,GAAG,OAAO,EAAE;AAClD,YAAA,UAAU,CAAC,QAAQ,EAAE,QAAQ,CAAC;;AAG9B,YAAA,CAAC,EAAE;QACP;IACJ;AACJ;AAEM,SAAU,YAAY,CACxB,QAAuB,EACvB,SAAoC,EACpC,MAAyB,EACzB,MAAgB,EAChB,SAAiB,EACjB,OAAe,EAAA;AAEf;;;;AAIG;AACH,IAAA,cAAc,CAAC,QAAQ,EAAE,SAAS,EAAE,OAAO,CAAC;AAE5C,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACvC,QAAQ,CAAC,IAAI,CAAC;AACV,YAAA,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC;YACnB,EAAE,EAAE,SAAS,CAAC,SAAS,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;AAC5C,YAAA,MAAM,EAAE,mBAAmB,CAAC,MAAM,EAAE,CAAC,CAAC;AACzC,SAAA,CAAC;IACN;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/animation/sequence/utils/normalize-times.mjs b/node_modules/framer-motion/dist/es/animation/sequence/utils/normalize-times.mjs deleted file mode 100644 index 14f6728..0000000 --- a/node_modules/framer-motion/dist/es/animation/sequence/utils/normalize-times.mjs +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Take an array of times that represent repeated keyframes. For instance - * if we have original times of [0, 0.5, 1] then our repeated times will - * be [0, 0.5, 1, 1, 1.5, 2]. Loop over the times and scale them back - * down to a 0-1 scale. - * - * `repeatDelayUnits` is the repeatDelay expressed in units of a single - * iteration's duration, so the total span equals `(repeat + 1) + repeat * repeatDelayUnits`. - */ -function normalizeTimes(times, repeat, repeatDelayUnits = 0) { - const totalUnits = repeat + 1 + repeat * repeatDelayUnits; - for (let i = 0; i < times.length; i++) { - times[i] = times[i] / totalUnits; - } -} - -export { normalizeTimes }; -//# sourceMappingURL=normalize-times.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/sequence/utils/normalize-times.mjs.map b/node_modules/framer-motion/dist/es/animation/sequence/utils/normalize-times.mjs.map deleted file mode 100644 index 26c27ca..0000000 --- a/node_modules/framer-motion/dist/es/animation/sequence/utils/normalize-times.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"normalize-times.mjs","sources":["../../../../../src/animation/sequence/utils/normalize-times.ts"],"sourcesContent":["/**\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"],"names":[],"mappings":"AAAA;;;;;;;;AAQG;AACG,SAAU,cAAc,CAC1B,KAAe,EACf,MAAc,EACd,gBAAgB,GAAG,CAAC,EAAA;IAEpB,MAAM,UAAU,GAAG,MAAM,GAAG,CAAC,GAAG,MAAM,GAAG,gBAAgB;AACzD,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACnC,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,UAAU;IACpC;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/animation/sequence/utils/sort.mjs b/node_modules/framer-motion/dist/es/animation/sequence/utils/sort.mjs deleted file mode 100644 index 49ae938..0000000 --- a/node_modules/framer-motion/dist/es/animation/sequence/utils/sort.mjs +++ /dev/null @@ -1,15 +0,0 @@ -function compareByTime(a, b) { - if (a.at === b.at) { - if (a.value === null) - return 1; - if (b.value === null) - return -1; - return 0; - } - else { - return a.at - b.at; - } -} - -export { compareByTime }; -//# sourceMappingURL=sort.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/sequence/utils/sort.mjs.map b/node_modules/framer-motion/dist/es/animation/sequence/utils/sort.mjs.map deleted file mode 100644 index 148e5d2..0000000 --- a/node_modules/framer-motion/dist/es/animation/sequence/utils/sort.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sort.mjs","sources":["../../../../../src/animation/sequence/utils/sort.ts"],"sourcesContent":["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"],"names":[],"mappings":"AAEM,SAAU,aAAa,CACzB,CAAmB,EACnB,CAAmB,EAAA;IAEnB,IAAI,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,EAAE;AACf,QAAA,IAAI,CAAC,CAAC,KAAK,KAAK,IAAI;AAAE,YAAA,OAAO,CAAC;AAC9B,QAAA,IAAI,CAAC,CAAC,KAAK,KAAK,IAAI;YAAE,OAAO,EAAE;AAC/B,QAAA,OAAO,CAAC;IACZ;SAAO;AACH,QAAA,OAAO,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE;IACtB;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/animation/utils/create-visual-element.mjs b/node_modules/framer-motion/dist/es/animation/utils/create-visual-element.mjs deleted file mode 100644 index d2c7acf..0000000 --- a/node_modules/framer-motion/dist/es/animation/utils/create-visual-element.mjs +++ /dev/null @@ -1,41 +0,0 @@ -import { isSVGElement, isSVGSVGElement, SVGVisualElement, HTMLVisualElement, visualElementStore, ObjectVisualElement } from 'motion-dom'; - -function createDOMVisualElement(element) { - const options = { - presenceContext: null, - props: {}, - visualState: { - renderState: { - transform: {}, - transformOrigin: {}, - style: {}, - vars: {}, - attrs: {}, - }, - latestValues: {}, - }, - }; - const node = isSVGElement(element) && !isSVGSVGElement(element) - ? new SVGVisualElement(options) - : new HTMLVisualElement(options); - node.mount(element); - visualElementStore.set(element, node); -} -function createObjectVisualElement(subject) { - const options = { - presenceContext: null, - props: {}, - visualState: { - renderState: { - output: {}, - }, - latestValues: {}, - }, - }; - const node = new ObjectVisualElement(options); - node.mount(subject); - visualElementStore.set(subject, node); -} - -export { createDOMVisualElement, createObjectVisualElement }; -//# sourceMappingURL=create-visual-element.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/utils/create-visual-element.mjs.map b/node_modules/framer-motion/dist/es/animation/utils/create-visual-element.mjs.map deleted file mode 100644 index 98d7295..0000000 --- a/node_modules/framer-motion/dist/es/animation/utils/create-visual-element.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"create-visual-element.mjs","sources":["../../../../src/animation/utils/create-visual-element.ts"],"sourcesContent":["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"],"names":[],"mappings":";;AASM,SAAU,sBAAsB,CAAC,OAAiC,EAAA;AACpE,IAAA,MAAM,OAAO,GAAG;AACZ,QAAA,eAAe,EAAE,IAAI;AACrB,QAAA,KAAK,EAAE,EAAE;AACT,QAAA,WAAW,EAAE;AACT,YAAA,WAAW,EAAE;AACT,gBAAA,SAAS,EAAE,EAAE;AACb,gBAAA,eAAe,EAAE,EAAE;AACnB,gBAAA,KAAK,EAAE,EAAE;AACT,gBAAA,IAAI,EAAE,EAAE;AACR,gBAAA,KAAK,EAAE,EAAE;AACZ,aAAA;AACD,YAAA,YAAY,EAAE,EAAE;AACnB,SAAA;KACJ;IACD,MAAM,IAAI,GACN,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,eAAe,CAAC,OAAO;AAC7C,UAAE,IAAI,gBAAgB,CAAC,OAAO;AAC9B,UAAE,IAAI,iBAAiB,CAAC,OAAO,CAAC;AAExC,IAAA,IAAI,CAAC,KAAK,CAAC,OAAc,CAAC;AAE1B,IAAA,kBAAkB,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC;AACzC;AAEM,SAAU,yBAAyB,CAAC,OAAe,EAAA;AACrD,IAAA,MAAM,OAAO,GAAG;AACZ,QAAA,eAAe,EAAE,IAAI;AACrB,QAAA,KAAK,EAAE,EAAE;AACT,QAAA,WAAW,EAAE;AACT,YAAA,WAAW,EAAE;AACT,gBAAA,MAAM,EAAE,EAAE;AACb,aAAA;AACD,YAAA,YAAY,EAAE,EAAE;AACnB,SAAA;KACJ;AACD,IAAA,MAAM,IAAI,GAAG,IAAI,mBAAmB,CAAC,OAAO,CAAC;AAE7C,IAAA,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;AAEnB,IAAA,kBAAkB,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC;AACzC;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/animation/utils/is-dom-keyframes.mjs b/node_modules/framer-motion/dist/es/animation/utils/is-dom-keyframes.mjs deleted file mode 100644 index be44507..0000000 --- a/node_modules/framer-motion/dist/es/animation/utils/is-dom-keyframes.mjs +++ /dev/null @@ -1,6 +0,0 @@ -function isDOMKeyframes(keyframes) { - return typeof keyframes === "object" && !Array.isArray(keyframes); -} - -export { isDOMKeyframes }; -//# sourceMappingURL=is-dom-keyframes.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/utils/is-dom-keyframes.mjs.map b/node_modules/framer-motion/dist/es/animation/utils/is-dom-keyframes.mjs.map deleted file mode 100644 index f8089b3..0000000 --- a/node_modules/framer-motion/dist/es/animation/utils/is-dom-keyframes.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"is-dom-keyframes.mjs","sources":["../../../../src/animation/utils/is-dom-keyframes.ts"],"sourcesContent":["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"],"names":[],"mappings":"AAEM,SAAU,cAAc,CAC1B,SAAkB,EAAA;AAElB,IAAA,OAAO,OAAO,SAAS,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC;AACrE;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/client.mjs b/node_modules/framer-motion/dist/es/client.mjs deleted file mode 100644 index ca763ff..0000000 --- a/node_modules/framer-motion/dist/es/client.mjs +++ /dev/null @@ -1,2 +0,0 @@ -export { MotionA as a, MotionAbbr as abbr, MotionAddress as address, MotionAnimate as animate, MotionArea as area, MotionArticle as article, MotionAside as aside, MotionAudio as audio, MotionB as b, MotionBase as base, MotionBdi as bdi, MotionBdo as bdo, MotionBig as big, MotionBlockquote as blockquote, MotionBody as body, MotionButton as button, MotionCanvas as canvas, MotionCaption as caption, MotionCircle as circle, MotionCite as cite, MotionClipPath as clipPath, MotionCode as code, MotionCol as col, MotionColgroup as colgroup, MotionData as data, MotionDatalist as datalist, MotionDd as dd, MotionDefs as defs, MotionDel as del, MotionDesc as desc, MotionDetails as details, MotionDfn as dfn, MotionDialog as dialog, MotionDiv as div, MotionDl as dl, MotionDt as dt, MotionEllipse as ellipse, MotionEm as em, MotionEmbed as embed, MotionFeBlend as feBlend, MotionFeColorMatrix as feColorMatrix, MotionFeComponentTransfer as feComponentTransfer, MotionFeComposite as feComposite, MotionFeConvolveMatrix as feConvolveMatrix, MotionFeDiffuseLighting as feDiffuseLighting, MotionFeDisplacementMap as feDisplacementMap, MotionFeDistantLight as feDistantLight, MotionFeDropShadow as feDropShadow, MotionFeFlood as feFlood, MotionFeFuncA as feFuncA, MotionFeFuncB as feFuncB, MotionFeFuncG as feFuncG, MotionFeFuncR as feFuncR, MotionFeGaussianBlur as feGaussianBlur, MotionFeImage as feImage, MotionFeMerge as feMerge, MotionFeMergeNode as feMergeNode, MotionFeMorphology as feMorphology, MotionFeOffset as feOffset, MotionFePointLight as fePointLight, MotionFeSpecularLighting as feSpecularLighting, MotionFeSpotLight as feSpotLight, MotionFeTile as feTile, MotionFeTurbulence as feTurbulence, MotionFieldset as fieldset, MotionFigcaption as figcaption, MotionFigure as figure, MotionFilter as filter, MotionFooter as footer, MotionForeignObject as foreignObject, MotionForm as form, MotionG as g, MotionH1 as h1, MotionH2 as h2, MotionH3 as h3, MotionH4 as h4, MotionH5 as h5, MotionH6 as h6, MotionHead as head, MotionHeader as header, MotionHgroup as hgroup, MotionHr as hr, MotionHtml as html, MotionI as i, MotionIframe as iframe, MotionImage as image, MotionImg as img, MotionInput as input, MotionIns as ins, MotionKbd as kbd, MotionKeygen as keygen, MotionLabel as label, MotionLegend as legend, MotionLi as li, MotionLine as line, MotionLinearGradient as linearGradient, MotionLink as link, MotionMain as main, MotionMap as map, MotionMark as mark, MotionMarker as marker, MotionMask as mask, MotionMenu as menu, MotionMenuitem as menuitem, MotionMetadata as metadata, MotionMeter as meter, MotionNav as nav, MotionObject as object, MotionOl as ol, MotionOptgroup as optgroup, MotionOption as option, MotionOutput as output, MotionP as p, MotionParam as param, MotionPath as path, MotionPattern as pattern, MotionPicture as picture, MotionPolygon as polygon, MotionPolyline as polyline, MotionPre as pre, MotionProgress as progress, MotionQ as q, MotionRadialGradient as radialGradient, MotionRect as rect, MotionRp as rp, MotionRt as rt, MotionRuby as ruby, MotionS as s, MotionSamp as samp, MotionScript as script, MotionSection as section, MotionSelect as select, MotionSmall as small, MotionSource as source, MotionSpan as span, MotionStop as stop, MotionStrong as strong, MotionStyle as style, MotionSub as sub, MotionSummary as summary, MotionSup as sup, MotionSvg as svg, MotionSymbol as symbol, MotionTable as table, MotionTbody as tbody, MotionTd as td, MotionText as text, MotionTextPath as textPath, MotionTextarea as textarea, MotionTfoot as tfoot, MotionTh as th, MotionThead as thead, MotionTime as time, MotionTitle as title, MotionTr as tr, MotionTrack as track, MotionTspan as tspan, MotionU as u, MotionUl as ul, MotionUse as use, MotionVideo as video, MotionView as view, MotionWbr as wbr, MotionWebview as webview } from './render/components/motion/elements.mjs'; -//# sourceMappingURL=client.mjs.map diff --git a/node_modules/framer-motion/dist/es/client.mjs.map b/node_modules/framer-motion/dist/es/client.mjs.map deleted file mode 100644 index 5835aec..0000000 --- a/node_modules/framer-motion/dist/es/client.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"client.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.mjs b/node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.mjs deleted file mode 100644 index 8f94c28..0000000 --- a/node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.mjs +++ /dev/null @@ -1,118 +0,0 @@ -"use client"; -import { jsx } from 'react/jsx-runtime'; -import { isHTMLElement } from 'motion-dom'; -import * as React from 'react'; -import { useId, useRef, useContext, useInsertionEffect } from 'react'; -import { MotionConfigContext } from '../../context/MotionConfigContext.mjs'; -import { useComposedRefs } from '../../utils/use-composed-ref.mjs'; - -/** - * Measurement functionality has to be within a separate component - * to leverage snapshot lifecycle. - */ -class PopChildMeasure extends React.Component { - getSnapshotBeforeUpdate(prevProps) { - const element = this.props.childRef.current; - if (isHTMLElement(element) && prevProps.isPresent && !this.props.isPresent && this.props.pop !== false) { - const parent = element.offsetParent; - const parentWidth = isHTMLElement(parent) - ? parent.offsetWidth || 0 - : 0; - const parentHeight = isHTMLElement(parent) - ? parent.offsetHeight || 0 - : 0; - const computedStyle = getComputedStyle(element); - const size = this.props.sizeRef.current; - size.height = parseFloat(computedStyle.height); - size.width = parseFloat(computedStyle.width); - size.top = element.offsetTop; - size.left = element.offsetLeft; - size.right = parentWidth - size.width - size.left; - size.bottom = parentHeight - size.height - size.top; - size.direction = computedStyle.direction; - } - return null; - } - /** - * Required with getSnapshotBeforeUpdate to stop React complaining. - */ - componentDidUpdate() { } - render() { - return this.props.children; - } -} -function PopChild({ children, isPresent, anchorX, anchorY, root, pop }) { - const id = useId(); - const ref = useRef(null); - const size = useRef({ - width: 0, - height: 0, - top: 0, - left: 0, - right: 0, - bottom: 0, - direction: "ltr", - }); - const { nonce } = useContext(MotionConfigContext); - /** - * In React 19, refs are passed via props.ref instead of element.ref. - * We check props.ref first (React 19) and fall back to element.ref (React 18). - * - * The composed ref is only used when popping the child out (pop !== false), - * so we avoid reading children.props.ref otherwise. In React 18.3 that read - * triggers a spurious "`ref` is not a prop" warning getter (#3745). - */ - const childRef = pop !== false - ? (children.props?.ref ?? - children?.ref) - : undefined; - const composedRef = useComposedRefs(ref, childRef); - /** - * We create and inject a style block so we can apply this explicit - * sizing in a non-destructive manner by just deleting the style block. - * - * We can't apply size via render as the measurement happens - * in getSnapshotBeforeUpdate (post-render), likewise if we apply the - * styles directly on the DOM node, we might be overwriting - * styles set via the style prop. - */ - useInsertionEffect(() => { - const { width, height, top, left, right, bottom, direction } = size.current; - if (isPresent || pop === false || !ref.current || !width || !height) - return; - const isRTL = direction === "rtl"; - const x = anchorX === "left" - ? (isRTL ? `right: ${right}` : `left: ${left}`) - : (isRTL ? `left: ${left}` : `right: ${right}`); - const y = anchorY === "bottom" ? `bottom: ${bottom}` : `top: ${top}`; - ref.current.dataset.motionPopId = id; - const style = document.createElement("style"); - if (nonce) - style.nonce = nonce; - const parent = root ?? document.head; - parent.appendChild(style); - if (style.sheet) { - style.sheet.insertRule(` - [data-motion-pop-id="${id}"] { - position: absolute !important; - width: ${width}px !important; - height: ${height}px !important; - ${x}px !important; - ${y}px !important; - } - `); - } - return () => { - ref.current?.removeAttribute("data-motion-pop-id"); - if (parent.contains(style)) { - parent.removeChild(style); - } - }; - }, [isPresent]); - return (jsx(PopChildMeasure, { isPresent: isPresent, childRef: ref, sizeRef: size, pop: pop, children: pop === false - ? children - : React.cloneElement(children, { ref: composedRef }) })); -} - -export { PopChild }; -//# sourceMappingURL=PopChild.mjs.map diff --git a/node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.mjs.map b/node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.mjs.map deleted file mode 100644 index 7f8d974..0000000 --- a/node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"PopChild.mjs","sources":["../../../../src/components/AnimatePresence/PopChild.tsx"],"sourcesContent":["\"use client\"\n\nimport { isHTMLElement } from \"motion-dom\"\nimport * as React from \"react\"\nimport { useContext, useId, useInsertionEffect, useRef } from \"react\"\n\nimport { MotionConfigContext } from \"../../context/MotionConfigContext\"\nimport { useComposedRefs } from \"../../utils/use-composed-ref\"\n\ninterface Size {\n width: number\n height: number\n top: number\n left: number\n right: number\n bottom: number\n direction: string\n}\n\ninterface Props {\n children: React.ReactElement\n isPresent: boolean\n anchorX?: \"left\" | \"right\"\n anchorY?: \"top\" | \"bottom\"\n root?: HTMLElement | ShadowRoot\n pop?: boolean\n}\n\ninterface MeasureProps extends Props {\n childRef: React.RefObject\n sizeRef: React.RefObject\n}\n\n/**\n * Measurement functionality has to be within a separate component\n * to leverage snapshot lifecycle.\n */\nclass PopChildMeasure extends React.Component {\n getSnapshotBeforeUpdate(prevProps: MeasureProps) {\n const element = this.props.childRef.current\n if (isHTMLElement(element) && prevProps.isPresent && !this.props.isPresent && this.props.pop !== false) {\n const parent = element.offsetParent\n const parentWidth = isHTMLElement(parent)\n ? parent.offsetWidth || 0\n : 0\n const parentHeight = isHTMLElement(parent)\n ? parent.offsetHeight || 0\n : 0\n\n const computedStyle = getComputedStyle(element)\n const size = this.props.sizeRef.current!\n size.height = parseFloat(computedStyle.height)\n size.width = parseFloat(computedStyle.width)\n size.top = element.offsetTop\n size.left = element.offsetLeft\n size.right = parentWidth - size.width - size.left\n size.bottom = parentHeight - size.height - size.top\n size.direction = computedStyle.direction\n }\n\n return null\n }\n\n /**\n * Required with getSnapshotBeforeUpdate to stop React complaining.\n */\n componentDidUpdate() {}\n\n render() {\n return this.props.children\n }\n}\n\nexport function PopChild({ children, isPresent, anchorX, anchorY, root, pop }: Props) {\n const id = useId()\n const ref = useRef(null)\n const size = useRef({\n width: 0,\n height: 0,\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n direction: \"ltr\",\n })\n const { nonce } = useContext(MotionConfigContext)\n /**\n * In React 19, refs are passed via props.ref instead of element.ref.\n * We check props.ref first (React 19) and fall back to element.ref (React 18).\n *\n * The composed ref is only used when popping the child out (pop !== false),\n * so we avoid reading children.props.ref otherwise. In React 18.3 that read\n * triggers a spurious \"`ref` is not a prop\" warning getter (#3745).\n */\n const childRef =\n pop !== false\n ? ((children.props as { ref?: React.Ref })?.ref ??\n (children as unknown as { ref?: React.Ref })?.ref)\n : undefined\n const composedRef = useComposedRefs(ref, childRef)\n\n /**\n * We create and inject a style block so we can apply this explicit\n * sizing in a non-destructive manner by just deleting the style block.\n *\n * We can't apply size via render as the measurement happens\n * in getSnapshotBeforeUpdate (post-render), likewise if we apply the\n * styles directly on the DOM node, we might be overwriting\n * styles set via the style prop.\n */\n useInsertionEffect(() => {\n const { width, height, top, left, right, bottom, direction } = size.current\n if (isPresent || pop === false || !ref.current || !width || !height) return\n\n const isRTL = direction === \"rtl\"\n const x = anchorX === \"left\"\n ? (isRTL ? `right: ${right}` : `left: ${left}`)\n : (isRTL ? `left: ${left}` : `right: ${right}`)\n const y = anchorY === \"bottom\" ? `bottom: ${bottom}` : `top: ${top}`\n\n ref.current.dataset.motionPopId = id\n\n const style = document.createElement(\"style\")\n if (nonce) style.nonce = nonce\n\n const parent = root ?? document.head\n parent.appendChild(style)\n\n if (style.sheet) {\n style.sheet.insertRule(`\n [data-motion-pop-id=\"${id}\"] {\n position: absolute !important;\n width: ${width}px !important;\n height: ${height}px !important;\n ${x}px !important;\n ${y}px !important;\n }\n `)\n }\n\n return () => {\n ref.current?.removeAttribute(\"data-motion-pop-id\")\n if (parent.contains(style)) {\n parent.removeChild(style)\n }\n }\n }, [isPresent])\n\n return (\n \n {pop === false\n ? children\n : React.cloneElement(children as any, { ref: composedRef })}\n \n )\n}\n"],"names":[],"mappings":";;;;;;;;AAiCA;;;AAGG;AACH;AACI;;;AAGQ;AACA;AACI;;AAEJ;AACI;;AAGJ;;;;AAIA;AACA;AACA;AACA;AACA;;AAGJ;;AAGJ;;AAEG;AACH;;AAGI;;AAEP;AAEK;AACF;AACA;;AAEI;AACA;AACA;AACA;AACA;AACA;AACA;AACH;;AAED;;;;;;;AAOG;AACH;AAEQ;;;;AAKR;;;;;;;;AAQG;;AAEC;AACA;;AAEA;AACA;AACI;AACA;AACJ;;;AAKA;AAAW;AAEX;AACA;AAEA;AACI;;;;;;;;AAQH;;AAGD;AACI;AACA;AACI;;AAER;AACJ;;AAKY;AACA;AAGhB;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs b/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs deleted file mode 100644 index 19d6046..0000000 --- a/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs +++ /dev/null @@ -1,77 +0,0 @@ -"use client"; -import { jsx } from 'react/jsx-runtime'; -import * as React from 'react'; -import { useId, useRef, useMemo } from 'react'; -import { PresenceContext } from '../../context/PresenceContext.mjs'; -import { useConstant } from '../../utils/use-constant.mjs'; -import { useIsomorphicLayoutEffect } from '../../utils/use-isomorphic-effect.mjs'; -import { PopChild } from './PopChild.mjs'; - -const PresenceChild = ({ children, initial, isPresent, onExitComplete, custom, presenceAffectsLayout, mode, anchorX, anchorY, root }) => { - const presenceChildren = useConstant(newChildrenMap); - const id = useId(); - // Written in a layout effect (not render) so discarded concurrent - // renders can't leave the refs pointing at uncommitted state. - const isPresentRef = useRef(isPresent); - const onExitCompleteRef = useRef(onExitComplete); - useIsomorphicLayoutEffect(() => { - isPresentRef.current = isPresent; - onExitCompleteRef.current = onExitComplete; - }); - let isReusedContext = true; - let context = useMemo(() => { - isReusedContext = false; - return { - id, - initial, - isPresent, - custom, - onExitComplete: (childId) => { - presenceChildren.set(childId, true); - for (const isComplete of presenceChildren.values()) { - if (!isComplete) - return; // can stop searching when any is incomplete - } - onExitComplete && onExitComplete(); - }, - register: (childId) => { - presenceChildren.set(childId, false); - return () => { - presenceChildren.delete(childId); - !isPresentRef.current && - !presenceChildren.size && - onExitCompleteRef.current?.(); - }; - }, - }; - }, [isPresent, presenceChildren, onExitComplete]); - /** - * If the presence of a child affects the layout of the components around it, - * we want to make a new context value to ensure they get re-rendered - * so they can detect that layout change. - */ - if (presenceAffectsLayout && isReusedContext) { - context = { ...context }; - } - useMemo(() => { - presenceChildren.forEach((_, key) => presenceChildren.set(key, false)); - }, [isPresent]); - /** - * If there's no `motion` components to fire exit animations, we want to remove this - * component immediately. - */ - React.useEffect(() => { - !isPresent && - !presenceChildren.size && - onExitComplete && - onExitComplete(); - }, [isPresent]); - children = (jsx(PopChild, { pop: mode === "popLayout", isPresent: isPresent, anchorX: anchorX, anchorY: anchorY, root: root, children: children })); - return (jsx(PresenceContext.Provider, { value: context, children: children })); -}; -function newChildrenMap() { - return new Map(); -} - -export { PresenceChild }; -//# sourceMappingURL=PresenceChild.mjs.map diff --git a/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs.map b/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs.map deleted file mode 100644 index ccd1c5d..0000000 --- a/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"PresenceChild.mjs","sources":["../../../../src/components/AnimatePresence/PresenceChild.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport { useId, useMemo, useRef } from \"react\"\nimport {\n PresenceContext,\n type PresenceContextProps,\n} from \"../../context/PresenceContext\"\nimport { VariantLabels } from \"../../motion/types\"\nimport { useConstant } from \"../../utils/use-constant\"\nimport { useIsomorphicLayoutEffect } from \"../../utils/use-isomorphic-effect\"\nimport { PopChild } from \"./PopChild\"\n\ninterface PresenceChildProps {\n children: React.ReactElement\n isPresent: boolean\n onExitComplete?: () => void\n initial?: false | VariantLabels\n custom?: any\n presenceAffectsLayout: boolean\n mode: \"sync\" | \"popLayout\" | \"wait\"\n anchorX?: \"left\" | \"right\"\n anchorY?: \"top\" | \"bottom\"\n root?: HTMLElement | ShadowRoot\n}\n\nexport const PresenceChild = ({\n children,\n initial,\n isPresent,\n onExitComplete,\n custom,\n presenceAffectsLayout,\n mode,\n anchorX,\n anchorY,\n root\n}: PresenceChildProps) => {\n const presenceChildren = useConstant(newChildrenMap)\n const id = useId()\n\n // Written in a layout effect (not render) so discarded concurrent\n // renders can't leave the refs pointing at uncommitted state.\n const isPresentRef = useRef(isPresent)\n const onExitCompleteRef = useRef(onExitComplete)\n useIsomorphicLayoutEffect(() => {\n isPresentRef.current = isPresent\n onExitCompleteRef.current = onExitComplete\n })\n\n let isReusedContext = true\n let context = useMemo((): PresenceContextProps => {\n isReusedContext = false\n return {\n id,\n initial,\n isPresent,\n custom,\n onExitComplete: (childId: string) => {\n presenceChildren.set(childId, true)\n\n for (const isComplete of presenceChildren.values()) {\n if (!isComplete) return // can stop searching when any is incomplete\n }\n\n onExitComplete && onExitComplete()\n },\n register: (childId: string) => {\n presenceChildren.set(childId, false)\n return () => {\n presenceChildren.delete(childId)\n !isPresentRef.current &&\n !presenceChildren.size &&\n onExitCompleteRef.current?.()\n }\n },\n }\n }, [isPresent, presenceChildren, onExitComplete])\n\n /**\n * If the presence of a child affects the layout of the components around it,\n * we want to make a new context value to ensure they get re-rendered\n * so they can detect that layout change.\n */\n if (presenceAffectsLayout && isReusedContext) {\n context = { ...context }\n }\n\n useMemo(() => {\n presenceChildren.forEach((_, key) => presenceChildren.set(key, false))\n }, [isPresent])\n\n /**\n * If there's no `motion` components to fire exit animations, we want to remove this\n * component immediately.\n */\n React.useEffect(() => {\n !isPresent &&\n !presenceChildren.size &&\n onExitComplete &&\n onExitComplete()\n }, [isPresent])\n\n children = (\n \n {children}\n \n )\n\n return (\n \n {children}\n \n )\n}\n\nfunction newChildrenMap(): Map {\n return new Map()\n}\n"],"names":[],"mappings":";;;;;;;;;AA0BO;AAYH;AACA;;;AAIA;AACA;;AAEI;AACA;AACJ;;AAGA;;;;;;;AAOQ;AACI;;AAGI;AAAiB;;;;AAKzB;AACI;AACA;AACI;;;AAGI;AACR;;;;AAKZ;;;;AAIG;AACH;AACI;;;AAIA;AACJ;AAEA;;;AAGG;AACH;AACI;;;AAGI;AACR;AAEA;AAMA;AAKJ;AAEA;;AAEA;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs b/node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs deleted file mode 100644 index 08b3b7f..0000000 --- a/node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs +++ /dev/null @@ -1,181 +0,0 @@ -"use client"; -import { jsx, Fragment } from 'react/jsx-runtime'; -import { useMemo, useRef, useState, useContext } from 'react'; -import { LayoutGroupContext } from '../../context/LayoutGroupContext.mjs'; -import { useConstant } from '../../utils/use-constant.mjs'; -import { useIsomorphicLayoutEffect } from '../../utils/use-isomorphic-effect.mjs'; -import { PresenceChild } from './PresenceChild.mjs'; -import { usePresence } from './use-presence.mjs'; -import { onlyElements, getChildKey } from './utils.mjs'; - -/** - * `AnimatePresence` enables the animation of components that have been removed from the tree. - * - * When adding/removing more than a single child, every child **must** be given a unique `key` prop. - * - * Any `motion` components that have an `exit` property defined will animate out when removed from - * the tree. - * - * ```jsx - * import { motion, AnimatePresence } from 'framer-motion' - * - * export const Items = ({ items }) => ( - * - * {items.map(item => ( - * - * ))} - * - * ) - * ``` - * - * You can sequence exit animations throughout a tree using variants. - * - * If a child contains multiple `motion` components with `exit` props, it will only unmount the child - * once all `motion` components have finished animating out. Likewise, any components using - * `usePresence` all need to call `safeToRemove`. - * - * @public - */ -const AnimatePresence = ({ children, custom, initial = true, onExitComplete, presenceAffectsLayout = true, mode = "sync", propagate = false, anchorX = "left", anchorY = "top", root }) => { - const [isParentPresent, safeToRemove] = usePresence(propagate); - /** - * Filter any children that aren't ReactElements. We can only track components - * between renders with a props.key. - */ - const presentChildren = useMemo(() => onlyElements(children), [children]); - /** - * Track the keys of the currently rendered children. This is used to - * determine which children are exiting. - */ - const presentKeys = propagate && !isParentPresent ? [] : presentChildren.map(getChildKey); - /** - * If `initial={false}` we only want to pass this to components in the first render. - */ - const isInitialRender = useRef(true); - /** - * A ref containing the currently present children. When all exit animations - * are complete, we use this to re-render the component with the latest children - * *committed* rather than the latest children *rendered*. - */ - const pendingPresentChildren = useRef(presentChildren); - /** - * Track which exiting children have finished animating out. - */ - const exitComplete = useConstant(() => new Map()); - /** - * Track which components are currently processing exit to prevent duplicate processing. - */ - const exitingComponents = useRef(new Set()); - /** - * Save children to render as React state. To ensure this component is concurrent-safe, - * we check for exiting children via an effect. - */ - const [diffedChildren, setDiffedChildren] = useState(presentChildren); - const [renderedChildren, setRenderedChildren] = useState(presentChildren); - useIsomorphicLayoutEffect(() => { - if (propagate && !isParentPresent && !renderedChildren.length) { - safeToRemove?.(); - } - }, [isParentPresent, propagate, renderedChildren.length, safeToRemove]); - useIsomorphicLayoutEffect(() => { - isInitialRender.current = false; - pendingPresentChildren.current = presentChildren; - /** - * Update complete status of exiting children. - */ - for (let i = 0; i < renderedChildren.length; i++) { - const key = getChildKey(renderedChildren[i]); - if (!presentKeys.includes(key)) { - if (exitComplete.get(key) !== true) { - exitComplete.set(key, false); - } - } - else { - exitComplete.delete(key); - exitingComponents.current.delete(key); - } - } - }, [renderedChildren, presentKeys.length, presentKeys.join("-")]); - const exitingChildren = []; - if (presentChildren !== diffedChildren) { - let nextChildren = [...presentChildren]; - /** - * Loop through all the currently rendered components and decide which - * are exiting. - */ - for (let i = 0; i < renderedChildren.length; i++) { - const child = renderedChildren[i]; - const key = getChildKey(child); - if (!presentKeys.includes(key)) { - nextChildren.splice(i, 0, child); - exitingChildren.push(child); - } - } - /** - * If we're in "wait" mode, and we have exiting children, we want to - * only render these until they've all exited. - */ - if (mode === "wait" && exitingChildren.length) { - nextChildren = exitingChildren; - } - setRenderedChildren(onlyElements(nextChildren)); - setDiffedChildren(presentChildren); - /** - * Early return to ensure once we've set state with the latest diffed - * children, we can immediately re-render. - */ - return null; - } - if (process.env.NODE_ENV !== "production" && - mode === "wait" && - renderedChildren.length > 1) { - console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`); - } - /** - * If we've been provided a forceRender function by the LayoutGroupContext, - * we can use it to force a re-render amongst all surrounding components once - * all components have finished animating out. - */ - const { forceRender } = useContext(LayoutGroupContext); - return (jsx(Fragment, { children: renderedChildren.map((child) => { - const key = getChildKey(child); - const isPresent = propagate && !isParentPresent - ? false - : presentChildren === renderedChildren || - presentKeys.includes(key); - const onExit = () => { - if (exitingComponents.current.has(key)) { - return; - } - if (exitComplete.has(key)) { - exitingComponents.current.add(key); - exitComplete.set(key, true); - } - else { - return; - } - let isEveryExitComplete = true; - exitComplete.forEach((isExitComplete) => { - if (!isExitComplete) - isEveryExitComplete = false; - }); - if (isEveryExitComplete) { - forceRender?.(); - setRenderedChildren(pendingPresentChildren.current); - propagate && safeToRemove?.(); - onExitComplete && onExitComplete(); - } - }; - return (jsx(PresenceChild, { isPresent: isPresent, initial: !isInitialRender.current || initial - ? undefined - : false, custom: custom, presenceAffectsLayout: presenceAffectsLayout, mode: mode, root: root, onExitComplete: isPresent ? undefined : onExit, anchorX: anchorX, anchorY: anchorY, children: child }, key)); - }) })); -}; - -export { AnimatePresence }; -//# sourceMappingURL=index.mjs.map diff --git a/node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs.map b/node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs.map deleted file mode 100644 index 60048d7..0000000 --- a/node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs","sources":["../../../../src/components/AnimatePresence/index.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport { useContext, useMemo, useRef, useState } from \"react\"\nimport { LayoutGroupContext } from \"../../context/LayoutGroupContext\"\nimport { useConstant } from \"../../utils/use-constant\"\nimport { useIsomorphicLayoutEffect } from \"../../utils/use-isomorphic-effect\"\nimport { PresenceChild } from \"./PresenceChild\"\nimport { AnimatePresenceProps } from \"./types\"\nimport { usePresence } from \"./use-presence\"\nimport { ComponentKey, getChildKey, onlyElements } from \"./utils\"\n\n/**\n * `AnimatePresence` enables the animation of components that have been removed from the tree.\n *\n * When adding/removing more than a single child, every child **must** be given a unique `key` prop.\n *\n * Any `motion` components that have an `exit` property defined will animate out when removed from\n * the tree.\n *\n * ```jsx\n * import { motion, AnimatePresence } from 'framer-motion'\n *\n * export const Items = ({ items }) => (\n * \n * {items.map(item => (\n * \n * ))}\n * \n * )\n * ```\n *\n * You can sequence exit animations throughout a tree using variants.\n *\n * If a child contains multiple `motion` components with `exit` props, it will only unmount the child\n * once all `motion` components have finished animating out. Likewise, any components using\n * `usePresence` all need to call `safeToRemove`.\n *\n * @public\n */\nexport const AnimatePresence = ({\n children,\n custom,\n initial = true,\n onExitComplete,\n presenceAffectsLayout = true,\n mode = \"sync\",\n propagate = false,\n anchorX = \"left\",\n anchorY = \"top\",\n root\n}: React.PropsWithChildren) => {\n const [isParentPresent, safeToRemove] = usePresence(propagate)\n\n /**\n * Filter any children that aren't ReactElements. We can only track components\n * between renders with a props.key.\n */\n const presentChildren = useMemo(() => onlyElements(children), [children])\n\n /**\n * Track the keys of the currently rendered children. This is used to\n * determine which children are exiting.\n */\n const presentKeys =\n propagate && !isParentPresent ? [] : presentChildren.map(getChildKey)\n\n /**\n * If `initial={false}` we only want to pass this to components in the first render.\n */\n const isInitialRender = useRef(true)\n\n /**\n * A ref containing the currently present children. When all exit animations\n * are complete, we use this to re-render the component with the latest children\n * *committed* rather than the latest children *rendered*.\n */\n const pendingPresentChildren = useRef(presentChildren)\n\n /**\n * Track which exiting children have finished animating out.\n */\n const exitComplete = useConstant(() => new Map())\n\n /**\n * Track which components are currently processing exit to prevent duplicate processing.\n */\n const exitingComponents = useRef(new Set())\n\n /**\n * Save children to render as React state. To ensure this component is concurrent-safe,\n * we check for exiting children via an effect.\n */\n const [diffedChildren, setDiffedChildren] = useState(presentChildren)\n const [renderedChildren, setRenderedChildren] = useState(presentChildren)\n\n useIsomorphicLayoutEffect(() => {\n if (propagate && !isParentPresent && !renderedChildren.length) {\n safeToRemove?.()\n }\n }, [isParentPresent, propagate, renderedChildren.length, safeToRemove])\n\n useIsomorphicLayoutEffect(() => {\n isInitialRender.current = false\n pendingPresentChildren.current = presentChildren\n\n /**\n * Update complete status of exiting children.\n */\n for (let i = 0; i < renderedChildren.length; i++) {\n const key = getChildKey(renderedChildren[i])\n\n if (!presentKeys.includes(key)) {\n if (exitComplete.get(key) !== true) {\n exitComplete.set(key, false)\n }\n } else {\n exitComplete.delete(key)\n exitingComponents.current.delete(key)\n }\n }\n }, [renderedChildren, presentKeys.length, presentKeys.join(\"-\")])\n\n const exitingChildren: any[] = []\n\n if (presentChildren !== diffedChildren) {\n let nextChildren = [...presentChildren]\n\n /**\n * Loop through all the currently rendered components and decide which\n * are exiting.\n */\n for (let i = 0; i < renderedChildren.length; i++) {\n const child = renderedChildren[i]\n const key = getChildKey(child)\n\n if (!presentKeys.includes(key)) {\n nextChildren.splice(i, 0, child)\n exitingChildren.push(child)\n }\n }\n\n /**\n * If we're in \"wait\" mode, and we have exiting children, we want to\n * only render these until they've all exited.\n */\n if (mode === \"wait\" && exitingChildren.length) {\n nextChildren = exitingChildren\n }\n\n setRenderedChildren(onlyElements(nextChildren))\n setDiffedChildren(presentChildren)\n\n /**\n * Early return to ensure once we've set state with the latest diffed\n * children, we can immediately re-render.\n */\n return null\n }\n\n if (\n process.env.NODE_ENV !== \"production\" &&\n mode === \"wait\" &&\n renderedChildren.length > 1\n ) {\n console.warn(\n `You're attempting to animate multiple children within AnimatePresence, but its mode is set to \"wait\". This will lead to odd visual behaviour.`\n )\n }\n\n /**\n * If we've been provided a forceRender function by the LayoutGroupContext,\n * we can use it to force a re-render amongst all surrounding components once\n * all components have finished animating out.\n */\n const { forceRender } = useContext(LayoutGroupContext)\n\n return (\n <>\n {renderedChildren.map((child) => {\n const key = getChildKey(child)\n\n const isPresent =\n propagate && !isParentPresent\n ? false\n : presentChildren === renderedChildren ||\n presentKeys.includes(key)\n\n const onExit = () => {\n if (exitingComponents.current.has(key)) {\n return\n }\n\n if (exitComplete.has(key)) {\n exitingComponents.current.add(key)\n exitComplete.set(key, true)\n } else {\n return\n }\n\n let isEveryExitComplete = true\n exitComplete.forEach((isExitComplete) => {\n if (!isExitComplete) isEveryExitComplete = false\n })\n\n if (isEveryExitComplete) {\n forceRender?.()\n setRenderedChildren(pendingPresentChildren.current)\n\n propagate && safeToRemove?.()\n\n onExitComplete && onExitComplete()\n }\n }\n\n return (\n \n {child}\n \n )\n })}\n \n )\n}\n"],"names":[],"mappings":";;;;;;;;;;AAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCG;AACI;;AAcH;;;AAGG;AACH;AAEA;;;AAGG;AACH;AAGA;;AAEG;AACH;AAEA;;;;AAIG;AACH;AAEA;;AAEG;;AAGH;;AAEG;;AAGH;;;AAGG;;;;;;;AAQH;;AAGI;AACA;AAEA;;AAEG;AACH;;;;AAKY;;;;AAGJ;AACA;;;AAGZ;;AAIA;AACI;AAEA;;;AAGG;AACH;AACI;AACA;;;AAII;;;AAIR;;;AAGG;;;;AAKH;;AAGA;;;AAGG;AACH;;AAGJ;AAEI;AACA;AAEA;;AAKJ;;;;AAIG;;;AAMS;AAEA;AAEQ;;AAEE;;;;;AAON;AACI;AACA;;;;;;AAMJ;AACI;;AACJ;;;AAII;AAEA;;;AAIR;AAEA;AAMgB;;;AAiBhC;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence-data.mjs b/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence-data.mjs deleted file mode 100644 index 8f0f305..0000000 --- a/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence-data.mjs +++ /dev/null @@ -1,11 +0,0 @@ -"use client"; -import { useContext } from 'react'; -import { PresenceContext } from '../../context/PresenceContext.mjs'; - -function usePresenceData() { - const context = useContext(PresenceContext); - return context ? context.custom : undefined; -} - -export { usePresenceData }; -//# sourceMappingURL=use-presence-data.mjs.map diff --git a/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence-data.mjs.map b/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence-data.mjs.map deleted file mode 100644 index a94db78..0000000 --- a/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence-data.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"use-presence-data.mjs","sources":["../../../../src/components/AnimatePresence/use-presence-data.ts"],"sourcesContent":["\"use client\"\n\nimport { useContext } from \"react\"\nimport { PresenceContext } from \"../../context/PresenceContext\"\n\nexport function usePresenceData() {\n const context = useContext(PresenceContext)\n return context ? context.custom : undefined\n}\n"],"names":[],"mappings":";;;;;AAMI;;AAEJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.mjs b/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.mjs deleted file mode 100644 index 462598e..0000000 --- a/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.mjs +++ /dev/null @@ -1,72 +0,0 @@ -"use client"; -import { useContext, useId, useEffect, useCallback } from 'react'; -import { PresenceContext } from '../../context/PresenceContext.mjs'; - -/** - * When a component is the child of `AnimatePresence`, it can use `usePresence` - * to access information about whether it's still present in the React tree. - * - * ```jsx - * import { usePresence } from "framer-motion" - * - * export const Component = () => { - * const [isPresent, safeToRemove] = usePresence() - * - * useEffect(() => { - * !isPresent && setTimeout(safeToRemove, 1000) - * }, [isPresent]) - * - * return

- * } - * ``` - * - * If `isPresent` is `false`, it means that a component has been removed from the tree, - * but `AnimatePresence` won't really remove it until `safeToRemove` has been called. - * - * @public - */ -function usePresence(subscribe = true) { - const context = useContext(PresenceContext); - if (context === null) - return [true, null]; - const { isPresent, onExitComplete, register } = context; - // It's safe to call the following hooks conditionally (after an early return) because the context will always - // either be null or non-null for the lifespan of the component. - const id = useId(); - useEffect(() => { - if (subscribe) { - return register(id); - } - }, [subscribe]); - const safeToRemove = useCallback(() => subscribe && onExitComplete && onExitComplete(id), [id, onExitComplete, subscribe]); - return !isPresent && onExitComplete ? [false, safeToRemove] : [true]; -} -/** - * Similar to `usePresence`, except `useIsPresent` simply returns whether or not the component is present. - * There is no `safeToRemove` function. - * - * ```jsx - * import { useIsPresent } from "framer-motion" - * - * export const Component = () => { - * const isPresent = useIsPresent() - * - * useEffect(() => { - * !isPresent && console.log("I've been removed!") - * }, [isPresent]) - * - * return
- * } - * ``` - * - * @public - */ -function useIsPresent() { - return isPresent(useContext(PresenceContext)); -} -function isPresent(context) { - return context === null ? true : context.isPresent; -} - -export { isPresent, useIsPresent, usePresence }; -//# sourceMappingURL=use-presence.mjs.map diff --git a/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.mjs.map b/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.mjs.map deleted file mode 100644 index a3af893..0000000 --- a/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"use-presence.mjs","sources":["../../../../src/components/AnimatePresence/use-presence.ts"],"sourcesContent":["\"use client\"\n\nimport { useCallback, useContext, useEffect, useId } from \"react\"\nimport {\n PresenceContext,\n PresenceContextProps,\n} from \"../../context/PresenceContext\"\n\nexport type SafeToRemove = () => void\n\ntype AlwaysPresent = [true, null]\n\ntype Present = [true]\n\ntype NotPresent = [false, SafeToRemove]\n\n/**\n * When a component is the child of `AnimatePresence`, it can use `usePresence`\n * to access information about whether it's still present in the React tree.\n *\n * ```jsx\n * import { usePresence } from \"framer-motion\"\n *\n * export const Component = () => {\n * const [isPresent, safeToRemove] = usePresence()\n *\n * useEffect(() => {\n * !isPresent && setTimeout(safeToRemove, 1000)\n * }, [isPresent])\n *\n * return
\n * }\n * ```\n *\n * If `isPresent` is `false`, it means that a component has been removed from the tree,\n * but `AnimatePresence` won't really remove it until `safeToRemove` has been called.\n *\n * @public\n */\nexport function usePresence(\n subscribe: boolean = true\n): AlwaysPresent | Present | NotPresent {\n const context = useContext(PresenceContext)\n\n if (context === null) return [true, null]\n\n const { isPresent, onExitComplete, register } = context\n\n // It's safe to call the following hooks conditionally (after an early return) because the context will always\n // either be null or non-null for the lifespan of the component.\n\n const id = useId()\n useEffect(() => {\n if (subscribe) {\n return register(id)\n }\n }, [subscribe])\n\n const safeToRemove = useCallback(\n () => subscribe && onExitComplete && onExitComplete(id),\n [id, onExitComplete, subscribe]\n )\n\n return !isPresent && onExitComplete ? [false, safeToRemove] : [true]\n}\n\n/**\n * Similar to `usePresence`, except `useIsPresent` simply returns whether or not the component is present.\n * There is no `safeToRemove` function.\n *\n * ```jsx\n * import { useIsPresent } from \"framer-motion\"\n *\n * export const Component = () => {\n * const isPresent = useIsPresent()\n *\n * useEffect(() => {\n * !isPresent && console.log(\"I've been removed!\")\n * }, [isPresent])\n *\n * return
\n * }\n * ```\n *\n * @public\n */\nexport function useIsPresent() {\n return isPresent(useContext(PresenceContext))\n}\n\nexport function isPresent(context: PresenceContextProps | null) {\n return context === null ? true : context.isPresent\n}\n"],"names":[],"mappings":";;;;AAgBA;;;;;;;;;;;;;;;;;;;;;;AAsBG;AACG;AAGF;;AAEsB;;;;AAOtB;;;AAGQ;;AAER;;AAOA;AACJ;AAEA;;;;;;;;;;;;;;;;;;;AAmBG;;AAEC;AACJ;AAEM;AACF;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/components/AnimatePresence/utils.mjs b/node_modules/framer-motion/dist/es/components/AnimatePresence/utils.mjs deleted file mode 100644 index 31b4bc8..0000000 --- a/node_modules/framer-motion/dist/es/components/AnimatePresence/utils.mjs +++ /dev/null @@ -1,15 +0,0 @@ -import { Children, isValidElement } from 'react'; - -const getChildKey = (child) => child.key || ""; -function onlyElements(children) { - const filtered = []; - // We use forEach here instead of map as map mutates the component key by preprending `.$` - Children.forEach(children, (child) => { - if (isValidElement(child)) - filtered.push(child); - }); - return filtered; -} - -export { getChildKey, onlyElements }; -//# sourceMappingURL=utils.mjs.map diff --git a/node_modules/framer-motion/dist/es/components/AnimatePresence/utils.mjs.map b/node_modules/framer-motion/dist/es/components/AnimatePresence/utils.mjs.map deleted file mode 100644 index 5679804..0000000 --- a/node_modules/framer-motion/dist/es/components/AnimatePresence/utils.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.mjs","sources":["../../../../src/components/AnimatePresence/utils.ts"],"sourcesContent":["import { isValidElement, Children, ReactElement, ReactNode } from \"react\"\n\nexport type ComponentKey = string | number\n\nexport const getChildKey = (child: ReactElement): ComponentKey =>\n child.key || \"\"\n\nexport function onlyElements(children: ReactNode): ReactElement[] {\n const filtered: ReactElement[] = []\n\n // We use forEach here instead of map as map mutates the component key by preprending `.$`\n Children.forEach(children, (child) => {\n if (isValidElement(child)) filtered.push(child)\n })\n\n return filtered\n}\n"],"names":[],"mappings":";;AAIO,MAAM,WAAW,GAAG,CAAC,KAAwB,KAChD,KAAK,CAAC,GAAG,IAAI;AAEX,SAAU,YAAY,CAAC,QAAmB,EAAA;IAC5C,MAAM,QAAQ,GAAwB,EAAE;;IAGxC,QAAQ,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,KAAK,KAAI;QACjC,IAAI,cAAc,CAAC,KAAK,CAAC;AAAE,YAAA,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC;AACnD,IAAA,CAAC,CAAC;AAEF,IAAA,OAAO,QAAQ;AACnB;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/components/AnimateSharedLayout.mjs b/node_modules/framer-motion/dist/es/components/AnimateSharedLayout.mjs deleted file mode 100644 index 13a4147..0000000 --- a/node_modules/framer-motion/dist/es/components/AnimateSharedLayout.mjs +++ /dev/null @@ -1,17 +0,0 @@ -"use client"; -import { jsx } from 'react/jsx-runtime'; -import { invariant } from 'motion-utils'; -import * as React from 'react'; -import { useConstant } from '../utils/use-constant.mjs'; -import { LayoutGroup } from './LayoutGroup/index.mjs'; - -let id = 0; -const AnimateSharedLayout = ({ children }) => { - React.useEffect(() => { - invariant(false, "AnimateSharedLayout is deprecated: https://www.framer.com/docs/guide-upgrade/##shared-layout-animations"); - }, []); - return (jsx(LayoutGroup, { id: useConstant(() => `asl-${id++}`), children: children })); -}; - -export { AnimateSharedLayout }; -//# sourceMappingURL=AnimateSharedLayout.mjs.map diff --git a/node_modules/framer-motion/dist/es/components/AnimateSharedLayout.mjs.map b/node_modules/framer-motion/dist/es/components/AnimateSharedLayout.mjs.map deleted file mode 100644 index 4fb5031..0000000 --- a/node_modules/framer-motion/dist/es/components/AnimateSharedLayout.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"AnimateSharedLayout.mjs","sources":["../../../src/components/AnimateSharedLayout.tsx"],"sourcesContent":["\"use client\"\n\nimport { invariant } from \"motion-utils\"\nimport * as React from \"react\"\nimport { useConstant } from \"../utils/use-constant\"\nimport { LayoutGroup } from \"./LayoutGroup\"\n\nlet id = 0\nexport const AnimateSharedLayout: React.FunctionComponent<\n React.PropsWithChildren\n> = ({ children }: React.PropsWithChildren<{}>) => {\n React.useEffect(() => {\n invariant(\n false,\n \"AnimateSharedLayout is deprecated: https://www.framer.com/docs/guide-upgrade/##shared-layout-animations\"\n )\n }, [])\n\n return (\n `asl-${id++}`)}>\n {children}\n \n )\n}\n"],"names":[],"mappings":";;;;;;;AAOA;;AAII;AACI;;;AAWR;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/components/LayoutGroup/index.mjs b/node_modules/framer-motion/dist/es/components/LayoutGroup/index.mjs deleted file mode 100644 index 4d5b36d..0000000 --- a/node_modules/framer-motion/dist/es/components/LayoutGroup/index.mjs +++ /dev/null @@ -1,33 +0,0 @@ -"use client"; -import { jsx } from 'react/jsx-runtime'; -import { useContext, useRef, useMemo } from 'react'; -import { LayoutGroupContext } from '../../context/LayoutGroupContext.mjs'; -import { DeprecatedLayoutGroupContext } from '../../context/DeprecatedLayoutGroupContext.mjs'; -import { useForceUpdate } from '../../utils/use-force-update.mjs'; -import { nodeGroup } from 'motion-dom'; - -const shouldInheritGroup = (inherit) => inherit === true; -const shouldInheritId = (inherit) => shouldInheritGroup(inherit === true) || inherit === "id"; -const LayoutGroup = ({ children, id, inherit = true }) => { - const layoutGroupContext = useContext(LayoutGroupContext); - const deprecatedLayoutGroupContext = useContext(DeprecatedLayoutGroupContext); - const [forceRender, key] = useForceUpdate(); - const context = useRef(null); - const upstreamId = layoutGroupContext.id || deprecatedLayoutGroupContext; - if (context.current === null) { - if (shouldInheritId(inherit) && upstreamId) { - id = id ? upstreamId + "-" + id : upstreamId; - } - context.current = { - id, - group: shouldInheritGroup(inherit) - ? layoutGroupContext.group || nodeGroup() - : nodeGroup(), - }; - } - const memoizedContext = useMemo(() => ({ ...context.current, forceRender }), [key]); - return (jsx(LayoutGroupContext.Provider, { value: memoizedContext, children: children })); -}; - -export { LayoutGroup }; -//# sourceMappingURL=index.mjs.map diff --git a/node_modules/framer-motion/dist/es/components/LayoutGroup/index.mjs.map b/node_modules/framer-motion/dist/es/components/LayoutGroup/index.mjs.map deleted file mode 100644 index f429a6f..0000000 --- a/node_modules/framer-motion/dist/es/components/LayoutGroup/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs","sources":["../../../../src/components/LayoutGroup/index.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport { MutableRefObject, useContext, useMemo, useRef } from \"react\"\nimport {\n LayoutGroupContext,\n LayoutGroupContextProps,\n} from \"../../context/LayoutGroupContext\"\nimport { DeprecatedLayoutGroupContext } from \"../../context/DeprecatedLayoutGroupContext\"\nimport { nodeGroup } from \"../../projection\"\nimport { useForceUpdate } from \"../../utils/use-force-update\"\n\ntype InheritOption = boolean | \"id\"\n\nexport interface Props {\n id?: string\n inherit?: InheritOption\n}\n\nconst shouldInheritGroup = (inherit: InheritOption) => inherit === true\nconst shouldInheritId = (inherit: InheritOption) =>\n shouldInheritGroup(inherit === true) || inherit === \"id\"\n\nexport const LayoutGroup: React.FunctionComponent<\n React.PropsWithChildren\n> = ({ children, id, inherit = true }) => {\n const layoutGroupContext = useContext(LayoutGroupContext)\n const deprecatedLayoutGroupContext = useContext(\n DeprecatedLayoutGroupContext\n )\n const [forceRender, key] = useForceUpdate()\n const context = useRef(\n null\n ) as MutableRefObject\n\n const upstreamId = layoutGroupContext.id || deprecatedLayoutGroupContext\n if (context.current === null) {\n if (shouldInheritId(inherit) && upstreamId) {\n id = id ? upstreamId + \"-\" + id : upstreamId\n }\n\n context.current = {\n id,\n group: shouldInheritGroup(inherit)\n ? layoutGroupContext.group || nodeGroup()\n : nodeGroup(),\n }\n }\n\n const memoizedContext = useMemo(\n () => ({ ...context.current, forceRender }),\n [key]\n )\n\n return (\n \n {children}\n \n )\n}\n"],"names":[],"mappings":";;;;;;;;AAmBA;AACA;AAGO;AAGH;AACA;;AAIA;AAIA;AACA;AACI;AACI;;;;AAKA;AACI;;;;;AAUZ;AAKJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/components/LazyMotion/index.mjs b/node_modules/framer-motion/dist/es/components/LazyMotion/index.mjs deleted file mode 100644 index 2b051f1..0000000 --- a/node_modules/framer-motion/dist/es/components/LazyMotion/index.mjs +++ /dev/null @@ -1,69 +0,0 @@ -"use client"; -import { jsx } from 'react/jsx-runtime'; -import { useState, useRef, useEffect } from 'react'; -import { LazyContext } from '../../context/LazyContext.mjs'; -import { loadFeatures } from '../../motion/features/load-features.mjs'; - -/** - * Used in conjunction with the `m` component to reduce bundle size. - * - * `m` is a version of the `motion` component that only loads functionality - * critical for the initial render. - * - * `LazyMotion` can then be used to either synchronously or asynchronously - * load animation and gesture support. - * - * ```jsx - * // Synchronous loading - * import { LazyMotion, m, domAnimation } from "framer-motion" - * - * function App() { - * return ( - * - * - * - * ) - * } - * - * // Asynchronous loading - * import { LazyMotion, m } from "framer-motion" - * - * function App() { - * return ( - * import('./path/to/domAnimation')}> - * - * - * ) - * } - * ``` - * - * @public - */ -function LazyMotion({ children, features, strict = false }) { - const [, setIsLoaded] = useState(!isLazyBundle(features)); - const loadedRenderer = useRef(undefined); - /** - * If this is a synchronous load, load features immediately - */ - if (!isLazyBundle(features)) { - const { renderer, ...loadedFeatures } = features; - loadedRenderer.current = renderer; - loadFeatures(loadedFeatures); - } - useEffect(() => { - if (isLazyBundle(features)) { - features().then(({ renderer, ...loadedFeatures }) => { - loadFeatures(loadedFeatures); - loadedRenderer.current = renderer; - setIsLoaded(true); - }); - } - }, []); - return (jsx(LazyContext.Provider, { value: { renderer: loadedRenderer.current, strict }, children: children })); -} -function isLazyBundle(features) { - return typeof features === "function"; -} - -export { LazyMotion }; -//# sourceMappingURL=index.mjs.map diff --git a/node_modules/framer-motion/dist/es/components/LazyMotion/index.mjs.map b/node_modules/framer-motion/dist/es/components/LazyMotion/index.mjs.map deleted file mode 100644 index d33ba6c..0000000 --- a/node_modules/framer-motion/dist/es/components/LazyMotion/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs","sources":["../../../../src/components/LazyMotion/index.tsx"],"sourcesContent":["\"use client\"\n\nimport { useEffect, useRef, useState } from \"react\"\nimport { LazyContext } from \"../../context/LazyContext\"\nimport { loadFeatures } from \"../../motion/features/load-features\"\nimport { FeatureBundle, LazyFeatureBundle } from \"../../motion/features/types\"\nimport { CreateVisualElement } from \"../../render/types\"\nimport { LazyProps } from \"./types\"\n\n/**\n * Used in conjunction with the `m` component to reduce bundle size.\n *\n * `m` is a version of the `motion` component that only loads functionality\n * critical for the initial render.\n *\n * `LazyMotion` can then be used to either synchronously or asynchronously\n * load animation and gesture support.\n *\n * ```jsx\n * // Synchronous loading\n * import { LazyMotion, m, domAnimation } from \"framer-motion\"\n *\n * function App() {\n * return (\n * \n * \n * \n * )\n * }\n *\n * // Asynchronous loading\n * import { LazyMotion, m } from \"framer-motion\"\n *\n * function App() {\n * return (\n * import('./path/to/domAnimation')}>\n * \n * \n * )\n * }\n * ```\n *\n * @public\n */\nexport function LazyMotion({ children, features, strict = false }: LazyProps) {\n const [, setIsLoaded] = useState(!isLazyBundle(features))\n const loadedRenderer = useRef(undefined)\n\n /**\n * If this is a synchronous load, load features immediately\n */\n if (!isLazyBundle(features)) {\n const { renderer, ...loadedFeatures } = features\n loadedRenderer.current = renderer\n loadFeatures(loadedFeatures)\n }\n\n useEffect(() => {\n if (isLazyBundle(features)) {\n features().then(({ renderer, ...loadedFeatures }) => {\n loadFeatures(loadedFeatures)\n loadedRenderer.current = renderer\n setIsLoaded(true)\n })\n }\n }, [])\n\n return (\n \n {children}\n \n )\n}\n\nfunction isLazyBundle(\n features: FeatureBundle | LazyFeatureBundle\n): features is LazyFeatureBundle {\n return typeof features === \"function\"\n}\n"],"names":[],"mappings":";;;;;;AASA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCG;AACG;AACF;AACA;AAEA;;AAEG;AACH;;AAEI;;;;AAKA;AACI;;AAEI;;AAEJ;;;;AAWZ;AAEA;AAGI;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/components/MotionConfig/index.mjs b/node_modules/framer-motion/dist/es/components/MotionConfig/index.mjs deleted file mode 100644 index f9700e2..0000000 --- a/node_modules/framer-motion/dist/es/components/MotionConfig/index.mjs +++ /dev/null @@ -1,52 +0,0 @@ -"use client"; -import { jsx } from 'react/jsx-runtime'; -import { useContext, useMemo } from 'react'; -import { resolveTransition } from 'motion-dom'; -import { MotionConfigContext } from '../../context/MotionConfigContext.mjs'; -import { useConstant } from '../../utils/use-constant.mjs'; - -/** - * `MotionConfig` is used to set configuration options for all children `motion` components. - * - * ```jsx - * import { motion, MotionConfig } from "framer-motion" - * - * export function App() { - * return ( - * - * - * - * ) - * } - * ``` - * - * @public - */ -function MotionConfig({ children, ...config }) { - /** - * Inherit props from any parent MotionConfig components - */ - const parentConfig = useContext(MotionConfigContext); - config = { ...parentConfig, ...config }; - config.transition = resolveTransition(config.transition, parentConfig.transition); - /** - * Don't allow isStatic to change between renders as it affects how many hooks - * motion components fire. - */ - config.isStatic = useConstant(() => config.isStatic); - /** - * Creating a new config context object will re-render every `motion` component - * every time it renders. So we only want to create a new one sparingly. - */ - const context = useMemo(() => config, [ - JSON.stringify(config.transition), - config.transformPagePoint, - config.reducedMotion, - config.skipAnimations, - config.isValidProp, - ]); - return (jsx(MotionConfigContext.Provider, { value: context, children: children })); -} - -export { MotionConfig }; -//# sourceMappingURL=index.mjs.map diff --git a/node_modules/framer-motion/dist/es/components/MotionConfig/index.mjs.map b/node_modules/framer-motion/dist/es/components/MotionConfig/index.mjs.map deleted file mode 100644 index ee5860c..0000000 --- a/node_modules/framer-motion/dist/es/components/MotionConfig/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs","sources":["../../../../src/components/MotionConfig/index.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport { useContext, useMemo } from \"react\"\nimport { resolveTransition } from \"motion-dom\"\nimport { MotionConfigContext } from \"../../context/MotionConfigContext\"\nimport { useConstant } from \"../../utils/use-constant\"\n\nexport interface MotionConfigProps extends Partial {\n children?: React.ReactNode\n}\n\n/**\n * `MotionConfig` is used to set configuration options for all children `motion` components.\n *\n * ```jsx\n * import { motion, MotionConfig } from \"framer-motion\"\n *\n * export function App() {\n * return (\n * \n * \n * \n * )\n * }\n * ```\n *\n * @public\n */\nexport function MotionConfig({ children, ...config }: MotionConfigProps) {\n /**\n * Inherit props from any parent MotionConfig components\n */\n const parentConfig = useContext(MotionConfigContext)\n config = { ...parentConfig, ...config }\n\n config.transition = resolveTransition(\n config.transition,\n parentConfig.transition\n )\n\n /**\n * Don't allow isStatic to change between renders as it affects how many hooks\n * motion components fire.\n */\n config.isStatic = useConstant(() => config.isStatic)\n\n /**\n * Creating a new config context object will re-render every `motion` component\n * every time it renders. So we only want to create a new one sparingly.\n */\n const context = useMemo(\n () => config,\n [\n JSON.stringify(config.transition),\n config.transformPagePoint,\n config.reducedMotion,\n config.skipAnimations,\n config.isValidProp,\n ]\n )\n\n return (\n \n {children}\n \n )\n}\n"],"names":[],"mappings":";;;;;;;AAYA;;;;;;;;;;;;;;;;AAgBG;AACG;AACF;;AAEG;AACH;;AAGA;AAKA;;;AAGG;AACH;AAEA;;;AAGG;;AAIK;AACA;AACA;AACA;AACA;AACH;AAGL;AAKJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/components/Reorder/Group.mjs b/node_modules/framer-motion/dist/es/components/Reorder/Group.mjs deleted file mode 100644 index 1acac79..0000000 --- a/node_modules/framer-motion/dist/es/components/Reorder/Group.mjs +++ /dev/null @@ -1,88 +0,0 @@ -"use client"; -import { jsx } from 'react/jsx-runtime'; -import { invariant } from 'motion-utils'; -import { forwardRef, useRef, useState, useEffect } from 'react'; -import { ReorderContext } from '../../context/ReorderContext.mjs'; -import { motion } from '../../render/components/motion/proxy.mjs'; -import { useConstant } from '../../utils/use-constant.mjs'; -import { checkReorder } from './utils/check-reorder.mjs'; -import { detectAxis } from './utils/detect-axis.mjs'; - -function ReorderGroupComponent({ children, as = "ul", axis: axisOverride, onReorder, values, ...props }, externalRef) { - const Component = useConstant(() => motion[as]); - const itemLayouts = useRef(new Map()); - const [detectedAxis, setDetectedAxis] = useState("y"); - const isReordering = useRef(false); - const groupRef = useRef(null); - const axis = axisOverride || detectedAxis; - invariant(Boolean(values), "Reorder.Group must be provided a values prop", "reorder-values"); - const valuesSet = new Set(values); - itemLayouts.current.forEach((_, value) => { - if (!valuesSet.has(value)) - itemLayouts.current.delete(value); - }); - const context = { - axis, - groupRef, - registerItem: (value, layout) => { - itemLayouts.current.set(value, layout); - if (!axisOverride) { - const nextAxis = detectAxis(values.flatMap((itemValue) => { - const itemLayout = itemLayouts.current.get(itemValue); - return itemLayout ? [itemLayout] : []; - })); - if (nextAxis !== detectedAxis) - setDetectedAxis(nextAxis); - } - }, - updateOrder: (item, offset, velocity) => { - if (isReordering.current) - return; - const order = values.flatMap((value) => { - const layout = itemLayouts.current.get(value); - return layout ? [{ value, layout }] : []; - }); - const direction = groupRef.current?.ownerDocument.defaultView?.getComputedStyle(groupRef.current).direction === "rtl" - ? "rtl" - : "ltr"; - const newOrder = checkReorder(order, item, offset, velocity, axis, direction); - if (order !== newOrder) { - isReordering.current = true; - const newValues = [...values]; - const measuredIndexes = order.map(({ value }) => values.indexOf(value)); - newOrder.forEach(({ value }, index) => { - newValues[measuredIndexes[index]] = value; - }); - onReorder(newValues); - } - }, - }; - useEffect(() => { - isReordering.current = false; - }); - // Combine refs if external ref is provided - const setRef = (element) => { - groupRef.current = element; - if (typeof externalRef === "function") { - externalRef(element); - } - else if (externalRef) { - externalRef.current = - element; - } - }; - /** - * Disable browser scroll anchoring on the group container. - * When items reorder, scroll anchoring can cause the browser to adjust - * the scroll position, which interferes with drag position calculations. - */ - const groupStyle = { - overflowAnchor: "none", - ...props.style, - }; - return (jsx(Component, { ...props, style: groupStyle, ref: setRef, ignoreStrict: true, children: jsx(ReorderContext.Provider, { value: context, children: children }) })); -} -const ReorderGroup = /*@__PURE__*/ forwardRef(ReorderGroupComponent); - -export { ReorderGroup, ReorderGroupComponent }; -//# sourceMappingURL=Group.mjs.map diff --git a/node_modules/framer-motion/dist/es/components/Reorder/Group.mjs.map b/node_modules/framer-motion/dist/es/components/Reorder/Group.mjs.map deleted file mode 100644 index 2b6ba21..0000000 --- a/node_modules/framer-motion/dist/es/components/Reorder/Group.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Group.mjs","sources":["../../../../src/components/Reorder/Group.tsx"],"sourcesContent":["\"use client\"\n\nimport { invariant } from \"motion-utils\"\nimport * as React from \"react\"\nimport {\n forwardRef,\n FunctionComponent,\n JSX,\n useEffect,\n useRef,\n useState,\n} from \"react\"\nimport { ReorderContext } from \"../../context/ReorderContext\"\nimport { motion } from \"../../render/components/motion/proxy\"\nimport { HTMLMotionProps } from \"../../render/html/types\"\nimport { useConstant } from \"../../utils/use-constant\"\nimport {\n DefaultGroupElement,\n ItemData,\n ReorderAxis,\n ReorderContextProps,\n ReorderElementTag,\n} from \"./types\"\nimport { checkReorder } from \"./utils/check-reorder\"\nimport { detectAxis } from \"./utils/detect-axis\"\n\nexport interface Props<\n V,\n TagName extends ReorderElementTag = DefaultGroupElement\n> {\n /**\n * A HTML element to render this component as. Defaults to `\"ul\"`.\n *\n * @public\n */\n as?: TagName\n\n /**\n * The axis to reorder along. By default, this is detected from the item\n * layout. Use `\"xy\"` to explicitly enable wrapped layout reordering.\n *\n * @public\n */\n axis?: ReorderAxis\n\n /**\n * A callback to fire with the new value order. For instance, if the values\n * are provided as a state from `useState`, this could be the set state function.\n *\n * @public\n */\n onReorder: (newOrder: V[]) => void\n\n /**\n * The latest values state.\n *\n * ```jsx\n * function Component() {\n * const [items, setItems] = useState([0, 1, 2])\n *\n * return (\n * \n * {items.map((item) => )}\n * \n * )\n * }\n * ```\n *\n * @public\n */\n values: V[]\n}\n\ntype ReorderGroupProps<\n V,\n TagName extends ReorderElementTag = DefaultGroupElement\n> = Props &\n Omit, \"values\"> &\n React.PropsWithChildren<{}>\n\nexport function ReorderGroupComponent<\n V,\n TagName extends ReorderElementTag = DefaultGroupElement\n>(\n {\n children,\n as = \"ul\" as TagName,\n axis: axisOverride,\n onReorder,\n values,\n ...props\n }: ReorderGroupProps,\n externalRef?: React.ForwardedRef\n): JSX.Element {\n const Component = useConstant(\n () => motion[as as keyof typeof motion]\n ) as FunctionComponent<\n React.PropsWithChildren & { ref?: React.Ref }>\n >\n\n const itemLayouts = useRef(new Map[\"layout\"]>())\n const [detectedAxis, setDetectedAxis] = useState(\"y\")\n const isReordering = useRef(false)\n const groupRef = useRef(null)\n const axis = axisOverride || detectedAxis\n\n invariant(\n Boolean(values),\n \"Reorder.Group must be provided a values prop\",\n \"reorder-values\"\n )\n\n const valuesSet = new Set(values)\n itemLayouts.current.forEach((_, value) => {\n if (!valuesSet.has(value)) itemLayouts.current.delete(value)\n })\n\n const context: ReorderContextProps = {\n axis,\n groupRef,\n registerItem: (value, layout) => {\n itemLayouts.current.set(value, layout)\n\n if (!axisOverride) {\n const nextAxis = detectAxis(\n values.flatMap((itemValue) => {\n const itemLayout = itemLayouts.current.get(itemValue)\n return itemLayout ? [itemLayout] : []\n })\n )\n\n if (nextAxis !== detectedAxis) setDetectedAxis(nextAxis)\n }\n },\n updateOrder: (item, offset, velocity) => {\n if (isReordering.current) return\n\n const order = values.flatMap((value) => {\n const layout = itemLayouts.current.get(value)\n return layout ? [{ value, layout }] : []\n })\n const direction =\n groupRef.current?.ownerDocument.defaultView?.getComputedStyle(\n groupRef.current\n ).direction === \"rtl\"\n ? \"rtl\"\n : \"ltr\"\n const newOrder = checkReorder(\n order,\n item,\n offset,\n velocity,\n axis,\n direction\n )\n\n if (order !== newOrder) {\n isReordering.current = true\n\n const newValues = [...values]\n const measuredIndexes = order.map(({ value }) =>\n values.indexOf(value)\n )\n newOrder.forEach(({ value }, index) => {\n newValues[measuredIndexes[index]] = value\n })\n onReorder(newValues)\n }\n },\n }\n\n useEffect(() => {\n isReordering.current = false\n })\n\n // Combine refs if external ref is provided\n const setRef = (element: Element | null) => {\n ;(groupRef as React.MutableRefObject).current = element\n if (typeof externalRef === \"function\") {\n externalRef(element)\n } else if (externalRef) {\n ;(externalRef as React.MutableRefObject).current =\n element\n }\n }\n\n /**\n * Disable browser scroll anchoring on the group container.\n * When items reorder, scroll anchoring can cause the browser to adjust\n * the scroll position, which interferes with drag position calculations.\n */\n const groupStyle = {\n overflowAnchor: \"none\" as const,\n ...props.style,\n }\n\n return (\n \n \n {children}\n \n \n )\n}\n\nexport const ReorderGroup = /*@__PURE__*/ forwardRef(ReorderGroupComponent) as <\n Values extends any[],\n TagName extends ReorderElementTag = DefaultGroupElement\n>(\n props: Omit<\n ReorderGroupProps,\n \"values\" | \"onReorder\"\n > & {\n values: Values\n onReorder: (newOrder: Values) => void\n } & { ref?: React.ForwardedRef }\n) => ReturnType\n"],"names":[],"mappings":";;;;;;;;;;AAgFM;AAcF;;;AAQA;AACA;AACA;;AAQA;;AAEI;AAA2B;AAC/B;AAEA;;;AAGI;;;;;;;;;;;;;;;;AAmBQ;AACJ;AACA;AAIQ;;AAER;AASA;AACI;AAEA;;;;AAMA;;;;;;AAOR;AACJ;;AAGA;AACM;AACF;;;;AAGM;AACE;;AAEZ;AAEA;;;;AAIG;AACH;AACI;;;AAIJ;AAOJ;AAEO;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/components/Reorder/Item.mjs b/node_modules/framer-motion/dist/es/components/Reorder/Item.mjs deleted file mode 100644 index 32c6394..0000000 --- a/node_modules/framer-motion/dist/es/components/Reorder/Item.mjs +++ /dev/null @@ -1,48 +0,0 @@ -"use client"; -import { jsx } from 'react/jsx-runtime'; -import { isMotionValue } from 'motion-dom'; -import { invariant } from 'motion-utils'; -import { forwardRef, useContext } from 'react'; -import { ReorderContext } from '../../context/ReorderContext.mjs'; -import { motion } from '../../render/components/motion/proxy.mjs'; -import { useConstant } from '../../utils/use-constant.mjs'; -import { useMotionValue } from '../../value/use-motion-value.mjs'; -import { useTransform } from '../../value/use-transform.mjs'; -import { autoScrollIfNeeded, resetAutoScrollState } from './utils/auto-scroll.mjs'; - -function useDefaultMotionValue(value, defaultValue = 0) { - return isMotionValue(value) ? value : useMotionValue(defaultValue); -} -function ReorderItemComponent({ children, style = {}, value, as = "li", onDrag, onDragEnd, layout = true, ...props }, externalRef) { - const Component = useConstant(() => motion[as]); - const context = useContext(ReorderContext); - const point = { - x: useDefaultMotionValue(style.x), - y: useDefaultMotionValue(style.y), - }; - const zIndex = useTransform([point.x, point.y], ([latestX, latestY]) => latestX || latestY ? 1 : "unset"); - invariant(Boolean(context), "Reorder.Item must be a child of Reorder.Group", "reorder-item-child"); - const { axis, registerItem, updateOrder, groupRef } = context; - const dragAxis = axis === "xy" ? true : axis; - return (jsx(Component, { drag: dragAxis, ...props, dragSnapToOrigin: true, style: { ...style, x: point.x, y: point.y, zIndex }, layout: layout, onDrag: (event, gesturePoint) => { - const { velocity, point: pointerPoint } = gesturePoint; - const offset = { x: point.x.get(), y: point.y.get() }; - updateOrder(value, offset, velocity); - const scrollAxis = axis === "xy" - ? Math.abs(velocity.x) > Math.abs(velocity.y) - ? "x" - : "y" - : axis; - autoScrollIfNeeded(groupRef.current, pointerPoint[scrollAxis], scrollAxis, velocity[scrollAxis]); - onDrag && onDrag(event, gesturePoint); - }, onDragEnd: (event, gesturePoint) => { - resetAutoScrollState(); - onDragEnd && onDragEnd(event, gesturePoint); - }, onLayoutMeasure: (measured) => { - registerItem(value, measured); - }, ref: externalRef, ignoreStrict: true, children: children })); -} -const ReorderItem = /*@__PURE__*/ forwardRef(ReorderItemComponent); - -export { ReorderItem, ReorderItemComponent }; -//# sourceMappingURL=Item.mjs.map diff --git a/node_modules/framer-motion/dist/es/components/Reorder/Item.mjs.map b/node_modules/framer-motion/dist/es/components/Reorder/Item.mjs.map deleted file mode 100644 index c3bfa51..0000000 --- a/node_modules/framer-motion/dist/es/components/Reorder/Item.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Item.mjs","sources":["../../../../src/components/Reorder/Item.tsx"],"sourcesContent":["\"use client\"\n\nimport { isMotionValue } from \"motion-dom\"\nimport { invariant } from \"motion-utils\"\nimport * as React from \"react\"\nimport { forwardRef, FunctionComponent, useContext } from \"react\"\nimport { ReorderContext } from \"../../context/ReorderContext\"\nimport { motion } from \"../../render/components/motion/proxy\"\nimport { HTMLMotionProps } from \"../../render/html/types\"\nimport { useConstant } from \"../../utils/use-constant\"\nimport { useMotionValue } from \"../../value/use-motion-value\"\nimport { useTransform } from \"../../value/use-transform\"\n\nimport { DefaultItemElement, ReorderElementTag } from \"./types\"\nimport { autoScrollIfNeeded, resetAutoScrollState } from \"./utils/auto-scroll\"\n\nexport interface Props<\n V,\n TagName extends ReorderElementTag = DefaultItemElement\n> {\n /**\n * A HTML element to render this component as. Defaults to `\"li\"`.\n *\n * @public\n */\n as?: TagName\n\n /**\n * The value in the list that this component represents.\n *\n * @public\n */\n value: V\n\n /**\n * A subset of layout options primarily used to disable layout=\"size\"\n *\n * @public\n * @default true\n */\n layout?: true | \"position\"\n}\n\nfunction useDefaultMotionValue(value: any, defaultValue: number = 0) {\n return isMotionValue(value) ? value : useMotionValue(defaultValue)\n}\n\ntype ReorderItemProps<\n V,\n TagName extends ReorderElementTag = DefaultItemElement\n> = Props &\n Omit, \"value\" | \"layout\"> &\n React.PropsWithChildren<{}>\n\nexport function ReorderItemComponent<\n V,\n TagName extends ReorderElementTag = DefaultItemElement\n>(\n {\n children,\n style = {},\n value,\n as = \"li\" as TagName,\n onDrag,\n onDragEnd,\n layout = true,\n ...props\n }: ReorderItemProps,\n externalRef?: React.ForwardedRef\n): React.JSX.Element {\n const Component = useConstant(\n () => motion[as as keyof typeof motion]\n ) as FunctionComponent<\n React.PropsWithChildren & { ref?: React.Ref }>\n >\n\n const context = useContext(ReorderContext)\n const point = {\n x: useDefaultMotionValue(style.x),\n y: useDefaultMotionValue(style.y),\n }\n\n const zIndex = useTransform([point.x, point.y], ([latestX, latestY]) =>\n latestX || latestY ? 1 : \"unset\"\n )\n\n invariant(\n Boolean(context),\n \"Reorder.Item must be a child of Reorder.Group\",\n \"reorder-item-child\"\n )\n\n const { axis, registerItem, updateOrder, groupRef } = context!\n const dragAxis = axis === \"xy\" ? true : axis\n\n return (\n {\n const { velocity, point: pointerPoint } = gesturePoint\n const offset = { x: point.x.get(), y: point.y.get() }\n\n updateOrder(value, offset, velocity)\n\n const scrollAxis =\n axis === \"xy\"\n ? Math.abs(velocity.x) > Math.abs(velocity.y)\n ? \"x\"\n : \"y\"\n : axis\n autoScrollIfNeeded(\n groupRef.current,\n pointerPoint[scrollAxis],\n scrollAxis,\n velocity[scrollAxis]\n )\n\n onDrag && onDrag(event, gesturePoint)\n }}\n onDragEnd={(event, gesturePoint) => {\n resetAutoScrollState()\n onDragEnd && onDragEnd(event, gesturePoint)\n }}\n onLayoutMeasure={(measured) => {\n registerItem(value, measured)\n }}\n ref={externalRef}\n ignoreStrict\n >\n {children}\n \n )\n}\n\nexport const ReorderItem = /*@__PURE__*/ forwardRef(ReorderItemComponent) as <\n V,\n TagName extends ReorderElementTag = DefaultItemElement\n>(\n props: ReorderItemProps & { ref?: React.ForwardedRef }\n) => ReturnType\n"],"names":[],"mappings":";;;;;;;;;;;;AA2CA;AACI;AACJ;AASM;AAgBF;AAMA;AACA;AACI;AACA;;AAGJ;;;AAWA;;;;AAaY;AAEA;AAEQ;AACI;AACA;;AAEZ;AAOA;;AAGA;AACA;AACJ;AAEI;;AAQhB;AAEO;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/components/Reorder/namespace.mjs b/node_modules/framer-motion/dist/es/components/Reorder/namespace.mjs deleted file mode 100644 index b8d507a..0000000 --- a/node_modules/framer-motion/dist/es/components/Reorder/namespace.mjs +++ /dev/null @@ -1,3 +0,0 @@ -export { ReorderGroup as Group } from './Group.mjs'; -export { ReorderItem as Item } from './Item.mjs'; -//# sourceMappingURL=namespace.mjs.map diff --git a/node_modules/framer-motion/dist/es/components/Reorder/namespace.mjs.map b/node_modules/framer-motion/dist/es/components/Reorder/namespace.mjs.map deleted file mode 100644 index 80982f6..0000000 --- a/node_modules/framer-motion/dist/es/components/Reorder/namespace.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"namespace.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/components/Reorder/utils/auto-scroll.mjs b/node_modules/framer-motion/dist/es/components/Reorder/utils/auto-scroll.mjs deleted file mode 100644 index a2e4a8f..0000000 --- a/node_modules/framer-motion/dist/es/components/Reorder/utils/auto-scroll.mjs +++ /dev/null @@ -1,124 +0,0 @@ -const threshold = 50; -const maxSpeed = 25; -const overflowStyles = new Set(["auto", "scroll"]); -// Track initial scroll limits per scrollable element (Bug 1 fix) -const initialScrollLimits = new WeakMap(); -const activeScrollEdge = new WeakMap(); -// Track which group element is currently dragging to clear state on end -let currentGroupElement = null; -function resetAutoScrollState() { - if (currentGroupElement) { - const scrollableAncestor = findScrollableAncestor(currentGroupElement, "y"); - if (scrollableAncestor) { - activeScrollEdge.delete(scrollableAncestor); - initialScrollLimits.delete(scrollableAncestor); - } - // Also try x axis - const scrollableAncestorX = findScrollableAncestor(currentGroupElement, "x"); - if (scrollableAncestorX && scrollableAncestorX !== scrollableAncestor) { - activeScrollEdge.delete(scrollableAncestorX); - initialScrollLimits.delete(scrollableAncestorX); - } - currentGroupElement = null; - } -} -function isScrollableElement(element, axis) { - const style = getComputedStyle(element); - const overflow = axis === "x" ? style.overflowX : style.overflowY; - const isDocumentScroll = element === document.body || - element === document.documentElement; - return overflowStyles.has(overflow) || isDocumentScroll; -} -function findScrollableAncestor(element, axis) { - let current = element?.parentElement; - while (current) { - if (isScrollableElement(current, axis)) { - return current; - } - current = current.parentElement; - } - return null; -} -function getScrollAmount(pointerPosition, scrollElement, axis) { - const rect = scrollElement.getBoundingClientRect(); - const start = axis === "x" ? Math.max(0, rect.left) : Math.max(0, rect.top); - const end = axis === "x" ? Math.min(window.innerWidth, rect.right) : Math.min(window.innerHeight, rect.bottom); - const distanceFromStart = pointerPosition - start; - const distanceFromEnd = end - pointerPosition; - if (distanceFromStart < threshold) { - const intensity = 1 - distanceFromStart / threshold; - return { amount: -maxSpeed * intensity * intensity, edge: "start" }; - } - else if (distanceFromEnd < threshold) { - const intensity = 1 - distanceFromEnd / threshold; - return { amount: maxSpeed * intensity * intensity, edge: "end" }; - } - return { amount: 0, edge: null }; -} -function autoScrollIfNeeded(groupElement, pointerPosition, axis, velocity) { - if (!groupElement) - return; - // Track the group element for cleanup - currentGroupElement = groupElement; - const scrollableAncestor = findScrollableAncestor(groupElement, axis); - if (!scrollableAncestor) - return; - // Convert pointer position from page coordinates to viewport coordinates. - // The gesture system uses pageX/pageY but getBoundingClientRect() returns - // viewport-relative coordinates, so we need to account for page scroll. - const viewportPointerPosition = pointerPosition - (axis === "x" ? window.scrollX : window.scrollY); - const { amount: scrollAmount, edge } = getScrollAmount(viewportPointerPosition, scrollableAncestor, axis); - // If not in any threshold zone, clear all state - if (edge === null) { - activeScrollEdge.delete(scrollableAncestor); - initialScrollLimits.delete(scrollableAncestor); - return; - } - const currentActiveEdge = activeScrollEdge.get(scrollableAncestor); - const isDocumentScroll = scrollableAncestor === document.body || - scrollableAncestor === document.documentElement; - // If not currently scrolling this edge, check velocity to see if we should start - if (currentActiveEdge !== edge) { - // Only start scrolling if velocity is towards the edge - const shouldStart = (edge === "start" && velocity < 0) || - (edge === "end" && velocity > 0); - if (!shouldStart) - return; - // Activate this edge - activeScrollEdge.set(scrollableAncestor, edge); - // Record initial scroll limit (prevents infinite scroll) - const maxScroll = axis === "x" - ? scrollableAncestor.scrollWidth - (isDocumentScroll ? window.innerWidth : scrollableAncestor.clientWidth) - : scrollableAncestor.scrollHeight - (isDocumentScroll ? window.innerHeight : scrollableAncestor.clientHeight); - initialScrollLimits.set(scrollableAncestor, maxScroll); - } - // Cap scrolling at initial limit (prevents infinite scroll) - if (scrollAmount > 0) { - const initialLimit = initialScrollLimits.get(scrollableAncestor); - const currentScroll = axis === "x" - ? (isDocumentScroll ? window.scrollX : scrollableAncestor.scrollLeft) - : (isDocumentScroll ? window.scrollY : scrollableAncestor.scrollTop); - if (currentScroll >= initialLimit) - return; - } - // Apply scroll - if (axis === "x") { - if (isDocumentScroll) { - window.scrollBy({ left: scrollAmount }); - } - else { - scrollableAncestor.scrollLeft += scrollAmount; - } - } - else { - if (isDocumentScroll) { - window.scrollBy({ top: scrollAmount }); - } - else { - scrollableAncestor.scrollTop += scrollAmount; - } - } -} - -export { autoScrollIfNeeded, resetAutoScrollState }; -//# sourceMappingURL=auto-scroll.mjs.map diff --git a/node_modules/framer-motion/dist/es/components/Reorder/utils/auto-scroll.mjs.map b/node_modules/framer-motion/dist/es/components/Reorder/utils/auto-scroll.mjs.map deleted file mode 100644 index 13faf16..0000000 --- a/node_modules/framer-motion/dist/es/components/Reorder/utils/auto-scroll.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"auto-scroll.mjs","sources":["../../../../../src/components/Reorder/utils/auto-scroll.ts"],"sourcesContent":["const threshold = 50\nconst maxSpeed = 25\n\nconst overflowStyles = new Set([\"auto\", \"scroll\"])\n\n// Track initial scroll limits per scrollable element (Bug 1 fix)\nconst initialScrollLimits = new WeakMap()\n\n// Track auto-scroll active state per edge: \"start\" (top/left) or \"end\" (bottom/right)\ntype ActiveEdge = \"start\" | \"end\" | null\nconst activeScrollEdge = new WeakMap()\n\n// Track which group element is currently dragging to clear state on end\nlet currentGroupElement: Element | null = null\n\nexport function resetAutoScrollState(): void {\n if (currentGroupElement) {\n const scrollableAncestor = findScrollableAncestor(\n currentGroupElement,\n \"y\"\n )\n if (scrollableAncestor) {\n activeScrollEdge.delete(scrollableAncestor)\n initialScrollLimits.delete(scrollableAncestor)\n }\n // Also try x axis\n const scrollableAncestorX = findScrollableAncestor(\n currentGroupElement,\n \"x\"\n )\n if (scrollableAncestorX && scrollableAncestorX !== scrollableAncestor) {\n activeScrollEdge.delete(scrollableAncestorX)\n initialScrollLimits.delete(scrollableAncestorX)\n }\n currentGroupElement = null\n }\n}\n\nfunction isScrollableElement(element: Element, axis: \"x\" | \"y\"): boolean {\n const style = getComputedStyle(element)\n const overflow = axis === \"x\" ? style.overflowX : style.overflowY\n\n const isDocumentScroll =\n element === document.body ||\n element === document.documentElement\n\n return overflowStyles.has(overflow) || isDocumentScroll\n}\n\nfunction findScrollableAncestor(\n element: Element | null,\n axis: \"x\" | \"y\"\n): HTMLElement | null {\n let current = element?.parentElement\n while (current) {\n if (isScrollableElement(current, axis)) {\n return current\n }\n current = current.parentElement\n }\n return null\n}\n\nfunction getScrollAmount(\n pointerPosition: number,\n scrollElement: HTMLElement,\n axis: \"x\" | \"y\"\n): { amount: number; edge: ActiveEdge } {\n const rect = scrollElement.getBoundingClientRect()\n\n const start = axis === \"x\" ? Math.max(0, rect.left) : Math.max(0, rect.top)\n const end = axis === \"x\" ? Math.min(window.innerWidth, rect.right) : Math.min(window.innerHeight, rect.bottom)\n\n const distanceFromStart = pointerPosition - start\n const distanceFromEnd = end - pointerPosition\n\n if (distanceFromStart < threshold) {\n const intensity = 1 - distanceFromStart / threshold\n return { amount: -maxSpeed * intensity * intensity, edge: \"start\" }\n } else if (distanceFromEnd < threshold) {\n const intensity = 1 - distanceFromEnd / threshold\n return { amount: maxSpeed * intensity * intensity, edge: \"end\" }\n }\n\n return { amount: 0, edge: null }\n}\n\nexport function autoScrollIfNeeded(\n groupElement: Element | null,\n pointerPosition: number,\n axis: \"x\" | \"y\",\n velocity: number\n): void {\n if (!groupElement) return\n\n // Track the group element for cleanup\n currentGroupElement = groupElement\n\n const scrollableAncestor = findScrollableAncestor(groupElement, axis)\n if (!scrollableAncestor) return\n\n // Convert pointer position from page coordinates to viewport coordinates.\n // The gesture system uses pageX/pageY but getBoundingClientRect() returns\n // viewport-relative coordinates, so we need to account for page scroll.\n const viewportPointerPosition =\n pointerPosition - (axis === \"x\" ? window.scrollX : window.scrollY)\n\n const { amount: scrollAmount, edge } = getScrollAmount(\n viewportPointerPosition,\n scrollableAncestor,\n axis\n )\n\n // If not in any threshold zone, clear all state\n if (edge === null) {\n activeScrollEdge.delete(scrollableAncestor)\n initialScrollLimits.delete(scrollableAncestor)\n return\n }\n\n const currentActiveEdge = activeScrollEdge.get(scrollableAncestor)\n\n const isDocumentScroll =\n scrollableAncestor === document.body ||\n scrollableAncestor === document.documentElement\n\n // If not currently scrolling this edge, check velocity to see if we should start\n if (currentActiveEdge !== edge) {\n // Only start scrolling if velocity is towards the edge\n const shouldStart =\n (edge === \"start\" && velocity < 0) ||\n (edge === \"end\" && velocity > 0)\n if (!shouldStart) return\n\n // Activate this edge\n activeScrollEdge.set(scrollableAncestor, edge)\n\n // Record initial scroll limit (prevents infinite scroll)\n const maxScroll =\n axis === \"x\"\n ? scrollableAncestor.scrollWidth - (isDocumentScroll ? window.innerWidth : scrollableAncestor.clientWidth)\n : scrollableAncestor.scrollHeight - (isDocumentScroll ? window.innerHeight : scrollableAncestor.clientHeight)\n\n initialScrollLimits.set(scrollableAncestor, maxScroll)\n }\n\n // Cap scrolling at initial limit (prevents infinite scroll)\n if (scrollAmount > 0) {\n const initialLimit = initialScrollLimits.get(scrollableAncestor)!\n const currentScroll =\n axis === \"x\"\n ? (isDocumentScroll ? window.scrollX : scrollableAncestor.scrollLeft)\n : (isDocumentScroll ? window.scrollY : scrollableAncestor.scrollTop)\n if (currentScroll >= initialLimit) return\n }\n\n // Apply scroll\n if (axis === \"x\") {\n if (isDocumentScroll) {\n window.scrollBy({ left: scrollAmount })\n } else {\n scrollableAncestor.scrollLeft += scrollAmount\n }\n } else {\n if (isDocumentScroll) {\n window.scrollBy({ top: scrollAmount })\n } else {\n scrollableAncestor.scrollTop += scrollAmount\n }\n }\n}\n"],"names":[],"mappings":"AAAA,MAAM,SAAS,GAAG,EAAE;AACpB,MAAM,QAAQ,GAAG,EAAE;AAEnB,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;AAElD;AACA,MAAM,mBAAmB,GAAG,IAAI,OAAO,EAAuB;AAI9D,MAAM,gBAAgB,GAAG,IAAI,OAAO,EAA2B;AAE/D;AACA,IAAI,mBAAmB,GAAmB,IAAI;SAE9B,oBAAoB,GAAA;IAChC,IAAI,mBAAmB,EAAE;QACrB,MAAM,kBAAkB,GAAG,sBAAsB,CAC7C,mBAAmB,EACnB,GAAG,CACN;QACD,IAAI,kBAAkB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kB,CAAE;AACjE,QAAA,MAAM,aAAa,GACf,IAAI,KAAK;AACL,eAAG,gBAAgB,GAAG,MAAM,CAAC,OAAO,GAAG,kBAAkB,CAAC,UAAU;AACpE,eAAG,gBAAgB,GAAG,MAAM,CAAC,OAAO,GAAG,kBAAkB,CAAC,SAAS,CAAC;QAC5E,IAAI,aAAa,IAAI,YAAY;YAAE;IACvC;;AAGA,IAAA,IAAI,IAAI,KAAK,GAAG,EAAE;QACd,IAAI,gBAAgB,EAAE;YAClB,MAAM,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;QAC3C;aAAO;AACH,YAAA,kBAAkB,CAAC,UAAU,IAAI,YAAY;QACjD;IACJ;SAAO;QACH,IAAI,gBAAgB,EAAE;YAClB,MAAM,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE,YAAY,EAAE,CAAC;QAC1C;aAAO;AACH,YAAA,kBAAkB,CAAC,SAAS,IAAI,YAAY;QAChD;IACJ;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/components/Reorder/utils/check-reorder.mjs b/node_modules/framer-motion/dist/es/components/Reorder/utils/check-reorder.mjs deleted file mode 100644 index 0adfa33..0000000 --- a/node_modules/framer-motion/dist/es/components/Reorder/utils/check-reorder.mjs +++ /dev/null @@ -1,95 +0,0 @@ -import { mixNumber } from 'motion-dom'; -import { moveItem } from 'motion-utils'; - -function checkReorder(order, value, offset, velocity, axis, direction = "ltr") { - const index = order.findIndex((item) => item.value === value); - if (index === -1) - return order; - if (axis === "xy") { - const { layout } = order[index]; - const center = { - x: mixNumber(layout.x.min, layout.x.max, 0.5) + offset.x, - y: mixNumber(layout.y.min, layout.y.max, 0.5) + offset.y, - }; - const lines = getLines(order); - const sourceLine = lines.find((line) => line.items.includes(order[index])); - const targetLine = lines.reduce((closest, line) => distanceToLine(center.y, line) < distanceToLine(center.y, closest) - ? line - : closest); - if (targetLine !== sourceLine) { - return moveToLine(order, index, center.x, targetLine, direction); - } - const currentDistance = distanceToBox(center, layout); - let target = -1; - let targetDistance = currentDistance; - order.forEach((item, targetIndex) => { - if (targetIndex === index) - return; - const distance = distanceToBox(center, item.layout); - if (distance < targetDistance) { - target = targetIndex; - targetDistance = distance; - } - }); - return target === -1 - ? order - : moveItem(order, index, index + Math.sign(target - index)); - } - if (!velocity[axis]) - return order; - const nextOffset = velocity[axis] > 0 ? 1 : -1; - const nextItem = order[index + nextOffset]; - if (!nextItem) - return order; - const item = order[index]; - const itemLayout = item.layout[axis]; - const nextLayout = nextItem.layout[axis]; - const nextItemCenter = mixNumber(nextLayout.min, nextLayout.max, 0.5); - if ((nextOffset === 1 && itemLayout.max + offset[axis] > nextItemCenter) || - (nextOffset === -1 && itemLayout.min + offset[axis] < nextItemCenter)) { - return moveItem(order, index, index + nextOffset); - } - return order; -} -function getLines(order) { - const lines = []; - order.forEach((item) => { - const { min, max } = item.layout.y; - const line = lines[lines.length - 1]; - if (!line || min >= line.max || max <= line.min) { - lines.push({ items: [item], min, max }); - } - else { - line.items.push(item); - line.min = Math.min(line.min, min); - line.max = Math.max(line.max, max); - } - }); - return lines; -} -function distanceToLine(y, line) { - return y < line.min ? line.min - y : y > line.max ? y - line.max : 0; -} -function moveToLine(order, index, x, line, direction) { - const remaining = order.filter((_, itemIndex) => itemIndex !== index); - const before = line.items.find((item) => { - const center = mixNumber(item.layout.x.min, item.layout.x.max, 0.5); - return direction === "ltr" ? x < center : x > center; - }); - const targetIndex = before - ? remaining.indexOf(before) - : remaining.indexOf(line.items[line.items.length - 1]) + 1; - const nextOrder = [...remaining]; - nextOrder.splice(targetIndex, 0, order[index]); - return nextOrder.every((item, itemIndex) => item === order[itemIndex]) - ? order - : nextOrder; -} -function distanceToBox(point, box) { - const x = Math.max(box.x.min - point.x, 0, point.x - box.x.max); - const y = Math.max(box.y.min - point.y, 0, point.y - box.y.max); - return x * x + y * y; -} - -export { checkReorder }; -//# sourceMappingURL=check-reorder.mjs.map diff --git a/node_modules/framer-motion/dist/es/components/Reorder/utils/check-reorder.mjs.map b/node_modules/framer-motion/dist/es/components/Reorder/utils/check-reorder.mjs.map deleted file mode 100644 index 128270d..0000000 --- a/node_modules/framer-motion/dist/es/components/Reorder/utils/check-reorder.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"check-reorder.mjs","sources":["../../../../../src/components/Reorder/utils/check-reorder.ts"],"sourcesContent":["import { mixNumber } from \"motion-dom\"\nimport { moveItem, Point } from \"motion-utils\"\nimport { ItemData, ReorderAxis } from \"../types\"\n\nexport function checkReorder(\n order: ItemData[],\n value: T,\n offset: Point,\n velocity: Point,\n axis: ReorderAxis,\n direction: \"ltr\" | \"rtl\" = \"ltr\"\n): ItemData[] {\n const index = order.findIndex((item) => item.value === value)\n\n if (index === -1) return order\n\n if (axis === \"xy\") {\n const { layout } = order[index]\n const center = {\n x: mixNumber(layout.x.min, layout.x.max, 0.5) + offset.x,\n y: mixNumber(layout.y.min, layout.y.max, 0.5) + offset.y,\n }\n const lines = getLines(order)\n const sourceLine = lines.find((line) =>\n line.items.includes(order[index])\n )!\n const targetLine = lines.reduce((closest, line) =>\n distanceToLine(center.y, line) < distanceToLine(center.y, closest)\n ? line\n : closest\n )\n\n if (targetLine !== sourceLine) {\n return moveToLine(order, index, center.x, targetLine, direction)\n }\n\n const currentDistance = distanceToBox(center, layout)\n let target = -1\n let targetDistance = currentDistance\n\n order.forEach((item, targetIndex) => {\n if (targetIndex === index) return\n const distance = distanceToBox(center, item.layout)\n if (distance < targetDistance) {\n target = targetIndex\n targetDistance = distance\n }\n })\n\n return target === -1\n ? order\n : moveItem(order, index, index + Math.sign(target - index))\n }\n\n if (!velocity[axis]) return order\n\n const nextOffset = velocity[axis] > 0 ? 1 : -1\n const nextItem = order[index + nextOffset]\n\n if (!nextItem) return order\n\n const item = order[index]\n const itemLayout = item.layout[axis]\n const nextLayout = nextItem.layout[axis]\n const nextItemCenter = mixNumber(nextLayout.min, nextLayout.max, 0.5)\n\n if (\n (nextOffset === 1 && itemLayout.max + offset[axis] > nextItemCenter) ||\n (nextOffset === -1 && itemLayout.min + offset[axis] < nextItemCenter)\n ) {\n return moveItem(order, index, index + nextOffset)\n }\n\n return order\n}\n\ninterface Line {\n items: ItemData[]\n min: number\n max: number\n}\n\nfunction getLines(order: ItemData[]) {\n const lines: Line[] = []\n\n order.forEach((item) => {\n const { min, max } = item.layout.y\n const line = lines[lines.length - 1]\n\n if (!line || min >= line.max || max <= line.min) {\n lines.push({ items: [item], min, max })\n } else {\n line.items.push(item)\n line.min = Math.min(line.min, min)\n line.max = Math.max(line.max, max)\n }\n })\n\n return lines\n}\n\nfunction distanceToLine(y: number, line: Line) {\n return y < line.min ? line.min - y : y > line.max ? y - line.max : 0\n}\n\nfunction moveToLine(\n order: ItemData[],\n index: number,\n x: number,\n line: Line,\n direction: \"ltr\" | \"rtl\"\n) {\n const remaining = order.filter((_, itemIndex) => itemIndex !== index)\n const before = line.items.find((item) => {\n const center = mixNumber(item.layout.x.min, item.layout.x.max, 0.5)\n return direction === \"ltr\" ? x < center : x > center\n })\n const targetIndex = before\n ? remaining.indexOf(before)\n : remaining.indexOf(line.items[line.items.length - 1]) + 1\n const nextOrder = [...remaining]\n nextOrder.splice(targetIndex, 0, order[index])\n\n return nextOrder.every((item, itemIndex) => item === order[itemIndex])\n ? order\n : nextOrder\n}\n\nfunction distanceToBox(point: Point, box: ItemData[\"layout\"]) {\n const x = Math.max(box.x.min - point.x, 0, point.x - box.x.max)\n const y = Math.max(box.y.min - point.y, 0, point.y - box.y.max)\n return x * x + y * y\n}\n"],"names":[],"mappings":";;;AAIM,SAAU,YAAY,CACxB,KAAoB,EACpB,KAAQ,EACR,MAAa,EACb,QAAe,EACf,IAAiB,EACjB,YAA2B,KAAK,EAAA;AAEhC,IAAA,MAAM,KAAK,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,KAAK,KAAK,KAAK,CAAC;IAE7D,IAAI,KAAK,KAAK,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AAC/D,IAAA,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC;AACxB;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/components/Reorder/utils/detect-axis.mjs b/node_modules/framer-motion/dist/es/components/Reorder/utils/detect-axis.mjs deleted file mode 100644 index 55d6b3d..0000000 --- a/node_modules/framer-motion/dist/es/components/Reorder/utils/detect-axis.mjs +++ /dev/null @@ -1,17 +0,0 @@ -const isSeparated = (a, b) => a.max <= b.min || b.max <= a.min; -function detectAxis(layouts) { - let x = false; - let y = false; - for (let i = 0; i < layouts.length; i++) { - for (let j = i + 1; j < layouts.length; j++) { - x || (x = isSeparated(layouts[i].x, layouts[j].x)); - y || (y = isSeparated(layouts[i].y, layouts[j].y)); - if (x && y) - return "xy"; - } - } - return x ? "x" : "y"; -} - -export { detectAxis }; -//# sourceMappingURL=detect-axis.mjs.map diff --git a/node_modules/framer-motion/dist/es/components/Reorder/utils/detect-axis.mjs.map b/node_modules/framer-motion/dist/es/components/Reorder/utils/detect-axis.mjs.map deleted file mode 100644 index fcd959a..0000000 --- a/node_modules/framer-motion/dist/es/components/Reorder/utils/detect-axis.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"detect-axis.mjs","sources":["../../../../../src/components/Reorder/utils/detect-axis.ts"],"sourcesContent":["import { Axis, Box } from \"motion-utils\"\nimport { ReorderAxis } from \"../types\"\n\nconst isSeparated = (a: Axis, b: Axis) => a.max <= b.min || b.max <= a.min\n\nexport function detectAxis(layouts: Box[]): ReorderAxis {\n let x = false\n let y = false\n\n for (let i = 0; i < layouts.length; i++) {\n for (let j = i + 1; j < layouts.length; j++) {\n x ||= isSeparated(layouts[i].x, layouts[j].x)\n y ||= isSeparated(layouts[i].y, layouts[j].y)\n\n if (x && y) return \"xy\"\n }\n }\n\n return x ? \"x\" : \"y\"\n}\n"],"names":[],"mappings":"AAGA,MAAM,WAAW,GAAG,CAAC,CAAO,EAAE,CAAO,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG;AAEpE,SAAU,UAAU,CAAC,OAAc,EAAA;IACrC,IAAI,CAAC,GAAG,KAAK;IACb,IAAI,CAAC,GAAG,KAAK;AAEb,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AACrC,QAAA,KAAK,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AACzC,YAAA,CAAC,KAAD,CAAC,GAAK,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AAC7C,YAAA,CAAC,KAAD,CAAC,GAAK,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;YAE7C,IAAI,CAAC,IAAI,CAAC;AAAE,gBAAA,OAAO,IAAI;QAC3B;IACJ;IAEA,OAAO,CAAC,GAAG,GAAG,GAAG,GAAG;AACxB;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/context/DeprecatedLayoutGroupContext.mjs b/node_modules/framer-motion/dist/es/context/DeprecatedLayoutGroupContext.mjs deleted file mode 100644 index 999cda1..0000000 --- a/node_modules/framer-motion/dist/es/context/DeprecatedLayoutGroupContext.mjs +++ /dev/null @@ -1,12 +0,0 @@ -"use client"; -import { createContext } from 'react'; - -/** - * Note: Still used by components generated by old versions of Framer - * - * @deprecated - */ -const DeprecatedLayoutGroupContext = createContext(null); - -export { DeprecatedLayoutGroupContext }; -//# sourceMappingURL=DeprecatedLayoutGroupContext.mjs.map diff --git a/node_modules/framer-motion/dist/es/context/DeprecatedLayoutGroupContext.mjs.map b/node_modules/framer-motion/dist/es/context/DeprecatedLayoutGroupContext.mjs.map deleted file mode 100644 index 5a18fc9..0000000 --- a/node_modules/framer-motion/dist/es/context/DeprecatedLayoutGroupContext.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"DeprecatedLayoutGroupContext.mjs","sources":["../../../src/context/DeprecatedLayoutGroupContext.ts"],"sourcesContent":["\"use client\"\n\nimport { createContext } from \"react\"\n\n/**\n * Note: Still used by components generated by old versions of Framer\n *\n * @deprecated\n */\nexport const DeprecatedLayoutGroupContext = createContext(null)\n"],"names":[],"mappings":";;;AAIA;;;;AAIG;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/context/LayoutGroupContext.mjs b/node_modules/framer-motion/dist/es/context/LayoutGroupContext.mjs deleted file mode 100644 index cd82e0b..0000000 --- a/node_modules/framer-motion/dist/es/context/LayoutGroupContext.mjs +++ /dev/null @@ -1,7 +0,0 @@ -"use client"; -import { createContext } from 'react'; - -const LayoutGroupContext = createContext({}); - -export { LayoutGroupContext }; -//# sourceMappingURL=LayoutGroupContext.mjs.map diff --git a/node_modules/framer-motion/dist/es/context/LayoutGroupContext.mjs.map b/node_modules/framer-motion/dist/es/context/LayoutGroupContext.mjs.map deleted file mode 100644 index bda87d9..0000000 --- a/node_modules/framer-motion/dist/es/context/LayoutGroupContext.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"LayoutGroupContext.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/context/LazyContext.mjs b/node_modules/framer-motion/dist/es/context/LazyContext.mjs deleted file mode 100644 index 0126060..0000000 --- a/node_modules/framer-motion/dist/es/context/LazyContext.mjs +++ /dev/null @@ -1,7 +0,0 @@ -"use client"; -import { createContext } from 'react'; - -const LazyContext = createContext({ strict: false }); - -export { LazyContext }; -//# sourceMappingURL=LazyContext.mjs.map diff --git a/node_modules/framer-motion/dist/es/context/LazyContext.mjs.map b/node_modules/framer-motion/dist/es/context/LazyContext.mjs.map deleted file mode 100644 index 57951a8..0000000 --- a/node_modules/framer-motion/dist/es/context/LazyContext.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"LazyContext.mjs","sources":["../../../src/context/LazyContext.ts"],"sourcesContent":["\"use client\"\n\nimport { createContext } from \"react\"\nimport { CreateVisualElement } from \"../render/types\"\n\nexport interface LazyContextProps {\n renderer?: CreateVisualElement\n strict: boolean\n}\n\nexport const LazyContext = createContext({ strict: false })\n"],"names":[],"mappings":";;;AAUO;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/context/MotionConfigContext.mjs b/node_modules/framer-motion/dist/es/context/MotionConfigContext.mjs deleted file mode 100644 index 9847a73..0000000 --- a/node_modules/framer-motion/dist/es/context/MotionConfigContext.mjs +++ /dev/null @@ -1,14 +0,0 @@ -"use client"; -import { createContext } from 'react'; - -/** - * @public - */ -const MotionConfigContext = createContext({ - transformPagePoint: (p) => p, - isStatic: false, - reducedMotion: "never", -}); - -export { MotionConfigContext }; -//# sourceMappingURL=MotionConfigContext.mjs.map diff --git a/node_modules/framer-motion/dist/es/context/MotionConfigContext.mjs.map b/node_modules/framer-motion/dist/es/context/MotionConfigContext.mjs.map deleted file mode 100644 index c269bfe..0000000 --- a/node_modules/framer-motion/dist/es/context/MotionConfigContext.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"MotionConfigContext.mjs","sources":["../../../src/context/MotionConfigContext.tsx"],"sourcesContent":["\"use client\"\n\nimport type { Transition } from \"motion-dom\"\nimport { TransformPoint } from \"motion-utils\"\nimport { createContext } from \"react\"\n\nexport type ReducedMotionConfig = \"always\" | \"never\" | \"user\"\nexport type IsValidProp = (key: string) => boolean\n\n/**\n * @public\n */\nexport interface MotionConfigContext {\n /**\n * Internal, exported only for usage in Framer\n */\n transformPagePoint: TransformPoint\n\n /**\n * Internal. Determines whether this is a static context ie the Framer canvas. If so,\n * it'll disable all dynamic functionality.\n */\n isStatic: boolean\n\n /**\n * Defines a new default transition for the entire tree.\n *\n * @public\n */\n transition?: Transition\n\n /**\n * If true, will respect the device prefersReducedMotion setting by switching\n * transform animations off.\n *\n * @public\n */\n reducedMotion?: ReducedMotionConfig\n\n /**\n * A custom `nonce` attribute used when wanting to enforce a Content Security Policy (CSP).\n * For more details see:\n * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/style-src#unsafe_inline_styles\n *\n * @public\n */\n nonce?: string\n\n /**\n * If true, all animations will be skipped and values will be set instantly.\n * Useful for E2E tests and visual regression testing.\n *\n * @public\n */\n skipAnimations?: boolean\n\n /**\n * Determines whether a prop should be forwarded to the DOM.\n * Useful when wrapping Motion components with a styling library.\n *\n * @public\n */\n isValidProp?: IsValidProp\n}\n\n/**\n * @public\n */\nexport const MotionConfigContext = createContext({\n transformPagePoint: (p) => p,\n isStatic: false,\n reducedMotion: \"never\",\n})\n"],"names":[],"mappings":";;;AAiEA;;AAEG;AACI;AACH;AACA;AACA;AACH;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/context/MotionContext/create.mjs b/node_modules/framer-motion/dist/es/context/MotionContext/create.mjs deleted file mode 100644 index 90806ea..0000000 --- a/node_modules/framer-motion/dist/es/context/MotionContext/create.mjs +++ /dev/null @@ -1,15 +0,0 @@ -"use client"; -import { useContext, useMemo } from 'react'; -import { MotionContext } from './index.mjs'; -import { getCurrentTreeVariants } from './utils.mjs'; - -function useCreateMotionContext(props) { - const { initial, animate } = getCurrentTreeVariants(props, useContext(MotionContext)); - return useMemo(() => ({ initial, animate }), [variantLabelsAsDependency(initial), variantLabelsAsDependency(animate)]); -} -function variantLabelsAsDependency(prop) { - return Array.isArray(prop) ? prop.join(" ") : prop; -} - -export { useCreateMotionContext }; -//# sourceMappingURL=create.mjs.map diff --git a/node_modules/framer-motion/dist/es/context/MotionContext/create.mjs.map b/node_modules/framer-motion/dist/es/context/MotionContext/create.mjs.map deleted file mode 100644 index a172977..0000000 --- a/node_modules/framer-motion/dist/es/context/MotionContext/create.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"create.mjs","sources":["../../../../src/context/MotionContext/create.ts"],"sourcesContent":["\"use client\"\n\nimport { useContext, useMemo } from \"react\"\nimport { MotionContext, type MotionContextProps } from \".\"\nimport { MotionProps } from \"../../motion/types\"\nimport { getCurrentTreeVariants } from \"./utils\"\n\nexport function useCreateMotionContext(\n props: MotionProps\n): MotionContextProps {\n const { initial, animate } = getCurrentTreeVariants(\n props,\n useContext(MotionContext)\n )\n\n return useMemo(\n () => ({ initial, animate }),\n [variantLabelsAsDependency(initial), variantLabelsAsDependency(animate)]\n )\n}\n\nfunction variantLabelsAsDependency(\n prop: undefined | string | string[] | boolean\n) {\n return Array.isArray(prop) ? prop.join(\" \") : prop\n}\n"],"names":[],"mappings":";;;;;AAOM;AAGF;;AASJ;AAEA;AAGI;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/context/MotionContext/index.mjs b/node_modules/framer-motion/dist/es/context/MotionContext/index.mjs deleted file mode 100644 index deb883c..0000000 --- a/node_modules/framer-motion/dist/es/context/MotionContext/index.mjs +++ /dev/null @@ -1,7 +0,0 @@ -"use client"; -import { createContext } from 'react'; - -const MotionContext = /* @__PURE__ */ createContext({}); - -export { MotionContext }; -//# sourceMappingURL=index.mjs.map diff --git a/node_modules/framer-motion/dist/es/context/MotionContext/index.mjs.map b/node_modules/framer-motion/dist/es/context/MotionContext/index.mjs.map deleted file mode 100644 index d1f6cb4..0000000 --- a/node_modules/framer-motion/dist/es/context/MotionContext/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs","sources":["../../../../src/context/MotionContext/index.ts"],"sourcesContent":["\"use client\"\n\nimport type { VisualElement } from \"motion-dom\"\nimport { createContext } from \"react\"\n\nexport interface MotionContextProps {\n visualElement?: VisualElement\n initial?: false | string | string[]\n animate?: string | string[]\n}\n\nexport const MotionContext = /* @__PURE__ */ createContext(\n {}\n)\n"],"names":[],"mappings":";;;AAWO;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/context/MotionContext/utils.mjs b/node_modules/framer-motion/dist/es/context/MotionContext/utils.mjs deleted file mode 100644 index 5281e89..0000000 --- a/node_modules/framer-motion/dist/es/context/MotionContext/utils.mjs +++ /dev/null @@ -1,17 +0,0 @@ -import { isControllingVariants, isVariantLabel } from 'motion-dom'; - -function getCurrentTreeVariants(props, context) { - if (isControllingVariants(props)) { - const { initial, animate } = props; - return { - initial: initial === false || isVariantLabel(initial) - ? initial - : undefined, - animate: isVariantLabel(animate) ? animate : undefined, - }; - } - return props.inherit !== false ? context : {}; -} - -export { getCurrentTreeVariants }; -//# sourceMappingURL=utils.mjs.map diff --git a/node_modules/framer-motion/dist/es/context/MotionContext/utils.mjs.map b/node_modules/framer-motion/dist/es/context/MotionContext/utils.mjs.map deleted file mode 100644 index 5592073..0000000 --- a/node_modules/framer-motion/dist/es/context/MotionContext/utils.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.mjs","sources":["../../../../src/context/MotionContext/utils.ts"],"sourcesContent":["import { isControllingVariants, isVariantLabel } from \"motion-dom\"\nimport type { MotionContextProps } from \".\"\nimport { MotionProps } from \"../../motion/types\"\n\nexport function getCurrentTreeVariants(\n props: MotionProps,\n context: MotionContextProps\n): MotionContextProps {\n if (isControllingVariants(props)) {\n const { initial, animate } = props\n return {\n initial:\n initial === false || isVariantLabel(initial)\n ? (initial as any)\n : undefined,\n animate: isVariantLabel(animate) ? animate : undefined,\n }\n }\n return props.inherit !== false ? context : {}\n}\n"],"names":[],"mappings":";;AAIM,SAAU,sBAAsB,CAClC,KAAkB,EAClB,OAA2B,EAAA;AAE3B,IAAA,IAAI,qBAAqB,CAAC,KAAK,CAAC,EAAE;AAC9B,QAAA,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,KAAK;QAClC,OAAO;YACH,OAAO,EACH,OAAO,KAAK,KAAK,IAAI,cAAc,CAAC,OAAO;AACvC,kBAAG;AACH,kBAAE,SAAS;AACnB,YAAA,OAAO,EAAE,cAAc,CAAC,OAAO,CAAC,GAAG,OAAO,GAAG,SAAS;SACzD;IACL;AACA,IAAA,OAAO,KAAK,CAAC,OAAO,KAAK,KAAK,GAAG,OAAO,GAAG,EAAE;AACjD;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/context/PresenceContext.mjs b/node_modules/framer-motion/dist/es/context/PresenceContext.mjs deleted file mode 100644 index 2ad3463..0000000 --- a/node_modules/framer-motion/dist/es/context/PresenceContext.mjs +++ /dev/null @@ -1,11 +0,0 @@ -"use client"; -import { createContext } from 'react'; - -/** - * @public - */ -const PresenceContext = -/* @__PURE__ */ createContext(null); - -export { PresenceContext }; -//# sourceMappingURL=PresenceContext.mjs.map diff --git a/node_modules/framer-motion/dist/es/context/PresenceContext.mjs.map b/node_modules/framer-motion/dist/es/context/PresenceContext.mjs.map deleted file mode 100644 index de11202..0000000 --- a/node_modules/framer-motion/dist/es/context/PresenceContext.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"PresenceContext.mjs","sources":["../../../src/context/PresenceContext.ts"],"sourcesContent":["\"use client\"\n\nimport { createContext } from \"react\"\nimport type { PresenceContextProps } from \"motion-dom\"\n\nexport type { PresenceContextProps }\n\n/**\n * @public\n */\nexport const PresenceContext =\n /* @__PURE__ */ createContext(null)\n"],"names":[],"mappings":";;;AAOA;;AAEG;;AAEC;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/context/ReorderContext.mjs b/node_modules/framer-motion/dist/es/context/ReorderContext.mjs deleted file mode 100644 index 17cefb9..0000000 --- a/node_modules/framer-motion/dist/es/context/ReorderContext.mjs +++ /dev/null @@ -1,7 +0,0 @@ -"use client"; -import { createContext } from 'react'; - -const ReorderContext = createContext(null); - -export { ReorderContext }; -//# sourceMappingURL=ReorderContext.mjs.map diff --git a/node_modules/framer-motion/dist/es/context/ReorderContext.mjs.map b/node_modules/framer-motion/dist/es/context/ReorderContext.mjs.map deleted file mode 100644 index a68068f..0000000 --- a/node_modules/framer-motion/dist/es/context/ReorderContext.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ReorderContext.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/context/SwitchLayoutGroupContext.mjs b/node_modules/framer-motion/dist/es/context/SwitchLayoutGroupContext.mjs deleted file mode 100644 index 08aaa76..0000000 --- a/node_modules/framer-motion/dist/es/context/SwitchLayoutGroupContext.mjs +++ /dev/null @@ -1,10 +0,0 @@ -"use client"; -import { createContext } from 'react'; - -/** - * Internal, exported only for usage in Framer - */ -const SwitchLayoutGroupContext = createContext({}); - -export { SwitchLayoutGroupContext }; -//# sourceMappingURL=SwitchLayoutGroupContext.mjs.map diff --git a/node_modules/framer-motion/dist/es/context/SwitchLayoutGroupContext.mjs.map b/node_modules/framer-motion/dist/es/context/SwitchLayoutGroupContext.mjs.map deleted file mode 100644 index e25c485..0000000 --- a/node_modules/framer-motion/dist/es/context/SwitchLayoutGroupContext.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"SwitchLayoutGroupContext.mjs","sources":["../../../src/context/SwitchLayoutGroupContext.ts"],"sourcesContent":["\"use client\"\n\nimport type { Transition, IProjectionNode } from \"motion-dom\"\nimport { createContext } from \"react\"\n\nexport interface SwitchLayoutGroup {\n register?: (member: IProjectionNode) => void\n deregister?: (member: IProjectionNode) => void\n}\n\nexport type SwitchLayoutGroupContext = SwitchLayoutGroup &\n InitialPromotionConfig\n\nexport type InitialPromotionConfig = {\n /**\n * The initial transition to use when the elements in this group mount (and automatically promoted).\n * Subsequent updates should provide a transition in the promote method.\n */\n transition?: Transition\n /**\n * If the follow tree should preserve its opacity when the lead is promoted on mount\n */\n shouldPreserveFollowOpacity?: (member: IProjectionNode) => boolean\n}\n\n/**\n * Internal, exported only for usage in Framer\n */\nexport const SwitchLayoutGroupContext = createContext(\n {}\n)\n"],"names":[],"mappings":";;;AAyBA;;AAEG;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/debug.mjs b/node_modules/framer-motion/dist/es/debug.mjs deleted file mode 100644 index 170c251..0000000 --- a/node_modules/framer-motion/dist/es/debug.mjs +++ /dev/null @@ -1,2 +0,0 @@ -export { recordStats } from 'motion-dom'; -//# sourceMappingURL=debug.mjs.map diff --git a/node_modules/framer-motion/dist/es/debug.mjs.map b/node_modules/framer-motion/dist/es/debug.mjs.map deleted file mode 100644 index b79ebba..0000000 --- a/node_modules/framer-motion/dist/es/debug.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"debug.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/dom-mini.mjs b/node_modules/framer-motion/dist/es/dom-mini.mjs deleted file mode 100644 index d8705e7..0000000 --- a/node_modules/framer-motion/dist/es/dom-mini.mjs +++ /dev/null @@ -1,3 +0,0 @@ -export { animateSequence } from './animation/animators/waapi/animate-sequence.mjs'; -export { animateMini as animate } from './animation/animators/waapi/animate-style.mjs'; -//# sourceMappingURL=dom-mini.mjs.map diff --git a/node_modules/framer-motion/dist/es/dom-mini.mjs.map b/node_modules/framer-motion/dist/es/dom-mini.mjs.map deleted file mode 100644 index 4979ad8..0000000 --- a/node_modules/framer-motion/dist/es/dom-mini.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"dom-mini.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/dom.mjs b/node_modules/framer-motion/dist/es/dom.mjs deleted file mode 100644 index 5df9220..0000000 --- a/node_modules/framer-motion/dist/es/dom.mjs +++ /dev/null @@ -1,10 +0,0 @@ -export * from 'motion-dom'; -export { delayInSeconds as delay } from 'motion-dom'; -export * from 'motion-utils'; -export { animate, createScopedAnimate } from './animation/animate/index.mjs'; -export { animateMini } from './animation/animators/waapi/animate-style.mjs'; -export { scroll } from './render/dom/scroll/index.mjs'; -export { scrollInfo } from './render/dom/scroll/track.mjs'; -export { inView } from './render/dom/viewport/index.mjs'; -export { distance, distance2D } from './utils/distance.mjs'; -//# sourceMappingURL=dom.mjs.map diff --git a/node_modules/framer-motion/dist/es/dom.mjs.map b/node_modules/framer-motion/dist/es/dom.mjs.map deleted file mode 100644 index f9925fb..0000000 --- a/node_modules/framer-motion/dist/es/dom.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"dom.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/events/add-pointer-event.mjs b/node_modules/framer-motion/dist/es/events/add-pointer-event.mjs deleted file mode 100644 index e204664..0000000 --- a/node_modules/framer-motion/dist/es/events/add-pointer-event.mjs +++ /dev/null @@ -1,9 +0,0 @@ -import { addDomEvent } from 'motion-dom'; -import { addPointerInfo } from './event-info.mjs'; - -function addPointerEvent(target, eventName, handler, options) { - return addDomEvent(target, eventName, addPointerInfo(handler), options); -} - -export { addPointerEvent }; -//# sourceMappingURL=add-pointer-event.mjs.map diff --git a/node_modules/framer-motion/dist/es/events/add-pointer-event.mjs.map b/node_modules/framer-motion/dist/es/events/add-pointer-event.mjs.map deleted file mode 100644 index db1b1b2..0000000 --- a/node_modules/framer-motion/dist/es/events/add-pointer-event.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"add-pointer-event.mjs","sources":["../../../src/events/add-pointer-event.ts"],"sourcesContent":["import { addDomEvent } from \"motion-dom\"\nimport { addPointerInfo, EventListenerWithPointInfo } from \"./event-info\"\n\nexport function addPointerEvent(\n target: EventTarget,\n eventName: string,\n handler: EventListenerWithPointInfo,\n options?: AddEventListenerOptions\n) {\n return addDomEvent(target, eventName, addPointerInfo(handler), options)\n}\n"],"names":[],"mappings":";;;AAGM,SAAU,eAAe,CAC3B,MAAmB,EACnB,SAAiB,EACjB,OAAmC,EACnC,OAAiC,EAAA;AAEjC,IAAA,OAAO,WAAW,CAAC,MAAM,EAAE,SAAS,EAAE,cAAc,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;AAC3E;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/events/event-info.mjs b/node_modules/framer-motion/dist/es/events/event-info.mjs deleted file mode 100644 index 0021717..0000000 --- a/node_modules/framer-motion/dist/es/events/event-info.mjs +++ /dev/null @@ -1,14 +0,0 @@ -import { isPrimaryPointer } from 'motion-dom'; - -function extractEventInfo(event) { - return { - point: { - x: event.pageX, - y: event.pageY, - }, - }; -} -const addPointerInfo = (handler) => (event) => isPrimaryPointer(event) && handler(event, extractEventInfo(event)); - -export { addPointerInfo, extractEventInfo }; -//# sourceMappingURL=event-info.mjs.map diff --git a/node_modules/framer-motion/dist/es/events/event-info.mjs.map b/node_modules/framer-motion/dist/es/events/event-info.mjs.map deleted file mode 100644 index c2b8927..0000000 --- a/node_modules/framer-motion/dist/es/events/event-info.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"event-info.mjs","sources":["../../../src/events/event-info.ts"],"sourcesContent":["import { EventInfo, isPrimaryPointer } from \"motion-dom\"\n\nexport type EventListenerWithPointInfo = (\n e: PointerEvent,\n info: EventInfo\n) => void\n\nexport function extractEventInfo(event: PointerEvent): EventInfo {\n return {\n point: {\n x: event.pageX,\n y: event.pageY,\n },\n }\n}\n\nexport const addPointerInfo =\n (handler: EventListenerWithPointInfo): EventListener =>\n (event: PointerEvent) =>\n isPrimaryPointer(event) && handler(event, extractEventInfo(event))\n"],"names":[],"mappings":";;AAOM,SAAU,gBAAgB,CAAC,KAAmB,EAAA;IAChD,OAAO;AACH,QAAA,KAAK,EAAE;YACH,CAAC,EAAE,KAAK,CAAC,KAAK;YACd,CAAC,EAAE,KAAK,CAAC,KAAK;AACjB,SAAA;KACJ;AACL;AAEO,MAAM,cAAc,GACvB,CAAC,OAAmC,KACpC,CAAC,KAAmB,KAChB,gBAAgB,CAAC,KAAK,CAAC,IAAI,OAAO,CAAC,KAAK,EAAE,gBAAgB,CAAC,KAAK,CAAC;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/events/use-dom-event.mjs b/node_modules/framer-motion/dist/es/events/use-dom-event.mjs deleted file mode 100644 index 8ea5b54..0000000 --- a/node_modules/framer-motion/dist/es/events/use-dom-event.mjs +++ /dev/null @@ -1,36 +0,0 @@ -"use client"; -import { useEffect } from 'react'; -import { addDomEvent } from 'motion-dom'; - -/** - * Attaches an event listener directly to the provided DOM element. - * - * Bypassing React's event system can be desirable, for instance when attaching non-passive - * event handlers. - * - * ```jsx - * const ref = useRef(null) - * - * useDomEvent(ref, 'wheel', onWheel, { passive: false }) - * - * return
- * ``` - * - * @param ref - React.RefObject that's been provided to the element you want to bind the listener to. - * @param eventName - Name of the event you want listen for. - * @param handler - Function to fire when receiving the event. - * @param options - Options to pass to `Event.addEventListener`. - * - * @public - */ -function useDomEvent(ref, eventName, handler, options) { - useEffect(() => { - const element = ref.current; - if (handler && element) { - return addDomEvent(element, eventName, handler, options); - } - }, [ref, eventName, handler, options]); -} - -export { useDomEvent }; -//# sourceMappingURL=use-dom-event.mjs.map diff --git a/node_modules/framer-motion/dist/es/events/use-dom-event.mjs.map b/node_modules/framer-motion/dist/es/events/use-dom-event.mjs.map deleted file mode 100644 index f24c4bf..0000000 --- a/node_modules/framer-motion/dist/es/events/use-dom-event.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"use-dom-event.mjs","sources":["../../../src/events/use-dom-event.ts"],"sourcesContent":["\"use client\"\n\nimport { RefObject, useEffect } from \"react\"\nimport { addDomEvent } from \"motion-dom\"\n\n/**\n * Attaches an event listener directly to the provided DOM element.\n *\n * Bypassing React's event system can be desirable, for instance when attaching non-passive\n * event handlers.\n *\n * ```jsx\n * const ref = useRef(null)\n *\n * useDomEvent(ref, 'wheel', onWheel, { passive: false })\n *\n * return
\n * ```\n *\n * @param ref - React.RefObject that's been provided to the element you want to bind the listener to.\n * @param eventName - Name of the event you want listen for.\n * @param handler - Function to fire when receiving the event.\n * @param options - Options to pass to `Event.addEventListener`.\n *\n * @public\n */\nexport function useDomEvent(\n ref: RefObject,\n eventName: string,\n handler?: EventListener | undefined,\n options?: AddEventListenerOptions\n) {\n useEffect(() => {\n const element = ref.current\n\n if (handler && element) {\n return addDomEvent(element, eventName, handler, options)\n }\n }, [ref, eventName, handler, options])\n}\n"],"names":[],"mappings":";;;;AAKA;;;;;;;;;;;;;;;;;;;;AAoBG;AACG;;AAOE;AAEA;;;;AAIR;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs b/node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs deleted file mode 100644 index d3b54bd..0000000 --- a/node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs +++ /dev/null @@ -1,573 +0,0 @@ -import { createBox, frame, eachAxis, measurePageBox, convertBoxToBoundingBox, convertBoundingBoxToBox, addValueToWillChange, animateMotionValue, mixNumber, addDomEvent, setDragLock, percent, calcLength, resize, isElementTextInput } from 'motion-dom'; -import { invariant } from 'motion-utils'; -import { addPointerEvent } from '../../events/add-pointer-event.mjs'; -import { extractEventInfo } from '../../events/event-info.mjs'; -import { getContextWindow } from '../../utils/get-context-window.mjs'; -import { isRefObject } from '../../utils/is-ref-object.mjs'; -import { PanSession } from '../pan/PanSession.mjs'; -import { applyConstraints, calcRelativeConstraints, resolveDragElastic, rebaseAxisConstraints, calcViewportConstraints, calcOrigin, defaultElastic } from './utils/constraints.mjs'; - -const elementDragControls = new WeakMap(); -class VisualElementDragControls { - constructor(visualElement) { - this.openDragLock = null; - this.isDragging = false; - this.currentDirection = null; - this.originPoint = { x: 0, y: 0 }; - /** - * The permitted boundaries of travel, in pixels. - */ - this.constraints = false; - this.hasMutatedConstraints = false; - /** - * The per-axis resolved elastic values. - */ - this.elastic = createBox(); - /** - * The latest pointer event. Used as fallback when the `cancel` and `stop` functions are called without arguments. - */ - this.latestPointerEvent = null; - /** - * The latest pan info. Used as fallback when the `cancel` and `stop` functions are called without arguments. - */ - this.latestPanInfo = null; - this.visualElement = visualElement; - } - start(originEvent, { snapToCursor = false, distanceThreshold } = {}) { - /** - * Don't start dragging if this component is exiting - */ - const { presenceContext } = this.visualElement; - if (presenceContext && presenceContext.isPresent === false) - return; - const onSessionStart = (event) => { - if (snapToCursor) { - this.snapToCursor(extractEventInfo(event).point); - } - this.stopAnimation(); - }; - const onStart = (event, info) => { - // Attempt to grab the global drag gesture lock - maybe make this part of PanSession - const { drag, dragPropagation, onDragStart } = this.getProps(); - if (drag && !dragPropagation) { - if (this.openDragLock) - this.openDragLock(); - this.openDragLock = setDragLock(drag); - // If we don 't have the lock, don't start dragging - if (!this.openDragLock) - return; - } - this.latestPointerEvent = event; - this.latestPanInfo = info; - this.isDragging = true; - this.currentDirection = null; - this.resolveConstraints(); - if (this.visualElement.projection) { - this.visualElement.projection.isAnimationBlocked = true; - this.visualElement.projection.target = undefined; - } - /** - * Record gesture origin and pointer offset - */ - eachAxis((axis) => { - let current = this.getAxisMotionValue(axis).get() || 0; - /** - * If the MotionValue is a percentage value convert to px - */ - if (percent.test(current)) { - const { projection } = this.visualElement; - if (projection && projection.layout) { - const measuredAxis = projection.layout.layoutBox[axis]; - if (measuredAxis) { - const length = calcLength(measuredAxis); - current = length * (parseFloat(current) / 100); - } - } - } - this.originPoint[axis] = current; - }); - // Fire onDragStart event - if (onDragStart) { - frame.update(() => onDragStart(event, info), false, true); - } - addValueToWillChange(this.visualElement, "transform"); - const { animationState } = this.visualElement; - animationState && animationState.setActive("whileDrag", true); - }; - const onMove = (event, info) => { - this.latestPointerEvent = event; - this.latestPanInfo = info; - const { dragPropagation, dragDirectionLock, onDirectionLock, onDrag, } = this.getProps(); - // If we didn't successfully receive the gesture lock, early return. - if (!dragPropagation && !this.openDragLock) - return; - const { offset } = info; - // Attempt to detect drag direction if directionLock is true - if (dragDirectionLock && this.currentDirection === null) { - this.currentDirection = getCurrentDirection(offset); - // If we've successfully set a direction, notify listener - if (this.currentDirection !== null) { - onDirectionLock && onDirectionLock(this.currentDirection); - } - return; - } - // Update each point with the latest position - this.updateAxis("x", info.point, offset); - this.updateAxis("y", info.point, offset); - /** - * Ideally we would leave the renderer to fire naturally at the end of - * this frame but if the element is about to change layout as the result - * of a re-render we want to ensure the browser can read the latest - * bounding box to ensure the pointer and element don't fall out of sync. - */ - this.visualElement.render(); - /** - * This must fire after the render call as it might trigger a state - * change which itself might trigger a layout update. - */ - if (onDrag) { - frame.update(() => onDrag(event, info), false, true); - } - }; - const onSessionEnd = (event, info) => { - this.latestPointerEvent = event; - this.latestPanInfo = info; - this.stop(event, info); - this.latestPointerEvent = null; - this.latestPanInfo = null; - }; - const resumeAnimation = () => { - const { dragSnapToOrigin: snap } = this.getProps(); - if (snap || this.constraints) { - this.startAnimation({ x: 0, y: 0 }); - } - }; - const { dragSnapToOrigin } = this.getProps(); - this.panSession = new PanSession(originEvent, { - onSessionStart, - onStart, - onMove, - onSessionEnd, - resumeAnimation, - }, { - transformPagePoint: this.visualElement.getTransformPagePoint(), - dragSnapToOrigin, - distanceThreshold, - contextWindow: getContextWindow(this.visualElement), - element: this.visualElement.current, - }); - } - /** - * @internal - */ - stop(event, panInfo) { - const finalEvent = event || this.latestPointerEvent; - const finalPanInfo = panInfo || this.latestPanInfo; - const isDragging = this.isDragging; - this.cancel(); - if (!isDragging || !finalPanInfo || !finalEvent) - return; - const { velocity } = finalPanInfo; - this.startAnimation(velocity); - const { onDragEnd } = this.getProps(); - if (onDragEnd) { - frame.postRender(() => onDragEnd(finalEvent, finalPanInfo)); - } - } - /** - * @internal - */ - cancel() { - this.isDragging = false; - const { projection, animationState } = this.visualElement; - if (projection) { - projection.isAnimationBlocked = false; - } - this.endPanSession(); - const { dragPropagation } = this.getProps(); - if (!dragPropagation && this.openDragLock) { - this.openDragLock(); - this.openDragLock = null; - } - animationState && animationState.setActive("whileDrag", false); - } - /** - * Clean up the pan session without modifying other drag state. - * This is used during unmount to ensure event listeners are removed - * without affecting projection animations or drag locks. - * @internal - */ - endPanSession() { - this.panSession && this.panSession.end(); - this.panSession = undefined; - } - updateAxis(axis, _point, offset) { - const { drag } = this.getProps(); - // If we're not dragging this axis, do an early return. - if (!offset || !shouldDrag(axis, drag, this.currentDirection)) - return; - const axisValue = this.getAxisMotionValue(axis); - let next = this.originPoint[axis] + offset[axis]; - // Apply constraints - if (this.constraints && this.constraints[axis]) { - next = applyConstraints(next, this.constraints[axis], this.elastic[axis]); - } - axisValue.set(next); - } - resolveConstraints() { - const { dragConstraints, dragElastic } = this.getProps(); - const layout = this.visualElement.projection && - !this.visualElement.projection.layout - ? this.visualElement.projection.measure(false) - : this.visualElement.projection?.layout; - const prevConstraints = this.constraints; - if (dragConstraints && isRefObject(dragConstraints)) { - if (!this.constraints) { - this.constraints = this.resolveRefConstraints(); - } - } - else { - if (dragConstraints && layout) { - this.constraints = calcRelativeConstraints(layout.layoutBox, dragConstraints); - } - else { - this.constraints = false; - } - } - this.elastic = resolveDragElastic(dragElastic); - /** - * If we're outputting to external MotionValues, we want to rebase the measured constraints - * from viewport-relative to component-relative. This only applies to relative (non-ref) - * constraints, as ref-based constraints from calcViewportConstraints are already in the - * correct coordinate space for the motion value transform offset. - */ - if (prevConstraints !== this.constraints && - !isRefObject(dragConstraints) && - layout && - this.constraints && - !this.hasMutatedConstraints) { - eachAxis((axis) => { - if (this.constraints !== false && - this.getAxisMotionValue(axis)) { - this.constraints[axis] = rebaseAxisConstraints(layout.layoutBox[axis], this.constraints[axis]); - } - }); - } - } - resolveRefConstraints() { - const { dragConstraints: constraints, onMeasureDragConstraints } = this.getProps(); - if (!constraints || !isRefObject(constraints)) - return false; - const constraintsElement = constraints.current; - invariant(constraintsElement !== null, "If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.", "drag-constraints-ref"); - const { projection } = this.visualElement; - // TODO - if (!projection || !projection.layout) - return false; - /** - * Refresh the root scroll offset so the constraint's viewport box - * translates to correct page coordinates. The scroll captured at - * drag mount can be stale if the document was scrolled afterwards — - * e.g. via the browser restoring scroll on refresh, or an ancestor - * layout effect running after this element's mount (#2829). - * - * Clear the cached scroll first so `updateScroll` bypasses its - * per-animationId cache and re-reads the live value. - */ - if (projection.root) { - projection.root.scroll = undefined; - projection.root.updateScroll(); - } - const constraintsBox = measurePageBox(constraintsElement, projection.root, this.visualElement.getTransformPagePoint()); - let measuredConstraints = calcViewportConstraints(projection.layout.layoutBox, constraintsBox); - /** - * If there's an onMeasureDragConstraints listener we call it and - * if different constraints are returned, set constraints to that - */ - if (onMeasureDragConstraints) { - const userConstraints = onMeasureDragConstraints(convertBoxToBoundingBox(measuredConstraints)); - this.hasMutatedConstraints = !!userConstraints; - if (userConstraints) { - measuredConstraints = convertBoundingBoxToBox(userConstraints); - } - } - return measuredConstraints; - } - startAnimation(velocity) { - const { drag, dragMomentum, dragElastic, dragTransition, dragSnapToOrigin, onDragTransitionEnd, } = this.getProps(); - const constraints = this.constraints || {}; - const momentumAnimations = eachAxis((axis) => { - if (!shouldDrag(axis, drag, this.currentDirection)) { - return; - } - let transition = (constraints && constraints[axis]) || {}; - if (dragSnapToOrigin === true || - dragSnapToOrigin === axis) - transition = { min: 0, max: 0 }; - /** - * Overdamp the boundary spring if `dragElastic` is disabled. There's still a frame - * of spring animations so we should look into adding a disable spring option to `inertia`. - * We could do something here where we affect the `bounceStiffness` and `bounceDamping` - * using the value of `dragElastic`. - */ - const bounceStiffness = dragElastic ? 200 : 1000000; - const bounceDamping = dragElastic ? 40 : 10000000; - const inertia = { - type: "inertia", - velocity: dragMomentum ? velocity[axis] : 0, - bounceStiffness, - bounceDamping, - timeConstant: 750, - restDelta: 1, - restSpeed: 10, - ...dragTransition, - ...transition, - }; - // If we're not animating on an externally-provided `MotionValue` we can use the - // component's animation controls which will handle interactions with whileHover (etc), - // otherwise we just have to animate the `MotionValue` itself. - return this.startAxisValueAnimation(axis, inertia); - }); - // Run all animations and then resolve the new drag constraints. - return Promise.all(momentumAnimations).then(onDragTransitionEnd); - } - startAxisValueAnimation(axis, transition) { - const axisValue = this.getAxisMotionValue(axis); - addValueToWillChange(this.visualElement, axis); - return axisValue.start(animateMotionValue(axis, axisValue, 0, transition, this.visualElement, false)); - } - stopAnimation() { - eachAxis((axis) => this.getAxisMotionValue(axis).stop()); - } - /** - * Drag works differently depending on which props are provided. - * - * - If _dragX and _dragY are provided, we output the gesture delta directly to those motion values. - * - Otherwise, we apply the delta to the x/y motion values. - */ - getAxisMotionValue(axis) { - const dragKey = `_drag${axis.toUpperCase()}`; - const props = this.visualElement.getProps(); - const externalMotionValue = props[dragKey]; - return externalMotionValue - ? externalMotionValue - : this.visualElement.getValue(axis, this.visualElement.latestValues[axis] ?? 0); - } - snapToCursor(point) { - eachAxis((axis) => { - const { drag } = this.getProps(); - // If we're not dragging this axis, do an early return. - if (!shouldDrag(axis, drag, this.currentDirection)) - return; - const { projection } = this.visualElement; - const axisValue = this.getAxisMotionValue(axis); - if (projection && projection.layout) { - const { min, max } = projection.layout.layoutBox[axis]; - /** - * The layout measurement includes the current transform value, - * so we need to add it back to get the correct snap position. - * This fixes an issue where elements with initial coordinates - * would snap to the wrong position on the first drag. - */ - const current = axisValue.get() || 0; - axisValue.set(point[axis] - mixNumber(min, max, 0.5) + current); - } - }); - } - /** - * When the viewport resizes we want to check if the measured constraints - * have changed and, if so, reposition the element within those new constraints - * relative to where it was before the resize. - */ - scalePositionWithinConstraints() { - if (!this.visualElement.current) - return; - const { drag, dragConstraints } = this.getProps(); - const { projection } = this.visualElement; - if (!isRefObject(dragConstraints) || !projection || !this.constraints) - return; - /** - * Stop current animations as there can be visual glitching if we try to do - * this mid-animation - */ - this.stopAnimation(); - /** - * Record the relative position of the dragged element relative to the - * constraints box and save as a progress value. - */ - const boxProgress = { x: 0, y: 0 }; - eachAxis((axis) => { - const axisValue = this.getAxisMotionValue(axis); - if (axisValue && this.constraints !== false) { - const latest = axisValue.get(); - boxProgress[axis] = calcOrigin({ min: latest, max: latest }, this.constraints[axis]); - } - }); - /** - * Update the layout of this element and resolve the latest drag constraints - */ - const { transformTemplate } = this.visualElement.getProps(); - this.visualElement.current.style.transform = transformTemplate - ? transformTemplate({}, "") - : "none"; - projection.root && projection.root.updateScroll(); - projection.updateLayout(); - /** - * Reset constraints so resolveConstraints() will recalculate them - * with the freshly measured layout rather than returning the cached value. - */ - this.constraints = false; - this.resolveConstraints(); - /** - * For each axis, calculate the current progress of the layout axis - * within the new constraints. - */ - eachAxis((axis) => { - if (!shouldDrag(axis, drag, null)) - return; - /** - * Calculate a new transform based on the previous box progress - */ - const axisValue = this.getAxisMotionValue(axis); - const { min, max } = this.constraints[axis]; - axisValue.set(mixNumber(min, max, boxProgress[axis])); - }); - /** - * Flush the updated transform to the DOM synchronously to prevent - * a visual flash at the element's CSS layout position (0,0) when - * the transform was stripped for measurement. - */ - this.visualElement.render(); - } - addListeners() { - if (!this.visualElement.current) - return; - elementDragControls.set(this.visualElement, this); - const element = this.visualElement.current; - /** - * Attach a pointerdown event listener on this DOM element to initiate drag tracking. - */ - const stopPointerListener = addPointerEvent(element, "pointerdown", (event) => { - const { drag, dragListener = true } = this.getProps(); - const target = event.target; - /** - * Only block drag if clicking on a text input child element - * (input, textarea, select, contenteditable) where users might - * want to select text or interact with the control. - * - * Buttons and links don't block drag since they don't have - * click-and-move actions of their own. - */ - const isClickingTextInputChild = target !== element && isElementTextInput(target); - if (drag && dragListener && !isClickingTextInputChild) { - this.start(event); - } - }); - /** - * If using ref-based constraints, observe both the draggable element - * and the constraint container for size changes via ResizeObserver. - * Setup is deferred because dragConstraints.current is null when - * addListeners first runs (React hasn't committed the ref yet). - */ - let stopResizeObservers; - const measureDragConstraints = () => { - const { dragConstraints } = this.getProps(); - if (isRefObject(dragConstraints) && dragConstraints.current) { - this.constraints = this.resolveRefConstraints(); - if (!stopResizeObservers) { - stopResizeObservers = startResizeObservers(element, dragConstraints.current, () => this.scalePositionWithinConstraints()); - } - } - }; - const { projection } = this.visualElement; - const stopMeasureLayoutListener = projection.addEventListener("measure", measureDragConstraints); - if (projection && !projection.layout) { - projection.root && projection.root.updateScroll(); - projection.updateLayout(); - } - frame.read(measureDragConstraints); - /** - * Attach a window resize listener to scale the draggable target within its defined - * constraints as the window resizes. - */ - const stopResizeListener = addDomEvent(window, "resize", () => this.scalePositionWithinConstraints()); - /** - * If the element's layout changes, calculate the delta and apply that to - * the drag gesture's origin point. - */ - const stopLayoutUpdateListener = projection.addEventListener("didUpdate", (({ delta, hasLayoutChanged }) => { - if (this.isDragging && hasLayoutChanged) { - eachAxis((axis) => { - const motionValue = this.getAxisMotionValue(axis); - if (!motionValue) - return; - this.originPoint[axis] += delta[axis].translate; - motionValue.set(motionValue.get() + delta[axis].translate); - }); - this.visualElement.render(); - } - })); - return () => { - stopResizeListener(); - stopPointerListener(); - stopMeasureLayoutListener(); - stopLayoutUpdateListener && stopLayoutUpdateListener(); - stopResizeObservers && stopResizeObservers(); - }; - } - getProps() { - const props = this.visualElement.getProps(); - const { drag = false, dragDirectionLock = false, dragPropagation = false, dragConstraints = false, dragElastic = defaultElastic, dragMomentum = true, } = props; - return { - ...props, - drag, - dragDirectionLock, - dragPropagation, - dragConstraints, - dragElastic, - dragMomentum, - }; - } -} -function skipFirstCall(callback) { - let isFirst = true; - return () => { - if (isFirst) { - isFirst = false; - return; - } - callback(); - }; -} -function startResizeObservers(element, constraintsElement, onResize) { - const stopElement = resize(element, skipFirstCall(onResize)); - const stopContainer = resize(constraintsElement, skipFirstCall(onResize)); - return () => { - stopElement(); - stopContainer(); - }; -} -function shouldDrag(direction, drag, currentDirection) { - return ((drag === true || drag === direction) && - (currentDirection === null || currentDirection === direction)); -} -/** - * Based on an x/y offset determine the current drag direction. If both axis' offsets are lower - * than the provided threshold, return `null`. - * - * @param offset - The x/y offset from origin. - * @param lockThreshold - (Optional) - the minimum absolute offset before we can determine a drag direction. - */ -function getCurrentDirection(offset, lockThreshold = 10) { - let direction = null; - if (Math.abs(offset.y) > lockThreshold) { - direction = "y"; - } - else if (Math.abs(offset.x) > lockThreshold) { - direction = "x"; - } - return direction; -} - -export { VisualElementDragControls, elementDragControls }; -//# sourceMappingURL=VisualElementDragControls.mjs.map diff --git a/node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs.map b/node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs.map deleted file mode 100644 index 2af878e..0000000 --- a/node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"VisualElementDragControls.mjs","sources":["../../../../src/gestures/drag/VisualElementDragControls.ts"],"sourcesContent":["import {\n addValueToWillChange,\n animateMotionValue,\n calcLength,\n convertBoundingBoxToBox,\n convertBoxToBoundingBox,\n createBox,\n eachAxis,\n frame,\n isElementTextInput,\n measurePageBox,\n mixNumber,\n PanInfo,\n percent,\n ResolvedConstraints,\n resize,\n setDragLock,\n Transition,\n type VisualElement,\n} from \"motion-dom\"\nimport { Axis, Point, invariant } from \"motion-utils\"\nimport { addDomEvent, type LayoutUpdateData } from \"motion-dom\"\nimport { addPointerEvent } from \"../../events/add-pointer-event\"\nimport { extractEventInfo } from \"../../events/event-info\"\nimport { MotionProps } from \"../../motion/types\"\nimport { getContextWindow } from \"../../utils/get-context-window\"\nimport { isRefObject } from \"../../utils/is-ref-object\"\nimport { PanSession } from \"../pan/PanSession\"\nimport {\n applyConstraints,\n calcOrigin,\n calcRelativeConstraints,\n calcViewportConstraints,\n defaultElastic,\n rebaseAxisConstraints,\n resolveDragElastic,\n} from \"./utils/constraints\"\n\nexport const elementDragControls = new WeakMap<\n VisualElement,\n VisualElementDragControls\n>()\n\nexport interface DragControlOptions {\n /**\n * This distance after which dragging starts and a direction is locked in.\n *\n * @public\n */\n distanceThreshold?: number\n\n /**\n * Whether to immediately snap to the cursor when dragging starts.\n *\n * @public\n */\n snapToCursor?: boolean\n}\n\ntype DragDirection = \"x\" | \"y\"\n\nexport class VisualElementDragControls {\n private visualElement: VisualElement\n\n private panSession?: PanSession\n\n private openDragLock: VoidFunction | null = null\n\n isDragging = false\n private currentDirection: DragDirection | null = null\n\n private originPoint: Point = { x: 0, y: 0 }\n\n /**\n * The permitted boundaries of travel, in pixels.\n */\n private constraints: ResolvedConstraints | false = false\n\n private hasMutatedConstraints = false\n\n /**\n * The per-axis resolved elastic values.\n */\n private elastic = createBox()\n\n /**\n * The latest pointer event. Used as fallback when the `cancel` and `stop` functions are called without arguments.\n */\n private latestPointerEvent: PointerEvent | null = null\n\n /**\n * The latest pan info. Used as fallback when the `cancel` and `stop` functions are called without arguments.\n */\n private latestPanInfo: PanInfo | null = null\n\n constructor(visualElement: VisualElement) {\n this.visualElement = visualElement\n }\n\n start(\n originEvent: PointerEvent,\n { snapToCursor = false, distanceThreshold }: DragControlOptions = {}\n ) {\n /**\n * Don't start dragging if this component is exiting\n */\n const { presenceContext } = this.visualElement\n if (presenceContext && presenceContext.isPresent === false) return\n\n const onSessionStart = (event: PointerEvent) => {\n if (snapToCursor) {\n this.snapToCursor(extractEventInfo(event).point)\n }\n this.stopAnimation()\n }\n\n const onStart = (event: PointerEvent, info: PanInfo) => {\n // Attempt to grab the global drag gesture lock - maybe make this part of PanSession\n const { drag, dragPropagation, onDragStart } = this.getProps()\n\n if (drag && !dragPropagation) {\n if (this.openDragLock) this.openDragLock()\n\n this.openDragLock = setDragLock(drag)\n\n // If we don 't have the lock, don't start dragging\n if (!this.openDragLock) return\n }\n\n this.latestPointerEvent = event\n this.latestPanInfo = info\n this.isDragging = true\n\n this.currentDirection = null\n\n this.resolveConstraints()\n\n if (this.visualElement.projection) {\n this.visualElement.projection.isAnimationBlocked = true\n this.visualElement.projection.target = undefined\n }\n\n /**\n * Record gesture origin and pointer offset\n */\n eachAxis((axis) => {\n let current = this.getAxisMotionValue(axis).get() || 0\n\n /**\n * If the MotionValue is a percentage value convert to px\n */\n if (percent.test(current)) {\n const { projection } = this.visualElement\n\n if (projection && projection.layout) {\n const measuredAxis = projection.layout.layoutBox[axis]\n\n if (measuredAxis) {\n const length = calcLength(measuredAxis)\n current = length * (parseFloat(current) / 100)\n }\n }\n }\n\n this.originPoint[axis] = current\n })\n\n // Fire onDragStart event\n if (onDragStart) {\n frame.update(() => onDragStart(event, info), false, true)\n }\n\n addValueToWillChange(this.visualElement, \"transform\")\n\n const { animationState } = this.visualElement\n animationState && animationState.setActive(\"whileDrag\", true)\n }\n\n const onMove = (event: PointerEvent, info: PanInfo) => {\n this.latestPointerEvent = event\n this.latestPanInfo = info\n\n const {\n dragPropagation,\n dragDirectionLock,\n onDirectionLock,\n onDrag,\n } = this.getProps()\n\n // If we didn't successfully receive the gesture lock, early return.\n if (!dragPropagation && !this.openDragLock) return\n\n const { offset } = info\n // Attempt to detect drag direction if directionLock is true\n if (dragDirectionLock && this.currentDirection === null) {\n this.currentDirection = getCurrentDirection(offset)\n\n // If we've successfully set a direction, notify listener\n if (this.currentDirection !== null) {\n onDirectionLock && onDirectionLock(this.currentDirection)\n }\n\n return\n }\n\n // Update each point with the latest position\n this.updateAxis(\"x\", info.point, offset)\n this.updateAxis(\"y\", info.point, offset)\n\n /**\n * Ideally we would leave the renderer to fire naturally at the end of\n * this frame but if the element is about to change layout as the result\n * of a re-render we want to ensure the browser can read the latest\n * bounding box to ensure the pointer and element don't fall out of sync.\n */\n this.visualElement.render()\n\n /**\n * This must fire after the render call as it might trigger a state\n * change which itself might trigger a layout update.\n */\n if (onDrag) {\n frame.update(() => onDrag(event, info), false, true)\n }\n }\n\n const onSessionEnd = (event: PointerEvent, info: PanInfo) => {\n this.latestPointerEvent = event\n this.latestPanInfo = info\n\n this.stop(event, info)\n\n this.latestPointerEvent = null\n this.latestPanInfo = null\n }\n\n const resumeAnimation = () => {\n const { dragSnapToOrigin: snap } = this.getProps()\n if (snap || this.constraints) {\n this.startAnimation({ x: 0, y: 0 })\n }\n }\n\n const { dragSnapToOrigin } = this.getProps()\n this.panSession = new PanSession(\n originEvent,\n {\n onSessionStart,\n onStart,\n onMove,\n onSessionEnd,\n resumeAnimation,\n },\n {\n transformPagePoint: this.visualElement.getTransformPagePoint(),\n dragSnapToOrigin,\n distanceThreshold,\n contextWindow: getContextWindow(this.visualElement),\n element: this.visualElement.current,\n }\n )\n }\n\n /**\n * @internal\n */\n stop(event?: PointerEvent, panInfo?: PanInfo) {\n const finalEvent = event || this.latestPointerEvent\n const finalPanInfo = panInfo || this.latestPanInfo\n\n const isDragging = this.isDragging\n this.cancel()\n if (!isDragging || !finalPanInfo || !finalEvent) return\n\n const { velocity } = finalPanInfo\n this.startAnimation(velocity)\n\n const { onDragEnd } = this.getProps()\n if (onDragEnd) {\n frame.postRender(() => onDragEnd(finalEvent, finalPanInfo))\n }\n }\n\n /**\n * @internal\n */\n cancel() {\n this.isDragging = false\n\n const { projection, animationState } = this.visualElement\n\n if (projection) {\n projection.isAnimationBlocked = false\n }\n\n this.endPanSession()\n\n const { dragPropagation } = this.getProps()\n\n if (!dragPropagation && this.openDragLock) {\n this.openDragLock()\n this.openDragLock = null\n }\n\n animationState && animationState.setActive(\"whileDrag\", false)\n }\n\n /**\n * Clean up the pan session without modifying other drag state.\n * This is used during unmount to ensure event listeners are removed\n * without affecting projection animations or drag locks.\n * @internal\n */\n endPanSession() {\n this.panSession && this.panSession.end()\n this.panSession = undefined\n }\n\n private updateAxis(axis: DragDirection, _point: Point, offset?: Point) {\n const { drag } = this.getProps()\n\n // If we're not dragging this axis, do an early return.\n if (!offset || !shouldDrag(axis, drag, this.currentDirection)) return\n\n const axisValue = this.getAxisMotionValue(axis)\n let next = this.originPoint[axis] + offset[axis]\n\n // Apply constraints\n if (this.constraints && this.constraints[axis]) {\n next = applyConstraints(\n next,\n this.constraints[axis],\n this.elastic[axis]\n )\n }\n\n axisValue.set(next)\n }\n\n private resolveConstraints() {\n const { dragConstraints, dragElastic } = this.getProps()\n\n const layout =\n this.visualElement.projection &&\n !this.visualElement.projection.layout\n ? this.visualElement.projection.measure(false)\n : this.visualElement.projection?.layout\n\n const prevConstraints = this.constraints\n\n if (dragConstraints && isRefObject(dragConstraints)) {\n if (!this.constraints) {\n this.constraints = this.resolveRefConstraints()\n }\n } else {\n if (dragConstraints && layout) {\n this.constraints = calcRelativeConstraints(\n layout.layoutBox,\n dragConstraints\n )\n } else {\n this.constraints = false\n }\n }\n\n this.elastic = resolveDragElastic(dragElastic)\n\n /**\n * If we're outputting to external MotionValues, we want to rebase the measured constraints\n * from viewport-relative to component-relative. This only applies to relative (non-ref)\n * constraints, as ref-based constraints from calcViewportConstraints are already in the\n * correct coordinate space for the motion value transform offset.\n */\n if (\n prevConstraints !== this.constraints &&\n !isRefObject(dragConstraints) &&\n layout &&\n this.constraints &&\n !this.hasMutatedConstraints\n ) {\n eachAxis((axis) => {\n if (\n this.constraints !== false &&\n this.getAxisMotionValue(axis)\n ) {\n this.constraints[axis] = rebaseAxisConstraints(\n layout.layoutBox[axis],\n this.constraints[axis]\n )\n }\n })\n }\n }\n\n private resolveRefConstraints() {\n const { dragConstraints: constraints, onMeasureDragConstraints } =\n this.getProps()\n if (!constraints || !isRefObject(constraints)) return false\n\n const constraintsElement = constraints.current as HTMLElement\n\n invariant(\n constraintsElement !== null,\n \"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.\",\n \"drag-constraints-ref\"\n )\n\n const { projection } = this.visualElement\n\n // TODO\n if (!projection || !projection.layout) return false\n\n /**\n * Refresh the root scroll offset so the constraint's viewport box\n * translates to correct page coordinates. The scroll captured at\n * drag mount can be stale if the document was scrolled afterwards —\n * e.g. via the browser restoring scroll on refresh, or an ancestor\n * layout effect running after this element's mount (#2829).\n *\n * Clear the cached scroll first so `updateScroll` bypasses its\n * per-animationId cache and re-reads the live value.\n */\n if (projection.root) {\n projection.root.scroll = undefined\n projection.root.updateScroll()\n }\n\n const constraintsBox = measurePageBox(\n constraintsElement,\n projection.root!,\n this.visualElement.getTransformPagePoint()\n )\n\n let measuredConstraints = calcViewportConstraints(\n projection.layout.layoutBox,\n constraintsBox\n )\n\n /**\n * If there's an onMeasureDragConstraints listener we call it and\n * if different constraints are returned, set constraints to that\n */\n if (onMeasureDragConstraints) {\n const userConstraints = onMeasureDragConstraints(\n convertBoxToBoundingBox(measuredConstraints)\n )\n\n this.hasMutatedConstraints = !!userConstraints\n\n if (userConstraints) {\n measuredConstraints = convertBoundingBoxToBox(userConstraints)\n }\n }\n\n return measuredConstraints\n }\n\n private startAnimation(velocity: Point) {\n const {\n drag,\n dragMomentum,\n dragElastic,\n dragTransition,\n dragSnapToOrigin,\n onDragTransitionEnd,\n } = this.getProps()\n\n const constraints: Partial = this.constraints || {}\n\n const momentumAnimations = eachAxis((axis) => {\n if (!shouldDrag(axis, drag, this.currentDirection)) {\n return\n }\n\n let transition = (constraints && constraints[axis]) || {}\n\n if (\n dragSnapToOrigin === true ||\n (dragSnapToOrigin as unknown) === axis\n )\n transition = { min: 0, max: 0 }\n\n /**\n * Overdamp the boundary spring if `dragElastic` is disabled. There's still a frame\n * of spring animations so we should look into adding a disable spring option to `inertia`.\n * We could do something here where we affect the `bounceStiffness` and `bounceDamping`\n * using the value of `dragElastic`.\n */\n const bounceStiffness = dragElastic ? 200 : 1000000\n const bounceDamping = dragElastic ? 40 : 10000000\n\n const inertia: Transition = {\n type: \"inertia\",\n velocity: dragMomentum ? velocity[axis] : 0,\n bounceStiffness,\n bounceDamping,\n timeConstant: 750,\n restDelta: 1,\n restSpeed: 10,\n ...dragTransition,\n ...transition,\n }\n\n // If we're not animating on an externally-provided `MotionValue` we can use the\n // component's animation controls which will handle interactions with whileHover (etc),\n // otherwise we just have to animate the `MotionValue` itself.\n return this.startAxisValueAnimation(axis, inertia)\n })\n\n // Run all animations and then resolve the new drag constraints.\n return Promise.all(momentumAnimations).then(onDragTransitionEnd)\n }\n\n private startAxisValueAnimation(\n axis: DragDirection,\n transition: Transition\n ) {\n const axisValue = this.getAxisMotionValue(axis)\n\n addValueToWillChange(this.visualElement, axis)\n\n return axisValue.start(\n animateMotionValue(\n axis,\n axisValue,\n 0,\n transition,\n this.visualElement,\n false\n )\n )\n }\n\n private stopAnimation() {\n eachAxis((axis) => this.getAxisMotionValue(axis).stop())\n }\n\n /**\n * Drag works differently depending on which props are provided.\n *\n * - If _dragX and _dragY are provided, we output the gesture delta directly to those motion values.\n * - Otherwise, we apply the delta to the x/y motion values.\n */\n private getAxisMotionValue(axis: DragDirection) {\n const dragKey =\n `_drag${axis.toUpperCase()}` as `_drag${Uppercase}`\n const props = this.visualElement.getProps()\n const externalMotionValue = props[dragKey]\n\n return externalMotionValue\n ? externalMotionValue\n : this.visualElement.getValue(\n axis,\n this.visualElement.latestValues[axis] ?? 0\n )\n }\n\n private snapToCursor(point: Point) {\n eachAxis((axis) => {\n const { drag } = this.getProps()\n\n // If we're not dragging this axis, do an early return.\n if (!shouldDrag(axis, drag, this.currentDirection)) return\n\n const { projection } = this.visualElement\n const axisValue = this.getAxisMotionValue(axis)\n\n if (projection && projection.layout) {\n const { min, max } = projection.layout.layoutBox[axis]\n\n /**\n * The layout measurement includes the current transform value,\n * so we need to add it back to get the correct snap position.\n * This fixes an issue where elements with initial coordinates\n * would snap to the wrong position on the first drag.\n */\n const current = axisValue.get() || 0\n\n axisValue.set(point[axis] - mixNumber(min, max, 0.5) + current)\n }\n })\n }\n\n /**\n * When the viewport resizes we want to check if the measured constraints\n * have changed and, if so, reposition the element within those new constraints\n * relative to where it was before the resize.\n */\n scalePositionWithinConstraints() {\n if (!this.visualElement.current) return\n\n const { drag, dragConstraints } = this.getProps()\n const { projection } = this.visualElement\n if (!isRefObject(dragConstraints) || !projection || !this.constraints)\n return\n\n /**\n * Stop current animations as there can be visual glitching if we try to do\n * this mid-animation\n */\n this.stopAnimation()\n\n /**\n * Record the relative position of the dragged element relative to the\n * constraints box and save as a progress value.\n */\n const boxProgress = { x: 0, y: 0 }\n eachAxis((axis) => {\n const axisValue = this.getAxisMotionValue(axis)\n if (axisValue && this.constraints !== false) {\n const latest = axisValue.get()\n boxProgress[axis] = calcOrigin(\n { min: latest, max: latest },\n this.constraints[axis] as Axis\n )\n }\n })\n\n /**\n * Update the layout of this element and resolve the latest drag constraints\n */\n const { transformTemplate } = this.visualElement.getProps()\n this.visualElement.current.style.transform = transformTemplate\n ? transformTemplate({}, \"\")\n : \"none\"\n projection.root && projection.root.updateScroll()\n projection.updateLayout()\n\n /**\n * Reset constraints so resolveConstraints() will recalculate them\n * with the freshly measured layout rather than returning the cached value.\n */\n this.constraints = false\n this.resolveConstraints()\n\n /**\n * For each axis, calculate the current progress of the layout axis\n * within the new constraints.\n */\n eachAxis((axis) => {\n if (!shouldDrag(axis, drag, null)) return\n\n /**\n * Calculate a new transform based on the previous box progress\n */\n const axisValue = this.getAxisMotionValue(axis)\n const { min, max } = (this.constraints as ResolvedConstraints)[\n axis\n ] as Axis\n axisValue.set(mixNumber(min, max, boxProgress[axis]))\n })\n\n /**\n * Flush the updated transform to the DOM synchronously to prevent\n * a visual flash at the element's CSS layout position (0,0) when\n * the transform was stripped for measurement.\n */\n this.visualElement.render()\n }\n\n addListeners() {\n if (!this.visualElement.current) return\n elementDragControls.set(this.visualElement, this)\n const element = this.visualElement.current\n\n /**\n * Attach a pointerdown event listener on this DOM element to initiate drag tracking.\n */\n const stopPointerListener = addPointerEvent(\n element,\n \"pointerdown\",\n (event) => {\n const { drag, dragListener = true } = this.getProps()\n const target = event.target as Element\n\n /**\n * Only block drag if clicking on a text input child element\n * (input, textarea, select, contenteditable) where users might\n * want to select text or interact with the control.\n *\n * Buttons and links don't block drag since they don't have\n * click-and-move actions of their own.\n */\n const isClickingTextInputChild =\n target !== element && isElementTextInput(target)\n\n if (drag && dragListener && !isClickingTextInputChild) {\n this.start(event)\n }\n }\n )\n\n /**\n * If using ref-based constraints, observe both the draggable element\n * and the constraint container for size changes via ResizeObserver.\n * Setup is deferred because dragConstraints.current is null when\n * addListeners first runs (React hasn't committed the ref yet).\n */\n let stopResizeObservers: VoidFunction | undefined\n\n const measureDragConstraints = () => {\n const { dragConstraints } = this.getProps()\n if (isRefObject(dragConstraints) && dragConstraints.current) {\n this.constraints = this.resolveRefConstraints()\n\n if (!stopResizeObservers) {\n stopResizeObservers = startResizeObservers(\n element,\n dragConstraints.current as HTMLElement,\n () => this.scalePositionWithinConstraints()\n )\n }\n }\n }\n\n const { projection } = this.visualElement\n\n const stopMeasureLayoutListener = projection!.addEventListener(\n \"measure\",\n measureDragConstraints\n )\n\n if (projection && !projection!.layout) {\n projection.root && projection.root.updateScroll()\n projection.updateLayout()\n }\n\n frame.read(measureDragConstraints)\n\n /**\n * Attach a window resize listener to scale the draggable target within its defined\n * constraints as the window resizes.\n */\n const stopResizeListener = addDomEvent(window, \"resize\", () =>\n this.scalePositionWithinConstraints()\n )\n\n /**\n * If the element's layout changes, calculate the delta and apply that to\n * the drag gesture's origin point.\n */\n const stopLayoutUpdateListener = projection!.addEventListener(\n \"didUpdate\",\n (({ delta, hasLayoutChanged }: LayoutUpdateData) => {\n if (this.isDragging && hasLayoutChanged) {\n eachAxis((axis) => {\n const motionValue = this.getAxisMotionValue(axis)\n if (!motionValue) return\n\n this.originPoint[axis] += delta[axis].translate\n motionValue.set(\n motionValue.get() + delta[axis].translate\n )\n })\n\n this.visualElement.render()\n }\n }) as any\n )\n\n return () => {\n stopResizeListener()\n stopPointerListener()\n stopMeasureLayoutListener()\n stopLayoutUpdateListener && stopLayoutUpdateListener()\n stopResizeObservers && stopResizeObservers()\n }\n }\n\n getProps(): MotionProps {\n const props = this.visualElement.getProps()\n const {\n drag = false,\n dragDirectionLock = false,\n dragPropagation = false,\n dragConstraints = false,\n dragElastic = defaultElastic,\n dragMomentum = true,\n } = props\n return {\n ...props,\n drag,\n dragDirectionLock,\n dragPropagation,\n dragConstraints,\n dragElastic,\n dragMomentum,\n }\n }\n}\n\nfunction skipFirstCall(callback: VoidFunction): VoidFunction {\n let isFirst = true\n return () => {\n if (isFirst) {\n isFirst = false\n return\n }\n callback()\n }\n}\n\nfunction startResizeObservers(\n element: HTMLElement,\n constraintsElement: HTMLElement,\n onResize: VoidFunction\n): VoidFunction {\n const stopElement = resize(element, skipFirstCall(onResize))\n const stopContainer = resize(constraintsElement, skipFirstCall(onResize))\n return () => {\n stopElement()\n stopContainer()\n }\n}\n\nfunction shouldDrag(\n direction: DragDirection,\n drag: boolean | DragDirection | undefined,\n currentDirection: null | DragDirection\n) {\n return (\n (drag === true || drag === direction) &&\n (currentDirection === null || currentDirection === direction)\n )\n}\n\n/**\n * Based on an x/y offset determine the current drag direction. If both axis' offsets are lower\n * than the provided threshold, return `null`.\n *\n * @param offset - The x/y offset from origin.\n * @param lockThreshold - (Optional) - the minimum absolute offset before we can determine a drag direction.\n */\nfunction getCurrentDirection(\n offset: Point,\n lockThreshold = 10\n): DragDirection | null {\n let direction: DragDirection | null = null\n\n if (Math.abs(offset.y) > lockThreshold) {\n direction = \"y\"\n } else if (Math.abs(offset.x) > lockThreshold) {\n direction = \"x\"\n }\n\n return direction\n}\n\nexport function expectsResolvedDragConstraints({\n dragConstraints,\n onMeasureDragConstraints,\n}: MotionProps) {\n return isRefObject(dragConstraints) && !!onMeasureDragConstraints\n}\n"],"names":[],"mappings":";;;;;;;;;AAsCO,MAAM,mBAAmB,GAAG,IAAI,OAAO;MAuBjC,yBAAyB,CAAA;AAkClC,IAAA,WAAA,CAAY,aAAyC,EAAA;QA7B7C,IAAA,CAAA,YAAY,GAAwB,IAAI;QAEhD,IAAA,CAAA,UAAU,GAAG,KAAK;QACV,IAAA,CAAA,gBAAgB,GAAyB,IAAI;QAE7C,IAAA,CAAA,WAAW,GAAU,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;AAE3C;;AAEG;QACK,IAAA,CAAA,WAAW,GAAgC,KAAK;QAEhD,IAAA,CAAA,qBAAqB,GAAG,KAAK;AAErC;;AAEG;QACK,IAAA,CAAA,OAAO,GAAG,SA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CAAC,GAAG,aAAa,EAAE;QACpC,SAAS,GAAG,GAAG;IACnB;SAAO,IAAI,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,aAAa,EAAE;QAC3C,SAAS,GAAG,GAAG;IACnB;AAEA,IAAA,OAAO,SAAS;AACpB;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/gestures/drag/index.mjs b/node_modules/framer-motion/dist/es/gestures/drag/index.mjs deleted file mode 100644 index 6eda988..0000000 --- a/node_modules/framer-motion/dist/es/gestures/drag/index.mjs +++ /dev/null @@ -1,51 +0,0 @@ -import { Feature } from 'motion-dom'; -import { noop } from 'motion-utils'; -import { VisualElementDragControls } from './VisualElementDragControls.mjs'; - -class DragGesture extends Feature { - constructor(node) { - super(node); - this.removeGroupControls = noop; - this.removeListeners = noop; - this.controls = new VisualElementDragControls(node); - } - mount() { - // If we've been provided a DragControls for manual control over the drag gesture, - // subscribe this component to it on mount. - const { dragControls } = this.node.getProps(); - if (dragControls) { - this.removeGroupControls = dragControls.subscribe(this.controls); - } - this.removeListeners = this.controls.addListeners() || noop; - } - update() { - const { dragControls } = this.node.getProps(); - const { dragControls: prevDragControls } = this.node.prevProps || {}; - if (dragControls !== prevDragControls) { - this.removeGroupControls(); - if (dragControls) { - this.removeGroupControls = dragControls.subscribe(this.controls); - } - } - } - unmount() { - this.removeGroupControls(); - this.removeListeners(); - /** - * In React 19, during list reorder reconciliation, components may - * briefly unmount and remount while the drag is still active. If we're - * actively dragging, we should NOT end the pan session - it will - * continue tracking pointer events via its window-level listeners. - * - * The pan session will be properly cleaned up when: - * 1. The drag ends naturally (pointerup/pointercancel) - * 2. The component is truly removed from the DOM - */ - if (!this.controls.isDragging) { - this.controls.endPanSession(); - } - } -} - -export { DragGesture }; -//# sourceMappingURL=index.mjs.map diff --git a/node_modules/framer-motion/dist/es/gestures/drag/index.mjs.map b/node_modules/framer-motion/dist/es/gestures/drag/index.mjs.map deleted file mode 100644 index 05a1daa..0000000 --- a/node_modules/framer-motion/dist/es/gestures/drag/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs","sources":["../../../../src/gestures/drag/index.ts"],"sourcesContent":["import { Feature, type VisualElement } from \"motion-dom\"\nimport { noop } from \"motion-utils\"\nimport { VisualElementDragControls } from \"./VisualElementDragControls\"\n\nexport class DragGesture extends Feature {\n controls: VisualElementDragControls\n\n removeGroupControls: Function = noop\n removeListeners: Function = noop\n\n constructor(node: VisualElement) {\n super(node)\n this.controls = new VisualElementDragControls(node)\n }\n\n mount() {\n // If we've been provided a DragControls for manual control over the drag gesture,\n // subscribe this component to it on mount.\n const { dragControls } = this.node.getProps()\n\n if (dragControls) {\n this.removeGroupControls = dragControls.subscribe(this.controls)\n }\n\n this.removeListeners = this.controls.addListeners() || noop\n }\n\n update() {\n const { dragControls } = this.node.getProps()\n const { dragControls: prevDragControls } = this.node.prevProps || {}\n\n if (dragControls !== prevDragControls) {\n this.removeGroupControls()\n if (dragControls) {\n this.removeGroupControls = dragControls.subscribe(this.controls)\n }\n }\n }\n\n unmount() {\n this.removeGroupControls()\n this.removeListeners()\n /**\n * In React 19, during list reorder reconciliation, components may\n * briefly unmount and remount while the drag is still active. If we're\n * actively dragging, we should NOT end the pan session - it will\n * continue tracking pointer events via its window-level listeners.\n *\n * The pan session will be properly cleaned up when:\n * 1. The drag ends naturally (pointerup/pointercancel)\n * 2. The component is truly removed from the DOM\n */\n if (!this.controls.isDragging) {\n this.controls.endPanSession()\n }\n }\n}\n"],"names":[],"mappings":";;;;AAIM,MAAO,WAAY,SAAQ,OAAoB,CAAA;AAMjD,IAAA,WAAA,CAAY,IAAgC,EAAA;QACxC,KAAK,CAAC,IAAI,CAAC;QAJf,IAAA,CAAA,mBAAmB,GAAa,IAAI;QACpC,IAAA,CAAA,eAAe,GAAa,IAAI;QAI5B,IAAI,CAAC,QAAQ,GAAG,IAAI,yBAAyB,CAAC,IAAI,CAAC;IACvD;IAEA,KAAK,GAAA;;;QAGD,MAAM,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;QAE7C,IAAI,YAAY,EAAE;YACd,IAAI,CAAC,mBAAmB,GAAG,YAAY,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC;QACpE;QAEA,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,QAAQ,CAAC,YAAY,EAAE,IAAI,IAAI;IAC/D;IAEA,MAAM,GAAA;QACF,MAAM,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;AAC7C,QAAA,MAAM,EAAE,YAAY,EAAE,gBAAgB,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,IAAI,EAAE;AAEpE,QAAA,IAAI,YAAY,KAAK,gBAAgB,EAAE;YACnC,IAAI,CAAC,mBAAmB,EAAE;YAC1B,IAAI,YAAY,EAAE;gBACd,IAAI,CAAC,mBAAmB,GAAG,YAAY,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC;YACpE;QACJ;IACJ;IAEA,OAAO,GAAA;QACH,IAAI,CAAC,mBAAmB,EAAE;QAC1B,IAAI,CAAC,eAAe,EAAE;AACtB;;;;;;;;;AASG;AACH,QAAA,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE;AAC3B,YAAA,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAE;QACjC;IACJ;AACH;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/gestures/drag/use-drag-controls.mjs b/node_modules/framer-motion/dist/es/gestures/drag/use-drag-controls.mjs deleted file mode 100644 index ebd79b9..0000000 --- a/node_modules/framer-motion/dist/es/gestures/drag/use-drag-controls.mjs +++ /dev/null @@ -1,117 +0,0 @@ -import { useConstant } from '../../utils/use-constant.mjs'; - -/** - * Can manually trigger a drag gesture on one or more `drag`-enabled `motion` components. - * - * ```jsx - * const dragControls = useDragControls() - * - * function startDrag(event) { - * dragControls.start(event, { snapToCursor: true }) - * } - * - * return ( - * <> - *
- * - * - * ) - * ``` - * - * @public - */ -class DragControls { - constructor() { - this.componentControls = new Set(); - } - /** - * Subscribe a component's internal `VisualElementDragControls` to the user-facing API. - * - * @internal - */ - subscribe(controls) { - this.componentControls.add(controls); - return () => this.componentControls.delete(controls); - } - /** - * Start a drag gesture on every `motion` component that has this set of drag controls - * passed into it via the `dragControls` prop. - * - * ```jsx - * dragControls.start(e, { - * snapToCursor: true - * }) - * ``` - * - * @param event - PointerEvent - * @param options - Options - * - * @public - */ - start(event, options) { - this.componentControls.forEach((controls) => { - controls.start(event.nativeEvent || event, options); - }); - } - /** - * Cancels a drag gesture. - * - * ```jsx - * dragControls.cancel() - * ``` - * - * @public - */ - cancel() { - this.componentControls.forEach((controls) => { - controls.cancel(); - }); - } - /** - * Stops a drag gesture. - * - * ```jsx - * dragControls.stop() - * ``` - * - * @public - */ - stop() { - this.componentControls.forEach((controls) => { - controls.stop(); - }); - } -} -const createDragControls = () => new DragControls(); -/** - * Usually, dragging is initiated by pressing down on a `motion` component with a `drag` prop - * and moving it. For some use-cases, for instance clicking at an arbitrary point on a video scrubber, we - * might want to initiate that dragging from a different component than the draggable one. - * - * By creating a `dragControls` using the `useDragControls` hook, we can pass this into - * the draggable component's `dragControls` prop. It exposes a `start` method - * that can start dragging from pointer events on other components. - * - * ```jsx - * const dragControls = useDragControls() - * - * function startDrag(event) { - * dragControls.start(event, { snapToCursor: true }) - * } - * - * return ( - * <> - *
- * - * - * ) - * ``` - * - * @public - */ -function useDragControls() { - return useConstant(createDragControls); -} - -export { DragControls, useDragControls }; -//# sourceMappingURL=use-drag-controls.mjs.map diff --git a/node_modules/framer-motion/dist/es/gestures/drag/use-drag-controls.mjs.map b/node_modules/framer-motion/dist/es/gestures/drag/use-drag-controls.mjs.map deleted file mode 100644 index 43af9eb..0000000 --- a/node_modules/framer-motion/dist/es/gestures/drag/use-drag-controls.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"use-drag-controls.mjs","sources":["../../../../src/gestures/drag/use-drag-controls.ts"],"sourcesContent":["import * as React from \"react\"\nimport { useConstant } from \"../../utils/use-constant\"\nimport {\n DragControlOptions,\n VisualElementDragControls,\n} from \"./VisualElementDragControls\"\n\n/**\n * Can manually trigger a drag gesture on one or more `drag`-enabled `motion` components.\n *\n * ```jsx\n * const dragControls = useDragControls()\n *\n * function startDrag(event) {\n * dragControls.start(event, { snapToCursor: true })\n * }\n *\n * return (\n * <>\n *
\n * \n * \n * )\n * ```\n *\n * @public\n */\nexport class DragControls {\n private componentControls = new Set()\n\n /**\n * Subscribe a component's internal `VisualElementDragControls` to the user-facing API.\n *\n * @internal\n */\n subscribe(controls: VisualElementDragControls): () => void {\n this.componentControls.add(controls)\n\n return () => this.componentControls.delete(controls)\n }\n\n /**\n * Start a drag gesture on every `motion` component that has this set of drag controls\n * passed into it via the `dragControls` prop.\n *\n * ```jsx\n * dragControls.start(e, {\n * snapToCursor: true\n * })\n * ```\n *\n * @param event - PointerEvent\n * @param options - Options\n *\n * @public\n */\n start(\n event: React.PointerEvent | PointerEvent,\n options?: DragControlOptions\n ) {\n this.componentControls.forEach((controls) => {\n controls.start(\n (event as React.PointerEvent).nativeEvent || event,\n options\n )\n })\n }\n\n /**\n * Cancels a drag gesture.\n *\n * ```jsx\n * dragControls.cancel()\n * ```\n *\n * @public\n */\n cancel() {\n this.componentControls.forEach((controls) => {\n controls.cancel()\n })\n }\n\n /**\n * Stops a drag gesture.\n *\n * ```jsx\n * dragControls.stop()\n * ```\n *\n * @public\n */\n stop() {\n this.componentControls.forEach((controls) => {\n controls.stop()\n })\n }\n}\n\nconst createDragControls = () => new DragControls()\n\n/**\n * Usually, dragging is initiated by pressing down on a `motion` component with a `drag` prop\n * and moving it. For some use-cases, for instance clicking at an arbitrary point on a video scrubber, we\n * might want to initiate that dragging from a different component than the draggable one.\n *\n * By creating a `dragControls` using the `useDragControls` hook, we can pass this into\n * the draggable component's `dragControls` prop. It exposes a `start` method\n * that can start dragging from pointer events on other components.\n *\n * ```jsx\n * const dragControls = useDragControls()\n *\n * function startDrag(event) {\n * dragControls.start(event, { snapToCursor: true })\n * }\n *\n * return (\n * <>\n *
\n * \n * \n * )\n * ```\n *\n * @public\n */\nexport function useDragControls() {\n return useConstant(createDragControls)\n}\n"],"names":[],"mappings":";;AAOA;;;;;;;;;;;;;;;;;;;AAmBG;MACU,YAAY,CAAA;AAAzB,IAAA,WAAA,GAAA;AACY,QAAA,IAAA,CAAA,iBAAiB,GAAG,IAAI,GAAG,EAA6B;IAqEpE;AAnEI;;;;AAIG;AACH,IAAA,SAAS,CAAC,QAAmC,EAAA;AACzC,QAAA,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,QAAQ,CAAC;QAEpC,OAAO,MAAM,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,QAAQ,CAAC;IACxD;AAEA;;;;;;;;;;;;;;AAcG;IACH,KAAK,CACD,KAAwC,EACxC,OAA4B,EAAA;QAE5B,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,QAAQ,KAAI;YACxC,QAAQ,CAAC,KAAK,CACT,KAA4B,CAAC,WAAW,IAAI,KAAK,EAClD,OAAO,CACV;AACL,QAAA,CAAC,CAAC;IACN;AAEA;;;;;;;;AAQG;IACH,MAAM,GAAA;QACF,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,QAAQ,KAAI;YACxC,QAAQ,CAAC,MAAM,EAAE;AACrB,QAAA,CAAC,CAAC;IACN;AAEA;;;;;;;;AAQG;IACH,IAAI,GAAA;QACA,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,QAAQ,KAAI;YACxC,QAAQ,CAAC,IAAI,EAAE;AACnB,QAAA,CAAC,CAAC;IACN;AACH;AAED,MAAM,kBAAkB,GAAG,MAAM,IAAI,YAAY,EAAE;AAEnD;;;;;;;;;;;;;;;;;;;;;;;;;AAyBG;SACa,eAAe,GAAA;AAC3B,IAAA,OAAO,WAAW,CAAC,kBAAkB,CAAC;AAC1C;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.mjs b/node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.mjs deleted file mode 100644 index 98c6754..0000000 --- a/node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.mjs +++ /dev/null @@ -1,128 +0,0 @@ -import { mixNumber, calcLength } from 'motion-dom'; -import { progress, clamp } from 'motion-utils'; - -/** - * Apply constraints to a point. These constraints are both physical along an - * axis, and an elastic factor that determines how much to constrain the point - * by if it does lie outside the defined parameters. - */ -function applyConstraints(point, { min, max }, elastic) { - if (min !== undefined && point < min) { - // If we have a min point defined, and this is outside of that, constrain - point = elastic - ? mixNumber(min, point, elastic.min) - : Math.max(point, min); - } - else if (max !== undefined && point > max) { - // If we have a max point defined, and this is outside of that, constrain - point = elastic - ? mixNumber(max, point, elastic.max) - : Math.min(point, max); - } - return point; -} -/** - * Calculate constraints in terms of the viewport when defined relatively to the - * measured axis. This is measured from the nearest edge, so a max constraint of 200 - * on an axis with a max value of 300 would return a constraint of 500 - axis length - */ -function calcRelativeAxisConstraints(axis, min, max) { - return { - min: min !== undefined ? axis.min + min : undefined, - max: max !== undefined - ? axis.max + max - (axis.max - axis.min) - : undefined, - }; -} -/** - * Calculate constraints in terms of the viewport when - * defined relatively to the measured bounding box. - */ -function calcRelativeConstraints(layoutBox, { top, left, bottom, right }) { - return { - x: calcRelativeAxisConstraints(layoutBox.x, left, right), - y: calcRelativeAxisConstraints(layoutBox.y, top, bottom), - }; -} -/** - * Calculate viewport constraints when defined as another viewport-relative axis - */ -function calcViewportAxisConstraints(layoutAxis, constraintsAxis) { - let min = constraintsAxis.min - layoutAxis.min; - let max = constraintsAxis.max - layoutAxis.max; - // If the constraints axis is actually smaller than the layout axis then we can - // flip the constraints - if (constraintsAxis.max - constraintsAxis.min < - layoutAxis.max - layoutAxis.min) { - [min, max] = [max, min]; - } - return { min, max }; -} -/** - * Calculate viewport constraints when defined as another viewport-relative box - */ -function calcViewportConstraints(layoutBox, constraintsBox) { - return { - x: calcViewportAxisConstraints(layoutBox.x, constraintsBox.x), - y: calcViewportAxisConstraints(layoutBox.y, constraintsBox.y), - }; -} -/** - * Calculate a transform origin relative to the source axis, between 0-1, that results - * in an asthetically pleasing scale/transform needed to project from source to target. - */ -function calcOrigin(source, target) { - let origin = 0.5; - const sourceLength = calcLength(source); - const targetLength = calcLength(target); - if (targetLength > sourceLength) { - origin = progress(target.min, target.max - sourceLength, source.min); - } - else if (sourceLength > targetLength) { - origin = progress(source.min, source.max - targetLength, target.min); - } - return clamp(0, 1, origin); -} -/** - * Rebase the calculated viewport constraints relative to the layout.min point. - */ -function rebaseAxisConstraints(layout, constraints) { - const relativeConstraints = {}; - if (constraints.min !== undefined) { - relativeConstraints.min = constraints.min - layout.min; - } - if (constraints.max !== undefined) { - relativeConstraints.max = constraints.max - layout.min; - } - return relativeConstraints; -} -const defaultElastic = 0.35; -/** - * Accepts a dragElastic prop and returns resolved elastic values for each axis. - */ -function resolveDragElastic(dragElastic = defaultElastic) { - if (dragElastic === false) { - dragElastic = 0; - } - else if (dragElastic === true) { - dragElastic = defaultElastic; - } - return { - x: resolveAxisElastic(dragElastic, "left", "right"), - y: resolveAxisElastic(dragElastic, "top", "bottom"), - }; -} -function resolveAxisElastic(dragElastic, minLabel, maxLabel) { - return { - min: resolvePointElastic(dragElastic, minLabel), - max: resolvePointElastic(dragElastic, maxLabel), - }; -} -function resolvePointElastic(dragElastic, label) { - return typeof dragElastic === "number" - ? dragElastic - : dragElastic[label] || 0; -} - -export { applyConstraints, calcOrigin, calcRelativeAxisConstraints, calcRelativeConstraints, calcViewportAxisConstraints, calcViewportConstraints, defaultElastic, rebaseAxisConstraints, resolveAxisElastic, resolveDragElastic, resolvePointElastic }; -//# sourceMappingURL=constraints.mjs.map diff --git a/node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.mjs.map b/node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.mjs.map deleted file mode 100644 index 3405bd5..0000000 --- a/node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"constraints.mjs","sources":["../../../../../src/gestures/drag/utils/constraints.ts"],"sourcesContent":["import { calcLength, mixNumber, type DragElastic, type ResolvedConstraints } from \"motion-dom\"\nimport {\n Axis,\n BoundingBox,\n Box,\n progress as calcProgress,\n clamp,\n Point,\n} from \"motion-utils\"\n\n/**\n * Apply constraints to a point. These constraints are both physical along an\n * axis, and an elastic factor that determines how much to constrain the point\n * by if it does lie outside the defined parameters.\n */\nexport function applyConstraints(\n point: number,\n { min, max }: Partial,\n elastic?: Axis\n): number {\n if (min !== undefined && point < min) {\n // If we have a min point defined, and this is outside of that, constrain\n point = elastic\n ? mixNumber(min, point, elastic.min)\n : Math.max(point, min)\n } else if (max !== undefined && point > max) {\n // If we have a max point defined, and this is outside of that, constrain\n point = elastic\n ? mixNumber(max, point, elastic.max)\n : Math.min(point, max)\n }\n\n return point\n}\n\n/**\n * Calculates a min projection point based on a pointer, pointer progress\n * within the drag target, and constraints.\n *\n * For instance if an element was 100px width, we were dragging from 0.25\n * along this axis, the pointer is at 200px, and there were no constraints,\n * we would calculate a min projection point of 175px.\n */\nexport function calcConstrainedMinPoint(\n point: number,\n length: number,\n progress: number,\n constraints?: Partial,\n elastic?: Axis\n): number {\n // Calculate a min point for this axis and apply it to the current pointer\n const min = point - length * progress\n\n return constraints ? applyConstraints(min, constraints, elastic) : min\n}\n\n/**\n * Calculate constraints in terms of the viewport when defined relatively to the\n * measured axis. This is measured from the nearest edge, so a max constraint of 200\n * on an axis with a max value of 300 would return a constraint of 500 - axis length\n */\nexport function calcRelativeAxisConstraints(\n axis: Axis,\n min?: number,\n max?: number\n): Partial {\n return {\n min: min !== undefined ? axis.min + min : undefined,\n max:\n max !== undefined\n ? axis.max + max - (axis.max - axis.min)\n : undefined,\n }\n}\n\n/**\n * Calculate constraints in terms of the viewport when\n * defined relatively to the measured bounding box.\n */\nexport function calcRelativeConstraints(\n layoutBox: Box,\n { top, left, bottom, right }: Partial\n): ResolvedConstraints {\n return {\n x: calcRelativeAxisConstraints(layoutBox.x, left, right),\n y: calcRelativeAxisConstraints(layoutBox.y, top, bottom),\n }\n}\n\n/**\n * Calculate viewport constraints when defined as another viewport-relative axis\n */\nexport function calcViewportAxisConstraints(\n layoutAxis: Axis,\n constraintsAxis: Axis\n) {\n let min = constraintsAxis.min - layoutAxis.min\n let max = constraintsAxis.max - layoutAxis.max\n\n // If the constraints axis is actually smaller than the layout axis then we can\n // flip the constraints\n if (\n constraintsAxis.max - constraintsAxis.min <\n layoutAxis.max - layoutAxis.min\n ) {\n ;[min, max] = [max, min]\n }\n\n return { min, max }\n}\n\n/**\n * Calculate viewport constraints when defined as another viewport-relative box\n */\nexport function calcViewportConstraints(layoutBox: Box, constraintsBox: Box) {\n return {\n x: calcViewportAxisConstraints(layoutBox.x, constraintsBox.x),\n y: calcViewportAxisConstraints(layoutBox.y, constraintsBox.y),\n }\n}\n\n/**\n * Calculate a transform origin relative to the source axis, between 0-1, that results\n * in an asthetically pleasing scale/transform needed to project from source to target.\n */\nexport function calcOrigin(source: Axis, target: Axis): number {\n let origin = 0.5\n const sourceLength = calcLength(source)\n const targetLength = calcLength(target)\n\n if (targetLength > sourceLength) {\n origin = calcProgress(target.min, target.max - sourceLength, source.min)\n } else if (sourceLength > targetLength) {\n origin = calcProgress(source.min, source.max - targetLength, target.min)\n }\n\n return clamp(0, 1, origin)\n}\n\n/**\n * Calculate the relative progress of one constraints box relative to another.\n * Imagine a page scroll bar. At the top, this would return 0, at the bottom, 1.\n * Anywhere in-between, a value between 0 and 1.\n *\n * This also handles flipped constraints, for instance a draggable container within\n * a smaller viewport like a scrollable view.\n */\nexport function calcProgressWithinConstraints(\n layoutBox: Box,\n constraintsBox: Box\n): Point {\n return {\n x: calcOrigin(layoutBox.x, constraintsBox.x),\n y: calcOrigin(layoutBox.y, constraintsBox.y),\n }\n}\n\n/**\n * Calculate the an axis position based on two axes and a progress value.\n */\nexport function calcPositionFromProgress(\n axis: Axis,\n constraints: Axis,\n progress: number\n): Axis {\n const axisLength = axis.max - axis.min\n const min = mixNumber(\n constraints.min,\n constraints.max - axisLength,\n progress\n )\n return { min, max: min + axisLength }\n}\n\n/**\n * Rebase the calculated viewport constraints relative to the layout.min point.\n */\nexport function rebaseAxisConstraints(\n layout: Axis,\n constraints: Partial\n): Partial {\n const relativeConstraints: Partial = {}\n\n if (constraints.min !== undefined) {\n relativeConstraints.min = constraints.min - layout.min\n }\n\n if (constraints.max !== undefined) {\n relativeConstraints.max = constraints.max - layout.min\n }\n\n return relativeConstraints\n}\n\nexport const defaultElastic = 0.35\n/**\n * Accepts a dragElastic prop and returns resolved elastic values for each axis.\n */\nexport function resolveDragElastic(\n dragElastic: DragElastic = defaultElastic\n): Box {\n if (dragElastic === false) {\n dragElastic = 0\n } else if (dragElastic === true) {\n dragElastic = defaultElastic\n }\n\n return {\n x: resolveAxisElastic(dragElastic, \"left\", \"right\"),\n y: resolveAxisElastic(dragElastic, \"top\", \"bottom\"),\n }\n}\n\nexport function resolveAxisElastic(\n dragElastic: DragElastic,\n minLabel: string,\n maxLabel: string\n): Axis {\n return {\n min: resolvePointElastic(dragElastic, minLabel),\n max: resolvePointElastic(dragElastic, maxLabel),\n }\n}\n\nexport function resolvePointElastic(\n dragElastic: DragElastic,\n label: string\n): number {\n return typeof dragElastic === \"number\"\n ? dragElastic\n : dragElastic[label as keyof typeof dragElastic] || 0\n}\n"],"names":["calcProgress"],"mappings":";;;AAUA;;;;AAIG;AACG,SAAU,gBAAgB,CAC5B,KAAa,EACb,EAAE,GAAG,EAAE,GAAG,EAAiB,EAC3B,OAAc,EAAA;IAEd,IAAI,GAAG,KAAK,SAAS,IAAI,KAAK,GAAG,GAAG,EAAE;;AAElC,QAAA,KAAK,GAAG;cACF,SAAS,CAAC,GAAG,EAAE,KA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AAG,MAAM,CAAC,GAAG;IAC1D;AAEA,IAAA,IAAI,WAAW,CAAC,GAAG,KAAK,SAAS,EAAE;QAC/B,mBAAmB,CAAC,GAAG,GAAG,WAAW,CAAC,GAAG,GAAG,MAAM,CAAC,GAAG;IAC1D;AAEA,IAAA,OAAO,mBAAmB;AAC9B;AAEO,MAAM,cAAc,GAAG;AAC9B;;AAEG;AACG,SAAU,kBAAkB,CAC9B,WAAA,GAA2B,cAAc,EAAA;AAEzC,IAAA,IAAI,WAAW,KAAK,KAAK,EAAE;QACvB,WAAW,GAAG,CAAC;IACnB;AAAO,SAAA,IAAI,WAAW,KAAK,IAAI,EAAE;QAC7B,WAAW,GAAG,cAAc;IAChC;IAEA,OAAO;QACH,CAAC,EAAE,kBAAkB,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC;QACnD,CAAC,EAAE,kBAAkB,CAAC,WAAW,EAAE,KAAK,EAAE,QAAQ,CAAC;KACtD;AACL;SAEgB,kBAAkB,CAC9B,WAAwB,EACxB,QAAgB,EAChB,QAAgB,EAAA;IAEhB,OAAO;AACH,QAAA,GAAG,EAAE,mBAAmB,CAAC,WAAW,EAAE,QAAQ,CAAC;AAC/C,QAAA,GAAG,EAAE,mBAAmB,CAAC,WAAW,EAAE,QAAQ,CAAC;KAClD;AACL;AAEM,SAAU,mBAAmB,CAC/B,WAAwB,EACxB,KAAa,EAAA;IAEb,OAAO,OAAO,WAAW,KAAK;AAC1B,UAAE;AACF,UAAE,WAAW,CAAC,KAAiC,CAAC,IAAI,CAAC;AAC7D;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/gestures/focus.mjs b/node_modules/framer-motion/dist/es/gestures/focus.mjs deleted file mode 100644 index dcd3282..0000000 --- a/node_modules/framer-motion/dist/es/gestures/focus.mjs +++ /dev/null @@ -1,41 +0,0 @@ -import { Feature, addDomEvent } from 'motion-dom'; -import { pipe } from 'motion-utils'; - -class FocusGesture extends Feature { - constructor() { - super(...arguments); - this.isActive = false; - } - onFocus() { - let isFocusVisible = false; - /** - * If this element doesn't match focus-visible then don't - * apply whileHover. But, if matches throws that focus-visible - * is not a valid selector then in that browser outline styles will be applied - * to the element by default and we want to match that behaviour with whileFocus. - */ - try { - isFocusVisible = this.node.current.matches(":focus-visible"); - } - catch (e) { - isFocusVisible = true; - } - if (!isFocusVisible || !this.node.animationState) - return; - this.node.animationState.setActive("whileFocus", true); - this.isActive = true; - } - onBlur() { - if (!this.isActive || !this.node.animationState) - return; - this.node.animationState.setActive("whileFocus", false); - this.isActive = false; - } - mount() { - this.unmount = pipe(addDomEvent(this.node.current, "focus", () => this.onFocus()), addDomEvent(this.node.current, "blur", () => this.onBlur())); - } - unmount() { } -} - -export { FocusGesture }; -//# sourceMappingURL=focus.mjs.map diff --git a/node_modules/framer-motion/dist/es/gestures/focus.mjs.map b/node_modules/framer-motion/dist/es/gestures/focus.mjs.map deleted file mode 100644 index 6263f64..0000000 --- a/node_modules/framer-motion/dist/es/gestures/focus.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"focus.mjs","sources":["../../../src/gestures/focus.ts"],"sourcesContent":["import { Feature, addDomEvent } from \"motion-dom\"\nimport { pipe } from \"motion-utils\"\n\nexport class FocusGesture extends Feature {\n private isActive = false\n\n onFocus() {\n let isFocusVisible = false\n\n /**\n * If this element doesn't match focus-visible then don't\n * apply whileHover. But, if matches throws that focus-visible\n * is not a valid selector then in that browser outline styles will be applied\n * to the element by default and we want to match that behaviour with whileFocus.\n */\n try {\n isFocusVisible = this.node.current!.matches(\":focus-visible\")\n } catch (e) {\n isFocusVisible = true\n }\n\n if (!isFocusVisible || !this.node.animationState) return\n\n this.node.animationState.setActive(\"whileFocus\", true)\n this.isActive = true\n }\n\n onBlur() {\n if (!this.isActive || !this.node.animationState) return\n this.node.animationState.setActive(\"whileFocus\", false)\n this.isActive = false\n }\n\n mount() {\n this.unmount = pipe(\n addDomEvent(this.node.current!, \"focus\", () => this.onFocus()),\n addDomEvent(this.node.current!, \"blur\", () => this.onBlur())\n ) as VoidFunction\n }\n\n unmount() {}\n}\n"],"names":[],"mappings":";;;AAGM,MAAO,YAAa,SAAQ,OAAgB,CAAA;AAAlD,IAAA,WAAA,GAAA;;QACY,IAAA,CAAA,QAAQ,GAAG,KAAK;IAqC5B;IAnCI,OAAO,GAAA;QACH,IAAI,cAAc,GAAG,KAAK;AAE1B;;;;;AAKG;AACH,QAAA,IAAI;YACA,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,OAAQ,CAAC,OAAO,CAAC,gBAAgB,CAAC;QACjE;QAAE,OAAO,CAAC,EAAE;YACR,cAAc,GAAG,IAAI;QACzB;QAEA,IAAI,CAAC,cAAc,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc;YAAE;QAElD,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,YAAY,EAAE,IAAI,CAAC;AACtD,QAAA,IAAI,CAAC,QAAQ,GAAG,IAAI;IACxB;IAEA,MAAM,GAAA;QACF,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc;YAAE;QACjD,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,YAAY,EAAE,KAAK,CAAC;AACvD,QAAA,IAAI,CAAC,QAAQ,GAAG,KAAK;IACzB;IAEA,KAAK,GAAA;AACD,QAAA,IAAI,CAAC,OAAO,GAAG,IAAI,CACf,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,OAAQ,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC,EAC9D,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,OAAQ,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC,MAAM,EAAE,CAAC,CAC/C;IACrB;AAEA,IAAA,OAAO,KAAI;AACd;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/gestures/hover.mjs b/node_modules/framer-motion/dist/es/gestures/hover.mjs deleted file mode 100644 index 6ab462f..0000000 --- a/node_modules/framer-motion/dist/es/gestures/hover.mjs +++ /dev/null @@ -1,29 +0,0 @@ -import { Feature, hover, frame } from 'motion-dom'; -import { extractEventInfo } from '../events/event-info.mjs'; - -function handleHoverEvent(node, event, lifecycle) { - const { props } = node; - if (node.animationState && props.whileHover) { - node.animationState.setActive("whileHover", lifecycle === "Start"); - } - const eventName = ("onHover" + lifecycle); - const callback = props[eventName]; - if (callback) { - frame.postRender(() => callback(event, extractEventInfo(event))); - } -} -class HoverGesture extends Feature { - mount() { - const { current } = this.node; - if (!current) - return; - this.unmount = hover(current, (_element, startEvent) => { - handleHoverEvent(this.node, startEvent, "Start"); - return (endEvent) => handleHoverEvent(this.node, endEvent, "End"); - }); - } - unmount() { } -} - -export { HoverGesture }; -//# sourceMappingURL=hover.mjs.map diff --git a/node_modules/framer-motion/dist/es/gestures/hover.mjs.map b/node_modules/framer-motion/dist/es/gestures/hover.mjs.map deleted file mode 100644 index 6f06642..0000000 --- a/node_modules/framer-motion/dist/es/gestures/hover.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"hover.mjs","sources":["../../../src/gestures/hover.ts"],"sourcesContent":["import { Feature, frame, hover, type VisualElement } from \"motion-dom\"\nimport { extractEventInfo } from \"../events/event-info\"\n\nfunction handleHoverEvent(\n node: VisualElement,\n event: PointerEvent,\n lifecycle: \"Start\" | \"End\"\n) {\n const { props } = node\n\n if (node.animationState && props.whileHover) {\n node.animationState.setActive(\"whileHover\", lifecycle === \"Start\")\n }\n\n const eventName = (\"onHover\" + lifecycle) as \"onHoverStart\" | \"onHoverEnd\"\n const callback = props[eventName]\n if (callback) {\n frame.postRender(() => callback(event, extractEventInfo(event)))\n }\n}\n\nexport class HoverGesture extends Feature {\n mount() {\n const { current } = this.node\n if (!current) return\n\n this.unmount = hover(current, (_element, startEvent) => {\n handleHoverEvent(this.node, startEvent, \"Start\")\n\n return (endEvent) => handleHoverEvent(this.node, endEvent, \"End\")\n })\n }\n\n unmount() {}\n}\n"],"names":[],"mappings":";;;AAGA,SAAS,gBAAgB,CACrB,IAA4B,EAC5B,KAAmB,EACnB,SAA0B,EAAA;AAE1B,IAAA,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI;IAEtB,IAAI,IAAI,CAAC,cAAc,IAAI,KAAK,CAAC,UAAU,EAAE;QACzC,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,YAAY,EAAE,SAAS,KAAK,OAAO,CAAC;IACtE;AAEA,IAAA,MAAM,SAAS,IAAI,SAAS,GAAG,SAAS,CAAkC;AAC1E,IAAA,MAAM,QAAQ,GAAG,KAAK,CAAC,SAAS,CAAC;IACjC,IAAI,QAAQ,EAAE;AACV,QAAA,KAAK,CAAC,UAAU,CAAC,MAAM,QAAQ,CAAC,KAAK,EAAE,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC;IACpE;AACJ;AAEM,MAAO,YAAa,SAAQ,OAAgB,CAAA;IAC9C,KAAK,GAAA;AACD,QAAA,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,IAAI;AAC7B,QAAA,IAAI,CAAC,OAAO;YAAE;AAEd,QAAA,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,UAAU,KAAI;YACnD,gBAAgB,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,CAAC;AAEhD,YAAA,OAAO,CAAC,QAAQ,KAAK,gBAAgB,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,CAAC;AACrE,QAAA,CAAC,CAAC;IACN;AAEA,IAAA,OAAO,KAAI;AACd;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/gestures/pan/PanSession.mjs b/node_modules/framer-motion/dist/es/gestures/pan/PanSession.mjs deleted file mode 100644 index 548ff9e..0000000 --- a/node_modules/framer-motion/dist/es/gestures/pan/PanSession.mjs +++ /dev/null @@ -1,283 +0,0 @@ -import { frameData, frame, isPrimaryPointer, cancelFrame } from 'motion-dom'; -import { pipe, secondsToMilliseconds, millisecondsToSeconds } from 'motion-utils'; -import { addPointerEvent } from '../../events/add-pointer-event.mjs'; -import { extractEventInfo } from '../../events/event-info.mjs'; -import { distance2D } from '../../utils/distance.mjs'; - -const overflowStyles = /*#__PURE__*/ new Set(["auto", "scroll"]); -/** - * @internal - */ -class PanSession { - constructor(event, handlers, { transformPagePoint, contextWindow = window, dragSnapToOrigin = false, distanceThreshold = 3, element, } = {}) { - /** - * @internal - */ - this.startEvent = null; - /** - * @internal - */ - this.lastMoveEvent = null; - /** - * @internal - */ - this.lastMoveEventInfo = null; - /** - * Raw (untransformed) event info, re-transformed each frame - * so transformPagePoint sees the current parent matrix. - * @internal - */ - this.lastRawMoveEventInfo = null; - /** - * @internal - */ - this.handlers = {}; - /** - * @internal - */ - this.contextWindow = window; - /** - * Scroll positions of scrollable ancestors and window. - * @internal - */ - this.scrollPositions = new Map(); - /** - * Cleanup function for scroll listeners. - * @internal - */ - this.removeScrollListeners = null; - this.onElementScroll = (event) => { - this.handleScroll(event.target); - }; - this.onWindowScroll = () => { - this.handleScroll(window); - }; - this.updatePoint = () => { - if (!(this.lastMoveEvent && this.lastMoveEventInfo)) - return; - // Re-transform raw point through current transformPagePoint so - // animated parent transforms (e.g. rotation) are picked up each frame - if (this.lastRawMoveEventInfo) { - this.lastMoveEventInfo = transformPoint(this.lastRawMoveEventInfo, this.transformPagePoint); - } - const info = getPanInfo(this.lastMoveEventInfo, this.history); - const isPanStarted = this.startEvent !== null; - // Only start panning if the offset is larger than 3 pixels. If we make it - // any larger than this we'll want to reset the pointer history - // on the first update to avoid visual snapping to the cursor. - const isDistancePastThreshold = distance2D(info.offset, { x: 0, y: 0 }) >= this.distanceThreshold; - if (!isPanStarted && !isDistancePastThreshold) - return; - const { point } = info; - const { timestamp } = frameData; - this.history.push({ ...point, timestamp }); - const { onStart, onMove } = this.handlers; - if (!isPanStarted) { - onStart && onStart(this.lastMoveEvent, info); - this.startEvent = this.lastMoveEvent; - } - onMove && onMove(this.lastMoveEvent, info); - }; - this.handlePointerMove = (event, info) => { - this.lastMoveEvent = event; - this.lastRawMoveEventInfo = info; - this.lastMoveEventInfo = transformPoint(info, this.transformPagePoint); - // Throttle mouse move event to once per frame - frame.update(this.updatePoint, true); - }; - this.handlePointerUp = (event, info) => { - this.end(); - const { onEnd, onSessionEnd, resumeAnimation } = this.handlers; - // Resume animation if dragSnapToOrigin is set OR if no drag started (user just clicked) - // This ensures constraint animations continue when interrupted by a click - if (this.dragSnapToOrigin || !this.startEvent) { - resumeAnimation && resumeAnimation(); - } - if (!(this.lastMoveEvent && this.lastMoveEventInfo)) - return; - const panInfo = getPanInfo(event.type === "pointercancel" - ? this.lastMoveEventInfo - : transformPoint(info, this.transformPagePoint), this.history); - if (this.startEvent && onEnd) { - onEnd(event, panInfo); - } - onSessionEnd && onSessionEnd(event, panInfo); - }; - // If we have more than one touch, don't start detecting this gesture - if (!isPrimaryPointer(event)) - return; - this.dragSnapToOrigin = dragSnapToOrigin; - this.handlers = handlers; - this.transformPagePoint = transformPagePoint; - this.distanceThreshold = distanceThreshold; - this.contextWindow = contextWindow || window; - const info = extractEventInfo(event); - const initialInfo = transformPoint(info, this.transformPagePoint); - const { point } = initialInfo; - const { timestamp } = frameData; - this.history = [{ ...point, timestamp }]; - const { onSessionStart } = handlers; - onSessionStart && - onSessionStart(event, getPanInfo(initialInfo, this.history)); - // Listen in the capture phase so a descendant calling - // stopPropagation() (e.g. in its own pointerup handler) can't - // prevent the gesture from ending. See #2794. - const eventOptions = { passive: true, capture: true }; - this.removeListeners = pipe(addPointerEvent(this.contextWindow, "pointermove", this.handlePointerMove, eventOptions), addPointerEvent(this.contextWindow, "pointerup", this.handlePointerUp, eventOptions), addPointerEvent(this.contextWindow, "pointercancel", this.handlePointerUp, eventOptions)); - // Start scroll tracking if element provided - if (element) { - this.startScrollTracking(element); - } - } - /** - * Start tracking scroll on ancestors and window. - */ - startScrollTracking(element) { - // Store initial scroll positions for scrollable ancestors - let current = element.parentElement; - while (current) { - const style = getComputedStyle(current); - if (overflowStyles.has(style.overflowX) || - overflowStyles.has(style.overflowY)) { - this.scrollPositions.set(current, { - x: current.scrollLeft, - y: current.scrollTop, - }); - } - current = current.parentElement; - } - // Track window scroll - this.scrollPositions.set(window, { - x: window.scrollX, - y: window.scrollY, - }); - // Capture listener catches element scroll events as they bubble - window.addEventListener("scroll", this.onElementScroll, { - capture: true, - }); - // Direct window scroll listener (window scroll doesn't bubble) - window.addEventListener("scroll", this.onWindowScroll); - this.removeScrollListeners = () => { - window.removeEventListener("scroll", this.onElementScroll, { - capture: true, - }); - window.removeEventListener("scroll", this.onWindowScroll); - }; - } - /** - * Handle scroll compensation during drag. - * - * For element scroll: adjusts history origin since pageX/pageY doesn't change. - * For window scroll: adjusts lastMoveEventInfo since pageX/pageY would change. - */ - handleScroll(target) { - const initial = this.scrollPositions.get(target); - if (!initial) - return; - const isWindow = target === window; - const current = isWindow - ? { x: window.scrollX, y: window.scrollY } - : { - x: target.scrollLeft, - y: target.scrollTop, - }; - const delta = { x: current.x - initial.x, y: current.y - initial.y }; - if (delta.x === 0 && delta.y === 0) - return; - if (isWindow) { - // Window scroll: pageX/pageY changes, so update lastMoveEventInfo - if (this.lastMoveEventInfo) { - this.lastMoveEventInfo.point.x += delta.x; - this.lastMoveEventInfo.point.y += delta.y; - } - } - else { - // Element scroll: pageX/pageY unchanged, so adjust history origin - if (this.history.length > 0) { - this.history[0].x -= delta.x; - this.history[0].y -= delta.y; - } - } - this.scrollPositions.set(target, current); - frame.update(this.updatePoint, true); - } - updateHandlers(handlers) { - this.handlers = handlers; - } - end() { - this.removeListeners && this.removeListeners(); - this.removeScrollListeners && this.removeScrollListeners(); - this.scrollPositions.clear(); - cancelFrame(this.updatePoint); - } -} -function transformPoint(info, transformPagePoint) { - return transformPagePoint ? { point: transformPagePoint(info.point) } : info; -} -function subtractPoint(a, b) { - return { x: a.x - b.x, y: a.y - b.y }; -} -function getPanInfo({ point }, history) { - return { - point, - delta: subtractPoint(point, lastDevicePoint(history)), - offset: subtractPoint(point, startDevicePoint(history)), - velocity: getVelocity(history, 0.1), - }; -} -function startDevicePoint(history) { - return history[0]; -} -function lastDevicePoint(history) { - return history[history.length - 1]; -} -function getVelocity(history, timeDelta) { - if (history.length < 2) { - return { x: 0, y: 0 }; - } - let i = history.length - 1; - let timestampedPoint = null; - const lastPoint = lastDevicePoint(history); - while (i >= 0) { - timestampedPoint = history[i]; - if (lastPoint.timestamp - timestampedPoint.timestamp > - secondsToMilliseconds(timeDelta)) { - break; - } - i--; - } - if (!timestampedPoint) { - return { x: 0, y: 0 }; - } - /** - * If the selected point is the pointer-down origin (history[0]), - * there are better movement points available, and the time gap - * is suspiciously large (>2x timeDelta), use the next point instead. - * This prevents stale pointer-down points from diluting velocity - * in hold-then-flick gestures. - */ - if (timestampedPoint === history[0] && - history.length > 2 && - lastPoint.timestamp - timestampedPoint.timestamp > - secondsToMilliseconds(timeDelta) * 2) { - timestampedPoint = history[1]; - } - const time = millisecondsToSeconds(lastPoint.timestamp - timestampedPoint.timestamp); - if (time === 0) { - return { x: 0, y: 0 }; - } - const currentVelocity = { - x: (lastPoint.x - timestampedPoint.x) / time, - y: (lastPoint.y - timestampedPoint.y) / time, - }; - if (currentVelocity.x === Infinity) { - currentVelocity.x = 0; - } - if (currentVelocity.y === Infinity) { - currentVelocity.y = 0; - } - return currentVelocity; -} - -export { PanSession }; -//# sourceMappingURL=PanSession.mjs.map diff --git a/node_modules/framer-motion/dist/es/gestures/pan/PanSession.mjs.map b/node_modules/framer-motion/dist/es/gestures/pan/PanSession.mjs.map deleted file mode 100644 index 696b160..0000000 --- a/node_modules/framer-motion/dist/es/gestures/pan/PanSession.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"PanSession.mjs","sources":["../../../../src/gestures/pan/PanSession.ts"],"sourcesContent":["import type { EventInfo, PanHandler } from \"motion-dom\"\nimport { cancelFrame, frame, frameData, isPrimaryPointer } from \"motion-dom\"\nimport {\n millisecondsToSeconds,\n pipe,\n Point,\n secondsToMilliseconds,\n TransformPoint,\n} from \"motion-utils\"\nimport { addPointerEvent } from \"../../events/add-pointer-event\"\nimport { extractEventInfo } from \"../../events/event-info\"\nimport { distance2D } from \"../../utils/distance\"\n\ninterface PanSessionHandlers {\n onSessionStart: PanHandler\n onStart: PanHandler\n onMove: PanHandler\n onEnd: PanHandler\n onSessionEnd: PanHandler\n resumeAnimation: () => void\n}\n\ninterface PanSessionOptions {\n transformPagePoint?: TransformPoint\n dragSnapToOrigin?: boolean | \"x\" | \"y\"\n distanceThreshold?: number\n contextWindow?: (Window & typeof globalThis) | null\n /**\n * Element being dragged. When provided, scroll events on its\n * ancestors and window are compensated so the gesture continues\n * smoothly during scroll.\n */\n element?: HTMLElement | null\n}\n\ninterface TimestampedPoint extends Point {\n timestamp: number\n}\n\nconst overflowStyles = /*#__PURE__*/ new Set([\"auto\", \"scroll\"])\n\n/**\n * @internal\n */\nexport class PanSession {\n /**\n * @internal\n */\n private history: TimestampedPoint[]\n\n /**\n * @internal\n */\n private startEvent: PointerEvent | null = null\n\n /**\n * @internal\n */\n private lastMoveEvent: PointerEvent | null = null\n\n /**\n * @internal\n */\n private lastMoveEventInfo: EventInfo | null = null\n\n /**\n * Raw (untransformed) event info, re-transformed each frame\n * so transformPagePoint sees the current parent matrix.\n * @internal\n */\n private lastRawMoveEventInfo: EventInfo | null = null\n\n /**\n * @internal\n */\n private transformPagePoint?: TransformPoint\n\n /**\n * @internal\n */\n private handlers: Partial = {}\n\n /**\n * @internal\n */\n private removeListeners: Function\n\n /**\n * For determining if an animation should resume after it is interupted\n *\n * @internal\n */\n private dragSnapToOrigin: boolean | \"x\" | \"y\"\n\n /**\n * The distance after which panning should start.\n *\n * @internal\n */\n private distanceThreshold: number\n\n /**\n * @internal\n */\n private contextWindow: PanSessionOptions[\"contextWindow\"] = window\n\n /**\n * Scroll positions of scrollable ancestors and window.\n * @internal\n */\n private scrollPositions: Map = new Map()\n\n /**\n * Cleanup function for scroll listeners.\n * @internal\n */\n private removeScrollListeners: (() => void) | null = null\n\n constructor(\n event: PointerEvent,\n handlers: Partial,\n {\n transformPagePoint,\n contextWindow = window,\n dragSnapToOrigin = false,\n distanceThreshold = 3,\n element,\n }: PanSessionOptions = {}\n ) {\n // If we have more than one touch, don't start detecting this gesture\n if (!isPrimaryPointer(event)) return\n\n this.dragSnapToOrigin = dragSnapToOrigin\n this.handlers = handlers\n this.transformPagePoint = transformPagePoint\n this.distanceThreshold = distanceThreshold\n this.contextWindow = contextWindow || window\n\n const info = extractEventInfo(event)\n const initialInfo = transformPoint(info, this.transformPagePoint)\n const { point } = initialInfo\n\n const { timestamp } = frameData\n\n this.history = [{ ...point, timestamp }]\n\n const { onSessionStart } = handlers\n onSessionStart &&\n onSessionStart(event, getPanInfo(initialInfo, this.history))\n\n // Listen in the capture phase so a descendant calling\n // stopPropagation() (e.g. in its own pointerup handler) can't\n // prevent the gesture from ending. See #2794.\n const eventOptions = { passive: true, capture: true }\n this.removeListeners = pipe(\n addPointerEvent(\n this.contextWindow,\n \"pointermove\",\n this.handlePointerMove,\n eventOptions\n ),\n addPointerEvent(\n this.contextWindow,\n \"pointerup\",\n this.handlePointerUp,\n eventOptions\n ),\n addPointerEvent(\n this.contextWindow,\n \"pointercancel\",\n this.handlePointerUp,\n eventOptions\n )\n )\n\n // Start scroll tracking if element provided\n if (element) {\n this.startScrollTracking(element)\n }\n }\n\n /**\n * Start tracking scroll on ancestors and window.\n */\n private startScrollTracking(element: HTMLElement): void {\n // Store initial scroll positions for scrollable ancestors\n let current = element.parentElement\n while (current) {\n const style = getComputedStyle(current)\n if (\n overflowStyles.has(style.overflowX) ||\n overflowStyles.has(style.overflowY)\n ) {\n this.scrollPositions.set(current, {\n x: current.scrollLeft,\n y: current.scrollTop,\n })\n }\n current = current.parentElement\n }\n\n // Track window scroll\n this.scrollPositions.set(window, {\n x: window.scrollX,\n y: window.scrollY,\n })\n\n // Capture listener catches element scroll events as they bubble\n window.addEventListener(\"scroll\", this.onElementScroll, {\n capture: true,\n })\n\n // Direct window scroll listener (window scroll doesn't bubble)\n window.addEventListener(\"scroll\", this.onWindowScroll)\n\n this.removeScrollListeners = () => {\n window.removeEventListener(\"scroll\", this.onElementScroll, {\n capture: true,\n })\n window.removeEventListener(\"scroll\", this.onWindowScroll)\n }\n }\n\n private onElementScroll = (event: Event): void => {\n this.handleScroll(event.target as Element)\n }\n\n private onWindowScroll = (): void => {\n this.handleScroll(window)\n }\n\n /**\n * Handle scroll compensation during drag.\n *\n * For element scroll: adjusts history origin since pageX/pageY doesn't change.\n * For window scroll: adjusts lastMoveEventInfo since pageX/pageY would change.\n */\n private handleScroll(target: Element | Window): void {\n const initial = this.scrollPositions.get(target)\n if (!initial) return\n\n const isWindow = target === window\n const current = isWindow\n ? { x: window.scrollX, y: window.scrollY }\n : {\n x: (target as Element).scrollLeft,\n y: (target as Element).scrollTop,\n }\n\n const delta = { x: current.x - initial.x, y: current.y - initial.y }\n if (delta.x === 0 && delta.y === 0) return\n\n if (isWindow) {\n // Window scroll: pageX/pageY changes, so update lastMoveEventInfo\n if (this.lastMoveEventInfo) {\n this.lastMoveEventInfo.point.x += delta.x\n this.lastMoveEventInfo.point.y += delta.y\n }\n } else {\n // Element scroll: pageX/pageY unchanged, so adjust history origin\n if (this.history.length > 0) {\n this.history[0].x -= delta.x\n this.history[0].y -= delta.y\n }\n }\n\n this.scrollPositions.set(target, current)\n frame.update(this.updatePoint, true)\n }\n\n private updatePoint = () => {\n if (!(this.lastMoveEvent && this.lastMoveEventInfo)) return\n\n // Re-transform raw point through current transformPagePoint so\n // animated parent transforms (e.g. rotation) are picked up each frame\n if (this.lastRawMoveEventInfo) {\n this.lastMoveEventInfo = transformPoint(\n this.lastRawMoveEventInfo,\n this.transformPagePoint\n )\n }\n\n const info = getPanInfo(this.lastMoveEventInfo, this.history)\n const isPanStarted = this.startEvent !== null\n\n // Only start panning if the offset is larger than 3 pixels. If we make it\n // any larger than this we'll want to reset the pointer history\n // on the first update to avoid visual snapping to the cursor.\n const isDistancePastThreshold =\n distance2D(info.offset, { x: 0, y: 0 }) >= this.distanceThreshold\n\n if (!isPanStarted && !isDistancePastThreshold) return\n\n const { point } = info\n const { timestamp } = frameData\n this.history.push({ ...point, timestamp })\n\n const { onStart, onMove } = this.handlers\n\n if (!isPanStarted) {\n onStart && onStart(this.lastMoveEvent, info)\n this.startEvent = this.lastMoveEvent\n }\n\n onMove && onMove(this.lastMoveEvent, info)\n }\n\n private handlePointerMove = (event: PointerEvent, info: EventInfo) => {\n this.lastMoveEvent = event\n this.lastRawMoveEventInfo = info\n this.lastMoveEventInfo = transformPoint(info, this.transformPagePoint)\n\n // Throttle mouse move event to once per frame\n frame.update(this.updatePoint, true)\n }\n\n private handlePointerUp = (event: PointerEvent, info: EventInfo) => {\n this.end()\n\n const { onEnd, onSessionEnd, resumeAnimation } = this.handlers\n\n // Resume animation if dragSnapToOrigin is set OR if no drag started (user just clicked)\n // This ensures constraint animations continue when interrupted by a click\n if (this.dragSnapToOrigin || !this.startEvent) {\n resumeAnimation && resumeAnimation()\n }\n if (!(this.lastMoveEvent && this.lastMoveEventInfo)) return\n\n const panInfo = getPanInfo(\n event.type === \"pointercancel\"\n ? this.lastMoveEventInfo\n : transformPoint(info, this.transformPagePoint),\n this.history\n )\n\n if (this.startEvent && onEnd) {\n onEnd(event, panInfo)\n }\n\n onSessionEnd && onSessionEnd(event, panInfo)\n }\n\n updateHandlers(handlers: Partial) {\n this.handlers = handlers\n }\n\n end() {\n this.removeListeners && this.removeListeners()\n this.removeScrollListeners && this.removeScrollListeners()\n this.scrollPositions.clear()\n cancelFrame(this.updatePoint)\n }\n}\n\nfunction transformPoint(\n info: EventInfo,\n transformPagePoint?: (point: Point) => Point\n) {\n return transformPagePoint ? { point: transformPagePoint(info.point) } : info\n}\n\nfunction subtractPoint(a: Point, b: Point): Point {\n return { x: a.x - b.x, y: a.y - b.y }\n}\n\nfunction getPanInfo({ point }: EventInfo, history: TimestampedPoint[]) {\n return {\n point,\n delta: subtractPoint(point, lastDevicePoint(history)),\n offset: subtractPoint(point, startDevicePoint(history)),\n velocity: getVelocity(history, 0.1),\n }\n}\n\nfunction startDevicePoint(history: TimestampedPoint[]): TimestampedPoint {\n return history[0]\n}\n\nfunction lastDevicePoint(history: TimestampedPoint[]): TimestampedPoint {\n return history[history.length - 1]\n}\n\nfunction getVelocity(history: TimestampedPoint[], timeDelta: number): Point {\n if (history.length < 2) {\n return { x: 0, y: 0 }\n }\n\n let i = history.length - 1\n let timestampedPoint: TimestampedPoint | null = null\n const lastPoint = lastDevicePoint(history)\n while (i >= 0) {\n timestampedPoint = history[i]\n if (\n lastPoint.timestamp - timestampedPoint.timestamp >\n secondsToMilliseconds(timeDelta)\n ) {\n break\n }\n i--\n }\n\n if (!timestampedPoint) {\n return { x: 0, y: 0 }\n }\n\n /**\n * If the selected point is the pointer-down origin (history[0]),\n * there are better movement points available, and the time gap\n * is suspiciously large (>2x timeDelta), use the next point instead.\n * This prevents stale pointer-down points from diluting velocity\n * in hold-then-flick gestures.\n */\n if (\n timestampedPoint === history[0] &&\n history.length > 2 &&\n lastPoint.timestamp - timestampedPoint.timestamp >\n secondsToMilliseconds(timeDelta) * 2\n ) {\n timestampedPoint = history[1]\n }\n\n const time = millisecondsToSeconds(\n lastPoint.timestamp - timestampedPoint.timestamp\n )\n if (time === 0) {\n return { x: 0, y: 0 }\n }\n\n const currentVelocity = {\n x: (lastPoint.x - timestampedPoint.x) / time,\n y: (lastPoint.y - timestampedPoint.y) / time,\n }\n\n if (currentVelocity.x === Infinity) {\n currentVelocity.x = 0\n }\n if (currentVelocity.y === Infinity) {\n currentVelocity.y = 0\n }\n\n return currentVelocity\n}\n"],"names":[],"mappings":";;;;;;AAuCA,MAAM,cAAc,iBAAiB,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;AAEhE;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CAAC,MAAM,GAAG,CAAC;AAClB,QAAA,SAAS,CAAC,SAAS,GAAG,gBAAgB,CAAC,SAAS;AAC5C,YAAA,qBAAqB,CAAC,SAAS,CAAC,GAAG,CAAC,EAC1C;AACE,QAAA,gBAAgB,GAAG,OAAO,CAAC,CAAC,CAAC;IACjC;AAEA,IAAA,MAAM,IAAI,GAAG,qBAAqB,CAC9B,SAAS,CAAC,SAAS,GAAG,gBAAgB,CAAC,SAAS,CACnD;AACD,IAAA,IAAI,IAAI,KAAK,CAAC,EAAE;QACZ,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;IACzB;AAEA,IAAA,MAAM,eAAe,GAAG;QACpB,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,GAAG,gBAAgB,CAAC,CAAC,IAAI,IAAI;QAC5C,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,GAAG,gBAAgB,CAAC,CAAC,IAAI,IAAI;KAC/C;AAED,IAAA,IAAI,eAAe,CAAC,CAAC,KAAK,QAAQ,EAAE;AAChC,QAAA,eAAe,CAAC,CAAC,GAAG,CAAC;IACzB;AACA,IAAA,IAAI,eAAe,CAAC,CAAC,KAAK,QAAQ,EAAE;AAChC,QAAA,eAAe,CAAC,CAAC,GAAG,CAAC;IACzB;AAEA,IAAA,OAAO,eAAe;AAC1B;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/gestures/pan/index.mjs b/node_modules/framer-motion/dist/es/gestures/pan/index.mjs deleted file mode 100644 index e0b1c17..0000000 --- a/node_modules/framer-motion/dist/es/gestures/pan/index.mjs +++ /dev/null @@ -1,50 +0,0 @@ -import { Feature, frame } from 'motion-dom'; -import { noop } from 'motion-utils'; -import { addPointerEvent } from '../../events/add-pointer-event.mjs'; -import { getContextWindow } from '../../utils/get-context-window.mjs'; -import { PanSession } from './PanSession.mjs'; - -const asyncHandler = (handler) => (event, info) => { - if (handler) { - frame.update(() => handler(event, info), false, true); - } -}; -class PanGesture extends Feature { - constructor() { - super(...arguments); - this.removePointerDownListener = noop; - } - onPointerDown(pointerDownEvent) { - this.session = new PanSession(pointerDownEvent, this.createPanHandlers(), { - transformPagePoint: this.node.getTransformPagePoint(), - contextWindow: getContextWindow(this.node), - }); - } - createPanHandlers() { - const { onPanSessionStart, onPanStart, onPan, onPanEnd } = this.node.getProps(); - return { - onSessionStart: asyncHandler(onPanSessionStart), - onStart: asyncHandler(onPanStart), - onMove: asyncHandler(onPan), - onEnd: (event, info) => { - delete this.session; - if (onPanEnd) { - frame.postRender(() => onPanEnd(event, info)); - } - }, - }; - } - mount() { - this.removePointerDownListener = addPointerEvent(this.node.current, "pointerdown", (event) => this.onPointerDown(event)); - } - update() { - this.session && this.session.updateHandlers(this.createPanHandlers()); - } - unmount() { - this.removePointerDownListener(); - this.session && this.session.end(); - } -} - -export { PanGesture }; -//# sourceMappingURL=index.mjs.map diff --git a/node_modules/framer-motion/dist/es/gestures/pan/index.mjs.map b/node_modules/framer-motion/dist/es/gestures/pan/index.mjs.map deleted file mode 100644 index cd1cdc0..0000000 --- a/node_modules/framer-motion/dist/es/gestures/pan/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs","sources":["../../../../src/gestures/pan/index.ts"],"sourcesContent":["import { Feature, frame, type PanInfo } from \"motion-dom\"\nimport { noop } from \"motion-utils\"\nimport { addPointerEvent } from \"../../events/add-pointer-event\"\nimport { getContextWindow } from \"../../utils/get-context-window\"\nimport { PanSession } from \"./PanSession\"\n\ntype PanEventHandler = (event: PointerEvent, info: PanInfo) => void\nconst asyncHandler =\n (handler?: PanEventHandler) => (event: PointerEvent, info: PanInfo) => {\n if (handler) {\n frame.update(() => handler(event, info), false, true)\n }\n }\n\nexport class PanGesture extends Feature {\n private session?: PanSession\n\n private removePointerDownListener: Function = noop\n\n onPointerDown(pointerDownEvent: PointerEvent) {\n this.session = new PanSession(\n pointerDownEvent,\n this.createPanHandlers(),\n {\n transformPagePoint: this.node.getTransformPagePoint(),\n contextWindow: getContextWindow(this.node),\n }\n )\n }\n\n createPanHandlers() {\n const { onPanSessionStart, onPanStart, onPan, onPanEnd } =\n this.node.getProps()\n\n return {\n onSessionStart: asyncHandler(onPanSessionStart),\n onStart: asyncHandler(onPanStart),\n onMove: asyncHandler(onPan),\n onEnd: (event: PointerEvent, info: PanInfo) => {\n delete this.session\n if (onPanEnd) {\n frame.postRender(() => onPanEnd(event, info))\n }\n },\n }\n }\n\n mount() {\n this.removePointerDownListener = addPointerEvent(\n this.node.current!,\n \"pointerdown\",\n (event: PointerEvent) => this.onPointerDown(event)\n )\n }\n\n update() {\n this.session && this.session.updateHandlers(this.createPanHandlers())\n }\n\n unmount() {\n this.removePointerDownListener()\n this.session && this.session.end()\n }\n}\n"],"names":[],"mappings":";;;;;;AAOA,MAAM,YAAY,GACd,CAAC,OAAyB,KAAK,CAAC,KAAmB,EAAE,IAAa,KAAI;IAClE,IAAI,OAAO,EAAE;AACT,QAAA,KAAK,CAAC,MAAM,CAAC,MAAM,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC;IACzD;AACJ,CAAC;AAEC,MAAO,UAAW,SAAQ,OAAgB,CAAA;AAAhD,IAAA,WAAA,GAAA;;QAGY,IAAA,CAAA,yBAAyB,GAAa,IAAI;IA8CtD;AA5CI,IAAA,aAAa,CAAC,gBAA8B,EAAA;AACxC,QAAA,IAAI,CAAC,OAAO,GAAG,IAAI,UAAU,CACzB,gBAAgB,EAChB,IAAI,CAAC,iBAAiB,EAAE,EACxB;AACI,YAAA,kBAAkB,EAAE,IAAI,CAAC,IAAI,CAAC,qBAAqB,EAAE;AACrD,YAAA,aAAa,EAAE,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC;AAC7C,SAAA,CACJ;IACL;IAEA,iBAAiB,GAAA;AACb,QAAA,MAAM,EAAE,iBAAiB,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,GACpD,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;QAExB,OAAO;AACH,YAAA,cAAc,EAAE,YAAY,CAAC,iBAAiB,CAAC;AAC/C,YAAA,OAAO,EAAE,YAAY,CAAC,UAAU,CAAC;AACjC,YAAA,MAAM,EAAE,YAAY,CAAC,KAAK,CAAC;AAC3B,YAAA,KAAK,EAAE,CAAC,KAAmB,EAAE,IAAa,KAAI;gBAC1C,OAAO,IAAI,CAAC,OAAO;gBACnB,IAAI,QAAQ,EAAE;AACV,oBAAA,KAAK,CAAC,UAAU,CAAC,MAAM,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;gBACjD;YACJ,CAAC;SACJ;IACL;IAEA,KAAK,GAAA;QACD,IAAI,CAAC,yBAAyB,GAAG,eAAe,CAC5C,IAAI,CAAC,IAAI,CAAC,OAAQ,EAClB,aAAa,EACb,CAAC,KAAmB,KAAK,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CACrD;IACL;IAEA,MAAM,GAAA;AACF,QAAA,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,iBAAiB,EAAE,CAAC;IACzE;IAEA,OAAO,GAAA;QACH,IAAI,CAAC,yBAAyB,EAAE;QAChC,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;IACtC;AACH;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/gestures/press.mjs b/node_modules/framer-motion/dist/es/gestures/press.mjs deleted file mode 100644 index 45b99a2..0000000 --- a/node_modules/framer-motion/dist/es/gestures/press.mjs +++ /dev/null @@ -1,36 +0,0 @@ -import { Feature, press, frame } from 'motion-dom'; -import { extractEventInfo } from '../events/event-info.mjs'; - -function handlePressEvent(node, event, lifecycle) { - const { props } = node; - if (node.current instanceof HTMLButtonElement && node.current.disabled) { - return; - } - if (node.animationState && props.whileTap) { - node.animationState.setActive("whileTap", lifecycle === "Start"); - } - const eventName = ("onTap" + (lifecycle === "End" ? "" : lifecycle)); - const callback = props[eventName]; - if (callback) { - frame.postRender(() => callback(event, extractEventInfo(event))); - } -} -class PressGesture extends Feature { - mount() { - const { current } = this.node; - if (!current) - return; - const { globalTapTarget, propagate } = this.node.props; - this.unmount = press(current, (_element, startEvent) => { - handlePressEvent(this.node, startEvent, "Start"); - return (endEvent, { success }) => handlePressEvent(this.node, endEvent, success ? "End" : "Cancel"); - }, { - useGlobalTarget: globalTapTarget, - stopPropagation: propagate?.tap === false, - }); - } - unmount() { } -} - -export { PressGesture }; -//# sourceMappingURL=press.mjs.map diff --git a/node_modules/framer-motion/dist/es/gestures/press.mjs.map b/node_modules/framer-motion/dist/es/gestures/press.mjs.map deleted file mode 100644 index 9719e26..0000000 --- a/node_modules/framer-motion/dist/es/gestures/press.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"press.mjs","sources":["../../../src/gestures/press.ts"],"sourcesContent":["import { Feature, frame, press, type VisualElement } from \"motion-dom\"\nimport { extractEventInfo } from \"../events/event-info\"\n\nfunction handlePressEvent(\n node: VisualElement,\n event: PointerEvent,\n lifecycle: \"Start\" | \"End\" | \"Cancel\"\n) {\n const { props } = node\n\n if (node.current instanceof HTMLButtonElement && node.current.disabled) {\n return\n }\n\n if (node.animationState && props.whileTap) {\n node.animationState.setActive(\"whileTap\", lifecycle === \"Start\")\n }\n\n const eventName = (\"onTap\" + (lifecycle === \"End\" ? \"\" : lifecycle)) as\n | \"onTapStart\"\n | \"onTap\"\n | \"onTapCancel\"\n\n const callback = props[eventName]\n if (callback) {\n frame.postRender(() => callback(event, extractEventInfo(event)))\n }\n}\n\nexport class PressGesture extends Feature {\n mount() {\n const { current } = this.node\n if (!current) return\n\n const { globalTapTarget, propagate } = this.node.props\n\n this.unmount = press(\n current,\n (_element, startEvent) => {\n handlePressEvent(this.node, startEvent, \"Start\")\n\n return (endEvent, { success }) =>\n handlePressEvent(\n this.node,\n endEvent,\n success ? \"End\" : \"Cancel\"\n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I,CAAC,IAAI,EACT,QAAQ,EACR,OAAO,GAAG,KAAK,GAAG,QAAQ,CAC7B;AACT,QAAA,CAAC,EACD;AACI,YAAA,eAAe,EAAE,eAAe;AAChC,YAAA,eAAe,EAAE,SAAS,EAAE,GAAG,KAAK,KAAK;AAC5C,SAAA,CACJ;IACL;AAEA,IAAA,OAAO,KAAI;AACd;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/index.mjs b/node_modules/framer-motion/dist/es/index.mjs deleted file mode 100644 index 94ee439..0000000 --- a/node_modules/framer-motion/dist/es/index.mjs +++ /dev/null @@ -1,79 +0,0 @@ -export { AnimatePresence } from './components/AnimatePresence/index.mjs'; -export { PopChild } from './components/AnimatePresence/PopChild.mjs'; -export { PresenceChild } from './components/AnimatePresence/PresenceChild.mjs'; -export { LayoutGroup } from './components/LayoutGroup/index.mjs'; -export { LazyMotion } from './components/LazyMotion/index.mjs'; -export { MotionConfig } from './components/MotionConfig/index.mjs'; -export { m } from './render/components/m/proxy.mjs'; -export { motion } from './render/components/motion/proxy.mjs'; -export { addPointerEvent } from './events/add-pointer-event.mjs'; -export { addPointerInfo } from './events/event-info.mjs'; -export { animations } from './motion/features/animations.mjs'; -export { makeUseVisualState } from './motion/utils/use-visual-state.mjs'; -export * from 'motion-dom'; -export { VisualElement, addScaleCorrector, animateVisualElement, arc, buildTransform, calcLength, createBox, delay, optimizedAppearDataAttribute, resolveMotionValue, visualElementStore } from 'motion-dom'; -export { filterProps } from './render/dom/utils/filter-props.mjs'; -export { isBrowser } from './utils/is-browser.mjs'; -export { useComposedRefs } from './utils/use-composed-ref.mjs'; -export { useForceUpdate } from './utils/use-force-update.mjs'; -export { useIsomorphicLayoutEffect } from './utils/use-isomorphic-effect.mjs'; -export { useUnmountEffect } from './utils/use-unmount-effect.mjs'; -export { domAnimation } from './render/dom/features-animation.mjs'; -export { domMax } from './render/dom/features-max.mjs'; -export { domMin } from './render/dom/features-min.mjs'; -export { useMotionValueEvent } from './utils/use-motion-value-event.mjs'; -export { useElementScroll } from './value/scroll/use-element-scroll.mjs'; -export { useViewportScroll } from './value/scroll/use-viewport-scroll.mjs'; -export { useMotionTemplate } from './value/use-motion-template.mjs'; -export { useMotionValue } from './value/use-motion-value.mjs'; -export { useScroll } from './value/use-scroll.mjs'; -export { useFollowValue } from './value/use-follow-value.mjs'; -export { useSpring } from './value/use-spring.mjs'; -export { useTime } from './value/use-time.mjs'; -export { useTransform } from './value/use-transform.mjs'; -export { useVelocity } from './value/use-velocity.mjs'; -export { useWillChange } from './value/use-will-change/index.mjs'; -export { WillChangeMotionValue } from './value/use-will-change/WillChangeMotionValue.mjs'; -export { useReducedMotion } from './utils/reduced-motion/use-reduced-motion.mjs'; -export { useReducedMotionConfig } from './utils/reduced-motion/use-reduced-motion-config.mjs'; -export * from 'motion-utils'; -export { MotionGlobalConfig } from 'motion-utils'; -export { animationControls } from './animation/hooks/animation-controls.mjs'; -export { useAnimate } from './animation/hooks/use-animate.mjs'; -export { useAnimateMini } from './animation/hooks/use-animate-style.mjs'; -export { useAnimation, useAnimationControls } from './animation/hooks/use-animation.mjs'; -export { useIsPresent, usePresence } from './components/AnimatePresence/use-presence.mjs'; -export { usePresenceData } from './components/AnimatePresence/use-presence-data.mjs'; -export { useDomEvent } from './events/use-dom-event.mjs'; -export { DragControls, useDragControls } from './gestures/drag/use-drag-controls.mjs'; -export { isMotionComponent } from './motion/utils/is-motion-component.mjs'; -export { unwrapMotionComponent } from './motion/utils/unwrap-motion-component.mjs'; -export { isValidMotionProp } from './motion/utils/valid-prop.mjs'; -export { useInstantLayoutTransition } from './projection/use-instant-layout-transition.mjs'; -export { useResetProjection } from './projection/use-reset-projection.mjs'; -export { useAnimationFrame } from './utils/use-animation-frame.mjs'; -export { useCycle } from './utils/use-cycle.mjs'; -export { useInView } from './utils/use-in-view.mjs'; -export { disableInstantTransitions, useInstantTransition } from './utils/use-instant-transition.mjs'; -export { usePageInView } from './utils/use-page-in-view.mjs'; -export { transformViewBoxPoint } from './utils/transform-viewbox-point.mjs'; -export { correctParentTransform } from './utils/transform-rotated-parent.mjs'; -export { startOptimizedAppearAnimation } from './animation/optimized-appear/start.mjs'; -export { LayoutGroupContext } from './context/LayoutGroupContext.mjs'; -export { MotionConfigContext } from './context/MotionConfigContext.mjs'; -export { MotionContext } from './context/MotionContext/index.mjs'; -export { PresenceContext } from './context/PresenceContext.mjs'; -export { SwitchLayoutGroupContext } from './context/SwitchLayoutGroupContext.mjs'; -export { useAnimatedState as useDeprecatedAnimatedState } from './animation/hooks/use-animated-state.mjs'; -export { AnimateSharedLayout } from './components/AnimateSharedLayout.mjs'; -export { DeprecatedLayoutGroupContext } from './context/DeprecatedLayoutGroupContext.mjs'; -export { useInvertedScale as useDeprecatedInvertedScale } from './value/use-inverted-scale.mjs'; -import * as namespace from './components/Reorder/namespace.mjs'; -export { namespace as Reorder }; -export { animate, createScopedAnimate } from './animation/animate/index.mjs'; -export { animateMini } from './animation/animators/waapi/animate-style.mjs'; -export { distance, distance2D } from './utils/distance.mjs'; -export { inView } from './render/dom/viewport/index.mjs'; -export { scroll } from './render/dom/scroll/index.mjs'; -export { scrollInfo } from './render/dom/scroll/track.mjs'; -//# sourceMappingURL=index.mjs.map diff --git a/node_modules/framer-motion/dist/es/index.mjs.map b/node_modules/framer-motion/dist/es/index.mjs.map deleted file mode 100644 index b28b640..0000000 --- a/node_modules/framer-motion/dist/es/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/m.mjs b/node_modules/framer-motion/dist/es/m.mjs deleted file mode 100644 index 2539355..0000000 --- a/node_modules/framer-motion/dist/es/m.mjs +++ /dev/null @@ -1,3 +0,0 @@ -export { MotionA as a, MotionAbbr as abbr, MotionAddress as address, MotionAnimate as animate, MotionArea as area, MotionArticle as article, MotionAside as aside, MotionAudio as audio, MotionB as b, MotionBase as base, MotionBdi as bdi, MotionBdo as bdo, MotionBig as big, MotionBlockquote as blockquote, MotionBody as body, MotionButton as button, MotionCanvas as canvas, MotionCaption as caption, MotionCircle as circle, MotionCite as cite, MotionClipPath as clipPath, MotionCode as code, MotionCol as col, MotionColgroup as colgroup, MotionData as data, MotionDatalist as datalist, MotionDd as dd, MotionDefs as defs, MotionDel as del, MotionDesc as desc, MotionDetails as details, MotionDfn as dfn, MotionDialog as dialog, MotionDiv as div, MotionDl as dl, MotionDt as dt, MotionEllipse as ellipse, MotionEm as em, MotionEmbed as embed, MotionFeBlend as feBlend, MotionFeColorMatrix as feColorMatrix, MotionFeComponentTransfer as feComponentTransfer, MotionFeComposite as feComposite, MotionFeConvolveMatrix as feConvolveMatrix, MotionFeDiffuseLighting as feDiffuseLighting, MotionFeDisplacementMap as feDisplacementMap, MotionFeDistantLight as feDistantLight, MotionFeDropShadow as feDropShadow, MotionFeFlood as feFlood, MotionFeFuncA as feFuncA, MotionFeFuncB as feFuncB, MotionFeFuncG as feFuncG, MotionFeFuncR as feFuncR, MotionFeGaussianBlur as feGaussianBlur, MotionFeImage as feImage, MotionFeMerge as feMerge, MotionFeMergeNode as feMergeNode, MotionFeMorphology as feMorphology, MotionFeOffset as feOffset, MotionFePointLight as fePointLight, MotionFeSpecularLighting as feSpecularLighting, MotionFeSpotLight as feSpotLight, MotionFeTile as feTile, MotionFeTurbulence as feTurbulence, MotionFieldset as fieldset, MotionFigcaption as figcaption, MotionFigure as figure, MotionFilter as filter, MotionFooter as footer, MotionForeignObject as foreignObject, MotionForm as form, MotionG as g, MotionH1 as h1, MotionH2 as h2, MotionH3 as h3, MotionH4 as h4, MotionH5 as h5, MotionH6 as h6, MotionHead as head, MotionHeader as header, MotionHgroup as hgroup, MotionHr as hr, MotionHtml as html, MotionI as i, MotionIframe as iframe, MotionImage as image, MotionImg as img, MotionInput as input, MotionIns as ins, MotionKbd as kbd, MotionKeygen as keygen, MotionLabel as label, MotionLegend as legend, MotionLi as li, MotionLine as line, MotionLinearGradient as linearGradient, MotionLink as link, MotionMain as main, MotionMap as map, MotionMark as mark, MotionMarker as marker, MotionMask as mask, MotionMenu as menu, MotionMenuitem as menuitem, MotionMetadata as metadata, MotionMeter as meter, MotionNav as nav, MotionObject as object, MotionOl as ol, MotionOptgroup as optgroup, MotionOption as option, MotionOutput as output, MotionP as p, MotionParam as param, MotionPath as path, MotionPattern as pattern, MotionPicture as picture, MotionPolygon as polygon, MotionPolyline as polyline, MotionPre as pre, MotionProgress as progress, MotionQ as q, MotionRadialGradient as radialGradient, MotionRect as rect, MotionRp as rp, MotionRt as rt, MotionRuby as ruby, MotionS as s, MotionSamp as samp, MotionScript as script, MotionSection as section, MotionSelect as select, MotionSmall as small, MotionSource as source, MotionSpan as span, MotionStop as stop, MotionStrong as strong, MotionStyle as style, MotionSub as sub, MotionSummary as summary, MotionSup as sup, MotionSvg as svg, MotionSymbol as symbol, MotionTable as table, MotionTbody as tbody, MotionTd as td, MotionText as text, MotionTextPath as textPath, MotionTextarea as textarea, MotionTfoot as tfoot, MotionTh as th, MotionThead as thead, MotionTime as time, MotionTitle as title, MotionTr as tr, MotionTrack as track, MotionTspan as tspan, MotionU as u, MotionUl as ul, MotionUse as use, MotionVideo as video, MotionView as view, MotionWbr as wbr, MotionWebview as webview } from './render/components/m/elements.mjs'; -export { createMinimalMotionComponent as create } from './render/components/m/create.mjs'; -//# sourceMappingURL=m.mjs.map diff --git a/node_modules/framer-motion/dist/es/m.mjs.map b/node_modules/framer-motion/dist/es/m.mjs.map deleted file mode 100644 index af0ce5d..0000000 --- a/node_modules/framer-motion/dist/es/m.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"m.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/mini.mjs b/node_modules/framer-motion/dist/es/mini.mjs deleted file mode 100644 index b620a1f..0000000 --- a/node_modules/framer-motion/dist/es/mini.mjs +++ /dev/null @@ -1,2 +0,0 @@ -export { useAnimateMini as useAnimate } from './animation/hooks/use-animate-style.mjs'; -//# sourceMappingURL=mini.mjs.map diff --git a/node_modules/framer-motion/dist/es/mini.mjs.map b/node_modules/framer-motion/dist/es/mini.mjs.map deleted file mode 100644 index d146aa0..0000000 --- a/node_modules/framer-motion/dist/es/mini.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mini.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/motion/features/animation/exit.mjs b/node_modules/framer-motion/dist/es/motion/features/animation/exit.mjs deleted file mode 100644 index 2519f77..0000000 --- a/node_modules/framer-motion/dist/es/motion/features/animation/exit.mjs +++ /dev/null @@ -1,70 +0,0 @@ -import { Feature, resolveVariant } from 'motion-dom'; - -let id = 0; -class ExitAnimationFeature extends Feature { - constructor() { - super(...arguments); - this.id = id++; - this.isExitComplete = false; - } - update() { - if (!this.node.presenceContext) - return; - const { isPresent, onExitComplete } = this.node.presenceContext; - const { isPresent: prevIsPresent } = this.node.prevPresenceContext || {}; - if (!this.node.animationState || isPresent === prevIsPresent) { - return; - } - if (isPresent && prevIsPresent === false) { - /** - * When re-entering, if the exit animation already completed - * (element is at rest), reset to initial values so the enter - * animation replays from the correct position. - */ - if (this.isExitComplete) { - const { initial, custom } = this.node.getProps(); - if (typeof initial === "string" || - (typeof initial === "object" && - initial !== null && - !Array.isArray(initial))) { - const resolved = resolveVariant(this.node, initial, custom); - if (resolved) { - const { transition, transitionEnd, ...target } = resolved; - for (const key in target) { - this.node - .getValue(key) - ?.jump(target[key]); - } - } - } - this.node.animationState.reset(); - this.node.animationState.animateChanges(); - } - else { - this.node.animationState.setActive("exit", false); - } - this.isExitComplete = false; - return; - } - const exitAnimation = this.node.animationState.setActive("exit", !isPresent); - if (onExitComplete && !isPresent) { - exitAnimation.then(() => { - this.isExitComplete = true; - onExitComplete(this.id); - }); - } - } - mount() { - const { register, onExitComplete } = this.node.presenceContext || {}; - if (onExitComplete) { - onExitComplete(this.id); - } - if (register) { - this.unmount = register(this.id); - } - } - unmount() { } -} - -export { ExitAnimationFeature }; -//# sourceMappingURL=exit.mjs.map diff --git a/node_modules/framer-motion/dist/es/motion/features/animation/exit.mjs.map b/node_modules/framer-motion/dist/es/motion/features/animation/exit.mjs.map deleted file mode 100644 index 7894c0e..0000000 --- a/node_modules/framer-motion/dist/es/motion/features/animation/exit.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"exit.mjs","sources":["../../../../../src/motion/features/animation/exit.ts"],"sourcesContent":["import { Feature, resolveVariant } from \"motion-dom\"\n\nlet id = 0\n\nexport class ExitAnimationFeature extends Feature {\n private id: number = id++\n private isExitComplete = false\n\n update() {\n if (!this.node.presenceContext) return\n\n const { isPresent, onExitComplete } = this.node.presenceContext\n const { isPresent: prevIsPresent } = this.node.prevPresenceContext || {}\n\n if (!this.node.animationState || isPresent === prevIsPresent) {\n return\n }\n\n if (isPresent && prevIsPresent === false) {\n /**\n * When re-entering, if the exit animation already completed\n * (element is at rest), reset to initial values so the enter\n * animation replays from the correct position.\n */\n if (this.isExitComplete) {\n const { initial, custom } = this.node.getProps()\n\n if (\n typeof initial === \"string\" ||\n (typeof initial === \"object\" &&\n initial !== null &&\n !Array.isArray(initial))\n ) {\n const resolved = resolveVariant(\n this.node,\n initial,\n custom\n )\n if (resolved) {\n const { transition, transitionEnd, ...target } =\n resolved\n for (const key in target) {\n this.node\n .getValue(key)\n ?.jump(\n target[\n key as keyof typeof target\n ] as any\n )\n }\n }\n }\n\n this.node.animationState.reset()\n this.node.animationState.animateChanges()\n } else {\n this.node.animationState.setActive(\"exit\", false)\n }\n\n this.isExitComplete = false\n return\n }\n\n const exitAnimation = this.node.animationState.setActive(\n \"exit\",\n !isPresent\n )\n\n if (onExitComplete && !isPresent) {\n exitAnimation.then(() => {\n this.isExitComplete = true\n onExitComplete(this.id)\n })\n }\n }\n\n mount() {\n const { register, onExitComplete } = this.node.presenceContext || {}\n\n if (onExitComplete) {\n onExitComplete(this.id)\n }\n\n if (register) {\n this.unmount = register(this.id)\n }\n }\n\n unmount() {}\n}\n"],"names":[],"mappings":";;AAEA,IAAI,EAAE,GAAG,CAAC;AAEJ,MAAO,oBAAqB,SAAQ,OAAgB,CAAA;AAA1D,IAAA,WAAA,GAAA;;QACY,IAAA,CAAA,EAAE,GAAW,EAAE,EAAE;QACjB,IAAA,CAAA,cAAc,GAAG,KAAK;IAmFlC;IAjFI,MAAM,GAAA;AACF,QAAA,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,eAAe;YAAE;QAEhC,MAAM,EAAE,SAAS,EAAE,cAAc,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,eAAe;AAC/D,QAAA,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,mBAAmB,IAAI,EAAE;QAExE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,IAAI,SAAS,KAAK,aAAa,EAAE;YAC1D;QACJ;AAEA,QAAA,IAAI,SAAS,IAAI,aAAa,KAAK,KAAK,EAAE;AACtC;;;;AAIG;AACH,YAAA,IAAI,IAAI,CAAC,cAAc,EAAE;AACrB,gBAAA,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;gBAEhD,IACI,OAAO,OAAO,KAAK,QAAQ;qBAC1B,OAAO,OAAO,KAAK,QAAQ;AACxB,wBAAA,OAAO,KAAK,IAAI;wBAChB,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,EAC9B;AACE,oBAAA,MAAM,QAAQ,GAAG,cAAc,CAC3B,IAAI,CAAC,IAAI,EACT,OAAO,EACP,MAAM,CACT;oBACD,IAAI,QAAQ,EAAE;wBACV,MAAM,EAAE,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/dist/es/motion/features/animation/index.mjs deleted file mode 100644 index be9a9ec..0000000 --- a/node_modules/framer-motion/dist/es/motion/features/animation/index.mjs +++ /dev/null @@ -1,39 +0,0 @@ -import { Feature, createAnimationState, isAnimationControls } from 'motion-dom'; - -class AnimationFeature extends Feature { - /** - * We dynamically generate the AnimationState manager as it contains a reference - * to the underlying animation library. We only want to load that if we load this, - * so people can optionally code split it out using the `m` component. - */ - constructor(node) { - super(node); - node.animationState || (node.animationState = createAnimationState(node)); - } - updateAnimationControlsSubscription() { - const { animate } = this.node.getProps(); - if (isAnimationControls(animate)) { - this.unmountControls = animate.subscribe(this.node); - } - } - /** - * Subscribe any provided AnimationControls to the component's VisualElement - */ - mount() { - this.updateAnimationControlsSubscription(); - } - update() { - const { animate } = this.node.getProps(); - const { animate: prevAnimate } = this.node.prevProps || {}; - if (animate !== prevAnimate) { - this.updateAnimationControlsSubscription(); - } - } - unmount() { - this.node.animationState.reset(); - this.unmountControls?.(); - } -} - -export { AnimationFeature }; -//# sourceMappingURL=index.mjs.map diff --git a/node_modules/framer-motion/dist/es/motion/features/animation/index.mjs.map b/node_modules/framer-motion/dist/es/motion/features/animation/index.mjs.map deleted file mode 100644 index e4623fc..0000000 --- a/node_modules/framer-motion/dist/es/motion/features/animation/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs","sources":["../../../../../src/motion/features/animation/index.ts"],"sourcesContent":["import {\n createAnimationState,\n Feature,\n isAnimationControls,\n type VisualElement,\n} from \"motion-dom\"\n\nexport class AnimationFeature extends Feature {\n unmountControls?: () => void\n\n /**\n * We dynamically generate the AnimationState manager as it contains a reference\n * to the underlying animation library. We only want to load that if we load this,\n * so people can optionally code split it out using the `m` component.\n */\n constructor(node: VisualElement) {\n super(node)\n node.animationState ||= createAnimationState(node)\n }\n\n updateAnimationControlsSubscription() {\n const { animate } = this.node.getProps()\n if (isAnimationControls(animate)) {\n this.unmountControls = animate.subscribe(this.node)\n }\n }\n\n /**\n * Subscribe any provided AnimationControls to the component's VisualElement\n */\n mount() {\n this.updateAnimationControlsSubscription()\n }\n\n update() {\n const { animate } = this.node.getProps()\n const { animate: prevAnimate } = this.node.prevProps || {}\n if (animate !== prevAnimate) {\n this.updateAnimationControlsSubscription()\n }\n }\n\n unmount() {\n this.node.animationState!.reset()\n this.unmountControls?.()\n }\n}\n"],"names":[],"mappings":";;AAOM,MAAO,gBAAiB,SAAQ,OAAgB,CAAA;AAGlD;;;;AAIG;AACH,IAAA,WAAA,CAAY,IAAmB,EAAA;QAC3B,KAAK,CAAC,IAAI,CAAC;QACX,IAAI,CAAC,cAAc,KAAnB,IAAI,CAAC,cAAc,GAAK,oBAAoB,CAAC,IAAI,CAAC,CAAA;IACtD;IAEA,mCAAmC,GAAA;QAC/B,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;AACxC,QAAA,IAAI,mBAAmB,CAAC,OAAO,CAAC,EAAE;YAC9B,IAAI,CAAC,eAAe,GAAG,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC;QACvD;IACJ;AAEA;;AAEG;IACH,KAAK,GAAA;QACD,IAAI,CAAC,mCAAmC,EAAE;IAC9C;IAEA,MAAM,GAAA;QACF,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;AACxC,QAAA,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,IAAI,EAAE;AAC1D,QAAA,IAAI,OAAO,KAAK,WAAW,EAAE;YACzB,IAAI,CAAC,mCAAmC,EAAE;QAC9C;IACJ;IAEA,OAAO,GAAA;AACH,QAAA,IAAI,CAAC,IAAI,CAAC,cAAe,CAAC,KAAK,EAAE;AACjC,QAAA,IAAI,CAAC,eAAe,IAAI;IAC5B;AACH;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/motion/features/animations.mjs b/node_modules/framer-motion/dist/es/motion/features/animations.mjs deleted file mode 100644 index 0746a48..0000000 --- a/node_modules/framer-motion/dist/es/motion/features/animations.mjs +++ /dev/null @@ -1,14 +0,0 @@ -import { AnimationFeature } from './animation/index.mjs'; -import { ExitAnimationFeature } from './animation/exit.mjs'; - -const animations = { - animation: { - Feature: AnimationFeature, - }, - exit: { - Feature: ExitAnimationFeature, - }, -}; - -export { animations }; -//# sourceMappingURL=animations.mjs.map diff --git a/node_modules/framer-motion/dist/es/motion/features/animations.mjs.map b/node_modules/framer-motion/dist/es/motion/features/animations.mjs.map deleted file mode 100644 index 8476c44..0000000 --- a/node_modules/framer-motion/dist/es/motion/features/animations.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"animations.mjs","sources":["../../../../src/motion/features/animations.ts"],"sourcesContent":["import { AnimationFeature } from \"./animation\"\nimport { ExitAnimationFeature } from \"./animation/exit\"\nimport { FeaturePackages } from \"./types\"\n\nexport const animations: FeaturePackages = {\n animation: {\n Feature: AnimationFeature,\n },\n exit: {\n Feature: ExitAnimationFeature,\n },\n}\n"],"names":[],"mappings":";;;AAIO,MAAM,UAAU,GAAoB;AACvC,IAAA,SAAS,EAAE;AACP,QAAA,OAAO,EAAE,gBAAgB;AAC5B,KAAA;AACD,IAAA,IAAI,EAAE;AACF,QAAA,OAAO,EAAE,oBAAoB;AAChC,KAAA;;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/motion/features/definitions.mjs b/node_modules/framer-motion/dist/es/motion/features/definitions.mjs deleted file mode 100644 index e3293b6..0000000 --- a/node_modules/framer-motion/dist/es/motion/features/definitions.mjs +++ /dev/null @@ -1,49 +0,0 @@ -import { getFeatureDefinitions, setFeatureDefinitions } from 'motion-dom'; - -const featureProps = { - animation: [ - "animate", - "variants", - "whileHover", - "whileTap", - "exit", - "whileInView", - "whileFocus", - "whileDrag", - ], - exit: ["exit"], - drag: ["drag", "dragControls"], - focus: ["whileFocus"], - hover: ["whileHover", "onHoverStart", "onHoverEnd"], - tap: ["whileTap", "onTap", "onTapStart", "onTapCancel"], - pan: ["onPan", "onPanStart", "onPanSessionStart", "onPanEnd"], - inView: ["whileInView", "onViewportEnter", "onViewportLeave"], - layout: ["layout", "layoutId"], -}; -let isInitialized = false; -/** - * Initialize feature definitions with isEnabled checks. - * This must be called before any motion components are rendered. - */ -function initFeatureDefinitions() { - if (isInitialized) - return; - const initialFeatureDefinitions = {}; - for (const key in featureProps) { - initialFeatureDefinitions[key] = { - isEnabled: (props) => featureProps[key].some((name) => !!props[name]), - }; - } - setFeatureDefinitions(initialFeatureDefinitions); - isInitialized = true; -} -/** - * Get the current feature definitions, initializing if needed. - */ -function getInitializedFeatureDefinitions() { - initFeatureDefinitions(); - return getFeatureDefinitions(); -} - -export { getInitializedFeatureDefinitions, initFeatureDefinitions }; -//# sourceMappingURL=definitions.mjs.map diff --git a/node_modules/framer-motion/dist/es/motion/features/definitions.mjs.map b/node_modules/framer-motion/dist/es/motion/features/definitions.mjs.map deleted file mode 100644 index 1cfc05c..0000000 --- a/node_modules/framer-motion/dist/es/motion/features/definitions.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"definitions.mjs","sources":["../../../../src/motion/features/definitions.ts"],"sourcesContent":["import { getFeatureDefinitions, setFeatureDefinitions } from \"motion-dom\"\nimport { MotionProps } from \"../types\"\nimport { FeatureDefinitions } from \"./types\"\n\nconst featureProps = {\n animation: [\n \"animate\",\n \"variants\",\n \"whileHover\",\n \"whileTap\",\n \"exit\",\n \"whileInView\",\n \"whileFocus\",\n \"whileDrag\",\n ],\n exit: [\"exit\"],\n drag: [\"drag\", \"dragControls\"],\n focus: [\"whileFocus\"],\n hover: [\"whileHover\", \"onHoverStart\", \"onHoverEnd\"],\n tap: [\"whileTap\", \"onTap\", \"onTapStart\", \"onTapCancel\"],\n pan: [\"onPan\", \"onPanStart\", \"onPanSessionStart\", \"onPanEnd\"],\n inView: [\"whileInView\", \"onViewportEnter\", \"onViewportLeave\"],\n layout: [\"layout\", \"layoutId\"],\n}\n\nlet isInitialized = false\n\n/**\n * Initialize feature definitions with isEnabled checks.\n * This must be called before any motion components are rendered.\n */\nexport function initFeatureDefinitions() {\n if (isInitialized) return\n\n const initialFeatureDefinitions: Partial = {}\n\n for (const key in featureProps) {\n initialFeatureDefinitions[\n key as keyof typeof initialFeatureDefinitions\n ] = {\n isEnabled: (props: MotionProps) =>\n featureProps[key as keyof typeof featureProps].some(\n (name: string) => !!props[name as keyof typeof props]\n ),\n }\n }\n\n setFeatureDefinitions(initialFeatureDefinitions)\n isInitialized = true\n}\n\n/**\n * Get the current feature definitions, initializing if needed.\n */\nexport function getInitializedFeatureDefinitions(): Partial {\n initFeatureDefinitions()\n return getFeatureDefinitions()\n}\n"],"names":[],"mappings":";;AAIA,MAAM,YAAY,GAAG;AACjB,IAAA,SAAS,EAAE;QACP,SAAS;QACT,UAAU;QACV,YAAY;QACZ,UAAU;QACV,MAAM;QACN,aAAa;QACb,YAAY;QACZ,WAAW;AACd,KAAA;IACD,IAAI,EAAE,CAAC,MAAM,CAAC;AACd,IAAA,IAAI,EAAE,CAAC,MAAM,EAAE,cAAc,CAAC;IAC9B,KAAK,EAAE,CAAC,YAAY,CAAC;AACrB,IAAA,KAAK,EAAE,CAAC,YAAY,EAAE,cAAc,EAAE,YAAY,CAAC;IACnD,GAAG,EAAE,CAAC,UAAU,EAAE,OAAO,EAAE,YAAY,EAAE,aAAa,CAAC;IACvD,GAAG,EAAE,CAAC,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,UAAU,CAAC;AAC7D,IAAA,MAAM,EAAE,CAAC,aAAa,EAAE,iBAAiB,EAAE,iBAAiB,CAAC;AAC7D,IAAA,MAAM,EAAE,CAAC,QAAQ,EAAE,UAAU,CAAC;CACjC;AAED,IAAI,aAAa,GAAG,KAAK;AAEzB;;;AAGG;SACa,sBAAsB,GAAA;AAClC,IAAA,IAAI,aAAa;QAAE;IAEnB,MAAM,yBAAyB,GAAgC,EAAE;AAEjE,IAAA,KAAK,MAAM,GAAG,IAAI,YAAY,EAAE;QAC5B,yBAAyB,CACrB,GAA6C,CAChD,GAAG;YACA,SAAS,EAAE,CAAC,KAAkB,KAC1B,YAAY,CAAC,GAAgC,CAAC,CAAC,IAAI,CAC/C,CAAC,IAAY,KAAK,CAAC,CAAC,KAAK,CAAC,IAA0B,CAAC,CACxD;SACR;IACL;IAEA,qBAAqB,CAAC,yBAAyB,CAAC;IAChD,aAAa,GAAG,IAAI;AACxB;AAEA;;AAEG;SACa,gCAAgC,GAAA;AAC5C,IAAA,sBAAsB,EAAE;IACxB,OAAO,qBAAqB,EAAE;AAClC;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/motion/features/drag.mjs b/node_modules/framer-motion/dist/es/motion/features/drag.mjs deleted file mode 100644 index 7852452..0000000 --- a/node_modules/framer-motion/dist/es/motion/features/drag.mjs +++ /dev/null @@ -1,18 +0,0 @@ -import { DragGesture } from '../../gestures/drag/index.mjs'; -import { PanGesture } from '../../gestures/pan/index.mjs'; -import { MeasureLayout } from './layout/MeasureLayout.mjs'; -import { HTMLProjectionNode } from 'motion-dom'; - -const drag = { - pan: { - Feature: PanGesture, - }, - drag: { - Feature: DragGesture, - ProjectionNode: HTMLProjectionNode, - MeasureLayout, - }, -}; - -export { drag }; -//# sourceMappingURL=drag.mjs.map diff --git a/node_modules/framer-motion/dist/es/motion/features/drag.mjs.map b/node_modules/framer-motion/dist/es/motion/features/drag.mjs.map deleted file mode 100644 index ee98308..0000000 --- a/node_modules/framer-motion/dist/es/motion/features/drag.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"drag.mjs","sources":["../../../../src/motion/features/drag.ts"],"sourcesContent":["import { DragGesture } from \"../../gestures/drag\"\nimport { PanGesture } from \"../../gestures/pan\"\nimport { HTMLProjectionNode } from \"../../projection\"\nimport { MeasureLayout } from \"./layout/MeasureLayout\"\nimport { FeaturePackages } from \"./types\"\n\nexport const drag: FeaturePackages = {\n pan: {\n Feature: PanGesture,\n },\n drag: {\n Feature: DragGesture,\n ProjectionNode: HTMLProjectionNode,\n MeasureLayout,\n },\n}\n"],"names":[],"mappings":";;;;;AAMO,MAAM,IAAI,GAAoB;AACjC,IAAA,GAAG,EAAE;AACD,QAAA,OAAO,EAAE,UAAU;AACtB,KAAA;AACD,IAAA,IAAI,EAAE;AACF,QAAA,OAAO,EAAE,WAAW;AACpB,QAAA,cAAc,EAAE,kBAAkB;QAClC,aAAa;AAChB,KAAA;;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/motion/features/gestures.mjs b/node_modules/framer-motion/dist/es/motion/features/gestures.mjs deleted file mode 100644 index e7708cc..0000000 --- a/node_modules/framer-motion/dist/es/motion/features/gestures.mjs +++ /dev/null @@ -1,22 +0,0 @@ -import { HoverGesture } from '../../gestures/hover.mjs'; -import { FocusGesture } from '../../gestures/focus.mjs'; -import { PressGesture } from '../../gestures/press.mjs'; -import { InViewFeature } from './viewport/index.mjs'; - -const gestureAnimations = { - inView: { - Feature: InViewFeature, - }, - tap: { - Feature: PressGesture, - }, - focus: { - Feature: FocusGesture, - }, - hover: { - Feature: HoverGesture, - }, -}; - -export { gestureAnimations }; -//# sourceMappingURL=gestures.mjs.map diff --git a/node_modules/framer-motion/dist/es/motion/features/gestures.mjs.map b/node_modules/framer-motion/dist/es/motion/features/gestures.mjs.map deleted file mode 100644 index 4a554e7..0000000 --- a/node_modules/framer-motion/dist/es/motion/features/gestures.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"gestures.mjs","sources":["../../../../src/motion/features/gestures.ts"],"sourcesContent":["import { HoverGesture } from \"../../gestures/hover\"\nimport { FocusGesture } from \"../../gestures/focus\"\nimport { PressGesture } from \"../../gestures/press\"\nimport { InViewFeature } from \"./viewport\"\nimport { FeaturePackages } from \"./types\"\n\nexport const gestureAnimations: FeaturePackages = {\n inView: {\n Feature: InViewFeature,\n },\n tap: {\n Feature: PressGesture,\n },\n focus: {\n Feature: FocusGesture,\n },\n hover: {\n Feature: HoverGesture,\n },\n}\n"],"names":[],"mappings":";;;;;AAMO,MAAM,iBAAiB,GAAoB;AAC9C,IAAA,MAAM,EAAE;AACJ,QAAA,OAAO,EAAE,aAAa;AACzB,KAAA;AACD,IAAA,GAAG,EAAE;AACD,QAAA,OAAO,EAAE,YAAY;AACxB,KAAA;AACD,IAAA,KAAK,EAAE;AACH,QAAA,OAAO,EAAE,YAAY;AACxB,KAAA;AACD,IAAA,KAAK,EAAE;AACH,QAAA,OAAO,EAAE,YAAY;AACxB,KAAA;;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/motion/features/layout.mjs b/node_modules/framer-motion/dist/es/motion/features/layout.mjs deleted file mode 100644 index 6ba67db..0000000 --- a/node_modules/framer-motion/dist/es/motion/features/layout.mjs +++ /dev/null @@ -1,12 +0,0 @@ -import { HTMLProjectionNode } from 'motion-dom'; -import { MeasureLayout } from './layout/MeasureLayout.mjs'; - -const layout = { - layout: { - ProjectionNode: HTMLProjectionNode, - MeasureLayout, - }, -}; - -export { layout }; -//# sourceMappingURL=layout.mjs.map diff --git a/node_modules/framer-motion/dist/es/motion/features/layout.mjs.map b/node_modules/framer-motion/dist/es/motion/features/layout.mjs.map deleted file mode 100644 index 900ad00..0000000 --- a/node_modules/framer-motion/dist/es/motion/features/layout.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"layout.mjs","sources":["../../../../src/motion/features/layout.ts"],"sourcesContent":["import { HTMLProjectionNode } from \"motion-dom\"\nimport { MeasureLayout } from \"./layout/MeasureLayout\"\nimport { FeaturePackages } from \"./types\"\n\nexport const layout: FeaturePackages = {\n layout: {\n ProjectionNode: HTMLProjectionNode,\n MeasureLayout,\n },\n}\n"],"names":[],"mappings":";;;AAIO,MAAM,MAAM,GAAoB;AACnC,IAAA,MAAM,EAAE;AACJ,QAAA,cAAc,EAAE,kBAAkB;QAClC,aAAa;AAChB,KAAA;;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.mjs b/node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.mjs deleted file mode 100644 index 58fa9ee..0000000 --- a/node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.mjs +++ /dev/null @@ -1,136 +0,0 @@ -"use client"; -import { jsx } from 'react/jsx-runtime'; -import { globalProjectionState, frame, microtask } from 'motion-dom'; -import { useContext, Component } from 'react'; -import { usePresence } from '../../../components/AnimatePresence/use-presence.mjs'; -import { LayoutGroupContext } from '../../../context/LayoutGroupContext.mjs'; -import { SwitchLayoutGroupContext } from '../../../context/SwitchLayoutGroupContext.mjs'; - -/** - * Track whether we've taken any snapshots yet. If not, - * we can safely skip notification of didUpdate. - * - * Difficult to capture in a test but to prevent flickering - * we must set this to true either on update or unmount. - * Running `next-env/layout-id` in Safari will show this behaviour if broken. - */ -let hasTakenAnySnapshot = false; -class MeasureLayoutWithContext extends Component { - /** - * This only mounts projection nodes for components that - * need measuring, we might want to do it for all components - * in order to incorporate transforms - */ - componentDidMount() { - const { visualElement, layoutGroup, switchLayoutGroup, layoutId } = this.props; - const { projection } = visualElement; - if (projection) { - if (layoutGroup.group) - layoutGroup.group.add(projection); - if (switchLayoutGroup && switchLayoutGroup.register && layoutId) { - switchLayoutGroup.register(projection); - } - if (hasTakenAnySnapshot) { - projection.root.didUpdate(); - } - projection.addEventListener("animationComplete", () => { - this.safeToRemove(); - }); - projection.setOptions({ - ...projection.options, - layoutDependency: this.props.layoutDependency, - onExitComplete: () => this.safeToRemove(), - }); - } - globalProjectionState.hasEverUpdated = true; - } - getSnapshotBeforeUpdate(prevProps) { - const { layoutDependency, visualElement, drag, isPresent } = this.props; - const { projection } = visualElement; - if (!projection) - return null; - /** - * TODO: We use this data in relegate to determine whether to - * promote a previous element. There's no guarantee its presence data - * will have updated by this point - if a bug like this arises it will - * have to be that we markForRelegation and then find a new lead some other way, - * perhaps in didUpdate - */ - projection.isPresent = isPresent; - if (prevProps.layoutDependency !== layoutDependency) { - projection.setOptions({ - ...projection.options, - layoutDependency, - }); - } - hasTakenAnySnapshot = true; - if (drag || - prevProps.layoutDependency !== layoutDependency || - layoutDependency === undefined || - prevProps.isPresent !== isPresent) { - projection.willUpdate(); - } - else { - this.safeToRemove(); - } - if (prevProps.isPresent !== isPresent) { - if (isPresent) { - projection.promote(); - } - else if (!projection.relegate()) { - /** - * If there's another stack member taking over from this one, - * it's in charge of the exit animation and therefore should - * be in charge of the safe to remove. Otherwise we call it here. - */ - frame.postRender(() => { - const stack = projection.getStack(); - if (!stack || !stack.members.length) { - this.safeToRemove(); - } - }); - } - } - return null; - } - componentDidUpdate() { - const { visualElement, layoutAnchor } = this.props; - const { projection } = visualElement; - if (projection) { - projection.options.layoutAnchor = layoutAnchor; - projection.root.didUpdate(); - microtask.postRender(() => { - if (!projection.currentAnimation && projection.isLead()) { - this.safeToRemove(); - } - }); - } - } - componentWillUnmount() { - const { visualElement, layoutGroup, switchLayoutGroup: promoteContext, } = this.props; - const { projection } = visualElement; - hasTakenAnySnapshot = true; - if (projection) { - projection.scheduleCheckAfterUnmount(); - if (layoutGroup && layoutGroup.group) - layoutGroup.group.remove(projection); - if (promoteContext && promoteContext.deregister) - promoteContext.deregister(projection); - } - } - safeToRemove() { - const { safeToRemove } = this.props; - safeToRemove && safeToRemove(); - } - render() { - return null; - } -} -function MeasureLayout(props) { - const [isPresent, safeToRemove] = usePresence(); - const layoutGroup = useContext(LayoutGroupContext); - return (jsx(MeasureLayoutWithContext, { ...props, layoutGroup: layoutGroup, switchLayoutGroup: useContext(SwitchLayoutGroupContext), isPresent: isPresent, safeToRemove: safeToRemove })); -} - -export { MeasureLayout }; -//# sourceMappingURL=MeasureLayout.mjs.map diff --git a/node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.mjs.map b/node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.mjs.map deleted file mode 100644 index 46b865d..0000000 --- a/node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"MeasureLayout.mjs","sources":["../../../../../src/motion/features/layout/MeasureLayout.tsx"],"sourcesContent":["\"use client\"\n\nimport { frame, microtask, globalProjectionState, type VisualElement } from \"motion-dom\"\nimport { Component, useContext } from \"react\"\nimport { usePresence } from \"../../../components/AnimatePresence/use-presence\"\nimport {\n LayoutGroupContext,\n LayoutGroupContextProps,\n} from \"../../../context/LayoutGroupContext\"\nimport { SwitchLayoutGroupContext } from \"../../../context/SwitchLayoutGroupContext\"\nimport { MotionProps } from \"../../types\"\n\ninterface MeasureContextProps {\n layoutGroup: LayoutGroupContextProps\n switchLayoutGroup?: SwitchLayoutGroupContext\n isPresent: boolean\n safeToRemove?: VoidFunction | null\n}\n\ntype MeasureProps = MotionProps &\n MeasureContextProps & { visualElement: VisualElement }\n\n/**\n * Track whether we've taken any snapshots yet. If not,\n * we can safely skip notification of didUpdate.\n *\n * Difficult to capture in a test but to prevent flickering\n * we must set this to true either on update or unmount.\n * Running `next-env/layout-id` in Safari will show this behaviour if broken.\n */\nlet hasTakenAnySnapshot = false\n\nclass MeasureLayoutWithContext extends Component {\n /**\n * This only mounts projection nodes for components that\n * need measuring, we might want to do it for all components\n * in order to incorporate transforms\n */\n componentDidMount() {\n const { visualElement, layoutGroup, switchLayoutGroup, layoutId } =\n this.props\n const { projection } = visualElement\n\n if (projection) {\n if (layoutGroup.group) layoutGroup.group.add(projection)\n\n if (switchLayoutGroup && switchLayoutGroup.register && layoutId) {\n switchLayoutGroup.register(projection)\n }\n\n if (hasTakenAnySnapshot) {\n projection.root!.didUpdate()\n }\n\n projection.addEventListener(\"animationComplete\", () => {\n this.safeToRemove()\n })\n projection.setOptions({\n ...projection.options,\n layoutDependency: this.props.layoutDependency,\n onExitComplete: () => this.safeToRemove(),\n })\n }\n\n globalProjectionState.hasEverUpdated = true\n }\n\n getSnapshotBeforeUpdate(prevProps: MeasureProps) {\n const { layoutDependency, visualElement, drag, isPresent } = this.props\n const { projection } = visualElement\n\n if (!projection) return null\n\n /**\n * TODO: We use this data in relegate to determine whether to\n * promote a previous element. There's no guarantee its presence data\n * will have updated by this point - if a bug like this arises it will\n * have to be that we markForRelegation and then find a new lead some other way,\n * perhaps in didUpdate\n */\n projection.isPresent = isPresent\n\n if (prevProps.layoutDependency !== layoutDependency) {\n projection.setOptions({\n ...projection.options,\n layoutDependency,\n })\n }\n\n hasTakenAnySnapshot = true\n\n if (\n drag ||\n prevProps.layoutDependency !== layoutDependency ||\n layoutDependency === undefined ||\n prevProps.isPresent !== isPresent\n ) {\n projection.willUpdate()\n } else {\n this.safeToRemove()\n }\n\n if (prevProps.isPresent !== isPresent) {\n if (isPresent) {\n projection.promote()\n } else if (!projection.relegate()) {\n /**\n * If there's another stack member taking over from this one,\n * it's in charge of the exit animation and therefore should\n * be in charge of the safe to remove. Otherwise we call it here.\n */\n frame.postRender(() => {\n const stack = projection.getStack()\n if (!stack || !stack.members.length) {\n this.safeToRemove()\n }\n })\n }\n }\n\n return null\n }\n\n componentDidUpdate() {\n const { visualElement, layoutAnchor } = this.props\n const { projection } = visualElement\n if (projection) {\n projection.options.layoutAnchor = layoutAnchor\n\n projection.root!.didUpdate()\n\n microtask.postRender(() => {\n if (!projection.currentAnimation && projection.isLead()) {\n this.safeToRemove()\n }\n })\n }\n }\n\n componentWillUnmount() {\n const {\n visualElement,\n layoutGroup,\n switchLayoutGroup: promoteContext,\n } = this.props\n const { projection } = visualElement\n\n hasTakenAnySnapshot = true\n\n if (projection) {\n projection.scheduleCheckAfterUnmount()\n if (layoutGroup && layoutGroup.group)\n layoutGroup.group.remove(projection)\n if (promoteContext && promoteContext.deregister)\n promoteContext.deregister(projection)\n }\n }\n\n safeToRemove() {\n const { safeToRemove } = this.props\n safeToRemove && safeToRemove()\n }\n\n render() {\n return null\n }\n}\n\nexport function MeasureLayout(\n props: MotionProps & { visualElement: VisualElement }\n) {\n const [isPresent, safeToRemove] = usePresence()\n const layoutGroup = useContext(LayoutGroupContext)\n\n return (\n \n )\n}\n"],"names":[],"mappings":";;;;;;;;AAsBA;;;;;;;AAOG;AACH;AAEA;AACI;;;;AAIG;;AAEC;AAEA;;;AAG2B;;AAGnB;;;AAIA;;AAGJ;;AAEA;;;AAGI;AACA;AACH;;AAGL;;AAGJ;AACI;AACA;AAEA;AAAiB;AAEjB;;;;;;AAMG;AACH;AAEA;;;;AAIK;;;AAKL;;AAGI;AACA;;;;;;AAOJ;;;;AAGW;AACH;;;;AAIG;AACH;AACI;;;;AAIJ;;;AAIR;;;;AAKA;;AAEI;AAEA;AAEA;;;;AAIA;;;;AAKJ;AAKA;;;;AAMI;AACI;AACJ;AACI;;;;AAKR;;;;AAKA;;AAEP;AAEK;;AAIF;;AAWJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/motion/features/load-features.mjs b/node_modules/framer-motion/dist/es/motion/features/load-features.mjs deleted file mode 100644 index dc52536..0000000 --- a/node_modules/framer-motion/dist/es/motion/features/load-features.mjs +++ /dev/null @@ -1,16 +0,0 @@ -import { setFeatureDefinitions } from 'motion-dom'; -import { getInitializedFeatureDefinitions } from './definitions.mjs'; - -function loadFeatures(features) { - const featureDefinitions = getInitializedFeatureDefinitions(); - for (const key in features) { - featureDefinitions[key] = { - ...featureDefinitions[key], - ...features[key], - }; - } - setFeatureDefinitions(featureDefinitions); -} - -export { loadFeatures }; -//# sourceMappingURL=load-features.mjs.map diff --git a/node_modules/framer-motion/dist/es/motion/features/load-features.mjs.map b/node_modules/framer-motion/dist/es/motion/features/load-features.mjs.map deleted file mode 100644 index 7601650..0000000 --- a/node_modules/framer-motion/dist/es/motion/features/load-features.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"load-features.mjs","sources":["../../../../src/motion/features/load-features.ts"],"sourcesContent":["import { setFeatureDefinitions } from \"motion-dom\"\nimport { getInitializedFeatureDefinitions } from \"./definitions\"\nimport { FeaturePackages } from \"./types\"\n\nexport function loadFeatures(features: FeaturePackages) {\n const featureDefinitions = getInitializedFeatureDefinitions()\n\n for (const key in features) {\n featureDefinitions[key as keyof typeof featureDefinitions] = {\n ...featureDefinitions[key as keyof typeof featureDefinitions],\n ...features[key as keyof typeof features],\n } as any\n }\n\n setFeatureDefinitions(featureDefinitions)\n}\n"],"names":[],"mappings":";;;AAIM,SAAU,YAAY,CAAC,QAAyB,EAAA;AAClD,IAAA,MAAM,kBAAkB,GAAG,gCAAgC,EAAE;AAE7D,IAAA,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE;QACxB,kBAAkB,CAAC,GAAsC,CAAC,GAAG;YACzD,GAAG,kBAAkB,CAAC,GAAsC,CAAC;YAC7D,GAAG,QAAQ,CAAC,GAA4B,CAAC;SACrC;IACZ;IAEA,qBAAqB,CAAC,kBAAkB,CAAC;AAC7C;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/motion/features/viewport/index.mjs b/node_modules/framer-motion/dist/es/motion/features/viewport/index.mjs deleted file mode 100644 index 4d1b957..0000000 --- a/node_modules/framer-motion/dist/es/motion/features/viewport/index.mjs +++ /dev/null @@ -1,77 +0,0 @@ -import { Feature } from 'motion-dom'; -import { observeIntersection } from './observers.mjs'; - -const thresholdNames = { - some: 0, - all: 1, -}; -class InViewFeature extends Feature { - constructor() { - super(...arguments); - this.hasEnteredView = false; - this.isInView = false; - } - startObserver() { - this.stopObserver?.(); - const { viewport = {} } = this.node.getProps(); - const { root, margin: rootMargin, amount = "some", once } = viewport; - const options = { - root: root ? root.current : undefined, - rootMargin, - threshold: typeof amount === "number" ? amount : thresholdNames[amount], - }; - const onIntersectionUpdate = (entry) => { - const { isIntersecting } = entry; - /** - * If there's been no change in the viewport state, early return. - */ - if (this.isInView === isIntersecting) - return; - this.isInView = isIntersecting; - /** - * Handle hasEnteredView. If this is only meant to run once, and - * element isn't visible, early return. Otherwise set hasEnteredView to true. - */ - if (once && !isIntersecting && this.hasEnteredView) { - return; - } - else if (isIntersecting) { - this.hasEnteredView = true; - } - if (this.node.animationState) { - this.node.animationState.setActive("whileInView", isIntersecting); - } - /** - * Use the latest committed props rather than the ones in scope - * when this observer is created - */ - const { onViewportEnter, onViewportLeave } = this.node.getProps(); - const callback = isIntersecting ? onViewportEnter : onViewportLeave; - callback && callback(entry); - }; - this.stopObserver = observeIntersection(this.node.current, options, onIntersectionUpdate); - } - mount() { - this.startObserver(); - } - update() { - if (typeof IntersectionObserver === "undefined") - return; - const { props, prevProps } = this.node; - const hasOptionsChanged = ["amount", "margin", "root"].some(hasViewportOptionChanged(props, prevProps)); - if (hasOptionsChanged) { - this.startObserver(); - } - } - unmount() { - this.stopObserver?.(); - this.hasEnteredView = false; - this.isInView = false; - } -} -function hasViewportOptionChanged({ viewport = {} }, { viewport: prevViewport = {} } = {}) { - return (name) => viewport[name] !== prevViewport[name]; -} - -export { InViewFeature }; -//# sourceMappingURL=index.mjs.map diff --git a/node_modules/framer-motion/dist/es/motion/features/viewport/index.mjs.map b/node_modules/framer-motion/dist/es/motion/features/viewport/index.mjs.map deleted file mode 100644 index cb6c730..0000000 --- a/node_modules/framer-motion/dist/es/motion/features/viewport/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs","sources":["../../../../../src/motion/features/viewport/index.ts"],"sourcesContent":["import { Feature } from \"motion-dom\"\nimport { MotionProps } from \"../../types\"\nimport { observeIntersection } from \"./observers\"\n\nconst thresholdNames = {\n some: 0,\n all: 1,\n}\n\nexport class InViewFeature extends Feature {\n private hasEnteredView = false\n\n private isInView = false\n\n private stopObserver?: () => void\n\n private startObserver() {\n this.stopObserver?.()\n\n const { viewport = {} } = this.node.getProps()\n const { root, margin: rootMargin, amount = \"some\", once } = viewport\n\n const options = {\n root: root ? root.current : undefined,\n rootMargin,\n threshold:\n typeof amount === \"number\" ? amount : thresholdNames[amount],\n }\n\n const onIntersectionUpdate = (entry: IntersectionObserverEntry) => {\n const { isIntersecting } = entry\n\n /**\n * If there's been no change in the viewport state, early return.\n */\n if (this.isInView === isIntersecting) return\n\n this.isInView = isIntersecting\n\n /**\n * Handle hasEnteredView. If this is only meant to run once, and\n * element isn't visible, early return. Otherwise set hasEnteredView to true.\n */\n if (once && !isIntersecting && this.hasEnteredView) {\n return\n } else if (isIntersecting) {\n this.hasEnteredView = true\n }\n\n if (this.node.animationState) {\n this.node.animationState.setActive(\n \"whileInView\",\n isIntersecting\n )\n }\n\n /**\n * Use the latest committed props rather than the ones in scope\n * when this observer is created\n */\n const { onViewportEnter, onViewportLeave } = this.node.getProps()\n const callback = isIntersecting ? onViewportEnter : onViewportLeave\n callback && callback(entry)\n }\n\n this.stopObserver = observeIntersection(\n this.node.current!,\n options,\n onIntersectionUpdate\n )\n }\n\n mount() {\n this.startObserver()\n }\n\n update() {\n if (typeof IntersectionObserver === \"undefined\") return\n\n const { props, prevProps } = this.node\n const hasOptionsChanged = [\"amount\", \"margin\", \"root\"].some(\n hasViewportOptionChanged(props, prevProps)\n )\n\n if (hasOptionsChanged) {\n this.startObserver()\n }\n }\n\n unmount() {\n this.stopObserver?.()\n this.hasEnteredView = false\n this.isInView = false\n }\n}\n\nfunction hasViewportOptionChanged(\n { viewport = {} }: MotionProps,\n { viewport: prevViewport = {} }: MotionProps = {}\n) {\n return (name: keyof typeof viewport) =>\n viewport[name] !== prevViewport[name]\n}\n"],"names":[],"mappings":";;;AAIA,MAAM,cAAc,GAAG;AACnB,IAAA,IAAI,EAAE,CAAC;AACP,IAAA,GAAG,EAAE,CAAC;CACT;AAEK,MAAO,aAAc,SAAQ,OAAgB,CAAA;AAAnD,IAAA,WAAA,GAAA;;QACY,IAAA,CAAA,cAAc,GAAG,KAAK;QAEtB,IAAA,CAAA,QAAQ,GAAG,KAAK;IAkF5B;IA9EY,aAAa,GAAA;AACjB,QAAA,IAAI,CAAC,YAAY,IAAI;AAErB,QAAA,MAAM,EAAE,QAAQ,GAAG,EAAE,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;AAC9C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MAAM,GAAA;QACF,IAAI,OAAO,oBAAoB,KAAK,WAAW;YAAE;QAEjD,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC,IAAI;AACtC,QAAA,MAAM,iBAAiB,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC,IAAI,CACvD,wBAAwB,CAAC,KAAK,EAAE,SAAS,CAAC,CAC7C;QAED,IAAI,iBAAiB,EAAE;YACnB,IAAI,CAAC,aAAa,EAAE;QACxB;IACJ;IAEA,OAAO,GAAA;AACH,QAAA,IAAI,CAAC,YAAY,IAAI;AACrB,QAAA,IAAI,CAAC,cAAc,GAAG,KAAK;AAC3B,QAAA,IAAI,CAAC,QAAQ,GAAG,KAAK;IACzB;AACH;AAED,SAAS,wBAAwB,CAC7B,EAAE,QAAQ,GAAG,EAAE,EAAe,EAC9B,EAAE,QAAQ,EAAE,YAAY,GAAG,EAAE,KAAkB,EAAE,EAAA;AAEjD,IAAA,OAAO,CAAC,IAA2B,KAC/B,QAAQ,CAAC,IAAI,CAAC,KAAK,YAAY,CAAC,IAAI,CAAC;AAC7C;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/motion/features/viewport/observers.mjs b/node_modules/framer-motion/dist/es/motion/features/viewport/observers.mjs deleted file mode 100644 index 7c67d85..0000000 --- a/node_modules/framer-motion/dist/es/motion/features/viewport/observers.mjs +++ /dev/null @@ -1,50 +0,0 @@ -/** - * Map an IntersectionHandler callback to an element. We only ever make one handler for one - * element, so even though these handlers might all be triggered by different - * observers, we can keep them in the same map. - */ -const observerCallbacks = new WeakMap(); -/** - * Multiple observers can be created for multiple element/document roots. Each with - * different settings. So here we store dictionaries of observers to each root, - * using serialised settings (threshold/margin) as lookup keys. - */ -const observers = new WeakMap(); -const fireObserverCallback = (entry) => { - const callback = observerCallbacks.get(entry.target); - callback && callback(entry); -}; -const fireAllObserverCallbacks = (entries) => { - entries.forEach(fireObserverCallback); -}; -function initIntersectionObserver({ root, ...options }) { - const lookupRoot = root || document; - /** - * If we don't have an observer lookup map for this root, create one. - */ - if (!observers.has(lookupRoot)) { - observers.set(lookupRoot, {}); - } - const rootObservers = observers.get(lookupRoot); - const key = JSON.stringify(options); - /** - * If we don't have an observer for this combination of root and settings, - * create one. - */ - if (!rootObservers[key]) { - rootObservers[key] = new IntersectionObserver(fireAllObserverCallbacks, { root, ...options }); - } - return rootObservers[key]; -} -function observeIntersection(element, options, callback) { - const rootInteresectionObserver = initIntersectionObserver(options); - observerCallbacks.set(element, callback); - rootInteresectionObserver.observe(element); - return () => { - observerCallbacks.delete(element); - rootInteresectionObserver.unobserve(element); - }; -} - -export { observeIntersection }; -//# sourceMappingURL=observers.mjs.map diff --git a/node_modules/framer-motion/dist/es/motion/features/viewport/observers.mjs.map b/node_modules/framer-motion/dist/es/motion/features/viewport/observers.mjs.map deleted file mode 100644 index cbbe273..0000000 --- a/node_modules/framer-motion/dist/es/motion/features/viewport/observers.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"observers.mjs","sources":["../../../../../src/motion/features/viewport/observers.ts"],"sourcesContent":["type IntersectionHandler = (entry: IntersectionObserverEntry) => void\n\ninterface ElementIntersectionObservers {\n [key: string]: IntersectionObserver\n}\n\n/**\n * Map an IntersectionHandler callback to an element. We only ever make one handler for one\n * element, so even though these handlers might all be triggered by different\n * observers, we can keep them in the same map.\n */\nconst observerCallbacks = new WeakMap()\n\n/**\n * Multiple observers can be created for multiple element/document roots. Each with\n * different settings. So here we store dictionaries of observers to each root,\n * using serialised settings (threshold/margin) as lookup keys.\n */\nconst observers = new WeakMap<\n Element | Document,\n ElementIntersectionObservers\n>()\n\nconst fireObserverCallback = (entry: IntersectionObserverEntry) => {\n const callback = observerCallbacks.get(entry.target)\n callback && callback(entry)\n}\n\nconst fireAllObserverCallbacks: IntersectionObserverCallback = (entries) => {\n entries.forEach(fireObserverCallback)\n}\n\nfunction initIntersectionObserver({\n root,\n ...options\n}: IntersectionObserverInit): IntersectionObserver {\n const lookupRoot = root || document\n\n /**\n * If we don't have an observer lookup map for this root, create one.\n */\n if (!observers.has(lookupRoot)) {\n observers.set(lookupRoot, {})\n }\n const rootObservers = observers.get(lookupRoot)!\n\n const key = JSON.stringify(options)\n\n /**\n * If we don't have an observer for this combination of root and settings,\n * create one.\n */\n if (!rootObservers[key]) {\n rootObservers[key] = new IntersectionObserver(\n fireAllObserverCallbacks,\n { root, ...options }\n )\n }\n\n return rootObservers[key]\n}\n\nexport function observeIntersection(\n element: Element,\n options: IntersectionObserverInit,\n callback: IntersectionHandler\n) {\n const rootInteresectionObserver = initIntersectionObserver(options)\n\n observerCallbacks.set(element, callback)\n rootInteresectionObserver.observe(element)\n\n return () => {\n observerCallbacks.delete(element)\n rootInteresectionObserver.unobserve(element)\n }\n}\n"],"names":[],"mappings":"AAMA;;;;AAIG;AACH,MAAM,iBAAiB,GAAG,IAAI,OAAO,EAAgC;AAErE;;;;AAIG;AACH,MAAM,SAAS,GAAG,IAAI,OAAO,EAG1B;AAEH,MAAM,oBAAoB,GAAG,CAAC,KAAgC,KAAI;IAC9D,MAAM,QAAQ,GAAG,iBAAiB,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC;AACpD,IAAA,QAAQ,IAAI,QAAQ,CAAC,KAAK,CAAC;AAC/B,CAAC;AAED,MAAM,wBAAwB,GAAiC,CAAC,OAAO,KAAI;AACvE,IAAA,OAAO,CAAC,OAAO,CAAC,oBAAoB,CAAC;AACzC,CAAC;AAED,SAAS,wBAAwB,CAAC,EAC9B,IAAI,EACJ,GAAG,OAAO,EACa,EAAA;AACvB,IAAA,MAAM,UAAU,GAAG,IAAI,IAAI,QAAQ;AAEnC;;AAEG;IACH,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE;AAC5B,QAAA,SAAS,CAAC,GAAG,CAAC,UAAU,EAAE,EAAE,CAAC;IACjC;IACA,MAAM,aAAa,GAAG,SAAS,CAAC,GAAG,CAAC,UAAU,CAAE;IAEhD,MAAM,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;AAEnC;;;AAGG;AACH,IAAA,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,EAAE;AACrB,QAAA,aAAa,CAAC,GAAG,CAAC,GAAG,IAAI,oBAAoB,CACzC,wBAAwB,EACxB,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CACvB;IACL;AAEA,IAAA,OAAO,aAAa,CAAC,GAAG,CAAC;AAC7B;SAEgB,mBAAmB,CAC/B,OAAgB,EAChB,OAAiC,EACjC,QAA6B,EAAA;AAE7B,IAAA,MAAM,yBAAyB,GAAG,wBAAwB,CAAC,OAAO,CAAC;AAEnE,IAAA,iBAAiB,CAAC,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAC;AACxC,IAAA,yBAAyB,CAAC,OAAO,CAAC,OAAO,CAAC;AAE1C,IAAA,OAAO,MAAK;AACR,QAAA,iBAAiB,CAAC,MAAM,CAAC,OAAO,CAAC;AACjC,QAAA,yBAAyB,CAAC,SAAS,CAAC,OAAO,CAAC;AAChD,IAAA,CAAC;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/motion/index.mjs b/node_modules/framer-motion/dist/es/motion/index.mjs deleted file mode 100644 index 50e499c..0000000 --- a/node_modules/framer-motion/dist/es/motion/index.mjs +++ /dev/null @@ -1,113 +0,0 @@ -"use client"; -import { jsxs, jsx } from 'react/jsx-runtime'; -import { warning, invariant } from 'motion-utils'; -import { forwardRef, useContext } from 'react'; -import { LayoutGroupContext } from '../context/LayoutGroupContext.mjs'; -import { LazyContext } from '../context/LazyContext.mjs'; -import { MotionConfigContext } from '../context/MotionConfigContext.mjs'; -import { MotionContext } from '../context/MotionContext/index.mjs'; -import { useCreateMotionContext } from '../context/MotionContext/create.mjs'; -import { useRender } from '../render/dom/use-render.mjs'; -import { isSVGComponent } from '../render/dom/utils/is-svg-component.mjs'; -import { useHTMLVisualState } from '../render/html/use-html-visual-state.mjs'; -import { useSVGVisualState } from '../render/svg/use-svg-visual-state.mjs'; -import { getInitializedFeatureDefinitions } from './features/definitions.mjs'; -import { loadFeatures } from './features/load-features.mjs'; -import { motionComponentSymbol } from './utils/symbol.mjs'; -import { useMotionRef } from './utils/use-motion-ref.mjs'; -import { useVisualElement } from './utils/use-visual-element.mjs'; - -/** - * Create a `motion` component. - * - * This function accepts a Component argument, which can be either a string (ie "div" - * for `motion.div`), or an actual React component. - * - * Alongside this is a config option which provides a way of rendering the provided - * component "offline", or outside the React render cycle. - */ -function createMotionComponent(Component, { forwardMotionProps = false, type } = {}, preloadedFeatures, createVisualElement) { - preloadedFeatures && loadFeatures(preloadedFeatures); - /** - * Determine whether to use SVG or HTML rendering based on: - * 1. Explicit `type` option (highest priority) - * 2. Auto-detection via `isSVGComponent` - */ - const isSVG = type ? type === "svg" : isSVGComponent(Component); - const useVisualState = isSVG ? useSVGVisualState : useHTMLVisualState; - function MotionDOMComponent(props, externalRef) { - /** - * If we need to measure the element we load this functionality in a - * separate class component in order to gain access to getSnapshotBeforeUpdate. - */ - let MeasureLayout; - const configAndProps = { - ...useContext(MotionConfigContext), - ...props, - layoutId: useLayoutId(props), - }; - const { isStatic, isValidProp } = configAndProps; - const context = useCreateMotionContext(props); - const visualState = useVisualState(props, isStatic); - if (!isStatic && typeof window !== "undefined") { - useStrictMode(configAndProps, preloadedFeatures); - const layoutProjection = getProjectionFunctionality(configAndProps); - MeasureLayout = layoutProjection.MeasureLayout; - /** - * Create a VisualElement for this component. A VisualElement provides a common - * interface to renderer-specific APIs (ie DOM/Three.js etc) as well as - * providing a way of rendering to these APIs outside of the React render loop - * for more performant animations and interactions - */ - context.visualElement = useVisualElement(Component, visualState, configAndProps, createVisualElement, layoutProjection.ProjectionNode, isSVG); - } - /** - * The mount order and hierarchy is specific to ensure our element ref - * is hydrated by the time features fire their effects. - */ - return (jsxs(MotionContext.Provider, { value: context, children: [MeasureLayout && context.visualElement ? (jsx(MeasureLayout, { visualElement: context.visualElement, ...configAndProps })) : null, useRender(Component, props, useMotionRef(visualState, context.visualElement, externalRef), visualState, isStatic, forwardMotionProps, isSVG, isValidProp)] })); - } - MotionDOMComponent.displayName = `motion.${typeof Component === "string" - ? Component - : `create(${Component.displayName ?? Component.name ?? ""})`}`; - const ForwardRefMotionComponent = forwardRef(MotionDOMComponent); - ForwardRefMotionComponent[motionComponentSymbol] = Component; - return ForwardRefMotionComponent; -} -function useLayoutId({ layoutId }) { - const layoutGroupId = useContext(LayoutGroupContext).id; - return layoutGroupId && layoutId !== undefined - ? layoutGroupId + "-" + layoutId - : layoutId; -} -function useStrictMode(configAndProps, preloadedFeatures) { - const isStrict = useContext(LazyContext).strict; - /** - * If we're in development mode, check to make sure we're not rendering a motion component - * as a child of LazyMotion, as this will break the file-size benefits of using it. - */ - if (process.env.NODE_ENV !== "production" && - preloadedFeatures && - isStrict) { - const strictMessage = "You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead."; - configAndProps.ignoreStrict - ? warning(false, strictMessage, "lazy-strict-mode") - : invariant(false, strictMessage, "lazy-strict-mode"); - } -} -function getProjectionFunctionality(props) { - const featureDefinitions = getInitializedFeatureDefinitions(); - const { drag, layout } = featureDefinitions; - if (!drag && !layout) - return {}; - const combined = { ...drag, ...layout }; - return { - MeasureLayout: drag?.isEnabled(props) || layout?.isEnabled(props) - ? combined.MeasureLayout - : undefined, - ProjectionNode: combined.ProjectionNode, - }; -} - -export { createMotionComponent }; -//# sourceMappingURL=index.mjs.map diff --git a/node_modules/framer-motion/dist/es/motion/index.mjs.map b/node_modules/framer-motion/dist/es/motion/index.mjs.map deleted file mode 100644 index 4e73846..0000000 --- a/node_modules/framer-motion/dist/es/motion/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs","sources":["../../../src/motion/index.tsx"],"sourcesContent":["\"use client\"\n\nimport { invariant, warning } from \"motion-utils\"\nimport * as React from \"react\"\nimport { forwardRef, useContext } from \"react\"\nimport { LayoutGroupContext } from \"../context/LayoutGroupContext\"\nimport { LazyContext } from \"../context/LazyContext\"\nimport { MotionConfigContext } from \"../context/MotionConfigContext\"\nimport { MotionContext } from \"../context/MotionContext\"\nimport { useCreateMotionContext } from \"../context/MotionContext/create\"\nimport { DOMMotionComponents } from \"../render/dom/types\"\nimport { useRender } from \"../render/dom/use-render\"\nimport { isSVGComponent } from \"../render/dom/utils/is-svg-component\"\nimport { HTMLRenderState } from \"../render/html/types\"\nimport { useHTMLVisualState } from \"../render/html/use-html-visual-state\"\nimport { SVGRenderState } from \"../render/svg/types\"\nimport { useSVGVisualState } from \"../render/svg/use-svg-visual-state\"\nimport { CreateVisualElement } from \"../render/types\"\nimport { getInitializedFeatureDefinitions } from \"./features/definitions\"\nimport { loadFeatures } from \"./features/load-features\"\nimport { FeatureBundle, FeaturePackages } from \"./features/types\"\nimport { MotionProps } from \"./types\"\nimport { motionComponentSymbol } from \"./utils/symbol\"\nimport { useMotionRef } from \"./utils/use-motion-ref\"\nimport { useVisualElement } from \"./utils/use-visual-element\"\n\nexport interface MotionComponentConfig<\n TagName extends keyof DOMMotionComponents | string = \"div\"\n> {\n preloadedFeatures?: FeatureBundle\n createVisualElement?: CreateVisualElement\n Component: TagName | React.ComponentType>\n forwardMotionProps?: boolean\n}\n\nexport type MotionComponentProps = {\n [K in Exclude]?: Props[K]\n} & MotionProps\n\nexport type MotionComponent = T extends keyof DOMMotionComponents\n ? DOMMotionComponents[T]\n : React.ComponentType<\n Omit, \"children\"> & {\n children?: \"children\" extends keyof P\n ? P[\"children\"] | MotionComponentProps

[\"children\"]\n : MotionComponentProps

[\"children\"]\n }\n >\n\nexport interface MotionComponentOptions {\n forwardMotionProps?: boolean\n /**\n * Specify whether the component renders an HTML or SVG element.\n * This is useful when wrapping custom SVG components that need\n * SVG-specific attribute handling (like viewBox animation).\n * By default, Motion auto-detects based on the component name,\n * but custom React components are always treated as HTML.\n */\n type?: \"html\" | \"svg\"\n}\n\n/**\n * Create a `motion` component.\n *\n * This function accepts a Component argument, which can be either a string (ie \"div\"\n * for `motion.div`), or an actual React component.\n *\n * Alongside this is a config option which provides a way of rendering the provided\n * component \"offline\", or outside the React render cycle.\n */\nexport function createMotionComponent<\n Props,\n TagName extends keyof DOMMotionComponents | string = \"div\"\n>(\n Component: TagName | string | React.ComponentType,\n { forwardMotionProps = false, type }: MotionComponentOptions = {},\n preloadedFeatures?: FeaturePackages,\n createVisualElement?: CreateVisualElement\n) {\n preloadedFeatures && loadFeatures(preloadedFeatures)\n\n /**\n * Determine whether to use SVG or HTML rendering based on:\n * 1. Explicit `type` option (highest priority)\n * 2. Auto-detection via `isSVGComponent`\n */\n const isSVG = type ? type === \"svg\" : isSVGComponent(Component)\n const useVisualState = isSVG ? useSVGVisualState : useHTMLVisualState\n\n function MotionDOMComponent(\n props: MotionComponentProps,\n externalRef?: React.Ref\n ) {\n /**\n * If we need to measure the element we load this functionality in a\n * separate class component in order to gain access to getSnapshotBeforeUpdate.\n */\n let MeasureLayout: undefined | React.ComponentType\n\n const configAndProps = {\n ...useContext(MotionConfigContext),\n ...props,\n layoutId: useLayoutId(props),\n }\n\n const { isStatic, isValidProp } = configAndProps\n\n const context = useCreateMotionContext(props)\n\n const visualState = useVisualState(props, isStatic)\n\n if (!isStatic && typeof window !== \"undefined\") {\n useStrictMode(configAndProps, preloadedFeatures)\n\n const layoutProjection = getProjectionFunctionality(configAndProps)\n MeasureLayout = layoutProjection.MeasureLayout\n\n /**\n * Create a VisualElement for this component. A VisualElement provides a common\n * interface to renderer-specific APIs (ie DOM/Three.js etc) as well as\n * providing a way of rendering to these APIs outside of the React render loop\n * for more performant animations and interactions\n */\n context.visualElement = useVisualElement(\n Component,\n visualState,\n configAndProps,\n createVisualElement,\n layoutProjection.ProjectionNode,\n isSVG\n )\n }\n\n /**\n * The mount order and hierarchy is specific to ensure our element ref\n * is hydrated by the time features fire their effects.\n */\n return (\n \n {MeasureLayout && context.visualElement ? (\n \n ) : null}\n {useRender(\n Component,\n props,\n useMotionRef<\n HTMLElement | SVGElement,\n HTMLRenderState | SVGRenderState\n >(visualState, context.visualElement, externalRef),\n visualState,\n isStatic,\n forwardMotionProps,\n isSVG,\n isValidProp\n )}\n \n )\n }\n\n MotionDOMComponent.displayName = `motion.${\n typeof Component === \"string\"\n ? Component\n : `create(${Component.displayName ?? Component.name ?? \"\"})`\n }`\n\n const ForwardRefMotionComponent = forwardRef(MotionDOMComponent as any)\n ;(ForwardRefMotionComponent as any)[motionComponentSymbol] = Component\n\n return ForwardRefMotionComponent as MotionComponent\n}\n\nfunction useLayoutId({ layoutId }: MotionProps) {\n const layoutGroupId = useContext(LayoutGroupContext).id\n return layoutGroupId && layoutId !== undefined\n ? layoutGroupId + \"-\" + layoutId\n : layoutId\n}\n\nfunction useStrictMode(\n configAndProps: MotionProps,\n preloadedFeatures?: FeaturePackages\n) {\n const isStrict = useContext(LazyContext).strict\n\n /**\n * If we're in development mode, check to make sure we're not rendering a motion component\n * as a child of LazyMotion, as this will break the file-size benefits of using it.\n */\n if (\n process.env.NODE_ENV !== \"production\" &&\n preloadedFeatures &&\n isStrict\n ) {\n const strictMessage =\n \"You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.\"\n configAndProps.ignoreStrict\n ? warning(false, strictMessage, \"lazy-strict-mode\")\n : invariant(false, strictMessage, \"lazy-strict-mode\")\n }\n}\n\nfunction getProjectionFunctionality(props: MotionProps) {\n const featureDefinitions = getInitializedFeatureDefinitions()\n const { drag, layout } = featureDefinitions\n\n if (!drag && !layout) return {}\n\n const combined = { ...drag, ...layout }\n\n return {\n MeasureLayout:\n drag?.isEnabled(props) || layout?.isEnabled(props)\n ? combined.MeasureLayout\n : undefined,\n ProjectionNode: combined.ProjectionNode,\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AA6DA;;;;;;;;AAQG;;AAUC;AAEA;;;;AAIG;AACH;;AAGA;AAII;;;AAGG;AACH;AAEA;;AAEI;AACA;;AAGJ;AAEA;;;AAKI;AAEA;AACA;AAEA;;;;;AAKG;AACH;;AAUJ;;;AAGG;AACH;;AAyBJ;AAEQ;AACA;AAGR;AACE;AAEF;AACJ;AAEA;;AAEI;AACI;;AAER;AAEA;;AAMI;;;AAGG;AACH;;AAGI;;AAIA;;;;AAIR;AAEA;AACI;AACA;AAEA;AAAsB;;;AAKlB;;AAGQ;;;AAGhB;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/motion/utils/is-motion-component.mjs b/node_modules/framer-motion/dist/es/motion/utils/is-motion-component.mjs deleted file mode 100644 index 3d73809..0000000 --- a/node_modules/framer-motion/dist/es/motion/utils/is-motion-component.mjs +++ /dev/null @@ -1,13 +0,0 @@ -import { motionComponentSymbol } from './symbol.mjs'; - -/** - * Checks if a component is a `motion` component. - */ -function isMotionComponent(component) { - return (component !== null && - typeof component === "object" && - motionComponentSymbol in component); -} - -export { isMotionComponent }; -//# sourceMappingURL=is-motion-component.mjs.map diff --git a/node_modules/framer-motion/dist/es/motion/utils/is-motion-component.mjs.map b/node_modules/framer-motion/dist/es/motion/utils/is-motion-component.mjs.map deleted file mode 100644 index 02cdc74..0000000 --- a/node_modules/framer-motion/dist/es/motion/utils/is-motion-component.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"is-motion-component.mjs","sources":["../../../../src/motion/utils/is-motion-component.ts"],"sourcesContent":["import { motionComponentSymbol } from \"./symbol\"\n\n/**\n * Checks if a component is a `motion` component.\n */\nexport function isMotionComponent(component: React.ComponentType | string) {\n return (\n component !== null &&\n typeof component === \"object\" &&\n motionComponentSymbol in component\n )\n}\n"],"names":[],"mappings":";;AAEA;;AAEG;AACG,SAAU,iBAAiB,CAAC,SAAuC,EAAA;IACrE,QACI,SAAS,KAAK,IAAI;QAClB,OAAO,SAAS,KAAK,QAAQ;QAC7B,qBAAqB,IAAI,SAAS;AAE1C;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/motion/utils/symbol.mjs b/node_modules/framer-motion/dist/es/motion/utils/symbol.mjs deleted file mode 100644 index afeb9bb..0000000 --- a/node_modules/framer-motion/dist/es/motion/utils/symbol.mjs +++ /dev/null @@ -1,4 +0,0 @@ -const motionComponentSymbol = Symbol.for("motionComponentSymbol"); - -export { motionComponentSymbol }; -//# sourceMappingURL=symbol.mjs.map diff --git a/node_modules/framer-motion/dist/es/motion/utils/symbol.mjs.map b/node_modules/framer-motion/dist/es/motion/utils/symbol.mjs.map deleted file mode 100644 index 84be6e0..0000000 --- a/node_modules/framer-motion/dist/es/motion/utils/symbol.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"symbol.mjs","sources":["../../../../src/motion/utils/symbol.ts"],"sourcesContent":["export const motionComponentSymbol = Symbol.for(\"motionComponentSymbol\")\n"],"names":[],"mappings":"AAAO,MAAM,qBAAqB,GAAG,MAAM,CAAC,GAAG,CAAC,uBAAuB;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/motion/utils/unwrap-motion-component.mjs b/node_modules/framer-motion/dist/es/motion/utils/unwrap-motion-component.mjs deleted file mode 100644 index b76a668..0000000 --- a/node_modules/framer-motion/dist/es/motion/utils/unwrap-motion-component.mjs +++ /dev/null @@ -1,18 +0,0 @@ -import { isMotionComponent } from './is-motion-component.mjs'; -import { motionComponentSymbol } from './symbol.mjs'; - -/** - * Unwraps a `motion` component and returns either a string for `motion.div` or - * the React component for `motion(Component)`. - * - * If the component is not a `motion` component it returns undefined. - */ -function unwrapMotionComponent(component) { - if (isMotionComponent(component)) { - return component[motionComponentSymbol]; - } - return undefined; -} - -export { unwrapMotionComponent }; -//# sourceMappingURL=unwrap-motion-component.mjs.map diff --git a/node_modules/framer-motion/dist/es/motion/utils/unwrap-motion-component.mjs.map b/node_modules/framer-motion/dist/es/motion/utils/unwrap-motion-component.mjs.map deleted file mode 100644 index 55c1556..0000000 --- a/node_modules/framer-motion/dist/es/motion/utils/unwrap-motion-component.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"unwrap-motion-component.mjs","sources":["../../../../src/motion/utils/unwrap-motion-component.ts"],"sourcesContent":["import { isMotionComponent } from \"./is-motion-component\"\nimport { motionComponentSymbol } from \"./symbol\"\n\n/**\n * Unwraps a `motion` component and returns either a string for `motion.div` or\n * the React component for `motion(Component)`.\n *\n * If the component is not a `motion` component it returns undefined.\n */\nexport function unwrapMotionComponent(\n component: React.ComponentType | string\n): React.ComponentType | string | undefined {\n if (isMotionComponent(component)) {\n return component[motionComponentSymbol as keyof typeof component]\n }\n\n return undefined\n}\n"],"names":[],"mappings":";;;AAGA;;;;;AAKG;AACG,SAAU,qBAAqB,CACjC,SAAuC,EAAA;AAEvC,IAAA,IAAI,iBAAiB,CAAC,SAAS,CAAC,EAAE;AAC9B,QAAA,OAAO,SAAS,CAAC,qBAA+C,CAAC;IACrE;AAEA,IAAA,OAAO,SAAS;AACpB;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.mjs b/node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.mjs deleted file mode 100644 index 595f011..0000000 --- a/node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.mjs +++ /dev/null @@ -1,52 +0,0 @@ -"use client"; -import { useRef, useInsertionEffect, useCallback } from 'react'; - -/** - * Creates a ref function that, when called, hydrates the provided - * external ref and VisualElement. - */ -function useMotionRef(visualState, visualElement, externalRef) { - /** - * Store externalRef in a ref to avoid including it in the useCallback - * dependency array. Including externalRef in dependencies causes issues - * with libraries like Radix UI that create new callback refs on each render - * when using asChild - this would cause the callback to be recreated, - * triggering element remounts and breaking AnimatePresence exit animations. - */ - const externalRefContainer = useRef(externalRef); - useInsertionEffect(() => { - externalRefContainer.current = externalRef; - }); - // Store cleanup function returned by callback refs (React 19 feature) - const refCleanup = useRef(null); - return useCallback((instance) => { - if (instance) { - visualState.onMount?.(instance); - } - if (visualElement) { - instance ? visualElement.mount(instance) : visualElement.unmount(); - } - const ref = externalRefContainer.current; - if (typeof ref === "function") { - if (instance) { - const cleanup = ref(instance); - if (typeof cleanup === "function") { - refCleanup.current = cleanup; - } - } - else if (refCleanup.current) { - refCleanup.current(); - refCleanup.current = null; - } - else { - ref(instance); - } - } - else if (ref) { - ref.current = instance; - } - }, [visualElement]); -} - -export { useMotionRef }; -//# sourceMappingURL=use-motion-ref.mjs.map diff --git a/node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.mjs.map b/node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.mjs.map deleted file mode 100644 index 029a602..0000000 --- a/node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"use-motion-ref.mjs","sources":["../../../../src/motion/utils/use-motion-ref.ts"],"sourcesContent":["\"use client\"\n\nimport type { VisualElement } from \"motion-dom\"\nimport * as React from \"react\"\nimport { useCallback, useInsertionEffect, useRef } from \"react\"\nimport { VisualState } from \"./use-visual-state\"\n\n/**\n * Creates a ref function that, when called, hydrates the provided\n * external ref and VisualElement.\n */\nexport function useMotionRef(\n visualState: VisualState,\n visualElement?: VisualElement | null,\n externalRef?: React.Ref\n): React.Ref {\n /**\n * Store externalRef in a ref to avoid including it in the useCallback\n * dependency array. Including externalRef in dependencies causes issues\n * with libraries like Radix UI that create new callback refs on each render\n * when using asChild - this would cause the callback to be recreated,\n * triggering element remounts and breaking AnimatePresence exit animations.\n */\n const externalRefContainer = useRef(externalRef)\n useInsertionEffect(() => {\n externalRefContainer.current = externalRef\n })\n\n // Store cleanup function returned by callback refs (React 19 feature)\n const refCleanup = useRef<(() => void) | null>(null)\n\n return useCallback(\n (instance: Instance) => {\n if (instance) {\n visualState.onMount?.(instance)\n }\n\n if (visualElement) {\n instance ? visualElement.mount(instance) : visualElement.unmount()\n }\n\n const ref = externalRefContainer.current\n if (typeof ref === \"function\") {\n if (instance) {\n const cleanup = ref(instance)\n if (typeof cleanup === \"function\") {\n refCleanup.current = cleanup\n }\n } else if (refCleanup.current) {\n refCleanup.current()\n refCleanup.current = null\n } else {\n ref(instance)\n }\n } else if (ref) {\n ;(ref as React.MutableRefObject).current = instance\n }\n },\n [visualElement]\n )\n}\n"],"names":[],"mappings":";;;AAOA;;;AAGG;;AAMC;;;;;;AAMG;AACH;;AAEI;AACJ;;AAGA;AAEA;;AAGY;;;AAIA;;AAGJ;AACA;;AAEQ;AACA;AACI;;;AAED;;AAEH;;;;;;;AAKF;;AAEV;AAGR;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/motion/utils/use-visual-element.mjs b/node_modules/framer-motion/dist/es/motion/utils/use-visual-element.mjs deleted file mode 100644 index 317f7cc..0000000 --- a/node_modules/framer-motion/dist/es/motion/utils/use-visual-element.mjs +++ /dev/null @@ -1,166 +0,0 @@ -"use client"; -import { optimizedAppearDataAttribute } from 'motion-dom'; -import { useContext, useRef, useInsertionEffect, useEffect } from 'react'; -import { LazyContext } from '../../context/LazyContext.mjs'; -import { MotionConfigContext } from '../../context/MotionConfigContext.mjs'; -import { MotionContext } from '../../context/MotionContext/index.mjs'; -import { PresenceContext } from '../../context/PresenceContext.mjs'; -import { SwitchLayoutGroupContext } from '../../context/SwitchLayoutGroupContext.mjs'; -import { isRefObject } from '../../utils/is-ref-object.mjs'; -import { useIsomorphicLayoutEffect } from '../../utils/use-isomorphic-effect.mjs'; - -function useVisualElement(Component, visualState, props, createVisualElement, ProjectionNodeConstructor, isSVG) { - const { visualElement: parent } = useContext(MotionContext); - const lazyContext = useContext(LazyContext); - const presenceContext = useContext(PresenceContext); - const motionConfig = useContext(MotionConfigContext); - const reducedMotionConfig = motionConfig.reducedMotion; - const skipAnimations = motionConfig.skipAnimations; - const visualElementRef = useRef(null); - /** - * Track whether the component has been through React's commit phase. - * Used to detect when LazyMotion features load after the component has mounted. - */ - const hasMountedOnce = useRef(false); - /** - * If we haven't preloaded a renderer, check to see if we have one lazy-loaded - */ - createVisualElement = - createVisualElement || - lazyContext.renderer; - if (!visualElementRef.current && createVisualElement) { - visualElementRef.current = createVisualElement(Component, { - visualState, - parent, - props, - presenceContext, - blockInitialAnimation: presenceContext - ? presenceContext.initial === false - : false, - reducedMotionConfig, - skipAnimations, - isSVG, - }); - /** - * If the component has already mounted before features loaded (e.g. via - * LazyMotion with async feature loading), we need to force the initial - * animation to run. Otherwise state changes that occurred before features - * loaded will be lost and the element will snap to its final state. - */ - if (hasMountedOnce.current && visualElementRef.current) { - visualElementRef.current.manuallyAnimateOnMount = true; - } - } - const visualElement = visualElementRef.current; - /** - * Load Motion gesture and animation features. These are rendered as renderless - * components so each feature can optionally make use of React lifecycle methods. - */ - const initialLayoutGroupConfig = useContext(SwitchLayoutGroupContext); - if (visualElement && - !visualElement.projection && - ProjectionNodeConstructor && - (visualElement.type === "html" || visualElement.type === "svg")) { - createProjectionNode(visualElementRef.current, props, ProjectionNodeConstructor, initialLayoutGroupConfig); - } - const isMounted = useRef(false); - useInsertionEffect(() => { - /** - * Check the component has already mounted before calling - * `update` unnecessarily. This ensures we skip the initial update. - */ - if (visualElement && isMounted.current) { - visualElement.update(props, presenceContext); - } - }); - /** - * Cache this value as we want to know whether HandoffAppearAnimations - * was present on initial render - it will be deleted after this. - */ - const optimisedAppearId = props[optimizedAppearDataAttribute]; - const wantsHandoff = useRef(Boolean(optimisedAppearId) && - typeof window !== "undefined" && - !window.MotionHandoffIsComplete?.(optimisedAppearId) && - window.MotionHasOptimisedAnimation?.(optimisedAppearId)); - useIsomorphicLayoutEffect(() => { - /** - * Track that this component has mounted. This is used to detect when - * LazyMotion features load after the component has already committed. - */ - hasMountedOnce.current = true; - if (!visualElement) - return; - isMounted.current = true; - window.MotionIsMounted = true; - visualElement.updateFeatures(); - visualElement.scheduleRenderMicrotask(); - /** - * Ideally this function would always run in a useEffect. - * - * However, if we have optimised appear animations to handoff from, - * it needs to happen synchronously to ensure there's no flash of - * incorrect styles in the event of a hydration error. - * - * So if we detect a situtation where optimised appear animations - * are running, we use useLayoutEffect to trigger animations. - */ - if (wantsHandoff.current && visualElement.animationState) { - visualElement.animationState.animateChanges(); - } - }); - useEffect(() => { - if (!visualElement) - return; - if (!wantsHandoff.current && visualElement.animationState) { - visualElement.animationState.animateChanges(); - } - if (wantsHandoff.current) { - // This ensures all future calls to animateChanges() in this component will run in useEffect - queueMicrotask(() => { - window.MotionHandoffMarkAsComplete?.(optimisedAppearId); - }); - wantsHandoff.current = false; - } - /** - * Now we've finished triggering animations for this element we - * can wipe the enteringChildren set for the next render. - */ - visualElement.enteringChildren = undefined; - }); - return visualElement; -} -function createProjectionNode(visualElement, props, ProjectionNodeConstructor, initialPromotionConfig) { - const { layoutId, layout, drag, dragConstraints, layoutScroll, layoutRoot, layoutAnchor, layoutCrossfade, } = props; - visualElement.projection = new ProjectionNodeConstructor(visualElement.latestValues, props["data-framer-portal-id"] - ? undefined - : getClosestProjectingNode(visualElement.parent)); - visualElement.projection.setOptions({ - layoutId, - layout, - alwaysMeasureLayout: Boolean(drag) || (dragConstraints && isRefObject(dragConstraints)), - visualElement, - /** - * TODO: Update options in an effect. This could be tricky as it'll be too late - * to update by the time layout animations run. - * We also need to fix this safeToRemove by linking it up to the one returned by usePresence, - * ensuring it gets called if there's no potential layout animations. - * - */ - animationType: typeof layout === "string" ? layout : "both", - initialPromotionConfig, - crossfade: layoutCrossfade, - layoutScroll, - layoutRoot, - layoutAnchor, - }); -} -function getClosestProjectingNode(visualElement) { - if (!visualElement) - return undefined; - return visualElement.options.allowProjection !== false - ? visualElement.projection - : getClosestProjectingNode(visualElement.parent); -} - -export { useVisualElement }; -//# sourceMappingURL=use-visual-element.mjs.map diff --git a/node_modules/framer-motion/dist/es/motion/utils/use-visual-element.mjs.map b/node_modules/framer-motion/dist/es/motion/utils/use-visual-element.mjs.map deleted file mode 100644 index e5fa364..0000000 --- a/node_modules/framer-motion/dist/es/motion/utils/use-visual-element.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"use-visual-element.mjs","sources":["../../../../src/motion/utils/use-visual-element.ts"],"sourcesContent":["\"use client\"\n\nimport {\n optimizedAppearDataAttribute,\n type HTMLRenderState,\n type SVGRenderState,\n type VisualElement,\n} from \"motion-dom\"\nimport * as React from \"react\"\nimport { useContext, useEffect, useInsertionEffect, useRef } from \"react\"\nimport { LazyContext } from \"../../context/LazyContext\"\nimport { MotionConfigContext } from \"../../context/MotionConfigContext\"\nimport { MotionContext } from \"../../context/MotionContext\"\nimport { PresenceContext } from \"../../context/PresenceContext\"\nimport {\n InitialPromotionConfig,\n SwitchLayoutGroupContext,\n} from \"../../context/SwitchLayoutGroupContext\"\nimport { MotionProps } from \"../../motion/types\"\nimport type { IProjectionNode } from \"motion-dom\"\nimport { DOMMotionComponents } from \"../../render/dom/types\"\nimport { CreateVisualElement } from \"../../render/types\"\nimport { isRefObject } from \"../../utils/is-ref-object\"\nimport { useIsomorphicLayoutEffect } from \"../../utils/use-isomorphic-effect\"\nimport { VisualState } from \"./use-visual-state\"\n\nexport function useVisualElement<\n Props,\n TagName extends keyof DOMMotionComponents | string\n>(\n Component: TagName | string | React.ComponentType,\n visualState:\n | VisualState\n | VisualState,\n props: MotionProps & Partial,\n createVisualElement?: CreateVisualElement,\n ProjectionNodeConstructor?: any,\n isSVG?: boolean\n): VisualElement | undefined {\n const { visualElement: parent } = useContext(MotionContext)\n const lazyContext = useContext(LazyContext)\n const presenceContext = useContext(PresenceContext)\n const motionConfig = useContext(MotionConfigContext)\n const reducedMotionConfig = motionConfig.reducedMotion\n const skipAnimations = motionConfig.skipAnimations\n\n const visualElementRef = useRef | null>(null)\n\n /**\n * Track whether the component has been through React's commit phase.\n * Used to detect when LazyMotion features load after the component has mounted.\n */\n const hasMountedOnce = useRef(false)\n\n /**\n * If we haven't preloaded a renderer, check to see if we have one lazy-loaded\n */\n createVisualElement =\n createVisualElement ||\n (lazyContext.renderer as CreateVisualElement)\n\n if (!visualElementRef.current && createVisualElement) {\n visualElementRef.current = createVisualElement(Component, {\n visualState,\n parent,\n props,\n presenceContext,\n blockInitialAnimation: presenceContext\n ? presenceContext.initial === false\n : false,\n reducedMotionConfig,\n skipAnimations,\n isSVG,\n })\n\n /**\n * If the component has already mounted before features loaded (e.g. via\n * LazyMotion with async feature loading), we need to force the initial\n * animation to run. Otherwise state changes that occurred before features\n * loaded will be lost and the element will snap to its final state.\n */\n if (hasMountedOnce.current && visualElementRef.current) {\n visualElementRef.current.manuallyAnimateOnMount = true\n }\n }\n\n const visualElement = visualElementRef.current\n\n /**\n * Load Motion gesture and animation features. These are rendered as renderless\n * components so each feature can optionally make use of React lifecycle methods.\n */\n const initialLayoutGroupConfig = useContext(SwitchLayoutGroupContext)\n\n if (\n visualElement &&\n !visualElement.projection &&\n ProjectionNodeConstructor &&\n (visualElement.type === \"html\" || visualElement.type === \"svg\")\n ) {\n createProjectionNode(\n visualElementRef.current!,\n props,\n ProjectionNodeConstructor,\n initialLayoutGroupConfig\n )\n }\n\n const isMounted = useRef(false)\n useInsertionEffect(() => {\n /**\n * Check the component has already mounted before calling\n * `update` unnecessarily. This ensures we skip the initial update.\n */\n if (visualElement && isMounted.current) {\n visualElement.update(props, presenceContext)\n }\n })\n\n /**\n * Cache this value as we want to know whether HandoffAppearAnimations\n * was present on initial render - it will be deleted after this.\n */\n const optimisedAppearId =\n props[optimizedAppearDataAttribute as keyof typeof props]\n const wantsHandoff = useRef(\n Boolean(optimisedAppearId) &&\n typeof window !== \"undefined\" &&\n !window.MotionHandoffIsComplete?.(optimisedAppearId) &&\n window.MotionHasOptimisedAnimation?.(optimisedAppearId)\n )\n\n useIsomorphicLayoutEffect(() => {\n /**\n * Track that this component has mounted. This is used to detect when\n * LazyMotion features load after the component has already committed.\n */\n hasMountedOnce.current = true\n\n if (!visualElement) return\n\n isMounted.current = true\n window.MotionIsMounted = true\n\n visualElement.updateFeatures()\n visualElement.scheduleRenderMicrotask()\n\n /**\n * Ideally this function would always run in a useEffect.\n *\n * However, if we have optimised appear animations to handoff from,\n * it needs to happen synchronously to ensure there's no flash of\n * incorrect styles in the event of a hydration error.\n *\n * So if we detect a situtation where optimised appear animations\n * are running, we use useLayoutEffect to trigger animations.\n */\n if (wantsHandoff.current && visualElement.animationState) {\n visualElement.animationState.animateChanges()\n }\n })\n\n useEffect(() => {\n if (!visualElement) return\n\n if (!wantsHandoff.current && visualElement.animationState) {\n visualElement.animationState.animateChanges()\n }\n\n if (wantsHandoff.current) {\n // This ensures all future calls to animateChanges() in this component will run in useEffect\n queueMicrotask(() => {\n window.MotionHandoffMarkAsComplete?.(optimisedAppearId)\n })\n\n wantsHandoff.current = false\n }\n\n /**\n * Now we've finished triggering animations for this element we\n * can wipe the enteringChildren set for the next render.\n */\n visualElement.enteringChildren = undefined\n })\n\n return visualElement!\n}\n\nfunction createProjectionNode(\n visualElement: VisualElement,\n props: MotionProps,\n ProjectionNodeConstructor: any,\n initialPromotionConfig?: InitialPromotionConfig\n) {\n const {\n layoutId,\n layout,\n drag,\n dragConstraints,\n layoutScroll,\n layoutRoot,\n layoutAnchor,\n layoutCrossfade,\n } = props\n\n visualElement.projection = new ProjectionNodeConstructor(\n visualElement.latestValues,\n props[\"data-framer-portal-id\"]\n ? undefined\n : getClosestProjectingNode(visualElement.parent)\n ) as IProjectionNode\n\n visualElement.projection.setOptions({\n layoutId,\n layout,\n alwaysMeasureLayout:\n Boolean(drag) || (dragConstraints && isRefObject(dragConstraints)),\n visualElement,\n /**\n * TODO: Update options in an effect. This could be tricky as it'll be too late\n * to update by the time layout animations run.\n * We also need to fix this safeToRemove by linking it up to the one returned by usePresence,\n * ensuring it gets called if there's no potential layout animations.\n *\n */\n animationType: typeof layout === \"string\" ? layout : \"both\",\n initialPromotionConfig,\n crossfade: layoutCrossfade,\n layoutScroll,\n layoutRoot,\n layoutAnchor,\n })\n}\n\nfunction getClosestProjectingNode(\n visualElement?: VisualElement<\n unknown,\n unknown,\n { allowProjection?: boolean }\n >\n): IProjectionNode | undefined {\n if (!visualElement) return undefined\n\n return visualElement.options.allowProjection !== false\n ? visualElement.projection\n : getClosestProjectingNode(visualElement.parent)\n}\n"],"names":[],"mappings":";;;;;;;;;;;AA0BM;;AAcF;AACA;AACA;AACA;AACA;AAEA;AAIA;;;AAGG;AACH;AAEA;;AAEG;;;;AAKH;AACI;;;;;AAKI;AACI;AACA;;;;AAIP;AAED;;;;;AAKG;;AAEC;;;AAIR;AAEA;;;AAGG;AACH;AAEA;;;AAII;;;AAUJ;;AAEI;;;AAGG;AACH;AACI;;AAER;AAEA;;;AAGG;AACH;AAEA;;AAGQ;AACA;;AAIJ;;;AAGG;AACH;AAEA;;AAEA;AACA;;;AAKA;;;;;;;;;AASG;;AAEC;;AAER;;AAGI;;;AAGI;;AAGJ;;;AAGQ;AACJ;AAEA;;AAGJ;;;AAGG;AACH;AACJ;AAEA;AACJ;AAEA;AAMI;AAWA;AAGQ;;AAIR;;;AAGI;;AAGA;;;;;;AAMG;AACH;;AAEA;;;;AAIH;AACL;AAEA;AAOI;AAAoB;AAEpB;;AAEI;AACR;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/motion/utils/use-visual-state.mjs b/node_modules/framer-motion/dist/es/motion/utils/use-visual-state.mjs deleted file mode 100644 index 433af58..0000000 --- a/node_modules/framer-motion/dist/es/motion/utils/use-visual-state.mjs +++ /dev/null @@ -1,78 +0,0 @@ -"use client"; -import { resolveMotionValue, isControllingVariants, isVariantNode, isAnimationControls, resolveVariantFromProps } from 'motion-dom'; -import { useContext } from 'react'; -import { MotionContext } from '../../context/MotionContext/index.mjs'; -import { PresenceContext } from '../../context/PresenceContext.mjs'; -import { useConstant } from '../../utils/use-constant.mjs'; - -function makeState({ scrapeMotionValuesFromProps, createRenderState, }, props, context, presenceContext) { - const state = { - latestValues: makeLatestValues(props, context, presenceContext, scrapeMotionValuesFromProps), - renderState: createRenderState(), - }; - return state; -} -function makeLatestValues(props, context, presenceContext, scrapeMotionValues) { - const values = {}; - const motionValues = scrapeMotionValues(props, {}); - for (const key in motionValues) { - values[key] = resolveMotionValue(motionValues[key]); - } - let { initial, animate } = props; - const isControllingVariants$1 = isControllingVariants(props); - const isVariantNode$1 = isVariantNode(props); - if (context && - isVariantNode$1 && - !isControllingVariants$1 && - props.inherit !== false) { - if (initial === undefined) - initial = context.initial; - if (animate === undefined) - animate = context.animate; - } - let isInitialAnimationBlocked = presenceContext - ? presenceContext.initial === false - : false; - isInitialAnimationBlocked = isInitialAnimationBlocked || initial === false; - const variantToSet = isInitialAnimationBlocked ? animate : initial; - if (variantToSet && - typeof variantToSet !== "boolean" && - !isAnimationControls(variantToSet)) { - const list = Array.isArray(variantToSet) ? variantToSet : [variantToSet]; - for (let i = 0; i < list.length; i++) { - const resolved = resolveVariantFromProps(props, list[i]); - if (resolved) { - const { transitionEnd, transition, ...target } = resolved; - for (const key in target) { - let valueTarget = target[key]; - if (Array.isArray(valueTarget)) { - /** - * Take final keyframe if the initial animation is blocked because - * we want to initialise at the end of that blocked animation. - */ - const index = isInitialAnimationBlocked - ? valueTarget.length - 1 - : 0; - valueTarget = valueTarget[index]; - } - if (valueTarget !== null) { - values[key] = valueTarget; - } - } - for (const key in transitionEnd) { - values[key] = transitionEnd[key]; - } - } - } - } - return values; -} -const makeUseVisualState = (config) => (props, isStatic) => { - const context = useContext(MotionContext); - const presenceContext = useContext(PresenceContext); - const make = () => makeState(config, props, context, presenceContext); - return isStatic ? make() : useConstant(make); -}; - -export { makeUseVisualState }; -//# sourceMappingURL=use-visual-state.mjs.map diff --git a/node_modules/framer-motion/dist/es/motion/utils/use-visual-state.mjs.map b/node_modules/framer-motion/dist/es/motion/utils/use-visual-state.mjs.map deleted file mode 100644 index bca2c6d..0000000 --- a/node_modules/framer-motion/dist/es/motion/utils/use-visual-state.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"use-visual-state.mjs","sources":["../../../../src/motion/utils/use-visual-state.ts"],"sourcesContent":["\"use client\"\n\nimport {\n AnyResolvedKeyframe,\n isAnimationControls,\n isControllingVariants as checkIsControllingVariants,\n isVariantNode as checkIsVariantNode,\n ResolvedValues,\n resolveVariantFromProps,\n} from \"motion-dom\"\nimport { useContext } from \"react\"\nimport { MotionContext, MotionContextProps } from \"../../context/MotionContext\"\nimport {\n PresenceContext,\n type PresenceContextProps,\n} from \"../../context/PresenceContext\"\nimport { ScrapeMotionValuesFromProps } from \"../../render/types\"\nimport { useConstant } from \"../../utils/use-constant\"\nimport { resolveMotionValue } from \"motion-dom\"\nimport { MotionProps } from \"../types\"\n\nexport interface VisualState {\n renderState: RenderState\n latestValues: ResolvedValues\n onMount?: (instance: Instance) => void\n}\n\nexport type UseVisualState = (\n props: MotionProps,\n isStatic: boolean\n) => VisualState\n\nexport interface UseVisualStateConfig {\n scrapeMotionValuesFromProps: ScrapeMotionValuesFromProps\n createRenderState: () => RenderState\n}\n\nfunction makeState(\n {\n scrapeMotionValuesFromProps,\n createRenderState,\n }: UseVisualStateConfig,\n props: MotionProps,\n context: MotionContextProps,\n presenceContext: PresenceContextProps | null\n) {\n const state: VisualState = {\n latestValues: makeLatestValues(\n props,\n context,\n presenceContext,\n scrapeMotionValuesFromProps\n ),\n renderState: createRenderState(),\n }\n\n return state\n}\n\nfunction makeLatestValues(\n props: MotionProps,\n context: MotionContextProps,\n presenceContext: PresenceContextProps | null,\n scrapeMotionValues: ScrapeMotionValuesFromProps\n) {\n const values: ResolvedValues = {}\n\n const motionValues = scrapeMotionValues(props, {})\n for (const key in motionValues) {\n values[key] = resolveMotionValue(motionValues[key])\n }\n\n let { initial, animate } = props\n const isControllingVariants = checkIsControllingVariants(props)\n const isVariantNode = checkIsVariantNode(props)\n\n if (\n context &&\n isVariantNode &&\n !isControllingVariants &&\n props.inherit !== false\n ) {\n if (initial === undefined) initial = context.initial\n if (animate === undefined) animate = context.animate\n }\n\n let isInitialAnimationBlocked = presenceContext\n ? presenceContext.initial === false\n : false\n isInitialAnimationBlocked = isInitialAnimationBlocked || initial === false\n\n const variantToSet = isInitialAnimationBlocked ? animate : initial\n\n if (\n variantToSet &&\n typeof variantToSet !== \"boolean\" &&\n !isAnimationControls(variantToSet)\n ) {\n const list = Array.isArray(variantToSet) ? variantToSet : [variantToSet]\n for (let i = 0; i < list.length; i++) {\n const resolved = resolveVariantFromProps(props, list[i] as any)\n if (resolved) {\n const { transitionEnd, transition, ...target } = resolved\n for (const key in target) {\n let valueTarget = target[key as keyof typeof target]\n\n if (Array.isArray(valueTarget)) {\n /**\n * Take final keyframe if the initial animation is blocked because\n * we want to initialise at the end of that blocked animation.\n */\n const index = isInitialAnimationBlocked\n ? valueTarget.length - 1\n : 0\n valueTarget = valueTarget[index] as any\n }\n\n if (valueTarget !== null) {\n values[key] = valueTarget as AnyResolvedKeyframe\n }\n }\n for (const key in transitionEnd) {\n values[key] = transitionEnd[\n key as keyof typeof transitionEnd\n ] as AnyResolvedKeyframe\n }\n }\n }\n }\n\n return values\n}\n\nexport const makeUseVisualState =\n (config: UseVisualStateConfig): UseVisualState =>\n (props: MotionProps, isStatic: boolean): VisualState => {\n const context = useContext(MotionContext)\n const presenceContext = useContext(PresenceContext)\n const make = () => makeState(config, props, context, presenceContext)\n\n return isStatic ? make() : useConstant(make)\n }\n"],"names":[],"mappings":";;;;;;;AAqCA;AASI;;;;AAUA;AACJ;AAEA;;;AASI;;;AAIA;AACA;AACA;AAEA;;AAGI;AACA;;AAE2B;;AACA;;;AAI3B;;AAEJ;;AAIA;;AAGI;AAEA;AACA;;;;AAIQ;AACI;AAEA;AACI;;;AAGG;;AAEC;;AAEJ;;AAGJ;AACI;;;AAGR;;;;;;AASZ;AACJ;AAEO;AAGC;AACA;AACA;AAEA;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/motion/utils/valid-prop.mjs b/node_modules/framer-motion/dist/es/motion/utils/valid-prop.mjs deleted file mode 100644 index e4c52d6..0000000 --- a/node_modules/framer-motion/dist/es/motion/utils/valid-prop.mjs +++ /dev/null @@ -1,59 +0,0 @@ -/** - * A list of all valid MotionProps. - * - * @privateRemarks - * This doesn't throw if a `MotionProp` name is missing - it should. - */ -const validMotionProps = new Set([ - "animate", - "exit", - "variants", - "initial", - "style", - "values", - "variants", - "transition", - "transformTemplate", - "custom", - "inherit", - "onBeforeLayoutMeasure", - "onAnimationStart", - "onAnimationComplete", - "onUpdate", - "onDragStart", - "onDrag", - "onDragEnd", - "onMeasureDragConstraints", - "onDirectionLock", - "onDragTransitionEnd", - "_dragX", - "_dragY", - "onHoverStart", - "onHoverEnd", - "onViewportEnter", - "onViewportLeave", - "globalTapTarget", - "propagate", - "ignoreStrict", - "viewport", -]); -/** - * Check whether a prop name is a valid `MotionProp` key. - * - * @param key - Name of the property to check - * @returns `true` is key is a valid `MotionProp`. - * - * @public - */ -function isValidMotionProp(key) { - return (key.startsWith("while") || - (key.startsWith("drag") && key !== "draggable") || - key.startsWith("layout") || - key.startsWith("onTap") || - key.startsWith("onPan") || - key.startsWith("onLayout") || - validMotionProps.has(key)); -} - -export { isValidMotionProp }; -//# sourceMappingURL=valid-prop.mjs.map diff --git a/node_modules/framer-motion/dist/es/motion/utils/valid-prop.mjs.map b/node_modules/framer-motion/dist/es/motion/utils/valid-prop.mjs.map deleted file mode 100644 index 0d7bdd0..0000000 --- a/node_modules/framer-motion/dist/es/motion/utils/valid-prop.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"valid-prop.mjs","sources":["../../../../src/motion/utils/valid-prop.ts"],"sourcesContent":["import { MotionProps } from \"../types\"\n\n/**\n * A list of all valid MotionProps.\n *\n * @privateRemarks\n * This doesn't throw if a `MotionProp` name is missing - it should.\n */\nconst validMotionProps = new Set([\n \"animate\",\n \"exit\",\n \"variants\",\n \"initial\",\n \"style\",\n \"values\",\n \"variants\",\n \"transition\",\n \"transformTemplate\",\n \"custom\",\n \"inherit\",\n \"onBeforeLayoutMeasure\",\n \"onAnimationStart\",\n \"onAnimationComplete\",\n \"onUpdate\",\n \"onDragStart\",\n \"onDrag\",\n \"onDragEnd\",\n \"onMeasureDragConstraints\",\n \"onDirectionLock\",\n \"onDragTransitionEnd\",\n \"_dragX\",\n \"_dragY\",\n \"onHoverStart\",\n \"onHoverEnd\",\n \"onViewportEnter\",\n \"onViewportLeave\",\n \"globalTapTarget\",\n \"propagate\",\n \"ignoreStrict\",\n \"viewport\",\n])\n\n/**\n * Check whether a prop name is a valid `MotionProp` key.\n *\n * @param key - Name of the property to check\n * @returns `true` is key is a valid `MotionProp`.\n *\n * @public\n */\nexport function isValidMotionProp(key: string) {\n return (\n key.startsWith(\"while\") ||\n (key.startsWith(\"drag\") && key !== \"draggable\") ||\n key.startsWith(\"layout\") ||\n key.startsWith(\"onTap\") ||\n key.startsWith(\"onPan\") ||\n key.startsWith(\"onLayout\") ||\n validMotionProps.has(key as keyof MotionProps)\n )\n}\n"],"names":[],"mappings":"AAEA;;;;;AAKG;AACH,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAoB;IAChD,SAAS;IACT,MAAM;IACN,UAAU;IACV,SAAS;IACT,OAAO;IACP,QAAQ;IACR,UAAU;IACV,YAAY;IACZ,mBAAmB;IACnB,QAAQ;IACR,SAAS;IACT,uBAAuB;IACvB,kBAAkB;IAClB,qBAAqB;IACrB,UAAU;IACV,aAAa;IACb,QAAQ;IACR,WAAW;IACX,0BAA0B;IAC1B,iBAAiB;IACjB,qBAAqB;IACrB,QAAQ;IACR,QAAQ;IACR,cAAc;IACd,YAAY;IACZ,iBAAiB;IACjB,iBAAiB;IACjB,iBAAiB;IACjB,WAAW;IACX,cAAc;IACd,UAAU;AACb,CAAA,CAAC;AAEF;;;;;;;AAOG;AACG,SAAU,iBAAiB,CAAC,GAAW,EAAA;AACzC,IAAA,QACI,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC;SACtB,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,GAAG,KAAK,WAAW,CAAC;AAC/C,QAAA,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC;AACxB,QAAA,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC;AACvB,QAAA,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC;AACvB,QAAA,GAAG,CAAC,UAAU,CAAC,UAAU,CAAC;AAC1B,QAAA,gBAAgB,CAAC,GAAG,CAAC,GAAwB,CAAC;AAEtD;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/projection.mjs b/node_modules/framer-motion/dist/es/projection.mjs deleted file mode 100644 index 902c523..0000000 --- a/node_modules/framer-motion/dist/es/projection.mjs +++ /dev/null @@ -1,2 +0,0 @@ -export { HTMLProjectionNode, HTMLVisualElement, addScaleCorrector, buildTransform, calcBoxDelta, correctBorderRadius, correctBoxShadow, frame, frameData, mix, nodeGroup, recordStats, statsBuffer } from 'motion-dom'; -//# sourceMappingURL=projection.mjs.map diff --git a/node_modules/framer-motion/dist/es/projection.mjs.map b/node_modules/framer-motion/dist/es/projection.mjs.map deleted file mode 100644 index 2f608b0..0000000 --- a/node_modules/framer-motion/dist/es/projection.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"projection.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/projection/use-instant-layout-transition.mjs b/node_modules/framer-motion/dist/es/projection/use-instant-layout-transition.mjs deleted file mode 100644 index 914d498..0000000 --- a/node_modules/framer-motion/dist/es/projection/use-instant-layout-transition.mjs +++ /dev/null @@ -1,15 +0,0 @@ -import { rootProjectionNode } from 'motion-dom'; - -function useInstantLayoutTransition() { - return startTransition; -} -function startTransition(callback) { - if (!rootProjectionNode.current) - return; - rootProjectionNode.current.isUpdating = false; - rootProjectionNode.current.blockUpdate(); - callback && callback(); -} - -export { useInstantLayoutTransition }; -//# sourceMappingURL=use-instant-layout-transition.mjs.map diff --git a/node_modules/framer-motion/dist/es/projection/use-instant-layout-transition.mjs.map b/node_modules/framer-motion/dist/es/projection/use-instant-layout-transition.mjs.map deleted file mode 100644 index 4186a7d..0000000 --- a/node_modules/framer-motion/dist/es/projection/use-instant-layout-transition.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"use-instant-layout-transition.mjs","sources":["../../../src/projection/use-instant-layout-transition.ts"],"sourcesContent":["import { rootProjectionNode } from \"motion-dom\"\n\nexport function useInstantLayoutTransition(): (\n cb?: (() => void) | undefined\n) => void {\n return startTransition\n}\n\nfunction startTransition(callback?: () => void) {\n if (!rootProjectionNode.current) return\n rootProjectionNode.current.isUpdating = false\n rootProjectionNode.current.blockUpdate()\n callback && callback()\n}\n"],"names":[],"mappings":";;SAEgB,0BAA0B,GAAA;AAGtC,IAAA,OAAO,eAAe;AAC1B;AAEA,SAAS,eAAe,CAAC,QAAqB,EAAA;IAC1C,IAAI,CAAC,kBAAkB,CAAC,OAAO;QAAE;AACjC,IAAA,kBAAkB,CAAC,OAAO,CAAC,UAAU,GAAG,KAAK;AAC7C,IAAA,kBAAkB,CAAC,OAAO,CAAC,WAAW,EAAE;IACxC,QAAQ,IAAI,QAAQ,EAAE;AAC1B;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/projection/use-reset-projection.mjs b/node_modules/framer-motion/dist/es/projection/use-reset-projection.mjs deleted file mode 100644 index 4ef3e87..0000000 --- a/node_modules/framer-motion/dist/es/projection/use-reset-projection.mjs +++ /dev/null @@ -1,15 +0,0 @@ -import { useCallback } from 'react'; -import { rootProjectionNode } from 'motion-dom'; - -function useResetProjection() { - const reset = useCallback(() => { - const root = rootProjectionNode.current; - if (!root) - return; - root.resetTree(); - }, []); - return reset; -} - -export { useResetProjection }; -//# sourceMappingURL=use-reset-projection.mjs.map diff --git a/node_modules/framer-motion/dist/es/projection/use-reset-projection.mjs.map b/node_modules/framer-motion/dist/es/projection/use-reset-projection.mjs.map deleted file mode 100644 index 9e26d99..0000000 --- a/node_modules/framer-motion/dist/es/projection/use-reset-projection.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"use-reset-projection.mjs","sources":["../../../src/projection/use-reset-projection.ts"],"sourcesContent":["import { useCallback } from \"react\";\nimport { rootProjectionNode } from \"motion-dom\"\n\nexport function useResetProjection() {\n const reset = useCallback(() => {\n const root = rootProjectionNode.current\n if (!root) return\n root.resetTree()\n }, [])\n\n return reset\n}\n"],"names":[],"mappings":";;;SAGgB,kBAAkB,GAAA;AAC9B,IAAA,MAAM,KAAK,GAAG,WAAW,CAAC,MAAK;AAC3B,QAAA,MAAM,IAAI,GAAG,kBAAkB,CAAC,OAAO;AACvC,QAAA,IAAI,CAAC,IAAI;YAAE;QACX,IAAI,CAAC,SAAS,EAAE;IACpB,CAAC,EAAE,EAAE,CAAC;AAEN,IAAA,OAAO,KAAK;AAChB;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/components/create-proxy.mjs b/node_modules/framer-motion/dist/es/render/components/create-proxy.mjs deleted file mode 100644 index 5252bc2..0000000 --- a/node_modules/framer-motion/dist/es/render/components/create-proxy.mjs +++ /dev/null @@ -1,46 +0,0 @@ -import { warnOnce } from 'motion-utils'; -import { createMotionComponent } from '../../motion/index.mjs'; - -function createMotionProxy(preloadedFeatures, createVisualElement) { - if (typeof Proxy === "undefined") { - return createMotionComponent; - } - /** - * A cache of generated `motion` components, e.g `motion.div`, `motion.input` etc. - * Rather than generating them anew every render. - */ - const componentCache = new Map(); - const factory = (Component, options) => { - return createMotionComponent(Component, options, preloadedFeatures, createVisualElement); - }; - /** - * Support for deprecated`motion(Component)` pattern - */ - const deprecatedFactoryFunction = (Component, options) => { - if (process.env.NODE_ENV !== "production") { - warnOnce(false, "motion() is deprecated. Use motion.create() instead."); - } - return factory(Component, options); - }; - return new Proxy(deprecatedFactoryFunction, { - /** - * Called when `motion` is referenced with a prop: `motion.div`, `motion.input` etc. - * The prop name is passed through as `key` and we can use that to generate a `motion` - * DOM component with that name. - */ - get: (_target, key) => { - if (key === "create") - return factory; - /** - * If this element doesn't exist in the component cache, create it and cache. - */ - if (!componentCache.has(key)) { - componentCache.set(key, createMotionComponent(key, undefined, preloadedFeatures, createVisualElement)); - } - return componentCache.get(key); - }, - }); -} - -export { createMotionProxy }; -//# sourceMappingURL=create-proxy.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/components/create-proxy.mjs.map b/node_modules/framer-motion/dist/es/render/components/create-proxy.mjs.map deleted file mode 100644 index c220c4d..0000000 --- a/node_modules/framer-motion/dist/es/render/components/create-proxy.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"create-proxy.mjs","sources":["../../../../src/render/components/create-proxy.ts"],"sourcesContent":["import { warnOnce } from \"motion-utils\"\nimport { createMotionComponent, MotionComponentOptions } from \"../../motion\"\nimport { FeaturePackages } from \"../../motion/features/types\"\nimport { MotionProps } from \"../../motion/types\"\nimport { DOMMotionComponents } from \"../dom/types\"\nimport { CreateVisualElement } from \"../types\"\n\n/**\n * I'd rather the return type of `custom` to be implicit but this throws\n * incorrect relative paths in the exported types and API Extractor throws\n * a wobbly.\n */\ntype ComponentProps = React.PropsWithoutRef &\n React.RefAttributes\nexport type CustomDomComponent = React.ComponentType<\n ComponentProps\n>\n\ntype MotionProxy = typeof createMotionComponent &\n DOMMotionComponents & { create: typeof createMotionComponent }\n\nexport function createMotionProxy(\n preloadedFeatures?: FeaturePackages,\n createVisualElement?: CreateVisualElement\n): MotionProxy {\n if (typeof Proxy === \"undefined\") {\n return createMotionComponent as MotionProxy\n }\n\n /**\n * A cache of generated `motion` components, e.g `motion.div`, `motion.input` etc.\n * Rather than generating them anew every render.\n */\n const componentCache = new Map()\n\n const factory = (Component: string, options?: MotionComponentOptions) => {\n return createMotionComponent(\n Component,\n options,\n preloadedFeatures,\n createVisualElement\n )\n }\n\n /**\n * Support for deprecated`motion(Component)` pattern\n */\n const deprecatedFactoryFunction = (\n Component: string,\n options?: MotionComponentOptions\n ) => {\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(\n false,\n \"motion() is deprecated. Use motion.create() instead.\"\n )\n }\n return factory(Component, options)\n }\n\n return new Proxy(deprecatedFactoryFunction, {\n /**\n * Called when `motion` is referenced with a prop: `motion.div`, `motion.input` etc.\n * The prop name is passed through as `key` and we can use that to generate a `motion`\n * DOM component with that name.\n */\n get: (_target, key: string) => {\n if (key === \"create\") return factory\n\n /**\n * If this element doesn't exist in the component cache, create it and cache.\n */\n if (!componentCache.has(key)) {\n componentCache.set(\n key,\n createMotionComponent(\n key,\n undefined,\n preloadedFeatures,\n createVisualElement\n )\n )\n }\n\n return componentCache.get(key)!\n },\n }) as MotionProxy\n}\n"],"names":[],"mappings":";;;AAqBM,SAAU,iBAAiB,CAC7B,iBAAmC,EACnC,mBAAmD,EAAA;AAEnD,IAAA,IAAI,OAAO,KAAK,KAAK,WAAW,EAAE;AAC9B,QAAA,OAAO,qBAAoC;IAC/C;AAEA;;;AAGG;AACH,IAAA,MAAM,cAAc,GAAG,IAAI,GAAG,EAAe;AAE7C,IAAA,MAAM,OAAO,GAAG,CAAC,SAAiB,EAAE,OAAgC,KAAI;QACpE,OAAO,qBAAqB,CACxB,SAAS,EACT,OAAO,EACP,iBAAiB,EACjB,mBAAmB,CACtB;AACL,IAAA,CAAC;AAED;;AAEG;AACH,IAAA,MAAM,yBAAyB,GAAG,CAC9B,SAAiB,EACjB,OAAgC,KAChC;QACA,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE;AACvC,YAAA,QAAQ,CACJ,KAAK,EACL,sDAAsD,CACzD;QACL;AACA,QAAA,OAAO,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC;AACtC,IAAA,CAAC;AAED,IAAA,OAAO,IAAI,KAAK,CAAC,yBAAyB,EAAE;AACxC;;;;AAIG;AACH,QAAA,GAAG,EAAE,CAAC,OAAO,EAAE,GAAW,KAAI;YAC1B,IAAI,GAAG,KAAK,QAAQ;AAAE,gBAAA,OAAO,OAAO;AAEpC;;AAEG;YACH,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;AAC1B,gBAAA,cAAc,CAAC,GAAG,CACd,GAAG,EACH,qBAAqB,CACjB,GAAG,EACH,SAAS,EACT,iBAAiB,EACjB,mBAAmB,CACtB,CACJ;YACL;AAEA,YAAA,OAAO,cAAc,CAAC,GAAG,CAAC,GAAG,CAAE;QACnC,CAAC;AACJ,KAAA,CAAgB;AACrB;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/components/m/create.mjs b/node_modules/framer-motion/dist/es/render/components/m/create.mjs deleted file mode 100644 index 48a923c..0000000 --- a/node_modules/framer-motion/dist/es/render/components/m/create.mjs +++ /dev/null @@ -1,8 +0,0 @@ -import { createMotionComponent } from '../../../motion/index.mjs'; - -function createMinimalMotionComponent(Component, options) { - return createMotionComponent(Component, options); -} - -export { createMinimalMotionComponent }; -//# sourceMappingURL=create.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/components/m/create.mjs.map b/node_modules/framer-motion/dist/es/render/components/m/create.mjs.map deleted file mode 100644 index 8c46836..0000000 --- a/node_modules/framer-motion/dist/es/render/components/m/create.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"create.mjs","sources":["../../../../../src/render/components/m/create.ts"],"sourcesContent":["import { createMotionComponent, MotionComponentOptions } from \"../../../motion\"\nimport { DOMMotionComponents } from \"../../dom/types\"\n\nexport function createMinimalMotionComponent<\n Props,\n TagName extends keyof DOMMotionComponents | string = \"div\"\n>(\n Component: TagName | string | React.ComponentType,\n options?: MotionComponentOptions\n) {\n return createMotionComponent(Component, options)\n}\n"],"names":[],"mappings":";;AAGM,SAAU,4BAA4B,CAIxC,SAAwD,EACxD,OAAgC,EAAA;AAEhC,IAAA,OAAO,qBAAqB,CAAC,SAAS,EAAE,OAAO,CAAC;AACpD;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/components/m/elements.mjs b/node_modules/framer-motion/dist/es/render/components/m/elements.mjs deleted file mode 100644 index 7f37fed..0000000 --- a/node_modules/framer-motion/dist/es/render/components/m/elements.mjs +++ /dev/null @@ -1,228 +0,0 @@ -"use client"; -import { createMinimalMotionComponent } from './create.mjs'; - -/** - * HTML components - */ -const MotionA = /*@__PURE__*/ createMinimalMotionComponent("a"); -const MotionAbbr = /*@__PURE__*/ createMinimalMotionComponent("abbr"); -const MotionAddress = -/*@__PURE__*/ createMinimalMotionComponent("address"); -const MotionArea = /*@__PURE__*/ createMinimalMotionComponent("area"); -const MotionArticle = -/*@__PURE__*/ createMinimalMotionComponent("article"); -const MotionAside = /*@__PURE__*/ createMinimalMotionComponent("aside"); -const MotionAudio = /*@__PURE__*/ createMinimalMotionComponent("audio"); -const MotionB = /*@__PURE__*/ createMinimalMotionComponent("b"); -const MotionBase = /*@__PURE__*/ createMinimalMotionComponent("base"); -const MotionBdi = /*@__PURE__*/ createMinimalMotionComponent("bdi"); -const MotionBdo = /*@__PURE__*/ createMinimalMotionComponent("bdo"); -const MotionBig = /*@__PURE__*/ createMinimalMotionComponent("big"); -const MotionBlockquote = -/*@__PURE__*/ createMinimalMotionComponent("blockquote"); -const MotionBody = /*@__PURE__*/ createMinimalMotionComponent("body"); -const MotionButton = /*@__PURE__*/ createMinimalMotionComponent("button"); -const MotionCanvas = /*@__PURE__*/ createMinimalMotionComponent("canvas"); -const MotionCaption = -/*@__PURE__*/ createMinimalMotionComponent("caption"); -const MotionCite = /*@__PURE__*/ createMinimalMotionComponent("cite"); -const MotionCode = /*@__PURE__*/ createMinimalMotionComponent("code"); -const MotionCol = /*@__PURE__*/ createMinimalMotionComponent("col"); -const MotionColgroup = -/*@__PURE__*/ createMinimalMotionComponent("colgroup"); -const MotionData = /*@__PURE__*/ createMinimalMotionComponent("data"); -const MotionDatalist = -/*@__PURE__*/ createMinimalMotionComponent("datalist"); -const MotionDd = /*@__PURE__*/ createMinimalMotionComponent("dd"); -const MotionDel = /*@__PURE__*/ createMinimalMotionComponent("del"); -const MotionDetails = -/*@__PURE__*/ createMinimalMotionComponent("details"); -const MotionDfn = /*@__PURE__*/ createMinimalMotionComponent("dfn"); -const MotionDialog = /*@__PURE__*/ createMinimalMotionComponent("dialog"); -const MotionDiv = /*@__PURE__*/ createMinimalMotionComponent("div"); -const MotionDl = /*@__PURE__*/ createMinimalMotionComponent("dl"); -const MotionDt = /*@__PURE__*/ createMinimalMotionComponent("dt"); -const MotionEm = /*@__PURE__*/ createMinimalMotionComponent("em"); -const MotionEmbed = /*@__PURE__*/ createMinimalMotionComponent("embed"); -const MotionFieldset = -/*@__PURE__*/ createMinimalMotionComponent("fieldset"); -const MotionFigcaption = -/*@__PURE__*/ createMinimalMotionComponent("figcaption"); -const MotionFigure = /*@__PURE__*/ createMinimalMotionComponent("figure"); -const MotionFooter = /*@__PURE__*/ createMinimalMotionComponent("footer"); -const MotionForm = /*@__PURE__*/ createMinimalMotionComponent("form"); -const MotionH1 = /*@__PURE__*/ createMinimalMotionComponent("h1"); -const MotionH2 = /*@__PURE__*/ createMinimalMotionComponent("h2"); -const MotionH3 = /*@__PURE__*/ createMinimalMotionComponent("h3"); -const MotionH4 = /*@__PURE__*/ createMinimalMotionComponent("h4"); -const MotionH5 = /*@__PURE__*/ createMinimalMotionComponent("h5"); -const MotionH6 = /*@__PURE__*/ createMinimalMotionComponent("h6"); -const MotionHead = /*@__PURE__*/ createMinimalMotionComponent("head"); -const MotionHeader = /*@__PURE__*/ createMinimalMotionComponent("header"); -const MotionHgroup = /*@__PURE__*/ createMinimalMotionComponent("hgroup"); -const MotionHr = /*@__PURE__*/ createMinimalMotionComponent("hr"); -const MotionHtml = /*@__PURE__*/ createMinimalMotionComponent("html"); -const MotionI = /*@__PURE__*/ createMinimalMotionComponent("i"); -const MotionIframe = /*@__PURE__*/ createMinimalMotionComponent("iframe"); -const MotionImg = /*@__PURE__*/ createMinimalMotionComponent("img"); -const MotionInput = /*@__PURE__*/ createMinimalMotionComponent("input"); -const MotionIns = /*@__PURE__*/ createMinimalMotionComponent("ins"); -const MotionKbd = /*@__PURE__*/ createMinimalMotionComponent("kbd"); -const MotionKeygen = /*@__PURE__*/ createMinimalMotionComponent("keygen"); -const MotionLabel = /*@__PURE__*/ createMinimalMotionComponent("label"); -const MotionLegend = /*@__PURE__*/ createMinimalMotionComponent("legend"); -const MotionLi = /*@__PURE__*/ createMinimalMotionComponent("li"); -const MotionLink = /*@__PURE__*/ createMinimalMotionComponent("link"); -const MotionMain = /*@__PURE__*/ createMinimalMotionComponent("main"); -const MotionMap = /*@__PURE__*/ createMinimalMotionComponent("map"); -const MotionMark = /*@__PURE__*/ createMinimalMotionComponent("mark"); -const MotionMenu = /*@__PURE__*/ createMinimalMotionComponent("menu"); -const MotionMenuitem = -/*@__PURE__*/ createMinimalMotionComponent("menuitem"); -const MotionMeter = /*@__PURE__*/ createMinimalMotionComponent("meter"); -const MotionNav = /*@__PURE__*/ createMinimalMotionComponent("nav"); -const MotionObject = /*@__PURE__*/ createMinimalMotionComponent("object"); -const MotionOl = /*@__PURE__*/ createMinimalMotionComponent("ol"); -const MotionOptgroup = -/*@__PURE__*/ createMinimalMotionComponent("optgroup"); -const MotionOption = /*@__PURE__*/ createMinimalMotionComponent("option"); -const MotionOutput = /*@__PURE__*/ createMinimalMotionComponent("output"); -const MotionP = /*@__PURE__*/ createMinimalMotionComponent("p"); -const MotionParam = /*@__PURE__*/ createMinimalMotionComponent("param"); -const MotionPicture = -/*@__PURE__*/ createMinimalMotionComponent("picture"); -const MotionPre = /*@__PURE__*/ createMinimalMotionComponent("pre"); -const MotionProgress = -/*@__PURE__*/ createMinimalMotionComponent("progress"); -const MotionQ = /*@__PURE__*/ createMinimalMotionComponent("q"); -const MotionRp = /*@__PURE__*/ createMinimalMotionComponent("rp"); -const MotionRt = /*@__PURE__*/ createMinimalMotionComponent("rt"); -const MotionRuby = /*@__PURE__*/ createMinimalMotionComponent("ruby"); -const MotionS = /*@__PURE__*/ createMinimalMotionComponent("s"); -const MotionSamp = /*@__PURE__*/ createMinimalMotionComponent("samp"); -const MotionScript = /*@__PURE__*/ createMinimalMotionComponent("script"); -const MotionSection = -/*@__PURE__*/ createMinimalMotionComponent("section"); -const MotionSelect = /*@__PURE__*/ createMinimalMotionComponent("select"); -const MotionSmall = /*@__PURE__*/ createMinimalMotionComponent("small"); -const MotionSource = /*@__PURE__*/ createMinimalMotionComponent("source"); -const MotionSpan = /*@__PURE__*/ createMinimalMotionComponent("span"); -const MotionStrong = /*@__PURE__*/ createMinimalMotionComponent("strong"); -const MotionStyle = /*@__PURE__*/ createMinimalMotionComponent("style"); -const MotionSub = /*@__PURE__*/ createMinimalMotionComponent("sub"); -const MotionSummary = -/*@__PURE__*/ createMinimalMotionComponent("summary"); -const MotionSup = /*@__PURE__*/ createMinimalMotionComponent("sup"); -const MotionTable = /*@__PURE__*/ createMinimalMotionComponent("table"); -const MotionTbody = /*@__PURE__*/ createMinimalMotionComponent("tbody"); -const MotionTd = /*@__PURE__*/ createMinimalMotionComponent("td"); -const MotionTextarea = -/*@__PURE__*/ createMinimalMotionComponent("textarea"); -const MotionTfoot = /*@__PURE__*/ createMinimalMotionComponent("tfoot"); -const MotionTh = /*@__PURE__*/ createMinimalMotionComponent("th"); -const MotionThead = /*@__PURE__*/ createMinimalMotionComponent("thead"); -const MotionTime = /*@__PURE__*/ createMinimalMotionComponent("time"); -const MotionTitle = /*@__PURE__*/ createMinimalMotionComponent("title"); -const MotionTr = /*@__PURE__*/ createMinimalMotionComponent("tr"); -const MotionTrack = /*@__PURE__*/ createMinimalMotionComponent("track"); -const MotionU = /*@__PURE__*/ createMinimalMotionComponent("u"); -const MotionUl = /*@__PURE__*/ createMinimalMotionComponent("ul"); -const MotionVideo = /*@__PURE__*/ createMinimalMotionComponent("video"); -const MotionWbr = /*@__PURE__*/ createMinimalMotionComponent("wbr"); -const MotionWebview = -/*@__PURE__*/ createMinimalMotionComponent("webview"); -/** - * SVG components - */ -const MotionAnimate = -/*@__PURE__*/ createMinimalMotionComponent("animate"); -const MotionCircle = /*@__PURE__*/ createMinimalMotionComponent("circle"); -const MotionDefs = /*@__PURE__*/ createMinimalMotionComponent("defs"); -const MotionDesc = /*@__PURE__*/ createMinimalMotionComponent("desc"); -const MotionEllipse = -/*@__PURE__*/ createMinimalMotionComponent("ellipse"); -const MotionG = /*@__PURE__*/ createMinimalMotionComponent("g"); -const MotionImage = /*@__PURE__*/ createMinimalMotionComponent("image"); -const MotionLine = /*@__PURE__*/ createMinimalMotionComponent("line"); -const MotionFilter = /*@__PURE__*/ createMinimalMotionComponent("filter"); -const MotionMarker = /*@__PURE__*/ createMinimalMotionComponent("marker"); -const MotionMask = /*@__PURE__*/ createMinimalMotionComponent("mask"); -const MotionMetadata = -/*@__PURE__*/ createMinimalMotionComponent("metadata"); -const MotionPath = /*@__PURE__*/ createMinimalMotionComponent("path"); -const MotionPattern = -/*@__PURE__*/ createMinimalMotionComponent("pattern"); -const MotionPolygon = -/*@__PURE__*/ createMinimalMotionComponent("polygon"); -const MotionPolyline = -/*@__PURE__*/ createMinimalMotionComponent("polyline"); -const MotionRect = /*@__PURE__*/ createMinimalMotionComponent("rect"); -const MotionStop = /*@__PURE__*/ createMinimalMotionComponent("stop"); -const MotionSvg = /*@__PURE__*/ createMinimalMotionComponent("svg"); -const MotionSymbol = /*@__PURE__*/ createMinimalMotionComponent("symbol"); -const MotionText = /*@__PURE__*/ createMinimalMotionComponent("text"); -const MotionTspan = /*@__PURE__*/ createMinimalMotionComponent("tspan"); -const MotionUse = /*@__PURE__*/ createMinimalMotionComponent("use"); -const MotionView = /*@__PURE__*/ createMinimalMotionComponent("view"); -const MotionClipPath = -/*@__PURE__*/ createMinimalMotionComponent("clipPath"); -const MotionFeBlend = -/*@__PURE__*/ createMinimalMotionComponent("feBlend"); -const MotionFeColorMatrix = -/*@__PURE__*/ createMinimalMotionComponent("feColorMatrix"); -const MotionFeComponentTransfer = -/*@__PURE__*/ createMinimalMotionComponent("feComponentTransfer"); -const MotionFeComposite = -/*@__PURE__*/ createMinimalMotionComponent("feComposite"); -const MotionFeConvolveMatrix = -/*@__PURE__*/ createMinimalMotionComponent("feConvolveMatrix"); -const MotionFeDiffuseLighting = -/*@__PURE__*/ createMinimalMotionComponent("feDiffuseLighting"); -const MotionFeDisplacementMap = -/*@__PURE__*/ createMinimalMotionComponent("feDisplacementMap"); -const MotionFeDistantLight = -/*@__PURE__*/ createMinimalMotionComponent("feDistantLight"); -const MotionFeDropShadow = -/*@__PURE__*/ createMinimalMotionComponent("feDropShadow"); -const MotionFeFlood = -/*@__PURE__*/ createMinimalMotionComponent("feFlood"); -const MotionFeFuncA = -/*@__PURE__*/ createMinimalMotionComponent("feFuncA"); -const MotionFeFuncB = -/*@__PURE__*/ createMinimalMotionComponent("feFuncB"); -const MotionFeFuncG = -/*@__PURE__*/ createMinimalMotionComponent("feFuncG"); -const MotionFeFuncR = -/*@__PURE__*/ createMinimalMotionComponent("feFuncR"); -const MotionFeGaussianBlur = -/*@__PURE__*/ createMinimalMotionComponent("feGaussianBlur"); -const MotionFeImage = -/*@__PURE__*/ createMinimalMotionComponent("feImage"); -const MotionFeMerge = -/*@__PURE__*/ createMinimalMotionComponent("feMerge"); -const MotionFeMergeNode = -/*@__PURE__*/ createMinimalMotionComponent("feMergeNode"); -const MotionFeMorphology = -/*@__PURE__*/ createMinimalMotionComponent("feMorphology"); -const MotionFeOffset = -/*@__PURE__*/ createMinimalMotionComponent("feOffset"); -const MotionFePointLight = -/*@__PURE__*/ createMinimalMotionComponent("fePointLight"); -const MotionFeSpecularLighting = -/*@__PURE__*/ createMinimalMotionComponent("feSpecularLighting"); -const MotionFeSpotLight = -/*@__PURE__*/ createMinimalMotionComponent("feSpotLight"); -const MotionFeTile = /*@__PURE__*/ createMinimalMotionComponent("feTile"); -const MotionFeTurbulence = -/*@__PURE__*/ createMinimalMotionComponent("feTurbulence"); -const MotionForeignObject = -/*@__PURE__*/ createMinimalMotionComponent("foreignObject"); -const MotionLinearGradient = -/*@__PURE__*/ createMinimalMotionComponent("linearGradient"); -const MotionRadialGradient = -/*@__PURE__*/ createMinimalMotionComponent("radialGradient"); -const MotionTextPath = -/*@__PURE__*/ createMinimalMotionComponent("textPath"); - -export { MotionA, MotionAbbr, MotionAddress, MotionAnimate, MotionArea, MotionArticle, MotionAside, MotionAudio, MotionB, MotionBase, MotionBdi, MotionBdo, MotionBig, MotionBlockquote, MotionBody, MotionButton, MotionCanvas, MotionCaption, MotionCircle, MotionCite, MotionClipPath, MotionCode, MotionCol, MotionColgroup, MotionData, MotionDatalist, MotionDd, MotionDefs, MotionDel, MotionDesc, MotionDetails, MotionDfn, MotionDialog, MotionDiv, MotionDl, MotionDt, MotionEllipse, MotionEm, MotionEmbed, MotionFeBlend, MotionFeColorMatrix, MotionFeComponentTransfer, MotionFeComposite, MotionFeConvolveMatrix, MotionFeDiffuseLighting, MotionFeDisplacementMap, MotionFeDistantLight, MotionFeDropShadow, MotionFeFlood, MotionFeFuncA, MotionFeFuncB, MotionFeFuncG, MotionFeFuncR, MotionFeGaussianBlur, MotionFeImage, MotionFeMerge, MotionFeMergeNode, MotionFeMorphology, MotionFeOffset, MotionFePointLight, MotionFeSpecularLighting, MotionFeSpotLight, MotionFeTile, MotionFeTurbulence, MotionFieldset, MotionFigcaption, MotionFigure, MotionFilter, MotionFooter, MotionForeignObject, MotionForm, MotionG, MotionH1, MotionH2, MotionH3, MotionH4, MotionH5, MotionH6, MotionHead, MotionHeader, MotionHgroup, MotionHr, MotionHtml, MotionI, MotionIframe, MotionImage, MotionImg, MotionInput, MotionIns, MotionKbd, MotionKeygen, MotionLabel, MotionLegend, MotionLi, MotionLine, MotionLinearGradient, MotionLink, MotionMain, MotionMap, MotionMark, MotionMarker, MotionMask, MotionMenu, MotionMenuitem, MotionMetadata, MotionMeter, MotionNav, MotionObject, MotionOl, MotionOptgroup, MotionOption, MotionOutput, MotionP, MotionParam, MotionPath, MotionPattern, MotionPicture, MotionPolygon, MotionPolyline, MotionPre, MotionProgress, MotionQ, MotionRadialGradient, MotionRect, MotionRp, MotionRt, MotionRuby, MotionS, MotionSamp, MotionScript, MotionSection, MotionSelect, MotionSmall, MotionSource, MotionSpan, MotionStop, MotionStrong, MotionStyle, MotionSub, MotionSummary, MotionSup, MotionSvg, MotionSymbol, MotionTable, MotionTbody, MotionTd, MotionText, MotionTextPath, MotionTextarea, MotionTfoot, MotionTh, MotionThead, MotionTime, MotionTitle, MotionTr, MotionTrack, MotionTspan, MotionU, MotionUl, MotionUse, MotionVideo, MotionView, MotionWbr, MotionWebview }; -//# sourceMappingURL=elements.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/components/m/elements.mjs.map b/node_modules/framer-motion/dist/es/render/components/m/elements.mjs.map deleted file mode 100644 index 59c7b46..0000000 --- a/node_modules/framer-motion/dist/es/render/components/m/elements.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"elements.mjs","sources":["../../../../../src/render/components/m/elements.ts"],"sourcesContent":["\"use client\"\n\nimport { createMinimalMotionComponent } from \"./create\"\n\n/**\n * HTML components\n */\nexport const MotionA = /*@__PURE__*/ createMinimalMotionComponent(\"a\")\nexport const MotionAbbr = /*@__PURE__*/ createMinimalMotionComponent(\"abbr\")\nexport const MotionAddress =\n /*@__PURE__*/ createMinimalMotionComponent(\"address\")\nexport const MotionArea = /*@__PURE__*/ createMinimalMotionComponent(\"area\")\nexport const MotionArticle =\n /*@__PURE__*/ createMinimalMotionComponent(\"article\")\nexport const MotionAside = /*@__PURE__*/ createMinimalMotionComponent(\"aside\")\nexport const MotionAudio = /*@__PURE__*/ createMinimalMotionComponent(\"audio\")\nexport const MotionB = /*@__PURE__*/ createMinimalMotionComponent(\"b\")\nexport const MotionBase = /*@__PURE__*/ createMinimalMotionComponent(\"base\")\nexport const MotionBdi = /*@__PURE__*/ createMinimalMotionComponent(\"bdi\")\nexport const MotionBdo = /*@__PURE__*/ createMinimalMotionComponent(\"bdo\")\nexport const MotionBig = /*@__PURE__*/ createMinimalMotionComponent(\"big\")\nexport const MotionBlockquote =\n /*@__PURE__*/ createMinimalMotionComponent(\"blockquote\")\nexport const MotionBody = /*@__PURE__*/ createMinimalMotionComponent(\"body\")\nexport const MotionButton = /*@__PURE__*/ createMinimalMotionComponent(\"button\")\nexport const MotionCanvas = /*@__PURE__*/ createMinimalMotionComponent(\"canvas\")\nexport const MotionCaption =\n /*@__PURE__*/ createMinimalMotionComponent(\"caption\")\nexport const MotionCite = /*@__PURE__*/ createMinimalMotionComponent(\"cite\")\nexport const MotionCode = /*@__PURE__*/ createMinimalMotionComponent(\"code\")\nexport const MotionCol = /*@__PURE__*/ createMinimalMotionComponent(\"col\")\nexport const MotionColgroup =\n /*@__PURE__*/ createMinimalMotionComponent(\"colgroup\")\nexport const MotionData = /*@__PURE__*/ createMinimalMotionComponent(\"data\")\nexport const MotionDatalist =\n /*@__PURE__*/ createMinimalMotionComponent(\"datalist\")\nexport const MotionDd = /*@__PURE__*/ createMinimalMotionComponent(\"dd\")\nexport const MotionDel = /*@__PURE__*/ createMinimalMotionComponent(\"del\")\nexport const MotionDetails =\n /*@__PURE__*/ createMinimalMotionComponent(\"details\")\nexport const MotionDfn = /*@__PURE__*/ createMinimalMotionComponent(\"dfn\")\nexport const MotionDialog = /*@__PURE__*/ createMinimalMotionComponent(\"dialog\")\nexport const MotionDiv = /*@__PURE__*/ createMinimalMotionComponent(\"div\")\nexport const MotionDl = /*@__PURE__*/ createMinimalMotionComponent(\"dl\")\nexport const MotionDt = /*@__PURE__*/ createMinimalMotionComponent(\"dt\")\nexport const MotionEm = /*@__PURE__*/ createMinimalMotionComponent(\"em\")\nexport const MotionEmbed = /*@__PURE__*/ createMinimalMotionComponent(\"embed\")\nexport const MotionFieldset =\n /*@__PURE__*/ createMinimalMotionComponent(\"fieldset\")\nexport const MotionFigcaption =\n /*@__PURE__*/ createMinimalMotionComponent(\"figcaption\")\nexport const MotionFigure = /*@__PURE__*/ createMinimalMotionComponent(\"figure\")\nexport const MotionFooter = /*@__PURE__*/ createMinimalMotionComponent(\"footer\")\nexport const MotionForm = /*@__PURE__*/ createMinimalMotionComponent(\"form\")\nexport const MotionH1 = /*@__PURE__*/ createMinimalMotionComponent(\"h1\")\nexport const MotionH2 = /*@__PURE__*/ createMinimalMotionComponent(\"h2\")\nexport const MotionH3 = /*@__PURE__*/ createMinimalMotionComponent(\"h3\")\nexport const MotionH4 = /*@__PURE__*/ createMinimalMotionComponent(\"h4\")\nexport const MotionH5 = /*@__PURE__*/ createMinimalMotionComponent(\"h5\")\nexport const MotionH6 = /*@__PURE__*/ createMinimalMotionComponent(\"h6\")\nexport const MotionHead = /*@__PURE__*/ createMinimalMotionComponent(\"head\")\nexport const MotionHeader = /*@__PURE__*/ createMinimalMotionComponent(\"header\")\nexport const MotionHgroup = /*@__PURE__*/ createMinimalMotionComponent(\"hgroup\")\nexport const MotionHr = /*@__PURE__*/ createMinimalMotionComponent(\"hr\")\nexport const MotionHtml = /*@__PURE__*/ createMinimalMotionComponent(\"html\")\nexport const MotionI = /*@__PURE__*/ createMinimalMotionComponent(\"i\")\nexport const MotionIframe = /*@__PURE__*/ createMinimalMotionComponent(\"iframe\")\nexport const MotionImg = /*@__PURE__*/ createMinimalMotionComponent(\"img\")\nexport const MotionInput = /*@__PURE__*/ createMinimalMotionComponent(\"input\")\nexport const MotionIns = /*@__PURE__*/ createMinimalMotionComponent(\"ins\")\nexport const MotionKbd = /*@__PURE__*/ createMinimalMotionComponent(\"kbd\")\nexport const MotionKeygen = /*@__PURE__*/ createMinimalMotionComponent(\"keygen\")\nexport const MotionLabel = /*@__PURE__*/ createMinimalMotionComponent(\"label\")\nexport const MotionLegend = /*@__PURE__*/ createMinimalMotionComponent(\"legend\")\nexport const MotionLi = /*@__PURE__*/ createMinimalMotionComponent(\"li\")\nexport const MotionLink = /*@__PURE__*/ createMinimalMotionComponent(\"link\")\nexport const MotionMain = /*@__PURE__*/ createMinimalMotionComponent(\"main\")\nexport const MotionMap = /*@__PURE__*/ createMinimalMotionComponent(\"map\")\nexport const MotionMark = /*@__PURE__*/ createMinimalMotionComponent(\"mark\")\nexport const MotionMenu = /*@__PURE__*/ createMinimalMotionComponent(\"menu\")\nexport const MotionMenuitem =\n /*@__PURE__*/ createMinimalMotionComponent(\"menuitem\")\nexport const MotionMeter = /*@__PURE__*/ createMinimalMotionComponent(\"meter\")\nexport const MotionNav = /*@__PURE__*/ createMinimalMotionComponent(\"nav\")\nexport const MotionObject = /*@__PURE__*/ createMinimalMotionComponent(\"object\")\nexport const MotionOl = /*@__PURE__*/ createMinimalMotionComponent(\"ol\")\nexport const MotionOptgroup =\n /*@__PURE__*/ createMinimalMotionComponent(\"optgroup\")\nexport const MotionOption = /*@__PURE__*/ createMinimalMotionComponent(\"option\")\nexport const MotionOutput = /*@__PURE__*/ createMinimalMotionComponent(\"output\")\nexport const MotionP = /*@__PURE__*/ createMinimalMotionComponent(\"p\")\nexport const MotionParam = /*@__PURE__*/ createMinimalMotionComponent(\"param\")\nexport const MotionPicture =\n /*@__PURE__*/ createMinimalMotionComponent(\"picture\")\nexport const MotionPre = /*@__PURE__*/ createMinimalMotionComponent(\"pre\")\nexport const MotionProgress =\n /*@__PURE__*/ createMinimalMotionComponent(\"progress\")\nexport const MotionQ = /*@__PURE__*/ createMinimalMotionComponent(\"q\")\nexport const MotionRp = /*@__PURE__*/ createMinimalMotionComponent(\"rp\")\nexport const MotionRt = /*@__PURE__*/ createMinimalMotionComponent(\"rt\")\nexport const MotionRuby = /*@__PURE__*/ createMinimalMotionComponent(\"ruby\")\nexport const MotionS = /*@__PURE__*/ createMinimalMotionComponent(\"s\")\nexport const MotionSamp = /*@__PURE__*/ createMinimalMotionComponent(\"samp\")\nexport const MotionScript = /*@__PURE__*/ createMinimalMotionComponent(\"script\")\nexport const MotionSection =\n /*@__PURE__*/ createMinimalMotionComponent(\"section\")\nexport const MotionSelect = /*@__PURE__*/ createMinimalMotionComponent(\"select\")\nexport const MotionSmall = /*@__PURE__*/ createMinimalMotionComponent(\"small\")\nexport const MotionSource = /*@__PURE__*/ createMinimalMotionComponent(\"source\")\nexport const MotionSpan = /*@__PURE__*/ createMinimalMotionComponent(\"span\")\nexport const MotionStrong = /*@__PURE__*/ createMinimalMotionComponent(\"strong\")\nexport const MotionStyle = /*@__PURE__*/ createMinimalMotionComponent(\"style\")\nexport const MotionSub = /*@__PURE__*/ createMinimalMotionComponent(\"sub\")\nexport const MotionSummary =\n /*@__PURE__*/ createMinimalMotionComponent(\"summary\")\nexport const MotionSup = /*@__PURE__*/ createMinimalMotionComponent(\"sup\")\nexport const MotionTable = /*@__PURE__*/ createMinimalMotionComponent(\"table\")\nexport const MotionTbody = /*@__PURE__*/ createMinimalMotionComponent(\"tbody\")\nexport const MotionTd = /*@__PURE__*/ createMinimalMotionComponent(\"td\")\nexport const MotionTextarea =\n /*@__PURE__*/ createMinimalMotionComponent(\"textarea\")\nexport const MotionTfoot = /*@__PURE__*/ createMinimalMotionComponent(\"tfoot\")\nexport const MotionTh = /*@__PURE__*/ createMinimalMotionComponent(\"th\")\nexport const MotionThead = /*@__PURE__*/ createMinimalMotionComponent(\"thead\")\nexport const MotionTime = /*@__PURE__*/ createMinimalMotionComponent(\"time\")\nexport const MotionTitle = /*@__PURE__*/ createMinimalMotionComponent(\"title\")\nexport const MotionTr = /*@__PURE__*/ createMinimalMotionComponent(\"tr\")\nexport const MotionTrack = /*@__PURE__*/ createMinimalMotionComponent(\"track\")\nexport const MotionU = /*@__PURE__*/ createMinimalMotionComponent(\"u\")\nexport const MotionUl = /*@__PURE__*/ createMinimalMotionComponent(\"ul\")\nexport const MotionVideo = /*@__PURE__*/ createMinimalMotionComponent(\"video\")\nexport const MotionWbr = /*@__PURE__*/ createMinimalMotionComponent(\"wbr\")\nexport const MotionWebview =\n /*@__PURE__*/ createMinimalMotionComponent(\"webview\")\n\n/**\n * SVG components\n */\nexport const MotionAnimate =\n /*@__PURE__*/ createMinimalMotionComponent(\"animate\")\nexport const MotionCircle = /*@__PURE__*/ createMinimalMotionComponent(\"circle\")\nexport const MotionDefs = /*@__PURE__*/ createMinimalMotionComponent(\"defs\")\nexport const MotionDesc = /*@__PURE__*/ createMinimalMotionComponent(\"desc\")\nexport const MotionEllipse =\n /*@__PURE__*/ createMinimalMotionComponent(\"ellipse\")\nexport const MotionG = /*@__PURE__*/ createMinimalMotionComponent(\"g\")\nexport const MotionImage = /*@__PURE__*/ createMinimalMotionComponent(\"image\")\nexport const MotionLine = /*@__PURE__*/ createMinimalMotionComponent(\"line\")\nexport const MotionFilter = /*@__PURE__*/ createMinimalMotionComponent(\"filter\")\nexport const MotionMarker = /*@__PURE__*/ createMinimalMotionComponent(\"marker\")\nexport const MotionMask = /*@__PURE__*/ createMinimalMotionComponent(\"mask\")\nexport const MotionMetadata =\n /*@__PURE__*/ createMinimalMotionComponent(\"metadata\")\nexport const MotionPath = /*@__PURE__*/ createMinimalMotionComponent(\"path\")\nexport const MotionPattern =\n /*@__PURE__*/ createMinimalMotionComponent(\"pattern\")\nexport const MotionPolygon =\n /*@__PURE__*/ createMinimalMotionComponent(\"polygon\")\nexport const MotionPolyline =\n /*@__PURE__*/ createMinimalMotionComponent(\"polyline\")\nexport const MotionRect = /*@__PURE__*/ createMinimalMotionComponent(\"rect\")\nexport const MotionStop = /*@__PURE__*/ createMinimalMotionComponent(\"stop\")\nexport const MotionSvg = /*@__PURE__*/ createMinimalMotionComponent(\"svg\")\nexport const MotionSymbol = /*@__PURE__*/ createMinimalMotionComponent(\"symbol\")\nexport const MotionText = /*@__PURE__*/ createMinimalMotionComponent(\"text\")\nexport const MotionTspan = /*@__PURE__*/ createMinimalMotionComponent(\"tspan\")\nexport const MotionUse = /*@__PURE__*/ createMinimalMotionComponent(\"use\")\nexport const MotionView = /*@__PURE__*/ createMinimalMotionComponent(\"view\")\nexport const MotionClipPath =\n /*@__PURE__*/ createMinimalMotionComponent(\"clipPath\")\nexport const MotionFeBlend =\n /*@__PURE__*/ createMinimalMotionComponent(\"feBlend\")\nexport const MotionFeColorMatrix =\n /*@__PURE__*/ createMinimalMotionComponent(\"feColorMatrix\")\nexport const MotionFeComponentTransfer =\n /*@__PURE__*/ createMinimalMotionComponent(\"feComponentTransfer\")\nexport const MotionFeComposite =\n /*@__PURE__*/ createMinimalMotionComponent(\"feComposite\")\nexport const MotionFeConvolveMatrix =\n /*@__PURE__*/ createMinimalMotionComponent(\"feConvolveMatrix\")\nexport const MotionFeDiffuseLighting =\n /*@__PURE__*/ createMinimalMotionComponent(\"feDiffuseLighting\")\nexport const MotionFeDisplacementMap =\n /*@__PURE__*/ createMinimalMotionComponent(\"feDisplacementMap\")\nexport const MotionFeDistantLight =\n /*@__PURE__*/ createMinimalMotionComponent(\"feDistantLight\")\nexport const MotionFeDropShadow =\n /*@__PURE__*/ createMinimalMotionComponent(\"feDropShadow\")\nexport const MotionFeFlood =\n /*@__PURE__*/ createMinimalMotionComponent(\"feFlood\")\nexport const MotionFeFuncA =\n /*@__PURE__*/ createMinimalMotionComponent(\"feFuncA\")\nexport const MotionFeFuncB =\n /*@__PURE__*/ createMinimalMotionComponent(\"feFuncB\")\nexport const MotionFeFuncG =\n /*@__PURE__*/ createMinimalMotionComponent(\"feFuncG\")\nexport const MotionFeFuncR =\n /*@__PURE__*/ createMinimalMotionComponent(\"feFuncR\")\nexport const MotionFeGaussianBlur =\n /*@__PURE__*/ createMinimalMotionComponent(\"feGaussianBlur\")\nexport const MotionFeImage =\n /*@__PURE__*/ createMinimalMotionComponent(\"feImage\")\nexport const MotionFeMerge =\n /*@__PURE__*/ createMinimalMotionComponent(\"feMerge\")\nexport const MotionFeMergeNode =\n /*@__PURE__*/ createMinimalMotionComponent(\"feMergeNode\")\nexport const MotionFeMorphology =\n /*@__PURE__*/ createMinimalMotionComponent(\"feMorphology\")\nexport const MotionFeOffset =\n /*@__PURE__*/ createMinimalMotionComponent(\"feOffset\")\nexport const MotionFePointLight =\n /*@__PURE__*/ createMinimalMotionComponent(\"fePointLight\")\nexport const MotionFeSpecularLighting =\n /*@__PURE__*/ createMinimalMotionComponent(\"feSpecularLighting\")\nexport const MotionFeSpotLight =\n /*@__PURE__*/ createMinimalMotionComponent(\"feSpotLight\")\nexport const MotionFeTile = /*@__PURE__*/ createMinimalMotionComponent(\"feTile\")\nexport const MotionFeTurbulence =\n /*@__PURE__*/ createMinimalMotionComponent(\"feTurbulence\")\nexport const MotionForeignObject =\n /*@__PURE__*/ createMinimalMotionComponent(\"foreignObject\")\nexport const MotionLinearGradient =\n /*@__PURE__*/ createMinimalMotionComponent(\"linearGradient\")\nexport const MotionRadialGradient =\n /*@__PURE__*/ createMinimalMotionComponent(\"radialGradient\")\nexport const MotionTextPath =\n /*@__PURE__*/ createMinimalMotionComponent(\"textPath\")\n"],"names":[],"mappings":";;;AAIA;;AAEG;AACI;AACA;;AAEH;AACG;;AAEH;AACG;AACA;AACA;AACA;AACA;AACA;AACA;;AAEH;AACG;AACA;AACA;;AAEH;AACG;AACA;AACA;;AAEH;AACG;;AAEH;AACG;AACA;;AAEH;AACG;AACA;AACA;AACA;AACA;AACA;AACA;;AAEH;;AAEA;AACG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEH;AACG;AACA;AACA;AACA;;AAEH;AACG;AACA;AACA;AACA;;AAEH;AACG;;AAEH;AACG;AACA;AACA;AACA;AACA;AACA;AACA;;AAEH;AACG;AACA;AACA;AACA;AACA;AACA;AACA;;AAEH;AACG;AACA;AACA;AACA;;AAEH;AACG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEH;AAEJ;;AAEG;;AAEC;AACG;AACA;AACA;;AAEH;AACG;AACA;AACA;AACA;AACA;AACA;;AAEH;AACG;;AAEH;;AAEA;;AAEA;AACG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEH;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACG;;AAEH;;AAEA;;AAEA;;AAEA;;AAEA;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/components/m/proxy.mjs b/node_modules/framer-motion/dist/es/render/components/m/proxy.mjs deleted file mode 100644 index 2de139e..0000000 --- a/node_modules/framer-motion/dist/es/render/components/m/proxy.mjs +++ /dev/null @@ -1,6 +0,0 @@ -import { createMotionProxy } from '../create-proxy.mjs'; - -const m = /*@__PURE__*/ createMotionProxy(); - -export { m }; -//# sourceMappingURL=proxy.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/components/m/proxy.mjs.map b/node_modules/framer-motion/dist/es/render/components/m/proxy.mjs.map deleted file mode 100644 index ce75105..0000000 --- a/node_modules/framer-motion/dist/es/render/components/m/proxy.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"proxy.mjs","sources":["../../../../../src/render/components/m/proxy.ts"],"sourcesContent":["import { createMotionProxy } from \"../create-proxy\"\n\nexport const m = /*@__PURE__*/ createMotionProxy()\n"],"names":[],"mappings":";;MAEa,CAAC,iBAAiB,iBAAiB;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/components/motion/create.mjs b/node_modules/framer-motion/dist/es/render/components/motion/create.mjs deleted file mode 100644 index b74f806..0000000 --- a/node_modules/framer-motion/dist/es/render/components/motion/create.mjs +++ /dev/null @@ -1,10 +0,0 @@ -import { createMotionComponent } from '../../../motion/index.mjs'; -import { createDomVisualElement } from '../../dom/create-visual-element.mjs'; -import { featureBundle } from './feature-bundle.mjs'; - -function createMotionComponentWithFeatures(Component, options) { - return createMotionComponent(Component, options, featureBundle, createDomVisualElement); -} - -export { createMotionComponentWithFeatures }; -//# sourceMappingURL=create.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/components/motion/create.mjs.map b/node_modules/framer-motion/dist/es/render/components/motion/create.mjs.map deleted file mode 100644 index ce872e9..0000000 --- a/node_modules/framer-motion/dist/es/render/components/motion/create.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"create.mjs","sources":["../../../../../src/render/components/motion/create.ts"],"sourcesContent":["import { createMotionComponent, MotionComponentOptions } from \"../../../motion\"\nimport { createDomVisualElement } from \"../../dom/create-visual-element\"\nimport { DOMMotionComponents } from \"../../dom/types\"\nimport { CreateVisualElement } from \"../../types\"\nimport { featureBundle } from \"./feature-bundle\"\n\nexport function createMotionComponentWithFeatures<\n Props,\n TagName extends keyof DOMMotionComponents | string = \"div\"\n>(\n Component: TagName | string | React.ComponentType,\n options?: MotionComponentOptions\n) {\n return createMotionComponent(\n Component,\n options,\n featureBundle,\n createDomVisualElement as CreateVisualElement\n )\n}\n"],"names":[],"mappings":";;;;AAMM,SAAU,iCAAiC,CAI7C,SAAwD,EACxD,OAAgC,EAAA;IAEhC,OAAO,qBAAqB,CACxB,SAAS,EACT,OAAO,EACP,aAAa,EACb,sBAA6D,CAChE;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/components/motion/elements.mjs b/node_modules/framer-motion/dist/es/render/components/motion/elements.mjs deleted file mode 100644 index 04dc762..0000000 --- a/node_modules/framer-motion/dist/es/render/components/motion/elements.mjs +++ /dev/null @@ -1,195 +0,0 @@ -"use client"; -import { createMotionComponentWithFeatures } from './create.mjs'; - -/** - * HTML components - */ -const MotionA = /*@__PURE__*/ createMotionComponentWithFeatures("a"); -const MotionAbbr = /*@__PURE__*/ createMotionComponentWithFeatures("abbr"); -const MotionAddress = /*@__PURE__*/ createMotionComponentWithFeatures("address"); -const MotionArea = /*@__PURE__*/ createMotionComponentWithFeatures("area"); -const MotionArticle = /*@__PURE__*/ createMotionComponentWithFeatures("article"); -const MotionAside = /*@__PURE__*/ createMotionComponentWithFeatures("aside"); -const MotionAudio = /*@__PURE__*/ createMotionComponentWithFeatures("audio"); -const MotionB = /*@__PURE__*/ createMotionComponentWithFeatures("b"); -const MotionBase = /*@__PURE__*/ createMotionComponentWithFeatures("base"); -const MotionBdi = /*@__PURE__*/ createMotionComponentWithFeatures("bdi"); -const MotionBdo = /*@__PURE__*/ createMotionComponentWithFeatures("bdo"); -const MotionBig = /*@__PURE__*/ createMotionComponentWithFeatures("big"); -const MotionBlockquote = -/*@__PURE__*/ createMotionComponentWithFeatures("blockquote"); -const MotionBody = /*@__PURE__*/ createMotionComponentWithFeatures("body"); -const MotionButton = /*@__PURE__*/ createMotionComponentWithFeatures("button"); -const MotionCanvas = /*@__PURE__*/ createMotionComponentWithFeatures("canvas"); -const MotionCaption = /*@__PURE__*/ createMotionComponentWithFeatures("caption"); -const MotionCite = /*@__PURE__*/ createMotionComponentWithFeatures("cite"); -const MotionCode = /*@__PURE__*/ createMotionComponentWithFeatures("code"); -const MotionCol = /*@__PURE__*/ createMotionComponentWithFeatures("col"); -const MotionColgroup = /*@__PURE__*/ createMotionComponentWithFeatures("colgroup"); -const MotionData = /*@__PURE__*/ createMotionComponentWithFeatures("data"); -const MotionDatalist = /*@__PURE__*/ createMotionComponentWithFeatures("datalist"); -const MotionDd = /*@__PURE__*/ createMotionComponentWithFeatures("dd"); -const MotionDel = /*@__PURE__*/ createMotionComponentWithFeatures("del"); -const MotionDetails = /*@__PURE__*/ createMotionComponentWithFeatures("details"); -const MotionDfn = /*@__PURE__*/ createMotionComponentWithFeatures("dfn"); -const MotionDialog = /*@__PURE__*/ createMotionComponentWithFeatures("dialog"); -const MotionDiv = /*@__PURE__*/ createMotionComponentWithFeatures("div"); -const MotionDl = /*@__PURE__*/ createMotionComponentWithFeatures("dl"); -const MotionDt = /*@__PURE__*/ createMotionComponentWithFeatures("dt"); -const MotionEm = /*@__PURE__*/ createMotionComponentWithFeatures("em"); -const MotionEmbed = /*@__PURE__*/ createMotionComponentWithFeatures("embed"); -const MotionFieldset = /*@__PURE__*/ createMotionComponentWithFeatures("fieldset"); -const MotionFigcaption = -/*@__PURE__*/ createMotionComponentWithFeatures("figcaption"); -const MotionFigure = /*@__PURE__*/ createMotionComponentWithFeatures("figure"); -const MotionFooter = /*@__PURE__*/ createMotionComponentWithFeatures("footer"); -const MotionForm = /*@__PURE__*/ createMotionComponentWithFeatures("form"); -const MotionH1 = /*@__PURE__*/ createMotionComponentWithFeatures("h1"); -const MotionH2 = /*@__PURE__*/ createMotionComponentWithFeatures("h2"); -const MotionH3 = /*@__PURE__*/ createMotionComponentWithFeatures("h3"); -const MotionH4 = /*@__PURE__*/ createMotionComponentWithFeatures("h4"); -const MotionH5 = /*@__PURE__*/ createMotionComponentWithFeatures("h5"); -const MotionH6 = /*@__PURE__*/ createMotionComponentWithFeatures("h6"); -const MotionHead = /*@__PURE__*/ createMotionComponentWithFeatures("head"); -const MotionHeader = /*@__PURE__*/ createMotionComponentWithFeatures("header"); -const MotionHgroup = /*@__PURE__*/ createMotionComponentWithFeatures("hgroup"); -const MotionHr = /*@__PURE__*/ createMotionComponentWithFeatures("hr"); -const MotionHtml = /*@__PURE__*/ createMotionComponentWithFeatures("html"); -const MotionI = /*@__PURE__*/ createMotionComponentWithFeatures("i"); -const MotionIframe = /*@__PURE__*/ createMotionComponentWithFeatures("iframe"); -const MotionImg = /*@__PURE__*/ createMotionComponentWithFeatures("img"); -const MotionInput = /*@__PURE__*/ createMotionComponentWithFeatures("input"); -const MotionIns = /*@__PURE__*/ createMotionComponentWithFeatures("ins"); -const MotionKbd = /*@__PURE__*/ createMotionComponentWithFeatures("kbd"); -const MotionKeygen = /*@__PURE__*/ createMotionComponentWithFeatures("keygen"); -const MotionLabel = /*@__PURE__*/ createMotionComponentWithFeatures("label"); -const MotionLegend = /*@__PURE__*/ createMotionComponentWithFeatures("legend"); -const MotionLi = /*@__PURE__*/ createMotionComponentWithFeatures("li"); -const MotionLink = /*@__PURE__*/ createMotionComponentWithFeatures("link"); -const MotionMain = /*@__PURE__*/ createMotionComponentWithFeatures("main"); -const MotionMap = /*@__PURE__*/ createMotionComponentWithFeatures("map"); -const MotionMark = /*@__PURE__*/ createMotionComponentWithFeatures("mark"); -const MotionMenu = /*@__PURE__*/ createMotionComponentWithFeatures("menu"); -const MotionMenuitem = /*@__PURE__*/ createMotionComponentWithFeatures("menuitem"); -const MotionMeter = /*@__PURE__*/ createMotionComponentWithFeatures("meter"); -const MotionNav = /*@__PURE__*/ createMotionComponentWithFeatures("nav"); -const MotionObject = /*@__PURE__*/ createMotionComponentWithFeatures("object"); -const MotionOl = /*@__PURE__*/ createMotionComponentWithFeatures("ol"); -const MotionOptgroup = /*@__PURE__*/ createMotionComponentWithFeatures("optgroup"); -const MotionOption = /*@__PURE__*/ createMotionComponentWithFeatures("option"); -const MotionOutput = /*@__PURE__*/ createMotionComponentWithFeatures("output"); -const MotionP = /*@__PURE__*/ createMotionComponentWithFeatures("p"); -const MotionParam = /*@__PURE__*/ createMotionComponentWithFeatures("param"); -const MotionPicture = /*@__PURE__*/ createMotionComponentWithFeatures("picture"); -const MotionPre = /*@__PURE__*/ createMotionComponentWithFeatures("pre"); -const MotionProgress = /*@__PURE__*/ createMotionComponentWithFeatures("progress"); -const MotionQ = /*@__PURE__*/ createMotionComponentWithFeatures("q"); -const MotionRp = /*@__PURE__*/ createMotionComponentWithFeatures("rp"); -const MotionRt = /*@__PURE__*/ createMotionComponentWithFeatures("rt"); -const MotionRuby = /*@__PURE__*/ createMotionComponentWithFeatures("ruby"); -const MotionS = /*@__PURE__*/ createMotionComponentWithFeatures("s"); -const MotionSamp = /*@__PURE__*/ createMotionComponentWithFeatures("samp"); -const MotionScript = /*@__PURE__*/ createMotionComponentWithFeatures("script"); -const MotionSection = /*@__PURE__*/ createMotionComponentWithFeatures("section"); -const MotionSelect = /*@__PURE__*/ createMotionComponentWithFeatures("select"); -const MotionSmall = /*@__PURE__*/ createMotionComponentWithFeatures("small"); -const MotionSource = /*@__PURE__*/ createMotionComponentWithFeatures("source"); -const MotionSpan = /*@__PURE__*/ createMotionComponentWithFeatures("span"); -const MotionStrong = /*@__PURE__*/ createMotionComponentWithFeatures("strong"); -const MotionStyle = /*@__PURE__*/ createMotionComponentWithFeatures("style"); -const MotionSub = /*@__PURE__*/ createMotionComponentWithFeatures("sub"); -const MotionSummary = /*@__PURE__*/ createMotionComponentWithFeatures("summary"); -const MotionSup = /*@__PURE__*/ createMotionComponentWithFeatures("sup"); -const MotionTable = /*@__PURE__*/ createMotionComponentWithFeatures("table"); -const MotionTbody = /*@__PURE__*/ createMotionComponentWithFeatures("tbody"); -const MotionTd = /*@__PURE__*/ createMotionComponentWithFeatures("td"); -const MotionTextarea = /*@__PURE__*/ createMotionComponentWithFeatures("textarea"); -const MotionTfoot = /*@__PURE__*/ createMotionComponentWithFeatures("tfoot"); -const MotionTh = /*@__PURE__*/ createMotionComponentWithFeatures("th"); -const MotionThead = /*@__PURE__*/ createMotionComponentWithFeatures("thead"); -const MotionTime = /*@__PURE__*/ createMotionComponentWithFeatures("time"); -const MotionTitle = /*@__PURE__*/ createMotionComponentWithFeatures("title"); -const MotionTr = /*@__PURE__*/ createMotionComponentWithFeatures("tr"); -const MotionTrack = /*@__PURE__*/ createMotionComponentWithFeatures("track"); -const MotionU = /*@__PURE__*/ createMotionComponentWithFeatures("u"); -const MotionUl = /*@__PURE__*/ createMotionComponentWithFeatures("ul"); -const MotionVideo = /*@__PURE__*/ createMotionComponentWithFeatures("video"); -const MotionWbr = /*@__PURE__*/ createMotionComponentWithFeatures("wbr"); -const MotionWebview = /*@__PURE__*/ createMotionComponentWithFeatures("webview"); -/** - * SVG components - */ -const MotionAnimate = /*@__PURE__*/ createMotionComponentWithFeatures("animate"); -const MotionCircle = /*@__PURE__*/ createMotionComponentWithFeatures("circle"); -const MotionDefs = /*@__PURE__*/ createMotionComponentWithFeatures("defs"); -const MotionDesc = /*@__PURE__*/ createMotionComponentWithFeatures("desc"); -const MotionEllipse = /*@__PURE__*/ createMotionComponentWithFeatures("ellipse"); -const MotionG = /*@__PURE__*/ createMotionComponentWithFeatures("g"); -const MotionImage = /*@__PURE__*/ createMotionComponentWithFeatures("image"); -const MotionLine = /*@__PURE__*/ createMotionComponentWithFeatures("line"); -const MotionFilter = /*@__PURE__*/ createMotionComponentWithFeatures("filter"); -const MotionMarker = /*@__PURE__*/ createMotionComponentWithFeatures("marker"); -const MotionMask = /*@__PURE__*/ createMotionComponentWithFeatures("mask"); -const MotionMetadata = /*@__PURE__*/ createMotionComponentWithFeatures("metadata"); -const MotionPath = /*@__PURE__*/ createMotionComponentWithFeatures("path"); -const MotionPattern = /*@__PURE__*/ createMotionComponentWithFeatures("pattern"); -const MotionPolygon = /*@__PURE__*/ createMotionComponentWithFeatures("polygon"); -const MotionPolyline = /*@__PURE__*/ createMotionComponentWithFeatures("polyline"); -const MotionRect = /*@__PURE__*/ createMotionComponentWithFeatures("rect"); -const MotionStop = /*@__PURE__*/ createMotionComponentWithFeatures("stop"); -const MotionSvg = /*@__PURE__*/ createMotionComponentWithFeatures("svg"); -const MotionSymbol = /*@__PURE__*/ createMotionComponentWithFeatures("symbol"); -const MotionText = /*@__PURE__*/ createMotionComponentWithFeatures("text"); -const MotionTspan = /*@__PURE__*/ createMotionComponentWithFeatures("tspan"); -const MotionUse = /*@__PURE__*/ createMotionComponentWithFeatures("use"); -const MotionView = /*@__PURE__*/ createMotionComponentWithFeatures("view"); -const MotionClipPath = /*@__PURE__*/ createMotionComponentWithFeatures("clipPath"); -const MotionFeBlend = /*@__PURE__*/ createMotionComponentWithFeatures("feBlend"); -const MotionFeColorMatrix = -/*@__PURE__*/ createMotionComponentWithFeatures("feColorMatrix"); -const MotionFeComponentTransfer = /*@__PURE__*/ createMotionComponentWithFeatures("feComponentTransfer"); -const MotionFeComposite = -/*@__PURE__*/ createMotionComponentWithFeatures("feComposite"); -const MotionFeConvolveMatrix = -/*@__PURE__*/ createMotionComponentWithFeatures("feConvolveMatrix"); -const MotionFeDiffuseLighting = -/*@__PURE__*/ createMotionComponentWithFeatures("feDiffuseLighting"); -const MotionFeDisplacementMap = -/*@__PURE__*/ createMotionComponentWithFeatures("feDisplacementMap"); -const MotionFeDistantLight = -/*@__PURE__*/ createMotionComponentWithFeatures("feDistantLight"); -const MotionFeDropShadow = -/*@__PURE__*/ createMotionComponentWithFeatures("feDropShadow"); -const MotionFeFlood = /*@__PURE__*/ createMotionComponentWithFeatures("feFlood"); -const MotionFeFuncA = /*@__PURE__*/ createMotionComponentWithFeatures("feFuncA"); -const MotionFeFuncB = /*@__PURE__*/ createMotionComponentWithFeatures("feFuncB"); -const MotionFeFuncG = /*@__PURE__*/ createMotionComponentWithFeatures("feFuncG"); -const MotionFeFuncR = /*@__PURE__*/ createMotionComponentWithFeatures("feFuncR"); -const MotionFeGaussianBlur = -/*@__PURE__*/ createMotionComponentWithFeatures("feGaussianBlur"); -const MotionFeImage = /*@__PURE__*/ createMotionComponentWithFeatures("feImage"); -const MotionFeMerge = /*@__PURE__*/ createMotionComponentWithFeatures("feMerge"); -const MotionFeMergeNode = -/*@__PURE__*/ createMotionComponentWithFeatures("feMergeNode"); -const MotionFeMorphology = -/*@__PURE__*/ createMotionComponentWithFeatures("feMorphology"); -const MotionFeOffset = /*@__PURE__*/ createMotionComponentWithFeatures("feOffset"); -const MotionFePointLight = -/*@__PURE__*/ createMotionComponentWithFeatures("fePointLight"); -const MotionFeSpecularLighting = -/*@__PURE__*/ createMotionComponentWithFeatures("feSpecularLighting"); -const MotionFeSpotLight = -/*@__PURE__*/ createMotionComponentWithFeatures("feSpotLight"); -const MotionFeTile = /*@__PURE__*/ createMotionComponentWithFeatures("feTile"); -const MotionFeTurbulence = -/*@__PURE__*/ createMotionComponentWithFeatures("feTurbulence"); -const MotionForeignObject = -/*@__PURE__*/ createMotionComponentWithFeatures("foreignObject"); -const MotionLinearGradient = -/*@__PURE__*/ createMotionComponentWithFeatures("linearGradient"); -const MotionRadialGradient = -/*@__PURE__*/ createMotionComponentWithFeatures("radialGradient"); -const MotionTextPath = /*@__PURE__*/ createMotionComponentWithFeatures("textPath"); - -export { MotionA, MotionAbbr, MotionAddress, MotionAnimate, MotionArea, MotionArticle, MotionAside, MotionAudio, MotionB, MotionBase, MotionBdi, MotionBdo, MotionBig, MotionBlockquote, MotionBody, MotionButton, MotionCanvas, MotionCaption, MotionCircle, MotionCite, MotionClipPath, MotionCode, MotionCol, MotionColgroup, MotionData, MotionDatalist, MotionDd, MotionDefs, MotionDel, MotionDesc, MotionDetails, MotionDfn, MotionDialog, MotionDiv, MotionDl, MotionDt, MotionEllipse, MotionEm, MotionEmbed, MotionFeBlend, MotionFeColorMatrix, MotionFeComponentTransfer, MotionFeComposite, MotionFeConvolveMatrix, MotionFeDiffuseLighting, MotionFeDisplacementMap, MotionFeDistantLight, MotionFeDropShadow, MotionFeFlood, MotionFeFuncA, MotionFeFuncB, MotionFeFuncG, MotionFeFuncR, MotionFeGaussianBlur, MotionFeImage, MotionFeMerge, MotionFeMergeNode, MotionFeMorphology, MotionFeOffset, MotionFePointLight, MotionFeSpecularLighting, MotionFeSpotLight, MotionFeTile, MotionFeTurbulence, MotionFieldset, MotionFigcaption, MotionFigure, MotionFilter, MotionFooter, MotionForeignObject, MotionForm, MotionG, MotionH1, MotionH2, MotionH3, MotionH4, MotionH5, MotionH6, MotionHead, MotionHeader, MotionHgroup, MotionHr, MotionHtml, MotionI, MotionIframe, MotionImage, MotionImg, MotionInput, MotionIns, MotionKbd, MotionKeygen, MotionLabel, MotionLegend, MotionLi, MotionLine, MotionLinearGradient, MotionLink, MotionMain, MotionMap, MotionMark, MotionMarker, MotionMask, MotionMenu, MotionMenuitem, MotionMetadata, MotionMeter, MotionNav, MotionObject, MotionOl, MotionOptgroup, MotionOption, MotionOutput, MotionP, MotionParam, MotionPath, MotionPattern, MotionPicture, MotionPolygon, MotionPolyline, MotionPre, MotionProgress, MotionQ, MotionRadialGradient, MotionRect, MotionRp, MotionRt, MotionRuby, MotionS, MotionSamp, MotionScript, MotionSection, MotionSelect, MotionSmall, MotionSource, MotionSpan, MotionStop, MotionStrong, MotionStyle, MotionSub, MotionSummary, MotionSup, MotionSvg, MotionSymbol, MotionTable, MotionTbody, MotionTd, MotionText, MotionTextPath, MotionTextarea, MotionTfoot, MotionTh, MotionThead, MotionTime, MotionTitle, MotionTr, MotionTrack, MotionTspan, MotionU, MotionUl, MotionUse, MotionVideo, MotionView, MotionWbr, MotionWebview }; -//# sourceMappingURL=elements.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/components/motion/elements.mjs.map b/node_modules/framer-motion/dist/es/render/components/motion/elements.mjs.map deleted file mode 100644 index 49a367d..0000000 --- a/node_modules/framer-motion/dist/es/render/components/motion/elements.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"elements.mjs","sources":["../../../../../src/render/components/motion/elements.ts"],"sourcesContent":["\"use client\"\n\nimport { createMotionComponentWithFeatures as createMotionComponent } from \"./create\"\n\n/**\n * HTML components\n */\nexport const MotionA = /*@__PURE__*/ createMotionComponent(\"a\")\nexport const MotionAbbr = /*@__PURE__*/ createMotionComponent(\"abbr\")\nexport const MotionAddress = /*@__PURE__*/ createMotionComponent(\"address\")\nexport const MotionArea = /*@__PURE__*/ createMotionComponent(\"area\")\nexport const MotionArticle = /*@__PURE__*/ createMotionComponent(\"article\")\nexport const MotionAside = /*@__PURE__*/ createMotionComponent(\"aside\")\nexport const MotionAudio = /*@__PURE__*/ createMotionComponent(\"audio\")\nexport const MotionB = /*@__PURE__*/ createMotionComponent(\"b\")\nexport const MotionBase = /*@__PURE__*/ createMotionComponent(\"base\")\nexport const MotionBdi = /*@__PURE__*/ createMotionComponent(\"bdi\")\nexport const MotionBdo = /*@__PURE__*/ createMotionComponent(\"bdo\")\nexport const MotionBig = /*@__PURE__*/ createMotionComponent(\"big\")\nexport const MotionBlockquote =\n /*@__PURE__*/ createMotionComponent(\"blockquote\")\nexport const MotionBody = /*@__PURE__*/ createMotionComponent(\"body\")\nexport const MotionButton = /*@__PURE__*/ createMotionComponent(\"button\")\nexport const MotionCanvas = /*@__PURE__*/ createMotionComponent(\"canvas\")\nexport const MotionCaption = /*@__PURE__*/ createMotionComponent(\"caption\")\nexport const MotionCite = /*@__PURE__*/ createMotionComponent(\"cite\")\nexport const MotionCode = /*@__PURE__*/ createMotionComponent(\"code\")\nexport const MotionCol = /*@__PURE__*/ createMotionComponent(\"col\")\nexport const MotionColgroup = /*@__PURE__*/ createMotionComponent(\"colgroup\")\nexport const MotionData = /*@__PURE__*/ createMotionComponent(\"data\")\nexport const MotionDatalist = /*@__PURE__*/ createMotionComponent(\"datalist\")\nexport const MotionDd = /*@__PURE__*/ createMotionComponent(\"dd\")\nexport const MotionDel = /*@__PURE__*/ createMotionComponent(\"del\")\nexport const MotionDetails = /*@__PURE__*/ createMotionComponent(\"details\")\nexport const MotionDfn = /*@__PURE__*/ createMotionComponent(\"dfn\")\nexport const MotionDialog = /*@__PURE__*/ createMotionComponent(\"dialog\")\nexport const MotionDiv = /*@__PURE__*/ createMotionComponent(\"div\")\nexport const MotionDl = /*@__PURE__*/ createMotionComponent(\"dl\")\nexport const MotionDt = /*@__PURE__*/ createMotionComponent(\"dt\")\nexport const MotionEm = /*@__PURE__*/ createMotionComponent(\"em\")\nexport const MotionEmbed = /*@__PURE__*/ createMotionComponent(\"embed\")\nexport const MotionFieldset = /*@__PURE__*/ createMotionComponent(\"fieldset\")\nexport const MotionFigcaption =\n /*@__PURE__*/ createMotionComponent(\"figcaption\")\nexport const MotionFigure = /*@__PURE__*/ createMotionComponent(\"figure\")\nexport const MotionFooter = /*@__PURE__*/ createMotionComponent(\"footer\")\nexport const MotionForm = /*@__PURE__*/ createMotionComponent(\"form\")\nexport const MotionH1 = /*@__PURE__*/ createMotionComponent(\"h1\")\nexport const MotionH2 = /*@__PURE__*/ createMotionComponent(\"h2\")\nexport const MotionH3 = /*@__PURE__*/ createMotionComponent(\"h3\")\nexport const MotionH4 = /*@__PURE__*/ createMotionComponent(\"h4\")\nexport const MotionH5 = /*@__PURE__*/ createMotionComponent(\"h5\")\nexport const MotionH6 = /*@__PURE__*/ createMotionComponent(\"h6\")\nexport const MotionHead = /*@__PURE__*/ createMotionComponent(\"head\")\nexport const MotionHeader = /*@__PURE__*/ createMotionComponent(\"header\")\nexport const MotionHgroup = /*@__PURE__*/ createMotionComponent(\"hgroup\")\nexport const MotionHr = /*@__PURE__*/ createMotionComponent(\"hr\")\nexport const MotionHtml = /*@__PURE__*/ createMotionComponent(\"html\")\nexport const MotionI = /*@__PURE__*/ createMotionComponent(\"i\")\nexport const MotionIframe = /*@__PURE__*/ createMotionComponent(\"iframe\")\nexport const MotionImg = /*@__PURE__*/ createMotionComponent(\"img\")\nexport const MotionInput = /*@__PURE__*/ createMotionComponent(\"input\")\nexport const MotionIns = /*@__PURE__*/ createMotionComponent(\"ins\")\nexport const MotionKbd = /*@__PURE__*/ createMotionComponent(\"kbd\")\nexport const MotionKeygen = /*@__PURE__*/ createMotionComponent(\"keygen\")\nexport const MotionLabel = /*@__PURE__*/ createMotionComponent(\"label\")\nexport const MotionLegend = /*@__PURE__*/ createMotionComponent(\"legend\")\nexport const MotionLi = /*@__PURE__*/ createMotionComponent(\"li\")\nexport const MotionLink = /*@__PURE__*/ createMotionComponent(\"link\")\nexport const MotionMain = /*@__PURE__*/ createMotionComponent(\"main\")\nexport const MotionMap = /*@__PURE__*/ createMotionComponent(\"map\")\nexport const MotionMark = /*@__PURE__*/ createMotionComponent(\"mark\")\nexport const MotionMenu = /*@__PURE__*/ createMotionComponent(\"menu\")\nexport const MotionMenuitem = /*@__PURE__*/ createMotionComponent(\"menuitem\")\nexport const MotionMeter = /*@__PURE__*/ createMotionComponent(\"meter\")\nexport const MotionNav = /*@__PURE__*/ createMotionComponent(\"nav\")\nexport const MotionObject = /*@__PURE__*/ createMotionComponent(\"object\")\nexport const MotionOl = /*@__PURE__*/ createMotionComponent(\"ol\")\nexport const MotionOptgroup = /*@__PURE__*/ createMotionComponent(\"optgroup\")\nexport const MotionOption = /*@__PURE__*/ createMotionComponent(\"option\")\nexport const MotionOutput = /*@__PURE__*/ createMotionComponent(\"output\")\nexport const MotionP = /*@__PURE__*/ createMotionComponent(\"p\")\nexport const MotionParam = /*@__PURE__*/ createMotionComponent(\"param\")\nexport const MotionPicture = /*@__PURE__*/ createMotionComponent(\"picture\")\nexport const MotionPre = /*@__PURE__*/ createMotionComponent(\"pre\")\nexport const MotionProgress = /*@__PURE__*/ createMotionComponent(\"progress\")\nexport const MotionQ = /*@__PURE__*/ createMotionComponent(\"q\")\nexport const MotionRp = /*@__PURE__*/ createMotionComponent(\"rp\")\nexport const MotionRt = /*@__PURE__*/ createMotionComponent(\"rt\")\nexport const MotionRuby = /*@__PURE__*/ createMotionComponent(\"ruby\")\nexport const MotionS = /*@__PURE__*/ createMotionComponent(\"s\")\nexport const MotionSamp = /*@__PURE__*/ createMotionComponent(\"samp\")\nexport const MotionScript = /*@__PURE__*/ createMotionComponent(\"script\")\nexport const MotionSection = /*@__PURE__*/ createMotionComponent(\"section\")\nexport const MotionSelect = /*@__PURE__*/ createMotionComponent(\"select\")\nexport const MotionSmall = /*@__PURE__*/ createMotionComponent(\"small\")\nexport const MotionSource = /*@__PURE__*/ createMotionComponent(\"source\")\nexport const MotionSpan = /*@__PURE__*/ createMotionComponent(\"span\")\nexport const MotionStrong = /*@__PURE__*/ createMotionComponent(\"strong\")\nexport const MotionStyle = /*@__PURE__*/ createMotionComponent(\"style\")\nexport const MotionSub = /*@__PURE__*/ createMotionComponent(\"sub\")\nexport const MotionSummary = /*@__PURE__*/ createMotionComponent(\"summary\")\nexport const MotionSup = /*@__PURE__*/ createMotionComponent(\"sup\")\nexport const MotionTable = /*@__PURE__*/ createMotionComponent(\"table\")\nexport const MotionTbody = /*@__PURE__*/ createMotionComponent(\"tbody\")\nexport const MotionTd = /*@__PURE__*/ createMotionComponent(\"td\")\nexport const MotionTextarea = /*@__PURE__*/ createMotionComponent(\"textarea\")\nexport const MotionTfoot = /*@__PURE__*/ createMotionComponent(\"tfoot\")\nexport const MotionTh = /*@__PURE__*/ createMotionComponent(\"th\")\nexport const MotionThead = /*@__PURE__*/ createMotionComponent(\"thead\")\nexport const MotionTime = /*@__PURE__*/ createMotionComponent(\"time\")\nexport const MotionTitle = /*@__PURE__*/ createMotionComponent(\"title\")\nexport const MotionTr = /*@__PURE__*/ createMotionComponent(\"tr\")\nexport const MotionTrack = /*@__PURE__*/ createMotionComponent(\"track\")\nexport const MotionU = /*@__PURE__*/ createMotionComponent(\"u\")\nexport const MotionUl = /*@__PURE__*/ createMotionComponent(\"ul\")\nexport const MotionVideo = /*@__PURE__*/ createMotionComponent(\"video\")\nexport const MotionWbr = /*@__PURE__*/ createMotionComponent(\"wbr\")\nexport const MotionWebview = /*@__PURE__*/ createMotionComponent(\"webview\")\n\n/**\n * SVG components\n */\nexport const MotionAnimate = /*@__PURE__*/ createMotionComponent(\"animate\")\nexport const MotionCircle = /*@__PURE__*/ createMotionComponent(\"circle\")\nexport const MotionDefs = /*@__PURE__*/ createMotionComponent(\"defs\")\nexport const MotionDesc = /*@__PURE__*/ createMotionComponent(\"desc\")\nexport const MotionEllipse = /*@__PURE__*/ createMotionComponent(\"ellipse\")\nexport const MotionG = /*@__PURE__*/ createMotionComponent(\"g\")\nexport const MotionImage = /*@__PURE__*/ createMotionComponent(\"image\")\nexport const MotionLine = /*@__PURE__*/ createMotionComponent(\"line\")\nexport const MotionFilter = /*@__PURE__*/ createMotionComponent(\"filter\")\nexport const MotionMarker = /*@__PURE__*/ createMotionComponent(\"marker\")\nexport const MotionMask = /*@__PURE__*/ createMotionComponent(\"mask\")\nexport const MotionMetadata = /*@__PURE__*/ createMotionComponent(\"metadata\")\nexport const MotionPath = /*@__PURE__*/ createMotionComponent(\"path\")\nexport const MotionPattern = /*@__PURE__*/ createMotionComponent(\"pattern\")\nexport const MotionPolygon = /*@__PURE__*/ createMotionComponent(\"polygon\")\nexport const MotionPolyline = /*@__PURE__*/ createMotionComponent(\"polyline\")\nexport const MotionRect = /*@__PURE__*/ createMotionComponent(\"rect\")\nexport const MotionStop = /*@__PURE__*/ createMotionComponent(\"stop\")\nexport const MotionSvg = /*@__PURE__*/ createMotionComponent(\"svg\")\nexport const MotionSymbol = /*@__PURE__*/ createMotionComponent(\"symbol\")\nexport const MotionText = /*@__PURE__*/ createMotionComponent(\"text\")\nexport const MotionTspan = /*@__PURE__*/ createMotionComponent(\"tspan\")\nexport const MotionUse = /*@__PURE__*/ createMotionComponent(\"use\")\nexport const MotionView = /*@__PURE__*/ createMotionComponent(\"view\")\nexport const MotionClipPath = /*@__PURE__*/ createMotionComponent(\"clipPath\")\nexport const MotionFeBlend = /*@__PURE__*/ createMotionComponent(\"feBlend\")\nexport const MotionFeColorMatrix =\n /*@__PURE__*/ createMotionComponent(\"feColorMatrix\")\nexport const MotionFeComponentTransfer = /*@__PURE__*/ createMotionComponent(\n \"feComponentTransfer\"\n)\nexport const MotionFeComposite =\n /*@__PURE__*/ createMotionComponent(\"feComposite\")\nexport const MotionFeConvolveMatrix =\n /*@__PURE__*/ createMotionComponent(\"feConvolveMatrix\")\nexport const MotionFeDiffuseLighting =\n /*@__PURE__*/ createMotionComponent(\"feDiffuseLighting\")\nexport const MotionFeDisplacementMap =\n /*@__PURE__*/ createMotionComponent(\"feDisplacementMap\")\nexport const MotionFeDistantLight =\n /*@__PURE__*/ createMotionComponent(\"feDistantLight\")\nexport const MotionFeDropShadow =\n /*@__PURE__*/ createMotionComponent(\"feDropShadow\")\nexport const MotionFeFlood = /*@__PURE__*/ createMotionComponent(\"feFlood\")\nexport const MotionFeFuncA = /*@__PURE__*/ createMotionComponent(\"feFuncA\")\nexport const MotionFeFuncB = /*@__PURE__*/ createMotionComponent(\"feFuncB\")\nexport const MotionFeFuncG = /*@__PURE__*/ createMotionComponent(\"feFuncG\")\nexport const MotionFeFuncR = /*@__PURE__*/ createMotionComponent(\"feFuncR\")\nexport const MotionFeGaussianBlur =\n /*@__PURE__*/ createMotionComponent(\"feGaussianBlur\")\nexport const MotionFeImage = /*@__PURE__*/ createMotionComponent(\"feImage\")\nexport const MotionFeMerge = /*@__PURE__*/ createMotionComponent(\"feMerge\")\nexport const MotionFeMergeNode =\n /*@__PURE__*/ createMotionComponent(\"feMergeNode\")\nexport const MotionFeMorphology =\n /*@__PURE__*/ createMotionComponent(\"feMorphology\")\nexport const MotionFeOffset = /*@__PURE__*/ createMotionComponent(\"feOffset\")\nexport const MotionFePointLight =\n /*@__PURE__*/ createMotionComponent(\"fePointLight\")\nexport const MotionFeSpecularLighting =\n /*@__PURE__*/ createMotionComponent(\"feSpecularLighting\")\nexport const MotionFeSpotLight =\n /*@__PURE__*/ createMotionComponent(\"feSpotLight\")\nexport const MotionFeTile = /*@__PURE__*/ createMotionComponent(\"feTile\")\nexport const MotionFeTurbulence =\n /*@__PURE__*/ createMotionComponent(\"feTurbulence\")\nexport const MotionForeignObject =\n /*@__PURE__*/ createMotionComponent(\"foreignObject\")\nexport const MotionLinearGradient =\n /*@__PURE__*/ createMotionComponent(\"linearGradient\")\nexport const MotionRadialGradient =\n /*@__PURE__*/ createMotionComponent(\"radialGradient\")\nexport const MotionTextPath = /*@__PURE__*/ createMotionComponent(\"textPath\")\n"],"names":[],"mappings":";;;AAIA;;AAEG;AACI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEH;AACG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEH;AACG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEP;;AAEG;AACI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEH;AACG;;AAIH;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACG;AACA;AACA;AACA;AACA;;AAEH;AACG;AACA;;AAEH;;AAEA;AACG;;AAEH;;AAEA;;AAEA;AACG;;AAEH;;AAEA;;AAEA;;AAEA;AACG;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/components/motion/feature-bundle.mjs b/node_modules/framer-motion/dist/es/render/components/motion/feature-bundle.mjs deleted file mode 100644 index 06da6bd..0000000 --- a/node_modules/framer-motion/dist/es/render/components/motion/feature-bundle.mjs +++ /dev/null @@ -1,14 +0,0 @@ -import { animations } from '../../../motion/features/animations.mjs'; -import { drag } from '../../../motion/features/drag.mjs'; -import { gestureAnimations } from '../../../motion/features/gestures.mjs'; -import { layout } from '../../../motion/features/layout.mjs'; - -const featureBundle = { - ...animations, - ...gestureAnimations, - ...drag, - ...layout, -}; - -export { featureBundle }; -//# sourceMappingURL=feature-bundle.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/components/motion/feature-bundle.mjs.map b/node_modules/framer-motion/dist/es/render/components/motion/feature-bundle.mjs.map deleted file mode 100644 index 14f564d..0000000 --- a/node_modules/framer-motion/dist/es/render/components/motion/feature-bundle.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"feature-bundle.mjs","sources":["../../../../../src/render/components/motion/feature-bundle.ts"],"sourcesContent":["import { animations } from \"../../../motion/features/animations\"\nimport { drag } from \"../../../motion/features/drag\"\nimport { gestureAnimations } from \"../../../motion/features/gestures\"\nimport { layout } from \"../../../motion/features/layout\"\n\nexport const featureBundle = {\n ...animations,\n ...gestureAnimations,\n ...drag,\n ...layout,\n}\n"],"names":[],"mappings":";;;;;AAKO,MAAM,aAAa,GAAG;AACzB,IAAA,GAAG,UAAU;AACb,IAAA,GAAG,iBAAiB;AACpB,IAAA,GAAG,IAAI;AACP,IAAA,GAAG,MAAM;;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/components/motion/proxy.mjs b/node_modules/framer-motion/dist/es/render/components/motion/proxy.mjs deleted file mode 100644 index 66755ca..0000000 --- a/node_modules/framer-motion/dist/es/render/components/motion/proxy.mjs +++ /dev/null @@ -1,8 +0,0 @@ -import { createDomVisualElement } from '../../dom/create-visual-element.mjs'; -import { createMotionProxy } from '../create-proxy.mjs'; -import { featureBundle } from './feature-bundle.mjs'; - -const motion = /*@__PURE__*/ createMotionProxy(featureBundle, createDomVisualElement); - -export { motion }; -//# sourceMappingURL=proxy.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/components/motion/proxy.mjs.map b/node_modules/framer-motion/dist/es/render/components/motion/proxy.mjs.map deleted file mode 100644 index 7866880..0000000 --- a/node_modules/framer-motion/dist/es/render/components/motion/proxy.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"proxy.mjs","sources":["../../../../../src/render/components/motion/proxy.ts"],"sourcesContent":["import { createDomVisualElement } from \"../../dom/create-visual-element\"\nimport { createMotionProxy } from \"../create-proxy\"\nimport { featureBundle } from \"./feature-bundle\"\n\nexport const motion = /*@__PURE__*/ createMotionProxy(\n featureBundle,\n createDomVisualElement\n)\n"],"names":[],"mappings":";;;;AAIO,MAAM,MAAM,iBAAiB,iBAAiB,CACjD,aAAa,EACb,sBAAsB;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/dom/create-visual-element.mjs b/node_modules/framer-motion/dist/es/render/dom/create-visual-element.mjs deleted file mode 100644 index 95a233f..0000000 --- a/node_modules/framer-motion/dist/es/render/dom/create-visual-element.mjs +++ /dev/null @@ -1,18 +0,0 @@ -import { SVGVisualElement, HTMLVisualElement } from 'motion-dom'; -import { Fragment } from 'react'; -import { isSVGComponent } from './utils/is-svg-component.mjs'; - -const createDomVisualElement = (Component, options) => { - /** - * Use explicit isSVG override if provided, otherwise auto-detect - */ - const isSVG = options.isSVG ?? isSVGComponent(Component); - return isSVG - ? new SVGVisualElement(options) - : new HTMLVisualElement(options, { - allowProjection: Component !== Fragment, - }); -}; - -export { createDomVisualElement }; -//# sourceMappingURL=create-visual-element.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/dom/create-visual-element.mjs.map b/node_modules/framer-motion/dist/es/render/dom/create-visual-element.mjs.map deleted file mode 100644 index a98aaaa..0000000 --- a/node_modules/framer-motion/dist/es/render/dom/create-visual-element.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"create-visual-element.mjs","sources":["../../../../src/render/dom/create-visual-element.ts"],"sourcesContent":["import { HTMLVisualElement, SVGVisualElement } from \"motion-dom\"\nimport { ComponentType, Fragment } from \"react\"\nimport { CreateVisualElement, VisualElementOptions } from \"../types\"\nimport { isSVGComponent } from \"./utils/is-svg-component\"\n\nexport const createDomVisualElement: CreateVisualElement = (\n Component: string | ComponentType>,\n options: VisualElementOptions\n) => {\n /**\n * Use explicit isSVG override if provided, otherwise auto-detect\n */\n const isSVG = options.isSVG ?? isSVGComponent(Component)\n\n return isSVG\n ? new SVGVisualElement(options)\n : new HTMLVisualElement(options, {\n allowProjection: Component !== Fragment,\n })\n}\n"],"names":[],"mappings":";;;;MAKa,sBAAsB,GAAwB,CACvD,SAAmE,EACnE,OAAuD,KACvD;AACA;;AAEG;IACH,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,cAAc,CAAC,SAAS,CAAC;AAExD,IAAA,OAAO;AACH,UAAE,IAAI,gBAAgB,CAAC,OAAO;AAC9B,UAAE,IAAI,iBAAiB,CAAC,OAAO,EAAE;YAC3B,eAAe,EAAE,SAAS,KAAK,QAAQ;AAC1C,SAAA,CAAC;AACZ;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/dom/features-animation.mjs b/node_modules/framer-motion/dist/es/render/dom/features-animation.mjs deleted file mode 100644 index 4f15e67..0000000 --- a/node_modules/framer-motion/dist/es/render/dom/features-animation.mjs +++ /dev/null @@ -1,16 +0,0 @@ -"use client"; -import { animations } from '../../motion/features/animations.mjs'; -import { gestureAnimations } from '../../motion/features/gestures.mjs'; -import { createDomVisualElement } from './create-visual-element.mjs'; - -/** - * @public - */ -const domAnimation = { - renderer: createDomVisualElement, - ...animations, - ...gestureAnimations, -}; - -export { domAnimation }; -//# sourceMappingURL=features-animation.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/dom/features-animation.mjs.map b/node_modules/framer-motion/dist/es/render/dom/features-animation.mjs.map deleted file mode 100644 index f0f6583..0000000 --- a/node_modules/framer-motion/dist/es/render/dom/features-animation.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"features-animation.mjs","sources":["../../../../src/render/dom/features-animation.ts"],"sourcesContent":["\"use client\"\n\nimport { animations } from \"../../motion/features/animations\"\nimport { gestureAnimations } from \"../../motion/features/gestures\"\nimport { FeatureBundle } from \"../../motion/features/types\"\nimport { createDomVisualElement } from \"./create-visual-element\"\n\n/**\n * @public\n */\nexport const domAnimation: FeatureBundle = {\n renderer: createDomVisualElement,\n ...animations,\n ...gestureAnimations,\n}\n"],"names":[],"mappings":";;;;;AAOA;;AAEG;AACI;AACH;AACA;AACA;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/dom/features-max.mjs b/node_modules/framer-motion/dist/es/render/dom/features-max.mjs deleted file mode 100644 index 54deaf2..0000000 --- a/node_modules/framer-motion/dist/es/render/dom/features-max.mjs +++ /dev/null @@ -1,16 +0,0 @@ -"use client"; -import { drag } from '../../motion/features/drag.mjs'; -import { layout } from '../../motion/features/layout.mjs'; -import { domAnimation } from './features-animation.mjs'; - -/** - * @public - */ -const domMax = { - ...domAnimation, - ...drag, - ...layout, -}; - -export { domMax }; -//# sourceMappingURL=features-max.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/dom/features-max.mjs.map b/node_modules/framer-motion/dist/es/render/dom/features-max.mjs.map deleted file mode 100644 index 082a5b8..0000000 --- a/node_modules/framer-motion/dist/es/render/dom/features-max.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"features-max.mjs","sources":["../../../../src/render/dom/features-max.ts"],"sourcesContent":["\"use client\"\n\nimport { drag } from \"../../motion/features/drag\"\nimport { layout } from \"../../motion/features/layout\"\nimport { FeatureBundle } from \"../../motion/features/types\"\nimport { domAnimation } from \"./features-animation\"\n\n/**\n * @public\n */\nexport const domMax: FeatureBundle = {\n ...domAnimation,\n ...drag,\n ...layout,\n}\n"],"names":[],"mappings":";;;;;AAOA;;AAEG;AACI;AACH;AACA;AACA;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/dom/features-min.mjs b/node_modules/framer-motion/dist/es/render/dom/features-min.mjs deleted file mode 100644 index 72a4fa0..0000000 --- a/node_modules/framer-motion/dist/es/render/dom/features-min.mjs +++ /dev/null @@ -1,14 +0,0 @@ -"use client"; -import { animations } from '../../motion/features/animations.mjs'; -import { createDomVisualElement } from './create-visual-element.mjs'; - -/** - * @public - */ -const domMin = { - renderer: createDomVisualElement, - ...animations, -}; - -export { domMin }; -//# sourceMappingURL=features-min.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/dom/features-min.mjs.map b/node_modules/framer-motion/dist/es/render/dom/features-min.mjs.map deleted file mode 100644 index 75c11f7..0000000 --- a/node_modules/framer-motion/dist/es/render/dom/features-min.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"features-min.mjs","sources":["../../../../src/render/dom/features-min.ts"],"sourcesContent":["\"use client\"\n\nimport { animations } from \"../../motion/features/animations\"\nimport { FeatureBundle } from \"../../motion/features/types\"\nimport { createDomVisualElement } from \"./create-visual-element\"\n\n/**\n * @public\n */\nexport const domMin: FeatureBundle = {\n renderer: createDomVisualElement,\n ...animations,\n}\n"],"names":[],"mappings":";;;;AAMA;;AAEG;AACI;AACH;AACA;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/attach-animation.mjs b/node_modules/framer-motion/dist/es/render/dom/scroll/attach-animation.mjs deleted file mode 100644 index 2913e9d..0000000 --- a/node_modules/framer-motion/dist/es/render/dom/scroll/attach-animation.mjs +++ /dev/null @@ -1,38 +0,0 @@ -import { observeTimeline } from 'motion-dom'; -import { canUseNativeTimeline } from './utils/can-use-native-timeline.mjs'; -import { getTimeline } from './utils/get-timeline.mjs'; -import { offsetToViewTimelineRange } from './utils/offset-to-range.mjs'; - -function attachToAnimation(animation, options) { - const timeline = getTimeline(options); - const range = options.target - ? offsetToViewTimelineRange(options.offset) - : undefined; - /** - * Use native timeline when: - * - No target: ScrollTimeline (existing behaviour) - * - Target with mappable offset: ViewTimeline with named range - * - Target with unmappable offset: fall back to JS observe - */ - const useNative = options.target - ? canUseNativeTimeline(options.target) && !!range - : canUseNativeTimeline(); - return animation.attachTimeline({ - timeline: useNative ? timeline : undefined, - ...(range && - useNative && { - rangeStart: range.rangeStart, - rangeEnd: range.rangeEnd, - }), - observe: (valueAnimation) => { - valueAnimation.pause(); - return observeTimeline((progress) => { - valueAnimation.time = - valueAnimation.iterationDuration * progress; - }, timeline); - }, - }); -} - -export { attachToAnimation }; -//# sourceMappingURL=attach-animation.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/attach-animation.mjs.map b/node_modules/framer-motion/dist/es/render/dom/scroll/attach-animation.mjs.map deleted file mode 100644 index b9553c0..0000000 --- a/node_modules/framer-motion/dist/es/render/dom/scroll/attach-animation.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"attach-animation.mjs","sources":["../../../../../src/render/dom/scroll/attach-animation.ts"],"sourcesContent":["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"],"names":[],"mappings":";;;;;AAMM,SAAU,iBAAiB,CAC7B,SAAoC,EACpC,OAAkC,EAAA;AAElC,IAAA,MAAM,QAAQ,GAAG,WAAW,CAAC,OAAO,CAAC;AAErC,IAAA,MAAM,KAAK,GAAG,OAAO,CAAC;AAClB,UAAE,yBAAyB,CAAC,OAAO,CAAC,MAAM;UACxC,SAAS;AAEf;;;;;AAKG;AACH,IAAA,MAAM,SAAS,GAAG,OAAO,CAAC;UACpB,oBAAoB,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;UAC1C,oBAAoB,EAAE;IAE5B,OAAO,SAAS,CAAC,cAAc,CAAC;QAC5B,QAAQ,EAAE,SAAS,GAAG,QAAQ,GAAG,SAAS;AAC1C,QAAA,IAAI,KAAK;AACL,YAAA,SAAS,IAAI;YACT,UAAU,EAAE,KAAK,CAAC,UAAU;YAC5B,QAAQ,EAAE,KAAK,CAAC,QAAQ;SAC3B,CAAC;AACN,QAAA,OAAO,EAAE,CAAC,cAAc,KAAI;YACxB,cAAc,CAAC,KAAK,EAAE;AAEtB,YAAA,OAAO,eAAe,CAAC,CAAC,QAAQ,KAAI;AAChC,gBAAA,cAAc,CAAC,IAAI;AACf,oBAAA,cAAc,CAAC,iBAAiB,GAAG,QAAQ;YACnD,CAAC,EAAE,QAAQ,CAAC;QAChB,CAAC;AACJ,KAAA,CAAC;AACN;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/attach-function.mjs b/node_modules/framer-motion/dist/es/render/dom/scroll/attach-function.mjs deleted file mode 100644 index f992a87..0000000 --- a/node_modules/framer-motion/dist/es/render/dom/scroll/attach-function.mjs +++ /dev/null @@ -1,25 +0,0 @@ -import { observeTimeline } from 'motion-dom'; -import { scrollInfo } from './track.mjs'; -import { getTimeline } from './utils/get-timeline.mjs'; -import { isElementTracking } from './utils/is-element-tracking.mjs'; - -/** - * If the onScroll function has two arguments, it's expecting - * more specific information about the scroll from scrollInfo. - */ -function isOnScrollWithInfo(onScroll) { - return onScroll.length === 2; -} -function attachToFunction(onScroll, options) { - if (isOnScrollWithInfo(onScroll) || isElementTracking(options)) { - return scrollInfo((info) => { - onScroll(info[options.axis].progress, info); - }, options); - } - else { - return observeTimeline(onScroll, getTimeline(options)); - } -} - -export { attachToFunction }; -//# sourceMappingURL=attach-function.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/attach-function.mjs.map b/node_modules/framer-motion/dist/es/render/dom/scroll/attach-function.mjs.map deleted file mode 100644 index 1a1a38d..0000000 --- a/node_modules/framer-motion/dist/es/render/dom/scroll/attach-function.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"attach-function.mjs","sources":["../../../../../src/render/dom/scroll/attach-function.ts"],"sourcesContent":["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"],"names":[],"mappings":";;;;;AAMA;;;AAGG;AACH,SAAS,kBAAkB,CAAC,QAAkB,EAAA;AAC1C,IAAA,OAAO,QAAQ,CAAC,MAAM,KAAK,CAAC;AAChC;AAEM,SAAU,gBAAgB,CAC5B,QAAkB,EAClB,OAAkC,EAAA;IAElC,IAAI,kBAAkB,CAAC,QAAQ,CAAC,IAAI,iBAAiB,CAAC,OAAO,CAAC,EAAE;AAC5D,QAAA,OAAO,UAAU,CAAC,CAAC,IAAI,KAAI;AACvB,YAAA,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,IAAK,CAAC,CAAC,QAAQ,EAAE,IAAI,CAAC;QAChD,CAAC,EAAE,OAAO,CAAC;IACf;SAAO;QACH,OAAO,eAAe,CAAC,QAAQ,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC1D;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/index.mjs b/node_modules/framer-motion/dist/es/render/dom/scroll/index.mjs deleted file mode 100644 index 2c4016a..0000000 --- a/node_modules/framer-motion/dist/es/render/dom/scroll/index.mjs +++ /dev/null @@ -1,15 +0,0 @@ -import { noop } from 'motion-utils'; -import { attachToAnimation } from './attach-animation.mjs'; -import { attachToFunction } from './attach-function.mjs'; - -function scroll(onScroll, { axis = "y", container = document.scrollingElement, ...options } = {}) { - if (!container) - return noop; - const optionsWithDefaults = { axis, container, ...options }; - return typeof onScroll === "function" - ? attachToFunction(onScroll, optionsWithDefaults) - : attachToAnimation(onScroll, optionsWithDefaults); -} - -export { scroll }; -//# sourceMappingURL=index.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/index.mjs.map b/node_modules/framer-motion/dist/es/render/dom/scroll/index.mjs.map deleted file mode 100644 index 964ab96..0000000 --- a/node_modules/framer-motion/dist/es/render/dom/scroll/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs","sources":["../../../../../src/render/dom/scroll/index.ts"],"sourcesContent":["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"],"names":[],"mappings":";;;;SAMgB,MAAM,CAClB,QAA8C,EAC9C,EACI,IAAI,GAAG,GAAG,EACV,SAAS,GAAG,QAAQ,CAAC,gBAA2B,EAChD,GAAG,OAAO,KACK,EAAE,EAAA;AAErB,IAAA,IAAI,CAAC,SAAS;AAAE,QAAA,OAAO,IAAoB;IAE3C,MAAM,mBAAmB,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,OAAO,EAAE;IAE3D,OAAO,OAAO,QAAQ,KAAK;AACvB,UAAE,gBAAgB,CAAC,QAAQ,EAAE,mBAAmB;AAChD,UAAE,iBAAiB,CAAC,QAAQ,EAAE,mBAAmB,CAAC;AAC1D;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/info.mjs b/node_modules/framer-motion/dist/es/render/dom/scroll/info.mjs deleted file mode 100644 index 3d0f053..0000000 --- a/node_modules/framer-motion/dist/es/render/dom/scroll/info.mjs +++ /dev/null @@ -1,56 +0,0 @@ -import { progress, velocityPerSecond } from 'motion-utils'; - -/** - * A time in milliseconds, beyond which we consider the scroll velocity to be 0. - */ -const maxElapsed = 50; -const createAxisInfo = () => ({ - current: 0, - offset: [], - progress: 0, - scrollLength: 0, - targetOffset: 0, - targetLength: 0, - containerLength: 0, - velocity: 0, -}); -const createScrollInfo = () => ({ - time: 0, - x: createAxisInfo(), - y: createAxisInfo(), -}); -const keys = { - x: { - length: "Width", - position: "Left", - }, - y: { - length: "Height", - position: "Top", - }, -}; -function updateAxisInfo(element, axisName, info, time) { - const axis = info[axisName]; - const { length, position } = keys[axisName]; - const prev = axis.current; - const prevTime = info.time; - axis.current = Math.abs(element[`scroll${position}`]); - axis.scrollLength = element[`scroll${length}`] - element[`client${length}`]; - axis.offset.length = 0; - axis.offset[0] = 0; - axis.offset[1] = axis.scrollLength; - axis.progress = progress(0, axis.scrollLength, axis.current); - const elapsed = time - prevTime; - axis.velocity = - elapsed > maxElapsed - ? 0 - : velocityPerSecond(axis.current - prev, elapsed); -} -function updateScrollInfo(element, info, time) { - updateAxisInfo(element, "x", info, time); - updateAxisInfo(element, "y", info, time); - info.time = time; -} - -export { createScrollInfo, updateScrollInfo }; -//# sourceMappingURL=info.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/info.mjs.map b/node_modules/framer-motion/dist/es/render/dom/scroll/info.mjs.map deleted file mode 100644 index 3aea0f4..0000000 --- a/node_modules/framer-motion/dist/es/render/dom/scroll/info.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"info.mjs","sources":["../../../../../src/render/dom/scroll/info.ts"],"sourcesContent":["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"],"names":[],"mappings":";;AAGA;;AAEG;AACH,MAAM,UAAU,GAAG,EAAE;AAErB,MAAM,cAAc,GAAG,OAAuB;AAC1C,IAAA,OAAO,EAAE,CAAC;AACV,IAAA,MAAM,EAAE,EAAE;AACV,IAAA,QAAQ,EAAE,CAAC;AACX,IAAA,YAAY,EAAE,CAAC;AACf,IAAA,YAAY,EAAE,CAAC;AACf,IAAA,YAAY,EAAE,CAAC;AACf,IAAA,eAAe,EAAE,CAAC;AAClB,IAAA,QAAQ,EAAE,CAAC;AACd,CAAA,CAAC;AAEK,MAAM,gBAAgB,GAAG,OAAmB;AAC/C,IAAA,IAAI,EAAE,CAAC;IACP,CAAC,EAAE,cAAc,EAAE;IACnB,CAAC,EAAE,cAAc,EAAE;AACtB,CAAA;AAED,MAAM,IAAI,GAAG;AACT,IAAA,CAAC,EAAE;AACC,QAAA,MAAM,EAAE,OAAO;AACf,QAAA,QAAQ,EAAE,MAAM;AACnB,KAAA;AACD,IA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EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC;IACxC,cAAc,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC;AACxC,IAAA,IAAI,CAAC,IAAI,GAAG,IAAI;AACpB;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/edge.mjs b/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/edge.mjs deleted file mode 100644 index 58cb4c1..0000000 --- a/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/edge.mjs +++ /dev/null @@ -1,46 +0,0 @@ -const namedEdges = { - start: 0, - center: 0.5, - end: 1, -}; -function resolveEdge(edge, length, inset = 0) { - let delta = 0; - /** - * If we have this edge defined as a preset, replace the definition - * with the numerical value. - */ - if (edge in namedEdges) { - edge = namedEdges[edge]; - } - /** - * Handle unit values - */ - if (typeof edge === "string") { - const asNumber = parseFloat(edge); - if (edge.endsWith("px")) { - delta = asNumber; - } - else if (edge.endsWith("%")) { - edge = asNumber / 100; - } - else if (edge.endsWith("vw")) { - delta = (asNumber / 100) * document.documentElement.clientWidth; - } - else if (edge.endsWith("vh")) { - delta = (asNumber / 100) * document.documentElement.clientHeight; - } - else { - edge = asNumber; - } - } - /** - * If the edge is defined as a number, handle as a progress value. - */ - if (typeof edge === "number") { - delta = length * edge; - } - return inset + delta; -} - -export { namedEdges, resolveEdge }; -//# sourceMappingURL=edge.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/edge.mjs.map b/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/edge.mjs.map deleted file mode 100644 index 0b568a7..0000000 --- a/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/edge.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"edge.mjs","sources":["../../../../../../src/render/dom/scroll/offsets/edge.ts"],"sourcesContent":["import { Edge, NamedEdges } from \"../types\"\n\nexport const namedEdges: Record = {\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"],"names":[],"mappings":"AAEO,MAAM,UAAU,GAA+B;AAClD,IAAA,KAAK,EAAE,CAAC;AACR,IAAA,MAAM,EAAE,GAAG;AACX,IAAA,GAAG,EAAE,CAAC;;AAGJ,SAAU,WAAW,CAAC,IAAU,EAAE,MAAc,EAAE,KAAK,GAAG,CAAC,EAAA;IAC7D,IAAI,KAAK,GAAG,CAAC;AAEb;;;AAGG;AACH,IAAA,IAAI,IAAI,IAAI,UAAU,EAAE;AACpB,QAAA,IAAI,GAAG,UAAU,CAAC,IAAkB,CAAC;IACzC;AAEA;;AAEG;AACH,IAAA,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;AAC1B,QAAA,MAAM,QAAQ,GAAG,UAAU,CAAC,IAAI,CAAC;AAEjC,QAAA,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;YACrB,KAAK,GAAG,QAAQ;QACpB;AAAO,aAAA,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;AAC3B,YAAA,IAAI,GAAG,QAAQ,GAAG,GAAG;QACzB;AAAO,aAAA,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;AAC5B,YAAA,KAAK,GAAG,CAAC,QAAQ,GAAG,GAAG,IAAI,QAAQ,CAAC,eAAe,CAAC,WAAW;QACnE;AAAO,aAAA,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;AAC5B,YAAA,KAAK,GAAG,CAAC,QAAQ,GAAG,GAAG,IAAI,QAAQ,CAAC,eAAe,CAAC,YAAY;QACpE;aAAO;YACH,IAAI,GAAG,QAAQ;QACnB;IACJ;AAEA;;AAEG;AACH,IAAA,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;AAC1B,QAAA,KAAK,GAAG,MAAM,GAAG,IAAI;IACzB;IAEA,OAAO,KAAK,GAAG,KAAK;AACxB;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/index.mjs b/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/index.mjs deleted file mode 100644 index 32cdd15..0000000 --- a/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/index.mjs +++ /dev/null @@ -1,60 +0,0 @@ -import { interpolate, defaultOffset } from 'motion-dom'; -import { clamp } from 'motion-utils'; -import { calcInset } from './inset.mjs'; -import { resolveOffset } from './offset.mjs'; -import { ScrollOffset } from './presets.mjs'; - -const point = { x: 0, y: 0 }; -function getTargetSize(target) { - return "getBBox" in target && target.tagName !== "svg" - ? target.getBBox() - : { width: target.clientWidth, height: target.clientHeight }; -} -function resolveOffsets(container, info, options) { - const { offset: offsetDefinition = ScrollOffset.All } = options; - const { target = container, axis = "y" } = options; - const lengthLabel = axis === "y" ? "height" : "width"; - const inset = target !== container ? calcInset(target, container) : point; - /** - * Measure the target and container. If they're the same thing then we - * use the container's scrollWidth/Height as the target, from there - * all other calculations can remain the same. - */ - const targetSize = target === container - ? { width: container.scrollWidth, height: container.scrollHeight } - : getTargetSize(target); - const containerSize = { - width: container.clientWidth, - height: container.clientHeight, - }; - /** - * Reset the length of the resolved offset array rather than creating a new one. - * TODO: More reusable data structures for targetSize/containerSize would also be good. - */ - info[axis].offset.length = 0; - /** - * Populate the offset array by resolving the user's offset definition into - * a list of pixel scroll offets. - */ - let hasChanged = !info[axis].interpolate; - const numOffsets = offsetDefinition.length; - for (let i = 0; i < numOffsets; i++) { - const offset = resolveOffset(offsetDefinition[i], containerSize[lengthLabel], targetSize[lengthLabel], inset[axis]); - if (!hasChanged && offset !== info[axis].interpolatorOffsets[i]) { - hasChanged = true; - } - info[axis].offset[i] = offset; - } - /** - * If the pixel scroll offsets have changed, create a new interpolator function - * to map scroll value into a progress. - */ - if (hasChanged) { - info[axis].interpolate = interpolate(info[axis].offset, defaultOffset(offsetDefinition), { clamp: false }); - info[axis].interpolatorOffsets = [...info[axis].offset]; - } - info[axis].progress = clamp(0, 1, info[axis].interpolate(info[axis].current)); -} - -export { resolveOffsets }; -//# sourceMappingURL=index.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/index.mjs.map b/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/index.mjs.map deleted file mode 100644 index cd82ae4..0000000 --- a/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs","sources":["../../../../../../src/render/dom/scroll/offsets/index.ts"],"sourcesContent":["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"],"names":[],"mappings":";;;;;;AAOA,MAAM,KAAK,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;AAE5B,SAAS,aAAa,CAAC,MAAe,EAAA;IAClC,OAAO,SAAS,IAAI,MAAM,IAAI,MAAM,CAAC,OAAO,KAAK;AAC7C,UAAG,MAA6B,CAAC,OAAO;AACxC,UAAE,EAAE,KAAK,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,CAAC,YAAY,EAAE;AACpE;SAEgB,cAAc,CAC1B,SAAkB,EAClB,IAAg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G,IAAI;QACrB;QAEA,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM;IACjC;AAEA;;;AAGG;IACH,IAAI,UAAU,EAAE;QACZ,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,GAAG,WAAW,CAChC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,EACjB,aAAa,CAAC,gBAAgB,CAAC,EAC/B,EAAE,KAAK,EAAE,KAAK,EAAE,CACnB;AAED,QAAA,IAAI,CAAC,IAAI,CAAC,CAAC,mBAAmB,GAAG,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC;IAC3D;IAEA,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,GAAG,KAAK,CACvB,CAAC,EACD,CAAC,EACD,IAAI,CAAC,IAAI,CAAC,CAAC,WAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAC9C;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/inset.mjs b/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/inset.mjs deleted file mode 100644 index 82d4652..0000000 --- a/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/inset.mjs +++ /dev/null @@ -1,48 +0,0 @@ -import { isHTMLElement } from 'motion-dom'; - -function calcInset(element, container) { - const inset = { x: 0, y: 0 }; - let current = element; - while (current && current !== container) { - if (isHTMLElement(current)) { - inset.x += current.offsetLeft; - inset.y += current.offsetTop; - current = current.offsetParent; - } - else if (current.tagName === "svg") { - /** - * This isn't an ideal approach to measuring the offset of tags. - * It would be preferable, given they behave like HTMLElements in most ways - * to use offsetLeft/Top. But these don't exist on . Likewise we - * can't use .getBBox() like most SVG elements as these provide the offset - * relative to the SVG itself, which for is usually 0x0. - */ - const svgBoundingBox = current.getBoundingClientRect(); - current = current.parentElement; - const parentBoundingBox = current.getBoundingClientRect(); - inset.x += svgBoundingBox.left - parentBoundingBox.left; - inset.y += svgBoundingBox.top - parentBoundingBox.top; - } - else if (current instanceof SVGGraphicsElement) { - const { x, y } = current.getBBox(); - inset.x += x; - inset.y += y; - let svg = null; - let parent = current.parentNode; - while (!svg) { - if (parent.tagName === "svg") { - svg = parent; - } - parent = current.parentNode; - } - current = svg; - } - else { - break; - } - } - return inset; -} - -export { calcInset }; -//# sourceMappingURL=inset.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/inset.mjs.map b/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/inset.mjs.map deleted file mode 100644 index 6c03b56..0000000 --- a/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/inset.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"inset.mjs","sources":["../../../../../../src/render/dom/scroll/offsets/inset.ts"],"sourcesContent":["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 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 . Likewise we\n * can't use .getBBox() like most SVG elements as these provide the offset\n * relative to the SVG itself, which for 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}\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gBAAA,MAAM,GAAG,OAAO,CAAC,UAAwB;YAC7C;YACA,OAAO,GAAG,GAAG;QACjB;aAAO;YACH;QACJ;IACJ;AAEA,IAAA,OAAO,KAAK;AAChB;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/offset.mjs b/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/offset.mjs deleted file mode 100644 index fd25b46..0000000 --- a/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/offset.mjs +++ /dev/null @@ -1,36 +0,0 @@ -import { resolveEdge, namedEdges } from './edge.mjs'; - -const defaultOffset = [0, 0]; -function resolveOffset(offset, containerLength, targetLength, targetInset) { - let offsetDefinition = Array.isArray(offset) ? offset : defaultOffset; - let targetPoint = 0; - let containerPoint = 0; - if (typeof offset === "number") { - /** - * If we're provided offset: [0, 0.5, 1] then each number x should become - * [x, x], so we default to the behaviour of mapping 0 => 0 of both target - * and container etc. - */ - offsetDefinition = [offset, offset]; - } - else if (typeof offset === "string") { - offset = offset.trim(); - if (offset.includes(" ")) { - offsetDefinition = offset.split(" "); - } - else { - /** - * If we're provided a definition like "100px" then we want to apply - * that only to the top of the target point, leaving the container at 0. - * Whereas a named offset like "end" should be applied to both. - */ - offsetDefinition = [offset, namedEdges[offset] ? offset : `0`]; - } - } - targetPoint = resolveEdge(offsetDefinition[0], targetLength, targetInset); - containerPoint = resolveEdge(offsetDefinition[1], containerLength); - return targetPoint - containerPoint; -} - -export { resolveOffset }; -//# sourceMappingURL=offset.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/offset.mjs.map b/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/offset.mjs.map deleted file mode 100644 index 0180029..0000000 --- a/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/offset.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"offset.mjs","sources":["../../../../../../src/render/dom/scroll/offsets/offset.ts"],"sourcesContent":["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"],"names":[],"mappings":";;AAGA,MAAM,aAAa,GAAyB,CAAC,CAAC,EAAE,CAAC,CAAC;AAE5C,SAAU,aAAa,CACzB,MAAkD,EAClD,eAAuB,EACvB,YAAoB,EACpB,WAAmB,EAAA;AAEnB,IAAA,IAAI,gBAAgB,GAChB,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,GAAG,aAAa;IAElD,IAAI,WAAW,GAAG,CAAC;IACnB,IAAI,cAAc,GAAG,CAAC;AAEtB,IAAA,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;AAC5B;;;;AAIG;AACH,QAAA,gBAAgB,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC;IACvC;AAAO,SAAA,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;AACnC,QAAA,MAAM,GAAG,MAAM,CAAC,IAAI,EAAgB;AAEpC,QAAA,IAAI,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;AACtB,YAAA,gBAAgB,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAA6B;QACpE;aAAO;AACH;;;;AAIG;AACH,YAAA,gBAAgB,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,MAAiC,CAAC,GAAG,MAAM,GAAG,CAAA,CAAA,CAAG,CAAC;QAC7F;IACJ;AAEA,IAAA,WAAW,GAAG,WAAW,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,WAAW,CAAC;IACzE,cAAc,GAAG,WAAW,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,eAAe,CAAC;IAElE,OAAO,WAAW,GAAG,cAAc;AACvC;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/presets.mjs b/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/presets.mjs deleted file mode 100644 index 46e42cf..0000000 --- a/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/presets.mjs +++ /dev/null @@ -1,21 +0,0 @@ -const ScrollOffset = { - Enter: [ - [0, 1], - [1, 1], - ], - Exit: [ - [0, 0], - [1, 0], - ], - Any: [ - [1, 0], - [0, 1], - ], - All: [ - [0, 0], - [1, 1], - ], -}; - -export { ScrollOffset }; -//# sourceMappingURL=presets.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/presets.mjs.map b/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/presets.mjs.map deleted file mode 100644 index 7d45123..0000000 --- a/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/presets.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"presets.mjs","sources":["../../../../../../src/render/dom/scroll/offsets/presets.ts"],"sourcesContent":["import { ProgressIntersection } from \"../types\"\n\nexport const ScrollOffset: Record = {\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"],"names":[],"mappings":"AAEO,MAAM,YAAY,GAA2C;AAClE,IAAA,KAAK,EAAE;QACL,CAAC,CAAC,EAAE,CAAC,CAAC;QACN,CAAC,CAAC,EAAE,CAAC,CAAC;AACP,KAAA;AACD,IAAA,IAAI,EAAE;QACJ,CAAC,CAAC,EAAE,CAAC,CAAC;QACN,CAAC,CAAC,EAAE,CAAC,CAAC;AACP,KAAA;AACD,IAAA,GAAG,EAAE;QACH,CAAC,CAAC,EAAE,CAAC,CAAC;QACN,CAAC,CAAC,EAAE,CAAC,CAAC;AACP,KAAA;AACD,IAAA,GAAG,EAAE;QACH,CAAC,CAAC,EAAE,CAAC,CAAC;QACN,CAAC,CAAC,EAAE,CAAC,CAAC;AACP,KAAA;;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/on-scroll-handler.mjs b/node_modules/framer-motion/dist/es/render/dom/scroll/on-scroll-handler.mjs deleted file mode 100644 index 6523a96..0000000 --- a/node_modules/framer-motion/dist/es/render/dom/scroll/on-scroll-handler.mjs +++ /dev/null @@ -1,55 +0,0 @@ -import { warnOnce } from 'motion-utils'; -import { updateScrollInfo } from './info.mjs'; -import { resolveOffsets } from './offsets/index.mjs'; - -function measure(container, target = container, info) { - /** - * Find inset of target within scrollable container - */ - info.x.targetOffset = 0; - info.y.targetOffset = 0; - if (target !== container) { - let node = target; - while (node && node !== container) { - info.x.targetOffset += node.offsetLeft; - info.y.targetOffset += node.offsetTop; - node = node.offsetParent; - } - } - info.x.targetLength = - target === container ? target.scrollWidth : target.clientWidth; - info.y.targetLength = - target === container ? target.scrollHeight : target.clientHeight; - info.x.containerLength = container.clientWidth; - info.y.containerLength = container.clientHeight; - /** - * In development mode ensure scroll containers aren't position: static as this makes - * it difficult to measure their relative positions. The document scrolling element - * is exempt: offsetParent measurements naturally resolve relative to the document. - */ - if (process.env.NODE_ENV !== "production") { - if (container && - target && - target !== container && - container !== document.documentElement && - container !== document.scrollingElement && - container !== document.body) { - warnOnce(getComputedStyle(container).position !== "static", "Please ensure that the container has a non-static position, like 'relative', 'fixed', or 'absolute' to ensure scroll offset is calculated correctly."); - } - } -} -function createOnScrollHandler(element, onScroll, info, options = {}) { - return { - measure: (time) => { - measure(element, options.target, info); - updateScrollInfo(element, info, time); - if (options.offset || options.target) { - resolveOffsets(element, info, options); - } - }, - notify: () => onScroll(info), - }; -} - -export { createOnScrollHandler }; -//# sourceMappingURL=on-scroll-handler.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/on-scroll-handler.mjs.map b/node_modules/framer-motion/dist/es/render/dom/scroll/on-scroll-handler.mjs.map deleted file mode 100644 index 9ef880a..0000000 --- a/node_modules/framer-motion/dist/es/render/dom/scroll/on-scroll-handler.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"on-scroll-handler.mjs","sources":["../../../../../src/render/dom/scroll/on-scroll-handler.ts"],"sourcesContent":["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"],"names":[],"mappings":";;;;AAUA,SAAS,OAAO,CACZ,SAAkB,EAClB,MAAA,GAAkB,SAAS,EAC3B,IAAgB,EAAA;AAEhB;;AAEG;AACH,IAAA,IAAI,CAAC,CAAC,CAAC,YAAY,GAAG,CAAC;AACvB,IAAA,IAAI,CAAC,CAAC,CAAC,YAAY,GAAG,CAAC;AACvB,IAAA,IAAI,MAAM,KAAK,SAAS,EAAE;QACtB,IAAI,IAAI,GAAG,MAAqB;AAChC,QAAA,OAAO,IAAI,IAAI,IAAI,KAAK,SAAS,EAAE;YAC/B,IAAI,CAAC,CAAC,CAAC,YAAY,IAAI,IAAI,CAAC,UAAU;YACtC,IAAI,CAAC,CAAC,CAAC,YAAY,IAAI,IAAI,CAAC,SAAS;AACrC,YAAA,IAAI,GAAG,IAAI,CAAC,YAA2B;QAC3C;IACJ;IAEA,IAAI,CAAC,CAAC,CAAC,YAAY;AACf,QAAA,MAAM,KAAK,SAAS,GAAG,MAAM,CAAC,WAAW,GAAG,MAAM,CAAC,WAAW;IAClE,IAAI,CAAC,CAAC,CAAC,YAAY;AACf,QAAA,MAAM,KAAK,SAAS,GAAG,MAAM,CAAC,YAAY,GAAG,MAAM,CAAC,YAAY;IACpE,IAAI,CAAC,CAAC,CAAC,eAAe,GAAG,SAAS,CAAC,WAAW;IAC9C,IAAI,CAAC,CAAC,CAAC,eAAe,GAAG,SAAS,CAAC,YAAY;AAE/C;;;;AAIG;IACH,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE;AACvC,QAAA,IACI,SAAS;YACT,MAAM;AACN,YAAA,MAAM,KAAK,SAAS;YACpB,SAAS,KAAK,QAAQ,CAAC,eAAe;YACtC,SAAS,KAAK,QAAQ,CAAC,gBAAgB;AACvC,YAAA,SAAS,KAAK,QAAQ,CAAC,IAAI,EAC7B;AACE,YAAA,QAAQ,CACJ,gBAAgB,CAAC,SAAS,CAAC,CAAC,QAAQ,KAAK,QAAQ,EACjD,sJAAsJ,CACzJ;QACL;IACJ;AACJ;AAEM,SAAU,qBAAqB,CACjC,OAAgB,EAChB,QAAsB,EACtB,IAAgB,EAChB,OAAA,GAA6B,EAAE,EAAA;IAE/B,OAAO;AACH,QAAA,OAAO,EAAE,CAAC,IAAI,KAAI;YACd,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC;AACtC,YAAA,gBAAgB,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC;YAErC,IAAI,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,MAAM,EAAE;AAClC,gBAAA,cAAc,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC;YAC1C;QACJ,CAAC;AACD,QAAA,MAAM,EAAE,MAAM,QAAQ,CAAC,IAAI,CAAC;KAC/B;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/track.mjs b/node_modules/framer-motion/dist/es/render/dom/scroll/track.mjs deleted file mode 100644 index 501837d..0000000 --- a/node_modules/framer-motion/dist/es/render/dom/scroll/track.mjs +++ /dev/null @@ -1,115 +0,0 @@ -import { resize, frame, cancelFrame, frameData } from 'motion-dom'; -import { noop } from 'motion-utils'; -import { createScrollInfo } from './info.mjs'; -import { createOnScrollHandler } from './on-scroll-handler.mjs'; - -const scrollListeners = new WeakMap(); -const resizeListeners = new WeakMap(); -const onScrollHandlers = new WeakMap(); -const scrollSize = new WeakMap(); -const dimensionCheckProcesses = new WeakMap(); -const getEventTarget = (element) => element === document.scrollingElement ? window : element; -function scrollInfo(onScroll, { container = document.scrollingElement, trackContentSize = false, ...options } = {}) { - if (!container) - return noop; - let containerHandlers = onScrollHandlers.get(container); - /** - * Get the onScroll handlers for this container. - * If one isn't found, create a new one. - */ - if (!containerHandlers) { - containerHandlers = new Set(); - onScrollHandlers.set(container, containerHandlers); - } - /** - * Create a new onScroll handler for the provided callback. - */ - const info = createScrollInfo(); - const containerHandler = createOnScrollHandler(container, onScroll, info, options); - containerHandlers.add(containerHandler); - /** - * Check if there's a scroll event listener for this container. - * If not, create one. - */ - if (!scrollListeners.has(container)) { - const measureAll = () => { - for (const handler of containerHandlers) { - handler.measure(frameData.timestamp); - } - frame.preUpdate(notifyAll); - }; - const notifyAll = () => { - for (const handler of containerHandlers) { - handler.notify(); - } - }; - const listener = () => frame.read(measureAll); - scrollListeners.set(container, listener); - const target = getEventTarget(container); - window.addEventListener("resize", listener); - if (container !== document.documentElement) { - resizeListeners.set(container, resize(container, listener)); - } - target.addEventListener("scroll", listener); - listener(); - } - /** - * Enable content size tracking if requested and not already enabled. - */ - if (trackContentSize && !dimensionCheckProcesses.has(container)) { - const listener = scrollListeners.get(container); - // Store initial scroll dimensions (object is reused to avoid allocation) - const size = { - width: container.scrollWidth, - height: container.scrollHeight, - }; - scrollSize.set(container, size); - // Add frame-based scroll dimension checking to detect content changes - const checkScrollDimensions = () => { - const newWidth = container.scrollWidth; - const newHeight = container.scrollHeight; - if (size.width !== newWidth || size.height !== newHeight) { - listener(); - size.width = newWidth; - size.height = newHeight; - } - }; - // Schedule with keepAlive=true to run every frame - const dimensionCheckProcess = frame.read(checkScrollDimensions, true); - dimensionCheckProcesses.set(container, dimensionCheckProcess); - } - const listener = scrollListeners.get(container); - frame.read(listener, false, true); - return () => { - cancelFrame(listener); - /** - * Check if we even have any handlers for this container. - */ - const currentHandlers = onScrollHandlers.get(container); - if (!currentHandlers) - return; - currentHandlers.delete(containerHandler); - if (currentHandlers.size) - return; - /** - * If no more handlers, remove the scroll listener too. - */ - const scrollListener = scrollListeners.get(container); - scrollListeners.delete(container); - if (scrollListener) { - getEventTarget(container).removeEventListener("scroll", scrollListener); - resizeListeners.get(container)?.(); - window.removeEventListener("resize", scrollListener); - } - // Clean up scroll dimension checking - const dimensionCheckProcess = dimensionCheckProcesses.get(container); - if (dimensionCheckProcess) { - cancelFrame(dimensionCheckProcess); - dimensionCheckProcesses.delete(container); - } - scrollSize.delete(container); - }; -} - -export { scrollInfo }; -//# sourceMappingURL=track.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/track.mjs.map b/node_modules/framer-motion/dist/es/render/dom/scroll/track.mjs.map deleted file mode 100644 index be35d66..0000000 --- a/node_modules/framer-motion/dist/es/render/dom/scroll/track.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"track.mjs","sources":["../../../../../src/render/dom/scroll/track.ts"],"sourcesContent":["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()\nconst resizeListeners = new WeakMap()\nconst onScrollHandlers = new WeakMap>()\nconst scrollSize = new WeakMap()\nconst dimensionCheckProcesses = new WeakMap()\n\nexport type ScrollTargets = Array\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"],"names":[],"mappings":";;;;;AAMA,MAAM,eAAe,GAAG,IAAI,OAAO,EAAyB;AAC5D,MAAM,eAAe,GAAG,IAAI,OAAO,EAAyB;AAC5D,MAAM,gBAAgB,GAAG,IAAI,OAAO,EAAiC;AACrE,MAAM,UAAU,GAAG,IAAI,OAAO,EAA8C;AAC5E,MAAM,uBAAuB,GAAG,IAAI,OAAO,EAAoB;AAI/D,MAAM,cAAc,GAAG,CAAC,OAAgB,KACpC,OAAO,KAAK,QAAQ,CAAC,gBAAgB,GAAG,MAAM,GAAG,OAAO;SAE5C,UAAU,CACtB,QAAsB,EACtB,EACI,SAAS,GAAG,QAAQ,CAAC,gBAA2B,EAChD,gBAAgB,GAAG,KAAK,EACxB,GAAG,OAAO,KACS,EAAE,EAAA;AAEzB,IAAA,IAAI,CAAC,SAAS;AAAE,QAAA,OAAO,IAAoB;IAE3C,IAAI,iBAAiB,GAAG,gBAAgB,CAAC,GAAG,CAAC,SAAS,CAAC;AAEvD;;;AAGG;IACH,IAAI,CAAC,iBAAiB,EAAE;AACpB,QAAA,iBAAiB,GAAG,IAAI,GAAG,EAAE;AAC7B,QAAA,gBAAgB,CAAC,GAAG,CAAC,SAAS,EAAE,iBAAiB,CAAC;IACtD;AAEA;;AAEG;AACH,IAAA,MAAM,IAAI,GAAG,gBAAgB,EAAE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CAAC,mBAAmB,CACzC,QAAQ,EACR,cAAc,CACjB;AACD,YAAA,eAAe,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI;AAClC,YAAA,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,cAAc,CAAC;QACxD;;QAGA,MAAM,qBAAqB,GAAG,uBAAuB,CAAC,GAAG,CAAC,SAAS,CAAC;QACpE,IAAI,qBAAqB,EAAE;YACvB,WAAW,CAAC,qBAAqB,CAAC;AAClC,YAAA,uBAAuB,CAAC,MAAM,CAAC,SAAS,CAAC;QAC7C;AACA,QAAA,UAAU,CAAC,MAAM,CAAC,SAAS,CAAC;AAChC,IAAA,CAAC;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/utils/can-use-native-timeline.mjs b/node_modules/framer-motion/dist/es/render/dom/scroll/utils/can-use-native-timeline.mjs deleted file mode 100644 index ed95092..0000000 --- a/node_modules/framer-motion/dist/es/render/dom/scroll/utils/can-use-native-timeline.mjs +++ /dev/null @@ -1,10 +0,0 @@ -import { supportsViewTimeline, supportsScrollTimeline } from 'motion-dom'; - -function canUseNativeTimeline(target) { - if (typeof window === "undefined") - return false; - return target ? supportsViewTimeline() : supportsScrollTimeline(); -} - -export { canUseNativeTimeline }; -//# sourceMappingURL=can-use-native-timeline.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/utils/can-use-native-timeline.mjs.map b/node_modules/framer-motion/dist/es/render/dom/scroll/utils/can-use-native-timeline.mjs.map deleted file mode 100644 index 88a8655..0000000 --- a/node_modules/framer-motion/dist/es/render/dom/scroll/utils/can-use-native-timeline.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"can-use-native-timeline.mjs","sources":["../../../../../../src/render/dom/scroll/utils/can-use-native-timeline.ts"],"sourcesContent":["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"],"names":[],"mappings":";;AAEM,SAAU,oBAAoB,CAAC,MAAgB,EAAA;IACjD,IAAI,OAAO,MAAM,KAAK,WAAW;AAAE,QAAA,OAAO,KAAK;IAC/C,OAAO,MAAM,GAAG,oBAAoB,EAAE,GAAG,sBAAsB,EAAE;AACrE;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/utils/get-timeline.mjs b/node_modules/framer-motion/dist/es/render/dom/scroll/utils/get-timeline.mjs deleted file mode 100644 index e7d2848..0000000 --- a/node_modules/framer-motion/dist/es/render/dom/scroll/utils/get-timeline.mjs +++ /dev/null @@ -1,62 +0,0 @@ -import { scrollInfo } from '../track.mjs'; -import { canUseNativeTimeline } from './can-use-native-timeline.mjs'; -import { offsetToViewTimelineRange } from './offset-to-range.mjs'; - -const timelineCache = new Map(); -function scrollTimelineFallback(options) { - const currentTime = { value: 0 }; - const cancel = scrollInfo((info) => { - currentTime.value = info[options.axis].progress * 100; - }, options); - return { currentTime, cancel }; -} -function getTimeline({ source, container, ...options }) { - const { axis } = options; - if (source) - container = source; - let containerCache = timelineCache.get(container); - if (!containerCache) { - containerCache = new Map(); - timelineCache.set(container, containerCache); - } - const targetKey = options.target ?? "self"; - let targetCache = containerCache.get(targetKey); - if (!targetCache) { - targetCache = {}; - containerCache.set(targetKey, targetCache); - } - const axisKey = axis + (options.offset ?? []).join(","); - if (!targetCache[axisKey]) { - if (options.target && canUseNativeTimeline(options.target)) { - const range = offsetToViewTimelineRange(options.offset); - if (range) { - targetCache[axisKey] = new ViewTimeline({ - subject: options.target, - axis, - }); - } - else { - targetCache[axisKey] = scrollTimelineFallback({ - container, - ...options, - }); - } - } - else if (canUseNativeTimeline()) { - targetCache[axisKey] = new ScrollTimeline({ - source: container, - axis, - }); - } - else { - targetCache[axisKey] = scrollTimelineFallback({ - container, - ...options, - }); - } - } - return targetCache[axisKey]; -} - -export { getTimeline }; -//# sourceMappingURL=get-timeline.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/utils/get-timeline.mjs.map b/node_modules/framer-motion/dist/es/render/dom/scroll/utils/get-timeline.mjs.map deleted file mode 100644 index 9055908..0000000 --- a/node_modules/framer-motion/dist/es/render/dom/scroll/utils/get-timeline.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"get-timeline.mjs","sources":["../../../../../../src/render/dom/scroll/utils/get-timeline.ts"],"sourcesContent":["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>\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"],"names":[],"mappings":";;;;AAsBA,MAAM,aAAa,GAAG,IAAI,GAAG,EAG1B;AAEH,SAAS,sBAAsB,CAAC,OAAkC,EAAA;AAC9D,IAAA,MAAM,WAAW,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE;AAEhC,IAAA,MAAM,MAAM,GAAG,UAAU,CAAC,CAAC,IAAI,KAAI;AAC/B,QAAA,WAAW,CAAC,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,IAAK,CAAC,CAAC,QAAQ,GAAG,GAAG;IAC1D,CAAC,EAAE,OAAO,CAAC;AAEX,IAAA,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE;AAClC;AAEM,SAAU,WAAW,CAAC,EACxB,MAAM,EACN,SAAS,EACT,GAAG,OAAO,EACc,EAAA;AACxB,IAAA,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO;AAExB,IAAA,IAAI,MAAM;QAAE,SAAS,GAAG,MAAM;IAE9B,IAAI,cAAc,GAAG,aAAa,CAAC,GAAG,CAAC,SAAS,CAAC;IACjD,IAAI,CAAC,cAAc,EAAE;AACjB,QAAA,cAAc,GAAG,IAAI,GAAG,EAAE;AAC1B,QAAA,aAAa,CAAC,GAAG,CAAC,SAAS,EAAE,cAAc,CAAC;IAChD;AAEA,IAAA,MAAM,SAAS,GAAG,OAAO,CAAC,MAAM,IAAI,MAAM;IAC1C,IAAI,WAAW,GAAG,cAAc,CAAC,GAAG,CAAC,SAAS,CAAC;IAC/C,IAAI,CAAC,WAAW,EAAE;QACd,WAAW,GAAG,EAAE;AAChB,QAAA,cAAc,CAAC,GAAG,CAAC,SAAS,EAAE,WAAW,CAAC;IAC9C;AAEA,IAAA,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,MAAM,IAAI,EAAE,EAAE,IAAI,CAAC,GAAG,CAAC;AAEvD,IAAA,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE;QACvB,IAAI,OAAO,CAAC,MAAM,IAAI,oBAAoB,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;YACxD,MAAM,KAAK,GAAG,yBAAyB,CAAC,OAAO,CAAC,MAAM,CAAC;YACvD,IAAI,KAAK,EAAE;AACP,gBAAA,WAAW,CAAC,OAAO,CAAC,GAAG,IAAI,YAAY,CAAC;oBACpC,OAAO,EAAE,OAAO,CAAC,MAAM;oBACvB,IAAI;AACP,iBAAA,CAAC;YACN;iBAAO;AACH,gBAAA,WAAW,CAAC,OAAO,CAAC,GAAG,sBAAsB,CAAC;oBAC1C,SAAS;AACT,oBAAA,GAAG,OAAO;AACb,iBAAA,CAAC;YACN;QACJ;aAAO,IAAI,oBAAoB,EAAE,EAAE;AAC/B,YAAA,WAAW,CAAC,OAAO,CAAC,GAAG,IAAI,cAAc,CAAC;AACtC,gBAAA,MAAM,EAAE,SAAS;gBACjB,IAAI;AACA,aAAA,CAAC;QACb;aAAO;AACH,YAAA,WAAW,CAAC,OAAO,CAAC,GAAG,sBAAsB,CAAC;gBAC1C,SAAS;AACT,gBAAA,GAAG,OAAO;AACb,aAAA,CAAC;QACN;IACJ;AAEA,IAAA,OAAO,WAAW,CAAC,OAAO,CAAE;AAChC;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/utils/is-element-tracking.mjs b/node_modules/framer-motion/dist/es/render/dom/scroll/utils/is-element-tracking.mjs deleted file mode 100644 index f801dc7..0000000 --- a/node_modules/framer-motion/dist/es/render/dom/scroll/utils/is-element-tracking.mjs +++ /dev/null @@ -1,10 +0,0 @@ -/** - * Currently, we only support element tracking with `scrollInfo`, though in - * the future we can also offer ViewTimeline support. - */ -function isElementTracking(options) { - return options && (options.target || options.offset); -} - -export { isElementTracking }; -//# sourceMappingURL=is-element-tracking.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/utils/is-element-tracking.mjs.map b/node_modules/framer-motion/dist/es/render/dom/scroll/utils/is-element-tracking.mjs.map deleted file mode 100644 index 06205ef..0000000 --- a/node_modules/framer-motion/dist/es/render/dom/scroll/utils/is-element-tracking.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"is-element-tracking.mjs","sources":["../../../../../../src/render/dom/scroll/utils/is-element-tracking.ts"],"sourcesContent":["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"],"names":[],"mappings":"AAEA;;;AAGG;AACG,SAAU,iBAAiB,CAAC,OAAmC,EAAA;IACjE,OAAO,OAAO,KAAK,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC;AACxD;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/utils/offset-to-range.mjs b/node_modules/framer-motion/dist/es/render/dom/scroll/utils/offset-to-range.mjs deleted file mode 100644 index d2a1cce..0000000 --- a/node_modules/framer-motion/dist/es/render/dom/scroll/utils/offset-to-range.mjs +++ /dev/null @@ -1,73 +0,0 @@ -import { ScrollOffset } from '../offsets/presets.mjs'; - -/** - * Maps from ProgressIntersection pairs used by Motion's preset offsets to - * ViewTimeline named ranges. Returns undefined for unrecognised patterns, - * which signals the caller to fall back to JS-based scroll tracking. - */ -const presets = [ - [ScrollOffset.Enter, "entry"], - [ScrollOffset.Exit, "exit"], - [ScrollOffset.Any, "cover"], - [ScrollOffset.All, "contain"], -]; -const stringToProgress = { - start: 0, - end: 1, -}; -function parseStringOffset(s) { - const parts = s.trim().split(/\s+/); - if (parts.length !== 2) - return undefined; - const a = stringToProgress[parts[0]]; - const b = stringToProgress[parts[1]]; - if (a === undefined || b === undefined) - return undefined; - return [a, b]; -} -function normaliseOffset(offset) { - if (offset.length !== 2) - return undefined; - const result = []; - for (const item of offset) { - if (Array.isArray(item)) { - result.push(item); - } - else if (typeof item === "string") { - const parsed = parseStringOffset(item); - if (!parsed) - return undefined; - result.push(parsed); - } - else { - return undefined; - } - } - return result; -} -function matchesPreset(offset, preset) { - const normalised = normaliseOffset(offset); - if (!normalised) - return false; - for (let i = 0; i < 2; i++) { - const o = normalised[i]; - const p = preset[i]; - if (o[0] !== p[0] || o[1] !== p[1]) - return false; - } - return true; -} -function offsetToViewTimelineRange(offset) { - if (!offset) { - return { rangeStart: "contain 0%", rangeEnd: "contain 100%" }; - } - for (const [preset, name] of presets) { - if (matchesPreset(offset, preset)) { - return { rangeStart: `${name} 0%`, rangeEnd: `${name} 100%` }; - } - } - return undefined; -} - -export { offsetToViewTimelineRange }; -//# sourceMappingURL=offset-to-range.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/utils/offset-to-range.mjs.map b/node_modules/framer-motion/dist/es/render/dom/scroll/utils/offset-to-range.mjs.map deleted file mode 100644 index 985a623..0000000 --- a/node_modules/framer-motion/dist/es/render/dom/scroll/utils/offset-to-range.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"offset-to-range.mjs","sources":["../../../../../../src/render/dom/scroll/utils/offset-to-range.ts"],"sourcesContent":["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 = {\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"],"names":["ScrollOffsetPresets"],"mappings":";;AAQA;;;;AAIG;AACH,MAAM,OAAO,GAAuC;AAChD,IAAA,CAACA,YAAmB,CAAC,KAAK,EAAE,OAAO,CAAC;AACpC,IAAA,CAACA,YAAmB,CAAC,IAAI,EAAE,MAAM,CAAC;AAClC,IAAA,CAACA,YAAmB,CAAC,GAAG,EAAE,OAAO,CAAC;AAClC,IAAA,CAACA,YAAmB,CAAC,GAAG,EAAE,SAAS,CAAC;CACvC;AAED,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C,MAAM,CAAC;AAC1C,IAAA,IAAI,CAAC,UAAU;AAAE,QAAA,OAAO,KAAK;AAE7B,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;AACxB,QAAA,MAAM,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC;AACvB,QAAA,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC;AACnB,QAAA,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAAE,YAAA,OAAO,KAAK;IACpD;AACA,IAAA,OAAO,IAAI;AACf;AAEM,SAAU,yBAAyB,CACrC,MAAqB,EAAA;IAErB,IAAI,CAAC,MAAM,EAAE;QACT,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAE,cAAc,EAAE;IACjE;IAEA,KAAK,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,OAAO,EAAE;AAClC,QAAA,IAAI,aAAa,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE;AAC/B,YAAA,OAAO,EAAE,UAAU,EAAE,CAAA,EAAG,IAAI,CAAA,GAAA,CAAK,EAAE,QAAQ,EAAE,CAAA,EAAG,IAAI,CAAA,KAAA,CAAO,EAAE;QACjE;IACJ;AAEA,IAAA,OAAO,SAAS;AACpB;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/dom/use-render.mjs b/node_modules/framer-motion/dist/es/render/dom/use-render.mjs deleted file mode 100644 index 6dff8a9..0000000 --- a/node_modules/framer-motion/dist/es/render/dom/use-render.mjs +++ /dev/null @@ -1,28 +0,0 @@ -"use client"; -import { isMotionValue } from 'motion-dom'; -import { Fragment, useMemo, createElement } from 'react'; -import { useHTMLProps } from '../html/use-props.mjs'; -import { useSVGProps } from '../svg/use-props.mjs'; -import { filterProps } from './utils/filter-props.mjs'; -import { isSVGComponent } from './utils/is-svg-component.mjs'; - -function useRender(Component, props, ref, { latestValues, }, isStatic, forwardMotionProps = false, isSVG, isValidProp) { - const useVisualProps = (isSVG ?? isSVGComponent(Component)) ? useSVGProps : useHTMLProps; - const visualProps = useVisualProps(props, latestValues, isStatic, Component); - const filteredProps = filterProps(props, typeof Component === "string", forwardMotionProps, isValidProp); - const elementProps = Component !== Fragment ? { ...filteredProps, ...visualProps, ref } : {}; - /** - * If component has been handed a motion value as its child, - * memoise its initial value and render that. Subsequent updates - * will be handled by the onChange handler - */ - const { children } = props; - const renderedChildren = useMemo(() => (isMotionValue(children) ? children.get() : children), [children]); - return createElement(Component, { - ...elementProps, - children: renderedChildren, - }); -} - -export { useRender }; -//# sourceMappingURL=use-render.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/dom/use-render.mjs.map b/node_modules/framer-motion/dist/es/render/dom/use-render.mjs.map deleted file mode 100644 index 3f2f8fa..0000000 --- a/node_modules/framer-motion/dist/es/render/dom/use-render.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"use-render.mjs","sources":["../../../../src/render/dom/use-render.ts"],"sourcesContent":["\"use client\"\n\nimport { isMotionValue } from \"motion-dom\"\nimport { Fragment, createElement, useMemo } from \"react\"\nimport type { IsValidProp } from \"../../context/MotionConfigContext\"\nimport { MotionProps } from \"../../motion/types\"\nimport { VisualState } from \"../../motion/utils/use-visual-state\"\nimport { HTMLRenderState } from \"../html/types\"\nimport { useHTMLProps } from \"../html/use-props\"\nimport { SVGRenderState } from \"../svg/types\"\nimport { useSVGProps } from \"../svg/use-props\"\nimport { DOMMotionComponents } from \"./types\"\nimport { filterProps } from \"./utils/filter-props\"\nimport { isSVGComponent } from \"./utils/is-svg-component\"\n\nexport function useRender<\n Props = {},\n TagName extends keyof DOMMotionComponents | string = \"div\"\n>(\n Component: TagName | string | React.ComponentType,\n props: MotionProps,\n ref: React.Ref,\n {\n latestValues,\n }: VisualState,\n isStatic: boolean,\n forwardMotionProps: boolean = false,\n isSVG?: boolean,\n isValidProp?: IsValidProp\n) {\n const useVisualProps =\n (isSVG ?? isSVGComponent(Component)) ? useSVGProps : useHTMLProps\n\n const visualProps = useVisualProps(\n props as any,\n latestValues,\n isStatic,\n Component as any\n )\n const filteredProps = filterProps(\n props,\n typeof Component === \"string\",\n forwardMotionProps,\n isValidProp\n )\n const elementProps =\n Component !== Fragment ? { ...filteredProps, ...visualProps, ref } : {}\n\n /**\n * If component has been handed a motion value as its child,\n * memoise its initial value and render that. Subsequent updates\n * will be handled by the onChange handler\n */\n const { children } = props\n const renderedChildren = useMemo(\n () => (isMotionValue(children) ? children.get() : children),\n [children]\n )\n\n return createElement(Component, {\n ...elementProps,\n children: renderedChildren,\n })\n}\n"],"names":[],"mappings":";;;;;;;;AAeM;AAeF;AAGA;AAMA;;AASA;;;;AAIG;AACH;AACA;;AAMI;AACA;AACH;AACL;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/dom/utils/filter-props.mjs b/node_modules/framer-motion/dist/es/render/dom/utils/filter-props.mjs deleted file mode 100644 index ac0cfc5..0000000 --- a/node_modules/framer-motion/dist/es/render/dom/utils/filter-props.mjs +++ /dev/null @@ -1,37 +0,0 @@ -import { isMotionValue } from 'motion-dom'; -import { isValidMotionProp } from '../../../motion/utils/valid-prop.mjs'; - -function shouldForward(key, isValidProp) { - return key.startsWith("on") - ? !isValidMotionProp(key) - : isValidProp?.(key) ?? !isValidMotionProp(key); -} -function filterProps(props, isDom, forwardMotionProps, isValidProp) { - const filteredProps = {}; - for (const key in props) { - /** - * values is considered a valid prop by Emotion, so if it's present - * this will be rendered out to the DOM unless explicitly filtered. - * - * We check the type as it could be used with the `feColorMatrix` - * element, which we support. - */ - if (key === "values" && typeof props.values === "object") - continue; - if (isMotionValue(props[key])) - continue; - if (shouldForward(key, isValidProp) || - (forwardMotionProps === true && isValidMotionProp(key)) || - (!isDom && !isValidMotionProp(key)) || - // If trying to use native HTML drag events, forward drag listeners - (props["draggable"] && - key.startsWith("onDrag"))) { - filteredProps[key] = - props[key]; - } - } - return filteredProps; -} - -export { filterProps }; -//# sourceMappingURL=filter-props.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/dom/utils/filter-props.mjs.map b/node_modules/framer-motion/dist/es/render/dom/utils/filter-props.mjs.map deleted file mode 100644 index 8825562..0000000 --- a/node_modules/framer-motion/dist/es/render/dom/utils/filter-props.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"filter-props.mjs","sources":["../../../../../src/render/dom/utils/filter-props.ts"],"sourcesContent":["import { isMotionValue } from \"motion-dom\"\nimport type { IsValidProp } from \"../../../context/MotionConfigContext\"\nimport type { MotionProps } from \"../../../motion/types\"\nimport { isValidMotionProp } from \"../../../motion/utils/valid-prop\"\n\nfunction shouldForward(key: string, isValidProp?: IsValidProp) {\n return key.startsWith(\"on\")\n ? !isValidMotionProp(key)\n : isValidProp?.(key) ?? !isValidMotionProp(key)\n}\n\nexport function filterProps(\n props: MotionProps,\n isDom: boolean,\n forwardMotionProps: boolean,\n isValidProp?: IsValidProp\n) {\n const filteredProps: MotionProps = {}\n\n for (const key in props) {\n /**\n * values is considered a valid prop by Emotion, so if it's present\n * this will be rendered out to the DOM unless explicitly filtered.\n *\n * We check the type as it could be used with the `feColorMatrix`\n * element, which we support.\n */\n if (key === \"values\" && typeof props.values === \"object\") continue\n\n if (isMotionValue(props[key as keyof typeof props])) continue\n\n if (\n shouldForward(key, isValidProp) ||\n (forwardMotionProps === true && isValidMotionProp(key)) ||\n (!isDom && !isValidMotionProp(key)) ||\n // If trying to use native HTML drag events, forward drag listeners\n (props[\"draggable\" as keyof MotionProps] &&\n key.startsWith(\"onDrag\"))\n ) {\n filteredProps[key as keyof MotionProps] =\n props[key as keyof MotionProps]\n }\n }\n\n return filteredProps\n}\n"],"names":[],"mappings":";;;AAKA,SAAS,aAAa,CAAC,GAAW,EAAE,WAAyB,EAAA;AACzD,IAAA,OAAO,GAAG,CAAC,UAAU,CAAC,IAAI;AACtB,UAAE,CAAC,iBAAiB,CAAC,GAAG;AACxB,UAAE,WAAW,GAAG,GAAG,CAAC,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC;AACvD;AAEM,SAAU,WAAW,CACvB,KAAkB,EAClB,KAAc,EACd,kBAA2B,EAC3B,WAAyB,EAAA;IAEzB,MAAM,aAAa,GAAgB,EAAE;AAErC,IAAA,KAAK,MAAM,GAAG,IAAI,KAAK,EAAE;AACrB;;;;;;AAMG;QACH,IAAI,GAAG,KAAK,QAAQ,IAAI,OAAO,KAAK,CAAC,MAAM,KAAK,QAAQ;YAAE;AAE1D,QAAA,IAAI,aAAa,CAAC,KAAK,CAAC,GAAyB,CAAC,CAAC;YAAE;AAErD,QAAA,IACI,aAAa,CAAC,GAAG,EAAE,WAAW,CAAC;aAC9B,kBAAkB,KAAK,IAAI,IAAI,iBAAiB,CAAC,GAAG,CAAC,CAAC;aACtD,CAAC,KAAK,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC;;aAElC,KAAK,CAAC,WAAgC,CAAC;AACpC,gBAAA,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,EAC/B;YACE,aAAa,CAAC,GAAwB,CAAC;gBACnC,KAAK,CAAC,GAAwB,CAAC;QACvC;IACJ;AAEA,IAAA,OAAO,aAAa;AACxB;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/dom/utils/is-svg-component.mjs b/node_modules/framer-motion/dist/es/render/dom/utils/is-svg-component.mjs deleted file mode 100644 index e300fc1..0000000 --- a/node_modules/framer-motion/dist/es/render/dom/utils/is-svg-component.mjs +++ /dev/null @@ -1,31 +0,0 @@ -import { lowercaseSVGElements } from '../../svg/lowercase-elements.mjs'; - -function isSVGComponent(Component) { - if ( - /** - * If it's not a string, it's a custom React component. Currently we only support - * HTML custom React components. - */ - typeof Component !== "string" || - /** - * If it contains a dash, the element is a custom HTML webcomponent. - */ - Component.includes("-")) { - return false; - } - else if ( - /** - * If it's in our list of lowercase SVG tags, it's an SVG component - */ - lowercaseSVGElements.indexOf(Component) > -1 || - /** - * If it contains a capital letter, it's an SVG component - */ - /[A-Z]/u.test(Component)) { - return true; - } - return false; -} - -export { isSVGComponent }; -//# sourceMappingURL=is-svg-component.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/dom/utils/is-svg-component.mjs.map b/node_modules/framer-motion/dist/es/render/dom/utils/is-svg-component.mjs.map deleted file mode 100644 index 88e680d..0000000 --- a/node_modules/framer-motion/dist/es/render/dom/utils/is-svg-component.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"is-svg-component.mjs","sources":["../../../../../src/render/dom/utils/is-svg-component.ts"],"sourcesContent":["import * as React from \"react\"\nimport { lowercaseSVGElements } from \"../../svg/lowercase-elements\"\n\nexport function isSVGComponent(Component: string | React.ComponentType) {\n if (\n /**\n * If it's not a string, it's a custom React component. Currently we only support\n * HTML custom React components.\n */\n typeof Component !== \"string\" ||\n /**\n * If it contains a dash, the element is a custom HTML webcomponent.\n */\n Component.includes(\"-\")\n ) {\n return false\n } else if (\n /**\n * If it's in our list of lowercase SVG tags, it's an SVG component\n */\n lowercaseSVGElements.indexOf(Component) > -1 ||\n /**\n * If it contains a capital letter, it's an SVG component\n */\n /[A-Z]/u.test(Component)\n ) {\n return true\n }\n\n return false\n}\n"],"names":[],"mappings":";;AAGM,SAAU,cAAc,CAAC,SAA4C,EAAA;AACvE,IAAA;AACI;;;AAGG;IACH,OAAO,SAAS,KAAK,QAAQ;AAC7B;;AAEG;AACH,QAAA,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,EACzB;AACE,QAAA,OAAO,KAAK;IAChB;AAAO,SAAA;AACH;;AAEG;AACH,IAAA,oBAAoB,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,EAAE;AAC5C;;AAEG;AACH,QAAA,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,EAC1B;AACE,QAAA,OAAO,IAAI;IACf;AAEA,IAAA,OAAO,KAAK;AAChB;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/dom/viewport/index.mjs b/node_modules/framer-motion/dist/es/render/dom/viewport/index.mjs deleted file mode 100644 index 93c0f8d..0000000 --- a/node_modules/framer-motion/dist/es/render/dom/viewport/index.mjs +++ /dev/null @@ -1,44 +0,0 @@ -import { resolveElements } from 'motion-dom'; - -const thresholds = { - some: 0, - all: 1, -}; -function inView(elementOrSelector, onStart, { root, margin: rootMargin, amount = "some" } = {}) { - const elements = resolveElements(elementOrSelector); - const activeIntersections = new WeakMap(); - const onIntersectionChange = (entries) => { - entries.forEach((entry) => { - const onEnd = activeIntersections.get(entry.target); - /** - * If there's no change to the intersection, we don't need to - * do anything here. - */ - if (entry.isIntersecting === Boolean(onEnd)) - return; - if (entry.isIntersecting) { - const newOnEnd = onStart(entry.target, entry); - if (typeof newOnEnd === "function") { - activeIntersections.set(entry.target, newOnEnd); - } - else { - observer.unobserve(entry.target); - } - } - else if (typeof onEnd === "function") { - onEnd(entry); - activeIntersections.delete(entry.target); - } - }); - }; - const observer = new IntersectionObserver(onIntersectionChange, { - root, - rootMargin, - threshold: typeof amount === "number" ? amount : thresholds[amount], - }); - elements.forEach((element) => observer.observe(element)); - return () => observer.disconnect(); -} - -export { inView }; -//# sourceMappingURL=index.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/dom/viewport/index.mjs.map b/node_modules/framer-motion/dist/es/render/dom/viewport/index.mjs.map deleted file mode 100644 index 7424f4a..0000000 --- a/node_modules/framer-motion/dist/es/render/dom/viewport/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs","sources":["../../../../../src/render/dom/viewport/index.ts"],"sourcesContent":["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()\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"],"names":[],"mappings":";;AAiBA,MAAM,UAAU,GAAG;AACf,IAAA,IAAI,EAAE,CAAC;AACP,IAAA,GAAG,EAAE,CAAC;CACT;SAEe,MAAM,CAClB,iBAAoC,EACpC,OAG6B,EAC7B,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,KAAoB,EAAE,EAAA;AAEjE,IAAA,MAAM,QAAQ,GAAG,eAAe,CAAC,iBAAiB,CAAC;AAEnD,IAAA,MAAM,mBAAmB,GAAG,IAAI,OAAO,EAA8B;AAErE,IAAA,MAAM,oBAAoB,GAAiC,CAAC,OAAO,KAAI;AACnE,QAAA,OAAO,CAAC,OAAO,CAAC,CAAC,KAAK,KAAI;YACtB,MAAM,KAAK,GAAG,mBAAmB,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC;AAEnD;;;AAGG;AACH,YAAA,IAAI,KAAK,CAAC,cAAc,KAAK,OAAO,CAAC,KAAK,CAAC;gBAAE;AAE7C,YAAA,IAAI,KAAK,CAAC,cAAc,EAAE;gBACtB,MAAM,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC;AAC7C,gBAAA,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE;oBAChC,mBAAmB,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,EAAE,QAAQ,CAAC;gBACnD;qBAAO;AACH,oBAAA,QAAQ,CAAC,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC;gBACpC;YACJ;AAAO,iBAAA,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE;gBACpC,KAAK,CAAC,KAAK,CAAC;AACZ,gBAAA,mBAAmB,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC;YAC5C;AACJ,QAAA,CAAC,CAAC;AACN,IAAA,CAAC;AAED,IAAA,MAAM,QAAQ,GAAG,IAAI,oBAAoB,CAAC,oBAAoB,EAAE;QAC5D,IAAI;QACJ,UAAU;AACV,QAAA,SAAS,EAAE,OAAO,MAAM,KAAK,QAAQ,GAAG,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;AACtE,KAAA,CAAC;AAEF,IAAA,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,KAAK,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;AAExD,IAAA,OAAO,MAAM,QAAQ,CAAC,UAAU,EAAE;AACtC;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/html/use-html-visual-state.mjs b/node_modules/framer-motion/dist/es/render/html/use-html-visual-state.mjs deleted file mode 100644 index 3b31d71..0000000 --- a/node_modules/framer-motion/dist/es/render/html/use-html-visual-state.mjs +++ /dev/null @@ -1,12 +0,0 @@ -"use client"; -import { scrapeHTMLMotionValuesFromProps } from 'motion-dom'; -import { makeUseVisualState } from '../../motion/utils/use-visual-state.mjs'; -import { createHtmlRenderState } from './utils/create-render-state.mjs'; - -const useHTMLVisualState = /*@__PURE__*/ makeUseVisualState({ - scrapeMotionValuesFromProps: scrapeHTMLMotionValuesFromProps, - createRenderState: createHtmlRenderState, -}); - -export { useHTMLVisualState }; -//# sourceMappingURL=use-html-visual-state.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/html/use-html-visual-state.mjs.map b/node_modules/framer-motion/dist/es/render/html/use-html-visual-state.mjs.map deleted file mode 100644 index 5ed058b..0000000 --- a/node_modules/framer-motion/dist/es/render/html/use-html-visual-state.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"use-html-visual-state.mjs","sources":["../../../../src/render/html/use-html-visual-state.ts"],"sourcesContent":["\"use client\"\n\nimport { scrapeHTMLMotionValuesFromProps } from \"motion-dom\"\nimport { makeUseVisualState } from \"../../motion/utils/use-visual-state\"\nimport { createHtmlRenderState } from \"./utils/create-render-state\"\n\nexport const useHTMLVisualState = /*@__PURE__*/ makeUseVisualState({\n scrapeMotionValuesFromProps: scrapeHTMLMotionValuesFromProps,\n createRenderState: createHtmlRenderState,\n})\n"],"names":[],"mappings":";;;;;AAMO;AACH;AACA;AACH;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/html/use-props.mjs b/node_modules/framer-motion/dist/es/render/html/use-props.mjs deleted file mode 100644 index 62e5556..0000000 --- a/node_modules/framer-motion/dist/es/render/html/use-props.mjs +++ /dev/null @@ -1,57 +0,0 @@ -"use client"; -import { isMotionValue, isForcedMotionValue, buildHTMLStyles } from 'motion-dom'; -import { useMemo } from 'react'; -import { createHtmlRenderState } from './utils/create-render-state.mjs'; - -function copyRawValuesOnly(target, source, props) { - for (const key in source) { - if (!isMotionValue(source[key]) && !isForcedMotionValue(key, props)) { - target[key] = source[key]; - } - } -} -function useInitialMotionValues({ transformTemplate }, visualState) { - return useMemo(() => { - const state = createHtmlRenderState(); - buildHTMLStyles(state, visualState, transformTemplate); - return Object.assign({}, state.vars, state.style); - }, [visualState]); -} -function useStyle(props, visualState) { - const styleProp = props.style || {}; - const style = {}; - /** - * Copy non-Motion Values straight into style - */ - copyRawValuesOnly(style, styleProp, props); - Object.assign(style, useInitialMotionValues(props, visualState)); - return style; -} -function useHTMLProps(props, visualState) { - // The `any` isn't ideal but it is the type of createElement props argument - const htmlProps = {}; - const style = useStyle(props, visualState); - if (props.drag && props.dragListener !== false) { - // Disable the ghost element when a user drags - htmlProps.draggable = false; - // Disable text selection - style.userSelect = - style.WebkitUserSelect = - style.WebkitTouchCallout = - "none"; - // Disable scrolling on the draggable direction - style.touchAction = - props.drag === true - ? "none" - : `pan-${props.drag === "x" ? "y" : "x"}`; - } - if (props.tabIndex === undefined && - (props.onTap || props.onTapStart || props.whileTap)) { - htmlProps.tabIndex = 0; - } - htmlProps.style = style; - return htmlProps; -} - -export { copyRawValuesOnly, useHTMLProps }; -//# sourceMappingURL=use-props.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/html/use-props.mjs.map b/node_modules/framer-motion/dist/es/render/html/use-props.mjs.map deleted file mode 100644 index 2c10e9a..0000000 --- a/node_modules/framer-motion/dist/es/render/html/use-props.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"use-props.mjs","sources":["../../../../src/render/html/use-props.ts"],"sourcesContent":["\"use client\"\n\nimport { AnyResolvedKeyframe, buildHTMLStyles, isForcedMotionValue, isMotionValue, MotionValue } from \"motion-dom\"\nimport { HTMLProps, useMemo } from \"react\"\nimport { MotionProps } from \"../../motion/types\"\nimport { ResolvedValues } from \"../types\"\nimport { createHtmlRenderState } from \"./utils/create-render-state\"\n\nexport function copyRawValuesOnly(\n target: ResolvedValues,\n source: { [key: string]: AnyResolvedKeyframe | MotionValue },\n props: MotionProps\n) {\n for (const key in source) {\n if (!isMotionValue(source[key]) && !isForcedMotionValue(key, props)) {\n target[key] = source[key] as AnyResolvedKeyframe\n }\n }\n}\n\nfunction useInitialMotionValues(\n { transformTemplate }: MotionProps,\n visualState: ResolvedValues\n) {\n return useMemo(() => {\n const state = createHtmlRenderState()\n\n buildHTMLStyles(state, visualState, transformTemplate)\n\n return Object.assign({}, state.vars, state.style)\n }, [visualState])\n}\n\nfunction useStyle(\n props: MotionProps,\n visualState: ResolvedValues\n): ResolvedValues {\n const styleProp = props.style || {}\n const style = {}\n\n /**\n * Copy non-Motion Values straight into style\n */\n copyRawValuesOnly(style, styleProp as any, props)\n\n Object.assign(style, useInitialMotionValues(props, visualState))\n\n return style\n}\n\nexport function useHTMLProps(\n props: MotionProps & HTMLProps,\n visualState: ResolvedValues\n) {\n // The `any` isn't ideal but it is the type of createElement props argument\n const htmlProps: any = {}\n const style = useStyle(props, visualState)\n\n if (props.drag && props.dragListener !== false) {\n // Disable the ghost element when a user drags\n htmlProps.draggable = false\n\n // Disable text selection\n style.userSelect =\n style.WebkitUserSelect =\n style.WebkitTouchCallout =\n \"none\"\n\n // Disable scrolling on the draggable direction\n style.touchAction =\n props.drag === true\n ? \"none\"\n : `pan-${props.drag === \"x\" ? \"y\" : \"x\"}`\n }\n\n if (\n props.tabIndex === undefined &&\n (props.onTap || props.onTapStart || props.whileTap)\n ) {\n htmlProps.tabIndex = 0\n }\n\n htmlProps.style = style\n\n return htmlProps\n}\n"],"names":[],"mappings":";;;;;;AAaI;AACI;;;;AAIR;AAEA;;AAKQ;AAEA;AAEA;AACJ;AACJ;AAEA;AAII;;AAGA;;AAEG;AACH;AAEA;AAEA;AACJ;AAEM;;;;;;AAUE;;AAGA;AACI;AACA;AACI;;AAGR;;AAEQ;AACA;;AAGZ;AAEI;AAEA;;AAGJ;AAEA;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/html/utils/create-render-state.mjs b/node_modules/framer-motion/dist/es/render/html/utils/create-render-state.mjs deleted file mode 100644 index e387201..0000000 --- a/node_modules/framer-motion/dist/es/render/html/utils/create-render-state.mjs +++ /dev/null @@ -1,9 +0,0 @@ -const createHtmlRenderState = () => ({ - style: {}, - transform: {}, - transformOrigin: {}, - vars: {}, -}); - -export { createHtmlRenderState }; -//# sourceMappingURL=create-render-state.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/html/utils/create-render-state.mjs.map b/node_modules/framer-motion/dist/es/render/html/utils/create-render-state.mjs.map deleted file mode 100644 index 5d7fcc4..0000000 --- a/node_modules/framer-motion/dist/es/render/html/utils/create-render-state.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"create-render-state.mjs","sources":["../../../../../src/render/html/utils/create-render-state.ts"],"sourcesContent":["import { HTMLRenderState } from \"../types\"\n\nexport const createHtmlRenderState = (): HTMLRenderState => ({\n style: {},\n transform: {},\n transformOrigin: {},\n vars: {},\n})\n"],"names":[],"mappings":"AAEO,MAAM,qBAAqB,GAAG,OAAwB;AACzD,IAAA,KAAK,EAAE,EAAE;AACT,IAAA,SAAS,EAAE,EAAE;AACb,IAAA,eAAe,EAAE,EAAE;AACnB,IAAA,IAAI,EAAE,EAAE;AACX,CAAA;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/svg/lowercase-elements.mjs b/node_modules/framer-motion/dist/es/render/svg/lowercase-elements.mjs deleted file mode 100644 index 0177ce0..0000000 --- a/node_modules/framer-motion/dist/es/render/svg/lowercase-elements.mjs +++ /dev/null @@ -1,34 +0,0 @@ -/** - * We keep these listed separately as we use the lowercase tag names as part - * of the runtime bundle to detect SVG components - */ -const lowercaseSVGElements = [ - "animate", - "circle", - "defs", - "desc", - "ellipse", - "g", - "image", - "line", - "filter", - "marker", - "mask", - "metadata", - "path", - "pattern", - "polygon", - "polyline", - "rect", - "stop", - "switch", - "symbol", - "svg", - "text", - "tspan", - "use", - "view", -]; - -export { lowercaseSVGElements }; -//# sourceMappingURL=lowercase-elements.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/svg/lowercase-elements.mjs.map b/node_modules/framer-motion/dist/es/render/svg/lowercase-elements.mjs.map deleted file mode 100644 index 3e9fda0..0000000 --- a/node_modules/framer-motion/dist/es/render/svg/lowercase-elements.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"lowercase-elements.mjs","sources":["../../../../src/render/svg/lowercase-elements.ts"],"sourcesContent":["/**\n * We keep these listed separately as we use the lowercase tag names as part\n * of the runtime bundle to detect SVG components\n */\nexport const lowercaseSVGElements = [\n \"animate\",\n \"circle\",\n \"defs\",\n \"desc\",\n \"ellipse\",\n \"g\",\n \"image\",\n \"line\",\n \"filter\",\n \"marker\",\n \"mask\",\n \"metadata\",\n \"path\",\n \"pattern\",\n \"polygon\",\n \"polyline\",\n \"rect\",\n \"stop\",\n \"switch\",\n \"symbol\",\n \"svg\",\n \"text\",\n \"tspan\",\n \"use\",\n \"view\",\n]\n"],"names":[],"mappings":"AAAA;;;AAGG;AACI,MAAM,oBAAoB,GAAG;IAChC,SAAS;IACT,QAAQ;IACR,MAAM;IACN,MAAM;IACN,SAAS;IACT,GAAG;IACH,OAAO;IACP,MAAM;IACN,QAAQ;IACR,QAAQ;IACR,MAAM;IACN,UAAU;IACV,MAAM;IACN,SAAS;IACT,SAAS;IACT,UAAU;IACV,MAAM;IACN,MAAM;IACN,QAAQ;IACR,QAAQ;IACR,KAAK;IACL,MAAM;IACN,OAAO;IACP,KAAK;IACL,MAAM;;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/svg/use-props.mjs b/node_modules/framer-motion/dist/es/render/svg/use-props.mjs deleted file mode 100644 index c992b5f..0000000 --- a/node_modules/framer-motion/dist/es/render/svg/use-props.mjs +++ /dev/null @@ -1,25 +0,0 @@ -"use client"; -import { buildSVGAttrs, isSVGTag } from 'motion-dom'; -import { useMemo } from 'react'; -import { copyRawValuesOnly } from '../html/use-props.mjs'; -import { createSvgRenderState } from './utils/create-render-state.mjs'; - -function useSVGProps(props, visualState, _isStatic, Component) { - const visualProps = useMemo(() => { - const state = createSvgRenderState(); - buildSVGAttrs(state, visualState, isSVGTag(Component), props.transformTemplate, props.style); - return { - ...state.attrs, - style: { ...state.style }, - }; - }, [visualState]); - if (props.style) { - const rawStyles = {}; - copyRawValuesOnly(rawStyles, props.style, props); - visualProps.style = { ...rawStyles, ...visualProps.style }; - } - return visualProps; -} - -export { useSVGProps }; -//# sourceMappingURL=use-props.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/svg/use-props.mjs.map b/node_modules/framer-motion/dist/es/render/svg/use-props.mjs.map deleted file mode 100644 index 6d16ff9..0000000 --- a/node_modules/framer-motion/dist/es/render/svg/use-props.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"use-props.mjs","sources":["../../../../src/render/svg/use-props.ts"],"sourcesContent":["\"use client\"\n\nimport { buildSVGAttrs, isSVGTag } from \"motion-dom\"\nimport { useMemo } from \"react\"\nimport { MotionProps } from \"../../motion/types\"\nimport { copyRawValuesOnly } from \"../html/use-props\"\nimport { ResolvedValues } from \"../types\"\nimport { createSvgRenderState } from \"./utils/create-render-state\"\n\nexport function useSVGProps(\n props: MotionProps,\n visualState: ResolvedValues,\n _isStatic: boolean,\n Component: string | React.ComponentType>\n) {\n const visualProps = useMemo(() => {\n const state = createSvgRenderState()\n\n buildSVGAttrs(\n state,\n visualState,\n isSVGTag(Component),\n props.transformTemplate,\n props.style\n )\n\n return {\n ...state.attrs,\n style: { ...state.style },\n }\n }, [visualState])\n\n if (props.style) {\n const rawStyles = {}\n copyRawValuesOnly(rawStyles, props.style as any, props)\n visualProps.style = { ...rawStyles, ...visualProps.style }\n }\n\n return visualProps\n}\n"],"names":[],"mappings":";;;;;;AASM;AAMF;AACI;AAEA;;;AAUI;;AAER;AAEA;;;AAGI;;AAGJ;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/svg/use-svg-visual-state.mjs b/node_modules/framer-motion/dist/es/render/svg/use-svg-visual-state.mjs deleted file mode 100644 index a987d88..0000000 --- a/node_modules/framer-motion/dist/es/render/svg/use-svg-visual-state.mjs +++ /dev/null @@ -1,12 +0,0 @@ -"use client"; -import { scrapeSVGMotionValuesFromProps } from 'motion-dom'; -import { makeUseVisualState } from '../../motion/utils/use-visual-state.mjs'; -import { createSvgRenderState } from './utils/create-render-state.mjs'; - -const useSVGVisualState = /*@__PURE__*/ makeUseVisualState({ - scrapeMotionValuesFromProps: scrapeSVGMotionValuesFromProps, - createRenderState: createSvgRenderState, -}); - -export { useSVGVisualState }; -//# sourceMappingURL=use-svg-visual-state.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/svg/use-svg-visual-state.mjs.map b/node_modules/framer-motion/dist/es/render/svg/use-svg-visual-state.mjs.map deleted file mode 100644 index 7f4d418..0000000 --- a/node_modules/framer-motion/dist/es/render/svg/use-svg-visual-state.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"use-svg-visual-state.mjs","sources":["../../../../src/render/svg/use-svg-visual-state.ts"],"sourcesContent":["\"use client\"\n\nimport { scrapeSVGMotionValuesFromProps } from \"motion-dom\"\nimport { makeUseVisualState } from \"../../motion/utils/use-visual-state\"\nimport { createSvgRenderState } from \"./utils/create-render-state\"\n\nexport const useSVGVisualState = /*@__PURE__*/ makeUseVisualState({\n scrapeMotionValuesFromProps: scrapeSVGMotionValuesFromProps,\n createRenderState: createSvgRenderState,\n})\n"],"names":[],"mappings":";;;;;AAMO;AACH;AACA;AACH;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.mjs b/node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.mjs deleted file mode 100644 index 884270f..0000000 --- a/node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.mjs +++ /dev/null @@ -1,9 +0,0 @@ -import { createHtmlRenderState } from '../../html/utils/create-render-state.mjs'; - -const createSvgRenderState = () => ({ - ...createHtmlRenderState(), - attrs: {}, -}); - -export { createSvgRenderState }; -//# sourceMappingURL=create-render-state.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.mjs.map b/node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.mjs.map deleted file mode 100644 index 409d46c..0000000 --- a/node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"create-render-state.mjs","sources":["../../../../../src/render/svg/utils/create-render-state.ts"],"sourcesContent":["import { createHtmlRenderState } from \"../../html/utils/create-render-state\"\nimport { SVGRenderState } from \"../types\"\n\nexport const createSvgRenderState = (): SVGRenderState => ({\n ...createHtmlRenderState(),\n attrs: {},\n})\n"],"names":[],"mappings":";;AAGO,MAAM,oBAAoB,GAAG,OAAuB;AACvD,IAAA,GAAG,qBAAqB,EAAE;AAC1B,IAAA,KAAK,EAAE,EAAE;AACZ,CAAA;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/utils/distance.mjs b/node_modules/framer-motion/dist/es/utils/distance.mjs deleted file mode 100644 index c7ff075..0000000 --- a/node_modules/framer-motion/dist/es/utils/distance.mjs +++ /dev/null @@ -1,10 +0,0 @@ -const distance = (a, b) => Math.abs(a - b); -function distance2D(a, b) { - // Multi-dimensional - const xDelta = distance(a.x, b.x); - const yDelta = distance(a.y, b.y); - return Math.sqrt(xDelta ** 2 + yDelta ** 2); -} - -export { distance, distance2D }; -//# sourceMappingURL=distance.mjs.map diff --git a/node_modules/framer-motion/dist/es/utils/distance.mjs.map b/node_modules/framer-motion/dist/es/utils/distance.mjs.map deleted file mode 100644 index 94ed1f6..0000000 --- a/node_modules/framer-motion/dist/es/utils/distance.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"distance.mjs","sources":["../../../src/utils/distance.ts"],"sourcesContent":["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"],"names":[],"mappings":"AAEO,MAAM,QAAQ,GAAG,CAAC,CAAS,EAAE,CAAS,KAAK,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC;AAE1D,SAAU,UAAU,CAAC,CAAQ,EAAE,CAAQ,EAAA;;AAEzC,IAAA,MAAM,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AACjC,IAAA,MAAM,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AACjC,IAAA,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,GAAG,MAAM,IAAI,CAAC,CAAC;AAC/C;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/utils/get-context-window.mjs b/node_modules/framer-motion/dist/es/utils/get-context-window.mjs deleted file mode 100644 index 02fa901..0000000 --- a/node_modules/framer-motion/dist/es/utils/get-context-window.mjs +++ /dev/null @@ -1,7 +0,0 @@ -// Fixes https://github.com/motiondivision/motion/issues/2270 -const getContextWindow = ({ current }) => { - return current ? current.ownerDocument.defaultView : null; -}; - -export { getContextWindow }; -//# sourceMappingURL=get-context-window.mjs.map diff --git a/node_modules/framer-motion/dist/es/utils/get-context-window.mjs.map b/node_modules/framer-motion/dist/es/utils/get-context-window.mjs.map deleted file mode 100644 index 4486b70..0000000 --- a/node_modules/framer-motion/dist/es/utils/get-context-window.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"get-context-window.mjs","sources":["../../../src/utils/get-context-window.ts"],"sourcesContent":["import type { VisualElement } from \"motion-dom\"\n\n// Fixes https://github.com/motiondivision/motion/issues/2270\nexport const getContextWindow = ({ current }: VisualElement) => {\n return current ? current.ownerDocument.defaultView : null\n}\n"],"names":[],"mappings":"AAEA;MACa,gBAAgB,GAAG,CAAC,EAAE,OAAO,EAA0B,KAAI;AACpE,IAAA,OAAO,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC,WAAW,GAAG,IAAI;AAC7D;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/utils/is-browser.mjs b/node_modules/framer-motion/dist/es/utils/is-browser.mjs deleted file mode 100644 index 870cec2..0000000 --- a/node_modules/framer-motion/dist/es/utils/is-browser.mjs +++ /dev/null @@ -1,4 +0,0 @@ -const isBrowser = typeof window !== "undefined"; - -export { isBrowser }; -//# sourceMappingURL=is-browser.mjs.map diff --git a/node_modules/framer-motion/dist/es/utils/is-browser.mjs.map b/node_modules/framer-motion/dist/es/utils/is-browser.mjs.map deleted file mode 100644 index 5cf8d86..0000000 --- a/node_modules/framer-motion/dist/es/utils/is-browser.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"is-browser.mjs","sources":["../../../src/utils/is-browser.ts"],"sourcesContent":["export const isBrowser = typeof window !== \"undefined\"\n"],"names":[],"mappings":"MAAa,SAAS,GAAG,OAAO,MAAM,KAAK;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/utils/is-ref-object.mjs b/node_modules/framer-motion/dist/es/utils/is-ref-object.mjs deleted file mode 100644 index 7c2f9bb..0000000 --- a/node_modules/framer-motion/dist/es/utils/is-ref-object.mjs +++ /dev/null @@ -1,8 +0,0 @@ -function isRefObject(ref) { - return (ref && - typeof ref === "object" && - Object.prototype.hasOwnProperty.call(ref, "current")); -} - -export { isRefObject }; -//# sourceMappingURL=is-ref-object.mjs.map diff --git a/node_modules/framer-motion/dist/es/utils/is-ref-object.mjs.map b/node_modules/framer-motion/dist/es/utils/is-ref-object.mjs.map deleted file mode 100644 index 9565b7f..0000000 --- a/node_modules/framer-motion/dist/es/utils/is-ref-object.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"is-ref-object.mjs","sources":["../../../src/utils/is-ref-object.ts"],"sourcesContent":["import { MutableRefObject } from \"./safe-react-types\"\n\nexport function isRefObject(ref: any): ref is MutableRefObject {\n return (\n ref &&\n typeof ref === \"object\" &&\n Object.prototype.hasOwnProperty.call(ref, \"current\")\n )\n}\n"],"names":[],"mappings":"AAEM,SAAU,WAAW,CAAU,GAAQ,EAAA;AACzC,IAAA,QACI,GAAG;QACH,OAAO,GAAG,KAAK,QAAQ;AACvB,QAAA,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,SAAS,CAAC;AAE5D;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion-config.mjs b/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion-config.mjs deleted file mode 100644 index f4a36b0..0000000 --- a/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion-config.mjs +++ /dev/null @@ -1,21 +0,0 @@ -"use client"; -import { useContext } from 'react'; -import { MotionConfigContext } from '../../context/MotionConfigContext.mjs'; -import { useReducedMotion } from './use-reduced-motion.mjs'; - -function useReducedMotionConfig() { - const reducedMotionPreference = useReducedMotion(); - const { reducedMotion } = useContext(MotionConfigContext); - if (reducedMotion === "never") { - return false; - } - else if (reducedMotion === "always") { - return true; - } - else { - return reducedMotionPreference; - } -} - -export { useReducedMotionConfig }; -//# sourceMappingURL=use-reduced-motion-config.mjs.map diff --git a/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion-config.mjs.map b/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion-config.mjs.map deleted file mode 100644 index 27f54f2..0000000 --- a/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion-config.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"use-reduced-motion-config.mjs","sources":["../../../../src/utils/reduced-motion/use-reduced-motion-config.ts"],"sourcesContent":["\"use client\"\n\nimport { useContext } from \"react\"\nimport { MotionConfigContext } from \"../../context/MotionConfigContext\"\nimport { useReducedMotion } from \"./use-reduced-motion\"\n\nexport function useReducedMotionConfig() {\n const reducedMotionPreference = useReducedMotion()\n const { reducedMotion } = useContext(MotionConfigContext)\n\n if (reducedMotion === \"never\") {\n return false\n } else if (reducedMotion === \"always\") {\n return true\n } else {\n return reducedMotionPreference\n }\n}\n"],"names":[],"mappings":";;;;;;AAOI;;AAGA;AACI;;AACG;AACH;;;AAEA;;AAER;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.mjs b/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.mjs deleted file mode 100644 index f78cfe8..0000000 --- a/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.mjs +++ /dev/null @@ -1,48 +0,0 @@ -"use client"; -import { hasReducedMotionListener, initPrefersReducedMotion, prefersReducedMotion } from 'motion-dom'; -import { warnOnce } from 'motion-utils'; -import { useState } from 'react'; - -/** - * A hook that returns `true` if we should be using reduced motion based on the current device's Reduced Motion setting. - * - * This can be used to implement changes to your UI based on Reduced Motion. For instance, replacing motion-sickness inducing - * `x`/`y` animations with `opacity`, disabling the autoplay of background videos, or turning off parallax motion. - * - * It will actively respond to changes and re-render your components with the latest setting. - * - * ```jsx - * export function Sidebar({ isOpen }) { - * const shouldReduceMotion = useReducedMotion() - * const closedX = shouldReduceMotion ? 0 : "-100%" - * - * return ( - * - * ) - * } - * ``` - * - * @return boolean - * - * @public - */ -function useReducedMotion() { - /** - * Lazy initialisation of prefersReducedMotion - */ - !hasReducedMotionListener.current && initPrefersReducedMotion(); - const [shouldReduceMotion] = useState(prefersReducedMotion.current); - if (process.env.NODE_ENV !== "production") { - warnOnce(shouldReduceMotion !== true, "You have Reduced Motion enabled on your device. Animations may not appear as expected.", "reduced-motion-disabled"); - } - /** - * TODO See if people miss automatically updating shouldReduceMotion setting - */ - return shouldReduceMotion; -} - -export { useReducedMotion }; -//# sourceMappingURL=use-reduced-motion.mjs.map diff --git a/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.mjs.map b/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.mjs.map deleted file mode 100644 index c5f09d1..0000000 --- a/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"use-reduced-motion.mjs","sources":["../../../../src/utils/reduced-motion/use-reduced-motion.ts"],"sourcesContent":["\"use client\"\n\nimport {\n hasReducedMotionListener,\n initPrefersReducedMotion,\n prefersReducedMotion,\n} from \"motion-dom\"\nimport { warnOnce } from \"motion-utils\"\nimport { useState } from \"react\"\n\n/**\n * A hook that returns `true` if we should be using reduced motion based on the current device's Reduced Motion setting.\n *\n * This can be used to implement changes to your UI based on Reduced Motion. For instance, replacing motion-sickness inducing\n * `x`/`y` animations with `opacity`, disabling the autoplay of background videos, or turning off parallax motion.\n *\n * It will actively respond to changes and re-render your components with the latest setting.\n *\n * ```jsx\n * export function Sidebar({ isOpen }) {\n * const shouldReduceMotion = useReducedMotion()\n * const closedX = shouldReduceMotion ? 0 : \"-100%\"\n *\n * return (\n * \n * )\n * }\n * ```\n *\n * @return boolean\n *\n * @public\n */\nexport function useReducedMotion() {\n /**\n * Lazy initialisation of prefersReducedMotion\n */\n !hasReducedMotionListener.current && initPrefersReducedMotion()\n\n const [shouldReduceMotion] = useState(prefersReducedMotion.current)\n\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(\n shouldReduceMotion !== true,\n \"You have Reduced Motion enabled on your device. Animations may not appear as expected.\",\n \"reduced-motion-disabled\"\n )\n }\n\n /**\n * TODO See if people miss automatically updating shouldReduceMotion setting\n */\n\n return shouldReduceMotion\n}\n"],"names":[],"mappings":";;;;;AAUA;;;;;;;;;;;;;;;;;;;;;;;;;AAyBG;;AAEC;;AAEG;AACH;;;;;AAYA;;AAEG;AAEH;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/utils/transform-rotated-parent.mjs b/node_modules/framer-motion/dist/es/utils/transform-rotated-parent.mjs deleted file mode 100644 index 09d364c..0000000 --- a/node_modules/framer-motion/dist/es/utils/transform-rotated-parent.mjs +++ /dev/null @@ -1,72 +0,0 @@ -/** - * Creates a `transformPagePoint` function that corrects pointer coordinates - * for a parent container with CSS transforms (rotation, scale, skew). - * - * When dragging elements inside a transformed parent, pointer coordinates - * need to be transformed through the inverse of the parent's transform - * so the drag offset is in local space. - * - * Works with both static and continuously animating transforms. - * - * @example - * ```jsx - * function App() { - * const ref = useRef(null) - * - * return ( - * - * - * - * - * - * ) - * } - * ``` - * - * @param parentRef - A React ref to the transformed parent element - * @returns A transformPagePoint function for use with MotionConfig - * - * @public - */ -function correctParentTransform(parentRef) { - return (point) => { - const parent = parentRef.current; - if (!parent) - return point; - const inv = getInverseMatrix(parent); - if (!inv) - return point; - // Get center of rotation in page space - const rect = parent.getBoundingClientRect(); - const cx = rect.left + window.scrollX + rect.width / 2; - const cy = rect.top + window.scrollY + rect.height / 2; - // Transform (point - center) through inverse, then add center back - const dx = point.x - cx; - const dy = point.y - cy; - return { - x: cx + inv.a * dx + inv.c * dy, - y: cy + inv.b * dx + inv.d * dy, - }; - }; -} -function getInverseMatrix(element) { - const { transform } = getComputedStyle(element); - if (!transform || transform === "none") - return null; - const match = transform.match(/^matrix3d\((.*)\)$/u) || - transform.match(/^matrix\((.*)\)$/u); - if (!match) - return null; - const v = match[1].split(",").map(Number); - const is3d = transform.startsWith("matrix3d"); - const a = v[0], b = v[1]; - const c = is3d ? v[4] : v[2]; - const d = is3d ? v[5] : v[3]; - const det = a * d - b * c; - if (Math.abs(det) < 1e-10) - return null; - return { a: d / det, b: -b / det, c: -c / det, d: a / det }; -} - -export { correctParentTransform }; -//# sourceMappingURL=transform-rotated-parent.mjs.map diff --git a/node_modules/framer-motion/dist/es/utils/transform-rotated-parent.mjs.map b/node_modules/framer-motion/dist/es/utils/transform-rotated-parent.mjs.map deleted file mode 100644 index 0d841cf..0000000 --- a/node_modules/framer-motion/dist/es/utils/transform-rotated-parent.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"transform-rotated-parent.mjs","sources":["../../../src/utils/transform-rotated-parent.ts"],"sourcesContent":["import type { Point, TransformPoint } from \"motion-utils\"\nimport type { RefObject } from \"react\"\n\n/**\n * Creates a `transformPagePoint` function that corrects pointer coordinates\n * for a parent container with CSS transforms (rotation, scale, skew).\n *\n * When dragging elements inside a transformed parent, pointer coordinates\n * need to be transformed through the inverse of the parent's transform\n * so the drag offset is in local space.\n *\n * Works with both static and continuously animating transforms.\n *\n * @example\n * ```jsx\n * function App() {\n * const ref = useRef(null)\n *\n * return (\n * \n * \n * \n * \n * \n * )\n * }\n * ```\n *\n * @param parentRef - A React ref to the transformed parent element\n * @returns A transformPagePoint function for use with MotionConfig\n *\n * @public\n */\nexport function correctParentTransform(\n parentRef: RefObject\n): TransformPoint {\n return (point: Point): Point => {\n const parent = parentRef.current\n if (!parent) return point\n\n const inv = getInverseMatrix(parent)\n if (!inv) return point\n\n // Get center of rotation in page space\n const rect = parent.getBoundingClientRect()\n const cx = rect.left + window.scrollX + rect.width / 2\n const cy = rect.top + window.scrollY + rect.height / 2\n\n // Transform (point - center) through inverse, then add center back\n const dx = point.x - cx\n const dy = point.y - cy\n return {\n x: cx + inv.a * dx + inv.c * dy,\n y: cy + inv.b * dx + inv.d * dy,\n }\n }\n}\n\ninterface InverseMatrix {\n a: number\n b: number\n c: number\n d: number\n}\n\nfunction getInverseMatrix(element: HTMLElement): InverseMatrix | null {\n const { transform } = getComputedStyle(element)\n if (!transform || transform === \"none\") return null\n\n const match =\n transform.match(/^matrix3d\\((.*)\\)$/u) ||\n transform.match(/^matrix\\((.*)\\)$/u)\n if (!match) return null\n\n const v = match[1].split(\",\").map(Number)\n const is3d = transform.startsWith(\"matrix3d\")\n const a = v[0],\n b = v[1]\n const c = is3d ? v[4] : v[2]\n const d = is3d ? v[5] : v[3]\n\n const det = a * d - b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OAAO,IAAI;AAEnD,IAAA,MAAM,KAAK,GACP,SAAS,CAAC,KAAK,CAAC,qBAAqB,CAAC;AACtC,QAAA,SAAS,CAAC,KAAK,CAAC,mBAAmB,CAAC;AACxC,IAAA,IAAI,CAAC,KAAK;AAAE,QAAA,OAAO,IAAI;AAEvB,IAAA,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC;IACzC,MAAM,IAAI,GAAG,SAAS,CAAC,UAAU,CAAC,UAAU,CAAC;AAC7C,IAAA,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EACV,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AACZ,IAAA,MAAM,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAC5B,IAAA,MAAM,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAE5B,MAAM,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC;AACzB,IAAA,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK;AAAE,QAAA,OAAO,IAAI;IAEtC,OAAO,EAAE,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE;AAC/D;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/utils/transform-viewbox-point.mjs b/node_modules/framer-motion/dist/es/utils/transform-viewbox-point.mjs deleted file mode 100644 index 378b008..0000000 --- a/node_modules/framer-motion/dist/es/utils/transform-viewbox-point.mjs +++ /dev/null @@ -1,63 +0,0 @@ -/** - * Creates a `transformPagePoint` function that accounts for SVG viewBox scaling. - * - * When dragging SVG elements inside an SVG with a viewBox that differs from - * the rendered dimensions (e.g., `viewBox="0 0 100 100"` but rendered at 500x500 pixels), - * pointer coordinates need to be transformed to match the SVG's coordinate system. - * - * @example - * ```jsx - * function App() { - * const svgRef = useRef(null) - * - * return ( - * - * - * - * - * - * ) - * } - * ``` - * - * @param svgRef - A React ref to the SVG element - * @returns A transformPagePoint function for use with MotionConfig - * - * @public - */ -function transformViewBoxPoint(svgRef) { - return (point) => { - const svg = svgRef.current; - if (!svg) { - return point; - } - // Get the viewBox attribute - const viewBox = svg.viewBox?.baseVal; - if (!viewBox || (viewBox.width === 0 && viewBox.height === 0)) { - // No viewBox or empty viewBox - no transformation needed - return point; - } - // Get the rendered dimensions of the SVG - const bbox = svg.getBoundingClientRect(); - if (bbox.width === 0 || bbox.height === 0) { - return point; - } - // Calculate scale factors - const scaleX = viewBox.width / bbox.width; - const scaleY = viewBox.height / bbox.height; - // Get the SVG's position on the page - const svgX = bbox.left + window.scrollX; - const svgY = bbox.top + window.scrollY; - // Transform the point: - // 1. Calculate position relative to SVG - // 2. Scale by viewBox/viewport ratio - // 3. Add back the SVG position (but in SVG coordinates) - return { - x: (point.x - svgX) * scaleX + svgX, - y: (point.y - svgY) * scaleY + svgY, - }; - }; -} - -export { transformViewBoxPoint }; -//# sourceMappingURL=transform-viewbox-point.mjs.map diff --git a/node_modules/framer-motion/dist/es/utils/transform-viewbox-point.mjs.map b/node_modules/framer-motion/dist/es/utils/transform-viewbox-point.mjs.map deleted file mode 100644 index 7dd63e8..0000000 --- a/node_modules/framer-motion/dist/es/utils/transform-viewbox-point.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"transform-viewbox-point.mjs","sources":["../../../src/utils/transform-viewbox-point.ts"],"sourcesContent":["import type { Point, TransformPoint } from \"motion-utils\"\nimport type { RefObject } from \"react\"\n\n/**\n * Creates a `transformPagePoint` function that accounts for SVG viewBox scaling.\n *\n * When dragging SVG elements inside an SVG with a viewBox that differs from\n * the rendered dimensions (e.g., `viewBox=\"0 0 100 100\"` but rendered at 500x500 pixels),\n * pointer coordinates need to be transformed to match the SVG's coordinate system.\n *\n * @example\n * ```jsx\n * function App() {\n * const svgRef = useRef(null)\n *\n * return (\n * \n * \n * \n * \n * \n * )\n * }\n * ```\n *\n * @param svgRef - A React ref to the SVG element\n * @returns A transformPagePoint function for use with MotionConfig\n *\n * @public\n */\nexport function transformViewBoxPoint(\n svgRef: RefObject\n): TransformPoint {\n return (point: Point): Point => {\n const svg = svgRef.current\n if (!svg) {\n return point\n }\n\n // Get the viewBox attribute\n const viewBox = svg.viewBox?.baseVal\n if (!viewBox || (viewBox.width === 0 && viewBox.height === 0)) {\n // No viewBox or empty viewBox - no transformation needed\n return point\n }\n\n // Get the rendered dimensions of the SVG\n const bbox = svg.getBoundingClientRect()\n if (bbox.width === 0 || bbox.height === 0) {\n return point\n }\n\n // Calculate scale factors\n const scaleX = viewBox.width / bbox.width\n const scaleY = viewBox.height / bbox.height\n\n // Get the SVG's position on the page\n const svgX = bbox.left + window.scrollX\n const svgY = bbox.top + window.scrollY\n\n // Transform the point:\n // 1. Calculate position relative to SVG\n // 2. Scale by viewBox/viewport ratio\n // 3. Add back the SVG position (but in SVG coordinates)\n return {\n x: (point.x - svgX) * scaleX + svgX,\n y: (point.y - svgY) * scaleY + svgY,\n }\n }\n}\n"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BG;AACG,SAAU,qBAAqB,CACjC,MAAuC,EAAA;IAEvC,OAAO,CAAC,KAAY,KAAW;AAC3B,QAAA,MAAM,GAAG,GAAG,MAAM,CAAC,OAAO;QAC1B,IAAI,CAAC,GAAG,EAAE;AACN,YAAA,OAAO,KAAK;QAChB;;AAGA,QAAA,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,EAAE,OAAO;AACpC,QAAA,IAAI,CAAC,OAAO,KAAK,OAAO,CAAC,KAAK,KAAK,CAAC,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC,EAAE;;AAE3D,YAAA,OAAO,KAAK;QAChB;;AAGA,QAAA,MAAM,IAAI,GAAG,GAAG,CAAC,qBAAqB,EAAE;AACxC,QAAA,IAAI,IAAI,CAAC,KAAK,KAAK,CAAC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE;AACvC,YAAA,OAAO,KAAK;QAChB;;QAGA,MAAM,MAAM,GAAG,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK;QACzC,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM;;QAG3C,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,OAAO;QACvC,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,GAAG,MAAM,CAAC,OAAO;;;;;QAMtC,OAAO;YACH,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,IAAI,MAAM,GAAG,IAAI;YACnC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,IAAI,MAAM,GAAG,IAAI;SACtC;AACL,IAAA,CAAC;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/utils/use-animation-frame.mjs b/node_modules/framer-motion/dist/es/utils/use-animation-frame.mjs deleted file mode 100644 index 529b1ce..0000000 --- a/node_modules/framer-motion/dist/es/utils/use-animation-frame.mjs +++ /dev/null @@ -1,23 +0,0 @@ -"use client"; -import { frame, cancelFrame } from 'motion-dom'; -import { useRef, useContext, useEffect } from 'react'; -import { MotionConfigContext } from '../context/MotionConfigContext.mjs'; - -function useAnimationFrame(callback) { - const initialTimestamp = useRef(0); - const { isStatic } = useContext(MotionConfigContext); - useEffect(() => { - if (isStatic) - return; - const provideTimeSinceStart = ({ timestamp, delta }) => { - if (!initialTimestamp.current) - initialTimestamp.current = timestamp; - callback(timestamp - initialTimestamp.current, delta); - }; - frame.update(provideTimeSinceStart, true); - return () => cancelFrame(provideTimeSinceStart); - }, [callback]); -} - -export { useAnimationFrame }; -//# sourceMappingURL=use-animation-frame.mjs.map diff --git a/node_modules/framer-motion/dist/es/utils/use-animation-frame.mjs.map b/node_modules/framer-motion/dist/es/utils/use-animation-frame.mjs.map deleted file mode 100644 index 22b0de0..0000000 --- a/node_modules/framer-motion/dist/es/utils/use-animation-frame.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"use-animation-frame.mjs","sources":["../../../src/utils/use-animation-frame.ts"],"sourcesContent":["\"use client\"\n\nimport { cancelFrame, frame, FrameData } from \"motion-dom\"\nimport { useContext, useEffect, useRef } from \"react\"\nimport { MotionConfigContext } from \"../context/MotionConfigContext\"\n\nexport type FrameCallback = (timestamp: number, delta: number) => void\n\nexport function useAnimationFrame(callback: FrameCallback) {\n const initialTimestamp = useRef(0)\n const { isStatic } = useContext(MotionConfigContext)\n\n useEffect(() => {\n if (isStatic) return\n\n const provideTimeSinceStart = ({ timestamp, delta }: FrameData) => {\n if (!initialTimestamp.current) initialTimestamp.current = timestamp\n\n callback(timestamp - initialTimestamp.current, delta)\n }\n\n frame.update(provideTimeSinceStart, true)\n return () => cancelFrame(provideTimeSinceStart)\n }, [callback])\n}\n"],"names":[],"mappings":";;;;;AAQM;AACF;;;AAII;;;;AAGmC;;AAGnC;AAEA;AACA;AACJ;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/utils/use-composed-ref.mjs b/node_modules/framer-motion/dist/es/utils/use-composed-ref.mjs deleted file mode 100644 index efa3d32..0000000 --- a/node_modules/framer-motion/dist/es/utils/use-composed-ref.mjs +++ /dev/null @@ -1,61 +0,0 @@ -import * as React from 'react'; - -/** - * Taken from https://github.com/radix-ui/primitives/blob/main/packages/react/compose-refs/src/compose-refs.tsx - */ -/** - * Set a given ref to a given value - * This utility takes care of different types of refs: callback refs and RefObject(s) - */ -function setRef(ref, value) { - if (typeof ref === "function") { - return ref(value); - } - else if (ref !== null && ref !== undefined) { - ref.current = value; - } -} -/** - * A utility to compose multiple refs together - * Accepts callback refs and RefObject(s) - */ -function composeRefs(...refs) { - return (node) => { - let hasCleanup = false; - const cleanups = refs.map((ref) => { - const cleanup = setRef(ref, node); - if (!hasCleanup && typeof cleanup === "function") { - hasCleanup = true; - } - return cleanup; - }); - // React <19 will log an error to the console if a callback ref returns a - // value. We don't use ref cleanups internally so this will only happen if a - // user's ref callback returns a value, which we only expect if they are - // using the cleanup functionality added in React 19. - if (hasCleanup) { - return () => { - for (let i = 0; i < cleanups.length; i++) { - const cleanup = cleanups[i]; - if (typeof cleanup === "function") { - cleanup(); - } - else { - setRef(refs[i], null); - } - } - }; - } - }; -} -/** - * A custom hook that composes multiple refs - * Accepts callback refs and RefObject(s) - */ -function useComposedRefs(...refs) { - // eslint-disable-next-line react-hooks/exhaustive-deps - return React.useCallback(composeRefs(...refs), refs); -} - -export { useComposedRefs }; -//# sourceMappingURL=use-composed-ref.mjs.map diff --git a/node_modules/framer-motion/dist/es/utils/use-composed-ref.mjs.map b/node_modules/framer-motion/dist/es/utils/use-composed-ref.mjs.map deleted file mode 100644 index f65fb06..0000000 --- a/node_modules/framer-motion/dist/es/utils/use-composed-ref.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"use-composed-ref.mjs","sources":["../../../src/utils/use-composed-ref.ts"],"sourcesContent":["/**\n * Taken from https://github.com/radix-ui/primitives/blob/main/packages/react/compose-refs/src/compose-refs.tsx\n */\nimport * as React from \"react\"\n\ntype PossibleRef = React.Ref | undefined\n\n/**\n * Set a given ref to a given value\n * This utility takes care of different types of refs: callback refs and RefObject(s)\n */\nfunction setRef(ref: PossibleRef, value: T): void | (() => void) {\n if (typeof ref === \"function\") {\n return ref(value)\n } else if (ref !== null && ref !== undefined) {\n ;(ref as React.MutableRefObject).current = value\n }\n}\n\n/**\n * A utility to compose multiple refs together\n * Accepts callback refs and RefObject(s)\n */\nfunction composeRefs(...refs: PossibleRef[]): React.RefCallback {\n return (node) => {\n let hasCleanup = false\n const cleanups = refs.map((ref) => {\n const cleanup = setRef(ref, node)\n if (!hasCleanup && typeof cleanup === \"function\") {\n hasCleanup = true\n }\n return cleanup\n })\n // React <19 will log an error to the console if a callback ref returns a\n // value. We don't use ref cleanups internally so this will only happen if a\n // user's ref callback returns a value, which we only expect if they are\n // using the cleanup functionality added in React 19.\n if (hasCleanup) {\n return () => {\n for (let i = 0; i < cleanups.length; i++) {\n const cleanup = cleanups[i]\n if (typeof cleanup === \"function\") {\n cleanup()\n } else {\n setRef(refs[i], null)\n }\n }\n }\n }\n }\n}\n\n/**\n * A custom hook that composes multiple refs\n * Accepts callback refs and RefObject(s)\n */\nfunction useComposedRefs(...refs: PossibleRef[]): React.RefCallback {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n return React.useCallback(composeRefs(...refs), refs)\n}\n\nexport { useComposedRefs }\n"],"names":[],"mappings":";;AAAA;;AAEG;AAKH;;;AAGG;AACH,SAAS,MAAM,CAAI,GAAmB,EAAE,KAAQ,EAAA;AAC5C,IAAA,IAAI,OAAO,GAAG,KAAK,UAAU,EAAE;AAC3B,QAAA,OAAO,GAAG,CAAC,KAAK,CAAC;IACrB;SAAO,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,SAAS,EAAE;AACxC,QAAA,GAAiC,CAAC,OAAO,GAAG,KAAK;IACvD;AACJ;AAEA;;;AAGG;AACH,SAAS,WAAW,CAAI,GAAG,IAAsB,EAAA;IAC7C,OAAO,CAAC,IAAI,KAAI;QACZ,IAAI,UAAU,GAAG,KAAK;QACtB,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,KAAI;YAC9B,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC;YACjC,IAAI,CAAC,UAAU,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE;gBAC9C,UAAU,GAAG,IAAI;YACrB;AACA,YAAA,OAAO,OAAO;AAClB,QAAA,CAAC,CAAC;;;;;QAKF,IAAI,UAAU,EAAE;AACZ,YAAA,OAAO,MAAK;AACR,gBAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AACtC,oBAAA,MAAM,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC;AAC3B,oBAAA,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE;AAC/B,wBAAA,OAAO,EAAE;oBACb;yBAAO;wBACH,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC;oBACzB;gBACJ;AACJ,YAAA,CAAC;QACL;AACJ,IAAA,CAAC;AACL;AAEA;;;AAGG;AACH,SAAS,eAAe,CAAI,GAAG,IAAsB,EAAA;;AAEjD,IAAA,OAAO,KAAK,CAAC,WAAW,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC,EAAE,IAAI,CAAC;AACxD;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/utils/use-constant.mjs b/node_modules/framer-motion/dist/es/utils/use-constant.mjs deleted file mode 100644 index 50a3e1d..0000000 --- a/node_modules/framer-motion/dist/es/utils/use-constant.mjs +++ /dev/null @@ -1,20 +0,0 @@ -"use client"; -import { useRef } from 'react'; - -/** - * Creates a constant value over the lifecycle of a component. - * - * Even if `useMemo` is provided an empty array as its final argument, it doesn't offer - * a guarantee that it won't re-run for performance reasons later on. By using `useConstant` - * you can ensure that initialisers don't execute twice or more. - */ -function useConstant(init) { - const ref = useRef(null); - if (ref.current === null) { - ref.current = init(); - } - return ref.current; -} - -export { useConstant }; -//# sourceMappingURL=use-constant.mjs.map diff --git a/node_modules/framer-motion/dist/es/utils/use-constant.mjs.map b/node_modules/framer-motion/dist/es/utils/use-constant.mjs.map deleted file mode 100644 index 4a9d7be..0000000 --- a/node_modules/framer-motion/dist/es/utils/use-constant.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"use-constant.mjs","sources":["../../../src/utils/use-constant.ts"],"sourcesContent":["\"use client\"\n\nimport { useRef } from \"react\"\n\ntype Init = () => T\n\n/**\n * Creates a constant value over the lifecycle of a component.\n *\n * Even if `useMemo` is provided an empty array as its final argument, it doesn't offer\n * a guarantee that it won't re-run for performance reasons later on. By using `useConstant`\n * you can ensure that initialisers don't execute twice or more.\n */\nexport function useConstant(init: Init) {\n const ref = useRef(null)\n\n if (ref.current === null) {\n ref.current = init()\n }\n\n return ref.current\n}\n"],"names":[],"mappings":";;;AAMA;;;;;;AAMG;AACG;AACF;AAEA;AACI;;;AAIR;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/utils/use-cycle.mjs b/node_modules/framer-motion/dist/es/utils/use-cycle.mjs deleted file mode 100644 index a5a61ff..0000000 --- a/node_modules/framer-motion/dist/es/utils/use-cycle.mjs +++ /dev/null @@ -1,49 +0,0 @@ -"use client"; -import { wrap } from 'motion-utils'; -import { useRef, useState, useCallback } from 'react'; - -/** - * Cycles through a series of visual properties. Can be used to toggle between or cycle through animations. It works similar to `useState` in React. It is provided an initial array of possible states, and returns an array of two arguments. - * - * An index value can be passed to the returned `cycle` function to cycle to a specific index. - * - * ```jsx - * import * as React from "react" - * import { motion, useCycle } from "framer-motion" - * - * export const MyComponent = () => { - * const [x, cycleX] = useCycle(0, 50, 100) - * - * return ( - * cycleX()} - * /> - * ) - * } - * ``` - * - * @param items - items to cycle through - * @returns [currentState, cycleState] - * - * @public - */ -function useCycle(...items) { - const index = useRef(0); - const [item, setItem] = useState(items[index.current]); - const runCycle = useCallback((next) => { - index.current = - typeof next !== "number" - ? wrap(0, items.length, index.current + 1) - : next; - setItem(items[index.current]); - }, - // The array will change on each call, but by putting items.length at - // the front of this array, we guarantee the dependency comparison will match up - // eslint-disable-next-line react-hooks/exhaustive-deps - [items.length, ...items]); - return [item, runCycle]; -} - -export { useCycle }; -//# sourceMappingURL=use-cycle.mjs.map diff --git a/node_modules/framer-motion/dist/es/utils/use-cycle.mjs.map b/node_modules/framer-motion/dist/es/utils/use-cycle.mjs.map deleted file mode 100644 index 59a6bc7..0000000 --- a/node_modules/framer-motion/dist/es/utils/use-cycle.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"use-cycle.mjs","sources":["../../../src/utils/use-cycle.ts"],"sourcesContent":["\"use client\"\n\nimport { wrap } from \"motion-utils\"\nimport { useCallback, useRef, useState } from \"react\"\n\nexport type Cycle = (i?: number) => void\n\nexport type CycleState = [T, Cycle]\n\n/**\n * Cycles through a series of visual properties. Can be used to toggle between or cycle through animations. It works similar to `useState` in React. It is provided an initial array of possible states, and returns an array of two arguments.\n *\n * An index value can be passed to the returned `cycle` function to cycle to a specific index.\n *\n * ```jsx\n * import * as React from \"react\"\n * import { motion, useCycle } from \"framer-motion\"\n *\n * export const MyComponent = () => {\n * const [x, cycleX] = useCycle(0, 50, 100)\n *\n * return (\n * cycleX()}\n * />\n * )\n * }\n * ```\n *\n * @param items - items to cycle through\n * @returns [currentState, cycleState]\n *\n * @public\n */\nexport function useCycle(...items: T[]): CycleState {\n const index = useRef(0)\n const [item, setItem] = useState(items[index.current])\n\n const runCycle = useCallback(\n (next?: number) => {\n index.current =\n typeof next !== \"number\"\n ? wrap(0, items.length, index.current + 1)\n : next\n\n setItem(items[index.current])\n },\n // The array will change on each call, but by putting items.length at\n // the front of this array, we guarantee the dependency comparison will match up\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [items.length, ...items]\n )\n return [item, runCycle]\n}\n"],"names":[],"mappings":";;;;AASA;;;;;;;;;;;;;;;;;;;;;;;;;AAyBG;AACG;AACF;AACA;AAEA;AAEQ;;AAEQ;;;;;;;;AAUhB;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/utils/use-force-update.mjs b/node_modules/framer-motion/dist/es/utils/use-force-update.mjs deleted file mode 100644 index 729a98b..0000000 --- a/node_modules/framer-motion/dist/es/utils/use-force-update.mjs +++ /dev/null @@ -1,21 +0,0 @@ -"use client"; -import { frame } from 'motion-dom'; -import { useState, useCallback } from 'react'; -import { useIsMounted } from './use-is-mounted.mjs'; - -function useForceUpdate() { - const isMounted = useIsMounted(); - const [forcedRenderCount, setForcedRenderCount] = useState(0); - const forceRender = useCallback(() => { - isMounted.current && setForcedRenderCount(forcedRenderCount + 1); - }, [forcedRenderCount]); - /** - * Defer this to the end of the next animation frame in case there are multiple - * synchronous calls. - */ - const deferredForceRender = useCallback(() => frame.postRender(forceRender), [forceRender]); - return [deferredForceRender, forcedRenderCount]; -} - -export { useForceUpdate }; -//# sourceMappingURL=use-force-update.mjs.map diff --git a/node_modules/framer-motion/dist/es/utils/use-force-update.mjs.map b/node_modules/framer-motion/dist/es/utils/use-force-update.mjs.map deleted file mode 100644 index a000fb8..0000000 --- a/node_modules/framer-motion/dist/es/utils/use-force-update.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"use-force-update.mjs","sources":["../../../src/utils/use-force-update.ts"],"sourcesContent":["\"use client\"\n\nimport { frame } from \"motion-dom\"\nimport { useCallback, useState } from \"react\"\nimport { useIsMounted } from \"./use-is-mounted\"\n\nexport function useForceUpdate(): [VoidFunction, number] {\n const isMounted = useIsMounted()\n const [forcedRenderCount, setForcedRenderCount] = useState(0)\n\n const forceRender = useCallback(() => {\n isMounted.current && setForcedRenderCount(forcedRenderCount + 1)\n }, [forcedRenderCount])\n\n /**\n * Defer this to the end of the next animation frame in case there are multiple\n * synchronous calls.\n */\n const deferredForceRender = useCallback(\n () => frame.postRender(forceRender),\n [forceRender]\n )\n\n return [deferredForceRender, forcedRenderCount]\n}\n"],"names":[],"mappings":";;;;;;AAOI;;AAGA;;AAEA;AAEA;;;AAGG;AACH;AAKA;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/utils/use-in-view.mjs b/node_modules/framer-motion/dist/es/utils/use-in-view.mjs deleted file mode 100644 index 59d5aeb..0000000 --- a/node_modules/framer-motion/dist/es/utils/use-in-view.mjs +++ /dev/null @@ -1,25 +0,0 @@ -"use client"; -import { useState, useEffect } from 'react'; -import { inView } from '../render/dom/viewport/index.mjs'; - -function useInView(ref, { root, margin, amount, once = false, initial = false, } = {}) { - const [isInView, setInView] = useState(initial); - useEffect(() => { - if (!ref.current || (once && isInView)) - return; - const onEnter = () => { - setInView(true); - return once ? undefined : () => setInView(false); - }; - const options = { - root: (root && root.current) || undefined, - margin, - amount, - }; - return inView(ref.current, onEnter, options); - }, [root, ref, margin, once, amount]); - return isInView; -} - -export { useInView }; -//# sourceMappingURL=use-in-view.mjs.map diff --git a/node_modules/framer-motion/dist/es/utils/use-in-view.mjs.map b/node_modules/framer-motion/dist/es/utils/use-in-view.mjs.map deleted file mode 100644 index 29d21d8..0000000 --- a/node_modules/framer-motion/dist/es/utils/use-in-view.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"use-in-view.mjs","sources":["../../../src/utils/use-in-view.ts"],"sourcesContent":["\"use client\"\n\nimport { RefObject, useEffect, useState } from \"react\"\nimport { inView, InViewOptions } from \"../render/dom/viewport\"\n\nexport interface UseInViewOptions\n extends Omit {\n root?: RefObject\n once?: boolean\n amount?: \"some\" | \"all\" | number\n initial?: boolean\n}\n\nexport function useInView(\n ref: RefObject,\n {\n root,\n margin,\n amount,\n once = false,\n initial = false,\n }: UseInViewOptions = {}\n) {\n const [isInView, setInView] = useState(initial)\n\n useEffect(() => {\n if (!ref.current || (once && isInView)) return\n\n const onEnter = () => {\n setInView(true)\n\n return once ? undefined : () => setInView(false)\n }\n\n const options: InViewOptions = {\n root: (root && root.current) || undefined,\n margin,\n amount,\n }\n\n return inView(ref.current, onEnter, options)\n }, [root, ref, margin, once, amount])\n\n return isInView\n}\n"],"names":[],"mappings":";;;;AAaM;;;;;;;AAkBM;AACJ;AAEA;;;;;;AAOJ;AAEA;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/utils/use-instant-transition.mjs b/node_modules/framer-motion/dist/es/utils/use-instant-transition.mjs deleted file mode 100644 index 8a84ebf..0000000 --- a/node_modules/framer-motion/dist/es/utils/use-instant-transition.mjs +++ /dev/null @@ -1,43 +0,0 @@ -"use client"; -import { frame } from 'motion-dom'; -import { MotionGlobalConfig } from 'motion-utils'; -import { useRef, useEffect } from 'react'; -import { useInstantLayoutTransition } from '../projection/use-instant-layout-transition.mjs'; -import { useForceUpdate } from './use-force-update.mjs'; - -function useInstantTransition() { - const [forceUpdate, forcedRenderCount] = useForceUpdate(); - const startInstantLayoutTransition = useInstantLayoutTransition(); - const unlockOnFrameRef = useRef(-1); - useEffect(() => { - /** - * Unblock after two animation frames, otherwise this will unblock too soon. - */ - frame.postRender(() => frame.postRender(() => { - /** - * If the callback has been called again after the effect - * triggered this 2 frame delay, don't unblock animations. This - * prevents the previous effect from unblocking the current - * instant transition too soon. This becomes more likely when - * used in conjunction with React.startTransition(). - */ - if (forcedRenderCount !== unlockOnFrameRef.current) - return; - MotionGlobalConfig.instantAnimations = false; - })); - }, [forcedRenderCount]); - return (callback) => { - startInstantLayoutTransition(() => { - MotionGlobalConfig.instantAnimations = true; - forceUpdate(); - callback(); - unlockOnFrameRef.current = forcedRenderCount + 1; - }); - }; -} -function disableInstantTransitions() { - MotionGlobalConfig.instantAnimations = false; -} - -export { disableInstantTransitions, useInstantTransition }; -//# sourceMappingURL=use-instant-transition.mjs.map diff --git a/node_modules/framer-motion/dist/es/utils/use-instant-transition.mjs.map b/node_modules/framer-motion/dist/es/utils/use-instant-transition.mjs.map deleted file mode 100644 index 8c6bdaa..0000000 --- a/node_modules/framer-motion/dist/es/utils/use-instant-transition.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"use-instant-transition.mjs","sources":["../../../src/utils/use-instant-transition.ts"],"sourcesContent":["\"use client\"\n\nimport { frame } from \"motion-dom\"\nimport { MotionGlobalConfig } from \"motion-utils\"\nimport { useEffect, useRef } from \"react\"\nimport { useInstantLayoutTransition } from \"../projection/use-instant-layout-transition\"\nimport { useForceUpdate } from \"./use-force-update\"\n\nexport function useInstantTransition() {\n const [forceUpdate, forcedRenderCount] = useForceUpdate()\n const startInstantLayoutTransition = useInstantLayoutTransition()\n const unlockOnFrameRef = useRef(-1)\n\n useEffect(() => {\n /**\n * Unblock after two animation frames, otherwise this will unblock too soon.\n */\n frame.postRender(() =>\n frame.postRender(() => {\n /**\n * If the callback has been called again after the effect\n * triggered this 2 frame delay, don't unblock animations. This\n * prevents the previous effect from unblocking the current\n * instant transition too soon. This becomes more likely when\n * used in conjunction with React.startTransition().\n */\n if (forcedRenderCount !== unlockOnFrameRef.current) return\n MotionGlobalConfig.instantAnimations = false\n })\n )\n }, [forcedRenderCount])\n\n return (callback: () => void) => {\n startInstantLayoutTransition(() => {\n MotionGlobalConfig.instantAnimations = true\n forceUpdate()\n callback()\n unlockOnFrameRef.current = forcedRenderCount + 1\n })\n }\n}\n\nexport function disableInstantTransitions() {\n MotionGlobalConfig.instantAnimations = false\n}\n"],"names":[],"mappings":";;;;;;;;;AAUI;AACA;;AAGI;;AAEG;;AAGK;;;;;;AAMG;AACH;;AACA;;AAGZ;;;AAIQ;AACA;AACA;AACA;AACJ;AACJ;AACJ;;AAGI;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/utils/use-is-mounted.mjs b/node_modules/framer-motion/dist/es/utils/use-is-mounted.mjs deleted file mode 100644 index 1ebefbe..0000000 --- a/node_modules/framer-motion/dist/es/utils/use-is-mounted.mjs +++ /dev/null @@ -1,17 +0,0 @@ -"use client"; -import { useRef } from 'react'; -import { useIsomorphicLayoutEffect } from './use-isomorphic-effect.mjs'; - -function useIsMounted() { - const isMounted = useRef(false); - useIsomorphicLayoutEffect(() => { - isMounted.current = true; - return () => { - isMounted.current = false; - }; - }, []); - return isMounted; -} - -export { useIsMounted }; -//# sourceMappingURL=use-is-mounted.mjs.map diff --git a/node_modules/framer-motion/dist/es/utils/use-is-mounted.mjs.map b/node_modules/framer-motion/dist/es/utils/use-is-mounted.mjs.map deleted file mode 100644 index 72e622c..0000000 --- a/node_modules/framer-motion/dist/es/utils/use-is-mounted.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"use-is-mounted.mjs","sources":["../../../src/utils/use-is-mounted.ts"],"sourcesContent":["\"use client\"\n\nimport { useRef } from \"react\"\nimport { useIsomorphicLayoutEffect } from \"./use-isomorphic-effect\"\n\nexport function useIsMounted() {\n const isMounted = useRef(false)\n useIsomorphicLayoutEffect(() => {\n isMounted.current = true\n\n return () => {\n isMounted.current = false\n }\n }, [])\n\n return isMounted\n}\n"],"names":[],"mappings":";;;;;AAMI;;AAEI;AAEA;AACI;AACJ;;AAGJ;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.mjs b/node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.mjs deleted file mode 100644 index 704d9f6..0000000 --- a/node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.mjs +++ /dev/null @@ -1,8 +0,0 @@ -"use client"; -import { useLayoutEffect, useEffect } from 'react'; -import { isBrowser } from './is-browser.mjs'; - -const useIsomorphicLayoutEffect = isBrowser ? useLayoutEffect : useEffect; - -export { useIsomorphicLayoutEffect }; -//# sourceMappingURL=use-isomorphic-effect.mjs.map diff --git a/node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.mjs.map b/node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.mjs.map deleted file mode 100644 index 66035e5..0000000 --- a/node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"use-isomorphic-effect.mjs","sources":["../../../src/utils/use-isomorphic-effect.ts"],"sourcesContent":["\"use client\"\n\nimport { useEffect, useLayoutEffect } from \"react\"\nimport { isBrowser } from \"./is-browser\"\n\nexport const useIsomorphicLayoutEffect = isBrowser ? useLayoutEffect : useEffect\n"],"names":[],"mappings":";;;;AAKO;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/utils/use-motion-value-event.mjs b/node_modules/framer-motion/dist/es/utils/use-motion-value-event.mjs deleted file mode 100644 index 5b19c98..0000000 --- a/node_modules/framer-motion/dist/es/utils/use-motion-value-event.mjs +++ /dev/null @@ -1,15 +0,0 @@ -"use client"; -import { useInsertionEffect } from 'react'; - -function useMotionValueEvent(value, event, callback) { - /** - * useInsertionEffect will create subscriptions before any other - * effects will run. Effects run upwards through the tree so it - * can be that binding a useLayoutEffect higher up the tree can - * miss changes from lower down the tree. - */ - useInsertionEffect(() => value.on(event, callback), [value, event, callback]); -} - -export { useMotionValueEvent }; -//# sourceMappingURL=use-motion-value-event.mjs.map diff --git a/node_modules/framer-motion/dist/es/utils/use-motion-value-event.mjs.map b/node_modules/framer-motion/dist/es/utils/use-motion-value-event.mjs.map deleted file mode 100644 index 07df7e4..0000000 --- a/node_modules/framer-motion/dist/es/utils/use-motion-value-event.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"use-motion-value-event.mjs","sources":["../../../src/utils/use-motion-value-event.ts"],"sourcesContent":["\"use client\"\n\nimport { MotionValue, MotionValueEventCallbacks } from \"motion-dom\"\nimport { useInsertionEffect } from \"react\"\n\nexport function useMotionValueEvent<\n V,\n EventName extends keyof MotionValueEventCallbacks\n>(\n value: MotionValue,\n event: EventName,\n callback: MotionValueEventCallbacks[EventName]\n) {\n /**\n * useInsertionEffect will create subscriptions before any other\n * effects will run. Effects run upwards through the tree so it\n * can be that binding a useLayoutEffect higher up the tree can\n * miss changes from lower down the tree.\n */\n useInsertionEffect(\n () => value.on(event, callback),\n [value, event, callback]\n )\n}\n"],"names":[],"mappings":";;;;AAaI;;;;;AAKG;;AAKP;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/utils/use-page-in-view.mjs b/node_modules/framer-motion/dist/es/utils/use-page-in-view.mjs deleted file mode 100644 index a4c1054..0000000 --- a/node_modules/framer-motion/dist/es/utils/use-page-in-view.mjs +++ /dev/null @@ -1,20 +0,0 @@ -"use client"; -import { useState, useEffect } from 'react'; - -function usePageInView() { - const [isInView, setIsInView] = useState(true); - useEffect(() => { - const handleVisibilityChange = () => setIsInView(!document.hidden); - if (document.hidden) { - handleVisibilityChange(); - } - document.addEventListener("visibilitychange", handleVisibilityChange); - return () => { - document.removeEventListener("visibilitychange", handleVisibilityChange); - }; - }, []); - return isInView; -} - -export { usePageInView }; -//# sourceMappingURL=use-page-in-view.mjs.map diff --git a/node_modules/framer-motion/dist/es/utils/use-page-in-view.mjs.map b/node_modules/framer-motion/dist/es/utils/use-page-in-view.mjs.map deleted file mode 100644 index 9a0dd0d..0000000 --- a/node_modules/framer-motion/dist/es/utils/use-page-in-view.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"use-page-in-view.mjs","sources":["../../../src/utils/use-page-in-view.ts"],"sourcesContent":["\"use client\"\n\nimport { useEffect, useState } from \"react\"\n\nexport function usePageInView() {\n const [isInView, setIsInView] = useState(true)\n\n useEffect(() => {\n const handleVisibilityChange = () => setIsInView(!document.hidden)\n\n if (document.hidden) {\n handleVisibilityChange()\n }\n\n document.addEventListener(\"visibilitychange\", handleVisibilityChange)\n\n return () => {\n document.removeEventListener(\n \"visibilitychange\",\n handleVisibilityChange\n )\n }\n }, [])\n\n return isInView\n}\n"],"names":[],"mappings":";;;;;;AAQQ;AAEA;AACI;;AAGJ;AAEA;AACI;AAIJ;;AAGJ;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/utils/use-unmount-effect.mjs b/node_modules/framer-motion/dist/es/utils/use-unmount-effect.mjs deleted file mode 100644 index a4bd165..0000000 --- a/node_modules/framer-motion/dist/es/utils/use-unmount-effect.mjs +++ /dev/null @@ -1,9 +0,0 @@ -"use client"; -import { useEffect } from 'react'; - -function useUnmountEffect(callback) { - return useEffect(() => () => callback(), []); -} - -export { useUnmountEffect }; -//# sourceMappingURL=use-unmount-effect.mjs.map diff --git a/node_modules/framer-motion/dist/es/utils/use-unmount-effect.mjs.map b/node_modules/framer-motion/dist/es/utils/use-unmount-effect.mjs.map deleted file mode 100644 index eb242e9..0000000 --- a/node_modules/framer-motion/dist/es/utils/use-unmount-effect.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"use-unmount-effect.mjs","sources":["../../../src/utils/use-unmount-effect.ts"],"sourcesContent":["\"use client\"\n\nimport { useEffect } from \"react\"\n\nexport function useUnmountEffect(callback: () => void) {\n return useEffect(() => () => callback(), [])\n}\n"],"names":[],"mappings":";;;AAIM;AACF;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/value/scroll/use-element-scroll.mjs b/node_modules/framer-motion/dist/es/value/scroll/use-element-scroll.mjs deleted file mode 100644 index f108d60..0000000 --- a/node_modules/framer-motion/dist/es/value/scroll/use-element-scroll.mjs +++ /dev/null @@ -1,15 +0,0 @@ -import { warnOnce } from 'motion-utils'; -import { useScroll } from '../use-scroll.mjs'; - -/** - * @deprecated useElementScroll is deprecated. Convert to useScroll({ container: ref }) - */ -function useElementScroll(ref) { - if (process.env.NODE_ENV === "development") { - warnOnce(false, "useElementScroll is deprecated. Convert to useScroll({ container: ref })."); - } - return useScroll({ container: ref }); -} - -export { useElementScroll }; -//# sourceMappingURL=use-element-scroll.mjs.map diff --git a/node_modules/framer-motion/dist/es/value/scroll/use-element-scroll.mjs.map b/node_modules/framer-motion/dist/es/value/scroll/use-element-scroll.mjs.map deleted file mode 100644 index 3375d13..0000000 --- a/node_modules/framer-motion/dist/es/value/scroll/use-element-scroll.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"use-element-scroll.mjs","sources":["../../../../src/value/scroll/use-element-scroll.ts"],"sourcesContent":["import { warnOnce } from \"motion-utils\"\nimport { RefObject } from \"react\"\nimport { useScroll } from \"../use-scroll\"\n\n/**\n * @deprecated useElementScroll is deprecated. Convert to useScroll({ container: ref })\n */\nexport function useElementScroll(ref: RefObject) {\n if (process.env.NODE_ENV === \"development\") {\n warnOnce(\n false,\n \"useElementScroll is deprecated. Convert to useScroll({ container: ref }).\"\n )\n }\n\n return useScroll({ container: ref })\n}\n"],"names":[],"mappings":";;;AAIA;;AAEG;AACG,SAAU,gBAAgB,CAAC,GAAkC,EAAA;IAC/D,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,EAAE;AACxC,QAAA,QAAQ,CACJ,KAAK,EACL,2EAA2E,CAC9E;IACL;IAEA,OAAO,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC;AACxC;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/value/scroll/use-viewport-scroll.mjs b/node_modules/framer-motion/dist/es/value/scroll/use-viewport-scroll.mjs deleted file mode 100644 index 0c9dcbe..0000000 --- a/node_modules/framer-motion/dist/es/value/scroll/use-viewport-scroll.mjs +++ /dev/null @@ -1,15 +0,0 @@ -import { warnOnce } from 'motion-utils'; -import { useScroll } from '../use-scroll.mjs'; - -/** - * @deprecated useViewportScroll is deprecated. Convert to useScroll() - */ -function useViewportScroll() { - if (process.env.NODE_ENV !== "production") { - warnOnce(false, "useViewportScroll is deprecated. Convert to useScroll()."); - } - return useScroll(); -} - -export { useViewportScroll }; -//# sourceMappingURL=use-viewport-scroll.mjs.map diff --git a/node_modules/framer-motion/dist/es/value/scroll/use-viewport-scroll.mjs.map b/node_modules/framer-motion/dist/es/value/scroll/use-viewport-scroll.mjs.map deleted file mode 100644 index ea730e9..0000000 --- a/node_modules/framer-motion/dist/es/value/scroll/use-viewport-scroll.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"use-viewport-scroll.mjs","sources":["../../../../src/value/scroll/use-viewport-scroll.ts"],"sourcesContent":["import { warnOnce } from \"motion-utils\"\nimport { useScroll } from \"../use-scroll\"\n\n/**\n * @deprecated useViewportScroll is deprecated. Convert to useScroll()\n */\nexport function useViewportScroll() {\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(\n false,\n \"useViewportScroll is deprecated. Convert to useScroll().\"\n )\n }\n return useScroll()\n}\n"],"names":[],"mappings":";;;AAGA;;AAEG;SACa,iBAAiB,GAAA;IAC7B,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE;AACvC,QAAA,QAAQ,CACJ,KAAK,EACL,0DAA0D,CAC7D;IACL;IACA,OAAO,SAAS,EAAE;AACtB;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/value/use-combine-values.mjs b/node_modules/framer-motion/dist/es/value/use-combine-values.mjs deleted file mode 100644 index fc34d54..0000000 --- a/node_modules/framer-motion/dist/es/value/use-combine-values.mjs +++ /dev/null @@ -1,39 +0,0 @@ -"use client"; -import { cancelFrame, frame } from 'motion-dom'; -import { useIsomorphicLayoutEffect } from '../utils/use-isomorphic-effect.mjs'; -import { useMotionValue } from './use-motion-value.mjs'; - -function useCombineMotionValues(values, combineValues) { - /** - * Initialise the returned motion value. This remains the same between renders. - */ - const value = useMotionValue(combineValues()); - /** - * Create a function that will update the template motion value with the latest values. - * This is pre-bound so whenever a motion value updates it can schedule its - * execution in Framesync. If it's already been scheduled it won't be fired twice - * in a single frame. - */ - const updateValue = () => value.set(combineValues()); - /** - * Synchronously update the motion value with the latest values during the render. - * This ensures that within a React render, the styles applied to the DOM are up-to-date. - */ - updateValue(); - /** - * Subscribe to all motion values found within the template. Whenever any of them change, - * schedule an update. - */ - useIsomorphicLayoutEffect(() => { - const scheduleUpdate = () => frame.preRender(updateValue, false, true); - const subscriptions = values.map((v) => v.on("change", scheduleUpdate)); - return () => { - subscriptions.forEach((unsubscribe) => unsubscribe()); - cancelFrame(updateValue); - }; - }); - return value; -} - -export { useCombineMotionValues }; -//# sourceMappingURL=use-combine-values.mjs.map diff --git a/node_modules/framer-motion/dist/es/value/use-combine-values.mjs.map b/node_modules/framer-motion/dist/es/value/use-combine-values.mjs.map deleted file mode 100644 index fbcd3a3..0000000 --- a/node_modules/framer-motion/dist/es/value/use-combine-values.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"use-combine-values.mjs","sources":["../../../src/value/use-combine-values.ts"],"sourcesContent":["\"use client\"\n\nimport { cancelFrame, frame, MotionValue } from \"motion-dom\"\nimport { useIsomorphicLayoutEffect } from \"../utils/use-isomorphic-effect\"\nimport { useMotionValue } from \"./use-motion-value\"\n\nexport function useCombineMotionValues(\n values: MotionValue[],\n combineValues: () => R\n) {\n /**\n * Initialise the returned motion value. This remains the same between renders.\n */\n const value = useMotionValue(combineValues())\n\n /**\n * Create a function that will update the template motion value with the latest values.\n * This is pre-bound so whenever a motion value updates it can schedule its\n * execution in Framesync. If it's already been scheduled it won't be fired twice\n * in a single frame.\n */\n const updateValue = () => value.set(combineValues())\n\n /**\n * Synchronously update the motion value with the latest values during the render.\n * This ensures that within a React render, the styles applied to the DOM are up-to-date.\n */\n updateValue()\n\n /**\n * Subscribe to all motion values found within the template. Whenever any of them change,\n * schedule an update.\n */\n useIsomorphicLayoutEffect(() => {\n const scheduleUpdate = () => frame.preRender(updateValue, false, true)\n const subscriptions = values.map((v) => v.on(\"change\", scheduleUpdate))\n\n return () => {\n subscriptions.forEach((unsubscribe) => unsubscribe())\n cancelFrame(updateValue)\n }\n })\n\n return value\n}\n"],"names":[],"mappings":";;;;;AAMM;AAIF;;AAEG;AACH;AAEA;;;;;AAKG;AACH;AAEA;;;AAGG;AACH;AAEA;;;AAGG;;AAEC;;AAGA;;;AAGA;AACJ;AAEA;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/value/use-computed.mjs b/node_modules/framer-motion/dist/es/value/use-computed.mjs deleted file mode 100644 index 1e85b4e..0000000 --- a/node_modules/framer-motion/dist/es/value/use-computed.mjs +++ /dev/null @@ -1,21 +0,0 @@ -"use client"; -import { collectMotionValues } from 'motion-dom'; -import { useCombineMotionValues } from './use-combine-values.mjs'; - -function useComputed(compute) { - /** - * Open session of collectMotionValues. Any MotionValue that calls get() - * will be saved into this array. - */ - collectMotionValues.current = []; - compute(); - const value = useCombineMotionValues(collectMotionValues.current, compute); - /** - * Synchronously close session of collectMotionValues. - */ - collectMotionValues.current = undefined; - return value; -} - -export { useComputed }; -//# sourceMappingURL=use-computed.mjs.map diff --git a/node_modules/framer-motion/dist/es/value/use-computed.mjs.map b/node_modules/framer-motion/dist/es/value/use-computed.mjs.map deleted file mode 100644 index f8ada62..0000000 --- a/node_modules/framer-motion/dist/es/value/use-computed.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"use-computed.mjs","sources":["../../../src/value/use-computed.ts"],"sourcesContent":["\"use client\"\n\nimport { collectMotionValues, type MotionValue } from \"motion-dom\"\nimport { useCombineMotionValues } from \"./use-combine-values\"\n\nexport function useComputed(compute: () => O): MotionValue {\n /**\n * Open session of collectMotionValues. Any MotionValue that calls get()\n * will be saved into this array.\n */\n collectMotionValues.current = []\n\n compute()\n\n const value = useCombineMotionValues(collectMotionValues.current, compute)\n\n /**\n * Synchronously close session of collectMotionValues.\n */\n collectMotionValues.current = undefined\n\n return value\n}\n"],"names":[],"mappings":";;;;AAKM;AACF;;;AAGG;AACH;AAEA;;AAIA;;AAEG;AACH;AAEA;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/value/use-follow-value.mjs b/node_modules/framer-motion/dist/es/value/use-follow-value.mjs deleted file mode 100644 index 29cb0d2..0000000 --- a/node_modules/framer-motion/dist/es/value/use-follow-value.mjs +++ /dev/null @@ -1,23 +0,0 @@ -"use client"; -import { attachFollow, isMotionValue } from 'motion-dom'; -import { useContext, useInsertionEffect } from 'react'; -import { MotionConfigContext } from '../context/MotionConfigContext.mjs'; -import { useMotionValue } from './use-motion-value.mjs'; -import { useTransform } from './use-transform.mjs'; - -function useFollowValue(source, options = {}) { - const { isStatic } = useContext(MotionConfigContext); - const getFromSource = () => (isMotionValue(source) ? source.get() : source); - // isStatic will never change, allowing early hooks return - if (isStatic) { - return useTransform(getFromSource); - } - const value = useMotionValue(getFromSource()); - useInsertionEffect(() => { - return attachFollow(value, source, options); - }, [value, JSON.stringify(options)]); - return value; -} - -export { useFollowValue }; -//# sourceMappingURL=use-follow-value.mjs.map diff --git a/node_modules/framer-motion/dist/es/value/use-follow-value.mjs.map b/node_modules/framer-motion/dist/es/value/use-follow-value.mjs.map deleted file mode 100644 index bb1ef6c..0000000 --- a/node_modules/framer-motion/dist/es/value/use-follow-value.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"use-follow-value.mjs","sources":["../../../src/value/use-follow-value.ts"],"sourcesContent":["\"use client\"\n\nimport {\n AnyResolvedKeyframe,\n attachFollow,\n FollowValueOptions,\n isMotionValue,\n MotionValue,\n} from \"motion-dom\"\nimport { useContext, useInsertionEffect } from \"react\"\nimport { MotionConfigContext } from \"../context/MotionConfigContext\"\nimport { useMotionValue } from \"./use-motion-value\"\nimport { useTransform } from \"./use-transform\"\n\n/**\n * Creates a `MotionValue` that, when `set`, will use the specified animation transition to animate to its new state.\n *\n * Unlike `useSpring` which is limited to spring animations, `useFollowValue` accepts any motion transition\n * including spring, tween, inertia, and keyframes.\n *\n * It can either work as a stand-alone `MotionValue` by initialising it with a value, or as a subscriber\n * to another `MotionValue`.\n *\n * @remarks\n *\n * ```jsx\n * // Spring animation (default)\n * const x = useFollowValue(0, { stiffness: 300 })\n *\n * // Tween animation\n * const y = useFollowValue(0, { type: \"tween\", duration: 0.5, ease: \"easeOut\" })\n *\n * // Track another MotionValue with spring\n * const source = useMotionValue(0)\n * const z = useFollowValue(source, { type: \"spring\", damping: 10 })\n *\n * // Inertia animation\n * const w = useFollowValue(0, { type: \"inertia\", velocity: 100 })\n * ```\n *\n * @param inputValue - `MotionValue` or number. If provided a `MotionValue`, when the input `MotionValue` changes, the created `MotionValue` will animate towards that value using the specified transition.\n * @param options - Animation transition options. Supports all transition types: spring, tween, inertia, keyframes.\n * @returns `MotionValue`\n *\n * @public\n */\nexport function useFollowValue(\n source: MotionValue,\n options?: FollowValueOptions\n): MotionValue\nexport function useFollowValue(\n source: string,\n options?: FollowValueOptions\n): MotionValue\nexport function useFollowValue(\n source: MotionValue,\n options?: FollowValueOptions\n): MotionValue\nexport function useFollowValue(\n source: number,\n options?: FollowValueOptions\n): MotionValue\nexport function useFollowValue(\n source: MotionValue | MotionValue | AnyResolvedKeyframe,\n options: FollowValueOptions = {}\n) {\n const { isStatic } = useContext(MotionConfigContext)\n const getFromSource = () => (isMotionValue(source) ? source.get() : source)\n\n // isStatic will never change, allowing early hooks return\n if (isStatic) {\n return useTransform(getFromSource)\n }\n\n const value = useMotionValue(getFromSource())\n\n useInsertionEffect(() => {\n return attachFollow(value, source, options)\n }, [value, JSON.stringify(options)])\n\n return value\n}\n"],"names":[],"mappings":";;;;;;;;;;;;AAuEQ;;AAGJ;;;AAIA;AAEA;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/value/use-inverted-scale.mjs b/node_modules/framer-motion/dist/es/value/use-inverted-scale.mjs deleted file mode 100644 index 347d419..0000000 --- a/node_modules/framer-motion/dist/es/value/use-inverted-scale.mjs +++ /dev/null @@ -1,54 +0,0 @@ -"use client"; -import { invariant, warning } from 'motion-utils'; -import { useContext } from 'react'; -import { MotionContext } from '../context/MotionContext/index.mjs'; -import { useMotionValue } from './use-motion-value.mjs'; -import { useTransform } from './use-transform.mjs'; - -// Keep things reasonable and avoid scale: Infinity. In practise we might need -// to add another value, opacity, that could interpolate scaleX/Y [0,0.01] => [0,1] -// to simply hide content at unreasonable scales. -const maxScale = 100000; -const invertScale = (scale) => scale > 0.001 ? 1 / scale : maxScale; -let hasWarned = false; -/** - * Returns a `MotionValue` each for `scaleX` and `scaleY` that update with the inverse - * of their respective parent scales. - * - * This is useful for undoing the distortion of content when scaling a parent component. - * - * By default, `useInvertedScale` will automatically fetch `scaleX` and `scaleY` from the nearest parent. - * By passing other `MotionValue`s in as `useInvertedScale({ scaleX, scaleY })`, it will invert the output - * of those instead. - * - * ```jsx - * const MyComponent = () => { - * const { scaleX, scaleY } = useInvertedScale() - * return - * } - * ``` - * - * @deprecated - */ -function useInvertedScale(scale) { - let parentScaleX = useMotionValue(1); - let parentScaleY = useMotionValue(1); - const { visualElement } = useContext(MotionContext); - invariant(!!(scale || visualElement), "If no scale values are provided, useInvertedScale must be used within a child of another motion component."); - warning(hasWarned, "useInvertedScale is deprecated and will be removed in 3.0. Use the layout prop instead."); - hasWarned = true; - if (scale) { - parentScaleX = scale.scaleX || parentScaleX; - parentScaleY = scale.scaleY || parentScaleY; - } - else if (visualElement) { - parentScaleX = visualElement.getValue("scaleX", 1); - parentScaleY = visualElement.getValue("scaleY", 1); - } - const scaleX = useTransform(parentScaleX, invertScale); - const scaleY = useTransform(parentScaleY, invertScale); - return { scaleX, scaleY }; -} - -export { invertScale, useInvertedScale }; -//# sourceMappingURL=use-inverted-scale.mjs.map diff --git a/node_modules/framer-motion/dist/es/value/use-inverted-scale.mjs.map b/node_modules/framer-motion/dist/es/value/use-inverted-scale.mjs.map deleted file mode 100644 index b9ef57b..0000000 --- a/node_modules/framer-motion/dist/es/value/use-inverted-scale.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"use-inverted-scale.mjs","sources":["../../../src/value/use-inverted-scale.ts"],"sourcesContent":["\"use client\"\n\nimport { MotionValue } from \"motion-dom\"\nimport { invariant, warning } from \"motion-utils\"\nimport { useContext } from \"react\"\nimport { MotionContext } from \"../context/MotionContext\"\nimport { useMotionValue } from \"./use-motion-value\"\nimport { useTransform } from \"./use-transform\"\n\ninterface ScaleMotionValues {\n scaleX: MotionValue\n scaleY: MotionValue\n}\n\n// Keep things reasonable and avoid scale: Infinity. In practise we might need\n// to add another value, opacity, that could interpolate scaleX/Y [0,0.01] => [0,1]\n// to simply hide content at unreasonable scales.\nconst maxScale = 100000\nexport const invertScale = (scale: number) =>\n scale > 0.001 ? 1 / scale : maxScale\n\nlet hasWarned = false\n\n/**\n * Returns a `MotionValue` each for `scaleX` and `scaleY` that update with the inverse\n * of their respective parent scales.\n *\n * This is useful for undoing the distortion of content when scaling a parent component.\n *\n * By default, `useInvertedScale` will automatically fetch `scaleX` and `scaleY` from the nearest parent.\n * By passing other `MotionValue`s in as `useInvertedScale({ scaleX, scaleY })`, it will invert the output\n * of those instead.\n *\n * ```jsx\n * const MyComponent = () => {\n * const { scaleX, scaleY } = useInvertedScale()\n * return \n * }\n * ```\n *\n * @deprecated\n */\nexport function useInvertedScale(\n scale?: Partial\n): ScaleMotionValues {\n let parentScaleX = useMotionValue(1)\n let parentScaleY = useMotionValue(1)\n const { visualElement } = useContext(MotionContext)\n\n invariant(\n !!(scale || visualElement),\n \"If no scale values are provided, useInvertedScale must be used within a child of another motion component.\"\n )\n\n warning(\n hasWarned,\n \"useInvertedScale is deprecated and will be removed in 3.0. Use the layout prop instead.\"\n )\n\n hasWarned = true\n\n if (scale) {\n parentScaleX = scale.scaleX || parentScaleX\n parentScaleY = scale.scaleY || parentScaleY\n } else if (visualElement) {\n parentScaleX = visualElement.getValue(\"scaleX\", 1)\n parentScaleY = visualElement.getValue(\"scaleY\", 1)\n }\n\n const scaleX = useTransform(parentScaleX, invertScale)\n const scaleY = useTransform(parentScaleY, invertScale)\n\n return { scaleX, scaleY }\n}\n"],"names":[],"mappings":";;;;;;;AAcA;AACA;AACA;AACA;;AAIA;AAEA;;;;;;;;;;;;;;;;;;AAkBG;AACG;AAGF;AACA;;;AAQA;;;AAQI;AACA;;;;;;;;AASJ;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/value/use-motion-template.mjs b/node_modules/framer-motion/dist/es/value/use-motion-template.mjs deleted file mode 100644 index 9654b0d..0000000 --- a/node_modules/framer-motion/dist/es/value/use-motion-template.mjs +++ /dev/null @@ -1,47 +0,0 @@ -"use client"; -import { isMotionValue } from 'motion-dom'; -import { useCombineMotionValues } from './use-combine-values.mjs'; - -/** - * Combine multiple motion values into a new one using a string template literal. - * - * ```jsx - * import { - * motion, - * useSpring, - * useMotionValue, - * useMotionTemplate - * } from "framer-motion" - * - * function Component() { - * const shadowX = useSpring(0) - * const shadowY = useMotionValue(0) - * const shadow = useMotionTemplate`drop-shadow(${shadowX}px ${shadowY}px 20px rgba(0,0,0,0.3))` - * - * return - * } - * ``` - * - * @public - */ -function useMotionTemplate(fragments, ...values) { - /** - * Create a function that will build a string from the latest motion values. - */ - const numFragments = fragments.length; - function buildValue() { - let output = ``; - for (let i = 0; i < numFragments; i++) { - output += fragments[i]; - const value = values[i]; - if (value) { - output += isMotionValue(value) ? value.get() : value; - } - } - return output; - } - return useCombineMotionValues(values.filter(isMotionValue), buildValue); -} - -export { useMotionTemplate }; -//# sourceMappingURL=use-motion-template.mjs.map diff --git a/node_modules/framer-motion/dist/es/value/use-motion-template.mjs.map b/node_modules/framer-motion/dist/es/value/use-motion-template.mjs.map deleted file mode 100644 index ebd693d..0000000 --- a/node_modules/framer-motion/dist/es/value/use-motion-template.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"use-motion-template.mjs","sources":["../../../src/value/use-motion-template.ts"],"sourcesContent":["\"use client\"\n\nimport { isMotionValue, MotionValue } from \"motion-dom\"\nimport { useCombineMotionValues } from \"./use-combine-values\"\n\n/**\n * Combine multiple motion values into a new one using a string template literal.\n *\n * ```jsx\n * import {\n * motion,\n * useSpring,\n * useMotionValue,\n * useMotionTemplate\n * } from \"framer-motion\"\n *\n * function Component() {\n * const shadowX = useSpring(0)\n * const shadowY = useMotionValue(0)\n * const shadow = useMotionTemplate`drop-shadow(${shadowX}px ${shadowY}px 20px rgba(0,0,0,0.3))`\n *\n * return \n * }\n * ```\n *\n * @public\n */\nexport function useMotionTemplate(\n fragments: TemplateStringsArray,\n ...values: Array\n) {\n /**\n * Create a function that will build a string from the latest motion values.\n */\n const numFragments = fragments.length\n\n function buildValue() {\n let output = ``\n\n for (let i = 0; i < numFragments; i++) {\n output += fragments[i]\n const value = values[i]\n if (value) {\n output += isMotionValue(value) ? value.get() : value\n }\n }\n\n return output\n }\n\n return useCombineMotionValues(values.filter(isMotionValue), buildValue)\n}\n"],"names":[],"mappings":";;;;AAKA;;;;;;;;;;;;;;;;;;;;;AAqBG;;AAKC;;AAEG;AACH;AAEA;;AAGI;AACI;AACA;;AAEI;;;AAIR;;;AAIR;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/value/use-motion-value.mjs b/node_modules/framer-motion/dist/es/value/use-motion-value.mjs deleted file mode 100644 index 119b29e..0000000 --- a/node_modules/framer-motion/dist/es/value/use-motion-value.mjs +++ /dev/null @@ -1,40 +0,0 @@ -"use client"; -import { motionValue } from 'motion-dom'; -import { useContext, useState, useEffect } from 'react'; -import { MotionConfigContext } from '../context/MotionConfigContext.mjs'; -import { useConstant } from '../utils/use-constant.mjs'; - -/** - * Creates a `MotionValue` to track the state and velocity of a value. - * - * Usually, these are created automatically. For advanced use-cases, like use with `useTransform`, you can create `MotionValue`s externally and pass them into the animated component via the `style` prop. - * - * ```jsx - * export const MyComponent = () => { - * const scale = useMotionValue(1) - * - * return - * } - * ``` - * - * @param initial - The initial state. - * - * @public - */ -function useMotionValue(initial) { - const value = useConstant(() => motionValue(initial)); - /** - * If this motion value is being used in static mode, like on - * the Framer canvas, force components to rerender when the motion - * value is updated. - */ - const { isStatic } = useContext(MotionConfigContext); - if (isStatic) { - const [, setLatest] = useState(initial); - useEffect(() => value.on("change", setLatest), []); - } - return value; -} - -export { useMotionValue }; -//# sourceMappingURL=use-motion-value.mjs.map diff --git a/node_modules/framer-motion/dist/es/value/use-motion-value.mjs.map b/node_modules/framer-motion/dist/es/value/use-motion-value.mjs.map deleted file mode 100644 index 8dcf9a5..0000000 --- a/node_modules/framer-motion/dist/es/value/use-motion-value.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"use-motion-value.mjs","sources":["../../../src/value/use-motion-value.ts"],"sourcesContent":["\"use client\"\n\nimport { motionValue, MotionValue } from \"motion-dom\"\nimport { useContext, useEffect, useState } from \"react\"\nimport { MotionConfigContext } from \"../context/MotionConfigContext\"\nimport { useConstant } from \"../utils/use-constant\"\n\n/**\n * Creates a `MotionValue` to track the state and velocity of a value.\n *\n * Usually, these are created automatically. For advanced use-cases, like use with `useTransform`, you can create `MotionValue`s externally and pass them into the animated component via the `style` prop.\n *\n * ```jsx\n * export const MyComponent = () => {\n * const scale = useMotionValue(1)\n *\n * return \n * }\n * ```\n *\n * @param initial - The initial state.\n *\n * @public\n */\nexport function useMotionValue(initial: T): MotionValue {\n const value = useConstant(() => motionValue(initial))\n\n /**\n * If this motion value is being used in static mode, like on\n * the Framer canvas, force components to rerender when the motion\n * value is updated.\n */\n const { isStatic } = useContext(MotionConfigContext)\n if (isStatic) {\n const [, setLatest] = useState(initial)\n useEffect(() => value.on(\"change\", setLatest), [])\n }\n\n return value\n}\n"],"names":[],"mappings":";;;;;;AAOA;;;;;;;;;;;;;;;;AAgBG;AACG;AACF;AAEA;;;;AAIG;;;;AAIC;;AAGJ;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/value/use-scroll.mjs b/node_modules/framer-motion/dist/es/value/use-scroll.mjs deleted file mode 100644 index 9b2fdcc..0000000 --- a/node_modules/framer-motion/dist/es/value/use-scroll.mjs +++ /dev/null @@ -1,119 +0,0 @@ -"use client"; -import { microtask, cancelMicrotask, supportsViewTimeline, supportsScrollTimeline, motionValue } from 'motion-dom'; -import { invariant } from 'motion-utils'; -import { useRef, useCallback, useEffect } from 'react'; -import { scroll } from '../render/dom/scroll/index.mjs'; -import { offsetToViewTimelineRange } from '../render/dom/scroll/utils/offset-to-range.mjs'; -import { useConstant } from '../utils/use-constant.mjs'; -import { useIsomorphicLayoutEffect } from '../utils/use-isomorphic-effect.mjs'; - -const createScrollMotionValues = () => ({ - scrollX: motionValue(0), - scrollY: motionValue(0), - scrollXProgress: motionValue(0), - scrollYProgress: motionValue(0), -}); -const isRefPending = (ref) => { - if (!ref) - return false; - return !ref.current; -}; -function makeAccelerateConfig(axis, options, container, target) { - return { - // Refs attach child-first; defer so target.current is populated - // before scroll() reads it. - factory: (animation) => { - let cleanup; - const start = () => { - // A provided ref may be hydrated by an effect declared after - // useScroll (or in a parent). Don't attach to the window - // scroll in the meantime — that result gets cached and would - // permanently mistrack. Wait until the ref resolves. - if (isRefPending(container) || isRefPending(target)) { - microtask.read(start); - return; - } - cleanup = scroll(animation, { - ...options, - axis, - container: container?.current || undefined, - target: target?.current || undefined, - }); - }; - microtask.read(start); - return () => { - cancelMicrotask(start); - cleanup?.(); - }; - }, - times: [0, 1], - keyframes: [0, 1], - ease: (v) => v, - duration: 1, - }; -} -function canAccelerateScroll(target, offset) { - if (typeof window === "undefined") - return false; - return target - ? supportsViewTimeline() && !!offsetToViewTimelineRange(offset) - : supportsScrollTimeline(); -} -function useScroll({ container, target, ...options } = {}) { - const values = useConstant(createScrollMotionValues); - if (canAccelerateScroll(target, options.offset)) { - values.scrollXProgress.accelerate = makeAccelerateConfig("x", options, container, target); - values.scrollYProgress.accelerate = makeAccelerateConfig("y", options, container, target); - } - const scrollAnimation = useRef(null); - const needsStart = useRef(false); - const start = useCallback(() => { - scrollAnimation.current = scroll((_progress, { x, y, }) => { - values.scrollX.set(x.current); - values.scrollXProgress.set(x.progress); - values.scrollY.set(y.current); - values.scrollYProgress.set(y.progress); - }, { - ...options, - container: container?.current || undefined, - target: target?.current || undefined, - }); - return () => { - scrollAnimation.current?.(); - }; - }, [container, target, JSON.stringify(options.offset)]); - useIsomorphicLayoutEffect(() => { - needsStart.current = false; - if (isRefPending(container) || isRefPending(target)) { - needsStart.current = true; - return; - } - else { - return start(); - } - }, [start]); - useEffect(() => { - if (!needsStart.current) - return; - // Defer to a microtask so any sibling/parent effect that hydrates the - // ref has a chance to run first. - let cleanup; - const tryStart = () => { - const containerPending = isRefPending(container); - const targetPending = isRefPending(target); - invariant(!containerPending, "Container ref is defined but not hydrated", "use-scroll-ref"); - invariant(!targetPending, "Target ref is defined but not hydrated", "use-scroll-ref"); - if (!containerPending && !targetPending) - cleanup = start(); - }; - microtask.read(tryStart); - return () => { - cancelMicrotask(tryStart); - cleanup?.(); - }; - }, [start]); - return values; -} - -export { useScroll }; -//# sourceMappingURL=use-scroll.mjs.map diff --git a/node_modules/framer-motion/dist/es/value/use-scroll.mjs.map b/node_modules/framer-motion/dist/es/value/use-scroll.mjs.map deleted file mode 100644 index d726410..0000000 --- a/node_modules/framer-motion/dist/es/value/use-scroll.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"use-scroll.mjs","sources":["../../../src/value/use-scroll.ts"],"sourcesContent":["\"use client\"\n\nimport {\n AnimationPlaybackControls,\n cancelMicrotask,\n microtask,\n motionValue,\n supportsScrollTimeline,\n supportsViewTimeline,\n} from \"motion-dom\"\nimport { invariant } from \"motion-utils\"\nimport { RefObject, useCallback, useEffect, useRef } from \"react\"\nimport { scroll } from \"../render/dom/scroll\"\nimport { ScrollInfoOptions } from \"../render/dom/scroll/types\"\nimport { offsetToViewTimelineRange } from \"../render/dom/scroll/utils/offset-to-range\"\nimport { useConstant } from \"../utils/use-constant\"\nimport { useIsomorphicLayoutEffect } from \"../utils/use-isomorphic-effect\"\n\nexport interface UseScrollOptions\n extends Omit {\n container?: RefObject\n target?: RefObject\n}\n\nconst createScrollMotionValues = () => ({\n scrollX: motionValue(0),\n scrollY: motionValue(0),\n scrollXProgress: motionValue(0),\n scrollYProgress: motionValue(0),\n})\n\nconst isRefPending = (ref?: RefObject) => {\n if (!ref) return false\n return !ref.current\n}\n\nfunction makeAccelerateConfig(\n axis: \"x\" | \"y\",\n options: Omit,\n container?: RefObject,\n target?: RefObject\n) {\n return {\n // Refs attach child-first; defer so target.current is populated\n // before scroll() reads it.\n factory: (animation: AnimationPlaybackControls) => {\n let cleanup: VoidFunction | undefined\n const start = () => {\n // A provided ref may be hydrated by an effect declared after\n // useScroll (or in a parent). Don't attach to the window\n // scroll in the meantime — that result gets cached and would\n // permanently mistrack. Wait until the ref resolves.\n if (isRefPending(container) || isRefPending(target)) {\n microtask.read(start)\n return\n }\n cleanup = scroll(animation, {\n ...options,\n axis,\n container: container?.current || undefined,\n target: target?.current || undefined,\n })\n }\n microtask.read(start)\n return () => {\n cancelMicrotask(start)\n cleanup?.()\n }\n },\n times: [0, 1],\n keyframes: [0, 1],\n ease: (v: number) => v,\n duration: 1,\n }\n}\n\nfunction canAccelerateScroll(\n target?: RefObject,\n offset?: ScrollInfoOptions[\"offset\"]\n) {\n if (typeof window === \"undefined\") return false\n return target\n ? supportsViewTimeline() && !!offsetToViewTimelineRange(offset)\n : supportsScrollTimeline()\n}\n\nexport function useScroll({\n container,\n target,\n ...options\n}: UseScrollOptions = {}) {\n const values = useConstant(createScrollMotionValues)\n\n if (canAccelerateScroll(target, options.offset)) {\n values.scrollXProgress.accelerate = makeAccelerateConfig(\n \"x\",\n options,\n container,\n target\n )\n values.scrollYProgress.accelerate = makeAccelerateConfig(\n \"y\",\n options,\n container,\n target\n )\n }\n\n const scrollAnimation = useRef(null)\n const needsStart = useRef(false)\n\n const start = useCallback(() => {\n scrollAnimation.current = scroll(\n (\n _progress: number,\n {\n x,\n y,\n }: {\n x: { current: number; progress: number }\n y: { current: number; progress: number }\n }\n ) => {\n values.scrollX.set(x.current)\n values.scrollXProgress.set(x.progress)\n values.scrollY.set(y.current)\n values.scrollYProgress.set(y.progress)\n },\n {\n ...options,\n container: container?.current || undefined,\n target: target?.current || undefined,\n }\n )\n\n return () => {\n scrollAnimation.current?.()\n }\n }, [container, target, JSON.stringify(options.offset)])\n\n useIsomorphicLayoutEffect(() => {\n needsStart.current = false\n\n if (isRefPending(container) || isRefPending(target)) {\n needsStart.current = true\n return\n } else {\n return start()\n }\n }, [start])\n\n useEffect(() => {\n if (!needsStart.current) return\n\n // Defer to a microtask so any sibling/parent effect that hydrates the\n // ref has a chance to run first.\n let cleanup: VoidFunction | undefined\n const tryStart = () => {\n const containerPending = isRefPending(container)\n const targetPending = isRefPending(target)\n invariant(\n !containerPending,\n \"Container ref is defined but not hydrated\",\n \"use-scroll-ref\"\n )\n invariant(\n !targetPending,\n \"Target ref is defined but not hydrated\",\n \"use-scroll-ref\"\n )\n if (!containerPending && !targetPending) cleanup = start()\n }\n microtask.read(tryStart)\n\n return () => {\n cancelMicrotask(tryStart)\n cleanup?.()\n }\n }, [start])\n\n return values\n}\n"],"names":[],"mappings":";;;;;;;;;AAwBA;AACI;AACA;AACA;AACA;AACH;AAED;AACI;AAAU;AACV;AACJ;AAEA;;;;AASQ;AACI;;;;;;;AAOQ;;;AAGJ;AACI;;AAEA;AACA;AACH;AACL;AACA;AACA;;;AAGA;;AAEJ;AACA;AACA;AACA;;AAER;AAEA;;AAIuC;AACnC;;;AAGJ;AAEM;AAKF;;AAGI;AAMA;;AAQJ;AACA;AAEA;AACI;;;;;AAeI;AAEI;AACA;AACA;AACH;AAGL;AACI;AACJ;AACJ;;AAGI;;AAGI;;;;;;AAKR;;;;;;AAOI;;AAEI;AACA;;;AAWA;;AACJ;AACA;AAEA;;;AAGA;AACJ;AAEA;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/value/use-spring.mjs b/node_modules/framer-motion/dist/es/value/use-spring.mjs deleted file mode 100644 index 225081a..0000000 --- a/node_modules/framer-motion/dist/es/value/use-spring.mjs +++ /dev/null @@ -1,9 +0,0 @@ -"use client"; -import { useFollowValue } from './use-follow-value.mjs'; - -function useSpring(source, options = {}) { - return useFollowValue(source, { type: "spring", ...options }); -} - -export { useSpring }; -//# sourceMappingURL=use-spring.mjs.map diff --git a/node_modules/framer-motion/dist/es/value/use-spring.mjs.map b/node_modules/framer-motion/dist/es/value/use-spring.mjs.map deleted file mode 100644 index d96672d..0000000 --- a/node_modules/framer-motion/dist/es/value/use-spring.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"use-spring.mjs","sources":["../../../src/value/use-spring.ts"],"sourcesContent":["\"use client\"\n\nimport { FollowValueOptions, MotionValue, SpringOptions } from \"motion-dom\"\nimport { useFollowValue } from \"./use-follow-value\"\n\ntype UseSpringOptions = SpringOptions &\n Pick\n\n/**\n * Creates a `MotionValue` that, when `set`, will use a spring animation to animate to its new state.\n *\n * It can either work as a stand-alone `MotionValue` by initialising it with a value, or as a subscriber\n * to another `MotionValue`.\n *\n * @remarks\n *\n * ```jsx\n * const x = useSpring(0, { stiffness: 300 })\n * const y = useSpring(x, { damping: 10 })\n * ```\n *\n * @param inputValue - `MotionValue` or number. If provided a `MotionValue`, when the input `MotionValue` changes, the created `MotionValue` will spring towards that value.\n * @param springConfig - Configuration options for the spring.\n * @returns `MotionValue`\n *\n * @public\n */\nexport function useSpring(\n source: MotionValue,\n options?: UseSpringOptions\n): MotionValue\nexport function useSpring(\n source: string,\n options?: UseSpringOptions\n): MotionValue\nexport function useSpring(\n source: MotionValue,\n options?: UseSpringOptions\n): MotionValue\nexport function useSpring(\n source: number,\n options?: UseSpringOptions\n): MotionValue\nexport function useSpring(\n source: MotionValue | MotionValue | string | number,\n options: UseSpringOptions = {}\n): MotionValue | MotionValue {\n return useFollowValue(source as any, { type: \"spring\", ...options })\n}\n"],"names":[],"mappings":";;;;AA+CI;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/value/use-time.mjs b/node_modules/framer-motion/dist/es/value/use-time.mjs deleted file mode 100644 index 74ec85a..0000000 --- a/node_modules/framer-motion/dist/es/value/use-time.mjs +++ /dev/null @@ -1,12 +0,0 @@ -"use client"; -import { useAnimationFrame } from '../utils/use-animation-frame.mjs'; -import { useMotionValue } from './use-motion-value.mjs'; - -function useTime() { - const time = useMotionValue(0); - useAnimationFrame((t) => time.set(t)); - return time; -} - -export { useTime }; -//# sourceMappingURL=use-time.mjs.map diff --git a/node_modules/framer-motion/dist/es/value/use-time.mjs.map b/node_modules/framer-motion/dist/es/value/use-time.mjs.map deleted file mode 100644 index c733bba..0000000 --- a/node_modules/framer-motion/dist/es/value/use-time.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"use-time.mjs","sources":["../../../src/value/use-time.ts"],"sourcesContent":["\"use client\"\n\nimport { useAnimationFrame } from \"../utils/use-animation-frame\"\nimport { useMotionValue } from \"./use-motion-value\"\n\nexport function useTime() {\n const time = useMotionValue(0)\n useAnimationFrame((t) => time.set(t))\n return time\n}\n"],"names":[],"mappings":";;;;;AAMI;AACA;AACA;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/value/use-transform.mjs b/node_modules/framer-motion/dist/es/value/use-transform.mjs deleted file mode 100644 index 156168e..0000000 --- a/node_modules/framer-motion/dist/es/value/use-transform.mjs +++ /dev/null @@ -1,70 +0,0 @@ -"use client"; -import { transform } from 'motion-dom'; -import { useConstant } from '../utils/use-constant.mjs'; -import { useCombineMotionValues } from './use-combine-values.mjs'; -import { useComputed } from './use-computed.mjs'; - -function useTransform(input, inputRangeOrTransformer, outputRangeOrMap, options) { - if (typeof input === "function") { - return useComputed(input); - } - /** - * Detect if outputRangeOrMap is an output map (object with keys) - * rather than an output range (array). - */ - const isOutputMap = outputRangeOrMap !== undefined && - !Array.isArray(outputRangeOrMap) && - typeof inputRangeOrTransformer !== "function"; - if (isOutputMap) { - return useMapTransform(input, inputRangeOrTransformer, outputRangeOrMap, options); - } - const outputRange = outputRangeOrMap; - const transformer = typeof inputRangeOrTransformer === "function" - ? inputRangeOrTransformer - : transform(inputRangeOrTransformer, outputRange, options); - const result = Array.isArray(input) - ? useListTransform(input, transformer) - : useListTransform([input], ([latest]) => transformer(latest)); - const inputAccelerate = !Array.isArray(input) - ? input.accelerate - : undefined; - if (inputAccelerate && - !inputAccelerate.isTransformed && - typeof inputRangeOrTransformer !== "function" && - Array.isArray(outputRangeOrMap) && - options?.clamp !== false) { - result.accelerate = { - ...inputAccelerate, - times: inputRangeOrTransformer, - keyframes: outputRangeOrMap, - isTransformed: true, - ...(options?.ease ? { ease: options.ease } : {}), - }; - } - return result; -} -function useListTransform(values, transformer) { - const latest = useConstant(() => []); - return useCombineMotionValues(values, () => { - latest.length = 0; - const numValues = values.length; - for (let i = 0; i < numValues; i++) { - latest[i] = values[i].get(); - } - return transformer(latest); - }); -} -function useMapTransform(inputValue, inputRange, outputMap, options) { - /** - * Capture keys once to ensure hooks are called in consistent order. - */ - const keys = useConstant(() => Object.keys(outputMap)); - const output = useConstant(() => ({})); - for (const key of keys) { - output[key] = useTransform(inputValue, inputRange, outputMap[key], options); - } - return output; -} - -export { useTransform }; -//# sourceMappingURL=use-transform.mjs.map diff --git a/node_modules/framer-motion/dist/es/value/use-transform.mjs.map b/node_modules/framer-motion/dist/es/value/use-transform.mjs.map deleted file mode 100644 index bec9364..0000000 --- a/node_modules/framer-motion/dist/es/value/use-transform.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"use-transform.mjs","sources":["../../../src/value/use-transform.ts"],"sourcesContent":["\"use client\"\n\nimport {\n AnyResolvedKeyframe,\n MotionValue,\n transform,\n TransformOptions,\n} from \"motion-dom\"\nimport { useConstant } from \"../utils/use-constant\"\nimport { useCombineMotionValues } from \"./use-combine-values\"\nimport { useComputed } from \"./use-computed\"\n\nexport type InputRange = number[]\ntype SingleTransformer = (input: I) => O\ntype MultiTransformer = (input: I[]) => O\ntype Transformer =\n | SingleTransformer\n /**\n * Ideally, this would be typed in all instances, but to type this\n * more accurately requires the tuple support in TypeScript 4:\n * https://gist.github.com/InventingWithMonster/c4d23752a0fae7888596c4ff6d92733a\n */\n | MultiTransformer\n\ninterface OutputMap {\n [key: string]: O[]\n}\n\n/**\n * Create multiple `MotionValue`s that transform the output of another `MotionValue` by mapping it from one range of values into multiple output ranges.\n *\n * @remarks\n *\n * This is useful when you want to derive multiple values from a single input value.\n * The keys of the output map must remain constant across renders.\n *\n * ```jsx\n * export const MyComponent = () => {\n * const x = useMotionValue(0)\n * const { opacity, scale } = useTransform(x, [0, 100], {\n * opacity: [0, 1],\n * scale: [0.5, 1]\n * })\n *\n * return (\n * \n * )\n * }\n * ```\n *\n * @param inputValue - `MotionValue`\n * @param inputRange - A linear series of numbers (either all increasing or decreasing)\n * @param outputMap - An object where keys map to output ranges. Each output range must be the same length as `inputRange`.\n * @param options - Transform options applied to all outputs\n *\n * @returns An object with the same keys as `outputMap`, where each value is a `MotionValue`\n *\n * @public\n */\nexport function useTransform>(\n inputValue: MotionValue,\n inputRange: InputRange,\n outputMap: T,\n options?: TransformOptions\n): { [K in keyof T]: MotionValue }\n\n/**\n * Create a `MotionValue` that transforms the output of another `MotionValue` by mapping it from one range of values into another.\n *\n * @remarks\n *\n * Given an input range of `[-200, -100, 100, 200]` and an output range of\n * `[0, 1, 1, 0]`, the returned `MotionValue` will:\n *\n * - When provided a value between `-200` and `-100`, will return a value between `0` and `1`.\n * - When provided a value between `-100` and `100`, will return `1`.\n * - When provided a value between `100` and `200`, will return a value between `1` and `0`\n *\n *\n * The input range must be a linear series of numbers. The output range\n * can be any value type supported by Motion: numbers, colors, shadows, etc.\n *\n * Every value in the output range must be of the same type and in the same format.\n *\n * ```jsx\n * export const MyComponent = () => {\n * const x = useMotionValue(0)\n * const xRange = [-200, -100, 100, 200]\n * const opacityRange = [0, 1, 1, 0]\n * const opacity = useTransform(x, xRange, opacityRange)\n *\n * return (\n * \n * )\n * }\n * ```\n *\n * @param inputValue - `MotionValue`\n * @param inputRange - A linear series of numbers (either all increasing or decreasing)\n * @param outputRange - A series of numbers, colors or strings. Must be the same length as `inputRange`.\n * @param options -\n *\n * - clamp: boolean. Clamp values to within the given range. Defaults to `true`\n * - ease: EasingFunction[]. Easing functions to use on the interpolations between each value in the input and output ranges. If provided as an array, the array must be one item shorter than the input and output ranges, as the easings apply to the transition between each.\n *\n * @returns `MotionValue`\n *\n * @public\n */\nexport function useTransform(\n value: MotionValue,\n inputRange: InputRange,\n outputRange: O[],\n options?: TransformOptions\n): MotionValue\n\n/**\n * Create a `MotionValue` that transforms the output of another `MotionValue` through a function.\n * In this example, `y` will always be double `x`.\n *\n * ```jsx\n * export const MyComponent = () => {\n * const x = useMotionValue(10)\n * const y = useTransform(x, value => value * 2)\n *\n * return \n * }\n * ```\n *\n * @param input - A `MotionValue` that will pass its latest value through `transform` to update the returned `MotionValue`.\n * @param transform - A function that accepts the latest value from `input` and returns a new value.\n * @returns `MotionValue`\n *\n * @public\n */\nexport function useTransform(\n input: MotionValue,\n transformer: SingleTransformer\n): MotionValue\n\n/**\n * Pass an array of `MotionValue`s and a function to combine them. In this example, `z` will be the `x` multiplied by `y`.\n *\n * ```jsx\n * export const MyComponent = () => {\n * const x = useMotionValue(0)\n * const y = useMotionValue(0)\n * const z = useTransform([x, y], ([latestX, latestY]) => latestX * latestY)\n *\n * return \n * }\n * ```\n *\n * @param input - An array of `MotionValue`s that will pass their latest values through `transform` to update the returned `MotionValue`.\n * @param transform - A function that accepts the latest values from `input` and returns a new value.\n * @returns `MotionValue`\n *\n * @public\n */\nexport function useTransform(\n input:\n | MotionValue[]\n | MotionValue[]\n | MotionValue[],\n transformer: MultiTransformer\n): MotionValue\nexport function useTransform(transformer: () => O): MotionValue\n\nexport function useTransform(\n input:\n | MotionValue\n | MotionValue[]\n | MotionValue[]\n | MotionValue[]\n | (() => O),\n inputRangeOrTransformer?: InputRange | Transformer,\n outputRangeOrMap?: O[] | OutputMap,\n options?: TransformOptions\n): MotionValue | { [key in K]: MotionValue } {\n if (typeof input === \"function\") {\n return useComputed(input)\n }\n\n /**\n * Detect if outputRangeOrMap is an output map (object with keys)\n * rather than an output range (array).\n */\n const isOutputMap =\n outputRangeOrMap !== undefined &&\n !Array.isArray(outputRangeOrMap) &&\n typeof inputRangeOrTransformer !== \"function\"\n\n if (isOutputMap) {\n return useMapTransform(\n input as MotionValue,\n inputRangeOrTransformer as InputRange,\n outputRangeOrMap as OutputMap,\n options\n ) as { [key in K]: MotionValue }\n }\n\n const outputRange = outputRangeOrMap as O[] | undefined\n const transformer =\n typeof inputRangeOrTransformer === \"function\"\n ? inputRangeOrTransformer\n : transform(inputRangeOrTransformer!, outputRange!, options)\n\n const result = Array.isArray(input)\n ? useListTransform(\n input,\n transformer as MultiTransformer\n )\n : useListTransform([input], ([latest]) =>\n (transformer as SingleTransformer)(latest)\n )\n\n const inputAccelerate = !Array.isArray(input)\n ? (input as MotionValue).accelerate\n : undefined\n\n if (\n inputAccelerate &&\n !inputAccelerate.isTransformed &&\n typeof inputRangeOrTransformer !== \"function\" &&\n Array.isArray(outputRangeOrMap) &&\n options?.clamp !== false\n ) {\n result.accelerate = {\n ...inputAccelerate,\n times: inputRangeOrTransformer as number[],\n keyframes: outputRangeOrMap,\n isTransformed: true,\n ...(options?.ease ? { ease: options.ease } : {}),\n }\n }\n\n return result\n}\n\nfunction useListTransform(\n values: MotionValue[],\n transformer: MultiTransformer\n): MotionValue {\n const latest = useConstant(() => [])\n\n return useCombineMotionValues(values, () => {\n latest.length = 0\n const numValues = values.length\n for (let i = 0; i < numValues; i++) {\n latest[i] = values[i].get()\n }\n\n return transformer(latest)\n })\n}\n\nfunction useMapTransform(\n inputValue: MotionValue,\n inputRange: InputRange,\n outputMap: OutputMap,\n options?: TransformOptions\n): { [key: string]: MotionValue } {\n /**\n * Capture keys once to ensure hooks are called in consistent order.\n */\n const keys = useConstant(() => Object.keys(outputMap))\n const output = useConstant<{ [key: string]: MotionValue }>(() => ({}))\n\n for (const key of keys) {\n output[key] = useTransform(inputValue, inputRange, outputMap[key], options)\n }\n\n return output\n}\n"],"names":[],"mappings":";;;;;;AA2KM;AAWF;AACI;;AAGJ;;;AAGG;AACH;AAEI;;;;;;AAaJ;AAEQ;;AAGR;AACI;AAIA;;;;AAQJ;;;AAII;AACA;;AAGI;AACA;AACA;AACA;AACA;;;AAIR;AACJ;AAEA;;AAMI;AACI;AACA;AACA;;;AAIA;AACJ;AACJ;AAEA;AAMI;;AAEG;AACH;;AAGA;AACI;;AAGJ;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/value/use-velocity.mjs b/node_modules/framer-motion/dist/es/value/use-velocity.mjs deleted file mode 100644 index 70a9d19..0000000 --- a/node_modules/framer-motion/dist/es/value/use-velocity.mjs +++ /dev/null @@ -1,37 +0,0 @@ -"use client"; -import { frame } from 'motion-dom'; -import { useMotionValueEvent } from '../utils/use-motion-value-event.mjs'; -import { useMotionValue } from './use-motion-value.mjs'; - -/** - * Creates a `MotionValue` that updates when the velocity of the provided `MotionValue` changes. - * - * ```javascript - * const x = useMotionValue(0) - * const xVelocity = useVelocity(x) - * const xAcceleration = useVelocity(xVelocity) - * ``` - * - * @public - */ -function useVelocity(value) { - const velocity = useMotionValue(value.getVelocity()); - const updateVelocity = () => { - const latest = value.getVelocity(); - velocity.set(latest); - /** - * If we still have velocity, schedule an update for the next frame - * to keep checking until it is zero. - */ - if (latest) - frame.update(updateVelocity); - }; - useMotionValueEvent(value, "change", () => { - // Schedule an update to this value at the end of the current frame. - frame.update(updateVelocity, false, true); - }); - return velocity; -} - -export { useVelocity }; -//# sourceMappingURL=use-velocity.mjs.map diff --git a/node_modules/framer-motion/dist/es/value/use-velocity.mjs.map b/node_modules/framer-motion/dist/es/value/use-velocity.mjs.map deleted file mode 100644 index df80afe..0000000 --- a/node_modules/framer-motion/dist/es/value/use-velocity.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"use-velocity.mjs","sources":["../../../src/value/use-velocity.ts"],"sourcesContent":["\"use client\"\n\nimport { frame, MotionValue } from \"motion-dom\"\nimport { useMotionValueEvent } from \"../utils/use-motion-value-event\"\nimport { useMotionValue } from \"./use-motion-value\"\n/**\n * Creates a `MotionValue` that updates when the velocity of the provided `MotionValue` changes.\n *\n * ```javascript\n * const x = useMotionValue(0)\n * const xVelocity = useVelocity(x)\n * const xAcceleration = useVelocity(xVelocity)\n * ```\n *\n * @public\n */\nexport function useVelocity(value: MotionValue): MotionValue {\n const velocity = useMotionValue(value.getVelocity())\n\n const updateVelocity = () => {\n const latest = value.getVelocity()\n velocity.set(latest)\n\n /**\n * If we still have velocity, schedule an update for the next frame\n * to keep checking until it is zero.\n */\n if (latest) frame.update(updateVelocity)\n }\n\n useMotionValueEvent(value, \"change\", () => {\n // Schedule an update to this value at the end of the current frame.\n frame.update(updateVelocity, false, true)\n })\n\n return velocity\n}\n"],"names":[],"mappings":";;;;;AAKA;;;;;;;;;;AAUG;AACG;;;AAIE;AACA;AAEA;;;AAGG;AACH;AAAY;AAChB;AAEA;;;AAGA;AAEA;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/value/use-will-change/WillChangeMotionValue.mjs b/node_modules/framer-motion/dist/es/value/use-will-change/WillChangeMotionValue.mjs deleted file mode 100644 index b5ba18b..0000000 --- a/node_modules/framer-motion/dist/es/value/use-will-change/WillChangeMotionValue.mjs +++ /dev/null @@ -1,20 +0,0 @@ -import { MotionValue, transformProps, acceleratedValues } from 'motion-dom'; - -class WillChangeMotionValue extends MotionValue { - constructor() { - super(...arguments); - this.isEnabled = false; - } - add(name) { - if (transformProps.has(name) || acceleratedValues.has(name)) { - this.isEnabled = true; - this.update(); - } - } - update() { - this.set(this.isEnabled ? "transform" : "auto"); - } -} - -export { WillChangeMotionValue }; -//# sourceMappingURL=WillChangeMotionValue.mjs.map diff --git a/node_modules/framer-motion/dist/es/value/use-will-change/WillChangeMotionValue.mjs.map b/node_modules/framer-motion/dist/es/value/use-will-change/WillChangeMotionValue.mjs.map deleted file mode 100644 index 1768274..0000000 --- a/node_modules/framer-motion/dist/es/value/use-will-change/WillChangeMotionValue.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"WillChangeMotionValue.mjs","sources":["../../../../src/value/use-will-change/WillChangeMotionValue.ts"],"sourcesContent":["import {\n acceleratedValues,\n MotionValue,\n transformProps,\n type WillChange,\n} from \"motion-dom\"\n\nexport class WillChangeMotionValue\n extends MotionValue\n implements WillChange\n{\n private isEnabled = false\n\n add(name: string) {\n if (transformProps.has(name) || acceleratedValues.has(name)) {\n this.isEnabled = true\n this.update()\n }\n }\n\n private update() {\n this.set(this.isEnabled ? \"transform\" : \"auto\")\n }\n}\n"],"names":[],"mappings":";;AAOM,MAAO,qBACT,SAAQ,WAAmB,CAAA;AAD/B,IAAA,WAAA,GAAA;;QAIY,IAAA,CAAA,SAAS,GAAG,KAAK;IAY7B;AAVI,IAAA,GAAG,CAAC,IAAY,EAAA;AACZ,QAAA,IAAI,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;AACzD,YAAA,IAAI,CAAC,SAAS,GAAG,IAAI;YACrB,IAAI,CAAC,MAAM,EAAE;QACjB;IACJ;IAEQ,MAAM,GAAA;AACV,QAAA,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,GAAG,WAAW,GAAG,MAAM,CAAC;IACnD;AACH;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/value/use-will-change/index.mjs b/node_modules/framer-motion/dist/es/value/use-will-change/index.mjs deleted file mode 100644 index f06ed5e..0000000 --- a/node_modules/framer-motion/dist/es/value/use-will-change/index.mjs +++ /dev/null @@ -1,10 +0,0 @@ -"use client"; -import { useConstant } from '../../utils/use-constant.mjs'; -import { WillChangeMotionValue } from './WillChangeMotionValue.mjs'; - -function useWillChange() { - return useConstant(() => new WillChangeMotionValue("auto")); -} - -export { useWillChange }; -//# sourceMappingURL=index.mjs.map diff --git a/node_modules/framer-motion/dist/es/value/use-will-change/index.mjs.map b/node_modules/framer-motion/dist/es/value/use-will-change/index.mjs.map deleted file mode 100644 index 0944a7c..0000000 --- a/node_modules/framer-motion/dist/es/value/use-will-change/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs","sources":["../../../../src/value/use-will-change/index.ts"],"sourcesContent":["\"use client\"\n\nimport type { WillChange } from \"motion-dom\"\nimport { useConstant } from \"../../utils/use-constant\"\nimport { WillChangeMotionValue } from \"./WillChangeMotionValue\"\n\nexport function useWillChange(): WillChange {\n return useConstant(() => new WillChangeMotionValue(\"auto\"))\n}\n"],"names":[],"mappings":";;;;;;AAQA;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/framer-motion.dev.js b/node_modules/framer-motion/dist/framer-motion.dev.js deleted file mode 100644 index b9a2adf..0000000 --- a/node_modules/framer-motion/dist/framer-motion.dev.js +++ /dev/null @@ -1,17543 +0,0 @@ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) : - typeof define === 'function' && define.amd ? define(['exports', 'react'], factory) : - (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Motion = {}, global.React)); -})(this, (function (exports, React$1) { 'use strict'; - - function _interopNamespaceDefault(e) { - var n = Object.create(null); - if (e) { - Object.keys(e).forEach(function (k) { - if (k !== 'default') { - var d = Object.getOwnPropertyDescriptor(e, k); - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: function () { return e[k]; } - }); - } - }); - } - n.default = e; - return Object.freeze(n); - } - - var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React$1); - - // source: react/cjs/react-jsx-runtime.production.min.js - /** - * @license React - * react-jsx-runtime.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - var f = React, - k = Symbol.for("react.element"), - l = Symbol.for("react.fragment"), - m$1 = Object.prototype.hasOwnProperty, - n = f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, - p = { key: true, ref: true, __self: true, __source: true }; - function q(c, a, g) { - var b, - d = {}, - e = null, - h = null; - void 0 !== g && (e = "" + g); - void 0 !== a.key && (e = "" + a.key); - void 0 !== a.ref && (h = a.ref); - for (b in a) m$1.call(a, b) && !p.hasOwnProperty(b) && (d[b] = a[b]); - if (c && c.defaultProps) - for (b in ((a = c.defaultProps), a)) void 0 === d[b] && (d[b] = a[b]); - return { $$typeof: k, type: c, key: e, ref: h, props: d, _owner: n.current } - } - const Fragment = l; - const jsx = q; - const jsxs = q; - - const LayoutGroupContext = React$1.createContext({}); - - /** - * Creates a constant value over the lifecycle of a component. - * - * Even if `useMemo` is provided an empty array as its final argument, it doesn't offer - * a guarantee that it won't re-run for performance reasons later on. By using `useConstant` - * you can ensure that initialisers don't execute twice or more. - */ - function useConstant(init) { - const ref = React$1.useRef(null); - if (ref.current === null) { - ref.current = init(); - } - return ref.current; - } - - const isBrowser$1 = typeof window !== "undefined"; - - const useIsomorphicLayoutEffect = isBrowser$1 ? React$1.useLayoutEffect : React$1.useEffect; - - /** - * @public - */ - const PresenceContext = - /* @__PURE__ */ React$1.createContext(null); - - function addUniqueItem(arr, item) { - if (arr.indexOf(item) === -1) - arr.push(item); - } - function removeItem(arr, item) { - const index = arr.indexOf(item); - if (index > -1) - arr.splice(index, 1); - } - // Adapted from array-move - function moveItem([...arr], fromIndex, toIndex) { - const startIndex = fromIndex < 0 ? arr.length + fromIndex : fromIndex; - if (startIndex >= 0 && startIndex < arr.length) { - const endIndex = toIndex < 0 ? arr.length + toIndex : toIndex; - const [item] = arr.splice(fromIndex, 1); - arr.splice(endIndex, 0, item); - } - return arr; - } - - const clamp = (min, max, v) => { - if (v > max) - return max; - if (v < min) - return min; - return v; - }; - - function formatErrorMessage(message, errorCode) { - return errorCode - ? `${message}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${errorCode}` - : message; - } - - exports.warning = () => { }; - exports.invariant = () => { }; - if (typeof process !== "undefined" && - process.env?.NODE_ENV !== "production") { - exports.warning = (check, message, errorCode) => { - if (!check && typeof console !== "undefined") { - console.warn(formatErrorMessage(message, errorCode)); - } - }; - exports.invariant = (check, message, errorCode) => { - if (!check) { - throw new Error(formatErrorMessage(message, errorCode)); - } - }; - } - - const MotionGlobalConfig = {}; - - /** - * Check if value is a numerical string, ie a string that is purely a number eg "100" or "-100.1" - */ - const isNumericalString = (v) => /^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(v); - - const isObject = (value) => typeof value === "object" && value !== null; - - /** - * Check if the value is a zero value string like "0px" or "0%" - */ - const isZeroValueString = (v) => /^0[^.\s]+$/u.test(v); - - /*#__NO_SIDE_EFFECTS__*/ - function memo(callback) { - let result; - return () => { - if (result === undefined) - result = callback(); - return result; - }; - } - - /*#__NO_SIDE_EFFECTS__*/ - const noop = (any) => any; - - /** - * Pipe - * Compose other transformers to run linearily - * pipe(min(20), max(40)) - * @param {...functions} transformers - * @return {function} - */ - const pipe = (...transformers) => transformers.reduce((a, b) => (v) => b(a(v))); - - /* - Progress within given range - - Given a lower limit and an upper limit, we return the progress - (expressed as a number 0-1) represented by the given value, and - limit that progress to within 0-1. - */ - /*#__NO_SIDE_EFFECTS__*/ - const progress = (from, to, value) => { - const range = to - from; - return range ? (value - from) / range : 1; - }; - - class SubscriptionManager { - constructor() { - this.subscriptions = []; - } - add(handler) { - addUniqueItem(this.subscriptions, handler); - return () => removeItem(this.subscriptions, handler); - } - notify(a, b, c) { - const numSubscriptions = this.subscriptions.length; - if (!numSubscriptions) - return; - if (numSubscriptions === 1) { - /** - * If there's only a single handler we can just call it without invoking a loop. - */ - this.subscriptions[0](a, b, c); - } - else { - for (let i = 0; i < numSubscriptions; i++) { - /** - * Check whether the handler exists before firing as it's possible - * the subscriptions were modified during this loop running. - */ - const handler = this.subscriptions[i]; - handler && handler(a, b, c); - } - } - } - getSize() { - return this.subscriptions.length; - } - clear() { - this.subscriptions.length = 0; - } - } - - /** - * Converts seconds to milliseconds - * - * @param seconds - Time in seconds. - * @return milliseconds - Converted time in milliseconds. - */ - /*#__NO_SIDE_EFFECTS__*/ - const secondsToMilliseconds = (seconds) => seconds * 1000; - /*#__NO_SIDE_EFFECTS__*/ - const millisecondsToSeconds = (milliseconds) => milliseconds / 1000; - - /* - Convert velocity into velocity per second - */ - /*#__NO_SIDE_EFFECTS__*/ - const velocityPerSecond = (velocity, frameDuration) => frameDuration ? velocity * (1000 / frameDuration) : 0; - - const warned = new Set(); - function hasWarned$1(message) { - return warned.has(message); - } - function warnOnce(condition, message, errorCode) { - if (condition || warned.has(message)) - return; - console.warn(formatErrorMessage(message, errorCode)); - warned.add(message); - } - - const wrap = (min, max, v) => { - const rangeSize = max - min; - return ((((v - min) % rangeSize) + rangeSize) % rangeSize) + min; - }; - - /* - Bezier function generator - This has been modified from Gaëtan Renaudeau's BezierEasing - https://github.com/gre/bezier-easing/blob/master/src/index.js - https://github.com/gre/bezier-easing/blob/master/LICENSE - - I've removed the newtonRaphsonIterate algo because in benchmarking it - wasn't noticeably faster than binarySubdivision, indeed removing it - usually improved times, depending on the curve. - I also removed the lookup table, as for the added bundle size and loop we're - only cutting ~4 or so subdivision iterations. I bumped the max iterations up - to 12 to compensate and this still tended to be faster for no perceivable - loss in accuracy. - Usage - const easeOut = cubicBezier(.17,.67,.83,.67); - const x = easeOut(0.5); // returns 0.627... - */ - // Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2. - const calcBezier = (t, a1, a2) => (((1.0 - 3.0 * a2 + 3.0 * a1) * t + (3.0 * a2 - 6.0 * a1)) * t + 3.0 * a1) * - t; - const subdivisionPrecision = 0.0000001; - const subdivisionMaxIterations = 12; - function binarySubdivide(x, lowerBound, upperBound, mX1, mX2) { - let currentX; - let currentT; - let i = 0; - do { - currentT = lowerBound + (upperBound - lowerBound) / 2.0; - currentX = calcBezier(currentT, mX1, mX2) - x; - if (currentX > 0.0) { - upperBound = currentT; - } - else { - lowerBound = currentT; - } - } while (Math.abs(currentX) > subdivisionPrecision && - ++i < subdivisionMaxIterations); - return currentT; - } - /*#__NO_SIDE_EFFECTS__*/ - function cubicBezier(mX1, mY1, mX2, mY2) { - // If this is a linear gradient, return linear easing - if (mX1 === mY1 && mX2 === mY2) - return noop; - const getTForX = (aX) => binarySubdivide(aX, 0, 1, mX1, mX2); - // If animation is at start/end, return t without easing - return (t) => t === 0 || t === 1 ? t : calcBezier(getTForX(t), mY1, mY2); - } - - // Accepts an easing function and returns a new one that outputs mirrored values for - // the second half of the animation. Turns easeIn into easeInOut. - /*#__NO_SIDE_EFFECTS__*/ - const mirrorEasing = (easing) => (p) => p <= 0.5 ? easing(2 * p) / 2 : (2 - easing(2 * (1 - p))) / 2; - - // Accepts an easing function and returns a new one that outputs reversed values. - // Turns easeIn into easeOut. - /*#__NO_SIDE_EFFECTS__*/ - const reverseEasing = (easing) => (p) => 1 - easing(1 - p); - - const backOut = /*@__PURE__*/ cubicBezier(0.33, 1.53, 0.69, 0.99); - const backIn = /*@__PURE__*/ reverseEasing(backOut); - const backInOut = /*@__PURE__*/ mirrorEasing(backIn); - - const anticipate = (p) => p >= 1 - ? 1 - : (p *= 2) < 1 - ? 0.5 * backIn(p) - : 0.5 * (2 - Math.pow(2, -10 * (p - 1))); - - const circIn = (p) => 1 - Math.sin(Math.acos(p)); - const circOut = reverseEasing(circIn); - const circInOut = mirrorEasing(circIn); - - const easeIn = /*@__PURE__*/ cubicBezier(0.42, 0, 1, 1); - const easeOut = /*@__PURE__*/ cubicBezier(0, 0, 0.58, 1); - const easeInOut = /*@__PURE__*/ cubicBezier(0.42, 0, 0.58, 1); - - /*#__NO_SIDE_EFFECTS__*/ - function steps(numSteps, direction = "end") { - return (progress) => { - progress = - direction === "end" - ? Math.min(progress, 0.999) - : Math.max(progress, 0.001); - const expanded = progress * numSteps; - const rounded = direction === "end" ? Math.floor(expanded) : Math.ceil(expanded); - return clamp(0, 1, rounded / numSteps); - }; - } - - /*#__NO_SIDE_EFFECTS__*/ - const isEasingArray = (ease) => { - return Array.isArray(ease) && typeof ease[0] !== "number"; - }; - - /*#__NO_SIDE_EFFECTS__*/ - function getEasingForSegment(easing, i) { - return isEasingArray(easing) ? easing[wrap(0, easing.length, i)] : easing; - } - - /*#__NO_SIDE_EFFECTS__*/ - const isBezierDefinition = (easing) => Array.isArray(easing) && typeof easing[0] === "number"; - - const easingLookup = { - linear: noop, - easeIn, - easeInOut, - easeOut, - circIn, - circInOut, - circOut, - backIn, - backInOut, - backOut, - anticipate, - }; - const isValidEasing = (easing) => { - return typeof easing === "string"; - }; - const easingDefinitionToFunction = (definition) => { - if (isBezierDefinition(definition)) { - // If cubic bezier definition, create bezier curve - exports.invariant(definition.length === 4, `Cubic bezier arrays must contain four numerical values.`, "cubic-bezier-length"); - const [x1, y1, x2, y2] = definition; - return cubicBezier(x1, y1, x2, y2); - } - else if (isValidEasing(definition)) { - // Else lookup from table - exports.invariant(easingLookup[definition] !== undefined, `Invalid easing type '${definition}'`, "invalid-easing-type"); - return easingLookup[definition]; - } - return definition; - }; - - const stepsOrder = [ - "setup", // Compute - "read", // Read - "resolveKeyframes", // Write/Read/Write/Read - "preUpdate", // Compute - "update", // Compute - "preRender", // Compute - "render", // Write - "postRender", // Compute - ]; - - function createRenderStep(runNextFrame) { - /** - * We create and reuse two queues, one to queue jobs for the current frame - * and one for the next. We reuse to avoid triggering GC after x frames. - */ - let thisFrame = new Set(); - let nextFrame = new Set(); - /** - * Track whether we're currently processing jobs in this step. This way - * we can decide whether to schedule new jobs for this frame or next. - */ - let isProcessing = false; - let flushNextFrame = false; - /** - * A set of processes which were marked keepAlive when scheduled. - */ - const toKeepAlive = new WeakSet(); - let latestFrameData = { - delta: 0.0, - timestamp: 0.0, - isProcessing: false, - }; - function triggerCallback(callback) { - if (toKeepAlive.has(callback)) { - step.schedule(callback); - runNextFrame(); - } - callback(latestFrameData); - } - const step = { - /** - * Schedule a process to run on the next frame. - */ - schedule: (callback, keepAlive = false, immediate = false) => { - const addToCurrentFrame = immediate && isProcessing; - const queue = addToCurrentFrame ? thisFrame : nextFrame; - if (keepAlive) - toKeepAlive.add(callback); - queue.add(callback); - return callback; - }, - /** - * Cancel the provided callback from running on the next frame. - */ - cancel: (callback) => { - nextFrame.delete(callback); - toKeepAlive.delete(callback); - }, - /** - * Execute all schedule callbacks. - */ - process: (frameData) => { - latestFrameData = frameData; - /** - * If we're already processing we've probably been triggered by a flushSync - * inside an existing process. Instead of executing, mark flushNextFrame - * as true and ensure we flush the following frame at the end of this one. - */ - if (isProcessing) { - flushNextFrame = true; - return; - } - isProcessing = true; - // Swap this frame and the next to avoid GC - const prevFrame = thisFrame; - thisFrame = nextFrame; - nextFrame = prevFrame; - // Execute this frame - thisFrame.forEach(triggerCallback); - // Clear the frame so no callbacks remain. This is to avoid - // memory leaks should this render step not run for a while. - thisFrame.clear(); - isProcessing = false; - if (flushNextFrame) { - flushNextFrame = false; - step.process(frameData); - } - }, - }; - return step; - } - - const maxElapsed$1 = 40; - function createRenderBatcher(scheduleNextBatch, allowKeepAlive) { - let runNextFrame = false; - let useDefaultElapsed = true; - const state = { - delta: 0.0, - timestamp: 0.0, - isProcessing: false, - }; - const flagRunNextFrame = () => (runNextFrame = true); - const steps = stepsOrder.reduce((acc, key) => { - acc[key] = createRenderStep(flagRunNextFrame); - return acc; - }, {}); - const { setup, read, resolveKeyframes, preUpdate, update, preRender, render, postRender, } = steps; - const processBatch = () => { - const useManualTiming = MotionGlobalConfig.useManualTiming; - const timestamp = useManualTiming - ? state.timestamp - : performance.now(); - runNextFrame = false; - if (!useManualTiming) { - state.delta = useDefaultElapsed - ? 1000 / 60 - : Math.max(Math.min(timestamp - state.timestamp, maxElapsed$1), 1); - } - state.timestamp = timestamp; - state.isProcessing = true; - // Unrolled render loop for better per-frame performance - setup.process(state); - read.process(state); - resolveKeyframes.process(state); - preUpdate.process(state); - update.process(state); - preRender.process(state); - render.process(state); - postRender.process(state); - state.isProcessing = false; - if (runNextFrame && allowKeepAlive) { - useDefaultElapsed = false; - scheduleNextBatch(processBatch); - } - }; - const wake = () => { - runNextFrame = true; - useDefaultElapsed = true; - if (!state.isProcessing) { - scheduleNextBatch(processBatch); - } - }; - const schedule = stepsOrder.reduce((acc, key) => { - const step = steps[key]; - acc[key] = (process, keepAlive = false, immediate = false) => { - if (!runNextFrame) - wake(); - return step.schedule(process, keepAlive, immediate); - }; - return acc; - }, {}); - const cancel = (process) => { - for (let i = 0; i < stepsOrder.length; i++) { - steps[stepsOrder[i]].cancel(process); - } - }; - return { schedule, cancel, state, steps }; - } - - const { schedule: frame, cancel: cancelFrame, state: frameData, steps: frameSteps, } = /* @__PURE__ */ createRenderBatcher(typeof requestAnimationFrame !== "undefined" ? requestAnimationFrame : noop, true); - - let now; - function clearTime() { - now = undefined; - } - /** - * An eventloop-synchronous alternative to performance.now(). - * - * Ensures that time measurements remain consistent within a synchronous context. - * Usually calling performance.now() twice within the same synchronous context - * will return different values which isn't useful for animations when we're usually - * trying to sync animations to the same frame. - */ - const time = { - now: () => { - if (now === undefined) { - time.set(frameData.isProcessing || MotionGlobalConfig.useManualTiming - ? frameData.timestamp - : performance.now()); - } - return now; - }, - set: (newTime) => { - now = newTime; - queueMicrotask(clearTime); - }, - }; - - const checkStringStartsWith = (token) => (key) => typeof key === "string" && key.startsWith(token); - const isCSSVariableName = - /*@__PURE__*/ checkStringStartsWith("--"); - const startsAsVariableToken = - /*@__PURE__*/ checkStringStartsWith("var(--"); - const isCSSVariableToken = (value) => { - const startsWithToken = startsAsVariableToken(value); - if (!startsWithToken) - return false; - // Ensure any comments are stripped from the value as this can harm performance of the regex. - return singleCssVariableRegex.test(value.split("/*")[0].trim()); - }; - const singleCssVariableRegex = /var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu; - /** - * Check if a value contains a CSS variable anywhere (e.g. inside calc()). - * Unlike isCSSVariableToken which checks if the value IS a var() token, - * this checks if the value CONTAINS var() somewhere in the string. - */ - function containsCSSVariable(value) { - if (typeof value !== "string") - return false; - // Strip comments to avoid false positives - return value.split("/*")[0].includes("var(--"); - } - - const number = { - test: (v) => typeof v === "number", - parse: parseFloat, - transform: (v) => v, - }; - const alpha = { - ...number, - transform: (v) => clamp(0, 1, v), - }; - const scale = { - ...number, - default: 1, - }; - - // If this number is a decimal, make it just five decimal places - // to avoid exponents - const sanitize = (v) => Math.round(v * 100000) / 100000; - - const floatRegex = /-?(?:\d+(?:\.\d+)?|\.\d+)/gu; - - function isNullish(v) { - return v == null; - } - - const singleColorRegex = /^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu; - - /** - * Returns true if the provided string is a color, ie rgba(0,0,0,0) or #000, - * but false if a number or multiple colors - */ - const isColorString = (type, testProp) => (v) => { - return Boolean((typeof v === "string" && - singleColorRegex.test(v) && - v.startsWith(type)) || - (testProp && - !isNullish(v) && - Object.prototype.hasOwnProperty.call(v, testProp))); - }; - const splitColor = (aName, bName, cName) => (v) => { - if (typeof v !== "string") - return v; - const [a, b, c, alpha] = v.match(floatRegex); - return { - [aName]: parseFloat(a), - [bName]: parseFloat(b), - [cName]: parseFloat(c), - alpha: alpha !== undefined ? parseFloat(alpha) : 1, - }; - }; - - const clampRgbUnit = (v) => clamp(0, 255, v); - const rgbUnit = { - ...number, - transform: (v) => Math.round(clampRgbUnit(v)), - }; - const rgba = { - test: /*@__PURE__*/ isColorString("rgb", "red"), - parse: /*@__PURE__*/ splitColor("red", "green", "blue"), - transform: ({ red, green, blue, alpha: alpha$1 = 1 }) => "rgba(" + - rgbUnit.transform(red) + - ", " + - rgbUnit.transform(green) + - ", " + - rgbUnit.transform(blue) + - ", " + - sanitize(alpha.transform(alpha$1)) + - ")", - }; - - function parseHex(v) { - let r = ""; - let g = ""; - let b = ""; - let a = ""; - // If we have 6 characters, ie #FF0000 - if (v.length > 5) { - r = v.substring(1, 3); - g = v.substring(3, 5); - b = v.substring(5, 7); - a = v.substring(7, 9); - // Or we have 3 characters, ie #F00 - } - else { - r = v.substring(1, 2); - g = v.substring(2, 3); - b = v.substring(3, 4); - a = v.substring(4, 5); - r += r; - g += g; - b += b; - a += a; - } - return { - red: parseInt(r, 16), - green: parseInt(g, 16), - blue: parseInt(b, 16), - alpha: a ? parseInt(a, 16) / 255 : 1, - }; - } - const hex = { - test: /*@__PURE__*/ isColorString("#"), - parse: parseHex, - transform: rgba.transform, - }; - - /*#__NO_SIDE_EFFECTS__*/ - const createUnitType = (unit) => ({ - test: (v) => typeof v === "string" && v.endsWith(unit) && v.split(" ").length === 1, - parse: parseFloat, - transform: (v) => `${v}${unit}`, - }); - const degrees = /*@__PURE__*/ createUnitType("deg"); - const percent = /*@__PURE__*/ createUnitType("%"); - const px = /*@__PURE__*/ createUnitType("px"); - const vh = /*@__PURE__*/ createUnitType("vh"); - const vw = /*@__PURE__*/ createUnitType("vw"); - const progressPercentage = /*@__PURE__*/ (() => ({ - ...percent, - parse: (v) => percent.parse(v) / 100, - transform: (v) => percent.transform(v * 100), - }))(); - - const hsla = { - test: /*@__PURE__*/ isColorString("hsl", "hue"), - parse: /*@__PURE__*/ splitColor("hue", "saturation", "lightness"), - transform: ({ hue, saturation, lightness, alpha: alpha$1 = 1 }) => { - return ("hsla(" + - Math.round(hue) + - ", " + - percent.transform(sanitize(saturation)) + - ", " + - percent.transform(sanitize(lightness)) + - ", " + - sanitize(alpha.transform(alpha$1)) + - ")"); - }, - }; - - const color = { - test: (v) => rgba.test(v) || hex.test(v) || hsla.test(v), - parse: (v) => { - if (rgba.test(v)) { - return rgba.parse(v); - } - else if (hsla.test(v)) { - return hsla.parse(v); - } - else { - return hex.parse(v); - } - }, - transform: (v) => { - return typeof v === "string" - ? v - : v.hasOwnProperty("red") - ? rgba.transform(v) - : hsla.transform(v); - }, - getAnimatableNone: (v) => { - const parsed = color.parse(v); - parsed.alpha = 0; - return color.transform(parsed); - }, - }; - - const colorRegex = /(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu; - - function test(v) { - return (isNaN(v) && - typeof v === "string" && - (v.match(floatRegex)?.length || 0) + - (v.match(colorRegex)?.length || 0) > - 0); - } - const NUMBER_TOKEN = "number"; - const COLOR_TOKEN = "color"; - const VAR_TOKEN = "var"; - const VAR_FUNCTION_TOKEN = "var("; - const SPLIT_TOKEN = "${}"; - // this regex consists of the `singleCssVariableRegex|rgbHSLValueRegex|digitRegex` - const complexRegex = /var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu; - function analyseComplexValue(value) { - const originalValue = value.toString(); - const values = []; - const indexes = { - color: [], - number: [], - var: [], - }; - const types = []; - let i = 0; - const tokenised = originalValue.replace(complexRegex, (parsedValue) => { - if (color.test(parsedValue)) { - indexes.color.push(i); - types.push(COLOR_TOKEN); - values.push(color.parse(parsedValue)); - } - else if (parsedValue.startsWith(VAR_FUNCTION_TOKEN)) { - indexes.var.push(i); - types.push(VAR_TOKEN); - values.push(parsedValue); - } - else { - indexes.number.push(i); - types.push(NUMBER_TOKEN); - values.push(parseFloat(parsedValue)); - } - ++i; - return SPLIT_TOKEN; - }); - const split = tokenised.split(SPLIT_TOKEN); - return { values, split, indexes, types }; - } - function parseComplexValue(v) { - return analyseComplexValue(v).values; - } - function buildTransformer({ split, types }) { - const numSections = split.length; - return (v) => { - let output = ""; - for (let i = 0; i < numSections; i++) { - output += split[i]; - if (v[i] !== undefined) { - const type = types[i]; - if (type === NUMBER_TOKEN) { - output += sanitize(v[i]); - } - else if (type === COLOR_TOKEN) { - output += color.transform(v[i]); - } - else { - output += v[i]; - } - } - } - return output; - }; - } - function createTransformer(source) { - return buildTransformer(analyseComplexValue(source)); - } - const convertNumbersToZero = (v) => typeof v === "number" ? 0 : color.test(v) ? color.getAnimatableNone(v) : v; - /** - * Convert a parsed value to its zero equivalent, but preserve numbers - * that act as divisors in CSS calc() expressions. - * - * analyseComplexValue extracts numbers from CSS strings and puts the - * surrounding text into a `split` template array. For example: - * "calc(var(--gap) / 5)" → values: [var(--gap), 5] - * split: ["calc(", " / ", ")"] - * - * When building a zero-equivalent for animation, naively zeroing all - * numbers turns the divisor into 0 → "calc(var(--gap) / 0)" → NaN. - * We detect this by checking whether the text preceding a number - * (split[i]) ends with "/" — the CSS calc division operator. - */ - const convertToZero = (value, splitBefore) => { - if (typeof value === "number") { - return splitBefore?.trim().endsWith("/") ? value : 0; - } - return convertNumbersToZero(value); - }; - function getAnimatableNone$1(v) { - const info = analyseComplexValue(v); - const transformer = buildTransformer(info); - return transformer(info.values.map((value, i) => convertToZero(value, info.split[i]))); - } - const complex = { - test, - parse: parseComplexValue, - createTransformer, - getAnimatableNone: getAnimatableNone$1, - }; - - // Adapted from https://gist.github.com/mjackson/5311256 - function hueToRgb(p, q, t) { - if (t < 0) - t += 1; - if (t > 1) - t -= 1; - if (t < 1 / 6) - return p + (q - p) * 6 * t; - if (t < 1 / 2) - return q; - if (t < 2 / 3) - return p + (q - p) * (2 / 3 - t) * 6; - return p; - } - function hslaToRgba({ hue, saturation, lightness, alpha }) { - hue /= 360; - saturation /= 100; - lightness /= 100; - let red = 0; - let green = 0; - let blue = 0; - if (!saturation) { - red = green = blue = lightness; - } - else { - const q = lightness < 0.5 - ? lightness * (1 + saturation) - : lightness + saturation - lightness * saturation; - const p = 2 * lightness - q; - red = hueToRgb(p, q, hue + 1 / 3); - green = hueToRgb(p, q, hue); - blue = hueToRgb(p, q, hue - 1 / 3); - } - return { - red: Math.round(red * 255), - green: Math.round(green * 255), - blue: Math.round(blue * 255), - alpha, - }; - } - - function mixImmediate(a, b) { - return (p) => (p > 0 ? b : a); - } - - /* - Value in range from progress - - Given a lower limit and an upper limit, we return the value within - that range as expressed by progress (usually a number from 0 to 1) - - So progress = 0.5 would change - - from -------- to - - to - - from ---- to - - E.g. from = 10, to = 20, progress = 0.5 => 15 - - @param [number]: Lower limit of range - @param [number]: Upper limit of range - @param [number]: The progress between lower and upper limits expressed 0-1 - @return [number]: Value as calculated from progress within range (not limited within range) - */ - const mixNumber$1 = (from, to, progress) => { - return from + (to - from) * progress; - }; - - // Linear color space blending - // Explained https://www.youtube.com/watch?v=LKnqECcg6Gw - // Demonstrated http://codepen.io/osublake/pen/xGVVaN - const mixLinearColor = (from, to, v) => { - const fromExpo = from * from; - const expo = v * (to * to - fromExpo) + fromExpo; - return expo < 0 ? 0 : Math.sqrt(expo); - }; - const colorTypes = [hex, rgba, hsla]; - const getColorType = (v) => colorTypes.find((type) => type.test(v)); - function asRGBA(color) { - const type = getColorType(color); - exports.warning(Boolean(type), `'${color}' is not an animatable color. Use the equivalent color code instead.`, "color-not-animatable"); - if (!Boolean(type)) - return false; - let model = type.parse(color); - if (type === hsla) { - // TODO Remove this cast - needed since Motion's stricter typing - model = hslaToRgba(model); - } - return model; - } - const mixColor = (from, to) => { - const fromRGBA = asRGBA(from); - const toRGBA = asRGBA(to); - if (!fromRGBA || !toRGBA) { - return mixImmediate(from, to); - } - const blended = { ...fromRGBA }; - return (v) => { - blended.red = mixLinearColor(fromRGBA.red, toRGBA.red, v); - blended.green = mixLinearColor(fromRGBA.green, toRGBA.green, v); - blended.blue = mixLinearColor(fromRGBA.blue, toRGBA.blue, v); - blended.alpha = mixNumber$1(fromRGBA.alpha, toRGBA.alpha, v); - return rgba.transform(blended); - }; - }; - - const invisibleValues = new Set(["none", "hidden"]); - /** - * Returns a function that, when provided a progress value between 0 and 1, - * will return the "none" or "hidden" string only when the progress is that of - * the origin or target. - */ - function mixVisibility(origin, target) { - if (invisibleValues.has(origin)) { - return (p) => (p <= 0 ? origin : target); - } - else { - return (p) => (p >= 1 ? target : origin); - } - } - - function mixNumber(a, b) { - return (p) => mixNumber$1(a, b, p); - } - function getMixer(a) { - if (typeof a === "number") { - return mixNumber; - } - else if (typeof a === "string") { - return isCSSVariableToken(a) - ? mixImmediate - : color.test(a) - ? mixColor - : mixComplex; - } - else if (Array.isArray(a)) { - return mixArray; - } - else if (typeof a === "object") { - return color.test(a) ? mixColor : mixObject; - } - return mixImmediate; - } - function mixArray(a, b) { - const output = [...a]; - const numValues = output.length; - const blendValue = a.map((v, i) => getMixer(v)(v, b[i])); - return (p) => { - for (let i = 0; i < numValues; i++) { - output[i] = blendValue[i](p); - } - return output; - }; - } - function mixObject(a, b) { - const output = { ...a, ...b }; - const blendValue = {}; - for (const key in output) { - if (a[key] !== undefined && b[key] !== undefined) { - blendValue[key] = getMixer(a[key])(a[key], b[key]); - } - } - return (v) => { - for (const key in blendValue) { - output[key] = blendValue[key](v); - } - return output; - }; - } - function matchOrder(origin, target) { - const orderedOrigin = []; - const pointers = { color: 0, var: 0, number: 0 }; - for (let i = 0; i < target.values.length; i++) { - const type = target.types[i]; - const originIndex = origin.indexes[type][pointers[type]]; - const originValue = origin.values[originIndex] ?? 0; - orderedOrigin[i] = originValue; - pointers[type]++; - } - return orderedOrigin; - } - const mixComplex = (origin, target) => { - const template = complex.createTransformer(target); - const originStats = analyseComplexValue(origin); - const targetStats = analyseComplexValue(target); - const canInterpolate = originStats.indexes.var.length === targetStats.indexes.var.length && - originStats.indexes.color.length === targetStats.indexes.color.length && - originStats.indexes.number.length >= targetStats.indexes.number.length; - if (canInterpolate) { - if ((invisibleValues.has(origin) && - !targetStats.values.length) || - (invisibleValues.has(target) && - !originStats.values.length)) { - return mixVisibility(origin, target); - } - return pipe(mixArray(matchOrder(originStats, targetStats), targetStats.values), template); - } - else { - exports.warning(true, `Complex values '${origin}' and '${target}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`, "complex-values-different"); - return mixImmediate(origin, target); - } - }; - - function mix(from, to, p) { - if (typeof from === "number" && - typeof to === "number" && - typeof p === "number") { - return mixNumber$1(from, to, p); - } - const mixer = getMixer(from); - return mixer(from, to); - } - - const frameloopDriver = (update) => { - const passTimestamp = ({ timestamp }) => update(timestamp); - return { - start: (keepAlive = true) => frame.update(passTimestamp, keepAlive), - stop: () => cancelFrame(passTimestamp), - /** - * If we're processing this frame we can use the - * framelocked timestamp to keep things in sync. - */ - now: () => (frameData.isProcessing ? frameData.timestamp : time.now()), - }; - }; - - const generateLinearEasing = (easing, duration, // as milliseconds - resolution = 10 // as milliseconds - ) => { - let points = ""; - const numPoints = Math.max(Math.round(duration / resolution), 2); - for (let i = 0; i < numPoints; i++) { - points += Math.round(easing(i / (numPoints - 1)) * 10000) / 10000 + ", "; - } - return `linear(${points.substring(0, points.length - 2)})`; - }; - - /** - * Implement a practical max duration for keyframe generation - * to prevent infinite loops - */ - const maxGeneratorDuration = 20000; - function calcGeneratorDuration(generator) { - let duration = 0; - const timeStep = 50; - let state = generator.next(duration); - while (!state.done && duration < maxGeneratorDuration) { - duration += timeStep; - state = generator.next(duration); - } - return duration >= maxGeneratorDuration ? Infinity : duration; - } - - /** - * Create a progress => progress easing function from a generator. - */ - function createGeneratorEasing(options, scale = 100, createGenerator) { - const generator = createGenerator({ ...options, keyframes: [0, scale] }); - const duration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration); - return { - type: "keyframes", - ease: (progress) => { - return generator.next(duration * progress).value / scale; - }, - duration: millisecondsToSeconds(duration), - }; - } - - const springDefaults = { - // Default spring physics - stiffness: 100, - damping: 10, - mass: 1.0, - velocity: 0.0, - // Default duration/bounce-based options - duration: 800, // in ms - bounce: 0.3, - visualDuration: 0.3, // in seconds - // Rest thresholds - restSpeed: { - granular: 0.01, - default: 2, - }, - restDelta: { - granular: 0.005, - default: 0.5, - }, - // Limits - minDuration: 0.01, // in seconds - maxDuration: 10.0, // in seconds - minDamping: 0.05, - maxDamping: 1, - }; - function calcAngularFreq(undampedFreq, dampingRatio) { - return undampedFreq * Math.sqrt(1 - dampingRatio * dampingRatio); - } - const rootIterations = 12; - function approximateRoot(envelope, derivative, initialGuess) { - let result = initialGuess; - for (let i = 1; i < rootIterations; i++) { - result = result - envelope(result) / derivative(result); - } - return result; - } - /** - * This is ported from the Framer implementation of duration-based spring resolution. - */ - const safeMin = 0.001; - function findSpring({ duration = springDefaults.duration, bounce = springDefaults.bounce, velocity = springDefaults.velocity, mass = springDefaults.mass, }) { - let envelope; - let derivative; - exports.warning(duration <= secondsToMilliseconds(springDefaults.maxDuration), "Spring duration must be 10 seconds or less", "spring-duration-limit"); - let dampingRatio = 1 - bounce; - /** - * Restrict dampingRatio and duration to within acceptable ranges. - */ - dampingRatio = clamp(springDefaults.minDamping, springDefaults.maxDamping, dampingRatio); - duration = clamp(springDefaults.minDuration, springDefaults.maxDuration, millisecondsToSeconds(duration)); - if (dampingRatio < 1) { - /** - * Underdamped spring - */ - envelope = (undampedFreq) => { - const exponentialDecay = undampedFreq * dampingRatio; - const delta = exponentialDecay * duration; - const a = exponentialDecay - velocity; - const b = calcAngularFreq(undampedFreq, dampingRatio); - const c = Math.exp(-delta); - return safeMin - (a / b) * c; - }; - derivative = (undampedFreq) => { - const exponentialDecay = undampedFreq * dampingRatio; - const delta = exponentialDecay * duration; - const d = delta * velocity + velocity; - const e = Math.pow(dampingRatio, 2) * Math.pow(undampedFreq, 2) * duration; - const f = Math.exp(-delta); - const g = calcAngularFreq(Math.pow(undampedFreq, 2), dampingRatio); - const factor = -envelope(undampedFreq) + safeMin > 0 ? -1 : 1; - return (factor * ((d - e) * f)) / g; - }; - } - else { - /** - * Critically-damped spring - */ - envelope = (undampedFreq) => { - const a = Math.exp(-undampedFreq * duration); - const b = (undampedFreq - velocity) * duration + 1; - return -safeMin + a * b; - }; - derivative = (undampedFreq) => { - const a = Math.exp(-undampedFreq * duration); - const b = (velocity - undampedFreq) * (duration * duration); - return a * b; - }; - } - const initialGuess = 5 / duration; - const undampedFreq = approximateRoot(envelope, derivative, initialGuess); - duration = secondsToMilliseconds(duration); - if (isNaN(undampedFreq)) { - return { - stiffness: springDefaults.stiffness, - damping: springDefaults.damping, - duration, - }; - } - else { - const stiffness = Math.pow(undampedFreq, 2) * mass; - return { - stiffness, - damping: dampingRatio * 2 * Math.sqrt(mass * stiffness), - duration, - }; - } - } - const durationKeys = ["duration", "bounce"]; - const physicsKeys = ["stiffness", "damping", "mass"]; - function isSpringType(options, keys) { - return keys.some((key) => options[key] !== undefined); - } - function getSpringOptions(options) { - let springOptions = { - velocity: springDefaults.velocity, - stiffness: springDefaults.stiffness, - damping: springDefaults.damping, - mass: springDefaults.mass, - isResolvedFromDuration: false, - ...options, - }; - // stiffness/damping/mass overrides duration/bounce - if (!isSpringType(options, physicsKeys) && - isSpringType(options, durationKeys)) { - // Time-defined springs should ignore inherited velocity. - // Velocity from interrupted animations can cause findSpring() - // to compute wildly different spring parameters, leading to - // massive oscillation on small-range animations. - springOptions.velocity = 0; - if (options.visualDuration) { - const visualDuration = options.visualDuration; - const root = (2 * Math.PI) / (visualDuration * 1.2); - const stiffness = root * root; - const damping = 2 * - clamp(0.05, 1, 1 - (options.bounce || 0)) * - Math.sqrt(stiffness); - springOptions = { - ...springOptions, - mass: springDefaults.mass, - stiffness, - damping, - }; - } - else { - const derived = findSpring({ ...options, velocity: 0 }); - springOptions = { - ...springOptions, - ...derived, - mass: springDefaults.mass, - }; - springOptions.isResolvedFromDuration = true; - } - } - return springOptions; - } - function spring(optionsOrVisualDuration = springDefaults.visualDuration, bounce = springDefaults.bounce) { - const options = typeof optionsOrVisualDuration !== "object" - ? { - visualDuration: optionsOrVisualDuration, - keyframes: [0, 1], - bounce, - } - : optionsOrVisualDuration; - let { restSpeed, restDelta } = options; - const origin = options.keyframes[0]; - const target = options.keyframes[options.keyframes.length - 1]; - /** - * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator - * to reduce GC during animation. - */ - const state = { done: false, value: origin }; - const { stiffness, damping, mass, duration, velocity, isResolvedFromDuration, } = getSpringOptions({ - ...options, - velocity: -millisecondsToSeconds(options.velocity || 0), - }); - const initialVelocity = velocity || 0.0; - const dampingRatio = damping / (2 * Math.sqrt(stiffness * mass)); - const initialDelta = target - origin; - const undampedAngularFreq = millisecondsToSeconds(Math.sqrt(stiffness / mass)); - /** - * If we're working on a granular scale, use smaller defaults for determining - * when the spring is finished. - * - * These defaults have been selected emprically based on what strikes a good - * ratio between feeling good and finishing as soon as changes are imperceptible. - */ - const isGranularScale = Math.abs(initialDelta) < 5; - restSpeed || (restSpeed = isGranularScale - ? springDefaults.restSpeed.granular - : springDefaults.restSpeed.default); - restDelta || (restDelta = isGranularScale - ? springDefaults.restDelta.granular - : springDefaults.restDelta.default); - let resolveSpring; - let resolveVelocity; - // Underdamped coefficients, hoisted for use in the inlined next() hot path - let angularFreq; - let A; - let sinCoeff; - let cosCoeff; - if (dampingRatio < 1) { - angularFreq = calcAngularFreq(undampedAngularFreq, dampingRatio); - A = - (initialVelocity + - dampingRatio * undampedAngularFreq * initialDelta) / - angularFreq; - // Underdamped spring - resolveSpring = (t) => { - const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); - return (target - - envelope * - (A * Math.sin(angularFreq * t) + - initialDelta * Math.cos(angularFreq * t))); - }; - // Analytical derivative of underdamped spring (px/ms) - sinCoeff = - dampingRatio * undampedAngularFreq * A + initialDelta * angularFreq; - cosCoeff = - dampingRatio * undampedAngularFreq * initialDelta - A * angularFreq; - resolveVelocity = (t) => { - const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); - return envelope * - (sinCoeff * Math.sin(angularFreq * t) + - cosCoeff * Math.cos(angularFreq * t)); - }; - } - else if (dampingRatio === 1) { - // Critically damped spring - resolveSpring = (t) => target - - Math.exp(-undampedAngularFreq * t) * - (initialDelta + - (initialVelocity + undampedAngularFreq * initialDelta) * t); - // Analytical derivative of critically damped spring (px/ms) - const C = initialVelocity + undampedAngularFreq * initialDelta; - resolveVelocity = (t) => Math.exp(-undampedAngularFreq * t) * - (undampedAngularFreq * C * t - initialVelocity); - } - else { - // Overdamped spring - const dampedAngularFreq = undampedAngularFreq * Math.sqrt(dampingRatio * dampingRatio - 1); - resolveSpring = (t) => { - const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); - // When performing sinh or cosh values can hit Infinity so we cap them here - const freqForT = Math.min(dampedAngularFreq * t, 300); - return (target - - (envelope * - ((initialVelocity + - dampingRatio * undampedAngularFreq * initialDelta) * - Math.sinh(freqForT) + - dampedAngularFreq * - initialDelta * - Math.cosh(freqForT))) / - dampedAngularFreq); - }; - // Analytical derivative of overdamped spring (px/ms) - const P = (initialVelocity + - dampingRatio * undampedAngularFreq * initialDelta) / - dampedAngularFreq; - const sinhCoeff = dampingRatio * undampedAngularFreq * P - initialDelta * dampedAngularFreq; - const coshCoeff = dampingRatio * undampedAngularFreq * initialDelta - P * dampedAngularFreq; - resolveVelocity = (t) => { - const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); - const freqForT = Math.min(dampedAngularFreq * t, 300); - return envelope * - (sinhCoeff * Math.sinh(freqForT) + - coshCoeff * Math.cosh(freqForT)); - }; - } - const generator = { - calculatedDuration: isResolvedFromDuration ? duration || null : null, - velocity: (t) => secondsToMilliseconds(resolveVelocity(t)), - next: (t) => { - /** - * For underdamped physics springs we need both position and - * velocity each tick. Compute shared trig values once to avoid - * duplicate Math.exp/sin/cos calls on the hot path. - */ - if (!isResolvedFromDuration && dampingRatio < 1) { - const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); - const sin = Math.sin(angularFreq * t); - const cos = Math.cos(angularFreq * t); - const current = target - - envelope * - (A * sin + initialDelta * cos); - const currentVelocity = secondsToMilliseconds(envelope * - (sinCoeff * sin + cosCoeff * cos)); - state.done = - Math.abs(currentVelocity) <= restSpeed && - Math.abs(target - current) <= restDelta; - state.value = state.done ? target : current; - return state; - } - const current = resolveSpring(t); - if (!isResolvedFromDuration) { - const currentVelocity = secondsToMilliseconds(resolveVelocity(t)); - state.done = - Math.abs(currentVelocity) <= restSpeed && - Math.abs(target - current) <= restDelta; - } - else { - state.done = t >= duration; - } - state.value = state.done ? target : current; - return state; - }, - toString: () => { - const calculatedDuration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration); - const easing = generateLinearEasing((progress) => generator.next(calculatedDuration * progress).value, calculatedDuration, 30); - return calculatedDuration + "ms " + easing; - }, - toTransition: () => { }, - }; - return generator; - } - spring.applyToOptions = (options) => { - const generatorOptions = createGeneratorEasing(options, 100, spring); - options.ease = generatorOptions.ease; - options.duration = secondsToMilliseconds(generatorOptions.duration); - options.type = "keyframes"; - return options; - }; - - const velocitySampleDuration = 5; // ms - function getGeneratorVelocity(resolveValue, t, current) { - const prevT = Math.max(t - velocitySampleDuration, 0); - return velocityPerSecond(current - resolveValue(prevT), t - prevT); - } - - function inertia({ keyframes, velocity = 0.0, power = 0.8, timeConstant = 325, bounceDamping = 10, bounceStiffness = 500, modifyTarget, min, max, restDelta = 0.5, restSpeed, }) { - const origin = keyframes[0]; - const state = { - done: false, - value: origin, - }; - const isOutOfBounds = (v) => (min !== undefined && v < min) || (max !== undefined && v > max); - const nearestBoundary = (v) => { - if (min === undefined) - return max; - if (max === undefined) - return min; - return Math.abs(min - v) < Math.abs(max - v) ? min : max; - }; - let amplitude = power * velocity; - const ideal = origin + amplitude; - const target = modifyTarget === undefined ? ideal : modifyTarget(ideal); - /** - * If the target has changed we need to re-calculate the amplitude, otherwise - * the animation will start from the wrong position. - */ - if (target !== ideal) - amplitude = target - origin; - const calcDelta = (t) => -amplitude * Math.exp(-t / timeConstant); - const calcLatest = (t) => target + calcDelta(t); - const applyFriction = (t) => { - const delta = calcDelta(t); - const latest = calcLatest(t); - state.done = Math.abs(delta) <= restDelta; - state.value = state.done ? target : latest; - }; - /** - * Ideally this would resolve for t in a stateless way, we could - * do that by always precalculating the animation but as we know - * this will be done anyway we can assume that spring will - * be discovered during that. - */ - let timeReachedBoundary; - let spring$1; - const checkCatchBoundary = (t) => { - if (!isOutOfBounds(state.value)) - return; - timeReachedBoundary = t; - spring$1 = spring({ - keyframes: [state.value, nearestBoundary(state.value)], - velocity: getGeneratorVelocity(calcLatest, t, state.value), // TODO: This should be passing * 1000 - damping: bounceDamping, - stiffness: bounceStiffness, - restDelta, - restSpeed, - }); - }; - checkCatchBoundary(0); - return { - calculatedDuration: null, - next: (t) => { - /** - * We need to resolve the friction to figure out if we need a - * spring but we don't want to do this twice per frame. So here - * we flag if we updated for this frame and later if we did - * we can skip doing it again. - */ - let hasUpdatedFrame = false; - if (!spring$1 && timeReachedBoundary === undefined) { - hasUpdatedFrame = true; - applyFriction(t); - checkCatchBoundary(t); - } - /** - * If we have a spring and the provided t is beyond the moment the friction - * animation crossed the min/max boundary, use the spring. - */ - if (timeReachedBoundary !== undefined && t >= timeReachedBoundary) { - return spring$1.next(t - timeReachedBoundary); - } - else { - !hasUpdatedFrame && applyFriction(t); - return state; - } - }, - }; - } - - function createMixers(output, ease, customMixer) { - const mixers = []; - const mixerFactory = customMixer || MotionGlobalConfig.mix || mix; - const numMixers = output.length - 1; - for (let i = 0; i < numMixers; i++) { - let mixer = mixerFactory(output[i], output[i + 1]); - if (ease) { - const easingFunction = Array.isArray(ease) ? ease[i] || noop : ease; - mixer = pipe(easingFunction, mixer); - } - mixers.push(mixer); - } - return mixers; - } - /** - * Create a function that maps from a numerical input array to a generic output array. - * - * Accepts: - * - Numbers - * - Colors (hex, hsl, hsla, rgb, rgba) - * - Complex (combinations of one or more numbers or strings) - * - * ```jsx - * const mixColor = interpolate([0, 1], ['#fff', '#000']) - * - * mixColor(0.5) // 'rgba(128, 128, 128, 1)' - * ``` - * - * TODO Revisit this approach once we've moved to data models for values, - * probably not needed to pregenerate mixer functions. - * - * @public - */ - function interpolate(input, output, { clamp: isClamp = true, ease, mixer } = {}) { - const inputLength = input.length; - exports.invariant(inputLength === output.length, "Both input and output ranges must be the same length", "range-length"); - /** - * If we're only provided a single input, we can just make a function - * that returns the output. - */ - if (inputLength === 1) - return () => output[0]; - if (inputLength === 2 && output[0] === output[1]) - return () => output[1]; - const isZeroDeltaRange = input[0] === input[1]; - // If input runs highest -> lowest, reverse both arrays - if (input[0] > input[inputLength - 1]) { - input = [...input].reverse(); - output = [...output].reverse(); - } - const mixers = createMixers(output, ease, mixer); - const numMixers = mixers.length; - const interpolator = (v) => { - if (isZeroDeltaRange && v < input[0]) - return output[0]; - let i = 0; - if (numMixers > 1) { - for (; i < input.length - 2; i++) { - if (v < input[i + 1]) - break; - } - } - const progressInRange = progress(input[i], input[i + 1], v); - return mixers[i](progressInRange); - }; - return isClamp - ? (v) => interpolator(clamp(input[0], input[inputLength - 1], v)) - : interpolator; - } - - function fillOffset(offset, remaining) { - const min = offset[offset.length - 1]; - for (let i = 1; i <= remaining; i++) { - const offsetProgress = progress(0, remaining, i); - offset.push(mixNumber$1(min, 1, offsetProgress)); - } - } - - function defaultOffset$1(arr) { - const offset = [0]; - fillOffset(offset, arr.length - 1); - return offset; - } - - function convertOffsetToTimes(offset, duration) { - return offset.map((o) => o * duration); - } - - function defaultEasing(values, easing) { - return values.map(() => easing || easeInOut).splice(0, values.length - 1); - } - function keyframes({ duration = 300, keyframes: keyframeValues, times, ease = "easeInOut", }) { - /** - * Easing functions can be externally defined as strings. Here we convert them - * into actual functions. - */ - const easingFunctions = isEasingArray(ease) - ? ease.map(easingDefinitionToFunction) - : easingDefinitionToFunction(ease); - /** - * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator - * to reduce GC during animation. - */ - const state = { - done: false, - value: keyframeValues[0], - }; - /** - * Create a times array based on the provided 0-1 offsets - */ - const absoluteTimes = convertOffsetToTimes( - // Only use the provided offsets if they're the correct length - // TODO Maybe we should warn here if there's a length mismatch - times && times.length === keyframeValues.length - ? times - : defaultOffset$1(keyframeValues), duration); - const mapTimeToKeyframe = interpolate(absoluteTimes, keyframeValues, { - ease: Array.isArray(easingFunctions) - ? easingFunctions - : defaultEasing(keyframeValues, easingFunctions), - }); - return { - calculatedDuration: duration, - next: (t) => { - state.value = mapTimeToKeyframe(t); - state.done = t >= duration; - return state; - }, - }; - } - - const isNotNull = (value) => value !== null; - function getFinalKeyframe(keyframes, { repeat, repeatType = "loop" }, finalKeyframe, speed = 1) { - const resolvedKeyframes = keyframes.filter(isNotNull); - const useFirstKeyframe = speed < 0 || (repeat && repeatType !== "loop" && repeat % 2 === 1); - const index = useFirstKeyframe ? 0 : resolvedKeyframes.length - 1; - return !index || finalKeyframe === undefined - ? resolvedKeyframes[index] - : finalKeyframe; - } - - const transitionTypeMap = { - decay: inertia, - inertia, - tween: keyframes, - keyframes: keyframes, - spring, - }; - function replaceTransitionType(transition) { - if (typeof transition.type === "string") { - transition.type = transitionTypeMap[transition.type]; - } - } - - class WithPromise { - constructor() { - this.updateFinished(); - } - get finished() { - return this._finished; - } - updateFinished() { - this._finished = new Promise((resolve) => { - this.resolve = resolve; - }); - } - notifyFinished() { - this.resolve(); - } - /** - * Allows the animation to be awaited. - * - * @deprecated Use `finished` instead. - */ - then(onResolve, onReject) { - return this.finished.then(onResolve, onReject); - } - } - - const percentToProgress = (percent) => percent / 100; - class JSAnimation extends WithPromise { - constructor(options) { - super(); - this.state = "idle"; - this.startTime = null; - this.isStopped = false; - /** - * The current time of the animation. - */ - this.currentTime = 0; - /** - * The time at which the animation was paused. - */ - this.holdTime = null; - /** - * Playback speed as a factor. 0 would be stopped, -1 reverse and 2 double speed. - */ - this.playbackSpeed = 1; - /** - * Reusable state object for the delay phase to avoid - * allocating a new object every frame. - */ - this.delayState = { - done: false, - value: undefined, - }; - /** - * This method is bound to the instance to fix a pattern where - * animation.stop is returned as a reference from a useEffect. - */ - this.stop = () => { - const { motionValue } = this.options; - if (motionValue && motionValue.updatedAt !== time.now()) { - this.tick(time.now()); - } - this.isStopped = true; - if (this.state === "idle") - return; - this.teardown(); - this.options.onStop?.(); - }; - this.options = options; - this.initAnimation(); - this.play(); - if (options.autoplay === false) - this.pause(); - } - initAnimation() { - const { options } = this; - replaceTransitionType(options); - const { type = keyframes, repeat = 0, repeatDelay = 0, repeatType, velocity = 0, } = options; - let { keyframes: keyframes$1 } = options; - const generatorFactory = type || keyframes; - if (generatorFactory !== keyframes) { - exports.invariant(keyframes$1.length <= 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${keyframes$1}`, "spring-two-frames"); - } - if (generatorFactory !== keyframes && - typeof keyframes$1[0] !== "number") { - this.mixKeyframes = pipe(percentToProgress, mix(keyframes$1[0], keyframes$1[1])); - keyframes$1 = [0, 100]; - } - const generator = generatorFactory({ ...options, keyframes: keyframes$1 }); - /** - * If we have a mirror repeat type we need to create a second generator that outputs the - * mirrored (not reversed) animation and later ping pong between the two generators. - */ - if (repeatType === "mirror") { - this.mirroredGenerator = generatorFactory({ - ...options, - keyframes: [...keyframes$1].reverse(), - velocity: -velocity, - }); - } - /** - * If duration is undefined and we have repeat options, - * we need to calculate a duration from the generator. - * - * We set it to the generator itself to cache the duration. - * Any timeline resolver will need to have already precalculated - * the duration by this step. - */ - if (generator.calculatedDuration === null) { - generator.calculatedDuration = calcGeneratorDuration(generator); - } - const { calculatedDuration } = generator; - this.calculatedDuration = calculatedDuration; - this.resolvedDuration = calculatedDuration + repeatDelay; - this.totalDuration = this.resolvedDuration * (repeat + 1) - repeatDelay; - this.generator = generator; - } - updateTime(timestamp) { - const animationTime = Math.round(timestamp - this.startTime) * this.playbackSpeed; - // Update currentTime - if (this.holdTime !== null) { - this.currentTime = this.holdTime; - } - else { - // Rounding the time because floating point arithmetic is not always accurate, e.g. 3000.367 - 1000.367 = - // 2000.0000000000002. This is a problem when we are comparing the currentTime with the duration, for - // example. - this.currentTime = animationTime; - } - } - tick(timestamp, sample = false) { - const { generator, totalDuration, mixKeyframes, mirroredGenerator, resolvedDuration, calculatedDuration, } = this; - if (this.startTime === null) - return generator.next(0); - const { delay = 0, keyframes, repeat, repeatType, repeatDelay, type, onUpdate, finalKeyframe, } = this.options; - /** - * requestAnimationFrame timestamps can come through as lower than - * the startTime as set by performance.now(). Here we prevent this, - * though in the future it could be possible to make setting startTime - * a pending operation that gets resolved here. - */ - if (this.speed > 0) { - this.startTime = Math.min(this.startTime, timestamp); - } - else if (this.speed < 0) { - this.startTime = Math.min(timestamp - totalDuration / this.speed, this.startTime); - } - if (sample) { - this.currentTime = timestamp; - } - else { - this.updateTime(timestamp); - } - // Rebase on delay - const timeWithoutDelay = this.currentTime - delay * (this.playbackSpeed >= 0 ? 1 : -1); - const isInDelayPhase = this.playbackSpeed >= 0 - ? timeWithoutDelay < 0 - : timeWithoutDelay > totalDuration; - this.currentTime = Math.max(timeWithoutDelay, 0); - // If this animation has finished, set the current time to the total duration. - if (this.state === "finished" && this.holdTime === null) { - this.currentTime = totalDuration; - } - let elapsed = this.currentTime; - let frameGenerator = generator; - if (repeat) { - /** - * Get the current progress (0-1) of the animation. If t is > - * than duration we'll get values like 2.5 (midway through the - * third iteration) - */ - const progress = Math.min(this.currentTime, totalDuration) / resolvedDuration; - /** - * Get the current iteration (0 indexed). For instance the floor of - * 2.5 is 2. - */ - let currentIteration = Math.floor(progress); - /** - * Get the current progress of the iteration by taking the remainder - * so 2.5 is 0.5 through iteration 2 - */ - let iterationProgress = progress % 1.0; - /** - * If iteration progress is 1 we count that as the end - * of the previous iteration. - */ - if (!iterationProgress && progress >= 1) { - iterationProgress = 1; - } - iterationProgress === 1 && currentIteration--; - currentIteration = Math.min(currentIteration, repeat + 1); - /** - * Reverse progress if we're not running in "normal" direction - */ - const isOddIteration = Boolean(currentIteration % 2); - if (isOddIteration) { - if (repeatType === "reverse") { - iterationProgress = 1 - iterationProgress; - if (repeatDelay) { - iterationProgress -= repeatDelay / resolvedDuration; - } - } - else if (repeatType === "mirror") { - frameGenerator = mirroredGenerator; - } - } - elapsed = clamp(0, 1, iterationProgress) * resolvedDuration; - } - /** - * If we're in negative time, set state as the initial keyframe. - * This prevents delay: x, duration: 0 animations from finishing - * instantly. - */ - let state; - if (isInDelayPhase) { - this.delayState.value = keyframes[0]; - state = this.delayState; - } - else { - state = frameGenerator.next(elapsed); - } - if (mixKeyframes && !isInDelayPhase) { - state.value = mixKeyframes(state.value); - } - let { done } = state; - if (!isInDelayPhase && calculatedDuration !== null) { - done = - this.playbackSpeed >= 0 - ? this.currentTime >= totalDuration - : this.currentTime <= 0; - } - const isAnimationFinished = this.holdTime === null && - (this.state === "finished" || (this.state === "running" && done)); - // TODO: The exception for inertia could be cleaner here - if (isAnimationFinished && type !== inertia) { - state.value = getFinalKeyframe(keyframes, this.options, finalKeyframe, this.speed); - } - if (onUpdate) { - onUpdate(state.value); - } - if (isAnimationFinished) { - this.finish(); - } - return state; - } - /** - * Allows the returned animation to be awaited or promise-chained. Currently - * resolves when the animation finishes at all but in a future update could/should - * reject if its cancels. - */ - then(resolve, reject) { - return this.finished.then(resolve, reject); - } - get duration() { - return millisecondsToSeconds(this.calculatedDuration); - } - get iterationDuration() { - const { delay = 0 } = this.options || {}; - return this.duration + millisecondsToSeconds(delay); - } - get time() { - return millisecondsToSeconds(this.currentTime); - } - set time(newTime) { - newTime = secondsToMilliseconds(newTime); - this.currentTime = newTime; - if (this.startTime === null || - this.holdTime !== null || - this.playbackSpeed === 0) { - this.holdTime = newTime; - } - else if (this.driver) { - this.startTime = this.driver.now() - newTime / this.playbackSpeed; - } - if (this.driver) { - this.driver.start(false); - } - else { - this.startTime = 0; - this.state = "paused"; - this.holdTime = newTime; - this.tick(newTime); - } - } - /** - * Returns the generator's velocity at the current time in units/second. - * Uses the analytical derivative when available (springs), avoiding - * the MotionValue's frame-dependent velocity estimation. - */ - getGeneratorVelocity() { - const t = this.currentTime; - if (t <= 0) - return this.options.velocity || 0; - if (this.generator.velocity) { - return this.generator.velocity(t); - } - // Fallback: finite difference - const current = this.generator.next(t).value; - return getGeneratorVelocity((s) => this.generator.next(s).value, t, current); - } - get speed() { - return this.playbackSpeed; - } - set speed(newSpeed) { - const hasChanged = this.playbackSpeed !== newSpeed; - if (hasChanged && this.driver) { - this.updateTime(time.now()); - } - this.playbackSpeed = newSpeed; - if (hasChanged && this.driver) { - this.time = millisecondsToSeconds(this.currentTime); - } - } - play() { - if (this.isStopped) - return; - const { driver = frameloopDriver, startTime } = this.options; - if (!this.driver) { - this.driver = driver((timestamp) => this.tick(timestamp)); - } - this.options.onPlay?.(); - const now = this.driver.now(); - if (this.state === "finished") { - this.updateFinished(); - this.startTime = now; - } - else if (this.holdTime !== null) { - this.startTime = now - this.holdTime; - } - else if (!this.startTime) { - this.startTime = startTime ?? now; - } - if (this.state === "finished" && this.speed < 0) { - this.startTime += this.calculatedDuration; - } - this.holdTime = null; - /** - * Set playState to running only after we've used it in - * the previous logic. - */ - this.state = "running"; - this.driver.start(); - } - pause() { - this.state = "paused"; - this.updateTime(time.now()); - this.holdTime = this.currentTime; - } - complete() { - if (this.state !== "running") { - this.play(); - } - this.state = "finished"; - this.holdTime = null; - } - finish() { - this.notifyFinished(); - this.teardown(); - this.state = "finished"; - this.options.onComplete?.(); - } - cancel() { - this.holdTime = null; - this.startTime = 0; - this.tick(0); - this.teardown(); - this.options.onCancel?.(); - } - teardown() { - this.state = "idle"; - this.stopDriver(); - this.startTime = this.holdTime = null; - } - stopDriver() { - if (!this.driver) - return; - this.driver.stop(); - this.driver = undefined; - } - sample(sampleTime) { - this.startTime = 0; - return this.tick(sampleTime, true); - } - attachTimeline(timeline) { - if (this.options.allowFlatten) { - this.options.type = "keyframes"; - this.options.ease = "linear"; - this.initAnimation(); - } - this.driver?.stop(); - return timeline.observe(this); - } - } - // Legacy function support - function animateValue(options) { - return new JSAnimation(options); - } - - function fillWildcards(keyframes) { - for (let i = 1; i < keyframes.length; i++) { - keyframes[i] ?? (keyframes[i] = keyframes[i - 1]); - } - } - - const radToDeg = (rad) => (rad * 180) / Math.PI; - const rotate = (v) => { - const angle = radToDeg(Math.atan2(v[1], v[0])); - return rebaseAngle(angle); - }; - const matrix2dParsers = { - x: 4, - y: 5, - translateX: 4, - translateY: 5, - scaleX: 0, - scaleY: 3, - scale: (v) => (Math.abs(v[0]) + Math.abs(v[3])) / 2, - rotate, - rotateZ: rotate, - skewX: (v) => radToDeg(Math.atan(v[1])), - skewY: (v) => radToDeg(Math.atan(v[2])), - skew: (v) => (Math.abs(v[1]) + Math.abs(v[2])) / 2, - }; - const rebaseAngle = (angle) => { - angle = angle % 360; - if (angle < 0) - angle += 360; - return angle; - }; - const rotateZ = rotate; - const scaleX = (v) => Math.sqrt(v[0] * v[0] + v[1] * v[1]); - const scaleY = (v) => Math.sqrt(v[4] * v[4] + v[5] * v[5]); - const matrix3dParsers = { - x: 12, - y: 13, - z: 14, - translateX: 12, - translateY: 13, - translateZ: 14, - scaleX, - scaleY, - scale: (v) => (scaleX(v) + scaleY(v)) / 2, - rotateX: (v) => rebaseAngle(radToDeg(Math.atan2(v[6], v[5]))), - rotateY: (v) => rebaseAngle(radToDeg(Math.atan2(-v[2], v[0]))), - rotateZ, - rotate: rotateZ, - skewX: (v) => radToDeg(Math.atan(v[4])), - skewY: (v) => radToDeg(Math.atan(v[1])), - skew: (v) => (Math.abs(v[1]) + Math.abs(v[4])) / 2, - }; - function defaultTransformValue(name) { - return name.includes("scale") ? 1 : 0; - } - function parseValueFromTransform(transform, name) { - if (!transform || transform === "none") { - return defaultTransformValue(name); - } - const matrix3dMatch = transform.match(/^matrix3d\(([-\d.e\s,]+)\)$/u); - let parsers; - let match; - if (matrix3dMatch) { - parsers = matrix3dParsers; - match = matrix3dMatch; - } - else { - const matrix2dMatch = transform.match(/^matrix\(([-\d.e\s,]+)\)$/u); - parsers = matrix2dParsers; - match = matrix2dMatch; - } - if (!match) { - return defaultTransformValue(name); - } - const valueParser = parsers[name]; - const values = match[1].split(",").map(convertTransformToNumber); - return typeof valueParser === "function" - ? valueParser(values) - : values[valueParser]; - } - const readTransformValue = (instance, name) => { - const { transform = "none" } = getComputedStyle(instance); - return parseValueFromTransform(transform, name); - }; - function convertTransformToNumber(value) { - return parseFloat(value.trim()); - } - - /** - * Generate a list of every possible transform key. - */ - const transformPropOrder = [ - "transformPerspective", - "x", - "y", - "z", - "translateX", - "translateY", - "translateZ", - "scale", - "scaleX", - "scaleY", - "rotate", - "rotateX", - "rotateY", - "rotateZ", - "skew", - "skewX", - "skewY", - ]; - /** - * A quick lookup for transform props. - * - * `pathRotation` is a transform for routing purposes (skipped from raw - * style application, wired to the transform composite, flags transform - * dirty) but is intentionally NOT in `transformPropOrder` — it is - * composed onto `rotate` at the build sites, not serialized in its own - * slot, and must stay out of the order-array consumers (parse-transform, - * unit-conversion, keys-position). - */ - const transformProps = /*@__PURE__*/ (() => new Set([...transformPropOrder, "pathRotation"]))(); - - const isNumOrPxType = (v) => v === number || v === px; - const transformKeys = new Set(["x", "y", "z"]); - const nonTranslationalTransformKeys = transformPropOrder.filter((key) => !transformKeys.has(key)); - function removeNonTranslationalTransform(visualElement) { - const removedTransforms = []; - nonTranslationalTransformKeys.forEach((key) => { - const value = visualElement.getValue(key); - if (value !== undefined) { - removedTransforms.push([key, value.get()]); - value.set(key.startsWith("scale") ? 1 : 0); - } - }); - return removedTransforms; - } - const positionalValues = { - // Dimensions - width: ({ x }, { paddingLeft = "0", paddingRight = "0", boxSizing }) => { - const width = x.max - x.min; - return boxSizing === "border-box" - ? width - : width - parseFloat(paddingLeft) - parseFloat(paddingRight); - }, - height: ({ y }, { paddingTop = "0", paddingBottom = "0", boxSizing }) => { - const height = y.max - y.min; - return boxSizing === "border-box" - ? height - : height - parseFloat(paddingTop) - parseFloat(paddingBottom); - }, - top: (_bbox, { top }) => parseFloat(top), - left: (_bbox, { left }) => parseFloat(left), - bottom: ({ y }, { top }) => parseFloat(top) + (y.max - y.min), - right: ({ x }, { left }) => parseFloat(left) + (x.max - x.min), - // Transform - x: (_bbox, { transform }) => parseValueFromTransform(transform, "x"), - y: (_bbox, { transform }) => parseValueFromTransform(transform, "y"), - }; - // Alias translate longform names - positionalValues.translateX = positionalValues.x; - positionalValues.translateY = positionalValues.y; - - const toResolve = new Set(); - let isScheduled = false; - let anyNeedsMeasurement = false; - let isForced = false; - function measureAllKeyframes() { - if (anyNeedsMeasurement) { - const resolversToMeasure = Array.from(toResolve).filter((resolver) => resolver.needsMeasurement); - const elementsToMeasure = new Set(resolversToMeasure.map((resolver) => resolver.element)); - const transformsToRestore = new Map(); - /** - * Write pass - * If we're measuring elements we want to remove bounding box-changing transforms. - */ - elementsToMeasure.forEach((element) => { - const removedTransforms = removeNonTranslationalTransform(element); - if (!removedTransforms.length) - return; - transformsToRestore.set(element, removedTransforms); - element.render(); - }); - // Read - resolversToMeasure.forEach((resolver) => resolver.measureInitialState()); - // Write - elementsToMeasure.forEach((element) => { - element.render(); - const restore = transformsToRestore.get(element); - if (restore) { - restore.forEach(([key, value]) => { - element.getValue(key)?.set(value); - }); - } - }); - // Read - resolversToMeasure.forEach((resolver) => resolver.measureEndState()); - // Write - resolversToMeasure.forEach((resolver) => { - if (resolver.suspendedScrollY !== undefined) { - window.scrollTo(0, resolver.suspendedScrollY); - } - }); - } - anyNeedsMeasurement = false; - isScheduled = false; - toResolve.forEach((resolver) => resolver.complete(isForced)); - toResolve.clear(); - } - function readAllKeyframes() { - toResolve.forEach((resolver) => { - resolver.readKeyframes(); - if (resolver.needsMeasurement) { - anyNeedsMeasurement = true; - } - }); - } - function flushKeyframeResolvers() { - isForced = true; - readAllKeyframes(); - measureAllKeyframes(); - isForced = false; - } - class KeyframeResolver { - constructor(unresolvedKeyframes, onComplete, name, motionValue, element, isAsync = false) { - this.state = "pending"; - /** - * Track whether this resolver is async. If it is, it'll be added to the - * resolver queue and flushed in the next frame. Resolvers that aren't going - * to trigger read/write thrashing don't need to be async. - */ - this.isAsync = false; - /** - * Track whether this resolver needs to perform a measurement - * to resolve its keyframes. - */ - this.needsMeasurement = false; - this.unresolvedKeyframes = [...unresolvedKeyframes]; - this.onComplete = onComplete; - this.name = name; - this.motionValue = motionValue; - this.element = element; - this.isAsync = isAsync; - } - scheduleResolve() { - this.state = "scheduled"; - if (this.isAsync) { - toResolve.add(this); - if (!isScheduled) { - isScheduled = true; - frame.read(readAllKeyframes); - frame.resolveKeyframes(measureAllKeyframes); - } - } - else { - this.readKeyframes(); - this.complete(); - } - } - readKeyframes() { - const { unresolvedKeyframes, name, element, motionValue } = this; - // If initial keyframe is null we need to read it from the DOM - if (unresolvedKeyframes[0] === null) { - const currentValue = motionValue?.get(); - // TODO: This doesn't work if the final keyframe is a wildcard - const finalKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1]; - if (currentValue !== undefined) { - unresolvedKeyframes[0] = currentValue; - } - else if (element && name) { - const valueAsRead = element.readValue(name, finalKeyframe); - if (valueAsRead !== undefined && valueAsRead !== null) { - unresolvedKeyframes[0] = valueAsRead; - } - } - if (unresolvedKeyframes[0] === undefined) { - unresolvedKeyframes[0] = finalKeyframe; - } - if (motionValue && currentValue === undefined) { - motionValue.set(unresolvedKeyframes[0]); - } - } - fillWildcards(unresolvedKeyframes); - } - setFinalKeyframe() { } - measureInitialState() { } - renderEndStyles() { } - measureEndState() { } - complete(isForcedComplete = false) { - this.state = "complete"; - this.onComplete(this.unresolvedKeyframes, this.finalKeyframe, isForcedComplete); - toResolve.delete(this); - } - cancel() { - if (this.state === "scheduled") { - toResolve.delete(this); - this.state = "pending"; - } - } - resume() { - if (this.state === "pending") - this.scheduleResolve(); - } - } - - const isCSSVar = (name) => name.startsWith("--"); - - function setStyle(element, name, value) { - isCSSVar(name) - ? element.style.setProperty(name, value) - : (element.style[name] = value); - } - - /** - * Add the ability for test suites to manually set support flags - * to better test more environments. - */ - const supportsFlags = {}; - - function memoSupports(callback, supportsFlag) { - const memoized = memo(callback); - return () => supportsFlags[supportsFlag] ?? memoized(); - } - - const supportsScrollTimeline = /* @__PURE__ */ memoSupports(() => window.ScrollTimeline !== undefined, "scrollTimeline"); - const supportsViewTimeline = /* @__PURE__ */ memoSupports(() => window.ViewTimeline !== undefined, "viewTimeline"); - - const supportsLinearEasing = /*@__PURE__*/ memoSupports(() => { - try { - document - .createElement("div") - .animate({ opacity: 0 }, { easing: "linear(0, 1)" }); - } - catch (e) { - return false; - } - return true; - }, "linearEasing"); - - const cubicBezierAsString = ([a, b, c, d]) => `cubic-bezier(${a}, ${b}, ${c}, ${d})`; - - const supportedWaapiEasing = { - linear: "linear", - ease: "ease", - easeIn: "ease-in", - easeOut: "ease-out", - easeInOut: "ease-in-out", - circIn: /*@__PURE__*/ cubicBezierAsString([0, 0.65, 0.55, 1]), - circOut: /*@__PURE__*/ cubicBezierAsString([0.55, 0, 1, 0.45]), - backIn: /*@__PURE__*/ cubicBezierAsString([0.31, 0.01, 0.66, -0.59]), - backOut: /*@__PURE__*/ cubicBezierAsString([0.33, 1.53, 0.69, 0.99]), - }; - - function mapEasingToNativeEasing(easing, duration) { - if (!easing) { - return undefined; - } - else if (typeof easing === "function") { - return supportsLinearEasing() - ? generateLinearEasing(easing, duration) - : "ease-out"; - } - else if (isBezierDefinition(easing)) { - return cubicBezierAsString(easing); - } - else if (Array.isArray(easing)) { - return easing.map((segmentEasing) => mapEasingToNativeEasing(segmentEasing, duration) || - supportedWaapiEasing.easeOut); - } - else { - return supportedWaapiEasing[easing]; - } - } - - function startWaapiAnimation(element, valueName, keyframes, { delay = 0, duration = 300, repeat = 0, repeatType = "loop", ease = "easeOut", times, } = {}, pseudoElement = undefined) { - const keyframeOptions = { - [valueName]: keyframes, - }; - if (times) - keyframeOptions.offset = times; - const easing = mapEasingToNativeEasing(ease, duration); - /** - * If this is an easing array, apply to keyframes, not animation as a whole - */ - if (Array.isArray(easing)) - keyframeOptions.easing = easing; - const options = { - delay, - duration, - easing: !Array.isArray(easing) ? easing : "linear", - fill: "both", - iterations: repeat + 1, - direction: repeatType === "reverse" ? "alternate" : "normal", - }; - if (pseudoElement) - options.pseudoElement = pseudoElement; - return element.animate(keyframeOptions, options); - } - - function isGenerator(type) { - return typeof type === "function" && "applyToOptions" in type; - } - - function applyGeneratorOptions({ type, ...options }) { - if (isGenerator(type) && supportsLinearEasing()) { - return type.applyToOptions(options); - } - else { - options.duration ?? (options.duration = 300); - options.ease ?? (options.ease = "easeOut"); - } - return options; - } - - /** - * NativeAnimation implements AnimationPlaybackControls for the browser's Web Animations API. - */ - class NativeAnimation extends WithPromise { - constructor(options) { - super(); - this.finishedTime = null; - this.isStopped = false; - /** - * Tracks a manually-set start time that takes precedence over WAAPI's - * dynamic startTime. This is cleared when play() or time setter is called, - * allowing WAAPI to take over timing. - */ - this.manualStartTime = null; - if (!options) - return; - const { element, name, keyframes, pseudoElement, allowFlatten = false, finalKeyframe, onComplete, } = options; - this.isPseudoElement = Boolean(pseudoElement); - this.allowFlatten = allowFlatten; - this.options = options; - exports.invariant(typeof options.type !== "string", `Mini animate() doesn't support "type" as a string.`, "mini-spring"); - const transition = applyGeneratorOptions(options); - this.animation = startWaapiAnimation(element, name, keyframes, transition, pseudoElement); - if (transition.autoplay === false) { - this.animation.pause(); - } - this.animation.onfinish = () => { - this.finishedTime = this.time; - if (!pseudoElement) { - const keyframe = getFinalKeyframe(keyframes, this.options, finalKeyframe, this.speed); - if (this.updateMotionValue) { - this.updateMotionValue(keyframe); - } - /** - * If we can, we want to commit the final style as set by the user, - * rather than the computed keyframe value supplied by the animation. - * We always do this, even when a motion value is present, to prevent - * a visual flash in Firefox where the WAAPI animation's fill is removed - * during cancel() before the scheduled render can apply the correct value. - */ - setStyle(element, name, keyframe); - this.animation.cancel(); - } - onComplete?.(); - this.notifyFinished(); - }; - } - play() { - if (this.isStopped) - return; - this.manualStartTime = null; - this.animation.play(); - if (this.state === "finished") { - this.updateFinished(); - } - } - pause() { - this.animation.pause(); - } - complete() { - this.animation.finish?.(); - } - cancel() { - try { - this.animation.cancel(); - } - catch (e) { } - } - stop() { - if (this.isStopped) - return; - this.isStopped = true; - const { state } = this; - if (state === "idle" || state === "finished") { - return; - } - if (this.updateMotionValue) { - this.updateMotionValue(); - } - else { - this.commitStyles(); - } - if (!this.isPseudoElement) - this.cancel(); - } - /** - * WAAPI doesn't natively have any interruption capabilities. - * - * In this method, we commit styles back to the DOM before cancelling - * the animation. - * - * This is designed to be overridden by NativeAnimationExtended, which - * will create a renderless JS animation and sample it twice to calculate - * its current value, "previous" value, and therefore allow - * Motion to also correctly calculate velocity for any subsequent animation - * while deferring the commit until the next animation frame. - */ - commitStyles() { - const element = this.options?.element; - if (!this.isPseudoElement && element?.isConnected) { - this.animation.commitStyles?.(); - } - } - get duration() { - const duration = this.animation.effect?.getComputedTiming?.().duration || 0; - return millisecondsToSeconds(Number(duration)); - } - get iterationDuration() { - const { delay = 0 } = this.options || {}; - return this.duration + millisecondsToSeconds(delay); - } - get time() { - return millisecondsToSeconds(Number(this.animation.currentTime) || 0); - } - set time(newTime) { - const wasFinished = this.finishedTime !== null; - this.manualStartTime = null; - this.finishedTime = null; - this.animation.currentTime = secondsToMilliseconds(newTime); - if (wasFinished) { - this.animation.pause(); - } - } - /** - * The playback speed of the animation. - * 1 = normal speed, 2 = double speed, 0.5 = half speed. - */ - get speed() { - return this.animation.playbackRate; - } - set speed(newSpeed) { - // Allow backwards playback after finishing - if (newSpeed < 0) - this.finishedTime = null; - this.animation.playbackRate = newSpeed; - } - get state() { - return this.finishedTime !== null - ? "finished" - : this.animation.playState; - } - get startTime() { - return this.manualStartTime ?? Number(this.animation.startTime); - } - set startTime(newStartTime) { - this.manualStartTime = this.animation.startTime = newStartTime; - } - /** - * Attaches a timeline to the animation, for instance the `ScrollTimeline`. - */ - attachTimeline({ timeline, rangeStart, rangeEnd, observe, }) { - if (this.allowFlatten) { - this.animation.effect?.updateTiming({ easing: "linear" }); - } - this.animation.onfinish = null; - if (timeline && supportsScrollTimeline()) { - this.animation.timeline = timeline; - if (rangeStart) - this.animation.rangeStart = rangeStart; - if (rangeEnd) - this.animation.rangeEnd = rangeEnd; - return noop; - } - else { - return observe(this); - } - } - } - - const unsupportedEasingFunctions = { - anticipate, - backInOut, - circInOut, - }; - function isUnsupportedEase(key) { - return key in unsupportedEasingFunctions; - } - function replaceStringEasing(transition) { - if (typeof transition.ease === "string" && - isUnsupportedEase(transition.ease)) { - transition.ease = unsupportedEasingFunctions[transition.ease]; - } - } - - /** - * 10ms is chosen here as it strikes a balance between smooth - * results (more than one keyframe per frame at 60fps) and - * keyframe quantity. - */ - const sampleDelta = 10; //ms - class NativeAnimationExtended extends NativeAnimation { - constructor(options) { - /** - * The base NativeAnimation function only supports a subset - * of Motion easings, and WAAPI also only supports some - * easing functions via string/cubic-bezier definitions. - * - * This function replaces those unsupported easing functions - * with a JS easing function. This will later get compiled - * to a linear() easing function. - */ - replaceStringEasing(options); - /** - * Ensure we replace the transition type with a generator function - * before passing to WAAPI. - * - * TODO: Does this have a better home? It could be shared with - * JSAnimation. - */ - replaceTransitionType(options); - super(options); - /** - * Only set startTime when the animation should autoplay. - * Setting startTime on a paused WAAPI animation unpauses it - * (per the WAAPI spec), which breaks autoplay: false. - */ - if (options.startTime !== undefined && options.autoplay !== false) { - this.startTime = options.startTime; - } - this.options = options; - } - /** - * WAAPI doesn't natively have any interruption capabilities. - * - * Rather than read committed styles back out of the DOM, we can - * create a renderless JS animation and sample it twice to calculate - * its current value, "previous" value, and therefore allow - * Motion to calculate velocity for any subsequent animation. - */ - updateMotionValue(value) { - const { motionValue, onUpdate, onComplete, element, ...options } = this.options; - if (!motionValue) - return; - if (value !== undefined) { - motionValue.set(value); - return; - } - const sampleAnimation = new JSAnimation({ - ...options, - autoplay: false, - }); - /** - * Use wall-clock elapsed time for sampling. - * Under CPU load, WAAPI's currentTime may not reflect actual - * elapsed time, causing incorrect sampling and visual jumps. - */ - const sampleTime = Math.max(sampleDelta, time.now() - this.startTime); - const delta = clamp(0, sampleDelta, sampleTime - sampleDelta); - const current = sampleAnimation.sample(sampleTime).value; - /** - * Write the estimated value to inline style so it persists - * after cancel(), covering the async gap before the next - * animation starts. - */ - const { name } = this.options; - if (element && name) - setStyle(element, name, current); - motionValue.setWithVelocity(sampleAnimation.sample(Math.max(0, sampleTime - delta)).value, current, delta); - sampleAnimation.stop(); - } - } - - /** - * Check if a value is animatable. Examples: - * - * ✅: 100, "100px", "#fff" - * ❌: "block", "url(2.jpg)" - * @param value - * - * @internal - */ - const isAnimatable = (value, name) => { - // If the list of keys that might be non-animatable grows, replace with Set - if (name === "zIndex") - return false; - // If it's a number or a keyframes array, we can animate it. We might at some point - // need to do a deep isAnimatable check of keyframes, or let Popmotion handle this, - // but for now lets leave it like this for performance reasons - if (typeof value === "number" || Array.isArray(value)) - return true; - if (typeof value === "string" && // It's animatable if we have a string - (complex.test(value) || value === "0") && // And it contains numbers and/or colors - !value.startsWith("url(") // Unless it starts with "url(" - ) { - return true; - } - return false; - }; - - function hasKeyframesChanged(keyframes) { - const current = keyframes[0]; - if (keyframes.length === 1) - return true; - for (let i = 0; i < keyframes.length; i++) { - if (keyframes[i] !== current) - return true; - } - } - function canAnimate(keyframes, name, type, velocity) { - /** - * Check if we're able to animate between the start and end keyframes, - * and throw a warning if we're attempting to animate between one that's - * animatable and another that isn't. - */ - const originKeyframe = keyframes[0]; - if (originKeyframe === null) { - return false; - } - /** - * These aren't traditionally animatable but we do support them. - * In future we could look into making this more generic or replacing - * this function with mix() === mixImmediate - */ - if (name === "display" || name === "visibility") - return true; - const targetKeyframe = keyframes[keyframes.length - 1]; - const isOriginAnimatable = isAnimatable(originKeyframe, name); - const isTargetAnimatable = isAnimatable(targetKeyframe, name); - exports.warning(isOriginAnimatable === isTargetAnimatable, `You are trying to animate ${name} from "${originKeyframe}" to "${targetKeyframe}". "${isOriginAnimatable ? targetKeyframe : originKeyframe}" is not an animatable value.`, "value-not-animatable"); - // Always skip if any of these are true - if (!isOriginAnimatable || !isTargetAnimatable) { - return false; - } - return (hasKeyframesChanged(keyframes) || - ((type === "spring" || isGenerator(type)) && velocity)); - } - - function makeAnimationInstant(options) { - options.duration = 0; - options.type = "keyframes"; - } - - /** - * A list of values that can be hardware-accelerated. - */ - const acceleratedValues = new Set([ - "opacity", - "clipPath", - "filter", - "transform", - "backgroundColor", - ]); - - const browserColorFunctions = /^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/; - function hasBrowserOnlyColors(keyframes) { - for (let i = 0; i < keyframes.length; i++) { - if (typeof keyframes[i] === "string" && - browserColorFunctions.test(keyframes[i])) { - return true; - } - } - return false; - } - - const colorProperties = new Set([ - "color", - "backgroundColor", - "outlineColor", - "fill", - "stroke", - "borderColor", - "borderTopColor", - "borderRightColor", - "borderBottomColor", - "borderLeftColor", - ]); - const supportsWaapi = /*@__PURE__*/ memo(() => Object.hasOwnProperty.call(Element.prototype, "animate")); - function supportsBrowserAnimation(options) { - const { motionValue, name, repeatDelay, repeatType, damping, type, keyframes, } = options; - const subject = motionValue?.owner?.current; - /** - * We use instanceof checks instead of isHTMLElement()/isSVGElement() - * because we explicitly **don't** want elements in different timing - * contexts (i.e. popups) to be accelerated, as it's not possible to sync - * these animations properly with those driven from the main window - * frameloop. - */ - if (!(subject instanceof HTMLElement) && - !(subject instanceof SVGElement)) { - return false; - } - const { onUpdate, transformTemplate } = motionValue.owner.getProps(); - return (supportsWaapi() && - name && - /** - * Force WAAPI for color properties with browser-only color formats - * (oklch, oklab, lab, lch, etc.) that the JS animation path can't parse. - */ - (acceleratedValues.has(name) || - (colorProperties.has(name) && - hasBrowserOnlyColors(keyframes))) && - (name !== "transform" || !transformTemplate) && - /** - * If we're outputting values to onUpdate then we can't use WAAPI as there's - * no way to read the value from WAAPI every frame. - */ - !onUpdate && - !repeatDelay && - repeatType !== "mirror" && - damping !== 0 && - type !== "inertia"); - } - - /** - * Maximum time allowed between an animation being created and it being - * resolved for us to use the latter as the start time. - * - * This is to ensure that while we prefer to "start" an animation as soon - * as it's triggered, we also want to avoid a visual jump if there's a big delay - * between these two moments. - */ - const MAX_RESOLVE_DELAY = 40; - class AsyncMotionValueAnimation extends WithPromise { - constructor({ autoplay = true, delay = 0, type = "keyframes", repeat = 0, repeatDelay = 0, repeatType = "loop", keyframes, name, motionValue, element, ...options }) { - super(); - /** - * Bound to support return animation.stop pattern - */ - this.stop = () => { - if (this._animation) { - this._animation.stop(); - this.stopTimeline?.(); - } - this.keyframeResolver?.cancel(); - }; - this.createdAt = time.now(); - const optionsWithDefaults = { - autoplay, - delay, - type, - repeat, - repeatDelay, - repeatType, - name, - motionValue, - element, - ...options, - }; - const KeyframeResolver$1 = element?.KeyframeResolver || KeyframeResolver; - this.keyframeResolver = new KeyframeResolver$1(keyframes, (resolvedKeyframes, finalKeyframe, forced) => this.onKeyframesResolved(resolvedKeyframes, finalKeyframe, optionsWithDefaults, !forced), name, motionValue, element); - this.keyframeResolver?.scheduleResolve(); - } - onKeyframesResolved(keyframes, finalKeyframe, options, sync) { - this.keyframeResolver = undefined; - const { name, type, velocity, delay, isHandoff, onUpdate } = options; - this.resolvedAt = time.now(); - /** - * If we can't animate this value with the resolved keyframes - * then we should complete it immediately. - */ - let canAnimateValue = true; - if (!canAnimate(keyframes, name, type, velocity)) { - canAnimateValue = false; - if (MotionGlobalConfig.instantAnimations || !delay) { - onUpdate?.(getFinalKeyframe(keyframes, options, finalKeyframe)); - } - keyframes[0] = keyframes[keyframes.length - 1]; - makeAnimationInstant(options); - options.repeat = 0; - } - /** - * Resolve startTime for the animation. - * - * This method uses the createdAt and resolvedAt to calculate the - * animation startTime. *Ideally*, we would use the createdAt time as t=0 - * as the following frame would then be the first frame of the animation in - * progress, which would feel snappier. - * - * However, if there's a delay (main thread work) between the creation of - * the animation and the first committed frame, we prefer to use resolvedAt - * to avoid a sudden jump into the animation. - */ - const startTime = sync - ? !this.resolvedAt - ? this.createdAt - : this.resolvedAt - this.createdAt > MAX_RESOLVE_DELAY - ? this.resolvedAt - : this.createdAt - : undefined; - const resolvedOptions = { - startTime, - finalKeyframe, - ...options, - keyframes, - }; - /** - * Animate via WAAPI if possible. If this is a handoff animation, the optimised animation will be running via - * WAAPI. Therefore, this animation must be JS to ensure it runs "under" the - * optimised animation. - * - * Also skip WAAPI when keyframes aren't animatable, as the resolved - * values may not be valid CSS and would trigger browser warnings. - */ - const useWaapi = canAnimateValue && - !isHandoff && - supportsBrowserAnimation(resolvedOptions); - const element = resolvedOptions.motionValue?.owner?.current; - let animation; - if (useWaapi) { - try { - animation = new NativeAnimationExtended({ - ...resolvedOptions, - element, - }); - } - catch { - animation = new JSAnimation(resolvedOptions); - } - } - else { - animation = new JSAnimation(resolvedOptions); - } - animation.finished.then(() => { - this.notifyFinished(); - }).catch(noop); - if (this.pendingTimeline) { - this.stopTimeline = animation.attachTimeline(this.pendingTimeline); - this.pendingTimeline = undefined; - } - this._animation = animation; - } - get finished() { - if (!this._animation) { - return this._finished; - } - else { - return this.animation.finished; - } - } - then(onResolve, _onReject) { - return this.finished.finally(onResolve).then(() => { }); - } - get animation() { - if (!this._animation) { - this.keyframeResolver?.resume(); - flushKeyframeResolvers(); - } - return this._animation; - } - get duration() { - return this.animation.duration; - } - get iterationDuration() { - return this.animation.iterationDuration; - } - get time() { - return this.animation.time; - } - set time(newTime) { - this.animation.time = newTime; - } - get speed() { - return this.animation.speed; - } - get state() { - return this.animation.state; - } - set speed(newSpeed) { - this.animation.speed = newSpeed; - } - get startTime() { - return this.animation.startTime; - } - attachTimeline(timeline) { - if (this._animation) { - this.stopTimeline = this.animation.attachTimeline(timeline); - } - else { - this.pendingTimeline = timeline; - } - return () => this.stop(); - } - play() { - this.animation.play(); - } - pause() { - this.animation.pause(); - } - complete() { - this.animation.complete(); - } - cancel() { - if (this._animation) { - this.animation.cancel(); - } - this.keyframeResolver?.cancel(); - } - } - - class GroupAnimation { - constructor(animations) { - // Bound to accomadate common `return animation.stop` pattern - this.stop = () => this.runAll("stop"); - this.animations = animations.filter(Boolean); - } - get finished() { - return Promise.all(this.animations.map((animation) => animation.finished)); - } - /** - * TODO: Filter out cancelled or stopped animations before returning - */ - getAll(propName) { - return this.animations[0][propName]; - } - setAll(propName, newValue) { - for (let i = 0; i < this.animations.length; i++) { - this.animations[i][propName] = newValue; - } - } - attachTimeline(timeline) { - const subscriptions = this.animations.map((animation) => animation.attachTimeline(timeline)); - return () => { - subscriptions.forEach((cancel, i) => { - cancel && cancel(); - this.animations[i].stop(); - }); - }; - } - get time() { - return this.getAll("time"); - } - set time(time) { - this.setAll("time", time); - } - get speed() { - return this.getAll("speed"); - } - set speed(speed) { - this.setAll("speed", speed); - } - get state() { - return this.getAll("state"); - } - get startTime() { - return this.getAll("startTime"); - } - get duration() { - return getMax(this.animations, "duration"); - } - get iterationDuration() { - return getMax(this.animations, "iterationDuration"); - } - runAll(methodName) { - this.animations.forEach((controls) => controls[methodName]()); - } - play() { - this.runAll("play"); - } - pause() { - this.runAll("pause"); - } - cancel() { - this.runAll("cancel"); - } - complete() { - this.runAll("complete"); - } - } - function getMax(animations, propName) { - let max = 0; - for (let i = 0; i < animations.length; i++) { - const value = animations[i][propName]; - if (value !== null && value > max) { - max = value; - } - } - return max; - } - - class GroupAnimationWithThen extends GroupAnimation { - then(onResolve, _onReject) { - return this.finished.finally(onResolve).then(() => { }); - } - } - - class NativeAnimationWrapper extends NativeAnimation { - constructor(animation) { - super(); - this.animation = animation; - animation.onfinish = () => { - this.finishedTime = this.time; - this.notifyFinished(); - }; - } - } - - const animationMaps = new WeakMap(); - const animationMapKey = (name, pseudoElement = "") => `${name}:${pseudoElement}`; - function getAnimationMap(element) { - let map = animationMaps.get(element); - if (!map) { - map = new Map(); - animationMaps.set(element, map); - } - return map; - } - - function calcChildStagger(children, child, delayChildren, staggerChildren = 0, staggerDirection = 1) { - const index = Array.from(children) - .sort((a, b) => a.sortNodePosition(b)) - .indexOf(child); - const numChildren = children.size; - const maxStaggerDuration = (numChildren - 1) * staggerChildren; - const delayIsFunction = typeof delayChildren === "function"; - return delayIsFunction - ? delayChildren(index, numChildren) - : staggerDirection === 1 - ? index * staggerChildren - : maxStaggerDuration - index * staggerChildren; - } - - /** - * Maximum time between the value of two frames, beyond which we - * assume the velocity has since been 0. - */ - const MAX_VELOCITY_DELTA = 30; - const isFloat = (value) => { - return !isNaN(parseFloat(value)); - }; - const collectMotionValues = { - current: undefined, - }; - /** - * `MotionValue` is used to track the state and velocity of motion values. - * - * @public - */ - class MotionValue { - /** - * @param init - The initiating value - * @param config - Optional configuration options - * - * - `transformer`: A function to transform incoming values with. - */ - constructor(init, options = {}) { - /** - * Tracks whether this value can output a velocity. Currently this is only true - * if the value is numerical, but we might be able to widen the scope here and support - * other value types. - * - * @internal - */ - this.canTrackVelocity = null; - /** - * An object containing a SubscriptionManager for each active event. - */ - this.events = {}; - this.updateAndNotify = (v) => { - const currentTime = time.now(); - /** - * If we're updating the value during another frame or eventloop - * than the previous frame, then the we set the previous frame value - * to current. - */ - if (this.updatedAt !== currentTime) { - this.setPrevFrameValue(); - } - this.prev = this.current; - this.setCurrent(v); - // Update update subscribers - if (this.current !== this.prev) { - this.events.change?.notify(this.current); - if (this.dependents) { - for (const dependent of this.dependents) { - dependent.dirty(); - } - } - } - }; - this.hasAnimated = false; - this.setCurrent(init); - this.owner = options.owner; - } - setCurrent(current) { - this.current = current; - this.updatedAt = time.now(); - if (this.canTrackVelocity === null && current !== undefined) { - this.canTrackVelocity = isFloat(this.current); - } - } - setPrevFrameValue(prevFrameValue = this.current) { - this.prevFrameValue = prevFrameValue; - this.prevUpdatedAt = this.updatedAt; - } - /** - * Adds a function that will be notified when the `MotionValue` is updated. - * - * It returns a function that, when called, will cancel the subscription. - * - * When calling `onChange` inside a React component, it should be wrapped with the - * `useEffect` hook. As it returns an unsubscribe function, this should be returned - * from the `useEffect` function to ensure you don't add duplicate subscribers.. - * - * ```jsx - * export const MyComponent = () => { - * const x = useMotionValue(0) - * const y = useMotionValue(0) - * const opacity = useMotionValue(1) - * - * useEffect(() => { - * function updateOpacity() { - * const maxXY = Math.max(x.get(), y.get()) - * const newOpacity = transform(maxXY, [0, 100], [1, 0]) - * opacity.set(newOpacity) - * } - * - * const unsubscribeX = x.on("change", updateOpacity) - * const unsubscribeY = y.on("change", updateOpacity) - * - * return () => { - * unsubscribeX() - * unsubscribeY() - * } - * }, []) - * - * return - * } - * ``` - * - * @param subscriber - A function that receives the latest value. - * @returns A function that, when called, will cancel this subscription. - * - * @deprecated - */ - onChange(subscription) { - { - warnOnce(false, `value.onChange(callback) is deprecated. Switch to value.on("change", callback).`); - } - return this.on("change", subscription); - } - on(eventName, callback) { - if (!this.events[eventName]) { - this.events[eventName] = new SubscriptionManager(); - } - const unsubscribe = this.events[eventName].add(callback); - if (eventName === "change") { - return () => { - unsubscribe(); - /** - * If we have no more change listeners by the start - * of the next frame, stop active animations. - */ - frame.read(() => { - if (!this.events.change.getSize()) { - this.stop(); - } - }); - }; - } - return unsubscribe; - } - clearListeners() { - for (const eventManagers in this.events) { - this.events[eventManagers].clear(); - } - } - /** - * Attaches a passive effect to the `MotionValue`. - */ - attach(passiveEffect, stopPassiveEffect) { - this.passiveEffect = passiveEffect; - this.stopPassiveEffect = stopPassiveEffect; - } - /** - * Sets the state of the `MotionValue`. - * - * @remarks - * - * ```jsx - * const x = useMotionValue(0) - * x.set(10) - * ``` - * - * @param latest - Latest value to set. - * @param render - Whether to notify render subscribers. Defaults to `true` - * - * @public - */ - set(v) { - if (!this.passiveEffect) { - this.updateAndNotify(v); - } - else { - this.passiveEffect(v, this.updateAndNotify); - } - } - setWithVelocity(prev, current, delta) { - this.set(current); - this.prev = undefined; - this.prevFrameValue = prev; - this.prevUpdatedAt = this.updatedAt - delta; - } - /** - * Set the state of the `MotionValue`, stopping any active animations, - * effects, and resets velocity to `0`. - */ - jump(v, endAnimation = true) { - this.updateAndNotify(v); - this.prev = v; - this.prevUpdatedAt = this.prevFrameValue = undefined; - endAnimation && this.stop(); - if (this.stopPassiveEffect) - this.stopPassiveEffect(); - } - dirty() { - this.events.change?.notify(this.current); - } - addDependent(dependent) { - if (!this.dependents) { - this.dependents = new Set(); - } - this.dependents.add(dependent); - } - removeDependent(dependent) { - if (this.dependents) { - this.dependents.delete(dependent); - } - } - /** - * Returns the latest state of `MotionValue` - * - * @returns - The latest state of `MotionValue` - * - * @public - */ - get() { - if (collectMotionValues.current) { - collectMotionValues.current.push(this); - } - return this.current; - } - /** - * @public - */ - getPrevious() { - return this.prev; - } - /** - * Returns the latest velocity of `MotionValue` - * - * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical. - * - * @public - */ - getVelocity() { - const currentTime = time.now(); - if (!this.canTrackVelocity || - this.prevFrameValue === undefined || - currentTime - this.updatedAt > MAX_VELOCITY_DELTA) { - return 0; - } - const delta = Math.min(this.updatedAt - this.prevUpdatedAt, MAX_VELOCITY_DELTA); - // Casts because of parseFloat's poor typing - return velocityPerSecond(parseFloat(this.current) - - parseFloat(this.prevFrameValue), delta); - } - /** - * Registers a new animation to control this `MotionValue`. Only one - * animation can drive a `MotionValue` at one time. - * - * ```jsx - * value.start() - * ``` - * - * @param animation - A function that starts the provided animation - */ - start(startAnimation) { - this.stop(); - return new Promise((resolve) => { - this.hasAnimated = true; - this.animation = startAnimation(resolve); - if (this.events.animationStart) { - this.events.animationStart.notify(); - } - }).then(() => { - if (this.events.animationComplete) { - this.events.animationComplete.notify(); - } - this.clearAnimation(); - }); - } - /** - * Stop the currently active animation. - * - * @public - */ - stop() { - if (this.animation) { - this.animation.stop(); - if (this.events.animationCancel) { - this.events.animationCancel.notify(); - } - } - this.clearAnimation(); - } - /** - * Returns `true` if this value is currently animating. - * - * @public - */ - isAnimating() { - return !!this.animation; - } - clearAnimation() { - delete this.animation; - } - /** - * Destroy and clean up subscribers to this `MotionValue`. - * - * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically - * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually - * created a `MotionValue` via the `motionValue` function. - * - * @public - */ - destroy() { - this.dependents?.clear(); - this.events.destroy?.notify(); - this.clearListeners(); - this.stop(); - if (this.stopPassiveEffect) { - this.stopPassiveEffect(); - } - } - } - function motionValue(init, options) { - return new MotionValue(init, options); - } - - /** - * If `transition` has `inherit: true`, shallow-merge it with - * `parentTransition` (child keys win) and strip the `inherit` key. - * Otherwise return `transition` unchanged. - */ - function resolveTransition(transition, parentTransition) { - if (transition?.inherit && parentTransition) { - const { inherit: _, ...rest } = transition; - return { ...parentTransition, ...rest }; - } - return transition; - } - - function getValueTransition$1(transition, key) { - const valueTransition = transition?.[key] ?? - transition?.["default"] ?? - transition; - if (valueTransition !== transition) { - return resolveTransition(valueTransition, transition); - } - return valueTransition; - } - - const underDampedSpring = { - type: "spring", - stiffness: 500, - damping: 25, - restSpeed: 10, - }; - const criticallyDampedSpring = (target) => ({ - type: "spring", - stiffness: 550, - damping: target === 0 ? 2 * Math.sqrt(550) : 30, - restSpeed: 10, - }); - const keyframesTransition = { - type: "keyframes", - duration: 0.8, - }; - /** - * Default easing curve is a slightly shallower version of - * the default browser easing curve. - */ - const ease = { - type: "keyframes", - ease: [0.25, 0.1, 0.35, 1], - duration: 0.3, - }; - const getDefaultTransition = (valueKey, { keyframes }) => { - if (keyframes.length > 2) { - return keyframesTransition; - } - else if (transformProps.has(valueKey)) { - return valueKey.startsWith("scale") - ? criticallyDampedSpring(keyframes[1]) - : underDampedSpring; - } - return ease; - }; - - const orchestrationKeys = new Set([ - "when", - "delay", - "delayChildren", - "staggerChildren", - "staggerDirection", - "repeat", - "repeatType", - "repeatDelay", - "from", - "elapsed", - ]); - /** - * Decide whether a transition is defined on a given Transition. - * This filters out orchestration options and returns true - * if any options are left. - */ - function isTransitionDefined(transition) { - for (const key in transition) { - if (!orchestrationKeys.has(key)) - return true; - } - return false; - } - - const animateMotionValue = (name, value, target, transition = {}, element, isHandoff) => (onComplete) => { - const valueTransition = getValueTransition$1(transition, name) || {}; - /** - * Most transition values are currently completely overwritten by value-specific - * transitions. In the future it'd be nicer to blend these transitions. But for now - * delay actually does inherit from the root transition if not value-specific. - */ - const delay = valueTransition.delay || transition.delay || 0; - /** - * Elapsed isn't a public transition option but can be passed through from - * optimized appear effects in milliseconds. - */ - let { elapsed = 0 } = transition; - elapsed = elapsed - secondsToMilliseconds(delay); - const options = { - keyframes: Array.isArray(target) ? target : [null, target], - ease: "easeOut", - velocity: value.getVelocity(), - ...valueTransition, - delay: -elapsed, - onUpdate: (v) => { - value.set(v); - valueTransition.onUpdate && valueTransition.onUpdate(v); - }, - onComplete: () => { - onComplete(); - valueTransition.onComplete && valueTransition.onComplete(); - }, - name, - motionValue: value, - element: isHandoff ? undefined : element, - }; - /** - * If there's no transition defined for this value, we can generate - * unique transition settings for this value. - */ - if (!isTransitionDefined(valueTransition)) { - Object.assign(options, getDefaultTransition(name, options)); - } - /** - * Both WAAPI and our internal animation functions use durations - * as defined by milliseconds, while our external API defines them - * as seconds. - */ - options.duration && (options.duration = secondsToMilliseconds(options.duration)); - options.repeatDelay && (options.repeatDelay = secondsToMilliseconds(options.repeatDelay)); - /** - * Support deprecated way to set initial value. Prefer keyframe syntax. - */ - if (options.from !== undefined) { - options.keyframes[0] = options.from; - } - let shouldSkip = false; - if (options.type === false || - (options.duration === 0 && !options.repeatDelay)) { - makeAnimationInstant(options); - if (options.delay === 0) { - shouldSkip = true; - } - } - if (MotionGlobalConfig.instantAnimations || - MotionGlobalConfig.skipAnimations || - element?.shouldSkipAnimations || - valueTransition.skipAnimations) { - shouldSkip = true; - makeAnimationInstant(options); - options.delay = 0; - } - /** - * If the transition type or easing has been explicitly set by the user - * then we don't want to allow flattening the animation. - */ - options.allowFlatten = !valueTransition.type && !valueTransition.ease; - /** - * If we can or must skip creating the animation, and apply only - * the final keyframe, do so. We also check once keyframes are resolved but - * this early check prevents the need to create an animation at all. - */ - if (shouldSkip && !isHandoff && value.get() !== undefined) { - const finalKeyframe = getFinalKeyframe(options.keyframes, valueTransition); - if (finalKeyframe !== undefined) { - frame.update(() => { - options.onUpdate(finalKeyframe); - options.onComplete(); - }); - return; - } - } - return valueTransition.isSync - ? new JSAnimation(options) - : new AsyncMotionValueAnimation(options); - }; - - const MIN_LAYOUT_DISTANCE = 20; - function bezierPoint(t, origin, control, target) { - const inv = 1 - t; - return inv * inv * origin + 2 * inv * t * control + t * t * target; - } - function bezierTangentAngle(t, originX, controlX, targetX, originY, controlY, targetY) { - const dx = 2 * (1 - t) * (controlX - originX) + 2 * t * (targetX - controlX); - const dy = 2 * (1 - t) * (controlY - originY) + 2 * t * (targetY - controlY); - return Math.atan2(dy, dx) * (180 / Math.PI); - } - function computeArcControlPoint(fromX, fromY, toX, toY, strength, peak) { - const deltaX = toX - fromX; - const deltaY = toY - fromY; - const distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY); - if (distance > 0) { - const normalPerpX = -deltaY / distance; - const normalPerpY = deltaX / distance; - const desiredHeight = strength * distance; - return { - x: fromX + deltaX * peak + normalPerpX * desiredHeight, - y: fromY + deltaY * peak + normalPerpY * desiredHeight, - }; - } - return { x: fromX, y: fromY }; - } - /** - * The pure sampling factory: `(from, to) => (t) => point`. Internal — - * used by {@link arc} and the unit tests. Not part of the public surface. - */ - function createArcPath({ strength = 0.5, peak = 0.5, direction, rotate = false, } = {}) { - const rotationScale = rotate === true ? 1 : typeof rotate === "number" ? rotate : 0; - // Auto-direction only: persists across calls to flip the bulge back - // onto the same screen side when the dominant axis changes between - // calls. Reuse the factory (module scope / useMemo) to keep this alive. - let prevBulgeSign; - const createInterpolator = (from, to) => { - const dx = to.x - from.x; - const dy = to.y - from.y; - let signed; - if (direction === "cw") { - signed = -strength; - } - else if (direction === "ccw") { - signed = strength; - } - else { - const dom = Math.abs(dx) >= Math.abs(dy) ? dx : dy; - signed = dom < 0 ? -strength : strength; - } - let control = computeArcControlPoint(from.x, from.y, to.x, to.y, signed, peak); - if (direction === undefined) { - const isVertical = Math.abs(dx) < Math.abs(dy); - const midX = from.x + dx * peak; - const midY = from.y + dy * peak; - const bulgeSign = isVertical - ? Math.sign(control.x - midX) - : Math.sign(control.y - midY); - if (prevBulgeSign !== undefined && - bulgeSign !== 0 && - bulgeSign !== prevBulgeSign) { - signed = -signed; - control = computeArcControlPoint(from.x, from.y, to.x, to.y, signed, peak); - } - else if (bulgeSign !== 0) { - prevBulgeSign = bulgeSign; - } - } - const tangent0 = rotationScale - ? bezierTangentAngle(0, from.x, control.x, to.x, from.y, control.y, to.y) - : 0; - const tangent1 = rotationScale - ? bezierTangentAngle(1, from.x, control.x, to.x, from.y, control.y, to.y) - : 0; - const tangentDelta = rotationScale - ? wrap(-180, 180, tangent1 - tangent0) - : 0; - return (t) => { - const out = { - x: bezierPoint(t, from.x, control.x, to.x), - y: bezierPoint(t, from.y, control.y, to.y), - }; - if (rotationScale) { - const raw = bezierTangentAngle(t, from.x, control.x, to.x, from.y, control.y, to.y); - const baseline = tangent0 + tangentDelta * t; - out.rotate = wrap(-180, 180, raw - baseline) * rotationScale; - } - return out; - }; - }; - return createInterpolator; - } - /** - * Creates a curved path for `transition.path`: - * - * ```ts - * - * ``` - * - * Reuse the returned value (module scope / useMemo / useRef) so its - * continuity closure survives re-renders — a fresh `arc()` has no memory. - */ - function arc(options = {}) { - const sample = createArcPath(options); - const path = { - interpolateProjection(delta) { - // `from` is the current translate offset (carries any in-flight - // displacement when interrupted); `to` is the new layout origin. - // The distance floor avoids visible wobble on tiny shifts. - const tx = delta.x.translate; - const ty = delta.y.translate; - if (Math.sqrt(tx * tx + ty * ty) < MIN_LAYOUT_DISTANCE) { - return undefined; - } - return sample({ x: tx, y: ty }, { x: 0, y: 0 }); - }, - animateVisualElement(visualElement, target, transition, delay, animations) { - if (!("x" in target || "y" in target)) - return; - const xValue = visualElement.getValue("x", visualElement.latestValues["x"] ?? 0); - const yValue = visualElement.getValue("y", visualElement.latestValues["y"] ?? 0); - const xRaw = target.x; - const yRaw = target.y; - const xFrom = (Array.isArray(xRaw) && xRaw[0] != null - ? xRaw[0] - : xValue?.get()) ?? 0; - const yFrom = (Array.isArray(yRaw) && yRaw[0] != null - ? yRaw[0] - : yValue?.get()) ?? 0; - const xTo = (Array.isArray(xRaw) - ? xRaw[xRaw.length - 1] - : xRaw ?? xFrom); - const yTo = (Array.isArray(yRaw) - ? yRaw[yRaw.length - 1] - : yRaw ?? yFrom); - // Interruption needs no flag: x/y already hold the displaced - // mid-arc position, so xFrom/yFrom carry the continuity geometry. - const interpolate = sample({ x: xFrom, y: yFrom }, { x: xTo, y: yTo }); - // Drive a dedicated `pathRotation` value (composed onto `rotate` - // at the build sites) rather than `rotate` itself, so a - // concurrent rotate animation composes and nothing accumulates - // on interrupt. - const pathRotationValue = interpolate(0).rotate !== undefined - ? visualElement.getValue("pathRotation", 0) - : undefined; - const pathTransition = { - delay, - ...getValueTransition$1(transition || {}, "x"), - }; - delete pathTransition.path; - const progress = motionValue(0); - progress.start(animateMotionValue("", progress, [0, 1000], { - ...pathTransition, - isSync: true, - velocity: 0, - onUpdate: (latest) => { - const point = interpolate(latest / 1000); - xValue?.set(point.x); - yValue?.set(point.y); - if (pathRotationValue && point.rotate !== undefined) { - pathRotationValue.set(point.rotate); - } - }, - onComplete: () => { - xValue?.set(xTo); - yValue?.set(yTo); - pathRotationValue?.set(0); - }, - // Interrupt/cancel must clear our additive contribution - // so it can't linger on top of the user's `rotate`. - onStop: () => pathRotationValue?.set(0), - onCancel: () => pathRotationValue?.set(0), - })); - if (progress.animation) - animations.push(progress.animation); - delete target.x; - delete target.y; - }, - }; - return path; - } - - /** - * Parse Framer's special CSS variable format into a CSS token and a fallback. - * - * ``` - * `var(--foo, #fff)` => [`--foo`, '#fff'] - * ``` - * - * @param current - */ - const splitCSSVariableRegex = - // eslint-disable-next-line redos-detector/no-unsafe-regex -- false positive, as it can match a lot of words - /^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u; - function parseCSSVariable(current) { - const match = splitCSSVariableRegex.exec(current); - if (!match) - return [,]; - const [, token1, token2, fallback] = match; - return [`--${token1 ?? token2}`, fallback]; - } - const maxDepth = 4; - function getVariableValue(current, element, depth = 1) { - exports.invariant(depth <= maxDepth, `Max CSS variable fallback depth detected in property "${current}". This may indicate a circular fallback dependency.`, "max-css-var-depth"); - const [token, fallback] = parseCSSVariable(current); - // No CSS variable detected - if (!token) - return; - // Attempt to read this CSS variable off the element - const resolved = window.getComputedStyle(element).getPropertyValue(token); - if (resolved) { - const trimmed = resolved.trim(); - return isNumericalString(trimmed) ? parseFloat(trimmed) : trimmed; - } - return isCSSVariableToken(fallback) - ? getVariableValue(fallback, element, depth + 1) - : fallback; - } - - function getValueState(visualElement) { - const state = [{}, {}]; - visualElement?.values.forEach((value, key) => { - state[0][key] = value.get(); - state[1][key] = value.getVelocity(); - }); - return state; - } - function resolveVariantFromProps(props, definition, custom, visualElement) { - /** - * If the variant definition is a function, resolve. - */ - if (typeof definition === "function") { - const [current, velocity] = getValueState(visualElement); - definition = definition(custom !== undefined ? custom : props.custom, current, velocity); - } - /** - * If the variant definition is a variant label, or - * the function returned a variant label, resolve. - */ - if (typeof definition === "string") { - definition = props.variants && props.variants[definition]; - } - /** - * At this point we've resolved both functions and variant labels, - * but the resolved variant label might itself have been a function. - * If so, resolve. This can only have returned a valid target object. - */ - if (typeof definition === "function") { - const [current, velocity] = getValueState(visualElement); - definition = definition(custom !== undefined ? custom : props.custom, current, velocity); - } - return definition; - } - - function resolveVariant(visualElement, definition, custom) { - const props = visualElement.getProps(); - return resolveVariantFromProps(props, definition, custom !== undefined ? custom : props.custom, visualElement); - } - - const positionalKeys = new Set([ - "width", - "height", - "top", - "left", - "right", - "bottom", - ...transformPropOrder, - ]); - - const isKeyframesTarget = (v) => { - return Array.isArray(v); - }; - - /** - * Set VisualElement's MotionValue, creating a new MotionValue for it if - * it doesn't exist. - */ - function setMotionValue(visualElement, key, value) { - if (visualElement.hasValue(key)) { - visualElement.getValue(key).set(value); - } - else { - visualElement.addValue(key, motionValue(value)); - } - } - function resolveFinalValueInKeyframes(v) { - // TODO maybe throw if v.length - 1 is placeholder token? - return isKeyframesTarget(v) ? v[v.length - 1] || 0 : v; - } - function setTarget(visualElement, definition) { - const resolved = resolveVariant(visualElement, definition); - let { transitionEnd = {}, transition = {}, ...target } = resolved || {}; - target = { ...target, ...transitionEnd }; - for (const key in target) { - const value = resolveFinalValueInKeyframes(target[key]); - setMotionValue(visualElement, key, value); - } - } - - const isMotionValue = (value) => Boolean(value && value.getVelocity); - - function isWillChangeMotionValue(value) { - return Boolean(isMotionValue(value) && value.add); - } - - function addValueToWillChange(visualElement, key) { - const willChange = visualElement.getValue("willChange"); - /** - * It could be that a user has set willChange to a regular MotionValue, - * in which case we can't add the value to it. - */ - if (isWillChangeMotionValue(willChange)) { - return willChange.add(key); - } - else if (!willChange && MotionGlobalConfig.WillChange) { - const newWillChange = new MotionGlobalConfig.WillChange("auto"); - visualElement.addValue("willChange", newWillChange); - newWillChange.add(key); - } - } - - function camelToDash(str) { - return str.replace(/([A-Z])/g, (match) => `-${match.toLowerCase()}`); - } - - const optimizedAppearDataId = "framerAppearId"; - const optimizedAppearDataAttribute = "data-" + camelToDash(optimizedAppearDataId); - - function getOptimisedAppearId(visualElement) { - return visualElement.props[optimizedAppearDataAttribute]; - } - - /** - * Decide whether we should block this animation. Previously, we achieved this - * just by checking whether the key was listed in protectedKeys, but this - * posed problems if an animation was triggered by afterChildren and protectedKeys - * had been set to true in the meantime. - */ - function shouldBlockAnimation({ protectedKeys, needsAnimating }, key) { - const shouldBlock = protectedKeys.hasOwnProperty(key) && needsAnimating[key] !== true; - needsAnimating[key] = false; - return shouldBlock; - } - function animateTarget(visualElement, targetAndTransition, { delay = 0, transitionOverride, type } = {}) { - let { transition, transitionEnd, ...target } = targetAndTransition; - const defaultTransition = visualElement.getDefaultTransition(); - transition = transition - ? resolveTransition(transition, defaultTransition) - : defaultTransition; - const reduceMotion = transition?.reduceMotion; - const skipAnimations = transition?.skipAnimations; - if (transitionOverride) - transition = transitionOverride; - const animations = []; - const animationTypeState = type && - visualElement.animationState && - visualElement.animationState.getState()[type]; - const path = transition?.path; - if (path) { - // path mutates `target` to claim x/y; loop below skips them. - path.animateVisualElement(visualElement, target, transition, delay, animations); - } - for (const key in target) { - const value = visualElement.getValue(key, visualElement.latestValues[key] ?? null); - const valueTarget = target[key]; - if (valueTarget === undefined || - (animationTypeState && - shouldBlockAnimation(animationTypeState, key))) { - continue; - } - const valueTransition = { - delay, - ...getValueTransition$1(transition || {}, key), - }; - if (skipAnimations) - valueTransition.skipAnimations = true; - /** - * If the value is already at the defined target, skip the animation. - * We still re-assert the value via frame.update to take precedence - * over any stale transitionEnd callbacks from previous animations. - */ - const currentValue = value.get(); - if (currentValue !== undefined && - !value.isAnimating() && - !Array.isArray(valueTarget) && - valueTarget === currentValue && - !valueTransition.velocity) { - frame.update(() => value.set(valueTarget)); - continue; - } - /** - * If this is the first time a value is being animated, check - * to see if we're handling off from an existing animation. - */ - let isHandoff = false; - if (window.MotionHandoffAnimation) { - const appearId = getOptimisedAppearId(visualElement); - if (appearId) { - const startTime = window.MotionHandoffAnimation(appearId, key, frame); - if (startTime !== null) { - valueTransition.startTime = startTime; - isHandoff = true; - } - } - } - addValueToWillChange(visualElement, key); - const shouldReduceMotion = reduceMotion ?? visualElement.shouldReduceMotion; - value.start(animateMotionValue(key, value, valueTarget, shouldReduceMotion && positionalKeys.has(key) - ? { type: false } - : valueTransition, visualElement, isHandoff)); - const animation = value.animation; - if (animation) { - animations.push(animation); - } - } - if (transitionEnd) { - const applyTransitionEnd = () => frame.update(() => { - transitionEnd && setTarget(visualElement, transitionEnd); - }); - if (animations.length) { - Promise.all(animations).then(applyTransitionEnd); - } - else { - applyTransitionEnd(); - } - } - return animations; - } - - function animateVariant(visualElement, variant, options = {}) { - const resolved = resolveVariant(visualElement, variant, options.type === "exit" - ? visualElement.presenceContext?.custom - : undefined); - let { transition = visualElement.getDefaultTransition() || {} } = resolved || {}; - if (options.transitionOverride) { - transition = options.transitionOverride; - } - /** - * If we have a variant, create a callback that runs it as an animation. - * Otherwise, we resolve a Promise immediately for a composable no-op. - */ - const getAnimation = resolved - ? () => Promise.all(animateTarget(visualElement, resolved, options)) - : () => Promise.resolve(); - /** - * If we have children, create a callback that runs all their animations. - * Otherwise, we resolve a Promise immediately for a composable no-op. - */ - const getChildAnimations = visualElement.variantChildren && visualElement.variantChildren.size - ? (forwardDelay = 0) => { - const { delayChildren = 0, staggerChildren, staggerDirection, } = transition; - return animateChildren(visualElement, variant, forwardDelay, delayChildren, staggerChildren, staggerDirection, options); - } - : () => Promise.resolve(); - /** - * If the transition explicitly defines a "when" option, we need to resolve either - * this animation or all children animations before playing the other. - */ - const { when } = transition; - if (when) { - const [first, last] = when === "beforeChildren" - ? [getAnimation, getChildAnimations] - : [getChildAnimations, getAnimation]; - return first().then(() => last()); - } - else { - return Promise.all([getAnimation(), getChildAnimations(options.delay)]); - } - } - function animateChildren(visualElement, variant, delay = 0, delayChildren = 0, staggerChildren = 0, staggerDirection = 1, options) { - const animations = []; - for (const child of visualElement.variantChildren) { - child.notify("AnimationStart", variant); - animations.push(animateVariant(child, variant, { - ...options, - delay: delay + - (typeof delayChildren === "function" ? 0 : delayChildren) + - calcChildStagger(visualElement.variantChildren, child, delayChildren, staggerChildren, staggerDirection), - }).then(() => child.notify("AnimationComplete", variant))); - } - return Promise.all(animations); - } - - function animateVisualElement(visualElement, definition, options = {}) { - visualElement.notify("AnimationStart", definition); - let animation; - if (Array.isArray(definition)) { - const animations = definition.map((variant) => animateVariant(visualElement, variant, options)); - animation = Promise.all(animations); - } - else if (typeof definition === "string") { - animation = animateVariant(visualElement, definition, options); - } - else { - const resolvedDefinition = typeof definition === "function" - ? resolveVariant(visualElement, definition, options.custom) - : definition; - animation = Promise.all(animateTarget(visualElement, resolvedDefinition, options)); - } - return animation.then(() => { - visualElement.notify("AnimationComplete", definition); - }); - } - - /** - * ValueType for "auto" - */ - const auto = { - test: (v) => v === "auto", - parse: (v) => v, - }; - - /** - * Tests a provided value against a ValueType - */ - const testValueType = (v) => (type) => type.test(v); - - /** - * A list of value types commonly used for dimensions - */ - const dimensionValueTypes = [number, px, percent, degrees, vw, vh, auto]; - /** - * Tests a dimensional value against the list of dimension ValueTypes - */ - const findDimensionValueType = (v) => dimensionValueTypes.find(testValueType(v)); - - function isNone(value) { - if (typeof value === "number") { - return value === 0; - } - else if (value !== null) { - return value === "none" || value === "0" || isZeroValueString(value); - } - else { - return true; - } - } - - /** - * Properties that should default to 1 or 100% - */ - const maxDefaults = new Set(["brightness", "contrast", "saturate", "opacity"]); - function applyDefaultFilter(v) { - const [name, value] = v.slice(0, -1).split("("); - if (name === "drop-shadow") - return v; - const [number] = value.match(floatRegex) || []; - if (!number) - return v; - const unit = value.replace(number, ""); - let defaultValue = maxDefaults.has(name) ? 1 : 0; - if (number !== value) - defaultValue *= 100; - return name + "(" + defaultValue + unit + ")"; - } - const functionRegex = /\b([a-z-]*)\(.*?\)/gu; - const filter = { - ...complex, - getAnimatableNone: (v) => { - const functions = v.match(functionRegex); - return functions ? functions.map(applyDefaultFilter).join(" ") : v; - }, - }; - - const mask = { - ...complex, - getAnimatableNone: (v) => { - const parsed = complex.parse(v); - const transformer = complex.createTransformer(v); - return transformer(parsed.map((v) => typeof v === "number" ? 0 : typeof v === "object" ? { ...v, alpha: 1 } : v)); - }, - }; - - const int = { - ...number, - transform: Math.round, - }; - - const transformValueTypes = { - rotate: degrees, - /** - * Internal channel for `transition.path` orientToPath. Composed onto - * `rotate` at the transform-build sites so the user's `rotate` is - * never read or overwritten. Not part of `transformPropOrder`. - */ - pathRotation: degrees, - rotateX: degrees, - rotateY: degrees, - rotateZ: degrees, - scale, - scaleX: scale, - scaleY: scale, - scaleZ: scale, - skew: degrees, - skewX: degrees, - skewY: degrees, - distance: px, - translateX: px, - translateY: px, - translateZ: px, - x: px, - y: px, - z: px, - perspective: px, - transformPerspective: px, - opacity: alpha, - originX: progressPercentage, - originY: progressPercentage, - originZ: px, - }; - - const numberValueTypes = { - // Border props - borderWidth: px, - borderTopWidth: px, - borderRightWidth: px, - borderBottomWidth: px, - borderLeftWidth: px, - borderRadius: px, - borderTopLeftRadius: px, - borderTopRightRadius: px, - borderBottomRightRadius: px, - borderBottomLeftRadius: px, - // Positioning props - width: px, - maxWidth: px, - height: px, - maxHeight: px, - top: px, - right: px, - bottom: px, - left: px, - inset: px, - insetBlock: px, - insetBlockStart: px, - insetBlockEnd: px, - insetInline: px, - insetInlineStart: px, - insetInlineEnd: px, - // Spacing props - padding: px, - paddingTop: px, - paddingRight: px, - paddingBottom: px, - paddingLeft: px, - paddingBlock: px, - paddingBlockStart: px, - paddingBlockEnd: px, - paddingInline: px, - paddingInlineStart: px, - paddingInlineEnd: px, - margin: px, - marginTop: px, - marginRight: px, - marginBottom: px, - marginLeft: px, - marginBlock: px, - marginBlockStart: px, - marginBlockEnd: px, - marginInline: px, - marginInlineStart: px, - marginInlineEnd: px, - // Typography - fontSize: px, - // Misc - backgroundPositionX: px, - backgroundPositionY: px, - ...transformValueTypes, - zIndex: int, - // SVG - fillOpacity: alpha, - strokeOpacity: alpha, - numOctaves: int, - }; - - /** - * A map of default value types for common values - */ - const defaultValueTypes = { - ...numberValueTypes, - // Color props - color, - backgroundColor: color, - outlineColor: color, - fill: color, - stroke: color, - // Border props - borderColor: color, - borderTopColor: color, - borderRightColor: color, - borderBottomColor: color, - borderLeftColor: color, - filter, - WebkitFilter: filter, - mask, - WebkitMask: mask, - }; - /** - * Gets the default ValueType for the provided value key - */ - const getDefaultValueType = (key) => defaultValueTypes[key]; - - const customTypes = /*@__PURE__*/ new Set([filter, mask]); - function getAnimatableNone(key, value) { - let defaultValueType = getDefaultValueType(key); - if (!customTypes.has(defaultValueType)) - defaultValueType = complex; - // If value is not recognised as animatable, ie "none", create an animatable version origin based on the target - return defaultValueType.getAnimatableNone - ? defaultValueType.getAnimatableNone(value) - : undefined; - } - - /** - * If we encounter keyframes like "none" or "0" and we also have keyframes like - * "#fff" or "200px 200px" we want to find a keyframe to serve as a template for - * the "none" keyframes. In this case "#fff" or "200px 200px" - then these get turned into - * zero equivalents, i.e. "#fff0" or "0px 0px". - */ - const invalidTemplates = new Set(["auto", "none", "0"]); - function makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, name) { - let i = 0; - let animatableTemplate = undefined; - while (i < unresolvedKeyframes.length && !animatableTemplate) { - const keyframe = unresolvedKeyframes[i]; - if (typeof keyframe === "string" && - !invalidTemplates.has(keyframe) && - analyseComplexValue(keyframe).values.length) { - animatableTemplate = unresolvedKeyframes[i]; - } - i++; - } - if (animatableTemplate && name) { - for (const noneIndex of noneKeyframeIndexes) { - unresolvedKeyframes[noneIndex] = getAnimatableNone(name, animatableTemplate); - } - } - } - - class DOMKeyframesResolver extends KeyframeResolver { - constructor(unresolvedKeyframes, onComplete, name, motionValue, element) { - super(unresolvedKeyframes, onComplete, name, motionValue, element, true); - } - readKeyframes() { - const { unresolvedKeyframes, element, name } = this; - if (!element || !element.current) - return; - super.readKeyframes(); - /** - * If any keyframe is a CSS variable, we need to find its value by sampling the element - */ - for (let i = 0; i < unresolvedKeyframes.length; i++) { - let keyframe = unresolvedKeyframes[i]; - if (typeof keyframe === "string") { - keyframe = keyframe.trim(); - if (isCSSVariableToken(keyframe)) { - const resolved = getVariableValue(keyframe, element.current); - if (resolved !== undefined) { - unresolvedKeyframes[i] = resolved; - } - if (i === unresolvedKeyframes.length - 1) { - this.finalKeyframe = keyframe; - } - } - } - } - /** - * Resolve "none" values. We do this potentially twice - once before and once after measuring keyframes. - * This could be seen as inefficient but it's a trade-off to avoid measurements in more situations, which - * have a far bigger performance impact. - */ - this.resolveNoneKeyframes(); - /** - * Check to see if unit type has changed. If so schedule jobs that will - * temporarily set styles to the destination keyframes. - * Skip if we have more than two keyframes or this isn't a positional value. - * TODO: We can throw if there are multiple keyframes and the value type changes. - */ - if (!positionalKeys.has(name) || unresolvedKeyframes.length !== 2) { - return; - } - const [origin, target] = unresolvedKeyframes; - const originType = findDimensionValueType(origin); - const targetType = findDimensionValueType(target); - /** - * If one keyframe contains embedded CSS variables (e.g. in calc()) and the other - * doesn't, we need to measure to convert to pixels. This handles GitHub issue #3410. - */ - const originHasVar = containsCSSVariable(origin); - const targetHasVar = containsCSSVariable(target); - if (originHasVar !== targetHasVar && positionalValues[name]) { - this.needsMeasurement = true; - return; - } - /** - * Either we don't recognise these value types or we can animate between them. - */ - if (originType === targetType) - return; - /** - * If both values are numbers or pixels, we can animate between them by - * converting them to numbers. - */ - if (isNumOrPxType(originType) && isNumOrPxType(targetType)) { - for (let i = 0; i < unresolvedKeyframes.length; i++) { - const value = unresolvedKeyframes[i]; - if (typeof value === "string") { - unresolvedKeyframes[i] = parseFloat(value); - } - } - } - else if (positionalValues[name]) { - /** - * Else, the only way to resolve this is by measuring the element. - */ - this.needsMeasurement = true; - } - } - resolveNoneKeyframes() { - const { unresolvedKeyframes, name } = this; - const noneKeyframeIndexes = []; - for (let i = 0; i < unresolvedKeyframes.length; i++) { - if (unresolvedKeyframes[i] === null || - isNone(unresolvedKeyframes[i])) { - noneKeyframeIndexes.push(i); - } - } - if (noneKeyframeIndexes.length) { - makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, name); - } - } - measureInitialState() { - const { element, unresolvedKeyframes, name } = this; - if (!element || !element.current) - return; - if (name === "height") { - this.suspendedScrollY = window.pageYOffset; - } - this.measuredOrigin = positionalValues[name](element.measureViewportBox(), window.getComputedStyle(element.current)); - unresolvedKeyframes[0] = this.measuredOrigin; - // Set final key frame to measure after next render - const measureKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1]; - if (measureKeyframe !== undefined) { - element.getValue(name, measureKeyframe).jump(measureKeyframe, false); - } - } - measureEndState() { - const { element, name, unresolvedKeyframes } = this; - if (!element || !element.current) - return; - const value = element.getValue(name); - value && value.jump(this.measuredOrigin, false); - const finalKeyframeIndex = unresolvedKeyframes.length - 1; - const finalKeyframe = unresolvedKeyframes[finalKeyframeIndex]; - unresolvedKeyframes[finalKeyframeIndex] = positionalValues[name](element.measureViewportBox(), window.getComputedStyle(element.current)); - if (finalKeyframe !== null && this.finalKeyframe === undefined) { - this.finalKeyframe = finalKeyframe; - } - // If we removed transform values, reapply them before the next render - if (this.removedTransforms?.length) { - this.removedTransforms.forEach(([unsetTransformName, unsetTransformValue]) => { - element - .getValue(unsetTransformName) - .set(unsetTransformValue); - }); - } - this.resolveNoneKeyframes(); - } - } - - /** - * The four corner-radius longhands. Shared so the projection mixer, scale - * corrector, WAAPI px-value set and view-transition crop pass don't each carry - * their own copy. Order is irrelevant - every consumer mixes/corrects/animates - * each corner independently. - */ - const cornerRadiusProps = [ - "borderTopLeftRadius", - "borderTopRightRadius", - "borderBottomRightRadius", - "borderBottomLeftRadius", - ]; - - const pxValues = new Set([ - // Border props - "borderWidth", - "borderTopWidth", - "borderRightWidth", - "borderBottomWidth", - "borderLeftWidth", - "borderRadius", - ...cornerRadiusProps, - // Positioning props - "width", - "maxWidth", - "height", - "maxHeight", - "top", - "right", - "bottom", - "left", - "inset", - "insetBlock", - "insetBlockStart", - "insetBlockEnd", - "insetInline", - "insetInlineStart", - "insetInlineEnd", - // Spacing props - "padding", - "paddingTop", - "paddingRight", - "paddingBottom", - "paddingLeft", - "paddingBlock", - "paddingBlockStart", - "paddingBlockEnd", - "paddingInline", - "paddingInlineStart", - "paddingInlineEnd", - "margin", - "marginTop", - "marginRight", - "marginBottom", - "marginLeft", - "marginBlock", - "marginBlockStart", - "marginBlockEnd", - "marginInline", - "marginInlineStart", - "marginInlineEnd", - // Typography - "fontSize", - // Misc - "backgroundPositionX", - "backgroundPositionY", - ]); - - function applyPxDefaults(keyframes, name) { - for (let i = 0; i < keyframes.length; i++) { - if (typeof keyframes[i] === "number" && pxValues.has(name)) { - keyframes[i] = keyframes[i] + "px"; - } - } - } - - function isWaapiSupportedEasing(easing) { - return Boolean((typeof easing === "function" && supportsLinearEasing()) || - !easing || - (typeof easing === "string" && - (easing in supportedWaapiEasing || supportsLinearEasing())) || - isBezierDefinition(easing) || - (Array.isArray(easing) && easing.every(isWaapiSupportedEasing))); - } - - const supportsPartialKeyframes = /*@__PURE__*/ memo(() => { - try { - document.createElement("div").animate({ opacity: [1] }); - } - catch (e) { - return false; - } - return true; - }); - - function resolveElements(elementOrSelector, scope, selectorCache) { - if (elementOrSelector == null) { - return []; - } - if (elementOrSelector instanceof EventTarget) { - return [elementOrSelector]; - } - else if (typeof elementOrSelector === "string") { - let root = document; - if (scope) { - root = scope.current; - } - const elements = selectorCache?.[elementOrSelector] ?? - root.querySelectorAll(elementOrSelector); - return elements ? Array.from(elements) : []; - } - return Array.from(elementOrSelector).filter((element) => element != null); - } - - function createSelectorEffect(subjectEffect) { - return (subject, values) => { - const elements = resolveElements(subject); - const subscriptions = []; - for (const element of elements) { - const remove = subjectEffect(element, values); - subscriptions.push(remove); - } - return () => { - for (const remove of subscriptions) - remove(); - }; - }; - } - - /** - * Provided a value and a ValueType, returns the value as that value type. - */ - const getValueAsType = (value, type) => { - return type && typeof value === "number" - ? type.transform(value) - : value; - }; - - class MotionValueState { - constructor() { - this.latest = {}; - this.values = new Map(); - } - set(name, value, render, computed, useDefaultValueType = true) { - const existingValue = this.values.get(name); - if (existingValue) { - existingValue.onRemove(); - } - const onChange = () => { - const v = value.get(); - if (useDefaultValueType) { - this.latest[name] = getValueAsType(v, numberValueTypes[name]); - } - else { - this.latest[name] = v; - } - render && frame.render(render); - }; - onChange(); - const cancelOnChange = value.on("change", onChange); - computed && value.addDependent(computed); - const remove = () => { - cancelOnChange(); - render && cancelFrame(render); - this.values.delete(name); - computed && value.removeDependent(computed); - }; - this.values.set(name, { value, onRemove: remove }); - return remove; - } - get(name) { - return this.values.get(name)?.value; - } - } - - function createEffect(addValue) { - const stateCache = new WeakMap(); - return (subject, values) => { - const state = stateCache.get(subject) ?? new MotionValueState(); - stateCache.set(subject, state); - const subscriptions = []; - for (const key in values) { - const value = values[key]; - const remove = addValue(subject, state, key, value); - subscriptions.push(remove); - } - return () => { - for (const cancel of subscriptions) - cancel(); - }; - }; - } - - function canSetAsProperty(element, name) { - if (!(name in element)) - return false; - const descriptor = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(element), name) || - Object.getOwnPropertyDescriptor(element, name); - // Check if it has a setter - return descriptor && typeof descriptor.set === "function"; - } - const addAttrValue = (element, state, key, value) => { - const isProp = canSetAsProperty(element, key); - const name = isProp - ? key - : key.startsWith("data") || key.startsWith("aria") - ? camelToDash(key) - : key; - /** - * Set attribute directly via property if available - */ - const render = isProp - ? () => { - element[name] = state.latest[key]; - } - : () => { - const v = state.latest[key]; - if (v === null || v === undefined) { - element.removeAttribute(name); - } - else { - element.setAttribute(name, String(v)); - } - }; - return state.set(key, value, render); - }; - const attrEffect = /*@__PURE__*/ createSelectorEffect( - /*@__PURE__*/ createEffect(addAttrValue)); - - const propEffect = /*@__PURE__*/ createEffect((subject, state, key, value) => { - return state.set(key, value, () => { - subject[key] = state.latest[key]; - }, undefined, false); - }); - - /** - * Checks if an element is an HTML element in a way - * that works across iframes - */ - function isHTMLElement(element) { - return (isObject(element) && - "offsetHeight" in element && - !("ownerSVGElement" in element)); - } - - const translateAlias$1 = { - x: "translateX", - y: "translateY", - z: "translateZ", - transformPerspective: "perspective", - }; - function buildTransform$1(state) { - let transform = ""; - let transformIsDefault = true; - /** - * Loop over all possible transforms in order, adding the ones that - * are present to the transform string. - */ - for (let i = 0; i < transformPropOrder.length; i++) { - const key = transformPropOrder[i]; - const value = state.latest[key]; - if (value === undefined) - continue; - let valueIsDefault = true; - if (typeof value === "number") { - valueIsDefault = value === (key.startsWith("scale") ? 1 : 0); - } - else { - const parsed = parseFloat(value); - valueIsDefault = key.startsWith("scale") ? parsed === 1 : parsed === 0; - } - if (!valueIsDefault) { - transformIsDefault = false; - const transformName = translateAlias$1[key] || key; - transform += `${transformName}(${value}) `; - } - } - // See build-transform.ts: additive `rotate()` so user `rotate` isn't - // clobbered. Not a `transformPropOrder` slot. - const pathRotation = state.latest.pathRotation; - if (pathRotation) { - transformIsDefault = false; - transform += `rotate(${typeof pathRotation === "number" - ? `${pathRotation}deg` - : pathRotation}) `; - } - return transformIsDefault ? "none" : transform.trim(); - } - - const originProps = new Set(["originX", "originY", "originZ"]); - const addStyleValue = (element, state, key, value) => { - let render = undefined; - let computed = undefined; - if (transformProps.has(key)) { - if (!state.get("transform")) { - // If this is an HTML element, we need to set the transform-box to fill-box - // to normalise the transform relative to the element's bounding box - if (!isHTMLElement(element) && !state.get("transformBox")) { - addStyleValue(element, state, "transformBox", new MotionValue("fill-box")); - } - state.set("transform", new MotionValue("none"), () => { - element.style.transform = buildTransform$1(state); - }); - } - computed = state.get("transform"); - } - else if (originProps.has(key)) { - if (!state.get("transformOrigin")) { - state.set("transformOrigin", new MotionValue(""), () => { - const originX = state.latest.originX ?? "50%"; - const originY = state.latest.originY ?? "50%"; - const originZ = state.latest.originZ ?? 0; - element.style.transformOrigin = `${originX} ${originY} ${originZ}`; - }); - } - computed = state.get("transformOrigin"); - } - else if (isCSSVar(key)) { - render = () => { - element.style.setProperty(key, state.latest[key]); - }; - } - else { - render = () => { - element.style[key] = state.latest[key]; - }; - } - return state.set(key, value, render, computed); - }; - const styleEffect = /*@__PURE__*/ createSelectorEffect( - /*@__PURE__*/ createEffect(addStyleValue)); - - function addSVGPathValue(element, state, key, value) { - frame.render(() => element.setAttribute("pathLength", "1")); - if (key === "pathOffset") { - return state.set(key, value, () => { - // Use unitless value to avoid Safari zoom bug - const offset = state.latest[key]; - element.setAttribute("stroke-dashoffset", `${-offset}`); - }); - } - else { - if (!state.get("stroke-dasharray")) { - state.set("stroke-dasharray", new MotionValue("1 1"), () => { - const { pathLength = 1, pathSpacing } = state.latest; - // Use unitless values to avoid Safari zoom bug - element.setAttribute("stroke-dasharray", `${pathLength} ${pathSpacing ?? 1 - Number(pathLength)}`); - }); - } - return state.set(key, value, undefined, state.get("stroke-dasharray")); - } - } - const addSVGValue = (element, state, key, value) => { - if (key.startsWith("path")) { - return addSVGPathValue(element, state, key, value); - } - else if (key.startsWith("attr")) { - return addAttrValue(element, state, convertAttrKey(key), value); - } - const handler = key in element.style ? addStyleValue : addAttrValue; - return handler(element, state, key, value); - }; - const svgEffect = /*@__PURE__*/ createSelectorEffect( - /*@__PURE__*/ createEffect(addSVGValue)); - function convertAttrKey(key) { - return key.replace(/^attr([A-Z])/, (_, firstChar) => firstChar.toLowerCase()); - } - - const { schedule: microtask, cancel: cancelMicrotask } = - /* @__PURE__ */ createRenderBatcher(queueMicrotask, false); - - const isDragging = { - x: false, - y: false, - }; - function isDragActive() { - return isDragging.x || isDragging.y; - } - - function setDragLock(axis) { - if (axis === "x" || axis === "y") { - if (isDragging[axis]) { - return null; - } - else { - isDragging[axis] = true; - return () => { - isDragging[axis] = false; - }; - } - } - else { - if (isDragging.x || isDragging.y) { - return null; - } - else { - isDragging.x = isDragging.y = true; - return () => { - isDragging.x = isDragging.y = false; - }; - } - } - } - - function setupGesture(elementOrSelector, options) { - const elements = resolveElements(elementOrSelector); - const gestureAbortController = new AbortController(); - const eventOptions = { - passive: true, - ...options, - signal: gestureAbortController.signal, - }; - const cancel = () => gestureAbortController.abort(); - return [elements, eventOptions, cancel]; - } - - function isValidHover(event) { - return !(event.pointerType === "touch" || isDragActive()); - } - /** - * Create a hover gesture. hover() is different to .addEventListener("pointerenter") - * in that it has an easier syntax, filters out polyfilled touch events, interoperates - * with drag gestures, and automatically removes the "pointerennd" event listener when the hover ends. - * - * @public - */ - function hover(elementOrSelector, onHoverStart, options = {}) { - const [elements, eventOptions, cancel] = setupGesture(elementOrSelector, options); - elements.forEach((element) => { - let isPressed = false; - let deferredHoverEnd = false; - let hoverEndCallback; - const removePointerLeave = () => { - element.removeEventListener("pointerleave", onPointerLeave); - }; - const endHover = (event) => { - if (hoverEndCallback) { - hoverEndCallback(event); - hoverEndCallback = undefined; - } - removePointerLeave(); - }; - const onPointerUp = (event) => { - isPressed = false; - window.removeEventListener("pointerup", onPointerUp); - window.removeEventListener("pointercancel", onPointerUp); - if (deferredHoverEnd) { - deferredHoverEnd = false; - endHover(event); - } - }; - const onPointerDown = () => { - isPressed = true; - window.addEventListener("pointerup", onPointerUp, eventOptions); - window.addEventListener("pointercancel", onPointerUp, eventOptions); - }; - const onPointerLeave = (leaveEvent) => { - if (leaveEvent.pointerType === "touch") - return; - if (isPressed) { - deferredHoverEnd = true; - return; - } - endHover(leaveEvent); - }; - const onPointerEnter = (enterEvent) => { - if (!isValidHover(enterEvent)) - return; - deferredHoverEnd = false; - const onHoverEnd = onHoverStart(element, enterEvent); - if (typeof onHoverEnd !== "function") - return; - hoverEndCallback = onHoverEnd; - element.addEventListener("pointerleave", onPointerLeave, eventOptions); - }; - element.addEventListener("pointerenter", onPointerEnter, eventOptions); - element.addEventListener("pointerdown", onPointerDown, eventOptions); - }); - return cancel; - } - - /** - * Recursively traverse up the tree to check whether the provided child node - * is the parent or a descendant of it. - * - * @param parent - Element to find - * @param child - Element to test against parent - */ - const isNodeOrChild = (parent, child) => { - if (!child) { - return false; - } - else if (parent === child) { - return true; - } - else { - return isNodeOrChild(parent, child.parentElement); - } - }; - - const isPrimaryPointer = (event) => { - if (event.pointerType === "mouse") { - return typeof event.button !== "number" || event.button <= 0; - } - else { - /** - * isPrimary is true for all mice buttons, whereas every touch point - * is regarded as its own input. So subsequent concurrent touch points - * will be false. - * - * Specifically match against false here as incomplete versions of - * PointerEvents in very old browser might have it set as undefined. - */ - return event.isPrimary !== false; - } - }; - - const keyboardAccessibleElements = new Set([ - "BUTTON", - "INPUT", - "SELECT", - "TEXTAREA", - "A", - ]); - /** - * Checks if an element is natively keyboard accessible (focusable). - * Used by the press gesture to determine if we need to add tabIndex. - */ - function isElementKeyboardAccessible(element) { - return (keyboardAccessibleElements.has(element.tagName) || - element.isContentEditable === true); - } - const textInputElements = new Set(["INPUT", "SELECT", "TEXTAREA"]); - /** - * Checks if an element has text selection or direct interaction behavior - * that should block drag gestures from starting. - * - * This specifically targets form controls where the user might want to select - * text or interact with the control (e.g., sliders, dropdowns). - * - * Buttons and links are NOT included because they don't have click-and-move - * actions of their own - they only respond to click events, so dragging - * should still work when initiated from these elements. - */ - function isElementTextInput(element) { - return (textInputElements.has(element.tagName) || - element.isContentEditable === true); - } - - const isPressing = new WeakSet(); - - /** - * Filter out events that are not "Enter" keys. - */ - function filterEvents(callback) { - return (event) => { - if (event.key !== "Enter") - return; - callback(event); - }; - } - function firePointerEvent(target, type) { - target.dispatchEvent(new PointerEvent("pointer" + type, { isPrimary: true, bubbles: true })); - } - const enableKeyboardPress = (focusEvent, eventOptions) => { - const element = focusEvent.currentTarget; - if (!element) - return; - const handleKeydown = filterEvents(() => { - if (isPressing.has(element)) - return; - firePointerEvent(element, "down"); - const handleKeyup = filterEvents(() => { - firePointerEvent(element, "up"); - }); - const handleBlur = () => firePointerEvent(element, "cancel"); - element.addEventListener("keyup", handleKeyup, eventOptions); - element.addEventListener("blur", handleBlur, eventOptions); - }); - element.addEventListener("keydown", handleKeydown, eventOptions); - /** - * Add an event listener that fires on blur to remove the keydown events. - */ - element.addEventListener("blur", () => element.removeEventListener("keydown", handleKeydown), eventOptions); - }; - - /** - * Filter out events that are not primary pointer events, or are triggering - * while a Motion gesture is active. - */ - function isValidPressEvent(event) { - return isPrimaryPointer(event) && !isDragActive(); - } - const claimedPointerDownEvents = new WeakSet(); - /** - * Create a press gesture. - * - * Press is different to `"pointerdown"`, `"pointerup"` in that it - * automatically filters out secondary pointer events like right - * click and multitouch. - * - * It also adds accessibility support for keyboards, where - * an element with a press gesture will receive focus and - * trigger on Enter `"keydown"` and `"keyup"` events. - * - * This is different to a browser's `"click"` event, which does - * respond to keyboards but only for the `"click"` itself, rather - * than the press start and end/cancel. The element also needs - * to be focusable for this to work, whereas a press gesture will - * make an element focusable by default. - * - * @public - */ - function press(targetOrSelector, onPressStart, options = {}) { - const [targets, eventOptions, cancelEvents] = setupGesture(targetOrSelector, options); - const startPress = (startEvent) => { - const target = startEvent.currentTarget; - if (!isValidPressEvent(startEvent)) - return; - if (claimedPointerDownEvents.has(startEvent)) - return; - isPressing.add(target); - if (options.stopPropagation) { - claimedPointerDownEvents.add(startEvent); - } - const onPressEnd = onPressStart(target, startEvent); - /** - * End listeners run in the capture phase so a descendant calling - * stopPropagation() in its own pointerup handler can't prevent the - * press gesture from ending. This also keeps the gesture-end - * ordering consistent with the drag gesture. See #2794. - */ - const endEventOptions = { ...eventOptions, capture: true }; - const onPointerEnd = (endEvent, success) => { - window.removeEventListener("pointerup", onPointerUp, endEventOptions); - window.removeEventListener("pointercancel", onPointerCancel, endEventOptions); - if (isPressing.has(target)) { - isPressing.delete(target); - } - if (!isValidPressEvent(endEvent)) { - return; - } - if (typeof onPressEnd === "function") { - onPressEnd(endEvent, { success }); - } - }; - const onPointerUp = (upEvent) => { - onPointerEnd(upEvent, target === window || - target === document || - options.useGlobalTarget || - isNodeOrChild(target, upEvent.target)); - }; - const onPointerCancel = (cancelEvent) => { - onPointerEnd(cancelEvent, false); - }; - window.addEventListener("pointerup", onPointerUp, endEventOptions); - window.addEventListener("pointercancel", onPointerCancel, endEventOptions); - }; - targets.forEach((target) => { - const pointerDownTarget = options.useGlobalTarget ? window : target; - pointerDownTarget.addEventListener("pointerdown", startPress, eventOptions); - if (isHTMLElement(target)) { - target.addEventListener("focus", (event) => enableKeyboardPress(event, eventOptions)); - if (!isElementKeyboardAccessible(target) && - !target.hasAttribute("tabindex")) { - target.tabIndex = 0; - } - } - }); - return cancelEvents; - } - - function getComputedStyle$2(element, name) { - const computedStyle = window.getComputedStyle(element); - return isCSSVar(name) - ? computedStyle.getPropertyValue(name) - : computedStyle[name]; - } - - /** - * Checks if an element is an SVG element in a way - * that works across iframes - */ - function isSVGElement(element) { - return isObject(element) && "ownerSVGElement" in element; - } - - const resizeHandlers = new WeakMap(); - let observer; - const getSize = (borderBoxAxis, svgAxis, htmlAxis) => (target, borderBoxSize) => { - if (borderBoxSize && borderBoxSize[0]) { - return borderBoxSize[0][(borderBoxAxis + "Size")]; - } - else if (isSVGElement(target) && "getBBox" in target) { - return target.getBBox()[svgAxis]; - } - else { - return target[htmlAxis]; - } - }; - const getWidth = /*@__PURE__*/ getSize("inline", "width", "offsetWidth"); - const getHeight = /*@__PURE__*/ getSize("block", "height", "offsetHeight"); - function notifyTarget({ target, borderBoxSize }) { - resizeHandlers.get(target)?.forEach((handler) => { - handler(target, { - get width() { - return getWidth(target, borderBoxSize); - }, - get height() { - return getHeight(target, borderBoxSize); - }, - }); - }); - } - function notifyAll(entries) { - entries.forEach(notifyTarget); - } - function createResizeObserver() { - if (typeof ResizeObserver === "undefined") - return; - observer = new ResizeObserver(notifyAll); - } - function resizeElement(target, handler) { - if (!observer) - createResizeObserver(); - const elements = resolveElements(target); - elements.forEach((element) => { - let elementHandlers = resizeHandlers.get(element); - if (!elementHandlers) { - elementHandlers = new Set(); - resizeHandlers.set(element, elementHandlers); - } - elementHandlers.add(handler); - observer?.observe(element); - }); - return () => { - elements.forEach((element) => { - const elementHandlers = resizeHandlers.get(element); - elementHandlers?.delete(handler); - if (!elementHandlers?.size) { - observer?.unobserve(element); - } - }); - }; - } - - const windowCallbacks = new Set(); - let windowResizeHandler; - function createWindowResizeHandler() { - windowResizeHandler = () => { - const info = { - get width() { - return window.innerWidth; - }, - get height() { - return window.innerHeight; - }, - }; - windowCallbacks.forEach((callback) => callback(info)); - }; - window.addEventListener("resize", windowResizeHandler); - } - function resizeWindow(callback) { - windowCallbacks.add(callback); - if (!windowResizeHandler) - createWindowResizeHandler(); - return () => { - windowCallbacks.delete(callback); - if (!windowCallbacks.size && - typeof windowResizeHandler === "function") { - window.removeEventListener("resize", windowResizeHandler); - windowResizeHandler = undefined; - } - }; - } - - function resize(a, b) { - return typeof a === "function" ? resizeWindow(a) : resizeElement(a, b); - } - - function observeTimeline(update, timeline) { - let prevProgress; - const onFrame = () => { - const { currentTime } = timeline; - const percentage = currentTime === null ? 0 : currentTime.value; - const progress = percentage / 100; - if (prevProgress !== progress) { - update(progress); - } - prevProgress = progress; - }; - frame.preUpdate(onFrame, true); - return () => cancelFrame(onFrame); - } - - const statsBuffer = { - value: null, - addProjectionMetrics: null, - }; - - function clearStatsBuffer() { - statsBuffer.value = null; - statsBuffer.addProjectionMetrics = null; - } - function recordStats() { - if (statsBuffer.value) { - clearStatsBuffer(); - throw new Error("Stats are already being measured"); - } - const buffer = statsBuffer; - buffer.value = { - layoutProjection: { - nodes: [], - calculatedTargetDeltas: [], - calculatedProjections: [], - }, - }; - buffer.addProjectionMetrics = (metrics) => { - const { layoutProjection } = buffer.value; - layoutProjection.nodes.push(metrics.nodes); - layoutProjection.calculatedTargetDeltas.push(metrics.calculatedTargetDeltas); - layoutProjection.calculatedProjections.push(metrics.calculatedProjections); - }; - } - - /** - * Checks if an element is specifically an SVGSVGElement (the root SVG element) - * in a way that works across iframes - */ - function isSVGSVGElement(element) { - return isSVGElement(element) && element.tagName === "svg"; - } - - function getOriginIndex(from, total) { - if (from === "first") { - return 0; - } - else { - const lastIndex = total - 1; - return from === "last" ? lastIndex : lastIndex / 2; - } - } - function stagger(duration = 0.1, { startDelay = 0, from = 0, ease } = {}) { - return (i, total) => { - const fromIndex = typeof from === "number" ? from : getOriginIndex(from, total); - const distance = Math.abs(fromIndex - i); - let delay = duration * distance; - if (ease) { - const maxDelay = total * duration; - const easingFunction = easingDefinitionToFunction(ease); - delay = easingFunction(delay / maxDelay) * maxDelay; - } - return startDelay + delay; - }; - } - - function transform(...args) { - const useImmediate = !Array.isArray(args[0]); - const argOffset = useImmediate ? 0 : -1; - const inputValue = args[0 + argOffset]; - const inputRange = args[1 + argOffset]; - const outputRange = args[2 + argOffset]; - const options = args[3 + argOffset]; - const interpolator = interpolate(inputRange, outputRange, options); - return useImmediate ? interpolator(inputValue) : interpolator; - } - - /** - * Create a `MotionValue` that animates to its latest value using any transition type. - * Can either be a value or track another `MotionValue`. - * - * ```jsx - * const x = motionValue(0) - * const y = followValue(x, { type: "spring", stiffness: 300 }) - * // or with tween - * const z = followValue(x, { type: "tween", duration: 0.5, ease: "easeOut" }) - * ``` - * - * @param source - Initial value or MotionValue to track - * @param options - Animation transition options - * @returns `MotionValue` - * - * @public - */ - function followValue(source, options) { - const initialValue = isMotionValue(source) ? source.get() : source; - const value = motionValue(initialValue); - attachFollow(value, source, options); - return value; - } - /** - * Attach an animation to a MotionValue that will animate whenever the value changes. - * Similar to attachSpring but supports any transition type (spring, tween, inertia, etc.) - * - * @param value - The MotionValue to animate - * @param source - Initial value or MotionValue to track - * @param options - Animation transition options - * @returns Cleanup function - * - * @public - */ - function attachFollow(value, source, options = {}) { - const initialValue = value.get(); - let activeAnimation = null; - let latestValue = initialValue; - let latestSetter; - const unit = typeof initialValue === "string" - ? initialValue.replace(/[\d.-]/g, "") - : undefined; - const stopAnimation = () => { - if (activeAnimation) { - activeAnimation.stop(); - activeAnimation = null; - } - value.animation = undefined; - }; - const startAnimation = () => { - const currentValue = asNumber$1(value.get()); - const targetValue = asNumber$1(latestValue); - // Don't animate if we're already at the target - if (currentValue === targetValue) { - stopAnimation(); - return; - } - // Use the running animation's analytical velocity for accuracy, - // falling back to the MotionValue's velocity for the initial animation. - // This prevents systematic velocity loss at high frame rates (240hz+). - const velocity = activeAnimation - ? activeAnimation.getGeneratorVelocity() - : value.getVelocity(); - stopAnimation(); - activeAnimation = new JSAnimation({ - keyframes: [currentValue, targetValue], - velocity, - // Default to spring if no type specified (matches useSpring behavior) - type: "spring", - restDelta: 0.001, - restSpeed: 0.01, - ...options, - onUpdate: latestSetter, - }); - }; - // Use a stable function reference so the frame loop Set deduplicates - // multiple calls within the same frame (e.g. rapid mouse events) - const scheduleAnimation = () => { - startAnimation(); - value.animation = activeAnimation ?? undefined; - value["events"].animationStart?.notify(); - activeAnimation?.then(() => { - value.animation = undefined; - value["events"].animationComplete?.notify(); - }); - }; - value.attach((v, set) => { - latestValue = v; - latestSetter = (latest) => set(parseValue(latest, unit)); - frame.postRender(scheduleAnimation); - }, stopAnimation); - if (isMotionValue(source)) { - let skipNextAnimation = options.skipInitialAnimation === true; - const removeSourceOnChange = source.on("change", (v) => { - if (skipNextAnimation) { - skipNextAnimation = false; - value.jump(parseValue(v, unit), false); - } - else { - value.set(parseValue(v, unit)); - } - }); - const removeValueOnDestroy = value.on("destroy", removeSourceOnChange); - return () => { - removeSourceOnChange(); - removeValueOnDestroy(); - }; - } - return stopAnimation; - } - function parseValue(v, unit) { - return unit ? v + unit : v; - } - function asNumber$1(v) { - return typeof v === "number" ? v : parseFloat(v); - } - - function subscribeValue(inputValues, outputValue, getLatest) { - const update = () => outputValue.set(getLatest()); - const scheduleUpdate = () => frame.preRender(update, false, true); - const subscriptions = inputValues.map((v) => v.on("change", scheduleUpdate)); - outputValue.on("destroy", () => { - subscriptions.forEach((unsubscribe) => unsubscribe()); - cancelFrame(update); - }); - } - - /** - * Create a `MotionValue` that transforms the output of other `MotionValue`s by - * passing their latest values through a transform function. - * - * Whenever a `MotionValue` referred to in the provided function is updated, - * it will be re-evaluated. - * - * ```jsx - * const x = motionValue(0) - * const y = transformValue(() => x.get() * 2) // double x - * ``` - * - * @param transformer - A transform function. This function must be pure with no side-effects or conditional statements. - * @returns `MotionValue` - * - * @public - */ - function transformValue(transform) { - const collectedValues = []; - /** - * Open session of collectMotionValues. Any MotionValue that calls get() - * inside transform will be saved into this array. - */ - collectMotionValues.current = collectedValues; - const initialValue = transform(); - collectMotionValues.current = undefined; - const value = motionValue(initialValue); - subscribeValue(collectedValues, value, transform); - return value; - } - - /** - * Create a `MotionValue` that maps the output of another `MotionValue` by - * mapping it from one range of values into another. - * - * @remarks - * - * Given an input range of `[-200, -100, 100, 200]` and an output range of - * `[0, 1, 1, 0]`, the returned `MotionValue` will: - * - * - When provided a value between `-200` and `-100`, will return a value between `0` and `1`. - * - When provided a value between `-100` and `100`, will return `1`. - * - When provided a value between `100` and `200`, will return a value between `1` and `0` - * - * The input range must be a linear series of numbers. The output range - * can be any value type supported by Motion: numbers, colors, shadows, etc. - * - * Every value in the output range must be of the same type and in the same format. - * - * ```jsx - * const x = motionValue(0) - * const xRange = [-200, -100, 100, 200] - * const opacityRange = [0, 1, 1, 0] - * const opacity = mapValue(x, xRange, opacityRange) - * ``` - * - * @param inputValue - `MotionValue` - * @param inputRange - A linear series of numbers (either all increasing or decreasing) - * @param outputRange - A series of numbers, colors or strings. Must be the same length as `inputRange`. - * @param options - - * - * - clamp: boolean. Clamp values to within the given range. Defaults to `true` - * - ease: EasingFunction[]. Easing functions to use on the interpolations between each value in the input and output ranges. If provided as an array, the array must be one item shorter than the input and output ranges, as the easings apply to the transition between each. - * - * @returns `MotionValue` - * - * @public - */ - function mapValue(inputValue, inputRange, outputRange, options) { - const map = transform(inputRange, outputRange, options); - return transformValue(() => map(inputValue.get())); - } - - /** - * Create a `MotionValue` that animates to its latest value using a spring. - * Can either be a value or track another `MotionValue`. - * - * ```jsx - * const x = motionValue(0) - * const y = springValue(x, { stiffness: 300 }) - * ``` - * - * @param source - Initial value or MotionValue to track - * @param options - Spring configuration options - * @returns `MotionValue` - * - * @public - */ - function springValue(source, options) { - return followValue(source, { type: "spring", ...options }); - } - /** - * Attach a spring animation to a MotionValue that will animate whenever the value changes. - * - * @param value - The MotionValue to animate - * @param source - Initial value or MotionValue to track - * @param options - Spring configuration options - * @returns Cleanup function - * - * @public - */ - function attachSpring(value, source, options) { - return attachFollow(value, source, { type: "spring", ...options }); - } - - /** - * A list of all ValueTypes - */ - const valueTypes = [...dimensionValueTypes, color, complex]; - /** - * Tests a value against the list of ValueTypes - */ - const findValueType = (v) => valueTypes.find(testValueType(v)); - - let nameCount = 0; - /** - * Generated names live in their own namespace so we can tell a name we own - * (and must clean up) from an author-defined one - and so a stale generated - * name left behind by an interrupted transition is re-owned, not mistaken for - * the author's and leaked. - */ - const generatedName = () => `motion-view-${nameCount++}`; - const isGeneratedName = (name) => name.startsWith("motion-view-"); - /** - * Tag a captured element with a `view-transition-class` so authors can target - * its generated layer from CSS (e.g. `::view-transition-group(.hero)`) without - * the opaque generated name. Tracked in `classed` - separate from the generated - * names in `assigned` - so cleanup removes the class without ever stripping an - * author's own inline `view-transition-name`. - */ - function tagClass(element, className, classed) { - if (!className) - return; - element.style?.setProperty("view-transition-class", className); - classed.push(element); - } - /** - * Set the element's `view-transition-group` so its layer reconstructs the DOM - * hierarchy in the pseudo-tree (`contain`) - or stays flat (`none`). Tracked in - * `grouped` for cleanup. When the element clips (any non-`visible` overflow) its - * name is recorded in `clipChildren` so the caller can clip the nested children - * (`::view-transition-group-children(name)`), mirroring the live clip through - * the whole transition rather than only at the live-DOM handoff. - * - * Ignored by browsers without nested view-transition groups, where it harmlessly - * degrades to the flat default. - */ - function applyGroup(element, name, group, grouped, clipChildren) { - if (!group) - return; - element.style?.setProperty("view-transition-group", group); - grouped.push(element); - if (group !== "none" && clipChildren) { - const style = getComputedStyle(element); - if (style.overflowX !== "visible" || style.overflowY !== "visible") { - clipChildren.add(name); - } - } - } - /** - * Resolve a selector/Element to elements and ensure each one carries a - * `view-transition-name` we can target from script. - * - * Author-defined names are reused as-is. Elements that are unnamed (or use - * the browser's `auto`/`match-element`, whose generated name is not exposed - * to script) are given a unique generated name, set inline so it's captured, - * and tracked in `assigned` for later cleanup. - * - * `registry` maps each Element to its name so the same element keeps its name - * across both captures (before and after the update), which is what allows a - * persistent element to animate as a single `group` layer. - */ - function assignViewTransitionNames(definition, registry, assigned, forcedNames, className, classed = [], group, grouped = [], clipChildren) { - const elements = resolveElements(definition); - /** - * The new end of a paired morph: give each element the matching name from - * the old end (by index) so the two share one layer and morph. If the new - * end resolves to *more* elements than the old end named, the extras have no - * counterpart - give them a fresh name so they animate as newcomers rather - * than being silently left unnamed. We return the names actually assigned - * (sized to the resolved elements), not the raw `forcedNames`, so stagger - * totals and the layer set stay in step with what's on the page. - */ - if (forcedNames) { - return elements.map((element, i) => { - const existing = registry.get(element); - if (existing) - return existing; - const name = forcedNames[i] ?? generatedName(); - element.style?.setProperty("view-transition-name", name); - assigned.push(element); - registry.set(element, name); - tagClass(element, className, classed); - applyGroup(element, name, group, grouped, clipChildren); - return name; - }); - } - /** - * Read every current name up front, before assigning any. Interleaving the - * reads with the inline `setProperty` writes below would dirty styles - * between reads and force a style recalc per element; batching the reads - * keeps it to one. Elements already in the registry keep their name and - * need no read. - */ - const currentNames = elements.map((element) => registry.has(element) - ? undefined - : getComputedStyle(element).getPropertyValue("view-transition-name")); - return elements.map((element, i) => { - const existing = registry.get(element); - if (existing) - return existing; - const current = currentNames[i]; - let name; - if (current && - current !== "none" && - current !== "auto" && - current !== "match-element" && - !isGeneratedName(current)) { - /** - * The author already named this layer - target it as-is and leave - * it to them to clean up. `auto`/`match-element` are overridden - * because their generated name is not exposed to script, and a - * stale `motion-view-*` (e.g. left by an interrupted transition) is - * re-owned rather than adopted as an author name and leaked. - */ - name = current; - } - else { - name = generatedName(); - element.style?.setProperty("view-transition-name", name); - assigned.push(element); - } - registry.set(element, name); - tagClass(element, className, classed); - applyGroup(element, name, group, grouped, clipChildren); - return name; - }); - } - /** - * Remove the `view-transition-name`s we generated and the - * `view-transition-class`es we applied. Author-defined names are never touched - * (they're not in `assigned`). Safe to call more than once (e.g. on both a - * finished and an interrupted transition). - */ - function releaseViewTransitionNames(assigned, classed = [], grouped = []) { - for (const element of assigned) { - element.style?.removeProperty("view-transition-name"); - } - for (const element of classed) { - element.style?.removeProperty("view-transition-class"); - } - for (const element of grouped) { - element.style?.removeProperty("view-transition-group"); - } - } - - function chooseLayerType(valueName) { - if (valueName === "layout") - return "group"; - if (valueName === "enter" || valueName === "new") - return "new"; - return "old"; - } - - let pendingRules = {}; - let style = null; - const css = { - set: (selector, values) => { - pendingRules[selector] = values; - }, - commit: () => { - if (!style) { - style = document.createElement("style"); - style.id = "motion-view"; - } - let cssText = ""; - for (const selector in pendingRules) { - const rule = pendingRules[selector]; - cssText += `${selector} {\n`; - for (const [property, value] of Object.entries(rule)) { - cssText += ` ${property}: ${value};\n`; - } - cssText += "}\n"; - } - style.textContent = cssText; - document.head.appendChild(style); - pendingRules = {}; - }, - remove: () => { - if (style && style.parentElement) { - style.parentElement.removeChild(style); - } - }, - }; - - function getViewAnimationLayerInfo(pseudoElement) { - const match = pseudoElement.match( - // `group-children` (nested transitions) before `group` so it wins. - /::view-transition-(old|new|group-children|group|image-pair)\((.*?)\)/); - if (!match) - return null; - return { layer: match[2], type: match[1] }; - } - - function getViewAnimations() { - return document.getAnimations().filter((animation) => { - const { effect } = animation; - return (!!effect && - effect.target === document.documentElement && - effect.pseudoElement?.startsWith("::view-transition")); - }); - } - - function hasTarget(target, targets) { - return targets.has(target) && Object.keys(targets.get(target)).length > 0; - } - - const definitionNames = ["layout", "enter", "exit", "new", "old"]; - /** - * Whether a computed border-radius is square (every component zero). Splitting - * on whitespace handles two-value/elliptical radii like "0px 20px" - a leading - * `parseFloat` alone would misread the non-zero vertical radius as square. - */ - const isSquareRadius = (radius) => radius.split(" ").every((value) => parseFloat(value) === 0); - /** - * The `ViewTransitionTarget` buckets driving each generated layer type, in - * priority order - the inverse of `chooseLayerType`. The new view is driven by - * `new`/`enter`, the old by `old`/`exit`. `group-children`/`image-pair` have no - * bucket; they follow the default layout timing. - */ - const typeBuckets = { - group: ["layout"], - new: ["new", "enter"], - old: ["old", "exit"], - }; - /** - * Default "absent" origin for a single-value keyframe, by pseudo type, so e.g. - * `enter({ scale: 1 })` grows in from 0.85 and `exit({ opacity: 0 })` fades - * from 1. `enter` prefers the matching `exit` value over these (see below). - */ - const ORIGIN_DEFAULTS = { - new: { opacity: 0, scale: 0.85 }, - old: { opacity: 1, scale: 1 }, - }; - /** - * How much two box aspect ratios must differ before a morph is treated as - * aspect-changing (and so worth cropping). Matches the projection engine's - * `preserve-aspect` threshold, so small layout jitter doesn't trigger a crop. - */ - const ASPECT_TOLERANCE = 0.2; - function startViewAnimation(builder) { - const { update, targets, resolveDefs, cropOverride, pairs, classNames, flatGroups, options: defaultOptions, } = builder; - if (!document.startViewTransition) { - // An async IIFE (not `new Promise(async …)`) so a throwing/rejecting - // update rejects this promise rather than leaving it unsettled. - return (async () => { - await update(); - return new GroupAnimation([]); - })(); - } - /** - * Resolve any selector/Element targets to layer names, assigning a - * `view-transition-name` to each element as we go. We run this before the - * update (so the elements are captured in the old snapshot) and again - * after it (for the new snapshot). An element present in both keeps the - * same name and animates as a single `group` layer. - */ - const nameRegistry = new Map(); - const assigned = []; - /** - * Elements we tagged with a `view-transition-class` (via `.class()`), - * tracked separately from `assigned` so cleanup removes the class without - * ever stripping an author's own inline `view-transition-name`. - */ - const classed = []; - /** - * Elements we set a `view-transition-group` on (for nesting), tracked for - * cleanup. `clipChildren` collects the names of nested parents that clip in - * the live layout, so their `::view-transition-group-children` is clipped - * through the transition - not just once the live DOM takes back over. - */ - const grouped = []; - const clipChildren = new Set(); - const layerTargets = new Map(); - const croppedNames = new Set(); - /** - * Each layer's explicit `.crop(true | false)` override (by resolved name), - * so `finalizeCrop` can let an author's choice win over the morph default. - */ - const cropForName = new Map(); - /** - * Each layer's stagger position (index + total) within its subject, per - * snapshot. Resolving against the snapshot the layer belongs to keeps - * stagger correct when `update()` replaces the matched elements, and lets - * us skip a layer that's absent from a snapshot (e.g. an exited element - * has no `new` pseudo-element). - */ - const layerStagger = new Map(); - /** - * Names allocated for a paired subject in the old snapshot, replayed onto - * its new-snapshot target so both ends share a layer and morph. - */ - const pairNames = new Map(); - /** - * The old (`from`) elements of each paired subject, so their names can be - * transferred off before the new (`to`) elements inherit them. - */ - const pairFrom = new Map(); - const resolveLayers = (phase) => { - targets.forEach((target, definition) => { - const className = classNames.get(definition); - /** - * Nest each resolved layer under its DOM-ancestor layer by default - * (`contain`), so an ancestor's clip/transform/opacity reach it - * through the transition; `.group(false)` opts a subject out (`none`) - * to stay flat and escape. Skipped for root / pre-named layers, which - * aren't elements we resolve and style. - */ - const group = definition === "root" || !resolveDefs.has(definition) - ? undefined - : flatGroups.has(definition) - ? "none" - : "contain"; - let names; - if (definition === "root" || !resolveDefs.has(definition)) { - names = [definition]; - } - else if (pairs.has(definition)) { - /** - * Paired morph: name the old target in the old snapshot, then - * force the same name(s) onto the new target in the new one, so - * two different elements morph as a single layer. - */ - if (phase === "old") { - pairFrom.set(definition, resolveElements(definition)); - names = assignViewTransitionNames(definition, nameRegistry, assigned, undefined, className, classed, group, grouped, clipChildren); - pairNames.set(definition, names); - } - else { - /** - * Transfer the name(s) off the `from` elements before the - * `to` elements inherit them. A `from` that survives into - * the new snapshot (e.g. hidden with `visibility: hidden` - * rather than removed) would otherwise keep the name and - * collide - "duplicate view-transition-name". - */ - for (const el of pairFrom.get(definition) ?? []) { - el.style?.removeProperty("view-transition-name"); - /** - * Drop the old end from the registry too, so the new - * end alone supplies this name's `new` crop radii - we - * neither re-measure nor get ordered by a stale element. - */ - nameRegistry.delete(el); - } - names = assignViewTransitionNames(pairs.get(definition), nameRegistry, assigned, pairNames.get(definition), className, classed, group, grouped, clipChildren); - } - } - else { - names = assignViewTransitionNames(definition, nameRegistry, assigned, undefined, className, classed, group, grouped, clipChildren); - } - // Record any explicit `.crop(true | false)` per resolved name; the - // crop set itself is computed later by `finalizeCrop` (it needs both - // snapshots to know which morphs change aspect ratio). - const override = cropOverride.get(definition); - names.forEach((name, index) => { - /** - * If two subjects resolve to the same element, merge their - * definitions so neither subject's animations are dropped. - */ - const existing = layerTargets.get(name); - layerTargets.set(name, existing && existing !== target - ? { ...existing, ...target } - : target); - if (override !== undefined) - cropForName.set(name, override); - const stagger = layerStagger.get(name) ?? {}; - stagger[phase] = [index, names.length]; - layerStagger.set(name, stagger); - }); - }); - }; - /** - * The stagger index/total for a layer, resolved against the snapshot it - * belongs to. Returns index -1 when the layer is absent from that snapshot - * so the caller can skip a pseudo-element that doesn't exist. - */ - const staggerPosition = (name, type) => { - const stagger = layerStagger.get(name); - const position = type === "old" - ? stagger?.old - : type === "new" - ? stagger?.new - : // group / group-children / image-pair persist across both. - stagger?.new ?? stagger?.old; - return position ?? [-1, 1]; - }; - /** - * Merge default + per-layer transition options for a generated layer and - * resolve any stagger/delay function against this element's position. Used - * by both the morph-retiming and crop corner-radius passes. - */ - const resolveLayerTransition = (target, type, transitionName, index, total) => { - const transition = mergeTransition(getValueTransition$1(defaultOptions, transitionName), getValueTransition$1((layerOptions(target, type) ?? {}), transitionName)); - if (typeof transition.delay === "function") { - transition.delay = transition.delay(index, total); - } - return transition; - }; - /** - * Resolve a layer's group (`layout`) timing to plain WAAPI values: native - * ms `delay`/`duration` and a baked `ease`. The single source of group - * timing, shared by the generated-group retiming and the crop corner-radius - * pass so the rounded clip animates on exactly the box's timing. It returns - * no generator `type` (the WAAPI-only `NativeAnimation` rejects a string - * type) nor `repeat`/`times` (which the group's `updateTiming` ignores), so - * none of them can leak into the radius animation and desync it. - */ - const resolveGroupTiming = (name) => { - const [index, total] = staggerPosition(name, "group"); - const transition = resolveLayerTransition(layerTargets.get(name), "group", "layout", index === -1 ? 0 : index, total); - transition.duration && (transition.duration = secondsToMilliseconds(transition.duration)); - const { delay = 0, duration, ease } = applyGeneratorOptions(transition); - return { delay: secondsToMilliseconds(delay), duration, ease }; - }; - /** - * Each layer's measured box + corner radii per snapshot. The box lets - * `finalizeCrop` tell whether a morph's aspect ratio changed (the only case - * worth cropping); the radii let a cropped morph's group clip animate each - * corner from the old element's radius to the new element's, keeping it - * rounded where `overflow: clip` would otherwise square the corners. - * - * We never flatten the source for capture (a snapshot is a paint of the live - * DOM, so squaring an element just for its capture would flash one real - * square frame). For an aspect-changing morph `object-fit: cover` crops each - * snapshot's own baked corners off-screen mid-morph, so the animated clip is - * the only visible corner; a near-same-aspect forced crop (`.crop(true)`) - * can't hide the outgoing snapshot's silhouette, but the endpoints coincide. - */ - const cropMeasurements = new Map(); - const measureLayers = (phase) => nameRegistry.forEach((name, element) => { - const el = element; - const rect = el.getBoundingClientRect?.(); - if (rect && rect.height) { - const style = getComputedStyle(el); - const radii = {}; - for (const corner of cornerRadiusProps) { - radii[corner] = style[corner]; - } - const entry = cropMeasurements.get(name) ?? {}; - entry[phase] = { width: rect.width, height: rect.height, radii }; - cropMeasurements.set(name, entry); - } - }); - /** - * With both snapshots measured, settle which layers crop. The default crops - * only a morph whose aspect ratio *changes* between snapshots - the one case - * where `object-fit: cover` does real work. A same-aspect morph or a - * fade-only layer is left uncropped: its corners scale naturally (no flash - * from squaring, no `overflow: clip` eating its shadow) and a backdrop can't - * be clipped to nothing. An explicit `.crop(true | false)` overrides either - * way. Runs after both snapshots are measured, since aspect needs both. - */ - const finalizeCrop = () => { - croppedNames.clear(); - for (const name of layerStagger.keys()) { - if (name === "root") - continue; - // An explicit `.crop(true | false)` wins; otherwise crop a morph - // whose aspect ratio changed. - if (cropForName.get(name) ?? aspectChanged(name)) { - croppedNames.add(name); - } - } - }; - /** - * Whether a layer is a morph whose box aspect ratio changed between - * snapshots (beyond a small tolerance). Fade-only layers (one snapshot) are - * never "changed". - */ - const aspectChanged = (name) => { - const box = cropMeasurements.get(name); - if (!box?.old || !box?.new || !box.old.height || !box.new.height) { - return false; - } - return (Math.abs(box.old.width / box.old.height - - box.new.width / box.new.height) > ASPECT_TOLERANCE); - }; - /** - * Write the persistent view-transition CSS: suppress root capture when the - * root has no animations of its own; force linear timing (baked into the - * keyframes, so we can retime later via updateTiming); and clip + - * object-fit: cover every cropped morph (the UA default overflows on - * aspect-ratio change). - * - * `css.commit` replaces rather than appends, so we re-set the full rule set - * each call - the crop rules are only known after `finalizeCrop` runs in the - * update callback, so the second call writes them. - */ - const commitViewCSS = () => { - if (!hasTarget("root", targets)) { - css.set(":root", { "view-transition-name": "none" }); - } - css.set("::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)", { "animation-timing-function": "linear !important" }); - croppedNames.forEach((name) => { - css.set(`::view-transition-group(${name})`, { overflow: "clip" }); - css.set(`::view-transition-old(${name}), ::view-transition-new(${name})`, { width: "100%", height: "100%", "object-fit": "cover" }); - }); - /** - * Clip the nested children of any layer that clips in the live layout, - * so a wrapper crops its child for the whole morph (mirroring the DOM) - * rather than only at the live-DOM handoff. No-op on browsers without - * nested view-transition groups. - */ - clipChildren.forEach((name) => { - css.set(`::view-transition-group-children(${name})`, { - overflow: "clip", - }); - }); - css.commit(); // Write - }; - const cleanup = () => { - releaseViewTransitionNames(assigned, classed, grouped); - css.remove(); // Write - }; - const callback = async () => { - await update(); - /** - * Re-resolve so elements created by the update are named for the new - * snapshot, then measure them. With both snapshots measured we can - * settle the crop set (aspect-changing morphs + forced). - */ - resolveLayers("new"); - measureLayers("new"); - finalizeCrop(); - /** - * Re-commit the crop CSS unconditionally: `finalizeCrop` is computed - * here (after both snapshots are measured), so the clip rules must be - * (re)written to match the settled set. - */ - commitViewCSS(); - }; - let transition; - try { - resolveLayers("old"); - /** - * Measure the old snapshot against the optimistic crop set (the new - * snapshot doesn't exist yet, so aspect change can't be known here; - * `finalizeCrop` settles it post-update). - */ - measureLayers("old"); - commitViewCSS(); - transition = document.startViewTransition(callback); - } - catch (error) { - /** - * The prelude writes inline names before the transition exists. If it - * throws (e.g. startViewTransition rejects in a bad UA state), release - * them so we neither leak DOM state nor stall the queue on a promise - * that never settles - hand back a rejection it can advance past. - */ - cleanup(); - return Promise.reject(error); - } - transition.finished.finally(cleanup); - return new Promise((resolve, reject) => { - transition.ready - .then(() => { - const generatedViewAnimations = getViewAnimations(); - const animations = []; - /** - * Create animations for each of our explicitly-defined subjects. - * `opacityAnimated` additionally tracks which `${name}:${type}` - * we faded, so we can keep the UA `plus-lighter` blend only for a - * genuine opacity crossfade (both sides fading) and drop it for a - * slide/transform, where additive compositing would flash bright. - */ - const explicitlyAnimated = new Set(); - const opacityAnimated = new Set(); - layerTargets.forEach((target, name) => { - const stagger = layerStagger.get(name); - /** - * Presence: `enter` only fires for a pure newcomer (a new - * view with no old), `exit` only for a pure leaver. A - * survivor (both) gets neither - it just morphs. - */ - const enterApplies = !!stagger?.new && !stagger?.old; - const exitApplies = !!stagger?.old && !stagger?.new; - for (const key of definitionNames) { - if (!target[key]) - continue; - if (key === "enter" && !enterApplies) - continue; - if (key === "exit" && !exitApplies) - continue; - const type = chooseLayerType(key); - const [index, total] = staggerPosition(name, type); - // Skip a layer absent from its snapshot. - if (index === -1) - continue; - const { keyframes, options } = target[key]; - for (let [valueName, valueKeyframes] of Object.entries(keyframes)) { - // Skip only missing values - `0` (e.g. opacity: 0) - // is valid and must reach the from-value inference. - if (valueKeyframes == null) - continue; - /** - * The view path hands keyframes straight to WAAPI, - * so Motion's `x`/`y` shorthands (compiled to - * `transform` only via the value pipeline) have no - * effect. Warn and skip - use `transform`/`translate`. - */ - if (valueName === "x" || valueName === "y") { - warnOnce(false, `animateView() animates view-transition layers with CSS properties; the "${valueName}" shorthand has no effect - use transform, e.g. { transform: "translateX(40px)" }.`); - continue; - } - /** - * enter/exit win over new/old on a shared property - - * skip it here when the gated bucket also defines it. - */ - if (key === "new" && - enterApplies && - target.enter?.keyframes[valueName] != null) { - continue; - } - if (key === "old" && - exitApplies && - target.exit?.keyframes[valueName] != null) { - continue; - } - const valueOptions = mergeTransition(getValueTransition$1(defaultOptions, valueName), getValueTransition$1(options, valueName)); - /** - * Infer an origin for a single-value keyframe. An - * `enter` mirrors the matching `exit` value (a - * defined exit reverses into the enter for free); - * otherwise the per-type default (opacity 0/1, scale - * 0.85). No default -> left as-is (animates from the - * live value). - * - * `new`/`old` fire for survivors too, where only the - * opacity crossfade default applies - a transform - * default like scale 0.85 would pop a persisting - * element, so gate it on the layer actually - * entering/leaving. - */ - if (!Array.isArray(valueKeyframes)) { - const exitValue = key === "enter" - ? target.exit?.keyframes[valueName] - : undefined; - const allowDefault = valueName === "opacity" || - (type === "new" ? enterApplies : exitApplies); - const from = exitValue != null - ? Array.isArray(exitValue) - ? exitValue[exitValue.length - 1] - : exitValue - : allowDefault - ? ORIGIN_DEFAULTS[type]?.[valueName] - : undefined; - if (from !== undefined) { - valueKeyframes = [from, valueKeyframes]; - } - } - /** - * Resolve stagger function if provided, per element - * across this subject's resolved layers. - */ - if (typeof valueOptions.delay === "function") { - valueOptions.delay = valueOptions.delay(index, total); - } - valueOptions.duration && (valueOptions.duration = secondsToMilliseconds(valueOptions.duration)); - valueOptions.delay && (valueOptions.delay = secondsToMilliseconds(valueOptions.delay)); - animations.push(new NativeAnimation({ - ...valueOptions, - element: document.documentElement, - name: valueName, - pseudoElement: `::view-transition-${type}(${name})`, - keyframes: valueKeyframes, - })); - explicitlyAnimated.add(`${name}:${type}`); - if (valueName === "opacity") { - opacityAnimated.add(`${name}:${type}`); - } - } - } - }); - /** - * Handle browser generated animations - */ - for (const animation of generatedViewAnimations) { - if (animation.playState === "finished") - continue; - const { effect } = animation; - if (!effect || !(effect instanceof KeyframeEffect)) - continue; - const { pseudoElement } = effect; - if (!pseudoElement) - continue; - const name = getViewAnimationLayerInfo(pseudoElement); - if (!name) - continue; - const targetDefinition = layerTargets.get(name.layer); - /** - * We built our own animation for this layer, so drop the - * browser-generated fade we're replacing. The UA - * `plus-lighter` blend is a *separate* generated animation on - * the same pseudo (it sets `mix-blend-mode` in its keyframes): - * keep it *only* for a true opacity crossfade - both sides - * fading - so a symmetric crossfade composites without - * darkening, but a slide/transform (where both layers stay - * opaque and overlap) doesn't flash bright from the addition. - */ - if (explicitlyAnimated.has(`${name.layer}:${name.type}`)) { - const isCrossfade = opacityAnimated.has(`${name.layer}:new`) && - opacityAnimated.has(`${name.layer}:old`); - if (isCrossfade && - effect - .getKeyframes() - .some((keyframe) => keyframe.mixBlendMode)) { - animations.push(new NativeAnimationWrapper(animation)); - } - else { - animation.cancel(); - } - continue; - } - /** - * Drop the orphaned half of the default crossfade. The UA - * fades old out and new in as a *pair*; if the opposing half - * was explicitly overridden with something other than an - * opacity fade (a clip or transform reveal), this side's - * default opacity fade has no partner - left to run it would - * dissolve what should be a static backdrop (e.g. - * `.new({ clipPath })` should reveal over a still old view, - * not fade the old out around the growing clip). Cancel it - - * and its `plus-lighter` sibling on the same pseudo, which - * would otherwise flash bright where the two opaque layers - * overlap. A genuine crossfade (the opposing side also fading - * opacity) keeps both halves and is handled above. - */ - const opposite = name.type === "old" - ? "new" - : name.type === "new" - ? "old" - : undefined; - if (opposite && - explicitlyAnimated.has(`${name.layer}:${opposite}`) && - !opacityAnimated.has(`${name.layer}:${opposite}`)) { - animation.cancel(); - continue; - } - /** - * Otherwise retime the browser-generated animation to - * Motion's timing. This auto-enables the layout (group) - * morph for any resolved/named target, and applies the - * default timing to old/new layers we haven't explicitly - * overridden. - * - * group + group-children both follow the layout timing so - * the nesting container stays in sync with the morph. - */ - /** - * A survivor's old + new are the two halves of one - * `plus-lighter` crossfade. They must share identical timing - * (so their opacities stay mirrored and sum to 1 - else the - * additive blend flashes bright wherever both are partly - * visible) and fade linearly (the bounce belongs on the - * group's geometry, not the opacity). So time them as the - * group, rather than via their own - potentially staggered, - * or enter/exit-derived - old/new options. - */ - const stagger = layerStagger.get(name.layer); - const isMorphCrossfade = (name.type === "old" || name.type === "new") && - !!stagger?.old && - !!stagger?.new; - let timing; - if (name.type.startsWith("group")) { - // group + group-children follow the resolved group - // timing - the single source shared with the crop - // corner-radius pass below. - const { delay, duration, ease } = resolveGroupTiming(name.layer); - timing = { - delay, - duration, - easing: mapEasingToNativeEasing(ease, duration), - }; - } - else { - const timingType = isMorphCrossfade ? "group" : name.type; - const [index, total] = staggerPosition(name.layer, timingType); - const transitionName = timingType === "group" ? "layout" : ""; - let animationTransition = resolveLayerTransition(targetDefinition, timingType, transitionName, index === -1 ? 0 : index, total); - /** - * The crossfade should resolve at the spring's - * *perceptual* (visual) duration - the geometry can keep - * bouncing, but the opacity shouldn't drag through the - * settle. So capture `visualDuration` before - * `applyGeneratorOptions` replaces it with the full - * overshoot duration, and use it for the fade. - */ - const visualDuration = animationTransition.visualDuration; - animationTransition.duration && (animationTransition.duration = secondsToMilliseconds(animationTransition.duration)); - animationTransition = - applyGeneratorOptions(animationTransition); - timing = { - delay: secondsToMilliseconds(animationTransition.delay ?? 0), - duration: isMorphCrossfade && visualDuration !== undefined - ? secondsToMilliseconds(visualDuration) - : animationTransition.duration, - easing: isMorphCrossfade - ? "linear" - : mapEasingToNativeEasing(animationTransition.ease, animationTransition.duration), - }; - } - effect.updateTiming(timing); - animations.push(new NativeAnimationWrapper(animation)); - } - /** - * Round each cropped layer's clip. Its `::view-transition-group` - * has `overflow: clip`, which would otherwise square the corners - * mid-morph; animate each corner from the old element's radius to - * the new element's so the crop stays rounded. Timed as the group - * (`layout`) so the radius tracks the morphing box. - */ - cropMeasurements.forEach((entry, name) => { - if (!croppedNames.has(name)) - return; - // Reuse the group's resolved timing - native ms delay/ - // duration + a baked ease, with no generator `type` or - // repeat/times to leak into (or throw inside) NativeAnimation. - const { delay, duration, ease } = resolveGroupTiming(name); - for (const corner of cornerRadiusProps) { - // `||` (not `??`) so an empty measurement falls back to - // the other snapshot rather than an invalid keyframe. - const from = entry.old?.radii[corner] || - entry.new?.radii[corner] || - "0px"; - const to = entry.new?.radii[corner] || - entry.old?.radii[corner] || - "0px"; - // Nothing to round if the corner is square at both ends. - if (isSquareRadius(from) && isSquareRadius(to)) - continue; - animations.push(new NativeAnimation({ - element: document.documentElement, - name: corner, - pseudoElement: `::view-transition-group(${name})`, - keyframes: [from, to], - delay, - duration, - ease, - })); - } - }); - resolve(new GroupAnimation(animations)); - }) - .catch(() => - /** - * `ready` rejects when the transition is skipped - no visual - * change, or superseded by an interrupting transition. The DOM - * update still applied, so settle with no animations rather than - * surfacing it as an error to an awaiting caller. A genuine - * failure in `update()` rejects `updateCallbackDone` (already - * settled by now), so propagate that instead. - */ - transition.updateCallbackDone.then(() => resolve(new GroupAnimation([])), reject)); - }); - } - /** - * The options that should time a given generated layer type, so a retimed - * group/old/new picks up any per-target transition the user provided. Checks - * the type's buckets in priority order (e.g. `new` before `enter`). - */ - function layerOptions(target, type) { - for (const bucket of typeBuckets[type] ?? []) { - const options = target?.[bucket]?.options; - if (options) - return options; - } - } - /** - * Merge a base transition (e.g. the default `options`) with a per-layer/value - * override. An explicit `duration` on the override must win over an inherited - * generator's own timing: a spring prefers `visualDuration`, and - * `spring.applyToOptions` overwrites `duration` with the computed settle time - - * so without this the override is silently discarded. Dropping the inherited - * `type`/`visualDuration` makes the layer a plain tween of that duration, unless - * it asked for its own generator `type`/`visualDuration`. - */ - function mergeTransition(base, override) { - const merged = { ...base, ...override }; - if (override.duration !== undefined) { - if (override.visualDuration === undefined) - delete merged.visualDuration; - if (override.type === undefined) - delete merged.type; - } - return merged; - } - - let builders = []; - let current = null; - function next() { - current = null; - const [nextBuilder] = builders; - if (nextBuilder) - start(nextBuilder); - } - function start(builder) { - removeItem(builders, builder); - current = builder; - startViewAnimation(builder) - .then((animation) => { - builder.notifyReady(animation); - return animation.finished; - }) - // A genuinely failed transition (a throwing update) rejects the - // builder; a skipped/interrupted one resolves with no animations (see - // start.ts). Either way, advance the queue - else later transitions hang. - .catch((error) => builder.notifyReject(error)) - .finally(next); - } - function processQueue() { - /** - * Iterate backwards over the builders array. We can ignore the - * "wait" animations. If we have an interrupting animation in the - * queue then we need to batch all preceeding animations into it. - * Currently this only batches the update functions but will also - * need to batch the targets. - */ - for (let i = builders.length - 1; i >= 0; i--) { - const builder = builders[i]; - const { interrupt } = builder.options; - if (interrupt === "immediate") { - const batchedUpdates = builders.slice(0, i + 1).map((b) => b.update); - const remaining = builders.slice(i + 1); - builder.update = () => { - batchedUpdates.forEach((update) => update()); - }; - // Put the current builder at the front, followed by any "wait" builders - builders = [builder, ...remaining]; - break; - } - } - if (!current || builders[0]?.options.interrupt === "immediate") { - next(); - } - } - function addToQueue(builder) { - builders.push(builder); - microtask.render(processQueue); - } - - class ViewTransitionBuilder { - constructor(update, options = {}) { - this.currentSubject = "root"; - this.targets = new Map(); - /** - * Definitions that must be resolved to elements (and assigned a - * `view-transition-name`) rather than treated as pre-named layers. - */ - this.resolveDefs = new Set(); - /** - * Per-subject crop override: `true` forces the crop (clip + object-fit: - * cover + animated corner radii) on, `false` forces it off. A subject with - * no entry uses the default - crop only a genuine morph (a layer present in - * both snapshots), so a fade-only enter/exit isn't clipped to nothing. - */ - this.cropOverride = new Map(); - /** - * Subjects paired with a different new-snapshot target (the second `.add()` - * argument), so two distinct elements share one name and morph into each - * other - a shared-element transition. - */ - this.pairs = new Map(); - /** - * A `view-transition-class` to apply to each subject's resolved elements, - * so authors can target the generated layers from CSS by class rather than - * the opaque generated name. - */ - this.classNames = new Map(); - /** - * Subjects opted out of automatic group nesting via `.group(false)`. Their - * layer stays a flat top-level group (`view-transition-group: none`) instead - * of nesting under its DOM-ancestor layer - so it animates independently and - * escapes an ancestor's clip/transform (e.g. an element that lifts out of a - * card and flies across, which nesting would clip to the card). - */ - this.flatGroups = new Set(); - this.notifyReady = noop; - this.notifyReject = noop; - this.readyPromise = new Promise((resolve, reject) => { - this.notifyReady = resolve; - this.notifyReject = reject; - }); - this.update = update; - this.options = { - interrupt: "wait", - ...options, - }; - // Avoid an unhandled rejection when a failed transition has no - // `.then(_, reject)` handler attached (e.g. fire-and-forget). - this.readyPromise.catch(noop); - addToQueue(this); - } - /** - * Target elements resolved from a selector or Element, each assigned a - * `view-transition-name` automatically. - * - * Passing a second target pairs them: the first is resolved in the old - * snapshot and the second in the new, sharing one name so two *different* - * elements morph into each other (e.g. `.add(card, ".modal")`). Symmetric - - * pass them the other way round to morph back. - */ - add(subject, newSubject) { - this.currentSubject = subject; - this.resolveDefs.add(subject); - if (newSubject !== undefined) - this.pairs.set(subject, newSubject); - // Register the subject so it participates (and gets an automatic - // layout/morph animation) even without an explicit enter/exit/layout. - if (!this.targets.has(subject)) - this.targets.set(subject, {}); - return this; - } - /** - * Control this subject's crop (clip + `object-fit: cover` + animated - * corners). By default a subject auto-crops only when it actually morphs - - * present in both snapshots (a survivor, or an `.add(a, b)` pair). A - * fade-only enter/exit has no second box to crop against, so it's left to - * the browser default; in particular the `overflow: clip` a crop adds would - * otherwise clip a mis-sized enter/exit layer to nothing. - * - * `.crop(false)` forces the crop off (e.g. a text morph, where - * `object-fit: cover` clips glyphs as the box grows); `.crop(true)` forces - * it on for a non-morph the default wouldn't otherwise crop. - */ - crop(enabled = true) { - this.cropOverride.set(this.currentSubject, enabled); - return this; - } - /** - * By default a subject's layer nests under its nearest DOM-ancestor layer - * (`view-transition-group: contain`), so the ancestor's clip/transform/opacity - * apply to it through the transition - mirroring how the DOM actually paints, - * and letting a wrapper crop its child for the whole morph rather than only - * once the live DOM takes back over. (Needs a browser that supports nested - * view-transition groups; elsewhere it degrades to the flat default.) - * - * Call `.group(false)` to opt out: the layer stays flat and top-level, so it - * animates independently and escapes an ancestor's clip - e.g. an element - * that should lift out of a card and fly across, which nesting would clip. - */ - group(enabled = true) { - enabled - ? this.flatGroups.delete(this.currentSubject) - : this.flatGroups.add(this.currentSubject); - return this; - } - /** - * Tag this subject's generated layers with a `view-transition-class`, so - * they can be targeted from CSS - `::view-transition-group(.name)`, - * `::view-transition-old/new(.name)`, `::view-transition-image-pair(.name)` - * - without the opaque generated `view-transition-name`. Because `.add()` - * can match many elements, a shared class targets them all at once (and, - * for a pair, both ends). The escape hatch for z-index / custom keyframes - * on a morph layer. - */ - class(name) { - this.classNames.set(this.currentSubject, name); - return this; - } - /** - * Set the transition for this subject's morph. The morph is enabled - * automatically by `.add()`; this just customises its timing (duration, - * easing, a `delay`/`stagger`, …). On the implicit `root` subject it also - * opts the page into the transition (the root crossfade). - */ - layout(options = {}) { - this.updateTarget("layout", {}, options); - return this; - } - enter(keyframes, options) { - this.updateTarget("enter", keyframes, options); - return this; - } - exit(keyframes, options) { - this.updateTarget("exit", keyframes, options); - return this; - } - /** - * Animate the new view directly, whether the element is appearing or - * persisting (unlike `.enter()`, which only fires for a pure newcomer). - * Pair with `.old()` for a crossfade or slide-through. - */ - new(keyframes, options) { - this.updateTarget("new", keyframes, options); - return this; - } - /** - * Animate the old view directly, whether the element is leaving or - * persisting (unlike `.exit()`, which only fires for a pure leaver). - */ - old(keyframes, options) { - this.updateTarget("old", keyframes, options); - return this; - } - updateTarget(target, keyframes, options = {}) { - const { currentSubject, targets } = this; - if (!targets.has(currentSubject)) { - targets.set(currentSubject, {}); - } - const targetData = targets.get(currentSubject); - targetData[target] = { keyframes, options }; - } - then(resolve, reject) { - return this.readyPromise.then(resolve, reject); - } - } - function animateView(update, options = {}) { - return new ViewTransitionBuilder(update, options); - } - - const createAxisDelta = () => ({ - translate: 0, - scale: 1, - origin: 0, - originPoint: 0, - }); - const createDelta = () => ({ - x: createAxisDelta(), - y: createAxisDelta(), - }); - const createAxis = () => ({ min: 0, max: 0 }); - const createBox = () => ({ - x: createAxis(), - y: createAxis(), - }); - - const visualElementStore = new WeakMap(); - - function isAnimationControls(v) { - return (v !== null && - typeof v === "object" && - typeof v.start === "function"); - } - - /** - * Decides if the supplied variable is variant label - */ - function isVariantLabel(v) { - return typeof v === "string" || Array.isArray(v); - } - - const variantPriorityOrder = [ - "animate", - "whileInView", - "whileFocus", - "whileHover", - "whileTap", - "whileDrag", - "exit", - ]; - const variantProps = ["initial", ...variantPriorityOrder]; - - function isControllingVariants(props) { - return (isAnimationControls(props.animate) || - variantProps.some((name) => isVariantLabel(props[name]))); - } - function isVariantNode(props) { - return Boolean(isControllingVariants(props) || props.variants); - } - - /** - * Updates motion values from props changes. - * Uses `any` type for element to avoid circular dependencies with VisualElement. - */ - function updateMotionValuesFromProps(element, next, prev) { - for (const key in next) { - const nextValue = next[key]; - const prevValue = prev[key]; - if (isMotionValue(nextValue)) { - /** - * If this is a motion value found in props or style, we want to add it - * to our visual element's motion value map. - */ - element.addValue(key, nextValue); - } - else if (isMotionValue(prevValue)) { - /** - * If we're swapping from a motion value to a static value, - * create a new motion value from that - */ - element.addValue(key, motionValue(nextValue, { owner: element })); - } - else if (prevValue !== nextValue) { - /** - * If this is a flat value that has changed, update the motion value - * or create one if it doesn't exist. We only want to do this if we're - * not handling the value with our animation state. - */ - if (element.hasValue(key)) { - const existingValue = element.getValue(key); - if (existingValue.liveStyle === true) { - existingValue.jump(nextValue); - } - else if (!existingValue.hasAnimated) { - existingValue.set(nextValue); - } - } - else { - const latestValue = element.getStaticValue(key); - element.addValue(key, motionValue(latestValue !== undefined ? latestValue : nextValue, { owner: element })); - } - } - } - // Handle removed values - for (const key in prev) { - if (next[key] === undefined) - element.removeValue(key); - } - return next; - } - - // Does this device prefer reduced motion? Returns `null` server-side. - const prefersReducedMotion = { current: null }; - const hasReducedMotionListener = { current: false }; - - const isBrowser = typeof window !== "undefined"; - function initPrefersReducedMotion() { - hasReducedMotionListener.current = true; - if (!isBrowser) - return; - if (window.matchMedia) { - const motionMediaQuery = window.matchMedia("(prefers-reduced-motion)"); - const setReducedMotionPreferences = () => (prefersReducedMotion.current = motionMediaQuery.matches); - motionMediaQuery.addEventListener("change", setReducedMotionPreferences); - setReducedMotionPreferences(); - } - else { - prefersReducedMotion.current = false; - } - } - - const propEventHandlers = [ - "AnimationStart", - "AnimationComplete", - "Update", - "BeforeLayoutMeasure", - "LayoutMeasure", - "LayoutAnimationStart", - "LayoutAnimationComplete", - ]; - /** - * Static feature definitions - can be injected by framework layer - */ - let featureDefinitions = {}; - /** - * Set feature definitions for all VisualElements. - * This should be called by the framework layer (e.g., framer-motion) during initialization. - */ - function setFeatureDefinitions(definitions) { - featureDefinitions = definitions; - } - /** - * Get the current feature definitions - */ - function getFeatureDefinitions() { - return featureDefinitions; - } - /** - * A VisualElement is an imperative abstraction around UI elements such as - * HTMLElement, SVGElement, Three.Object3D etc. - */ - class VisualElement { - /** - * This method takes React props and returns found MotionValues. For example, HTML - * MotionValues will be found within the style prop, whereas for Three.js within attribute arrays. - * - * This isn't an abstract method as it needs calling in the constructor, but it is - * intended to be one. - */ - scrapeMotionValuesFromProps(_props, _prevProps, _visualElement) { - return {}; - } - constructor({ parent, props, presenceContext, reducedMotionConfig, skipAnimations, blockInitialAnimation, visualState, }, options = {}) { - /** - * A reference to the current underlying Instance, e.g. a HTMLElement - * or Three.Mesh etc. - */ - this.current = null; - /** - * A set containing references to this VisualElement's children. - */ - this.children = new Set(); - /** - * Determine what role this visual element should take in the variant tree. - */ - this.isVariantNode = false; - this.isControllingVariants = false; - /** - * Decides whether this VisualElement should animate in reduced motion - * mode. - * - * TODO: This is currently set on every individual VisualElement but feels - * like it could be set globally. - */ - this.shouldReduceMotion = null; - /** - * Decides whether animations should be skipped for this VisualElement. - * Useful for E2E tests and visual regression testing. - */ - this.shouldSkipAnimations = false; - /** - * A map of all motion values attached to this visual element. Motion - * values are source of truth for any given animated value. A motion - * value might be provided externally by the component via props. - */ - this.values = new Map(); - this.KeyframeResolver = KeyframeResolver; - /** - * Cleanup functions for active features (hover/tap/exit etc) - */ - this.features = {}; - /** - * A map of every subscription that binds the provided or generated - * motion values onChange listeners to this visual element. - */ - this.valueSubscriptions = new Map(); - /** - * A reference to the previously-provided motion values as returned - * from scrapeMotionValuesFromProps. We use the keys in here to determine - * if any motion values need to be removed after props are updated. - */ - this.prevMotionValues = {}; - /** - * Track whether this element has been mounted before, to detect - * remounts after Suspense unmount/remount cycles. - */ - this.hasBeenMounted = false; - /** - * An object containing a SubscriptionManager for each active event. - */ - this.events = {}; - /** - * An object containing an unsubscribe function for each prop event subscription. - * For example, every "Update" event can have multiple subscribers via - * VisualElement.on(), but only one of those can be defined via the onUpdate prop. - */ - this.propEventSubscriptions = {}; - this.notifyUpdate = () => this.notify("Update", this.latestValues); - this.render = () => { - if (!this.current) - return; - this.triggerBuild(); - this.renderInstance(this.current, this.renderState, this.props.style, this.projection); - }; - this.renderScheduledAt = 0.0; - this.scheduleRender = () => { - const now = time.now(); - if (this.renderScheduledAt < now) { - this.renderScheduledAt = now; - frame.render(this.render, false, true); - } - }; - const { latestValues, renderState } = visualState; - this.latestValues = latestValues; - this.baseTarget = { ...latestValues }; - this.initialValues = props.initial ? { ...latestValues } : {}; - this.renderState = renderState; - this.parent = parent; - this.props = props; - this.presenceContext = presenceContext; - this.depth = parent ? parent.depth + 1 : 0; - this.reducedMotionConfig = reducedMotionConfig; - this.skipAnimationsConfig = skipAnimations; - this.options = options; - this.blockInitialAnimation = Boolean(blockInitialAnimation); - this.isControllingVariants = isControllingVariants(props); - this.isVariantNode = isVariantNode(props); - if (this.isVariantNode) { - this.variantChildren = new Set(); - } - this.manuallyAnimateOnMount = Boolean(parent && parent.current); - /** - * Any motion values that are provided to the element when created - * aren't yet bound to the element, as this would technically be impure. - * However, we iterate through the motion values and set them to the - * initial values for this component. - * - * TODO: This is impure and we should look at changing this to run on mount. - * Doing so will break some tests but this isn't necessarily a breaking change, - * more a reflection of the test. - */ - const { willChange, ...initialMotionValues } = this.scrapeMotionValuesFromProps(props, {}, this); - for (const key in initialMotionValues) { - const value = initialMotionValues[key]; - if (latestValues[key] !== undefined && isMotionValue(value)) { - value.set(latestValues[key]); - } - } - } - mount(instance) { - /** - * If this element has been mounted before (e.g. after a Suspense - * unmount/remount), reset motion values to their initial state - * so animations replay correctly from initial → animate. - */ - if (this.hasBeenMounted) { - for (const key in this.initialValues) { - this.values.get(key)?.jump(this.initialValues[key]); - this.latestValues[key] = this.initialValues[key]; - } - } - this.current = instance; - visualElementStore.set(instance, this); - if (this.projection && !this.projection.instance) { - this.projection.mount(instance); - } - if (this.parent && this.isVariantNode && !this.isControllingVariants) { - this.removeFromVariantTree = this.parent.addVariantChild(this); - } - this.values.forEach((value, key) => this.bindToMotionValue(key, value)); - /** - * Determine reduced motion preference. Only initialize the matchMedia - * listener if we actually need the dynamic value (i.e., when config - * is neither "never" nor "always"). - */ - if (this.reducedMotionConfig === "never") { - this.shouldReduceMotion = false; - } - else if (this.reducedMotionConfig === "always") { - this.shouldReduceMotion = true; - } - else { - if (!hasReducedMotionListener.current) { - initPrefersReducedMotion(); - } - this.shouldReduceMotion = prefersReducedMotion.current; - } - { - warnOnce(this.shouldReduceMotion !== true, "You have Reduced Motion enabled on your device. Animations may not appear as expected.", "reduced-motion-disabled"); - } - /** - * Set whether animations should be skipped based on the config. - */ - this.shouldSkipAnimations = this.skipAnimationsConfig ?? false; - this.parent?.addChild(this); - this.update(this.props, this.presenceContext); - this.hasBeenMounted = true; - } - unmount() { - this.projection && this.projection.unmount(); - cancelFrame(this.notifyUpdate); - cancelFrame(this.render); - this.valueSubscriptions.forEach((remove) => remove()); - this.valueSubscriptions.clear(); - this.removeFromVariantTree && this.removeFromVariantTree(); - this.parent?.removeChild(this); - for (const key in this.events) { - this.events[key].clear(); - } - for (const key in this.features) { - const feature = this.features[key]; - if (feature) { - feature.unmount(); - feature.isMounted = false; - } - } - this.current = null; - } - addChild(child) { - this.children.add(child); - this.enteringChildren ?? (this.enteringChildren = new Set()); - this.enteringChildren.add(child); - } - removeChild(child) { - this.children.delete(child); - this.enteringChildren && this.enteringChildren.delete(child); - } - bindToMotionValue(key, value) { - if (this.valueSubscriptions.has(key)) { - this.valueSubscriptions.get(key)(); - } - if (value.accelerate && - acceleratedValues.has(key) && - this.current instanceof HTMLElement) { - const { factory, keyframes, times, ease, duration } = value.accelerate; - const animation = new NativeAnimation({ - element: this.current, - name: key, - keyframes, - times, - ease, - duration: secondsToMilliseconds(duration), - }); - const cleanup = factory(animation); - this.valueSubscriptions.set(key, () => { - cleanup(); - animation.cancel(); - }); - return; - } - const valueIsTransform = transformProps.has(key); - if (valueIsTransform && this.onBindTransform) { - this.onBindTransform(); - } - const removeOnChange = value.on("change", (latestValue) => { - this.latestValues[key] = latestValue; - this.props.onUpdate && frame.preRender(this.notifyUpdate); - if (valueIsTransform && this.projection) { - this.projection.isTransformDirty = true; - } - this.scheduleRender(); - }); - let removeSyncCheck; - if (typeof window !== "undefined" && - window.MotionCheckAppearSync) { - removeSyncCheck = window.MotionCheckAppearSync(this, key, value); - } - this.valueSubscriptions.set(key, () => { - removeOnChange(); - if (removeSyncCheck) - removeSyncCheck(); - // Defer to MotionValue.on("change") auto-stop so React 19 remounts - // can resubscribe before the animation is cancelled (#3315). - }); - } - sortNodePosition(other) { - /** - * If these nodes aren't even of the same type we can't compare their depth. - */ - if (!this.current || - !this.sortInstanceNodePosition || - this.type !== other.type) { - return 0; - } - return this.sortInstanceNodePosition(this.current, other.current); - } - updateFeatures() { - let key = "animation"; - for (key in featureDefinitions) { - const featureDefinition = featureDefinitions[key]; - if (!featureDefinition) - continue; - const { isEnabled, Feature: FeatureConstructor } = featureDefinition; - /** - * If this feature is enabled but not active, make a new instance. - */ - if (!this.features[key] && - FeatureConstructor && - isEnabled(this.props)) { - this.features[key] = new FeatureConstructor(this); - } - /** - * If we have a feature, mount or update it. - */ - if (this.features[key]) { - const feature = this.features[key]; - if (feature.isMounted) { - feature.update(); - } - else { - feature.mount(); - feature.isMounted = true; - } - } - } - } - triggerBuild() { - this.build(this.renderState, this.latestValues, this.props); - } - /** - * Measure the current viewport box with or without transforms. - * Only measures axis-aligned boxes, rotate and skew must be manually - * removed with a re-render to work. - */ - measureViewportBox() { - return this.current - ? this.measureInstanceViewportBox(this.current, this.props) - : createBox(); - } - getStaticValue(key) { - return this.latestValues[key]; - } - setStaticValue(key, value) { - this.latestValues[key] = value; - } - /** - * Update the provided props. Ensure any newly-added motion values are - * added to our map, old ones removed, and listeners updated. - */ - update(props, presenceContext) { - if (props.transformTemplate || this.props.transformTemplate) { - this.scheduleRender(); - } - this.prevProps = this.props; - this.props = props; - this.prevPresenceContext = this.presenceContext; - this.presenceContext = presenceContext; - /** - * Update prop event handlers ie onAnimationStart, onAnimationComplete - */ - for (let i = 0; i < propEventHandlers.length; i++) { - const key = propEventHandlers[i]; - if (this.propEventSubscriptions[key]) { - this.propEventSubscriptions[key](); - delete this.propEventSubscriptions[key]; - } - const listenerName = ("on" + key); - const listener = props[listenerName]; - if (listener) { - this.propEventSubscriptions[key] = this.on(key, listener); - } - } - this.prevMotionValues = updateMotionValuesFromProps(this, this.scrapeMotionValuesFromProps(props, this.prevProps || {}, this), this.prevMotionValues); - if (this.handleChildMotionValue) { - this.handleChildMotionValue(); - } - } - getProps() { - return this.props; - } - /** - * Returns the variant definition with a given name. - */ - getVariant(name) { - return this.props.variants ? this.props.variants[name] : undefined; - } - /** - * Returns the defined default transition on this component. - */ - getDefaultTransition() { - return this.props.transition; - } - getTransformPagePoint() { - return this.props.transformPagePoint; - } - getClosestVariantNode() { - return this.isVariantNode - ? this - : this.parent - ? this.parent.getClosestVariantNode() - : undefined; - } - /** - * Add a child visual element to our set of children. - */ - addVariantChild(child) { - const closestVariantNode = this.getClosestVariantNode(); - if (closestVariantNode) { - closestVariantNode.variantChildren && - closestVariantNode.variantChildren.add(child); - return () => closestVariantNode.variantChildren.delete(child); - } - } - /** - * Add a motion value and bind it to this visual element. - */ - addValue(key, value) { - // Remove existing value if it exists - const existingValue = this.values.get(key); - if (value !== existingValue) { - if (existingValue) - this.removeValue(key); - this.bindToMotionValue(key, value); - this.values.set(key, value); - this.latestValues[key] = value.get(); - } - } - /** - * Remove a motion value and unbind any active subscriptions. - */ - removeValue(key) { - this.values.delete(key); - const unsubscribe = this.valueSubscriptions.get(key); - if (unsubscribe) { - unsubscribe(); - this.valueSubscriptions.delete(key); - } - delete this.latestValues[key]; - this.removeValueFromRenderState(key, this.renderState); - } - /** - * Check whether we have a motion value for this key - */ - hasValue(key) { - return this.values.has(key); - } - getValue(key, defaultValue) { - if (this.props.values && this.props.values[key]) { - return this.props.values[key]; - } - let value = this.values.get(key); - if (value === undefined && defaultValue !== undefined) { - value = motionValue(defaultValue === null ? undefined : defaultValue, { owner: this }); - this.addValue(key, value); - } - return value; - } - /** - * If we're trying to animate to a previously unencountered value, - * we need to check for it in our state and as a last resort read it - * directly from the instance (which might have performance implications). - */ - readValue(key, target) { - let value = this.latestValues[key] !== undefined || !this.current - ? this.latestValues[key] - : this.getBaseTargetFromProps(this.props, key) ?? - this.readValueFromInstance(this.current, key, this.options); - if (value !== undefined && value !== null) { - if (typeof value === "string" && - (isNumericalString(value) || isZeroValueString(value))) { - // If this is a number read as a string, ie "0" or "200", convert it to a number - value = parseFloat(value); - } - else if (!findValueType(value) && complex.test(target)) { - value = getAnimatableNone(key, target); - } - this.setBaseTarget(key, isMotionValue(value) ? value.get() : value); - } - return isMotionValue(value) ? value.get() : value; - } - /** - * Set the base target to later animate back to. This is currently - * only hydrated on creation and when we first read a value. - */ - setBaseTarget(key, value) { - this.baseTarget[key] = value; - } - /** - * Find the base target for a value thats been removed from all animation - * props. - */ - getBaseTarget(key) { - const { initial } = this.props; - let valueFromInitial; - if (typeof initial === "string" || typeof initial === "object") { - const variant = resolveVariantFromProps(this.props, initial, this.presenceContext?.custom); - if (variant) { - valueFromInitial = variant[key]; - } - } - /** - * If this value still exists in the current initial variant, read that. - */ - if (initial && valueFromInitial !== undefined) { - return valueFromInitial; - } - /** - * Alternatively, if this VisualElement config has defined a getBaseTarget - * so we can read the value from an alternative source, try that. - */ - const target = this.getBaseTargetFromProps(this.props, key); - if (target !== undefined && !isMotionValue(target)) - return target; - /** - * If the value was initially defined on initial, but it doesn't any more, - * return undefined. Otherwise return the value as initially read from the DOM. - */ - return this.initialValues[key] !== undefined && - valueFromInitial === undefined - ? undefined - : this.baseTarget[key]; - } - on(eventName, callback) { - if (!this.events[eventName]) { - this.events[eventName] = new SubscriptionManager(); - } - return this.events[eventName].add(callback); - } - notify(eventName, ...args) { - if (this.events[eventName]) { - this.events[eventName].notify(...args); - } - } - scheduleRenderMicrotask() { - microtask.render(this.render); - } - } - - class DOMVisualElement extends VisualElement { - constructor() { - super(...arguments); - this.KeyframeResolver = DOMKeyframesResolver; - } - sortInstanceNodePosition(a, b) { - /** - * compareDocumentPosition returns a bitmask, by using the bitwise & - * we're returning true if 2 in that bitmask is set to true. 2 is set - * to true if b preceeds a. - */ - return a.compareDocumentPosition(b) & 2 ? 1 : -1; - } - getBaseTargetFromProps(props, key) { - const style = props.style; - return style ? style[key] : undefined; - } - removeValueFromRenderState(key, { vars, style }) { - delete vars[key]; - delete style[key]; - } - handleChildMotionValue() { - if (this.childSubscription) { - this.childSubscription(); - delete this.childSubscription; - } - const { children } = this.props; - if (isMotionValue(children)) { - this.childSubscription = children.on("change", (latest) => { - if (this.current) { - this.current.textContent = `${latest}`; - } - }); - } - } - } - - /** - * Feature base class for extending VisualElement functionality. - * Features are plugins that can be mounted/unmounted to add behavior - * like gestures, animations, or layout tracking. - */ - class Feature { - constructor(node) { - this.isMounted = false; - this.node = node; - } - update() { } - } - - /** - * Bounding boxes tend to be defined as top, left, right, bottom. For various operations - * it's easier to consider each axis individually. This function returns a bounding box - * as a map of single-axis min/max values. - */ - function convertBoundingBoxToBox({ top, left, right, bottom, }) { - return { - x: { min: left, max: right }, - y: { min: top, max: bottom }, - }; - } - function convertBoxToBoundingBox({ x, y }) { - return { top: y.min, right: x.max, bottom: y.max, left: x.min }; - } - /** - * Applies a TransformPoint function to a bounding box. TransformPoint is usually a function - * provided by Framer to allow measured points to be corrected for device scaling. This is used - * when measuring DOM elements and DOM event points. - */ - function transformBoxPoints(point, transformPoint) { - if (!transformPoint) - return point; - const topLeft = transformPoint({ x: point.left, y: point.top }); - const bottomRight = transformPoint({ x: point.right, y: point.bottom }); - return { - top: topLeft.y, - left: topLeft.x, - bottom: bottomRight.y, - right: bottomRight.x, - }; - } - - function isIdentityScale(scale) { - return scale === undefined || scale === 1; - } - function hasScale({ scale, scaleX, scaleY }) { - return (!isIdentityScale(scale) || - !isIdentityScale(scaleX) || - !isIdentityScale(scaleY)); - } - function hasTransform(values) { - return (hasScale(values) || - has2DTranslate(values) || - values.z || - values.rotate || - values.rotateX || - values.rotateY || - values.skewX || - values.skewY); - } - function has2DTranslate(values) { - return is2DTranslate(values.x) || is2DTranslate(values.y); - } - function is2DTranslate(value) { - return value && value !== "0%"; - } - - /** - * Scales a point based on a factor and an originPoint - */ - function scalePoint(point, scale, originPoint) { - const distanceFromOrigin = point - originPoint; - const scaled = scale * distanceFromOrigin; - return originPoint + scaled; - } - /** - * Applies a translate/scale delta to a point - */ - function applyPointDelta(point, translate, scale, originPoint, boxScale) { - if (boxScale !== undefined) { - point = scalePoint(point, boxScale, originPoint); - } - return scalePoint(point, scale, originPoint) + translate; - } - /** - * Applies a translate/scale delta to an axis - */ - function applyAxisDelta(axis, translate = 0, scale = 1, originPoint, boxScale) { - axis.min = applyPointDelta(axis.min, translate, scale, originPoint, boxScale); - axis.max = applyPointDelta(axis.max, translate, scale, originPoint, boxScale); - } - /** - * Applies a translate/scale delta to a box - */ - function applyBoxDelta(box, { x, y }) { - applyAxisDelta(box.x, x.translate, x.scale, x.originPoint); - applyAxisDelta(box.y, y.translate, y.scale, y.originPoint); - } - const TREE_SCALE_SNAP_MIN = 0.999999999999; - const TREE_SCALE_SNAP_MAX = 1.0000000000001; - /** - * Apply a tree of deltas to a box. We do this to calculate the effect of all the transforms - * in a tree upon our box before then calculating how to project it into our desired viewport-relative box - * - * This is the final nested loop within updateLayoutDelta for future refactoring - */ - function applyTreeDeltas(box, treeScale, treePath, isSharedTransition = false) { - const treeLength = treePath.length; - if (!treeLength) - return; - // Reset the treeScale - treeScale.x = treeScale.y = 1; - let node; - let delta; - for (let i = 0; i < treeLength; i++) { - node = treePath[i]; - delta = node.projectionDelta; - /** - * TODO: Prefer to remove this, but currently we have motion components with - * display: contents in Framer. - */ - const { visualElement } = node.options; - if (visualElement && - visualElement.props.style && - visualElement.props.style.display === "contents") { - continue; - } - if (isSharedTransition && - node.options.layoutScroll && - node.scroll && - node !== node.root) { - translateAxis(box.x, -node.scroll.offset.x); - translateAxis(box.y, -node.scroll.offset.y); - } - if (delta) { - // Incoporate each ancestor's scale into a cumulative treeScale for this component - treeScale.x *= delta.x.scale; - treeScale.y *= delta.y.scale; - // Apply each ancestor's calculated delta into this component's recorded layout box - applyBoxDelta(box, delta); - } - if (isSharedTransition && hasTransform(node.latestValues)) { - transformBox(box, node.latestValues, node.layout?.layoutBox); - } - } - /** - * Snap tree scale back to 1 if it's within a non-perceivable threshold. - * This will help reduce useless scales getting rendered. - */ - if (treeScale.x < TREE_SCALE_SNAP_MAX && - treeScale.x > TREE_SCALE_SNAP_MIN) { - treeScale.x = 1.0; - } - if (treeScale.y < TREE_SCALE_SNAP_MAX && - treeScale.y > TREE_SCALE_SNAP_MIN) { - treeScale.y = 1.0; - } - } - function translateAxis(axis, distance) { - axis.min += distance; - axis.max += distance; - } - /** - * Apply a transform to an axis from the latest resolved motion values. - * This function basically acts as a bridge between a flat motion value map - * and applyAxisDelta - */ - function transformAxis(axis, axisTranslate, axisScale, boxScale, axisOrigin = 0.5) { - const originPoint = mixNumber$1(axis.min, axis.max, axisOrigin); - // Apply the axis delta to the final axis - applyAxisDelta(axis, axisTranslate, axisScale, originPoint, boxScale); - } - function resolveAxisTranslate(value, axis) { - if (typeof value === "string") { - return (parseFloat(value) / 100) * (axis.max - axis.min); - } - return value; - } - /** - * Apply a transform to a box from the latest resolved motion values. - */ - function transformBox(box, transform, sourceBox) { - const resolveBox = sourceBox ?? box; - transformAxis(box.x, resolveAxisTranslate(transform.x, resolveBox.x), transform.scaleX, transform.scale, transform.originX); - transformAxis(box.y, resolveAxisTranslate(transform.y, resolveBox.y), transform.scaleY, transform.scale, transform.originY); - } - - function measureViewportBox(instance, transformPoint) { - return convertBoundingBoxToBox(transformBoxPoints(instance.getBoundingClientRect(), transformPoint)); - } - function measurePageBox(element, rootProjectionNode, transformPagePoint) { - const viewportBox = measureViewportBox(element, transformPagePoint); - const { scroll } = rootProjectionNode; - if (scroll) { - translateAxis(viewportBox.x, scroll.offset.x); - translateAxis(viewportBox.y, scroll.offset.y); - } - return viewportBox; - } - - const translateAlias = { - x: "translateX", - y: "translateY", - z: "translateZ", - transformPerspective: "perspective", - }; - const numTransforms = transformPropOrder.length; - /** - * Build a CSS transform style from individual x/y/scale etc properties. - * - * This outputs with a default order of transforms/scales/rotations, this can be customised by - * providing a transformTemplate function. - */ - function buildTransform(latestValues, transform, transformTemplate) { - // The transform string we're going to build into. - let transformString = ""; - let transformIsDefault = true; - /** - * Loop over all possible transforms in order, adding the ones that - * are present to the transform string. - */ - for (let i = 0; i < numTransforms; i++) { - const key = transformPropOrder[i]; - const value = latestValues[key]; - if (value === undefined) - continue; - let valueIsDefault = true; - if (typeof value === "number") { - valueIsDefault = value === (key.startsWith("scale") ? 1 : 0); - } - else { - const parsed = parseFloat(value); - valueIsDefault = key.startsWith("scale") ? parsed === 1 : parsed === 0; - } - if (!valueIsDefault || transformTemplate) { - const valueAsType = getValueAsType(value, numberValueTypes[key]); - if (!valueIsDefault) { - transformIsDefault = false; - const transformName = translateAlias[key] || key; - transformString += `${transformName}(${valueAsType}) `; - } - if (transformTemplate) { - transform[key] = valueAsType; - } - } - } - // `pathRotation` composes onto `rotate` as a separate additive term so - // the user's `rotate` is never clobbered. Deliberately not a slot in - // `transformPropOrder`. - const pathRotation = latestValues.pathRotation; - if (pathRotation) { - transformIsDefault = false; - transformString += `rotate(${getValueAsType(pathRotation, numberValueTypes.pathRotation)}) `; - } - transformString = transformString.trim(); - // If we have a custom `transform` template, pass our transform values and - // generated transformString to that before returning - if (transformTemplate) { - transformString = transformTemplate(transform, transformIsDefault ? "" : transformString); - } - else if (transformIsDefault) { - transformString = "none"; - } - return transformString; - } - - function buildHTMLStyles(state, latestValues, transformTemplate) { - const { style, vars, transformOrigin } = state; - // Track whether we encounter any transform or transformOrigin values. - let hasTransform = false; - let hasTransformOrigin = false; - /** - * Loop over all our latest animated values and decide whether to handle them - * as a style or CSS variable. - * - * Transforms and transform origins are kept separately for further processing. - */ - for (const key in latestValues) { - const value = latestValues[key]; - if (transformProps.has(key)) { - // If this is a transform, flag to enable further transform processing - hasTransform = true; - continue; - } - else if (isCSSVariableName(key)) { - vars[key] = value; - continue; - } - else { - // Convert the value to its default value type, ie 0 -> "0px" - const valueAsType = getValueAsType(value, numberValueTypes[key]); - if (key.startsWith("origin")) { - // If this is a transform origin, flag and enable further transform-origin processing - hasTransformOrigin = true; - transformOrigin[key] = - valueAsType; - } - else { - style[key] = valueAsType; - } - } - } - if (!latestValues.transform) { - if (hasTransform || transformTemplate) { - style.transform = buildTransform(latestValues, state.transform, transformTemplate); - } - else if (style.transform) { - /** - * If we have previously created a transform but currently don't have any, - * reset transform style to none. - */ - style.transform = "none"; - } - } - /** - * Build a transformOrigin style. Uses the same defaults as the browser for - * undefined origins. - */ - if (hasTransformOrigin) { - const { originX = "50%", originY = "50%", originZ = 0, } = transformOrigin; - style.transformOrigin = `${originX} ${originY} ${originZ}`; - } - } - - function renderHTML(element, { style, vars }, styleProp, projection) { - const elementStyle = element.style; - let key; - for (key in style) { - // CSSStyleDeclaration has [index: number]: string; in the types, so we use that as key type. - elementStyle[key] = style[key]; - } - // Write projection styles directly to element style - projection?.applyProjectionStyles(elementStyle, styleProp); - for (key in vars) { - // Loop over any CSS variables and assign those. - // They can only be assigned using `setProperty`. - elementStyle.setProperty(key, vars[key]); - } - } - - function pixelsToPercent(pixels, axis) { - if (axis.max === axis.min) - return 0; - return (pixels / (axis.max - axis.min)) * 100; - } - /** - * We always correct borderRadius as a percentage rather than pixels to reduce paints. - * For example, if you are projecting a box that is 100px wide with a 10px borderRadius - * into a box that is 200px wide with a 20px borderRadius, that is actually a 10% - * borderRadius in both states. If we animate between the two in pixels that will trigger - * a paint each time. If we animate between the two in percentage we'll avoid a paint. - */ - const correctBorderRadius = { - correct: (latest, node) => { - if (!node.target) - return latest; - /** - * If latest is a string, if it's a percentage we can return immediately as it's - * going to be stretched appropriately. Otherwise, if it's a pixel, convert it to a number. - */ - if (typeof latest === "string") { - if (px.test(latest)) { - latest = parseFloat(latest); - } - else { - return latest; - } - } - /** - * If latest is a number, it's a pixel value. We use the current viewportBox to calculate that - * pixel value as a percentage of each axis - */ - const x = pixelsToPercent(latest, node.target.x); - const y = pixelsToPercent(latest, node.target.y); - return `${x}% ${y}%`; - }, - }; - - const correctBoxShadow = { - correct: (latest, { treeScale, projectionDelta }) => { - const original = latest; - const shadow = complex.parse(latest); - // TODO: Doesn't support multiple shadows - if (shadow.length > 5) - return original; - const template = complex.createTransformer(latest); - const offset = typeof shadow[0] !== "number" ? 1 : 0; - // Calculate the overall context scale - const xScale = projectionDelta.x.scale * treeScale.x; - const yScale = projectionDelta.y.scale * treeScale.y; - shadow[0 + offset] /= xScale; - shadow[1 + offset] /= yScale; - /** - * Ideally we'd correct x and y scales individually, but because blur and - * spread apply to both we have to take a scale average and apply that instead. - * We could potentially improve the outcome of this by incorporating the ratio between - * the two scales. - */ - const averageScale = mixNumber$1(xScale, yScale, 0.5); - // Blur - if (typeof shadow[2 + offset] === "number") - shadow[2 + offset] /= averageScale; - // Spread - if (typeof shadow[3 + offset] === "number") - shadow[3 + offset] /= averageScale; - return template(shadow); - }, - }; - - const scaleCorrectors = { - borderRadius: { - ...correctBorderRadius, - applyTo: [...cornerRadiusProps], - }, - borderTopLeftRadius: correctBorderRadius, - borderTopRightRadius: correctBorderRadius, - borderBottomLeftRadius: correctBorderRadius, - borderBottomRightRadius: correctBorderRadius, - boxShadow: correctBoxShadow, - }; - function addScaleCorrector(correctors) { - for (const key in correctors) { - scaleCorrectors[key] = correctors[key]; - if (isCSSVariableName(key)) { - scaleCorrectors[key].isCSSVariable = true; - } - } - } - - function isForcedMotionValue(key, { layout, layoutId }) { - return (transformProps.has(key) || - key.startsWith("origin") || - ((layout || layoutId !== undefined) && - (!!scaleCorrectors[key] || key === "opacity"))); - } - - function scrapeMotionValuesFromProps$1(props, prevProps, visualElement) { - const style = props.style; - const prevStyle = prevProps?.style; - const newValues = {}; - if (!style) - return newValues; - for (const key in style) { - if (isMotionValue(style[key]) || - (prevStyle && isMotionValue(prevStyle[key])) || - isForcedMotionValue(key, props) || - visualElement?.getValue(key)?.liveStyle !== undefined) { - newValues[key] = style[key]; - } - } - return newValues; - } - - function getComputedStyle$1(element) { - return window.getComputedStyle(element); - } - class HTMLVisualElement extends DOMVisualElement { - constructor() { - super(...arguments); - this.type = "html"; - this.renderInstance = renderHTML; - } - mount(instance) { - /** - * If a custom component forwards its ref to something other than a - * HTML/SVG element (a class instance, an imperative handle) there's - * nothing for Motion to style, measure or attach gestures to. #2777 - */ - exports.invariant(Boolean(instance.style), "motion.create() components must forward their ref to a HTML or SVG element", "custom-component-ref"); - super.mount(instance); - } - readValueFromInstance(instance, key) { - if (transformProps.has(key)) { - return this.projection?.isProjecting - ? defaultTransformValue(key) - : readTransformValue(instance, key); - } - else { - const computedStyle = getComputedStyle$1(instance); - const value = (isCSSVariableName(key) - ? computedStyle.getPropertyValue(key) - : computedStyle[key]) || 0; - return typeof value === "string" ? value.trim() : value; - } - } - measureInstanceViewportBox(instance, { transformPagePoint }) { - return measureViewportBox(instance, transformPagePoint); - } - build(renderState, latestValues, props) { - buildHTMLStyles(renderState, latestValues, props.transformTemplate); - } - scrapeMotionValuesFromProps(props, prevProps, visualElement) { - return scrapeMotionValuesFromProps$1(props, prevProps, visualElement); - } - } - - function isObjectKey(key, object) { - return key in object; - } - class ObjectVisualElement extends VisualElement { - constructor() { - super(...arguments); - this.type = "object"; - } - readValueFromInstance(instance, key) { - if (isObjectKey(key, instance)) { - const value = instance[key]; - if (typeof value === "string" || typeof value === "number") { - return value; - } - } - return undefined; - } - getBaseTargetFromProps() { - return undefined; - } - removeValueFromRenderState(key, renderState) { - delete renderState.output[key]; - } - measureInstanceViewportBox() { - return createBox(); - } - build(renderState, latestValues) { - Object.assign(renderState.output, latestValues); - } - renderInstance(instance, { output }) { - Object.assign(instance, output); - } - sortInstanceNodePosition() { - return 0; - } - } - - const dashKeys = { - offset: "stroke-dashoffset", - array: "stroke-dasharray", - }; - const camelKeys = { - offset: "strokeDashoffset", - array: "strokeDasharray", - }; - /** - * Build SVG path properties. Uses the path's measured length to convert - * our custom pathLength, pathSpacing and pathOffset into stroke-dashoffset - * and stroke-dasharray attributes. - * - * This function is mutative to reduce per-frame GC. - * - * Note: We use unitless values for stroke-dasharray and stroke-dashoffset - * because Safari incorrectly scales px values when the page is zoomed. - */ - function buildSVGPath(attrs, length, spacing = 1, offset = 0, useDashCase = true) { - // Normalise path length by setting SVG attribute pathLength to 1 - attrs.pathLength = 1; - // We use dash case when setting attributes directly to the DOM node and camel case - // when defining props on a React component. - const keys = useDashCase ? dashKeys : camelKeys; - // Build the dash offset (unitless to avoid Safari zoom bug) - attrs[keys.offset] = `${-offset}`; - // Build the dash array (unitless to avoid Safari zoom bug) - attrs[keys.array] = `${length} ${spacing}`; - } - - const cssStyleProperties = [ - "transform", - "opacity", - "offsetDistance", - "offsetPath", - "offsetRotate", - "offsetAnchor", - ]; - /** - * Build SVG visual attributes, like cx and style.transform - */ - function buildSVGAttrs(state, { attrX, attrY, attrScale, pathLength, pathSpacing = 1, pathOffset = 0, - // This is object creation, which we try to avoid per-frame. - ...latest }, isSVGTag, transformTemplate, styleProp) { - buildHTMLStyles(state, latest, transformTemplate); - /** - * For svg tags we just want to make sure viewBox is animatable and treat all the styles - * as normal HTML tags. - */ - if (isSVGTag) { - if (state.style.viewBox) { - state.attrs.viewBox = state.style.viewBox; - } - return; - } - state.attrs = state.style; - state.style = {}; - const { attrs, style } = state; - for (const key of cssStyleProperties) { - if (attrs[key] !== undefined) { - style[key] = attrs[key]; - delete attrs[key]; - } - } - if (style.transform || attrs.transformOrigin) { - style.transformOrigin = attrs.transformOrigin ?? "50% 50%"; - delete attrs.transformOrigin; - } - if (style.transform) { - /** - * SVG's element transform-origin uses its own median as a reference. - * Therefore, transformBox becomes a fill-box - */ - style.transformBox = styleProp?.transformBox ?? "fill-box"; - delete attrs.transformBox; - } - // Render attrX/attrY/attrScale as attributes - if (attrX !== undefined) - attrs.x = attrX; - if (attrY !== undefined) - attrs.y = attrY; - if (attrScale !== undefined) - attrs.scale = attrScale; - // Build SVG path if one has been defined - if (pathLength !== undefined) { - buildSVGPath(attrs, pathLength, pathSpacing, pathOffset, false); - } - } - - /** - * A set of attribute names that are always read/written as camel case. - */ - const camelCaseAttributes = new Set([ - "baseFrequency", - "diffuseConstant", - "kernelMatrix", - "kernelUnitLength", - "keySplines", - "keyTimes", - "limitingConeAngle", - "markerHeight", - "markerWidth", - "numOctaves", - "targetX", - "targetY", - "surfaceScale", - "specularConstant", - "specularExponent", - "stdDeviation", - "tableValues", - "viewBox", - "gradientTransform", - "pathLength", - "startOffset", - "textLength", - "lengthAdjust", - ]); - - const isSVGTag = (tag) => typeof tag === "string" && tag.toLowerCase() === "svg"; - - function renderSVG(element, renderState, _styleProp, projection) { - renderHTML(element, renderState, undefined, projection); - for (const key in renderState.attrs) { - element.setAttribute(!camelCaseAttributes.has(key) ? camelToDash(key) : key, renderState.attrs[key]); - } - } - - function scrapeMotionValuesFromProps(props, prevProps, visualElement) { - const newValues = scrapeMotionValuesFromProps$1(props, prevProps, visualElement); - for (const key in props) { - if (isMotionValue(props[key]) || - isMotionValue(prevProps[key])) { - const targetKey = transformPropOrder.indexOf(key) !== -1 - ? "attr" + key.charAt(0).toUpperCase() + key.substring(1) - : key; - newValues[targetKey] = props[key]; - } - } - return newValues; - } - - class SVGVisualElement extends DOMVisualElement { - constructor() { - super(...arguments); - this.type = "svg"; - this.isSVGTag = false; - this.measureInstanceViewportBox = createBox; - } - getBaseTargetFromProps(props, key) { - return props[key]; - } - readValueFromInstance(instance, key) { - if (transformProps.has(key)) { - const defaultType = getDefaultValueType(key); - return defaultType ? defaultType.default || 0 : 0; - } - if (cssStyleProperties.includes(key)) { - const computedStyle = getComputedStyle(instance); - const value = computedStyle[key]; - if (typeof value === "string" && value) - return value.trim(); - } - key = !camelCaseAttributes.has(key) ? camelToDash(key) : key; - return instance.getAttribute(key); - } - scrapeMotionValuesFromProps(props, prevProps, visualElement) { - return scrapeMotionValuesFromProps(props, prevProps, visualElement); - } - build(renderState, latestValues, props) { - buildSVGAttrs(renderState, latestValues, this.isSVGTag, props.transformTemplate, props.style); - } - renderInstance(instance, renderState, styleProp, projection) { - renderSVG(instance, renderState, styleProp, projection); - } - mount(instance) { - this.isSVGTag = isSVGTag(instance.tagName); - super.mount(instance); - } - } - - const numVariantProps = variantProps.length; - /** - * Get variant context from a visual element's parent chain. - * Uses `any` type for visualElement to avoid circular dependencies. - */ - function getVariantContext(visualElement) { - if (!visualElement) - return undefined; - if (!visualElement.isControllingVariants) { - const context = visualElement.parent - ? getVariantContext(visualElement.parent) || {} - : {}; - if (visualElement.props.initial !== undefined) { - context.initial = visualElement.props.initial; - } - return context; - } - const context = {}; - for (let i = 0; i < numVariantProps; i++) { - const name = variantProps[i]; - const prop = visualElement.props[name]; - if (isVariantLabel(prop) || prop === false) { - context[name] = prop; - } - } - return context; - } - - function shallowCompare(next, prev) { - if (!Array.isArray(prev)) - return false; - const prevLength = prev.length; - if (prevLength !== next.length) - return false; - for (let i = 0; i < prevLength; i++) { - if (prev[i] !== next[i]) - return false; - } - return true; - } - - const reversePriorityOrder = [...variantPriorityOrder].reverse(); - const numAnimationTypes = variantPriorityOrder.length; - function createAnimateFunction(visualElement) { - return (animations) => { - return Promise.all(animations.map(({ animation, options }) => animateVisualElement(visualElement, animation, options))); - }; - } - function createAnimationState(visualElement) { - let animate = createAnimateFunction(visualElement); - let state = createState(); - let isInitialRender = true; - /** - * Track whether the animation state has been reset (e.g. via StrictMode - * double-invocation or Suspense unmount/remount). On the first - * animateChanges() call after a reset we need to behave like the initial - * render for variant-inheritance checks, even though isInitialRender is - * already false. - */ - let wasReset = false; - /** - * This function will be used to reduce the animation definitions for - * each active animation type into an object of resolved values for it. - */ - const buildResolvedTypeValues = (type) => (acc, definition) => { - const resolved = resolveVariant(visualElement, definition, type === "exit" - ? visualElement.presenceContext?.custom - : undefined); - if (resolved) { - const { transition, transitionEnd, ...target } = resolved; - acc = { ...acc, ...target, ...transitionEnd }; - } - return acc; - }; - /** - * This just allows us to inject mocked animation functions - * @internal - */ - function setAnimateFunction(makeAnimator) { - animate = makeAnimator(visualElement); - } - /** - * When we receive new props, we need to: - * 1. Create a list of protected keys for each type. This is a directory of - * value keys that are currently being "handled" by types of a higher priority - * so that whenever an animation is played of a given type, these values are - * protected from being animated. - * 2. Determine if an animation type needs animating. - * 3. Determine if any values have been removed from a type and figure out - * what to animate those to. - */ - function animateChanges(changedActiveType) { - const { props } = visualElement; - const context = getVariantContext(visualElement.parent) || {}; - /** - * A list of animations that we'll build into as we iterate through the animation - * types. This will get executed at the end of the function. - */ - const animations = []; - /** - * Keep track of which values have been removed. Then, as we hit lower priority - * animation types, we can check if they contain removed values and animate to that. - */ - const removedKeys = new Set(); - /** - * A dictionary of all encountered keys. This is an object to let us build into and - * copy it without iteration. Each time we hit an animation type we set its protected - * keys - the keys its not allowed to animate - to the latest version of this object. - */ - let encounteredKeys = {}; - /** - * If a variant has been removed at a given index, and this component is controlling - * variant animations, we want to ensure lower-priority variants are forced to animate. - */ - let removedVariantIndex = Infinity; - /** - * Iterate through all animation types in reverse priority order. For each, we want to - * detect which values it's handling and whether or not they've changed (and therefore - * need to be animated). If any values have been removed, we want to detect those in - * lower priority props and flag for animation. - */ - for (let i = 0; i < numAnimationTypes; i++) { - const type = reversePriorityOrder[i]; - const typeState = state[type]; - const prop = props[type] !== undefined - ? props[type] - : context[type]; - const propIsVariant = isVariantLabel(prop); - /** - * If this type has *just* changed isActive status, set activeDelta - * to that status. Otherwise set to null. - */ - const activeDelta = type === changedActiveType ? typeState.isActive : null; - if (activeDelta === false) - removedVariantIndex = i; - /** - * If this prop is an inherited variant, rather than been set directly on the - * component itself, we want to make sure we allow the parent to trigger animations. - * - * TODO: Can probably change this to a !isControllingVariants check - */ - let isInherited = prop === context[type] && - prop !== props[type] && - propIsVariant; - if (isInherited && - (isInitialRender || wasReset) && - visualElement.manuallyAnimateOnMount) { - isInherited = false; - } - /** - * Set all encountered keys so far as the protected keys for this type. This will - * be any key that has been animated or otherwise handled by active, higher-priortiy types. - */ - typeState.protectedKeys = { ...encounteredKeys }; - // Check if we can skip analysing this prop early - if ( - // If it isn't active and hasn't *just* been set as inactive - (!typeState.isActive && activeDelta === null) || - // If we didn't and don't have any defined prop for this animation type - (!prop && !typeState.prevProp) || - // Or if the prop doesn't define an animation - isAnimationControls(prop) || - typeof prop === "boolean") { - continue; - } - /** - * If exit is already active and wasn't just activated, skip - * re-processing to prevent interrupting running exit animations. - * Re-resolving exit with a changed custom value can start new - * value animations that stop the originals, leaving the exit - * animation promise unresolved and the component stuck in the DOM. - */ - if (type === "exit" && typeState.isActive && activeDelta !== true) { - if (typeState.prevResolvedValues) { - encounteredKeys = { - ...encounteredKeys, - ...typeState.prevResolvedValues, - }; - } - continue; - } - /** - * As we go look through the values defined on this type, if we detect - * a changed value or a value that was removed in a higher priority, we set - * this to true and add this prop to the animation list. - */ - const variantDidChange = checkVariantsDidChange(typeState.prevProp, prop); - let shouldAnimateType = variantDidChange || - // If we're making this variant active, we want to always make it active - (type === changedActiveType && - typeState.isActive && - !isInherited && - propIsVariant) || - // If we removed a higher-priority variant (i is in reverse order) - (i > removedVariantIndex && propIsVariant); - let handledRemovedValues = false; - /** - * As animations can be set as variant lists, variants or target objects, we - * coerce everything to an array if it isn't one already - */ - const definitionList = Array.isArray(prop) ? prop : [prop]; - /** - * Build an object of all the resolved values. We'll use this in the subsequent - * animateChanges calls to determine whether a value has changed. - */ - let resolvedValues = definitionList.reduce(buildResolvedTypeValues(type), {}); - if (activeDelta === false) - resolvedValues = {}; - /** - * Now we need to loop through all the keys in the prev prop and this prop, - * and decide: - * 1. If the value has changed, and needs animating - * 2. If it has been removed, and needs adding to the removedKeys set - * 3. If it has been removed in a higher priority type and needs animating - * 4. If it hasn't been removed in a higher priority but hasn't changed, and - * needs adding to the type's protectedKeys list. - */ - const { prevResolvedValues = {} } = typeState; - const allKeys = { - ...prevResolvedValues, - ...resolvedValues, - }; - const markToAnimate = (key) => { - shouldAnimateType = true; - if (removedKeys.has(key)) { - handledRemovedValues = true; - removedKeys.delete(key); - } - typeState.needsAnimating[key] = true; - const motionValue = visualElement.getValue(key); - if (motionValue) - motionValue.liveStyle = false; - }; - for (const key in allKeys) { - const next = resolvedValues[key]; - const prev = prevResolvedValues[key]; - // If we've already handled this we can just skip ahead - if (encounteredKeys.hasOwnProperty(key)) - continue; - /** - * If the value has changed, we probably want to animate it. - */ - let valueHasChanged = false; - if (isKeyframesTarget(next) && isKeyframesTarget(prev)) { - valueHasChanged = - !shallowCompare(next, prev) || variantDidChange; - } - else { - valueHasChanged = next !== prev; - } - if (valueHasChanged) { - if (next !== undefined && next !== null) { - // If next is defined and doesn't equal prev, it needs animating - markToAnimate(key); - } - else { - // If it's undefined, it's been removed. - removedKeys.add(key); - } - } - else if (next !== undefined && removedKeys.has(key)) { - /** - * If next hasn't changed and it isn't undefined, we want to check if it's - * been removed by a higher priority - */ - markToAnimate(key); - } - else { - /** - * If it hasn't changed, we add it to the list of protected values - * to ensure it doesn't get animated. - */ - typeState.protectedKeys[key] = true; - } - } - /** - * Update the typeState so next time animateChanges is called we can compare the - * latest prop and resolvedValues to these. - */ - typeState.prevProp = prop; - typeState.prevResolvedValues = resolvedValues; - if (typeState.isActive) { - encounteredKeys = { ...encounteredKeys, ...resolvedValues }; - } - if ((isInitialRender || wasReset) && - visualElement.blockInitialAnimation) { - shouldAnimateType = false; - } - /** - * If this is an inherited prop we want to skip this animation - * unless the inherited variants haven't changed on this render. - */ - const willAnimateViaParent = isInherited && variantDidChange; - const needsAnimating = !willAnimateViaParent || handledRemovedValues; - if (shouldAnimateType && needsAnimating) { - animations.push(...definitionList.map((animation) => { - const options = { type }; - /** - * If we're performing the initial animation, but we're not - * rendering at the same time as the variant-controlling parent, - * we want to use the parent's transition to calculate the stagger. - */ - if (typeof animation === "string" && - (isInitialRender || wasReset) && - !willAnimateViaParent && - visualElement.manuallyAnimateOnMount && - visualElement.parent) { - const { parent } = visualElement; - const parentVariant = resolveVariant(parent, animation); - if (parent.enteringChildren && parentVariant) { - const { delayChildren } = parentVariant.transition || {}; - options.delay = calcChildStagger(parent.enteringChildren, visualElement, delayChildren); - } - } - return { - animation: animation, - options, - }; - })); - } - } - /** - * If there are some removed value that haven't been dealt with, - * we need to create a new animation that falls back either to the value - * defined in the style prop, or the last read value. - */ - if (removedKeys.size) { - const fallbackAnimation = {}; - /** - * If the initial prop contains a transition we can use that, otherwise - * allow the animation function to use the visual element's default. - */ - if (typeof props.initial !== "boolean") { - const initialTransition = resolveVariant(visualElement, Array.isArray(props.initial) - ? props.initial[0] - : props.initial); - if (initialTransition && initialTransition.transition) { - fallbackAnimation.transition = initialTransition.transition; - } - } - removedKeys.forEach((key) => { - const fallbackTarget = visualElement.getBaseTarget(key); - const motionValue = visualElement.getValue(key); - if (motionValue) - motionValue.liveStyle = true; - // @ts-expect-error - @mattgperry to figure if we should do something here - fallbackAnimation[key] = fallbackTarget ?? null; - }); - animations.push({ animation: fallbackAnimation }); - } - let shouldAnimate = Boolean(animations.length); - if (isInitialRender && - (props.initial === false || props.initial === props.animate) && - !visualElement.manuallyAnimateOnMount) { - shouldAnimate = false; - } - isInitialRender = false; - wasReset = false; - return shouldAnimate ? animate(animations) : Promise.resolve(); - } - /** - * Change whether a certain animation type is active. - */ - function setActive(type, isActive) { - // If the active state hasn't changed, we can safely do nothing here - if (state[type].isActive === isActive) - return Promise.resolve(); - // Propagate active change to children - visualElement.variantChildren?.forEach((child) => child.animationState?.setActive(type, isActive)); - state[type].isActive = isActive; - const animations = animateChanges(type); - for (const key in state) { - state[key].protectedKeys = {}; - } - return animations; - } - return { - animateChanges, - setActive, - setAnimateFunction, - getState: () => state, - reset: () => { - state = createState(); - wasReset = true; - }, - }; - } - function checkVariantsDidChange(prev, next) { - if (typeof next === "string") { - return next !== prev; - } - else if (Array.isArray(next)) { - return !shallowCompare(next, prev); - } - return false; - } - function createTypeState(isActive = false) { - return { - isActive, - protectedKeys: {}, - needsAnimating: {}, - prevResolvedValues: {}, - }; - } - function createState() { - return { - animate: createTypeState(true), - whileInView: createTypeState(), - whileHover: createTypeState(), - whileTap: createTypeState(), - whileDrag: createTypeState(), - whileFocus: createTypeState(), - exit: createTypeState(), - }; - } - - /** - * Reset an axis to the provided origin box. - * - * This is a mutative operation. - */ - function copyAxisInto(axis, originAxis) { - axis.min = originAxis.min; - axis.max = originAxis.max; - } - /** - * Reset a box to the provided origin box. - * - * This is a mutative operation. - */ - function copyBoxInto(box, originBox) { - copyAxisInto(box.x, originBox.x); - copyAxisInto(box.y, originBox.y); - } - /** - * Reset a delta to the provided origin box. - * - * This is a mutative operation. - */ - function copyAxisDeltaInto(delta, originDelta) { - delta.translate = originDelta.translate; - delta.scale = originDelta.scale; - delta.originPoint = originDelta.originPoint; - delta.origin = originDelta.origin; - } - - const SCALE_PRECISION = 0.0001; - const SCALE_MIN = 1 - SCALE_PRECISION; - const SCALE_MAX = 1 + SCALE_PRECISION; - const TRANSLATE_PRECISION = 0.01; - const TRANSLATE_MIN = 0 - TRANSLATE_PRECISION; - const TRANSLATE_MAX = 0 + TRANSLATE_PRECISION; - function calcLength(axis) { - return axis.max - axis.min; - } - function isNear(value, target, maxDistance) { - return Math.abs(value - target) <= maxDistance; - } - function calcAxisDelta(delta, source, target, origin = 0.5) { - delta.origin = origin; - delta.originPoint = mixNumber$1(source.min, source.max, delta.origin); - delta.scale = calcLength(target) / calcLength(source); - delta.translate = - mixNumber$1(target.min, target.max, delta.origin) - delta.originPoint; - if ((delta.scale >= SCALE_MIN && delta.scale <= SCALE_MAX) || - isNaN(delta.scale)) { - delta.scale = 1.0; - } - if ((delta.translate >= TRANSLATE_MIN && - delta.translate <= TRANSLATE_MAX) || - isNaN(delta.translate)) { - delta.translate = 0.0; - } - } - function calcBoxDelta(delta, source, target, origin) { - calcAxisDelta(delta.x, source.x, target.x, origin ? origin.originX : undefined); - calcAxisDelta(delta.y, source.y, target.y, origin ? origin.originY : undefined); - } - function calcRelativeAxis(target, relative, parent, anchor = 0) { - const anchorPoint = anchor - ? mixNumber$1(parent.min, parent.max, anchor) - : parent.min; - target.min = anchorPoint + relative.min; - target.max = target.min + calcLength(relative); - } - function calcRelativeBox(target, relative, parent, anchor) { - calcRelativeAxis(target.x, relative.x, parent.x, anchor?.x); - calcRelativeAxis(target.y, relative.y, parent.y, anchor?.y); - } - function calcRelativeAxisPosition(target, layout, parent, anchor = 0) { - const anchorPoint = anchor - ? mixNumber$1(parent.min, parent.max, anchor) - : parent.min; - target.min = layout.min - anchorPoint; - target.max = target.min + calcLength(layout); - } - function calcRelativePosition(target, layout, parent, anchor) { - calcRelativeAxisPosition(target.x, layout.x, parent.x, anchor?.x); - calcRelativeAxisPosition(target.y, layout.y, parent.y, anchor?.y); - } - - /** - * Remove a delta from a point. This is essentially the steps of applyPointDelta in reverse - */ - function removePointDelta(point, translate, scale, originPoint, boxScale) { - point -= translate; - point = scalePoint(point, 1 / scale, originPoint); - if (boxScale !== undefined) { - point = scalePoint(point, 1 / boxScale, originPoint); - } - return point; - } - /** - * Remove a delta from an axis. This is essentially the steps of applyAxisDelta in reverse - */ - function removeAxisDelta(axis, translate = 0, scale = 1, origin = 0.5, boxScale, originAxis = axis, sourceAxis = axis) { - if (percent.test(translate)) { - translate = parseFloat(translate); - const relativeProgress = mixNumber$1(sourceAxis.min, sourceAxis.max, translate / 100); - translate = relativeProgress - sourceAxis.min; - } - if (typeof translate !== "number") - return; - let originPoint = mixNumber$1(originAxis.min, originAxis.max, origin); - if (axis === originAxis) - originPoint -= translate; - axis.min = removePointDelta(axis.min, translate, scale, originPoint, boxScale); - axis.max = removePointDelta(axis.max, translate, scale, originPoint, boxScale); - } - /** - * Remove a transforms from an axis. This is essentially the steps of applyAxisTransforms in reverse - * and acts as a bridge between motion values and removeAxisDelta - */ - function removeAxisTransforms(axis, transforms, [key, scaleKey, originKey], origin, sourceAxis) { - removeAxisDelta(axis, transforms[key], transforms[scaleKey], transforms[originKey], transforms.scale, origin, sourceAxis); - } - /** - * The names of the motion values we want to apply as translation, scale and origin. - */ - const xKeys = ["x", "scaleX", "originX"]; - const yKeys = ["y", "scaleY", "originY"]; - /** - * Remove a transforms from an box. This is essentially the steps of applyAxisBox in reverse - * and acts as a bridge between motion values and removeAxisDelta - */ - function removeBoxTransforms(box, transforms, originBox, sourceBox) { - removeAxisTransforms(box.x, transforms, xKeys, originBox ? originBox.x : undefined, sourceBox ? sourceBox.x : undefined); - removeAxisTransforms(box.y, transforms, yKeys, originBox ? originBox.y : undefined, sourceBox ? sourceBox.y : undefined); - } - - function isAxisDeltaZero(delta) { - return delta.translate === 0 && delta.scale === 1; - } - function isDeltaZero(delta) { - return isAxisDeltaZero(delta.x) && isAxisDeltaZero(delta.y); - } - function axisEquals(a, b) { - return a.min === b.min && a.max === b.max; - } - function boxEquals(a, b) { - return axisEquals(a.x, b.x) && axisEquals(a.y, b.y); - } - function axisEqualsRounded(a, b) { - return (Math.round(a.min) === Math.round(b.min) && - Math.round(a.max) === Math.round(b.max)); - } - function boxEqualsRounded(a, b) { - return axisEqualsRounded(a.x, b.x) && axisEqualsRounded(a.y, b.y); - } - function aspectRatio(box) { - return calcLength(box.x) / calcLength(box.y); - } - function axisDeltaEquals(a, b) { - return (a.translate === b.translate && - a.scale === b.scale && - a.originPoint === b.originPoint); - } - - function eachAxis(callback) { - return [callback("x"), callback("y")]; - } - - function buildProjectionTransform(delta, treeScale, latestTransform) { - let transform = ""; - /** - * The translations we use to calculate are always relative to the viewport coordinate space. - * But when we apply scales, we also scale the coordinate space of an element and its children. - * For instance if we have a treeScale (the culmination of all parent scales) of 0.5 and we need - * to move an element 100 pixels, we actually need to move it 200 in within that scaled space. - */ - const xTranslate = delta.x.translate / treeScale.x; - const yTranslate = delta.y.translate / treeScale.y; - const zTranslate = latestTransform?.z || 0; - if (xTranslate || yTranslate || zTranslate) { - transform = `translate3d(${xTranslate}px, ${yTranslate}px, ${zTranslate}px) `; - } - /** - * Apply scale correction for the tree transform. - * This will apply scale to the screen-orientated axes. - */ - if (treeScale.x !== 1 || treeScale.y !== 1) { - transform += `scale(${1 / treeScale.x}, ${1 / treeScale.y}) `; - } - if (latestTransform) { - const { transformPerspective, rotate, pathRotation, rotateX, rotateY, skewX, skewY, } = latestTransform; - if (transformPerspective) - transform = `perspective(${transformPerspective}px) ${transform}`; - if (rotate) - transform += `rotate(${rotate}deg) `; - // Additive `rotate()` so user `rotate` isn't clobbered. - if (pathRotation) - transform += `rotate(${pathRotation}deg) `; - if (rotateX) - transform += `rotateX(${rotateX}deg) `; - if (rotateY) - transform += `rotateY(${rotateY}deg) `; - if (skewX) - transform += `skewX(${skewX}deg) `; - if (skewY) - transform += `skewY(${skewY}deg) `; - } - /** - * Apply scale to match the size of the element to the size we want it. - * This will apply scale to the element-orientated axes. - */ - const elementScaleX = delta.x.scale * treeScale.x; - const elementScaleY = delta.y.scale * treeScale.y; - if (elementScaleX !== 1 || elementScaleY !== 1) { - transform += `scale(${elementScaleX}, ${elementScaleY})`; - } - return transform || "none"; - } - - const numBorders = cornerRadiusProps.length; - const asNumber = (value) => typeof value === "string" ? parseFloat(value) : value; - const isPx = (value) => typeof value === "number" || px.test(value); - function mixValues(target, follow, lead, progress, shouldCrossfadeOpacity, isOnlyMember) { - if (shouldCrossfadeOpacity) { - target.opacity = mixNumber$1(0, lead.opacity ?? 1, easeCrossfadeIn(progress)); - target.opacityExit = mixNumber$1(follow.opacity ?? 1, 0, easeCrossfadeOut(progress)); - } - else if (isOnlyMember) { - target.opacity = mixNumber$1(follow.opacity ?? 1, lead.opacity ?? 1, progress); - } - /** - * Mix border radius - */ - for (let i = 0; i < numBorders; i++) { - const borderLabel = cornerRadiusProps[i]; - let followRadius = getRadius(follow, borderLabel); - let leadRadius = getRadius(lead, borderLabel); - if (followRadius === undefined && leadRadius === undefined) - continue; - followRadius || (followRadius = 0); - leadRadius || (leadRadius = 0); - const canMix = followRadius === 0 || - leadRadius === 0 || - isPx(followRadius) === isPx(leadRadius); - if (canMix) { - target[borderLabel] = Math.max(mixNumber$1(asNumber(followRadius), asNumber(leadRadius), progress), 0); - if (percent.test(leadRadius) || percent.test(followRadius)) { - target[borderLabel] += "%"; - } - } - else { - target[borderLabel] = leadRadius; - } - } - /** - * Mix rotation - */ - if (follow.rotate || lead.rotate) { - target.rotate = mixNumber$1(follow.rotate || 0, lead.rotate || 0, progress); - } - } - function getRadius(values, radiusName) { - return values[radiusName] !== undefined - ? values[radiusName] - : values.borderRadius; - } - const easeCrossfadeIn = /*@__PURE__*/ compress(0, 0.5, circOut); - const easeCrossfadeOut = /*@__PURE__*/ compress(0.5, 0.95, noop); - function compress(min, max, easing) { - return (p) => { - // Could replace ifs with clamp - if (p < min) - return 0; - if (p > max) - return 1; - return easing(progress(min, max, p)); - }; - } - - function animateSingleValue(value, keyframes, options) { - const motionValue$1 = isMotionValue(value) ? value : motionValue(value); - motionValue$1.start(animateMotionValue("", motionValue$1, keyframes, options)); - return motionValue$1.animation; - } - - function addDomEvent(target, eventName, handler, options = { passive: true }) { - target.addEventListener(eventName, handler, options); - return () => target.removeEventListener(eventName, handler, options); - } - - const compareByDepth = (a, b) => a.depth - b.depth; - - class FlatTree { - constructor() { - this.children = []; - this.isDirty = false; - } - add(child) { - addUniqueItem(this.children, child); - this.isDirty = true; - } - remove(child) { - removeItem(this.children, child); - this.isDirty = true; - } - forEach(callback) { - this.isDirty && this.children.sort(compareByDepth); - this.isDirty = false; - this.children.forEach(callback); - } - } - - /** - * Timeout defined in ms - */ - function delay(callback, timeout) { - const start = time.now(); - const checkElapsed = ({ timestamp }) => { - const elapsed = timestamp - start; - if (elapsed >= timeout) { - cancelFrame(checkElapsed); - callback(elapsed - timeout); - } - }; - frame.setup(checkElapsed, true); - return () => cancelFrame(checkElapsed); - } - function delayInSeconds(callback, timeout) { - return delay(callback, secondsToMilliseconds(timeout)); - } - - /** - * If the provided value is a MotionValue, this returns the actual value, otherwise just the value itself - */ - function resolveMotionValue(value) { - return isMotionValue(value) ? value.get() : value; - } - - class NodeStack { - constructor() { - this.members = []; - } - add(node) { - addUniqueItem(this.members, node); - for (let i = this.members.length - 1; i >= 0; i--) { - const member = this.members[i]; - if (member === node || member === this.lead || member === this.prevLead) - continue; - const inst = member.instance; - if ((!inst || inst.isConnected === false) && !member.snapshot) { - removeItem(this.members, member); - member.unmount(); - } - } - node.scheduleRender(); - } - remove(node) { - removeItem(this.members, node); - if (node === this.prevLead) - this.prevLead = undefined; - if (node === this.lead) { - const prevLead = this.members[this.members.length - 1]; - if (prevLead) - this.promote(prevLead); - } - } - relegate(node) { - for (let i = this.members.indexOf(node) - 1; i >= 0; i--) { - const member = this.members[i]; - if (member.isPresent !== false && member.instance?.isConnected !== false) { - this.promote(member); - return true; - } - } - return false; - } - promote(node, preserveFollowOpacity) { - const prevLead = this.lead; - if (node === prevLead) - return; - this.prevLead = prevLead; - this.lead = node; - node.show(); - if (prevLead) { - prevLead.updateSnapshot(); - node.scheduleRender(); - const { layoutDependency: prevDep } = prevLead.options; - const { layoutDependency: nextDep } = node.options; - if (prevDep === undefined || prevDep !== nextDep) { - node.resumeFrom = prevLead; - if (preserveFollowOpacity) - prevLead.preserveOpacity = true; - if (prevLead.snapshot) { - node.snapshot = prevLead.snapshot; - node.snapshot.latestValues = - prevLead.animationValues || prevLead.latestValues; - } - if (node.root?.isUpdating) - node.isLayoutDirty = true; - } - if (node.options.crossfade === false) - prevLead.hide(); - } - } - exitAnimationComplete() { - this.members.forEach((member) => { - member.options.onExitComplete?.(); - member.resumingFrom?.options.onExitComplete?.(); - }); - } - scheduleRender() { - this.members.forEach((member) => member.instance && member.scheduleRender(false)); - } - removeLeadSnapshot() { - if (this.lead?.snapshot) - this.lead.snapshot = undefined; - } - } - - /** - * This should only ever be modified on the client otherwise it'll - * persist through server requests. If we need instanced states we - * could lazy-init via root. - */ - const globalProjectionState = { - /** - * Global flag as to whether the tree has animated since the last time - * we resized the window - */ - hasAnimatedSinceResize: true, - /** - * We set this to true once, on the first update. Any nodes added to the tree beyond that - * update will be given a `data-projection-id` attribute. - */ - hasEverUpdated: false, - }; - - const metrics = { - nodes: 0, - calculatedTargetDeltas: 0, - calculatedProjections: 0, - }; - const transformAxes = ["", "X", "Y", "Z"]; - /** - * We use 1000 as the animation target as 0-1000 maps better to pixels than 0-1 - * which has a noticeable difference in spring animations - */ - const animationTarget = 1000; - let id$2 = 0; - function resetDistortingTransform(key, visualElement, values, sharedAnimationValues) { - const { latestValues } = visualElement; - // Record the distorting transform and then temporarily set it to 0 - if (latestValues[key]) { - values[key] = latestValues[key]; - visualElement.setStaticValue(key, 0); - if (sharedAnimationValues) { - sharedAnimationValues[key] = 0; - } - } - } - function cancelTreeOptimisedTransformAnimations(projectionNode) { - projectionNode.hasCheckedOptimisedAppear = true; - if (projectionNode.root === projectionNode) - return; - const { visualElement } = projectionNode.options; - if (!visualElement) - return; - const appearId = getOptimisedAppearId(visualElement); - if (window.MotionHasOptimisedAnimation(appearId, "transform")) { - const { layout, layoutId } = projectionNode.options; - window.MotionCancelOptimisedAnimation(appearId, "transform", frame, !(layout || layoutId)); - } - const { parent } = projectionNode; - if (parent && !parent.hasCheckedOptimisedAppear) { - cancelTreeOptimisedTransformAnimations(parent); - } - } - function createProjectionNode$1({ attachResizeListener, defaultParent, measureScroll, checkIsScrollRoot, resetTransform, }) { - return class ProjectionNode { - constructor(latestValues = {}, parent = defaultParent?.()) { - /** - * A unique ID generated for every projection node. - */ - this.id = id$2++; - /** - * An id that represents a unique session instigated by startUpdate. - */ - this.animationId = 0; - this.animationCommitId = 0; - /** - * A Set containing all this component's children. This is used to iterate - * through the children. - * - * TODO: This could be faster to iterate as a flat array stored on the root node. - */ - this.children = new Set(); - /** - * Options for the node. We use this to configure what kind of layout animations - * we should perform (if any). - */ - this.options = {}; - /** - * We use this to detect when its safe to shut down part of a projection tree. - * We have to keep projecting children for scale correction and relative projection - * until all their parents stop performing layout animations. - */ - this.isTreeAnimating = false; - this.isAnimationBlocked = false; - /** - * Flag to true if we think this layout has been changed. We can't always know this, - * currently we set it to true every time a component renders, or if it has a layoutDependency - * if that has changed between renders. Additionally, components can be grouped by LayoutGroup - * and if one node is dirtied, they all are. - */ - this.isLayoutDirty = false; - /** - * Flag to true if we think the projection calculations for this node needs - * recalculating as a result of an updated transform or layout animation. - */ - this.isProjectionDirty = false; - /** - * Flag to true if the layout *or* transform has changed. This then gets propagated - * throughout the projection tree, forcing any element below to recalculate on the next frame. - */ - this.isSharedProjectionDirty = false; - /** - * Flag transform dirty. This gets propagated throughout the whole tree but is only - * respected by shared nodes. - */ - this.isTransformDirty = false; - /** - * Block layout updates for instant layout transitions throughout the tree. - */ - this.updateManuallyBlocked = false; - this.updateBlockedByResize = false; - /** - * Set to true between the start of the first `willUpdate` call and the end of the `didUpdate` - * call. - */ - this.isUpdating = false; - /** - * If this is an SVG element we currently disable projection transforms - */ - this.isSVG = false; - /** - * Flag to true (during promotion) if a node doing an instant layout transition needs to reset - * its projection styles. - */ - this.needsReset = false; - /** - * Flags whether this node should have its transform reset prior to measuring. - */ - this.shouldResetTransform = false; - /** - * Store whether this node has been checked for optimised appear animations. As - * effects fire bottom-up, and we want to look up the tree for appear animations, - * this makes sure we only check each path once, stopping at nodes that - * have already been checked. - */ - this.hasCheckedOptimisedAppear = false; - /** - * An object representing the calculated contextual/accumulated/tree scale. - * This will be used to scale calculcated projection transforms, as these are - * calculated in screen-space but need to be scaled for elements to layoutly - * make it to their calculated destinations. - * - * TODO: Lazy-init - */ - this.treeScale = { x: 1, y: 1 }; - /** - * - */ - this.eventHandlers = new Map(); - this.hasTreeAnimated = false; - this.layoutVersion = 0; - // Note: Currently only running on root node - this.updateScheduled = false; - this.scheduleUpdate = () => this.update(); - this.projectionUpdateScheduled = false; - this.checkUpdateFailed = () => { - if (this.isUpdating) { - this.isUpdating = false; - this.clearAllSnapshots(); - } - }; - /** - * This is a multi-step process as shared nodes might be of different depths. Nodes - * are sorted by depth order, so we need to resolve the entire tree before moving to - * the next step. - */ - this.updateProjection = () => { - this.projectionUpdateScheduled = false; - /** - * Reset debug counts. Manually resetting rather than creating a new - * object each frame. - */ - if (statsBuffer.value) { - metrics.nodes = - metrics.calculatedTargetDeltas = - metrics.calculatedProjections = - 0; - } - this.nodes.forEach(propagateDirtyNodes); - this.nodes.forEach(resolveTargetDelta); - this.nodes.forEach(calcProjection); - this.nodes.forEach(cleanDirtyNodes); - if (statsBuffer.addProjectionMetrics) { - statsBuffer.addProjectionMetrics(metrics); - } - }; - /** - * Frame calculations - */ - this.resolvedRelativeTargetAt = 0.0; - this.linkedParentVersion = 0; - this.hasProjected = false; - this.isVisible = true; - this.animationProgress = 0; - /** - * Shared layout - */ - // TODO Only running on root node - this.sharedNodes = new Map(); - this.latestValues = latestValues; - this.root = parent ? parent.root || parent : this; - this.path = parent ? [...parent.path, parent] : []; - this.parent = parent; - this.depth = parent ? parent.depth + 1 : 0; - for (let i = 0; i < this.path.length; i++) { - this.path[i].shouldResetTransform = true; - } - if (this.root === this) - this.nodes = new FlatTree(); - } - addEventListener(name, handler) { - if (!this.eventHandlers.has(name)) { - this.eventHandlers.set(name, new SubscriptionManager()); - } - return this.eventHandlers.get(name).add(handler); - } - notifyListeners(name, ...args) { - const subscriptionManager = this.eventHandlers.get(name); - subscriptionManager && subscriptionManager.notify(...args); - } - hasListeners(name) { - return this.eventHandlers.has(name); - } - /** - * Lifecycles - */ - mount(instance) { - if (this.instance) - return; - this.isSVG = isSVGElement(instance) && !isSVGSVGElement(instance); - this.instance = instance; - const { layoutId, layout, visualElement } = this.options; - if (visualElement && !visualElement.current) { - visualElement.mount(instance); - } - this.root.nodes.add(this); - this.parent && this.parent.children.add(this); - if (this.root.hasTreeAnimated && (layout || layoutId)) { - this.isLayoutDirty = true; - } - if (attachResizeListener) { - let cancelDelay; - let innerWidth = 0; - const resizeUnblockUpdate = () => (this.root.updateBlockedByResize = false); - // Set initial innerWidth in a frame.read callback to batch the read - frame.read(() => { - innerWidth = window.innerWidth; - }); - attachResizeListener(instance, () => { - const newInnerWidth = window.innerWidth; - if (newInnerWidth === innerWidth) - return; - innerWidth = newInnerWidth; - this.root.updateBlockedByResize = true; - cancelDelay && cancelDelay(); - cancelDelay = delay(resizeUnblockUpdate, 250); - if (globalProjectionState.hasAnimatedSinceResize) { - globalProjectionState.hasAnimatedSinceResize = false; - this.nodes.forEach(finishAnimation); - } - }); - } - if (layoutId) { - this.root.registerSharedNode(layoutId, this); - } - // Only register the handler if it requires layout animation - if (this.options.animate !== false && - visualElement && - (layoutId || layout)) { - this.addEventListener("didUpdate", ({ delta, hasLayoutChanged, hasRelativeLayoutChanged, layout: newLayout, }) => { - if (this.isTreeAnimationBlocked()) { - this.target = undefined; - this.relativeTarget = undefined; - return; - } - // TODO: Check here if an animation exists - const layoutTransition = this.options.transition || - visualElement.getDefaultTransition() || - defaultLayoutTransition; - const { onLayoutAnimationStart, onLayoutAnimationComplete, } = visualElement.getProps(); - /** - * The target layout of the element might stay the same, - * but its position relative to its parent has changed. - */ - const hasTargetChanged = !this.targetLayout || - !boxEqualsRounded(this.targetLayout, newLayout); - /* - * Note: Disabled to fix relative animations always triggering new - * layout animations. If this causes further issues, we can try - * a different approach to detecting relative target changes. - */ - // || hasRelativeLayoutChanged - /** - * If the layout hasn't seemed to have changed, it might be that the - * element is visually in the same place in the document but its position - * relative to its parent has indeed changed. So here we check for that. - */ - const hasOnlyRelativeTargetChanged = !hasLayoutChanged && hasRelativeLayoutChanged; - if (this.options.layoutRoot || - this.resumeFrom || - hasOnlyRelativeTargetChanged || - (hasLayoutChanged && - (hasTargetChanged || !this.currentAnimation))) { - if (this.resumeFrom) { - this.resumingFrom = this.resumeFrom; - this.resumingFrom.resumingFrom = undefined; - } - const animationOptions = { - ...getValueTransition$1(layoutTransition, "layout"), - onPlay: onLayoutAnimationStart, - onComplete: onLayoutAnimationComplete, - }; - if (visualElement.shouldReduceMotion || - this.options.layoutRoot) { - animationOptions.delay = 0; - animationOptions.type = false; - } - this.startAnimation(animationOptions); - /** - * Set animation origin after starting animation to avoid layout jump - * caused by stopping previous layout animation - */ - this.setAnimationOrigin(delta, hasOnlyRelativeTargetChanged, animationOptions - .path); - } - else { - /** - * If the layout hasn't changed and we have an animation that hasn't started yet, - * finish it immediately. Otherwise it will be animating from a location - * that was probably never committed to screen and look like a jumpy box. - */ - if (!hasLayoutChanged) { - finishAnimation(this); - } - if (this.isLead() && this.options.onExitComplete) { - this.options.onExitComplete(); - } - } - this.targetLayout = newLayout; - }); - } - } - unmount() { - this.options.layoutId && this.willUpdate(); - this.root.nodes.remove(this); - const stack = this.getStack(); - stack && stack.remove(this); - this.parent && this.parent.children.delete(this); - this.instance = undefined; - this.eventHandlers.clear(); - cancelFrame(this.updateProjection); - } - // only on the root - blockUpdate() { - this.updateManuallyBlocked = true; - } - unblockUpdate() { - this.updateManuallyBlocked = false; - } - isUpdateBlocked() { - return this.updateManuallyBlocked || this.updateBlockedByResize; - } - isTreeAnimationBlocked() { - return (this.isAnimationBlocked || - (this.parent && this.parent.isTreeAnimationBlocked()) || - false); - } - // Note: currently only running on root node - startUpdate() { - if (this.isUpdateBlocked()) - return; - this.isUpdating = true; - this.nodes && this.nodes.forEach(resetSkewAndRotation); - this.animationId++; - } - getTransformTemplate() { - const { visualElement } = this.options; - return visualElement && visualElement.getProps().transformTemplate; - } - willUpdate(shouldNotifyListeners = true) { - this.root.hasTreeAnimated = true; - if (this.root.isUpdateBlocked()) { - this.options.onExitComplete && this.options.onExitComplete(); - return; - } - /** - * If we're running optimised appear animations then these must be - * cancelled before measuring the DOM. This is so we can measure - * the true layout of the element rather than the WAAPI animation - * which will be unaffected by the resetSkewAndRotate step. - * - * Note: This is a DOM write. Worst case scenario is this is sandwiched - * between other snapshot reads which will cause unnecessary style recalculations. - * This has to happen here though, as we don't yet know which nodes will need - * snapshots in startUpdate(), but we only want to cancel optimised animations - * if a layout animation measurement is actually going to be affected by them. - */ - if (window.MotionCancelOptimisedAnimation && - !this.hasCheckedOptimisedAppear) { - cancelTreeOptimisedTransformAnimations(this); - } - !this.root.isUpdating && this.root.startUpdate(); - if (this.isLayoutDirty) - return; - this.isLayoutDirty = true; - for (let i = 0; i < this.path.length; i++) { - const node = this.path[i]; - node.shouldResetTransform = true; - /** - * Percentage translates resolve against layoutBox dimensions, - * so ancestors with them must be re-measured after transform reset. - */ - if (typeof node.latestValues.x === "string" || - typeof node.latestValues.y === "string") { - node.isLayoutDirty = true; - } - node.updateScroll("snapshot"); - if (node.options.layoutRoot) { - node.willUpdate(false); - } - } - const { layoutId, layout } = this.options; - if (layoutId === undefined && !layout) - return; - const transformTemplate = this.getTransformTemplate(); - this.prevTransformTemplateValue = transformTemplate - ? transformTemplate(this.latestValues, "") - : undefined; - this.updateSnapshot(); - shouldNotifyListeners && this.notifyListeners("willUpdate"); - } - update() { - this.updateScheduled = false; - const updateWasBlocked = this.isUpdateBlocked(); - // When doing an instant transition, we skip the layout update, - // but should still clean up the measurements so that the next - // snapshot could be taken correctly. - if (updateWasBlocked) { - const wasBlockedByResize = this.updateBlockedByResize; - this.unblockUpdate(); - this.updateBlockedByResize = false; - this.clearAllSnapshots(); - /** - * When blocked by resize, still measure layouts so - * callbacks like onLayoutMeasure fire (e.g. Reorder). - * Skip notifyLayoutUpdate to prevent animations. - */ - if (wasBlockedByResize) { - this.nodes.forEach(forceLayoutMeasure); - } - this.nodes.forEach(clearMeasurements); - return; - } - /** - * If this is a repeat of didUpdate then ignore the animation. - */ - if (this.animationId <= this.animationCommitId) { - this.nodes.forEach(clearIsLayoutDirty); - return; - } - this.animationCommitId = this.animationId; - if (!this.isUpdating) { - this.nodes.forEach(clearIsLayoutDirty); - } - else { - this.isUpdating = false; - /** - * Ensure animation-blocked nodes (e.g. during drag) - * get measured even when memoized (willUpdate skipped). - */ - this.nodes.forEach(ensureDraggedNodesSnapshotted); - /** - * Write - */ - this.nodes.forEach(resetTransformStyle); - /** - * Read ================== - */ - // Update layout measurements of updated children - this.nodes.forEach(updateLayout); - /** - * Write - */ - // Notify listeners that the layout is updated - this.nodes.forEach(notifyLayoutUpdate); - } - this.clearAllSnapshots(); - /** - * Manually flush any pending updates. Ideally - * we could leave this to the following requestAnimationFrame but this seems - * to leave a flash of incorrectly styled content. - */ - const now = time.now(); - frameData.delta = clamp(0, 1000 / 60, now - frameData.timestamp); - frameData.timestamp = now; - frameData.isProcessing = true; - frameSteps.update.process(frameData); - frameSteps.preRender.process(frameData); - frameSteps.render.process(frameData); - frameData.isProcessing = false; - } - didUpdate() { - if (!this.updateScheduled) { - this.updateScheduled = true; - microtask.read(this.scheduleUpdate); - } - } - clearAllSnapshots() { - this.nodes.forEach(clearSnapshot); - this.sharedNodes.forEach(removeLeadSnapshots); - } - scheduleUpdateProjection() { - if (!this.projectionUpdateScheduled) { - this.projectionUpdateScheduled = true; - frame.preRender(this.updateProjection, false, true); - } - } - scheduleCheckAfterUnmount() { - /** - * If the unmounting node is in a layoutGroup and did trigger a willUpdate, - * we manually call didUpdate to give a chance to the siblings to animate. - * Otherwise, cleanup all snapshots to prevents future nodes from reusing them. - */ - frame.postRender(() => { - if (this.isLayoutDirty) { - this.root.didUpdate(); - } - else { - this.root.checkUpdateFailed(); - } - }); - } - /** - * Update measurements - */ - updateSnapshot() { - if (this.snapshot || !this.instance) - return; - this.snapshot = this.measure(); - if (this.snapshot && - !calcLength(this.snapshot.measuredBox.x) && - !calcLength(this.snapshot.measuredBox.y)) { - this.snapshot = undefined; - } - } - updateLayout() { - if (!this.instance) - return; - this.updateScroll(); - if (!(this.options.alwaysMeasureLayout && this.isLead()) && - !this.isLayoutDirty) { - return; - } - /** - * When a node is mounted, it simply resumes from the prevLead's - * snapshot instead of taking a new one, but the ancestors scroll - * might have updated while the prevLead is unmounted. We need to - * update the scroll again to make sure the layout we measure is - * up to date. - */ - if (this.resumeFrom && !this.resumeFrom.instance) { - for (let i = 0; i < this.path.length; i++) { - const node = this.path[i]; - node.updateScroll(); - } - } - const prevLayout = this.layout; - this.layout = this.measure(false); - this.layoutVersion++; - if (!this.layoutCorrected) - this.layoutCorrected = createBox(); - this.isLayoutDirty = false; - this.projectionDelta = undefined; - this.notifyListeners("measure", this.layout.layoutBox); - const { visualElement } = this.options; - visualElement && - visualElement.notify("LayoutMeasure", this.layout.layoutBox, prevLayout ? prevLayout.layoutBox : undefined); - } - updateScroll(phase = "measure") { - let needsMeasurement = Boolean(this.options.layoutScroll && this.instance); - if (this.scroll && - this.scroll.animationId === this.root.animationId && - this.scroll.phase === phase) { - needsMeasurement = false; - } - if (needsMeasurement && this.instance) { - const isRoot = checkIsScrollRoot(this.instance); - this.scroll = { - animationId: this.root.animationId, - phase, - isRoot, - offset: measureScroll(this.instance), - wasRoot: this.scroll ? this.scroll.isRoot : isRoot, - }; - } - } - resetTransform() { - if (!resetTransform) - return; - const isResetRequested = this.isLayoutDirty || - this.shouldResetTransform || - this.options.alwaysMeasureLayout; - const hasProjection = this.projectionDelta && !isDeltaZero(this.projectionDelta); - const transformTemplate = this.getTransformTemplate(); - const transformTemplateValue = transformTemplate - ? transformTemplate(this.latestValues, "") - : undefined; - const transformTemplateHasChanged = transformTemplateValue !== this.prevTransformTemplateValue; - if (isResetRequested && - this.instance && - (hasProjection || - hasTransform(this.latestValues) || - transformTemplateHasChanged)) { - resetTransform(this.instance, transformTemplateValue); - this.shouldResetTransform = false; - this.scheduleRender(); - } - } - measure(removeTransform = true) { - const pageBox = this.measurePageBox(); - let layoutBox = this.removeElementScroll(pageBox); - /** - * Measurements taken during the pre-render stage - * still have transforms applied so we remove them - * via calculation. - */ - if (removeTransform) { - layoutBox = this.removeTransform(layoutBox); - } - roundBox(layoutBox); - return { - animationId: this.root.animationId, - measuredBox: pageBox, - layoutBox, - latestValues: {}, - source: this.id, - }; - } - measurePageBox() { - const { visualElement } = this.options; - if (!visualElement) - return createBox(); - const box = visualElement.measureViewportBox(); - const wasInScrollRoot = this.scroll?.wasRoot || this.path.some(checkNodeWasScrollRoot); - if (!wasInScrollRoot) { - // Remove viewport scroll to give page-relative coordinates - const { scroll } = this.root; - if (scroll) { - translateAxis(box.x, scroll.offset.x); - translateAxis(box.y, scroll.offset.y); - } - } - return box; - } - removeElementScroll(box) { - const boxWithoutScroll = createBox(); - copyBoxInto(boxWithoutScroll, box); - if (this.scroll?.wasRoot) { - return boxWithoutScroll; - } - /** - * Performance TODO: Keep a cumulative scroll offset down the tree - * rather than loop back up the path. - */ - for (let i = 0; i < this.path.length; i++) { - const node = this.path[i]; - const { scroll, options } = node; - if (node !== this.root && scroll && options.layoutScroll) { - /** - * If this is a new scroll root, we want to remove all previous scrolls - * from the viewport box. - */ - if (scroll.wasRoot) { - copyBoxInto(boxWithoutScroll, box); - } - translateAxis(boxWithoutScroll.x, scroll.offset.x); - translateAxis(boxWithoutScroll.y, scroll.offset.y); - } - } - return boxWithoutScroll; - } - applyTransform(box, transformOnly = false, output) { - const withTransforms = output || createBox(); - copyBoxInto(withTransforms, box); - for (let i = 0; i < this.path.length; i++) { - const node = this.path[i]; - if (!transformOnly && - node.options.layoutScroll && - node.scroll && - node !== node.root) { - translateAxis(withTransforms.x, -node.scroll.offset.x); - translateAxis(withTransforms.y, -node.scroll.offset.y); - } - if (!hasTransform(node.latestValues)) - continue; - transformBox(withTransforms, node.latestValues, node.layout?.layoutBox); - } - if (hasTransform(this.latestValues)) { - transformBox(withTransforms, this.latestValues, this.layout?.layoutBox); - } - return withTransforms; - } - removeTransform(box) { - const boxWithoutTransform = createBox(); - copyBoxInto(boxWithoutTransform, box); - for (let i = 0; i < this.path.length; i++) { - const node = this.path[i]; - if (!hasTransform(node.latestValues)) - continue; - let sourceBox; - if (node.instance) { - hasScale(node.latestValues) && node.updateSnapshot(); - sourceBox = createBox(); - copyBoxInto(sourceBox, node.measurePageBox()); - } - removeBoxTransforms(boxWithoutTransform, node.latestValues, node.snapshot?.layoutBox, sourceBox); - } - if (hasTransform(this.latestValues)) { - removeBoxTransforms(boxWithoutTransform, this.latestValues); - } - return boxWithoutTransform; - } - setTargetDelta(delta) { - this.targetDelta = delta; - this.root.scheduleUpdateProjection(); - this.isProjectionDirty = true; - } - setOptions(options) { - this.options = { - ...this.options, - ...options, - crossfade: options.crossfade !== undefined ? options.crossfade : true, - }; - } - clearMeasurements() { - this.scroll = undefined; - this.layout = undefined; - this.snapshot = undefined; - this.prevTransformTemplateValue = undefined; - this.targetDelta = undefined; - this.target = undefined; - this.isLayoutDirty = false; - } - forceRelativeParentToResolveTarget() { - if (!this.relativeParent) - return; - /** - * If the parent target isn't up-to-date, force it to update. - * This is an unfortunate de-optimisation as it means any updating relative - * projection will cause all the relative parents to recalculate back - * up the tree. - */ - if (this.relativeParent.resolvedRelativeTargetAt !== - frameData.timestamp) { - this.relativeParent.resolveTargetDelta(true); - } - } - resolveTargetDelta(forceRecalculation = false) { - /** - * Once the dirty status of nodes has been spread through the tree, we also - * need to check if we have a shared node of a different depth that has itself - * been dirtied. - */ - const lead = this.getLead(); - this.isProjectionDirty || (this.isProjectionDirty = lead.isProjectionDirty); - this.isTransformDirty || (this.isTransformDirty = lead.isTransformDirty); - this.isSharedProjectionDirty || (this.isSharedProjectionDirty = lead.isSharedProjectionDirty); - const isShared = Boolean(this.resumingFrom) || this !== lead; - /** - * We don't use transform for this step of processing so we don't - * need to check whether any nodes have changed transform. - */ - const canSkip = !(forceRecalculation || - (isShared && this.isSharedProjectionDirty) || - this.isProjectionDirty || - this.parent?.isProjectionDirty || - this.attemptToResolveRelativeTarget || - this.root.updateBlockedByResize); - if (canSkip) - return; - const { layout, layoutId } = this.options; - /** - * If we have no layout, we can't perform projection, so early return - */ - if (!this.layout || !(layout || layoutId)) - return; - this.resolvedRelativeTargetAt = frameData.timestamp; - const relativeParent = this.getClosestProjectingParent(); - if (relativeParent && - this.linkedParentVersion !== relativeParent.layoutVersion && - !relativeParent.options.layoutRoot) { - this.removeRelativeTarget(); - } - /** - * If we don't have a targetDelta but do have a layout, we can attempt to resolve - * a relativeParent. This will allow a component to perform scale correction - * even if no animation has started. - */ - if (!this.targetDelta && !this.relativeTarget) { - if (this.options.layoutAnchor !== false && - relativeParent && - relativeParent.layout) { - this.createRelativeTarget(relativeParent, this.layout.layoutBox, relativeParent.layout.layoutBox); - } - else { - this.removeRelativeTarget(); - } - } - /** - * If we have no relative target or no target delta our target isn't valid - * for this frame. - */ - if (!this.relativeTarget && !this.targetDelta) - return; - /** - * Lazy-init target data structure - */ - if (!this.target) { - this.target = createBox(); - this.targetWithTransforms = createBox(); - } - /** - * If we've got a relative box for this component, resolve it into a target relative to the parent. - */ - if (this.relativeTarget && - this.relativeTargetOrigin && - this.relativeParent && - this.relativeParent.target) { - this.forceRelativeParentToResolveTarget(); - calcRelativeBox(this.target, this.relativeTarget, this.relativeParent.target, this.options.layoutAnchor || undefined); - /** - * If we've only got a targetDelta, resolve it into a target - */ - } - else if (this.targetDelta) { - if (Boolean(this.resumingFrom)) { - this.applyTransform(this.layout.layoutBox, false, this.target); - } - else { - copyBoxInto(this.target, this.layout.layoutBox); - } - applyBoxDelta(this.target, this.targetDelta); - } - else { - /** - * If no target, use own layout as target - */ - copyBoxInto(this.target, this.layout.layoutBox); - } - /** - * If we've been told to attempt to resolve a relative target, do so. - */ - if (this.attemptToResolveRelativeTarget) { - this.attemptToResolveRelativeTarget = false; - if (this.options.layoutAnchor !== false && - relativeParent && - Boolean(relativeParent.resumingFrom) === - Boolean(this.resumingFrom) && - !relativeParent.options.layoutScroll && - relativeParent.target && - this.animationProgress !== 1) { - this.createRelativeTarget(relativeParent, this.target, relativeParent.target); - } - else { - this.relativeParent = this.relativeTarget = undefined; - } - } - /** - * Increase debug counter for resolved target deltas - */ - if (statsBuffer.value) { - metrics.calculatedTargetDeltas++; - } - } - getClosestProjectingParent() { - if (!this.parent || - hasScale(this.parent.latestValues) || - has2DTranslate(this.parent.latestValues)) { - return undefined; - } - if (this.parent.isProjecting()) { - return this.parent; - } - else { - return this.parent.getClosestProjectingParent(); - } - } - isProjecting() { - return Boolean((this.relativeTarget || - this.targetDelta || - this.options.layoutRoot) && - this.layout); - } - createRelativeTarget(relativeParent, layout, parentLayout) { - this.relativeParent = relativeParent; - this.linkedParentVersion = relativeParent.layoutVersion; - this.forceRelativeParentToResolveTarget(); - this.relativeTarget = createBox(); - this.relativeTargetOrigin = createBox(); - calcRelativePosition(this.relativeTargetOrigin, layout, parentLayout, this.options.layoutAnchor || undefined); - copyBoxInto(this.relativeTarget, this.relativeTargetOrigin); - } - removeRelativeTarget() { - this.relativeParent = this.relativeTarget = undefined; - } - calcProjection() { - const lead = this.getLead(); - const isShared = Boolean(this.resumingFrom) || this !== lead; - let canSkip = true; - /** - * If this is a normal layout animation and neither this node nor its nearest projecting - * is dirty then we can't skip. - */ - if (this.isProjectionDirty || this.parent?.isProjectionDirty) { - canSkip = false; - } - /** - * If this is a shared layout animation and this node's shared projection is dirty then - * we can't skip. - */ - if (isShared && - (this.isSharedProjectionDirty || this.isTransformDirty)) { - canSkip = false; - } - /** - * If we have resolved the target this frame we must recalculate the - * projection to ensure it visually represents the internal calculations. - */ - if (this.resolvedRelativeTargetAt === frameData.timestamp) { - canSkip = false; - } - if (canSkip) - return; - const { layout, layoutId } = this.options; - /** - * If this section of the tree isn't animating we can - * delete our target sources for the following frame. - */ - this.isTreeAnimating = Boolean((this.parent && this.parent.isTreeAnimating) || - this.currentAnimation || - this.pendingAnimation); - if (!this.isTreeAnimating) { - this.targetDelta = this.relativeTarget = undefined; - } - if (!this.layout || !(layout || layoutId)) - return; - /** - * Reset the corrected box with the latest values from box, as we're then going - * to perform mutative operations on it. - */ - copyBoxInto(this.layoutCorrected, this.layout.layoutBox); - /** - * Record previous tree scales before updating. - */ - const prevTreeScaleX = this.treeScale.x; - const prevTreeScaleY = this.treeScale.y; - /** - * Apply all the parent deltas to this box to produce the corrected box. This - * is the layout box, as it will appear on screen as a result of the transforms of its parents. - */ - applyTreeDeltas(this.layoutCorrected, this.treeScale, this.path, isShared); - /** - * If this layer needs to perform scale correction but doesn't have a target, - * use the layout as the target. - */ - if (lead.layout && - !lead.target && - (this.treeScale.x !== 1 || this.treeScale.y !== 1)) { - lead.target = lead.layout.layoutBox; - lead.targetWithTransforms = createBox(); - } - const { target } = lead; - if (!target) { - /** - * If we don't have a target to project into, but we were previously - * projecting, we want to remove the stored transform and schedule - * a render to ensure the elements reflect the removed transform. - */ - if (this.prevProjectionDelta) { - this.createProjectionDeltas(); - this.scheduleRender(); - } - return; - } - if (!this.projectionDelta || !this.prevProjectionDelta) { - this.createProjectionDeltas(); - } - else { - copyAxisDeltaInto(this.prevProjectionDelta.x, this.projectionDelta.x); - copyAxisDeltaInto(this.prevProjectionDelta.y, this.projectionDelta.y); - } - /** - * Update the delta between the corrected box and the target box before user-set transforms were applied. - * This will allow us to calculate the corrected borderRadius and boxShadow to compensate - * for our layout reprojection, but still allow them to be scaled correctly by the user. - * It might be that to simplify this we may want to accept that user-set scale is also corrected - * and we wouldn't have to keep and calc both deltas, OR we could support a user setting - * to allow people to choose whether these styles are corrected based on just the - * layout reprojection or the final bounding box. - */ - calcBoxDelta(this.projectionDelta, this.layoutCorrected, target, this.latestValues); - if (this.treeScale.x !== prevTreeScaleX || - this.treeScale.y !== prevTreeScaleY || - !axisDeltaEquals(this.projectionDelta.x, this.prevProjectionDelta.x) || - !axisDeltaEquals(this.projectionDelta.y, this.prevProjectionDelta.y)) { - this.hasProjected = true; - this.scheduleRender(); - this.notifyListeners("projectionUpdate", target); - } - /** - * Increase debug counter for recalculated projections - */ - if (statsBuffer.value) { - metrics.calculatedProjections++; - } - } - hide() { - this.isVisible = false; - // TODO: Schedule render - } - show() { - this.isVisible = true; - // TODO: Schedule render - } - scheduleRender(notifyAll = true) { - this.options.visualElement?.scheduleRender(); - if (notifyAll) { - const stack = this.getStack(); - stack && stack.scheduleRender(); - } - if (this.resumingFrom && !this.resumingFrom.instance) { - this.resumingFrom = undefined; - } - } - createProjectionDeltas() { - this.prevProjectionDelta = createDelta(); - this.projectionDelta = createDelta(); - this.projectionDeltaWithTransform = createDelta(); - } - setAnimationOrigin(delta, hasOnlyRelativeTargetChanged = false, pathFn) { - const snapshot = this.snapshot; - const snapshotLatestValues = snapshot ? snapshot.latestValues : {}; - const mixedValues = { ...this.latestValues }; - const targetDelta = createDelta(); - if (!this.relativeParent || - !this.relativeParent.options.layoutRoot) { - this.relativeTarget = this.relativeTargetOrigin = undefined; - } - this.attemptToResolveRelativeTarget = !hasOnlyRelativeTargetChanged; - const relativeLayout = createBox(); - const snapshotSource = snapshot ? snapshot.source : undefined; - const layoutSource = this.layout ? this.layout.source : undefined; - const isSharedLayoutAnimation = snapshotSource !== layoutSource; - const stack = this.getStack(); - const isOnlyMember = !stack || stack.members.length <= 1; - const shouldCrossfadeOpacity = Boolean(isSharedLayoutAnimation && - !isOnlyMember && - this.options.crossfade === true && - !this.path.some(hasOpacityCrossfade)); - this.animationProgress = 0; - let prevRelativeTarget; - // The path decides whether the layout shift is worth curving - // (distance floor) and resolves the interpolator from the delta. - const interpolate = pathFn?.interpolateProjection(delta); - this.mixTargetDelta = (latest) => { - const progress = latest / 1000; - const point = interpolate?.(progress); - if (point) { - targetDelta.x.translate = point.x; - targetDelta.x.scale = mixNumber$1(delta.x.scale, 1, progress); - targetDelta.x.origin = delta.x.origin; - targetDelta.x.originPoint = delta.x.originPoint; - targetDelta.y.translate = point.y; - targetDelta.y.scale = mixNumber$1(delta.y.scale, 1, progress); - targetDelta.y.origin = delta.y.origin; - targetDelta.y.originPoint = delta.y.originPoint; - } - else { - mixAxisDeltaLinear(targetDelta.x, delta.x, progress); - mixAxisDeltaLinear(targetDelta.y, delta.y, progress); - } - this.setTargetDelta(targetDelta); - if (this.relativeTarget && - this.relativeTargetOrigin && - this.layout && - this.relativeParent && - this.relativeParent.layout) { - calcRelativePosition(relativeLayout, this.layout.layoutBox, this.relativeParent.layout.layoutBox, this.options.layoutAnchor || undefined); - mixBox(this.relativeTarget, this.relativeTargetOrigin, relativeLayout, progress); - /** - * If this is an unchanged relative target we can consider the - * projection not dirty. - */ - if (prevRelativeTarget && - boxEquals(this.relativeTarget, prevRelativeTarget)) { - this.isProjectionDirty = false; - } - if (!prevRelativeTarget) - prevRelativeTarget = createBox(); - copyBoxInto(prevRelativeTarget, this.relativeTarget); - } - if (isSharedLayoutAnimation) { - this.animationValues = mixedValues; - mixValues(mixedValues, snapshotLatestValues, this.latestValues, progress, shouldCrossfadeOpacity, isOnlyMember); - } - if (point && point.rotate !== undefined) { - // Dedicated `pathRotation` channel, not `rotate`, so an - // animating `rotate` is composed with, never clobbered. - if (!this.animationValues) - this.animationValues = mixedValues; - this.animationValues.pathRotation = point.rotate; - } - this.root.scheduleUpdateProjection(); - this.scheduleRender(); - this.animationProgress = progress; - }; - this.mixTargetDelta(this.options.layoutRoot ? 1000 : 0); - } - startAnimation(options) { - this.notifyListeners("animationStart"); - this.currentAnimation?.stop(); - this.resumingFrom?.currentAnimation?.stop(); - if (this.pendingAnimation) { - cancelFrame(this.pendingAnimation); - this.pendingAnimation = undefined; - } - /** - * Start the animation in the next frame to have a frame with progress 0, - * where the target is the same as when the animation started, so we can - * calculate the relative positions correctly for instant transitions. - */ - this.pendingAnimation = frame.update(() => { - globalProjectionState.hasAnimatedSinceResize = true; - this.motionValue || (this.motionValue = motionValue(0)); - this.motionValue.jump(0, false); - this.currentAnimation = animateSingleValue(this.motionValue, [0, 1000], { - ...options, - velocity: 0, - isSync: true, - onUpdate: (latest) => { - this.mixTargetDelta(latest); - options.onUpdate && options.onUpdate(latest); - }, - onComplete: () => { - options.onComplete && options.onComplete(); - this.completeAnimation(); - }, - }); - if (this.resumingFrom) { - this.resumingFrom.currentAnimation = this.currentAnimation; - } - this.pendingAnimation = undefined; - }); - } - completeAnimation() { - if (this.resumingFrom) { - this.resumingFrom.currentAnimation = undefined; - this.resumingFrom.preserveOpacity = undefined; - } - const stack = this.getStack(); - stack && stack.exitAnimationComplete(); - this.resumingFrom = - this.currentAnimation = - this.animationValues = - undefined; - this.notifyListeners("animationComplete"); - } - finishAnimation() { - if (this.currentAnimation) { - this.mixTargetDelta && this.mixTargetDelta(animationTarget); - this.currentAnimation.stop(); - } - this.completeAnimation(); - } - applyTransformsToTarget() { - const lead = this.getLead(); - let { targetWithTransforms, target, layout, latestValues } = lead; - if (!targetWithTransforms || !target || !layout) - return; - /** - * If we're only animating position, and this element isn't the lead element, - * then instead of projecting into the lead box we instead want to calculate - * a new target that aligns the two boxes but maintains the layout shape. - */ - if (this !== lead && - this.layout && - layout && - shouldAnimatePositionOnly(this.options.animationType, this.layout.layoutBox, layout.layoutBox)) { - target = this.target || createBox(); - const xLength = calcLength(this.layout.layoutBox.x); - target.x.min = lead.target.x.min; - target.x.max = target.x.min + xLength; - const yLength = calcLength(this.layout.layoutBox.y); - target.y.min = lead.target.y.min; - target.y.max = target.y.min + yLength; - } - copyBoxInto(targetWithTransforms, target); - /** - * Apply the latest user-set transforms to the targetBox to produce the targetBoxFinal. - * This is the final box that we will then project into by calculating a transform delta and - * applying it to the corrected box. - */ - transformBox(targetWithTransforms, latestValues); - /** - * Update the delta between the corrected box and the final target box, after - * user-set transforms are applied to it. This will be used by the renderer to - * create a transform style that will reproject the element from its layout layout - * into the desired bounding box. - */ - calcBoxDelta(this.projectionDeltaWithTransform, this.layoutCorrected, targetWithTransforms, latestValues); - } - registerSharedNode(layoutId, node) { - if (!this.sharedNodes.has(layoutId)) { - this.sharedNodes.set(layoutId, new NodeStack()); - } - const stack = this.sharedNodes.get(layoutId); - stack.add(node); - const config = node.options.initialPromotionConfig; - node.promote({ - transition: config ? config.transition : undefined, - preserveFollowOpacity: config && config.shouldPreserveFollowOpacity - ? config.shouldPreserveFollowOpacity(node) - : undefined, - }); - } - isLead() { - const stack = this.getStack(); - return stack ? stack.lead === this : true; - } - getLead() { - const { layoutId } = this.options; - return layoutId ? this.getStack()?.lead || this : this; - } - getPrevLead() { - const { layoutId } = this.options; - return layoutId ? this.getStack()?.prevLead : undefined; - } - getStack() { - const { layoutId } = this.options; - if (layoutId) - return this.root.sharedNodes.get(layoutId); - } - promote({ needsReset, transition, preserveFollowOpacity, } = {}) { - const stack = this.getStack(); - if (stack) - stack.promote(this, preserveFollowOpacity); - if (needsReset) { - this.projectionDelta = undefined; - this.needsReset = true; - } - if (transition) - this.setOptions({ transition }); - } - relegate() { - const stack = this.getStack(); - if (stack) { - return stack.relegate(this); - } - else { - return false; - } - } - resetSkewAndRotation() { - const { visualElement } = this.options; - if (!visualElement) - return; - // If there's no detected skew or rotation values, we can early return without a forced render. - let hasDistortingTransform = false; - /** - * An unrolled check for rotation values. Most elements don't have any rotation and - * skipping the nested loop and new object creation is 50% faster. - */ - const { latestValues } = visualElement; - if (latestValues.z || - latestValues.rotate || - latestValues.rotateX || - latestValues.rotateY || - latestValues.rotateZ || - latestValues.skewX || - latestValues.skewY) { - hasDistortingTransform = true; - } - // If there's no distorting values, we don't need to do any more. - if (!hasDistortingTransform) - return; - const resetValues = {}; - if (latestValues.z) { - resetDistortingTransform("z", visualElement, resetValues, this.animationValues); - } - // Check the skew and rotate value of all axes and reset to 0 - for (let i = 0; i < transformAxes.length; i++) { - resetDistortingTransform(`rotate${transformAxes[i]}`, visualElement, resetValues, this.animationValues); - resetDistortingTransform(`skew${transformAxes[i]}`, visualElement, resetValues, this.animationValues); - } - // Force a render of this element to apply the transform with all skews and rotations - // set to 0. - visualElement.render(); - // Put back all the values we reset - for (const key in resetValues) { - visualElement.setStaticValue(key, resetValues[key]); - if (this.animationValues) { - this.animationValues[key] = resetValues[key]; - } - } - // Schedule a render for the next frame. This ensures we won't visually - // see the element with the reset rotate value applied. - visualElement.scheduleRender(); - } - applyProjectionStyles(targetStyle, // CSSStyleDeclaration - doesn't allow numbers to be assigned to properties - styleProp) { - if (!this.instance || this.isSVG) - return; - if (!this.isVisible) { - targetStyle.visibility = "hidden"; - return; - } - const transformTemplate = this.getTransformTemplate(); - if (this.needsReset) { - this.needsReset = false; - targetStyle.visibility = ""; - targetStyle.opacity = ""; - targetStyle.pointerEvents = - resolveMotionValue(styleProp?.pointerEvents) || ""; - targetStyle.transform = transformTemplate - ? transformTemplate(this.latestValues, "") - : "none"; - return; - } - const lead = this.getLead(); - if (!this.projectionDelta || !this.layout || !lead.target) { - if (this.options.layoutId) { - targetStyle.opacity = - this.latestValues.opacity !== undefined - ? this.latestValues.opacity - : 1; - targetStyle.pointerEvents = - resolveMotionValue(styleProp?.pointerEvents) || ""; - } - if (this.hasProjected && !hasTransform(this.latestValues)) { - targetStyle.transform = transformTemplate - ? transformTemplate({}, "") - : "none"; - this.hasProjected = false; - } - return; - } - targetStyle.visibility = ""; - const valuesToRender = lead.animationValues || lead.latestValues; - this.applyTransformsToTarget(); - let transform = buildProjectionTransform(this.projectionDeltaWithTransform, this.treeScale, valuesToRender); - if (transformTemplate) { - transform = transformTemplate(valuesToRender, transform); - } - targetStyle.transform = transform; - const { x, y } = this.projectionDelta; - targetStyle.transformOrigin = `${x.origin * 100}% ${y.origin * 100}% 0`; - if (lead.animationValues) { - /** - * If the lead component is animating, assign this either the entering/leaving - * opacity - */ - targetStyle.opacity = - lead === this - ? valuesToRender.opacity ?? - this.latestValues.opacity ?? - 1 - : this.preserveOpacity - ? this.latestValues.opacity - : valuesToRender.opacityExit; - } - else { - /** - * Or we're not animating at all, set the lead component to its layout - * opacity and other components to hidden. - */ - targetStyle.opacity = - lead === this - ? valuesToRender.opacity !== undefined - ? valuesToRender.opacity - : "" - : valuesToRender.opacityExit !== undefined - ? valuesToRender.opacityExit - : 0; - } - /** - * Apply scale correction - */ - for (const key in scaleCorrectors) { - if (valuesToRender[key] === undefined) - continue; - const { correct, applyTo, isCSSVariable } = scaleCorrectors[key]; - /** - * Only apply scale correction to the value if we have an - * active projection transform. Otherwise these values become - * vulnerable to distortion if the element changes size without - * a corresponding layout animation. - */ - const corrected = transform === "none" - ? valuesToRender[key] - : correct(valuesToRender[key], lead); - if (applyTo) { - const num = applyTo.length; - for (let i = 0; i < num; i++) { - targetStyle[applyTo[i]] = corrected; - } - } - else { - // If this is a CSS variable, set it directly on the instance. - // Replacing this function from creating styles to setting them - // would be a good place to remove per frame object creation - if (isCSSVariable) { - this.options.visualElement.renderState.vars[key] = corrected; - } - else { - targetStyle[key] = corrected; - } - } - } - /** - * Disable pointer events on follow components. This is to ensure - * that if a follow component covers a lead component it doesn't block - * pointer events on the lead. - */ - if (this.options.layoutId) { - targetStyle.pointerEvents = - lead === this - ? resolveMotionValue(styleProp?.pointerEvents) || "" - : "none"; - } - } - clearSnapshot() { - this.resumeFrom = this.snapshot = undefined; - } - // Only run on root - resetTree() { - this.root.nodes.forEach((node) => node.currentAnimation?.stop()); - this.root.nodes.forEach(clearMeasurements); - this.root.sharedNodes.clear(); - } - }; - } - function updateLayout(node) { - node.updateLayout(); - } - function notifyLayoutUpdate(node) { - const snapshot = node.resumeFrom?.snapshot || node.snapshot; - if (node.isLead() && - node.layout && - snapshot && - node.hasListeners("didUpdate")) { - const { layoutBox: layout, measuredBox: measuredLayout } = node.layout; - const { animationType } = node.options; - const isShared = snapshot.source !== node.layout.source; - // TODO Maybe we want to also resize the layout snapshot so we don't trigger - // animations for instance if layout="size" and an element has only changed position - if (animationType === "size") { - eachAxis((axis) => { - const axisSnapshot = isShared - ? snapshot.measuredBox[axis] - : snapshot.layoutBox[axis]; - const length = calcLength(axisSnapshot); - axisSnapshot.min = layout[axis].min; - axisSnapshot.max = axisSnapshot.min + length; - }); - } - else if (animationType === "x" || animationType === "y") { - const snapAxis = animationType === "x" ? "y" : "x"; - copyAxisInto(isShared - ? snapshot.measuredBox[snapAxis] - : snapshot.layoutBox[snapAxis], layout[snapAxis]); - } - else if (shouldAnimatePositionOnly(animationType, snapshot.layoutBox, layout)) { - eachAxis((axis) => { - const axisSnapshot = isShared - ? snapshot.measuredBox[axis] - : snapshot.layoutBox[axis]; - const length = calcLength(layout[axis]); - axisSnapshot.max = axisSnapshot.min + length; - /** - * Ensure relative target gets resized and rerendererd - */ - if (node.relativeTarget && !node.currentAnimation) { - node.isProjectionDirty = true; - node.relativeTarget[axis].max = - node.relativeTarget[axis].min + length; - } - }); - } - const layoutDelta = createDelta(); - calcBoxDelta(layoutDelta, layout, snapshot.layoutBox); - const visualDelta = createDelta(); - if (isShared) { - calcBoxDelta(visualDelta, node.applyTransform(measuredLayout, true), snapshot.measuredBox); - } - else { - calcBoxDelta(visualDelta, layout, snapshot.layoutBox); - } - const hasLayoutChanged = !isDeltaZero(layoutDelta); - let hasRelativeLayoutChanged = false; - if (!node.resumeFrom) { - const relativeParent = node.getClosestProjectingParent(); - /** - * If the relativeParent is itself resuming from a different element then - * the relative snapshot is not relavent - */ - if (relativeParent && !relativeParent.resumeFrom) { - const { snapshot: parentSnapshot, layout: parentLayout } = relativeParent; - if (parentSnapshot && parentLayout) { - const anchor = node.options.layoutAnchor || undefined; - const relativeSnapshot = createBox(); - calcRelativePosition(relativeSnapshot, snapshot.layoutBox, parentSnapshot.layoutBox, anchor); - const relativeLayout = createBox(); - calcRelativePosition(relativeLayout, layout, parentLayout.layoutBox, anchor); - if (!boxEqualsRounded(relativeSnapshot, relativeLayout)) { - hasRelativeLayoutChanged = true; - } - if (relativeParent.options.layoutRoot) { - node.relativeTarget = relativeLayout; - node.relativeTargetOrigin = relativeSnapshot; - node.relativeParent = relativeParent; - } - } - } - } - node.notifyListeners("didUpdate", { - layout, - snapshot, - delta: visualDelta, - layoutDelta, - hasLayoutChanged, - hasRelativeLayoutChanged, - }); - } - else if (node.isLead()) { - const { onExitComplete } = node.options; - onExitComplete && onExitComplete(); - } - /** - * Clearing transition - * TODO: Investigate why this transition is being passed in as {type: false } from Framer - * and why we need it at all - */ - node.options.transition = undefined; - } - function propagateDirtyNodes(node) { - /** - * Increase debug counter for nodes encountered this frame - */ - if (statsBuffer.value) { - metrics.nodes++; - } - if (!node.parent) - return; - /** - * If this node isn't projecting, propagate isProjectionDirty. It will have - * no performance impact but it will allow the next child that *is* projecting - * but *isn't* dirty to just check its parent to see if *any* ancestor needs - * correcting. - */ - if (!node.isProjecting()) { - node.isProjectionDirty = node.parent.isProjectionDirty; - } - /** - * Propagate isSharedProjectionDirty and isTransformDirty - * throughout the whole tree. A future revision can take another look at - * this but for safety we still recalcualte shared nodes. - */ - node.isSharedProjectionDirty || (node.isSharedProjectionDirty = Boolean(node.isProjectionDirty || - node.parent.isProjectionDirty || - node.parent.isSharedProjectionDirty)); - node.isTransformDirty || (node.isTransformDirty = node.parent.isTransformDirty); - } - function cleanDirtyNodes(node) { - node.isProjectionDirty = - node.isSharedProjectionDirty = - node.isTransformDirty = - false; - } - function clearSnapshot(node) { - node.clearSnapshot(); - } - function clearMeasurements(node) { - node.clearMeasurements(); - } - function forceLayoutMeasure(node) { - node.isLayoutDirty = true; - node.updateLayout(); - } - function clearIsLayoutDirty(node) { - node.isLayoutDirty = false; - } - /** - * When a node is animation-blocked (e.g. during drag) and its component - * didn't re-render (memoized), willUpdate() is never called so there's - * no snapshot. Use the previous layout as a snapshot and mark dirty so - * resetTransform/updateLayout/notifyLayoutUpdate process it normally. - */ - function ensureDraggedNodesSnapshotted(node) { - if (node.isAnimationBlocked && node.layout && !node.isLayoutDirty) { - node.snapshot = node.layout; - node.isLayoutDirty = true; - } - } - function resetTransformStyle(node) { - const { visualElement } = node.options; - if (visualElement && visualElement.getProps().onBeforeLayoutMeasure) { - visualElement.notify("BeforeLayoutMeasure"); - } - node.resetTransform(); - } - function finishAnimation(node) { - node.finishAnimation(); - node.targetDelta = node.relativeTarget = node.target = undefined; - node.isProjectionDirty = true; - } - function resolveTargetDelta(node) { - node.resolveTargetDelta(); - } - function calcProjection(node) { - node.calcProjection(); - } - function resetSkewAndRotation(node) { - node.resetSkewAndRotation(); - } - function removeLeadSnapshots(stack) { - stack.removeLeadSnapshot(); - } - function mixAxisDeltaLinear(output, delta, p) { - output.translate = mixNumber$1(delta.translate, 0, p); - output.scale = mixNumber$1(delta.scale, 1, p); - output.origin = delta.origin; - output.originPoint = delta.originPoint; - } - function mixAxis(output, from, to, p) { - output.min = mixNumber$1(from.min, to.min, p); - output.max = mixNumber$1(from.max, to.max, p); - } - function mixBox(output, from, to, p) { - mixAxis(output.x, from.x, to.x, p); - mixAxis(output.y, from.y, to.y, p); - } - function hasOpacityCrossfade(node) { - return (node.animationValues && node.animationValues.opacityExit !== undefined); - } - const defaultLayoutTransition = { - duration: 0.45, - ease: [0.4, 0, 0.1, 1], - }; - const userAgentContains = (string) => typeof navigator !== "undefined" && - navigator.userAgent && - navigator.userAgent.toLowerCase().includes(string); - /** - * Measured bounding boxes must be rounded in Safari and - * left untouched in Chrome, otherwise non-integer layouts within scaled-up elements - * can appear to jump. - */ - const roundPoint = userAgentContains("applewebkit/") && !userAgentContains("chrome/") - ? Math.round - : noop; - function roundAxis(axis) { - // Round to the nearest .5 pixels to support subpixel layouts - axis.min = roundPoint(axis.min); - axis.max = roundPoint(axis.max); - } - function roundBox(box) { - roundAxis(box.x); - roundAxis(box.y); - } - function shouldAnimatePositionOnly(animationType, snapshot, layout) { - return (animationType === "position" || - (animationType === "preserve-aspect" && - !isNear(aspectRatio(snapshot), aspectRatio(layout), 0.2))); - } - function checkNodeWasScrollRoot(node) { - return node !== node.root && node.scroll?.wasRoot; - } - - const DocumentProjectionNode = createProjectionNode$1({ - attachResizeListener: (ref, notify) => addDomEvent(ref, "resize", notify), - measureScroll: () => ({ - x: document.documentElement.scrollLeft || document.body?.scrollLeft || 0, - y: document.documentElement.scrollTop || document.body?.scrollTop || 0, - }), - checkIsScrollRoot: () => true, - }); - - const notify = (node) => !node.isLayoutDirty && node.willUpdate(false); - function nodeGroup() { - const nodes = new Set(); - const subscriptions = new WeakMap(); - const dirtyAll = () => nodes.forEach(notify); - return { - add: (node) => { - nodes.add(node); - subscriptions.set(node, node.addEventListener("willUpdate", dirtyAll)); - }, - remove: (node) => { - nodes.delete(node); - const unsubscribe = subscriptions.get(node); - if (unsubscribe) { - unsubscribe(); - subscriptions.delete(node); - } - dirtyAll(); - }, - dirty: dirtyAll, - }; - } - - const rootProjectionNode = { - current: undefined, - }; - const HTMLProjectionNode = createProjectionNode$1({ - measureScroll: (instance) => ({ - x: instance.scrollLeft, - y: instance.scrollTop, - }), - defaultParent: () => { - if (!rootProjectionNode.current) { - const documentNode = new DocumentProjectionNode({}); - documentNode.mount(window); - documentNode.setOptions({ layoutScroll: true }); - rootProjectionNode.current = documentNode; - } - return rootProjectionNode.current; - }, - resetTransform: (instance, value) => { - instance.style.transform = value !== undefined ? value : "none"; - }, - checkIsScrollRoot: (instance) => Boolean(window.getComputedStyle(instance).position === "fixed"), - }); - - const layoutSelector = "[data-layout],[data-layout-id]"; - /** - * All imperatively-created projection nodes live in one persistent tree, - * shared across animateLayout() calls (and with any React-created nodes, - * via the singleton document root). Keyed by element for reuse. - */ - const layoutNodes = new WeakMap(); - /** - * Builders created within the same synchronous tick are flushed together - * as a single "commit": every node is snapshotted before any updateDom - * runs, mirroring React batching renders from different parts of the tree. - */ - let pendingBuilders; - function collectLayoutElements(scope) { - const elements = []; - if (scope instanceof HTMLElement && scope.matches(layoutSelector)) { - elements.push(scope); - } - scope.querySelectorAll(layoutSelector).forEach((element) => { - if (element instanceof HTMLElement) - elements.push(element); - }); - return elements; - } - /** - * Process any work scheduled on the frameloop now. A previous animation - * may have been seeked while paused (controls.time = x) without a frame - * having rendered it - we must materialise that state into the DOM - * before taking snapshots. - */ - function flushPendingFrame() { - if (frameData.isProcessing) - return; - const now = time.now(); - frameData.delta = clamp(0, 1000 / 60, now - frameData.timestamp); - frameData.timestamp = now; - frameData.isProcessing = true; - frameSteps.update.process(frameData); - frameSteps.preRender.process(frameData); - frameSteps.render.process(frameData); - frameData.isProcessing = false; - } - function getProjectionParent(element) { - let ancestor = element.parentElement; - while (ancestor) { - const node = layoutNodes.get(ancestor); - if (node && node.instance) - return node; - ancestor = ancestor.parentElement; - } - return undefined; - } - function createVisualElement() { - return new HTMLVisualElement({ - props: {}, - presenceContext: null, - visualState: { - latestValues: {}, - renderState: { - transform: {}, - transformOrigin: {}, - style: {}, - vars: {}, - }, - }, - }, { allowProjection: true }); - } - function readNodeOptions(element, transition) { - const layoutAttr = element.getAttribute("data-layout"); - const layoutId = element.getAttribute("data-layout-id") ?? undefined; - return { - layoutId, - layout: layoutAttr !== null ? true : undefined, - animationType: (!layoutAttr || layoutAttr === "true" - ? "both" - : layoutAttr), - transition, - }; - } - function prepareNode(element, transition) { - let node = layoutNodes.get(element); - if (!node) { - let visualElement = visualElementStore.get(element); - if (!visualElement) - visualElement = createVisualElement(); - /** - * A first-time element may carry a projection transform in its - * inline style (e.g. it was cloned from an element mid-animation). - * That transform isn't tracked in latestValues so the engine can't - * reset it before measuring - clear it now so the first layout - * measurement isn't inflated. - */ - if (element.style.transform && - !hasTransform(visualElement.latestValues)) { - element.style.transform = ""; - } - node = new HTMLProjectionNode(visualElement.latestValues, getProjectionParent(element)); - visualElement.projection = node; - node.setOptions({ - ...readNodeOptions(element, transition), - visualElement, - }); - node.mount(element); - layoutNodes.set(element, node); - } - else { - node.setOptions(readNodeOptions(element, transition)); - } - node.isPresent = true; - if (node.options.onExitComplete) { - node.setOptions({ onExitComplete: undefined }); - } - return node; - } - function sortDocumentOrder(elements) { - return [...elements].sort((a, b) => a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1); - } - function dropNode(element, node) { - node.setOptions({ onExitComplete: undefined }); - /** - * Stop any lingering animation so it can't leak into future updates. - * A follow node can share its currentAnimation with a surviving lead - * (via resumingFrom), in which case it isn't ours to stop. - */ - const stack = node.getStack(); - if (!stack || node.isLead()) - node.currentAnimation?.stop(); - node.unmount(); - layoutNodes.delete(element); - } - function flushPendingBuilders() { - const builders = pendingBuilders; - pendingBuilders = undefined; - flushPendingFrame(); - /** - * Discover and mount every node across all builders before snapshotting - * any of them. Mounting during an active update flags isLayoutDirty, - * which would make that node's own willUpdate skip its snapshot. - * Document order guarantees ancestors mount before descendants, even - * when they're discovered by different builders. - */ - const targets = new Map(); - for (const builder of builders) { - for (const element of builder.collectTargets()) { - const owners = targets.get(element); - owners ? owners.push(builder) : targets.set(element, [builder]); - } - } - const union = new Map(); - for (const element of sortDocumentOrder(targets.keys())) { - const owners = targets.get(element); - const node = prepareNode(element, owners[owners.length - 1].transitionFor(element)); - for (const owner of owners) - owner.adopt(element, node); - union.set(element, node); - } - union.forEach((node) => { - node.isLayoutDirty = false; - node.willUpdate(); - }); - const updatePromises = []; - for (const builder of builders) { - const result = builder.runUpdate(); - if (result) - updatePromises.push(result); - } - const commit = () => { - /** - * Process all additions before any removals so that, even across - * builders, a removed member knows whether a replacement with the - * same layoutId was added in this commit. - */ - const newMemberIds = new Set(); - for (const builder of builders) { - builder.reconcileAdditions(newMemberIds); - } - for (const builder of builders) { - builder.reconcileRemovals(newMemberIds); - } - let root; - union.forEach((node) => (root || (root = node.root))); - for (const builder of builders) - root || (root = builder.getRoot()); - root?.didUpdate(); - /** - * The root flushes the update on a microtask, synchronously - * processing the frame that creates the layout animations. Collect - * them in a later microtask step of the same pass. - */ - microtask.render(() => { - for (const builder of builders) - builder.finalize(); - }); - }; - updatePromises.length ? Promise.all(updatePromises).then(commit) : commit(); - } - class LayoutAnimationBuilder { - constructor(scope, updateDom, defaultOptions) { - this.scope = scope; - this.updateDom = updateDom; - this.defaultOptions = defaultOptions; - this.sharedTransitions = new Map(); - this.notifyReady = () => { }; - this.rejectReady = () => { }; - this.tracked = new Map(); - this.restorePoints = new Map(); - this.readyPromise = new Promise((resolve, reject) => { - this.notifyReady = resolve; - this.rejectReady = reject; - }); - if (!pendingBuilders) { - pendingBuilders = []; - queueMicrotask(flushPendingBuilders); - } - pendingBuilders.push(this); - } - shared(id, transition) { - this.sharedTransitions.set(id, transition); - return this; - } - then(resolve, reject) { - return this.readyPromise.then(resolve, reject); - } - transitionFor(element) { - const layoutId = element.getAttribute("data-layout-id"); - return ((layoutId && this.sharedTransitions.get(layoutId)) || - this.defaultOptions); - } - adopt(element, node) { - this.tracked.set(element, node); - this.restorePoints.set(element, { - parent: element.parentElement, - next: element.nextSibling, - }); - } - collectTargets() { - return collectLayoutElements(this.scope); - } - runUpdate() { - try { - const result = this.updateDom(); - if (result && typeof result.then === "function") { - return result.then(undefined, (error) => { - this.updateError = error; - }); - } - } - catch (error) { - this.updateError = error; - } - return undefined; - } - reconcileAdditions(newMemberIds) { - for (const element of collectLayoutElements(this.scope)) { - if (this.tracked.has(element)) - continue; - const node = prepareNode(element, this.transitionFor(element)); - this.adopt(element, node); - node.options.layoutId && newMemberIds.add(node.options.layoutId); - } - } - reconcileRemovals(newMemberIds) { - this.tracked.forEach((node, element) => { - if (element.isConnected) - return; - const restore = this.restorePoints.get(element); - this.restorePoints.delete(element); - const { layoutId } = node.options; - const stack = node.getStack(); - const hasSurvivor = stack && - stack.members.some((member) => member !== node && - member.instance - ?.isConnected); - /** - * A removed lead with a surviving stack member - and no - * replacement member added this commit - runs an exit - * crossfade: restore the element to its old position in the - * DOM, relegate it and let the survivor take over. It's - * removed again once the animation completes. - */ - if (layoutId && - node.isLead() && - hasSurvivor && - !newMemberIds.has(layoutId)) { - if (restore && restore.parent.isConnected) { - restore.parent.insertBefore(element, restore.next && restore.next.parentNode === restore.parent - ? restore.next - : null); - node.isPresent = false; - node.setOptions({ - onExitComplete: () => { - element.remove(); - dropNode(element, node); - }, - }); - if (node.relegate()) - return; - element.remove(); - } - } - dropNode(element, node); - this.tracked.delete(element); - }); - } - getRoot() { - let root; - this.tracked.forEach((node) => (root || (root = node.root))); - return root; - } - finalize() { - if (this.updateError) { - this.rejectReady(this.updateError); - return; - } - const animations = new Set(); - this.tracked.forEach((node) => { - if (node.instance && node.currentAnimation) { - animations.add(node.currentAnimation); - } - }); - this.notifyReady(new GroupAnimation([...animations])); - } - } - function parseAnimateLayoutArgs(scopeOrUpdateDom, updateDomOrOptions, options) { - if (typeof scopeOrUpdateDom === "function") { - return { - scope: document, - updateDom: scopeOrUpdateDom, - defaultOptions: updateDomOrOptions, - }; - } - const scope = scopeOrUpdateDom instanceof Document - ? scopeOrUpdateDom - : resolveElements(scopeOrUpdateDom)[0] ?? document; - return { - scope, - updateDom: updateDomOrOptions, - defaultOptions: options, - }; - } - - /** - * @deprecated - * - * Import as `frame` instead. - */ - const sync = frame; - /** - * @deprecated - * - * Use cancelFrame(callback) instead. - */ - const cancelSync = stepsOrder.reduce((acc, key) => { - acc[key] = (process) => cancelFrame(process); - return acc; - }, {}); - - /** - * @public - */ - const MotionConfigContext = React$1.createContext({ - transformPagePoint: (p) => p, - isStatic: false, - reducedMotion: "never", - }); - - /** - * Taken from https://github.com/radix-ui/primitives/blob/main/packages/react/compose-refs/src/compose-refs.tsx - */ - /** - * Set a given ref to a given value - * This utility takes care of different types of refs: callback refs and RefObject(s) - */ - function setRef(ref, value) { - if (typeof ref === "function") { - return ref(value); - } - else if (ref !== null && ref !== undefined) { - ref.current = value; - } - } - /** - * A utility to compose multiple refs together - * Accepts callback refs and RefObject(s) - */ - function composeRefs(...refs) { - return (node) => { - let hasCleanup = false; - const cleanups = refs.map((ref) => { - const cleanup = setRef(ref, node); - if (!hasCleanup && typeof cleanup === "function") { - hasCleanup = true; - } - return cleanup; - }); - // React <19 will log an error to the console if a callback ref returns a - // value. We don't use ref cleanups internally so this will only happen if a - // user's ref callback returns a value, which we only expect if they are - // using the cleanup functionality added in React 19. - if (hasCleanup) { - return () => { - for (let i = 0; i < cleanups.length; i++) { - const cleanup = cleanups[i]; - if (typeof cleanup === "function") { - cleanup(); - } - else { - setRef(refs[i], null); - } - } - }; - } - }; - } - /** - * A custom hook that composes multiple refs - * Accepts callback refs and RefObject(s) - */ - function useComposedRefs(...refs) { - // eslint-disable-next-line react-hooks/exhaustive-deps - return React__namespace.useCallback(composeRefs(...refs), refs); - } - - /** - * Measurement functionality has to be within a separate component - * to leverage snapshot lifecycle. - */ - class PopChildMeasure extends React__namespace.Component { - getSnapshotBeforeUpdate(prevProps) { - const element = this.props.childRef.current; - if (isHTMLElement(element) && prevProps.isPresent && !this.props.isPresent && this.props.pop !== false) { - const parent = element.offsetParent; - const parentWidth = isHTMLElement(parent) - ? parent.offsetWidth || 0 - : 0; - const parentHeight = isHTMLElement(parent) - ? parent.offsetHeight || 0 - : 0; - const computedStyle = getComputedStyle(element); - const size = this.props.sizeRef.current; - size.height = parseFloat(computedStyle.height); - size.width = parseFloat(computedStyle.width); - size.top = element.offsetTop; - size.left = element.offsetLeft; - size.right = parentWidth - size.width - size.left; - size.bottom = parentHeight - size.height - size.top; - size.direction = computedStyle.direction; - } - return null; - } - /** - * Required with getSnapshotBeforeUpdate to stop React complaining. - */ - componentDidUpdate() { } - render() { - return this.props.children; - } - } - function PopChild({ children, isPresent, anchorX, anchorY, root, pop }) { - const id = React$1.useId(); - const ref = React$1.useRef(null); - const size = React$1.useRef({ - width: 0, - height: 0, - top: 0, - left: 0, - right: 0, - bottom: 0, - direction: "ltr", - }); - const { nonce } = React$1.useContext(MotionConfigContext); - /** - * In React 19, refs are passed via props.ref instead of element.ref. - * We check props.ref first (React 19) and fall back to element.ref (React 18). - * - * The composed ref is only used when popping the child out (pop !== false), - * so we avoid reading children.props.ref otherwise. In React 18.3 that read - * triggers a spurious "`ref` is not a prop" warning getter (#3745). - */ - const childRef = pop !== false - ? (children.props?.ref ?? - children?.ref) - : undefined; - const composedRef = useComposedRefs(ref, childRef); - /** - * We create and inject a style block so we can apply this explicit - * sizing in a non-destructive manner by just deleting the style block. - * - * We can't apply size via render as the measurement happens - * in getSnapshotBeforeUpdate (post-render), likewise if we apply the - * styles directly on the DOM node, we might be overwriting - * styles set via the style prop. - */ - React$1.useInsertionEffect(() => { - const { width, height, top, left, right, bottom, direction } = size.current; - if (isPresent || pop === false || !ref.current || !width || !height) - return; - const isRTL = direction === "rtl"; - const x = anchorX === "left" - ? (isRTL ? `right: ${right}` : `left: ${left}`) - : (isRTL ? `left: ${left}` : `right: ${right}`); - const y = anchorY === "bottom" ? `bottom: ${bottom}` : `top: ${top}`; - ref.current.dataset.motionPopId = id; - const style = document.createElement("style"); - if (nonce) - style.nonce = nonce; - const parent = root ?? document.head; - parent.appendChild(style); - if (style.sheet) { - style.sheet.insertRule(` - [data-motion-pop-id="${id}"] { - position: absolute !important; - width: ${width}px !important; - height: ${height}px !important; - ${x}px !important; - ${y}px !important; - } - `); - } - return () => { - ref.current?.removeAttribute("data-motion-pop-id"); - if (parent.contains(style)) { - parent.removeChild(style); - } - }; - }, [isPresent]); - return (jsx(PopChildMeasure, { isPresent: isPresent, childRef: ref, sizeRef: size, pop: pop, children: pop === false - ? children - : React__namespace.cloneElement(children, { ref: composedRef }) })); - } - - const PresenceChild = ({ children, initial, isPresent, onExitComplete, custom, presenceAffectsLayout, mode, anchorX, anchorY, root }) => { - const presenceChildren = useConstant(newChildrenMap); - const id = React$1.useId(); - // Written in a layout effect (not render) so discarded concurrent - // renders can't leave the refs pointing at uncommitted state. - const isPresentRef = React$1.useRef(isPresent); - const onExitCompleteRef = React$1.useRef(onExitComplete); - useIsomorphicLayoutEffect(() => { - isPresentRef.current = isPresent; - onExitCompleteRef.current = onExitComplete; - }); - let isReusedContext = true; - let context = React$1.useMemo(() => { - isReusedContext = false; - return { - id, - initial, - isPresent, - custom, - onExitComplete: (childId) => { - presenceChildren.set(childId, true); - for (const isComplete of presenceChildren.values()) { - if (!isComplete) - return; // can stop searching when any is incomplete - } - onExitComplete && onExitComplete(); - }, - register: (childId) => { - presenceChildren.set(childId, false); - return () => { - presenceChildren.delete(childId); - !isPresentRef.current && - !presenceChildren.size && - onExitCompleteRef.current?.(); - }; - }, - }; - }, [isPresent, presenceChildren, onExitComplete]); - /** - * If the presence of a child affects the layout of the components around it, - * we want to make a new context value to ensure they get re-rendered - * so they can detect that layout change. - */ - if (presenceAffectsLayout && isReusedContext) { - context = { ...context }; - } - React$1.useMemo(() => { - presenceChildren.forEach((_, key) => presenceChildren.set(key, false)); - }, [isPresent]); - /** - * If there's no `motion` components to fire exit animations, we want to remove this - * component immediately. - */ - React__namespace.useEffect(() => { - !isPresent && - !presenceChildren.size && - onExitComplete && - onExitComplete(); - }, [isPresent]); - children = (jsx(PopChild, { pop: mode === "popLayout", isPresent: isPresent, anchorX: anchorX, anchorY: anchorY, root: root, children: children })); - return (jsx(PresenceContext.Provider, { value: context, children: children })); - }; - function newChildrenMap() { - return new Map(); - } - - /** - * When a component is the child of `AnimatePresence`, it can use `usePresence` - * to access information about whether it's still present in the React tree. - * - * ```jsx - * import { usePresence } from "framer-motion" - * - * export const Component = () => { - * const [isPresent, safeToRemove] = usePresence() - * - * useEffect(() => { - * !isPresent && setTimeout(safeToRemove, 1000) - * }, [isPresent]) - * - * return

- * } - * ``` - * - * If `isPresent` is `false`, it means that a component has been removed from the tree, - * but `AnimatePresence` won't really remove it until `safeToRemove` has been called. - * - * @public - */ - function usePresence(subscribe = true) { - const context = React$1.useContext(PresenceContext); - if (context === null) - return [true, null]; - const { isPresent, onExitComplete, register } = context; - // It's safe to call the following hooks conditionally (after an early return) because the context will always - // either be null or non-null for the lifespan of the component. - const id = React$1.useId(); - React$1.useEffect(() => { - if (subscribe) { - return register(id); - } - }, [subscribe]); - const safeToRemove = React$1.useCallback(() => subscribe && onExitComplete && onExitComplete(id), [id, onExitComplete, subscribe]); - return !isPresent && onExitComplete ? [false, safeToRemove] : [true]; - } - /** - * Similar to `usePresence`, except `useIsPresent` simply returns whether or not the component is present. - * There is no `safeToRemove` function. - * - * ```jsx - * import { useIsPresent } from "framer-motion" - * - * export const Component = () => { - * const isPresent = useIsPresent() - * - * useEffect(() => { - * !isPresent && console.log("I've been removed!") - * }, [isPresent]) - * - * return
- * } - * ``` - * - * @public - */ - function useIsPresent() { - return isPresent(React$1.useContext(PresenceContext)); - } - function isPresent(context) { - return context === null ? true : context.isPresent; - } - - const getChildKey = (child) => child.key || ""; - function onlyElements(children) { - const filtered = []; - // We use forEach here instead of map as map mutates the component key by preprending `.$` - React$1.Children.forEach(children, (child) => { - if (React$1.isValidElement(child)) - filtered.push(child); - }); - return filtered; - } - - /** - * `AnimatePresence` enables the animation of components that have been removed from the tree. - * - * When adding/removing more than a single child, every child **must** be given a unique `key` prop. - * - * Any `motion` components that have an `exit` property defined will animate out when removed from - * the tree. - * - * ```jsx - * import { motion, AnimatePresence } from 'framer-motion' - * - * export const Items = ({ items }) => ( - * - * {items.map(item => ( - * - * ))} - * - * ) - * ``` - * - * You can sequence exit animations throughout a tree using variants. - * - * If a child contains multiple `motion` components with `exit` props, it will only unmount the child - * once all `motion` components have finished animating out. Likewise, any components using - * `usePresence` all need to call `safeToRemove`. - * - * @public - */ - const AnimatePresence = ({ children, custom, initial = true, onExitComplete, presenceAffectsLayout = true, mode = "sync", propagate = false, anchorX = "left", anchorY = "top", root }) => { - const [isParentPresent, safeToRemove] = usePresence(propagate); - /** - * Filter any children that aren't ReactElements. We can only track components - * between renders with a props.key. - */ - const presentChildren = React$1.useMemo(() => onlyElements(children), [children]); - /** - * Track the keys of the currently rendered children. This is used to - * determine which children are exiting. - */ - const presentKeys = propagate && !isParentPresent ? [] : presentChildren.map(getChildKey); - /** - * If `initial={false}` we only want to pass this to components in the first render. - */ - const isInitialRender = React$1.useRef(true); - /** - * A ref containing the currently present children. When all exit animations - * are complete, we use this to re-render the component with the latest children - * *committed* rather than the latest children *rendered*. - */ - const pendingPresentChildren = React$1.useRef(presentChildren); - /** - * Track which exiting children have finished animating out. - */ - const exitComplete = useConstant(() => new Map()); - /** - * Track which components are currently processing exit to prevent duplicate processing. - */ - const exitingComponents = React$1.useRef(new Set()); - /** - * Save children to render as React state. To ensure this component is concurrent-safe, - * we check for exiting children via an effect. - */ - const [diffedChildren, setDiffedChildren] = React$1.useState(presentChildren); - const [renderedChildren, setRenderedChildren] = React$1.useState(presentChildren); - useIsomorphicLayoutEffect(() => { - if (propagate && !isParentPresent && !renderedChildren.length) { - safeToRemove?.(); - } - }, [isParentPresent, propagate, renderedChildren.length, safeToRemove]); - useIsomorphicLayoutEffect(() => { - isInitialRender.current = false; - pendingPresentChildren.current = presentChildren; - /** - * Update complete status of exiting children. - */ - for (let i = 0; i < renderedChildren.length; i++) { - const key = getChildKey(renderedChildren[i]); - if (!presentKeys.includes(key)) { - if (exitComplete.get(key) !== true) { - exitComplete.set(key, false); - } - } - else { - exitComplete.delete(key); - exitingComponents.current.delete(key); - } - } - }, [renderedChildren, presentKeys.length, presentKeys.join("-")]); - const exitingChildren = []; - if (presentChildren !== diffedChildren) { - let nextChildren = [...presentChildren]; - /** - * Loop through all the currently rendered components and decide which - * are exiting. - */ - for (let i = 0; i < renderedChildren.length; i++) { - const child = renderedChildren[i]; - const key = getChildKey(child); - if (!presentKeys.includes(key)) { - nextChildren.splice(i, 0, child); - exitingChildren.push(child); - } - } - /** - * If we're in "wait" mode, and we have exiting children, we want to - * only render these until they've all exited. - */ - if (mode === "wait" && exitingChildren.length) { - nextChildren = exitingChildren; - } - setRenderedChildren(onlyElements(nextChildren)); - setDiffedChildren(presentChildren); - /** - * Early return to ensure once we've set state with the latest diffed - * children, we can immediately re-render. - */ - return null; - } - if (mode === "wait" && - renderedChildren.length > 1) { - console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`); - } - /** - * If we've been provided a forceRender function by the LayoutGroupContext, - * we can use it to force a re-render amongst all surrounding components once - * all components have finished animating out. - */ - const { forceRender } = React$1.useContext(LayoutGroupContext); - return (jsx(Fragment, { children: renderedChildren.map((child) => { - const key = getChildKey(child); - const isPresent = propagate && !isParentPresent - ? false - : presentChildren === renderedChildren || - presentKeys.includes(key); - const onExit = () => { - if (exitingComponents.current.has(key)) { - return; - } - if (exitComplete.has(key)) { - exitingComponents.current.add(key); - exitComplete.set(key, true); - } - else { - return; - } - let isEveryExitComplete = true; - exitComplete.forEach((isExitComplete) => { - if (!isExitComplete) - isEveryExitComplete = false; - }); - if (isEveryExitComplete) { - forceRender?.(); - setRenderedChildren(pendingPresentChildren.current); - propagate && safeToRemove?.(); - onExitComplete && onExitComplete(); - } - }; - return (jsx(PresenceChild, { isPresent: isPresent, initial: !isInitialRender.current || initial - ? undefined - : false, custom: custom, presenceAffectsLayout: presenceAffectsLayout, mode: mode, root: root, onExitComplete: isPresent ? undefined : onExit, anchorX: anchorX, anchorY: anchorY, children: child }, key)); - }) })); - }; - - /** - * Note: Still used by components generated by old versions of Framer - * - * @deprecated - */ - const DeprecatedLayoutGroupContext = React$1.createContext(null); - - function useIsMounted() { - const isMounted = React$1.useRef(false); - useIsomorphicLayoutEffect(() => { - isMounted.current = true; - return () => { - isMounted.current = false; - }; - }, []); - return isMounted; - } - - function useForceUpdate() { - const isMounted = useIsMounted(); - const [forcedRenderCount, setForcedRenderCount] = React$1.useState(0); - const forceRender = React$1.useCallback(() => { - isMounted.current && setForcedRenderCount(forcedRenderCount + 1); - }, [forcedRenderCount]); - /** - * Defer this to the end of the next animation frame in case there are multiple - * synchronous calls. - */ - const deferredForceRender = React$1.useCallback(() => frame.postRender(forceRender), [forceRender]); - return [deferredForceRender, forcedRenderCount]; - } - - const shouldInheritGroup = (inherit) => inherit === true; - const shouldInheritId = (inherit) => shouldInheritGroup(inherit === true) || inherit === "id"; - const LayoutGroup = ({ children, id, inherit = true }) => { - const layoutGroupContext = React$1.useContext(LayoutGroupContext); - const deprecatedLayoutGroupContext = React$1.useContext(DeprecatedLayoutGroupContext); - const [forceRender, key] = useForceUpdate(); - const context = React$1.useRef(null); - const upstreamId = layoutGroupContext.id || deprecatedLayoutGroupContext; - if (context.current === null) { - if (shouldInheritId(inherit) && upstreamId) { - id = id ? upstreamId + "-" + id : upstreamId; - } - context.current = { - id, - group: shouldInheritGroup(inherit) - ? layoutGroupContext.group || nodeGroup() - : nodeGroup(), - }; - } - const memoizedContext = React$1.useMemo(() => ({ ...context.current, forceRender }), [key]); - return (jsx(LayoutGroupContext.Provider, { value: memoizedContext, children: children })); - }; - - const LazyContext = React$1.createContext({ strict: false }); - - const featureProps = { - animation: [ - "animate", - "variants", - "whileHover", - "whileTap", - "exit", - "whileInView", - "whileFocus", - "whileDrag", - ], - exit: ["exit"], - drag: ["drag", "dragControls"], - focus: ["whileFocus"], - hover: ["whileHover", "onHoverStart", "onHoverEnd"], - tap: ["whileTap", "onTap", "onTapStart", "onTapCancel"], - pan: ["onPan", "onPanStart", "onPanSessionStart", "onPanEnd"], - inView: ["whileInView", "onViewportEnter", "onViewportLeave"], - layout: ["layout", "layoutId"], - }; - let isInitialized = false; - /** - * Initialize feature definitions with isEnabled checks. - * This must be called before any motion components are rendered. - */ - function initFeatureDefinitions() { - if (isInitialized) - return; - const initialFeatureDefinitions = {}; - for (const key in featureProps) { - initialFeatureDefinitions[key] = { - isEnabled: (props) => featureProps[key].some((name) => !!props[name]), - }; - } - setFeatureDefinitions(initialFeatureDefinitions); - isInitialized = true; - } - /** - * Get the current feature definitions, initializing if needed. - */ - function getInitializedFeatureDefinitions() { - initFeatureDefinitions(); - return getFeatureDefinitions(); - } - - function loadFeatures(features) { - const featureDefinitions = getInitializedFeatureDefinitions(); - for (const key in features) { - featureDefinitions[key] = { - ...featureDefinitions[key], - ...features[key], - }; - } - setFeatureDefinitions(featureDefinitions); - } - - /** - * Used in conjunction with the `m` component to reduce bundle size. - * - * `m` is a version of the `motion` component that only loads functionality - * critical for the initial render. - * - * `LazyMotion` can then be used to either synchronously or asynchronously - * load animation and gesture support. - * - * ```jsx - * // Synchronous loading - * import { LazyMotion, m, domAnimation } from "framer-motion" - * - * function App() { - * return ( - * - * - * - * ) - * } - * - * // Asynchronous loading - * import { LazyMotion, m } from "framer-motion" - * - * function App() { - * return ( - * import('./path/to/domAnimation')}> - * - * - * ) - * } - * ``` - * - * @public - */ - function LazyMotion({ children, features, strict = false }) { - const [, setIsLoaded] = React$1.useState(!isLazyBundle(features)); - const loadedRenderer = React$1.useRef(undefined); - /** - * If this is a synchronous load, load features immediately - */ - if (!isLazyBundle(features)) { - const { renderer, ...loadedFeatures } = features; - loadedRenderer.current = renderer; - loadFeatures(loadedFeatures); - } - React$1.useEffect(() => { - if (isLazyBundle(features)) { - features().then(({ renderer, ...loadedFeatures }) => { - loadFeatures(loadedFeatures); - loadedRenderer.current = renderer; - setIsLoaded(true); - }); - } - }, []); - return (jsx(LazyContext.Provider, { value: { renderer: loadedRenderer.current, strict }, children: children })); - } - function isLazyBundle(features) { - return typeof features === "function"; - } - - /** - * `MotionConfig` is used to set configuration options for all children `motion` components. - * - * ```jsx - * import { motion, MotionConfig } from "framer-motion" - * - * export function App() { - * return ( - * - * - * - * ) - * } - * ``` - * - * @public - */ - function MotionConfig({ children, ...config }) { - /** - * Inherit props from any parent MotionConfig components - */ - const parentConfig = React$1.useContext(MotionConfigContext); - config = { ...parentConfig, ...config }; - config.transition = resolveTransition(config.transition, parentConfig.transition); - /** - * Don't allow isStatic to change between renders as it affects how many hooks - * motion components fire. - */ - config.isStatic = useConstant(() => config.isStatic); - /** - * Creating a new config context object will re-render every `motion` component - * every time it renders. So we only want to create a new one sparingly. - */ - const context = React$1.useMemo(() => config, [ - JSON.stringify(config.transition), - config.transformPagePoint, - config.reducedMotion, - config.skipAnimations, - config.isValidProp, - ]); - return (jsx(MotionConfigContext.Provider, { value: context, children: children })); - } - - const ReorderContext = React$1.createContext(null); - - /** - * We keep these listed separately as we use the lowercase tag names as part - * of the runtime bundle to detect SVG components - */ - const lowercaseSVGElements = [ - "animate", - "circle", - "defs", - "desc", - "ellipse", - "g", - "image", - "line", - "filter", - "marker", - "mask", - "metadata", - "path", - "pattern", - "polygon", - "polyline", - "rect", - "stop", - "switch", - "symbol", - "svg", - "text", - "tspan", - "use", - "view", - ]; - - function isSVGComponent(Component) { - if ( - /** - * If it's not a string, it's a custom React component. Currently we only support - * HTML custom React components. - */ - typeof Component !== "string" || - /** - * If it contains a dash, the element is a custom HTML webcomponent. - */ - Component.includes("-")) { - return false; - } - else if ( - /** - * If it's in our list of lowercase SVG tags, it's an SVG component - */ - lowercaseSVGElements.indexOf(Component) > -1 || - /** - * If it contains a capital letter, it's an SVG component - */ - /[A-Z]/u.test(Component)) { - return true; - } - return false; - } - - const createDomVisualElement = (Component, options) => { - /** - * Use explicit isSVG override if provided, otherwise auto-detect - */ - const isSVG = options.isSVG ?? isSVGComponent(Component); - return isSVG - ? new SVGVisualElement(options) - : new HTMLVisualElement(options, { - allowProjection: Component !== React$1.Fragment, - }); - }; - - const MotionContext = /* @__PURE__ */ React$1.createContext({}); - - function getCurrentTreeVariants(props, context) { - if (isControllingVariants(props)) { - const { initial, animate } = props; - return { - initial: initial === false || isVariantLabel(initial) - ? initial - : undefined, - animate: isVariantLabel(animate) ? animate : undefined, - }; - } - return props.inherit !== false ? context : {}; - } - - function useCreateMotionContext(props) { - const { initial, animate } = getCurrentTreeVariants(props, React$1.useContext(MotionContext)); - return React$1.useMemo(() => ({ initial, animate }), [variantLabelsAsDependency(initial), variantLabelsAsDependency(animate)]); - } - function variantLabelsAsDependency(prop) { - return Array.isArray(prop) ? prop.join(" ") : prop; - } - - const createHtmlRenderState = () => ({ - style: {}, - transform: {}, - transformOrigin: {}, - vars: {}, - }); - - function copyRawValuesOnly(target, source, props) { - for (const key in source) { - if (!isMotionValue(source[key]) && !isForcedMotionValue(key, props)) { - target[key] = source[key]; - } - } - } - function useInitialMotionValues({ transformTemplate }, visualState) { - return React$1.useMemo(() => { - const state = createHtmlRenderState(); - buildHTMLStyles(state, visualState, transformTemplate); - return Object.assign({}, state.vars, state.style); - }, [visualState]); - } - function useStyle(props, visualState) { - const styleProp = props.style || {}; - const style = {}; - /** - * Copy non-Motion Values straight into style - */ - copyRawValuesOnly(style, styleProp, props); - Object.assign(style, useInitialMotionValues(props, visualState)); - return style; - } - function useHTMLProps(props, visualState) { - // The `any` isn't ideal but it is the type of createElement props argument - const htmlProps = {}; - const style = useStyle(props, visualState); - if (props.drag && props.dragListener !== false) { - // Disable the ghost element when a user drags - htmlProps.draggable = false; - // Disable text selection - style.userSelect = - style.WebkitUserSelect = - style.WebkitTouchCallout = - "none"; - // Disable scrolling on the draggable direction - style.touchAction = - props.drag === true - ? "none" - : `pan-${props.drag === "x" ? "y" : "x"}`; - } - if (props.tabIndex === undefined && - (props.onTap || props.onTapStart || props.whileTap)) { - htmlProps.tabIndex = 0; - } - htmlProps.style = style; - return htmlProps; - } - - const createSvgRenderState = () => ({ - ...createHtmlRenderState(), - attrs: {}, - }); - - function useSVGProps(props, visualState, _isStatic, Component) { - const visualProps = React$1.useMemo(() => { - const state = createSvgRenderState(); - buildSVGAttrs(state, visualState, isSVGTag(Component), props.transformTemplate, props.style); - return { - ...state.attrs, - style: { ...state.style }, - }; - }, [visualState]); - if (props.style) { - const rawStyles = {}; - copyRawValuesOnly(rawStyles, props.style, props); - visualProps.style = { ...rawStyles, ...visualProps.style }; - } - return visualProps; - } - - /** - * A list of all valid MotionProps. - * - * @privateRemarks - * This doesn't throw if a `MotionProp` name is missing - it should. - */ - const validMotionProps = new Set([ - "animate", - "exit", - "variants", - "initial", - "style", - "values", - "variants", - "transition", - "transformTemplate", - "custom", - "inherit", - "onBeforeLayoutMeasure", - "onAnimationStart", - "onAnimationComplete", - "onUpdate", - "onDragStart", - "onDrag", - "onDragEnd", - "onMeasureDragConstraints", - "onDirectionLock", - "onDragTransitionEnd", - "_dragX", - "_dragY", - "onHoverStart", - "onHoverEnd", - "onViewportEnter", - "onViewportLeave", - "globalTapTarget", - "propagate", - "ignoreStrict", - "viewport", - ]); - /** - * Check whether a prop name is a valid `MotionProp` key. - * - * @param key - Name of the property to check - * @returns `true` is key is a valid `MotionProp`. - * - * @public - */ - function isValidMotionProp(key) { - return (key.startsWith("while") || - (key.startsWith("drag") && key !== "draggable") || - key.startsWith("layout") || - key.startsWith("onTap") || - key.startsWith("onPan") || - key.startsWith("onLayout") || - validMotionProps.has(key)); - } - - function shouldForward(key, isValidProp) { - return key.startsWith("on") - ? !isValidMotionProp(key) - : isValidProp?.(key) ?? !isValidMotionProp(key); - } - function filterProps(props, isDom, forwardMotionProps, isValidProp) { - const filteredProps = {}; - for (const key in props) { - /** - * values is considered a valid prop by Emotion, so if it's present - * this will be rendered out to the DOM unless explicitly filtered. - * - * We check the type as it could be used with the `feColorMatrix` - * element, which we support. - */ - if (key === "values" && typeof props.values === "object") - continue; - if (isMotionValue(props[key])) - continue; - if (shouldForward(key, isValidProp) || - (forwardMotionProps === true && isValidMotionProp(key)) || - (!isDom && !isValidMotionProp(key)) || - // If trying to use native HTML drag events, forward drag listeners - (props["draggable"] && - key.startsWith("onDrag"))) { - filteredProps[key] = - props[key]; - } - } - return filteredProps; - } - - function useRender(Component, props, ref, { latestValues, }, isStatic, forwardMotionProps = false, isSVG, isValidProp) { - const useVisualProps = (isSVG ?? isSVGComponent(Component)) ? useSVGProps : useHTMLProps; - const visualProps = useVisualProps(props, latestValues, isStatic, Component); - const filteredProps = filterProps(props, typeof Component === "string", forwardMotionProps, isValidProp); - const elementProps = Component !== React$1.Fragment ? { ...filteredProps, ...visualProps, ref } : {}; - /** - * If component has been handed a motion value as its child, - * memoise its initial value and render that. Subsequent updates - * will be handled by the onChange handler - */ - const { children } = props; - const renderedChildren = React$1.useMemo(() => (isMotionValue(children) ? children.get() : children), [children]); - return React$1.createElement(Component, { - ...elementProps, - children: renderedChildren, - }); - } - - function makeState({ scrapeMotionValuesFromProps, createRenderState, }, props, context, presenceContext) { - const state = { - latestValues: makeLatestValues(props, context, presenceContext, scrapeMotionValuesFromProps), - renderState: createRenderState(), - }; - return state; - } - function makeLatestValues(props, context, presenceContext, scrapeMotionValues) { - const values = {}; - const motionValues = scrapeMotionValues(props, {}); - for (const key in motionValues) { - values[key] = resolveMotionValue(motionValues[key]); - } - let { initial, animate } = props; - const isControllingVariants$1 = isControllingVariants(props); - const isVariantNode$1 = isVariantNode(props); - if (context && - isVariantNode$1 && - !isControllingVariants$1 && - props.inherit !== false) { - if (initial === undefined) - initial = context.initial; - if (animate === undefined) - animate = context.animate; - } - let isInitialAnimationBlocked = presenceContext - ? presenceContext.initial === false - : false; - isInitialAnimationBlocked = isInitialAnimationBlocked || initial === false; - const variantToSet = isInitialAnimationBlocked ? animate : initial; - if (variantToSet && - typeof variantToSet !== "boolean" && - !isAnimationControls(variantToSet)) { - const list = Array.isArray(variantToSet) ? variantToSet : [variantToSet]; - for (let i = 0; i < list.length; i++) { - const resolved = resolveVariantFromProps(props, list[i]); - if (resolved) { - const { transitionEnd, transition, ...target } = resolved; - for (const key in target) { - let valueTarget = target[key]; - if (Array.isArray(valueTarget)) { - /** - * Take final keyframe if the initial animation is blocked because - * we want to initialise at the end of that blocked animation. - */ - const index = isInitialAnimationBlocked - ? valueTarget.length - 1 - : 0; - valueTarget = valueTarget[index]; - } - if (valueTarget !== null) { - values[key] = valueTarget; - } - } - for (const key in transitionEnd) { - values[key] = transitionEnd[key]; - } - } - } - } - return values; - } - const makeUseVisualState = (config) => (props, isStatic) => { - const context = React$1.useContext(MotionContext); - const presenceContext = React$1.useContext(PresenceContext); - const make = () => makeState(config, props, context, presenceContext); - return isStatic ? make() : useConstant(make); - }; - - const useHTMLVisualState = /*@__PURE__*/ makeUseVisualState({ - scrapeMotionValuesFromProps: scrapeMotionValuesFromProps$1, - createRenderState: createHtmlRenderState, - }); - - const useSVGVisualState = /*@__PURE__*/ makeUseVisualState({ - scrapeMotionValuesFromProps: scrapeMotionValuesFromProps, - createRenderState: createSvgRenderState, - }); - - const motionComponentSymbol = Symbol.for("motionComponentSymbol"); - - /** - * Creates a ref function that, when called, hydrates the provided - * external ref and VisualElement. - */ - function useMotionRef(visualState, visualElement, externalRef) { - /** - * Store externalRef in a ref to avoid including it in the useCallback - * dependency array. Including externalRef in dependencies causes issues - * with libraries like Radix UI that create new callback refs on each render - * when using asChild - this would cause the callback to be recreated, - * triggering element remounts and breaking AnimatePresence exit animations. - */ - const externalRefContainer = React$1.useRef(externalRef); - React$1.useInsertionEffect(() => { - externalRefContainer.current = externalRef; - }); - // Store cleanup function returned by callback refs (React 19 feature) - const refCleanup = React$1.useRef(null); - return React$1.useCallback((instance) => { - if (instance) { - visualState.onMount?.(instance); - } - if (visualElement) { - instance ? visualElement.mount(instance) : visualElement.unmount(); - } - const ref = externalRefContainer.current; - if (typeof ref === "function") { - if (instance) { - const cleanup = ref(instance); - if (typeof cleanup === "function") { - refCleanup.current = cleanup; - } - } - else if (refCleanup.current) { - refCleanup.current(); - refCleanup.current = null; - } - else { - ref(instance); - } - } - else if (ref) { - ref.current = instance; - } - }, [visualElement]); - } - - /** - * Internal, exported only for usage in Framer - */ - const SwitchLayoutGroupContext = React$1.createContext({}); - - function isRefObject(ref) { - return (ref && - typeof ref === "object" && - Object.prototype.hasOwnProperty.call(ref, "current")); - } - - function useVisualElement(Component, visualState, props, createVisualElement, ProjectionNodeConstructor, isSVG) { - const { visualElement: parent } = React$1.useContext(MotionContext); - const lazyContext = React$1.useContext(LazyContext); - const presenceContext = React$1.useContext(PresenceContext); - const motionConfig = React$1.useContext(MotionConfigContext); - const reducedMotionConfig = motionConfig.reducedMotion; - const skipAnimations = motionConfig.skipAnimations; - const visualElementRef = React$1.useRef(null); - /** - * Track whether the component has been through React's commit phase. - * Used to detect when LazyMotion features load after the component has mounted. - */ - const hasMountedOnce = React$1.useRef(false); - /** - * If we haven't preloaded a renderer, check to see if we have one lazy-loaded - */ - createVisualElement = - createVisualElement || - lazyContext.renderer; - if (!visualElementRef.current && createVisualElement) { - visualElementRef.current = createVisualElement(Component, { - visualState, - parent, - props, - presenceContext, - blockInitialAnimation: presenceContext - ? presenceContext.initial === false - : false, - reducedMotionConfig, - skipAnimations, - isSVG, - }); - /** - * If the component has already mounted before features loaded (e.g. via - * LazyMotion with async feature loading), we need to force the initial - * animation to run. Otherwise state changes that occurred before features - * loaded will be lost and the element will snap to its final state. - */ - if (hasMountedOnce.current && visualElementRef.current) { - visualElementRef.current.manuallyAnimateOnMount = true; - } - } - const visualElement = visualElementRef.current; - /** - * Load Motion gesture and animation features. These are rendered as renderless - * components so each feature can optionally make use of React lifecycle methods. - */ - const initialLayoutGroupConfig = React$1.useContext(SwitchLayoutGroupContext); - if (visualElement && - !visualElement.projection && - ProjectionNodeConstructor && - (visualElement.type === "html" || visualElement.type === "svg")) { - createProjectionNode(visualElementRef.current, props, ProjectionNodeConstructor, initialLayoutGroupConfig); - } - const isMounted = React$1.useRef(false); - React$1.useInsertionEffect(() => { - /** - * Check the component has already mounted before calling - * `update` unnecessarily. This ensures we skip the initial update. - */ - if (visualElement && isMounted.current) { - visualElement.update(props, presenceContext); - } - }); - /** - * Cache this value as we want to know whether HandoffAppearAnimations - * was present on initial render - it will be deleted after this. - */ - const optimisedAppearId = props[optimizedAppearDataAttribute]; - const wantsHandoff = React$1.useRef(Boolean(optimisedAppearId) && - typeof window !== "undefined" && - !window.MotionHandoffIsComplete?.(optimisedAppearId) && - window.MotionHasOptimisedAnimation?.(optimisedAppearId)); - useIsomorphicLayoutEffect(() => { - /** - * Track that this component has mounted. This is used to detect when - * LazyMotion features load after the component has already committed. - */ - hasMountedOnce.current = true; - if (!visualElement) - return; - isMounted.current = true; - window.MotionIsMounted = true; - visualElement.updateFeatures(); - visualElement.scheduleRenderMicrotask(); - /** - * Ideally this function would always run in a useEffect. - * - * However, if we have optimised appear animations to handoff from, - * it needs to happen synchronously to ensure there's no flash of - * incorrect styles in the event of a hydration error. - * - * So if we detect a situtation where optimised appear animations - * are running, we use useLayoutEffect to trigger animations. - */ - if (wantsHandoff.current && visualElement.animationState) { - visualElement.animationState.animateChanges(); - } - }); - React$1.useEffect(() => { - if (!visualElement) - return; - if (!wantsHandoff.current && visualElement.animationState) { - visualElement.animationState.animateChanges(); - } - if (wantsHandoff.current) { - // This ensures all future calls to animateChanges() in this component will run in useEffect - queueMicrotask(() => { - window.MotionHandoffMarkAsComplete?.(optimisedAppearId); - }); - wantsHandoff.current = false; - } - /** - * Now we've finished triggering animations for this element we - * can wipe the enteringChildren set for the next render. - */ - visualElement.enteringChildren = undefined; - }); - return visualElement; - } - function createProjectionNode(visualElement, props, ProjectionNodeConstructor, initialPromotionConfig) { - const { layoutId, layout, drag, dragConstraints, layoutScroll, layoutRoot, layoutAnchor, layoutCrossfade, } = props; - visualElement.projection = new ProjectionNodeConstructor(visualElement.latestValues, props["data-framer-portal-id"] - ? undefined - : getClosestProjectingNode(visualElement.parent)); - visualElement.projection.setOptions({ - layoutId, - layout, - alwaysMeasureLayout: Boolean(drag) || (dragConstraints && isRefObject(dragConstraints)), - visualElement, - /** - * TODO: Update options in an effect. This could be tricky as it'll be too late - * to update by the time layout animations run. - * We also need to fix this safeToRemove by linking it up to the one returned by usePresence, - * ensuring it gets called if there's no potential layout animations. - * - */ - animationType: typeof layout === "string" ? layout : "both", - initialPromotionConfig, - crossfade: layoutCrossfade, - layoutScroll, - layoutRoot, - layoutAnchor, - }); - } - function getClosestProjectingNode(visualElement) { - if (!visualElement) - return undefined; - return visualElement.options.allowProjection !== false - ? visualElement.projection - : getClosestProjectingNode(visualElement.parent); - } - - /** - * Create a `motion` component. - * - * This function accepts a Component argument, which can be either a string (ie "div" - * for `motion.div`), or an actual React component. - * - * Alongside this is a config option which provides a way of rendering the provided - * component "offline", or outside the React render cycle. - */ - function createMotionComponent(Component, { forwardMotionProps = false, type } = {}, preloadedFeatures, createVisualElement) { - preloadedFeatures && loadFeatures(preloadedFeatures); - /** - * Determine whether to use SVG or HTML rendering based on: - * 1. Explicit `type` option (highest priority) - * 2. Auto-detection via `isSVGComponent` - */ - const isSVG = type ? type === "svg" : isSVGComponent(Component); - const useVisualState = isSVG ? useSVGVisualState : useHTMLVisualState; - function MotionDOMComponent(props, externalRef) { - /** - * If we need to measure the element we load this functionality in a - * separate class component in order to gain access to getSnapshotBeforeUpdate. - */ - let MeasureLayout; - const configAndProps = { - ...React$1.useContext(MotionConfigContext), - ...props, - layoutId: useLayoutId(props), - }; - const { isStatic, isValidProp } = configAndProps; - const context = useCreateMotionContext(props); - const visualState = useVisualState(props, isStatic); - if (!isStatic && typeof window !== "undefined") { - useStrictMode(configAndProps, preloadedFeatures); - const layoutProjection = getProjectionFunctionality(configAndProps); - MeasureLayout = layoutProjection.MeasureLayout; - /** - * Create a VisualElement for this component. A VisualElement provides a common - * interface to renderer-specific APIs (ie DOM/Three.js etc) as well as - * providing a way of rendering to these APIs outside of the React render loop - * for more performant animations and interactions - */ - context.visualElement = useVisualElement(Component, visualState, configAndProps, createVisualElement, layoutProjection.ProjectionNode, isSVG); - } - /** - * The mount order and hierarchy is specific to ensure our element ref - * is hydrated by the time features fire their effects. - */ - return (jsxs(MotionContext.Provider, { value: context, children: [MeasureLayout && context.visualElement ? (jsx(MeasureLayout, { visualElement: context.visualElement, ...configAndProps })) : null, useRender(Component, props, useMotionRef(visualState, context.visualElement, externalRef), visualState, isStatic, forwardMotionProps, isSVG, isValidProp)] })); - } - MotionDOMComponent.displayName = `motion.${typeof Component === "string" - ? Component - : `create(${Component.displayName ?? Component.name ?? ""})`}`; - const ForwardRefMotionComponent = React$1.forwardRef(MotionDOMComponent); - ForwardRefMotionComponent[motionComponentSymbol] = Component; - return ForwardRefMotionComponent; - } - function useLayoutId({ layoutId }) { - const layoutGroupId = React$1.useContext(LayoutGroupContext).id; - return layoutGroupId && layoutId !== undefined - ? layoutGroupId + "-" + layoutId - : layoutId; - } - function useStrictMode(configAndProps, preloadedFeatures) { - const isStrict = React$1.useContext(LazyContext).strict; - /** - * If we're in development mode, check to make sure we're not rendering a motion component - * as a child of LazyMotion, as this will break the file-size benefits of using it. - */ - if (preloadedFeatures && - isStrict) { - const strictMessage = "You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead."; - configAndProps.ignoreStrict - ? exports.warning(false, strictMessage, "lazy-strict-mode") - : exports.invariant(false, strictMessage, "lazy-strict-mode"); - } - } - function getProjectionFunctionality(props) { - const featureDefinitions = getInitializedFeatureDefinitions(); - const { drag, layout } = featureDefinitions; - if (!drag && !layout) - return {}; - const combined = { ...drag, ...layout }; - return { - MeasureLayout: drag?.isEnabled(props) || layout?.isEnabled(props) - ? combined.MeasureLayout - : undefined, - ProjectionNode: combined.ProjectionNode, - }; - } - - function createMotionProxy(preloadedFeatures, createVisualElement) { - if (typeof Proxy === "undefined") { - return createMotionComponent; - } - /** - * A cache of generated `motion` components, e.g `motion.div`, `motion.input` etc. - * Rather than generating them anew every render. - */ - const componentCache = new Map(); - const factory = (Component, options) => { - return createMotionComponent(Component, options, preloadedFeatures, createVisualElement); - }; - /** - * Support for deprecated`motion(Component)` pattern - */ - const deprecatedFactoryFunction = (Component, options) => { - { - warnOnce(false, "motion() is deprecated. Use motion.create() instead."); - } - return factory(Component, options); - }; - return new Proxy(deprecatedFactoryFunction, { - /** - * Called when `motion` is referenced with a prop: `motion.div`, `motion.input` etc. - * The prop name is passed through as `key` and we can use that to generate a `motion` - * DOM component with that name. - */ - get: (_target, key) => { - if (key === "create") - return factory; - /** - * If this element doesn't exist in the component cache, create it and cache. - */ - if (!componentCache.has(key)) { - componentCache.set(key, createMotionComponent(key, undefined, preloadedFeatures, createVisualElement)); - } - return componentCache.get(key); - }, - }); - } - - class AnimationFeature extends Feature { - /** - * We dynamically generate the AnimationState manager as it contains a reference - * to the underlying animation library. We only want to load that if we load this, - * so people can optionally code split it out using the `m` component. - */ - constructor(node) { - super(node); - node.animationState || (node.animationState = createAnimationState(node)); - } - updateAnimationControlsSubscription() { - const { animate } = this.node.getProps(); - if (isAnimationControls(animate)) { - this.unmountControls = animate.subscribe(this.node); - } - } - /** - * Subscribe any provided AnimationControls to the component's VisualElement - */ - mount() { - this.updateAnimationControlsSubscription(); - } - update() { - const { animate } = this.node.getProps(); - const { animate: prevAnimate } = this.node.prevProps || {}; - if (animate !== prevAnimate) { - this.updateAnimationControlsSubscription(); - } - } - unmount() { - this.node.animationState.reset(); - this.unmountControls?.(); - } - } - - let id$1 = 0; - class ExitAnimationFeature extends Feature { - constructor() { - super(...arguments); - this.id = id$1++; - this.isExitComplete = false; - } - update() { - if (!this.node.presenceContext) - return; - const { isPresent, onExitComplete } = this.node.presenceContext; - const { isPresent: prevIsPresent } = this.node.prevPresenceContext || {}; - if (!this.node.animationState || isPresent === prevIsPresent) { - return; - } - if (isPresent && prevIsPresent === false) { - /** - * When re-entering, if the exit animation already completed - * (element is at rest), reset to initial values so the enter - * animation replays from the correct position. - */ - if (this.isExitComplete) { - const { initial, custom } = this.node.getProps(); - if (typeof initial === "string" || - (typeof initial === "object" && - initial !== null && - !Array.isArray(initial))) { - const resolved = resolveVariant(this.node, initial, custom); - if (resolved) { - const { transition, transitionEnd, ...target } = resolved; - for (const key in target) { - this.node - .getValue(key) - ?.jump(target[key]); - } - } - } - this.node.animationState.reset(); - this.node.animationState.animateChanges(); - } - else { - this.node.animationState.setActive("exit", false); - } - this.isExitComplete = false; - return; - } - const exitAnimation = this.node.animationState.setActive("exit", !isPresent); - if (onExitComplete && !isPresent) { - exitAnimation.then(() => { - this.isExitComplete = true; - onExitComplete(this.id); - }); - } - } - mount() { - const { register, onExitComplete } = this.node.presenceContext || {}; - if (onExitComplete) { - onExitComplete(this.id); - } - if (register) { - this.unmount = register(this.id); - } - } - unmount() { } - } - - const animations = { - animation: { - Feature: AnimationFeature, - }, - exit: { - Feature: ExitAnimationFeature, - }, - }; - - function extractEventInfo(event) { - return { - point: { - x: event.pageX, - y: event.pageY, - }, - }; - } - const addPointerInfo = (handler) => (event) => isPrimaryPointer(event) && handler(event, extractEventInfo(event)); - - function addPointerEvent(target, eventName, handler, options) { - return addDomEvent(target, eventName, addPointerInfo(handler), options); - } - - // Fixes https://github.com/motiondivision/motion/issues/2270 - const getContextWindow = ({ current }) => { - return current ? current.ownerDocument.defaultView : null; - }; - - const distance = (a, b) => Math.abs(a - b); - function distance2D(a, b) { - // Multi-dimensional - const xDelta = distance(a.x, b.x); - const yDelta = distance(a.y, b.y); - return Math.sqrt(xDelta ** 2 + yDelta ** 2); - } - - const overflowStyles$1 = /*#__PURE__*/ new Set(["auto", "scroll"]); - /** - * @internal - */ - class PanSession { - constructor(event, handlers, { transformPagePoint, contextWindow = window, dragSnapToOrigin = false, distanceThreshold = 3, element, } = {}) { - /** - * @internal - */ - this.startEvent = null; - /** - * @internal - */ - this.lastMoveEvent = null; - /** - * @internal - */ - this.lastMoveEventInfo = null; - /** - * Raw (untransformed) event info, re-transformed each frame - * so transformPagePoint sees the current parent matrix. - * @internal - */ - this.lastRawMoveEventInfo = null; - /** - * @internal - */ - this.handlers = {}; - /** - * @internal - */ - this.contextWindow = window; - /** - * Scroll positions of scrollable ancestors and window. - * @internal - */ - this.scrollPositions = new Map(); - /** - * Cleanup function for scroll listeners. - * @internal - */ - this.removeScrollListeners = null; - this.onElementScroll = (event) => { - this.handleScroll(event.target); - }; - this.onWindowScroll = () => { - this.handleScroll(window); - }; - this.updatePoint = () => { - if (!(this.lastMoveEvent && this.lastMoveEventInfo)) - return; - // Re-transform raw point through current transformPagePoint so - // animated parent transforms (e.g. rotation) are picked up each frame - if (this.lastRawMoveEventInfo) { - this.lastMoveEventInfo = transformPoint(this.lastRawMoveEventInfo, this.transformPagePoint); - } - const info = getPanInfo(this.lastMoveEventInfo, this.history); - const isPanStarted = this.startEvent !== null; - // Only start panning if the offset is larger than 3 pixels. If we make it - // any larger than this we'll want to reset the pointer history - // on the first update to avoid visual snapping to the cursor. - const isDistancePastThreshold = distance2D(info.offset, { x: 0, y: 0 }) >= this.distanceThreshold; - if (!isPanStarted && !isDistancePastThreshold) - return; - const { point } = info; - const { timestamp } = frameData; - this.history.push({ ...point, timestamp }); - const { onStart, onMove } = this.handlers; - if (!isPanStarted) { - onStart && onStart(this.lastMoveEvent, info); - this.startEvent = this.lastMoveEvent; - } - onMove && onMove(this.lastMoveEvent, info); - }; - this.handlePointerMove = (event, info) => { - this.lastMoveEvent = event; - this.lastRawMoveEventInfo = info; - this.lastMoveEventInfo = transformPoint(info, this.transformPagePoint); - // Throttle mouse move event to once per frame - frame.update(this.updatePoint, true); - }; - this.handlePointerUp = (event, info) => { - this.end(); - const { onEnd, onSessionEnd, resumeAnimation } = this.handlers; - // Resume animation if dragSnapToOrigin is set OR if no drag started (user just clicked) - // This ensures constraint animations continue when interrupted by a click - if (this.dragSnapToOrigin || !this.startEvent) { - resumeAnimation && resumeAnimation(); - } - if (!(this.lastMoveEvent && this.lastMoveEventInfo)) - return; - const panInfo = getPanInfo(event.type === "pointercancel" - ? this.lastMoveEventInfo - : transformPoint(info, this.transformPagePoint), this.history); - if (this.startEvent && onEnd) { - onEnd(event, panInfo); - } - onSessionEnd && onSessionEnd(event, panInfo); - }; - // If we have more than one touch, don't start detecting this gesture - if (!isPrimaryPointer(event)) - return; - this.dragSnapToOrigin = dragSnapToOrigin; - this.handlers = handlers; - this.transformPagePoint = transformPagePoint; - this.distanceThreshold = distanceThreshold; - this.contextWindow = contextWindow || window; - const info = extractEventInfo(event); - const initialInfo = transformPoint(info, this.transformPagePoint); - const { point } = initialInfo; - const { timestamp } = frameData; - this.history = [{ ...point, timestamp }]; - const { onSessionStart } = handlers; - onSessionStart && - onSessionStart(event, getPanInfo(initialInfo, this.history)); - // Listen in the capture phase so a descendant calling - // stopPropagation() (e.g. in its own pointerup handler) can't - // prevent the gesture from ending. See #2794. - const eventOptions = { passive: true, capture: true }; - this.removeListeners = pipe(addPointerEvent(this.contextWindow, "pointermove", this.handlePointerMove, eventOptions), addPointerEvent(this.contextWindow, "pointerup", this.handlePointerUp, eventOptions), addPointerEvent(this.contextWindow, "pointercancel", this.handlePointerUp, eventOptions)); - // Start scroll tracking if element provided - if (element) { - this.startScrollTracking(element); - } - } - /** - * Start tracking scroll on ancestors and window. - */ - startScrollTracking(element) { - // Store initial scroll positions for scrollable ancestors - let current = element.parentElement; - while (current) { - const style = getComputedStyle(current); - if (overflowStyles$1.has(style.overflowX) || - overflowStyles$1.has(style.overflowY)) { - this.scrollPositions.set(current, { - x: current.scrollLeft, - y: current.scrollTop, - }); - } - current = current.parentElement; - } - // Track window scroll - this.scrollPositions.set(window, { - x: window.scrollX, - y: window.scrollY, - }); - // Capture listener catches element scroll events as they bubble - window.addEventListener("scroll", this.onElementScroll, { - capture: true, - }); - // Direct window scroll listener (window scroll doesn't bubble) - window.addEventListener("scroll", this.onWindowScroll); - this.removeScrollListeners = () => { - window.removeEventListener("scroll", this.onElementScroll, { - capture: true, - }); - window.removeEventListener("scroll", this.onWindowScroll); - }; - } - /** - * Handle scroll compensation during drag. - * - * For element scroll: adjusts history origin since pageX/pageY doesn't change. - * For window scroll: adjusts lastMoveEventInfo since pageX/pageY would change. - */ - handleScroll(target) { - const initial = this.scrollPositions.get(target); - if (!initial) - return; - const isWindow = target === window; - const current = isWindow - ? { x: window.scrollX, y: window.scrollY } - : { - x: target.scrollLeft, - y: target.scrollTop, - }; - const delta = { x: current.x - initial.x, y: current.y - initial.y }; - if (delta.x === 0 && delta.y === 0) - return; - if (isWindow) { - // Window scroll: pageX/pageY changes, so update lastMoveEventInfo - if (this.lastMoveEventInfo) { - this.lastMoveEventInfo.point.x += delta.x; - this.lastMoveEventInfo.point.y += delta.y; - } - } - else { - // Element scroll: pageX/pageY unchanged, so adjust history origin - if (this.history.length > 0) { - this.history[0].x -= delta.x; - this.history[0].y -= delta.y; - } - } - this.scrollPositions.set(target, current); - frame.update(this.updatePoint, true); - } - updateHandlers(handlers) { - this.handlers = handlers; - } - end() { - this.removeListeners && this.removeListeners(); - this.removeScrollListeners && this.removeScrollListeners(); - this.scrollPositions.clear(); - cancelFrame(this.updatePoint); - } - } - function transformPoint(info, transformPagePoint) { - return transformPagePoint ? { point: transformPagePoint(info.point) } : info; - } - function subtractPoint(a, b) { - return { x: a.x - b.x, y: a.y - b.y }; - } - function getPanInfo({ point }, history) { - return { - point, - delta: subtractPoint(point, lastDevicePoint(history)), - offset: subtractPoint(point, startDevicePoint(history)), - velocity: getVelocity(history, 0.1), - }; - } - function startDevicePoint(history) { - return history[0]; - } - function lastDevicePoint(history) { - return history[history.length - 1]; - } - function getVelocity(history, timeDelta) { - if (history.length < 2) { - return { x: 0, y: 0 }; - } - let i = history.length - 1; - let timestampedPoint = null; - const lastPoint = lastDevicePoint(history); - while (i >= 0) { - timestampedPoint = history[i]; - if (lastPoint.timestamp - timestampedPoint.timestamp > - secondsToMilliseconds(timeDelta)) { - break; - } - i--; - } - if (!timestampedPoint) { - return { x: 0, y: 0 }; - } - /** - * If the selected point is the pointer-down origin (history[0]), - * there are better movement points available, and the time gap - * is suspiciously large (>2x timeDelta), use the next point instead. - * This prevents stale pointer-down points from diluting velocity - * in hold-then-flick gestures. - */ - if (timestampedPoint === history[0] && - history.length > 2 && - lastPoint.timestamp - timestampedPoint.timestamp > - secondsToMilliseconds(timeDelta) * 2) { - timestampedPoint = history[1]; - } - const time = millisecondsToSeconds(lastPoint.timestamp - timestampedPoint.timestamp); - if (time === 0) { - return { x: 0, y: 0 }; - } - const currentVelocity = { - x: (lastPoint.x - timestampedPoint.x) / time, - y: (lastPoint.y - timestampedPoint.y) / time, - }; - if (currentVelocity.x === Infinity) { - currentVelocity.x = 0; - } - if (currentVelocity.y === Infinity) { - currentVelocity.y = 0; - } - return currentVelocity; - } - - /** - * Apply constraints to a point. These constraints are both physical along an - * axis, and an elastic factor that determines how much to constrain the point - * by if it does lie outside the defined parameters. - */ - function applyConstraints(point, { min, max }, elastic) { - if (min !== undefined && point < min) { - // If we have a min point defined, and this is outside of that, constrain - point = elastic - ? mixNumber$1(min, point, elastic.min) - : Math.max(point, min); - } - else if (max !== undefined && point > max) { - // If we have a max point defined, and this is outside of that, constrain - point = elastic - ? mixNumber$1(max, point, elastic.max) - : Math.min(point, max); - } - return point; - } - /** - * Calculate constraints in terms of the viewport when defined relatively to the - * measured axis. This is measured from the nearest edge, so a max constraint of 200 - * on an axis with a max value of 300 would return a constraint of 500 - axis length - */ - function calcRelativeAxisConstraints(axis, min, max) { - return { - min: min !== undefined ? axis.min + min : undefined, - max: max !== undefined - ? axis.max + max - (axis.max - axis.min) - : undefined, - }; - } - /** - * Calculate constraints in terms of the viewport when - * defined relatively to the measured bounding box. - */ - function calcRelativeConstraints(layoutBox, { top, left, bottom, right }) { - return { - x: calcRelativeAxisConstraints(layoutBox.x, left, right), - y: calcRelativeAxisConstraints(layoutBox.y, top, bottom), - }; - } - /** - * Calculate viewport constraints when defined as another viewport-relative axis - */ - function calcViewportAxisConstraints(layoutAxis, constraintsAxis) { - let min = constraintsAxis.min - layoutAxis.min; - let max = constraintsAxis.max - layoutAxis.max; - // If the constraints axis is actually smaller than the layout axis then we can - // flip the constraints - if (constraintsAxis.max - constraintsAxis.min < - layoutAxis.max - layoutAxis.min) { - [min, max] = [max, min]; - } - return { min, max }; - } - /** - * Calculate viewport constraints when defined as another viewport-relative box - */ - function calcViewportConstraints(layoutBox, constraintsBox) { - return { - x: calcViewportAxisConstraints(layoutBox.x, constraintsBox.x), - y: calcViewportAxisConstraints(layoutBox.y, constraintsBox.y), - }; - } - /** - * Calculate a transform origin relative to the source axis, between 0-1, that results - * in an asthetically pleasing scale/transform needed to project from source to target. - */ - function calcOrigin(source, target) { - let origin = 0.5; - const sourceLength = calcLength(source); - const targetLength = calcLength(target); - if (targetLength > sourceLength) { - origin = progress(target.min, target.max - sourceLength, source.min); - } - else if (sourceLength > targetLength) { - origin = progress(source.min, source.max - targetLength, target.min); - } - return clamp(0, 1, origin); - } - /** - * Rebase the calculated viewport constraints relative to the layout.min point. - */ - function rebaseAxisConstraints(layout, constraints) { - const relativeConstraints = {}; - if (constraints.min !== undefined) { - relativeConstraints.min = constraints.min - layout.min; - } - if (constraints.max !== undefined) { - relativeConstraints.max = constraints.max - layout.min; - } - return relativeConstraints; - } - const defaultElastic = 0.35; - /** - * Accepts a dragElastic prop and returns resolved elastic values for each axis. - */ - function resolveDragElastic(dragElastic = defaultElastic) { - if (dragElastic === false) { - dragElastic = 0; - } - else if (dragElastic === true) { - dragElastic = defaultElastic; - } - return { - x: resolveAxisElastic(dragElastic, "left", "right"), - y: resolveAxisElastic(dragElastic, "top", "bottom"), - }; - } - function resolveAxisElastic(dragElastic, minLabel, maxLabel) { - return { - min: resolvePointElastic(dragElastic, minLabel), - max: resolvePointElastic(dragElastic, maxLabel), - }; - } - function resolvePointElastic(dragElastic, label) { - return typeof dragElastic === "number" - ? dragElastic - : dragElastic[label] || 0; - } - - const elementDragControls = new WeakMap(); - class VisualElementDragControls { - constructor(visualElement) { - this.openDragLock = null; - this.isDragging = false; - this.currentDirection = null; - this.originPoint = { x: 0, y: 0 }; - /** - * The permitted boundaries of travel, in pixels. - */ - this.constraints = false; - this.hasMutatedConstraints = false; - /** - * The per-axis resolved elastic values. - */ - this.elastic = createBox(); - /** - * The latest pointer event. Used as fallback when the `cancel` and `stop` functions are called without arguments. - */ - this.latestPointerEvent = null; - /** - * The latest pan info. Used as fallback when the `cancel` and `stop` functions are called without arguments. - */ - this.latestPanInfo = null; - this.visualElement = visualElement; - } - start(originEvent, { snapToCursor = false, distanceThreshold } = {}) { - /** - * Don't start dragging if this component is exiting - */ - const { presenceContext } = this.visualElement; - if (presenceContext && presenceContext.isPresent === false) - return; - const onSessionStart = (event) => { - if (snapToCursor) { - this.snapToCursor(extractEventInfo(event).point); - } - this.stopAnimation(); - }; - const onStart = (event, info) => { - // Attempt to grab the global drag gesture lock - maybe make this part of PanSession - const { drag, dragPropagation, onDragStart } = this.getProps(); - if (drag && !dragPropagation) { - if (this.openDragLock) - this.openDragLock(); - this.openDragLock = setDragLock(drag); - // If we don 't have the lock, don't start dragging - if (!this.openDragLock) - return; - } - this.latestPointerEvent = event; - this.latestPanInfo = info; - this.isDragging = true; - this.currentDirection = null; - this.resolveConstraints(); - if (this.visualElement.projection) { - this.visualElement.projection.isAnimationBlocked = true; - this.visualElement.projection.target = undefined; - } - /** - * Record gesture origin and pointer offset - */ - eachAxis((axis) => { - let current = this.getAxisMotionValue(axis).get() || 0; - /** - * If the MotionValue is a percentage value convert to px - */ - if (percent.test(current)) { - const { projection } = this.visualElement; - if (projection && projection.layout) { - const measuredAxis = projection.layout.layoutBox[axis]; - if (measuredAxis) { - const length = calcLength(measuredAxis); - current = length * (parseFloat(current) / 100); - } - } - } - this.originPoint[axis] = current; - }); - // Fire onDragStart event - if (onDragStart) { - frame.update(() => onDragStart(event, info), false, true); - } - addValueToWillChange(this.visualElement, "transform"); - const { animationState } = this.visualElement; - animationState && animationState.setActive("whileDrag", true); - }; - const onMove = (event, info) => { - this.latestPointerEvent = event; - this.latestPanInfo = info; - const { dragPropagation, dragDirectionLock, onDirectionLock, onDrag, } = this.getProps(); - // If we didn't successfully receive the gesture lock, early return. - if (!dragPropagation && !this.openDragLock) - return; - const { offset } = info; - // Attempt to detect drag direction if directionLock is true - if (dragDirectionLock && this.currentDirection === null) { - this.currentDirection = getCurrentDirection(offset); - // If we've successfully set a direction, notify listener - if (this.currentDirection !== null) { - onDirectionLock && onDirectionLock(this.currentDirection); - } - return; - } - // Update each point with the latest position - this.updateAxis("x", info.point, offset); - this.updateAxis("y", info.point, offset); - /** - * Ideally we would leave the renderer to fire naturally at the end of - * this frame but if the element is about to change layout as the result - * of a re-render we want to ensure the browser can read the latest - * bounding box to ensure the pointer and element don't fall out of sync. - */ - this.visualElement.render(); - /** - * This must fire after the render call as it might trigger a state - * change which itself might trigger a layout update. - */ - if (onDrag) { - frame.update(() => onDrag(event, info), false, true); - } - }; - const onSessionEnd = (event, info) => { - this.latestPointerEvent = event; - this.latestPanInfo = info; - this.stop(event, info); - this.latestPointerEvent = null; - this.latestPanInfo = null; - }; - const resumeAnimation = () => { - const { dragSnapToOrigin: snap } = this.getProps(); - if (snap || this.constraints) { - this.startAnimation({ x: 0, y: 0 }); - } - }; - const { dragSnapToOrigin } = this.getProps(); - this.panSession = new PanSession(originEvent, { - onSessionStart, - onStart, - onMove, - onSessionEnd, - resumeAnimation, - }, { - transformPagePoint: this.visualElement.getTransformPagePoint(), - dragSnapToOrigin, - distanceThreshold, - contextWindow: getContextWindow(this.visualElement), - element: this.visualElement.current, - }); - } - /** - * @internal - */ - stop(event, panInfo) { - const finalEvent = event || this.latestPointerEvent; - const finalPanInfo = panInfo || this.latestPanInfo; - const isDragging = this.isDragging; - this.cancel(); - if (!isDragging || !finalPanInfo || !finalEvent) - return; - const { velocity } = finalPanInfo; - this.startAnimation(velocity); - const { onDragEnd } = this.getProps(); - if (onDragEnd) { - frame.postRender(() => onDragEnd(finalEvent, finalPanInfo)); - } - } - /** - * @internal - */ - cancel() { - this.isDragging = false; - const { projection, animationState } = this.visualElement; - if (projection) { - projection.isAnimationBlocked = false; - } - this.endPanSession(); - const { dragPropagation } = this.getProps(); - if (!dragPropagation && this.openDragLock) { - this.openDragLock(); - this.openDragLock = null; - } - animationState && animationState.setActive("whileDrag", false); - } - /** - * Clean up the pan session without modifying other drag state. - * This is used during unmount to ensure event listeners are removed - * without affecting projection animations or drag locks. - * @internal - */ - endPanSession() { - this.panSession && this.panSession.end(); - this.panSession = undefined; - } - updateAxis(axis, _point, offset) { - const { drag } = this.getProps(); - // If we're not dragging this axis, do an early return. - if (!offset || !shouldDrag(axis, drag, this.currentDirection)) - return; - const axisValue = this.getAxisMotionValue(axis); - let next = this.originPoint[axis] + offset[axis]; - // Apply constraints - if (this.constraints && this.constraints[axis]) { - next = applyConstraints(next, this.constraints[axis], this.elastic[axis]); - } - axisValue.set(next); - } - resolveConstraints() { - const { dragConstraints, dragElastic } = this.getProps(); - const layout = this.visualElement.projection && - !this.visualElement.projection.layout - ? this.visualElement.projection.measure(false) - : this.visualElement.projection?.layout; - const prevConstraints = this.constraints; - if (dragConstraints && isRefObject(dragConstraints)) { - if (!this.constraints) { - this.constraints = this.resolveRefConstraints(); - } - } - else { - if (dragConstraints && layout) { - this.constraints = calcRelativeConstraints(layout.layoutBox, dragConstraints); - } - else { - this.constraints = false; - } - } - this.elastic = resolveDragElastic(dragElastic); - /** - * If we're outputting to external MotionValues, we want to rebase the measured constraints - * from viewport-relative to component-relative. This only applies to relative (non-ref) - * constraints, as ref-based constraints from calcViewportConstraints are already in the - * correct coordinate space for the motion value transform offset. - */ - if (prevConstraints !== this.constraints && - !isRefObject(dragConstraints) && - layout && - this.constraints && - !this.hasMutatedConstraints) { - eachAxis((axis) => { - if (this.constraints !== false && - this.getAxisMotionValue(axis)) { - this.constraints[axis] = rebaseAxisConstraints(layout.layoutBox[axis], this.constraints[axis]); - } - }); - } - } - resolveRefConstraints() { - const { dragConstraints: constraints, onMeasureDragConstraints } = this.getProps(); - if (!constraints || !isRefObject(constraints)) - return false; - const constraintsElement = constraints.current; - exports.invariant(constraintsElement !== null, "If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.", "drag-constraints-ref"); - const { projection } = this.visualElement; - // TODO - if (!projection || !projection.layout) - return false; - /** - * Refresh the root scroll offset so the constraint's viewport box - * translates to correct page coordinates. The scroll captured at - * drag mount can be stale if the document was scrolled afterwards — - * e.g. via the browser restoring scroll on refresh, or an ancestor - * layout effect running after this element's mount (#2829). - * - * Clear the cached scroll first so `updateScroll` bypasses its - * per-animationId cache and re-reads the live value. - */ - if (projection.root) { - projection.root.scroll = undefined; - projection.root.updateScroll(); - } - const constraintsBox = measurePageBox(constraintsElement, projection.root, this.visualElement.getTransformPagePoint()); - let measuredConstraints = calcViewportConstraints(projection.layout.layoutBox, constraintsBox); - /** - * If there's an onMeasureDragConstraints listener we call it and - * if different constraints are returned, set constraints to that - */ - if (onMeasureDragConstraints) { - const userConstraints = onMeasureDragConstraints(convertBoxToBoundingBox(measuredConstraints)); - this.hasMutatedConstraints = !!userConstraints; - if (userConstraints) { - measuredConstraints = convertBoundingBoxToBox(userConstraints); - } - } - return measuredConstraints; - } - startAnimation(velocity) { - const { drag, dragMomentum, dragElastic, dragTransition, dragSnapToOrigin, onDragTransitionEnd, } = this.getProps(); - const constraints = this.constraints || {}; - const momentumAnimations = eachAxis((axis) => { - if (!shouldDrag(axis, drag, this.currentDirection)) { - return; - } - let transition = (constraints && constraints[axis]) || {}; - if (dragSnapToOrigin === true || - dragSnapToOrigin === axis) - transition = { min: 0, max: 0 }; - /** - * Overdamp the boundary spring if `dragElastic` is disabled. There's still a frame - * of spring animations so we should look into adding a disable spring option to `inertia`. - * We could do something here where we affect the `bounceStiffness` and `bounceDamping` - * using the value of `dragElastic`. - */ - const bounceStiffness = dragElastic ? 200 : 1000000; - const bounceDamping = dragElastic ? 40 : 10000000; - const inertia = { - type: "inertia", - velocity: dragMomentum ? velocity[axis] : 0, - bounceStiffness, - bounceDamping, - timeConstant: 750, - restDelta: 1, - restSpeed: 10, - ...dragTransition, - ...transition, - }; - // If we're not animating on an externally-provided `MotionValue` we can use the - // component's animation controls which will handle interactions with whileHover (etc), - // otherwise we just have to animate the `MotionValue` itself. - return this.startAxisValueAnimation(axis, inertia); - }); - // Run all animations and then resolve the new drag constraints. - return Promise.all(momentumAnimations).then(onDragTransitionEnd); - } - startAxisValueAnimation(axis, transition) { - const axisValue = this.getAxisMotionValue(axis); - addValueToWillChange(this.visualElement, axis); - return axisValue.start(animateMotionValue(axis, axisValue, 0, transition, this.visualElement, false)); - } - stopAnimation() { - eachAxis((axis) => this.getAxisMotionValue(axis).stop()); - } - /** - * Drag works differently depending on which props are provided. - * - * - If _dragX and _dragY are provided, we output the gesture delta directly to those motion values. - * - Otherwise, we apply the delta to the x/y motion values. - */ - getAxisMotionValue(axis) { - const dragKey = `_drag${axis.toUpperCase()}`; - const props = this.visualElement.getProps(); - const externalMotionValue = props[dragKey]; - return externalMotionValue - ? externalMotionValue - : this.visualElement.getValue(axis, this.visualElement.latestValues[axis] ?? 0); - } - snapToCursor(point) { - eachAxis((axis) => { - const { drag } = this.getProps(); - // If we're not dragging this axis, do an early return. - if (!shouldDrag(axis, drag, this.currentDirection)) - return; - const { projection } = this.visualElement; - const axisValue = this.getAxisMotionValue(axis); - if (projection && projection.layout) { - const { min, max } = projection.layout.layoutBox[axis]; - /** - * The layout measurement includes the current transform value, - * so we need to add it back to get the correct snap position. - * This fixes an issue where elements with initial coordinates - * would snap to the wrong position on the first drag. - */ - const current = axisValue.get() || 0; - axisValue.set(point[axis] - mixNumber$1(min, max, 0.5) + current); - } - }); - } - /** - * When the viewport resizes we want to check if the measured constraints - * have changed and, if so, reposition the element within those new constraints - * relative to where it was before the resize. - */ - scalePositionWithinConstraints() { - if (!this.visualElement.current) - return; - const { drag, dragConstraints } = this.getProps(); - const { projection } = this.visualElement; - if (!isRefObject(dragConstraints) || !projection || !this.constraints) - return; - /** - * Stop current animations as there can be visual glitching if we try to do - * this mid-animation - */ - this.stopAnimation(); - /** - * Record the relative position of the dragged element relative to the - * constraints box and save as a progress value. - */ - const boxProgress = { x: 0, y: 0 }; - eachAxis((axis) => { - const axisValue = this.getAxisMotionValue(axis); - if (axisValue && this.constraints !== false) { - const latest = axisValue.get(); - boxProgress[axis] = calcOrigin({ min: latest, max: latest }, this.constraints[axis]); - } - }); - /** - * Update the layout of this element and resolve the latest drag constraints - */ - const { transformTemplate } = this.visualElement.getProps(); - this.visualElement.current.style.transform = transformTemplate - ? transformTemplate({}, "") - : "none"; - projection.root && projection.root.updateScroll(); - projection.updateLayout(); - /** - * Reset constraints so resolveConstraints() will recalculate them - * with the freshly measured layout rather than returning the cached value. - */ - this.constraints = false; - this.resolveConstraints(); - /** - * For each axis, calculate the current progress of the layout axis - * within the new constraints. - */ - eachAxis((axis) => { - if (!shouldDrag(axis, drag, null)) - return; - /** - * Calculate a new transform based on the previous box progress - */ - const axisValue = this.getAxisMotionValue(axis); - const { min, max } = this.constraints[axis]; - axisValue.set(mixNumber$1(min, max, boxProgress[axis])); - }); - /** - * Flush the updated transform to the DOM synchronously to prevent - * a visual flash at the element's CSS layout position (0,0) when - * the transform was stripped for measurement. - */ - this.visualElement.render(); - } - addListeners() { - if (!this.visualElement.current) - return; - elementDragControls.set(this.visualElement, this); - const element = this.visualElement.current; - /** - * Attach a pointerdown event listener on this DOM element to initiate drag tracking. - */ - const stopPointerListener = addPointerEvent(element, "pointerdown", (event) => { - const { drag, dragListener = true } = this.getProps(); - const target = event.target; - /** - * Only block drag if clicking on a text input child element - * (input, textarea, select, contenteditable) where users might - * want to select text or interact with the control. - * - * Buttons and links don't block drag since they don't have - * click-and-move actions of their own. - */ - const isClickingTextInputChild = target !== element && isElementTextInput(target); - if (drag && dragListener && !isClickingTextInputChild) { - this.start(event); - } - }); - /** - * If using ref-based constraints, observe both the draggable element - * and the constraint container for size changes via ResizeObserver. - * Setup is deferred because dragConstraints.current is null when - * addListeners first runs (React hasn't committed the ref yet). - */ - let stopResizeObservers; - const measureDragConstraints = () => { - const { dragConstraints } = this.getProps(); - if (isRefObject(dragConstraints) && dragConstraints.current) { - this.constraints = this.resolveRefConstraints(); - if (!stopResizeObservers) { - stopResizeObservers = startResizeObservers(element, dragConstraints.current, () => this.scalePositionWithinConstraints()); - } - } - }; - const { projection } = this.visualElement; - const stopMeasureLayoutListener = projection.addEventListener("measure", measureDragConstraints); - if (projection && !projection.layout) { - projection.root && projection.root.updateScroll(); - projection.updateLayout(); - } - frame.read(measureDragConstraints); - /** - * Attach a window resize listener to scale the draggable target within its defined - * constraints as the window resizes. - */ - const stopResizeListener = addDomEvent(window, "resize", () => this.scalePositionWithinConstraints()); - /** - * If the element's layout changes, calculate the delta and apply that to - * the drag gesture's origin point. - */ - const stopLayoutUpdateListener = projection.addEventListener("didUpdate", (({ delta, hasLayoutChanged }) => { - if (this.isDragging && hasLayoutChanged) { - eachAxis((axis) => { - const motionValue = this.getAxisMotionValue(axis); - if (!motionValue) - return; - this.originPoint[axis] += delta[axis].translate; - motionValue.set(motionValue.get() + delta[axis].translate); - }); - this.visualElement.render(); - } - })); - return () => { - stopResizeListener(); - stopPointerListener(); - stopMeasureLayoutListener(); - stopLayoutUpdateListener && stopLayoutUpdateListener(); - stopResizeObservers && stopResizeObservers(); - }; - } - getProps() { - const props = this.visualElement.getProps(); - const { drag = false, dragDirectionLock = false, dragPropagation = false, dragConstraints = false, dragElastic = defaultElastic, dragMomentum = true, } = props; - return { - ...props, - drag, - dragDirectionLock, - dragPropagation, - dragConstraints, - dragElastic, - dragMomentum, - }; - } - } - function skipFirstCall(callback) { - let isFirst = true; - return () => { - if (isFirst) { - isFirst = false; - return; - } - callback(); - }; - } - function startResizeObservers(element, constraintsElement, onResize) { - const stopElement = resize(element, skipFirstCall(onResize)); - const stopContainer = resize(constraintsElement, skipFirstCall(onResize)); - return () => { - stopElement(); - stopContainer(); - }; - } - function shouldDrag(direction, drag, currentDirection) { - return ((drag === true || drag === direction) && - (currentDirection === null || currentDirection === direction)); - } - /** - * Based on an x/y offset determine the current drag direction. If both axis' offsets are lower - * than the provided threshold, return `null`. - * - * @param offset - The x/y offset from origin. - * @param lockThreshold - (Optional) - the minimum absolute offset before we can determine a drag direction. - */ - function getCurrentDirection(offset, lockThreshold = 10) { - let direction = null; - if (Math.abs(offset.y) > lockThreshold) { - direction = "y"; - } - else if (Math.abs(offset.x) > lockThreshold) { - direction = "x"; - } - return direction; - } - - class DragGesture extends Feature { - constructor(node) { - super(node); - this.removeGroupControls = noop; - this.removeListeners = noop; - this.controls = new VisualElementDragControls(node); - } - mount() { - // If we've been provided a DragControls for manual control over the drag gesture, - // subscribe this component to it on mount. - const { dragControls } = this.node.getProps(); - if (dragControls) { - this.removeGroupControls = dragControls.subscribe(this.controls); - } - this.removeListeners = this.controls.addListeners() || noop; - } - update() { - const { dragControls } = this.node.getProps(); - const { dragControls: prevDragControls } = this.node.prevProps || {}; - if (dragControls !== prevDragControls) { - this.removeGroupControls(); - if (dragControls) { - this.removeGroupControls = dragControls.subscribe(this.controls); - } - } - } - unmount() { - this.removeGroupControls(); - this.removeListeners(); - /** - * In React 19, during list reorder reconciliation, components may - * briefly unmount and remount while the drag is still active. If we're - * actively dragging, we should NOT end the pan session - it will - * continue tracking pointer events via its window-level listeners. - * - * The pan session will be properly cleaned up when: - * 1. The drag ends naturally (pointerup/pointercancel) - * 2. The component is truly removed from the DOM - */ - if (!this.controls.isDragging) { - this.controls.endPanSession(); - } - } - } - - const asyncHandler = (handler) => (event, info) => { - if (handler) { - frame.update(() => handler(event, info), false, true); - } - }; - class PanGesture extends Feature { - constructor() { - super(...arguments); - this.removePointerDownListener = noop; - } - onPointerDown(pointerDownEvent) { - this.session = new PanSession(pointerDownEvent, this.createPanHandlers(), { - transformPagePoint: this.node.getTransformPagePoint(), - contextWindow: getContextWindow(this.node), - }); - } - createPanHandlers() { - const { onPanSessionStart, onPanStart, onPan, onPanEnd } = this.node.getProps(); - return { - onSessionStart: asyncHandler(onPanSessionStart), - onStart: asyncHandler(onPanStart), - onMove: asyncHandler(onPan), - onEnd: (event, info) => { - delete this.session; - if (onPanEnd) { - frame.postRender(() => onPanEnd(event, info)); - } - }, - }; - } - mount() { - this.removePointerDownListener = addPointerEvent(this.node.current, "pointerdown", (event) => this.onPointerDown(event)); - } - update() { - this.session && this.session.updateHandlers(this.createPanHandlers()); - } - unmount() { - this.removePointerDownListener(); - this.session && this.session.end(); - } - } - - /** - * Track whether we've taken any snapshots yet. If not, - * we can safely skip notification of didUpdate. - * - * Difficult to capture in a test but to prevent flickering - * we must set this to true either on update or unmount. - * Running `next-env/layout-id` in Safari will show this behaviour if broken. - */ - let hasTakenAnySnapshot = false; - class MeasureLayoutWithContext extends React$1.Component { - /** - * This only mounts projection nodes for components that - * need measuring, we might want to do it for all components - * in order to incorporate transforms - */ - componentDidMount() { - const { visualElement, layoutGroup, switchLayoutGroup, layoutId } = this.props; - const { projection } = visualElement; - if (projection) { - if (layoutGroup.group) - layoutGroup.group.add(projection); - if (switchLayoutGroup && switchLayoutGroup.register && layoutId) { - switchLayoutGroup.register(projection); - } - if (hasTakenAnySnapshot) { - projection.root.didUpdate(); - } - projection.addEventListener("animationComplete", () => { - this.safeToRemove(); - }); - projection.setOptions({ - ...projection.options, - layoutDependency: this.props.layoutDependency, - onExitComplete: () => this.safeToRemove(), - }); - } - globalProjectionState.hasEverUpdated = true; - } - getSnapshotBeforeUpdate(prevProps) { - const { layoutDependency, visualElement, drag, isPresent } = this.props; - const { projection } = visualElement; - if (!projection) - return null; - /** - * TODO: We use this data in relegate to determine whether to - * promote a previous element. There's no guarantee its presence data - * will have updated by this point - if a bug like this arises it will - * have to be that we markForRelegation and then find a new lead some other way, - * perhaps in didUpdate - */ - projection.isPresent = isPresent; - if (prevProps.layoutDependency !== layoutDependency) { - projection.setOptions({ - ...projection.options, - layoutDependency, - }); - } - hasTakenAnySnapshot = true; - if (drag || - prevProps.layoutDependency !== layoutDependency || - layoutDependency === undefined || - prevProps.isPresent !== isPresent) { - projection.willUpdate(); - } - else { - this.safeToRemove(); - } - if (prevProps.isPresent !== isPresent) { - if (isPresent) { - projection.promote(); - } - else if (!projection.relegate()) { - /** - * If there's another stack member taking over from this one, - * it's in charge of the exit animation and therefore should - * be in charge of the safe to remove. Otherwise we call it here. - */ - frame.postRender(() => { - const stack = projection.getStack(); - if (!stack || !stack.members.length) { - this.safeToRemove(); - } - }); - } - } - return null; - } - componentDidUpdate() { - const { visualElement, layoutAnchor } = this.props; - const { projection } = visualElement; - if (projection) { - projection.options.layoutAnchor = layoutAnchor; - projection.root.didUpdate(); - microtask.postRender(() => { - if (!projection.currentAnimation && projection.isLead()) { - this.safeToRemove(); - } - }); - } - } - componentWillUnmount() { - const { visualElement, layoutGroup, switchLayoutGroup: promoteContext, } = this.props; - const { projection } = visualElement; - hasTakenAnySnapshot = true; - if (projection) { - projection.scheduleCheckAfterUnmount(); - if (layoutGroup && layoutGroup.group) - layoutGroup.group.remove(projection); - if (promoteContext && promoteContext.deregister) - promoteContext.deregister(projection); - } - } - safeToRemove() { - const { safeToRemove } = this.props; - safeToRemove && safeToRemove(); - } - render() { - return null; - } - } - function MeasureLayout(props) { - const [isPresent, safeToRemove] = usePresence(); - const layoutGroup = React$1.useContext(LayoutGroupContext); - return (jsx(MeasureLayoutWithContext, { ...props, layoutGroup: layoutGroup, switchLayoutGroup: React$1.useContext(SwitchLayoutGroupContext), isPresent: isPresent, safeToRemove: safeToRemove })); - } - - const drag = { - pan: { - Feature: PanGesture, - }, - drag: { - Feature: DragGesture, - ProjectionNode: HTMLProjectionNode, - MeasureLayout, - }, - }; - - function handleHoverEvent(node, event, lifecycle) { - const { props } = node; - if (node.animationState && props.whileHover) { - node.animationState.setActive("whileHover", lifecycle === "Start"); - } - const eventName = ("onHover" + lifecycle); - const callback = props[eventName]; - if (callback) { - frame.postRender(() => callback(event, extractEventInfo(event))); - } - } - class HoverGesture extends Feature { - mount() { - const { current } = this.node; - if (!current) - return; - this.unmount = hover(current, (_element, startEvent) => { - handleHoverEvent(this.node, startEvent, "Start"); - return (endEvent) => handleHoverEvent(this.node, endEvent, "End"); - }); - } - unmount() { } - } - - class FocusGesture extends Feature { - constructor() { - super(...arguments); - this.isActive = false; - } - onFocus() { - let isFocusVisible = false; - /** - * If this element doesn't match focus-visible then don't - * apply whileHover. But, if matches throws that focus-visible - * is not a valid selector then in that browser outline styles will be applied - * to the element by default and we want to match that behaviour with whileFocus. - */ - try { - isFocusVisible = this.node.current.matches(":focus-visible"); - } - catch (e) { - isFocusVisible = true; - } - if (!isFocusVisible || !this.node.animationState) - return; - this.node.animationState.setActive("whileFocus", true); - this.isActive = true; - } - onBlur() { - if (!this.isActive || !this.node.animationState) - return; - this.node.animationState.setActive("whileFocus", false); - this.isActive = false; - } - mount() { - this.unmount = pipe(addDomEvent(this.node.current, "focus", () => this.onFocus()), addDomEvent(this.node.current, "blur", () => this.onBlur())); - } - unmount() { } - } - - function handlePressEvent(node, event, lifecycle) { - const { props } = node; - if (node.current instanceof HTMLButtonElement && node.current.disabled) { - return; - } - if (node.animationState && props.whileTap) { - node.animationState.setActive("whileTap", lifecycle === "Start"); - } - const eventName = ("onTap" + (lifecycle === "End" ? "" : lifecycle)); - const callback = props[eventName]; - if (callback) { - frame.postRender(() => callback(event, extractEventInfo(event))); - } - } - class PressGesture extends Feature { - mount() { - const { current } = this.node; - if (!current) - return; - const { globalTapTarget, propagate } = this.node.props; - this.unmount = press(current, (_element, startEvent) => { - handlePressEvent(this.node, startEvent, "Start"); - return (endEvent, { success }) => handlePressEvent(this.node, endEvent, success ? "End" : "Cancel"); - }, { - useGlobalTarget: globalTapTarget, - stopPropagation: propagate?.tap === false, - }); - } - unmount() { } - } - - /** - * Map an IntersectionHandler callback to an element. We only ever make one handler for one - * element, so even though these handlers might all be triggered by different - * observers, we can keep them in the same map. - */ - const observerCallbacks = new WeakMap(); - /** - * Multiple observers can be created for multiple element/document roots. Each with - * different settings. So here we store dictionaries of observers to each root, - * using serialised settings (threshold/margin) as lookup keys. - */ - const observers = new WeakMap(); - const fireObserverCallback = (entry) => { - const callback = observerCallbacks.get(entry.target); - callback && callback(entry); - }; - const fireAllObserverCallbacks = (entries) => { - entries.forEach(fireObserverCallback); - }; - function initIntersectionObserver({ root, ...options }) { - const lookupRoot = root || document; - /** - * If we don't have an observer lookup map for this root, create one. - */ - if (!observers.has(lookupRoot)) { - observers.set(lookupRoot, {}); - } - const rootObservers = observers.get(lookupRoot); - const key = JSON.stringify(options); - /** - * If we don't have an observer for this combination of root and settings, - * create one. - */ - if (!rootObservers[key]) { - rootObservers[key] = new IntersectionObserver(fireAllObserverCallbacks, { root, ...options }); - } - return rootObservers[key]; - } - function observeIntersection(element, options, callback) { - const rootInteresectionObserver = initIntersectionObserver(options); - observerCallbacks.set(element, callback); - rootInteresectionObserver.observe(element); - return () => { - observerCallbacks.delete(element); - rootInteresectionObserver.unobserve(element); - }; - } - - const thresholdNames = { - some: 0, - all: 1, - }; - class InViewFeature extends Feature { - constructor() { - super(...arguments); - this.hasEnteredView = false; - this.isInView = false; - } - startObserver() { - this.stopObserver?.(); - const { viewport = {} } = this.node.getProps(); - const { root, margin: rootMargin, amount = "some", once } = viewport; - const options = { - root: root ? root.current : undefined, - rootMargin, - threshold: typeof amount === "number" ? amount : thresholdNames[amount], - }; - const onIntersectionUpdate = (entry) => { - const { isIntersecting } = entry; - /** - * If there's been no change in the viewport state, early return. - */ - if (this.isInView === isIntersecting) - return; - this.isInView = isIntersecting; - /** - * Handle hasEnteredView. If this is only meant to run once, and - * element isn't visible, early return. Otherwise set hasEnteredView to true. - */ - if (once && !isIntersecting && this.hasEnteredView) { - return; - } - else if (isIntersecting) { - this.hasEnteredView = true; - } - if (this.node.animationState) { - this.node.animationState.setActive("whileInView", isIntersecting); - } - /** - * Use the latest committed props rather than the ones in scope - * when this observer is created - */ - const { onViewportEnter, onViewportLeave } = this.node.getProps(); - const callback = isIntersecting ? onViewportEnter : onViewportLeave; - callback && callback(entry); - }; - this.stopObserver = observeIntersection(this.node.current, options, onIntersectionUpdate); - } - mount() { - this.startObserver(); - } - update() { - if (typeof IntersectionObserver === "undefined") - return; - const { props, prevProps } = this.node; - const hasOptionsChanged = ["amount", "margin", "root"].some(hasViewportOptionChanged(props, prevProps)); - if (hasOptionsChanged) { - this.startObserver(); - } - } - unmount() { - this.stopObserver?.(); - this.hasEnteredView = false; - this.isInView = false; - } - } - function hasViewportOptionChanged({ viewport = {} }, { viewport: prevViewport = {} } = {}) { - return (name) => viewport[name] !== prevViewport[name]; - } - - const gestureAnimations = { - inView: { - Feature: InViewFeature, - }, - tap: { - Feature: PressGesture, - }, - focus: { - Feature: FocusGesture, - }, - hover: { - Feature: HoverGesture, - }, - }; - - const layout = { - layout: { - ProjectionNode: HTMLProjectionNode, - MeasureLayout, - }, - }; - - const featureBundle = { - ...animations, - ...gestureAnimations, - ...drag, - ...layout, - }; - - const motion = /*@__PURE__*/ createMotionProxy(featureBundle, createDomVisualElement); - - function checkReorder(order, value, offset, velocity, axis, direction = "ltr") { - const index = order.findIndex((item) => item.value === value); - if (index === -1) - return order; - if (axis === "xy") { - const { layout } = order[index]; - const center = { - x: mixNumber$1(layout.x.min, layout.x.max, 0.5) + offset.x, - y: mixNumber$1(layout.y.min, layout.y.max, 0.5) + offset.y, - }; - const lines = getLines(order); - const sourceLine = lines.find((line) => line.items.includes(order[index])); - const targetLine = lines.reduce((closest, line) => distanceToLine(center.y, line) < distanceToLine(center.y, closest) - ? line - : closest); - if (targetLine !== sourceLine) { - return moveToLine(order, index, center.x, targetLine, direction); - } - const currentDistance = distanceToBox(center, layout); - let target = -1; - let targetDistance = currentDistance; - order.forEach((item, targetIndex) => { - if (targetIndex === index) - return; - const distance = distanceToBox(center, item.layout); - if (distance < targetDistance) { - target = targetIndex; - targetDistance = distance; - } - }); - return target === -1 - ? order - : moveItem(order, index, index + Math.sign(target - index)); - } - if (!velocity[axis]) - return order; - const nextOffset = velocity[axis] > 0 ? 1 : -1; - const nextItem = order[index + nextOffset]; - if (!nextItem) - return order; - const item = order[index]; - const itemLayout = item.layout[axis]; - const nextLayout = nextItem.layout[axis]; - const nextItemCenter = mixNumber$1(nextLayout.min, nextLayout.max, 0.5); - if ((nextOffset === 1 && itemLayout.max + offset[axis] > nextItemCenter) || - (nextOffset === -1 && itemLayout.min + offset[axis] < nextItemCenter)) { - return moveItem(order, index, index + nextOffset); - } - return order; - } - function getLines(order) { - const lines = []; - order.forEach((item) => { - const { min, max } = item.layout.y; - const line = lines[lines.length - 1]; - if (!line || min >= line.max || max <= line.min) { - lines.push({ items: [item], min, max }); - } - else { - line.items.push(item); - line.min = Math.min(line.min, min); - line.max = Math.max(line.max, max); - } - }); - return lines; - } - function distanceToLine(y, line) { - return y < line.min ? line.min - y : y > line.max ? y - line.max : 0; - } - function moveToLine(order, index, x, line, direction) { - const remaining = order.filter((_, itemIndex) => itemIndex !== index); - const before = line.items.find((item) => { - const center = mixNumber$1(item.layout.x.min, item.layout.x.max, 0.5); - return direction === "ltr" ? x < center : x > center; - }); - const targetIndex = before - ? remaining.indexOf(before) - : remaining.indexOf(line.items[line.items.length - 1]) + 1; - const nextOrder = [...remaining]; - nextOrder.splice(targetIndex, 0, order[index]); - return nextOrder.every((item, itemIndex) => item === order[itemIndex]) - ? order - : nextOrder; - } - function distanceToBox(point, box) { - const x = Math.max(box.x.min - point.x, 0, point.x - box.x.max); - const y = Math.max(box.y.min - point.y, 0, point.y - box.y.max); - return x * x + y * y; - } - - const isSeparated = (a, b) => a.max <= b.min || b.max <= a.min; - function detectAxis(layouts) { - let x = false; - let y = false; - for (let i = 0; i < layouts.length; i++) { - for (let j = i + 1; j < layouts.length; j++) { - x || (x = isSeparated(layouts[i].x, layouts[j].x)); - y || (y = isSeparated(layouts[i].y, layouts[j].y)); - if (x && y) - return "xy"; - } - } - return x ? "x" : "y"; - } - - function ReorderGroupComponent({ children, as = "ul", axis: axisOverride, onReorder, values, ...props }, externalRef) { - const Component = useConstant(() => motion[as]); - const itemLayouts = React$1.useRef(new Map()); - const [detectedAxis, setDetectedAxis] = React$1.useState("y"); - const isReordering = React$1.useRef(false); - const groupRef = React$1.useRef(null); - const axis = axisOverride || detectedAxis; - exports.invariant(Boolean(values), "Reorder.Group must be provided a values prop", "reorder-values"); - const valuesSet = new Set(values); - itemLayouts.current.forEach((_, value) => { - if (!valuesSet.has(value)) - itemLayouts.current.delete(value); - }); - const context = { - axis, - groupRef, - registerItem: (value, layout) => { - itemLayouts.current.set(value, layout); - if (!axisOverride) { - const nextAxis = detectAxis(values.flatMap((itemValue) => { - const itemLayout = itemLayouts.current.get(itemValue); - return itemLayout ? [itemLayout] : []; - })); - if (nextAxis !== detectedAxis) - setDetectedAxis(nextAxis); - } - }, - updateOrder: (item, offset, velocity) => { - if (isReordering.current) - return; - const order = values.flatMap((value) => { - const layout = itemLayouts.current.get(value); - return layout ? [{ value, layout }] : []; - }); - const direction = groupRef.current?.ownerDocument.defaultView?.getComputedStyle(groupRef.current).direction === "rtl" - ? "rtl" - : "ltr"; - const newOrder = checkReorder(order, item, offset, velocity, axis, direction); - if (order !== newOrder) { - isReordering.current = true; - const newValues = [...values]; - const measuredIndexes = order.map(({ value }) => values.indexOf(value)); - newOrder.forEach(({ value }, index) => { - newValues[measuredIndexes[index]] = value; - }); - onReorder(newValues); - } - }, - }; - React$1.useEffect(() => { - isReordering.current = false; - }); - // Combine refs if external ref is provided - const setRef = (element) => { - groupRef.current = element; - if (typeof externalRef === "function") { - externalRef(element); - } - else if (externalRef) { - externalRef.current = - element; - } - }; - /** - * Disable browser scroll anchoring on the group container. - * When items reorder, scroll anchoring can cause the browser to adjust - * the scroll position, which interferes with drag position calculations. - */ - const groupStyle = { - overflowAnchor: "none", - ...props.style, - }; - return (jsx(Component, { ...props, style: groupStyle, ref: setRef, ignoreStrict: true, children: jsx(ReorderContext.Provider, { value: context, children: children }) })); - } - const ReorderGroup = /*@__PURE__*/ React$1.forwardRef(ReorderGroupComponent); - - /** - * Creates a `MotionValue` to track the state and velocity of a value. - * - * Usually, these are created automatically. For advanced use-cases, like use with `useTransform`, you can create `MotionValue`s externally and pass them into the animated component via the `style` prop. - * - * ```jsx - * export const MyComponent = () => { - * const scale = useMotionValue(1) - * - * return - * } - * ``` - * - * @param initial - The initial state. - * - * @public - */ - function useMotionValue(initial) { - const value = useConstant(() => motionValue(initial)); - /** - * If this motion value is being used in static mode, like on - * the Framer canvas, force components to rerender when the motion - * value is updated. - */ - const { isStatic } = React$1.useContext(MotionConfigContext); - if (isStatic) { - const [, setLatest] = React$1.useState(initial); - React$1.useEffect(() => value.on("change", setLatest), []); - } - return value; - } - - function useCombineMotionValues(values, combineValues) { - /** - * Initialise the returned motion value. This remains the same between renders. - */ - const value = useMotionValue(combineValues()); - /** - * Create a function that will update the template motion value with the latest values. - * This is pre-bound so whenever a motion value updates it can schedule its - * execution in Framesync. If it's already been scheduled it won't be fired twice - * in a single frame. - */ - const updateValue = () => value.set(combineValues()); - /** - * Synchronously update the motion value with the latest values during the render. - * This ensures that within a React render, the styles applied to the DOM are up-to-date. - */ - updateValue(); - /** - * Subscribe to all motion values found within the template. Whenever any of them change, - * schedule an update. - */ - useIsomorphicLayoutEffect(() => { - const scheduleUpdate = () => frame.preRender(updateValue, false, true); - const subscriptions = values.map((v) => v.on("change", scheduleUpdate)); - return () => { - subscriptions.forEach((unsubscribe) => unsubscribe()); - cancelFrame(updateValue); - }; - }); - return value; - } - - function useComputed(compute) { - /** - * Open session of collectMotionValues. Any MotionValue that calls get() - * will be saved into this array. - */ - collectMotionValues.current = []; - compute(); - const value = useCombineMotionValues(collectMotionValues.current, compute); - /** - * Synchronously close session of collectMotionValues. - */ - collectMotionValues.current = undefined; - return value; - } - - function useTransform(input, inputRangeOrTransformer, outputRangeOrMap, options) { - if (typeof input === "function") { - return useComputed(input); - } - /** - * Detect if outputRangeOrMap is an output map (object with keys) - * rather than an output range (array). - */ - const isOutputMap = outputRangeOrMap !== undefined && - !Array.isArray(outputRangeOrMap) && - typeof inputRangeOrTransformer !== "function"; - if (isOutputMap) { - return useMapTransform(input, inputRangeOrTransformer, outputRangeOrMap, options); - } - const outputRange = outputRangeOrMap; - const transformer = typeof inputRangeOrTransformer === "function" - ? inputRangeOrTransformer - : transform(inputRangeOrTransformer, outputRange, options); - const result = Array.isArray(input) - ? useListTransform(input, transformer) - : useListTransform([input], ([latest]) => transformer(latest)); - const inputAccelerate = !Array.isArray(input) - ? input.accelerate - : undefined; - if (inputAccelerate && - !inputAccelerate.isTransformed && - typeof inputRangeOrTransformer !== "function" && - Array.isArray(outputRangeOrMap) && - options?.clamp !== false) { - result.accelerate = { - ...inputAccelerate, - times: inputRangeOrTransformer, - keyframes: outputRangeOrMap, - isTransformed: true, - ...(options?.ease ? { ease: options.ease } : {}), - }; - } - return result; - } - function useListTransform(values, transformer) { - const latest = useConstant(() => []); - return useCombineMotionValues(values, () => { - latest.length = 0; - const numValues = values.length; - for (let i = 0; i < numValues; i++) { - latest[i] = values[i].get(); - } - return transformer(latest); - }); - } - function useMapTransform(inputValue, inputRange, outputMap, options) { - /** - * Capture keys once to ensure hooks are called in consistent order. - */ - const keys = useConstant(() => Object.keys(outputMap)); - const output = useConstant(() => ({})); - for (const key of keys) { - output[key] = useTransform(inputValue, inputRange, outputMap[key], options); - } - return output; - } - - const threshold = 50; - const maxSpeed = 25; - const overflowStyles = new Set(["auto", "scroll"]); - // Track initial scroll limits per scrollable element (Bug 1 fix) - const initialScrollLimits = new WeakMap(); - const activeScrollEdge = new WeakMap(); - // Track which group element is currently dragging to clear state on end - let currentGroupElement = null; - function resetAutoScrollState() { - if (currentGroupElement) { - const scrollableAncestor = findScrollableAncestor(currentGroupElement, "y"); - if (scrollableAncestor) { - activeScrollEdge.delete(scrollableAncestor); - initialScrollLimits.delete(scrollableAncestor); - } - // Also try x axis - const scrollableAncestorX = findScrollableAncestor(currentGroupElement, "x"); - if (scrollableAncestorX && scrollableAncestorX !== scrollableAncestor) { - activeScrollEdge.delete(scrollableAncestorX); - initialScrollLimits.delete(scrollableAncestorX); - } - currentGroupElement = null; - } - } - function isScrollableElement(element, axis) { - const style = getComputedStyle(element); - const overflow = axis === "x" ? style.overflowX : style.overflowY; - const isDocumentScroll = element === document.body || - element === document.documentElement; - return overflowStyles.has(overflow) || isDocumentScroll; - } - function findScrollableAncestor(element, axis) { - let current = element?.parentElement; - while (current) { - if (isScrollableElement(current, axis)) { - return current; - } - current = current.parentElement; - } - return null; - } - function getScrollAmount(pointerPosition, scrollElement, axis) { - const rect = scrollElement.getBoundingClientRect(); - const start = axis === "x" ? Math.max(0, rect.left) : Math.max(0, rect.top); - const end = axis === "x" ? Math.min(window.innerWidth, rect.right) : Math.min(window.innerHeight, rect.bottom); - const distanceFromStart = pointerPosition - start; - const distanceFromEnd = end - pointerPosition; - if (distanceFromStart < threshold) { - const intensity = 1 - distanceFromStart / threshold; - return { amount: -maxSpeed * intensity * intensity, edge: "start" }; - } - else if (distanceFromEnd < threshold) { - const intensity = 1 - distanceFromEnd / threshold; - return { amount: maxSpeed * intensity * intensity, edge: "end" }; - } - return { amount: 0, edge: null }; - } - function autoScrollIfNeeded(groupElement, pointerPosition, axis, velocity) { - if (!groupElement) - return; - // Track the group element for cleanup - currentGroupElement = groupElement; - const scrollableAncestor = findScrollableAncestor(groupElement, axis); - if (!scrollableAncestor) - return; - // Convert pointer position from page coordinates to viewport coordinates. - // The gesture system uses pageX/pageY but getBoundingClientRect() returns - // viewport-relative coordinates, so we need to account for page scroll. - const viewportPointerPosition = pointerPosition - (axis === "x" ? window.scrollX : window.scrollY); - const { amount: scrollAmount, edge } = getScrollAmount(viewportPointerPosition, scrollableAncestor, axis); - // If not in any threshold zone, clear all state - if (edge === null) { - activeScrollEdge.delete(scrollableAncestor); - initialScrollLimits.delete(scrollableAncestor); - return; - } - const currentActiveEdge = activeScrollEdge.get(scrollableAncestor); - const isDocumentScroll = scrollableAncestor === document.body || - scrollableAncestor === document.documentElement; - // If not currently scrolling this edge, check velocity to see if we should start - if (currentActiveEdge !== edge) { - // Only start scrolling if velocity is towards the edge - const shouldStart = (edge === "start" && velocity < 0) || - (edge === "end" && velocity > 0); - if (!shouldStart) - return; - // Activate this edge - activeScrollEdge.set(scrollableAncestor, edge); - // Record initial scroll limit (prevents infinite scroll) - const maxScroll = axis === "x" - ? scrollableAncestor.scrollWidth - (isDocumentScroll ? window.innerWidth : scrollableAncestor.clientWidth) - : scrollableAncestor.scrollHeight - (isDocumentScroll ? window.innerHeight : scrollableAncestor.clientHeight); - initialScrollLimits.set(scrollableAncestor, maxScroll); - } - // Cap scrolling at initial limit (prevents infinite scroll) - if (scrollAmount > 0) { - const initialLimit = initialScrollLimits.get(scrollableAncestor); - const currentScroll = axis === "x" - ? (isDocumentScroll ? window.scrollX : scrollableAncestor.scrollLeft) - : (isDocumentScroll ? window.scrollY : scrollableAncestor.scrollTop); - if (currentScroll >= initialLimit) - return; - } - // Apply scroll - if (axis === "x") { - if (isDocumentScroll) { - window.scrollBy({ left: scrollAmount }); - } - else { - scrollableAncestor.scrollLeft += scrollAmount; - } - } - else { - if (isDocumentScroll) { - window.scrollBy({ top: scrollAmount }); - } - else { - scrollableAncestor.scrollTop += scrollAmount; - } - } - } - - function useDefaultMotionValue(value, defaultValue = 0) { - return isMotionValue(value) ? value : useMotionValue(defaultValue); - } - function ReorderItemComponent({ children, style = {}, value, as = "li", onDrag, onDragEnd, layout = true, ...props }, externalRef) { - const Component = useConstant(() => motion[as]); - const context = React$1.useContext(ReorderContext); - const point = { - x: useDefaultMotionValue(style.x), - y: useDefaultMotionValue(style.y), - }; - const zIndex = useTransform([point.x, point.y], ([latestX, latestY]) => latestX || latestY ? 1 : "unset"); - exports.invariant(Boolean(context), "Reorder.Item must be a child of Reorder.Group", "reorder-item-child"); - const { axis, registerItem, updateOrder, groupRef } = context; - const dragAxis = axis === "xy" ? true : axis; - return (jsx(Component, { drag: dragAxis, ...props, dragSnapToOrigin: true, style: { ...style, x: point.x, y: point.y, zIndex }, layout: layout, onDrag: (event, gesturePoint) => { - const { velocity, point: pointerPoint } = gesturePoint; - const offset = { x: point.x.get(), y: point.y.get() }; - updateOrder(value, offset, velocity); - const scrollAxis = axis === "xy" - ? Math.abs(velocity.x) > Math.abs(velocity.y) - ? "x" - : "y" - : axis; - autoScrollIfNeeded(groupRef.current, pointerPoint[scrollAxis], scrollAxis, velocity[scrollAxis]); - onDrag && onDrag(event, gesturePoint); - }, onDragEnd: (event, gesturePoint) => { - resetAutoScrollState(); - onDragEnd && onDragEnd(event, gesturePoint); - }, onLayoutMeasure: (measured) => { - registerItem(value, measured); - }, ref: externalRef, ignoreStrict: true, children: children })); - } - const ReorderItem = /*@__PURE__*/ React$1.forwardRef(ReorderItemComponent); - - var namespace = /*#__PURE__*/Object.freeze({ - __proto__: null, - Group: ReorderGroup, - Item: ReorderItem - }); - - function isDOMKeyframes(keyframes) { - return typeof keyframes === "object" && !Array.isArray(keyframes); - } - - function resolveSubjects(subject, keyframes, scope, selectorCache) { - if (subject == null) { - return []; - } - if (typeof subject === "string" && isDOMKeyframes(keyframes)) { - return resolveElements(subject, scope, selectorCache); - } - else if (subject instanceof NodeList) { - return Array.from(subject); - } - else if (Array.isArray(subject)) { - return subject.filter((s) => s != null); - } - else { - return [subject]; - } - } - - function calculateRepeatDuration(duration, repeat, repeatDelay) { - return duration * (repeat + 1) + repeatDelay * repeat; - } - - /** - * Given a absolute or relative time definition and current/prev time state of the sequence, - * calculate an absolute time for the next keyframes. - */ - function calcNextTime(current, next, prev, labels) { - if (typeof next === "number") { - return next; - } - else if (next.startsWith("-") || next.startsWith("+")) { - return Math.max(0, current + parseFloat(next)); - } - else if (next === "<") { - return prev; - } - else if (next.startsWith("<")) { - return Math.max(0, prev + parseFloat(next.slice(1))); - } - else { - return labels.get(next) ?? current; - } - } - - function eraseKeyframes(sequence, startTime, endTime) { - for (let i = 0; i < sequence.length; i++) { - const keyframe = sequence[i]; - if (keyframe.at > startTime && keyframe.at < endTime) { - removeItem(sequence, keyframe); - // If we remove this item we have to push the pointer back one - i--; - } - } - } - function addKeyframes(sequence, keyframes, easing, offset, startTime, endTime) { - /** - * Erase every existing value between currentTime and targetTime, - * this will essentially splice this timeline into any currently - * defined ones. - */ - eraseKeyframes(sequence, startTime, endTime); - for (let i = 0; i < keyframes.length; i++) { - sequence.push({ - value: keyframes[i], - at: mixNumber$1(startTime, endTime, offset[i]), - easing: getEasingForSegment(easing, i), - }); - } - } - - /** - * Take an array of times that represent repeated keyframes. For instance - * if we have original times of [0, 0.5, 1] then our repeated times will - * be [0, 0.5, 1, 1, 1.5, 2]. Loop over the times and scale them back - * down to a 0-1 scale. - * - * `repeatDelayUnits` is the repeatDelay expressed in units of a single - * iteration's duration, so the total span equals `(repeat + 1) + repeat * repeatDelayUnits`. - */ - function normalizeTimes(times, repeat, repeatDelayUnits = 0) { - const totalUnits = repeat + 1 + repeat * repeatDelayUnits; - for (let i = 0; i < times.length; i++) { - times[i] = times[i] / totalUnits; - } - } - - function compareByTime(a, b) { - if (a.at === b.at) { - if (a.value === null) - return 1; - if (b.value === null) - return -1; - return 0; - } - else { - return a.at - b.at; - } - } - - const defaultSegmentEasing = "easeInOut"; - const MAX_REPEAT = 20; - function createAnimationsFromSequence(sequence, { defaultTransition = {}, ...sequenceTransition } = {}, scope, generators) { - const defaultDuration = defaultTransition.duration || 0.3; - const animationDefinitions = new Map(); - const sequences = new Map(); - const elementCache = {}; - const timeLabels = new Map(); - let prevTime = 0; - let currentTime = 0; - let totalDuration = 0; - /** - * Build the timeline by mapping over the sequence array and converting - * the definitions into keyframes and offsets with absolute time values. - * These will later get converted into relative offsets in a second pass. - */ - for (let i = 0; i < sequence.length; i++) { - const segment = sequence[i]; - /** - * If this is a timeline label, mark it and skip the rest of this iteration. - */ - if (typeof segment === "string") { - timeLabels.set(segment, currentTime); - continue; - } - else if (!Array.isArray(segment)) { - timeLabels.set(segment.name, calcNextTime(currentTime, segment.at, prevTime, timeLabels)); - continue; - } - let [subject, keyframes, transition = {}] = segment; - /** - * If a relative or absolute time value has been specified we need to resolve - * it in relation to the currentTime. - */ - if (transition.at !== undefined) { - currentTime = calcNextTime(currentTime, transition.at, prevTime, timeLabels); - } - /** - * Keep track of the maximum duration in this definition. This will be - * applied to currentTime once the definition has been parsed. - */ - let maxDuration = 0; - const resolveValueSequence = (valueKeyframes, valueTransition, valueSequence, elementIndex = 0, numSubjects = 0) => { - const valueKeyframesAsList = keyframesAsList(valueKeyframes); - const { delay = 0, times = defaultOffset$1(valueKeyframesAsList), type = defaultTransition.type || "keyframes", repeat, repeatType, repeatDelay = 0, ...remainingTransition } = valueTransition; - let { ease = defaultTransition.ease || "easeOut", duration } = valueTransition; - /** - * Resolve stagger() if defined. - */ - const calculatedDelay = typeof delay === "function" - ? delay(elementIndex, numSubjects) - : delay; - /** - * If this animation should and can use a spring, generate a spring easing function. - */ - const numKeyframes = valueKeyframesAsList.length; - const createGenerator = isGenerator(type) - ? type - : generators?.[type || "keyframes"]; - if (numKeyframes <= 2 && createGenerator) { - /** - * As we're creating an easing function from a spring, - * ideally we want to generate it using the real distance - * between the two keyframes. However this isn't always - * possible - in these situations we use 0-100. - */ - let absoluteDelta = 100; - if (numKeyframes === 2 && - isNumberKeyframesArray(valueKeyframesAsList)) { - const delta = valueKeyframesAsList[1] - valueKeyframesAsList[0]; - absoluteDelta = Math.abs(delta); - } - const springTransition = { - ...defaultTransition, - ...remainingTransition, - }; - if (duration !== undefined) { - springTransition.duration = secondsToMilliseconds(duration); - } - const springEasing = createGeneratorEasing(springTransition, absoluteDelta, createGenerator); - ease = springEasing.ease; - duration = springEasing.duration; - } - duration ?? (duration = defaultDuration); - const startTime = currentTime + calculatedDelay; - /** - * If there's only one time offset of 0, fill in a second with length 1 - */ - if (times.length === 1 && times[0] === 0) { - times[1] = 1; - } - /** - * Fill out if offset if fewer offsets than keyframes - */ - const remainder = times.length - valueKeyframesAsList.length; - remainder > 0 && fillOffset(times, remainder); - /** - * If only one value has been set, ie [1], push a null to the start of - * the keyframe array. This will let us mark a keyframe at this point - * that will later be hydrated with the previous value. - */ - valueKeyframesAsList.length === 1 && - valueKeyframesAsList.unshift(null); - /** - * Segments can't express `repeat: Infinity` or very large - * counts — they'd leave dead time after the segment or - * explode the keyframe array. Ignore with a warning. - */ - if (repeat) { - exports.warning(repeat < MAX_REPEAT, `Sequence segments can't repeat ${repeat} times — ignoring repeat option. Use a value below ${MAX_REPEAT} or apply repeat at the sequence level instead.`); - } - if (repeat && repeat < MAX_REPEAT) { - /** - * Express repeatDelay in units of a single iteration's duration - * so it can be added to the per-iteration time offsets below - * before they're normalized to 0-1. - */ - const repeatDelayUnits = duration > 0 ? repeatDelay / duration : 0; - duration = calculateRepeatDuration(duration, repeat, repeatDelay); - const originalKeyframes = [...valueKeyframesAsList]; - const originalTimes = [...times]; - ease = Array.isArray(ease) ? [...ease] : [ease]; - const originalEase = [...ease]; - /** - * For reverse/mirror, alternate iterations play the segment - * backwards. mirror matches JSAnimation's mirroredGenerator: - * reversed keyframes, easings unchanged. reverse matches - * JSAnimation's iterationProgress = 1 - p: reversed - * keyframes, easing array reversed AND each function easing - * mapped through reverseEasing (string easings unchanged — - * they're resolved later by the keyframes engine). - */ - const isFlipping = repeatType === "reverse" || repeatType === "mirror"; - let flippedKeyframes = originalKeyframes; - let flippedEases = originalEase; - if (isFlipping) { - flippedKeyframes = [...originalKeyframes].reverse(); - if (repeatType === "reverse") { - flippedEases = [...originalEase] - .reverse() - .map((e) => typeof e === "function" - ? reverseEasing(e) - : e); - } - } - for (let repeatIndex = 0; repeatIndex < repeat; repeatIndex++) { - const isFlipped = isFlipping && repeatIndex % 2 === 0; - const iterKeyframes = isFlipped - ? flippedKeyframes - : originalKeyframes; - const iterEase = isFlipped ? flippedEases : originalEase; - const iterStartOffset = (repeatIndex + 1) * (1 + repeatDelayUnits); - /** - * If repeatDelay is set, hold the previous iteration's - * final value through the delay by inserting a keyframe - * at the moment the next iteration begins. - */ - if (repeatDelayUnits > 0) { - valueKeyframesAsList.push(valueKeyframesAsList[valueKeyframesAsList.length - 1]); - times.push(iterStartOffset); - ease.push("linear"); - } - valueKeyframesAsList.push(...iterKeyframes); - for (let keyframeIndex = 0; keyframeIndex < iterKeyframes.length; keyframeIndex++) { - times.push(originalTimes[keyframeIndex] + iterStartOffset); - ease.push(keyframeIndex === 0 - ? "linear" - : getEasingForSegment(iterEase, keyframeIndex - 1)); - } - } - normalizeTimes(times, repeat, repeatDelayUnits); - } - const targetTime = startTime + duration; - /** - * Add keyframes, mapping offsets to absolute time. - */ - addKeyframes(valueSequence, valueKeyframesAsList, ease, times, startTime, targetTime); - maxDuration = Math.max(calculatedDelay + duration, maxDuration); - totalDuration = Math.max(targetTime, totalDuration); - }; - if (isMotionValue(subject)) { - const subjectSequence = getSubjectSequence(subject, sequences); - resolveValueSequence(keyframes, transition, getValueSequence("default", subjectSequence)); - } - else { - const subjects = resolveSubjects(subject, keyframes, scope, elementCache); - const numSubjects = subjects.length; - /** - * For every element in this segment, process the defined values. - */ - for (let subjectIndex = 0; subjectIndex < numSubjects; subjectIndex++) { - /** - * Cast necessary, but we know these are of this type - */ - keyframes = keyframes; - transition = transition; - const thisSubject = subjects[subjectIndex]; - const subjectSequence = getSubjectSequence(thisSubject, sequences); - for (const key in keyframes) { - resolveValueSequence(keyframes[key], getValueTransition(transition, key), getValueSequence(key, subjectSequence), subjectIndex, numSubjects); - } - } - } - prevTime = currentTime; - currentTime += maxDuration; - } - /** - * For every element and value combination create a new animation. - */ - sequences.forEach((valueSequences, element) => { - for (const key in valueSequences) { - const valueSequence = valueSequences[key]; - /** - * Arrange all the keyframes in ascending time order. - */ - valueSequence.sort(compareByTime); - const keyframes = []; - const valueOffset = []; - const valueEasing = []; - /** - * For each keyframe, translate absolute times into - * relative offsets based on the total duration of the timeline. - */ - for (let i = 0; i < valueSequence.length; i++) { - const { at, value, easing } = valueSequence[i]; - keyframes.push(value); - valueOffset.push(progress(0, totalDuration, at)); - valueEasing.push(easing || "easeOut"); - } - /** - * If the first keyframe doesn't land on offset: 0 - * provide one by duplicating the initial keyframe. This ensures - * it snaps to the first keyframe when the animation starts. - */ - if (valueOffset[0] !== 0) { - valueOffset.unshift(0); - keyframes.unshift(keyframes[0]); - valueEasing.unshift(defaultSegmentEasing); - } - /** - * If the last keyframe doesn't land on offset: 1 - * provide one with a null wildcard value. This will ensure it - * stays static until the end of the animation. - */ - if (valueOffset[valueOffset.length - 1] !== 1) { - valueOffset.push(1); - keyframes.push(null); - } - if (!animationDefinitions.has(element)) { - animationDefinitions.set(element, { - keyframes: {}, - transition: {}, - }); - } - const definition = animationDefinitions.get(element); - definition.keyframes[key] = keyframes; - /** - * Exclude `type` from defaultTransition since springs have been - * converted to duration-based easing functions in resolveValueSequence. - * Including `type: "spring"` would cause JSAnimation to error when - * the merged keyframes array has more than 2 keyframes. - */ - const { type: _type, ...remainingDefaultTransition } = defaultTransition; - definition.transition[key] = { - ...remainingDefaultTransition, - duration: totalDuration, - ease: valueEasing, - times: valueOffset, - ...sequenceTransition, - }; - } - }); - return animationDefinitions; - } - function getSubjectSequence(subject, sequences) { - !sequences.has(subject) && sequences.set(subject, {}); - return sequences.get(subject); - } - function getValueSequence(name, sequences) { - if (!sequences[name]) - sequences[name] = []; - return sequences[name]; - } - function keyframesAsList(keyframes) { - return Array.isArray(keyframes) ? keyframes : [keyframes]; - } - function getValueTransition(transition, key) { - return transition && transition[key] - ? { - ...transition, - ...transition[key], - } - : { ...transition }; - } - const isNumber = (keyframe) => typeof keyframe === "number"; - const isNumberKeyframesArray = (keyframes) => keyframes.every(isNumber); - - function createDOMVisualElement(element) { - const options = { - presenceContext: null, - props: {}, - visualState: { - renderState: { - transform: {}, - transformOrigin: {}, - style: {}, - vars: {}, - attrs: {}, - }, - latestValues: {}, - }, - }; - const node = isSVGElement(element) && !isSVGSVGElement(element) - ? new SVGVisualElement(options) - : new HTMLVisualElement(options); - node.mount(element); - visualElementStore.set(element, node); - } - function createObjectVisualElement(subject) { - const options = { - presenceContext: null, - props: {}, - visualState: { - renderState: { - output: {}, - }, - latestValues: {}, - }, - }; - const node = new ObjectVisualElement(options); - node.mount(subject); - visualElementStore.set(subject, node); - } - - function isSingleValue(subject, keyframes) { - return (isMotionValue(subject) || - typeof subject === "number" || - (typeof subject === "string" && !isDOMKeyframes(keyframes))); - } - /** - * Implementation - */ - function animateSubject(subject, keyframes, options, scope) { - const animations = []; - if (isSingleValue(subject, keyframes)) { - animations.push(animateSingleValue(subject, isDOMKeyframes(keyframes) - ? keyframes.default || keyframes - : keyframes, options ? options.default || options : options)); - } - else { - // Gracefully handle null/undefined subjects (e.g., from querySelector returning null) - if (subject == null) { - return animations; - } - const subjects = resolveSubjects(subject, keyframes, scope); - const numSubjects = subjects.length; - exports.invariant(Boolean(numSubjects), "No valid elements provided.", "no-valid-elements"); - for (let i = 0; i < numSubjects; i++) { - const thisSubject = subjects[i]; - const createVisualElement = thisSubject instanceof Element - ? createDOMVisualElement - : createObjectVisualElement; - if (!visualElementStore.has(thisSubject)) { - createVisualElement(thisSubject); - } - const visualElement = visualElementStore.get(thisSubject); - const transition = { ...options }; - /** - * Resolve stagger function if provided. - */ - if ("delay" in transition && - typeof transition.delay === "function") { - transition.delay = transition.delay(i, numSubjects); - } - animations.push(...animateTarget(visualElement, { ...keyframes, transition }, {})); - } - } - return animations; - } - - function animateSequence(sequence, options, scope) { - const animations = []; - /** - * Pre-process: replace function segments with MotionValue segments, - * subscribe callbacks immediately - */ - const processedSequence = sequence.map((segment) => { - if (Array.isArray(segment) && typeof segment[0] === "function") { - const callback = segment[0]; - const mv = motionValue(0); - mv.on("change", callback); - if (segment.length === 1) { - return [mv, [0, 1]]; - } - else if (segment.length === 2) { - return [mv, [0, 1], segment[1]]; - } - else { - return [mv, segment[1], segment[2]]; - } - } - return segment; - }); - const animationDefinitions = createAnimationsFromSequence(processedSequence, options, scope, { spring }); - animationDefinitions.forEach(({ keyframes, transition }, subject) => { - animations.push(...animateSubject(subject, keyframes, transition)); - }); - return animations; - } - - function isSequence(value) { - return Array.isArray(value) && value.some(Array.isArray); - } - /** - * Creates an animation function that is optionally scoped - * to a specific element. - */ - function createScopedAnimate(options = {}) { - const { scope, reduceMotion, skipAnimations } = options; - /** - * Implementation - */ - function scopedAnimate(subjectOrSequence, optionsOrKeyframes, options) { - let animations = []; - let animationOnComplete; - const inherited = {}; - if (reduceMotion !== undefined) - inherited.reduceMotion = reduceMotion; - if (skipAnimations !== undefined) - inherited.skipAnimations = skipAnimations; - if (isSequence(subjectOrSequence)) { - const { onComplete, ...sequenceOptions } = optionsOrKeyframes || {}; - if (typeof onComplete === "function") { - animationOnComplete = onComplete; - } - animations = animateSequence(subjectOrSequence, { ...inherited, ...sequenceOptions }, scope); - } - else { - // Extract top-level onComplete so it doesn't get applied per-value - const { onComplete, ...rest } = options || {}; - if (typeof onComplete === "function") { - animationOnComplete = onComplete; - } - animations = animateSubject(subjectOrSequence, optionsOrKeyframes, { ...inherited, ...rest }, scope); - } - const animation = new GroupAnimationWithThen(animations); - if (animationOnComplete) { - animation.finished.then(animationOnComplete); - } - if (scope) { - scope.animations.push(animation); - animation.finished.then(() => { - removeItem(scope.animations, animation); - }); - } - return animation; - } - return scopedAnimate; - } - const animate = createScopedAnimate(); - - function animateElements(elementOrSelector, keyframes, options, scope) { - // Gracefully handle null/undefined elements (e.g., from querySelector returning null) - if (elementOrSelector == null) { - return []; - } - const elements = resolveElements(elementOrSelector, scope); - const numElements = elements.length; - exports.invariant(Boolean(numElements), "No valid elements provided.", "no-valid-elements"); - /** - * WAAPI doesn't support interrupting animations. - * - * Therefore, starting animations requires a three-step process: - * 1. Stop existing animations (write styles to DOM) - * 2. Resolve keyframes (read styles from DOM) - * 3. Create new animations (write styles to DOM) - * - * The hybrid `animate()` function uses AsyncAnimation to resolve - * keyframes before creating new animations, which removes style - * thrashing. Here, we have much stricter filesize constraints. - * Therefore we do this in a synchronous way that ensures that - * at least within `animate()` calls there is no style thrashing. - * - * In the motion-native-animate-mini-interrupt benchmark this - * was 80% faster than a single loop. - */ - const animationDefinitions = []; - /** - * Step 1: Build options and stop existing animations (write) - */ - for (let i = 0; i < numElements; i++) { - const element = elements[i]; - const elementTransition = { ...options }; - /** - * Resolve stagger function if provided. - */ - if (typeof elementTransition.delay === "function") { - elementTransition.delay = elementTransition.delay(i, numElements); - } - for (const valueName in keyframes) { - let valueKeyframes = keyframes[valueName]; - if (!Array.isArray(valueKeyframes)) { - valueKeyframes = [valueKeyframes]; - } - const valueOptions = { - ...getValueTransition$1(elementTransition, valueName), - }; - valueOptions.duration && (valueOptions.duration = secondsToMilliseconds(valueOptions.duration)); - valueOptions.delay && (valueOptions.delay = secondsToMilliseconds(valueOptions.delay)); - /** - * If there's an existing animation playing on this element then stop it - * before creating a new one. - */ - const map = getAnimationMap(element); - const key = animationMapKey(valueName, valueOptions.pseudoElement || ""); - const currentAnimation = map.get(key); - currentAnimation && currentAnimation.stop(); - animationDefinitions.push({ - map, - key, - unresolvedKeyframes: valueKeyframes, - options: { - ...valueOptions, - element, - name: valueName, - allowFlatten: !elementTransition.type && !elementTransition.ease, - }, - }); - } - } - /** - * Step 2: Resolve keyframes (read) - */ - for (let i = 0; i < animationDefinitions.length; i++) { - const { unresolvedKeyframes, options: animationOptions } = animationDefinitions[i]; - const { element, name, pseudoElement } = animationOptions; - if (!pseudoElement && unresolvedKeyframes[0] === null) { - unresolvedKeyframes[0] = getComputedStyle$2(element, name); - } - fillWildcards(unresolvedKeyframes); - applyPxDefaults(unresolvedKeyframes, name); - /** - * If we only have one keyframe, explicitly read the initial keyframe - * from the computed style. This is to ensure consistency with WAAPI behaviour - * for restarting animations, for instance .play() after finish, when it - * has one vs two keyframes. - */ - if (!pseudoElement && unresolvedKeyframes.length < 2) { - unresolvedKeyframes.unshift(getComputedStyle$2(element, name)); - } - animationOptions.keyframes = unresolvedKeyframes; - } - /** - * Step 3: Create new animations (write) - */ - const animations = []; - for (let i = 0; i < animationDefinitions.length; i++) { - const { map, key, options: animationOptions } = animationDefinitions[i]; - const animation = new NativeAnimation(animationOptions); - map.set(key, animation); - animation.finished.finally(() => map.delete(key)); - animations.push(animation); - } - return animations; - } - - const createScopedWaapiAnimate = (scope) => { - function scopedAnimate(elementOrSelector, keyframes, options) { - return new GroupAnimationWithThen(animateElements(elementOrSelector, keyframes, options, scope)); - } - return scopedAnimate; - }; - const animateMini = /*@__PURE__*/ createScopedWaapiAnimate(); - - function canUseNativeTimeline(target) { - if (typeof window === "undefined") - return false; - return target ? supportsViewTimeline() : supportsScrollTimeline(); - } - - /** - * A time in milliseconds, beyond which we consider the scroll velocity to be 0. - */ - const maxElapsed = 50; - const createAxisInfo = () => ({ - current: 0, - offset: [], - progress: 0, - scrollLength: 0, - targetOffset: 0, - targetLength: 0, - containerLength: 0, - velocity: 0, - }); - const createScrollInfo = () => ({ - time: 0, - x: createAxisInfo(), - y: createAxisInfo(), - }); - const keys = { - x: { - length: "Width", - position: "Left", - }, - y: { - length: "Height", - position: "Top", - }, - }; - function updateAxisInfo(element, axisName, info, time) { - const axis = info[axisName]; - const { length, position } = keys[axisName]; - const prev = axis.current; - const prevTime = info.time; - axis.current = Math.abs(element[`scroll${position}`]); - axis.scrollLength = element[`scroll${length}`] - element[`client${length}`]; - axis.offset.length = 0; - axis.offset[0] = 0; - axis.offset[1] = axis.scrollLength; - axis.progress = progress(0, axis.scrollLength, axis.current); - const elapsed = time - prevTime; - axis.velocity = - elapsed > maxElapsed - ? 0 - : velocityPerSecond(axis.current - prev, elapsed); - } - function updateScrollInfo(element, info, time) { - updateAxisInfo(element, "x", info, time); - updateAxisInfo(element, "y", info, time); - info.time = time; - } - - function calcInset(element, container) { - const inset = { x: 0, y: 0 }; - let current = element; - while (current && current !== container) { - if (isHTMLElement(current)) { - inset.x += current.offsetLeft; - inset.y += current.offsetTop; - current = current.offsetParent; - } - else if (current.tagName === "svg") { - /** - * This isn't an ideal approach to measuring the offset of tags. - * It would be preferable, given they behave like HTMLElements in most ways - * to use offsetLeft/Top. But these don't exist on . Likewise we - * can't use .getBBox() like most SVG elements as these provide the offset - * relative to the SVG itself, which for is usually 0x0. - */ - const svgBoundingBox = current.getBoundingClientRect(); - current = current.parentElement; - const parentBoundingBox = current.getBoundingClientRect(); - inset.x += svgBoundingBox.left - parentBoundingBox.left; - inset.y += svgBoundingBox.top - parentBoundingBox.top; - } - else if (current instanceof SVGGraphicsElement) { - const { x, y } = current.getBBox(); - inset.x += x; - inset.y += y; - let svg = null; - let parent = current.parentNode; - while (!svg) { - if (parent.tagName === "svg") { - svg = parent; - } - parent = current.parentNode; - } - current = svg; - } - else { - break; - } - } - return inset; - } - - const namedEdges = { - start: 0, - center: 0.5, - end: 1, - }; - function resolveEdge(edge, length, inset = 0) { - let delta = 0; - /** - * If we have this edge defined as a preset, replace the definition - * with the numerical value. - */ - if (edge in namedEdges) { - edge = namedEdges[edge]; - } - /** - * Handle unit values - */ - if (typeof edge === "string") { - const asNumber = parseFloat(edge); - if (edge.endsWith("px")) { - delta = asNumber; - } - else if (edge.endsWith("%")) { - edge = asNumber / 100; - } - else if (edge.endsWith("vw")) { - delta = (asNumber / 100) * document.documentElement.clientWidth; - } - else if (edge.endsWith("vh")) { - delta = (asNumber / 100) * document.documentElement.clientHeight; - } - else { - edge = asNumber; - } - } - /** - * If the edge is defined as a number, handle as a progress value. - */ - if (typeof edge === "number") { - delta = length * edge; - } - return inset + delta; - } - - const defaultOffset = [0, 0]; - function resolveOffset(offset, containerLength, targetLength, targetInset) { - let offsetDefinition = Array.isArray(offset) ? offset : defaultOffset; - let targetPoint = 0; - let containerPoint = 0; - if (typeof offset === "number") { - /** - * If we're provided offset: [0, 0.5, 1] then each number x should become - * [x, x], so we default to the behaviour of mapping 0 => 0 of both target - * and container etc. - */ - offsetDefinition = [offset, offset]; - } - else if (typeof offset === "string") { - offset = offset.trim(); - if (offset.includes(" ")) { - offsetDefinition = offset.split(" "); - } - else { - /** - * If we're provided a definition like "100px" then we want to apply - * that only to the top of the target point, leaving the container at 0. - * Whereas a named offset like "end" should be applied to both. - */ - offsetDefinition = [offset, namedEdges[offset] ? offset : `0`]; - } - } - targetPoint = resolveEdge(offsetDefinition[0], targetLength, targetInset); - containerPoint = resolveEdge(offsetDefinition[1], containerLength); - return targetPoint - containerPoint; - } - - const ScrollOffset = { - Enter: [ - [0, 1], - [1, 1], - ], - Exit: [ - [0, 0], - [1, 0], - ], - Any: [ - [1, 0], - [0, 1], - ], - All: [ - [0, 0], - [1, 1], - ], - }; - - const point = { x: 0, y: 0 }; - function getTargetSize(target) { - return "getBBox" in target && target.tagName !== "svg" - ? target.getBBox() - : { width: target.clientWidth, height: target.clientHeight }; - } - function resolveOffsets(container, info, options) { - const { offset: offsetDefinition = ScrollOffset.All } = options; - const { target = container, axis = "y" } = options; - const lengthLabel = axis === "y" ? "height" : "width"; - const inset = target !== container ? calcInset(target, container) : point; - /** - * Measure the target and container. If they're the same thing then we - * use the container's scrollWidth/Height as the target, from there - * all other calculations can remain the same. - */ - const targetSize = target === container - ? { width: container.scrollWidth, height: container.scrollHeight } - : getTargetSize(target); - const containerSize = { - width: container.clientWidth, - height: container.clientHeight, - }; - /** - * Reset the length of the resolved offset array rather than creating a new one. - * TODO: More reusable data structures for targetSize/containerSize would also be good. - */ - info[axis].offset.length = 0; - /** - * Populate the offset array by resolving the user's offset definition into - * a list of pixel scroll offets. - */ - let hasChanged = !info[axis].interpolate; - const numOffsets = offsetDefinition.length; - for (let i = 0; i < numOffsets; i++) { - const offset = resolveOffset(offsetDefinition[i], containerSize[lengthLabel], targetSize[lengthLabel], inset[axis]); - if (!hasChanged && offset !== info[axis].interpolatorOffsets[i]) { - hasChanged = true; - } - info[axis].offset[i] = offset; - } - /** - * If the pixel scroll offsets have changed, create a new interpolator function - * to map scroll value into a progress. - */ - if (hasChanged) { - info[axis].interpolate = interpolate(info[axis].offset, defaultOffset$1(offsetDefinition), { clamp: false }); - info[axis].interpolatorOffsets = [...info[axis].offset]; - } - info[axis].progress = clamp(0, 1, info[axis].interpolate(info[axis].current)); - } - - function measure(container, target = container, info) { - /** - * Find inset of target within scrollable container - */ - info.x.targetOffset = 0; - info.y.targetOffset = 0; - if (target !== container) { - let node = target; - while (node && node !== container) { - info.x.targetOffset += node.offsetLeft; - info.y.targetOffset += node.offsetTop; - node = node.offsetParent; - } - } - info.x.targetLength = - target === container ? target.scrollWidth : target.clientWidth; - info.y.targetLength = - target === container ? target.scrollHeight : target.clientHeight; - info.x.containerLength = container.clientWidth; - info.y.containerLength = container.clientHeight; - /** - * In development mode ensure scroll containers aren't position: static as this makes - * it difficult to measure their relative positions. The document scrolling element - * is exempt: offsetParent measurements naturally resolve relative to the document. - */ - { - if (container && - target && - target !== container && - container !== document.documentElement && - container !== document.scrollingElement && - container !== document.body) { - warnOnce(getComputedStyle(container).position !== "static", "Please ensure that the container has a non-static position, like 'relative', 'fixed', or 'absolute' to ensure scroll offset is calculated correctly."); - } - } - } - function createOnScrollHandler(element, onScroll, info, options = {}) { - return { - measure: (time) => { - measure(element, options.target, info); - updateScrollInfo(element, info, time); - if (options.offset || options.target) { - resolveOffsets(element, info, options); - } - }, - notify: () => onScroll(info), - }; - } - - const scrollListeners = new WeakMap(); - const resizeListeners = new WeakMap(); - const onScrollHandlers = new WeakMap(); - const scrollSize = new WeakMap(); - const dimensionCheckProcesses = new WeakMap(); - const getEventTarget = (element) => element === document.scrollingElement ? window : element; - function scrollInfo(onScroll, { container = document.scrollingElement, trackContentSize = false, ...options } = {}) { - if (!container) - return noop; - let containerHandlers = onScrollHandlers.get(container); - /** - * Get the onScroll handlers for this container. - * If one isn't found, create a new one. - */ - if (!containerHandlers) { - containerHandlers = new Set(); - onScrollHandlers.set(container, containerHandlers); - } - /** - * Create a new onScroll handler for the provided callback. - */ - const info = createScrollInfo(); - const containerHandler = createOnScrollHandler(container, onScroll, info, options); - containerHandlers.add(containerHandler); - /** - * Check if there's a scroll event listener for this container. - * If not, create one. - */ - if (!scrollListeners.has(container)) { - const measureAll = () => { - for (const handler of containerHandlers) { - handler.measure(frameData.timestamp); - } - frame.preUpdate(notifyAll); - }; - const notifyAll = () => { - for (const handler of containerHandlers) { - handler.notify(); - } - }; - const listener = () => frame.read(measureAll); - scrollListeners.set(container, listener); - const target = getEventTarget(container); - window.addEventListener("resize", listener); - if (container !== document.documentElement) { - resizeListeners.set(container, resize(container, listener)); - } - target.addEventListener("scroll", listener); - listener(); - } - /** - * Enable content size tracking if requested and not already enabled. - */ - if (trackContentSize && !dimensionCheckProcesses.has(container)) { - const listener = scrollListeners.get(container); - // Store initial scroll dimensions (object is reused to avoid allocation) - const size = { - width: container.scrollWidth, - height: container.scrollHeight, - }; - scrollSize.set(container, size); - // Add frame-based scroll dimension checking to detect content changes - const checkScrollDimensions = () => { - const newWidth = container.scrollWidth; - const newHeight = container.scrollHeight; - if (size.width !== newWidth || size.height !== newHeight) { - listener(); - size.width = newWidth; - size.height = newHeight; - } - }; - // Schedule with keepAlive=true to run every frame - const dimensionCheckProcess = frame.read(checkScrollDimensions, true); - dimensionCheckProcesses.set(container, dimensionCheckProcess); - } - const listener = scrollListeners.get(container); - frame.read(listener, false, true); - return () => { - cancelFrame(listener); - /** - * Check if we even have any handlers for this container. - */ - const currentHandlers = onScrollHandlers.get(container); - if (!currentHandlers) - return; - currentHandlers.delete(containerHandler); - if (currentHandlers.size) - return; - /** - * If no more handlers, remove the scroll listener too. - */ - const scrollListener = scrollListeners.get(container); - scrollListeners.delete(container); - if (scrollListener) { - getEventTarget(container).removeEventListener("scroll", scrollListener); - resizeListeners.get(container)?.(); - window.removeEventListener("resize", scrollListener); - } - // Clean up scroll dimension checking - const dimensionCheckProcess = dimensionCheckProcesses.get(container); - if (dimensionCheckProcess) { - cancelFrame(dimensionCheckProcess); - dimensionCheckProcesses.delete(container); - } - scrollSize.delete(container); - }; - } - - /** - * Maps from ProgressIntersection pairs used by Motion's preset offsets to - * ViewTimeline named ranges. Returns undefined for unrecognised patterns, - * which signals the caller to fall back to JS-based scroll tracking. - */ - const presets = [ - [ScrollOffset.Enter, "entry"], - [ScrollOffset.Exit, "exit"], - [ScrollOffset.Any, "cover"], - [ScrollOffset.All, "contain"], - ]; - const stringToProgress = { - start: 0, - end: 1, - }; - function parseStringOffset(s) { - const parts = s.trim().split(/\s+/); - if (parts.length !== 2) - return undefined; - const a = stringToProgress[parts[0]]; - const b = stringToProgress[parts[1]]; - if (a === undefined || b === undefined) - return undefined; - return [a, b]; - } - function normaliseOffset(offset) { - if (offset.length !== 2) - return undefined; - const result = []; - for (const item of offset) { - if (Array.isArray(item)) { - result.push(item); - } - else if (typeof item === "string") { - const parsed = parseStringOffset(item); - if (!parsed) - return undefined; - result.push(parsed); - } - else { - return undefined; - } - } - return result; - } - function matchesPreset(offset, preset) { - const normalised = normaliseOffset(offset); - if (!normalised) - return false; - for (let i = 0; i < 2; i++) { - const o = normalised[i]; - const p = preset[i]; - if (o[0] !== p[0] || o[1] !== p[1]) - return false; - } - return true; - } - function offsetToViewTimelineRange(offset) { - if (!offset) { - return { rangeStart: "contain 0%", rangeEnd: "contain 100%" }; - } - for (const [preset, name] of presets) { - if (matchesPreset(offset, preset)) { - return { rangeStart: `${name} 0%`, rangeEnd: `${name} 100%` }; - } - } - return undefined; - } - - const timelineCache = new Map(); - function scrollTimelineFallback(options) { - const currentTime = { value: 0 }; - const cancel = scrollInfo((info) => { - currentTime.value = info[options.axis].progress * 100; - }, options); - return { currentTime, cancel }; - } - function getTimeline({ source, container, ...options }) { - const { axis } = options; - if (source) - container = source; - let containerCache = timelineCache.get(container); - if (!containerCache) { - containerCache = new Map(); - timelineCache.set(container, containerCache); - } - const targetKey = options.target ?? "self"; - let targetCache = containerCache.get(targetKey); - if (!targetCache) { - targetCache = {}; - containerCache.set(targetKey, targetCache); - } - const axisKey = axis + (options.offset ?? []).join(","); - if (!targetCache[axisKey]) { - if (options.target && canUseNativeTimeline(options.target)) { - const range = offsetToViewTimelineRange(options.offset); - if (range) { - targetCache[axisKey] = new ViewTimeline({ - subject: options.target, - axis, - }); - } - else { - targetCache[axisKey] = scrollTimelineFallback({ - container, - ...options, - }); - } - } - else if (canUseNativeTimeline()) { - targetCache[axisKey] = new ScrollTimeline({ - source: container, - axis, - }); - } - else { - targetCache[axisKey] = scrollTimelineFallback({ - container, - ...options, - }); - } - } - return targetCache[axisKey]; - } - - function attachToAnimation(animation, options) { - const timeline = getTimeline(options); - const range = options.target - ? offsetToViewTimelineRange(options.offset) - : undefined; - /** - * Use native timeline when: - * - No target: ScrollTimeline (existing behaviour) - * - Target with mappable offset: ViewTimeline with named range - * - Target with unmappable offset: fall back to JS observe - */ - const useNative = options.target - ? canUseNativeTimeline(options.target) && !!range - : canUseNativeTimeline(); - return animation.attachTimeline({ - timeline: useNative ? timeline : undefined, - ...(range && - useNative && { - rangeStart: range.rangeStart, - rangeEnd: range.rangeEnd, - }), - observe: (valueAnimation) => { - valueAnimation.pause(); - return observeTimeline((progress) => { - valueAnimation.time = - valueAnimation.iterationDuration * progress; - }, timeline); - }, - }); - } - - /** - * Currently, we only support element tracking with `scrollInfo`, though in - * the future we can also offer ViewTimeline support. - */ - function isElementTracking(options) { - return options && (options.target || options.offset); - } - - /** - * If the onScroll function has two arguments, it's expecting - * more specific information about the scroll from scrollInfo. - */ - function isOnScrollWithInfo(onScroll) { - return onScroll.length === 2; - } - function attachToFunction(onScroll, options) { - if (isOnScrollWithInfo(onScroll) || isElementTracking(options)) { - return scrollInfo((info) => { - onScroll(info[options.axis].progress, info); - }, options); - } - else { - return observeTimeline(onScroll, getTimeline(options)); - } - } - - function scroll(onScroll, { axis = "y", container = document.scrollingElement, ...options } = {}) { - if (!container) - return noop; - const optionsWithDefaults = { axis, container, ...options }; - return typeof onScroll === "function" - ? attachToFunction(onScroll, optionsWithDefaults) - : attachToAnimation(onScroll, optionsWithDefaults); - } - - const thresholds = { - some: 0, - all: 1, - }; - function inView(elementOrSelector, onStart, { root, margin: rootMargin, amount = "some" } = {}) { - const elements = resolveElements(elementOrSelector); - const activeIntersections = new WeakMap(); - const onIntersectionChange = (entries) => { - entries.forEach((entry) => { - const onEnd = activeIntersections.get(entry.target); - /** - * If there's no change to the intersection, we don't need to - * do anything here. - */ - if (entry.isIntersecting === Boolean(onEnd)) - return; - if (entry.isIntersecting) { - const newOnEnd = onStart(entry.target, entry); - if (typeof newOnEnd === "function") { - activeIntersections.set(entry.target, newOnEnd); - } - else { - observer.unobserve(entry.target); - } - } - else if (typeof onEnd === "function") { - onEnd(entry); - activeIntersections.delete(entry.target); - } - }); - }; - const observer = new IntersectionObserver(onIntersectionChange, { - root, - rootMargin, - threshold: typeof amount === "number" ? amount : thresholds[amount], - }); - elements.forEach((element) => observer.observe(element)); - return () => observer.disconnect(); - } - - const m = /*@__PURE__*/ createMotionProxy(); - - function useUnmountEffect(callback) { - return React$1.useEffect(() => () => callback(), []); - } - - /** - * @public - */ - const domAnimation = { - renderer: createDomVisualElement, - ...animations, - ...gestureAnimations, - }; - - /** - * @public - */ - const domMax = { - ...domAnimation, - ...drag, - ...layout, - }; - - /** - * @public - */ - const domMin = { - renderer: createDomVisualElement, - ...animations, - }; - - function useMotionValueEvent(value, event, callback) { - /** - * useInsertionEffect will create subscriptions before any other - * effects will run. Effects run upwards through the tree so it - * can be that binding a useLayoutEffect higher up the tree can - * miss changes from lower down the tree. - */ - React$1.useInsertionEffect(() => value.on(event, callback), [value, event, callback]); - } - - const createScrollMotionValues = () => ({ - scrollX: motionValue(0), - scrollY: motionValue(0), - scrollXProgress: motionValue(0), - scrollYProgress: motionValue(0), - }); - const isRefPending = (ref) => { - if (!ref) - return false; - return !ref.current; - }; - function makeAccelerateConfig(axis, options, container, target) { - return { - // Refs attach child-first; defer so target.current is populated - // before scroll() reads it. - factory: (animation) => { - let cleanup; - const start = () => { - // A provided ref may be hydrated by an effect declared after - // useScroll (or in a parent). Don't attach to the window - // scroll in the meantime — that result gets cached and would - // permanently mistrack. Wait until the ref resolves. - if (isRefPending(container) || isRefPending(target)) { - microtask.read(start); - return; - } - cleanup = scroll(animation, { - ...options, - axis, - container: container?.current || undefined, - target: target?.current || undefined, - }); - }; - microtask.read(start); - return () => { - cancelMicrotask(start); - cleanup?.(); - }; - }, - times: [0, 1], - keyframes: [0, 1], - ease: (v) => v, - duration: 1, - }; - } - function canAccelerateScroll(target, offset) { - if (typeof window === "undefined") - return false; - return target - ? supportsViewTimeline() && !!offsetToViewTimelineRange(offset) - : supportsScrollTimeline(); - } - function useScroll({ container, target, ...options } = {}) { - const values = useConstant(createScrollMotionValues); - if (canAccelerateScroll(target, options.offset)) { - values.scrollXProgress.accelerate = makeAccelerateConfig("x", options, container, target); - values.scrollYProgress.accelerate = makeAccelerateConfig("y", options, container, target); - } - const scrollAnimation = React$1.useRef(null); - const needsStart = React$1.useRef(false); - const start = React$1.useCallback(() => { - scrollAnimation.current = scroll((_progress, { x, y, }) => { - values.scrollX.set(x.current); - values.scrollXProgress.set(x.progress); - values.scrollY.set(y.current); - values.scrollYProgress.set(y.progress); - }, { - ...options, - container: container?.current || undefined, - target: target?.current || undefined, - }); - return () => { - scrollAnimation.current?.(); - }; - }, [container, target, JSON.stringify(options.offset)]); - useIsomorphicLayoutEffect(() => { - needsStart.current = false; - if (isRefPending(container) || isRefPending(target)) { - needsStart.current = true; - return; - } - else { - return start(); - } - }, [start]); - React$1.useEffect(() => { - if (!needsStart.current) - return; - // Defer to a microtask so any sibling/parent effect that hydrates the - // ref has a chance to run first. - let cleanup; - const tryStart = () => { - const containerPending = isRefPending(container); - const targetPending = isRefPending(target); - exports.invariant(!containerPending, "Container ref is defined but not hydrated", "use-scroll-ref"); - exports.invariant(!targetPending, "Target ref is defined but not hydrated", "use-scroll-ref"); - if (!containerPending && !targetPending) - cleanup = start(); - }; - microtask.read(tryStart); - return () => { - cancelMicrotask(tryStart); - cleanup?.(); - }; - }, [start]); - return values; - } - - /** - * @deprecated useElementScroll is deprecated. Convert to useScroll({ container: ref }) - */ - function useElementScroll(ref) { - { - warnOnce(false, "useElementScroll is deprecated. Convert to useScroll({ container: ref })."); - } - return useScroll({ container: ref }); - } - - /** - * @deprecated useViewportScroll is deprecated. Convert to useScroll() - */ - function useViewportScroll() { - { - warnOnce(false, "useViewportScroll is deprecated. Convert to useScroll()."); - } - return useScroll(); - } - - /** - * Combine multiple motion values into a new one using a string template literal. - * - * ```jsx - * import { - * motion, - * useSpring, - * useMotionValue, - * useMotionTemplate - * } from "framer-motion" - * - * function Component() { - * const shadowX = useSpring(0) - * const shadowY = useMotionValue(0) - * const shadow = useMotionTemplate`drop-shadow(${shadowX}px ${shadowY}px 20px rgba(0,0,0,0.3))` - * - * return - * } - * ``` - * - * @public - */ - function useMotionTemplate(fragments, ...values) { - /** - * Create a function that will build a string from the latest motion values. - */ - const numFragments = fragments.length; - function buildValue() { - let output = ``; - for (let i = 0; i < numFragments; i++) { - output += fragments[i]; - const value = values[i]; - if (value) { - output += isMotionValue(value) ? value.get() : value; - } - } - return output; - } - return useCombineMotionValues(values.filter(isMotionValue), buildValue); - } - - function useFollowValue(source, options = {}) { - const { isStatic } = React$1.useContext(MotionConfigContext); - const getFromSource = () => (isMotionValue(source) ? source.get() : source); - // isStatic will never change, allowing early hooks return - if (isStatic) { - return useTransform(getFromSource); - } - const value = useMotionValue(getFromSource()); - React$1.useInsertionEffect(() => { - return attachFollow(value, source, options); - }, [value, JSON.stringify(options)]); - return value; - } - - function useSpring(source, options = {}) { - return useFollowValue(source, { type: "spring", ...options }); - } - - function useAnimationFrame(callback) { - const initialTimestamp = React$1.useRef(0); - const { isStatic } = React$1.useContext(MotionConfigContext); - React$1.useEffect(() => { - if (isStatic) - return; - const provideTimeSinceStart = ({ timestamp, delta }) => { - if (!initialTimestamp.current) - initialTimestamp.current = timestamp; - callback(timestamp - initialTimestamp.current, delta); - }; - frame.update(provideTimeSinceStart, true); - return () => cancelFrame(provideTimeSinceStart); - }, [callback]); - } - - function useTime() { - const time = useMotionValue(0); - useAnimationFrame((t) => time.set(t)); - return time; - } - - /** - * Creates a `MotionValue` that updates when the velocity of the provided `MotionValue` changes. - * - * ```javascript - * const x = useMotionValue(0) - * const xVelocity = useVelocity(x) - * const xAcceleration = useVelocity(xVelocity) - * ``` - * - * @public - */ - function useVelocity(value) { - const velocity = useMotionValue(value.getVelocity()); - const updateVelocity = () => { - const latest = value.getVelocity(); - velocity.set(latest); - /** - * If we still have velocity, schedule an update for the next frame - * to keep checking until it is zero. - */ - if (latest) - frame.update(updateVelocity); - }; - useMotionValueEvent(value, "change", () => { - // Schedule an update to this value at the end of the current frame. - frame.update(updateVelocity, false, true); - }); - return velocity; - } - - class WillChangeMotionValue extends MotionValue { - constructor() { - super(...arguments); - this.isEnabled = false; - } - add(name) { - if (transformProps.has(name) || acceleratedValues.has(name)) { - this.isEnabled = true; - this.update(); - } - } - update() { - this.set(this.isEnabled ? "transform" : "auto"); - } - } - - function useWillChange() { - return useConstant(() => new WillChangeMotionValue("auto")); - } - - /** - * A hook that returns `true` if we should be using reduced motion based on the current device's Reduced Motion setting. - * - * This can be used to implement changes to your UI based on Reduced Motion. For instance, replacing motion-sickness inducing - * `x`/`y` animations with `opacity`, disabling the autoplay of background videos, or turning off parallax motion. - * - * It will actively respond to changes and re-render your components with the latest setting. - * - * ```jsx - * export function Sidebar({ isOpen }) { - * const shouldReduceMotion = useReducedMotion() - * const closedX = shouldReduceMotion ? 0 : "-100%" - * - * return ( - * - * ) - * } - * ``` - * - * @return boolean - * - * @public - */ - function useReducedMotion() { - /** - * Lazy initialisation of prefersReducedMotion - */ - !hasReducedMotionListener.current && initPrefersReducedMotion(); - const [shouldReduceMotion] = React$1.useState(prefersReducedMotion.current); - { - warnOnce(shouldReduceMotion !== true, "You have Reduced Motion enabled on your device. Animations may not appear as expected.", "reduced-motion-disabled"); - } - /** - * TODO See if people miss automatically updating shouldReduceMotion setting - */ - return shouldReduceMotion; - } - - function useReducedMotionConfig() { - const reducedMotionPreference = useReducedMotion(); - const { reducedMotion } = React$1.useContext(MotionConfigContext); - if (reducedMotion === "never") { - return false; - } - else if (reducedMotion === "always") { - return true; - } - else { - return reducedMotionPreference; - } - } - - function stopAnimation(visualElement) { - visualElement.values.forEach((value) => value.stop()); - } - function setVariants(visualElement, variantLabels) { - const reversedLabels = [...variantLabels].reverse(); - reversedLabels.forEach((key) => { - const variant = visualElement.getVariant(key); - variant && setTarget(visualElement, variant); - if (visualElement.variantChildren) { - visualElement.variantChildren.forEach((child) => { - setVariants(child, variantLabels); - }); - } - }); - } - function setValues(visualElement, definition) { - if (Array.isArray(definition)) { - return setVariants(visualElement, definition); - } - else if (typeof definition === "string") { - return setVariants(visualElement, [definition]); - } - else { - setTarget(visualElement, definition); - } - } - /** - * @public - */ - function animationControls() { - /** - * Track whether the host component has mounted. - */ - let hasMounted = false; - /** - * A collection of linked component animation controls. - */ - const subscribers = new Set(); - const controls = { - subscribe(visualElement) { - subscribers.add(visualElement); - return () => void subscribers.delete(visualElement); - }, - start(definition, transitionOverride) { - exports.invariant(hasMounted, "controls.start() should only be called after a component has mounted. Consider calling within a useEffect hook."); - const animations = []; - subscribers.forEach((visualElement) => { - animations.push(animateVisualElement(visualElement, definition, { - transitionOverride, - })); - }); - return Promise.all(animations); - }, - set(definition) { - exports.invariant(hasMounted, "controls.set() should only be called after a component has mounted. Consider calling within a useEffect hook."); - return subscribers.forEach((visualElement) => { - setValues(visualElement, definition); - }); - }, - stop() { - subscribers.forEach((visualElement) => { - stopAnimation(visualElement); - }); - }, - mount() { - hasMounted = true; - return () => { - hasMounted = false; - controls.stop(); - }; - }, - }; - return controls; - } - - function useAnimate() { - const scope = useConstant(() => ({ - current: null, // Will be hydrated by React - animations: [], - })); - const reduceMotion = useReducedMotionConfig() ?? undefined; - const { skipAnimations } = React$1.useContext(MotionConfigContext); - const animate = React$1.useMemo(() => createScopedAnimate({ scope, reduceMotion, skipAnimations }), [scope, reduceMotion, skipAnimations]); - useUnmountEffect(() => { - scope.animations.forEach((animation) => animation.stop()); - scope.animations.length = 0; - }); - return [scope, animate]; - } - - function useAnimateMini() { - const scope = useConstant(() => ({ - current: null, // Will be hydrated by React - animations: [], - })); - const animate = useConstant(() => createScopedWaapiAnimate(scope)); - useUnmountEffect(() => { - scope.animations.forEach((animation) => animation.stop()); - }); - return [scope, animate]; - } - - /** - * Creates `LegacyAnimationControls`, which can be used to manually start, stop - * and sequence animations on one or more components. - * - * The returned `LegacyAnimationControls` should be passed to the `animate` property - * of the components you want to animate. - * - * These components can then be animated with the `start` method. - * - * ```jsx - * import * as React from 'react' - * import { motion, useAnimation } from 'framer-motion' - * - * export function MyComponent(props) { - * const controls = useAnimation() - * - * controls.start({ - * x: 100, - * transition: { duration: 0.5 }, - * }) - * - * return - * } - * ``` - * - * @returns Animation controller with `start` and `stop` methods - * - * @public - */ - function useAnimationControls() { - const controls = useConstant(animationControls); - useIsomorphicLayoutEffect(controls.mount, []); - return controls; - } - const useAnimation = useAnimationControls; - - function usePresenceData() { - const context = React$1.useContext(PresenceContext); - return context ? context.custom : undefined; - } - - /** - * Attaches an event listener directly to the provided DOM element. - * - * Bypassing React's event system can be desirable, for instance when attaching non-passive - * event handlers. - * - * ```jsx - * const ref = useRef(null) - * - * useDomEvent(ref, 'wheel', onWheel, { passive: false }) - * - * return
- * ``` - * - * @param ref - React.RefObject that's been provided to the element you want to bind the listener to. - * @param eventName - Name of the event you want listen for. - * @param handler - Function to fire when receiving the event. - * @param options - Options to pass to `Event.addEventListener`. - * - * @public - */ - function useDomEvent(ref, eventName, handler, options) { - React$1.useEffect(() => { - const element = ref.current; - if (handler && element) { - return addDomEvent(element, eventName, handler, options); - } - }, [ref, eventName, handler, options]); - } - - /** - * Can manually trigger a drag gesture on one or more `drag`-enabled `motion` components. - * - * ```jsx - * const dragControls = useDragControls() - * - * function startDrag(event) { - * dragControls.start(event, { snapToCursor: true }) - * } - * - * return ( - * <> - *
- * - * - * ) - * ``` - * - * @public - */ - class DragControls { - constructor() { - this.componentControls = new Set(); - } - /** - * Subscribe a component's internal `VisualElementDragControls` to the user-facing API. - * - * @internal - */ - subscribe(controls) { - this.componentControls.add(controls); - return () => this.componentControls.delete(controls); - } - /** - * Start a drag gesture on every `motion` component that has this set of drag controls - * passed into it via the `dragControls` prop. - * - * ```jsx - * dragControls.start(e, { - * snapToCursor: true - * }) - * ``` - * - * @param event - PointerEvent - * @param options - Options - * - * @public - */ - start(event, options) { - this.componentControls.forEach((controls) => { - controls.start(event.nativeEvent || event, options); - }); - } - /** - * Cancels a drag gesture. - * - * ```jsx - * dragControls.cancel() - * ``` - * - * @public - */ - cancel() { - this.componentControls.forEach((controls) => { - controls.cancel(); - }); - } - /** - * Stops a drag gesture. - * - * ```jsx - * dragControls.stop() - * ``` - * - * @public - */ - stop() { - this.componentControls.forEach((controls) => { - controls.stop(); - }); - } - } - const createDragControls = () => new DragControls(); - /** - * Usually, dragging is initiated by pressing down on a `motion` component with a `drag` prop - * and moving it. For some use-cases, for instance clicking at an arbitrary point on a video scrubber, we - * might want to initiate that dragging from a different component than the draggable one. - * - * By creating a `dragControls` using the `useDragControls` hook, we can pass this into - * the draggable component's `dragControls` prop. It exposes a `start` method - * that can start dragging from pointer events on other components. - * - * ```jsx - * const dragControls = useDragControls() - * - * function startDrag(event) { - * dragControls.start(event, { snapToCursor: true }) - * } - * - * return ( - * <> - *
- * - * - * ) - * ``` - * - * @public - */ - function useDragControls() { - return useConstant(createDragControls); - } - - /** - * Checks if a component is a `motion` component. - */ - function isMotionComponent(component) { - return (component !== null && - typeof component === "object" && - motionComponentSymbol in component); - } - - /** - * Unwraps a `motion` component and returns either a string for `motion.div` or - * the React component for `motion(Component)`. - * - * If the component is not a `motion` component it returns undefined. - */ - function unwrapMotionComponent(component) { - if (isMotionComponent(component)) { - return component[motionComponentSymbol]; - } - return undefined; - } - - function useInstantLayoutTransition() { - return startTransition; - } - function startTransition(callback) { - if (!rootProjectionNode.current) - return; - rootProjectionNode.current.isUpdating = false; - rootProjectionNode.current.blockUpdate(); - callback && callback(); - } - - function useResetProjection() { - const reset = React$1.useCallback(() => { - const root = rootProjectionNode.current; - if (!root) - return; - root.resetTree(); - }, []); - return reset; - } - - /** - * Cycles through a series of visual properties. Can be used to toggle between or cycle through animations. It works similar to `useState` in React. It is provided an initial array of possible states, and returns an array of two arguments. - * - * An index value can be passed to the returned `cycle` function to cycle to a specific index. - * - * ```jsx - * import * as React from "react" - * import { motion, useCycle } from "framer-motion" - * - * export const MyComponent = () => { - * const [x, cycleX] = useCycle(0, 50, 100) - * - * return ( - * cycleX()} - * /> - * ) - * } - * ``` - * - * @param items - items to cycle through - * @returns [currentState, cycleState] - * - * @public - */ - function useCycle(...items) { - const index = React$1.useRef(0); - const [item, setItem] = React$1.useState(items[index.current]); - const runCycle = React$1.useCallback((next) => { - index.current = - typeof next !== "number" - ? wrap(0, items.length, index.current + 1) - : next; - setItem(items[index.current]); - }, - // The array will change on each call, but by putting items.length at - // the front of this array, we guarantee the dependency comparison will match up - // eslint-disable-next-line react-hooks/exhaustive-deps - [items.length, ...items]); - return [item, runCycle]; - } - - function useInView(ref, { root, margin, amount, once = false, initial = false, } = {}) { - const [isInView, setInView] = React$1.useState(initial); - React$1.useEffect(() => { - if (!ref.current || (once && isInView)) - return; - const onEnter = () => { - setInView(true); - return once ? undefined : () => setInView(false); - }; - const options = { - root: (root && root.current) || undefined, - margin, - amount, - }; - return inView(ref.current, onEnter, options); - }, [root, ref, margin, once, amount]); - return isInView; - } - - function useInstantTransition() { - const [forceUpdate, forcedRenderCount] = useForceUpdate(); - const startInstantLayoutTransition = useInstantLayoutTransition(); - const unlockOnFrameRef = React$1.useRef(-1); - React$1.useEffect(() => { - /** - * Unblock after two animation frames, otherwise this will unblock too soon. - */ - frame.postRender(() => frame.postRender(() => { - /** - * If the callback has been called again after the effect - * triggered this 2 frame delay, don't unblock animations. This - * prevents the previous effect from unblocking the current - * instant transition too soon. This becomes more likely when - * used in conjunction with React.startTransition(). - */ - if (forcedRenderCount !== unlockOnFrameRef.current) - return; - MotionGlobalConfig.instantAnimations = false; - })); - }, [forcedRenderCount]); - return (callback) => { - startInstantLayoutTransition(() => { - MotionGlobalConfig.instantAnimations = true; - forceUpdate(); - callback(); - unlockOnFrameRef.current = forcedRenderCount + 1; - }); - }; - } - function disableInstantTransitions() { - MotionGlobalConfig.instantAnimations = false; - } - - function usePageInView() { - const [isInView, setIsInView] = React$1.useState(true); - React$1.useEffect(() => { - const handleVisibilityChange = () => setIsInView(!document.hidden); - if (document.hidden) { - handleVisibilityChange(); - } - document.addEventListener("visibilitychange", handleVisibilityChange); - return () => { - document.removeEventListener("visibilitychange", handleVisibilityChange); - }; - }, []); - return isInView; - } - - /** - * Creates a `transformPagePoint` function that accounts for SVG viewBox scaling. - * - * When dragging SVG elements inside an SVG with a viewBox that differs from - * the rendered dimensions (e.g., `viewBox="0 0 100 100"` but rendered at 500x500 pixels), - * pointer coordinates need to be transformed to match the SVG's coordinate system. - * - * @example - * ```jsx - * function App() { - * const svgRef = useRef(null) - * - * return ( - * - * - * - * - * - * ) - * } - * ``` - * - * @param svgRef - A React ref to the SVG element - * @returns A transformPagePoint function for use with MotionConfig - * - * @public - */ - function transformViewBoxPoint(svgRef) { - return (point) => { - const svg = svgRef.current; - if (!svg) { - return point; - } - // Get the viewBox attribute - const viewBox = svg.viewBox?.baseVal; - if (!viewBox || (viewBox.width === 0 && viewBox.height === 0)) { - // No viewBox or empty viewBox - no transformation needed - return point; - } - // Get the rendered dimensions of the SVG - const bbox = svg.getBoundingClientRect(); - if (bbox.width === 0 || bbox.height === 0) { - return point; - } - // Calculate scale factors - const scaleX = viewBox.width / bbox.width; - const scaleY = viewBox.height / bbox.height; - // Get the SVG's position on the page - const svgX = bbox.left + window.scrollX; - const svgY = bbox.top + window.scrollY; - // Transform the point: - // 1. Calculate position relative to SVG - // 2. Scale by viewBox/viewport ratio - // 3. Add back the SVG position (but in SVG coordinates) - return { - x: (point.x - svgX) * scaleX + svgX, - y: (point.y - svgY) * scaleY + svgY, - }; - }; - } - - /** - * Creates a `transformPagePoint` function that corrects pointer coordinates - * for a parent container with CSS transforms (rotation, scale, skew). - * - * When dragging elements inside a transformed parent, pointer coordinates - * need to be transformed through the inverse of the parent's transform - * so the drag offset is in local space. - * - * Works with both static and continuously animating transforms. - * - * @example - * ```jsx - * function App() { - * const ref = useRef(null) - * - * return ( - * - * - * - * - * - * ) - * } - * ``` - * - * @param parentRef - A React ref to the transformed parent element - * @returns A transformPagePoint function for use with MotionConfig - * - * @public - */ - function correctParentTransform(parentRef) { - return (point) => { - const parent = parentRef.current; - if (!parent) - return point; - const inv = getInverseMatrix(parent); - if (!inv) - return point; - // Get center of rotation in page space - const rect = parent.getBoundingClientRect(); - const cx = rect.left + window.scrollX + rect.width / 2; - const cy = rect.top + window.scrollY + rect.height / 2; - // Transform (point - center) through inverse, then add center back - const dx = point.x - cx; - const dy = point.y - cy; - return { - x: cx + inv.a * dx + inv.c * dy, - y: cy + inv.b * dx + inv.d * dy, - }; - }; - } - function getInverseMatrix(element) { - const { transform } = getComputedStyle(element); - if (!transform || transform === "none") - return null; - const match = transform.match(/^matrix3d\((.*)\)$/u) || - transform.match(/^matrix\((.*)\)$/u); - if (!match) - return null; - const v = match[1].split(",").map(Number); - const is3d = transform.startsWith("matrix3d"); - const a = v[0], b = v[1]; - const c = is3d ? v[4] : v[2]; - const d = is3d ? v[5] : v[3]; - const det = a * d - b * c; - if (Math.abs(det) < 1e-10) - return null; - return { a: d / det, b: -b / det, c: -c / det, d: a / det }; - } - - const appearAnimationStore = new Map(); - const appearComplete = new Map(); - - const appearStoreId = (elementId, valueName) => { - const key = transformProps.has(valueName) ? "transform" : valueName; - return `${elementId}: ${key}`; - }; - - function handoffOptimizedAppearAnimation(elementId, valueName, frame) { - const storeId = appearStoreId(elementId, valueName); - const optimisedAnimation = appearAnimationStore.get(storeId); - if (!optimisedAnimation) { - return null; - } - const { animation, startTime } = optimisedAnimation; - function cancelAnimation() { - window.MotionCancelOptimisedAnimation?.(elementId, valueName, frame); - } - /** - * We can cancel the animation once it's finished now that we've synced - * with Motion. - * - * Prefer onfinish over finished as onfinish is backwards compatible with - * older browsers. - */ - animation.onfinish = cancelAnimation; - if (startTime === null || window.MotionHandoffIsComplete?.(elementId)) { - /** - * If the startTime is null, this animation is the Paint Ready detection animation - * and we can cancel it immediately without handoff. - * - * Or if we've already handed off the animation then we're now interrupting it. - * In which case we need to cancel it. - */ - cancelAnimation(); - return null; - } - else { - return startTime; - } - } - - /** - * A single time to use across all animations to manually set startTime - * and ensure they're all in sync. - */ - let startFrameTime; - /** - * A dummy animation to detect when Chrome is ready to start - * painting the page and hold off from triggering the real animation - * until then. We only need one animation to detect paint ready. - * - * https://bugs.chromium.org/p/chromium/issues/detail?id=1406850 - */ - let readyAnimation; - /** - * Keep track of animations that were suspended vs cancelled so we - * can easily resume them when we're done measuring layout. - */ - const suspendedAnimations = new Set(); - function resumeSuspendedAnimations() { - suspendedAnimations.forEach((data) => { - data.animation.play(); - data.animation.startTime = data.startTime; - }); - suspendedAnimations.clear(); - } - function startOptimizedAppearAnimation(element, name, keyframes, options, onReady) { - // Prevent optimised appear animations if Motion has already started animating. - if (window.MotionIsMounted) { - return; - } - const id = element.dataset[optimizedAppearDataId]; - if (!id) - return; - window.MotionHandoffAnimation = handoffOptimizedAppearAnimation; - const storeId = appearStoreId(id, name); - if (!readyAnimation) { - readyAnimation = startWaapiAnimation(element, name, [keyframes[0], keyframes[0]], - /** - * 10 secs is basically just a super-safe duration to give Chrome - * long enough to get the animation ready. - */ - { duration: 10000, ease: "linear" }); - appearAnimationStore.set(storeId, { - animation: readyAnimation, - startTime: null, - }); - /** - * If there's no readyAnimation then there's been no instantiation - * of handoff animations. - */ - window.MotionHandoffAnimation = handoffOptimizedAppearAnimation; - window.MotionHasOptimisedAnimation = (elementId, valueName) => { - if (!elementId) - return false; - /** - * Keep a map of elementIds that have started animating. We check - * via ID instead of Element because of hydration errors and - * pre-hydration checks. We also actively record IDs as they start - * animating rather than simply checking for data-appear-id as - * this attrbute might be present but not lead to an animation, for - * instance if the element's appear animation is on a different - * breakpoint. - */ - if (!valueName) { - return appearComplete.has(elementId); - } - const animationId = appearStoreId(elementId, valueName); - return Boolean(appearAnimationStore.get(animationId)); - }; - window.MotionHandoffMarkAsComplete = (elementId) => { - if (appearComplete.has(elementId)) { - appearComplete.set(elementId, true); - } - }; - window.MotionHandoffIsComplete = (elementId) => { - return appearComplete.get(elementId) === true; - }; - /** - * We only need to cancel transform animations as - * they're the ones that will interfere with the - * layout animation measurements. - */ - window.MotionCancelOptimisedAnimation = (elementId, valueName, frame, canResume) => { - const animationId = appearStoreId(elementId, valueName); - const data = appearAnimationStore.get(animationId); - if (!data) - return; - if (frame && canResume === undefined) { - /** - * Wait until the end of the subsequent frame to cancel the animation - * to ensure we don't remove the animation before the main thread has - * had a chance to resolve keyframes and render. - */ - frame.postRender(() => { - frame.postRender(() => { - data.animation.cancel(); - }); - }); - } - else { - data.animation.cancel(); - } - if (frame && canResume) { - suspendedAnimations.add(data); - frame.render(resumeSuspendedAnimations); - } - else { - appearAnimationStore.delete(animationId); - /** - * If there are no more animations left, we can remove the cancel function. - * This will let us know when we can stop checking for conflicting layout animations. - */ - if (!appearAnimationStore.size) { - window.MotionCancelOptimisedAnimation = undefined; - } - } - }; - window.MotionCheckAppearSync = (visualElement, valueName, value) => { - const appearId = getOptimisedAppearId(visualElement); - if (!appearId) - return; - const valueIsOptimised = window.MotionHasOptimisedAnimation?.(appearId, valueName); - const externalAnimationValue = visualElement.props.values?.[valueName]; - if (!valueIsOptimised || !externalAnimationValue) - return; - const removeSyncCheck = value.on("change", (latestValue) => { - if (externalAnimationValue.get() !== latestValue) { - window.MotionCancelOptimisedAnimation?.(appearId, valueName); - removeSyncCheck(); - } - }); - return removeSyncCheck; - }; - } - const startAnimation = () => { - readyAnimation.cancel(); - const appearAnimation = startWaapiAnimation(element, name, keyframes, options); - /** - * Record the time of the first started animation. We call performance.now() once - * here and once in handoff to ensure we're getting - * close to a frame-locked time. This keeps all animations in sync. - */ - if (startFrameTime === undefined) { - startFrameTime = performance.now(); - } - appearAnimation.startTime = startFrameTime; - appearAnimationStore.set(storeId, { - animation: appearAnimation, - startTime: startFrameTime, - }); - if (onReady) - onReady(appearAnimation); - }; - appearComplete.set(id, false); - if (readyAnimation.ready) { - readyAnimation.ready.then(startAnimation).catch(noop); - } - else { - startAnimation(); - } - } - - const createObject = () => ({}); - class StateVisualElement extends VisualElement { - constructor() { - super(...arguments); - this.measureInstanceViewportBox = createBox; - } - build() { } - resetTransform() { } - restoreTransform() { } - removeValueFromRenderState() { } - renderInstance() { } - scrapeMotionValuesFromProps() { - return createObject(); - } - getBaseTargetFromProps() { - return undefined; - } - readValueFromInstance(_state, key, options) { - return options.initialState[key] || 0; - } - sortInstanceNodePosition() { - return 0; - } - } - const useVisualState = makeUseVisualState({ - scrapeMotionValuesFromProps: createObject, - createRenderState: createObject, - }); - /** - * This is not an officially supported API and may be removed - * on any version. - */ - function useAnimatedState(initialState) { - const [animationState, setAnimationState] = React$1.useState(initialState); - const visualState = useVisualState({}, false); - const element = useConstant(() => { - return new StateVisualElement({ - props: { - onUpdate: (v) => { - setAnimationState({ ...v }); - }, - }, - visualState, - presenceContext: null, - }, { initialState }); - }); - React$1.useLayoutEffect(() => { - element.mount({}); - return () => element.unmount(); - }, [element]); - const startAnimation = useConstant(() => (animationDefinition) => { - return animateVisualElement(element, animationDefinition); - }); - return [animationState, startAnimation]; - } - - let id = 0; - const AnimateSharedLayout = ({ children }) => { - React__namespace.useEffect(() => { - exports.invariant(false, "AnimateSharedLayout is deprecated: https://www.framer.com/docs/guide-upgrade/##shared-layout-animations"); - }, []); - return (jsx(LayoutGroup, { id: useConstant(() => `asl-${id++}`), children: children })); - }; - - // Keep things reasonable and avoid scale: Infinity. In practise we might need - // to add another value, opacity, that could interpolate scaleX/Y [0,0.01] => [0,1] - // to simply hide content at unreasonable scales. - const maxScale = 100000; - const invertScale = (scale) => scale > 0.001 ? 1 / scale : maxScale; - let hasWarned = false; - /** - * Returns a `MotionValue` each for `scaleX` and `scaleY` that update with the inverse - * of their respective parent scales. - * - * This is useful for undoing the distortion of content when scaling a parent component. - * - * By default, `useInvertedScale` will automatically fetch `scaleX` and `scaleY` from the nearest parent. - * By passing other `MotionValue`s in as `useInvertedScale({ scaleX, scaleY })`, it will invert the output - * of those instead. - * - * ```jsx - * const MyComponent = () => { - * const { scaleX, scaleY } = useInvertedScale() - * return - * } - * ``` - * - * @deprecated - */ - function useInvertedScale(scale) { - let parentScaleX = useMotionValue(1); - let parentScaleY = useMotionValue(1); - const { visualElement } = React$1.useContext(MotionContext); - exports.invariant(!!(scale || visualElement), "If no scale values are provided, useInvertedScale must be used within a child of another motion component."); - exports.warning(hasWarned, "useInvertedScale is deprecated and will be removed in 3.0. Use the layout prop instead."); - hasWarned = true; - if (scale) { - parentScaleX = scale.scaleX || parentScaleX; - parentScaleY = scale.scaleY || parentScaleY; - } - else if (visualElement) { - parentScaleX = visualElement.getValue("scaleX", 1); - parentScaleY = visualElement.getValue("scaleY", 1); - } - const scaleX = useTransform(parentScaleX, invertScale); - const scaleY = useTransform(parentScaleY, invertScale); - return { scaleX, scaleY }; - } - - exports.AnimatePresence = AnimatePresence; - exports.AnimateSharedLayout = AnimateSharedLayout; - exports.AsyncMotionValueAnimation = AsyncMotionValueAnimation; - exports.DOMKeyframesResolver = DOMKeyframesResolver; - exports.DOMVisualElement = DOMVisualElement; - exports.DeprecatedLayoutGroupContext = DeprecatedLayoutGroupContext; - exports.DocumentProjectionNode = DocumentProjectionNode; - exports.DragControls = DragControls; - exports.Feature = Feature; - exports.FlatTree = FlatTree; - exports.GroupAnimation = GroupAnimation; - exports.GroupAnimationWithThen = GroupAnimationWithThen; - exports.HTMLProjectionNode = HTMLProjectionNode; - exports.HTMLVisualElement = HTMLVisualElement; - exports.JSAnimation = JSAnimation; - exports.KeyframeResolver = KeyframeResolver; - exports.LayoutAnimationBuilder = LayoutAnimationBuilder; - exports.LayoutGroup = LayoutGroup; - exports.LayoutGroupContext = LayoutGroupContext; - exports.LazyMotion = LazyMotion; - exports.MotionConfig = MotionConfig; - exports.MotionConfigContext = MotionConfigContext; - exports.MotionContext = MotionContext; - exports.MotionGlobalConfig = MotionGlobalConfig; - exports.MotionValue = MotionValue; - exports.NativeAnimation = NativeAnimation; - exports.NativeAnimationExtended = NativeAnimationExtended; - exports.NativeAnimationWrapper = NativeAnimationWrapper; - exports.NodeStack = NodeStack; - exports.ObjectVisualElement = ObjectVisualElement; - exports.PopChild = PopChild; - exports.PresenceChild = PresenceChild; - exports.PresenceContext = PresenceContext; - exports.Reorder = namespace; - exports.SVGVisualElement = SVGVisualElement; - exports.SubscriptionManager = SubscriptionManager; - exports.SwitchLayoutGroupContext = SwitchLayoutGroupContext; - exports.ViewTransitionBuilder = ViewTransitionBuilder; - exports.VisualElement = VisualElement; - exports.WillChangeMotionValue = WillChangeMotionValue; - exports.acceleratedValues = acceleratedValues; - exports.addAttrValue = addAttrValue; - exports.addDomEvent = addDomEvent; - exports.addPointerEvent = addPointerEvent; - exports.addPointerInfo = addPointerInfo; - exports.addScaleCorrector = addScaleCorrector; - exports.addStyleValue = addStyleValue; - exports.addUniqueItem = addUniqueItem; - exports.addValueToWillChange = addValueToWillChange; - exports.alpha = alpha; - exports.analyseComplexValue = analyseComplexValue; - exports.animate = animate; - exports.animateMini = animateMini; - exports.animateMotionValue = animateMotionValue; - exports.animateSingleValue = animateSingleValue; - exports.animateTarget = animateTarget; - exports.animateValue = animateValue; - exports.animateVariant = animateVariant; - exports.animateView = animateView; - exports.animateVisualElement = animateVisualElement; - exports.animationControls = animationControls; - exports.animationMapKey = animationMapKey; - exports.animations = animations; - exports.anticipate = anticipate; - exports.applyAxisDelta = applyAxisDelta; - exports.applyBoxDelta = applyBoxDelta; - exports.applyGeneratorOptions = applyGeneratorOptions; - exports.applyPointDelta = applyPointDelta; - exports.applyPxDefaults = applyPxDefaults; - exports.applyTreeDeltas = applyTreeDeltas; - exports.arc = arc; - exports.aspectRatio = aspectRatio; - exports.attachFollow = attachFollow; - exports.attachSpring = attachSpring; - exports.attrEffect = attrEffect; - exports.axisDeltaEquals = axisDeltaEquals; - exports.axisEquals = axisEquals; - exports.axisEqualsRounded = axisEqualsRounded; - exports.backIn = backIn; - exports.backInOut = backInOut; - exports.backOut = backOut; - exports.boxEquals = boxEquals; - exports.boxEqualsRounded = boxEqualsRounded; - exports.buildHTMLStyles = buildHTMLStyles; - exports.buildProjectionTransform = buildProjectionTransform; - exports.buildSVGAttrs = buildSVGAttrs; - exports.buildSVGPath = buildSVGPath; - exports.buildTransform = buildTransform; - exports.calcAxisDelta = calcAxisDelta; - exports.calcBoxDelta = calcBoxDelta; - exports.calcChildStagger = calcChildStagger; - exports.calcGeneratorDuration = calcGeneratorDuration; - exports.calcLength = calcLength; - exports.calcRelativeAxis = calcRelativeAxis; - exports.calcRelativeAxisPosition = calcRelativeAxisPosition; - exports.calcRelativeBox = calcRelativeBox; - exports.calcRelativePosition = calcRelativePosition; - exports.camelCaseAttributes = camelCaseAttributes; - exports.camelToDash = camelToDash; - exports.cancelFrame = cancelFrame; - exports.cancelMicrotask = cancelMicrotask; - exports.cancelSync = cancelSync; - exports.checkVariantsDidChange = checkVariantsDidChange; - exports.circIn = circIn; - exports.circInOut = circInOut; - exports.circOut = circOut; - exports.clamp = clamp; - exports.cleanDirtyNodes = cleanDirtyNodes; - exports.collectMotionValues = collectMotionValues; - exports.color = color; - exports.compareByDepth = compareByDepth; - exports.complex = complex; - exports.containsCSSVariable = containsCSSVariable; - exports.convertBoundingBoxToBox = convertBoundingBoxToBox; - exports.convertBoxToBoundingBox = convertBoxToBoundingBox; - exports.convertOffsetToTimes = convertOffsetToTimes; - exports.copyAxisDeltaInto = copyAxisDeltaInto; - exports.copyAxisInto = copyAxisInto; - exports.copyBoxInto = copyBoxInto; - exports.correctBorderRadius = correctBorderRadius; - exports.correctBoxShadow = correctBoxShadow; - exports.correctParentTransform = correctParentTransform; - exports.createAnimationState = createAnimationState; - exports.createAxis = createAxis; - exports.createAxisDelta = createAxisDelta; - exports.createBox = createBox; - exports.createDelta = createDelta; - exports.createGeneratorEasing = createGeneratorEasing; - exports.createProjectionNode = createProjectionNode$1; - exports.createRenderBatcher = createRenderBatcher; - exports.createScopedAnimate = createScopedAnimate; - exports.cubicBezier = cubicBezier; - exports.cubicBezierAsString = cubicBezierAsString; - exports.defaultEasing = defaultEasing; - exports.defaultOffset = defaultOffset$1; - exports.defaultTransformValue = defaultTransformValue; - exports.defaultValueTypes = defaultValueTypes; - exports.degrees = degrees; - exports.delay = delay; - exports.delayInSeconds = delayInSeconds; - exports.dimensionValueTypes = dimensionValueTypes; - exports.disableInstantTransitions = disableInstantTransitions; - exports.distance = distance; - exports.distance2D = distance2D; - exports.domAnimation = domAnimation; - exports.domMax = domMax; - exports.domMin = domMin; - exports.eachAxis = eachAxis; - exports.easeIn = easeIn; - exports.easeInOut = easeInOut; - exports.easeOut = easeOut; - exports.easingDefinitionToFunction = easingDefinitionToFunction; - exports.fillOffset = fillOffset; - exports.fillWildcards = fillWildcards; - exports.filterProps = filterProps; - exports.findDimensionValueType = findDimensionValueType; - exports.findValueType = findValueType; - exports.flushKeyframeResolvers = flushKeyframeResolvers; - exports.followValue = followValue; - exports.frame = frame; - exports.frameData = frameData; - exports.frameSteps = frameSteps; - exports.generateLinearEasing = generateLinearEasing; - exports.getAnimatableNone = getAnimatableNone; - exports.getAnimationMap = getAnimationMap; - exports.getComputedStyle = getComputedStyle$2; - exports.getDefaultTransition = getDefaultTransition; - exports.getDefaultValueType = getDefaultValueType; - exports.getEasingForSegment = getEasingForSegment; - exports.getFeatureDefinitions = getFeatureDefinitions; - exports.getFinalKeyframe = getFinalKeyframe; - exports.getMixer = getMixer; - exports.getOptimisedAppearId = getOptimisedAppearId; - exports.getOriginIndex = getOriginIndex; - exports.getValueAsType = getValueAsType; - exports.getValueTransition = getValueTransition$1; - exports.getVariableValue = getVariableValue; - exports.getVariantContext = getVariantContext; - exports.getViewAnimationLayerInfo = getViewAnimationLayerInfo; - exports.getViewAnimations = getViewAnimations; - exports.globalProjectionState = globalProjectionState; - exports.has2DTranslate = has2DTranslate; - exports.hasReducedMotionListener = hasReducedMotionListener; - exports.hasScale = hasScale; - exports.hasTransform = hasTransform; - exports.hasWarned = hasWarned$1; - exports.hex = hex; - exports.hover = hover; - exports.hsla = hsla; - exports.hslaToRgba = hslaToRgba; - exports.inView = inView; - exports.inertia = inertia; - exports.initPrefersReducedMotion = initPrefersReducedMotion; - exports.interpolate = interpolate; - exports.invisibleValues = invisibleValues; - exports.isAnimationControls = isAnimationControls; - exports.isBezierDefinition = isBezierDefinition; - exports.isBrowser = isBrowser$1; - exports.isCSSVariableName = isCSSVariableName; - exports.isCSSVariableToken = isCSSVariableToken; - exports.isControllingVariants = isControllingVariants; - exports.isDeltaZero = isDeltaZero; - exports.isDragActive = isDragActive; - exports.isDragging = isDragging; - exports.isEasingArray = isEasingArray; - exports.isElementKeyboardAccessible = isElementKeyboardAccessible; - exports.isElementTextInput = isElementTextInput; - exports.isForcedMotionValue = isForcedMotionValue; - exports.isGenerator = isGenerator; - exports.isHTMLElement = isHTMLElement; - exports.isKeyframesTarget = isKeyframesTarget; - exports.isMotionComponent = isMotionComponent; - exports.isMotionValue = isMotionValue; - exports.isNear = isNear; - exports.isNodeOrChild = isNodeOrChild; - exports.isNumericalString = isNumericalString; - exports.isObject = isObject; - exports.isPrimaryPointer = isPrimaryPointer; - exports.isSVGElement = isSVGElement; - exports.isSVGSVGElement = isSVGSVGElement; - exports.isSVGTag = isSVGTag; - exports.isTransitionDefined = isTransitionDefined; - exports.isValidMotionProp = isValidMotionProp; - exports.isVariantLabel = isVariantLabel; - exports.isVariantNode = isVariantNode; - exports.isWaapiSupportedEasing = isWaapiSupportedEasing; - exports.isWillChangeMotionValue = isWillChangeMotionValue; - exports.isZeroValueString = isZeroValueString; - exports.keyframes = keyframes; - exports.m = m; - exports.makeAnimationInstant = makeAnimationInstant; - exports.makeUseVisualState = makeUseVisualState; - exports.mapEasingToNativeEasing = mapEasingToNativeEasing; - exports.mapValue = mapValue; - exports.maxGeneratorDuration = maxGeneratorDuration; - exports.measurePageBox = measurePageBox; - exports.measureViewportBox = measureViewportBox; - exports.memo = memo; - exports.microtask = microtask; - exports.millisecondsToSeconds = millisecondsToSeconds; - exports.mirrorEasing = mirrorEasing; - exports.mix = mix; - exports.mixArray = mixArray; - exports.mixColor = mixColor; - exports.mixComplex = mixComplex; - exports.mixImmediate = mixImmediate; - exports.mixLinearColor = mixLinearColor; - exports.mixNumber = mixNumber$1; - exports.mixObject = mixObject; - exports.mixValues = mixValues; - exports.mixVisibility = mixVisibility; - exports.motion = motion; - exports.motionValue = motionValue; - exports.moveItem = moveItem; - exports.nodeGroup = nodeGroup; - exports.noop = noop; - exports.number = number; - exports.numberValueTypes = numberValueTypes; - exports.observeTimeline = observeTimeline; - exports.optimizedAppearDataAttribute = optimizedAppearDataAttribute; - exports.optimizedAppearDataId = optimizedAppearDataId; - exports.parseAnimateLayoutArgs = parseAnimateLayoutArgs; - exports.parseCSSVariable = parseCSSVariable; - exports.parseValueFromTransform = parseValueFromTransform; - exports.percent = percent; - exports.pipe = pipe; - exports.pixelsToPercent = pixelsToPercent; - exports.positionalKeys = positionalKeys; - exports.prefersReducedMotion = prefersReducedMotion; - exports.press = press; - exports.progress = progress; - exports.progressPercentage = progressPercentage; - exports.propEffect = propEffect; - exports.propagateDirtyNodes = propagateDirtyNodes; - exports.px = px; - exports.readTransformValue = readTransformValue; - exports.recordStats = recordStats; - exports.removeAxisDelta = removeAxisDelta; - exports.removeAxisTransforms = removeAxisTransforms; - exports.removeBoxTransforms = removeBoxTransforms; - exports.removeItem = removeItem; - exports.removePointDelta = removePointDelta; - exports.renderHTML = renderHTML; - exports.renderSVG = renderSVG; - exports.resize = resize; - exports.resolveElements = resolveElements; - exports.resolveMotionValue = resolveMotionValue; - exports.resolveTransition = resolveTransition; - exports.resolveVariant = resolveVariant; - exports.resolveVariantFromProps = resolveVariantFromProps; - exports.reverseEasing = reverseEasing; - exports.rgbUnit = rgbUnit; - exports.rgba = rgba; - exports.rootProjectionNode = rootProjectionNode; - exports.scale = scale; - exports.scaleCorrectors = scaleCorrectors; - exports.scalePoint = scalePoint; - exports.scrapeHTMLMotionValuesFromProps = scrapeMotionValuesFromProps$1; - exports.scrapeSVGMotionValuesFromProps = scrapeMotionValuesFromProps; - exports.scroll = scroll; - exports.scrollInfo = scrollInfo; - exports.secondsToMilliseconds = secondsToMilliseconds; - exports.setDragLock = setDragLock; - exports.setFeatureDefinitions = setFeatureDefinitions; - exports.setStyle = setStyle; - exports.setTarget = setTarget; - exports.spring = spring; - exports.springValue = springValue; - exports.stagger = stagger; - exports.startOptimizedAppearAnimation = startOptimizedAppearAnimation; - exports.startWaapiAnimation = startWaapiAnimation; - exports.statsBuffer = statsBuffer; - exports.steps = steps; - exports.styleEffect = styleEffect; - exports.supportedWaapiEasing = supportedWaapiEasing; - exports.supportsBrowserAnimation = supportsBrowserAnimation; - exports.supportsFlags = supportsFlags; - exports.supportsLinearEasing = supportsLinearEasing; - exports.supportsPartialKeyframes = supportsPartialKeyframes; - exports.supportsScrollTimeline = supportsScrollTimeline; - exports.supportsViewTimeline = supportsViewTimeline; - exports.svgEffect = svgEffect; - exports.sync = sync; - exports.testValueType = testValueType; - exports.time = time; - exports.transform = transform; - exports.transformAxis = transformAxis; - exports.transformBox = transformBox; - exports.transformBoxPoints = transformBoxPoints; - exports.transformPropOrder = transformPropOrder; - exports.transformProps = transformProps; - exports.transformValue = transformValue; - exports.transformValueTypes = transformValueTypes; - exports.transformViewBoxPoint = transformViewBoxPoint; - exports.translateAxis = translateAxis; - exports.unwrapMotionComponent = unwrapMotionComponent; - exports.updateMotionValuesFromProps = updateMotionValuesFromProps; - exports.useAnimate = useAnimate; - exports.useAnimateMini = useAnimateMini; - exports.useAnimation = useAnimation; - exports.useAnimationControls = useAnimationControls; - exports.useAnimationFrame = useAnimationFrame; - exports.useComposedRefs = useComposedRefs; - exports.useCycle = useCycle; - exports.useDeprecatedAnimatedState = useAnimatedState; - exports.useDeprecatedInvertedScale = useInvertedScale; - exports.useDomEvent = useDomEvent; - exports.useDragControls = useDragControls; - exports.useElementScroll = useElementScroll; - exports.useFollowValue = useFollowValue; - exports.useForceUpdate = useForceUpdate; - exports.useInView = useInView; - exports.useInstantLayoutTransition = useInstantLayoutTransition; - exports.useInstantTransition = useInstantTransition; - exports.useIsPresent = useIsPresent; - exports.useIsomorphicLayoutEffect = useIsomorphicLayoutEffect; - exports.useMotionTemplate = useMotionTemplate; - exports.useMotionValue = useMotionValue; - exports.useMotionValueEvent = useMotionValueEvent; - exports.usePageInView = usePageInView; - exports.usePresence = usePresence; - exports.usePresenceData = usePresenceData; - exports.useReducedMotion = useReducedMotion; - exports.useReducedMotionConfig = useReducedMotionConfig; - exports.useResetProjection = useResetProjection; - exports.useScroll = useScroll; - exports.useSpring = useSpring; - exports.useTime = useTime; - exports.useTransform = useTransform; - exports.useUnmountEffect = useUnmountEffect; - exports.useVelocity = useVelocity; - exports.useViewportScroll = useViewportScroll; - exports.useWillChange = useWillChange; - exports.variantPriorityOrder = variantPriorityOrder; - exports.variantProps = variantProps; - exports.velocityPerSecond = velocityPerSecond; - exports.vh = vh; - exports.visualElementStore = visualElementStore; - exports.vw = vw; - exports.warnOnce = warnOnce; - exports.wrap = wrap; - -})); diff --git a/node_modules/framer-motion/dist/framer-motion.js b/node_modules/framer-motion/dist/framer-motion.js deleted file mode 100644 index 64b1eae..0000000 --- a/node_modules/framer-motion/dist/framer-motion.js +++ /dev/null @@ -1 +0,0 @@ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Motion={},t.React)}(this,function(t,e){"use strict";function n(t){var e=Object.create(null);return t&&Object.keys(t).forEach(function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}}),e.default=t,Object.freeze(e)}var i=n(e),o=React,s=Symbol.for("react.element"),r=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,l=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function u(t,e,n){var i,o={},r=null,u=null;for(i in void 0!==n&&(r=""+n),void 0!==e.key&&(r=""+e.key),void 0!==e.ref&&(u=e.ref),e)a.call(e,i)&&!c.hasOwnProperty(i)&&(o[i]=e[i]);if(t&&t.defaultProps)for(i in e=t.defaultProps)void 0===o[i]&&(o[i]=e[i]);return{$$typeof:s,type:t,key:r,ref:u,props:o,_owner:l.current}}const h=r,d=u,p=u,m=e.createContext({});function f(t){const n=e.useRef(null);return null===n.current&&(n.current=t()),n.current}const g="undefined"!=typeof window,y=g?e.useLayoutEffect:e.useEffect,v=e.createContext(null);function x(t,e){-1===t.indexOf(e)&&t.push(e)}function w(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}function S([...t],e,n){const i=e<0?t.length+e:e;if(i>=0&&in>e?e:n{},t.invariant=()=>{},"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(t.warning=(t,e,n)=>{t||"undefined"==typeof console||console.warn(T(e,n))},t.invariant=(t,e,n)=>{if(!t)throw new Error(T(e,n))});const P={},E=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),A=t=>"object"==typeof t&&null!==t,M=t=>/^0[^.\s]+$/u.test(t);function C(t){let e;return()=>(void 0===e&&(e=t()),e)}const V=t=>t,k=(...t)=>t.reduce((t,e)=>n=>e(t(n))),D=(t,e,n)=>{const i=e-t;return i?(n-t)/i:1};class R{constructor(){this.subscriptions=[]}add(t){return x(this.subscriptions,t),()=>w(this.subscriptions,t)}notify(t,e,n){const i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](t,e,n);else for(let o=0;o1e3*t,B=t=>t/1e3,O=(t,e)=>e?t*(1e3/e):0,j=new Set;function I(t,e,n){t||j.has(e)||(console.warn(T(e,n)),j.add(e))}const F=(t,e,n)=>{const i=e-t;return((n-t)%i+i)%i+t},W=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function $(t,e,n,i){if(t===e&&n===i)return V;const o=e=>function(t,e,n,i,o){let s,r,a=0;do{r=e+(n-e)/2,s=W(r,i,o)-t,s>0?n=r:e=r}while(Math.abs(s)>1e-7&&++a<12);return r}(e,0,1,t,n);return t=>0===t||1===t?t:W(o(t),e,i)}const N=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,U=t=>e=>1-t(1-e),z=$(.33,1.53,.69,.99),Y=U(z),H=N(Y),X=t=>t>=1?1:(t*=2)<1?.5*Y(t):.5*(2-Math.pow(2,-10*(t-1))),G=t=>1-Math.sin(Math.acos(t)),K=U(G),_=N(G),q=$(.42,0,1,1),Z=$(0,0,.58,1),J=$(.42,0,.58,1);const Q=t=>Array.isArray(t)&&"number"!=typeof t[0];function tt(t,e){return Q(t)?t[F(0,t.length,e)]:t}const et=t=>Array.isArray(t)&&"number"==typeof t[0],nt={linear:V,easeIn:q,easeInOut:J,easeOut:Z,circIn:G,circInOut:_,circOut:K,backIn:Y,backInOut:H,backOut:z,anticipate:X},it=e=>{if(et(e)){t.invariant(4===e.length,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[n,i,o,s]=e;return $(n,i,o,s)}return"string"==typeof e?(t.invariant(void 0!==nt[e],`Invalid easing type '${e}'`,"invalid-easing-type"),nt[e]):e},ot=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function st(t,e){let n=!1,i=!0;const o={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,r=ot.reduce((t,e)=>(t[e]=function(t){let e=new Set,n=new Set,i=!1,o=!1;const s=new WeakSet;let r={delta:0,timestamp:0,isProcessing:!1};function a(e){s.has(e)&&(l.schedule(e),t()),e(r)}const l={schedule:(t,o=!1,r=!1)=>{const a=r&&i?e:n;return o&&s.add(t),a.add(t),t},cancel:t=>{n.delete(t),s.delete(t)},process:t=>{if(r=t,i)return void(o=!0);i=!0;const s=e;e=n,n=s,e.forEach(a),e.clear(),i=!1,o&&(o=!1,l.process(t))}};return l}(s),t),{}),{setup:a,read:l,resolveKeyframes:c,preUpdate:u,update:h,preRender:d,render:p,postRender:m}=r,f=()=>{const s=P.useManualTiming,r=s?o.timestamp:performance.now();n=!1,s||(o.delta=i?1e3/60:Math.max(Math.min(r-o.timestamp,40),1)),o.timestamp=r,o.isProcessing=!0,a.process(o),l.process(o),c.process(o),u.process(o),h.process(o),d.process(o),p.process(o),m.process(o),o.isProcessing=!1,n&&e&&(i=!1,t(f))};return{schedule:ot.reduce((e,s)=>{const a=r[s];return e[s]=(e,s=!1,r=!1)=>(n||(n=!0,i=!0,o.isProcessing||t(f)),a.schedule(e,s,r)),e},{}),cancel:t=>{for(let e=0;e(void 0===ut&&dt.set(lt.isProcessing||P.useManualTiming?lt.timestamp:performance.now()),ut),set:t=>{ut=t,queueMicrotask(ht)}},pt=t=>e=>"string"==typeof e&&e.startsWith(t),mt=pt("--"),ft=pt("var(--"),gt=t=>!!ft(t)&&yt.test(t.split("/*")[0].trim()),yt=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function vt(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const xt={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},wt={...xt,transform:t=>b(0,1,t)},St={...xt,default:1},bt=t=>Math.round(1e5*t)/1e5,Tt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const Pt=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Et=(t,e)=>n=>Boolean("string"==typeof n&&Pt.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),At=(t,e,n)=>i=>{if("string"!=typeof i)return i;const[o,s,r,a]=i.match(Tt);return{[t]:parseFloat(o),[e]:parseFloat(s),[n]:parseFloat(r),alpha:void 0!==a?parseFloat(a):1}},Mt={...xt,transform:t=>Math.round((t=>b(0,255,t))(t))},Ct={test:Et("rgb","red"),parse:At("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+Mt.transform(t)+", "+Mt.transform(e)+", "+Mt.transform(n)+", "+bt(wt.transform(i))+")"};const Vt={test:Et("#"),parse:function(t){let e="",n="",i="",o="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),i=t.substring(5,7),o=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),i=t.substring(3,4),o=t.substring(4,5),e+=e,n+=n,i+=i,o+=o),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:o?parseInt(o,16)/255:1}},transform:Ct.transform},kt=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),Dt=kt("deg"),Rt=kt("%"),Lt=kt("px"),Bt=kt("vh"),Ot=kt("vw"),jt=(()=>({...Rt,parse:t=>Rt.parse(t)/100,transform:t=>Rt.transform(100*t)}))(),It={test:Et("hsl","hue"),parse:At("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+Rt.transform(bt(e))+", "+Rt.transform(bt(n))+", "+bt(wt.transform(i))+")"},Ft={test:t=>Ct.test(t)||Vt.test(t)||It.test(t),parse:t=>Ct.test(t)?Ct.parse(t):It.test(t)?It.parse(t):Vt.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?Ct.transform(t):It.transform(t),getAnimatableNone:t=>{const e=Ft.parse(t);return e.alpha=0,Ft.transform(e)}},Wt=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const $t="number",Nt="color",Ut=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function zt(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},o=[];let s=0;const r=e.replace(Ut,t=>(Ft.test(t)?(i.color.push(s),o.push(Nt),n.push(Ft.parse(t))):t.startsWith("var(")?(i.var.push(s),o.push("var"),n.push(t)):(i.number.push(s),o.push($t),n.push(parseFloat(t))),++s,"${}")).split("${}");return{values:n,split:r,indexes:i,types:o}}function Yt({split:t,types:e}){const n=t.length;return i=>{let o="";for(let s=0;s{return"number"==typeof t?e?.trim().endsWith("/")?t:0:"number"==typeof(n=t)?0:Ft.test(n)?Ft.getAnimatableNone(n):n;var n};const Xt={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(Tt)?.length||0)+(t.match(Wt)?.length||0)>0},parse:function(t){return zt(t).values},createTransformer:function(t){return Yt(zt(t))},getAnimatableNone:function(t){const e=zt(t);return Yt(e)(e.values.map((t,n)=>Ht(t,e.split[n])))}};function Gt(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function Kt({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let o=0,s=0,r=0;if(e/=100){const i=n<.5?n*(1+e):n+e-n*e,a=2*n-i;o=Gt(a,i,t+1/3),s=Gt(a,i,t),r=Gt(a,i,t-1/3)}else o=s=r=n;return{red:Math.round(255*o),green:Math.round(255*s),blue:Math.round(255*r),alpha:i}}function _t(t,e){return n=>n>0?e:t}const qt=(t,e,n)=>t+(e-t)*n,Zt=(t,e,n)=>{const i=t*t,o=n*(e*e-i)+i;return o<0?0:Math.sqrt(o)},Jt=[Vt,Ct,It];function Qt(e){const n=(i=e,Jt.find(t=>t.test(i)));var i;if(t.warning(Boolean(n),`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!Boolean(n))return!1;let o=n.parse(e);return n===It&&(o=Kt(o)),o}const te=(t,e)=>{const n=Qt(t),i=Qt(e);if(!n||!i)return _t(t,e);const o={...n};return t=>(o.red=Zt(n.red,i.red,t),o.green=Zt(n.green,i.green,t),o.blue=Zt(n.blue,i.blue,t),o.alpha=qt(n.alpha,i.alpha,t),Ct.transform(o))},ee=new Set(["none","hidden"]);function ne(t,e){return ee.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function ie(t,e){return n=>qt(t,e,n)}function oe(t){return"number"==typeof t?ie:"string"==typeof t?gt(t)?_t:Ft.test(t)?te:ae:Array.isArray(t)?se:"object"==typeof t?Ft.test(t)?te:re:_t}function se(t,e){const n=[...t],i=n.length,o=t.map((t,n)=>oe(t)(t,e[n]));return t=>{for(let e=0;e{for(const e in i)n[e]=i[e](t);return n}}const ae=(e,n)=>{const i=Xt.createTransformer(n),o=zt(e),s=zt(n);return o.indexes.var.length===s.indexes.var.length&&o.indexes.color.length===s.indexes.color.length&&o.indexes.number.length>=s.indexes.number.length?ee.has(e)&&!s.values.length||ee.has(n)&&!o.values.length?ne(e,n):k(se(function(t,e){const n=[],i={color:0,var:0,number:0};for(let o=0;o{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>rt.update(e,t),stop:()=>at(e),now:()=>lt.isProcessing?lt.timestamp:dt.now()}},ue=(t,e,n=10)=>{let i="";const o=Math.max(Math.round(e/n),2);for(let e=0;e=he?1/0:e}function pe(t,e=100,n){const i=n({...t,keyframes:[0,e]}),o=Math.min(de(i),he);return{type:"keyframes",ease:t=>i.next(o*t).value/e,duration:B(o)}}const me=100,fe=10,ge=1,ye=0,ve=800,xe=.3,we=.3,Se={granular:.01,default:2},be={granular:.005,default:.5},Te=.01,Pe=10,Ee=.05,Ae=1;function Me(t,e){return t*Math.sqrt(1-e*e)}const Ce=.001;const Ve=["duration","bounce"],ke=["stiffness","damping","mass"];function De(t,e){return e.some(e=>void 0!==t[e])}function Re(e){let n={velocity:ye,stiffness:me,damping:fe,mass:ge,isResolvedFromDuration:!1,...e};if(!De(e,ke)&&De(e,Ve))if(n.velocity=0,e.visualDuration){const t=e.visualDuration,i=2*Math.PI/(1.2*t),o=i*i,s=2*b(.05,1,1-(e.bounce||0))*Math.sqrt(o);n={...n,mass:ge,stiffness:o,damping:s}}else{const i=function({duration:e=ve,bounce:n=xe,velocity:i=ye,mass:o=ge}){let s,r;t.warning(e<=L(Pe),"Spring duration must be 10 seconds or less","spring-duration-limit");let a=1-n;a=b(Ee,Ae,a),e=b(Te,Pe,B(e)),a<1?(s=t=>{const n=t*a,o=n*e,s=n-i,r=Me(t,a),l=Math.exp(-o);return Ce-s/r*l},r=t=>{const n=t*a*e,o=n*i+i,r=Math.pow(a,2)*Math.pow(t,2)*e,l=Math.exp(-n),c=Me(Math.pow(t,2),a);return(-s(t)+Ce>0?-1:1)*((o-r)*l)/c}):(s=t=>Math.exp(-t*e)*((t-i)*e+1)-.001,r=t=>Math.exp(-t*e)*(e*e*(i-t)));const l=function(t,e,n){let i=n;for(let n=1;n<12;n++)i-=t(i)/e(i);return i}(s,r,5/e);if(e=L(e),isNaN(l))return{stiffness:me,damping:fe,duration:e};{const t=Math.pow(l,2)*o;return{stiffness:t,damping:2*a*Math.sqrt(o*t),duration:e}}}({...e,velocity:0});n={...n,...i,mass:ge},n.isResolvedFromDuration=!0}return n}function Le(t=we,e=xe){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:i,restDelta:o}=n;const s=n.keyframes[0],r=n.keyframes[n.keyframes.length-1],a={done:!1,value:s},{stiffness:l,damping:c,mass:u,duration:h,velocity:d,isResolvedFromDuration:p}=Re({...n,velocity:-B(n.velocity||0)}),m=d||0,f=c/(2*Math.sqrt(l*u)),g=r-s,y=B(Math.sqrt(l/u)),v=Math.abs(g)<5;let x,w,S,b,T,P;if(i||(i=v?Se.granular:Se.default),o||(o=v?be.granular:be.default),f<1)S=Me(y,f),b=(m+f*y*g)/S,x=t=>{const e=Math.exp(-f*y*t);return r-e*(b*Math.sin(S*t)+g*Math.cos(S*t))},T=f*y*b+g*S,P=f*y*g-b*S,w=t=>Math.exp(-f*y*t)*(T*Math.sin(S*t)+P*Math.cos(S*t));else if(1===f){x=t=>r-Math.exp(-y*t)*(g+(m+y*g)*t);const t=m+y*g;w=e=>Math.exp(-y*e)*(y*t*e-m)}else{const t=y*Math.sqrt(f*f-1);x=e=>{const n=Math.exp(-f*y*e),i=Math.min(t*e,300);return r-n*((m+f*y*g)*Math.sinh(i)+t*g*Math.cosh(i))/t};const e=(m+f*y*g)/t,n=f*y*e-g*t,i=f*y*g-e*t;w=e=>{const o=Math.exp(-f*y*e),s=Math.min(t*e,300);return o*(n*Math.sinh(s)+i*Math.cosh(s))}}const E={calculatedDuration:p&&h||null,velocity:t=>L(w(t)),next:t=>{if(!p&&f<1){const e=Math.exp(-f*y*t),n=Math.sin(S*t),s=Math.cos(S*t),l=r-e*(b*n+g*s),c=L(e*(T*n+P*s));return a.done=Math.abs(c)<=i&&Math.abs(r-l)<=o,a.value=a.done?r:l,a}const e=x(t);if(p)a.done=t>=h;else{const n=L(w(t));a.done=Math.abs(n)<=i&&Math.abs(r-e)<=o}return a.value=a.done?r:e,a},toString:()=>{const t=Math.min(de(E),he),e=ue(e=>E.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return E}Le.applyToOptions=t=>{const e=pe(t,100,Le);return t.ease=e.ease,t.duration=L(e.duration),t.type="keyframes",t};function Be(t,e,n){const i=Math.max(e-5,0);return O(n-t(i),e-i)}function Oe({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:o=10,bounceStiffness:s=500,modifyTarget:r,min:a,max:l,restDelta:c=.5,restSpeed:u}){const h=t[0],d={done:!1,value:h},p=t=>void 0===a?l:void 0===l||Math.abs(a-t)-m*Math.exp(-t/i),v=t=>g+y(t),x=t=>{const e=y(t),n=v(t);d.done=Math.abs(e)<=c,d.value=d.done?g:n};let w,S;const b=t=>{var e;(e=d.value,void 0!==a&&el)&&(w=t,S=Le({keyframes:[d.value,p(d.value)],velocity:Be(v,t,d.value),damping:o,stiffness:s,restDelta:c,restSpeed:u}))};return b(0),{calculatedDuration:null,next:t=>{let e=!1;return S||void 0!==w||(e=!0,x(t),b(t)),void 0!==w&&t>=w?S.next(t-w):(!e&&x(t),d)}}}function je(e,n,{clamp:i=!0,ease:o,mixer:s}={}){const r=e.length;if(t.invariant(r===n.length,"Both input and output ranges must be the same length","range-length"),1===r)return()=>n[0];if(2===r&&n[0]===n[1])return()=>n[1];const a=e[0]===e[1];e[0]>e[r-1]&&(e=[...e].reverse(),n=[...n].reverse());const l=function(t,e,n){const i=[],o=n||P.mix||le,s=t.length-1;for(let n=0;n{if(a&&t1)for(;iu(b(e[0],e[r-1],t)):u}function Ie(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const o=D(0,e,i);t.push(qt(n,1,o))}}function Fe(t){const e=[0];return Ie(e,t.length-1),e}function We(t,e){return t.map(t=>t*e)}function $e(t,e){return t.map(()=>e||J).splice(0,t.length-1)}function Ne({duration:t=300,keyframes:e,times:n,ease:i="easeInOut"}){const o=Q(i)?i.map(it):it(i),s={done:!1,value:e[0]},r=je(We(n&&n.length===e.length?n:Fe(e),t),e,{ease:Array.isArray(o)?o:$e(e,o)});return{calculatedDuration:t,next:e=>(s.value=r(e),s.done=e>=t,s)}}const Ue=t=>null!==t;function ze(t,{repeat:e,repeatType:n="loop"},i,o=1){const s=t.filter(Ue),r=o<0||e&&"loop"!==n&&e%2==1?0:s.length-1;return r&&void 0!==i?i:s[r]}const Ye={decay:Oe,inertia:Oe,tween:Ne,keyframes:Ne,spring:Le};function He(t){"string"==typeof t.type&&(t.type=Ye[t.type])}class Xe{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const Ge=t=>t/100;class Ke extends Xe{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:t}=this.options;t&&t.updatedAt!==dt.now()&&this.tick(dt.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;He(t);const{type:e=Ne,repeat:n=0,repeatDelay:i=0,repeatType:o,velocity:s=0}=t;let{keyframes:r}=t;const a=e||Ne;a!==Ne&&"number"!=typeof r[0]&&(this.mixKeyframes=k(Ge,le(r[0],r[1])),r=[0,100]);const l=a({...t,keyframes:r});"mirror"===o&&(this.mirroredGenerator=a({...t,keyframes:[...r].reverse(),velocity:-s})),null===l.calculatedDuration&&(l.calculatedDuration=de(l));const{calculatedDuration:c}=l;this.calculatedDuration=c,this.resolvedDuration=c+i,this.totalDuration=this.resolvedDuration*(n+1)-i,this.generator=l}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,e=!1){const{generator:n,totalDuration:i,mixKeyframes:o,mirroredGenerator:s,resolvedDuration:r,calculatedDuration:a}=this;if(null===this.startTime)return n.next(0);const{delay:l=0,keyframes:c,repeat:u,repeatType:h,repeatDelay:d,type:p,onUpdate:m,finalKeyframe:f}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const g=this.currentTime-l*(this.playbackSpeed>=0?1:-1),y=this.playbackSpeed>=0?g<0:g>i;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=i);let v,x=this.currentTime,w=n;if(u){const t=Math.min(this.currentTime,i)/r;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,u+1);Boolean(e%2)&&("reverse"===h?(n=1-n,d&&(n-=d/r)):"mirror"===h&&(w=s)),x=b(0,1,n)*r}y?(this.delayState.value=c[0],v=this.delayState):v=w.next(x),o&&!y&&(v.value=o(v.value));let{done:S}=v;y||null===a||(S=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const T=null===this.holdTime&&("finished"===this.state||"running"===this.state&&S);return T&&p!==Oe&&(v.value=ze(c,this.options,f,this.speed)),m&&m(v.value),T&&this.finish(),v}then(t,e){return this.finished.then(t,e)}get duration(){return B(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+B(t)}get time(){return B(this.currentTime)}set time(t){t=L(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);return Be(t=>this.generator.next(t).value,t,this.generator.next(t).value)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;e&&this.driver&&this.updateTime(dt.now()),this.playbackSpeed=t,e&&this.driver&&(this.time=B(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=ce,startTime:e}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),this.options.onPlay?.();const n=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=n):null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime||(this.startTime=e??n),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(dt.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function _e(t){for(let e=1;e180*t/Math.PI,Ze=t=>{const e=qe(Math.atan2(t[1],t[0]));return Qe(e)},Je={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Ze,rotateZ:Ze,skewX:t=>qe(Math.atan(t[1])),skewY:t=>qe(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Qe=t=>((t%=360)<0&&(t+=360),t),tn=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),en=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),nn={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:tn,scaleY:en,scale:t=>(tn(t)+en(t))/2,rotateX:t=>Qe(qe(Math.atan2(t[6],t[5]))),rotateY:t=>Qe(qe(Math.atan2(-t[2],t[0]))),rotateZ:Ze,rotate:Ze,skewX:t=>qe(Math.atan(t[4])),skewY:t=>qe(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function on(t){return t.includes("scale")?1:0}function sn(t,e){if(!t||"none"===t)return on(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,o;if(n)i=nn,o=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=Je,o=e}if(!o)return on(e);const s=i[e],r=o[1].split(",").map(an);return"function"==typeof s?s(r):r[s]}const rn=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return sn(n,e)};function an(t){return parseFloat(t.trim())}const ln=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],cn=(()=>new Set([...ln,"pathRotation"]))(),un=t=>t===xt||t===Lt,hn=new Set(["x","y","z"]),dn=ln.filter(t=>!hn.has(t));const pn={width:({x:t},{paddingLeft:e="0",paddingRight:n="0",boxSizing:i})=>{const o=t.max-t.min;return"border-box"===i?o:o-parseFloat(e)-parseFloat(n)},height:({y:t},{paddingTop:e="0",paddingBottom:n="0",boxSizing:i})=>{const o=t.max-t.min;return"border-box"===i?o:o-parseFloat(e)-parseFloat(n)},top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>sn(e,"x"),y:(t,{transform:e})=>sn(e,"y")};pn.translateX=pn.x,pn.translateY=pn.y;const mn=new Set;let fn=!1,gn=!1,yn=!1;function vn(){if(gn){const t=Array.from(mn).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),n=new Map;e.forEach(t=>{const e=function(t){const e=[];return dn.forEach(n=>{const i=t.getValue(n);void 0!==i&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),e}(t);e.length&&(n.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=n.get(t);e&&e.forEach(([e,n])=>{t.getValue(e)?.set(n)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}gn=!1,fn=!1,mn.forEach(t=>t.complete(yn)),mn.clear()}function xn(){mn.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(gn=!0)})}function wn(){yn=!0,xn(),vn(),yn=!1}class Sn{constructor(t,e,n,i,o,s=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=i,this.element=o,this.isAsync=s}scheduleResolve(){this.state="scheduled",this.isAsync?(mn.add(this),fn||(fn=!0,rt.read(xn),rt.resolveKeyframes(vn))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:i}=this;if(null===t[0]){const o=i?.get(),s=t[t.length-1];if(void 0!==o)t[0]=o;else if(n&&e){const i=n.readValue(e,s);null!=i&&(t[0]=i)}void 0===t[0]&&(t[0]=s),i&&void 0===o&&i.set(t[0])}_e(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),mn.delete(this)}cancel(){"scheduled"===this.state&&(mn.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}const bn=t=>t.startsWith("--");function Tn(t,e,n){bn(e)?t.style.setProperty(e,n):t.style[e]=n}const Pn={};function En(t,e){const n=C(t);return()=>Pn[e]??n()}const An=En(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),Mn=En(()=>void 0!==window.ViewTimeline,"viewTimeline"),Cn=En(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),Vn=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,kn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Vn([0,.65,.55,1]),circOut:Vn([.55,0,1,.45]),backIn:Vn([.31,.01,.66,-.59]),backOut:Vn([.33,1.53,.69,.99])};function Dn(t,e){return t?"function"==typeof t?Cn()?ue(t,e):"ease-out":et(t)?Vn(t):Array.isArray(t)?t.map(t=>Dn(t,e)||kn.easeOut):kn[t]:void 0}function Rn(t,e,n,{delay:i=0,duration:o=300,repeat:s=0,repeatType:r="loop",ease:a="easeOut",times:l}={},c=void 0){const u={[e]:n};l&&(u.offset=l);const h=Dn(a,o);Array.isArray(h)&&(u.easing=h);const d={delay:i,duration:o,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:s+1,direction:"reverse"===r?"alternate":"normal"};return c&&(d.pseudoElement=c),t.animate(u,d)}function Ln(t){return"function"==typeof t&&"applyToOptions"in t}function Bn({type:t,...e}){return Ln(t)&&Cn()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class On extends Xe{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:i,keyframes:o,pseudoElement:s,allowFlatten:r=!1,finalKeyframe:a,onComplete:l}=e;this.isPseudoElement=Boolean(s),this.allowFlatten=r,this.options=e,t.invariant("string"!=typeof e.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const c=Bn(e);this.animation=Rn(n,i,o,c,s),!1===c.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const t=ze(o,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(t),Tn(n,i,t),this.animation.cancel()}l?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return B(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+B(t)}get time(){return B(Number(this.animation.currentTime)||0)}set time(t){const e=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=L(t),e&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:e,rangeEnd:n,observe:i}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&An()?(this.animation.timeline=t,e&&(this.animation.rangeStart=e),n&&(this.animation.rangeEnd=n),V):i(this)}}const jn={anticipate:X,backInOut:H,circInOut:_};function In(t){"string"==typeof t.ease&&t.ease in jn&&(t.ease=jn[t.ease])}class Fn extends On{constructor(t){In(t),He(t),super(t),void 0!==t.startTime&&!1!==t.autoplay&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:e,onUpdate:n,onComplete:i,element:o,...s}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);const r=new Ke({...s,autoplay:!1}),a=Math.max(10,dt.now()-this.startTime),l=b(0,10,a-10),c=r.sample(a).value,{name:u}=this.options;o&&u&&Tn(o,u,c),e.setWithVelocity(r.sample(Math.max(0,a-l)).value,c,l),r.stop()}}const Wn=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Xt.test(t)&&"0"!==t||t.startsWith("url(")));function $n(t){t.duration=0,t.type="keyframes"}const Nn=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),Un=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;const zn=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),Yn=C(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Hn(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:o,damping:s,type:r,keyframes:a}=t,l=e?.owner?.current;if(!(l instanceof HTMLElement||l instanceof SVGElement))return!1;const{onUpdate:c,transformTemplate:u}=e.owner.getProps();return Yn()&&n&&(Nn.has(n)||zn.has(n)&&function(t){for(let e=0;e{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=dt.now();const h={autoplay:t,delay:e,type:n,repeat:i,repeatDelay:o,repeatType:s,name:a,motionValue:l,element:c,...u},d=c?.KeyframeResolver||Sn;this.keyframeResolver=new d(r,(t,e,n)=>this.onKeyframesResolved(t,e,h,!n),a,l,c),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,n,i,o){this.keyframeResolver=void 0;const{name:s,type:r,velocity:a,delay:l,isHandoff:c,onUpdate:u}=i;this.resolvedAt=dt.now();let h=!0;(function(e,n,i,o){const s=e[0];if(null===s)return!1;if("display"===n||"visibility"===n)return!0;const r=e[e.length-1],a=Wn(s,n),l=Wn(r,n);return t.warning(a===l,`You are trying to animate ${n} from "${s}" to "${r}". "${a?r:s}" is not an animatable value.`,"value-not-animatable"),!(!a||!l)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:n,...i,keyframes:e},p=h&&!c&&Hn(d),m=d.motionValue?.owner?.current;let f;if(p)try{f=new Fn({...d,element:m})}catch{f=new Ke(d)}else f=new Ke(d);f.finished.then(()=>{this.notifyFinished()}).catch(V),this.pendingTimeline&&(this.stopTimeline=f.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=f}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),wn()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}class Gn{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;ne.attachTimeline(t));return()=>{e.forEach((t,e)=>{t&&t(),this.animations[e].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return Kn(this.animations,"duration")}get iterationDuration(){return Kn(this.animations,"iterationDuration")}runAll(t){this.animations.forEach(e=>e[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function Kn(t,e){let n=0;for(let i=0;in&&(n=o)}return n}class _n extends Gn{then(t,e){return this.finished.finally(t).then(()=>{})}}class qn extends On{constructor(t){super(),this.animation=t,t.onfinish=()=>{this.finishedTime=this.time,this.notifyFinished()}}}const Zn=new WeakMap,Jn=(t,e="")=>`${t}:${e}`;function Qn(t){let e=Zn.get(t);return e||(e=new Map,Zn.set(t,e)),e}function ti(t,e,n,i=0,o=1){const s=Array.from(t).sort((t,e)=>t.sortNodePosition(e)).indexOf(e),r=t.size,a=(r-1)*i;return"function"==typeof n?n(s,r):1===o?s*i:a-s*i}const ei={current:void 0};class ni{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=dt.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=dt.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new R);const n=this.events[t].add(e);return"change"===t?()=>{n(),rt.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return ei.current&&ei.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=dt.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return O(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function ii(t,e){return new ni(t,e)}function oi(t,e){if(t?.inherit&&e){const{inherit:n,...i}=t;return{...e,...i}}return t}function si(t,e){const n=t?.[e]??t?.default??t;return n!==t?oi(n,t):n}const ri={type:"spring",stiffness:500,damping:25,restSpeed:10},ai={type:"keyframes",duration:.8},li={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ci=(t,{keyframes:e})=>e.length>2?ai:cn.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:ri:li,ui=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function hi(t){for(const e in t)if(!ui.has(e))return!0;return!1}const di=(t,e,n,i={},o,s)=>r=>{const a=si(i,t)||{},l=a.delay||i.delay||0;let{elapsed:c=0}=i;c-=L(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-c,onUpdate:t=>{e.set(t),a.onUpdate&&a.onUpdate(t)},onComplete:()=>{r(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:s?void 0:o};hi(a)||Object.assign(u,ci(t,u)),u.duration&&(u.duration=L(u.duration)),u.repeatDelay&&(u.repeatDelay=L(u.repeatDelay)),void 0!==u.from&&(u.keyframes[0]=u.from);let h=!1;if((!1===u.type||0===u.duration&&!u.repeatDelay)&&($n(u),0===u.delay&&(h=!0)),(P.instantAnimations||P.skipAnimations||o?.shouldSkipAnimations||a.skipAnimations)&&(h=!0,$n(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,h&&!s&&void 0!==e.get()){const t=ze(u.keyframes,a);if(void 0!==t)return void rt.update(()=>{u.onUpdate(t),u.onComplete()})}return a.isSync?new Ke(u):new Xn(u)};function pi(t,e,n,i){const o=1-t;return o*o*e+2*o*t*n+t*t*i}function mi(t,e,n,i,o,s,r){const a=2*(1-t)*(n-e)+2*t*(i-n),l=2*(1-t)*(s-o)+2*t*(r-s);return Math.atan2(l,a)*(180/Math.PI)}function fi(t,e,n,i,o,s){const r=n-t,a=i-e,l=Math.sqrt(r*r+a*a);if(l>0){const n=o*l;return{x:t+r*s+-a/l*n,y:e+a*s+r/l*n}}return{x:t,y:e}}const gi=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function yi(t){const e=gi.exec(t);if(!e)return[,];const[,n,i,o]=e;return[`--${n??i}`,o]}function vi(e,n,i=1){t.invariant(i<=4,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[o,s]=yi(e);if(!o)return;const r=window.getComputedStyle(n).getPropertyValue(o);if(r){const t=r.trim();return E(t)?parseFloat(t):t}return gt(s)?vi(s,n,i+1):s}function xi(t){const e=[{},{}];return t?.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}function wi(t,e,n,i){if("function"==typeof e){const[o,s]=xi(i);e=e(void 0!==n?n:t.custom,o,s)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[o,s]=xi(i);e=e(void 0!==n?n:t.custom,o,s)}return e}function Si(t,e,n){const i=t.getProps();return wi(i,e,void 0!==n?n:i.custom,t)}const bi=new Set(["width","height","top","left","right","bottom",...ln]),Ti=t=>Array.isArray(t);function Pi(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,ii(n))}function Ei(t){return Ti(t)?t[t.length-1]||0:t}function Ai(t,e){const n=Si(t,e);let{transitionEnd:i={},transition:o={},...s}=n||{};s={...s,...i};for(const e in s){Pi(t,e,Ei(s[e]))}}const Mi=t=>Boolean(t&&t.getVelocity);function Ci(t){return Boolean(Mi(t)&&t.add)}function Vi(t,e){const n=t.getValue("willChange");if(Ci(n))return n.add(e);if(!n&&P.WillChange){const n=new P.WillChange("auto");t.addValue("willChange",n),n.add(e)}}function ki(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const Di="framerAppearId",Ri="data-"+ki(Di);function Li(t){return t.props[Ri]}function Bi({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}function Oi(t,e,{delay:n=0,transitionOverride:i,type:o}={}){let{transition:s,transitionEnd:r,...a}=e;const l=t.getDefaultTransition();s=s?oi(s,l):l;const c=s?.reduceMotion,u=s?.skipAnimations;i&&(s=i);const h=[],d=o&&t.animationState&&t.animationState.getState()[o],p=s?.path;p&&p.animateVisualElement(t,a,s,n,h);for(const e in a){const i=t.getValue(e,t.latestValues[e]??null),o=a[e];if(void 0===o||d&&Bi(d,e))continue;const r={delay:n,...si(s||{},e)};u&&(r.skipAnimations=!0);const l=i.get();if(void 0!==l&&!i.isAnimating()&&!Array.isArray(o)&&o===l&&!r.velocity){rt.update(()=>i.set(o));continue}let p=!1;if(window.MotionHandoffAnimation){const n=Li(t);if(n){const t=window.MotionHandoffAnimation(n,e,rt);null!==t&&(r.startTime=t,p=!0)}}Vi(t,e);const m=c??t.shouldReduceMotion;i.start(di(e,i,o,m&&bi.has(e)?{type:!1}:r,t,p));const f=i.animation;f&&h.push(f)}if(r){const e=()=>rt.update(()=>{r&&Ai(t,r)});h.length?Promise.all(h).then(e):e()}return h}function ji(t,e,n={}){const i=Si(t,e,"exit"===n.type?t.presenceContext?.custom:void 0);let{transition:o=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(o=n.transitionOverride);const s=i?()=>Promise.all(Oi(t,i,n)):()=>Promise.resolve(),r=t.variantChildren&&t.variantChildren.size?(i=0)=>{const{delayChildren:s=0,staggerChildren:r,staggerDirection:a}=o;return function(t,e,n=0,i=0,o=0,s=1,r){const a=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),a.push(ji(l,e,{...r,delay:n+("function"==typeof i?0:i)+ti(t.variantChildren,l,i,o,s)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(a)}(t,e,i,s,r,a,n)}:()=>Promise.resolve(),{when:a}=o;if(a){const[t,e]="beforeChildren"===a?[s,r]:[r,s];return t().then(()=>e())}return Promise.all([s(),r(n.delay)])}function Ii(t,e,n={}){let i;if(t.notify("AnimationStart",e),Array.isArray(e)){const o=e.map(e=>ji(t,e,n));i=Promise.all(o)}else if("string"==typeof e)i=ji(t,e,n);else{const o="function"==typeof e?Si(t,e,n.custom):e;i=Promise.all(Oi(t,o,n))}return i.then(()=>{t.notify("AnimationComplete",e)})}const Fi=t=>e=>e.test(t),Wi=[xt,Lt,Rt,Dt,Ot,Bt,{test:t=>"auto"===t,parse:t=>t}],$i=t=>Wi.find(Fi(t));function Ni(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||M(t))}const Ui=new Set(["brightness","contrast","saturate","opacity"]);function zi(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(Tt)||[];if(!i)return t;const o=n.replace(i,"");let s=Ui.has(e)?1:0;return i!==n&&(s*=100),e+"("+s+o+")"}const Yi=/\b([a-z-]*)\(.*?\)/gu,Hi={...Xt,getAnimatableNone:t=>{const e=t.match(Yi);return e?e.map(zi).join(" "):t}},Xi={...Xt,getAnimatableNone:t=>{const e=Xt.parse(t);return Xt.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},Gi={...xt,transform:Math.round},Ki={rotate:Dt,pathRotation:Dt,rotateX:Dt,rotateY:Dt,rotateZ:Dt,scale:St,scaleX:St,scaleY:St,scaleZ:St,skew:Dt,skewX:Dt,skewY:Dt,distance:Lt,translateX:Lt,translateY:Lt,translateZ:Lt,x:Lt,y:Lt,z:Lt,perspective:Lt,transformPerspective:Lt,opacity:wt,originX:jt,originY:jt,originZ:Lt},_i={borderWidth:Lt,borderTopWidth:Lt,borderRightWidth:Lt,borderBottomWidth:Lt,borderLeftWidth:Lt,borderRadius:Lt,borderTopLeftRadius:Lt,borderTopRightRadius:Lt,borderBottomRightRadius:Lt,borderBottomLeftRadius:Lt,width:Lt,maxWidth:Lt,height:Lt,maxHeight:Lt,top:Lt,right:Lt,bottom:Lt,left:Lt,inset:Lt,insetBlock:Lt,insetBlockStart:Lt,insetBlockEnd:Lt,insetInline:Lt,insetInlineStart:Lt,insetInlineEnd:Lt,padding:Lt,paddingTop:Lt,paddingRight:Lt,paddingBottom:Lt,paddingLeft:Lt,paddingBlock:Lt,paddingBlockStart:Lt,paddingBlockEnd:Lt,paddingInline:Lt,paddingInlineStart:Lt,paddingInlineEnd:Lt,margin:Lt,marginTop:Lt,marginRight:Lt,marginBottom:Lt,marginLeft:Lt,marginBlock:Lt,marginBlockStart:Lt,marginBlockEnd:Lt,marginInline:Lt,marginInlineStart:Lt,marginInlineEnd:Lt,fontSize:Lt,backgroundPositionX:Lt,backgroundPositionY:Lt,...Ki,zIndex:Gi,fillOpacity:wt,strokeOpacity:wt,numOctaves:Gi},qi={..._i,color:Ft,backgroundColor:Ft,outlineColor:Ft,fill:Ft,stroke:Ft,borderColor:Ft,borderTopColor:Ft,borderRightColor:Ft,borderBottomColor:Ft,borderLeftColor:Ft,filter:Hi,WebkitFilter:Hi,mask:Xi,WebkitMask:Xi},Zi=t=>qi[t],Ji=new Set([Hi,Xi]);function Qi(t,e){let n=Zi(t);return Ji.has(n)||(n=Xt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const to=new Set(["auto","none","0"]);class eo extends Sn{constructor(t,e,n,i,o){super(t,e,n,i,o,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n{t.getValue(e).set(n)}),this.resolveNoneKeyframes()}}const no=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"],io=new Set(["borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius",...no,"width","maxWidth","height","maxHeight","top","right","bottom","left","inset","insetBlock","insetBlockStart","insetBlockEnd","insetInline","insetInlineStart","insetInlineEnd","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingBlock","paddingBlockStart","paddingBlockEnd","paddingInline","paddingInlineStart","paddingInlineEnd","margin","marginTop","marginRight","marginBottom","marginLeft","marginBlock","marginBlockStart","marginBlockEnd","marginInline","marginInlineStart","marginInlineEnd","fontSize","backgroundPositionX","backgroundPositionY"]);function oo(t,e){for(let n=0;n{try{document.createElement("div").animate({opacity:[1]})}catch(t){return!1}return!0});function ro(t,e,n){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){let i=document;e&&(i=e.current);const o=n?.[t]??i.querySelectorAll(t);return o?Array.from(o):[]}return Array.from(t).filter(t=>null!=t)}function ao(t){return(e,n)=>{const i=ro(e),o=[];for(const e of i){const i=t(e,n);o.push(i)}return()=>{for(const t of o)t()}}}const lo=(t,e)=>e&&"number"==typeof t?e.transform(t):t;class co{constructor(){this.latest={},this.values=new Map}set(t,e,n,i,o=!0){const s=this.values.get(t);s&&s.onRemove();const r=()=>{const i=e.get();this.latest[t]=o?lo(i,_i[t]):i,n&&rt.render(n)};r();const a=e.on("change",r);i&&e.addDependent(i);const l=()=>{a(),n&&at(n),this.values.delete(t),i&&e.removeDependent(i)};return this.values.set(t,{value:e,onRemove:l}),l}get(t){return this.values.get(t)?.value}}function uo(t){const e=new WeakMap;return(n,i)=>{const o=e.get(n)??new co;e.set(n,o);const s=[];for(const e in i){const r=i[e],a=t(n,o,e,r);s.push(a)}return()=>{for(const t of s)t()}}}const ho=(t,e,n,i)=>{const o=function(t,e){if(!(e in t))return!1;const n=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(t),e)||Object.getOwnPropertyDescriptor(t,e);return n&&"function"==typeof n.set}(t,n),s=o?n:n.startsWith("data")||n.startsWith("aria")?ki(n):n,r=o?()=>{t[s]=e.latest[n]}:()=>{const i=e.latest[n];null==i?t.removeAttribute(s):t.setAttribute(s,String(i))};return e.set(n,i,r)},po=ao(uo(ho)),mo=uo((t,e,n,i)=>e.set(n,i,()=>{t[n]=e.latest[n]},void 0,!1));function fo(t){return A(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const go={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"};const yo=new Set(["originX","originY","originZ"]),vo=(t,e,n,i)=>{let o,s;return cn.has(n)?(e.get("transform")||(fo(t)||e.get("transformBox")||vo(t,e,"transformBox",new ni("fill-box")),e.set("transform",new ni("none"),()=>{t.style.transform=function(t){let e="",n=!0;for(let i=0;i{const n=e.latest.originX??"50%",i=e.latest.originY??"50%",o=e.latest.originZ??0;t.style.transformOrigin=`${n} ${i} ${o}`}),s=e.get("transformOrigin")):o=bn(n)?()=>{t.style.setProperty(n,e.latest[n])}:()=>{t.style[n]=e.latest[n]},e.set(n,i,o,s)},xo=ao(uo(vo));const wo=ao(uo((t,e,n,i)=>{if(n.startsWith("path"))return function(t,e,n,i){return rt.render(()=>t.setAttribute("pathLength","1")),"pathOffset"===n?e.set(n,i,()=>{const i=e.latest[n];t.setAttribute("stroke-dashoffset",""+-i)}):(e.get("stroke-dasharray")||e.set("stroke-dasharray",new ni("1 1"),()=>{const{pathLength:n=1,pathSpacing:i}=e.latest;t.setAttribute("stroke-dasharray",`${n} ${i??1-Number(n)}`)}),e.set(n,i,void 0,e.get("stroke-dasharray")))}(t,e,n,i);if(n.startsWith("attr"))return ho(t,e,function(t){return t.replace(/^attr([A-Z])/,(t,e)=>e.toLowerCase())}(n),i);return(n in t.style?vo:ho)(t,e,n,i)}));const{schedule:So,cancel:bo}=st(queueMicrotask,!1),To={x:!1,y:!1};function Po(){return To.x||To.y}function Eo(t){return"x"===t||"y"===t?To[t]?null:(To[t]=!0,()=>{To[t]=!1}):To.x||To.y?null:(To.x=To.y=!0,()=>{To.x=To.y=!1})}function Ao(t,e){const n=ro(t),i=new AbortController;return[n,{passive:!0,...e,signal:i.signal},()=>i.abort()]}function Mo(t,e,n={}){const[i,o,s]=Ao(t,n);return i.forEach(t=>{let n,i=!1,s=!1;const r=e=>{n&&(n(e),n=void 0),t.removeEventListener("pointerleave",l)},a=t=>{i=!1,window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",a),s&&(s=!1,r(t))},l=t=>{"touch"!==t.pointerType&&(i?s=!0:r(t))};t.addEventListener("pointerenter",i=>{if("touch"===i.pointerType||Po())return;s=!1;const r=e(t,i);"function"==typeof r&&(n=r,t.addEventListener("pointerleave",l,o))},o),t.addEventListener("pointerdown",()=>{i=!0,window.addEventListener("pointerup",a,o),window.addEventListener("pointercancel",a,o)},o)}),s}const Co=(t,e)=>!!e&&(t===e||Co(t,e.parentElement)),Vo=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,ko=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Do(t){return ko.has(t.tagName)||!0===t.isContentEditable}const Ro=new Set(["INPUT","SELECT","TEXTAREA"]);function Lo(t){return Ro.has(t.tagName)||!0===t.isContentEditable}const Bo=new WeakSet;function Oo(t){return e=>{"Enter"===e.key&&t(e)}}function jo(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function Io(t){return Vo(t)&&!Po()}const Fo=new WeakSet;function Wo(t,e,n={}){const[i,o,s]=Ao(t,n),r=t=>{const i=t.currentTarget;if(!Io(t))return;if(Fo.has(t))return;Bo.add(i),n.stopPropagation&&Fo.add(t);const s=e(i,t),r={...o,capture:!0},a=(t,e)=>{window.removeEventListener("pointerup",l,r),window.removeEventListener("pointercancel",c,r),Bo.has(i)&&Bo.delete(i),Io(t)&&"function"==typeof s&&s(t,{success:e})},l=t=>{a(t,i===window||i===document||n.useGlobalTarget||Co(i,t.target))},c=t=>{a(t,!1)};window.addEventListener("pointerup",l,r),window.addEventListener("pointercancel",c,r)};return i.forEach(t=>{(n.useGlobalTarget?window:t).addEventListener("pointerdown",r,o),fo(t)&&(t.addEventListener("focus",t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const i=Oo(()=>{if(Bo.has(n))return;jo(n,"down");const t=Oo(()=>{jo(n,"up")});n.addEventListener("keyup",t,e),n.addEventListener("blur",()=>jo(n,"cancel"),e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)})(t,o)),Do(t)||t.hasAttribute("tabindex")||(t.tabIndex=0))}),s}function $o(t,e){const n=window.getComputedStyle(t);return bn(e)?n.getPropertyValue(e):n[e]}function No(t){return A(t)&&"ownerSVGElement"in t}const Uo=new WeakMap;let zo;const Yo=(t,e,n)=>(i,o)=>o&&o[0]?o[0][t+"Size"]:No(i)&&"getBBox"in i?i.getBBox()[e]:i[n],Ho=Yo("inline","width","offsetWidth"),Xo=Yo("block","height","offsetHeight");function Go({target:t,borderBoxSize:e}){Uo.get(t)?.forEach(n=>{n(t,{get width(){return Ho(t,e)},get height(){return Xo(t,e)}})})}function Ko(t){t.forEach(Go)}function _o(t,e){zo||"undefined"!=typeof ResizeObserver&&(zo=new ResizeObserver(Ko));const n=ro(t);return n.forEach(t=>{let n=Uo.get(t);n||(n=new Set,Uo.set(t,n)),n.add(e),zo?.observe(t)}),()=>{n.forEach(t=>{const n=Uo.get(t);n?.delete(e),n?.size||zo?.unobserve(t)})}}const qo=new Set;let Zo;function Jo(t){return qo.add(t),Zo||(Zo=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};qo.forEach(e=>e(t))},window.addEventListener("resize",Zo)),()=>{qo.delete(t),qo.size||"function"!=typeof Zo||(window.removeEventListener("resize",Zo),Zo=void 0)}}function Qo(t,e){return"function"==typeof t?Jo(t):_o(t,e)}function ts(t,e){let n;const i=()=>{const{currentTime:i}=e,o=(null===i?0:i.value)/100;n!==o&&t(o),n=o};return rt.preUpdate(i,!0),()=>at(i)}const es={value:null,addProjectionMetrics:null};function ns(t){return No(t)&&"svg"===t.tagName}function is(t,e){if("first"===t)return 0;{const n=e-1;return"last"===t?n:n/2}}function os(...t){const e=!Array.isArray(t[0]),n=e?0:-1,i=t[0+n],o=je(t[1+n],t[2+n],t[3+n]);return e?o(i):o}function ss(t,e){const n=ii(Mi(t)?t.get():t);return rs(n,t,e),n}function rs(t,e,n={}){const i=t.get();let o,s=null,r=i;const a="string"==typeof i?i.replace(/[\d.-]/g,""):void 0,l=()=>{s&&(s.stop(),s=null),t.animation=void 0},c=()=>{(()=>{const e=ls(t.get()),i=ls(r);if(e===i)return void l();const a=s?s.getGeneratorVelocity():t.getVelocity();l(),s=new Ke({keyframes:[e,i],velocity:a,type:"spring",restDelta:.001,restSpeed:.01,...n,onUpdate:o})})(),t.animation=s??void 0,t.events.animationStart?.notify(),s?.then(()=>{t.animation=void 0,t.events.animationComplete?.notify()})};if(t.attach((t,e)=>{r=t,o=t=>e(as(t,a)),rt.postRender(c)},l),Mi(e)){let i=!0===n.skipInitialAnimation;const o=e.on("change",e=>{i?(i=!1,t.jump(as(e,a),!1)):t.set(as(e,a))}),s=t.on("destroy",o);return()=>{o(),s()}}return l}function as(t,e){return e?t+e:t}function ls(t){return"number"==typeof t?t:parseFloat(t)}function cs(t){const e=[];ei.current=e;const n=t();ei.current=void 0;const i=ii(n);return function(t,e,n){const i=()=>e.set(n()),o=()=>rt.preRender(i,!1,!0),s=t.map(t=>t.on("change",o));e.on("destroy",()=>{s.forEach(t=>t()),at(i)})}(e,i,t),i}const us=[...Wi,Ft,Xt],hs=t=>us.find(Fi(t));let ds=0;const ps=()=>"motion-view-"+ds++;function ms(t,e,n){e&&(t.style?.setProperty("view-transition-class",e),n.push(t))}function fs(t,e,n,i,o){if(n&&(t.style?.setProperty("view-transition-group",n),i.push(t),"none"!==n&&o)){const n=getComputedStyle(t);"visible"===n.overflowX&&"visible"===n.overflowY||o.add(e)}}function gs(t,e,n,i,o,s=[],r,a=[],l){const c=ro(t);if(i)return c.map((t,c)=>{const u=e.get(t);if(u)return u;const h=i[c]??ps();return t.style?.setProperty("view-transition-name",h),n.push(t),e.set(t,h),ms(t,o,s),fs(t,h,r,a,l),h});const u=c.map(t=>e.has(t)?void 0:getComputedStyle(t).getPropertyValue("view-transition-name"));return c.map((t,i)=>{const c=e.get(t);if(c)return c;const h=u[i];let d;return h&&"none"!==h&&"auto"!==h&&"match-element"!==h&&!(t=>t.startsWith("motion-view-"))(h)?d=h:(d=ps(),t.style?.setProperty("view-transition-name",d),n.push(t)),e.set(t,d),ms(t,o,s),fs(t,d,r,a,l),d})}function ys(t){return"layout"===t?"group":"enter"===t||"new"===t?"new":"old"}let vs={},xs=null;const ws=(t,e)=>{vs[t]=e},Ss=()=>{xs||(xs=document.createElement("style"),xs.id="motion-view");let t="";for(const e in vs){const n=vs[e];t+=`${e} {\n`;for(const[e,i]of Object.entries(n))t+=` ${e}: ${i};\n`;t+="}\n"}xs.textContent=t,document.head.appendChild(xs),vs={}},bs=()=>{xs&&xs.parentElement&&xs.parentElement.removeChild(xs)};function Ts(t){const e=t.match(/::view-transition-(old|new|group-children|group|image-pair)\((.*?)\)/);return e?{layer:e[2],type:e[1]}:null}function Ps(){return document.getAnimations().filter(t=>{const{effect:e}=t;return!!e&&e.target===document.documentElement&&e.pseudoElement?.startsWith("::view-transition")})}const Es=["layout","enter","exit","new","old"],As=t=>t.split(" ").every(t=>0===parseFloat(t)),Ms={group:["layout"],new:["new","enter"],old:["old","exit"]},Cs={new:{opacity:0,scale:.85},old:{opacity:1,scale:1}};function Vs(t){const{update:e,targets:n,resolveDefs:i,cropOverride:o,pairs:s,classNames:r,flatGroups:a,options:l}=t;if(!document.startViewTransition)return(async()=>(await e(),new Gn([])))();const c=new Map,u=[],h=[],d=[],p=new Set,m=new Map,f=new Set,g=new Map,y=new Map,v=new Map,x=new Map,w=t=>{n.forEach((e,n)=>{const l=r.get(n),f="root"!==n&&i.has(n)?a.has(n)?"none":"contain":void 0;let w;if("root"!==n&&i.has(n))if(s.has(n))if("old"===t)x.set(n,ro(n)),w=gs(n,c,u,void 0,l,h,f,d,p),v.set(n,w);else{for(const t of x.get(n)??[])t.style?.removeProperty("view-transition-name"),c.delete(t);w=gs(s.get(n),c,u,v.get(n),l,h,f,d,p)}else w=gs(n,c,u,void 0,l,h,f,d,p);else w=[n];const S=o.get(n);w.forEach((n,i)=>{const o=m.get(n);m.set(n,o&&o!==e?{...o,...e}:e),void 0!==S&&g.set(n,S);const s=y.get(n)??{};s[t]=[i,w.length],y.set(n,s)})})},S=(t,e)=>{const n=y.get(t);return("old"===e?n?.old:"new"===e?n?.new:n?.new??n?.old)??[-1,1]},b=(t,e,n,i,o)=>{const s=ks(si(l,n),si(function(t,e){for(const n of Ms[e]??[]){const e=t?.[n]?.options;if(e)return e}}(t,e)??{},n));return"function"==typeof s.delay&&(s.delay=s.delay(i,o)),s},T=t=>{const[e,n]=S(t,"group"),i=b(m.get(t),"group","layout",-1===e?0:e,n);i.duration&&(i.duration=L(i.duration));const{delay:o=0,duration:s,ease:r}=Bn(i);return{delay:L(o),duration:s,ease:r}},P=new Map,E=t=>c.forEach((e,n)=>{const i=n,o=i.getBoundingClientRect?.();if(o&&o.height){const n=getComputedStyle(i),s={};for(const t of no)s[t]=n[t];const r=P.get(e)??{};r[t]={width:o.width,height:o.height,radii:s},P.set(e,r)}}),A=t=>{const e=P.get(t);return!!(e?.old&&e?.new&&e.old.height&&e.new.height)&&Math.abs(e.old.width/e.old.height-e.new.width/e.new.height)>.2},M=()=>{(function(t,e){return e.has(t)&&Object.keys(e.get(t)).length>0})("root",n)||ws(":root",{"view-transition-name":"none"}),ws("::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)",{"animation-timing-function":"linear !important"}),f.forEach(t=>{ws(`::view-transition-group(${t})`,{overflow:"clip"}),ws(`::view-transition-old(${t}), ::view-transition-new(${t})`,{width:"100%",height:"100%","object-fit":"cover"})}),p.forEach(t=>{ws(`::view-transition-group-children(${t})`,{overflow:"clip"})}),Ss()},C=()=>{!function(t,e=[],n=[]){for(const e of t)e.style?.removeProperty("view-transition-name");for(const t of e)t.style?.removeProperty("view-transition-class");for(const t of n)t.style?.removeProperty("view-transition-group")}(u,h,d),bs()},V=async()=>{await e(),w("new"),E("new"),(()=>{f.clear();for(const t of y.keys())"root"!==t&&(g.get(t)??A(t))&&f.add(t)})(),M()};let k;try{w("old"),E("old"),M(),k=document.startViewTransition(V)}catch(t){return C(),Promise.reject(t)}return k.finished.finally(C),new Promise((t,e)=>{k.ready.then(()=>{const e=Ps(),n=[],i=new Set,o=new Set;m.forEach((t,e)=>{const s=y.get(e),r=!!s?.new&&!s?.old,a=!!s?.old&&!s?.new;for(const s of Es){if(!t[s])continue;if("enter"===s&&!r)continue;if("exit"===s&&!a)continue;const c=ys(s),[u,h]=S(e,c);if(-1===u)continue;const{keyframes:d,options:p}=t[s];for(let[m,f]of Object.entries(d)){if(null==f)continue;if("x"===m||"y"===m){I(!1,`animateView() animates view-transition layers with CSS properties; the "${m}" shorthand has no effect - use transform, e.g. { transform: "translateX(40px)" }.`);continue}if("new"===s&&r&&null!=t.enter?.keyframes[m])continue;if("old"===s&&a&&null!=t.exit?.keyframes[m])continue;const d=ks(si(l,m),si(p,m));if(!Array.isArray(f)){const e="enter"===s?t.exit?.keyframes[m]:void 0,n="opacity"===m||("new"===c?r:a),i=null!=e?Array.isArray(e)?e[e.length-1]:e:n?Cs[c]?.[m]:void 0;void 0!==i&&(f=[i,f])}"function"==typeof d.delay&&(d.delay=d.delay(u,h)),d.duration&&(d.duration=L(d.duration)),d.delay&&(d.delay=L(d.delay)),n.push(new On({...d,element:document.documentElement,name:m,pseudoElement:`::view-transition-${c}(${e})`,keyframes:f})),i.add(`${e}:${c}`),"opacity"===m&&o.add(`${e}:${c}`)}}});for(const t of e){if("finished"===t.playState)continue;const{effect:e}=t;if(!(e&&e instanceof KeyframeEffect))continue;const{pseudoElement:s}=e;if(!s)continue;const r=Ts(s);if(!r)continue;const a=m.get(r.layer);if(i.has(`${r.layer}:${r.type}`)){o.has(`${r.layer}:new`)&&o.has(`${r.layer}:old`)&&e.getKeyframes().some(t=>t.mixBlendMode)?n.push(new qn(t)):t.cancel();continue}const l="old"===r.type?"new":"new"===r.type?"old":void 0;if(l&&i.has(`${r.layer}:${l}`)&&!o.has(`${r.layer}:${l}`)){t.cancel();continue}const c=y.get(r.layer),u=!("old"!==r.type&&"new"!==r.type||!c?.old||!c?.new);let h;if(r.type.startsWith("group")){const{delay:t,duration:e,ease:n}=T(r.layer);h={delay:t,duration:e,easing:Dn(n,e)}}else{const t=u?"group":r.type,[e,n]=S(r.layer,t);let i=b(a,t,"group"===t?"layout":"",-1===e?0:e,n);const o=i.visualDuration;i.duration&&(i.duration=L(i.duration)),i=Bn(i),h={delay:L(i.delay??0),duration:u&&void 0!==o?L(o):i.duration,easing:u?"linear":Dn(i.ease,i.duration)}}e.updateTiming(h),n.push(new qn(t))}P.forEach((t,e)=>{if(!f.has(e))return;const{delay:i,duration:o,ease:s}=T(e);for(const r of no){const a=t.old?.radii[r]||t.new?.radii[r]||"0px",l=t.new?.radii[r]||t.old?.radii[r]||"0px";As(a)&&As(l)||n.push(new On({element:document.documentElement,name:r,pseudoElement:`::view-transition-group(${e})`,keyframes:[a,l],delay:i,duration:o,ease:s}))}}),t(new Gn(n))}).catch(()=>k.updateCallbackDone.then(()=>t(new Gn([])),e))})}function ks(t,e){const n={...t,...e};return void 0!==e.duration&&(void 0===e.visualDuration&&delete n.visualDuration,void 0===e.type&&delete n.type),n}let Ds=[],Rs=null;function Ls(){Rs=null;const[t]=Ds;var e;t&&(w(Ds,e=t),Rs=e,Vs(e).then(t=>(e.notifyReady(t),t.finished)).catch(t=>e.notifyReject(t)).finally(Ls))}function Bs(){for(let t=Ds.length-1;t>=0;t--){const e=Ds[t],{interrupt:n}=e.options;if("immediate"===n){const n=Ds.slice(0,t+1).map(t=>t.update),i=Ds.slice(t+1);e.update=()=>{n.forEach(t=>t())},Ds=[e,...i];break}}Rs&&"immediate"!==Ds[0]?.options.interrupt||Ls()}class Os{constructor(t,e={}){var n;this.currentSubject="root",this.targets=new Map,this.resolveDefs=new Set,this.cropOverride=new Map,this.pairs=new Map,this.classNames=new Map,this.flatGroups=new Set,this.notifyReady=V,this.notifyReject=V,this.readyPromise=new Promise((t,e)=>{this.notifyReady=t,this.notifyReject=e}),this.update=t,this.options={interrupt:"wait",...e},this.readyPromise.catch(V),n=this,Ds.push(n),So.render(Bs)}add(t,e){return this.currentSubject=t,this.resolveDefs.add(t),void 0!==e&&this.pairs.set(t,e),this.targets.has(t)||this.targets.set(t,{}),this}crop(t=!0){return this.cropOverride.set(this.currentSubject,t),this}group(t=!0){return t?this.flatGroups.delete(this.currentSubject):this.flatGroups.add(this.currentSubject),this}class(t){return this.classNames.set(this.currentSubject,t),this}layout(t={}){return this.updateTarget("layout",{},t),this}enter(t,e){return this.updateTarget("enter",t,e),this}exit(t,e){return this.updateTarget("exit",t,e),this}new(t,e){return this.updateTarget("new",t,e),this}old(t,e){return this.updateTarget("old",t,e),this}updateTarget(t,e,n={}){const{currentSubject:i,targets:o}=this;o.has(i)||o.set(i,{});o.get(i)[t]={keyframes:e,options:n}}then(t,e){return this.readyPromise.then(t,e)}}const js=()=>({translate:0,scale:1,origin:0,originPoint:0}),Is=()=>({x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}),Fs=()=>({min:0,max:0}),Ws=()=>({x:{min:0,max:0},y:{min:0,max:0}}),$s=new WeakMap;function Ns(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function Us(t){return"string"==typeof t||Array.isArray(t)}const zs=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Ys=["initial",...zs];function Hs(t){return Ns(t.animate)||Ys.some(e=>Us(t[e]))}function Xs(t){return Boolean(Hs(t)||t.variants)}function Gs(t,e,n){for(const i in e){const o=e[i],s=n[i];if(Mi(o))t.addValue(i,o);else if(Mi(s))t.addValue(i,ii(o,{owner:t}));else if(s!==o)if(t.hasValue(i)){const e=t.getValue(i);!0===e.liveStyle?e.jump(o):e.hasAnimated||e.set(o)}else{const e=t.getStaticValue(i);t.addValue(i,ii(void 0!==e?e:o,{owner:t}))}}for(const i in n)void 0===e[i]&&t.removeValue(i);return e}const Ks={current:null},_s={current:!1},qs="undefined"!=typeof window;function Zs(){if(_s.current=!0,qs)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Ks.current=t.matches;t.addEventListener("change",e),e()}else Ks.current=!1}const Js=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Qs={};function tr(t){Qs=t}function er(){return Qs}class nr{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:i,skipAnimations:o,blockInitialAnimation:s,visualState:r},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Sn,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const t=dt.now();this.renderScheduledAtthis.bindToMotionValue(e,t)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(_s.current||Zs(),this.shouldReduceMotion=Ks.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),at(this.notifyUpdate),at(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,e){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),e.accelerate&&Nn.has(t)&&this.current instanceof HTMLElement){const{factory:n,keyframes:i,times:o,ease:s,duration:r}=e.accelerate,a=new On({element:this.current,name:t,keyframes:i,times:o,ease:s,duration:L(r)}),l=n(a);return void this.valueSubscriptions.set(t,()=>{l(),a.cancel()})}const n=cn.has(t);n&&this.onBindTransform&&this.onBindTransform();const i=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&rt.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{i(),o&&o()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in Qs){const e=Qs[t];if(!e)continue;const{isEnabled:n,Feature:i}=e;if(!this.features[t]&&i&&n(this.props)&&(this.features[t]=new i(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;ee.variantChildren.delete(t)}addValue(t,e){const n=this.values.get(t);e!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=ii(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,e){let n=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];return null!=n&&("string"==typeof n&&(E(n)||M(n))?n=parseFloat(n):!hs(n)&&Xt.test(e)&&(n=Qi(t,e)),this.setBaseTarget(t,Mi(n)?n.get():n)),Mi(n)?n.get():n}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let n;if("string"==typeof e||"object"==typeof e){const i=wi(this.props,e,this.presenceContext?.custom);i&&(n=i[t])}if(e&&void 0!==n)return n;const i=this.getBaseTargetFromProps(this.props,t);return void 0===i||Mi(i)?void 0!==this.initialValues[t]&&void 0===n?void 0:this.baseTarget[t]:i}on(t,e){return this.events[t]||(this.events[t]=new R),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){So.render(this.render)}}class ir extends nr{constructor(){super(...arguments),this.KeyframeResolver=eo}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){const n=t.style;return n?n[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Mi(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}class or{constructor(t){this.isMounted=!1,this.node=t}update(){}}function sr({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function rr({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function ar(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),i=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}function lr(t){return void 0===t||1===t}function cr({scale:t,scaleX:e,scaleY:n}){return!lr(t)||!lr(e)||!lr(n)}function ur(t){return cr(t)||hr(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function hr(t){return dr(t.x)||dr(t.y)}function dr(t){return t&&"0%"!==t}function pr(t,e,n){return n+e*(t-n)}function mr(t,e,n,i,o){return void 0!==o&&(t=pr(t,o,i)),pr(t,n,i)+e}function fr(t,e=0,n=1,i,o){t.min=mr(t.min,e,n,i,o),t.max=mr(t.max,e,n,i,o)}function gr(t,{x:e,y:n}){fr(t.x,e.translate,e.scale,e.originPoint),fr(t.y,n.translate,n.scale,n.originPoint)}const yr=.999999999999,vr=1.0000000000001;function xr(t,e,n,i=!1){const o=n.length;if(!o)return;let s,r;e.x=e.y=1;for(let a=0;ayr&&(e.x=1),e.yyr&&(e.y=1)}function wr(t,e){t.min+=e,t.max+=e}function Sr(t,e,n,i,o=.5){fr(t,e,n,qt(t.min,t.max,o),i)}function br(t,e){return"string"==typeof t?parseFloat(t)/100*(e.max-e.min):t}function Tr(t,e,n){const i=n??t;Sr(t.x,br(e.x,i.x),e.scaleX,e.scale,e.originX),Sr(t.y,br(e.y,i.y),e.scaleY,e.scale,e.originY)}function Pr(t,e){return sr(ar(t.getBoundingClientRect(),e))}function Er(t,e,n){const i=Pr(t,n),{scroll:o}=e;return o&&(wr(i.x,o.offset.x),wr(i.y,o.offset.y)),i}const Ar={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Mr=ln.length;function Cr(t,e,n){let i="",o=!0;for(let s=0;s{if(!e.target)return t;if("string"==typeof t){if(!Lt.test(t))return t;t=parseFloat(t)}return`${Dr(t,e.target.x)}% ${Dr(t,e.target.y)}%`}},Lr={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,o=Xt.parse(t);if(o.length>5)return i;const s=Xt.createTransformer(t),r="number"!=typeof o[0]?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;o[0+r]/=a,o[1+r]/=l;const c=qt(a,l,.5);return"number"==typeof o[2+r]&&(o[2+r]/=c),"number"==typeof o[3+r]&&(o[3+r]/=c),s(o)}},Br={borderRadius:{...Rr,applyTo:[...no]},borderTopLeftRadius:Rr,borderTopRightRadius:Rr,borderBottomLeftRadius:Rr,borderBottomRightRadius:Rr,boxShadow:Lr};function Or(t,{layout:e,layoutId:n}){return cn.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!Br[t]||"opacity"===t)}function jr(t,e,n){const i=t.style,o=e?.style,s={};if(!i)return s;for(const e in i)(Mi(i[e])||o&&Mi(o[e])||Or(e,t)||void 0!==n?.getValue(e)?.liveStyle)&&(s[e]=i[e]);return s}class Ir extends ir{constructor(){super(...arguments),this.type="html",this.renderInstance=kr}mount(e){t.invariant(Boolean(e.style),"motion.create() components must forward their ref to a HTML or SVG element","custom-component-ref"),super.mount(e)}readValueFromInstance(t,e){if(cn.has(e))return this.projection?.isProjecting?on(e):rn(t,e);{const i=(n=t,window.getComputedStyle(n)),o=(mt(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof o?o.trim():o}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return Pr(t,e)}build(t,e,n){Vr(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return jr(t,e,n)}}class Fr extends nr{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,e){if(function(t,e){return t in e}(e,t)){const n=t[e];if("string"==typeof n||"number"==typeof n)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(t,e){delete e.output[t]}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}build(t,e){Object.assign(t.output,e)}renderInstance(t,{output:e}){Object.assign(t,e)}sortInstanceNodePosition(){return 0}}const Wr={offset:"stroke-dashoffset",array:"stroke-dasharray"},$r={offset:"strokeDashoffset",array:"strokeDasharray"};function Nr(t,e,n=1,i=0,o=!0){t.pathLength=1;const s=o?Wr:$r;t[s.offset]=""+-i,t[s.array]=`${e} ${n}`}const Ur=["transform","opacity","offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function zr(t,{attrX:e,attrY:n,attrScale:i,pathLength:o,pathSpacing:s=1,pathOffset:r=0,...a},l,c,u){if(Vr(t,a,c),l)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:h,style:d}=t;for(const t of Ur)void 0!==h[t]&&(d[t]=h[t],delete h[t]);(d.transform||h.transformOrigin)&&(d.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),d.transform&&(d.transformBox=u?.transformBox??"fill-box",delete h.transformBox),void 0!==e&&(h.x=e),void 0!==n&&(h.y=n),void 0!==i&&(h.scale=i),void 0!==o&&Nr(h,o,s,r,!1)}const Yr=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),Hr=t=>"string"==typeof t&&"svg"===t.toLowerCase();function Xr(t,e,n,i){kr(t,e,void 0,i);for(const n in e.attrs)t.setAttribute(Yr.has(n)?n:ki(n),e.attrs[n])}function Gr(t,e,n){const i=jr(t,e,n);for(const n in t)if(Mi(t[n])||Mi(e[n])){i[-1!==ln.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]}return i}class Kr extends ir{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ws}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(cn.has(e)){const t=Zi(e);return t&&t.default||0}if(Ur.includes(e)){const n=getComputedStyle(t)[e];if("string"==typeof n&&n)return n.trim()}return e=Yr.has(e)?e:ki(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return Gr(t,e,n)}build(t,e,n){zr(t,e,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,e,n,i){Xr(t,e,0,i)}mount(t){this.isSVGTag=Hr(t.tagName),super.mount(t)}}const _r=Ys.length;function qr(t){if(!t)return;if(!t.isControllingVariants){const e=t.parent&&qr(t.parent)||{};return void 0!==t.props.initial&&(e.initial=t.props.initial),e}const e={};for(let n=0;n<_r;n++){const i=Ys[n],o=t.props[i];(Us(o)||!1===o)&&(e[i]=o)}return e}function Zr(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let i=0;iPromise.all(e.map(({animation:e,options:n})=>Ii(t,e,n)))}(t),n=ia(),i=!0,o=!1;const s=e=>(n,i)=>{const o=Si(t,i,"exit"===e?t.presenceContext?.custom:void 0);if(o){const{transition:t,transitionEnd:e,...i}=o;n={...n,...i,...e}}return n};function r(r){const{props:a}=t,l=qr(t.parent)||{},c=[],u=new Set;let h={},d=1/0;for(let e=0;ed&&g,S=!1;const b=Array.isArray(f)?f:[f];let T=b.reduce(s(p),{});!1===y&&(T={});const{prevResolvedValues:P={}}=m,E={...P,...T},A=e=>{w=!0,u.has(e)&&(S=!0,u.delete(e)),m.needsAnimating[e]=!0;const n=t.getValue(e);n&&(n.liveStyle=!1)};for(const t in E){const e=T[t],n=P[t];if(h.hasOwnProperty(t))continue;let i=!1;i=Ti(e)&&Ti(n)?!Zr(e,n)||x:e!==n,i?null!=e?A(t):u.add(t):void 0!==e&&u.has(t)?A(t):m.protectedKeys[t]=!0}m.prevProp=f,m.prevResolvedValues=T,m.isActive&&(h={...h,...T}),(i||o)&&t.blockInitialAnimation&&(w=!1);const M=v&&x;w&&(!M||S)&&c.push(...b.map(e=>{const n={type:p};if("string"==typeof e&&(i||o)&&!M&&t.manuallyAnimateOnMount&&t.parent){const{parent:i}=t,o=Si(i,e);if(i.enteringChildren&&o){const{delayChildren:e}=o.transition||{};n.delay=ti(i.enteringChildren,t,e)}}return{animation:e,options:n}}))}if(u.size){const e={};if("boolean"!=typeof a.initial){const n=Si(t,Array.isArray(a.initial)?a.initial[0]:a.initial);n&&n.transition&&(e.transition=n.transition)}u.forEach(n=>{const i=t.getBaseTarget(n),o=t.getValue(n);o&&(o.liveStyle=!0),e[n]=i??null}),c.push({animation:e})}let p=Boolean(c.length);return!i||!1!==a.initial&&a.initial!==a.animate||t.manuallyAnimateOnMount||(p=!1),i=!1,o=!1,p?e(c):Promise.resolve()}return{animateChanges:r,setActive:function(e,i){if(n[e].isActive===i)return Promise.resolve();t.variantChildren?.forEach(t=>t.animationState?.setActive(e,i)),n[e].isActive=i;const o=r(e);for(const t in n)n[t].protectedKeys={};return o},setAnimateFunction:function(n){e=n(t)},getState:()=>n,reset:()=>{n=ia(),o=!0}}}function ea(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!Zr(e,t)}function na(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function ia(){return{animate:na(!0),whileInView:na(),whileHover:na(),whileTap:na(),whileDrag:na(),whileFocus:na(),exit:na()}}function oa(t,e){t.min=e.min,t.max=e.max}function sa(t,e){oa(t.x,e.x),oa(t.y,e.y)}function ra(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function aa(t){return t.max-t.min}function la(t,e,n){return Math.abs(t-e)<=n}function ca(t,e,n,i=.5){t.origin=i,t.originPoint=qt(e.min,e.max,t.origin),t.scale=aa(n)/aa(e),t.translate=qt(n.min,n.max,t.origin)-t.originPoint,(t.scale>=.9999&&t.scale<=1.0001||isNaN(t.scale))&&(t.scale=1),(t.translate>=-.01&&t.translate<=.01||isNaN(t.translate))&&(t.translate=0)}function ua(t,e,n,i){ca(t.x,e.x,n.x,i?i.originX:void 0),ca(t.y,e.y,n.y,i?i.originY:void 0)}function ha(t,e,n,i=0){const o=i?qt(n.min,n.max,i):n.min;t.min=o+e.min,t.max=t.min+aa(e)}function da(t,e,n,i){ha(t.x,e.x,n.x,i?.x),ha(t.y,e.y,n.y,i?.y)}function pa(t,e,n,i=0){const o=i?qt(n.min,n.max,i):n.min;t.min=e.min-o,t.max=t.min+aa(e)}function ma(t,e,n,i){pa(t.x,e.x,n.x,i?.x),pa(t.y,e.y,n.y,i?.y)}function fa(t,e,n,i,o){return t=pr(t-=e,1/n,i),void 0!==o&&(t=pr(t,1/o,i)),t}function ga(t,e=0,n=1,i=.5,o,s=t,r=t){if(Rt.test(e)){e=parseFloat(e);e=qt(r.min,r.max,e/100)-r.min}if("number"!=typeof e)return;let a=qt(s.min,s.max,i);t===s&&(a-=e),t.min=fa(t.min,e,n,a,o),t.max=fa(t.max,e,n,a,o)}function ya(t,e,[n,i,o],s,r){ga(t,e[n],e[i],e[o],e.scale,s,r)}const va=["x","scaleX","originX"],xa=["y","scaleY","originY"];function wa(t,e,n,i){ya(t.x,e,va,n?n.x:void 0,i?i.x:void 0),ya(t.y,e,xa,n?n.y:void 0,i?i.y:void 0)}function Sa(t){return 0===t.translate&&1===t.scale}function ba(t){return Sa(t.x)&&Sa(t.y)}function Ta(t,e){return t.min===e.min&&t.max===e.max}function Pa(t,e){return Ta(t.x,e.x)&&Ta(t.y,e.y)}function Ea(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Aa(t,e){return Ea(t.x,e.x)&&Ea(t.y,e.y)}function Ma(t){return aa(t.x)/aa(t.y)}function Ca(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function Va(t){return[t("x"),t("y")]}function ka(t,e,n){let i="";const o=t.x.translate/e.x,s=t.y.translate/e.y,r=n?.z||0;if((o||s||r)&&(i=`translate3d(${o}px, ${s}px, ${r}px) `),1===e.x&&1===e.y||(i+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:t,rotate:e,pathRotation:o,rotateX:s,rotateY:r,skewX:a,skewY:l}=n;t&&(i=`perspective(${t}px) ${i}`),e&&(i+=`rotate(${e}deg) `),o&&(i+=`rotate(${o}deg) `),s&&(i+=`rotateX(${s}deg) `),r&&(i+=`rotateY(${r}deg) `),a&&(i+=`skewX(${a}deg) `),l&&(i+=`skewY(${l}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return 1===a&&1===l||(i+=`scale(${a}, ${l})`),i||"none"}const Da=no.length,Ra=t=>"string"==typeof t?parseFloat(t):t,La=t=>"number"==typeof t||Lt.test(t);function Ba(t,e,n,i,o,s){o?(t.opacity=qt(0,n.opacity??1,ja(i)),t.opacityExit=qt(e.opacity??1,0,Ia(i))):s&&(t.opacity=qt(e.opacity??1,n.opacity??1,i));for(let o=0;oie?1:n(D(t,e,i))}function Wa(t,e,n){const i=Mi(t)?t:ii(t);return i.start(di("",i,e,n)),i.animation}function $a(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n,i)}const Na=(t,e)=>t.depth-e.depth;class Ua{constructor(){this.children=[],this.isDirty=!1}add(t){x(this.children,t),this.isDirty=!0}remove(t){w(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Na),this.isDirty=!1,this.children.forEach(t)}}function za(t,e){const n=dt.now(),i=({timestamp:o})=>{const s=o-n;s>=e&&(at(i),t(s-e))};return rt.setup(i,!0),()=>at(i)}function Ya(t){return Mi(t)?t.get():t}class Ha{constructor(){this.members=[]}add(t){x(this.members,t);for(let e=this.members.length-1;e>=0;e--){const n=this.members[e];if(n===t||n===this.lead||n===this.prevLead)continue;const i=n.instance;i&&!1!==i.isConnected||n.snapshot||(w(this.members,n),n.unmount())}t.scheduleRender()}remove(t){if(w(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){for(let e=this.members.indexOf(t)-1;e>=0;e--){const t=this.members[e];if(!1!==t.isPresent&&!1!==t.instance?.isConnected)return this.promote(t),!0}return!1}promote(t,e){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.updateSnapshot(),t.scheduleRender();const{layoutDependency:i}=n.options,{layoutDependency:o}=t.options;void 0!==i&&i===o||(t.resumeFrom=n,e&&(n.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root?.isUpdating&&(t.isLayoutDirty=!0)),!1===t.options.crossfade&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{t.options.onExitComplete?.(),t.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}const Xa={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Ga={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},Ka=["","X","Y","Z"];let _a=0;function qa(t,e,n,i){const{latestValues:o}=e;o[t]&&(n[t]=o[t],e.setStaticValue(t,0),i&&(i[t]=0))}function Za(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=Li(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:e,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",rt,!(e||i))}const{parent:i}=t;i&&!i.hasCheckedOptimisedAppear&&Za(i)}function Ja({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:i,resetTransform:o}){return class{constructor(t={},n=e?.()){this.id=_a++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,es.value&&(Ga.nodes=Ga.calculatedTargetDeltas=Ga.calculatedProjections=0),this.nodes.forEach(el),this.nodes.forEach(ul),this.nodes.forEach(hl),this.nodes.forEach(nl),es.addProjectionMetrics&&es.addProjectionMetrics(Ga)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=t,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let t=0;tthis.root.updateBlockedByResize=!1;rt.read(()=>{i=window.innerWidth}),t(e,()=>{const t=window.innerWidth;t!==i&&(i=t,this.root.updateBlockedByResize=!0,n&&n(),n=za(o,250),Xa.hasAnimatedSinceResize&&(Xa.hasAnimatedSinceResize=!1,this.nodes.forEach(cl)))})}n&&this.root.registerSharedNode(n,this),!1!==this.options.animate&&o&&(n||i)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeLayoutChanged:n,layout:i})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const s=this.options.transition||o.getDefaultTransition()||yl,{onLayoutAnimationStart:r,onLayoutAnimationComplete:a}=o.getProps(),l=!this.targetLayout||!Aa(this.targetLayout,i),c=!e&&n;if(this.options.layoutRoot||this.resumeFrom||c||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const e={...si(s,"layout"),onPlay:r,onComplete:a};(o.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e),this.setAnimationOrigin(t,c,e.path)}else e||cl(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=i})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const t=this.getStack();t&&t.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),at(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(dl),this.animationId++)}getTransformTemplate(){const{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Za(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||aa(this.snapshot.measuredBox.x)||aa(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;t{const n=e/1e3,i=p?.(n);i?(r.x.translate=i.x,r.x.scale=qt(t.x.scale,1,n),r.x.origin=t.x.origin,r.x.originPoint=t.x.originPoint,r.y.translate=i.y,r.y.scale=qt(t.y.scale,1,n),r.y.origin=t.y.origin,r.y.originPoint=t.y.originPoint):(ml(r.x,t.x,n),ml(r.y,t.y,n)),this.setTargetDelta(r),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ma(a,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),function(t,e,n,i){fl(t.x,e.x,n.x,i),fl(t.y,e.y,n.y,i)}(this.relativeTarget,this.relativeTargetOrigin,a,n),d&&Pa(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||(d={x:{min:0,max:0},y:{min:0,max:0}}),sa(d,this.relativeTarget)),l&&(this.animationValues=s,Ba(s,o,this.latestValues,n,h,u)),i&&void 0!==i.rotate&&(this.animationValues||(this.animationValues=s),this.animationValues.pathRotation=i.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(t){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(at(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=rt.update(()=>{Xa.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=ii(0)),this.motionValue.jump(0,!1),this.currentAnimation=Wa(this.motionValue,[0,1e3],{...t,velocity:0,isSync:!0,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onComplete:()=>{t.onComplete&&t.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const t=this.getStack();t&&t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead();let{targetWithTransforms:e,target:n,layout:i,latestValues:o}=t;if(e&&n&&i){if(this!==t&&this.layout&&i&&Sl(this.options.animationType,this.layout.layoutBox,i.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=aa(this.layout.layoutBox.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const i=aa(this.layout.layoutBox.y);n.y.min=t.target.y.min,n.y.max=n.y.min+i}sa(e,n),Tr(e,o),ua(this.projectionDeltaWithTransform,this.layoutCorrected,e,o)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new Ha);this.sharedNodes.get(t).add(e);const n=e.options.initialPromotionConfig;e.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(e):void 0})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){const{layoutId:t}=this.options;return t&&this.getStack()?.lead||this}getPrevLead(){const{layoutId:t}=this.options;return t?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:n}={}){const i=this.getStack();i&&i.promote(this,n),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetSkewAndRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const{latestValues:n}=t;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(e=!0),!e)return;const i={};n.z&&qa("z",t,i,this.animationValues);for(let e=0;et.currentAnimation?.stop()),this.root.nodes.forEach(ol),this.root.sharedNodes.clear()}}}function Qa(t){t.updateLayout()}function tl(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=t.layout,{animationType:o}=t.options,s=e.source!==t.layout.source;if("size"===o)Va(t=>{const i=s?e.measuredBox[t]:e.layoutBox[t],o=aa(i);i.min=n[t].min,i.max=i.min+o});else if("x"===o||"y"===o){const t="x"===o?"y":"x";oa(s?e.measuredBox[t]:e.layoutBox[t],n[t])}else Sl(o,e.layoutBox,n)&&Va(i=>{const o=s?e.measuredBox[i]:e.layoutBox[i],r=aa(n[i]);o.max=o.min+r,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[i].max=t.relativeTarget[i].min+r)});const r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};ua(r,n,e.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};s?ua(a,t.applyTransform(i,!0),e.measuredBox):ua(a,n,e.layoutBox);const l=!ba(r);let c=!1;if(!t.resumeFrom){const i=t.getClosestProjectingParent();if(i&&!i.resumeFrom){const{snapshot:o,layout:s}=i;if(o&&s){const r=t.options.layoutAnchor||void 0,a={x:{min:0,max:0},y:{min:0,max:0}};ma(a,e.layoutBox,o.layoutBox,r);const l={x:{min:0,max:0},y:{min:0,max:0}};ma(l,n,s.layoutBox,r),Aa(a,l)||(c=!0),i.options.layoutRoot&&(t.relativeTarget=l,t.relativeTargetOrigin=a,t.relativeParent=i)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:a,layoutDelta:r,hasLayoutChanged:l,hasRelativeLayoutChanged:c})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function el(t){es.value&&Ga.nodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=Boolean(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function nl(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function il(t){t.clearSnapshot()}function ol(t){t.clearMeasurements()}function sl(t){t.isLayoutDirty=!0,t.updateLayout()}function rl(t){t.isLayoutDirty=!1}function al(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function ll(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function cl(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function ul(t){t.resolveTargetDelta()}function hl(t){t.calcProjection()}function dl(t){t.resetSkewAndRotation()}function pl(t){t.removeLeadSnapshot()}function ml(t,e,n){t.translate=qt(e.translate,0,n),t.scale=qt(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function fl(t,e,n,i){t.min=qt(e.min,n.min,i),t.max=qt(e.max,n.max,i)}function gl(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const yl={duration:.45,ease:[.4,0,.1,1]},vl=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),xl=vl("applewebkit/")&&!vl("chrome/")?Math.round:V;function wl(t){t.min=xl(t.min),t.max=xl(t.max)}function Sl(t,e,n){return"position"===t||"preserve-aspect"===t&&!la(Ma(e),Ma(n),.2)}function bl(t){return t!==t.root&&t.scroll?.wasRoot}const Tl=Ja({attachResizeListener:(t,e)=>$a(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Pl=t=>!t.isLayoutDirty&&t.willUpdate(!1);function El(){const t=new Set,e=new WeakMap,n=()=>t.forEach(Pl);return{add:i=>{t.add(i),e.set(i,i.addEventListener("willUpdate",n))},remove:i=>{t.delete(i);const o=e.get(i);o&&(o(),e.delete(i)),n()},dirty:n}}const Al={current:void 0},Ml=Ja({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Al.current){const t=new Tl({});t.mount(window),t.setOptions({layoutScroll:!0}),Al.current=t}return Al.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),Cl="[data-layout],[data-layout-id]",Vl=new WeakMap;let kl;function Dl(t){const e=[];return t instanceof HTMLElement&&t.matches(Cl)&&e.push(t),t.querySelectorAll(Cl).forEach(t=>{t instanceof HTMLElement&&e.push(t)}),e}function Rl(t,e){const n=t.getAttribute("data-layout");return{layoutId:t.getAttribute("data-layout-id")??void 0,layout:null!==n||void 0,animationType:n&&"true"!==n?n:"both",transition:e}}function Ll(t,e){let n=Vl.get(t);if(n)n.setOptions(Rl(t,e));else{let i=$s.get(t);i||(i=new Ir({props:{},presenceContext:null,visualState:{latestValues:{},renderState:{transform:{},transformOrigin:{},style:{},vars:{}}}},{allowProjection:!0})),t.style.transform&&!ur(i.latestValues)&&(t.style.transform=""),n=new Ml(i.latestValues,function(t){let e=t.parentElement;for(;e;){const t=Vl.get(e);if(t&&t.instance)return t;e=e.parentElement}}(t)),i.projection=n,n.setOptions({...Rl(t,e),visualElement:i}),n.mount(t),Vl.set(t,n)}return n.isPresent=!0,n.options.onExitComplete&&n.setOptions({onExitComplete:void 0}),n}function Bl(t,e){e.setOptions({onExitComplete:void 0});e.getStack()&&!e.isLead()||e.currentAnimation?.stop(),e.unmount(),Vl.delete(t)}function Ol(){const t=kl;kl=void 0,function(){if(lt.isProcessing)return;const t=dt.now();lt.delta=b(0,1e3/60,t-lt.timestamp),lt.timestamp=t,lt.isProcessing=!0,ct.update.process(lt),ct.preRender.process(lt),ct.render.process(lt),lt.isProcessing=!1}();const e=new Map;for(const n of t)for(const t of n.collectTargets()){const i=e.get(t);i?i.push(n):e.set(t,[n])}const n=new Map;for(const t of(i=e.keys(),[...i].sort((t,e)=>t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1))){const i=e.get(t),o=Ll(t,i[i.length-1].transitionFor(t));for(const e of i)e.adopt(t,o);n.set(t,o)}var i;n.forEach(t=>{t.isLayoutDirty=!1,t.willUpdate()});const o=[];for(const e of t){const t=e.runUpdate();t&&o.push(t)}const s=()=>{const e=new Set;for(const n of t)n.reconcileAdditions(e);for(const n of t)n.reconcileRemovals(e);let i;n.forEach(t=>i||(i=t.root));for(const e of t)i||(i=e.getRoot());i?.didUpdate(),So.render(()=>{for(const e of t)e.finalize()})};o.length?Promise.all(o).then(s):s()}const jl=rt,Il=ot.reduce((t,e)=>(t[e]=t=>at(t),t),{}),Fl=e.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function Wl(t,e){if("function"==typeof t)return t(e);null!=t&&(t.current=e)}function $l(...t){return i.useCallback(function(...t){return e=>{let n=!1;const i=t.map(t=>{const i=Wl(t,e);return n||"function"!=typeof i||(n=!0),i});if(n)return()=>{for(let e=0;e{const{width:t,height:e,top:i,left:d,right:p,bottom:m,direction:f}=u.current;if(n||!1===a||!c.current||!t||!e)return;const g="rtl"===f,y="left"===o?g?`right: ${p}`:`left: ${d}`:g?`left: ${d}`:`right: ${p}`,v="bottom"===s?`bottom: ${m}`:`top: ${i}`;c.current.dataset.motionPopId=l;const x=document.createElement("style");h&&(x.nonce=h);const w=r??document.head;return w.appendChild(x),x.sheet&&x.sheet.insertRule(`\n [data-motion-pop-id="${l}"] {\n position: absolute !important;\n width: ${t}px !important;\n height: ${e}px !important;\n ${y}px !important;\n ${v}px !important;\n }\n `),()=>{c.current?.removeAttribute("data-motion-pop-id"),w.contains(x)&&w.removeChild(x)}},[n]),d(Nl,{isPresent:n,childRef:c,sizeRef:u,pop:a,children:!1===a?t:i.cloneElement(t,{ref:m})})}const zl=({children:t,initial:n,isPresent:o,onExitComplete:s,custom:r,presenceAffectsLayout:a,mode:l,anchorX:c,anchorY:u,root:h})=>{const p=f(Yl),m=e.useId(),g=e.useRef(o),x=e.useRef(s);y(()=>{g.current=o,x.current=s});let w=!0,S=e.useMemo(()=>(w=!1,{id:m,initial:n,isPresent:o,custom:r,onExitComplete:t=>{p.set(t,!0);for(const t of p.values())if(!t)return;s&&s()},register:t=>(p.set(t,!1),()=>{p.delete(t),!g.current&&!p.size&&x.current?.()})}),[o,p,s]);return a&&w&&(S={...S}),e.useMemo(()=>{p.forEach((t,e)=>p.set(e,!1))},[o]),i.useEffect(()=>{!o&&!p.size&&s&&s()},[o]),t=d(Ul,{pop:"popLayout"===l,isPresent:o,anchorX:c,anchorY:u,root:h,children:t}),d(v.Provider,{value:S,children:t})};function Yl(){return new Map}function Hl(t=!0){const n=e.useContext(v);if(null===n)return[!0,null];const{isPresent:i,onExitComplete:o,register:s}=n,r=e.useId();e.useEffect(()=>{if(t)return s(r)},[t]);const a=e.useCallback(()=>t&&o&&o(r),[r,o,t]);return!i&&o?[!1,a]:[!0]}const Xl=t=>t.key||"";function Gl(t){const n=[];return e.Children.forEach(t,t=>{e.isValidElement(t)&&n.push(t)}),n}const Kl=e.createContext(null);function _l(){const t=function(){const t=e.useRef(!1);return y(()=>(t.current=!0,()=>{t.current=!1}),[]),t}(),[n,i]=e.useState(0),o=e.useCallback(()=>{t.current&&i(n+1)},[n]);return[e.useCallback(()=>rt.postRender(o),[o]),n]}const ql=t=>!0===t,Zl=({children:t,id:n,inherit:i=!0})=>{const o=e.useContext(m),s=e.useContext(Kl),[r,a]=_l(),l=e.useRef(null),c=o.id||s;null===l.current&&((t=>ql(!0===t)||"id"===t)(i)&&c&&(n=n?c+"-"+n:c),l.current={id:n,group:ql(i)&&o.group||El()});const u=e.useMemo(()=>({...l.current,forceRender:r}),[a]);return d(m.Provider,{value:u,children:t})},Jl=e.createContext({strict:!1}),Ql={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let tc=!1;function ec(){return function(){if(tc)return;const t={};for(const e in Ql)t[e]={isEnabled:t=>Ql[e].some(e=>!!t[e])};tr(t),tc=!0}(),er()}function nc(t){const e=ec();for(const n in t)e[n]={...e[n],...t[n]};tr(e)}function ic(t){return"function"==typeof t}const oc=e.createContext(null),sc=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function rc(t){return"string"==typeof t&&!t.includes("-")&&!!(sc.indexOf(t)>-1||/[A-Z]/u.test(t))}const ac=(t,n)=>n.isSVG??rc(t)?new Kr(n):new Ir(n,{allowProjection:t!==e.Fragment}),lc=e.createContext({});function cc(t){const{initial:n,animate:i}=function(t,e){if(Hs(t)){const{initial:e,animate:n}=t;return{initial:!1===e||Us(e)?e:void 0,animate:Us(n)?n:void 0}}return!1!==t.inherit?e:{}}(t,e.useContext(lc));return e.useMemo(()=>({initial:n,animate:i}),[uc(n),uc(i)])}function uc(t){return Array.isArray(t)?t.join(" "):t}const hc=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function dc(t,e,n){for(const i in e)Mi(e[i])||Or(i,n)||(t[i]=e[i])}function pc(t,n){const i={};return dc(i,t.style||{},t),Object.assign(i,function({transformTemplate:t},n){return e.useMemo(()=>{const e={style:{},transform:{},transformOrigin:{},vars:{}};return Vr(e,n,t),Object.assign({},e.vars,e.style)},[n])}(t,n)),i}function mc(t,e){const n={},i=pc(t,e);return t.drag&&!1!==t.dragListener&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),void 0===t.tabIndex&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=i,n}const fc=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}});function gc(t,n,i,o){const s=e.useMemo(()=>{const e={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return zr(e,n,Hr(o),t.transformTemplate,t.style),{...e.attrs,style:{...e.style}}},[n]);if(t.style){const e={};dc(e,t.style,t),s.style={...e,...s.style}}return s}const yc=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function vc(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||yc.has(t)}function xc(t,e){return t.startsWith("on")?!vc(t):e?.(t)??!vc(t)}function wc(t,e,n,i){const o={};for(const s in t)"values"===s&&"object"==typeof t.values||Mi(t[s])||(xc(s,i)||!0===n&&vc(s)||!e&&!vc(s)||t.draggable&&s.startsWith("onDrag"))&&(o[s]=t[s]);return o}function Sc(t,n,i,{latestValues:o},s,r=!1,a,l){const c=(a??rc(t)?gc:mc)(n,o,s,t),u=wc(n,"string"==typeof t,r,l),h=t!==e.Fragment?{...u,...c,ref:i}:{},{children:d}=n,p=e.useMemo(()=>Mi(d)?d.get():d,[d]);return e.createElement(t,{...h,children:p})}function bc(t,e,n,i){const o={},s=i(t,{});for(const t in s)o[t]=Ya(s[t]);let{initial:r,animate:a}=t;const l=Hs(t),c=Xs(t);e&&c&&!l&&!1!==t.inherit&&(void 0===r&&(r=e.initial),void 0===a&&(a=e.animate));let u=!!n&&!1===n.initial;u=u||!1===r;const h=u?a:r;if(h&&"boolean"!=typeof h&&!Ns(h)){const e=Array.isArray(h)?h:[h];for(let n=0;n(n,i)=>{const o=e.useContext(lc),s=e.useContext(v),r=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e},n,i,o){return{latestValues:bc(n,i,o,t),renderState:e()}}(t,n,o,s);return i?r():f(r)},Pc=Tc({scrapeMotionValuesFromProps:jr,createRenderState:hc}),Ec=Tc({scrapeMotionValuesFromProps:Gr,createRenderState:fc}),Ac=Symbol.for("motionComponentSymbol");function Mc(t,n,i){const o=e.useRef(i);e.useInsertionEffect(()=>{o.current=i});const s=e.useRef(null);return e.useCallback(e=>{e&&t.onMount?.(e),n&&(e?n.mount(e):n.unmount());const i=o.current;if("function"==typeof i)if(e){const t=i(e);"function"==typeof t&&(s.current=t)}else s.current?(s.current(),s.current=null):i(e);else i&&(i.current=e)},[n])}const Cc=e.createContext({});function Vc(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function kc(t,n,i,o,s,r){const{visualElement:a}=e.useContext(lc),l=e.useContext(Jl),c=e.useContext(v),u=e.useContext(Fl),h=u.reducedMotion,d=u.skipAnimations,p=e.useRef(null),m=e.useRef(!1);o=o||l.renderer,!p.current&&o&&(p.current=o(t,{visualState:n,parent:a,props:i,presenceContext:c,blockInitialAnimation:!!c&&!1===c.initial,reducedMotionConfig:h,skipAnimations:d,isSVG:r}),m.current&&p.current&&(p.current.manuallyAnimateOnMount=!0));const f=p.current,g=e.useContext(Cc);!f||f.projection||!s||"html"!==f.type&&"svg"!==f.type||function(t,e,n,i){const{layoutId:o,layout:s,drag:r,dragConstraints:a,layoutScroll:l,layoutRoot:c,layoutAnchor:u,layoutCrossfade:h}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:Dc(t.parent)),t.projection.setOptions({layoutId:o,layout:s,alwaysMeasureLayout:Boolean(r)||a&&Vc(a),visualElement:t,animationType:"string"==typeof s?s:"both",initialPromotionConfig:i,crossfade:h,layoutScroll:l,layoutRoot:c,layoutAnchor:u})}(p.current,i,s,g);const x=e.useRef(!1);e.useInsertionEffect(()=>{f&&x.current&&f.update(i,c)});const w=i[Ri],S=e.useRef(Boolean(w)&&"undefined"!=typeof window&&!window.MotionHandoffIsComplete?.(w)&&window.MotionHasOptimisedAnimation?.(w));return y(()=>{m.current=!0,f&&(x.current=!0,window.MotionIsMounted=!0,f.updateFeatures(),f.scheduleRenderMicrotask(),S.current&&f.animationState&&f.animationState.animateChanges())}),e.useEffect(()=>{f&&(!S.current&&f.animationState&&f.animationState.animateChanges(),S.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(w)}),S.current=!1),f.enteringChildren=void 0)}),f}function Dc(t){if(t)return!1!==t.options.allowProjection?t.projection:Dc(t.parent)}function Rc(t,{forwardMotionProps:n=!1,type:i}={},o,s){o&&nc(o);const r=i?"svg"===i:rc(t),a=r?Ec:Pc;function l(i,o){let l;const c={...e.useContext(Fl),...i,layoutId:Lc(i)},{isStatic:u,isValidProp:h}=c,m=cc(i),f=a(i,u);if(!u&&"undefined"!=typeof window){e.useContext(Jl).strict;const n=function(t){const e=ec(),{drag:n,layout:i}=e;if(!n&&!i)return{};const o={...n,...i};return{MeasureLayout:n?.isEnabled(t)||i?.isEnabled(t)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}(c);l=n.MeasureLayout,m.visualElement=kc(t,f,c,s,n.ProjectionNode,r)}return p(lc.Provider,{value:m,children:[l&&m.visualElement?d(l,{visualElement:m.visualElement,...c}):null,Sc(t,i,Mc(f,m.visualElement,o),f,u,n,r,h)]})}l.displayName=`motion.${"string"==typeof t?t:`create(${t.displayName??t.name??""})`}`;const c=e.forwardRef(l);return c[Ac]=t,c}function Lc({layoutId:t}){const n=e.useContext(m).id;return n&&void 0!==t?n+"-"+t:t}function Bc(t,e){if("undefined"==typeof Proxy)return Rc;const n=new Map,i=(n,i)=>Rc(n,i,t,e);return new Proxy((t,e)=>i(t,e),{get:(o,s)=>"create"===s?i:(n.has(s)||n.set(s,Rc(s,void 0,t,e)),n.get(s))})}let Oc=0;const jc={animation:{Feature:class extends or{constructor(t){super(t),t.animationState||(t.animationState=ta(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Ns(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}},exit:{Feature:class extends or{constructor(){super(...arguments),this.id=Oc++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:e}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===n)return;if(t&&!1===n){if(this.isExitComplete){const{initial:t,custom:e}=this.node.getProps();if("string"==typeof t||"object"==typeof t&&null!==t&&!Array.isArray(t)){const n=Si(this.node,t,e);if(n){const{transition:t,transitionEnd:e,...i}=n;for(const t in i)this.node.getValue(t)?.jump(i[t])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);return void(this.isExitComplete=!1)}const i=this.node.animationState.setActive("exit",!t);e&&!t&&i.then(()=>{this.isExitComplete=!0,e(this.id)})}mount(){const{register:t,onExitComplete:e}=this.node.presenceContext||{};e&&e(this.id),t&&(this.unmount=t(this.id))}unmount(){}}}};function Ic(t){return{point:{x:t.pageX,y:t.pageY}}}const Fc=t=>e=>Vo(e)&&t(e,Ic(e));function Wc(t,e,n,i){return $a(t,e,Fc(n),i)}const $c=({current:t})=>t?t.ownerDocument.defaultView:null,Nc=(t,e)=>Math.abs(t-e);function Uc(t,e){const n=Nc(t.x,e.x),i=Nc(t.y,e.y);return Math.sqrt(n**2+i**2)}const zc=new Set(["auto","scroll"]);class Yc{constructor(t,e,{transformPagePoint:n,contextWindow:i=window,dragSnapToOrigin:o=!1,distanceThreshold:s=3,element:r}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=t=>{this.handleScroll(t.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Hc(this.lastRawMoveEventInfo,this.transformPagePoint));const t=Gc(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=Uc(t.offset,{x:0,y:0})>=this.distanceThreshold;if(!e&&!n)return;const{point:i}=t,{timestamp:o}=lt;this.history.push({...i,timestamp:o});const{onStart:s,onMove:r}=this.handlers;e||(s&&s(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),r&&r(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastRawMoveEventInfo=e,this.lastMoveEventInfo=Hc(e,this.transformPagePoint),rt.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();const{onEnd:n,onSessionEnd:i,resumeAnimation:o}=this.handlers;if(!this.dragSnapToOrigin&&this.startEvent||o&&o(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const s=Gc("pointercancel"===t.type?this.lastMoveEventInfo:Hc(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,s),i&&i(t,s)},!Vo(t))return;this.dragSnapToOrigin=o,this.handlers=e,this.transformPagePoint=n,this.distanceThreshold=s,this.contextWindow=i||window;const a=Hc(Ic(t),this.transformPagePoint),{point:l}=a,{timestamp:c}=lt;this.history=[{...l,timestamp:c}];const{onSessionStart:u}=e;u&&u(t,Gc(a,this.history));const h={passive:!0,capture:!0};this.removeListeners=k(Wc(this.contextWindow,"pointermove",this.handlePointerMove,h),Wc(this.contextWindow,"pointerup",this.handlePointerUp,h),Wc(this.contextWindow,"pointercancel",this.handlePointerUp,h)),r&&this.startScrollTracking(r)}startScrollTracking(t){let e=t.parentElement;for(;e;){const t=getComputedStyle(e);(zc.has(t.overflowX)||zc.has(t.overflowY))&&this.scrollPositions.set(e,{x:e.scrollLeft,y:e.scrollTop}),e=e.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const e=this.scrollPositions.get(t);if(!e)return;const n=t===window,i=n?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},o=i.x-e.x,s=i.y-e.y;0===o&&0===s||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=o,this.lastMoveEventInfo.point.y+=s):this.history.length>0&&(this.history[0].x-=o,this.history[0].y-=s),this.scrollPositions.set(t,i),rt.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),at(this.updatePoint)}}function Hc(t,e){return e?{point:e(t.point)}:t}function Xc(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Gc({point:t},e){return{point:t,delta:Xc(t,_c(e)),offset:Xc(t,Kc(e)),velocity:qc(e,.1)}}function Kc(t){return t[0]}function _c(t){return t[t.length-1]}function qc(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const o=_c(t);for(;n>=0&&(i=t[n],!(o.timestamp-i.timestamp>L(e)));)n--;if(!i)return{x:0,y:0};i===t[0]&&t.length>2&&o.timestamp-i.timestamp>2*L(e)&&(i=t[1]);const s=B(o.timestamp-i.timestamp);if(0===s)return{x:0,y:0};const r={x:(o.x-i.x)/s,y:(o.y-i.y)/s};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function Zc(t,e,n){return{min:void 0!==e?t.min+e:void 0,max:void 0!==n?t.max+n-(t.max-t.min):void 0}}function Jc(t,e){let n=e.min-t.min,i=e.max-t.max;return e.max-e.min{e&&this.snapToCursor(Ic(t).point),this.stopAnimation()},onStart:(t,e)=>{const{drag:n,dragPropagation:i,onDragStart:o}=this.getProps();if(n&&!i&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Eo(n),!this.openDragLock))return;this.latestPointerEvent=t,this.latestPanInfo=e,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Va(t=>{let e=this.getAxisMotionValue(t).get()||0;if(Rt.test(e)){const{projection:n}=this.visualElement;if(n&&n.layout){const i=n.layout.layoutBox[t];if(i){e=aa(i)*(parseFloat(e)/100)}}}this.originPoint[t]=e}),o&&rt.update(()=>o(t,e),!1,!0),Vi(this.visualElement,"transform");const{animationState:s}=this.visualElement;s&&s.setActive("whileDrag",!0)},onMove:(t,e)=>{this.latestPointerEvent=t,this.latestPanInfo=e;const{dragPropagation:n,dragDirectionLock:i,onDirectionLock:o,onDrag:s}=this.getProps();if(!n&&!this.openDragLock)return;const{offset:r}=e;if(i&&null===this.currentDirection)return this.currentDirection=function(t,e=10){let n=null;Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x");return n}(r),void(null!==this.currentDirection&&o&&o(this.currentDirection));this.updateAxis("x",e.point,r),this.updateAxis("y",e.point,r),this.visualElement.render(),s&&rt.update(()=>s(t,e),!1,!0)},onSessionEnd:(t,e)=>{this.latestPointerEvent=t,this.latestPanInfo=e,this.stop(t,e),this.latestPointerEvent=null,this.latestPanInfo=null},resumeAnimation:()=>{const{dragSnapToOrigin:t}=this.getProps();(t||this.constraints)&&this.startAnimation({x:0,y:0})}},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:o,distanceThreshold:n,contextWindow:$c(this.visualElement),element:this.visualElement.current})}stop(t,e){const n=t||this.latestPointerEvent,i=e||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!i||!n)return;const{velocity:s}=i;this.startAnimation(s);const{onDragEnd:r}=this.getProps();r&&rt.postRender(()=>r(n,i))}cancel(){this.isDragging=!1;const{projection:t,animationState:e}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),e&&e.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,e,n){const{drag:i}=this.getProps();if(!n||!su(t,i,this.currentDirection))return;const o=this.getAxisMotionValue(t);let s=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(s=function(t,{min:e,max:n},i){return void 0!==e&&tn&&(t=i?qt(n,t,i.max):Math.min(t,n)),t}(s,this.constraints[t],this.elastic[t])),o.set(s)}resolveConstraints(){const{dragConstraints:t,dragElastic:e}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,i=this.constraints;t&&Vc(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!n)&&function(t,{top:e,left:n,bottom:i,right:o}){return{x:Zc(t.x,n,o),y:Zc(t.y,e,i)}}(n.layoutBox,t),this.elastic=function(t=Qc){return!1===t?t=0:!0===t&&(t=Qc),{x:tu(t,"left","right"),y:tu(t,"top","bottom")}}(e),i!==this.constraints&&!Vc(t)&&n&&this.constraints&&!this.hasMutatedConstraints&&Va(t=>{!1!==this.constraints&&this.getAxisMotionValue(t)&&(this.constraints[t]=function(t,e){const n={};return void 0!==e.min&&(n.min=e.min-t.min),void 0!==e.max&&(n.max=e.max-t.min),n}(n.layoutBox[t],this.constraints[t]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!Vc(e))return!1;const i=e.current;t.invariant(null!==i,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:o}=this.visualElement;if(!o||!o.layout)return!1;o.root&&(o.root.scroll=void 0,o.root.updateScroll());const s=Er(i,o.root,this.visualElement.getTransformPagePoint());let r=function(t,e){return{x:Jc(t.x,e.x),y:Jc(t.y,e.y)}}(o.layout.layoutBox,s);if(n){const t=n(rr(r));this.hasMutatedConstraints=!!t,t&&(r=sr(t))}return r}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:i,dragTransition:o,dragSnapToOrigin:s,onDragTransitionEnd:r}=this.getProps(),a=this.constraints||{},l=Va(r=>{if(!su(r,e,this.currentDirection))return;let l=a&&a[r]||{};!0!==s&&s!==r||(l={min:0,max:0});const c=i?200:1e6,u=i?40:1e7,h={type:"inertia",velocity:n?t[r]:0,bounceStiffness:c,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...o,...l};return this.startAxisValueAnimation(r,h)});return Promise.all(l).then(r)}startAxisValueAnimation(t,e){const n=this.getAxisMotionValue(t);return Vi(this.visualElement,t),n.start(di(t,n,0,e,this.visualElement,!1))}stopAnimation(){Va(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const e=`_drag${t.toUpperCase()}`,n=this.visualElement.getProps()[e];return n||this.visualElement.getValue(t,this.visualElement.latestValues[t]??0)}snapToCursor(t){Va(e=>{const{drag:n}=this.getProps();if(!su(e,n,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(e);if(i&&i.layout){const{min:n,max:s}=i.layout.layoutBox[e],r=o.get()||0;o.set(t[e]-qt(n,s,.5)+r)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:e}=this.getProps(),{projection:n}=this.visualElement;if(!Vc(e)||!n||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Va(t=>{const e=this.getAxisMotionValue(t);if(e&&!1!==this.constraints){const n=e.get();i[t]=function(t,e){let n=.5;const i=aa(t),o=aa(e);return o>i?n=D(e.min,e.max-i,t.min):i>o&&(n=D(t.min,t.max-o,e.min)),b(0,1,n)}({min:n,max:n},this.constraints[t])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),Va(e=>{if(!su(e,t,null))return;const n=this.getAxisMotionValue(e),{min:o,max:s}=this.constraints[e];n.set(qt(o,s,i[e]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;nu.set(this.visualElement,this);const t=this.visualElement.current,e=Wc(t,"pointerdown",e=>{const{drag:n,dragListener:i=!0}=this.getProps(),o=e.target,s=o!==t&&Lo(o);n&&i&&!s&&this.start(e)});let n;const i=()=>{const{dragConstraints:e}=this.getProps();Vc(e)&&e.current&&(this.constraints=this.resolveRefConstraints(),n||(n=function(t,e,n){const i=Qo(t,ou(n)),o=Qo(e,ou(n));return()=>{i(),o()}}(t,e.current,()=>this.scalePositionWithinConstraints())))},{projection:o}=this.visualElement,s=o.addEventListener("measure",i);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),rt.read(i);const r=$a(window,"resize",()=>this.scalePositionWithinConstraints()),a=o.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(Va(e=>{const n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))}),this.visualElement.render())});return()=>{r(),e(),s(),a&&a(),n&&n()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:s=Qc,dragMomentum:r=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:i,dragConstraints:o,dragElastic:s,dragMomentum:r}}}function ou(t){let e=!0;return()=>{e?e=!1:t()}}function su(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}const ru=t=>(e,n)=>{t&&rt.update(()=>t(e,n),!1,!0)};let au=!1;class lu extends e.Component{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:i}=this.props,{projection:o}=t;o&&(e.group&&e.group.add(o),n&&n.register&&i&&n.register(o),au&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Xa.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:n,drag:i,isPresent:o}=this.props,{projection:s}=n;return s?(s.isPresent=o,t.layoutDependency!==e&&s.setOptions({...s.options,layoutDependency:e}),au=!0,i||t.layoutDependency!==e||void 0===e||t.isPresent!==o?s.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?s.promote():s.relegate()||rt.postRender(()=>{const t=s.getStack();t&&t.members.length||this.safeToRemove()})),null):null}componentDidUpdate(){const{visualElement:t,layoutAnchor:e}=this.props,{projection:n}=t;n&&(n.options.layoutAnchor=e,n.root.didUpdate(),So.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n}=this.props,{projection:i}=t;au=!0,i&&(i.scheduleCheckAfterUnmount(),e&&e.group&&e.group.remove(i),n&&n.deregister&&n.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function cu(t){const[n,i]=Hl(),o=e.useContext(m);return d(lu,{...t,layoutGroup:o,switchLayoutGroup:e.useContext(Cc),isPresent:n,safeToRemove:i})}const uu={pan:{Feature:class extends or{constructor(){super(...arguments),this.removePointerDownListener=V}onPointerDown(t){this.session=new Yc(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:$c(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:e,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:ru(t),onStart:ru(e),onMove:ru(n),onEnd:(t,e)=>{delete this.session,i&&rt.postRender(()=>i(t,e))}}}mount(){this.removePointerDownListener=Wc(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends or{constructor(t){super(t),this.removeGroupControls=V,this.removeListeners=V,this.controls=new iu(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||V}update(){const{dragControls:t}=this.node.getProps(),{dragControls:e}=this.node.prevProps||{};t!==e&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},ProjectionNode:Ml,MeasureLayout:cu}};function hu(t,e,n){const{props:i}=t;t.animationState&&i.whileHover&&t.animationState.setActive("whileHover","Start"===n);const o=i["onHover"+n];o&&rt.postRender(()=>o(e,Ic(e)))}function du(t,e,n){const{props:i}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&i.whileTap&&t.animationState.setActive("whileTap","Start"===n);const o=i["onTap"+("End"===n?"":n)];o&&rt.postRender(()=>o(e,Ic(e)))}const pu=new WeakMap,mu=new WeakMap,fu=t=>{const e=pu.get(t.target);e&&e(t)},gu=t=>{t.forEach(fu)};function yu(t,e,n){const i=function({root:t,...e}){const n=t||document;mu.has(n)||mu.set(n,{});const i=mu.get(n),o=JSON.stringify(e);return i[o]||(i[o]=new IntersectionObserver(gu,{root:t,...e})),i[o]}(e);return pu.set(t,n),i.observe(t),()=>{pu.delete(t),i.unobserve(t)}}const vu={some:0,all:1};const xu={inView:{Feature:class extends or{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:t={}}=this.node.getProps(),{root:e,margin:n,amount:i="some",once:o}=t,s={root:e?e.current:void 0,rootMargin:n,threshold:"number"==typeof i?i:vu[i]};this.stopObserver=yu(this.node.current,s,t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,o&&!e&&this.hasEnteredView)return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);const{onViewportEnter:n,onViewportLeave:i}=this.node.getProps(),s=e?n:i;s&&s(t)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}(t,e))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}},tap:{Feature:class extends or{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:e,propagate:n}=this.node.props;this.unmount=Wo(t,(t,e)=>(du(this.node,e,"Start"),(t,{success:e})=>du(this.node,t,e?"End":"Cancel")),{useGlobalTarget:e,stopPropagation:!1===n?.tap})}unmount(){}}},focus:{Feature:class extends or{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){t=!0}t&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=k($a(this.node.current,"focus",()=>this.onFocus()),$a(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends or{mount(){const{current:t}=this.node;t&&(this.unmount=Mo(t,(t,e)=>(hu(this.node,e,"Start"),t=>hu(this.node,t,"End"))))}unmount(){}}}},wu={layout:{ProjectionNode:Ml,MeasureLayout:cu}},Su=Bc({...jc,...xu,...uu,...wu},ac);function bu(t,e,n,i,o,s="ltr"){const r=t.findIndex(t=>t.value===e);if(-1===r)return t;if("xy"===o){const{layout:e}=t[r],i={x:qt(e.x.min,e.x.max,.5)+n.x,y:qt(e.y.min,e.y.max,.5)+n.y},o=function(t){const e=[];return t.forEach(t=>{const{min:n,max:i}=t.layout.y,o=e[e.length-1];!o||n>=o.max||i<=o.min?e.push({items:[t],min:n,max:i}):(o.items.push(t),o.min=Math.min(o.min,n),o.max=Math.max(o.max,i))}),e}(t),a=o.find(e=>e.items.includes(t[r])),l=o.reduce((t,e)=>Tu(i.y,e)n!==e),r=i.items.find(t=>{const e=qt(t.layout.x.min,t.layout.x.max,.5);return"ltr"===o?ne}),a=r?s.indexOf(r):s.indexOf(i.items[i.items.length-1])+1,l=[...s];return l.splice(a,0,t[e]),l.every((e,n)=>e===t[n])?t:l}(t,r,i.x,l,s);const c=Pu(i,e);let u=-1,h=c;return t.forEach((t,e)=>{if(e===r)return;const n=Pu(i,t.layout);n0?1:-1,l=t[r+a];if(!l)return t;const c=t[r].layout[o],u=l.layout[o],h=qt(u.min,u.max,.5);return 1===a&&c.max+n[o]>h||-1===a&&c.min+n[o]e.max?t-e.max:0}function Pu(t,e){const n=Math.max(e.x.min-t.x,0,t.x-e.x.max),i=Math.max(e.y.min-t.y,0,t.y-e.y.max);return n*n+i*i}const Eu=(t,e)=>t.max<=e.min||e.max<=t.min;function Au({children:n,as:i="ul",axis:o,onReorder:s,values:r,...a},l){const c=f(()=>Su[i]),u=e.useRef(new Map),[h,p]=e.useState("y"),m=e.useRef(!1),g=e.useRef(null),y=o||h;t.invariant(Boolean(r),"Reorder.Group must be provided a values prop","reorder-values");const v=new Set(r);u.current.forEach((t,e)=>{v.has(e)||u.current.delete(e)});const x={axis:y,groupRef:g,registerItem:(t,e)=>{if(u.current.set(t,e),!o){const t=function(t){let e=!1,n=!1;for(let i=0;i{const e=u.current.get(t);return e?[e]:[]}));t!==h&&p(t)}},updateOrder:(t,e,n)=>{if(m.current)return;const i=r.flatMap(t=>{const e=u.current.get(t);return e?[{value:t,layout:e}]:[]}),o="rtl"===g.current?.ownerDocument.defaultView?.getComputedStyle(g.current).direction?"rtl":"ltr",a=bu(i,t,e,n,y,o);if(i!==a){m.current=!0;const t=[...r],e=i.map(({value:t})=>r.indexOf(t));a.forEach(({value:n},i)=>{t[e[i]]=n}),s(t)}}};e.useEffect(()=>{m.current=!1});const w={overflowAnchor:"none",...a.style};return d(c,{...a,style:w,ref:t=>{g.current=t,"function"==typeof l?l(t):l&&(l.current=t)},ignoreStrict:!0,children:d(oc.Provider,{value:x,children:n})})}const Mu=e.forwardRef(Au);function Cu(t){const n=f(()=>ii(t)),{isStatic:i}=e.useContext(Fl);if(i){const[,i]=e.useState(t);e.useEffect(()=>n.on("change",i),[])}return n}function Vu(t,e){const n=Cu(e()),i=()=>n.set(e());return i(),y(()=>{const e=()=>rt.preRender(i,!1,!0),n=t.map(t=>t.on("change",e));return()=>{n.forEach(t=>t()),at(i)}}),n}function ku(t,e,n,i){if("function"==typeof t)return function(t){ei.current=[],t();const e=Vu(ei.current,t);return ei.current=void 0,e}(t);if(void 0!==n&&!Array.isArray(n)&&"function"!=typeof e)return function(t,e,n,i){const o=f(()=>Object.keys(n)),s=f(()=>({}));for(const r of o)s[r]=ku(t,e,n[r],i);return s}(t,e,n,i);const o="function"==typeof e?e:os(e,n,i),s=Array.isArray(t)?Du(t,o):Du([t],([t])=>o(t)),r=Array.isArray(t)?void 0:t.accelerate;return r&&!r.isTransformed&&"function"!=typeof e&&Array.isArray(n)&&!1!==i?.clamp&&(s.accelerate={...r,times:e,keyframes:n,isTransformed:!0,...i?.ease?{ease:i.ease}:{}}),s}function Du(t,e){const n=f(()=>[]);return Vu(t,()=>{n.length=0;const i=t.length;for(let e=0;e0))return;Bu.set(o,a);const t="x"===n?o.scrollWidth-(c?window.innerWidth:o.clientWidth):o.scrollHeight-(c?window.innerHeight:o.clientHeight);Lu.set(o,t)}if(r>0){const t=Lu.get(o);if(("x"===n?c?window.scrollX:o.scrollLeft:c?window.scrollY:o.scrollTop)>=t)return}"x"===n?c?window.scrollBy({left:r}):o.scrollLeft+=r:c?window.scrollBy({top:r}):o.scrollTop+=r}function Wu(t,e=0){return Mi(t)?t:Cu(e)}function $u({children:n,style:i={},value:o,as:s="li",onDrag:r,onDragEnd:a,layout:l=!0,...c},u){const h=f(()=>Su[s]),p=e.useContext(oc),m={x:Wu(i.x),y:Wu(i.y)},g=ku([m.x,m.y],([t,e])=>t||e?1:"unset");t.invariant(Boolean(p),"Reorder.Item must be a child of Reorder.Group","reorder-item-child");const{axis:y,registerItem:v,updateOrder:x,groupRef:w}=p;return d(h,{drag:"xy"===y||y,...c,dragSnapToOrigin:!0,style:{...i,x:m.x,y:m.y,zIndex:g},layout:l,onDrag:(t,e)=>{const{velocity:n,point:i}=e,s={x:m.x.get(),y:m.y.get()};x(o,s,n);const a="xy"===y?Math.abs(n.x)>Math.abs(n.y)?"x":"y":y;Fu(w.current,i[a],a,n[a]),r&&r(t,e)},onDragEnd:(t,e)=>{!function(){if(Ou){const t=Iu(Ou,"y");t&&(Bu.delete(t),Lu.delete(t));const e=Iu(Ou,"x");e&&e!==t&&(Bu.delete(e),Lu.delete(e)),Ou=null}}(),a&&a(t,e)},onLayoutMeasure:t=>{v(o,t)},ref:u,ignoreStrict:!0,children:n})}const Nu=e.forwardRef($u);var Uu=Object.freeze({__proto__:null,Group:Mu,Item:Nu});function zu(t){return"object"==typeof t&&!Array.isArray(t)}function Yu(t,e,n,i){return null==t?[]:"string"==typeof t&&zu(e)?ro(t,n,i):t instanceof NodeList?Array.from(t):Array.isArray(t)?t.filter(t=>null!=t):[t]}function Hu(t,e,n){return t*(e+1)+n*e}function Xu(t,e,n,i){return"number"==typeof e?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?n:e.startsWith("<")?Math.max(0,n+parseFloat(e.slice(1))):i.get(e)??t}function Gu(t,e,n,i,o,s){!function(t,e,n){for(let i=0;ie&&o.at"number"==typeof t,eh=t=>t.every(th);function nh(t){const e={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=No(t)&&!ns(t)?new Kr(e):new Ir(e);n.mount(t),$s.set(t,n)}function ih(t){const e=new Fr({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});e.mount(t),$s.set(t,e)}function oh(e,n,i,o){const s=[];if(function(t,e){return Mi(t)||"number"==typeof t||"string"==typeof t&&!zu(e)}(e,n))s.push(Wa(e,zu(n)&&n.default||n,i&&i.default||i));else{if(null==e)return s;const r=Yu(e,n,o),a=r.length;t.invariant(Boolean(a),"No valid elements provided.","no-valid-elements");for(let t=0;t{const c=Ju(e),{delay:u=0,times:h=Fe(c),type:m=n.type||"keyframes",repeat:f,repeatType:g,repeatDelay:v=0,...x}=i;let{ease:w=n.ease||"easeOut",duration:S}=i;const b="function"==typeof u?u(a,l):u,T=c.length,P=Ln(m)?m:s?.[m||"keyframes"];if(T<=2&&P){let t=100;if(2===T&&eh(c)){const e=c[1]-c[0];t=Math.abs(e)}const e={...n,...x};void 0!==S&&(e.duration=L(S));const i=pe(e,t,P);w=i.ease,S=i.duration}S??(S=r);const E=d+b;1===h.length&&0===h[0]&&(h[1]=1);const A=h.length-c.length;if(A>0&&Ie(h,A),1===c.length&&c.unshift(null),f&&t.warning(f<20,`Sequence segments can't repeat ${f} times — ignoring repeat option. Use a value below 20 or apply repeat at the sequence level instead.`),f&&f<20){const t=S>0?v/S:0;S=Hu(S,f,v);const e=[...c],n=[...h];w=Array.isArray(w)?[...w]:[w];const i=[...w],o="reverse"===g||"mirror"===g;let s=e,r=i;o&&(s=[...e].reverse(),"reverse"===g&&(r=[...i].reverse().map(t=>"function"==typeof t?U(t):t)));for(let a=0;a0&&(c.push(c[c.length-1]),h.push(p),w.push("linear")),c.push(...u);for(let t=0;t{for(const o in t){const s=t[o];s.sort(_u);const r=[],l=[],c=[];for(let t=0;t{if(Array.isArray(t)&&"function"==typeof t[0]){const e=t[0],n=ii(0);return n.on("change",e),1===t.length?[n,[0,1]]:2===t.length?[n,[0,1],t[1]]:[n,t[1],t[2]]}return t}),n,i,{spring:Le});return s.forEach(({keyframes:t,transition:e},n)=>{o.push(...oh(n,t,e))}),o}function rh(t={}){const{scope:e,reduceMotion:n,skipAnimations:i}=t;return function(t,o,s){let r,a=[];const l={};if(void 0!==n&&(l.reduceMotion=n),void 0!==i&&(l.skipAnimations=i),c=t,Array.isArray(c)&&c.some(Array.isArray)){const{onComplete:n,...i}=o||{};"function"==typeof n&&(r=n),a=sh(t,{...l,...i},e)}else{const{onComplete:n,...i}=s||{};"function"==typeof n&&(r=n),a=oh(t,o,{...l,...i},e)}var c;const u=new _n(a);return r&&u.finished.then(r),e&&(e.animations.push(u),u.finished.then(()=>{w(e.animations,u)})),u}}const ah=rh();const lh=e=>function(n,i,o){return new _n(function(e,n,i,o){if(null==e)return[];const s=ro(e,o),r=s.length;t.invariant(Boolean(r),"No valid elements provided.","no-valid-elements");const a=[];for(let t=0;te.delete(n)),l.push(o)}return l}(n,i,o,e))},ch=lh();function uh(t){return"undefined"!=typeof window&&(t?Mn():An())}const hh={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function dh(t,e,n,i){const o=n[e],{length:s,position:r}=hh[e],a=o.current,l=n.time;o.current=Math.abs(t[`scroll${r}`]),o.scrollLength=t[`scroll${s}`]-t[`client${s}`],o.offset.length=0,o.offset[0]=0,o.offset[1]=o.scrollLength,o.progress=D(0,o.scrollLength,o.current);const c=i-l;o.velocity=c>50?0:O(o.current-a,c)}const ph={start:0,center:.5,end:1};function mh(t,e,n=0){let i=0;if(t in ph&&(t=ph[t]),"string"==typeof t){const e=parseFloat(t);t.endsWith("px")?i=e:t.endsWith("%")?t=e/100:t.endsWith("vw")?i=e/100*document.documentElement.clientWidth:t.endsWith("vh")?i=e/100*document.documentElement.clientHeight:t=e}return"number"==typeof t&&(i=e*t),n+i}const fh=[0,0];function gh(t,e,n,i){let o=Array.isArray(t)?t:fh,s=0,r=0;return"number"==typeof t?o=[t,t]:"string"==typeof t&&(o=(t=t.trim()).includes(" ")?t.split(" "):[t,ph[t]?t:"0"]),s=mh(o[0],n,i),r=mh(o[1],e),s-r}const yh={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},vh={x:0,y:0};function xh(t,e,n){const{offset:i=yh.All}=n,{target:o=t,axis:s="y"}=n,r="y"===s?"height":"width",a=o!==t?function(t,e){const n={x:0,y:0};let i=t;for(;i&&i!==e;)if(fo(i))n.x+=i.offsetLeft,n.y+=i.offsetTop,i=i.offsetParent;else if("svg"===i.tagName){const t=i.getBoundingClientRect();i=i.parentElement;const e=i.getBoundingClientRect();n.x+=t.left-e.left,n.y+=t.top-e.top}else{if(!(i instanceof SVGGraphicsElement))break;{const{x:t,y:e}=i.getBBox();n.x+=t,n.y+=e;let o=null,s=i.parentNode;for(;!o;)"svg"===s.tagName&&(o=s),s=i.parentNode;i=o}}return n}(o,t):vh,l=o===t?{width:t.scrollWidth,height:t.scrollHeight}:function(t){return"getBBox"in t&&"svg"!==t.tagName?t.getBBox():{width:t.clientWidth,height:t.clientHeight}}(o),c={width:t.clientWidth,height:t.clientHeight};e[s].offset.length=0;let u=!e[s].interpolate;const h=i.length;for(let t=0;t{!function(t,e=t,n){if(n.x.targetOffset=0,n.y.targetOffset=0,e!==t){let i=e;for(;i&&i!==t;)n.x.targetOffset+=i.offsetLeft,n.y.targetOffset+=i.offsetTop,i=i.offsetParent}n.x.targetLength=e===t?e.scrollWidth:e.clientWidth,n.y.targetLength=e===t?e.scrollHeight:e.clientHeight,n.x.containerLength=t.clientWidth,n.y.containerLength=t.clientHeight}(t,i.target,n),function(t,e,n){dh(t,"x",e,n),dh(t,"y",e,n),e.time=n}(t,n,e),(i.offset||i.target)&&xh(t,n,i)},notify:()=>e(n)}}const Sh=new WeakMap,bh=new WeakMap,Th=new WeakMap,Ph=new WeakMap,Eh=new WeakMap,Ah=t=>t===document.scrollingElement?window:t;function Mh(t,{container:e=document.scrollingElement,trackContentSize:n=!1,...i}={}){if(!e)return V;let o=Th.get(e);o||(o=new Set,Th.set(e,o));const s=wh(e,t,{time:0,x:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0},y:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}},i);if(o.add(s),!Sh.has(e)){const t=()=>{for(const t of o)t.measure(lt.timestamp);rt.preUpdate(n)},n=()=>{for(const t of o)t.notify()},i=()=>rt.read(t);Sh.set(e,i);const s=Ah(e);window.addEventListener("resize",i),e!==document.documentElement&&bh.set(e,Qo(e,i)),s.addEventListener("scroll",i),i()}if(n&&!Eh.has(e)){const t=Sh.get(e),n={width:e.scrollWidth,height:e.scrollHeight};Ph.set(e,n);const i=()=>{const i=e.scrollWidth,o=e.scrollHeight;n.width===i&&n.height===o||(t(),n.width=i,n.height=o)},o=rt.read(i,!0);Eh.set(e,o)}const r=Sh.get(e);return rt.read(r,!1,!0),()=>{at(r);const t=Th.get(e);if(!t)return;if(t.delete(s),t.size)return;const n=Sh.get(e);Sh.delete(e),n&&(Ah(e).removeEventListener("scroll",n),bh.get(e)?.(),window.removeEventListener("resize",n));const i=Eh.get(e);i&&(at(i),Eh.delete(e)),Ph.delete(e)}}const Ch=[[yh.Enter,"entry"],[yh.Exit,"exit"],[yh.Any,"cover"],[yh.All,"contain"]],Vh={start:0,end:1};function kh(t){const e=t.trim().split(/\s+/);if(2!==e.length)return;const n=Vh[e[0]],i=Vh[e[1]];return void 0!==n&&void 0!==i?[n,i]:void 0}function Dh(t,e){const n=function(t){if(2!==t.length)return;const e=[];for(const n of t)if(Array.isArray(n))e.push(n);else{if("string"!=typeof n)return;{const t=kh(n);if(!t)return;e.push(t)}}return e}(t);if(!n)return!1;for(let t=0;t<2;t++){const i=n[t],o=e[t];if(i[0]!==o[0]||i[1]!==o[1])return!1}return!0}function Rh(t){if(!t)return{rangeStart:"contain 0%",rangeEnd:"contain 100%"};for(const[e,n]of Ch)if(Dh(t,e))return{rangeStart:`${n} 0%`,rangeEnd:`${n} 100%`}}const Lh=new Map;function Bh(t){const e={value:0},n=Mh(n=>{e.value=100*n[t.axis].progress},t);return{currentTime:e,cancel:n}}function Oh({source:t,container:e,...n}){const{axis:i}=n;t&&(e=t);let o=Lh.get(e);o||(o=new Map,Lh.set(e,o));const s=n.target??"self";let r=o.get(s);r||(r={},o.set(s,r));const a=i+(n.offset??[]).join(",");if(!r[a])if(n.target&&uh(n.target)){const t=Rh(n.offset);r[a]=t?new ViewTimeline({subject:n.target,axis:i}):Bh({container:e,...n})}else uh()?r[a]=new ScrollTimeline({source:e,axis:i}):r[a]=Bh({container:e,...n});return r[a]}function jh(t,{axis:e="y",container:n=document.scrollingElement,...i}={}){if(!n)return V;const o={axis:e,container:n,...i};return"function"==typeof t?function(t,e){return function(t){return 2===t.length}(t)||function(t){return t&&(t.target||t.offset)}(e)?Mh(n=>{t(n[e.axis].progress,n)},e):ts(t,Oh(e))}(t,o):function(t,e){const n=Oh(e),i=e.target?Rh(e.offset):void 0,o=e.target?uh(e.target)&&!!i:uh();return t.attachTimeline({timeline:o?n:void 0,...i&&o&&{rangeStart:i.rangeStart,rangeEnd:i.rangeEnd},observe:t=>(t.pause(),ts(e=>{t.time=t.iterationDuration*e},n))})}(t,o)}const Ih={some:0,all:1};function Fh(t,e,{root:n,margin:i,amount:o="some"}={}){const s=ro(t),r=new WeakMap,a=new IntersectionObserver(t=>{t.forEach(t=>{const n=r.get(t.target);if(t.isIntersecting!==Boolean(n))if(t.isIntersecting){const n=e(t.target,t);"function"==typeof n?r.set(t.target,n):a.unobserve(t.target)}else"function"==typeof n&&(n(t),r.delete(t.target))})},{root:n,rootMargin:i,threshold:"number"==typeof o?o:Ih[o]});return s.forEach(t=>a.observe(t)),()=>a.disconnect()}const Wh=Bc();function $h(t){return e.useEffect(()=>()=>t(),[])}const Nh={renderer:ac,...jc,...xu},Uh={...Nh,...uu,...wu},zh={renderer:ac,...jc};function Yh(t,n,i){e.useInsertionEffect(()=>t.on(n,i),[t,n,i])}const Hh=()=>({scrollX:ii(0),scrollY:ii(0),scrollXProgress:ii(0),scrollYProgress:ii(0)}),Xh=t=>!!t&&!t.current;function Gh(t,e,n,i){return{factory:o=>{let s;const r=()=>{Xh(n)||Xh(i)?So.read(r):s=jh(o,{...e,axis:t,container:n?.current||void 0,target:i?.current||void 0})};return So.read(r),()=>{bo(r),s?.()}},times:[0,1],keyframes:[0,1],ease:t=>t,duration:1}}function Kh({container:n,target:i,...o}={}){const s=f(Hh);(function(t,e){return"undefined"!=typeof window&&(t?Mn()&&!!Rh(e):An())})(i,o.offset)&&(s.scrollXProgress.accelerate=Gh("x",o,n,i),s.scrollYProgress.accelerate=Gh("y",o,n,i));const r=e.useRef(null),a=e.useRef(!1),l=e.useCallback(()=>(r.current=jh((t,{x:e,y:n})=>{s.scrollX.set(e.current),s.scrollXProgress.set(e.progress),s.scrollY.set(n.current),s.scrollYProgress.set(n.progress)},{...o,container:n?.current||void 0,target:i?.current||void 0}),()=>{r.current?.()}),[n,i,JSON.stringify(o.offset)]);return y(()=>(a.current=!1,Xh(n)||Xh(i)?void(a.current=!0):l()),[l]),e.useEffect(()=>{if(!a.current)return;let e;const o=()=>{const o=Xh(n),s=Xh(i);t.invariant(!o,"Container ref is defined but not hydrated","use-scroll-ref"),t.invariant(!s,"Target ref is defined but not hydrated","use-scroll-ref"),o||s||(e=l())};return So.read(o),()=>{bo(o),e?.()}},[l]),s}function _h(t,n={}){const{isStatic:i}=e.useContext(Fl),o=()=>Mi(t)?t.get():t;if(i)return ku(o);const s=Cu(o());return e.useInsertionEffect(()=>rs(s,t,n),[s,JSON.stringify(n)]),s}function qh(t){const n=e.useRef(0),{isStatic:i}=e.useContext(Fl);e.useEffect(()=>{if(i)return;const e=({timestamp:e,delta:i})=>{n.current||(n.current=e),t(e-n.current,i)};return rt.update(e,!0),()=>at(e)},[t])}class Zh extends ni{constructor(){super(...arguments),this.isEnabled=!1}add(t){(cn.has(t)||Nn.has(t))&&(this.isEnabled=!0,this.update())}update(){this.set(this.isEnabled?"transform":"auto")}}function Jh(){!_s.current&&Zs();const[t]=e.useState(Ks.current);return t}function Qh(){const t=Jh(),{reducedMotion:n}=e.useContext(Fl);return"never"!==n&&("always"===n||t)}function td(t,e){[...e].reverse().forEach(n=>{const i=t.getVariant(n);i&&Ai(t,i),t.variantChildren&&t.variantChildren.forEach(t=>{td(t,e)})})}function ed(){let e=!1;const n=new Set,i={subscribe:t=>(n.add(t),()=>{n.delete(t)}),start(i,o){t.invariant(e,"controls.start() should only be called after a component has mounted. Consider calling within a useEffect hook.");const s=[];return n.forEach(t=>{s.push(Ii(t,i,{transitionOverride:o}))}),Promise.all(s)},set:i=>(t.invariant(e,"controls.set() should only be called after a component has mounted. Consider calling within a useEffect hook."),n.forEach(t=>{!function(t,e){Array.isArray(e)?td(t,e):"string"==typeof e?td(t,[e]):Ai(t,e)}(t,i)})),stop(){n.forEach(t=>{!function(t){t.values.forEach(t=>t.stop())}(t)})},mount:()=>(e=!0,()=>{e=!1,i.stop()})};return i}function nd(){const t=f(ed);return y(t.mount,[]),t}const id=nd;class od{constructor(){this.componentControls=new Set}subscribe(t){return this.componentControls.add(t),()=>this.componentControls.delete(t)}start(t,e){this.componentControls.forEach(n=>{n.start(t.nativeEvent||t,e)})}cancel(){this.componentControls.forEach(t=>{t.cancel()})}stop(){this.componentControls.forEach(t=>{t.stop()})}}const sd=()=>new od;function rd(t){return null!==t&&"object"==typeof t&&Ac in t}function ad(){return ld}function ld(t){Al.current&&(Al.current.isUpdating=!1,Al.current.blockUpdate(),t&&t())}const cd=new Map,ud=new Map,hd=(t,e)=>`${t}: ${cn.has(e)?"transform":e}`;function dd(t,e,n){const i=hd(t,e),o=cd.get(i);if(!o)return null;const{animation:s,startTime:r}=o;function a(){window.MotionCancelOptimisedAnimation?.(t,e,n)}return s.onfinish=a,null===r||window.MotionHandoffIsComplete?.(t)?(a(),null):r}let pd,md;const fd=new Set;function gd(){fd.forEach(t=>{t.animation.play(),t.animation.startTime=t.startTime}),fd.clear()}const yd=()=>({});class vd extends nr{constructor(){super(...arguments),this.measureInstanceViewportBox=Ws}build(){}resetTransform(){}restoreTransform(){}removeValueFromRenderState(){}renderInstance(){}scrapeMotionValuesFromProps(){return{}}getBaseTargetFromProps(){}readValueFromInstance(t,e,n){return n.initialState[e]||0}sortInstanceNodePosition(){return 0}}const xd=Tc({scrapeMotionValuesFromProps:yd,createRenderState:yd});let wd=0;const Sd=t=>t>.001?1/t:1e5;let bd=!1;t.AnimatePresence=({children:t,custom:n,initial:i=!0,onExitComplete:o,presenceAffectsLayout:s=!0,mode:r="sync",propagate:a=!1,anchorX:l="left",anchorY:c="top",root:u})=>{const[p,g]=Hl(a),v=e.useMemo(()=>Gl(t),[t]),x=a&&!p?[]:v.map(Xl),w=e.useRef(!0),S=e.useRef(v),b=f(()=>new Map),T=e.useRef(new Set),[P,E]=e.useState(v),[A,M]=e.useState(v);y(()=>{!a||p||A.length||g?.()},[p,a,A.length,g]),y(()=>{w.current=!1,S.current=v;for(let t=0;t{const e=Xl(t),h=!(a&&!p)&&(v===A||x.includes(e));return d(zl,{isPresent:h,initial:!(w.current&&!i)&&void 0,custom:n,presenceAffectsLayout:s,mode:r,root:u,onExitComplete:h?void 0:()=>{if(T.current.has(e))return;if(!b.has(e))return;T.current.add(e),b.set(e,!0);let t=!0;b.forEach(e=>{e||(t=!1)}),t&&(V?.(),M(S.current),a&&g?.(),o&&o())},anchorX:l,anchorY:c,children:t},e)})})},t.AnimateSharedLayout=({children:e})=>(i.useEffect(()=>{t.invariant(!1,"AnimateSharedLayout is deprecated: https://www.framer.com/docs/guide-upgrade/##shared-layout-animations")},[]),d(Zl,{id:f(()=>"asl-"+wd++),children:e})),t.AsyncMotionValueAnimation=Xn,t.DOMKeyframesResolver=eo,t.DOMVisualElement=ir,t.DeprecatedLayoutGroupContext=Kl,t.DocumentProjectionNode=Tl,t.DragControls=od,t.Feature=or,t.FlatTree=Ua,t.GroupAnimation=Gn,t.GroupAnimationWithThen=_n,t.HTMLProjectionNode=Ml,t.HTMLVisualElement=Ir,t.JSAnimation=Ke,t.KeyframeResolver=Sn,t.LayoutAnimationBuilder=class{constructor(t,e,n){this.scope=t,this.updateDom=e,this.defaultOptions=n,this.sharedTransitions=new Map,this.notifyReady=()=>{},this.rejectReady=()=>{},this.tracked=new Map,this.restorePoints=new Map,this.readyPromise=new Promise((t,e)=>{this.notifyReady=t,this.rejectReady=e}),kl||(kl=[],queueMicrotask(Ol)),kl.push(this)}shared(t,e){return this.sharedTransitions.set(t,e),this}then(t,e){return this.readyPromise.then(t,e)}transitionFor(t){const e=t.getAttribute("data-layout-id");return e&&this.sharedTransitions.get(e)||this.defaultOptions}adopt(t,e){this.tracked.set(t,e),this.restorePoints.set(t,{parent:t.parentElement,next:t.nextSibling})}collectTargets(){return Dl(this.scope)}runUpdate(){try{const t=this.updateDom();if(t&&"function"==typeof t.then)return t.then(void 0,t=>{this.updateError=t})}catch(t){this.updateError=t}}reconcileAdditions(t){for(const e of Dl(this.scope)){if(this.tracked.has(e))continue;const n=Ll(e,this.transitionFor(e));this.adopt(e,n),n.options.layoutId&&t.add(n.options.layoutId)}}reconcileRemovals(t){this.tracked.forEach((e,n)=>{if(n.isConnected)return;const i=this.restorePoints.get(n);this.restorePoints.delete(n);const{layoutId:o}=e.options,s=e.getStack(),r=s&&s.members.some(t=>t!==e&&t.instance?.isConnected);if(o&&e.isLead()&&r&&!t.has(o)&&i&&i.parent.isConnected){if(i.parent.insertBefore(n,i.next&&i.next.parentNode===i.parent?i.next:null),e.isPresent=!1,e.setOptions({onExitComplete:()=>{n.remove(),Bl(n,e)}}),e.relegate())return;n.remove()}Bl(n,e),this.tracked.delete(n)})}getRoot(){let t;return this.tracked.forEach(e=>t||(t=e.root)),t}finalize(){if(this.updateError)return void this.rejectReady(this.updateError);const t=new Set;this.tracked.forEach(e=>{e.instance&&e.currentAnimation&&t.add(e.currentAnimation)}),this.notifyReady(new Gn([...t]))}},t.LayoutGroup=Zl,t.LayoutGroupContext=m,t.LazyMotion=function({children:t,features:n,strict:i=!1}){const[,o]=e.useState(!ic(n)),s=e.useRef(void 0);if(!ic(n)){const{renderer:t,...e}=n;s.current=t,nc(e)}return e.useEffect(()=>{ic(n)&&n().then(({renderer:t,...e})=>{nc(e),s.current=t,o(!0)})},[]),d(Jl.Provider,{value:{renderer:s.current,strict:i},children:t})},t.MotionConfig=function({children:t,...n}){const i=e.useContext(Fl);(n={...i,...n}).transition=oi(n.transition,i.transition),n.isStatic=f(()=>n.isStatic);const o=e.useMemo(()=>n,[JSON.stringify(n.transition),n.transformPagePoint,n.reducedMotion,n.skipAnimations,n.isValidProp]);return d(Fl.Provider,{value:o,children:t})},t.MotionConfigContext=Fl,t.MotionContext=lc,t.MotionGlobalConfig=P,t.MotionValue=ni,t.NativeAnimation=On,t.NativeAnimationExtended=Fn,t.NativeAnimationWrapper=qn,t.NodeStack=Ha,t.ObjectVisualElement=Fr,t.PopChild=Ul,t.PresenceChild=zl,t.PresenceContext=v,t.Reorder=Uu,t.SVGVisualElement=Kr,t.SubscriptionManager=R,t.SwitchLayoutGroupContext=Cc,t.ViewTransitionBuilder=Os,t.VisualElement=nr,t.WillChangeMotionValue=Zh,t.acceleratedValues=Nn,t.addAttrValue=ho,t.addDomEvent=$a,t.addPointerEvent=Wc,t.addPointerInfo=Fc,t.addScaleCorrector=function(t){for(const e in t)Br[e]=t[e],mt(e)&&(Br[e].isCSSVariable=!0)},t.addStyleValue=vo,t.addUniqueItem=x,t.addValueToWillChange=Vi,t.alpha=wt,t.analyseComplexValue=zt,t.animate=ah,t.animateMini=ch,t.animateMotionValue=di,t.animateSingleValue=Wa,t.animateTarget=Oi,t.animateValue=function(t){return new Ke(t)},t.animateVariant=ji,t.animateView=function(t,e={}){return new Os(t,e)},t.animateVisualElement=Ii,t.animationControls=ed,t.animationMapKey=Jn,t.animations=jc,t.anticipate=X,t.applyAxisDelta=fr,t.applyBoxDelta=gr,t.applyGeneratorOptions=Bn,t.applyPointDelta=mr,t.applyPxDefaults=oo,t.applyTreeDeltas=xr,t.arc=function(t={}){const e=function({strength:t=.5,peak:e=.5,direction:n,rotate:i=!1}={}){const o=!0===i?1:"number"==typeof i?i:0;let s;return(i,r)=>{const a=r.x-i.x,l=r.y-i.y;let c;c="cw"===n?-t:"ccw"===n?t:(Math.abs(a)>=Math.abs(l)?a:l)<0?-t:t;let u=fi(i.x,i.y,r.x,r.y,c,e);if(void 0===n){const t=Math.abs(a){const e={x:pi(t,i.x,u.x,r.x),y:pi(t,i.y,u.y,r.y)};if(o){const n=mi(t,i.x,u.x,r.x,i.y,u.y,r.y),s=h+p*t;e.rotate=F(-180,180,n-s)*o}return e}}}(t),n={interpolateProjection(t){const n=t.x.translate,i=t.y.translate;if(!(Math.sqrt(n*n+i*i)<20))return e({x:n,y:i},{x:0,y:0})},animateVisualElement(t,n,i,o,s){if(!("x"in n)&&!("y"in n))return;const r=t.getValue("x",t.latestValues.x??0),a=t.getValue("y",t.latestValues.y??0),l=n.x,c=n.y,u=(Array.isArray(l)&&null!=l[0]?l[0]:r?.get())??0,h=(Array.isArray(c)&&null!=c[0]?c[0]:a?.get())??0,d=Array.isArray(l)?l[l.length-1]:l??u,p=Array.isArray(c)?c[c.length-1]:c??h,m=e({x:u,y:h},{x:d,y:p}),f=void 0!==m(0).rotate?t.getValue("pathRotation",0):void 0,g={delay:o,...si(i||{},"x")};delete g.path;const y=ii(0);y.start(di("",y,[0,1e3],{...g,isSync:!0,velocity:0,onUpdate:t=>{const e=m(t/1e3);r?.set(e.x),a?.set(e.y),f&&void 0!==e.rotate&&f.set(e.rotate)},onComplete:()=>{r?.set(d),a?.set(p),f?.set(0)},onStop:()=>f?.set(0),onCancel:()=>f?.set(0)})),y.animation&&s.push(y.animation),delete n.x,delete n.y}};return n},t.aspectRatio=Ma,t.attachFollow=rs,t.attachSpring=function(t,e,n){return rs(t,e,{type:"spring",...n})},t.attrEffect=po,t.axisDeltaEquals=Ca,t.axisEquals=Ta,t.axisEqualsRounded=Ea,t.backIn=Y,t.backInOut=H,t.backOut=z,t.boxEquals=Pa,t.boxEqualsRounded=Aa,t.buildHTMLStyles=Vr,t.buildProjectionTransform=ka,t.buildSVGAttrs=zr,t.buildSVGPath=Nr,t.buildTransform=Cr,t.calcAxisDelta=ca,t.calcBoxDelta=ua,t.calcChildStagger=ti,t.calcGeneratorDuration=de,t.calcLength=aa,t.calcRelativeAxis=ha,t.calcRelativeAxisPosition=pa,t.calcRelativeBox=da,t.calcRelativePosition=ma,t.camelCaseAttributes=Yr,t.camelToDash=ki,t.cancelFrame=at,t.cancelMicrotask=bo,t.cancelSync=Il,t.checkVariantsDidChange=ea,t.circIn=G,t.circInOut=_,t.circOut=K,t.clamp=b,t.cleanDirtyNodes=nl,t.collectMotionValues=ei,t.color=Ft,t.compareByDepth=Na,t.complex=Xt,t.containsCSSVariable=vt,t.convertBoundingBoxToBox=sr,t.convertBoxToBoundingBox=rr,t.convertOffsetToTimes=We,t.copyAxisDeltaInto=ra,t.copyAxisInto=oa,t.copyBoxInto=sa,t.correctBorderRadius=Rr,t.correctBoxShadow=Lr,t.correctParentTransform=function(t){return e=>{const n=t.current;if(!n)return e;const i=function(t){const{transform:e}=getComputedStyle(t);if(!e||"none"===e)return null;const n=e.match(/^matrix3d\((.*)\)$/u)||e.match(/^matrix\((.*)\)$/u);if(!n)return null;const i=n[1].split(",").map(Number),o=e.startsWith("matrix3d"),s=i[0],r=i[1],a=o?i[4]:i[2],l=o?i[5]:i[3],c=s*l-r*a;return Math.abs(c)<1e-10?null:{a:l/c,b:-r/c,c:-a/c,d:s/c}}(n);if(!i)return e;const o=n.getBoundingClientRect(),s=o.left+window.scrollX+o.width/2,r=o.top+window.scrollY+o.height/2,a=e.x-s,l=e.y-r;return{x:s+i.a*a+i.c*l,y:r+i.b*a+i.d*l}}},t.createAnimationState=ta,t.createAxis=Fs,t.createAxisDelta=js,t.createBox=Ws,t.createDelta=Is,t.createGeneratorEasing=pe,t.createProjectionNode=Ja,t.createRenderBatcher=st,t.createScopedAnimate=rh,t.cubicBezier=$,t.cubicBezierAsString=Vn,t.defaultEasing=$e,t.defaultOffset=Fe,t.defaultTransformValue=on,t.defaultValueTypes=qi,t.degrees=Dt,t.delay=za,t.delayInSeconds=function(t,e){return za(t,L(e))},t.dimensionValueTypes=Wi,t.disableInstantTransitions=function(){P.instantAnimations=!1},t.distance=Nc,t.distance2D=Uc,t.domAnimation=Nh,t.domMax=Uh,t.domMin=zh,t.eachAxis=Va,t.easeIn=q,t.easeInOut=J,t.easeOut=Z,t.easingDefinitionToFunction=it,t.fillOffset=Ie,t.fillWildcards=_e,t.filterProps=wc,t.findDimensionValueType=$i,t.findValueType=hs,t.flushKeyframeResolvers=wn,t.followValue=ss,t.frame=rt,t.frameData=lt,t.frameSteps=ct,t.generateLinearEasing=ue,t.getAnimatableNone=Qi,t.getAnimationMap=Qn,t.getComputedStyle=$o,t.getDefaultTransition=ci,t.getDefaultValueType=Zi,t.getEasingForSegment=tt,t.getFeatureDefinitions=er,t.getFinalKeyframe=ze,t.getMixer=oe,t.getOptimisedAppearId=Li,t.getOriginIndex=is,t.getValueAsType=lo,t.getValueTransition=si,t.getVariableValue=vi,t.getVariantContext=qr,t.getViewAnimationLayerInfo=Ts,t.getViewAnimations=Ps,t.globalProjectionState=Xa,t.has2DTranslate=hr,t.hasReducedMotionListener=_s,t.hasScale=cr,t.hasTransform=ur,t.hasWarned=function(t){return j.has(t)},t.hex=Vt,t.hover=Mo,t.hsla=It,t.hslaToRgba=Kt,t.inView=Fh,t.inertia=Oe,t.initPrefersReducedMotion=Zs,t.interpolate=je,t.invisibleValues=ee,t.isAnimationControls=Ns,t.isBezierDefinition=et,t.isBrowser=g,t.isCSSVariableName=mt,t.isCSSVariableToken=gt,t.isControllingVariants=Hs,t.isDeltaZero=ba,t.isDragActive=Po,t.isDragging=To,t.isEasingArray=Q,t.isElementKeyboardAccessible=Do,t.isElementTextInput=Lo,t.isForcedMotionValue=Or,t.isGenerator=Ln,t.isHTMLElement=fo,t.isKeyframesTarget=Ti,t.isMotionComponent=rd,t.isMotionValue=Mi,t.isNear=la,t.isNodeOrChild=Co,t.isNumericalString=E,t.isObject=A,t.isPrimaryPointer=Vo,t.isSVGElement=No,t.isSVGSVGElement=ns,t.isSVGTag=Hr,t.isTransitionDefined=hi,t.isValidMotionProp=vc,t.isVariantLabel=Us,t.isVariantNode=Xs,t.isWaapiSupportedEasing=function t(e){return Boolean("function"==typeof e&&Cn()||!e||"string"==typeof e&&(e in kn||Cn())||et(e)||Array.isArray(e)&&e.every(t))},t.isWillChangeMotionValue=Ci,t.isZeroValueString=M,t.keyframes=Ne,t.m=Wh,t.makeAnimationInstant=$n,t.makeUseVisualState=Tc,t.mapEasingToNativeEasing=Dn,t.mapValue=function(t,e,n,i){const o=os(e,n,i);return cs(()=>o(t.get()))},t.maxGeneratorDuration=he,t.measurePageBox=Er,t.measureViewportBox=Pr,t.memo=C,t.microtask=So,t.millisecondsToSeconds=B,t.mirrorEasing=N,t.mix=le,t.mixArray=se,t.mixColor=te,t.mixComplex=ae,t.mixImmediate=_t,t.mixLinearColor=Zt,t.mixNumber=qt,t.mixObject=re,t.mixValues=Ba,t.mixVisibility=ne,t.motion=Su,t.motionValue=ii,t.moveItem=S,t.nodeGroup=El,t.noop=V,t.number=xt,t.numberValueTypes=_i,t.observeTimeline=ts,t.optimizedAppearDataAttribute=Ri,t.optimizedAppearDataId=Di,t.parseAnimateLayoutArgs=function(t,e,n){return"function"==typeof t?{scope:document,updateDom:t,defaultOptions:e}:{scope:t instanceof Document?t:ro(t)[0]??document,updateDom:e,defaultOptions:n}},t.parseCSSVariable=yi,t.parseValueFromTransform=sn,t.percent=Rt,t.pipe=k,t.pixelsToPercent=Dr,t.positionalKeys=bi,t.prefersReducedMotion=Ks,t.press=Wo,t.progress=D,t.progressPercentage=jt,t.propEffect=mo,t.propagateDirtyNodes=el,t.px=Lt,t.readTransformValue=rn,t.recordStats=function(){if(es.value)throw es.value=null,es.addProjectionMetrics=null,new Error("Stats are already being measured");const t=es;t.value={layoutProjection:{nodes:[],calculatedTargetDeltas:[],calculatedProjections:[]}},t.addProjectionMetrics=e=>{const{layoutProjection:n}=t.value;n.nodes.push(e.nodes),n.calculatedTargetDeltas.push(e.calculatedTargetDeltas),n.calculatedProjections.push(e.calculatedProjections)}},t.removeAxisDelta=ga,t.removeAxisTransforms=ya,t.removeBoxTransforms=wa,t.removeItem=w,t.removePointDelta=fa,t.renderHTML=kr,t.renderSVG=Xr,t.resize=Qo,t.resolveElements=ro,t.resolveMotionValue=Ya,t.resolveTransition=oi,t.resolveVariant=Si,t.resolveVariantFromProps=wi,t.reverseEasing=U,t.rgbUnit=Mt,t.rgba=Ct,t.rootProjectionNode=Al,t.scale=St,t.scaleCorrectors=Br,t.scalePoint=pr,t.scrapeHTMLMotionValuesFromProps=jr,t.scrapeSVGMotionValuesFromProps=Gr,t.scroll=jh,t.scrollInfo=Mh,t.secondsToMilliseconds=L,t.setDragLock=Eo,t.setFeatureDefinitions=tr,t.setStyle=Tn,t.setTarget=Ai,t.spring=Le,t.springValue=function(t,e){return ss(t,{type:"spring",...e})},t.stagger=function(t=.1,{startDelay:e=0,from:n=0,ease:i}={}){return(o,s)=>{const r="number"==typeof n?n:is(n,s),a=Math.abs(r-o);let l=t*a;if(i){const e=s*t;l=it(i)(l/e)*e}return e+l}},t.startOptimizedAppearAnimation=function(t,e,n,i,o){if(window.MotionIsMounted)return;const s=t.dataset[Di];if(!s)return;window.MotionHandoffAnimation=dd;const r=hd(s,e);md||(md=Rn(t,e,[n[0],n[0]],{duration:1e4,ease:"linear"}),cd.set(r,{animation:md,startTime:null}),window.MotionHandoffAnimation=dd,window.MotionHasOptimisedAnimation=(t,e)=>{if(!t)return!1;if(!e)return ud.has(t);const n=hd(t,e);return Boolean(cd.get(n))},window.MotionHandoffMarkAsComplete=t=>{ud.has(t)&&ud.set(t,!0)},window.MotionHandoffIsComplete=t=>!0===ud.get(t),window.MotionCancelOptimisedAnimation=(t,e,n,i)=>{const o=hd(t,e),s=cd.get(o);s&&(n&&void 0===i?n.postRender(()=>{n.postRender(()=>{s.animation.cancel()})}):s.animation.cancel(),n&&i?(fd.add(s),n.render(gd)):(cd.delete(o),cd.size||(window.MotionCancelOptimisedAnimation=void 0)))},window.MotionCheckAppearSync=(t,e,n)=>{const i=Li(t);if(!i)return;const o=window.MotionHasOptimisedAnimation?.(i,e),s=t.props.values?.[e];if(!o||!s)return;const r=n.on("change",t=>{s.get()!==t&&(window.MotionCancelOptimisedAnimation?.(i,e),r())});return r});const a=()=>{md.cancel();const s=Rn(t,e,n,i);void 0===pd&&(pd=performance.now()),s.startTime=pd,cd.set(r,{animation:s,startTime:pd}),o&&o(s)};ud.set(s,!1),md.ready?md.ready.then(a).catch(V):a()},t.startWaapiAnimation=Rn,t.statsBuffer=es,t.steps=function(t,e="end"){return n=>{const i=(n="end"===e?Math.min(n,.999):Math.max(n,.001))*t,o="end"===e?Math.floor(i):Math.ceil(i);return b(0,1,o/t)}},t.styleEffect=xo,t.supportedWaapiEasing=kn,t.supportsBrowserAnimation=Hn,t.supportsFlags=Pn,t.supportsLinearEasing=Cn,t.supportsPartialKeyframes=so,t.supportsScrollTimeline=An,t.supportsViewTimeline=Mn,t.svgEffect=wo,t.sync=jl,t.testValueType=Fi,t.time=dt,t.transform=os,t.transformAxis=Sr,t.transformBox=Tr,t.transformBoxPoints=ar,t.transformPropOrder=ln,t.transformProps=cn,t.transformValue=cs,t.transformValueTypes=Ki,t.transformViewBoxPoint=function(t){return e=>{const n=t.current;if(!n)return e;const i=n.viewBox?.baseVal;if(!i||0===i.width&&0===i.height)return e;const o=n.getBoundingClientRect();if(0===o.width||0===o.height)return e;const s=i.width/o.width,r=i.height/o.height,a=o.left+window.scrollX,l=o.top+window.scrollY;return{x:(e.x-a)*s+a,y:(e.y-l)*r+l}}},t.translateAxis=wr,t.unwrapMotionComponent=function(t){if(rd(t))return t[Ac]},t.updateMotionValuesFromProps=Gs,t.useAnimate=function(){const t=f(()=>({current:null,animations:[]})),n=Qh()??void 0,{skipAnimations:i}=e.useContext(Fl),o=e.useMemo(()=>rh({scope:t,reduceMotion:n,skipAnimations:i}),[t,n,i]);return $h(()=>{t.animations.forEach(t=>t.stop()),t.animations.length=0}),[t,o]},t.useAnimateMini=function(){const t=f(()=>({current:null,animations:[]})),e=f(()=>lh(t));return $h(()=>{t.animations.forEach(t=>t.stop())}),[t,e]},t.useAnimation=id,t.useAnimationControls=nd,t.useAnimationFrame=qh,t.useComposedRefs=$l,t.useCycle=function(...t){const n=e.useRef(0),[i,o]=e.useState(t[n.current]),s=e.useCallback(e=>{n.current="number"!=typeof e?F(0,t.length,n.current+1):e,o(t[n.current])},[t.length,...t]);return[i,s]},t.useDeprecatedAnimatedState=function(t){const[n,i]=e.useState(t),o=xd({},!1),s=f(()=>new vd({props:{onUpdate:t=>{i({...t})}},visualState:o,presenceContext:null},{initialState:t}));return e.useLayoutEffect(()=>(s.mount({}),()=>s.unmount()),[s]),[n,f(()=>t=>Ii(s,t))]},t.useDeprecatedInvertedScale=function(n){let i=Cu(1),o=Cu(1);const{visualElement:s}=e.useContext(lc);return t.invariant(!(!n&&!s),"If no scale values are provided, useInvertedScale must be used within a child of another motion component."),t.warning(bd,"useInvertedScale is deprecated and will be removed in 3.0. Use the layout prop instead."),bd=!0,n?(i=n.scaleX||i,o=n.scaleY||o):s&&(i=s.getValue("scaleX",1),o=s.getValue("scaleY",1)),{scaleX:ku(i,Sd),scaleY:ku(o,Sd)}},t.useDomEvent=function(t,n,i,o){e.useEffect(()=>{const e=t.current;if(i&&e)return $a(e,n,i,o)},[t,n,i,o])},t.useDragControls=function(){return f(sd)},t.useElementScroll=function(t){return Kh({container:t})},t.useFollowValue=_h,t.useForceUpdate=_l,t.useInView=function(t,{root:n,margin:i,amount:o,once:s=!1,initial:r=!1}={}){const[a,l]=e.useState(r);return e.useEffect(()=>{if(!t.current||s&&a)return;const e={root:n&&n.current||void 0,margin:i,amount:o};return Fh(t.current,()=>(l(!0),s?void 0:()=>l(!1)),e)},[n,t,i,s,o]),a},t.useInstantLayoutTransition=ad,t.useInstantTransition=function(){const[t,n]=_l(),i=ad(),o=e.useRef(-1);return e.useEffect(()=>{rt.postRender(()=>rt.postRender(()=>{n===o.current&&(P.instantAnimations=!1)}))},[n]),e=>{i(()=>{P.instantAnimations=!0,t(),e(),o.current=n+1})}},t.useIsPresent=function(){return null===(t=e.useContext(v))||t.isPresent;var t},t.useIsomorphicLayoutEffect=y,t.useMotionTemplate=function(t,...e){const n=t.length;return Vu(e.filter(Mi),function(){let i="";for(let o=0;o{const t=()=>n(!document.hidden);return document.hidden&&t(),document.addEventListener("visibilitychange",t),()=>{document.removeEventListener("visibilitychange",t)}},[]),t},t.usePresence=Hl,t.usePresenceData=function(){const t=e.useContext(v);return t?t.custom:void 0},t.useReducedMotion=Jh,t.useReducedMotionConfig=Qh,t.useResetProjection=function(){return e.useCallback(()=>{const t=Al.current;t&&t.resetTree()},[])},t.useScroll=Kh,t.useSpring=function(t,e={}){return _h(t,{type:"spring",...e})},t.useTime=function(){const t=Cu(0);return qh(e=>t.set(e)),t},t.useTransform=ku,t.useUnmountEffect=$h,t.useVelocity=function(t){const e=Cu(t.getVelocity()),n=()=>{const i=t.getVelocity();e.set(i),i&&rt.update(n)};return Yh(t,"change",()=>{rt.update(n,!1,!0)}),e},t.useViewportScroll=function(){return Kh()},t.useWillChange=function(){return f(()=>new Zh("auto"))},t.variantPriorityOrder=zs,t.variantProps=Ys,t.velocityPerSecond=O,t.vh=Bt,t.visualElementStore=$s,t.vw=Ot,t.warnOnce=I,t.wrap=F}); diff --git a/node_modules/framer-motion/dist/index.d.ts b/node_modules/framer-motion/dist/index.d.ts deleted file mode 100644 index be769c6..0000000 --- a/node_modules/framer-motion/dist/index.d.ts +++ /dev/null @@ -1,1740 +0,0 @@ -/// -import * as motion_dom from 'motion-dom'; -import { AnyResolvedKeyframe, OnKeyframesResolved, KeyframeResolver, MotionNodeOptions, MotionValue, TransformProperties, SVGPathProperties, Transition, PresenceContextProps, ResolvedValues, VisualElement, Feature, UnresolvedValueKeyframe, AnimationOptions, ElementOrSelector, DOMKeyframesDefinition, AnimationPlaybackOptions, AnimationPlaybackControlsWithThen, ValueAnimationTransition, AnimationScope, AnimationPlaybackControls, EventInfo, MotionValueEventCallbacks, FollowValueOptions, SpringOptions, TransformOptions, WillChange, LegacyAnimationControls, NodeGroup, IProjectionNode } from 'motion-dom'; -export * from 'motion-dom'; -export { ArcOptions, DelayedFunction, FlatTree, FollowValueOptions, IProjectionNode, MotionPath, ResolvedValues, VisualElement, addScaleCorrector, animateVisualElement, arc, buildTransform, calcLength, createBox, delay, optimizedAppearDataAttribute, resolveMotionValue, visualElementStore } from 'motion-dom'; -import * as react_jsx_runtime from 'react/jsx-runtime'; -import * as React$1 from 'react'; -import { CSSProperties, PropsWithoutRef, RefAttributes, JSX, SVGAttributes, useEffect, RefObject } from 'react'; -import { TransformPoint, Easing, EasingFunction, Point } from 'motion-utils'; -export * from 'motion-utils'; -export { MotionGlobalConfig } from 'motion-utils'; - -type ResolveKeyframes = (keyframes: V[], onComplete: OnKeyframesResolved, name?: string, motionValue?: any) => KeyframeResolver; - -/** - * @public - */ -interface AnimatePresenceProps { - /** - * By passing `initial={false}`, `AnimatePresence` will disable any initial animations on children - * that are present when the component is first rendered. - * - * ```jsx - * - * {isVisible && ( - * - * )} - * - * ``` - * - * @public - */ - initial?: boolean; - /** - * When a component is removed, there's no longer a chance to update its props. So if a component's `exit` - * prop is defined as a dynamic variant and you want to pass a new `custom` prop, you can do so via `AnimatePresence`. - * This will ensure all leaving components animate using the latest data. - * - * @public - */ - custom?: any; - /** - * Fires when all exiting nodes have completed animating out. - * - * @public - */ - onExitComplete?: () => void; - /** - * Determines how to handle entering and exiting elements. - * - * - `"sync"`: Default. Elements animate in and out as soon as they're added/removed. - * - `"popLayout"`: Exiting elements are "popped" from the page layout, allowing sibling - * elements to immediately occupy their new layouts. - * - `"wait"`: Only renders one component at a time. Wait for the exiting component to animate out - * before animating the next component in. - * - * @public - */ - mode?: "sync" | "popLayout" | "wait"; - /** - * Root element to use when injecting styles, used when mode === `"popLayout"`. - * This defaults to document.head but can be overridden e.g. for use in shadow DOM. - */ - root?: HTMLElement | ShadowRoot; - /** - * Internal. Used in Framer to flag that sibling children *shouldn't* re-render as a result of a - * child being removed. - */ - presenceAffectsLayout?: boolean; - /** - * If true, the `AnimatePresence` component will propagate parent exit animations - * to its children. - */ - propagate?: boolean; - /** - * Internal. Set whether to anchor the x position of the exiting element to the left or right - * when using `mode="popLayout"`. - */ - anchorX?: "left" | "right"; - /** - * Internal. Set whether to anchor the y position of the exiting element to the top or bottom - * when using `mode="popLayout"`. Use `"bottom"` for elements originally positioned with - * `bottom: 0` to prevent them from shifting during exit animations. - */ - anchorY?: "top" | "bottom"; -} - -/** - * `AnimatePresence` enables the animation of components that have been removed from the tree. - * - * When adding/removing more than a single child, every child **must** be given a unique `key` prop. - * - * Any `motion` components that have an `exit` property defined will animate out when removed from - * the tree. - * - * ```jsx - * import { motion, AnimatePresence } from 'framer-motion' - * - * export const Items = ({ items }) => ( - * - * {items.map(item => ( - * - * ))} - * - * ) - * ``` - * - * You can sequence exit animations throughout a tree using variants. - * - * If a child contains multiple `motion` components with `exit` props, it will only unmount the child - * once all `motion` components have finished animating out. Likewise, any components using - * `usePresence` all need to call `safeToRemove`. - * - * @public - */ -declare const AnimatePresence: ({ children, custom, initial, onExitComplete, presenceAffectsLayout, mode, propagate, anchorX, anchorY, root }: React$1.PropsWithChildren) => react_jsx_runtime.JSX.Element | null; - -interface Props$3 { - children: React$1.ReactElement; - isPresent: boolean; - anchorX?: "left" | "right"; - anchorY?: "top" | "bottom"; - root?: HTMLElement | ShadowRoot; - pop?: boolean; -} -declare function PopChild({ children, isPresent, anchorX, anchorY, root, pop }: Props$3): react_jsx_runtime.JSX.Element; - -/** - * Either a string, or array of strings, that reference variants defined via the `variants` prop. - * @public - */ -type VariantLabels = string | string[]; - -type MotionValueString = MotionValue; -type MotionValueNumber = MotionValue; -type MotionValueAny = MotionValue; -type AnyMotionValue = MotionValueNumber | MotionValueString | MotionValueAny; -type MotionValueHelper = T | AnyMotionValue; -type MakeMotionHelper = { - [K in keyof T]: MotionValueHelper; -}; -type MakeCustomValueTypeHelper = MakeMotionHelper; -type MakeMotion = MakeCustomValueTypeHelper; -type MotionCSS = MakeMotion>; -/** - * @public - */ -type MotionTransform = MakeMotion; -type MotionSVGProps = MakeMotion; -/** - * @public - */ -interface MotionStyle extends MotionCSS, MotionTransform, MotionSVGProps { -} -/** - * Props for `motion` components. - * - * @public - */ -interface MotionProps extends MotionNodeOptions { - /** - * - * The React DOM `style` prop, enhanced with support for `MotionValue`s and separate `transform` values. - * - * ```jsx - * export const MyComponent = () => { - * const x = useMotionValue(0) - * - * return - * } - * ``` - */ - style?: MotionStyle; - children?: React.ReactNode | MotionValueNumber | MotionValueString; -} - -interface PresenceChildProps { - children: React$1.ReactElement; - isPresent: boolean; - onExitComplete?: () => void; - initial?: false | VariantLabels; - custom?: any; - presenceAffectsLayout: boolean; - mode: "sync" | "popLayout" | "wait"; - anchorX?: "left" | "right"; - anchorY?: "top" | "bottom"; - root?: HTMLElement | ShadowRoot; -} -declare const PresenceChild: ({ children, initial, isPresent, onExitComplete, custom, presenceAffectsLayout, mode, anchorX, anchorY, root }: PresenceChildProps) => react_jsx_runtime.JSX.Element; - -type InheritOption = boolean | "id"; -interface Props$2 { - id?: string; - inherit?: InheritOption; -} -declare const LayoutGroup: React$1.FunctionComponent>; - -type ReducedMotionConfig = "always" | "never" | "user"; -type IsValidProp = (key: string) => boolean; -/** - * @public - */ -interface MotionConfigContext { - /** - * Internal, exported only for usage in Framer - */ - transformPagePoint: TransformPoint; - /** - * Internal. Determines whether this is a static context ie the Framer canvas. If so, - * it'll disable all dynamic functionality. - */ - isStatic: boolean; - /** - * Defines a new default transition for the entire tree. - * - * @public - */ - transition?: Transition; - /** - * If true, will respect the device prefersReducedMotion setting by switching - * transform animations off. - * - * @public - */ - reducedMotion?: ReducedMotionConfig; - /** - * A custom `nonce` attribute used when wanting to enforce a Content Security Policy (CSP). - * For more details see: - * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/style-src#unsafe_inline_styles - * - * @public - */ - nonce?: string; - /** - * If true, all animations will be skipped and values will be set instantly. - * Useful for E2E tests and visual regression testing. - * - * @public - */ - skipAnimations?: boolean; - /** - * Determines whether a prop should be forwarded to the DOM. - * Useful when wrapping Motion components with a styling library. - * - * @public - */ - isValidProp?: IsValidProp; -} -/** - * @public - */ -declare const MotionConfigContext: React$1.Context; - -/** - * @public - */ -declare const PresenceContext: React$1.Context; - -interface VisualState { - renderState: RenderState; - latestValues: ResolvedValues; - onMount?: (instance: Instance) => void; -} -type UseVisualState = (props: MotionProps, isStatic: boolean) => VisualState; -interface UseVisualStateConfig { - scrapeMotionValuesFromProps: ScrapeMotionValuesFromProps; - createRenderState: () => RenderState; -} -declare const makeUseVisualState: (config: UseVisualStateConfig) => UseVisualState; - -interface HTMLElements { - a: HTMLAnchorElement; - abbr: HTMLElement; - address: HTMLElement; - area: HTMLAreaElement; - article: HTMLElement; - aside: HTMLElement; - audio: HTMLAudioElement; - b: HTMLElement; - base: HTMLBaseElement; - bdi: HTMLElement; - bdo: HTMLElement; - big: HTMLElement; - blockquote: HTMLQuoteElement; - body: HTMLBodyElement; - br: HTMLBRElement; - button: HTMLButtonElement; - canvas: HTMLCanvasElement; - caption: HTMLElement; - center: HTMLElement; - cite: HTMLElement; - code: HTMLElement; - col: HTMLTableColElement; - colgroup: HTMLTableColElement; - data: HTMLDataElement; - datalist: HTMLDataListElement; - dd: HTMLElement; - del: HTMLModElement; - details: HTMLDetailsElement; - dfn: HTMLElement; - dialog: HTMLDialogElement; - div: HTMLDivElement; - dl: HTMLDListElement; - dt: HTMLElement; - em: HTMLElement; - embed: HTMLEmbedElement; - fieldset: HTMLFieldSetElement; - figcaption: HTMLElement; - figure: HTMLElement; - footer: HTMLElement; - form: HTMLFormElement; - h1: HTMLHeadingElement; - h2: HTMLHeadingElement; - h3: HTMLHeadingElement; - h4: HTMLHeadingElement; - h5: HTMLHeadingElement; - h6: HTMLHeadingElement; - head: HTMLHeadElement; - header: HTMLElement; - hgroup: HTMLElement; - hr: HTMLHRElement; - html: HTMLHtmlElement; - i: HTMLElement; - iframe: HTMLIFrameElement; - img: HTMLImageElement; - input: HTMLInputElement; - ins: HTMLModElement; - kbd: HTMLElement; - keygen: HTMLElement; - label: HTMLLabelElement; - legend: HTMLLegendElement; - li: HTMLLIElement; - link: HTMLLinkElement; - main: HTMLElement; - map: HTMLMapElement; - mark: HTMLElement; - menu: HTMLElement; - menuitem: HTMLElement; - meta: HTMLMetaElement; - meter: HTMLMeterElement; - nav: HTMLElement; - noindex: HTMLElement; - noscript: HTMLElement; - object: HTMLObjectElement; - ol: HTMLOListElement; - optgroup: HTMLOptGroupElement; - option: HTMLOptionElement; - output: HTMLOutputElement; - p: HTMLParagraphElement; - param: HTMLParamElement; - picture: HTMLElement; - pre: HTMLPreElement; - progress: HTMLProgressElement; - q: HTMLQuoteElement; - rp: HTMLElement; - rt: HTMLElement; - ruby: HTMLElement; - s: HTMLElement; - samp: HTMLElement; - search: HTMLElement; - slot: HTMLSlotElement; - script: HTMLScriptElement; - section: HTMLElement; - select: HTMLSelectElement; - small: HTMLElement; - source: HTMLSourceElement; - span: HTMLSpanElement; - strong: HTMLElement; - style: HTMLStyleElement; - sub: HTMLElement; - summary: HTMLElement; - sup: HTMLElement; - table: HTMLTableElement; - template: HTMLTemplateElement; - tbody: HTMLTableSectionElement; - td: HTMLTableDataCellElement; - textarea: HTMLTextAreaElement; - tfoot: HTMLTableSectionElement; - th: HTMLTableHeaderCellElement; - thead: HTMLTableSectionElement; - time: HTMLTimeElement; - title: HTMLTitleElement; - tr: HTMLTableRowElement; - track: HTMLTrackElement; - u: HTMLElement; - ul: HTMLUListElement; - var: HTMLElement; - video: HTMLVideoElement; - wbr: HTMLElement; - webview: HTMLWebViewElement; -} - -/** - * @public - */ -type ForwardRefComponent = { - readonly $$typeof: symbol; -} & ((props: PropsWithoutRef

& RefAttributes) => JSX.Element); -type AttributesWithoutMotionProps = { - [K in Exclude]?: Attributes[K]; -}; -/** - * @public - */ -type HTMLMotionProps = AttributesWithoutMotionProps & MotionProps; -/** - * Motion-optimised versions of React's HTML components. - * - * @public - */ -type HTMLMotionComponents = { - [K in keyof HTMLElements]: ForwardRefComponent>; -}; - -type UnionStringArray> = T[number]; -declare const svgElements: readonly ["animate", "circle", "defs", "desc", "ellipse", "g", "image", "line", "filter", "marker", "mask", "metadata", "path", "pattern", "polygon", "polyline", "rect", "stop", "svg", "switch", "symbol", "text", "tspan", "use", "view", "clipPath", "feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence", "foreignObject", "linearGradient", "radialGradient", "textPath"]; -type SVGElements = UnionStringArray; - -interface SVGAttributesWithoutMotionProps extends Pick, Exclude, keyof MotionProps>> { -} -/** - * Blanket-accept any SVG attribute as a `MotionValue` - * @public - */ -type SVGAttributesAsMotionValues = MakeMotion>; -type UnwrapSVGFactoryElement = F extends React.SVGProps ? P : never; -/** - * @public - */ -interface SVGMotionProps extends SVGAttributesAsMotionValues, MotionProps { -} -/** - * Motion-optimised versions of React's SVG components. - * - * @public - */ -type SVGMotionComponents = { - [K in SVGElements]: ForwardRefComponent, SVGMotionProps>>; -}; - -type DOMMotionComponents = HTMLMotionComponents & SVGMotionComponents; - -type ScrapeMotionValuesFromProps = (props: MotionProps, prevProps: MotionProps, visualElement?: VisualElement) => { - [key: string]: MotionValue | AnyResolvedKeyframe; -}; -interface VisualElementOptions { - visualState: VisualState; - parent?: VisualElement; - variantParent?: VisualElement; - presenceContext: PresenceContextProps | null; - props: MotionProps; - blockInitialAnimation?: boolean; - reducedMotionConfig?: ReducedMotionConfig; - /** - * If true, all animations will be skipped and values will be set instantly. - * Useful for E2E tests and visual regression testing. - */ - skipAnimations?: boolean; - /** - * Explicit override for SVG detection. When true, uses SVG rendering; - * when false, uses HTML rendering. If undefined, auto-detects. - */ - isSVG?: boolean; -} - -type CreateVisualElement = (Component: TagName | string | React.ComponentType, options: VisualElementOptions) => VisualElement; - -declare function MeasureLayout(props: MotionProps & { - visualElement: VisualElement; -}): react_jsx_runtime.JSX.Element; - -interface FeatureClass { - new (props: Props): Feature; -} -interface HydratedFeatureDefinition { - isEnabled: (props: MotionProps) => boolean; - Feature: FeatureClass; - ProjectionNode?: any; - MeasureLayout?: typeof MeasureLayout; -} -interface HydratedFeatureDefinitions { - animation?: HydratedFeatureDefinition; - exit?: HydratedFeatureDefinition; - drag?: HydratedFeatureDefinition; - tap?: HydratedFeatureDefinition; - focus?: HydratedFeatureDefinition; - hover?: HydratedFeatureDefinition; - pan?: HydratedFeatureDefinition; - inView?: HydratedFeatureDefinition; - layout?: HydratedFeatureDefinition; -} -interface FeatureDefinition { - isEnabled: HydratedFeatureDefinition["isEnabled"]; - Feature?: HydratedFeatureDefinition["Feature"]; - ProjectionNode?: HydratedFeatureDefinition["ProjectionNode"]; - MeasureLayout?: HydratedFeatureDefinition["MeasureLayout"]; -} -type FeatureDefinitions = { - [K in keyof HydratedFeatureDefinitions]: FeatureDefinition; -}; -interface FeaturePackage { - Feature?: HydratedFeatureDefinition["Feature"]; - ProjectionNode?: HydratedFeatureDefinition["ProjectionNode"]; - MeasureLayout?: HydratedFeatureDefinition["MeasureLayout"]; -} -type FeaturePackages = { - [K in keyof HydratedFeatureDefinitions]: FeaturePackage; -}; -interface FeatureBundle extends FeaturePackages { - renderer: CreateVisualElement; -} -type LazyFeatureBundle$1 = () => Promise; - -type LazyFeatureBundle = () => Promise; -/** - * @public - */ -interface LazyProps { - children?: React.ReactNode; - /** - * Can be used to provide a feature bundle synchronously or asynchronously. - * - * ```jsx - * // features.js - * import { domAnimation } from "framer-motion" - * export default domAnimation - * - * // index.js - * import { LazyMotion, m } from "framer-motion" - * - * const loadFeatures = () =>import("./features.js") - * .then(res => res.default) - * - * function Component() { - * return ( - * - * - * - * ) - * } - * ``` - * - * @public - */ - features: FeatureBundle | LazyFeatureBundle; - /** - * If `true`, will throw an error if a `motion` component renders within - * a `LazyMotion` component. - * - * ```jsx - * // This component will throw an error that explains using a motion component - * // instead of the m component will break the benefits of code-splitting. - * function Component() { - * return ( - * - * - * - * ) - * } - * ``` - * - * @public - */ - strict?: boolean; -} - -/** - * Used in conjunction with the `m` component to reduce bundle size. - * - * `m` is a version of the `motion` component that only loads functionality - * critical for the initial render. - * - * `LazyMotion` can then be used to either synchronously or asynchronously - * load animation and gesture support. - * - * ```jsx - * // Synchronous loading - * import { LazyMotion, m, domAnimation } from "framer-motion" - * - * function App() { - * return ( - * - * - * - * ) - * } - * - * // Asynchronous loading - * import { LazyMotion, m } from "framer-motion" - * - * function App() { - * return ( - * import('./path/to/domAnimation')}> - * - * - * ) - * } - * ``` - * - * @public - */ -declare function LazyMotion({ children, features, strict }: LazyProps): react_jsx_runtime.JSX.Element; - -interface MotionConfigProps extends Partial { - children?: React$1.ReactNode; -} -/** - * `MotionConfig` is used to set configuration options for all children `motion` components. - * - * ```jsx - * import { motion, MotionConfig } from "framer-motion" - * - * export function App() { - * return ( - * - * - * - * ) - * } - * ``` - * - * @public - */ -declare function MotionConfig({ children, ...config }: MotionConfigProps): react_jsx_runtime.JSX.Element; - -/** - * Lifecycle callbacks are not supported on individual sequence segments - * because segments are consolidated into a single animation per subject. - * Use sequence-level options (e.g. SequenceOptions.onComplete) instead. - */ -type LifecycleCallbacks = "onUpdate" | "onPlay" | "onComplete" | "onRepeat" | "onStop"; -/** - * Distributive Omit preserves union branches (unlike plain Omit). - */ -type DistributiveOmit = T extends any ? Omit : never; -type SegmentTransitionOptions = DistributiveOmit & At; -type SegmentValueTransitionOptions = DistributiveOmit & At; -type ObjectTarget = { - [K in keyof O]?: O[K] | UnresolvedValueKeyframe[]; -}; -type SequenceTime = number | "<" | `+${number}` | `-${number}` | `${string}`; -type SequenceLabel = string; -interface SequenceLabelWithTime { - name: SequenceLabel; - at: SequenceTime; -} -interface At { - at?: SequenceTime; -} -type MotionValueSegment = [ - MotionValue, - UnresolvedValueKeyframe | UnresolvedValueKeyframe[] -]; -type MotionValueSegmentWithTransition = [ - MotionValue, - UnresolvedValueKeyframe | UnresolvedValueKeyframe[], - SegmentValueTransitionOptions -]; -type DOMSegment = [ElementOrSelector, DOMKeyframesDefinition]; -type DOMSegmentWithTransition = [ - ElementOrSelector, - DOMKeyframesDefinition, - SegmentTransitionOptions -]; -type ObjectSegment = [O, ObjectTarget]; -type ObjectSegmentWithTransition = [ - O, - ObjectTarget, - SegmentTransitionOptions -]; -type SequenceProgressCallback = (value: any) => void; -type FunctionSegment = [SequenceProgressCallback] | [SequenceProgressCallback, SegmentTransitionOptions] | [ - SequenceProgressCallback, - UnresolvedValueKeyframe | UnresolvedValueKeyframe[], - SegmentTransitionOptions -]; -type Segment = ObjectSegment | ObjectSegmentWithTransition | SequenceLabel | SequenceLabelWithTime | MotionValueSegment | MotionValueSegmentWithTransition | DOMSegment | DOMSegmentWithTransition | FunctionSegment; -type AnimationSequence = Segment[]; -interface SequenceOptions extends AnimationPlaybackOptions { - delay?: number; - duration?: number; - defaultTransition?: Transition; - reduceMotion?: boolean; - skipAnimations?: boolean; - onComplete?: () => void; -} -interface AbsoluteKeyframe { - value: AnyResolvedKeyframe | null; - at: number; - easing?: Easing; -} -type ValueSequence = AbsoluteKeyframe[]; -interface SequenceMap { - [key: string]: ValueSequence; -} -type ResolvedAnimationDefinition = { - keyframes: { - [key: string]: UnresolvedValueKeyframe[]; - }; - transition: { - [key: string]: Transition; - }; -}; -type ResolvedAnimationDefinitions = Map; - -interface ScopedAnimateOptions { - scope?: AnimationScope; - reduceMotion?: boolean; - skipAnimations?: boolean; -} -/** - * Creates an animation function that is optionally scoped - * to a specific element. - */ -declare function createScopedAnimate(options?: ScopedAnimateOptions): { - (sequence: AnimationSequence, options?: SequenceOptions): AnimationPlaybackControlsWithThen; - (value: string | MotionValue, keyframes: string | UnresolvedValueKeyframe[], options?: ValueAnimationTransition): AnimationPlaybackControlsWithThen; - (value: number | MotionValue, keyframes: number | UnresolvedValueKeyframe[], options?: ValueAnimationTransition): AnimationPlaybackControlsWithThen; - (value: V | MotionValue, keyframes: V | UnresolvedValueKeyframe[], options?: ValueAnimationTransition): AnimationPlaybackControlsWithThen; - (element: ElementOrSelector, keyframes: DOMKeyframesDefinition, options?: AnimationOptions): AnimationPlaybackControlsWithThen; - (object: O | O[], keyframes: ObjectTarget, options?: AnimationOptions): AnimationPlaybackControlsWithThen; -}; -declare const animate: { - (sequence: AnimationSequence, options?: SequenceOptions): AnimationPlaybackControlsWithThen; - (value: string | MotionValue, keyframes: string | UnresolvedValueKeyframe[], options?: ValueAnimationTransition): AnimationPlaybackControlsWithThen; - (value: number | MotionValue, keyframes: number | UnresolvedValueKeyframe[], options?: ValueAnimationTransition): AnimationPlaybackControlsWithThen; - (value: V | MotionValue, keyframes: V | UnresolvedValueKeyframe[], options?: ValueAnimationTransition): AnimationPlaybackControlsWithThen; - (element: ElementOrSelector, keyframes: DOMKeyframesDefinition, options?: AnimationOptions): AnimationPlaybackControlsWithThen; - (object: O | O[], keyframes: ObjectTarget, options?: AnimationOptions): AnimationPlaybackControlsWithThen; -}; - -declare const animateMini: (elementOrSelector: ElementOrSelector, keyframes: DOMKeyframesDefinition, options?: AnimationOptions) => AnimationPlaybackControlsWithThen; - -interface ScrollOptions { - source?: HTMLElement; - container?: Element; - target?: Element; - axis?: "x" | "y"; - offset?: ScrollOffset; -} -type OnScrollProgress = (progress: number) => void; -type OnScrollWithInfo = (progress: number, info: ScrollInfo) => void; -type OnScroll = OnScrollProgress | OnScrollWithInfo; -interface AxisScrollInfo { - current: number; - offset: number[]; - progress: number; - scrollLength: number; - velocity: number; - targetOffset: number; - targetLength: number; - containerLength: number; - interpolatorOffsets?: number[]; - interpolate?: EasingFunction; -} -interface ScrollInfo { - time: number; - x: AxisScrollInfo; - y: AxisScrollInfo; -} -type OnScrollInfo = (info: ScrollInfo) => void; -type SupportedEdgeUnit = "px" | "vw" | "vh" | "%"; -type EdgeUnit = `${number}${SupportedEdgeUnit}`; -type NamedEdges = "start" | "end" | "center"; -type EdgeString = NamedEdges | EdgeUnit | `${number}`; -type Edge = EdgeString | number; -type ProgressIntersection = [number, number]; -type Intersection = `${Edge} ${Edge}`; -type ScrollOffset = Array; -interface ScrollInfoOptions { - container?: Element; - target?: Element; - axis?: "x" | "y"; - offset?: ScrollOffset; - /** - * When true, enables per-frame checking of scrollWidth/scrollHeight - * to detect content size changes and recalculate scroll progress. - * - * @default false - */ - trackContentSize?: boolean; -} - -declare function scroll(onScroll: OnScroll | AnimationPlaybackControls, { axis, container, ...options }?: ScrollOptions): VoidFunction; - -declare function scrollInfo(onScroll: OnScrollInfo, { container, trackContentSize, ...options }?: ScrollInfoOptions): VoidFunction; - -type ViewChangeHandler = (entry: IntersectionObserverEntry) => void; -type MarginValue = `${number}${"px" | "%"}`; -type MarginType = MarginValue | `${MarginValue} ${MarginValue}` | `${MarginValue} ${MarginValue} ${MarginValue}` | `${MarginValue} ${MarginValue} ${MarginValue} ${MarginValue}`; -interface InViewOptions { - root?: Element | Document; - margin?: MarginType; - amount?: "some" | "all" | number; -} -declare function inView(elementOrSelector: ElementOrSelector, onStart: (element: Element, entry: IntersectionObserverEntry) => void | ViewChangeHandler, { root, margin: rootMargin, amount }?: InViewOptions): VoidFunction; - -declare const distance: (a: number, b: number) => number; -declare function distance2D(a: Point, b: Point): number; - -type ReorderAxis = "x" | "y" | "xy"; -type ReorderElementTag = keyof HTMLElements; -type DefaultGroupElement = "ul"; -type DefaultItemElement = "li"; - -interface Props$1 { - /** - * A HTML element to render this component as. Defaults to `"ul"`. - * - * @public - */ - as?: TagName; - /** - * The axis to reorder along. By default, this is detected from the item - * layout. Use `"xy"` to explicitly enable wrapped layout reordering. - * - * @public - */ - axis?: ReorderAxis; - /** - * A callback to fire with the new value order. For instance, if the values - * are provided as a state from `useState`, this could be the set state function. - * - * @public - */ - onReorder: (newOrder: V[]) => void; - /** - * The latest values state. - * - * ```jsx - * function Component() { - * const [items, setItems] = useState([0, 1, 2]) - * - * return ( - * - * {items.map((item) => )} - * - * ) - * } - * ``` - * - * @public - */ - values: V[]; -} -type ReorderGroupProps = Props$1 & Omit, "values"> & React$1.PropsWithChildren<{}>; -declare function ReorderGroupComponent({ children, as, axis: axisOverride, onReorder, values, ...props }: ReorderGroupProps, externalRef?: React$1.ForwardedRef): JSX.Element; -declare const ReorderGroup: (props: Omit, "values" | "onReorder"> & { - values: Values; - onReorder: (newOrder: Values) => void; -} & { - ref?: React$1.ForwardedRef | undefined; -}) => ReturnType; - -interface Props { - /** - * A HTML element to render this component as. Defaults to `"li"`. - * - * @public - */ - as?: TagName; - /** - * The value in the list that this component represents. - * - * @public - */ - value: V; - /** - * A subset of layout options primarily used to disable layout="size" - * - * @public - * @default true - */ - layout?: true | "position"; -} -type ReorderItemProps = Props & Omit, "value" | "layout"> & React$1.PropsWithChildren<{}>; -declare function ReorderItemComponent({ children, style, value, as, onDrag, onDragEnd, layout, ...props }: ReorderItemProps, externalRef?: React$1.ForwardedRef): React$1.JSX.Element; -declare const ReorderItem: (props: ReorderItemProps & { - ref?: React$1.ForwardedRef; -}) => ReturnType; - -declare namespace namespace_d { - export { ReorderGroup as Group, ReorderItem as Item }; -} - -type MotionComponentProps = { - [K in Exclude]?: Props[K]; -} & MotionProps; -type MotionComponent = T extends keyof DOMMotionComponents ? DOMMotionComponents[T] : React$1.ComponentType, "children"> & { - children?: "children" extends keyof P ? P["children"] | MotionComponentProps

["children"] : MotionComponentProps

["children"]; -}>; -interface MotionComponentOptions { - forwardMotionProps?: boolean; - /** - * Specify whether the component renders an HTML or SVG element. - * This is useful when wrapping custom SVG components that need - * SVG-specific attribute handling (like viewBox animation). - * By default, Motion auto-detects based on the component name, - * but custom React components are always treated as HTML. - */ - type?: "html" | "svg"; -} -/** - * Create a `motion` component. - * - * This function accepts a Component argument, which can be either a string (ie "div" - * for `motion.div`), or an actual React component. - * - * Alongside this is a config option which provides a way of rendering the provided - * component "offline", or outside the React render cycle. - */ -declare function createMotionComponent(Component: TagName | string | React$1.ComponentType, { forwardMotionProps, type }?: MotionComponentOptions, preloadedFeatures?: FeaturePackages, createVisualElement?: CreateVisualElement): MotionComponent; - -declare const m: typeof createMotionComponent & HTMLMotionComponents & SVGMotionComponents & { - create: typeof createMotionComponent; -}; - -declare const motion: typeof createMotionComponent & HTMLMotionComponents & SVGMotionComponents & { - create: typeof createMotionComponent; -}; - -type EventListenerWithPointInfo = (e: PointerEvent, info: EventInfo) => void; -declare const addPointerInfo: (handler: EventListenerWithPointInfo) => EventListener; - -declare function addPointerEvent(target: EventTarget, eventName: string, handler: EventListenerWithPointInfo, options?: AddEventListenerOptions): () => void; - -declare const animations: FeaturePackages; - -declare function filterProps(props: MotionProps, isDom: boolean, forwardMotionProps: boolean, isValidProp?: IsValidProp): MotionProps; - -type AnimationType = "animate" | "whileHover" | "whileTap" | "whileDrag" | "whileFocus" | "whileInView" | "exit"; - -declare const isBrowser: boolean; - -/** - * Taken from https://github.com/radix-ui/primitives/blob/main/packages/react/compose-refs/src/compose-refs.tsx - */ - -type PossibleRef = React$1.Ref | undefined; -/** - * A custom hook that composes multiple refs - * Accepts callback refs and RefObject(s) - */ -declare function useComposedRefs(...refs: PossibleRef[]): React$1.RefCallback; - -declare function useForceUpdate(): [VoidFunction, number]; - -declare const useIsomorphicLayoutEffect: typeof useEffect; - -declare function useUnmountEffect(callback: () => void): void; - -/** - * @public - */ -declare const domAnimation: FeatureBundle; - -/** - * @public - */ -declare const domMax: FeatureBundle; - -/** - * @public - */ -declare const domMin: FeatureBundle; - -declare function useMotionValueEvent>(value: MotionValue, event: EventName, callback: MotionValueEventCallbacks[EventName]): void; - -/** - * @deprecated useElementScroll is deprecated. Convert to useScroll({ container: ref }) - */ -declare function useElementScroll(ref: RefObject): { - scrollX: motion_dom.MotionValue; - scrollY: motion_dom.MotionValue; - scrollXProgress: motion_dom.MotionValue; - scrollYProgress: motion_dom.MotionValue; -}; - -/** - * @deprecated useViewportScroll is deprecated. Convert to useScroll() - */ -declare function useViewportScroll(): { - scrollX: motion_dom.MotionValue; - scrollY: motion_dom.MotionValue; - scrollXProgress: motion_dom.MotionValue; - scrollYProgress: motion_dom.MotionValue; -}; - -/** - * Combine multiple motion values into a new one using a string template literal. - * - * ```jsx - * import { - * motion, - * useSpring, - * useMotionValue, - * useMotionTemplate - * } from "framer-motion" - * - * function Component() { - * const shadowX = useSpring(0) - * const shadowY = useMotionValue(0) - * const shadow = useMotionTemplate`drop-shadow(${shadowX}px ${shadowY}px 20px rgba(0,0,0,0.3))` - * - * return - * } - * ``` - * - * @public - */ -declare function useMotionTemplate(fragments: TemplateStringsArray, ...values: Array): MotionValue; - -/** - * Creates a `MotionValue` to track the state and velocity of a value. - * - * Usually, these are created automatically. For advanced use-cases, like use with `useTransform`, you can create `MotionValue`s externally and pass them into the animated component via the `style` prop. - * - * ```jsx - * export const MyComponent = () => { - * const scale = useMotionValue(1) - * - * return - * } - * ``` - * - * @param initial - The initial state. - * - * @public - */ -declare function useMotionValue(initial: T): MotionValue; - -interface UseScrollOptions extends Omit { - container?: RefObject; - target?: RefObject; -} -declare function useScroll({ container, target, ...options }?: UseScrollOptions): { - scrollX: motion_dom.MotionValue; - scrollY: motion_dom.MotionValue; - scrollXProgress: motion_dom.MotionValue; - scrollYProgress: motion_dom.MotionValue; -}; - -/** - * Creates a `MotionValue` that, when `set`, will use the specified animation transition to animate to its new state. - * - * Unlike `useSpring` which is limited to spring animations, `useFollowValue` accepts any motion transition - * including spring, tween, inertia, and keyframes. - * - * It can either work as a stand-alone `MotionValue` by initialising it with a value, or as a subscriber - * to another `MotionValue`. - * - * @remarks - * - * ```jsx - * // Spring animation (default) - * const x = useFollowValue(0, { stiffness: 300 }) - * - * // Tween animation - * const y = useFollowValue(0, { type: "tween", duration: 0.5, ease: "easeOut" }) - * - * // Track another MotionValue with spring - * const source = useMotionValue(0) - * const z = useFollowValue(source, { type: "spring", damping: 10 }) - * - * // Inertia animation - * const w = useFollowValue(0, { type: "inertia", velocity: 100 }) - * ``` - * - * @param inputValue - `MotionValue` or number. If provided a `MotionValue`, when the input `MotionValue` changes, the created `MotionValue` will animate towards that value using the specified transition. - * @param options - Animation transition options. Supports all transition types: spring, tween, inertia, keyframes. - * @returns `MotionValue` - * - * @public - */ -declare function useFollowValue(source: MotionValue, options?: FollowValueOptions): MotionValue; -declare function useFollowValue(source: string, options?: FollowValueOptions): MotionValue; -declare function useFollowValue(source: MotionValue, options?: FollowValueOptions): MotionValue; -declare function useFollowValue(source: number, options?: FollowValueOptions): MotionValue; - -type UseSpringOptions = SpringOptions & Pick; -/** - * Creates a `MotionValue` that, when `set`, will use a spring animation to animate to its new state. - * - * It can either work as a stand-alone `MotionValue` by initialising it with a value, or as a subscriber - * to another `MotionValue`. - * - * @remarks - * - * ```jsx - * const x = useSpring(0, { stiffness: 300 }) - * const y = useSpring(x, { damping: 10 }) - * ``` - * - * @param inputValue - `MotionValue` or number. If provided a `MotionValue`, when the input `MotionValue` changes, the created `MotionValue` will spring towards that value. - * @param springConfig - Configuration options for the spring. - * @returns `MotionValue` - * - * @public - */ -declare function useSpring(source: MotionValue, options?: UseSpringOptions): MotionValue; -declare function useSpring(source: string, options?: UseSpringOptions): MotionValue; -declare function useSpring(source: MotionValue, options?: UseSpringOptions): MotionValue; -declare function useSpring(source: number, options?: UseSpringOptions): MotionValue; - -declare function useTime(): motion_dom.MotionValue; - -type InputRange = number[]; -type SingleTransformer = (input: I) => O; -type MultiTransformer = (input: I[]) => O; -/** - * Create multiple `MotionValue`s that transform the output of another `MotionValue` by mapping it from one range of values into multiple output ranges. - * - * @remarks - * - * This is useful when you want to derive multiple values from a single input value. - * The keys of the output map must remain constant across renders. - * - * ```jsx - * export const MyComponent = () => { - * const x = useMotionValue(0) - * const { opacity, scale } = useTransform(x, [0, 100], { - * opacity: [0, 1], - * scale: [0.5, 1] - * }) - * - * return ( - * - * ) - * } - * ``` - * - * @param inputValue - `MotionValue` - * @param inputRange - A linear series of numbers (either all increasing or decreasing) - * @param outputMap - An object where keys map to output ranges. Each output range must be the same length as `inputRange`. - * @param options - Transform options applied to all outputs - * - * @returns An object with the same keys as `outputMap`, where each value is a `MotionValue` - * - * @public - */ -declare function useTransform>(inputValue: MotionValue, inputRange: InputRange, outputMap: T, options?: TransformOptions): { - [K in keyof T]: MotionValue; -}; -/** - * Create a `MotionValue` that transforms the output of another `MotionValue` by mapping it from one range of values into another. - * - * @remarks - * - * Given an input range of `[-200, -100, 100, 200]` and an output range of - * `[0, 1, 1, 0]`, the returned `MotionValue` will: - * - * - When provided a value between `-200` and `-100`, will return a value between `0` and `1`. - * - When provided a value between `-100` and `100`, will return `1`. - * - When provided a value between `100` and `200`, will return a value between `1` and `0` - * - * - * The input range must be a linear series of numbers. The output range - * can be any value type supported by Motion: numbers, colors, shadows, etc. - * - * Every value in the output range must be of the same type and in the same format. - * - * ```jsx - * export const MyComponent = () => { - * const x = useMotionValue(0) - * const xRange = [-200, -100, 100, 200] - * const opacityRange = [0, 1, 1, 0] - * const opacity = useTransform(x, xRange, opacityRange) - * - * return ( - * - * ) - * } - * ``` - * - * @param inputValue - `MotionValue` - * @param inputRange - A linear series of numbers (either all increasing or decreasing) - * @param outputRange - A series of numbers, colors or strings. Must be the same length as `inputRange`. - * @param options - - * - * - clamp: boolean. Clamp values to within the given range. Defaults to `true` - * - ease: EasingFunction[]. Easing functions to use on the interpolations between each value in the input and output ranges. If provided as an array, the array must be one item shorter than the input and output ranges, as the easings apply to the transition between each. - * - * @returns `MotionValue` - * - * @public - */ -declare function useTransform(value: MotionValue, inputRange: InputRange, outputRange: O[], options?: TransformOptions): MotionValue; -/** - * Create a `MotionValue` that transforms the output of another `MotionValue` through a function. - * In this example, `y` will always be double `x`. - * - * ```jsx - * export const MyComponent = () => { - * const x = useMotionValue(10) - * const y = useTransform(x, value => value * 2) - * - * return - * } - * ``` - * - * @param input - A `MotionValue` that will pass its latest value through `transform` to update the returned `MotionValue`. - * @param transform - A function that accepts the latest value from `input` and returns a new value. - * @returns `MotionValue` - * - * @public - */ -declare function useTransform(input: MotionValue, transformer: SingleTransformer): MotionValue; -/** - * Pass an array of `MotionValue`s and a function to combine them. In this example, `z` will be the `x` multiplied by `y`. - * - * ```jsx - * export const MyComponent = () => { - * const x = useMotionValue(0) - * const y = useMotionValue(0) - * const z = useTransform([x, y], ([latestX, latestY]) => latestX * latestY) - * - * return - * } - * ``` - * - * @param input - An array of `MotionValue`s that will pass their latest values through `transform` to update the returned `MotionValue`. - * @param transform - A function that accepts the latest values from `input` and returns a new value. - * @returns `MotionValue` - * - * @public - */ -declare function useTransform(input: MotionValue[] | MotionValue[] | MotionValue[], transformer: MultiTransformer): MotionValue; -declare function useTransform(transformer: () => O): MotionValue; - -/** - * Creates a `MotionValue` that updates when the velocity of the provided `MotionValue` changes. - * - * ```javascript - * const x = useMotionValue(0) - * const xVelocity = useVelocity(x) - * const xAcceleration = useVelocity(xVelocity) - * ``` - * - * @public - */ -declare function useVelocity(value: MotionValue): MotionValue; - -declare function useWillChange(): WillChange; - -declare class WillChangeMotionValue extends MotionValue implements WillChange { - private isEnabled; - add(name: string): void; - private update; -} - -/** - * A hook that returns `true` if we should be using reduced motion based on the current device's Reduced Motion setting. - * - * This can be used to implement changes to your UI based on Reduced Motion. For instance, replacing motion-sickness inducing - * `x`/`y` animations with `opacity`, disabling the autoplay of background videos, or turning off parallax motion. - * - * It will actively respond to changes and re-render your components with the latest setting. - * - * ```jsx - * export function Sidebar({ isOpen }) { - * const shouldReduceMotion = useReducedMotion() - * const closedX = shouldReduceMotion ? 0 : "-100%" - * - * return ( - * - * ) - * } - * ``` - * - * @return boolean - * - * @public - */ -declare function useReducedMotion(): boolean | null; - -declare function useReducedMotionConfig(): boolean | null; - -/** - * @public - */ -declare function animationControls(): LegacyAnimationControls; - -declare function useAnimate(): [AnimationScope, { - (sequence: AnimationSequence, options?: SequenceOptions | undefined): motion_dom.AnimationPlaybackControlsWithThen; - (value: string | motion_dom.MotionValue, keyframes: string | motion_dom.UnresolvedValueKeyframe[], options?: motion_dom.ValueAnimationTransition | undefined): motion_dom.AnimationPlaybackControlsWithThen; - (value: number | motion_dom.MotionValue, keyframes: number | motion_dom.UnresolvedValueKeyframe[], options?: motion_dom.ValueAnimationTransition | undefined): motion_dom.AnimationPlaybackControlsWithThen; - (value: V | motion_dom.MotionValue, keyframes: V | motion_dom.UnresolvedValueKeyframe[], options?: motion_dom.ValueAnimationTransition | undefined): motion_dom.AnimationPlaybackControlsWithThen; - (element: motion_dom.ElementOrSelector, keyframes: motion_dom.DOMKeyframesDefinition, options?: motion_dom.AnimationOptions | undefined): motion_dom.AnimationPlaybackControlsWithThen; - (object: O | O[], keyframes: ObjectTarget, options?: motion_dom.AnimationOptions | undefined): motion_dom.AnimationPlaybackControlsWithThen; -}]; - -declare function useAnimateMini(): [AnimationScope, (elementOrSelector: motion_dom.ElementOrSelector, keyframes: motion_dom.DOMKeyframesDefinition, options?: motion_dom.AnimationOptions | undefined) => motion_dom.AnimationPlaybackControlsWithThen]; - -/** - * Creates `LegacyAnimationControls`, which can be used to manually start, stop - * and sequence animations on one or more components. - * - * The returned `LegacyAnimationControls` should be passed to the `animate` property - * of the components you want to animate. - * - * These components can then be animated with the `start` method. - * - * ```jsx - * import * as React from 'react' - * import { motion, useAnimation } from 'framer-motion' - * - * export function MyComponent(props) { - * const controls = useAnimation() - * - * controls.start({ - * x: 100, - * transition: { duration: 0.5 }, - * }) - * - * return - * } - * ``` - * - * @returns Animation controller with `start` and `stop` methods - * - * @public - */ -declare function useAnimationControls(): LegacyAnimationControls; -declare const useAnimation: typeof useAnimationControls; - -type SafeToRemove = () => void; -type AlwaysPresent = [true, null]; -type Present = [true]; -type NotPresent = [false, SafeToRemove]; -/** - * When a component is the child of `AnimatePresence`, it can use `usePresence` - * to access information about whether it's still present in the React tree. - * - * ```jsx - * import { usePresence } from "framer-motion" - * - * export const Component = () => { - * const [isPresent, safeToRemove] = usePresence() - * - * useEffect(() => { - * !isPresent && setTimeout(safeToRemove, 1000) - * }, [isPresent]) - * - * return

- * } - * ``` - * - * If `isPresent` is `false`, it means that a component has been removed from the tree, - * but `AnimatePresence` won't really remove it until `safeToRemove` has been called. - * - * @public - */ -declare function usePresence(subscribe?: boolean): AlwaysPresent | Present | NotPresent; -/** - * Similar to `usePresence`, except `useIsPresent` simply returns whether or not the component is present. - * There is no `safeToRemove` function. - * - * ```jsx - * import { useIsPresent } from "framer-motion" - * - * export const Component = () => { - * const isPresent = useIsPresent() - * - * useEffect(() => { - * !isPresent && console.log("I've been removed!") - * }, [isPresent]) - * - * return
- * } - * ``` - * - * @public - */ -declare function useIsPresent(): boolean; - -declare function usePresenceData(): any; - -/** - * Attaches an event listener directly to the provided DOM element. - * - * Bypassing React's event system can be desirable, for instance when attaching non-passive - * event handlers. - * - * ```jsx - * const ref = useRef(null) - * - * useDomEvent(ref, 'wheel', onWheel, { passive: false }) - * - * return
- * ``` - * - * @param ref - React.RefObject that's been provided to the element you want to bind the listener to. - * @param eventName - Name of the event you want listen for. - * @param handler - Function to fire when receiving the event. - * @param options - Options to pass to `Event.addEventListener`. - * - * @public - */ -declare function useDomEvent(ref: RefObject, eventName: string, handler?: EventListener | undefined, options?: AddEventListenerOptions): void; - -interface DragControlOptions { - /** - * This distance after which dragging starts and a direction is locked in. - * - * @public - */ - distanceThreshold?: number; - /** - * Whether to immediately snap to the cursor when dragging starts. - * - * @public - */ - snapToCursor?: boolean; -} - -/** - * Can manually trigger a drag gesture on one or more `drag`-enabled `motion` components. - * - * ```jsx - * const dragControls = useDragControls() - * - * function startDrag(event) { - * dragControls.start(event, { snapToCursor: true }) - * } - * - * return ( - * <> - *
- * - * - * ) - * ``` - * - * @public - */ -declare class DragControls { - private componentControls; - /** - * Start a drag gesture on every `motion` component that has this set of drag controls - * passed into it via the `dragControls` prop. - * - * ```jsx - * dragControls.start(e, { - * snapToCursor: true - * }) - * ``` - * - * @param event - PointerEvent - * @param options - Options - * - * @public - */ - start(event: React$1.PointerEvent | PointerEvent, options?: DragControlOptions): void; - /** - * Cancels a drag gesture. - * - * ```jsx - * dragControls.cancel() - * ``` - * - * @public - */ - cancel(): void; - /** - * Stops a drag gesture. - * - * ```jsx - * dragControls.stop() - * ``` - * - * @public - */ - stop(): void; -} -/** - * Usually, dragging is initiated by pressing down on a `motion` component with a `drag` prop - * and moving it. For some use-cases, for instance clicking at an arbitrary point on a video scrubber, we - * might want to initiate that dragging from a different component than the draggable one. - * - * By creating a `dragControls` using the `useDragControls` hook, we can pass this into - * the draggable component's `dragControls` prop. It exposes a `start` method - * that can start dragging from pointer events on other components. - * - * ```jsx - * const dragControls = useDragControls() - * - * function startDrag(event) { - * dragControls.start(event, { snapToCursor: true }) - * } - * - * return ( - * <> - *
- * - * - * ) - * ``` - * - * @public - */ -declare function useDragControls(): DragControls; - -/** - * Checks if a component is a `motion` component. - */ -declare function isMotionComponent(component: React.ComponentType | string): boolean; - -/** - * Unwraps a `motion` component and returns either a string for `motion.div` or - * the React component for `motion(Component)`. - * - * If the component is not a `motion` component it returns undefined. - */ -declare function unwrapMotionComponent(component: React.ComponentType | string): React.ComponentType | string | undefined; - -/** - * Check whether a prop name is a valid `MotionProp` key. - * - * @param key - Name of the property to check - * @returns `true` is key is a valid `MotionProp`. - * - * @public - */ -declare function isValidMotionProp(key: string): boolean; - -declare function useInstantLayoutTransition(): (cb?: (() => void) | undefined) => void; - -declare function useResetProjection(): () => void; - -type FrameCallback = (timestamp: number, delta: number) => void; -declare function useAnimationFrame(callback: FrameCallback): void; - -type Cycle = (i?: number) => void; -type CycleState = [T, Cycle]; -/** - * Cycles through a series of visual properties. Can be used to toggle between or cycle through animations. It works similar to `useState` in React. It is provided an initial array of possible states, and returns an array of two arguments. - * - * An index value can be passed to the returned `cycle` function to cycle to a specific index. - * - * ```jsx - * import * as React from "react" - * import { motion, useCycle } from "framer-motion" - * - * export const MyComponent = () => { - * const [x, cycleX] = useCycle(0, 50, 100) - * - * return ( - * cycleX()} - * /> - * ) - * } - * ``` - * - * @param items - items to cycle through - * @returns [currentState, cycleState] - * - * @public - */ -declare function useCycle(...items: T[]): CycleState; - -interface UseInViewOptions extends Omit { - root?: RefObject; - once?: boolean; - amount?: "some" | "all" | number; - initial?: boolean; -} -declare function useInView(ref: RefObject, { root, margin, amount, once, initial, }?: UseInViewOptions): boolean; - -declare function useInstantTransition(): (callback: () => void) => void; -declare function disableInstantTransitions(): void; - -declare function usePageInView(): boolean; - -/** - * Creates a `transformPagePoint` function that accounts for SVG viewBox scaling. - * - * When dragging SVG elements inside an SVG with a viewBox that differs from - * the rendered dimensions (e.g., `viewBox="0 0 100 100"` but rendered at 500x500 pixels), - * pointer coordinates need to be transformed to match the SVG's coordinate system. - * - * @example - * ```jsx - * function App() { - * const svgRef = useRef(null) - * - * return ( - * - * - * - * - * - * ) - * } - * ``` - * - * @param svgRef - A React ref to the SVG element - * @returns A transformPagePoint function for use with MotionConfig - * - * @public - */ -declare function transformViewBoxPoint(svgRef: RefObject): TransformPoint; - -/** - * Creates a `transformPagePoint` function that corrects pointer coordinates - * for a parent container with CSS transforms (rotation, scale, skew). - * - * When dragging elements inside a transformed parent, pointer coordinates - * need to be transformed through the inverse of the parent's transform - * so the drag offset is in local space. - * - * Works with both static and continuously animating transforms. - * - * @example - * ```jsx - * function App() { - * const ref = useRef(null) - * - * return ( - * - * - * - * - * - * ) - * } - * ``` - * - * @param parentRef - A React ref to the transformed parent element - * @returns A transformPagePoint function for use with MotionConfig - * - * @public - */ -declare function correctParentTransform(parentRef: RefObject): TransformPoint; - -declare function startOptimizedAppearAnimation(element: HTMLElement, name: string, keyframes: string[] | number[], options: ValueAnimationTransition, onReady?: (animation: Animation) => void): void; - -interface LayoutGroupContextProps { - id?: string; - group?: NodeGroup; - forceRender?: VoidFunction; -} -declare const LayoutGroupContext: React$1.Context; - -interface MotionContextProps { - visualElement?: VisualElement; - initial?: false | string | string[]; - animate?: string | string[]; -} -declare const MotionContext: React$1.Context>; - -interface SwitchLayoutGroup { - register?: (member: IProjectionNode) => void; - deregister?: (member: IProjectionNode) => void; -} -type InitialPromotionConfig = { - /** - * The initial transition to use when the elements in this group mount (and automatically promoted). - * Subsequent updates should provide a transition in the promote method. - */ - transition?: Transition; - /** - * If the follow tree should preserve its opacity when the lead is promoted on mount - */ - shouldPreserveFollowOpacity?: (member: IProjectionNode) => boolean; -}; -type SwitchLayoutGroupContext = SwitchLayoutGroup & InitialPromotionConfig; -/** - * Internal, exported only for usage in Framer - */ -declare const SwitchLayoutGroupContext: React$1.Context; - -/** - * @public - */ -interface ScrollMotionValues { - scrollX: MotionValue; - scrollY: MotionValue; - scrollXProgress: MotionValue; - scrollYProgress: MotionValue; -} - -/** - * This is not an officially supported API and may be removed - * on any version. - */ -declare function useAnimatedState(initialState: any): any[]; - -declare const AnimateSharedLayout: React$1.FunctionComponent>; - -/** - * Note: Still used by components generated by old versions of Framer - * - * @deprecated - */ -declare const DeprecatedLayoutGroupContext: React$1.Context; - -interface ScaleMotionValues { - scaleX: MotionValue; - scaleY: MotionValue; -} -/** - * Returns a `MotionValue` each for `scaleX` and `scaleY` that update with the inverse - * of their respective parent scales. - * - * This is useful for undoing the distortion of content when scaling a parent component. - * - * By default, `useInvertedScale` will automatically fetch `scaleX` and `scaleY` from the nearest parent. - * By passing other `MotionValue`s in as `useInvertedScale({ scaleX, scaleY })`, it will invert the output - * of those instead. - * - * ```jsx - * const MyComponent = () => { - * const { scaleX, scaleY } = useInvertedScale() - * return - * } - * ``` - * - * @deprecated - */ -declare function useInvertedScale(scale?: Partial): ScaleMotionValues; - -export { type AbsoluteKeyframe, AnimatePresence, type AnimatePresenceProps, AnimateSharedLayout, type AnimationSequence, type AnimationType, type At, type CreateVisualElement, type Cycle, type CycleState, type DOMMotionComponents, type DOMSegment, type DOMSegmentWithTransition, DeprecatedLayoutGroupContext, DragControls, type FeatureBundle, type FeatureDefinition, type FeatureDefinitions, type FeaturePackage, type FeaturePackages, type ForwardRefComponent, type FunctionSegment, type HTMLElements, type HTMLMotionProps, type HydratedFeatureDefinition, type HydratedFeatureDefinitions, LayoutGroup, LayoutGroupContext, type LazyFeatureBundle$1 as LazyFeatureBundle, LazyMotion, type LazyProps, MotionConfig, MotionConfigContext, type MotionConfigProps, MotionContext, type MotionProps, type MotionStyle, type MotionTransform, type MotionValueSegment, type MotionValueSegmentWithTransition, type ObjectSegment, type ObjectSegmentWithTransition, type ObjectTarget, PopChild, PresenceChild, PresenceContext, namespace_d as Reorder, type ResolveKeyframes, type ResolvedAnimationDefinition, type ResolvedAnimationDefinitions, type SVGAttributesAsMotionValues, type SVGMotionProps, type ScrapeMotionValuesFromProps, type ScrollMotionValues, type Segment, type SegmentTransitionOptions, type SegmentValueTransitionOptions, type SequenceLabel, type SequenceLabelWithTime, type SequenceMap, type SequenceOptions, type SequenceProgressCallback, type SequenceTime, SwitchLayoutGroupContext, type UseInViewOptions, type UseScrollOptions, type ValueSequence, type VariantLabels, type VisualState, WillChangeMotionValue, addPointerEvent, addPointerInfo, animate, animateMini, animationControls, animations, correctParentTransform, createScopedAnimate, disableInstantTransitions, distance, distance2D, domAnimation, domMax, domMin, filterProps, inView, isBrowser, isMotionComponent, isValidMotionProp, m, makeUseVisualState, motion, scroll, scrollInfo, startOptimizedAppearAnimation, transformViewBoxPoint, unwrapMotionComponent, useAnimate, useAnimateMini, useAnimation, useAnimationControls, useAnimationFrame, useComposedRefs, useCycle, useAnimatedState as useDeprecatedAnimatedState, useInvertedScale as useDeprecatedInvertedScale, useDomEvent, useDragControls, useElementScroll, useFollowValue, useForceUpdate, useInView, useInstantLayoutTransition, useInstantTransition, useIsPresent, useIsomorphicLayoutEffect, useMotionTemplate, useMotionValue, useMotionValueEvent, usePageInView, usePresence, usePresenceData, useReducedMotion, useReducedMotionConfig, useResetProjection, useScroll, useSpring, useTime, useTransform, useUnmountEffect, useVelocity, useViewportScroll, useWillChange }; diff --git a/node_modules/framer-motion/dist/m.d.ts b/node_modules/framer-motion/dist/m.d.ts deleted file mode 100644 index b155f07..0000000 --- a/node_modules/framer-motion/dist/m.d.ts +++ /dev/null @@ -1,412 +0,0 @@ -/// -import * as React$1 from 'react'; -import { CSSProperties, PropsWithoutRef, RefAttributes, JSX, SVGAttributes } from 'react'; -import { MotionNodeOptions, MotionValue, TransformProperties, SVGPathProperties } from 'motion-dom'; - -type MotionValueString = MotionValue; -type MotionValueNumber = MotionValue; -type MotionValueAny = MotionValue; -type AnyMotionValue = MotionValueNumber | MotionValueString | MotionValueAny; -type MotionValueHelper = T | AnyMotionValue; -type MakeMotionHelper = { - [K in keyof T]: MotionValueHelper; -}; -type MakeCustomValueTypeHelper = MakeMotionHelper; -type MakeMotion = MakeCustomValueTypeHelper; -type MotionCSS = MakeMotion>; -/** - * @public - */ -type MotionTransform = MakeMotion; -type MotionSVGProps = MakeMotion; -/** - * @public - */ -interface MotionStyle$1 extends MotionCSS, MotionTransform, MotionSVGProps { -} -/** - * Props for `motion` components. - * - * @public - */ -interface MotionProps extends MotionNodeOptions { - /** - * - * The React DOM `style` prop, enhanced with support for `MotionValue`s and separate `transform` values. - * - * ```jsx - * export const MyComponent = () => { - * const x = useMotionValue(0) - * - * return - * } - * ``` - */ - style?: MotionStyle$1; - children?: React.ReactNode | MotionValueNumber | MotionValueString; -} - -interface HTMLElements { - a: HTMLAnchorElement; - abbr: HTMLElement; - address: HTMLElement; - area: HTMLAreaElement; - article: HTMLElement; - aside: HTMLElement; - audio: HTMLAudioElement; - b: HTMLElement; - base: HTMLBaseElement; - bdi: HTMLElement; - bdo: HTMLElement; - big: HTMLElement; - blockquote: HTMLQuoteElement; - body: HTMLBodyElement; - br: HTMLBRElement; - button: HTMLButtonElement; - canvas: HTMLCanvasElement; - caption: HTMLElement; - center: HTMLElement; - cite: HTMLElement; - code: HTMLElement; - col: HTMLTableColElement; - colgroup: HTMLTableColElement; - data: HTMLDataElement; - datalist: HTMLDataListElement; - dd: HTMLElement; - del: HTMLModElement; - details: HTMLDetailsElement; - dfn: HTMLElement; - dialog: HTMLDialogElement; - div: HTMLDivElement; - dl: HTMLDListElement; - dt: HTMLElement; - em: HTMLElement; - embed: HTMLEmbedElement; - fieldset: HTMLFieldSetElement; - figcaption: HTMLElement; - figure: HTMLElement; - footer: HTMLElement; - form: HTMLFormElement; - h1: HTMLHeadingElement; - h2: HTMLHeadingElement; - h3: HTMLHeadingElement; - h4: HTMLHeadingElement; - h5: HTMLHeadingElement; - h6: HTMLHeadingElement; - head: HTMLHeadElement; - header: HTMLElement; - hgroup: HTMLElement; - hr: HTMLHRElement; - html: HTMLHtmlElement; - i: HTMLElement; - iframe: HTMLIFrameElement; - img: HTMLImageElement; - input: HTMLInputElement; - ins: HTMLModElement; - kbd: HTMLElement; - keygen: HTMLElement; - label: HTMLLabelElement; - legend: HTMLLegendElement; - li: HTMLLIElement; - link: HTMLLinkElement; - main: HTMLElement; - map: HTMLMapElement; - mark: HTMLElement; - menu: HTMLElement; - menuitem: HTMLElement; - meta: HTMLMetaElement; - meter: HTMLMeterElement; - nav: HTMLElement; - noindex: HTMLElement; - noscript: HTMLElement; - object: HTMLObjectElement; - ol: HTMLOListElement; - optgroup: HTMLOptGroupElement; - option: HTMLOptionElement; - output: HTMLOutputElement; - p: HTMLParagraphElement; - param: HTMLParamElement; - picture: HTMLElement; - pre: HTMLPreElement; - progress: HTMLProgressElement; - q: HTMLQuoteElement; - rp: HTMLElement; - rt: HTMLElement; - ruby: HTMLElement; - s: HTMLElement; - samp: HTMLElement; - search: HTMLElement; - slot: HTMLSlotElement; - script: HTMLScriptElement; - section: HTMLElement; - select: HTMLSelectElement; - small: HTMLElement; - source: HTMLSourceElement; - span: HTMLSpanElement; - strong: HTMLElement; - style: HTMLStyleElement; - sub: HTMLElement; - summary: HTMLElement; - sup: HTMLElement; - table: HTMLTableElement; - template: HTMLTemplateElement; - tbody: HTMLTableSectionElement; - td: HTMLTableDataCellElement; - textarea: HTMLTextAreaElement; - tfoot: HTMLTableSectionElement; - th: HTMLTableHeaderCellElement; - thead: HTMLTableSectionElement; - time: HTMLTimeElement; - title: HTMLTitleElement; - tr: HTMLTableRowElement; - track: HTMLTrackElement; - u: HTMLElement; - ul: HTMLUListElement; - var: HTMLElement; - video: HTMLVideoElement; - wbr: HTMLElement; - webview: HTMLWebViewElement; -} - -/** - * @public - */ -type ForwardRefComponent = { - readonly $$typeof: symbol; -} & ((props: PropsWithoutRef

& RefAttributes) => JSX.Element); -type AttributesWithoutMotionProps = { - [K in Exclude]?: Attributes[K]; -}; -/** - * @public - */ -type HTMLMotionProps = AttributesWithoutMotionProps & MotionProps; -/** - * Motion-optimised versions of React's HTML components. - * - * @public - */ -type HTMLMotionComponents = { - [K in keyof HTMLElements]: ForwardRefComponent>; -}; - -type UnionStringArray> = T[number]; -declare const svgElements: readonly ["animate", "circle", "defs", "desc", "ellipse", "g", "image", "line", "filter", "marker", "mask", "metadata", "path", "pattern", "polygon", "polyline", "rect", "stop", "svg", "switch", "symbol", "text", "tspan", "use", "view", "clipPath", "feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence", "foreignObject", "linearGradient", "radialGradient", "textPath"]; -type SVGElements = UnionStringArray; - -interface SVGAttributesWithoutMotionProps extends Pick, Exclude, keyof MotionProps>> { -} -/** - * Blanket-accept any SVG attribute as a `MotionValue` - * @public - */ -type SVGAttributesAsMotionValues = MakeMotion>; -type UnwrapSVGFactoryElement = F extends React.SVGProps ? P : never; -/** - * @public - */ -interface SVGMotionProps extends SVGAttributesAsMotionValues, MotionProps { -} -/** - * Motion-optimised versions of React's SVG components. - * - * @public - */ -type SVGMotionComponents = { - [K in SVGElements]: ForwardRefComponent, SVGMotionProps>>; -}; - -type DOMMotionComponents = HTMLMotionComponents & SVGMotionComponents; - -type MotionComponentProps = { - [K in Exclude]?: Props[K]; -} & MotionProps; -type MotionComponent = T extends keyof DOMMotionComponents ? DOMMotionComponents[T] : React$1.ComponentType, "children"> & { - children?: "children" extends keyof P ? P["children"] | MotionComponentProps

["children"] : MotionComponentProps

["children"]; -}>; -interface MotionComponentOptions { - forwardMotionProps?: boolean; - /** - * Specify whether the component renders an HTML or SVG element. - * This is useful when wrapping custom SVG components that need - * SVG-specific attribute handling (like viewBox animation). - * By default, Motion auto-detects based on the component name, - * but custom React components are always treated as HTML. - */ - type?: "html" | "svg"; -} - -declare function createMinimalMotionComponent(Component: TagName | string | React.ComponentType, options?: MotionComponentOptions): MotionComponent; - -/** - * HTML components - */ -declare const MotionA: ForwardRefComponent>; -declare const MotionAbbr: ForwardRefComponent>; -declare const MotionAddress: ForwardRefComponent>; -declare const MotionArea: ForwardRefComponent>; -declare const MotionArticle: ForwardRefComponent>; -declare const MotionAside: ForwardRefComponent>; -declare const MotionAudio: ForwardRefComponent>; -declare const MotionB: ForwardRefComponent>; -declare const MotionBase: ForwardRefComponent>; -declare const MotionBdi: ForwardRefComponent>; -declare const MotionBdo: ForwardRefComponent>; -declare const MotionBig: ForwardRefComponent>; -declare const MotionBlockquote: ForwardRefComponent>; -declare const MotionBody: ForwardRefComponent>; -declare const MotionButton: ForwardRefComponent>; -declare const MotionCanvas: ForwardRefComponent>; -declare const MotionCaption: ForwardRefComponent>; -declare const MotionCite: ForwardRefComponent>; -declare const MotionCode: ForwardRefComponent>; -declare const MotionCol: ForwardRefComponent>; -declare const MotionColgroup: ForwardRefComponent>; -declare const MotionData: ForwardRefComponent>; -declare const MotionDatalist: ForwardRefComponent>; -declare const MotionDd: ForwardRefComponent>; -declare const MotionDel: ForwardRefComponent>; -declare const MotionDetails: ForwardRefComponent>; -declare const MotionDfn: ForwardRefComponent>; -declare const MotionDialog: ForwardRefComponent>; -declare const MotionDiv: ForwardRefComponent>; -declare const MotionDl: ForwardRefComponent>; -declare const MotionDt: ForwardRefComponent>; -declare const MotionEm: ForwardRefComponent>; -declare const MotionEmbed: ForwardRefComponent>; -declare const MotionFieldset: ForwardRefComponent>; -declare const MotionFigcaption: ForwardRefComponent>; -declare const MotionFigure: ForwardRefComponent>; -declare const MotionFooter: ForwardRefComponent>; -declare const MotionForm: ForwardRefComponent>; -declare const MotionH1: ForwardRefComponent>; -declare const MotionH2: ForwardRefComponent>; -declare const MotionH3: ForwardRefComponent>; -declare const MotionH4: ForwardRefComponent>; -declare const MotionH5: ForwardRefComponent>; -declare const MotionH6: ForwardRefComponent>; -declare const MotionHead: ForwardRefComponent>; -declare const MotionHeader: ForwardRefComponent>; -declare const MotionHgroup: ForwardRefComponent>; -declare const MotionHr: ForwardRefComponent>; -declare const MotionHtml: ForwardRefComponent>; -declare const MotionI: ForwardRefComponent>; -declare const MotionIframe: ForwardRefComponent>; -declare const MotionImg: ForwardRefComponent>; -declare const MotionInput: ForwardRefComponent>; -declare const MotionIns: ForwardRefComponent>; -declare const MotionKbd: ForwardRefComponent>; -declare const MotionKeygen: ForwardRefComponent>; -declare const MotionLabel: ForwardRefComponent>; -declare const MotionLegend: ForwardRefComponent>; -declare const MotionLi: ForwardRefComponent>; -declare const MotionLink: ForwardRefComponent>; -declare const MotionMain: ForwardRefComponent>; -declare const MotionMap: ForwardRefComponent>; -declare const MotionMark: ForwardRefComponent>; -declare const MotionMenu: ForwardRefComponent>; -declare const MotionMenuitem: ForwardRefComponent>; -declare const MotionMeter: ForwardRefComponent>; -declare const MotionNav: ForwardRefComponent>; -declare const MotionObject: ForwardRefComponent>; -declare const MotionOl: ForwardRefComponent>; -declare const MotionOptgroup: ForwardRefComponent>; -declare const MotionOption: ForwardRefComponent>; -declare const MotionOutput: ForwardRefComponent>; -declare const MotionP: ForwardRefComponent>; -declare const MotionParam: ForwardRefComponent>; -declare const MotionPicture: ForwardRefComponent>; -declare const MotionPre: ForwardRefComponent>; -declare const MotionProgress: ForwardRefComponent>; -declare const MotionQ: ForwardRefComponent>; -declare const MotionRp: ForwardRefComponent>; -declare const MotionRt: ForwardRefComponent>; -declare const MotionRuby: ForwardRefComponent>; -declare const MotionS: ForwardRefComponent>; -declare const MotionSamp: ForwardRefComponent>; -declare const MotionScript: ForwardRefComponent>; -declare const MotionSection: ForwardRefComponent>; -declare const MotionSelect: ForwardRefComponent>; -declare const MotionSmall: ForwardRefComponent>; -declare const MotionSource: ForwardRefComponent>; -declare const MotionSpan: ForwardRefComponent>; -declare const MotionStrong: ForwardRefComponent>; -declare const MotionStyle: ForwardRefComponent>; -declare const MotionSub: ForwardRefComponent>; -declare const MotionSummary: ForwardRefComponent>; -declare const MotionSup: ForwardRefComponent>; -declare const MotionTable: ForwardRefComponent>; -declare const MotionTbody: ForwardRefComponent>; -declare const MotionTd: ForwardRefComponent>; -declare const MotionTextarea: ForwardRefComponent>; -declare const MotionTfoot: ForwardRefComponent>; -declare const MotionTh: ForwardRefComponent>; -declare const MotionThead: ForwardRefComponent>; -declare const MotionTime: ForwardRefComponent>; -declare const MotionTitle: ForwardRefComponent>; -declare const MotionTr: ForwardRefComponent>; -declare const MotionTrack: ForwardRefComponent>; -declare const MotionU: ForwardRefComponent>; -declare const MotionUl: ForwardRefComponent>; -declare const MotionVideo: ForwardRefComponent>; -declare const MotionWbr: ForwardRefComponent>; -declare const MotionWebview: ForwardRefComponent>; -/** - * SVG components - */ -declare const MotionAnimate: ForwardRefComponent>; -declare const MotionCircle: ForwardRefComponent>; -declare const MotionDefs: ForwardRefComponent>; -declare const MotionDesc: ForwardRefComponent>; -declare const MotionEllipse: ForwardRefComponent>; -declare const MotionG: ForwardRefComponent>; -declare const MotionImage: ForwardRefComponent>; -declare const MotionLine: ForwardRefComponent>; -declare const MotionFilter: ForwardRefComponent>; -declare const MotionMarker: ForwardRefComponent>; -declare const MotionMask: ForwardRefComponent>; -declare const MotionMetadata: ForwardRefComponent>; -declare const MotionPath: ForwardRefComponent>; -declare const MotionPattern: ForwardRefComponent>; -declare const MotionPolygon: ForwardRefComponent>; -declare const MotionPolyline: ForwardRefComponent>; -declare const MotionRect: ForwardRefComponent>; -declare const MotionStop: ForwardRefComponent>; -declare const MotionSvg: ForwardRefComponent>; -declare const MotionSymbol: ForwardRefComponent>; -declare const MotionText: ForwardRefComponent>; -declare const MotionTspan: ForwardRefComponent>; -declare const MotionUse: ForwardRefComponent>; -declare const MotionView: ForwardRefComponent>; -declare const MotionClipPath: ForwardRefComponent>; -declare const MotionFeBlend: ForwardRefComponent>; -declare const MotionFeColorMatrix: ForwardRefComponent>; -declare const MotionFeComponentTransfer: ForwardRefComponent>; -declare const MotionFeComposite: ForwardRefComponent>; -declare const MotionFeConvolveMatrix: ForwardRefComponent>; -declare const MotionFeDiffuseLighting: ForwardRefComponent>; -declare const MotionFeDisplacementMap: ForwardRefComponent>; -declare const MotionFeDistantLight: ForwardRefComponent>; -declare const MotionFeDropShadow: ForwardRefComponent>; -declare const MotionFeFlood: ForwardRefComponent>; -declare const MotionFeFuncA: ForwardRefComponent>; -declare const MotionFeFuncB: ForwardRefComponent>; -declare const MotionFeFuncG: ForwardRefComponent>; -declare const MotionFeFuncR: ForwardRefComponent>; -declare const MotionFeGaussianBlur: ForwardRefComponent>; -declare const MotionFeImage: ForwardRefComponent>; -declare const MotionFeMerge: ForwardRefComponent>; -declare const MotionFeMergeNode: ForwardRefComponent>; -declare const MotionFeMorphology: ForwardRefComponent>; -declare const MotionFeOffset: ForwardRefComponent>; -declare const MotionFePointLight: ForwardRefComponent>; -declare const MotionFeSpecularLighting: ForwardRefComponent>; -declare const MotionFeSpotLight: ForwardRefComponent>; -declare const MotionFeTile: ForwardRefComponent>; -declare const MotionFeTurbulence: ForwardRefComponent>; -declare const MotionForeignObject: ForwardRefComponent>; -declare const MotionLinearGradient: ForwardRefComponent>; -declare const MotionRadialGradient: ForwardRefComponent>; -declare const MotionTextPath: ForwardRefComponent>; - -export { MotionA as a, MotionAbbr as abbr, MotionAddress as address, MotionAnimate as animate, MotionArea as area, MotionArticle as article, MotionAside as aside, MotionAudio as audio, MotionB as b, MotionBase as base, MotionBdi as bdi, MotionBdo as bdo, MotionBig as big, MotionBlockquote as blockquote, MotionBody as body, MotionButton as button, MotionCanvas as canvas, MotionCaption as caption, MotionCircle as circle, MotionCite as cite, MotionClipPath as clipPath, MotionCode as code, MotionCol as col, MotionColgroup as colgroup, createMinimalMotionComponent as create, MotionData as data, MotionDatalist as datalist, MotionDd as dd, MotionDefs as defs, MotionDel as del, MotionDesc as desc, MotionDetails as details, MotionDfn as dfn, MotionDialog as dialog, MotionDiv as div, MotionDl as dl, MotionDt as dt, MotionEllipse as ellipse, MotionEm as em, MotionEmbed as embed, MotionFeBlend as feBlend, MotionFeColorMatrix as feColorMatrix, MotionFeComponentTransfer as feComponentTransfer, MotionFeComposite as feComposite, MotionFeConvolveMatrix as feConvolveMatrix, MotionFeDiffuseLighting as feDiffuseLighting, MotionFeDisplacementMap as feDisplacementMap, MotionFeDistantLight as feDistantLight, MotionFeDropShadow as feDropShadow, MotionFeFlood as feFlood, MotionFeFuncA as feFuncA, MotionFeFuncB as feFuncB, MotionFeFuncG as feFuncG, MotionFeFuncR as feFuncR, MotionFeGaussianBlur as feGaussianBlur, MotionFeImage as feImage, MotionFeMerge as feMerge, MotionFeMergeNode as feMergeNode, MotionFeMorphology as feMorphology, MotionFeOffset as feOffset, MotionFePointLight as fePointLight, MotionFeSpecularLighting as feSpecularLighting, MotionFeSpotLight as feSpotLight, MotionFeTile as feTile, MotionFeTurbulence as feTurbulence, MotionFieldset as fieldset, MotionFigcaption as figcaption, MotionFigure as figure, MotionFilter as filter, MotionFooter as footer, MotionForeignObject as foreignObject, MotionForm as form, MotionG as g, MotionH1 as h1, MotionH2 as h2, MotionH3 as h3, MotionH4 as h4, MotionH5 as h5, MotionH6 as h6, MotionHead as head, MotionHeader as header, MotionHgroup as hgroup, MotionHr as hr, MotionHtml as html, MotionI as i, MotionIframe as iframe, MotionImage as image, MotionImg as img, MotionInput as input, MotionIns as ins, MotionKbd as kbd, MotionKeygen as keygen, MotionLabel as label, MotionLegend as legend, MotionLi as li, MotionLine as line, MotionLinearGradient as linearGradient, MotionLink as link, MotionMain as main, MotionMap as map, MotionMark as mark, MotionMarker as marker, MotionMask as mask, MotionMenu as menu, MotionMenuitem as menuitem, MotionMetadata as metadata, MotionMeter as meter, MotionNav as nav, MotionObject as object, MotionOl as ol, MotionOptgroup as optgroup, MotionOption as option, MotionOutput as output, MotionP as p, MotionParam as param, MotionPath as path, MotionPattern as pattern, MotionPicture as picture, MotionPolygon as polygon, MotionPolyline as polyline, MotionPre as pre, MotionProgress as progress, MotionQ as q, MotionRadialGradient as radialGradient, MotionRect as rect, MotionRp as rp, MotionRt as rt, MotionRuby as ruby, MotionS as s, MotionSamp as samp, MotionScript as script, MotionSection as section, MotionSelect as select, MotionSmall as small, MotionSource as source, MotionSpan as span, MotionStop as stop, MotionStrong as strong, MotionStyle as style, MotionSub as sub, MotionSummary as summary, MotionSup as sup, MotionSvg as svg, MotionSymbol as symbol, MotionTable as table, MotionTbody as tbody, MotionTd as td, MotionText as text, MotionTextPath as textPath, MotionTextarea as textarea, MotionTfoot as tfoot, MotionTh as th, MotionThead as thead, MotionTime as time, MotionTitle as title, MotionTr as tr, MotionTrack as track, MotionTspan as tspan, MotionU as u, MotionUl as ul, MotionUse as use, MotionVideo as video, MotionView as view, MotionWbr as wbr, MotionWebview as webview }; diff --git a/node_modules/framer-motion/dist/mini.d.ts b/node_modules/framer-motion/dist/mini.d.ts deleted file mode 100644 index 0c2d756..0000000 --- a/node_modules/framer-motion/dist/mini.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import * as motion_dom from 'motion-dom'; -import { AnimationScope } from 'motion-dom'; - -declare function useAnimateMini(): [AnimationScope, (elementOrSelector: motion_dom.ElementOrSelector, keyframes: motion_dom.DOMKeyframesDefinition, options?: motion_dom.AnimationOptions | undefined) => motion_dom.AnimationPlaybackControlsWithThen]; - -export { useAnimateMini as useAnimate }; diff --git a/node_modules/framer-motion/dist/mini.js b/node_modules/framer-motion/dist/mini.js deleted file mode 100644 index ed7ee2e..0000000 --- a/node_modules/framer-motion/dist/mini.js +++ /dev/null @@ -1 +0,0 @@ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Motion={},t.React)}(this,function(t,e){"use strict";function n(t){const n=e.useRef(null);return null===n.current&&(n.current=t()),n.current}let i=()=>{};"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(i=(t,e,n)=>{if(!t)throw new Error(function(t,e){return e?`${t}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:t}(e,n))});const s=t=>t,a=t=>1e3*t,o=t=>t/1e3,r=t=>null!==t;class l{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}function u(t){for(let e=1;et.startsWith("--");const d={};function m(t,e){const n=function(t){let e;return()=>(void 0===e&&(e=t()),e)}(t);return()=>d[e]??n()}const c=m(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),p=m(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),f=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,g={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:f([0,.65,.55,1]),circOut:f([.55,0,1,.45]),backIn:f([.31,.01,.66,-.59]),backOut:f([.33,1.53,.69,.99])};function y(t,e){return t?"function"==typeof t?p()?((t,e,n=10)=>{let i="";const s=Math.max(Math.round(e/n),2);for(let e=0;eArray.isArray(t)&&"number"==typeof t[0])(t)?f(t):Array.isArray(t)?t.map(t=>y(t,e)||g.easeOut):g[t]:void 0}class T extends l{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:e,name:n,keyframes:s,pseudoElement:a,allowFlatten:o=!1,finalKeyframe:l,onComplete:u}=t;this.isPseudoElement=Boolean(a),this.allowFlatten=o,this.options=t,i("string"!=typeof t.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const d=function({type:t,...e}){return function(t){return"function"==typeof t&&"applyToOptions"in t}(t)&&p()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=function(t,e,n,{delay:i=0,duration:s=300,repeat:a=0,repeatType:o="loop",ease:r="easeOut",times:l}={},u){const h={[e]:n};l&&(h.offset=l);const d=y(r,s);Array.isArray(d)&&(h.easing=d);const m={delay:i,duration:s,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:a+1,direction:"reverse"===o?"alternate":"normal"};return u&&(m.pseudoElement=u),t.animate(h,m)}(e,n,s,d,a),!1===d.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!a){const t=function(t,{repeat:e,repeatType:n="loop"},i,s=1){const a=t.filter(r),o=s<0||e&&"loop"!==n&&e%2==1?0:a.length-1;return o&&void 0!==i?i:a[o]}(s,this.options,l,this.speed);this.updateMotionValue&&this.updateMotionValue(t),function(t,e,n){h(e)?t.style.setProperty(e,n):t.style[e]=n}(e,n,t),this.animation.cancel()}u?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return o(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+o(t)}get time(){return o(Number(this.animation.currentTime)||0)}set time(t){const e=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=a(t),e&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:e,rangeEnd:n,observe:i}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&c()?(this.animation.timeline=t,e&&(this.animation.rangeStart=e),n&&(this.animation.rangeEnd=n),s):i(this)}}class b{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;ne.attachTimeline(t));return()=>{e.forEach((t,e)=>{t&&t(),this.animations[e].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return A(this.animations,"duration")}get iterationDuration(){return A(this.animations,"iterationDuration")}runAll(t){this.animations.forEach(e=>e[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function A(t,e){let n=0;for(let i=0;in&&(n=s)}return n}class S extends b{then(t,e){return this.finished.finally(t).then(()=>{})}}const E=new WeakMap,k=(t,e="")=>`${t}:${e}`;function v(t){let e=E.get(t);return e||(e=new Map,E.set(t,e)),e}function w(t,e){const n=t?.[e]??t?.default??t;return n!==t?function(t,e){if(t?.inherit&&e){const{inherit:n,...i}=t;return{...e,...i}}return t}(n,t):n}const B=new Set(["borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","width","maxWidth","height","maxHeight","top","right","bottom","left","inset","insetBlock","insetBlockStart","insetBlockEnd","insetInline","insetInlineStart","insetInlineEnd","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingBlock","paddingBlockStart","paddingBlockEnd","paddingInline","paddingInlineStart","paddingInlineEnd","margin","marginTop","marginRight","marginBottom","marginLeft","marginBlock","marginBlockStart","marginBlockEnd","marginInline","marginInlineStart","marginInlineEnd","fontSize","backgroundPositionX","backgroundPositionY"]);function R(t,e){for(let n=0;nnull!=t)}(t,s),r=o.length;i(Boolean(r),"No valid elements provided.","no-valid-elements");const l=[];for(let t=0;te.delete(n)),h.push(s)}return h}t.useAnimate=function(){const t=n(()=>({current:null,animations:[]})),i=n(()=>(t=>function(e,n,i){return new S(M(e,n,i,t))})(t));var s;return s=()=>{t.animations.forEach(t=>t.stop())},e.useEffect(()=>()=>s(),[]),[t,i]}}); diff --git a/node_modules/framer-motion/dist/projection.d.ts b/node_modules/framer-motion/dist/projection.d.ts deleted file mode 100644 index 32faa61..0000000 --- a/node_modules/framer-motion/dist/projection.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { HTMLProjectionNode, HTMLVisualElement, addScaleCorrector, buildTransform, calcBoxDelta, correctBorderRadius, correctBoxShadow, frame, frameData, mix, nodeGroup, recordStats, statsBuffer } from 'motion-dom'; diff --git a/node_modules/framer-motion/dist/size-rollup-animate.js b/node_modules/framer-motion/dist/size-rollup-animate.js deleted file mode 100644 index 9d6af59..0000000 --- a/node_modules/framer-motion/dist/size-rollup-animate.js +++ /dev/null @@ -1,2 +0,0 @@ -function t(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const e=(t,e,n)=>n>e?e:n{},i=()=>{};"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(s=(t,e,s)=>{t||"undefined"==typeof console||console.warn(n(e,s))},i=(t,e,s)=>{if(!t)throw new Error(n(e,s))});const r={},a=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),o=t=>/^0[^.\s]+$/u.test(t);function l(t){let e;return()=>(void 0===e&&(e=t()),e)}const u=t=>t,h=(...t)=>t.reduce((t,e)=>n=>e(t(n))),c=(t,e,n)=>{const s=e-t;return s?(n-t)/s:1};class d{constructor(){this.subscriptions=[]}add(e){var n,s;return n=this.subscriptions,s=e,-1===n.indexOf(s)&&n.push(s),()=>t(this.subscriptions,e)}notify(t,e,n){const s=this.subscriptions.length;if(s)if(1===s)this.subscriptions[0](t,e,n);else for(let i=0;i1e3*t,m=t=>t/1e3,f=(t,e)=>e?t*(1e3/e):0,g=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function y(t,e,n,s){if(t===e&&n===s)return u;const i=e=>function(t,e,n,s,i){let r,a,o=0;do{a=e+(n-e)/2,r=g(a,s,i)-t,r>0?n=a:e=a}while(Math.abs(r)>1e-7&&++o<12);return a}(e,0,1,t,n);return t=>0===t||1===t?t:g(i(t),e,s)}const v=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,b=t=>e=>1-t(1-e),T=y(.33,1.53,.69,.99),w=b(T),M=v(w),S=t=>t>=1?1:(t*=2)<1?.5*w(t):.5*(2-Math.pow(2,-10*(t-1))),x=t=>1-Math.sin(Math.acos(t)),A=b(x),k=v(x),V=y(.42,0,1,1),C=y(0,0,.58,1),F=y(.42,0,.58,1),P=t=>Array.isArray(t)&&"number"!=typeof t[0];function R(t,e){return P(t)?t[((t,e,n)=>{const s=e-t;return((n-t)%s+s)%s+t})(0,t.length,e)]:t}const E=t=>Array.isArray(t)&&"number"==typeof t[0],B={linear:u,easeIn:V,easeInOut:F,easeOut:C,circIn:x,circInOut:k,circOut:A,backIn:w,backInOut:M,backOut:T,anticipate:S},D=t=>{if(E(t)){i(4===t.length,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[e,n,s,r]=t;return y(e,n,s,r)}return"string"==typeof t?(i(void 0!==B[t],`Invalid easing type '${t}'`,"invalid-easing-type"),B[t]):t},I=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function O(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=I.reduce((t,e)=>(t[e]=function(t){let e=new Set,n=new Set,s=!1,i=!1;const r=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function o(e){r.has(e)&&(l.schedule(e),t()),e(a)}const l={schedule:(t,i=!1,a=!1)=>{const o=a&&s?e:n;return i&&r.add(t),o.add(t),t},cancel:t=>{n.delete(t),r.delete(t)},process:t=>{if(a=t,s)return void(i=!0);s=!0;const r=e;e=n,n=r,e.forEach(o),e.clear(),s=!1,i&&(i=!1,l.process(t))}};return l}(a),t),{}),{setup:l,read:u,resolveKeyframes:h,preUpdate:c,update:d,preRender:p,render:m,postRender:f}=o,g=()=>{const a=r.useManualTiming,o=a?i.timestamp:performance.now();n=!1,a||(i.delta=s?1e3/60:Math.max(Math.min(o-i.timestamp,40),1)),i.timestamp=o,i.isProcessing=!0,l.process(i),u.process(i),h.process(i),c.process(i),d.process(i),p.process(i),m.process(i),f.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(g))};return{schedule:I.reduce((e,r)=>{const a=o[r];return e[r]=(e,r=!1,o=!1)=>(n||(n=!0,s=!0,i.isProcessing||t(g)),a.schedule(e,r,o)),e},{}),cancel:t=>{for(let e=0;e(void 0===j&&L.set(K.isProcessing||r.useManualTiming?K.timestamp:performance.now()),j),set:t=>{j=t,queueMicrotask(W)}},Y=t=>e=>"string"==typeof e&&e.startsWith(t),U=Y("--"),X=Y("var(--"),q=t=>!!X(t)&&z.test(t.split("/*")[0].trim()),z=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Z(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const _={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},G={..._,transform:t=>e(0,1,t)},H={..._,default:1},J=t=>Math.round(1e5*t)/1e5,Q=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const tt=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,et=(t,e)=>n=>Boolean("string"==typeof n&&tt.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),nt=(t,e,n)=>s=>{if("string"!=typeof s)return s;const[i,r,a,o]=s.match(Q);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(a),alpha:void 0!==o?parseFloat(o):1}},st={..._,transform:t=>Math.round((t=>e(0,255,t))(t))},it={test:et("rgb","red"),parse:nt("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+st.transform(t)+", "+st.transform(e)+", "+st.transform(n)+", "+J(G.transform(s))+")"};const rt={test:et("#"),parse:function(t){let e="",n="",s="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,s+=s,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}},transform:it.transform},at=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),ot=at("deg"),lt=at("%"),ut=at("px"),ht=at("vh"),ct=at("vw"),dt=(()=>({...lt,parse:t=>lt.parse(t)/100,transform:t=>lt.transform(100*t)}))(),pt={test:et("hsl","hue"),parse:nt("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+lt.transform(J(e))+", "+lt.transform(J(n))+", "+J(G.transform(s))+")"},mt={test:t=>it.test(t)||rt.test(t)||pt.test(t),parse:t=>it.test(t)?it.parse(t):pt.test(t)?pt.parse(t):rt.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?it.transform(t):pt.transform(t),getAnimatableNone:t=>{const e=mt.parse(t);return e.alpha=0,mt.transform(e)}},ft=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const gt="number",yt="color",vt=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function bt(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let r=0;const a=e.replace(vt,t=>(mt.test(t)?(s.color.push(r),i.push(yt),n.push(mt.parse(t))):t.startsWith("var(")?(s.var.push(r),i.push("var"),n.push(t)):(s.number.push(r),i.push(gt),n.push(parseFloat(t))),++r,"${}")).split("${}");return{values:n,split:a,indexes:s,types:i}}function Tt({split:t,types:e}){const n=t.length;return s=>{let i="";for(let r=0;r{return"number"==typeof t?e?.trim().endsWith("/")?t:0:"number"==typeof(n=t)?0:mt.test(n)?mt.getAnimatableNone(n):n;var n};const Mt={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(Q)?.length||0)+(t.match(ft)?.length||0)>0},parse:function(t){return bt(t).values},createTransformer:function(t){return Tt(bt(t))},getAnimatableNone:function(t){const e=bt(t);return Tt(e)(e.values.map((t,n)=>wt(t,e.split[n])))}};function St(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function xt(t,e){return n=>n>0?e:t}const At=(t,e,n)=>t+(e-t)*n,kt=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},Vt=[rt,it,pt];function Ct(t){const e=(n=t,Vt.find(t=>t.test(n)));var n;if(s(Boolean(e),`'${t}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!Boolean(e))return!1;let i=e.parse(t);return e===pt&&(i=function({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,n/=100;let i=0,r=0,a=0;if(e/=100){const s=n<.5?n*(1+e):n+e-n*e,o=2*n-s;i=St(o,s,t+1/3),r=St(o,s,t),a=St(o,s,t-1/3)}else i=r=a=n;return{red:Math.round(255*i),green:Math.round(255*r),blue:Math.round(255*a),alpha:s}}(i)),i}const Ft=(t,e)=>{const n=Ct(t),s=Ct(e);if(!n||!s)return xt(t,e);const i={...n};return t=>(i.red=kt(n.red,s.red,t),i.green=kt(n.green,s.green,t),i.blue=kt(n.blue,s.blue,t),i.alpha=At(n.alpha,s.alpha,t),it.transform(i))},Pt=new Set(["none","hidden"]);function Rt(t,e){return n=>At(t,e,n)}function Et(t){return"number"==typeof t?Rt:"string"==typeof t?q(t)?xt:mt.test(t)?Ft:It:Array.isArray(t)?Bt:"object"==typeof t?mt.test(t)?Ft:Dt:xt}function Bt(t,e){const n=[...t],s=n.length,i=t.map((t,n)=>Et(t)(t,e[n]));return t=>{for(let e=0;e{for(const e in s)n[e]=s[e](t);return n}}const It=(t,e)=>{const n=Mt.createTransformer(e),i=bt(t),r=bt(e);return i.indexes.var.length===r.indexes.var.length&&i.indexes.color.length===r.indexes.color.length&&i.indexes.number.length>=r.indexes.number.length?Pt.has(t)&&!r.values.length||Pt.has(e)&&!i.values.length?function(t,e){return Pt.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):h(Bt(function(t,e){const n=[],s={color:0,var:0,number:0};for(let i=0;i{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>N.update(e,t),stop:()=>$(e),now:()=>K.isProcessing?K.timestamp:L.now()}},$t=(t,e,n=10)=>{let s="";const i=Math.max(Math.round(e/n),2);for(let e=0;e=Kt?1/0:e}function Wt(t,e=100,n){const s=n({...t,keyframes:[0,e]}),i=Math.min(jt(s),Kt);return{type:"keyframes",ease:t=>s.next(i*t).value/e,duration:m(i)}}const Lt=100,Yt=10,Ut=1,Xt=0,qt=800,zt=.3,Zt=.3,_t={granular:.01,default:2},Gt={granular:.005,default:.5},Ht=.01,Jt=10,Qt=.05,te=1;function ee(t,e){return t*Math.sqrt(1-e*e)}const ne=.001;const se=["duration","bounce"],ie=["stiffness","damping","mass"];function re(t,e){return e.some(e=>void 0!==t[e])}function ae(t){let n={velocity:Xt,stiffness:Lt,damping:Yt,mass:Ut,isResolvedFromDuration:!1,...t};if(!re(t,ie)&&re(t,se))if(n.velocity=0,t.visualDuration){const s=t.visualDuration,i=2*Math.PI/(1.2*s),r=i*i,a=2*e(.05,1,1-(t.bounce||0))*Math.sqrt(r);n={...n,mass:Ut,stiffness:r,damping:a}}else{const i=function({duration:t=qt,bounce:n=zt,velocity:i=Xt,mass:r=Ut}){let a,o;s(t<=p(Jt),"Spring duration must be 10 seconds or less","spring-duration-limit");let l=1-n;l=e(Qt,te,l),t=e(Ht,Jt,m(t)),l<1?(a=e=>{const n=e*l,s=n*t,r=n-i,a=ee(e,l),o=Math.exp(-s);return ne-r/a*o},o=e=>{const n=e*l*t,s=n*i+i,r=Math.pow(l,2)*Math.pow(e,2)*t,o=Math.exp(-n),u=ee(Math.pow(e,2),l);return(-a(e)+ne>0?-1:1)*((s-r)*o)/u}):(a=e=>Math.exp(-e*t)*((e-i)*t+1)-.001,o=e=>Math.exp(-e*t)*(t*t*(i-e)));const u=function(t,e,n){let s=n;for(let n=1;n<12;n++)s-=t(s)/e(s);return s}(a,o,5/t);if(t=p(t),isNaN(u))return{stiffness:Lt,damping:Yt,duration:t};{const e=Math.pow(u,2)*r;return{stiffness:e,damping:2*l*Math.sqrt(r*e),duration:t}}}({...t,velocity:0});n={...n,...i,mass:Ut},n.isResolvedFromDuration=!0}return n}function oe(t=Zt,e=zt){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:i}=n;const r=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],o={done:!1,value:r},{stiffness:l,damping:u,mass:h,duration:c,velocity:d,isResolvedFromDuration:f}=ae({...n,velocity:-m(n.velocity||0)}),g=d||0,y=u/(2*Math.sqrt(l*h)),v=a-r,b=m(Math.sqrt(l/h)),T=Math.abs(v)<5;let w,M,S,x,A,k;if(s||(s=T?_t.granular:_t.default),i||(i=T?Gt.granular:Gt.default),y<1)S=ee(b,y),x=(g+y*b*v)/S,w=t=>{const e=Math.exp(-y*b*t);return a-e*(x*Math.sin(S*t)+v*Math.cos(S*t))},A=y*b*x+v*S,k=y*b*v-x*S,M=t=>Math.exp(-y*b*t)*(A*Math.sin(S*t)+k*Math.cos(S*t));else if(1===y){w=t=>a-Math.exp(-b*t)*(v+(g+b*v)*t);const t=g+b*v;M=e=>Math.exp(-b*e)*(b*t*e-g)}else{const t=b*Math.sqrt(y*y-1);w=e=>{const n=Math.exp(-y*b*e),s=Math.min(t*e,300);return a-n*((g+y*b*v)*Math.sinh(s)+t*v*Math.cosh(s))/t};const e=(g+y*b*v)/t,n=y*b*e-v*t,s=y*b*v-e*t;M=e=>{const i=Math.exp(-y*b*e),r=Math.min(t*e,300);return i*(n*Math.sinh(r)+s*Math.cosh(r))}}const V={calculatedDuration:f&&c||null,velocity:t=>p(M(t)),next:t=>{if(!f&&y<1){const e=Math.exp(-y*b*t),n=Math.sin(S*t),r=Math.cos(S*t),l=a-e*(x*n+v*r),u=p(e*(A*n+k*r));return o.done=Math.abs(u)<=s&&Math.abs(a-l)<=i,o.value=o.done?a:l,o}const e=w(t);if(f)o.done=t>=c;else{const n=p(M(t));o.done=Math.abs(n)<=s&&Math.abs(a-e)<=i}return o.value=o.done?a:e,o},toString:()=>{const t=Math.min(jt(V),Kt),e=$t(e=>V.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return V}oe.applyToOptions=t=>{const e=Wt(t,100,oe);return t.ease=e.ease,t.duration=p(e.duration),t.type="keyframes",t};function le(t,e,n){const s=Math.max(e-5,0);return f(n-t(s),e-s)}function ue({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:r=500,modifyTarget:a,min:o,max:l,restDelta:u=.5,restSpeed:h}){const c=t[0],d={done:!1,value:c},p=t=>void 0===o?l:void 0===l||Math.abs(o-t)-m*Math.exp(-t/s),v=t=>g+y(t),b=t=>{const e=y(t),n=v(t);d.done=Math.abs(e)<=u,d.value=d.done?g:n};let T,w;const M=t=>{var e;(e=d.value,void 0!==o&&el)&&(T=t,w=oe({keyframes:[d.value,p(d.value)],velocity:le(v,t,d.value),damping:i,stiffness:r,restDelta:u,restSpeed:h}))};return M(0),{calculatedDuration:null,next:t=>{let e=!1;return w||void 0!==T||(e=!0,b(t),M(t)),void 0!==T&&t>=T?w.next(t-T):(!e&&b(t),d)}}}function he(t,n,{clamp:s=!0,ease:a,mixer:o}={}){const l=t.length;if(i(l===n.length,"Both input and output ranges must be the same length","range-length"),1===l)return()=>n[0];if(2===l&&n[0]===n[1])return()=>n[1];const d=t[0]===t[1];t[0]>t[l-1]&&(t=[...t].reverse(),n=[...n].reverse());const p=function(t,e,n){const s=[],i=n||r.mix||Ot,a=t.length-1;for(let n=0;n{if(d&&e1)for(;sf(e(t[0],t[l-1],n)):f}function ce(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=c(0,e,s);t.push(At(n,1,i))}}function de(t){const e=[0];return ce(e,t.length-1),e}function pe({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=P(s)?s.map(D):D(s),r={done:!1,value:e[0]},a=function(t,e){return t.map(t=>t*e)}(n&&n.length===e.length?n:de(e),t),o=he(a,e,{ease:Array.isArray(i)?i:(l=e,u=i,l.map(()=>u||F).splice(0,l.length-1))});var l,u;return{calculatedDuration:t,next:e=>(r.value=o(e),r.done=e>=t,r)}}const me=t=>null!==t;function fe(t,{repeat:e,repeatType:n="loop"},s,i=1){const r=t.filter(me),a=i<0||e&&"loop"!==n&&e%2==1?0:r.length-1;return a&&void 0!==s?s:r[a]}const ge={decay:ue,inertia:ue,tween:pe,keyframes:pe,spring:oe};function ye(t){"string"==typeof t.type&&(t.type=ge[t.type])}class ve{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const be=t=>t/100;class Te extends ve{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:t}=this.options;t&&t.updatedAt!==L.now()&&this.tick(L.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;ye(t);const{type:e=pe,repeat:n=0,repeatDelay:s=0,repeatType:i,velocity:r=0}=t;let{keyframes:a}=t;const o=e||pe;o!==pe&&"number"!=typeof a[0]&&(this.mixKeyframes=h(be,Ot(a[0],a[1])),a=[0,100]);const l=o({...t,keyframes:a});"mirror"===i&&(this.mirroredGenerator=o({...t,keyframes:[...a].reverse(),velocity:-r})),null===l.calculatedDuration&&(l.calculatedDuration=jt(l));const{calculatedDuration:u}=l;this.calculatedDuration=u,this.resolvedDuration=u+s,this.totalDuration=this.resolvedDuration*(n+1)-s,this.generator=l}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,n=!1){const{generator:s,totalDuration:i,mixKeyframes:r,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:l}=this;if(null===this.startTime)return s.next(0);const{delay:u=0,keyframes:h,repeat:c,repeatType:d,repeatDelay:p,type:m,onUpdate:f,finalKeyframe:g}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const y=this.currentTime-u*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?y<0:y>i;this.currentTime=Math.max(y,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=i);let b,T=this.currentTime,w=s;if(c){const t=Math.min(this.currentTime,i)/o;let n=Math.floor(t),s=t%1;!s&&t>=1&&(s=1),1===s&&n--,n=Math.min(n,c+1);Boolean(n%2)&&("reverse"===d?(s=1-s,p&&(s-=p/o)):"mirror"===d&&(w=a)),T=e(0,1,s)*o}v?(this.delayState.value=h[0],b=this.delayState):b=w.next(T),r&&!v&&(b.value=r(b.value));let{done:M}=b;v||null===l||(M=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const S=null===this.holdTime&&("finished"===this.state||"running"===this.state&&M);return S&&m!==ue&&(b.value=fe(h,this.options,g,this.speed)),f&&f(b.value),S&&this.finish(),b}then(t,e){return this.finished.then(t,e)}get duration(){return m(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+m(t)}get time(){return m(this.currentTime)}set time(t){t=p(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);return le(t=>this.generator.next(t).value,t,this.generator.next(t).value)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;e&&this.driver&&this.updateTime(L.now()),this.playbackSpeed=t,e&&this.driver&&(this.time=m(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=Nt,startTime:e}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),this.options.onPlay?.();const n=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=n):null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime||(this.startTime=e??n),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(L.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}const we=t=>180*t/Math.PI,Me=t=>{const e=we(Math.atan2(t[1],t[0]));return xe(e)},Se={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Me,rotateZ:Me,skewX:t=>we(Math.atan(t[1])),skewY:t=>we(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},xe=t=>((t%=360)<0&&(t+=360),t),Ae=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),ke=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Ve={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Ae,scaleY:ke,scale:t=>(Ae(t)+ke(t))/2,rotateX:t=>xe(we(Math.atan2(t[6],t[5]))),rotateY:t=>xe(we(Math.atan2(-t[2],t[0]))),rotateZ:Me,rotate:Me,skewX:t=>we(Math.atan(t[4])),skewY:t=>we(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Ce(t){return t.includes("scale")?1:0}function Fe(t,e){if(!t||"none"===t)return Ce(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=Ve,i=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=Se,i=e}if(!i)return Ce(e);const r=s[e],a=i[1].split(",").map(Pe);return"function"==typeof r?r(a):a[r]}function Pe(t){return parseFloat(t.trim())}const Re=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ee=(()=>new Set([...Re,"pathRotation"]))(),Be=t=>t===_||t===ut,De=new Set(["x","y","z"]),Ie=Re.filter(t=>!De.has(t));const Oe={width:({x:t},{paddingLeft:e="0",paddingRight:n="0",boxSizing:s})=>{const i=t.max-t.min;return"border-box"===s?i:i-parseFloat(e)-parseFloat(n)},height:({y:t},{paddingTop:e="0",paddingBottom:n="0",boxSizing:s})=>{const i=t.max-t.min;return"border-box"===s?i:i-parseFloat(e)-parseFloat(n)},top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>Fe(e,"x"),y:(t,{transform:e})=>Fe(e,"y")};Oe.translateX=Oe.x,Oe.translateY=Oe.y;const Ne=new Set;let $e=!1,Ke=!1,je=!1;function We(){if(Ke){const t=Array.from(Ne).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),n=new Map;e.forEach(t=>{const e=function(t){const e=[];return Ie.forEach(n=>{const s=t.getValue(n);void 0!==s&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e}(t);e.length&&(n.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=n.get(t);e&&e.forEach(([e,n])=>{t.getValue(e)?.set(n)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}Ke=!1,$e=!1,Ne.forEach(t=>t.complete(je)),Ne.clear()}function Le(){Ne.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Ke=!0)})}class Ye{constructor(t,e,n,s,i,r=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=s,this.element=i,this.isAsync=r}scheduleResolve(){this.state="scheduled",this.isAsync?(Ne.add(this),$e||($e=!0,N.read(Le),N.resolveKeyframes(We))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:s}=this;if(null===t[0]){const i=s?.get(),r=t[t.length-1];if(void 0!==i)t[0]=i;else if(n&&e){const s=n.readValue(e,r);null!=s&&(t[0]=s)}void 0===t[0]&&(t[0]=r),s&&void 0===i&&s.set(t[0])}!function(t){for(let e=1;et.startsWith("--"))(e)?t.style.setProperty(e,n):t.style[e]=n}const Xe={};function qe(t,e){const n=l(t);return()=>Xe[e]??n()}const ze=qe(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),Ze=qe(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),_e=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,Ge={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:_e([0,.65,.55,1]),circOut:_e([.55,0,1,.45]),backIn:_e([.31,.01,.66,-.59]),backOut:_e([.33,1.53,.69,.99])};function He(t,e){return t?"function"==typeof t?Ze()?$t(t,e):"ease-out":E(t)?_e(t):Array.isArray(t)?t.map(t=>He(t,e)||Ge.easeOut):Ge[t]:void 0}function Je(t,e,n,{delay:s=0,duration:i=300,repeat:r=0,repeatType:a="loop",ease:o="easeOut",times:l}={},u=void 0){const h={[e]:n};l&&(h.offset=l);const c=He(o,i);Array.isArray(c)&&(h.easing=c);const d={delay:s,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:r+1,direction:"reverse"===a?"alternate":"normal"};return u&&(d.pseudoElement=u),t.animate(h,d)}function Qe(t){return"function"==typeof t&&"applyToOptions"in t}class tn extends ve{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:e,name:n,keyframes:s,pseudoElement:r,allowFlatten:a=!1,finalKeyframe:o,onComplete:l}=t;this.isPseudoElement=Boolean(r),this.allowFlatten=a,this.options=t,i("string"!=typeof t.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const u=function({type:t,...e}){return Qe(t)&&Ze()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=Je(e,n,s,u,r),!1===u.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!r){const t=fe(s,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(t),Ue(e,n,t),this.animation.cancel()}l?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return m(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+m(t)}get time(){return m(Number(this.animation.currentTime)||0)}set time(t){const e=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=p(t),e&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:e,rangeEnd:n,observe:s}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&ze()?(this.animation.timeline=t,e&&(this.animation.rangeStart=e),n&&(this.animation.rangeEnd=n),u):s(this)}}const en={anticipate:S,backInOut:M,circInOut:k};function nn(t){"string"==typeof t.ease&&t.ease in en&&(t.ease=en[t.ease])}class sn extends tn{constructor(t){nn(t),ye(t),super(t),void 0!==t.startTime&&!1!==t.autoplay&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:s,onComplete:i,element:r,...a}=this.options;if(!n)return;if(void 0!==t)return void n.set(t);const o=new Te({...a,autoplay:!1}),l=Math.max(10,L.now()-this.startTime),u=e(0,10,l-10),h=o.sample(l).value,{name:c}=this.options;r&&c&&Ue(r,c,h),n.setWithVelocity(o.sample(Math.max(0,l-u)).value,h,u),o.stop()}}const rn=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Mt.test(t)&&"0"!==t||t.startsWith("url(")));function an(t){t.duration=0,t.type="keyframes"}const on=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),ln=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;const un=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),hn=l(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function cn(t){const{motionValue:e,name:n,repeatDelay:s,repeatType:i,damping:r,type:a,keyframes:o}=t,l=e?.owner?.current;if(!(l instanceof HTMLElement||l instanceof SVGElement))return!1;const{onUpdate:u,transformTemplate:h}=e.owner.getProps();return hn()&&n&&(on.has(n)||un.has(n)&&function(t){for(let e=0;e{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=L.now();const c={autoplay:t,delay:e,type:n,repeat:s,repeatDelay:i,repeatType:r,name:o,motionValue:l,element:u,...h},d=u?.KeyframeResolver||Ye;this.keyframeResolver=new d(a,(t,e,n)=>this.onKeyframesResolved(t,e,c,!n),o,l,u),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,e,n,i){this.keyframeResolver=void 0;const{name:a,type:o,velocity:l,delay:h,isHandoff:c,onUpdate:d}=n;this.resolvedAt=L.now();let p=!0;(function(t,e,n,i){const r=t[0];if(null===r)return!1;if("display"===e||"visibility"===e)return!0;const a=t[t.length-1],o=rn(r,e),l=rn(a,e);return s(o===l,`You are trying to animate ${e} from "${r}" to "${a}". "${o?a:r}" is not an animatable value.`,"value-not-animatable"),!(!o||!l)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:e,...n,keyframes:t},f=p&&!c&&cn(m),g=m.motionValue?.owner?.current;let y;if(f)try{y=new sn({...m,element:g})}catch{y=new Te(m)}else y=new Te(m);y.finished.then(()=>{this.notifyFinished()}).catch(u),this.pendingTimeline&&(this.stopTimeline=y.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=y}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),je=!0,Le(),We(),je=!1),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}class pn{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;ne.attachTimeline(t));return()=>{e.forEach((t,e)=>{t&&t(),this.animations[e].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return mn(this.animations,"duration")}get iterationDuration(){return mn(this.animations,"iterationDuration")}runAll(t){this.animations.forEach(e=>e[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function mn(t,e){let n=0;for(let s=0;sn&&(n=i)}return n}class fn extends pn{then(t,e){return this.finished.finally(t).then(()=>{})}}class gn{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=L.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=L.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new d);const n=this.events[t].add(e);return"change"===t?()=>{n(),N.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=L.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return f(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function yn(t,e){return new gn(t,e)}function vn(t,e){if(t?.inherit&&e){const{inherit:n,...s}=t;return{...e,...s}}return t}function bn(t,e){const n=t?.[e]??t?.default??t;return n!==t?vn(n,t):n}const Tn={type:"spring",stiffness:500,damping:25,restSpeed:10},wn={type:"keyframes",duration:.8},Mn={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Sn=(t,{keyframes:e})=>e.length>2?wn:Ee.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:Tn:Mn,xn=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);const An=(t,e,n,s={},i,a)=>o=>{const l=bn(s,t)||{},u=l.delay||s.delay||0;let{elapsed:h=0}=s;h-=p(u);const c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...l,delay:-h,onUpdate:t=>{e.set(t),l.onUpdate&&l.onUpdate(t)},onComplete:()=>{o(),l.onComplete&&l.onComplete()},name:t,motionValue:e,element:a?void 0:i};(function(t){for(const e in t)if(!xn.has(e))return!0;return!1})(l)||Object.assign(c,Sn(t,c)),c.duration&&(c.duration=p(c.duration)),c.repeatDelay&&(c.repeatDelay=p(c.repeatDelay)),void 0!==c.from&&(c.keyframes[0]=c.from);let d=!1;if((!1===c.type||0===c.duration&&!c.repeatDelay)&&(an(c),0===c.delay&&(d=!0)),(r.instantAnimations||r.skipAnimations||i?.shouldSkipAnimations||l.skipAnimations)&&(d=!0,an(c),c.delay=0),c.allowFlatten=!l.type&&!l.ease,d&&!a&&void 0!==e.get()){const t=fe(c.keyframes,l);if(void 0!==t)return void N.update(()=>{c.onUpdate(t),c.onComplete()})}return l.isSync?new Te(c):new dn(c)},kn=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Vn(t,e,n=1){i(n<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[s,r]=function(t){const e=kn.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}(t);if(!s)return;const o=window.getComputedStyle(e).getPropertyValue(s);if(o){const t=o.trim();return a(t)?parseFloat(t):t}return q(r)?Vn(r,e,n+1):r}function Cn(t){const e=[{},{}];return t?.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}function Fn(t,e,n,s){if("function"==typeof e){const[i,r]=Cn(s);e=e(void 0!==n?n:t.custom,i,r)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[i,r]=Cn(s);e=e(void 0!==n?n:t.custom,i,r)}return e}const Pn=new Set(["width","height","top","left","right","bottom",...Re]);function Rn(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,yn(n))}function En(t){return(t=>Array.isArray(t))(t)?t[t.length-1]||0:t}function Bn(t,e){const n=function(t,e){const n=t.getProps();return Fn(n,e,n.custom,t)}(t,e);let{transitionEnd:s={},transition:i={},...r}=n||{};r={...r,...s};for(const e in r){Rn(t,e,En(r[e]))}}const Dn=t=>Boolean(t&&t.getVelocity);function In(t,e){const n=t.getValue("willChange");if(s=n,Boolean(Dn(s)&&s.add))return n.add(e);if(!n&&r.WillChange){const n=new r.WillChange("auto");t.addValue("willChange",n),n.add(e)}var s}function On(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const Nn="data-"+On("framerAppearId");function $n(t){return t.props[Nn]}function Kn({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,s}function jn(t,e,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:r,transitionEnd:a,...o}=e;const l=t.getDefaultTransition();r=r?vn(r,l):l;const u=r?.reduceMotion,h=r?.skipAnimations;s&&(r=s);const c=[],d=i&&t.animationState&&t.animationState.getState()[i],p=r?.path;p&&p.animateVisualElement(t,o,r,n,c);for(const e in o){const s=t.getValue(e,t.latestValues[e]??null),i=o[e];if(void 0===i||d&&Kn(d,e))continue;const a={delay:n,...bn(r||{},e)};h&&(a.skipAnimations=!0);const l=s.get();if(void 0!==l&&!s.isAnimating()&&!Array.isArray(i)&&i===l&&!a.velocity){N.update(()=>s.set(i));continue}let p=!1;if(window.MotionHandoffAnimation){const n=$n(t);if(n){const t=window.MotionHandoffAnimation(n,e,N);null!==t&&(a.startTime=t,p=!0)}}In(t,e);const m=u??t.shouldReduceMotion;s.start(An(e,s,i,m&&Pn.has(e)?{type:!1}:a,t,p));const f=s.animation;f&&c.push(f)}if(a){const e=()=>N.update(()=>{a&&Bn(t,a)});c.length?Promise.all(c).then(e):e()}return c}const Wn=t=>e=>e.test(t),Ln=[_,ut,lt,ot,ct,ht,{test:t=>"auto"===t,parse:t=>t}],Yn=t=>Ln.find(Wn(t));function Un(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||o(t))}const Xn=new Set(["brightness","contrast","saturate","opacity"]);function qn(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[s]=n.match(Q)||[];if(!s)return t;const i=n.replace(s,"");let r=Xn.has(e)?1:0;return s!==n&&(r*=100),e+"("+r+i+")"}const zn=/\b([a-z-]*)\(.*?\)/gu,Zn={...Mt,getAnimatableNone:t=>{const e=t.match(zn);return e?e.map(qn).join(" "):t}},_n={...Mt,getAnimatableNone:t=>{const e=Mt.parse(t);return Mt.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},Gn={..._,transform:Math.round},Hn={borderWidth:ut,borderTopWidth:ut,borderRightWidth:ut,borderBottomWidth:ut,borderLeftWidth:ut,borderRadius:ut,borderTopLeftRadius:ut,borderTopRightRadius:ut,borderBottomRightRadius:ut,borderBottomLeftRadius:ut,width:ut,maxWidth:ut,height:ut,maxHeight:ut,top:ut,right:ut,bottom:ut,left:ut,inset:ut,insetBlock:ut,insetBlockStart:ut,insetBlockEnd:ut,insetInline:ut,insetInlineStart:ut,insetInlineEnd:ut,padding:ut,paddingTop:ut,paddingRight:ut,paddingBottom:ut,paddingLeft:ut,paddingBlock:ut,paddingBlockStart:ut,paddingBlockEnd:ut,paddingInline:ut,paddingInlineStart:ut,paddingInlineEnd:ut,margin:ut,marginTop:ut,marginRight:ut,marginBottom:ut,marginLeft:ut,marginBlock:ut,marginBlockStart:ut,marginBlockEnd:ut,marginInline:ut,marginInlineStart:ut,marginInlineEnd:ut,fontSize:ut,backgroundPositionX:ut,backgroundPositionY:ut,...{rotate:ot,pathRotation:ot,rotateX:ot,rotateY:ot,rotateZ:ot,scale:H,scaleX:H,scaleY:H,scaleZ:H,skew:ot,skewX:ot,skewY:ot,distance:ut,translateX:ut,translateY:ut,translateZ:ut,x:ut,y:ut,z:ut,perspective:ut,transformPerspective:ut,opacity:G,originX:dt,originY:dt,originZ:ut},zIndex:Gn,fillOpacity:G,strokeOpacity:G,numOctaves:Gn},Jn={...Hn,color:mt,backgroundColor:mt,outlineColor:mt,fill:mt,stroke:mt,borderColor:mt,borderTopColor:mt,borderRightColor:mt,borderBottomColor:mt,borderLeftColor:mt,filter:Zn,WebkitFilter:Zn,mask:_n,WebkitMask:_n},Qn=t=>Jn[t],ts=new Set([Zn,_n]);function es(t,e){let n=Qn(t);return ts.has(n)||(n=Mt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const ns=new Set(["auto","none","0"]);class ss extends Ye{constructor(t,e,n,s,i){super(t,e,n,s,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n{t.getValue(e).set(n)}),this.resolveNoneKeyframes()}}const is=(t,e)=>e&&"number"==typeof t?e.transform(t):t,{schedule:rs}=O(queueMicrotask,!1);function as(t){return"object"==typeof(e=t)&&null!==e&&"ownerSVGElement"in t;var e}const os=[...Ln,mt,Mt],ls=()=>({x:{min:0,max:0},y:{min:0,max:0}}),us=new WeakMap;const hs=["initial","animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"];function cs(t){return null!==(e=t.animate)&&"object"==typeof e&&"function"==typeof e.start||hs.some(e=>function(t){return"string"==typeof t||Array.isArray(t)}(t[e]));var e}const ds={current:null},ps={current:!1},ms="undefined"!=typeof window;const fs=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let gs={};class ys{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:s,skipAnimations:i,blockInitialAnimation:r,visualState:a},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Ye,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const t=L.now();this.renderScheduledAtthis.bindToMotionValue(e,t)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(ps.current||function(){if(ps.current=!0,ms)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>ds.current=t.matches;t.addEventListener("change",e),e()}else ds.current=!1}(),this.shouldReduceMotion=ds.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),$(this.notifyUpdate),$(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,e){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),e.accelerate&&on.has(t)&&this.current instanceof HTMLElement){const{factory:n,keyframes:s,times:i,ease:r,duration:a}=e.accelerate,o=new tn({element:this.current,name:t,keyframes:s,times:i,ease:r,duration:p(a)}),l=n(o);return void this.valueSubscriptions.set(t,()=>{l(),o.cancel()})}const n=Ee.has(t);n&&this.onBindTransform&&this.onBindTransform();const s=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&N.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{s(),i&&i()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in gs){const e=gs[t];if(!e)continue;const{isEnabled:n,Feature:s}=e;if(!this.features[t]&&s&&n(this.props)&&(this.features[t]=new s(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;ee.variantChildren.delete(t)}addValue(t,e){const n=this.values.get(t);e!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=yn(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,e){let n=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var s;return null!=n&&("string"==typeof n&&(a(n)||o(n))?n=parseFloat(n):(s=n,!os.find(Wn(s))&&Mt.test(e)&&(n=es(t,e))),this.setBaseTarget(t,Dn(n)?n.get():n)),Dn(n)?n.get():n}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let n;if("string"==typeof e||"object"==typeof e){const s=Fn(this.props,e,this.presenceContext?.custom);s&&(n=s[t])}if(e&&void 0!==n)return n;const s=this.getBaseTargetFromProps(this.props,t);return void 0===s||Dn(s)?void 0!==this.initialValues[t]&&void 0===n?void 0:this.baseTarget[t]:s}on(t,e){return this.events[t]||(this.events[t]=new d),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){rs.render(this.render)}}class vs extends ys{constructor(){super(...arguments),this.KeyframeResolver=ss}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){const n=t.style;return n?n[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Dn(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}const bs={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Ts=Re.length;function ws(t,e,n){const{style:s,vars:i,transformOrigin:r}=t;let a=!1,o=!1;for(const t in e){const n=e[t];if(Ee.has(t))a=!0;else if(U(t))i[t]=n;else{const e=is(n,Hn[t]);t.startsWith("origin")?(o=!0,r[t]=e):s[t]=e}}if(e.transform||(a||n?s.transform=function(t,e,n){let s="",i=!0;for(let r=0;r{if(!e.target)return t;if("string"==typeof t){if(!ut.test(t))return t;t=parseFloat(t)}return`${Ss(t,e.target.x)}% ${Ss(t,e.target.y)}%`}},As={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,i=Mt.parse(t);if(i.length>5)return s;const r=Mt.createTransformer(t),a="number"!=typeof i[0]?1:0,o=n.x.scale*e.x,l=n.y.scale*e.y;i[0+a]/=o,i[1+a]/=l;const u=At(o,l,.5);return"number"==typeof i[2+a]&&(i[2+a]/=u),"number"==typeof i[3+a]&&(i[3+a]/=u),r(i)}},ks={borderRadius:{...xs,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"]},borderTopLeftRadius:xs,borderTopRightRadius:xs,borderBottomLeftRadius:xs,borderBottomRightRadius:xs,boxShadow:As};function Vs(t,{layout:e,layoutId:n}){return Ee.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!ks[t]||"opacity"===t)}function Cs(t,e,n){const s=t.style,i=e?.style,r={};if(!s)return r;for(const e in s)(Dn(s[e])||i&&Dn(i[e])||Vs(e,t)||void 0!==n?.getValue(e)?.liveStyle)&&(r[e]=s[e]);return r}class Fs extends vs{constructor(){super(...arguments),this.type="html",this.renderInstance=Ms}mount(t){i(Boolean(t.style),"motion.create() components must forward their ref to a HTML or SVG element","custom-component-ref"),super.mount(t)}readValueFromInstance(t,e){if(Ee.has(e))return this.projection?.isProjecting?Ce(e):((t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Fe(n,e)})(t,e);{const s=(n=t,window.getComputedStyle(n)),i=(U(e)?s.getPropertyValue(e):s[e])||0;return"string"==typeof i?i.trim():i}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return function(t,e){return function({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}(t.getBoundingClientRect(),e))}(t,e)}build(t,e,n){ws(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return Cs(t,e,n)}}class Ps extends ys{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,e){if(function(t,e){return t in e}(e,t)){const n=t[e];if("string"==typeof n||"number"==typeof n)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(t,e){delete e.output[t]}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}build(t,e){Object.assign(t.output,e)}renderInstance(t,{output:e}){Object.assign(t,e)}sortInstanceNodePosition(){return 0}}const Rs={offset:"stroke-dashoffset",array:"stroke-dasharray"},Es={offset:"strokeDashoffset",array:"strokeDasharray"};const Bs=["transform","opacity","offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Ds(t,{attrX:e,attrY:n,attrScale:s,pathLength:i,pathSpacing:r=1,pathOffset:a=0,...o},l,u,h){if(ws(t,o,u),l)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:c,style:d}=t;for(const t of Bs)void 0!==c[t]&&(d[t]=c[t],delete c[t]);(d.transform||c.transformOrigin)&&(d.transformOrigin=c.transformOrigin??"50% 50%",delete c.transformOrigin),d.transform&&(d.transformBox=h?.transformBox??"fill-box",delete c.transformBox),void 0!==e&&(c.x=e),void 0!==n&&(c.y=n),void 0!==s&&(c.scale=s),void 0!==i&&function(t,e,n=1,s=0,i=!0){t.pathLength=1;const r=i?Rs:Es;t[r.offset]=""+-s,t[r.array]=`${e} ${n}`}(c,i,r,a,!1)}const Is=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);class Os extends vs{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ls}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(Ee.has(e)){const t=Qn(e);return t&&t.default||0}if(Bs.includes(e)){const n=getComputedStyle(t)[e];if("string"==typeof n&&n)return n.trim()}return e=Is.has(e)?e:On(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return function(t,e,n){const s=Cs(t,e,n);for(const n in t)(Dn(t[n])||Dn(e[n]))&&(s[-1!==Re.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]);return s}(t,e,n)}build(t,e,n){Ds(t,e,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,e,n,s){!function(t,e,n,s){Ms(t,e,void 0,s);for(const n in e.attrs)t.setAttribute(Is.has(n)?n:On(n),e.attrs[n])}(t,e,0,s)}mount(t){var e;this.isSVGTag="string"==typeof(e=t.tagName)&&"svg"===e.toLowerCase(),super.mount(t)}}function Ns(t){return"object"==typeof t&&!Array.isArray(t)}function $s(t,e,n,s){return null==t?[]:"string"==typeof t&&Ns(e)?function(t,e,n){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){let s=document;e&&(s=e.current);const i=n?.[t]??s.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t).filter(t=>null!=t)}(t,n,s):t instanceof NodeList?Array.from(t):Array.isArray(t)?t.filter(t=>null!=t):[t]}function Ks(t,e,n){return t*(e+1)+n*e}function js(t,e,n,s){return"number"==typeof e?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?n:e.startsWith("<")?Math.max(0,n+parseFloat(e.slice(1))):s.get(e)??t}function Ws(e,n,s,i,r,a){!function(e,n,s){for(let i=0;in&&r.at"number"==typeof t,_s=t=>t.every(Zs);function Gs(t){const e={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=as(t)&&!function(t){return as(t)&&"svg"===t.tagName}(t)?new Os(e):new Fs(e);n.mount(t),us.set(t,n)}function Hs(t){const e=new Ps({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});e.mount(t),us.set(t,e)}function Js(t,e,n,s){const r=[];if(function(t,e){return Dn(t)||"number"==typeof t||"string"==typeof t&&!Ns(e)}(t,e))r.push(function(t,e,n){const s=Dn(t)?t:yn(t);return s.start(An("",s,e,n)),s.animation}(t,Ns(e)&&e.default||e,n&&n.default||n));else{if(null==t)return r;const a=$s(t,e,s),o=a.length;i(Boolean(o),"No valid elements provided.","no-valid-elements");for(let t=0;t{const u=qs(t),{delay:h=0,times:c=de(u),type:d=e.type||"keyframes",repeat:g,repeatType:y,repeatDelay:T=0,...w}=n;let{ease:M=e.ease||"easeOut",duration:S}=n;const x="function"==typeof h?h(o,l):h,A=u.length,k=Qe(d)?d:r?.[d||"keyframes"];if(A<=2&&k){let t=100;if(2===A&&_s(u)){const e=u[1]-u[0];t=Math.abs(e)}const n={...e,...w};void 0!==S&&(n.duration=p(S));const s=Wt(n,t,k);M=s.ease,S=s.duration}S??(S=a);const V=m+x;1===c.length&&0===c[0]&&(c[1]=1);const C=c.length-u.length;if(C>0&&ce(c,C),1===u.length&&u.unshift(null),g&&s(g<20,`Sequence segments can't repeat ${g} times — ignoring repeat option. Use a value below 20 or apply repeat at the sequence level instead.`),g&&g<20){const t=S>0?T/S:0;S=Ks(S,g,T);const e=[...u],n=[...c];M=Array.isArray(M)?[...M]:[M];const s=[...M],i="reverse"===y||"mirror"===y;let r=e,a=s;i&&(r=[...e].reverse(),"reverse"===y&&(a=[...s].reverse().map(t=>"function"==typeof t?b(t):t)));for(let o=0;o0&&(u.push(u[u.length-1]),c.push(p),M.push("linear")),u.push(...h);for(let t=0;t{for(const i in t){const r=t[i];r.sort(Ys);const a=[],l=[],u=[];for(let t=0;t{if(Array.isArray(t)&&"function"==typeof t[0]){const e=t[0],n=yn(0);return n.on("change",e),1===t.length?[n,[0,1]]:2===t.length?[n,[0,1],t[1]]:[n,t[1],t[2]]}return t}),e,n,{spring:oe});return r.forEach(({keyframes:t,transition:e},n)=>{i.push(...Js(n,t,e))}),i}function ti(e={}){const{scope:n,reduceMotion:s,skipAnimations:i}=e;return function(e,r,a){let o,l=[];const u={};if(void 0!==s&&(u.reduceMotion=s),void 0!==i&&(u.skipAnimations=i),h=e,Array.isArray(h)&&h.some(Array.isArray)){const{onComplete:t,...s}=r||{};"function"==typeof t&&(o=t),l=Qs(e,{...u,...s},n)}else{const{onComplete:t,...s}=a||{};"function"==typeof t&&(o=t),l=Js(e,r,{...u,...s},n)}var h;const c=new fn(l);return o&&c.finished.then(o),n&&(n.animations.push(c),c.finished.then(()=>{t(n.animations,c)})),c}}const ei=ti();export{ei as animate,ti as createScopedAnimate}; -//# sourceMappingURL=size-rollup-animate.js.map diff --git a/node_modules/framer-motion/dist/size-rollup-animate.js.map b/node_modules/framer-motion/dist/size-rollup-animate.js.map deleted file mode 100644 index ccef52f..0000000 --- a/node_modules/framer-motion/dist/size-rollup-animate.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"size-rollup-animate.js","sources":["../../motion-utils/dist/es/array.mjs","../../motion-utils/dist/es/clamp.mjs","../../motion-utils/dist/es/format-error-message.mjs","../../motion-utils/dist/es/errors.mjs","../../motion-utils/dist/es/global-config.mjs","../../motion-utils/dist/es/is-numerical-string.mjs","../../motion-utils/dist/es/is-zero-value-string.mjs","../../motion-utils/dist/es/memo.mjs","../../motion-utils/dist/es/noop.mjs","../../motion-utils/dist/es/pipe.mjs","../../motion-utils/dist/es/progress.mjs","../../motion-utils/dist/es/subscription-manager.mjs","../../motion-utils/dist/es/time-conversion.mjs","../../motion-utils/dist/es/velocity-per-second.mjs","../../motion-utils/dist/es/easing/cubic-bezier.mjs","../../motion-utils/dist/es/easing/modifiers/mirror.mjs","../../motion-utils/dist/es/easing/modifiers/reverse.mjs","../../motion-utils/dist/es/easing/back.mjs","../../motion-utils/dist/es/easing/anticipate.mjs","../../motion-utils/dist/es/easing/circ.mjs","../../motion-utils/dist/es/easing/ease.mjs","../../motion-utils/dist/es/easing/utils/is-easing-array.mjs","../../motion-utils/dist/es/easing/utils/get-easing-for-segment.mjs","../../motion-utils/dist/es/wrap.mjs","../../motion-utils/dist/es/easing/utils/is-bezier-definition.mjs","../../motion-utils/dist/es/easing/utils/map.mjs","../../motion-dom/dist/es/frameloop/order.mjs","../../motion-dom/dist/es/frameloop/batcher.mjs","../../motion-dom/dist/es/frameloop/render-step.mjs","../../motion-dom/dist/es/frameloop/frame.mjs","../../motion-dom/dist/es/frameloop/sync-time.mjs","../../motion-dom/dist/es/animation/utils/is-css-variable.mjs","../../motion-dom/dist/es/value/types/numbers/index.mjs","../../motion-dom/dist/es/value/types/utils/sanitize.mjs","../../motion-dom/dist/es/value/types/utils/float-regex.mjs","../../motion-dom/dist/es/value/types/utils/single-color-regex.mjs","../../motion-dom/dist/es/value/types/color/utils.mjs","../../motion-dom/dist/es/value/types/utils/is-nullish.mjs","../../motion-dom/dist/es/value/types/color/rgba.mjs","../../motion-dom/dist/es/value/types/color/hex.mjs","../../motion-dom/dist/es/value/types/numbers/units.mjs","../../motion-dom/dist/es/value/types/color/hsla.mjs","../../motion-dom/dist/es/value/types/color/index.mjs","../../motion-dom/dist/es/value/types/utils/color-regex.mjs","../../motion-dom/dist/es/value/types/complex/index.mjs","../../motion-dom/dist/es/value/types/color/hsla-to-rgba.mjs","../../motion-dom/dist/es/utils/mix/immediate.mjs","../../motion-dom/dist/es/utils/mix/number.mjs","../../motion-dom/dist/es/utils/mix/color.mjs","../../motion-dom/dist/es/utils/mix/visibility.mjs","../../motion-dom/dist/es/utils/mix/complex.mjs","../../motion-dom/dist/es/utils/mix/index.mjs","../../motion-dom/dist/es/animation/drivers/frame.mjs","../../motion-dom/dist/es/animation/waapi/utils/linear.mjs","../../motion-dom/dist/es/animation/generators/utils/calc-duration.mjs","../../motion-dom/dist/es/animation/generators/utils/create-generator-easing.mjs","../../motion-dom/dist/es/animation/generators/spring.mjs","../../motion-dom/dist/es/animation/generators/utils/velocity.mjs","../../motion-dom/dist/es/animation/generators/inertia.mjs","../../motion-dom/dist/es/utils/interpolate.mjs","../../motion-dom/dist/es/animation/keyframes/offsets/fill.mjs","../../motion-dom/dist/es/animation/keyframes/offsets/default.mjs","../../motion-dom/dist/es/animation/generators/keyframes.mjs","../../motion-dom/dist/es/animation/keyframes/offsets/time.mjs","../../motion-dom/dist/es/animation/keyframes/get-final.mjs","../../motion-dom/dist/es/animation/utils/replace-transition-type.mjs","../../motion-dom/dist/es/animation/utils/WithPromise.mjs","../../motion-dom/dist/es/animation/JSAnimation.mjs","../../motion-dom/dist/es/render/dom/parse-transform.mjs","../../motion-dom/dist/es/render/utils/keys-transform.mjs","../../motion-dom/dist/es/animation/keyframes/utils/unit-conversion.mjs","../../motion-dom/dist/es/animation/keyframes/KeyframesResolver.mjs","../../motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.mjs","../../motion-dom/dist/es/render/dom/style-set.mjs","../../motion-dom/dist/es/render/dom/is-css-var.mjs","../../motion-dom/dist/es/utils/supports/flags.mjs","../../motion-dom/dist/es/utils/supports/memo.mjs","../../motion-dom/dist/es/utils/supports/scroll-timeline.mjs","../../motion-dom/dist/es/utils/supports/linear-easing.mjs","../../motion-dom/dist/es/animation/waapi/easing/cubic-bezier.mjs","../../motion-dom/dist/es/animation/waapi/easing/supported.mjs","../../motion-dom/dist/es/animation/waapi/easing/map-easing.mjs","../../motion-dom/dist/es/animation/waapi/start-waapi-animation.mjs","../../motion-dom/dist/es/animation/generators/utils/is-generator.mjs","../../motion-dom/dist/es/animation/NativeAnimation.mjs","../../motion-dom/dist/es/animation/waapi/utils/apply-generator.mjs","../../motion-dom/dist/es/animation/waapi/utils/unsupported-easing.mjs","../../motion-dom/dist/es/animation/NativeAnimationExtended.mjs","../../motion-dom/dist/es/animation/utils/is-animatable.mjs","../../motion-dom/dist/es/animation/utils/make-animation-instant.mjs","../../motion-dom/dist/es/animation/waapi/utils/accelerated-values.mjs","../../motion-dom/dist/es/animation/waapi/utils/is-browser-color.mjs","../../motion-dom/dist/es/animation/waapi/supports/waapi.mjs","../../motion-dom/dist/es/animation/AsyncMotionValueAnimation.mjs","../../motion-dom/dist/es/animation/utils/can-animate.mjs","../../motion-dom/dist/es/animation/GroupAnimation.mjs","../../motion-dom/dist/es/animation/GroupAnimationWithThen.mjs","../../motion-dom/dist/es/value/index.mjs","../../motion-dom/dist/es/animation/utils/resolve-transition.mjs","../../motion-dom/dist/es/animation/utils/get-value-transition.mjs","../../motion-dom/dist/es/animation/utils/default-transitions.mjs","../../motion-dom/dist/es/animation/utils/is-transition-defined.mjs","../../motion-dom/dist/es/animation/interfaces/motion-value.mjs","../../motion-dom/dist/es/animation/utils/css-variables-conversion.mjs","../../motion-dom/dist/es/render/utils/resolve-variants.mjs","../../motion-dom/dist/es/render/utils/keys-position.mjs","../../motion-dom/dist/es/render/utils/setters.mjs","../../motion-dom/dist/es/render/utils/is-keyframes-target.mjs","../../motion-dom/dist/es/render/utils/resolve-dynamic-variants.mjs","../../motion-dom/dist/es/value/utils/is-motion-value.mjs","../../motion-dom/dist/es/value/will-change/add-will-change.mjs","../../motion-dom/dist/es/value/will-change/is.mjs","../../motion-dom/dist/es/render/dom/utils/camel-to-dash.mjs","../../motion-dom/dist/es/animation/optimized-appear/data-id.mjs","../../motion-dom/dist/es/animation/optimized-appear/get-appear-id.mjs","../../motion-dom/dist/es/animation/interfaces/visual-element-target.mjs","../../motion-dom/dist/es/value/types/auto.mjs","../../motion-dom/dist/es/value/types/test.mjs","../../motion-dom/dist/es/value/types/dimensions.mjs","../../motion-dom/dist/es/animation/keyframes/utils/is-none.mjs","../../motion-dom/dist/es/value/types/complex/filter.mjs","../../motion-dom/dist/es/value/types/complex/mask.mjs","../../motion-dom/dist/es/value/types/int.mjs","../../motion-dom/dist/es/value/types/maps/number.mjs","../../motion-dom/dist/es/value/types/maps/transform.mjs","../../motion-dom/dist/es/value/types/maps/defaults.mjs","../../motion-dom/dist/es/value/types/utils/animatable-none.mjs","../../motion-dom/dist/es/animation/keyframes/utils/make-none-animatable.mjs","../../motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.mjs","../../motion-dom/dist/es/value/types/utils/get-as-type.mjs","../../motion-dom/dist/es/frameloop/microtask.mjs","../../motion-dom/dist/es/utils/is-svg-element.mjs","../../motion-utils/dist/es/is-object.mjs","../../motion-dom/dist/es/value/types/utils/find.mjs","../../motion-dom/dist/es/projection/geometry/models.mjs","../../motion-dom/dist/es/render/store.mjs","../../motion-dom/dist/es/render/utils/variant-props.mjs","../../motion-dom/dist/es/render/utils/is-controlling-variants.mjs","../../motion-dom/dist/es/render/utils/is-animation-controls.mjs","../../motion-dom/dist/es/render/utils/is-variant-label.mjs","../../motion-dom/dist/es/render/utils/reduced-motion/state.mjs","../../motion-dom/dist/es/render/utils/reduced-motion/index.mjs","../../motion-dom/dist/es/render/VisualElement.mjs","../../motion-dom/dist/es/render/utils/motion-values.mjs","../../motion-dom/dist/es/render/dom/DOMVisualElement.mjs","../../motion-dom/dist/es/render/html/utils/build-transform.mjs","../../motion-dom/dist/es/render/html/utils/build-styles.mjs","../../motion-dom/dist/es/render/html/utils/render.mjs","../../motion-dom/dist/es/projection/styles/scale-border-radius.mjs","../../motion-dom/dist/es/projection/styles/scale-box-shadow.mjs","../../motion-dom/dist/es/projection/styles/scale-correction.mjs","../../motion-dom/dist/es/utils/border-radius.mjs","../../motion-dom/dist/es/render/utils/is-forced-motion-value.mjs","../../motion-dom/dist/es/render/html/utils/scrape-motion-values.mjs","../../motion-dom/dist/es/render/html/HTMLVisualElement.mjs","../../motion-dom/dist/es/projection/utils/measure.mjs","../../motion-dom/dist/es/projection/geometry/conversion.mjs","../../motion-dom/dist/es/render/object/ObjectVisualElement.mjs","../../motion-dom/dist/es/render/svg/utils/path.mjs","../../motion-dom/dist/es/render/svg/utils/build-attrs.mjs","../../motion-dom/dist/es/render/svg/utils/camel-case-attrs.mjs","../../motion-dom/dist/es/render/svg/SVGVisualElement.mjs","../../motion-dom/dist/es/render/svg/utils/scrape-motion-values.mjs","../../motion-dom/dist/es/render/svg/utils/render.mjs","../../motion-dom/dist/es/render/svg/utils/is-svg-tag.mjs","../lib/animation/utils/is-dom-keyframes.js","../lib/animation/animate/resolve-subjects.js","../../motion-dom/dist/es/utils/resolve-elements.mjs","../lib/animation/sequence/utils/calc-repeat-duration.js","../lib/animation/sequence/utils/calc-time.js","../lib/animation/sequence/utils/edit.js","../lib/animation/sequence/utils/normalize-times.js","../lib/animation/sequence/utils/sort.js","../lib/animation/sequence/create.js","../lib/animation/utils/create-visual-element.js","../../motion-dom/dist/es/utils/is-svg-svg-element.mjs","../lib/animation/animate/subject.js","../../motion-dom/dist/es/animation/animate/single-value.mjs","../lib/animation/animate/sequence.js","../lib/animation/animate/index.js"],"sourcesContent":["function addUniqueItem(arr, item) {\n if (arr.indexOf(item) === -1)\n arr.push(item);\n}\nfunction removeItem(arr, item) {\n const index = arr.indexOf(item);\n if (index > -1)\n arr.splice(index, 1);\n}\n// Adapted from array-move\nfunction moveItem([...arr], fromIndex, toIndex) {\n const startIndex = fromIndex < 0 ? arr.length + fromIndex : fromIndex;\n if (startIndex >= 0 && startIndex < arr.length) {\n const endIndex = toIndex < 0 ? arr.length + toIndex : toIndex;\n const [item] = arr.splice(fromIndex, 1);\n arr.splice(endIndex, 0, item);\n }\n return arr;\n}\n\nexport { addUniqueItem, moveItem, removeItem };\n//# sourceMappingURL=array.mjs.map\n","const clamp = (min, max, v) => {\n if (v > max)\n return max;\n if (v < min)\n return min;\n return v;\n};\n\nexport { clamp };\n//# sourceMappingURL=clamp.mjs.map\n","function formatErrorMessage(message, errorCode) {\n return errorCode\n ? `${message}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${errorCode}`\n : message;\n}\n\nexport { formatErrorMessage };\n//# sourceMappingURL=format-error-message.mjs.map\n","import { formatErrorMessage } from './format-error-message.mjs';\n\nlet warning = () => { };\nlet invariant = () => { };\nif (typeof process !== \"undefined\" &&\n process.env?.NODE_ENV !== \"production\") {\n warning = (check, message, errorCode) => {\n if (!check && typeof console !== \"undefined\") {\n console.warn(formatErrorMessage(message, errorCode));\n }\n };\n invariant = (check, message, errorCode) => {\n if (!check) {\n throw new Error(formatErrorMessage(message, errorCode));\n }\n };\n}\n\nexport { invariant, warning };\n//# sourceMappingURL=errors.mjs.map\n","const MotionGlobalConfig = {};\n\nexport { MotionGlobalConfig };\n//# sourceMappingURL=global-config.mjs.map\n","/**\n * Check if value is a numerical string, ie a string that is purely a number eg \"100\" or \"-100.1\"\n */\nconst isNumericalString = (v) => /^-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)$/u.test(v);\n\nexport { isNumericalString };\n//# sourceMappingURL=is-numerical-string.mjs.map\n","/**\n * Check if the value is a zero value string like \"0px\" or \"0%\"\n */\nconst isZeroValueString = (v) => /^0[^.\\s]+$/u.test(v);\n\nexport { isZeroValueString };\n//# sourceMappingURL=is-zero-value-string.mjs.map\n","/*#__NO_SIDE_EFFECTS__*/\nfunction memo(callback) {\n let result;\n return () => {\n if (result === undefined)\n result = callback();\n return result;\n };\n}\n\nexport { memo };\n//# sourceMappingURL=memo.mjs.map\n","/*#__NO_SIDE_EFFECTS__*/\nconst noop = (any) => any;\n\nexport { noop };\n//# sourceMappingURL=noop.mjs.map\n","/**\n * Pipe\n * Compose other transformers to run linearily\n * pipe(min(20), max(40))\n * @param {...functions} transformers\n * @return {function}\n */\nconst pipe = (...transformers) => transformers.reduce((a, b) => (v) => b(a(v)));\n\nexport { pipe };\n//# sourceMappingURL=pipe.mjs.map\n","/*\n Progress within given range\n\n Given a lower limit and an upper limit, we return the progress\n (expressed as a number 0-1) represented by the given value, and\n limit that progress to within 0-1.\n*/\n/*#__NO_SIDE_EFFECTS__*/\nconst progress = (from, to, value) => {\n const range = to - from;\n return range ? (value - from) / range : 1;\n};\n\nexport { progress };\n//# sourceMappingURL=progress.mjs.map\n","import { addUniqueItem, removeItem } from './array.mjs';\n\nclass SubscriptionManager {\n constructor() {\n this.subscriptions = [];\n }\n add(handler) {\n addUniqueItem(this.subscriptions, handler);\n return () => removeItem(this.subscriptions, handler);\n }\n notify(a, b, c) {\n const numSubscriptions = this.subscriptions.length;\n if (!numSubscriptions)\n return;\n if (numSubscriptions === 1) {\n /**\n * If there's only a single handler we can just call it without invoking a loop.\n */\n this.subscriptions[0](a, b, c);\n }\n else {\n for (let i = 0; i < numSubscriptions; i++) {\n /**\n * Check whether the handler exists before firing as it's possible\n * the subscriptions were modified during this loop running.\n */\n const handler = this.subscriptions[i];\n handler && handler(a, b, c);\n }\n }\n }\n getSize() {\n return this.subscriptions.length;\n }\n clear() {\n this.subscriptions.length = 0;\n }\n}\n\nexport { SubscriptionManager };\n//# sourceMappingURL=subscription-manager.mjs.map\n","/**\n * Converts seconds to milliseconds\n *\n * @param seconds - Time in seconds.\n * @return milliseconds - Converted time in milliseconds.\n */\n/*#__NO_SIDE_EFFECTS__*/\nconst secondsToMilliseconds = (seconds) => seconds * 1000;\n/*#__NO_SIDE_EFFECTS__*/\nconst millisecondsToSeconds = (milliseconds) => milliseconds / 1000;\n\nexport { millisecondsToSeconds, secondsToMilliseconds };\n//# sourceMappingURL=time-conversion.mjs.map\n","/*\n Convert velocity into velocity per second\n*/\n/*#__NO_SIDE_EFFECTS__*/\nconst velocityPerSecond = (velocity, frameDuration) => frameDuration ? velocity * (1000 / frameDuration) : 0;\n\nexport { velocityPerSecond };\n//# sourceMappingURL=velocity-per-second.mjs.map\n","import { noop } from '../noop.mjs';\n\n/*\n Bezier function generator\n This has been modified from Gaëtan Renaudeau's BezierEasing\n https://github.com/gre/bezier-easing/blob/master/src/index.js\n https://github.com/gre/bezier-easing/blob/master/LICENSE\n \n I've removed the newtonRaphsonIterate algo because in benchmarking it\n wasn't noticeably faster than binarySubdivision, indeed removing it\n usually improved times, depending on the curve.\n I also removed the lookup table, as for the added bundle size and loop we're\n only cutting ~4 or so subdivision iterations. I bumped the max iterations up\n to 12 to compensate and this still tended to be faster for no perceivable\n loss in accuracy.\n Usage\n const easeOut = cubicBezier(.17,.67,.83,.67);\n const x = easeOut(0.5); // returns 0.627...\n*/\n// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.\nconst calcBezier = (t, a1, a2) => (((1.0 - 3.0 * a2 + 3.0 * a1) * t + (3.0 * a2 - 6.0 * a1)) * t + 3.0 * a1) *\n t;\nconst subdivisionPrecision = 0.0000001;\nconst subdivisionMaxIterations = 12;\nfunction binarySubdivide(x, lowerBound, upperBound, mX1, mX2) {\n let currentX;\n let currentT;\n let i = 0;\n do {\n currentT = lowerBound + (upperBound - lowerBound) / 2.0;\n currentX = calcBezier(currentT, mX1, mX2) - x;\n if (currentX > 0.0) {\n upperBound = currentT;\n }\n else {\n lowerBound = currentT;\n }\n } while (Math.abs(currentX) > subdivisionPrecision &&\n ++i < subdivisionMaxIterations);\n return currentT;\n}\n/*#__NO_SIDE_EFFECTS__*/\nfunction cubicBezier(mX1, mY1, mX2, mY2) {\n // If this is a linear gradient, return linear easing\n if (mX1 === mY1 && mX2 === mY2)\n return noop;\n const getTForX = (aX) => binarySubdivide(aX, 0, 1, mX1, mX2);\n // If animation is at start/end, return t without easing\n return (t) => t === 0 || t === 1 ? t : calcBezier(getTForX(t), mY1, mY2);\n}\n\nexport { cubicBezier };\n//# sourceMappingURL=cubic-bezier.mjs.map\n","// Accepts an easing function and returns a new one that outputs mirrored values for\n// the second half of the animation. Turns easeIn into easeInOut.\n/*#__NO_SIDE_EFFECTS__*/\nconst mirrorEasing = (easing) => (p) => p <= 0.5 ? easing(2 * p) / 2 : (2 - easing(2 * (1 - p))) / 2;\n\nexport { mirrorEasing };\n//# sourceMappingURL=mirror.mjs.map\n","// Accepts an easing function and returns a new one that outputs reversed values.\n// Turns easeIn into easeOut.\n/*#__NO_SIDE_EFFECTS__*/\nconst reverseEasing = (easing) => (p) => 1 - easing(1 - p);\n\nexport { reverseEasing };\n//# sourceMappingURL=reverse.mjs.map\n","import { cubicBezier } from './cubic-bezier.mjs';\nimport { mirrorEasing } from './modifiers/mirror.mjs';\nimport { reverseEasing } from './modifiers/reverse.mjs';\n\nconst backOut = /*@__PURE__*/ cubicBezier(0.33, 1.53, 0.69, 0.99);\nconst backIn = /*@__PURE__*/ reverseEasing(backOut);\nconst backInOut = /*@__PURE__*/ mirrorEasing(backIn);\n\nexport { backIn, backInOut, backOut };\n//# sourceMappingURL=back.mjs.map\n","import { backIn } from './back.mjs';\n\nconst anticipate = (p) => p >= 1\n ? 1\n : (p *= 2) < 1\n ? 0.5 * backIn(p)\n : 0.5 * (2 - Math.pow(2, -10 * (p - 1)));\n\nexport { anticipate };\n//# sourceMappingURL=anticipate.mjs.map\n","import { mirrorEasing } from './modifiers/mirror.mjs';\nimport { reverseEasing } from './modifiers/reverse.mjs';\n\nconst circIn = (p) => 1 - Math.sin(Math.acos(p));\nconst circOut = reverseEasing(circIn);\nconst circInOut = mirrorEasing(circIn);\n\nexport { circIn, circInOut, circOut };\n//# sourceMappingURL=circ.mjs.map\n","import { cubicBezier } from './cubic-bezier.mjs';\n\nconst easeIn = /*@__PURE__*/ cubicBezier(0.42, 0, 1, 1);\nconst easeOut = /*@__PURE__*/ cubicBezier(0, 0, 0.58, 1);\nconst easeInOut = /*@__PURE__*/ cubicBezier(0.42, 0, 0.58, 1);\n\nexport { easeIn, easeInOut, easeOut };\n//# sourceMappingURL=ease.mjs.map\n","/*#__NO_SIDE_EFFECTS__*/\nconst isEasingArray = (ease) => {\n return Array.isArray(ease) && typeof ease[0] !== \"number\";\n};\n\nexport { isEasingArray };\n//# sourceMappingURL=is-easing-array.mjs.map\n","import { wrap } from '../../wrap.mjs';\nimport { isEasingArray } from './is-easing-array.mjs';\n\n/*#__NO_SIDE_EFFECTS__*/\nfunction getEasingForSegment(easing, i) {\n return isEasingArray(easing) ? easing[wrap(0, easing.length, i)] : easing;\n}\n\nexport { getEasingForSegment };\n//# sourceMappingURL=get-easing-for-segment.mjs.map\n","const wrap = (min, max, v) => {\n const rangeSize = max - min;\n return ((((v - min) % rangeSize) + rangeSize) % rangeSize) + min;\n};\n\nexport { wrap };\n//# sourceMappingURL=wrap.mjs.map\n","/*#__NO_SIDE_EFFECTS__*/\nconst isBezierDefinition = (easing) => Array.isArray(easing) && typeof easing[0] === \"number\";\n\nexport { isBezierDefinition };\n//# sourceMappingURL=is-bezier-definition.mjs.map\n","import { invariant } from '../../errors.mjs';\nimport { noop } from '../../noop.mjs';\nimport { anticipate } from '../anticipate.mjs';\nimport { backOut, backInOut, backIn } from '../back.mjs';\nimport { circOut, circInOut, circIn } from '../circ.mjs';\nimport { cubicBezier } from '../cubic-bezier.mjs';\nimport { easeOut, easeInOut, easeIn } from '../ease.mjs';\nimport { isBezierDefinition } from './is-bezier-definition.mjs';\n\nconst easingLookup = {\n linear: noop,\n easeIn,\n easeInOut,\n easeOut,\n circIn,\n circInOut,\n circOut,\n backIn,\n backInOut,\n backOut,\n anticipate,\n};\nconst isValidEasing = (easing) => {\n return typeof easing === \"string\";\n};\nconst easingDefinitionToFunction = (definition) => {\n if (isBezierDefinition(definition)) {\n // If cubic bezier definition, create bezier curve\n invariant(definition.length === 4, `Cubic bezier arrays must contain four numerical values.`, \"cubic-bezier-length\");\n const [x1, y1, x2, y2] = definition;\n return cubicBezier(x1, y1, x2, y2);\n }\n else if (isValidEasing(definition)) {\n // Else lookup from table\n invariant(easingLookup[definition] !== undefined, `Invalid easing type '${definition}'`, \"invalid-easing-type\");\n return easingLookup[definition];\n }\n return definition;\n};\n\nexport { easingDefinitionToFunction };\n//# sourceMappingURL=map.mjs.map\n","const stepsOrder = [\n \"setup\", // Compute\n \"read\", // Read\n \"resolveKeyframes\", // Write/Read/Write/Read\n \"preUpdate\", // Compute\n \"update\", // Compute\n \"preRender\", // Compute\n \"render\", // Write\n \"postRender\", // Compute\n];\n\nexport { stepsOrder };\n//# sourceMappingURL=order.mjs.map\n","import { MotionGlobalConfig } from 'motion-utils';\nimport { stepsOrder } from './order.mjs';\nimport { createRenderStep } from './render-step.mjs';\n\nconst maxElapsed = 40;\nfunction createRenderBatcher(scheduleNextBatch, allowKeepAlive) {\n let runNextFrame = false;\n let useDefaultElapsed = true;\n const state = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n };\n const flagRunNextFrame = () => (runNextFrame = true);\n const steps = stepsOrder.reduce((acc, key) => {\n acc[key] = createRenderStep(flagRunNextFrame);\n return acc;\n }, {});\n const { setup, read, resolveKeyframes, preUpdate, update, preRender, render, postRender, } = steps;\n const processBatch = () => {\n const useManualTiming = MotionGlobalConfig.useManualTiming;\n const timestamp = useManualTiming\n ? state.timestamp\n : performance.now();\n runNextFrame = false;\n if (!useManualTiming) {\n state.delta = useDefaultElapsed\n ? 1000 / 60\n : Math.max(Math.min(timestamp - state.timestamp, maxElapsed), 1);\n }\n state.timestamp = timestamp;\n state.isProcessing = true;\n // Unrolled render loop for better per-frame performance\n setup.process(state);\n read.process(state);\n resolveKeyframes.process(state);\n preUpdate.process(state);\n update.process(state);\n preRender.process(state);\n render.process(state);\n postRender.process(state);\n state.isProcessing = false;\n if (runNextFrame && allowKeepAlive) {\n useDefaultElapsed = false;\n scheduleNextBatch(processBatch);\n }\n };\n const wake = () => {\n runNextFrame = true;\n useDefaultElapsed = true;\n if (!state.isProcessing) {\n scheduleNextBatch(processBatch);\n }\n };\n const schedule = stepsOrder.reduce((acc, key) => {\n const step = steps[key];\n acc[key] = (process, keepAlive = false, immediate = false) => {\n if (!runNextFrame)\n wake();\n return step.schedule(process, keepAlive, immediate);\n };\n return acc;\n }, {});\n const cancel = (process) => {\n for (let i = 0; i < stepsOrder.length; i++) {\n steps[stepsOrder[i]].cancel(process);\n }\n };\n return { schedule, cancel, state, steps };\n}\n\nexport { createRenderBatcher };\n//# sourceMappingURL=batcher.mjs.map\n","function createRenderStep(runNextFrame) {\n /**\n * We create and reuse two queues, one to queue jobs for the current frame\n * and one for the next. We reuse to avoid triggering GC after x frames.\n */\n let thisFrame = new Set();\n let nextFrame = new Set();\n /**\n * Track whether we're currently processing jobs in this step. This way\n * we can decide whether to schedule new jobs for this frame or next.\n */\n let isProcessing = false;\n let flushNextFrame = false;\n /**\n * A set of processes which were marked keepAlive when scheduled.\n */\n const toKeepAlive = new WeakSet();\n let latestFrameData = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n };\n function triggerCallback(callback) {\n if (toKeepAlive.has(callback)) {\n step.schedule(callback);\n runNextFrame();\n }\n callback(latestFrameData);\n }\n const step = {\n /**\n * Schedule a process to run on the next frame.\n */\n schedule: (callback, keepAlive = false, immediate = false) => {\n const addToCurrentFrame = immediate && isProcessing;\n const queue = addToCurrentFrame ? thisFrame : nextFrame;\n if (keepAlive)\n toKeepAlive.add(callback);\n queue.add(callback);\n return callback;\n },\n /**\n * Cancel the provided callback from running on the next frame.\n */\n cancel: (callback) => {\n nextFrame.delete(callback);\n toKeepAlive.delete(callback);\n },\n /**\n * Execute all schedule callbacks.\n */\n process: (frameData) => {\n latestFrameData = frameData;\n /**\n * If we're already processing we've probably been triggered by a flushSync\n * inside an existing process. Instead of executing, mark flushNextFrame\n * as true and ensure we flush the following frame at the end of this one.\n */\n if (isProcessing) {\n flushNextFrame = true;\n return;\n }\n isProcessing = true;\n // Swap this frame and the next to avoid GC\n const prevFrame = thisFrame;\n thisFrame = nextFrame;\n nextFrame = prevFrame;\n // Execute this frame\n thisFrame.forEach(triggerCallback);\n // Clear the frame so no callbacks remain. This is to avoid\n // memory leaks should this render step not run for a while.\n thisFrame.clear();\n isProcessing = false;\n if (flushNextFrame) {\n flushNextFrame = false;\n step.process(frameData);\n }\n },\n };\n return step;\n}\n\nexport { createRenderStep };\n//# sourceMappingURL=render-step.mjs.map\n","import { noop } from 'motion-utils';\nimport { createRenderBatcher } from './batcher.mjs';\n\nconst { schedule: frame, cancel: cancelFrame, state: frameData, steps: frameSteps, } = /* @__PURE__ */ createRenderBatcher(typeof requestAnimationFrame !== \"undefined\" ? requestAnimationFrame : noop, true);\n\nexport { cancelFrame, frame, frameData, frameSteps };\n//# sourceMappingURL=frame.mjs.map\n","import { MotionGlobalConfig } from 'motion-utils';\nimport { frameData } from './frame.mjs';\n\nlet now;\nfunction clearTime() {\n now = undefined;\n}\n/**\n * An eventloop-synchronous alternative to performance.now().\n *\n * Ensures that time measurements remain consistent within a synchronous context.\n * Usually calling performance.now() twice within the same synchronous context\n * will return different values which isn't useful for animations when we're usually\n * trying to sync animations to the same frame.\n */\nconst time = {\n now: () => {\n if (now === undefined) {\n time.set(frameData.isProcessing || MotionGlobalConfig.useManualTiming\n ? frameData.timestamp\n : performance.now());\n }\n return now;\n },\n set: (newTime) => {\n now = newTime;\n queueMicrotask(clearTime);\n },\n};\n\nexport { time };\n//# sourceMappingURL=sync-time.mjs.map\n","const checkStringStartsWith = (token) => (key) => typeof key === \"string\" && key.startsWith(token);\nconst isCSSVariableName = \n/*@__PURE__*/ checkStringStartsWith(\"--\");\nconst startsAsVariableToken = \n/*@__PURE__*/ checkStringStartsWith(\"var(--\");\nconst isCSSVariableToken = (value) => {\n const startsWithToken = startsAsVariableToken(value);\n if (!startsWithToken)\n return false;\n // Ensure any comments are stripped from the value as this can harm performance of the regex.\n return singleCssVariableRegex.test(value.split(\"/*\")[0].trim());\n};\nconst singleCssVariableRegex = /var\\(--(?:[\\w-]+\\s*|[\\w-]+\\s*,(?:\\s*[^)(\\s]|\\s*\\((?:[^)(]|\\([^)(]*\\))*\\))+\\s*)\\)$/iu;\n/**\n * Check if a value contains a CSS variable anywhere (e.g. inside calc()).\n * Unlike isCSSVariableToken which checks if the value IS a var() token,\n * this checks if the value CONTAINS var() somewhere in the string.\n */\nfunction containsCSSVariable(value) {\n if (typeof value !== \"string\")\n return false;\n // Strip comments to avoid false positives\n return value.split(\"/*\")[0].includes(\"var(--\");\n}\n\nexport { containsCSSVariable, isCSSVariableName, isCSSVariableToken };\n//# sourceMappingURL=is-css-variable.mjs.map\n","import { clamp } from 'motion-utils';\n\nconst number = {\n test: (v) => typeof v === \"number\",\n parse: parseFloat,\n transform: (v) => v,\n};\nconst alpha = {\n ...number,\n transform: (v) => clamp(0, 1, v),\n};\nconst scale = {\n ...number,\n default: 1,\n};\n\nexport { alpha, number, scale };\n//# sourceMappingURL=index.mjs.map\n","// If this number is a decimal, make it just five decimal places\n// to avoid exponents\nconst sanitize = (v) => Math.round(v * 100000) / 100000;\n\nexport { sanitize };\n//# sourceMappingURL=sanitize.mjs.map\n","const floatRegex = /-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)/gu;\n\nexport { floatRegex };\n//# sourceMappingURL=float-regex.mjs.map\n","const singleColorRegex = /^(?:#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\))$/iu;\n\nexport { singleColorRegex };\n//# sourceMappingURL=single-color-regex.mjs.map\n","import { floatRegex } from '../utils/float-regex.mjs';\nimport { isNullish } from '../utils/is-nullish.mjs';\nimport { singleColorRegex } from '../utils/single-color-regex.mjs';\n\n/**\n * Returns true if the provided string is a color, ie rgba(0,0,0,0) or #000,\n * but false if a number or multiple colors\n */\nconst isColorString = (type, testProp) => (v) => {\n return Boolean((typeof v === \"string\" &&\n singleColorRegex.test(v) &&\n v.startsWith(type)) ||\n (testProp &&\n !isNullish(v) &&\n Object.prototype.hasOwnProperty.call(v, testProp)));\n};\nconst splitColor = (aName, bName, cName) => (v) => {\n if (typeof v !== \"string\")\n return v;\n const [a, b, c, alpha] = v.match(floatRegex);\n return {\n [aName]: parseFloat(a),\n [bName]: parseFloat(b),\n [cName]: parseFloat(c),\n alpha: alpha !== undefined ? parseFloat(alpha) : 1,\n };\n};\n\nexport { isColorString, splitColor };\n//# sourceMappingURL=utils.mjs.map\n","function isNullish(v) {\n return v == null;\n}\n\nexport { isNullish };\n//# sourceMappingURL=is-nullish.mjs.map\n","import { clamp } from 'motion-utils';\nimport { number, alpha } from '../numbers/index.mjs';\nimport { sanitize } from '../utils/sanitize.mjs';\nimport { splitColor, isColorString } from './utils.mjs';\n\nconst clampRgbUnit = (v) => clamp(0, 255, v);\nconst rgbUnit = {\n ...number,\n transform: (v) => Math.round(clampRgbUnit(v)),\n};\nconst rgba = {\n test: /*@__PURE__*/ isColorString(\"rgb\", \"red\"),\n parse: /*@__PURE__*/ splitColor(\"red\", \"green\", \"blue\"),\n transform: ({ red, green, blue, alpha: alpha$1 = 1 }) => \"rgba(\" +\n rgbUnit.transform(red) +\n \", \" +\n rgbUnit.transform(green) +\n \", \" +\n rgbUnit.transform(blue) +\n \", \" +\n sanitize(alpha.transform(alpha$1)) +\n \")\",\n};\n\nexport { rgbUnit, rgba };\n//# sourceMappingURL=rgba.mjs.map\n","import { rgba } from './rgba.mjs';\nimport { isColorString } from './utils.mjs';\n\nfunction parseHex(v) {\n let r = \"\";\n let g = \"\";\n let b = \"\";\n let a = \"\";\n // If we have 6 characters, ie #FF0000\n if (v.length > 5) {\n r = v.substring(1, 3);\n g = v.substring(3, 5);\n b = v.substring(5, 7);\n a = v.substring(7, 9);\n // Or we have 3 characters, ie #F00\n }\n else {\n r = v.substring(1, 2);\n g = v.substring(2, 3);\n b = v.substring(3, 4);\n a = v.substring(4, 5);\n r += r;\n g += g;\n b += b;\n a += a;\n }\n return {\n red: parseInt(r, 16),\n green: parseInt(g, 16),\n blue: parseInt(b, 16),\n alpha: a ? parseInt(a, 16) / 255 : 1,\n };\n}\nconst hex = {\n test: /*@__PURE__*/ isColorString(\"#\"),\n parse: parseHex,\n transform: rgba.transform,\n};\n\nexport { hex };\n//# sourceMappingURL=hex.mjs.map\n","/*#__NO_SIDE_EFFECTS__*/\nconst createUnitType = (unit) => ({\n test: (v) => typeof v === \"string\" && v.endsWith(unit) && v.split(\" \").length === 1,\n parse: parseFloat,\n transform: (v) => `${v}${unit}`,\n});\nconst degrees = /*@__PURE__*/ createUnitType(\"deg\");\nconst percent = /*@__PURE__*/ createUnitType(\"%\");\nconst px = /*@__PURE__*/ createUnitType(\"px\");\nconst vh = /*@__PURE__*/ createUnitType(\"vh\");\nconst vw = /*@__PURE__*/ createUnitType(\"vw\");\nconst progressPercentage = /*@__PURE__*/ (() => ({\n ...percent,\n parse: (v) => percent.parse(v) / 100,\n transform: (v) => percent.transform(v * 100),\n}))();\n\nexport { degrees, percent, progressPercentage, px, vh, vw };\n//# sourceMappingURL=units.mjs.map\n","import { alpha } from '../numbers/index.mjs';\nimport { percent } from '../numbers/units.mjs';\nimport { sanitize } from '../utils/sanitize.mjs';\nimport { splitColor, isColorString } from './utils.mjs';\n\nconst hsla = {\n test: /*@__PURE__*/ isColorString(\"hsl\", \"hue\"),\n parse: /*@__PURE__*/ splitColor(\"hue\", \"saturation\", \"lightness\"),\n transform: ({ hue, saturation, lightness, alpha: alpha$1 = 1 }) => {\n return (\"hsla(\" +\n Math.round(hue) +\n \", \" +\n percent.transform(sanitize(saturation)) +\n \", \" +\n percent.transform(sanitize(lightness)) +\n \", \" +\n sanitize(alpha.transform(alpha$1)) +\n \")\");\n },\n};\n\nexport { hsla };\n//# sourceMappingURL=hsla.mjs.map\n","import { hex } from './hex.mjs';\nimport { hsla } from './hsla.mjs';\nimport { rgba } from './rgba.mjs';\n\nconst color = {\n test: (v) => rgba.test(v) || hex.test(v) || hsla.test(v),\n parse: (v) => {\n if (rgba.test(v)) {\n return rgba.parse(v);\n }\n else if (hsla.test(v)) {\n return hsla.parse(v);\n }\n else {\n return hex.parse(v);\n }\n },\n transform: (v) => {\n return typeof v === \"string\"\n ? v\n : v.hasOwnProperty(\"red\")\n ? rgba.transform(v)\n : hsla.transform(v);\n },\n getAnimatableNone: (v) => {\n const parsed = color.parse(v);\n parsed.alpha = 0;\n return color.transform(parsed);\n },\n};\n\nexport { color };\n//# sourceMappingURL=index.mjs.map\n","const colorRegex = /(?:#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\))/giu;\n\nexport { colorRegex };\n//# sourceMappingURL=color-regex.mjs.map\n","import { color } from '../color/index.mjs';\nimport { colorRegex } from '../utils/color-regex.mjs';\nimport { floatRegex } from '../utils/float-regex.mjs';\nimport { sanitize } from '../utils/sanitize.mjs';\n\nfunction test(v) {\n return (isNaN(v) &&\n typeof v === \"string\" &&\n (v.match(floatRegex)?.length || 0) +\n (v.match(colorRegex)?.length || 0) >\n 0);\n}\nconst NUMBER_TOKEN = \"number\";\nconst COLOR_TOKEN = \"color\";\nconst VAR_TOKEN = \"var\";\nconst VAR_FUNCTION_TOKEN = \"var(\";\nconst SPLIT_TOKEN = \"${}\";\n// this regex consists of the `singleCssVariableRegex|rgbHSLValueRegex|digitRegex`\nconst complexRegex = /var\\s*\\(\\s*--(?:[\\w-]+\\s*|[\\w-]+\\s*,(?:\\s*[^)(\\s]|\\s*\\((?:[^)(]|\\([^)(]*\\))*\\))+\\s*)\\)|#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\)|-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)/giu;\nfunction analyseComplexValue(value) {\n const originalValue = value.toString();\n const values = [];\n const indexes = {\n color: [],\n number: [],\n var: [],\n };\n const types = [];\n let i = 0;\n const tokenised = originalValue.replace(complexRegex, (parsedValue) => {\n if (color.test(parsedValue)) {\n indexes.color.push(i);\n types.push(COLOR_TOKEN);\n values.push(color.parse(parsedValue));\n }\n else if (parsedValue.startsWith(VAR_FUNCTION_TOKEN)) {\n indexes.var.push(i);\n types.push(VAR_TOKEN);\n values.push(parsedValue);\n }\n else {\n indexes.number.push(i);\n types.push(NUMBER_TOKEN);\n values.push(parseFloat(parsedValue));\n }\n ++i;\n return SPLIT_TOKEN;\n });\n const split = tokenised.split(SPLIT_TOKEN);\n return { values, split, indexes, types };\n}\nfunction parseComplexValue(v) {\n return analyseComplexValue(v).values;\n}\nfunction buildTransformer({ split, types }) {\n const numSections = split.length;\n return (v) => {\n let output = \"\";\n for (let i = 0; i < numSections; i++) {\n output += split[i];\n if (v[i] !== undefined) {\n const type = types[i];\n if (type === NUMBER_TOKEN) {\n output += sanitize(v[i]);\n }\n else if (type === COLOR_TOKEN) {\n output += color.transform(v[i]);\n }\n else {\n output += v[i];\n }\n }\n }\n return output;\n };\n}\nfunction createTransformer(source) {\n return buildTransformer(analyseComplexValue(source));\n}\nconst convertNumbersToZero = (v) => typeof v === \"number\" ? 0 : color.test(v) ? color.getAnimatableNone(v) : v;\n/**\n * Convert a parsed value to its zero equivalent, but preserve numbers\n * that act as divisors in CSS calc() expressions.\n *\n * analyseComplexValue extracts numbers from CSS strings and puts the\n * surrounding text into a `split` template array. For example:\n * \"calc(var(--gap) / 5)\" → values: [var(--gap), 5]\n * split: [\"calc(\", \" / \", \")\"]\n *\n * When building a zero-equivalent for animation, naively zeroing all\n * numbers turns the divisor into 0 → \"calc(var(--gap) / 0)\" → NaN.\n * We detect this by checking whether the text preceding a number\n * (split[i]) ends with \"/\" — the CSS calc division operator.\n */\nconst convertToZero = (value, splitBefore) => {\n if (typeof value === \"number\") {\n return splitBefore?.trim().endsWith(\"/\") ? value : 0;\n }\n return convertNumbersToZero(value);\n};\nfunction getAnimatableNone(v) {\n const info = analyseComplexValue(v);\n const transformer = buildTransformer(info);\n return transformer(info.values.map((value, i) => convertToZero(value, info.split[i])));\n}\nconst complex = {\n test,\n parse: parseComplexValue,\n createTransformer,\n getAnimatableNone,\n};\n\nexport { analyseComplexValue, complex };\n//# sourceMappingURL=index.mjs.map\n","// Adapted from https://gist.github.com/mjackson/5311256\nfunction hueToRgb(p, q, t) {\n if (t < 0)\n t += 1;\n if (t > 1)\n t -= 1;\n if (t < 1 / 6)\n return p + (q - p) * 6 * t;\n if (t < 1 / 2)\n return q;\n if (t < 2 / 3)\n return p + (q - p) * (2 / 3 - t) * 6;\n return p;\n}\nfunction hslaToRgba({ hue, saturation, lightness, alpha }) {\n hue /= 360;\n saturation /= 100;\n lightness /= 100;\n let red = 0;\n let green = 0;\n let blue = 0;\n if (!saturation) {\n red = green = blue = lightness;\n }\n else {\n const q = lightness < 0.5\n ? lightness * (1 + saturation)\n : lightness + saturation - lightness * saturation;\n const p = 2 * lightness - q;\n red = hueToRgb(p, q, hue + 1 / 3);\n green = hueToRgb(p, q, hue);\n blue = hueToRgb(p, q, hue - 1 / 3);\n }\n return {\n red: Math.round(red * 255),\n green: Math.round(green * 255),\n blue: Math.round(blue * 255),\n alpha,\n };\n}\n\nexport { hslaToRgba };\n//# sourceMappingURL=hsla-to-rgba.mjs.map\n","function mixImmediate(a, b) {\n return (p) => (p > 0 ? b : a);\n}\n\nexport { mixImmediate };\n//# sourceMappingURL=immediate.mjs.map\n","/*\n Value in range from progress\n\n Given a lower limit and an upper limit, we return the value within\n that range as expressed by progress (usually a number from 0 to 1)\n\n So progress = 0.5 would change\n\n from -------- to\n\n to\n\n from ---- to\n\n E.g. from = 10, to = 20, progress = 0.5 => 15\n\n @param [number]: Lower limit of range\n @param [number]: Upper limit of range\n @param [number]: The progress between lower and upper limits expressed 0-1\n @return [number]: Value as calculated from progress within range (not limited within range)\n*/\nconst mixNumber = (from, to, progress) => {\n return from + (to - from) * progress;\n};\n\nexport { mixNumber };\n//# sourceMappingURL=number.mjs.map\n","import { warning } from 'motion-utils';\nimport { hex } from '../../value/types/color/hex.mjs';\nimport { hsla } from '../../value/types/color/hsla.mjs';\nimport { hslaToRgba } from '../../value/types/color/hsla-to-rgba.mjs';\nimport { rgba } from '../../value/types/color/rgba.mjs';\nimport { mixImmediate } from './immediate.mjs';\nimport { mixNumber } from './number.mjs';\n\n// Linear color space blending\n// Explained https://www.youtube.com/watch?v=LKnqECcg6Gw\n// Demonstrated http://codepen.io/osublake/pen/xGVVaN\nconst mixLinearColor = (from, to, v) => {\n const fromExpo = from * from;\n const expo = v * (to * to - fromExpo) + fromExpo;\n return expo < 0 ? 0 : Math.sqrt(expo);\n};\nconst colorTypes = [hex, rgba, hsla];\nconst getColorType = (v) => colorTypes.find((type) => type.test(v));\nfunction asRGBA(color) {\n const type = getColorType(color);\n warning(Boolean(type), `'${color}' is not an animatable color. Use the equivalent color code instead.`, \"color-not-animatable\");\n if (!Boolean(type))\n return false;\n let model = type.parse(color);\n if (type === hsla) {\n // TODO Remove this cast - needed since Motion's stricter typing\n model = hslaToRgba(model);\n }\n return model;\n}\nconst mixColor = (from, to) => {\n const fromRGBA = asRGBA(from);\n const toRGBA = asRGBA(to);\n if (!fromRGBA || !toRGBA) {\n return mixImmediate(from, to);\n }\n const blended = { ...fromRGBA };\n return (v) => {\n blended.red = mixLinearColor(fromRGBA.red, toRGBA.red, v);\n blended.green = mixLinearColor(fromRGBA.green, toRGBA.green, v);\n blended.blue = mixLinearColor(fromRGBA.blue, toRGBA.blue, v);\n blended.alpha = mixNumber(fromRGBA.alpha, toRGBA.alpha, v);\n return rgba.transform(blended);\n };\n};\n\nexport { mixColor, mixLinearColor };\n//# sourceMappingURL=color.mjs.map\n","const invisibleValues = new Set([\"none\", \"hidden\"]);\n/**\n * Returns a function that, when provided a progress value between 0 and 1,\n * will return the \"none\" or \"hidden\" string only when the progress is that of\n * the origin or target.\n */\nfunction mixVisibility(origin, target) {\n if (invisibleValues.has(origin)) {\n return (p) => (p <= 0 ? origin : target);\n }\n else {\n return (p) => (p >= 1 ? target : origin);\n }\n}\n\nexport { invisibleValues, mixVisibility };\n//# sourceMappingURL=visibility.mjs.map\n","import { pipe, warning } from 'motion-utils';\nimport { isCSSVariableToken } from '../../animation/utils/is-css-variable.mjs';\nimport { color } from '../../value/types/color/index.mjs';\nimport { complex, analyseComplexValue } from '../../value/types/complex/index.mjs';\nimport { mixColor } from './color.mjs';\nimport { mixImmediate } from './immediate.mjs';\nimport { mixNumber as mixNumber$1 } from './number.mjs';\nimport { invisibleValues, mixVisibility } from './visibility.mjs';\n\nfunction mixNumber(a, b) {\n return (p) => mixNumber$1(a, b, p);\n}\nfunction getMixer(a) {\n if (typeof a === \"number\") {\n return mixNumber;\n }\n else if (typeof a === \"string\") {\n return isCSSVariableToken(a)\n ? mixImmediate\n : color.test(a)\n ? mixColor\n : mixComplex;\n }\n else if (Array.isArray(a)) {\n return mixArray;\n }\n else if (typeof a === \"object\") {\n return color.test(a) ? mixColor : mixObject;\n }\n return mixImmediate;\n}\nfunction mixArray(a, b) {\n const output = [...a];\n const numValues = output.length;\n const blendValue = a.map((v, i) => getMixer(v)(v, b[i]));\n return (p) => {\n for (let i = 0; i < numValues; i++) {\n output[i] = blendValue[i](p);\n }\n return output;\n };\n}\nfunction mixObject(a, b) {\n const output = { ...a, ...b };\n const blendValue = {};\n for (const key in output) {\n if (a[key] !== undefined && b[key] !== undefined) {\n blendValue[key] = getMixer(a[key])(a[key], b[key]);\n }\n }\n return (v) => {\n for (const key in blendValue) {\n output[key] = blendValue[key](v);\n }\n return output;\n };\n}\nfunction matchOrder(origin, target) {\n const orderedOrigin = [];\n const pointers = { color: 0, var: 0, number: 0 };\n for (let i = 0; i < target.values.length; i++) {\n const type = target.types[i];\n const originIndex = origin.indexes[type][pointers[type]];\n const originValue = origin.values[originIndex] ?? 0;\n orderedOrigin[i] = originValue;\n pointers[type]++;\n }\n return orderedOrigin;\n}\nconst mixComplex = (origin, target) => {\n const template = complex.createTransformer(target);\n const originStats = analyseComplexValue(origin);\n const targetStats = analyseComplexValue(target);\n const canInterpolate = originStats.indexes.var.length === targetStats.indexes.var.length &&\n originStats.indexes.color.length === targetStats.indexes.color.length &&\n originStats.indexes.number.length >= targetStats.indexes.number.length;\n if (canInterpolate) {\n if ((invisibleValues.has(origin) &&\n !targetStats.values.length) ||\n (invisibleValues.has(target) &&\n !originStats.values.length)) {\n return mixVisibility(origin, target);\n }\n return pipe(mixArray(matchOrder(originStats, targetStats), targetStats.values), template);\n }\n else {\n warning(true, `Complex values '${origin}' and '${target}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`, \"complex-values-different\");\n return mixImmediate(origin, target);\n }\n};\n\nexport { getMixer, mixArray, mixComplex, mixObject };\n//# sourceMappingURL=complex.mjs.map\n","import { getMixer } from './complex.mjs';\nimport { mixNumber } from './number.mjs';\n\nfunction mix(from, to, p) {\n if (typeof from === \"number\" &&\n typeof to === \"number\" &&\n typeof p === \"number\") {\n return mixNumber(from, to, p);\n }\n const mixer = getMixer(from);\n return mixer(from, to);\n}\n\nexport { mix };\n//# sourceMappingURL=index.mjs.map\n","import { time } from '../../frameloop/sync-time.mjs';\nimport { frameData, cancelFrame, frame } from '../../frameloop/frame.mjs';\n\nconst frameloopDriver = (update) => {\n const passTimestamp = ({ timestamp }) => update(timestamp);\n return {\n start: (keepAlive = true) => frame.update(passTimestamp, keepAlive),\n stop: () => cancelFrame(passTimestamp),\n /**\n * If we're processing this frame we can use the\n * framelocked timestamp to keep things in sync.\n */\n now: () => (frameData.isProcessing ? frameData.timestamp : time.now()),\n };\n};\n\nexport { frameloopDriver };\n//# sourceMappingURL=frame.mjs.map\n","const generateLinearEasing = (easing, duration, // as milliseconds\nresolution = 10 // as milliseconds\n) => {\n let points = \"\";\n const numPoints = Math.max(Math.round(duration / resolution), 2);\n for (let i = 0; i < numPoints; i++) {\n points += Math.round(easing(i / (numPoints - 1)) * 10000) / 10000 + \", \";\n }\n return `linear(${points.substring(0, points.length - 2)})`;\n};\n\nexport { generateLinearEasing };\n//# sourceMappingURL=linear.mjs.map\n","/**\n * Implement a practical max duration for keyframe generation\n * to prevent infinite loops\n */\nconst maxGeneratorDuration = 20000;\nfunction calcGeneratorDuration(generator) {\n let duration = 0;\n const timeStep = 50;\n let state = generator.next(duration);\n while (!state.done && duration < maxGeneratorDuration) {\n duration += timeStep;\n state = generator.next(duration);\n }\n return duration >= maxGeneratorDuration ? Infinity : duration;\n}\n\nexport { calcGeneratorDuration, maxGeneratorDuration };\n//# sourceMappingURL=calc-duration.mjs.map\n","import { millisecondsToSeconds } from 'motion-utils';\nimport { calcGeneratorDuration, maxGeneratorDuration } from './calc-duration.mjs';\n\n/**\n * Create a progress => progress easing function from a generator.\n */\nfunction createGeneratorEasing(options, scale = 100, createGenerator) {\n const generator = createGenerator({ ...options, keyframes: [0, scale] });\n const duration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration);\n return {\n type: \"keyframes\",\n ease: (progress) => {\n return generator.next(duration * progress).value / scale;\n },\n duration: millisecondsToSeconds(duration),\n };\n}\n\nexport { createGeneratorEasing };\n//# sourceMappingURL=create-generator-easing.mjs.map\n","import { millisecondsToSeconds, clamp, secondsToMilliseconds, warning } from 'motion-utils';\nimport { generateLinearEasing } from '../waapi/utils/linear.mjs';\nimport { calcGeneratorDuration, maxGeneratorDuration } from './utils/calc-duration.mjs';\nimport { createGeneratorEasing } from './utils/create-generator-easing.mjs';\n\nconst springDefaults = {\n // Default spring physics\n stiffness: 100,\n damping: 10,\n mass: 1.0,\n velocity: 0.0,\n // Default duration/bounce-based options\n duration: 800, // in ms\n bounce: 0.3,\n visualDuration: 0.3, // in seconds\n // Rest thresholds\n restSpeed: {\n granular: 0.01,\n default: 2,\n },\n restDelta: {\n granular: 0.005,\n default: 0.5,\n },\n // Limits\n minDuration: 0.01, // in seconds\n maxDuration: 10.0, // in seconds\n minDamping: 0.05,\n maxDamping: 1,\n};\nfunction calcAngularFreq(undampedFreq, dampingRatio) {\n return undampedFreq * Math.sqrt(1 - dampingRatio * dampingRatio);\n}\nconst rootIterations = 12;\nfunction approximateRoot(envelope, derivative, initialGuess) {\n let result = initialGuess;\n for (let i = 1; i < rootIterations; i++) {\n result = result - envelope(result) / derivative(result);\n }\n return result;\n}\n/**\n * This is ported from the Framer implementation of duration-based spring resolution.\n */\nconst safeMin = 0.001;\nfunction findSpring({ duration = springDefaults.duration, bounce = springDefaults.bounce, velocity = springDefaults.velocity, mass = springDefaults.mass, }) {\n let envelope;\n let derivative;\n warning(duration <= secondsToMilliseconds(springDefaults.maxDuration), \"Spring duration must be 10 seconds or less\", \"spring-duration-limit\");\n let dampingRatio = 1 - bounce;\n /**\n * Restrict dampingRatio and duration to within acceptable ranges.\n */\n dampingRatio = clamp(springDefaults.minDamping, springDefaults.maxDamping, dampingRatio);\n duration = clamp(springDefaults.minDuration, springDefaults.maxDuration, millisecondsToSeconds(duration));\n if (dampingRatio < 1) {\n /**\n * Underdamped spring\n */\n envelope = (undampedFreq) => {\n const exponentialDecay = undampedFreq * dampingRatio;\n const delta = exponentialDecay * duration;\n const a = exponentialDecay - velocity;\n const b = calcAngularFreq(undampedFreq, dampingRatio);\n const c = Math.exp(-delta);\n return safeMin - (a / b) * c;\n };\n derivative = (undampedFreq) => {\n const exponentialDecay = undampedFreq * dampingRatio;\n const delta = exponentialDecay * duration;\n const d = delta * velocity + velocity;\n const e = Math.pow(dampingRatio, 2) * Math.pow(undampedFreq, 2) * duration;\n const f = Math.exp(-delta);\n const g = calcAngularFreq(Math.pow(undampedFreq, 2), dampingRatio);\n const factor = -envelope(undampedFreq) + safeMin > 0 ? -1 : 1;\n return (factor * ((d - e) * f)) / g;\n };\n }\n else {\n /**\n * Critically-damped spring\n */\n envelope = (undampedFreq) => {\n const a = Math.exp(-undampedFreq * duration);\n const b = (undampedFreq - velocity) * duration + 1;\n return -safeMin + a * b;\n };\n derivative = (undampedFreq) => {\n const a = Math.exp(-undampedFreq * duration);\n const b = (velocity - undampedFreq) * (duration * duration);\n return a * b;\n };\n }\n const initialGuess = 5 / duration;\n const undampedFreq = approximateRoot(envelope, derivative, initialGuess);\n duration = secondsToMilliseconds(duration);\n if (isNaN(undampedFreq)) {\n return {\n stiffness: springDefaults.stiffness,\n damping: springDefaults.damping,\n duration,\n };\n }\n else {\n const stiffness = Math.pow(undampedFreq, 2) * mass;\n return {\n stiffness,\n damping: dampingRatio * 2 * Math.sqrt(mass * stiffness),\n duration,\n };\n }\n}\nconst durationKeys = [\"duration\", \"bounce\"];\nconst physicsKeys = [\"stiffness\", \"damping\", \"mass\"];\nfunction isSpringType(options, keys) {\n return keys.some((key) => options[key] !== undefined);\n}\nfunction getSpringOptions(options) {\n let springOptions = {\n velocity: springDefaults.velocity,\n stiffness: springDefaults.stiffness,\n damping: springDefaults.damping,\n mass: springDefaults.mass,\n isResolvedFromDuration: false,\n ...options,\n };\n // stiffness/damping/mass overrides duration/bounce\n if (!isSpringType(options, physicsKeys) &&\n isSpringType(options, durationKeys)) {\n // Time-defined springs should ignore inherited velocity.\n // Velocity from interrupted animations can cause findSpring()\n // to compute wildly different spring parameters, leading to\n // massive oscillation on small-range animations.\n springOptions.velocity = 0;\n if (options.visualDuration) {\n const visualDuration = options.visualDuration;\n const root = (2 * Math.PI) / (visualDuration * 1.2);\n const stiffness = root * root;\n const damping = 2 *\n clamp(0.05, 1, 1 - (options.bounce || 0)) *\n Math.sqrt(stiffness);\n springOptions = {\n ...springOptions,\n mass: springDefaults.mass,\n stiffness,\n damping,\n };\n }\n else {\n const derived = findSpring({ ...options, velocity: 0 });\n springOptions = {\n ...springOptions,\n ...derived,\n mass: springDefaults.mass,\n };\n springOptions.isResolvedFromDuration = true;\n }\n }\n return springOptions;\n}\nfunction spring(optionsOrVisualDuration = springDefaults.visualDuration, bounce = springDefaults.bounce) {\n const options = typeof optionsOrVisualDuration !== \"object\"\n ? {\n visualDuration: optionsOrVisualDuration,\n keyframes: [0, 1],\n bounce,\n }\n : optionsOrVisualDuration;\n let { restSpeed, restDelta } = options;\n const origin = options.keyframes[0];\n const target = options.keyframes[options.keyframes.length - 1];\n /**\n * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator\n * to reduce GC during animation.\n */\n const state = { done: false, value: origin };\n const { stiffness, damping, mass, duration, velocity, isResolvedFromDuration, } = getSpringOptions({\n ...options,\n velocity: -millisecondsToSeconds(options.velocity || 0),\n });\n const initialVelocity = velocity || 0.0;\n const dampingRatio = damping / (2 * Math.sqrt(stiffness * mass));\n const initialDelta = target - origin;\n const undampedAngularFreq = millisecondsToSeconds(Math.sqrt(stiffness / mass));\n /**\n * If we're working on a granular scale, use smaller defaults for determining\n * when the spring is finished.\n *\n * These defaults have been selected emprically based on what strikes a good\n * ratio between feeling good and finishing as soon as changes are imperceptible.\n */\n const isGranularScale = Math.abs(initialDelta) < 5;\n restSpeed || (restSpeed = isGranularScale\n ? springDefaults.restSpeed.granular\n : springDefaults.restSpeed.default);\n restDelta || (restDelta = isGranularScale\n ? springDefaults.restDelta.granular\n : springDefaults.restDelta.default);\n let resolveSpring;\n let resolveVelocity;\n // Underdamped coefficients, hoisted for use in the inlined next() hot path\n let angularFreq;\n let A;\n let sinCoeff;\n let cosCoeff;\n if (dampingRatio < 1) {\n angularFreq = calcAngularFreq(undampedAngularFreq, dampingRatio);\n A =\n (initialVelocity +\n dampingRatio * undampedAngularFreq * initialDelta) /\n angularFreq;\n // Underdamped spring\n resolveSpring = (t) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);\n return (target -\n envelope *\n (A * Math.sin(angularFreq * t) +\n initialDelta * Math.cos(angularFreq * t)));\n };\n // Analytical derivative of underdamped spring (px/ms)\n sinCoeff =\n dampingRatio * undampedAngularFreq * A + initialDelta * angularFreq;\n cosCoeff =\n dampingRatio * undampedAngularFreq * initialDelta - A * angularFreq;\n resolveVelocity = (t) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);\n return envelope *\n (sinCoeff * Math.sin(angularFreq * t) +\n cosCoeff * Math.cos(angularFreq * t));\n };\n }\n else if (dampingRatio === 1) {\n // Critically damped spring\n resolveSpring = (t) => target -\n Math.exp(-undampedAngularFreq * t) *\n (initialDelta +\n (initialVelocity + undampedAngularFreq * initialDelta) * t);\n // Analytical derivative of critically damped spring (px/ms)\n const C = initialVelocity + undampedAngularFreq * initialDelta;\n resolveVelocity = (t) => Math.exp(-undampedAngularFreq * t) *\n (undampedAngularFreq * C * t - initialVelocity);\n }\n else {\n // Overdamped spring\n const dampedAngularFreq = undampedAngularFreq * Math.sqrt(dampingRatio * dampingRatio - 1);\n resolveSpring = (t) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);\n // When performing sinh or cosh values can hit Infinity so we cap them here\n const freqForT = Math.min(dampedAngularFreq * t, 300);\n return (target -\n (envelope *\n ((initialVelocity +\n dampingRatio * undampedAngularFreq * initialDelta) *\n Math.sinh(freqForT) +\n dampedAngularFreq *\n initialDelta *\n Math.cosh(freqForT))) /\n dampedAngularFreq);\n };\n // Analytical derivative of overdamped spring (px/ms)\n const P = (initialVelocity +\n dampingRatio * undampedAngularFreq * initialDelta) /\n dampedAngularFreq;\n const sinhCoeff = dampingRatio * undampedAngularFreq * P - initialDelta * dampedAngularFreq;\n const coshCoeff = dampingRatio * undampedAngularFreq * initialDelta - P * dampedAngularFreq;\n resolveVelocity = (t) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);\n const freqForT = Math.min(dampedAngularFreq * t, 300);\n return envelope *\n (sinhCoeff * Math.sinh(freqForT) +\n coshCoeff * Math.cosh(freqForT));\n };\n }\n const generator = {\n calculatedDuration: isResolvedFromDuration ? duration || null : null,\n velocity: (t) => secondsToMilliseconds(resolveVelocity(t)),\n next: (t) => {\n /**\n * For underdamped physics springs we need both position and\n * velocity each tick. Compute shared trig values once to avoid\n * duplicate Math.exp/sin/cos calls on the hot path.\n */\n if (!isResolvedFromDuration && dampingRatio < 1) {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);\n const sin = Math.sin(angularFreq * t);\n const cos = Math.cos(angularFreq * t);\n const current = target -\n envelope *\n (A * sin + initialDelta * cos);\n const currentVelocity = secondsToMilliseconds(envelope *\n (sinCoeff * sin + cosCoeff * cos));\n state.done =\n Math.abs(currentVelocity) <= restSpeed &&\n Math.abs(target - current) <= restDelta;\n state.value = state.done ? target : current;\n return state;\n }\n const current = resolveSpring(t);\n if (!isResolvedFromDuration) {\n const currentVelocity = secondsToMilliseconds(resolveVelocity(t));\n state.done =\n Math.abs(currentVelocity) <= restSpeed &&\n Math.abs(target - current) <= restDelta;\n }\n else {\n state.done = t >= duration;\n }\n state.value = state.done ? target : current;\n return state;\n },\n toString: () => {\n const calculatedDuration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration);\n const easing = generateLinearEasing((progress) => generator.next(calculatedDuration * progress).value, calculatedDuration, 30);\n return calculatedDuration + \"ms \" + easing;\n },\n toTransition: () => { },\n };\n return generator;\n}\nspring.applyToOptions = (options) => {\n const generatorOptions = createGeneratorEasing(options, 100, spring);\n options.ease = generatorOptions.ease;\n options.duration = secondsToMilliseconds(generatorOptions.duration);\n options.type = \"keyframes\";\n return options;\n};\n\nexport { spring };\n//# sourceMappingURL=spring.mjs.map\n","import { velocityPerSecond } from 'motion-utils';\n\nconst velocitySampleDuration = 5; // ms\nfunction getGeneratorVelocity(resolveValue, t, current) {\n const prevT = Math.max(t - velocitySampleDuration, 0);\n return velocityPerSecond(current - resolveValue(prevT), t - prevT);\n}\n\nexport { getGeneratorVelocity };\n//# sourceMappingURL=velocity.mjs.map\n","import { spring } from './spring.mjs';\nimport { getGeneratorVelocity } from './utils/velocity.mjs';\n\nfunction inertia({ keyframes, velocity = 0.0, power = 0.8, timeConstant = 325, bounceDamping = 10, bounceStiffness = 500, modifyTarget, min, max, restDelta = 0.5, restSpeed, }) {\n const origin = keyframes[0];\n const state = {\n done: false,\n value: origin,\n };\n const isOutOfBounds = (v) => (min !== undefined && v < min) || (max !== undefined && v > max);\n const nearestBoundary = (v) => {\n if (min === undefined)\n return max;\n if (max === undefined)\n return min;\n return Math.abs(min - v) < Math.abs(max - v) ? min : max;\n };\n let amplitude = power * velocity;\n const ideal = origin + amplitude;\n const target = modifyTarget === undefined ? ideal : modifyTarget(ideal);\n /**\n * If the target has changed we need to re-calculate the amplitude, otherwise\n * the animation will start from the wrong position.\n */\n if (target !== ideal)\n amplitude = target - origin;\n const calcDelta = (t) => -amplitude * Math.exp(-t / timeConstant);\n const calcLatest = (t) => target + calcDelta(t);\n const applyFriction = (t) => {\n const delta = calcDelta(t);\n const latest = calcLatest(t);\n state.done = Math.abs(delta) <= restDelta;\n state.value = state.done ? target : latest;\n };\n /**\n * Ideally this would resolve for t in a stateless way, we could\n * do that by always precalculating the animation but as we know\n * this will be done anyway we can assume that spring will\n * be discovered during that.\n */\n let timeReachedBoundary;\n let spring$1;\n const checkCatchBoundary = (t) => {\n if (!isOutOfBounds(state.value))\n return;\n timeReachedBoundary = t;\n spring$1 = spring({\n keyframes: [state.value, nearestBoundary(state.value)],\n velocity: getGeneratorVelocity(calcLatest, t, state.value), // TODO: This should be passing * 1000\n damping: bounceDamping,\n stiffness: bounceStiffness,\n restDelta,\n restSpeed,\n });\n };\n checkCatchBoundary(0);\n return {\n calculatedDuration: null,\n next: (t) => {\n /**\n * We need to resolve the friction to figure out if we need a\n * spring but we don't want to do this twice per frame. So here\n * we flag if we updated for this frame and later if we did\n * we can skip doing it again.\n */\n let hasUpdatedFrame = false;\n if (!spring$1 && timeReachedBoundary === undefined) {\n hasUpdatedFrame = true;\n applyFriction(t);\n checkCatchBoundary(t);\n }\n /**\n * If we have a spring and the provided t is beyond the moment the friction\n * animation crossed the min/max boundary, use the spring.\n */\n if (timeReachedBoundary !== undefined && t >= timeReachedBoundary) {\n return spring$1.next(t - timeReachedBoundary);\n }\n else {\n !hasUpdatedFrame && applyFriction(t);\n return state;\n }\n },\n };\n}\n\nexport { inertia };\n//# sourceMappingURL=inertia.mjs.map\n","import { invariant, clamp, MotionGlobalConfig, noop, pipe, progress } from 'motion-utils';\nimport { mix } from './mix/index.mjs';\n\nfunction createMixers(output, ease, customMixer) {\n const mixers = [];\n const mixerFactory = customMixer || MotionGlobalConfig.mix || mix;\n const numMixers = output.length - 1;\n for (let i = 0; i < numMixers; i++) {\n let mixer = mixerFactory(output[i], output[i + 1]);\n if (ease) {\n const easingFunction = Array.isArray(ease) ? ease[i] || noop : ease;\n mixer = pipe(easingFunction, mixer);\n }\n mixers.push(mixer);\n }\n return mixers;\n}\n/**\n * Create a function that maps from a numerical input array to a generic output array.\n *\n * Accepts:\n * - Numbers\n * - Colors (hex, hsl, hsla, rgb, rgba)\n * - Complex (combinations of one or more numbers or strings)\n *\n * ```jsx\n * const mixColor = interpolate([0, 1], ['#fff', '#000'])\n *\n * mixColor(0.5) // 'rgba(128, 128, 128, 1)'\n * ```\n *\n * TODO Revisit this approach once we've moved to data models for values,\n * probably not needed to pregenerate mixer functions.\n *\n * @public\n */\nfunction interpolate(input, output, { clamp: isClamp = true, ease, mixer } = {}) {\n const inputLength = input.length;\n invariant(inputLength === output.length, \"Both input and output ranges must be the same length\", \"range-length\");\n /**\n * If we're only provided a single input, we can just make a function\n * that returns the output.\n */\n if (inputLength === 1)\n return () => output[0];\n if (inputLength === 2 && output[0] === output[1])\n return () => output[1];\n const isZeroDeltaRange = input[0] === input[1];\n // If input runs highest -> lowest, reverse both arrays\n if (input[0] > input[inputLength - 1]) {\n input = [...input].reverse();\n output = [...output].reverse();\n }\n const mixers = createMixers(output, ease, mixer);\n const numMixers = mixers.length;\n const interpolator = (v) => {\n if (isZeroDeltaRange && v < input[0])\n return output[0];\n let i = 0;\n if (numMixers > 1) {\n for (; i < input.length - 2; i++) {\n if (v < input[i + 1])\n break;\n }\n }\n const progressInRange = progress(input[i], input[i + 1], v);\n return mixers[i](progressInRange);\n };\n return isClamp\n ? (v) => interpolator(clamp(input[0], input[inputLength - 1], v))\n : interpolator;\n}\n\nexport { interpolate };\n//# sourceMappingURL=interpolate.mjs.map\n","import { progress } from 'motion-utils';\nimport { mixNumber } from '../../../utils/mix/number.mjs';\n\nfunction fillOffset(offset, remaining) {\n const min = offset[offset.length - 1];\n for (let i = 1; i <= remaining; i++) {\n const offsetProgress = progress(0, remaining, i);\n offset.push(mixNumber(min, 1, offsetProgress));\n }\n}\n\nexport { fillOffset };\n//# sourceMappingURL=fill.mjs.map\n","import { fillOffset } from './fill.mjs';\n\nfunction defaultOffset(arr) {\n const offset = [0];\n fillOffset(offset, arr.length - 1);\n return offset;\n}\n\nexport { defaultOffset };\n//# sourceMappingURL=default.mjs.map\n","import { easeInOut, isEasingArray, easingDefinitionToFunction } from 'motion-utils';\nimport { interpolate } from '../../utils/interpolate.mjs';\nimport { defaultOffset } from '../keyframes/offsets/default.mjs';\nimport { convertOffsetToTimes } from '../keyframes/offsets/time.mjs';\n\nfunction defaultEasing(values, easing) {\n return values.map(() => easing || easeInOut).splice(0, values.length - 1);\n}\nfunction keyframes({ duration = 300, keyframes: keyframeValues, times, ease = \"easeInOut\", }) {\n /**\n * Easing functions can be externally defined as strings. Here we convert them\n * into actual functions.\n */\n const easingFunctions = isEasingArray(ease)\n ? ease.map(easingDefinitionToFunction)\n : easingDefinitionToFunction(ease);\n /**\n * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator\n * to reduce GC during animation.\n */\n const state = {\n done: false,\n value: keyframeValues[0],\n };\n /**\n * Create a times array based on the provided 0-1 offsets\n */\n const absoluteTimes = convertOffsetToTimes(\n // Only use the provided offsets if they're the correct length\n // TODO Maybe we should warn here if there's a length mismatch\n times && times.length === keyframeValues.length\n ? times\n : defaultOffset(keyframeValues), duration);\n const mapTimeToKeyframe = interpolate(absoluteTimes, keyframeValues, {\n ease: Array.isArray(easingFunctions)\n ? easingFunctions\n : defaultEasing(keyframeValues, easingFunctions),\n });\n return {\n calculatedDuration: duration,\n next: (t) => {\n state.value = mapTimeToKeyframe(t);\n state.done = t >= duration;\n return state;\n },\n };\n}\n\nexport { defaultEasing, keyframes };\n//# sourceMappingURL=keyframes.mjs.map\n","function convertOffsetToTimes(offset, duration) {\n return offset.map((o) => o * duration);\n}\n\nexport { convertOffsetToTimes };\n//# sourceMappingURL=time.mjs.map\n","const isNotNull = (value) => value !== null;\nfunction getFinalKeyframe(keyframes, { repeat, repeatType = \"loop\" }, finalKeyframe, speed = 1) {\n const resolvedKeyframes = keyframes.filter(isNotNull);\n const useFirstKeyframe = speed < 0 || (repeat && repeatType !== \"loop\" && repeat % 2 === 1);\n const index = useFirstKeyframe ? 0 : resolvedKeyframes.length - 1;\n return !index || finalKeyframe === undefined\n ? resolvedKeyframes[index]\n : finalKeyframe;\n}\n\nexport { getFinalKeyframe };\n//# sourceMappingURL=get-final.mjs.map\n","import { inertia } from '../generators/inertia.mjs';\nimport { keyframes } from '../generators/keyframes.mjs';\nimport { spring } from '../generators/spring.mjs';\n\nconst transitionTypeMap = {\n decay: inertia,\n inertia,\n tween: keyframes,\n keyframes: keyframes,\n spring,\n};\nfunction replaceTransitionType(transition) {\n if (typeof transition.type === \"string\") {\n transition.type = transitionTypeMap[transition.type];\n }\n}\n\nexport { replaceTransitionType };\n//# sourceMappingURL=replace-transition-type.mjs.map\n","class WithPromise {\n constructor() {\n this.updateFinished();\n }\n get finished() {\n return this._finished;\n }\n updateFinished() {\n this._finished = new Promise((resolve) => {\n this.resolve = resolve;\n });\n }\n notifyFinished() {\n this.resolve();\n }\n /**\n * Allows the animation to be awaited.\n *\n * @deprecated Use `finished` instead.\n */\n then(onResolve, onReject) {\n return this.finished.then(onResolve, onReject);\n }\n}\n\nexport { WithPromise };\n//# sourceMappingURL=WithPromise.mjs.map\n","import { invariant, pipe, clamp, millisecondsToSeconds, secondsToMilliseconds } from 'motion-utils';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { mix } from '../utils/mix/index.mjs';\nimport { frameloopDriver } from './drivers/frame.mjs';\nimport { inertia } from './generators/inertia.mjs';\nimport { keyframes } from './generators/keyframes.mjs';\nimport { calcGeneratorDuration } from './generators/utils/calc-duration.mjs';\nimport { getGeneratorVelocity } from './generators/utils/velocity.mjs';\nimport { getFinalKeyframe } from './keyframes/get-final.mjs';\nimport { replaceTransitionType } from './utils/replace-transition-type.mjs';\nimport { WithPromise } from './utils/WithPromise.mjs';\n\nconst percentToProgress = (percent) => percent / 100;\nclass JSAnimation extends WithPromise {\n constructor(options) {\n super();\n this.state = \"idle\";\n this.startTime = null;\n this.isStopped = false;\n /**\n * The current time of the animation.\n */\n this.currentTime = 0;\n /**\n * The time at which the animation was paused.\n */\n this.holdTime = null;\n /**\n * Playback speed as a factor. 0 would be stopped, -1 reverse and 2 double speed.\n */\n this.playbackSpeed = 1;\n /**\n * Reusable state object for the delay phase to avoid\n * allocating a new object every frame.\n */\n this.delayState = {\n done: false,\n value: undefined,\n };\n /**\n * This method is bound to the instance to fix a pattern where\n * animation.stop is returned as a reference from a useEffect.\n */\n this.stop = () => {\n const { motionValue } = this.options;\n if (motionValue && motionValue.updatedAt !== time.now()) {\n this.tick(time.now());\n }\n this.isStopped = true;\n if (this.state === \"idle\")\n return;\n this.teardown();\n this.options.onStop?.();\n };\n this.options = options;\n this.initAnimation();\n this.play();\n if (options.autoplay === false)\n this.pause();\n }\n initAnimation() {\n const { options } = this;\n replaceTransitionType(options);\n const { type = keyframes, repeat = 0, repeatDelay = 0, repeatType, velocity = 0, } = options;\n let { keyframes: keyframes$1 } = options;\n const generatorFactory = type || keyframes;\n if (process.env.NODE_ENV !== \"production\" &&\n generatorFactory !== keyframes) {\n invariant(keyframes$1.length <= 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${keyframes$1}`, \"spring-two-frames\");\n }\n if (generatorFactory !== keyframes &&\n typeof keyframes$1[0] !== \"number\") {\n this.mixKeyframes = pipe(percentToProgress, mix(keyframes$1[0], keyframes$1[1]));\n keyframes$1 = [0, 100];\n }\n const generator = generatorFactory({ ...options, keyframes: keyframes$1 });\n /**\n * If we have a mirror repeat type we need to create a second generator that outputs the\n * mirrored (not reversed) animation and later ping pong between the two generators.\n */\n if (repeatType === \"mirror\") {\n this.mirroredGenerator = generatorFactory({\n ...options,\n keyframes: [...keyframes$1].reverse(),\n velocity: -velocity,\n });\n }\n /**\n * If duration is undefined and we have repeat options,\n * we need to calculate a duration from the generator.\n *\n * We set it to the generator itself to cache the duration.\n * Any timeline resolver will need to have already precalculated\n * the duration by this step.\n */\n if (generator.calculatedDuration === null) {\n generator.calculatedDuration = calcGeneratorDuration(generator);\n }\n const { calculatedDuration } = generator;\n this.calculatedDuration = calculatedDuration;\n this.resolvedDuration = calculatedDuration + repeatDelay;\n this.totalDuration = this.resolvedDuration * (repeat + 1) - repeatDelay;\n this.generator = generator;\n }\n updateTime(timestamp) {\n const animationTime = Math.round(timestamp - this.startTime) * this.playbackSpeed;\n // Update currentTime\n if (this.holdTime !== null) {\n this.currentTime = this.holdTime;\n }\n else {\n // Rounding the time because floating point arithmetic is not always accurate, e.g. 3000.367 - 1000.367 =\n // 2000.0000000000002. This is a problem when we are comparing the currentTime with the duration, for\n // example.\n this.currentTime = animationTime;\n }\n }\n tick(timestamp, sample = false) {\n const { generator, totalDuration, mixKeyframes, mirroredGenerator, resolvedDuration, calculatedDuration, } = this;\n if (this.startTime === null)\n return generator.next(0);\n const { delay = 0, keyframes, repeat, repeatType, repeatDelay, type, onUpdate, finalKeyframe, } = this.options;\n /**\n * requestAnimationFrame timestamps can come through as lower than\n * the startTime as set by performance.now(). Here we prevent this,\n * though in the future it could be possible to make setting startTime\n * a pending operation that gets resolved here.\n */\n if (this.speed > 0) {\n this.startTime = Math.min(this.startTime, timestamp);\n }\n else if (this.speed < 0) {\n this.startTime = Math.min(timestamp - totalDuration / this.speed, this.startTime);\n }\n if (sample) {\n this.currentTime = timestamp;\n }\n else {\n this.updateTime(timestamp);\n }\n // Rebase on delay\n const timeWithoutDelay = this.currentTime - delay * (this.playbackSpeed >= 0 ? 1 : -1);\n const isInDelayPhase = this.playbackSpeed >= 0\n ? timeWithoutDelay < 0\n : timeWithoutDelay > totalDuration;\n this.currentTime = Math.max(timeWithoutDelay, 0);\n // If this animation has finished, set the current time to the total duration.\n if (this.state === \"finished\" && this.holdTime === null) {\n this.currentTime = totalDuration;\n }\n let elapsed = this.currentTime;\n let frameGenerator = generator;\n if (repeat) {\n /**\n * Get the current progress (0-1) of the animation. If t is >\n * than duration we'll get values like 2.5 (midway through the\n * third iteration)\n */\n const progress = Math.min(this.currentTime, totalDuration) / resolvedDuration;\n /**\n * Get the current iteration (0 indexed). For instance the floor of\n * 2.5 is 2.\n */\n let currentIteration = Math.floor(progress);\n /**\n * Get the current progress of the iteration by taking the remainder\n * so 2.5 is 0.5 through iteration 2\n */\n let iterationProgress = progress % 1.0;\n /**\n * If iteration progress is 1 we count that as the end\n * of the previous iteration.\n */\n if (!iterationProgress && progress >= 1) {\n iterationProgress = 1;\n }\n iterationProgress === 1 && currentIteration--;\n currentIteration = Math.min(currentIteration, repeat + 1);\n /**\n * Reverse progress if we're not running in \"normal\" direction\n */\n const isOddIteration = Boolean(currentIteration % 2);\n if (isOddIteration) {\n if (repeatType === \"reverse\") {\n iterationProgress = 1 - iterationProgress;\n if (repeatDelay) {\n iterationProgress -= repeatDelay / resolvedDuration;\n }\n }\n else if (repeatType === \"mirror\") {\n frameGenerator = mirroredGenerator;\n }\n }\n elapsed = clamp(0, 1, iterationProgress) * resolvedDuration;\n }\n /**\n * If we're in negative time, set state as the initial keyframe.\n * This prevents delay: x, duration: 0 animations from finishing\n * instantly.\n */\n let state;\n if (isInDelayPhase) {\n this.delayState.value = keyframes[0];\n state = this.delayState;\n }\n else {\n state = frameGenerator.next(elapsed);\n }\n if (mixKeyframes && !isInDelayPhase) {\n state.value = mixKeyframes(state.value);\n }\n let { done } = state;\n if (!isInDelayPhase && calculatedDuration !== null) {\n done =\n this.playbackSpeed >= 0\n ? this.currentTime >= totalDuration\n : this.currentTime <= 0;\n }\n const isAnimationFinished = this.holdTime === null &&\n (this.state === \"finished\" || (this.state === \"running\" && done));\n // TODO: The exception for inertia could be cleaner here\n if (isAnimationFinished && type !== inertia) {\n state.value = getFinalKeyframe(keyframes, this.options, finalKeyframe, this.speed);\n }\n if (onUpdate) {\n onUpdate(state.value);\n }\n if (isAnimationFinished) {\n this.finish();\n }\n return state;\n }\n /**\n * Allows the returned animation to be awaited or promise-chained. Currently\n * resolves when the animation finishes at all but in a future update could/should\n * reject if its cancels.\n */\n then(resolve, reject) {\n return this.finished.then(resolve, reject);\n }\n get duration() {\n return millisecondsToSeconds(this.calculatedDuration);\n }\n get iterationDuration() {\n const { delay = 0 } = this.options || {};\n return this.duration + millisecondsToSeconds(delay);\n }\n get time() {\n return millisecondsToSeconds(this.currentTime);\n }\n set time(newTime) {\n newTime = secondsToMilliseconds(newTime);\n this.currentTime = newTime;\n if (this.startTime === null ||\n this.holdTime !== null ||\n this.playbackSpeed === 0) {\n this.holdTime = newTime;\n }\n else if (this.driver) {\n this.startTime = this.driver.now() - newTime / this.playbackSpeed;\n }\n if (this.driver) {\n this.driver.start(false);\n }\n else {\n this.startTime = 0;\n this.state = \"paused\";\n this.holdTime = newTime;\n this.tick(newTime);\n }\n }\n /**\n * Returns the generator's velocity at the current time in units/second.\n * Uses the analytical derivative when available (springs), avoiding\n * the MotionValue's frame-dependent velocity estimation.\n */\n getGeneratorVelocity() {\n const t = this.currentTime;\n if (t <= 0)\n return this.options.velocity || 0;\n if (this.generator.velocity) {\n return this.generator.velocity(t);\n }\n // Fallback: finite difference\n const current = this.generator.next(t).value;\n return getGeneratorVelocity((s) => this.generator.next(s).value, t, current);\n }\n get speed() {\n return this.playbackSpeed;\n }\n set speed(newSpeed) {\n const hasChanged = this.playbackSpeed !== newSpeed;\n if (hasChanged && this.driver) {\n this.updateTime(time.now());\n }\n this.playbackSpeed = newSpeed;\n if (hasChanged && this.driver) {\n this.time = millisecondsToSeconds(this.currentTime);\n }\n }\n play() {\n if (this.isStopped)\n return;\n const { driver = frameloopDriver, startTime } = this.options;\n if (!this.driver) {\n this.driver = driver((timestamp) => this.tick(timestamp));\n }\n this.options.onPlay?.();\n const now = this.driver.now();\n if (this.state === \"finished\") {\n this.updateFinished();\n this.startTime = now;\n }\n else if (this.holdTime !== null) {\n this.startTime = now - this.holdTime;\n }\n else if (!this.startTime) {\n this.startTime = startTime ?? now;\n }\n if (this.state === \"finished\" && this.speed < 0) {\n this.startTime += this.calculatedDuration;\n }\n this.holdTime = null;\n /**\n * Set playState to running only after we've used it in\n * the previous logic.\n */\n this.state = \"running\";\n this.driver.start();\n }\n pause() {\n this.state = \"paused\";\n this.updateTime(time.now());\n this.holdTime = this.currentTime;\n }\n complete() {\n if (this.state !== \"running\") {\n this.play();\n }\n this.state = \"finished\";\n this.holdTime = null;\n }\n finish() {\n this.notifyFinished();\n this.teardown();\n this.state = \"finished\";\n this.options.onComplete?.();\n }\n cancel() {\n this.holdTime = null;\n this.startTime = 0;\n this.tick(0);\n this.teardown();\n this.options.onCancel?.();\n }\n teardown() {\n this.state = \"idle\";\n this.stopDriver();\n this.startTime = this.holdTime = null;\n }\n stopDriver() {\n if (!this.driver)\n return;\n this.driver.stop();\n this.driver = undefined;\n }\n sample(sampleTime) {\n this.startTime = 0;\n return this.tick(sampleTime, true);\n }\n attachTimeline(timeline) {\n if (this.options.allowFlatten) {\n this.options.type = \"keyframes\";\n this.options.ease = \"linear\";\n this.initAnimation();\n }\n this.driver?.stop();\n return timeline.observe(this);\n }\n}\n// Legacy function support\nfunction animateValue(options) {\n return new JSAnimation(options);\n}\n\nexport { JSAnimation, animateValue };\n//# sourceMappingURL=JSAnimation.mjs.map\n","const radToDeg = (rad) => (rad * 180) / Math.PI;\nconst rotate = (v) => {\n const angle = radToDeg(Math.atan2(v[1], v[0]));\n return rebaseAngle(angle);\n};\nconst matrix2dParsers = {\n x: 4,\n y: 5,\n translateX: 4,\n translateY: 5,\n scaleX: 0,\n scaleY: 3,\n scale: (v) => (Math.abs(v[0]) + Math.abs(v[3])) / 2,\n rotate,\n rotateZ: rotate,\n skewX: (v) => radToDeg(Math.atan(v[1])),\n skewY: (v) => radToDeg(Math.atan(v[2])),\n skew: (v) => (Math.abs(v[1]) + Math.abs(v[2])) / 2,\n};\nconst rebaseAngle = (angle) => {\n angle = angle % 360;\n if (angle < 0)\n angle += 360;\n return angle;\n};\nconst rotateZ = rotate;\nconst scaleX = (v) => Math.sqrt(v[0] * v[0] + v[1] * v[1]);\nconst scaleY = (v) => Math.sqrt(v[4] * v[4] + v[5] * v[5]);\nconst matrix3dParsers = {\n x: 12,\n y: 13,\n z: 14,\n translateX: 12,\n translateY: 13,\n translateZ: 14,\n scaleX,\n scaleY,\n scale: (v) => (scaleX(v) + scaleY(v)) / 2,\n rotateX: (v) => rebaseAngle(radToDeg(Math.atan2(v[6], v[5]))),\n rotateY: (v) => rebaseAngle(radToDeg(Math.atan2(-v[2], v[0]))),\n rotateZ,\n rotate: rotateZ,\n skewX: (v) => radToDeg(Math.atan(v[4])),\n skewY: (v) => radToDeg(Math.atan(v[1])),\n skew: (v) => (Math.abs(v[1]) + Math.abs(v[4])) / 2,\n};\nfunction defaultTransformValue(name) {\n return name.includes(\"scale\") ? 1 : 0;\n}\nfunction parseValueFromTransform(transform, name) {\n if (!transform || transform === \"none\") {\n return defaultTransformValue(name);\n }\n const matrix3dMatch = transform.match(/^matrix3d\\(([-\\d.e\\s,]+)\\)$/u);\n let parsers;\n let match;\n if (matrix3dMatch) {\n parsers = matrix3dParsers;\n match = matrix3dMatch;\n }\n else {\n const matrix2dMatch = transform.match(/^matrix\\(([-\\d.e\\s,]+)\\)$/u);\n parsers = matrix2dParsers;\n match = matrix2dMatch;\n }\n if (!match) {\n return defaultTransformValue(name);\n }\n const valueParser = parsers[name];\n const values = match[1].split(\",\").map(convertTransformToNumber);\n return typeof valueParser === \"function\"\n ? valueParser(values)\n : values[valueParser];\n}\nconst readTransformValue = (instance, name) => {\n const { transform = \"none\" } = getComputedStyle(instance);\n return parseValueFromTransform(transform, name);\n};\nfunction convertTransformToNumber(value) {\n return parseFloat(value.trim());\n}\n\nexport { defaultTransformValue, parseValueFromTransform, readTransformValue };\n//# sourceMappingURL=parse-transform.mjs.map\n","/**\n * Generate a list of every possible transform key.\n */\nconst transformPropOrder = [\n \"transformPerspective\",\n \"x\",\n \"y\",\n \"z\",\n \"translateX\",\n \"translateY\",\n \"translateZ\",\n \"scale\",\n \"scaleX\",\n \"scaleY\",\n \"rotate\",\n \"rotateX\",\n \"rotateY\",\n \"rotateZ\",\n \"skew\",\n \"skewX\",\n \"skewY\",\n];\n/**\n * A quick lookup for transform props.\n *\n * `pathRotation` is a transform for routing purposes (skipped from raw\n * style application, wired to the transform composite, flags transform\n * dirty) but is intentionally NOT in `transformPropOrder` — it is\n * composed onto `rotate` at the build sites, not serialized in its own\n * slot, and must stay out of the order-array consumers (parse-transform,\n * unit-conversion, keys-position).\n */\nconst transformProps = /*@__PURE__*/ (() => new Set([...transformPropOrder, \"pathRotation\"]))();\n\nexport { transformPropOrder, transformProps };\n//# sourceMappingURL=keys-transform.mjs.map\n","import { parseValueFromTransform } from '../../../render/dom/parse-transform.mjs';\nimport { transformPropOrder } from '../../../render/utils/keys-transform.mjs';\nimport { number } from '../../../value/types/numbers/index.mjs';\nimport { px } from '../../../value/types/numbers/units.mjs';\n\nconst isNumOrPxType = (v) => v === number || v === px;\nconst transformKeys = new Set([\"x\", \"y\", \"z\"]);\nconst nonTranslationalTransformKeys = transformPropOrder.filter((key) => !transformKeys.has(key));\nfunction removeNonTranslationalTransform(visualElement) {\n const removedTransforms = [];\n nonTranslationalTransformKeys.forEach((key) => {\n const value = visualElement.getValue(key);\n if (value !== undefined) {\n removedTransforms.push([key, value.get()]);\n value.set(key.startsWith(\"scale\") ? 1 : 0);\n }\n });\n return removedTransforms;\n}\nconst positionalValues = {\n // Dimensions\n width: ({ x }, { paddingLeft = \"0\", paddingRight = \"0\", boxSizing }) => {\n const width = x.max - x.min;\n return boxSizing === \"border-box\"\n ? width\n : width - parseFloat(paddingLeft) - parseFloat(paddingRight);\n },\n height: ({ y }, { paddingTop = \"0\", paddingBottom = \"0\", boxSizing }) => {\n const height = y.max - y.min;\n return boxSizing === \"border-box\"\n ? height\n : height - parseFloat(paddingTop) - parseFloat(paddingBottom);\n },\n top: (_bbox, { top }) => parseFloat(top),\n left: (_bbox, { left }) => parseFloat(left),\n bottom: ({ y }, { top }) => parseFloat(top) + (y.max - y.min),\n right: ({ x }, { left }) => parseFloat(left) + (x.max - x.min),\n // Transform\n x: (_bbox, { transform }) => parseValueFromTransform(transform, \"x\"),\n y: (_bbox, { transform }) => parseValueFromTransform(transform, \"y\"),\n};\n// Alias translate longform names\npositionalValues.translateX = positionalValues.x;\npositionalValues.translateY = positionalValues.y;\n\nexport { isNumOrPxType, positionalValues, removeNonTranslationalTransform };\n//# sourceMappingURL=unit-conversion.mjs.map\n","import { fillWildcards } from './utils/fill-wildcards.mjs';\nimport { removeNonTranslationalTransform } from './utils/unit-conversion.mjs';\nimport { frame } from '../../frameloop/frame.mjs';\n\nconst toResolve = new Set();\nlet isScheduled = false;\nlet anyNeedsMeasurement = false;\nlet isForced = false;\nfunction measureAllKeyframes() {\n if (anyNeedsMeasurement) {\n const resolversToMeasure = Array.from(toResolve).filter((resolver) => resolver.needsMeasurement);\n const elementsToMeasure = new Set(resolversToMeasure.map((resolver) => resolver.element));\n const transformsToRestore = new Map();\n /**\n * Write pass\n * If we're measuring elements we want to remove bounding box-changing transforms.\n */\n elementsToMeasure.forEach((element) => {\n const removedTransforms = removeNonTranslationalTransform(element);\n if (!removedTransforms.length)\n return;\n transformsToRestore.set(element, removedTransforms);\n element.render();\n });\n // Read\n resolversToMeasure.forEach((resolver) => resolver.measureInitialState());\n // Write\n elementsToMeasure.forEach((element) => {\n element.render();\n const restore = transformsToRestore.get(element);\n if (restore) {\n restore.forEach(([key, value]) => {\n element.getValue(key)?.set(value);\n });\n }\n });\n // Read\n resolversToMeasure.forEach((resolver) => resolver.measureEndState());\n // Write\n resolversToMeasure.forEach((resolver) => {\n if (resolver.suspendedScrollY !== undefined) {\n window.scrollTo(0, resolver.suspendedScrollY);\n }\n });\n }\n anyNeedsMeasurement = false;\n isScheduled = false;\n toResolve.forEach((resolver) => resolver.complete(isForced));\n toResolve.clear();\n}\nfunction readAllKeyframes() {\n toResolve.forEach((resolver) => {\n resolver.readKeyframes();\n if (resolver.needsMeasurement) {\n anyNeedsMeasurement = true;\n }\n });\n}\nfunction flushKeyframeResolvers() {\n isForced = true;\n readAllKeyframes();\n measureAllKeyframes();\n isForced = false;\n}\nclass KeyframeResolver {\n constructor(unresolvedKeyframes, onComplete, name, motionValue, element, isAsync = false) {\n this.state = \"pending\";\n /**\n * Track whether this resolver is async. If it is, it'll be added to the\n * resolver queue and flushed in the next frame. Resolvers that aren't going\n * to trigger read/write thrashing don't need to be async.\n */\n this.isAsync = false;\n /**\n * Track whether this resolver needs to perform a measurement\n * to resolve its keyframes.\n */\n this.needsMeasurement = false;\n this.unresolvedKeyframes = [...unresolvedKeyframes];\n this.onComplete = onComplete;\n this.name = name;\n this.motionValue = motionValue;\n this.element = element;\n this.isAsync = isAsync;\n }\n scheduleResolve() {\n this.state = \"scheduled\";\n if (this.isAsync) {\n toResolve.add(this);\n if (!isScheduled) {\n isScheduled = true;\n frame.read(readAllKeyframes);\n frame.resolveKeyframes(measureAllKeyframes);\n }\n }\n else {\n this.readKeyframes();\n this.complete();\n }\n }\n readKeyframes() {\n const { unresolvedKeyframes, name, element, motionValue } = this;\n // If initial keyframe is null we need to read it from the DOM\n if (unresolvedKeyframes[0] === null) {\n const currentValue = motionValue?.get();\n // TODO: This doesn't work if the final keyframe is a wildcard\n const finalKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1];\n if (currentValue !== undefined) {\n unresolvedKeyframes[0] = currentValue;\n }\n else if (element && name) {\n const valueAsRead = element.readValue(name, finalKeyframe);\n if (valueAsRead !== undefined && valueAsRead !== null) {\n unresolvedKeyframes[0] = valueAsRead;\n }\n }\n if (unresolvedKeyframes[0] === undefined) {\n unresolvedKeyframes[0] = finalKeyframe;\n }\n if (motionValue && currentValue === undefined) {\n motionValue.set(unresolvedKeyframes[0]);\n }\n }\n fillWildcards(unresolvedKeyframes);\n }\n setFinalKeyframe() { }\n measureInitialState() { }\n renderEndStyles() { }\n measureEndState() { }\n complete(isForcedComplete = false) {\n this.state = \"complete\";\n this.onComplete(this.unresolvedKeyframes, this.finalKeyframe, isForcedComplete);\n toResolve.delete(this);\n }\n cancel() {\n if (this.state === \"scheduled\") {\n toResolve.delete(this);\n this.state = \"pending\";\n }\n }\n resume() {\n if (this.state === \"pending\")\n this.scheduleResolve();\n }\n}\n\nexport { KeyframeResolver, flushKeyframeResolvers };\n//# sourceMappingURL=KeyframesResolver.mjs.map\n","function fillWildcards(keyframes) {\n for (let i = 1; i < keyframes.length; i++) {\n keyframes[i] ?? (keyframes[i] = keyframes[i - 1]);\n }\n}\n\nexport { fillWildcards };\n//# sourceMappingURL=fill-wildcards.mjs.map\n","import { isCSSVar } from './is-css-var.mjs';\n\nfunction setStyle(element, name, value) {\n isCSSVar(name)\n ? element.style.setProperty(name, value)\n : (element.style[name] = value);\n}\n\nexport { setStyle };\n//# sourceMappingURL=style-set.mjs.map\n","const isCSSVar = (name) => name.startsWith(\"--\");\n\nexport { isCSSVar };\n//# sourceMappingURL=is-css-var.mjs.map\n","/**\n * Add the ability for test suites to manually set support flags\n * to better test more environments.\n */\nconst supportsFlags = {};\n\nexport { supportsFlags };\n//# sourceMappingURL=flags.mjs.map\n","import { memo } from 'motion-utils';\nimport { supportsFlags } from './flags.mjs';\n\nfunction memoSupports(callback, supportsFlag) {\n const memoized = memo(callback);\n return () => supportsFlags[supportsFlag] ?? memoized();\n}\n\nexport { memoSupports };\n//# sourceMappingURL=memo.mjs.map\n","import { memoSupports } from './memo.mjs';\n\nconst supportsScrollTimeline = /* @__PURE__ */ memoSupports(() => window.ScrollTimeline !== undefined, \"scrollTimeline\");\nconst supportsViewTimeline = /* @__PURE__ */ memoSupports(() => window.ViewTimeline !== undefined, \"viewTimeline\");\n\nexport { supportsScrollTimeline, supportsViewTimeline };\n//# sourceMappingURL=scroll-timeline.mjs.map\n","import { memoSupports } from './memo.mjs';\n\nconst supportsLinearEasing = /*@__PURE__*/ memoSupports(() => {\n try {\n document\n .createElement(\"div\")\n .animate({ opacity: 0 }, { easing: \"linear(0, 1)\" });\n }\n catch (e) {\n return false;\n }\n return true;\n}, \"linearEasing\");\n\nexport { supportsLinearEasing };\n//# sourceMappingURL=linear-easing.mjs.map\n","const cubicBezierAsString = ([a, b, c, d]) => `cubic-bezier(${a}, ${b}, ${c}, ${d})`;\n\nexport { cubicBezierAsString };\n//# sourceMappingURL=cubic-bezier.mjs.map\n","import { cubicBezierAsString } from './cubic-bezier.mjs';\n\nconst supportedWaapiEasing = {\n linear: \"linear\",\n ease: \"ease\",\n easeIn: \"ease-in\",\n easeOut: \"ease-out\",\n easeInOut: \"ease-in-out\",\n circIn: /*@__PURE__*/ cubicBezierAsString([0, 0.65, 0.55, 1]),\n circOut: /*@__PURE__*/ cubicBezierAsString([0.55, 0, 1, 0.45]),\n backIn: /*@__PURE__*/ cubicBezierAsString([0.31, 0.01, 0.66, -0.59]),\n backOut: /*@__PURE__*/ cubicBezierAsString([0.33, 1.53, 0.69, 0.99]),\n};\n\nexport { supportedWaapiEasing };\n//# sourceMappingURL=supported.mjs.map\n","import { isBezierDefinition } from 'motion-utils';\nimport { supportsLinearEasing } from '../../../utils/supports/linear-easing.mjs';\nimport { generateLinearEasing } from '../utils/linear.mjs';\nimport { cubicBezierAsString } from './cubic-bezier.mjs';\nimport { supportedWaapiEasing } from './supported.mjs';\n\nfunction mapEasingToNativeEasing(easing, duration) {\n if (!easing) {\n return undefined;\n }\n else if (typeof easing === \"function\") {\n return supportsLinearEasing()\n ? generateLinearEasing(easing, duration)\n : \"ease-out\";\n }\n else if (isBezierDefinition(easing)) {\n return cubicBezierAsString(easing);\n }\n else if (Array.isArray(easing)) {\n return easing.map((segmentEasing) => mapEasingToNativeEasing(segmentEasing, duration) ||\n supportedWaapiEasing.easeOut);\n }\n else {\n return supportedWaapiEasing[easing];\n }\n}\n\nexport { mapEasingToNativeEasing };\n//# sourceMappingURL=map-easing.mjs.map\n","import { mapEasingToNativeEasing } from './easing/map-easing.mjs';\n\nfunction startWaapiAnimation(element, valueName, keyframes, { delay = 0, duration = 300, repeat = 0, repeatType = \"loop\", ease = \"easeOut\", times, } = {}, pseudoElement = undefined) {\n const keyframeOptions = {\n [valueName]: keyframes,\n };\n if (times)\n keyframeOptions.offset = times;\n const easing = mapEasingToNativeEasing(ease, duration);\n /**\n * If this is an easing array, apply to keyframes, not animation as a whole\n */\n if (Array.isArray(easing))\n keyframeOptions.easing = easing;\n const options = {\n delay,\n duration,\n easing: !Array.isArray(easing) ? easing : \"linear\",\n fill: \"both\",\n iterations: repeat + 1,\n direction: repeatType === \"reverse\" ? \"alternate\" : \"normal\",\n };\n if (pseudoElement)\n options.pseudoElement = pseudoElement;\n return element.animate(keyframeOptions, options);\n}\n\nexport { startWaapiAnimation };\n//# sourceMappingURL=start-waapi-animation.mjs.map\n","function isGenerator(type) {\n return typeof type === \"function\" && \"applyToOptions\" in type;\n}\n\nexport { isGenerator };\n//# sourceMappingURL=is-generator.mjs.map\n","import { invariant, millisecondsToSeconds, secondsToMilliseconds, noop } from 'motion-utils';\nimport { setStyle } from '../render/dom/style-set.mjs';\nimport { supportsScrollTimeline } from '../utils/supports/scroll-timeline.mjs';\nimport { getFinalKeyframe } from './keyframes/get-final.mjs';\nimport { WithPromise } from './utils/WithPromise.mjs';\nimport { startWaapiAnimation } from './waapi/start-waapi-animation.mjs';\nimport { applyGeneratorOptions } from './waapi/utils/apply-generator.mjs';\n\n/**\n * NativeAnimation implements AnimationPlaybackControls for the browser's Web Animations API.\n */\nclass NativeAnimation extends WithPromise {\n constructor(options) {\n super();\n this.finishedTime = null;\n this.isStopped = false;\n /**\n * Tracks a manually-set start time that takes precedence over WAAPI's\n * dynamic startTime. This is cleared when play() or time setter is called,\n * allowing WAAPI to take over timing.\n */\n this.manualStartTime = null;\n if (!options)\n return;\n const { element, name, keyframes, pseudoElement, allowFlatten = false, finalKeyframe, onComplete, } = options;\n this.isPseudoElement = Boolean(pseudoElement);\n this.allowFlatten = allowFlatten;\n this.options = options;\n invariant(typeof options.type !== \"string\", `Mini animate() doesn't support \"type\" as a string.`, \"mini-spring\");\n const transition = applyGeneratorOptions(options);\n this.animation = startWaapiAnimation(element, name, keyframes, transition, pseudoElement);\n if (transition.autoplay === false) {\n this.animation.pause();\n }\n this.animation.onfinish = () => {\n this.finishedTime = this.time;\n if (!pseudoElement) {\n const keyframe = getFinalKeyframe(keyframes, this.options, finalKeyframe, this.speed);\n if (this.updateMotionValue) {\n this.updateMotionValue(keyframe);\n }\n /**\n * If we can, we want to commit the final style as set by the user,\n * rather than the computed keyframe value supplied by the animation.\n * We always do this, even when a motion value is present, to prevent\n * a visual flash in Firefox where the WAAPI animation's fill is removed\n * during cancel() before the scheduled render can apply the correct value.\n */\n setStyle(element, name, keyframe);\n this.animation.cancel();\n }\n onComplete?.();\n this.notifyFinished();\n };\n }\n play() {\n if (this.isStopped)\n return;\n this.manualStartTime = null;\n this.animation.play();\n if (this.state === \"finished\") {\n this.updateFinished();\n }\n }\n pause() {\n this.animation.pause();\n }\n complete() {\n this.animation.finish?.();\n }\n cancel() {\n try {\n this.animation.cancel();\n }\n catch (e) { }\n }\n stop() {\n if (this.isStopped)\n return;\n this.isStopped = true;\n const { state } = this;\n if (state === \"idle\" || state === \"finished\") {\n return;\n }\n if (this.updateMotionValue) {\n this.updateMotionValue();\n }\n else {\n this.commitStyles();\n }\n if (!this.isPseudoElement)\n this.cancel();\n }\n /**\n * WAAPI doesn't natively have any interruption capabilities.\n *\n * In this method, we commit styles back to the DOM before cancelling\n * the animation.\n *\n * This is designed to be overridden by NativeAnimationExtended, which\n * will create a renderless JS animation and sample it twice to calculate\n * its current value, \"previous\" value, and therefore allow\n * Motion to also correctly calculate velocity for any subsequent animation\n * while deferring the commit until the next animation frame.\n */\n commitStyles() {\n const element = this.options?.element;\n if (!this.isPseudoElement && element?.isConnected) {\n this.animation.commitStyles?.();\n }\n }\n get duration() {\n const duration = this.animation.effect?.getComputedTiming?.().duration || 0;\n return millisecondsToSeconds(Number(duration));\n }\n get iterationDuration() {\n const { delay = 0 } = this.options || {};\n return this.duration + millisecondsToSeconds(delay);\n }\n get time() {\n return millisecondsToSeconds(Number(this.animation.currentTime) || 0);\n }\n set time(newTime) {\n const wasFinished = this.finishedTime !== null;\n this.manualStartTime = null;\n this.finishedTime = null;\n this.animation.currentTime = secondsToMilliseconds(newTime);\n if (wasFinished) {\n this.animation.pause();\n }\n }\n /**\n * The playback speed of the animation.\n * 1 = normal speed, 2 = double speed, 0.5 = half speed.\n */\n get speed() {\n return this.animation.playbackRate;\n }\n set speed(newSpeed) {\n // Allow backwards playback after finishing\n if (newSpeed < 0)\n this.finishedTime = null;\n this.animation.playbackRate = newSpeed;\n }\n get state() {\n return this.finishedTime !== null\n ? \"finished\"\n : this.animation.playState;\n }\n get startTime() {\n return this.manualStartTime ?? Number(this.animation.startTime);\n }\n set startTime(newStartTime) {\n this.manualStartTime = this.animation.startTime = newStartTime;\n }\n /**\n * Attaches a timeline to the animation, for instance the `ScrollTimeline`.\n */\n attachTimeline({ timeline, rangeStart, rangeEnd, observe, }) {\n if (this.allowFlatten) {\n this.animation.effect?.updateTiming({ easing: \"linear\" });\n }\n this.animation.onfinish = null;\n if (timeline && supportsScrollTimeline()) {\n this.animation.timeline = timeline;\n if (rangeStart)\n this.animation.rangeStart = rangeStart;\n if (rangeEnd)\n this.animation.rangeEnd = rangeEnd;\n return noop;\n }\n else {\n return observe(this);\n }\n }\n}\n\nexport { NativeAnimation };\n//# sourceMappingURL=NativeAnimation.mjs.map\n","import { supportsLinearEasing } from '../../../utils/supports/linear-easing.mjs';\nimport { isGenerator } from '../../generators/utils/is-generator.mjs';\n\nfunction applyGeneratorOptions({ type, ...options }) {\n if (isGenerator(type) && supportsLinearEasing()) {\n return type.applyToOptions(options);\n }\n else {\n options.duration ?? (options.duration = 300);\n options.ease ?? (options.ease = \"easeOut\");\n }\n return options;\n}\n\nexport { applyGeneratorOptions };\n//# sourceMappingURL=apply-generator.mjs.map\n","import { circInOut, backInOut, anticipate } from 'motion-utils';\n\nconst unsupportedEasingFunctions = {\n anticipate,\n backInOut,\n circInOut,\n};\nfunction isUnsupportedEase(key) {\n return key in unsupportedEasingFunctions;\n}\nfunction replaceStringEasing(transition) {\n if (typeof transition.ease === \"string\" &&\n isUnsupportedEase(transition.ease)) {\n transition.ease = unsupportedEasingFunctions[transition.ease];\n }\n}\n\nexport { replaceStringEasing };\n//# sourceMappingURL=unsupported-easing.mjs.map\n","import { clamp } from 'motion-utils';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { setStyle } from '../render/dom/style-set.mjs';\nimport { JSAnimation } from './JSAnimation.mjs';\nimport { NativeAnimation } from './NativeAnimation.mjs';\nimport { replaceTransitionType } from './utils/replace-transition-type.mjs';\nimport { replaceStringEasing } from './waapi/utils/unsupported-easing.mjs';\n\n/**\n * 10ms is chosen here as it strikes a balance between smooth\n * results (more than one keyframe per frame at 60fps) and\n * keyframe quantity.\n */\nconst sampleDelta = 10; //ms\nclass NativeAnimationExtended extends NativeAnimation {\n constructor(options) {\n /**\n * The base NativeAnimation function only supports a subset\n * of Motion easings, and WAAPI also only supports some\n * easing functions via string/cubic-bezier definitions.\n *\n * This function replaces those unsupported easing functions\n * with a JS easing function. This will later get compiled\n * to a linear() easing function.\n */\n replaceStringEasing(options);\n /**\n * Ensure we replace the transition type with a generator function\n * before passing to WAAPI.\n *\n * TODO: Does this have a better home? It could be shared with\n * JSAnimation.\n */\n replaceTransitionType(options);\n super(options);\n /**\n * Only set startTime when the animation should autoplay.\n * Setting startTime on a paused WAAPI animation unpauses it\n * (per the WAAPI spec), which breaks autoplay: false.\n */\n if (options.startTime !== undefined && options.autoplay !== false) {\n this.startTime = options.startTime;\n }\n this.options = options;\n }\n /**\n * WAAPI doesn't natively have any interruption capabilities.\n *\n * Rather than read committed styles back out of the DOM, we can\n * create a renderless JS animation and sample it twice to calculate\n * its current value, \"previous\" value, and therefore allow\n * Motion to calculate velocity for any subsequent animation.\n */\n updateMotionValue(value) {\n const { motionValue, onUpdate, onComplete, element, ...options } = this.options;\n if (!motionValue)\n return;\n if (value !== undefined) {\n motionValue.set(value);\n return;\n }\n const sampleAnimation = new JSAnimation({\n ...options,\n autoplay: false,\n });\n /**\n * Use wall-clock elapsed time for sampling.\n * Under CPU load, WAAPI's currentTime may not reflect actual\n * elapsed time, causing incorrect sampling and visual jumps.\n */\n const sampleTime = Math.max(sampleDelta, time.now() - this.startTime);\n const delta = clamp(0, sampleDelta, sampleTime - sampleDelta);\n const current = sampleAnimation.sample(sampleTime).value;\n /**\n * Write the estimated value to inline style so it persists\n * after cancel(), covering the async gap before the next\n * animation starts.\n */\n const { name } = this.options;\n if (element && name)\n setStyle(element, name, current);\n motionValue.setWithVelocity(sampleAnimation.sample(Math.max(0, sampleTime - delta)).value, current, delta);\n sampleAnimation.stop();\n }\n}\n\nexport { NativeAnimationExtended };\n//# sourceMappingURL=NativeAnimationExtended.mjs.map\n","import { complex } from '../../value/types/complex/index.mjs';\n\n/**\n * Check if a value is animatable. Examples:\n *\n * ✅: 100, \"100px\", \"#fff\"\n * ❌: \"block\", \"url(2.jpg)\"\n * @param value\n *\n * @internal\n */\nconst isAnimatable = (value, name) => {\n // If the list of keys that might be non-animatable grows, replace with Set\n if (name === \"zIndex\")\n return false;\n // If it's a number or a keyframes array, we can animate it. We might at some point\n // need to do a deep isAnimatable check of keyframes, or let Popmotion handle this,\n // but for now lets leave it like this for performance reasons\n if (typeof value === \"number\" || Array.isArray(value))\n return true;\n if (typeof value === \"string\" && // It's animatable if we have a string\n (complex.test(value) || value === \"0\") && // And it contains numbers and/or colors\n !value.startsWith(\"url(\") // Unless it starts with \"url(\"\n ) {\n return true;\n }\n return false;\n};\n\nexport { isAnimatable };\n//# sourceMappingURL=is-animatable.mjs.map\n","function makeAnimationInstant(options) {\n options.duration = 0;\n options.type = \"keyframes\";\n}\n\nexport { makeAnimationInstant };\n//# sourceMappingURL=make-animation-instant.mjs.map\n","/**\n * A list of values that can be hardware-accelerated.\n */\nconst acceleratedValues = new Set([\n \"opacity\",\n \"clipPath\",\n \"filter\",\n \"transform\",\n \"backgroundColor\",\n]);\n\nexport { acceleratedValues };\n//# sourceMappingURL=accelerated-values.mjs.map\n","const browserColorFunctions = /^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\\(/;\nfunction hasBrowserOnlyColors(keyframes) {\n for (let i = 0; i < keyframes.length; i++) {\n if (typeof keyframes[i] === \"string\" &&\n browserColorFunctions.test(keyframes[i])) {\n return true;\n }\n }\n return false;\n}\n\nexport { hasBrowserOnlyColors };\n//# sourceMappingURL=is-browser-color.mjs.map\n","import { memo } from 'motion-utils';\nimport { acceleratedValues } from '../utils/accelerated-values.mjs';\nimport { hasBrowserOnlyColors } from '../utils/is-browser-color.mjs';\n\nconst colorProperties = new Set([\n \"color\",\n \"backgroundColor\",\n \"outlineColor\",\n \"fill\",\n \"stroke\",\n \"borderColor\",\n \"borderTopColor\",\n \"borderRightColor\",\n \"borderBottomColor\",\n \"borderLeftColor\",\n]);\nconst supportsWaapi = /*@__PURE__*/ memo(() => Object.hasOwnProperty.call(Element.prototype, \"animate\"));\nfunction supportsBrowserAnimation(options) {\n const { motionValue, name, repeatDelay, repeatType, damping, type, keyframes, } = options;\n const subject = motionValue?.owner?.current;\n /**\n * We use instanceof checks instead of isHTMLElement()/isSVGElement()\n * because we explicitly **don't** want elements in different timing\n * contexts (i.e. popups) to be accelerated, as it's not possible to sync\n * these animations properly with those driven from the main window\n * frameloop.\n */\n if (!(subject instanceof HTMLElement) &&\n !(subject instanceof SVGElement)) {\n return false;\n }\n const { onUpdate, transformTemplate } = motionValue.owner.getProps();\n return (supportsWaapi() &&\n name &&\n /**\n * Force WAAPI for color properties with browser-only color formats\n * (oklch, oklab, lab, lch, etc.) that the JS animation path can't parse.\n */\n (acceleratedValues.has(name) ||\n (colorProperties.has(name) &&\n hasBrowserOnlyColors(keyframes))) &&\n (name !== \"transform\" || !transformTemplate) &&\n /**\n * If we're outputting values to onUpdate then we can't use WAAPI as there's\n * no way to read the value from WAAPI every frame.\n */\n !onUpdate &&\n !repeatDelay &&\n repeatType !== \"mirror\" &&\n damping !== 0 &&\n type !== \"inertia\");\n}\n\nexport { supportsBrowserAnimation };\n//# sourceMappingURL=waapi.mjs.map\n","import { MotionGlobalConfig, noop } from 'motion-utils';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { JSAnimation } from './JSAnimation.mjs';\nimport { getFinalKeyframe } from './keyframes/get-final.mjs';\nimport { KeyframeResolver, flushKeyframeResolvers } from './keyframes/KeyframesResolver.mjs';\nimport { NativeAnimationExtended } from './NativeAnimationExtended.mjs';\nimport { canAnimate } from './utils/can-animate.mjs';\nimport { makeAnimationInstant } from './utils/make-animation-instant.mjs';\nimport { WithPromise } from './utils/WithPromise.mjs';\nimport { supportsBrowserAnimation } from './waapi/supports/waapi.mjs';\n\n/**\n * Maximum time allowed between an animation being created and it being\n * resolved for us to use the latter as the start time.\n *\n * This is to ensure that while we prefer to \"start\" an animation as soon\n * as it's triggered, we also want to avoid a visual jump if there's a big delay\n * between these two moments.\n */\nconst MAX_RESOLVE_DELAY = 40;\nclass AsyncMotionValueAnimation extends WithPromise {\n constructor({ autoplay = true, delay = 0, type = \"keyframes\", repeat = 0, repeatDelay = 0, repeatType = \"loop\", keyframes, name, motionValue, element, ...options }) {\n super();\n /**\n * Bound to support return animation.stop pattern\n */\n this.stop = () => {\n if (this._animation) {\n this._animation.stop();\n this.stopTimeline?.();\n }\n this.keyframeResolver?.cancel();\n };\n this.createdAt = time.now();\n const optionsWithDefaults = {\n autoplay,\n delay,\n type,\n repeat,\n repeatDelay,\n repeatType,\n name,\n motionValue,\n element,\n ...options,\n };\n const KeyframeResolver$1 = element?.KeyframeResolver || KeyframeResolver;\n this.keyframeResolver = new KeyframeResolver$1(keyframes, (resolvedKeyframes, finalKeyframe, forced) => this.onKeyframesResolved(resolvedKeyframes, finalKeyframe, optionsWithDefaults, !forced), name, motionValue, element);\n this.keyframeResolver?.scheduleResolve();\n }\n onKeyframesResolved(keyframes, finalKeyframe, options, sync) {\n this.keyframeResolver = undefined;\n const { name, type, velocity, delay, isHandoff, onUpdate } = options;\n this.resolvedAt = time.now();\n /**\n * If we can't animate this value with the resolved keyframes\n * then we should complete it immediately.\n */\n let canAnimateValue = true;\n if (!canAnimate(keyframes, name, type, velocity)) {\n canAnimateValue = false;\n if (MotionGlobalConfig.instantAnimations || !delay) {\n onUpdate?.(getFinalKeyframe(keyframes, options, finalKeyframe));\n }\n keyframes[0] = keyframes[keyframes.length - 1];\n makeAnimationInstant(options);\n options.repeat = 0;\n }\n /**\n * Resolve startTime for the animation.\n *\n * This method uses the createdAt and resolvedAt to calculate the\n * animation startTime. *Ideally*, we would use the createdAt time as t=0\n * as the following frame would then be the first frame of the animation in\n * progress, which would feel snappier.\n *\n * However, if there's a delay (main thread work) between the creation of\n * the animation and the first committed frame, we prefer to use resolvedAt\n * to avoid a sudden jump into the animation.\n */\n const startTime = sync\n ? !this.resolvedAt\n ? this.createdAt\n : this.resolvedAt - this.createdAt > MAX_RESOLVE_DELAY\n ? this.resolvedAt\n : this.createdAt\n : undefined;\n const resolvedOptions = {\n startTime,\n finalKeyframe,\n ...options,\n keyframes,\n };\n /**\n * Animate via WAAPI if possible. If this is a handoff animation, the optimised animation will be running via\n * WAAPI. Therefore, this animation must be JS to ensure it runs \"under\" the\n * optimised animation.\n *\n * Also skip WAAPI when keyframes aren't animatable, as the resolved\n * values may not be valid CSS and would trigger browser warnings.\n */\n const useWaapi = canAnimateValue &&\n !isHandoff &&\n supportsBrowserAnimation(resolvedOptions);\n const element = resolvedOptions.motionValue?.owner?.current;\n let animation;\n if (useWaapi) {\n try {\n animation = new NativeAnimationExtended({\n ...resolvedOptions,\n element,\n });\n }\n catch {\n animation = new JSAnimation(resolvedOptions);\n }\n }\n else {\n animation = new JSAnimation(resolvedOptions);\n }\n animation.finished.then(() => {\n this.notifyFinished();\n }).catch(noop);\n if (this.pendingTimeline) {\n this.stopTimeline = animation.attachTimeline(this.pendingTimeline);\n this.pendingTimeline = undefined;\n }\n this._animation = animation;\n }\n get finished() {\n if (!this._animation) {\n return this._finished;\n }\n else {\n return this.animation.finished;\n }\n }\n then(onResolve, _onReject) {\n return this.finished.finally(onResolve).then(() => { });\n }\n get animation() {\n if (!this._animation) {\n this.keyframeResolver?.resume();\n flushKeyframeResolvers();\n }\n return this._animation;\n }\n get duration() {\n return this.animation.duration;\n }\n get iterationDuration() {\n return this.animation.iterationDuration;\n }\n get time() {\n return this.animation.time;\n }\n set time(newTime) {\n this.animation.time = newTime;\n }\n get speed() {\n return this.animation.speed;\n }\n get state() {\n return this.animation.state;\n }\n set speed(newSpeed) {\n this.animation.speed = newSpeed;\n }\n get startTime() {\n return this.animation.startTime;\n }\n attachTimeline(timeline) {\n if (this._animation) {\n this.stopTimeline = this.animation.attachTimeline(timeline);\n }\n else {\n this.pendingTimeline = timeline;\n }\n return () => this.stop();\n }\n play() {\n this.animation.play();\n }\n pause() {\n this.animation.pause();\n }\n complete() {\n this.animation.complete();\n }\n cancel() {\n if (this._animation) {\n this.animation.cancel();\n }\n this.keyframeResolver?.cancel();\n }\n}\n\nexport { AsyncMotionValueAnimation };\n//# sourceMappingURL=AsyncMotionValueAnimation.mjs.map\n","import { warning } from 'motion-utils';\nimport { isGenerator } from '../generators/utils/is-generator.mjs';\nimport { isAnimatable } from './is-animatable.mjs';\n\nfunction hasKeyframesChanged(keyframes) {\n const current = keyframes[0];\n if (keyframes.length === 1)\n return true;\n for (let i = 0; i < keyframes.length; i++) {\n if (keyframes[i] !== current)\n return true;\n }\n}\nfunction canAnimate(keyframes, name, type, velocity) {\n /**\n * Check if we're able to animate between the start and end keyframes,\n * and throw a warning if we're attempting to animate between one that's\n * animatable and another that isn't.\n */\n const originKeyframe = keyframes[0];\n if (originKeyframe === null) {\n return false;\n }\n /**\n * These aren't traditionally animatable but we do support them.\n * In future we could look into making this more generic or replacing\n * this function with mix() === mixImmediate\n */\n if (name === \"display\" || name === \"visibility\")\n return true;\n const targetKeyframe = keyframes[keyframes.length - 1];\n const isOriginAnimatable = isAnimatable(originKeyframe, name);\n const isTargetAnimatable = isAnimatable(targetKeyframe, name);\n warning(isOriginAnimatable === isTargetAnimatable, `You are trying to animate ${name} from \"${originKeyframe}\" to \"${targetKeyframe}\". \"${isOriginAnimatable ? targetKeyframe : originKeyframe}\" is not an animatable value.`, \"value-not-animatable\");\n // Always skip if any of these are true\n if (!isOriginAnimatable || !isTargetAnimatable) {\n return false;\n }\n return (hasKeyframesChanged(keyframes) ||\n ((type === \"spring\" || isGenerator(type)) && velocity));\n}\n\nexport { canAnimate };\n//# sourceMappingURL=can-animate.mjs.map\n","class GroupAnimation {\n constructor(animations) {\n // Bound to accomadate common `return animation.stop` pattern\n this.stop = () => this.runAll(\"stop\");\n this.animations = animations.filter(Boolean);\n }\n get finished() {\n return Promise.all(this.animations.map((animation) => animation.finished));\n }\n /**\n * TODO: Filter out cancelled or stopped animations before returning\n */\n getAll(propName) {\n return this.animations[0][propName];\n }\n setAll(propName, newValue) {\n for (let i = 0; i < this.animations.length; i++) {\n this.animations[i][propName] = newValue;\n }\n }\n attachTimeline(timeline) {\n const subscriptions = this.animations.map((animation) => animation.attachTimeline(timeline));\n return () => {\n subscriptions.forEach((cancel, i) => {\n cancel && cancel();\n this.animations[i].stop();\n });\n };\n }\n get time() {\n return this.getAll(\"time\");\n }\n set time(time) {\n this.setAll(\"time\", time);\n }\n get speed() {\n return this.getAll(\"speed\");\n }\n set speed(speed) {\n this.setAll(\"speed\", speed);\n }\n get state() {\n return this.getAll(\"state\");\n }\n get startTime() {\n return this.getAll(\"startTime\");\n }\n get duration() {\n return getMax(this.animations, \"duration\");\n }\n get iterationDuration() {\n return getMax(this.animations, \"iterationDuration\");\n }\n runAll(methodName) {\n this.animations.forEach((controls) => controls[methodName]());\n }\n play() {\n this.runAll(\"play\");\n }\n pause() {\n this.runAll(\"pause\");\n }\n cancel() {\n this.runAll(\"cancel\");\n }\n complete() {\n this.runAll(\"complete\");\n }\n}\nfunction getMax(animations, propName) {\n let max = 0;\n for (let i = 0; i < animations.length; i++) {\n const value = animations[i][propName];\n if (value !== null && value > max) {\n max = value;\n }\n }\n return max;\n}\n\nexport { GroupAnimation };\n//# sourceMappingURL=GroupAnimation.mjs.map\n","import { GroupAnimation } from './GroupAnimation.mjs';\n\nclass GroupAnimationWithThen extends GroupAnimation {\n then(onResolve, _onReject) {\n return this.finished.finally(onResolve).then(() => { });\n }\n}\n\nexport { GroupAnimationWithThen };\n//# sourceMappingURL=GroupAnimationWithThen.mjs.map\n","import { warnOnce, SubscriptionManager, velocityPerSecond } from 'motion-utils';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { frame } from '../frameloop/frame.mjs';\n\n/**\n * Maximum time between the value of two frames, beyond which we\n * assume the velocity has since been 0.\n */\nconst MAX_VELOCITY_DELTA = 30;\nconst isFloat = (value) => {\n return !isNaN(parseFloat(value));\n};\nconst collectMotionValues = {\n current: undefined,\n};\n/**\n * `MotionValue` is used to track the state and velocity of motion values.\n *\n * @public\n */\nclass MotionValue {\n /**\n * @param init - The initiating value\n * @param config - Optional configuration options\n *\n * - `transformer`: A function to transform incoming values with.\n */\n constructor(init, options = {}) {\n /**\n * Tracks whether this value can output a velocity. Currently this is only true\n * if the value is numerical, but we might be able to widen the scope here and support\n * other value types.\n *\n * @internal\n */\n this.canTrackVelocity = null;\n /**\n * An object containing a SubscriptionManager for each active event.\n */\n this.events = {};\n this.updateAndNotify = (v) => {\n const currentTime = time.now();\n /**\n * If we're updating the value during another frame or eventloop\n * than the previous frame, then the we set the previous frame value\n * to current.\n */\n if (this.updatedAt !== currentTime) {\n this.setPrevFrameValue();\n }\n this.prev = this.current;\n this.setCurrent(v);\n // Update update subscribers\n if (this.current !== this.prev) {\n this.events.change?.notify(this.current);\n if (this.dependents) {\n for (const dependent of this.dependents) {\n dependent.dirty();\n }\n }\n }\n };\n this.hasAnimated = false;\n this.setCurrent(init);\n this.owner = options.owner;\n }\n setCurrent(current) {\n this.current = current;\n this.updatedAt = time.now();\n if (this.canTrackVelocity === null && current !== undefined) {\n this.canTrackVelocity = isFloat(this.current);\n }\n }\n setPrevFrameValue(prevFrameValue = this.current) {\n this.prevFrameValue = prevFrameValue;\n this.prevUpdatedAt = this.updatedAt;\n }\n /**\n * Adds a function that will be notified when the `MotionValue` is updated.\n *\n * It returns a function that, when called, will cancel the subscription.\n *\n * When calling `onChange` inside a React component, it should be wrapped with the\n * `useEffect` hook. As it returns an unsubscribe function, this should be returned\n * from the `useEffect` function to ensure you don't add duplicate subscribers..\n *\n * ```jsx\n * export const MyComponent = () => {\n * const x = useMotionValue(0)\n * const y = useMotionValue(0)\n * const opacity = useMotionValue(1)\n *\n * useEffect(() => {\n * function updateOpacity() {\n * const maxXY = Math.max(x.get(), y.get())\n * const newOpacity = transform(maxXY, [0, 100], [1, 0])\n * opacity.set(newOpacity)\n * }\n *\n * const unsubscribeX = x.on(\"change\", updateOpacity)\n * const unsubscribeY = y.on(\"change\", updateOpacity)\n *\n * return () => {\n * unsubscribeX()\n * unsubscribeY()\n * }\n * }, [])\n *\n * return \n * }\n * ```\n *\n * @param subscriber - A function that receives the latest value.\n * @returns A function that, when called, will cancel this subscription.\n *\n * @deprecated\n */\n onChange(subscription) {\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(false, `value.onChange(callback) is deprecated. Switch to value.on(\"change\", callback).`);\n }\n return this.on(\"change\", subscription);\n }\n on(eventName, callback) {\n if (!this.events[eventName]) {\n this.events[eventName] = new SubscriptionManager();\n }\n const unsubscribe = this.events[eventName].add(callback);\n if (eventName === \"change\") {\n return () => {\n unsubscribe();\n /**\n * If we have no more change listeners by the start\n * of the next frame, stop active animations.\n */\n frame.read(() => {\n if (!this.events.change.getSize()) {\n this.stop();\n }\n });\n };\n }\n return unsubscribe;\n }\n clearListeners() {\n for (const eventManagers in this.events) {\n this.events[eventManagers].clear();\n }\n }\n /**\n * Attaches a passive effect to the `MotionValue`.\n */\n attach(passiveEffect, stopPassiveEffect) {\n this.passiveEffect = passiveEffect;\n this.stopPassiveEffect = stopPassiveEffect;\n }\n /**\n * Sets the state of the `MotionValue`.\n *\n * @remarks\n *\n * ```jsx\n * const x = useMotionValue(0)\n * x.set(10)\n * ```\n *\n * @param latest - Latest value to set.\n * @param render - Whether to notify render subscribers. Defaults to `true`\n *\n * @public\n */\n set(v) {\n if (!this.passiveEffect) {\n this.updateAndNotify(v);\n }\n else {\n this.passiveEffect(v, this.updateAndNotify);\n }\n }\n setWithVelocity(prev, current, delta) {\n this.set(current);\n this.prev = undefined;\n this.prevFrameValue = prev;\n this.prevUpdatedAt = this.updatedAt - delta;\n }\n /**\n * Set the state of the `MotionValue`, stopping any active animations,\n * effects, and resets velocity to `0`.\n */\n jump(v, endAnimation = true) {\n this.updateAndNotify(v);\n this.prev = v;\n this.prevUpdatedAt = this.prevFrameValue = undefined;\n endAnimation && this.stop();\n if (this.stopPassiveEffect)\n this.stopPassiveEffect();\n }\n dirty() {\n this.events.change?.notify(this.current);\n }\n addDependent(dependent) {\n if (!this.dependents) {\n this.dependents = new Set();\n }\n this.dependents.add(dependent);\n }\n removeDependent(dependent) {\n if (this.dependents) {\n this.dependents.delete(dependent);\n }\n }\n /**\n * Returns the latest state of `MotionValue`\n *\n * @returns - The latest state of `MotionValue`\n *\n * @public\n */\n get() {\n if (collectMotionValues.current) {\n collectMotionValues.current.push(this);\n }\n return this.current;\n }\n /**\n * @public\n */\n getPrevious() {\n return this.prev;\n }\n /**\n * Returns the latest velocity of `MotionValue`\n *\n * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical.\n *\n * @public\n */\n getVelocity() {\n const currentTime = time.now();\n if (!this.canTrackVelocity ||\n this.prevFrameValue === undefined ||\n currentTime - this.updatedAt > MAX_VELOCITY_DELTA) {\n return 0;\n }\n const delta = Math.min(this.updatedAt - this.prevUpdatedAt, MAX_VELOCITY_DELTA);\n // Casts because of parseFloat's poor typing\n return velocityPerSecond(parseFloat(this.current) -\n parseFloat(this.prevFrameValue), delta);\n }\n /**\n * Registers a new animation to control this `MotionValue`. Only one\n * animation can drive a `MotionValue` at one time.\n *\n * ```jsx\n * value.start()\n * ```\n *\n * @param animation - A function that starts the provided animation\n */\n start(startAnimation) {\n this.stop();\n return new Promise((resolve) => {\n this.hasAnimated = true;\n this.animation = startAnimation(resolve);\n if (this.events.animationStart) {\n this.events.animationStart.notify();\n }\n }).then(() => {\n if (this.events.animationComplete) {\n this.events.animationComplete.notify();\n }\n this.clearAnimation();\n });\n }\n /**\n * Stop the currently active animation.\n *\n * @public\n */\n stop() {\n if (this.animation) {\n this.animation.stop();\n if (this.events.animationCancel) {\n this.events.animationCancel.notify();\n }\n }\n this.clearAnimation();\n }\n /**\n * Returns `true` if this value is currently animating.\n *\n * @public\n */\n isAnimating() {\n return !!this.animation;\n }\n clearAnimation() {\n delete this.animation;\n }\n /**\n * Destroy and clean up subscribers to this `MotionValue`.\n *\n * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically\n * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually\n * created a `MotionValue` via the `motionValue` function.\n *\n * @public\n */\n destroy() {\n this.dependents?.clear();\n this.events.destroy?.notify();\n this.clearListeners();\n this.stop();\n if (this.stopPassiveEffect) {\n this.stopPassiveEffect();\n }\n }\n}\nfunction motionValue(init, options) {\n return new MotionValue(init, options);\n}\n\nexport { MotionValue, collectMotionValues, motionValue };\n//# sourceMappingURL=index.mjs.map\n","/**\n * If `transition` has `inherit: true`, shallow-merge it with\n * `parentTransition` (child keys win) and strip the `inherit` key.\n * Otherwise return `transition` unchanged.\n */\nfunction resolveTransition(transition, parentTransition) {\n if (transition?.inherit && parentTransition) {\n const { inherit: _, ...rest } = transition;\n return { ...parentTransition, ...rest };\n }\n return transition;\n}\n\nexport { resolveTransition };\n//# sourceMappingURL=resolve-transition.mjs.map\n","import { resolveTransition } from './resolve-transition.mjs';\n\nfunction getValueTransition(transition, key) {\n const valueTransition = transition?.[key] ??\n transition?.[\"default\"] ??\n transition;\n if (valueTransition !== transition) {\n return resolveTransition(valueTransition, transition);\n }\n return valueTransition;\n}\n\nexport { getValueTransition };\n//# sourceMappingURL=get-value-transition.mjs.map\n","import { transformProps } from '../../render/utils/keys-transform.mjs';\n\nconst underDampedSpring = {\n type: \"spring\",\n stiffness: 500,\n damping: 25,\n restSpeed: 10,\n};\nconst criticallyDampedSpring = (target) => ({\n type: \"spring\",\n stiffness: 550,\n damping: target === 0 ? 2 * Math.sqrt(550) : 30,\n restSpeed: 10,\n});\nconst keyframesTransition = {\n type: \"keyframes\",\n duration: 0.8,\n};\n/**\n * Default easing curve is a slightly shallower version of\n * the default browser easing curve.\n */\nconst ease = {\n type: \"keyframes\",\n ease: [0.25, 0.1, 0.35, 1],\n duration: 0.3,\n};\nconst getDefaultTransition = (valueKey, { keyframes }) => {\n if (keyframes.length > 2) {\n return keyframesTransition;\n }\n else if (transformProps.has(valueKey)) {\n return valueKey.startsWith(\"scale\")\n ? criticallyDampedSpring(keyframes[1])\n : underDampedSpring;\n }\n return ease;\n};\n\nexport { getDefaultTransition };\n//# sourceMappingURL=default-transitions.mjs.map\n","const orchestrationKeys = new Set([\n \"when\",\n \"delay\",\n \"delayChildren\",\n \"staggerChildren\",\n \"staggerDirection\",\n \"repeat\",\n \"repeatType\",\n \"repeatDelay\",\n \"from\",\n \"elapsed\",\n]);\n/**\n * Decide whether a transition is defined on a given Transition.\n * This filters out orchestration options and returns true\n * if any options are left.\n */\nfunction isTransitionDefined(transition) {\n for (const key in transition) {\n if (!orchestrationKeys.has(key))\n return true;\n }\n return false;\n}\n\nexport { isTransitionDefined };\n//# sourceMappingURL=is-transition-defined.mjs.map\n","import { secondsToMilliseconds, MotionGlobalConfig } from 'motion-utils';\nimport { AsyncMotionValueAnimation } from '../AsyncMotionValueAnimation.mjs';\nimport { JSAnimation } from '../JSAnimation.mjs';\nimport { getValueTransition } from '../utils/get-value-transition.mjs';\nimport { makeAnimationInstant } from '../utils/make-animation-instant.mjs';\nimport { getDefaultTransition } from '../utils/default-transitions.mjs';\nimport { getFinalKeyframe } from '../keyframes/get-final.mjs';\nimport { isTransitionDefined } from '../utils/is-transition-defined.mjs';\nimport { frame } from '../../frameloop/frame.mjs';\n\nconst animateMotionValue = (name, value, target, transition = {}, element, isHandoff) => (onComplete) => {\n const valueTransition = getValueTransition(transition, name) || {};\n /**\n * Most transition values are currently completely overwritten by value-specific\n * transitions. In the future it'd be nicer to blend these transitions. But for now\n * delay actually does inherit from the root transition if not value-specific.\n */\n const delay = valueTransition.delay || transition.delay || 0;\n /**\n * Elapsed isn't a public transition option but can be passed through from\n * optimized appear effects in milliseconds.\n */\n let { elapsed = 0 } = transition;\n elapsed = elapsed - secondsToMilliseconds(delay);\n const options = {\n keyframes: Array.isArray(target) ? target : [null, target],\n ease: \"easeOut\",\n velocity: value.getVelocity(),\n ...valueTransition,\n delay: -elapsed,\n onUpdate: (v) => {\n value.set(v);\n valueTransition.onUpdate && valueTransition.onUpdate(v);\n },\n onComplete: () => {\n onComplete();\n valueTransition.onComplete && valueTransition.onComplete();\n },\n name,\n motionValue: value,\n element: isHandoff ? undefined : element,\n };\n /**\n * If there's no transition defined for this value, we can generate\n * unique transition settings for this value.\n */\n if (!isTransitionDefined(valueTransition)) {\n Object.assign(options, getDefaultTransition(name, options));\n }\n /**\n * Both WAAPI and our internal animation functions use durations\n * as defined by milliseconds, while our external API defines them\n * as seconds.\n */\n options.duration && (options.duration = secondsToMilliseconds(options.duration));\n options.repeatDelay && (options.repeatDelay = secondsToMilliseconds(options.repeatDelay));\n /**\n * Support deprecated way to set initial value. Prefer keyframe syntax.\n */\n if (options.from !== undefined) {\n options.keyframes[0] = options.from;\n }\n let shouldSkip = false;\n if (options.type === false ||\n (options.duration === 0 && !options.repeatDelay)) {\n makeAnimationInstant(options);\n if (options.delay === 0) {\n shouldSkip = true;\n }\n }\n if (MotionGlobalConfig.instantAnimations ||\n MotionGlobalConfig.skipAnimations ||\n element?.shouldSkipAnimations ||\n valueTransition.skipAnimations) {\n shouldSkip = true;\n makeAnimationInstant(options);\n options.delay = 0;\n }\n /**\n * If the transition type or easing has been explicitly set by the user\n * then we don't want to allow flattening the animation.\n */\n options.allowFlatten = !valueTransition.type && !valueTransition.ease;\n /**\n * If we can or must skip creating the animation, and apply only\n * the final keyframe, do so. We also check once keyframes are resolved but\n * this early check prevents the need to create an animation at all.\n */\n if (shouldSkip && !isHandoff && value.get() !== undefined) {\n const finalKeyframe = getFinalKeyframe(options.keyframes, valueTransition);\n if (finalKeyframe !== undefined) {\n frame.update(() => {\n options.onUpdate(finalKeyframe);\n options.onComplete();\n });\n return;\n }\n }\n return valueTransition.isSync\n ? new JSAnimation(options)\n : new AsyncMotionValueAnimation(options);\n};\n\nexport { animateMotionValue };\n//# sourceMappingURL=motion-value.mjs.map\n","import { invariant, isNumericalString } from 'motion-utils';\nimport { isCSSVariableToken } from './is-css-variable.mjs';\n\n/**\n * Parse Framer's special CSS variable format into a CSS token and a fallback.\n *\n * ```\n * `var(--foo, #fff)` => [`--foo`, '#fff']\n * ```\n *\n * @param current\n */\nconst splitCSSVariableRegex = \n// eslint-disable-next-line redos-detector/no-unsafe-regex -- false positive, as it can match a lot of words\n/^var\\(--(?:([\\w-]+)|([\\w-]+), ?([a-zA-Z\\d ()%#.,-]+))\\)/u;\nfunction parseCSSVariable(current) {\n const match = splitCSSVariableRegex.exec(current);\n if (!match)\n return [,];\n const [, token1, token2, fallback] = match;\n return [`--${token1 ?? token2}`, fallback];\n}\nconst maxDepth = 4;\nfunction getVariableValue(current, element, depth = 1) {\n invariant(depth <= maxDepth, `Max CSS variable fallback depth detected in property \"${current}\". This may indicate a circular fallback dependency.`, \"max-css-var-depth\");\n const [token, fallback] = parseCSSVariable(current);\n // No CSS variable detected\n if (!token)\n return;\n // Attempt to read this CSS variable off the element\n const resolved = window.getComputedStyle(element).getPropertyValue(token);\n if (resolved) {\n const trimmed = resolved.trim();\n return isNumericalString(trimmed) ? parseFloat(trimmed) : trimmed;\n }\n return isCSSVariableToken(fallback)\n ? getVariableValue(fallback, element, depth + 1)\n : fallback;\n}\n\nexport { getVariableValue, parseCSSVariable };\n//# sourceMappingURL=css-variables-conversion.mjs.map\n","function getValueState(visualElement) {\n const state = [{}, {}];\n visualElement?.values.forEach((value, key) => {\n state[0][key] = value.get();\n state[1][key] = value.getVelocity();\n });\n return state;\n}\nfunction resolveVariantFromProps(props, definition, custom, visualElement) {\n /**\n * If the variant definition is a function, resolve.\n */\n if (typeof definition === \"function\") {\n const [current, velocity] = getValueState(visualElement);\n definition = definition(custom !== undefined ? custom : props.custom, current, velocity);\n }\n /**\n * If the variant definition is a variant label, or\n * the function returned a variant label, resolve.\n */\n if (typeof definition === \"string\") {\n definition = props.variants && props.variants[definition];\n }\n /**\n * At this point we've resolved both functions and variant labels,\n * but the resolved variant label might itself have been a function.\n * If so, resolve. This can only have returned a valid target object.\n */\n if (typeof definition === \"function\") {\n const [current, velocity] = getValueState(visualElement);\n definition = definition(custom !== undefined ? custom : props.custom, current, velocity);\n }\n return definition;\n}\n\nexport { resolveVariantFromProps };\n//# sourceMappingURL=resolve-variants.mjs.map\n","import { transformPropOrder } from './keys-transform.mjs';\n\nconst positionalKeys = new Set([\n \"width\",\n \"height\",\n \"top\",\n \"left\",\n \"right\",\n \"bottom\",\n ...transformPropOrder,\n]);\n\nexport { positionalKeys };\n//# sourceMappingURL=keys-position.mjs.map\n","import { motionValue } from '../../value/index.mjs';\nimport { resolveVariant } from './resolve-dynamic-variants.mjs';\nimport { isKeyframesTarget } from './is-keyframes-target.mjs';\n\n/**\n * Set VisualElement's MotionValue, creating a new MotionValue for it if\n * it doesn't exist.\n */\nfunction setMotionValue(visualElement, key, value) {\n if (visualElement.hasValue(key)) {\n visualElement.getValue(key).set(value);\n }\n else {\n visualElement.addValue(key, motionValue(value));\n }\n}\nfunction resolveFinalValueInKeyframes(v) {\n // TODO maybe throw if v.length - 1 is placeholder token?\n return isKeyframesTarget(v) ? v[v.length - 1] || 0 : v;\n}\nfunction setTarget(visualElement, definition) {\n const resolved = resolveVariant(visualElement, definition);\n let { transitionEnd = {}, transition = {}, ...target } = resolved || {};\n target = { ...target, ...transitionEnd };\n for (const key in target) {\n const value = resolveFinalValueInKeyframes(target[key]);\n setMotionValue(visualElement, key, value);\n }\n}\n\nexport { setTarget };\n//# sourceMappingURL=setters.mjs.map\n","const isKeyframesTarget = (v) => {\n return Array.isArray(v);\n};\n\nexport { isKeyframesTarget };\n//# sourceMappingURL=is-keyframes-target.mjs.map\n","import { resolveVariantFromProps } from './resolve-variants.mjs';\n\nfunction resolveVariant(visualElement, definition, custom) {\n const props = visualElement.getProps();\n return resolveVariantFromProps(props, definition, custom !== undefined ? custom : props.custom, visualElement);\n}\n\nexport { resolveVariant };\n//# sourceMappingURL=resolve-dynamic-variants.mjs.map\n","const isMotionValue = (value) => Boolean(value && value.getVelocity);\n\nexport { isMotionValue };\n//# sourceMappingURL=is-motion-value.mjs.map\n","import { MotionGlobalConfig } from 'motion-utils';\nimport { isWillChangeMotionValue } from './is.mjs';\n\nfunction addValueToWillChange(visualElement, key) {\n const willChange = visualElement.getValue(\"willChange\");\n /**\n * It could be that a user has set willChange to a regular MotionValue,\n * in which case we can't add the value to it.\n */\n if (isWillChangeMotionValue(willChange)) {\n return willChange.add(key);\n }\n else if (!willChange && MotionGlobalConfig.WillChange) {\n const newWillChange = new MotionGlobalConfig.WillChange(\"auto\");\n visualElement.addValue(\"willChange\", newWillChange);\n newWillChange.add(key);\n }\n}\n\nexport { addValueToWillChange };\n//# sourceMappingURL=add-will-change.mjs.map\n","import { isMotionValue } from '../utils/is-motion-value.mjs';\n\nfunction isWillChangeMotionValue(value) {\n return Boolean(isMotionValue(value) && value.add);\n}\n\nexport { isWillChangeMotionValue };\n//# sourceMappingURL=is.mjs.map\n","function camelToDash(str) {\n return str.replace(/([A-Z])/g, (match) => `-${match.toLowerCase()}`);\n}\n\nexport { camelToDash };\n//# sourceMappingURL=camel-to-dash.mjs.map\n","import { camelToDash } from '../../render/dom/utils/camel-to-dash.mjs';\n\nconst optimizedAppearDataId = \"framerAppearId\";\nconst optimizedAppearDataAttribute = \"data-\" + camelToDash(optimizedAppearDataId);\n\nexport { optimizedAppearDataAttribute, optimizedAppearDataId };\n//# sourceMappingURL=data-id.mjs.map\n","import { optimizedAppearDataAttribute } from './data-id.mjs';\n\nfunction getOptimisedAppearId(visualElement) {\n return visualElement.props[optimizedAppearDataAttribute];\n}\n\nexport { getOptimisedAppearId };\n//# sourceMappingURL=get-appear-id.mjs.map\n","import { getValueTransition } from '../utils/get-value-transition.mjs';\nimport { resolveTransition } from '../utils/resolve-transition.mjs';\nimport { positionalKeys } from '../../render/utils/keys-position.mjs';\nimport { setTarget } from '../../render/utils/setters.mjs';\nimport { addValueToWillChange } from '../../value/will-change/add-will-change.mjs';\nimport { getOptimisedAppearId } from '../optimized-appear/get-appear-id.mjs';\nimport { animateMotionValue } from './motion-value.mjs';\nimport { frame } from '../../frameloop/frame.mjs';\n\n/**\n * Decide whether we should block this animation. Previously, we achieved this\n * just by checking whether the key was listed in protectedKeys, but this\n * posed problems if an animation was triggered by afterChildren and protectedKeys\n * had been set to true in the meantime.\n */\nfunction shouldBlockAnimation({ protectedKeys, needsAnimating }, key) {\n const shouldBlock = protectedKeys.hasOwnProperty(key) && needsAnimating[key] !== true;\n needsAnimating[key] = false;\n return shouldBlock;\n}\nfunction animateTarget(visualElement, targetAndTransition, { delay = 0, transitionOverride, type } = {}) {\n let { transition, transitionEnd, ...target } = targetAndTransition;\n const defaultTransition = visualElement.getDefaultTransition();\n transition = transition\n ? resolveTransition(transition, defaultTransition)\n : defaultTransition;\n const reduceMotion = transition?.reduceMotion;\n const skipAnimations = transition?.skipAnimations;\n if (transitionOverride)\n transition = transitionOverride;\n const animations = [];\n const animationTypeState = type &&\n visualElement.animationState &&\n visualElement.animationState.getState()[type];\n const path = transition?.path;\n if (path) {\n // path mutates `target` to claim x/y; loop below skips them.\n path.animateVisualElement(visualElement, target, transition, delay, animations);\n }\n for (const key in target) {\n const value = visualElement.getValue(key, visualElement.latestValues[key] ?? null);\n const valueTarget = target[key];\n if (valueTarget === undefined ||\n (animationTypeState &&\n shouldBlockAnimation(animationTypeState, key))) {\n continue;\n }\n const valueTransition = {\n delay,\n ...getValueTransition(transition || {}, key),\n };\n if (skipAnimations)\n valueTransition.skipAnimations = true;\n /**\n * If the value is already at the defined target, skip the animation.\n * We still re-assert the value via frame.update to take precedence\n * over any stale transitionEnd callbacks from previous animations.\n */\n const currentValue = value.get();\n if (currentValue !== undefined &&\n !value.isAnimating() &&\n !Array.isArray(valueTarget) &&\n valueTarget === currentValue &&\n !valueTransition.velocity) {\n frame.update(() => value.set(valueTarget));\n continue;\n }\n /**\n * If this is the first time a value is being animated, check\n * to see if we're handling off from an existing animation.\n */\n let isHandoff = false;\n if (window.MotionHandoffAnimation) {\n const appearId = getOptimisedAppearId(visualElement);\n if (appearId) {\n const startTime = window.MotionHandoffAnimation(appearId, key, frame);\n if (startTime !== null) {\n valueTransition.startTime = startTime;\n isHandoff = true;\n }\n }\n }\n addValueToWillChange(visualElement, key);\n const shouldReduceMotion = reduceMotion ?? visualElement.shouldReduceMotion;\n value.start(animateMotionValue(key, value, valueTarget, shouldReduceMotion && positionalKeys.has(key)\n ? { type: false }\n : valueTransition, visualElement, isHandoff));\n const animation = value.animation;\n if (animation) {\n animations.push(animation);\n }\n }\n if (transitionEnd) {\n const applyTransitionEnd = () => frame.update(() => {\n transitionEnd && setTarget(visualElement, transitionEnd);\n });\n if (animations.length) {\n Promise.all(animations).then(applyTransitionEnd);\n }\n else {\n applyTransitionEnd();\n }\n }\n return animations;\n}\n\nexport { animateTarget };\n//# sourceMappingURL=visual-element-target.mjs.map\n","/**\n * ValueType for \"auto\"\n */\nconst auto = {\n test: (v) => v === \"auto\",\n parse: (v) => v,\n};\n\nexport { auto };\n//# sourceMappingURL=auto.mjs.map\n","/**\n * Tests a provided value against a ValueType\n */\nconst testValueType = (v) => (type) => type.test(v);\n\nexport { testValueType };\n//# sourceMappingURL=test.mjs.map\n","import { auto } from './auto.mjs';\nimport { number } from './numbers/index.mjs';\nimport { px, percent, degrees, vw, vh } from './numbers/units.mjs';\nimport { testValueType } from './test.mjs';\n\n/**\n * A list of value types commonly used for dimensions\n */\nconst dimensionValueTypes = [number, px, percent, degrees, vw, vh, auto];\n/**\n * Tests a dimensional value against the list of dimension ValueTypes\n */\nconst findDimensionValueType = (v) => dimensionValueTypes.find(testValueType(v));\n\nexport { dimensionValueTypes, findDimensionValueType };\n//# sourceMappingURL=dimensions.mjs.map\n","import { isZeroValueString } from 'motion-utils';\n\nfunction isNone(value) {\n if (typeof value === \"number\") {\n return value === 0;\n }\n else if (value !== null) {\n return value === \"none\" || value === \"0\" || isZeroValueString(value);\n }\n else {\n return true;\n }\n}\n\nexport { isNone };\n//# sourceMappingURL=is-none.mjs.map\n","import { complex } from './index.mjs';\nimport { floatRegex } from '../utils/float-regex.mjs';\n\n/**\n * Properties that should default to 1 or 100%\n */\nconst maxDefaults = new Set([\"brightness\", \"contrast\", \"saturate\", \"opacity\"]);\nfunction applyDefaultFilter(v) {\n const [name, value] = v.slice(0, -1).split(\"(\");\n if (name === \"drop-shadow\")\n return v;\n const [number] = value.match(floatRegex) || [];\n if (!number)\n return v;\n const unit = value.replace(number, \"\");\n let defaultValue = maxDefaults.has(name) ? 1 : 0;\n if (number !== value)\n defaultValue *= 100;\n return name + \"(\" + defaultValue + unit + \")\";\n}\nconst functionRegex = /\\b([a-z-]*)\\(.*?\\)/gu;\nconst filter = {\n ...complex,\n getAnimatableNone: (v) => {\n const functions = v.match(functionRegex);\n return functions ? functions.map(applyDefaultFilter).join(\" \") : v;\n },\n};\n\nexport { filter };\n//# sourceMappingURL=filter.mjs.map\n","import { complex } from './index.mjs';\n\nconst mask = {\n ...complex,\n getAnimatableNone: (v) => {\n const parsed = complex.parse(v);\n const transformer = complex.createTransformer(v);\n return transformer(parsed.map((v) => typeof v === \"number\" ? 0 : typeof v === \"object\" ? { ...v, alpha: 1 } : v));\n },\n};\n\nexport { mask };\n//# sourceMappingURL=mask.mjs.map\n","import { number } from './numbers/index.mjs';\n\nconst int = {\n ...number,\n transform: Math.round,\n};\n\nexport { int };\n//# sourceMappingURL=int.mjs.map\n","import { int } from '../int.mjs';\nimport { alpha } from '../numbers/index.mjs';\nimport { px } from '../numbers/units.mjs';\nimport { transformValueTypes } from './transform.mjs';\n\nconst numberValueTypes = {\n // Border props\n borderWidth: px,\n borderTopWidth: px,\n borderRightWidth: px,\n borderBottomWidth: px,\n borderLeftWidth: px,\n borderRadius: px,\n borderTopLeftRadius: px,\n borderTopRightRadius: px,\n borderBottomRightRadius: px,\n borderBottomLeftRadius: px,\n // Positioning props\n width: px,\n maxWidth: px,\n height: px,\n maxHeight: px,\n top: px,\n right: px,\n bottom: px,\n left: px,\n inset: px,\n insetBlock: px,\n insetBlockStart: px,\n insetBlockEnd: px,\n insetInline: px,\n insetInlineStart: px,\n insetInlineEnd: px,\n // Spacing props\n padding: px,\n paddingTop: px,\n paddingRight: px,\n paddingBottom: px,\n paddingLeft: px,\n paddingBlock: px,\n paddingBlockStart: px,\n paddingBlockEnd: px,\n paddingInline: px,\n paddingInlineStart: px,\n paddingInlineEnd: px,\n margin: px,\n marginTop: px,\n marginRight: px,\n marginBottom: px,\n marginLeft: px,\n marginBlock: px,\n marginBlockStart: px,\n marginBlockEnd: px,\n marginInline: px,\n marginInlineStart: px,\n marginInlineEnd: px,\n // Typography\n fontSize: px,\n // Misc\n backgroundPositionX: px,\n backgroundPositionY: px,\n ...transformValueTypes,\n zIndex: int,\n // SVG\n fillOpacity: alpha,\n strokeOpacity: alpha,\n numOctaves: int,\n};\n\nexport { numberValueTypes };\n//# sourceMappingURL=number.mjs.map\n","import { alpha, scale } from '../numbers/index.mjs';\nimport { px, progressPercentage, degrees } from '../numbers/units.mjs';\n\nconst transformValueTypes = {\n rotate: degrees,\n /**\n * Internal channel for `transition.path` orientToPath. Composed onto\n * `rotate` at the transform-build sites so the user's `rotate` is\n * never read or overwritten. Not part of `transformPropOrder`.\n */\n pathRotation: degrees,\n rotateX: degrees,\n rotateY: degrees,\n rotateZ: degrees,\n scale,\n scaleX: scale,\n scaleY: scale,\n scaleZ: scale,\n skew: degrees,\n skewX: degrees,\n skewY: degrees,\n distance: px,\n translateX: px,\n translateY: px,\n translateZ: px,\n x: px,\n y: px,\n z: px,\n perspective: px,\n transformPerspective: px,\n opacity: alpha,\n originX: progressPercentage,\n originY: progressPercentage,\n originZ: px,\n};\n\nexport { transformValueTypes };\n//# sourceMappingURL=transform.mjs.map\n","import { color } from '../color/index.mjs';\nimport { filter } from '../complex/filter.mjs';\nimport { mask } from '../complex/mask.mjs';\nimport { numberValueTypes } from './number.mjs';\n\n/**\n * A map of default value types for common values\n */\nconst defaultValueTypes = {\n ...numberValueTypes,\n // Color props\n color,\n backgroundColor: color,\n outlineColor: color,\n fill: color,\n stroke: color,\n // Border props\n borderColor: color,\n borderTopColor: color,\n borderRightColor: color,\n borderBottomColor: color,\n borderLeftColor: color,\n filter,\n WebkitFilter: filter,\n mask,\n WebkitMask: mask,\n};\n/**\n * Gets the default ValueType for the provided value key\n */\nconst getDefaultValueType = (key) => defaultValueTypes[key];\n\nexport { defaultValueTypes, getDefaultValueType };\n//# sourceMappingURL=defaults.mjs.map\n","import { complex } from '../complex/index.mjs';\nimport { filter } from '../complex/filter.mjs';\nimport { mask } from '../complex/mask.mjs';\nimport { getDefaultValueType } from '../maps/defaults.mjs';\n\nconst customTypes = /*@__PURE__*/ new Set([filter, mask]);\nfunction getAnimatableNone(key, value) {\n let defaultValueType = getDefaultValueType(key);\n if (!customTypes.has(defaultValueType))\n defaultValueType = complex;\n // If value is not recognised as animatable, ie \"none\", create an animatable version origin based on the target\n return defaultValueType.getAnimatableNone\n ? defaultValueType.getAnimatableNone(value)\n : undefined;\n}\n\nexport { getAnimatableNone };\n//# sourceMappingURL=animatable-none.mjs.map\n","import { analyseComplexValue } from '../../../value/types/complex/index.mjs';\nimport { getAnimatableNone } from '../../../value/types/utils/animatable-none.mjs';\n\n/**\n * If we encounter keyframes like \"none\" or \"0\" and we also have keyframes like\n * \"#fff\" or \"200px 200px\" we want to find a keyframe to serve as a template for\n * the \"none\" keyframes. In this case \"#fff\" or \"200px 200px\" - then these get turned into\n * zero equivalents, i.e. \"#fff0\" or \"0px 0px\".\n */\nconst invalidTemplates = new Set([\"auto\", \"none\", \"0\"]);\nfunction makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, name) {\n let i = 0;\n let animatableTemplate = undefined;\n while (i < unresolvedKeyframes.length && !animatableTemplate) {\n const keyframe = unresolvedKeyframes[i];\n if (typeof keyframe === \"string\" &&\n !invalidTemplates.has(keyframe) &&\n analyseComplexValue(keyframe).values.length) {\n animatableTemplate = unresolvedKeyframes[i];\n }\n i++;\n }\n if (animatableTemplate && name) {\n for (const noneIndex of noneKeyframeIndexes) {\n unresolvedKeyframes[noneIndex] = getAnimatableNone(name, animatableTemplate);\n }\n }\n}\n\nexport { makeNoneKeyframesAnimatable };\n//# sourceMappingURL=make-none-animatable.mjs.map\n","import { positionalKeys } from '../../render/utils/keys-position.mjs';\nimport { findDimensionValueType } from '../../value/types/dimensions.mjs';\nimport { getVariableValue } from '../utils/css-variables-conversion.mjs';\nimport { isCSSVariableToken, containsCSSVariable } from '../utils/is-css-variable.mjs';\nimport { KeyframeResolver } from './KeyframesResolver.mjs';\nimport { isNone } from './utils/is-none.mjs';\nimport { makeNoneKeyframesAnimatable } from './utils/make-none-animatable.mjs';\nimport { positionalValues, isNumOrPxType } from './utils/unit-conversion.mjs';\n\nclass DOMKeyframesResolver extends KeyframeResolver {\n constructor(unresolvedKeyframes, onComplete, name, motionValue, element) {\n super(unresolvedKeyframes, onComplete, name, motionValue, element, true);\n }\n readKeyframes() {\n const { unresolvedKeyframes, element, name } = this;\n if (!element || !element.current)\n return;\n super.readKeyframes();\n /**\n * If any keyframe is a CSS variable, we need to find its value by sampling the element\n */\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n let keyframe = unresolvedKeyframes[i];\n if (typeof keyframe === \"string\") {\n keyframe = keyframe.trim();\n if (isCSSVariableToken(keyframe)) {\n const resolved = getVariableValue(keyframe, element.current);\n if (resolved !== undefined) {\n unresolvedKeyframes[i] = resolved;\n }\n if (i === unresolvedKeyframes.length - 1) {\n this.finalKeyframe = keyframe;\n }\n }\n }\n }\n /**\n * Resolve \"none\" values. We do this potentially twice - once before and once after measuring keyframes.\n * This could be seen as inefficient but it's a trade-off to avoid measurements in more situations, which\n * have a far bigger performance impact.\n */\n this.resolveNoneKeyframes();\n /**\n * Check to see if unit type has changed. If so schedule jobs that will\n * temporarily set styles to the destination keyframes.\n * Skip if we have more than two keyframes or this isn't a positional value.\n * TODO: We can throw if there are multiple keyframes and the value type changes.\n */\n if (!positionalKeys.has(name) || unresolvedKeyframes.length !== 2) {\n return;\n }\n const [origin, target] = unresolvedKeyframes;\n const originType = findDimensionValueType(origin);\n const targetType = findDimensionValueType(target);\n /**\n * If one keyframe contains embedded CSS variables (e.g. in calc()) and the other\n * doesn't, we need to measure to convert to pixels. This handles GitHub issue #3410.\n */\n const originHasVar = containsCSSVariable(origin);\n const targetHasVar = containsCSSVariable(target);\n if (originHasVar !== targetHasVar && positionalValues[name]) {\n this.needsMeasurement = true;\n return;\n }\n /**\n * Either we don't recognise these value types or we can animate between them.\n */\n if (originType === targetType)\n return;\n /**\n * If both values are numbers or pixels, we can animate between them by\n * converting them to numbers.\n */\n if (isNumOrPxType(originType) && isNumOrPxType(targetType)) {\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n const value = unresolvedKeyframes[i];\n if (typeof value === \"string\") {\n unresolvedKeyframes[i] = parseFloat(value);\n }\n }\n }\n else if (positionalValues[name]) {\n /**\n * Else, the only way to resolve this is by measuring the element.\n */\n this.needsMeasurement = true;\n }\n }\n resolveNoneKeyframes() {\n const { unresolvedKeyframes, name } = this;\n const noneKeyframeIndexes = [];\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n if (unresolvedKeyframes[i] === null ||\n isNone(unresolvedKeyframes[i])) {\n noneKeyframeIndexes.push(i);\n }\n }\n if (noneKeyframeIndexes.length) {\n makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, name);\n }\n }\n measureInitialState() {\n const { element, unresolvedKeyframes, name } = this;\n if (!element || !element.current)\n return;\n if (name === \"height\") {\n this.suspendedScrollY = window.pageYOffset;\n }\n this.measuredOrigin = positionalValues[name](element.measureViewportBox(), window.getComputedStyle(element.current));\n unresolvedKeyframes[0] = this.measuredOrigin;\n // Set final key frame to measure after next render\n const measureKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1];\n if (measureKeyframe !== undefined) {\n element.getValue(name, measureKeyframe).jump(measureKeyframe, false);\n }\n }\n measureEndState() {\n const { element, name, unresolvedKeyframes } = this;\n if (!element || !element.current)\n return;\n const value = element.getValue(name);\n value && value.jump(this.measuredOrigin, false);\n const finalKeyframeIndex = unresolvedKeyframes.length - 1;\n const finalKeyframe = unresolvedKeyframes[finalKeyframeIndex];\n unresolvedKeyframes[finalKeyframeIndex] = positionalValues[name](element.measureViewportBox(), window.getComputedStyle(element.current));\n if (finalKeyframe !== null && this.finalKeyframe === undefined) {\n this.finalKeyframe = finalKeyframe;\n }\n // If we removed transform values, reapply them before the next render\n if (this.removedTransforms?.length) {\n this.removedTransforms.forEach(([unsetTransformName, unsetTransformValue]) => {\n element\n .getValue(unsetTransformName)\n .set(unsetTransformValue);\n });\n }\n this.resolveNoneKeyframes();\n }\n}\n\nexport { DOMKeyframesResolver };\n//# sourceMappingURL=DOMKeyframesResolver.mjs.map\n","/**\n * Provided a value and a ValueType, returns the value as that value type.\n */\nconst getValueAsType = (value, type) => {\n return type && typeof value === \"number\"\n ? type.transform(value)\n : value;\n};\n\nexport { getValueAsType };\n//# sourceMappingURL=get-as-type.mjs.map\n","import { createRenderBatcher } from './batcher.mjs';\n\nconst { schedule: microtask, cancel: cancelMicrotask } = \n/* @__PURE__ */ createRenderBatcher(queueMicrotask, false);\n\nexport { cancelMicrotask, microtask };\n//# sourceMappingURL=microtask.mjs.map\n","import { isObject } from 'motion-utils';\n\n/**\n * Checks if an element is an SVG element in a way\n * that works across iframes\n */\nfunction isSVGElement(element) {\n return isObject(element) && \"ownerSVGElement\" in element;\n}\n\nexport { isSVGElement };\n//# sourceMappingURL=is-svg-element.mjs.map\n","const isObject = (value) => typeof value === \"object\" && value !== null;\n\nexport { isObject };\n//# sourceMappingURL=is-object.mjs.map\n","import { color } from '../color/index.mjs';\nimport { complex } from '../complex/index.mjs';\nimport { dimensionValueTypes } from '../dimensions.mjs';\nimport { testValueType } from '../test.mjs';\n\n/**\n * A list of all ValueTypes\n */\nconst valueTypes = [...dimensionValueTypes, color, complex];\n/**\n * Tests a value against the list of ValueTypes\n */\nconst findValueType = (v) => valueTypes.find(testValueType(v));\n\nexport { findValueType };\n//# sourceMappingURL=find.mjs.map\n","const createAxisDelta = () => ({\n translate: 0,\n scale: 1,\n origin: 0,\n originPoint: 0,\n});\nconst createDelta = () => ({\n x: createAxisDelta(),\n y: createAxisDelta(),\n});\nconst createAxis = () => ({ min: 0, max: 0 });\nconst createBox = () => ({\n x: createAxis(),\n y: createAxis(),\n});\n\nexport { createAxis, createAxisDelta, createBox, createDelta };\n//# sourceMappingURL=models.mjs.map\n","const visualElementStore = new WeakMap();\n\nexport { visualElementStore };\n//# sourceMappingURL=store.mjs.map\n","const variantPriorityOrder = [\n \"animate\",\n \"whileInView\",\n \"whileFocus\",\n \"whileHover\",\n \"whileTap\",\n \"whileDrag\",\n \"exit\",\n];\nconst variantProps = [\"initial\", ...variantPriorityOrder];\n\nexport { variantPriorityOrder, variantProps };\n//# sourceMappingURL=variant-props.mjs.map\n","import { isAnimationControls } from './is-animation-controls.mjs';\nimport { isVariantLabel } from './is-variant-label.mjs';\nimport { variantProps } from './variant-props.mjs';\n\nfunction isControllingVariants(props) {\n return (isAnimationControls(props.animate) ||\n variantProps.some((name) => isVariantLabel(props[name])));\n}\nfunction isVariantNode(props) {\n return Boolean(isControllingVariants(props) || props.variants);\n}\n\nexport { isControllingVariants, isVariantNode };\n//# sourceMappingURL=is-controlling-variants.mjs.map\n","function isAnimationControls(v) {\n return (v !== null &&\n typeof v === \"object\" &&\n typeof v.start === \"function\");\n}\n\nexport { isAnimationControls };\n//# sourceMappingURL=is-animation-controls.mjs.map\n","/**\n * Decides if the supplied variable is variant label\n */\nfunction isVariantLabel(v) {\n return typeof v === \"string\" || Array.isArray(v);\n}\n\nexport { isVariantLabel };\n//# sourceMappingURL=is-variant-label.mjs.map\n","// Does this device prefer reduced motion? Returns `null` server-side.\nconst prefersReducedMotion = { current: null };\nconst hasReducedMotionListener = { current: false };\n\nexport { hasReducedMotionListener, prefersReducedMotion };\n//# sourceMappingURL=state.mjs.map\n","import { hasReducedMotionListener, prefersReducedMotion } from './state.mjs';\n\nconst isBrowser = typeof window !== \"undefined\";\nfunction initPrefersReducedMotion() {\n hasReducedMotionListener.current = true;\n if (!isBrowser)\n return;\n if (window.matchMedia) {\n const motionMediaQuery = window.matchMedia(\"(prefers-reduced-motion)\");\n const setReducedMotionPreferences = () => (prefersReducedMotion.current = motionMediaQuery.matches);\n motionMediaQuery.addEventListener(\"change\", setReducedMotionPreferences);\n setReducedMotionPreferences();\n }\n else {\n prefersReducedMotion.current = false;\n }\n}\n\nexport { hasReducedMotionListener, initPrefersReducedMotion, prefersReducedMotion };\n//# sourceMappingURL=index.mjs.map\n","import { warnOnce, secondsToMilliseconds, isNumericalString, isZeroValueString, SubscriptionManager } from 'motion-utils';\nimport { KeyframeResolver } from '../animation/keyframes/KeyframesResolver.mjs';\nimport { NativeAnimation } from '../animation/NativeAnimation.mjs';\nimport { acceleratedValues } from '../animation/waapi/utils/accelerated-values.mjs';\nimport { microtask } from '../frameloop/microtask.mjs';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { createBox } from '../projection/geometry/models.mjs';\nimport { motionValue } from '../value/index.mjs';\nimport { complex } from '../value/types/complex/index.mjs';\nimport { getAnimatableNone } from '../value/types/utils/animatable-none.mjs';\nimport { findValueType } from '../value/types/utils/find.mjs';\nimport { isMotionValue } from '../value/utils/is-motion-value.mjs';\nimport { visualElementStore } from './store.mjs';\nimport { isControllingVariants, isVariantNode } from './utils/is-controlling-variants.mjs';\nimport { transformProps } from './utils/keys-transform.mjs';\nimport { updateMotionValuesFromProps } from './utils/motion-values.mjs';\nimport { initPrefersReducedMotion } from './utils/reduced-motion/index.mjs';\nimport { resolveVariantFromProps } from './utils/resolve-variants.mjs';\nimport { hasReducedMotionListener, prefersReducedMotion } from './utils/reduced-motion/state.mjs';\nimport { frame, cancelFrame } from '../frameloop/frame.mjs';\n\nconst propEventHandlers = [\n \"AnimationStart\",\n \"AnimationComplete\",\n \"Update\",\n \"BeforeLayoutMeasure\",\n \"LayoutMeasure\",\n \"LayoutAnimationStart\",\n \"LayoutAnimationComplete\",\n];\n/**\n * Static feature definitions - can be injected by framework layer\n */\nlet featureDefinitions = {};\n/**\n * Set feature definitions for all VisualElements.\n * This should be called by the framework layer (e.g., framer-motion) during initialization.\n */\nfunction setFeatureDefinitions(definitions) {\n featureDefinitions = definitions;\n}\n/**\n * Get the current feature definitions\n */\nfunction getFeatureDefinitions() {\n return featureDefinitions;\n}\n/**\n * A VisualElement is an imperative abstraction around UI elements such as\n * HTMLElement, SVGElement, Three.Object3D etc.\n */\nclass VisualElement {\n /**\n * This method takes React props and returns found MotionValues. For example, HTML\n * MotionValues will be found within the style prop, whereas for Three.js within attribute arrays.\n *\n * This isn't an abstract method as it needs calling in the constructor, but it is\n * intended to be one.\n */\n scrapeMotionValuesFromProps(_props, _prevProps, _visualElement) {\n return {};\n }\n constructor({ parent, props, presenceContext, reducedMotionConfig, skipAnimations, blockInitialAnimation, visualState, }, options = {}) {\n /**\n * A reference to the current underlying Instance, e.g. a HTMLElement\n * or Three.Mesh etc.\n */\n this.current = null;\n /**\n * A set containing references to this VisualElement's children.\n */\n this.children = new Set();\n /**\n * Determine what role this visual element should take in the variant tree.\n */\n this.isVariantNode = false;\n this.isControllingVariants = false;\n /**\n * Decides whether this VisualElement should animate in reduced motion\n * mode.\n *\n * TODO: This is currently set on every individual VisualElement but feels\n * like it could be set globally.\n */\n this.shouldReduceMotion = null;\n /**\n * Decides whether animations should be skipped for this VisualElement.\n * Useful for E2E tests and visual regression testing.\n */\n this.shouldSkipAnimations = false;\n /**\n * A map of all motion values attached to this visual element. Motion\n * values are source of truth for any given animated value. A motion\n * value might be provided externally by the component via props.\n */\n this.values = new Map();\n this.KeyframeResolver = KeyframeResolver;\n /**\n * Cleanup functions for active features (hover/tap/exit etc)\n */\n this.features = {};\n /**\n * A map of every subscription that binds the provided or generated\n * motion values onChange listeners to this visual element.\n */\n this.valueSubscriptions = new Map();\n /**\n * A reference to the previously-provided motion values as returned\n * from scrapeMotionValuesFromProps. We use the keys in here to determine\n * if any motion values need to be removed after props are updated.\n */\n this.prevMotionValues = {};\n /**\n * Track whether this element has been mounted before, to detect\n * remounts after Suspense unmount/remount cycles.\n */\n this.hasBeenMounted = false;\n /**\n * An object containing a SubscriptionManager for each active event.\n */\n this.events = {};\n /**\n * An object containing an unsubscribe function for each prop event subscription.\n * For example, every \"Update\" event can have multiple subscribers via\n * VisualElement.on(), but only one of those can be defined via the onUpdate prop.\n */\n this.propEventSubscriptions = {};\n this.notifyUpdate = () => this.notify(\"Update\", this.latestValues);\n this.render = () => {\n if (!this.current)\n return;\n this.triggerBuild();\n this.renderInstance(this.current, this.renderState, this.props.style, this.projection);\n };\n this.renderScheduledAt = 0.0;\n this.scheduleRender = () => {\n const now = time.now();\n if (this.renderScheduledAt < now) {\n this.renderScheduledAt = now;\n frame.render(this.render, false, true);\n }\n };\n const { latestValues, renderState } = visualState;\n this.latestValues = latestValues;\n this.baseTarget = { ...latestValues };\n this.initialValues = props.initial ? { ...latestValues } : {};\n this.renderState = renderState;\n this.parent = parent;\n this.props = props;\n this.presenceContext = presenceContext;\n this.depth = parent ? parent.depth + 1 : 0;\n this.reducedMotionConfig = reducedMotionConfig;\n this.skipAnimationsConfig = skipAnimations;\n this.options = options;\n this.blockInitialAnimation = Boolean(blockInitialAnimation);\n this.isControllingVariants = isControllingVariants(props);\n this.isVariantNode = isVariantNode(props);\n if (this.isVariantNode) {\n this.variantChildren = new Set();\n }\n this.manuallyAnimateOnMount = Boolean(parent && parent.current);\n /**\n * Any motion values that are provided to the element when created\n * aren't yet bound to the element, as this would technically be impure.\n * However, we iterate through the motion values and set them to the\n * initial values for this component.\n *\n * TODO: This is impure and we should look at changing this to run on mount.\n * Doing so will break some tests but this isn't necessarily a breaking change,\n * more a reflection of the test.\n */\n const { willChange, ...initialMotionValues } = this.scrapeMotionValuesFromProps(props, {}, this);\n for (const key in initialMotionValues) {\n const value = initialMotionValues[key];\n if (latestValues[key] !== undefined && isMotionValue(value)) {\n value.set(latestValues[key]);\n }\n }\n }\n mount(instance) {\n /**\n * If this element has been mounted before (e.g. after a Suspense\n * unmount/remount), reset motion values to their initial state\n * so animations replay correctly from initial → animate.\n */\n if (this.hasBeenMounted) {\n for (const key in this.initialValues) {\n this.values.get(key)?.jump(this.initialValues[key]);\n this.latestValues[key] = this.initialValues[key];\n }\n }\n this.current = instance;\n visualElementStore.set(instance, this);\n if (this.projection && !this.projection.instance) {\n this.projection.mount(instance);\n }\n if (this.parent && this.isVariantNode && !this.isControllingVariants) {\n this.removeFromVariantTree = this.parent.addVariantChild(this);\n }\n this.values.forEach((value, key) => this.bindToMotionValue(key, value));\n /**\n * Determine reduced motion preference. Only initialize the matchMedia\n * listener if we actually need the dynamic value (i.e., when config\n * is neither \"never\" nor \"always\").\n */\n if (this.reducedMotionConfig === \"never\") {\n this.shouldReduceMotion = false;\n }\n else if (this.reducedMotionConfig === \"always\") {\n this.shouldReduceMotion = true;\n }\n else {\n if (!hasReducedMotionListener.current) {\n initPrefersReducedMotion();\n }\n this.shouldReduceMotion = prefersReducedMotion.current;\n }\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(this.shouldReduceMotion !== true, \"You have Reduced Motion enabled on your device. Animations may not appear as expected.\", \"reduced-motion-disabled\");\n }\n /**\n * Set whether animations should be skipped based on the config.\n */\n this.shouldSkipAnimations = this.skipAnimationsConfig ?? false;\n this.parent?.addChild(this);\n this.update(this.props, this.presenceContext);\n this.hasBeenMounted = true;\n }\n unmount() {\n this.projection && this.projection.unmount();\n cancelFrame(this.notifyUpdate);\n cancelFrame(this.render);\n this.valueSubscriptions.forEach((remove) => remove());\n this.valueSubscriptions.clear();\n this.removeFromVariantTree && this.removeFromVariantTree();\n this.parent?.removeChild(this);\n for (const key in this.events) {\n this.events[key].clear();\n }\n for (const key in this.features) {\n const feature = this.features[key];\n if (feature) {\n feature.unmount();\n feature.isMounted = false;\n }\n }\n this.current = null;\n }\n addChild(child) {\n this.children.add(child);\n this.enteringChildren ?? (this.enteringChildren = new Set());\n this.enteringChildren.add(child);\n }\n removeChild(child) {\n this.children.delete(child);\n this.enteringChildren && this.enteringChildren.delete(child);\n }\n bindToMotionValue(key, value) {\n if (this.valueSubscriptions.has(key)) {\n this.valueSubscriptions.get(key)();\n }\n if (value.accelerate &&\n acceleratedValues.has(key) &&\n this.current instanceof HTMLElement) {\n const { factory, keyframes, times, ease, duration } = value.accelerate;\n const animation = new NativeAnimation({\n element: this.current,\n name: key,\n keyframes,\n times,\n ease,\n duration: secondsToMilliseconds(duration),\n });\n const cleanup = factory(animation);\n this.valueSubscriptions.set(key, () => {\n cleanup();\n animation.cancel();\n });\n return;\n }\n const valueIsTransform = transformProps.has(key);\n if (valueIsTransform && this.onBindTransform) {\n this.onBindTransform();\n }\n const removeOnChange = value.on(\"change\", (latestValue) => {\n this.latestValues[key] = latestValue;\n this.props.onUpdate && frame.preRender(this.notifyUpdate);\n if (valueIsTransform && this.projection) {\n this.projection.isTransformDirty = true;\n }\n this.scheduleRender();\n });\n let removeSyncCheck;\n if (typeof window !== \"undefined\" &&\n window.MotionCheckAppearSync) {\n removeSyncCheck = window.MotionCheckAppearSync(this, key, value);\n }\n this.valueSubscriptions.set(key, () => {\n removeOnChange();\n if (removeSyncCheck)\n removeSyncCheck();\n // Defer to MotionValue.on(\"change\") auto-stop so React 19 remounts\n // can resubscribe before the animation is cancelled (#3315).\n });\n }\n sortNodePosition(other) {\n /**\n * If these nodes aren't even of the same type we can't compare their depth.\n */\n if (!this.current ||\n !this.sortInstanceNodePosition ||\n this.type !== other.type) {\n return 0;\n }\n return this.sortInstanceNodePosition(this.current, other.current);\n }\n updateFeatures() {\n let key = \"animation\";\n for (key in featureDefinitions) {\n const featureDefinition = featureDefinitions[key];\n if (!featureDefinition)\n continue;\n const { isEnabled, Feature: FeatureConstructor } = featureDefinition;\n /**\n * If this feature is enabled but not active, make a new instance.\n */\n if (!this.features[key] &&\n FeatureConstructor &&\n isEnabled(this.props)) {\n this.features[key] = new FeatureConstructor(this);\n }\n /**\n * If we have a feature, mount or update it.\n */\n if (this.features[key]) {\n const feature = this.features[key];\n if (feature.isMounted) {\n feature.update();\n }\n else {\n feature.mount();\n feature.isMounted = true;\n }\n }\n }\n }\n triggerBuild() {\n this.build(this.renderState, this.latestValues, this.props);\n }\n /**\n * Measure the current viewport box with or without transforms.\n * Only measures axis-aligned boxes, rotate and skew must be manually\n * removed with a re-render to work.\n */\n measureViewportBox() {\n return this.current\n ? this.measureInstanceViewportBox(this.current, this.props)\n : createBox();\n }\n getStaticValue(key) {\n return this.latestValues[key];\n }\n setStaticValue(key, value) {\n this.latestValues[key] = value;\n }\n /**\n * Update the provided props. Ensure any newly-added motion values are\n * added to our map, old ones removed, and listeners updated.\n */\n update(props, presenceContext) {\n if (props.transformTemplate || this.props.transformTemplate) {\n this.scheduleRender();\n }\n this.prevProps = this.props;\n this.props = props;\n this.prevPresenceContext = this.presenceContext;\n this.presenceContext = presenceContext;\n /**\n * Update prop event handlers ie onAnimationStart, onAnimationComplete\n */\n for (let i = 0; i < propEventHandlers.length; i++) {\n const key = propEventHandlers[i];\n if (this.propEventSubscriptions[key]) {\n this.propEventSubscriptions[key]();\n delete this.propEventSubscriptions[key];\n }\n const listenerName = (\"on\" + key);\n const listener = props[listenerName];\n if (listener) {\n this.propEventSubscriptions[key] = this.on(key, listener);\n }\n }\n this.prevMotionValues = updateMotionValuesFromProps(this, this.scrapeMotionValuesFromProps(props, this.prevProps || {}, this), this.prevMotionValues);\n if (this.handleChildMotionValue) {\n this.handleChildMotionValue();\n }\n }\n getProps() {\n return this.props;\n }\n /**\n * Returns the variant definition with a given name.\n */\n getVariant(name) {\n return this.props.variants ? this.props.variants[name] : undefined;\n }\n /**\n * Returns the defined default transition on this component.\n */\n getDefaultTransition() {\n return this.props.transition;\n }\n getTransformPagePoint() {\n return this.props.transformPagePoint;\n }\n getClosestVariantNode() {\n return this.isVariantNode\n ? this\n : this.parent\n ? this.parent.getClosestVariantNode()\n : undefined;\n }\n /**\n * Add a child visual element to our set of children.\n */\n addVariantChild(child) {\n const closestVariantNode = this.getClosestVariantNode();\n if (closestVariantNode) {\n closestVariantNode.variantChildren &&\n closestVariantNode.variantChildren.add(child);\n return () => closestVariantNode.variantChildren.delete(child);\n }\n }\n /**\n * Add a motion value and bind it to this visual element.\n */\n addValue(key, value) {\n // Remove existing value if it exists\n const existingValue = this.values.get(key);\n if (value !== existingValue) {\n if (existingValue)\n this.removeValue(key);\n this.bindToMotionValue(key, value);\n this.values.set(key, value);\n this.latestValues[key] = value.get();\n }\n }\n /**\n * Remove a motion value and unbind any active subscriptions.\n */\n removeValue(key) {\n this.values.delete(key);\n const unsubscribe = this.valueSubscriptions.get(key);\n if (unsubscribe) {\n unsubscribe();\n this.valueSubscriptions.delete(key);\n }\n delete this.latestValues[key];\n this.removeValueFromRenderState(key, this.renderState);\n }\n /**\n * Check whether we have a motion value for this key\n */\n hasValue(key) {\n return this.values.has(key);\n }\n getValue(key, defaultValue) {\n if (this.props.values && this.props.values[key]) {\n return this.props.values[key];\n }\n let value = this.values.get(key);\n if (value === undefined && defaultValue !== undefined) {\n value = motionValue(defaultValue === null ? undefined : defaultValue, { owner: this });\n this.addValue(key, value);\n }\n return value;\n }\n /**\n * If we're trying to animate to a previously unencountered value,\n * we need to check for it in our state and as a last resort read it\n * directly from the instance (which might have performance implications).\n */\n readValue(key, target) {\n let value = this.latestValues[key] !== undefined || !this.current\n ? this.latestValues[key]\n : this.getBaseTargetFromProps(this.props, key) ??\n this.readValueFromInstance(this.current, key, this.options);\n if (value !== undefined && value !== null) {\n if (typeof value === \"string\" &&\n (isNumericalString(value) || isZeroValueString(value))) {\n // If this is a number read as a string, ie \"0\" or \"200\", convert it to a number\n value = parseFloat(value);\n }\n else if (!findValueType(value) && complex.test(target)) {\n value = getAnimatableNone(key, target);\n }\n this.setBaseTarget(key, isMotionValue(value) ? value.get() : value);\n }\n return isMotionValue(value) ? value.get() : value;\n }\n /**\n * Set the base target to later animate back to. This is currently\n * only hydrated on creation and when we first read a value.\n */\n setBaseTarget(key, value) {\n this.baseTarget[key] = value;\n }\n /**\n * Find the base target for a value thats been removed from all animation\n * props.\n */\n getBaseTarget(key) {\n const { initial } = this.props;\n let valueFromInitial;\n if (typeof initial === \"string\" || typeof initial === \"object\") {\n const variant = resolveVariantFromProps(this.props, initial, this.presenceContext?.custom);\n if (variant) {\n valueFromInitial = variant[key];\n }\n }\n /**\n * If this value still exists in the current initial variant, read that.\n */\n if (initial && valueFromInitial !== undefined) {\n return valueFromInitial;\n }\n /**\n * Alternatively, if this VisualElement config has defined a getBaseTarget\n * so we can read the value from an alternative source, try that.\n */\n const target = this.getBaseTargetFromProps(this.props, key);\n if (target !== undefined && !isMotionValue(target))\n return target;\n /**\n * If the value was initially defined on initial, but it doesn't any more,\n * return undefined. Otherwise return the value as initially read from the DOM.\n */\n return this.initialValues[key] !== undefined &&\n valueFromInitial === undefined\n ? undefined\n : this.baseTarget[key];\n }\n on(eventName, callback) {\n if (!this.events[eventName]) {\n this.events[eventName] = new SubscriptionManager();\n }\n return this.events[eventName].add(callback);\n }\n notify(eventName, ...args) {\n if (this.events[eventName]) {\n this.events[eventName].notify(...args);\n }\n }\n scheduleRenderMicrotask() {\n microtask.render(this.render);\n }\n}\n\nexport { VisualElement, getFeatureDefinitions, setFeatureDefinitions };\n//# sourceMappingURL=VisualElement.mjs.map\n","import { motionValue } from '../../value/index.mjs';\nimport { isMotionValue } from '../../value/utils/is-motion-value.mjs';\n\n/**\n * Updates motion values from props changes.\n * Uses `any` type for element to avoid circular dependencies with VisualElement.\n */\nfunction updateMotionValuesFromProps(element, next, prev) {\n for (const key in next) {\n const nextValue = next[key];\n const prevValue = prev[key];\n if (isMotionValue(nextValue)) {\n /**\n * If this is a motion value found in props or style, we want to add it\n * to our visual element's motion value map.\n */\n element.addValue(key, nextValue);\n }\n else if (isMotionValue(prevValue)) {\n /**\n * If we're swapping from a motion value to a static value,\n * create a new motion value from that\n */\n element.addValue(key, motionValue(nextValue, { owner: element }));\n }\n else if (prevValue !== nextValue) {\n /**\n * If this is a flat value that has changed, update the motion value\n * or create one if it doesn't exist. We only want to do this if we're\n * not handling the value with our animation state.\n */\n if (element.hasValue(key)) {\n const existingValue = element.getValue(key);\n if (existingValue.liveStyle === true) {\n existingValue.jump(nextValue);\n }\n else if (!existingValue.hasAnimated) {\n existingValue.set(nextValue);\n }\n }\n else {\n const latestValue = element.getStaticValue(key);\n element.addValue(key, motionValue(latestValue !== undefined ? latestValue : nextValue, { owner: element }));\n }\n }\n }\n // Handle removed values\n for (const key in prev) {\n if (next[key] === undefined)\n element.removeValue(key);\n }\n return next;\n}\n\nexport { updateMotionValuesFromProps };\n//# sourceMappingURL=motion-values.mjs.map\n","import { isMotionValue } from '../../value/utils/is-motion-value.mjs';\nimport { DOMKeyframesResolver } from '../../animation/keyframes/DOMKeyframesResolver.mjs';\nimport { VisualElement } from '../VisualElement.mjs';\n\nclass DOMVisualElement extends VisualElement {\n constructor() {\n super(...arguments);\n this.KeyframeResolver = DOMKeyframesResolver;\n }\n sortInstanceNodePosition(a, b) {\n /**\n * compareDocumentPosition returns a bitmask, by using the bitwise &\n * we're returning true if 2 in that bitmask is set to true. 2 is set\n * to true if b preceeds a.\n */\n return a.compareDocumentPosition(b) & 2 ? 1 : -1;\n }\n getBaseTargetFromProps(props, key) {\n const style = props.style;\n return style ? style[key] : undefined;\n }\n removeValueFromRenderState(key, { vars, style }) {\n delete vars[key];\n delete style[key];\n }\n handleChildMotionValue() {\n if (this.childSubscription) {\n this.childSubscription();\n delete this.childSubscription;\n }\n const { children } = this.props;\n if (isMotionValue(children)) {\n this.childSubscription = children.on(\"change\", (latest) => {\n if (this.current) {\n this.current.textContent = `${latest}`;\n }\n });\n }\n }\n}\n\nexport { DOMVisualElement };\n//# sourceMappingURL=DOMVisualElement.mjs.map\n","import { getValueAsType } from '../../../value/types/utils/get-as-type.mjs';\nimport { numberValueTypes } from '../../../value/types/maps/number.mjs';\nimport { transformPropOrder } from '../../utils/keys-transform.mjs';\n\nconst translateAlias = {\n x: \"translateX\",\n y: \"translateY\",\n z: \"translateZ\",\n transformPerspective: \"perspective\",\n};\nconst numTransforms = transformPropOrder.length;\n/**\n * Build a CSS transform style from individual x/y/scale etc properties.\n *\n * This outputs with a default order of transforms/scales/rotations, this can be customised by\n * providing a transformTemplate function.\n */\nfunction buildTransform(latestValues, transform, transformTemplate) {\n // The transform string we're going to build into.\n let transformString = \"\";\n let transformIsDefault = true;\n /**\n * Loop over all possible transforms in order, adding the ones that\n * are present to the transform string.\n */\n for (let i = 0; i < numTransforms; i++) {\n const key = transformPropOrder[i];\n const value = latestValues[key];\n if (value === undefined)\n continue;\n let valueIsDefault = true;\n if (typeof value === \"number\") {\n valueIsDefault = value === (key.startsWith(\"scale\") ? 1 : 0);\n }\n else {\n const parsed = parseFloat(value);\n valueIsDefault = key.startsWith(\"scale\") ? parsed === 1 : parsed === 0;\n }\n if (!valueIsDefault || transformTemplate) {\n const valueAsType = getValueAsType(value, numberValueTypes[key]);\n if (!valueIsDefault) {\n transformIsDefault = false;\n const transformName = translateAlias[key] || key;\n transformString += `${transformName}(${valueAsType}) `;\n }\n if (transformTemplate) {\n transform[key] = valueAsType;\n }\n }\n }\n // `pathRotation` composes onto `rotate` as a separate additive term so\n // the user's `rotate` is never clobbered. Deliberately not a slot in\n // `transformPropOrder`.\n const pathRotation = latestValues.pathRotation;\n if (pathRotation) {\n transformIsDefault = false;\n transformString += `rotate(${getValueAsType(pathRotation, numberValueTypes.pathRotation)}) `;\n }\n transformString = transformString.trim();\n // If we have a custom `transform` template, pass our transform values and\n // generated transformString to that before returning\n if (transformTemplate) {\n transformString = transformTemplate(transform, transformIsDefault ? \"\" : transformString);\n }\n else if (transformIsDefault) {\n transformString = \"none\";\n }\n return transformString;\n}\n\nexport { buildTransform };\n//# sourceMappingURL=build-transform.mjs.map\n","import { getValueAsType } from '../../../value/types/utils/get-as-type.mjs';\nimport { numberValueTypes } from '../../../value/types/maps/number.mjs';\nimport { transformProps } from '../../utils/keys-transform.mjs';\nimport { isCSSVariableName } from '../../../animation/utils/is-css-variable.mjs';\nimport { buildTransform } from './build-transform.mjs';\n\nfunction buildHTMLStyles(state, latestValues, transformTemplate) {\n const { style, vars, transformOrigin } = state;\n // Track whether we encounter any transform or transformOrigin values.\n let hasTransform = false;\n let hasTransformOrigin = false;\n /**\n * Loop over all our latest animated values and decide whether to handle them\n * as a style or CSS variable.\n *\n * Transforms and transform origins are kept separately for further processing.\n */\n for (const key in latestValues) {\n const value = latestValues[key];\n if (transformProps.has(key)) {\n // If this is a transform, flag to enable further transform processing\n hasTransform = true;\n continue;\n }\n else if (isCSSVariableName(key)) {\n vars[key] = value;\n continue;\n }\n else {\n // Convert the value to its default value type, ie 0 -> \"0px\"\n const valueAsType = getValueAsType(value, numberValueTypes[key]);\n if (key.startsWith(\"origin\")) {\n // If this is a transform origin, flag and enable further transform-origin processing\n hasTransformOrigin = true;\n transformOrigin[key] =\n valueAsType;\n }\n else {\n style[key] = valueAsType;\n }\n }\n }\n if (!latestValues.transform) {\n if (hasTransform || transformTemplate) {\n style.transform = buildTransform(latestValues, state.transform, transformTemplate);\n }\n else if (style.transform) {\n /**\n * If we have previously created a transform but currently don't have any,\n * reset transform style to none.\n */\n style.transform = \"none\";\n }\n }\n /**\n * Build a transformOrigin style. Uses the same defaults as the browser for\n * undefined origins.\n */\n if (hasTransformOrigin) {\n const { originX = \"50%\", originY = \"50%\", originZ = 0, } = transformOrigin;\n style.transformOrigin = `${originX} ${originY} ${originZ}`;\n }\n}\n\nexport { buildHTMLStyles };\n//# sourceMappingURL=build-styles.mjs.map\n","function renderHTML(element, { style, vars }, styleProp, projection) {\n const elementStyle = element.style;\n let key;\n for (key in style) {\n // CSSStyleDeclaration has [index: number]: string; in the types, so we use that as key type.\n elementStyle[key] = style[key];\n }\n // Write projection styles directly to element style\n projection?.applyProjectionStyles(elementStyle, styleProp);\n for (key in vars) {\n // Loop over any CSS variables and assign those.\n // They can only be assigned using `setProperty`.\n elementStyle.setProperty(key, vars[key]);\n }\n}\n\nexport { renderHTML };\n//# sourceMappingURL=render.mjs.map\n","import { px } from '../../value/types/numbers/units.mjs';\n\nfunction pixelsToPercent(pixels, axis) {\n if (axis.max === axis.min)\n return 0;\n return (pixels / (axis.max - axis.min)) * 100;\n}\n/**\n * We always correct borderRadius as a percentage rather than pixels to reduce paints.\n * For example, if you are projecting a box that is 100px wide with a 10px borderRadius\n * into a box that is 200px wide with a 20px borderRadius, that is actually a 10%\n * borderRadius in both states. If we animate between the two in pixels that will trigger\n * a paint each time. If we animate between the two in percentage we'll avoid a paint.\n */\nconst correctBorderRadius = {\n correct: (latest, node) => {\n if (!node.target)\n return latest;\n /**\n * If latest is a string, if it's a percentage we can return immediately as it's\n * going to be stretched appropriately. Otherwise, if it's a pixel, convert it to a number.\n */\n if (typeof latest === \"string\") {\n if (px.test(latest)) {\n latest = parseFloat(latest);\n }\n else {\n return latest;\n }\n }\n /**\n * If latest is a number, it's a pixel value. We use the current viewportBox to calculate that\n * pixel value as a percentage of each axis\n */\n const x = pixelsToPercent(latest, node.target.x);\n const y = pixelsToPercent(latest, node.target.y);\n return `${x}% ${y}%`;\n },\n};\n\nexport { correctBorderRadius, pixelsToPercent };\n//# sourceMappingURL=scale-border-radius.mjs.map\n","import { complex } from '../../value/types/complex/index.mjs';\nimport { mixNumber } from '../../utils/mix/number.mjs';\n\nconst correctBoxShadow = {\n correct: (latest, { treeScale, projectionDelta }) => {\n const original = latest;\n const shadow = complex.parse(latest);\n // TODO: Doesn't support multiple shadows\n if (shadow.length > 5)\n return original;\n const template = complex.createTransformer(latest);\n const offset = typeof shadow[0] !== \"number\" ? 1 : 0;\n // Calculate the overall context scale\n const xScale = projectionDelta.x.scale * treeScale.x;\n const yScale = projectionDelta.y.scale * treeScale.y;\n shadow[0 + offset] /= xScale;\n shadow[1 + offset] /= yScale;\n /**\n * Ideally we'd correct x and y scales individually, but because blur and\n * spread apply to both we have to take a scale average and apply that instead.\n * We could potentially improve the outcome of this by incorporating the ratio between\n * the two scales.\n */\n const averageScale = mixNumber(xScale, yScale, 0.5);\n // Blur\n if (typeof shadow[2 + offset] === \"number\")\n shadow[2 + offset] /= averageScale;\n // Spread\n if (typeof shadow[3 + offset] === \"number\")\n shadow[3 + offset] /= averageScale;\n return template(shadow);\n },\n};\n\nexport { correctBoxShadow };\n//# sourceMappingURL=scale-box-shadow.mjs.map\n","import { isCSSVariableName } from '../../animation/utils/is-css-variable.mjs';\nimport { cornerRadiusProps } from '../../utils/border-radius.mjs';\nimport { correctBorderRadius } from './scale-border-radius.mjs';\nimport { correctBoxShadow } from './scale-box-shadow.mjs';\n\nconst scaleCorrectors = {\n borderRadius: {\n ...correctBorderRadius,\n applyTo: [...cornerRadiusProps],\n },\n borderTopLeftRadius: correctBorderRadius,\n borderTopRightRadius: correctBorderRadius,\n borderBottomLeftRadius: correctBorderRadius,\n borderBottomRightRadius: correctBorderRadius,\n boxShadow: correctBoxShadow,\n};\nfunction addScaleCorrector(correctors) {\n for (const key in correctors) {\n scaleCorrectors[key] = correctors[key];\n if (isCSSVariableName(key)) {\n scaleCorrectors[key].isCSSVariable = true;\n }\n }\n}\n\nexport { addScaleCorrector, scaleCorrectors };\n//# sourceMappingURL=scale-correction.mjs.map\n","/**\n * The four corner-radius longhands. Shared so the projection mixer, scale\n * corrector, WAAPI px-value set and view-transition crop pass don't each carry\n * their own copy. Order is irrelevant - every consumer mixes/corrects/animates\n * each corner independently.\n */\nconst cornerRadiusProps = [\n \"borderTopLeftRadius\",\n \"borderTopRightRadius\",\n \"borderBottomRightRadius\",\n \"borderBottomLeftRadius\",\n];\n\nexport { cornerRadiusProps };\n//# sourceMappingURL=border-radius.mjs.map\n","import { transformProps } from './keys-transform.mjs';\nimport { scaleCorrectors } from '../../projection/styles/scale-correction.mjs';\nexport { addScaleCorrector } from '../../projection/styles/scale-correction.mjs';\n\nfunction isForcedMotionValue(key, { layout, layoutId }) {\n return (transformProps.has(key) ||\n key.startsWith(\"origin\") ||\n ((layout || layoutId !== undefined) &&\n (!!scaleCorrectors[key] || key === \"opacity\")));\n}\n\nexport { isForcedMotionValue, scaleCorrectors };\n//# sourceMappingURL=is-forced-motion-value.mjs.map\n","import { isMotionValue } from '../../../value/utils/is-motion-value.mjs';\nimport { isForcedMotionValue } from '../../utils/is-forced-motion-value.mjs';\n\nfunction scrapeMotionValuesFromProps(props, prevProps, visualElement) {\n const style = props.style;\n const prevStyle = prevProps?.style;\n const newValues = {};\n if (!style)\n return newValues;\n for (const key in style) {\n if (isMotionValue(style[key]) ||\n (prevStyle && isMotionValue(prevStyle[key])) ||\n isForcedMotionValue(key, props) ||\n visualElement?.getValue(key)?.liveStyle !== undefined) {\n newValues[key] = style[key];\n }\n }\n return newValues;\n}\n\nexport { scrapeMotionValuesFromProps };\n//# sourceMappingURL=scrape-motion-values.mjs.map\n","import { invariant } from 'motion-utils';\nimport { isCSSVariableName } from '../../animation/utils/is-css-variable.mjs';\nimport { transformProps } from '../utils/keys-transform.mjs';\nimport { defaultTransformValue, readTransformValue } from '../dom/parse-transform.mjs';\nimport { measureViewportBox } from '../../projection/utils/measure.mjs';\nimport { DOMVisualElement } from '../dom/DOMVisualElement.mjs';\nimport { buildHTMLStyles } from './utils/build-styles.mjs';\nimport { renderHTML } from './utils/render.mjs';\nimport { scrapeMotionValuesFromProps } from './utils/scrape-motion-values.mjs';\n\nfunction getComputedStyle(element) {\n return window.getComputedStyle(element);\n}\nclass HTMLVisualElement extends DOMVisualElement {\n constructor() {\n super(...arguments);\n this.type = \"html\";\n this.renderInstance = renderHTML;\n }\n mount(instance) {\n /**\n * If a custom component forwards its ref to something other than a\n * HTML/SVG element (a class instance, an imperative handle) there's\n * nothing for Motion to style, measure or attach gestures to. #2777\n */\n invariant(Boolean(instance.style), \"motion.create() components must forward their ref to a HTML or SVG element\", \"custom-component-ref\");\n super.mount(instance);\n }\n readValueFromInstance(instance, key) {\n if (transformProps.has(key)) {\n return this.projection?.isProjecting\n ? defaultTransformValue(key)\n : readTransformValue(instance, key);\n }\n else {\n const computedStyle = getComputedStyle(instance);\n const value = (isCSSVariableName(key)\n ? computedStyle.getPropertyValue(key)\n : computedStyle[key]) || 0;\n return typeof value === \"string\" ? value.trim() : value;\n }\n }\n measureInstanceViewportBox(instance, { transformPagePoint }) {\n return measureViewportBox(instance, transformPagePoint);\n }\n build(renderState, latestValues, props) {\n buildHTMLStyles(renderState, latestValues, props.transformTemplate);\n }\n scrapeMotionValuesFromProps(props, prevProps, visualElement) {\n return scrapeMotionValuesFromProps(props, prevProps, visualElement);\n }\n}\n\nexport { HTMLVisualElement, getComputedStyle };\n//# sourceMappingURL=HTMLVisualElement.mjs.map\n","import { convertBoundingBoxToBox, transformBoxPoints } from '../geometry/conversion.mjs';\nimport { translateAxis } from '../geometry/delta-apply.mjs';\n\nfunction measureViewportBox(instance, transformPoint) {\n return convertBoundingBoxToBox(transformBoxPoints(instance.getBoundingClientRect(), transformPoint));\n}\nfunction measurePageBox(element, rootProjectionNode, transformPagePoint) {\n const viewportBox = measureViewportBox(element, transformPagePoint);\n const { scroll } = rootProjectionNode;\n if (scroll) {\n translateAxis(viewportBox.x, scroll.offset.x);\n translateAxis(viewportBox.y, scroll.offset.y);\n }\n return viewportBox;\n}\n\nexport { measurePageBox, measureViewportBox };\n//# sourceMappingURL=measure.mjs.map\n","/**\n * Bounding boxes tend to be defined as top, left, right, bottom. For various operations\n * it's easier to consider each axis individually. This function returns a bounding box\n * as a map of single-axis min/max values.\n */\nfunction convertBoundingBoxToBox({ top, left, right, bottom, }) {\n return {\n x: { min: left, max: right },\n y: { min: top, max: bottom },\n };\n}\nfunction convertBoxToBoundingBox({ x, y }) {\n return { top: y.min, right: x.max, bottom: y.max, left: x.min };\n}\n/**\n * Applies a TransformPoint function to a bounding box. TransformPoint is usually a function\n * provided by Framer to allow measured points to be corrected for device scaling. This is used\n * when measuring DOM elements and DOM event points.\n */\nfunction transformBoxPoints(point, transformPoint) {\n if (!transformPoint)\n return point;\n const topLeft = transformPoint({ x: point.left, y: point.top });\n const bottomRight = transformPoint({ x: point.right, y: point.bottom });\n return {\n top: topLeft.y,\n left: topLeft.x,\n bottom: bottomRight.y,\n right: bottomRight.x,\n };\n}\n\nexport { convertBoundingBoxToBox, convertBoxToBoundingBox, transformBoxPoints };\n//# sourceMappingURL=conversion.mjs.map\n","import { createBox } from '../../projection/geometry/models.mjs';\nimport { VisualElement } from '../VisualElement.mjs';\n\nfunction isObjectKey(key, object) {\n return key in object;\n}\nclass ObjectVisualElement extends VisualElement {\n constructor() {\n super(...arguments);\n this.type = \"object\";\n }\n readValueFromInstance(instance, key) {\n if (isObjectKey(key, instance)) {\n const value = instance[key];\n if (typeof value === \"string\" || typeof value === \"number\") {\n return value;\n }\n }\n return undefined;\n }\n getBaseTargetFromProps() {\n return undefined;\n }\n removeValueFromRenderState(key, renderState) {\n delete renderState.output[key];\n }\n measureInstanceViewportBox() {\n return createBox();\n }\n build(renderState, latestValues) {\n Object.assign(renderState.output, latestValues);\n }\n renderInstance(instance, { output }) {\n Object.assign(instance, output);\n }\n sortInstanceNodePosition() {\n return 0;\n }\n}\n\nexport { ObjectVisualElement };\n//# sourceMappingURL=ObjectVisualElement.mjs.map\n","const dashKeys = {\n offset: \"stroke-dashoffset\",\n array: \"stroke-dasharray\",\n};\nconst camelKeys = {\n offset: \"strokeDashoffset\",\n array: \"strokeDasharray\",\n};\n/**\n * Build SVG path properties. Uses the path's measured length to convert\n * our custom pathLength, pathSpacing and pathOffset into stroke-dashoffset\n * and stroke-dasharray attributes.\n *\n * This function is mutative to reduce per-frame GC.\n *\n * Note: We use unitless values for stroke-dasharray and stroke-dashoffset\n * because Safari incorrectly scales px values when the page is zoomed.\n */\nfunction buildSVGPath(attrs, length, spacing = 1, offset = 0, useDashCase = true) {\n // Normalise path length by setting SVG attribute pathLength to 1\n attrs.pathLength = 1;\n // We use dash case when setting attributes directly to the DOM node and camel case\n // when defining props on a React component.\n const keys = useDashCase ? dashKeys : camelKeys;\n // Build the dash offset (unitless to avoid Safari zoom bug)\n attrs[keys.offset] = `${-offset}`;\n // Build the dash array (unitless to avoid Safari zoom bug)\n attrs[keys.array] = `${length} ${spacing}`;\n}\n\nexport { buildSVGPath };\n//# sourceMappingURL=path.mjs.map\n","import { buildHTMLStyles } from '../../html/utils/build-styles.mjs';\nimport { buildSVGPath } from './path.mjs';\n\nconst cssStyleProperties = [\n \"transform\",\n \"opacity\",\n \"offsetDistance\",\n \"offsetPath\",\n \"offsetRotate\",\n \"offsetAnchor\",\n];\n/**\n * Build SVG visual attributes, like cx and style.transform\n */\nfunction buildSVGAttrs(state, { attrX, attrY, attrScale, pathLength, pathSpacing = 1, pathOffset = 0, \n// This is object creation, which we try to avoid per-frame.\n...latest }, isSVGTag, transformTemplate, styleProp) {\n buildHTMLStyles(state, latest, transformTemplate);\n /**\n * For svg tags we just want to make sure viewBox is animatable and treat all the styles\n * as normal HTML tags.\n */\n if (isSVGTag) {\n if (state.style.viewBox) {\n state.attrs.viewBox = state.style.viewBox;\n }\n return;\n }\n state.attrs = state.style;\n state.style = {};\n const { attrs, style } = state;\n for (const key of cssStyleProperties) {\n if (attrs[key] !== undefined) {\n style[key] = attrs[key];\n delete attrs[key];\n }\n }\n if (style.transform || attrs.transformOrigin) {\n style.transformOrigin = attrs.transformOrigin ?? \"50% 50%\";\n delete attrs.transformOrigin;\n }\n if (style.transform) {\n /**\n * SVG's element transform-origin uses its own median as a reference.\n * Therefore, transformBox becomes a fill-box\n */\n style.transformBox = styleProp?.transformBox ?? \"fill-box\";\n delete attrs.transformBox;\n }\n // Render attrX/attrY/attrScale as attributes\n if (attrX !== undefined)\n attrs.x = attrX;\n if (attrY !== undefined)\n attrs.y = attrY;\n if (attrScale !== undefined)\n attrs.scale = attrScale;\n // Build SVG path if one has been defined\n if (pathLength !== undefined) {\n buildSVGPath(attrs, pathLength, pathSpacing, pathOffset, false);\n }\n}\n\nexport { buildSVGAttrs, cssStyleProperties };\n//# sourceMappingURL=build-attrs.mjs.map\n","/**\n * A set of attribute names that are always read/written as camel case.\n */\nconst camelCaseAttributes = new Set([\n \"baseFrequency\",\n \"diffuseConstant\",\n \"kernelMatrix\",\n \"kernelUnitLength\",\n \"keySplines\",\n \"keyTimes\",\n \"limitingConeAngle\",\n \"markerHeight\",\n \"markerWidth\",\n \"numOctaves\",\n \"targetX\",\n \"targetY\",\n \"surfaceScale\",\n \"specularConstant\",\n \"specularExponent\",\n \"stdDeviation\",\n \"tableValues\",\n \"viewBox\",\n \"gradientTransform\",\n \"pathLength\",\n \"startOffset\",\n \"textLength\",\n \"lengthAdjust\",\n]);\n\nexport { camelCaseAttributes };\n//# sourceMappingURL=camel-case-attrs.mjs.map\n","import { transformProps } from '../utils/keys-transform.mjs';\nimport { getDefaultValueType } from '../../value/types/maps/defaults.mjs';\nimport { createBox } from '../../projection/geometry/models.mjs';\nimport { DOMVisualElement } from '../dom/DOMVisualElement.mjs';\nimport { camelToDash } from '../dom/utils/camel-to-dash.mjs';\nimport { cssStyleProperties, buildSVGAttrs } from './utils/build-attrs.mjs';\nimport { camelCaseAttributes } from './utils/camel-case-attrs.mjs';\nimport { isSVGTag } from './utils/is-svg-tag.mjs';\nimport { renderSVG } from './utils/render.mjs';\nimport { scrapeMotionValuesFromProps } from './utils/scrape-motion-values.mjs';\n\nclass SVGVisualElement extends DOMVisualElement {\n constructor() {\n super(...arguments);\n this.type = \"svg\";\n this.isSVGTag = false;\n this.measureInstanceViewportBox = createBox;\n }\n getBaseTargetFromProps(props, key) {\n return props[key];\n }\n readValueFromInstance(instance, key) {\n if (transformProps.has(key)) {\n const defaultType = getDefaultValueType(key);\n return defaultType ? defaultType.default || 0 : 0;\n }\n if (cssStyleProperties.includes(key)) {\n const computedStyle = getComputedStyle(instance);\n const value = computedStyle[key];\n if (typeof value === \"string\" && value)\n return value.trim();\n }\n key = !camelCaseAttributes.has(key) ? camelToDash(key) : key;\n return instance.getAttribute(key);\n }\n scrapeMotionValuesFromProps(props, prevProps, visualElement) {\n return scrapeMotionValuesFromProps(props, prevProps, visualElement);\n }\n build(renderState, latestValues, props) {\n buildSVGAttrs(renderState, latestValues, this.isSVGTag, props.transformTemplate, props.style);\n }\n renderInstance(instance, renderState, styleProp, projection) {\n renderSVG(instance, renderState, styleProp, projection);\n }\n mount(instance) {\n this.isSVGTag = isSVGTag(instance.tagName);\n super.mount(instance);\n }\n}\n\nexport { SVGVisualElement };\n//# sourceMappingURL=SVGVisualElement.mjs.map\n","import { isMotionValue } from '../../../value/utils/is-motion-value.mjs';\nimport { transformPropOrder } from '../../utils/keys-transform.mjs';\nimport { scrapeMotionValuesFromProps as scrapeMotionValuesFromProps$1 } from '../../html/utils/scrape-motion-values.mjs';\n\nfunction scrapeMotionValuesFromProps(props, prevProps, visualElement) {\n const newValues = scrapeMotionValuesFromProps$1(props, prevProps, visualElement);\n for (const key in props) {\n if (isMotionValue(props[key]) ||\n isMotionValue(prevProps[key])) {\n const targetKey = transformPropOrder.indexOf(key) !== -1\n ? \"attr\" + key.charAt(0).toUpperCase() + key.substring(1)\n : key;\n newValues[targetKey] = props[key];\n }\n }\n return newValues;\n}\n\nexport { scrapeMotionValuesFromProps };\n//# sourceMappingURL=scrape-motion-values.mjs.map\n","import { camelToDash } from '../../dom/utils/camel-to-dash.mjs';\nimport { renderHTML } from '../../html/utils/render.mjs';\nimport { camelCaseAttributes } from './camel-case-attrs.mjs';\n\nfunction renderSVG(element, renderState, _styleProp, projection) {\n renderHTML(element, renderState, undefined, projection);\n for (const key in renderState.attrs) {\n element.setAttribute(!camelCaseAttributes.has(key) ? camelToDash(key) : key, renderState.attrs[key]);\n }\n}\n\nexport { renderSVG };\n//# sourceMappingURL=render.mjs.map\n","const isSVGTag = (tag) => typeof tag === \"string\" && tag.toLowerCase() === \"svg\";\n\nexport { isSVGTag };\n//# sourceMappingURL=is-svg-tag.mjs.map\n","export function isDOMKeyframes(keyframes) {\n return typeof keyframes === \"object\" && !Array.isArray(keyframes);\n}\n//# sourceMappingURL=is-dom-keyframes.js.map","import { resolveElements, } from \"motion-dom\";\nimport { isDOMKeyframes } from \"../utils/is-dom-keyframes\";\nexport function resolveSubjects(subject, keyframes, scope, selectorCache) {\n if (subject == null) {\n return [];\n }\n if (typeof subject === \"string\" && isDOMKeyframes(keyframes)) {\n return resolveElements(subject, scope, selectorCache);\n }\n else if (subject instanceof NodeList) {\n return Array.from(subject);\n }\n else if (Array.isArray(subject)) {\n return subject.filter((s) => s != null);\n }\n else {\n return [subject];\n }\n}\n//# sourceMappingURL=resolve-subjects.js.map","function resolveElements(elementOrSelector, scope, selectorCache) {\n if (elementOrSelector == null) {\n return [];\n }\n if (elementOrSelector instanceof EventTarget) {\n return [elementOrSelector];\n }\n else if (typeof elementOrSelector === \"string\") {\n let root = document;\n if (scope) {\n root = scope.current;\n }\n const elements = selectorCache?.[elementOrSelector] ??\n root.querySelectorAll(elementOrSelector);\n return elements ? Array.from(elements) : [];\n }\n return Array.from(elementOrSelector).filter((element) => element != null);\n}\n\nexport { resolveElements };\n//# sourceMappingURL=resolve-elements.mjs.map\n","export function calculateRepeatDuration(duration, repeat, repeatDelay) {\n return duration * (repeat + 1) + repeatDelay * repeat;\n}\n//# sourceMappingURL=calc-repeat-duration.js.map","/**\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(current, next, prev, labels) {\n if (typeof next === \"number\") {\n return next;\n }\n else if (next.startsWith(\"-\") || next.startsWith(\"+\")) {\n return Math.max(0, current + parseFloat(next));\n }\n else if (next === \"<\") {\n return prev;\n }\n else if (next.startsWith(\"<\")) {\n return Math.max(0, prev + parseFloat(next.slice(1)));\n }\n else {\n return labels.get(next) ?? current;\n }\n}\n//# sourceMappingURL=calc-time.js.map","import { mixNumber } from \"motion-dom\";\nimport { getEasingForSegment, removeItem } from \"motion-utils\";\nexport function eraseKeyframes(sequence, startTime, endTime) {\n for (let i = 0; i < sequence.length; i++) {\n const keyframe = sequence[i];\n if (keyframe.at > startTime && keyframe.at < endTime) {\n removeItem(sequence, keyframe);\n // If we remove this item we have to push the pointer back one\n i--;\n }\n }\n}\nexport function addKeyframes(sequence, keyframes, easing, offset, startTime, endTime) {\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 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//# sourceMappingURL=edit.js.map","/**\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(times, repeat, repeatDelayUnits = 0) {\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//# sourceMappingURL=normalize-times.js.map","export function compareByTime(a, b) {\n if (a.at === b.at) {\n if (a.value === null)\n return 1;\n if (b.value === null)\n return -1;\n return 0;\n }\n else {\n return a.at - b.at;\n }\n}\n//# sourceMappingURL=sort.js.map","import { createGeneratorEasing, defaultOffset, fillOffset, isGenerator, isMotionValue, } from \"motion-dom\";\nimport { getEasingForSegment, progress, reverseEasing, secondsToMilliseconds, warning, } from \"motion-utils\";\nimport { resolveSubjects } from \"../animate/resolve-subjects\";\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\";\nconst defaultSegmentEasing = \"easeInOut\";\nconst MAX_REPEAT = 20;\nexport function createAnimationsFromSequence(sequence, { defaultTransition = {}, ...sequenceTransition } = {}, scope, generators) {\n const defaultDuration = defaultTransition.duration || 0.3;\n const animationDefinitions = new Map();\n const sequences = new Map();\n const elementCache = {};\n const timeLabels = new Map();\n let prevTime = 0;\n let currentTime = 0;\n let totalDuration = 0;\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 * 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 }\n else if (!Array.isArray(segment)) {\n timeLabels.set(segment.name, calcNextTime(currentTime, segment.at, prevTime, timeLabels));\n continue;\n }\n let [subject, keyframes, transition = {}] = segment;\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(currentTime, transition.at, prevTime, timeLabels);\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 const resolveValueSequence = (valueKeyframes, valueTransition, valueSequence, elementIndex = 0, numSubjects = 0) => {\n const valueKeyframesAsList = keyframesAsList(valueKeyframes);\n const { delay = 0, times = defaultOffset(valueKeyframesAsList), type = defaultTransition.type || \"keyframes\", repeat, repeatType, repeatDelay = 0, ...remainingTransition } = valueTransition;\n let { ease = defaultTransition.ease || \"easeOut\", duration } = valueTransition;\n /**\n * Resolve stagger() if defined.\n */\n const calculatedDelay = typeof delay === \"function\"\n ? delay(elementIndex, numSubjects)\n : delay;\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 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 (numKeyframes === 2 &&\n isNumberKeyframesArray(valueKeyframesAsList)) {\n const delta = valueKeyframesAsList[1] - valueKeyframesAsList[0];\n absoluteDelta = Math.abs(delta);\n }\n const springTransition = {\n ...defaultTransition,\n ...remainingTransition,\n };\n if (duration !== undefined) {\n springTransition.duration = secondsToMilliseconds(duration);\n }\n const springEasing = createGeneratorEasing(springTransition, absoluteDelta, createGenerator);\n ease = springEasing.ease;\n duration = springEasing.duration;\n }\n duration ?? (duration = defaultDuration);\n const startTime = currentTime + calculatedDelay;\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 * 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 * 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 * 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(repeat < MAX_REPEAT, `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 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 = duration > 0 ? repeatDelay / duration : 0;\n duration = calculateRepeatDuration(duration, repeat, repeatDelay);\n const originalKeyframes = [...valueKeyframesAsList];\n const originalTimes = [...times];\n ease = Array.isArray(ease) ? [...ease] : [ease];\n const originalEase = [...ease];\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 = 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) => typeof e === \"function\"\n ? reverseEasing(e)\n : e);\n }\n }\n for (let repeatIndex = 0; repeatIndex < repeat; repeatIndex++) {\n const isFlipped = isFlipping && repeatIndex % 2 === 0;\n const iterKeyframes = isFlipped\n ? flippedKeyframes\n : originalKeyframes;\n const iterEase = isFlipped ? flippedEases : originalEase;\n const iterStartOffset = (repeatIndex + 1) * (1 + repeatDelayUnits);\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(valueKeyframesAsList[valueKeyframesAsList.length - 1]);\n times.push(iterStartOffset);\n ease.push(\"linear\");\n }\n valueKeyframesAsList.push(...iterKeyframes);\n for (let keyframeIndex = 0; keyframeIndex < iterKeyframes.length; keyframeIndex++) {\n times.push(originalTimes[keyframeIndex] + iterStartOffset);\n ease.push(keyframeIndex === 0\n ? \"linear\"\n : getEasingForSegment(iterEase, keyframeIndex - 1));\n }\n }\n normalizeTimes(times, repeat, repeatDelayUnits);\n }\n const targetTime = startTime + duration;\n /**\n * Add keyframes, mapping offsets to absolute time.\n */\n addKeyframes(valueSequence, valueKeyframesAsList, ease, times, startTime, targetTime);\n maxDuration = Math.max(calculatedDelay + duration, maxDuration);\n totalDuration = Math.max(targetTime, totalDuration);\n };\n if (isMotionValue(subject)) {\n const subjectSequence = getSubjectSequence(subject, sequences);\n resolveValueSequence(keyframes, transition, getValueSequence(\"default\", subjectSequence));\n }\n else {\n const subjects = resolveSubjects(subject, keyframes, scope, elementCache);\n const numSubjects = subjects.length;\n /**\n * For every element in this segment, process the defined values.\n */\n for (let subjectIndex = 0; subjectIndex < numSubjects; subjectIndex++) {\n /**\n * Cast necessary, but we know these are of this type\n */\n keyframes = keyframes;\n transition = transition;\n const thisSubject = subjects[subjectIndex];\n const subjectSequence = getSubjectSequence(thisSubject, sequences);\n for (const key in keyframes) {\n resolveValueSequence(keyframes[key], getValueTransition(transition, key), getValueSequence(key, subjectSequence), subjectIndex, numSubjects);\n }\n }\n }\n prevTime = currentTime;\n currentTime += maxDuration;\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 * Arrange all the keyframes in ascending time order.\n */\n valueSequence.sort(compareByTime);\n const keyframes = [];\n const valueOffset = [];\n const valueEasing = [];\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 * 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 * 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 if (!animationDefinitions.has(element)) {\n animationDefinitions.set(element, {\n keyframes: {},\n transition: {},\n });\n }\n const definition = animationDefinitions.get(element);\n definition.keyframes[key] = keyframes;\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 } = defaultTransition;\n definition.transition[key] = {\n ...remainingDefaultTransition,\n duration: totalDuration,\n ease: valueEasing,\n times: valueOffset,\n ...sequenceTransition,\n };\n }\n });\n return animationDefinitions;\n}\nfunction getSubjectSequence(subject, sequences) {\n !sequences.has(subject) && sequences.set(subject, {});\n return sequences.get(subject);\n}\nfunction getValueSequence(name, sequences) {\n if (!sequences[name])\n sequences[name] = [];\n return sequences[name];\n}\nfunction keyframesAsList(keyframes) {\n return Array.isArray(keyframes) ? keyframes : [keyframes];\n}\nexport function getValueTransition(transition, key) {\n return transition && transition[key]\n ? {\n ...transition,\n ...transition[key],\n }\n : { ...transition };\n}\nconst isNumber = (keyframe) => typeof keyframe === \"number\";\nconst isNumberKeyframesArray = (keyframes) => keyframes.every(isNumber);\n//# sourceMappingURL=create.js.map","import { HTMLVisualElement, isSVGElement, isSVGSVGElement, ObjectVisualElement, SVGVisualElement, visualElementStore, } from \"motion-dom\";\nexport function createDOMVisualElement(element) {\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 = isSVGElement(element) && !isSVGSVGElement(element)\n ? new SVGVisualElement(options)\n : new HTMLVisualElement(options);\n node.mount(element);\n visualElementStore.set(element, node);\n}\nexport function createObjectVisualElement(subject) {\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 node.mount(subject);\n visualElementStore.set(subject, node);\n}\n//# sourceMappingURL=create-visual-element.js.map","import { isSVGElement } from './is-svg-element.mjs';\n\n/**\n * Checks if an element is specifically an SVGSVGElement (the root SVG element)\n * in a way that works across iframes\n */\nfunction isSVGSVGElement(element) {\n return isSVGElement(element) && element.tagName === \"svg\";\n}\n\nexport { isSVGSVGElement };\n//# sourceMappingURL=is-svg-svg-element.mjs.map\n","import { animateTarget, isMotionValue, visualElementStore, } from \"motion-dom\";\nimport { invariant } from \"motion-utils\";\nimport { createDOMVisualElement, createObjectVisualElement, } from \"../utils/create-visual-element\";\nimport { isDOMKeyframes } from \"../utils/is-dom-keyframes\";\nimport { resolveSubjects } from \"./resolve-subjects\";\nimport { animateSingleValue } from \"motion-dom\";\nfunction isSingleValue(subject, keyframes) {\n return (isMotionValue(subject) ||\n typeof subject === \"number\" ||\n (typeof subject === \"string\" && !isDOMKeyframes(keyframes)));\n}\n/**\n * Implementation\n */\nexport function animateSubject(subject, keyframes, options, scope) {\n const animations = [];\n if (isSingleValue(subject, keyframes)) {\n animations.push(animateSingleValue(subject, isDOMKeyframes(keyframes)\n ? keyframes.default || keyframes\n : keyframes, options ? options.default || options : options));\n }\n else {\n // Gracefully handle null/undefined subjects (e.g., from querySelector returning null)\n if (subject == null) {\n return animations;\n }\n const subjects = resolveSubjects(subject, keyframes, scope);\n const numSubjects = subjects.length;\n invariant(Boolean(numSubjects), \"No valid elements provided.\", \"no-valid-elements\");\n for (let i = 0; i < numSubjects; i++) {\n const thisSubject = subjects[i];\n const createVisualElement = thisSubject instanceof Element\n ? createDOMVisualElement\n : createObjectVisualElement;\n if (!visualElementStore.has(thisSubject)) {\n createVisualElement(thisSubject);\n }\n const visualElement = visualElementStore.get(thisSubject);\n const transition = { ...options };\n /**\n * Resolve stagger function if provided.\n */\n if (\"delay\" in transition &&\n typeof transition.delay === \"function\") {\n transition.delay = transition.delay(i, numSubjects);\n }\n animations.push(...animateTarget(visualElement, { ...keyframes, transition }, {}));\n }\n }\n return animations;\n}\n//# sourceMappingURL=subject.js.map","import { animateMotionValue } from '../interfaces/motion-value.mjs';\nimport { motionValue } from '../../value/index.mjs';\nimport { isMotionValue } from '../../value/utils/is-motion-value.mjs';\n\nfunction animateSingleValue(value, keyframes, options) {\n const motionValue$1 = isMotionValue(value) ? value : motionValue(value);\n motionValue$1.start(animateMotionValue(\"\", motionValue$1, keyframes, options));\n return motionValue$1.animation;\n}\n\nexport { animateSingleValue };\n//# sourceMappingURL=single-value.mjs.map\n","import { motionValue, spring, } from \"motion-dom\";\nimport { createAnimationsFromSequence } from \"../sequence/create\";\nimport { animateSubject } from \"./subject\";\nexport function animateSequence(sequence, options, scope) {\n const animations = [];\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];\n const mv = motionValue(0);\n mv.on(\"change\", callback);\n if (segment.length === 1) {\n return [mv, [0, 1]];\n }\n else if (segment.length === 2) {\n return [mv, [0, 1], segment[1]];\n }\n else {\n return [mv, segment[1], segment[2]];\n }\n }\n return segment;\n });\n const animationDefinitions = createAnimationsFromSequence(processedSequence, options, scope, { spring });\n animationDefinitions.forEach(({ keyframes, transition }, subject) => {\n animations.push(...animateSubject(subject, keyframes, transition));\n });\n return animations;\n}\n//# sourceMappingURL=sequence.js.map","import { GroupAnimationWithThen } from \"motion-dom\";\nimport { removeItem } from \"motion-utils\";\nimport { animateSequence } from \"./sequence\";\nimport { animateSubject } from \"./subject\";\nfunction isSequence(value) {\n return Array.isArray(value) && value.some(Array.isArray);\n}\n/**\n * Creates an animation function that is optionally scoped\n * to a specific element.\n */\nexport function createScopedAnimate(options = {}) {\n const { scope, reduceMotion, skipAnimations } = options;\n /**\n * Implementation\n */\n function scopedAnimate(subjectOrSequence, optionsOrKeyframes, options) {\n let animations = [];\n let animationOnComplete;\n const inherited = {};\n if (reduceMotion !== undefined)\n inherited.reduceMotion = reduceMotion;\n if (skipAnimations !== undefined)\n inherited.skipAnimations = skipAnimations;\n if (isSequence(subjectOrSequence)) {\n const { onComplete, ...sequenceOptions } = optionsOrKeyframes || {};\n if (typeof onComplete === \"function\") {\n animationOnComplete = onComplete;\n }\n animations = animateSequence(subjectOrSequence, { ...inherited, ...sequenceOptions }, 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;\n }\n animations = animateSubject(subjectOrSequence, optionsOrKeyframes, { ...inherited, ...rest }, scope);\n }\n const animation = new GroupAnimationWithThen(animations);\n if (animationOnComplete) {\n animation.finished.then(animationOnComplete);\n }\n if (scope) {\n scope.animations.push(animation);\n animation.finished.then(() => {\n removeItem(scope.animations, animation);\n });\n }\n return animation;\n }\n return scopedAnimate;\n}\nexport const animate = createScopedAnimate();\n//# sourceMappingURL=index.js.map"],"names":["removeItem","arr","item","index","indexOf","splice","clamp","min","max","v","formatErrorMessage","message","errorCode","warning","invariant","process","env","NODE_ENV","check","console","warn","Error","MotionGlobalConfig","isNumericalString","test","isZeroValueString","memo","callback","result","undefined","noop","any","pipe","transformers","reduce","a","b","progress","from","to","value","range","SubscriptionManager","constructor","this","subscriptions","add","handler","push","notify","c","numSubscriptions","length","i","getSize","clear","secondsToMilliseconds","seconds","millisecondsToSeconds","milliseconds","velocityPerSecond","velocity","frameDuration","calcBezier","t","a1","a2","cubicBezier","mX1","mY1","mX2","mY2","getTForX","aX","x","lowerBound","upperBound","currentX","currentT","Math","abs","binarySubdivide","mirrorEasing","easing","p","reverseEasing","backOut","backIn","backInOut","anticipate","pow","circIn","sin","acos","circOut","circInOut","easeIn","easeOut","easeInOut","isEasingArray","ease","Array","isArray","getEasingForSegment","rangeSize","wrap","isBezierDefinition","easingLookup","linear","easingDefinitionToFunction","definition","x1","y1","x2","y2","stepsOrder","createRenderBatcher","scheduleNextBatch","allowKeepAlive","runNextFrame","useDefaultElapsed","state","delta","timestamp","isProcessing","flagRunNextFrame","steps","acc","key","thisFrame","Set","nextFrame","flushNextFrame","toKeepAlive","WeakSet","latestFrameData","triggerCallback","has","step","schedule","keepAlive","immediate","queue","cancel","delete","frameData","prevFrame","forEach","createRenderStep","setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender","processBatch","useManualTiming","performance","now","frame","cancelFrame","requestAnimationFrame","clearTime","time","set","newTime","queueMicrotask","checkStringStartsWith","token","startsWith","isCSSVariableName","startsAsVariableToken","isCSSVariableToken","singleCssVariableRegex","split","trim","containsCSSVariable","includes","number","parse","parseFloat","transform","alpha","scale","default","sanitize","round","floatRegex","singleColorRegex","isColorString","type","testProp","Boolean","isNullish","Object","prototype","hasOwnProperty","call","splitColor","aName","bName","cName","match","rgbUnit","clampRgbUnit","rgba","red","green","blue","alpha$1","hex","r","g","substring","parseInt","createUnitType","unit","endsWith","degrees","percent","px","vh","vw","progressPercentage","hsla","hue","saturation","lightness","color","getAnimatableNone","parsed","colorRegex","NUMBER_TOKEN","COLOR_TOKEN","complexRegex","analyseComplexValue","originalValue","toString","values","indexes","var","types","replace","parsedValue","buildTransformer","numSections","output","convertToZero","splitBefore","complex","isNaN","createTransformer","source","info","transformer","map","hueToRgb","q","mixImmediate","mixNumber","mixLinearColor","fromExpo","expo","sqrt","colorTypes","asRGBA","find","model","hslaToRgba","mixColor","fromRGBA","toRGBA","blended","invisibleValues","mixNumber$1","getMixer","mixComplex","mixArray","mixObject","numValues","blendValue","origin","target","template","originStats","targetStats","mixVisibility","orderedOrigin","pointers","originIndex","originValue","matchOrder","mix","mixer","frameloopDriver","passTimestamp","start","stop","generateLinearEasing","duration","resolution","points","numPoints","maxGeneratorDuration","calcGeneratorDuration","generator","next","done","Infinity","createGeneratorEasing","options","createGenerator","keyframes","springDefaults","granular","calcAngularFreq","undampedFreq","dampingRatio","safeMin","durationKeys","physicsKeys","isSpringType","keys","some","getSpringOptions","springOptions","stiffness","damping","mass","isResolvedFromDuration","visualDuration","root","PI","bounce","derived","envelope","derivative","exponentialDecay","exp","d","e","f","initialGuess","approximateRoot","findSpring","spring","optionsOrVisualDuration","restSpeed","restDelta","initialVelocity","initialDelta","undampedAngularFreq","isGranularScale","resolveSpring","resolveVelocity","angularFreq","A","sinCoeff","cosCoeff","cos","C","dampedAngularFreq","freqForT","sinh","cosh","P","sinhCoeff","coshCoeff","calculatedDuration","current","currentVelocity","toTransition","applyToOptions","generatorOptions","getGeneratorVelocity","resolveValue","prevT","inertia","power","timeConstant","bounceDamping","bounceStiffness","modifyTarget","nearestBoundary","amplitude","ideal","calcDelta","calcLatest","applyFriction","latest","timeReachedBoundary","spring$1","checkCatchBoundary","hasUpdatedFrame","interpolate","input","isClamp","inputLength","isZeroDeltaRange","reverse","mixers","customMixer","mixerFactory","numMixers","easingFunction","createMixers","interpolator","progressInRange","fillOffset","offset","remaining","offsetProgress","defaultOffset","keyframeValues","times","easingFunctions","absoluteTimes","o","convertOffsetToTimes","mapTimeToKeyframe","isNotNull","getFinalKeyframe","repeat","repeatType","finalKeyframe","speed","resolvedKeyframes","filter","transitionTypeMap","decay","tween","replaceTransitionType","transition","WithPromise","updateFinished","finished","_finished","Promise","resolve","notifyFinished","then","onResolve","onReject","percentToProgress","JSAnimation","super","startTime","isStopped","currentTime","holdTime","playbackSpeed","delayState","motionValue","updatedAt","tick","teardown","onStop","initAnimation","play","autoplay","pause","repeatDelay","keyframes$1","generatorFactory","mixKeyframes","mirroredGenerator","resolvedDuration","totalDuration","updateTime","animationTime","sample","delay","onUpdate","timeWithoutDelay","isInDelayPhase","elapsed","frameGenerator","currentIteration","floor","iterationProgress","isAnimationFinished","finish","reject","iterationDuration","driver","s","newSpeed","hasChanged","onPlay","complete","onComplete","onCancel","stopDriver","sampleTime","attachTimeline","timeline","allowFlatten","observe","radToDeg","rad","rotate","angle","atan2","rebaseAngle","matrix2dParsers","y","translateX","translateY","scaleX","scaleY","rotateZ","skewX","atan","skewY","skew","matrix3dParsers","z","translateZ","rotateX","rotateY","defaultTransformValue","name","parseValueFromTransform","matrix3dMatch","parsers","matrix2dMatch","valueParser","convertTransformToNumber","transformPropOrder","transformProps","isNumOrPxType","transformKeys","nonTranslationalTransformKeys","positionalValues","width","paddingLeft","paddingRight","boxSizing","height","paddingTop","paddingBottom","top","_bbox","left","bottom","right","toResolve","isScheduled","anyNeedsMeasurement","isForced","measureAllKeyframes","resolversToMeasure","resolver","needsMeasurement","elementsToMeasure","element","transformsToRestore","Map","removedTransforms","visualElement","getValue","get","removeNonTranslationalTransform","measureInitialState","restore","measureEndState","suspendedScrollY","window","scrollTo","readAllKeyframes","readKeyframes","KeyframeResolver","unresolvedKeyframes","isAsync","scheduleResolve","currentValue","valueAsRead","readValue","fillWildcards","setFinalKeyframe","renderEndStyles","isForcedComplete","resume","setStyle","isCSSVar","style","setProperty","supportsFlags","memoSupports","supportsFlag","memoized","supportsScrollTimeline","ScrollTimeline","supportsLinearEasing","document","createElement","animate","opacity","cubicBezierAsString","supportedWaapiEasing","mapEasingToNativeEasing","segmentEasing","startWaapiAnimation","valueName","pseudoElement","keyframeOptions","fill","iterations","direction","isGenerator","NativeAnimation","finishedTime","manualStartTime","isPseudoElement","applyGeneratorOptions","animation","onfinish","keyframe","updateMotionValue","commitStyles","isConnected","effect","getComputedTiming","Number","wasFinished","playbackRate","playState","newStartTime","rangeStart","rangeEnd","updateTiming","unsupportedEasingFunctions","replaceStringEasing","NativeAnimationExtended","sampleAnimation","setWithVelocity","isAnimatable","makeAnimationInstant","acceleratedValues","browserColorFunctions","colorProperties","supportsWaapi","Element","supportsBrowserAnimation","subject","owner","HTMLElement","SVGElement","transformTemplate","getProps","hasBrowserOnlyColors","AsyncMotionValueAnimation","_animation","stopTimeline","keyframeResolver","createdAt","optionsWithDefaults","KeyframeResolver$1","forced","onKeyframesResolved","sync","isHandoff","resolvedAt","canAnimateValue","originKeyframe","targetKeyframe","isOriginAnimatable","isTargetAnimatable","hasKeyframesChanged","canAnimate","instantAnimations","resolvedOptions","useWaapi","catch","pendingTimeline","_onReject","finally","GroupAnimation","animations","runAll","all","getAll","propName","setAll","newValue","getMax","methodName","controls","GroupAnimationWithThen","MotionValue","init","canTrackVelocity","events","updateAndNotify","setPrevFrameValue","prev","setCurrent","change","dependents","dependent","dirty","hasAnimated","prevFrameValue","prevUpdatedAt","onChange","subscription","on","eventName","unsubscribe","clearListeners","eventManagers","attach","passiveEffect","stopPassiveEffect","jump","endAnimation","addDependent","removeDependent","getPrevious","getVelocity","startAnimation","animationStart","animationComplete","clearAnimation","animationCancel","isAnimating","destroy","resolveTransition","parentTransition","inherit","_","rest","getValueTransition","valueTransition","underDampedSpring","keyframesTransition","getDefaultTransition","valueKey","orchestrationKeys","animateMotionValue","isTransitionDefined","assign","shouldSkip","skipAnimations","shouldSkipAnimations","isSync","splitCSSVariableRegex","getVariableValue","depth","fallback","exec","token1","token2","parseCSSVariable","resolved","getComputedStyle","getPropertyValue","trimmed","getValueState","resolveVariantFromProps","props","custom","variants","positionalKeys","setMotionValue","hasValue","addValue","resolveFinalValueInKeyframes","isKeyframesTarget","setTarget","resolveVariant","transitionEnd","isMotionValue","addValueToWillChange","willChange","WillChange","newWillChange","camelToDash","str","toLowerCase","optimizedAppearDataAttribute","getOptimisedAppearId","shouldBlockAnimation","protectedKeys","needsAnimating","shouldBlock","animateTarget","targetAndTransition","transitionOverride","defaultTransition","reduceMotion","animationTypeState","animationState","getState","path","animateVisualElement","latestValues","valueTarget","MotionHandoffAnimation","appearId","shouldReduceMotion","applyTransitionEnd","testValueType","dimensionValueTypes","findDimensionValueType","isNone","maxDefaults","applyDefaultFilter","slice","defaultValue","functionRegex","functions","join","mask","int","numberValueTypes","borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","maxWidth","maxHeight","inset","insetBlock","insetBlockStart","insetBlockEnd","insetInline","insetInlineStart","insetInlineEnd","padding","paddingBlock","paddingBlockStart","paddingBlockEnd","paddingInline","paddingInlineStart","paddingInlineEnd","margin","marginTop","marginRight","marginBottom","marginLeft","marginBlock","marginBlockStart","marginBlockEnd","marginInline","marginInlineStart","marginInlineEnd","fontSize","backgroundPositionX","backgroundPositionY","pathRotation","scaleZ","distance","perspective","transformPerspective","originX","originY","originZ","zIndex","fillOpacity","strokeOpacity","numOctaves","defaultValueTypes","backgroundColor","outlineColor","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","WebkitFilter","WebkitMask","getDefaultValueType","customTypes","defaultValueType","invalidTemplates","DOMKeyframesResolver","resolveNoneKeyframes","originType","targetType","noneKeyframeIndexes","animatableTemplate","noneIndex","makeNoneKeyframesAnimatable","pageYOffset","measuredOrigin","measureViewportBox","measureKeyframe","finalKeyframeIndex","unsetTransformName","unsetTransformValue","getValueAsType","microtask","isSVGElement","valueTypes","createBox","visualElementStore","WeakMap","variantProps","isControllingVariants","isVariantLabel","prefersReducedMotion","hasReducedMotionListener","isBrowser","propEventHandlers","featureDefinitions","VisualElement","scrapeMotionValuesFromProps","_props","_prevProps","_visualElement","parent","presenceContext","reducedMotionConfig","blockInitialAnimation","visualState","children","isVariantNode","features","valueSubscriptions","prevMotionValues","hasBeenMounted","propEventSubscriptions","notifyUpdate","triggerBuild","renderInstance","renderState","projection","renderScheduledAt","scheduleRender","baseTarget","initialValues","initial","skipAnimationsConfig","variantChildren","manuallyAnimateOnMount","initialMotionValues","mount","instance","removeFromVariantTree","addVariantChild","bindToMotionValue","matchMedia","motionMediaQuery","setReducedMotionPreferences","matches","addEventListener","initPrefersReducedMotion","addChild","unmount","remove","removeChild","feature","isMounted","child","enteringChildren","accelerate","factory","cleanup","valueIsTransform","onBindTransform","removeOnChange","latestValue","isTransformDirty","removeSyncCheck","MotionCheckAppearSync","sortNodePosition","other","sortInstanceNodePosition","updateFeatures","featureDefinition","isEnabled","Feature","FeatureConstructor","build","measureInstanceViewportBox","getStaticValue","setStaticValue","prevProps","prevPresenceContext","listener","nextValue","prevValue","existingValue","liveStyle","removeValue","updateMotionValuesFromProps","handleChildMotionValue","getVariant","getTransformPagePoint","transformPagePoint","getClosestVariantNode","closestVariantNode","removeValueFromRenderState","getBaseTargetFromProps","readValueFromInstance","setBaseTarget","getBaseTarget","valueFromInitial","variant","args","scheduleRenderMicrotask","DOMVisualElement","arguments","compareDocumentPosition","vars","childSubscription","textContent","translateAlias","numTransforms","buildHTMLStyles","transformOrigin","hasTransform","hasTransformOrigin","valueAsType","transformString","transformIsDefault","valueIsDefault","buildTransform","renderHTML","styleProp","elementStyle","applyProjectionStyles","pixelsToPercent","pixels","axis","correctBorderRadius","correct","node","correctBoxShadow","treeScale","projectionDelta","original","shadow","xScale","yScale","averageScale","scaleCorrectors","applyTo","boxShadow","isForcedMotionValue","layout","layoutId","prevStyle","newValues","HTMLVisualElement","isProjecting","readTransformValue","computedStyle","transformPoint","convertBoundingBoxToBox","point","topLeft","bottomRight","transformBoxPoints","getBoundingClientRect","ObjectVisualElement","object","isObjectKey","dashKeys","array","camelKeys","cssStyleProperties","buildSVGAttrs","attrX","attrY","attrScale","pathLength","pathSpacing","pathOffset","isSVGTag","viewBox","attrs","transformBox","spacing","useDashCase","buildSVGPath","camelCaseAttributes","SVGVisualElement","defaultType","getAttribute","scrapeMotionValuesFromProps$1","charAt","toUpperCase","_styleProp","setAttribute","renderSVG","tag","tagName","isDOMKeyframes","resolveSubjects","scope","selectorCache","elementOrSelector","EventTarget","elements","querySelectorAll","resolveElements","NodeList","calculateRepeatDuration","calcNextTime","labels","addKeyframes","sequence","endTime","at","eraseKeyframes","normalizeTimes","repeatDelayUnits","totalUnits","compareByTime","getSubjectSequence","sequences","getValueSequence","keyframesAsList","isNumber","isNumberKeyframesArray","every","createDOMVisualElement","isSVGSVGElement","createObjectVisualElement","animateSubject","isSingleValue","motionValue$1","animateSingleValue","subjects","numSubjects","thisSubject","createVisualElement","animateSequence","animationDefinitions","sequenceTransition","generators","defaultDuration","elementCache","timeLabels","prevTime","segment","maxDuration","resolveValueSequence","valueKeyframes","valueSequence","elementIndex","valueKeyframesAsList","remainingTransition","calculatedDelay","numKeyframes","absoluteDelta","springTransition","springEasing","remainder","unshift","originalKeyframes","originalTimes","originalEase","isFlipping","flippedKeyframes","flippedEases","repeatIndex","isFlipped","iterKeyframes","iterEase","iterStartOffset","keyframeIndex","targetTime","subjectIndex","subjectSequence","valueSequences","sort","valueOffset","valueEasing","_type","remainingDefaultTransition","createAnimationsFromSequence","mv","createScopedAnimate","subjectOrSequence","optionsOrKeyframes","animationOnComplete","inherited","sequenceOptions"],"mappings":"AAIA,SAASA,EAAWC,EAAKC,GACrB,MAAMC,EAAQF,EAAIG,QAAQF,GACtBC,GAAQ,GACRF,EAAII,OAAOF,EAAO,EAC1B,CCRA,MAAMG,EAAQ,CAACC,EAAKC,EAAKC,IACjBA,EAAID,EACGA,EACPC,EAAIF,EACGA,EACJE,ECLX,SAASC,EAAmBC,EAASC,GACjC,OAAOA,EACD,GAAGD,2FAAiGC,IACp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oN,KACrDkC,EAAWxnB,QAAQ0jC,GAAepe,EAAS5U,EAAWwH,MAEnDsP,CACX,CCpBO,SAASwf,GAAoBx2B,EAAU,IAC1C,MAAMoxB,MAAEA,EAAKpT,aAAEA,EAAY/C,eAAEA,GAAmBjb,EAuChD,OAnCA,SAAuBy2B,EAAmBC,EAAoB12B,GAC1D,IACI22B,EADA3f,EAAa,GAEjB,MAAM4f,EAAY,CAAA,EAKlB,QAJqBvoC,IAAjB2vB,IACA4Y,EAAU5Y,aAAeA,QACN3vB,IAAnB4sB,IACA2b,EAAU3b,eAAiBA,GAnBnBjsB,EAoBGynC,EAnBZ5jC,MAAMC,QAAQ9D,IAAUA,EAAM6R,KAAKhO,MAAMC,SAmBT,CAC/B,MAAMsY,WAAEA,KAAeyrB,GAAoBH,GAAsB,CAAA,EACvC,mBAAftrB,IACPurB,EAAsBvrB,GAE1B4L,EAAa0c,GAAgB+C,EAAmB,IAAKG,KAAcC,GAAmBzF,EAC1F,KACK,CAED,MAAMhmB,WAAEA,KAAeiP,GAASra,GAAW,CAAA,EACjB,mBAAfoL,IACPurB,EAAsBvrB,GAE1B4L,EAAakc,GAAeuD,EAAmBC,EAAoB,IAAKE,KAAcvc,GAAQ+W,EAClG,CAlCR,IAAoBpiC,EAmCZ,MAAMikB,EAAY,IAAIyE,GAAuBV,GAU7C,OATI2f,GACA1jB,EAAUpL,SAASK,KAAKyuB,GAExBvF,IACAA,EAAMpa,WAAWxnB,KAAKyjB,GACtBA,EAAUpL,SAASK,KAAK,KACpB1b,EAAW4kC,EAAMpa,WAAY/D,MAG9BA,CACX,CAEJ,CACY,MAACnB,GAAU0kB"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/size-rollup-dom-animation-assets.js b/node_modules/framer-motion/dist/size-rollup-dom-animation-assets.js deleted file mode 100644 index febbd57..0000000 --- a/node_modules/framer-motion/dist/size-rollup-dom-animation-assets.js +++ /dev/null @@ -1 +0,0 @@ -const t=(t,e,s)=>s>e?e:s{},n=()=>{};"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(s=(t,s,n)=>{t||"undefined"==typeof console||console.warn(e(s,n))},n=(t,s,n)=>{if(!t)throw new Error(e(s,n))});const i={},r=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),a=t=>/^0[^.\s]+$/u.test(t);function o(t){let e;return()=>(void 0===e&&(e=t()),e)}const h=t=>t;class l{constructor(){this.subscriptions=[]}add(t){var e,s;return e=this.subscriptions,s=t,-1===e.indexOf(s)&&e.push(s),()=>function(t,e){const s=t.indexOf(e);s>-1&&t.splice(s,1)}(this.subscriptions,t)}notify(t,e,s){const n=this.subscriptions.length;if(n)if(1===n)this.subscriptions[0](t,e,s);else for(let i=0;i1e3*t,c=t=>t/1e3,d=(t,e)=>e?t*(1e3/e):0,p=t=>Array.isArray(t)&&"number"==typeof t[0],f=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function m(t,e){let s=!1,n=!0;const r={delta:0,timestamp:0,isProcessing:!1},a=()=>s=!0,o=f.reduce((t,e)=>(t[e]=function(t){let e=new Set,s=new Set,n=!1,i=!1;const r=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function o(e){r.has(e)&&(h.schedule(e),t()),e(a)}const h={schedule:(t,i=!1,a=!1)=>{const o=a&&n?e:s;return i&&r.add(t),o.add(t),t},cancel:t=>{s.delete(t),r.delete(t)},process:t=>{if(a=t,n)return void(i=!0);n=!0;const r=e;e=s,s=r,e.forEach(o),e.clear(),n=!1,i&&(i=!1,h.process(t))}};return h}(a),t),{}),{setup:h,read:l,resolveKeyframes:u,preUpdate:c,update:d,preRender:p,render:m,postRender:g}=o,v=()=>{const a=i.useManualTiming,o=a?r.timestamp:performance.now();s=!1,a||(r.delta=n?1e3/60:Math.max(Math.min(o-r.timestamp,40),1)),r.timestamp=o,r.isProcessing=!0,h.process(r),l.process(r),u.process(r),c.process(r),d.process(r),p.process(r),m.process(r),g.process(r),r.isProcessing=!1,s&&e&&(n=!1,t(v))};return{schedule:f.reduce((e,i)=>{const a=o[i];return e[i]=(e,i=!1,o=!1)=>(s||(s=!0,n=!0,r.isProcessing||t(v)),a.schedule(e,i,o)),e},{}),cancel:t=>{for(let e=0;e(void 0===b&&V.set(y.isProcessing||i.useManualTiming?y.timestamp:performance.now()),b),set:t=>{b=t,queueMicrotask(w)}},S=t=>e=>"string"==typeof e&&e.startsWith(t),M=S("--"),T=S("var(--"),A=t=>!!T(t)&&C.test(t.split("/*")[0].trim()),C=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function x(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const k={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},F={...k,transform:e=>t(0,1,e)},E={...k,default:1},R=t=>Math.round(1e5*t)/1e5,B=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const P=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,I=(t,e)=>s=>Boolean("string"==typeof s&&P.test(s)&&s.startsWith(t)||e&&!function(t){return null==t}(s)&&Object.prototype.hasOwnProperty.call(s,e)),N=(t,e,s)=>n=>{if("string"!=typeof n)return n;const[i,r,a,o]=n.match(B);return{[t]:parseFloat(i),[e]:parseFloat(r),[s]:parseFloat(a),alpha:void 0!==o?parseFloat(o):1}},O={...k,transform:e=>Math.round((e=>t(0,255,e))(e))},$={test:I("rgb","red"),parse:N("red","green","blue"),transform:({red:t,green:e,blue:s,alpha:n=1})=>"rgba("+O.transform(t)+", "+O.transform(e)+", "+O.transform(s)+", "+R(F.transform(n))+")"};const L={test:I("#"),parse:function(t){let e="",s="",n="",i="";return t.length>5?(e=t.substring(1,3),s=t.substring(3,5),n=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),s=t.substring(2,3),n=t.substring(3,4),i=t.substring(4,5),e+=e,s+=s,n+=n,i+=i),{red:parseInt(e,16),green:parseInt(s,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}},transform:$.transform},Y=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),W=Y("deg"),X=Y("%"),j=Y("px"),z=Y("vh"),K=Y("vw"),U=(()=>({...X,parse:t=>X.parse(t)/100,transform:t=>X.transform(100*t)}))(),Z={test:I("hsl","hue"),parse:N("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:s,alpha:n=1})=>"hsla("+Math.round(t)+", "+X.transform(R(e))+", "+X.transform(R(s))+", "+R(F.transform(n))+")"},D={test:t=>$.test(t)||L.test(t)||Z.test(t),parse:t=>$.test(t)?$.parse(t):Z.test(t)?Z.parse(t):L.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?$.transform(t):Z.transform(t),getAnimatableNone:t=>{const e=D.parse(t);return e.alpha=0,D.transform(e)}},q=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const H="number",_="color",G=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function J(t){const e=t.toString(),s=[],n={color:[],number:[],var:[]},i=[];let r=0;const a=e.replace(G,t=>(D.test(t)?(n.color.push(r),i.push(_),s.push(D.parse(t))):t.startsWith("var(")?(n.var.push(r),i.push("var"),s.push(t)):(n.number.push(r),i.push(H),s.push(parseFloat(t))),++r,"${}")).split("${}");return{values:s,split:a,indexes:n,types:i}}function Q({split:t,types:e}){const s=t.length;return n=>{let i="";for(let r=0;r{return"number"==typeof t?e?.trim().endsWith("/")?t:0:"number"==typeof(s=t)?0:D.test(s)?D.getAnimatableNone(s):s;var s};const et={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(B)?.length||0)+(t.match(q)?.length||0)>0},parse:function(t){return J(t).values},createTransformer:function(t){return Q(J(t))},getAnimatableNone:function(t){const e=J(t);return Q(e)(e.values.map((t,s)=>tt(t,e.split[s])))}},st=(t,e,s)=>t+(e-t)*s,nt=(t,e,s=10)=>{let n="";const i=Math.max(Math.round(e/s),2);for(let e=0;enull!==t;function rt(t,{repeat:e,repeatType:s="loop"},n,i=1){const r=t.filter(it),a=i<0||e&&"loop"!==s&&e%2==1?0:r.length-1;return a&&void 0!==n?n:r[a]}class at{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const ot=t=>180*t/Math.PI,ht=t=>{const e=ot(Math.atan2(t[1],t[0]));return ut(e)},lt={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:ht,rotateZ:ht,skewX:t=>ot(Math.atan(t[1])),skewY:t=>ot(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},ut=t=>((t%=360)<0&&(t+=360),t),ct=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),dt=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),pt={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:ct,scaleY:dt,scale:t=>(ct(t)+dt(t))/2,rotateX:t=>ut(ot(Math.atan2(t[6],t[5]))),rotateY:t=>ut(ot(Math.atan2(-t[2],t[0]))),rotateZ:ht,rotate:ht,skewX:t=>ot(Math.atan(t[4])),skewY:t=>ot(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function ft(t){return t.includes("scale")?1:0}function mt(t,e){if(!t||"none"===t)return ft(e);const s=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let n,i;if(s)n=pt,i=s;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);n=lt,i=e}if(!i)return ft(e);const r=n[e],a=i[1].split(",").map(vt);return"function"==typeof r?r(a):a[r]}const gt=(t,e)=>{const{transform:s="none"}=getComputedStyle(t);return mt(s,e)};function vt(t){return parseFloat(t.trim())}const yt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],bt=(()=>new Set([...yt,"pathRotation"]))(),wt=t=>t===k||t===j,Vt=new Set(["x","y","z"]),St=yt.filter(t=>!Vt.has(t));const Mt={width:({x:t},{paddingLeft:e="0",paddingRight:s="0",boxSizing:n})=>{const i=t.max-t.min;return"border-box"===n?i:i-parseFloat(e)-parseFloat(s)},height:({y:t},{paddingTop:e="0",paddingBottom:s="0",boxSizing:n})=>{const i=t.max-t.min;return"border-box"===n?i:i-parseFloat(e)-parseFloat(s)},top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>mt(e,"x"),y:(t,{transform:e})=>mt(e,"y")};Mt.translateX=Mt.x,Mt.translateY=Mt.y;const Tt=new Set;let At=!1,Ct=!1,xt=!1;function kt(){if(Ct){const t=Array.from(Tt).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),s=new Map;e.forEach(t=>{const e=function(t){const e=[];return St.forEach(s=>{const n=t.getValue(s);void 0!==n&&(e.push([s,n.get()]),n.set(s.startsWith("scale")?1:0))}),e}(t);e.length&&(s.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=s.get(t);e&&e.forEach(([e,s])=>{t.getValue(e)?.set(s)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}Ct=!1,At=!1,Tt.forEach(t=>t.complete(xt)),Tt.clear()}function Ft(){Tt.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Ct=!0)})}function Et(){xt=!0,Ft(),kt(),xt=!1}class Rt{constructor(t,e,s,n,i,r=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=s,this.motionValue=n,this.element=i,this.isAsync=r}scheduleResolve(){this.state="scheduled",this.isAsync?(Tt.add(this),At||(At=!0,g.read(Ft),g.resolveKeyframes(kt))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:s,motionValue:n}=this;if(null===t[0]){const i=n?.get(),r=t[t.length-1];if(void 0!==i)t[0]=i;else if(s&&e){const n=s.readValue(e,r);null!=n&&(t[0]=n)}void 0===t[0]&&(t[0]=r),n&&void 0===i&&n.set(t[0])}!function(t){for(let e=1;et.startsWith("--"))(e)?t.style.setProperty(e,s):t.style[e]=s}const Pt={};function It(t,e){const s=o(t);return()=>Pt[e]??s()}const Nt=It(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),Ot=It(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),$t=([t,e,s,n])=>`cubic-bezier(${t}, ${e}, ${s}, ${n})`,Lt={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:$t([0,.65,.55,1]),circOut:$t([.55,0,1,.45]),backIn:$t([.31,.01,.66,-.59]),backOut:$t([.33,1.53,.69,.99])};function Yt(t,e){return t?"function"==typeof t?Ot()?nt(t,e):"ease-out":p(t)?$t(t):Array.isArray(t)?t.map(t=>Yt(t,e)||Lt.easeOut):Lt[t]:void 0}function Wt(t,e,s,{delay:n=0,duration:i=300,repeat:r=0,repeatType:a="loop",ease:o="easeOut",times:h}={},l=void 0){const u={[e]:s};h&&(u.offset=h);const c=Yt(o,i);Array.isArray(c)&&(u.easing=c);const d={delay:n,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:r+1,direction:"reverse"===a?"alternate":"normal"};return l&&(d.pseudoElement=l),t.animate(u,d)}function Xt(t){return"function"==typeof t&&"applyToOptions"in t}class jt extends at{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:e,name:s,keyframes:i,pseudoElement:r,allowFlatten:a=!1,finalKeyframe:o,onComplete:h}=t;this.isPseudoElement=Boolean(r),this.allowFlatten=a,this.options=t,n("string"!=typeof t.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const l=function({type:t,...e}){return Xt(t)&&Ot()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=Wt(e,s,i,l,r),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!r){const t=rt(i,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(t),Bt(e,s,t),this.animation.cancel()}h?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return c(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+c(t)}get time(){return c(Number(this.animation.currentTime)||0)}set time(t){const e=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=u(t),e&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:e,rangeEnd:s,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&Nt()?(this.animation.timeline=t,e&&(this.animation.rangeStart=e),s&&(this.animation.rangeEnd=s),h):n(this)}}const zt=new Set(["opacity","clipPath","filter","transform","backgroundColor"]);class Kt{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=V.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=V.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new l);const s=this.events[t].add(e);return"change"===t?()=>{s(),g.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,s){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-s}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=V.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return d(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Ut(t,e){return new Kt(t,e)}function Zt(t){const e=[{},{}];return t?.values.forEach((t,s)=>{e[0][s]=t.get(),e[1][s]=t.getVelocity()}),e}function Dt(t,e,s,n){if("function"==typeof e){const[i,r]=Zt(n);e=e(void 0!==s?s:t.custom,i,r)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[i,r]=Zt(n);e=e(void 0!==s?s:t.custom,i,r)}return e}const qt=t=>Boolean(t&&t.getVelocity);function Ht(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const _t="data-"+Ht("framerAppearId"),Gt=t=>e=>e.test(t),Jt=[k,j,X,W,K,z,{test:t=>"auto"===t,parse:t=>t}],Qt=t=>Jt.find(Gt(t)),te=new Set(["brightness","contrast","saturate","opacity"]);function ee(t){const[e,s]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[n]=s.match(B)||[];if(!n)return t;const i=s.replace(n,"");let r=te.has(e)?1:0;return n!==s&&(r*=100),e+"("+r+i+")"}const se=/\b([a-z-]*)\(.*?\)/gu,ne={...et,getAnimatableNone:t=>{const e=t.match(se);return e?e.map(ee).join(" "):t}},ie={...et,getAnimatableNone:t=>{const e=et.parse(t);return et.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},re={...k,transform:Math.round},ae={borderWidth:j,borderTopWidth:j,borderRightWidth:j,borderBottomWidth:j,borderLeftWidth:j,borderRadius:j,borderTopLeftRadius:j,borderTopRightRadius:j,borderBottomRightRadius:j,borderBottomLeftRadius:j,width:j,maxWidth:j,height:j,maxHeight:j,top:j,right:j,bottom:j,left:j,inset:j,insetBlock:j,insetBlockStart:j,insetBlockEnd:j,insetInline:j,insetInlineStart:j,insetInlineEnd:j,padding:j,paddingTop:j,paddingRight:j,paddingBottom:j,paddingLeft:j,paddingBlock:j,paddingBlockStart:j,paddingBlockEnd:j,paddingInline:j,paddingInlineStart:j,paddingInlineEnd:j,margin:j,marginTop:j,marginRight:j,marginBottom:j,marginLeft:j,marginBlock:j,marginBlockStart:j,marginBlockEnd:j,marginInline:j,marginInlineStart:j,marginInlineEnd:j,fontSize:j,backgroundPositionX:j,backgroundPositionY:j,...{rotate:W,pathRotation:W,rotateX:W,rotateY:W,rotateZ:W,scale:E,scaleX:E,scaleY:E,scaleZ:E,skew:W,skewX:W,skewY:W,distance:j,translateX:j,translateY:j,translateZ:j,x:j,y:j,z:j,perspective:j,transformPerspective:j,opacity:F,originX:U,originY:U,originZ:j},zIndex:re,fillOpacity:F,strokeOpacity:F,numOctaves:re},oe={...ae,color:D,backgroundColor:D,outlineColor:D,fill:D,stroke:D,borderColor:D,borderTopColor:D,borderRightColor:D,borderBottomColor:D,borderLeftColor:D,filter:ne,WebkitFilter:ne,mask:ie,WebkitMask:ie},he=t=>oe[t],le=new Set([ne,ie]);function ue(t,e){let s=he(t);return le.has(s)||(s=et),s.getAnimatableNone?s.getAnimatableNone(e):void 0}const ce=(t,e)=>e&&"number"==typeof t?e.transform(t):t,{schedule:de}=m(queueMicrotask,!1),pe=[...Jt,D,et],fe=()=>({x:{min:0,max:0},y:{min:0,max:0}}),me=new WeakMap;function ge(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function ve(t){return"string"==typeof t||Array.isArray(t)}const ye=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],be=["initial",...ye];function we(t){return ge(t.animate)||be.some(e=>ve(t[e]))}function Ve(t){return Boolean(we(t)||t.variants)}const Se={current:null},Me={current:!1},Te="undefined"!=typeof window;const Ae=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Ce={};function xe(t){Ce=t}function ke(){return Ce}class Fe{scrapeMotionValuesFromProps(t,e,s){return{}}constructor({parent:t,props:e,presenceContext:s,reducedMotionConfig:n,skipAnimations:i,blockInitialAnimation:r,visualState:a},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Rt,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const t=V.now();this.renderScheduledAtthis.bindToMotionValue(e,t)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(Me.current||function(){if(Me.current=!0,Te)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Se.current=t.matches;t.addEventListener("change",e),e()}else Se.current=!1}(),this.shouldReduceMotion=Se.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),v(this.notifyUpdate),v(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,e){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),e.accelerate&&zt.has(t)&&this.current instanceof HTMLElement){const{factory:s,keyframes:n,times:i,ease:r,duration:a}=e.accelerate,o=new jt({element:this.current,name:t,keyframes:n,times:i,ease:r,duration:u(a)}),h=s(o);return void this.valueSubscriptions.set(t,()=>{h(),o.cancel()})}const s=bt.has(t);s&&this.onBindTransform&&this.onBindTransform();const n=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&g.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{n(),i&&i()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in Ce){const e=Ce[t];if(!e)continue;const{isEnabled:s,Feature:n}=e;if(!this.features[t]&&n&&s(this.props)&&(this.features[t]=new n(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;ee.variantChildren.delete(t)}addValue(t,e){const s=this.values.get(t);e!==s&&(s&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let s=this.values.get(t);return void 0===s&&void 0!==e&&(s=Ut(null===e?void 0:e,{owner:this}),this.addValue(t,s)),s}readValue(t,e){let s=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var n;return null!=s&&("string"==typeof s&&(r(s)||a(s))?s=parseFloat(s):(n=s,!pe.find(Gt(n))&&et.test(e)&&(s=ue(t,e))),this.setBaseTarget(t,qt(s)?s.get():s)),qt(s)?s.get():s}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let s;if("string"==typeof e||"object"==typeof e){const n=Dt(this.props,e,this.presenceContext?.custom);n&&(s=n[t])}if(e&&void 0!==s)return s;const n=this.getBaseTargetFromProps(this.props,t);return void 0===n||qt(n)?void 0!==this.initialValues[t]&&void 0===s?void 0:this.baseTarget[t]:n}on(t,e){return this.events[t]||(this.events[t]=new l),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){de.render(this.render)}}const Ee={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Re=yt.length;function Be(t,e,s){const{style:n,vars:i,transformOrigin:r}=t;let a=!1,o=!1;for(const t in e){const s=e[t];if(bt.has(t))a=!0;else if(M(t))i[t]=s;else{const e=ce(s,ae[t]);t.startsWith("origin")?(o=!0,r[t]=e):n[t]=e}}if(e.transform||(a||s?n.transform=function(t,e,s){let n="",i=!0;for(let r=0;r{if(!e.target)return t;if("string"==typeof t){if(!j.test(t))return t;t=parseFloat(t)}return`${Pe(t,e.target.x)}% ${Pe(t,e.target.y)}%`}},Ne={correct:(t,{treeScale:e,projectionDelta:s})=>{const n=t,i=et.parse(t);if(i.length>5)return n;const r=et.createTransformer(t),a="number"!=typeof i[0]?1:0,o=s.x.scale*e.x,h=s.y.scale*e.y;i[0+a]/=o,i[1+a]/=h;const l=st(o,h,.5);return"number"==typeof i[2+a]&&(i[2+a]/=l),"number"==typeof i[3+a]&&(i[3+a]/=l),r(i)}},Oe={borderRadius:{...Ie,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"]},borderTopLeftRadius:Ie,borderTopRightRadius:Ie,borderBottomLeftRadius:Ie,borderBottomRightRadius:Ie,boxShadow:Ne};function $e(t,{layout:e,layoutId:s}){return bt.has(t)||t.startsWith("origin")||(e||void 0!==s)&&(!!Oe[t]||"opacity"===t)}function Le(t,e,s){const n=t.style,i=e?.style,r={};if(!n)return r;for(const e in n)(qt(n[e])||i&&qt(i[e])||$e(e,t)||void 0!==s?.getValue(e)?.liveStyle)&&(r[e]=n[e]);return r}const Ye={offset:"stroke-dashoffset",array:"stroke-dasharray"},We={offset:"strokeDashoffset",array:"strokeDasharray"};const Xe=["transform","opacity","offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function je(t,{attrX:e,attrY:s,attrScale:n,pathLength:i,pathSpacing:r=1,pathOffset:a=0,...o},h,l,u){if(Be(t,o,l),h)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:c,style:d}=t;for(const t of Xe)void 0!==c[t]&&(d[t]=c[t],delete c[t]);(d.transform||c.transformOrigin)&&(d.transformOrigin=c.transformOrigin??"50% 50%",delete c.transformOrigin),d.transform&&(d.transformBox=u?.transformBox??"fill-box",delete c.transformBox),void 0!==e&&(c.x=e),void 0!==s&&(c.y=s),void 0!==n&&(c.scale=n),void 0!==i&&function(t,e,s=1,n=0,i=!0){t.pathLength=1;const r=i?Ye:We;t[r.offset]=""+-n,t[r.array]=`${e} ${s}`}(c,i,r,a,!1)}const ze=t=>"string"==typeof t&&"svg"===t.toLowerCase();function Ke(t,e,s){const n=Le(t,e,s);for(const s in t)if(qt(t[s])||qt(e[s])){n[-1!==yt.indexOf(s)?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s]=t[s]}return n}const Ue=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Ze(t){return"string"==typeof t&&!t.includes("-")&&!!(Ue.indexOf(t)>-1||/[A-Z]/u.test(t))}export{Qt as $,et as A,J as B,y as C,V as D,v as E,g as F,c as G,t as H,nt as I,u as J,d as K,rt as L,i as M,jt as N,Bt as O,Xt as P,zt as Q,o as R,Rt as S,Et as T,bt as U,r as V,at as W,yt as X,Ut as Y,a as Z,ue as _,we as a,x as a0,Mt as a1,wt as a2,Fe as a3,ft as a4,gt as a5,M as a6,Ht as a7,fe as a8,Xe as a9,he as aa,be as ab,ye as ac,ve as b,$e as c,Be as d,je as e,ze as f,Ze as g,Ve as h,qt as i,ge as j,Ke as k,ke as l,xe as m,h as n,_t as o,p,n as q,Dt as r,Le as s,st as t,$ as u,Z as v,L as w,s as x,A as y,D as z}; diff --git a/node_modules/framer-motion/dist/size-rollup-dom-animation-m.js b/node_modules/framer-motion/dist/size-rollup-dom-animation-m.js deleted file mode 100644 index 5ccb079..0000000 --- a/node_modules/framer-motion/dist/size-rollup-dom-animation-m.js +++ /dev/null @@ -1 +0,0 @@ -import{jsxs as t,jsx as n}from"react/jsx-runtime";import{createContext as o,useContext as e,useMemo as r,Fragment as a,createElement as i,useRef as s,useInsertionEffect as u,useCallback as c,useLayoutEffect as l,useEffect as d,forwardRef as f}from"react";import{i as m,a as p,b as y,c as g,d as v,e as h,f as w,g as S,P as M,r as b,h as P,j as E,k as A,s as T,l as C,m as j,n as V,S as x,o as I,p as L,L as k}from"./size-rollup-dom-max-assets.js";const W=o({strict:!1}),H=o({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),O=o({});function D(t){const{initial:n,animate:o}=function(t,n){if(m(t)){const{initial:n,animate:o}=t;return{initial:!1===n||p(n)?n:void 0,animate:p(o)?o:void 0}}return!1!==t.inherit?n:{}}(t,e(O));return r(()=>({initial:n,animate:o}),[F(n),F(o)])}function F(t){return Array.isArray(t)?t.join(" "):t}const R=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function N(t,n,o){for(const e in n)y(n[e])||g(e,o)||(t[e]=n[e])}function B(t,n){const o={};return N(o,t.style||{},t),Object.assign(o,function({transformTemplate:t},n){return r(()=>{const o={style:{},transform:{},transformOrigin:{},vars:{}};return v(o,n,t),Object.assign({},o.vars,o.style)},[n])}(t,n)),o}function U(t,n){const o={},e=B(t,n);return t.drag&&!1!==t.dragListener&&(o.draggable=!1,e.userSelect=e.WebkitUserSelect=e.WebkitTouchCallout="none",e.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),void 0===t.tabIndex&&(t.onTap||t.onTapStart||t.whileTap)&&(o.tabIndex=0),o.style=e,o}const $=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}});function _(t,n,o,e){const a=r(()=>{const o={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return h(o,n,w(e),t.transformTemplate,t.style),{...o.attrs,style:{...o.style}}},[n]);if(t.style){const n={};N(n,t.style,t),a.style={...n,...a.style}}return a}const q=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function z(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||q.has(t)}function G(t,n){return t.startsWith("on")?!z(t):n?.(t)??!z(t)}function X(t,n,o,{latestValues:e},s,u=!1,c,l){const d=(c??S(t)?_:U)(n,e,s,t),f=function(t,n,o,e){const r={};for(const a in t)"values"===a&&"object"==typeof t.values||y(t[a])||(G(a,e)||!0===o&&z(a)||!n&&!z(a)||t.draggable&&a.startsWith("onDrag"))&&(r[a]=t[a]);return r}(n,"string"==typeof t,u,l),m=t!==a?{...f,...d,ref:o}:{},{children:p}=n,g=r(()=>y(p)?p.get():p,[p]);return i(t,{...m,children:g})}function Y(t,n,o,e){const r={},a=e(t,{});for(const t in a)r[t]=b(a[t]);let{initial:i,animate:s}=t;const u=m(t),c=P(t);n&&c&&!u&&!1!==t.inherit&&(void 0===i&&(i=n.initial),void 0===s&&(s=n.animate));let l=!!o&&!1===o.initial;l=l||!1===i;const d=l?s:i;if(d&&"boolean"!=typeof d&&!E(d)){const n=Array.isArray(d)?d:[d];for(let o=0;o(n,o)=>{const r=e(O),a=e(M),i=()=>function({scrapeMotionValuesFromProps:t,createRenderState:n},o,e,r){return{latestValues:Y(o,e,r,t),renderState:n()}}(t,n,r,a);return o?i():function(t){const n=s(null);return null===n.current&&(n.current=t()),n.current}(i)},K=J({scrapeMotionValuesFromProps:T,createRenderState:R}),Q=J({scrapeMotionValuesFromProps:C,createRenderState:$}),Z={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let tt=!1;function nt(){return function(){if(tt)return;const t={};for(const n in Z)t[n]={isEnabled:t=>Z[n].some(n=>!!t[n])};V(t),tt=!0}(),j()}const ot=Symbol.for("motionComponentSymbol");function et(t,n,o){const e=s(o);u(()=>{e.current=o});const r=s(null);return c(o=>{o&&t.onMount?.(o),n&&(o?n.mount(o):n.unmount());const a=e.current;if("function"==typeof a)if(o){const t=a(o);"function"==typeof t&&(r.current=t)}else r.current?(r.current(),r.current=null):a(o);else a&&(a.current=o)},[n])}const rt="undefined"!=typeof window?l:d;function at(t,n,o,r,a,i){const{visualElement:c}=e(O),l=e(W),f=e(M),m=e(H),p=m.reducedMotion,y=m.skipAnimations,g=s(null),v=s(!1);r=r||l.renderer,!g.current&&r&&(g.current=r(t,{visualState:n,parent:c,props:o,presenceContext:f,blockInitialAnimation:!!f&&!1===f.initial,reducedMotionConfig:p,skipAnimations:y,isSVG:i}),v.current&&g.current&&(g.current.manuallyAnimateOnMount=!0));const h=g.current,w=e(x);!h||h.projection||!a||"html"!==h.type&&"svg"!==h.type||function(t,n,o,e){const{layoutId:r,layout:a,drag:i,dragConstraints:s,layoutScroll:u,layoutRoot:c,layoutAnchor:l,layoutCrossfade:d}=n;t.projection=new o(t.latestValues,n["data-framer-portal-id"]?void 0:it(t.parent)),t.projection.setOptions({layoutId:r,layout:a,alwaysMeasureLayout:Boolean(i)||s&&L(s),visualElement:t,animationType:"string"==typeof a?a:"both",initialPromotionConfig:e,crossfade:d,layoutScroll:u,layoutRoot:c,layoutAnchor:l})}(g.current,o,a,w);const S=s(!1);u(()=>{h&&S.current&&h.update(o,f)});const b=o[I],P=s(Boolean(b)&&"undefined"!=typeof window&&!window.MotionHandoffIsComplete?.(b)&&window.MotionHasOptimisedAnimation?.(b));return rt(()=>{v.current=!0,h&&(S.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),h.scheduleRenderMicrotask(),P.current&&h.animationState&&h.animationState.animateChanges())}),d(()=>{h&&(!P.current&&h.animationState&&h.animationState.animateChanges(),P.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(b)}),P.current=!1),h.enteringChildren=void 0)}),h}function it(t){if(t)return!1!==t.options.allowProjection?t.projection:it(t.parent)}function st(o,{forwardMotionProps:r=!1,type:a}={},i,s){const u=a?"svg"===a:S(o),c=u?Q:K;function l(a,i){let l;const d={...e(H),...a,layoutId:ut(a)},{isStatic:f,isValidProp:m}=d,p=D(a),y=c(a,f);if(!f&&"undefined"!=typeof window){e(W).strict;const t=function(t){const n=nt(),{drag:o,layout:e}=n;if(!o&&!e)return{};const r={...o,...e};return{MeasureLayout:o?.isEnabled(t)||e?.isEnabled(t)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}(d);l=t.MeasureLayout,p.visualElement=at(o,y,d,s,t.ProjectionNode,u)}return t(O.Provider,{value:p,children:[l&&p.visualElement?n(l,{visualElement:p.visualElement,...d}):null,X(o,a,et(y,p.visualElement,i),y,f,r,u,m)]})}l.displayName=`motion.${"string"==typeof o?o:`create(${o.displayName??o.name??""})`}`;const d=f(l);return d[ot]=o,d}function ut({layoutId:t}){const n=e(k).id;return n&&void 0!==t?n+"-"+t:t}function ct(t,n){return st(t,n)}const lt=ct("div");export{lt as MotionDiv}; diff --git a/node_modules/framer-motion/dist/size-rollup-dom-animation.js b/node_modules/framer-motion/dist/size-rollup-dom-animation.js deleted file mode 100644 index 71098c3..0000000 --- a/node_modules/framer-motion/dist/size-rollup-dom-animation.js +++ /dev/null @@ -1 +0,0 @@ -import{n as t,p as e,q as n,t as i,u as s,v as r,w as o,x as a,y as u,z as l,A as c,B as h,C as d,D as p,E as m,F as f,G as y,H as v,I as g,J as w,K as b,M as T,W as x,L as A,N as S,O as M,P as k,Q as C,R as E,S as V,T as P,U as D,V as O,r as I,X as F,Y as L,i as R,o as K,Z as B,_ as j,$ as G,a0 as q,a1 as H,a2 as N,a3 as U,a4 as $,a5 as W,a6 as _,d as z,s as Y,a7 as X,a8 as J,a9 as Z,k as Q,e as tt,f as et,aa as nt,b as it,ab as st,j as rt,ac as ot,g as at}from"./size-rollup-dom-animation-assets.js";import{Fragment as ut}from"react";const lt=(...t)=>t.reduce((t,e)=>n=>e(t(n))),ct=(t,e,n)=>{const i=e-t;return i?(n-t)/i:1},ht=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function dt(e,n,i,s){if(e===n&&i===s)return t;const r=t=>function(t,e,n,i,s){let r,o,a=0;do{o=e+(n-e)/2,r=ht(o,i,s)-t,r>0?n=o:e=o}while(Math.abs(r)>1e-7&&++a<12);return o}(t,0,1,e,i);return t=>0===t||1===t?t:ht(r(t),n,s)}const pt=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,mt=t=>e=>1-t(1-e),ft=dt(.33,1.53,.69,.99),yt=mt(ft),vt=pt(yt),gt=t=>t>=1?1:(t*=2)<1?.5*yt(t):.5*(2-Math.pow(2,-10*(t-1))),wt=t=>1-Math.sin(Math.acos(t)),bt=mt(wt),Tt=pt(wt),xt=dt(.42,0,1,1),At=dt(0,0,.58,1),St=dt(.42,0,.58,1),Mt={linear:t,easeIn:xt,easeInOut:St,easeOut:At,circIn:wt,circInOut:Tt,circOut:bt,backIn:yt,backInOut:vt,backOut:ft,anticipate:gt},kt=t=>{if(e(t)){n(4===t.length,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[e,i,s,r]=t;return dt(e,i,s,r)}return"string"==typeof t?(n(void 0!==Mt[t],`Invalid easing type '${t}'`,"invalid-easing-type"),Mt[t]):t};function Ct(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function Et(t,e){return n=>n>0?e:t}const Vt=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},Pt=[o,s,r];function Dt(t){const e=(n=t,Pt.find(t=>t.test(n)));var n;if(a(Boolean(e),`'${t}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!Boolean(e))return!1;let i=e.parse(t);return e===r&&(i=function({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let s=0,r=0,o=0;if(e/=100){const i=n<.5?n*(1+e):n+e-n*e,a=2*n-i;s=Ct(a,i,t+1/3),r=Ct(a,i,t),o=Ct(a,i,t-1/3)}else s=r=o=n;return{red:Math.round(255*s),green:Math.round(255*r),blue:Math.round(255*o),alpha:i}}(i)),i}const Ot=(t,e)=>{const n=Dt(t),r=Dt(e);if(!n||!r)return Et(t,e);const o={...n};return t=>(o.red=Vt(n.red,r.red,t),o.green=Vt(n.green,r.green,t),o.blue=Vt(n.blue,r.blue,t),o.alpha=i(n.alpha,r.alpha,t),s.transform(o))},It=new Set(["none","hidden"]);function Ft(t,e){return n=>i(t,e,n)}function Lt(t){return"number"==typeof t?Ft:"string"==typeof t?u(t)?Et:l.test(t)?Ot:Bt:Array.isArray(t)?Rt:"object"==typeof t?l.test(t)?Ot:Kt:Et}function Rt(t,e){const n=[...t],i=n.length,s=t.map((t,n)=>Lt(t)(t,e[n]));return t=>{for(let e=0;e{for(const e in i)n[e]=i[e](t);return n}}const Bt=(t,e)=>{const n=c.createTransformer(e),i=h(t),s=h(e);return i.indexes.var.length===s.indexes.var.length&&i.indexes.color.length===s.indexes.color.length&&i.indexes.number.length>=s.indexes.number.length?It.has(t)&&!s.values.length||It.has(e)&&!i.values.length?function(t,e){return It.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):lt(Rt(function(t,e){const n=[],i={color:0,var:0,number:0};for(let s=0;s{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>f.update(e,t),stop:()=>m(e),now:()=>d.isProcessing?d.timestamp:p.now()}},qt=2e4;function Ht(t){let e=0;let n=t.next(e);for(;!n.done&&e=qt?1/0:e}const Nt=100,Ut=10,$t=1,Wt=0,_t=800,zt=.3,Yt=.3,Xt={granular:.01,default:2},Jt={granular:.005,default:.5},Zt=.01,Qt=10,te=.05,ee=1;function ne(t,e){return t*Math.sqrt(1-e*e)}const ie=.001;const se=["duration","bounce"],re=["stiffness","damping","mass"];function oe(t,e){return e.some(e=>void 0!==t[e])}function ae(t){let e={velocity:Wt,stiffness:Nt,damping:Ut,mass:$t,isResolvedFromDuration:!1,...t};if(!oe(t,re)&&oe(t,se))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,i=2*Math.PI/(1.2*n),s=i*i,r=2*v(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:$t,stiffness:s,damping:r}}else{const n=function({duration:t=_t,bounce:e=zt,velocity:n=Wt,mass:i=$t}){let s,r;a(t<=w(Qt),"Spring duration must be 10 seconds or less","spring-duration-limit");let o=1-e;o=v(te,ee,o),t=v(Zt,Qt,y(t)),o<1?(s=e=>{const i=e*o,s=i*t,r=i-n,a=ne(e,o),u=Math.exp(-s);return ie-r/a*u},r=e=>{const i=e*o*t,r=i*n+n,a=Math.pow(o,2)*Math.pow(e,2)*t,u=Math.exp(-i),l=ne(Math.pow(e,2),o);return(-s(e)+ie>0?-1:1)*((r-a)*u)/l}):(s=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,r=e=>Math.exp(-e*t)*(t*t*(n-e)));const u=function(t,e,n){let i=n;for(let n=1;n<12;n++)i-=t(i)/e(i);return i}(s,r,5/t);if(t=w(t),isNaN(u))return{stiffness:Nt,damping:Ut,duration:t};{const e=Math.pow(u,2)*i;return{stiffness:e,damping:2*o*Math.sqrt(i*e),duration:t}}}({...t,velocity:0});e={...e,...n,mass:$t},e.isResolvedFromDuration=!0}return e}function ue(t=Yt,e=zt){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:i,restDelta:s}=n;const r=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:u,damping:l,mass:c,duration:h,velocity:d,isResolvedFromDuration:p}=ae({...n,velocity:-y(n.velocity||0)}),m=d||0,f=l/(2*Math.sqrt(u*c)),v=o-r,b=y(Math.sqrt(u/c)),T=Math.abs(v)<5;let x,A,S,M,k,C;if(i||(i=T?Xt.granular:Xt.default),s||(s=T?Jt.granular:Jt.default),f<1)S=ne(b,f),M=(m+f*b*v)/S,x=t=>{const e=Math.exp(-f*b*t);return o-e*(M*Math.sin(S*t)+v*Math.cos(S*t))},k=f*b*M+v*S,C=f*b*v-M*S,A=t=>Math.exp(-f*b*t)*(k*Math.sin(S*t)+C*Math.cos(S*t));else if(1===f){x=t=>o-Math.exp(-b*t)*(v+(m+b*v)*t);const t=m+b*v;A=e=>Math.exp(-b*e)*(b*t*e-m)}else{const t=b*Math.sqrt(f*f-1);x=e=>{const n=Math.exp(-f*b*e),i=Math.min(t*e,300);return o-n*((m+f*b*v)*Math.sinh(i)+t*v*Math.cosh(i))/t};const e=(m+f*b*v)/t,n=f*b*e-v*t,i=f*b*v-e*t;A=e=>{const s=Math.exp(-f*b*e),r=Math.min(t*e,300);return s*(n*Math.sinh(r)+i*Math.cosh(r))}}const E={calculatedDuration:p&&h||null,velocity:t=>w(A(t)),next:t=>{if(!p&&f<1){const e=Math.exp(-f*b*t),n=Math.sin(S*t),r=Math.cos(S*t),u=o-e*(M*n+v*r),l=w(e*(k*n+C*r));return a.done=Math.abs(l)<=i&&Math.abs(o-u)<=s,a.value=a.done?o:u,a}const e=x(t);if(p)a.done=t>=h;else{const n=w(A(t));a.done=Math.abs(n)<=i&&Math.abs(o-e)<=s}return a.value=a.done?o:e,a},toString:()=>{const t=Math.min(Ht(E),qt),e=g(e=>E.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return E}ue.applyToOptions=t=>{const e=function(t,e=100,n){const i=n({...t,keyframes:[0,e]}),s=Math.min(Ht(i),qt);return{type:"keyframes",ease:t=>i.next(s*t).value/e,duration:y(s)}}(t,100,ue);return t.ease=e.ease,t.duration=w(e.duration),t.type="keyframes",t};function le(t,e,n){const i=Math.max(e-5,0);return b(n-t(i),e-i)}function ce({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:u,restDelta:l=.5,restSpeed:c}){const h=t[0],d={done:!1,value:h},p=t=>void 0===a?u:void 0===u||Math.abs(a-t)-m*Math.exp(-t/i),g=t=>y+v(t),w=t=>{const e=v(t),n=g(t);d.done=Math.abs(e)<=l,d.value=d.done?y:n};let b,T;const x=t=>{var e;(e=d.value,void 0!==a&&eu)&&(b=t,T=ue({keyframes:[d.value,p(d.value)],velocity:le(g,t,d.value),damping:s,stiffness:r,restDelta:l,restSpeed:c}))};return x(0),{calculatedDuration:null,next:t=>{let e=!1;return T||void 0!==b||(e=!0,w(t),x(t)),void 0!==b&&t>=b?T.next(t-b):(!e&&w(t),d)}}}function he(e,i,{clamp:s=!0,ease:r,mixer:o}={}){const a=e.length;if(n(a===i.length,"Both input and output ranges must be the same length","range-length"),1===a)return()=>i[0];if(2===a&&i[0]===i[1])return()=>i[1];const u=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),i=[...i].reverse());const l=function(e,n,i){const s=[],r=i||T.mix||jt,o=e.length-1;for(let i=0;i{if(u&&t1)for(;nh(v(e[0],e[a-1],t)):h}function de(t){const e=[0];return function(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const r=ct(0,e,s);t.push(i(n,1,r))}}(e,t.length-1),e}function pe({duration:t=300,keyframes:e,times:n,ease:i="easeInOut"}){const s=(t=>Array.isArray(t)&&"number"!=typeof t[0])(i)?i.map(kt):kt(i),r={done:!1,value:e[0]},o=function(t,e){return t.map(t=>t*e)}(n&&n.length===e.length?n:de(e),t),a=he(o,e,{ease:Array.isArray(s)?s:(u=e,l=s,u.map(()=>l||St).splice(0,u.length-1))});var u,l;return{calculatedDuration:t,next:e=>(r.value=a(e),r.done=e>=t,r)}}const me={decay:ce,inertia:ce,tween:pe,keyframes:pe,spring:ue};function fe(t){"string"==typeof t.type&&(t.type=me[t.type])}const ye=t=>t/100;class ve extends x{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:t}=this.options;t&&t.updatedAt!==p.now()&&this.tick(p.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;fe(t);const{type:e=pe,repeat:n=0,repeatDelay:i=0,repeatType:s,velocity:r=0}=t;let{keyframes:o}=t;const a=e||pe;a!==pe&&"number"!=typeof o[0]&&(this.mixKeyframes=lt(ye,jt(o[0],o[1])),o=[0,100]);const u=a({...t,keyframes:o});"mirror"===s&&(this.mirroredGenerator=a({...t,keyframes:[...o].reverse(),velocity:-r})),null===u.calculatedDuration&&(u.calculatedDuration=Ht(u));const{calculatedDuration:l}=u;this.calculatedDuration=l,this.resolvedDuration=l+i,this.totalDuration=this.resolvedDuration*(n+1)-i,this.generator=u}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,e=!1){const{generator:n,totalDuration:i,mixKeyframes:s,mirroredGenerator:r,resolvedDuration:o,calculatedDuration:a}=this;if(null===this.startTime)return n.next(0);const{delay:u=0,keyframes:l,repeat:c,repeatType:h,repeatDelay:d,type:p,onUpdate:m,finalKeyframe:f}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const y=this.currentTime-u*(this.playbackSpeed>=0?1:-1),g=this.playbackSpeed>=0?y<0:y>i;this.currentTime=Math.max(y,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=i);let w,b=this.currentTime,T=n;if(c){const t=Math.min(this.currentTime,i)/o;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,c+1);Boolean(e%2)&&("reverse"===h?(n=1-n,d&&(n-=d/o)):"mirror"===h&&(T=r)),b=v(0,1,n)*o}g?(this.delayState.value=l[0],w=this.delayState):w=T.next(b),s&&!g&&(w.value=s(w.value));let{done:x}=w;g||null===a||(x=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const S=null===this.holdTime&&("finished"===this.state||"running"===this.state&&x);return S&&p!==ce&&(w.value=A(l,this.options,f,this.speed)),m&&m(w.value),S&&this.finish(),w}then(t,e){return this.finished.then(t,e)}get duration(){return y(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+y(t)}get time(){return y(this.currentTime)}set time(t){t=w(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);return le(t=>this.generator.next(t).value,t,this.generator.next(t).value)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;e&&this.driver&&this.updateTime(p.now()),this.playbackSpeed=t,e&&this.driver&&(this.time=y(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=Gt,startTime:e}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),this.options.onPlay?.();const n=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=n):null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime||(this.startTime=e??n),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(p.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}const ge={anticipate:gt,backInOut:vt,circInOut:Tt};function we(t){"string"==typeof t.ease&&t.ease in ge&&(t.ease=ge[t.ease])}class be extends S{constructor(t){we(t),fe(t),super(t),void 0!==t.startTime&&!1!==t.autoplay&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:e,onUpdate:n,onComplete:i,element:s,...r}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);const o=new ve({...r,autoplay:!1}),a=Math.max(10,p.now()-this.startTime),u=v(0,10,a-10),l=o.sample(a).value,{name:c}=this.options;s&&c&&M(s,c,l),e.setWithVelocity(o.sample(Math.max(0,a-u)).value,l,u),o.stop()}}const Te=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!c.test(t)&&"0"!==t||t.startsWith("url(")));function xe(t){t.duration=0,t.type="keyframes"}const Ae=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;const Se=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),Me=E(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function ke(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:s,damping:r,type:o,keyframes:a}=t,u=e?.owner?.current;if(!(u instanceof HTMLElement||u instanceof SVGElement))return!1;const{onUpdate:l,transformTemplate:c}=e.owner.getProps();return Me()&&n&&(C.has(n)||Se.has(n)&&function(t){for(let e=0;e{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=p.now();const h={autoplay:t,delay:e,type:n,repeat:i,repeatDelay:s,repeatType:r,name:a,motionValue:u,element:l,...c},d=l?.KeyframeResolver||V;this.keyframeResolver=new d(o,(t,e,n)=>this.onKeyframesResolved(t,e,h,!n),a,u,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,n,i,s){this.keyframeResolver=void 0;const{name:r,type:o,velocity:u,delay:l,isHandoff:c,onUpdate:h}=i;this.resolvedAt=p.now();let d=!0;(function(t,e,n,i){const s=t[0];if(null===s)return!1;if("display"===e||"visibility"===e)return!0;const r=t[t.length-1],o=Te(s,e),u=Te(r,e);return a(o===u,`You are trying to animate ${e} from "${s}" to "${r}". "${o?r:s}" is not an animatable value.`,"value-not-animatable"),!(!o||!u)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:n,...i,keyframes:e},f=d&&!c&&ke(m),y=m.motionValue?.owner?.current;let v;if(f)try{v=new be({...m,element:y})}catch{v=new ve(m)}else v=new ve(m);v.finished.then(()=>{this.notifyFinished()}).catch(t),this.pendingTimeline&&(this.stopTimeline=v.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=v}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),P()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function Ee(t,e,n,i=0,s=1){const r=Array.from(t).sort((t,e)=>t.sortNodePosition(e)).indexOf(e),o=t.size,a=(o-1)*i;return"function"==typeof n?n(r,o):1===s?r*i:a-r*i}function Ve(t,e){if(t?.inherit&&e){const{inherit:n,...i}=t;return{...e,...i}}return t}function Pe(t,e){const n=t?.[e]??t?.default??t;return n!==t?Ve(n,t):n}const De={type:"spring",stiffness:500,damping:25,restSpeed:10},Oe={type:"keyframes",duration:.8},Ie={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Fe=(t,{keyframes:e})=>e.length>2?Oe:D.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:De:Ie,Le=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);const Re=(t,e,n,i={},s,r)=>o=>{const a=Pe(i,t)||{},u=a.delay||i.delay||0;let{elapsed:l=0}=i;l-=w(u);const c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-l,onUpdate:t=>{e.set(t),a.onUpdate&&a.onUpdate(t)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:r?void 0:s};(function(t){for(const e in t)if(!Le.has(e))return!0;return!1})(a)||Object.assign(c,Fe(t,c)),c.duration&&(c.duration=w(c.duration)),c.repeatDelay&&(c.repeatDelay=w(c.repeatDelay)),void 0!==c.from&&(c.keyframes[0]=c.from);let h=!1;if((!1===c.type||0===c.duration&&!c.repeatDelay)&&(xe(c),0===c.delay&&(h=!0)),(T.instantAnimations||T.skipAnimations||s?.shouldSkipAnimations||a.skipAnimations)&&(h=!0,xe(c),c.delay=0),c.allowFlatten=!a.type&&!a.ease,h&&!r&&void 0!==e.get()){const t=A(c.keyframes,a);if(void 0!==t)return void f.update(()=>{c.onUpdate(t),c.onComplete()})}return a.isSync?new ve(c):new Ce(c)},Ke=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Be(t,e,i=1){n(i<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[s,r]=function(t){const e=Ke.exec(t);if(!e)return[,];const[,n,i,s]=e;return[`--${n??i}`,s]}(t);if(!s)return;const o=window.getComputedStyle(e).getPropertyValue(s);if(o){const t=o.trim();return O(t)?parseFloat(t):t}return u(r)?Be(r,e,i+1):r}function je(t,e,n){const i=t.getProps();return I(i,e,void 0!==n?n:i.custom,t)}const Ge=new Set(["width","height","top","left","right","bottom",...F]),qe=t=>Array.isArray(t);function He(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,L(n))}function Ne(t){return qe(t)?t[t.length-1]||0:t}function Ue(t,e){const n=t.getValue("willChange");if(i=n,Boolean(R(i)&&i.add))return n.add(e);if(!n&&T.WillChange){const n=new T.WillChange("auto");t.addValue("willChange",n),n.add(e)}var i}function $e(t){return t.props[K]}function We({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}function _e(t,e,{delay:n=0,transitionOverride:i,type:s}={}){let{transition:r,transitionEnd:o,...a}=e;const u=t.getDefaultTransition();r=r?Ve(r,u):u;const l=r?.reduceMotion,c=r?.skipAnimations;i&&(r=i);const h=[],d=s&&t.animationState&&t.animationState.getState()[s],p=r?.path;p&&p.animateVisualElement(t,a,r,n,h);for(const e in a){const i=t.getValue(e,t.latestValues[e]??null),s=a[e];if(void 0===s||d&&We(d,e))continue;const o={delay:n,...Pe(r||{},e)};c&&(o.skipAnimations=!0);const u=i.get();if(void 0!==u&&!i.isAnimating()&&!Array.isArray(s)&&s===u&&!o.velocity){f.update(()=>i.set(s));continue}let p=!1;if(window.MotionHandoffAnimation){const n=$e(t);if(n){const t=window.MotionHandoffAnimation(n,e,f);null!==t&&(o.startTime=t,p=!0)}}Ue(t,e);const m=l??t.shouldReduceMotion;i.start(Re(e,i,s,m&&Ge.has(e)?{type:!1}:o,t,p));const y=i.animation;y&&h.push(y)}if(o){const e=()=>f.update(()=>{o&&function(t,e){const n=je(t,e);let{transitionEnd:i={},transition:s={},...r}=n||{};r={...r,...i};for(const e in r)He(t,e,Ne(r[e]))}(t,o)});h.length?Promise.all(h).then(e):e()}return h}function ze(t,e,n={}){const i=je(t,e,"exit"===n.type?t.presenceContext?.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const r=i?()=>Promise.all(_e(t,i,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(i=0)=>{const{delayChildren:r=0,staggerChildren:o,staggerDirection:a}=s;return function(t,e,n=0,i=0,s=0,r=1,o){const a=[];for(const u of t.variantChildren)u.notify("AnimationStart",e),a.push(ze(u,e,{...o,delay:n+("function"==typeof i?0:i)+Ee(t.variantChildren,u,i,s,r)}).then(()=>u.notify("AnimationComplete",e)));return Promise.all(a)}(t,e,i,r,o,a,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[t,e]="beforeChildren"===a?[r,o]:[o,r];return t().then(()=>e())}return Promise.all([r(),o(n.delay)])}function Ye(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||B(t))}const Xe=new Set(["auto","none","0"]);class Je extends V{constructor(t,e,n,i,s){super(t,e,n,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n{t.getValue(e).set(n)}),this.resolveNoneKeyframes()}}const Ze=!1;function Qe(t,e){const n=function(t,e,n){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){let e=document;const i=n?.[t]??e.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t).filter(t=>null!=t)}(t),i=new AbortController;return[n,{passive:!0,...e,signal:i.signal},()=>i.abort()]}function tn(t){return!("touch"===t.pointerType||Ze)}function en(t,e,n={}){const[i,s,r]=Qe(t,n);return i.forEach(t=>{let n,i=!1,r=!1;const o=e=>{n&&(n(e),n=void 0),t.removeEventListener("pointerleave",u)},a=t=>{i=!1,window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",a),r&&(r=!1,o(t))},u=t=>{"touch"!==t.pointerType&&(i?r=!0:o(t))};t.addEventListener("pointerenter",i=>{if(!tn(i))return;r=!1;const o=e(t,i);"function"==typeof o&&(n=o,t.addEventListener("pointerleave",u,s))},s),t.addEventListener("pointerdown",()=>{i=!0,window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",a,s)},s)}),r}const nn=(t,e)=>!!e&&(t===e||nn(t,e.parentElement)),sn=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const rn=new WeakSet;function on(t){return e=>{"Enter"===e.key&&t(e)}}function an(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function un(t){return(t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary)(t)&&!0}const ln=new WeakSet;function cn(t,e,n={}){const[i,s,r]=Qe(t,n),o=t=>{const i=t.currentTarget;if(!un(t))return;if(ln.has(t))return;rn.add(i),n.stopPropagation&&ln.add(t);const r=e(i,t),o={...s,capture:!0},a=(t,e)=>{window.removeEventListener("pointerup",u,o),window.removeEventListener("pointercancel",l,o),rn.has(i)&&rn.delete(i),un(t)&&"function"==typeof r&&r(t,{success:e})},u=t=>{a(t,i===window||i===document||n.useGlobalTarget||nn(i,t.target))},l=t=>{a(t,!1)};window.addEventListener("pointerup",u,o),window.addEventListener("pointercancel",l,o)};return i.forEach(t=>{var e,i;(n.useGlobalTarget?window:t).addEventListener("pointerdown",o,s),"object"==typeof(i=e=t)&&null!==i&&"offsetHeight"in e&&!("ownerSVGElement"in e)&&(t.addEventListener("focus",t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const i=on(()=>{if(rn.has(n))return;an(n,"down");const t=on(()=>{an(n,"up")});n.addEventListener("keyup",t,e),n.addEventListener("blur",()=>an(n,"cancel"),e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)})(t,s)),function(t){return sn.has(t.tagName)||!0===t.isContentEditable}(t)||t.hasAttribute("tabindex")||(t.tabIndex=0))}),r}class hn extends U{constructor(){super(...arguments),this.KeyframeResolver=Je}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){const n=t.style;return n?n[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;R(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}class dn{constructor(t){this.isMounted=!1,this.node=t}update(){}}function pn(t,{style:e,vars:n},i,s){const r=t.style;let o;for(o in e)r[o]=e[o];for(o in s?.applyProjectionStyles(r,i),n)r.setProperty(o,n[o])}class mn extends hn{constructor(){super(...arguments),this.type="html",this.renderInstance=pn}mount(t){n(Boolean(t.style),"motion.create() components must forward their ref to a HTML or SVG element","custom-component-ref"),super.mount(t)}readValueFromInstance(t,e){if(D.has(e))return this.projection?.isProjecting?$(e):W(t,e);{const i=(n=t,window.getComputedStyle(n)),s=(_(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof s?s.trim():s}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return function(t,e){return function({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),i=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}(t.getBoundingClientRect(),e))}(t,e)}build(t,e,n){z(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return Y(t,e,n)}}const fn=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);class yn extends hn{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=J}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(D.has(e)){const t=nt(e);return t&&t.default||0}if(Z.includes(e)){const n=getComputedStyle(t)[e];if("string"==typeof n&&n)return n.trim()}return e=fn.has(e)?e:X(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return Q(t,e,n)}build(t,e,n){tt(t,e,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,e,n,i){!function(t,e,n,i){pn(t,e,void 0,i);for(const n in e.attrs)t.setAttribute(fn.has(n)?n:X(n),e.attrs[n])}(t,e,0,i)}mount(t){this.isSVGTag=et(t.tagName),super.mount(t)}}const vn=st.length;function gn(t){if(!t)return;if(!t.isControllingVariants){const e=t.parent&&gn(t.parent)||{};return void 0!==t.props.initial&&(e.initial=t.props.initial),e}const e={};for(let n=0;nPromise.all(e.map(({animation:e,options:n})=>function(t,e,n={}){let i;if(t.notify("AnimationStart",e),Array.isArray(e)){const s=e.map(e=>ze(t,e,n));i=Promise.all(s)}else if("string"==typeof e)i=ze(t,e,n);else{const s="function"==typeof e?je(t,e,n.custom):e;i=Promise.all(_e(t,s,n))}return i.then(()=>{t.notify("AnimationComplete",e)})}(t,e,n)))}function An(t){let e=xn(t),n=kn(),i=!0,s=!1;const r=e=>(n,i)=>{const s=je(t,i,"exit"===e?t.presenceContext?.custom:void 0);if(s){const{transition:t,transitionEnd:e,...i}=s;n={...n,...i,...e}}return n};function o(o){const{props:a}=t,u=gn(t.parent)||{},l=[],c=new Set;let h={},d=1/0;for(let e=0;ed&&y,T=!1;const x=Array.isArray(f)?f:[f];let A=x.reduce(r(p),{});!1===v&&(A={});const{prevResolvedValues:S={}}=m,M={...S,...A},k=e=>{b=!0,c.has(e)&&(T=!0,c.delete(e)),m.needsAnimating[e]=!0;const n=t.getValue(e);n&&(n.liveStyle=!1)};for(const t in M){const e=A[t],n=S[t];if(h.hasOwnProperty(t))continue;let i=!1;i=qe(e)&&qe(n)?!wn(e,n)||w:e!==n,i?null!=e?k(t):c.add(t):void 0!==e&&c.has(t)?k(t):m.protectedKeys[t]=!0}m.prevProp=f,m.prevResolvedValues=A,m.isActive&&(h={...h,...A}),(i||s)&&t.blockInitialAnimation&&(b=!1);const C=g&&w;b&&(!C||T)&&l.push(...x.map(e=>{const n={type:p};if("string"==typeof e&&(i||s)&&!C&&t.manuallyAnimateOnMount&&t.parent){const{parent:i}=t,s=je(i,e);if(i.enteringChildren&&s){const{delayChildren:e}=s.transition||{};n.delay=Ee(i.enteringChildren,t,e)}}return{animation:e,options:n}}))}if(c.size){const e={};if("boolean"!=typeof a.initial){const n=je(t,Array.isArray(a.initial)?a.initial[0]:a.initial);n&&n.transition&&(e.transition=n.transition)}c.forEach(n=>{const i=t.getBaseTarget(n),s=t.getValue(n);s&&(s.liveStyle=!0),e[n]=i??null}),l.push({animation:e})}let p=Boolean(l.length);return!i||!1!==a.initial&&a.initial!==a.animate||t.manuallyAnimateOnMount||(p=!1),i=!1,s=!1,p?e(l):Promise.resolve()}return{animateChanges:o,setActive:function(e,i){if(n[e].isActive===i)return Promise.resolve();t.variantChildren?.forEach(t=>t.animationState?.setActive(e,i)),n[e].isActive=i;const s=o(e);for(const t in n)n[t].protectedKeys={};return s},setAnimateFunction:function(n){e=n(t)},getState:()=>n,reset:()=>{n=kn(),s=!0}}}function Sn(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!wn(e,t)}function Mn(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function kn(){return{animate:Mn(!0),whileInView:Mn(),whileHover:Mn(),whileTap:Mn(),whileDrag:Mn(),whileFocus:Mn(),exit:Mn()}}function Cn(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n,i)}let En=0;const Vn={animation:{Feature:class extends dn{constructor(t){super(t),t.animationState||(t.animationState=An(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();rt(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}},exit:{Feature:class extends dn{constructor(){super(...arguments),this.id=En++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:e}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===n)return;if(t&&!1===n){if(this.isExitComplete){const{initial:t,custom:e}=this.node.getProps();if("string"==typeof t||"object"==typeof t&&null!==t&&!Array.isArray(t)){const n=je(this.node,t,e);if(n){const{transition:t,transitionEnd:e,...i}=n;for(const t in i)this.node.getValue(t)?.jump(i[t])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);return void(this.isExitComplete=!1)}const i=this.node.animationState.setActive("exit",!t);e&&!t&&i.then(()=>{this.isExitComplete=!0,e(this.id)})}mount(){const{register:t,onExitComplete:e}=this.node.presenceContext||{};e&&e(this.id),t&&(this.unmount=t(this.id))}unmount(){}}}};function Pn(t){return{point:{x:t.pageX,y:t.pageY}}}function Dn(t,e,n){const{props:i}=t;t.animationState&&i.whileHover&&t.animationState.setActive("whileHover","Start"===n);const s=i["onHover"+n];s&&f.postRender(()=>s(e,Pn(e)))}function On(t,e,n){const{props:i}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&i.whileTap&&t.animationState.setActive("whileTap","Start"===n);const s=i["onTap"+("End"===n?"":n)];s&&f.postRender(()=>s(e,Pn(e)))}const In=new WeakMap,Fn=new WeakMap,Ln=t=>{const e=In.get(t.target);e&&e(t)},Rn=t=>{t.forEach(Ln)};function Kn(t,e,n){const i=function({root:t,...e}){const n=t||document;Fn.has(n)||Fn.set(n,{});const i=Fn.get(n),s=JSON.stringify(e);return i[s]||(i[s]=new IntersectionObserver(Rn,{root:t,...e})),i[s]}(e);return In.set(t,n),i.observe(t),()=>{In.delete(t),i.unobserve(t)}}const Bn={some:0,all:1};const jn={renderer:(t,e)=>e.isSVG??at(t)?new yn(e):new mn(e,{allowProjection:t!==ut}),...Vn,...{inView:{Feature:class extends dn{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:t={}}=this.node.getProps(),{root:e,margin:n,amount:i="some",once:s}=t,r={root:e?e.current:void 0,rootMargin:n,threshold:"number"==typeof i?i:Bn[i]};this.stopObserver=Kn(this.node.current,r,t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,s&&!e&&this.hasEnteredView)return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);const{onViewportEnter:n,onViewportLeave:i}=this.node.getProps(),r=e?n:i;r&&r(t)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}(t,e))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}},tap:{Feature:class extends dn{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:e,propagate:n}=this.node.props;this.unmount=cn(t,(t,e)=>(On(this.node,e,"Start"),(t,{success:e})=>On(this.node,t,e?"End":"Cancel")),{useGlobalTarget:e,stopPropagation:!1===n?.tap})}unmount(){}}},focus:{Feature:class extends dn{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){t=!0}t&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=lt(Cn(this.node.current,"focus",()=>this.onFocus()),Cn(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends dn{mount(){const{current:t}=this.node;t&&(this.unmount=en(t,(t,e)=>(Dn(this.node,e,"Start"),t=>Dn(this.node,t,"End"))))}unmount(){}}}}};export{jn as domAnimation}; diff --git a/node_modules/framer-motion/dist/size-rollup-dom-max-assets.js b/node_modules/framer-motion/dist/size-rollup-dom-max-assets.js deleted file mode 100644 index fbd0595..0000000 --- a/node_modules/framer-motion/dist/size-rollup-dom-max-assets.js +++ /dev/null @@ -1 +0,0 @@ -import{createContext as t}from"react";function e(t,e){-1===t.indexOf(e)&&t.push(e)}function s(t,e){const s=t.indexOf(e);s>-1&&t.splice(s,1)}const n=(t,e,s)=>s>e?e:s{},r=()=>{};"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(a=(t,e,s)=>{t||"undefined"==typeof console||console.warn(i(e,s))},r=(t,e,s)=>{if(!t)throw new Error(i(e,s))});const o={},h=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),l=t=>/^0[^.\s]+$/u.test(t);function u(t){let e;return()=>(void 0===e&&(e=t()),e)}const c=t=>t;class d{constructor(){this.subscriptions=[]}add(t){return e(this.subscriptions,t),()=>s(this.subscriptions,t)}notify(t,e,s){const n=this.subscriptions.length;if(n)if(1===n)this.subscriptions[0](t,e,s);else for(let i=0;i1e3*t,f=t=>t/1e3,m=(t,e)=>e?t*(1e3/e):0,g=t=>Array.isArray(t)&&"number"==typeof t[0],v=t({}),y=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function b(t,e){let s=!1,n=!0;const i={delta:0,timestamp:0,isProcessing:!1},a=()=>s=!0,r=y.reduce((t,e)=>(t[e]=function(t){let e=new Set,s=new Set,n=!1,i=!1;const a=new WeakSet;let r={delta:0,timestamp:0,isProcessing:!1};function o(e){a.has(e)&&(h.schedule(e),t()),e(r)}const h={schedule:(t,i=!1,r=!1)=>{const o=r&&n?e:s;return i&&a.add(t),o.add(t),t},cancel:t=>{s.delete(t),a.delete(t)},process:t=>{if(r=t,n)return void(i=!0);n=!0;const a=e;e=s,s=a,e.forEach(o),e.clear(),n=!1,i&&(i=!1,h.process(t))}};return h}(a),t),{}),{setup:h,read:l,resolveKeyframes:u,preUpdate:c,update:d,preRender:p,render:f,postRender:m}=r,g=()=>{const a=o.useManualTiming,r=a?i.timestamp:performance.now();s=!1,a||(i.delta=n?1e3/60:Math.max(Math.min(r-i.timestamp,40),1)),i.timestamp=r,i.isProcessing=!0,h.process(i),l.process(i),u.process(i),c.process(i),d.process(i),p.process(i),f.process(i),m.process(i),i.isProcessing=!1,s&&e&&(n=!1,t(g))};return{schedule:y.reduce((e,a)=>{const o=r[a];return e[a]=(e,a=!1,r=!1)=>(s||(s=!0,n=!0,i.isProcessing||t(g)),o.schedule(e,a,r)),e},{}),cancel:t=>{for(let e=0;e(void 0===T&&A.set(S.isProcessing||o.useManualTiming?S.timestamp:performance.now()),T),set:t=>{T=t,queueMicrotask(x)}},C=t=>e=>"string"==typeof e&&e.startsWith(t),k=C("--"),F=C("var(--"),E=t=>!!F(t)&&P.test(t.split("/*")[0].trim()),P=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function R(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const B={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},I={...B,transform:t=>n(0,1,t)},N={...B,default:1},O=t=>Math.round(1e5*t)/1e5,$=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const L=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Y=(t,e)=>s=>Boolean("string"==typeof s&&L.test(s)&&s.startsWith(t)||e&&!function(t){return null==t}(s)&&Object.prototype.hasOwnProperty.call(s,e)),W=(t,e,s)=>n=>{if("string"!=typeof n)return n;const[i,a,r,o]=n.match($);return{[t]:parseFloat(i),[e]:parseFloat(a),[s]:parseFloat(r),alpha:void 0!==o?parseFloat(o):1}},X={...B,transform:t=>Math.round((t=>n(0,255,t))(t))},j={test:Y("rgb","red"),parse:W("red","green","blue"),transform:({red:t,green:e,blue:s,alpha:n=1})=>"rgba("+X.transform(t)+", "+X.transform(e)+", "+X.transform(s)+", "+O(I.transform(n))+")"};const z={test:Y("#"),parse:function(t){let e="",s="",n="",i="";return t.length>5?(e=t.substring(1,3),s=t.substring(3,5),n=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),s=t.substring(2,3),n=t.substring(3,4),i=t.substring(4,5),e+=e,s+=s,n+=n,i+=i),{red:parseInt(e,16),green:parseInt(s,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}},transform:j.transform},K=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),U=K("deg"),Z=K("%"),D=K("px"),q=K("vh"),H=K("vw"),_=(()=>({...Z,parse:t=>Z.parse(t)/100,transform:t=>Z.transform(100*t)}))(),G={test:Y("hsl","hue"),parse:W("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:s,alpha:n=1})=>"hsla("+Math.round(t)+", "+Z.transform(O(e))+", "+Z.transform(O(s))+", "+O(I.transform(n))+")"},J={test:t=>j.test(t)||z.test(t)||G.test(t),parse:t=>j.test(t)?j.parse(t):G.test(t)?G.parse(t):z.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?j.transform(t):G.transform(t),getAnimatableNone:t=>{const e=J.parse(t);return e.alpha=0,J.transform(e)}},Q=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const tt="number",et="color",st=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function nt(t){const e=t.toString(),s=[],n={color:[],number:[],var:[]},i=[];let a=0;const r=e.replace(st,t=>(J.test(t)?(n.color.push(a),i.push(et),s.push(J.parse(t))):t.startsWith("var(")?(n.var.push(a),i.push("var"),s.push(t)):(n.number.push(a),i.push(tt),s.push(parseFloat(t))),++a,"${}")).split("${}");return{values:s,split:r,indexes:n,types:i}}function it({split:t,types:e}){const s=t.length;return n=>{let i="";for(let a=0;a{return"number"==typeof t?e?.trim().endsWith("/")?t:0:"number"==typeof(s=t)?0:J.test(s)?J.getAnimatableNone(s):s;var s};const rt={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match($)?.length||0)+(t.match(Q)?.length||0)>0},parse:function(t){return nt(t).values},createTransformer:function(t){return it(nt(t))},getAnimatableNone:function(t){const e=nt(t);return it(e)(e.values.map((t,s)=>at(t,e.split[s])))}},ot=(t,e,s)=>t+(e-t)*s,ht=(t,e,s=10)=>{let n="";const i=Math.max(Math.round(e/s),2);for(let e=0;enull!==t;function ut(t,{repeat:e,repeatType:s="loop"},n,i=1){const a=t.filter(lt),r=i<0||e&&"loop"!==s&&e%2==1?0:a.length-1;return r&&void 0!==n?n:a[r]}class ct{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const dt=t=>180*t/Math.PI,pt=t=>{const e=dt(Math.atan2(t[1],t[0]));return mt(e)},ft={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:pt,rotateZ:pt,skewX:t=>dt(Math.atan(t[1])),skewY:t=>dt(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},mt=t=>((t%=360)<0&&(t+=360),t),gt=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),vt=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),yt={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:gt,scaleY:vt,scale:t=>(gt(t)+vt(t))/2,rotateX:t=>mt(dt(Math.atan2(t[6],t[5]))),rotateY:t=>mt(dt(Math.atan2(-t[2],t[0]))),rotateZ:pt,rotate:pt,skewX:t=>dt(Math.atan(t[4])),skewY:t=>dt(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function bt(t){return t.includes("scale")?1:0}function wt(t,e){if(!t||"none"===t)return bt(e);const s=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let n,i;if(s)n=yt,i=s;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);n=ft,i=e}if(!i)return bt(e);const a=n[e],r=i[1].split(",").map(St);return"function"==typeof a?a(r):r[a]}const Vt=(t,e)=>{const{transform:s="none"}=getComputedStyle(t);return wt(s,e)};function St(t){return parseFloat(t.trim())}const Mt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Tt=(()=>new Set([...Mt,"pathRotation"]))(),xt=t=>t===B||t===D,At=new Set(["x","y","z"]),Ct=Mt.filter(t=>!At.has(t));const kt={width:({x:t},{paddingLeft:e="0",paddingRight:s="0",boxSizing:n})=>{const i=t.max-t.min;return"border-box"===n?i:i-parseFloat(e)-parseFloat(s)},height:({y:t},{paddingTop:e="0",paddingBottom:s="0",boxSizing:n})=>{const i=t.max-t.min;return"border-box"===n?i:i-parseFloat(e)-parseFloat(s)},top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>wt(e,"x"),y:(t,{transform:e})=>wt(e,"y")};kt.translateX=kt.x,kt.translateY=kt.y;const Ft=new Set;let Et=!1,Pt=!1,Rt=!1;function Bt(){if(Pt){const t=Array.from(Ft).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),s=new Map;e.forEach(t=>{const e=function(t){const e=[];return Ct.forEach(s=>{const n=t.getValue(s);void 0!==n&&(e.push([s,n.get()]),n.set(s.startsWith("scale")?1:0))}),e}(t);e.length&&(s.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=s.get(t);e&&e.forEach(([e,s])=>{t.getValue(e)?.set(s)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}Pt=!1,Et=!1,Ft.forEach(t=>t.complete(Rt)),Ft.clear()}function It(){Ft.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Pt=!0)})}function Nt(){Rt=!0,It(),Bt(),Rt=!1}class Ot{constructor(t,e,s,n,i,a=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=s,this.motionValue=n,this.element=i,this.isAsync=a}scheduleResolve(){this.state="scheduled",this.isAsync?(Ft.add(this),Et||(Et=!0,w.read(It),w.resolveKeyframes(Bt))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:s,motionValue:n}=this;if(null===t[0]){const i=n?.get(),a=t[t.length-1];if(void 0!==i)t[0]=i;else if(s&&e){const n=s.readValue(e,a);null!=n&&(t[0]=n)}void 0===t[0]&&(t[0]=a),n&&void 0===i&&n.set(t[0])}!function(t){for(let e=1;et.startsWith("--"))(e)?t.style.setProperty(e,s):t.style[e]=s}const Lt={};function Yt(t,e){const s=u(t);return()=>Lt[e]??s()}const Wt=Yt(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),Xt=Yt(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),jt=([t,e,s,n])=>`cubic-bezier(${t}, ${e}, ${s}, ${n})`,zt={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:jt([0,.65,.55,1]),circOut:jt([.55,0,1,.45]),backIn:jt([.31,.01,.66,-.59]),backOut:jt([.33,1.53,.69,.99])};function Kt(t,e){return t?"function"==typeof t?Xt()?ht(t,e):"ease-out":g(t)?jt(t):Array.isArray(t)?t.map(t=>Kt(t,e)||zt.easeOut):zt[t]:void 0}function Ut(t,e,s,{delay:n=0,duration:i=300,repeat:a=0,repeatType:r="loop",ease:o="easeOut",times:h}={},l=void 0){const u={[e]:s};h&&(u.offset=h);const c=Kt(o,i);Array.isArray(c)&&(u.easing=c);const d={delay:n,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:a+1,direction:"reverse"===r?"alternate":"normal"};return l&&(d.pseudoElement=l),t.animate(u,d)}function Zt(t){return"function"==typeof t&&"applyToOptions"in t}class Dt extends ct{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:e,name:s,keyframes:n,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:h}=t;this.isPseudoElement=Boolean(i),this.allowFlatten=a,this.options=t,r("string"!=typeof t.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const l=function({type:t,...e}){return Zt(t)&&Xt()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=Ut(e,s,n,l,i),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const t=ut(n,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(t),$t(e,s,t),this.animation.cancel()}h?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return f(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+f(t)}get time(){return f(Number(this.animation.currentTime)||0)}set time(t){const e=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=p(t),e&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:e,rangeEnd:s,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&Wt()?(this.animation.timeline=t,e&&(this.animation.rangeStart=e),s&&(this.animation.rangeEnd=s),c):n(this)}}const qt=new Set(["opacity","clipPath","filter","transform","backgroundColor"]);class Ht{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=A.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=A.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new d);const s=this.events[t].add(e);return"change"===t?()=>{s(),w.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,s){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-s}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=A.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return m(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function _t(t,e){return new Ht(t,e)}function Gt(t){const e=[{},{}];return t?.values.forEach((t,s)=>{e[0][s]=t.get(),e[1][s]=t.getVelocity()}),e}function Jt(t,e,s,n){if("function"==typeof e){const[i,a]=Gt(n);e=e(void 0!==s?s:t.custom,i,a)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[i,a]=Gt(n);e=e(void 0!==s?s:t.custom,i,a)}return e}const Qt=t=>Boolean(t&&t.getVelocity);function te(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const ee="data-"+te("framerAppearId"),se=t=>e=>e.test(t),ne=[B,D,Z,U,H,q,{test:t=>"auto"===t,parse:t=>t}],ie=t=>ne.find(se(t)),ae=new Set(["brightness","contrast","saturate","opacity"]);function re(t){const[e,s]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[n]=s.match($)||[];if(!n)return t;const i=s.replace(n,"");let a=ae.has(e)?1:0;return n!==s&&(a*=100),e+"("+a+i+")"}const oe=/\b([a-z-]*)\(.*?\)/gu,he={...rt,getAnimatableNone:t=>{const e=t.match(oe);return e?e.map(re).join(" "):t}},le={...rt,getAnimatableNone:t=>{const e=rt.parse(t);return rt.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},ue={...B,transform:Math.round},ce={borderWidth:D,borderTopWidth:D,borderRightWidth:D,borderBottomWidth:D,borderLeftWidth:D,borderRadius:D,borderTopLeftRadius:D,borderTopRightRadius:D,borderBottomRightRadius:D,borderBottomLeftRadius:D,width:D,maxWidth:D,height:D,maxHeight:D,top:D,right:D,bottom:D,left:D,inset:D,insetBlock:D,insetBlockStart:D,insetBlockEnd:D,insetInline:D,insetInlineStart:D,insetInlineEnd:D,padding:D,paddingTop:D,paddingRight:D,paddingBottom:D,paddingLeft:D,paddingBlock:D,paddingBlockStart:D,paddingBlockEnd:D,paddingInline:D,paddingInlineStart:D,paddingInlineEnd:D,margin:D,marginTop:D,marginRight:D,marginBottom:D,marginLeft:D,marginBlock:D,marginBlockStart:D,marginBlockEnd:D,marginInline:D,marginInlineStart:D,marginInlineEnd:D,fontSize:D,backgroundPositionX:D,backgroundPositionY:D,...{rotate:U,pathRotation:U,rotateX:U,rotateY:U,rotateZ:U,scale:N,scaleX:N,scaleY:N,scaleZ:N,skew:U,skewX:U,skewY:U,distance:D,translateX:D,translateY:D,translateZ:D,x:D,y:D,z:D,perspective:D,transformPerspective:D,opacity:I,originX:_,originY:_,originZ:D},zIndex:ue,fillOpacity:I,strokeOpacity:I,numOctaves:ue},de={...ce,color:J,backgroundColor:J,outlineColor:J,fill:J,stroke:J,borderColor:J,borderTopColor:J,borderRightColor:J,borderBottomColor:J,borderLeftColor:J,filter:he,WebkitFilter:he,mask:le,WebkitMask:le},pe=t=>de[t],fe=new Set([he,le]);function me(t,e){let s=pe(t);return fe.has(s)||(s=rt),s.getAnimatableNone?s.getAnimatableNone(e):void 0}const ge=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"],ve=(t,e)=>e&&"number"==typeof t?e.transform(t):t,{schedule:ye}=b(queueMicrotask,!1),be=[...ne,J,rt],we=()=>({x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}),Ve=()=>({x:{min:0,max:0},y:{min:0,max:0}}),Se=new WeakMap;function Me(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function Te(t){return"string"==typeof t||Array.isArray(t)}const xe=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Ae=["initial",...xe];function Ce(t){return Me(t.animate)||Ae.some(e=>Te(t[e]))}function ke(t){return Boolean(Ce(t)||t.variants)}const Fe={current:null},Ee={current:!1},Pe="undefined"!=typeof window;const Re=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Be={};function Ie(t){Be=t}function Ne(){return Be}class Oe{scrapeMotionValuesFromProps(t,e,s){return{}}constructor({parent:t,props:e,presenceContext:s,reducedMotionConfig:n,skipAnimations:i,blockInitialAnimation:a,visualState:r},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Ot,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const t=A.now();this.renderScheduledAtthis.bindToMotionValue(e,t)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(Ee.current||function(){if(Ee.current=!0,Pe)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Fe.current=t.matches;t.addEventListener("change",e),e()}else Fe.current=!1}(),this.shouldReduceMotion=Fe.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),V(this.notifyUpdate),V(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,e){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),e.accelerate&&qt.has(t)&&this.current instanceof HTMLElement){const{factory:s,keyframes:n,times:i,ease:a,duration:r}=e.accelerate,o=new Dt({element:this.current,name:t,keyframes:n,times:i,ease:a,duration:p(r)}),h=s(o);return void this.valueSubscriptions.set(t,()=>{h(),o.cancel()})}const s=Tt.has(t);s&&this.onBindTransform&&this.onBindTransform();const n=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&w.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{n(),i&&i()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in Be){const e=Be[t];if(!e)continue;const{isEnabled:s,Feature:n}=e;if(!this.features[t]&&n&&s(this.props)&&(this.features[t]=new n(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;ee.variantChildren.delete(t)}addValue(t,e){const s=this.values.get(t);e!==s&&(s&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let s=this.values.get(t);return void 0===s&&void 0!==e&&(s=_t(null===e?void 0:e,{owner:this}),this.addValue(t,s)),s}readValue(t,e){let s=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var n;return null!=s&&("string"==typeof s&&(h(s)||l(s))?s=parseFloat(s):(n=s,!be.find(se(n))&&rt.test(e)&&(s=me(t,e))),this.setBaseTarget(t,Qt(s)?s.get():s)),Qt(s)?s.get():s}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let s;if("string"==typeof e||"object"==typeof e){const n=Jt(this.props,e,this.presenceContext?.custom);n&&(s=n[t])}if(e&&void 0!==s)return s;const n=this.getBaseTargetFromProps(this.props,t);return void 0===n||Qt(n)?void 0!==this.initialValues[t]&&void 0===s?void 0:this.baseTarget[t]:n}on(t,e){return this.events[t]||(this.events[t]=new d),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){ye.render(this.render)}}const $e={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Le=Mt.length;function Ye(t,e,s){const{style:n,vars:i,transformOrigin:a}=t;let r=!1,o=!1;for(const t in e){const s=e[t];if(Tt.has(t))r=!0;else if(k(t))i[t]=s;else{const e=ve(s,ce[t]);t.startsWith("origin")?(o=!0,a[t]=e):n[t]=e}}if(e.transform||(r||s?n.transform=function(t,e,s){let n="",i=!0;for(let a=0;a{if(!e.target)return t;if("string"==typeof t){if(!D.test(t))return t;t=parseFloat(t)}return`${We(t,e.target.x)}% ${We(t,e.target.y)}%`}},je={correct:(t,{treeScale:e,projectionDelta:s})=>{const n=t,i=rt.parse(t);if(i.length>5)return n;const a=rt.createTransformer(t),r="number"!=typeof i[0]?1:0,o=s.x.scale*e.x,h=s.y.scale*e.y;i[0+r]/=o,i[1+r]/=h;const l=ot(o,h,.5);return"number"==typeof i[2+r]&&(i[2+r]/=l),"number"==typeof i[3+r]&&(i[3+r]/=l),a(i)}},ze={borderRadius:{...Xe,applyTo:[...ge]},borderTopLeftRadius:Xe,borderTopRightRadius:Xe,borderBottomLeftRadius:Xe,borderBottomRightRadius:Xe,boxShadow:je};function Ke(t,{layout:e,layoutId:s}){return Tt.has(t)||t.startsWith("origin")||(e||void 0!==s)&&(!!ze[t]||"opacity"===t)}function Ue(t,e,s){const n=t.style,i=e?.style,a={};if(!n)return a;for(const e in n)(Qt(n[e])||i&&Qt(i[e])||Ke(e,t)||void 0!==s?.getValue(e)?.liveStyle)&&(a[e]=n[e]);return a}const Ze={offset:"stroke-dashoffset",array:"stroke-dasharray"},De={offset:"strokeDashoffset",array:"strokeDasharray"};const qe=["transform","opacity","offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function He(t,{attrX:e,attrY:s,attrScale:n,pathLength:i,pathSpacing:a=1,pathOffset:r=0,...o},h,l,u){if(Ye(t,o,l),h)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:c,style:d}=t;for(const t of qe)void 0!==c[t]&&(d[t]=c[t],delete c[t]);(d.transform||c.transformOrigin)&&(d.transformOrigin=c.transformOrigin??"50% 50%",delete c.transformOrigin),d.transform&&(d.transformBox=u?.transformBox??"fill-box",delete c.transformBox),void 0!==e&&(c.x=e),void 0!==s&&(c.y=s),void 0!==n&&(c.scale=n),void 0!==i&&function(t,e,s=1,n=0,i=!0){t.pathLength=1;const a=i?Ze:De;t[a.offset]=""+-n,t[a.array]=`${e} ${s}`}(c,i,a,r,!1)}const _e=t=>"string"==typeof t&&"svg"===t.toLowerCase();function Ge(t,e,s){const n=Ue(t,e,s);for(const s in t)if(Qt(t[s])||Qt(e[s])){n[-1!==Mt.indexOf(s)?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s]=t[s]}return n}function Je(t){return Qt(t)?t.get():t}const Qe=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function ts(t){return"string"==typeof t&&!t.includes("-")&&!!(Qe.indexOf(t)>-1||/[A-Z]/u.test(t))}const es=t(null),ss=t({});function ns(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}export{h as $,E as A,J as B,rt as C,nt as D,S as E,A as F,V as G,w as H,f as I,n as J,ht as K,v as L,p as M,m as N,o as O,es as P,ut as Q,Dt as R,ss as S,$t as T,Zt as U,u as V,ct as W,qt as X,Ot as Y,Nt as Z,Tt as _,Te as a,Mt as a0,_t as a1,l as a2,me as a3,ie as a4,R as a5,kt as a6,xt as a7,Oe as a8,bt as a9,Vt as aa,k as ab,te as ac,Ve as ad,qe as ae,pe as af,Ae as ag,xe as ah,Z as ai,ge as aj,D as ak,e as al,s as am,d as an,M as ao,ye as ap,we as aq,ze as ar,Qt as b,Ke as c,Ye as d,He as e,_e as f,ts as g,ke as h,Ce as i,Me as j,Jt as k,Ge as l,Ne as m,Ie as n,ee as o,ns as p,c as q,Je as r,Ue as s,g as t,r as u,ot as v,j as w,G as x,z as y,a as z}; diff --git a/node_modules/framer-motion/dist/size-rollup-dom-max.js b/node_modules/framer-motion/dist/size-rollup-dom-max.js deleted file mode 100644 index d4b68f3..0000000 --- a/node_modules/framer-motion/dist/size-rollup-dom-max.js +++ /dev/null @@ -1 +0,0 @@ -import{q as t,t as e,u as i,v as n,w as s,x as o,y as r,z as a,A as l,B as h,C as u,D as c,E as d,F as m,G as p,H as f,I as y,J as g,K as v,M as x,N as T,O as P,W as w,Q as S,R as E,T as A,U as D,V as b,X as M,Y as k,Z as C,_ as V,$ as L,k as R,a0 as B,a1 as j,b as I,o as O,a2 as F,a3 as U,a4 as z,a5 as W,a6 as $,a7 as N,a8 as G,a9 as H,aa as K,ab as Y,d as X,s as q,ac as _,ad as Z,ae as J,l as Q,e as tt,f as et,af as it,a as nt,ag as st,j as ot,ah as rt,ai as at,aj as lt,ak as ht,al as ut,am as ct,an as dt,ao as mt,ap as pt,aq as ft,r as yt,ar as gt,p as vt,P as xt,L as Tt,S as Pt,g as wt}from"./size-rollup-dom-max-assets.js";import{jsx as St}from"react/jsx-runtime";import{useContext as Et,useId as At,useEffect as Dt,useCallback as bt,Component as Mt,Fragment as kt}from"react";const Ct=t=>"object"==typeof t&&null!==t,Vt=(...t)=>t.reduce((t,e)=>i=>e(t(i))),Lt=(t,e,i)=>{const n=e-t;return n?(i-t)/n:1},Rt=(t,e,i)=>(((1-3*i+3*e)*t+(3*i-6*e))*t+3*e)*t;function Bt(e,i,n,s){if(e===i&&n===s)return t;const o=t=>function(t,e,i,n,s){let o,r,a=0;do{r=e+(i-e)/2,o=Rt(r,n,s)-t,o>0?i=r:e=r}while(Math.abs(o)>1e-7&&++a<12);return r}(t,0,1,e,n);return t=>0===t||1===t?t:Rt(o(t),i,s)}const jt=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,It=t=>e=>1-t(1-e),Ot=Bt(.33,1.53,.69,.99),Ft=It(Ot),Ut=jt(Ft),zt=t=>t>=1?1:(t*=2)<1?.5*Ft(t):.5*(2-Math.pow(2,-10*(t-1))),Wt=t=>1-Math.sin(Math.acos(t)),$t=It(Wt),Nt=jt(Wt),Gt=Bt(.42,0,1,1),Ht=Bt(0,0,.58,1),Kt=Bt(.42,0,.58,1),Yt={linear:t,easeIn:Gt,easeInOut:Kt,easeOut:Ht,circIn:Wt,circInOut:Nt,circOut:$t,backIn:Ft,backInOut:Ut,backOut:Ot,anticipate:zt},Xt=t=>{if(e(t)){i(4===t.length,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[e,n,s,o]=t;return Bt(e,n,s,o)}return"string"==typeof t?(i(void 0!==Yt[t],`Invalid easing type '${t}'`,"invalid-easing-type"),Yt[t]):t};function qt(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}function _t(t,e){return i=>i>0?e:t}const Zt=(t,e,i)=>{const n=t*t,s=i*(e*e-n)+n;return s<0?0:Math.sqrt(s)},Jt=[r,s,o];function Qt(t){const e=(i=t,Jt.find(t=>t.test(i)));var i;if(a(Boolean(e),`'${t}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!Boolean(e))return!1;let n=e.parse(t);return e===o&&(n=function({hue:t,saturation:e,lightness:i,alpha:n}){t/=360,i/=100;let s=0,o=0,r=0;if(e/=100){const n=i<.5?i*(1+e):i+e-i*e,a=2*i-n;s=qt(a,n,t+1/3),o=qt(a,n,t),r=qt(a,n,t-1/3)}else s=o=r=i;return{red:Math.round(255*s),green:Math.round(255*o),blue:Math.round(255*r),alpha:n}}(n)),n}const te=(t,e)=>{const i=Qt(t),o=Qt(e);if(!i||!o)return _t(t,e);const r={...i};return t=>(r.red=Zt(i.red,o.red,t),r.green=Zt(i.green,o.green,t),r.blue=Zt(i.blue,o.blue,t),r.alpha=n(i.alpha,o.alpha,t),s.transform(r))},ee=new Set(["none","hidden"]);function ie(t,e){return i=>n(t,e,i)}function ne(t){return"number"==typeof t?ie:"string"==typeof t?l(t)?_t:h.test(t)?te:re:Array.isArray(t)?se:"object"==typeof t?h.test(t)?te:oe:_t}function se(t,e){const i=[...t],n=i.length,s=t.map((t,i)=>ne(t)(t,e[i]));return t=>{for(let e=0;e{for(const e in n)i[e]=n[e](t);return i}}const re=(t,e)=>{const i=u.createTransformer(e),n=c(t),s=c(e);return n.indexes.var.length===s.indexes.var.length&&n.indexes.color.length===s.indexes.color.length&&n.indexes.number.length>=s.indexes.number.length?ee.has(t)&&!s.values.length||ee.has(e)&&!n.values.length?function(t,e){return ee.has(t)?i=>i<=0?t:e:i=>i>=1?e:t}(t,e):Vt(se(function(t,e){const i=[],n={color:0,var:0,number:0};for(let s=0;s{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>f.update(e,t),stop:()=>p(e),now:()=>d.isProcessing?d.timestamp:m.now()}},he=2e4;function ue(t){let e=0;let i=t.next(e);for(;!i.done&&e=he?1/0:e}const ce=100,de=10,me=1,pe=0,fe=800,ye=.3,ge=.3,ve={granular:.01,default:2},xe={granular:.005,default:.5},Te=.01,Pe=10,we=.05,Se=1;function Ee(t,e){return t*Math.sqrt(1-e*e)}const Ae=.001;const De=["duration","bounce"],be=["stiffness","damping","mass"];function Me(t,e){return e.some(e=>void 0!==t[e])}function ke(t){let e={velocity:pe,stiffness:ce,damping:de,mass:me,isResolvedFromDuration:!1,...t};if(!Me(t,be)&&Me(t,De))if(e.velocity=0,t.visualDuration){const i=t.visualDuration,n=2*Math.PI/(1.2*i),s=n*n,o=2*g(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:me,stiffness:s,damping:o}}else{const i=function({duration:t=fe,bounce:e=ye,velocity:i=pe,mass:n=me}){let s,o;a(t<=x(Pe),"Spring duration must be 10 seconds or less","spring-duration-limit");let r=1-e;r=g(we,Se,r),t=g(Te,Pe,y(t)),r<1?(s=e=>{const n=e*r,s=n*t,o=n-i,a=Ee(e,r),l=Math.exp(-s);return Ae-o/a*l},o=e=>{const n=e*r*t,o=n*i+i,a=Math.pow(r,2)*Math.pow(e,2)*t,l=Math.exp(-n),h=Ee(Math.pow(e,2),r);return(-s(e)+Ae>0?-1:1)*((o-a)*l)/h}):(s=e=>Math.exp(-e*t)*((e-i)*t+1)-.001,o=e=>Math.exp(-e*t)*(t*t*(i-e)));const l=function(t,e,i){let n=i;for(let i=1;i<12;i++)n-=t(n)/e(n);return n}(s,o,5/t);if(t=x(t),isNaN(l))return{stiffness:ce,damping:de,duration:t};{const e=Math.pow(l,2)*n;return{stiffness:e,damping:2*r*Math.sqrt(n*e),duration:t}}}({...t,velocity:0});e={...e,...i,mass:me},e.isResolvedFromDuration=!0}return e}function Ce(t=ge,e=ye){const i="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:n,restDelta:s}=i;const o=i.keyframes[0],r=i.keyframes[i.keyframes.length-1],a={done:!1,value:o},{stiffness:l,damping:h,mass:u,duration:c,velocity:d,isResolvedFromDuration:m}=ke({...i,velocity:-y(i.velocity||0)}),p=d||0,f=h/(2*Math.sqrt(l*u)),g=r-o,T=y(Math.sqrt(l/u)),P=Math.abs(g)<5;let w,S,E,A,D,b;if(n||(n=P?ve.granular:ve.default),s||(s=P?xe.granular:xe.default),f<1)E=Ee(T,f),A=(p+f*T*g)/E,w=t=>{const e=Math.exp(-f*T*t);return r-e*(A*Math.sin(E*t)+g*Math.cos(E*t))},D=f*T*A+g*E,b=f*T*g-A*E,S=t=>Math.exp(-f*T*t)*(D*Math.sin(E*t)+b*Math.cos(E*t));else if(1===f){w=t=>r-Math.exp(-T*t)*(g+(p+T*g)*t);const t=p+T*g;S=e=>Math.exp(-T*e)*(T*t*e-p)}else{const t=T*Math.sqrt(f*f-1);w=e=>{const i=Math.exp(-f*T*e),n=Math.min(t*e,300);return r-i*((p+f*T*g)*Math.sinh(n)+t*g*Math.cosh(n))/t};const e=(p+f*T*g)/t,i=f*T*e-g*t,n=f*T*g-e*t;S=e=>{const s=Math.exp(-f*T*e),o=Math.min(t*e,300);return s*(i*Math.sinh(o)+n*Math.cosh(o))}}const M={calculatedDuration:m&&c||null,velocity:t=>x(S(t)),next:t=>{if(!m&&f<1){const e=Math.exp(-f*T*t),i=Math.sin(E*t),o=Math.cos(E*t),l=r-e*(A*i+g*o),h=x(e*(D*i+b*o));return a.done=Math.abs(h)<=n&&Math.abs(r-l)<=s,a.value=a.done?r:l,a}const e=w(t);if(m)a.done=t>=c;else{const i=x(S(t));a.done=Math.abs(i)<=n&&Math.abs(r-e)<=s}return a.value=a.done?r:e,a},toString:()=>{const t=Math.min(ue(M),he),e=v(e=>M.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return M}Ce.applyToOptions=t=>{const e=function(t,e=100,i){const n=i({...t,keyframes:[0,e]}),s=Math.min(ue(n),he);return{type:"keyframes",ease:t=>n.next(s*t).value/e,duration:y(s)}}(t,100,Ce);return t.ease=e.ease,t.duration=x(e.duration),t.type="keyframes",t};function Ve(t,e,i){const n=Math.max(e-5,0);return T(i-t(n),e-n)}function Le({keyframes:t,velocity:e=0,power:i=.8,timeConstant:n=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:l,restDelta:h=.5,restSpeed:u}){const c=t[0],d={done:!1,value:c},m=t=>void 0===a?l:void 0===l||Math.abs(a-t)-p*Math.exp(-t/n),v=t=>y+g(t),x=t=>{const e=g(t),i=v(t);d.done=Math.abs(e)<=h,d.value=d.done?y:i};let T,P;const w=t=>{var e;(e=d.value,void 0!==a&&el)&&(T=t,P=Ce({keyframes:[d.value,m(d.value)],velocity:Ve(v,t,d.value),damping:s,stiffness:o,restDelta:h,restSpeed:u}))};return w(0),{calculatedDuration:null,next:t=>{let e=!1;return P||void 0!==T||(e=!0,x(t),w(t)),void 0!==T&&t>=T?P.next(t-T):(!e&&x(t),d)}}}function Re(e,n,{clamp:s=!0,ease:o,mixer:r}={}){const a=e.length;if(i(a===n.length,"Both input and output ranges must be the same length","range-length"),1===a)return()=>n[0];if(2===a&&n[0]===n[1])return()=>n[1];const l=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),n=[...n].reverse());const h=function(e,i,n){const s=[],o=n||P.mix||ae,r=e.length-1;for(let n=0;n{if(l&&t1)for(;ic(g(e[0],e[a-1],t)):c}function Be(t){const e=[0];return function(t,e){const i=t[t.length-1];for(let s=1;s<=e;s++){const o=Lt(0,e,s);t.push(n(i,1,o))}}(e,t.length-1),e}function je({duration:t=300,keyframes:e,times:i,ease:n="easeInOut"}){const s=(t=>Array.isArray(t)&&"number"!=typeof t[0])(n)?n.map(Xt):Xt(n),o={done:!1,value:e[0]},r=function(t,e){return t.map(t=>t*e)}(i&&i.length===e.length?i:Be(e),t),a=Re(r,e,{ease:Array.isArray(s)?s:(l=e,h=s,l.map(()=>h||Kt).splice(0,l.length-1))});var l,h;return{calculatedDuration:t,next:e=>(o.value=a(e),o.done=e>=t,o)}}const Ie={decay:Le,inertia:Le,tween:je,keyframes:je,spring:Ce};function Oe(t){"string"==typeof t.type&&(t.type=Ie[t.type])}const Fe=t=>t/100;class Ue extends w{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:t}=this.options;t&&t.updatedAt!==m.now()&&this.tick(m.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;Oe(t);const{type:e=je,repeat:i=0,repeatDelay:n=0,repeatType:s,velocity:o=0}=t;let{keyframes:r}=t;const a=e||je;a!==je&&"number"!=typeof r[0]&&(this.mixKeyframes=Vt(Fe,ae(r[0],r[1])),r=[0,100]);const l=a({...t,keyframes:r});"mirror"===s&&(this.mirroredGenerator=a({...t,keyframes:[...r].reverse(),velocity:-o})),null===l.calculatedDuration&&(l.calculatedDuration=ue(l));const{calculatedDuration:h}=l;this.calculatedDuration=h,this.resolvedDuration=h+n,this.totalDuration=this.resolvedDuration*(i+1)-n,this.generator=l}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,e=!1){const{generator:i,totalDuration:n,mixKeyframes:s,mirroredGenerator:o,resolvedDuration:r,calculatedDuration:a}=this;if(null===this.startTime)return i.next(0);const{delay:l=0,keyframes:h,repeat:u,repeatType:c,repeatDelay:d,type:m,onUpdate:p,finalKeyframe:f}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-n/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const y=this.currentTime-l*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?y<0:y>n;this.currentTime=Math.max(y,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=n);let x,T=this.currentTime,P=i;if(u){const t=Math.min(this.currentTime,n)/r;let e=Math.floor(t),i=t%1;!i&&t>=1&&(i=1),1===i&&e--,e=Math.min(e,u+1);Boolean(e%2)&&("reverse"===c?(i=1-i,d&&(i-=d/r)):"mirror"===c&&(P=o)),T=g(0,1,i)*r}v?(this.delayState.value=h[0],x=this.delayState):x=P.next(T),s&&!v&&(x.value=s(x.value));let{done:w}=x;v||null===a||(w=this.playbackSpeed>=0?this.currentTime>=n:this.currentTime<=0);const E=null===this.holdTime&&("finished"===this.state||"running"===this.state&&w);return E&&m!==Le&&(x.value=S(h,this.options,f,this.speed)),p&&p(x.value),E&&this.finish(),x}then(t,e){return this.finished.then(t,e)}get duration(){return y(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+y(t)}get time(){return y(this.currentTime)}set time(t){t=x(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);return Ve(t=>this.generator.next(t).value,t,this.generator.next(t).value)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;e&&this.driver&&this.updateTime(m.now()),this.playbackSpeed=t,e&&this.driver&&(this.time=y(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=le,startTime:e}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),this.options.onPlay?.();const i=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=i):null!==this.holdTime?this.startTime=i-this.holdTime:this.startTime||(this.startTime=e??i),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(m.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}const ze={anticipate:zt,backInOut:Ut,circInOut:Nt};function We(t){"string"==typeof t.ease&&t.ease in ze&&(t.ease=ze[t.ease])}class $e extends E{constructor(t){We(t),Oe(t),super(t),void 0!==t.startTime&&!1!==t.autoplay&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:e,onUpdate:i,onComplete:n,element:s,...o}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);const r=new Ue({...o,autoplay:!1}),a=Math.max(10,m.now()-this.startTime),l=g(0,10,a-10),h=r.sample(a).value,{name:u}=this.options;s&&u&&A(s,u,h),e.setWithVelocity(r.sample(Math.max(0,a-l)).value,h,l),r.stop()}}const Ne=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!u.test(t)&&"0"!==t||t.startsWith("url(")));function Ge(t){t.duration=0,t.type="keyframes"}const He=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;const Ke=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),Ye=b(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Xe(t){const{motionValue:e,name:i,repeatDelay:n,repeatType:s,damping:o,type:r,keyframes:a}=t,l=e?.owner?.current;if(!(l instanceof HTMLElement||l instanceof SVGElement))return!1;const{onUpdate:h,transformTemplate:u}=e.owner.getProps();return Ye()&&i&&(M.has(i)||Ke.has(i)&&function(t){for(let e=0;e{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=m.now();const c={autoplay:t,delay:e,type:i,repeat:n,repeatDelay:s,repeatType:o,name:a,motionValue:l,element:h,...u},d=h?.KeyframeResolver||k;this.keyframeResolver=new d(r,(t,e,i)=>this.onKeyframesResolved(t,e,c,!i),a,l,h),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,i,n,s){this.keyframeResolver=void 0;const{name:o,type:r,velocity:l,delay:h,isHandoff:u,onUpdate:c}=n;this.resolvedAt=m.now();let d=!0;(function(t,e,i,n){const s=t[0];if(null===s)return!1;if("display"===e||"visibility"===e)return!0;const o=t[t.length-1],r=Ne(s,e),l=Ne(o,e);return a(r===l,`You are trying to animate ${e} from "${s}" to "${o}". "${r?o:s}" is not an animatable value.`,"value-not-animatable"),!(!r||!l)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let i=0;i40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:i,...n,keyframes:e},f=d&&!u&&Xe(p),y=p.motionValue?.owner?.current;let g;if(f)try{g=new $e({...p,element:y})}catch{g=new Ue(p)}else g=new Ue(p);g.finished.then(()=>{this.notifyFinished()}).catch(t),this.pendingTimeline&&(this.stopTimeline=g.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=g}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),C()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function _e(t,e,i,n=0,s=1){const o=Array.from(t).sort((t,e)=>t.sortNodePosition(e)).indexOf(e),r=t.size,a=(r-1)*n;return"function"==typeof i?i(o,r):1===s?o*n:a-o*n}function Ze(t,e){if(t?.inherit&&e){const{inherit:i,...n}=t;return{...e,...n}}return t}function Je(t,e){const i=t?.[e]??t?.default??t;return i!==t?Ze(i,t):i}const Qe={type:"spring",stiffness:500,damping:25,restSpeed:10},ti={type:"keyframes",duration:.8},ei={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ii=(t,{keyframes:e})=>e.length>2?ti:V.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:Qe:ei,ni=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);const si=(t,e,i,n={},s,o)=>r=>{const a=Je(n,t)||{},l=a.delay||n.delay||0;let{elapsed:h=0}=n;h-=x(l);const u={keyframes:Array.isArray(i)?i:[null,i],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-h,onUpdate:t=>{e.set(t),a.onUpdate&&a.onUpdate(t)},onComplete:()=>{r(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:o?void 0:s};(function(t){for(const e in t)if(!ni.has(e))return!0;return!1})(a)||Object.assign(u,ii(t,u)),u.duration&&(u.duration=x(u.duration)),u.repeatDelay&&(u.repeatDelay=x(u.repeatDelay)),void 0!==u.from&&(u.keyframes[0]=u.from);let c=!1;if((!1===u.type||0===u.duration&&!u.repeatDelay)&&(Ge(u),0===u.delay&&(c=!0)),(P.instantAnimations||P.skipAnimations||s?.shouldSkipAnimations||a.skipAnimations)&&(c=!0,Ge(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,c&&!o&&void 0!==e.get()){const t=S(u.keyframes,a);if(void 0!==t)return void f.update(()=>{u.onUpdate(t),u.onComplete()})}return a.isSync?new Ue(u):new qe(u)},oi=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function ri(t,e,n=1){i(n<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[s,o]=function(t){const e=oi.exec(t);if(!e)return[,];const[,i,n,s]=e;return[`--${i??n}`,s]}(t);if(!s)return;const r=window.getComputedStyle(e).getPropertyValue(s);if(r){const t=r.trim();return L(t)?parseFloat(t):t}return l(o)?ri(o,e,n+1):o}function ai(t,e,i){const n=t.getProps();return R(n,e,void 0!==i?i:n.custom,t)}const li=new Set(["width","height","top","left","right","bottom",...B]),hi=t=>Array.isArray(t);function ui(t,e,i){t.hasValue(e)?t.getValue(e).set(i):t.addValue(e,j(i))}function ci(t){return hi(t)?t[t.length-1]||0:t}function di(t,e){const i=t.getValue("willChange");if(n=i,Boolean(I(n)&&n.add))return i.add(e);if(!i&&P.WillChange){const i=new P.WillChange("auto");t.addValue("willChange",i),i.add(e)}var n}function mi(t){return t.props[O]}function pi({protectedKeys:t,needsAnimating:e},i){const n=t.hasOwnProperty(i)&&!0!==e[i];return e[i]=!1,n}function fi(t,e,{delay:i=0,transitionOverride:n,type:s}={}){let{transition:o,transitionEnd:r,...a}=e;const l=t.getDefaultTransition();o=o?Ze(o,l):l;const h=o?.reduceMotion,u=o?.skipAnimations;n&&(o=n);const c=[],d=s&&t.animationState&&t.animationState.getState()[s],m=o?.path;m&&m.animateVisualElement(t,a,o,i,c);for(const e in a){const n=t.getValue(e,t.latestValues[e]??null),s=a[e];if(void 0===s||d&&pi(d,e))continue;const r={delay:i,...Je(o||{},e)};u&&(r.skipAnimations=!0);const l=n.get();if(void 0!==l&&!n.isAnimating()&&!Array.isArray(s)&&s===l&&!r.velocity){f.update(()=>n.set(s));continue}let m=!1;if(window.MotionHandoffAnimation){const i=mi(t);if(i){const t=window.MotionHandoffAnimation(i,e,f);null!==t&&(r.startTime=t,m=!0)}}di(t,e);const p=h??t.shouldReduceMotion;n.start(si(e,n,s,p&&li.has(e)?{type:!1}:r,t,m));const y=n.animation;y&&c.push(y)}if(r){const e=()=>f.update(()=>{r&&function(t,e){const i=ai(t,e);let{transitionEnd:n={},transition:s={},...o}=i||{};o={...o,...n};for(const e in o)ui(t,e,ci(o[e]))}(t,r)});c.length?Promise.all(c).then(e):e()}return c}function yi(t,e,i={}){const n=ai(t,e,"exit"===i.type?t.presenceContext?.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=n||{};i.transitionOverride&&(s=i.transitionOverride);const o=n?()=>Promise.all(fi(t,n,i)):()=>Promise.resolve(),r=t.variantChildren&&t.variantChildren.size?(n=0)=>{const{delayChildren:o=0,staggerChildren:r,staggerDirection:a}=s;return function(t,e,i=0,n=0,s=0,o=1,r){const a=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),a.push(yi(l,e,{...r,delay:i+("function"==typeof n?0:n)+_e(t.variantChildren,l,n,s,o)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(a)}(t,e,n,o,r,a,i)}:()=>Promise.resolve(),{when:a}=s;if(a){const[t,e]="beforeChildren"===a?[o,r]:[r,o];return t().then(()=>e())}return Promise.all([o(),r(i.delay)])}function gi(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||F(t))}const vi=new Set(["auto","none","0"]);class xi extends k{constructor(t,e,i,n,s){super(t,e,i,n,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:i}=this;if(!e||!e.current)return;super.readKeyframes();for(let i=0;i{t.getValue(e).set(i)}),this.resolveNoneKeyframes()}}function Ti(t,e,i){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){let e=document;const n=i?.[t]??e.querySelectorAll(t);return n?Array.from(n):[]}return Array.from(t).filter(t=>null!=t)}const Pi={x:!1,y:!1};function wi(){return Pi.x||Pi.y}function Si(t,e){const i=Ti(t),n=new AbortController;return[i,{passive:!0,...e,signal:n.signal},()=>n.abort()]}function Ei(t,e,i={}){const[n,s,o]=Si(t,i);return n.forEach(t=>{let i,n=!1,o=!1;const r=e=>{i&&(i(e),i=void 0),t.removeEventListener("pointerleave",l)},a=t=>{n=!1,window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",a),o&&(o=!1,r(t))},l=t=>{"touch"!==t.pointerType&&(n?o=!0:r(t))};t.addEventListener("pointerenter",n=>{if("touch"===n.pointerType||wi())return;o=!1;const r=e(t,n);"function"==typeof r&&(i=r,t.addEventListener("pointerleave",l,s))},s),t.addEventListener("pointerdown",()=>{n=!0,window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",a,s)},s)}),o}const Ai=(t,e)=>!!e&&(t===e||Ai(t,e.parentElement)),Di=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,bi=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const Mi=new Set(["INPUT","SELECT","TEXTAREA"]);const ki=new WeakSet;function Ci(t){return e=>{"Enter"===e.key&&t(e)}}function Vi(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function Li(t){return Di(t)&&!wi()}const Ri=new WeakSet;function Bi(t,e,i={}){const[n,s,o]=Si(t,i),r=t=>{const n=t.currentTarget;if(!Li(t))return;if(Ri.has(t))return;ki.add(n),i.stopPropagation&&Ri.add(t);const o=e(n,t),r={...s,capture:!0},a=(t,e)=>{window.removeEventListener("pointerup",l,r),window.removeEventListener("pointercancel",h,r),ki.has(n)&&ki.delete(n),Li(t)&&"function"==typeof o&&o(t,{success:e})},l=t=>{a(t,n===window||n===document||i.useGlobalTarget||Ai(n,t.target))},h=t=>{a(t,!1)};window.addEventListener("pointerup",l,r),window.addEventListener("pointercancel",h,r)};return n.forEach(t=>{var e;(i.useGlobalTarget?window:t).addEventListener("pointerdown",r,s),Ct(e=t)&&"offsetHeight"in e&&!("ownerSVGElement"in e)&&(t.addEventListener("focus",t=>((t,e)=>{const i=t.currentTarget;if(!i)return;const n=Ci(()=>{if(ki.has(i))return;Vi(i,"down");const t=Ci(()=>{Vi(i,"up")});i.addEventListener("keyup",t,e),i.addEventListener("blur",()=>Vi(i,"cancel"),e)});i.addEventListener("keydown",n,e),i.addEventListener("blur",()=>i.removeEventListener("keydown",n),e)})(t,s)),function(t){return bi.has(t.tagName)||!0===t.isContentEditable}(t)||t.hasAttribute("tabindex")||(t.tabIndex=0))}),o}function ji(t){return Ct(t)&&"ownerSVGElement"in t}const Ii=new WeakMap;let Oi;const Fi=(t,e,i)=>(n,s)=>s&&s[0]?s[0][t+"Size"]:ji(n)&&"getBBox"in n?n.getBBox()[e]:n[i],Ui=Fi("inline","width","offsetWidth"),zi=Fi("block","height","offsetHeight");function Wi({target:t,borderBoxSize:e}){Ii.get(t)?.forEach(i=>{i(t,{get width(){return Ui(t,e)},get height(){return zi(t,e)}})})}function $i(t){t.forEach(Wi)}function Ni(t,e){Oi||"undefined"!=typeof ResizeObserver&&(Oi=new ResizeObserver($i));const i=Ti(t);return i.forEach(t=>{let i=Ii.get(t);i||(i=new Set,Ii.set(t,i)),i.add(e),Oi?.observe(t)}),()=>{i.forEach(t=>{const i=Ii.get(t);i?.delete(e),i?.size||Oi?.unobserve(t)})}}const Gi=new Set;let Hi;function Ki(t){return Gi.add(t),Hi||(Hi=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};Gi.forEach(e=>e(t))},window.addEventListener("resize",Hi)),()=>{Gi.delete(t),Gi.size||"function"!=typeof Hi||(window.removeEventListener("resize",Hi),Hi=void 0)}}function Yi(t,e){return"function"==typeof t?Ki(t):Ni(t,e)}class Xi extends G{constructor(){super(...arguments),this.KeyframeResolver=xi}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){const i=t.style;return i?i[e]:void 0}removeValueFromRenderState(t,{vars:e,style:i}){delete e[t],delete i[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;I(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}class qi{constructor(t){this.isMounted=!1,this.node=t}update(){}}function _i({top:t,left:e,right:i,bottom:n}){return{x:{min:e,max:i},y:{min:t,max:n}}}function Zi(t){return void 0===t||1===t}function Ji({scale:t,scaleX:e,scaleY:i}){return!Zi(t)||!Zi(e)||!Zi(i)}function Qi(t){return Ji(t)||tn(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function tn(t){return en(t.x)||en(t.y)}function en(t){return t&&"0%"!==t}function nn(t,e,i){return i+e*(t-i)}function sn(t,e,i,n,s){return void 0!==s&&(t=nn(t,s,n)),nn(t,i,n)+e}function on(t,e=0,i=1,n,s){t.min=sn(t.min,e,i,n,s),t.max=sn(t.max,e,i,n,s)}function rn(t,{x:e,y:i}){on(t.x,e.translate,e.scale,e.originPoint),on(t.y,i.translate,i.scale,i.originPoint)}const an=.999999999999,ln=1.0000000000001;function hn(t,e){t.min+=e,t.max+=e}function un(t,e,i,s,o=.5){on(t,e,i,n(t.min,t.max,o),s)}function cn(t,e){return"string"==typeof t?parseFloat(t)/100*(e.max-e.min):t}function dn(t,e,i){const n=i??t;un(t.x,cn(e.x,n.x),e.scaleX,e.scale,e.originX),un(t.y,cn(e.y,n.y),e.scaleY,e.scale,e.originY)}function mn(t,e){return _i(function(t,e){if(!e)return t;const i=e({x:t.left,y:t.top}),n=e({x:t.right,y:t.bottom});return{top:i.y,left:i.x,bottom:n.y,right:n.x}}(t.getBoundingClientRect(),e))}function pn(t,{style:e,vars:i},n,s){const o=t.style;let r;for(r in e)o[r]=e[r];for(r in s?.applyProjectionStyles(o,n),i)o.setProperty(r,i[r])}class fn extends Xi{constructor(){super(...arguments),this.type="html",this.renderInstance=pn}mount(t){i(Boolean(t.style),"motion.create() components must forward their ref to a HTML or SVG element","custom-component-ref"),super.mount(t)}readValueFromInstance(t,e){if(V.has(e))return this.projection?.isProjecting?H(e):K(t,e);{const n=(i=t,window.getComputedStyle(i)),s=(Y(e)?n.getPropertyValue(e):n[e])||0;return"string"==typeof s?s.trim():s}var i}measureInstanceViewportBox(t,{transformPagePoint:e}){return mn(t,e)}build(t,e,i){X(t,e,i.transformTemplate)}scrapeMotionValuesFromProps(t,e,i){return q(t,e,i)}}const yn=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);class gn extends Xi{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Z}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(V.has(e)){const t=it(e);return t&&t.default||0}if(J.includes(e)){const i=getComputedStyle(t)[e];if("string"==typeof i&&i)return i.trim()}return e=yn.has(e)?e:_(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,i){return Q(t,e,i)}build(t,e,i){tt(t,e,this.isSVGTag,i.transformTemplate,i.style)}renderInstance(t,e,i,n){!function(t,e,i,n){pn(t,e,void 0,n);for(const i in e.attrs)t.setAttribute(yn.has(i)?i:_(i),e.attrs[i])}(t,e,0,n)}mount(t){this.isSVGTag=et(t.tagName),super.mount(t)}}const vn=st.length;function xn(t){if(!t)return;if(!t.isControllingVariants){const e=t.parent&&xn(t.parent)||{};return void 0!==t.props.initial&&(e.initial=t.props.initial),e}const e={};for(let i=0;iPromise.all(e.map(({animation:e,options:i})=>function(t,e,i={}){let n;if(t.notify("AnimationStart",e),Array.isArray(e)){const s=e.map(e=>yi(t,e,i));n=Promise.all(s)}else if("string"==typeof e)n=yi(t,e,i);else{const s="function"==typeof e?ai(t,e,i.custom):e;n=Promise.all(fi(t,s,i))}return n.then(()=>{t.notify("AnimationComplete",e)})}(t,e,i)))}function En(t){let e=Sn(t),i=bn(),n=!0,s=!1;const o=e=>(i,n)=>{const s=ai(t,n,"exit"===e?t.presenceContext?.custom:void 0);if(s){const{transition:t,transitionEnd:e,...n}=s;i={...i,...n,...e}}return i};function r(r){const{props:a}=t,l=xn(t.parent)||{},h=[],u=new Set;let c={},d=1/0;for(let e=0;ed&&y,P=!1;const w=Array.isArray(f)?f:[f];let S=w.reduce(o(m),{});!1===g&&(S={});const{prevResolvedValues:E={}}=p,A={...E,...S},D=e=>{T=!0,u.has(e)&&(P=!0,u.delete(e)),p.needsAnimating[e]=!0;const i=t.getValue(e);i&&(i.liveStyle=!1)};for(const t in A){const e=S[t],i=E[t];if(c.hasOwnProperty(t))continue;let n=!1;n=hi(e)&&hi(i)?!Tn(e,i)||x:e!==i,n?null!=e?D(t):u.add(t):void 0!==e&&u.has(t)?D(t):p.protectedKeys[t]=!0}p.prevProp=f,p.prevResolvedValues=S,p.isActive&&(c={...c,...S}),(n||s)&&t.blockInitialAnimation&&(T=!1);const b=v&&x;T&&(!b||P)&&h.push(...w.map(e=>{const i={type:m};if("string"==typeof e&&(n||s)&&!b&&t.manuallyAnimateOnMount&&t.parent){const{parent:n}=t,s=ai(n,e);if(n.enteringChildren&&s){const{delayChildren:e}=s.transition||{};i.delay=_e(n.enteringChildren,t,e)}}return{animation:e,options:i}}))}if(u.size){const e={};if("boolean"!=typeof a.initial){const i=ai(t,Array.isArray(a.initial)?a.initial[0]:a.initial);i&&i.transition&&(e.transition=i.transition)}u.forEach(i=>{const n=t.getBaseTarget(i),s=t.getValue(i);s&&(s.liveStyle=!0),e[i]=n??null}),h.push({animation:e})}let m=Boolean(h.length);return!n||!1!==a.initial&&a.initial!==a.animate||t.manuallyAnimateOnMount||(m=!1),n=!1,s=!1,m?e(h):Promise.resolve()}return{animateChanges:r,setActive:function(e,n){if(i[e].isActive===n)return Promise.resolve();t.variantChildren?.forEach(t=>t.animationState?.setActive(e,n)),i[e].isActive=n;const s=r(e);for(const t in i)i[t].protectedKeys={};return s},setAnimateFunction:function(i){e=i(t)},getState:()=>i,reset:()=>{i=bn(),s=!0}}}function An(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!Tn(e,t)}function Dn(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function bn(){return{animate:Dn(!0),whileInView:Dn(),whileHover:Dn(),whileTap:Dn(),whileDrag:Dn(),whileFocus:Dn(),exit:Dn()}}function Mn(t,e){t.min=e.min,t.max=e.max}function kn(t,e){Mn(t.x,e.x),Mn(t.y,e.y)}function Cn(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function Vn(t){return t.max-t.min}function Ln(t,e,i,s=.5){t.origin=s,t.originPoint=n(e.min,e.max,t.origin),t.scale=Vn(i)/Vn(e),t.translate=n(i.min,i.max,t.origin)-t.originPoint,(t.scale>=.9999&&t.scale<=1.0001||isNaN(t.scale))&&(t.scale=1),(t.translate>=-.01&&t.translate<=.01||isNaN(t.translate))&&(t.translate=0)}function Rn(t,e,i,n){Ln(t.x,e.x,i.x,n?n.originX:void 0),Ln(t.y,e.y,i.y,n?n.originY:void 0)}function Bn(t,e,i,s=0){const o=s?n(i.min,i.max,s):i.min;t.min=o+e.min,t.max=t.min+Vn(e)}function jn(t,e,i,s=0){const o=s?n(i.min,i.max,s):i.min;t.min=e.min-o,t.max=t.min+Vn(e)}function In(t,e,i,n){jn(t.x,e.x,i.x,n?.x),jn(t.y,e.y,i.y,n?.y)}function On(t,e,i,n,s){return t=nn(t-=e,1/i,n),void 0!==s&&(t=nn(t,1/s,n)),t}function Fn(t,e,[i,s,o],r,a){!function(t,e=0,i=1,s=.5,o,r=t,a=t){at.test(e)&&(e=parseFloat(e),e=n(a.min,a.max,e/100)-a.min);if("number"!=typeof e)return;let l=n(r.min,r.max,s);t===r&&(l-=e),t.min=On(t.min,e,i,l,o),t.max=On(t.max,e,i,l,o)}(t,e[i],e[s],e[o],e.scale,r,a)}const Un=["x","scaleX","originX"],zn=["y","scaleY","originY"];function Wn(t,e,i,n){Fn(t.x,e,Un,i?i.x:void 0,n?n.x:void 0),Fn(t.y,e,zn,i?i.y:void 0,n?n.y:void 0)}function $n(t){return 0===t.translate&&1===t.scale}function Nn(t){return $n(t.x)&&$n(t.y)}function Gn(t,e){return t.min===e.min&&t.max===e.max}function Hn(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Kn(t,e){return Hn(t.x,e.x)&&Hn(t.y,e.y)}function Yn(t){return Vn(t.x)/Vn(t.y)}function Xn(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function qn(t){return[t("x"),t("y")]}const _n=lt.length,Zn=t=>"string"==typeof t?parseFloat(t):t,Jn=t=>"number"==typeof t||ht.test(t);function Qn(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const ts=is(0,.5,$t),es=is(.5,.95,t);function is(t,e,i){return n=>ne?1:i(Lt(t,e,n))}function ns(t,e,i,n={passive:!0}){return t.addEventListener(e,i,n),()=>t.removeEventListener(e,i,n)}const ss=(t,e)=>t.depth-e.depth;class os{constructor(){this.children=[],this.isDirty=!1}add(t){ut(this.children,t),this.isDirty=!0}remove(t){ct(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(ss),this.isDirty=!1,this.children.forEach(t)}}class rs{constructor(){this.members=[]}add(t){ut(this.members,t);for(let e=this.members.length-1;e>=0;e--){const i=this.members[e];if(i===t||i===this.lead||i===this.prevLead)continue;const n=i.instance;n&&!1!==n.isConnected||i.snapshot||(ct(this.members,i),i.unmount())}t.scheduleRender()}remove(t){if(ct(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){for(let e=this.members.indexOf(t)-1;e>=0;e--){const t=this.members[e];if(!1!==t.isPresent&&!1!==t.instance?.isConnected)return this.promote(t),!0}return!1}promote(t,e){const i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.updateSnapshot(),t.scheduleRender();const{layoutDependency:n}=i.options,{layoutDependency:s}=t.options;void 0!==n&&n===s||(t.resumeFrom=i,e&&(i.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues),t.root?.isUpdating&&(t.isLayoutDirty=!0)),!1===t.options.crossfade&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{t.options.onExitComplete?.(),t.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}const as={hasAnimatedSinceResize:!0,hasEverUpdated:!1},ls=["","X","Y","Z"];let hs=0;function us(t,e,i,n){const{latestValues:s}=e;s[t]&&(i[t]=s[t],e.setStaticValue(t,0),n&&(n[t]=0))}function cs(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const i=mi(e);if(window.MotionHasOptimisedAnimation(i,"transform")){const{layout:e,layoutId:n}=t.options;window.MotionCancelOptimisedAnimation(i,"transform",f,!(e||n))}const{parent:n}=t;n&&!n.hasCheckedOptimisedAppear&&cs(n)}function ds({attachResizeListener:t,defaultParent:e,measureScroll:i,checkIsScrollRoot:s,resetTransform:o}){return class{constructor(t={},i=e?.()){this.id=hs++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(fs),this.nodes.forEach(Es),this.nodes.forEach(As),this.nodes.forEach(ys)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=t,this.root=i?i.root||i:this,this.path=i?[...i.path,i]:[],this.parent=i,this.depth=i?i.depth+1:0;for(let t=0;tthis.root.updateBlockedByResize=!1;f.read(()=>{n=window.innerWidth}),t(e,()=>{const t=window.innerWidth;t!==n&&(n=t,this.root.updateBlockedByResize=!0,i&&i(),i=function(t,e){const i=m.now(),n=({timestamp:s})=>{const o=s-i;o>=e&&(p(n),t(o-e))};return f.setup(n,!0),()=>p(n)}(s,250),as.hasAnimatedSinceResize&&(as.hasAnimatedSinceResize=!1,this.nodes.forEach(Ss)))})}n&&this.root.registerSharedNode(n,this),!1!==this.options.animate&&o&&(n||s)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeLayoutChanged:i,layout:n})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const s=this.options.transition||o.getDefaultTransition()||Vs,{onLayoutAnimationStart:r,onLayoutAnimationComplete:a}=o.getProps(),l=!this.targetLayout||!Kn(this.targetLayout,n),h=!e&&i;if(this.options.layoutRoot||this.resumeFrom||h||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const e={...Je(s,"layout"),onPlay:r,onComplete:a};(o.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e),this.setAnimationOrigin(t,h,e.path)}else e||Ss(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=n})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const t=this.getStack();t&&t.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),p(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Ds),this.animationId++)}getTransformTemplate(){const{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&cs(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||Vn(this.snapshot.measuredBox.x)||Vn(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;tan&&(e.x=1),e.yan&&(e.y=1)}(this.layoutCorrected,this.treeScale,this.path,e),!t.layout||t.target||1===this.treeScale.x&&1===this.treeScale.y||(t.target=t.layout.layoutBox,t.targetWithTransforms=Z());const{target:a}=t;a?(this.projectionDelta&&this.prevProjectionDelta?(Cn(this.prevProjectionDelta.x,this.projectionDelta.x),Cn(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),Rn(this.projectionDelta,this.layoutCorrected,a,this.latestValues),this.treeScale.x===o&&this.treeScale.y===r&&Xn(this.projectionDelta.x,this.prevProjectionDelta.x)&&Xn(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",a))):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){if(this.options.visualElement?.scheduleRender(),t){const t=this.getStack();t&&t.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=ft(),this.projectionDelta=ft(),this.projectionDeltaWithTransform=ft()}setAnimationOrigin(t,e=!1,i){const s=this.snapshot,o=s?s.latestValues:{},r={...this.latestValues},a=ft();this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!e;const l=Z(),h=(s?s.source:void 0)!==(this.layout?this.layout.source:void 0),u=this.getStack(),c=!u||u.members.length<=1,d=Boolean(h&&!c&&!0===this.options.crossfade&&!this.path.some(Cs));let m;this.animationProgress=0;const p=i?.interpolateProjection(t);this.mixTargetDelta=e=>{const i=e/1e3,s=p?.(i);var u,f,y,g,v,x;s?(a.x.translate=s.x,a.x.scale=n(t.x.scale,1,i),a.x.origin=t.x.origin,a.x.originPoint=t.x.originPoint,a.y.translate=s.y,a.y.scale=n(t.y.scale,1,i),a.y.origin=t.y.origin,a.y.originPoint=t.y.originPoint):(Ms(a.x,t.x,i),Ms(a.y,t.y,i)),this.setTargetDelta(a),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(In(l,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),y=this.relativeTarget,g=this.relativeTargetOrigin,v=l,x=i,ks(y.x,g.x,v.x,x),ks(y.y,g.y,v.y,x),m&&(u=this.relativeTarget,f=m,Gn(u.x,f.x)&&Gn(u.y,f.y))&&(this.isProjectionDirty=!1),m||(m=Z()),kn(m,this.relativeTarget)),h&&(this.animationValues=r,function(t,e,i,s,o,r){o?(t.opacity=n(0,i.opacity??1,ts(s)),t.opacityExit=n(e.opacity??1,0,es(s))):r&&(t.opacity=n(e.opacity??1,i.opacity??1,s));for(let o=0;o<_n;o++){const r=lt[o];let a=Qn(e,r),l=Qn(i,r);void 0===a&&void 0===l||(a||(a=0),l||(l=0),0===a||0===l||Jn(a)===Jn(l)?(t[r]=Math.max(n(Zn(a),Zn(l),s),0),(at.test(l)||at.test(a))&&(t[r]+="%")):t[r]=l)}(e.rotate||i.rotate)&&(t.rotate=n(e.rotate||0,i.rotate||0,s))}(r,o,this.latestValues,i,d,c)),s&&void 0!==s.rotate&&(this.animationValues||(this.animationValues=r),this.animationValues.pathRotation=s.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=i},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(t){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(p(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=f.update(()=>{as.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=j(0)),this.motionValue.jump(0,!1),this.currentAnimation=function(t,e,i){const n=I(t)?t:j(t);return n.start(si("",n,e,i)),n.animation}(this.motionValue,[0,1e3],{...t,velocity:0,isSync:!0,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onComplete:()=>{t.onComplete&&t.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const t=this.getStack();t&&t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead();let{targetWithTransforms:e,target:i,layout:n,latestValues:s}=t;if(e&&i&&n){if(this!==t&&this.layout&&n&&js(this.options.animationType,this.layout.layoutBox,n.layoutBox)){i=this.target||Z();const e=Vn(this.layout.layoutBox.x);i.x.min=t.target.x.min,i.x.max=i.x.min+e;const n=Vn(this.layout.layoutBox.y);i.y.min=t.target.y.min,i.y.max=i.y.min+n}kn(e,i),dn(e,s),Rn(this.projectionDeltaWithTransform,this.layoutCorrected,e,s)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new rs);this.sharedNodes.get(t).add(e);const i=e.options.initialPromotionConfig;e.promote({transition:i?i.transition:void 0,preserveFollowOpacity:i&&i.shouldPreserveFollowOpacity?i.shouldPreserveFollowOpacity(e):void 0})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){const{layoutId:t}=this.options;return t&&this.getStack()?.lead||this}getPrevLead(){const{layoutId:t}=this.options;return t?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:i}={}){const n=this.getStack();n&&n.promote(this,i),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetSkewAndRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const{latestValues:i}=t;if((i.z||i.rotate||i.rotateX||i.rotateY||i.rotateZ||i.skewX||i.skewY)&&(e=!0),!e)return;const n={};i.z&&us("z",t,n,this.animationValues);for(let e=0;et.currentAnimation?.stop()),this.root.nodes.forEach(vs),this.root.sharedNodes.clear()}}}function ms(t){t.updateLayout()}function ps(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:i,measuredBox:n}=t.layout,{animationType:s}=t.options,o=e.source!==t.layout.source;if("size"===s)qn(t=>{const n=o?e.measuredBox[t]:e.layoutBox[t],s=Vn(n);n.min=i[t].min,n.max=n.min+s});else if("x"===s||"y"===s){const t="x"===s?"y":"x";Mn(o?e.measuredBox[t]:e.layoutBox[t],i[t])}else js(s,e.layoutBox,i)&&qn(n=>{const s=o?e.measuredBox[n]:e.layoutBox[n],r=Vn(i[n]);s.max=s.min+r,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[n].max=t.relativeTarget[n].min+r)});const r=ft();Rn(r,i,e.layoutBox);const a=ft();o?Rn(a,t.applyTransform(n,!0),e.measuredBox):Rn(a,i,e.layoutBox);const l=!Nn(r);let h=!1;if(!t.resumeFrom){const n=t.getClosestProjectingParent();if(n&&!n.resumeFrom){const{snapshot:s,layout:o}=n;if(s&&o){const r=t.options.layoutAnchor||void 0,a=Z();In(a,e.layoutBox,s.layoutBox,r);const l=Z();In(l,i,o.layoutBox,r),Kn(a,l)||(h=!0),n.options.layoutRoot&&(t.relativeTarget=l,t.relativeTargetOrigin=a,t.relativeParent=n)}}}t.notifyListeners("didUpdate",{layout:i,snapshot:e,delta:a,layoutDelta:r,hasLayoutChanged:l,hasRelativeLayoutChanged:h})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function fs(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=Boolean(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function ys(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function gs(t){t.clearSnapshot()}function vs(t){t.clearMeasurements()}function xs(t){t.isLayoutDirty=!0,t.updateLayout()}function Ts(t){t.isLayoutDirty=!1}function Ps(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function ws(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Ss(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Es(t){t.resolveTargetDelta()}function As(t){t.calcProjection()}function Ds(t){t.resetSkewAndRotation()}function bs(t){t.removeLeadSnapshot()}function Ms(t,e,i){t.translate=n(e.translate,0,i),t.scale=n(e.scale,1,i),t.origin=e.origin,t.originPoint=e.originPoint}function ks(t,e,i,s){t.min=n(e.min,i.min,s),t.max=n(e.max,i.max,s)}function Cs(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const Vs={duration:.45,ease:[.4,0,.1,1]},Ls=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Rs=Ls("applewebkit/")&&!Ls("chrome/")?Math.round:t;function Bs(t){t.min=Rs(t.min),t.max=Rs(t.max)}function js(t,e,i){return"position"===t||"preserve-aspect"===t&&(n=Yn(e),s=Yn(i),o=.2,!(Math.abs(n-s)<=o));var n,s,o}function Is(t){return t!==t.root&&t.scroll?.wasRoot}const Os=ds({attachResizeListener:(t,e)=>ns(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Fs={current:void 0},Us=ds({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Fs.current){const t=new Os({});t.mount(window),t.setOptions({layoutScroll:!0}),Fs.current=t}return Fs.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)});function zs(t){return{point:{x:t.pageX,y:t.pageY}}}function Ws(t,e,i,n){return ns(t,e,(t=>e=>Di(e)&&t(e,zs(e)))(i),n)}const $s=({current:t})=>t?t.ownerDocument.defaultView:null,Ns=(t,e)=>Math.abs(t-e);const Gs=new Set(["auto","scroll"]);class Hs{constructor(t,e,{transformPagePoint:i,contextWindow:n=window,dragSnapToOrigin:s=!1,distanceThreshold:o=3,element:r}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=t=>{this.handleScroll(t.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Ks(this.lastRawMoveEventInfo,this.transformPagePoint));const t=Xs(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,i=function(t,e){const i=Ns(t.x,e.x),n=Ns(t.y,e.y);return Math.sqrt(i**2+n**2)}(t.offset,{x:0,y:0})>=this.distanceThreshold;if(!e&&!i)return;const{point:n}=t,{timestamp:s}=d;this.history.push({...n,timestamp:s});const{onStart:o,onMove:r}=this.handlers;e||(o&&o(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),r&&r(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastRawMoveEventInfo=e,this.lastMoveEventInfo=Ks(e,this.transformPagePoint),f.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();const{onEnd:i,onSessionEnd:n,resumeAnimation:s}=this.handlers;if(!this.dragSnapToOrigin&&this.startEvent||s&&s(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const o=Xs("pointercancel"===t.type?this.lastMoveEventInfo:Ks(e,this.transformPagePoint),this.history);this.startEvent&&i&&i(t,o),n&&n(t,o)},!Di(t))return;this.dragSnapToOrigin=s,this.handlers=e,this.transformPagePoint=i,this.distanceThreshold=o,this.contextWindow=n||window;const a=Ks(zs(t),this.transformPagePoint),{point:l}=a,{timestamp:h}=d;this.history=[{...l,timestamp:h}];const{onSessionStart:u}=e;u&&u(t,Xs(a,this.history));const c={passive:!0,capture:!0};this.removeListeners=Vt(Ws(this.contextWindow,"pointermove",this.handlePointerMove,c),Ws(this.contextWindow,"pointerup",this.handlePointerUp,c),Ws(this.contextWindow,"pointercancel",this.handlePointerUp,c)),r&&this.startScrollTracking(r)}startScrollTracking(t){let e=t.parentElement;for(;e;){const t=getComputedStyle(e);(Gs.has(t.overflowX)||Gs.has(t.overflowY))&&this.scrollPositions.set(e,{x:e.scrollLeft,y:e.scrollTop}),e=e.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const e=this.scrollPositions.get(t);if(!e)return;const i=t===window,n=i?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},s=n.x-e.x,o=n.y-e.y;0===s&&0===o||(i?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=s,this.lastMoveEventInfo.point.y+=o):this.history.length>0&&(this.history[0].x-=s,this.history[0].y-=o),this.scrollPositions.set(t,n),f.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),p(this.updatePoint)}}function Ks(t,e){return e?{point:e(t.point)}:t}function Ys(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Xs({point:t},e){return{point:t,delta:Ys(t,_s(e)),offset:Ys(t,qs(e)),velocity:Zs(e,.1)}}function qs(t){return t[0]}function _s(t){return t[t.length-1]}function Zs(t,e){if(t.length<2)return{x:0,y:0};let i=t.length-1,n=null;const s=_s(t);for(;i>=0&&(n=t[i],!(s.timestamp-n.timestamp>x(e)));)i--;if(!n)return{x:0,y:0};n===t[0]&&t.length>2&&s.timestamp-n.timestamp>2*x(e)&&(n=t[1]);const o=y(s.timestamp-n.timestamp);if(0===o)return{x:0,y:0};const r={x:(s.x-n.x)/o,y:(s.y-n.y)/o};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function Js(t,e,i){return{min:void 0!==e?t.min+e:void 0,max:void 0!==i?t.max+i-(t.max-t.min):void 0}}function Qs(t,e){let i=e.min-t.min,n=e.max-t.max;return e.max-e.min{e&&this.snapToCursor(zs(t).point),this.stopAnimation()},onStart:(t,e)=>{const{drag:i,dragPropagation:n,onDragStart:s}=this.getProps();if(i&&!n&&(this.openDragLock&&this.openDragLock(),this.openDragLock="x"===(o=i)||"y"===o?Pi[o]?null:(Pi[o]=!0,()=>{Pi[o]=!1}):Pi.x||Pi.y?null:(Pi.x=Pi.y=!0,()=>{Pi.x=Pi.y=!1}),!this.openDragLock))return;var o;this.latestPointerEvent=t,this.latestPanInfo=e,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),qn(t=>{let e=this.getAxisMotionValue(t).get()||0;if(at.test(e)){const{projection:i}=this.visualElement;if(i&&i.layout){const n=i.layout.layoutBox[t];if(n){e=Vn(n)*(parseFloat(e)/100)}}}this.originPoint[t]=e}),s&&f.update(()=>s(t,e),!1,!0),di(this.visualElement,"transform");const{animationState:r}=this.visualElement;r&&r.setActive("whileDrag",!0)},onMove:(t,e)=>{this.latestPointerEvent=t,this.latestPanInfo=e;const{dragPropagation:i,dragDirectionLock:n,onDirectionLock:s,onDrag:o}=this.getProps();if(!i&&!this.openDragLock)return;const{offset:r}=e;if(n&&null===this.currentDirection)return this.currentDirection=function(t,e=10){let i=null;Math.abs(t.y)>e?i="y":Math.abs(t.x)>e&&(i="x");return i}(r),void(null!==this.currentDirection&&s&&s(this.currentDirection));this.updateAxis("x",e.point,r),this.updateAxis("y",e.point,r),this.visualElement.render(),o&&f.update(()=>o(t,e),!1,!0)},onSessionEnd:(t,e)=>{this.latestPointerEvent=t,this.latestPanInfo=e,this.stop(t,e),this.latestPointerEvent=null,this.latestPanInfo=null},resumeAnimation:()=>{const{dragSnapToOrigin:t}=this.getProps();(t||this.constraints)&&this.startAnimation({x:0,y:0})}},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:s,distanceThreshold:i,contextWindow:$s(this.visualElement),element:this.visualElement.current})}stop(t,e){const i=t||this.latestPointerEvent,n=e||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!n||!i)return;const{velocity:o}=n;this.startAnimation(o);const{onDragEnd:r}=this.getProps();r&&f.postRender(()=>r(i,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:e}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:i}=this.getProps();!i&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),e&&e.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,e,i){const{drag:s}=this.getProps();if(!i||!ro(t,s,this.currentDirection))return;const o=this.getAxisMotionValue(t);let r=this.originPoint[t]+i[t];this.constraints&&this.constraints[t]&&(r=function(t,{min:e,max:i},s){return void 0!==e&&ti&&(t=s?n(i,t,s.max):Math.min(t,i)),t}(r,this.constraints[t],this.elastic[t])),o.set(r)}resolveConstraints(){const{dragConstraints:t,dragElastic:e}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,n=this.constraints;t&&vt(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!i)&&function(t,{top:e,left:i,bottom:n,right:s}){return{x:Js(t.x,i,s),y:Js(t.y,e,n)}}(i.layoutBox,t),this.elastic=function(t=to){return!1===t?t=0:!0===t&&(t=to),{x:eo(t,"left","right"),y:eo(t,"top","bottom")}}(e),n!==this.constraints&&!vt(t)&&i&&this.constraints&&!this.hasMutatedConstraints&&qn(t=>{!1!==this.constraints&&this.getAxisMotionValue(t)&&(this.constraints[t]=function(t,e){const i={};return void 0!==e.min&&(i.min=e.min-t.min),void 0!==e.max&&(i.max=e.max-t.min),i}(i.layoutBox[t],this.constraints[t]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!t||!vt(t))return!1;const n=t.current;i(null!==n,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:s}=this.visualElement;if(!s||!s.layout)return!1;s.root&&(s.root.scroll=void 0,s.root.updateScroll());const o=function(t,e,i){const n=mn(t,i),{scroll:s}=e;return s&&(hn(n.x,s.offset.x),hn(n.y,s.offset.y)),n}(n,s.root,this.visualElement.getTransformPagePoint());let r=function(t,e){return{x:Qs(t.x,e.x),y:Qs(t.y,e.y)}}(s.layout.layoutBox,o);if(e){const t=e(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(r));this.hasMutatedConstraints=!!t,t&&(r=_i(t))}return r}startAnimation(t){const{drag:e,dragMomentum:i,dragElastic:n,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:r}=this.getProps(),a=this.constraints||{},l=qn(r=>{if(!ro(r,e,this.currentDirection))return;let l=a&&a[r]||{};!0!==o&&o!==r||(l={min:0,max:0});const h=n?200:1e6,u=n?40:1e7,c={type:"inertia",velocity:i?t[r]:0,bounceStiffness:h,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...s,...l};return this.startAxisValueAnimation(r,c)});return Promise.all(l).then(r)}startAxisValueAnimation(t,e){const i=this.getAxisMotionValue(t);return di(this.visualElement,t),i.start(si(t,i,0,e,this.visualElement,!1))}stopAnimation(){qn(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const e=`_drag${t.toUpperCase()}`,i=this.visualElement.getProps()[e];return i||this.visualElement.getValue(t,this.visualElement.latestValues[t]??0)}snapToCursor(t){qn(e=>{const{drag:i}=this.getProps();if(!ro(e,i,this.currentDirection))return;const{projection:s}=this.visualElement,o=this.getAxisMotionValue(e);if(s&&s.layout){const{min:i,max:r}=s.layout.layoutBox[e],a=o.get()||0;o.set(t[e]-n(i,r,.5)+a)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:e}=this.getProps(),{projection:i}=this.visualElement;if(!vt(e)||!i||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};qn(t=>{const e=this.getAxisMotionValue(t);if(e&&!1!==this.constraints){const i=e.get();s[t]=function(t,e){let i=.5;const n=Vn(t),s=Vn(e);return s>n?i=Lt(e.min,e.max-n,t.min):n>s&&(i=Lt(t.min,t.max-s,e.min)),g(0,1,i)}({min:i,max:i},this.constraints[t])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.constraints=!1,this.resolveConstraints(),qn(e=>{if(!ro(e,t,null))return;const i=this.getAxisMotionValue(e),{min:o,max:r}=this.constraints[e];i.set(n(o,r,s[e]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;no.set(this.visualElement,this);const t=this.visualElement.current,e=Ws(t,"pointerdown",e=>{const{drag:i,dragListener:n=!0}=this.getProps(),s=e.target,o=s!==t&&function(t){return Mi.has(t.tagName)||!0===t.isContentEditable}(s);i&&n&&!o&&this.start(e)});let i;const n=()=>{const{dragConstraints:e}=this.getProps();vt(e)&&e.current&&(this.constraints=this.resolveRefConstraints(),i||(i=function(t,e,i){const n=Yi(t,oo(i)),s=Yi(e,oo(i));return()=>{n(),s()}}(t,e.current,()=>this.scalePositionWithinConstraints())))},{projection:s}=this.visualElement,o=s.addEventListener("measure",n);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),f.read(n);const r=ns(window,"resize",()=>this.scalePositionWithinConstraints()),a=s.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(qn(e=>{const i=this.getAxisMotionValue(e);i&&(this.originPoint[e]+=t[e].translate,i.set(i.get()+t[e].translate))}),this.visualElement.render())});return()=>{r(),e(),o(),a&&a(),i&&i()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:i=!1,dragPropagation:n=!1,dragConstraints:s=!1,dragElastic:o=to,dragMomentum:r=!0}=t;return{...t,drag:e,dragDirectionLock:i,dragPropagation:n,dragConstraints:s,dragElastic:o,dragMomentum:r}}}function oo(t){let e=!0;return()=>{e?e=!1:t()}}function ro(t,e,i){return!(!0!==e&&e!==t||null!==i&&i!==t)}const ao=t=>(e,i)=>{t&&f.update(()=>t(e,i),!1,!0)};let lo=!1;class ho extends Mt{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:i,layoutId:n}=this.props,{projection:s}=t;s&&(e.group&&e.group.add(s),i&&i.register&&n&&i.register(s),lo&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),as.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:i,drag:n,isPresent:s}=this.props,{projection:o}=i;return o?(o.isPresent=s,t.layoutDependency!==e&&o.setOptions({...o.options,layoutDependency:e}),lo=!0,n||t.layoutDependency!==e||void 0===e||t.isPresent!==s?o.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?o.promote():o.relegate()||f.postRender(()=>{const t=o.getStack();t&&t.members.length||this.safeToRemove()})),null):null}componentDidUpdate(){const{visualElement:t,layoutAnchor:e}=this.props,{projection:i}=t;i&&(i.options.layoutAnchor=e,i.root.didUpdate(),pt.postRender(()=>{!i.currentAnimation&&i.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:i}=this.props,{projection:n}=t;lo=!0,n&&(n.scheduleCheckAfterUnmount(),e&&e.group&&e.group.remove(n),i&&i.deregister&&i.deregister(n))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function uo(t){const[e,i]=function(t=!0){const e=Et(xt);if(null===e)return[!0,null];const{isPresent:i,onExitComplete:n,register:s}=e,o=At();Dt(()=>{if(t)return s(o)},[t]);const r=bt(()=>t&&n&&n(o),[o,n,t]);return!i&&n?[!1,r]:[!0]}(),n=Et(Tt);return St(ho,{...t,layoutGroup:n,switchLayoutGroup:Et(Pt),isPresent:e,safeToRemove:i})}const co={pan:{Feature:class extends qi{constructor(){super(...arguments),this.removePointerDownListener=t}onPointerDown(t){this.session=new Hs(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:$s(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:e,onPan:i,onPanEnd:n}=this.node.getProps();return{onSessionStart:ao(t),onStart:ao(e),onMove:ao(i),onEnd:(t,e)=>{delete this.session,n&&f.postRender(()=>n(t,e))}}}mount(){this.removePointerDownListener=Ws(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends qi{constructor(e){super(e),this.removeGroupControls=t,this.removeListeners=t,this.controls=new so(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||t}update(){const{dragControls:t}=this.node.getProps(),{dragControls:e}=this.node.prevProps||{};t!==e&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},ProjectionNode:Us,MeasureLayout:uo}},mo={layout:{ProjectionNode:Us,MeasureLayout:uo}};let po=0;const fo={animation:{Feature:class extends qi{constructor(t){super(t),t.animationState||(t.animationState=En(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();ot(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}},exit:{Feature:class extends qi{constructor(){super(...arguments),this.id=po++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:e}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===i)return;if(t&&!1===i){if(this.isExitComplete){const{initial:t,custom:e}=this.node.getProps();if("string"==typeof t||"object"==typeof t&&null!==t&&!Array.isArray(t)){const i=ai(this.node,t,e);if(i){const{transition:t,transitionEnd:e,...n}=i;for(const t in n)this.node.getValue(t)?.jump(n[t])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);return void(this.isExitComplete=!1)}const n=this.node.animationState.setActive("exit",!t);e&&!t&&n.then(()=>{this.isExitComplete=!0,e(this.id)})}mount(){const{register:t,onExitComplete:e}=this.node.presenceContext||{};e&&e(this.id),t&&(this.unmount=t(this.id))}unmount(){}}}};function yo(t,e,i){const{props:n}=t;t.animationState&&n.whileHover&&t.animationState.setActive("whileHover","Start"===i);const s=n["onHover"+i];s&&f.postRender(()=>s(e,zs(e)))}function go(t,e,i){const{props:n}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&n.whileTap&&t.animationState.setActive("whileTap","Start"===i);const s=n["onTap"+("End"===i?"":i)];s&&f.postRender(()=>s(e,zs(e)))}const vo=new WeakMap,xo=new WeakMap,To=t=>{const e=vo.get(t.target);e&&e(t)},Po=t=>{t.forEach(To)};function wo(t,e,i){const n=function({root:t,...e}){const i=t||document;xo.has(i)||xo.set(i,{});const n=xo.get(i),s=JSON.stringify(e);return n[s]||(n[s]=new IntersectionObserver(Po,{root:t,...e})),n[s]}(e);return vo.set(t,i),n.observe(t),()=>{vo.delete(t),n.unobserve(t)}}const So={some:0,all:1};const Eo={renderer:(t,e)=>e.isSVG??wt(t)?new gn(e):new fn(e,{allowProjection:t!==kt}),...fo,...{inView:{Feature:class extends qi{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:t={}}=this.node.getProps(),{root:e,margin:i,amount:n="some",once:s}=t,o={root:e?e.current:void 0,rootMargin:i,threshold:"number"==typeof n?n:So[n]};this.stopObserver=wo(this.node.current,o,t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,s&&!e&&this.hasEnteredView)return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);const{onViewportEnter:i,onViewportLeave:n}=this.node.getProps(),o=e?i:n;o&&o(t)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return i=>t[i]!==e[i]}(t,e))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}},tap:{Feature:class extends qi{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:e,propagate:i}=this.node.props;this.unmount=Bi(t,(t,e)=>(go(this.node,e,"Start"),(t,{success:e})=>go(this.node,t,e?"End":"Cancel")),{useGlobalTarget:e,stopPropagation:!1===i?.tap})}unmount(){}}},focus:{Feature:class extends qi{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){t=!0}t&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Vt(ns(this.node.current,"focus",()=>this.onFocus()),ns(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends qi{mount(){const{current:t}=this.node;t&&(this.unmount=Ei(t,(t,e)=>(yo(this.node,e,"Start"),t=>yo(this.node,t,"End"))))}unmount(){}}}}},Ao={...Eo,...co,...mo};export{Ao as domMax}; diff --git a/node_modules/framer-motion/dist/size-rollup-m.js b/node_modules/framer-motion/dist/size-rollup-m.js deleted file mode 100644 index ad7fbc9..0000000 --- a/node_modules/framer-motion/dist/size-rollup-m.js +++ /dev/null @@ -1,2 +0,0 @@ -import{jsxs as t,jsx as n}from"react/jsx-runtime";import{createContext as r,useContext as e,useMemo as o,Fragment as a,createElement as s,useRef as i,useInsertionEffect as l,useCallback as u,useLayoutEffect as c,useEffect as f,forwardRef as d}from"react";const p=(t,n,r)=>r>n?n:rt,isStatic:!1,reducedMotion:"never"}),y=r({}),v=(t=>n=>"string"==typeof n&&n.startsWith(t))("--"),b={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},w={...b,transform:t=>p(0,1,t)},S={...b,default:1},x=t=>Math.round(1e5*t)/1e5,R=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const k=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,B=(t,n)=>r=>Boolean("string"==typeof r&&k.test(r)&&r.startsWith(t)||n&&!function(t){return null==t}(r)&&Object.prototype.hasOwnProperty.call(r,n)),T=(t,n,r)=>e=>{if("string"!=typeof e)return e;const[o,a,s,i]=e.match(R);return{[t]:parseFloat(o),[n]:parseFloat(a),[r]:parseFloat(s),alpha:void 0!==i?parseFloat(i):1}},I={...b,transform:t=>Math.round((t=>p(0,255,t))(t))},A={test:B("rgb","red"),parse:T("red","green","blue"),transform:({red:t,green:n,blue:r,alpha:e=1})=>"rgba("+I.transform(t)+", "+I.transform(n)+", "+I.transform(r)+", "+x(w.transform(e))+")"};const M={test:B("#"),parse:function(t){let n="",r="",e="",o="";return t.length>5?(n=t.substring(1,3),r=t.substring(3,5),e=t.substring(5,7),o=t.substring(7,9)):(n=t.substring(1,2),r=t.substring(2,3),e=t.substring(3,4),o=t.substring(4,5),n+=n,r+=r,e+=e,o+=o),{red:parseInt(n,16),green:parseInt(r,16),blue:parseInt(e,16),alpha:o?parseInt(o,16)/255:1}},transform:A.transform},P=t=>({test:n=>"string"==typeof n&&n.endsWith(t)&&1===n.split(" ").length,parse:parseFloat,transform:n=>`${n}${t}`}),O=P("deg"),W=P("%"),E=P("px"),L=(()=>({...W,parse:t=>W.parse(t)/100,transform:t=>W.transform(100*t)}))(),C={test:B("hsl","hue"),parse:T("hue","saturation","lightness"),transform:({hue:t,saturation:n,lightness:r,alpha:e=1})=>"hsla("+Math.round(t)+", "+W.transform(x(n))+", "+W.transform(x(r))+", "+x(w.transform(e))+")"},j={test:t=>A.test(t)||M.test(t)||C.test(t),parse:t=>A.test(t)?A.parse(t):C.test(t)?C.parse(t):M.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?A.transform(t):C.transform(t),getAnimatableNone:t=>{const n=j.parse(t);return n.alpha=0,j.transform(n)}},V=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const $="number",F="color",X=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Y(t){const n=t.toString(),r=[],e={color:[],number:[],var:[]},o=[];let a=0;const s=n.replace(X,t=>(j.test(t)?(e.color.push(a),o.push(F),r.push(j.parse(t))):t.startsWith("var(")?(e.var.push(a),o.push("var"),r.push(t)):(e.number.push(a),o.push($),r.push(parseFloat(t))),++a,"${}")).split("${}");return{values:r,split:s,indexes:e,types:o}}function D({split:t,types:n}){const r=t.length;return e=>{let o="";for(let a=0;a{return"number"==typeof t?n?.trim().endsWith("/")?t:0:"number"==typeof(r=t)?0:j.test(r)?j.getAnimatableNone(r):r;var r};const N={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(R)?.length||0)+(t.match(V)?.length||0)>0},parse:function(t){return Y(t).values},createTransformer:function(t){return D(Y(t))},getAnimatableNone:function(t){const n=Y(t);return D(n)(n.values.map((t,r)=>H(t,n.split[r])))}},Z=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],z=(()=>new Set([...Z,"pathRotation"]))();function U(t,n,r,e){if("function"==typeof n){const[r,e]=[{},{}];n=n(t.custom,r,e)}if("string"==typeof n&&(n=t.variants&&t.variants[n]),"function"==typeof n){const[r,e]=[{},{}];n=n(t.custom,r,e)}return n}const _=t=>Boolean(t&&t.getVelocity);const q="data-"+"framerAppearId".replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`);const G={...b,transform:Math.round},J={borderWidth:E,borderTopWidth:E,borderRightWidth:E,borderBottomWidth:E,borderLeftWidth:E,borderRadius:E,borderTopLeftRadius:E,borderTopRightRadius:E,borderBottomRightRadius:E,borderBottomLeftRadius:E,width:E,maxWidth:E,height:E,maxHeight:E,top:E,right:E,bottom:E,left:E,inset:E,insetBlock:E,insetBlockStart:E,insetBlockEnd:E,insetInline:E,insetInlineStart:E,insetInlineEnd:E,padding:E,paddingTop:E,paddingRight:E,paddingBottom:E,paddingLeft:E,paddingBlock:E,paddingBlockStart:E,paddingBlockEnd:E,paddingInline:E,paddingInlineStart:E,paddingInlineEnd:E,margin:E,marginTop:E,marginRight:E,marginBottom:E,marginLeft:E,marginBlock:E,marginBlockStart:E,marginBlockEnd:E,marginInline:E,marginInlineStart:E,marginInlineEnd:E,fontSize:E,backgroundPositionX:E,backgroundPositionY:E,...{rotate:O,pathRotation:O,rotateX:O,rotateY:O,rotateZ:O,scale:S,scaleX:S,scaleY:S,scaleZ:S,skew:O,skewX:O,skewY:O,distance:E,translateX:E,translateY:E,translateZ:E,x:E,y:E,z:E,perspective:E,transformPerspective:E,opacity:w,originX:L,originY:L,originZ:E},zIndex:G,fillOpacity:w,strokeOpacity:w,numOctaves:G},K=(t,n)=>n&&"number"==typeof t?n.transform(t):t;function Q(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function tt(t){return"string"==typeof t||Array.isArray(t)}const nt=["initial","animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"];function rt(t){return Q(t.animate)||nt.some(n=>tt(t[n]))}let et={};const ot={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},at=Z.length;function st(t,n,r){const{style:e,vars:o,transformOrigin:a}=t;let s=!1,i=!1;for(const t in n){const r=n[t];if(z.has(t))s=!0;else if(v(t))o[t]=r;else{const n=K(r,J[t]);t.startsWith("origin")?(i=!0,a[t]=n):e[t]=n}}if(n.transform||(s||r?e.transform=function(t,n,r){let e="",o=!0;for(let a=0;a{if(!n.target)return t;if("string"==typeof t){if(!E.test(t))return t;t=parseFloat(t)}return`${it(t,n.target.x)}% ${it(t,n.target.y)}%`}},ut={correct:(t,{treeScale:n,projectionDelta:r})=>{const e=t,o=N.parse(t);if(o.length>5)return e;const a=N.createTransformer(t),s="number"!=typeof o[0]?1:0,i=r.x.scale*n.x,l=r.y.scale*n.y;o[0+s]/=i,o[1+s]/=l;const u=(c=i)+(l-c)*.5;var c;return"number"==typeof o[2+s]&&(o[2+s]/=u),"number"==typeof o[3+s]&&(o[3+s]/=u),a(o)}},ct={borderRadius:{...lt,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"]},borderTopLeftRadius:lt,borderTopRightRadius:lt,borderBottomLeftRadius:lt,borderBottomRightRadius:lt,boxShadow:ut};function ft(t,{layout:n,layoutId:r}){return z.has(t)||t.startsWith("origin")||(n||void 0!==r)&&(!!ct[t]||"opacity"===t)}function dt(t,n,r){const e=t.style,o=n?.style,a={};if(!e)return a;for(const n in e)(_(e[n])||o&&_(o[n])||ft(n,t)||void 0!==r?.getValue(n)?.liveStyle)&&(a[n]=e[n]);return a}const pt={offset:"stroke-dashoffset",array:"stroke-dasharray"},mt={offset:"strokeDashoffset",array:"strokeDasharray"};const gt=["transform","opacity","offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function ht(t,{attrX:n,attrY:r,attrScale:e,pathLength:o,pathSpacing:a=1,pathOffset:s=0,...i},l,u,c){if(st(t,i,u),l)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:f,style:d}=t;for(const t of gt)void 0!==f[t]&&(d[t]=f[t],delete f[t]);(d.transform||f.transformOrigin)&&(d.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),d.transform&&(d.transformBox=c?.transformBox??"fill-box",delete f.transformBox),void 0!==n&&(f.x=n),void 0!==r&&(f.y=r),void 0!==e&&(f.scale=e),void 0!==o&&function(t,n,r=1,e=0,o=!0){t.pathLength=1;const a=o?pt:mt;t[a.offset]=""+-e,t[a.array]=`${n} ${r}`}(f,o,a,s,!1)}function yt(t){return _(t)?t.get():t}function vt(t){const{initial:n,animate:r}=function(t,n){if(rt(t)){const{initial:n,animate:r}=t;return{initial:!1===n||tt(n)?n:void 0,animate:tt(r)?r:void 0}}return!1!==t.inherit?n:{}}(t,e(y));return o(()=>({initial:n,animate:r}),[bt(n),bt(r)])}function bt(t){return Array.isArray(t)?t.join(" "):t}const wt=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function St(t,n,r){for(const e in n)_(n[e])||ft(e,r)||(t[e]=n[e])}function xt(t,n){const r={};return St(r,t.style||{},t),Object.assign(r,function({transformTemplate:t},n){return o(()=>{const r={style:{},transform:{},transformOrigin:{},vars:{}};return st(r,n,t),Object.assign({},r.vars,r.style)},[n])}(t,n)),r}function Rt(t,n){const r={},e=xt(t,n);return t.drag&&!1!==t.dragListener&&(r.draggable=!1,e.userSelect=e.WebkitUserSelect=e.WebkitTouchCallout="none",e.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),void 0===t.tabIndex&&(t.onTap||t.onTapStart||t.whileTap)&&(r.tabIndex=0),r.style=e,r}const kt=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}});function Bt(t,n,r,e){const a=o(()=>{const r={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};var o;return ht(r,n,"string"==typeof(o=e)&&"svg"===o.toLowerCase(),t.transformTemplate,t.style),{...r.attrs,style:{...r.style}}},[n]);if(t.style){const n={};St(n,t.style,t),a.style={...n,...a.style}}return a}const Tt=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function It(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Tt.has(t)}function At(t,n){return t.startsWith("on")?!It(t):n?.(t)??!It(t)}const Mt=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Pt(t){return"string"==typeof t&&!t.includes("-")&&!!(Mt.indexOf(t)>-1||/[A-Z]/u.test(t))}function Ot(t,n,r,{latestValues:e},i,l=!1,u,c){const f=(u??Pt(t)?Bt:Rt)(n,e,i,t),d=function(t,n,r,e){const o={};for(const a in t)"values"===a&&"object"==typeof t.values||_(t[a])||(At(a,e)||!0===r&&It(a)||!n&&!It(a)||t.draggable&&a.startsWith("onDrag"))&&(o[a]=t[a]);return o}(n,"string"==typeof t,l,c),p=t!==a?{...d,...f,ref:r}:{},{children:m}=n,g=o(()=>_(m)?m.get():m,[m]);return s(t,{...p,children:g})}const Wt=r(null);function Et(t,n,r,e){const o={},a=e(t,{});for(const t in a)o[t]=yt(a[t]);let{initial:s,animate:i}=t;const l=rt(t),u=function(t){return Boolean(rt(t)||t.variants)}(t);n&&u&&!l&&!1!==t.inherit&&(void 0===s&&(s=n.initial),void 0===i&&(i=n.animate));let c=!!r&&!1===r.initial;c=c||!1===s;const f=c?i:s;if(f&&"boolean"!=typeof f&&!Q(f)){const n=Array.isArray(f)?f:[f];for(let r=0;r(n,r)=>{const o=e(y),a=e(Wt),s=()=>function({scrapeMotionValuesFromProps:t,createRenderState:n},r,e,o){return{latestValues:Et(r,e,o,t),renderState:n()}}(t,n,o,a);return r?s():function(t){const n=i(null);return null===n.current&&(n.current=t()),n.current}(s)},Ct=Lt({scrapeMotionValuesFromProps:dt,createRenderState:wt}),jt=Lt({scrapeMotionValuesFromProps:function(t,n,r){const e=dt(t,n,r);for(const r in t)if(_(t[r])||_(n[r])){e[-1!==Z.indexOf(r)?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r]=t[r]}return e},createRenderState:kt}),Vt={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let $t=!1;function Ft(){if($t)return;const t={};for(const n in Vt)t[n]={isEnabled:t=>Vt[n].some(n=>!!t[n])};et=t,$t=!0}function Xt(){return Ft(),et}const Yt=Symbol.for("motionComponentSymbol");function Dt(t,n,r){const e=i(r);l(()=>{e.current=r});const o=i(null);return u(r=>{r&&t.onMount?.(r),n&&(r?n.mount(r):n.unmount());const a=e.current;if("function"==typeof a)if(r){const t=a(r);"function"==typeof t&&(o.current=t)}else o.current?(o.current(),o.current=null):a(r);else a&&(a.current=r)},[n])}const Ht=r({});function Nt(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}const Zt="undefined"!=typeof window?c:f;function zt(t,n,r,o,a,s){const{visualElement:u}=e(y),c=e(g),d=e(Wt),p=e(h),m=p.reducedMotion,v=p.skipAnimations,b=i(null),w=i(!1);o=o||c.renderer,!b.current&&o&&(b.current=o(t,{visualState:n,parent:u,props:r,presenceContext:d,blockInitialAnimation:!!d&&!1===d.initial,reducedMotionConfig:m,skipAnimations:v,isSVG:s}),w.current&&b.current&&(b.current.manuallyAnimateOnMount=!0));const S=b.current,x=e(Ht);!S||S.projection||!a||"html"!==S.type&&"svg"!==S.type||function(t,n,r,e){const{layoutId:o,layout:a,drag:s,dragConstraints:i,layoutScroll:l,layoutRoot:u,layoutAnchor:c,layoutCrossfade:f}=n;t.projection=new r(t.latestValues,n["data-framer-portal-id"]?void 0:Ut(t.parent)),t.projection.setOptions({layoutId:o,layout:a,alwaysMeasureLayout:Boolean(s)||i&&Nt(i),visualElement:t,animationType:"string"==typeof a?a:"both",initialPromotionConfig:e,crossfade:f,layoutScroll:l,layoutRoot:u,layoutAnchor:c})}(b.current,r,a,x);const R=i(!1);l(()=>{S&&R.current&&S.update(r,d)});const k=r[q],B=i(Boolean(k)&&"undefined"!=typeof window&&!window.MotionHandoffIsComplete?.(k)&&window.MotionHasOptimisedAnimation?.(k));return Zt(()=>{w.current=!0,S&&(R.current=!0,window.MotionIsMounted=!0,S.updateFeatures(),S.scheduleRenderMicrotask(),B.current&&S.animationState&&S.animationState.animateChanges())}),f(()=>{S&&(!B.current&&S.animationState&&S.animationState.animateChanges(),B.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(k)}),B.current=!1),S.enteringChildren=void 0)}),S}function Ut(t){if(t)return!1!==t.options.allowProjection?t.projection:Ut(t.parent)}function _t(r,{forwardMotionProps:o=!1,type:a}={},s,i){const l=a?"svg"===a:Pt(r),u=l?jt:Ct;function c(a,s){let c;const f={...e(h),...a,layoutId:qt(a)},{isStatic:d,isValidProp:p}=f,m=vt(a),v=u(a,d);if(!d&&"undefined"!=typeof window){e(g).strict;const t=function(t){const n=Xt(),{drag:r,layout:e}=n;if(!r&&!e)return{};const o={...r,...e};return{MeasureLayout:r?.isEnabled(t)||e?.isEnabled(t)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}(f);c=t.MeasureLayout,m.visualElement=zt(r,v,f,i,t.ProjectionNode,l)}return t(y.Provider,{value:m,children:[c&&m.visualElement?n(c,{visualElement:m.visualElement,...f}):null,Ot(r,a,Dt(v,m.visualElement,s),v,d,o,l,p)]})}c.displayName=`motion.${"string"==typeof r?r:`create(${r.displayName??r.name??""})`}`;const f=d(c);return f[Yt]=r,f}function qt({layoutId:t}){const n=e(m).id;return n&&void 0!==t?n+"-"+t:t}function Gt(t,n){return _t(t,n)}const Jt=Gt("div");export{Jt as MotionDiv}; -//# sourceMappingURL=size-rollup-m.js.map diff --git a/node_modules/framer-motion/dist/size-rollup-m.js.map b/node_modules/framer-motion/dist/size-rollup-m.js.map deleted file mode 100644 index 8ec200c..0000000 --- a/node_modules/framer-motion/dist/size-rollup-m.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"size-rollup-m.js","sources":["../../motion-utils/dist/es/clamp.mjs","../lib/context/LayoutGroupContext.js","../lib/context/LazyContext.js","../lib/context/MotionConfigContext.js","../lib/context/MotionContext/index.js","../../motion-dom/dist/es/animation/utils/is-css-variable.mjs","../../motion-dom/dist/es/value/types/numbers/index.mjs","../../motion-dom/dist/es/value/types/utils/sanitize.mjs","../../motion-dom/dist/es/value/types/utils/float-regex.mjs","../../motion-dom/dist/es/value/types/utils/single-color-regex.mjs","../../motion-dom/dist/es/value/types/color/utils.mjs","../../motion-dom/dist/es/value/types/utils/is-nullish.mjs","../../motion-dom/dist/es/value/types/color/rgba.mjs","../../motion-dom/dist/es/value/types/color/hex.mjs","../../motion-dom/dist/es/value/types/numbers/units.mjs","../../motion-dom/dist/es/value/types/color/hsla.mjs","../../motion-dom/dist/es/value/types/color/index.mjs","../../motion-dom/dist/es/value/types/utils/color-regex.mjs","../../motion-dom/dist/es/value/types/complex/index.mjs","../../motion-dom/dist/es/render/utils/keys-transform.mjs","../../motion-dom/dist/es/render/utils/resolve-variants.mjs","../../motion-dom/dist/es/value/utils/is-motion-value.mjs","../../motion-dom/dist/es/animation/optimized-appear/data-id.mjs","../../motion-dom/dist/es/render/dom/utils/camel-to-dash.mjs","../../motion-dom/dist/es/value/types/int.mjs","../../motion-dom/dist/es/value/types/maps/number.mjs","../../motion-dom/dist/es/value/types/maps/transform.mjs","../../motion-dom/dist/es/value/types/utils/get-as-type.mjs","../../motion-dom/dist/es/render/utils/is-animation-controls.mjs","../../motion-dom/dist/es/render/utils/is-variant-label.mjs","../../motion-dom/dist/es/render/utils/variant-props.mjs","../../motion-dom/dist/es/render/utils/is-controlling-variants.mjs","../../motion-dom/dist/es/render/VisualElement.mjs","../../motion-dom/dist/es/render/html/utils/build-transform.mjs","../../motion-dom/dist/es/render/html/utils/build-styles.mjs","../../motion-dom/dist/es/projection/styles/scale-border-radius.mjs","../../motion-dom/dist/es/projection/styles/scale-box-shadow.mjs","../../motion-dom/dist/es/utils/mix/number.mjs","../../motion-dom/dist/es/projection/styles/scale-correction.mjs","../../motion-dom/dist/es/utils/border-radius.mjs","../../motion-dom/dist/es/render/utils/is-forced-motion-value.mjs","../../motion-dom/dist/es/render/html/utils/scrape-motion-values.mjs","../../motion-dom/dist/es/render/svg/utils/path.mjs","../../motion-dom/dist/es/render/svg/utils/build-attrs.mjs","../../motion-dom/dist/es/value/utils/resolve-motion-value.mjs","../lib/context/MotionContext/create.js","../lib/context/MotionContext/utils.js","../lib/render/html/utils/create-render-state.js","../lib/render/html/use-props.js","../lib/render/svg/utils/create-render-state.js","../lib/render/svg/use-props.js","../../motion-dom/dist/es/render/svg/utils/is-svg-tag.mjs","../lib/motion/utils/valid-prop.js","../lib/render/dom/utils/filter-props.js","../lib/render/svg/lowercase-elements.js","../lib/render/dom/utils/is-svg-component.js","../lib/render/dom/use-render.js","../lib/context/PresenceContext.js","../lib/motion/utils/use-visual-state.js","../lib/utils/use-constant.js","../lib/render/html/use-html-visual-state.js","../lib/render/svg/use-svg-visual-state.js","../../motion-dom/dist/es/render/svg/utils/scrape-motion-values.mjs","../lib/motion/features/definitions.js","../lib/motion/utils/symbol.js","../lib/motion/utils/use-motion-ref.js","../lib/context/SwitchLayoutGroupContext.js","../lib/utils/is-ref-object.js","../lib/utils/is-browser.js","../lib/utils/use-isomorphic-effect.js","../lib/motion/utils/use-visual-element.js","../lib/motion/index.js","../lib/render/components/m/create.js","../lib/render/components/m/elements.js","../lib/render/components/m/size.js"],"sourcesContent":["const clamp = (min, max, v) => {\n if (v > max)\n return max;\n if (v < min)\n return min;\n return v;\n};\n\nexport { clamp };\n//# sourceMappingURL=clamp.mjs.map\n","\"use client\";\nimport { createContext } from \"react\";\nexport const LayoutGroupContext = createContext({});\n//# sourceMappingURL=LayoutGroupContext.js.map","\"use client\";\nimport { createContext } from \"react\";\nexport const LazyContext = createContext({ strict: false });\n//# sourceMappingURL=LazyContext.js.map","\"use client\";\nimport { createContext } from \"react\";\n/**\n * @public\n */\nexport const MotionConfigContext = createContext({\n transformPagePoint: (p) => p,\n isStatic: false,\n reducedMotion: \"never\",\n});\n//# sourceMappingURL=MotionConfigContext.js.map","\"use client\";\nimport { createContext } from \"react\";\nexport const MotionContext = /* @__PURE__ */ createContext({});\n//# sourceMappingURL=index.js.map","const checkStringStartsWith = (token) => (key) => typeof key === \"string\" && key.startsWith(token);\nconst isCSSVariableName = \n/*@__PURE__*/ checkStringStartsWith(\"--\");\nconst startsAsVariableToken = \n/*@__PURE__*/ checkStringStartsWith(\"var(--\");\nconst isCSSVariableToken = (value) => {\n const startsWithToken = startsAsVariableToken(value);\n if (!startsWithToken)\n return false;\n // Ensure any comments are stripped from the value as this can harm performance of the regex.\n return singleCssVariableRegex.test(value.split(\"/*\")[0].trim());\n};\nconst singleCssVariableRegex = /var\\(--(?:[\\w-]+\\s*|[\\w-]+\\s*,(?:\\s*[^)(\\s]|\\s*\\((?:[^)(]|\\([^)(]*\\))*\\))+\\s*)\\)$/iu;\n/**\n * Check if a value contains a CSS variable anywhere (e.g. inside calc()).\n * Unlike isCSSVariableToken which checks if the value IS a var() token,\n * this checks if the value CONTAINS var() somewhere in the string.\n */\nfunction containsCSSVariable(value) {\n if (typeof value !== \"string\")\n return false;\n // Strip comments to avoid false positives\n return value.split(\"/*\")[0].includes(\"var(--\");\n}\n\nexport { containsCSSVariable, isCSSVariableName, isCSSVariableToken };\n//# sourceMappingURL=is-css-variable.mjs.map\n","import { clamp } from 'motion-utils';\n\nconst number = {\n test: (v) => typeof v === \"number\",\n parse: parseFloat,\n transform: (v) => v,\n};\nconst alpha = {\n ...number,\n transform: (v) => clamp(0, 1, v),\n};\nconst scale = {\n ...number,\n default: 1,\n};\n\nexport { alpha, number, scale };\n//# sourceMappingURL=index.mjs.map\n","// If this number is a decimal, make it just five decimal places\n// to avoid exponents\nconst sanitize = (v) => Math.round(v * 100000) / 100000;\n\nexport { sanitize };\n//# sourceMappingURL=sanitize.mjs.map\n","const floatRegex = /-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)/gu;\n\nexport { floatRegex };\n//# sourceMappingURL=float-regex.mjs.map\n","const singleColorRegex = /^(?:#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\))$/iu;\n\nexport { singleColorRegex };\n//# sourceMappingURL=single-color-regex.mjs.map\n","import { floatRegex } from '../utils/float-regex.mjs';\nimport { isNullish } from '../utils/is-nullish.mjs';\nimport { singleColorRegex } from '../utils/single-color-regex.mjs';\n\n/**\n * Returns true if the provided string is a color, ie rgba(0,0,0,0) or #000,\n * but false if a number or multiple colors\n */\nconst isColorString = (type, testProp) => (v) => {\n return Boolean((typeof v === \"string\" &&\n singleColorRegex.test(v) &&\n v.startsWith(type)) ||\n (testProp &&\n !isNullish(v) &&\n Object.prototype.hasOwnProperty.call(v, testProp)));\n};\nconst splitColor = (aName, bName, cName) => (v) => {\n if (typeof v !== \"string\")\n return v;\n const [a, b, c, alpha] = v.match(floatRegex);\n return {\n [aName]: parseFloat(a),\n [bName]: parseFloat(b),\n [cName]: parseFloat(c),\n alpha: alpha !== undefined ? parseFloat(alpha) : 1,\n };\n};\n\nexport { isColorString, splitColor };\n//# sourceMappingURL=utils.mjs.map\n","function isNullish(v) {\n return v == null;\n}\n\nexport { isNullish };\n//# sourceMappingURL=is-nullish.mjs.map\n","import { clamp } from 'motion-utils';\nimport { number, alpha } from '../numbers/index.mjs';\nimport { sanitize } from '../utils/sanitize.mjs';\nimport { splitColor, isColorString } from './utils.mjs';\n\nconst clampRgbUnit = (v) => clamp(0, 255, v);\nconst rgbUnit = {\n ...number,\n transform: (v) => Math.round(clampRgbUnit(v)),\n};\nconst rgba = {\n test: /*@__PURE__*/ isColorString(\"rgb\", \"red\"),\n parse: /*@__PURE__*/ splitColor(\"red\", \"green\", \"blue\"),\n transform: ({ red, green, blue, alpha: alpha$1 = 1 }) => \"rgba(\" +\n rgbUnit.transform(red) +\n \", \" +\n rgbUnit.transform(green) +\n \", \" +\n rgbUnit.transform(blue) +\n \", \" +\n sanitize(alpha.transform(alpha$1)) +\n \")\",\n};\n\nexport { rgbUnit, rgba };\n//# sourceMappingURL=rgba.mjs.map\n","import { rgba } from './rgba.mjs';\nimport { isColorString } from './utils.mjs';\n\nfunction parseHex(v) {\n let r = \"\";\n let g = \"\";\n let b = \"\";\n let a = \"\";\n // If we have 6 characters, ie #FF0000\n if (v.length > 5) {\n r = v.substring(1, 3);\n g = v.substring(3, 5);\n b = v.substring(5, 7);\n a = v.substring(7, 9);\n // Or we have 3 characters, ie #F00\n }\n else {\n r = v.substring(1, 2);\n g = v.substring(2, 3);\n b = v.substring(3, 4);\n a = v.substring(4, 5);\n r += r;\n g += g;\n b += b;\n a += a;\n }\n return {\n red: parseInt(r, 16),\n green: parseInt(g, 16),\n blue: parseInt(b, 16),\n alpha: a ? parseInt(a, 16) / 255 : 1,\n };\n}\nconst hex = {\n test: /*@__PURE__*/ isColorString(\"#\"),\n parse: parseHex,\n transform: rgba.transform,\n};\n\nexport { hex };\n//# sourceMappingURL=hex.mjs.map\n","/*#__NO_SIDE_EFFECTS__*/\nconst createUnitType = (unit) => ({\n test: (v) => typeof v === \"string\" && v.endsWith(unit) && v.split(\" \").length === 1,\n parse: parseFloat,\n transform: (v) => `${v}${unit}`,\n});\nconst degrees = /*@__PURE__*/ createUnitType(\"deg\");\nconst percent = /*@__PURE__*/ createUnitType(\"%\");\nconst px = /*@__PURE__*/ createUnitType(\"px\");\nconst vh = /*@__PURE__*/ createUnitType(\"vh\");\nconst vw = /*@__PURE__*/ createUnitType(\"vw\");\nconst progressPercentage = /*@__PURE__*/ (() => ({\n ...percent,\n parse: (v) => percent.parse(v) / 100,\n transform: (v) => percent.transform(v * 100),\n}))();\n\nexport { degrees, percent, progressPercentage, px, vh, vw };\n//# sourceMappingURL=units.mjs.map\n","import { alpha } from '../numbers/index.mjs';\nimport { percent } from '../numbers/units.mjs';\nimport { sanitize } from '../utils/sanitize.mjs';\nimport { splitColor, isColorString } from './utils.mjs';\n\nconst hsla = {\n test: /*@__PURE__*/ isColorString(\"hsl\", \"hue\"),\n parse: /*@__PURE__*/ splitColor(\"hue\", \"saturation\", \"lightness\"),\n transform: ({ hue, saturation, lightness, alpha: alpha$1 = 1 }) => {\n return (\"hsla(\" +\n Math.round(hue) +\n \", \" +\n percent.transform(sanitize(saturation)) +\n \", \" +\n percent.transform(sanitize(lightness)) +\n \", \" +\n sanitize(alpha.transform(alpha$1)) +\n \")\");\n },\n};\n\nexport { hsla };\n//# sourceMappingURL=hsla.mjs.map\n","import { hex } from './hex.mjs';\nimport { hsla } from './hsla.mjs';\nimport { rgba } from './rgba.mjs';\n\nconst color = {\n test: (v) => rgba.test(v) || hex.test(v) || hsla.test(v),\n parse: (v) => {\n if (rgba.test(v)) {\n return rgba.parse(v);\n }\n else if (hsla.test(v)) {\n return hsla.parse(v);\n }\n else {\n return hex.parse(v);\n }\n },\n transform: (v) => {\n return typeof v === \"string\"\n ? v\n : v.hasOwnProperty(\"red\")\n ? rgba.transform(v)\n : hsla.transform(v);\n },\n getAnimatableNone: (v) => {\n const parsed = color.parse(v);\n parsed.alpha = 0;\n return color.transform(parsed);\n },\n};\n\nexport { color };\n//# sourceMappingURL=index.mjs.map\n","const colorRegex = /(?:#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\))/giu;\n\nexport { colorRegex };\n//# sourceMappingURL=color-regex.mjs.map\n","import { color } from '../color/index.mjs';\nimport { colorRegex } from '../utils/color-regex.mjs';\nimport { floatRegex } from '../utils/float-regex.mjs';\nimport { sanitize } from '../utils/sanitize.mjs';\n\nfunction test(v) {\n return (isNaN(v) &&\n typeof v === \"string\" &&\n (v.match(floatRegex)?.length || 0) +\n (v.match(colorRegex)?.length || 0) >\n 0);\n}\nconst NUMBER_TOKEN = \"number\";\nconst COLOR_TOKEN = \"color\";\nconst VAR_TOKEN = \"var\";\nconst VAR_FUNCTION_TOKEN = \"var(\";\nconst SPLIT_TOKEN = \"${}\";\n// this regex consists of the `singleCssVariableRegex|rgbHSLValueRegex|digitRegex`\nconst complexRegex = /var\\s*\\(\\s*--(?:[\\w-]+\\s*|[\\w-]+\\s*,(?:\\s*[^)(\\s]|\\s*\\((?:[^)(]|\\([^)(]*\\))*\\))+\\s*)\\)|#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\)|-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)/giu;\nfunction analyseComplexValue(value) {\n const originalValue = value.toString();\n const values = [];\n const indexes = {\n color: [],\n number: [],\n var: [],\n };\n const types = [];\n let i = 0;\n const tokenised = originalValue.replace(complexRegex, (parsedValue) => {\n if (color.test(parsedValue)) {\n indexes.color.push(i);\n types.push(COLOR_TOKEN);\n values.push(color.parse(parsedValue));\n }\n else if (parsedValue.startsWith(VAR_FUNCTION_TOKEN)) {\n indexes.var.push(i);\n types.push(VAR_TOKEN);\n values.push(parsedValue);\n }\n else {\n indexes.number.push(i);\n types.push(NUMBER_TOKEN);\n values.push(parseFloat(parsedValue));\n }\n ++i;\n return SPLIT_TOKEN;\n });\n const split = tokenised.split(SPLIT_TOKEN);\n return { values, split, indexes, types };\n}\nfunction parseComplexValue(v) {\n return analyseComplexValue(v).values;\n}\nfunction buildTransformer({ split, types }) {\n const numSections = split.length;\n return (v) => {\n let output = \"\";\n for (let i = 0; i < numSections; i++) {\n output += split[i];\n if (v[i] !== undefined) {\n const type = types[i];\n if (type === NUMBER_TOKEN) {\n output += sanitize(v[i]);\n }\n else if (type === COLOR_TOKEN) {\n output += color.transform(v[i]);\n }\n else {\n output += v[i];\n }\n }\n }\n return output;\n };\n}\nfunction createTransformer(source) {\n return buildTransformer(analyseComplexValue(source));\n}\nconst convertNumbersToZero = (v) => typeof v === \"number\" ? 0 : color.test(v) ? color.getAnimatableNone(v) : v;\n/**\n * Convert a parsed value to its zero equivalent, but preserve numbers\n * that act as divisors in CSS calc() expressions.\n *\n * analyseComplexValue extracts numbers from CSS strings and puts the\n * surrounding text into a `split` template array. For example:\n * \"calc(var(--gap) / 5)\" → values: [var(--gap), 5]\n * split: [\"calc(\", \" / \", \")\"]\n *\n * When building a zero-equivalent for animation, naively zeroing all\n * numbers turns the divisor into 0 → \"calc(var(--gap) / 0)\" → NaN.\n * We detect this by checking whether the text preceding a number\n * (split[i]) ends with \"/\" — the CSS calc division operator.\n */\nconst convertToZero = (value, splitBefore) => {\n if (typeof value === \"number\") {\n return splitBefore?.trim().endsWith(\"/\") ? value : 0;\n }\n return convertNumbersToZero(value);\n};\nfunction getAnimatableNone(v) {\n const info = analyseComplexValue(v);\n const transformer = buildTransformer(info);\n return transformer(info.values.map((value, i) => convertToZero(value, info.split[i])));\n}\nconst complex = {\n test,\n parse: parseComplexValue,\n createTransformer,\n getAnimatableNone,\n};\n\nexport { analyseComplexValue, complex };\n//# sourceMappingURL=index.mjs.map\n","/**\n * Generate a list of every possible transform key.\n */\nconst transformPropOrder = [\n \"transformPerspective\",\n \"x\",\n \"y\",\n \"z\",\n \"translateX\",\n \"translateY\",\n \"translateZ\",\n \"scale\",\n \"scaleX\",\n \"scaleY\",\n \"rotate\",\n \"rotateX\",\n \"rotateY\",\n \"rotateZ\",\n \"skew\",\n \"skewX\",\n \"skewY\",\n];\n/**\n * A quick lookup for transform props.\n *\n * `pathRotation` is a transform for routing purposes (skipped from raw\n * style application, wired to the transform composite, flags transform\n * dirty) but is intentionally NOT in `transformPropOrder` — it is\n * composed onto `rotate` at the build sites, not serialized in its own\n * slot, and must stay out of the order-array consumers (parse-transform,\n * unit-conversion, keys-position).\n */\nconst transformProps = /*@__PURE__*/ (() => new Set([...transformPropOrder, \"pathRotation\"]))();\n\nexport { transformPropOrder, transformProps };\n//# sourceMappingURL=keys-transform.mjs.map\n","function getValueState(visualElement) {\n const state = [{}, {}];\n visualElement?.values.forEach((value, key) => {\n state[0][key] = value.get();\n state[1][key] = value.getVelocity();\n });\n return state;\n}\nfunction resolveVariantFromProps(props, definition, custom, visualElement) {\n /**\n * If the variant definition is a function, resolve.\n */\n if (typeof definition === \"function\") {\n const [current, velocity] = getValueState(visualElement);\n definition = definition(custom !== undefined ? custom : props.custom, current, velocity);\n }\n /**\n * If the variant definition is a variant label, or\n * the function returned a variant label, resolve.\n */\n if (typeof definition === \"string\") {\n definition = props.variants && props.variants[definition];\n }\n /**\n * At this point we've resolved both functions and variant labels,\n * but the resolved variant label might itself have been a function.\n * If so, resolve. This can only have returned a valid target object.\n */\n if (typeof definition === \"function\") {\n const [current, velocity] = getValueState(visualElement);\n definition = definition(custom !== undefined ? custom : props.custom, current, velocity);\n }\n return definition;\n}\n\nexport { resolveVariantFromProps };\n//# sourceMappingURL=resolve-variants.mjs.map\n","const isMotionValue = (value) => Boolean(value && value.getVelocity);\n\nexport { isMotionValue };\n//# sourceMappingURL=is-motion-value.mjs.map\n","import { camelToDash } from '../../render/dom/utils/camel-to-dash.mjs';\n\nconst optimizedAppearDataId = \"framerAppearId\";\nconst optimizedAppearDataAttribute = \"data-\" + camelToDash(optimizedAppearDataId);\n\nexport { optimizedAppearDataAttribute, optimizedAppearDataId };\n//# sourceMappingURL=data-id.mjs.map\n","function camelToDash(str) {\n return str.replace(/([A-Z])/g, (match) => `-${match.toLowerCase()}`);\n}\n\nexport { camelToDash };\n//# sourceMappingURL=camel-to-dash.mjs.map\n","import { number } from './numbers/index.mjs';\n\nconst int = {\n ...number,\n transform: Math.round,\n};\n\nexport { int };\n//# sourceMappingURL=int.mjs.map\n","import { int } from '../int.mjs';\nimport { alpha } from '../numbers/index.mjs';\nimport { px } from '../numbers/units.mjs';\nimport { transformValueTypes } from './transform.mjs';\n\nconst numberValueTypes = {\n // Border props\n borderWidth: px,\n borderTopWidth: px,\n borderRightWidth: px,\n borderBottomWidth: px,\n borderLeftWidth: px,\n borderRadius: px,\n borderTopLeftRadius: px,\n borderTopRightRadius: px,\n borderBottomRightRadius: px,\n borderBottomLeftRadius: px,\n // Positioning props\n width: px,\n maxWidth: px,\n height: px,\n maxHeight: px,\n top: px,\n right: px,\n bottom: px,\n left: px,\n inset: px,\n insetBlock: px,\n insetBlockStart: px,\n insetBlockEnd: px,\n insetInline: px,\n insetInlineStart: px,\n insetInlineEnd: px,\n // Spacing props\n padding: px,\n paddingTop: px,\n paddingRight: px,\n paddingBottom: px,\n paddingLeft: px,\n paddingBlock: px,\n paddingBlockStart: px,\n paddingBlockEnd: px,\n paddingInline: px,\n paddingInlineStart: px,\n paddingInlineEnd: px,\n margin: px,\n marginTop: px,\n marginRight: px,\n marginBottom: px,\n marginLeft: px,\n marginBlock: px,\n marginBlockStart: px,\n marginBlockEnd: px,\n marginInline: px,\n marginInlineStart: px,\n marginInlineEnd: px,\n // Typography\n fontSize: px,\n // Misc\n backgroundPositionX: px,\n backgroundPositionY: px,\n ...transformValueTypes,\n zIndex: int,\n // SVG\n fillOpacity: alpha,\n strokeOpacity: alpha,\n numOctaves: int,\n};\n\nexport { numberValueTypes };\n//# sourceMappingURL=number.mjs.map\n","import { alpha, scale } from '../numbers/index.mjs';\nimport { px, progressPercentage, degrees } from '../numbers/units.mjs';\n\nconst transformValueTypes = {\n rotate: degrees,\n /**\n * Internal channel for `transition.path` orientToPath. Composed onto\n * `rotate` at the transform-build sites so the user's `rotate` is\n * never read or overwritten. Not part of `transformPropOrder`.\n */\n pathRotation: degrees,\n rotateX: degrees,\n rotateY: degrees,\n rotateZ: degrees,\n scale,\n scaleX: scale,\n scaleY: scale,\n scaleZ: scale,\n skew: degrees,\n skewX: degrees,\n skewY: degrees,\n distance: px,\n translateX: px,\n translateY: px,\n translateZ: px,\n x: px,\n y: px,\n z: px,\n perspective: px,\n transformPerspective: px,\n opacity: alpha,\n originX: progressPercentage,\n originY: progressPercentage,\n originZ: px,\n};\n\nexport { transformValueTypes };\n//# sourceMappingURL=transform.mjs.map\n","/**\n * Provided a value and a ValueType, returns the value as that value type.\n */\nconst getValueAsType = (value, type) => {\n return type && typeof value === \"number\"\n ? type.transform(value)\n : value;\n};\n\nexport { getValueAsType };\n//# sourceMappingURL=get-as-type.mjs.map\n","function isAnimationControls(v) {\n return (v !== null &&\n typeof v === \"object\" &&\n typeof v.start === \"function\");\n}\n\nexport { isAnimationControls };\n//# sourceMappingURL=is-animation-controls.mjs.map\n","/**\n * Decides if the supplied variable is variant label\n */\nfunction isVariantLabel(v) {\n return typeof v === \"string\" || Array.isArray(v);\n}\n\nexport { isVariantLabel };\n//# sourceMappingURL=is-variant-label.mjs.map\n","const variantPriorityOrder = [\n \"animate\",\n \"whileInView\",\n \"whileFocus\",\n \"whileHover\",\n \"whileTap\",\n \"whileDrag\",\n \"exit\",\n];\nconst variantProps = [\"initial\", ...variantPriorityOrder];\n\nexport { variantPriorityOrder, variantProps };\n//# sourceMappingURL=variant-props.mjs.map\n","import { isAnimationControls } from './is-animation-controls.mjs';\nimport { isVariantLabel } from './is-variant-label.mjs';\nimport { variantProps } from './variant-props.mjs';\n\nfunction isControllingVariants(props) {\n return (isAnimationControls(props.animate) ||\n variantProps.some((name) => isVariantLabel(props[name])));\n}\nfunction isVariantNode(props) {\n return Boolean(isControllingVariants(props) || props.variants);\n}\n\nexport { isControllingVariants, isVariantNode };\n//# sourceMappingURL=is-controlling-variants.mjs.map\n","import { warnOnce, secondsToMilliseconds, isNumericalString, isZeroValueString, SubscriptionManager } from 'motion-utils';\nimport { KeyframeResolver } from '../animation/keyframes/KeyframesResolver.mjs';\nimport { NativeAnimation } from '../animation/NativeAnimation.mjs';\nimport { acceleratedValues } from '../animation/waapi/utils/accelerated-values.mjs';\nimport { microtask } from '../frameloop/microtask.mjs';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { createBox } from '../projection/geometry/models.mjs';\nimport { motionValue } from '../value/index.mjs';\nimport { complex } from '../value/types/complex/index.mjs';\nimport { getAnimatableNone } from '../value/types/utils/animatable-none.mjs';\nimport { findValueType } from '../value/types/utils/find.mjs';\nimport { isMotionValue } from '../value/utils/is-motion-value.mjs';\nimport { visualElementStore } from './store.mjs';\nimport { isControllingVariants, isVariantNode } from './utils/is-controlling-variants.mjs';\nimport { transformProps } from './utils/keys-transform.mjs';\nimport { updateMotionValuesFromProps } from './utils/motion-values.mjs';\nimport { initPrefersReducedMotion } from './utils/reduced-motion/index.mjs';\nimport { resolveVariantFromProps } from './utils/resolve-variants.mjs';\nimport { hasReducedMotionListener, prefersReducedMotion } from './utils/reduced-motion/state.mjs';\nimport { frame, cancelFrame } from '../frameloop/frame.mjs';\n\nconst propEventHandlers = [\n \"AnimationStart\",\n \"AnimationComplete\",\n \"Update\",\n \"BeforeLayoutMeasure\",\n \"LayoutMeasure\",\n \"LayoutAnimationStart\",\n \"LayoutAnimationComplete\",\n];\n/**\n * Static feature definitions - can be injected by framework layer\n */\nlet featureDefinitions = {};\n/**\n * Set feature definitions for all VisualElements.\n * This should be called by the framework layer (e.g., framer-motion) during initialization.\n */\nfunction setFeatureDefinitions(definitions) {\n featureDefinitions = definitions;\n}\n/**\n * Get the current feature definitions\n */\nfunction getFeatureDefinitions() {\n return featureDefinitions;\n}\n/**\n * A VisualElement is an imperative abstraction around UI elements such as\n * HTMLElement, SVGElement, Three.Object3D etc.\n */\nclass VisualElement {\n /**\n * This method takes React props and returns found MotionValues. For example, HTML\n * MotionValues will be found within the style prop, whereas for Three.js within attribute arrays.\n *\n * This isn't an abstract method as it needs calling in the constructor, but it is\n * intended to be one.\n */\n scrapeMotionValuesFromProps(_props, _prevProps, _visualElement) {\n return {};\n }\n constructor({ parent, props, presenceContext, reducedMotionConfig, skipAnimations, blockInitialAnimation, visualState, }, options = {}) {\n /**\n * A reference to the current underlying Instance, e.g. a HTMLElement\n * or Three.Mesh etc.\n */\n this.current = null;\n /**\n * A set containing references to this VisualElement's children.\n */\n this.children = new Set();\n /**\n * Determine what role this visual element should take in the variant tree.\n */\n this.isVariantNode = false;\n this.isControllingVariants = false;\n /**\n * Decides whether this VisualElement should animate in reduced motion\n * mode.\n *\n * TODO: This is currently set on every individual VisualElement but feels\n * like it could be set globally.\n */\n this.shouldReduceMotion = null;\n /**\n * Decides whether animations should be skipped for this VisualElement.\n * Useful for E2E tests and visual regression testing.\n */\n this.shouldSkipAnimations = false;\n /**\n * A map of all motion values attached to this visual element. Motion\n * values are source of truth for any given animated value. A motion\n * value might be provided externally by the component via props.\n */\n this.values = new Map();\n this.KeyframeResolver = KeyframeResolver;\n /**\n * Cleanup functions for active features (hover/tap/exit etc)\n */\n this.features = {};\n /**\n * A map of every subscription that binds the provided or generated\n * motion values onChange listeners to this visual element.\n */\n this.valueSubscriptions = new Map();\n /**\n * A reference to the previously-provided motion values as returned\n * from scrapeMotionValuesFromProps. We use the keys in here to determine\n * if any motion values need to be removed after props are updated.\n */\n this.prevMotionValues = {};\n /**\n * Track whether this element has been mounted before, to detect\n * remounts after Suspense unmount/remount cycles.\n */\n this.hasBeenMounted = false;\n /**\n * An object containing a SubscriptionManager for each active event.\n */\n this.events = {};\n /**\n * An object containing an unsubscribe function for each prop event subscription.\n * For example, every \"Update\" event can have multiple subscribers via\n * VisualElement.on(), but only one of those can be defined via the onUpdate prop.\n */\n this.propEventSubscriptions = {};\n this.notifyUpdate = () => this.notify(\"Update\", this.latestValues);\n this.render = () => {\n if (!this.current)\n return;\n this.triggerBuild();\n this.renderInstance(this.current, this.renderState, this.props.style, this.projection);\n };\n this.renderScheduledAt = 0.0;\n this.scheduleRender = () => {\n const now = time.now();\n if (this.renderScheduledAt < now) {\n this.renderScheduledAt = now;\n frame.render(this.render, false, true);\n }\n };\n const { latestValues, renderState } = visualState;\n this.latestValues = latestValues;\n this.baseTarget = { ...latestValues };\n this.initialValues = props.initial ? { ...latestValues } : {};\n this.renderState = renderState;\n this.parent = parent;\n this.props = props;\n this.presenceContext = presenceContext;\n this.depth = parent ? parent.depth + 1 : 0;\n this.reducedMotionConfig = reducedMotionConfig;\n this.skipAnimationsConfig = skipAnimations;\n this.options = options;\n this.blockInitialAnimation = Boolean(blockInitialAnimation);\n this.isControllingVariants = isControllingVariants(props);\n this.isVariantNode = isVariantNode(props);\n if (this.isVariantNode) {\n this.variantChildren = new Set();\n }\n this.manuallyAnimateOnMount = Boolean(parent && parent.current);\n /**\n * Any motion values that are provided to the element when created\n * aren't yet bound to the element, as this would technically be impure.\n * However, we iterate through the motion values and set them to the\n * initial values for this component.\n *\n * TODO: This is impure and we should look at changing this to run on mount.\n * Doing so will break some tests but this isn't necessarily a breaking change,\n * more a reflection of the test.\n */\n const { willChange, ...initialMotionValues } = this.scrapeMotionValuesFromProps(props, {}, this);\n for (const key in initialMotionValues) {\n const value = initialMotionValues[key];\n if (latestValues[key] !== undefined && isMotionValue(value)) {\n value.set(latestValues[key]);\n }\n }\n }\n mount(instance) {\n /**\n * If this element has been mounted before (e.g. after a Suspense\n * unmount/remount), reset motion values to their initial state\n * so animations replay correctly from initial → animate.\n */\n if (this.hasBeenMounted) {\n for (const key in this.initialValues) {\n this.values.get(key)?.jump(this.initialValues[key]);\n this.latestValues[key] = this.initialValues[key];\n }\n }\n this.current = instance;\n visualElementStore.set(instance, this);\n if (this.projection && !this.projection.instance) {\n this.projection.mount(instance);\n }\n if (this.parent && this.isVariantNode && !this.isControllingVariants) {\n this.removeFromVariantTree = this.parent.addVariantChild(this);\n }\n this.values.forEach((value, key) => this.bindToMotionValue(key, value));\n /**\n * Determine reduced motion preference. Only initialize the matchMedia\n * listener if we actually need the dynamic value (i.e., when config\n * is neither \"never\" nor \"always\").\n */\n if (this.reducedMotionConfig === \"never\") {\n this.shouldReduceMotion = false;\n }\n else if (this.reducedMotionConfig === \"always\") {\n this.shouldReduceMotion = true;\n }\n else {\n if (!hasReducedMotionListener.current) {\n initPrefersReducedMotion();\n }\n this.shouldReduceMotion = prefersReducedMotion.current;\n }\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(this.shouldReduceMotion !== true, \"You have Reduced Motion enabled on your device. Animations may not appear as expected.\", \"reduced-motion-disabled\");\n }\n /**\n * Set whether animations should be skipped based on the config.\n */\n this.shouldSkipAnimations = this.skipAnimationsConfig ?? false;\n this.parent?.addChild(this);\n this.update(this.props, this.presenceContext);\n this.hasBeenMounted = true;\n }\n unmount() {\n this.projection && this.projection.unmount();\n cancelFrame(this.notifyUpdate);\n cancelFrame(this.render);\n this.valueSubscriptions.forEach((remove) => remove());\n this.valueSubscriptions.clear();\n this.removeFromVariantTree && this.removeFromVariantTree();\n this.parent?.removeChild(this);\n for (const key in this.events) {\n this.events[key].clear();\n }\n for (const key in this.features) {\n const feature = this.features[key];\n if (feature) {\n feature.unmount();\n feature.isMounted = false;\n }\n }\n this.current = null;\n }\n addChild(child) {\n this.children.add(child);\n this.enteringChildren ?? (this.enteringChildren = new Set());\n this.enteringChildren.add(child);\n }\n removeChild(child) {\n this.children.delete(child);\n this.enteringChildren && this.enteringChildren.delete(child);\n }\n bindToMotionValue(key, value) {\n if (this.valueSubscriptions.has(key)) {\n this.valueSubscriptions.get(key)();\n }\n if (value.accelerate &&\n acceleratedValues.has(key) &&\n this.current instanceof HTMLElement) {\n const { factory, keyframes, times, ease, duration } = value.accelerate;\n const animation = new NativeAnimation({\n element: this.current,\n name: key,\n keyframes,\n times,\n ease,\n duration: secondsToMilliseconds(duration),\n });\n const cleanup = factory(animation);\n this.valueSubscriptions.set(key, () => {\n cleanup();\n animation.cancel();\n });\n return;\n }\n const valueIsTransform = transformProps.has(key);\n if (valueIsTransform && this.onBindTransform) {\n this.onBindTransform();\n }\n const removeOnChange = value.on(\"change\", (latestValue) => {\n this.latestValues[key] = latestValue;\n this.props.onUpdate && frame.preRender(this.notifyUpdate);\n if (valueIsTransform && this.projection) {\n this.projection.isTransformDirty = true;\n }\n this.scheduleRender();\n });\n let removeSyncCheck;\n if (typeof window !== \"undefined\" &&\n window.MotionCheckAppearSync) {\n removeSyncCheck = window.MotionCheckAppearSync(this, key, value);\n }\n this.valueSubscriptions.set(key, () => {\n removeOnChange();\n if (removeSyncCheck)\n removeSyncCheck();\n // Defer to MotionValue.on(\"change\") auto-stop so React 19 remounts\n // can resubscribe before the animation is cancelled (#3315).\n });\n }\n sortNodePosition(other) {\n /**\n * If these nodes aren't even of the same type we can't compare their depth.\n */\n if (!this.current ||\n !this.sortInstanceNodePosition ||\n this.type !== other.type) {\n return 0;\n }\n return this.sortInstanceNodePosition(this.current, other.current);\n }\n updateFeatures() {\n let key = \"animation\";\n for (key in featureDefinitions) {\n const featureDefinition = featureDefinitions[key];\n if (!featureDefinition)\n continue;\n const { isEnabled, Feature: FeatureConstructor } = featureDefinition;\n /**\n * If this feature is enabled but not active, make a new instance.\n */\n if (!this.features[key] &&\n FeatureConstructor &&\n isEnabled(this.props)) {\n this.features[key] = new FeatureConstructor(this);\n }\n /**\n * If we have a feature, mount or update it.\n */\n if (this.features[key]) {\n const feature = this.features[key];\n if (feature.isMounted) {\n feature.update();\n }\n else {\n feature.mount();\n feature.isMounted = true;\n }\n }\n }\n }\n triggerBuild() {\n this.build(this.renderState, this.latestValues, this.props);\n }\n /**\n * Measure the current viewport box with or without transforms.\n * Only measures axis-aligned boxes, rotate and skew must be manually\n * removed with a re-render to work.\n */\n measureViewportBox() {\n return this.current\n ? this.measureInstanceViewportBox(this.current, this.props)\n : createBox();\n }\n getStaticValue(key) {\n return this.latestValues[key];\n }\n setStaticValue(key, value) {\n this.latestValues[key] = value;\n }\n /**\n * Update the provided props. Ensure any newly-added motion values are\n * added to our map, old ones removed, and listeners updated.\n */\n update(props, presenceContext) {\n if (props.transformTemplate || this.props.transformTemplate) {\n this.scheduleRender();\n }\n this.prevProps = this.props;\n this.props = props;\n this.prevPresenceContext = this.presenceContext;\n this.presenceContext = presenceContext;\n /**\n * Update prop event handlers ie onAnimationStart, onAnimationComplete\n */\n for (let i = 0; i < propEventHandlers.length; i++) {\n const key = propEventHandlers[i];\n if (this.propEventSubscriptions[key]) {\n this.propEventSubscriptions[key]();\n delete this.propEventSubscriptions[key];\n }\n const listenerName = (\"on\" + key);\n const listener = props[listenerName];\n if (listener) {\n this.propEventSubscriptions[key] = this.on(key, listener);\n }\n }\n this.prevMotionValues = updateMotionValuesFromProps(this, this.scrapeMotionValuesFromProps(props, this.prevProps || {}, this), this.prevMotionValues);\n if (this.handleChildMotionValue) {\n this.handleChildMotionValue();\n }\n }\n getProps() {\n return this.props;\n }\n /**\n * Returns the variant definition with a given name.\n */\n getVariant(name) {\n return this.props.variants ? this.props.variants[name] : undefined;\n }\n /**\n * Returns the defined default transition on this component.\n */\n getDefaultTransition() {\n return this.props.transition;\n }\n getTransformPagePoint() {\n return this.props.transformPagePoint;\n }\n getClosestVariantNode() {\n return this.isVariantNode\n ? this\n : this.parent\n ? this.parent.getClosestVariantNode()\n : undefined;\n }\n /**\n * Add a child visual element to our set of children.\n */\n addVariantChild(child) {\n const closestVariantNode = this.getClosestVariantNode();\n if (closestVariantNode) {\n closestVariantNode.variantChildren &&\n closestVariantNode.variantChildren.add(child);\n return () => closestVariantNode.variantChildren.delete(child);\n }\n }\n /**\n * Add a motion value and bind it to this visual element.\n */\n addValue(key, value) {\n // Remove existing value if it exists\n const existingValue = this.values.get(key);\n if (value !== existingValue) {\n if (existingValue)\n this.removeValue(key);\n this.bindToMotionValue(key, value);\n this.values.set(key, value);\n this.latestValues[key] = value.get();\n }\n }\n /**\n * Remove a motion value and unbind any active subscriptions.\n */\n removeValue(key) {\n this.values.delete(key);\n const unsubscribe = this.valueSubscriptions.get(key);\n if (unsubscribe) {\n unsubscribe();\n this.valueSubscriptions.delete(key);\n }\n delete this.latestValues[key];\n this.removeValueFromRenderState(key, this.renderState);\n }\n /**\n * Check whether we have a motion value for this key\n */\n hasValue(key) {\n return this.values.has(key);\n }\n getValue(key, defaultValue) {\n if (this.props.values && this.props.values[key]) {\n return this.props.values[key];\n }\n let value = this.values.get(key);\n if (value === undefined && defaultValue !== undefined) {\n value = motionValue(defaultValue === null ? undefined : defaultValue, { owner: this });\n this.addValue(key, value);\n }\n return value;\n }\n /**\n * If we're trying to animate to a previously unencountered value,\n * we need to check for it in our state and as a last resort read it\n * directly from the instance (which might have performance implications).\n */\n readValue(key, target) {\n let value = this.latestValues[key] !== undefined || !this.current\n ? this.latestValues[key]\n : this.getBaseTargetFromProps(this.props, key) ??\n this.readValueFromInstance(this.current, key, this.options);\n if (value !== undefined && value !== null) {\n if (typeof value === \"string\" &&\n (isNumericalString(value) || isZeroValueString(value))) {\n // If this is a number read as a string, ie \"0\" or \"200\", convert it to a number\n value = parseFloat(value);\n }\n else if (!findValueType(value) && complex.test(target)) {\n value = getAnimatableNone(key, target);\n }\n this.setBaseTarget(key, isMotionValue(value) ? value.get() : value);\n }\n return isMotionValue(value) ? value.get() : value;\n }\n /**\n * Set the base target to later animate back to. This is currently\n * only hydrated on creation and when we first read a value.\n */\n setBaseTarget(key, value) {\n this.baseTarget[key] = value;\n }\n /**\n * Find the base target for a value thats been removed from all animation\n * props.\n */\n getBaseTarget(key) {\n const { initial } = this.props;\n let valueFromInitial;\n if (typeof initial === \"string\" || typeof initial === \"object\") {\n const variant = resolveVariantFromProps(this.props, initial, this.presenceContext?.custom);\n if (variant) {\n valueFromInitial = variant[key];\n }\n }\n /**\n * If this value still exists in the current initial variant, read that.\n */\n if (initial && valueFromInitial !== undefined) {\n return valueFromInitial;\n }\n /**\n * Alternatively, if this VisualElement config has defined a getBaseTarget\n * so we can read the value from an alternative source, try that.\n */\n const target = this.getBaseTargetFromProps(this.props, key);\n if (target !== undefined && !isMotionValue(target))\n return target;\n /**\n * If the value was initially defined on initial, but it doesn't any more,\n * return undefined. Otherwise return the value as initially read from the DOM.\n */\n return this.initialValues[key] !== undefined &&\n valueFromInitial === undefined\n ? undefined\n : this.baseTarget[key];\n }\n on(eventName, callback) {\n if (!this.events[eventName]) {\n this.events[eventName] = new SubscriptionManager();\n }\n return this.events[eventName].add(callback);\n }\n notify(eventName, ...args) {\n if (this.events[eventName]) {\n this.events[eventName].notify(...args);\n }\n }\n scheduleRenderMicrotask() {\n microtask.render(this.render);\n }\n}\n\nexport { VisualElement, getFeatureDefinitions, setFeatureDefinitions };\n//# sourceMappingURL=VisualElement.mjs.map\n","import { getValueAsType } from '../../../value/types/utils/get-as-type.mjs';\nimport { numberValueTypes } from '../../../value/types/maps/number.mjs';\nimport { transformPropOrder } from '../../utils/keys-transform.mjs';\n\nconst translateAlias = {\n x: \"translateX\",\n y: \"translateY\",\n z: \"translateZ\",\n transformPerspective: \"perspective\",\n};\nconst numTransforms = transformPropOrder.length;\n/**\n * Build a CSS transform style from individual x/y/scale etc properties.\n *\n * This outputs with a default order of transforms/scales/rotations, this can be customised by\n * providing a transformTemplate function.\n */\nfunction buildTransform(latestValues, transform, transformTemplate) {\n // The transform string we're going to build into.\n let transformString = \"\";\n let transformIsDefault = true;\n /**\n * Loop over all possible transforms in order, adding the ones that\n * are present to the transform string.\n */\n for (let i = 0; i < numTransforms; i++) {\n const key = transformPropOrder[i];\n const value = latestValues[key];\n if (value === undefined)\n continue;\n let valueIsDefault = true;\n if (typeof value === \"number\") {\n valueIsDefault = value === (key.startsWith(\"scale\") ? 1 : 0);\n }\n else {\n const parsed = parseFloat(value);\n valueIsDefault = key.startsWith(\"scale\") ? parsed === 1 : parsed === 0;\n }\n if (!valueIsDefault || transformTemplate) {\n const valueAsType = getValueAsType(value, numberValueTypes[key]);\n if (!valueIsDefault) {\n transformIsDefault = false;\n const transformName = translateAlias[key] || key;\n transformString += `${transformName}(${valueAsType}) `;\n }\n if (transformTemplate) {\n transform[key] = valueAsType;\n }\n }\n }\n // `pathRotation` composes onto `rotate` as a separate additive term so\n // the user's `rotate` is never clobbered. Deliberately not a slot in\n // `transformPropOrder`.\n const pathRotation = latestValues.pathRotation;\n if (pathRotation) {\n transformIsDefault = false;\n transformString += `rotate(${getValueAsType(pathRotation, numberValueTypes.pathRotation)}) `;\n }\n transformString = transformString.trim();\n // If we have a custom `transform` template, pass our transform values and\n // generated transformString to that before returning\n if (transformTemplate) {\n transformString = transformTemplate(transform, transformIsDefault ? \"\" : transformString);\n }\n else if (transformIsDefault) {\n transformString = \"none\";\n }\n return transformString;\n}\n\nexport { buildTransform };\n//# sourceMappingURL=build-transform.mjs.map\n","import { getValueAsType } from '../../../value/types/utils/get-as-type.mjs';\nimport { numberValueTypes } from '../../../value/types/maps/number.mjs';\nimport { transformProps } from '../../utils/keys-transform.mjs';\nimport { isCSSVariableName } from '../../../animation/utils/is-css-variable.mjs';\nimport { buildTransform } from './build-transform.mjs';\n\nfunction buildHTMLStyles(state, latestValues, transformTemplate) {\n const { style, vars, transformOrigin } = state;\n // Track whether we encounter any transform or transformOrigin values.\n let hasTransform = false;\n let hasTransformOrigin = false;\n /**\n * Loop over all our latest animated values and decide whether to handle them\n * as a style or CSS variable.\n *\n * Transforms and transform origins are kept separately for further processing.\n */\n for (const key in latestValues) {\n const value = latestValues[key];\n if (transformProps.has(key)) {\n // If this is a transform, flag to enable further transform processing\n hasTransform = true;\n continue;\n }\n else if (isCSSVariableName(key)) {\n vars[key] = value;\n continue;\n }\n else {\n // Convert the value to its default value type, ie 0 -> \"0px\"\n const valueAsType = getValueAsType(value, numberValueTypes[key]);\n if (key.startsWith(\"origin\")) {\n // If this is a transform origin, flag and enable further transform-origin processing\n hasTransformOrigin = true;\n transformOrigin[key] =\n valueAsType;\n }\n else {\n style[key] = valueAsType;\n }\n }\n }\n if (!latestValues.transform) {\n if (hasTransform || transformTemplate) {\n style.transform = buildTransform(latestValues, state.transform, transformTemplate);\n }\n else if (style.transform) {\n /**\n * If we have previously created a transform but currently don't have any,\n * reset transform style to none.\n */\n style.transform = \"none\";\n }\n }\n /**\n * Build a transformOrigin style. Uses the same defaults as the browser for\n * undefined origins.\n */\n if (hasTransformOrigin) {\n const { originX = \"50%\", originY = \"50%\", originZ = 0, } = transformOrigin;\n style.transformOrigin = `${originX} ${originY} ${originZ}`;\n }\n}\n\nexport { buildHTMLStyles };\n//# sourceMappingURL=build-styles.mjs.map\n","import { px } from '../../value/types/numbers/units.mjs';\n\nfunction pixelsToPercent(pixels, axis) {\n if (axis.max === axis.min)\n return 0;\n return (pixels / (axis.max - axis.min)) * 100;\n}\n/**\n * We always correct borderRadius as a percentage rather than pixels to reduce paints.\n * For example, if you are projecting a box that is 100px wide with a 10px borderRadius\n * into a box that is 200px wide with a 20px borderRadius, that is actually a 10%\n * borderRadius in both states. If we animate between the two in pixels that will trigger\n * a paint each time. If we animate between the two in percentage we'll avoid a paint.\n */\nconst correctBorderRadius = {\n correct: (latest, node) => {\n if (!node.target)\n return latest;\n /**\n * If latest is a string, if it's a percentage we can return immediately as it's\n * going to be stretched appropriately. Otherwise, if it's a pixel, convert it to a number.\n */\n if (typeof latest === \"string\") {\n if (px.test(latest)) {\n latest = parseFloat(latest);\n }\n else {\n return latest;\n }\n }\n /**\n * If latest is a number, it's a pixel value. We use the current viewportBox to calculate that\n * pixel value as a percentage of each axis\n */\n const x = pixelsToPercent(latest, node.target.x);\n const y = pixelsToPercent(latest, node.target.y);\n return `${x}% ${y}%`;\n },\n};\n\nexport { correctBorderRadius, pixelsToPercent };\n//# sourceMappingURL=scale-border-radius.mjs.map\n","import { complex } from '../../value/types/complex/index.mjs';\nimport { mixNumber } from '../../utils/mix/number.mjs';\n\nconst correctBoxShadow = {\n correct: (latest, { treeScale, projectionDelta }) => {\n const original = latest;\n const shadow = complex.parse(latest);\n // TODO: Doesn't support multiple shadows\n if (shadow.length > 5)\n return original;\n const template = complex.createTransformer(latest);\n const offset = typeof shadow[0] !== \"number\" ? 1 : 0;\n // Calculate the overall context scale\n const xScale = projectionDelta.x.scale * treeScale.x;\n const yScale = projectionDelta.y.scale * treeScale.y;\n shadow[0 + offset] /= xScale;\n shadow[1 + offset] /= yScale;\n /**\n * Ideally we'd correct x and y scales individually, but because blur and\n * spread apply to both we have to take a scale average and apply that instead.\n * We could potentially improve the outcome of this by incorporating the ratio between\n * the two scales.\n */\n const averageScale = mixNumber(xScale, yScale, 0.5);\n // Blur\n if (typeof shadow[2 + offset] === \"number\")\n shadow[2 + offset] /= averageScale;\n // Spread\n if (typeof shadow[3 + offset] === \"number\")\n shadow[3 + offset] /= averageScale;\n return template(shadow);\n },\n};\n\nexport { correctBoxShadow };\n//# sourceMappingURL=scale-box-shadow.mjs.map\n","/*\n Value in range from progress\n\n Given a lower limit and an upper limit, we return the value within\n that range as expressed by progress (usually a number from 0 to 1)\n\n So progress = 0.5 would change\n\n from -------- to\n\n to\n\n from ---- to\n\n E.g. from = 10, to = 20, progress = 0.5 => 15\n\n @param [number]: Lower limit of range\n @param [number]: Upper limit of range\n @param [number]: The progress between lower and upper limits expressed 0-1\n @return [number]: Value as calculated from progress within range (not limited within range)\n*/\nconst mixNumber = (from, to, progress) => {\n return from + (to - from) * progress;\n};\n\nexport { mixNumber };\n//# sourceMappingURL=number.mjs.map\n","import { isCSSVariableName } from '../../animation/utils/is-css-variable.mjs';\nimport { cornerRadiusProps } from '../../utils/border-radius.mjs';\nimport { correctBorderRadius } from './scale-border-radius.mjs';\nimport { correctBoxShadow } from './scale-box-shadow.mjs';\n\nconst scaleCorrectors = {\n borderRadius: {\n ...correctBorderRadius,\n applyTo: [...cornerRadiusProps],\n },\n borderTopLeftRadius: correctBorderRadius,\n borderTopRightRadius: correctBorderRadius,\n borderBottomLeftRadius: correctBorderRadius,\n borderBottomRightRadius: correctBorderRadius,\n boxShadow: correctBoxShadow,\n};\nfunction addScaleCorrector(correctors) {\n for (const key in correctors) {\n scaleCorrectors[key] = correctors[key];\n if (isCSSVariableName(key)) {\n scaleCorrectors[key].isCSSVariable = true;\n }\n }\n}\n\nexport { addScaleCorrector, scaleCorrectors };\n//# sourceMappingURL=scale-correction.mjs.map\n","/**\n * The four corner-radius longhands. Shared so the projection mixer, scale\n * corrector, WAAPI px-value set and view-transition crop pass don't each carry\n * their own copy. Order is irrelevant - every consumer mixes/corrects/animates\n * each corner independently.\n */\nconst cornerRadiusProps = [\n \"borderTopLeftRadius\",\n \"borderTopRightRadius\",\n \"borderBottomRightRadius\",\n \"borderBottomLeftRadius\",\n];\n\nexport { cornerRadiusProps };\n//# sourceMappingURL=border-radius.mjs.map\n","import { transformProps } from './keys-transform.mjs';\nimport { scaleCorrectors } from '../../projection/styles/scale-correction.mjs';\nexport { addScaleCorrector } from '../../projection/styles/scale-correction.mjs';\n\nfunction isForcedMotionValue(key, { layout, layoutId }) {\n return (transformProps.has(key) ||\n key.startsWith(\"origin\") ||\n ((layout || layoutId !== undefined) &&\n (!!scaleCorrectors[key] || key === \"opacity\")));\n}\n\nexport { isForcedMotionValue, scaleCorrectors };\n//# sourceMappingURL=is-forced-motion-value.mjs.map\n","import { isMotionValue } from '../../../value/utils/is-motion-value.mjs';\nimport { isForcedMotionValue } from '../../utils/is-forced-motion-value.mjs';\n\nfunction scrapeMotionValuesFromProps(props, prevProps, visualElement) {\n const style = props.style;\n const prevStyle = prevProps?.style;\n const newValues = {};\n if (!style)\n return newValues;\n for (const key in style) {\n if (isMotionValue(style[key]) ||\n (prevStyle && isMotionValue(prevStyle[key])) ||\n isForcedMotionValue(key, props) ||\n visualElement?.getValue(key)?.liveStyle !== undefined) {\n newValues[key] = style[key];\n }\n }\n return newValues;\n}\n\nexport { scrapeMotionValuesFromProps };\n//# sourceMappingURL=scrape-motion-values.mjs.map\n","const dashKeys = {\n offset: \"stroke-dashoffset\",\n array: \"stroke-dasharray\",\n};\nconst camelKeys = {\n offset: \"strokeDashoffset\",\n array: \"strokeDasharray\",\n};\n/**\n * Build SVG path properties. Uses the path's measured length to convert\n * our custom pathLength, pathSpacing and pathOffset into stroke-dashoffset\n * and stroke-dasharray attributes.\n *\n * This function is mutative to reduce per-frame GC.\n *\n * Note: We use unitless values for stroke-dasharray and stroke-dashoffset\n * because Safari incorrectly scales px values when the page is zoomed.\n */\nfunction buildSVGPath(attrs, length, spacing = 1, offset = 0, useDashCase = true) {\n // Normalise path length by setting SVG attribute pathLength to 1\n attrs.pathLength = 1;\n // We use dash case when setting attributes directly to the DOM node and camel case\n // when defining props on a React component.\n const keys = useDashCase ? dashKeys : camelKeys;\n // Build the dash offset (unitless to avoid Safari zoom bug)\n attrs[keys.offset] = `${-offset}`;\n // Build the dash array (unitless to avoid Safari zoom bug)\n attrs[keys.array] = `${length} ${spacing}`;\n}\n\nexport { buildSVGPath };\n//# sourceMappingURL=path.mjs.map\n","import { buildHTMLStyles } from '../../html/utils/build-styles.mjs';\nimport { buildSVGPath } from './path.mjs';\n\nconst cssStyleProperties = [\n \"transform\",\n \"opacity\",\n \"offsetDistance\",\n \"offsetPath\",\n \"offsetRotate\",\n \"offsetAnchor\",\n];\n/**\n * Build SVG visual attributes, like cx and style.transform\n */\nfunction buildSVGAttrs(state, { attrX, attrY, attrScale, pathLength, pathSpacing = 1, pathOffset = 0, \n// This is object creation, which we try to avoid per-frame.\n...latest }, isSVGTag, transformTemplate, styleProp) {\n buildHTMLStyles(state, latest, transformTemplate);\n /**\n * For svg tags we just want to make sure viewBox is animatable and treat all the styles\n * as normal HTML tags.\n */\n if (isSVGTag) {\n if (state.style.viewBox) {\n state.attrs.viewBox = state.style.viewBox;\n }\n return;\n }\n state.attrs = state.style;\n state.style = {};\n const { attrs, style } = state;\n for (const key of cssStyleProperties) {\n if (attrs[key] !== undefined) {\n style[key] = attrs[key];\n delete attrs[key];\n }\n }\n if (style.transform || attrs.transformOrigin) {\n style.transformOrigin = attrs.transformOrigin ?? \"50% 50%\";\n delete attrs.transformOrigin;\n }\n if (style.transform) {\n /**\n * SVG's element transform-origin uses its own median as a reference.\n * Therefore, transformBox becomes a fill-box\n */\n style.transformBox = styleProp?.transformBox ?? \"fill-box\";\n delete attrs.transformBox;\n }\n // Render attrX/attrY/attrScale as attributes\n if (attrX !== undefined)\n attrs.x = attrX;\n if (attrY !== undefined)\n attrs.y = attrY;\n if (attrScale !== undefined)\n attrs.scale = attrScale;\n // Build SVG path if one has been defined\n if (pathLength !== undefined) {\n buildSVGPath(attrs, pathLength, pathSpacing, pathOffset, false);\n }\n}\n\nexport { buildSVGAttrs, cssStyleProperties };\n//# sourceMappingURL=build-attrs.mjs.map\n","import { isMotionValue } from './is-motion-value.mjs';\n\n/**\n * If the provided value is a MotionValue, this returns the actual value, otherwise just the value itself\n */\nfunction resolveMotionValue(value) {\n return isMotionValue(value) ? value.get() : value;\n}\n\nexport { resolveMotionValue };\n//# sourceMappingURL=resolve-motion-value.mjs.map\n","\"use client\";\nimport { useContext, useMemo } from \"react\";\nimport { MotionContext } from \".\";\nimport { getCurrentTreeVariants } from \"./utils\";\nexport function useCreateMotionContext(props) {\n const { initial, animate } = getCurrentTreeVariants(props, useContext(MotionContext));\n return useMemo(() => ({ initial, animate }), [variantLabelsAsDependency(initial), variantLabelsAsDependency(animate)]);\n}\nfunction variantLabelsAsDependency(prop) {\n return Array.isArray(prop) ? prop.join(\" \") : prop;\n}\n//# sourceMappingURL=create.js.map","import { isControllingVariants, isVariantLabel } from \"motion-dom\";\nexport function getCurrentTreeVariants(props, context) {\n if (isControllingVariants(props)) {\n const { initial, animate } = props;\n return {\n initial: initial === false || isVariantLabel(initial)\n ? initial\n : undefined,\n animate: isVariantLabel(animate) ? animate : undefined,\n };\n }\n return props.inherit !== false ? context : {};\n}\n//# sourceMappingURL=utils.js.map","export const createHtmlRenderState = () => ({\n style: {},\n transform: {},\n transformOrigin: {},\n vars: {},\n});\n//# sourceMappingURL=create-render-state.js.map","\"use client\";\nimport { buildHTMLStyles, isForcedMotionValue, isMotionValue } from \"motion-dom\";\nimport { useMemo } from \"react\";\nimport { createHtmlRenderState } from \"./utils/create-render-state\";\nexport function copyRawValuesOnly(target, source, props) {\n for (const key in source) {\n if (!isMotionValue(source[key]) && !isForcedMotionValue(key, props)) {\n target[key] = source[key];\n }\n }\n}\nfunction useInitialMotionValues({ transformTemplate }, visualState) {\n return useMemo(() => {\n const state = createHtmlRenderState();\n buildHTMLStyles(state, visualState, transformTemplate);\n return Object.assign({}, state.vars, state.style);\n }, [visualState]);\n}\nfunction useStyle(props, visualState) {\n const styleProp = props.style || {};\n const style = {};\n /**\n * Copy non-Motion Values straight into style\n */\n copyRawValuesOnly(style, styleProp, props);\n Object.assign(style, useInitialMotionValues(props, visualState));\n return style;\n}\nexport function useHTMLProps(props, visualState) {\n // The `any` isn't ideal but it is the type of createElement props argument\n const htmlProps = {};\n const style = useStyle(props, visualState);\n if (props.drag && props.dragListener !== false) {\n // Disable the ghost element when a user drags\n htmlProps.draggable = false;\n // Disable text selection\n style.userSelect =\n style.WebkitUserSelect =\n style.WebkitTouchCallout =\n \"none\";\n // Disable scrolling on the draggable direction\n style.touchAction =\n props.drag === true\n ? \"none\"\n : `pan-${props.drag === \"x\" ? \"y\" : \"x\"}`;\n }\n if (props.tabIndex === undefined &&\n (props.onTap || props.onTapStart || props.whileTap)) {\n htmlProps.tabIndex = 0;\n }\n htmlProps.style = style;\n return htmlProps;\n}\n//# sourceMappingURL=use-props.js.map","import { createHtmlRenderState } from \"../../html/utils/create-render-state\";\nexport const createSvgRenderState = () => ({\n ...createHtmlRenderState(),\n attrs: {},\n});\n//# sourceMappingURL=create-render-state.js.map","\"use client\";\nimport { buildSVGAttrs, isSVGTag } from \"motion-dom\";\nimport { useMemo } from \"react\";\nimport { copyRawValuesOnly } from \"../html/use-props\";\nimport { createSvgRenderState } from \"./utils/create-render-state\";\nexport function useSVGProps(props, visualState, _isStatic, Component) {\n const visualProps = useMemo(() => {\n const state = createSvgRenderState();\n buildSVGAttrs(state, visualState, isSVGTag(Component), props.transformTemplate, props.style);\n return {\n ...state.attrs,\n style: { ...state.style },\n };\n }, [visualState]);\n if (props.style) {\n const rawStyles = {};\n copyRawValuesOnly(rawStyles, props.style, props);\n visualProps.style = { ...rawStyles, ...visualProps.style };\n }\n return visualProps;\n}\n//# sourceMappingURL=use-props.js.map","const isSVGTag = (tag) => typeof tag === \"string\" && tag.toLowerCase() === \"svg\";\n\nexport { isSVGTag };\n//# sourceMappingURL=is-svg-tag.mjs.map\n","/**\n * A list of all valid MotionProps.\n *\n * @privateRemarks\n * This doesn't throw if a `MotionProp` name is missing - it should.\n */\nconst validMotionProps = new Set([\n \"animate\",\n \"exit\",\n \"variants\",\n \"initial\",\n \"style\",\n \"values\",\n \"variants\",\n \"transition\",\n \"transformTemplate\",\n \"custom\",\n \"inherit\",\n \"onBeforeLayoutMeasure\",\n \"onAnimationStart\",\n \"onAnimationComplete\",\n \"onUpdate\",\n \"onDragStart\",\n \"onDrag\",\n \"onDragEnd\",\n \"onMeasureDragConstraints\",\n \"onDirectionLock\",\n \"onDragTransitionEnd\",\n \"_dragX\",\n \"_dragY\",\n \"onHoverStart\",\n \"onHoverEnd\",\n \"onViewportEnter\",\n \"onViewportLeave\",\n \"globalTapTarget\",\n \"propagate\",\n \"ignoreStrict\",\n \"viewport\",\n]);\n/**\n * Check whether a prop name is a valid `MotionProp` key.\n *\n * @param key - Name of the property to check\n * @returns `true` is key is a valid `MotionProp`.\n *\n * @public\n */\nexport function isValidMotionProp(key) {\n return (key.startsWith(\"while\") ||\n (key.startsWith(\"drag\") && key !== \"draggable\") ||\n key.startsWith(\"layout\") ||\n key.startsWith(\"onTap\") ||\n key.startsWith(\"onPan\") ||\n key.startsWith(\"onLayout\") ||\n validMotionProps.has(key));\n}\n//# sourceMappingURL=valid-prop.js.map","import { isMotionValue } from \"motion-dom\";\nimport { isValidMotionProp } from \"../../../motion/utils/valid-prop\";\nfunction shouldForward(key, isValidProp) {\n return key.startsWith(\"on\")\n ? !isValidMotionProp(key)\n : isValidProp?.(key) ?? !isValidMotionProp(key);\n}\nexport function filterProps(props, isDom, forwardMotionProps, isValidProp) {\n const filteredProps = {};\n for (const key in props) {\n /**\n * values is considered a valid prop by Emotion, so if it's present\n * this will be rendered out to the DOM unless explicitly filtered.\n *\n * We check the type as it could be used with the `feColorMatrix`\n * element, which we support.\n */\n if (key === \"values\" && typeof props.values === \"object\")\n continue;\n if (isMotionValue(props[key]))\n continue;\n if (shouldForward(key, isValidProp) ||\n (forwardMotionProps === true && isValidMotionProp(key)) ||\n (!isDom && !isValidMotionProp(key)) ||\n // If trying to use native HTML drag events, forward drag listeners\n (props[\"draggable\"] &&\n key.startsWith(\"onDrag\"))) {\n filteredProps[key] =\n props[key];\n }\n }\n return filteredProps;\n}\n//# sourceMappingURL=filter-props.js.map","/**\n * We keep these listed separately as we use the lowercase tag names as part\n * of the runtime bundle to detect SVG components\n */\nexport const lowercaseSVGElements = [\n \"animate\",\n \"circle\",\n \"defs\",\n \"desc\",\n \"ellipse\",\n \"g\",\n \"image\",\n \"line\",\n \"filter\",\n \"marker\",\n \"mask\",\n \"metadata\",\n \"path\",\n \"pattern\",\n \"polygon\",\n \"polyline\",\n \"rect\",\n \"stop\",\n \"switch\",\n \"symbol\",\n \"svg\",\n \"text\",\n \"tspan\",\n \"use\",\n \"view\",\n];\n//# sourceMappingURL=lowercase-elements.js.map","import { lowercaseSVGElements } from \"../../svg/lowercase-elements\";\nexport function isSVGComponent(Component) {\n if (\n /**\n * If it's not a string, it's a custom React component. Currently we only support\n * HTML custom React components.\n */\n typeof Component !== \"string\" ||\n /**\n * If it contains a dash, the element is a custom HTML webcomponent.\n */\n Component.includes(\"-\")) {\n return false;\n }\n else if (\n /**\n * If it's in our list of lowercase SVG tags, it's an SVG component\n */\n lowercaseSVGElements.indexOf(Component) > -1 ||\n /**\n * If it contains a capital letter, it's an SVG component\n */\n /[A-Z]/u.test(Component)) {\n return true;\n }\n return false;\n}\n//# sourceMappingURL=is-svg-component.js.map","\"use client\";\nimport { isMotionValue } from \"motion-dom\";\nimport { Fragment, createElement, useMemo } from \"react\";\nimport { useHTMLProps } from \"../html/use-props\";\nimport { useSVGProps } from \"../svg/use-props\";\nimport { filterProps } from \"./utils/filter-props\";\nimport { isSVGComponent } from \"./utils/is-svg-component\";\nexport function useRender(Component, props, ref, { latestValues, }, isStatic, forwardMotionProps = false, isSVG, isValidProp) {\n const useVisualProps = (isSVG ?? isSVGComponent(Component)) ? useSVGProps : useHTMLProps;\n const visualProps = useVisualProps(props, latestValues, isStatic, Component);\n const filteredProps = filterProps(props, typeof Component === \"string\", forwardMotionProps, isValidProp);\n const elementProps = Component !== Fragment ? { ...filteredProps, ...visualProps, ref } : {};\n /**\n * If component has been handed a motion value as its child,\n * memoise its initial value and render that. Subsequent updates\n * will be handled by the onChange handler\n */\n const { children } = props;\n const renderedChildren = useMemo(() => (isMotionValue(children) ? children.get() : children), [children]);\n return createElement(Component, {\n ...elementProps,\n children: renderedChildren,\n });\n}\n//# sourceMappingURL=use-render.js.map","\"use client\";\nimport { createContext } from \"react\";\n/**\n * @public\n */\nexport const PresenceContext = \n/* @__PURE__ */ createContext(null);\n//# sourceMappingURL=PresenceContext.js.map","\"use client\";\nimport { isAnimationControls, isControllingVariants as checkIsControllingVariants, isVariantNode as checkIsVariantNode, resolveVariantFromProps, } from \"motion-dom\";\nimport { useContext } from \"react\";\nimport { MotionContext } from \"../../context/MotionContext\";\nimport { PresenceContext, } from \"../../context/PresenceContext\";\nimport { useConstant } from \"../../utils/use-constant\";\nimport { resolveMotionValue } from \"motion-dom\";\nfunction makeState({ scrapeMotionValuesFromProps, createRenderState, }, props, context, presenceContext) {\n const state = {\n latestValues: makeLatestValues(props, context, presenceContext, scrapeMotionValuesFromProps),\n renderState: createRenderState(),\n };\n return state;\n}\nfunction makeLatestValues(props, context, presenceContext, scrapeMotionValues) {\n const values = {};\n const motionValues = scrapeMotionValues(props, {});\n for (const key in motionValues) {\n values[key] = resolveMotionValue(motionValues[key]);\n }\n let { initial, animate } = props;\n const isControllingVariants = checkIsControllingVariants(props);\n const isVariantNode = checkIsVariantNode(props);\n if (context &&\n isVariantNode &&\n !isControllingVariants &&\n props.inherit !== false) {\n if (initial === undefined)\n initial = context.initial;\n if (animate === undefined)\n animate = context.animate;\n }\n let isInitialAnimationBlocked = presenceContext\n ? presenceContext.initial === false\n : false;\n isInitialAnimationBlocked = isInitialAnimationBlocked || initial === false;\n const variantToSet = isInitialAnimationBlocked ? animate : initial;\n if (variantToSet &&\n typeof variantToSet !== \"boolean\" &&\n !isAnimationControls(variantToSet)) {\n const list = Array.isArray(variantToSet) ? variantToSet : [variantToSet];\n for (let i = 0; i < list.length; i++) {\n const resolved = resolveVariantFromProps(props, list[i]);\n if (resolved) {\n const { transitionEnd, transition, ...target } = resolved;\n for (const key in target) {\n let valueTarget = target[key];\n if (Array.isArray(valueTarget)) {\n /**\n * Take final keyframe if the initial animation is blocked because\n * we want to initialise at the end of that blocked animation.\n */\n const index = isInitialAnimationBlocked\n ? valueTarget.length - 1\n : 0;\n valueTarget = valueTarget[index];\n }\n if (valueTarget !== null) {\n values[key] = valueTarget;\n }\n }\n for (const key in transitionEnd) {\n values[key] = transitionEnd[key];\n }\n }\n }\n }\n return values;\n}\nexport const makeUseVisualState = (config) => (props, isStatic) => {\n const context = useContext(MotionContext);\n const presenceContext = useContext(PresenceContext);\n const make = () => makeState(config, props, context, presenceContext);\n return isStatic ? make() : useConstant(make);\n};\n//# sourceMappingURL=use-visual-state.js.map","\"use client\";\nimport { useRef } from \"react\";\n/**\n * Creates a constant value over the lifecycle of a component.\n *\n * Even if `useMemo` is provided an empty array as its final argument, it doesn't offer\n * a guarantee that it won't re-run for performance reasons later on. By using `useConstant`\n * you can ensure that initialisers don't execute twice or more.\n */\nexport function useConstant(init) {\n const ref = useRef(null);\n if (ref.current === null) {\n ref.current = init();\n }\n return ref.current;\n}\n//# sourceMappingURL=use-constant.js.map","\"use client\";\nimport { scrapeHTMLMotionValuesFromProps } from \"motion-dom\";\nimport { makeUseVisualState } from \"../../motion/utils/use-visual-state\";\nimport { createHtmlRenderState } from \"./utils/create-render-state\";\nexport const useHTMLVisualState = /*@__PURE__*/ makeUseVisualState({\n scrapeMotionValuesFromProps: scrapeHTMLMotionValuesFromProps,\n createRenderState: createHtmlRenderState,\n});\n//# sourceMappingURL=use-html-visual-state.js.map","\"use client\";\nimport { scrapeSVGMotionValuesFromProps } from \"motion-dom\";\nimport { makeUseVisualState } from \"../../motion/utils/use-visual-state\";\nimport { createSvgRenderState } from \"./utils/create-render-state\";\nexport const useSVGVisualState = /*@__PURE__*/ makeUseVisualState({\n scrapeMotionValuesFromProps: scrapeSVGMotionValuesFromProps,\n createRenderState: createSvgRenderState,\n});\n//# sourceMappingURL=use-svg-visual-state.js.map","import { isMotionValue } from '../../../value/utils/is-motion-value.mjs';\nimport { transformPropOrder } from '../../utils/keys-transform.mjs';\nimport { scrapeMotionValuesFromProps as scrapeMotionValuesFromProps$1 } from '../../html/utils/scrape-motion-values.mjs';\n\nfunction scrapeMotionValuesFromProps(props, prevProps, visualElement) {\n const newValues = scrapeMotionValuesFromProps$1(props, prevProps, visualElement);\n for (const key in props) {\n if (isMotionValue(props[key]) ||\n isMotionValue(prevProps[key])) {\n const targetKey = transformPropOrder.indexOf(key) !== -1\n ? \"attr\" + key.charAt(0).toUpperCase() + key.substring(1)\n : key;\n newValues[targetKey] = props[key];\n }\n }\n return newValues;\n}\n\nexport { scrapeMotionValuesFromProps };\n//# sourceMappingURL=scrape-motion-values.mjs.map\n","import { getFeatureDefinitions, setFeatureDefinitions } from \"motion-dom\";\nconst featureProps = {\n animation: [\n \"animate\",\n \"variants\",\n \"whileHover\",\n \"whileTap\",\n \"exit\",\n \"whileInView\",\n \"whileFocus\",\n \"whileDrag\",\n ],\n exit: [\"exit\"],\n drag: [\"drag\", \"dragControls\"],\n focus: [\"whileFocus\"],\n hover: [\"whileHover\", \"onHoverStart\", \"onHoverEnd\"],\n tap: [\"whileTap\", \"onTap\", \"onTapStart\", \"onTapCancel\"],\n pan: [\"onPan\", \"onPanStart\", \"onPanSessionStart\", \"onPanEnd\"],\n inView: [\"whileInView\", \"onViewportEnter\", \"onViewportLeave\"],\n layout: [\"layout\", \"layoutId\"],\n};\nlet isInitialized = false;\n/**\n * Initialize feature definitions with isEnabled checks.\n * This must be called before any motion components are rendered.\n */\nexport function initFeatureDefinitions() {\n if (isInitialized)\n return;\n const initialFeatureDefinitions = {};\n for (const key in featureProps) {\n initialFeatureDefinitions[key] = {\n isEnabled: (props) => featureProps[key].some((name) => !!props[name]),\n };\n }\n setFeatureDefinitions(initialFeatureDefinitions);\n isInitialized = true;\n}\n/**\n * Get the current feature definitions, initializing if needed.\n */\nexport function getInitializedFeatureDefinitions() {\n initFeatureDefinitions();\n return getFeatureDefinitions();\n}\n//# sourceMappingURL=definitions.js.map","export const motionComponentSymbol = Symbol.for(\"motionComponentSymbol\");\n//# sourceMappingURL=symbol.js.map","\"use client\";\nimport { useCallback, useInsertionEffect, useRef } from \"react\";\n/**\n * Creates a ref function that, when called, hydrates the provided\n * external ref and VisualElement.\n */\nexport function useMotionRef(visualState, visualElement, externalRef) {\n /**\n * Store externalRef in a ref to avoid including it in the useCallback\n * dependency array. Including externalRef in dependencies causes issues\n * with libraries like Radix UI that create new callback refs on each render\n * when using asChild - this would cause the callback to be recreated,\n * triggering element remounts and breaking AnimatePresence exit animations.\n */\n const externalRefContainer = useRef(externalRef);\n useInsertionEffect(() => {\n externalRefContainer.current = externalRef;\n });\n // Store cleanup function returned by callback refs (React 19 feature)\n const refCleanup = useRef(null);\n return useCallback((instance) => {\n if (instance) {\n visualState.onMount?.(instance);\n }\n if (visualElement) {\n instance ? visualElement.mount(instance) : visualElement.unmount();\n }\n const ref = externalRefContainer.current;\n if (typeof ref === \"function\") {\n if (instance) {\n const cleanup = ref(instance);\n if (typeof cleanup === \"function\") {\n refCleanup.current = cleanup;\n }\n }\n else if (refCleanup.current) {\n refCleanup.current();\n refCleanup.current = null;\n }\n else {\n ref(instance);\n }\n }\n else if (ref) {\n ;\n ref.current = instance;\n }\n }, [visualElement]);\n}\n//# sourceMappingURL=use-motion-ref.js.map","\"use client\";\nimport { createContext } from \"react\";\n/**\n * Internal, exported only for usage in Framer\n */\nexport const SwitchLayoutGroupContext = createContext({});\n//# sourceMappingURL=SwitchLayoutGroupContext.js.map","export function isRefObject(ref) {\n return (ref &&\n typeof ref === \"object\" &&\n Object.prototype.hasOwnProperty.call(ref, \"current\"));\n}\n//# sourceMappingURL=is-ref-object.js.map","export const isBrowser = typeof window !== \"undefined\";\n//# sourceMappingURL=is-browser.js.map","\"use client\";\nimport { useEffect, useLayoutEffect } from \"react\";\nimport { isBrowser } from \"./is-browser\";\nexport const useIsomorphicLayoutEffect = isBrowser ? useLayoutEffect : useEffect;\n//# sourceMappingURL=use-isomorphic-effect.js.map","\"use client\";\nimport { optimizedAppearDataAttribute, } from \"motion-dom\";\nimport { useContext, useEffect, useInsertionEffect, useRef } from \"react\";\nimport { LazyContext } from \"../../context/LazyContext\";\nimport { MotionConfigContext } from \"../../context/MotionConfigContext\";\nimport { MotionContext } from \"../../context/MotionContext\";\nimport { PresenceContext } from \"../../context/PresenceContext\";\nimport { SwitchLayoutGroupContext, } from \"../../context/SwitchLayoutGroupContext\";\nimport { isRefObject } from \"../../utils/is-ref-object\";\nimport { useIsomorphicLayoutEffect } from \"../../utils/use-isomorphic-effect\";\nexport function useVisualElement(Component, visualState, props, createVisualElement, ProjectionNodeConstructor, isSVG) {\n const { visualElement: parent } = useContext(MotionContext);\n const lazyContext = useContext(LazyContext);\n const presenceContext = useContext(PresenceContext);\n const motionConfig = useContext(MotionConfigContext);\n const reducedMotionConfig = motionConfig.reducedMotion;\n const skipAnimations = motionConfig.skipAnimations;\n const visualElementRef = useRef(null);\n /**\n * Track whether the component has been through React's commit phase.\n * Used to detect when LazyMotion features load after the component has mounted.\n */\n const hasMountedOnce = useRef(false);\n /**\n * If we haven't preloaded a renderer, check to see if we have one lazy-loaded\n */\n createVisualElement =\n createVisualElement ||\n lazyContext.renderer;\n if (!visualElementRef.current && createVisualElement) {\n visualElementRef.current = createVisualElement(Component, {\n visualState,\n parent,\n props,\n presenceContext,\n blockInitialAnimation: presenceContext\n ? presenceContext.initial === false\n : false,\n reducedMotionConfig,\n skipAnimations,\n isSVG,\n });\n /**\n * If the component has already mounted before features loaded (e.g. via\n * LazyMotion with async feature loading), we need to force the initial\n * animation to run. Otherwise state changes that occurred before features\n * loaded will be lost and the element will snap to its final state.\n */\n if (hasMountedOnce.current && visualElementRef.current) {\n visualElementRef.current.manuallyAnimateOnMount = true;\n }\n }\n const visualElement = visualElementRef.current;\n /**\n * Load Motion gesture and animation features. These are rendered as renderless\n * components so each feature can optionally make use of React lifecycle methods.\n */\n const initialLayoutGroupConfig = useContext(SwitchLayoutGroupContext);\n if (visualElement &&\n !visualElement.projection &&\n ProjectionNodeConstructor &&\n (visualElement.type === \"html\" || visualElement.type === \"svg\")) {\n createProjectionNode(visualElementRef.current, props, ProjectionNodeConstructor, initialLayoutGroupConfig);\n }\n const isMounted = useRef(false);\n useInsertionEffect(() => {\n /**\n * Check the component has already mounted before calling\n * `update` unnecessarily. This ensures we skip the initial update.\n */\n if (visualElement && isMounted.current) {\n visualElement.update(props, presenceContext);\n }\n });\n /**\n * Cache this value as we want to know whether HandoffAppearAnimations\n * was present on initial render - it will be deleted after this.\n */\n const optimisedAppearId = props[optimizedAppearDataAttribute];\n const wantsHandoff = useRef(Boolean(optimisedAppearId) &&\n typeof window !== \"undefined\" &&\n !window.MotionHandoffIsComplete?.(optimisedAppearId) &&\n window.MotionHasOptimisedAnimation?.(optimisedAppearId));\n useIsomorphicLayoutEffect(() => {\n /**\n * Track that this component has mounted. This is used to detect when\n * LazyMotion features load after the component has already committed.\n */\n hasMountedOnce.current = true;\n if (!visualElement)\n return;\n isMounted.current = true;\n window.MotionIsMounted = true;\n visualElement.updateFeatures();\n visualElement.scheduleRenderMicrotask();\n /**\n * Ideally this function would always run in a useEffect.\n *\n * However, if we have optimised appear animations to handoff from,\n * it needs to happen synchronously to ensure there's no flash of\n * incorrect styles in the event of a hydration error.\n *\n * So if we detect a situtation where optimised appear animations\n * are running, we use useLayoutEffect to trigger animations.\n */\n if (wantsHandoff.current && visualElement.animationState) {\n visualElement.animationState.animateChanges();\n }\n });\n useEffect(() => {\n if (!visualElement)\n return;\n if (!wantsHandoff.current && visualElement.animationState) {\n visualElement.animationState.animateChanges();\n }\n if (wantsHandoff.current) {\n // This ensures all future calls to animateChanges() in this component will run in useEffect\n queueMicrotask(() => {\n window.MotionHandoffMarkAsComplete?.(optimisedAppearId);\n });\n wantsHandoff.current = false;\n }\n /**\n * Now we've finished triggering animations for this element we\n * can wipe the enteringChildren set for the next render.\n */\n visualElement.enteringChildren = undefined;\n });\n return visualElement;\n}\nfunction createProjectionNode(visualElement, props, ProjectionNodeConstructor, initialPromotionConfig) {\n const { layoutId, layout, drag, dragConstraints, layoutScroll, layoutRoot, layoutAnchor, layoutCrossfade, } = props;\n visualElement.projection = new ProjectionNodeConstructor(visualElement.latestValues, props[\"data-framer-portal-id\"]\n ? undefined\n : getClosestProjectingNode(visualElement.parent));\n visualElement.projection.setOptions({\n layoutId,\n layout,\n alwaysMeasureLayout: Boolean(drag) || (dragConstraints && isRefObject(dragConstraints)),\n visualElement,\n /**\n * TODO: Update options in an effect. This could be tricky as it'll be too late\n * to update by the time layout animations run.\n * We also need to fix this safeToRemove by linking it up to the one returned by usePresence,\n * ensuring it gets called if there's no potential layout animations.\n *\n */\n animationType: typeof layout === \"string\" ? layout : \"both\",\n initialPromotionConfig,\n crossfade: layoutCrossfade,\n layoutScroll,\n layoutRoot,\n layoutAnchor,\n });\n}\nfunction getClosestProjectingNode(visualElement) {\n if (!visualElement)\n return undefined;\n return visualElement.options.allowProjection !== false\n ? visualElement.projection\n : getClosestProjectingNode(visualElement.parent);\n}\n//# sourceMappingURL=use-visual-element.js.map","\"use client\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { invariant, warning } from \"motion-utils\";\nimport { forwardRef, useContext } from \"react\";\nimport { LayoutGroupContext } from \"../context/LayoutGroupContext\";\nimport { LazyContext } from \"../context/LazyContext\";\nimport { MotionConfigContext } from \"../context/MotionConfigContext\";\nimport { MotionContext } from \"../context/MotionContext\";\nimport { useCreateMotionContext } from \"../context/MotionContext/create\";\nimport { useRender } from \"../render/dom/use-render\";\nimport { isSVGComponent } from \"../render/dom/utils/is-svg-component\";\nimport { useHTMLVisualState } from \"../render/html/use-html-visual-state\";\nimport { useSVGVisualState } from \"../render/svg/use-svg-visual-state\";\nimport { getInitializedFeatureDefinitions } from \"./features/definitions\";\nimport { loadFeatures } from \"./features/load-features\";\nimport { motionComponentSymbol } from \"./utils/symbol\";\nimport { useMotionRef } from \"./utils/use-motion-ref\";\nimport { useVisualElement } from \"./utils/use-visual-element\";\n/**\n * Create a `motion` component.\n *\n * This function accepts a Component argument, which can be either a string (ie \"div\"\n * for `motion.div`), or an actual React component.\n *\n * Alongside this is a config option which provides a way of rendering the provided\n * component \"offline\", or outside the React render cycle.\n */\nexport function createMotionComponent(Component, { forwardMotionProps = false, type } = {}, preloadedFeatures, createVisualElement) {\n preloadedFeatures && loadFeatures(preloadedFeatures);\n /**\n * Determine whether to use SVG or HTML rendering based on:\n * 1. Explicit `type` option (highest priority)\n * 2. Auto-detection via `isSVGComponent`\n */\n const isSVG = type ? type === \"svg\" : isSVGComponent(Component);\n const useVisualState = isSVG ? useSVGVisualState : useHTMLVisualState;\n function MotionDOMComponent(props, externalRef) {\n /**\n * If we need to measure the element we load this functionality in a\n * separate class component in order to gain access to getSnapshotBeforeUpdate.\n */\n let MeasureLayout;\n const configAndProps = {\n ...useContext(MotionConfigContext),\n ...props,\n layoutId: useLayoutId(props),\n };\n const { isStatic, isValidProp } = configAndProps;\n const context = useCreateMotionContext(props);\n const visualState = useVisualState(props, isStatic);\n if (!isStatic && typeof window !== \"undefined\") {\n useStrictMode(configAndProps, preloadedFeatures);\n const layoutProjection = getProjectionFunctionality(configAndProps);\n MeasureLayout = layoutProjection.MeasureLayout;\n /**\n * Create a VisualElement for this component. A VisualElement provides a common\n * interface to renderer-specific APIs (ie DOM/Three.js etc) as well as\n * providing a way of rendering to these APIs outside of the React render loop\n * for more performant animations and interactions\n */\n context.visualElement = useVisualElement(Component, visualState, configAndProps, createVisualElement, layoutProjection.ProjectionNode, isSVG);\n }\n /**\n * The mount order and hierarchy is specific to ensure our element ref\n * is hydrated by the time features fire their effects.\n */\n return (_jsxs(MotionContext.Provider, { value: context, children: [MeasureLayout && context.visualElement ? (_jsx(MeasureLayout, { visualElement: context.visualElement, ...configAndProps })) : null, useRender(Component, props, useMotionRef(visualState, context.visualElement, externalRef), visualState, isStatic, forwardMotionProps, isSVG, isValidProp)] }));\n }\n MotionDOMComponent.displayName = `motion.${typeof Component === \"string\"\n ? Component\n : `create(${Component.displayName ?? Component.name ?? \"\"})`}`;\n const ForwardRefMotionComponent = forwardRef(MotionDOMComponent);\n ForwardRefMotionComponent[motionComponentSymbol] = Component;\n return ForwardRefMotionComponent;\n}\nfunction useLayoutId({ layoutId }) {\n const layoutGroupId = useContext(LayoutGroupContext).id;\n return layoutGroupId && layoutId !== undefined\n ? layoutGroupId + \"-\" + layoutId\n : layoutId;\n}\nfunction useStrictMode(configAndProps, preloadedFeatures) {\n const isStrict = useContext(LazyContext).strict;\n /**\n * If we're in development mode, check to make sure we're not rendering a motion component\n * as a child of LazyMotion, as this will break the file-size benefits of using it.\n */\n if (process.env.NODE_ENV !== \"production\" &&\n preloadedFeatures &&\n isStrict) {\n const strictMessage = \"You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.\";\n configAndProps.ignoreStrict\n ? warning(false, strictMessage, \"lazy-strict-mode\")\n : invariant(false, strictMessage, \"lazy-strict-mode\");\n }\n}\nfunction getProjectionFunctionality(props) {\n const featureDefinitions = getInitializedFeatureDefinitions();\n const { drag, layout } = featureDefinitions;\n if (!drag && !layout)\n return {};\n const combined = { ...drag, ...layout };\n return {\n MeasureLayout: drag?.isEnabled(props) || layout?.isEnabled(props)\n ? combined.MeasureLayout\n : undefined,\n ProjectionNode: combined.ProjectionNode,\n };\n}\n//# sourceMappingURL=index.js.map","import { createMotionComponent } from \"../../../motion\";\nexport function createMinimalMotionComponent(Component, options) {\n return createMotionComponent(Component, options);\n}\n//# sourceMappingURL=create.js.map","\"use client\";\nimport { createMinimalMotionComponent } from \"./create\";\n/**\n * HTML components\n */\nexport const MotionA = /*@__PURE__*/ createMinimalMotionComponent(\"a\");\nexport const MotionAbbr = /*@__PURE__*/ createMinimalMotionComponent(\"abbr\");\nexport const MotionAddress = \n/*@__PURE__*/ createMinimalMotionComponent(\"address\");\nexport const MotionArea = /*@__PURE__*/ createMinimalMotionComponent(\"area\");\nexport const MotionArticle = \n/*@__PURE__*/ createMinimalMotionComponent(\"article\");\nexport const MotionAside = /*@__PURE__*/ createMinimalMotionComponent(\"aside\");\nexport const MotionAudio = /*@__PURE__*/ createMinimalMotionComponent(\"audio\");\nexport const MotionB = /*@__PURE__*/ createMinimalMotionComponent(\"b\");\nexport const MotionBase = /*@__PURE__*/ createMinimalMotionComponent(\"base\");\nexport const MotionBdi = /*@__PURE__*/ createMinimalMotionComponent(\"bdi\");\nexport const MotionBdo = /*@__PURE__*/ createMinimalMotionComponent(\"bdo\");\nexport const MotionBig = /*@__PURE__*/ createMinimalMotionComponent(\"big\");\nexport const MotionBlockquote = \n/*@__PURE__*/ createMinimalMotionComponent(\"blockquote\");\nexport const MotionBody = /*@__PURE__*/ createMinimalMotionComponent(\"body\");\nexport const MotionButton = /*@__PURE__*/ createMinimalMotionComponent(\"button\");\nexport const MotionCanvas = /*@__PURE__*/ createMinimalMotionComponent(\"canvas\");\nexport const MotionCaption = \n/*@__PURE__*/ createMinimalMotionComponent(\"caption\");\nexport const MotionCite = /*@__PURE__*/ createMinimalMotionComponent(\"cite\");\nexport const MotionCode = /*@__PURE__*/ createMinimalMotionComponent(\"code\");\nexport const MotionCol = /*@__PURE__*/ createMinimalMotionComponent(\"col\");\nexport const MotionColgroup = \n/*@__PURE__*/ createMinimalMotionComponent(\"colgroup\");\nexport const MotionData = /*@__PURE__*/ createMinimalMotionComponent(\"data\");\nexport const MotionDatalist = \n/*@__PURE__*/ createMinimalMotionComponent(\"datalist\");\nexport const MotionDd = /*@__PURE__*/ createMinimalMotionComponent(\"dd\");\nexport const MotionDel = /*@__PURE__*/ createMinimalMotionComponent(\"del\");\nexport const MotionDetails = \n/*@__PURE__*/ createMinimalMotionComponent(\"details\");\nexport const MotionDfn = /*@__PURE__*/ createMinimalMotionComponent(\"dfn\");\nexport const MotionDialog = /*@__PURE__*/ createMinimalMotionComponent(\"dialog\");\nexport const MotionDiv = /*@__PURE__*/ createMinimalMotionComponent(\"div\");\nexport const MotionDl = /*@__PURE__*/ createMinimalMotionComponent(\"dl\");\nexport const MotionDt = /*@__PURE__*/ createMinimalMotionComponent(\"dt\");\nexport const MotionEm = /*@__PURE__*/ createMinimalMotionComponent(\"em\");\nexport const MotionEmbed = /*@__PURE__*/ createMinimalMotionComponent(\"embed\");\nexport const MotionFieldset = \n/*@__PURE__*/ createMinimalMotionComponent(\"fieldset\");\nexport const MotionFigcaption = \n/*@__PURE__*/ createMinimalMotionComponent(\"figcaption\");\nexport const MotionFigure = /*@__PURE__*/ createMinimalMotionComponent(\"figure\");\nexport const MotionFooter = /*@__PURE__*/ createMinimalMotionComponent(\"footer\");\nexport const MotionForm = /*@__PURE__*/ createMinimalMotionComponent(\"form\");\nexport const MotionH1 = /*@__PURE__*/ createMinimalMotionComponent(\"h1\");\nexport const MotionH2 = /*@__PURE__*/ createMinimalMotionComponent(\"h2\");\nexport const MotionH3 = /*@__PURE__*/ createMinimalMotionComponent(\"h3\");\nexport const MotionH4 = /*@__PURE__*/ createMinimalMotionComponent(\"h4\");\nexport const MotionH5 = /*@__PURE__*/ createMinimalMotionComponent(\"h5\");\nexport const MotionH6 = /*@__PURE__*/ createMinimalMotionComponent(\"h6\");\nexport const MotionHead = /*@__PURE__*/ createMinimalMotionComponent(\"head\");\nexport const MotionHeader = /*@__PURE__*/ createMinimalMotionComponent(\"header\");\nexport const MotionHgroup = /*@__PURE__*/ createMinimalMotionComponent(\"hgroup\");\nexport const MotionHr = /*@__PURE__*/ createMinimalMotionComponent(\"hr\");\nexport const MotionHtml = /*@__PURE__*/ createMinimalMotionComponent(\"html\");\nexport const MotionI = /*@__PURE__*/ createMinimalMotionComponent(\"i\");\nexport const MotionIframe = /*@__PURE__*/ createMinimalMotionComponent(\"iframe\");\nexport const MotionImg = /*@__PURE__*/ createMinimalMotionComponent(\"img\");\nexport const MotionInput = /*@__PURE__*/ createMinimalMotionComponent(\"input\");\nexport const MotionIns = /*@__PURE__*/ createMinimalMotionComponent(\"ins\");\nexport const MotionKbd = /*@__PURE__*/ createMinimalMotionComponent(\"kbd\");\nexport const MotionKeygen = /*@__PURE__*/ createMinimalMotionComponent(\"keygen\");\nexport const MotionLabel = /*@__PURE__*/ createMinimalMotionComponent(\"label\");\nexport const MotionLegend = /*@__PURE__*/ createMinimalMotionComponent(\"legend\");\nexport const MotionLi = /*@__PURE__*/ createMinimalMotionComponent(\"li\");\nexport const MotionLink = /*@__PURE__*/ createMinimalMotionComponent(\"link\");\nexport const MotionMain = /*@__PURE__*/ createMinimalMotionComponent(\"main\");\nexport const MotionMap = /*@__PURE__*/ createMinimalMotionComponent(\"map\");\nexport const MotionMark = /*@__PURE__*/ createMinimalMotionComponent(\"mark\");\nexport const MotionMenu = /*@__PURE__*/ createMinimalMotionComponent(\"menu\");\nexport const MotionMenuitem = \n/*@__PURE__*/ createMinimalMotionComponent(\"menuitem\");\nexport const MotionMeter = /*@__PURE__*/ createMinimalMotionComponent(\"meter\");\nexport const MotionNav = /*@__PURE__*/ createMinimalMotionComponent(\"nav\");\nexport const MotionObject = /*@__PURE__*/ createMinimalMotionComponent(\"object\");\nexport const MotionOl = /*@__PURE__*/ createMinimalMotionComponent(\"ol\");\nexport const MotionOptgroup = \n/*@__PURE__*/ createMinimalMotionComponent(\"optgroup\");\nexport const MotionOption = /*@__PURE__*/ createMinimalMotionComponent(\"option\");\nexport const MotionOutput = /*@__PURE__*/ createMinimalMotionComponent(\"output\");\nexport const MotionP = /*@__PURE__*/ createMinimalMotionComponent(\"p\");\nexport const MotionParam = /*@__PURE__*/ createMinimalMotionComponent(\"param\");\nexport const MotionPicture = \n/*@__PURE__*/ createMinimalMotionComponent(\"picture\");\nexport const MotionPre = /*@__PURE__*/ createMinimalMotionComponent(\"pre\");\nexport const MotionProgress = \n/*@__PURE__*/ createMinimalMotionComponent(\"progress\");\nexport const MotionQ = /*@__PURE__*/ createMinimalMotionComponent(\"q\");\nexport const MotionRp = /*@__PURE__*/ createMinimalMotionComponent(\"rp\");\nexport const MotionRt = /*@__PURE__*/ createMinimalMotionComponent(\"rt\");\nexport const MotionRuby = /*@__PURE__*/ createMinimalMotionComponent(\"ruby\");\nexport const MotionS = /*@__PURE__*/ createMinimalMotionComponent(\"s\");\nexport const MotionSamp = /*@__PURE__*/ createMinimalMotionComponent(\"samp\");\nexport const MotionScript = /*@__PURE__*/ createMinimalMotionComponent(\"script\");\nexport const MotionSection = \n/*@__PURE__*/ createMinimalMotionComponent(\"section\");\nexport const MotionSelect = /*@__PURE__*/ createMinimalMotionComponent(\"select\");\nexport const MotionSmall = /*@__PURE__*/ createMinimalMotionComponent(\"small\");\nexport const MotionSource = /*@__PURE__*/ createMinimalMotionComponent(\"source\");\nexport const MotionSpan = /*@__PURE__*/ createMinimalMotionComponent(\"span\");\nexport const MotionStrong = /*@__PURE__*/ createMinimalMotionComponent(\"strong\");\nexport const MotionStyle = /*@__PURE__*/ createMinimalMotionComponent(\"style\");\nexport const MotionSub = /*@__PURE__*/ createMinimalMotionComponent(\"sub\");\nexport const MotionSummary = \n/*@__PURE__*/ createMinimalMotionComponent(\"summary\");\nexport const MotionSup = /*@__PURE__*/ createMinimalMotionComponent(\"sup\");\nexport const MotionTable = /*@__PURE__*/ createMinimalMotionComponent(\"table\");\nexport const MotionTbody = /*@__PURE__*/ createMinimalMotionComponent(\"tbody\");\nexport const MotionTd = /*@__PURE__*/ createMinimalMotionComponent(\"td\");\nexport const MotionTextarea = \n/*@__PURE__*/ createMinimalMotionComponent(\"textarea\");\nexport const MotionTfoot = /*@__PURE__*/ createMinimalMotionComponent(\"tfoot\");\nexport const MotionTh = /*@__PURE__*/ createMinimalMotionComponent(\"th\");\nexport const MotionThead = /*@__PURE__*/ createMinimalMotionComponent(\"thead\");\nexport const MotionTime = /*@__PURE__*/ createMinimalMotionComponent(\"time\");\nexport const MotionTitle = /*@__PURE__*/ createMinimalMotionComponent(\"title\");\nexport const MotionTr = /*@__PURE__*/ createMinimalMotionComponent(\"tr\");\nexport const MotionTrack = /*@__PURE__*/ createMinimalMotionComponent(\"track\");\nexport const MotionU = /*@__PURE__*/ createMinimalMotionComponent(\"u\");\nexport const MotionUl = /*@__PURE__*/ createMinimalMotionComponent(\"ul\");\nexport const MotionVideo = /*@__PURE__*/ createMinimalMotionComponent(\"video\");\nexport const MotionWbr = /*@__PURE__*/ createMinimalMotionComponent(\"wbr\");\nexport const MotionWebview = \n/*@__PURE__*/ createMinimalMotionComponent(\"webview\");\n/**\n * SVG components\n */\nexport const MotionAnimate = \n/*@__PURE__*/ createMinimalMotionComponent(\"animate\");\nexport const MotionCircle = /*@__PURE__*/ createMinimalMotionComponent(\"circle\");\nexport const MotionDefs = /*@__PURE__*/ createMinimalMotionComponent(\"defs\");\nexport const MotionDesc = /*@__PURE__*/ createMinimalMotionComponent(\"desc\");\nexport const MotionEllipse = \n/*@__PURE__*/ createMinimalMotionComponent(\"ellipse\");\nexport const MotionG = /*@__PURE__*/ createMinimalMotionComponent(\"g\");\nexport const MotionImage = /*@__PURE__*/ createMinimalMotionComponent(\"image\");\nexport const MotionLine = /*@__PURE__*/ createMinimalMotionComponent(\"line\");\nexport const MotionFilter = /*@__PURE__*/ createMinimalMotionComponent(\"filter\");\nexport const MotionMarker = /*@__PURE__*/ createMinimalMotionComponent(\"marker\");\nexport const MotionMask = /*@__PURE__*/ createMinimalMotionComponent(\"mask\");\nexport const MotionMetadata = \n/*@__PURE__*/ createMinimalMotionComponent(\"metadata\");\nexport const MotionPath = /*@__PURE__*/ createMinimalMotionComponent(\"path\");\nexport const MotionPattern = \n/*@__PURE__*/ createMinimalMotionComponent(\"pattern\");\nexport const MotionPolygon = \n/*@__PURE__*/ createMinimalMotionComponent(\"polygon\");\nexport const MotionPolyline = \n/*@__PURE__*/ createMinimalMotionComponent(\"polyline\");\nexport const MotionRect = /*@__PURE__*/ createMinimalMotionComponent(\"rect\");\nexport const MotionStop = /*@__PURE__*/ createMinimalMotionComponent(\"stop\");\nexport const MotionSvg = /*@__PURE__*/ createMinimalMotionComponent(\"svg\");\nexport const MotionSymbol = /*@__PURE__*/ createMinimalMotionComponent(\"symbol\");\nexport const MotionText = /*@__PURE__*/ createMinimalMotionComponent(\"text\");\nexport const MotionTspan = /*@__PURE__*/ createMinimalMotionComponent(\"tspan\");\nexport const MotionUse = /*@__PURE__*/ createMinimalMotionComponent(\"use\");\nexport const MotionView = /*@__PURE__*/ createMinimalMotionComponent(\"view\");\nexport const MotionClipPath = \n/*@__PURE__*/ createMinimalMotionComponent(\"clipPath\");\nexport const MotionFeBlend = \n/*@__PURE__*/ createMinimalMotionComponent(\"feBlend\");\nexport const MotionFeColorMatrix = \n/*@__PURE__*/ createMinimalMotionComponent(\"feColorMatrix\");\nexport const MotionFeComponentTransfer = \n/*@__PURE__*/ createMinimalMotionComponent(\"feComponentTransfer\");\nexport const MotionFeComposite = \n/*@__PURE__*/ createMinimalMotionComponent(\"feComposite\");\nexport const MotionFeConvolveMatrix = \n/*@__PURE__*/ createMinimalMotionComponent(\"feConvolveMatrix\");\nexport const MotionFeDiffuseLighting = \n/*@__PURE__*/ createMinimalMotionComponent(\"feDiffuseLighting\");\nexport const MotionFeDisplacementMap = \n/*@__PURE__*/ createMinimalMotionComponent(\"feDisplacementMap\");\nexport const MotionFeDistantLight = \n/*@__PURE__*/ createMinimalMotionComponent(\"feDistantLight\");\nexport const MotionFeDropShadow = \n/*@__PURE__*/ createMinimalMotionComponent(\"feDropShadow\");\nexport const MotionFeFlood = \n/*@__PURE__*/ createMinimalMotionComponent(\"feFlood\");\nexport const MotionFeFuncA = \n/*@__PURE__*/ createMinimalMotionComponent(\"feFuncA\");\nexport const MotionFeFuncB = \n/*@__PURE__*/ createMinimalMotionComponent(\"feFuncB\");\nexport const MotionFeFuncG = \n/*@__PURE__*/ createMinimalMotionComponent(\"feFuncG\");\nexport const MotionFeFuncR = \n/*@__PURE__*/ createMinimalMotionComponent(\"feFuncR\");\nexport const MotionFeGaussianBlur = \n/*@__PURE__*/ createMinimalMotionComponent(\"feGaussianBlur\");\nexport const MotionFeImage = \n/*@__PURE__*/ createMinimalMotionComponent(\"feImage\");\nexport const MotionFeMerge = \n/*@__PURE__*/ createMinimalMotionComponent(\"feMerge\");\nexport const MotionFeMergeNode = \n/*@__PURE__*/ createMinimalMotionComponent(\"feMergeNode\");\nexport const MotionFeMorphology = \n/*@__PURE__*/ createMinimalMotionComponent(\"feMorphology\");\nexport const MotionFeOffset = \n/*@__PURE__*/ createMinimalMotionComponent(\"feOffset\");\nexport const MotionFePointLight = \n/*@__PURE__*/ createMinimalMotionComponent(\"fePointLight\");\nexport const MotionFeSpecularLighting = \n/*@__PURE__*/ createMinimalMotionComponent(\"feSpecularLighting\");\nexport const MotionFeSpotLight = \n/*@__PURE__*/ createMinimalMotionComponent(\"feSpotLight\");\nexport const MotionFeTile = /*@__PURE__*/ createMinimalMotionComponent(\"feTile\");\nexport const MotionFeTurbulence = \n/*@__PURE__*/ createMinimalMotionComponent(\"feTurbulence\");\nexport const MotionForeignObject = \n/*@__PURE__*/ createMinimalMotionComponent(\"foreignObject\");\nexport const MotionLinearGradient = \n/*@__PURE__*/ createMinimalMotionComponent(\"linearGradient\");\nexport const MotionRadialGradient = \n/*@__PURE__*/ createMinimalMotionComponent(\"radialGradient\");\nexport const MotionTextPath = \n/*@__PURE__*/ createMinimalMotionComponent(\"textPath\");\n//# sourceMappingURL=elements.js.map","import { m } from \"./\";\nexport const MotionDiv = m.div;\n//# sourceMappingURL=size.js.map"],"names":["clamp","min","max","v","LayoutGroupContext","createContext","LazyContext","strict","MotionConfigContext","transformPagePoint","p","isStatic","reducedMotion","MotionContext","isCSSVariableName","token","key","startsWith","checkStringStartsWith","number","test","parse","parseFloat","transform","alpha","scale","default","sanitize","Math","round","floatRegex","singleColorRegex","isColorString","type","testProp","Boolean","isNullish","Object","prototype","hasOwnProperty","call","splitColor","aName","bName","cName","a","b","c","match","undefined","rgbUnit","clampRgbUnit","rgba","red","green","blue","alpha$1","hex","r","g","length","substring","parseInt","createUnitType","unit","endsWith","split","degrees","percent","px","progressPercentage","hsla","hue","saturation","lightness","color","getAnimatableNone","parsed","colorRegex","NUMBER_TOKEN","COLOR_TOKEN","complexRegex","analyseComplexValue","value","originalValue","toString","values","indexes","var","types","i","replace","parsedValue","push","buildTransformer","numSections","output","convertToZero","splitBefore","trim","complex","isNaN","createTransformer","source","info","transformer","map","transformPropOrder","transformProps","Set","resolveVariantFromProps","props","definition","custom","visualElement","current","velocity","variants","isMotionValue","getVelocity","optimizedAppearDataAttribute","toLowerCase","int","numberValueTypes","borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","width","maxWidth","height","maxHeight","top","right","bottom","left","inset","insetBlock","insetBlockStart","insetBlockEnd","insetInline","insetInlineStart","insetInlineEnd","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingBlock","paddingBlockStart","paddingBlockEnd","paddingInline","paddingInlineStart","paddingInlineEnd","margin","marginTop","marginRight","marginBottom","marginLeft","marginBlock","marginBlockStart","marginBlockEnd","marginInline","marginInlineStart","marginInlineEnd","fontSize","backgroundPositionX","backgroundPositionY","rotate","pathRotation","rotateX","rotateY","rotateZ","scaleX","scaleY","scaleZ","skew","skewX","skewY","distance","translateX","translateY","translateZ","x","y","z","perspective","transformPerspective","opacity","originX","originY","originZ","zIndex","fillOpacity","strokeOpacity","numOctaves","getValueAsType","isAnimationControls","start","isVariantLabel","Array","isArray","variantProps","isControllingVariants","animate","some","name","featureDefinitions","translateAlias","numTransforms","buildHTMLStyles","state","latestValues","transformTemplate","style","vars","transformOrigin","hasTransform","hasTransformOrigin","has","valueAsType","transformString","transformIsDefault","valueIsDefault","buildTransform","pixelsToPercent","pixels","axis","correctBorderRadius","correct","latest","node","target","correctBoxShadow","treeScale","projectionDelta","original","shadow","template","offset","xScale","yScale","averageScale","from","scaleCorrectors","applyTo","boxShadow","isForcedMotionValue","layout","layoutId","scrapeMotionValuesFromProps","prevProps","prevStyle","newValues","getValue","liveStyle","dashKeys","array","camelKeys","cssStyleProperties","buildSVGAttrs","attrX","attrY","attrScale","pathLength","pathSpacing","pathOffset","isSVGTag","styleProp","viewBox","attrs","transformBox","spacing","useDashCase","keys","buildSVGPath","resolveMotionValue","get","useCreateMotionContext","initial","context","inherit","getCurrentTreeVariants","useContext","useMemo","variantLabelsAsDependency","prop","join","createHtmlRenderState","copyRawValuesOnly","useStyle","visualState","assign","useInitialMotionValues","useHTMLProps","htmlProps","drag","dragListener","draggable","userSelect","WebkitUserSelect","WebkitTouchCallout","touchAction","tabIndex","onTap","onTapStart","whileTap","createSvgRenderState","useSVGProps","_isStatic","Component","visualProps","tag","rawStyles","validMotionProps","isValidMotionProp","shouldForward","isValidProp","lowercaseSVGElements","isSVGComponent","includes","indexOf","useRender","ref","forwardMotionProps","isSVG","filteredProps","isDom","filterProps","elementProps","Fragment","children","renderedChildren","createElement","PresenceContext","makeLatestValues","presenceContext","scrapeMotionValues","motionValues","checkIsControllingVariants","isVariantNode","checkIsVariantNode","isInitialAnimationBlocked","variantToSet","list","resolved","transitionEnd","transition","valueTarget","makeUseVisualState","config","make","createRenderState","renderState","makeState","init","useRef","useConstant","useHTMLVisualState","scrapeHTMLMotionValuesFromProps","useSVGVisualState","scrapeMotionValuesFromProps$1","charAt","toUpperCase","featureProps","animation","exit","focus","hover","tap","pan","inView","isInitialized","initFeatureDefinitions","initialFeatureDefinitions","isEnabled","getInitializedFeatureDefinitions","motionComponentSymbol","Symbol","for","useMotionRef","externalRef","externalRefContainer","useInsertionEffect","refCleanup","useCallback","instance","onMount","mount","unmount","cleanup","SwitchLayoutGroupContext","isRefObject","useIsomorphicLayoutEffect","window","useLayoutEffect","useEffect","useVisualElement","createVisualElement","ProjectionNodeConstructor","parent","lazyContext","motionConfig","reducedMotionConfig","skipAnimations","visualElementRef","hasMountedOnce","renderer","blockInitialAnimation","manuallyAnimateOnMount","initialLayoutGroupConfig","projection","initialPromotionConfig","dragConstraints","layoutScroll","layoutRoot","layoutAnchor","layoutCrossfade","getClosestProjectingNode","setOptions","alwaysMeasureLayout","animationType","crossfade","createProjectionNode","isMounted","update","optimisedAppearId","wantsHandoff","MotionHandoffIsComplete","MotionHasOptimisedAnimation","MotionIsMounted","updateFeatures","scheduleRenderMicrotask","animationState","animateChanges","queueMicrotask","MotionHandoffMarkAsComplete","enteringChildren","options","allowProjection","createMotionComponent","preloadedFeatures","useVisualState","MotionDOMComponent","MeasureLayout","configAndProps","useLayoutId","layoutProjection","combined","ProjectionNode","getProjectionFunctionality","_jsxs","Provider","_jsx","displayName","ForwardRefMotionComponent","forwardRef","layoutGroupId","id","createMinimalMotionComponent","MotionDiv"],"mappings":"+PAAA,MAAMA,EAAQ,CAACC,EAAKC,EAAKC,IACjBA,EAAID,EACGA,EACPC,EAAIF,EACGA,EACJE,ECHEC,EAAqBC,EAAc,ICAnCC,EAAcD,EAAc,CAAEE,QAAQ,ICGtCC,EAAsBH,EAAc,CAC7CI,mBAAqBC,GAAMA,EAC3BC,UAAU,EACVC,cAAe,UCNNC,EAAgCR,EAAc,ICDrDS,EADwB,CAACC,GAAWC,GAAuB,iBAARA,GAAoBA,EAAIC,WAAWF,GAE9EG,CAAsB,MCA9BC,EAAS,CACXC,KAAOjB,GAAmB,iBAANA,EACpBkB,MAAOC,WAC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KAAM3H,GAAUZ,EAAW7M,EAAOmR,GAAazF,EAAaX,EAAQ5K,cAAeiR,GAAc1F,EAAa9R,EAAU+T,EAAoBC,EAAOR,KACxV,CACA8H,EAAmBW,YAAc,UAA+B,iBAAdhJ,EAC5CA,EACA,UAAUA,EAAUgJ,aAAehJ,EAAUxG,MAAQ,QAC3D,MAAMyP,EAA4BC,EAAWb,GAE7C,OADAY,EAA0B9E,IAAyBnE,EAC5CiJ,CACX,CACA,SAAST,IAAYrM,SAAEA,IACnB,MAAMgN,EAAgB9K,EAAW7R,GAAoB4c,GACrD,OAAOD,QAA8B9Z,IAAb8M,EAClBgN,EAAgB,IAAMhN,EACtBA,CACV,CC/EO,SAASkN,GAA6BrJ,EAAWgI,GACpD,OAAOE,GAAsBlI,EAAWgI,EAC5C,CCqCO,MCvCMsB,GDuC0BD,GAA6B"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/size-rollup-motion.js b/node_modules/framer-motion/dist/size-rollup-motion.js deleted file mode 100644 index 6ba5c44..0000000 --- a/node_modules/framer-motion/dist/size-rollup-motion.js +++ /dev/null @@ -1,2 +0,0 @@ -import{jsxs as t,jsx as e}from"react/jsx-runtime";import{createContext as n,useContext as i,useMemo as s,Fragment as o,createElement as r,useRef as a,useInsertionEffect as l,useCallback as h,useLayoutEffect as u,useEffect as c,forwardRef as d,useId as p,Component as m}from"react";function f(t,e){-1===t.indexOf(e)&&t.push(e)}function y(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const g=(t,e,n)=>n>e?e:n{},w=()=>{};"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(x=(t,e,n)=>{t||"undefined"==typeof console||console.warn(v(e,n))},w=(t,e,n)=>{if(!t)throw new Error(v(e,n))});const T={},S=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),P=t=>"object"==typeof t&&null!==t,b=t=>/^0[^.\s]+$/u.test(t);function E(t){let e;return()=>(void 0===e&&(e=t()),e)}const A=t=>t,M=(...t)=>t.reduce((t,e)=>n=>e(t(n))),V=(t,e,n)=>{const i=e-t;return i?(n-t)/i:1};class C{constructor(){this.subscriptions=[]}add(t){return f(this.subscriptions,t),()=>y(this.subscriptions,t)}notify(t,e,n){const i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](t,e,n);else for(let s=0;s1e3*t,D=t=>t/1e3,R=(t,e)=>e?t*(1e3/e):0,L=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function B(t,e,n,i){if(t===e&&n===i)return A;const s=e=>function(t,e,n,i,s){let o,r,a=0;do{r=e+(n-e)/2,o=L(r,i,s)-t,o>0?n=r:e=r}while(Math.abs(o)>1e-7&&++a<12);return r}(e,0,1,t,n);return t=>0===t||1===t?t:L(s(t),e,i)}const j=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,F=t=>e=>1-t(1-e),I=B(.33,1.53,.69,.99),O=F(I),U=j(O),W=t=>t>=1?1:(t*=2)<1?.5*O(t):.5*(2-Math.pow(2,-10*(t-1))),N=t=>1-Math.sin(Math.acos(t)),$=F(N),z=j(N),Y=B(.42,0,1,1),X=B(0,0,.58,1),H=B(.42,0,.58,1),K=t=>Array.isArray(t)&&"number"==typeof t[0],G={linear:A,easeIn:Y,easeInOut:H,easeOut:X,circIn:N,circInOut:z,circOut:$,backIn:O,backInOut:U,backOut:I,anticipate:W},q=t=>{if(K(t)){w(4===t.length,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[e,n,i,s]=t;return B(e,n,i,s)}return"string"==typeof t?(w(void 0!==G[t],`Invalid easing type '${t}'`,"invalid-easing-type"),G[t]):t},Z=n({}),_=n({strict:!1}),J=n({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),Q=n({}),tt=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function et(t,e){let n=!1,i=!0;const s={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,r=tt.reduce((t,e)=>(t[e]=function(t){let e=new Set,n=new Set,i=!1,s=!1;const o=new WeakSet;let r={delta:0,timestamp:0,isProcessing:!1};function a(e){o.has(e)&&(l.schedule(e),t()),e(r)}const l={schedule:(t,s=!1,r=!1)=>{const a=r&&i?e:n;return s&&o.add(t),a.add(t),t},cancel:t=>{n.delete(t),o.delete(t)},process:t=>{if(r=t,i)return void(s=!0);i=!0;const o=e;e=n,n=o,e.forEach(a),e.clear(),i=!1,s&&(s=!1,l.process(t))}};return l}(o),t),{}),{setup:a,read:l,resolveKeyframes:h,preUpdate:u,update:c,preRender:d,render:p,postRender:m}=r,f=()=>{const o=T.useManualTiming,r=o?s.timestamp:performance.now();n=!1,o||(s.delta=i?1e3/60:Math.max(Math.min(r-s.timestamp,40),1)),s.timestamp=r,s.isProcessing=!0,a.process(s),l.process(s),h.process(s),u.process(s),c.process(s),d.process(s),p.process(s),m.process(s),s.isProcessing=!1,n&&e&&(i=!1,t(f))};return{schedule:tt.reduce((e,o)=>{const a=r[o];return e[o]=(e,o=!1,r=!1)=>(n||(n=!0,i=!0,s.isProcessing||t(f)),a.schedule(e,o,r)),e},{}),cancel:t=>{for(let e=0;e(void 0===rt&<.set(st.isProcessing||T.useManualTiming?st.timestamp:performance.now()),rt),set:t=>{rt=t,queueMicrotask(at)}},ht=t=>e=>"string"==typeof e&&e.startsWith(t),ut=ht("--"),ct=ht("var(--"),dt=t=>!!ct(t)&&pt.test(t.split("/*")[0].trim()),pt=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function mt(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const ft={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},yt={...ft,transform:t=>g(0,1,t)},gt={...ft,default:1},vt=t=>Math.round(1e5*t)/1e5,xt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const wt=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Tt=(t,e)=>n=>Boolean("string"==typeof n&&wt.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),St=(t,e,n)=>i=>{if("string"!=typeof i)return i;const[s,o,r,a]=i.match(xt);return{[t]:parseFloat(s),[e]:parseFloat(o),[n]:parseFloat(r),alpha:void 0!==a?parseFloat(a):1}},Pt={...ft,transform:t=>Math.round((t=>g(0,255,t))(t))},bt={test:Tt("rgb","red"),parse:St("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+Pt.transform(t)+", "+Pt.transform(e)+", "+Pt.transform(n)+", "+vt(yt.transform(i))+")"};const Et={test:Tt("#"),parse:function(t){let e="",n="",i="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),i=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),i=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,i+=i,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:s?parseInt(s,16)/255:1}},transform:bt.transform},At=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),Mt=At("deg"),Vt=At("%"),Ct=At("px"),kt=At("vh"),Dt=At("vw"),Rt=(()=>({...Vt,parse:t=>Vt.parse(t)/100,transform:t=>Vt.transform(100*t)}))(),Lt={test:Tt("hsl","hue"),parse:St("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+Vt.transform(vt(e))+", "+Vt.transform(vt(n))+", "+vt(yt.transform(i))+")"},Bt={test:t=>bt.test(t)||Et.test(t)||Lt.test(t),parse:t=>bt.test(t)?bt.parse(t):Lt.test(t)?Lt.parse(t):Et.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?bt.transform(t):Lt.transform(t),getAnimatableNone:t=>{const e=Bt.parse(t);return e.alpha=0,Bt.transform(e)}},jt=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const Ft="number",It="color",Ot=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Ut(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},s=[];let o=0;const r=e.replace(Ot,t=>(Bt.test(t)?(i.color.push(o),s.push(It),n.push(Bt.parse(t))):t.startsWith("var(")?(i.var.push(o),s.push("var"),n.push(t)):(i.number.push(o),s.push(Ft),n.push(parseFloat(t))),++o,"${}")).split("${}");return{values:n,split:r,indexes:i,types:s}}function Wt({split:t,types:e}){const n=t.length;return i=>{let s="";for(let o=0;o{return"number"==typeof t?e?.trim().endsWith("/")?t:0:"number"==typeof(n=t)?0:Bt.test(n)?Bt.getAnimatableNone(n):n;var n};const $t={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(xt)?.length||0)+(t.match(jt)?.length||0)>0},parse:function(t){return Ut(t).values},createTransformer:function(t){return Wt(Ut(t))},getAnimatableNone:function(t){const e=Ut(t);return Wt(e)(e.values.map((t,n)=>Nt(t,e.split[n])))}};function zt(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function Yt(t,e){return n=>n>0?e:t}const Xt=(t,e,n)=>t+(e-t)*n,Ht=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},Kt=[Et,bt,Lt];function Gt(t){const e=(n=t,Kt.find(t=>t.test(n)));var n;if(x(Boolean(e),`'${t}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!Boolean(e))return!1;let i=e.parse(t);return e===Lt&&(i=function({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let s=0,o=0,r=0;if(e/=100){const i=n<.5?n*(1+e):n+e-n*e,a=2*n-i;s=zt(a,i,t+1/3),o=zt(a,i,t),r=zt(a,i,t-1/3)}else s=o=r=n;return{red:Math.round(255*s),green:Math.round(255*o),blue:Math.round(255*r),alpha:i}}(i)),i}const qt=(t,e)=>{const n=Gt(t),i=Gt(e);if(!n||!i)return Yt(t,e);const s={...n};return t=>(s.red=Ht(n.red,i.red,t),s.green=Ht(n.green,i.green,t),s.blue=Ht(n.blue,i.blue,t),s.alpha=Xt(n.alpha,i.alpha,t),bt.transform(s))},Zt=new Set(["none","hidden"]);function _t(t,e){return n=>Xt(t,e,n)}function Jt(t){return"number"==typeof t?_t:"string"==typeof t?dt(t)?Yt:Bt.test(t)?qt:ee:Array.isArray(t)?Qt:"object"==typeof t?Bt.test(t)?qt:te:Yt}function Qt(t,e){const n=[...t],i=n.length,s=t.map((t,n)=>Jt(t)(t,e[n]));return t=>{for(let e=0;e{for(const e in i)n[e]=i[e](t);return n}}const ee=(t,e)=>{const n=$t.createTransformer(e),i=Ut(t),s=Ut(e);return i.indexes.var.length===s.indexes.var.length&&i.indexes.color.length===s.indexes.color.length&&i.indexes.number.length>=s.indexes.number.length?Zt.has(t)&&!s.values.length||Zt.has(e)&&!i.values.length?function(t,e){return Zt.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):M(Qt(function(t,e){const n=[],i={color:0,var:0,number:0};for(let s=0;s{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>nt.update(e,t),stop:()=>it(e),now:()=>st.isProcessing?st.timestamp:lt.now()}},se=(t,e,n=10)=>{let i="";const s=Math.max(Math.round(e/n),2);for(let e=0;e=oe?1/0:e}const ae=100,le=10,he=1,ue=0,ce=800,de=.3,pe=.3,me={granular:.01,default:2},fe={granular:.005,default:.5},ye=.01,ge=10,ve=.05,xe=1;function we(t,e){return t*Math.sqrt(1-e*e)}const Te=.001;const Se=["duration","bounce"],Pe=["stiffness","damping","mass"];function be(t,e){return e.some(e=>void 0!==t[e])}function Ee(t){let e={velocity:ue,stiffness:ae,damping:le,mass:he,isResolvedFromDuration:!1,...t};if(!be(t,Pe)&&be(t,Se))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,i=2*Math.PI/(1.2*n),s=i*i,o=2*g(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:he,stiffness:s,damping:o}}else{const n=function({duration:t=ce,bounce:e=de,velocity:n=ue,mass:i=he}){let s,o;x(t<=k(ge),"Spring duration must be 10 seconds or less","spring-duration-limit");let r=1-e;r=g(ve,xe,r),t=g(ye,ge,D(t)),r<1?(s=e=>{const i=e*r,s=i*t,o=i-n,a=we(e,r),l=Math.exp(-s);return Te-o/a*l},o=e=>{const i=e*r*t,o=i*n+n,a=Math.pow(r,2)*Math.pow(e,2)*t,l=Math.exp(-i),h=we(Math.pow(e,2),r);return(-s(e)+Te>0?-1:1)*((o-a)*l)/h}):(s=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,o=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let i=n;for(let n=1;n<12;n++)i-=t(i)/e(i);return i}(s,o,5/t);if(t=k(t),isNaN(a))return{stiffness:ae,damping:le,duration:t};{const e=Math.pow(a,2)*i;return{stiffness:e,damping:2*r*Math.sqrt(i*e),duration:t}}}({...t,velocity:0});e={...e,...n,mass:he},e.isResolvedFromDuration=!0}return e}function Ae(t=pe,e=de){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:i,restDelta:s}=n;const o=n.keyframes[0],r=n.keyframes[n.keyframes.length-1],a={done:!1,value:o},{stiffness:l,damping:h,mass:u,duration:c,velocity:d,isResolvedFromDuration:p}=Ee({...n,velocity:-D(n.velocity||0)}),m=d||0,f=h/(2*Math.sqrt(l*u)),y=r-o,g=D(Math.sqrt(l/u)),v=Math.abs(y)<5;let x,w,T,S,P,b;if(i||(i=v?me.granular:me.default),s||(s=v?fe.granular:fe.default),f<1)T=we(g,f),S=(m+f*g*y)/T,x=t=>{const e=Math.exp(-f*g*t);return r-e*(S*Math.sin(T*t)+y*Math.cos(T*t))},P=f*g*S+y*T,b=f*g*y-S*T,w=t=>Math.exp(-f*g*t)*(P*Math.sin(T*t)+b*Math.cos(T*t));else if(1===f){x=t=>r-Math.exp(-g*t)*(y+(m+g*y)*t);const t=m+g*y;w=e=>Math.exp(-g*e)*(g*t*e-m)}else{const t=g*Math.sqrt(f*f-1);x=e=>{const n=Math.exp(-f*g*e),i=Math.min(t*e,300);return r-n*((m+f*g*y)*Math.sinh(i)+t*y*Math.cosh(i))/t};const e=(m+f*g*y)/t,n=f*g*e-y*t,i=f*g*y-e*t;w=e=>{const s=Math.exp(-f*g*e),o=Math.min(t*e,300);return s*(n*Math.sinh(o)+i*Math.cosh(o))}}const E={calculatedDuration:p&&c||null,velocity:t=>k(w(t)),next:t=>{if(!p&&f<1){const e=Math.exp(-f*g*t),n=Math.sin(T*t),o=Math.cos(T*t),l=r-e*(S*n+y*o),h=k(e*(P*n+b*o));return a.done=Math.abs(h)<=i&&Math.abs(r-l)<=s,a.value=a.done?r:l,a}const e=x(t);if(p)a.done=t>=c;else{const n=k(w(t));a.done=Math.abs(n)<=i&&Math.abs(r-e)<=s}return a.value=a.done?r:e,a},toString:()=>{const t=Math.min(re(E),oe),e=se(e=>E.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return E}Ae.applyToOptions=t=>{const e=function(t,e=100,n){const i=n({...t,keyframes:[0,e]}),s=Math.min(re(i),oe);return{type:"keyframes",ease:t=>i.next(s*t).value/e,duration:D(s)}}(t,100,Ae);return t.ease=e.ease,t.duration=k(e.duration),t.type="keyframes",t};function Me(t,e,n){const i=Math.max(e-5,0);return R(n-t(i),e-i)}function Ve({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:l,restDelta:h=.5,restSpeed:u}){const c=t[0],d={done:!1,value:c},p=t=>void 0===a?l:void 0===l||Math.abs(a-t)-m*Math.exp(-t/i),v=t=>y+g(t),x=t=>{const e=g(t),n=v(t);d.done=Math.abs(e)<=h,d.value=d.done?y:n};let w,T;const S=t=>{var e;(e=d.value,void 0!==a&&el)&&(w=t,T=Ae({keyframes:[d.value,p(d.value)],velocity:Me(v,t,d.value),damping:s,stiffness:o,restDelta:h,restSpeed:u}))};return S(0),{calculatedDuration:null,next:t=>{let e=!1;return T||void 0!==w||(e=!0,x(t),S(t)),void 0!==w&&t>=w?T.next(t-w):(!e&&x(t),d)}}}function Ce(t,e,{clamp:n=!0,ease:i,mixer:s}={}){const o=t.length;if(w(o===e.length,"Both input and output ranges must be the same length","range-length"),1===o)return()=>e[0];if(2===o&&e[0]===e[1])return()=>e[1];const r=t[0]===t[1];t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=function(t,e,n){const i=[],s=n||T.mix||ne,o=t.length-1;for(let n=0;n{if(r&&n1)for(;ih(g(t[0],t[o-1],e)):h}function ke(t){const e=[0];return function(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const s=V(0,e,i);t.push(Xt(n,1,s))}}(e,t.length-1),e}function De({duration:t=300,keyframes:e,times:n,ease:i="easeInOut"}){const s=(t=>Array.isArray(t)&&"number"!=typeof t[0])(i)?i.map(q):q(i),o={done:!1,value:e[0]},r=function(t,e){return t.map(t=>t*e)}(n&&n.length===e.length?n:ke(e),t),a=Ce(r,e,{ease:Array.isArray(s)?s:(l=e,h=s,l.map(()=>h||H).splice(0,l.length-1))});var l,h;return{calculatedDuration:t,next:e=>(o.value=a(e),o.done=e>=t,o)}}const Re=t=>null!==t;function Le(t,{repeat:e,repeatType:n="loop"},i,s=1){const o=t.filter(Re),r=s<0||e&&"loop"!==n&&e%2==1?0:o.length-1;return r&&void 0!==i?i:o[r]}const Be={decay:Ve,inertia:Ve,tween:De,keyframes:De,spring:Ae};function je(t){"string"==typeof t.type&&(t.type=Be[t.type])}class Fe{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const Ie=t=>t/100;class Oe extends Fe{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:t}=this.options;t&&t.updatedAt!==lt.now()&&this.tick(lt.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;je(t);const{type:e=De,repeat:n=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=t;let{keyframes:r}=t;const a=e||De;a!==De&&"number"!=typeof r[0]&&(this.mixKeyframes=M(Ie,ne(r[0],r[1])),r=[0,100]);const l=a({...t,keyframes:r});"mirror"===s&&(this.mirroredGenerator=a({...t,keyframes:[...r].reverse(),velocity:-o})),null===l.calculatedDuration&&(l.calculatedDuration=re(l));const{calculatedDuration:h}=l;this.calculatedDuration=h,this.resolvedDuration=h+i,this.totalDuration=this.resolvedDuration*(n+1)-i,this.generator=l}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,e=!1){const{generator:n,totalDuration:i,mixKeyframes:s,mirroredGenerator:o,resolvedDuration:r,calculatedDuration:a}=this;if(null===this.startTime)return n.next(0);const{delay:l=0,keyframes:h,repeat:u,repeatType:c,repeatDelay:d,type:p,onUpdate:m,finalKeyframe:f}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const y=this.currentTime-l*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?y<0:y>i;this.currentTime=Math.max(y,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=i);let x,w=this.currentTime,T=n;if(u){const t=Math.min(this.currentTime,i)/r;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,u+1);Boolean(e%2)&&("reverse"===c?(n=1-n,d&&(n-=d/r)):"mirror"===c&&(T=o)),w=g(0,1,n)*r}v?(this.delayState.value=h[0],x=this.delayState):x=T.next(w),s&&!v&&(x.value=s(x.value));let{done:S}=x;v||null===a||(S=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const P=null===this.holdTime&&("finished"===this.state||"running"===this.state&&S);return P&&p!==Ve&&(x.value=Le(h,this.options,f,this.speed)),m&&m(x.value),P&&this.finish(),x}then(t,e){return this.finished.then(t,e)}get duration(){return D(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+D(t)}get time(){return D(this.currentTime)}set time(t){t=k(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);return Me(t=>this.generator.next(t).value,t,this.generator.next(t).value)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;e&&this.driver&&this.updateTime(lt.now()),this.playbackSpeed=t,e&&this.driver&&(this.time=D(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=ie,startTime:e}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),this.options.onPlay?.();const n=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=n):null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime||(this.startTime=e??n),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(lt.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}const Ue=t=>180*t/Math.PI,We=t=>{const e=Ue(Math.atan2(t[1],t[0]));return $e(e)},Ne={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:We,rotateZ:We,skewX:t=>Ue(Math.atan(t[1])),skewY:t=>Ue(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},$e=t=>((t%=360)<0&&(t+=360),t),ze=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Ye=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Xe={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:ze,scaleY:Ye,scale:t=>(ze(t)+Ye(t))/2,rotateX:t=>$e(Ue(Math.atan2(t[6],t[5]))),rotateY:t=>$e(Ue(Math.atan2(-t[2],t[0]))),rotateZ:We,rotate:We,skewX:t=>Ue(Math.atan(t[4])),skewY:t=>Ue(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function He(t){return t.includes("scale")?1:0}function Ke(t,e){if(!t||"none"===t)return He(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,s;if(n)i=Xe,s=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=Ne,s=e}if(!s)return He(e);const o=i[e],r=s[1].split(",").map(Ge);return"function"==typeof o?o(r):r[o]}function Ge(t){return parseFloat(t.trim())}const qe=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ze=(()=>new Set([...qe,"pathRotation"]))(),_e=t=>t===ft||t===Ct,Je=new Set(["x","y","z"]),Qe=qe.filter(t=>!Je.has(t));const tn={width:({x:t},{paddingLeft:e="0",paddingRight:n="0",boxSizing:i})=>{const s=t.max-t.min;return"border-box"===i?s:s-parseFloat(e)-parseFloat(n)},height:({y:t},{paddingTop:e="0",paddingBottom:n="0",boxSizing:i})=>{const s=t.max-t.min;return"border-box"===i?s:s-parseFloat(e)-parseFloat(n)},top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>Ke(e,"x"),y:(t,{transform:e})=>Ke(e,"y")};tn.translateX=tn.x,tn.translateY=tn.y;const en=new Set;let nn=!1,sn=!1,on=!1;function rn(){if(sn){const t=Array.from(en).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),n=new Map;e.forEach(t=>{const e=function(t){const e=[];return Qe.forEach(n=>{const i=t.getValue(n);void 0!==i&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),e}(t);e.length&&(n.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=n.get(t);e&&e.forEach(([e,n])=>{t.getValue(e)?.set(n)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}sn=!1,nn=!1,en.forEach(t=>t.complete(on)),en.clear()}function an(){en.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(sn=!0)})}class ln{constructor(t,e,n,i,s,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(en.add(this),nn||(nn=!0,nt.read(an),nt.resolveKeyframes(rn))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:i}=this;if(null===t[0]){const s=i?.get(),o=t[t.length-1];if(void 0!==s)t[0]=s;else if(n&&e){const i=n.readValue(e,o);null!=i&&(t[0]=i)}void 0===t[0]&&(t[0]=o),i&&void 0===s&&i.set(t[0])}!function(t){for(let e=1;et.startsWith("--"))(e)?t.style.setProperty(e,n):t.style[e]=n}const un={};function cn(t,e){const n=E(t);return()=>un[e]??n()}const dn=cn(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),pn=cn(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),mn=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,fn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:mn([0,.65,.55,1]),circOut:mn([.55,0,1,.45]),backIn:mn([.31,.01,.66,-.59]),backOut:mn([.33,1.53,.69,.99])};function yn(t,e){return t?"function"==typeof t?pn()?se(t,e):"ease-out":K(t)?mn(t):Array.isArray(t)?t.map(t=>yn(t,e)||fn.easeOut):fn[t]:void 0}function gn(t,e,n,{delay:i=0,duration:s=300,repeat:o=0,repeatType:r="loop",ease:a="easeOut",times:l}={},h=void 0){const u={[e]:n};l&&(u.offset=l);const c=yn(a,s);Array.isArray(c)&&(u.easing=c);const d={delay:i,duration:s,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:o+1,direction:"reverse"===r?"alternate":"normal"};return h&&(d.pseudoElement=h),t.animate(u,d)}function vn(t){return"function"==typeof t&&"applyToOptions"in t}class xn extends Fe{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:e,name:n,keyframes:i,pseudoElement:s,allowFlatten:o=!1,finalKeyframe:r,onComplete:a}=t;this.isPseudoElement=Boolean(s),this.allowFlatten=o,this.options=t,w("string"!=typeof t.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const l=function({type:t,...e}){return vn(t)&&pn()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=gn(e,n,i,l,s),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const t=Le(i,this.options,r,this.speed);this.updateMotionValue&&this.updateMotionValue(t),hn(e,n,t),this.animation.cancel()}a?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return D(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+D(t)}get time(){return D(Number(this.animation.currentTime)||0)}set time(t){const e=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=k(t),e&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:e,rangeEnd:n,observe:i}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&dn()?(this.animation.timeline=t,e&&(this.animation.rangeStart=e),n&&(this.animation.rangeEnd=n),A):i(this)}}const wn={anticipate:W,backInOut:U,circInOut:z};function Tn(t){"string"==typeof t.ease&&t.ease in wn&&(t.ease=wn[t.ease])}class Sn extends xn{constructor(t){Tn(t),je(t),super(t),void 0!==t.startTime&&!1!==t.autoplay&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:e,onUpdate:n,onComplete:i,element:s,...o}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);const r=new Oe({...o,autoplay:!1}),a=Math.max(10,lt.now()-this.startTime),l=g(0,10,a-10),h=r.sample(a).value,{name:u}=this.options;s&&u&&hn(s,u,h),e.setWithVelocity(r.sample(Math.max(0,a-l)).value,h,l),r.stop()}}const Pn=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!$t.test(t)&&"0"!==t||t.startsWith("url(")));function bn(t){t.duration=0,t.type="keyframes"}const En=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),An=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;const Mn=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),Vn=E(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Cn(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:s,damping:o,type:r,keyframes:a}=t,l=e?.owner?.current;if(!(l instanceof HTMLElement||l instanceof SVGElement))return!1;const{onUpdate:h,transformTemplate:u}=e.owner.getProps();return Vn()&&n&&(En.has(n)||Mn.has(n)&&function(t){for(let e=0;e{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=lt.now();const c={autoplay:t,delay:e,type:n,repeat:i,repeatDelay:s,repeatType:o,name:a,motionValue:l,element:h,...u},d=h?.KeyframeResolver||ln;this.keyframeResolver=new d(r,(t,e,n)=>this.onKeyframesResolved(t,e,c,!n),a,l,h),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,e,n,i){this.keyframeResolver=void 0;const{name:s,type:o,velocity:r,delay:a,isHandoff:l,onUpdate:h}=n;this.resolvedAt=lt.now();let u=!0;(function(t,e,n,i){const s=t[0];if(null===s)return!1;if("display"===e||"visibility"===e)return!0;const o=t[t.length-1],r=Pn(s,e),a=Pn(o,e);return x(r===a,`You are trying to animate ${e} from "${s}" to "${o}". "${r?o:s}" is not an animatable value.`,"value-not-animatable"),!(!r||!a)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:e,...n,keyframes:t},d=u&&!l&&Cn(c),p=c.motionValue?.owner?.current;let m;if(d)try{m=new Sn({...c,element:p})}catch{m=new Oe(c)}else m=new Oe(c);m.finished.then(()=>{this.notifyFinished()}).catch(A),this.pendingTimeline&&(this.stopTimeline=m.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),on=!0,an(),rn(),on=!1),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function Dn(t,e,n,i=0,s=1){const o=Array.from(t).sort((t,e)=>t.sortNodePosition(e)).indexOf(e),r=t.size,a=(r-1)*i;return"function"==typeof n?n(o,r):1===s?o*i:a-o*i}class Rn{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=lt.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=lt.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new C);const n=this.events[t].add(e);return"change"===t?()=>{n(),nt.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=lt.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return R(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Ln(t,e){return new Rn(t,e)}function Bn(t,e){if(t?.inherit&&e){const{inherit:n,...i}=t;return{...e,...i}}return t}function jn(t,e){const n=t?.[e]??t?.default??t;return n!==t?Bn(n,t):n}const Fn={type:"spring",stiffness:500,damping:25,restSpeed:10},In={type:"keyframes",duration:.8},On={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Un=(t,{keyframes:e})=>e.length>2?In:Ze.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:Fn:On,Wn=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);const Nn=(t,e,n,i={},s,o)=>r=>{const a=jn(i,t)||{},l=a.delay||i.delay||0;let{elapsed:h=0}=i;h-=k(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-h,onUpdate:t=>{e.set(t),a.onUpdate&&a.onUpdate(t)},onComplete:()=>{r(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:o?void 0:s};(function(t){for(const e in t)if(!Wn.has(e))return!0;return!1})(a)||Object.assign(u,Un(t,u)),u.duration&&(u.duration=k(u.duration)),u.repeatDelay&&(u.repeatDelay=k(u.repeatDelay)),void 0!==u.from&&(u.keyframes[0]=u.from);let c=!1;if((!1===u.type||0===u.duration&&!u.repeatDelay)&&(bn(u),0===u.delay&&(c=!0)),(T.instantAnimations||T.skipAnimations||s?.shouldSkipAnimations||a.skipAnimations)&&(c=!0,bn(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,c&&!o&&void 0!==e.get()){const t=Le(u.keyframes,a);if(void 0!==t)return void nt.update(()=>{u.onUpdate(t),u.onComplete()})}return a.isSync?new Oe(u):new kn(u)},$n=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function zn(t,e,n=1){w(n<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[i,s]=function(t){const e=$n.exec(t);if(!e)return[,];const[,n,i,s]=e;return[`--${n??i}`,s]}(t);if(!i)return;const o=window.getComputedStyle(e).getPropertyValue(i);if(o){const t=o.trim();return S(t)?parseFloat(t):t}return dt(s)?zn(s,e,n+1):s}function Yn(t){const e=[{},{}];return t?.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}function Xn(t,e,n,i){if("function"==typeof e){const[s,o]=Yn(i);e=e(void 0!==n?n:t.custom,s,o)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[s,o]=Yn(i);e=e(void 0!==n?n:t.custom,s,o)}return e}function Hn(t,e,n){const i=t.getProps();return Xn(i,e,void 0!==n?n:i.custom,t)}const Kn=new Set(["width","height","top","left","right","bottom",...qe]),Gn=t=>Array.isArray(t);function qn(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Ln(n))}function Zn(t){return Gn(t)?t[t.length-1]||0:t}const _n=t=>Boolean(t&&t.getVelocity);function Jn(t,e){const n=t.getValue("willChange");if(i=n,Boolean(_n(i)&&i.add))return n.add(e);if(!n&&T.WillChange){const n=new T.WillChange("auto");t.addValue("willChange",n),n.add(e)}var i}function Qn(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const ti="data-"+Qn("framerAppearId");function ei(t){return t.props[ti]}function ni({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}function ii(t,e,{delay:n=0,transitionOverride:i,type:s}={}){let{transition:o,transitionEnd:r,...a}=e;const l=t.getDefaultTransition();o=o?Bn(o,l):l;const h=o?.reduceMotion,u=o?.skipAnimations;i&&(o=i);const c=[],d=s&&t.animationState&&t.animationState.getState()[s],p=o?.path;p&&p.animateVisualElement(t,a,o,n,c);for(const e in a){const i=t.getValue(e,t.latestValues[e]??null),s=a[e];if(void 0===s||d&&ni(d,e))continue;const r={delay:n,...jn(o||{},e)};u&&(r.skipAnimations=!0);const l=i.get();if(void 0!==l&&!i.isAnimating()&&!Array.isArray(s)&&s===l&&!r.velocity){nt.update(()=>i.set(s));continue}let p=!1;if(window.MotionHandoffAnimation){const n=ei(t);if(n){const t=window.MotionHandoffAnimation(n,e,nt);null!==t&&(r.startTime=t,p=!0)}}Jn(t,e);const m=h??t.shouldReduceMotion;i.start(Nn(e,i,s,m&&Kn.has(e)?{type:!1}:r,t,p));const f=i.animation;f&&c.push(f)}if(r){const e=()=>nt.update(()=>{r&&function(t,e){const n=Hn(t,e);let{transitionEnd:i={},transition:s={},...o}=n||{};o={...o,...i};for(const e in o)qn(t,e,Zn(o[e]))}(t,r)});c.length?Promise.all(c).then(e):e()}return c}function si(t,e,n={}){const i=Hn(t,e,"exit"===n.type?t.presenceContext?.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const o=i?()=>Promise.all(ii(t,i,n)):()=>Promise.resolve(),r=t.variantChildren&&t.variantChildren.size?(i=0)=>{const{delayChildren:o=0,staggerChildren:r,staggerDirection:a}=s;return function(t,e,n=0,i=0,s=0,o=1,r){const a=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),a.push(si(l,e,{...r,delay:n+("function"==typeof i?0:i)+Dn(t.variantChildren,l,i,s,o)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(a)}(t,e,i,o,r,a,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[t,e]="beforeChildren"===a?[o,r]:[r,o];return t().then(()=>e())}return Promise.all([o(),r(n.delay)])}const oi=t=>e=>e.test(t),ri=[ft,Ct,Vt,Mt,Dt,kt,{test:t=>"auto"===t,parse:t=>t}],ai=t=>ri.find(oi(t));function li(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||b(t))}const hi=new Set(["brightness","contrast","saturate","opacity"]);function ui(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(xt)||[];if(!i)return t;const s=n.replace(i,"");let o=hi.has(e)?1:0;return i!==n&&(o*=100),e+"("+o+s+")"}const ci=/\b([a-z-]*)\(.*?\)/gu,di={...$t,getAnimatableNone:t=>{const e=t.match(ci);return e?e.map(ui).join(" "):t}},pi={...$t,getAnimatableNone:t=>{const e=$t.parse(t);return $t.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},mi={...ft,transform:Math.round},fi={borderWidth:Ct,borderTopWidth:Ct,borderRightWidth:Ct,borderBottomWidth:Ct,borderLeftWidth:Ct,borderRadius:Ct,borderTopLeftRadius:Ct,borderTopRightRadius:Ct,borderBottomRightRadius:Ct,borderBottomLeftRadius:Ct,width:Ct,maxWidth:Ct,height:Ct,maxHeight:Ct,top:Ct,right:Ct,bottom:Ct,left:Ct,inset:Ct,insetBlock:Ct,insetBlockStart:Ct,insetBlockEnd:Ct,insetInline:Ct,insetInlineStart:Ct,insetInlineEnd:Ct,padding:Ct,paddingTop:Ct,paddingRight:Ct,paddingBottom:Ct,paddingLeft:Ct,paddingBlock:Ct,paddingBlockStart:Ct,paddingBlockEnd:Ct,paddingInline:Ct,paddingInlineStart:Ct,paddingInlineEnd:Ct,margin:Ct,marginTop:Ct,marginRight:Ct,marginBottom:Ct,marginLeft:Ct,marginBlock:Ct,marginBlockStart:Ct,marginBlockEnd:Ct,marginInline:Ct,marginInlineStart:Ct,marginInlineEnd:Ct,fontSize:Ct,backgroundPositionX:Ct,backgroundPositionY:Ct,...{rotate:Mt,pathRotation:Mt,rotateX:Mt,rotateY:Mt,rotateZ:Mt,scale:gt,scaleX:gt,scaleY:gt,scaleZ:gt,skew:Mt,skewX:Mt,skewY:Mt,distance:Ct,translateX:Ct,translateY:Ct,translateZ:Ct,x:Ct,y:Ct,z:Ct,perspective:Ct,transformPerspective:Ct,opacity:yt,originX:Rt,originY:Rt,originZ:Ct},zIndex:mi,fillOpacity:yt,strokeOpacity:yt,numOctaves:mi},yi={...fi,color:Bt,backgroundColor:Bt,outlineColor:Bt,fill:Bt,stroke:Bt,borderColor:Bt,borderTopColor:Bt,borderRightColor:Bt,borderBottomColor:Bt,borderLeftColor:Bt,filter:di,WebkitFilter:di,mask:pi,WebkitMask:pi},gi=t=>yi[t],vi=new Set([di,pi]);function xi(t,e){let n=gi(t);return vi.has(n)||(n=$t),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const wi=new Set(["auto","none","0"]);class Ti extends ln{constructor(t,e,n,i,s){super(t,e,n,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n{t.getValue(e).set(n)}),this.resolveNoneKeyframes()}}const Si=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function Pi(t,e,n){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){let e=document;const i=n?.[t]??e.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t).filter(t=>null!=t)}const bi=(t,e)=>e&&"number"==typeof t?e.transform(t):t;const{schedule:Ei}=et(queueMicrotask,!1),Ai={x:!1,y:!1};function Mi(){return Ai.x||Ai.y}function Vi(t,e){const n=Pi(t),i=new AbortController;return[n,{passive:!0,...e,signal:i.signal},()=>i.abort()]}function Ci(t,e,n={}){const[i,s,o]=Vi(t,n);return i.forEach(t=>{let n,i=!1,o=!1;const r=e=>{n&&(n(e),n=void 0),t.removeEventListener("pointerleave",l)},a=t=>{i=!1,window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",a),o&&(o=!1,r(t))},l=t=>{"touch"!==t.pointerType&&(i?o=!0:r(t))};t.addEventListener("pointerenter",i=>{if("touch"===i.pointerType||Mi())return;o=!1;const r=e(t,i);"function"==typeof r&&(n=r,t.addEventListener("pointerleave",l,s))},s),t.addEventListener("pointerdown",()=>{i=!0,window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",a,s)},s)}),o}const ki=(t,e)=>!!e&&(t===e||ki(t,e.parentElement)),Di=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,Ri=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const Li=new Set(["INPUT","SELECT","TEXTAREA"]);const Bi=new WeakSet;function ji(t){return e=>{"Enter"===e.key&&t(e)}}function Fi(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function Ii(t){return Di(t)&&!Mi()}const Oi=new WeakSet;function Ui(t,e,n={}){const[i,s,o]=Vi(t,n),r=t=>{const i=t.currentTarget;if(!Ii(t))return;if(Oi.has(t))return;Bi.add(i),n.stopPropagation&&Oi.add(t);const o=e(i,t),r={...s,capture:!0},a=(t,e)=>{window.removeEventListener("pointerup",l,r),window.removeEventListener("pointercancel",h,r),Bi.has(i)&&Bi.delete(i),Ii(t)&&"function"==typeof o&&o(t,{success:e})},l=t=>{a(t,i===window||i===document||n.useGlobalTarget||ki(i,t.target))},h=t=>{a(t,!1)};window.addEventListener("pointerup",l,r),window.addEventListener("pointercancel",h,r)};return i.forEach(t=>{var e;(n.useGlobalTarget?window:t).addEventListener("pointerdown",r,s),P(e=t)&&"offsetHeight"in e&&!("ownerSVGElement"in e)&&(t.addEventListener("focus",t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const i=ji(()=>{if(Bi.has(n))return;Fi(n,"down");const t=ji(()=>{Fi(n,"up")});n.addEventListener("keyup",t,e),n.addEventListener("blur",()=>Fi(n,"cancel"),e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)})(t,s)),function(t){return Ri.has(t.tagName)||!0===t.isContentEditable}(t)||t.hasAttribute("tabindex")||(t.tabIndex=0))}),o}function Wi(t){return P(t)&&"ownerSVGElement"in t}const Ni=new WeakMap;let $i;const zi=(t,e,n)=>(i,s)=>s&&s[0]?s[0][t+"Size"]:Wi(i)&&"getBBox"in i?i.getBBox()[e]:i[n],Yi=zi("inline","width","offsetWidth"),Xi=zi("block","height","offsetHeight");function Hi({target:t,borderBoxSize:e}){Ni.get(t)?.forEach(n=>{n(t,{get width(){return Yi(t,e)},get height(){return Xi(t,e)}})})}function Ki(t){t.forEach(Hi)}function Gi(t,e){$i||"undefined"!=typeof ResizeObserver&&($i=new ResizeObserver(Ki));const n=Pi(t);return n.forEach(t=>{let n=Ni.get(t);n||(n=new Set,Ni.set(t,n)),n.add(e),$i?.observe(t)}),()=>{n.forEach(t=>{const n=Ni.get(t);n?.delete(e),n?.size||$i?.unobserve(t)})}}const qi=new Set;let Zi;function _i(t){return qi.add(t),Zi||(Zi=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};qi.forEach(e=>e(t))},window.addEventListener("resize",Zi)),()=>{qi.delete(t),qi.size||"function"!=typeof Zi||(window.removeEventListener("resize",Zi),Zi=void 0)}}function Ji(t,e){return"function"==typeof t?_i(t):Gi(t,e)}const Qi=[...ri,Bt,$t],ts=()=>({x:{min:0,max:0},y:{min:0,max:0}}),es=new WeakMap;function ns(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function is(t){return"string"==typeof t||Array.isArray(t)}const ss=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],os=["initial",...ss];function rs(t){return ns(t.animate)||os.some(e=>is(t[e]))}function as(t){return Boolean(rs(t)||t.variants)}const ls={current:null},hs={current:!1},us="undefined"!=typeof window;const cs=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let ds={};function ps(t){ds=t}class ms{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:i,skipAnimations:s,blockInitialAnimation:o,visualState:r},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=ln,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const t=lt.now();this.renderScheduledAtthis.bindToMotionValue(e,t)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(hs.current||function(){if(hs.current=!0,us)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>ls.current=t.matches;t.addEventListener("change",e),e()}else ls.current=!1}(),this.shouldReduceMotion=ls.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),it(this.notifyUpdate),it(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,e){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),e.accelerate&&En.has(t)&&this.current instanceof HTMLElement){const{factory:n,keyframes:i,times:s,ease:o,duration:r}=e.accelerate,a=new xn({element:this.current,name:t,keyframes:i,times:s,ease:o,duration:k(r)}),l=n(a);return void this.valueSubscriptions.set(t,()=>{l(),a.cancel()})}const n=Ze.has(t);n&&this.onBindTransform&&this.onBindTransform();const i=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&nt.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let s;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{i(),s&&s()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in ds){const e=ds[t];if(!e)continue;const{isEnabled:n,Feature:i}=e;if(!this.features[t]&&i&&n(this.props)&&(this.features[t]=new i(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;ee.variantChildren.delete(t)}addValue(t,e){const n=this.values.get(t);e!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=Ln(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,e){let n=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var i;return null!=n&&("string"==typeof n&&(S(n)||b(n))?n=parseFloat(n):(i=n,!Qi.find(oi(i))&&$t.test(e)&&(n=xi(t,e))),this.setBaseTarget(t,_n(n)?n.get():n)),_n(n)?n.get():n}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let n;if("string"==typeof e||"object"==typeof e){const i=Xn(this.props,e,this.presenceContext?.custom);i&&(n=i[t])}if(e&&void 0!==n)return n;const i=this.getBaseTargetFromProps(this.props,t);return void 0===i||_n(i)?void 0!==this.initialValues[t]&&void 0===n?void 0:this.baseTarget[t]:i}on(t,e){return this.events[t]||(this.events[t]=new C),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){Ei.render(this.render)}}class fs extends ms{constructor(){super(...arguments),this.KeyframeResolver=Ti}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){const n=t.style;return n?n[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;_n(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}class ys{constructor(t){this.isMounted=!1,this.node=t}update(){}}function gs({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function vs(t){return void 0===t||1===t}function xs({scale:t,scaleX:e,scaleY:n}){return!vs(t)||!vs(e)||!vs(n)}function ws(t){return xs(t)||Ts(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Ts(t){return Ss(t.x)||Ss(t.y)}function Ss(t){return t&&"0%"!==t}function Ps(t,e,n){return n+e*(t-n)}function bs(t,e,n,i,s){return void 0!==s&&(t=Ps(t,s,i)),Ps(t,n,i)+e}function Es(t,e=0,n=1,i,s){t.min=bs(t.min,e,n,i,s),t.max=bs(t.max,e,n,i,s)}function As(t,{x:e,y:n}){Es(t.x,e.translate,e.scale,e.originPoint),Es(t.y,n.translate,n.scale,n.originPoint)}const Ms=.999999999999,Vs=1.0000000000001;function Cs(t,e){t.min+=e,t.max+=e}function ks(t,e,n,i,s=.5){Es(t,e,n,Xt(t.min,t.max,s),i)}function Ds(t,e){return"string"==typeof t?parseFloat(t)/100*(e.max-e.min):t}function Rs(t,e,n){const i=n??t;ks(t.x,Ds(e.x,i.x),e.scaleX,e.scale,e.originX),ks(t.y,Ds(e.y,i.y),e.scaleY,e.scale,e.originY)}function Ls(t,e){return gs(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),i=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}(t.getBoundingClientRect(),e))}const Bs={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},js=qe.length;function Fs(t,e,n){const{style:i,vars:s,transformOrigin:o}=t;let r=!1,a=!1;for(const t in e){const n=e[t];if(Ze.has(t))r=!0;else if(ut(t))s[t]=n;else{const e=bi(n,fi[t]);t.startsWith("origin")?(a=!0,o[t]=e):i[t]=e}}if(e.transform||(r||n?i.transform=function(t,e,n){let i="",s=!0;for(let o=0;o{if(!e.target)return t;if("string"==typeof t){if(!Ct.test(t))return t;t=parseFloat(t)}return`${Os(t,e.target.x)}% ${Os(t,e.target.y)}%`}},Ws={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,s=$t.parse(t);if(s.length>5)return i;const o=$t.createTransformer(t),r="number"!=typeof s[0]?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;s[0+r]/=a,s[1+r]/=l;const h=Xt(a,l,.5);return"number"==typeof s[2+r]&&(s[2+r]/=h),"number"==typeof s[3+r]&&(s[3+r]/=h),o(s)}},Ns={borderRadius:{...Us,applyTo:[...Si]},borderTopLeftRadius:Us,borderTopRightRadius:Us,borderBottomLeftRadius:Us,borderBottomRightRadius:Us,boxShadow:Ws};function $s(t,{layout:e,layoutId:n}){return Ze.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!Ns[t]||"opacity"===t)}function zs(t,e,n){const i=t.style,s=e?.style,o={};if(!i)return o;for(const e in i)(_n(i[e])||s&&_n(s[e])||$s(e,t)||void 0!==n?.getValue(e)?.liveStyle)&&(o[e]=i[e]);return o}class Ys extends fs{constructor(){super(...arguments),this.type="html",this.renderInstance=Is}mount(t){w(Boolean(t.style),"motion.create() components must forward their ref to a HTML or SVG element","custom-component-ref"),super.mount(t)}readValueFromInstance(t,e){if(Ze.has(e))return this.projection?.isProjecting?He(e):((t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Ke(n,e)})(t,e);{const i=(n=t,window.getComputedStyle(n)),s=(ut(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof s?s.trim():s}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return Ls(t,e)}build(t,e,n){Fs(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return zs(t,e,n)}}const Xs={offset:"stroke-dashoffset",array:"stroke-dasharray"},Hs={offset:"strokeDashoffset",array:"strokeDasharray"};const Ks=["transform","opacity","offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Gs(t,{attrX:e,attrY:n,attrScale:i,pathLength:s,pathSpacing:o=1,pathOffset:r=0,...a},l,h,u){if(Fs(t,a,h),l)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:c,style:d}=t;for(const t of Ks)void 0!==c[t]&&(d[t]=c[t],delete c[t]);(d.transform||c.transformOrigin)&&(d.transformOrigin=c.transformOrigin??"50% 50%",delete c.transformOrigin),d.transform&&(d.transformBox=u?.transformBox??"fill-box",delete c.transformBox),void 0!==e&&(c.x=e),void 0!==n&&(c.y=n),void 0!==i&&(c.scale=i),void 0!==s&&function(t,e,n=1,i=0,s=!0){t.pathLength=1;const o=s?Xs:Hs;t[o.offset]=""+-i,t[o.array]=`${e} ${n}`}(c,s,o,r,!1)}const qs=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),Zs=t=>"string"==typeof t&&"svg"===t.toLowerCase();function _s(t,e,n){const i=zs(t,e,n);for(const n in t)if(_n(t[n])||_n(e[n])){i[-1!==qe.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]}return i}class Js extends fs{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ts}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(Ze.has(e)){const t=gi(e);return t&&t.default||0}if(Ks.includes(e)){const n=getComputedStyle(t)[e];if("string"==typeof n&&n)return n.trim()}return e=qs.has(e)?e:Qn(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return _s(t,e,n)}build(t,e,n){Gs(t,e,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,e,n,i){!function(t,e,n,i){Is(t,e,void 0,i);for(const n in e.attrs)t.setAttribute(qs.has(n)?n:Qn(n),e.attrs[n])}(t,e,0,i)}mount(t){this.isSVGTag=Zs(t.tagName),super.mount(t)}}const Qs=os.length;function to(t){if(!t)return;if(!t.isControllingVariants){const e=t.parent&&to(t.parent)||{};return void 0!==t.props.initial&&(e.initial=t.props.initial),e}const e={};for(let n=0;nPromise.all(e.map(({animation:e,options:n})=>function(t,e,n={}){let i;if(t.notify("AnimationStart",e),Array.isArray(e)){const s=e.map(e=>si(t,e,n));i=Promise.all(s)}else if("string"==typeof e)i=si(t,e,n);else{const s="function"==typeof e?Hn(t,e,n.custom):e;i=Promise.all(ii(t,s,n))}return i.then(()=>{t.notify("AnimationComplete",e)})}(t,e,n)))}function oo(t){let e=so(t),n=lo(),i=!0,s=!1;const o=e=>(n,i)=>{const s=Hn(t,i,"exit"===e?t.presenceContext?.custom:void 0);if(s){const{transition:t,transitionEnd:e,...i}=s;n={...n,...i,...e}}return n};function r(r){const{props:a}=t,l=to(t.parent)||{},h=[],u=new Set;let c={},d=1/0;for(let e=0;ed&&y,T=!1;const S=Array.isArray(f)?f:[f];let P=S.reduce(o(p),{});!1===g&&(P={});const{prevResolvedValues:b={}}=m,E={...b,...P},A=e=>{w=!0,u.has(e)&&(T=!0,u.delete(e)),m.needsAnimating[e]=!0;const n=t.getValue(e);n&&(n.liveStyle=!1)};for(const t in E){const e=P[t],n=b[t];if(c.hasOwnProperty(t))continue;let i=!1;i=Gn(e)&&Gn(n)?!eo(e,n)||x:e!==n,i?null!=e?A(t):u.add(t):void 0!==e&&u.has(t)?A(t):m.protectedKeys[t]=!0}m.prevProp=f,m.prevResolvedValues=P,m.isActive&&(c={...c,...P}),(i||s)&&t.blockInitialAnimation&&(w=!1);const M=v&&x;w&&(!M||T)&&h.push(...S.map(e=>{const n={type:p};if("string"==typeof e&&(i||s)&&!M&&t.manuallyAnimateOnMount&&t.parent){const{parent:i}=t,s=Hn(i,e);if(i.enteringChildren&&s){const{delayChildren:e}=s.transition||{};n.delay=Dn(i.enteringChildren,t,e)}}return{animation:e,options:n}}))}if(u.size){const e={};if("boolean"!=typeof a.initial){const n=Hn(t,Array.isArray(a.initial)?a.initial[0]:a.initial);n&&n.transition&&(e.transition=n.transition)}u.forEach(n=>{const i=t.getBaseTarget(n),s=t.getValue(n);s&&(s.liveStyle=!0),e[n]=i??null}),h.push({animation:e})}let p=Boolean(h.length);return!i||!1!==a.initial&&a.initial!==a.animate||t.manuallyAnimateOnMount||(p=!1),i=!1,s=!1,p?e(h):Promise.resolve()}return{animateChanges:r,setActive:function(e,i){if(n[e].isActive===i)return Promise.resolve();t.variantChildren?.forEach(t=>t.animationState?.setActive(e,i)),n[e].isActive=i;const s=r(e);for(const t in n)n[t].protectedKeys={};return s},setAnimateFunction:function(n){e=n(t)},getState:()=>n,reset:()=>{n=lo(),s=!0}}}function ro(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!eo(e,t)}function ao(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function lo(){return{animate:ao(!0),whileInView:ao(),whileHover:ao(),whileTap:ao(),whileDrag:ao(),whileFocus:ao(),exit:ao()}}function ho(t,e){t.min=e.min,t.max=e.max}function uo(t,e){ho(t.x,e.x),ho(t.y,e.y)}function co(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function po(t){return t.max-t.min}function mo(t,e,n,i=.5){t.origin=i,t.originPoint=Xt(e.min,e.max,t.origin),t.scale=po(n)/po(e),t.translate=Xt(n.min,n.max,t.origin)-t.originPoint,(t.scale>=.9999&&t.scale<=1.0001||isNaN(t.scale))&&(t.scale=1),(t.translate>=-.01&&t.translate<=.01||isNaN(t.translate))&&(t.translate=0)}function fo(t,e,n,i){mo(t.x,e.x,n.x,i?i.originX:void 0),mo(t.y,e.y,n.y,i?i.originY:void 0)}function yo(t,e,n,i=0){const s=i?Xt(n.min,n.max,i):n.min;t.min=s+e.min,t.max=t.min+po(e)}function go(t,e,n,i=0){const s=i?Xt(n.min,n.max,i):n.min;t.min=e.min-s,t.max=t.min+po(e)}function vo(t,e,n,i){go(t.x,e.x,n.x,i?.x),go(t.y,e.y,n.y,i?.y)}function xo(t,e,n,i,s){return t=Ps(t-=e,1/n,i),void 0!==s&&(t=Ps(t,1/s,i)),t}function wo(t,e,[n,i,s],o,r){!function(t,e=0,n=1,i=.5,s,o=t,r=t){Vt.test(e)&&(e=parseFloat(e),e=Xt(r.min,r.max,e/100)-r.min);if("number"!=typeof e)return;let a=Xt(o.min,o.max,i);t===o&&(a-=e),t.min=xo(t.min,e,n,a,s),t.max=xo(t.max,e,n,a,s)}(t,e[n],e[i],e[s],e.scale,o,r)}const To=["x","scaleX","originX"],So=["y","scaleY","originY"];function Po(t,e,n,i){wo(t.x,e,To,n?n.x:void 0,i?i.x:void 0),wo(t.y,e,So,n?n.y:void 0,i?i.y:void 0)}function bo(t){return 0===t.translate&&1===t.scale}function Eo(t){return bo(t.x)&&bo(t.y)}function Ao(t,e){return t.min===e.min&&t.max===e.max}function Mo(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Vo(t,e){return Mo(t.x,e.x)&&Mo(t.y,e.y)}function Co(t){return po(t.x)/po(t.y)}function ko(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function Do(t){return[t("x"),t("y")]}const Ro=Si.length,Lo=t=>"string"==typeof t?parseFloat(t):t,Bo=t=>"number"==typeof t||Ct.test(t);function jo(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const Fo=Oo(0,.5,$),Io=Oo(.5,.95,A);function Oo(t,e,n){return i=>ie?1:n(V(t,e,i))}function Uo(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n,i)}const Wo=(t,e)=>t.depth-e.depth;class No{constructor(){this.children=[],this.isDirty=!1}add(t){f(this.children,t),this.isDirty=!0}remove(t){y(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Wo),this.isDirty=!1,this.children.forEach(t)}}function $o(t){return _n(t)?t.get():t}class zo{constructor(){this.members=[]}add(t){f(this.members,t);for(let e=this.members.length-1;e>=0;e--){const n=this.members[e];if(n===t||n===this.lead||n===this.prevLead)continue;const i=n.instance;i&&!1!==i.isConnected||n.snapshot||(y(this.members,n),n.unmount())}t.scheduleRender()}remove(t){if(y(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){for(let e=this.members.indexOf(t)-1;e>=0;e--){const t=this.members[e];if(!1!==t.isPresent&&!1!==t.instance?.isConnected)return this.promote(t),!0}return!1}promote(t,e){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.updateSnapshot(),t.scheduleRender();const{layoutDependency:i}=n.options,{layoutDependency:s}=t.options;void 0!==i&&i===s||(t.resumeFrom=n,e&&(n.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root?.isUpdating&&(t.isLayoutDirty=!0)),!1===t.options.crossfade&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{t.options.onExitComplete?.(),t.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}const Yo={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Xo=["","X","Y","Z"];let Ho=0;function Ko(t,e,n,i){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),i&&(i[t]=0))}function Go(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=ei(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:e,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",nt,!(e||i))}const{parent:i}=t;i&&!i.hasCheckedOptimisedAppear&&Go(i)}function qo({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:i,resetTransform:s}){return class{constructor(t={},n=e?.()){this.id=Ho++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(Jo),this.nodes.forEach(ar),this.nodes.forEach(lr),this.nodes.forEach(Qo)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=t,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let t=0;tthis.root.updateBlockedByResize=!1;nt.read(()=>{i=window.innerWidth}),t(e,()=>{const t=window.innerWidth;t!==i&&(i=t,this.root.updateBlockedByResize=!0,n&&n(),n=function(t,e){const n=lt.now(),i=({timestamp:s})=>{const o=s-n;o>=e&&(it(i),t(o-e))};return nt.setup(i,!0),()=>it(i)}(s,250),Yo.hasAnimatedSinceResize&&(Yo.hasAnimatedSinceResize=!1,this.nodes.forEach(rr)))})}i&&this.root.registerSharedNode(i,this),!1!==this.options.animate&&o&&(i||s)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeLayoutChanged:n,layout:i})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const s=this.options.transition||o.getDefaultTransition()||mr,{onLayoutAnimationStart:r,onLayoutAnimationComplete:a}=o.getProps(),l=!this.targetLayout||!Vo(this.targetLayout,i),h=!e&&n;if(this.options.layoutRoot||this.resumeFrom||h||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const e={...jn(s,"layout"),onPlay:r,onComplete:a};(o.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e),this.setAnimationOrigin(t,h,e.path)}else e||rr(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=i})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const t=this.getStack();t&&t.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),it(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(hr),this.animationId++)}getTransformTemplate(){const{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Go(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||po(this.snapshot.measuredBox.x)||po(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;tMs&&(e.x=1),e.yMs&&(e.y=1)}(this.layoutCorrected,this.treeScale,this.path,e),!t.layout||t.target||1===this.treeScale.x&&1===this.treeScale.y||(t.target=t.layout.layoutBox,t.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}});const{target:a}=t;a?(this.projectionDelta&&this.prevProjectionDelta?(co(this.prevProjectionDelta.x,this.projectionDelta.x),co(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),fo(this.projectionDelta,this.layoutCorrected,a,this.latestValues),this.treeScale.x===o&&this.treeScale.y===r&&ko(this.projectionDelta.x,this.prevProjectionDelta.x)&&ko(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",a))):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){if(this.options.visualElement?.scheduleRender(),t){const t=this.getStack();t&&t.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}}setAnimationOrigin(t,e=!1,n){const i=this.snapshot,s=i?i.latestValues:{},o={...this.latestValues},r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!e;const a={x:{min:0,max:0},y:{min:0,max:0}},l=(i?i.source:void 0)!==(this.layout?this.layout.source:void 0),h=this.getStack(),u=!h||h.members.length<=1,c=Boolean(l&&!u&&!0===this.options.crossfade&&!this.path.some(pr));let d;this.animationProgress=0;const p=n?.interpolateProjection(t);this.mixTargetDelta=e=>{const n=e/1e3,i=p?.(n);var h,m,f,y,g,v;i?(r.x.translate=i.x,r.x.scale=Xt(t.x.scale,1,n),r.x.origin=t.x.origin,r.x.originPoint=t.x.originPoint,r.y.translate=i.y,r.y.scale=Xt(t.y.scale,1,n),r.y.origin=t.y.origin,r.y.originPoint=t.y.originPoint):(cr(r.x,t.x,n),cr(r.y,t.y,n)),this.setTargetDelta(r),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(vo(a,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),f=this.relativeTarget,y=this.relativeTargetOrigin,g=a,v=n,dr(f.x,y.x,g.x,v),dr(f.y,y.y,g.y,v),d&&(h=this.relativeTarget,m=d,Ao(h.x,m.x)&&Ao(h.y,m.y))&&(this.isProjectionDirty=!1),d||(d={x:{min:0,max:0},y:{min:0,max:0}}),uo(d,this.relativeTarget)),l&&(this.animationValues=o,function(t,e,n,i,s,o){s?(t.opacity=Xt(0,n.opacity??1,Fo(i)),t.opacityExit=Xt(e.opacity??1,0,Io(i))):o&&(t.opacity=Xt(e.opacity??1,n.opacity??1,i));for(let s=0;s{Yo.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Ln(0)),this.motionValue.jump(0,!1),this.currentAnimation=function(t,e,n){const i=_n(t)?t:Ln(t);return i.start(Nn("",i,e,n)),i.animation}(this.motionValue,[0,1e3],{...t,velocity:0,isSync:!0,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onComplete:()=>{t.onComplete&&t.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const t=this.getStack();t&&t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead();let{targetWithTransforms:e,target:n,layout:i,latestValues:s}=t;if(e&&n&&i){if(this!==t&&this.layout&&i&&vr(this.options.animationType,this.layout.layoutBox,i.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=po(this.layout.layoutBox.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const i=po(this.layout.layoutBox.y);n.y.min=t.target.y.min,n.y.max=n.y.min+i}uo(e,n),Rs(e,s),fo(this.projectionDeltaWithTransform,this.layoutCorrected,e,s)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new zo);this.sharedNodes.get(t).add(e);const n=e.options.initialPromotionConfig;e.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(e):void 0})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){const{layoutId:t}=this.options;return t&&this.getStack()?.lead||this}getPrevLead(){const{layoutId:t}=this.options;return t?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:n}={}){const i=this.getStack();i&&i.promote(this,n),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetSkewAndRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const{latestValues:n}=t;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(e=!0),!e)return;const i={};n.z&&Ko("z",t,i,this.animationValues);for(let e=0;et.currentAnimation?.stop()),this.root.nodes.forEach(er),this.root.sharedNodes.clear()}}}function Zo(t){t.updateLayout()}function _o(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=t.layout,{animationType:s}=t.options,o=e.source!==t.layout.source;if("size"===s)Do(t=>{const i=o?e.measuredBox[t]:e.layoutBox[t],s=po(i);i.min=n[t].min,i.max=i.min+s});else if("x"===s||"y"===s){const t="x"===s?"y":"x";ho(o?e.measuredBox[t]:e.layoutBox[t],n[t])}else vr(s,e.layoutBox,n)&&Do(i=>{const s=o?e.measuredBox[i]:e.layoutBox[i],r=po(n[i]);s.max=s.min+r,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[i].max=t.relativeTarget[i].min+r)});const r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};fo(r,n,e.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};o?fo(a,t.applyTransform(i,!0),e.measuredBox):fo(a,n,e.layoutBox);const l=!Eo(r);let h=!1;if(!t.resumeFrom){const i=t.getClosestProjectingParent();if(i&&!i.resumeFrom){const{snapshot:s,layout:o}=i;if(s&&o){const r=t.options.layoutAnchor||void 0,a={x:{min:0,max:0},y:{min:0,max:0}};vo(a,e.layoutBox,s.layoutBox,r);const l={x:{min:0,max:0},y:{min:0,max:0}};vo(l,n,o.layoutBox,r),Vo(a,l)||(h=!0),i.options.layoutRoot&&(t.relativeTarget=l,t.relativeTargetOrigin=a,t.relativeParent=i)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:a,layoutDelta:r,hasLayoutChanged:l,hasRelativeLayoutChanged:h})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function Jo(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=Boolean(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function Qo(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function tr(t){t.clearSnapshot()}function er(t){t.clearMeasurements()}function nr(t){t.isLayoutDirty=!0,t.updateLayout()}function ir(t){t.isLayoutDirty=!1}function sr(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function or(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function rr(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function ar(t){t.resolveTargetDelta()}function lr(t){t.calcProjection()}function hr(t){t.resetSkewAndRotation()}function ur(t){t.removeLeadSnapshot()}function cr(t,e,n){t.translate=Xt(e.translate,0,n),t.scale=Xt(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function dr(t,e,n,i){t.min=Xt(e.min,n.min,i),t.max=Xt(e.max,n.max,i)}function pr(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const mr={duration:.45,ease:[.4,0,.1,1]},fr=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),yr=fr("applewebkit/")&&!fr("chrome/")?Math.round:A;function gr(t){t.min=yr(t.min),t.max=yr(t.max)}function vr(t,e,n){return"position"===t||"preserve-aspect"===t&&(i=Co(e),s=Co(n),o=.2,!(Math.abs(i-s)<=o));var i,s,o}function xr(t){return t!==t.root&&t.scroll?.wasRoot}const wr=qo({attachResizeListener:(t,e)=>Uo(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Tr={current:void 0},Sr=qo({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Tr.current){const t=new wr({});t.mount(window),t.setOptions({layoutScroll:!0}),Tr.current=t}return Tr.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)});function Pr(t){const{initial:e,animate:n}=function(t,e){if(rs(t)){const{initial:e,animate:n}=t;return{initial:!1===e||is(e)?e:void 0,animate:is(n)?n:void 0}}return!1!==t.inherit?e:{}}(t,i(Q));return s(()=>({initial:e,animate:n}),[br(e),br(n)])}function br(t){return Array.isArray(t)?t.join(" "):t}const Er=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Ar(t,e,n){for(const i in e)_n(e[i])||$s(i,n)||(t[i]=e[i])}function Mr(t,e){const n={};return Ar(n,t.style||{},t),Object.assign(n,function({transformTemplate:t},e){return s(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{}};return Fs(n,e,t),Object.assign({},n.vars,n.style)},[e])}(t,e)),n}function Vr(t,e){const n={},i=Mr(t,e);return t.drag&&!1!==t.dragListener&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),void 0===t.tabIndex&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=i,n}const Cr=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}});function kr(t,e,n,i){const o=s(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return Gs(n,e,Zs(i),t.transformTemplate,t.style),{...n.attrs,style:{...n.style}}},[e]);if(t.style){const e={};Ar(e,t.style,t),o.style={...e,...o.style}}return o}const Dr=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function Rr(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Dr.has(t)}function Lr(t,e){return t.startsWith("on")?!Rr(t):e?.(t)??!Rr(t)}const Br=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function jr(t){return"string"==typeof t&&!t.includes("-")&&!!(Br.indexOf(t)>-1||/[A-Z]/u.test(t))}function Fr(t,e,n,{latestValues:i},a,l=!1,h,u){const c=(h??jr(t)?kr:Vr)(e,i,a,t),d=function(t,e,n,i){const s={};for(const o in t)"values"===o&&"object"==typeof t.values||_n(t[o])||(Lr(o,i)||!0===n&&Rr(o)||!e&&!Rr(o)||t.draggable&&o.startsWith("onDrag"))&&(s[o]=t[o]);return s}(e,"string"==typeof t,l,u),p=t!==o?{...d,...c,ref:n}:{},{children:m}=e,f=s(()=>_n(m)?m.get():m,[m]);return r(t,{...p,children:f})}const Ir=n(null);function Or(t,e,n,i){const s={},o=i(t,{});for(const t in o)s[t]=$o(o[t]);let{initial:r,animate:a}=t;const l=rs(t),h=as(t);e&&h&&!l&&!1!==t.inherit&&(void 0===r&&(r=e.initial),void 0===a&&(a=e.animate));let u=!!n&&!1===n.initial;u=u||!1===r;const c=u?a:r;if(c&&"boolean"!=typeof c&&!ns(c)){const e=Array.isArray(c)?c:[c];for(let n=0;n(e,n)=>{const s=i(Q),o=i(Ir),r=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e},n,i,s){return{latestValues:Or(n,i,s,t),renderState:e()}}(t,e,s,o);return n?r():function(t){const e=a(null);return null===e.current&&(e.current=t()),e.current}(r)},Wr=Ur({scrapeMotionValuesFromProps:zs,createRenderState:Er}),Nr=Ur({scrapeMotionValuesFromProps:_s,createRenderState:Cr}),$r={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let zr=!1;function Yr(){return function(){if(zr)return;const t={};for(const e in $r)t[e]={isEnabled:t=>$r[e].some(e=>!!t[e])};ps(t),zr=!0}(),ds}const Xr=Symbol.for("motionComponentSymbol");function Hr(t,e,n){const i=a(n);l(()=>{i.current=n});const s=a(null);return h(n=>{n&&t.onMount?.(n),e&&(n?e.mount(n):e.unmount());const o=i.current;if("function"==typeof o)if(n){const t=o(n);"function"==typeof t&&(s.current=t)}else s.current?(s.current(),s.current=null):o(n);else o&&(o.current=n)},[e])}const Kr=n({});function Gr(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}const qr="undefined"!=typeof window?u:c;function Zr(t,e,n,s,o,r){const{visualElement:h}=i(Q),u=i(_),d=i(Ir),p=i(J),m=p.reducedMotion,f=p.skipAnimations,y=a(null),g=a(!1);s=s||u.renderer,!y.current&&s&&(y.current=s(t,{visualState:e,parent:h,props:n,presenceContext:d,blockInitialAnimation:!!d&&!1===d.initial,reducedMotionConfig:m,skipAnimations:f,isSVG:r}),g.current&&y.current&&(y.current.manuallyAnimateOnMount=!0));const v=y.current,x=i(Kr);!v||v.projection||!o||"html"!==v.type&&"svg"!==v.type||function(t,e,n,i){const{layoutId:s,layout:o,drag:r,dragConstraints:a,layoutScroll:l,layoutRoot:h,layoutAnchor:u,layoutCrossfade:c}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:_r(t.parent)),t.projection.setOptions({layoutId:s,layout:o,alwaysMeasureLayout:Boolean(r)||a&&Gr(a),visualElement:t,animationType:"string"==typeof o?o:"both",initialPromotionConfig:i,crossfade:c,layoutScroll:l,layoutRoot:h,layoutAnchor:u})}(y.current,n,o,x);const w=a(!1);l(()=>{v&&w.current&&v.update(n,d)});const T=n[ti],S=a(Boolean(T)&&"undefined"!=typeof window&&!window.MotionHandoffIsComplete?.(T)&&window.MotionHasOptimisedAnimation?.(T));return qr(()=>{g.current=!0,v&&(w.current=!0,window.MotionIsMounted=!0,v.updateFeatures(),v.scheduleRenderMicrotask(),S.current&&v.animationState&&v.animationState.animateChanges())}),c(()=>{v&&(!S.current&&v.animationState&&v.animationState.animateChanges(),S.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(T)}),S.current=!1),v.enteringChildren=void 0)}),v}function _r(t){if(t)return!1!==t.options.allowProjection?t.projection:_r(t.parent)}function Jr(n,{forwardMotionProps:s=!1,type:o}={},r,a){r&&function(t){const e=Yr();for(const n in t)e[n]={...e[n],...t[n]};ps(e)}(r);const l=o?"svg"===o:jr(n),h=l?Nr:Wr;function u(o,r){let u;const c={...i(J),...o,layoutId:Qr(o)},{isStatic:d,isValidProp:p}=c,m=Pr(o),f=h(o,d);if(!d&&"undefined"!=typeof window){i(_).strict;const t=function(t){const e=Yr(),{drag:n,layout:i}=e;if(!n&&!i)return{};const s={...n,...i};return{MeasureLayout:n?.isEnabled(t)||i?.isEnabled(t)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}(c);u=t.MeasureLayout,m.visualElement=Zr(n,f,c,a,t.ProjectionNode,l)}return t(Q.Provider,{value:m,children:[u&&m.visualElement?e(u,{visualElement:m.visualElement,...c}):null,Fr(n,o,Hr(f,m.visualElement,r),f,d,s,l,p)]})}u.displayName=`motion.${"string"==typeof n?n:`create(${n.displayName??n.name??""})`}`;const c=d(u);return c[Xr]=n,c}function Qr({layoutId:t}){const e=i(Z).id;return e&&void 0!==t?e+"-"+t:t}const ta=(t,e)=>e.isSVG??jr(t)?new Js(e):new Ys(e,{allowProjection:t!==o});let ea=0;const na={animation:{Feature:class extends ys{constructor(t){super(t),t.animationState||(t.animationState=oo(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();ns(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}},exit:{Feature:class extends ys{constructor(){super(...arguments),this.id=ea++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:e}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===n)return;if(t&&!1===n){if(this.isExitComplete){const{initial:t,custom:e}=this.node.getProps();if("string"==typeof t||"object"==typeof t&&null!==t&&!Array.isArray(t)){const n=Hn(this.node,t,e);if(n){const{transition:t,transitionEnd:e,...i}=n;for(const t in i)this.node.getValue(t)?.jump(i[t])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);return void(this.isExitComplete=!1)}const i=this.node.animationState.setActive("exit",!t);e&&!t&&i.then(()=>{this.isExitComplete=!0,e(this.id)})}mount(){const{register:t,onExitComplete:e}=this.node.presenceContext||{};e&&e(this.id),t&&(this.unmount=t(this.id))}unmount(){}}}};function ia(t){return{point:{x:t.pageX,y:t.pageY}}}function sa(t,e,n,i){return Uo(t,e,(t=>e=>Di(e)&&t(e,ia(e)))(n),i)}const oa=({current:t})=>t?t.ownerDocument.defaultView:null,ra=(t,e)=>Math.abs(t-e);const aa=new Set(["auto","scroll"]);class la{constructor(t,e,{transformPagePoint:n,contextWindow:i=window,dragSnapToOrigin:s=!1,distanceThreshold:o=3,element:r}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=t=>{this.handleScroll(t.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=ha(this.lastRawMoveEventInfo,this.transformPagePoint));const t=ca(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=function(t,e){const n=ra(t.x,e.x),i=ra(t.y,e.y);return Math.sqrt(n**2+i**2)}(t.offset,{x:0,y:0})>=this.distanceThreshold;if(!e&&!n)return;const{point:i}=t,{timestamp:s}=st;this.history.push({...i,timestamp:s});const{onStart:o,onMove:r}=this.handlers;e||(o&&o(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),r&&r(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastRawMoveEventInfo=e,this.lastMoveEventInfo=ha(e,this.transformPagePoint),nt.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();const{onEnd:n,onSessionEnd:i,resumeAnimation:s}=this.handlers;if(!this.dragSnapToOrigin&&this.startEvent||s&&s(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const o=ca("pointercancel"===t.type?this.lastMoveEventInfo:ha(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,o),i&&i(t,o)},!Di(t))return;this.dragSnapToOrigin=s,this.handlers=e,this.transformPagePoint=n,this.distanceThreshold=o,this.contextWindow=i||window;const a=ha(ia(t),this.transformPagePoint),{point:l}=a,{timestamp:h}=st;this.history=[{...l,timestamp:h}];const{onSessionStart:u}=e;u&&u(t,ca(a,this.history));const c={passive:!0,capture:!0};this.removeListeners=M(sa(this.contextWindow,"pointermove",this.handlePointerMove,c),sa(this.contextWindow,"pointerup",this.handlePointerUp,c),sa(this.contextWindow,"pointercancel",this.handlePointerUp,c)),r&&this.startScrollTracking(r)}startScrollTracking(t){let e=t.parentElement;for(;e;){const t=getComputedStyle(e);(aa.has(t.overflowX)||aa.has(t.overflowY))&&this.scrollPositions.set(e,{x:e.scrollLeft,y:e.scrollTop}),e=e.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const e=this.scrollPositions.get(t);if(!e)return;const n=t===window,i=n?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},s=i.x-e.x,o=i.y-e.y;0===s&&0===o||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=s,this.lastMoveEventInfo.point.y+=o):this.history.length>0&&(this.history[0].x-=s,this.history[0].y-=o),this.scrollPositions.set(t,i),nt.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),it(this.updatePoint)}}function ha(t,e){return e?{point:e(t.point)}:t}function ua(t,e){return{x:t.x-e.x,y:t.y-e.y}}function ca({point:t},e){return{point:t,delta:ua(t,pa(e)),offset:ua(t,da(e)),velocity:ma(e,.1)}}function da(t){return t[0]}function pa(t){return t[t.length-1]}function ma(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const s=pa(t);for(;n>=0&&(i=t[n],!(s.timestamp-i.timestamp>k(e)));)n--;if(!i)return{x:0,y:0};i===t[0]&&t.length>2&&s.timestamp-i.timestamp>2*k(e)&&(i=t[1]);const o=D(s.timestamp-i.timestamp);if(0===o)return{x:0,y:0};const r={x:(s.x-i.x)/o,y:(s.y-i.y)/o};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function fa(t,e,n){return{min:void 0!==e?t.min+e:void 0,max:void 0!==n?t.max+n-(t.max-t.min):void 0}}function ya(t,e){let n=e.min-t.min,i=e.max-t.max;return e.max-e.min{e&&this.snapToCursor(ia(t).point),this.stopAnimation()},onStart:(t,e)=>{const{drag:n,dragPropagation:i,onDragStart:s}=this.getProps();if(n&&!i&&(this.openDragLock&&this.openDragLock(),this.openDragLock="x"===(o=n)||"y"===o?Ai[o]?null:(Ai[o]=!0,()=>{Ai[o]=!1}):Ai.x||Ai.y?null:(Ai.x=Ai.y=!0,()=>{Ai.x=Ai.y=!1}),!this.openDragLock))return;var o;this.latestPointerEvent=t,this.latestPanInfo=e,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Do(t=>{let e=this.getAxisMotionValue(t).get()||0;if(Vt.test(e)){const{projection:n}=this.visualElement;if(n&&n.layout){const i=n.layout.layoutBox[t];if(i){e=po(i)*(parseFloat(e)/100)}}}this.originPoint[t]=e}),s&&nt.update(()=>s(t,e),!1,!0),Jn(this.visualElement,"transform");const{animationState:r}=this.visualElement;r&&r.setActive("whileDrag",!0)},onMove:(t,e)=>{this.latestPointerEvent=t,this.latestPanInfo=e;const{dragPropagation:n,dragDirectionLock:i,onDirectionLock:s,onDrag:o}=this.getProps();if(!n&&!this.openDragLock)return;const{offset:r}=e;if(i&&null===this.currentDirection)return this.currentDirection=function(t,e=10){let n=null;Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x");return n}(r),void(null!==this.currentDirection&&s&&s(this.currentDirection));this.updateAxis("x",e.point,r),this.updateAxis("y",e.point,r),this.visualElement.render(),o&&nt.update(()=>o(t,e),!1,!0)},onSessionEnd:(t,e)=>{this.latestPointerEvent=t,this.latestPanInfo=e,this.stop(t,e),this.latestPointerEvent=null,this.latestPanInfo=null},resumeAnimation:()=>{const{dragSnapToOrigin:t}=this.getProps();(t||this.constraints)&&this.startAnimation({x:0,y:0})}},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:s,distanceThreshold:n,contextWindow:oa(this.visualElement),element:this.visualElement.current})}stop(t,e){const n=t||this.latestPointerEvent,i=e||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!i||!n)return;const{velocity:o}=i;this.startAnimation(o);const{onDragEnd:r}=this.getProps();r&&nt.postRender(()=>r(n,i))}cancel(){this.isDragging=!1;const{projection:t,animationState:e}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),e&&e.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,e,n){const{drag:i}=this.getProps();if(!n||!Pa(t,i,this.currentDirection))return;const s=this.getAxisMotionValue(t);let o=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(o=function(t,{min:e,max:n},i){return void 0!==e&&tn&&(t=i?Xt(n,t,i.max):Math.min(t,n)),t}(o,this.constraints[t],this.elastic[t])),s.set(o)}resolveConstraints(){const{dragConstraints:t,dragElastic:e}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,i=this.constraints;t&&Gr(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!n)&&function(t,{top:e,left:n,bottom:i,right:s}){return{x:fa(t.x,n,s),y:fa(t.y,e,i)}}(n.layoutBox,t),this.elastic=function(t=ga){return!1===t?t=0:!0===t&&(t=ga),{x:va(t,"left","right"),y:va(t,"top","bottom")}}(e),i!==this.constraints&&!Gr(t)&&n&&this.constraints&&!this.hasMutatedConstraints&&Do(t=>{!1!==this.constraints&&this.getAxisMotionValue(t)&&(this.constraints[t]=function(t,e){const n={};return void 0!==e.min&&(n.min=e.min-t.min),void 0!==e.max&&(n.max=e.max-t.min),n}(n.layoutBox[t],this.constraints[t]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!t||!Gr(t))return!1;const n=t.current;w(null!==n,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:i}=this.visualElement;if(!i||!i.layout)return!1;i.root&&(i.root.scroll=void 0,i.root.updateScroll());const s=function(t,e,n){const i=Ls(t,n),{scroll:s}=e;return s&&(Cs(i.x,s.offset.x),Cs(i.y,s.offset.y)),i}(n,i.root,this.visualElement.getTransformPagePoint());let o=function(t,e){return{x:ya(t.x,e.x),y:ya(t.y,e.y)}}(i.layout.layoutBox,s);if(e){const t=e(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(o));this.hasMutatedConstraints=!!t,t&&(o=gs(t))}return o}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:r}=this.getProps(),a=this.constraints||{},l=Do(r=>{if(!Pa(r,e,this.currentDirection))return;let l=a&&a[r]||{};!0!==o&&o!==r||(l={min:0,max:0});const h=i?200:1e6,u=i?40:1e7,c={type:"inertia",velocity:n?t[r]:0,bounceStiffness:h,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...s,...l};return this.startAxisValueAnimation(r,c)});return Promise.all(l).then(r)}startAxisValueAnimation(t,e){const n=this.getAxisMotionValue(t);return Jn(this.visualElement,t),n.start(Nn(t,n,0,e,this.visualElement,!1))}stopAnimation(){Do(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const e=`_drag${t.toUpperCase()}`,n=this.visualElement.getProps()[e];return n||this.visualElement.getValue(t,this.visualElement.latestValues[t]??0)}snapToCursor(t){Do(e=>{const{drag:n}=this.getProps();if(!Pa(e,n,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(e);if(i&&i.layout){const{min:n,max:o}=i.layout.layoutBox[e],r=s.get()||0;s.set(t[e]-Xt(n,o,.5)+r)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:e}=this.getProps(),{projection:n}=this.visualElement;if(!Gr(e)||!n||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Do(t=>{const e=this.getAxisMotionValue(t);if(e&&!1!==this.constraints){const n=e.get();i[t]=function(t,e){let n=.5;const i=po(t),s=po(e);return s>i?n=V(e.min,e.max-i,t.min):i>s&&(n=V(t.min,t.max-s,e.min)),g(0,1,n)}({min:n,max:n},this.constraints[t])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),Do(e=>{if(!Pa(e,t,null))return;const n=this.getAxisMotionValue(e),{min:s,max:o}=this.constraints[e];n.set(Xt(s,o,i[e]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;wa.set(this.visualElement,this);const t=this.visualElement.current,e=sa(t,"pointerdown",e=>{const{drag:n,dragListener:i=!0}=this.getProps(),s=e.target,o=s!==t&&function(t){return Li.has(t.tagName)||!0===t.isContentEditable}(s);n&&i&&!o&&this.start(e)});let n;const i=()=>{const{dragConstraints:e}=this.getProps();Gr(e)&&e.current&&(this.constraints=this.resolveRefConstraints(),n||(n=function(t,e,n){const i=Ji(t,Sa(n)),s=Ji(e,Sa(n));return()=>{i(),s()}}(t,e.current,()=>this.scalePositionWithinConstraints())))},{projection:s}=this.visualElement,o=s.addEventListener("measure",i);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),nt.read(i);const r=Uo(window,"resize",()=>this.scalePositionWithinConstraints()),a=s.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(Do(e=>{const n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))}),this.visualElement.render())});return()=>{r(),e(),o(),a&&a(),n&&n()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:o=ga,dragMomentum:r=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:r}}}function Sa(t){let e=!0;return()=>{e?e=!1:t()}}function Pa(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}const ba=t=>(e,n)=>{t&&nt.update(()=>t(e,n),!1,!0)};let Ea=!1;class Aa extends m{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:i}=this.props,{projection:s}=t;s&&(e.group&&e.group.add(s),n&&n.register&&i&&n.register(s),Ea&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Yo.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:n,drag:i,isPresent:s}=this.props,{projection:o}=n;return o?(o.isPresent=s,t.layoutDependency!==e&&o.setOptions({...o.options,layoutDependency:e}),Ea=!0,i||t.layoutDependency!==e||void 0===e||t.isPresent!==s?o.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?o.promote():o.relegate()||nt.postRender(()=>{const t=o.getStack();t&&t.members.length||this.safeToRemove()})),null):null}componentDidUpdate(){const{visualElement:t,layoutAnchor:e}=this.props,{projection:n}=t;n&&(n.options.layoutAnchor=e,n.root.didUpdate(),Ei.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n}=this.props,{projection:i}=t;Ea=!0,i&&(i.scheduleCheckAfterUnmount(),e&&e.group&&e.group.remove(i),n&&n.deregister&&n.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Ma(t){const[n,s]=function(t=!0){const e=i(Ir);if(null===e)return[!0,null];const{isPresent:n,onExitComplete:s,register:o}=e,r=p();c(()=>{if(t)return o(r)},[t]);const a=h(()=>t&&s&&s(r),[r,s,t]);return!n&&s?[!1,a]:[!0]}(),o=i(Z);return e(Aa,{...t,layoutGroup:o,switchLayoutGroup:i(Kr),isPresent:n,safeToRemove:s})}const Va={pan:{Feature:class extends ys{constructor(){super(...arguments),this.removePointerDownListener=A}onPointerDown(t){this.session=new la(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:oa(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:e,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:ba(t),onStart:ba(e),onMove:ba(n),onEnd:(t,e)=>{delete this.session,i&&nt.postRender(()=>i(t,e))}}}mount(){this.removePointerDownListener=sa(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends ys{constructor(t){super(t),this.removeGroupControls=A,this.removeListeners=A,this.controls=new Ta(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||A}update(){const{dragControls:t}=this.node.getProps(),{dragControls:e}=this.node.prevProps||{};t!==e&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},ProjectionNode:Sr,MeasureLayout:Ma}};function Ca(t,e,n){const{props:i}=t;t.animationState&&i.whileHover&&t.animationState.setActive("whileHover","Start"===n);const s=i["onHover"+n];s&&nt.postRender(()=>s(e,ia(e)))}function ka(t,e,n){const{props:i}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&i.whileTap&&t.animationState.setActive("whileTap","Start"===n);const s=i["onTap"+("End"===n?"":n)];s&&nt.postRender(()=>s(e,ia(e)))}const Da=new WeakMap,Ra=new WeakMap,La=t=>{const e=Da.get(t.target);e&&e(t)},Ba=t=>{t.forEach(La)};function ja(t,e,n){const i=function({root:t,...e}){const n=t||document;Ra.has(n)||Ra.set(n,{});const i=Ra.get(n),s=JSON.stringify(e);return i[s]||(i[s]=new IntersectionObserver(Ba,{root:t,...e})),i[s]}(e);return Da.set(t,n),i.observe(t),()=>{Da.delete(t),i.unobserve(t)}}const Fa={some:0,all:1};const Ia={...na,...{inView:{Feature:class extends ys{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:t={}}=this.node.getProps(),{root:e,margin:n,amount:i="some",once:s}=t,o={root:e?e.current:void 0,rootMargin:n,threshold:"number"==typeof i?i:Fa[i]};this.stopObserver=ja(this.node.current,o,t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,s&&!e&&this.hasEnteredView)return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);const{onViewportEnter:n,onViewportLeave:i}=this.node.getProps(),o=e?n:i;o&&o(t)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}(t,e))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}},tap:{Feature:class extends ys{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:e,propagate:n}=this.node.props;this.unmount=Ui(t,(t,e)=>(ka(this.node,e,"Start"),(t,{success:e})=>ka(this.node,t,e?"End":"Cancel")),{useGlobalTarget:e,stopPropagation:!1===n?.tap})}unmount(){}}},focus:{Feature:class extends ys{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){t=!0}t&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=M(Uo(this.node.current,"focus",()=>this.onFocus()),Uo(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends ys{mount(){const{current:t}=this.node;t&&(this.unmount=Ci(t,(t,e)=>(Ca(this.node,e,"Start"),t=>Ca(this.node,t,"End"))))}unmount(){}}}},...Va,...{layout:{ProjectionNode:Sr,MeasureLayout:Ma}}};function Oa(t,e){return Jr(t,e,Ia,ta)}const Ua=Oa("div");export{Ua as MotionDiv}; -//# sourceMappingURL=size-rollup-motion.js.map diff --git a/node_modules/framer-motion/dist/size-rollup-motion.js.map b/node_modules/framer-motion/dist/size-rollup-motion.js.map deleted file mode 100644 index 3b5a8e5..0000000 --- a/node_modules/framer-motion/dist/size-rollup-motion.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"size-rollup-motion.js","sources":["../../motion-utils/dist/es/array.mjs","../../motion-utils/dist/es/clamp.mjs","../../motion-utils/dist/es/format-error-message.mjs","../../motion-utils/dist/es/errors.mjs","../../motion-utils/dist/es/global-config.mjs","../../motion-utils/dist/es/is-numerical-string.mjs","../../motion-utils/dist/es/is-object.mjs","../../motion-utils/dist/es/is-zero-value-string.mjs","../../motion-utils/dist/es/memo.mjs","../../motion-utils/dist/es/noop.mjs","../../motion-utils/dist/es/pipe.mjs","../../motion-utils/dist/es/progress.mjs","../../motion-utils/dist/es/subscription-manager.mjs","../../motion-utils/dist/es/time-conversion.mjs","../../motion-utils/dist/es/velocity-per-second.mjs","../../motion-utils/dist/es/easing/cubic-bezier.mjs","../../motion-utils/dist/es/easing/modifiers/mirror.mjs","../../motion-utils/dist/es/easing/modifiers/reverse.mjs","../../motion-utils/dist/es/easing/back.mjs","../../motion-utils/dist/es/easing/anticipate.mjs","../../motion-utils/dist/es/easing/circ.mjs","../../motion-utils/dist/es/easing/ease.mjs","../../motion-utils/dist/es/easing/utils/is-bezier-definition.mjs","../../motion-utils/dist/es/easing/utils/map.mjs","../lib/context/LayoutGroupContext.js","../lib/context/LazyContext.js","../lib/context/MotionConfigContext.js","../lib/context/MotionContext/index.js","../../motion-dom/dist/es/frameloop/order.mjs","../../motion-dom/dist/es/frameloop/batcher.mjs","../../motion-dom/dist/es/frameloop/render-step.mjs","../../motion-dom/dist/es/frameloop/frame.mjs","../../motion-dom/dist/es/frameloop/sync-time.mjs","../../motion-dom/dist/es/animation/utils/is-css-variable.mjs","../../motion-dom/dist/es/value/types/numbers/index.mjs","../../motion-dom/dist/es/value/types/utils/sanitize.mjs","../../motion-dom/dist/es/value/types/utils/float-regex.mjs","../../motion-dom/dist/es/value/types/utils/single-color-regex.mjs","../../motion-dom/dist/es/value/types/color/utils.mjs","../../motion-dom/dist/es/value/types/utils/is-nullish.mjs","../../motion-dom/dist/es/value/types/color/rgba.mjs","../../motion-dom/dist/es/value/types/color/hex.mjs","../../motion-dom/dist/es/value/types/numbers/units.mjs","../../motion-dom/dist/es/value/types/color/hsla.mjs","../../motion-dom/dist/es/value/types/color/index.mjs","../../motion-dom/dist/es/value/types/utils/color-regex.mjs","../../motion-dom/dist/es/value/types/complex/index.mjs","../../motion-dom/dist/es/value/types/color/hsla-to-rgba.mjs","../../motion-dom/dist/es/utils/mix/immediate.mjs","../../motion-dom/dist/es/utils/mix/number.mjs","../../motion-dom/dist/es/utils/mix/color.mjs","../../motion-dom/dist/es/utils/mix/visibility.mjs","../../motion-dom/dist/es/utils/mix/complex.mjs","../../motion-dom/dist/es/utils/mix/index.mjs","../../motion-dom/dist/es/animation/drivers/frame.mjs","../../motion-dom/dist/es/animation/waapi/utils/linear.mjs","../../motion-dom/dist/es/animation/generators/utils/calc-duration.mjs","../../motion-dom/dist/es/animation/generators/spring.mjs","../../motion-dom/dist/es/animation/generators/utils/create-generator-easing.mjs","../../motion-dom/dist/es/animation/generators/utils/velocity.mjs","../../motion-dom/dist/es/animation/generators/inertia.mjs","../../motion-dom/dist/es/utils/interpolate.mjs","../../motion-dom/dist/es/animation/keyframes/offsets/default.mjs","../../motion-dom/dist/es/animation/keyframes/offsets/fill.mjs","../../motion-dom/dist/es/animation/generators/keyframes.mjs","../../motion-utils/dist/es/easing/utils/is-easing-array.mjs","../../motion-dom/dist/es/animation/keyframes/offsets/time.mjs","../../motion-dom/dist/es/animation/keyframes/get-final.mjs","../../motion-dom/dist/es/animation/utils/replace-transition-type.mjs","../../motion-dom/dist/es/animation/utils/WithPromise.mjs","../../motion-dom/dist/es/animation/JSAnimation.mjs","../../motion-dom/dist/es/render/dom/parse-transform.mjs","../../motion-dom/dist/es/render/utils/keys-transform.mjs","../../motion-dom/dist/es/animation/keyframes/utils/unit-conversion.mjs","../../motion-dom/dist/es/animation/keyframes/KeyframesResolver.mjs","../../motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.mjs","../../motion-dom/dist/es/render/dom/style-set.mjs","../../motion-dom/dist/es/render/dom/is-css-var.mjs","../../motion-dom/dist/es/utils/supports/flags.mjs","../../motion-dom/dist/es/utils/supports/memo.mjs","../../motion-dom/dist/es/utils/supports/scroll-timeline.mjs","../../motion-dom/dist/es/utils/supports/linear-easing.mjs","../../motion-dom/dist/es/animation/waapi/easing/cubic-bezier.mjs","../../motion-dom/dist/es/animation/waapi/easing/supported.mjs","../../motion-dom/dist/es/animation/waapi/easing/map-easing.mjs","../../motion-dom/dist/es/animation/waapi/start-waapi-animation.mjs","../../motion-dom/dist/es/animation/generators/utils/is-generator.mjs","../../motion-dom/dist/es/animation/NativeAnimation.mjs","../../motion-dom/dist/es/animation/waapi/utils/apply-generator.mjs","../../motion-dom/dist/es/animation/waapi/utils/unsupported-easing.mjs","../../motion-dom/dist/es/animation/NativeAnimationExtended.mjs","../../motion-dom/dist/es/animation/utils/is-animatable.mjs","../../motion-dom/dist/es/animation/utils/make-animation-instant.mjs","../../motion-dom/dist/es/animation/waapi/utils/accelerated-values.mjs","../../motion-dom/dist/es/animation/waapi/utils/is-browser-color.mjs","../../motion-dom/dist/es/animation/waapi/supports/waapi.mjs","../../motion-dom/dist/es/animation/AsyncMotionValueAnimation.mjs","../../motion-dom/dist/es/animation/utils/can-animate.mjs","../../motion-dom/dist/es/animation/utils/calc-child-stagger.mjs","../../motion-dom/dist/es/value/index.mjs","../../motion-dom/dist/es/animation/utils/resolve-transition.mjs","../../motion-dom/dist/es/animation/utils/get-value-transition.mjs","../../motion-dom/dist/es/animation/utils/default-transitions.mjs","../../motion-dom/dist/es/animation/utils/is-transition-defined.mjs","../../motion-dom/dist/es/animation/interfaces/motion-value.mjs","../../motion-dom/dist/es/animation/utils/css-variables-conversion.mjs","../../motion-dom/dist/es/render/utils/resolve-variants.mjs","../../motion-dom/dist/es/render/utils/resolve-dynamic-variants.mjs","../../motion-dom/dist/es/render/utils/keys-position.mjs","../../motion-dom/dist/es/render/utils/is-keyframes-target.mjs","../../motion-dom/dist/es/render/utils/setters.mjs","../../motion-dom/dist/es/value/utils/is-motion-value.mjs","../../motion-dom/dist/es/value/will-change/add-will-change.mjs","../../motion-dom/dist/es/value/will-change/is.mjs","../../motion-dom/dist/es/render/dom/utils/camel-to-dash.mjs","../../motion-dom/dist/es/animation/optimized-appear/data-id.mjs","../../motion-dom/dist/es/animation/optimized-appear/get-appear-id.mjs","../../motion-dom/dist/es/animation/interfaces/visual-element-target.mjs","../../motion-dom/dist/es/animation/interfaces/visual-element-variant.mjs","../../motion-dom/dist/es/value/types/auto.mjs","../../motion-dom/dist/es/value/types/test.mjs","../../motion-dom/dist/es/value/types/dimensions.mjs","../../motion-dom/dist/es/animation/keyframes/utils/is-none.mjs","../../motion-dom/dist/es/value/types/complex/filter.mjs","../../motion-dom/dist/es/value/types/complex/mask.mjs","../../motion-dom/dist/es/value/types/int.mjs","../../motion-dom/dist/es/value/types/maps/number.mjs","../../motion-dom/dist/es/value/types/maps/transform.mjs","../../motion-dom/dist/es/value/types/maps/defaults.mjs","../../motion-dom/dist/es/value/types/utils/animatable-none.mjs","../../motion-dom/dist/es/animation/keyframes/utils/make-none-animatable.mjs","../../motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.mjs","../../motion-dom/dist/es/utils/border-radius.mjs","../../motion-dom/dist/es/utils/resolve-elements.mjs","../../motion-dom/dist/es/value/types/utils/get-as-type.mjs","../../motion-dom/dist/es/frameloop/microtask.mjs","../../motion-dom/dist/es/gestures/drag/state/is-active.mjs","../../motion-dom/dist/es/gestures/utils/setup.mjs","../../motion-dom/dist/es/gestures/hover.mjs","../../motion-dom/dist/es/gestures/utils/is-node-or-child.mjs","../../motion-dom/dist/es/gestures/utils/is-primary-pointer.mjs","../../motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.mjs","../../motion-dom/dist/es/gestures/press/utils/state.mjs","../../motion-dom/dist/es/gestures/press/utils/keyboard.mjs","../../motion-dom/dist/es/gestures/press/index.mjs","../../motion-dom/dist/es/utils/is-html-element.mjs","../../motion-dom/dist/es/utils/is-svg-element.mjs","../../motion-dom/dist/es/resize/handle-element.mjs","../../motion-dom/dist/es/resize/handle-window.mjs","../../motion-dom/dist/es/resize/index.mjs","../../motion-dom/dist/es/value/types/utils/find.mjs","../../motion-dom/dist/es/projection/geometry/models.mjs","../../motion-dom/dist/es/render/store.mjs","../../motion-dom/dist/es/render/utils/is-animation-controls.mjs","../../motion-dom/dist/es/render/utils/is-variant-label.mjs","../../motion-dom/dist/es/render/utils/variant-props.mjs","../../motion-dom/dist/es/render/utils/is-controlling-variants.mjs","../../motion-dom/dist/es/render/utils/reduced-motion/state.mjs","../../motion-dom/dist/es/render/utils/reduced-motion/index.mjs","../../motion-dom/dist/es/render/VisualElement.mjs","../../motion-dom/dist/es/render/utils/motion-values.mjs","../../motion-dom/dist/es/render/dom/DOMVisualElement.mjs","../../motion-dom/dist/es/render/Feature.mjs","../../motion-dom/dist/es/projection/geometry/conversion.mjs","../../motion-dom/dist/es/projection/utils/has-transform.mjs","../../motion-dom/dist/es/projection/geometry/delta-apply.mjs","../../motion-dom/dist/es/projection/utils/measure.mjs","../../motion-dom/dist/es/render/html/utils/build-transform.mjs","../../motion-dom/dist/es/render/html/utils/build-styles.mjs","../../motion-dom/dist/es/render/html/utils/render.mjs","../../motion-dom/dist/es/projection/styles/scale-border-radius.mjs","../../motion-dom/dist/es/projection/styles/scale-box-shadow.mjs","../../motion-dom/dist/es/projection/styles/scale-correction.mjs","../../motion-dom/dist/es/render/utils/is-forced-motion-value.mjs","../../motion-dom/dist/es/render/html/utils/scrape-motion-values.mjs","../../motion-dom/dist/es/render/html/HTMLVisualElement.mjs","../../motion-dom/dist/es/render/svg/utils/path.mjs","../../motion-dom/dist/es/render/svg/utils/build-attrs.mjs","../../motion-dom/dist/es/render/svg/utils/camel-case-attrs.mjs","../../motion-dom/dist/es/render/svg/utils/is-svg-tag.mjs","../../motion-dom/dist/es/render/svg/utils/scrape-motion-values.mjs","../../motion-dom/dist/es/render/svg/SVGVisualElement.mjs","../../motion-dom/dist/es/render/svg/utils/render.mjs","../../motion-dom/dist/es/render/utils/get-variant-context.mjs","../../motion-dom/dist/es/render/utils/shallow-compare.mjs","../../motion-dom/dist/es/render/utils/animation-state.mjs","../../motion-dom/dist/es/animation/interfaces/visual-element.mjs","../../motion-dom/dist/es/projection/geometry/copy.mjs","../../motion-dom/dist/es/projection/geometry/delta-calc.mjs","../../motion-dom/dist/es/projection/geometry/delta-remove.mjs","../../motion-dom/dist/es/projection/geometry/utils.mjs","../../motion-dom/dist/es/projection/utils/each-axis.mjs","../../motion-dom/dist/es/projection/animation/mix-values.mjs","../../motion-dom/dist/es/events/add-dom-event.mjs","../../motion-dom/dist/es/projection/utils/compare-by-depth.mjs","../../motion-dom/dist/es/projection/utils/flat-tree.mjs","../../motion-dom/dist/es/value/utils/resolve-motion-value.mjs","../../motion-dom/dist/es/projection/shared/stack.mjs","../../motion-dom/dist/es/projection/node/state.mjs","../../motion-dom/dist/es/projection/node/create-projection-node.mjs","../../motion-dom/dist/es/utils/is-svg-svg-element.mjs","../../motion-dom/dist/es/utils/delay.mjs","../../motion-dom/dist/es/animation/animate/single-value.mjs","../../motion-dom/dist/es/projection/styles/transform.mjs","../../motion-dom/dist/es/projection/node/DocumentProjectionNode.mjs","../../motion-dom/dist/es/projection/node/HTMLProjectionNode.mjs","../lib/context/MotionContext/create.js","../lib/context/MotionContext/utils.js","../lib/render/html/utils/create-render-state.js","../lib/render/html/use-props.js","../lib/render/svg/utils/create-render-state.js","../lib/render/svg/use-props.js","../lib/motion/utils/valid-prop.js","../lib/render/dom/utils/filter-props.js","../lib/render/svg/lowercase-elements.js","../lib/render/dom/utils/is-svg-component.js","../lib/render/dom/use-render.js","../lib/context/PresenceContext.js","../lib/motion/utils/use-visual-state.js","../lib/utils/use-constant.js","../lib/render/html/use-html-visual-state.js","../lib/render/svg/use-svg-visual-state.js","../lib/motion/features/definitions.js","../lib/motion/utils/symbol.js","../lib/motion/utils/use-motion-ref.js","../lib/context/SwitchLayoutGroupContext.js","../lib/utils/is-ref-object.js","../lib/utils/is-browser.js","../lib/utils/use-isomorphic-effect.js","../lib/motion/utils/use-visual-element.js","../lib/motion/index.js","../lib/motion/features/load-features.js","../lib/render/dom/create-visual-element.js","../lib/motion/features/animation/exit.js","../lib/motion/features/animations.js","../lib/motion/features/animation/index.js","../lib/events/event-info.js","../lib/events/add-pointer-event.js","../lib/utils/get-context-window.js","../lib/utils/distance.js","../lib/gestures/pan/PanSession.js","../lib/gestures/drag/utils/constraints.js","../lib/gestures/drag/VisualElementDragControls.js","../../motion-dom/dist/es/gestures/drag/state/set-active.mjs","../lib/gestures/pan/index.js","../lib/motion/features/layout/MeasureLayout.js","../lib/components/AnimatePresence/use-presence.js","../lib/motion/features/drag.js","../lib/gestures/drag/index.js","../lib/gestures/hover.js","../lib/gestures/press.js","../lib/motion/features/viewport/observers.js","../lib/motion/features/viewport/index.js","../lib/motion/features/gestures.js","../lib/render/components/motion/feature-bundle.js","../lib/gestures/focus.js","../lib/motion/features/layout.js","../lib/render/components/motion/create.js","../lib/render/components/motion/elements.js","../lib/render/components/motion/size.js"],"sourcesContent":["function addUniqueItem(arr, item) {\n if (arr.indexOf(item) === -1)\n arr.push(item);\n}\nfunction removeItem(arr, item) {\n const index = arr.indexOf(item);\n if (index > -1)\n arr.splice(index, 1);\n}\n// Adapted from array-move\nfunction moveItem([...arr], fromIndex, toIndex) {\n const startIndex = fromIndex < 0 ? arr.length + fromIndex : fromIndex;\n if (startIndex >= 0 && startIndex < arr.length) {\n const endIndex = toIndex < 0 ? arr.length + toIndex : toIndex;\n const [item] = arr.splice(fromIndex, 1);\n arr.splice(endIndex, 0, item);\n }\n return arr;\n}\n\nexport { addUniqueItem, moveItem, removeItem };\n//# sourceMappingURL=array.mjs.map\n","const clamp = (min, max, v) => {\n if (v > max)\n return max;\n if (v < min)\n return min;\n return v;\n};\n\nexport { clamp };\n//# sourceMappingURL=clamp.mjs.map\n","function formatErrorMessage(message, errorCode) {\n return errorCode\n ? `${message}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${errorCode}`\n : message;\n}\n\nexport { formatErrorMessage };\n//# sourceMappingURL=format-error-message.mjs.map\n","import { formatErrorMessage } from './format-error-message.mjs';\n\nlet warning = () => { };\nlet invariant = () => { };\nif (typeof process !== \"undefined\" &&\n process.env?.NODE_ENV !== \"production\") {\n warning = (check, message, errorCode) => {\n if (!check && typeof console !== \"undefined\") {\n console.warn(formatErrorMessage(message, errorCode));\n }\n };\n invariant = (check, message, errorCode) => {\n if (!check) {\n throw new Error(formatErrorMessage(message, errorCode));\n }\n };\n}\n\nexport { invariant, warning };\n//# sourceMappingURL=errors.mjs.map\n","const MotionGlobalConfig = {};\n\nexport { MotionGlobalConfig };\n//# sourceMappingURL=global-config.mjs.map\n","/**\n * Check if value is a numerical string, ie a string that is purely a number eg \"100\" or \"-100.1\"\n */\nconst isNumericalString = (v) => /^-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)$/u.test(v);\n\nexport { isNumericalString };\n//# sourceMappingURL=is-numerical-string.mjs.map\n","const isObject = (value) => typeof value === \"object\" && value !== null;\n\nexport { isObject };\n//# sourceMappingURL=is-object.mjs.map\n","/**\n * Check if the value is a zero value string like \"0px\" or \"0%\"\n */\nconst isZeroValueString = (v) => /^0[^.\\s]+$/u.test(v);\n\nexport { isZeroValueString };\n//# sourceMappingURL=is-zero-value-string.mjs.map\n","/*#__NO_SIDE_EFFECTS__*/\nfunction memo(callback) {\n let result;\n return () => {\n if (result === undefined)\n result = callback();\n return result;\n };\n}\n\nexport { memo };\n//# sourceMappingURL=memo.mjs.map\n","/*#__NO_SIDE_EFFECTS__*/\nconst noop = (any) => any;\n\nexport { noop };\n//# sourceMappingURL=noop.mjs.map\n","/**\n * Pipe\n * Compose other transformers to run linearily\n * pipe(min(20), max(40))\n * @param {...functions} transformers\n * @return {function}\n */\nconst pipe = (...transformers) => transformers.reduce((a, b) => (v) => b(a(v)));\n\nexport { pipe };\n//# sourceMappingURL=pipe.mjs.map\n","/*\n Progress within given range\n\n Given a lower limit and an upper limit, we return the progress\n (expressed as a number 0-1) represented by the given value, and\n limit that progress to within 0-1.\n*/\n/*#__NO_SIDE_EFFECTS__*/\nconst progress = (from, to, value) => {\n const range = to - from;\n return range ? (value - from) / range : 1;\n};\n\nexport { progress };\n//# sourceMappingURL=progress.mjs.map\n","import { addUniqueItem, removeItem } from './array.mjs';\n\nclass SubscriptionManager {\n constructor() {\n this.subscriptions = [];\n }\n add(handler) {\n addUniqueItem(this.subscriptions, handler);\n return () => removeItem(this.subscriptions, handler);\n }\n notify(a, b, c) {\n const numSubscriptions = this.subscriptions.length;\n if (!numSubscriptions)\n return;\n if (numSubscriptions === 1) {\n /**\n * If there's only a single handler we can just call it without invoking a loop.\n */\n this.subscriptions[0](a, b, c);\n }\n else {\n for (let i = 0; i < numSubscriptions; i++) {\n /**\n * Check whether the handler exists before firing as it's possible\n * the subscriptions were modified during this loop running.\n */\n const handler = this.subscriptions[i];\n handler && handler(a, b, c);\n }\n }\n }\n getSize() {\n return this.subscriptions.length;\n }\n clear() {\n this.subscriptions.length = 0;\n }\n}\n\nexport { SubscriptionManager };\n//# sourceMappingURL=subscription-manager.mjs.map\n","/**\n * Converts seconds to milliseconds\n *\n * @param seconds - Time in seconds.\n * @return milliseconds - Converted time in milliseconds.\n */\n/*#__NO_SIDE_EFFECTS__*/\nconst secondsToMilliseconds = (seconds) => seconds * 1000;\n/*#__NO_SIDE_EFFECTS__*/\nconst millisecondsToSeconds = (milliseconds) => milliseconds / 1000;\n\nexport { millisecondsToSeconds, secondsToMilliseconds };\n//# sourceMappingURL=time-conversion.mjs.map\n","/*\n Convert velocity into velocity per second\n*/\n/*#__NO_SIDE_EFFECTS__*/\nconst velocityPerSecond = (velocity, frameDuration) => frameDuration ? velocity * (1000 / frameDuration) : 0;\n\nexport { velocityPerSecond };\n//# sourceMappingURL=velocity-per-second.mjs.map\n","import { noop } from '../noop.mjs';\n\n/*\n Bezier function generator\n This has been modified from Gaëtan Renaudeau's BezierEasing\n https://github.com/gre/bezier-easing/blob/master/src/index.js\n https://github.com/gre/bezier-easing/blob/master/LICENSE\n \n I've removed the newtonRaphsonIterate algo because in benchmarking it\n wasn't noticeably faster than binarySubdivision, indeed removing it\n usually improved times, depending on the curve.\n I also removed the lookup table, as for the added bundle size and loop we're\n only cutting ~4 or so subdivision iterations. I bumped the max iterations up\n to 12 to compensate and this still tended to be faster for no perceivable\n loss in accuracy.\n Usage\n const easeOut = cubicBezier(.17,.67,.83,.67);\n const x = easeOut(0.5); // returns 0.627...\n*/\n// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.\nconst calcBezier = (t, a1, a2) => (((1.0 - 3.0 * a2 + 3.0 * a1) * t + (3.0 * a2 - 6.0 * a1)) * t + 3.0 * a1) *\n t;\nconst subdivisionPrecision = 0.0000001;\nconst subdivisionMaxIterations = 12;\nfunction binarySubdivide(x, lowerBound, upperBound, mX1, mX2) {\n let currentX;\n let currentT;\n let i = 0;\n do {\n currentT = lowerBound + (upperBound - lowerBound) / 2.0;\n currentX = calcBezier(currentT, mX1, mX2) - x;\n if (currentX > 0.0) {\n upperBound = currentT;\n }\n else {\n lowerBound = currentT;\n }\n } while (Math.abs(currentX) > subdivisionPrecision &&\n ++i < subdivisionMaxIterations);\n return currentT;\n}\n/*#__NO_SIDE_EFFECTS__*/\nfunction cubicBezier(mX1, mY1, mX2, mY2) {\n // If this is a linear gradient, return linear easing\n if (mX1 === mY1 && mX2 === mY2)\n return noop;\n const getTForX = (aX) => binarySubdivide(aX, 0, 1, mX1, mX2);\n // If animation is at start/end, return t without easing\n return (t) => t === 0 || t === 1 ? t : calcBezier(getTForX(t), mY1, mY2);\n}\n\nexport { cubicBezier };\n//# sourceMappingURL=cubic-bezier.mjs.map\n","// Accepts an easing function and returns a new one that outputs mirrored values for\n// the second half of the animation. Turns easeIn into easeInOut.\n/*#__NO_SIDE_EFFECTS__*/\nconst mirrorEasing = (easing) => (p) => p <= 0.5 ? easing(2 * p) / 2 : (2 - easing(2 * (1 - p))) / 2;\n\nexport { mirrorEasing };\n//# sourceMappingURL=mirror.mjs.map\n","// Accepts an easing function and returns a new one that outputs reversed values.\n// Turns easeIn into easeOut.\n/*#__NO_SIDE_EFFECTS__*/\nconst reverseEasing = (easing) => (p) => 1 - easing(1 - p);\n\nexport { reverseEasing };\n//# sourceMappingURL=reverse.mjs.map\n","import { cubicBezier } from './cubic-bezier.mjs';\nimport { mirrorEasing } from './modifiers/mirror.mjs';\nimport { reverseEasing } from './modifiers/reverse.mjs';\n\nconst backOut = /*@__PURE__*/ cubicBezier(0.33, 1.53, 0.69, 0.99);\nconst backIn = /*@__PURE__*/ reverseEasing(backOut);\nconst backInOut = /*@__PURE__*/ mirrorEasing(backIn);\n\nexport { backIn, backInOut, backOut };\n//# sourceMappingURL=back.mjs.map\n","import { backIn } from './back.mjs';\n\nconst anticipate = (p) => p >= 1\n ? 1\n : (p *= 2) < 1\n ? 0.5 * backIn(p)\n : 0.5 * (2 - Math.pow(2, -10 * (p - 1)));\n\nexport { anticipate };\n//# sourceMappingURL=anticipate.mjs.map\n","import { mirrorEasing } from './modifiers/mirror.mjs';\nimport { reverseEasing } from './modifiers/reverse.mjs';\n\nconst circIn = (p) => 1 - Math.sin(Math.acos(p));\nconst circOut = reverseEasing(circIn);\nconst circInOut = mirrorEasing(circIn);\n\nexport { circIn, circInOut, circOut };\n//# sourceMappingURL=circ.mjs.map\n","import { cubicBezier } from './cubic-bezier.mjs';\n\nconst easeIn = /*@__PURE__*/ cubicBezier(0.42, 0, 1, 1);\nconst easeOut = /*@__PURE__*/ cubicBezier(0, 0, 0.58, 1);\nconst easeInOut = /*@__PURE__*/ cubicBezier(0.42, 0, 0.58, 1);\n\nexport { easeIn, easeInOut, easeOut };\n//# sourceMappingURL=ease.mjs.map\n","/*#__NO_SIDE_EFFECTS__*/\nconst isBezierDefinition = (easing) => Array.isArray(easing) && typeof easing[0] === \"number\";\n\nexport { isBezierDefinition };\n//# sourceMappingURL=is-bezier-definition.mjs.map\n","import { invariant } from '../../errors.mjs';\nimport { noop } from '../../noop.mjs';\nimport { anticipate } from '../anticipate.mjs';\nimport { backOut, backInOut, backIn } from '../back.mjs';\nimport { circOut, circInOut, circIn } from '../circ.mjs';\nimport { cubicBezier } from '../cubic-bezier.mjs';\nimport { easeOut, easeInOut, easeIn } from '../ease.mjs';\nimport { isBezierDefinition } from './is-bezier-definition.mjs';\n\nconst easingLookup = {\n linear: noop,\n easeIn,\n easeInOut,\n easeOut,\n circIn,\n circInOut,\n circOut,\n backIn,\n backInOut,\n backOut,\n anticipate,\n};\nconst isValidEasing = (easing) => {\n return typeof easing === \"string\";\n};\nconst easingDefinitionToFunction = (definition) => {\n if (isBezierDefinition(definition)) {\n // If cubic bezier definition, create bezier curve\n invariant(definition.length === 4, `Cubic bezier arrays must contain four numerical values.`, \"cubic-bezier-length\");\n const [x1, y1, x2, y2] = definition;\n return cubicBezier(x1, y1, x2, y2);\n }\n else if (isValidEasing(definition)) {\n // Else lookup from table\n invariant(easingLookup[definition] !== undefined, `Invalid easing type '${definition}'`, \"invalid-easing-type\");\n return easingLookup[definition];\n }\n return definition;\n};\n\nexport { easingDefinitionToFunction };\n//# sourceMappingURL=map.mjs.map\n","\"use client\";\nimport { createContext } from \"react\";\nexport const LayoutGroupContext = createContext({});\n//# sourceMappingURL=LayoutGroupContext.js.map","\"use client\";\nimport { createContext } from \"react\";\nexport const LazyContext = createContext({ strict: false });\n//# sourceMappingURL=LazyContext.js.map","\"use client\";\nimport { createContext } from \"react\";\n/**\n * @public\n */\nexport const MotionConfigContext = createContext({\n transformPagePoint: (p) => p,\n isStatic: false,\n reducedMotion: \"never\",\n});\n//# sourceMappingURL=MotionConfigContext.js.map","\"use client\";\nimport { createContext } from \"react\";\nexport const MotionContext = /* @__PURE__ */ createContext({});\n//# sourceMappingURL=index.js.map","const stepsOrder = [\n \"setup\", // Compute\n \"read\", // Read\n \"resolveKeyframes\", // Write/Read/Write/Read\n \"preUpdate\", // Compute\n \"update\", // Compute\n \"preRender\", // Compute\n \"render\", // Write\n \"postRender\", // Compute\n];\n\nexport { stepsOrder };\n//# sourceMappingURL=order.mjs.map\n","import { MotionGlobalConfig } from 'motion-utils';\nimport { stepsOrder } from './order.mjs';\nimport { createRenderStep } from './render-step.mjs';\n\nconst maxElapsed = 40;\nfunction createRenderBatcher(scheduleNextBatch, allowKeepAlive) {\n let runNextFrame = false;\n let useDefaultElapsed = true;\n const state = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n };\n const flagRunNextFrame = () => (runNextFrame = true);\n const steps = stepsOrder.reduce((acc, key) => {\n acc[key] = createRenderStep(flagRunNextFrame);\n return acc;\n }, {});\n const { setup, read, resolveKeyframes, preUpdate, update, preRender, render, postRender, } = steps;\n const processBatch = () => {\n const useManualTiming = MotionGlobalConfig.useManualTiming;\n const timestamp = useManualTiming\n ? state.timestamp\n : performance.now();\n runNextFrame = false;\n if (!useManualTiming) {\n state.delta = useDefaultElapsed\n ? 1000 / 60\n : Math.max(Math.min(timestamp - state.timestamp, maxElapsed), 1);\n }\n state.timestamp = timestamp;\n state.isProcessing = true;\n // Unrolled render loop for better per-frame performance\n setup.process(state);\n read.process(state);\n resolveKeyframes.process(state);\n preUpdate.process(state);\n update.process(state);\n preRender.process(state);\n render.process(state);\n postRender.process(state);\n state.isProcessing = false;\n if (runNextFrame && allowKeepAlive) {\n useDefaultElapsed = false;\n scheduleNextBatch(processBatch);\n }\n };\n const wake = () => {\n runNextFrame = true;\n useDefaultElapsed = true;\n if (!state.isProcessing) {\n scheduleNextBatch(processBatch);\n }\n };\n const schedule = stepsOrder.reduce((acc, key) => {\n const step = steps[key];\n acc[key] = (process, keepAlive = false, immediate = false) => {\n if (!runNextFrame)\n wake();\n return step.schedule(process, keepAlive, immediate);\n };\n return acc;\n }, {});\n const cancel = (process) => {\n for (let i = 0; i < stepsOrder.length; i++) {\n steps[stepsOrder[i]].cancel(process);\n }\n };\n return { schedule, cancel, state, steps };\n}\n\nexport { createRenderBatcher };\n//# sourceMappingURL=batcher.mjs.map\n","function createRenderStep(runNextFrame) {\n /**\n * We create and reuse two queues, one to queue jobs for the current frame\n * and one for the next. We reuse to avoid triggering GC after x frames.\n */\n let thisFrame = new Set();\n let nextFrame = new Set();\n /**\n * Track whether we're currently processing jobs in this step. This way\n * we can decide whether to schedule new jobs for this frame or next.\n */\n let isProcessing = false;\n let flushNextFrame = false;\n /**\n * A set of processes which were marked keepAlive when scheduled.\n */\n const toKeepAlive = new WeakSet();\n let latestFrameData = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n };\n function triggerCallback(callback) {\n if (toKeepAlive.has(callback)) {\n step.schedule(callback);\n runNextFrame();\n }\n callback(latestFrameData);\n }\n const step = {\n /**\n * Schedule a process to run on the next frame.\n */\n schedule: (callback, keepAlive = false, immediate = false) => {\n const addToCurrentFrame = immediate && isProcessing;\n const queue = addToCurrentFrame ? thisFrame : nextFrame;\n if (keepAlive)\n toKeepAlive.add(callback);\n queue.add(callback);\n return callback;\n },\n /**\n * Cancel the provided callback from running on the next frame.\n */\n cancel: (callback) => {\n nextFrame.delete(callback);\n toKeepAlive.delete(callback);\n },\n /**\n * Execute all schedule callbacks.\n */\n process: (frameData) => {\n latestFrameData = frameData;\n /**\n * If we're already processing we've probably been triggered by a flushSync\n * inside an existing process. Instead of executing, mark flushNextFrame\n * as true and ensure we flush the following frame at the end of this one.\n */\n if (isProcessing) {\n flushNextFrame = true;\n return;\n }\n isProcessing = true;\n // Swap this frame and the next to avoid GC\n const prevFrame = thisFrame;\n thisFrame = nextFrame;\n nextFrame = prevFrame;\n // Execute this frame\n thisFrame.forEach(triggerCallback);\n // Clear the frame so no callbacks remain. This is to avoid\n // memory leaks should this render step not run for a while.\n thisFrame.clear();\n isProcessing = false;\n if (flushNextFrame) {\n flushNextFrame = false;\n step.process(frameData);\n }\n },\n };\n return step;\n}\n\nexport { createRenderStep };\n//# sourceMappingURL=render-step.mjs.map\n","import { noop } from 'motion-utils';\nimport { createRenderBatcher } from './batcher.mjs';\n\nconst { schedule: frame, cancel: cancelFrame, state: frameData, steps: frameSteps, } = /* @__PURE__ */ createRenderBatcher(typeof requestAnimationFrame !== \"undefined\" ? requestAnimationFrame : noop, true);\n\nexport { cancelFrame, frame, frameData, frameSteps };\n//# sourceMappingURL=frame.mjs.map\n","import { MotionGlobalConfig } from 'motion-utils';\nimport { frameData } from './frame.mjs';\n\nlet now;\nfunction clearTime() {\n now = undefined;\n}\n/**\n * An eventloop-synchronous alternative to performance.now().\n *\n * Ensures that time measurements remain consistent within a synchronous context.\n * Usually calling performance.now() twice within the same synchronous context\n * will return different values which isn't useful for animations when we're usually\n * trying to sync animations to the same frame.\n */\nconst time = {\n now: () => {\n if (now === undefined) {\n time.set(frameData.isProcessing || MotionGlobalConfig.useManualTiming\n ? frameData.timestamp\n : performance.now());\n }\n return now;\n },\n set: (newTime) => {\n now = newTime;\n queueMicrotask(clearTime);\n },\n};\n\nexport { time };\n//# sourceMappingURL=sync-time.mjs.map\n","const checkStringStartsWith = (token) => (key) => typeof key === \"string\" && key.startsWith(token);\nconst isCSSVariableName = \n/*@__PURE__*/ checkStringStartsWith(\"--\");\nconst startsAsVariableToken = \n/*@__PURE__*/ checkStringStartsWith(\"var(--\");\nconst isCSSVariableToken = (value) => {\n const startsWithToken = startsAsVariableToken(value);\n if (!startsWithToken)\n return false;\n // Ensure any comments are stripped from the value as this can harm performance of the regex.\n return singleCssVariableRegex.test(value.split(\"/*\")[0].trim());\n};\nconst singleCssVariableRegex = /var\\(--(?:[\\w-]+\\s*|[\\w-]+\\s*,(?:\\s*[^)(\\s]|\\s*\\((?:[^)(]|\\([^)(]*\\))*\\))+\\s*)\\)$/iu;\n/**\n * Check if a value contains a CSS variable anywhere (e.g. inside calc()).\n * Unlike isCSSVariableToken which checks if the value IS a var() token,\n * this checks if the value CONTAINS var() somewhere in the string.\n */\nfunction containsCSSVariable(value) {\n if (typeof value !== \"string\")\n return false;\n // Strip comments to avoid false positives\n return value.split(\"/*\")[0].includes(\"var(--\");\n}\n\nexport { containsCSSVariable, isCSSVariableName, isCSSVariableToken };\n//# sourceMappingURL=is-css-variable.mjs.map\n","import { clamp } from 'motion-utils';\n\nconst number = {\n test: (v) => typeof v === \"number\",\n parse: parseFloat,\n transform: (v) => v,\n};\nconst alpha = {\n ...number,\n transform: (v) => clamp(0, 1, v),\n};\nconst scale = {\n ...number,\n default: 1,\n};\n\nexport { alpha, number, scale };\n//# sourceMappingURL=index.mjs.map\n","// If this number is a decimal, make it just five decimal places\n// to avoid exponents\nconst sanitize = (v) => Math.round(v * 100000) / 100000;\n\nexport { sanitize };\n//# sourceMappingURL=sanitize.mjs.map\n","const floatRegex = /-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)/gu;\n\nexport { floatRegex };\n//# sourceMappingURL=float-regex.mjs.map\n","const singleColorRegex = /^(?:#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\))$/iu;\n\nexport { singleColorRegex };\n//# sourceMappingURL=single-color-regex.mjs.map\n","import { floatRegex } from '../utils/float-regex.mjs';\nimport { isNullish } from '../utils/is-nullish.mjs';\nimport { singleColorRegex } from '../utils/single-color-regex.mjs';\n\n/**\n * Returns true if the provided string is a color, ie rgba(0,0,0,0) or #000,\n * but false if a number or multiple colors\n */\nconst isColorString = (type, testProp) => (v) => {\n return Boolean((typeof v === \"string\" &&\n singleColorRegex.test(v) &&\n v.startsWith(type)) ||\n (testProp &&\n !isNullish(v) &&\n Object.prototype.hasOwnProperty.call(v, testProp)));\n};\nconst splitColor = (aName, bName, cName) => (v) => {\n if (typeof v !== \"string\")\n return v;\n const [a, b, c, alpha] = v.match(floatRegex);\n return {\n [aName]: parseFloat(a),\n [bName]: parseFloat(b),\n [cName]: parseFloat(c),\n alpha: alpha !== undefined ? parseFloat(alpha) : 1,\n };\n};\n\nexport { isColorString, splitColor };\n//# sourceMappingURL=utils.mjs.map\n","function isNullish(v) {\n return v == null;\n}\n\nexport { isNullish };\n//# sourceMappingURL=is-nullish.mjs.map\n","import { clamp } from 'motion-utils';\nimport { number, alpha } from '../numbers/index.mjs';\nimport { sanitize } from '../utils/sanitize.mjs';\nimport { splitColor, isColorString } from './utils.mjs';\n\nconst clampRgbUnit = (v) => clamp(0, 255, v);\nconst rgbUnit = {\n ...number,\n transform: (v) => Math.round(clampRgbUnit(v)),\n};\nconst rgba = {\n test: /*@__PURE__*/ isColorString(\"rgb\", \"red\"),\n parse: /*@__PURE__*/ splitColor(\"red\", \"green\", \"blue\"),\n transform: ({ red, green, blue, alpha: alpha$1 = 1 }) => \"rgba(\" +\n rgbUnit.transform(red) +\n \", \" +\n rgbUnit.transform(green) +\n \", \" +\n rgbUnit.transform(blue) +\n \", \" +\n sanitize(alpha.transform(alpha$1)) +\n \")\",\n};\n\nexport { rgbUnit, rgba };\n//# sourceMappingURL=rgba.mjs.map\n","import { rgba } from './rgba.mjs';\nimport { isColorString } from './utils.mjs';\n\nfunction parseHex(v) {\n let r = \"\";\n let g = \"\";\n let b = \"\";\n let a = \"\";\n // If we have 6 characters, ie #FF0000\n if (v.length > 5) {\n r = v.substring(1, 3);\n g = v.substring(3, 5);\n b = v.substring(5, 7);\n a = v.substring(7, 9);\n // Or we have 3 characters, ie #F00\n }\n else {\n r = v.substring(1, 2);\n g = v.substring(2, 3);\n b = v.substring(3, 4);\n a = v.substring(4, 5);\n r += r;\n g += g;\n b += b;\n a += a;\n }\n return {\n red: parseInt(r, 16),\n green: parseInt(g, 16),\n blue: parseInt(b, 16),\n alpha: a ? parseInt(a, 16) / 255 : 1,\n };\n}\nconst hex = {\n test: /*@__PURE__*/ isColorString(\"#\"),\n parse: parseHex,\n transform: rgba.transform,\n};\n\nexport { hex };\n//# sourceMappingURL=hex.mjs.map\n","/*#__NO_SIDE_EFFECTS__*/\nconst createUnitType = (unit) => ({\n test: (v) => typeof v === \"string\" && v.endsWith(unit) && v.split(\" \").length === 1,\n parse: parseFloat,\n transform: (v) => `${v}${unit}`,\n});\nconst degrees = /*@__PURE__*/ createUnitType(\"deg\");\nconst percent = /*@__PURE__*/ createUnitType(\"%\");\nconst px = /*@__PURE__*/ createUnitType(\"px\");\nconst vh = /*@__PURE__*/ createUnitType(\"vh\");\nconst vw = /*@__PURE__*/ createUnitType(\"vw\");\nconst progressPercentage = /*@__PURE__*/ (() => ({\n ...percent,\n parse: (v) => percent.parse(v) / 100,\n transform: (v) => percent.transform(v * 100),\n}))();\n\nexport { degrees, percent, progressPercentage, px, vh, vw };\n//# sourceMappingURL=units.mjs.map\n","import { alpha } from '../numbers/index.mjs';\nimport { percent } from '../numbers/units.mjs';\nimport { sanitize } from '../utils/sanitize.mjs';\nimport { splitColor, isColorString } from './utils.mjs';\n\nconst hsla = {\n test: /*@__PURE__*/ isColorString(\"hsl\", \"hue\"),\n parse: /*@__PURE__*/ splitColor(\"hue\", \"saturation\", \"lightness\"),\n transform: ({ hue, saturation, lightness, alpha: alpha$1 = 1 }) => {\n return (\"hsla(\" +\n Math.round(hue) +\n \", \" +\n percent.transform(sanitize(saturation)) +\n \", \" +\n percent.transform(sanitize(lightness)) +\n \", \" +\n sanitize(alpha.transform(alpha$1)) +\n \")\");\n },\n};\n\nexport { hsla };\n//# sourceMappingURL=hsla.mjs.map\n","import { hex } from './hex.mjs';\nimport { hsla } from './hsla.mjs';\nimport { rgba } from './rgba.mjs';\n\nconst color = {\n test: (v) => rgba.test(v) || hex.test(v) || hsla.test(v),\n parse: (v) => {\n if (rgba.test(v)) {\n return rgba.parse(v);\n }\n else if (hsla.test(v)) {\n return hsla.parse(v);\n }\n else {\n return hex.parse(v);\n }\n },\n transform: (v) => {\n return typeof v === \"string\"\n ? v\n : v.hasOwnProperty(\"red\")\n ? rgba.transform(v)\n : hsla.transform(v);\n },\n getAnimatableNone: (v) => {\n const parsed = color.parse(v);\n parsed.alpha = 0;\n return color.transform(parsed);\n },\n};\n\nexport { color };\n//# sourceMappingURL=index.mjs.map\n","const colorRegex = /(?:#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\))/giu;\n\nexport { colorRegex };\n//# sourceMappingURL=color-regex.mjs.map\n","import { color } from '../color/index.mjs';\nimport { colorRegex } from '../utils/color-regex.mjs';\nimport { floatRegex } from '../utils/float-regex.mjs';\nimport { sanitize } from '../utils/sanitize.mjs';\n\nfunction test(v) {\n return (isNaN(v) &&\n typeof v === \"string\" &&\n (v.match(floatRegex)?.length || 0) +\n (v.match(colorRegex)?.length || 0) >\n 0);\n}\nconst NUMBER_TOKEN = \"number\";\nconst COLOR_TOKEN = \"color\";\nconst VAR_TOKEN = \"var\";\nconst VAR_FUNCTION_TOKEN = \"var(\";\nconst SPLIT_TOKEN = \"${}\";\n// this regex consists of the `singleCssVariableRegex|rgbHSLValueRegex|digitRegex`\nconst complexRegex = /var\\s*\\(\\s*--(?:[\\w-]+\\s*|[\\w-]+\\s*,(?:\\s*[^)(\\s]|\\s*\\((?:[^)(]|\\([^)(]*\\))*\\))+\\s*)\\)|#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\)|-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)/giu;\nfunction analyseComplexValue(value) {\n const originalValue = value.toString();\n const values = [];\n const indexes = {\n color: [],\n number: [],\n var: [],\n };\n const types = [];\n let i = 0;\n const tokenised = originalValue.replace(complexRegex, (parsedValue) => {\n if (color.test(parsedValue)) {\n indexes.color.push(i);\n types.push(COLOR_TOKEN);\n values.push(color.parse(parsedValue));\n }\n else if (parsedValue.startsWith(VAR_FUNCTION_TOKEN)) {\n indexes.var.push(i);\n types.push(VAR_TOKEN);\n values.push(parsedValue);\n }\n else {\n indexes.number.push(i);\n types.push(NUMBER_TOKEN);\n values.push(parseFloat(parsedValue));\n }\n ++i;\n return SPLIT_TOKEN;\n });\n const split = tokenised.split(SPLIT_TOKEN);\n return { values, split, indexes, types };\n}\nfunction parseComplexValue(v) {\n return analyseComplexValue(v).values;\n}\nfunction buildTransformer({ split, types }) {\n const numSections = split.length;\n return (v) => {\n let output = \"\";\n for (let i = 0; i < numSections; i++) {\n output += split[i];\n if (v[i] !== undefined) {\n const type = types[i];\n if (type === NUMBER_TOKEN) {\n output += sanitize(v[i]);\n }\n else if (type === COLOR_TOKEN) {\n output += color.transform(v[i]);\n }\n else {\n output += v[i];\n }\n }\n }\n return output;\n };\n}\nfunction createTransformer(source) {\n return buildTransformer(analyseComplexValue(source));\n}\nconst convertNumbersToZero = (v) => typeof v === \"number\" ? 0 : color.test(v) ? color.getAnimatableNone(v) : v;\n/**\n * Convert a parsed value to its zero equivalent, but preserve numbers\n * that act as divisors in CSS calc() expressions.\n *\n * analyseComplexValue extracts numbers from CSS strings and puts the\n * surrounding text into a `split` template array. For example:\n * \"calc(var(--gap) / 5)\" → values: [var(--gap), 5]\n * split: [\"calc(\", \" / \", \")\"]\n *\n * When building a zero-equivalent for animation, naively zeroing all\n * numbers turns the divisor into 0 → \"calc(var(--gap) / 0)\" → NaN.\n * We detect this by checking whether the text preceding a number\n * (split[i]) ends with \"/\" — the CSS calc division operator.\n */\nconst convertToZero = (value, splitBefore) => {\n if (typeof value === \"number\") {\n return splitBefore?.trim().endsWith(\"/\") ? value : 0;\n }\n return convertNumbersToZero(value);\n};\nfunction getAnimatableNone(v) {\n const info = analyseComplexValue(v);\n const transformer = buildTransformer(info);\n return transformer(info.values.map((value, i) => convertToZero(value, info.split[i])));\n}\nconst complex = {\n test,\n parse: parseComplexValue,\n createTransformer,\n getAnimatableNone,\n};\n\nexport { analyseComplexValue, complex };\n//# sourceMappingURL=index.mjs.map\n","// Adapted from https://gist.github.com/mjackson/5311256\nfunction hueToRgb(p, q, t) {\n if (t < 0)\n t += 1;\n if (t > 1)\n t -= 1;\n if (t < 1 / 6)\n return p + (q - p) * 6 * t;\n if (t < 1 / 2)\n return q;\n if (t < 2 / 3)\n return p + (q - p) * (2 / 3 - t) * 6;\n return p;\n}\nfunction hslaToRgba({ hue, saturation, lightness, alpha }) {\n hue /= 360;\n saturation /= 100;\n lightness /= 100;\n let red = 0;\n let green = 0;\n let blue = 0;\n if (!saturation) {\n red = green = blue = lightness;\n }\n else {\n const q = lightness < 0.5\n ? lightness * (1 + saturation)\n : lightness + saturation - lightness * saturation;\n const p = 2 * lightness - q;\n red = hueToRgb(p, q, hue + 1 / 3);\n green = hueToRgb(p, q, hue);\n blue = hueToRgb(p, q, hue - 1 / 3);\n }\n return {\n red: Math.round(red * 255),\n green: Math.round(green * 255),\n blue: Math.round(blue * 255),\n alpha,\n };\n}\n\nexport { hslaToRgba };\n//# sourceMappingURL=hsla-to-rgba.mjs.map\n","function mixImmediate(a, b) {\n return (p) => (p > 0 ? b : a);\n}\n\nexport { mixImmediate };\n//# sourceMappingURL=immediate.mjs.map\n","/*\n Value in range from progress\n\n Given a lower limit and an upper limit, we return the value within\n that range as expressed by progress (usually a number from 0 to 1)\n\n So progress = 0.5 would change\n\n from -------- to\n\n to\n\n from ---- to\n\n E.g. from = 10, to = 20, progress = 0.5 => 15\n\n @param [number]: Lower limit of range\n @param [number]: Upper limit of range\n @param [number]: The progress between lower and upper limits expressed 0-1\n @return [number]: Value as calculated from progress within range (not limited within range)\n*/\nconst mixNumber = (from, to, progress) => {\n return from + (to - from) * progress;\n};\n\nexport { mixNumber };\n//# sourceMappingURL=number.mjs.map\n","import { warning } from 'motion-utils';\nimport { hex } from '../../value/types/color/hex.mjs';\nimport { hsla } from '../../value/types/color/hsla.mjs';\nimport { hslaToRgba } from '../../value/types/color/hsla-to-rgba.mjs';\nimport { rgba } from '../../value/types/color/rgba.mjs';\nimport { mixImmediate } from './immediate.mjs';\nimport { mixNumber } from './number.mjs';\n\n// Linear color space blending\n// Explained https://www.youtube.com/watch?v=LKnqECcg6Gw\n// Demonstrated http://codepen.io/osublake/pen/xGVVaN\nconst mixLinearColor = (from, to, v) => {\n const fromExpo = from * from;\n const expo = v * (to * to - fromExpo) + fromExpo;\n return expo < 0 ? 0 : Math.sqrt(expo);\n};\nconst colorTypes = [hex, rgba, hsla];\nconst getColorType = (v) => colorTypes.find((type) => type.test(v));\nfunction asRGBA(color) {\n const type = getColorType(color);\n warning(Boolean(type), `'${color}' is not an animatable color. Use the equivalent color code instead.`, \"color-not-animatable\");\n if (!Boolean(type))\n return false;\n let model = type.parse(color);\n if (type === hsla) {\n // TODO Remove this cast - needed since Motion's stricter typing\n model = hslaToRgba(model);\n }\n return model;\n}\nconst mixColor = (from, to) => {\n const fromRGBA = asRGBA(from);\n const toRGBA = asRGBA(to);\n if (!fromRGBA || !toRGBA) {\n return mixImmediate(from, to);\n }\n const blended = { ...fromRGBA };\n return (v) => {\n blended.red = mixLinearColor(fromRGBA.red, toRGBA.red, v);\n blended.green = mixLinearColor(fromRGBA.green, toRGBA.green, v);\n blended.blue = mixLinearColor(fromRGBA.blue, toRGBA.blue, v);\n blended.alpha = mixNumber(fromRGBA.alpha, toRGBA.alpha, v);\n return rgba.transform(blended);\n };\n};\n\nexport { mixColor, mixLinearColor };\n//# sourceMappingURL=color.mjs.map\n","const invisibleValues = new Set([\"none\", \"hidden\"]);\n/**\n * Returns a function that, when provided a progress value between 0 and 1,\n * will return the \"none\" or \"hidden\" string only when the progress is that of\n * the origin or target.\n */\nfunction mixVisibility(origin, target) {\n if (invisibleValues.has(origin)) {\n return (p) => (p <= 0 ? origin : target);\n }\n else {\n return (p) => (p >= 1 ? target : origin);\n }\n}\n\nexport { invisibleValues, mixVisibility };\n//# sourceMappingURL=visibility.mjs.map\n","import { pipe, warning } from 'motion-utils';\nimport { isCSSVariableToken } from '../../animation/utils/is-css-variable.mjs';\nimport { color } from '../../value/types/color/index.mjs';\nimport { complex, analyseComplexValue } from '../../value/types/complex/index.mjs';\nimport { mixColor } from './color.mjs';\nimport { mixImmediate } from './immediate.mjs';\nimport { mixNumber as mixNumber$1 } from './number.mjs';\nimport { invisibleValues, mixVisibility } from './visibility.mjs';\n\nfunction mixNumber(a, b) {\n return (p) => mixNumber$1(a, b, p);\n}\nfunction getMixer(a) {\n if (typeof a === \"number\") {\n return mixNumber;\n }\n else if (typeof a === \"string\") {\n return isCSSVariableToken(a)\n ? mixImmediate\n : color.test(a)\n ? mixColor\n : mixComplex;\n }\n else if (Array.isArray(a)) {\n return mixArray;\n }\n else if (typeof a === \"object\") {\n return color.test(a) ? mixColor : mixObject;\n }\n return mixImmediate;\n}\nfunction mixArray(a, b) {\n const output = [...a];\n const numValues = output.length;\n const blendValue = a.map((v, i) => getMixer(v)(v, b[i]));\n return (p) => {\n for (let i = 0; i < numValues; i++) {\n output[i] = blendValue[i](p);\n }\n return output;\n };\n}\nfunction mixObject(a, b) {\n const output = { ...a, ...b };\n const blendValue = {};\n for (const key in output) {\n if (a[key] !== undefined && b[key] !== undefined) {\n blendValue[key] = getMixer(a[key])(a[key], b[key]);\n }\n }\n return (v) => {\n for (const key in blendValue) {\n output[key] = blendValue[key](v);\n }\n return output;\n };\n}\nfunction matchOrder(origin, target) {\n const orderedOrigin = [];\n const pointers = { color: 0, var: 0, number: 0 };\n for (let i = 0; i < target.values.length; i++) {\n const type = target.types[i];\n const originIndex = origin.indexes[type][pointers[type]];\n const originValue = origin.values[originIndex] ?? 0;\n orderedOrigin[i] = originValue;\n pointers[type]++;\n }\n return orderedOrigin;\n}\nconst mixComplex = (origin, target) => {\n const template = complex.createTransformer(target);\n const originStats = analyseComplexValue(origin);\n const targetStats = analyseComplexValue(target);\n const canInterpolate = originStats.indexes.var.length === targetStats.indexes.var.length &&\n originStats.indexes.color.length === targetStats.indexes.color.length &&\n originStats.indexes.number.length >= targetStats.indexes.number.length;\n if (canInterpolate) {\n if ((invisibleValues.has(origin) &&\n !targetStats.values.length) ||\n (invisibleValues.has(target) &&\n !originStats.values.length)) {\n return mixVisibility(origin, target);\n }\n return pipe(mixArray(matchOrder(originStats, targetStats), targetStats.values), template);\n }\n else {\n warning(true, `Complex values '${origin}' and '${target}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`, \"complex-values-different\");\n return mixImmediate(origin, target);\n }\n};\n\nexport { getMixer, mixArray, mixComplex, mixObject };\n//# sourceMappingURL=complex.mjs.map\n","import { getMixer } from './complex.mjs';\nimport { mixNumber } from './number.mjs';\n\nfunction mix(from, to, p) {\n if (typeof from === \"number\" &&\n typeof to === \"number\" &&\n typeof p === \"number\") {\n return mixNumber(from, to, p);\n }\n const mixer = getMixer(from);\n return mixer(from, to);\n}\n\nexport { mix };\n//# sourceMappingURL=index.mjs.map\n","import { time } from '../../frameloop/sync-time.mjs';\nimport { frameData, cancelFrame, frame } from '../../frameloop/frame.mjs';\n\nconst frameloopDriver = (update) => {\n const passTimestamp = ({ timestamp }) => update(timestamp);\n return {\n start: (keepAlive = true) => frame.update(passTimestamp, keepAlive),\n stop: () => cancelFrame(passTimestamp),\n /**\n * If we're processing this frame we can use the\n * framelocked timestamp to keep things in sync.\n */\n now: () => (frameData.isProcessing ? frameData.timestamp : time.now()),\n };\n};\n\nexport { frameloopDriver };\n//# sourceMappingURL=frame.mjs.map\n","const generateLinearEasing = (easing, duration, // as milliseconds\nresolution = 10 // as milliseconds\n) => {\n let points = \"\";\n const numPoints = Math.max(Math.round(duration / resolution), 2);\n for (let i = 0; i < numPoints; i++) {\n points += Math.round(easing(i / (numPoints - 1)) * 10000) / 10000 + \", \";\n }\n return `linear(${points.substring(0, points.length - 2)})`;\n};\n\nexport { generateLinearEasing };\n//# sourceMappingURL=linear.mjs.map\n","/**\n * Implement a practical max duration for keyframe generation\n * to prevent infinite loops\n */\nconst maxGeneratorDuration = 20000;\nfunction calcGeneratorDuration(generator) {\n let duration = 0;\n const timeStep = 50;\n let state = generator.next(duration);\n while (!state.done && duration < maxGeneratorDuration) {\n duration += timeStep;\n state = generator.next(duration);\n }\n return duration >= maxGeneratorDuration ? Infinity : duration;\n}\n\nexport { calcGeneratorDuration, maxGeneratorDuration };\n//# sourceMappingURL=calc-duration.mjs.map\n","import { millisecondsToSeconds, clamp, secondsToMilliseconds, warning } from 'motion-utils';\nimport { generateLinearEasing } from '../waapi/utils/linear.mjs';\nimport { calcGeneratorDuration, maxGeneratorDuration } from './utils/calc-duration.mjs';\nimport { createGeneratorEasing } from './utils/create-generator-easing.mjs';\n\nconst springDefaults = {\n // Default spring physics\n stiffness: 100,\n damping: 10,\n mass: 1.0,\n velocity: 0.0,\n // Default duration/bounce-based options\n duration: 800, // in ms\n bounce: 0.3,\n visualDuration: 0.3, // in seconds\n // Rest thresholds\n restSpeed: {\n granular: 0.01,\n default: 2,\n },\n restDelta: {\n granular: 0.005,\n default: 0.5,\n },\n // Limits\n minDuration: 0.01, // in seconds\n maxDuration: 10.0, // in seconds\n minDamping: 0.05,\n maxDamping: 1,\n};\nfunction calcAngularFreq(undampedFreq, dampingRatio) {\n return undampedFreq * Math.sqrt(1 - dampingRatio * dampingRatio);\n}\nconst rootIterations = 12;\nfunction approximateRoot(envelope, derivative, initialGuess) {\n let result = initialGuess;\n for (let i = 1; i < rootIterations; i++) {\n result = result - envelope(result) / derivative(result);\n }\n return result;\n}\n/**\n * This is ported from the Framer implementation of duration-based spring resolution.\n */\nconst safeMin = 0.001;\nfunction findSpring({ duration = springDefaults.duration, bounce = springDefaults.bounce, velocity = springDefaults.velocity, mass = springDefaults.mass, }) {\n let envelope;\n let derivative;\n warning(duration <= secondsToMilliseconds(springDefaults.maxDuration), \"Spring duration must be 10 seconds or less\", \"spring-duration-limit\");\n let dampingRatio = 1 - bounce;\n /**\n * Restrict dampingRatio and duration to within acceptable ranges.\n */\n dampingRatio = clamp(springDefaults.minDamping, springDefaults.maxDamping, dampingRatio);\n duration = clamp(springDefaults.minDuration, springDefaults.maxDuration, millisecondsToSeconds(duration));\n if (dampingRatio < 1) {\n /**\n * Underdamped spring\n */\n envelope = (undampedFreq) => {\n const exponentialDecay = undampedFreq * dampingRatio;\n const delta = exponentialDecay * duration;\n const a = exponentialDecay - velocity;\n const b = calcAngularFreq(undampedFreq, dampingRatio);\n const c = Math.exp(-delta);\n return safeMin - (a / b) * c;\n };\n derivative = (undampedFreq) => {\n const exponentialDecay = undampedFreq * dampingRatio;\n const delta = exponentialDecay * duration;\n const d = delta * velocity + velocity;\n const e = Math.pow(dampingRatio, 2) * Math.pow(undampedFreq, 2) * duration;\n const f = Math.exp(-delta);\n const g = calcAngularFreq(Math.pow(undampedFreq, 2), dampingRatio);\n const factor = -envelope(undampedFreq) + safeMin > 0 ? -1 : 1;\n return (factor * ((d - e) * f)) / g;\n };\n }\n else {\n /**\n * Critically-damped spring\n */\n envelope = (undampedFreq) => {\n const a = Math.exp(-undampedFreq * duration);\n const b = (undampedFreq - velocity) * duration + 1;\n return -safeMin + a * b;\n };\n derivative = (undampedFreq) => {\n const a = Math.exp(-undampedFreq * duration);\n const b = (velocity - undampedFreq) * (duration * duration);\n return a * b;\n };\n }\n const initialGuess = 5 / duration;\n const undampedFreq = approximateRoot(envelope, derivative, initialGuess);\n duration = secondsToMilliseconds(duration);\n if (isNaN(undampedFreq)) {\n return {\n stiffness: springDefaults.stiffness,\n damping: springDefaults.damping,\n duration,\n };\n }\n else {\n const stiffness = Math.pow(undampedFreq, 2) * mass;\n return {\n stiffness,\n damping: dampingRatio * 2 * Math.sqrt(mass * stiffness),\n duration,\n };\n }\n}\nconst durationKeys = [\"duration\", \"bounce\"];\nconst physicsKeys = [\"stiffness\", \"damping\", \"mass\"];\nfunction isSpringType(options, keys) {\n return keys.some((key) => options[key] !== undefined);\n}\nfunction getSpringOptions(options) {\n let springOptions = {\n velocity: springDefaults.velocity,\n stiffness: springDefaults.stiffness,\n damping: springDefaults.damping,\n mass: springDefaults.mass,\n isResolvedFromDuration: false,\n ...options,\n };\n // stiffness/damping/mass overrides duration/bounce\n if (!isSpringType(options, physicsKeys) &&\n isSpringType(options, durationKeys)) {\n // Time-defined springs should ignore inherited velocity.\n // Velocity from interrupted animations can cause findSpring()\n // to compute wildly different spring parameters, leading to\n // massive oscillation on small-range animations.\n springOptions.velocity = 0;\n if (options.visualDuration) {\n const visualDuration = options.visualDuration;\n const root = (2 * Math.PI) / (visualDuration * 1.2);\n const stiffness = root * root;\n const damping = 2 *\n clamp(0.05, 1, 1 - (options.bounce || 0)) *\n Math.sqrt(stiffness);\n springOptions = {\n ...springOptions,\n mass: springDefaults.mass,\n stiffness,\n damping,\n };\n }\n else {\n const derived = findSpring({ ...options, velocity: 0 });\n springOptions = {\n ...springOptions,\n ...derived,\n mass: springDefaults.mass,\n };\n springOptions.isResolvedFromDuration = true;\n }\n }\n return springOptions;\n}\nfunction spring(optionsOrVisualDuration = springDefaults.visualDuration, bounce = springDefaults.bounce) {\n const options = typeof optionsOrVisualDuration !== \"object\"\n ? {\n visualDuration: optionsOrVisualDuration,\n keyframes: [0, 1],\n bounce,\n }\n : optionsOrVisualDuration;\n let { restSpeed, restDelta } = options;\n const origin = options.keyframes[0];\n const target = options.keyframes[options.keyframes.length - 1];\n /**\n * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator\n * to reduce GC during animation.\n */\n const state = { done: false, value: origin };\n const { stiffness, damping, mass, duration, velocity, isResolvedFromDuration, } = getSpringOptions({\n ...options,\n velocity: -millisecondsToSeconds(options.velocity || 0),\n });\n const initialVelocity = velocity || 0.0;\n const dampingRatio = damping / (2 * Math.sqrt(stiffness * mass));\n const initialDelta = target - origin;\n const undampedAngularFreq = millisecondsToSeconds(Math.sqrt(stiffness / mass));\n /**\n * If we're working on a granular scale, use smaller defaults for determining\n * when the spring is finished.\n *\n * These defaults have been selected emprically based on what strikes a good\n * ratio between feeling good and finishing as soon as changes are imperceptible.\n */\n const isGranularScale = Math.abs(initialDelta) < 5;\n restSpeed || (restSpeed = isGranularScale\n ? springDefaults.restSpeed.granular\n : springDefaults.restSpeed.default);\n restDelta || (restDelta = isGranularScale\n ? springDefaults.restDelta.granular\n : springDefaults.restDelta.default);\n let resolveSpring;\n let resolveVelocity;\n // Underdamped coefficients, hoisted for use in the inlined next() hot path\n let angularFreq;\n let A;\n let sinCoeff;\n let cosCoeff;\n if (dampingRatio < 1) {\n angularFreq = calcAngularFreq(undampedAngularFreq, dampingRatio);\n A =\n (initialVelocity +\n dampingRatio * undampedAngularFreq * initialDelta) /\n angularFreq;\n // Underdamped spring\n resolveSpring = (t) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);\n return (target -\n envelope *\n (A * Math.sin(angularFreq * t) +\n initialDelta * Math.cos(angularFreq * t)));\n };\n // Analytical derivative of underdamped spring (px/ms)\n sinCoeff =\n dampingRatio * undampedAngularFreq * A + initialDelta * angularFreq;\n cosCoeff =\n dampingRatio * undampedAngularFreq * initialDelta - A * angularFreq;\n resolveVelocity = (t) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);\n return envelope *\n (sinCoeff * Math.sin(angularFreq * t) +\n cosCoeff * Math.cos(angularFreq * t));\n };\n }\n else if (dampingRatio === 1) {\n // Critically damped spring\n resolveSpring = (t) => target -\n Math.exp(-undampedAngularFreq * t) *\n (initialDelta +\n (initialVelocity + undampedAngularFreq * initialDelta) * t);\n // Analytical derivative of critically damped spring (px/ms)\n const C = initialVelocity + undampedAngularFreq * initialDelta;\n resolveVelocity = (t) => Math.exp(-undampedAngularFreq * t) *\n (undampedAngularFreq * C * t - initialVelocity);\n }\n else {\n // Overdamped spring\n const dampedAngularFreq = undampedAngularFreq * Math.sqrt(dampingRatio * dampingRatio - 1);\n resolveSpring = (t) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);\n // When performing sinh or cosh values can hit Infinity so we cap them here\n const freqForT = Math.min(dampedAngularFreq * t, 300);\n return (target -\n (envelope *\n ((initialVelocity +\n dampingRatio * undampedAngularFreq * initialDelta) *\n Math.sinh(freqForT) +\n dampedAngularFreq *\n initialDelta *\n Math.cosh(freqForT))) /\n dampedAngularFreq);\n };\n // Analytical derivative of overdamped spring (px/ms)\n const P = (initialVelocity +\n dampingRatio * undampedAngularFreq * initialDelta) /\n dampedAngularFreq;\n const sinhCoeff = dampingRatio * undampedAngularFreq * P - initialDelta * dampedAngularFreq;\n const coshCoeff = dampingRatio * undampedAngularFreq * initialDelta - P * dampedAngularFreq;\n resolveVelocity = (t) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);\n const freqForT = Math.min(dampedAngularFreq * t, 300);\n return envelope *\n (sinhCoeff * Math.sinh(freqForT) +\n coshCoeff * Math.cosh(freqForT));\n };\n }\n const generator = {\n calculatedDuration: isResolvedFromDuration ? duration || null : null,\n velocity: (t) => secondsToMilliseconds(resolveVelocity(t)),\n next: (t) => {\n /**\n * For underdamped physics springs we need both position and\n * velocity each tick. Compute shared trig values once to avoid\n * duplicate Math.exp/sin/cos calls on the hot path.\n */\n if (!isResolvedFromDuration && dampingRatio < 1) {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);\n const sin = Math.sin(angularFreq * t);\n const cos = Math.cos(angularFreq * t);\n const current = target -\n envelope *\n (A * sin + initialDelta * cos);\n const currentVelocity = secondsToMilliseconds(envelope *\n (sinCoeff * sin + cosCoeff * cos));\n state.done =\n Math.abs(currentVelocity) <= restSpeed &&\n Math.abs(target - current) <= restDelta;\n state.value = state.done ? target : current;\n return state;\n }\n const current = resolveSpring(t);\n if (!isResolvedFromDuration) {\n const currentVelocity = secondsToMilliseconds(resolveVelocity(t));\n state.done =\n Math.abs(currentVelocity) <= restSpeed &&\n Math.abs(target - current) <= restDelta;\n }\n else {\n state.done = t >= duration;\n }\n state.value = state.done ? target : current;\n return state;\n },\n toString: () => {\n const calculatedDuration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration);\n const easing = generateLinearEasing((progress) => generator.next(calculatedDuration * progress).value, calculatedDuration, 30);\n return calculatedDuration + \"ms \" + easing;\n },\n toTransition: () => { },\n };\n return generator;\n}\nspring.applyToOptions = (options) => {\n const generatorOptions = createGeneratorEasing(options, 100, spring);\n options.ease = generatorOptions.ease;\n options.duration = secondsToMilliseconds(generatorOptions.duration);\n options.type = \"keyframes\";\n return options;\n};\n\nexport { spring };\n//# sourceMappingURL=spring.mjs.map\n","import { millisecondsToSeconds } from 'motion-utils';\nimport { calcGeneratorDuration, maxGeneratorDuration } from './calc-duration.mjs';\n\n/**\n * Create a progress => progress easing function from a generator.\n */\nfunction createGeneratorEasing(options, scale = 100, createGenerator) {\n const generator = createGenerator({ ...options, keyframes: [0, scale] });\n const duration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration);\n return {\n type: \"keyframes\",\n ease: (progress) => {\n return generator.next(duration * progress).value / scale;\n },\n duration: millisecondsToSeconds(duration),\n };\n}\n\nexport { createGeneratorEasing };\n//# sourceMappingURL=create-generator-easing.mjs.map\n","import { velocityPerSecond } from 'motion-utils';\n\nconst velocitySampleDuration = 5; // ms\nfunction getGeneratorVelocity(resolveValue, t, current) {\n const prevT = Math.max(t - velocitySampleDuration, 0);\n return velocityPerSecond(current - resolveValue(prevT), t - prevT);\n}\n\nexport { getGeneratorVelocity };\n//# sourceMappingURL=velocity.mjs.map\n","import { spring } from './spring.mjs';\nimport { getGeneratorVelocity } from './utils/velocity.mjs';\n\nfunction inertia({ keyframes, velocity = 0.0, power = 0.8, timeConstant = 325, bounceDamping = 10, bounceStiffness = 500, modifyTarget, min, max, restDelta = 0.5, restSpeed, }) {\n const origin = keyframes[0];\n const state = {\n done: false,\n value: origin,\n };\n const isOutOfBounds = (v) => (min !== undefined && v < min) || (max !== undefined && v > max);\n const nearestBoundary = (v) => {\n if (min === undefined)\n return max;\n if (max === undefined)\n return min;\n return Math.abs(min - v) < Math.abs(max - v) ? min : max;\n };\n let amplitude = power * velocity;\n const ideal = origin + amplitude;\n const target = modifyTarget === undefined ? ideal : modifyTarget(ideal);\n /**\n * If the target has changed we need to re-calculate the amplitude, otherwise\n * the animation will start from the wrong position.\n */\n if (target !== ideal)\n amplitude = target - origin;\n const calcDelta = (t) => -amplitude * Math.exp(-t / timeConstant);\n const calcLatest = (t) => target + calcDelta(t);\n const applyFriction = (t) => {\n const delta = calcDelta(t);\n const latest = calcLatest(t);\n state.done = Math.abs(delta) <= restDelta;\n state.value = state.done ? target : latest;\n };\n /**\n * Ideally this would resolve for t in a stateless way, we could\n * do that by always precalculating the animation but as we know\n * this will be done anyway we can assume that spring will\n * be discovered during that.\n */\n let timeReachedBoundary;\n let spring$1;\n const checkCatchBoundary = (t) => {\n if (!isOutOfBounds(state.value))\n return;\n timeReachedBoundary = t;\n spring$1 = spring({\n keyframes: [state.value, nearestBoundary(state.value)],\n velocity: getGeneratorVelocity(calcLatest, t, state.value), // TODO: This should be passing * 1000\n damping: bounceDamping,\n stiffness: bounceStiffness,\n restDelta,\n restSpeed,\n });\n };\n checkCatchBoundary(0);\n return {\n calculatedDuration: null,\n next: (t) => {\n /**\n * We need to resolve the friction to figure out if we need a\n * spring but we don't want to do this twice per frame. So here\n * we flag if we updated for this frame and later if we did\n * we can skip doing it again.\n */\n let hasUpdatedFrame = false;\n if (!spring$1 && timeReachedBoundary === undefined) {\n hasUpdatedFrame = true;\n applyFriction(t);\n checkCatchBoundary(t);\n }\n /**\n * If we have a spring and the provided t is beyond the moment the friction\n * animation crossed the min/max boundary, use the spring.\n */\n if (timeReachedBoundary !== undefined && t >= timeReachedBoundary) {\n return spring$1.next(t - timeReachedBoundary);\n }\n else {\n !hasUpdatedFrame && applyFriction(t);\n return state;\n }\n },\n };\n}\n\nexport { inertia };\n//# sourceMappingURL=inertia.mjs.map\n","import { invariant, clamp, MotionGlobalConfig, noop, pipe, progress } from 'motion-utils';\nimport { mix } from './mix/index.mjs';\n\nfunction createMixers(output, ease, customMixer) {\n const mixers = [];\n const mixerFactory = customMixer || MotionGlobalConfig.mix || mix;\n const numMixers = output.length - 1;\n for (let i = 0; i < numMixers; i++) {\n let mixer = mixerFactory(output[i], output[i + 1]);\n if (ease) {\n const easingFunction = Array.isArray(ease) ? ease[i] || noop : ease;\n mixer = pipe(easingFunction, mixer);\n }\n mixers.push(mixer);\n }\n return mixers;\n}\n/**\n * Create a function that maps from a numerical input array to a generic output array.\n *\n * Accepts:\n * - Numbers\n * - Colors (hex, hsl, hsla, rgb, rgba)\n * - Complex (combinations of one or more numbers or strings)\n *\n * ```jsx\n * const mixColor = interpolate([0, 1], ['#fff', '#000'])\n *\n * mixColor(0.5) // 'rgba(128, 128, 128, 1)'\n * ```\n *\n * TODO Revisit this approach once we've moved to data models for values,\n * probably not needed to pregenerate mixer functions.\n *\n * @public\n */\nfunction interpolate(input, output, { clamp: isClamp = true, ease, mixer } = {}) {\n const inputLength = input.length;\n invariant(inputLength === output.length, \"Both input and output ranges must be the same length\", \"range-length\");\n /**\n * If we're only provided a single input, we can just make a function\n * that returns the output.\n */\n if (inputLength === 1)\n return () => output[0];\n if (inputLength === 2 && output[0] === output[1])\n return () => output[1];\n const isZeroDeltaRange = input[0] === input[1];\n // If input runs highest -> lowest, reverse both arrays\n if (input[0] > input[inputLength - 1]) {\n input = [...input].reverse();\n output = [...output].reverse();\n }\n const mixers = createMixers(output, ease, mixer);\n const numMixers = mixers.length;\n const interpolator = (v) => {\n if (isZeroDeltaRange && v < input[0])\n return output[0];\n let i = 0;\n if (numMixers > 1) {\n for (; i < input.length - 2; i++) {\n if (v < input[i + 1])\n break;\n }\n }\n const progressInRange = progress(input[i], input[i + 1], v);\n return mixers[i](progressInRange);\n };\n return isClamp\n ? (v) => interpolator(clamp(input[0], input[inputLength - 1], v))\n : interpolator;\n}\n\nexport { interpolate };\n//# sourceMappingURL=interpolate.mjs.map\n","import { fillOffset } from './fill.mjs';\n\nfunction defaultOffset(arr) {\n const offset = [0];\n fillOffset(offset, arr.length - 1);\n return offset;\n}\n\nexport { defaultOffset };\n//# sourceMappingURL=default.mjs.map\n","import { progress } from 'motion-utils';\nimport { mixNumber } from '../../../utils/mix/number.mjs';\n\nfunction fillOffset(offset, remaining) {\n const min = offset[offset.length - 1];\n for (let i = 1; i <= remaining; i++) {\n const offsetProgress = progress(0, remaining, i);\n offset.push(mixNumber(min, 1, offsetProgress));\n }\n}\n\nexport { fillOffset };\n//# sourceMappingURL=fill.mjs.map\n","import { easeInOut, isEasingArray, easingDefinitionToFunction } from 'motion-utils';\nimport { interpolate } from '../../utils/interpolate.mjs';\nimport { defaultOffset } from '../keyframes/offsets/default.mjs';\nimport { convertOffsetToTimes } from '../keyframes/offsets/time.mjs';\n\nfunction defaultEasing(values, easing) {\n return values.map(() => easing || easeInOut).splice(0, values.length - 1);\n}\nfunction keyframes({ duration = 300, keyframes: keyframeValues, times, ease = \"easeInOut\", }) {\n /**\n * Easing functions can be externally defined as strings. Here we convert them\n * into actual functions.\n */\n const easingFunctions = isEasingArray(ease)\n ? ease.map(easingDefinitionToFunction)\n : easingDefinitionToFunction(ease);\n /**\n * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator\n * to reduce GC during animation.\n */\n const state = {\n done: false,\n value: keyframeValues[0],\n };\n /**\n * Create a times array based on the provided 0-1 offsets\n */\n const absoluteTimes = convertOffsetToTimes(\n // Only use the provided offsets if they're the correct length\n // TODO Maybe we should warn here if there's a length mismatch\n times && times.length === keyframeValues.length\n ? times\n : defaultOffset(keyframeValues), duration);\n const mapTimeToKeyframe = interpolate(absoluteTimes, keyframeValues, {\n ease: Array.isArray(easingFunctions)\n ? easingFunctions\n : defaultEasing(keyframeValues, easingFunctions),\n });\n return {\n calculatedDuration: duration,\n next: (t) => {\n state.value = mapTimeToKeyframe(t);\n state.done = t >= duration;\n return state;\n },\n };\n}\n\nexport { defaultEasing, keyframes };\n//# sourceMappingURL=keyframes.mjs.map\n","/*#__NO_SIDE_EFFECTS__*/\nconst isEasingArray = (ease) => {\n return Array.isArray(ease) && typeof ease[0] !== \"number\";\n};\n\nexport { isEasingArray };\n//# sourceMappingURL=is-easing-array.mjs.map\n","function convertOffsetToTimes(offset, duration) {\n return offset.map((o) => o * duration);\n}\n\nexport { convertOffsetToTimes };\n//# sourceMappingURL=time.mjs.map\n","const isNotNull = (value) => value !== null;\nfunction getFinalKeyframe(keyframes, { repeat, repeatType = \"loop\" }, finalKeyframe, speed = 1) {\n const resolvedKeyframes = keyframes.filter(isNotNull);\n const useFirstKeyframe = speed < 0 || (repeat && repeatType !== \"loop\" && repeat % 2 === 1);\n const index = useFirstKeyframe ? 0 : resolvedKeyframes.length - 1;\n return !index || finalKeyframe === undefined\n ? resolvedKeyframes[index]\n : finalKeyframe;\n}\n\nexport { getFinalKeyframe };\n//# sourceMappingURL=get-final.mjs.map\n","import { inertia } from '../generators/inertia.mjs';\nimport { keyframes } from '../generators/keyframes.mjs';\nimport { spring } from '../generators/spring.mjs';\n\nconst transitionTypeMap = {\n decay: inertia,\n inertia,\n tween: keyframes,\n keyframes: keyframes,\n spring,\n};\nfunction replaceTransitionType(transition) {\n if (typeof transition.type === \"string\") {\n transition.type = transitionTypeMap[transition.type];\n }\n}\n\nexport { replaceTransitionType };\n//# sourceMappingURL=replace-transition-type.mjs.map\n","class WithPromise {\n constructor() {\n this.updateFinished();\n }\n get finished() {\n return this._finished;\n }\n updateFinished() {\n this._finished = new Promise((resolve) => {\n this.resolve = resolve;\n });\n }\n notifyFinished() {\n this.resolve();\n }\n /**\n * Allows the animation to be awaited.\n *\n * @deprecated Use `finished` instead.\n */\n then(onResolve, onReject) {\n return this.finished.then(onResolve, onReject);\n }\n}\n\nexport { WithPromise };\n//# sourceMappingURL=WithPromise.mjs.map\n","import { invariant, pipe, clamp, millisecondsToSeconds, secondsToMilliseconds } from 'motion-utils';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { mix } from '../utils/mix/index.mjs';\nimport { frameloopDriver } from './drivers/frame.mjs';\nimport { inertia } from './generators/inertia.mjs';\nimport { keyframes } from './generators/keyframes.mjs';\nimport { calcGeneratorDuration } from './generators/utils/calc-duration.mjs';\nimport { getGeneratorVelocity } from './generators/utils/velocity.mjs';\nimport { getFinalKeyframe } from './keyframes/get-final.mjs';\nimport { replaceTransitionType } from './utils/replace-transition-type.mjs';\nimport { WithPromise } from './utils/WithPromise.mjs';\n\nconst percentToProgress = (percent) => percent / 100;\nclass JSAnimation extends WithPromise {\n constructor(options) {\n super();\n this.state = \"idle\";\n this.startTime = null;\n this.isStopped = false;\n /**\n * The current time of the animation.\n */\n this.currentTime = 0;\n /**\n * The time at which the animation was paused.\n */\n this.holdTime = null;\n /**\n * Playback speed as a factor. 0 would be stopped, -1 reverse and 2 double speed.\n */\n this.playbackSpeed = 1;\n /**\n * Reusable state object for the delay phase to avoid\n * allocating a new object every frame.\n */\n this.delayState = {\n done: false,\n value: undefined,\n };\n /**\n * This method is bound to the instance to fix a pattern where\n * animation.stop is returned as a reference from a useEffect.\n */\n this.stop = () => {\n const { motionValue } = this.options;\n if (motionValue && motionValue.updatedAt !== time.now()) {\n this.tick(time.now());\n }\n this.isStopped = true;\n if (this.state === \"idle\")\n return;\n this.teardown();\n this.options.onStop?.();\n };\n this.options = options;\n this.initAnimation();\n this.play();\n if (options.autoplay === false)\n this.pause();\n }\n initAnimation() {\n const { options } = this;\n replaceTransitionType(options);\n const { type = keyframes, repeat = 0, repeatDelay = 0, repeatType, velocity = 0, } = options;\n let { keyframes: keyframes$1 } = options;\n const generatorFactory = type || keyframes;\n if (process.env.NODE_ENV !== \"production\" &&\n generatorFactory !== keyframes) {\n invariant(keyframes$1.length <= 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${keyframes$1}`, \"spring-two-frames\");\n }\n if (generatorFactory !== keyframes &&\n typeof keyframes$1[0] !== \"number\") {\n this.mixKeyframes = pipe(percentToProgress, mix(keyframes$1[0], keyframes$1[1]));\n keyframes$1 = [0, 100];\n }\n const generator = generatorFactory({ ...options, keyframes: keyframes$1 });\n /**\n * If we have a mirror repeat type we need to create a second generator that outputs the\n * mirrored (not reversed) animation and later ping pong between the two generators.\n */\n if (repeatType === \"mirror\") {\n this.mirroredGenerator = generatorFactory({\n ...options,\n keyframes: [...keyframes$1].reverse(),\n velocity: -velocity,\n });\n }\n /**\n * If duration is undefined and we have repeat options,\n * we need to calculate a duration from the generator.\n *\n * We set it to the generator itself to cache the duration.\n * Any timeline resolver will need to have already precalculated\n * the duration by this step.\n */\n if (generator.calculatedDuration === null) {\n generator.calculatedDuration = calcGeneratorDuration(generator);\n }\n const { calculatedDuration } = generator;\n this.calculatedDuration = calculatedDuration;\n this.resolvedDuration = calculatedDuration + repeatDelay;\n this.totalDuration = this.resolvedDuration * (repeat + 1) - repeatDelay;\n this.generator = generator;\n }\n updateTime(timestamp) {\n const animationTime = Math.round(timestamp - this.startTime) * this.playbackSpeed;\n // Update currentTime\n if (this.holdTime !== null) {\n this.currentTime = this.holdTime;\n }\n else {\n // Rounding the time because floating point arithmetic is not always accurate, e.g. 3000.367 - 1000.367 =\n // 2000.0000000000002. This is a problem when we are comparing the currentTime with the duration, for\n // example.\n this.currentTime = animationTime;\n }\n }\n tick(timestamp, sample = false) {\n const { generator, totalDuration, mixKeyframes, mirroredGenerator, resolvedDuration, calculatedDuration, } = this;\n if (this.startTime === null)\n return generator.next(0);\n const { delay = 0, keyframes, repeat, repeatType, repeatDelay, type, onUpdate, finalKeyframe, } = this.options;\n /**\n * requestAnimationFrame timestamps can come through as lower than\n * the startTime as set by performance.now(). Here we prevent this,\n * though in the future it could be possible to make setting startTime\n * a pending operation that gets resolved here.\n */\n if (this.speed > 0) {\n this.startTime = Math.min(this.startTime, timestamp);\n }\n else if (this.speed < 0) {\n this.startTime = Math.min(timestamp - totalDuration / this.speed, this.startTime);\n }\n if (sample) {\n this.currentTime = timestamp;\n }\n else {\n this.updateTime(timestamp);\n }\n // Rebase on delay\n const timeWithoutDelay = this.currentTime - delay * (this.playbackSpeed >= 0 ? 1 : -1);\n const isInDelayPhase = this.playbackSpeed >= 0\n ? timeWithoutDelay < 0\n : timeWithoutDelay > totalDuration;\n this.currentTime = Math.max(timeWithoutDelay, 0);\n // If this animation has finished, set the current time to the total duration.\n if (this.state === \"finished\" && this.holdTime === null) {\n this.currentTime = totalDuration;\n }\n let elapsed = this.currentTime;\n let frameGenerator = generator;\n if (repeat) {\n /**\n * Get the current progress (0-1) of the animation. If t is >\n * than duration we'll get values like 2.5 (midway through the\n * third iteration)\n */\n const progress = Math.min(this.currentTime, totalDuration) / resolvedDuration;\n /**\n * Get the current iteration (0 indexed). For instance the floor of\n * 2.5 is 2.\n */\n let currentIteration = Math.floor(progress);\n /**\n * Get the current progress of the iteration by taking the remainder\n * so 2.5 is 0.5 through iteration 2\n */\n let iterationProgress = progress % 1.0;\n /**\n * If iteration progress is 1 we count that as the end\n * of the previous iteration.\n */\n if (!iterationProgress && progress >= 1) {\n iterationProgress = 1;\n }\n iterationProgress === 1 && currentIteration--;\n currentIteration = Math.min(currentIteration, repeat + 1);\n /**\n * Reverse progress if we're not running in \"normal\" direction\n */\n const isOddIteration = Boolean(currentIteration % 2);\n if (isOddIteration) {\n if (repeatType === \"reverse\") {\n iterationProgress = 1 - iterationProgress;\n if (repeatDelay) {\n iterationProgress -= repeatDelay / resolvedDuration;\n }\n }\n else if (repeatType === \"mirror\") {\n frameGenerator = mirroredGenerator;\n }\n }\n elapsed = clamp(0, 1, iterationProgress) * resolvedDuration;\n }\n /**\n * If we're in negative time, set state as the initial keyframe.\n * This prevents delay: x, duration: 0 animations from finishing\n * instantly.\n */\n let state;\n if (isInDelayPhase) {\n this.delayState.value = keyframes[0];\n state = this.delayState;\n }\n else {\n state = frameGenerator.next(elapsed);\n }\n if (mixKeyframes && !isInDelayPhase) {\n state.value = mixKeyframes(state.value);\n }\n let { done } = state;\n if (!isInDelayPhase && calculatedDuration !== null) {\n done =\n this.playbackSpeed >= 0\n ? this.currentTime >= totalDuration\n : this.currentTime <= 0;\n }\n const isAnimationFinished = this.holdTime === null &&\n (this.state === \"finished\" || (this.state === \"running\" && done));\n // TODO: The exception for inertia could be cleaner here\n if (isAnimationFinished && type !== inertia) {\n state.value = getFinalKeyframe(keyframes, this.options, finalKeyframe, this.speed);\n }\n if (onUpdate) {\n onUpdate(state.value);\n }\n if (isAnimationFinished) {\n this.finish();\n }\n return state;\n }\n /**\n * Allows the returned animation to be awaited or promise-chained. Currently\n * resolves when the animation finishes at all but in a future update could/should\n * reject if its cancels.\n */\n then(resolve, reject) {\n return this.finished.then(resolve, reject);\n }\n get duration() {\n return millisecondsToSeconds(this.calculatedDuration);\n }\n get iterationDuration() {\n const { delay = 0 } = this.options || {};\n return this.duration + millisecondsToSeconds(delay);\n }\n get time() {\n return millisecondsToSeconds(this.currentTime);\n }\n set time(newTime) {\n newTime = secondsToMilliseconds(newTime);\n this.currentTime = newTime;\n if (this.startTime === null ||\n this.holdTime !== null ||\n this.playbackSpeed === 0) {\n this.holdTime = newTime;\n }\n else if (this.driver) {\n this.startTime = this.driver.now() - newTime / this.playbackSpeed;\n }\n if (this.driver) {\n this.driver.start(false);\n }\n else {\n this.startTime = 0;\n this.state = \"paused\";\n this.holdTime = newTime;\n this.tick(newTime);\n }\n }\n /**\n * Returns the generator's velocity at the current time in units/second.\n * Uses the analytical derivative when available (springs), avoiding\n * the MotionValue's frame-dependent velocity estimation.\n */\n getGeneratorVelocity() {\n const t = this.currentTime;\n if (t <= 0)\n return this.options.velocity || 0;\n if (this.generator.velocity) {\n return this.generator.velocity(t);\n }\n // Fallback: finite difference\n const current = this.generator.next(t).value;\n return getGeneratorVelocity((s) => this.generator.next(s).value, t, current);\n }\n get speed() {\n return this.playbackSpeed;\n }\n set speed(newSpeed) {\n const hasChanged = this.playbackSpeed !== newSpeed;\n if (hasChanged && this.driver) {\n this.updateTime(time.now());\n }\n this.playbackSpeed = newSpeed;\n if (hasChanged && this.driver) {\n this.time = millisecondsToSeconds(this.currentTime);\n }\n }\n play() {\n if (this.isStopped)\n return;\n const { driver = frameloopDriver, startTime } = this.options;\n if (!this.driver) {\n this.driver = driver((timestamp) => this.tick(timestamp));\n }\n this.options.onPlay?.();\n const now = this.driver.now();\n if (this.state === \"finished\") {\n this.updateFinished();\n this.startTime = now;\n }\n else if (this.holdTime !== null) {\n this.startTime = now - this.holdTime;\n }\n else if (!this.startTime) {\n this.startTime = startTime ?? now;\n }\n if (this.state === \"finished\" && this.speed < 0) {\n this.startTime += this.calculatedDuration;\n }\n this.holdTime = null;\n /**\n * Set playState to running only after we've used it in\n * the previous logic.\n */\n this.state = \"running\";\n this.driver.start();\n }\n pause() {\n this.state = \"paused\";\n this.updateTime(time.now());\n this.holdTime = this.currentTime;\n }\n complete() {\n if (this.state !== \"running\") {\n this.play();\n }\n this.state = \"finished\";\n this.holdTime = null;\n }\n finish() {\n this.notifyFinished();\n this.teardown();\n this.state = \"finished\";\n this.options.onComplete?.();\n }\n cancel() {\n this.holdTime = null;\n this.startTime = 0;\n this.tick(0);\n this.teardown();\n this.options.onCancel?.();\n }\n teardown() {\n this.state = \"idle\";\n this.stopDriver();\n this.startTime = this.holdTime = null;\n }\n stopDriver() {\n if (!this.driver)\n return;\n this.driver.stop();\n this.driver = undefined;\n }\n sample(sampleTime) {\n this.startTime = 0;\n return this.tick(sampleTime, true);\n }\n attachTimeline(timeline) {\n if (this.options.allowFlatten) {\n this.options.type = \"keyframes\";\n this.options.ease = \"linear\";\n this.initAnimation();\n }\n this.driver?.stop();\n return timeline.observe(this);\n }\n}\n// Legacy function support\nfunction animateValue(options) {\n return new JSAnimation(options);\n}\n\nexport { JSAnimation, animateValue };\n//# sourceMappingURL=JSAnimation.mjs.map\n","const radToDeg = (rad) => (rad * 180) / Math.PI;\nconst rotate = (v) => {\n const angle = radToDeg(Math.atan2(v[1], v[0]));\n return rebaseAngle(angle);\n};\nconst matrix2dParsers = {\n x: 4,\n y: 5,\n translateX: 4,\n translateY: 5,\n scaleX: 0,\n scaleY: 3,\n scale: (v) => (Math.abs(v[0]) + Math.abs(v[3])) / 2,\n rotate,\n rotateZ: rotate,\n skewX: (v) => radToDeg(Math.atan(v[1])),\n skewY: (v) => radToDeg(Math.atan(v[2])),\n skew: (v) => (Math.abs(v[1]) + Math.abs(v[2])) / 2,\n};\nconst rebaseAngle = (angle) => {\n angle = angle % 360;\n if (angle < 0)\n angle += 360;\n return angle;\n};\nconst rotateZ = rotate;\nconst scaleX = (v) => Math.sqrt(v[0] * v[0] + v[1] * v[1]);\nconst scaleY = (v) => Math.sqrt(v[4] * v[4] + v[5] * v[5]);\nconst matrix3dParsers = {\n x: 12,\n y: 13,\n z: 14,\n translateX: 12,\n translateY: 13,\n translateZ: 14,\n scaleX,\n scaleY,\n scale: (v) => (scaleX(v) + scaleY(v)) / 2,\n rotateX: (v) => rebaseAngle(radToDeg(Math.atan2(v[6], v[5]))),\n rotateY: (v) => rebaseAngle(radToDeg(Math.atan2(-v[2], v[0]))),\n rotateZ,\n rotate: rotateZ,\n skewX: (v) => radToDeg(Math.atan(v[4])),\n skewY: (v) => radToDeg(Math.atan(v[1])),\n skew: (v) => (Math.abs(v[1]) + Math.abs(v[4])) / 2,\n};\nfunction defaultTransformValue(name) {\n return name.includes(\"scale\") ? 1 : 0;\n}\nfunction parseValueFromTransform(transform, name) {\n if (!transform || transform === \"none\") {\n return defaultTransformValue(name);\n }\n const matrix3dMatch = transform.match(/^matrix3d\\(([-\\d.e\\s,]+)\\)$/u);\n let parsers;\n let match;\n if (matrix3dMatch) {\n parsers = matrix3dParsers;\n match = matrix3dMatch;\n }\n else {\n const matrix2dMatch = transform.match(/^matrix\\(([-\\d.e\\s,]+)\\)$/u);\n parsers = matrix2dParsers;\n match = matrix2dMatch;\n }\n if (!match) {\n return defaultTransformValue(name);\n }\n const valueParser = parsers[name];\n const values = match[1].split(\",\").map(convertTransformToNumber);\n return typeof valueParser === \"function\"\n ? valueParser(values)\n : values[valueParser];\n}\nconst readTransformValue = (instance, name) => {\n const { transform = \"none\" } = getComputedStyle(instance);\n return parseValueFromTransform(transform, name);\n};\nfunction convertTransformToNumber(value) {\n return parseFloat(value.trim());\n}\n\nexport { defaultTransformValue, parseValueFromTransform, readTransformValue };\n//# sourceMappingURL=parse-transform.mjs.map\n","/**\n * Generate a list of every possible transform key.\n */\nconst transformPropOrder = [\n \"transformPerspective\",\n \"x\",\n \"y\",\n \"z\",\n \"translateX\",\n \"translateY\",\n \"translateZ\",\n \"scale\",\n \"scaleX\",\n \"scaleY\",\n \"rotate\",\n \"rotateX\",\n \"rotateY\",\n \"rotateZ\",\n \"skew\",\n \"skewX\",\n \"skewY\",\n];\n/**\n * A quick lookup for transform props.\n *\n * `pathRotation` is a transform for routing purposes (skipped from raw\n * style application, wired to the transform composite, flags transform\n * dirty) but is intentionally NOT in `transformPropOrder` — it is\n * composed onto `rotate` at the build sites, not serialized in its own\n * slot, and must stay out of the order-array consumers (parse-transform,\n * unit-conversion, keys-position).\n */\nconst transformProps = /*@__PURE__*/ (() => new Set([...transformPropOrder, \"pathRotation\"]))();\n\nexport { transformPropOrder, transformProps };\n//# sourceMappingURL=keys-transform.mjs.map\n","import { parseValueFromTransform } from '../../../render/dom/parse-transform.mjs';\nimport { transformPropOrder } from '../../../render/utils/keys-transform.mjs';\nimport { number } from '../../../value/types/numbers/index.mjs';\nimport { px } from '../../../value/types/numbers/units.mjs';\n\nconst isNumOrPxType = (v) => v === number || v === px;\nconst transformKeys = new Set([\"x\", \"y\", \"z\"]);\nconst nonTranslationalTransformKeys = transformPropOrder.filter((key) => !transformKeys.has(key));\nfunction removeNonTranslationalTransform(visualElement) {\n const removedTransforms = [];\n nonTranslationalTransformKeys.forEach((key) => {\n const value = visualElement.getValue(key);\n if (value !== undefined) {\n removedTransforms.push([key, value.get()]);\n value.set(key.startsWith(\"scale\") ? 1 : 0);\n }\n });\n return removedTransforms;\n}\nconst positionalValues = {\n // Dimensions\n width: ({ x }, { paddingLeft = \"0\", paddingRight = \"0\", boxSizing }) => {\n const width = x.max - x.min;\n return boxSizing === \"border-box\"\n ? width\n : width - parseFloat(paddingLeft) - parseFloat(paddingRight);\n },\n height: ({ y }, { paddingTop = \"0\", paddingBottom = \"0\", boxSizing }) => {\n const height = y.max - y.min;\n return boxSizing === \"border-box\"\n ? height\n : height - parseFloat(paddingTop) - parseFloat(paddingBottom);\n },\n top: (_bbox, { top }) => parseFloat(top),\n left: (_bbox, { left }) => parseFloat(left),\n bottom: ({ y }, { top }) => parseFloat(top) + (y.max - y.min),\n right: ({ x }, { left }) => parseFloat(left) + (x.max - x.min),\n // Transform\n x: (_bbox, { transform }) => parseValueFromTransform(transform, \"x\"),\n y: (_bbox, { transform }) => parseValueFromTransform(transform, \"y\"),\n};\n// Alias translate longform names\npositionalValues.translateX = positionalValues.x;\npositionalValues.translateY = positionalValues.y;\n\nexport { isNumOrPxType, positionalValues, removeNonTranslationalTransform };\n//# sourceMappingURL=unit-conversion.mjs.map\n","import { fillWildcards } from './utils/fill-wildcards.mjs';\nimport { removeNonTranslationalTransform } from './utils/unit-conversion.mjs';\nimport { frame } from '../../frameloop/frame.mjs';\n\nconst toResolve = new Set();\nlet isScheduled = false;\nlet anyNeedsMeasurement = false;\nlet isForced = false;\nfunction measureAllKeyframes() {\n if (anyNeedsMeasurement) {\n const resolversToMeasure = Array.from(toResolve).filter((resolver) => resolver.needsMeasurement);\n const elementsToMeasure = new Set(resolversToMeasure.map((resolver) => resolver.element));\n const transformsToRestore = new Map();\n /**\n * Write pass\n * If we're measuring elements we want to remove bounding box-changing transforms.\n */\n elementsToMeasure.forEach((element) => {\n const removedTransforms = removeNonTranslationalTransform(element);\n if (!removedTransforms.length)\n return;\n transformsToRestore.set(element, removedTransforms);\n element.render();\n });\n // Read\n resolversToMeasure.forEach((resolver) => resolver.measureInitialState());\n // Write\n elementsToMeasure.forEach((element) => {\n element.render();\n const restore = transformsToRestore.get(element);\n if (restore) {\n restore.forEach(([key, value]) => {\n element.getValue(key)?.set(value);\n });\n }\n });\n // Read\n resolversToMeasure.forEach((resolver) => resolver.measureEndState());\n // Write\n resolversToMeasure.forEach((resolver) => {\n if (resolver.suspendedScrollY !== undefined) {\n window.scrollTo(0, resolver.suspendedScrollY);\n }\n });\n }\n anyNeedsMeasurement = false;\n isScheduled = false;\n toResolve.forEach((resolver) => resolver.complete(isForced));\n toResolve.clear();\n}\nfunction readAllKeyframes() {\n toResolve.forEach((resolver) => {\n resolver.readKeyframes();\n if (resolver.needsMeasurement) {\n anyNeedsMeasurement = true;\n }\n });\n}\nfunction flushKeyframeResolvers() {\n isForced = true;\n readAllKeyframes();\n measureAllKeyframes();\n isForced = false;\n}\nclass KeyframeResolver {\n constructor(unresolvedKeyframes, onComplete, name, motionValue, element, isAsync = false) {\n this.state = \"pending\";\n /**\n * Track whether this resolver is async. If it is, it'll be added to the\n * resolver queue and flushed in the next frame. Resolvers that aren't going\n * to trigger read/write thrashing don't need to be async.\n */\n this.isAsync = false;\n /**\n * Track whether this resolver needs to perform a measurement\n * to resolve its keyframes.\n */\n this.needsMeasurement = false;\n this.unresolvedKeyframes = [...unresolvedKeyframes];\n this.onComplete = onComplete;\n this.name = name;\n this.motionValue = motionValue;\n this.element = element;\n this.isAsync = isAsync;\n }\n scheduleResolve() {\n this.state = \"scheduled\";\n if (this.isAsync) {\n toResolve.add(this);\n if (!isScheduled) {\n isScheduled = true;\n frame.read(readAllKeyframes);\n frame.resolveKeyframes(measureAllKeyframes);\n }\n }\n else {\n this.readKeyframes();\n this.complete();\n }\n }\n readKeyframes() {\n const { unresolvedKeyframes, name, element, motionValue } = this;\n // If initial keyframe is null we need to read it from the DOM\n if (unresolvedKeyframes[0] === null) {\n const currentValue = motionValue?.get();\n // TODO: This doesn't work if the final keyframe is a wildcard\n const finalKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1];\n if (currentValue !== undefined) {\n unresolvedKeyframes[0] = currentValue;\n }\n else if (element && name) {\n const valueAsRead = element.readValue(name, finalKeyframe);\n if (valueAsRead !== undefined && valueAsRead !== null) {\n unresolvedKeyframes[0] = valueAsRead;\n }\n }\n if (unresolvedKeyframes[0] === undefined) {\n unresolvedKeyframes[0] = finalKeyframe;\n }\n if (motionValue && currentValue === undefined) {\n motionValue.set(unresolvedKeyframes[0]);\n }\n }\n fillWildcards(unresolvedKeyframes);\n }\n setFinalKeyframe() { }\n measureInitialState() { }\n renderEndStyles() { }\n measureEndState() { }\n complete(isForcedComplete = false) {\n this.state = \"complete\";\n this.onComplete(this.unresolvedKeyframes, this.finalKeyframe, isForcedComplete);\n toResolve.delete(this);\n }\n cancel() {\n if (this.state === \"scheduled\") {\n toResolve.delete(this);\n this.state = \"pending\";\n }\n }\n resume() {\n if (this.state === \"pending\")\n this.scheduleResolve();\n }\n}\n\nexport { KeyframeResolver, flushKeyframeResolvers };\n//# sourceMappingURL=KeyframesResolver.mjs.map\n","function fillWildcards(keyframes) {\n for (let i = 1; i < keyframes.length; i++) {\n keyframes[i] ?? (keyframes[i] = keyframes[i - 1]);\n }\n}\n\nexport { fillWildcards };\n//# sourceMappingURL=fill-wildcards.mjs.map\n","import { isCSSVar } from './is-css-var.mjs';\n\nfunction setStyle(element, name, value) {\n isCSSVar(name)\n ? element.style.setProperty(name, value)\n : (element.style[name] = value);\n}\n\nexport { setStyle };\n//# sourceMappingURL=style-set.mjs.map\n","const isCSSVar = (name) => name.startsWith(\"--\");\n\nexport { isCSSVar };\n//# sourceMappingURL=is-css-var.mjs.map\n","/**\n * Add the ability for test suites to manually set support flags\n * to better test more environments.\n */\nconst supportsFlags = {};\n\nexport { supportsFlags };\n//# sourceMappingURL=flags.mjs.map\n","import { memo } from 'motion-utils';\nimport { supportsFlags } from './flags.mjs';\n\nfunction memoSupports(callback, supportsFlag) {\n const memoized = memo(callback);\n return () => supportsFlags[supportsFlag] ?? memoized();\n}\n\nexport { memoSupports };\n//# sourceMappingURL=memo.mjs.map\n","import { memoSupports } from './memo.mjs';\n\nconst supportsScrollTimeline = /* @__PURE__ */ memoSupports(() => window.ScrollTimeline !== undefined, \"scrollTimeline\");\nconst supportsViewTimeline = /* @__PURE__ */ memoSupports(() => window.ViewTimeline !== undefined, \"viewTimeline\");\n\nexport { supportsScrollTimeline, supportsViewTimeline };\n//# sourceMappingURL=scroll-timeline.mjs.map\n","import { memoSupports } from './memo.mjs';\n\nconst supportsLinearEasing = /*@__PURE__*/ memoSupports(() => {\n try {\n document\n .createElement(\"div\")\n .animate({ opacity: 0 }, { easing: \"linear(0, 1)\" });\n }\n catch (e) {\n return false;\n }\n return true;\n}, \"linearEasing\");\n\nexport { supportsLinearEasing };\n//# sourceMappingURL=linear-easing.mjs.map\n","const cubicBezierAsString = ([a, b, c, d]) => `cubic-bezier(${a}, ${b}, ${c}, ${d})`;\n\nexport { cubicBezierAsString };\n//# sourceMappingURL=cubic-bezier.mjs.map\n","import { cubicBezierAsString } from './cubic-bezier.mjs';\n\nconst supportedWaapiEasing = {\n linear: \"linear\",\n ease: \"ease\",\n easeIn: \"ease-in\",\n easeOut: \"ease-out\",\n easeInOut: \"ease-in-out\",\n circIn: /*@__PURE__*/ cubicBezierAsString([0, 0.65, 0.55, 1]),\n circOut: /*@__PURE__*/ cubicBezierAsString([0.55, 0, 1, 0.45]),\n backIn: /*@__PURE__*/ cubicBezierAsString([0.31, 0.01, 0.66, -0.59]),\n backOut: /*@__PURE__*/ cubicBezierAsString([0.33, 1.53, 0.69, 0.99]),\n};\n\nexport { supportedWaapiEasing };\n//# sourceMappingURL=supported.mjs.map\n","import { isBezierDefinition } from 'motion-utils';\nimport { supportsLinearEasing } from '../../../utils/supports/linear-easing.mjs';\nimport { generateLinearEasing } from '../utils/linear.mjs';\nimport { cubicBezierAsString } from './cubic-bezier.mjs';\nimport { supportedWaapiEasing } from './supported.mjs';\n\nfunction mapEasingToNativeEasing(easing, duration) {\n if (!easing) {\n return undefined;\n }\n else if (typeof easing === \"function\") {\n return supportsLinearEasing()\n ? generateLinearEasing(easing, duration)\n : \"ease-out\";\n }\n else if (isBezierDefinition(easing)) {\n return cubicBezierAsString(easing);\n }\n else if (Array.isArray(easing)) {\n return easing.map((segmentEasing) => mapEasingToNativeEasing(segmentEasing, duration) ||\n supportedWaapiEasing.easeOut);\n }\n else {\n return supportedWaapiEasing[easing];\n }\n}\n\nexport { mapEasingToNativeEasing };\n//# sourceMappingURL=map-easing.mjs.map\n","import { mapEasingToNativeEasing } from './easing/map-easing.mjs';\n\nfunction startWaapiAnimation(element, valueName, keyframes, { delay = 0, duration = 300, repeat = 0, repeatType = \"loop\", ease = \"easeOut\", times, } = {}, pseudoElement = undefined) {\n const keyframeOptions = {\n [valueName]: keyframes,\n };\n if (times)\n keyframeOptions.offset = times;\n const easing = mapEasingToNativeEasing(ease, duration);\n /**\n * If this is an easing array, apply to keyframes, not animation as a whole\n */\n if (Array.isArray(easing))\n keyframeOptions.easing = easing;\n const options = {\n delay,\n duration,\n easing: !Array.isArray(easing) ? easing : \"linear\",\n fill: \"both\",\n iterations: repeat + 1,\n direction: repeatType === \"reverse\" ? \"alternate\" : \"normal\",\n };\n if (pseudoElement)\n options.pseudoElement = pseudoElement;\n return element.animate(keyframeOptions, options);\n}\n\nexport { startWaapiAnimation };\n//# sourceMappingURL=start-waapi-animation.mjs.map\n","function isGenerator(type) {\n return typeof type === \"function\" && \"applyToOptions\" in type;\n}\n\nexport { isGenerator };\n//# sourceMappingURL=is-generator.mjs.map\n","import { invariant, millisecondsToSeconds, secondsToMilliseconds, noop } from 'motion-utils';\nimport { setStyle } from '../render/dom/style-set.mjs';\nimport { supportsScrollTimeline } from '../utils/supports/scroll-timeline.mjs';\nimport { getFinalKeyframe } from './keyframes/get-final.mjs';\nimport { WithPromise } from './utils/WithPromise.mjs';\nimport { startWaapiAnimation } from './waapi/start-waapi-animation.mjs';\nimport { applyGeneratorOptions } from './waapi/utils/apply-generator.mjs';\n\n/**\n * NativeAnimation implements AnimationPlaybackControls for the browser's Web Animations API.\n */\nclass NativeAnimation extends WithPromise {\n constructor(options) {\n super();\n this.finishedTime = null;\n this.isStopped = false;\n /**\n * Tracks a manually-set start time that takes precedence over WAAPI's\n * dynamic startTime. This is cleared when play() or time setter is called,\n * allowing WAAPI to take over timing.\n */\n this.manualStartTime = null;\n if (!options)\n return;\n const { element, name, keyframes, pseudoElement, allowFlatten = false, finalKeyframe, onComplete, } = options;\n this.isPseudoElement = Boolean(pseudoElement);\n this.allowFlatten = allowFlatten;\n this.options = options;\n invariant(typeof options.type !== \"string\", `Mini animate() doesn't support \"type\" as a string.`, \"mini-spring\");\n const transition = applyGeneratorOptions(options);\n this.animation = startWaapiAnimation(element, name, keyframes, transition, pseudoElement);\n if (transition.autoplay === false) {\n this.animation.pause();\n }\n this.animation.onfinish = () => {\n this.finishedTime = this.time;\n if (!pseudoElement) {\n const keyframe = getFinalKeyframe(keyframes, this.options, finalKeyframe, this.speed);\n if (this.updateMotionValue) {\n this.updateMotionValue(keyframe);\n }\n /**\n * If we can, we want to commit the final style as set by the user,\n * rather than the computed keyframe value supplied by the animation.\n * We always do this, even when a motion value is present, to prevent\n * a visual flash in Firefox where the WAAPI animation's fill is removed\n * during cancel() before the scheduled render can apply the correct value.\n */\n setStyle(element, name, keyframe);\n this.animation.cancel();\n }\n onComplete?.();\n this.notifyFinished();\n };\n }\n play() {\n if (this.isStopped)\n return;\n this.manualStartTime = null;\n this.animation.play();\n if (this.state === \"finished\") {\n this.updateFinished();\n }\n }\n pause() {\n this.animation.pause();\n }\n complete() {\n this.animation.finish?.();\n }\n cancel() {\n try {\n this.animation.cancel();\n }\n catch (e) { }\n }\n stop() {\n if (this.isStopped)\n return;\n this.isStopped = true;\n const { state } = this;\n if (state === \"idle\" || state === \"finished\") {\n return;\n }\n if (this.updateMotionValue) {\n this.updateMotionValue();\n }\n else {\n this.commitStyles();\n }\n if (!this.isPseudoElement)\n this.cancel();\n }\n /**\n * WAAPI doesn't natively have any interruption capabilities.\n *\n * In this method, we commit styles back to the DOM before cancelling\n * the animation.\n *\n * This is designed to be overridden by NativeAnimationExtended, which\n * will create a renderless JS animation and sample it twice to calculate\n * its current value, \"previous\" value, and therefore allow\n * Motion to also correctly calculate velocity for any subsequent animation\n * while deferring the commit until the next animation frame.\n */\n commitStyles() {\n const element = this.options?.element;\n if (!this.isPseudoElement && element?.isConnected) {\n this.animation.commitStyles?.();\n }\n }\n get duration() {\n const duration = this.animation.effect?.getComputedTiming?.().duration || 0;\n return millisecondsToSeconds(Number(duration));\n }\n get iterationDuration() {\n const { delay = 0 } = this.options || {};\n return this.duration + millisecondsToSeconds(delay);\n }\n get time() {\n return millisecondsToSeconds(Number(this.animation.currentTime) || 0);\n }\n set time(newTime) {\n const wasFinished = this.finishedTime !== null;\n this.manualStartTime = null;\n this.finishedTime = null;\n this.animation.currentTime = secondsToMilliseconds(newTime);\n if (wasFinished) {\n this.animation.pause();\n }\n }\n /**\n * The playback speed of the animation.\n * 1 = normal speed, 2 = double speed, 0.5 = half speed.\n */\n get speed() {\n return this.animation.playbackRate;\n }\n set speed(newSpeed) {\n // Allow backwards playback after finishing\n if (newSpeed < 0)\n this.finishedTime = null;\n this.animation.playbackRate = newSpeed;\n }\n get state() {\n return this.finishedTime !== null\n ? \"finished\"\n : this.animation.playState;\n }\n get startTime() {\n return this.manualStartTime ?? Number(this.animation.startTime);\n }\n set startTime(newStartTime) {\n this.manualStartTime = this.animation.startTime = newStartTime;\n }\n /**\n * Attaches a timeline to the animation, for instance the `ScrollTimeline`.\n */\n attachTimeline({ timeline, rangeStart, rangeEnd, observe, }) {\n if (this.allowFlatten) {\n this.animation.effect?.updateTiming({ easing: \"linear\" });\n }\n this.animation.onfinish = null;\n if (timeline && supportsScrollTimeline()) {\n this.animation.timeline = timeline;\n if (rangeStart)\n this.animation.rangeStart = rangeStart;\n if (rangeEnd)\n this.animation.rangeEnd = rangeEnd;\n return noop;\n }\n else {\n return observe(this);\n }\n }\n}\n\nexport { NativeAnimation };\n//# sourceMappingURL=NativeAnimation.mjs.map\n","import { supportsLinearEasing } from '../../../utils/supports/linear-easing.mjs';\nimport { isGenerator } from '../../generators/utils/is-generator.mjs';\n\nfunction applyGeneratorOptions({ type, ...options }) {\n if (isGenerator(type) && supportsLinearEasing()) {\n return type.applyToOptions(options);\n }\n else {\n options.duration ?? (options.duration = 300);\n options.ease ?? (options.ease = \"easeOut\");\n }\n return options;\n}\n\nexport { applyGeneratorOptions };\n//# sourceMappingURL=apply-generator.mjs.map\n","import { circInOut, backInOut, anticipate } from 'motion-utils';\n\nconst unsupportedEasingFunctions = {\n anticipate,\n backInOut,\n circInOut,\n};\nfunction isUnsupportedEase(key) {\n return key in unsupportedEasingFunctions;\n}\nfunction replaceStringEasing(transition) {\n if (typeof transition.ease === \"string\" &&\n isUnsupportedEase(transition.ease)) {\n transition.ease = unsupportedEasingFunctions[transition.ease];\n }\n}\n\nexport { replaceStringEasing };\n//# sourceMappingURL=unsupported-easing.mjs.map\n","import { clamp } from 'motion-utils';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { setStyle } from '../render/dom/style-set.mjs';\nimport { JSAnimation } from './JSAnimation.mjs';\nimport { NativeAnimation } from './NativeAnimation.mjs';\nimport { replaceTransitionType } from './utils/replace-transition-type.mjs';\nimport { replaceStringEasing } from './waapi/utils/unsupported-easing.mjs';\n\n/**\n * 10ms is chosen here as it strikes a balance between smooth\n * results (more than one keyframe per frame at 60fps) and\n * keyframe quantity.\n */\nconst sampleDelta = 10; //ms\nclass NativeAnimationExtended extends NativeAnimation {\n constructor(options) {\n /**\n * The base NativeAnimation function only supports a subset\n * of Motion easings, and WAAPI also only supports some\n * easing functions via string/cubic-bezier definitions.\n *\n * This function replaces those unsupported easing functions\n * with a JS easing function. This will later get compiled\n * to a linear() easing function.\n */\n replaceStringEasing(options);\n /**\n * Ensure we replace the transition type with a generator function\n * before passing to WAAPI.\n *\n * TODO: Does this have a better home? It could be shared with\n * JSAnimation.\n */\n replaceTransitionType(options);\n super(options);\n /**\n * Only set startTime when the animation should autoplay.\n * Setting startTime on a paused WAAPI animation unpauses it\n * (per the WAAPI spec), which breaks autoplay: false.\n */\n if (options.startTime !== undefined && options.autoplay !== false) {\n this.startTime = options.startTime;\n }\n this.options = options;\n }\n /**\n * WAAPI doesn't natively have any interruption capabilities.\n *\n * Rather than read committed styles back out of the DOM, we can\n * create a renderless JS animation and sample it twice to calculate\n * its current value, \"previous\" value, and therefore allow\n * Motion to calculate velocity for any subsequent animation.\n */\n updateMotionValue(value) {\n const { motionValue, onUpdate, onComplete, element, ...options } = this.options;\n if (!motionValue)\n return;\n if (value !== undefined) {\n motionValue.set(value);\n return;\n }\n const sampleAnimation = new JSAnimation({\n ...options,\n autoplay: false,\n });\n /**\n * Use wall-clock elapsed time for sampling.\n * Under CPU load, WAAPI's currentTime may not reflect actual\n * elapsed time, causing incorrect sampling and visual jumps.\n */\n const sampleTime = Math.max(sampleDelta, time.now() - this.startTime);\n const delta = clamp(0, sampleDelta, sampleTime - sampleDelta);\n const current = sampleAnimation.sample(sampleTime).value;\n /**\n * Write the estimated value to inline style so it persists\n * after cancel(), covering the async gap before the next\n * animation starts.\n */\n const { name } = this.options;\n if (element && name)\n setStyle(element, name, current);\n motionValue.setWithVelocity(sampleAnimation.sample(Math.max(0, sampleTime - delta)).value, current, delta);\n sampleAnimation.stop();\n }\n}\n\nexport { NativeAnimationExtended };\n//# sourceMappingURL=NativeAnimationExtended.mjs.map\n","import { complex } from '../../value/types/complex/index.mjs';\n\n/**\n * Check if a value is animatable. Examples:\n *\n * ✅: 100, \"100px\", \"#fff\"\n * ❌: \"block\", \"url(2.jpg)\"\n * @param value\n *\n * @internal\n */\nconst isAnimatable = (value, name) => {\n // If the list of keys that might be non-animatable grows, replace with Set\n if (name === \"zIndex\")\n return false;\n // If it's a number or a keyframes array, we can animate it. We might at some point\n // need to do a deep isAnimatable check of keyframes, or let Popmotion handle this,\n // but for now lets leave it like this for performance reasons\n if (typeof value === \"number\" || Array.isArray(value))\n return true;\n if (typeof value === \"string\" && // It's animatable if we have a string\n (complex.test(value) || value === \"0\") && // And it contains numbers and/or colors\n !value.startsWith(\"url(\") // Unless it starts with \"url(\"\n ) {\n return true;\n }\n return false;\n};\n\nexport { isAnimatable };\n//# sourceMappingURL=is-animatable.mjs.map\n","function makeAnimationInstant(options) {\n options.duration = 0;\n options.type = \"keyframes\";\n}\n\nexport { makeAnimationInstant };\n//# sourceMappingURL=make-animation-instant.mjs.map\n","/**\n * A list of values that can be hardware-accelerated.\n */\nconst acceleratedValues = new Set([\n \"opacity\",\n \"clipPath\",\n \"filter\",\n \"transform\",\n \"backgroundColor\",\n]);\n\nexport { acceleratedValues };\n//# sourceMappingURL=accelerated-values.mjs.map\n","const browserColorFunctions = /^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\\(/;\nfunction hasBrowserOnlyColors(keyframes) {\n for (let i = 0; i < keyframes.length; i++) {\n if (typeof keyframes[i] === \"string\" &&\n browserColorFunctions.test(keyframes[i])) {\n return true;\n }\n }\n return false;\n}\n\nexport { hasBrowserOnlyColors };\n//# sourceMappingURL=is-browser-color.mjs.map\n","import { memo } from 'motion-utils';\nimport { acceleratedValues } from '../utils/accelerated-values.mjs';\nimport { hasBrowserOnlyColors } from '../utils/is-browser-color.mjs';\n\nconst colorProperties = new Set([\n \"color\",\n \"backgroundColor\",\n \"outlineColor\",\n \"fill\",\n \"stroke\",\n \"borderColor\",\n \"borderTopColor\",\n \"borderRightColor\",\n \"borderBottomColor\",\n \"borderLeftColor\",\n]);\nconst supportsWaapi = /*@__PURE__*/ memo(() => Object.hasOwnProperty.call(Element.prototype, \"animate\"));\nfunction supportsBrowserAnimation(options) {\n const { motionValue, name, repeatDelay, repeatType, damping, type, keyframes, } = options;\n const subject = motionValue?.owner?.current;\n /**\n * We use instanceof checks instead of isHTMLElement()/isSVGElement()\n * because we explicitly **don't** want elements in different timing\n * contexts (i.e. popups) to be accelerated, as it's not possible to sync\n * these animations properly with those driven from the main window\n * frameloop.\n */\n if (!(subject instanceof HTMLElement) &&\n !(subject instanceof SVGElement)) {\n return false;\n }\n const { onUpdate, transformTemplate } = motionValue.owner.getProps();\n return (supportsWaapi() &&\n name &&\n /**\n * Force WAAPI for color properties with browser-only color formats\n * (oklch, oklab, lab, lch, etc.) that the JS animation path can't parse.\n */\n (acceleratedValues.has(name) ||\n (colorProperties.has(name) &&\n hasBrowserOnlyColors(keyframes))) &&\n (name !== \"transform\" || !transformTemplate) &&\n /**\n * If we're outputting values to onUpdate then we can't use WAAPI as there's\n * no way to read the value from WAAPI every frame.\n */\n !onUpdate &&\n !repeatDelay &&\n repeatType !== \"mirror\" &&\n damping !== 0 &&\n type !== \"inertia\");\n}\n\nexport { supportsBrowserAnimation };\n//# sourceMappingURL=waapi.mjs.map\n","import { MotionGlobalConfig, noop } from 'motion-utils';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { JSAnimation } from './JSAnimation.mjs';\nimport { getFinalKeyframe } from './keyframes/get-final.mjs';\nimport { KeyframeResolver, flushKeyframeResolvers } from './keyframes/KeyframesResolver.mjs';\nimport { NativeAnimationExtended } from './NativeAnimationExtended.mjs';\nimport { canAnimate } from './utils/can-animate.mjs';\nimport { makeAnimationInstant } from './utils/make-animation-instant.mjs';\nimport { WithPromise } from './utils/WithPromise.mjs';\nimport { supportsBrowserAnimation } from './waapi/supports/waapi.mjs';\n\n/**\n * Maximum time allowed between an animation being created and it being\n * resolved for us to use the latter as the start time.\n *\n * This is to ensure that while we prefer to \"start\" an animation as soon\n * as it's triggered, we also want to avoid a visual jump if there's a big delay\n * between these two moments.\n */\nconst MAX_RESOLVE_DELAY = 40;\nclass AsyncMotionValueAnimation extends WithPromise {\n constructor({ autoplay = true, delay = 0, type = \"keyframes\", repeat = 0, repeatDelay = 0, repeatType = \"loop\", keyframes, name, motionValue, element, ...options }) {\n super();\n /**\n * Bound to support return animation.stop pattern\n */\n this.stop = () => {\n if (this._animation) {\n this._animation.stop();\n this.stopTimeline?.();\n }\n this.keyframeResolver?.cancel();\n };\n this.createdAt = time.now();\n const optionsWithDefaults = {\n autoplay,\n delay,\n type,\n repeat,\n repeatDelay,\n repeatType,\n name,\n motionValue,\n element,\n ...options,\n };\n const KeyframeResolver$1 = element?.KeyframeResolver || KeyframeResolver;\n this.keyframeResolver = new KeyframeResolver$1(keyframes, (resolvedKeyframes, finalKeyframe, forced) => this.onKeyframesResolved(resolvedKeyframes, finalKeyframe, optionsWithDefaults, !forced), name, motionValue, element);\n this.keyframeResolver?.scheduleResolve();\n }\n onKeyframesResolved(keyframes, finalKeyframe, options, sync) {\n this.keyframeResolver = undefined;\n const { name, type, velocity, delay, isHandoff, onUpdate } = options;\n this.resolvedAt = time.now();\n /**\n * If we can't animate this value with the resolved keyframes\n * then we should complete it immediately.\n */\n let canAnimateValue = true;\n if (!canAnimate(keyframes, name, type, velocity)) {\n canAnimateValue = false;\n if (MotionGlobalConfig.instantAnimations || !delay) {\n onUpdate?.(getFinalKeyframe(keyframes, options, finalKeyframe));\n }\n keyframes[0] = keyframes[keyframes.length - 1];\n makeAnimationInstant(options);\n options.repeat = 0;\n }\n /**\n * Resolve startTime for the animation.\n *\n * This method uses the createdAt and resolvedAt to calculate the\n * animation startTime. *Ideally*, we would use the createdAt time as t=0\n * as the following frame would then be the first frame of the animation in\n * progress, which would feel snappier.\n *\n * However, if there's a delay (main thread work) between the creation of\n * the animation and the first committed frame, we prefer to use resolvedAt\n * to avoid a sudden jump into the animation.\n */\n const startTime = sync\n ? !this.resolvedAt\n ? this.createdAt\n : this.resolvedAt - this.createdAt > MAX_RESOLVE_DELAY\n ? this.resolvedAt\n : this.createdAt\n : undefined;\n const resolvedOptions = {\n startTime,\n finalKeyframe,\n ...options,\n keyframes,\n };\n /**\n * Animate via WAAPI if possible. If this is a handoff animation, the optimised animation will be running via\n * WAAPI. Therefore, this animation must be JS to ensure it runs \"under\" the\n * optimised animation.\n *\n * Also skip WAAPI when keyframes aren't animatable, as the resolved\n * values may not be valid CSS and would trigger browser warnings.\n */\n const useWaapi = canAnimateValue &&\n !isHandoff &&\n supportsBrowserAnimation(resolvedOptions);\n const element = resolvedOptions.motionValue?.owner?.current;\n let animation;\n if (useWaapi) {\n try {\n animation = new NativeAnimationExtended({\n ...resolvedOptions,\n element,\n });\n }\n catch {\n animation = new JSAnimation(resolvedOptions);\n }\n }\n else {\n animation = new JSAnimation(resolvedOptions);\n }\n animation.finished.then(() => {\n this.notifyFinished();\n }).catch(noop);\n if (this.pendingTimeline) {\n this.stopTimeline = animation.attachTimeline(this.pendingTimeline);\n this.pendingTimeline = undefined;\n }\n this._animation = animation;\n }\n get finished() {\n if (!this._animation) {\n return this._finished;\n }\n else {\n return this.animation.finished;\n }\n }\n then(onResolve, _onReject) {\n return this.finished.finally(onResolve).then(() => { });\n }\n get animation() {\n if (!this._animation) {\n this.keyframeResolver?.resume();\n flushKeyframeResolvers();\n }\n return this._animation;\n }\n get duration() {\n return this.animation.duration;\n }\n get iterationDuration() {\n return this.animation.iterationDuration;\n }\n get time() {\n return this.animation.time;\n }\n set time(newTime) {\n this.animation.time = newTime;\n }\n get speed() {\n return this.animation.speed;\n }\n get state() {\n return this.animation.state;\n }\n set speed(newSpeed) {\n this.animation.speed = newSpeed;\n }\n get startTime() {\n return this.animation.startTime;\n }\n attachTimeline(timeline) {\n if (this._animation) {\n this.stopTimeline = this.animation.attachTimeline(timeline);\n }\n else {\n this.pendingTimeline = timeline;\n }\n return () => this.stop();\n }\n play() {\n this.animation.play();\n }\n pause() {\n this.animation.pause();\n }\n complete() {\n this.animation.complete();\n }\n cancel() {\n if (this._animation) {\n this.animation.cancel();\n }\n this.keyframeResolver?.cancel();\n }\n}\n\nexport { AsyncMotionValueAnimation };\n//# sourceMappingURL=AsyncMotionValueAnimation.mjs.map\n","import { warning } from 'motion-utils';\nimport { isGenerator } from '../generators/utils/is-generator.mjs';\nimport { isAnimatable } from './is-animatable.mjs';\n\nfunction hasKeyframesChanged(keyframes) {\n const current = keyframes[0];\n if (keyframes.length === 1)\n return true;\n for (let i = 0; i < keyframes.length; i++) {\n if (keyframes[i] !== current)\n return true;\n }\n}\nfunction canAnimate(keyframes, name, type, velocity) {\n /**\n * Check if we're able to animate between the start and end keyframes,\n * and throw a warning if we're attempting to animate between one that's\n * animatable and another that isn't.\n */\n const originKeyframe = keyframes[0];\n if (originKeyframe === null) {\n return false;\n }\n /**\n * These aren't traditionally animatable but we do support them.\n * In future we could look into making this more generic or replacing\n * this function with mix() === mixImmediate\n */\n if (name === \"display\" || name === \"visibility\")\n return true;\n const targetKeyframe = keyframes[keyframes.length - 1];\n const isOriginAnimatable = isAnimatable(originKeyframe, name);\n const isTargetAnimatable = isAnimatable(targetKeyframe, name);\n warning(isOriginAnimatable === isTargetAnimatable, `You are trying to animate ${name} from \"${originKeyframe}\" to \"${targetKeyframe}\". \"${isOriginAnimatable ? targetKeyframe : originKeyframe}\" is not an animatable value.`, \"value-not-animatable\");\n // Always skip if any of these are true\n if (!isOriginAnimatable || !isTargetAnimatable) {\n return false;\n }\n return (hasKeyframesChanged(keyframes) ||\n ((type === \"spring\" || isGenerator(type)) && velocity));\n}\n\nexport { canAnimate };\n//# sourceMappingURL=can-animate.mjs.map\n","function calcChildStagger(children, child, delayChildren, staggerChildren = 0, staggerDirection = 1) {\n const index = Array.from(children)\n .sort((a, b) => a.sortNodePosition(b))\n .indexOf(child);\n const numChildren = children.size;\n const maxStaggerDuration = (numChildren - 1) * staggerChildren;\n const delayIsFunction = typeof delayChildren === \"function\";\n return delayIsFunction\n ? delayChildren(index, numChildren)\n : staggerDirection === 1\n ? index * staggerChildren\n : maxStaggerDuration - index * staggerChildren;\n}\n\nexport { calcChildStagger };\n//# sourceMappingURL=calc-child-stagger.mjs.map\n","import { warnOnce, SubscriptionManager, velocityPerSecond } from 'motion-utils';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { frame } from '../frameloop/frame.mjs';\n\n/**\n * Maximum time between the value of two frames, beyond which we\n * assume the velocity has since been 0.\n */\nconst MAX_VELOCITY_DELTA = 30;\nconst isFloat = (value) => {\n return !isNaN(parseFloat(value));\n};\nconst collectMotionValues = {\n current: undefined,\n};\n/**\n * `MotionValue` is used to track the state and velocity of motion values.\n *\n * @public\n */\nclass MotionValue {\n /**\n * @param init - The initiating value\n * @param config - Optional configuration options\n *\n * - `transformer`: A function to transform incoming values with.\n */\n constructor(init, options = {}) {\n /**\n * Tracks whether this value can output a velocity. Currently this is only true\n * if the value is numerical, but we might be able to widen the scope here and support\n * other value types.\n *\n * @internal\n */\n this.canTrackVelocity = null;\n /**\n * An object containing a SubscriptionManager for each active event.\n */\n this.events = {};\n this.updateAndNotify = (v) => {\n const currentTime = time.now();\n /**\n * If we're updating the value during another frame or eventloop\n * than the previous frame, then the we set the previous frame value\n * to current.\n */\n if (this.updatedAt !== currentTime) {\n this.setPrevFrameValue();\n }\n this.prev = this.current;\n this.setCurrent(v);\n // Update update subscribers\n if (this.current !== this.prev) {\n this.events.change?.notify(this.current);\n if (this.dependents) {\n for (const dependent of this.dependents) {\n dependent.dirty();\n }\n }\n }\n };\n this.hasAnimated = false;\n this.setCurrent(init);\n this.owner = options.owner;\n }\n setCurrent(current) {\n this.current = current;\n this.updatedAt = time.now();\n if (this.canTrackVelocity === null && current !== undefined) {\n this.canTrackVelocity = isFloat(this.current);\n }\n }\n setPrevFrameValue(prevFrameValue = this.current) {\n this.prevFrameValue = prevFrameValue;\n this.prevUpdatedAt = this.updatedAt;\n }\n /**\n * Adds a function that will be notified when the `MotionValue` is updated.\n *\n * It returns a function that, when called, will cancel the subscription.\n *\n * When calling `onChange` inside a React component, it should be wrapped with the\n * `useEffect` hook. As it returns an unsubscribe function, this should be returned\n * from the `useEffect` function to ensure you don't add duplicate subscribers..\n *\n * ```jsx\n * export const MyComponent = () => {\n * const x = useMotionValue(0)\n * const y = useMotionValue(0)\n * const opacity = useMotionValue(1)\n *\n * useEffect(() => {\n * function updateOpacity() {\n * const maxXY = Math.max(x.get(), y.get())\n * const newOpacity = transform(maxXY, [0, 100], [1, 0])\n * opacity.set(newOpacity)\n * }\n *\n * const unsubscribeX = x.on(\"change\", updateOpacity)\n * const unsubscribeY = y.on(\"change\", updateOpacity)\n *\n * return () => {\n * unsubscribeX()\n * unsubscribeY()\n * }\n * }, [])\n *\n * return \n * }\n * ```\n *\n * @param subscriber - A function that receives the latest value.\n * @returns A function that, when called, will cancel this subscription.\n *\n * @deprecated\n */\n onChange(subscription) {\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(false, `value.onChange(callback) is deprecated. Switch to value.on(\"change\", callback).`);\n }\n return this.on(\"change\", subscription);\n }\n on(eventName, callback) {\n if (!this.events[eventName]) {\n this.events[eventName] = new SubscriptionManager();\n }\n const unsubscribe = this.events[eventName].add(callback);\n if (eventName === \"change\") {\n return () => {\n unsubscribe();\n /**\n * If we have no more change listeners by the start\n * of the next frame, stop active animations.\n */\n frame.read(() => {\n if (!this.events.change.getSize()) {\n this.stop();\n }\n });\n };\n }\n return unsubscribe;\n }\n clearListeners() {\n for (const eventManagers in this.events) {\n this.events[eventManagers].clear();\n }\n }\n /**\n * Attaches a passive effect to the `MotionValue`.\n */\n attach(passiveEffect, stopPassiveEffect) {\n this.passiveEffect = passiveEffect;\n this.stopPassiveEffect = stopPassiveEffect;\n }\n /**\n * Sets the state of the `MotionValue`.\n *\n * @remarks\n *\n * ```jsx\n * const x = useMotionValue(0)\n * x.set(10)\n * ```\n *\n * @param latest - Latest value to set.\n * @param render - Whether to notify render subscribers. Defaults to `true`\n *\n * @public\n */\n set(v) {\n if (!this.passiveEffect) {\n this.updateAndNotify(v);\n }\n else {\n this.passiveEffect(v, this.updateAndNotify);\n }\n }\n setWithVelocity(prev, current, delta) {\n this.set(current);\n this.prev = undefined;\n this.prevFrameValue = prev;\n this.prevUpdatedAt = this.updatedAt - delta;\n }\n /**\n * Set the state of the `MotionValue`, stopping any active animations,\n * effects, and resets velocity to `0`.\n */\n jump(v, endAnimation = true) {\n this.updateAndNotify(v);\n this.prev = v;\n this.prevUpdatedAt = this.prevFrameValue = undefined;\n endAnimation && this.stop();\n if (this.stopPassiveEffect)\n this.stopPassiveEffect();\n }\n dirty() {\n this.events.change?.notify(this.current);\n }\n addDependent(dependent) {\n if (!this.dependents) {\n this.dependents = new Set();\n }\n this.dependents.add(dependent);\n }\n removeDependent(dependent) {\n if (this.dependents) {\n this.dependents.delete(dependent);\n }\n }\n /**\n * Returns the latest state of `MotionValue`\n *\n * @returns - The latest state of `MotionValue`\n *\n * @public\n */\n get() {\n if (collectMotionValues.current) {\n collectMotionValues.current.push(this);\n }\n return this.current;\n }\n /**\n * @public\n */\n getPrevious() {\n return this.prev;\n }\n /**\n * Returns the latest velocity of `MotionValue`\n *\n * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical.\n *\n * @public\n */\n getVelocity() {\n const currentTime = time.now();\n if (!this.canTrackVelocity ||\n this.prevFrameValue === undefined ||\n currentTime - this.updatedAt > MAX_VELOCITY_DELTA) {\n return 0;\n }\n const delta = Math.min(this.updatedAt - this.prevUpdatedAt, MAX_VELOCITY_DELTA);\n // Casts because of parseFloat's poor typing\n return velocityPerSecond(parseFloat(this.current) -\n parseFloat(this.prevFrameValue), delta);\n }\n /**\n * Registers a new animation to control this `MotionValue`. Only one\n * animation can drive a `MotionValue` at one time.\n *\n * ```jsx\n * value.start()\n * ```\n *\n * @param animation - A function that starts the provided animation\n */\n start(startAnimation) {\n this.stop();\n return new Promise((resolve) => {\n this.hasAnimated = true;\n this.animation = startAnimation(resolve);\n if (this.events.animationStart) {\n this.events.animationStart.notify();\n }\n }).then(() => {\n if (this.events.animationComplete) {\n this.events.animationComplete.notify();\n }\n this.clearAnimation();\n });\n }\n /**\n * Stop the currently active animation.\n *\n * @public\n */\n stop() {\n if (this.animation) {\n this.animation.stop();\n if (this.events.animationCancel) {\n this.events.animationCancel.notify();\n }\n }\n this.clearAnimation();\n }\n /**\n * Returns `true` if this value is currently animating.\n *\n * @public\n */\n isAnimating() {\n return !!this.animation;\n }\n clearAnimation() {\n delete this.animation;\n }\n /**\n * Destroy and clean up subscribers to this `MotionValue`.\n *\n * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically\n * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually\n * created a `MotionValue` via the `motionValue` function.\n *\n * @public\n */\n destroy() {\n this.dependents?.clear();\n this.events.destroy?.notify();\n this.clearListeners();\n this.stop();\n if (this.stopPassiveEffect) {\n this.stopPassiveEffect();\n }\n }\n}\nfunction motionValue(init, options) {\n return new MotionValue(init, options);\n}\n\nexport { MotionValue, collectMotionValues, motionValue };\n//# sourceMappingURL=index.mjs.map\n","/**\n * If `transition` has `inherit: true`, shallow-merge it with\n * `parentTransition` (child keys win) and strip the `inherit` key.\n * Otherwise return `transition` unchanged.\n */\nfunction resolveTransition(transition, parentTransition) {\n if (transition?.inherit && parentTransition) {\n const { inherit: _, ...rest } = transition;\n return { ...parentTransition, ...rest };\n }\n return transition;\n}\n\nexport { resolveTransition };\n//# sourceMappingURL=resolve-transition.mjs.map\n","import { resolveTransition } from './resolve-transition.mjs';\n\nfunction getValueTransition(transition, key) {\n const valueTransition = transition?.[key] ??\n transition?.[\"default\"] ??\n transition;\n if (valueTransition !== transition) {\n return resolveTransition(valueTransition, transition);\n }\n return valueTransition;\n}\n\nexport { getValueTransition };\n//# sourceMappingURL=get-value-transition.mjs.map\n","import { transformProps } from '../../render/utils/keys-transform.mjs';\n\nconst underDampedSpring = {\n type: \"spring\",\n stiffness: 500,\n damping: 25,\n restSpeed: 10,\n};\nconst criticallyDampedSpring = (target) => ({\n type: \"spring\",\n stiffness: 550,\n damping: target === 0 ? 2 * Math.sqrt(550) : 30,\n restSpeed: 10,\n});\nconst keyframesTransition = {\n type: \"keyframes\",\n duration: 0.8,\n};\n/**\n * Default easing curve is a slightly shallower version of\n * the default browser easing curve.\n */\nconst ease = {\n type: \"keyframes\",\n ease: [0.25, 0.1, 0.35, 1],\n duration: 0.3,\n};\nconst getDefaultTransition = (valueKey, { keyframes }) => {\n if (keyframes.length > 2) {\n return keyframesTransition;\n }\n else if (transformProps.has(valueKey)) {\n return valueKey.startsWith(\"scale\")\n ? criticallyDampedSpring(keyframes[1])\n : underDampedSpring;\n }\n return ease;\n};\n\nexport { getDefaultTransition };\n//# sourceMappingURL=default-transitions.mjs.map\n","const orchestrationKeys = new Set([\n \"when\",\n \"delay\",\n \"delayChildren\",\n \"staggerChildren\",\n \"staggerDirection\",\n \"repeat\",\n \"repeatType\",\n \"repeatDelay\",\n \"from\",\n \"elapsed\",\n]);\n/**\n * Decide whether a transition is defined on a given Transition.\n * This filters out orchestration options and returns true\n * if any options are left.\n */\nfunction isTransitionDefined(transition) {\n for (const key in transition) {\n if (!orchestrationKeys.has(key))\n return true;\n }\n return false;\n}\n\nexport { isTransitionDefined };\n//# sourceMappingURL=is-transition-defined.mjs.map\n","import { secondsToMilliseconds, MotionGlobalConfig } from 'motion-utils';\nimport { AsyncMotionValueAnimation } from '../AsyncMotionValueAnimation.mjs';\nimport { JSAnimation } from '../JSAnimation.mjs';\nimport { getValueTransition } from '../utils/get-value-transition.mjs';\nimport { makeAnimationInstant } from '../utils/make-animation-instant.mjs';\nimport { getDefaultTransition } from '../utils/default-transitions.mjs';\nimport { getFinalKeyframe } from '../keyframes/get-final.mjs';\nimport { isTransitionDefined } from '../utils/is-transition-defined.mjs';\nimport { frame } from '../../frameloop/frame.mjs';\n\nconst animateMotionValue = (name, value, target, transition = {}, element, isHandoff) => (onComplete) => {\n const valueTransition = getValueTransition(transition, name) || {};\n /**\n * Most transition values are currently completely overwritten by value-specific\n * transitions. In the future it'd be nicer to blend these transitions. But for now\n * delay actually does inherit from the root transition if not value-specific.\n */\n const delay = valueTransition.delay || transition.delay || 0;\n /**\n * Elapsed isn't a public transition option but can be passed through from\n * optimized appear effects in milliseconds.\n */\n let { elapsed = 0 } = transition;\n elapsed = elapsed - secondsToMilliseconds(delay);\n const options = {\n keyframes: Array.isArray(target) ? target : [null, target],\n ease: \"easeOut\",\n velocity: value.getVelocity(),\n ...valueTransition,\n delay: -elapsed,\n onUpdate: (v) => {\n value.set(v);\n valueTransition.onUpdate && valueTransition.onUpdate(v);\n },\n onComplete: () => {\n onComplete();\n valueTransition.onComplete && valueTransition.onComplete();\n },\n name,\n motionValue: value,\n element: isHandoff ? undefined : element,\n };\n /**\n * If there's no transition defined for this value, we can generate\n * unique transition settings for this value.\n */\n if (!isTransitionDefined(valueTransition)) {\n Object.assign(options, getDefaultTransition(name, options));\n }\n /**\n * Both WAAPI and our internal animation functions use durations\n * as defined by milliseconds, while our external API defines them\n * as seconds.\n */\n options.duration && (options.duration = secondsToMilliseconds(options.duration));\n options.repeatDelay && (options.repeatDelay = secondsToMilliseconds(options.repeatDelay));\n /**\n * Support deprecated way to set initial value. Prefer keyframe syntax.\n */\n if (options.from !== undefined) {\n options.keyframes[0] = options.from;\n }\n let shouldSkip = false;\n if (options.type === false ||\n (options.duration === 0 && !options.repeatDelay)) {\n makeAnimationInstant(options);\n if (options.delay === 0) {\n shouldSkip = true;\n }\n }\n if (MotionGlobalConfig.instantAnimations ||\n MotionGlobalConfig.skipAnimations ||\n element?.shouldSkipAnimations ||\n valueTransition.skipAnimations) {\n shouldSkip = true;\n makeAnimationInstant(options);\n options.delay = 0;\n }\n /**\n * If the transition type or easing has been explicitly set by the user\n * then we don't want to allow flattening the animation.\n */\n options.allowFlatten = !valueTransition.type && !valueTransition.ease;\n /**\n * If we can or must skip creating the animation, and apply only\n * the final keyframe, do so. We also check once keyframes are resolved but\n * this early check prevents the need to create an animation at all.\n */\n if (shouldSkip && !isHandoff && value.get() !== undefined) {\n const finalKeyframe = getFinalKeyframe(options.keyframes, valueTransition);\n if (finalKeyframe !== undefined) {\n frame.update(() => {\n options.onUpdate(finalKeyframe);\n options.onComplete();\n });\n return;\n }\n }\n return valueTransition.isSync\n ? new JSAnimation(options)\n : new AsyncMotionValueAnimation(options);\n};\n\nexport { animateMotionValue };\n//# sourceMappingURL=motion-value.mjs.map\n","import { invariant, isNumericalString } from 'motion-utils';\nimport { isCSSVariableToken } from './is-css-variable.mjs';\n\n/**\n * Parse Framer's special CSS variable format into a CSS token and a fallback.\n *\n * ```\n * `var(--foo, #fff)` => [`--foo`, '#fff']\n * ```\n *\n * @param current\n */\nconst splitCSSVariableRegex = \n// eslint-disable-next-line redos-detector/no-unsafe-regex -- false positive, as it can match a lot of words\n/^var\\(--(?:([\\w-]+)|([\\w-]+), ?([a-zA-Z\\d ()%#.,-]+))\\)/u;\nfunction parseCSSVariable(current) {\n const match = splitCSSVariableRegex.exec(current);\n if (!match)\n return [,];\n const [, token1, token2, fallback] = match;\n return [`--${token1 ?? token2}`, fallback];\n}\nconst maxDepth = 4;\nfunction getVariableValue(current, element, depth = 1) {\n invariant(depth <= maxDepth, `Max CSS variable fallback depth detected in property \"${current}\". This may indicate a circular fallback dependency.`, \"max-css-var-depth\");\n const [token, fallback] = parseCSSVariable(current);\n // No CSS variable detected\n if (!token)\n return;\n // Attempt to read this CSS variable off the element\n const resolved = window.getComputedStyle(element).getPropertyValue(token);\n if (resolved) {\n const trimmed = resolved.trim();\n return isNumericalString(trimmed) ? parseFloat(trimmed) : trimmed;\n }\n return isCSSVariableToken(fallback)\n ? getVariableValue(fallback, element, depth + 1)\n : fallback;\n}\n\nexport { getVariableValue, parseCSSVariable };\n//# sourceMappingURL=css-variables-conversion.mjs.map\n","function getValueState(visualElement) {\n const state = [{}, {}];\n visualElement?.values.forEach((value, key) => {\n state[0][key] = value.get();\n state[1][key] = value.getVelocity();\n });\n return state;\n}\nfunction resolveVariantFromProps(props, definition, custom, visualElement) {\n /**\n * If the variant definition is a function, resolve.\n */\n if (typeof definition === \"function\") {\n const [current, velocity] = getValueState(visualElement);\n definition = definition(custom !== undefined ? custom : props.custom, current, velocity);\n }\n /**\n * If the variant definition is a variant label, or\n * the function returned a variant label, resolve.\n */\n if (typeof definition === \"string\") {\n definition = props.variants && props.variants[definition];\n }\n /**\n * At this point we've resolved both functions and variant labels,\n * but the resolved variant label might itself have been a function.\n * If so, resolve. This can only have returned a valid target object.\n */\n if (typeof definition === \"function\") {\n const [current, velocity] = getValueState(visualElement);\n definition = definition(custom !== undefined ? custom : props.custom, current, velocity);\n }\n return definition;\n}\n\nexport { resolveVariantFromProps };\n//# sourceMappingURL=resolve-variants.mjs.map\n","import { resolveVariantFromProps } from './resolve-variants.mjs';\n\nfunction resolveVariant(visualElement, definition, custom) {\n const props = visualElement.getProps();\n return resolveVariantFromProps(props, definition, custom !== undefined ? custom : props.custom, visualElement);\n}\n\nexport { resolveVariant };\n//# sourceMappingURL=resolve-dynamic-variants.mjs.map\n","import { transformPropOrder } from './keys-transform.mjs';\n\nconst positionalKeys = new Set([\n \"width\",\n \"height\",\n \"top\",\n \"left\",\n \"right\",\n \"bottom\",\n ...transformPropOrder,\n]);\n\nexport { positionalKeys };\n//# sourceMappingURL=keys-position.mjs.map\n","const isKeyframesTarget = (v) => {\n return Array.isArray(v);\n};\n\nexport { isKeyframesTarget };\n//# sourceMappingURL=is-keyframes-target.mjs.map\n","import { motionValue } from '../../value/index.mjs';\nimport { resolveVariant } from './resolve-dynamic-variants.mjs';\nimport { isKeyframesTarget } from './is-keyframes-target.mjs';\n\n/**\n * Set VisualElement's MotionValue, creating a new MotionValue for it if\n * it doesn't exist.\n */\nfunction setMotionValue(visualElement, key, value) {\n if (visualElement.hasValue(key)) {\n visualElement.getValue(key).set(value);\n }\n else {\n visualElement.addValue(key, motionValue(value));\n }\n}\nfunction resolveFinalValueInKeyframes(v) {\n // TODO maybe throw if v.length - 1 is placeholder token?\n return isKeyframesTarget(v) ? v[v.length - 1] || 0 : v;\n}\nfunction setTarget(visualElement, definition) {\n const resolved = resolveVariant(visualElement, definition);\n let { transitionEnd = {}, transition = {}, ...target } = resolved || {};\n target = { ...target, ...transitionEnd };\n for (const key in target) {\n const value = resolveFinalValueInKeyframes(target[key]);\n setMotionValue(visualElement, key, value);\n }\n}\n\nexport { setTarget };\n//# sourceMappingURL=setters.mjs.map\n","const isMotionValue = (value) => Boolean(value && value.getVelocity);\n\nexport { isMotionValue };\n//# sourceMappingURL=is-motion-value.mjs.map\n","import { MotionGlobalConfig } from 'motion-utils';\nimport { isWillChangeMotionValue } from './is.mjs';\n\nfunction addValueToWillChange(visualElement, key) {\n const willChange = visualElement.getValue(\"willChange\");\n /**\n * It could be that a user has set willChange to a regular MotionValue,\n * in which case we can't add the value to it.\n */\n if (isWillChangeMotionValue(willChange)) {\n return willChange.add(key);\n }\n else if (!willChange && MotionGlobalConfig.WillChange) {\n const newWillChange = new MotionGlobalConfig.WillChange(\"auto\");\n visualElement.addValue(\"willChange\", newWillChange);\n newWillChange.add(key);\n }\n}\n\nexport { addValueToWillChange };\n//# sourceMappingURL=add-will-change.mjs.map\n","import { isMotionValue } from '../utils/is-motion-value.mjs';\n\nfunction isWillChangeMotionValue(value) {\n return Boolean(isMotionValue(value) && value.add);\n}\n\nexport { isWillChangeMotionValue };\n//# sourceMappingURL=is.mjs.map\n","function camelToDash(str) {\n return str.replace(/([A-Z])/g, (match) => `-${match.toLowerCase()}`);\n}\n\nexport { camelToDash };\n//# sourceMappingURL=camel-to-dash.mjs.map\n","import { camelToDash } from '../../render/dom/utils/camel-to-dash.mjs';\n\nconst optimizedAppearDataId = \"framerAppearId\";\nconst optimizedAppearDataAttribute = \"data-\" + camelToDash(optimizedAppearDataId);\n\nexport { optimizedAppearDataAttribute, optimizedAppearDataId };\n//# sourceMappingURL=data-id.mjs.map\n","import { optimizedAppearDataAttribute } from './data-id.mjs';\n\nfunction getOptimisedAppearId(visualElement) {\n return visualElement.props[optimizedAppearDataAttribute];\n}\n\nexport { getOptimisedAppearId };\n//# sourceMappingURL=get-appear-id.mjs.map\n","import { getValueTransition } from '../utils/get-value-transition.mjs';\nimport { resolveTransition } from '../utils/resolve-transition.mjs';\nimport { positionalKeys } from '../../render/utils/keys-position.mjs';\nimport { setTarget } from '../../render/utils/setters.mjs';\nimport { addValueToWillChange } from '../../value/will-change/add-will-change.mjs';\nimport { getOptimisedAppearId } from '../optimized-appear/get-appear-id.mjs';\nimport { animateMotionValue } from './motion-value.mjs';\nimport { frame } from '../../frameloop/frame.mjs';\n\n/**\n * Decide whether we should block this animation. Previously, we achieved this\n * just by checking whether the key was listed in protectedKeys, but this\n * posed problems if an animation was triggered by afterChildren and protectedKeys\n * had been set to true in the meantime.\n */\nfunction shouldBlockAnimation({ protectedKeys, needsAnimating }, key) {\n const shouldBlock = protectedKeys.hasOwnProperty(key) && needsAnimating[key] !== true;\n needsAnimating[key] = false;\n return shouldBlock;\n}\nfunction animateTarget(visualElement, targetAndTransition, { delay = 0, transitionOverride, type } = {}) {\n let { transition, transitionEnd, ...target } = targetAndTransition;\n const defaultTransition = visualElement.getDefaultTransition();\n transition = transition\n ? resolveTransition(transition, defaultTransition)\n : defaultTransition;\n const reduceMotion = transition?.reduceMotion;\n const skipAnimations = transition?.skipAnimations;\n if (transitionOverride)\n transition = transitionOverride;\n const animations = [];\n const animationTypeState = type &&\n visualElement.animationState &&\n visualElement.animationState.getState()[type];\n const path = transition?.path;\n if (path) {\n // path mutates `target` to claim x/y; loop below skips them.\n path.animateVisualElement(visualElement, target, transition, delay, animations);\n }\n for (const key in target) {\n const value = visualElement.getValue(key, visualElement.latestValues[key] ?? null);\n const valueTarget = target[key];\n if (valueTarget === undefined ||\n (animationTypeState &&\n shouldBlockAnimation(animationTypeState, key))) {\n continue;\n }\n const valueTransition = {\n delay,\n ...getValueTransition(transition || {}, key),\n };\n if (skipAnimations)\n valueTransition.skipAnimations = true;\n /**\n * If the value is already at the defined target, skip the animation.\n * We still re-assert the value via frame.update to take precedence\n * over any stale transitionEnd callbacks from previous animations.\n */\n const currentValue = value.get();\n if (currentValue !== undefined &&\n !value.isAnimating() &&\n !Array.isArray(valueTarget) &&\n valueTarget === currentValue &&\n !valueTransition.velocity) {\n frame.update(() => value.set(valueTarget));\n continue;\n }\n /**\n * If this is the first time a value is being animated, check\n * to see if we're handling off from an existing animation.\n */\n let isHandoff = false;\n if (window.MotionHandoffAnimation) {\n const appearId = getOptimisedAppearId(visualElement);\n if (appearId) {\n const startTime = window.MotionHandoffAnimation(appearId, key, frame);\n if (startTime !== null) {\n valueTransition.startTime = startTime;\n isHandoff = true;\n }\n }\n }\n addValueToWillChange(visualElement, key);\n const shouldReduceMotion = reduceMotion ?? visualElement.shouldReduceMotion;\n value.start(animateMotionValue(key, value, valueTarget, shouldReduceMotion && positionalKeys.has(key)\n ? { type: false }\n : valueTransition, visualElement, isHandoff));\n const animation = value.animation;\n if (animation) {\n animations.push(animation);\n }\n }\n if (transitionEnd) {\n const applyTransitionEnd = () => frame.update(() => {\n transitionEnd && setTarget(visualElement, transitionEnd);\n });\n if (animations.length) {\n Promise.all(animations).then(applyTransitionEnd);\n }\n else {\n applyTransitionEnd();\n }\n }\n return animations;\n}\n\nexport { animateTarget };\n//# sourceMappingURL=visual-element-target.mjs.map\n","import { resolveVariant } from '../../render/utils/resolve-dynamic-variants.mjs';\nimport { calcChildStagger } from '../utils/calc-child-stagger.mjs';\nimport { animateTarget } from './visual-element-target.mjs';\n\nfunction animateVariant(visualElement, variant, options = {}) {\n const resolved = resolveVariant(visualElement, variant, options.type === \"exit\"\n ? visualElement.presenceContext?.custom\n : undefined);\n let { transition = visualElement.getDefaultTransition() || {} } = resolved || {};\n if (options.transitionOverride) {\n transition = options.transitionOverride;\n }\n /**\n * If we have a variant, create a callback that runs it as an animation.\n * Otherwise, we resolve a Promise immediately for a composable no-op.\n */\n const getAnimation = resolved\n ? () => Promise.all(animateTarget(visualElement, resolved, options))\n : () => Promise.resolve();\n /**\n * If we have children, create a callback that runs all their animations.\n * Otherwise, we resolve a Promise immediately for a composable no-op.\n */\n const getChildAnimations = visualElement.variantChildren && visualElement.variantChildren.size\n ? (forwardDelay = 0) => {\n const { delayChildren = 0, staggerChildren, staggerDirection, } = transition;\n return animateChildren(visualElement, variant, forwardDelay, delayChildren, staggerChildren, staggerDirection, options);\n }\n : () => Promise.resolve();\n /**\n * If the transition explicitly defines a \"when\" option, we need to resolve either\n * this animation or all children animations before playing the other.\n */\n const { when } = transition;\n if (when) {\n const [first, last] = when === \"beforeChildren\"\n ? [getAnimation, getChildAnimations]\n : [getChildAnimations, getAnimation];\n return first().then(() => last());\n }\n else {\n return Promise.all([getAnimation(), getChildAnimations(options.delay)]);\n }\n}\nfunction animateChildren(visualElement, variant, delay = 0, delayChildren = 0, staggerChildren = 0, staggerDirection = 1, options) {\n const animations = [];\n for (const child of visualElement.variantChildren) {\n child.notify(\"AnimationStart\", variant);\n animations.push(animateVariant(child, variant, {\n ...options,\n delay: delay +\n (typeof delayChildren === \"function\" ? 0 : delayChildren) +\n calcChildStagger(visualElement.variantChildren, child, delayChildren, staggerChildren, staggerDirection),\n }).then(() => child.notify(\"AnimationComplete\", variant)));\n }\n return Promise.all(animations);\n}\n\nexport { animateVariant };\n//# sourceMappingURL=visual-element-variant.mjs.map\n","/**\n * ValueType for \"auto\"\n */\nconst auto = {\n test: (v) => v === \"auto\",\n parse: (v) => v,\n};\n\nexport { auto };\n//# sourceMappingURL=auto.mjs.map\n","/**\n * Tests a provided value against a ValueType\n */\nconst testValueType = (v) => (type) => type.test(v);\n\nexport { testValueType };\n//# sourceMappingURL=test.mjs.map\n","import { auto } from './auto.mjs';\nimport { number } from './numbers/index.mjs';\nimport { px, percent, degrees, vw, vh } from './numbers/units.mjs';\nimport { testValueType } from './test.mjs';\n\n/**\n * A list of value types commonly used for dimensions\n */\nconst dimensionValueTypes = [number, px, percent, degrees, vw, vh, auto];\n/**\n * Tests a dimensional value against the list of dimension ValueTypes\n */\nconst findDimensionValueType = (v) => dimensionValueTypes.find(testValueType(v));\n\nexport { dimensionValueTypes, findDimensionValueType };\n//# sourceMappingURL=dimensions.mjs.map\n","import { isZeroValueString } from 'motion-utils';\n\nfunction isNone(value) {\n if (typeof value === \"number\") {\n return value === 0;\n }\n else if (value !== null) {\n return value === \"none\" || value === \"0\" || isZeroValueString(value);\n }\n else {\n return true;\n }\n}\n\nexport { isNone };\n//# sourceMappingURL=is-none.mjs.map\n","import { complex } from './index.mjs';\nimport { floatRegex } from '../utils/float-regex.mjs';\n\n/**\n * Properties that should default to 1 or 100%\n */\nconst maxDefaults = new Set([\"brightness\", \"contrast\", \"saturate\", \"opacity\"]);\nfunction applyDefaultFilter(v) {\n const [name, value] = v.slice(0, -1).split(\"(\");\n if (name === \"drop-shadow\")\n return v;\n const [number] = value.match(floatRegex) || [];\n if (!number)\n return v;\n const unit = value.replace(number, \"\");\n let defaultValue = maxDefaults.has(name) ? 1 : 0;\n if (number !== value)\n defaultValue *= 100;\n return name + \"(\" + defaultValue + unit + \")\";\n}\nconst functionRegex = /\\b([a-z-]*)\\(.*?\\)/gu;\nconst filter = {\n ...complex,\n getAnimatableNone: (v) => {\n const functions = v.match(functionRegex);\n return functions ? functions.map(applyDefaultFilter).join(\" \") : v;\n },\n};\n\nexport { filter };\n//# sourceMappingURL=filter.mjs.map\n","import { complex } from './index.mjs';\n\nconst mask = {\n ...complex,\n getAnimatableNone: (v) => {\n const parsed = complex.parse(v);\n const transformer = complex.createTransformer(v);\n return transformer(parsed.map((v) => typeof v === \"number\" ? 0 : typeof v === \"object\" ? { ...v, alpha: 1 } : v));\n },\n};\n\nexport { mask };\n//# sourceMappingURL=mask.mjs.map\n","import { number } from './numbers/index.mjs';\n\nconst int = {\n ...number,\n transform: Math.round,\n};\n\nexport { int };\n//# sourceMappingURL=int.mjs.map\n","import { int } from '../int.mjs';\nimport { alpha } from '../numbers/index.mjs';\nimport { px } from '../numbers/units.mjs';\nimport { transformValueTypes } from './transform.mjs';\n\nconst numberValueTypes = {\n // Border props\n borderWidth: px,\n borderTopWidth: px,\n borderRightWidth: px,\n borderBottomWidth: px,\n borderLeftWidth: px,\n borderRadius: px,\n borderTopLeftRadius: px,\n borderTopRightRadius: px,\n borderBottomRightRadius: px,\n borderBottomLeftRadius: px,\n // Positioning props\n width: px,\n maxWidth: px,\n height: px,\n maxHeight: px,\n top: px,\n right: px,\n bottom: px,\n left: px,\n inset: px,\n insetBlock: px,\n insetBlockStart: px,\n insetBlockEnd: px,\n insetInline: px,\n insetInlineStart: px,\n insetInlineEnd: px,\n // Spacing props\n padding: px,\n paddingTop: px,\n paddingRight: px,\n paddingBottom: px,\n paddingLeft: px,\n paddingBlock: px,\n paddingBlockStart: px,\n paddingBlockEnd: px,\n paddingInline: px,\n paddingInlineStart: px,\n paddingInlineEnd: px,\n margin: px,\n marginTop: px,\n marginRight: px,\n marginBottom: px,\n marginLeft: px,\n marginBlock: px,\n marginBlockStart: px,\n marginBlockEnd: px,\n marginInline: px,\n marginInlineStart: px,\n marginInlineEnd: px,\n // Typography\n fontSize: px,\n // Misc\n backgroundPositionX: px,\n backgroundPositionY: px,\n ...transformValueTypes,\n zIndex: int,\n // SVG\n fillOpacity: alpha,\n strokeOpacity: alpha,\n numOctaves: int,\n};\n\nexport { numberValueTypes };\n//# sourceMappingURL=number.mjs.map\n","import { alpha, scale } from '../numbers/index.mjs';\nimport { px, progressPercentage, degrees } from '../numbers/units.mjs';\n\nconst transformValueTypes = {\n rotate: degrees,\n /**\n * Internal channel for `transition.path` orientToPath. Composed onto\n * `rotate` at the transform-build sites so the user's `rotate` is\n * never read or overwritten. Not part of `transformPropOrder`.\n */\n pathRotation: degrees,\n rotateX: degrees,\n rotateY: degrees,\n rotateZ: degrees,\n scale,\n scaleX: scale,\n scaleY: scale,\n scaleZ: scale,\n skew: degrees,\n skewX: degrees,\n skewY: degrees,\n distance: px,\n translateX: px,\n translateY: px,\n translateZ: px,\n x: px,\n y: px,\n z: px,\n perspective: px,\n transformPerspective: px,\n opacity: alpha,\n originX: progressPercentage,\n originY: progressPercentage,\n originZ: px,\n};\n\nexport { transformValueTypes };\n//# sourceMappingURL=transform.mjs.map\n","import { color } from '../color/index.mjs';\nimport { filter } from '../complex/filter.mjs';\nimport { mask } from '../complex/mask.mjs';\nimport { numberValueTypes } from './number.mjs';\n\n/**\n * A map of default value types for common values\n */\nconst defaultValueTypes = {\n ...numberValueTypes,\n // Color props\n color,\n backgroundColor: color,\n outlineColor: color,\n fill: color,\n stroke: color,\n // Border props\n borderColor: color,\n borderTopColor: color,\n borderRightColor: color,\n borderBottomColor: color,\n borderLeftColor: color,\n filter,\n WebkitFilter: filter,\n mask,\n WebkitMask: mask,\n};\n/**\n * Gets the default ValueType for the provided value key\n */\nconst getDefaultValueType = (key) => defaultValueTypes[key];\n\nexport { defaultValueTypes, getDefaultValueType };\n//# sourceMappingURL=defaults.mjs.map\n","import { complex } from '../complex/index.mjs';\nimport { filter } from '../complex/filter.mjs';\nimport { mask } from '../complex/mask.mjs';\nimport { getDefaultValueType } from '../maps/defaults.mjs';\n\nconst customTypes = /*@__PURE__*/ new Set([filter, mask]);\nfunction getAnimatableNone(key, value) {\n let defaultValueType = getDefaultValueType(key);\n if (!customTypes.has(defaultValueType))\n defaultValueType = complex;\n // If value is not recognised as animatable, ie \"none\", create an animatable version origin based on the target\n return defaultValueType.getAnimatableNone\n ? defaultValueType.getAnimatableNone(value)\n : undefined;\n}\n\nexport { getAnimatableNone };\n//# sourceMappingURL=animatable-none.mjs.map\n","import { analyseComplexValue } from '../../../value/types/complex/index.mjs';\nimport { getAnimatableNone } from '../../../value/types/utils/animatable-none.mjs';\n\n/**\n * If we encounter keyframes like \"none\" or \"0\" and we also have keyframes like\n * \"#fff\" or \"200px 200px\" we want to find a keyframe to serve as a template for\n * the \"none\" keyframes. In this case \"#fff\" or \"200px 200px\" - then these get turned into\n * zero equivalents, i.e. \"#fff0\" or \"0px 0px\".\n */\nconst invalidTemplates = new Set([\"auto\", \"none\", \"0\"]);\nfunction makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, name) {\n let i = 0;\n let animatableTemplate = undefined;\n while (i < unresolvedKeyframes.length && !animatableTemplate) {\n const keyframe = unresolvedKeyframes[i];\n if (typeof keyframe === \"string\" &&\n !invalidTemplates.has(keyframe) &&\n analyseComplexValue(keyframe).values.length) {\n animatableTemplate = unresolvedKeyframes[i];\n }\n i++;\n }\n if (animatableTemplate && name) {\n for (const noneIndex of noneKeyframeIndexes) {\n unresolvedKeyframes[noneIndex] = getAnimatableNone(name, animatableTemplate);\n }\n }\n}\n\nexport { makeNoneKeyframesAnimatable };\n//# sourceMappingURL=make-none-animatable.mjs.map\n","import { positionalKeys } from '../../render/utils/keys-position.mjs';\nimport { findDimensionValueType } from '../../value/types/dimensions.mjs';\nimport { getVariableValue } from '../utils/css-variables-conversion.mjs';\nimport { isCSSVariableToken, containsCSSVariable } from '../utils/is-css-variable.mjs';\nimport { KeyframeResolver } from './KeyframesResolver.mjs';\nimport { isNone } from './utils/is-none.mjs';\nimport { makeNoneKeyframesAnimatable } from './utils/make-none-animatable.mjs';\nimport { positionalValues, isNumOrPxType } from './utils/unit-conversion.mjs';\n\nclass DOMKeyframesResolver extends KeyframeResolver {\n constructor(unresolvedKeyframes, onComplete, name, motionValue, element) {\n super(unresolvedKeyframes, onComplete, name, motionValue, element, true);\n }\n readKeyframes() {\n const { unresolvedKeyframes, element, name } = this;\n if (!element || !element.current)\n return;\n super.readKeyframes();\n /**\n * If any keyframe is a CSS variable, we need to find its value by sampling the element\n */\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n let keyframe = unresolvedKeyframes[i];\n if (typeof keyframe === \"string\") {\n keyframe = keyframe.trim();\n if (isCSSVariableToken(keyframe)) {\n const resolved = getVariableValue(keyframe, element.current);\n if (resolved !== undefined) {\n unresolvedKeyframes[i] = resolved;\n }\n if (i === unresolvedKeyframes.length - 1) {\n this.finalKeyframe = keyframe;\n }\n }\n }\n }\n /**\n * Resolve \"none\" values. We do this potentially twice - once before and once after measuring keyframes.\n * This could be seen as inefficient but it's a trade-off to avoid measurements in more situations, which\n * have a far bigger performance impact.\n */\n this.resolveNoneKeyframes();\n /**\n * Check to see if unit type has changed. If so schedule jobs that will\n * temporarily set styles to the destination keyframes.\n * Skip if we have more than two keyframes or this isn't a positional value.\n * TODO: We can throw if there are multiple keyframes and the value type changes.\n */\n if (!positionalKeys.has(name) || unresolvedKeyframes.length !== 2) {\n return;\n }\n const [origin, target] = unresolvedKeyframes;\n const originType = findDimensionValueType(origin);\n const targetType = findDimensionValueType(target);\n /**\n * If one keyframe contains embedded CSS variables (e.g. in calc()) and the other\n * doesn't, we need to measure to convert to pixels. This handles GitHub issue #3410.\n */\n const originHasVar = containsCSSVariable(origin);\n const targetHasVar = containsCSSVariable(target);\n if (originHasVar !== targetHasVar && positionalValues[name]) {\n this.needsMeasurement = true;\n return;\n }\n /**\n * Either we don't recognise these value types or we can animate between them.\n */\n if (originType === targetType)\n return;\n /**\n * If both values are numbers or pixels, we can animate between them by\n * converting them to numbers.\n */\n if (isNumOrPxType(originType) && isNumOrPxType(targetType)) {\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n const value = unresolvedKeyframes[i];\n if (typeof value === \"string\") {\n unresolvedKeyframes[i] = parseFloat(value);\n }\n }\n }\n else if (positionalValues[name]) {\n /**\n * Else, the only way to resolve this is by measuring the element.\n */\n this.needsMeasurement = true;\n }\n }\n resolveNoneKeyframes() {\n const { unresolvedKeyframes, name } = this;\n const noneKeyframeIndexes = [];\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n if (unresolvedKeyframes[i] === null ||\n isNone(unresolvedKeyframes[i])) {\n noneKeyframeIndexes.push(i);\n }\n }\n if (noneKeyframeIndexes.length) {\n makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, name);\n }\n }\n measureInitialState() {\n const { element, unresolvedKeyframes, name } = this;\n if (!element || !element.current)\n return;\n if (name === \"height\") {\n this.suspendedScrollY = window.pageYOffset;\n }\n this.measuredOrigin = positionalValues[name](element.measureViewportBox(), window.getComputedStyle(element.current));\n unresolvedKeyframes[0] = this.measuredOrigin;\n // Set final key frame to measure after next render\n const measureKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1];\n if (measureKeyframe !== undefined) {\n element.getValue(name, measureKeyframe).jump(measureKeyframe, false);\n }\n }\n measureEndState() {\n const { element, name, unresolvedKeyframes } = this;\n if (!element || !element.current)\n return;\n const value = element.getValue(name);\n value && value.jump(this.measuredOrigin, false);\n const finalKeyframeIndex = unresolvedKeyframes.length - 1;\n const finalKeyframe = unresolvedKeyframes[finalKeyframeIndex];\n unresolvedKeyframes[finalKeyframeIndex] = positionalValues[name](element.measureViewportBox(), window.getComputedStyle(element.current));\n if (finalKeyframe !== null && this.finalKeyframe === undefined) {\n this.finalKeyframe = finalKeyframe;\n }\n // If we removed transform values, reapply them before the next render\n if (this.removedTransforms?.length) {\n this.removedTransforms.forEach(([unsetTransformName, unsetTransformValue]) => {\n element\n .getValue(unsetTransformName)\n .set(unsetTransformValue);\n });\n }\n this.resolveNoneKeyframes();\n }\n}\n\nexport { DOMKeyframesResolver };\n//# sourceMappingURL=DOMKeyframesResolver.mjs.map\n","/**\n * The four corner-radius longhands. Shared so the projection mixer, scale\n * corrector, WAAPI px-value set and view-transition crop pass don't each carry\n * their own copy. Order is irrelevant - every consumer mixes/corrects/animates\n * each corner independently.\n */\nconst cornerRadiusProps = [\n \"borderTopLeftRadius\",\n \"borderTopRightRadius\",\n \"borderBottomRightRadius\",\n \"borderBottomLeftRadius\",\n];\n\nexport { cornerRadiusProps };\n//# sourceMappingURL=border-radius.mjs.map\n","function resolveElements(elementOrSelector, scope, selectorCache) {\n if (elementOrSelector == null) {\n return [];\n }\n if (elementOrSelector instanceof EventTarget) {\n return [elementOrSelector];\n }\n else if (typeof elementOrSelector === \"string\") {\n let root = document;\n if (scope) {\n root = scope.current;\n }\n const elements = selectorCache?.[elementOrSelector] ??\n root.querySelectorAll(elementOrSelector);\n return elements ? Array.from(elements) : [];\n }\n return Array.from(elementOrSelector).filter((element) => element != null);\n}\n\nexport { resolveElements };\n//# sourceMappingURL=resolve-elements.mjs.map\n","/**\n * Provided a value and a ValueType, returns the value as that value type.\n */\nconst getValueAsType = (value, type) => {\n return type && typeof value === \"number\"\n ? type.transform(value)\n : value;\n};\n\nexport { getValueAsType };\n//# sourceMappingURL=get-as-type.mjs.map\n","import { createRenderBatcher } from './batcher.mjs';\n\nconst { schedule: microtask, cancel: cancelMicrotask } = \n/* @__PURE__ */ createRenderBatcher(queueMicrotask, false);\n\nexport { cancelMicrotask, microtask };\n//# sourceMappingURL=microtask.mjs.map\n","const isDragging = {\n x: false,\n y: false,\n};\nfunction isDragActive() {\n return isDragging.x || isDragging.y;\n}\n\nexport { isDragActive, isDragging };\n//# sourceMappingURL=is-active.mjs.map\n","import { resolveElements } from '../../utils/resolve-elements.mjs';\n\nfunction setupGesture(elementOrSelector, options) {\n const elements = resolveElements(elementOrSelector);\n const gestureAbortController = new AbortController();\n const eventOptions = {\n passive: true,\n ...options,\n signal: gestureAbortController.signal,\n };\n const cancel = () => gestureAbortController.abort();\n return [elements, eventOptions, cancel];\n}\n\nexport { setupGesture };\n//# sourceMappingURL=setup.mjs.map\n","import { isDragActive } from './drag/state/is-active.mjs';\nimport { setupGesture } from './utils/setup.mjs';\n\nfunction isValidHover(event) {\n return !(event.pointerType === \"touch\" || isDragActive());\n}\n/**\n * Create a hover gesture. hover() is different to .addEventListener(\"pointerenter\")\n * in that it has an easier syntax, filters out polyfilled touch events, interoperates\n * with drag gestures, and automatically removes the \"pointerennd\" event listener when the hover ends.\n *\n * @public\n */\nfunction hover(elementOrSelector, onHoverStart, options = {}) {\n const [elements, eventOptions, cancel] = setupGesture(elementOrSelector, options);\n elements.forEach((element) => {\n let isPressed = false;\n let deferredHoverEnd = false;\n let hoverEndCallback;\n const removePointerLeave = () => {\n element.removeEventListener(\"pointerleave\", onPointerLeave);\n };\n const endHover = (event) => {\n if (hoverEndCallback) {\n hoverEndCallback(event);\n hoverEndCallback = undefined;\n }\n removePointerLeave();\n };\n const onPointerUp = (event) => {\n isPressed = false;\n window.removeEventListener(\"pointerup\", onPointerUp);\n window.removeEventListener(\"pointercancel\", onPointerUp);\n if (deferredHoverEnd) {\n deferredHoverEnd = false;\n endHover(event);\n }\n };\n const onPointerDown = () => {\n isPressed = true;\n window.addEventListener(\"pointerup\", onPointerUp, eventOptions);\n window.addEventListener(\"pointercancel\", onPointerUp, eventOptions);\n };\n const onPointerLeave = (leaveEvent) => {\n if (leaveEvent.pointerType === \"touch\")\n return;\n if (isPressed) {\n deferredHoverEnd = true;\n return;\n }\n endHover(leaveEvent);\n };\n const onPointerEnter = (enterEvent) => {\n if (!isValidHover(enterEvent))\n return;\n deferredHoverEnd = false;\n const onHoverEnd = onHoverStart(element, enterEvent);\n if (typeof onHoverEnd !== \"function\")\n return;\n hoverEndCallback = onHoverEnd;\n element.addEventListener(\"pointerleave\", onPointerLeave, eventOptions);\n };\n element.addEventListener(\"pointerenter\", onPointerEnter, eventOptions);\n element.addEventListener(\"pointerdown\", onPointerDown, eventOptions);\n });\n return cancel;\n}\n\nexport { hover };\n//# sourceMappingURL=hover.mjs.map\n","/**\n * Recursively traverse up the tree to check whether the provided child node\n * is the parent or a descendant of it.\n *\n * @param parent - Element to find\n * @param child - Element to test against parent\n */\nconst isNodeOrChild = (parent, child) => {\n if (!child) {\n return false;\n }\n else if (parent === child) {\n return true;\n }\n else {\n return isNodeOrChild(parent, child.parentElement);\n }\n};\n\nexport { isNodeOrChild };\n//# sourceMappingURL=is-node-or-child.mjs.map\n","const isPrimaryPointer = (event) => {\n if (event.pointerType === \"mouse\") {\n return typeof event.button !== \"number\" || event.button <= 0;\n }\n else {\n /**\n * isPrimary is true for all mice buttons, whereas every touch point\n * is regarded as its own input. So subsequent concurrent touch points\n * will be false.\n *\n * Specifically match against false here as incomplete versions of\n * PointerEvents in very old browser might have it set as undefined.\n */\n return event.isPrimary !== false;\n }\n};\n\nexport { isPrimaryPointer };\n//# sourceMappingURL=is-primary-pointer.mjs.map\n","const keyboardAccessibleElements = new Set([\n \"BUTTON\",\n \"INPUT\",\n \"SELECT\",\n \"TEXTAREA\",\n \"A\",\n]);\n/**\n * Checks if an element is natively keyboard accessible (focusable).\n * Used by the press gesture to determine if we need to add tabIndex.\n */\nfunction isElementKeyboardAccessible(element) {\n return (keyboardAccessibleElements.has(element.tagName) ||\n element.isContentEditable === true);\n}\nconst textInputElements = new Set([\"INPUT\", \"SELECT\", \"TEXTAREA\"]);\n/**\n * Checks if an element has text selection or direct interaction behavior\n * that should block drag gestures from starting.\n *\n * This specifically targets form controls where the user might want to select\n * text or interact with the control (e.g., sliders, dropdowns).\n *\n * Buttons and links are NOT included because they don't have click-and-move\n * actions of their own - they only respond to click events, so dragging\n * should still work when initiated from these elements.\n */\nfunction isElementTextInput(element) {\n return (textInputElements.has(element.tagName) ||\n element.isContentEditable === true);\n}\n\nexport { isElementKeyboardAccessible, isElementTextInput };\n//# sourceMappingURL=is-keyboard-accessible.mjs.map\n","const isPressing = new WeakSet();\n\nexport { isPressing };\n//# sourceMappingURL=state.mjs.map\n","import { isPressing } from './state.mjs';\n\n/**\n * Filter out events that are not \"Enter\" keys.\n */\nfunction filterEvents(callback) {\n return (event) => {\n if (event.key !== \"Enter\")\n return;\n callback(event);\n };\n}\nfunction firePointerEvent(target, type) {\n target.dispatchEvent(new PointerEvent(\"pointer\" + type, { isPrimary: true, bubbles: true }));\n}\nconst enableKeyboardPress = (focusEvent, eventOptions) => {\n const element = focusEvent.currentTarget;\n if (!element)\n return;\n const handleKeydown = filterEvents(() => {\n if (isPressing.has(element))\n return;\n firePointerEvent(element, \"down\");\n const handleKeyup = filterEvents(() => {\n firePointerEvent(element, \"up\");\n });\n const handleBlur = () => firePointerEvent(element, \"cancel\");\n element.addEventListener(\"keyup\", handleKeyup, eventOptions);\n element.addEventListener(\"blur\", handleBlur, eventOptions);\n });\n element.addEventListener(\"keydown\", handleKeydown, eventOptions);\n /**\n * Add an event listener that fires on blur to remove the keydown events.\n */\n element.addEventListener(\"blur\", () => element.removeEventListener(\"keydown\", handleKeydown), eventOptions);\n};\n\nexport { enableKeyboardPress };\n//# sourceMappingURL=keyboard.mjs.map\n","import { isHTMLElement } from '../../utils/is-html-element.mjs';\nimport { isDragActive } from '../drag/state/is-active.mjs';\nimport { isNodeOrChild } from '../utils/is-node-or-child.mjs';\nimport { isPrimaryPointer } from '../utils/is-primary-pointer.mjs';\nimport { setupGesture } from '../utils/setup.mjs';\nimport { isElementKeyboardAccessible } from './utils/is-keyboard-accessible.mjs';\nimport { enableKeyboardPress } from './utils/keyboard.mjs';\nimport { isPressing } from './utils/state.mjs';\n\n/**\n * Filter out events that are not primary pointer events, or are triggering\n * while a Motion gesture is active.\n */\nfunction isValidPressEvent(event) {\n return isPrimaryPointer(event) && !isDragActive();\n}\nconst claimedPointerDownEvents = new WeakSet();\n/**\n * Create a press gesture.\n *\n * Press is different to `\"pointerdown\"`, `\"pointerup\"` in that it\n * automatically filters out secondary pointer events like right\n * click and multitouch.\n *\n * It also adds accessibility support for keyboards, where\n * an element with a press gesture will receive focus and\n * trigger on Enter `\"keydown\"` and `\"keyup\"` events.\n *\n * This is different to a browser's `\"click\"` event, which does\n * respond to keyboards but only for the `\"click\"` itself, rather\n * than the press start and end/cancel. The element also needs\n * to be focusable for this to work, whereas a press gesture will\n * make an element focusable by default.\n *\n * @public\n */\nfunction press(targetOrSelector, onPressStart, options = {}) {\n const [targets, eventOptions, cancelEvents] = setupGesture(targetOrSelector, options);\n const startPress = (startEvent) => {\n const target = startEvent.currentTarget;\n if (!isValidPressEvent(startEvent))\n return;\n if (claimedPointerDownEvents.has(startEvent))\n return;\n isPressing.add(target);\n if (options.stopPropagation) {\n claimedPointerDownEvents.add(startEvent);\n }\n const onPressEnd = onPressStart(target, startEvent);\n /**\n * End listeners run in the capture phase so a descendant calling\n * stopPropagation() in its own pointerup handler can't prevent the\n * press gesture from ending. This also keeps the gesture-end\n * ordering consistent with the drag gesture. See #2794.\n */\n const endEventOptions = { ...eventOptions, capture: true };\n const onPointerEnd = (endEvent, success) => {\n window.removeEventListener(\"pointerup\", onPointerUp, endEventOptions);\n window.removeEventListener(\"pointercancel\", onPointerCancel, endEventOptions);\n if (isPressing.has(target)) {\n isPressing.delete(target);\n }\n if (!isValidPressEvent(endEvent)) {\n return;\n }\n if (typeof onPressEnd === \"function\") {\n onPressEnd(endEvent, { success });\n }\n };\n const onPointerUp = (upEvent) => {\n onPointerEnd(upEvent, target === window ||\n target === document ||\n options.useGlobalTarget ||\n isNodeOrChild(target, upEvent.target));\n };\n const onPointerCancel = (cancelEvent) => {\n onPointerEnd(cancelEvent, false);\n };\n window.addEventListener(\"pointerup\", onPointerUp, endEventOptions);\n window.addEventListener(\"pointercancel\", onPointerCancel, endEventOptions);\n };\n targets.forEach((target) => {\n const pointerDownTarget = options.useGlobalTarget ? window : target;\n pointerDownTarget.addEventListener(\"pointerdown\", startPress, eventOptions);\n if (isHTMLElement(target)) {\n target.addEventListener(\"focus\", (event) => enableKeyboardPress(event, eventOptions));\n if (!isElementKeyboardAccessible(target) &&\n !target.hasAttribute(\"tabindex\")) {\n target.tabIndex = 0;\n }\n }\n });\n return cancelEvents;\n}\n\nexport { press };\n//# sourceMappingURL=index.mjs.map\n","import { isObject } from 'motion-utils';\n\n/**\n * Checks if an element is an HTML element in a way\n * that works across iframes\n */\nfunction isHTMLElement(element) {\n return (isObject(element) &&\n \"offsetHeight\" in element &&\n !(\"ownerSVGElement\" in element));\n}\n\nexport { isHTMLElement };\n//# sourceMappingURL=is-html-element.mjs.map\n","import { isObject } from 'motion-utils';\n\n/**\n * Checks if an element is an SVG element in a way\n * that works across iframes\n */\nfunction isSVGElement(element) {\n return isObject(element) && \"ownerSVGElement\" in element;\n}\n\nexport { isSVGElement };\n//# sourceMappingURL=is-svg-element.mjs.map\n","import { isSVGElement } from '../utils/is-svg-element.mjs';\nimport { resolveElements } from '../utils/resolve-elements.mjs';\n\nconst resizeHandlers = new WeakMap();\nlet observer;\nconst getSize = (borderBoxAxis, svgAxis, htmlAxis) => (target, borderBoxSize) => {\n if (borderBoxSize && borderBoxSize[0]) {\n return borderBoxSize[0][(borderBoxAxis + \"Size\")];\n }\n else if (isSVGElement(target) && \"getBBox\" in target) {\n return target.getBBox()[svgAxis];\n }\n else {\n return target[htmlAxis];\n }\n};\nconst getWidth = /*@__PURE__*/ getSize(\"inline\", \"width\", \"offsetWidth\");\nconst getHeight = /*@__PURE__*/ getSize(\"block\", \"height\", \"offsetHeight\");\nfunction notifyTarget({ target, borderBoxSize }) {\n resizeHandlers.get(target)?.forEach((handler) => {\n handler(target, {\n get width() {\n return getWidth(target, borderBoxSize);\n },\n get height() {\n return getHeight(target, borderBoxSize);\n },\n });\n });\n}\nfunction notifyAll(entries) {\n entries.forEach(notifyTarget);\n}\nfunction createResizeObserver() {\n if (typeof ResizeObserver === \"undefined\")\n return;\n observer = new ResizeObserver(notifyAll);\n}\nfunction resizeElement(target, handler) {\n if (!observer)\n createResizeObserver();\n const elements = resolveElements(target);\n elements.forEach((element) => {\n let elementHandlers = resizeHandlers.get(element);\n if (!elementHandlers) {\n elementHandlers = new Set();\n resizeHandlers.set(element, elementHandlers);\n }\n elementHandlers.add(handler);\n observer?.observe(element);\n });\n return () => {\n elements.forEach((element) => {\n const elementHandlers = resizeHandlers.get(element);\n elementHandlers?.delete(handler);\n if (!elementHandlers?.size) {\n observer?.unobserve(element);\n }\n });\n };\n}\n\nexport { resizeElement };\n//# sourceMappingURL=handle-element.mjs.map\n","const windowCallbacks = new Set();\nlet windowResizeHandler;\nfunction createWindowResizeHandler() {\n windowResizeHandler = () => {\n const info = {\n get width() {\n return window.innerWidth;\n },\n get height() {\n return window.innerHeight;\n },\n };\n windowCallbacks.forEach((callback) => callback(info));\n };\n window.addEventListener(\"resize\", windowResizeHandler);\n}\nfunction resizeWindow(callback) {\n windowCallbacks.add(callback);\n if (!windowResizeHandler)\n createWindowResizeHandler();\n return () => {\n windowCallbacks.delete(callback);\n if (!windowCallbacks.size &&\n typeof windowResizeHandler === \"function\") {\n window.removeEventListener(\"resize\", windowResizeHandler);\n windowResizeHandler = undefined;\n }\n };\n}\n\nexport { resizeWindow };\n//# sourceMappingURL=handle-window.mjs.map\n","import { resizeElement } from './handle-element.mjs';\nimport { resizeWindow } from './handle-window.mjs';\n\nfunction resize(a, b) {\n return typeof a === \"function\" ? resizeWindow(a) : resizeElement(a, b);\n}\n\nexport { resize };\n//# sourceMappingURL=index.mjs.map\n","import { color } from '../color/index.mjs';\nimport { complex } from '../complex/index.mjs';\nimport { dimensionValueTypes } from '../dimensions.mjs';\nimport { testValueType } from '../test.mjs';\n\n/**\n * A list of all ValueTypes\n */\nconst valueTypes = [...dimensionValueTypes, color, complex];\n/**\n * Tests a value against the list of ValueTypes\n */\nconst findValueType = (v) => valueTypes.find(testValueType(v));\n\nexport { findValueType };\n//# sourceMappingURL=find.mjs.map\n","const createAxisDelta = () => ({\n translate: 0,\n scale: 1,\n origin: 0,\n originPoint: 0,\n});\nconst createDelta = () => ({\n x: createAxisDelta(),\n y: createAxisDelta(),\n});\nconst createAxis = () => ({ min: 0, max: 0 });\nconst createBox = () => ({\n x: createAxis(),\n y: createAxis(),\n});\n\nexport { createAxis, createAxisDelta, createBox, createDelta };\n//# sourceMappingURL=models.mjs.map\n","const visualElementStore = new WeakMap();\n\nexport { visualElementStore };\n//# sourceMappingURL=store.mjs.map\n","function isAnimationControls(v) {\n return (v !== null &&\n typeof v === \"object\" &&\n typeof v.start === \"function\");\n}\n\nexport { isAnimationControls };\n//# sourceMappingURL=is-animation-controls.mjs.map\n","/**\n * Decides if the supplied variable is variant label\n */\nfunction isVariantLabel(v) {\n return typeof v === \"string\" || Array.isArray(v);\n}\n\nexport { isVariantLabel };\n//# sourceMappingURL=is-variant-label.mjs.map\n","const variantPriorityOrder = [\n \"animate\",\n \"whileInView\",\n \"whileFocus\",\n \"whileHover\",\n \"whileTap\",\n \"whileDrag\",\n \"exit\",\n];\nconst variantProps = [\"initial\", ...variantPriorityOrder];\n\nexport { variantPriorityOrder, variantProps };\n//# sourceMappingURL=variant-props.mjs.map\n","import { isAnimationControls } from './is-animation-controls.mjs';\nimport { isVariantLabel } from './is-variant-label.mjs';\nimport { variantProps } from './variant-props.mjs';\n\nfunction isControllingVariants(props) {\n return (isAnimationControls(props.animate) ||\n variantProps.some((name) => isVariantLabel(props[name])));\n}\nfunction isVariantNode(props) {\n return Boolean(isControllingVariants(props) || props.variants);\n}\n\nexport { isControllingVariants, isVariantNode };\n//# sourceMappingURL=is-controlling-variants.mjs.map\n","// Does this device prefer reduced motion? Returns `null` server-side.\nconst prefersReducedMotion = { current: null };\nconst hasReducedMotionListener = { current: false };\n\nexport { hasReducedMotionListener, prefersReducedMotion };\n//# sourceMappingURL=state.mjs.map\n","import { hasReducedMotionListener, prefersReducedMotion } from './state.mjs';\n\nconst isBrowser = typeof window !== \"undefined\";\nfunction initPrefersReducedMotion() {\n hasReducedMotionListener.current = true;\n if (!isBrowser)\n return;\n if (window.matchMedia) {\n const motionMediaQuery = window.matchMedia(\"(prefers-reduced-motion)\");\n const setReducedMotionPreferences = () => (prefersReducedMotion.current = motionMediaQuery.matches);\n motionMediaQuery.addEventListener(\"change\", setReducedMotionPreferences);\n setReducedMotionPreferences();\n }\n else {\n prefersReducedMotion.current = false;\n }\n}\n\nexport { hasReducedMotionListener, initPrefersReducedMotion, prefersReducedMotion };\n//# sourceMappingURL=index.mjs.map\n","import { warnOnce, secondsToMilliseconds, isNumericalString, isZeroValueString, SubscriptionManager } from 'motion-utils';\nimport { KeyframeResolver } from '../animation/keyframes/KeyframesResolver.mjs';\nimport { NativeAnimation } from '../animation/NativeAnimation.mjs';\nimport { acceleratedValues } from '../animation/waapi/utils/accelerated-values.mjs';\nimport { microtask } from '../frameloop/microtask.mjs';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { createBox } from '../projection/geometry/models.mjs';\nimport { motionValue } from '../value/index.mjs';\nimport { complex } from '../value/types/complex/index.mjs';\nimport { getAnimatableNone } from '../value/types/utils/animatable-none.mjs';\nimport { findValueType } from '../value/types/utils/find.mjs';\nimport { isMotionValue } from '../value/utils/is-motion-value.mjs';\nimport { visualElementStore } from './store.mjs';\nimport { isControllingVariants, isVariantNode } from './utils/is-controlling-variants.mjs';\nimport { transformProps } from './utils/keys-transform.mjs';\nimport { updateMotionValuesFromProps } from './utils/motion-values.mjs';\nimport { initPrefersReducedMotion } from './utils/reduced-motion/index.mjs';\nimport { resolveVariantFromProps } from './utils/resolve-variants.mjs';\nimport { hasReducedMotionListener, prefersReducedMotion } from './utils/reduced-motion/state.mjs';\nimport { frame, cancelFrame } from '../frameloop/frame.mjs';\n\nconst propEventHandlers = [\n \"AnimationStart\",\n \"AnimationComplete\",\n \"Update\",\n \"BeforeLayoutMeasure\",\n \"LayoutMeasure\",\n \"LayoutAnimationStart\",\n \"LayoutAnimationComplete\",\n];\n/**\n * Static feature definitions - can be injected by framework layer\n */\nlet featureDefinitions = {};\n/**\n * Set feature definitions for all VisualElements.\n * This should be called by the framework layer (e.g., framer-motion) during initialization.\n */\nfunction setFeatureDefinitions(definitions) {\n featureDefinitions = definitions;\n}\n/**\n * Get the current feature definitions\n */\nfunction getFeatureDefinitions() {\n return featureDefinitions;\n}\n/**\n * A VisualElement is an imperative abstraction around UI elements such as\n * HTMLElement, SVGElement, Three.Object3D etc.\n */\nclass VisualElement {\n /**\n * This method takes React props and returns found MotionValues. For example, HTML\n * MotionValues will be found within the style prop, whereas for Three.js within attribute arrays.\n *\n * This isn't an abstract method as it needs calling in the constructor, but it is\n * intended to be one.\n */\n scrapeMotionValuesFromProps(_props, _prevProps, _visualElement) {\n return {};\n }\n constructor({ parent, props, presenceContext, reducedMotionConfig, skipAnimations, blockInitialAnimation, visualState, }, options = {}) {\n /**\n * A reference to the current underlying Instance, e.g. a HTMLElement\n * or Three.Mesh etc.\n */\n this.current = null;\n /**\n * A set containing references to this VisualElement's children.\n */\n this.children = new Set();\n /**\n * Determine what role this visual element should take in the variant tree.\n */\n this.isVariantNode = false;\n this.isControllingVariants = false;\n /**\n * Decides whether this VisualElement should animate in reduced motion\n * mode.\n *\n * TODO: This is currently set on every individual VisualElement but feels\n * like it could be set globally.\n */\n this.shouldReduceMotion = null;\n /**\n * Decides whether animations should be skipped for this VisualElement.\n * Useful for E2E tests and visual regression testing.\n */\n this.shouldSkipAnimations = false;\n /**\n * A map of all motion values attached to this visual element. Motion\n * values are source of truth for any given animated value. A motion\n * value might be provided externally by the component via props.\n */\n this.values = new Map();\n this.KeyframeResolver = KeyframeResolver;\n /**\n * Cleanup functions for active features (hover/tap/exit etc)\n */\n this.features = {};\n /**\n * A map of every subscription that binds the provided or generated\n * motion values onChange listeners to this visual element.\n */\n this.valueSubscriptions = new Map();\n /**\n * A reference to the previously-provided motion values as returned\n * from scrapeMotionValuesFromProps. We use the keys in here to determine\n * if any motion values need to be removed after props are updated.\n */\n this.prevMotionValues = {};\n /**\n * Track whether this element has been mounted before, to detect\n * remounts after Suspense unmount/remount cycles.\n */\n this.hasBeenMounted = false;\n /**\n * An object containing a SubscriptionManager for each active event.\n */\n this.events = {};\n /**\n * An object containing an unsubscribe function for each prop event subscription.\n * For example, every \"Update\" event can have multiple subscribers via\n * VisualElement.on(), but only one of those can be defined via the onUpdate prop.\n */\n this.propEventSubscriptions = {};\n this.notifyUpdate = () => this.notify(\"Update\", this.latestValues);\n this.render = () => {\n if (!this.current)\n return;\n this.triggerBuild();\n this.renderInstance(this.current, this.renderState, this.props.style, this.projection);\n };\n this.renderScheduledAt = 0.0;\n this.scheduleRender = () => {\n const now = time.now();\n if (this.renderScheduledAt < now) {\n this.renderScheduledAt = now;\n frame.render(this.render, false, true);\n }\n };\n const { latestValues, renderState } = visualState;\n this.latestValues = latestValues;\n this.baseTarget = { ...latestValues };\n this.initialValues = props.initial ? { ...latestValues } : {};\n this.renderState = renderState;\n this.parent = parent;\n this.props = props;\n this.presenceContext = presenceContext;\n this.depth = parent ? parent.depth + 1 : 0;\n this.reducedMotionConfig = reducedMotionConfig;\n this.skipAnimationsConfig = skipAnimations;\n this.options = options;\n this.blockInitialAnimation = Boolean(blockInitialAnimation);\n this.isControllingVariants = isControllingVariants(props);\n this.isVariantNode = isVariantNode(props);\n if (this.isVariantNode) {\n this.variantChildren = new Set();\n }\n this.manuallyAnimateOnMount = Boolean(parent && parent.current);\n /**\n * Any motion values that are provided to the element when created\n * aren't yet bound to the element, as this would technically be impure.\n * However, we iterate through the motion values and set them to the\n * initial values for this component.\n *\n * TODO: This is impure and we should look at changing this to run on mount.\n * Doing so will break some tests but this isn't necessarily a breaking change,\n * more a reflection of the test.\n */\n const { willChange, ...initialMotionValues } = this.scrapeMotionValuesFromProps(props, {}, this);\n for (const key in initialMotionValues) {\n const value = initialMotionValues[key];\n if (latestValues[key] !== undefined && isMotionValue(value)) {\n value.set(latestValues[key]);\n }\n }\n }\n mount(instance) {\n /**\n * If this element has been mounted before (e.g. after a Suspense\n * unmount/remount), reset motion values to their initial state\n * so animations replay correctly from initial → animate.\n */\n if (this.hasBeenMounted) {\n for (const key in this.initialValues) {\n this.values.get(key)?.jump(this.initialValues[key]);\n this.latestValues[key] = this.initialValues[key];\n }\n }\n this.current = instance;\n visualElementStore.set(instance, this);\n if (this.projection && !this.projection.instance) {\n this.projection.mount(instance);\n }\n if (this.parent && this.isVariantNode && !this.isControllingVariants) {\n this.removeFromVariantTree = this.parent.addVariantChild(this);\n }\n this.values.forEach((value, key) => this.bindToMotionValue(key, value));\n /**\n * Determine reduced motion preference. Only initialize the matchMedia\n * listener if we actually need the dynamic value (i.e., when config\n * is neither \"never\" nor \"always\").\n */\n if (this.reducedMotionConfig === \"never\") {\n this.shouldReduceMotion = false;\n }\n else if (this.reducedMotionConfig === \"always\") {\n this.shouldReduceMotion = true;\n }\n else {\n if (!hasReducedMotionListener.current) {\n initPrefersReducedMotion();\n }\n this.shouldReduceMotion = prefersReducedMotion.current;\n }\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(this.shouldReduceMotion !== true, \"You have Reduced Motion enabled on your device. Animations may not appear as expected.\", \"reduced-motion-disabled\");\n }\n /**\n * Set whether animations should be skipped based on the config.\n */\n this.shouldSkipAnimations = this.skipAnimationsConfig ?? false;\n this.parent?.addChild(this);\n this.update(this.props, this.presenceContext);\n this.hasBeenMounted = true;\n }\n unmount() {\n this.projection && this.projection.unmount();\n cancelFrame(this.notifyUpdate);\n cancelFrame(this.render);\n this.valueSubscriptions.forEach((remove) => remove());\n this.valueSubscriptions.clear();\n this.removeFromVariantTree && this.removeFromVariantTree();\n this.parent?.removeChild(this);\n for (const key in this.events) {\n this.events[key].clear();\n }\n for (const key in this.features) {\n const feature = this.features[key];\n if (feature) {\n feature.unmount();\n feature.isMounted = false;\n }\n }\n this.current = null;\n }\n addChild(child) {\n this.children.add(child);\n this.enteringChildren ?? (this.enteringChildren = new Set());\n this.enteringChildren.add(child);\n }\n removeChild(child) {\n this.children.delete(child);\n this.enteringChildren && this.enteringChildren.delete(child);\n }\n bindToMotionValue(key, value) {\n if (this.valueSubscriptions.has(key)) {\n this.valueSubscriptions.get(key)();\n }\n if (value.accelerate &&\n acceleratedValues.has(key) &&\n this.current instanceof HTMLElement) {\n const { factory, keyframes, times, ease, duration } = value.accelerate;\n const animation = new NativeAnimation({\n element: this.current,\n name: key,\n keyframes,\n times,\n ease,\n duration: secondsToMilliseconds(duration),\n });\n const cleanup = factory(animation);\n this.valueSubscriptions.set(key, () => {\n cleanup();\n animation.cancel();\n });\n return;\n }\n const valueIsTransform = transformProps.has(key);\n if (valueIsTransform && this.onBindTransform) {\n this.onBindTransform();\n }\n const removeOnChange = value.on(\"change\", (latestValue) => {\n this.latestValues[key] = latestValue;\n this.props.onUpdate && frame.preRender(this.notifyUpdate);\n if (valueIsTransform && this.projection) {\n this.projection.isTransformDirty = true;\n }\n this.scheduleRender();\n });\n let removeSyncCheck;\n if (typeof window !== \"undefined\" &&\n window.MotionCheckAppearSync) {\n removeSyncCheck = window.MotionCheckAppearSync(this, key, value);\n }\n this.valueSubscriptions.set(key, () => {\n removeOnChange();\n if (removeSyncCheck)\n removeSyncCheck();\n // Defer to MotionValue.on(\"change\") auto-stop so React 19 remounts\n // can resubscribe before the animation is cancelled (#3315).\n });\n }\n sortNodePosition(other) {\n /**\n * If these nodes aren't even of the same type we can't compare their depth.\n */\n if (!this.current ||\n !this.sortInstanceNodePosition ||\n this.type !== other.type) {\n return 0;\n }\n return this.sortInstanceNodePosition(this.current, other.current);\n }\n updateFeatures() {\n let key = \"animation\";\n for (key in featureDefinitions) {\n const featureDefinition = featureDefinitions[key];\n if (!featureDefinition)\n continue;\n const { isEnabled, Feature: FeatureConstructor } = featureDefinition;\n /**\n * If this feature is enabled but not active, make a new instance.\n */\n if (!this.features[key] &&\n FeatureConstructor &&\n isEnabled(this.props)) {\n this.features[key] = new FeatureConstructor(this);\n }\n /**\n * If we have a feature, mount or update it.\n */\n if (this.features[key]) {\n const feature = this.features[key];\n if (feature.isMounted) {\n feature.update();\n }\n else {\n feature.mount();\n feature.isMounted = true;\n }\n }\n }\n }\n triggerBuild() {\n this.build(this.renderState, this.latestValues, this.props);\n }\n /**\n * Measure the current viewport box with or without transforms.\n * Only measures axis-aligned boxes, rotate and skew must be manually\n * removed with a re-render to work.\n */\n measureViewportBox() {\n return this.current\n ? this.measureInstanceViewportBox(this.current, this.props)\n : createBox();\n }\n getStaticValue(key) {\n return this.latestValues[key];\n }\n setStaticValue(key, value) {\n this.latestValues[key] = value;\n }\n /**\n * Update the provided props. Ensure any newly-added motion values are\n * added to our map, old ones removed, and listeners updated.\n */\n update(props, presenceContext) {\n if (props.transformTemplate || this.props.transformTemplate) {\n this.scheduleRender();\n }\n this.prevProps = this.props;\n this.props = props;\n this.prevPresenceContext = this.presenceContext;\n this.presenceContext = presenceContext;\n /**\n * Update prop event handlers ie onAnimationStart, onAnimationComplete\n */\n for (let i = 0; i < propEventHandlers.length; i++) {\n const key = propEventHandlers[i];\n if (this.propEventSubscriptions[key]) {\n this.propEventSubscriptions[key]();\n delete this.propEventSubscriptions[key];\n }\n const listenerName = (\"on\" + key);\n const listener = props[listenerName];\n if (listener) {\n this.propEventSubscriptions[key] = this.on(key, listener);\n }\n }\n this.prevMotionValues = updateMotionValuesFromProps(this, this.scrapeMotionValuesFromProps(props, this.prevProps || {}, this), this.prevMotionValues);\n if (this.handleChildMotionValue) {\n this.handleChildMotionValue();\n }\n }\n getProps() {\n return this.props;\n }\n /**\n * Returns the variant definition with a given name.\n */\n getVariant(name) {\n return this.props.variants ? this.props.variants[name] : undefined;\n }\n /**\n * Returns the defined default transition on this component.\n */\n getDefaultTransition() {\n return this.props.transition;\n }\n getTransformPagePoint() {\n return this.props.transformPagePoint;\n }\n getClosestVariantNode() {\n return this.isVariantNode\n ? this\n : this.parent\n ? this.parent.getClosestVariantNode()\n : undefined;\n }\n /**\n * Add a child visual element to our set of children.\n */\n addVariantChild(child) {\n const closestVariantNode = this.getClosestVariantNode();\n if (closestVariantNode) {\n closestVariantNode.variantChildren &&\n closestVariantNode.variantChildren.add(child);\n return () => closestVariantNode.variantChildren.delete(child);\n }\n }\n /**\n * Add a motion value and bind it to this visual element.\n */\n addValue(key, value) {\n // Remove existing value if it exists\n const existingValue = this.values.get(key);\n if (value !== existingValue) {\n if (existingValue)\n this.removeValue(key);\n this.bindToMotionValue(key, value);\n this.values.set(key, value);\n this.latestValues[key] = value.get();\n }\n }\n /**\n * Remove a motion value and unbind any active subscriptions.\n */\n removeValue(key) {\n this.values.delete(key);\n const unsubscribe = this.valueSubscriptions.get(key);\n if (unsubscribe) {\n unsubscribe();\n this.valueSubscriptions.delete(key);\n }\n delete this.latestValues[key];\n this.removeValueFromRenderState(key, this.renderState);\n }\n /**\n * Check whether we have a motion value for this key\n */\n hasValue(key) {\n return this.values.has(key);\n }\n getValue(key, defaultValue) {\n if (this.props.values && this.props.values[key]) {\n return this.props.values[key];\n }\n let value = this.values.get(key);\n if (value === undefined && defaultValue !== undefined) {\n value = motionValue(defaultValue === null ? undefined : defaultValue, { owner: this });\n this.addValue(key, value);\n }\n return value;\n }\n /**\n * If we're trying to animate to a previously unencountered value,\n * we need to check for it in our state and as a last resort read it\n * directly from the instance (which might have performance implications).\n */\n readValue(key, target) {\n let value = this.latestValues[key] !== undefined || !this.current\n ? this.latestValues[key]\n : this.getBaseTargetFromProps(this.props, key) ??\n this.readValueFromInstance(this.current, key, this.options);\n if (value !== undefined && value !== null) {\n if (typeof value === \"string\" &&\n (isNumericalString(value) || isZeroValueString(value))) {\n // If this is a number read as a string, ie \"0\" or \"200\", convert it to a number\n value = parseFloat(value);\n }\n else if (!findValueType(value) && complex.test(target)) {\n value = getAnimatableNone(key, target);\n }\n this.setBaseTarget(key, isMotionValue(value) ? value.get() : value);\n }\n return isMotionValue(value) ? value.get() : value;\n }\n /**\n * Set the base target to later animate back to. This is currently\n * only hydrated on creation and when we first read a value.\n */\n setBaseTarget(key, value) {\n this.baseTarget[key] = value;\n }\n /**\n * Find the base target for a value thats been removed from all animation\n * props.\n */\n getBaseTarget(key) {\n const { initial } = this.props;\n let valueFromInitial;\n if (typeof initial === \"string\" || typeof initial === \"object\") {\n const variant = resolveVariantFromProps(this.props, initial, this.presenceContext?.custom);\n if (variant) {\n valueFromInitial = variant[key];\n }\n }\n /**\n * If this value still exists in the current initial variant, read that.\n */\n if (initial && valueFromInitial !== undefined) {\n return valueFromInitial;\n }\n /**\n * Alternatively, if this VisualElement config has defined a getBaseTarget\n * so we can read the value from an alternative source, try that.\n */\n const target = this.getBaseTargetFromProps(this.props, key);\n if (target !== undefined && !isMotionValue(target))\n return target;\n /**\n * If the value was initially defined on initial, but it doesn't any more,\n * return undefined. Otherwise return the value as initially read from the DOM.\n */\n return this.initialValues[key] !== undefined &&\n valueFromInitial === undefined\n ? undefined\n : this.baseTarget[key];\n }\n on(eventName, callback) {\n if (!this.events[eventName]) {\n this.events[eventName] = new SubscriptionManager();\n }\n return this.events[eventName].add(callback);\n }\n notify(eventName, ...args) {\n if (this.events[eventName]) {\n this.events[eventName].notify(...args);\n }\n }\n scheduleRenderMicrotask() {\n microtask.render(this.render);\n }\n}\n\nexport { VisualElement, getFeatureDefinitions, setFeatureDefinitions };\n//# sourceMappingURL=VisualElement.mjs.map\n","import { motionValue } from '../../value/index.mjs';\nimport { isMotionValue } from '../../value/utils/is-motion-value.mjs';\n\n/**\n * Updates motion values from props changes.\n * Uses `any` type for element to avoid circular dependencies with VisualElement.\n */\nfunction updateMotionValuesFromProps(element, next, prev) {\n for (const key in next) {\n const nextValue = next[key];\n const prevValue = prev[key];\n if (isMotionValue(nextValue)) {\n /**\n * If this is a motion value found in props or style, we want to add it\n * to our visual element's motion value map.\n */\n element.addValue(key, nextValue);\n }\n else if (isMotionValue(prevValue)) {\n /**\n * If we're swapping from a motion value to a static value,\n * create a new motion value from that\n */\n element.addValue(key, motionValue(nextValue, { owner: element }));\n }\n else if (prevValue !== nextValue) {\n /**\n * If this is a flat value that has changed, update the motion value\n * or create one if it doesn't exist. We only want to do this if we're\n * not handling the value with our animation state.\n */\n if (element.hasValue(key)) {\n const existingValue = element.getValue(key);\n if (existingValue.liveStyle === true) {\n existingValue.jump(nextValue);\n }\n else if (!existingValue.hasAnimated) {\n existingValue.set(nextValue);\n }\n }\n else {\n const latestValue = element.getStaticValue(key);\n element.addValue(key, motionValue(latestValue !== undefined ? latestValue : nextValue, { owner: element }));\n }\n }\n }\n // Handle removed values\n for (const key in prev) {\n if (next[key] === undefined)\n element.removeValue(key);\n }\n return next;\n}\n\nexport { updateMotionValuesFromProps };\n//# sourceMappingURL=motion-values.mjs.map\n","import { isMotionValue } from '../../value/utils/is-motion-value.mjs';\nimport { DOMKeyframesResolver } from '../../animation/keyframes/DOMKeyframesResolver.mjs';\nimport { VisualElement } from '../VisualElement.mjs';\n\nclass DOMVisualElement extends VisualElement {\n constructor() {\n super(...arguments);\n this.KeyframeResolver = DOMKeyframesResolver;\n }\n sortInstanceNodePosition(a, b) {\n /**\n * compareDocumentPosition returns a bitmask, by using the bitwise &\n * we're returning true if 2 in that bitmask is set to true. 2 is set\n * to true if b preceeds a.\n */\n return a.compareDocumentPosition(b) & 2 ? 1 : -1;\n }\n getBaseTargetFromProps(props, key) {\n const style = props.style;\n return style ? style[key] : undefined;\n }\n removeValueFromRenderState(key, { vars, style }) {\n delete vars[key];\n delete style[key];\n }\n handleChildMotionValue() {\n if (this.childSubscription) {\n this.childSubscription();\n delete this.childSubscription;\n }\n const { children } = this.props;\n if (isMotionValue(children)) {\n this.childSubscription = children.on(\"change\", (latest) => {\n if (this.current) {\n this.current.textContent = `${latest}`;\n }\n });\n }\n }\n}\n\nexport { DOMVisualElement };\n//# sourceMappingURL=DOMVisualElement.mjs.map\n","/**\n * Feature base class for extending VisualElement functionality.\n * Features are plugins that can be mounted/unmounted to add behavior\n * like gestures, animations, or layout tracking.\n */\nclass Feature {\n constructor(node) {\n this.isMounted = false;\n this.node = node;\n }\n update() { }\n}\n\nexport { Feature };\n//# sourceMappingURL=Feature.mjs.map\n","/**\n * Bounding boxes tend to be defined as top, left, right, bottom. For various operations\n * it's easier to consider each axis individually. This function returns a bounding box\n * as a map of single-axis min/max values.\n */\nfunction convertBoundingBoxToBox({ top, left, right, bottom, }) {\n return {\n x: { min: left, max: right },\n y: { min: top, max: bottom },\n };\n}\nfunction convertBoxToBoundingBox({ x, y }) {\n return { top: y.min, right: x.max, bottom: y.max, left: x.min };\n}\n/**\n * Applies a TransformPoint function to a bounding box. TransformPoint is usually a function\n * provided by Framer to allow measured points to be corrected for device scaling. This is used\n * when measuring DOM elements and DOM event points.\n */\nfunction transformBoxPoints(point, transformPoint) {\n if (!transformPoint)\n return point;\n const topLeft = transformPoint({ x: point.left, y: point.top });\n const bottomRight = transformPoint({ x: point.right, y: point.bottom });\n return {\n top: topLeft.y,\n left: topLeft.x,\n bottom: bottomRight.y,\n right: bottomRight.x,\n };\n}\n\nexport { convertBoundingBoxToBox, convertBoxToBoundingBox, transformBoxPoints };\n//# sourceMappingURL=conversion.mjs.map\n","function isIdentityScale(scale) {\n return scale === undefined || scale === 1;\n}\nfunction hasScale({ scale, scaleX, scaleY }) {\n return (!isIdentityScale(scale) ||\n !isIdentityScale(scaleX) ||\n !isIdentityScale(scaleY));\n}\nfunction hasTransform(values) {\n return (hasScale(values) ||\n has2DTranslate(values) ||\n values.z ||\n values.rotate ||\n values.rotateX ||\n values.rotateY ||\n values.skewX ||\n values.skewY);\n}\nfunction has2DTranslate(values) {\n return is2DTranslate(values.x) || is2DTranslate(values.y);\n}\nfunction is2DTranslate(value) {\n return value && value !== \"0%\";\n}\n\nexport { has2DTranslate, hasScale, hasTransform };\n//# sourceMappingURL=has-transform.mjs.map\n","import { mixNumber } from '../../utils/mix/number.mjs';\nimport { hasTransform } from '../utils/has-transform.mjs';\n\n/**\n * Scales a point based on a factor and an originPoint\n */\nfunction scalePoint(point, scale, originPoint) {\n const distanceFromOrigin = point - originPoint;\n const scaled = scale * distanceFromOrigin;\n return originPoint + scaled;\n}\n/**\n * Applies a translate/scale delta to a point\n */\nfunction applyPointDelta(point, translate, scale, originPoint, boxScale) {\n if (boxScale !== undefined) {\n point = scalePoint(point, boxScale, originPoint);\n }\n return scalePoint(point, scale, originPoint) + translate;\n}\n/**\n * Applies a translate/scale delta to an axis\n */\nfunction applyAxisDelta(axis, translate = 0, scale = 1, originPoint, boxScale) {\n axis.min = applyPointDelta(axis.min, translate, scale, originPoint, boxScale);\n axis.max = applyPointDelta(axis.max, translate, scale, originPoint, boxScale);\n}\n/**\n * Applies a translate/scale delta to a box\n */\nfunction applyBoxDelta(box, { x, y }) {\n applyAxisDelta(box.x, x.translate, x.scale, x.originPoint);\n applyAxisDelta(box.y, y.translate, y.scale, y.originPoint);\n}\nconst TREE_SCALE_SNAP_MIN = 0.999999999999;\nconst TREE_SCALE_SNAP_MAX = 1.0000000000001;\n/**\n * Apply a tree of deltas to a box. We do this to calculate the effect of all the transforms\n * in a tree upon our box before then calculating how to project it into our desired viewport-relative box\n *\n * This is the final nested loop within updateLayoutDelta for future refactoring\n */\nfunction applyTreeDeltas(box, treeScale, treePath, isSharedTransition = false) {\n const treeLength = treePath.length;\n if (!treeLength)\n return;\n // Reset the treeScale\n treeScale.x = treeScale.y = 1;\n let node;\n let delta;\n for (let i = 0; i < treeLength; i++) {\n node = treePath[i];\n delta = node.projectionDelta;\n /**\n * TODO: Prefer to remove this, but currently we have motion components with\n * display: contents in Framer.\n */\n const { visualElement } = node.options;\n if (visualElement &&\n visualElement.props.style &&\n visualElement.props.style.display === \"contents\") {\n continue;\n }\n if (isSharedTransition &&\n node.options.layoutScroll &&\n node.scroll &&\n node !== node.root) {\n translateAxis(box.x, -node.scroll.offset.x);\n translateAxis(box.y, -node.scroll.offset.y);\n }\n if (delta) {\n // Incoporate each ancestor's scale into a cumulative treeScale for this component\n treeScale.x *= delta.x.scale;\n treeScale.y *= delta.y.scale;\n // Apply each ancestor's calculated delta into this component's recorded layout box\n applyBoxDelta(box, delta);\n }\n if (isSharedTransition && hasTransform(node.latestValues)) {\n transformBox(box, node.latestValues, node.layout?.layoutBox);\n }\n }\n /**\n * Snap tree scale back to 1 if it's within a non-perceivable threshold.\n * This will help reduce useless scales getting rendered.\n */\n if (treeScale.x < TREE_SCALE_SNAP_MAX &&\n treeScale.x > TREE_SCALE_SNAP_MIN) {\n treeScale.x = 1.0;\n }\n if (treeScale.y < TREE_SCALE_SNAP_MAX &&\n treeScale.y > TREE_SCALE_SNAP_MIN) {\n treeScale.y = 1.0;\n }\n}\nfunction translateAxis(axis, distance) {\n axis.min += distance;\n axis.max += distance;\n}\n/**\n * Apply a transform to an axis from the latest resolved motion values.\n * This function basically acts as a bridge between a flat motion value map\n * and applyAxisDelta\n */\nfunction transformAxis(axis, axisTranslate, axisScale, boxScale, axisOrigin = 0.5) {\n const originPoint = mixNumber(axis.min, axis.max, axisOrigin);\n // Apply the axis delta to the final axis\n applyAxisDelta(axis, axisTranslate, axisScale, originPoint, boxScale);\n}\nfunction resolveAxisTranslate(value, axis) {\n if (typeof value === \"string\") {\n return (parseFloat(value) / 100) * (axis.max - axis.min);\n }\n return value;\n}\n/**\n * Apply a transform to a box from the latest resolved motion values.\n */\nfunction transformBox(box, transform, sourceBox) {\n const resolveBox = sourceBox ?? box;\n transformAxis(box.x, resolveAxisTranslate(transform.x, resolveBox.x), transform.scaleX, transform.scale, transform.originX);\n transformAxis(box.y, resolveAxisTranslate(transform.y, resolveBox.y), transform.scaleY, transform.scale, transform.originY);\n}\n\nexport { applyAxisDelta, applyBoxDelta, applyPointDelta, applyTreeDeltas, scalePoint, transformAxis, transformBox, translateAxis };\n//# sourceMappingURL=delta-apply.mjs.map\n","import { convertBoundingBoxToBox, transformBoxPoints } from '../geometry/conversion.mjs';\nimport { translateAxis } from '../geometry/delta-apply.mjs';\n\nfunction measureViewportBox(instance, transformPoint) {\n return convertBoundingBoxToBox(transformBoxPoints(instance.getBoundingClientRect(), transformPoint));\n}\nfunction measurePageBox(element, rootProjectionNode, transformPagePoint) {\n const viewportBox = measureViewportBox(element, transformPagePoint);\n const { scroll } = rootProjectionNode;\n if (scroll) {\n translateAxis(viewportBox.x, scroll.offset.x);\n translateAxis(viewportBox.y, scroll.offset.y);\n }\n return viewportBox;\n}\n\nexport { measurePageBox, measureViewportBox };\n//# sourceMappingURL=measure.mjs.map\n","import { getValueAsType } from '../../../value/types/utils/get-as-type.mjs';\nimport { numberValueTypes } from '../../../value/types/maps/number.mjs';\nimport { transformPropOrder } from '../../utils/keys-transform.mjs';\n\nconst translateAlias = {\n x: \"translateX\",\n y: \"translateY\",\n z: \"translateZ\",\n transformPerspective: \"perspective\",\n};\nconst numTransforms = transformPropOrder.length;\n/**\n * Build a CSS transform style from individual x/y/scale etc properties.\n *\n * This outputs with a default order of transforms/scales/rotations, this can be customised by\n * providing a transformTemplate function.\n */\nfunction buildTransform(latestValues, transform, transformTemplate) {\n // The transform string we're going to build into.\n let transformString = \"\";\n let transformIsDefault = true;\n /**\n * Loop over all possible transforms in order, adding the ones that\n * are present to the transform string.\n */\n for (let i = 0; i < numTransforms; i++) {\n const key = transformPropOrder[i];\n const value = latestValues[key];\n if (value === undefined)\n continue;\n let valueIsDefault = true;\n if (typeof value === \"number\") {\n valueIsDefault = value === (key.startsWith(\"scale\") ? 1 : 0);\n }\n else {\n const parsed = parseFloat(value);\n valueIsDefault = key.startsWith(\"scale\") ? parsed === 1 : parsed === 0;\n }\n if (!valueIsDefault || transformTemplate) {\n const valueAsType = getValueAsType(value, numberValueTypes[key]);\n if (!valueIsDefault) {\n transformIsDefault = false;\n const transformName = translateAlias[key] || key;\n transformString += `${transformName}(${valueAsType}) `;\n }\n if (transformTemplate) {\n transform[key] = valueAsType;\n }\n }\n }\n // `pathRotation` composes onto `rotate` as a separate additive term so\n // the user's `rotate` is never clobbered. Deliberately not a slot in\n // `transformPropOrder`.\n const pathRotation = latestValues.pathRotation;\n if (pathRotation) {\n transformIsDefault = false;\n transformString += `rotate(${getValueAsType(pathRotation, numberValueTypes.pathRotation)}) `;\n }\n transformString = transformString.trim();\n // If we have a custom `transform` template, pass our transform values and\n // generated transformString to that before returning\n if (transformTemplate) {\n transformString = transformTemplate(transform, transformIsDefault ? \"\" : transformString);\n }\n else if (transformIsDefault) {\n transformString = \"none\";\n }\n return transformString;\n}\n\nexport { buildTransform };\n//# sourceMappingURL=build-transform.mjs.map\n","import { getValueAsType } from '../../../value/types/utils/get-as-type.mjs';\nimport { numberValueTypes } from '../../../value/types/maps/number.mjs';\nimport { transformProps } from '../../utils/keys-transform.mjs';\nimport { isCSSVariableName } from '../../../animation/utils/is-css-variable.mjs';\nimport { buildTransform } from './build-transform.mjs';\n\nfunction buildHTMLStyles(state, latestValues, transformTemplate) {\n const { style, vars, transformOrigin } = state;\n // Track whether we encounter any transform or transformOrigin values.\n let hasTransform = false;\n let hasTransformOrigin = false;\n /**\n * Loop over all our latest animated values and decide whether to handle them\n * as a style or CSS variable.\n *\n * Transforms and transform origins are kept separately for further processing.\n */\n for (const key in latestValues) {\n const value = latestValues[key];\n if (transformProps.has(key)) {\n // If this is a transform, flag to enable further transform processing\n hasTransform = true;\n continue;\n }\n else if (isCSSVariableName(key)) {\n vars[key] = value;\n continue;\n }\n else {\n // Convert the value to its default value type, ie 0 -> \"0px\"\n const valueAsType = getValueAsType(value, numberValueTypes[key]);\n if (key.startsWith(\"origin\")) {\n // If this is a transform origin, flag and enable further transform-origin processing\n hasTransformOrigin = true;\n transformOrigin[key] =\n valueAsType;\n }\n else {\n style[key] = valueAsType;\n }\n }\n }\n if (!latestValues.transform) {\n if (hasTransform || transformTemplate) {\n style.transform = buildTransform(latestValues, state.transform, transformTemplate);\n }\n else if (style.transform) {\n /**\n * If we have previously created a transform but currently don't have any,\n * reset transform style to none.\n */\n style.transform = \"none\";\n }\n }\n /**\n * Build a transformOrigin style. Uses the same defaults as the browser for\n * undefined origins.\n */\n if (hasTransformOrigin) {\n const { originX = \"50%\", originY = \"50%\", originZ = 0, } = transformOrigin;\n style.transformOrigin = `${originX} ${originY} ${originZ}`;\n }\n}\n\nexport { buildHTMLStyles };\n//# sourceMappingURL=build-styles.mjs.map\n","function renderHTML(element, { style, vars }, styleProp, projection) {\n const elementStyle = element.style;\n let key;\n for (key in style) {\n // CSSStyleDeclaration has [index: number]: string; in the types, so we use that as key type.\n elementStyle[key] = style[key];\n }\n // Write projection styles directly to element style\n projection?.applyProjectionStyles(elementStyle, styleProp);\n for (key in vars) {\n // Loop over any CSS variables and assign those.\n // They can only be assigned using `setProperty`.\n elementStyle.setProperty(key, vars[key]);\n }\n}\n\nexport { renderHTML };\n//# sourceMappingURL=render.mjs.map\n","import { px } from '../../value/types/numbers/units.mjs';\n\nfunction pixelsToPercent(pixels, axis) {\n if (axis.max === axis.min)\n return 0;\n return (pixels / (axis.max - axis.min)) * 100;\n}\n/**\n * We always correct borderRadius as a percentage rather than pixels to reduce paints.\n * For example, if you are projecting a box that is 100px wide with a 10px borderRadius\n * into a box that is 200px wide with a 20px borderRadius, that is actually a 10%\n * borderRadius in both states. If we animate between the two in pixels that will trigger\n * a paint each time. If we animate between the two in percentage we'll avoid a paint.\n */\nconst correctBorderRadius = {\n correct: (latest, node) => {\n if (!node.target)\n return latest;\n /**\n * If latest is a string, if it's a percentage we can return immediately as it's\n * going to be stretched appropriately. Otherwise, if it's a pixel, convert it to a number.\n */\n if (typeof latest === \"string\") {\n if (px.test(latest)) {\n latest = parseFloat(latest);\n }\n else {\n return latest;\n }\n }\n /**\n * If latest is a number, it's a pixel value. We use the current viewportBox to calculate that\n * pixel value as a percentage of each axis\n */\n const x = pixelsToPercent(latest, node.target.x);\n const y = pixelsToPercent(latest, node.target.y);\n return `${x}% ${y}%`;\n },\n};\n\nexport { correctBorderRadius, pixelsToPercent };\n//# sourceMappingURL=scale-border-radius.mjs.map\n","import { complex } from '../../value/types/complex/index.mjs';\nimport { mixNumber } from '../../utils/mix/number.mjs';\n\nconst correctBoxShadow = {\n correct: (latest, { treeScale, projectionDelta }) => {\n const original = latest;\n const shadow = complex.parse(latest);\n // TODO: Doesn't support multiple shadows\n if (shadow.length > 5)\n return original;\n const template = complex.createTransformer(latest);\n const offset = typeof shadow[0] !== \"number\" ? 1 : 0;\n // Calculate the overall context scale\n const xScale = projectionDelta.x.scale * treeScale.x;\n const yScale = projectionDelta.y.scale * treeScale.y;\n shadow[0 + offset] /= xScale;\n shadow[1 + offset] /= yScale;\n /**\n * Ideally we'd correct x and y scales individually, but because blur and\n * spread apply to both we have to take a scale average and apply that instead.\n * We could potentially improve the outcome of this by incorporating the ratio between\n * the two scales.\n */\n const averageScale = mixNumber(xScale, yScale, 0.5);\n // Blur\n if (typeof shadow[2 + offset] === \"number\")\n shadow[2 + offset] /= averageScale;\n // Spread\n if (typeof shadow[3 + offset] === \"number\")\n shadow[3 + offset] /= averageScale;\n return template(shadow);\n },\n};\n\nexport { correctBoxShadow };\n//# sourceMappingURL=scale-box-shadow.mjs.map\n","import { isCSSVariableName } from '../../animation/utils/is-css-variable.mjs';\nimport { cornerRadiusProps } from '../../utils/border-radius.mjs';\nimport { correctBorderRadius } from './scale-border-radius.mjs';\nimport { correctBoxShadow } from './scale-box-shadow.mjs';\n\nconst scaleCorrectors = {\n borderRadius: {\n ...correctBorderRadius,\n applyTo: [...cornerRadiusProps],\n },\n borderTopLeftRadius: correctBorderRadius,\n borderTopRightRadius: correctBorderRadius,\n borderBottomLeftRadius: correctBorderRadius,\n borderBottomRightRadius: correctBorderRadius,\n boxShadow: correctBoxShadow,\n};\nfunction addScaleCorrector(correctors) {\n for (const key in correctors) {\n scaleCorrectors[key] = correctors[key];\n if (isCSSVariableName(key)) {\n scaleCorrectors[key].isCSSVariable = true;\n }\n }\n}\n\nexport { addScaleCorrector, scaleCorrectors };\n//# sourceMappingURL=scale-correction.mjs.map\n","import { transformProps } from './keys-transform.mjs';\nimport { scaleCorrectors } from '../../projection/styles/scale-correction.mjs';\nexport { addScaleCorrector } from '../../projection/styles/scale-correction.mjs';\n\nfunction isForcedMotionValue(key, { layout, layoutId }) {\n return (transformProps.has(key) ||\n key.startsWith(\"origin\") ||\n ((layout || layoutId !== undefined) &&\n (!!scaleCorrectors[key] || key === \"opacity\")));\n}\n\nexport { isForcedMotionValue, scaleCorrectors };\n//# sourceMappingURL=is-forced-motion-value.mjs.map\n","import { isMotionValue } from '../../../value/utils/is-motion-value.mjs';\nimport { isForcedMotionValue } from '../../utils/is-forced-motion-value.mjs';\n\nfunction scrapeMotionValuesFromProps(props, prevProps, visualElement) {\n const style = props.style;\n const prevStyle = prevProps?.style;\n const newValues = {};\n if (!style)\n return newValues;\n for (const key in style) {\n if (isMotionValue(style[key]) ||\n (prevStyle && isMotionValue(prevStyle[key])) ||\n isForcedMotionValue(key, props) ||\n visualElement?.getValue(key)?.liveStyle !== undefined) {\n newValues[key] = style[key];\n }\n }\n return newValues;\n}\n\nexport { scrapeMotionValuesFromProps };\n//# sourceMappingURL=scrape-motion-values.mjs.map\n","import { invariant } from 'motion-utils';\nimport { isCSSVariableName } from '../../animation/utils/is-css-variable.mjs';\nimport { transformProps } from '../utils/keys-transform.mjs';\nimport { defaultTransformValue, readTransformValue } from '../dom/parse-transform.mjs';\nimport { measureViewportBox } from '../../projection/utils/measure.mjs';\nimport { DOMVisualElement } from '../dom/DOMVisualElement.mjs';\nimport { buildHTMLStyles } from './utils/build-styles.mjs';\nimport { renderHTML } from './utils/render.mjs';\nimport { scrapeMotionValuesFromProps } from './utils/scrape-motion-values.mjs';\n\nfunction getComputedStyle(element) {\n return window.getComputedStyle(element);\n}\nclass HTMLVisualElement extends DOMVisualElement {\n constructor() {\n super(...arguments);\n this.type = \"html\";\n this.renderInstance = renderHTML;\n }\n mount(instance) {\n /**\n * If a custom component forwards its ref to something other than a\n * HTML/SVG element (a class instance, an imperative handle) there's\n * nothing for Motion to style, measure or attach gestures to. #2777\n */\n invariant(Boolean(instance.style), \"motion.create() components must forward their ref to a HTML or SVG element\", \"custom-component-ref\");\n super.mount(instance);\n }\n readValueFromInstance(instance, key) {\n if (transformProps.has(key)) {\n return this.projection?.isProjecting\n ? defaultTransformValue(key)\n : readTransformValue(instance, key);\n }\n else {\n const computedStyle = getComputedStyle(instance);\n const value = (isCSSVariableName(key)\n ? computedStyle.getPropertyValue(key)\n : computedStyle[key]) || 0;\n return typeof value === \"string\" ? value.trim() : value;\n }\n }\n measureInstanceViewportBox(instance, { transformPagePoint }) {\n return measureViewportBox(instance, transformPagePoint);\n }\n build(renderState, latestValues, props) {\n buildHTMLStyles(renderState, latestValues, props.transformTemplate);\n }\n scrapeMotionValuesFromProps(props, prevProps, visualElement) {\n return scrapeMotionValuesFromProps(props, prevProps, visualElement);\n }\n}\n\nexport { HTMLVisualElement, getComputedStyle };\n//# sourceMappingURL=HTMLVisualElement.mjs.map\n","const dashKeys = {\n offset: \"stroke-dashoffset\",\n array: \"stroke-dasharray\",\n};\nconst camelKeys = {\n offset: \"strokeDashoffset\",\n array: \"strokeDasharray\",\n};\n/**\n * Build SVG path properties. Uses the path's measured length to convert\n * our custom pathLength, pathSpacing and pathOffset into stroke-dashoffset\n * and stroke-dasharray attributes.\n *\n * This function is mutative to reduce per-frame GC.\n *\n * Note: We use unitless values for stroke-dasharray and stroke-dashoffset\n * because Safari incorrectly scales px values when the page is zoomed.\n */\nfunction buildSVGPath(attrs, length, spacing = 1, offset = 0, useDashCase = true) {\n // Normalise path length by setting SVG attribute pathLength to 1\n attrs.pathLength = 1;\n // We use dash case when setting attributes directly to the DOM node and camel case\n // when defining props on a React component.\n const keys = useDashCase ? dashKeys : camelKeys;\n // Build the dash offset (unitless to avoid Safari zoom bug)\n attrs[keys.offset] = `${-offset}`;\n // Build the dash array (unitless to avoid Safari zoom bug)\n attrs[keys.array] = `${length} ${spacing}`;\n}\n\nexport { buildSVGPath };\n//# sourceMappingURL=path.mjs.map\n","import { buildHTMLStyles } from '../../html/utils/build-styles.mjs';\nimport { buildSVGPath } from './path.mjs';\n\nconst cssStyleProperties = [\n \"transform\",\n \"opacity\",\n \"offsetDistance\",\n \"offsetPath\",\n \"offsetRotate\",\n \"offsetAnchor\",\n];\n/**\n * Build SVG visual attributes, like cx and style.transform\n */\nfunction buildSVGAttrs(state, { attrX, attrY, attrScale, pathLength, pathSpacing = 1, pathOffset = 0, \n// This is object creation, which we try to avoid per-frame.\n...latest }, isSVGTag, transformTemplate, styleProp) {\n buildHTMLStyles(state, latest, transformTemplate);\n /**\n * For svg tags we just want to make sure viewBox is animatable and treat all the styles\n * as normal HTML tags.\n */\n if (isSVGTag) {\n if (state.style.viewBox) {\n state.attrs.viewBox = state.style.viewBox;\n }\n return;\n }\n state.attrs = state.style;\n state.style = {};\n const { attrs, style } = state;\n for (const key of cssStyleProperties) {\n if (attrs[key] !== undefined) {\n style[key] = attrs[key];\n delete attrs[key];\n }\n }\n if (style.transform || attrs.transformOrigin) {\n style.transformOrigin = attrs.transformOrigin ?? \"50% 50%\";\n delete attrs.transformOrigin;\n }\n if (style.transform) {\n /**\n * SVG's element transform-origin uses its own median as a reference.\n * Therefore, transformBox becomes a fill-box\n */\n style.transformBox = styleProp?.transformBox ?? \"fill-box\";\n delete attrs.transformBox;\n }\n // Render attrX/attrY/attrScale as attributes\n if (attrX !== undefined)\n attrs.x = attrX;\n if (attrY !== undefined)\n attrs.y = attrY;\n if (attrScale !== undefined)\n attrs.scale = attrScale;\n // Build SVG path if one has been defined\n if (pathLength !== undefined) {\n buildSVGPath(attrs, pathLength, pathSpacing, pathOffset, false);\n }\n}\n\nexport { buildSVGAttrs, cssStyleProperties };\n//# sourceMappingURL=build-attrs.mjs.map\n","/**\n * A set of attribute names that are always read/written as camel case.\n */\nconst camelCaseAttributes = new Set([\n \"baseFrequency\",\n \"diffuseConstant\",\n \"kernelMatrix\",\n \"kernelUnitLength\",\n \"keySplines\",\n \"keyTimes\",\n \"limitingConeAngle\",\n \"markerHeight\",\n \"markerWidth\",\n \"numOctaves\",\n \"targetX\",\n \"targetY\",\n \"surfaceScale\",\n \"specularConstant\",\n \"specularExponent\",\n \"stdDeviation\",\n \"tableValues\",\n \"viewBox\",\n \"gradientTransform\",\n \"pathLength\",\n \"startOffset\",\n \"textLength\",\n \"lengthAdjust\",\n]);\n\nexport { camelCaseAttributes };\n//# sourceMappingURL=camel-case-attrs.mjs.map\n","const isSVGTag = (tag) => typeof tag === \"string\" && tag.toLowerCase() === \"svg\";\n\nexport { isSVGTag };\n//# sourceMappingURL=is-svg-tag.mjs.map\n","import { isMotionValue } from '../../../value/utils/is-motion-value.mjs';\nimport { transformPropOrder } from '../../utils/keys-transform.mjs';\nimport { scrapeMotionValuesFromProps as scrapeMotionValuesFromProps$1 } from '../../html/utils/scrape-motion-values.mjs';\n\nfunction scrapeMotionValuesFromProps(props, prevProps, visualElement) {\n const newValues = scrapeMotionValuesFromProps$1(props, prevProps, visualElement);\n for (const key in props) {\n if (isMotionValue(props[key]) ||\n isMotionValue(prevProps[key])) {\n const targetKey = transformPropOrder.indexOf(key) !== -1\n ? \"attr\" + key.charAt(0).toUpperCase() + key.substring(1)\n : key;\n newValues[targetKey] = props[key];\n }\n }\n return newValues;\n}\n\nexport { scrapeMotionValuesFromProps };\n//# sourceMappingURL=scrape-motion-values.mjs.map\n","import { transformProps } from '../utils/keys-transform.mjs';\nimport { getDefaultValueType } from '../../value/types/maps/defaults.mjs';\nimport { createBox } from '../../projection/geometry/models.mjs';\nimport { DOMVisualElement } from '../dom/DOMVisualElement.mjs';\nimport { camelToDash } from '../dom/utils/camel-to-dash.mjs';\nimport { cssStyleProperties, buildSVGAttrs } from './utils/build-attrs.mjs';\nimport { camelCaseAttributes } from './utils/camel-case-attrs.mjs';\nimport { isSVGTag } from './utils/is-svg-tag.mjs';\nimport { renderSVG } from './utils/render.mjs';\nimport { scrapeMotionValuesFromProps } from './utils/scrape-motion-values.mjs';\n\nclass SVGVisualElement extends DOMVisualElement {\n constructor() {\n super(...arguments);\n this.type = \"svg\";\n this.isSVGTag = false;\n this.measureInstanceViewportBox = createBox;\n }\n getBaseTargetFromProps(props, key) {\n return props[key];\n }\n readValueFromInstance(instance, key) {\n if (transformProps.has(key)) {\n const defaultType = getDefaultValueType(key);\n return defaultType ? defaultType.default || 0 : 0;\n }\n if (cssStyleProperties.includes(key)) {\n const computedStyle = getComputedStyle(instance);\n const value = computedStyle[key];\n if (typeof value === \"string\" && value)\n return value.trim();\n }\n key = !camelCaseAttributes.has(key) ? camelToDash(key) : key;\n return instance.getAttribute(key);\n }\n scrapeMotionValuesFromProps(props, prevProps, visualElement) {\n return scrapeMotionValuesFromProps(props, prevProps, visualElement);\n }\n build(renderState, latestValues, props) {\n buildSVGAttrs(renderState, latestValues, this.isSVGTag, props.transformTemplate, props.style);\n }\n renderInstance(instance, renderState, styleProp, projection) {\n renderSVG(instance, renderState, styleProp, projection);\n }\n mount(instance) {\n this.isSVGTag = isSVGTag(instance.tagName);\n super.mount(instance);\n }\n}\n\nexport { SVGVisualElement };\n//# sourceMappingURL=SVGVisualElement.mjs.map\n","import { camelToDash } from '../../dom/utils/camel-to-dash.mjs';\nimport { renderHTML } from '../../html/utils/render.mjs';\nimport { camelCaseAttributes } from './camel-case-attrs.mjs';\n\nfunction renderSVG(element, renderState, _styleProp, projection) {\n renderHTML(element, renderState, undefined, projection);\n for (const key in renderState.attrs) {\n element.setAttribute(!camelCaseAttributes.has(key) ? camelToDash(key) : key, renderState.attrs[key]);\n }\n}\n\nexport { renderSVG };\n//# sourceMappingURL=render.mjs.map\n","import { isVariantLabel } from './is-variant-label.mjs';\nimport { variantProps } from './variant-props.mjs';\n\nconst numVariantProps = variantProps.length;\n/**\n * Get variant context from a visual element's parent chain.\n * Uses `any` type for visualElement to avoid circular dependencies.\n */\nfunction getVariantContext(visualElement) {\n if (!visualElement)\n return undefined;\n if (!visualElement.isControllingVariants) {\n const context = visualElement.parent\n ? getVariantContext(visualElement.parent) || {}\n : {};\n if (visualElement.props.initial !== undefined) {\n context.initial = visualElement.props.initial;\n }\n return context;\n }\n const context = {};\n for (let i = 0; i < numVariantProps; i++) {\n const name = variantProps[i];\n const prop = visualElement.props[name];\n if (isVariantLabel(prop) || prop === false) {\n context[name] = prop;\n }\n }\n return context;\n}\n\nexport { getVariantContext };\n//# sourceMappingURL=get-variant-context.mjs.map\n","function shallowCompare(next, prev) {\n if (!Array.isArray(prev))\n return false;\n const prevLength = prev.length;\n if (prevLength !== next.length)\n return false;\n for (let i = 0; i < prevLength; i++) {\n if (prev[i] !== next[i])\n return false;\n }\n return true;\n}\n\nexport { shallowCompare };\n//# sourceMappingURL=shallow-compare.mjs.map\n","import { animateVisualElement } from '../../animation/interfaces/visual-element.mjs';\nimport { calcChildStagger } from '../../animation/utils/calc-child-stagger.mjs';\nimport { getVariantContext } from './get-variant-context.mjs';\nimport { isAnimationControls } from './is-animation-controls.mjs';\nimport { isKeyframesTarget } from './is-keyframes-target.mjs';\nimport { isVariantLabel } from './is-variant-label.mjs';\nimport { resolveVariant } from './resolve-dynamic-variants.mjs';\nimport { shallowCompare } from './shallow-compare.mjs';\nimport { variantPriorityOrder } from './variant-props.mjs';\n\nconst reversePriorityOrder = [...variantPriorityOrder].reverse();\nconst numAnimationTypes = variantPriorityOrder.length;\nfunction createAnimateFunction(visualElement) {\n return (animations) => {\n return Promise.all(animations.map(({ animation, options }) => animateVisualElement(visualElement, animation, options)));\n };\n}\nfunction createAnimationState(visualElement) {\n let animate = createAnimateFunction(visualElement);\n let state = createState();\n let isInitialRender = true;\n /**\n * Track whether the animation state has been reset (e.g. via StrictMode\n * double-invocation or Suspense unmount/remount). On the first\n * animateChanges() call after a reset we need to behave like the initial\n * render for variant-inheritance checks, even though isInitialRender is\n * already false.\n */\n let wasReset = false;\n /**\n * This function will be used to reduce the animation definitions for\n * each active animation type into an object of resolved values for it.\n */\n const buildResolvedTypeValues = (type) => (acc, definition) => {\n const resolved = resolveVariant(visualElement, definition, type === \"exit\"\n ? visualElement.presenceContext?.custom\n : undefined);\n if (resolved) {\n const { transition, transitionEnd, ...target } = resolved;\n acc = { ...acc, ...target, ...transitionEnd };\n }\n return acc;\n };\n /**\n * This just allows us to inject mocked animation functions\n * @internal\n */\n function setAnimateFunction(makeAnimator) {\n animate = makeAnimator(visualElement);\n }\n /**\n * When we receive new props, we need to:\n * 1. Create a list of protected keys for each type. This is a directory of\n * value keys that are currently being \"handled\" by types of a higher priority\n * so that whenever an animation is played of a given type, these values are\n * protected from being animated.\n * 2. Determine if an animation type needs animating.\n * 3. Determine if any values have been removed from a type and figure out\n * what to animate those to.\n */\n function animateChanges(changedActiveType) {\n const { props } = visualElement;\n const context = getVariantContext(visualElement.parent) || {};\n /**\n * A list of animations that we'll build into as we iterate through the animation\n * types. This will get executed at the end of the function.\n */\n const animations = [];\n /**\n * Keep track of which values have been removed. Then, as we hit lower priority\n * animation types, we can check if they contain removed values and animate to that.\n */\n const removedKeys = new Set();\n /**\n * A dictionary of all encountered keys. This is an object to let us build into and\n * copy it without iteration. Each time we hit an animation type we set its protected\n * keys - the keys its not allowed to animate - to the latest version of this object.\n */\n let encounteredKeys = {};\n /**\n * If a variant has been removed at a given index, and this component is controlling\n * variant animations, we want to ensure lower-priority variants are forced to animate.\n */\n let removedVariantIndex = Infinity;\n /**\n * Iterate through all animation types in reverse priority order. For each, we want to\n * detect which values it's handling and whether or not they've changed (and therefore\n * need to be animated). If any values have been removed, we want to detect those in\n * lower priority props and flag for animation.\n */\n for (let i = 0; i < numAnimationTypes; i++) {\n const type = reversePriorityOrder[i];\n const typeState = state[type];\n const prop = props[type] !== undefined\n ? props[type]\n : context[type];\n const propIsVariant = isVariantLabel(prop);\n /**\n * If this type has *just* changed isActive status, set activeDelta\n * to that status. Otherwise set to null.\n */\n const activeDelta = type === changedActiveType ? typeState.isActive : null;\n if (activeDelta === false)\n removedVariantIndex = i;\n /**\n * If this prop is an inherited variant, rather than been set directly on the\n * component itself, we want to make sure we allow the parent to trigger animations.\n *\n * TODO: Can probably change this to a !isControllingVariants check\n */\n let isInherited = prop === context[type] &&\n prop !== props[type] &&\n propIsVariant;\n if (isInherited &&\n (isInitialRender || wasReset) &&\n visualElement.manuallyAnimateOnMount) {\n isInherited = false;\n }\n /**\n * Set all encountered keys so far as the protected keys for this type. This will\n * be any key that has been animated or otherwise handled by active, higher-priortiy types.\n */\n typeState.protectedKeys = { ...encounteredKeys };\n // Check if we can skip analysing this prop early\n if (\n // If it isn't active and hasn't *just* been set as inactive\n (!typeState.isActive && activeDelta === null) ||\n // If we didn't and don't have any defined prop for this animation type\n (!prop && !typeState.prevProp) ||\n // Or if the prop doesn't define an animation\n isAnimationControls(prop) ||\n typeof prop === \"boolean\") {\n continue;\n }\n /**\n * If exit is already active and wasn't just activated, skip\n * re-processing to prevent interrupting running exit animations.\n * Re-resolving exit with a changed custom value can start new\n * value animations that stop the originals, leaving the exit\n * animation promise unresolved and the component stuck in the DOM.\n */\n if (type === \"exit\" && typeState.isActive && activeDelta !== true) {\n if (typeState.prevResolvedValues) {\n encounteredKeys = {\n ...encounteredKeys,\n ...typeState.prevResolvedValues,\n };\n }\n continue;\n }\n /**\n * As we go look through the values defined on this type, if we detect\n * a changed value or a value that was removed in a higher priority, we set\n * this to true and add this prop to the animation list.\n */\n const variantDidChange = checkVariantsDidChange(typeState.prevProp, prop);\n let shouldAnimateType = variantDidChange ||\n // If we're making this variant active, we want to always make it active\n (type === changedActiveType &&\n typeState.isActive &&\n !isInherited &&\n propIsVariant) ||\n // If we removed a higher-priority variant (i is in reverse order)\n (i > removedVariantIndex && propIsVariant);\n let handledRemovedValues = false;\n /**\n * As animations can be set as variant lists, variants or target objects, we\n * coerce everything to an array if it isn't one already\n */\n const definitionList = Array.isArray(prop) ? prop : [prop];\n /**\n * Build an object of all the resolved values. We'll use this in the subsequent\n * animateChanges calls to determine whether a value has changed.\n */\n let resolvedValues = definitionList.reduce(buildResolvedTypeValues(type), {});\n if (activeDelta === false)\n resolvedValues = {};\n /**\n * Now we need to loop through all the keys in the prev prop and this prop,\n * and decide:\n * 1. If the value has changed, and needs animating\n * 2. If it has been removed, and needs adding to the removedKeys set\n * 3. If it has been removed in a higher priority type and needs animating\n * 4. If it hasn't been removed in a higher priority but hasn't changed, and\n * needs adding to the type's protectedKeys list.\n */\n const { prevResolvedValues = {} } = typeState;\n const allKeys = {\n ...prevResolvedValues,\n ...resolvedValues,\n };\n const markToAnimate = (key) => {\n shouldAnimateType = true;\n if (removedKeys.has(key)) {\n handledRemovedValues = true;\n removedKeys.delete(key);\n }\n typeState.needsAnimating[key] = true;\n const motionValue = visualElement.getValue(key);\n if (motionValue)\n motionValue.liveStyle = false;\n };\n for (const key in allKeys) {\n const next = resolvedValues[key];\n const prev = prevResolvedValues[key];\n // If we've already handled this we can just skip ahead\n if (encounteredKeys.hasOwnProperty(key))\n continue;\n /**\n * If the value has changed, we probably want to animate it.\n */\n let valueHasChanged = false;\n if (isKeyframesTarget(next) && isKeyframesTarget(prev)) {\n valueHasChanged =\n !shallowCompare(next, prev) || variantDidChange;\n }\n else {\n valueHasChanged = next !== prev;\n }\n if (valueHasChanged) {\n if (next !== undefined && next !== null) {\n // If next is defined and doesn't equal prev, it needs animating\n markToAnimate(key);\n }\n else {\n // If it's undefined, it's been removed.\n removedKeys.add(key);\n }\n }\n else if (next !== undefined && removedKeys.has(key)) {\n /**\n * If next hasn't changed and it isn't undefined, we want to check if it's\n * been removed by a higher priority\n */\n markToAnimate(key);\n }\n else {\n /**\n * If it hasn't changed, we add it to the list of protected values\n * to ensure it doesn't get animated.\n */\n typeState.protectedKeys[key] = true;\n }\n }\n /**\n * Update the typeState so next time animateChanges is called we can compare the\n * latest prop and resolvedValues to these.\n */\n typeState.prevProp = prop;\n typeState.prevResolvedValues = resolvedValues;\n if (typeState.isActive) {\n encounteredKeys = { ...encounteredKeys, ...resolvedValues };\n }\n if ((isInitialRender || wasReset) &&\n visualElement.blockInitialAnimation) {\n shouldAnimateType = false;\n }\n /**\n * If this is an inherited prop we want to skip this animation\n * unless the inherited variants haven't changed on this render.\n */\n const willAnimateViaParent = isInherited && variantDidChange;\n const needsAnimating = !willAnimateViaParent || handledRemovedValues;\n if (shouldAnimateType && needsAnimating) {\n animations.push(...definitionList.map((animation) => {\n const options = { type };\n /**\n * If we're performing the initial animation, but we're not\n * rendering at the same time as the variant-controlling parent,\n * we want to use the parent's transition to calculate the stagger.\n */\n if (typeof animation === \"string\" &&\n (isInitialRender || wasReset) &&\n !willAnimateViaParent &&\n visualElement.manuallyAnimateOnMount &&\n visualElement.parent) {\n const { parent } = visualElement;\n const parentVariant = resolveVariant(parent, animation);\n if (parent.enteringChildren && parentVariant) {\n const { delayChildren } = parentVariant.transition || {};\n options.delay = calcChildStagger(parent.enteringChildren, visualElement, delayChildren);\n }\n }\n return {\n animation: animation,\n options,\n };\n }));\n }\n }\n /**\n * If there are some removed value that haven't been dealt with,\n * we need to create a new animation that falls back either to the value\n * defined in the style prop, or the last read value.\n */\n if (removedKeys.size) {\n const fallbackAnimation = {};\n /**\n * If the initial prop contains a transition we can use that, otherwise\n * allow the animation function to use the visual element's default.\n */\n if (typeof props.initial !== \"boolean\") {\n const initialTransition = resolveVariant(visualElement, Array.isArray(props.initial)\n ? props.initial[0]\n : props.initial);\n if (initialTransition && initialTransition.transition) {\n fallbackAnimation.transition = initialTransition.transition;\n }\n }\n removedKeys.forEach((key) => {\n const fallbackTarget = visualElement.getBaseTarget(key);\n const motionValue = visualElement.getValue(key);\n if (motionValue)\n motionValue.liveStyle = true;\n // @ts-expect-error - @mattgperry to figure if we should do something here\n fallbackAnimation[key] = fallbackTarget ?? null;\n });\n animations.push({ animation: fallbackAnimation });\n }\n let shouldAnimate = Boolean(animations.length);\n if (isInitialRender &&\n (props.initial === false || props.initial === props.animate) &&\n !visualElement.manuallyAnimateOnMount) {\n shouldAnimate = false;\n }\n isInitialRender = false;\n wasReset = false;\n return shouldAnimate ? animate(animations) : Promise.resolve();\n }\n /**\n * Change whether a certain animation type is active.\n */\n function setActive(type, isActive) {\n // If the active state hasn't changed, we can safely do nothing here\n if (state[type].isActive === isActive)\n return Promise.resolve();\n // Propagate active change to children\n visualElement.variantChildren?.forEach((child) => child.animationState?.setActive(type, isActive));\n state[type].isActive = isActive;\n const animations = animateChanges(type);\n for (const key in state) {\n state[key].protectedKeys = {};\n }\n return animations;\n }\n return {\n animateChanges,\n setActive,\n setAnimateFunction,\n getState: () => state,\n reset: () => {\n state = createState();\n wasReset = true;\n },\n };\n}\nfunction checkVariantsDidChange(prev, next) {\n if (typeof next === \"string\") {\n return next !== prev;\n }\n else if (Array.isArray(next)) {\n return !shallowCompare(next, prev);\n }\n return false;\n}\nfunction createTypeState(isActive = false) {\n return {\n isActive,\n protectedKeys: {},\n needsAnimating: {},\n prevResolvedValues: {},\n };\n}\nfunction createState() {\n return {\n animate: createTypeState(true),\n whileInView: createTypeState(),\n whileHover: createTypeState(),\n whileTap: createTypeState(),\n whileDrag: createTypeState(),\n whileFocus: createTypeState(),\n exit: createTypeState(),\n };\n}\n\nexport { checkVariantsDidChange, createAnimationState };\n//# sourceMappingURL=animation-state.mjs.map\n","import { resolveVariant } from '../../render/utils/resolve-dynamic-variants.mjs';\nimport { animateTarget } from './visual-element-target.mjs';\nimport { animateVariant } from './visual-element-variant.mjs';\n\nfunction animateVisualElement(visualElement, definition, options = {}) {\n visualElement.notify(\"AnimationStart\", definition);\n let animation;\n if (Array.isArray(definition)) {\n const animations = definition.map((variant) => animateVariant(visualElement, variant, options));\n animation = Promise.all(animations);\n }\n else if (typeof definition === \"string\") {\n animation = animateVariant(visualElement, definition, options);\n }\n else {\n const resolvedDefinition = typeof definition === \"function\"\n ? resolveVariant(visualElement, definition, options.custom)\n : definition;\n animation = Promise.all(animateTarget(visualElement, resolvedDefinition, options));\n }\n return animation.then(() => {\n visualElement.notify(\"AnimationComplete\", definition);\n });\n}\n\nexport { animateVisualElement };\n//# sourceMappingURL=visual-element.mjs.map\n","/**\n * Reset an axis to the provided origin box.\n *\n * This is a mutative operation.\n */\nfunction copyAxisInto(axis, originAxis) {\n axis.min = originAxis.min;\n axis.max = originAxis.max;\n}\n/**\n * Reset a box to the provided origin box.\n *\n * This is a mutative operation.\n */\nfunction copyBoxInto(box, originBox) {\n copyAxisInto(box.x, originBox.x);\n copyAxisInto(box.y, originBox.y);\n}\n/**\n * Reset a delta to the provided origin box.\n *\n * This is a mutative operation.\n */\nfunction copyAxisDeltaInto(delta, originDelta) {\n delta.translate = originDelta.translate;\n delta.scale = originDelta.scale;\n delta.originPoint = originDelta.originPoint;\n delta.origin = originDelta.origin;\n}\n\nexport { copyAxisDeltaInto, copyAxisInto, copyBoxInto };\n//# sourceMappingURL=copy.mjs.map\n","import { mixNumber } from '../../utils/mix/number.mjs';\n\nconst SCALE_PRECISION = 0.0001;\nconst SCALE_MIN = 1 - SCALE_PRECISION;\nconst SCALE_MAX = 1 + SCALE_PRECISION;\nconst TRANSLATE_PRECISION = 0.01;\nconst TRANSLATE_MIN = 0 - TRANSLATE_PRECISION;\nconst TRANSLATE_MAX = 0 + TRANSLATE_PRECISION;\nfunction calcLength(axis) {\n return axis.max - axis.min;\n}\nfunction isNear(value, target, maxDistance) {\n return Math.abs(value - target) <= maxDistance;\n}\nfunction calcAxisDelta(delta, source, target, origin = 0.5) {\n delta.origin = origin;\n delta.originPoint = mixNumber(source.min, source.max, delta.origin);\n delta.scale = calcLength(target) / calcLength(source);\n delta.translate =\n mixNumber(target.min, target.max, delta.origin) - delta.originPoint;\n if ((delta.scale >= SCALE_MIN && delta.scale <= SCALE_MAX) ||\n isNaN(delta.scale)) {\n delta.scale = 1.0;\n }\n if ((delta.translate >= TRANSLATE_MIN &&\n delta.translate <= TRANSLATE_MAX) ||\n isNaN(delta.translate)) {\n delta.translate = 0.0;\n }\n}\nfunction calcBoxDelta(delta, source, target, origin) {\n calcAxisDelta(delta.x, source.x, target.x, origin ? origin.originX : undefined);\n calcAxisDelta(delta.y, source.y, target.y, origin ? origin.originY : undefined);\n}\nfunction calcRelativeAxis(target, relative, parent, anchor = 0) {\n const anchorPoint = anchor\n ? mixNumber(parent.min, parent.max, anchor)\n : parent.min;\n target.min = anchorPoint + relative.min;\n target.max = target.min + calcLength(relative);\n}\nfunction calcRelativeBox(target, relative, parent, anchor) {\n calcRelativeAxis(target.x, relative.x, parent.x, anchor?.x);\n calcRelativeAxis(target.y, relative.y, parent.y, anchor?.y);\n}\nfunction calcRelativeAxisPosition(target, layout, parent, anchor = 0) {\n const anchorPoint = anchor\n ? mixNumber(parent.min, parent.max, anchor)\n : parent.min;\n target.min = layout.min - anchorPoint;\n target.max = target.min + calcLength(layout);\n}\nfunction calcRelativePosition(target, layout, parent, anchor) {\n calcRelativeAxisPosition(target.x, layout.x, parent.x, anchor?.x);\n calcRelativeAxisPosition(target.y, layout.y, parent.y, anchor?.y);\n}\n\nexport { calcAxisDelta, calcBoxDelta, calcLength, calcRelativeAxis, calcRelativeAxisPosition, calcRelativeBox, calcRelativePosition, isNear };\n//# sourceMappingURL=delta-calc.mjs.map\n","import { mixNumber } from '../../utils/mix/number.mjs';\nimport { percent } from '../../value/types/numbers/units.mjs';\nimport { scalePoint } from './delta-apply.mjs';\n\n/**\n * Remove a delta from a point. This is essentially the steps of applyPointDelta in reverse\n */\nfunction removePointDelta(point, translate, scale, originPoint, boxScale) {\n point -= translate;\n point = scalePoint(point, 1 / scale, originPoint);\n if (boxScale !== undefined) {\n point = scalePoint(point, 1 / boxScale, originPoint);\n }\n return point;\n}\n/**\n * Remove a delta from an axis. This is essentially the steps of applyAxisDelta in reverse\n */\nfunction removeAxisDelta(axis, translate = 0, scale = 1, origin = 0.5, boxScale, originAxis = axis, sourceAxis = axis) {\n if (percent.test(translate)) {\n translate = parseFloat(translate);\n const relativeProgress = mixNumber(sourceAxis.min, sourceAxis.max, translate / 100);\n translate = relativeProgress - sourceAxis.min;\n }\n if (typeof translate !== \"number\")\n return;\n let originPoint = mixNumber(originAxis.min, originAxis.max, origin);\n if (axis === originAxis)\n originPoint -= translate;\n axis.min = removePointDelta(axis.min, translate, scale, originPoint, boxScale);\n axis.max = removePointDelta(axis.max, translate, scale, originPoint, boxScale);\n}\n/**\n * Remove a transforms from an axis. This is essentially the steps of applyAxisTransforms in reverse\n * and acts as a bridge between motion values and removeAxisDelta\n */\nfunction removeAxisTransforms(axis, transforms, [key, scaleKey, originKey], origin, sourceAxis) {\n removeAxisDelta(axis, transforms[key], transforms[scaleKey], transforms[originKey], transforms.scale, origin, sourceAxis);\n}\n/**\n * The names of the motion values we want to apply as translation, scale and origin.\n */\nconst xKeys = [\"x\", \"scaleX\", \"originX\"];\nconst yKeys = [\"y\", \"scaleY\", \"originY\"];\n/**\n * Remove a transforms from an box. This is essentially the steps of applyAxisBox in reverse\n * and acts as a bridge between motion values and removeAxisDelta\n */\nfunction removeBoxTransforms(box, transforms, originBox, sourceBox) {\n removeAxisTransforms(box.x, transforms, xKeys, originBox ? originBox.x : undefined, sourceBox ? sourceBox.x : undefined);\n removeAxisTransforms(box.y, transforms, yKeys, originBox ? originBox.y : undefined, sourceBox ? sourceBox.y : undefined);\n}\n\nexport { removeAxisDelta, removeAxisTransforms, removeBoxTransforms, removePointDelta };\n//# sourceMappingURL=delta-remove.mjs.map\n","import { calcLength } from './delta-calc.mjs';\n\nfunction isAxisDeltaZero(delta) {\n return delta.translate === 0 && delta.scale === 1;\n}\nfunction isDeltaZero(delta) {\n return isAxisDeltaZero(delta.x) && isAxisDeltaZero(delta.y);\n}\nfunction axisEquals(a, b) {\n return a.min === b.min && a.max === b.max;\n}\nfunction boxEquals(a, b) {\n return axisEquals(a.x, b.x) && axisEquals(a.y, b.y);\n}\nfunction axisEqualsRounded(a, b) {\n return (Math.round(a.min) === Math.round(b.min) &&\n Math.round(a.max) === Math.round(b.max));\n}\nfunction boxEqualsRounded(a, b) {\n return axisEqualsRounded(a.x, b.x) && axisEqualsRounded(a.y, b.y);\n}\nfunction aspectRatio(box) {\n return calcLength(box.x) / calcLength(box.y);\n}\nfunction axisDeltaEquals(a, b) {\n return (a.translate === b.translate &&\n a.scale === b.scale &&\n a.originPoint === b.originPoint);\n}\n\nexport { aspectRatio, axisDeltaEquals, axisEquals, axisEqualsRounded, boxEquals, boxEqualsRounded, isDeltaZero };\n//# sourceMappingURL=utils.mjs.map\n","function eachAxis(callback) {\n return [callback(\"x\"), callback(\"y\")];\n}\n\nexport { eachAxis };\n//# sourceMappingURL=each-axis.mjs.map\n","import { mixNumber } from '../../utils/mix/number.mjs';\nimport { percent, px } from '../../value/types/numbers/units.mjs';\nimport { progress, circOut, noop } from 'motion-utils';\nimport { cornerRadiusProps } from '../../utils/border-radius.mjs';\n\nconst numBorders = cornerRadiusProps.length;\nconst asNumber = (value) => typeof value === \"string\" ? parseFloat(value) : value;\nconst isPx = (value) => typeof value === \"number\" || px.test(value);\nfunction mixValues(target, follow, lead, progress, shouldCrossfadeOpacity, isOnlyMember) {\n if (shouldCrossfadeOpacity) {\n target.opacity = mixNumber(0, lead.opacity ?? 1, easeCrossfadeIn(progress));\n target.opacityExit = mixNumber(follow.opacity ?? 1, 0, easeCrossfadeOut(progress));\n }\n else if (isOnlyMember) {\n target.opacity = mixNumber(follow.opacity ?? 1, lead.opacity ?? 1, progress);\n }\n /**\n * Mix border radius\n */\n for (let i = 0; i < numBorders; i++) {\n const borderLabel = cornerRadiusProps[i];\n let followRadius = getRadius(follow, borderLabel);\n let leadRadius = getRadius(lead, borderLabel);\n if (followRadius === undefined && leadRadius === undefined)\n continue;\n followRadius || (followRadius = 0);\n leadRadius || (leadRadius = 0);\n const canMix = followRadius === 0 ||\n leadRadius === 0 ||\n isPx(followRadius) === isPx(leadRadius);\n if (canMix) {\n target[borderLabel] = Math.max(mixNumber(asNumber(followRadius), asNumber(leadRadius), progress), 0);\n if (percent.test(leadRadius) || percent.test(followRadius)) {\n target[borderLabel] += \"%\";\n }\n }\n else {\n target[borderLabel] = leadRadius;\n }\n }\n /**\n * Mix rotation\n */\n if (follow.rotate || lead.rotate) {\n target.rotate = mixNumber(follow.rotate || 0, lead.rotate || 0, progress);\n }\n}\nfunction getRadius(values, radiusName) {\n return values[radiusName] !== undefined\n ? values[radiusName]\n : values.borderRadius;\n}\nconst easeCrossfadeIn = /*@__PURE__*/ compress(0, 0.5, circOut);\nconst easeCrossfadeOut = /*@__PURE__*/ compress(0.5, 0.95, noop);\nfunction compress(min, max, easing) {\n return (p) => {\n // Could replace ifs with clamp\n if (p < min)\n return 0;\n if (p > max)\n return 1;\n return easing(progress(min, max, p));\n };\n}\n\nexport { mixValues };\n//# sourceMappingURL=mix-values.mjs.map\n","function addDomEvent(target, eventName, handler, options = { passive: true }) {\n target.addEventListener(eventName, handler, options);\n return () => target.removeEventListener(eventName, handler, options);\n}\n\nexport { addDomEvent };\n//# sourceMappingURL=add-dom-event.mjs.map\n","const compareByDepth = (a, b) => a.depth - b.depth;\n\nexport { compareByDepth };\n//# sourceMappingURL=compare-by-depth.mjs.map\n","import { addUniqueItem, removeItem } from 'motion-utils';\nimport { compareByDepth } from './compare-by-depth.mjs';\n\nclass FlatTree {\n constructor() {\n this.children = [];\n this.isDirty = false;\n }\n add(child) {\n addUniqueItem(this.children, child);\n this.isDirty = true;\n }\n remove(child) {\n removeItem(this.children, child);\n this.isDirty = true;\n }\n forEach(callback) {\n this.isDirty && this.children.sort(compareByDepth);\n this.isDirty = false;\n this.children.forEach(callback);\n }\n}\n\nexport { FlatTree };\n//# sourceMappingURL=flat-tree.mjs.map\n","import { isMotionValue } from './is-motion-value.mjs';\n\n/**\n * If the provided value is a MotionValue, this returns the actual value, otherwise just the value itself\n */\nfunction resolveMotionValue(value) {\n return isMotionValue(value) ? value.get() : value;\n}\n\nexport { resolveMotionValue };\n//# sourceMappingURL=resolve-motion-value.mjs.map\n","import { addUniqueItem, removeItem } from 'motion-utils';\n\nclass NodeStack {\n constructor() {\n this.members = [];\n }\n add(node) {\n addUniqueItem(this.members, node);\n for (let i = this.members.length - 1; i >= 0; i--) {\n const member = this.members[i];\n if (member === node || member === this.lead || member === this.prevLead)\n continue;\n const inst = member.instance;\n if ((!inst || inst.isConnected === false) && !member.snapshot) {\n removeItem(this.members, member);\n member.unmount();\n }\n }\n node.scheduleRender();\n }\n remove(node) {\n removeItem(this.members, node);\n if (node === this.prevLead)\n this.prevLead = undefined;\n if (node === this.lead) {\n const prevLead = this.members[this.members.length - 1];\n if (prevLead)\n this.promote(prevLead);\n }\n }\n relegate(node) {\n for (let i = this.members.indexOf(node) - 1; i >= 0; i--) {\n const member = this.members[i];\n if (member.isPresent !== false && member.instance?.isConnected !== false) {\n this.promote(member);\n return true;\n }\n }\n return false;\n }\n promote(node, preserveFollowOpacity) {\n const prevLead = this.lead;\n if (node === prevLead)\n return;\n this.prevLead = prevLead;\n this.lead = node;\n node.show();\n if (prevLead) {\n prevLead.updateSnapshot();\n node.scheduleRender();\n const { layoutDependency: prevDep } = prevLead.options;\n const { layoutDependency: nextDep } = node.options;\n if (prevDep === undefined || prevDep !== nextDep) {\n node.resumeFrom = prevLead;\n if (preserveFollowOpacity)\n prevLead.preserveOpacity = true;\n if (prevLead.snapshot) {\n node.snapshot = prevLead.snapshot;\n node.snapshot.latestValues =\n prevLead.animationValues || prevLead.latestValues;\n }\n if (node.root?.isUpdating)\n node.isLayoutDirty = true;\n }\n if (node.options.crossfade === false)\n prevLead.hide();\n }\n }\n exitAnimationComplete() {\n this.members.forEach((member) => {\n member.options.onExitComplete?.();\n member.resumingFrom?.options.onExitComplete?.();\n });\n }\n scheduleRender() {\n this.members.forEach((member) => member.instance && member.scheduleRender(false));\n }\n removeLeadSnapshot() {\n if (this.lead?.snapshot)\n this.lead.snapshot = undefined;\n }\n}\n\nexport { NodeStack };\n//# sourceMappingURL=stack.mjs.map\n","/**\n * This should only ever be modified on the client otherwise it'll\n * persist through server requests. If we need instanced states we\n * could lazy-init via root.\n */\nconst globalProjectionState = {\n /**\n * Global flag as to whether the tree has animated since the last time\n * we resized the window\n */\n hasAnimatedSinceResize: true,\n /**\n * We set this to true once, on the first update. Any nodes added to the tree beyond that\n * update will be given a `data-projection-id` attribute.\n */\n hasEverUpdated: false,\n};\n\nexport { globalProjectionState };\n//# sourceMappingURL=state.mjs.map\n","import { SubscriptionManager, clamp, noop } from 'motion-utils';\nimport { animateSingleValue } from '../../animation/animate/single-value.mjs';\nimport { getOptimisedAppearId } from '../../animation/optimized-appear/get-appear-id.mjs';\nimport { getValueTransition } from '../../animation/utils/get-value-transition.mjs';\nimport { microtask } from '../../frameloop/microtask.mjs';\nimport { time } from '../../frameloop/sync-time.mjs';\nimport { scaleCorrectors } from '../styles/scale-correction.mjs';\nimport { statsBuffer } from '../../stats/buffer.mjs';\nimport { delay } from '../../utils/delay.mjs';\nimport { isSVGElement } from '../../utils/is-svg-element.mjs';\nimport { isSVGSVGElement } from '../../utils/is-svg-svg-element.mjs';\nimport { mixNumber } from '../../utils/mix/number.mjs';\nimport { motionValue } from '../../value/index.mjs';\nimport { resolveMotionValue } from '../../value/utils/resolve-motion-value.mjs';\nimport { mixValues } from '../animation/mix-values.mjs';\nimport { copyBoxInto, copyAxisDeltaInto, copyAxisInto } from '../geometry/copy.mjs';\nimport { translateAxis, transformBox, applyBoxDelta, applyTreeDeltas } from '../geometry/delta-apply.mjs';\nimport { calcLength, calcRelativeBox, calcRelativePosition, calcBoxDelta, isNear } from '../geometry/delta-calc.mjs';\nimport { removeBoxTransforms } from '../geometry/delta-remove.mjs';\nimport { createBox, createDelta } from '../geometry/models.mjs';\nimport { boxEqualsRounded, isDeltaZero, axisDeltaEquals, boxEquals, aspectRatio } from '../geometry/utils.mjs';\nimport { NodeStack } from '../shared/stack.mjs';\nimport { buildProjectionTransform } from '../styles/transform.mjs';\nimport { eachAxis } from '../utils/each-axis.mjs';\nimport { FlatTree } from '../utils/flat-tree.mjs';\nimport { hasTransform, hasScale, has2DTranslate } from '../utils/has-transform.mjs';\nimport { globalProjectionState } from './state.mjs';\nimport { frame, cancelFrame, frameData, frameSteps } from '../../frameloop/frame.mjs';\n\nconst metrics = {\n nodes: 0,\n calculatedTargetDeltas: 0,\n calculatedProjections: 0,\n};\nconst transformAxes = [\"\", \"X\", \"Y\", \"Z\"];\n/**\n * We use 1000 as the animation target as 0-1000 maps better to pixels than 0-1\n * which has a noticeable difference in spring animations\n */\nconst animationTarget = 1000;\nlet id = 0;\nfunction resetDistortingTransform(key, visualElement, values, sharedAnimationValues) {\n const { latestValues } = visualElement;\n // Record the distorting transform and then temporarily set it to 0\n if (latestValues[key]) {\n values[key] = latestValues[key];\n visualElement.setStaticValue(key, 0);\n if (sharedAnimationValues) {\n sharedAnimationValues[key] = 0;\n }\n }\n}\nfunction cancelTreeOptimisedTransformAnimations(projectionNode) {\n projectionNode.hasCheckedOptimisedAppear = true;\n if (projectionNode.root === projectionNode)\n return;\n const { visualElement } = projectionNode.options;\n if (!visualElement)\n return;\n const appearId = getOptimisedAppearId(visualElement);\n if (window.MotionHasOptimisedAnimation(appearId, \"transform\")) {\n const { layout, layoutId } = projectionNode.options;\n window.MotionCancelOptimisedAnimation(appearId, \"transform\", frame, !(layout || layoutId));\n }\n const { parent } = projectionNode;\n if (parent && !parent.hasCheckedOptimisedAppear) {\n cancelTreeOptimisedTransformAnimations(parent);\n }\n}\nfunction createProjectionNode({ attachResizeListener, defaultParent, measureScroll, checkIsScrollRoot, resetTransform, }) {\n return class ProjectionNode {\n constructor(latestValues = {}, parent = defaultParent?.()) {\n /**\n * A unique ID generated for every projection node.\n */\n this.id = id++;\n /**\n * An id that represents a unique session instigated by startUpdate.\n */\n this.animationId = 0;\n this.animationCommitId = 0;\n /**\n * A Set containing all this component's children. This is used to iterate\n * through the children.\n *\n * TODO: This could be faster to iterate as a flat array stored on the root node.\n */\n this.children = new Set();\n /**\n * Options for the node. We use this to configure what kind of layout animations\n * we should perform (if any).\n */\n this.options = {};\n /**\n * We use this to detect when its safe to shut down part of a projection tree.\n * We have to keep projecting children for scale correction and relative projection\n * until all their parents stop performing layout animations.\n */\n this.isTreeAnimating = false;\n this.isAnimationBlocked = false;\n /**\n * Flag to true if we think this layout has been changed. We can't always know this,\n * currently we set it to true every time a component renders, or if it has a layoutDependency\n * if that has changed between renders. Additionally, components can be grouped by LayoutGroup\n * and if one node is dirtied, they all are.\n */\n this.isLayoutDirty = false;\n /**\n * Flag to true if we think the projection calculations for this node needs\n * recalculating as a result of an updated transform or layout animation.\n */\n this.isProjectionDirty = false;\n /**\n * Flag to true if the layout *or* transform has changed. This then gets propagated\n * throughout the projection tree, forcing any element below to recalculate on the next frame.\n */\n this.isSharedProjectionDirty = false;\n /**\n * Flag transform dirty. This gets propagated throughout the whole tree but is only\n * respected by shared nodes.\n */\n this.isTransformDirty = false;\n /**\n * Block layout updates for instant layout transitions throughout the tree.\n */\n this.updateManuallyBlocked = false;\n this.updateBlockedByResize = false;\n /**\n * Set to true between the start of the first `willUpdate` call and the end of the `didUpdate`\n * call.\n */\n this.isUpdating = false;\n /**\n * If this is an SVG element we currently disable projection transforms\n */\n this.isSVG = false;\n /**\n * Flag to true (during promotion) if a node doing an instant layout transition needs to reset\n * its projection styles.\n */\n this.needsReset = false;\n /**\n * Flags whether this node should have its transform reset prior to measuring.\n */\n this.shouldResetTransform = false;\n /**\n * Store whether this node has been checked for optimised appear animations. As\n * effects fire bottom-up, and we want to look up the tree for appear animations,\n * this makes sure we only check each path once, stopping at nodes that\n * have already been checked.\n */\n this.hasCheckedOptimisedAppear = false;\n /**\n * An object representing the calculated contextual/accumulated/tree scale.\n * This will be used to scale calculcated projection transforms, as these are\n * calculated in screen-space but need to be scaled for elements to layoutly\n * make it to their calculated destinations.\n *\n * TODO: Lazy-init\n */\n this.treeScale = { x: 1, y: 1 };\n /**\n *\n */\n this.eventHandlers = new Map();\n this.hasTreeAnimated = false;\n this.layoutVersion = 0;\n // Note: Currently only running on root node\n this.updateScheduled = false;\n this.scheduleUpdate = () => this.update();\n this.projectionUpdateScheduled = false;\n this.checkUpdateFailed = () => {\n if (this.isUpdating) {\n this.isUpdating = false;\n this.clearAllSnapshots();\n }\n };\n /**\n * This is a multi-step process as shared nodes might be of different depths. Nodes\n * are sorted by depth order, so we need to resolve the entire tree before moving to\n * the next step.\n */\n this.updateProjection = () => {\n this.projectionUpdateScheduled = false;\n /**\n * Reset debug counts. Manually resetting rather than creating a new\n * object each frame.\n */\n if (statsBuffer.value) {\n metrics.nodes =\n metrics.calculatedTargetDeltas =\n metrics.calculatedProjections =\n 0;\n }\n this.nodes.forEach(propagateDirtyNodes);\n this.nodes.forEach(resolveTargetDelta);\n this.nodes.forEach(calcProjection);\n this.nodes.forEach(cleanDirtyNodes);\n if (statsBuffer.addProjectionMetrics) {\n statsBuffer.addProjectionMetrics(metrics);\n }\n };\n /**\n * Frame calculations\n */\n this.resolvedRelativeTargetAt = 0.0;\n this.linkedParentVersion = 0;\n this.hasProjected = false;\n this.isVisible = true;\n this.animationProgress = 0;\n /**\n * Shared layout\n */\n // TODO Only running on root node\n this.sharedNodes = new Map();\n this.latestValues = latestValues;\n this.root = parent ? parent.root || parent : this;\n this.path = parent ? [...parent.path, parent] : [];\n this.parent = parent;\n this.depth = parent ? parent.depth + 1 : 0;\n for (let i = 0; i < this.path.length; i++) {\n this.path[i].shouldResetTransform = true;\n }\n if (this.root === this)\n this.nodes = new FlatTree();\n }\n addEventListener(name, handler) {\n if (!this.eventHandlers.has(name)) {\n this.eventHandlers.set(name, new SubscriptionManager());\n }\n return this.eventHandlers.get(name).add(handler);\n }\n notifyListeners(name, ...args) {\n const subscriptionManager = this.eventHandlers.get(name);\n subscriptionManager && subscriptionManager.notify(...args);\n }\n hasListeners(name) {\n return this.eventHandlers.has(name);\n }\n /**\n * Lifecycles\n */\n mount(instance) {\n if (this.instance)\n return;\n this.isSVG = isSVGElement(instance) && !isSVGSVGElement(instance);\n this.instance = instance;\n const { layoutId, layout, visualElement } = this.options;\n if (visualElement && !visualElement.current) {\n visualElement.mount(instance);\n }\n this.root.nodes.add(this);\n this.parent && this.parent.children.add(this);\n if (this.root.hasTreeAnimated && (layout || layoutId)) {\n this.isLayoutDirty = true;\n }\n if (attachResizeListener) {\n let cancelDelay;\n let innerWidth = 0;\n const resizeUnblockUpdate = () => (this.root.updateBlockedByResize = false);\n // Set initial innerWidth in a frame.read callback to batch the read\n frame.read(() => {\n innerWidth = window.innerWidth;\n });\n attachResizeListener(instance, () => {\n const newInnerWidth = window.innerWidth;\n if (newInnerWidth === innerWidth)\n return;\n innerWidth = newInnerWidth;\n this.root.updateBlockedByResize = true;\n cancelDelay && cancelDelay();\n cancelDelay = delay(resizeUnblockUpdate, 250);\n if (globalProjectionState.hasAnimatedSinceResize) {\n globalProjectionState.hasAnimatedSinceResize = false;\n this.nodes.forEach(finishAnimation);\n }\n });\n }\n if (layoutId) {\n this.root.registerSharedNode(layoutId, this);\n }\n // Only register the handler if it requires layout animation\n if (this.options.animate !== false &&\n visualElement &&\n (layoutId || layout)) {\n this.addEventListener(\"didUpdate\", ({ delta, hasLayoutChanged, hasRelativeLayoutChanged, layout: newLayout, }) => {\n if (this.isTreeAnimationBlocked()) {\n this.target = undefined;\n this.relativeTarget = undefined;\n return;\n }\n // TODO: Check here if an animation exists\n const layoutTransition = this.options.transition ||\n visualElement.getDefaultTransition() ||\n defaultLayoutTransition;\n const { onLayoutAnimationStart, onLayoutAnimationComplete, } = visualElement.getProps();\n /**\n * The target layout of the element might stay the same,\n * but its position relative to its parent has changed.\n */\n const hasTargetChanged = !this.targetLayout ||\n !boxEqualsRounded(this.targetLayout, newLayout);\n /*\n * Note: Disabled to fix relative animations always triggering new\n * layout animations. If this causes further issues, we can try\n * a different approach to detecting relative target changes.\n */\n // || hasRelativeLayoutChanged\n /**\n * If the layout hasn't seemed to have changed, it might be that the\n * element is visually in the same place in the document but its position\n * relative to its parent has indeed changed. So here we check for that.\n */\n const hasOnlyRelativeTargetChanged = !hasLayoutChanged && hasRelativeLayoutChanged;\n if (this.options.layoutRoot ||\n this.resumeFrom ||\n hasOnlyRelativeTargetChanged ||\n (hasLayoutChanged &&\n (hasTargetChanged || !this.currentAnimation))) {\n if (this.resumeFrom) {\n this.resumingFrom = this.resumeFrom;\n this.resumingFrom.resumingFrom = undefined;\n }\n const animationOptions = {\n ...getValueTransition(layoutTransition, \"layout\"),\n onPlay: onLayoutAnimationStart,\n onComplete: onLayoutAnimationComplete,\n };\n if (visualElement.shouldReduceMotion ||\n this.options.layoutRoot) {\n animationOptions.delay = 0;\n animationOptions.type = false;\n }\n this.startAnimation(animationOptions);\n /**\n * Set animation origin after starting animation to avoid layout jump\n * caused by stopping previous layout animation\n */\n this.setAnimationOrigin(delta, hasOnlyRelativeTargetChanged, animationOptions\n .path);\n }\n else {\n /**\n * If the layout hasn't changed and we have an animation that hasn't started yet,\n * finish it immediately. Otherwise it will be animating from a location\n * that was probably never committed to screen and look like a jumpy box.\n */\n if (!hasLayoutChanged) {\n finishAnimation(this);\n }\n if (this.isLead() && this.options.onExitComplete) {\n this.options.onExitComplete();\n }\n }\n this.targetLayout = newLayout;\n });\n }\n }\n unmount() {\n this.options.layoutId && this.willUpdate();\n this.root.nodes.remove(this);\n const stack = this.getStack();\n stack && stack.remove(this);\n this.parent && this.parent.children.delete(this);\n this.instance = undefined;\n this.eventHandlers.clear();\n cancelFrame(this.updateProjection);\n }\n // only on the root\n blockUpdate() {\n this.updateManuallyBlocked = true;\n }\n unblockUpdate() {\n this.updateManuallyBlocked = false;\n }\n isUpdateBlocked() {\n return this.updateManuallyBlocked || this.updateBlockedByResize;\n }\n isTreeAnimationBlocked() {\n return (this.isAnimationBlocked ||\n (this.parent && this.parent.isTreeAnimationBlocked()) ||\n false);\n }\n // Note: currently only running on root node\n startUpdate() {\n if (this.isUpdateBlocked())\n return;\n this.isUpdating = true;\n this.nodes && this.nodes.forEach(resetSkewAndRotation);\n this.animationId++;\n }\n getTransformTemplate() {\n const { visualElement } = this.options;\n return visualElement && visualElement.getProps().transformTemplate;\n }\n willUpdate(shouldNotifyListeners = true) {\n this.root.hasTreeAnimated = true;\n if (this.root.isUpdateBlocked()) {\n this.options.onExitComplete && this.options.onExitComplete();\n return;\n }\n /**\n * If we're running optimised appear animations then these must be\n * cancelled before measuring the DOM. This is so we can measure\n * the true layout of the element rather than the WAAPI animation\n * which will be unaffected by the resetSkewAndRotate step.\n *\n * Note: This is a DOM write. Worst case scenario is this is sandwiched\n * between other snapshot reads which will cause unnecessary style recalculations.\n * This has to happen here though, as we don't yet know which nodes will need\n * snapshots in startUpdate(), but we only want to cancel optimised animations\n * if a layout animation measurement is actually going to be affected by them.\n */\n if (window.MotionCancelOptimisedAnimation &&\n !this.hasCheckedOptimisedAppear) {\n cancelTreeOptimisedTransformAnimations(this);\n }\n !this.root.isUpdating && this.root.startUpdate();\n if (this.isLayoutDirty)\n return;\n this.isLayoutDirty = true;\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i];\n node.shouldResetTransform = true;\n /**\n * Percentage translates resolve against layoutBox dimensions,\n * so ancestors with them must be re-measured after transform reset.\n */\n if (typeof node.latestValues.x === \"string\" ||\n typeof node.latestValues.y === \"string\") {\n node.isLayoutDirty = true;\n }\n node.updateScroll(\"snapshot\");\n if (node.options.layoutRoot) {\n node.willUpdate(false);\n }\n }\n const { layoutId, layout } = this.options;\n if (layoutId === undefined && !layout)\n return;\n const transformTemplate = this.getTransformTemplate();\n this.prevTransformTemplateValue = transformTemplate\n ? transformTemplate(this.latestValues, \"\")\n : undefined;\n this.updateSnapshot();\n shouldNotifyListeners && this.notifyListeners(\"willUpdate\");\n }\n update() {\n this.updateScheduled = false;\n const updateWasBlocked = this.isUpdateBlocked();\n // When doing an instant transition, we skip the layout update,\n // but should still clean up the measurements so that the next\n // snapshot could be taken correctly.\n if (updateWasBlocked) {\n const wasBlockedByResize = this.updateBlockedByResize;\n this.unblockUpdate();\n this.updateBlockedByResize = false;\n this.clearAllSnapshots();\n /**\n * When blocked by resize, still measure layouts so\n * callbacks like onLayoutMeasure fire (e.g. Reorder).\n * Skip notifyLayoutUpdate to prevent animations.\n */\n if (wasBlockedByResize) {\n this.nodes.forEach(forceLayoutMeasure);\n }\n this.nodes.forEach(clearMeasurements);\n return;\n }\n /**\n * If this is a repeat of didUpdate then ignore the animation.\n */\n if (this.animationId <= this.animationCommitId) {\n this.nodes.forEach(clearIsLayoutDirty);\n return;\n }\n this.animationCommitId = this.animationId;\n if (!this.isUpdating) {\n this.nodes.forEach(clearIsLayoutDirty);\n }\n else {\n this.isUpdating = false;\n /**\n * Ensure animation-blocked nodes (e.g. during drag)\n * get measured even when memoized (willUpdate skipped).\n */\n this.nodes.forEach(ensureDraggedNodesSnapshotted);\n /**\n * Write\n */\n this.nodes.forEach(resetTransformStyle);\n /**\n * Read ==================\n */\n // Update layout measurements of updated children\n this.nodes.forEach(updateLayout);\n /**\n * Write\n */\n // Notify listeners that the layout is updated\n this.nodes.forEach(notifyLayoutUpdate);\n }\n this.clearAllSnapshots();\n /**\n * Manually flush any pending updates. Ideally\n * we could leave this to the following requestAnimationFrame but this seems\n * to leave a flash of incorrectly styled content.\n */\n const now = time.now();\n frameData.delta = clamp(0, 1000 / 60, now - frameData.timestamp);\n frameData.timestamp = now;\n frameData.isProcessing = true;\n frameSteps.update.process(frameData);\n frameSteps.preRender.process(frameData);\n frameSteps.render.process(frameData);\n frameData.isProcessing = false;\n }\n didUpdate() {\n if (!this.updateScheduled) {\n this.updateScheduled = true;\n microtask.read(this.scheduleUpdate);\n }\n }\n clearAllSnapshots() {\n this.nodes.forEach(clearSnapshot);\n this.sharedNodes.forEach(removeLeadSnapshots);\n }\n scheduleUpdateProjection() {\n if (!this.projectionUpdateScheduled) {\n this.projectionUpdateScheduled = true;\n frame.preRender(this.updateProjection, false, true);\n }\n }\n scheduleCheckAfterUnmount() {\n /**\n * If the unmounting node is in a layoutGroup and did trigger a willUpdate,\n * we manually call didUpdate to give a chance to the siblings to animate.\n * Otherwise, cleanup all snapshots to prevents future nodes from reusing them.\n */\n frame.postRender(() => {\n if (this.isLayoutDirty) {\n this.root.didUpdate();\n }\n else {\n this.root.checkUpdateFailed();\n }\n });\n }\n /**\n * Update measurements\n */\n updateSnapshot() {\n if (this.snapshot || !this.instance)\n return;\n this.snapshot = this.measure();\n if (this.snapshot &&\n !calcLength(this.snapshot.measuredBox.x) &&\n !calcLength(this.snapshot.measuredBox.y)) {\n this.snapshot = undefined;\n }\n }\n updateLayout() {\n if (!this.instance)\n return;\n this.updateScroll();\n if (!(this.options.alwaysMeasureLayout && this.isLead()) &&\n !this.isLayoutDirty) {\n return;\n }\n /**\n * When a node is mounted, it simply resumes from the prevLead's\n * snapshot instead of taking a new one, but the ancestors scroll\n * might have updated while the prevLead is unmounted. We need to\n * update the scroll again to make sure the layout we measure is\n * up to date.\n */\n if (this.resumeFrom && !this.resumeFrom.instance) {\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i];\n node.updateScroll();\n }\n }\n const prevLayout = this.layout;\n this.layout = this.measure(false);\n this.layoutVersion++;\n if (!this.layoutCorrected)\n this.layoutCorrected = createBox();\n this.isLayoutDirty = false;\n this.projectionDelta = undefined;\n this.notifyListeners(\"measure\", this.layout.layoutBox);\n const { visualElement } = this.options;\n visualElement &&\n visualElement.notify(\"LayoutMeasure\", this.layout.layoutBox, prevLayout ? prevLayout.layoutBox : undefined);\n }\n updateScroll(phase = \"measure\") {\n let needsMeasurement = Boolean(this.options.layoutScroll && this.instance);\n if (this.scroll &&\n this.scroll.animationId === this.root.animationId &&\n this.scroll.phase === phase) {\n needsMeasurement = false;\n }\n if (needsMeasurement && this.instance) {\n const isRoot = checkIsScrollRoot(this.instance);\n this.scroll = {\n animationId: this.root.animationId,\n phase,\n isRoot,\n offset: measureScroll(this.instance),\n wasRoot: this.scroll ? this.scroll.isRoot : isRoot,\n };\n }\n }\n resetTransform() {\n if (!resetTransform)\n return;\n const isResetRequested = this.isLayoutDirty ||\n this.shouldResetTransform ||\n this.options.alwaysMeasureLayout;\n const hasProjection = this.projectionDelta && !isDeltaZero(this.projectionDelta);\n const transformTemplate = this.getTransformTemplate();\n const transformTemplateValue = transformTemplate\n ? transformTemplate(this.latestValues, \"\")\n : undefined;\n const transformTemplateHasChanged = transformTemplateValue !== this.prevTransformTemplateValue;\n if (isResetRequested &&\n this.instance &&\n (hasProjection ||\n hasTransform(this.latestValues) ||\n transformTemplateHasChanged)) {\n resetTransform(this.instance, transformTemplateValue);\n this.shouldResetTransform = false;\n this.scheduleRender();\n }\n }\n measure(removeTransform = true) {\n const pageBox = this.measurePageBox();\n let layoutBox = this.removeElementScroll(pageBox);\n /**\n * Measurements taken during the pre-render stage\n * still have transforms applied so we remove them\n * via calculation.\n */\n if (removeTransform) {\n layoutBox = this.removeTransform(layoutBox);\n }\n roundBox(layoutBox);\n return {\n animationId: this.root.animationId,\n measuredBox: pageBox,\n layoutBox,\n latestValues: {},\n source: this.id,\n };\n }\n measurePageBox() {\n const { visualElement } = this.options;\n if (!visualElement)\n return createBox();\n const box = visualElement.measureViewportBox();\n const wasInScrollRoot = this.scroll?.wasRoot || this.path.some(checkNodeWasScrollRoot);\n if (!wasInScrollRoot) {\n // Remove viewport scroll to give page-relative coordinates\n const { scroll } = this.root;\n if (scroll) {\n translateAxis(box.x, scroll.offset.x);\n translateAxis(box.y, scroll.offset.y);\n }\n }\n return box;\n }\n removeElementScroll(box) {\n const boxWithoutScroll = createBox();\n copyBoxInto(boxWithoutScroll, box);\n if (this.scroll?.wasRoot) {\n return boxWithoutScroll;\n }\n /**\n * Performance TODO: Keep a cumulative scroll offset down the tree\n * rather than loop back up the path.\n */\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i];\n const { scroll, options } = node;\n if (node !== this.root && scroll && options.layoutScroll) {\n /**\n * If this is a new scroll root, we want to remove all previous scrolls\n * from the viewport box.\n */\n if (scroll.wasRoot) {\n copyBoxInto(boxWithoutScroll, box);\n }\n translateAxis(boxWithoutScroll.x, scroll.offset.x);\n translateAxis(boxWithoutScroll.y, scroll.offset.y);\n }\n }\n return boxWithoutScroll;\n }\n applyTransform(box, transformOnly = false, output) {\n const withTransforms = output || createBox();\n copyBoxInto(withTransforms, box);\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i];\n if (!transformOnly &&\n node.options.layoutScroll &&\n node.scroll &&\n node !== node.root) {\n translateAxis(withTransforms.x, -node.scroll.offset.x);\n translateAxis(withTransforms.y, -node.scroll.offset.y);\n }\n if (!hasTransform(node.latestValues))\n continue;\n transformBox(withTransforms, node.latestValues, node.layout?.layoutBox);\n }\n if (hasTransform(this.latestValues)) {\n transformBox(withTransforms, this.latestValues, this.layout?.layoutBox);\n }\n return withTransforms;\n }\n removeTransform(box) {\n const boxWithoutTransform = createBox();\n copyBoxInto(boxWithoutTransform, box);\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i];\n if (!hasTransform(node.latestValues))\n continue;\n let sourceBox;\n if (node.instance) {\n hasScale(node.latestValues) && node.updateSnapshot();\n sourceBox = createBox();\n copyBoxInto(sourceBox, node.measurePageBox());\n }\n removeBoxTransforms(boxWithoutTransform, node.latestValues, node.snapshot?.layoutBox, sourceBox);\n }\n if (hasTransform(this.latestValues)) {\n removeBoxTransforms(boxWithoutTransform, this.latestValues);\n }\n return boxWithoutTransform;\n }\n setTargetDelta(delta) {\n this.targetDelta = delta;\n this.root.scheduleUpdateProjection();\n this.isProjectionDirty = true;\n }\n setOptions(options) {\n this.options = {\n ...this.options,\n ...options,\n crossfade: options.crossfade !== undefined ? options.crossfade : true,\n };\n }\n clearMeasurements() {\n this.scroll = undefined;\n this.layout = undefined;\n this.snapshot = undefined;\n this.prevTransformTemplateValue = undefined;\n this.targetDelta = undefined;\n this.target = undefined;\n this.isLayoutDirty = false;\n }\n forceRelativeParentToResolveTarget() {\n if (!this.relativeParent)\n return;\n /**\n * If the parent target isn't up-to-date, force it to update.\n * This is an unfortunate de-optimisation as it means any updating relative\n * projection will cause all the relative parents to recalculate back\n * up the tree.\n */\n if (this.relativeParent.resolvedRelativeTargetAt !==\n frameData.timestamp) {\n this.relativeParent.resolveTargetDelta(true);\n }\n }\n resolveTargetDelta(forceRecalculation = false) {\n /**\n * Once the dirty status of nodes has been spread through the tree, we also\n * need to check if we have a shared node of a different depth that has itself\n * been dirtied.\n */\n const lead = this.getLead();\n this.isProjectionDirty || (this.isProjectionDirty = lead.isProjectionDirty);\n this.isTransformDirty || (this.isTransformDirty = lead.isTransformDirty);\n this.isSharedProjectionDirty || (this.isSharedProjectionDirty = lead.isSharedProjectionDirty);\n const isShared = Boolean(this.resumingFrom) || this !== lead;\n /**\n * We don't use transform for this step of processing so we don't\n * need to check whether any nodes have changed transform.\n */\n const canSkip = !(forceRecalculation ||\n (isShared && this.isSharedProjectionDirty) ||\n this.isProjectionDirty ||\n this.parent?.isProjectionDirty ||\n this.attemptToResolveRelativeTarget ||\n this.root.updateBlockedByResize);\n if (canSkip)\n return;\n const { layout, layoutId } = this.options;\n /**\n * If we have no layout, we can't perform projection, so early return\n */\n if (!this.layout || !(layout || layoutId))\n return;\n this.resolvedRelativeTargetAt = frameData.timestamp;\n const relativeParent = this.getClosestProjectingParent();\n if (relativeParent &&\n this.linkedParentVersion !== relativeParent.layoutVersion &&\n !relativeParent.options.layoutRoot) {\n this.removeRelativeTarget();\n }\n /**\n * If we don't have a targetDelta but do have a layout, we can attempt to resolve\n * a relativeParent. This will allow a component to perform scale correction\n * even if no animation has started.\n */\n if (!this.targetDelta && !this.relativeTarget) {\n if (this.options.layoutAnchor !== false &&\n relativeParent &&\n relativeParent.layout) {\n this.createRelativeTarget(relativeParent, this.layout.layoutBox, relativeParent.layout.layoutBox);\n }\n else {\n this.removeRelativeTarget();\n }\n }\n /**\n * If we have no relative target or no target delta our target isn't valid\n * for this frame.\n */\n if (!this.relativeTarget && !this.targetDelta)\n return;\n /**\n * Lazy-init target data structure\n */\n if (!this.target) {\n this.target = createBox();\n this.targetWithTransforms = createBox();\n }\n /**\n * If we've got a relative box for this component, resolve it into a target relative to the parent.\n */\n if (this.relativeTarget &&\n this.relativeTargetOrigin &&\n this.relativeParent &&\n this.relativeParent.target) {\n this.forceRelativeParentToResolveTarget();\n calcRelativeBox(this.target, this.relativeTarget, this.relativeParent.target, this.options.layoutAnchor || undefined);\n /**\n * If we've only got a targetDelta, resolve it into a target\n */\n }\n else if (this.targetDelta) {\n if (Boolean(this.resumingFrom)) {\n this.applyTransform(this.layout.layoutBox, false, this.target);\n }\n else {\n copyBoxInto(this.target, this.layout.layoutBox);\n }\n applyBoxDelta(this.target, this.targetDelta);\n }\n else {\n /**\n * If no target, use own layout as target\n */\n copyBoxInto(this.target, this.layout.layoutBox);\n }\n /**\n * If we've been told to attempt to resolve a relative target, do so.\n */\n if (this.attemptToResolveRelativeTarget) {\n this.attemptToResolveRelativeTarget = false;\n if (this.options.layoutAnchor !== false &&\n relativeParent &&\n Boolean(relativeParent.resumingFrom) ===\n Boolean(this.resumingFrom) &&\n !relativeParent.options.layoutScroll &&\n relativeParent.target &&\n this.animationProgress !== 1) {\n this.createRelativeTarget(relativeParent, this.target, relativeParent.target);\n }\n else {\n this.relativeParent = this.relativeTarget = undefined;\n }\n }\n /**\n * Increase debug counter for resolved target deltas\n */\n if (statsBuffer.value) {\n metrics.calculatedTargetDeltas++;\n }\n }\n getClosestProjectingParent() {\n if (!this.parent ||\n hasScale(this.parent.latestValues) ||\n has2DTranslate(this.parent.latestValues)) {\n return undefined;\n }\n if (this.parent.isProjecting()) {\n return this.parent;\n }\n else {\n return this.parent.getClosestProjectingParent();\n }\n }\n isProjecting() {\n return Boolean((this.relativeTarget ||\n this.targetDelta ||\n this.options.layoutRoot) &&\n this.layout);\n }\n createRelativeTarget(relativeParent, layout, parentLayout) {\n this.relativeParent = relativeParent;\n this.linkedParentVersion = relativeParent.layoutVersion;\n this.forceRelativeParentToResolveTarget();\n this.relativeTarget = createBox();\n this.relativeTargetOrigin = createBox();\n calcRelativePosition(this.relativeTargetOrigin, layout, parentLayout, this.options.layoutAnchor || undefined);\n copyBoxInto(this.relativeTarget, this.relativeTargetOrigin);\n }\n removeRelativeTarget() {\n this.relativeParent = this.relativeTarget = undefined;\n }\n calcProjection() {\n const lead = this.getLead();\n const isShared = Boolean(this.resumingFrom) || this !== lead;\n let canSkip = true;\n /**\n * If this is a normal layout animation and neither this node nor its nearest projecting\n * is dirty then we can't skip.\n */\n if (this.isProjectionDirty || this.parent?.isProjectionDirty) {\n canSkip = false;\n }\n /**\n * If this is a shared layout animation and this node's shared projection is dirty then\n * we can't skip.\n */\n if (isShared &&\n (this.isSharedProjectionDirty || this.isTransformDirty)) {\n canSkip = false;\n }\n /**\n * If we have resolved the target this frame we must recalculate the\n * projection to ensure it visually represents the internal calculations.\n */\n if (this.resolvedRelativeTargetAt === frameData.timestamp) {\n canSkip = false;\n }\n if (canSkip)\n return;\n const { layout, layoutId } = this.options;\n /**\n * If this section of the tree isn't animating we can\n * delete our target sources for the following frame.\n */\n this.isTreeAnimating = Boolean((this.parent && this.parent.isTreeAnimating) ||\n this.currentAnimation ||\n this.pendingAnimation);\n if (!this.isTreeAnimating) {\n this.targetDelta = this.relativeTarget = undefined;\n }\n if (!this.layout || !(layout || layoutId))\n return;\n /**\n * Reset the corrected box with the latest values from box, as we're then going\n * to perform mutative operations on it.\n */\n copyBoxInto(this.layoutCorrected, this.layout.layoutBox);\n /**\n * Record previous tree scales before updating.\n */\n const prevTreeScaleX = this.treeScale.x;\n const prevTreeScaleY = this.treeScale.y;\n /**\n * Apply all the parent deltas to this box to produce the corrected box. This\n * is the layout box, as it will appear on screen as a result of the transforms of its parents.\n */\n applyTreeDeltas(this.layoutCorrected, this.treeScale, this.path, isShared);\n /**\n * If this layer needs to perform scale correction but doesn't have a target,\n * use the layout as the target.\n */\n if (lead.layout &&\n !lead.target &&\n (this.treeScale.x !== 1 || this.treeScale.y !== 1)) {\n lead.target = lead.layout.layoutBox;\n lead.targetWithTransforms = createBox();\n }\n const { target } = lead;\n if (!target) {\n /**\n * If we don't have a target to project into, but we were previously\n * projecting, we want to remove the stored transform and schedule\n * a render to ensure the elements reflect the removed transform.\n */\n if (this.prevProjectionDelta) {\n this.createProjectionDeltas();\n this.scheduleRender();\n }\n return;\n }\n if (!this.projectionDelta || !this.prevProjectionDelta) {\n this.createProjectionDeltas();\n }\n else {\n copyAxisDeltaInto(this.prevProjectionDelta.x, this.projectionDelta.x);\n copyAxisDeltaInto(this.prevProjectionDelta.y, this.projectionDelta.y);\n }\n /**\n * Update the delta between the corrected box and the target box before user-set transforms were applied.\n * This will allow us to calculate the corrected borderRadius and boxShadow to compensate\n * for our layout reprojection, but still allow them to be scaled correctly by the user.\n * It might be that to simplify this we may want to accept that user-set scale is also corrected\n * and we wouldn't have to keep and calc both deltas, OR we could support a user setting\n * to allow people to choose whether these styles are corrected based on just the\n * layout reprojection or the final bounding box.\n */\n calcBoxDelta(this.projectionDelta, this.layoutCorrected, target, this.latestValues);\n if (this.treeScale.x !== prevTreeScaleX ||\n this.treeScale.y !== prevTreeScaleY ||\n !axisDeltaEquals(this.projectionDelta.x, this.prevProjectionDelta.x) ||\n !axisDeltaEquals(this.projectionDelta.y, this.prevProjectionDelta.y)) {\n this.hasProjected = true;\n this.scheduleRender();\n this.notifyListeners(\"projectionUpdate\", target);\n }\n /**\n * Increase debug counter for recalculated projections\n */\n if (statsBuffer.value) {\n metrics.calculatedProjections++;\n }\n }\n hide() {\n this.isVisible = false;\n // TODO: Schedule render\n }\n show() {\n this.isVisible = true;\n // TODO: Schedule render\n }\n scheduleRender(notifyAll = true) {\n this.options.visualElement?.scheduleRender();\n if (notifyAll) {\n const stack = this.getStack();\n stack && stack.scheduleRender();\n }\n if (this.resumingFrom && !this.resumingFrom.instance) {\n this.resumingFrom = undefined;\n }\n }\n createProjectionDeltas() {\n this.prevProjectionDelta = createDelta();\n this.projectionDelta = createDelta();\n this.projectionDeltaWithTransform = createDelta();\n }\n setAnimationOrigin(delta, hasOnlyRelativeTargetChanged = false, pathFn) {\n const snapshot = this.snapshot;\n const snapshotLatestValues = snapshot ? snapshot.latestValues : {};\n const mixedValues = { ...this.latestValues };\n const targetDelta = createDelta();\n if (!this.relativeParent ||\n !this.relativeParent.options.layoutRoot) {\n this.relativeTarget = this.relativeTargetOrigin = undefined;\n }\n this.attemptToResolveRelativeTarget = !hasOnlyRelativeTargetChanged;\n const relativeLayout = createBox();\n const snapshotSource = snapshot ? snapshot.source : undefined;\n const layoutSource = this.layout ? this.layout.source : undefined;\n const isSharedLayoutAnimation = snapshotSource !== layoutSource;\n const stack = this.getStack();\n const isOnlyMember = !stack || stack.members.length <= 1;\n const shouldCrossfadeOpacity = Boolean(isSharedLayoutAnimation &&\n !isOnlyMember &&\n this.options.crossfade === true &&\n !this.path.some(hasOpacityCrossfade));\n this.animationProgress = 0;\n let prevRelativeTarget;\n // The path decides whether the layout shift is worth curving\n // (distance floor) and resolves the interpolator from the delta.\n const interpolate = pathFn?.interpolateProjection(delta);\n this.mixTargetDelta = (latest) => {\n const progress = latest / 1000;\n const point = interpolate?.(progress);\n if (point) {\n targetDelta.x.translate = point.x;\n targetDelta.x.scale = mixNumber(delta.x.scale, 1, progress);\n targetDelta.x.origin = delta.x.origin;\n targetDelta.x.originPoint = delta.x.originPoint;\n targetDelta.y.translate = point.y;\n targetDelta.y.scale = mixNumber(delta.y.scale, 1, progress);\n targetDelta.y.origin = delta.y.origin;\n targetDelta.y.originPoint = delta.y.originPoint;\n }\n else {\n mixAxisDeltaLinear(targetDelta.x, delta.x, progress);\n mixAxisDeltaLinear(targetDelta.y, delta.y, progress);\n }\n this.setTargetDelta(targetDelta);\n if (this.relativeTarget &&\n this.relativeTargetOrigin &&\n this.layout &&\n this.relativeParent &&\n this.relativeParent.layout) {\n calcRelativePosition(relativeLayout, this.layout.layoutBox, this.relativeParent.layout.layoutBox, this.options.layoutAnchor || undefined);\n mixBox(this.relativeTarget, this.relativeTargetOrigin, relativeLayout, progress);\n /**\n * If this is an unchanged relative target we can consider the\n * projection not dirty.\n */\n if (prevRelativeTarget &&\n boxEquals(this.relativeTarget, prevRelativeTarget)) {\n this.isProjectionDirty = false;\n }\n if (!prevRelativeTarget)\n prevRelativeTarget = createBox();\n copyBoxInto(prevRelativeTarget, this.relativeTarget);\n }\n if (isSharedLayoutAnimation) {\n this.animationValues = mixedValues;\n mixValues(mixedValues, snapshotLatestValues, this.latestValues, progress, shouldCrossfadeOpacity, isOnlyMember);\n }\n if (point && point.rotate !== undefined) {\n // Dedicated `pathRotation` channel, not `rotate`, so an\n // animating `rotate` is composed with, never clobbered.\n if (!this.animationValues)\n this.animationValues = mixedValues;\n this.animationValues.pathRotation = point.rotate;\n }\n this.root.scheduleUpdateProjection();\n this.scheduleRender();\n this.animationProgress = progress;\n };\n this.mixTargetDelta(this.options.layoutRoot ? 1000 : 0);\n }\n startAnimation(options) {\n this.notifyListeners(\"animationStart\");\n this.currentAnimation?.stop();\n this.resumingFrom?.currentAnimation?.stop();\n if (this.pendingAnimation) {\n cancelFrame(this.pendingAnimation);\n this.pendingAnimation = undefined;\n }\n /**\n * Start the animation in the next frame to have a frame with progress 0,\n * where the target is the same as when the animation started, so we can\n * calculate the relative positions correctly for instant transitions.\n */\n this.pendingAnimation = frame.update(() => {\n globalProjectionState.hasAnimatedSinceResize = true;\n this.motionValue || (this.motionValue = motionValue(0));\n this.motionValue.jump(0, false);\n this.currentAnimation = animateSingleValue(this.motionValue, [0, 1000], {\n ...options,\n velocity: 0,\n isSync: true,\n onUpdate: (latest) => {\n this.mixTargetDelta(latest);\n options.onUpdate && options.onUpdate(latest);\n },\n onComplete: () => {\n options.onComplete && options.onComplete();\n this.completeAnimation();\n },\n });\n if (this.resumingFrom) {\n this.resumingFrom.currentAnimation = this.currentAnimation;\n }\n this.pendingAnimation = undefined;\n });\n }\n completeAnimation() {\n if (this.resumingFrom) {\n this.resumingFrom.currentAnimation = undefined;\n this.resumingFrom.preserveOpacity = undefined;\n }\n const stack = this.getStack();\n stack && stack.exitAnimationComplete();\n this.resumingFrom =\n this.currentAnimation =\n this.animationValues =\n undefined;\n this.notifyListeners(\"animationComplete\");\n }\n finishAnimation() {\n if (this.currentAnimation) {\n this.mixTargetDelta && this.mixTargetDelta(animationTarget);\n this.currentAnimation.stop();\n }\n this.completeAnimation();\n }\n applyTransformsToTarget() {\n const lead = this.getLead();\n let { targetWithTransforms, target, layout, latestValues } = lead;\n if (!targetWithTransforms || !target || !layout)\n return;\n /**\n * If we're only animating position, and this element isn't the lead element,\n * then instead of projecting into the lead box we instead want to calculate\n * a new target that aligns the two boxes but maintains the layout shape.\n */\n if (this !== lead &&\n this.layout &&\n layout &&\n shouldAnimatePositionOnly(this.options.animationType, this.layout.layoutBox, layout.layoutBox)) {\n target = this.target || createBox();\n const xLength = calcLength(this.layout.layoutBox.x);\n target.x.min = lead.target.x.min;\n target.x.max = target.x.min + xLength;\n const yLength = calcLength(this.layout.layoutBox.y);\n target.y.min = lead.target.y.min;\n target.y.max = target.y.min + yLength;\n }\n copyBoxInto(targetWithTransforms, target);\n /**\n * Apply the latest user-set transforms to the targetBox to produce the targetBoxFinal.\n * This is the final box that we will then project into by calculating a transform delta and\n * applying it to the corrected box.\n */\n transformBox(targetWithTransforms, latestValues);\n /**\n * Update the delta between the corrected box and the final target box, after\n * user-set transforms are applied to it. This will be used by the renderer to\n * create a transform style that will reproject the element from its layout layout\n * into the desired bounding box.\n */\n calcBoxDelta(this.projectionDeltaWithTransform, this.layoutCorrected, targetWithTransforms, latestValues);\n }\n registerSharedNode(layoutId, node) {\n if (!this.sharedNodes.has(layoutId)) {\n this.sharedNodes.set(layoutId, new NodeStack());\n }\n const stack = this.sharedNodes.get(layoutId);\n stack.add(node);\n const config = node.options.initialPromotionConfig;\n node.promote({\n transition: config ? config.transition : undefined,\n preserveFollowOpacity: config && config.shouldPreserveFollowOpacity\n ? config.shouldPreserveFollowOpacity(node)\n : undefined,\n });\n }\n isLead() {\n const stack = this.getStack();\n return stack ? stack.lead === this : true;\n }\n getLead() {\n const { layoutId } = this.options;\n return layoutId ? this.getStack()?.lead || this : this;\n }\n getPrevLead() {\n const { layoutId } = this.options;\n return layoutId ? this.getStack()?.prevLead : undefined;\n }\n getStack() {\n const { layoutId } = this.options;\n if (layoutId)\n return this.root.sharedNodes.get(layoutId);\n }\n promote({ needsReset, transition, preserveFollowOpacity, } = {}) {\n const stack = this.getStack();\n if (stack)\n stack.promote(this, preserveFollowOpacity);\n if (needsReset) {\n this.projectionDelta = undefined;\n this.needsReset = true;\n }\n if (transition)\n this.setOptions({ transition });\n }\n relegate() {\n const stack = this.getStack();\n if (stack) {\n return stack.relegate(this);\n }\n else {\n return false;\n }\n }\n resetSkewAndRotation() {\n const { visualElement } = this.options;\n if (!visualElement)\n return;\n // If there's no detected skew or rotation values, we can early return without a forced render.\n let hasDistortingTransform = false;\n /**\n * An unrolled check for rotation values. Most elements don't have any rotation and\n * skipping the nested loop and new object creation is 50% faster.\n */\n const { latestValues } = visualElement;\n if (latestValues.z ||\n latestValues.rotate ||\n latestValues.rotateX ||\n latestValues.rotateY ||\n latestValues.rotateZ ||\n latestValues.skewX ||\n latestValues.skewY) {\n hasDistortingTransform = true;\n }\n // If there's no distorting values, we don't need to do any more.\n if (!hasDistortingTransform)\n return;\n const resetValues = {};\n if (latestValues.z) {\n resetDistortingTransform(\"z\", visualElement, resetValues, this.animationValues);\n }\n // Check the skew and rotate value of all axes and reset to 0\n for (let i = 0; i < transformAxes.length; i++) {\n resetDistortingTransform(`rotate${transformAxes[i]}`, visualElement, resetValues, this.animationValues);\n resetDistortingTransform(`skew${transformAxes[i]}`, visualElement, resetValues, this.animationValues);\n }\n // Force a render of this element to apply the transform with all skews and rotations\n // set to 0.\n visualElement.render();\n // Put back all the values we reset\n for (const key in resetValues) {\n visualElement.setStaticValue(key, resetValues[key]);\n if (this.animationValues) {\n this.animationValues[key] = resetValues[key];\n }\n }\n // Schedule a render for the next frame. This ensures we won't visually\n // see the element with the reset rotate value applied.\n visualElement.scheduleRender();\n }\n applyProjectionStyles(targetStyle, // CSSStyleDeclaration - doesn't allow numbers to be assigned to properties\n styleProp) {\n if (!this.instance || this.isSVG)\n return;\n if (!this.isVisible) {\n targetStyle.visibility = \"hidden\";\n return;\n }\n const transformTemplate = this.getTransformTemplate();\n if (this.needsReset) {\n this.needsReset = false;\n targetStyle.visibility = \"\";\n targetStyle.opacity = \"\";\n targetStyle.pointerEvents =\n resolveMotionValue(styleProp?.pointerEvents) || \"\";\n targetStyle.transform = transformTemplate\n ? transformTemplate(this.latestValues, \"\")\n : \"none\";\n return;\n }\n const lead = this.getLead();\n if (!this.projectionDelta || !this.layout || !lead.target) {\n if (this.options.layoutId) {\n targetStyle.opacity =\n this.latestValues.opacity !== undefined\n ? this.latestValues.opacity\n : 1;\n targetStyle.pointerEvents =\n resolveMotionValue(styleProp?.pointerEvents) || \"\";\n }\n if (this.hasProjected && !hasTransform(this.latestValues)) {\n targetStyle.transform = transformTemplate\n ? transformTemplate({}, \"\")\n : \"none\";\n this.hasProjected = false;\n }\n return;\n }\n targetStyle.visibility = \"\";\n const valuesToRender = lead.animationValues || lead.latestValues;\n this.applyTransformsToTarget();\n let transform = buildProjectionTransform(this.projectionDeltaWithTransform, this.treeScale, valuesToRender);\n if (transformTemplate) {\n transform = transformTemplate(valuesToRender, transform);\n }\n targetStyle.transform = transform;\n const { x, y } = this.projectionDelta;\n targetStyle.transformOrigin = `${x.origin * 100}% ${y.origin * 100}% 0`;\n if (lead.animationValues) {\n /**\n * If the lead component is animating, assign this either the entering/leaving\n * opacity\n */\n targetStyle.opacity =\n lead === this\n ? valuesToRender.opacity ??\n this.latestValues.opacity ??\n 1\n : this.preserveOpacity\n ? this.latestValues.opacity\n : valuesToRender.opacityExit;\n }\n else {\n /**\n * Or we're not animating at all, set the lead component to its layout\n * opacity and other components to hidden.\n */\n targetStyle.opacity =\n lead === this\n ? valuesToRender.opacity !== undefined\n ? valuesToRender.opacity\n : \"\"\n : valuesToRender.opacityExit !== undefined\n ? valuesToRender.opacityExit\n : 0;\n }\n /**\n * Apply scale correction\n */\n for (const key in scaleCorrectors) {\n if (valuesToRender[key] === undefined)\n continue;\n const { correct, applyTo, isCSSVariable } = scaleCorrectors[key];\n /**\n * Only apply scale correction to the value if we have an\n * active projection transform. Otherwise these values become\n * vulnerable to distortion if the element changes size without\n * a corresponding layout animation.\n */\n const corrected = transform === \"none\"\n ? valuesToRender[key]\n : correct(valuesToRender[key], lead);\n if (applyTo) {\n const num = applyTo.length;\n for (let i = 0; i < num; i++) {\n targetStyle[applyTo[i]] = corrected;\n }\n }\n else {\n // If this is a CSS variable, set it directly on the instance.\n // Replacing this function from creating styles to setting them\n // would be a good place to remove per frame object creation\n if (isCSSVariable) {\n this.options.visualElement.renderState.vars[key] = corrected;\n }\n else {\n targetStyle[key] = corrected;\n }\n }\n }\n /**\n * Disable pointer events on follow components. This is to ensure\n * that if a follow component covers a lead component it doesn't block\n * pointer events on the lead.\n */\n if (this.options.layoutId) {\n targetStyle.pointerEvents =\n lead === this\n ? resolveMotionValue(styleProp?.pointerEvents) || \"\"\n : \"none\";\n }\n }\n clearSnapshot() {\n this.resumeFrom = this.snapshot = undefined;\n }\n // Only run on root\n resetTree() {\n this.root.nodes.forEach((node) => node.currentAnimation?.stop());\n this.root.nodes.forEach(clearMeasurements);\n this.root.sharedNodes.clear();\n }\n };\n}\nfunction updateLayout(node) {\n node.updateLayout();\n}\nfunction notifyLayoutUpdate(node) {\n const snapshot = node.resumeFrom?.snapshot || node.snapshot;\n if (node.isLead() &&\n node.layout &&\n snapshot &&\n node.hasListeners(\"didUpdate\")) {\n const { layoutBox: layout, measuredBox: measuredLayout } = node.layout;\n const { animationType } = node.options;\n const isShared = snapshot.source !== node.layout.source;\n // TODO Maybe we want to also resize the layout snapshot so we don't trigger\n // animations for instance if layout=\"size\" and an element has only changed position\n if (animationType === \"size\") {\n eachAxis((axis) => {\n const axisSnapshot = isShared\n ? snapshot.measuredBox[axis]\n : snapshot.layoutBox[axis];\n const length = calcLength(axisSnapshot);\n axisSnapshot.min = layout[axis].min;\n axisSnapshot.max = axisSnapshot.min + length;\n });\n }\n else if (animationType === \"x\" || animationType === \"y\") {\n const snapAxis = animationType === \"x\" ? \"y\" : \"x\";\n copyAxisInto(isShared\n ? snapshot.measuredBox[snapAxis]\n : snapshot.layoutBox[snapAxis], layout[snapAxis]);\n }\n else if (shouldAnimatePositionOnly(animationType, snapshot.layoutBox, layout)) {\n eachAxis((axis) => {\n const axisSnapshot = isShared\n ? snapshot.measuredBox[axis]\n : snapshot.layoutBox[axis];\n const length = calcLength(layout[axis]);\n axisSnapshot.max = axisSnapshot.min + length;\n /**\n * Ensure relative target gets resized and rerendererd\n */\n if (node.relativeTarget && !node.currentAnimation) {\n node.isProjectionDirty = true;\n node.relativeTarget[axis].max =\n node.relativeTarget[axis].min + length;\n }\n });\n }\n const layoutDelta = createDelta();\n calcBoxDelta(layoutDelta, layout, snapshot.layoutBox);\n const visualDelta = createDelta();\n if (isShared) {\n calcBoxDelta(visualDelta, node.applyTransform(measuredLayout, true), snapshot.measuredBox);\n }\n else {\n calcBoxDelta(visualDelta, layout, snapshot.layoutBox);\n }\n const hasLayoutChanged = !isDeltaZero(layoutDelta);\n let hasRelativeLayoutChanged = false;\n if (!node.resumeFrom) {\n const relativeParent = node.getClosestProjectingParent();\n /**\n * If the relativeParent is itself resuming from a different element then\n * the relative snapshot is not relavent\n */\n if (relativeParent && !relativeParent.resumeFrom) {\n const { snapshot: parentSnapshot, layout: parentLayout } = relativeParent;\n if (parentSnapshot && parentLayout) {\n const anchor = node.options.layoutAnchor || undefined;\n const relativeSnapshot = createBox();\n calcRelativePosition(relativeSnapshot, snapshot.layoutBox, parentSnapshot.layoutBox, anchor);\n const relativeLayout = createBox();\n calcRelativePosition(relativeLayout, layout, parentLayout.layoutBox, anchor);\n if (!boxEqualsRounded(relativeSnapshot, relativeLayout)) {\n hasRelativeLayoutChanged = true;\n }\n if (relativeParent.options.layoutRoot) {\n node.relativeTarget = relativeLayout;\n node.relativeTargetOrigin = relativeSnapshot;\n node.relativeParent = relativeParent;\n }\n }\n }\n }\n node.notifyListeners(\"didUpdate\", {\n layout,\n snapshot,\n delta: visualDelta,\n layoutDelta,\n hasLayoutChanged,\n hasRelativeLayoutChanged,\n });\n }\n else if (node.isLead()) {\n const { onExitComplete } = node.options;\n onExitComplete && onExitComplete();\n }\n /**\n * Clearing transition\n * TODO: Investigate why this transition is being passed in as {type: false } from Framer\n * and why we need it at all\n */\n node.options.transition = undefined;\n}\nfunction propagateDirtyNodes(node) {\n /**\n * Increase debug counter for nodes encountered this frame\n */\n if (statsBuffer.value) {\n metrics.nodes++;\n }\n if (!node.parent)\n return;\n /**\n * If this node isn't projecting, propagate isProjectionDirty. It will have\n * no performance impact but it will allow the next child that *is* projecting\n * but *isn't* dirty to just check its parent to see if *any* ancestor needs\n * correcting.\n */\n if (!node.isProjecting()) {\n node.isProjectionDirty = node.parent.isProjectionDirty;\n }\n /**\n * Propagate isSharedProjectionDirty and isTransformDirty\n * throughout the whole tree. A future revision can take another look at\n * this but for safety we still recalcualte shared nodes.\n */\n node.isSharedProjectionDirty || (node.isSharedProjectionDirty = Boolean(node.isProjectionDirty ||\n node.parent.isProjectionDirty ||\n node.parent.isSharedProjectionDirty));\n node.isTransformDirty || (node.isTransformDirty = node.parent.isTransformDirty);\n}\nfunction cleanDirtyNodes(node) {\n node.isProjectionDirty =\n node.isSharedProjectionDirty =\n node.isTransformDirty =\n false;\n}\nfunction clearSnapshot(node) {\n node.clearSnapshot();\n}\nfunction clearMeasurements(node) {\n node.clearMeasurements();\n}\nfunction forceLayoutMeasure(node) {\n node.isLayoutDirty = true;\n node.updateLayout();\n}\nfunction clearIsLayoutDirty(node) {\n node.isLayoutDirty = false;\n}\n/**\n * When a node is animation-blocked (e.g. during drag) and its component\n * didn't re-render (memoized), willUpdate() is never called so there's\n * no snapshot. Use the previous layout as a snapshot and mark dirty so\n * resetTransform/updateLayout/notifyLayoutUpdate process it normally.\n */\nfunction ensureDraggedNodesSnapshotted(node) {\n if (node.isAnimationBlocked && node.layout && !node.isLayoutDirty) {\n node.snapshot = node.layout;\n node.isLayoutDirty = true;\n }\n}\nfunction resetTransformStyle(node) {\n const { visualElement } = node.options;\n if (visualElement && visualElement.getProps().onBeforeLayoutMeasure) {\n visualElement.notify(\"BeforeLayoutMeasure\");\n }\n node.resetTransform();\n}\nfunction finishAnimation(node) {\n node.finishAnimation();\n node.targetDelta = node.relativeTarget = node.target = undefined;\n node.isProjectionDirty = true;\n}\nfunction resolveTargetDelta(node) {\n node.resolveTargetDelta();\n}\nfunction calcProjection(node) {\n node.calcProjection();\n}\nfunction resetSkewAndRotation(node) {\n node.resetSkewAndRotation();\n}\nfunction removeLeadSnapshots(stack) {\n stack.removeLeadSnapshot();\n}\nfunction mixAxisDeltaLinear(output, delta, p) {\n output.translate = mixNumber(delta.translate, 0, p);\n output.scale = mixNumber(delta.scale, 1, p);\n output.origin = delta.origin;\n output.originPoint = delta.originPoint;\n}\nfunction mixAxis(output, from, to, p) {\n output.min = mixNumber(from.min, to.min, p);\n output.max = mixNumber(from.max, to.max, p);\n}\nfunction mixBox(output, from, to, p) {\n mixAxis(output.x, from.x, to.x, p);\n mixAxis(output.y, from.y, to.y, p);\n}\nfunction hasOpacityCrossfade(node) {\n return (node.animationValues && node.animationValues.opacityExit !== undefined);\n}\nconst defaultLayoutTransition = {\n duration: 0.45,\n ease: [0.4, 0, 0.1, 1],\n};\nconst userAgentContains = (string) => typeof navigator !== \"undefined\" &&\n navigator.userAgent &&\n navigator.userAgent.toLowerCase().includes(string);\n/**\n * Measured bounding boxes must be rounded in Safari and\n * left untouched in Chrome, otherwise non-integer layouts within scaled-up elements\n * can appear to jump.\n */\nconst roundPoint = userAgentContains(\"applewebkit/\") && !userAgentContains(\"chrome/\")\n ? Math.round\n : noop;\nfunction roundAxis(axis) {\n // Round to the nearest .5 pixels to support subpixel layouts\n axis.min = roundPoint(axis.min);\n axis.max = roundPoint(axis.max);\n}\nfunction roundBox(box) {\n roundAxis(box.x);\n roundAxis(box.y);\n}\nfunction shouldAnimatePositionOnly(animationType, snapshot, layout) {\n return (animationType === \"position\" ||\n (animationType === \"preserve-aspect\" &&\n !isNear(aspectRatio(snapshot), aspectRatio(layout), 0.2)));\n}\nfunction checkNodeWasScrollRoot(node) {\n return node !== node.root && node.scroll?.wasRoot;\n}\n\nexport { cleanDirtyNodes, createProjectionNode, mixAxis, mixBox, propagateDirtyNodes };\n//# sourceMappingURL=create-projection-node.mjs.map\n","import { isSVGElement } from './is-svg-element.mjs';\n\n/**\n * Checks if an element is specifically an SVGSVGElement (the root SVG element)\n * in a way that works across iframes\n */\nfunction isSVGSVGElement(element) {\n return isSVGElement(element) && element.tagName === \"svg\";\n}\n\nexport { isSVGSVGElement };\n//# sourceMappingURL=is-svg-svg-element.mjs.map\n","import { time } from '../frameloop/sync-time.mjs';\nimport { secondsToMilliseconds } from 'motion-utils';\nimport { frame, cancelFrame } from '../frameloop/frame.mjs';\n\n/**\n * Timeout defined in ms\n */\nfunction delay(callback, timeout) {\n const start = time.now();\n const checkElapsed = ({ timestamp }) => {\n const elapsed = timestamp - start;\n if (elapsed >= timeout) {\n cancelFrame(checkElapsed);\n callback(elapsed - timeout);\n }\n };\n frame.setup(checkElapsed, true);\n return () => cancelFrame(checkElapsed);\n}\nfunction delayInSeconds(callback, timeout) {\n return delay(callback, secondsToMilliseconds(timeout));\n}\n\nexport { delay, delayInSeconds };\n//# sourceMappingURL=delay.mjs.map\n","import { animateMotionValue } from '../interfaces/motion-value.mjs';\nimport { motionValue } from '../../value/index.mjs';\nimport { isMotionValue } from '../../value/utils/is-motion-value.mjs';\n\nfunction animateSingleValue(value, keyframes, options) {\n const motionValue$1 = isMotionValue(value) ? value : motionValue(value);\n motionValue$1.start(animateMotionValue(\"\", motionValue$1, keyframes, options));\n return motionValue$1.animation;\n}\n\nexport { animateSingleValue };\n//# sourceMappingURL=single-value.mjs.map\n","function buildProjectionTransform(delta, treeScale, latestTransform) {\n let transform = \"\";\n /**\n * The translations we use to calculate are always relative to the viewport coordinate space.\n * But when we apply scales, we also scale the coordinate space of an element and its children.\n * For instance if we have a treeScale (the culmination of all parent scales) of 0.5 and we need\n * to move an element 100 pixels, we actually need to move it 200 in within that scaled space.\n */\n const xTranslate = delta.x.translate / treeScale.x;\n const yTranslate = delta.y.translate / treeScale.y;\n const zTranslate = latestTransform?.z || 0;\n if (xTranslate || yTranslate || zTranslate) {\n transform = `translate3d(${xTranslate}px, ${yTranslate}px, ${zTranslate}px) `;\n }\n /**\n * Apply scale correction for the tree transform.\n * This will apply scale to the screen-orientated axes.\n */\n if (treeScale.x !== 1 || treeScale.y !== 1) {\n transform += `scale(${1 / treeScale.x}, ${1 / treeScale.y}) `;\n }\n if (latestTransform) {\n const { transformPerspective, rotate, pathRotation, rotateX, rotateY, skewX, skewY, } = latestTransform;\n if (transformPerspective)\n transform = `perspective(${transformPerspective}px) ${transform}`;\n if (rotate)\n transform += `rotate(${rotate}deg) `;\n // Additive `rotate()` so user `rotate` isn't clobbered.\n if (pathRotation)\n transform += `rotate(${pathRotation}deg) `;\n if (rotateX)\n transform += `rotateX(${rotateX}deg) `;\n if (rotateY)\n transform += `rotateY(${rotateY}deg) `;\n if (skewX)\n transform += `skewX(${skewX}deg) `;\n if (skewY)\n transform += `skewY(${skewY}deg) `;\n }\n /**\n * Apply scale to match the size of the element to the size we want it.\n * This will apply scale to the element-orientated axes.\n */\n const elementScaleX = delta.x.scale * treeScale.x;\n const elementScaleY = delta.y.scale * treeScale.y;\n if (elementScaleX !== 1 || elementScaleY !== 1) {\n transform += `scale(${elementScaleX}, ${elementScaleY})`;\n }\n return transform || \"none\";\n}\n\nexport { buildProjectionTransform };\n//# sourceMappingURL=transform.mjs.map\n","import { addDomEvent } from '../../events/add-dom-event.mjs';\nimport { createProjectionNode } from './create-projection-node.mjs';\n\nconst DocumentProjectionNode = createProjectionNode({\n attachResizeListener: (ref, notify) => addDomEvent(ref, \"resize\", notify),\n measureScroll: () => ({\n x: document.documentElement.scrollLeft || document.body?.scrollLeft || 0,\n y: document.documentElement.scrollTop || document.body?.scrollTop || 0,\n }),\n checkIsScrollRoot: () => true,\n});\n\nexport { DocumentProjectionNode };\n//# sourceMappingURL=DocumentProjectionNode.mjs.map\n","import { createProjectionNode } from './create-projection-node.mjs';\nimport { DocumentProjectionNode } from './DocumentProjectionNode.mjs';\n\nconst rootProjectionNode = {\n current: undefined,\n};\nconst HTMLProjectionNode = createProjectionNode({\n measureScroll: (instance) => ({\n x: instance.scrollLeft,\n y: instance.scrollTop,\n }),\n defaultParent: () => {\n if (!rootProjectionNode.current) {\n const documentNode = new DocumentProjectionNode({});\n documentNode.mount(window);\n documentNode.setOptions({ layoutScroll: true });\n rootProjectionNode.current = documentNode;\n }\n return rootProjectionNode.current;\n },\n resetTransform: (instance, value) => {\n instance.style.transform = value !== undefined ? value : \"none\";\n },\n checkIsScrollRoot: (instance) => Boolean(window.getComputedStyle(instance).position === \"fixed\"),\n});\n\nexport { HTMLProjectionNode, rootProjectionNode };\n//# sourceMappingURL=HTMLProjectionNode.mjs.map\n","\"use client\";\nimport { useContext, useMemo } from \"react\";\nimport { MotionContext } from \".\";\nimport { getCurrentTreeVariants } from \"./utils\";\nexport function useCreateMotionContext(props) {\n const { initial, animate } = getCurrentTreeVariants(props, useContext(MotionContext));\n return useMemo(() => ({ initial, animate }), [variantLabelsAsDependency(initial), variantLabelsAsDependency(animate)]);\n}\nfunction variantLabelsAsDependency(prop) {\n return Array.isArray(prop) ? prop.join(\" \") : prop;\n}\n//# sourceMappingURL=create.js.map","import { isControllingVariants, isVariantLabel } from \"motion-dom\";\nexport function getCurrentTreeVariants(props, context) {\n if (isControllingVariants(props)) {\n const { initial, animate } = props;\n return {\n initial: initial === false || isVariantLabel(initial)\n ? initial\n : undefined,\n animate: isVariantLabel(animate) ? animate : undefined,\n };\n }\n return props.inherit !== false ? context : {};\n}\n//# sourceMappingURL=utils.js.map","export const createHtmlRenderState = () => ({\n style: {},\n transform: {},\n transformOrigin: {},\n vars: {},\n});\n//# sourceMappingURL=create-render-state.js.map","\"use client\";\nimport { buildHTMLStyles, isForcedMotionValue, isMotionValue } from \"motion-dom\";\nimport { useMemo } from \"react\";\nimport { createHtmlRenderState } from \"./utils/create-render-state\";\nexport function copyRawValuesOnly(target, source, props) {\n for (const key in source) {\n if (!isMotionValue(source[key]) && !isForcedMotionValue(key, props)) {\n target[key] = source[key];\n }\n }\n}\nfunction useInitialMotionValues({ transformTemplate }, visualState) {\n return useMemo(() => {\n const state = createHtmlRenderState();\n buildHTMLStyles(state, visualState, transformTemplate);\n return Object.assign({}, state.vars, state.style);\n }, [visualState]);\n}\nfunction useStyle(props, visualState) {\n const styleProp = props.style || {};\n const style = {};\n /**\n * Copy non-Motion Values straight into style\n */\n copyRawValuesOnly(style, styleProp, props);\n Object.assign(style, useInitialMotionValues(props, visualState));\n return style;\n}\nexport function useHTMLProps(props, visualState) {\n // The `any` isn't ideal but it is the type of createElement props argument\n const htmlProps = {};\n const style = useStyle(props, visualState);\n if (props.drag && props.dragListener !== false) {\n // Disable the ghost element when a user drags\n htmlProps.draggable = false;\n // Disable text selection\n style.userSelect =\n style.WebkitUserSelect =\n style.WebkitTouchCallout =\n \"none\";\n // Disable scrolling on the draggable direction\n style.touchAction =\n props.drag === true\n ? \"none\"\n : `pan-${props.drag === \"x\" ? \"y\" : \"x\"}`;\n }\n if (props.tabIndex === undefined &&\n (props.onTap || props.onTapStart || props.whileTap)) {\n htmlProps.tabIndex = 0;\n }\n htmlProps.style = style;\n return htmlProps;\n}\n//# sourceMappingURL=use-props.js.map","import { createHtmlRenderState } from \"../../html/utils/create-render-state\";\nexport const createSvgRenderState = () => ({\n ...createHtmlRenderState(),\n attrs: {},\n});\n//# sourceMappingURL=create-render-state.js.map","\"use client\";\nimport { buildSVGAttrs, isSVGTag } from \"motion-dom\";\nimport { useMemo } from \"react\";\nimport { copyRawValuesOnly } from \"../html/use-props\";\nimport { createSvgRenderState } from \"./utils/create-render-state\";\nexport function useSVGProps(props, visualState, _isStatic, Component) {\n const visualProps = useMemo(() => {\n const state = createSvgRenderState();\n buildSVGAttrs(state, visualState, isSVGTag(Component), props.transformTemplate, props.style);\n return {\n ...state.attrs,\n style: { ...state.style },\n };\n }, [visualState]);\n if (props.style) {\n const rawStyles = {};\n copyRawValuesOnly(rawStyles, props.style, props);\n visualProps.style = { ...rawStyles, ...visualProps.style };\n }\n return visualProps;\n}\n//# sourceMappingURL=use-props.js.map","/**\n * A list of all valid MotionProps.\n *\n * @privateRemarks\n * This doesn't throw if a `MotionProp` name is missing - it should.\n */\nconst validMotionProps = new Set([\n \"animate\",\n \"exit\",\n \"variants\",\n \"initial\",\n \"style\",\n \"values\",\n \"variants\",\n \"transition\",\n \"transformTemplate\",\n \"custom\",\n \"inherit\",\n \"onBeforeLayoutMeasure\",\n \"onAnimationStart\",\n \"onAnimationComplete\",\n \"onUpdate\",\n \"onDragStart\",\n \"onDrag\",\n \"onDragEnd\",\n \"onMeasureDragConstraints\",\n \"onDirectionLock\",\n \"onDragTransitionEnd\",\n \"_dragX\",\n \"_dragY\",\n \"onHoverStart\",\n \"onHoverEnd\",\n \"onViewportEnter\",\n \"onViewportLeave\",\n \"globalTapTarget\",\n \"propagate\",\n \"ignoreStrict\",\n \"viewport\",\n]);\n/**\n * Check whether a prop name is a valid `MotionProp` key.\n *\n * @param key - Name of the property to check\n * @returns `true` is key is a valid `MotionProp`.\n *\n * @public\n */\nexport function isValidMotionProp(key) {\n return (key.startsWith(\"while\") ||\n (key.startsWith(\"drag\") && key !== \"draggable\") ||\n key.startsWith(\"layout\") ||\n key.startsWith(\"onTap\") ||\n key.startsWith(\"onPan\") ||\n key.startsWith(\"onLayout\") ||\n validMotionProps.has(key));\n}\n//# sourceMappingURL=valid-prop.js.map","import { isMotionValue } from \"motion-dom\";\nimport { isValidMotionProp } from \"../../../motion/utils/valid-prop\";\nfunction shouldForward(key, isValidProp) {\n return key.startsWith(\"on\")\n ? !isValidMotionProp(key)\n : isValidProp?.(key) ?? !isValidMotionProp(key);\n}\nexport function filterProps(props, isDom, forwardMotionProps, isValidProp) {\n const filteredProps = {};\n for (const key in props) {\n /**\n * values is considered a valid prop by Emotion, so if it's present\n * this will be rendered out to the DOM unless explicitly filtered.\n *\n * We check the type as it could be used with the `feColorMatrix`\n * element, which we support.\n */\n if (key === \"values\" && typeof props.values === \"object\")\n continue;\n if (isMotionValue(props[key]))\n continue;\n if (shouldForward(key, isValidProp) ||\n (forwardMotionProps === true && isValidMotionProp(key)) ||\n (!isDom && !isValidMotionProp(key)) ||\n // If trying to use native HTML drag events, forward drag listeners\n (props[\"draggable\"] &&\n key.startsWith(\"onDrag\"))) {\n filteredProps[key] =\n props[key];\n }\n }\n return filteredProps;\n}\n//# sourceMappingURL=filter-props.js.map","/**\n * We keep these listed separately as we use the lowercase tag names as part\n * of the runtime bundle to detect SVG components\n */\nexport const lowercaseSVGElements = [\n \"animate\",\n \"circle\",\n \"defs\",\n \"desc\",\n \"ellipse\",\n \"g\",\n \"image\",\n \"line\",\n \"filter\",\n \"marker\",\n \"mask\",\n \"metadata\",\n \"path\",\n \"pattern\",\n \"polygon\",\n \"polyline\",\n \"rect\",\n \"stop\",\n \"switch\",\n \"symbol\",\n \"svg\",\n \"text\",\n \"tspan\",\n \"use\",\n \"view\",\n];\n//# sourceMappingURL=lowercase-elements.js.map","import { lowercaseSVGElements } from \"../../svg/lowercase-elements\";\nexport function isSVGComponent(Component) {\n if (\n /**\n * If it's not a string, it's a custom React component. Currently we only support\n * HTML custom React components.\n */\n typeof Component !== \"string\" ||\n /**\n * If it contains a dash, the element is a custom HTML webcomponent.\n */\n Component.includes(\"-\")) {\n return false;\n }\n else if (\n /**\n * If it's in our list of lowercase SVG tags, it's an SVG component\n */\n lowercaseSVGElements.indexOf(Component) > -1 ||\n /**\n * If it contains a capital letter, it's an SVG component\n */\n /[A-Z]/u.test(Component)) {\n return true;\n }\n return false;\n}\n//# sourceMappingURL=is-svg-component.js.map","\"use client\";\nimport { isMotionValue } from \"motion-dom\";\nimport { Fragment, createElement, useMemo } from \"react\";\nimport { useHTMLProps } from \"../html/use-props\";\nimport { useSVGProps } from \"../svg/use-props\";\nimport { filterProps } from \"./utils/filter-props\";\nimport { isSVGComponent } from \"./utils/is-svg-component\";\nexport function useRender(Component, props, ref, { latestValues, }, isStatic, forwardMotionProps = false, isSVG, isValidProp) {\n const useVisualProps = (isSVG ?? isSVGComponent(Component)) ? useSVGProps : useHTMLProps;\n const visualProps = useVisualProps(props, latestValues, isStatic, Component);\n const filteredProps = filterProps(props, typeof Component === \"string\", forwardMotionProps, isValidProp);\n const elementProps = Component !== Fragment ? { ...filteredProps, ...visualProps, ref } : {};\n /**\n * If component has been handed a motion value as its child,\n * memoise its initial value and render that. Subsequent updates\n * will be handled by the onChange handler\n */\n const { children } = props;\n const renderedChildren = useMemo(() => (isMotionValue(children) ? children.get() : children), [children]);\n return createElement(Component, {\n ...elementProps,\n children: renderedChildren,\n });\n}\n//# sourceMappingURL=use-render.js.map","\"use client\";\nimport { createContext } from \"react\";\n/**\n * @public\n */\nexport const PresenceContext = \n/* @__PURE__ */ createContext(null);\n//# sourceMappingURL=PresenceContext.js.map","\"use client\";\nimport { isAnimationControls, isControllingVariants as checkIsControllingVariants, isVariantNode as checkIsVariantNode, resolveVariantFromProps, } from \"motion-dom\";\nimport { useContext } from \"react\";\nimport { MotionContext } from \"../../context/MotionContext\";\nimport { PresenceContext, } from \"../../context/PresenceContext\";\nimport { useConstant } from \"../../utils/use-constant\";\nimport { resolveMotionValue } from \"motion-dom\";\nfunction makeState({ scrapeMotionValuesFromProps, createRenderState, }, props, context, presenceContext) {\n const state = {\n latestValues: makeLatestValues(props, context, presenceContext, scrapeMotionValuesFromProps),\n renderState: createRenderState(),\n };\n return state;\n}\nfunction makeLatestValues(props, context, presenceContext, scrapeMotionValues) {\n const values = {};\n const motionValues = scrapeMotionValues(props, {});\n for (const key in motionValues) {\n values[key] = resolveMotionValue(motionValues[key]);\n }\n let { initial, animate } = props;\n const isControllingVariants = checkIsControllingVariants(props);\n const isVariantNode = checkIsVariantNode(props);\n if (context &&\n isVariantNode &&\n !isControllingVariants &&\n props.inherit !== false) {\n if (initial === undefined)\n initial = context.initial;\n if (animate === undefined)\n animate = context.animate;\n }\n let isInitialAnimationBlocked = presenceContext\n ? presenceContext.initial === false\n : false;\n isInitialAnimationBlocked = isInitialAnimationBlocked || initial === false;\n const variantToSet = isInitialAnimationBlocked ? animate : initial;\n if (variantToSet &&\n typeof variantToSet !== \"boolean\" &&\n !isAnimationControls(variantToSet)) {\n const list = Array.isArray(variantToSet) ? variantToSet : [variantToSet];\n for (let i = 0; i < list.length; i++) {\n const resolved = resolveVariantFromProps(props, list[i]);\n if (resolved) {\n const { transitionEnd, transition, ...target } = resolved;\n for (const key in target) {\n let valueTarget = target[key];\n if (Array.isArray(valueTarget)) {\n /**\n * Take final keyframe if the initial animation is blocked because\n * we want to initialise at the end of that blocked animation.\n */\n const index = isInitialAnimationBlocked\n ? valueTarget.length - 1\n : 0;\n valueTarget = valueTarget[index];\n }\n if (valueTarget !== null) {\n values[key] = valueTarget;\n }\n }\n for (const key in transitionEnd) {\n values[key] = transitionEnd[key];\n }\n }\n }\n }\n return values;\n}\nexport const makeUseVisualState = (config) => (props, isStatic) => {\n const context = useContext(MotionContext);\n const presenceContext = useContext(PresenceContext);\n const make = () => makeState(config, props, context, presenceContext);\n return isStatic ? make() : useConstant(make);\n};\n//# sourceMappingURL=use-visual-state.js.map","\"use client\";\nimport { useRef } from \"react\";\n/**\n * Creates a constant value over the lifecycle of a component.\n *\n * Even if `useMemo` is provided an empty array as its final argument, it doesn't offer\n * a guarantee that it won't re-run for performance reasons later on. By using `useConstant`\n * you can ensure that initialisers don't execute twice or more.\n */\nexport function useConstant(init) {\n const ref = useRef(null);\n if (ref.current === null) {\n ref.current = init();\n }\n return ref.current;\n}\n//# sourceMappingURL=use-constant.js.map","\"use client\";\nimport { scrapeHTMLMotionValuesFromProps } from \"motion-dom\";\nimport { makeUseVisualState } from \"../../motion/utils/use-visual-state\";\nimport { createHtmlRenderState } from \"./utils/create-render-state\";\nexport const useHTMLVisualState = /*@__PURE__*/ makeUseVisualState({\n scrapeMotionValuesFromProps: scrapeHTMLMotionValuesFromProps,\n createRenderState: createHtmlRenderState,\n});\n//# sourceMappingURL=use-html-visual-state.js.map","\"use client\";\nimport { scrapeSVGMotionValuesFromProps } from \"motion-dom\";\nimport { makeUseVisualState } from \"../../motion/utils/use-visual-state\";\nimport { createSvgRenderState } from \"./utils/create-render-state\";\nexport const useSVGVisualState = /*@__PURE__*/ makeUseVisualState({\n scrapeMotionValuesFromProps: scrapeSVGMotionValuesFromProps,\n createRenderState: createSvgRenderState,\n});\n//# sourceMappingURL=use-svg-visual-state.js.map","import { getFeatureDefinitions, setFeatureDefinitions } from \"motion-dom\";\nconst featureProps = {\n animation: [\n \"animate\",\n \"variants\",\n \"whileHover\",\n \"whileTap\",\n \"exit\",\n \"whileInView\",\n \"whileFocus\",\n \"whileDrag\",\n ],\n exit: [\"exit\"],\n drag: [\"drag\", \"dragControls\"],\n focus: [\"whileFocus\"],\n hover: [\"whileHover\", \"onHoverStart\", \"onHoverEnd\"],\n tap: [\"whileTap\", \"onTap\", \"onTapStart\", \"onTapCancel\"],\n pan: [\"onPan\", \"onPanStart\", \"onPanSessionStart\", \"onPanEnd\"],\n inView: [\"whileInView\", \"onViewportEnter\", \"onViewportLeave\"],\n layout: [\"layout\", \"layoutId\"],\n};\nlet isInitialized = false;\n/**\n * Initialize feature definitions with isEnabled checks.\n * This must be called before any motion components are rendered.\n */\nexport function initFeatureDefinitions() {\n if (isInitialized)\n return;\n const initialFeatureDefinitions = {};\n for (const key in featureProps) {\n initialFeatureDefinitions[key] = {\n isEnabled: (props) => featureProps[key].some((name) => !!props[name]),\n };\n }\n setFeatureDefinitions(initialFeatureDefinitions);\n isInitialized = true;\n}\n/**\n * Get the current feature definitions, initializing if needed.\n */\nexport function getInitializedFeatureDefinitions() {\n initFeatureDefinitions();\n return getFeatureDefinitions();\n}\n//# sourceMappingURL=definitions.js.map","export const motionComponentSymbol = Symbol.for(\"motionComponentSymbol\");\n//# sourceMappingURL=symbol.js.map","\"use client\";\nimport { useCallback, useInsertionEffect, useRef } from \"react\";\n/**\n * Creates a ref function that, when called, hydrates the provided\n * external ref and VisualElement.\n */\nexport function useMotionRef(visualState, visualElement, externalRef) {\n /**\n * Store externalRef in a ref to avoid including it in the useCallback\n * dependency array. Including externalRef in dependencies causes issues\n * with libraries like Radix UI that create new callback refs on each render\n * when using asChild - this would cause the callback to be recreated,\n * triggering element remounts and breaking AnimatePresence exit animations.\n */\n const externalRefContainer = useRef(externalRef);\n useInsertionEffect(() => {\n externalRefContainer.current = externalRef;\n });\n // Store cleanup function returned by callback refs (React 19 feature)\n const refCleanup = useRef(null);\n return useCallback((instance) => {\n if (instance) {\n visualState.onMount?.(instance);\n }\n if (visualElement) {\n instance ? visualElement.mount(instance) : visualElement.unmount();\n }\n const ref = externalRefContainer.current;\n if (typeof ref === \"function\") {\n if (instance) {\n const cleanup = ref(instance);\n if (typeof cleanup === \"function\") {\n refCleanup.current = cleanup;\n }\n }\n else if (refCleanup.current) {\n refCleanup.current();\n refCleanup.current = null;\n }\n else {\n ref(instance);\n }\n }\n else if (ref) {\n ;\n ref.current = instance;\n }\n }, [visualElement]);\n}\n//# sourceMappingURL=use-motion-ref.js.map","\"use client\";\nimport { createContext } from \"react\";\n/**\n * Internal, exported only for usage in Framer\n */\nexport const SwitchLayoutGroupContext = createContext({});\n//# sourceMappingURL=SwitchLayoutGroupContext.js.map","export function isRefObject(ref) {\n return (ref &&\n typeof ref === \"object\" &&\n Object.prototype.hasOwnProperty.call(ref, \"current\"));\n}\n//# sourceMappingURL=is-ref-object.js.map","export const isBrowser = typeof window !== \"undefined\";\n//# sourceMappingURL=is-browser.js.map","\"use client\";\nimport { useEffect, useLayoutEffect } from \"react\";\nimport { isBrowser } from \"./is-browser\";\nexport const useIsomorphicLayoutEffect = isBrowser ? useLayoutEffect : useEffect;\n//# sourceMappingURL=use-isomorphic-effect.js.map","\"use client\";\nimport { optimizedAppearDataAttribute, } from \"motion-dom\";\nimport { useContext, useEffect, useInsertionEffect, useRef } from \"react\";\nimport { LazyContext } from \"../../context/LazyContext\";\nimport { MotionConfigContext } from \"../../context/MotionConfigContext\";\nimport { MotionContext } from \"../../context/MotionContext\";\nimport { PresenceContext } from \"../../context/PresenceContext\";\nimport { SwitchLayoutGroupContext, } from \"../../context/SwitchLayoutGroupContext\";\nimport { isRefObject } from \"../../utils/is-ref-object\";\nimport { useIsomorphicLayoutEffect } from \"../../utils/use-isomorphic-effect\";\nexport function useVisualElement(Component, visualState, props, createVisualElement, ProjectionNodeConstructor, isSVG) {\n const { visualElement: parent } = useContext(MotionContext);\n const lazyContext = useContext(LazyContext);\n const presenceContext = useContext(PresenceContext);\n const motionConfig = useContext(MotionConfigContext);\n const reducedMotionConfig = motionConfig.reducedMotion;\n const skipAnimations = motionConfig.skipAnimations;\n const visualElementRef = useRef(null);\n /**\n * Track whether the component has been through React's commit phase.\n * Used to detect when LazyMotion features load after the component has mounted.\n */\n const hasMountedOnce = useRef(false);\n /**\n * If we haven't preloaded a renderer, check to see if we have one lazy-loaded\n */\n createVisualElement =\n createVisualElement ||\n lazyContext.renderer;\n if (!visualElementRef.current && createVisualElement) {\n visualElementRef.current = createVisualElement(Component, {\n visualState,\n parent,\n props,\n presenceContext,\n blockInitialAnimation: presenceContext\n ? presenceContext.initial === false\n : false,\n reducedMotionConfig,\n skipAnimations,\n isSVG,\n });\n /**\n * If the component has already mounted before features loaded (e.g. via\n * LazyMotion with async feature loading), we need to force the initial\n * animation to run. Otherwise state changes that occurred before features\n * loaded will be lost and the element will snap to its final state.\n */\n if (hasMountedOnce.current && visualElementRef.current) {\n visualElementRef.current.manuallyAnimateOnMount = true;\n }\n }\n const visualElement = visualElementRef.current;\n /**\n * Load Motion gesture and animation features. These are rendered as renderless\n * components so each feature can optionally make use of React lifecycle methods.\n */\n const initialLayoutGroupConfig = useContext(SwitchLayoutGroupContext);\n if (visualElement &&\n !visualElement.projection &&\n ProjectionNodeConstructor &&\n (visualElement.type === \"html\" || visualElement.type === \"svg\")) {\n createProjectionNode(visualElementRef.current, props, ProjectionNodeConstructor, initialLayoutGroupConfig);\n }\n const isMounted = useRef(false);\n useInsertionEffect(() => {\n /**\n * Check the component has already mounted before calling\n * `update` unnecessarily. This ensures we skip the initial update.\n */\n if (visualElement && isMounted.current) {\n visualElement.update(props, presenceContext);\n }\n });\n /**\n * Cache this value as we want to know whether HandoffAppearAnimations\n * was present on initial render - it will be deleted after this.\n */\n const optimisedAppearId = props[optimizedAppearDataAttribute];\n const wantsHandoff = useRef(Boolean(optimisedAppearId) &&\n typeof window !== \"undefined\" &&\n !window.MotionHandoffIsComplete?.(optimisedAppearId) &&\n window.MotionHasOptimisedAnimation?.(optimisedAppearId));\n useIsomorphicLayoutEffect(() => {\n /**\n * Track that this component has mounted. This is used to detect when\n * LazyMotion features load after the component has already committed.\n */\n hasMountedOnce.current = true;\n if (!visualElement)\n return;\n isMounted.current = true;\n window.MotionIsMounted = true;\n visualElement.updateFeatures();\n visualElement.scheduleRenderMicrotask();\n /**\n * Ideally this function would always run in a useEffect.\n *\n * However, if we have optimised appear animations to handoff from,\n * it needs to happen synchronously to ensure there's no flash of\n * incorrect styles in the event of a hydration error.\n *\n * So if we detect a situtation where optimised appear animations\n * are running, we use useLayoutEffect to trigger animations.\n */\n if (wantsHandoff.current && visualElement.animationState) {\n visualElement.animationState.animateChanges();\n }\n });\n useEffect(() => {\n if (!visualElement)\n return;\n if (!wantsHandoff.current && visualElement.animationState) {\n visualElement.animationState.animateChanges();\n }\n if (wantsHandoff.current) {\n // This ensures all future calls to animateChanges() in this component will run in useEffect\n queueMicrotask(() => {\n window.MotionHandoffMarkAsComplete?.(optimisedAppearId);\n });\n wantsHandoff.current = false;\n }\n /**\n * Now we've finished triggering animations for this element we\n * can wipe the enteringChildren set for the next render.\n */\n visualElement.enteringChildren = undefined;\n });\n return visualElement;\n}\nfunction createProjectionNode(visualElement, props, ProjectionNodeConstructor, initialPromotionConfig) {\n const { layoutId, layout, drag, dragConstraints, layoutScroll, layoutRoot, layoutAnchor, layoutCrossfade, } = props;\n visualElement.projection = new ProjectionNodeConstructor(visualElement.latestValues, props[\"data-framer-portal-id\"]\n ? undefined\n : getClosestProjectingNode(visualElement.parent));\n visualElement.projection.setOptions({\n layoutId,\n layout,\n alwaysMeasureLayout: Boolean(drag) || (dragConstraints && isRefObject(dragConstraints)),\n visualElement,\n /**\n * TODO: Update options in an effect. This could be tricky as it'll be too late\n * to update by the time layout animations run.\n * We also need to fix this safeToRemove by linking it up to the one returned by usePresence,\n * ensuring it gets called if there's no potential layout animations.\n *\n */\n animationType: typeof layout === \"string\" ? layout : \"both\",\n initialPromotionConfig,\n crossfade: layoutCrossfade,\n layoutScroll,\n layoutRoot,\n layoutAnchor,\n });\n}\nfunction getClosestProjectingNode(visualElement) {\n if (!visualElement)\n return undefined;\n return visualElement.options.allowProjection !== false\n ? visualElement.projection\n : getClosestProjectingNode(visualElement.parent);\n}\n//# sourceMappingURL=use-visual-element.js.map","\"use client\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { invariant, warning } from \"motion-utils\";\nimport { forwardRef, useContext } from \"react\";\nimport { LayoutGroupContext } from \"../context/LayoutGroupContext\";\nimport { LazyContext } from \"../context/LazyContext\";\nimport { MotionConfigContext } from \"../context/MotionConfigContext\";\nimport { MotionContext } from \"../context/MotionContext\";\nimport { useCreateMotionContext } from \"../context/MotionContext/create\";\nimport { useRender } from \"../render/dom/use-render\";\nimport { isSVGComponent } from \"../render/dom/utils/is-svg-component\";\nimport { useHTMLVisualState } from \"../render/html/use-html-visual-state\";\nimport { useSVGVisualState } from \"../render/svg/use-svg-visual-state\";\nimport { getInitializedFeatureDefinitions } from \"./features/definitions\";\nimport { loadFeatures } from \"./features/load-features\";\nimport { motionComponentSymbol } from \"./utils/symbol\";\nimport { useMotionRef } from \"./utils/use-motion-ref\";\nimport { useVisualElement } from \"./utils/use-visual-element\";\n/**\n * Create a `motion` component.\n *\n * This function accepts a Component argument, which can be either a string (ie \"div\"\n * for `motion.div`), or an actual React component.\n *\n * Alongside this is a config option which provides a way of rendering the provided\n * component \"offline\", or outside the React render cycle.\n */\nexport function createMotionComponent(Component, { forwardMotionProps = false, type } = {}, preloadedFeatures, createVisualElement) {\n preloadedFeatures && loadFeatures(preloadedFeatures);\n /**\n * Determine whether to use SVG or HTML rendering based on:\n * 1. Explicit `type` option (highest priority)\n * 2. Auto-detection via `isSVGComponent`\n */\n const isSVG = type ? type === \"svg\" : isSVGComponent(Component);\n const useVisualState = isSVG ? useSVGVisualState : useHTMLVisualState;\n function MotionDOMComponent(props, externalRef) {\n /**\n * If we need to measure the element we load this functionality in a\n * separate class component in order to gain access to getSnapshotBeforeUpdate.\n */\n let MeasureLayout;\n const configAndProps = {\n ...useContext(MotionConfigContext),\n ...props,\n layoutId: useLayoutId(props),\n };\n const { isStatic, isValidProp } = configAndProps;\n const context = useCreateMotionContext(props);\n const visualState = useVisualState(props, isStatic);\n if (!isStatic && typeof window !== \"undefined\") {\n useStrictMode(configAndProps, preloadedFeatures);\n const layoutProjection = getProjectionFunctionality(configAndProps);\n MeasureLayout = layoutProjection.MeasureLayout;\n /**\n * Create a VisualElement for this component. A VisualElement provides a common\n * interface to renderer-specific APIs (ie DOM/Three.js etc) as well as\n * providing a way of rendering to these APIs outside of the React render loop\n * for more performant animations and interactions\n */\n context.visualElement = useVisualElement(Component, visualState, configAndProps, createVisualElement, layoutProjection.ProjectionNode, isSVG);\n }\n /**\n * The mount order and hierarchy is specific to ensure our element ref\n * is hydrated by the time features fire their effects.\n */\n return (_jsxs(MotionContext.Provider, { value: context, children: [MeasureLayout && context.visualElement ? (_jsx(MeasureLayout, { visualElement: context.visualElement, ...configAndProps })) : null, useRender(Component, props, useMotionRef(visualState, context.visualElement, externalRef), visualState, isStatic, forwardMotionProps, isSVG, isValidProp)] }));\n }\n MotionDOMComponent.displayName = `motion.${typeof Component === \"string\"\n ? Component\n : `create(${Component.displayName ?? Component.name ?? \"\"})`}`;\n const ForwardRefMotionComponent = forwardRef(MotionDOMComponent);\n ForwardRefMotionComponent[motionComponentSymbol] = Component;\n return ForwardRefMotionComponent;\n}\nfunction useLayoutId({ layoutId }) {\n const layoutGroupId = useContext(LayoutGroupContext).id;\n return layoutGroupId && layoutId !== undefined\n ? layoutGroupId + \"-\" + layoutId\n : layoutId;\n}\nfunction useStrictMode(configAndProps, preloadedFeatures) {\n const isStrict = useContext(LazyContext).strict;\n /**\n * If we're in development mode, check to make sure we're not rendering a motion component\n * as a child of LazyMotion, as this will break the file-size benefits of using it.\n */\n if (process.env.NODE_ENV !== \"production\" &&\n preloadedFeatures &&\n isStrict) {\n const strictMessage = \"You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.\";\n configAndProps.ignoreStrict\n ? warning(false, strictMessage, \"lazy-strict-mode\")\n : invariant(false, strictMessage, \"lazy-strict-mode\");\n }\n}\nfunction getProjectionFunctionality(props) {\n const featureDefinitions = getInitializedFeatureDefinitions();\n const { drag, layout } = featureDefinitions;\n if (!drag && !layout)\n return {};\n const combined = { ...drag, ...layout };\n return {\n MeasureLayout: drag?.isEnabled(props) || layout?.isEnabled(props)\n ? combined.MeasureLayout\n : undefined,\n ProjectionNode: combined.ProjectionNode,\n };\n}\n//# sourceMappingURL=index.js.map","import { setFeatureDefinitions } from \"motion-dom\";\nimport { getInitializedFeatureDefinitions } from \"./definitions\";\nexport function loadFeatures(features) {\n const featureDefinitions = getInitializedFeatureDefinitions();\n for (const key in features) {\n featureDefinitions[key] = {\n ...featureDefinitions[key],\n ...features[key],\n };\n }\n setFeatureDefinitions(featureDefinitions);\n}\n//# sourceMappingURL=load-features.js.map","import { HTMLVisualElement, SVGVisualElement } from \"motion-dom\";\nimport { Fragment } from \"react\";\nimport { isSVGComponent } from \"./utils/is-svg-component\";\nexport const createDomVisualElement = (Component, options) => {\n /**\n * Use explicit isSVG override if provided, otherwise auto-detect\n */\n const isSVG = options.isSVG ?? isSVGComponent(Component);\n return isSVG\n ? new SVGVisualElement(options)\n : new HTMLVisualElement(options, {\n allowProjection: Component !== Fragment,\n });\n};\n//# sourceMappingURL=create-visual-element.js.map","import { Feature, resolveVariant } from \"motion-dom\";\nlet id = 0;\nexport class ExitAnimationFeature extends Feature {\n constructor() {\n super(...arguments);\n this.id = id++;\n this.isExitComplete = false;\n }\n update() {\n if (!this.node.presenceContext)\n return;\n const { isPresent, onExitComplete } = this.node.presenceContext;\n const { isPresent: prevIsPresent } = this.node.prevPresenceContext || {};\n if (!this.node.animationState || isPresent === prevIsPresent) {\n return;\n }\n if (isPresent && prevIsPresent === false) {\n /**\n * When re-entering, if the exit animation already completed\n * (element is at rest), reset to initial values so the enter\n * animation replays from the correct position.\n */\n if (this.isExitComplete) {\n const { initial, custom } = this.node.getProps();\n if (typeof initial === \"string\" ||\n (typeof initial === \"object\" &&\n initial !== null &&\n !Array.isArray(initial))) {\n const resolved = resolveVariant(this.node, initial, custom);\n if (resolved) {\n const { transition, transitionEnd, ...target } = resolved;\n for (const key in target) {\n this.node\n .getValue(key)\n ?.jump(target[key]);\n }\n }\n }\n this.node.animationState.reset();\n this.node.animationState.animateChanges();\n }\n else {\n this.node.animationState.setActive(\"exit\", false);\n }\n this.isExitComplete = false;\n return;\n }\n const exitAnimation = this.node.animationState.setActive(\"exit\", !isPresent);\n if (onExitComplete && !isPresent) {\n exitAnimation.then(() => {\n this.isExitComplete = true;\n onExitComplete(this.id);\n });\n }\n }\n mount() {\n const { register, onExitComplete } = this.node.presenceContext || {};\n if (onExitComplete) {\n onExitComplete(this.id);\n }\n if (register) {\n this.unmount = register(this.id);\n }\n }\n unmount() { }\n}\n//# sourceMappingURL=exit.js.map","import { AnimationFeature } from \"./animation\";\nimport { ExitAnimationFeature } from \"./animation/exit\";\nexport const animations = {\n animation: {\n Feature: AnimationFeature,\n },\n exit: {\n Feature: ExitAnimationFeature,\n },\n};\n//# sourceMappingURL=animations.js.map","import { createAnimationState, Feature, isAnimationControls, } from \"motion-dom\";\nexport class AnimationFeature extends Feature {\n /**\n * We dynamically generate the AnimationState manager as it contains a reference\n * to the underlying animation library. We only want to load that if we load this,\n * so people can optionally code split it out using the `m` component.\n */\n constructor(node) {\n super(node);\n node.animationState || (node.animationState = createAnimationState(node));\n }\n updateAnimationControlsSubscription() {\n const { animate } = this.node.getProps();\n if (isAnimationControls(animate)) {\n this.unmountControls = animate.subscribe(this.node);\n }\n }\n /**\n * Subscribe any provided AnimationControls to the component's VisualElement\n */\n mount() {\n this.updateAnimationControlsSubscription();\n }\n update() {\n const { animate } = this.node.getProps();\n const { animate: prevAnimate } = this.node.prevProps || {};\n if (animate !== prevAnimate) {\n this.updateAnimationControlsSubscription();\n }\n }\n unmount() {\n this.node.animationState.reset();\n this.unmountControls?.();\n }\n}\n//# sourceMappingURL=index.js.map","import { isPrimaryPointer } from \"motion-dom\";\nexport function extractEventInfo(event) {\n return {\n point: {\n x: event.pageX,\n y: event.pageY,\n },\n };\n}\nexport const addPointerInfo = (handler) => (event) => isPrimaryPointer(event) && handler(event, extractEventInfo(event));\n//# sourceMappingURL=event-info.js.map","import { addDomEvent } from \"motion-dom\";\nimport { addPointerInfo } from \"./event-info\";\nexport function addPointerEvent(target, eventName, handler, options) {\n return addDomEvent(target, eventName, addPointerInfo(handler), options);\n}\n//# sourceMappingURL=add-pointer-event.js.map","// Fixes https://github.com/motiondivision/motion/issues/2270\nexport const getContextWindow = ({ current }) => {\n return current ? current.ownerDocument.defaultView : null;\n};\n//# sourceMappingURL=get-context-window.js.map","export const distance = (a, b) => Math.abs(a - b);\nexport function distance2D(a, b) {\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//# sourceMappingURL=distance.js.map","import { cancelFrame, frame, frameData, isPrimaryPointer } from \"motion-dom\";\nimport { millisecondsToSeconds, pipe, secondsToMilliseconds, } from \"motion-utils\";\nimport { addPointerEvent } from \"../../events/add-pointer-event\";\nimport { extractEventInfo } from \"../../events/event-info\";\nimport { distance2D } from \"../../utils/distance\";\nconst overflowStyles = /*#__PURE__*/ new Set([\"auto\", \"scroll\"]);\n/**\n * @internal\n */\nexport class PanSession {\n constructor(event, handlers, { transformPagePoint, contextWindow = window, dragSnapToOrigin = false, distanceThreshold = 3, element, } = {}) {\n /**\n * @internal\n */\n this.startEvent = null;\n /**\n * @internal\n */\n this.lastMoveEvent = null;\n /**\n * @internal\n */\n this.lastMoveEventInfo = null;\n /**\n * Raw (untransformed) event info, re-transformed each frame\n * so transformPagePoint sees the current parent matrix.\n * @internal\n */\n this.lastRawMoveEventInfo = null;\n /**\n * @internal\n */\n this.handlers = {};\n /**\n * @internal\n */\n this.contextWindow = window;\n /**\n * Scroll positions of scrollable ancestors and window.\n * @internal\n */\n this.scrollPositions = new Map();\n /**\n * Cleanup function for scroll listeners.\n * @internal\n */\n this.removeScrollListeners = null;\n this.onElementScroll = (event) => {\n this.handleScroll(event.target);\n };\n this.onWindowScroll = () => {\n this.handleScroll(window);\n };\n this.updatePoint = () => {\n if (!(this.lastMoveEvent && this.lastMoveEventInfo))\n return;\n // Re-transform raw point through current transformPagePoint so\n // animated parent transforms (e.g. rotation) are picked up each frame\n if (this.lastRawMoveEventInfo) {\n this.lastMoveEventInfo = transformPoint(this.lastRawMoveEventInfo, this.transformPagePoint);\n }\n const info = getPanInfo(this.lastMoveEventInfo, this.history);\n const isPanStarted = this.startEvent !== null;\n // Only start panning if the offset is larger than 3 pixels. If we make it\n // any larger than this we'll want to reset the pointer history\n // on the first update to avoid visual snapping to the cursor.\n const isDistancePastThreshold = distance2D(info.offset, { x: 0, y: 0 }) >= this.distanceThreshold;\n if (!isPanStarted && !isDistancePastThreshold)\n return;\n const { point } = info;\n const { timestamp } = frameData;\n this.history.push({ ...point, timestamp });\n const { onStart, onMove } = this.handlers;\n if (!isPanStarted) {\n onStart && onStart(this.lastMoveEvent, info);\n this.startEvent = this.lastMoveEvent;\n }\n onMove && onMove(this.lastMoveEvent, info);\n };\n this.handlePointerMove = (event, info) => {\n this.lastMoveEvent = event;\n this.lastRawMoveEventInfo = info;\n this.lastMoveEventInfo = transformPoint(info, this.transformPagePoint);\n // Throttle mouse move event to once per frame\n frame.update(this.updatePoint, true);\n };\n this.handlePointerUp = (event, info) => {\n this.end();\n const { onEnd, onSessionEnd, resumeAnimation } = this.handlers;\n // Resume animation if dragSnapToOrigin is set OR if no drag started (user just clicked)\n // This ensures constraint animations continue when interrupted by a click\n if (this.dragSnapToOrigin || !this.startEvent) {\n resumeAnimation && resumeAnimation();\n }\n if (!(this.lastMoveEvent && this.lastMoveEventInfo))\n return;\n const panInfo = getPanInfo(event.type === \"pointercancel\"\n ? this.lastMoveEventInfo\n : transformPoint(info, this.transformPagePoint), this.history);\n if (this.startEvent && onEnd) {\n onEnd(event, panInfo);\n }\n onSessionEnd && onSessionEnd(event, panInfo);\n };\n // If we have more than one touch, don't start detecting this gesture\n if (!isPrimaryPointer(event))\n return;\n this.dragSnapToOrigin = dragSnapToOrigin;\n this.handlers = handlers;\n this.transformPagePoint = transformPagePoint;\n this.distanceThreshold = distanceThreshold;\n this.contextWindow = contextWindow || window;\n const info = extractEventInfo(event);\n const initialInfo = transformPoint(info, this.transformPagePoint);\n const { point } = initialInfo;\n const { timestamp } = frameData;\n this.history = [{ ...point, timestamp }];\n const { onSessionStart } = handlers;\n onSessionStart &&\n onSessionStart(event, getPanInfo(initialInfo, this.history));\n // Listen in the capture phase so a descendant calling\n // stopPropagation() (e.g. in its own pointerup handler) can't\n // prevent the gesture from ending. See #2794.\n const eventOptions = { passive: true, capture: true };\n this.removeListeners = pipe(addPointerEvent(this.contextWindow, \"pointermove\", this.handlePointerMove, eventOptions), addPointerEvent(this.contextWindow, \"pointerup\", this.handlePointerUp, eventOptions), addPointerEvent(this.contextWindow, \"pointercancel\", this.handlePointerUp, eventOptions));\n // Start scroll tracking if element provided\n if (element) {\n this.startScrollTracking(element);\n }\n }\n /**\n * Start tracking scroll on ancestors and window.\n */\n startScrollTracking(element) {\n // Store initial scroll positions for scrollable ancestors\n let current = element.parentElement;\n while (current) {\n const style = getComputedStyle(current);\n if (overflowStyles.has(style.overflowX) ||\n overflowStyles.has(style.overflowY)) {\n this.scrollPositions.set(current, {\n x: current.scrollLeft,\n y: current.scrollTop,\n });\n }\n current = current.parentElement;\n }\n // Track window scroll\n this.scrollPositions.set(window, {\n x: window.scrollX,\n y: window.scrollY,\n });\n // Capture listener catches element scroll events as they bubble\n window.addEventListener(\"scroll\", this.onElementScroll, {\n capture: true,\n });\n // Direct window scroll listener (window scroll doesn't bubble)\n window.addEventListener(\"scroll\", this.onWindowScroll);\n this.removeScrollListeners = () => {\n window.removeEventListener(\"scroll\", this.onElementScroll, {\n capture: true,\n });\n window.removeEventListener(\"scroll\", this.onWindowScroll);\n };\n }\n /**\n * Handle scroll compensation during drag.\n *\n * For element scroll: adjusts history origin since pageX/pageY doesn't change.\n * For window scroll: adjusts lastMoveEventInfo since pageX/pageY would change.\n */\n handleScroll(target) {\n const initial = this.scrollPositions.get(target);\n if (!initial)\n return;\n const isWindow = target === window;\n const current = isWindow\n ? { x: window.scrollX, y: window.scrollY }\n : {\n x: target.scrollLeft,\n y: target.scrollTop,\n };\n const delta = { x: current.x - initial.x, y: current.y - initial.y };\n if (delta.x === 0 && delta.y === 0)\n return;\n if (isWindow) {\n // Window scroll: pageX/pageY changes, so update lastMoveEventInfo\n if (this.lastMoveEventInfo) {\n this.lastMoveEventInfo.point.x += delta.x;\n this.lastMoveEventInfo.point.y += delta.y;\n }\n }\n else {\n // Element scroll: pageX/pageY unchanged, so adjust history origin\n if (this.history.length > 0) {\n this.history[0].x -= delta.x;\n this.history[0].y -= delta.y;\n }\n }\n this.scrollPositions.set(target, current);\n frame.update(this.updatePoint, true);\n }\n updateHandlers(handlers) {\n this.handlers = handlers;\n }\n end() {\n this.removeListeners && this.removeListeners();\n this.removeScrollListeners && this.removeScrollListeners();\n this.scrollPositions.clear();\n cancelFrame(this.updatePoint);\n }\n}\nfunction transformPoint(info, transformPagePoint) {\n return transformPagePoint ? { point: transformPagePoint(info.point) } : info;\n}\nfunction subtractPoint(a, b) {\n return { x: a.x - b.x, y: a.y - b.y };\n}\nfunction getPanInfo({ point }, history) {\n return {\n point,\n delta: subtractPoint(point, lastDevicePoint(history)),\n offset: subtractPoint(point, startDevicePoint(history)),\n velocity: getVelocity(history, 0.1),\n };\n}\nfunction startDevicePoint(history) {\n return history[0];\n}\nfunction lastDevicePoint(history) {\n return history[history.length - 1];\n}\nfunction getVelocity(history, timeDelta) {\n if (history.length < 2) {\n return { x: 0, y: 0 };\n }\n let i = history.length - 1;\n let timestampedPoint = null;\n const lastPoint = lastDevicePoint(history);\n while (i >= 0) {\n timestampedPoint = history[i];\n if (lastPoint.timestamp - timestampedPoint.timestamp >\n secondsToMilliseconds(timeDelta)) {\n break;\n }\n i--;\n }\n if (!timestampedPoint) {\n return { x: 0, y: 0 };\n }\n /**\n * If the selected point is the pointer-down origin (history[0]),\n * there are better movement points available, and the time gap\n * is suspiciously large (>2x timeDelta), use the next point instead.\n * This prevents stale pointer-down points from diluting velocity\n * in hold-then-flick gestures.\n */\n if (timestampedPoint === history[0] &&\n history.length > 2 &&\n lastPoint.timestamp - timestampedPoint.timestamp >\n secondsToMilliseconds(timeDelta) * 2) {\n timestampedPoint = history[1];\n }\n const time = millisecondsToSeconds(lastPoint.timestamp - timestampedPoint.timestamp);\n if (time === 0) {\n return { x: 0, y: 0 };\n }\n const currentVelocity = {\n x: (lastPoint.x - timestampedPoint.x) / time,\n y: (lastPoint.y - timestampedPoint.y) / time,\n };\n if (currentVelocity.x === Infinity) {\n currentVelocity.x = 0;\n }\n if (currentVelocity.y === Infinity) {\n currentVelocity.y = 0;\n }\n return currentVelocity;\n}\n//# sourceMappingURL=PanSession.js.map","import { calcLength, mixNumber } from \"motion-dom\";\nimport { progress as calcProgress, clamp, } from \"motion-utils\";\n/**\n * Apply constraints to a point. These constraints are both physical along an\n * axis, and an elastic factor that determines how much to constrain the point\n * by if it does lie outside the defined parameters.\n */\nexport function applyConstraints(point, { min, max }, elastic) {\n if (min !== undefined && point < min) {\n // If we have a min point defined, and this is outside of that, constrain\n point = elastic\n ? mixNumber(min, point, elastic.min)\n : Math.max(point, min);\n }\n else if (max !== undefined && point > max) {\n // If we have a max point defined, and this is outside of that, constrain\n point = elastic\n ? mixNumber(max, point, elastic.max)\n : Math.min(point, max);\n }\n return point;\n}\n/**\n * Calculates a min projection point based on a pointer, pointer progress\n * within the drag target, and constraints.\n *\n * For instance if an element was 100px width, we were dragging from 0.25\n * along this axis, the pointer is at 200px, and there were no constraints,\n * we would calculate a min projection point of 175px.\n */\nexport function calcConstrainedMinPoint(point, length, progress, constraints, elastic) {\n // Calculate a min point for this axis and apply it to the current pointer\n const min = point - length * progress;\n return constraints ? applyConstraints(min, constraints, elastic) : min;\n}\n/**\n * Calculate constraints in terms of the viewport when defined relatively to the\n * measured axis. This is measured from the nearest edge, so a max constraint of 200\n * on an axis with a max value of 300 would return a constraint of 500 - axis length\n */\nexport function calcRelativeAxisConstraints(axis, min, max) {\n return {\n min: min !== undefined ? axis.min + min : undefined,\n max: max !== undefined\n ? axis.max + max - (axis.max - axis.min)\n : undefined,\n };\n}\n/**\n * Calculate constraints in terms of the viewport when\n * defined relatively to the measured bounding box.\n */\nexport function calcRelativeConstraints(layoutBox, { top, left, bottom, right }) {\n return {\n x: calcRelativeAxisConstraints(layoutBox.x, left, right),\n y: calcRelativeAxisConstraints(layoutBox.y, top, bottom),\n };\n}\n/**\n * Calculate viewport constraints when defined as another viewport-relative axis\n */\nexport function calcViewportAxisConstraints(layoutAxis, constraintsAxis) {\n let min = constraintsAxis.min - layoutAxis.min;\n let max = constraintsAxis.max - layoutAxis.max;\n // If the constraints axis is actually smaller than the layout axis then we can\n // flip the constraints\n if (constraintsAxis.max - constraintsAxis.min <\n layoutAxis.max - layoutAxis.min) {\n ;\n [min, max] = [max, min];\n }\n return { min, max };\n}\n/**\n * Calculate viewport constraints when defined as another viewport-relative box\n */\nexport function calcViewportConstraints(layoutBox, constraintsBox) {\n return {\n x: calcViewportAxisConstraints(layoutBox.x, constraintsBox.x),\n y: calcViewportAxisConstraints(layoutBox.y, constraintsBox.y),\n };\n}\n/**\n * Calculate a transform origin relative to the source axis, between 0-1, that results\n * in an asthetically pleasing scale/transform needed to project from source to target.\n */\nexport function calcOrigin(source, target) {\n let origin = 0.5;\n const sourceLength = calcLength(source);\n const targetLength = calcLength(target);\n if (targetLength > sourceLength) {\n origin = calcProgress(target.min, target.max - sourceLength, source.min);\n }\n else if (sourceLength > targetLength) {\n origin = calcProgress(source.min, source.max - targetLength, target.min);\n }\n return clamp(0, 1, origin);\n}\n/**\n * Calculate the relative progress of one constraints box relative to another.\n * Imagine a page scroll bar. At the top, this would return 0, at the bottom, 1.\n * Anywhere in-between, a value between 0 and 1.\n *\n * This also handles flipped constraints, for instance a draggable container within\n * a smaller viewport like a scrollable view.\n */\nexport function calcProgressWithinConstraints(layoutBox, constraintsBox) {\n return {\n x: calcOrigin(layoutBox.x, constraintsBox.x),\n y: calcOrigin(layoutBox.y, constraintsBox.y),\n };\n}\n/**\n * Calculate the an axis position based on two axes and a progress value.\n */\nexport function calcPositionFromProgress(axis, constraints, progress) {\n const axisLength = axis.max - axis.min;\n const min = mixNumber(constraints.min, constraints.max - axisLength, progress);\n return { min, max: min + axisLength };\n}\n/**\n * Rebase the calculated viewport constraints relative to the layout.min point.\n */\nexport function rebaseAxisConstraints(layout, constraints) {\n const relativeConstraints = {};\n if (constraints.min !== undefined) {\n relativeConstraints.min = constraints.min - layout.min;\n }\n if (constraints.max !== undefined) {\n relativeConstraints.max = constraints.max - layout.min;\n }\n return relativeConstraints;\n}\nexport const defaultElastic = 0.35;\n/**\n * Accepts a dragElastic prop and returns resolved elastic values for each axis.\n */\nexport function resolveDragElastic(dragElastic = defaultElastic) {\n if (dragElastic === false) {\n dragElastic = 0;\n }\n else if (dragElastic === true) {\n dragElastic = defaultElastic;\n }\n return {\n x: resolveAxisElastic(dragElastic, \"left\", \"right\"),\n y: resolveAxisElastic(dragElastic, \"top\", \"bottom\"),\n };\n}\nexport function resolveAxisElastic(dragElastic, minLabel, maxLabel) {\n return {\n min: resolvePointElastic(dragElastic, minLabel),\n max: resolvePointElastic(dragElastic, maxLabel),\n };\n}\nexport function resolvePointElastic(dragElastic, label) {\n return typeof dragElastic === \"number\"\n ? dragElastic\n : dragElastic[label] || 0;\n}\n//# sourceMappingURL=constraints.js.map","import { addValueToWillChange, animateMotionValue, calcLength, convertBoundingBoxToBox, convertBoxToBoundingBox, createBox, eachAxis, frame, isElementTextInput, measurePageBox, mixNumber, percent, resize, setDragLock, } from \"motion-dom\";\nimport { invariant } from \"motion-utils\";\nimport { addDomEvent } from \"motion-dom\";\nimport { addPointerEvent } from \"../../events/add-pointer-event\";\nimport { extractEventInfo } from \"../../events/event-info\";\nimport { getContextWindow } from \"../../utils/get-context-window\";\nimport { isRefObject } from \"../../utils/is-ref-object\";\nimport { PanSession } from \"../pan/PanSession\";\nimport { applyConstraints, calcOrigin, calcRelativeConstraints, calcViewportConstraints, defaultElastic, rebaseAxisConstraints, resolveDragElastic, } from \"./utils/constraints\";\nexport const elementDragControls = new WeakMap();\nexport class VisualElementDragControls {\n constructor(visualElement) {\n this.openDragLock = null;\n this.isDragging = false;\n this.currentDirection = null;\n this.originPoint = { x: 0, y: 0 };\n /**\n * The permitted boundaries of travel, in pixels.\n */\n this.constraints = false;\n this.hasMutatedConstraints = false;\n /**\n * The per-axis resolved elastic values.\n */\n this.elastic = createBox();\n /**\n * The latest pointer event. Used as fallback when the `cancel` and `stop` functions are called without arguments.\n */\n this.latestPointerEvent = null;\n /**\n * The latest pan info. Used as fallback when the `cancel` and `stop` functions are called without arguments.\n */\n this.latestPanInfo = null;\n this.visualElement = visualElement;\n }\n start(originEvent, { snapToCursor = false, distanceThreshold } = {}) {\n /**\n * Don't start dragging if this component is exiting\n */\n const { presenceContext } = this.visualElement;\n if (presenceContext && presenceContext.isPresent === false)\n return;\n const onSessionStart = (event) => {\n if (snapToCursor) {\n this.snapToCursor(extractEventInfo(event).point);\n }\n this.stopAnimation();\n };\n const onStart = (event, info) => {\n // Attempt to grab the global drag gesture lock - maybe make this part of PanSession\n const { drag, dragPropagation, onDragStart } = this.getProps();\n if (drag && !dragPropagation) {\n if (this.openDragLock)\n this.openDragLock();\n this.openDragLock = setDragLock(drag);\n // If we don 't have the lock, don't start dragging\n if (!this.openDragLock)\n return;\n }\n this.latestPointerEvent = event;\n this.latestPanInfo = info;\n this.isDragging = true;\n this.currentDirection = null;\n this.resolveConstraints();\n if (this.visualElement.projection) {\n this.visualElement.projection.isAnimationBlocked = true;\n this.visualElement.projection.target = undefined;\n }\n /**\n * Record gesture origin and pointer offset\n */\n eachAxis((axis) => {\n let current = this.getAxisMotionValue(axis).get() || 0;\n /**\n * If the MotionValue is a percentage value convert to px\n */\n if (percent.test(current)) {\n const { projection } = this.visualElement;\n if (projection && projection.layout) {\n const measuredAxis = projection.layout.layoutBox[axis];\n if (measuredAxis) {\n const length = calcLength(measuredAxis);\n current = length * (parseFloat(current) / 100);\n }\n }\n }\n this.originPoint[axis] = current;\n });\n // Fire onDragStart event\n if (onDragStart) {\n frame.update(() => onDragStart(event, info), false, true);\n }\n addValueToWillChange(this.visualElement, \"transform\");\n const { animationState } = this.visualElement;\n animationState && animationState.setActive(\"whileDrag\", true);\n };\n const onMove = (event, info) => {\n this.latestPointerEvent = event;\n this.latestPanInfo = info;\n const { dragPropagation, dragDirectionLock, onDirectionLock, onDrag, } = this.getProps();\n // If we didn't successfully receive the gesture lock, early return.\n if (!dragPropagation && !this.openDragLock)\n return;\n const { offset } = info;\n // Attempt to detect drag direction if directionLock is true\n if (dragDirectionLock && this.currentDirection === null) {\n this.currentDirection = getCurrentDirection(offset);\n // If we've successfully set a direction, notify listener\n if (this.currentDirection !== null) {\n onDirectionLock && onDirectionLock(this.currentDirection);\n }\n return;\n }\n // Update each point with the latest position\n this.updateAxis(\"x\", info.point, offset);\n this.updateAxis(\"y\", info.point, offset);\n /**\n * Ideally we would leave the renderer to fire naturally at the end of\n * this frame but if the element is about to change layout as the result\n * of a re-render we want to ensure the browser can read the latest\n * bounding box to ensure the pointer and element don't fall out of sync.\n */\n this.visualElement.render();\n /**\n * This must fire after the render call as it might trigger a state\n * change which itself might trigger a layout update.\n */\n if (onDrag) {\n frame.update(() => onDrag(event, info), false, true);\n }\n };\n const onSessionEnd = (event, info) => {\n this.latestPointerEvent = event;\n this.latestPanInfo = info;\n this.stop(event, info);\n this.latestPointerEvent = null;\n this.latestPanInfo = null;\n };\n const resumeAnimation = () => {\n const { dragSnapToOrigin: snap } = this.getProps();\n if (snap || this.constraints) {\n this.startAnimation({ x: 0, y: 0 });\n }\n };\n const { dragSnapToOrigin } = this.getProps();\n this.panSession = new PanSession(originEvent, {\n onSessionStart,\n onStart,\n onMove,\n onSessionEnd,\n resumeAnimation,\n }, {\n transformPagePoint: this.visualElement.getTransformPagePoint(),\n dragSnapToOrigin,\n distanceThreshold,\n contextWindow: getContextWindow(this.visualElement),\n element: this.visualElement.current,\n });\n }\n /**\n * @internal\n */\n stop(event, panInfo) {\n const finalEvent = event || this.latestPointerEvent;\n const finalPanInfo = panInfo || this.latestPanInfo;\n const isDragging = this.isDragging;\n this.cancel();\n if (!isDragging || !finalPanInfo || !finalEvent)\n return;\n const { velocity } = finalPanInfo;\n this.startAnimation(velocity);\n const { onDragEnd } = this.getProps();\n if (onDragEnd) {\n frame.postRender(() => onDragEnd(finalEvent, finalPanInfo));\n }\n }\n /**\n * @internal\n */\n cancel() {\n this.isDragging = false;\n const { projection, animationState } = this.visualElement;\n if (projection) {\n projection.isAnimationBlocked = false;\n }\n this.endPanSession();\n const { dragPropagation } = this.getProps();\n if (!dragPropagation && this.openDragLock) {\n this.openDragLock();\n this.openDragLock = null;\n }\n animationState && animationState.setActive(\"whileDrag\", false);\n }\n /**\n * Clean up the pan session without modifying other drag state.\n * This is used during unmount to ensure event listeners are removed\n * without affecting projection animations or drag locks.\n * @internal\n */\n endPanSession() {\n this.panSession && this.panSession.end();\n this.panSession = undefined;\n }\n updateAxis(axis, _point, offset) {\n const { drag } = this.getProps();\n // If we're not dragging this axis, do an early return.\n if (!offset || !shouldDrag(axis, drag, this.currentDirection))\n return;\n const axisValue = this.getAxisMotionValue(axis);\n let next = this.originPoint[axis] + offset[axis];\n // Apply constraints\n if (this.constraints && this.constraints[axis]) {\n next = applyConstraints(next, this.constraints[axis], this.elastic[axis]);\n }\n axisValue.set(next);\n }\n resolveConstraints() {\n const { dragConstraints, dragElastic } = this.getProps();\n const layout = this.visualElement.projection &&\n !this.visualElement.projection.layout\n ? this.visualElement.projection.measure(false)\n : this.visualElement.projection?.layout;\n const prevConstraints = this.constraints;\n if (dragConstraints && isRefObject(dragConstraints)) {\n if (!this.constraints) {\n this.constraints = this.resolveRefConstraints();\n }\n }\n else {\n if (dragConstraints && layout) {\n this.constraints = calcRelativeConstraints(layout.layoutBox, dragConstraints);\n }\n else {\n this.constraints = false;\n }\n }\n this.elastic = resolveDragElastic(dragElastic);\n /**\n * If we're outputting to external MotionValues, we want to rebase the measured constraints\n * from viewport-relative to component-relative. This only applies to relative (non-ref)\n * constraints, as ref-based constraints from calcViewportConstraints are already in the\n * correct coordinate space for the motion value transform offset.\n */\n if (prevConstraints !== this.constraints &&\n !isRefObject(dragConstraints) &&\n layout &&\n this.constraints &&\n !this.hasMutatedConstraints) {\n eachAxis((axis) => {\n if (this.constraints !== false &&\n this.getAxisMotionValue(axis)) {\n this.constraints[axis] = rebaseAxisConstraints(layout.layoutBox[axis], this.constraints[axis]);\n }\n });\n }\n }\n resolveRefConstraints() {\n const { dragConstraints: constraints, onMeasureDragConstraints } = this.getProps();\n if (!constraints || !isRefObject(constraints))\n return false;\n const constraintsElement = constraints.current;\n invariant(constraintsElement !== null, \"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.\", \"drag-constraints-ref\");\n const { projection } = this.visualElement;\n // TODO\n if (!projection || !projection.layout)\n return false;\n /**\n * Refresh the root scroll offset so the constraint's viewport box\n * translates to correct page coordinates. The scroll captured at\n * drag mount can be stale if the document was scrolled afterwards —\n * e.g. via the browser restoring scroll on refresh, or an ancestor\n * layout effect running after this element's mount (#2829).\n *\n * Clear the cached scroll first so `updateScroll` bypasses its\n * per-animationId cache and re-reads the live value.\n */\n if (projection.root) {\n projection.root.scroll = undefined;\n projection.root.updateScroll();\n }\n const constraintsBox = measurePageBox(constraintsElement, projection.root, this.visualElement.getTransformPagePoint());\n let measuredConstraints = calcViewportConstraints(projection.layout.layoutBox, constraintsBox);\n /**\n * If there's an onMeasureDragConstraints listener we call it and\n * if different constraints are returned, set constraints to that\n */\n if (onMeasureDragConstraints) {\n const userConstraints = onMeasureDragConstraints(convertBoxToBoundingBox(measuredConstraints));\n this.hasMutatedConstraints = !!userConstraints;\n if (userConstraints) {\n measuredConstraints = convertBoundingBoxToBox(userConstraints);\n }\n }\n return measuredConstraints;\n }\n startAnimation(velocity) {\n const { drag, dragMomentum, dragElastic, dragTransition, dragSnapToOrigin, onDragTransitionEnd, } = this.getProps();\n const constraints = this.constraints || {};\n const momentumAnimations = eachAxis((axis) => {\n if (!shouldDrag(axis, drag, this.currentDirection)) {\n return;\n }\n let transition = (constraints && constraints[axis]) || {};\n if (dragSnapToOrigin === true ||\n dragSnapToOrigin === axis)\n transition = { min: 0, max: 0 };\n /**\n * Overdamp the boundary spring if `dragElastic` is disabled. There's still a frame\n * of spring animations so we should look into adding a disable spring option to `inertia`.\n * We could do something here where we affect the `bounceStiffness` and `bounceDamping`\n * using the value of `dragElastic`.\n */\n const bounceStiffness = dragElastic ? 200 : 1000000;\n const bounceDamping = dragElastic ? 40 : 10000000;\n const inertia = {\n type: \"inertia\",\n velocity: dragMomentum ? velocity[axis] : 0,\n bounceStiffness,\n bounceDamping,\n timeConstant: 750,\n restDelta: 1,\n restSpeed: 10,\n ...dragTransition,\n ...transition,\n };\n // If we're not animating on an externally-provided `MotionValue` we can use the\n // component's animation controls which will handle interactions with whileHover (etc),\n // otherwise we just have to animate the `MotionValue` itself.\n return this.startAxisValueAnimation(axis, inertia);\n });\n // Run all animations and then resolve the new drag constraints.\n return Promise.all(momentumAnimations).then(onDragTransitionEnd);\n }\n startAxisValueAnimation(axis, transition) {\n const axisValue = this.getAxisMotionValue(axis);\n addValueToWillChange(this.visualElement, axis);\n return axisValue.start(animateMotionValue(axis, axisValue, 0, transition, this.visualElement, false));\n }\n stopAnimation() {\n eachAxis((axis) => this.getAxisMotionValue(axis).stop());\n }\n /**\n * Drag works differently depending on which props are provided.\n *\n * - If _dragX and _dragY are provided, we output the gesture delta directly to those motion values.\n * - Otherwise, we apply the delta to the x/y motion values.\n */\n getAxisMotionValue(axis) {\n const dragKey = `_drag${axis.toUpperCase()}`;\n const props = this.visualElement.getProps();\n const externalMotionValue = props[dragKey];\n return externalMotionValue\n ? externalMotionValue\n : this.visualElement.getValue(axis, this.visualElement.latestValues[axis] ?? 0);\n }\n snapToCursor(point) {\n eachAxis((axis) => {\n const { drag } = this.getProps();\n // If we're not dragging this axis, do an early return.\n if (!shouldDrag(axis, drag, this.currentDirection))\n return;\n const { projection } = this.visualElement;\n const axisValue = this.getAxisMotionValue(axis);\n if (projection && projection.layout) {\n const { min, max } = projection.layout.layoutBox[axis];\n /**\n * The layout measurement includes the current transform value,\n * so we need to add it back to get the correct snap position.\n * This fixes an issue where elements with initial coordinates\n * would snap to the wrong position on the first drag.\n */\n const current = axisValue.get() || 0;\n axisValue.set(point[axis] - mixNumber(min, max, 0.5) + current);\n }\n });\n }\n /**\n * When the viewport resizes we want to check if the measured constraints\n * have changed and, if so, reposition the element within those new constraints\n * relative to where it was before the resize.\n */\n scalePositionWithinConstraints() {\n if (!this.visualElement.current)\n return;\n const { drag, dragConstraints } = this.getProps();\n const { projection } = this.visualElement;\n if (!isRefObject(dragConstraints) || !projection || !this.constraints)\n return;\n /**\n * Stop current animations as there can be visual glitching if we try to do\n * this mid-animation\n */\n this.stopAnimation();\n /**\n * Record the relative position of the dragged element relative to the\n * constraints box and save as a progress value.\n */\n const boxProgress = { x: 0, y: 0 };\n eachAxis((axis) => {\n const axisValue = this.getAxisMotionValue(axis);\n if (axisValue && this.constraints !== false) {\n const latest = axisValue.get();\n boxProgress[axis] = calcOrigin({ min: latest, max: latest }, this.constraints[axis]);\n }\n });\n /**\n * Update the layout of this element and resolve the latest drag constraints\n */\n const { transformTemplate } = this.visualElement.getProps();\n this.visualElement.current.style.transform = transformTemplate\n ? transformTemplate({}, \"\")\n : \"none\";\n projection.root && projection.root.updateScroll();\n projection.updateLayout();\n /**\n * Reset constraints so resolveConstraints() will recalculate them\n * with the freshly measured layout rather than returning the cached value.\n */\n this.constraints = false;\n this.resolveConstraints();\n /**\n * For each axis, calculate the current progress of the layout axis\n * within the new constraints.\n */\n eachAxis((axis) => {\n if (!shouldDrag(axis, drag, null))\n return;\n /**\n * Calculate a new transform based on the previous box progress\n */\n const axisValue = this.getAxisMotionValue(axis);\n const { min, max } = this.constraints[axis];\n axisValue.set(mixNumber(min, max, boxProgress[axis]));\n });\n /**\n * Flush the updated transform to the DOM synchronously to prevent\n * a visual flash at the element's CSS layout position (0,0) when\n * the transform was stripped for measurement.\n */\n this.visualElement.render();\n }\n addListeners() {\n if (!this.visualElement.current)\n return;\n elementDragControls.set(this.visualElement, this);\n const element = this.visualElement.current;\n /**\n * Attach a pointerdown event listener on this DOM element to initiate drag tracking.\n */\n const stopPointerListener = addPointerEvent(element, \"pointerdown\", (event) => {\n const { drag, dragListener = true } = this.getProps();\n const target = event.target;\n /**\n * Only block drag if clicking on a text input child element\n * (input, textarea, select, contenteditable) where users might\n * want to select text or interact with the control.\n *\n * Buttons and links don't block drag since they don't have\n * click-and-move actions of their own.\n */\n const isClickingTextInputChild = target !== element && isElementTextInput(target);\n if (drag && dragListener && !isClickingTextInputChild) {\n this.start(event);\n }\n });\n /**\n * If using ref-based constraints, observe both the draggable element\n * and the constraint container for size changes via ResizeObserver.\n * Setup is deferred because dragConstraints.current is null when\n * addListeners first runs (React hasn't committed the ref yet).\n */\n let stopResizeObservers;\n const measureDragConstraints = () => {\n const { dragConstraints } = this.getProps();\n if (isRefObject(dragConstraints) && dragConstraints.current) {\n this.constraints = this.resolveRefConstraints();\n if (!stopResizeObservers) {\n stopResizeObservers = startResizeObservers(element, dragConstraints.current, () => this.scalePositionWithinConstraints());\n }\n }\n };\n const { projection } = this.visualElement;\n const stopMeasureLayoutListener = projection.addEventListener(\"measure\", measureDragConstraints);\n if (projection && !projection.layout) {\n projection.root && projection.root.updateScroll();\n projection.updateLayout();\n }\n frame.read(measureDragConstraints);\n /**\n * Attach a window resize listener to scale the draggable target within its defined\n * constraints as the window resizes.\n */\n const stopResizeListener = addDomEvent(window, \"resize\", () => this.scalePositionWithinConstraints());\n /**\n * If the element's layout changes, calculate the delta and apply that to\n * the drag gesture's origin point.\n */\n const stopLayoutUpdateListener = projection.addEventListener(\"didUpdate\", (({ delta, hasLayoutChanged }) => {\n if (this.isDragging && hasLayoutChanged) {\n eachAxis((axis) => {\n const motionValue = this.getAxisMotionValue(axis);\n if (!motionValue)\n return;\n this.originPoint[axis] += delta[axis].translate;\n motionValue.set(motionValue.get() + delta[axis].translate);\n });\n this.visualElement.render();\n }\n }));\n return () => {\n stopResizeListener();\n stopPointerListener();\n stopMeasureLayoutListener();\n stopLayoutUpdateListener && stopLayoutUpdateListener();\n stopResizeObservers && stopResizeObservers();\n };\n }\n getProps() {\n const props = this.visualElement.getProps();\n const { drag = false, dragDirectionLock = false, dragPropagation = false, dragConstraints = false, dragElastic = defaultElastic, dragMomentum = true, } = props;\n return {\n ...props,\n drag,\n dragDirectionLock,\n dragPropagation,\n dragConstraints,\n dragElastic,\n dragMomentum,\n };\n }\n}\nfunction skipFirstCall(callback) {\n let isFirst = true;\n return () => {\n if (isFirst) {\n isFirst = false;\n return;\n }\n callback();\n };\n}\nfunction startResizeObservers(element, constraintsElement, onResize) {\n const stopElement = resize(element, skipFirstCall(onResize));\n const stopContainer = resize(constraintsElement, skipFirstCall(onResize));\n return () => {\n stopElement();\n stopContainer();\n };\n}\nfunction shouldDrag(direction, drag, currentDirection) {\n return ((drag === true || drag === direction) &&\n (currentDirection === null || currentDirection === direction));\n}\n/**\n * Based on an x/y offset determine the current drag direction. If both axis' offsets are lower\n * than the provided threshold, return `null`.\n *\n * @param offset - The x/y offset from origin.\n * @param lockThreshold - (Optional) - the minimum absolute offset before we can determine a drag direction.\n */\nfunction getCurrentDirection(offset, lockThreshold = 10) {\n let direction = null;\n if (Math.abs(offset.y) > lockThreshold) {\n direction = \"y\";\n }\n else if (Math.abs(offset.x) > lockThreshold) {\n direction = \"x\";\n }\n return direction;\n}\nexport function expectsResolvedDragConstraints({ dragConstraints, onMeasureDragConstraints, }) {\n return isRefObject(dragConstraints) && !!onMeasureDragConstraints;\n}\n//# sourceMappingURL=VisualElementDragControls.js.map","import { isDragging } from './is-active.mjs';\n\nfunction setDragLock(axis) {\n if (axis === \"x\" || axis === \"y\") {\n if (isDragging[axis]) {\n return null;\n }\n else {\n isDragging[axis] = true;\n return () => {\n isDragging[axis] = false;\n };\n }\n }\n else {\n if (isDragging.x || isDragging.y) {\n return null;\n }\n else {\n isDragging.x = isDragging.y = true;\n return () => {\n isDragging.x = isDragging.y = false;\n };\n }\n }\n}\n\nexport { setDragLock };\n//# sourceMappingURL=set-active.mjs.map\n","import { Feature, frame } from \"motion-dom\";\nimport { noop } from \"motion-utils\";\nimport { addPointerEvent } from \"../../events/add-pointer-event\";\nimport { getContextWindow } from \"../../utils/get-context-window\";\nimport { PanSession } from \"./PanSession\";\nconst asyncHandler = (handler) => (event, info) => {\n if (handler) {\n frame.update(() => handler(event, info), false, true);\n }\n};\nexport class PanGesture extends Feature {\n constructor() {\n super(...arguments);\n this.removePointerDownListener = noop;\n }\n onPointerDown(pointerDownEvent) {\n this.session = new PanSession(pointerDownEvent, this.createPanHandlers(), {\n transformPagePoint: this.node.getTransformPagePoint(),\n contextWindow: getContextWindow(this.node),\n });\n }\n createPanHandlers() {\n const { onPanSessionStart, onPanStart, onPan, onPanEnd } = this.node.getProps();\n return {\n onSessionStart: asyncHandler(onPanSessionStart),\n onStart: asyncHandler(onPanStart),\n onMove: asyncHandler(onPan),\n onEnd: (event, info) => {\n delete this.session;\n if (onPanEnd) {\n frame.postRender(() => onPanEnd(event, info));\n }\n },\n };\n }\n mount() {\n this.removePointerDownListener = addPointerEvent(this.node.current, \"pointerdown\", (event) => this.onPointerDown(event));\n }\n update() {\n this.session && this.session.updateHandlers(this.createPanHandlers());\n }\n unmount() {\n this.removePointerDownListener();\n this.session && this.session.end();\n }\n}\n//# sourceMappingURL=index.js.map","\"use client\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { frame, microtask, globalProjectionState } from \"motion-dom\";\nimport { Component, useContext } from \"react\";\nimport { usePresence } from \"../../../components/AnimatePresence/use-presence\";\nimport { LayoutGroupContext, } from \"../../../context/LayoutGroupContext\";\nimport { SwitchLayoutGroupContext } from \"../../../context/SwitchLayoutGroupContext\";\n/**\n * Track whether we've taken any snapshots yet. If not,\n * we can safely skip notification of didUpdate.\n *\n * Difficult to capture in a test but to prevent flickering\n * we must set this to true either on update or unmount.\n * Running `next-env/layout-id` in Safari will show this behaviour if broken.\n */\nlet hasTakenAnySnapshot = false;\nclass MeasureLayoutWithContext extends Component {\n /**\n * This only mounts projection nodes for components that\n * need measuring, we might want to do it for all components\n * in order to incorporate transforms\n */\n componentDidMount() {\n const { visualElement, layoutGroup, switchLayoutGroup, layoutId } = this.props;\n const { projection } = visualElement;\n if (projection) {\n if (layoutGroup.group)\n layoutGroup.group.add(projection);\n if (switchLayoutGroup && switchLayoutGroup.register && layoutId) {\n switchLayoutGroup.register(projection);\n }\n if (hasTakenAnySnapshot) {\n projection.root.didUpdate();\n }\n projection.addEventListener(\"animationComplete\", () => {\n this.safeToRemove();\n });\n projection.setOptions({\n ...projection.options,\n layoutDependency: this.props.layoutDependency,\n onExitComplete: () => this.safeToRemove(),\n });\n }\n globalProjectionState.hasEverUpdated = true;\n }\n getSnapshotBeforeUpdate(prevProps) {\n const { layoutDependency, visualElement, drag, isPresent } = this.props;\n const { projection } = visualElement;\n if (!projection)\n return null;\n /**\n * TODO: We use this data in relegate to determine whether to\n * promote a previous element. There's no guarantee its presence data\n * will have updated by this point - if a bug like this arises it will\n * have to be that we markForRelegation and then find a new lead some other way,\n * perhaps in didUpdate\n */\n projection.isPresent = isPresent;\n if (prevProps.layoutDependency !== layoutDependency) {\n projection.setOptions({\n ...projection.options,\n layoutDependency,\n });\n }\n hasTakenAnySnapshot = true;\n if (drag ||\n prevProps.layoutDependency !== layoutDependency ||\n layoutDependency === undefined ||\n prevProps.isPresent !== isPresent) {\n projection.willUpdate();\n }\n else {\n this.safeToRemove();\n }\n if (prevProps.isPresent !== isPresent) {\n if (isPresent) {\n projection.promote();\n }\n else if (!projection.relegate()) {\n /**\n * If there's another stack member taking over from this one,\n * it's in charge of the exit animation and therefore should\n * be in charge of the safe to remove. Otherwise we call it here.\n */\n frame.postRender(() => {\n const stack = projection.getStack();\n if (!stack || !stack.members.length) {\n this.safeToRemove();\n }\n });\n }\n }\n return null;\n }\n componentDidUpdate() {\n const { visualElement, layoutAnchor } = this.props;\n const { projection } = visualElement;\n if (projection) {\n projection.options.layoutAnchor = layoutAnchor;\n projection.root.didUpdate();\n microtask.postRender(() => {\n if (!projection.currentAnimation && projection.isLead()) {\n this.safeToRemove();\n }\n });\n }\n }\n componentWillUnmount() {\n const { visualElement, layoutGroup, switchLayoutGroup: promoteContext, } = this.props;\n const { projection } = visualElement;\n hasTakenAnySnapshot = true;\n if (projection) {\n projection.scheduleCheckAfterUnmount();\n if (layoutGroup && layoutGroup.group)\n layoutGroup.group.remove(projection);\n if (promoteContext && promoteContext.deregister)\n promoteContext.deregister(projection);\n }\n }\n safeToRemove() {\n const { safeToRemove } = this.props;\n safeToRemove && safeToRemove();\n }\n render() {\n return null;\n }\n}\nexport function MeasureLayout(props) {\n const [isPresent, safeToRemove] = usePresence();\n const layoutGroup = useContext(LayoutGroupContext);\n return (_jsx(MeasureLayoutWithContext, { ...props, layoutGroup: layoutGroup, switchLayoutGroup: useContext(SwitchLayoutGroupContext), isPresent: isPresent, safeToRemove: safeToRemove }));\n}\n//# sourceMappingURL=MeasureLayout.js.map","\"use client\";\nimport { useCallback, useContext, useEffect, useId } from \"react\";\nimport { PresenceContext, } from \"../../context/PresenceContext\";\n/**\n * When a component is the child of `AnimatePresence`, it can use `usePresence`\n * to access information about whether it's still present in the React tree.\n *\n * ```jsx\n * import { usePresence } from \"framer-motion\"\n *\n * export const Component = () => {\n * const [isPresent, safeToRemove] = usePresence()\n *\n * useEffect(() => {\n * !isPresent && setTimeout(safeToRemove, 1000)\n * }, [isPresent])\n *\n * return

\n * }\n * ```\n *\n * If `isPresent` is `false`, it means that a component has been removed from the tree,\n * but `AnimatePresence` won't really remove it until `safeToRemove` has been called.\n *\n * @public\n */\nexport function usePresence(subscribe = true) {\n const context = useContext(PresenceContext);\n if (context === null)\n return [true, null];\n const { isPresent, onExitComplete, register } = context;\n // It's safe to call the following hooks conditionally (after an early return) because the context will always\n // either be null or non-null for the lifespan of the component.\n const id = useId();\n useEffect(() => {\n if (subscribe) {\n return register(id);\n }\n }, [subscribe]);\n const safeToRemove = useCallback(() => subscribe && onExitComplete && onExitComplete(id), [id, onExitComplete, subscribe]);\n return !isPresent && onExitComplete ? [false, safeToRemove] : [true];\n}\n/**\n * Similar to `usePresence`, except `useIsPresent` simply returns whether or not the component is present.\n * There is no `safeToRemove` function.\n *\n * ```jsx\n * import { useIsPresent } from \"framer-motion\"\n *\n * export const Component = () => {\n * const isPresent = useIsPresent()\n *\n * useEffect(() => {\n * !isPresent && console.log(\"I've been removed!\")\n * }, [isPresent])\n *\n * return
\n * }\n * ```\n *\n * @public\n */\nexport function useIsPresent() {\n return isPresent(useContext(PresenceContext));\n}\nexport function isPresent(context) {\n return context === null ? true : context.isPresent;\n}\n//# sourceMappingURL=use-presence.js.map","import { DragGesture } from \"../../gestures/drag\";\nimport { PanGesture } from \"../../gestures/pan\";\nimport { HTMLProjectionNode } from \"../../projection\";\nimport { MeasureLayout } from \"./layout/MeasureLayout\";\nexport const drag = {\n pan: {\n Feature: PanGesture,\n },\n drag: {\n Feature: DragGesture,\n ProjectionNode: HTMLProjectionNode,\n MeasureLayout,\n },\n};\n//# sourceMappingURL=drag.js.map","import { Feature } from \"motion-dom\";\nimport { noop } from \"motion-utils\";\nimport { VisualElementDragControls } from \"./VisualElementDragControls\";\nexport class DragGesture extends Feature {\n constructor(node) {\n super(node);\n this.removeGroupControls = noop;\n this.removeListeners = noop;\n this.controls = new VisualElementDragControls(node);\n }\n mount() {\n // If we've been provided a DragControls for manual control over the drag gesture,\n // subscribe this component to it on mount.\n const { dragControls } = this.node.getProps();\n if (dragControls) {\n this.removeGroupControls = dragControls.subscribe(this.controls);\n }\n this.removeListeners = this.controls.addListeners() || noop;\n }\n update() {\n const { dragControls } = this.node.getProps();\n const { dragControls: prevDragControls } = this.node.prevProps || {};\n if (dragControls !== prevDragControls) {\n this.removeGroupControls();\n if (dragControls) {\n this.removeGroupControls = dragControls.subscribe(this.controls);\n }\n }\n }\n unmount() {\n this.removeGroupControls();\n this.removeListeners();\n /**\n * In React 19, during list reorder reconciliation, components may\n * briefly unmount and remount while the drag is still active. If we're\n * actively dragging, we should NOT end the pan session - it will\n * continue tracking pointer events via its window-level listeners.\n *\n * The pan session will be properly cleaned up when:\n * 1. The drag ends naturally (pointerup/pointercancel)\n * 2. The component is truly removed from the DOM\n */\n if (!this.controls.isDragging) {\n this.controls.endPanSession();\n }\n }\n}\n//# sourceMappingURL=index.js.map","import { Feature, frame, hover } from \"motion-dom\";\nimport { extractEventInfo } from \"../events/event-info\";\nfunction handleHoverEvent(node, event, lifecycle) {\n const { props } = node;\n if (node.animationState && props.whileHover) {\n node.animationState.setActive(\"whileHover\", lifecycle === \"Start\");\n }\n const eventName = (\"onHover\" + lifecycle);\n const callback = props[eventName];\n if (callback) {\n frame.postRender(() => callback(event, extractEventInfo(event)));\n }\n}\nexport class HoverGesture extends Feature {\n mount() {\n const { current } = this.node;\n if (!current)\n return;\n this.unmount = hover(current, (_element, startEvent) => {\n handleHoverEvent(this.node, startEvent, \"Start\");\n return (endEvent) => handleHoverEvent(this.node, endEvent, \"End\");\n });\n }\n unmount() { }\n}\n//# sourceMappingURL=hover.js.map","import { Feature, frame, press } from \"motion-dom\";\nimport { extractEventInfo } from \"../events/event-info\";\nfunction handlePressEvent(node, event, lifecycle) {\n const { props } = node;\n if (node.current instanceof HTMLButtonElement && node.current.disabled) {\n return;\n }\n if (node.animationState && props.whileTap) {\n node.animationState.setActive(\"whileTap\", lifecycle === \"Start\");\n }\n const eventName = (\"onTap\" + (lifecycle === \"End\" ? \"\" : lifecycle));\n const callback = props[eventName];\n if (callback) {\n frame.postRender(() => callback(event, extractEventInfo(event)));\n }\n}\nexport class PressGesture extends Feature {\n mount() {\n const { current } = this.node;\n if (!current)\n return;\n const { globalTapTarget, propagate } = this.node.props;\n this.unmount = press(current, (_element, startEvent) => {\n handlePressEvent(this.node, startEvent, \"Start\");\n return (endEvent, { success }) => handlePressEvent(this.node, endEvent, success ? \"End\" : \"Cancel\");\n }, {\n useGlobalTarget: globalTapTarget,\n stopPropagation: propagate?.tap === false,\n });\n }\n unmount() { }\n}\n//# sourceMappingURL=press.js.map","/**\n * Map an IntersectionHandler callback to an element. We only ever make one handler for one\n * element, so even though these handlers might all be triggered by different\n * observers, we can keep them in the same map.\n */\nconst observerCallbacks = new WeakMap();\n/**\n * Multiple observers can be created for multiple element/document roots. Each with\n * different settings. So here we store dictionaries of observers to each root,\n * using serialised settings (threshold/margin) as lookup keys.\n */\nconst observers = new WeakMap();\nconst fireObserverCallback = (entry) => {\n const callback = observerCallbacks.get(entry.target);\n callback && callback(entry);\n};\nconst fireAllObserverCallbacks = (entries) => {\n entries.forEach(fireObserverCallback);\n};\nfunction initIntersectionObserver({ root, ...options }) {\n const lookupRoot = root || document;\n /**\n * If we don't have an observer lookup map for this root, create one.\n */\n if (!observers.has(lookupRoot)) {\n observers.set(lookupRoot, {});\n }\n const rootObservers = observers.get(lookupRoot);\n const key = JSON.stringify(options);\n /**\n * If we don't have an observer for this combination of root and settings,\n * create one.\n */\n if (!rootObservers[key]) {\n rootObservers[key] = new IntersectionObserver(fireAllObserverCallbacks, { root, ...options });\n }\n return rootObservers[key];\n}\nexport function observeIntersection(element, options, callback) {\n const rootInteresectionObserver = initIntersectionObserver(options);\n observerCallbacks.set(element, callback);\n rootInteresectionObserver.observe(element);\n return () => {\n observerCallbacks.delete(element);\n rootInteresectionObserver.unobserve(element);\n };\n}\n//# sourceMappingURL=observers.js.map","import { Feature } from \"motion-dom\";\nimport { observeIntersection } from \"./observers\";\nconst thresholdNames = {\n some: 0,\n all: 1,\n};\nexport class InViewFeature extends Feature {\n constructor() {\n super(...arguments);\n this.hasEnteredView = false;\n this.isInView = false;\n }\n startObserver() {\n this.stopObserver?.();\n const { viewport = {} } = this.node.getProps();\n const { root, margin: rootMargin, amount = \"some\", once } = viewport;\n const options = {\n root: root ? root.current : undefined,\n rootMargin,\n threshold: typeof amount === \"number\" ? amount : thresholdNames[amount],\n };\n const onIntersectionUpdate = (entry) => {\n const { isIntersecting } = entry;\n /**\n * If there's been no change in the viewport state, early return.\n */\n if (this.isInView === isIntersecting)\n return;\n this.isInView = isIntersecting;\n /**\n * Handle hasEnteredView. If this is only meant to run once, and\n * element isn't visible, early return. Otherwise set hasEnteredView to true.\n */\n if (once && !isIntersecting && this.hasEnteredView) {\n return;\n }\n else if (isIntersecting) {\n this.hasEnteredView = true;\n }\n if (this.node.animationState) {\n this.node.animationState.setActive(\"whileInView\", isIntersecting);\n }\n /**\n * Use the latest committed props rather than the ones in scope\n * when this observer is created\n */\n const { onViewportEnter, onViewportLeave } = this.node.getProps();\n const callback = isIntersecting ? onViewportEnter : onViewportLeave;\n callback && callback(entry);\n };\n this.stopObserver = observeIntersection(this.node.current, options, onIntersectionUpdate);\n }\n mount() {\n this.startObserver();\n }\n update() {\n if (typeof IntersectionObserver === \"undefined\")\n return;\n const { props, prevProps } = this.node;\n const hasOptionsChanged = [\"amount\", \"margin\", \"root\"].some(hasViewportOptionChanged(props, prevProps));\n if (hasOptionsChanged) {\n this.startObserver();\n }\n }\n unmount() {\n this.stopObserver?.();\n this.hasEnteredView = false;\n this.isInView = false;\n }\n}\nfunction hasViewportOptionChanged({ viewport = {} }, { viewport: prevViewport = {} } = {}) {\n return (name) => viewport[name] !== prevViewport[name];\n}\n//# sourceMappingURL=index.js.map","import { HoverGesture } from \"../../gestures/hover\";\nimport { FocusGesture } from \"../../gestures/focus\";\nimport { PressGesture } from \"../../gestures/press\";\nimport { InViewFeature } from \"./viewport\";\nexport const gestureAnimations = {\n inView: {\n Feature: InViewFeature,\n },\n tap: {\n Feature: PressGesture,\n },\n focus: {\n Feature: FocusGesture,\n },\n hover: {\n Feature: HoverGesture,\n },\n};\n//# sourceMappingURL=gestures.js.map","import { animations } from \"../../../motion/features/animations\";\nimport { drag } from \"../../../motion/features/drag\";\nimport { gestureAnimations } from \"../../../motion/features/gestures\";\nimport { layout } from \"../../../motion/features/layout\";\nexport const featureBundle = {\n ...animations,\n ...gestureAnimations,\n ...drag,\n ...layout,\n};\n//# sourceMappingURL=feature-bundle.js.map","import { Feature, addDomEvent } from \"motion-dom\";\nimport { pipe } from \"motion-utils\";\nexport class FocusGesture extends Feature {\n constructor() {\n super(...arguments);\n this.isActive = false;\n }\n onFocus() {\n let isFocusVisible = false;\n /**\n * If this element doesn't match focus-visible then don't\n * apply whileHover. But, if matches throws that focus-visible\n * is not a valid selector then in that browser outline styles will be applied\n * to the element by default and we want to match that behaviour with whileFocus.\n */\n try {\n isFocusVisible = this.node.current.matches(\":focus-visible\");\n }\n catch (e) {\n isFocusVisible = true;\n }\n if (!isFocusVisible || !this.node.animationState)\n return;\n this.node.animationState.setActive(\"whileFocus\", true);\n this.isActive = true;\n }\n onBlur() {\n if (!this.isActive || !this.node.animationState)\n return;\n this.node.animationState.setActive(\"whileFocus\", false);\n this.isActive = false;\n }\n mount() {\n this.unmount = pipe(addDomEvent(this.node.current, \"focus\", () => this.onFocus()), addDomEvent(this.node.current, \"blur\", () => this.onBlur()));\n }\n unmount() { }\n}\n//# sourceMappingURL=focus.js.map","import { HTMLProjectionNode } from \"motion-dom\";\nimport { MeasureLayout } from \"./layout/MeasureLayout\";\nexport const layout = {\n layout: {\n ProjectionNode: HTMLProjectionNode,\n MeasureLayout,\n },\n};\n//# sourceMappingURL=layout.js.map","import { createMotionComponent } from \"../../../motion\";\nimport { createDomVisualElement } from \"../../dom/create-visual-element\";\nimport { featureBundle } from \"./feature-bundle\";\nexport function createMotionComponentWithFeatures(Component, options) {\n return createMotionComponent(Component, options, featureBundle, createDomVisualElement);\n}\n//# sourceMappingURL=create.js.map","\"use client\";\nimport { createMotionComponentWithFeatures as createMotionComponent } from \"./create\";\n/**\n * HTML components\n */\nexport const MotionA = /*@__PURE__*/ createMotionComponent(\"a\");\nexport const MotionAbbr = /*@__PURE__*/ createMotionComponent(\"abbr\");\nexport const MotionAddress = /*@__PURE__*/ createMotionComponent(\"address\");\nexport const MotionArea = /*@__PURE__*/ createMotionComponent(\"area\");\nexport const MotionArticle = /*@__PURE__*/ createMotionComponent(\"article\");\nexport const MotionAside = /*@__PURE__*/ createMotionComponent(\"aside\");\nexport const MotionAudio = /*@__PURE__*/ createMotionComponent(\"audio\");\nexport const MotionB = /*@__PURE__*/ createMotionComponent(\"b\");\nexport const MotionBase = /*@__PURE__*/ createMotionComponent(\"base\");\nexport const MotionBdi = /*@__PURE__*/ createMotionComponent(\"bdi\");\nexport const MotionBdo = /*@__PURE__*/ createMotionComponent(\"bdo\");\nexport const MotionBig = /*@__PURE__*/ createMotionComponent(\"big\");\nexport const MotionBlockquote = \n/*@__PURE__*/ createMotionComponent(\"blockquote\");\nexport const MotionBody = /*@__PURE__*/ createMotionComponent(\"body\");\nexport const MotionButton = /*@__PURE__*/ createMotionComponent(\"button\");\nexport const MotionCanvas = /*@__PURE__*/ createMotionComponent(\"canvas\");\nexport const MotionCaption = /*@__PURE__*/ createMotionComponent(\"caption\");\nexport const MotionCite = /*@__PURE__*/ createMotionComponent(\"cite\");\nexport const MotionCode = /*@__PURE__*/ createMotionComponent(\"code\");\nexport const MotionCol = /*@__PURE__*/ createMotionComponent(\"col\");\nexport const MotionColgroup = /*@__PURE__*/ createMotionComponent(\"colgroup\");\nexport const MotionData = /*@__PURE__*/ createMotionComponent(\"data\");\nexport const MotionDatalist = /*@__PURE__*/ createMotionComponent(\"datalist\");\nexport const MotionDd = /*@__PURE__*/ createMotionComponent(\"dd\");\nexport const MotionDel = /*@__PURE__*/ createMotionComponent(\"del\");\nexport const MotionDetails = /*@__PURE__*/ createMotionComponent(\"details\");\nexport const MotionDfn = /*@__PURE__*/ createMotionComponent(\"dfn\");\nexport const MotionDialog = /*@__PURE__*/ createMotionComponent(\"dialog\");\nexport const MotionDiv = /*@__PURE__*/ createMotionComponent(\"div\");\nexport const MotionDl = /*@__PURE__*/ createMotionComponent(\"dl\");\nexport const MotionDt = /*@__PURE__*/ createMotionComponent(\"dt\");\nexport const MotionEm = /*@__PURE__*/ createMotionComponent(\"em\");\nexport const MotionEmbed = /*@__PURE__*/ createMotionComponent(\"embed\");\nexport const MotionFieldset = /*@__PURE__*/ createMotionComponent(\"fieldset\");\nexport const MotionFigcaption = \n/*@__PURE__*/ createMotionComponent(\"figcaption\");\nexport const MotionFigure = /*@__PURE__*/ createMotionComponent(\"figure\");\nexport const MotionFooter = /*@__PURE__*/ createMotionComponent(\"footer\");\nexport const MotionForm = /*@__PURE__*/ createMotionComponent(\"form\");\nexport const MotionH1 = /*@__PURE__*/ createMotionComponent(\"h1\");\nexport const MotionH2 = /*@__PURE__*/ createMotionComponent(\"h2\");\nexport const MotionH3 = /*@__PURE__*/ createMotionComponent(\"h3\");\nexport const MotionH4 = /*@__PURE__*/ createMotionComponent(\"h4\");\nexport const MotionH5 = /*@__PURE__*/ createMotionComponent(\"h5\");\nexport const MotionH6 = /*@__PURE__*/ createMotionComponent(\"h6\");\nexport const MotionHead = /*@__PURE__*/ createMotionComponent(\"head\");\nexport const MotionHeader = /*@__PURE__*/ createMotionComponent(\"header\");\nexport const MotionHgroup = /*@__PURE__*/ createMotionComponent(\"hgroup\");\nexport const MotionHr = /*@__PURE__*/ createMotionComponent(\"hr\");\nexport const MotionHtml = /*@__PURE__*/ createMotionComponent(\"html\");\nexport const MotionI = /*@__PURE__*/ createMotionComponent(\"i\");\nexport const MotionIframe = /*@__PURE__*/ createMotionComponent(\"iframe\");\nexport const MotionImg = /*@__PURE__*/ createMotionComponent(\"img\");\nexport const MotionInput = /*@__PURE__*/ createMotionComponent(\"input\");\nexport const MotionIns = /*@__PURE__*/ createMotionComponent(\"ins\");\nexport const MotionKbd = /*@__PURE__*/ createMotionComponent(\"kbd\");\nexport const MotionKeygen = /*@__PURE__*/ createMotionComponent(\"keygen\");\nexport const MotionLabel = /*@__PURE__*/ createMotionComponent(\"label\");\nexport const MotionLegend = /*@__PURE__*/ createMotionComponent(\"legend\");\nexport const MotionLi = /*@__PURE__*/ createMotionComponent(\"li\");\nexport const MotionLink = /*@__PURE__*/ createMotionComponent(\"link\");\nexport const MotionMain = /*@__PURE__*/ createMotionComponent(\"main\");\nexport const MotionMap = /*@__PURE__*/ createMotionComponent(\"map\");\nexport const MotionMark = /*@__PURE__*/ createMotionComponent(\"mark\");\nexport const MotionMenu = /*@__PURE__*/ createMotionComponent(\"menu\");\nexport const MotionMenuitem = /*@__PURE__*/ createMotionComponent(\"menuitem\");\nexport const MotionMeter = /*@__PURE__*/ createMotionComponent(\"meter\");\nexport const MotionNav = /*@__PURE__*/ createMotionComponent(\"nav\");\nexport const MotionObject = /*@__PURE__*/ createMotionComponent(\"object\");\nexport const MotionOl = /*@__PURE__*/ createMotionComponent(\"ol\");\nexport const MotionOptgroup = /*@__PURE__*/ createMotionComponent(\"optgroup\");\nexport const MotionOption = /*@__PURE__*/ createMotionComponent(\"option\");\nexport const MotionOutput = /*@__PURE__*/ createMotionComponent(\"output\");\nexport const MotionP = /*@__PURE__*/ createMotionComponent(\"p\");\nexport const MotionParam = /*@__PURE__*/ createMotionComponent(\"param\");\nexport const MotionPicture = /*@__PURE__*/ createMotionComponent(\"picture\");\nexport const MotionPre = /*@__PURE__*/ createMotionComponent(\"pre\");\nexport const MotionProgress = /*@__PURE__*/ createMotionComponent(\"progress\");\nexport const MotionQ = /*@__PURE__*/ createMotionComponent(\"q\");\nexport const MotionRp = /*@__PURE__*/ createMotionComponent(\"rp\");\nexport const MotionRt = /*@__PURE__*/ createMotionComponent(\"rt\");\nexport const MotionRuby = /*@__PURE__*/ createMotionComponent(\"ruby\");\nexport const MotionS = /*@__PURE__*/ createMotionComponent(\"s\");\nexport const MotionSamp = /*@__PURE__*/ createMotionComponent(\"samp\");\nexport const MotionScript = /*@__PURE__*/ createMotionComponent(\"script\");\nexport const MotionSection = /*@__PURE__*/ createMotionComponent(\"section\");\nexport const MotionSelect = /*@__PURE__*/ createMotionComponent(\"select\");\nexport const MotionSmall = /*@__PURE__*/ createMotionComponent(\"small\");\nexport const MotionSource = /*@__PURE__*/ createMotionComponent(\"source\");\nexport const MotionSpan = /*@__PURE__*/ createMotionComponent(\"span\");\nexport const MotionStrong = /*@__PURE__*/ createMotionComponent(\"strong\");\nexport const MotionStyle = /*@__PURE__*/ createMotionComponent(\"style\");\nexport const MotionSub = /*@__PURE__*/ createMotionComponent(\"sub\");\nexport const MotionSummary = /*@__PURE__*/ createMotionComponent(\"summary\");\nexport const MotionSup = /*@__PURE__*/ createMotionComponent(\"sup\");\nexport const MotionTable = /*@__PURE__*/ createMotionComponent(\"table\");\nexport const MotionTbody = /*@__PURE__*/ createMotionComponent(\"tbody\");\nexport const MotionTd = /*@__PURE__*/ createMotionComponent(\"td\");\nexport const MotionTextarea = /*@__PURE__*/ createMotionComponent(\"textarea\");\nexport const MotionTfoot = /*@__PURE__*/ createMotionComponent(\"tfoot\");\nexport const MotionTh = /*@__PURE__*/ createMotionComponent(\"th\");\nexport const MotionThead = /*@__PURE__*/ createMotionComponent(\"thead\");\nexport const MotionTime = /*@__PURE__*/ createMotionComponent(\"time\");\nexport const MotionTitle = /*@__PURE__*/ createMotionComponent(\"title\");\nexport const MotionTr = /*@__PURE__*/ createMotionComponent(\"tr\");\nexport const MotionTrack = /*@__PURE__*/ createMotionComponent(\"track\");\nexport const MotionU = /*@__PURE__*/ createMotionComponent(\"u\");\nexport const MotionUl = /*@__PURE__*/ createMotionComponent(\"ul\");\nexport const MotionVideo = /*@__PURE__*/ createMotionComponent(\"video\");\nexport const MotionWbr = /*@__PURE__*/ createMotionComponent(\"wbr\");\nexport const MotionWebview = /*@__PURE__*/ createMotionComponent(\"webview\");\n/**\n * SVG components\n */\nexport const MotionAnimate = /*@__PURE__*/ createMotionComponent(\"animate\");\nexport const MotionCircle = /*@__PURE__*/ createMotionComponent(\"circle\");\nexport const MotionDefs = /*@__PURE__*/ createMotionComponent(\"defs\");\nexport const MotionDesc = /*@__PURE__*/ createMotionComponent(\"desc\");\nexport const MotionEllipse = /*@__PURE__*/ createMotionComponent(\"ellipse\");\nexport const MotionG = /*@__PURE__*/ createMotionComponent(\"g\");\nexport const MotionImage = /*@__PURE__*/ createMotionComponent(\"image\");\nexport const MotionLine = /*@__PURE__*/ createMotionComponent(\"line\");\nexport const MotionFilter = /*@__PURE__*/ createMotionComponent(\"filter\");\nexport const MotionMarker = /*@__PURE__*/ createMotionComponent(\"marker\");\nexport const MotionMask = /*@__PURE__*/ createMotionComponent(\"mask\");\nexport const MotionMetadata = /*@__PURE__*/ createMotionComponent(\"metadata\");\nexport const MotionPath = /*@__PURE__*/ createMotionComponent(\"path\");\nexport const MotionPattern = /*@__PURE__*/ createMotionComponent(\"pattern\");\nexport const MotionPolygon = /*@__PURE__*/ createMotionComponent(\"polygon\");\nexport const MotionPolyline = /*@__PURE__*/ createMotionComponent(\"polyline\");\nexport const MotionRect = /*@__PURE__*/ createMotionComponent(\"rect\");\nexport const MotionStop = /*@__PURE__*/ createMotionComponent(\"stop\");\nexport const MotionSvg = /*@__PURE__*/ createMotionComponent(\"svg\");\nexport const MotionSymbol = /*@__PURE__*/ createMotionComponent(\"symbol\");\nexport const MotionText = /*@__PURE__*/ createMotionComponent(\"text\");\nexport const MotionTspan = /*@__PURE__*/ createMotionComponent(\"tspan\");\nexport const MotionUse = /*@__PURE__*/ createMotionComponent(\"use\");\nexport const MotionView = /*@__PURE__*/ createMotionComponent(\"view\");\nexport const MotionClipPath = /*@__PURE__*/ createMotionComponent(\"clipPath\");\nexport const MotionFeBlend = /*@__PURE__*/ createMotionComponent(\"feBlend\");\nexport const MotionFeColorMatrix = \n/*@__PURE__*/ createMotionComponent(\"feColorMatrix\");\nexport const MotionFeComponentTransfer = /*@__PURE__*/ createMotionComponent(\"feComponentTransfer\");\nexport const MotionFeComposite = \n/*@__PURE__*/ createMotionComponent(\"feComposite\");\nexport const MotionFeConvolveMatrix = \n/*@__PURE__*/ createMotionComponent(\"feConvolveMatrix\");\nexport const MotionFeDiffuseLighting = \n/*@__PURE__*/ createMotionComponent(\"feDiffuseLighting\");\nexport const MotionFeDisplacementMap = \n/*@__PURE__*/ createMotionComponent(\"feDisplacementMap\");\nexport const MotionFeDistantLight = \n/*@__PURE__*/ createMotionComponent(\"feDistantLight\");\nexport const MotionFeDropShadow = \n/*@__PURE__*/ createMotionComponent(\"feDropShadow\");\nexport const MotionFeFlood = /*@__PURE__*/ createMotionComponent(\"feFlood\");\nexport const MotionFeFuncA = /*@__PURE__*/ createMotionComponent(\"feFuncA\");\nexport const MotionFeFuncB = /*@__PURE__*/ createMotionComponent(\"feFuncB\");\nexport const MotionFeFuncG = /*@__PURE__*/ createMotionComponent(\"feFuncG\");\nexport const MotionFeFuncR = /*@__PURE__*/ createMotionComponent(\"feFuncR\");\nexport const MotionFeGaussianBlur = \n/*@__PURE__*/ createMotionComponent(\"feGaussianBlur\");\nexport const MotionFeImage = /*@__PURE__*/ createMotionComponent(\"feImage\");\nexport const MotionFeMerge = /*@__PURE__*/ createMotionComponent(\"feMerge\");\nexport const MotionFeMergeNode = \n/*@__PURE__*/ createMotionComponent(\"feMergeNode\");\nexport const MotionFeMorphology = \n/*@__PURE__*/ createMotionComponent(\"feMorphology\");\nexport const MotionFeOffset = /*@__PURE__*/ createMotionComponent(\"feOffset\");\nexport const MotionFePointLight = \n/*@__PURE__*/ createMotionComponent(\"fePointLight\");\nexport const MotionFeSpecularLighting = \n/*@__PURE__*/ createMotionComponent(\"feSpecularLighting\");\nexport const MotionFeSpotLight = \n/*@__PURE__*/ createMotionComponent(\"feSpotLight\");\nexport const MotionFeTile = /*@__PURE__*/ createMotionComponent(\"feTile\");\nexport const MotionFeTurbulence = \n/*@__PURE__*/ createMotionComponent(\"feTurbulence\");\nexport const MotionForeignObject = \n/*@__PURE__*/ createMotionComponent(\"foreignObject\");\nexport const MotionLinearGradient = \n/*@__PURE__*/ createMotionComponent(\"linearGradient\");\nexport const MotionRadialGradient = \n/*@__PURE__*/ createMotionComponent(\"radialGradient\");\nexport const MotionTextPath = /*@__PURE__*/ createMotionComponent(\"textPath\");\n//# sourceMappingURL=elements.js.map","import { motion } from \"./\";\nexport const MotionDiv = motion.div;\n//# sourceMappingURL=size.js.map"],"names":["addUniqueItem","arr","item","indexOf","push","removeItem","index","splice","clamp","min","max","v","formatErrorMessage","message","errorCode","warning","invariant","process","env","NODE_ENV","check","console","warn","Error","MotionGlobalConfig","isNumericalString","test","isObject","value","isZeroValueString","memo","callback","result","undefined","noop","any","pipe","transformers","reduce","a","b","progress","from","to","range","SubscriptionManager","constructor","this","subscriptions","add","handler","notify","c","numSubscriptions","length","i","getSize","clear","secondsToMilliseconds","seconds","millisecondsToSeconds","milliseconds","velocityPerSecond","velocity","frameDuration","calcBezier","t","a1","a2","cubicBezier","mX1","mY1","mX2","mY2","getTForX","aX","x","lowerBound","upperBound","currentX","currentT","Math","abs","binarySubdivide","mirrorEasing","easing","p","reverseEasing","backOut","backIn","backInOut","anticipate","pow","circIn","sin","acos","circOut","circInOut","easeIn","easeOut","easeInOut","isBezierDefinition","Array","isArray","easingLookup","linear","easingDefinitionToFunction","definition","x1","y1","x2","y2","LayoutGroupContext","createContext","LazyContext","strict","MotionConfigContext","transformPagePoint","isStatic","reducedMotion","MotionContext","stepsOrder","createRenderBatcher","scheduleNextBatch","allowKeepAlive","runNextFrame","useDefaultElapsed","state","delta","timestamp","isProcessing","flagRunNextFrame","steps","acc","key","thisFrame","Set","nextFrame","flushNextFrame","toKeepAlive","WeakSet","latestFrameData","triggerCallback","has","step","schedule","keepAlive","immediate","queue","cancel","delete","frameData","prevFrame","forEach","createRenderStep","setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender","processBatch","useManualTiming","performance","now","frame","cancelFrame","frameSteps","requestAnimationFrame","clearTime","time","set","newTime","queueMicrotask","checkStringStartsWith","token","startsWith","isCSSVariableName","startsAsVariableToken","isCSSVariableToken","singleCssVariableRegex","split","trim","containsCSSVariable","includes","number","parse","parseFloat","transform","alpha","scale","default","sanitize","round","floatRegex","singleColorRegex","isColorString","type","testProp","Boolean","isNullish","Object","prototype","hasOwnProperty","call","splitColor","aName","bName","cName","match","rgbUnit","clampRgbUnit","rgba","red","green","blue","alpha$1","hex","r","g","substring","parseInt","createUnitType","unit","endsWith","degrees","percent","px","vh","vw","progressPercentage","hsla","hue","saturation","lightness","color","getAnimatableNone","parsed","colorRegex","NUMBER_TOKEN","COLOR_TOKEN","complexRegex","analyseComplexValue","originalValue","toString","values","indexes","var","types","replace","parsedValue","buildTransformer","numSections","output","convertToZero","splitBefore","complex","isNaN","createTransformer","source","info","transformer","map","hueToRgb","q","mixImmediate","mixNumber","mixLinearColor","fromExpo","expo","sqrt","colorTypes","asRGBA","find","model","hslaToRgba","mixColor","fromRGBA","toRGBA","blended","invisibleValues","mixNumber$1","getMixer","mixComplex","mixArray","mixObject","numValues","blendValue","origin","target","template","originStats","targetStats","mixVisibility","orderedOrigin","pointers","originIndex","originValue","matchOrder","mix","mixer","frameloopDriver","passTimestamp","start","stop","generateLinearEasing","duration","resolution","points","numPoints","maxGeneratorDuration","calcGeneratorDuration","generator","next","done","Infinity","springDefaults","granular","calcAngularFreq","undampedFreq","dampingRatio","safeMin","durationKeys","physicsKeys","isSpringType","options","keys","some","getSpringOptions","springOptions","stiffness","damping","mass","isResolvedFromDuration","visualDuration","root","PI","bounce","derived","envelope","derivative","exponentialDecay","exp","d","e","f","initialGuess","approximateRoot","findSpring","spring","optionsOrVisualDuration","keyframes","restSpeed","restDelta","initialVelocity","initialDelta","undampedAngularFreq","isGranularScale","resolveSpring","resolveVelocity","angularFreq","A","sinCoeff","cosCoeff","cos","C","dampedAngularFreq","freqForT","sinh","cosh","P","sinhCoeff","coshCoeff","calculatedDuration","current","currentVelocity","toTransition","applyToOptions","generatorOptions","createGenerator","ease","createGeneratorEasing","getGeneratorVelocity","resolveValue","prevT","inertia","power","timeConstant","bounceDamping","bounceStiffness","modifyTarget","nearestBoundary","amplitude","ideal","calcDelta","calcLatest","applyFriction","latest","timeReachedBoundary","spring$1","checkCatchBoundary","hasUpdatedFrame","interpolate","input","isClamp","inputLength","isZeroDeltaRange","reverse","mixers","customMixer","mixerFactory","numMixers","easingFunction","createMixers","interpolator","progressInRange","defaultOffset","offset","remaining","offsetProgress","fillOffset","keyframeValues","times","easingFunctions","isEasingArray","absoluteTimes","o","convertOffsetToTimes","mapTimeToKeyframe","isNotNull","getFinalKeyframe","repeat","repeatType","finalKeyframe","speed","resolvedKeyframes","filter","transitionTypeMap","decay","tween","replaceTransitionType","transition","WithPromise","updateFinished","finished","_finished","Promise","resolve","notifyFinished","then","onResolve","onReject","percentToProgress","JSAnimation","super","startTime","isStopped","currentTime","holdTime","playbackSpeed","delayState","motionValue","updatedAt","tick","teardown","onStop","initAnimation","play","autoplay","pause","repeatDelay","keyframes$1","generatorFactory","mixKeyframes","mirroredGenerator","resolvedDuration","totalDuration","updateTime","animationTime","sample","delay","onUpdate","timeWithoutDelay","isInDelayPhase","elapsed","frameGenerator","currentIteration","floor","iterationProgress","isAnimationFinished","finish","reject","iterationDuration","driver","s","newSpeed","hasChanged","onPlay","complete","onComplete","onCancel","stopDriver","sampleTime","attachTimeline","timeline","allowFlatten","observe","radToDeg","rad","rotate","angle","atan2","rebaseAngle","matrix2dParsers","y","translateX","translateY","scaleX","scaleY","rotateZ","skewX","atan","skewY","skew","matrix3dParsers","z","translateZ","rotateX","rotateY","defaultTransformValue","name","parseValueFromTransform","matrix3dMatch","parsers","matrix2dMatch","valueParser","convertTransformToNumber","transformPropOrder","transformProps","isNumOrPxType","transformKeys","nonTranslationalTransformKeys","positionalValues","width","paddingLeft","paddingRight","boxSizing","height","paddingTop","paddingBottom","top","_bbox","left","bottom","right","toResolve","isScheduled","anyNeedsMeasurement","isForced","measureAllKeyframes","resolversToMeasure","resolver","needsMeasurement","elementsToMeasure","element","transformsToRestore","Map","removedTransforms","visualElement","getValue","get","removeNonTranslationalTransform","measureInitialState","restore","measureEndState","suspendedScrollY","window","scrollTo","readAllKeyframes","readKeyframes","KeyframeResolver","unresolvedKeyframes","isAsync","scheduleResolve","currentValue","valueAsRead","readValue","fillWildcards","setFinalKeyframe","renderEndStyles","isForcedComplete","resume","setStyle","isCSSVar","style","setProperty","supportsFlags","memoSupports","supportsFlag","memoized","supportsScrollTimeline","ScrollTimeline","supportsLinearEasing","document","createElement","animate","opacity","cubicBezierAsString","supportedWaapiEasing","mapEasingToNativeEasing","segmentEasing","startWaapiAnimation","valueName","pseudoElement","keyframeOptions","fill","iterations","direction","isGenerator","NativeAnimation","finishedTime","manualStartTime","isPseudoElement","applyGeneratorOptions","animation","onfinish","keyframe","updateMotionValue","commitStyles","isConnected","effect","getComputedTiming","Number","wasFinished","playbackRate","playState","newStartTime","rangeStart","rangeEnd","updateTiming","unsupportedEasingFunctions","replaceStringEasing","NativeAnimationExtended","sampleAnimation","setWithVelocity","isAnimatable","makeAnimationInstant","acceleratedValues","browserColorFunctions","colorProperties","supportsWaapi","Element","supportsBrowserAnimation","subject","owner","HTMLElement","SVGElement","transformTemplate","getProps","hasBrowserOnlyColors","AsyncMotionValueAnimation","_animation","stopTimeline","keyframeResolver","createdAt","optionsWithDefaults","KeyframeResolver$1","forced","onKeyframesResolved","sync","isHandoff","resolvedAt","canAnimateValue","originKeyframe","targetKeyframe","isOriginAnimatable","isTargetAnimatable","hasKeyframesChanged","canAnimate","instantAnimations","resolvedOptions","useWaapi","catch","pendingTimeline","_onReject","finally","calcChildStagger","children","child","delayChildren","staggerChildren","staggerDirection","sort","sortNodePosition","numChildren","size","maxStaggerDuration","MotionValue","init","canTrackVelocity","events","updateAndNotify","setPrevFrameValue","prev","setCurrent","change","dependents","dependent","dirty","hasAnimated","prevFrameValue","prevUpdatedAt","onChange","subscription","on","eventName","unsubscribe","clearListeners","eventManagers","attach","passiveEffect","stopPassiveEffect","jump","endAnimation","addDependent","removeDependent","getPrevious","getVelocity","startAnimation","animationStart","animationComplete","clearAnimation","animationCancel","isAnimating","destroy","resolveTransition","parentTransition","inherit","_","rest","getValueTransition","valueTransition","underDampedSpring","keyframesTransition","getDefaultTransition","valueKey","orchestrationKeys","animateMotionValue","isTransitionDefined","assign","shouldSkip","skipAnimations","shouldSkipAnimations","isSync","splitCSSVariableRegex","getVariableValue","depth","fallback","exec","token1","token2","parseCSSVariable","resolved","getComputedStyle","getPropertyValue","trimmed","getValueState","resolveVariantFromProps","props","custom","variants","resolveVariant","positionalKeys","isKeyframesTarget","setMotionValue","hasValue","addValue","resolveFinalValueInKeyframes","isMotionValue","addValueToWillChange","willChange","WillChange","newWillChange","camelToDash","str","toLowerCase","optimizedAppearDataAttribute","getOptimisedAppearId","shouldBlockAnimation","protectedKeys","needsAnimating","shouldBlock","animateTarget","targetAndTransition","transitionOverride","transitionEnd","defaultTransition","reduceMotion","animations","animationTypeState","animationState","getState","path","animateVisualElement","latestValues","valueTarget","MotionHandoffAnimation","appearId","shouldReduceMotion","applyTransitionEnd","setTarget","all","animateVariant","variant","presenceContext","getAnimation","getChildAnimations","variantChildren","forwardDelay","animateChildren","when","first","last","testValueType","dimensionValueTypes","findDimensionValueType","isNone","maxDefaults","applyDefaultFilter","slice","defaultValue","functionRegex","functions","join","mask","int","numberValueTypes","borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","maxWidth","maxHeight","inset","insetBlock","insetBlockStart","insetBlockEnd","insetInline","insetInlineStart","insetInlineEnd","padding","paddingBlock","paddingBlockStart","paddingBlockEnd","paddingInline","paddingInlineStart","paddingInlineEnd","margin","marginTop","marginRight","marginBottom","marginLeft","marginBlock","marginBlockStart","marginBlockEnd","marginInline","marginInlineStart","marginInlineEnd","fontSize","backgroundPositionX","backgroundPositionY","pathRotation","scaleZ","distance","perspective","transformPerspective","originX","originY","originZ","zIndex","fillOpacity","strokeOpacity","numOctaves","defaultValueTypes","backgroundColor","outlineColor","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","WebkitFilter","WebkitMask","getDefaultValueType","customTypes","defaultValueType","invalidTemplates","DOMKeyframesResolver","resolveNoneKeyframes","originType","targetType","noneKeyframeIndexes","animatableTemplate","noneIndex","makeNoneKeyframesAnimatable","pageYOffset","measuredOrigin","measureViewportBox","measureKeyframe","finalKeyframeIndex","unsetTransformName","unsetTransformValue","cornerRadiusProps","resolveElements","elementOrSelector","scope","selectorCache","EventTarget","elements","querySelectorAll","getValueAsType","microtask","isDragging","isDragActive","setupGesture","gestureAbortController","AbortController","passive","signal","abort","hover","onHoverStart","eventOptions","hoverEndCallback","isPressed","deferredHoverEnd","endHover","event","removeEventListener","onPointerLeave","onPointerUp","leaveEvent","pointerType","addEventListener","enterEvent","onHoverEnd","isNodeOrChild","parent","parentElement","isPrimaryPointer","button","isPrimary","keyboardAccessibleElements","textInputElements","isPressing","filterEvents","firePointerEvent","dispatchEvent","PointerEvent","bubbles","isValidPressEvent","claimedPointerDownEvents","press","targetOrSelector","onPressStart","targets","cancelEvents","startPress","startEvent","currentTarget","stopPropagation","onPressEnd","endEventOptions","capture","onPointerEnd","endEvent","success","onPointerCancel","upEvent","useGlobalTarget","cancelEvent","focusEvent","handleKeydown","handleKeyup","enableKeyboardPress","tagName","isContentEditable","isElementKeyboardAccessible","hasAttribute","tabIndex","isSVGElement","resizeHandlers","WeakMap","observer","borderBoxAxis","svgAxis","htmlAxis","borderBoxSize","getBBox","getWidth","getHeight","notifyTarget","notifyAll","entries","resizeElement","ResizeObserver","elementHandlers","unobserve","windowCallbacks","windowResizeHandler","resizeWindow","innerWidth","innerHeight","resize","valueTypes","createBox","visualElementStore","isAnimationControls","isVariantLabel","variantPriorityOrder","variantProps","isControllingVariants","isVariantNode","prefersReducedMotion","hasReducedMotionListener","isBrowser","propEventHandlers","featureDefinitions","setFeatureDefinitions","definitions","VisualElement","scrapeMotionValuesFromProps","_props","_prevProps","_visualElement","reducedMotionConfig","blockInitialAnimation","visualState","features","valueSubscriptions","prevMotionValues","hasBeenMounted","propEventSubscriptions","notifyUpdate","triggerBuild","renderInstance","renderState","projection","renderScheduledAt","scheduleRender","baseTarget","initialValues","initial","skipAnimationsConfig","manuallyAnimateOnMount","initialMotionValues","mount","instance","removeFromVariantTree","addVariantChild","bindToMotionValue","matchMedia","motionMediaQuery","setReducedMotionPreferences","matches","initPrefersReducedMotion","addChild","unmount","remove","removeChild","feature","isMounted","enteringChildren","accelerate","factory","cleanup","valueIsTransform","onBindTransform","removeOnChange","latestValue","isTransformDirty","removeSyncCheck","MotionCheckAppearSync","other","sortInstanceNodePosition","updateFeatures","featureDefinition","isEnabled","Feature","FeatureConstructor","build","measureInstanceViewportBox","getStaticValue","setStaticValue","prevProps","prevPresenceContext","listener","nextValue","prevValue","existingValue","liveStyle","removeValue","updateMotionValuesFromProps","handleChildMotionValue","getVariant","getTransformPagePoint","getClosestVariantNode","closestVariantNode","removeValueFromRenderState","getBaseTargetFromProps","readValueFromInstance","setBaseTarget","getBaseTarget","valueFromInitial","args","scheduleRenderMicrotask","DOMVisualElement","arguments","compareDocumentPosition","vars","childSubscription","textContent","node","convertBoundingBoxToBox","isIdentityScale","hasScale","hasTransform","has2DTranslate","is2DTranslate","scalePoint","point","originPoint","applyPointDelta","translate","boxScale","applyAxisDelta","axis","applyBoxDelta","box","TREE_SCALE_SNAP_MIN","TREE_SCALE_SNAP_MAX","translateAxis","transformAxis","axisTranslate","axisScale","axisOrigin","resolveAxisTranslate","transformBox","sourceBox","resolveBox","transformPoint","topLeft","bottomRight","transformBoxPoints","getBoundingClientRect","translateAlias","numTransforms","buildHTMLStyles","transformOrigin","hasTransformOrigin","valueAsType","transformString","transformIsDefault","valueIsDefault","buildTransform","renderHTML","styleProp","elementStyle","applyProjectionStyles","pixelsToPercent","pixels","correctBorderRadius","correct","correctBoxShadow","treeScale","projectionDelta","original","shadow","xScale","yScale","averageScale","scaleCorrectors","applyTo","boxShadow","isForcedMotionValue","layout","layoutId","prevStyle","newValues","HTMLVisualElement","isProjecting","readTransformValue","computedStyle","dashKeys","array","camelKeys","cssStyleProperties","buildSVGAttrs","attrX","attrY","attrScale","pathLength","pathSpacing","pathOffset","isSVGTag","viewBox","attrs","spacing","useDashCase","buildSVGPath","camelCaseAttributes","tag","scrapeMotionValuesFromProps$1","charAt","toUpperCase","SVGVisualElement","defaultType","getAttribute","_styleProp","setAttribute","renderSVG","numVariantProps","getVariantContext","context","prop","shallowCompare","prevLength","reversePriorityOrder","numAnimationTypes","createAnimateFunction","resolvedDefinition","createAnimationState","createState","isInitialRender","wasReset","buildResolvedTypeValues","animateChanges","changedActiveType","removedKeys","encounteredKeys","removedVariantIndex","typeState","propIsVariant","activeDelta","isActive","isInherited","prevProp","prevResolvedValues","variantDidChange","checkVariantsDidChange","shouldAnimateType","handledRemovedValues","definitionList","resolvedValues","allKeys","markToAnimate","valueHasChanged","willAnimateViaParent","parentVariant","fallbackAnimation","initialTransition","fallbackTarget","shouldAnimate","setActive","setAnimateFunction","makeAnimator","reset","createTypeState","whileInView","whileHover","whileTap","whileDrag","whileFocus","exit","copyAxisInto","originAxis","copyBoxInto","originBox","copyAxisDeltaInto","originDelta","calcLength","calcAxisDelta","calcBoxDelta","calcRelativeAxis","relative","anchor","anchorPoint","calcRelativeAxisPosition","calcRelativePosition","removePointDelta","removeAxisTransforms","transforms","scaleKey","originKey","sourceAxis","removeAxisDelta","xKeys","yKeys","removeBoxTransforms","isAxisDeltaZero","isDeltaZero","axisEquals","axisEqualsRounded","boxEqualsRounded","aspectRatio","axisDeltaEquals","eachAxis","numBorders","asNumber","isPx","getRadius","radiusName","easeCrossfadeIn","compress","easeCrossfadeOut","addDomEvent","compareByDepth","FlatTree","isDirty","resolveMotionValue","NodeStack","members","member","lead","prevLead","inst","snapshot","promote","relegate","isPresent","preserveFollowOpacity","show","updateSnapshot","layoutDependency","prevDep","nextDep","resumeFrom","preserveOpacity","animationValues","isUpdating","isLayoutDirty","crossfade","hide","exitAnimationComplete","onExitComplete","resumingFrom","removeLeadSnapshot","globalProjectionState","hasAnimatedSinceResize","hasEverUpdated","transformAxes","id","resetDistortingTransform","sharedAnimationValues","cancelTreeOptimisedTransformAnimations","projectionNode","hasCheckedOptimisedAppear","MotionHasOptimisedAnimation","MotionCancelOptimisedAnimation","createProjectionNode","attachResizeListener","defaultParent","measureScroll","checkIsScrollRoot","resetTransform","animationId","animationCommitId","isTreeAnimating","isAnimationBlocked","isProjectionDirty","isSharedProjectionDirty","updateManuallyBlocked","updateBlockedByResize","isSVG","needsReset","shouldResetTransform","eventHandlers","hasTreeAnimated","layoutVersion","updateScheduled","scheduleUpdate","projectionUpdateScheduled","checkUpdateFailed","clearAllSnapshots","updateProjection","nodes","propagateDirtyNodes","resolveTargetDelta","calcProjection","cleanDirtyNodes","resolvedRelativeTargetAt","linkedParentVersion","hasProjected","isVisible","animationProgress","sharedNodes","notifyListeners","subscriptionManager","hasListeners","cancelDelay","resizeUnblockUpdate","newInnerWidth","timeout","checkElapsed","finishAnimation","registerSharedNode","hasLayoutChanged","hasRelativeLayoutChanged","newLayout","isTreeAnimationBlocked","relativeTarget","layoutTransition","defaultLayoutTransition","onLayoutAnimationStart","onLayoutAnimationComplete","hasTargetChanged","targetLayout","hasOnlyRelativeTargetChanged","layoutRoot","currentAnimation","animationOptions","setAnimationOrigin","isLead","willUpdate","stack","getStack","blockUpdate","unblockUpdate","isUpdateBlocked","startUpdate","resetSkewAndRotation","getTransformTemplate","shouldNotifyListeners","updateScroll","prevTransformTemplateValue","wasBlockedByResize","forceLayoutMeasure","clearMeasurements","clearIsLayoutDirty","ensureDraggedNodesSnapshotted","resetTransformStyle","updateLayout","notifyLayoutUpdate","didUpdate","clearSnapshot","removeLeadSnapshots","scheduleUpdateProjection","scheduleCheckAfterUnmount","measure","measuredBox","alwaysMeasureLayout","prevLayout","layoutCorrected","layoutBox","phase","layoutScroll","scroll","isRoot","wasRoot","isResetRequested","hasProjection","transformTemplateValue","transformTemplateHasChanged","removeTransform","pageBox","measurePageBox","removeElementScroll","roundAxis","checkNodeWasScrollRoot","boxWithoutScroll","applyTransform","transformOnly","withTransforms","boxWithoutTransform","setTargetDelta","targetDelta","setOptions","forceRelativeParentToResolveTarget","relativeParent","forceRecalculation","getLead","isShared","attemptToResolveRelativeTarget","getClosestProjectingParent","removeRelativeTarget","layoutAnchor","createRelativeTarget","targetWithTransforms","relativeTargetOrigin","parentLayout","canSkip","pendingAnimation","prevTreeScaleX","prevTreeScaleY","treePath","isSharedTransition","treeLength","display","applyTreeDeltas","prevProjectionDelta","createProjectionDeltas","projectionDeltaWithTransform","pathFn","snapshotLatestValues","mixedValues","relativeLayout","isSharedLayoutAnimation","isOnlyMember","shouldCrossfadeOpacity","hasOpacityCrossfade","prevRelativeTarget","interpolateProjection","mixTargetDelta","mixAxisDeltaLinear","mixAxis","follow","opacityExit","borderLabel","followRadius","leadRadius","mixValues","motionValue$1","animateSingleValue","completeAnimation","applyTransformsToTarget","shouldAnimatePositionOnly","animationType","xLength","yLength","config","initialPromotionConfig","shouldPreserveFollowOpacity","getPrevLead","hasDistortingTransform","resetValues","targetStyle","visibility","pointerEvents","valuesToRender","latestTransform","xTranslate","yTranslate","zTranslate","elementScaleX","elementScaleY","buildProjectionTransform","isCSSVariable","corrected","num","resetTree","measuredLayout","axisSnapshot","snapAxis","layoutDelta","visualDelta","parentSnapshot","relativeSnapshot","onBeforeLayoutMeasure","userAgentContains","string","navigator","userAgent","roundPoint","maxDistance","DocumentProjectionNode","ref","documentElement","scrollLeft","body","scrollTop","rootProjectionNode","HTMLProjectionNode","documentNode","position","useCreateMotionContext","getCurrentTreeVariants","useContext","useMemo","variantLabelsAsDependency","createHtmlRenderState","copyRawValuesOnly","useStyle","useInitialMotionValues","useHTMLProps","htmlProps","drag","dragListener","draggable","userSelect","WebkitUserSelect","WebkitTouchCallout","touchAction","onTap","onTapStart","createSvgRenderState","useSVGProps","_isStatic","Component","visualProps","rawStyles","validMotionProps","isValidMotionProp","shouldForward","isValidProp","lowercaseSVGElements","isSVGComponent","useRender","forwardMotionProps","filteredProps","isDom","filterProps","elementProps","Fragment","renderedChildren","PresenceContext","makeLatestValues","scrapeMotionValues","motionValues","checkIsControllingVariants","checkIsVariantNode","isInitialAnimationBlocked","variantToSet","list","makeUseVisualState","make","createRenderState","makeState","useRef","useConstant","useHTMLVisualState","scrapeHTMLMotionValuesFromProps","useSVGVisualState","scrapeSVGMotionValuesFromProps","featureProps","focus","tap","pan","inView","isInitialized","getInitializedFeatureDefinitions","initialFeatureDefinitions","initFeatureDefinitions","motionComponentSymbol","Symbol","for","useMotionRef","externalRef","externalRefContainer","useInsertionEffect","refCleanup","useCallback","onMount","SwitchLayoutGroupContext","isRefObject","useIsomorphicLayoutEffect","useLayoutEffect","useEffect","useVisualElement","createVisualElement","ProjectionNodeConstructor","lazyContext","motionConfig","visualElementRef","hasMountedOnce","renderer","initialLayoutGroupConfig","dragConstraints","layoutCrossfade","getClosestProjectingNode","optimisedAppearId","wantsHandoff","MotionHandoffIsComplete","MotionIsMounted","MotionHandoffMarkAsComplete","allowProjection","createMotionComponent","preloadedFeatures","loadFeatures","useVisualState","MotionDOMComponent","MeasureLayout","configAndProps","useLayoutId","layoutProjection","combined","ProjectionNode","getProjectionFunctionality","_jsxs","Provider","_jsx","displayName","ForwardRefMotionComponent","forwardRef","layoutGroupId","createDomVisualElement","updateAnimationControlsSubscription","unmountControls","subscribe","prevAnimate","isExitComplete","prevIsPresent","exitAnimation","register","extractEventInfo","pageX","pageY","addPointerEvent","addPointerInfo","getContextWindow","ownerDocument","defaultView","overflowStyles","PanSession","handlers","contextWindow","dragSnapToOrigin","distanceThreshold","lastMoveEvent","lastMoveEventInfo","lastRawMoveEventInfo","scrollPositions","removeScrollListeners","onElementScroll","handleScroll","onWindowScroll","updatePoint","getPanInfo","history","isPanStarted","isDistancePastThreshold","xDelta","yDelta","distance2D","onStart","onMove","handlePointerMove","handlePointerUp","end","onEnd","onSessionEnd","resumeAnimation","panInfo","initialInfo","onSessionStart","removeListeners","startScrollTracking","overflowX","overflowY","scrollX","scrollY","isWindow","updateHandlers","subtractPoint","lastDevicePoint","startDevicePoint","timeDelta","timestampedPoint","lastPoint","calcRelativeAxisConstraints","calcViewportAxisConstraints","layoutAxis","constraintsAxis","defaultElastic","resolveAxisElastic","dragElastic","minLabel","maxLabel","resolvePointElastic","label","elementDragControls","VisualElementDragControls","openDragLock","currentDirection","constraints","hasMutatedConstraints","elastic","latestPointerEvent","latestPanInfo","originEvent","snapToCursor","panSession","stopAnimation","dragPropagation","onDragStart","resolveConstraints","getAxisMotionValue","measuredAxis","dragDirectionLock","onDirectionLock","onDrag","lockThreshold","getCurrentDirection","updateAxis","snap","finalEvent","finalPanInfo","onDragEnd","endPanSession","_point","shouldDrag","axisValue","applyConstraints","prevConstraints","resolveRefConstraints","calcRelativeConstraints","resolveDragElastic","relativeConstraints","rebaseAxisConstraints","onMeasureDragConstraints","constraintsElement","constraintsBox","viewportBox","measuredConstraints","calcViewportConstraints","userConstraints","convertBoxToBoundingBox","dragMomentum","dragTransition","onDragTransitionEnd","momentumAnimations","startAxisValueAnimation","dragKey","externalMotionValue","scalePositionWithinConstraints","boxProgress","sourceLength","targetLength","calcProgress","calcOrigin","addListeners","stopPointerListener","isClickingTextInputChild","isElementTextInput","stopResizeObservers","measureDragConstraints","onResize","stopElement","skipFirstCall","stopContainer","startResizeObservers","stopMeasureLayoutListener","stopResizeListener","stopLayoutUpdateListener","isFirst","asyncHandler","hasTakenAnySnapshot","MeasureLayoutWithContext","componentDidMount","layoutGroup","switchLayoutGroup","group","safeToRemove","getSnapshotBeforeUpdate","componentDidUpdate","componentWillUnmount","promoteContext","deregister","useId","usePresence","removePointerDownListener","onPointerDown","pointerDownEvent","session","createPanHandlers","onPanSessionStart","onPanStart","onPan","onPanEnd","removeGroupControls","controls","dragControls","prevDragControls","handleHoverEvent","lifecycle","handlePressEvent","HTMLButtonElement","disabled","observerCallbacks","observers","fireObserverCallback","entry","fireAllObserverCallbacks","observeIntersection","rootInteresectionObserver","lookupRoot","rootObservers","JSON","stringify","IntersectionObserver","initIntersectionObserver","thresholdNames","featureBundle","hasEnteredView","isInView","startObserver","stopObserver","viewport","rootMargin","amount","once","threshold","isIntersecting","onViewportEnter","onViewportLeave","prevViewport","hasViewportOptionChanged","globalTapTarget","propagate","_element","onFocus","isFocusVisible","onBlur","createMotionComponentWithFeatures","MotionDiv"],"mappings":"yRAAA,SAASA,EAAcC,EAAKC,IACE,IAAtBD,EAAIE,QAAQD,IACZD,EAAIG,KAAKF,EACjB,CACA,SAASG,EAAWJ,EAAKC,GACrB,MAAMI,EAAQL,EAAIE,QAAQD,GACtBI,GAAQ,GACRL,EAAIM,OAAOD,EAAO,EAC1B,CCRA,MAAME,EAAQ,CAACC,EAAKC,EAAKC,IACjBA,EAAID,EACGA,EACPC,EAAIF,EACGA,EACJE,ECLX,SAASC,EAAmBC,EAASC,GACjC,OAAOA,EACD,GAAGD,2FAAiGC,IACpGD,CACV,CCFA,IAAIE,EAAU,OACVC,EAAY,OACO,oBAAZC,SACmB,eAA1BA,QAAQC,KAAKC,WACbJ,EAAU,CAACK,EAAOP,EAASC,KAClBM,GAA4B,oBAAZC,SACjBA,QAAQC,KAAKV,EAAmBC,EAASC,KAGjDE,EAAY,CAACI,EAAOP,EAASC,KACzB,IAAKM,EACD,MAAM,IAAIG,MAAMX,EAAmBC,EAASC,MCbxD,MAAMU,EAAqB,CAAA,ECGrBC,EAAqBd,GAAM,+BAA+Be,KAAKf,GCH/DgB,EAAYC,GAA2B,iBAAVA,GAAgC,OAAVA,ECGnDC,EAAqBlB,GAAM,cAAce,KAAKf,GCFpD,SAASmB,EAAKC,GACV,IAAIC,EACJ,MAAO,UACYC,IAAXD,IACAA,EAASD,KACNC,EAEf,CCPA,MAAME,EAAQC,GAAQA,ECMhBC,EAAO,IAAIC,IAAiBA,EAAaC,OAAO,CAACC,EAAGC,IAAO7B,GAAM6B,EAAED,EAAE5B,KCCrE8B,EAAW,CAACC,EAAMC,EAAIf,KACxB,MAAMgB,EAAQD,EAAKD,EACnB,OAAOE,GAAShB,EAAQc,GAAQE,EAAQ,GCR5C,MAAMC,EACF,WAAAC,GACIC,KAAKC,cAAgB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D,KAAK4jC,KAAM1J,EAAY,SAChCO,GAAai4B,GAAiB1yD,KAAK4jC,KAAMnJ,EAAU,SAEnE,CACA,OAAA4F,GAAY,QKhBTsgB,MELe,CAClBhZ,OAAQ,CACJof,eAAgBlH,GAChB6G,oBCFD,SAASwO,GAAkC3T,EAAW/vC,GACzD,OAAO60C,GAAsB9E,EAAW/vC,EAASqiD,GAAerM,GACpE,CC6BO,MCjCM2N,GDiC0B9O,GAAsB"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/size-rollup-scroll.js b/node_modules/framer-motion/dist/size-rollup-scroll.js deleted file mode 100644 index f9a2168..0000000 --- a/node_modules/framer-motion/dist/size-rollup-scroll.js +++ /dev/null @@ -1,2 +0,0 @@ -const e=(e,t,n)=>n>t?t:n{},r=()=>{};"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(n=(e,n,r)=>{e||"undefined"==typeof console||console.warn(t(n,r))},r=(e,n,r)=>{if(!e)throw new Error(t(n,r))});const s={},o=e=>"object"==typeof e&&null!==e;const i=e=>e,a=(...e)=>e.reduce((e,t)=>n=>t(e(n))),c=(e,t,n)=>{const r=t-e;return r?(n-e)/r:1},l=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function u(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,a=l.reduce((e,t)=>(e[t]=function(e){let t=new Set,n=new Set,r=!1,s=!1;const o=new WeakSet;let i={delta:0,timestamp:0,isProcessing:!1};function a(t){o.has(t)&&(c.schedule(t),e()),t(i)}const c={schedule:(e,s=!1,i=!1)=>{const a=i&&r?t:n;return s&&o.add(e),a.add(e),e},cancel:e=>{n.delete(e),o.delete(e)},process:e=>{if(i=e,r)return void(s=!0);r=!0;const o=t;t=n,n=o,t.forEach(a),t.clear(),r=!1,s&&(s=!1,c.process(e))}};return c}(i),e),{}),{setup:c,read:u,resolveKeyframes:f,preUpdate:d,update:g,preRender:h,render:p,postRender:m}=a,v=()=>{const i=s.useManualTiming,a=i?o.timestamp:performance.now();n=!1,i||(o.delta=r?1e3/60:Math.max(Math.min(a-o.timestamp,40),1)),o.timestamp=a,o.isProcessing=!0,c.process(o),u.process(o),f.process(o),d.process(o),g.process(o),h.process(o),p.process(o),m.process(o),o.isProcessing=!1,n&&t&&(r=!1,e(v))};return{schedule:l.reduce((t,s)=>{const i=a[s];return t[s]=(t,s=!1,a=!1)=>(n||(n=!0,r=!0,o.isProcessing||e(v)),i.schedule(t,s,a)),t},{}),cancel:e=>{for(let t=0;tt=>"string"==typeof t&&t.startsWith(e))("var(--"),p=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,m={test:e=>"number"==typeof e,parse:parseFloat,transform:e=>e},v={...m,transform:t=>e(0,1,t)},y=e=>Math.round(1e5*e)/1e5,w=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const b=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,x=(e,t)=>n=>Boolean("string"==typeof n&&b.test(n)&&n.startsWith(e)||t&&!function(e){return null==e}(n)&&Object.prototype.hasOwnProperty.call(n,t)),E=(e,t,n)=>r=>{if("string"!=typeof r)return r;const[s,o,i,a]=r.match(w);return{[e]:parseFloat(s),[t]:parseFloat(o),[n]:parseFloat(i),alpha:void 0!==a?parseFloat(a):1}},W={...m,transform:t=>Math.round((t=>e(0,255,t))(t))},L={test:x("rgb","red"),parse:E("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+W.transform(e)+", "+W.transform(t)+", "+W.transform(n)+", "+y(v.transform(r))+")"};const A={test:x("#"),parse:function(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}},transform:L.transform},S=(e=>({test:t=>"string"==typeof t&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}))("%"),M={test:x("hsl","hue"),parse:E("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+S.transform(y(t))+", "+S.transform(y(n))+", "+y(v.transform(r))+")"},B={test:e=>L.test(e)||A.test(e)||M.test(e),parse:e=>L.test(e)?L.parse(e):M.test(e)?M.parse(e):A.parse(e),transform:e=>"string"==typeof e?e:e.hasOwnProperty("red")?L.transform(e):M.transform(e),getAnimatableNone:e=>{const t=B.parse(e);return t.alpha=0,B.transform(t)}},T=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const $="number",O="color",H=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function z(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let o=0;const i=t.replace(H,e=>(B.test(e)?(r.color.push(o),s.push(O),n.push(B.parse(e))):e.startsWith("var(")?(r.var.push(o),s.push("var"),n.push(e)):(r.number.push(o),s.push($),n.push(parseFloat(e))),++o,"${}")).split("${}");return{values:n,split:i,indexes:r,types:s}}function F({split:e,types:t}){const n=e.length;return r=>{let s="";for(let o=0;o{return"number"==typeof e?t?.trim().endsWith("/")?e:0:"number"==typeof(n=e)?0:B.test(n)?B.getAnimatableNone(n):n;var n};const k={test:function(e){return isNaN(e)&&"string"==typeof e&&(e.match(w)?.length||0)+(e.match(T)?.length||0)>0},parse:function(e){return z(e).values},createTransformer:function(e){return F(z(e))},getAnimatableNone:function(e){const t=z(e);return F(t)(t.values.map((e,n)=>N(e,t.split[n])))}};function P(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function R(e,t){return n=>n>0?t:e}const q=(e,t,n)=>e+(t-e)*n,V=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},j=[A,L,M];function U(e){const t=(r=e,j.find(e=>e.test(r)));var r;if(n(Boolean(t),`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!Boolean(t))return!1;let s=t.parse(e);return t===M&&(s=function({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,n/=100;let s=0,o=0,i=0;if(t/=100){const r=n<.5?n*(1+t):n+t-n*t,a=2*n-r;s=P(a,r,e+1/3),o=P(a,r,e),i=P(a,r,e-1/3)}else s=o=i=n;return{red:Math.round(255*s),green:Math.round(255*o),blue:Math.round(255*i),alpha:r}}(s)),s}const C=(e,t)=>{const n=U(e),r=U(t);if(!n||!r)return R(e,t);const s={...n};return e=>(s.red=V(n.red,r.red,e),s.green=V(n.green,r.green,e),s.blue=V(n.blue,r.blue,e),s.alpha=q(n.alpha,r.alpha,e),L.transform(s))},G=new Set(["none","hidden"]);function I(e,t){return n=>q(e,t,n)}function D(e){return"number"==typeof e?I:"string"==typeof e?h(t=e)&&p.test(t.split("/*")[0].trim())?R:B.test(e)?C:J:Array.isArray(e)?K:"object"==typeof e?B.test(e)?C:_:R;var t}function K(e,t){const n=[...e],r=n.length,s=e.map((e,n)=>D(e)(e,t[n]));return e=>{for(let t=0;t{for(const t in r)n[t]=r[t](e);return n}}const J=(e,t)=>{const r=k.createTransformer(t),s=z(e),o=z(t);return s.indexes.var.length===o.indexes.var.length&&s.indexes.color.length===o.indexes.color.length&&s.indexes.number.length>=o.indexes.number.length?G.has(e)&&!o.values.length||G.has(t)&&!s.values.length?function(e,t){return G.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}(e,t):a(K(function(e,t){const n=[],r={color:0,var:0,number:0};for(let s=0;sn[0];if(2===f&&n[0]===n[1])return()=>n[1];const d=t[0]===t[1];t[0]>t[f-1]&&(t=[...t].reverse(),n=[...n].reverse());const g=function(e,t,n){const r=[],o=n||s.mix||Q,c=e.length-1;for(let n=0;n{if(d&&e1)for(;rp(e(t[0],t[f-1],n)):p}function Y(e){const t=[0];return function(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=c(0,t,r);e.push(q(n,1,s))}}(t,e.length-1),t}const Z={};function ee(e,t){const n=function(e){let t;return()=>(void 0===t&&(t=e()),t)}(e);return()=>Z[t]??n()}const te=ee(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),ne=ee(()=>void 0!==window.ViewTimeline,"viewTimeline");function re(e){return o(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const se=new WeakMap;let oe;const ie=(e,t,n)=>(r,s)=>{return s&&s[0]?s[0][e+"Size"]:o(i=r)&&"ownerSVGElement"in i&&"getBBox"in r?r.getBBox()[t]:r[n];var i},ae=ie("inline","width","offsetWidth"),ce=ie("block","height","offsetHeight");function le({target:e,borderBoxSize:t}){se.get(e)?.forEach(n=>{n(e,{get width(){return ae(e,t)},get height(){return ce(e,t)}})})}function ue(e){e.forEach(le)}function fe(e,t){oe||"undefined"!=typeof ResizeObserver&&(oe=new ResizeObserver(ue));const n=function(e){if(null==e)return[];if(e instanceof EventTarget)return[e];if("string"==typeof e){const t=document.querySelectorAll(e);return t?Array.from(t):[]}return Array.from(e).filter(e=>null!=e)}(e);return n.forEach(e=>{let n=se.get(e);n||(n=new Set,se.set(e,n)),n.add(t),oe?.observe(e)}),()=>{n.forEach(e=>{const n=se.get(e);n?.delete(t),n?.size||oe?.unobserve(e)})}}const de=new Set;let ge;function he(e){return de.add(e),ge||(ge=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};de.forEach(t=>t(e))},window.addEventListener("resize",ge)),()=>{de.delete(e),de.size||"function"!=typeof ge||(window.removeEventListener("resize",ge),ge=void 0)}}function pe(e,t){let n;const r=()=>{const{currentTime:r}=t,s=(null===r?0:r.value)/100;n!==s&&e(s),n=s};return f.preUpdate(r,!0),()=>d(r)}function me(e){return"undefined"!=typeof window&&(e?ne():te())}const ve={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function ye(e,t,n,r){const s=n[t],{length:o,position:i}=ve[t],a=s.current,l=n.time;s.current=Math.abs(e[`scroll${i}`]),s.scrollLength=e[`scroll${o}`]-e[`client${o}`],s.offset.length=0,s.offset[0]=0,s.offset[1]=s.scrollLength,s.progress=c(0,s.scrollLength,s.current);const u=r-l;var f,d;s.velocity=u>50?0:(f=s.current-a,(d=u)?f*(1e3/d):0)}const we={start:0,center:.5,end:1};function be(e,t,n=0){let r=0;if(e in we&&(e=we[e]),"string"==typeof e){const t=parseFloat(e);e.endsWith("px")?r=t:e.endsWith("%")?e=t/100:e.endsWith("vw")?r=t/100*document.documentElement.clientWidth:e.endsWith("vh")?r=t/100*document.documentElement.clientHeight:e=t}return"number"==typeof e&&(r=t*e),n+r}const xe=[0,0];function Ee(e,t,n,r){let s=Array.isArray(e)?e:xe,o=0,i=0;return"number"==typeof e?s=[e,e]:"string"==typeof e&&(s=(e=e.trim()).includes(" ")?e.split(" "):[e,we[e]?e:"0"]),o=be(s[0],n,r),i=be(s[1],t),o-i}const We={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},Le={x:0,y:0};function Ae(t,n,r){const{offset:s=We.All}=r,{target:o=t,axis:i="y"}=r,a="y"===i?"height":"width",c=o!==t?function(e,t){const n={x:0,y:0};let r=e;for(;r&&r!==t;)if(re(r))n.x+=r.offsetLeft,n.y+=r.offsetTop,r=r.offsetParent;else if("svg"===r.tagName){const e=r.getBoundingClientRect();r=r.parentElement;const t=r.getBoundingClientRect();n.x+=e.left-t.left,n.y+=e.top-t.top}else{if(!(r instanceof SVGGraphicsElement))break;{const{x:e,y:t}=r.getBBox();n.x+=e,n.y+=t;let s=null,o=r.parentNode;for(;!s;)"svg"===o.tagName&&(s=o),o=r.parentNode;r=s}}return n}(o,t):Le,l=o===t?{width:t.scrollWidth,height:t.scrollHeight}:function(e){return"getBBox"in e&&"svg"!==e.tagName?e.getBBox():{width:e.clientWidth,height:e.clientHeight}}(o),u={width:t.clientWidth,height:t.clientHeight};n[i].offset.length=0;let f=!n[i].interpolate;const d=s.length;for(let e=0;e{!function(e,t=e,n){if(n.x.targetOffset=0,n.y.targetOffset=0,t!==e){let r=t;for(;r&&r!==e;)n.x.targetOffset+=r.offsetLeft,n.y.targetOffset+=r.offsetTop,r=r.offsetParent}n.x.targetLength=t===e?t.scrollWidth:t.clientWidth,n.y.targetLength=t===e?t.scrollHeight:t.clientHeight,n.x.containerLength=e.clientWidth,n.y.containerLength=e.clientHeight}(e,r.target,n),function(e,t,n){ye(e,"x",t,n),ye(e,"y",t,n),t.time=n}(e,n,t),(r.offset||r.target)&&Ae(e,n,r)},notify:()=>t(n)}}const Me=new WeakMap,Be=new WeakMap,Te=new WeakMap,$e=new WeakMap,Oe=new WeakMap,He=e=>e===document.scrollingElement?window:e;function ze(e,{container:t=document.scrollingElement,trackContentSize:n=!1,...r}={}){if(!t)return i;let s=Te.get(t);s||(s=new Set,Te.set(t,s));const o=Se(t,e,{time:0,x:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0},y:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}},r);if(s.add(o),!Me.has(t)){const e=()=>{for(const e of s)e.measure(g.timestamp);f.preUpdate(n)},n=()=>{for(const e of s)e.notify()},r=()=>f.read(e);Me.set(t,r);const o=He(t);window.addEventListener("resize",r),t!==document.documentElement&&Be.set(t,(c=r,"function"==typeof(a=t)?he(a):fe(a,c))),o.addEventListener("scroll",r),r()}var a,c;if(n&&!Oe.has(t)){const e=Me.get(t),n={width:t.scrollWidth,height:t.scrollHeight};$e.set(t,n);const r=()=>{const r=t.scrollWidth,s=t.scrollHeight;n.width===r&&n.height===s||(e(),n.width=r,n.height=s)},s=f.read(r,!0);Oe.set(t,s)}const l=Me.get(t);return f.read(l,!1,!0),()=>{d(l);const e=Te.get(t);if(!e)return;if(e.delete(o),e.size)return;const n=Me.get(t);Me.delete(t),n&&(He(t).removeEventListener("scroll",n),Be.get(t)?.(),window.removeEventListener("resize",n));const r=Oe.get(t);r&&(d(r),Oe.delete(t)),$e.delete(t)}}const Fe=[[We.Enter,"entry"],[We.Exit,"exit"],[We.Any,"cover"],[We.All,"contain"]],Ne={start:0,end:1};function ke(e){const t=e.trim().split(/\s+/);if(2!==t.length)return;const n=Ne[t[0]],r=Ne[t[1]];return void 0!==n&&void 0!==r?[n,r]:void 0}function Pe(e,t){const n=function(e){if(2!==e.length)return;const t=[];for(const n of e)if(Array.isArray(n))t.push(n);else{if("string"!=typeof n)return;{const e=ke(n);if(!e)return;t.push(e)}}return t}(e);if(!n)return!1;for(let e=0;e<2;e++){const r=n[e],s=t[e];if(r[0]!==s[0]||r[1]!==s[1])return!1}return!0}function Re(e){if(!e)return{rangeStart:"contain 0%",rangeEnd:"contain 100%"};for(const[t,n]of Fe)if(Pe(e,t))return{rangeStart:`${n} 0%`,rangeEnd:`${n} 100%`}}const qe=new Map;function Ve(e){const t={value:0},n=ze(n=>{t.value=100*n[e.axis].progress},e);return{currentTime:t,cancel:n}}function je({source:e,container:t,...n}){const{axis:r}=n;e&&(t=e);let s=qe.get(t);s||(s=new Map,qe.set(t,s));const o=n.target??"self";let i=s.get(o);i||(i={},s.set(o,i));const a=r+(n.offset??[]).join(",");if(!i[a])if(n.target&&me(n.target)){const e=Re(n.offset);i[a]=e?new ViewTimeline({subject:n.target,axis:r}):Ve({container:t,...n})}else me()?i[a]=new ScrollTimeline({source:t,axis:r}):i[a]=Ve({container:t,...n});return i[a]}function Ue(e,{axis:t="y",container:n=document.scrollingElement,...r}={}){if(!n)return i;const s={axis:t,container:n,...r};return"function"==typeof e?function(e,t){return function(e){return 2===e.length}(e)||function(e){return e&&(e.target||e.offset)}(t)?ze(n=>{e(n[t.axis].progress,n)},t):pe(e,je(t))}(e,s):function(e,t){const n=je(t),r=t.target?Re(t.offset):void 0,s=t.target?me(t.target)&&!!r:me();return e.attachTimeline({timeline:s?n:void 0,...r&&s&&{rangeStart:r.rangeStart,rangeEnd:r.rangeEnd},observe:e=>(e.pause(),pe(t=>{e.time=e.iterationDuration*t},n))})}(e,s)}export{Ue as scroll}; -//# sourceMappingURL=size-rollup-scroll.js.map diff --git a/node_modules/framer-motion/dist/size-rollup-scroll.js.map b/node_modules/framer-motion/dist/size-rollup-scroll.js.map deleted file mode 100644 index ad8a8df..0000000 --- a/node_modules/framer-motion/dist/size-rollup-scroll.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"size-rollup-scroll.js","sources":["../../motion-utils/dist/es/clamp.mjs","../../motion-utils/dist/es/format-error-message.mjs","../../motion-utils/dist/es/errors.mjs","../../motion-utils/dist/es/global-config.mjs","../../motion-utils/dist/es/is-object.mjs","../../motion-utils/dist/es/noop.mjs","../../motion-utils/dist/es/pipe.mjs","../../motion-utils/dist/es/progress.mjs","../../motion-dom/dist/es/frameloop/order.mjs","../../motion-dom/dist/es/frameloop/batcher.mjs","../../motion-dom/dist/es/frameloop/render-step.mjs","../../motion-dom/dist/es/frameloop/frame.mjs","../../motion-dom/dist/es/animation/utils/is-css-variable.mjs","../../motion-dom/dist/es/value/types/numbers/index.mjs","../../motion-dom/dist/es/value/types/utils/sanitize.mjs","../../motion-dom/dist/es/value/types/utils/float-regex.mjs","../../motion-dom/dist/es/value/types/utils/single-color-regex.mjs","../../motion-dom/dist/es/value/types/color/utils.mjs","../../motion-dom/dist/es/value/types/utils/is-nullish.mjs","../../motion-dom/dist/es/value/types/color/rgba.mjs","../../motion-dom/dist/es/value/types/color/hex.mjs","../../motion-dom/dist/es/value/types/numbers/units.mjs","../../motion-dom/dist/es/value/types/color/hsla.mjs","../../motion-dom/dist/es/value/types/color/index.mjs","../../motion-dom/dist/es/value/types/utils/color-regex.mjs","../../motion-dom/dist/es/value/types/complex/index.mjs","../../motion-dom/dist/es/value/types/color/hsla-to-rgba.mjs","../../motion-dom/dist/es/utils/mix/immediate.mjs","../../motion-dom/dist/es/utils/mix/number.mjs","../../motion-dom/dist/es/utils/mix/color.mjs","../../motion-dom/dist/es/utils/mix/visibility.mjs","../../motion-dom/dist/es/utils/mix/complex.mjs","../../motion-dom/dist/es/utils/mix/index.mjs","../../motion-dom/dist/es/utils/interpolate.mjs","../../motion-dom/dist/es/animation/keyframes/offsets/default.mjs","../../motion-dom/dist/es/animation/keyframes/offsets/fill.mjs","../../motion-dom/dist/es/utils/supports/flags.mjs","../../motion-dom/dist/es/utils/supports/memo.mjs","../../motion-utils/dist/es/memo.mjs","../../motion-dom/dist/es/utils/supports/scroll-timeline.mjs","../../motion-dom/dist/es/utils/is-html-element.mjs","../../motion-dom/dist/es/resize/handle-element.mjs","../../motion-dom/dist/es/utils/is-svg-element.mjs","../../motion-dom/dist/es/utils/resolve-elements.mjs","../../motion-dom/dist/es/resize/handle-window.mjs","../../motion-dom/dist/es/scroll/observe.mjs","../lib/render/dom/scroll/utils/can-use-native-timeline.js","../lib/render/dom/scroll/info.js","../../motion-utils/dist/es/velocity-per-second.mjs","../lib/render/dom/scroll/offsets/edge.js","../lib/render/dom/scroll/offsets/offset.js","../lib/render/dom/scroll/offsets/presets.js","../lib/render/dom/scroll/offsets/index.js","../lib/render/dom/scroll/offsets/inset.js","../lib/render/dom/scroll/on-scroll-handler.js","../lib/render/dom/scroll/track.js","../../motion-dom/dist/es/resize/index.mjs","../lib/render/dom/scroll/utils/offset-to-range.js","../lib/render/dom/scroll/utils/get-timeline.js","../lib/render/dom/scroll/index.js","../lib/render/dom/scroll/attach-function.js","../lib/render/dom/scroll/utils/is-element-tracking.js","../lib/render/dom/scroll/attach-animation.js"],"sourcesContent":["const clamp = (min, max, v) => {\n if (v > max)\n return max;\n if (v < min)\n return min;\n return v;\n};\n\nexport { clamp };\n//# sourceMappingURL=clamp.mjs.map\n","function formatErrorMessage(message, errorCode) {\n return errorCode\n ? `${message}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${errorCode}`\n : message;\n}\n\nexport { formatErrorMessage };\n//# sourceMappingURL=format-error-message.mjs.map\n","import { formatErrorMessage } from './format-error-message.mjs';\n\nlet warning = () => { };\nlet invariant = () => { };\nif (typeof process !== \"undefined\" &&\n process.env?.NODE_ENV !== \"production\") {\n warning = (check, message, errorCode) => {\n if (!check && typeof console !== \"undefined\") {\n console.warn(formatErrorMessage(message, errorCode));\n }\n };\n invariant = (check, message, errorCode) => {\n if (!check) {\n throw new Error(formatErrorMessage(message, errorCode));\n }\n };\n}\n\nexport { invariant, warning };\n//# sourceMappingURL=errors.mjs.map\n","const MotionGlobalConfig = {};\n\nexport { MotionGlobalConfig };\n//# sourceMappingURL=global-config.mjs.map\n","const isObject = (value) => typeof value === \"object\" && value !== null;\n\nexport { isObject };\n//# sourceMappingURL=is-object.mjs.map\n","/*#__NO_SIDE_EFFECTS__*/\nconst noop = (any) => any;\n\nexport { noop };\n//# sourceMappingURL=noop.mjs.map\n","/**\n * Pipe\n * Compose other transformers to run linearily\n * pipe(min(20), max(40))\n * @param {...functions} transformers\n * @return {function}\n */\nconst pipe = (...transformers) => transformers.reduce((a, b) => (v) => b(a(v)));\n\nexport { pipe };\n//# sourceMappingURL=pipe.mjs.map\n","/*\n Progress within given range\n\n Given a lower limit and an upper limit, we return the progress\n (expressed as a number 0-1) represented by the given value, and\n limit that progress to within 0-1.\n*/\n/*#__NO_SIDE_EFFECTS__*/\nconst progress = (from, to, value) => {\n const range = to - from;\n return range ? (value - from) / range : 1;\n};\n\nexport { progress };\n//# sourceMappingURL=progress.mjs.map\n","const stepsOrder = [\n \"setup\", // Compute\n \"read\", // Read\n \"resolveKeyframes\", // Write/Read/Write/Read\n \"preUpdate\", // Compute\n \"update\", // Compute\n \"preRender\", // Compute\n \"render\", // Write\n \"postRender\", // Compute\n];\n\nexport { stepsOrder };\n//# sourceMappingURL=order.mjs.map\n","import { MotionGlobalConfig } from 'motion-utils';\nimport { stepsOrder } from './order.mjs';\nimport { createRenderStep } from './render-step.mjs';\n\nconst maxElapsed = 40;\nfunction createRenderBatcher(scheduleNextBatch, allowKeepAlive) {\n let runNextFrame = false;\n let useDefaultElapsed = true;\n const state = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n };\n const flagRunNextFrame = () => (runNextFrame = true);\n const steps = stepsOrder.reduce((acc, key) => {\n acc[key] = createRenderStep(flagRunNextFrame);\n return acc;\n }, {});\n const { setup, read, resolveKeyframes, preUpdate, update, preRender, render, postRender, } = steps;\n const processBatch = () => {\n const useManualTiming = MotionGlobalConfig.useManualTiming;\n const timestamp = useManualTiming\n ? state.timestamp\n : performance.now();\n runNextFrame = false;\n if (!useManualTiming) {\n state.delta = useDefaultElapsed\n ? 1000 / 60\n : Math.max(Math.min(timestamp - state.timestamp, maxElapsed), 1);\n }\n state.timestamp = timestamp;\n state.isProcessing = true;\n // Unrolled render loop for better per-frame performance\n setup.process(state);\n read.process(state);\n resolveKeyframes.process(state);\n preUpdate.process(state);\n update.process(state);\n preRender.process(state);\n render.process(state);\n postRender.process(state);\n state.isProcessing = false;\n if (runNextFrame && allowKeepAlive) {\n useDefaultElapsed = false;\n scheduleNextBatch(processBatch);\n }\n };\n const wake = () => {\n runNextFrame = true;\n useDefaultElapsed = true;\n if (!state.isProcessing) {\n scheduleNextBatch(processBatch);\n }\n };\n const schedule = stepsOrder.reduce((acc, key) => {\n const step = steps[key];\n acc[key] = (process, keepAlive = false, immediate = false) => {\n if (!runNextFrame)\n wake();\n return step.schedule(process, keepAlive, immediate);\n };\n return acc;\n }, {});\n const cancel = (process) => {\n for (let i = 0; i < stepsOrder.length; i++) {\n steps[stepsOrder[i]].cancel(process);\n }\n };\n return { schedule, cancel, state, steps };\n}\n\nexport { createRenderBatcher };\n//# sourceMappingURL=batcher.mjs.map\n","function createRenderStep(runNextFrame) {\n /**\n * We create and reuse two queues, one to queue jobs for the current frame\n * and one for the next. We reuse to avoid triggering GC after x frames.\n */\n let thisFrame = new Set();\n let nextFrame = new Set();\n /**\n * Track whether we're currently processing jobs in this step. This way\n * we can decide whether to schedule new jobs for this frame or next.\n */\n let isProcessing = false;\n let flushNextFrame = false;\n /**\n * A set of processes which were marked keepAlive when scheduled.\n */\n const toKeepAlive = new WeakSet();\n let latestFrameData = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n };\n function triggerCallback(callback) {\n if (toKeepAlive.has(callback)) {\n step.schedule(callback);\n runNextFrame();\n }\n callback(latestFrameData);\n }\n const step = {\n /**\n * Schedule a process to run on the next frame.\n */\n schedule: (callback, keepAlive = false, immediate = false) => {\n const addToCurrentFrame = immediate && isProcessing;\n const queue = addToCurrentFrame ? thisFrame : nextFrame;\n if (keepAlive)\n toKeepAlive.add(callback);\n queue.add(callback);\n return callback;\n },\n /**\n * Cancel the provided callback from running on the next frame.\n */\n cancel: (callback) => {\n nextFrame.delete(callback);\n toKeepAlive.delete(callback);\n },\n /**\n * Execute all schedule callbacks.\n */\n process: (frameData) => {\n latestFrameData = frameData;\n /**\n * If we're already processing we've probably been triggered by a flushSync\n * inside an existing process. Instead of executing, mark flushNextFrame\n * as true and ensure we flush the following frame at the end of this one.\n */\n if (isProcessing) {\n flushNextFrame = true;\n return;\n }\n isProcessing = true;\n // Swap this frame and the next to avoid GC\n const prevFrame = thisFrame;\n thisFrame = nextFrame;\n nextFrame = prevFrame;\n // Execute this frame\n thisFrame.forEach(triggerCallback);\n // Clear the frame so no callbacks remain. This is to avoid\n // memory leaks should this render step not run for a while.\n thisFrame.clear();\n isProcessing = false;\n if (flushNextFrame) {\n flushNextFrame = false;\n step.process(frameData);\n }\n },\n };\n return step;\n}\n\nexport { createRenderStep };\n//# sourceMappingURL=render-step.mjs.map\n","import { noop } from 'motion-utils';\nimport { createRenderBatcher } from './batcher.mjs';\n\nconst { schedule: frame, cancel: cancelFrame, state: frameData, steps: frameSteps, } = /* @__PURE__ */ createRenderBatcher(typeof requestAnimationFrame !== \"undefined\" ? requestAnimationFrame : noop, true);\n\nexport { cancelFrame, frame, frameData, frameSteps };\n//# sourceMappingURL=frame.mjs.map\n","const checkStringStartsWith = (token) => (key) => typeof key === \"string\" && key.startsWith(token);\nconst isCSSVariableName = \n/*@__PURE__*/ checkStringStartsWith(\"--\");\nconst startsAsVariableToken = \n/*@__PURE__*/ checkStringStartsWith(\"var(--\");\nconst isCSSVariableToken = (value) => {\n const startsWithToken = startsAsVariableToken(value);\n if (!startsWithToken)\n return false;\n // Ensure any comments are stripped from the value as this can harm performance of the regex.\n return singleCssVariableRegex.test(value.split(\"/*\")[0].trim());\n};\nconst singleCssVariableRegex = /var\\(--(?:[\\w-]+\\s*|[\\w-]+\\s*,(?:\\s*[^)(\\s]|\\s*\\((?:[^)(]|\\([^)(]*\\))*\\))+\\s*)\\)$/iu;\n/**\n * Check if a value contains a CSS variable anywhere (e.g. inside calc()).\n * Unlike isCSSVariableToken which checks if the value IS a var() token,\n * this checks if the value CONTAINS var() somewhere in the string.\n */\nfunction containsCSSVariable(value) {\n if (typeof value !== \"string\")\n return false;\n // Strip comments to avoid false positives\n return value.split(\"/*\")[0].includes(\"var(--\");\n}\n\nexport { containsCSSVariable, isCSSVariableName, isCSSVariableToken };\n//# sourceMappingURL=is-css-variable.mjs.map\n","import { clamp } from 'motion-utils';\n\nconst number = {\n test: (v) => typeof v === \"number\",\n parse: parseFloat,\n transform: (v) => v,\n};\nconst alpha = {\n ...number,\n transform: (v) => clamp(0, 1, v),\n};\nconst scale = {\n ...number,\n default: 1,\n};\n\nexport { alpha, number, scale };\n//# sourceMappingURL=index.mjs.map\n","// If this number is a decimal, make it just five decimal places\n// to avoid exponents\nconst sanitize = (v) => Math.round(v * 100000) / 100000;\n\nexport { sanitize };\n//# sourceMappingURL=sanitize.mjs.map\n","const floatRegex = /-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)/gu;\n\nexport { floatRegex };\n//# sourceMappingURL=float-regex.mjs.map\n","const singleColorRegex = /^(?:#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\))$/iu;\n\nexport { singleColorRegex };\n//# sourceMappingURL=single-color-regex.mjs.map\n","import { floatRegex } from '../utils/float-regex.mjs';\nimport { isNullish } from '../utils/is-nullish.mjs';\nimport { singleColorRegex } from '../utils/single-color-regex.mjs';\n\n/**\n * Returns true if the provided string is a color, ie rgba(0,0,0,0) or #000,\n * but false if a number or multiple colors\n */\nconst isColorString = (type, testProp) => (v) => {\n return Boolean((typeof v === \"string\" &&\n singleColorRegex.test(v) &&\n v.startsWith(type)) ||\n (testProp &&\n !isNullish(v) &&\n Object.prototype.hasOwnProperty.call(v, testProp)));\n};\nconst splitColor = (aName, bName, cName) => (v) => {\n if (typeof v !== \"string\")\n return v;\n const [a, b, c, alpha] = v.match(floatRegex);\n return {\n [aName]: parseFloat(a),\n [bName]: parseFloat(b),\n [cName]: parseFloat(c),\n alpha: alpha !== undefined ? parseFloat(alpha) : 1,\n };\n};\n\nexport { isColorString, splitColor };\n//# sourceMappingURL=utils.mjs.map\n","function isNullish(v) {\n return v == null;\n}\n\nexport { isNullish };\n//# sourceMappingURL=is-nullish.mjs.map\n","import { clamp } from 'motion-utils';\nimport { number, alpha } from '../numbers/index.mjs';\nimport { sanitize } from '../utils/sanitize.mjs';\nimport { splitColor, isColorString } from './utils.mjs';\n\nconst clampRgbUnit = (v) => clamp(0, 255, v);\nconst rgbUnit = {\n ...number,\n transform: (v) => Math.round(clampRgbUnit(v)),\n};\nconst rgba = {\n test: /*@__PURE__*/ isColorString(\"rgb\", \"red\"),\n parse: /*@__PURE__*/ splitColor(\"red\", \"green\", \"blue\"),\n transform: ({ red, green, blue, alpha: alpha$1 = 1 }) => \"rgba(\" +\n rgbUnit.transform(red) +\n \", \" +\n rgbUnit.transform(green) +\n \", \" +\n rgbUnit.transform(blue) +\n \", \" +\n sanitize(alpha.transform(alpha$1)) +\n \")\",\n};\n\nexport { rgbUnit, rgba };\n//# sourceMappingURL=rgba.mjs.map\n","import { rgba } from './rgba.mjs';\nimport { isColorString } from './utils.mjs';\n\nfunction parseHex(v) {\n let r = \"\";\n let g = \"\";\n let b = \"\";\n let a = \"\";\n // If we have 6 characters, ie #FF0000\n if (v.length > 5) {\n r = v.substring(1, 3);\n g = v.substring(3, 5);\n b = v.substring(5, 7);\n a = v.substring(7, 9);\n // Or we have 3 characters, ie #F00\n }\n else {\n r = v.substring(1, 2);\n g = v.substring(2, 3);\n b = v.substring(3, 4);\n a = v.substring(4, 5);\n r += r;\n g += g;\n b += b;\n a += a;\n }\n return {\n red: parseInt(r, 16),\n green: parseInt(g, 16),\n blue: parseInt(b, 16),\n alpha: a ? parseInt(a, 16) / 255 : 1,\n };\n}\nconst hex = {\n test: /*@__PURE__*/ isColorString(\"#\"),\n parse: parseHex,\n transform: rgba.transform,\n};\n\nexport { hex };\n//# sourceMappingURL=hex.mjs.map\n","/*#__NO_SIDE_EFFECTS__*/\nconst createUnitType = (unit) => ({\n test: (v) => typeof v === \"string\" && v.endsWith(unit) && v.split(\" \").length === 1,\n parse: parseFloat,\n transform: (v) => `${v}${unit}`,\n});\nconst degrees = /*@__PURE__*/ createUnitType(\"deg\");\nconst percent = /*@__PURE__*/ createUnitType(\"%\");\nconst px = /*@__PURE__*/ createUnitType(\"px\");\nconst vh = /*@__PURE__*/ createUnitType(\"vh\");\nconst vw = /*@__PURE__*/ createUnitType(\"vw\");\nconst progressPercentage = /*@__PURE__*/ (() => ({\n ...percent,\n parse: (v) => percent.parse(v) / 100,\n transform: (v) => percent.transform(v * 100),\n}))();\n\nexport { degrees, percent, progressPercentage, px, vh, vw };\n//# sourceMappingURL=units.mjs.map\n","import { alpha } from '../numbers/index.mjs';\nimport { percent } from '../numbers/units.mjs';\nimport { sanitize } from '../utils/sanitize.mjs';\nimport { splitColor, isColorString } from './utils.mjs';\n\nconst hsla = {\n test: /*@__PURE__*/ isColorString(\"hsl\", \"hue\"),\n parse: /*@__PURE__*/ splitColor(\"hue\", \"saturation\", \"lightness\"),\n transform: ({ hue, saturation, lightness, alpha: alpha$1 = 1 }) => {\n return (\"hsla(\" +\n Math.round(hue) +\n \", \" +\n percent.transform(sanitize(saturation)) +\n \", \" +\n percent.transform(sanitize(lightness)) +\n \", \" +\n sanitize(alpha.transform(alpha$1)) +\n \")\");\n },\n};\n\nexport { hsla };\n//# sourceMappingURL=hsla.mjs.map\n","import { hex } from './hex.mjs';\nimport { hsla } from './hsla.mjs';\nimport { rgba } from './rgba.mjs';\n\nconst color = {\n test: (v) => rgba.test(v) || hex.test(v) || hsla.test(v),\n parse: (v) => {\n if (rgba.test(v)) {\n return rgba.parse(v);\n }\n else if (hsla.test(v)) {\n return hsla.parse(v);\n }\n else {\n return hex.parse(v);\n }\n },\n transform: (v) => {\n return typeof v === \"string\"\n ? v\n : v.hasOwnProperty(\"red\")\n ? rgba.transform(v)\n : hsla.transform(v);\n },\n getAnimatableNone: (v) => {\n const parsed = color.parse(v);\n parsed.alpha = 0;\n return color.transform(parsed);\n },\n};\n\nexport { color };\n//# sourceMappingURL=index.mjs.map\n","const colorRegex = /(?:#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\))/giu;\n\nexport { colorRegex };\n//# sourceMappingURL=color-regex.mjs.map\n","import { color } from '../color/index.mjs';\nimport { colorRegex } from '../utils/color-regex.mjs';\nimport { floatRegex } from '../utils/float-regex.mjs';\nimport { sanitize } from '../utils/sanitize.mjs';\n\nfunction test(v) {\n return (isNaN(v) &&\n typeof v === \"string\" &&\n (v.match(floatRegex)?.length || 0) +\n (v.match(colorRegex)?.length || 0) >\n 0);\n}\nconst NUMBER_TOKEN = \"number\";\nconst COLOR_TOKEN = \"color\";\nconst VAR_TOKEN = \"var\";\nconst VAR_FUNCTION_TOKEN = \"var(\";\nconst SPLIT_TOKEN = \"${}\";\n// this regex consists of the `singleCssVariableRegex|rgbHSLValueRegex|digitRegex`\nconst complexRegex = /var\\s*\\(\\s*--(?:[\\w-]+\\s*|[\\w-]+\\s*,(?:\\s*[^)(\\s]|\\s*\\((?:[^)(]|\\([^)(]*\\))*\\))+\\s*)\\)|#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\)|-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)/giu;\nfunction analyseComplexValue(value) {\n const originalValue = value.toString();\n const values = [];\n const indexes = {\n color: [],\n number: [],\n var: [],\n };\n const types = [];\n let i = 0;\n const tokenised = originalValue.replace(complexRegex, (parsedValue) => {\n if (color.test(parsedValue)) {\n indexes.color.push(i);\n types.push(COLOR_TOKEN);\n values.push(color.parse(parsedValue));\n }\n else if (parsedValue.startsWith(VAR_FUNCTION_TOKEN)) {\n indexes.var.push(i);\n types.push(VAR_TOKEN);\n values.push(parsedValue);\n }\n else {\n indexes.number.push(i);\n types.push(NUMBER_TOKEN);\n values.push(parseFloat(parsedValue));\n }\n ++i;\n return SPLIT_TOKEN;\n });\n const split = tokenised.split(SPLIT_TOKEN);\n return { values, split, indexes, types };\n}\nfunction parseComplexValue(v) {\n return analyseComplexValue(v).values;\n}\nfunction buildTransformer({ split, types }) {\n const numSections = split.length;\n return (v) => {\n let output = \"\";\n for (let i = 0; i < numSections; i++) {\n output += split[i];\n if (v[i] !== undefined) {\n const type = types[i];\n if (type === NUMBER_TOKEN) {\n output += sanitize(v[i]);\n }\n else if (type === COLOR_TOKEN) {\n output += color.transform(v[i]);\n }\n else {\n output += v[i];\n }\n }\n }\n return output;\n };\n}\nfunction createTransformer(source) {\n return buildTransformer(analyseComplexValue(source));\n}\nconst convertNumbersToZero = (v) => typeof v === \"number\" ? 0 : color.test(v) ? color.getAnimatableNone(v) : v;\n/**\n * Convert a parsed value to its zero equivalent, but preserve numbers\n * that act as divisors in CSS calc() expressions.\n *\n * analyseComplexValue extracts numbers from CSS strings and puts the\n * surrounding text into a `split` template array. For example:\n * \"calc(var(--gap) / 5)\" → values: [var(--gap), 5]\n * split: [\"calc(\", \" / \", \")\"]\n *\n * When building a zero-equivalent for animation, naively zeroing all\n * numbers turns the divisor into 0 → \"calc(var(--gap) / 0)\" → NaN.\n * We detect this by checking whether the text preceding a number\n * (split[i]) ends with \"/\" — the CSS calc division operator.\n */\nconst convertToZero = (value, splitBefore) => {\n if (typeof value === \"number\") {\n return splitBefore?.trim().endsWith(\"/\") ? value : 0;\n }\n return convertNumbersToZero(value);\n};\nfunction getAnimatableNone(v) {\n const info = analyseComplexValue(v);\n const transformer = buildTransformer(info);\n return transformer(info.values.map((value, i) => convertToZero(value, info.split[i])));\n}\nconst complex = {\n test,\n parse: parseComplexValue,\n createTransformer,\n getAnimatableNone,\n};\n\nexport { analyseComplexValue, complex };\n//# sourceMappingURL=index.mjs.map\n","// Adapted from https://gist.github.com/mjackson/5311256\nfunction hueToRgb(p, q, t) {\n if (t < 0)\n t += 1;\n if (t > 1)\n t -= 1;\n if (t < 1 / 6)\n return p + (q - p) * 6 * t;\n if (t < 1 / 2)\n return q;\n if (t < 2 / 3)\n return p + (q - p) * (2 / 3 - t) * 6;\n return p;\n}\nfunction hslaToRgba({ hue, saturation, lightness, alpha }) {\n hue /= 360;\n saturation /= 100;\n lightness /= 100;\n let red = 0;\n let green = 0;\n let blue = 0;\n if (!saturation) {\n red = green = blue = lightness;\n }\n else {\n const q = lightness < 0.5\n ? lightness * (1 + saturation)\n : lightness + saturation - lightness * saturation;\n const p = 2 * lightness - q;\n red = hueToRgb(p, q, hue + 1 / 3);\n green = hueToRgb(p, q, hue);\n blue = hueToRgb(p, q, hue - 1 / 3);\n }\n return {\n red: Math.round(red * 255),\n green: Math.round(green * 255),\n blue: Math.round(blue * 255),\n alpha,\n };\n}\n\nexport { hslaToRgba };\n//# sourceMappingURL=hsla-to-rgba.mjs.map\n","function mixImmediate(a, b) {\n return (p) => (p > 0 ? b : a);\n}\n\nexport { mixImmediate };\n//# sourceMappingURL=immediate.mjs.map\n","/*\n Value in range from progress\n\n Given a lower limit and an upper limit, we return the value within\n that range as expressed by progress (usually a number from 0 to 1)\n\n So progress = 0.5 would change\n\n from -------- to\n\n to\n\n from ---- to\n\n E.g. from = 10, to = 20, progress = 0.5 => 15\n\n @param [number]: Lower limit of range\n @param [number]: Upper limit of range\n @param [number]: The progress between lower and upper limits expressed 0-1\n @return [number]: Value as calculated from progress within range (not limited within range)\n*/\nconst mixNumber = (from, to, progress) => {\n return from + (to - from) * progress;\n};\n\nexport { mixNumber };\n//# sourceMappingURL=number.mjs.map\n","import { warning } from 'motion-utils';\nimport { hex } from '../../value/types/color/hex.mjs';\nimport { hsla } from '../../value/types/color/hsla.mjs';\nimport { hslaToRgba } from '../../value/types/color/hsla-to-rgba.mjs';\nimport { rgba } from '../../value/types/color/rgba.mjs';\nimport { mixImmediate } from './immediate.mjs';\nimport { mixNumber } from './number.mjs';\n\n// Linear color space blending\n// Explained https://www.youtube.com/watch?v=LKnqECcg6Gw\n// Demonstrated http://codepen.io/osublake/pen/xGVVaN\nconst mixLinearColor = (from, to, v) => {\n const fromExpo = from * from;\n const expo = v * (to * to - fromExpo) + fromExpo;\n return expo < 0 ? 0 : Math.sqrt(expo);\n};\nconst colorTypes = [hex, rgba, hsla];\nconst getColorType = (v) => colorTypes.find((type) => type.test(v));\nfunction asRGBA(color) {\n const type = getColorType(color);\n warning(Boolean(type), `'${color}' is not an animatable color. Use the equivalent color code instead.`, \"color-not-animatable\");\n if (!Boolean(type))\n return false;\n let model = type.parse(color);\n if (type === hsla) {\n // TODO Remove this cast - needed since Motion's stricter typing\n model = hslaToRgba(model);\n }\n return model;\n}\nconst mixColor = (from, to) => {\n const fromRGBA = asRGBA(from);\n const toRGBA = asRGBA(to);\n if (!fromRGBA || !toRGBA) {\n return mixImmediate(from, to);\n }\n const blended = { ...fromRGBA };\n return (v) => {\n blended.red = mixLinearColor(fromRGBA.red, toRGBA.red, v);\n blended.green = mixLinearColor(fromRGBA.green, toRGBA.green, v);\n blended.blue = mixLinearColor(fromRGBA.blue, toRGBA.blue, v);\n blended.alpha = mixNumber(fromRGBA.alpha, toRGBA.alpha, v);\n return rgba.transform(blended);\n };\n};\n\nexport { mixColor, mixLinearColor };\n//# sourceMappingURL=color.mjs.map\n","const invisibleValues = new Set([\"none\", \"hidden\"]);\n/**\n * Returns a function that, when provided a progress value between 0 and 1,\n * will return the \"none\" or \"hidden\" string only when the progress is that of\n * the origin or target.\n */\nfunction mixVisibility(origin, target) {\n if (invisibleValues.has(origin)) {\n return (p) => (p <= 0 ? origin : target);\n }\n else {\n return (p) => (p >= 1 ? target : origin);\n }\n}\n\nexport { invisibleValues, mixVisibility };\n//# sourceMappingURL=visibility.mjs.map\n","import { pipe, warning } from 'motion-utils';\nimport { isCSSVariableToken } from '../../animation/utils/is-css-variable.mjs';\nimport { color } from '../../value/types/color/index.mjs';\nimport { complex, analyseComplexValue } from '../../value/types/complex/index.mjs';\nimport { mixColor } from './color.mjs';\nimport { mixImmediate } from './immediate.mjs';\nimport { mixNumber as mixNumber$1 } from './number.mjs';\nimport { invisibleValues, mixVisibility } from './visibility.mjs';\n\nfunction mixNumber(a, b) {\n return (p) => mixNumber$1(a, b, p);\n}\nfunction getMixer(a) {\n if (typeof a === \"number\") {\n return mixNumber;\n }\n else if (typeof a === \"string\") {\n return isCSSVariableToken(a)\n ? mixImmediate\n : color.test(a)\n ? mixColor\n : mixComplex;\n }\n else if (Array.isArray(a)) {\n return mixArray;\n }\n else if (typeof a === \"object\") {\n return color.test(a) ? mixColor : mixObject;\n }\n return mixImmediate;\n}\nfunction mixArray(a, b) {\n const output = [...a];\n const numValues = output.length;\n const blendValue = a.map((v, i) => getMixer(v)(v, b[i]));\n return (p) => {\n for (let i = 0; i < numValues; i++) {\n output[i] = blendValue[i](p);\n }\n return output;\n };\n}\nfunction mixObject(a, b) {\n const output = { ...a, ...b };\n const blendValue = {};\n for (const key in output) {\n if (a[key] !== undefined && b[key] !== undefined) {\n blendValue[key] = getMixer(a[key])(a[key], b[key]);\n }\n }\n return (v) => {\n for (const key in blendValue) {\n output[key] = blendValue[key](v);\n }\n return output;\n };\n}\nfunction matchOrder(origin, target) {\n const orderedOrigin = [];\n const pointers = { color: 0, var: 0, number: 0 };\n for (let i = 0; i < target.values.length; i++) {\n const type = target.types[i];\n const originIndex = origin.indexes[type][pointers[type]];\n const originValue = origin.values[originIndex] ?? 0;\n orderedOrigin[i] = originValue;\n pointers[type]++;\n }\n return orderedOrigin;\n}\nconst mixComplex = (origin, target) => {\n const template = complex.createTransformer(target);\n const originStats = analyseComplexValue(origin);\n const targetStats = analyseComplexValue(target);\n const canInterpolate = originStats.indexes.var.length === targetStats.indexes.var.length &&\n originStats.indexes.color.length === targetStats.indexes.color.length &&\n originStats.indexes.number.length >= targetStats.indexes.number.length;\n if (canInterpolate) {\n if ((invisibleValues.has(origin) &&\n !targetStats.values.length) ||\n (invisibleValues.has(target) &&\n !originStats.values.length)) {\n return mixVisibility(origin, target);\n }\n return pipe(mixArray(matchOrder(originStats, targetStats), targetStats.values), template);\n }\n else {\n warning(true, `Complex values '${origin}' and '${target}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`, \"complex-values-different\");\n return mixImmediate(origin, target);\n }\n};\n\nexport { getMixer, mixArray, mixComplex, mixObject };\n//# sourceMappingURL=complex.mjs.map\n","import { getMixer } from './complex.mjs';\nimport { mixNumber } from './number.mjs';\n\nfunction mix(from, to, p) {\n if (typeof from === \"number\" &&\n typeof to === \"number\" &&\n typeof p === \"number\") {\n return mixNumber(from, to, p);\n }\n const mixer = getMixer(from);\n return mixer(from, to);\n}\n\nexport { mix };\n//# sourceMappingURL=index.mjs.map\n","import { invariant, clamp, MotionGlobalConfig, noop, pipe, progress } from 'motion-utils';\nimport { mix } from './mix/index.mjs';\n\nfunction createMixers(output, ease, customMixer) {\n const mixers = [];\n const mixerFactory = customMixer || MotionGlobalConfig.mix || mix;\n const numMixers = output.length - 1;\n for (let i = 0; i < numMixers; i++) {\n let mixer = mixerFactory(output[i], output[i + 1]);\n if (ease) {\n const easingFunction = Array.isArray(ease) ? ease[i] || noop : ease;\n mixer = pipe(easingFunction, mixer);\n }\n mixers.push(mixer);\n }\n return mixers;\n}\n/**\n * Create a function that maps from a numerical input array to a generic output array.\n *\n * Accepts:\n * - Numbers\n * - Colors (hex, hsl, hsla, rgb, rgba)\n * - Complex (combinations of one or more numbers or strings)\n *\n * ```jsx\n * const mixColor = interpolate([0, 1], ['#fff', '#000'])\n *\n * mixColor(0.5) // 'rgba(128, 128, 128, 1)'\n * ```\n *\n * TODO Revisit this approach once we've moved to data models for values,\n * probably not needed to pregenerate mixer functions.\n *\n * @public\n */\nfunction interpolate(input, output, { clamp: isClamp = true, ease, mixer } = {}) {\n const inputLength = input.length;\n invariant(inputLength === output.length, \"Both input and output ranges must be the same length\", \"range-length\");\n /**\n * If we're only provided a single input, we can just make a function\n * that returns the output.\n */\n if (inputLength === 1)\n return () => output[0];\n if (inputLength === 2 && output[0] === output[1])\n return () => output[1];\n const isZeroDeltaRange = input[0] === input[1];\n // If input runs highest -> lowest, reverse both arrays\n if (input[0] > input[inputLength - 1]) {\n input = [...input].reverse();\n output = [...output].reverse();\n }\n const mixers = createMixers(output, ease, mixer);\n const numMixers = mixers.length;\n const interpolator = (v) => {\n if (isZeroDeltaRange && v < input[0])\n return output[0];\n let i = 0;\n if (numMixers > 1) {\n for (; i < input.length - 2; i++) {\n if (v < input[i + 1])\n break;\n }\n }\n const progressInRange = progress(input[i], input[i + 1], v);\n return mixers[i](progressInRange);\n };\n return isClamp\n ? (v) => interpolator(clamp(input[0], input[inputLength - 1], v))\n : interpolator;\n}\n\nexport { interpolate };\n//# sourceMappingURL=interpolate.mjs.map\n","import { fillOffset } from './fill.mjs';\n\nfunction defaultOffset(arr) {\n const offset = [0];\n fillOffset(offset, arr.length - 1);\n return offset;\n}\n\nexport { defaultOffset };\n//# sourceMappingURL=default.mjs.map\n","import { progress } from 'motion-utils';\nimport { mixNumber } from '../../../utils/mix/number.mjs';\n\nfunction fillOffset(offset, remaining) {\n const min = offset[offset.length - 1];\n for (let i = 1; i <= remaining; i++) {\n const offsetProgress = progress(0, remaining, i);\n offset.push(mixNumber(min, 1, offsetProgress));\n }\n}\n\nexport { fillOffset };\n//# sourceMappingURL=fill.mjs.map\n","/**\n * Add the ability for test suites to manually set support flags\n * to better test more environments.\n */\nconst supportsFlags = {};\n\nexport { supportsFlags };\n//# sourceMappingURL=flags.mjs.map\n","import { memo } from 'motion-utils';\nimport { supportsFlags } from './flags.mjs';\n\nfunction memoSupports(callback, supportsFlag) {\n const memoized = memo(callback);\n return () => supportsFlags[supportsFlag] ?? memoized();\n}\n\nexport { memoSupports };\n//# sourceMappingURL=memo.mjs.map\n","/*#__NO_SIDE_EFFECTS__*/\nfunction memo(callback) {\n let result;\n return () => {\n if (result === undefined)\n result = callback();\n return result;\n };\n}\n\nexport { memo };\n//# sourceMappingURL=memo.mjs.map\n","import { memoSupports } from './memo.mjs';\n\nconst supportsScrollTimeline = /* @__PURE__ */ memoSupports(() => window.ScrollTimeline !== undefined, \"scrollTimeline\");\nconst supportsViewTimeline = /* @__PURE__ */ memoSupports(() => window.ViewTimeline !== undefined, \"viewTimeline\");\n\nexport { supportsScrollTimeline, supportsViewTimeline };\n//# sourceMappingURL=scroll-timeline.mjs.map\n","import { isObject } from 'motion-utils';\n\n/**\n * Checks if an element is an HTML element in a way\n * that works across iframes\n */\nfunction isHTMLElement(element) {\n return (isObject(element) &&\n \"offsetHeight\" in element &&\n !(\"ownerSVGElement\" in element));\n}\n\nexport { isHTMLElement };\n//# sourceMappingURL=is-html-element.mjs.map\n","import { isSVGElement } from '../utils/is-svg-element.mjs';\nimport { resolveElements } from '../utils/resolve-elements.mjs';\n\nconst resizeHandlers = new WeakMap();\nlet observer;\nconst getSize = (borderBoxAxis, svgAxis, htmlAxis) => (target, borderBoxSize) => {\n if (borderBoxSize && borderBoxSize[0]) {\n return borderBoxSize[0][(borderBoxAxis + \"Size\")];\n }\n else if (isSVGElement(target) && \"getBBox\" in target) {\n return target.getBBox()[svgAxis];\n }\n else {\n return target[htmlAxis];\n }\n};\nconst getWidth = /*@__PURE__*/ getSize(\"inline\", \"width\", \"offsetWidth\");\nconst getHeight = /*@__PURE__*/ getSize(\"block\", \"height\", \"offsetHeight\");\nfunction notifyTarget({ target, borderBoxSize }) {\n resizeHandlers.get(target)?.forEach((handler) => {\n handler(target, {\n get width() {\n return getWidth(target, borderBoxSize);\n },\n get height() {\n return getHeight(target, borderBoxSize);\n },\n });\n });\n}\nfunction notifyAll(entries) {\n entries.forEach(notifyTarget);\n}\nfunction createResizeObserver() {\n if (typeof ResizeObserver === \"undefined\")\n return;\n observer = new ResizeObserver(notifyAll);\n}\nfunction resizeElement(target, handler) {\n if (!observer)\n createResizeObserver();\n const elements = resolveElements(target);\n elements.forEach((element) => {\n let elementHandlers = resizeHandlers.get(element);\n if (!elementHandlers) {\n elementHandlers = new Set();\n resizeHandlers.set(element, elementHandlers);\n }\n elementHandlers.add(handler);\n observer?.observe(element);\n });\n return () => {\n elements.forEach((element) => {\n const elementHandlers = resizeHandlers.get(element);\n elementHandlers?.delete(handler);\n if (!elementHandlers?.size) {\n observer?.unobserve(element);\n }\n });\n };\n}\n\nexport { resizeElement };\n//# sourceMappingURL=handle-element.mjs.map\n","import { isObject } from 'motion-utils';\n\n/**\n * Checks if an element is an SVG element in a way\n * that works across iframes\n */\nfunction isSVGElement(element) {\n return isObject(element) && \"ownerSVGElement\" in element;\n}\n\nexport { isSVGElement };\n//# sourceMappingURL=is-svg-element.mjs.map\n","function resolveElements(elementOrSelector, scope, selectorCache) {\n if (elementOrSelector == null) {\n return [];\n }\n if (elementOrSelector instanceof EventTarget) {\n return [elementOrSelector];\n }\n else if (typeof elementOrSelector === \"string\") {\n let root = document;\n if (scope) {\n root = scope.current;\n }\n const elements = selectorCache?.[elementOrSelector] ??\n root.querySelectorAll(elementOrSelector);\n return elements ? Array.from(elements) : [];\n }\n return Array.from(elementOrSelector).filter((element) => element != null);\n}\n\nexport { resolveElements };\n//# sourceMappingURL=resolve-elements.mjs.map\n","const windowCallbacks = new Set();\nlet windowResizeHandler;\nfunction createWindowResizeHandler() {\n windowResizeHandler = () => {\n const info = {\n get width() {\n return window.innerWidth;\n },\n get height() {\n return window.innerHeight;\n },\n };\n windowCallbacks.forEach((callback) => callback(info));\n };\n window.addEventListener(\"resize\", windowResizeHandler);\n}\nfunction resizeWindow(callback) {\n windowCallbacks.add(callback);\n if (!windowResizeHandler)\n createWindowResizeHandler();\n return () => {\n windowCallbacks.delete(callback);\n if (!windowCallbacks.size &&\n typeof windowResizeHandler === \"function\") {\n window.removeEventListener(\"resize\", windowResizeHandler);\n windowResizeHandler = undefined;\n }\n };\n}\n\nexport { resizeWindow };\n//# sourceMappingURL=handle-window.mjs.map\n","import { frame, cancelFrame } from '../frameloop/frame.mjs';\n\nfunction observeTimeline(update, timeline) {\n let prevProgress;\n const onFrame = () => {\n const { currentTime } = timeline;\n const percentage = currentTime === null ? 0 : currentTime.value;\n const progress = percentage / 100;\n if (prevProgress !== progress) {\n update(progress);\n }\n prevProgress = progress;\n };\n frame.preUpdate(onFrame, true);\n return () => cancelFrame(onFrame);\n}\n\nexport { observeTimeline };\n//# sourceMappingURL=observe.mjs.map\n","import { supportsScrollTimeline, supportsViewTimeline } from \"motion-dom\";\nexport function canUseNativeTimeline(target) {\n if (typeof window === \"undefined\")\n return false;\n return target ? supportsViewTimeline() : supportsScrollTimeline();\n}\n//# sourceMappingURL=can-use-native-timeline.js.map","import { progress, velocityPerSecond } from \"motion-utils\";\n/**\n * A time in milliseconds, beyond which we consider the scroll velocity to be 0.\n */\nconst maxElapsed = 50;\nconst createAxisInfo = () => ({\n current: 0,\n offset: [],\n progress: 0,\n scrollLength: 0,\n targetOffset: 0,\n targetLength: 0,\n containerLength: 0,\n velocity: 0,\n});\nexport const createScrollInfo = () => ({\n time: 0,\n x: createAxisInfo(),\n y: createAxisInfo(),\n});\nconst keys = {\n x: {\n length: \"Width\",\n position: \"Left\",\n },\n y: {\n length: \"Height\",\n position: \"Top\",\n },\n};\nfunction updateAxisInfo(element, axisName, info, time) {\n const axis = info[axisName];\n const { length, position } = keys[axisName];\n const prev = axis.current;\n const prevTime = info.time;\n axis.current = Math.abs(element[`scroll${position}`]);\n axis.scrollLength = element[`scroll${length}`] - element[`client${length}`];\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 const elapsed = time - prevTime;\n axis.velocity =\n elapsed > maxElapsed\n ? 0\n : velocityPerSecond(axis.current - prev, elapsed);\n}\nexport function updateScrollInfo(element, info, time) {\n updateAxisInfo(element, \"x\", info, time);\n updateAxisInfo(element, \"y\", info, time);\n info.time = time;\n}\n//# sourceMappingURL=info.js.map","/*\n Convert velocity into velocity per second\n*/\n/*#__NO_SIDE_EFFECTS__*/\nconst velocityPerSecond = (velocity, frameDuration) => frameDuration ? velocity * (1000 / frameDuration) : 0;\n\nexport { velocityPerSecond };\n//# sourceMappingURL=velocity-per-second.mjs.map\n","export const namedEdges = {\n start: 0,\n center: 0.5,\n end: 1,\n};\nexport function resolveEdge(edge, length, inset = 0) {\n let delta = 0;\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];\n }\n /**\n * Handle unit values\n */\n if (typeof edge === \"string\") {\n const asNumber = parseFloat(edge);\n if (edge.endsWith(\"px\")) {\n delta = asNumber;\n }\n else if (edge.endsWith(\"%\")) {\n edge = asNumber / 100;\n }\n else if (edge.endsWith(\"vw\")) {\n delta = (asNumber / 100) * document.documentElement.clientWidth;\n }\n else if (edge.endsWith(\"vh\")) {\n delta = (asNumber / 100) * document.documentElement.clientHeight;\n }\n else {\n edge = asNumber;\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 return inset + delta;\n}\n//# sourceMappingURL=edge.js.map","import { namedEdges, resolveEdge } from \"./edge\";\nconst defaultOffset = [0, 0];\nexport function resolveOffset(offset, containerLength, targetLength, targetInset) {\n let offsetDefinition = Array.isArray(offset) ? offset : defaultOffset;\n let targetPoint = 0;\n let containerPoint = 0;\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 }\n else if (typeof offset === \"string\") {\n offset = offset.trim();\n if (offset.includes(\" \")) {\n offsetDefinition = offset.split(\" \");\n }\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] ? offset : `0`];\n }\n }\n targetPoint = resolveEdge(offsetDefinition[0], targetLength, targetInset);\n containerPoint = resolveEdge(offsetDefinition[1], containerLength);\n return targetPoint - containerPoint;\n}\n//# sourceMappingURL=offset.js.map","export const ScrollOffset = {\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//# sourceMappingURL=presets.js.map","import { defaultOffset, interpolate } from \"motion-dom\";\nimport { clamp } from \"motion-utils\";\nimport { calcInset } from \"./inset\";\nimport { resolveOffset } from \"./offset\";\nimport { ScrollOffset } from \"./presets\";\nconst point = { x: 0, y: 0 };\nfunction getTargetSize(target) {\n return \"getBBox\" in target && target.tagName !== \"svg\"\n ? target.getBBox()\n : { width: target.clientWidth, height: target.clientHeight };\n}\nexport function resolveOffsets(container, info, options) {\n const { offset: offsetDefinition = ScrollOffset.All } = options;\n const { target = container, axis = \"y\" } = options;\n const lengthLabel = axis === \"y\" ? \"height\" : \"width\";\n const inset = target !== container ? calcInset(target, container) : point;\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 = target === container\n ? { width: container.scrollWidth, height: container.scrollHeight }\n : getTargetSize(target);\n const containerSize = {\n width: container.clientWidth,\n height: container.clientHeight,\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 * 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 const numOffsets = offsetDefinition.length;\n for (let i = 0; i < numOffsets; i++) {\n const offset = resolveOffset(offsetDefinition[i], containerSize[lengthLabel], targetSize[lengthLabel], inset[axis]);\n if (!hasChanged && offset !== info[axis].interpolatorOffsets[i]) {\n hasChanged = true;\n }\n info[axis].offset[i] = offset;\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(info[axis].offset, defaultOffset(offsetDefinition), { clamp: false });\n info[axis].interpolatorOffsets = [...info[axis].offset];\n }\n info[axis].progress = clamp(0, 1, info[axis].interpolate(info[axis].current));\n}\n//# sourceMappingURL=index.js.map","import { isHTMLElement } from \"motion-dom\";\nexport function calcInset(element, container) {\n const inset = { x: 0, y: 0 };\n let current = 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 }\n else if (current.tagName === \"svg\") {\n /**\n * This isn't an ideal approach to measuring the offset of 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 . Likewise we\n * can't use .getBBox() like most SVG elements as these provide the offset\n * relative to the SVG itself, which for 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 }\n else if (current instanceof SVGGraphicsElement) {\n const { x, y } = current.getBBox();\n inset.x += x;\n inset.y += y;\n let svg = null;\n let parent = current.parentNode;\n while (!svg) {\n if (parent.tagName === \"svg\") {\n svg = parent;\n }\n parent = current.parentNode;\n }\n current = svg;\n }\n else {\n break;\n }\n }\n return inset;\n}\n//# sourceMappingURL=inset.js.map","import { warnOnce } from \"motion-utils\";\nimport { updateScrollInfo } from \"./info\";\nimport { resolveOffsets } from \"./offsets/index\";\nfunction measure(container, target = container, info) {\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;\n while (node && node !== container) {\n info.x.targetOffset += node.offsetLeft;\n info.y.targetOffset += node.offsetTop;\n node = node.offsetParent;\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 * 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 (container &&\n target &&\n target !== container &&\n container !== document.documentElement &&\n container !== document.scrollingElement &&\n container !== document.body) {\n warnOnce(getComputedStyle(container).position !== \"static\", \"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}\nexport function createOnScrollHandler(element, onScroll, info, options = {}) {\n return {\n measure: (time) => {\n measure(element, options.target, info);\n updateScrollInfo(element, info, time);\n if (options.offset || options.target) {\n resolveOffsets(element, info, options);\n }\n },\n notify: () => onScroll(info),\n };\n}\n//# sourceMappingURL=on-scroll-handler.js.map","import { cancelFrame, frame, frameData, resize } from \"motion-dom\";\nimport { noop } from \"motion-utils\";\nimport { createScrollInfo } from \"./info\";\nimport { createOnScrollHandler } from \"./on-scroll-handler\";\nconst scrollListeners = new WeakMap();\nconst resizeListeners = new WeakMap();\nconst onScrollHandlers = new WeakMap();\nconst scrollSize = new WeakMap();\nconst dimensionCheckProcesses = new WeakMap();\nconst getEventTarget = (element) => element === document.scrollingElement ? window : element;\nexport function scrollInfo(onScroll, { container = document.scrollingElement, trackContentSize = false, ...options } = {}) {\n if (!container)\n return noop;\n let containerHandlers = onScrollHandlers.get(container);\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 * Create a new onScroll handler for the provided callback.\n */\n const info = createScrollInfo();\n const containerHandler = createOnScrollHandler(container, onScroll, info, options);\n containerHandlers.add(containerHandler);\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 frame.preUpdate(notifyAll);\n };\n const notifyAll = () => {\n for (const handler of containerHandlers) {\n handler.notify();\n }\n };\n const listener = () => frame.read(measureAll);\n scrollListeners.set(container, listener);\n const target = getEventTarget(container);\n window.addEventListener(\"resize\", listener);\n if (container !== document.documentElement) {\n resizeListeners.set(container, resize(container, listener));\n }\n target.addEventListener(\"scroll\", listener);\n listener();\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 // 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 // Add frame-based scroll dimension checking to detect content changes\n const checkScrollDimensions = () => {\n const newWidth = container.scrollWidth;\n const newHeight = container.scrollHeight;\n if (size.width !== newWidth || size.height !== newHeight) {\n listener();\n size.width = newWidth;\n size.height = newHeight;\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 const listener = scrollListeners.get(container);\n frame.read(listener, false, true);\n return () => {\n cancelFrame(listener);\n /**\n * Check if we even have any handlers for this container.\n */\n const currentHandlers = onScrollHandlers.get(container);\n if (!currentHandlers)\n return;\n currentHandlers.delete(containerHandler);\n if (currentHandlers.size)\n return;\n /**\n * If no more handlers, remove the scroll listener too.\n */\n const scrollListener = scrollListeners.get(container);\n scrollListeners.delete(container);\n if (scrollListener) {\n getEventTarget(container).removeEventListener(\"scroll\", scrollListener);\n resizeListeners.get(container)?.();\n window.removeEventListener(\"resize\", scrollListener);\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//# sourceMappingURL=track.js.map","import { resizeElement } from './handle-element.mjs';\nimport { resizeWindow } from './handle-window.mjs';\n\nfunction resize(a, b) {\n return typeof a === \"function\" ? resizeWindow(a) : resizeElement(a, b);\n}\n\nexport { resize };\n//# sourceMappingURL=index.mjs.map\n","import { ScrollOffset as ScrollOffsetPresets } from \"../offsets/presets\";\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 = [\n [ScrollOffsetPresets.Enter, \"entry\"],\n [ScrollOffsetPresets.Exit, \"exit\"],\n [ScrollOffsetPresets.Any, \"cover\"],\n [ScrollOffsetPresets.All, \"contain\"],\n];\nconst stringToProgress = {\n start: 0,\n end: 1,\n};\nfunction parseStringOffset(s) {\n const parts = s.trim().split(/\\s+/);\n if (parts.length !== 2)\n return undefined;\n const a = stringToProgress[parts[0]];\n const b = stringToProgress[parts[1]];\n if (a === undefined || b === undefined)\n return undefined;\n return [a, b];\n}\nfunction normaliseOffset(offset) {\n if (offset.length !== 2)\n return undefined;\n const result = [];\n for (const item of offset) {\n if (Array.isArray(item)) {\n result.push(item);\n }\n else if (typeof item === \"string\") {\n const parsed = parseStringOffset(item);\n if (!parsed)\n return undefined;\n result.push(parsed);\n }\n else {\n return undefined;\n }\n }\n return result;\n}\nfunction matchesPreset(offset, preset) {\n const normalised = normaliseOffset(offset);\n if (!normalised)\n return false;\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])\n return false;\n }\n return true;\n}\nexport function offsetToViewTimelineRange(offset) {\n if (!offset) {\n return { rangeStart: \"contain 0%\", rangeEnd: \"contain 100%\" };\n }\n for (const [preset, name] of presets) {\n if (matchesPreset(offset, preset)) {\n return { rangeStart: `${name} 0%`, rangeEnd: `${name} 100%` };\n }\n }\n return undefined;\n}\n//# sourceMappingURL=offset-to-range.js.map","import { scrollInfo } from \"../track\";\nimport { canUseNativeTimeline } from \"./can-use-native-timeline\";\nimport { offsetToViewTimelineRange } from \"./offset-to-range\";\nconst timelineCache = new Map();\nfunction scrollTimelineFallback(options) {\n const currentTime = { value: 0 };\n const cancel = scrollInfo((info) => {\n currentTime.value = info[options.axis].progress * 100;\n }, options);\n return { currentTime, cancel };\n}\nexport function getTimeline({ source, container, ...options }) {\n const { axis } = options;\n if (source)\n container = source;\n let containerCache = timelineCache.get(container);\n if (!containerCache) {\n containerCache = new Map();\n timelineCache.set(container, containerCache);\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 const axisKey = axis + (options.offset ?? []).join(\",\");\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 }\n else {\n targetCache[axisKey] = scrollTimelineFallback({\n container,\n ...options,\n });\n }\n }\n else if (canUseNativeTimeline()) {\n targetCache[axisKey] = new ScrollTimeline({\n source: container,\n axis,\n });\n }\n else {\n targetCache[axisKey] = scrollTimelineFallback({\n container,\n ...options,\n });\n }\n }\n return targetCache[axisKey];\n}\n//# sourceMappingURL=get-timeline.js.map","import { noop } from \"motion-utils\";\nimport { attachToAnimation } from \"./attach-animation\";\nimport { attachToFunction } from \"./attach-function\";\nexport function scroll(onScroll, { axis = \"y\", container = document.scrollingElement, ...options } = {}) {\n if (!container)\n return noop;\n const optionsWithDefaults = { axis, container, ...options };\n return typeof onScroll === \"function\"\n ? attachToFunction(onScroll, optionsWithDefaults)\n : attachToAnimation(onScroll, optionsWithDefaults);\n}\n//# sourceMappingURL=index.js.map","import { observeTimeline } from \"motion-dom\";\nimport { scrollInfo } from \"./track\";\nimport { getTimeline } from \"./utils/get-timeline\";\nimport { isElementTracking } from \"./utils/is-element-tracking\";\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) {\n return onScroll.length === 2;\n}\nexport function attachToFunction(onScroll, options) {\n if (isOnScrollWithInfo(onScroll) || isElementTracking(options)) {\n return scrollInfo((info) => {\n onScroll(info[options.axis].progress, info);\n }, options);\n }\n else {\n return observeTimeline(onScroll, getTimeline(options));\n }\n}\n//# sourceMappingURL=attach-function.js.map","/**\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) {\n return options && (options.target || options.offset);\n}\n//# sourceMappingURL=is-element-tracking.js.map","import { observeTimeline } from \"motion-dom\";\nimport { canUseNativeTimeline } from \"./utils/can-use-native-timeline\";\nimport { getTimeline } from \"./utils/get-timeline\";\nimport { offsetToViewTimelineRange } from \"./utils/offset-to-range\";\nexport function attachToAnimation(animation, options) {\n const timeline = getTimeline(options);\n const range = options.target\n ? offsetToViewTimelineRange(options.offset)\n : undefined;\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 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 return observeTimeline((progress) => {\n valueAnimation.time =\n valueAnimation.iterationDuration * progress;\n }, timeline);\n },\n });\n}\n//# sourceMappingURL=attach-animation.js.map"],"names":["clamp","min","max","v","formatErrorMessage","message","errorCode","warning","invariant","process","env","NODE_ENV","check","console","warn","Error","MotionGlobalConfig","isObject","value","noop","any","pipe","transformers","reduce","a","b","progress","from","to","range","stepsOrder","createRenderBatcher","scheduleNextBatch","allowKeepAlive","runNextFrame","useDefaultElapsed","state","delta","timestamp","isProcessing","flagRunNextFrame","steps","acc","key","thisFrame","Set","nextFrame","flushNextFrame","toKeepAlive","WeakSet","latestFrameData","triggerCallback","callback","has","step","schedule","keepAlive","immediate","queue","add","cancel","delete","frameData","prevFrame","forEach","clear","createRenderStep","setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender","processBatch","useManualTiming","performance","now","Math","i","length","frame","cancelFrame","requestAnimationFrame","startsAsVariableToken","token","startsWith","checkStringStartsWith","singleCssVariableRegex","number","test","parse","parseFloat","transform","alpha","sanitize","round","floatRegex","singleColorRegex","isColorString","type","testProp","Boolean","isNullish","Object","prototype","hasOwnProperty","call","splitColor","aName","bName","cName","c","match","undefined","rgbUnit","clampRgbUnit","rgba","red","green","blue","alpha$1","hex","r","g","substring","parseInt","percent","unit","endsWith","split","createUnitType","hsla","hue","saturation","lightness","color","getAnimatableNone","parsed","colorRegex","NUMBER_TOKEN","COLOR_TOKEN","complexRegex","analyseComplexValue","originalValue","toString","values","indexes","var","types","replace","parsedValue","push","buildTransformer","numSections","output","convertToZero","splitBefore","trim","complex","isNaN","createTransformer","source","info","transformer","map","hueToRgb","p","q","t","mixImmediate","mixNumber","mixLinearColor","fromExpo","expo","sqrt","colorTypes","asRGBA","find","model","hslaToRgba","mixColor","fromRGBA","toRGBA","blended","invisibleValues","mixNumber$1","getMixer","mixComplex","Array","isArray","mixArray","mixObject","numValues","blendValue","origin","target","template","originStats","targetStats","mixVisibility","orderedOrigin","pointers","originIndex","originValue","matchOrder","mix","mixer","interpolate","input","isClamp","ease","inputLength","isZeroDeltaRange","reverse","mixers","customMixer","mixerFactory","numMixers","easingFunction","createMixers","interpolator","progressInRange","defaultOffset","arr","offset","remaining","offsetProgress","fillOffset","supportsFlags","memoSupports","supportsFlag","memoized","result","memo","supportsScrollTimeline","window","ScrollTimeline","supportsViewTimeline","ViewTimeline","isHTMLElement","element","resizeHandlers","WeakMap","observer","getSize","borderBoxAxis","svgAxis","htmlAxis","borderBoxSize","getBBox","getWidth","getHeight","notifyTarget","get","handler","width","height","notifyAll","entries","resizeElement","ResizeObserver","elements","elementOrSelector","EventTarget","document","querySelectorAll","filter","resolveElements","elementHandlers","set","observe","size","unobserve","windowCallbacks","windowResizeHandler","resizeWindow","innerWidth","innerHeight","addEventListener","removeEventListener","observeTimeline","timeline","prevProgress","onFrame","currentTime","canUseNativeTimeline","keys","x","position","y","updateAxisInfo","axisName","time","axis","prev","current","prevTime","abs","scrollLength","elapsed","velocity","frameDuration","namedEdges","start","center","end","resolveEdge","edge","inset","asNumber","documentElement","clientWidth","clientHeight","resolveOffset","containerLength","targetLength","targetInset","offsetDefinition","targetPoint","containerPoint","includes","ScrollOffset","Enter","Exit","Any","All","point","resolveOffsets","container","options","lengthLabel","offsetLeft","offsetTop","offsetParent","tagName","svgBoundingBox","getBoundingClientRect","parentElement","parentBoundingBox","left","top","SVGGraphicsElement","svg","parent","parentNode","calcInset","targetSize","scrollWidth","scrollHeight","getTargetSize","containerSize","hasChanged","numOffsets","interpolatorOffsets","createOnScrollHandler","onScroll","measure","targetOffset","node","updateScrollInfo","notify","scrollListeners","resizeListeners","onScrollHandlers","scrollSize","dimensionCheckProcesses","getEventTarget","scrollingElement","scrollInfo","trackContentSize","containerHandlers","containerHandler","measureAll","listener","checkScrollDimensions","newWidth","newHeight","dimensionCheckProcess","currentHandlers","scrollListener","presets","ScrollOffsetPresets","stringToProgress","parseStringOffset","s","parts","matchesPreset","preset","normalised","item","normaliseOffset","o","offsetToViewTimelineRange","rangeStart","rangeEnd","name","timelineCache","Map","scrollTimelineFallback","getTimeline","containerCache","targetKey","targetCache","axisKey","join","subject","scroll","optionsWithDefaults","isOnScrollWithInfo","isElementTracking","attachToFunction","animation","useNative","attachTimeline","valueAnimation","pause","iterationDuration","attachToAnimation"],"mappings":"AAAA,MAAMA,EAAQ,CAACC,EAAKC,EAAKC,IACjBA,EAAID,EACGA,EACPC,EAAIF,EACGA,EACJE,ECLX,SAASC,EAAmBC,EAASC,GACjC,OAAOA,EACD,GAAGD,2FAAiGC,IACpGD,CACV,CCFA,IAAIE,EAAU,OACVC,EAAY,OACO,oBAAZC,SACmB,eAA1BA,QAAQC,KAAKC,WACbJ,EAAU,CAACK,EAAOP,EAASC,KAClBM,GAA4B,oBAAZC,SACjBA,QAAQC,KAA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EpB5H,QAAUgJ,IACNA,EAAeC,QACRvI,GAAiBhQ,IACpBsY,EAAe1H,KACX0H,EAAeE,kBAAoBxY,GACxCiQ,KAGf,CHxBUwI,CAAkB9D,EAAUoD,EACtC"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/size-rollup-waapi-animate.js b/node_modules/framer-motion/dist/size-rollup-waapi-animate.js deleted file mode 100644 index d52bdcb..0000000 --- a/node_modules/framer-motion/dist/size-rollup-waapi-animate.js +++ /dev/null @@ -1,2 +0,0 @@ -let t=()=>{};"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(t=(t,e,n)=>{if(!t)throw new Error(function(t,e){return e?`${t}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:t}(e,n))});const e=t=>t,n=t=>1e3*t,i=t=>t/1e3,s=t=>null!==t;class a{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}function o(t){for(let e=1;et.startsWith("--");const l={};function u(t,e){const n=function(t){let e;return()=>(void 0===e&&(e=t()),e)}(t);return()=>l[e]??n()}const h=u(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),d=u(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),m=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,c={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:m([0,.65,.55,1]),circOut:m([.55,0,1,.45]),backIn:m([.31,.01,.66,-.59]),backOut:m([.33,1.53,.69,.99])};function p(t,e){return t?"function"==typeof t?d()?((t,e,n=10)=>{let i="";const s=Math.max(Math.round(e/n),2);for(let e=0;eArray.isArray(t)&&"number"==typeof t[0])(t)?m(t):Array.isArray(t)?t.map(t=>p(t,e)||c.easeOut):c[t]:void 0}class f extends a{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:i,keyframes:a,pseudoElement:o,allowFlatten:l=!1,finalKeyframe:u,onComplete:h}=e;this.isPseudoElement=Boolean(o),this.allowFlatten=l,this.options=e,t("string"!=typeof e.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const m=function({type:t,...e}){return function(t){return"function"==typeof t&&"applyToOptions"in t}(t)&&d()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(e);this.animation=function(t,e,n,{delay:i=0,duration:s=300,repeat:a=0,repeatType:o="loop",ease:r="easeOut",times:l}={},u){const h={[e]:n};l&&(h.offset=l);const d=p(r,s);Array.isArray(d)&&(h.easing=d);const m={delay:i,duration:s,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:a+1,direction:"reverse"===o?"alternate":"normal"};return u&&(m.pseudoElement=u),t.animate(h,m)}(n,i,a,m,o),!1===m.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const t=function(t,{repeat:e,repeatType:n="loop"},i,a=1){const o=t.filter(s),r=a<0||e&&"loop"!==n&&e%2==1?0:o.length-1;return r&&void 0!==i?i:o[r]}(a,this.options,u,this.speed);this.updateMotionValue&&this.updateMotionValue(t),function(t,e,n){r(e)?t.style.setProperty(e,n):t.style[e]=n}(n,i,t),this.animation.cancel()}h?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return i(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+i(t)}get time(){return i(Number(this.animation.currentTime)||0)}set time(t){const e=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=n(t),e&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:n,rangeEnd:i,observe:s}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&h()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),i&&(this.animation.rangeEnd=i),e):s(this)}}class g{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;ne.attachTimeline(t));return()=>{e.forEach((t,e)=>{t&&t(),this.animations[e].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return y(this.animations,"duration")}get iterationDuration(){return y(this.animations,"iterationDuration")}runAll(t){this.animations.forEach(e=>e[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function y(t,e){let n=0;for(let i=0;in&&(n=s)}return n}class T extends g{then(t,e){return this.finished.finally(t).then(()=>{})}}const b=new WeakMap,A=(t,e="")=>`${t}:${e}`;function S(t){let e=b.get(t);return e||(e=new Map,b.set(t,e)),e}function E(t,e){const n=t?.[e]??t?.default??t;return n!==t?function(t,e){if(t?.inherit&&e){const{inherit:n,...i}=t;return{...e,...i}}return t}(n,t):n}const k=new Set(["borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","width","maxWidth","height","maxHeight","top","right","bottom","left","inset","insetBlock","insetBlockStart","insetBlockEnd","insetInline","insetInlineStart","insetInlineEnd","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingBlock","paddingBlockStart","paddingBlockEnd","paddingInline","paddingInlineStart","paddingInlineEnd","margin","marginTop","marginRight","marginBottom","marginLeft","marginBlock","marginBlockStart","marginBlockEnd","marginInline","marginInlineStart","marginInlineEnd","fontSize","backgroundPositionX","backgroundPositionY"]);function v(t,e){for(let n=0;nnull!=t)}(e,a),l=r.length;t(Boolean(l),"No valid elements provided.","no-valid-elements");const u=[];for(let t=0;te.delete(n)),h.push(s)}return h}const I=t=>function(e,n,i){return new T(B(e,n,i,t))},R=I();export{R as animateMini,I as createScopedWaapiAnimate}; -//# sourceMappingURL=size-rollup-waapi-animate.js.map diff --git a/node_modules/framer-motion/dist/size-rollup-waapi-animate.js.map b/node_modules/framer-motion/dist/size-rollup-waapi-animate.js.map deleted file mode 100644 index b82bf23..0000000 --- a/node_modules/framer-motion/dist/size-rollup-waapi-animate.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"size-rollup-waapi-animate.js","sources":["../../motion-utils/dist/es/errors.mjs","../../motion-utils/dist/es/format-error-message.mjs","../../motion-utils/dist/es/noop.mjs","../../motion-utils/dist/es/time-conversion.mjs","../../motion-dom/dist/es/animation/keyframes/get-final.mjs","../../motion-dom/dist/es/animation/utils/WithPromise.mjs","../../motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.mjs","../../motion-dom/dist/es/render/dom/is-css-var.mjs","../../motion-dom/dist/es/utils/supports/flags.mjs","../../motion-dom/dist/es/utils/supports/memo.mjs","../../motion-utils/dist/es/memo.mjs","../../motion-dom/dist/es/utils/supports/scroll-timeline.mjs","../../motion-dom/dist/es/utils/supports/linear-easing.mjs","../../motion-dom/dist/es/animation/waapi/easing/cubic-bezier.mjs","../../motion-dom/dist/es/animation/waapi/easing/supported.mjs","../../motion-dom/dist/es/animation/waapi/easing/map-easing.mjs","../../motion-dom/dist/es/animation/waapi/utils/linear.mjs","../../motion-utils/dist/es/easing/utils/is-bezier-definition.mjs","../../motion-dom/dist/es/animation/NativeAnimation.mjs","../../motion-dom/dist/es/animation/waapi/utils/apply-generator.mjs","../../motion-dom/dist/es/animation/generators/utils/is-generator.mjs","../../motion-dom/dist/es/animation/waapi/start-waapi-animation.mjs","../../motion-dom/dist/es/render/dom/style-set.mjs","../../motion-dom/dist/es/animation/GroupAnimation.mjs","../../motion-dom/dist/es/animation/GroupAnimationWithThen.mjs","../../motion-dom/dist/es/animation/utils/active-animations.mjs","../../motion-dom/dist/es/animation/utils/get-value-transition.mjs","../../motion-dom/dist/es/animation/utils/resolve-transition.mjs","../../motion-dom/dist/es/utils/border-radius.mjs","../../motion-dom/dist/es/animation/waapi/utils/px-values.mjs","../../motion-dom/dist/es/animation/keyframes/utils/apply-px-defaults.mjs","../../motion-dom/dist/es/render/dom/style-computed.mjs","../lib/animation/animators/waapi/animate-elements.js","../../motion-dom/dist/es/utils/resolve-elements.mjs","../lib/animation/animators/waapi/animate-style.js"],"sourcesContent":["import { formatErrorMessage } from './format-error-message.mjs';\n\nlet warning = () => { };\nlet invariant = () => { };\nif (typeof process !== \"undefined\" &&\n process.env?.NODE_ENV !== \"production\") {\n warning = (check, message, errorCode) => {\n if (!check && typeof console !== \"undefined\") {\n console.warn(formatErrorMessage(message, errorCode));\n }\n };\n invariant = (check, message, errorCode) => {\n if (!check) {\n throw new Error(formatErrorMessage(message, errorCode));\n }\n };\n}\n\nexport { invariant, warning };\n//# sourceMappingURL=errors.mjs.map\n","function formatErrorMessage(message, errorCode) {\n return errorCode\n ? `${message}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${errorCode}`\n : message;\n}\n\nexport { formatErrorMessage };\n//# sourceMappingURL=format-error-message.mjs.map\n","/*#__NO_SIDE_EFFECTS__*/\nconst noop = (any) => any;\n\nexport { noop };\n//# sourceMappingURL=noop.mjs.map\n","/**\n * Converts seconds to milliseconds\n *\n * @param seconds - Time in seconds.\n * @return milliseconds - Converted time in milliseconds.\n */\n/*#__NO_SIDE_EFFECTS__*/\nconst secondsToMilliseconds = (seconds) => seconds * 1000;\n/*#__NO_SIDE_EFFECTS__*/\nconst millisecondsToSeconds = (milliseconds) => milliseconds / 1000;\n\nexport { millisecondsToSeconds, secondsToMilliseconds };\n//# sourceMappingURL=time-conversion.mjs.map\n","const isNotNull = (value) => value !== null;\nfunction getFinalKeyframe(keyframes, { repeat, repeatType = \"loop\" }, finalKeyframe, speed = 1) {\n const resolvedKeyframes = keyframes.filter(isNotNull);\n const useFirstKeyframe = speed < 0 || (repeat && repeatType !== \"loop\" && repeat % 2 === 1);\n const index = useFirstKeyframe ? 0 : resolvedKeyframes.length - 1;\n return !index || finalKeyframe === undefined\n ? resolvedKeyframes[index]\n : finalKeyframe;\n}\n\nexport { getFinalKeyframe };\n//# sourceMappingURL=get-final.mjs.map\n","class WithPromise {\n constructor() {\n this.updateFinished();\n }\n get finished() {\n return this._finished;\n }\n updateFinished() {\n this._finished = new Promise((resolve) => {\n this.resolve = resolve;\n });\n }\n notifyFinished() {\n this.resolve();\n }\n /**\n * Allows the animation to be awaited.\n *\n * @deprecated Use `finished` instead.\n */\n then(onResolve, onReject) {\n return this.finished.then(onResolve, onReject);\n }\n}\n\nexport { WithPromise };\n//# sourceMappingURL=WithPromise.mjs.map\n","function fillWildcards(keyframes) {\n for (let i = 1; i < keyframes.length; i++) {\n keyframes[i] ?? (keyframes[i] = keyframes[i - 1]);\n }\n}\n\nexport { fillWildcards };\n//# sourceMappingURL=fill-wildcards.mjs.map\n","const isCSSVar = (name) => name.startsWith(\"--\");\n\nexport { isCSSVar };\n//# sourceMappingURL=is-css-var.mjs.map\n","/**\n * Add the ability for test suites to manually set support flags\n * to better test more environments.\n */\nconst supportsFlags = {};\n\nexport { supportsFlags };\n//# sourceMappingURL=flags.mjs.map\n","import { memo } from 'motion-utils';\nimport { supportsFlags } from './flags.mjs';\n\nfunction memoSupports(callback, supportsFlag) {\n const memoized = memo(callback);\n return () => supportsFlags[supportsFlag] ?? memoized();\n}\n\nexport { memoSupports };\n//# sourceMappingURL=memo.mjs.map\n","/*#__NO_SIDE_EFFECTS__*/\nfunction memo(callback) {\n let result;\n return () => {\n if (result === undefined)\n result = callback();\n return result;\n };\n}\n\nexport { memo };\n//# sourceMappingURL=memo.mjs.map\n","import { memoSupports } from './memo.mjs';\n\nconst supportsScrollTimeline = /* @__PURE__ */ memoSupports(() => window.ScrollTimeline !== undefined, \"scrollTimeline\");\nconst supportsViewTimeline = /* @__PURE__ */ memoSupports(() => window.ViewTimeline !== undefined, \"viewTimeline\");\n\nexport { supportsScrollTimeline, supportsViewTimeline };\n//# sourceMappingURL=scroll-timeline.mjs.map\n","import { memoSupports } from './memo.mjs';\n\nconst supportsLinearEasing = /*@__PURE__*/ memoSupports(() => {\n try {\n document\n .createElement(\"div\")\n .animate({ opacity: 0 }, { easing: \"linear(0, 1)\" });\n }\n catch (e) {\n return false;\n }\n return true;\n}, \"linearEasing\");\n\nexport { supportsLinearEasing };\n//# sourceMappingURL=linear-easing.mjs.map\n","const cubicBezierAsString = ([a, b, c, d]) => `cubic-bezier(${a}, ${b}, ${c}, ${d})`;\n\nexport { cubicBezierAsString };\n//# sourceMappingURL=cubic-bezier.mjs.map\n","import { cubicBezierAsString } from './cubic-bezier.mjs';\n\nconst supportedWaapiEasing = {\n linear: \"linear\",\n ease: \"ease\",\n easeIn: \"ease-in\",\n easeOut: \"ease-out\",\n easeInOut: \"ease-in-out\",\n circIn: /*@__PURE__*/ cubicBezierAsString([0, 0.65, 0.55, 1]),\n circOut: /*@__PURE__*/ cubicBezierAsString([0.55, 0, 1, 0.45]),\n backIn: /*@__PURE__*/ cubicBezierAsString([0.31, 0.01, 0.66, -0.59]),\n backOut: /*@__PURE__*/ cubicBezierAsString([0.33, 1.53, 0.69, 0.99]),\n};\n\nexport { supportedWaapiEasing };\n//# sourceMappingURL=supported.mjs.map\n","import { isBezierDefinition } from 'motion-utils';\nimport { supportsLinearEasing } from '../../../utils/supports/linear-easing.mjs';\nimport { generateLinearEasing } from '../utils/linear.mjs';\nimport { cubicBezierAsString } from './cubic-bezier.mjs';\nimport { supportedWaapiEasing } from './supported.mjs';\n\nfunction mapEasingToNativeEasing(easing, duration) {\n if (!easing) {\n return undefined;\n }\n else if (typeof easing === \"function\") {\n return supportsLinearEasing()\n ? generateLinearEasing(easing, duration)\n : \"ease-out\";\n }\n else if (isBezierDefinition(easing)) {\n return cubicBezierAsString(easing);\n }\n else if (Array.isArray(easing)) {\n return easing.map((segmentEasing) => mapEasingToNativeEasing(segmentEasing, duration) ||\n supportedWaapiEasing.easeOut);\n }\n else {\n return supportedWaapiEasing[easing];\n }\n}\n\nexport { mapEasingToNativeEasing };\n//# sourceMappingURL=map-easing.mjs.map\n","const generateLinearEasing = (easing, duration, // as milliseconds\nresolution = 10 // as milliseconds\n) => {\n let points = \"\";\n const numPoints = Math.max(Math.round(duration / resolution), 2);\n for (let i = 0; i < numPoints; i++) {\n points += Math.round(easing(i / (numPoints - 1)) * 10000) / 10000 + \", \";\n }\n return `linear(${points.substring(0, points.length - 2)})`;\n};\n\nexport { generateLinearEasing };\n//# sourceMappingURL=linear.mjs.map\n","/*#__NO_SIDE_EFFECTS__*/\nconst isBezierDefinition = (easing) => Array.isArray(easing) && typeof easing[0] === \"number\";\n\nexport { isBezierDefinition };\n//# sourceMappingURL=is-bezier-definition.mjs.map\n","import { invariant, millisecondsToSeconds, secondsToMilliseconds, noop } from 'motion-utils';\nimport { setStyle } from '../render/dom/style-set.mjs';\nimport { supportsScrollTimeline } from '../utils/supports/scroll-timeline.mjs';\nimport { getFinalKeyframe } from './keyframes/get-final.mjs';\nimport { WithPromise } from './utils/WithPromise.mjs';\nimport { startWaapiAnimation } from './waapi/start-waapi-animation.mjs';\nimport { applyGeneratorOptions } from './waapi/utils/apply-generator.mjs';\n\n/**\n * NativeAnimation implements AnimationPlaybackControls for the browser's Web Animations API.\n */\nclass NativeAnimation extends WithPromise {\n constructor(options) {\n super();\n this.finishedTime = null;\n this.isStopped = false;\n /**\n * Tracks a manually-set start time that takes precedence over WAAPI's\n * dynamic startTime. This is cleared when play() or time setter is called,\n * allowing WAAPI to take over timing.\n */\n this.manualStartTime = null;\n if (!options)\n return;\n const { element, name, keyframes, pseudoElement, allowFlatten = false, finalKeyframe, onComplete, } = options;\n this.isPseudoElement = Boolean(pseudoElement);\n this.allowFlatten = allowFlatten;\n this.options = options;\n invariant(typeof options.type !== \"string\", `Mini animate() doesn't support \"type\" as a string.`, \"mini-spring\");\n const transition = applyGeneratorOptions(options);\n this.animation = startWaapiAnimation(element, name, keyframes, transition, pseudoElement);\n if (transition.autoplay === false) {\n this.animation.pause();\n }\n this.animation.onfinish = () => {\n this.finishedTime = this.time;\n if (!pseudoElement) {\n const keyframe = getFinalKeyframe(keyframes, this.options, finalKeyframe, this.speed);\n if (this.updateMotionValue) {\n this.updateMotionValue(keyframe);\n }\n /**\n * If we can, we want to commit the final style as set by the user,\n * rather than the computed keyframe value supplied by the animation.\n * We always do this, even when a motion value is present, to prevent\n * a visual flash in Firefox where the WAAPI animation's fill is removed\n * during cancel() before the scheduled render can apply the correct value.\n */\n setStyle(element, name, keyframe);\n this.animation.cancel();\n }\n onComplete?.();\n this.notifyFinished();\n };\n }\n play() {\n if (this.isStopped)\n return;\n this.manualStartTime = null;\n this.animation.play();\n if (this.state === \"finished\") {\n this.updateFinished();\n }\n }\n pause() {\n this.animation.pause();\n }\n complete() {\n this.animation.finish?.();\n }\n cancel() {\n try {\n this.animation.cancel();\n }\n catch (e) { }\n }\n stop() {\n if (this.isStopped)\n return;\n this.isStopped = true;\n const { state } = this;\n if (state === \"idle\" || state === \"finished\") {\n return;\n }\n if (this.updateMotionValue) {\n this.updateMotionValue();\n }\n else {\n this.commitStyles();\n }\n if (!this.isPseudoElement)\n this.cancel();\n }\n /**\n * WAAPI doesn't natively have any interruption capabilities.\n *\n * In this method, we commit styles back to the DOM before cancelling\n * the animation.\n *\n * This is designed to be overridden by NativeAnimationExtended, which\n * will create a renderless JS animation and sample it twice to calculate\n * its current value, \"previous\" value, and therefore allow\n * Motion to also correctly calculate velocity for any subsequent animation\n * while deferring the commit until the next animation frame.\n */\n commitStyles() {\n const element = this.options?.element;\n if (!this.isPseudoElement && element?.isConnected) {\n this.animation.commitStyles?.();\n }\n }\n get duration() {\n const duration = this.animation.effect?.getComputedTiming?.().duration || 0;\n return millisecondsToSeconds(Number(duration));\n }\n get iterationDuration() {\n const { delay = 0 } = this.options || {};\n return this.duration + millisecondsToSeconds(delay);\n }\n get time() {\n return millisecondsToSeconds(Number(this.animation.currentTime) || 0);\n }\n set time(newTime) {\n const wasFinished = this.finishedTime !== null;\n this.manualStartTime = null;\n this.finishedTime = null;\n this.animation.currentTime = secondsToMilliseconds(newTime);\n if (wasFinished) {\n this.animation.pause();\n }\n }\n /**\n * The playback speed of the animation.\n * 1 = normal speed, 2 = double speed, 0.5 = half speed.\n */\n get speed() {\n return this.animation.playbackRate;\n }\n set speed(newSpeed) {\n // Allow backwards playback after finishing\n if (newSpeed < 0)\n this.finishedTime = null;\n this.animation.playbackRate = newSpeed;\n }\n get state() {\n return this.finishedTime !== null\n ? \"finished\"\n : this.animation.playState;\n }\n get startTime() {\n return this.manualStartTime ?? Number(this.animation.startTime);\n }\n set startTime(newStartTime) {\n this.manualStartTime = this.animation.startTime = newStartTime;\n }\n /**\n * Attaches a timeline to the animation, for instance the `ScrollTimeline`.\n */\n attachTimeline({ timeline, rangeStart, rangeEnd, observe, }) {\n if (this.allowFlatten) {\n this.animation.effect?.updateTiming({ easing: \"linear\" });\n }\n this.animation.onfinish = null;\n if (timeline && supportsScrollTimeline()) {\n this.animation.timeline = timeline;\n if (rangeStart)\n this.animation.rangeStart = rangeStart;\n if (rangeEnd)\n this.animation.rangeEnd = rangeEnd;\n return noop;\n }\n else {\n return observe(this);\n }\n }\n}\n\nexport { NativeAnimation };\n//# sourceMappingURL=NativeAnimation.mjs.map\n","import { supportsLinearEasing } from '../../../utils/supports/linear-easing.mjs';\nimport { isGenerator } from '../../generators/utils/is-generator.mjs';\n\nfunction applyGeneratorOptions({ type, ...options }) {\n if (isGenerator(type) && supportsLinearEasing()) {\n return type.applyToOptions(options);\n }\n else {\n options.duration ?? (options.duration = 300);\n options.ease ?? (options.ease = \"easeOut\");\n }\n return options;\n}\n\nexport { applyGeneratorOptions };\n//# sourceMappingURL=apply-generator.mjs.map\n","function isGenerator(type) {\n return typeof type === \"function\" && \"applyToOptions\" in type;\n}\n\nexport { isGenerator };\n//# sourceMappingURL=is-generator.mjs.map\n","import { mapEasingToNativeEasing } from './easing/map-easing.mjs';\n\nfunction startWaapiAnimation(element, valueName, keyframes, { delay = 0, duration = 300, repeat = 0, repeatType = \"loop\", ease = \"easeOut\", times, } = {}, pseudoElement = undefined) {\n const keyframeOptions = {\n [valueName]: keyframes,\n };\n if (times)\n keyframeOptions.offset = times;\n const easing = mapEasingToNativeEasing(ease, duration);\n /**\n * If this is an easing array, apply to keyframes, not animation as a whole\n */\n if (Array.isArray(easing))\n keyframeOptions.easing = easing;\n const options = {\n delay,\n duration,\n easing: !Array.isArray(easing) ? easing : \"linear\",\n fill: \"both\",\n iterations: repeat + 1,\n direction: repeatType === \"reverse\" ? \"alternate\" : \"normal\",\n };\n if (pseudoElement)\n options.pseudoElement = pseudoElement;\n return element.animate(keyframeOptions, options);\n}\n\nexport { startWaapiAnimation };\n//# sourceMappingURL=start-waapi-animation.mjs.map\n","import { isCSSVar } from './is-css-var.mjs';\n\nfunction setStyle(element, name, value) {\n isCSSVar(name)\n ? element.style.setProperty(name, value)\n : (element.style[name] = value);\n}\n\nexport { setStyle };\n//# sourceMappingURL=style-set.mjs.map\n","class GroupAnimation {\n constructor(animations) {\n // Bound to accomadate common `return animation.stop` pattern\n this.stop = () => this.runAll(\"stop\");\n this.animations = animations.filter(Boolean);\n }\n get finished() {\n return Promise.all(this.animations.map((animation) => animation.finished));\n }\n /**\n * TODO: Filter out cancelled or stopped animations before returning\n */\n getAll(propName) {\n return this.animations[0][propName];\n }\n setAll(propName, newValue) {\n for (let i = 0; i < this.animations.length; i++) {\n this.animations[i][propName] = newValue;\n }\n }\n attachTimeline(timeline) {\n const subscriptions = this.animations.map((animation) => animation.attachTimeline(timeline));\n return () => {\n subscriptions.forEach((cancel, i) => {\n cancel && cancel();\n this.animations[i].stop();\n });\n };\n }\n get time() {\n return this.getAll(\"time\");\n }\n set time(time) {\n this.setAll(\"time\", time);\n }\n get speed() {\n return this.getAll(\"speed\");\n }\n set speed(speed) {\n this.setAll(\"speed\", speed);\n }\n get state() {\n return this.getAll(\"state\");\n }\n get startTime() {\n return this.getAll(\"startTime\");\n }\n get duration() {\n return getMax(this.animations, \"duration\");\n }\n get iterationDuration() {\n return getMax(this.animations, \"iterationDuration\");\n }\n runAll(methodName) {\n this.animations.forEach((controls) => controls[methodName]());\n }\n play() {\n this.runAll(\"play\");\n }\n pause() {\n this.runAll(\"pause\");\n }\n cancel() {\n this.runAll(\"cancel\");\n }\n complete() {\n this.runAll(\"complete\");\n }\n}\nfunction getMax(animations, propName) {\n let max = 0;\n for (let i = 0; i < animations.length; i++) {\n const value = animations[i][propName];\n if (value !== null && value > max) {\n max = value;\n }\n }\n return max;\n}\n\nexport { GroupAnimation };\n//# sourceMappingURL=GroupAnimation.mjs.map\n","import { GroupAnimation } from './GroupAnimation.mjs';\n\nclass GroupAnimationWithThen extends GroupAnimation {\n then(onResolve, _onReject) {\n return this.finished.finally(onResolve).then(() => { });\n }\n}\n\nexport { GroupAnimationWithThen };\n//# sourceMappingURL=GroupAnimationWithThen.mjs.map\n","const animationMaps = new WeakMap();\nconst animationMapKey = (name, pseudoElement = \"\") => `${name}:${pseudoElement}`;\nfunction getAnimationMap(element) {\n let map = animationMaps.get(element);\n if (!map) {\n map = new Map();\n animationMaps.set(element, map);\n }\n return map;\n}\n\nexport { animationMapKey, getAnimationMap };\n//# sourceMappingURL=active-animations.mjs.map\n","import { resolveTransition } from './resolve-transition.mjs';\n\nfunction getValueTransition(transition, key) {\n const valueTransition = transition?.[key] ??\n transition?.[\"default\"] ??\n transition;\n if (valueTransition !== transition) {\n return resolveTransition(valueTransition, transition);\n }\n return valueTransition;\n}\n\nexport { getValueTransition };\n//# sourceMappingURL=get-value-transition.mjs.map\n","/**\n * If `transition` has `inherit: true`, shallow-merge it with\n * `parentTransition` (child keys win) and strip the `inherit` key.\n * Otherwise return `transition` unchanged.\n */\nfunction resolveTransition(transition, parentTransition) {\n if (transition?.inherit && parentTransition) {\n const { inherit: _, ...rest } = transition;\n return { ...parentTransition, ...rest };\n }\n return transition;\n}\n\nexport { resolveTransition };\n//# sourceMappingURL=resolve-transition.mjs.map\n","/**\n * The four corner-radius longhands. Shared so the projection mixer, scale\n * corrector, WAAPI px-value set and view-transition crop pass don't each carry\n * their own copy. Order is irrelevant - every consumer mixes/corrects/animates\n * each corner independently.\n */\nconst cornerRadiusProps = [\n \"borderTopLeftRadius\",\n \"borderTopRightRadius\",\n \"borderBottomRightRadius\",\n \"borderBottomLeftRadius\",\n];\n\nexport { cornerRadiusProps };\n//# sourceMappingURL=border-radius.mjs.map\n","import { cornerRadiusProps } from '../../../utils/border-radius.mjs';\n\nconst pxValues = new Set([\n // Border props\n \"borderWidth\",\n \"borderTopWidth\",\n \"borderRightWidth\",\n \"borderBottomWidth\",\n \"borderLeftWidth\",\n \"borderRadius\",\n ...cornerRadiusProps,\n // Positioning props\n \"width\",\n \"maxWidth\",\n \"height\",\n \"maxHeight\",\n \"top\",\n \"right\",\n \"bottom\",\n \"left\",\n \"inset\",\n \"insetBlock\",\n \"insetBlockStart\",\n \"insetBlockEnd\",\n \"insetInline\",\n \"insetInlineStart\",\n \"insetInlineEnd\",\n // Spacing props\n \"padding\",\n \"paddingTop\",\n \"paddingRight\",\n \"paddingBottom\",\n \"paddingLeft\",\n \"paddingBlock\",\n \"paddingBlockStart\",\n \"paddingBlockEnd\",\n \"paddingInline\",\n \"paddingInlineStart\",\n \"paddingInlineEnd\",\n \"margin\",\n \"marginTop\",\n \"marginRight\",\n \"marginBottom\",\n \"marginLeft\",\n \"marginBlock\",\n \"marginBlockStart\",\n \"marginBlockEnd\",\n \"marginInline\",\n \"marginInlineStart\",\n \"marginInlineEnd\",\n // Typography\n \"fontSize\",\n // Misc\n \"backgroundPositionX\",\n \"backgroundPositionY\",\n]);\n\nexport { pxValues };\n//# sourceMappingURL=px-values.mjs.map\n","import { pxValues } from '../../waapi/utils/px-values.mjs';\n\nfunction applyPxDefaults(keyframes, name) {\n for (let i = 0; i < keyframes.length; i++) {\n if (typeof keyframes[i] === \"number\" && pxValues.has(name)) {\n keyframes[i] = keyframes[i] + \"px\";\n }\n }\n}\n\nexport { applyPxDefaults };\n//# sourceMappingURL=apply-px-defaults.mjs.map\n","import { isCSSVar } from './is-css-var.mjs';\n\nfunction getComputedStyle(element, name) {\n const computedStyle = window.getComputedStyle(element);\n return isCSSVar(name)\n ? computedStyle.getPropertyValue(name)\n : computedStyle[name];\n}\n\nexport { getComputedStyle };\n//# sourceMappingURL=style-computed.mjs.map\n","import { animationMapKey, applyPxDefaults, fillWildcards, getAnimationMap, getComputedStyle, getValueTransition, NativeAnimation, resolveElements, } from \"motion-dom\";\nimport { invariant, secondsToMilliseconds } from \"motion-utils\";\nexport function animateElements(elementOrSelector, keyframes, options, scope) {\n // Gracefully handle null/undefined elements (e.g., from querySelector returning null)\n if (elementOrSelector == null) {\n return [];\n }\n const elements = resolveElements(elementOrSelector, scope);\n const numElements = elements.length;\n invariant(Boolean(numElements), \"No valid elements provided.\", \"no-valid-elements\");\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 = [];\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 = { ...options };\n /**\n * Resolve stagger function if provided.\n */\n if (typeof elementTransition.delay === \"function\") {\n elementTransition.delay = elementTransition.delay(i, numElements);\n }\n for (const valueName in keyframes) {\n let valueKeyframes = keyframes[valueName];\n if (!Array.isArray(valueKeyframes)) {\n valueKeyframes = [valueKeyframes];\n }\n const valueOptions = {\n ...getValueTransition(elementTransition, valueName),\n };\n valueOptions.duration && (valueOptions.duration = secondsToMilliseconds(valueOptions.duration));\n valueOptions.delay && (valueOptions.delay = secondsToMilliseconds(valueOptions.delay));\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(valueName, valueOptions.pseudoElement || \"\");\n const currentAnimation = map.get(key);\n currentAnimation && currentAnimation.stop();\n animationDefinitions.push({\n map,\n key,\n unresolvedKeyframes: valueKeyframes,\n options: {\n ...valueOptions,\n element,\n name: valueName,\n allowFlatten: !elementTransition.type && !elementTransition.ease,\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 } = animationDefinitions[i];\n const { element, name, pseudoElement } = animationOptions;\n if (!pseudoElement && unresolvedKeyframes[0] === null) {\n unresolvedKeyframes[0] = getComputedStyle(element, name);\n }\n fillWildcards(unresolvedKeyframes);\n applyPxDefaults(unresolvedKeyframes, name);\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 animationOptions.keyframes = unresolvedKeyframes;\n }\n /**\n * Step 3: Create new animations (write)\n */\n const animations = [];\n for (let i = 0; i < animationDefinitions.length; i++) {\n const { map, key, options: animationOptions } = animationDefinitions[i];\n const animation = new NativeAnimation(animationOptions);\n map.set(key, animation);\n animation.finished.finally(() => map.delete(key));\n animations.push(animation);\n }\n return animations;\n}\n//# sourceMappingURL=animate-elements.js.map","function resolveElements(elementOrSelector, scope, selectorCache) {\n if (elementOrSelector == null) {\n return [];\n }\n if (elementOrSelector instanceof EventTarget) {\n return [elementOrSelector];\n }\n else if (typeof elementOrSelector === \"string\") {\n let root = document;\n if (scope) {\n root = scope.current;\n }\n const elements = selectorCache?.[elementOrSelector] ??\n root.querySelectorAll(elementOrSelector);\n return elements ? Array.from(elements) : [];\n }\n return Array.from(elementOrSelector).filter((element) => element != null);\n}\n\nexport { resolveElements };\n//# sourceMappingURL=resolve-elements.mjs.map\n","import { GroupAnimationWithThen, } from \"motion-dom\";\nimport { animateElements } from \"./animate-elements\";\nexport const createScopedWaapiAnimate = (scope) => {\n function scopedAnimate(elementOrSelector, keyframes, options) {\n return new GroupAnimationWithThen(animateElements(elementOrSelector, keyframes, options, scope));\n }\n return scopedAnimate;\n};\nexport const animateMini = /*@__PURE__*/ createScopedWaapiAnimate();\n//# sourceMappingURL=animate-style.js.map"],"names":["invariant","process","env","NODE_ENV","check","message","errorCode","Error","formatErrorMessage","noop","any","secondsToMilliseconds","seconds","millisecondsToSeconds","milliseconds","isNotNull","value","WithPromise","constructor","this","updateFinished","finished","_finished","Promise","resolve","notifyFinished","then","onResolve","onReject","fillWildcards","keyframes","i","length","isCSSVar","name","startsWith","supportsFlags","memoSupports","callback","supportsFlag","memoized","result","undefined","memo","supportsScrollTimeline","window","ScrollTimeline","supportsLinearEasing","document","createElement","animate","opacity","easing","e","cubicBezierAsString","a","b","c","d","supportedWaapiEasing","linear","ease","easeIn","easeOut","easeInOut","circIn","circOut","backIn","backOut","mapEasingToNativeEasing","duration","resolution","points","numPoints","Math","max","round","substring","generateLinearEasing","Array","isArray","isBezierDefinition","map","segmentEasing","NativeAnimation","options","super","finishedTime","isStopped","manualStartTime","element","pseudoElement","allowFlatten","finalKeyframe","onComplete","isPseudoElement","Boolean","type","transition","isGenerator","applyToOptions","applyGeneratorOptions","animation","valueName","delay","repeat","repeatType","times","keyframeOptions","offset","fill","iterations","direction","startWaapiAnimation","autoplay","pause","onfinish","time","keyframe","speed","resolvedKeyframes","filter","index","getFinalKeyframe","updateMotionValue","style","setProperty","setStyle","cancel","play","state","complete","finish","stop","commitStyles","isConnected","effect","getComputedTiming","Number","iterationDuration","currentTime","newTime","wasFinished","playbackRate","newSpeed","playState","startTime","newStartTime","attachTimeline","timeline","rangeStart","rangeEnd","observe","updateTiming","GroupAnimation","animations","runAll","all","getAll","propName","setAll","newValue","subscriptions","forEach","getMax","methodName","controls","GroupAnimationWithThen","_onReject","finally","animationMaps","WeakMap","animationMapKey","getAnimationMap","get","Map","set","getValueTransition","key","valueTransition","parentTransition","inherit","_","rest","resolveTransition","pxValues","Set","applyPxDefaults","has","getComputedStyle","computedStyle","getPropertyValue","animateElements","elementOrSelector","scope","elements","EventTarget","root","current","querySelectorAll","from","resolveElements","numElements","animationDefinitions","elementTransition","valueKeyframes","valueOptions","currentAnimation","push","unresolvedKeyframes","animationOptions","unshift","delete","createScopedWaapiAnimate","animateMini"],"mappings":"AAGA,IAAIA,EAAY,OACO,oBAAZC,SACmB,eAA1BA,QAAQC,KAAKC,WAMbH,EAAY,CAACI,EAAOC,EAASC,KACzB,IAAKF,EACD,MAAM,IAAIG,MCbtB,SAA4BF,EAASC,GACjC,OAAOA,EACD,GAAGD,2FAAiGC,IACpGD,CACV,CDS4BG,CAAmBH,EAASC,MEZxD,MAAMG,EAAQC,GAAQA,ECMhBC,EAAyBC,GAAsB,IAAVA,EAErCC,EAAyBC,GAAiBA,E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,QAAS6H,GAAqBP,EAAqB5K,IAC1E2D,QAAEA,EAAOxD,KAAEA,EAAIyD,cAAEA,GAAkBuH,EACpCvH,GAA4C,OAA3BsH,EAAoB,KACtCA,EAAoB,GAAKpB,EAAiBnG,EAASxD,IAEvDL,EAAcoL,GACdtB,EAAgBsB,EAAqB/K,IAOhCyD,GAAiBsH,EAAoBjL,OAAS,GAC/CiL,EAAoBE,QAAQtB,EAAiBnG,EAASxD,IAE1DgL,EAAiBpL,UAAYmL,CACjC,CAIA,MAAMtD,EAAa,GACnB,IAAK,IAAI5H,EAAI,EAAGA,EAAI4K,EAAqB3K,OAAQD,IAAK,CAClD,MAAMmD,IAAEA,EAAGgG,IAAEA,EAAK7F,QAAS6H,GAAqBP,EAAqB5K,GAC/DuE,EAAY,IAAIlB,EAAgB8H,GACtChI,EAAI8F,IAAIE,EAAK5E,GACbA,EAAUjF,SAASoJ,QAAQ,IAAMvF,EAAIkI,OAAOlC,IAC5CvB,EAAWqD,KAAK1G,EACpB,CACA,OAAOqD,CACX,CEvGY,MAAC0D,EAA4BnB,GACrC,SAAuBD,EAAmBnK,EAAWuD,GACjD,OAAO,IAAIkF,EAAuByB,EAAgBC,EAAmBnK,EAAWuD,EAAS6G,GAC7F,EAGSoB,EAA4BD"} \ No newline at end of file diff --git a/node_modules/framer-motion/dom/README.md b/node_modules/framer-motion/dom/README.md deleted file mode 100644 index 9f4c437..0000000 --- a/node_modules/framer-motion/dom/README.md +++ /dev/null @@ -1 +0,0 @@ -This directory is a fallback for `exports["./dom"]` in the root `framer-motion` `package.json`. diff --git a/node_modules/framer-motion/dom/mini/package.json b/node_modules/framer-motion/dom/mini/package.json deleted file mode 100644 index 6d6ee8d..0000000 --- a/node_modules/framer-motion/dom/mini/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "private": true, - "types": "../../dist/dom-mini.d.ts", - "main": "../../dist/cjs/dom-mini.js", - "module": "../../dist/es/dom-mini.mjs" -} diff --git a/node_modules/framer-motion/dom/package.json b/node_modules/framer-motion/dom/package.json deleted file mode 100644 index c08f91c..0000000 --- a/node_modules/framer-motion/dom/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "private": true, - "types": "../dist/dom.d.ts", - "main": "../dist/cjs/dom.js", - "module": "../dist/es/dom.mjs" -} diff --git a/node_modules/framer-motion/m/package.json b/node_modules/framer-motion/m/package.json deleted file mode 100644 index 5e76408..0000000 --- a/node_modules/framer-motion/m/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "private": true, - "types": "../dist/m.d.ts", - "main": "../dist/cjs/m.js", - "module": "../dist/es/m.mjs" -} diff --git a/node_modules/framer-motion/mini/package.json b/node_modules/framer-motion/mini/package.json deleted file mode 100644 index 1ed4407..0000000 --- a/node_modules/framer-motion/mini/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "private": true, - "types": "../dist/mini.d.ts", - "main": "../dist/cjs/mini.js", - "module": "../dist/es/mini.mjs" -} diff --git a/node_modules/framer-motion/package.json b/node_modules/framer-motion/package.json deleted file mode 100644 index 5826e56..0000000 --- a/node_modules/framer-motion/package.json +++ /dev/null @@ -1,144 +0,0 @@ -{ - "name": "framer-motion", - "version": "13.1.0", - "description": "A simple and powerful JavaScript animation library", - "main": "dist/cjs/index.js", - "module": "dist/es/index.mjs", - "exports": { - ".": { - "types": "./dist/index.d.ts", - "require": "./dist/cjs/index.js", - "import": "./dist/es/index.mjs", - "default": "./dist/cjs/index.js" - }, - "./debug": { - "types": "./dist/debug.d.ts", - "require": "./dist/cjs/debug.js", - "import": "./dist/es/debug.mjs", - "default": "./dist/cjs/debug.js" - }, - "./dom/mini": { - "types": "./dist/dom-mini.d.ts", - "require": "./dist/cjs/dom-mini.js", - "import": "./dist/es/dom-mini.mjs", - "default": "./dist/cjs/dom-mini.js" - }, - "./dom": { - "types": "./dist/dom.d.ts", - "require": "./dist/cjs/dom.js", - "import": "./dist/es/dom.mjs", - "default": "./dist/cjs/dom.js" - }, - "./client": { - "types": "./dist/client.d.ts", - "require": "./dist/cjs/client.js", - "import": "./dist/es/client.mjs", - "default": "./dist/cjs/client.js" - }, - "./m": { - "types": "./dist/m.d.ts", - "require": "./dist/cjs/m.js", - "import": "./dist/es/m.mjs", - "default": "./dist/cjs/m.js" - }, - "./mini": { - "types": "./dist/mini.d.ts", - "require": "./dist/cjs/mini.js", - "import": "./dist/es/mini.mjs", - "default": "./dist/cjs/mini.js" - }, - "./projection": { - "types": "./dist/projection.d.ts", - "import": "./dist/es/projection.mjs", - "default": "./dist/es/projection.mjs" - }, - "./package.json": "./package.json" - }, - "types": "dist/index.d.ts", - "author": "Matt Perry", - "license": "MIT", - "repository": "https://github.com/motiondivision/motion/", - "sideEffects": false, - "keywords": [ - "react animation", - "react", - "pose", - "react pose", - "animation", - "gestures", - "drag", - "spring", - "popmotion", - "framer", - "waapi" - ], - "scripts": { - "eslint": "yarn run lint", - "lint": "yarn eslint src/**/*.ts", - "build": "yarn clean && tsc --noEmitOnError -p . && rollup -c && node ./scripts/check-bundle.js", - "dev": "yarn watch", - "clean": "rm -rf types dist lib", - "test": "yarn test-server && yarn test-client", - "test-client": "jest --config jest.config.json --max-workers=2", - "test-server": "jest --config jest.config.ssr.json", - "prettier": "prettier ./src/* --write", - "watch": "concurrently -c blue,red -n tsc --noEmitOnError ,rollup --kill-others \"tsc --noEmitOnError --watch -p . --preserveWatchOutput\" \"rollup --config --watch --no-watch.clearScreen\"", - "prepack": "yarn build && yarn measure", - "postpublish": "git push --tags", - "measure": "rollup -c ./rollup.size.config.mjs" - }, - "dependencies": { - "motion-dom": "^13.0.0", - "motion-utils": "^13.0.0", - "tslib": "^2.4.0" - }, - "devDependencies": { - "@radix-ui/react-dialog": "^1.1.15", - "@thednp/dommatrix": "^2.0.11", - "@types/three": "0.137.0", - "three": "0.137.0" - }, - "peerDependencies": { - "react": "^18.0.0 || ^19.0.0", - "react-dom": "^18.0.0 || ^19.0.0" - }, - "peerDependenciesMeta": { - "react": { - "optional": true - }, - "react-dom": { - "optional": true - } - }, - "bundlesize": [ - { - "path": "./dist/size-rollup-motion.js", - "maxSize": "34.9 kB" - }, - { - "path": "./dist/size-rollup-m.js", - "maxSize": "6 kB" - }, - { - "path": "./dist/size-rollup-dom-animation.js", - "maxSize": "17.85 kB" - }, - { - "path": "./dist/size-rollup-dom-max.js", - "maxSize": "29.8 kB" - }, - { - "path": "./dist/size-rollup-animate.js", - "maxSize": "19.1 kB" - }, - { - "path": "./dist/size-rollup-scroll.js", - "maxSize": "5.2 kB" - }, - { - "path": "./dist/size-rollup-waapi-animate.js", - "maxSize": "2.26 kB" - } - ], - "gitHead": "adaf7a4e5368d704ea350669f6ac674fb26ff270" -} diff --git a/node_modules/motion-dom/LICENSE.md b/node_modules/motion-dom/LICENSE.md deleted file mode 100644 index 8111044..0000000 --- a/node_modules/motion-dom/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2024 [Motion](https://motion.dev) B.V. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/motion-dom/dist/cjs/index.js b/node_modules/motion-dom/dist/cjs/index.js deleted file mode 100644 index 8fe6b5b..0000000 --- a/node_modules/motion-dom/dist/cjs/index.js +++ /dev/null @@ -1,11036 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { value: true }); - -var motionUtils = require('motion-utils'); - -const stepsOrder = [ - "setup", // Compute - "read", // Read - "resolveKeyframes", // Write/Read/Write/Read - "preUpdate", // Compute - "update", // Compute - "preRender", // Compute - "render", // Write - "postRender", // Compute -]; - -function createRenderStep(runNextFrame) { - /** - * We create and reuse two queues, one to queue jobs for the current frame - * and one for the next. We reuse to avoid triggering GC after x frames. - */ - let thisFrame = new Set(); - let nextFrame = new Set(); - /** - * Track whether we're currently processing jobs in this step. This way - * we can decide whether to schedule new jobs for this frame or next. - */ - let isProcessing = false; - let flushNextFrame = false; - /** - * A set of processes which were marked keepAlive when scheduled. - */ - const toKeepAlive = new WeakSet(); - let latestFrameData = { - delta: 0.0, - timestamp: 0.0, - isProcessing: false, - }; - function triggerCallback(callback) { - if (toKeepAlive.has(callback)) { - step.schedule(callback); - runNextFrame(); - } - callback(latestFrameData); - } - const step = { - /** - * Schedule a process to run on the next frame. - */ - schedule: (callback, keepAlive = false, immediate = false) => { - const addToCurrentFrame = immediate && isProcessing; - const queue = addToCurrentFrame ? thisFrame : nextFrame; - if (keepAlive) - toKeepAlive.add(callback); - queue.add(callback); - return callback; - }, - /** - * Cancel the provided callback from running on the next frame. - */ - cancel: (callback) => { - nextFrame.delete(callback); - toKeepAlive.delete(callback); - }, - /** - * Execute all schedule callbacks. - */ - process: (frameData) => { - latestFrameData = frameData; - /** - * If we're already processing we've probably been triggered by a flushSync - * inside an existing process. Instead of executing, mark flushNextFrame - * as true and ensure we flush the following frame at the end of this one. - */ - if (isProcessing) { - flushNextFrame = true; - return; - } - isProcessing = true; - // Swap this frame and the next to avoid GC - const prevFrame = thisFrame; - thisFrame = nextFrame; - nextFrame = prevFrame; - // Execute this frame - thisFrame.forEach(triggerCallback); - // Clear the frame so no callbacks remain. This is to avoid - // memory leaks should this render step not run for a while. - thisFrame.clear(); - isProcessing = false; - if (flushNextFrame) { - flushNextFrame = false; - step.process(frameData); - } - }, - }; - return step; -} - -const maxElapsed = 40; -function createRenderBatcher(scheduleNextBatch, allowKeepAlive) { - let runNextFrame = false; - let useDefaultElapsed = true; - const state = { - delta: 0.0, - timestamp: 0.0, - isProcessing: false, - }; - const flagRunNextFrame = () => (runNextFrame = true); - const steps = stepsOrder.reduce((acc, key) => { - acc[key] = createRenderStep(flagRunNextFrame); - return acc; - }, {}); - const { setup, read, resolveKeyframes, preUpdate, update, preRender, render, postRender, } = steps; - const processBatch = () => { - const useManualTiming = motionUtils.MotionGlobalConfig.useManualTiming; - const timestamp = useManualTiming - ? state.timestamp - : performance.now(); - runNextFrame = false; - if (!useManualTiming) { - state.delta = useDefaultElapsed - ? 1000 / 60 - : Math.max(Math.min(timestamp - state.timestamp, maxElapsed), 1); - } - state.timestamp = timestamp; - state.isProcessing = true; - // Unrolled render loop for better per-frame performance - setup.process(state); - read.process(state); - resolveKeyframes.process(state); - preUpdate.process(state); - update.process(state); - preRender.process(state); - render.process(state); - postRender.process(state); - state.isProcessing = false; - if (runNextFrame && allowKeepAlive) { - useDefaultElapsed = false; - scheduleNextBatch(processBatch); - } - }; - const wake = () => { - runNextFrame = true; - useDefaultElapsed = true; - if (!state.isProcessing) { - scheduleNextBatch(processBatch); - } - }; - const schedule = stepsOrder.reduce((acc, key) => { - const step = steps[key]; - acc[key] = (process, keepAlive = false, immediate = false) => { - if (!runNextFrame) - wake(); - return step.schedule(process, keepAlive, immediate); - }; - return acc; - }, {}); - const cancel = (process) => { - for (let i = 0; i < stepsOrder.length; i++) { - steps[stepsOrder[i]].cancel(process); - } - }; - return { schedule, cancel, state, steps }; -} - -const { schedule: frame, cancel: cancelFrame, state: frameData, steps: frameSteps, } = /* @__PURE__ */ createRenderBatcher(typeof requestAnimationFrame !== "undefined" ? requestAnimationFrame : motionUtils.noop, true); - -let now; -function clearTime() { - now = undefined; -} -/** - * An eventloop-synchronous alternative to performance.now(). - * - * Ensures that time measurements remain consistent within a synchronous context. - * Usually calling performance.now() twice within the same synchronous context - * will return different values which isn't useful for animations when we're usually - * trying to sync animations to the same frame. - */ -const time = { - now: () => { - if (now === undefined) { - time.set(frameData.isProcessing || motionUtils.MotionGlobalConfig.useManualTiming - ? frameData.timestamp - : performance.now()); - } - return now; - }, - set: (newTime) => { - now = newTime; - queueMicrotask(clearTime); - }, -}; - -const checkStringStartsWith = (token) => (key) => typeof key === "string" && key.startsWith(token); -const isCSSVariableName = -/*@__PURE__*/ checkStringStartsWith("--"); -const startsAsVariableToken = -/*@__PURE__*/ checkStringStartsWith("var(--"); -const isCSSVariableToken = (value) => { - const startsWithToken = startsAsVariableToken(value); - if (!startsWithToken) - return false; - // Ensure any comments are stripped from the value as this can harm performance of the regex. - return singleCssVariableRegex.test(value.split("/*")[0].trim()); -}; -const singleCssVariableRegex = /var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu; -/** - * Check if a value contains a CSS variable anywhere (e.g. inside calc()). - * Unlike isCSSVariableToken which checks if the value IS a var() token, - * this checks if the value CONTAINS var() somewhere in the string. - */ -function containsCSSVariable(value) { - if (typeof value !== "string") - return false; - // Strip comments to avoid false positives - return value.split("/*")[0].includes("var(--"); -} - -const number = { - test: (v) => typeof v === "number", - parse: parseFloat, - transform: (v) => v, -}; -const alpha = { - ...number, - transform: (v) => motionUtils.clamp(0, 1, v), -}; -const scale = { - ...number, - default: 1, -}; - -// If this number is a decimal, make it just five decimal places -// to avoid exponents -const sanitize = (v) => Math.round(v * 100000) / 100000; - -const floatRegex = /-?(?:\d+(?:\.\d+)?|\.\d+)/gu; - -function isNullish(v) { - return v == null; -} - -const singleColorRegex = /^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu; - -/** - * Returns true if the provided string is a color, ie rgba(0,0,0,0) or #000, - * but false if a number or multiple colors - */ -const isColorString = (type, testProp) => (v) => { - return Boolean((typeof v === "string" && - singleColorRegex.test(v) && - v.startsWith(type)) || - (testProp && - !isNullish(v) && - Object.prototype.hasOwnProperty.call(v, testProp))); -}; -const splitColor = (aName, bName, cName) => (v) => { - if (typeof v !== "string") - return v; - const [a, b, c, alpha] = v.match(floatRegex); - return { - [aName]: parseFloat(a), - [bName]: parseFloat(b), - [cName]: parseFloat(c), - alpha: alpha !== undefined ? parseFloat(alpha) : 1, - }; -}; - -const clampRgbUnit = (v) => motionUtils.clamp(0, 255, v); -const rgbUnit = { - ...number, - transform: (v) => Math.round(clampRgbUnit(v)), -}; -const rgba = { - test: /*@__PURE__*/ isColorString("rgb", "red"), - parse: /*@__PURE__*/ splitColor("red", "green", "blue"), - transform: ({ red, green, blue, alpha: alpha$1 = 1 }) => "rgba(" + - rgbUnit.transform(red) + - ", " + - rgbUnit.transform(green) + - ", " + - rgbUnit.transform(blue) + - ", " + - sanitize(alpha.transform(alpha$1)) + - ")", -}; - -function parseHex(v) { - let r = ""; - let g = ""; - let b = ""; - let a = ""; - // If we have 6 characters, ie #FF0000 - if (v.length > 5) { - r = v.substring(1, 3); - g = v.substring(3, 5); - b = v.substring(5, 7); - a = v.substring(7, 9); - // Or we have 3 characters, ie #F00 - } - else { - r = v.substring(1, 2); - g = v.substring(2, 3); - b = v.substring(3, 4); - a = v.substring(4, 5); - r += r; - g += g; - b += b; - a += a; - } - return { - red: parseInt(r, 16), - green: parseInt(g, 16), - blue: parseInt(b, 16), - alpha: a ? parseInt(a, 16) / 255 : 1, - }; -} -const hex = { - test: /*@__PURE__*/ isColorString("#"), - parse: parseHex, - transform: rgba.transform, -}; - -/*#__NO_SIDE_EFFECTS__*/ -const createUnitType = (unit) => ({ - test: (v) => typeof v === "string" && v.endsWith(unit) && v.split(" ").length === 1, - parse: parseFloat, - transform: (v) => `${v}${unit}`, -}); -const degrees = /*@__PURE__*/ createUnitType("deg"); -const percent = /*@__PURE__*/ createUnitType("%"); -const px = /*@__PURE__*/ createUnitType("px"); -const vh = /*@__PURE__*/ createUnitType("vh"); -const vw = /*@__PURE__*/ createUnitType("vw"); -const progressPercentage = /*@__PURE__*/ (() => ({ - ...percent, - parse: (v) => percent.parse(v) / 100, - transform: (v) => percent.transform(v * 100), -}))(); - -const hsla = { - test: /*@__PURE__*/ isColorString("hsl", "hue"), - parse: /*@__PURE__*/ splitColor("hue", "saturation", "lightness"), - transform: ({ hue, saturation, lightness, alpha: alpha$1 = 1 }) => { - return ("hsla(" + - Math.round(hue) + - ", " + - percent.transform(sanitize(saturation)) + - ", " + - percent.transform(sanitize(lightness)) + - ", " + - sanitize(alpha.transform(alpha$1)) + - ")"); - }, -}; - -const color = { - test: (v) => rgba.test(v) || hex.test(v) || hsla.test(v), - parse: (v) => { - if (rgba.test(v)) { - return rgba.parse(v); - } - else if (hsla.test(v)) { - return hsla.parse(v); - } - else { - return hex.parse(v); - } - }, - transform: (v) => { - return typeof v === "string" - ? v - : v.hasOwnProperty("red") - ? rgba.transform(v) - : hsla.transform(v); - }, - getAnimatableNone: (v) => { - const parsed = color.parse(v); - parsed.alpha = 0; - return color.transform(parsed); - }, -}; - -const colorRegex = /(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu; - -function test(v) { - return (isNaN(v) && - typeof v === "string" && - (v.match(floatRegex)?.length || 0) + - (v.match(colorRegex)?.length || 0) > - 0); -} -const NUMBER_TOKEN = "number"; -const COLOR_TOKEN = "color"; -const VAR_TOKEN = "var"; -const VAR_FUNCTION_TOKEN = "var("; -const SPLIT_TOKEN = "${}"; -// this regex consists of the `singleCssVariableRegex|rgbHSLValueRegex|digitRegex` -const complexRegex = /var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu; -function analyseComplexValue(value) { - const originalValue = value.toString(); - const values = []; - const indexes = { - color: [], - number: [], - var: [], - }; - const types = []; - let i = 0; - const tokenised = originalValue.replace(complexRegex, (parsedValue) => { - if (color.test(parsedValue)) { - indexes.color.push(i); - types.push(COLOR_TOKEN); - values.push(color.parse(parsedValue)); - } - else if (parsedValue.startsWith(VAR_FUNCTION_TOKEN)) { - indexes.var.push(i); - types.push(VAR_TOKEN); - values.push(parsedValue); - } - else { - indexes.number.push(i); - types.push(NUMBER_TOKEN); - values.push(parseFloat(parsedValue)); - } - ++i; - return SPLIT_TOKEN; - }); - const split = tokenised.split(SPLIT_TOKEN); - return { values, split, indexes, types }; -} -function parseComplexValue(v) { - return analyseComplexValue(v).values; -} -function buildTransformer({ split, types }) { - const numSections = split.length; - return (v) => { - let output = ""; - for (let i = 0; i < numSections; i++) { - output += split[i]; - if (v[i] !== undefined) { - const type = types[i]; - if (type === NUMBER_TOKEN) { - output += sanitize(v[i]); - } - else if (type === COLOR_TOKEN) { - output += color.transform(v[i]); - } - else { - output += v[i]; - } - } - } - return output; - }; -} -function createTransformer(source) { - return buildTransformer(analyseComplexValue(source)); -} -const convertNumbersToZero = (v) => typeof v === "number" ? 0 : color.test(v) ? color.getAnimatableNone(v) : v; -/** - * Convert a parsed value to its zero equivalent, but preserve numbers - * that act as divisors in CSS calc() expressions. - * - * analyseComplexValue extracts numbers from CSS strings and puts the - * surrounding text into a `split` template array. For example: - * "calc(var(--gap) / 5)" → values: [var(--gap), 5] - * split: ["calc(", " / ", ")"] - * - * When building a zero-equivalent for animation, naively zeroing all - * numbers turns the divisor into 0 → "calc(var(--gap) / 0)" → NaN. - * We detect this by checking whether the text preceding a number - * (split[i]) ends with "/" — the CSS calc division operator. - */ -const convertToZero = (value, splitBefore) => { - if (typeof value === "number") { - return splitBefore?.trim().endsWith("/") ? value : 0; - } - return convertNumbersToZero(value); -}; -function getAnimatableNone$1(v) { - const info = analyseComplexValue(v); - const transformer = buildTransformer(info); - return transformer(info.values.map((value, i) => convertToZero(value, info.split[i]))); -} -const complex = { - test, - parse: parseComplexValue, - createTransformer, - getAnimatableNone: getAnimatableNone$1, -}; - -// Adapted from https://gist.github.com/mjackson/5311256 -function hueToRgb(p, q, t) { - if (t < 0) - t += 1; - if (t > 1) - t -= 1; - if (t < 1 / 6) - return p + (q - p) * 6 * t; - if (t < 1 / 2) - return q; - if (t < 2 / 3) - return p + (q - p) * (2 / 3 - t) * 6; - return p; -} -function hslaToRgba({ hue, saturation, lightness, alpha }) { - hue /= 360; - saturation /= 100; - lightness /= 100; - let red = 0; - let green = 0; - let blue = 0; - if (!saturation) { - red = green = blue = lightness; - } - else { - const q = lightness < 0.5 - ? lightness * (1 + saturation) - : lightness + saturation - lightness * saturation; - const p = 2 * lightness - q; - red = hueToRgb(p, q, hue + 1 / 3); - green = hueToRgb(p, q, hue); - blue = hueToRgb(p, q, hue - 1 / 3); - } - return { - red: Math.round(red * 255), - green: Math.round(green * 255), - blue: Math.round(blue * 255), - alpha, - }; -} - -function mixImmediate(a, b) { - return (p) => (p > 0 ? b : a); -} - -/* - Value in range from progress - - Given a lower limit and an upper limit, we return the value within - that range as expressed by progress (usually a number from 0 to 1) - - So progress = 0.5 would change - - from -------- to - - to - - from ---- to - - E.g. from = 10, to = 20, progress = 0.5 => 15 - - @param [number]: Lower limit of range - @param [number]: Upper limit of range - @param [number]: The progress between lower and upper limits expressed 0-1 - @return [number]: Value as calculated from progress within range (not limited within range) -*/ -const mixNumber$1 = (from, to, progress) => { - return from + (to - from) * progress; -}; - -// Linear color space blending -// Explained https://www.youtube.com/watch?v=LKnqECcg6Gw -// Demonstrated http://codepen.io/osublake/pen/xGVVaN -const mixLinearColor = (from, to, v) => { - const fromExpo = from * from; - const expo = v * (to * to - fromExpo) + fromExpo; - return expo < 0 ? 0 : Math.sqrt(expo); -}; -const colorTypes = [hex, rgba, hsla]; -const getColorType = (v) => colorTypes.find((type) => type.test(v)); -function asRGBA(color) { - const type = getColorType(color); - motionUtils.warning(Boolean(type), `'${color}' is not an animatable color. Use the equivalent color code instead.`, "color-not-animatable"); - if (!Boolean(type)) - return false; - let model = type.parse(color); - if (type === hsla) { - // TODO Remove this cast - needed since Motion's stricter typing - model = hslaToRgba(model); - } - return model; -} -const mixColor = (from, to) => { - const fromRGBA = asRGBA(from); - const toRGBA = asRGBA(to); - if (!fromRGBA || !toRGBA) { - return mixImmediate(from, to); - } - const blended = { ...fromRGBA }; - return (v) => { - blended.red = mixLinearColor(fromRGBA.red, toRGBA.red, v); - blended.green = mixLinearColor(fromRGBA.green, toRGBA.green, v); - blended.blue = mixLinearColor(fromRGBA.blue, toRGBA.blue, v); - blended.alpha = mixNumber$1(fromRGBA.alpha, toRGBA.alpha, v); - return rgba.transform(blended); - }; -}; - -const invisibleValues = new Set(["none", "hidden"]); -/** - * Returns a function that, when provided a progress value between 0 and 1, - * will return the "none" or "hidden" string only when the progress is that of - * the origin or target. - */ -function mixVisibility(origin, target) { - if (invisibleValues.has(origin)) { - return (p) => (p <= 0 ? origin : target); - } - else { - return (p) => (p >= 1 ? target : origin); - } -} - -function mixNumber(a, b) { - return (p) => mixNumber$1(a, b, p); -} -function getMixer(a) { - if (typeof a === "number") { - return mixNumber; - } - else if (typeof a === "string") { - return isCSSVariableToken(a) - ? mixImmediate - : color.test(a) - ? mixColor - : mixComplex; - } - else if (Array.isArray(a)) { - return mixArray; - } - else if (typeof a === "object") { - return color.test(a) ? mixColor : mixObject; - } - return mixImmediate; -} -function mixArray(a, b) { - const output = [...a]; - const numValues = output.length; - const blendValue = a.map((v, i) => getMixer(v)(v, b[i])); - return (p) => { - for (let i = 0; i < numValues; i++) { - output[i] = blendValue[i](p); - } - return output; - }; -} -function mixObject(a, b) { - const output = { ...a, ...b }; - const blendValue = {}; - for (const key in output) { - if (a[key] !== undefined && b[key] !== undefined) { - blendValue[key] = getMixer(a[key])(a[key], b[key]); - } - } - return (v) => { - for (const key in blendValue) { - output[key] = blendValue[key](v); - } - return output; - }; -} -function matchOrder(origin, target) { - const orderedOrigin = []; - const pointers = { color: 0, var: 0, number: 0 }; - for (let i = 0; i < target.values.length; i++) { - const type = target.types[i]; - const originIndex = origin.indexes[type][pointers[type]]; - const originValue = origin.values[originIndex] ?? 0; - orderedOrigin[i] = originValue; - pointers[type]++; - } - return orderedOrigin; -} -const mixComplex = (origin, target) => { - const template = complex.createTransformer(target); - const originStats = analyseComplexValue(origin); - const targetStats = analyseComplexValue(target); - const canInterpolate = originStats.indexes.var.length === targetStats.indexes.var.length && - originStats.indexes.color.length === targetStats.indexes.color.length && - originStats.indexes.number.length >= targetStats.indexes.number.length; - if (canInterpolate) { - if ((invisibleValues.has(origin) && - !targetStats.values.length) || - (invisibleValues.has(target) && - !originStats.values.length)) { - return mixVisibility(origin, target); - } - return motionUtils.pipe(mixArray(matchOrder(originStats, targetStats), targetStats.values), template); - } - else { - motionUtils.warning(true, `Complex values '${origin}' and '${target}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`, "complex-values-different"); - return mixImmediate(origin, target); - } -}; - -function mix(from, to, p) { - if (typeof from === "number" && - typeof to === "number" && - typeof p === "number") { - return mixNumber$1(from, to, p); - } - const mixer = getMixer(from); - return mixer(from, to); -} - -const frameloopDriver = (update) => { - const passTimestamp = ({ timestamp }) => update(timestamp); - return { - start: (keepAlive = true) => frame.update(passTimestamp, keepAlive), - stop: () => cancelFrame(passTimestamp), - /** - * If we're processing this frame we can use the - * framelocked timestamp to keep things in sync. - */ - now: () => (frameData.isProcessing ? frameData.timestamp : time.now()), - }; -}; - -const generateLinearEasing = (easing, duration, // as milliseconds -resolution = 10 // as milliseconds -) => { - let points = ""; - const numPoints = Math.max(Math.round(duration / resolution), 2); - for (let i = 0; i < numPoints; i++) { - points += Math.round(easing(i / (numPoints - 1)) * 10000) / 10000 + ", "; - } - return `linear(${points.substring(0, points.length - 2)})`; -}; - -/** - * Implement a practical max duration for keyframe generation - * to prevent infinite loops - */ -const maxGeneratorDuration = 20000; -function calcGeneratorDuration(generator) { - let duration = 0; - const timeStep = 50; - let state = generator.next(duration); - while (!state.done && duration < maxGeneratorDuration) { - duration += timeStep; - state = generator.next(duration); - } - return duration >= maxGeneratorDuration ? Infinity : duration; -} - -/** - * Create a progress => progress easing function from a generator. - */ -function createGeneratorEasing(options, scale = 100, createGenerator) { - const generator = createGenerator({ ...options, keyframes: [0, scale] }); - const duration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration); - return { - type: "keyframes", - ease: (progress) => { - return generator.next(duration * progress).value / scale; - }, - duration: motionUtils.millisecondsToSeconds(duration), - }; -} - -const springDefaults = { - // Default spring physics - stiffness: 100, - damping: 10, - mass: 1.0, - velocity: 0.0, - // Default duration/bounce-based options - duration: 800, // in ms - bounce: 0.3, - visualDuration: 0.3, // in seconds - // Rest thresholds - restSpeed: { - granular: 0.01, - default: 2, - }, - restDelta: { - granular: 0.005, - default: 0.5, - }, - // Limits - minDuration: 0.01, // in seconds - maxDuration: 10.0, // in seconds - minDamping: 0.05, - maxDamping: 1, -}; -function calcAngularFreq(undampedFreq, dampingRatio) { - return undampedFreq * Math.sqrt(1 - dampingRatio * dampingRatio); -} -const rootIterations = 12; -function approximateRoot(envelope, derivative, initialGuess) { - let result = initialGuess; - for (let i = 1; i < rootIterations; i++) { - result = result - envelope(result) / derivative(result); - } - return result; -} -/** - * This is ported from the Framer implementation of duration-based spring resolution. - */ -const safeMin = 0.001; -function findSpring({ duration = springDefaults.duration, bounce = springDefaults.bounce, velocity = springDefaults.velocity, mass = springDefaults.mass, }) { - let envelope; - let derivative; - motionUtils.warning(duration <= motionUtils.secondsToMilliseconds(springDefaults.maxDuration), "Spring duration must be 10 seconds or less", "spring-duration-limit"); - let dampingRatio = 1 - bounce; - /** - * Restrict dampingRatio and duration to within acceptable ranges. - */ - dampingRatio = motionUtils.clamp(springDefaults.minDamping, springDefaults.maxDamping, dampingRatio); - duration = motionUtils.clamp(springDefaults.minDuration, springDefaults.maxDuration, motionUtils.millisecondsToSeconds(duration)); - if (dampingRatio < 1) { - /** - * Underdamped spring - */ - envelope = (undampedFreq) => { - const exponentialDecay = undampedFreq * dampingRatio; - const delta = exponentialDecay * duration; - const a = exponentialDecay - velocity; - const b = calcAngularFreq(undampedFreq, dampingRatio); - const c = Math.exp(-delta); - return safeMin - (a / b) * c; - }; - derivative = (undampedFreq) => { - const exponentialDecay = undampedFreq * dampingRatio; - const delta = exponentialDecay * duration; - const d = delta * velocity + velocity; - const e = Math.pow(dampingRatio, 2) * Math.pow(undampedFreq, 2) * duration; - const f = Math.exp(-delta); - const g = calcAngularFreq(Math.pow(undampedFreq, 2), dampingRatio); - const factor = -envelope(undampedFreq) + safeMin > 0 ? -1 : 1; - return (factor * ((d - e) * f)) / g; - }; - } - else { - /** - * Critically-damped spring - */ - envelope = (undampedFreq) => { - const a = Math.exp(-undampedFreq * duration); - const b = (undampedFreq - velocity) * duration + 1; - return -safeMin + a * b; - }; - derivative = (undampedFreq) => { - const a = Math.exp(-undampedFreq * duration); - const b = (velocity - undampedFreq) * (duration * duration); - return a * b; - }; - } - const initialGuess = 5 / duration; - const undampedFreq = approximateRoot(envelope, derivative, initialGuess); - duration = motionUtils.secondsToMilliseconds(duration); - if (isNaN(undampedFreq)) { - return { - stiffness: springDefaults.stiffness, - damping: springDefaults.damping, - duration, - }; - } - else { - const stiffness = Math.pow(undampedFreq, 2) * mass; - return { - stiffness, - damping: dampingRatio * 2 * Math.sqrt(mass * stiffness), - duration, - }; - } -} -const durationKeys = ["duration", "bounce"]; -const physicsKeys = ["stiffness", "damping", "mass"]; -function isSpringType(options, keys) { - return keys.some((key) => options[key] !== undefined); -} -function getSpringOptions(options) { - let springOptions = { - velocity: springDefaults.velocity, - stiffness: springDefaults.stiffness, - damping: springDefaults.damping, - mass: springDefaults.mass, - isResolvedFromDuration: false, - ...options, - }; - // stiffness/damping/mass overrides duration/bounce - if (!isSpringType(options, physicsKeys) && - isSpringType(options, durationKeys)) { - // Time-defined springs should ignore inherited velocity. - // Velocity from interrupted animations can cause findSpring() - // to compute wildly different spring parameters, leading to - // massive oscillation on small-range animations. - springOptions.velocity = 0; - if (options.visualDuration) { - const visualDuration = options.visualDuration; - const root = (2 * Math.PI) / (visualDuration * 1.2); - const stiffness = root * root; - const damping = 2 * - motionUtils.clamp(0.05, 1, 1 - (options.bounce || 0)) * - Math.sqrt(stiffness); - springOptions = { - ...springOptions, - mass: springDefaults.mass, - stiffness, - damping, - }; - } - else { - const derived = findSpring({ ...options, velocity: 0 }); - springOptions = { - ...springOptions, - ...derived, - mass: springDefaults.mass, - }; - springOptions.isResolvedFromDuration = true; - } - } - return springOptions; -} -function spring(optionsOrVisualDuration = springDefaults.visualDuration, bounce = springDefaults.bounce) { - const options = typeof optionsOrVisualDuration !== "object" - ? { - visualDuration: optionsOrVisualDuration, - keyframes: [0, 1], - bounce, - } - : optionsOrVisualDuration; - let { restSpeed, restDelta } = options; - const origin = options.keyframes[0]; - const target = options.keyframes[options.keyframes.length - 1]; - /** - * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator - * to reduce GC during animation. - */ - const state = { done: false, value: origin }; - const { stiffness, damping, mass, duration, velocity, isResolvedFromDuration, } = getSpringOptions({ - ...options, - velocity: -motionUtils.millisecondsToSeconds(options.velocity || 0), - }); - const initialVelocity = velocity || 0.0; - const dampingRatio = damping / (2 * Math.sqrt(stiffness * mass)); - const initialDelta = target - origin; - const undampedAngularFreq = motionUtils.millisecondsToSeconds(Math.sqrt(stiffness / mass)); - /** - * If we're working on a granular scale, use smaller defaults for determining - * when the spring is finished. - * - * These defaults have been selected emprically based on what strikes a good - * ratio between feeling good and finishing as soon as changes are imperceptible. - */ - const isGranularScale = Math.abs(initialDelta) < 5; - restSpeed || (restSpeed = isGranularScale - ? springDefaults.restSpeed.granular - : springDefaults.restSpeed.default); - restDelta || (restDelta = isGranularScale - ? springDefaults.restDelta.granular - : springDefaults.restDelta.default); - let resolveSpring; - let resolveVelocity; - // Underdamped coefficients, hoisted for use in the inlined next() hot path - let angularFreq; - let A; - let sinCoeff; - let cosCoeff; - if (dampingRatio < 1) { - angularFreq = calcAngularFreq(undampedAngularFreq, dampingRatio); - A = - (initialVelocity + - dampingRatio * undampedAngularFreq * initialDelta) / - angularFreq; - // Underdamped spring - resolveSpring = (t) => { - const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); - return (target - - envelope * - (A * Math.sin(angularFreq * t) + - initialDelta * Math.cos(angularFreq * t))); - }; - // Analytical derivative of underdamped spring (px/ms) - sinCoeff = - dampingRatio * undampedAngularFreq * A + initialDelta * angularFreq; - cosCoeff = - dampingRatio * undampedAngularFreq * initialDelta - A * angularFreq; - resolveVelocity = (t) => { - const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); - return envelope * - (sinCoeff * Math.sin(angularFreq * t) + - cosCoeff * Math.cos(angularFreq * t)); - }; - } - else if (dampingRatio === 1) { - // Critically damped spring - resolveSpring = (t) => target - - Math.exp(-undampedAngularFreq * t) * - (initialDelta + - (initialVelocity + undampedAngularFreq * initialDelta) * t); - // Analytical derivative of critically damped spring (px/ms) - const C = initialVelocity + undampedAngularFreq * initialDelta; - resolveVelocity = (t) => Math.exp(-undampedAngularFreq * t) * - (undampedAngularFreq * C * t - initialVelocity); - } - else { - // Overdamped spring - const dampedAngularFreq = undampedAngularFreq * Math.sqrt(dampingRatio * dampingRatio - 1); - resolveSpring = (t) => { - const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); - // When performing sinh or cosh values can hit Infinity so we cap them here - const freqForT = Math.min(dampedAngularFreq * t, 300); - return (target - - (envelope * - ((initialVelocity + - dampingRatio * undampedAngularFreq * initialDelta) * - Math.sinh(freqForT) + - dampedAngularFreq * - initialDelta * - Math.cosh(freqForT))) / - dampedAngularFreq); - }; - // Analytical derivative of overdamped spring (px/ms) - const P = (initialVelocity + - dampingRatio * undampedAngularFreq * initialDelta) / - dampedAngularFreq; - const sinhCoeff = dampingRatio * undampedAngularFreq * P - initialDelta * dampedAngularFreq; - const coshCoeff = dampingRatio * undampedAngularFreq * initialDelta - P * dampedAngularFreq; - resolveVelocity = (t) => { - const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); - const freqForT = Math.min(dampedAngularFreq * t, 300); - return envelope * - (sinhCoeff * Math.sinh(freqForT) + - coshCoeff * Math.cosh(freqForT)); - }; - } - const generator = { - calculatedDuration: isResolvedFromDuration ? duration || null : null, - velocity: (t) => motionUtils.secondsToMilliseconds(resolveVelocity(t)), - next: (t) => { - /** - * For underdamped physics springs we need both position and - * velocity each tick. Compute shared trig values once to avoid - * duplicate Math.exp/sin/cos calls on the hot path. - */ - if (!isResolvedFromDuration && dampingRatio < 1) { - const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); - const sin = Math.sin(angularFreq * t); - const cos = Math.cos(angularFreq * t); - const current = target - - envelope * - (A * sin + initialDelta * cos); - const currentVelocity = motionUtils.secondsToMilliseconds(envelope * - (sinCoeff * sin + cosCoeff * cos)); - state.done = - Math.abs(currentVelocity) <= restSpeed && - Math.abs(target - current) <= restDelta; - state.value = state.done ? target : current; - return state; - } - const current = resolveSpring(t); - if (!isResolvedFromDuration) { - const currentVelocity = motionUtils.secondsToMilliseconds(resolveVelocity(t)); - state.done = - Math.abs(currentVelocity) <= restSpeed && - Math.abs(target - current) <= restDelta; - } - else { - state.done = t >= duration; - } - state.value = state.done ? target : current; - return state; - }, - toString: () => { - const calculatedDuration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration); - const easing = generateLinearEasing((progress) => generator.next(calculatedDuration * progress).value, calculatedDuration, 30); - return calculatedDuration + "ms " + easing; - }, - toTransition: () => { }, - }; - return generator; -} -spring.applyToOptions = (options) => { - const generatorOptions = createGeneratorEasing(options, 100, spring); - options.ease = generatorOptions.ease; - options.duration = motionUtils.secondsToMilliseconds(generatorOptions.duration); - options.type = "keyframes"; - return options; -}; - -const velocitySampleDuration = 5; // ms -function getGeneratorVelocity(resolveValue, t, current) { - const prevT = Math.max(t - velocitySampleDuration, 0); - return motionUtils.velocityPerSecond(current - resolveValue(prevT), t - prevT); -} - -function inertia({ keyframes, velocity = 0.0, power = 0.8, timeConstant = 325, bounceDamping = 10, bounceStiffness = 500, modifyTarget, min, max, restDelta = 0.5, restSpeed, }) { - const origin = keyframes[0]; - const state = { - done: false, - value: origin, - }; - const isOutOfBounds = (v) => (min !== undefined && v < min) || (max !== undefined && v > max); - const nearestBoundary = (v) => { - if (min === undefined) - return max; - if (max === undefined) - return min; - return Math.abs(min - v) < Math.abs(max - v) ? min : max; - }; - let amplitude = power * velocity; - const ideal = origin + amplitude; - const target = modifyTarget === undefined ? ideal : modifyTarget(ideal); - /** - * If the target has changed we need to re-calculate the amplitude, otherwise - * the animation will start from the wrong position. - */ - if (target !== ideal) - amplitude = target - origin; - const calcDelta = (t) => -amplitude * Math.exp(-t / timeConstant); - const calcLatest = (t) => target + calcDelta(t); - const applyFriction = (t) => { - const delta = calcDelta(t); - const latest = calcLatest(t); - state.done = Math.abs(delta) <= restDelta; - state.value = state.done ? target : latest; - }; - /** - * Ideally this would resolve for t in a stateless way, we could - * do that by always precalculating the animation but as we know - * this will be done anyway we can assume that spring will - * be discovered during that. - */ - let timeReachedBoundary; - let spring$1; - const checkCatchBoundary = (t) => { - if (!isOutOfBounds(state.value)) - return; - timeReachedBoundary = t; - spring$1 = spring({ - keyframes: [state.value, nearestBoundary(state.value)], - velocity: getGeneratorVelocity(calcLatest, t, state.value), // TODO: This should be passing * 1000 - damping: bounceDamping, - stiffness: bounceStiffness, - restDelta, - restSpeed, - }); - }; - checkCatchBoundary(0); - return { - calculatedDuration: null, - next: (t) => { - /** - * We need to resolve the friction to figure out if we need a - * spring but we don't want to do this twice per frame. So here - * we flag if we updated for this frame and later if we did - * we can skip doing it again. - */ - let hasUpdatedFrame = false; - if (!spring$1 && timeReachedBoundary === undefined) { - hasUpdatedFrame = true; - applyFriction(t); - checkCatchBoundary(t); - } - /** - * If we have a spring and the provided t is beyond the moment the friction - * animation crossed the min/max boundary, use the spring. - */ - if (timeReachedBoundary !== undefined && t >= timeReachedBoundary) { - return spring$1.next(t - timeReachedBoundary); - } - else { - !hasUpdatedFrame && applyFriction(t); - return state; - } - }, - }; -} - -function createMixers(output, ease, customMixer) { - const mixers = []; - const mixerFactory = customMixer || motionUtils.MotionGlobalConfig.mix || mix; - const numMixers = output.length - 1; - for (let i = 0; i < numMixers; i++) { - let mixer = mixerFactory(output[i], output[i + 1]); - if (ease) { - const easingFunction = Array.isArray(ease) ? ease[i] || motionUtils.noop : ease; - mixer = motionUtils.pipe(easingFunction, mixer); - } - mixers.push(mixer); - } - return mixers; -} -/** - * Create a function that maps from a numerical input array to a generic output array. - * - * Accepts: - * - Numbers - * - Colors (hex, hsl, hsla, rgb, rgba) - * - Complex (combinations of one or more numbers or strings) - * - * ```jsx - * const mixColor = interpolate([0, 1], ['#fff', '#000']) - * - * mixColor(0.5) // 'rgba(128, 128, 128, 1)' - * ``` - * - * TODO Revisit this approach once we've moved to data models for values, - * probably not needed to pregenerate mixer functions. - * - * @public - */ -function interpolate(input, output, { clamp: isClamp = true, ease, mixer } = {}) { - const inputLength = input.length; - motionUtils.invariant(inputLength === output.length, "Both input and output ranges must be the same length", "range-length"); - /** - * If we're only provided a single input, we can just make a function - * that returns the output. - */ - if (inputLength === 1) - return () => output[0]; - if (inputLength === 2 && output[0] === output[1]) - return () => output[1]; - const isZeroDeltaRange = input[0] === input[1]; - // If input runs highest -> lowest, reverse both arrays - if (input[0] > input[inputLength - 1]) { - input = [...input].reverse(); - output = [...output].reverse(); - } - const mixers = createMixers(output, ease, mixer); - const numMixers = mixers.length; - const interpolator = (v) => { - if (isZeroDeltaRange && v < input[0]) - return output[0]; - let i = 0; - if (numMixers > 1) { - for (; i < input.length - 2; i++) { - if (v < input[i + 1]) - break; - } - } - const progressInRange = motionUtils.progress(input[i], input[i + 1], v); - return mixers[i](progressInRange); - }; - return isClamp - ? (v) => interpolator(motionUtils.clamp(input[0], input[inputLength - 1], v)) - : interpolator; -} - -function fillOffset(offset, remaining) { - const min = offset[offset.length - 1]; - for (let i = 1; i <= remaining; i++) { - const offsetProgress = motionUtils.progress(0, remaining, i); - offset.push(mixNumber$1(min, 1, offsetProgress)); - } -} - -function defaultOffset(arr) { - const offset = [0]; - fillOffset(offset, arr.length - 1); - return offset; -} - -function convertOffsetToTimes(offset, duration) { - return offset.map((o) => o * duration); -} - -function defaultEasing(values, easing) { - return values.map(() => easing || motionUtils.easeInOut).splice(0, values.length - 1); -} -function keyframes({ duration = 300, keyframes: keyframeValues, times, ease = "easeInOut", }) { - /** - * Easing functions can be externally defined as strings. Here we convert them - * into actual functions. - */ - const easingFunctions = motionUtils.isEasingArray(ease) - ? ease.map(motionUtils.easingDefinitionToFunction) - : motionUtils.easingDefinitionToFunction(ease); - /** - * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator - * to reduce GC during animation. - */ - const state = { - done: false, - value: keyframeValues[0], - }; - /** - * Create a times array based on the provided 0-1 offsets - */ - const absoluteTimes = convertOffsetToTimes( - // Only use the provided offsets if they're the correct length - // TODO Maybe we should warn here if there's a length mismatch - times && times.length === keyframeValues.length - ? times - : defaultOffset(keyframeValues), duration); - const mapTimeToKeyframe = interpolate(absoluteTimes, keyframeValues, { - ease: Array.isArray(easingFunctions) - ? easingFunctions - : defaultEasing(keyframeValues, easingFunctions), - }); - return { - calculatedDuration: duration, - next: (t) => { - state.value = mapTimeToKeyframe(t); - state.done = t >= duration; - return state; - }, - }; -} - -const isNotNull = (value) => value !== null; -function getFinalKeyframe(keyframes, { repeat, repeatType = "loop" }, finalKeyframe, speed = 1) { - const resolvedKeyframes = keyframes.filter(isNotNull); - const useFirstKeyframe = speed < 0 || (repeat && repeatType !== "loop" && repeat % 2 === 1); - const index = useFirstKeyframe ? 0 : resolvedKeyframes.length - 1; - return !index || finalKeyframe === undefined - ? resolvedKeyframes[index] - : finalKeyframe; -} - -const transitionTypeMap = { - decay: inertia, - inertia, - tween: keyframes, - keyframes: keyframes, - spring, -}; -function replaceTransitionType(transition) { - if (typeof transition.type === "string") { - transition.type = transitionTypeMap[transition.type]; - } -} - -class WithPromise { - constructor() { - this.updateFinished(); - } - get finished() { - return this._finished; - } - updateFinished() { - this._finished = new Promise((resolve) => { - this.resolve = resolve; - }); - } - notifyFinished() { - this.resolve(); - } - /** - * Allows the animation to be awaited. - * - * @deprecated Use `finished` instead. - */ - then(onResolve, onReject) { - return this.finished.then(onResolve, onReject); - } -} - -const percentToProgress = (percent) => percent / 100; -class JSAnimation extends WithPromise { - constructor(options) { - super(); - this.state = "idle"; - this.startTime = null; - this.isStopped = false; - /** - * The current time of the animation. - */ - this.currentTime = 0; - /** - * The time at which the animation was paused. - */ - this.holdTime = null; - /** - * Playback speed as a factor. 0 would be stopped, -1 reverse and 2 double speed. - */ - this.playbackSpeed = 1; - /** - * Reusable state object for the delay phase to avoid - * allocating a new object every frame. - */ - this.delayState = { - done: false, - value: undefined, - }; - /** - * This method is bound to the instance to fix a pattern where - * animation.stop is returned as a reference from a useEffect. - */ - this.stop = () => { - const { motionValue } = this.options; - if (motionValue && motionValue.updatedAt !== time.now()) { - this.tick(time.now()); - } - this.isStopped = true; - if (this.state === "idle") - return; - this.teardown(); - this.options.onStop?.(); - }; - this.options = options; - this.initAnimation(); - this.play(); - if (options.autoplay === false) - this.pause(); - } - initAnimation() { - const { options } = this; - replaceTransitionType(options); - const { type = keyframes, repeat = 0, repeatDelay = 0, repeatType, velocity = 0, } = options; - let { keyframes: keyframes$1 } = options; - const generatorFactory = type || keyframes; - if (process.env.NODE_ENV !== "production" && - generatorFactory !== keyframes) { - motionUtils.invariant(keyframes$1.length <= 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${keyframes$1}`, "spring-two-frames"); - } - if (generatorFactory !== keyframes && - typeof keyframes$1[0] !== "number") { - this.mixKeyframes = motionUtils.pipe(percentToProgress, mix(keyframes$1[0], keyframes$1[1])); - keyframes$1 = [0, 100]; - } - const generator = generatorFactory({ ...options, keyframes: keyframes$1 }); - /** - * If we have a mirror repeat type we need to create a second generator that outputs the - * mirrored (not reversed) animation and later ping pong between the two generators. - */ - if (repeatType === "mirror") { - this.mirroredGenerator = generatorFactory({ - ...options, - keyframes: [...keyframes$1].reverse(), - velocity: -velocity, - }); - } - /** - * If duration is undefined and we have repeat options, - * we need to calculate a duration from the generator. - * - * We set it to the generator itself to cache the duration. - * Any timeline resolver will need to have already precalculated - * the duration by this step. - */ - if (generator.calculatedDuration === null) { - generator.calculatedDuration = calcGeneratorDuration(generator); - } - const { calculatedDuration } = generator; - this.calculatedDuration = calculatedDuration; - this.resolvedDuration = calculatedDuration + repeatDelay; - this.totalDuration = this.resolvedDuration * (repeat + 1) - repeatDelay; - this.generator = generator; - } - updateTime(timestamp) { - const animationTime = Math.round(timestamp - this.startTime) * this.playbackSpeed; - // Update currentTime - if (this.holdTime !== null) { - this.currentTime = this.holdTime; - } - else { - // Rounding the time because floating point arithmetic is not always accurate, e.g. 3000.367 - 1000.367 = - // 2000.0000000000002. This is a problem when we are comparing the currentTime with the duration, for - // example. - this.currentTime = animationTime; - } - } - tick(timestamp, sample = false) { - const { generator, totalDuration, mixKeyframes, mirroredGenerator, resolvedDuration, calculatedDuration, } = this; - if (this.startTime === null) - return generator.next(0); - const { delay = 0, keyframes, repeat, repeatType, repeatDelay, type, onUpdate, finalKeyframe, } = this.options; - /** - * requestAnimationFrame timestamps can come through as lower than - * the startTime as set by performance.now(). Here we prevent this, - * though in the future it could be possible to make setting startTime - * a pending operation that gets resolved here. - */ - if (this.speed > 0) { - this.startTime = Math.min(this.startTime, timestamp); - } - else if (this.speed < 0) { - this.startTime = Math.min(timestamp - totalDuration / this.speed, this.startTime); - } - if (sample) { - this.currentTime = timestamp; - } - else { - this.updateTime(timestamp); - } - // Rebase on delay - const timeWithoutDelay = this.currentTime - delay * (this.playbackSpeed >= 0 ? 1 : -1); - const isInDelayPhase = this.playbackSpeed >= 0 - ? timeWithoutDelay < 0 - : timeWithoutDelay > totalDuration; - this.currentTime = Math.max(timeWithoutDelay, 0); - // If this animation has finished, set the current time to the total duration. - if (this.state === "finished" && this.holdTime === null) { - this.currentTime = totalDuration; - } - let elapsed = this.currentTime; - let frameGenerator = generator; - if (repeat) { - /** - * Get the current progress (0-1) of the animation. If t is > - * than duration we'll get values like 2.5 (midway through the - * third iteration) - */ - const progress = Math.min(this.currentTime, totalDuration) / resolvedDuration; - /** - * Get the current iteration (0 indexed). For instance the floor of - * 2.5 is 2. - */ - let currentIteration = Math.floor(progress); - /** - * Get the current progress of the iteration by taking the remainder - * so 2.5 is 0.5 through iteration 2 - */ - let iterationProgress = progress % 1.0; - /** - * If iteration progress is 1 we count that as the end - * of the previous iteration. - */ - if (!iterationProgress && progress >= 1) { - iterationProgress = 1; - } - iterationProgress === 1 && currentIteration--; - currentIteration = Math.min(currentIteration, repeat + 1); - /** - * Reverse progress if we're not running in "normal" direction - */ - const isOddIteration = Boolean(currentIteration % 2); - if (isOddIteration) { - if (repeatType === "reverse") { - iterationProgress = 1 - iterationProgress; - if (repeatDelay) { - iterationProgress -= repeatDelay / resolvedDuration; - } - } - else if (repeatType === "mirror") { - frameGenerator = mirroredGenerator; - } - } - elapsed = motionUtils.clamp(0, 1, iterationProgress) * resolvedDuration; - } - /** - * If we're in negative time, set state as the initial keyframe. - * This prevents delay: x, duration: 0 animations from finishing - * instantly. - */ - let state; - if (isInDelayPhase) { - this.delayState.value = keyframes[0]; - state = this.delayState; - } - else { - state = frameGenerator.next(elapsed); - } - if (mixKeyframes && !isInDelayPhase) { - state.value = mixKeyframes(state.value); - } - let { done } = state; - if (!isInDelayPhase && calculatedDuration !== null) { - done = - this.playbackSpeed >= 0 - ? this.currentTime >= totalDuration - : this.currentTime <= 0; - } - const isAnimationFinished = this.holdTime === null && - (this.state === "finished" || (this.state === "running" && done)); - // TODO: The exception for inertia could be cleaner here - if (isAnimationFinished && type !== inertia) { - state.value = getFinalKeyframe(keyframes, this.options, finalKeyframe, this.speed); - } - if (onUpdate) { - onUpdate(state.value); - } - if (isAnimationFinished) { - this.finish(); - } - return state; - } - /** - * Allows the returned animation to be awaited or promise-chained. Currently - * resolves when the animation finishes at all but in a future update could/should - * reject if its cancels. - */ - then(resolve, reject) { - return this.finished.then(resolve, reject); - } - get duration() { - return motionUtils.millisecondsToSeconds(this.calculatedDuration); - } - get iterationDuration() { - const { delay = 0 } = this.options || {}; - return this.duration + motionUtils.millisecondsToSeconds(delay); - } - get time() { - return motionUtils.millisecondsToSeconds(this.currentTime); - } - set time(newTime) { - newTime = motionUtils.secondsToMilliseconds(newTime); - this.currentTime = newTime; - if (this.startTime === null || - this.holdTime !== null || - this.playbackSpeed === 0) { - this.holdTime = newTime; - } - else if (this.driver) { - this.startTime = this.driver.now() - newTime / this.playbackSpeed; - } - if (this.driver) { - this.driver.start(false); - } - else { - this.startTime = 0; - this.state = "paused"; - this.holdTime = newTime; - this.tick(newTime); - } - } - /** - * Returns the generator's velocity at the current time in units/second. - * Uses the analytical derivative when available (springs), avoiding - * the MotionValue's frame-dependent velocity estimation. - */ - getGeneratorVelocity() { - const t = this.currentTime; - if (t <= 0) - return this.options.velocity || 0; - if (this.generator.velocity) { - return this.generator.velocity(t); - } - // Fallback: finite difference - const current = this.generator.next(t).value; - return getGeneratorVelocity((s) => this.generator.next(s).value, t, current); - } - get speed() { - return this.playbackSpeed; - } - set speed(newSpeed) { - const hasChanged = this.playbackSpeed !== newSpeed; - if (hasChanged && this.driver) { - this.updateTime(time.now()); - } - this.playbackSpeed = newSpeed; - if (hasChanged && this.driver) { - this.time = motionUtils.millisecondsToSeconds(this.currentTime); - } - } - play() { - if (this.isStopped) - return; - const { driver = frameloopDriver, startTime } = this.options; - if (!this.driver) { - this.driver = driver((timestamp) => this.tick(timestamp)); - } - this.options.onPlay?.(); - const now = this.driver.now(); - if (this.state === "finished") { - this.updateFinished(); - this.startTime = now; - } - else if (this.holdTime !== null) { - this.startTime = now - this.holdTime; - } - else if (!this.startTime) { - this.startTime = startTime ?? now; - } - if (this.state === "finished" && this.speed < 0) { - this.startTime += this.calculatedDuration; - } - this.holdTime = null; - /** - * Set playState to running only after we've used it in - * the previous logic. - */ - this.state = "running"; - this.driver.start(); - } - pause() { - this.state = "paused"; - this.updateTime(time.now()); - this.holdTime = this.currentTime; - } - complete() { - if (this.state !== "running") { - this.play(); - } - this.state = "finished"; - this.holdTime = null; - } - finish() { - this.notifyFinished(); - this.teardown(); - this.state = "finished"; - this.options.onComplete?.(); - } - cancel() { - this.holdTime = null; - this.startTime = 0; - this.tick(0); - this.teardown(); - this.options.onCancel?.(); - } - teardown() { - this.state = "idle"; - this.stopDriver(); - this.startTime = this.holdTime = null; - } - stopDriver() { - if (!this.driver) - return; - this.driver.stop(); - this.driver = undefined; - } - sample(sampleTime) { - this.startTime = 0; - return this.tick(sampleTime, true); - } - attachTimeline(timeline) { - if (this.options.allowFlatten) { - this.options.type = "keyframes"; - this.options.ease = "linear"; - this.initAnimation(); - } - this.driver?.stop(); - return timeline.observe(this); - } -} -// Legacy function support -function animateValue(options) { - return new JSAnimation(options); -} - -function fillWildcards(keyframes) { - for (let i = 1; i < keyframes.length; i++) { - keyframes[i] ?? (keyframes[i] = keyframes[i - 1]); - } -} - -const radToDeg = (rad) => (rad * 180) / Math.PI; -const rotate = (v) => { - const angle = radToDeg(Math.atan2(v[1], v[0])); - return rebaseAngle(angle); -}; -const matrix2dParsers = { - x: 4, - y: 5, - translateX: 4, - translateY: 5, - scaleX: 0, - scaleY: 3, - scale: (v) => (Math.abs(v[0]) + Math.abs(v[3])) / 2, - rotate, - rotateZ: rotate, - skewX: (v) => radToDeg(Math.atan(v[1])), - skewY: (v) => radToDeg(Math.atan(v[2])), - skew: (v) => (Math.abs(v[1]) + Math.abs(v[2])) / 2, -}; -const rebaseAngle = (angle) => { - angle = angle % 360; - if (angle < 0) - angle += 360; - return angle; -}; -const rotateZ = rotate; -const scaleX = (v) => Math.sqrt(v[0] * v[0] + v[1] * v[1]); -const scaleY = (v) => Math.sqrt(v[4] * v[4] + v[5] * v[5]); -const matrix3dParsers = { - x: 12, - y: 13, - z: 14, - translateX: 12, - translateY: 13, - translateZ: 14, - scaleX, - scaleY, - scale: (v) => (scaleX(v) + scaleY(v)) / 2, - rotateX: (v) => rebaseAngle(radToDeg(Math.atan2(v[6], v[5]))), - rotateY: (v) => rebaseAngle(radToDeg(Math.atan2(-v[2], v[0]))), - rotateZ, - rotate: rotateZ, - skewX: (v) => radToDeg(Math.atan(v[4])), - skewY: (v) => radToDeg(Math.atan(v[1])), - skew: (v) => (Math.abs(v[1]) + Math.abs(v[4])) / 2, -}; -function defaultTransformValue(name) { - return name.includes("scale") ? 1 : 0; -} -function parseValueFromTransform(transform, name) { - if (!transform || transform === "none") { - return defaultTransformValue(name); - } - const matrix3dMatch = transform.match(/^matrix3d\(([-\d.e\s,]+)\)$/u); - let parsers; - let match; - if (matrix3dMatch) { - parsers = matrix3dParsers; - match = matrix3dMatch; - } - else { - const matrix2dMatch = transform.match(/^matrix\(([-\d.e\s,]+)\)$/u); - parsers = matrix2dParsers; - match = matrix2dMatch; - } - if (!match) { - return defaultTransformValue(name); - } - const valueParser = parsers[name]; - const values = match[1].split(",").map(convertTransformToNumber); - return typeof valueParser === "function" - ? valueParser(values) - : values[valueParser]; -} -const readTransformValue = (instance, name) => { - const { transform = "none" } = getComputedStyle(instance); - return parseValueFromTransform(transform, name); -}; -function convertTransformToNumber(value) { - return parseFloat(value.trim()); -} - -/** - * Generate a list of every possible transform key. - */ -const transformPropOrder = [ - "transformPerspective", - "x", - "y", - "z", - "translateX", - "translateY", - "translateZ", - "scale", - "scaleX", - "scaleY", - "rotate", - "rotateX", - "rotateY", - "rotateZ", - "skew", - "skewX", - "skewY", -]; -/** - * A quick lookup for transform props. - * - * `pathRotation` is a transform for routing purposes (skipped from raw - * style application, wired to the transform composite, flags transform - * dirty) but is intentionally NOT in `transformPropOrder` — it is - * composed onto `rotate` at the build sites, not serialized in its own - * slot, and must stay out of the order-array consumers (parse-transform, - * unit-conversion, keys-position). - */ -const transformProps = /*@__PURE__*/ (() => new Set([...transformPropOrder, "pathRotation"]))(); - -const isNumOrPxType = (v) => v === number || v === px; -const transformKeys = new Set(["x", "y", "z"]); -const nonTranslationalTransformKeys = transformPropOrder.filter((key) => !transformKeys.has(key)); -function removeNonTranslationalTransform(visualElement) { - const removedTransforms = []; - nonTranslationalTransformKeys.forEach((key) => { - const value = visualElement.getValue(key); - if (value !== undefined) { - removedTransforms.push([key, value.get()]); - value.set(key.startsWith("scale") ? 1 : 0); - } - }); - return removedTransforms; -} -const positionalValues = { - // Dimensions - width: ({ x }, { paddingLeft = "0", paddingRight = "0", boxSizing }) => { - const width = x.max - x.min; - return boxSizing === "border-box" - ? width - : width - parseFloat(paddingLeft) - parseFloat(paddingRight); - }, - height: ({ y }, { paddingTop = "0", paddingBottom = "0", boxSizing }) => { - const height = y.max - y.min; - return boxSizing === "border-box" - ? height - : height - parseFloat(paddingTop) - parseFloat(paddingBottom); - }, - top: (_bbox, { top }) => parseFloat(top), - left: (_bbox, { left }) => parseFloat(left), - bottom: ({ y }, { top }) => parseFloat(top) + (y.max - y.min), - right: ({ x }, { left }) => parseFloat(left) + (x.max - x.min), - // Transform - x: (_bbox, { transform }) => parseValueFromTransform(transform, "x"), - y: (_bbox, { transform }) => parseValueFromTransform(transform, "y"), -}; -// Alias translate longform names -positionalValues.translateX = positionalValues.x; -positionalValues.translateY = positionalValues.y; - -const toResolve = new Set(); -let isScheduled = false; -let anyNeedsMeasurement = false; -let isForced = false; -function measureAllKeyframes() { - if (anyNeedsMeasurement) { - const resolversToMeasure = Array.from(toResolve).filter((resolver) => resolver.needsMeasurement); - const elementsToMeasure = new Set(resolversToMeasure.map((resolver) => resolver.element)); - const transformsToRestore = new Map(); - /** - * Write pass - * If we're measuring elements we want to remove bounding box-changing transforms. - */ - elementsToMeasure.forEach((element) => { - const removedTransforms = removeNonTranslationalTransform(element); - if (!removedTransforms.length) - return; - transformsToRestore.set(element, removedTransforms); - element.render(); - }); - // Read - resolversToMeasure.forEach((resolver) => resolver.measureInitialState()); - // Write - elementsToMeasure.forEach((element) => { - element.render(); - const restore = transformsToRestore.get(element); - if (restore) { - restore.forEach(([key, value]) => { - element.getValue(key)?.set(value); - }); - } - }); - // Read - resolversToMeasure.forEach((resolver) => resolver.measureEndState()); - // Write - resolversToMeasure.forEach((resolver) => { - if (resolver.suspendedScrollY !== undefined) { - window.scrollTo(0, resolver.suspendedScrollY); - } - }); - } - anyNeedsMeasurement = false; - isScheduled = false; - toResolve.forEach((resolver) => resolver.complete(isForced)); - toResolve.clear(); -} -function readAllKeyframes() { - toResolve.forEach((resolver) => { - resolver.readKeyframes(); - if (resolver.needsMeasurement) { - anyNeedsMeasurement = true; - } - }); -} -function flushKeyframeResolvers() { - isForced = true; - readAllKeyframes(); - measureAllKeyframes(); - isForced = false; -} -class KeyframeResolver { - constructor(unresolvedKeyframes, onComplete, name, motionValue, element, isAsync = false) { - this.state = "pending"; - /** - * Track whether this resolver is async. If it is, it'll be added to the - * resolver queue and flushed in the next frame. Resolvers that aren't going - * to trigger read/write thrashing don't need to be async. - */ - this.isAsync = false; - /** - * Track whether this resolver needs to perform a measurement - * to resolve its keyframes. - */ - this.needsMeasurement = false; - this.unresolvedKeyframes = [...unresolvedKeyframes]; - this.onComplete = onComplete; - this.name = name; - this.motionValue = motionValue; - this.element = element; - this.isAsync = isAsync; - } - scheduleResolve() { - this.state = "scheduled"; - if (this.isAsync) { - toResolve.add(this); - if (!isScheduled) { - isScheduled = true; - frame.read(readAllKeyframes); - frame.resolveKeyframes(measureAllKeyframes); - } - } - else { - this.readKeyframes(); - this.complete(); - } - } - readKeyframes() { - const { unresolvedKeyframes, name, element, motionValue } = this; - // If initial keyframe is null we need to read it from the DOM - if (unresolvedKeyframes[0] === null) { - const currentValue = motionValue?.get(); - // TODO: This doesn't work if the final keyframe is a wildcard - const finalKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1]; - if (currentValue !== undefined) { - unresolvedKeyframes[0] = currentValue; - } - else if (element && name) { - const valueAsRead = element.readValue(name, finalKeyframe); - if (valueAsRead !== undefined && valueAsRead !== null) { - unresolvedKeyframes[0] = valueAsRead; - } - } - if (unresolvedKeyframes[0] === undefined) { - unresolvedKeyframes[0] = finalKeyframe; - } - if (motionValue && currentValue === undefined) { - motionValue.set(unresolvedKeyframes[0]); - } - } - fillWildcards(unresolvedKeyframes); - } - setFinalKeyframe() { } - measureInitialState() { } - renderEndStyles() { } - measureEndState() { } - complete(isForcedComplete = false) { - this.state = "complete"; - this.onComplete(this.unresolvedKeyframes, this.finalKeyframe, isForcedComplete); - toResolve.delete(this); - } - cancel() { - if (this.state === "scheduled") { - toResolve.delete(this); - this.state = "pending"; - } - } - resume() { - if (this.state === "pending") - this.scheduleResolve(); - } -} - -const isCSSVar = (name) => name.startsWith("--"); - -function setStyle(element, name, value) { - isCSSVar(name) - ? element.style.setProperty(name, value) - : (element.style[name] = value); -} - -/** - * Add the ability for test suites to manually set support flags - * to better test more environments. - */ -const supportsFlags = {}; - -function memoSupports(callback, supportsFlag) { - const memoized = motionUtils.memo(callback); - return () => supportsFlags[supportsFlag] ?? memoized(); -} - -const supportsScrollTimeline = /* @__PURE__ */ memoSupports(() => window.ScrollTimeline !== undefined, "scrollTimeline"); -const supportsViewTimeline = /* @__PURE__ */ memoSupports(() => window.ViewTimeline !== undefined, "viewTimeline"); - -const supportsLinearEasing = /*@__PURE__*/ memoSupports(() => { - try { - document - .createElement("div") - .animate({ opacity: 0 }, { easing: "linear(0, 1)" }); - } - catch (e) { - return false; - } - return true; -}, "linearEasing"); - -const cubicBezierAsString = ([a, b, c, d]) => `cubic-bezier(${a}, ${b}, ${c}, ${d})`; - -const supportedWaapiEasing = { - linear: "linear", - ease: "ease", - easeIn: "ease-in", - easeOut: "ease-out", - easeInOut: "ease-in-out", - circIn: /*@__PURE__*/ cubicBezierAsString([0, 0.65, 0.55, 1]), - circOut: /*@__PURE__*/ cubicBezierAsString([0.55, 0, 1, 0.45]), - backIn: /*@__PURE__*/ cubicBezierAsString([0.31, 0.01, 0.66, -0.59]), - backOut: /*@__PURE__*/ cubicBezierAsString([0.33, 1.53, 0.69, 0.99]), -}; - -function mapEasingToNativeEasing(easing, duration) { - if (!easing) { - return undefined; - } - else if (typeof easing === "function") { - return supportsLinearEasing() - ? generateLinearEasing(easing, duration) - : "ease-out"; - } - else if (motionUtils.isBezierDefinition(easing)) { - return cubicBezierAsString(easing); - } - else if (Array.isArray(easing)) { - return easing.map((segmentEasing) => mapEasingToNativeEasing(segmentEasing, duration) || - supportedWaapiEasing.easeOut); - } - else { - return supportedWaapiEasing[easing]; - } -} - -function startWaapiAnimation(element, valueName, keyframes, { delay = 0, duration = 300, repeat = 0, repeatType = "loop", ease = "easeOut", times, } = {}, pseudoElement = undefined) { - const keyframeOptions = { - [valueName]: keyframes, - }; - if (times) - keyframeOptions.offset = times; - const easing = mapEasingToNativeEasing(ease, duration); - /** - * If this is an easing array, apply to keyframes, not animation as a whole - */ - if (Array.isArray(easing)) - keyframeOptions.easing = easing; - const options = { - delay, - duration, - easing: !Array.isArray(easing) ? easing : "linear", - fill: "both", - iterations: repeat + 1, - direction: repeatType === "reverse" ? "alternate" : "normal", - }; - if (pseudoElement) - options.pseudoElement = pseudoElement; - return element.animate(keyframeOptions, options); -} - -function isGenerator(type) { - return typeof type === "function" && "applyToOptions" in type; -} - -function applyGeneratorOptions({ type, ...options }) { - if (isGenerator(type) && supportsLinearEasing()) { - return type.applyToOptions(options); - } - else { - options.duration ?? (options.duration = 300); - options.ease ?? (options.ease = "easeOut"); - } - return options; -} - -/** - * NativeAnimation implements AnimationPlaybackControls for the browser's Web Animations API. - */ -class NativeAnimation extends WithPromise { - constructor(options) { - super(); - this.finishedTime = null; - this.isStopped = false; - /** - * Tracks a manually-set start time that takes precedence over WAAPI's - * dynamic startTime. This is cleared when play() or time setter is called, - * allowing WAAPI to take over timing. - */ - this.manualStartTime = null; - if (!options) - return; - const { element, name, keyframes, pseudoElement, allowFlatten = false, finalKeyframe, onComplete, } = options; - this.isPseudoElement = Boolean(pseudoElement); - this.allowFlatten = allowFlatten; - this.options = options; - motionUtils.invariant(typeof options.type !== "string", `Mini animate() doesn't support "type" as a string.`, "mini-spring"); - const transition = applyGeneratorOptions(options); - this.animation = startWaapiAnimation(element, name, keyframes, transition, pseudoElement); - if (transition.autoplay === false) { - this.animation.pause(); - } - this.animation.onfinish = () => { - this.finishedTime = this.time; - if (!pseudoElement) { - const keyframe = getFinalKeyframe(keyframes, this.options, finalKeyframe, this.speed); - if (this.updateMotionValue) { - this.updateMotionValue(keyframe); - } - /** - * If we can, we want to commit the final style as set by the user, - * rather than the computed keyframe value supplied by the animation. - * We always do this, even when a motion value is present, to prevent - * a visual flash in Firefox where the WAAPI animation's fill is removed - * during cancel() before the scheduled render can apply the correct value. - */ - setStyle(element, name, keyframe); - this.animation.cancel(); - } - onComplete?.(); - this.notifyFinished(); - }; - } - play() { - if (this.isStopped) - return; - this.manualStartTime = null; - this.animation.play(); - if (this.state === "finished") { - this.updateFinished(); - } - } - pause() { - this.animation.pause(); - } - complete() { - this.animation.finish?.(); - } - cancel() { - try { - this.animation.cancel(); - } - catch (e) { } - } - stop() { - if (this.isStopped) - return; - this.isStopped = true; - const { state } = this; - if (state === "idle" || state === "finished") { - return; - } - if (this.updateMotionValue) { - this.updateMotionValue(); - } - else { - this.commitStyles(); - } - if (!this.isPseudoElement) - this.cancel(); - } - /** - * WAAPI doesn't natively have any interruption capabilities. - * - * In this method, we commit styles back to the DOM before cancelling - * the animation. - * - * This is designed to be overridden by NativeAnimationExtended, which - * will create a renderless JS animation and sample it twice to calculate - * its current value, "previous" value, and therefore allow - * Motion to also correctly calculate velocity for any subsequent animation - * while deferring the commit until the next animation frame. - */ - commitStyles() { - const element = this.options?.element; - if (!this.isPseudoElement && element?.isConnected) { - this.animation.commitStyles?.(); - } - } - get duration() { - const duration = this.animation.effect?.getComputedTiming?.().duration || 0; - return motionUtils.millisecondsToSeconds(Number(duration)); - } - get iterationDuration() { - const { delay = 0 } = this.options || {}; - return this.duration + motionUtils.millisecondsToSeconds(delay); - } - get time() { - return motionUtils.millisecondsToSeconds(Number(this.animation.currentTime) || 0); - } - set time(newTime) { - const wasFinished = this.finishedTime !== null; - this.manualStartTime = null; - this.finishedTime = null; - this.animation.currentTime = motionUtils.secondsToMilliseconds(newTime); - if (wasFinished) { - this.animation.pause(); - } - } - /** - * The playback speed of the animation. - * 1 = normal speed, 2 = double speed, 0.5 = half speed. - */ - get speed() { - return this.animation.playbackRate; - } - set speed(newSpeed) { - // Allow backwards playback after finishing - if (newSpeed < 0) - this.finishedTime = null; - this.animation.playbackRate = newSpeed; - } - get state() { - return this.finishedTime !== null - ? "finished" - : this.animation.playState; - } - get startTime() { - return this.manualStartTime ?? Number(this.animation.startTime); - } - set startTime(newStartTime) { - this.manualStartTime = this.animation.startTime = newStartTime; - } - /** - * Attaches a timeline to the animation, for instance the `ScrollTimeline`. - */ - attachTimeline({ timeline, rangeStart, rangeEnd, observe, }) { - if (this.allowFlatten) { - this.animation.effect?.updateTiming({ easing: "linear" }); - } - this.animation.onfinish = null; - if (timeline && supportsScrollTimeline()) { - this.animation.timeline = timeline; - if (rangeStart) - this.animation.rangeStart = rangeStart; - if (rangeEnd) - this.animation.rangeEnd = rangeEnd; - return motionUtils.noop; - } - else { - return observe(this); - } - } -} - -const unsupportedEasingFunctions = { - anticipate: motionUtils.anticipate, - backInOut: motionUtils.backInOut, - circInOut: motionUtils.circInOut, -}; -function isUnsupportedEase(key) { - return key in unsupportedEasingFunctions; -} -function replaceStringEasing(transition) { - if (typeof transition.ease === "string" && - isUnsupportedEase(transition.ease)) { - transition.ease = unsupportedEasingFunctions[transition.ease]; - } -} - -/** - * 10ms is chosen here as it strikes a balance between smooth - * results (more than one keyframe per frame at 60fps) and - * keyframe quantity. - */ -const sampleDelta = 10; //ms -class NativeAnimationExtended extends NativeAnimation { - constructor(options) { - /** - * The base NativeAnimation function only supports a subset - * of Motion easings, and WAAPI also only supports some - * easing functions via string/cubic-bezier definitions. - * - * This function replaces those unsupported easing functions - * with a JS easing function. This will later get compiled - * to a linear() easing function. - */ - replaceStringEasing(options); - /** - * Ensure we replace the transition type with a generator function - * before passing to WAAPI. - * - * TODO: Does this have a better home? It could be shared with - * JSAnimation. - */ - replaceTransitionType(options); - super(options); - /** - * Only set startTime when the animation should autoplay. - * Setting startTime on a paused WAAPI animation unpauses it - * (per the WAAPI spec), which breaks autoplay: false. - */ - if (options.startTime !== undefined && options.autoplay !== false) { - this.startTime = options.startTime; - } - this.options = options; - } - /** - * WAAPI doesn't natively have any interruption capabilities. - * - * Rather than read committed styles back out of the DOM, we can - * create a renderless JS animation and sample it twice to calculate - * its current value, "previous" value, and therefore allow - * Motion to calculate velocity for any subsequent animation. - */ - updateMotionValue(value) { - const { motionValue, onUpdate, onComplete, element, ...options } = this.options; - if (!motionValue) - return; - if (value !== undefined) { - motionValue.set(value); - return; - } - const sampleAnimation = new JSAnimation({ - ...options, - autoplay: false, - }); - /** - * Use wall-clock elapsed time for sampling. - * Under CPU load, WAAPI's currentTime may not reflect actual - * elapsed time, causing incorrect sampling and visual jumps. - */ - const sampleTime = Math.max(sampleDelta, time.now() - this.startTime); - const delta = motionUtils.clamp(0, sampleDelta, sampleTime - sampleDelta); - const current = sampleAnimation.sample(sampleTime).value; - /** - * Write the estimated value to inline style so it persists - * after cancel(), covering the async gap before the next - * animation starts. - */ - const { name } = this.options; - if (element && name) - setStyle(element, name, current); - motionValue.setWithVelocity(sampleAnimation.sample(Math.max(0, sampleTime - delta)).value, current, delta); - sampleAnimation.stop(); - } -} - -/** - * Check if a value is animatable. Examples: - * - * ✅: 100, "100px", "#fff" - * ❌: "block", "url(2.jpg)" - * @param value - * - * @internal - */ -const isAnimatable = (value, name) => { - // If the list of keys that might be non-animatable grows, replace with Set - if (name === "zIndex") - return false; - // If it's a number or a keyframes array, we can animate it. We might at some point - // need to do a deep isAnimatable check of keyframes, or let Popmotion handle this, - // but for now lets leave it like this for performance reasons - if (typeof value === "number" || Array.isArray(value)) - return true; - if (typeof value === "string" && // It's animatable if we have a string - (complex.test(value) || value === "0") && // And it contains numbers and/or colors - !value.startsWith("url(") // Unless it starts with "url(" - ) { - return true; - } - return false; -}; - -function hasKeyframesChanged(keyframes) { - const current = keyframes[0]; - if (keyframes.length === 1) - return true; - for (let i = 0; i < keyframes.length; i++) { - if (keyframes[i] !== current) - return true; - } -} -function canAnimate(keyframes, name, type, velocity) { - /** - * Check if we're able to animate between the start and end keyframes, - * and throw a warning if we're attempting to animate between one that's - * animatable and another that isn't. - */ - const originKeyframe = keyframes[0]; - if (originKeyframe === null) { - return false; - } - /** - * These aren't traditionally animatable but we do support them. - * In future we could look into making this more generic or replacing - * this function with mix() === mixImmediate - */ - if (name === "display" || name === "visibility") - return true; - const targetKeyframe = keyframes[keyframes.length - 1]; - const isOriginAnimatable = isAnimatable(originKeyframe, name); - const isTargetAnimatable = isAnimatable(targetKeyframe, name); - motionUtils.warning(isOriginAnimatable === isTargetAnimatable, `You are trying to animate ${name} from "${originKeyframe}" to "${targetKeyframe}". "${isOriginAnimatable ? targetKeyframe : originKeyframe}" is not an animatable value.`, "value-not-animatable"); - // Always skip if any of these are true - if (!isOriginAnimatable || !isTargetAnimatable) { - return false; - } - return (hasKeyframesChanged(keyframes) || - ((type === "spring" || isGenerator(type)) && velocity)); -} - -function makeAnimationInstant(options) { - options.duration = 0; - options.type = "keyframes"; -} - -/** - * A list of values that can be hardware-accelerated. - */ -const acceleratedValues = new Set([ - "opacity", - "clipPath", - "filter", - "transform", - "backgroundColor", -]); - -const browserColorFunctions = /^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/; -function hasBrowserOnlyColors(keyframes) { - for (let i = 0; i < keyframes.length; i++) { - if (typeof keyframes[i] === "string" && - browserColorFunctions.test(keyframes[i])) { - return true; - } - } - return false; -} - -const colorProperties = new Set([ - "color", - "backgroundColor", - "outlineColor", - "fill", - "stroke", - "borderColor", - "borderTopColor", - "borderRightColor", - "borderBottomColor", - "borderLeftColor", -]); -const supportsWaapi = /*@__PURE__*/ motionUtils.memo(() => Object.hasOwnProperty.call(Element.prototype, "animate")); -function supportsBrowserAnimation(options) { - const { motionValue, name, repeatDelay, repeatType, damping, type, keyframes, } = options; - const subject = motionValue?.owner?.current; - /** - * We use instanceof checks instead of isHTMLElement()/isSVGElement() - * because we explicitly **don't** want elements in different timing - * contexts (i.e. popups) to be accelerated, as it's not possible to sync - * these animations properly with those driven from the main window - * frameloop. - */ - if (!(subject instanceof HTMLElement) && - !(subject instanceof SVGElement)) { - return false; - } - const { onUpdate, transformTemplate } = motionValue.owner.getProps(); - return (supportsWaapi() && - name && - /** - * Force WAAPI for color properties with browser-only color formats - * (oklch, oklab, lab, lch, etc.) that the JS animation path can't parse. - */ - (acceleratedValues.has(name) || - (colorProperties.has(name) && - hasBrowserOnlyColors(keyframes))) && - (name !== "transform" || !transformTemplate) && - /** - * If we're outputting values to onUpdate then we can't use WAAPI as there's - * no way to read the value from WAAPI every frame. - */ - !onUpdate && - !repeatDelay && - repeatType !== "mirror" && - damping !== 0 && - type !== "inertia"); -} - -/** - * Maximum time allowed between an animation being created and it being - * resolved for us to use the latter as the start time. - * - * This is to ensure that while we prefer to "start" an animation as soon - * as it's triggered, we also want to avoid a visual jump if there's a big delay - * between these two moments. - */ -const MAX_RESOLVE_DELAY = 40; -class AsyncMotionValueAnimation extends WithPromise { - constructor({ autoplay = true, delay = 0, type = "keyframes", repeat = 0, repeatDelay = 0, repeatType = "loop", keyframes, name, motionValue, element, ...options }) { - super(); - /** - * Bound to support return animation.stop pattern - */ - this.stop = () => { - if (this._animation) { - this._animation.stop(); - this.stopTimeline?.(); - } - this.keyframeResolver?.cancel(); - }; - this.createdAt = time.now(); - const optionsWithDefaults = { - autoplay, - delay, - type, - repeat, - repeatDelay, - repeatType, - name, - motionValue, - element, - ...options, - }; - const KeyframeResolver$1 = element?.KeyframeResolver || KeyframeResolver; - this.keyframeResolver = new KeyframeResolver$1(keyframes, (resolvedKeyframes, finalKeyframe, forced) => this.onKeyframesResolved(resolvedKeyframes, finalKeyframe, optionsWithDefaults, !forced), name, motionValue, element); - this.keyframeResolver?.scheduleResolve(); - } - onKeyframesResolved(keyframes, finalKeyframe, options, sync) { - this.keyframeResolver = undefined; - const { name, type, velocity, delay, isHandoff, onUpdate } = options; - this.resolvedAt = time.now(); - /** - * If we can't animate this value with the resolved keyframes - * then we should complete it immediately. - */ - let canAnimateValue = true; - if (!canAnimate(keyframes, name, type, velocity)) { - canAnimateValue = false; - if (motionUtils.MotionGlobalConfig.instantAnimations || !delay) { - onUpdate?.(getFinalKeyframe(keyframes, options, finalKeyframe)); - } - keyframes[0] = keyframes[keyframes.length - 1]; - makeAnimationInstant(options); - options.repeat = 0; - } - /** - * Resolve startTime for the animation. - * - * This method uses the createdAt and resolvedAt to calculate the - * animation startTime. *Ideally*, we would use the createdAt time as t=0 - * as the following frame would then be the first frame of the animation in - * progress, which would feel snappier. - * - * However, if there's a delay (main thread work) between the creation of - * the animation and the first committed frame, we prefer to use resolvedAt - * to avoid a sudden jump into the animation. - */ - const startTime = sync - ? !this.resolvedAt - ? this.createdAt - : this.resolvedAt - this.createdAt > MAX_RESOLVE_DELAY - ? this.resolvedAt - : this.createdAt - : undefined; - const resolvedOptions = { - startTime, - finalKeyframe, - ...options, - keyframes, - }; - /** - * Animate via WAAPI if possible. If this is a handoff animation, the optimised animation will be running via - * WAAPI. Therefore, this animation must be JS to ensure it runs "under" the - * optimised animation. - * - * Also skip WAAPI when keyframes aren't animatable, as the resolved - * values may not be valid CSS and would trigger browser warnings. - */ - const useWaapi = canAnimateValue && - !isHandoff && - supportsBrowserAnimation(resolvedOptions); - const element = resolvedOptions.motionValue?.owner?.current; - let animation; - if (useWaapi) { - try { - animation = new NativeAnimationExtended({ - ...resolvedOptions, - element, - }); - } - catch { - animation = new JSAnimation(resolvedOptions); - } - } - else { - animation = new JSAnimation(resolvedOptions); - } - animation.finished.then(() => { - this.notifyFinished(); - }).catch(motionUtils.noop); - if (this.pendingTimeline) { - this.stopTimeline = animation.attachTimeline(this.pendingTimeline); - this.pendingTimeline = undefined; - } - this._animation = animation; - } - get finished() { - if (!this._animation) { - return this._finished; - } - else { - return this.animation.finished; - } - } - then(onResolve, _onReject) { - return this.finished.finally(onResolve).then(() => { }); - } - get animation() { - if (!this._animation) { - this.keyframeResolver?.resume(); - flushKeyframeResolvers(); - } - return this._animation; - } - get duration() { - return this.animation.duration; - } - get iterationDuration() { - return this.animation.iterationDuration; - } - get time() { - return this.animation.time; - } - set time(newTime) { - this.animation.time = newTime; - } - get speed() { - return this.animation.speed; - } - get state() { - return this.animation.state; - } - set speed(newSpeed) { - this.animation.speed = newSpeed; - } - get startTime() { - return this.animation.startTime; - } - attachTimeline(timeline) { - if (this._animation) { - this.stopTimeline = this.animation.attachTimeline(timeline); - } - else { - this.pendingTimeline = timeline; - } - return () => this.stop(); - } - play() { - this.animation.play(); - } - pause() { - this.animation.pause(); - } - complete() { - this.animation.complete(); - } - cancel() { - if (this._animation) { - this.animation.cancel(); - } - this.keyframeResolver?.cancel(); - } -} - -class GroupAnimation { - constructor(animations) { - // Bound to accomadate common `return animation.stop` pattern - this.stop = () => this.runAll("stop"); - this.animations = animations.filter(Boolean); - } - get finished() { - return Promise.all(this.animations.map((animation) => animation.finished)); - } - /** - * TODO: Filter out cancelled or stopped animations before returning - */ - getAll(propName) { - return this.animations[0][propName]; - } - setAll(propName, newValue) { - for (let i = 0; i < this.animations.length; i++) { - this.animations[i][propName] = newValue; - } - } - attachTimeline(timeline) { - const subscriptions = this.animations.map((animation) => animation.attachTimeline(timeline)); - return () => { - subscriptions.forEach((cancel, i) => { - cancel && cancel(); - this.animations[i].stop(); - }); - }; - } - get time() { - return this.getAll("time"); - } - set time(time) { - this.setAll("time", time); - } - get speed() { - return this.getAll("speed"); - } - set speed(speed) { - this.setAll("speed", speed); - } - get state() { - return this.getAll("state"); - } - get startTime() { - return this.getAll("startTime"); - } - get duration() { - return getMax(this.animations, "duration"); - } - get iterationDuration() { - return getMax(this.animations, "iterationDuration"); - } - runAll(methodName) { - this.animations.forEach((controls) => controls[methodName]()); - } - play() { - this.runAll("play"); - } - pause() { - this.runAll("pause"); - } - cancel() { - this.runAll("cancel"); - } - complete() { - this.runAll("complete"); - } -} -function getMax(animations, propName) { - let max = 0; - for (let i = 0; i < animations.length; i++) { - const value = animations[i][propName]; - if (value !== null && value > max) { - max = value; - } - } - return max; -} - -class GroupAnimationWithThen extends GroupAnimation { - then(onResolve, _onReject) { - return this.finished.finally(onResolve).then(() => { }); - } -} - -class NativeAnimationWrapper extends NativeAnimation { - constructor(animation) { - super(); - this.animation = animation; - animation.onfinish = () => { - this.finishedTime = this.time; - this.notifyFinished(); - }; - } -} - -const animationMaps = new WeakMap(); -const animationMapKey = (name, pseudoElement = "") => `${name}:${pseudoElement}`; -function getAnimationMap(element) { - let map = animationMaps.get(element); - if (!map) { - map = new Map(); - animationMaps.set(element, map); - } - return map; -} - -function calcChildStagger(children, child, delayChildren, staggerChildren = 0, staggerDirection = 1) { - const index = Array.from(children) - .sort((a, b) => a.sortNodePosition(b)) - .indexOf(child); - const numChildren = children.size; - const maxStaggerDuration = (numChildren - 1) * staggerChildren; - const delayIsFunction = typeof delayChildren === "function"; - return delayIsFunction - ? delayChildren(index, numChildren) - : staggerDirection === 1 - ? index * staggerChildren - : maxStaggerDuration - index * staggerChildren; -} - -/** - * Maximum time between the value of two frames, beyond which we - * assume the velocity has since been 0. - */ -const MAX_VELOCITY_DELTA = 30; -const isFloat = (value) => { - return !isNaN(parseFloat(value)); -}; -const collectMotionValues = { - current: undefined, -}; -/** - * `MotionValue` is used to track the state and velocity of motion values. - * - * @public - */ -class MotionValue { - /** - * @param init - The initiating value - * @param config - Optional configuration options - * - * - `transformer`: A function to transform incoming values with. - */ - constructor(init, options = {}) { - /** - * Tracks whether this value can output a velocity. Currently this is only true - * if the value is numerical, but we might be able to widen the scope here and support - * other value types. - * - * @internal - */ - this.canTrackVelocity = null; - /** - * An object containing a SubscriptionManager for each active event. - */ - this.events = {}; - this.updateAndNotify = (v) => { - const currentTime = time.now(); - /** - * If we're updating the value during another frame or eventloop - * than the previous frame, then the we set the previous frame value - * to current. - */ - if (this.updatedAt !== currentTime) { - this.setPrevFrameValue(); - } - this.prev = this.current; - this.setCurrent(v); - // Update update subscribers - if (this.current !== this.prev) { - this.events.change?.notify(this.current); - if (this.dependents) { - for (const dependent of this.dependents) { - dependent.dirty(); - } - } - } - }; - this.hasAnimated = false; - this.setCurrent(init); - this.owner = options.owner; - } - setCurrent(current) { - this.current = current; - this.updatedAt = time.now(); - if (this.canTrackVelocity === null && current !== undefined) { - this.canTrackVelocity = isFloat(this.current); - } - } - setPrevFrameValue(prevFrameValue = this.current) { - this.prevFrameValue = prevFrameValue; - this.prevUpdatedAt = this.updatedAt; - } - /** - * Adds a function that will be notified when the `MotionValue` is updated. - * - * It returns a function that, when called, will cancel the subscription. - * - * When calling `onChange` inside a React component, it should be wrapped with the - * `useEffect` hook. As it returns an unsubscribe function, this should be returned - * from the `useEffect` function to ensure you don't add duplicate subscribers.. - * - * ```jsx - * export const MyComponent = () => { - * const x = useMotionValue(0) - * const y = useMotionValue(0) - * const opacity = useMotionValue(1) - * - * useEffect(() => { - * function updateOpacity() { - * const maxXY = Math.max(x.get(), y.get()) - * const newOpacity = transform(maxXY, [0, 100], [1, 0]) - * opacity.set(newOpacity) - * } - * - * const unsubscribeX = x.on("change", updateOpacity) - * const unsubscribeY = y.on("change", updateOpacity) - * - * return () => { - * unsubscribeX() - * unsubscribeY() - * } - * }, []) - * - * return - * } - * ``` - * - * @param subscriber - A function that receives the latest value. - * @returns A function that, when called, will cancel this subscription. - * - * @deprecated - */ - onChange(subscription) { - if (process.env.NODE_ENV !== "production") { - motionUtils.warnOnce(false, `value.onChange(callback) is deprecated. Switch to value.on("change", callback).`); - } - return this.on("change", subscription); - } - on(eventName, callback) { - if (!this.events[eventName]) { - this.events[eventName] = new motionUtils.SubscriptionManager(); - } - const unsubscribe = this.events[eventName].add(callback); - if (eventName === "change") { - return () => { - unsubscribe(); - /** - * If we have no more change listeners by the start - * of the next frame, stop active animations. - */ - frame.read(() => { - if (!this.events.change.getSize()) { - this.stop(); - } - }); - }; - } - return unsubscribe; - } - clearListeners() { - for (const eventManagers in this.events) { - this.events[eventManagers].clear(); - } - } - /** - * Attaches a passive effect to the `MotionValue`. - */ - attach(passiveEffect, stopPassiveEffect) { - this.passiveEffect = passiveEffect; - this.stopPassiveEffect = stopPassiveEffect; - } - /** - * Sets the state of the `MotionValue`. - * - * @remarks - * - * ```jsx - * const x = useMotionValue(0) - * x.set(10) - * ``` - * - * @param latest - Latest value to set. - * @param render - Whether to notify render subscribers. Defaults to `true` - * - * @public - */ - set(v) { - if (!this.passiveEffect) { - this.updateAndNotify(v); - } - else { - this.passiveEffect(v, this.updateAndNotify); - } - } - setWithVelocity(prev, current, delta) { - this.set(current); - this.prev = undefined; - this.prevFrameValue = prev; - this.prevUpdatedAt = this.updatedAt - delta; - } - /** - * Set the state of the `MotionValue`, stopping any active animations, - * effects, and resets velocity to `0`. - */ - jump(v, endAnimation = true) { - this.updateAndNotify(v); - this.prev = v; - this.prevUpdatedAt = this.prevFrameValue = undefined; - endAnimation && this.stop(); - if (this.stopPassiveEffect) - this.stopPassiveEffect(); - } - dirty() { - this.events.change?.notify(this.current); - } - addDependent(dependent) { - if (!this.dependents) { - this.dependents = new Set(); - } - this.dependents.add(dependent); - } - removeDependent(dependent) { - if (this.dependents) { - this.dependents.delete(dependent); - } - } - /** - * Returns the latest state of `MotionValue` - * - * @returns - The latest state of `MotionValue` - * - * @public - */ - get() { - if (collectMotionValues.current) { - collectMotionValues.current.push(this); - } - return this.current; - } - /** - * @public - */ - getPrevious() { - return this.prev; - } - /** - * Returns the latest velocity of `MotionValue` - * - * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical. - * - * @public - */ - getVelocity() { - const currentTime = time.now(); - if (!this.canTrackVelocity || - this.prevFrameValue === undefined || - currentTime - this.updatedAt > MAX_VELOCITY_DELTA) { - return 0; - } - const delta = Math.min(this.updatedAt - this.prevUpdatedAt, MAX_VELOCITY_DELTA); - // Casts because of parseFloat's poor typing - return motionUtils.velocityPerSecond(parseFloat(this.current) - - parseFloat(this.prevFrameValue), delta); - } - /** - * Registers a new animation to control this `MotionValue`. Only one - * animation can drive a `MotionValue` at one time. - * - * ```jsx - * value.start() - * ``` - * - * @param animation - A function that starts the provided animation - */ - start(startAnimation) { - this.stop(); - return new Promise((resolve) => { - this.hasAnimated = true; - this.animation = startAnimation(resolve); - if (this.events.animationStart) { - this.events.animationStart.notify(); - } - }).then(() => { - if (this.events.animationComplete) { - this.events.animationComplete.notify(); - } - this.clearAnimation(); - }); - } - /** - * Stop the currently active animation. - * - * @public - */ - stop() { - if (this.animation) { - this.animation.stop(); - if (this.events.animationCancel) { - this.events.animationCancel.notify(); - } - } - this.clearAnimation(); - } - /** - * Returns `true` if this value is currently animating. - * - * @public - */ - isAnimating() { - return !!this.animation; - } - clearAnimation() { - delete this.animation; - } - /** - * Destroy and clean up subscribers to this `MotionValue`. - * - * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically - * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually - * created a `MotionValue` via the `motionValue` function. - * - * @public - */ - destroy() { - this.dependents?.clear(); - this.events.destroy?.notify(); - this.clearListeners(); - this.stop(); - if (this.stopPassiveEffect) { - this.stopPassiveEffect(); - } - } -} -function motionValue(init, options) { - return new MotionValue(init, options); -} - -/** - * If `transition` has `inherit: true`, shallow-merge it with - * `parentTransition` (child keys win) and strip the `inherit` key. - * Otherwise return `transition` unchanged. - */ -function resolveTransition(transition, parentTransition) { - if (transition?.inherit && parentTransition) { - const { inherit: _, ...rest } = transition; - return { ...parentTransition, ...rest }; - } - return transition; -} - -function getValueTransition(transition, key) { - const valueTransition = transition?.[key] ?? - transition?.["default"] ?? - transition; - if (valueTransition !== transition) { - return resolveTransition(valueTransition, transition); - } - return valueTransition; -} - -const underDampedSpring = { - type: "spring", - stiffness: 500, - damping: 25, - restSpeed: 10, -}; -const criticallyDampedSpring = (target) => ({ - type: "spring", - stiffness: 550, - damping: target === 0 ? 2 * Math.sqrt(550) : 30, - restSpeed: 10, -}); -const keyframesTransition = { - type: "keyframes", - duration: 0.8, -}; -/** - * Default easing curve is a slightly shallower version of - * the default browser easing curve. - */ -const ease = { - type: "keyframes", - ease: [0.25, 0.1, 0.35, 1], - duration: 0.3, -}; -const getDefaultTransition = (valueKey, { keyframes }) => { - if (keyframes.length > 2) { - return keyframesTransition; - } - else if (transformProps.has(valueKey)) { - return valueKey.startsWith("scale") - ? criticallyDampedSpring(keyframes[1]) - : underDampedSpring; - } - return ease; -}; - -const orchestrationKeys = new Set([ - "when", - "delay", - "delayChildren", - "staggerChildren", - "staggerDirection", - "repeat", - "repeatType", - "repeatDelay", - "from", - "elapsed", -]); -/** - * Decide whether a transition is defined on a given Transition. - * This filters out orchestration options and returns true - * if any options are left. - */ -function isTransitionDefined(transition) { - for (const key in transition) { - if (!orchestrationKeys.has(key)) - return true; - } - return false; -} - -const animateMotionValue = (name, value, target, transition = {}, element, isHandoff) => (onComplete) => { - const valueTransition = getValueTransition(transition, name) || {}; - /** - * Most transition values are currently completely overwritten by value-specific - * transitions. In the future it'd be nicer to blend these transitions. But for now - * delay actually does inherit from the root transition if not value-specific. - */ - const delay = valueTransition.delay || transition.delay || 0; - /** - * Elapsed isn't a public transition option but can be passed through from - * optimized appear effects in milliseconds. - */ - let { elapsed = 0 } = transition; - elapsed = elapsed - motionUtils.secondsToMilliseconds(delay); - const options = { - keyframes: Array.isArray(target) ? target : [null, target], - ease: "easeOut", - velocity: value.getVelocity(), - ...valueTransition, - delay: -elapsed, - onUpdate: (v) => { - value.set(v); - valueTransition.onUpdate && valueTransition.onUpdate(v); - }, - onComplete: () => { - onComplete(); - valueTransition.onComplete && valueTransition.onComplete(); - }, - name, - motionValue: value, - element: isHandoff ? undefined : element, - }; - /** - * If there's no transition defined for this value, we can generate - * unique transition settings for this value. - */ - if (!isTransitionDefined(valueTransition)) { - Object.assign(options, getDefaultTransition(name, options)); - } - /** - * Both WAAPI and our internal animation functions use durations - * as defined by milliseconds, while our external API defines them - * as seconds. - */ - options.duration && (options.duration = motionUtils.secondsToMilliseconds(options.duration)); - options.repeatDelay && (options.repeatDelay = motionUtils.secondsToMilliseconds(options.repeatDelay)); - /** - * Support deprecated way to set initial value. Prefer keyframe syntax. - */ - if (options.from !== undefined) { - options.keyframes[0] = options.from; - } - let shouldSkip = false; - if (options.type === false || - (options.duration === 0 && !options.repeatDelay)) { - makeAnimationInstant(options); - if (options.delay === 0) { - shouldSkip = true; - } - } - if (motionUtils.MotionGlobalConfig.instantAnimations || - motionUtils.MotionGlobalConfig.skipAnimations || - element?.shouldSkipAnimations || - valueTransition.skipAnimations) { - shouldSkip = true; - makeAnimationInstant(options); - options.delay = 0; - } - /** - * If the transition type or easing has been explicitly set by the user - * then we don't want to allow flattening the animation. - */ - options.allowFlatten = !valueTransition.type && !valueTransition.ease; - /** - * If we can or must skip creating the animation, and apply only - * the final keyframe, do so. We also check once keyframes are resolved but - * this early check prevents the need to create an animation at all. - */ - if (shouldSkip && !isHandoff && value.get() !== undefined) { - const finalKeyframe = getFinalKeyframe(options.keyframes, valueTransition); - if (finalKeyframe !== undefined) { - frame.update(() => { - options.onUpdate(finalKeyframe); - options.onComplete(); - }); - return; - } - } - return valueTransition.isSync - ? new JSAnimation(options) - : new AsyncMotionValueAnimation(options); -}; - -const MIN_LAYOUT_DISTANCE = 20; -function bezierPoint(t, origin, control, target) { - const inv = 1 - t; - return inv * inv * origin + 2 * inv * t * control + t * t * target; -} -function bezierTangentAngle(t, originX, controlX, targetX, originY, controlY, targetY) { - const dx = 2 * (1 - t) * (controlX - originX) + 2 * t * (targetX - controlX); - const dy = 2 * (1 - t) * (controlY - originY) + 2 * t * (targetY - controlY); - return Math.atan2(dy, dx) * (180 / Math.PI); -} -function computeArcControlPoint(fromX, fromY, toX, toY, strength, peak) { - const deltaX = toX - fromX; - const deltaY = toY - fromY; - const distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY); - if (distance > 0) { - const normalPerpX = -deltaY / distance; - const normalPerpY = deltaX / distance; - const desiredHeight = strength * distance; - return { - x: fromX + deltaX * peak + normalPerpX * desiredHeight, - y: fromY + deltaY * peak + normalPerpY * desiredHeight, - }; - } - return { x: fromX, y: fromY }; -} -/** - * The pure sampling factory: `(from, to) => (t) => point`. Internal — - * used by {@link arc} and the unit tests. Not part of the public surface. - */ -function createArcPath({ strength = 0.5, peak = 0.5, direction, rotate = false, } = {}) { - const rotationScale = rotate === true ? 1 : typeof rotate === "number" ? rotate : 0; - // Auto-direction only: persists across calls to flip the bulge back - // onto the same screen side when the dominant axis changes between - // calls. Reuse the factory (module scope / useMemo) to keep this alive. - let prevBulgeSign; - const createInterpolator = (from, to) => { - const dx = to.x - from.x; - const dy = to.y - from.y; - let signed; - if (direction === "cw") { - signed = -strength; - } - else if (direction === "ccw") { - signed = strength; - } - else { - const dom = Math.abs(dx) >= Math.abs(dy) ? dx : dy; - signed = dom < 0 ? -strength : strength; - } - let control = computeArcControlPoint(from.x, from.y, to.x, to.y, signed, peak); - if (direction === undefined) { - const isVertical = Math.abs(dx) < Math.abs(dy); - const midX = from.x + dx * peak; - const midY = from.y + dy * peak; - const bulgeSign = isVertical - ? Math.sign(control.x - midX) - : Math.sign(control.y - midY); - if (prevBulgeSign !== undefined && - bulgeSign !== 0 && - bulgeSign !== prevBulgeSign) { - signed = -signed; - control = computeArcControlPoint(from.x, from.y, to.x, to.y, signed, peak); - } - else if (bulgeSign !== 0) { - prevBulgeSign = bulgeSign; - } - } - const tangent0 = rotationScale - ? bezierTangentAngle(0, from.x, control.x, to.x, from.y, control.y, to.y) - : 0; - const tangent1 = rotationScale - ? bezierTangentAngle(1, from.x, control.x, to.x, from.y, control.y, to.y) - : 0; - const tangentDelta = rotationScale - ? motionUtils.wrap(-180, 180, tangent1 - tangent0) - : 0; - return (t) => { - const out = { - x: bezierPoint(t, from.x, control.x, to.x), - y: bezierPoint(t, from.y, control.y, to.y), - }; - if (rotationScale) { - const raw = bezierTangentAngle(t, from.x, control.x, to.x, from.y, control.y, to.y); - const baseline = tangent0 + tangentDelta * t; - out.rotate = motionUtils.wrap(-180, 180, raw - baseline) * rotationScale; - } - return out; - }; - }; - return createInterpolator; -} -/** - * Creates a curved path for `transition.path`: - * - * ```ts - * - * ``` - * - * Reuse the returned value (module scope / useMemo / useRef) so its - * continuity closure survives re-renders — a fresh `arc()` has no memory. - */ -function arc(options = {}) { - const sample = createArcPath(options); - const path = { - interpolateProjection(delta) { - // `from` is the current translate offset (carries any in-flight - // displacement when interrupted); `to` is the new layout origin. - // The distance floor avoids visible wobble on tiny shifts. - const tx = delta.x.translate; - const ty = delta.y.translate; - if (Math.sqrt(tx * tx + ty * ty) < MIN_LAYOUT_DISTANCE) { - return undefined; - } - return sample({ x: tx, y: ty }, { x: 0, y: 0 }); - }, - animateVisualElement(visualElement, target, transition, delay, animations) { - if (!("x" in target || "y" in target)) - return; - const xValue = visualElement.getValue("x", visualElement.latestValues["x"] ?? 0); - const yValue = visualElement.getValue("y", visualElement.latestValues["y"] ?? 0); - const xRaw = target.x; - const yRaw = target.y; - const xFrom = (Array.isArray(xRaw) && xRaw[0] != null - ? xRaw[0] - : xValue?.get()) ?? 0; - const yFrom = (Array.isArray(yRaw) && yRaw[0] != null - ? yRaw[0] - : yValue?.get()) ?? 0; - const xTo = (Array.isArray(xRaw) - ? xRaw[xRaw.length - 1] - : xRaw ?? xFrom); - const yTo = (Array.isArray(yRaw) - ? yRaw[yRaw.length - 1] - : yRaw ?? yFrom); - // Interruption needs no flag: x/y already hold the displaced - // mid-arc position, so xFrom/yFrom carry the continuity geometry. - const interpolate = sample({ x: xFrom, y: yFrom }, { x: xTo, y: yTo }); - // Drive a dedicated `pathRotation` value (composed onto `rotate` - // at the build sites) rather than `rotate` itself, so a - // concurrent rotate animation composes and nothing accumulates - // on interrupt. - const pathRotationValue = interpolate(0).rotate !== undefined - ? visualElement.getValue("pathRotation", 0) - : undefined; - const pathTransition = { - delay, - ...getValueTransition(transition || {}, "x"), - }; - delete pathTransition.path; - const progress = motionValue(0); - progress.start(animateMotionValue("", progress, [0, 1000], { - ...pathTransition, - isSync: true, - velocity: 0, - onUpdate: (latest) => { - const point = interpolate(latest / 1000); - xValue?.set(point.x); - yValue?.set(point.y); - if (pathRotationValue && point.rotate !== undefined) { - pathRotationValue.set(point.rotate); - } - }, - onComplete: () => { - xValue?.set(xTo); - yValue?.set(yTo); - pathRotationValue?.set(0); - }, - // Interrupt/cancel must clear our additive contribution - // so it can't linger on top of the user's `rotate`. - onStop: () => pathRotationValue?.set(0), - onCancel: () => pathRotationValue?.set(0), - })); - if (progress.animation) - animations.push(progress.animation); - delete target.x; - delete target.y; - }, - }; - return path; -} - -/** - * Parse Framer's special CSS variable format into a CSS token and a fallback. - * - * ``` - * `var(--foo, #fff)` => [`--foo`, '#fff'] - * ``` - * - * @param current - */ -const splitCSSVariableRegex = -// eslint-disable-next-line redos-detector/no-unsafe-regex -- false positive, as it can match a lot of words -/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u; -function parseCSSVariable(current) { - const match = splitCSSVariableRegex.exec(current); - if (!match) - return [,]; - const [, token1, token2, fallback] = match; - return [`--${token1 ?? token2}`, fallback]; -} -const maxDepth = 4; -function getVariableValue(current, element, depth = 1) { - motionUtils.invariant(depth <= maxDepth, `Max CSS variable fallback depth detected in property "${current}". This may indicate a circular fallback dependency.`, "max-css-var-depth"); - const [token, fallback] = parseCSSVariable(current); - // No CSS variable detected - if (!token) - return; - // Attempt to read this CSS variable off the element - const resolved = window.getComputedStyle(element).getPropertyValue(token); - if (resolved) { - const trimmed = resolved.trim(); - return motionUtils.isNumericalString(trimmed) ? parseFloat(trimmed) : trimmed; - } - return isCSSVariableToken(fallback) - ? getVariableValue(fallback, element, depth + 1) - : fallback; -} - -function getValueState(visualElement) { - const state = [{}, {}]; - visualElement?.values.forEach((value, key) => { - state[0][key] = value.get(); - state[1][key] = value.getVelocity(); - }); - return state; -} -function resolveVariantFromProps(props, definition, custom, visualElement) { - /** - * If the variant definition is a function, resolve. - */ - if (typeof definition === "function") { - const [current, velocity] = getValueState(visualElement); - definition = definition(custom !== undefined ? custom : props.custom, current, velocity); - } - /** - * If the variant definition is a variant label, or - * the function returned a variant label, resolve. - */ - if (typeof definition === "string") { - definition = props.variants && props.variants[definition]; - } - /** - * At this point we've resolved both functions and variant labels, - * but the resolved variant label might itself have been a function. - * If so, resolve. This can only have returned a valid target object. - */ - if (typeof definition === "function") { - const [current, velocity] = getValueState(visualElement); - definition = definition(custom !== undefined ? custom : props.custom, current, velocity); - } - return definition; -} - -function resolveVariant(visualElement, definition, custom) { - const props = visualElement.getProps(); - return resolveVariantFromProps(props, definition, custom !== undefined ? custom : props.custom, visualElement); -} - -const positionalKeys = new Set([ - "width", - "height", - "top", - "left", - "right", - "bottom", - ...transformPropOrder, -]); - -const isKeyframesTarget = (v) => { - return Array.isArray(v); -}; - -/** - * Set VisualElement's MotionValue, creating a new MotionValue for it if - * it doesn't exist. - */ -function setMotionValue(visualElement, key, value) { - if (visualElement.hasValue(key)) { - visualElement.getValue(key).set(value); - } - else { - visualElement.addValue(key, motionValue(value)); - } -} -function resolveFinalValueInKeyframes(v) { - // TODO maybe throw if v.length - 1 is placeholder token? - return isKeyframesTarget(v) ? v[v.length - 1] || 0 : v; -} -function setTarget(visualElement, definition) { - const resolved = resolveVariant(visualElement, definition); - let { transitionEnd = {}, transition = {}, ...target } = resolved || {}; - target = { ...target, ...transitionEnd }; - for (const key in target) { - const value = resolveFinalValueInKeyframes(target[key]); - setMotionValue(visualElement, key, value); - } -} - -const isMotionValue = (value) => Boolean(value && value.getVelocity); - -function isWillChangeMotionValue(value) { - return Boolean(isMotionValue(value) && value.add); -} - -function addValueToWillChange(visualElement, key) { - const willChange = visualElement.getValue("willChange"); - /** - * It could be that a user has set willChange to a regular MotionValue, - * in which case we can't add the value to it. - */ - if (isWillChangeMotionValue(willChange)) { - return willChange.add(key); - } - else if (!willChange && motionUtils.MotionGlobalConfig.WillChange) { - const newWillChange = new motionUtils.MotionGlobalConfig.WillChange("auto"); - visualElement.addValue("willChange", newWillChange); - newWillChange.add(key); - } -} - -function camelToDash(str) { - return str.replace(/([A-Z])/g, (match) => `-${match.toLowerCase()}`); -} - -const optimizedAppearDataId = "framerAppearId"; -const optimizedAppearDataAttribute = "data-" + camelToDash(optimizedAppearDataId); - -function getOptimisedAppearId(visualElement) { - return visualElement.props[optimizedAppearDataAttribute]; -} - -/** - * Decide whether we should block this animation. Previously, we achieved this - * just by checking whether the key was listed in protectedKeys, but this - * posed problems if an animation was triggered by afterChildren and protectedKeys - * had been set to true in the meantime. - */ -function shouldBlockAnimation({ protectedKeys, needsAnimating }, key) { - const shouldBlock = protectedKeys.hasOwnProperty(key) && needsAnimating[key] !== true; - needsAnimating[key] = false; - return shouldBlock; -} -function animateTarget(visualElement, targetAndTransition, { delay = 0, transitionOverride, type } = {}) { - let { transition, transitionEnd, ...target } = targetAndTransition; - const defaultTransition = visualElement.getDefaultTransition(); - transition = transition - ? resolveTransition(transition, defaultTransition) - : defaultTransition; - const reduceMotion = transition?.reduceMotion; - const skipAnimations = transition?.skipAnimations; - if (transitionOverride) - transition = transitionOverride; - const animations = []; - const animationTypeState = type && - visualElement.animationState && - visualElement.animationState.getState()[type]; - const path = transition?.path; - if (path) { - // path mutates `target` to claim x/y; loop below skips them. - path.animateVisualElement(visualElement, target, transition, delay, animations); - } - for (const key in target) { - const value = visualElement.getValue(key, visualElement.latestValues[key] ?? null); - const valueTarget = target[key]; - if (valueTarget === undefined || - (animationTypeState && - shouldBlockAnimation(animationTypeState, key))) { - continue; - } - const valueTransition = { - delay, - ...getValueTransition(transition || {}, key), - }; - if (skipAnimations) - valueTransition.skipAnimations = true; - /** - * If the value is already at the defined target, skip the animation. - * We still re-assert the value via frame.update to take precedence - * over any stale transitionEnd callbacks from previous animations. - */ - const currentValue = value.get(); - if (currentValue !== undefined && - !value.isAnimating() && - !Array.isArray(valueTarget) && - valueTarget === currentValue && - !valueTransition.velocity) { - frame.update(() => value.set(valueTarget)); - continue; - } - /** - * If this is the first time a value is being animated, check - * to see if we're handling off from an existing animation. - */ - let isHandoff = false; - if (window.MotionHandoffAnimation) { - const appearId = getOptimisedAppearId(visualElement); - if (appearId) { - const startTime = window.MotionHandoffAnimation(appearId, key, frame); - if (startTime !== null) { - valueTransition.startTime = startTime; - isHandoff = true; - } - } - } - addValueToWillChange(visualElement, key); - const shouldReduceMotion = reduceMotion ?? visualElement.shouldReduceMotion; - value.start(animateMotionValue(key, value, valueTarget, shouldReduceMotion && positionalKeys.has(key) - ? { type: false } - : valueTransition, visualElement, isHandoff)); - const animation = value.animation; - if (animation) { - animations.push(animation); - } - } - if (transitionEnd) { - const applyTransitionEnd = () => frame.update(() => { - transitionEnd && setTarget(visualElement, transitionEnd); - }); - if (animations.length) { - Promise.all(animations).then(applyTransitionEnd); - } - else { - applyTransitionEnd(); - } - } - return animations; -} - -function animateVariant(visualElement, variant, options = {}) { - const resolved = resolveVariant(visualElement, variant, options.type === "exit" - ? visualElement.presenceContext?.custom - : undefined); - let { transition = visualElement.getDefaultTransition() || {} } = resolved || {}; - if (options.transitionOverride) { - transition = options.transitionOverride; - } - /** - * If we have a variant, create a callback that runs it as an animation. - * Otherwise, we resolve a Promise immediately for a composable no-op. - */ - const getAnimation = resolved - ? () => Promise.all(animateTarget(visualElement, resolved, options)) - : () => Promise.resolve(); - /** - * If we have children, create a callback that runs all their animations. - * Otherwise, we resolve a Promise immediately for a composable no-op. - */ - const getChildAnimations = visualElement.variantChildren && visualElement.variantChildren.size - ? (forwardDelay = 0) => { - const { delayChildren = 0, staggerChildren, staggerDirection, } = transition; - return animateChildren(visualElement, variant, forwardDelay, delayChildren, staggerChildren, staggerDirection, options); - } - : () => Promise.resolve(); - /** - * If the transition explicitly defines a "when" option, we need to resolve either - * this animation or all children animations before playing the other. - */ - const { when } = transition; - if (when) { - const [first, last] = when === "beforeChildren" - ? [getAnimation, getChildAnimations] - : [getChildAnimations, getAnimation]; - return first().then(() => last()); - } - else { - return Promise.all([getAnimation(), getChildAnimations(options.delay)]); - } -} -function animateChildren(visualElement, variant, delay = 0, delayChildren = 0, staggerChildren = 0, staggerDirection = 1, options) { - const animations = []; - for (const child of visualElement.variantChildren) { - child.notify("AnimationStart", variant); - animations.push(animateVariant(child, variant, { - ...options, - delay: delay + - (typeof delayChildren === "function" ? 0 : delayChildren) + - calcChildStagger(visualElement.variantChildren, child, delayChildren, staggerChildren, staggerDirection), - }).then(() => child.notify("AnimationComplete", variant))); - } - return Promise.all(animations); -} - -function animateVisualElement(visualElement, definition, options = {}) { - visualElement.notify("AnimationStart", definition); - let animation; - if (Array.isArray(definition)) { - const animations = definition.map((variant) => animateVariant(visualElement, variant, options)); - animation = Promise.all(animations); - } - else if (typeof definition === "string") { - animation = animateVariant(visualElement, definition, options); - } - else { - const resolvedDefinition = typeof definition === "function" - ? resolveVariant(visualElement, definition, options.custom) - : definition; - animation = Promise.all(animateTarget(visualElement, resolvedDefinition, options)); - } - return animation.then(() => { - visualElement.notify("AnimationComplete", definition); - }); -} - -/** - * ValueType for "auto" - */ -const auto = { - test: (v) => v === "auto", - parse: (v) => v, -}; - -/** - * Tests a provided value against a ValueType - */ -const testValueType = (v) => (type) => type.test(v); - -/** - * A list of value types commonly used for dimensions - */ -const dimensionValueTypes = [number, px, percent, degrees, vw, vh, auto]; -/** - * Tests a dimensional value against the list of dimension ValueTypes - */ -const findDimensionValueType = (v) => dimensionValueTypes.find(testValueType(v)); - -function isNone(value) { - if (typeof value === "number") { - return value === 0; - } - else if (value !== null) { - return value === "none" || value === "0" || motionUtils.isZeroValueString(value); - } - else { - return true; - } -} - -/** - * Properties that should default to 1 or 100% - */ -const maxDefaults = new Set(["brightness", "contrast", "saturate", "opacity"]); -function applyDefaultFilter(v) { - const [name, value] = v.slice(0, -1).split("("); - if (name === "drop-shadow") - return v; - const [number] = value.match(floatRegex) || []; - if (!number) - return v; - const unit = value.replace(number, ""); - let defaultValue = maxDefaults.has(name) ? 1 : 0; - if (number !== value) - defaultValue *= 100; - return name + "(" + defaultValue + unit + ")"; -} -const functionRegex = /\b([a-z-]*)\(.*?\)/gu; -const filter = { - ...complex, - getAnimatableNone: (v) => { - const functions = v.match(functionRegex); - return functions ? functions.map(applyDefaultFilter).join(" ") : v; - }, -}; - -const mask = { - ...complex, - getAnimatableNone: (v) => { - const parsed = complex.parse(v); - const transformer = complex.createTransformer(v); - return transformer(parsed.map((v) => typeof v === "number" ? 0 : typeof v === "object" ? { ...v, alpha: 1 } : v)); - }, -}; - -const int = { - ...number, - transform: Math.round, -}; - -const transformValueTypes = { - rotate: degrees, - /** - * Internal channel for `transition.path` orientToPath. Composed onto - * `rotate` at the transform-build sites so the user's `rotate` is - * never read or overwritten. Not part of `transformPropOrder`. - */ - pathRotation: degrees, - rotateX: degrees, - rotateY: degrees, - rotateZ: degrees, - scale, - scaleX: scale, - scaleY: scale, - scaleZ: scale, - skew: degrees, - skewX: degrees, - skewY: degrees, - distance: px, - translateX: px, - translateY: px, - translateZ: px, - x: px, - y: px, - z: px, - perspective: px, - transformPerspective: px, - opacity: alpha, - originX: progressPercentage, - originY: progressPercentage, - originZ: px, -}; - -const numberValueTypes = { - // Border props - borderWidth: px, - borderTopWidth: px, - borderRightWidth: px, - borderBottomWidth: px, - borderLeftWidth: px, - borderRadius: px, - borderTopLeftRadius: px, - borderTopRightRadius: px, - borderBottomRightRadius: px, - borderBottomLeftRadius: px, - // Positioning props - width: px, - maxWidth: px, - height: px, - maxHeight: px, - top: px, - right: px, - bottom: px, - left: px, - inset: px, - insetBlock: px, - insetBlockStart: px, - insetBlockEnd: px, - insetInline: px, - insetInlineStart: px, - insetInlineEnd: px, - // Spacing props - padding: px, - paddingTop: px, - paddingRight: px, - paddingBottom: px, - paddingLeft: px, - paddingBlock: px, - paddingBlockStart: px, - paddingBlockEnd: px, - paddingInline: px, - paddingInlineStart: px, - paddingInlineEnd: px, - margin: px, - marginTop: px, - marginRight: px, - marginBottom: px, - marginLeft: px, - marginBlock: px, - marginBlockStart: px, - marginBlockEnd: px, - marginInline: px, - marginInlineStart: px, - marginInlineEnd: px, - // Typography - fontSize: px, - // Misc - backgroundPositionX: px, - backgroundPositionY: px, - ...transformValueTypes, - zIndex: int, - // SVG - fillOpacity: alpha, - strokeOpacity: alpha, - numOctaves: int, -}; - -/** - * A map of default value types for common values - */ -const defaultValueTypes = { - ...numberValueTypes, - // Color props - color, - backgroundColor: color, - outlineColor: color, - fill: color, - stroke: color, - // Border props - borderColor: color, - borderTopColor: color, - borderRightColor: color, - borderBottomColor: color, - borderLeftColor: color, - filter, - WebkitFilter: filter, - mask, - WebkitMask: mask, -}; -/** - * Gets the default ValueType for the provided value key - */ -const getDefaultValueType = (key) => defaultValueTypes[key]; - -const customTypes = /*@__PURE__*/ new Set([filter, mask]); -function getAnimatableNone(key, value) { - let defaultValueType = getDefaultValueType(key); - if (!customTypes.has(defaultValueType)) - defaultValueType = complex; - // If value is not recognised as animatable, ie "none", create an animatable version origin based on the target - return defaultValueType.getAnimatableNone - ? defaultValueType.getAnimatableNone(value) - : undefined; -} - -/** - * If we encounter keyframes like "none" or "0" and we also have keyframes like - * "#fff" or "200px 200px" we want to find a keyframe to serve as a template for - * the "none" keyframes. In this case "#fff" or "200px 200px" - then these get turned into - * zero equivalents, i.e. "#fff0" or "0px 0px". - */ -const invalidTemplates = new Set(["auto", "none", "0"]); -function makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, name) { - let i = 0; - let animatableTemplate = undefined; - while (i < unresolvedKeyframes.length && !animatableTemplate) { - const keyframe = unresolvedKeyframes[i]; - if (typeof keyframe === "string" && - !invalidTemplates.has(keyframe) && - analyseComplexValue(keyframe).values.length) { - animatableTemplate = unresolvedKeyframes[i]; - } - i++; - } - if (animatableTemplate && name) { - for (const noneIndex of noneKeyframeIndexes) { - unresolvedKeyframes[noneIndex] = getAnimatableNone(name, animatableTemplate); - } - } -} - -class DOMKeyframesResolver extends KeyframeResolver { - constructor(unresolvedKeyframes, onComplete, name, motionValue, element) { - super(unresolvedKeyframes, onComplete, name, motionValue, element, true); - } - readKeyframes() { - const { unresolvedKeyframes, element, name } = this; - if (!element || !element.current) - return; - super.readKeyframes(); - /** - * If any keyframe is a CSS variable, we need to find its value by sampling the element - */ - for (let i = 0; i < unresolvedKeyframes.length; i++) { - let keyframe = unresolvedKeyframes[i]; - if (typeof keyframe === "string") { - keyframe = keyframe.trim(); - if (isCSSVariableToken(keyframe)) { - const resolved = getVariableValue(keyframe, element.current); - if (resolved !== undefined) { - unresolvedKeyframes[i] = resolved; - } - if (i === unresolvedKeyframes.length - 1) { - this.finalKeyframe = keyframe; - } - } - } - } - /** - * Resolve "none" values. We do this potentially twice - once before and once after measuring keyframes. - * This could be seen as inefficient but it's a trade-off to avoid measurements in more situations, which - * have a far bigger performance impact. - */ - this.resolveNoneKeyframes(); - /** - * Check to see if unit type has changed. If so schedule jobs that will - * temporarily set styles to the destination keyframes. - * Skip if we have more than two keyframes or this isn't a positional value. - * TODO: We can throw if there are multiple keyframes and the value type changes. - */ - if (!positionalKeys.has(name) || unresolvedKeyframes.length !== 2) { - return; - } - const [origin, target] = unresolvedKeyframes; - const originType = findDimensionValueType(origin); - const targetType = findDimensionValueType(target); - /** - * If one keyframe contains embedded CSS variables (e.g. in calc()) and the other - * doesn't, we need to measure to convert to pixels. This handles GitHub issue #3410. - */ - const originHasVar = containsCSSVariable(origin); - const targetHasVar = containsCSSVariable(target); - if (originHasVar !== targetHasVar && positionalValues[name]) { - this.needsMeasurement = true; - return; - } - /** - * Either we don't recognise these value types or we can animate between them. - */ - if (originType === targetType) - return; - /** - * If both values are numbers or pixels, we can animate between them by - * converting them to numbers. - */ - if (isNumOrPxType(originType) && isNumOrPxType(targetType)) { - for (let i = 0; i < unresolvedKeyframes.length; i++) { - const value = unresolvedKeyframes[i]; - if (typeof value === "string") { - unresolvedKeyframes[i] = parseFloat(value); - } - } - } - else if (positionalValues[name]) { - /** - * Else, the only way to resolve this is by measuring the element. - */ - this.needsMeasurement = true; - } - } - resolveNoneKeyframes() { - const { unresolvedKeyframes, name } = this; - const noneKeyframeIndexes = []; - for (let i = 0; i < unresolvedKeyframes.length; i++) { - if (unresolvedKeyframes[i] === null || - isNone(unresolvedKeyframes[i])) { - noneKeyframeIndexes.push(i); - } - } - if (noneKeyframeIndexes.length) { - makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, name); - } - } - measureInitialState() { - const { element, unresolvedKeyframes, name } = this; - if (!element || !element.current) - return; - if (name === "height") { - this.suspendedScrollY = window.pageYOffset; - } - this.measuredOrigin = positionalValues[name](element.measureViewportBox(), window.getComputedStyle(element.current)); - unresolvedKeyframes[0] = this.measuredOrigin; - // Set final key frame to measure after next render - const measureKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1]; - if (measureKeyframe !== undefined) { - element.getValue(name, measureKeyframe).jump(measureKeyframe, false); - } - } - measureEndState() { - const { element, name, unresolvedKeyframes } = this; - if (!element || !element.current) - return; - const value = element.getValue(name); - value && value.jump(this.measuredOrigin, false); - const finalKeyframeIndex = unresolvedKeyframes.length - 1; - const finalKeyframe = unresolvedKeyframes[finalKeyframeIndex]; - unresolvedKeyframes[finalKeyframeIndex] = positionalValues[name](element.measureViewportBox(), window.getComputedStyle(element.current)); - if (finalKeyframe !== null && this.finalKeyframe === undefined) { - this.finalKeyframe = finalKeyframe; - } - // If we removed transform values, reapply them before the next render - if (this.removedTransforms?.length) { - this.removedTransforms.forEach(([unsetTransformName, unsetTransformValue]) => { - element - .getValue(unsetTransformName) - .set(unsetTransformValue); - }); - } - this.resolveNoneKeyframes(); - } -} - -/** - * The four corner-radius longhands. Shared so the projection mixer, scale - * corrector, WAAPI px-value set and view-transition crop pass don't each carry - * their own copy. Order is irrelevant - every consumer mixes/corrects/animates - * each corner independently. - */ -const cornerRadiusProps = [ - "borderTopLeftRadius", - "borderTopRightRadius", - "borderBottomRightRadius", - "borderBottomLeftRadius", -]; - -const pxValues = new Set([ - // Border props - "borderWidth", - "borderTopWidth", - "borderRightWidth", - "borderBottomWidth", - "borderLeftWidth", - "borderRadius", - ...cornerRadiusProps, - // Positioning props - "width", - "maxWidth", - "height", - "maxHeight", - "top", - "right", - "bottom", - "left", - "inset", - "insetBlock", - "insetBlockStart", - "insetBlockEnd", - "insetInline", - "insetInlineStart", - "insetInlineEnd", - // Spacing props - "padding", - "paddingTop", - "paddingRight", - "paddingBottom", - "paddingLeft", - "paddingBlock", - "paddingBlockStart", - "paddingBlockEnd", - "paddingInline", - "paddingInlineStart", - "paddingInlineEnd", - "margin", - "marginTop", - "marginRight", - "marginBottom", - "marginLeft", - "marginBlock", - "marginBlockStart", - "marginBlockEnd", - "marginInline", - "marginInlineStart", - "marginInlineEnd", - // Typography - "fontSize", - // Misc - "backgroundPositionX", - "backgroundPositionY", -]); - -function applyPxDefaults(keyframes, name) { - for (let i = 0; i < keyframes.length; i++) { - if (typeof keyframes[i] === "number" && pxValues.has(name)) { - keyframes[i] = keyframes[i] + "px"; - } - } -} - -function isWaapiSupportedEasing(easing) { - return Boolean((typeof easing === "function" && supportsLinearEasing()) || - !easing || - (typeof easing === "string" && - (easing in supportedWaapiEasing || supportsLinearEasing())) || - motionUtils.isBezierDefinition(easing) || - (Array.isArray(easing) && easing.every(isWaapiSupportedEasing))); -} - -const supportsPartialKeyframes = /*@__PURE__*/ motionUtils.memo(() => { - try { - document.createElement("div").animate({ opacity: [1] }); - } - catch (e) { - return false; - } - return true; -}); - -function resolveElements(elementOrSelector, scope, selectorCache) { - if (elementOrSelector == null) { - return []; - } - if (elementOrSelector instanceof EventTarget) { - return [elementOrSelector]; - } - else if (typeof elementOrSelector === "string") { - let root = document; - if (scope) { - root = scope.current; - } - const elements = selectorCache?.[elementOrSelector] ?? - root.querySelectorAll(elementOrSelector); - return elements ? Array.from(elements) : []; - } - return Array.from(elementOrSelector).filter((element) => element != null); -} - -function createSelectorEffect(subjectEffect) { - return (subject, values) => { - const elements = resolveElements(subject); - const subscriptions = []; - for (const element of elements) { - const remove = subjectEffect(element, values); - subscriptions.push(remove); - } - return () => { - for (const remove of subscriptions) - remove(); - }; - }; -} - -/** - * Provided a value and a ValueType, returns the value as that value type. - */ -const getValueAsType = (value, type) => { - return type && typeof value === "number" - ? type.transform(value) - : value; -}; - -class MotionValueState { - constructor() { - this.latest = {}; - this.values = new Map(); - } - set(name, value, render, computed, useDefaultValueType = true) { - const existingValue = this.values.get(name); - if (existingValue) { - existingValue.onRemove(); - } - const onChange = () => { - const v = value.get(); - if (useDefaultValueType) { - this.latest[name] = getValueAsType(v, numberValueTypes[name]); - } - else { - this.latest[name] = v; - } - render && frame.render(render); - }; - onChange(); - const cancelOnChange = value.on("change", onChange); - computed && value.addDependent(computed); - const remove = () => { - cancelOnChange(); - render && cancelFrame(render); - this.values.delete(name); - computed && value.removeDependent(computed); - }; - this.values.set(name, { value, onRemove: remove }); - return remove; - } - get(name) { - return this.values.get(name)?.value; - } -} - -function createEffect(addValue) { - const stateCache = new WeakMap(); - return (subject, values) => { - const state = stateCache.get(subject) ?? new MotionValueState(); - stateCache.set(subject, state); - const subscriptions = []; - for (const key in values) { - const value = values[key]; - const remove = addValue(subject, state, key, value); - subscriptions.push(remove); - } - return () => { - for (const cancel of subscriptions) - cancel(); - }; - }; -} - -function canSetAsProperty(element, name) { - if (!(name in element)) - return false; - const descriptor = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(element), name) || - Object.getOwnPropertyDescriptor(element, name); - // Check if it has a setter - return descriptor && typeof descriptor.set === "function"; -} -const addAttrValue = (element, state, key, value) => { - const isProp = canSetAsProperty(element, key); - const name = isProp - ? key - : key.startsWith("data") || key.startsWith("aria") - ? camelToDash(key) - : key; - /** - * Set attribute directly via property if available - */ - const render = isProp - ? () => { - element[name] = state.latest[key]; - } - : () => { - const v = state.latest[key]; - if (v === null || v === undefined) { - element.removeAttribute(name); - } - else { - element.setAttribute(name, String(v)); - } - }; - return state.set(key, value, render); -}; -const attrEffect = /*@__PURE__*/ createSelectorEffect( -/*@__PURE__*/ createEffect(addAttrValue)); - -const propEffect = /*@__PURE__*/ createEffect((subject, state, key, value) => { - return state.set(key, value, () => { - subject[key] = state.latest[key]; - }, undefined, false); -}); - -/** - * Checks if an element is an HTML element in a way - * that works across iframes - */ -function isHTMLElement(element) { - return (motionUtils.isObject(element) && - "offsetHeight" in element && - !("ownerSVGElement" in element)); -} - -const translateAlias$1 = { - x: "translateX", - y: "translateY", - z: "translateZ", - transformPerspective: "perspective", -}; -function buildTransform$1(state) { - let transform = ""; - let transformIsDefault = true; - /** - * Loop over all possible transforms in order, adding the ones that - * are present to the transform string. - */ - for (let i = 0; i < transformPropOrder.length; i++) { - const key = transformPropOrder[i]; - const value = state.latest[key]; - if (value === undefined) - continue; - let valueIsDefault = true; - if (typeof value === "number") { - valueIsDefault = value === (key.startsWith("scale") ? 1 : 0); - } - else { - const parsed = parseFloat(value); - valueIsDefault = key.startsWith("scale") ? parsed === 1 : parsed === 0; - } - if (!valueIsDefault) { - transformIsDefault = false; - const transformName = translateAlias$1[key] || key; - transform += `${transformName}(${value}) `; - } - } - // See build-transform.ts: additive `rotate()` so user `rotate` isn't - // clobbered. Not a `transformPropOrder` slot. - const pathRotation = state.latest.pathRotation; - if (pathRotation) { - transformIsDefault = false; - transform += `rotate(${typeof pathRotation === "number" - ? `${pathRotation}deg` - : pathRotation}) `; - } - return transformIsDefault ? "none" : transform.trim(); -} - -const originProps = new Set(["originX", "originY", "originZ"]); -const addStyleValue = (element, state, key, value) => { - let render = undefined; - let computed = undefined; - if (transformProps.has(key)) { - if (!state.get("transform")) { - // If this is an HTML element, we need to set the transform-box to fill-box - // to normalise the transform relative to the element's bounding box - if (!isHTMLElement(element) && !state.get("transformBox")) { - addStyleValue(element, state, "transformBox", new MotionValue("fill-box")); - } - state.set("transform", new MotionValue("none"), () => { - element.style.transform = buildTransform$1(state); - }); - } - computed = state.get("transform"); - } - else if (originProps.has(key)) { - if (!state.get("transformOrigin")) { - state.set("transformOrigin", new MotionValue(""), () => { - const originX = state.latest.originX ?? "50%"; - const originY = state.latest.originY ?? "50%"; - const originZ = state.latest.originZ ?? 0; - element.style.transformOrigin = `${originX} ${originY} ${originZ}`; - }); - } - computed = state.get("transformOrigin"); - } - else if (isCSSVar(key)) { - render = () => { - element.style.setProperty(key, state.latest[key]); - }; - } - else { - render = () => { - element.style[key] = state.latest[key]; - }; - } - return state.set(key, value, render, computed); -}; -const styleEffect = /*@__PURE__*/ createSelectorEffect( -/*@__PURE__*/ createEffect(addStyleValue)); - -function addSVGPathValue(element, state, key, value) { - frame.render(() => element.setAttribute("pathLength", "1")); - if (key === "pathOffset") { - return state.set(key, value, () => { - // Use unitless value to avoid Safari zoom bug - const offset = state.latest[key]; - element.setAttribute("stroke-dashoffset", `${-offset}`); - }); - } - else { - if (!state.get("stroke-dasharray")) { - state.set("stroke-dasharray", new MotionValue("1 1"), () => { - const { pathLength = 1, pathSpacing } = state.latest; - // Use unitless values to avoid Safari zoom bug - element.setAttribute("stroke-dasharray", `${pathLength} ${pathSpacing ?? 1 - Number(pathLength)}`); - }); - } - return state.set(key, value, undefined, state.get("stroke-dasharray")); - } -} -const addSVGValue = (element, state, key, value) => { - if (key.startsWith("path")) { - return addSVGPathValue(element, state, key, value); - } - else if (key.startsWith("attr")) { - return addAttrValue(element, state, convertAttrKey(key), value); - } - const handler = key in element.style ? addStyleValue : addAttrValue; - return handler(element, state, key, value); -}; -const svgEffect = /*@__PURE__*/ createSelectorEffect( -/*@__PURE__*/ createEffect(addSVGValue)); -function convertAttrKey(key) { - return key.replace(/^attr([A-Z])/, (_, firstChar) => firstChar.toLowerCase()); -} - -const { schedule: microtask, cancel: cancelMicrotask } = -/* @__PURE__ */ createRenderBatcher(queueMicrotask, false); - -const isDragging = { - x: false, - y: false, -}; -function isDragActive() { - return isDragging.x || isDragging.y; -} - -function setDragLock(axis) { - if (axis === "x" || axis === "y") { - if (isDragging[axis]) { - return null; - } - else { - isDragging[axis] = true; - return () => { - isDragging[axis] = false; - }; - } - } - else { - if (isDragging.x || isDragging.y) { - return null; - } - else { - isDragging.x = isDragging.y = true; - return () => { - isDragging.x = isDragging.y = false; - }; - } - } -} - -function setupGesture(elementOrSelector, options) { - const elements = resolveElements(elementOrSelector); - const gestureAbortController = new AbortController(); - const eventOptions = { - passive: true, - ...options, - signal: gestureAbortController.signal, - }; - const cancel = () => gestureAbortController.abort(); - return [elements, eventOptions, cancel]; -} - -function isValidHover(event) { - return !(event.pointerType === "touch" || isDragActive()); -} -/** - * Create a hover gesture. hover() is different to .addEventListener("pointerenter") - * in that it has an easier syntax, filters out polyfilled touch events, interoperates - * with drag gestures, and automatically removes the "pointerennd" event listener when the hover ends. - * - * @public - */ -function hover(elementOrSelector, onHoverStart, options = {}) { - const [elements, eventOptions, cancel] = setupGesture(elementOrSelector, options); - elements.forEach((element) => { - let isPressed = false; - let deferredHoverEnd = false; - let hoverEndCallback; - const removePointerLeave = () => { - element.removeEventListener("pointerleave", onPointerLeave); - }; - const endHover = (event) => { - if (hoverEndCallback) { - hoverEndCallback(event); - hoverEndCallback = undefined; - } - removePointerLeave(); - }; - const onPointerUp = (event) => { - isPressed = false; - window.removeEventListener("pointerup", onPointerUp); - window.removeEventListener("pointercancel", onPointerUp); - if (deferredHoverEnd) { - deferredHoverEnd = false; - endHover(event); - } - }; - const onPointerDown = () => { - isPressed = true; - window.addEventListener("pointerup", onPointerUp, eventOptions); - window.addEventListener("pointercancel", onPointerUp, eventOptions); - }; - const onPointerLeave = (leaveEvent) => { - if (leaveEvent.pointerType === "touch") - return; - if (isPressed) { - deferredHoverEnd = true; - return; - } - endHover(leaveEvent); - }; - const onPointerEnter = (enterEvent) => { - if (!isValidHover(enterEvent)) - return; - deferredHoverEnd = false; - const onHoverEnd = onHoverStart(element, enterEvent); - if (typeof onHoverEnd !== "function") - return; - hoverEndCallback = onHoverEnd; - element.addEventListener("pointerleave", onPointerLeave, eventOptions); - }; - element.addEventListener("pointerenter", onPointerEnter, eventOptions); - element.addEventListener("pointerdown", onPointerDown, eventOptions); - }); - return cancel; -} - -/** - * Recursively traverse up the tree to check whether the provided child node - * is the parent or a descendant of it. - * - * @param parent - Element to find - * @param child - Element to test against parent - */ -const isNodeOrChild = (parent, child) => { - if (!child) { - return false; - } - else if (parent === child) { - return true; - } - else { - return isNodeOrChild(parent, child.parentElement); - } -}; - -const isPrimaryPointer = (event) => { - if (event.pointerType === "mouse") { - return typeof event.button !== "number" || event.button <= 0; - } - else { - /** - * isPrimary is true for all mice buttons, whereas every touch point - * is regarded as its own input. So subsequent concurrent touch points - * will be false. - * - * Specifically match against false here as incomplete versions of - * PointerEvents in very old browser might have it set as undefined. - */ - return event.isPrimary !== false; - } -}; - -const keyboardAccessibleElements = new Set([ - "BUTTON", - "INPUT", - "SELECT", - "TEXTAREA", - "A", -]); -/** - * Checks if an element is natively keyboard accessible (focusable). - * Used by the press gesture to determine if we need to add tabIndex. - */ -function isElementKeyboardAccessible(element) { - return (keyboardAccessibleElements.has(element.tagName) || - element.isContentEditable === true); -} -const textInputElements = new Set(["INPUT", "SELECT", "TEXTAREA"]); -/** - * Checks if an element has text selection or direct interaction behavior - * that should block drag gestures from starting. - * - * This specifically targets form controls where the user might want to select - * text or interact with the control (e.g., sliders, dropdowns). - * - * Buttons and links are NOT included because they don't have click-and-move - * actions of their own - they only respond to click events, so dragging - * should still work when initiated from these elements. - */ -function isElementTextInput(element) { - return (textInputElements.has(element.tagName) || - element.isContentEditable === true); -} - -const isPressing = new WeakSet(); - -/** - * Filter out events that are not "Enter" keys. - */ -function filterEvents(callback) { - return (event) => { - if (event.key !== "Enter") - return; - callback(event); - }; -} -function firePointerEvent(target, type) { - target.dispatchEvent(new PointerEvent("pointer" + type, { isPrimary: true, bubbles: true })); -} -const enableKeyboardPress = (focusEvent, eventOptions) => { - const element = focusEvent.currentTarget; - if (!element) - return; - const handleKeydown = filterEvents(() => { - if (isPressing.has(element)) - return; - firePointerEvent(element, "down"); - const handleKeyup = filterEvents(() => { - firePointerEvent(element, "up"); - }); - const handleBlur = () => firePointerEvent(element, "cancel"); - element.addEventListener("keyup", handleKeyup, eventOptions); - element.addEventListener("blur", handleBlur, eventOptions); - }); - element.addEventListener("keydown", handleKeydown, eventOptions); - /** - * Add an event listener that fires on blur to remove the keydown events. - */ - element.addEventListener("blur", () => element.removeEventListener("keydown", handleKeydown), eventOptions); -}; - -/** - * Filter out events that are not primary pointer events, or are triggering - * while a Motion gesture is active. - */ -function isValidPressEvent(event) { - return isPrimaryPointer(event) && !isDragActive(); -} -const claimedPointerDownEvents = new WeakSet(); -/** - * Create a press gesture. - * - * Press is different to `"pointerdown"`, `"pointerup"` in that it - * automatically filters out secondary pointer events like right - * click and multitouch. - * - * It also adds accessibility support for keyboards, where - * an element with a press gesture will receive focus and - * trigger on Enter `"keydown"` and `"keyup"` events. - * - * This is different to a browser's `"click"` event, which does - * respond to keyboards but only for the `"click"` itself, rather - * than the press start and end/cancel. The element also needs - * to be focusable for this to work, whereas a press gesture will - * make an element focusable by default. - * - * @public - */ -function press(targetOrSelector, onPressStart, options = {}) { - const [targets, eventOptions, cancelEvents] = setupGesture(targetOrSelector, options); - const startPress = (startEvent) => { - const target = startEvent.currentTarget; - if (!isValidPressEvent(startEvent)) - return; - if (claimedPointerDownEvents.has(startEvent)) - return; - isPressing.add(target); - if (options.stopPropagation) { - claimedPointerDownEvents.add(startEvent); - } - const onPressEnd = onPressStart(target, startEvent); - /** - * End listeners run in the capture phase so a descendant calling - * stopPropagation() in its own pointerup handler can't prevent the - * press gesture from ending. This also keeps the gesture-end - * ordering consistent with the drag gesture. See #2794. - */ - const endEventOptions = { ...eventOptions, capture: true }; - const onPointerEnd = (endEvent, success) => { - window.removeEventListener("pointerup", onPointerUp, endEventOptions); - window.removeEventListener("pointercancel", onPointerCancel, endEventOptions); - if (isPressing.has(target)) { - isPressing.delete(target); - } - if (!isValidPressEvent(endEvent)) { - return; - } - if (typeof onPressEnd === "function") { - onPressEnd(endEvent, { success }); - } - }; - const onPointerUp = (upEvent) => { - onPointerEnd(upEvent, target === window || - target === document || - options.useGlobalTarget || - isNodeOrChild(target, upEvent.target)); - }; - const onPointerCancel = (cancelEvent) => { - onPointerEnd(cancelEvent, false); - }; - window.addEventListener("pointerup", onPointerUp, endEventOptions); - window.addEventListener("pointercancel", onPointerCancel, endEventOptions); - }; - targets.forEach((target) => { - const pointerDownTarget = options.useGlobalTarget ? window : target; - pointerDownTarget.addEventListener("pointerdown", startPress, eventOptions); - if (isHTMLElement(target)) { - target.addEventListener("focus", (event) => enableKeyboardPress(event, eventOptions)); - if (!isElementKeyboardAccessible(target) && - !target.hasAttribute("tabindex")) { - target.tabIndex = 0; - } - } - }); - return cancelEvents; -} - -function getComputedStyle$2(element, name) { - const computedStyle = window.getComputedStyle(element); - return isCSSVar(name) - ? computedStyle.getPropertyValue(name) - : computedStyle[name]; -} - -/** - * Checks if an element is an SVG element in a way - * that works across iframes - */ -function isSVGElement(element) { - return motionUtils.isObject(element) && "ownerSVGElement" in element; -} - -const resizeHandlers = new WeakMap(); -let observer; -const getSize = (borderBoxAxis, svgAxis, htmlAxis) => (target, borderBoxSize) => { - if (borderBoxSize && borderBoxSize[0]) { - return borderBoxSize[0][(borderBoxAxis + "Size")]; - } - else if (isSVGElement(target) && "getBBox" in target) { - return target.getBBox()[svgAxis]; - } - else { - return target[htmlAxis]; - } -}; -const getWidth = /*@__PURE__*/ getSize("inline", "width", "offsetWidth"); -const getHeight = /*@__PURE__*/ getSize("block", "height", "offsetHeight"); -function notifyTarget({ target, borderBoxSize }) { - resizeHandlers.get(target)?.forEach((handler) => { - handler(target, { - get width() { - return getWidth(target, borderBoxSize); - }, - get height() { - return getHeight(target, borderBoxSize); - }, - }); - }); -} -function notifyAll(entries) { - entries.forEach(notifyTarget); -} -function createResizeObserver() { - if (typeof ResizeObserver === "undefined") - return; - observer = new ResizeObserver(notifyAll); -} -function resizeElement(target, handler) { - if (!observer) - createResizeObserver(); - const elements = resolveElements(target); - elements.forEach((element) => { - let elementHandlers = resizeHandlers.get(element); - if (!elementHandlers) { - elementHandlers = new Set(); - resizeHandlers.set(element, elementHandlers); - } - elementHandlers.add(handler); - observer?.observe(element); - }); - return () => { - elements.forEach((element) => { - const elementHandlers = resizeHandlers.get(element); - elementHandlers?.delete(handler); - if (!elementHandlers?.size) { - observer?.unobserve(element); - } - }); - }; -} - -const windowCallbacks = new Set(); -let windowResizeHandler; -function createWindowResizeHandler() { - windowResizeHandler = () => { - const info = { - get width() { - return window.innerWidth; - }, - get height() { - return window.innerHeight; - }, - }; - windowCallbacks.forEach((callback) => callback(info)); - }; - window.addEventListener("resize", windowResizeHandler); -} -function resizeWindow(callback) { - windowCallbacks.add(callback); - if (!windowResizeHandler) - createWindowResizeHandler(); - return () => { - windowCallbacks.delete(callback); - if (!windowCallbacks.size && - typeof windowResizeHandler === "function") { - window.removeEventListener("resize", windowResizeHandler); - windowResizeHandler = undefined; - } - }; -} - -function resize(a, b) { - return typeof a === "function" ? resizeWindow(a) : resizeElement(a, b); -} - -function observeTimeline(update, timeline) { - let prevProgress; - const onFrame = () => { - const { currentTime } = timeline; - const percentage = currentTime === null ? 0 : currentTime.value; - const progress = percentage / 100; - if (prevProgress !== progress) { - update(progress); - } - prevProgress = progress; - }; - frame.preUpdate(onFrame, true); - return () => cancelFrame(onFrame); -} - -const statsBuffer = { - value: null, - addProjectionMetrics: null, -}; - -function clearStatsBuffer() { - statsBuffer.value = null; - statsBuffer.addProjectionMetrics = null; -} -function recordStats() { - if (statsBuffer.value) { - clearStatsBuffer(); - throw new Error("Stats are already being measured"); - } - const buffer = statsBuffer; - buffer.value = { - layoutProjection: { - nodes: [], - calculatedTargetDeltas: [], - calculatedProjections: [], - }, - }; - buffer.addProjectionMetrics = (metrics) => { - const { layoutProjection } = buffer.value; - layoutProjection.nodes.push(metrics.nodes); - layoutProjection.calculatedTargetDeltas.push(metrics.calculatedTargetDeltas); - layoutProjection.calculatedProjections.push(metrics.calculatedProjections); - }; -} - -/** - * Checks if an element is specifically an SVGSVGElement (the root SVG element) - * in a way that works across iframes - */ -function isSVGSVGElement(element) { - return isSVGElement(element) && element.tagName === "svg"; -} - -function getOriginIndex(from, total) { - if (from === "first") { - return 0; - } - else { - const lastIndex = total - 1; - return from === "last" ? lastIndex : lastIndex / 2; - } -} -function stagger(duration = 0.1, { startDelay = 0, from = 0, ease } = {}) { - return (i, total) => { - const fromIndex = typeof from === "number" ? from : getOriginIndex(from, total); - const distance = Math.abs(fromIndex - i); - let delay = duration * distance; - if (ease) { - const maxDelay = total * duration; - const easingFunction = motionUtils.easingDefinitionToFunction(ease); - delay = easingFunction(delay / maxDelay) * maxDelay; - } - return startDelay + delay; - }; -} - -function transform(...args) { - const useImmediate = !Array.isArray(args[0]); - const argOffset = useImmediate ? 0 : -1; - const inputValue = args[0 + argOffset]; - const inputRange = args[1 + argOffset]; - const outputRange = args[2 + argOffset]; - const options = args[3 + argOffset]; - const interpolator = interpolate(inputRange, outputRange, options); - return useImmediate ? interpolator(inputValue) : interpolator; -} - -/** - * Create a `MotionValue` that animates to its latest value using any transition type. - * Can either be a value or track another `MotionValue`. - * - * ```jsx - * const x = motionValue(0) - * const y = followValue(x, { type: "spring", stiffness: 300 }) - * // or with tween - * const z = followValue(x, { type: "tween", duration: 0.5, ease: "easeOut" }) - * ``` - * - * @param source - Initial value or MotionValue to track - * @param options - Animation transition options - * @returns `MotionValue` - * - * @public - */ -function followValue(source, options) { - const initialValue = isMotionValue(source) ? source.get() : source; - const value = motionValue(initialValue); - attachFollow(value, source, options); - return value; -} -/** - * Attach an animation to a MotionValue that will animate whenever the value changes. - * Similar to attachSpring but supports any transition type (spring, tween, inertia, etc.) - * - * @param value - The MotionValue to animate - * @param source - Initial value or MotionValue to track - * @param options - Animation transition options - * @returns Cleanup function - * - * @public - */ -function attachFollow(value, source, options = {}) { - const initialValue = value.get(); - let activeAnimation = null; - let latestValue = initialValue; - let latestSetter; - const unit = typeof initialValue === "string" - ? initialValue.replace(/[\d.-]/g, "") - : undefined; - const stopAnimation = () => { - if (activeAnimation) { - activeAnimation.stop(); - activeAnimation = null; - } - value.animation = undefined; - }; - const startAnimation = () => { - const currentValue = asNumber$1(value.get()); - const targetValue = asNumber$1(latestValue); - // Don't animate if we're already at the target - if (currentValue === targetValue) { - stopAnimation(); - return; - } - // Use the running animation's analytical velocity for accuracy, - // falling back to the MotionValue's velocity for the initial animation. - // This prevents systematic velocity loss at high frame rates (240hz+). - const velocity = activeAnimation - ? activeAnimation.getGeneratorVelocity() - : value.getVelocity(); - stopAnimation(); - activeAnimation = new JSAnimation({ - keyframes: [currentValue, targetValue], - velocity, - // Default to spring if no type specified (matches useSpring behavior) - type: "spring", - restDelta: 0.001, - restSpeed: 0.01, - ...options, - onUpdate: latestSetter, - }); - }; - // Use a stable function reference so the frame loop Set deduplicates - // multiple calls within the same frame (e.g. rapid mouse events) - const scheduleAnimation = () => { - startAnimation(); - value.animation = activeAnimation ?? undefined; - value["events"].animationStart?.notify(); - activeAnimation?.then(() => { - value.animation = undefined; - value["events"].animationComplete?.notify(); - }); - }; - value.attach((v, set) => { - latestValue = v; - latestSetter = (latest) => set(parseValue(latest, unit)); - frame.postRender(scheduleAnimation); - }, stopAnimation); - if (isMotionValue(source)) { - let skipNextAnimation = options.skipInitialAnimation === true; - const removeSourceOnChange = source.on("change", (v) => { - if (skipNextAnimation) { - skipNextAnimation = false; - value.jump(parseValue(v, unit), false); - } - else { - value.set(parseValue(v, unit)); - } - }); - const removeValueOnDestroy = value.on("destroy", removeSourceOnChange); - return () => { - removeSourceOnChange(); - removeValueOnDestroy(); - }; - } - return stopAnimation; -} -function parseValue(v, unit) { - return unit ? v + unit : v; -} -function asNumber$1(v) { - return typeof v === "number" ? v : parseFloat(v); -} - -function subscribeValue(inputValues, outputValue, getLatest) { - const update = () => outputValue.set(getLatest()); - const scheduleUpdate = () => frame.preRender(update, false, true); - const subscriptions = inputValues.map((v) => v.on("change", scheduleUpdate)); - outputValue.on("destroy", () => { - subscriptions.forEach((unsubscribe) => unsubscribe()); - cancelFrame(update); - }); -} - -/** - * Create a `MotionValue` that transforms the output of other `MotionValue`s by - * passing their latest values through a transform function. - * - * Whenever a `MotionValue` referred to in the provided function is updated, - * it will be re-evaluated. - * - * ```jsx - * const x = motionValue(0) - * const y = transformValue(() => x.get() * 2) // double x - * ``` - * - * @param transformer - A transform function. This function must be pure with no side-effects or conditional statements. - * @returns `MotionValue` - * - * @public - */ -function transformValue(transform) { - const collectedValues = []; - /** - * Open session of collectMotionValues. Any MotionValue that calls get() - * inside transform will be saved into this array. - */ - collectMotionValues.current = collectedValues; - const initialValue = transform(); - collectMotionValues.current = undefined; - const value = motionValue(initialValue); - subscribeValue(collectedValues, value, transform); - return value; -} - -/** - * Create a `MotionValue` that maps the output of another `MotionValue` by - * mapping it from one range of values into another. - * - * @remarks - * - * Given an input range of `[-200, -100, 100, 200]` and an output range of - * `[0, 1, 1, 0]`, the returned `MotionValue` will: - * - * - When provided a value between `-200` and `-100`, will return a value between `0` and `1`. - * - When provided a value between `-100` and `100`, will return `1`. - * - When provided a value between `100` and `200`, will return a value between `1` and `0` - * - * The input range must be a linear series of numbers. The output range - * can be any value type supported by Motion: numbers, colors, shadows, etc. - * - * Every value in the output range must be of the same type and in the same format. - * - * ```jsx - * const x = motionValue(0) - * const xRange = [-200, -100, 100, 200] - * const opacityRange = [0, 1, 1, 0] - * const opacity = mapValue(x, xRange, opacityRange) - * ``` - * - * @param inputValue - `MotionValue` - * @param inputRange - A linear series of numbers (either all increasing or decreasing) - * @param outputRange - A series of numbers, colors or strings. Must be the same length as `inputRange`. - * @param options - - * - * - clamp: boolean. Clamp values to within the given range. Defaults to `true` - * - ease: EasingFunction[]. Easing functions to use on the interpolations between each value in the input and output ranges. If provided as an array, the array must be one item shorter than the input and output ranges, as the easings apply to the transition between each. - * - * @returns `MotionValue` - * - * @public - */ -function mapValue(inputValue, inputRange, outputRange, options) { - const map = transform(inputRange, outputRange, options); - return transformValue(() => map(inputValue.get())); -} - -/** - * Create a `MotionValue` that animates to its latest value using a spring. - * Can either be a value or track another `MotionValue`. - * - * ```jsx - * const x = motionValue(0) - * const y = springValue(x, { stiffness: 300 }) - * ``` - * - * @param source - Initial value or MotionValue to track - * @param options - Spring configuration options - * @returns `MotionValue` - * - * @public - */ -function springValue(source, options) { - return followValue(source, { type: "spring", ...options }); -} -/** - * Attach a spring animation to a MotionValue that will animate whenever the value changes. - * - * @param value - The MotionValue to animate - * @param source - Initial value or MotionValue to track - * @param options - Spring configuration options - * @returns Cleanup function - * - * @public - */ -function attachSpring(value, source, options) { - return attachFollow(value, source, { type: "spring", ...options }); -} - -/** - * A list of all ValueTypes - */ -const valueTypes = [...dimensionValueTypes, color, complex]; -/** - * Tests a value against the list of ValueTypes - */ -const findValueType = (v) => valueTypes.find(testValueType(v)); - -let nameCount = 0; -/** - * Generated names live in their own namespace so we can tell a name we own - * (and must clean up) from an author-defined one - and so a stale generated - * name left behind by an interrupted transition is re-owned, not mistaken for - * the author's and leaked. - */ -const generatedName = () => `motion-view-${nameCount++}`; -const isGeneratedName = (name) => name.startsWith("motion-view-"); -/** - * Tag a captured element with a `view-transition-class` so authors can target - * its generated layer from CSS (e.g. `::view-transition-group(.hero)`) without - * the opaque generated name. Tracked in `classed` - separate from the generated - * names in `assigned` - so cleanup removes the class without ever stripping an - * author's own inline `view-transition-name`. - */ -function tagClass(element, className, classed) { - if (!className) - return; - element.style?.setProperty("view-transition-class", className); - classed.push(element); -} -/** - * Set the element's `view-transition-group` so its layer reconstructs the DOM - * hierarchy in the pseudo-tree (`contain`) - or stays flat (`none`). Tracked in - * `grouped` for cleanup. When the element clips (any non-`visible` overflow) its - * name is recorded in `clipChildren` so the caller can clip the nested children - * (`::view-transition-group-children(name)`), mirroring the live clip through - * the whole transition rather than only at the live-DOM handoff. - * - * Ignored by browsers without nested view-transition groups, where it harmlessly - * degrades to the flat default. - */ -function applyGroup(element, name, group, grouped, clipChildren) { - if (!group) - return; - element.style?.setProperty("view-transition-group", group); - grouped.push(element); - if (group !== "none" && clipChildren) { - const style = getComputedStyle(element); - if (style.overflowX !== "visible" || style.overflowY !== "visible") { - clipChildren.add(name); - } - } -} -/** - * Resolve a selector/Element to elements and ensure each one carries a - * `view-transition-name` we can target from script. - * - * Author-defined names are reused as-is. Elements that are unnamed (or use - * the browser's `auto`/`match-element`, whose generated name is not exposed - * to script) are given a unique generated name, set inline so it's captured, - * and tracked in `assigned` for later cleanup. - * - * `registry` maps each Element to its name so the same element keeps its name - * across both captures (before and after the update), which is what allows a - * persistent element to animate as a single `group` layer. - */ -function assignViewTransitionNames(definition, registry, assigned, forcedNames, className, classed = [], group, grouped = [], clipChildren) { - const elements = resolveElements(definition); - /** - * The new end of a paired morph: give each element the matching name from - * the old end (by index) so the two share one layer and morph. If the new - * end resolves to *more* elements than the old end named, the extras have no - * counterpart - give them a fresh name so they animate as newcomers rather - * than being silently left unnamed. We return the names actually assigned - * (sized to the resolved elements), not the raw `forcedNames`, so stagger - * totals and the layer set stay in step with what's on the page. - */ - if (forcedNames) { - return elements.map((element, i) => { - const existing = registry.get(element); - if (existing) - return existing; - const name = forcedNames[i] ?? generatedName(); - element.style?.setProperty("view-transition-name", name); - assigned.push(element); - registry.set(element, name); - tagClass(element, className, classed); - applyGroup(element, name, group, grouped, clipChildren); - return name; - }); - } - /** - * Read every current name up front, before assigning any. Interleaving the - * reads with the inline `setProperty` writes below would dirty styles - * between reads and force a style recalc per element; batching the reads - * keeps it to one. Elements already in the registry keep their name and - * need no read. - */ - const currentNames = elements.map((element) => registry.has(element) - ? undefined - : getComputedStyle(element).getPropertyValue("view-transition-name")); - return elements.map((element, i) => { - const existing = registry.get(element); - if (existing) - return existing; - const current = currentNames[i]; - let name; - if (current && - current !== "none" && - current !== "auto" && - current !== "match-element" && - !isGeneratedName(current)) { - /** - * The author already named this layer - target it as-is and leave - * it to them to clean up. `auto`/`match-element` are overridden - * because their generated name is not exposed to script, and a - * stale `motion-view-*` (e.g. left by an interrupted transition) is - * re-owned rather than adopted as an author name and leaked. - */ - name = current; - } - else { - name = generatedName(); - element.style?.setProperty("view-transition-name", name); - assigned.push(element); - } - registry.set(element, name); - tagClass(element, className, classed); - applyGroup(element, name, group, grouped, clipChildren); - return name; - }); -} -/** - * Remove the `view-transition-name`s we generated and the - * `view-transition-class`es we applied. Author-defined names are never touched - * (they're not in `assigned`). Safe to call more than once (e.g. on both a - * finished and an interrupted transition). - */ -function releaseViewTransitionNames(assigned, classed = [], grouped = []) { - for (const element of assigned) { - element.style?.removeProperty("view-transition-name"); - } - for (const element of classed) { - element.style?.removeProperty("view-transition-class"); - } - for (const element of grouped) { - element.style?.removeProperty("view-transition-group"); - } -} - -function chooseLayerType(valueName) { - if (valueName === "layout") - return "group"; - if (valueName === "enter" || valueName === "new") - return "new"; - return "old"; -} - -let pendingRules = {}; -let style = null; -const css = { - set: (selector, values) => { - pendingRules[selector] = values; - }, - commit: () => { - if (!style) { - style = document.createElement("style"); - style.id = "motion-view"; - } - let cssText = ""; - for (const selector in pendingRules) { - const rule = pendingRules[selector]; - cssText += `${selector} {\n`; - for (const [property, value] of Object.entries(rule)) { - cssText += ` ${property}: ${value};\n`; - } - cssText += "}\n"; - } - style.textContent = cssText; - document.head.appendChild(style); - pendingRules = {}; - }, - remove: () => { - if (style && style.parentElement) { - style.parentElement.removeChild(style); - } - }, -}; - -function getViewAnimationLayerInfo(pseudoElement) { - const match = pseudoElement.match( - // `group-children` (nested transitions) before `group` so it wins. - /::view-transition-(old|new|group-children|group|image-pair)\((.*?)\)/); - if (!match) - return null; - return { layer: match[2], type: match[1] }; -} - -function getViewAnimations() { - return document.getAnimations().filter((animation) => { - const { effect } = animation; - return (!!effect && - effect.target === document.documentElement && - effect.pseudoElement?.startsWith("::view-transition")); - }); -} - -function hasTarget(target, targets) { - return targets.has(target) && Object.keys(targets.get(target)).length > 0; -} - -const definitionNames = ["layout", "enter", "exit", "new", "old"]; -/** - * Whether a computed border-radius is square (every component zero). Splitting - * on whitespace handles two-value/elliptical radii like "0px 20px" - a leading - * `parseFloat` alone would misread the non-zero vertical radius as square. - */ -const isSquareRadius = (radius) => radius.split(" ").every((value) => parseFloat(value) === 0); -/** - * The `ViewTransitionTarget` buckets driving each generated layer type, in - * priority order - the inverse of `chooseLayerType`. The new view is driven by - * `new`/`enter`, the old by `old`/`exit`. `group-children`/`image-pair` have no - * bucket; they follow the default layout timing. - */ -const typeBuckets = { - group: ["layout"], - new: ["new", "enter"], - old: ["old", "exit"], -}; -/** - * Default "absent" origin for a single-value keyframe, by pseudo type, so e.g. - * `enter({ scale: 1 })` grows in from 0.85 and `exit({ opacity: 0 })` fades - * from 1. `enter` prefers the matching `exit` value over these (see below). - */ -const ORIGIN_DEFAULTS = { - new: { opacity: 0, scale: 0.85 }, - old: { opacity: 1, scale: 1 }, -}; -/** - * How much two box aspect ratios must differ before a morph is treated as - * aspect-changing (and so worth cropping). Matches the projection engine's - * `preserve-aspect` threshold, so small layout jitter doesn't trigger a crop. - */ -const ASPECT_TOLERANCE = 0.2; -function startViewAnimation(builder) { - const { update, targets, resolveDefs, cropOverride, pairs, classNames, flatGroups, options: defaultOptions, } = builder; - if (!document.startViewTransition) { - // An async IIFE (not `new Promise(async …)`) so a throwing/rejecting - // update rejects this promise rather than leaving it unsettled. - return (async () => { - await update(); - return new GroupAnimation([]); - })(); - } - /** - * Resolve any selector/Element targets to layer names, assigning a - * `view-transition-name` to each element as we go. We run this before the - * update (so the elements are captured in the old snapshot) and again - * after it (for the new snapshot). An element present in both keeps the - * same name and animates as a single `group` layer. - */ - const nameRegistry = new Map(); - const assigned = []; - /** - * Elements we tagged with a `view-transition-class` (via `.class()`), - * tracked separately from `assigned` so cleanup removes the class without - * ever stripping an author's own inline `view-transition-name`. - */ - const classed = []; - /** - * Elements we set a `view-transition-group` on (for nesting), tracked for - * cleanup. `clipChildren` collects the names of nested parents that clip in - * the live layout, so their `::view-transition-group-children` is clipped - * through the transition - not just once the live DOM takes back over. - */ - const grouped = []; - const clipChildren = new Set(); - const layerTargets = new Map(); - const croppedNames = new Set(); - /** - * Each layer's explicit `.crop(true | false)` override (by resolved name), - * so `finalizeCrop` can let an author's choice win over the morph default. - */ - const cropForName = new Map(); - /** - * Each layer's stagger position (index + total) within its subject, per - * snapshot. Resolving against the snapshot the layer belongs to keeps - * stagger correct when `update()` replaces the matched elements, and lets - * us skip a layer that's absent from a snapshot (e.g. an exited element - * has no `new` pseudo-element). - */ - const layerStagger = new Map(); - /** - * Names allocated for a paired subject in the old snapshot, replayed onto - * its new-snapshot target so both ends share a layer and morph. - */ - const pairNames = new Map(); - /** - * The old (`from`) elements of each paired subject, so their names can be - * transferred off before the new (`to`) elements inherit them. - */ - const pairFrom = new Map(); - const resolveLayers = (phase) => { - targets.forEach((target, definition) => { - const className = classNames.get(definition); - /** - * Nest each resolved layer under its DOM-ancestor layer by default - * (`contain`), so an ancestor's clip/transform/opacity reach it - * through the transition; `.group(false)` opts a subject out (`none`) - * to stay flat and escape. Skipped for root / pre-named layers, which - * aren't elements we resolve and style. - */ - const group = definition === "root" || !resolveDefs.has(definition) - ? undefined - : flatGroups.has(definition) - ? "none" - : "contain"; - let names; - if (definition === "root" || !resolveDefs.has(definition)) { - names = [definition]; - } - else if (pairs.has(definition)) { - /** - * Paired morph: name the old target in the old snapshot, then - * force the same name(s) onto the new target in the new one, so - * two different elements morph as a single layer. - */ - if (phase === "old") { - pairFrom.set(definition, resolveElements(definition)); - names = assignViewTransitionNames(definition, nameRegistry, assigned, undefined, className, classed, group, grouped, clipChildren); - pairNames.set(definition, names); - } - else { - /** - * Transfer the name(s) off the `from` elements before the - * `to` elements inherit them. A `from` that survives into - * the new snapshot (e.g. hidden with `visibility: hidden` - * rather than removed) would otherwise keep the name and - * collide - "duplicate view-transition-name". - */ - for (const el of pairFrom.get(definition) ?? []) { - el.style?.removeProperty("view-transition-name"); - /** - * Drop the old end from the registry too, so the new - * end alone supplies this name's `new` crop radii - we - * neither re-measure nor get ordered by a stale element. - */ - nameRegistry.delete(el); - } - names = assignViewTransitionNames(pairs.get(definition), nameRegistry, assigned, pairNames.get(definition), className, classed, group, grouped, clipChildren); - } - } - else { - names = assignViewTransitionNames(definition, nameRegistry, assigned, undefined, className, classed, group, grouped, clipChildren); - } - // Record any explicit `.crop(true | false)` per resolved name; the - // crop set itself is computed later by `finalizeCrop` (it needs both - // snapshots to know which morphs change aspect ratio). - const override = cropOverride.get(definition); - names.forEach((name, index) => { - /** - * If two subjects resolve to the same element, merge their - * definitions so neither subject's animations are dropped. - */ - const existing = layerTargets.get(name); - layerTargets.set(name, existing && existing !== target - ? { ...existing, ...target } - : target); - if (override !== undefined) - cropForName.set(name, override); - const stagger = layerStagger.get(name) ?? {}; - stagger[phase] = [index, names.length]; - layerStagger.set(name, stagger); - }); - }); - }; - /** - * The stagger index/total for a layer, resolved against the snapshot it - * belongs to. Returns index -1 when the layer is absent from that snapshot - * so the caller can skip a pseudo-element that doesn't exist. - */ - const staggerPosition = (name, type) => { - const stagger = layerStagger.get(name); - const position = type === "old" - ? stagger?.old - : type === "new" - ? stagger?.new - : // group / group-children / image-pair persist across both. - stagger?.new ?? stagger?.old; - return position ?? [-1, 1]; - }; - /** - * Merge default + per-layer transition options for a generated layer and - * resolve any stagger/delay function against this element's position. Used - * by both the morph-retiming and crop corner-radius passes. - */ - const resolveLayerTransition = (target, type, transitionName, index, total) => { - const transition = mergeTransition(getValueTransition(defaultOptions, transitionName), getValueTransition((layerOptions(target, type) ?? {}), transitionName)); - if (typeof transition.delay === "function") { - transition.delay = transition.delay(index, total); - } - return transition; - }; - /** - * Resolve a layer's group (`layout`) timing to plain WAAPI values: native - * ms `delay`/`duration` and a baked `ease`. The single source of group - * timing, shared by the generated-group retiming and the crop corner-radius - * pass so the rounded clip animates on exactly the box's timing. It returns - * no generator `type` (the WAAPI-only `NativeAnimation` rejects a string - * type) nor `repeat`/`times` (which the group's `updateTiming` ignores), so - * none of them can leak into the radius animation and desync it. - */ - const resolveGroupTiming = (name) => { - const [index, total] = staggerPosition(name, "group"); - const transition = resolveLayerTransition(layerTargets.get(name), "group", "layout", index === -1 ? 0 : index, total); - transition.duration && (transition.duration = motionUtils.secondsToMilliseconds(transition.duration)); - const { delay = 0, duration, ease } = applyGeneratorOptions(transition); - return { delay: motionUtils.secondsToMilliseconds(delay), duration, ease }; - }; - /** - * Each layer's measured box + corner radii per snapshot. The box lets - * `finalizeCrop` tell whether a morph's aspect ratio changed (the only case - * worth cropping); the radii let a cropped morph's group clip animate each - * corner from the old element's radius to the new element's, keeping it - * rounded where `overflow: clip` would otherwise square the corners. - * - * We never flatten the source for capture (a snapshot is a paint of the live - * DOM, so squaring an element just for its capture would flash one real - * square frame). For an aspect-changing morph `object-fit: cover` crops each - * snapshot's own baked corners off-screen mid-morph, so the animated clip is - * the only visible corner; a near-same-aspect forced crop (`.crop(true)`) - * can't hide the outgoing snapshot's silhouette, but the endpoints coincide. - */ - const cropMeasurements = new Map(); - const measureLayers = (phase) => nameRegistry.forEach((name, element) => { - const el = element; - const rect = el.getBoundingClientRect?.(); - if (rect && rect.height) { - const style = getComputedStyle(el); - const radii = {}; - for (const corner of cornerRadiusProps) { - radii[corner] = style[corner]; - } - const entry = cropMeasurements.get(name) ?? {}; - entry[phase] = { width: rect.width, height: rect.height, radii }; - cropMeasurements.set(name, entry); - } - }); - /** - * With both snapshots measured, settle which layers crop. The default crops - * only a morph whose aspect ratio *changes* between snapshots - the one case - * where `object-fit: cover` does real work. A same-aspect morph or a - * fade-only layer is left uncropped: its corners scale naturally (no flash - * from squaring, no `overflow: clip` eating its shadow) and a backdrop can't - * be clipped to nothing. An explicit `.crop(true | false)` overrides either - * way. Runs after both snapshots are measured, since aspect needs both. - */ - const finalizeCrop = () => { - croppedNames.clear(); - for (const name of layerStagger.keys()) { - if (name === "root") - continue; - // An explicit `.crop(true | false)` wins; otherwise crop a morph - // whose aspect ratio changed. - if (cropForName.get(name) ?? aspectChanged(name)) { - croppedNames.add(name); - } - } - }; - /** - * Whether a layer is a morph whose box aspect ratio changed between - * snapshots (beyond a small tolerance). Fade-only layers (one snapshot) are - * never "changed". - */ - const aspectChanged = (name) => { - const box = cropMeasurements.get(name); - if (!box?.old || !box?.new || !box.old.height || !box.new.height) { - return false; - } - return (Math.abs(box.old.width / box.old.height - - box.new.width / box.new.height) > ASPECT_TOLERANCE); - }; - /** - * Write the persistent view-transition CSS: suppress root capture when the - * root has no animations of its own; force linear timing (baked into the - * keyframes, so we can retime later via updateTiming); and clip + - * object-fit: cover every cropped morph (the UA default overflows on - * aspect-ratio change). - * - * `css.commit` replaces rather than appends, so we re-set the full rule set - * each call - the crop rules are only known after `finalizeCrop` runs in the - * update callback, so the second call writes them. - */ - const commitViewCSS = () => { - if (!hasTarget("root", targets)) { - css.set(":root", { "view-transition-name": "none" }); - } - css.set("::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)", { "animation-timing-function": "linear !important" }); - croppedNames.forEach((name) => { - css.set(`::view-transition-group(${name})`, { overflow: "clip" }); - css.set(`::view-transition-old(${name}), ::view-transition-new(${name})`, { width: "100%", height: "100%", "object-fit": "cover" }); - }); - /** - * Clip the nested children of any layer that clips in the live layout, - * so a wrapper crops its child for the whole morph (mirroring the DOM) - * rather than only at the live-DOM handoff. No-op on browsers without - * nested view-transition groups. - */ - clipChildren.forEach((name) => { - css.set(`::view-transition-group-children(${name})`, { - overflow: "clip", - }); - }); - css.commit(); // Write - }; - const cleanup = () => { - releaseViewTransitionNames(assigned, classed, grouped); - css.remove(); // Write - }; - const callback = async () => { - await update(); - /** - * Re-resolve so elements created by the update are named for the new - * snapshot, then measure them. With both snapshots measured we can - * settle the crop set (aspect-changing morphs + forced). - */ - resolveLayers("new"); - measureLayers("new"); - finalizeCrop(); - /** - * Re-commit the crop CSS unconditionally: `finalizeCrop` is computed - * here (after both snapshots are measured), so the clip rules must be - * (re)written to match the settled set. - */ - commitViewCSS(); - }; - let transition; - try { - resolveLayers("old"); - /** - * Measure the old snapshot against the optimistic crop set (the new - * snapshot doesn't exist yet, so aspect change can't be known here; - * `finalizeCrop` settles it post-update). - */ - measureLayers("old"); - commitViewCSS(); - transition = document.startViewTransition(callback); - } - catch (error) { - /** - * The prelude writes inline names before the transition exists. If it - * throws (e.g. startViewTransition rejects in a bad UA state), release - * them so we neither leak DOM state nor stall the queue on a promise - * that never settles - hand back a rejection it can advance past. - */ - cleanup(); - return Promise.reject(error); - } - transition.finished.finally(cleanup); - return new Promise((resolve, reject) => { - transition.ready - .then(() => { - const generatedViewAnimations = getViewAnimations(); - const animations = []; - /** - * Create animations for each of our explicitly-defined subjects. - * `opacityAnimated` additionally tracks which `${name}:${type}` - * we faded, so we can keep the UA `plus-lighter` blend only for a - * genuine opacity crossfade (both sides fading) and drop it for a - * slide/transform, where additive compositing would flash bright. - */ - const explicitlyAnimated = new Set(); - const opacityAnimated = new Set(); - layerTargets.forEach((target, name) => { - const stagger = layerStagger.get(name); - /** - * Presence: `enter` only fires for a pure newcomer (a new - * view with no old), `exit` only for a pure leaver. A - * survivor (both) gets neither - it just morphs. - */ - const enterApplies = !!stagger?.new && !stagger?.old; - const exitApplies = !!stagger?.old && !stagger?.new; - for (const key of definitionNames) { - if (!target[key]) - continue; - if (key === "enter" && !enterApplies) - continue; - if (key === "exit" && !exitApplies) - continue; - const type = chooseLayerType(key); - const [index, total] = staggerPosition(name, type); - // Skip a layer absent from its snapshot. - if (index === -1) - continue; - const { keyframes, options } = target[key]; - for (let [valueName, valueKeyframes] of Object.entries(keyframes)) { - // Skip only missing values - `0` (e.g. opacity: 0) - // is valid and must reach the from-value inference. - if (valueKeyframes == null) - continue; - /** - * The view path hands keyframes straight to WAAPI, - * so Motion's `x`/`y` shorthands (compiled to - * `transform` only via the value pipeline) have no - * effect. Warn and skip - use `transform`/`translate`. - */ - if (valueName === "x" || valueName === "y") { - motionUtils.warnOnce(false, `animateView() animates view-transition layers with CSS properties; the "${valueName}" shorthand has no effect - use transform, e.g. { transform: "translateX(40px)" }.`); - continue; - } - /** - * enter/exit win over new/old on a shared property - - * skip it here when the gated bucket also defines it. - */ - if (key === "new" && - enterApplies && - target.enter?.keyframes[valueName] != null) { - continue; - } - if (key === "old" && - exitApplies && - target.exit?.keyframes[valueName] != null) { - continue; - } - const valueOptions = mergeTransition(getValueTransition(defaultOptions, valueName), getValueTransition(options, valueName)); - /** - * Infer an origin for a single-value keyframe. An - * `enter` mirrors the matching `exit` value (a - * defined exit reverses into the enter for free); - * otherwise the per-type default (opacity 0/1, scale - * 0.85). No default -> left as-is (animates from the - * live value). - * - * `new`/`old` fire for survivors too, where only the - * opacity crossfade default applies - a transform - * default like scale 0.85 would pop a persisting - * element, so gate it on the layer actually - * entering/leaving. - */ - if (!Array.isArray(valueKeyframes)) { - const exitValue = key === "enter" - ? target.exit?.keyframes[valueName] - : undefined; - const allowDefault = valueName === "opacity" || - (type === "new" ? enterApplies : exitApplies); - const from = exitValue != null - ? Array.isArray(exitValue) - ? exitValue[exitValue.length - 1] - : exitValue - : allowDefault - ? ORIGIN_DEFAULTS[type]?.[valueName] - : undefined; - if (from !== undefined) { - valueKeyframes = [from, valueKeyframes]; - } - } - /** - * Resolve stagger function if provided, per element - * across this subject's resolved layers. - */ - if (typeof valueOptions.delay === "function") { - valueOptions.delay = valueOptions.delay(index, total); - } - valueOptions.duration && (valueOptions.duration = motionUtils.secondsToMilliseconds(valueOptions.duration)); - valueOptions.delay && (valueOptions.delay = motionUtils.secondsToMilliseconds(valueOptions.delay)); - animations.push(new NativeAnimation({ - ...valueOptions, - element: document.documentElement, - name: valueName, - pseudoElement: `::view-transition-${type}(${name})`, - keyframes: valueKeyframes, - })); - explicitlyAnimated.add(`${name}:${type}`); - if (valueName === "opacity") { - opacityAnimated.add(`${name}:${type}`); - } - } - } - }); - /** - * Handle browser generated animations - */ - for (const animation of generatedViewAnimations) { - if (animation.playState === "finished") - continue; - const { effect } = animation; - if (!effect || !(effect instanceof KeyframeEffect)) - continue; - const { pseudoElement } = effect; - if (!pseudoElement) - continue; - const name = getViewAnimationLayerInfo(pseudoElement); - if (!name) - continue; - const targetDefinition = layerTargets.get(name.layer); - /** - * We built our own animation for this layer, so drop the - * browser-generated fade we're replacing. The UA - * `plus-lighter` blend is a *separate* generated animation on - * the same pseudo (it sets `mix-blend-mode` in its keyframes): - * keep it *only* for a true opacity crossfade - both sides - * fading - so a symmetric crossfade composites without - * darkening, but a slide/transform (where both layers stay - * opaque and overlap) doesn't flash bright from the addition. - */ - if (explicitlyAnimated.has(`${name.layer}:${name.type}`)) { - const isCrossfade = opacityAnimated.has(`${name.layer}:new`) && - opacityAnimated.has(`${name.layer}:old`); - if (isCrossfade && - effect - .getKeyframes() - .some((keyframe) => keyframe.mixBlendMode)) { - animations.push(new NativeAnimationWrapper(animation)); - } - else { - animation.cancel(); - } - continue; - } - /** - * Drop the orphaned half of the default crossfade. The UA - * fades old out and new in as a *pair*; if the opposing half - * was explicitly overridden with something other than an - * opacity fade (a clip or transform reveal), this side's - * default opacity fade has no partner - left to run it would - * dissolve what should be a static backdrop (e.g. - * `.new({ clipPath })` should reveal over a still old view, - * not fade the old out around the growing clip). Cancel it - - * and its `plus-lighter` sibling on the same pseudo, which - * would otherwise flash bright where the two opaque layers - * overlap. A genuine crossfade (the opposing side also fading - * opacity) keeps both halves and is handled above. - */ - const opposite = name.type === "old" - ? "new" - : name.type === "new" - ? "old" - : undefined; - if (opposite && - explicitlyAnimated.has(`${name.layer}:${opposite}`) && - !opacityAnimated.has(`${name.layer}:${opposite}`)) { - animation.cancel(); - continue; - } - /** - * Otherwise retime the browser-generated animation to - * Motion's timing. This auto-enables the layout (group) - * morph for any resolved/named target, and applies the - * default timing to old/new layers we haven't explicitly - * overridden. - * - * group + group-children both follow the layout timing so - * the nesting container stays in sync with the morph. - */ - /** - * A survivor's old + new are the two halves of one - * `plus-lighter` crossfade. They must share identical timing - * (so their opacities stay mirrored and sum to 1 - else the - * additive blend flashes bright wherever both are partly - * visible) and fade linearly (the bounce belongs on the - * group's geometry, not the opacity). So time them as the - * group, rather than via their own - potentially staggered, - * or enter/exit-derived - old/new options. - */ - const stagger = layerStagger.get(name.layer); - const isMorphCrossfade = (name.type === "old" || name.type === "new") && - !!stagger?.old && - !!stagger?.new; - let timing; - if (name.type.startsWith("group")) { - // group + group-children follow the resolved group - // timing - the single source shared with the crop - // corner-radius pass below. - const { delay, duration, ease } = resolveGroupTiming(name.layer); - timing = { - delay, - duration, - easing: mapEasingToNativeEasing(ease, duration), - }; - } - else { - const timingType = isMorphCrossfade ? "group" : name.type; - const [index, total] = staggerPosition(name.layer, timingType); - const transitionName = timingType === "group" ? "layout" : ""; - let animationTransition = resolveLayerTransition(targetDefinition, timingType, transitionName, index === -1 ? 0 : index, total); - /** - * The crossfade should resolve at the spring's - * *perceptual* (visual) duration - the geometry can keep - * bouncing, but the opacity shouldn't drag through the - * settle. So capture `visualDuration` before - * `applyGeneratorOptions` replaces it with the full - * overshoot duration, and use it for the fade. - */ - const visualDuration = animationTransition.visualDuration; - animationTransition.duration && (animationTransition.duration = motionUtils.secondsToMilliseconds(animationTransition.duration)); - animationTransition = - applyGeneratorOptions(animationTransition); - timing = { - delay: motionUtils.secondsToMilliseconds(animationTransition.delay ?? 0), - duration: isMorphCrossfade && visualDuration !== undefined - ? motionUtils.secondsToMilliseconds(visualDuration) - : animationTransition.duration, - easing: isMorphCrossfade - ? "linear" - : mapEasingToNativeEasing(animationTransition.ease, animationTransition.duration), - }; - } - effect.updateTiming(timing); - animations.push(new NativeAnimationWrapper(animation)); - } - /** - * Round each cropped layer's clip. Its `::view-transition-group` - * has `overflow: clip`, which would otherwise square the corners - * mid-morph; animate each corner from the old element's radius to - * the new element's so the crop stays rounded. Timed as the group - * (`layout`) so the radius tracks the morphing box. - */ - cropMeasurements.forEach((entry, name) => { - if (!croppedNames.has(name)) - return; - // Reuse the group's resolved timing - native ms delay/ - // duration + a baked ease, with no generator `type` or - // repeat/times to leak into (or throw inside) NativeAnimation. - const { delay, duration, ease } = resolveGroupTiming(name); - for (const corner of cornerRadiusProps) { - // `||` (not `??`) so an empty measurement falls back to - // the other snapshot rather than an invalid keyframe. - const from = entry.old?.radii[corner] || - entry.new?.radii[corner] || - "0px"; - const to = entry.new?.radii[corner] || - entry.old?.radii[corner] || - "0px"; - // Nothing to round if the corner is square at both ends. - if (isSquareRadius(from) && isSquareRadius(to)) - continue; - animations.push(new NativeAnimation({ - element: document.documentElement, - name: corner, - pseudoElement: `::view-transition-group(${name})`, - keyframes: [from, to], - delay, - duration, - ease, - })); - } - }); - resolve(new GroupAnimation(animations)); - }) - .catch(() => - /** - * `ready` rejects when the transition is skipped - no visual - * change, or superseded by an interrupting transition. The DOM - * update still applied, so settle with no animations rather than - * surfacing it as an error to an awaiting caller. A genuine - * failure in `update()` rejects `updateCallbackDone` (already - * settled by now), so propagate that instead. - */ - transition.updateCallbackDone.then(() => resolve(new GroupAnimation([])), reject)); - }); -} -/** - * The options that should time a given generated layer type, so a retimed - * group/old/new picks up any per-target transition the user provided. Checks - * the type's buckets in priority order (e.g. `new` before `enter`). - */ -function layerOptions(target, type) { - for (const bucket of typeBuckets[type] ?? []) { - const options = target?.[bucket]?.options; - if (options) - return options; - } -} -/** - * Merge a base transition (e.g. the default `options`) with a per-layer/value - * override. An explicit `duration` on the override must win over an inherited - * generator's own timing: a spring prefers `visualDuration`, and - * `spring.applyToOptions` overwrites `duration` with the computed settle time - - * so without this the override is silently discarded. Dropping the inherited - * `type`/`visualDuration` makes the layer a plain tween of that duration, unless - * it asked for its own generator `type`/`visualDuration`. - */ -function mergeTransition(base, override) { - const merged = { ...base, ...override }; - if (override.duration !== undefined) { - if (override.visualDuration === undefined) - delete merged.visualDuration; - if (override.type === undefined) - delete merged.type; - } - return merged; -} - -let builders = []; -let current = null; -function next() { - current = null; - const [nextBuilder] = builders; - if (nextBuilder) - start(nextBuilder); -} -function start(builder) { - motionUtils.removeItem(builders, builder); - current = builder; - startViewAnimation(builder) - .then((animation) => { - builder.notifyReady(animation); - return animation.finished; - }) - // A genuinely failed transition (a throwing update) rejects the - // builder; a skipped/interrupted one resolves with no animations (see - // start.ts). Either way, advance the queue - else later transitions hang. - .catch((error) => builder.notifyReject(error)) - .finally(next); -} -function processQueue() { - /** - * Iterate backwards over the builders array. We can ignore the - * "wait" animations. If we have an interrupting animation in the - * queue then we need to batch all preceeding animations into it. - * Currently this only batches the update functions but will also - * need to batch the targets. - */ - for (let i = builders.length - 1; i >= 0; i--) { - const builder = builders[i]; - const { interrupt } = builder.options; - if (interrupt === "immediate") { - const batchedUpdates = builders.slice(0, i + 1).map((b) => b.update); - const remaining = builders.slice(i + 1); - builder.update = () => { - batchedUpdates.forEach((update) => update()); - }; - // Put the current builder at the front, followed by any "wait" builders - builders = [builder, ...remaining]; - break; - } - } - if (!current || builders[0]?.options.interrupt === "immediate") { - next(); - } -} -function addToQueue(builder) { - builders.push(builder); - microtask.render(processQueue); -} - -class ViewTransitionBuilder { - constructor(update, options = {}) { - this.currentSubject = "root"; - this.targets = new Map(); - /** - * Definitions that must be resolved to elements (and assigned a - * `view-transition-name`) rather than treated as pre-named layers. - */ - this.resolveDefs = new Set(); - /** - * Per-subject crop override: `true` forces the crop (clip + object-fit: - * cover + animated corner radii) on, `false` forces it off. A subject with - * no entry uses the default - crop only a genuine morph (a layer present in - * both snapshots), so a fade-only enter/exit isn't clipped to nothing. - */ - this.cropOverride = new Map(); - /** - * Subjects paired with a different new-snapshot target (the second `.add()` - * argument), so two distinct elements share one name and morph into each - * other - a shared-element transition. - */ - this.pairs = new Map(); - /** - * A `view-transition-class` to apply to each subject's resolved elements, - * so authors can target the generated layers from CSS by class rather than - * the opaque generated name. - */ - this.classNames = new Map(); - /** - * Subjects opted out of automatic group nesting via `.group(false)`. Their - * layer stays a flat top-level group (`view-transition-group: none`) instead - * of nesting under its DOM-ancestor layer - so it animates independently and - * escapes an ancestor's clip/transform (e.g. an element that lifts out of a - * card and flies across, which nesting would clip to the card). - */ - this.flatGroups = new Set(); - this.notifyReady = motionUtils.noop; - this.notifyReject = motionUtils.noop; - this.readyPromise = new Promise((resolve, reject) => { - this.notifyReady = resolve; - this.notifyReject = reject; - }); - this.update = update; - this.options = { - interrupt: "wait", - ...options, - }; - // Avoid an unhandled rejection when a failed transition has no - // `.then(_, reject)` handler attached (e.g. fire-and-forget). - this.readyPromise.catch(motionUtils.noop); - addToQueue(this); - } - /** - * Target elements resolved from a selector or Element, each assigned a - * `view-transition-name` automatically. - * - * Passing a second target pairs them: the first is resolved in the old - * snapshot and the second in the new, sharing one name so two *different* - * elements morph into each other (e.g. `.add(card, ".modal")`). Symmetric - - * pass them the other way round to morph back. - */ - add(subject, newSubject) { - this.currentSubject = subject; - this.resolveDefs.add(subject); - if (newSubject !== undefined) - this.pairs.set(subject, newSubject); - // Register the subject so it participates (and gets an automatic - // layout/morph animation) even without an explicit enter/exit/layout. - if (!this.targets.has(subject)) - this.targets.set(subject, {}); - return this; - } - /** - * Control this subject's crop (clip + `object-fit: cover` + animated - * corners). By default a subject auto-crops only when it actually morphs - - * present in both snapshots (a survivor, or an `.add(a, b)` pair). A - * fade-only enter/exit has no second box to crop against, so it's left to - * the browser default; in particular the `overflow: clip` a crop adds would - * otherwise clip a mis-sized enter/exit layer to nothing. - * - * `.crop(false)` forces the crop off (e.g. a text morph, where - * `object-fit: cover` clips glyphs as the box grows); `.crop(true)` forces - * it on for a non-morph the default wouldn't otherwise crop. - */ - crop(enabled = true) { - this.cropOverride.set(this.currentSubject, enabled); - return this; - } - /** - * By default a subject's layer nests under its nearest DOM-ancestor layer - * (`view-transition-group: contain`), so the ancestor's clip/transform/opacity - * apply to it through the transition - mirroring how the DOM actually paints, - * and letting a wrapper crop its child for the whole morph rather than only - * once the live DOM takes back over. (Needs a browser that supports nested - * view-transition groups; elsewhere it degrades to the flat default.) - * - * Call `.group(false)` to opt out: the layer stays flat and top-level, so it - * animates independently and escapes an ancestor's clip - e.g. an element - * that should lift out of a card and fly across, which nesting would clip. - */ - group(enabled = true) { - enabled - ? this.flatGroups.delete(this.currentSubject) - : this.flatGroups.add(this.currentSubject); - return this; - } - /** - * Tag this subject's generated layers with a `view-transition-class`, so - * they can be targeted from CSS - `::view-transition-group(.name)`, - * `::view-transition-old/new(.name)`, `::view-transition-image-pair(.name)` - * - without the opaque generated `view-transition-name`. Because `.add()` - * can match many elements, a shared class targets them all at once (and, - * for a pair, both ends). The escape hatch for z-index / custom keyframes - * on a morph layer. - */ - class(name) { - this.classNames.set(this.currentSubject, name); - return this; - } - /** - * Set the transition for this subject's morph. The morph is enabled - * automatically by `.add()`; this just customises its timing (duration, - * easing, a `delay`/`stagger`, …). On the implicit `root` subject it also - * opts the page into the transition (the root crossfade). - */ - layout(options = {}) { - this.updateTarget("layout", {}, options); - return this; - } - enter(keyframes, options) { - this.updateTarget("enter", keyframes, options); - return this; - } - exit(keyframes, options) { - this.updateTarget("exit", keyframes, options); - return this; - } - /** - * Animate the new view directly, whether the element is appearing or - * persisting (unlike `.enter()`, which only fires for a pure newcomer). - * Pair with `.old()` for a crossfade or slide-through. - */ - new(keyframes, options) { - this.updateTarget("new", keyframes, options); - return this; - } - /** - * Animate the old view directly, whether the element is leaving or - * persisting (unlike `.exit()`, which only fires for a pure leaver). - */ - old(keyframes, options) { - this.updateTarget("old", keyframes, options); - return this; - } - updateTarget(target, keyframes, options = {}) { - const { currentSubject, targets } = this; - if (!targets.has(currentSubject)) { - targets.set(currentSubject, {}); - } - const targetData = targets.get(currentSubject); - targetData[target] = { keyframes, options }; - } - then(resolve, reject) { - return this.readyPromise.then(resolve, reject); - } -} -function animateView(update, options = {}) { - return new ViewTransitionBuilder(update, options); -} - -const createAxisDelta = () => ({ - translate: 0, - scale: 1, - origin: 0, - originPoint: 0, -}); -const createDelta = () => ({ - x: createAxisDelta(), - y: createAxisDelta(), -}); -const createAxis = () => ({ min: 0, max: 0 }); -const createBox = () => ({ - x: createAxis(), - y: createAxis(), -}); - -const visualElementStore = new WeakMap(); - -function isAnimationControls(v) { - return (v !== null && - typeof v === "object" && - typeof v.start === "function"); -} - -/** - * Decides if the supplied variable is variant label - */ -function isVariantLabel(v) { - return typeof v === "string" || Array.isArray(v); -} - -const variantPriorityOrder = [ - "animate", - "whileInView", - "whileFocus", - "whileHover", - "whileTap", - "whileDrag", - "exit", -]; -const variantProps = ["initial", ...variantPriorityOrder]; - -function isControllingVariants(props) { - return (isAnimationControls(props.animate) || - variantProps.some((name) => isVariantLabel(props[name]))); -} -function isVariantNode(props) { - return Boolean(isControllingVariants(props) || props.variants); -} - -/** - * Updates motion values from props changes. - * Uses `any` type for element to avoid circular dependencies with VisualElement. - */ -function updateMotionValuesFromProps(element, next, prev) { - for (const key in next) { - const nextValue = next[key]; - const prevValue = prev[key]; - if (isMotionValue(nextValue)) { - /** - * If this is a motion value found in props or style, we want to add it - * to our visual element's motion value map. - */ - element.addValue(key, nextValue); - } - else if (isMotionValue(prevValue)) { - /** - * If we're swapping from a motion value to a static value, - * create a new motion value from that - */ - element.addValue(key, motionValue(nextValue, { owner: element })); - } - else if (prevValue !== nextValue) { - /** - * If this is a flat value that has changed, update the motion value - * or create one if it doesn't exist. We only want to do this if we're - * not handling the value with our animation state. - */ - if (element.hasValue(key)) { - const existingValue = element.getValue(key); - if (existingValue.liveStyle === true) { - existingValue.jump(nextValue); - } - else if (!existingValue.hasAnimated) { - existingValue.set(nextValue); - } - } - else { - const latestValue = element.getStaticValue(key); - element.addValue(key, motionValue(latestValue !== undefined ? latestValue : nextValue, { owner: element })); - } - } - } - // Handle removed values - for (const key in prev) { - if (next[key] === undefined) - element.removeValue(key); - } - return next; -} - -// Does this device prefer reduced motion? Returns `null` server-side. -const prefersReducedMotion = { current: null }; -const hasReducedMotionListener = { current: false }; - -const isBrowser = typeof window !== "undefined"; -function initPrefersReducedMotion() { - hasReducedMotionListener.current = true; - if (!isBrowser) - return; - if (window.matchMedia) { - const motionMediaQuery = window.matchMedia("(prefers-reduced-motion)"); - const setReducedMotionPreferences = () => (prefersReducedMotion.current = motionMediaQuery.matches); - motionMediaQuery.addEventListener("change", setReducedMotionPreferences); - setReducedMotionPreferences(); - } - else { - prefersReducedMotion.current = false; - } -} - -const propEventHandlers = [ - "AnimationStart", - "AnimationComplete", - "Update", - "BeforeLayoutMeasure", - "LayoutMeasure", - "LayoutAnimationStart", - "LayoutAnimationComplete", -]; -/** - * Static feature definitions - can be injected by framework layer - */ -let featureDefinitions = {}; -/** - * Set feature definitions for all VisualElements. - * This should be called by the framework layer (e.g., framer-motion) during initialization. - */ -function setFeatureDefinitions(definitions) { - featureDefinitions = definitions; -} -/** - * Get the current feature definitions - */ -function getFeatureDefinitions() { - return featureDefinitions; -} -/** - * A VisualElement is an imperative abstraction around UI elements such as - * HTMLElement, SVGElement, Three.Object3D etc. - */ -class VisualElement { - /** - * This method takes React props and returns found MotionValues. For example, HTML - * MotionValues will be found within the style prop, whereas for Three.js within attribute arrays. - * - * This isn't an abstract method as it needs calling in the constructor, but it is - * intended to be one. - */ - scrapeMotionValuesFromProps(_props, _prevProps, _visualElement) { - return {}; - } - constructor({ parent, props, presenceContext, reducedMotionConfig, skipAnimations, blockInitialAnimation, visualState, }, options = {}) { - /** - * A reference to the current underlying Instance, e.g. a HTMLElement - * or Three.Mesh etc. - */ - this.current = null; - /** - * A set containing references to this VisualElement's children. - */ - this.children = new Set(); - /** - * Determine what role this visual element should take in the variant tree. - */ - this.isVariantNode = false; - this.isControllingVariants = false; - /** - * Decides whether this VisualElement should animate in reduced motion - * mode. - * - * TODO: This is currently set on every individual VisualElement but feels - * like it could be set globally. - */ - this.shouldReduceMotion = null; - /** - * Decides whether animations should be skipped for this VisualElement. - * Useful for E2E tests and visual regression testing. - */ - this.shouldSkipAnimations = false; - /** - * A map of all motion values attached to this visual element. Motion - * values are source of truth for any given animated value. A motion - * value might be provided externally by the component via props. - */ - this.values = new Map(); - this.KeyframeResolver = KeyframeResolver; - /** - * Cleanup functions for active features (hover/tap/exit etc) - */ - this.features = {}; - /** - * A map of every subscription that binds the provided or generated - * motion values onChange listeners to this visual element. - */ - this.valueSubscriptions = new Map(); - /** - * A reference to the previously-provided motion values as returned - * from scrapeMotionValuesFromProps. We use the keys in here to determine - * if any motion values need to be removed after props are updated. - */ - this.prevMotionValues = {}; - /** - * Track whether this element has been mounted before, to detect - * remounts after Suspense unmount/remount cycles. - */ - this.hasBeenMounted = false; - /** - * An object containing a SubscriptionManager for each active event. - */ - this.events = {}; - /** - * An object containing an unsubscribe function for each prop event subscription. - * For example, every "Update" event can have multiple subscribers via - * VisualElement.on(), but only one of those can be defined via the onUpdate prop. - */ - this.propEventSubscriptions = {}; - this.notifyUpdate = () => this.notify("Update", this.latestValues); - this.render = () => { - if (!this.current) - return; - this.triggerBuild(); - this.renderInstance(this.current, this.renderState, this.props.style, this.projection); - }; - this.renderScheduledAt = 0.0; - this.scheduleRender = () => { - const now = time.now(); - if (this.renderScheduledAt < now) { - this.renderScheduledAt = now; - frame.render(this.render, false, true); - } - }; - const { latestValues, renderState } = visualState; - this.latestValues = latestValues; - this.baseTarget = { ...latestValues }; - this.initialValues = props.initial ? { ...latestValues } : {}; - this.renderState = renderState; - this.parent = parent; - this.props = props; - this.presenceContext = presenceContext; - this.depth = parent ? parent.depth + 1 : 0; - this.reducedMotionConfig = reducedMotionConfig; - this.skipAnimationsConfig = skipAnimations; - this.options = options; - this.blockInitialAnimation = Boolean(blockInitialAnimation); - this.isControllingVariants = isControllingVariants(props); - this.isVariantNode = isVariantNode(props); - if (this.isVariantNode) { - this.variantChildren = new Set(); - } - this.manuallyAnimateOnMount = Boolean(parent && parent.current); - /** - * Any motion values that are provided to the element when created - * aren't yet bound to the element, as this would technically be impure. - * However, we iterate through the motion values and set them to the - * initial values for this component. - * - * TODO: This is impure and we should look at changing this to run on mount. - * Doing so will break some tests but this isn't necessarily a breaking change, - * more a reflection of the test. - */ - const { willChange, ...initialMotionValues } = this.scrapeMotionValuesFromProps(props, {}, this); - for (const key in initialMotionValues) { - const value = initialMotionValues[key]; - if (latestValues[key] !== undefined && isMotionValue(value)) { - value.set(latestValues[key]); - } - } - } - mount(instance) { - /** - * If this element has been mounted before (e.g. after a Suspense - * unmount/remount), reset motion values to their initial state - * so animations replay correctly from initial → animate. - */ - if (this.hasBeenMounted) { - for (const key in this.initialValues) { - this.values.get(key)?.jump(this.initialValues[key]); - this.latestValues[key] = this.initialValues[key]; - } - } - this.current = instance; - visualElementStore.set(instance, this); - if (this.projection && !this.projection.instance) { - this.projection.mount(instance); - } - if (this.parent && this.isVariantNode && !this.isControllingVariants) { - this.removeFromVariantTree = this.parent.addVariantChild(this); - } - this.values.forEach((value, key) => this.bindToMotionValue(key, value)); - /** - * Determine reduced motion preference. Only initialize the matchMedia - * listener if we actually need the dynamic value (i.e., when config - * is neither "never" nor "always"). - */ - if (this.reducedMotionConfig === "never") { - this.shouldReduceMotion = false; - } - else if (this.reducedMotionConfig === "always") { - this.shouldReduceMotion = true; - } - else { - if (!hasReducedMotionListener.current) { - initPrefersReducedMotion(); - } - this.shouldReduceMotion = prefersReducedMotion.current; - } - if (process.env.NODE_ENV !== "production") { - motionUtils.warnOnce(this.shouldReduceMotion !== true, "You have Reduced Motion enabled on your device. Animations may not appear as expected.", "reduced-motion-disabled"); - } - /** - * Set whether animations should be skipped based on the config. - */ - this.shouldSkipAnimations = this.skipAnimationsConfig ?? false; - this.parent?.addChild(this); - this.update(this.props, this.presenceContext); - this.hasBeenMounted = true; - } - unmount() { - this.projection && this.projection.unmount(); - cancelFrame(this.notifyUpdate); - cancelFrame(this.render); - this.valueSubscriptions.forEach((remove) => remove()); - this.valueSubscriptions.clear(); - this.removeFromVariantTree && this.removeFromVariantTree(); - this.parent?.removeChild(this); - for (const key in this.events) { - this.events[key].clear(); - } - for (const key in this.features) { - const feature = this.features[key]; - if (feature) { - feature.unmount(); - feature.isMounted = false; - } - } - this.current = null; - } - addChild(child) { - this.children.add(child); - this.enteringChildren ?? (this.enteringChildren = new Set()); - this.enteringChildren.add(child); - } - removeChild(child) { - this.children.delete(child); - this.enteringChildren && this.enteringChildren.delete(child); - } - bindToMotionValue(key, value) { - if (this.valueSubscriptions.has(key)) { - this.valueSubscriptions.get(key)(); - } - if (value.accelerate && - acceleratedValues.has(key) && - this.current instanceof HTMLElement) { - const { factory, keyframes, times, ease, duration } = value.accelerate; - const animation = new NativeAnimation({ - element: this.current, - name: key, - keyframes, - times, - ease, - duration: motionUtils.secondsToMilliseconds(duration), - }); - const cleanup = factory(animation); - this.valueSubscriptions.set(key, () => { - cleanup(); - animation.cancel(); - }); - return; - } - const valueIsTransform = transformProps.has(key); - if (valueIsTransform && this.onBindTransform) { - this.onBindTransform(); - } - const removeOnChange = value.on("change", (latestValue) => { - this.latestValues[key] = latestValue; - this.props.onUpdate && frame.preRender(this.notifyUpdate); - if (valueIsTransform && this.projection) { - this.projection.isTransformDirty = true; - } - this.scheduleRender(); - }); - let removeSyncCheck; - if (typeof window !== "undefined" && - window.MotionCheckAppearSync) { - removeSyncCheck = window.MotionCheckAppearSync(this, key, value); - } - this.valueSubscriptions.set(key, () => { - removeOnChange(); - if (removeSyncCheck) - removeSyncCheck(); - // Defer to MotionValue.on("change") auto-stop so React 19 remounts - // can resubscribe before the animation is cancelled (#3315). - }); - } - sortNodePosition(other) { - /** - * If these nodes aren't even of the same type we can't compare their depth. - */ - if (!this.current || - !this.sortInstanceNodePosition || - this.type !== other.type) { - return 0; - } - return this.sortInstanceNodePosition(this.current, other.current); - } - updateFeatures() { - let key = "animation"; - for (key in featureDefinitions) { - const featureDefinition = featureDefinitions[key]; - if (!featureDefinition) - continue; - const { isEnabled, Feature: FeatureConstructor } = featureDefinition; - /** - * If this feature is enabled but not active, make a new instance. - */ - if (!this.features[key] && - FeatureConstructor && - isEnabled(this.props)) { - this.features[key] = new FeatureConstructor(this); - } - /** - * If we have a feature, mount or update it. - */ - if (this.features[key]) { - const feature = this.features[key]; - if (feature.isMounted) { - feature.update(); - } - else { - feature.mount(); - feature.isMounted = true; - } - } - } - } - triggerBuild() { - this.build(this.renderState, this.latestValues, this.props); - } - /** - * Measure the current viewport box with or without transforms. - * Only measures axis-aligned boxes, rotate and skew must be manually - * removed with a re-render to work. - */ - measureViewportBox() { - return this.current - ? this.measureInstanceViewportBox(this.current, this.props) - : createBox(); - } - getStaticValue(key) { - return this.latestValues[key]; - } - setStaticValue(key, value) { - this.latestValues[key] = value; - } - /** - * Update the provided props. Ensure any newly-added motion values are - * added to our map, old ones removed, and listeners updated. - */ - update(props, presenceContext) { - if (props.transformTemplate || this.props.transformTemplate) { - this.scheduleRender(); - } - this.prevProps = this.props; - this.props = props; - this.prevPresenceContext = this.presenceContext; - this.presenceContext = presenceContext; - /** - * Update prop event handlers ie onAnimationStart, onAnimationComplete - */ - for (let i = 0; i < propEventHandlers.length; i++) { - const key = propEventHandlers[i]; - if (this.propEventSubscriptions[key]) { - this.propEventSubscriptions[key](); - delete this.propEventSubscriptions[key]; - } - const listenerName = ("on" + key); - const listener = props[listenerName]; - if (listener) { - this.propEventSubscriptions[key] = this.on(key, listener); - } - } - this.prevMotionValues = updateMotionValuesFromProps(this, this.scrapeMotionValuesFromProps(props, this.prevProps || {}, this), this.prevMotionValues); - if (this.handleChildMotionValue) { - this.handleChildMotionValue(); - } - } - getProps() { - return this.props; - } - /** - * Returns the variant definition with a given name. - */ - getVariant(name) { - return this.props.variants ? this.props.variants[name] : undefined; - } - /** - * Returns the defined default transition on this component. - */ - getDefaultTransition() { - return this.props.transition; - } - getTransformPagePoint() { - return this.props.transformPagePoint; - } - getClosestVariantNode() { - return this.isVariantNode - ? this - : this.parent - ? this.parent.getClosestVariantNode() - : undefined; - } - /** - * Add a child visual element to our set of children. - */ - addVariantChild(child) { - const closestVariantNode = this.getClosestVariantNode(); - if (closestVariantNode) { - closestVariantNode.variantChildren && - closestVariantNode.variantChildren.add(child); - return () => closestVariantNode.variantChildren.delete(child); - } - } - /** - * Add a motion value and bind it to this visual element. - */ - addValue(key, value) { - // Remove existing value if it exists - const existingValue = this.values.get(key); - if (value !== existingValue) { - if (existingValue) - this.removeValue(key); - this.bindToMotionValue(key, value); - this.values.set(key, value); - this.latestValues[key] = value.get(); - } - } - /** - * Remove a motion value and unbind any active subscriptions. - */ - removeValue(key) { - this.values.delete(key); - const unsubscribe = this.valueSubscriptions.get(key); - if (unsubscribe) { - unsubscribe(); - this.valueSubscriptions.delete(key); - } - delete this.latestValues[key]; - this.removeValueFromRenderState(key, this.renderState); - } - /** - * Check whether we have a motion value for this key - */ - hasValue(key) { - return this.values.has(key); - } - getValue(key, defaultValue) { - if (this.props.values && this.props.values[key]) { - return this.props.values[key]; - } - let value = this.values.get(key); - if (value === undefined && defaultValue !== undefined) { - value = motionValue(defaultValue === null ? undefined : defaultValue, { owner: this }); - this.addValue(key, value); - } - return value; - } - /** - * If we're trying to animate to a previously unencountered value, - * we need to check for it in our state and as a last resort read it - * directly from the instance (which might have performance implications). - */ - readValue(key, target) { - let value = this.latestValues[key] !== undefined || !this.current - ? this.latestValues[key] - : this.getBaseTargetFromProps(this.props, key) ?? - this.readValueFromInstance(this.current, key, this.options); - if (value !== undefined && value !== null) { - if (typeof value === "string" && - (motionUtils.isNumericalString(value) || motionUtils.isZeroValueString(value))) { - // If this is a number read as a string, ie "0" or "200", convert it to a number - value = parseFloat(value); - } - else if (!findValueType(value) && complex.test(target)) { - value = getAnimatableNone(key, target); - } - this.setBaseTarget(key, isMotionValue(value) ? value.get() : value); - } - return isMotionValue(value) ? value.get() : value; - } - /** - * Set the base target to later animate back to. This is currently - * only hydrated on creation and when we first read a value. - */ - setBaseTarget(key, value) { - this.baseTarget[key] = value; - } - /** - * Find the base target for a value thats been removed from all animation - * props. - */ - getBaseTarget(key) { - const { initial } = this.props; - let valueFromInitial; - if (typeof initial === "string" || typeof initial === "object") { - const variant = resolveVariantFromProps(this.props, initial, this.presenceContext?.custom); - if (variant) { - valueFromInitial = variant[key]; - } - } - /** - * If this value still exists in the current initial variant, read that. - */ - if (initial && valueFromInitial !== undefined) { - return valueFromInitial; - } - /** - * Alternatively, if this VisualElement config has defined a getBaseTarget - * so we can read the value from an alternative source, try that. - */ - const target = this.getBaseTargetFromProps(this.props, key); - if (target !== undefined && !isMotionValue(target)) - return target; - /** - * If the value was initially defined on initial, but it doesn't any more, - * return undefined. Otherwise return the value as initially read from the DOM. - */ - return this.initialValues[key] !== undefined && - valueFromInitial === undefined - ? undefined - : this.baseTarget[key]; - } - on(eventName, callback) { - if (!this.events[eventName]) { - this.events[eventName] = new motionUtils.SubscriptionManager(); - } - return this.events[eventName].add(callback); - } - notify(eventName, ...args) { - if (this.events[eventName]) { - this.events[eventName].notify(...args); - } - } - scheduleRenderMicrotask() { - microtask.render(this.render); - } -} - -class DOMVisualElement extends VisualElement { - constructor() { - super(...arguments); - this.KeyframeResolver = DOMKeyframesResolver; - } - sortInstanceNodePosition(a, b) { - /** - * compareDocumentPosition returns a bitmask, by using the bitwise & - * we're returning true if 2 in that bitmask is set to true. 2 is set - * to true if b preceeds a. - */ - return a.compareDocumentPosition(b) & 2 ? 1 : -1; - } - getBaseTargetFromProps(props, key) { - const style = props.style; - return style ? style[key] : undefined; - } - removeValueFromRenderState(key, { vars, style }) { - delete vars[key]; - delete style[key]; - } - handleChildMotionValue() { - if (this.childSubscription) { - this.childSubscription(); - delete this.childSubscription; - } - const { children } = this.props; - if (isMotionValue(children)) { - this.childSubscription = children.on("change", (latest) => { - if (this.current) { - this.current.textContent = `${latest}`; - } - }); - } - } -} - -/** - * Feature base class for extending VisualElement functionality. - * Features are plugins that can be mounted/unmounted to add behavior - * like gestures, animations, or layout tracking. - */ -class Feature { - constructor(node) { - this.isMounted = false; - this.node = node; - } - update() { } -} - -/** - * Bounding boxes tend to be defined as top, left, right, bottom. For various operations - * it's easier to consider each axis individually. This function returns a bounding box - * as a map of single-axis min/max values. - */ -function convertBoundingBoxToBox({ top, left, right, bottom, }) { - return { - x: { min: left, max: right }, - y: { min: top, max: bottom }, - }; -} -function convertBoxToBoundingBox({ x, y }) { - return { top: y.min, right: x.max, bottom: y.max, left: x.min }; -} -/** - * Applies a TransformPoint function to a bounding box. TransformPoint is usually a function - * provided by Framer to allow measured points to be corrected for device scaling. This is used - * when measuring DOM elements and DOM event points. - */ -function transformBoxPoints(point, transformPoint) { - if (!transformPoint) - return point; - const topLeft = transformPoint({ x: point.left, y: point.top }); - const bottomRight = transformPoint({ x: point.right, y: point.bottom }); - return { - top: topLeft.y, - left: topLeft.x, - bottom: bottomRight.y, - right: bottomRight.x, - }; -} - -function isIdentityScale(scale) { - return scale === undefined || scale === 1; -} -function hasScale({ scale, scaleX, scaleY }) { - return (!isIdentityScale(scale) || - !isIdentityScale(scaleX) || - !isIdentityScale(scaleY)); -} -function hasTransform(values) { - return (hasScale(values) || - has2DTranslate(values) || - values.z || - values.rotate || - values.rotateX || - values.rotateY || - values.skewX || - values.skewY); -} -function has2DTranslate(values) { - return is2DTranslate(values.x) || is2DTranslate(values.y); -} -function is2DTranslate(value) { - return value && value !== "0%"; -} - -/** - * Scales a point based on a factor and an originPoint - */ -function scalePoint(point, scale, originPoint) { - const distanceFromOrigin = point - originPoint; - const scaled = scale * distanceFromOrigin; - return originPoint + scaled; -} -/** - * Applies a translate/scale delta to a point - */ -function applyPointDelta(point, translate, scale, originPoint, boxScale) { - if (boxScale !== undefined) { - point = scalePoint(point, boxScale, originPoint); - } - return scalePoint(point, scale, originPoint) + translate; -} -/** - * Applies a translate/scale delta to an axis - */ -function applyAxisDelta(axis, translate = 0, scale = 1, originPoint, boxScale) { - axis.min = applyPointDelta(axis.min, translate, scale, originPoint, boxScale); - axis.max = applyPointDelta(axis.max, translate, scale, originPoint, boxScale); -} -/** - * Applies a translate/scale delta to a box - */ -function applyBoxDelta(box, { x, y }) { - applyAxisDelta(box.x, x.translate, x.scale, x.originPoint); - applyAxisDelta(box.y, y.translate, y.scale, y.originPoint); -} -const TREE_SCALE_SNAP_MIN = 0.999999999999; -const TREE_SCALE_SNAP_MAX = 1.0000000000001; -/** - * Apply a tree of deltas to a box. We do this to calculate the effect of all the transforms - * in a tree upon our box before then calculating how to project it into our desired viewport-relative box - * - * This is the final nested loop within updateLayoutDelta for future refactoring - */ -function applyTreeDeltas(box, treeScale, treePath, isSharedTransition = false) { - const treeLength = treePath.length; - if (!treeLength) - return; - // Reset the treeScale - treeScale.x = treeScale.y = 1; - let node; - let delta; - for (let i = 0; i < treeLength; i++) { - node = treePath[i]; - delta = node.projectionDelta; - /** - * TODO: Prefer to remove this, but currently we have motion components with - * display: contents in Framer. - */ - const { visualElement } = node.options; - if (visualElement && - visualElement.props.style && - visualElement.props.style.display === "contents") { - continue; - } - if (isSharedTransition && - node.options.layoutScroll && - node.scroll && - node !== node.root) { - translateAxis(box.x, -node.scroll.offset.x); - translateAxis(box.y, -node.scroll.offset.y); - } - if (delta) { - // Incoporate each ancestor's scale into a cumulative treeScale for this component - treeScale.x *= delta.x.scale; - treeScale.y *= delta.y.scale; - // Apply each ancestor's calculated delta into this component's recorded layout box - applyBoxDelta(box, delta); - } - if (isSharedTransition && hasTransform(node.latestValues)) { - transformBox(box, node.latestValues, node.layout?.layoutBox); - } - } - /** - * Snap tree scale back to 1 if it's within a non-perceivable threshold. - * This will help reduce useless scales getting rendered. - */ - if (treeScale.x < TREE_SCALE_SNAP_MAX && - treeScale.x > TREE_SCALE_SNAP_MIN) { - treeScale.x = 1.0; - } - if (treeScale.y < TREE_SCALE_SNAP_MAX && - treeScale.y > TREE_SCALE_SNAP_MIN) { - treeScale.y = 1.0; - } -} -function translateAxis(axis, distance) { - axis.min += distance; - axis.max += distance; -} -/** - * Apply a transform to an axis from the latest resolved motion values. - * This function basically acts as a bridge between a flat motion value map - * and applyAxisDelta - */ -function transformAxis(axis, axisTranslate, axisScale, boxScale, axisOrigin = 0.5) { - const originPoint = mixNumber$1(axis.min, axis.max, axisOrigin); - // Apply the axis delta to the final axis - applyAxisDelta(axis, axisTranslate, axisScale, originPoint, boxScale); -} -function resolveAxisTranslate(value, axis) { - if (typeof value === "string") { - return (parseFloat(value) / 100) * (axis.max - axis.min); - } - return value; -} -/** - * Apply a transform to a box from the latest resolved motion values. - */ -function transformBox(box, transform, sourceBox) { - const resolveBox = sourceBox ?? box; - transformAxis(box.x, resolveAxisTranslate(transform.x, resolveBox.x), transform.scaleX, transform.scale, transform.originX); - transformAxis(box.y, resolveAxisTranslate(transform.y, resolveBox.y), transform.scaleY, transform.scale, transform.originY); -} - -function measureViewportBox(instance, transformPoint) { - return convertBoundingBoxToBox(transformBoxPoints(instance.getBoundingClientRect(), transformPoint)); -} -function measurePageBox(element, rootProjectionNode, transformPagePoint) { - const viewportBox = measureViewportBox(element, transformPagePoint); - const { scroll } = rootProjectionNode; - if (scroll) { - translateAxis(viewportBox.x, scroll.offset.x); - translateAxis(viewportBox.y, scroll.offset.y); - } - return viewportBox; -} - -const translateAlias = { - x: "translateX", - y: "translateY", - z: "translateZ", - transformPerspective: "perspective", -}; -const numTransforms = transformPropOrder.length; -/** - * Build a CSS transform style from individual x/y/scale etc properties. - * - * This outputs with a default order of transforms/scales/rotations, this can be customised by - * providing a transformTemplate function. - */ -function buildTransform(latestValues, transform, transformTemplate) { - // The transform string we're going to build into. - let transformString = ""; - let transformIsDefault = true; - /** - * Loop over all possible transforms in order, adding the ones that - * are present to the transform string. - */ - for (let i = 0; i < numTransforms; i++) { - const key = transformPropOrder[i]; - const value = latestValues[key]; - if (value === undefined) - continue; - let valueIsDefault = true; - if (typeof value === "number") { - valueIsDefault = value === (key.startsWith("scale") ? 1 : 0); - } - else { - const parsed = parseFloat(value); - valueIsDefault = key.startsWith("scale") ? parsed === 1 : parsed === 0; - } - if (!valueIsDefault || transformTemplate) { - const valueAsType = getValueAsType(value, numberValueTypes[key]); - if (!valueIsDefault) { - transformIsDefault = false; - const transformName = translateAlias[key] || key; - transformString += `${transformName}(${valueAsType}) `; - } - if (transformTemplate) { - transform[key] = valueAsType; - } - } - } - // `pathRotation` composes onto `rotate` as a separate additive term so - // the user's `rotate` is never clobbered. Deliberately not a slot in - // `transformPropOrder`. - const pathRotation = latestValues.pathRotation; - if (pathRotation) { - transformIsDefault = false; - transformString += `rotate(${getValueAsType(pathRotation, numberValueTypes.pathRotation)}) `; - } - transformString = transformString.trim(); - // If we have a custom `transform` template, pass our transform values and - // generated transformString to that before returning - if (transformTemplate) { - transformString = transformTemplate(transform, transformIsDefault ? "" : transformString); - } - else if (transformIsDefault) { - transformString = "none"; - } - return transformString; -} - -function buildHTMLStyles(state, latestValues, transformTemplate) { - const { style, vars, transformOrigin } = state; - // Track whether we encounter any transform or transformOrigin values. - let hasTransform = false; - let hasTransformOrigin = false; - /** - * Loop over all our latest animated values and decide whether to handle them - * as a style or CSS variable. - * - * Transforms and transform origins are kept separately for further processing. - */ - for (const key in latestValues) { - const value = latestValues[key]; - if (transformProps.has(key)) { - // If this is a transform, flag to enable further transform processing - hasTransform = true; - continue; - } - else if (isCSSVariableName(key)) { - vars[key] = value; - continue; - } - else { - // Convert the value to its default value type, ie 0 -> "0px" - const valueAsType = getValueAsType(value, numberValueTypes[key]); - if (key.startsWith("origin")) { - // If this is a transform origin, flag and enable further transform-origin processing - hasTransformOrigin = true; - transformOrigin[key] = - valueAsType; - } - else { - style[key] = valueAsType; - } - } - } - if (!latestValues.transform) { - if (hasTransform || transformTemplate) { - style.transform = buildTransform(latestValues, state.transform, transformTemplate); - } - else if (style.transform) { - /** - * If we have previously created a transform but currently don't have any, - * reset transform style to none. - */ - style.transform = "none"; - } - } - /** - * Build a transformOrigin style. Uses the same defaults as the browser for - * undefined origins. - */ - if (hasTransformOrigin) { - const { originX = "50%", originY = "50%", originZ = 0, } = transformOrigin; - style.transformOrigin = `${originX} ${originY} ${originZ}`; - } -} - -function renderHTML(element, { style, vars }, styleProp, projection) { - const elementStyle = element.style; - let key; - for (key in style) { - // CSSStyleDeclaration has [index: number]: string; in the types, so we use that as key type. - elementStyle[key] = style[key]; - } - // Write projection styles directly to element style - projection?.applyProjectionStyles(elementStyle, styleProp); - for (key in vars) { - // Loop over any CSS variables and assign those. - // They can only be assigned using `setProperty`. - elementStyle.setProperty(key, vars[key]); - } -} - -function pixelsToPercent(pixels, axis) { - if (axis.max === axis.min) - return 0; - return (pixels / (axis.max - axis.min)) * 100; -} -/** - * We always correct borderRadius as a percentage rather than pixels to reduce paints. - * For example, if you are projecting a box that is 100px wide with a 10px borderRadius - * into a box that is 200px wide with a 20px borderRadius, that is actually a 10% - * borderRadius in both states. If we animate between the two in pixels that will trigger - * a paint each time. If we animate between the two in percentage we'll avoid a paint. - */ -const correctBorderRadius = { - correct: (latest, node) => { - if (!node.target) - return latest; - /** - * If latest is a string, if it's a percentage we can return immediately as it's - * going to be stretched appropriately. Otherwise, if it's a pixel, convert it to a number. - */ - if (typeof latest === "string") { - if (px.test(latest)) { - latest = parseFloat(latest); - } - else { - return latest; - } - } - /** - * If latest is a number, it's a pixel value. We use the current viewportBox to calculate that - * pixel value as a percentage of each axis - */ - const x = pixelsToPercent(latest, node.target.x); - const y = pixelsToPercent(latest, node.target.y); - return `${x}% ${y}%`; - }, -}; - -const correctBoxShadow = { - correct: (latest, { treeScale, projectionDelta }) => { - const original = latest; - const shadow = complex.parse(latest); - // TODO: Doesn't support multiple shadows - if (shadow.length > 5) - return original; - const template = complex.createTransformer(latest); - const offset = typeof shadow[0] !== "number" ? 1 : 0; - // Calculate the overall context scale - const xScale = projectionDelta.x.scale * treeScale.x; - const yScale = projectionDelta.y.scale * treeScale.y; - shadow[0 + offset] /= xScale; - shadow[1 + offset] /= yScale; - /** - * Ideally we'd correct x and y scales individually, but because blur and - * spread apply to both we have to take a scale average and apply that instead. - * We could potentially improve the outcome of this by incorporating the ratio between - * the two scales. - */ - const averageScale = mixNumber$1(xScale, yScale, 0.5); - // Blur - if (typeof shadow[2 + offset] === "number") - shadow[2 + offset] /= averageScale; - // Spread - if (typeof shadow[3 + offset] === "number") - shadow[3 + offset] /= averageScale; - return template(shadow); - }, -}; - -const scaleCorrectors = { - borderRadius: { - ...correctBorderRadius, - applyTo: [...cornerRadiusProps], - }, - borderTopLeftRadius: correctBorderRadius, - borderTopRightRadius: correctBorderRadius, - borderBottomLeftRadius: correctBorderRadius, - borderBottomRightRadius: correctBorderRadius, - boxShadow: correctBoxShadow, -}; -function addScaleCorrector(correctors) { - for (const key in correctors) { - scaleCorrectors[key] = correctors[key]; - if (isCSSVariableName(key)) { - scaleCorrectors[key].isCSSVariable = true; - } - } -} - -function isForcedMotionValue(key, { layout, layoutId }) { - return (transformProps.has(key) || - key.startsWith("origin") || - ((layout || layoutId !== undefined) && - (!!scaleCorrectors[key] || key === "opacity"))); -} - -function scrapeMotionValuesFromProps$1(props, prevProps, visualElement) { - const style = props.style; - const prevStyle = prevProps?.style; - const newValues = {}; - if (!style) - return newValues; - for (const key in style) { - if (isMotionValue(style[key]) || - (prevStyle && isMotionValue(prevStyle[key])) || - isForcedMotionValue(key, props) || - visualElement?.getValue(key)?.liveStyle !== undefined) { - newValues[key] = style[key]; - } - } - return newValues; -} - -function getComputedStyle$1(element) { - return window.getComputedStyle(element); -} -class HTMLVisualElement extends DOMVisualElement { - constructor() { - super(...arguments); - this.type = "html"; - this.renderInstance = renderHTML; - } - mount(instance) { - /** - * If a custom component forwards its ref to something other than a - * HTML/SVG element (a class instance, an imperative handle) there's - * nothing for Motion to style, measure or attach gestures to. #2777 - */ - motionUtils.invariant(Boolean(instance.style), "motion.create() components must forward their ref to a HTML or SVG element", "custom-component-ref"); - super.mount(instance); - } - readValueFromInstance(instance, key) { - if (transformProps.has(key)) { - return this.projection?.isProjecting - ? defaultTransformValue(key) - : readTransformValue(instance, key); - } - else { - const computedStyle = getComputedStyle$1(instance); - const value = (isCSSVariableName(key) - ? computedStyle.getPropertyValue(key) - : computedStyle[key]) || 0; - return typeof value === "string" ? value.trim() : value; - } - } - measureInstanceViewportBox(instance, { transformPagePoint }) { - return measureViewportBox(instance, transformPagePoint); - } - build(renderState, latestValues, props) { - buildHTMLStyles(renderState, latestValues, props.transformTemplate); - } - scrapeMotionValuesFromProps(props, prevProps, visualElement) { - return scrapeMotionValuesFromProps$1(props, prevProps, visualElement); - } -} - -function isObjectKey(key, object) { - return key in object; -} -class ObjectVisualElement extends VisualElement { - constructor() { - super(...arguments); - this.type = "object"; - } - readValueFromInstance(instance, key) { - if (isObjectKey(key, instance)) { - const value = instance[key]; - if (typeof value === "string" || typeof value === "number") { - return value; - } - } - return undefined; - } - getBaseTargetFromProps() { - return undefined; - } - removeValueFromRenderState(key, renderState) { - delete renderState.output[key]; - } - measureInstanceViewportBox() { - return createBox(); - } - build(renderState, latestValues) { - Object.assign(renderState.output, latestValues); - } - renderInstance(instance, { output }) { - Object.assign(instance, output); - } - sortInstanceNodePosition() { - return 0; - } -} - -const dashKeys = { - offset: "stroke-dashoffset", - array: "stroke-dasharray", -}; -const camelKeys = { - offset: "strokeDashoffset", - array: "strokeDasharray", -}; -/** - * Build SVG path properties. Uses the path's measured length to convert - * our custom pathLength, pathSpacing and pathOffset into stroke-dashoffset - * and stroke-dasharray attributes. - * - * This function is mutative to reduce per-frame GC. - * - * Note: We use unitless values for stroke-dasharray and stroke-dashoffset - * because Safari incorrectly scales px values when the page is zoomed. - */ -function buildSVGPath(attrs, length, spacing = 1, offset = 0, useDashCase = true) { - // Normalise path length by setting SVG attribute pathLength to 1 - attrs.pathLength = 1; - // We use dash case when setting attributes directly to the DOM node and camel case - // when defining props on a React component. - const keys = useDashCase ? dashKeys : camelKeys; - // Build the dash offset (unitless to avoid Safari zoom bug) - attrs[keys.offset] = `${-offset}`; - // Build the dash array (unitless to avoid Safari zoom bug) - attrs[keys.array] = `${length} ${spacing}`; -} - -const cssStyleProperties = [ - "transform", - "opacity", - "offsetDistance", - "offsetPath", - "offsetRotate", - "offsetAnchor", -]; -/** - * Build SVG visual attributes, like cx and style.transform - */ -function buildSVGAttrs(state, { attrX, attrY, attrScale, pathLength, pathSpacing = 1, pathOffset = 0, -// This is object creation, which we try to avoid per-frame. -...latest }, isSVGTag, transformTemplate, styleProp) { - buildHTMLStyles(state, latest, transformTemplate); - /** - * For svg tags we just want to make sure viewBox is animatable and treat all the styles - * as normal HTML tags. - */ - if (isSVGTag) { - if (state.style.viewBox) { - state.attrs.viewBox = state.style.viewBox; - } - return; - } - state.attrs = state.style; - state.style = {}; - const { attrs, style } = state; - for (const key of cssStyleProperties) { - if (attrs[key] !== undefined) { - style[key] = attrs[key]; - delete attrs[key]; - } - } - if (style.transform || attrs.transformOrigin) { - style.transformOrigin = attrs.transformOrigin ?? "50% 50%"; - delete attrs.transformOrigin; - } - if (style.transform) { - /** - * SVG's element transform-origin uses its own median as a reference. - * Therefore, transformBox becomes a fill-box - */ - style.transformBox = styleProp?.transformBox ?? "fill-box"; - delete attrs.transformBox; - } - // Render attrX/attrY/attrScale as attributes - if (attrX !== undefined) - attrs.x = attrX; - if (attrY !== undefined) - attrs.y = attrY; - if (attrScale !== undefined) - attrs.scale = attrScale; - // Build SVG path if one has been defined - if (pathLength !== undefined) { - buildSVGPath(attrs, pathLength, pathSpacing, pathOffset, false); - } -} - -/** - * A set of attribute names that are always read/written as camel case. - */ -const camelCaseAttributes = new Set([ - "baseFrequency", - "diffuseConstant", - "kernelMatrix", - "kernelUnitLength", - "keySplines", - "keyTimes", - "limitingConeAngle", - "markerHeight", - "markerWidth", - "numOctaves", - "targetX", - "targetY", - "surfaceScale", - "specularConstant", - "specularExponent", - "stdDeviation", - "tableValues", - "viewBox", - "gradientTransform", - "pathLength", - "startOffset", - "textLength", - "lengthAdjust", -]); - -const isSVGTag = (tag) => typeof tag === "string" && tag.toLowerCase() === "svg"; - -function renderSVG(element, renderState, _styleProp, projection) { - renderHTML(element, renderState, undefined, projection); - for (const key in renderState.attrs) { - element.setAttribute(!camelCaseAttributes.has(key) ? camelToDash(key) : key, renderState.attrs[key]); - } -} - -function scrapeMotionValuesFromProps(props, prevProps, visualElement) { - const newValues = scrapeMotionValuesFromProps$1(props, prevProps, visualElement); - for (const key in props) { - if (isMotionValue(props[key]) || - isMotionValue(prevProps[key])) { - const targetKey = transformPropOrder.indexOf(key) !== -1 - ? "attr" + key.charAt(0).toUpperCase() + key.substring(1) - : key; - newValues[targetKey] = props[key]; - } - } - return newValues; -} - -class SVGVisualElement extends DOMVisualElement { - constructor() { - super(...arguments); - this.type = "svg"; - this.isSVGTag = false; - this.measureInstanceViewportBox = createBox; - } - getBaseTargetFromProps(props, key) { - return props[key]; - } - readValueFromInstance(instance, key) { - if (transformProps.has(key)) { - const defaultType = getDefaultValueType(key); - return defaultType ? defaultType.default || 0 : 0; - } - if (cssStyleProperties.includes(key)) { - const computedStyle = getComputedStyle(instance); - const value = computedStyle[key]; - if (typeof value === "string" && value) - return value.trim(); - } - key = !camelCaseAttributes.has(key) ? camelToDash(key) : key; - return instance.getAttribute(key); - } - scrapeMotionValuesFromProps(props, prevProps, visualElement) { - return scrapeMotionValuesFromProps(props, prevProps, visualElement); - } - build(renderState, latestValues, props) { - buildSVGAttrs(renderState, latestValues, this.isSVGTag, props.transformTemplate, props.style); - } - renderInstance(instance, renderState, styleProp, projection) { - renderSVG(instance, renderState, styleProp, projection); - } - mount(instance) { - this.isSVGTag = isSVGTag(instance.tagName); - super.mount(instance); - } -} - -const numVariantProps = variantProps.length; -/** - * Get variant context from a visual element's parent chain. - * Uses `any` type for visualElement to avoid circular dependencies. - */ -function getVariantContext(visualElement) { - if (!visualElement) - return undefined; - if (!visualElement.isControllingVariants) { - const context = visualElement.parent - ? getVariantContext(visualElement.parent) || {} - : {}; - if (visualElement.props.initial !== undefined) { - context.initial = visualElement.props.initial; - } - return context; - } - const context = {}; - for (let i = 0; i < numVariantProps; i++) { - const name = variantProps[i]; - const prop = visualElement.props[name]; - if (isVariantLabel(prop) || prop === false) { - context[name] = prop; - } - } - return context; -} - -function shallowCompare(next, prev) { - if (!Array.isArray(prev)) - return false; - const prevLength = prev.length; - if (prevLength !== next.length) - return false; - for (let i = 0; i < prevLength; i++) { - if (prev[i] !== next[i]) - return false; - } - return true; -} - -const reversePriorityOrder = [...variantPriorityOrder].reverse(); -const numAnimationTypes = variantPriorityOrder.length; -function createAnimateFunction(visualElement) { - return (animations) => { - return Promise.all(animations.map(({ animation, options }) => animateVisualElement(visualElement, animation, options))); - }; -} -function createAnimationState(visualElement) { - let animate = createAnimateFunction(visualElement); - let state = createState(); - let isInitialRender = true; - /** - * Track whether the animation state has been reset (e.g. via StrictMode - * double-invocation or Suspense unmount/remount). On the first - * animateChanges() call after a reset we need to behave like the initial - * render for variant-inheritance checks, even though isInitialRender is - * already false. - */ - let wasReset = false; - /** - * This function will be used to reduce the animation definitions for - * each active animation type into an object of resolved values for it. - */ - const buildResolvedTypeValues = (type) => (acc, definition) => { - const resolved = resolveVariant(visualElement, definition, type === "exit" - ? visualElement.presenceContext?.custom - : undefined); - if (resolved) { - const { transition, transitionEnd, ...target } = resolved; - acc = { ...acc, ...target, ...transitionEnd }; - } - return acc; - }; - /** - * This just allows us to inject mocked animation functions - * @internal - */ - function setAnimateFunction(makeAnimator) { - animate = makeAnimator(visualElement); - } - /** - * When we receive new props, we need to: - * 1. Create a list of protected keys for each type. This is a directory of - * value keys that are currently being "handled" by types of a higher priority - * so that whenever an animation is played of a given type, these values are - * protected from being animated. - * 2. Determine if an animation type needs animating. - * 3. Determine if any values have been removed from a type and figure out - * what to animate those to. - */ - function animateChanges(changedActiveType) { - const { props } = visualElement; - const context = getVariantContext(visualElement.parent) || {}; - /** - * A list of animations that we'll build into as we iterate through the animation - * types. This will get executed at the end of the function. - */ - const animations = []; - /** - * Keep track of which values have been removed. Then, as we hit lower priority - * animation types, we can check if they contain removed values and animate to that. - */ - const removedKeys = new Set(); - /** - * A dictionary of all encountered keys. This is an object to let us build into and - * copy it without iteration. Each time we hit an animation type we set its protected - * keys - the keys its not allowed to animate - to the latest version of this object. - */ - let encounteredKeys = {}; - /** - * If a variant has been removed at a given index, and this component is controlling - * variant animations, we want to ensure lower-priority variants are forced to animate. - */ - let removedVariantIndex = Infinity; - /** - * Iterate through all animation types in reverse priority order. For each, we want to - * detect which values it's handling and whether or not they've changed (and therefore - * need to be animated). If any values have been removed, we want to detect those in - * lower priority props and flag for animation. - */ - for (let i = 0; i < numAnimationTypes; i++) { - const type = reversePriorityOrder[i]; - const typeState = state[type]; - const prop = props[type] !== undefined - ? props[type] - : context[type]; - const propIsVariant = isVariantLabel(prop); - /** - * If this type has *just* changed isActive status, set activeDelta - * to that status. Otherwise set to null. - */ - const activeDelta = type === changedActiveType ? typeState.isActive : null; - if (activeDelta === false) - removedVariantIndex = i; - /** - * If this prop is an inherited variant, rather than been set directly on the - * component itself, we want to make sure we allow the parent to trigger animations. - * - * TODO: Can probably change this to a !isControllingVariants check - */ - let isInherited = prop === context[type] && - prop !== props[type] && - propIsVariant; - if (isInherited && - (isInitialRender || wasReset) && - visualElement.manuallyAnimateOnMount) { - isInherited = false; - } - /** - * Set all encountered keys so far as the protected keys for this type. This will - * be any key that has been animated or otherwise handled by active, higher-priortiy types. - */ - typeState.protectedKeys = { ...encounteredKeys }; - // Check if we can skip analysing this prop early - if ( - // If it isn't active and hasn't *just* been set as inactive - (!typeState.isActive && activeDelta === null) || - // If we didn't and don't have any defined prop for this animation type - (!prop && !typeState.prevProp) || - // Or if the prop doesn't define an animation - isAnimationControls(prop) || - typeof prop === "boolean") { - continue; - } - /** - * If exit is already active and wasn't just activated, skip - * re-processing to prevent interrupting running exit animations. - * Re-resolving exit with a changed custom value can start new - * value animations that stop the originals, leaving the exit - * animation promise unresolved and the component stuck in the DOM. - */ - if (type === "exit" && typeState.isActive && activeDelta !== true) { - if (typeState.prevResolvedValues) { - encounteredKeys = { - ...encounteredKeys, - ...typeState.prevResolvedValues, - }; - } - continue; - } - /** - * As we go look through the values defined on this type, if we detect - * a changed value or a value that was removed in a higher priority, we set - * this to true and add this prop to the animation list. - */ - const variantDidChange = checkVariantsDidChange(typeState.prevProp, prop); - let shouldAnimateType = variantDidChange || - // If we're making this variant active, we want to always make it active - (type === changedActiveType && - typeState.isActive && - !isInherited && - propIsVariant) || - // If we removed a higher-priority variant (i is in reverse order) - (i > removedVariantIndex && propIsVariant); - let handledRemovedValues = false; - /** - * As animations can be set as variant lists, variants or target objects, we - * coerce everything to an array if it isn't one already - */ - const definitionList = Array.isArray(prop) ? prop : [prop]; - /** - * Build an object of all the resolved values. We'll use this in the subsequent - * animateChanges calls to determine whether a value has changed. - */ - let resolvedValues = definitionList.reduce(buildResolvedTypeValues(type), {}); - if (activeDelta === false) - resolvedValues = {}; - /** - * Now we need to loop through all the keys in the prev prop and this prop, - * and decide: - * 1. If the value has changed, and needs animating - * 2. If it has been removed, and needs adding to the removedKeys set - * 3. If it has been removed in a higher priority type and needs animating - * 4. If it hasn't been removed in a higher priority but hasn't changed, and - * needs adding to the type's protectedKeys list. - */ - const { prevResolvedValues = {} } = typeState; - const allKeys = { - ...prevResolvedValues, - ...resolvedValues, - }; - const markToAnimate = (key) => { - shouldAnimateType = true; - if (removedKeys.has(key)) { - handledRemovedValues = true; - removedKeys.delete(key); - } - typeState.needsAnimating[key] = true; - const motionValue = visualElement.getValue(key); - if (motionValue) - motionValue.liveStyle = false; - }; - for (const key in allKeys) { - const next = resolvedValues[key]; - const prev = prevResolvedValues[key]; - // If we've already handled this we can just skip ahead - if (encounteredKeys.hasOwnProperty(key)) - continue; - /** - * If the value has changed, we probably want to animate it. - */ - let valueHasChanged = false; - if (isKeyframesTarget(next) && isKeyframesTarget(prev)) { - valueHasChanged = - !shallowCompare(next, prev) || variantDidChange; - } - else { - valueHasChanged = next !== prev; - } - if (valueHasChanged) { - if (next !== undefined && next !== null) { - // If next is defined and doesn't equal prev, it needs animating - markToAnimate(key); - } - else { - // If it's undefined, it's been removed. - removedKeys.add(key); - } - } - else if (next !== undefined && removedKeys.has(key)) { - /** - * If next hasn't changed and it isn't undefined, we want to check if it's - * been removed by a higher priority - */ - markToAnimate(key); - } - else { - /** - * If it hasn't changed, we add it to the list of protected values - * to ensure it doesn't get animated. - */ - typeState.protectedKeys[key] = true; - } - } - /** - * Update the typeState so next time animateChanges is called we can compare the - * latest prop and resolvedValues to these. - */ - typeState.prevProp = prop; - typeState.prevResolvedValues = resolvedValues; - if (typeState.isActive) { - encounteredKeys = { ...encounteredKeys, ...resolvedValues }; - } - if ((isInitialRender || wasReset) && - visualElement.blockInitialAnimation) { - shouldAnimateType = false; - } - /** - * If this is an inherited prop we want to skip this animation - * unless the inherited variants haven't changed on this render. - */ - const willAnimateViaParent = isInherited && variantDidChange; - const needsAnimating = !willAnimateViaParent || handledRemovedValues; - if (shouldAnimateType && needsAnimating) { - animations.push(...definitionList.map((animation) => { - const options = { type }; - /** - * If we're performing the initial animation, but we're not - * rendering at the same time as the variant-controlling parent, - * we want to use the parent's transition to calculate the stagger. - */ - if (typeof animation === "string" && - (isInitialRender || wasReset) && - !willAnimateViaParent && - visualElement.manuallyAnimateOnMount && - visualElement.parent) { - const { parent } = visualElement; - const parentVariant = resolveVariant(parent, animation); - if (parent.enteringChildren && parentVariant) { - const { delayChildren } = parentVariant.transition || {}; - options.delay = calcChildStagger(parent.enteringChildren, visualElement, delayChildren); - } - } - return { - animation: animation, - options, - }; - })); - } - } - /** - * If there are some removed value that haven't been dealt with, - * we need to create a new animation that falls back either to the value - * defined in the style prop, or the last read value. - */ - if (removedKeys.size) { - const fallbackAnimation = {}; - /** - * If the initial prop contains a transition we can use that, otherwise - * allow the animation function to use the visual element's default. - */ - if (typeof props.initial !== "boolean") { - const initialTransition = resolveVariant(visualElement, Array.isArray(props.initial) - ? props.initial[0] - : props.initial); - if (initialTransition && initialTransition.transition) { - fallbackAnimation.transition = initialTransition.transition; - } - } - removedKeys.forEach((key) => { - const fallbackTarget = visualElement.getBaseTarget(key); - const motionValue = visualElement.getValue(key); - if (motionValue) - motionValue.liveStyle = true; - // @ts-expect-error - @mattgperry to figure if we should do something here - fallbackAnimation[key] = fallbackTarget ?? null; - }); - animations.push({ animation: fallbackAnimation }); - } - let shouldAnimate = Boolean(animations.length); - if (isInitialRender && - (props.initial === false || props.initial === props.animate) && - !visualElement.manuallyAnimateOnMount) { - shouldAnimate = false; - } - isInitialRender = false; - wasReset = false; - return shouldAnimate ? animate(animations) : Promise.resolve(); - } - /** - * Change whether a certain animation type is active. - */ - function setActive(type, isActive) { - // If the active state hasn't changed, we can safely do nothing here - if (state[type].isActive === isActive) - return Promise.resolve(); - // Propagate active change to children - visualElement.variantChildren?.forEach((child) => child.animationState?.setActive(type, isActive)); - state[type].isActive = isActive; - const animations = animateChanges(type); - for (const key in state) { - state[key].protectedKeys = {}; - } - return animations; - } - return { - animateChanges, - setActive, - setAnimateFunction, - getState: () => state, - reset: () => { - state = createState(); - wasReset = true; - }, - }; -} -function checkVariantsDidChange(prev, next) { - if (typeof next === "string") { - return next !== prev; - } - else if (Array.isArray(next)) { - return !shallowCompare(next, prev); - } - return false; -} -function createTypeState(isActive = false) { - return { - isActive, - protectedKeys: {}, - needsAnimating: {}, - prevResolvedValues: {}, - }; -} -function createState() { - return { - animate: createTypeState(true), - whileInView: createTypeState(), - whileHover: createTypeState(), - whileTap: createTypeState(), - whileDrag: createTypeState(), - whileFocus: createTypeState(), - exit: createTypeState(), - }; -} - -/** - * Reset an axis to the provided origin box. - * - * This is a mutative operation. - */ -function copyAxisInto(axis, originAxis) { - axis.min = originAxis.min; - axis.max = originAxis.max; -} -/** - * Reset a box to the provided origin box. - * - * This is a mutative operation. - */ -function copyBoxInto(box, originBox) { - copyAxisInto(box.x, originBox.x); - copyAxisInto(box.y, originBox.y); -} -/** - * Reset a delta to the provided origin box. - * - * This is a mutative operation. - */ -function copyAxisDeltaInto(delta, originDelta) { - delta.translate = originDelta.translate; - delta.scale = originDelta.scale; - delta.originPoint = originDelta.originPoint; - delta.origin = originDelta.origin; -} - -const SCALE_PRECISION = 0.0001; -const SCALE_MIN = 1 - SCALE_PRECISION; -const SCALE_MAX = 1 + SCALE_PRECISION; -const TRANSLATE_PRECISION = 0.01; -const TRANSLATE_MIN = 0 - TRANSLATE_PRECISION; -const TRANSLATE_MAX = 0 + TRANSLATE_PRECISION; -function calcLength(axis) { - return axis.max - axis.min; -} -function isNear(value, target, maxDistance) { - return Math.abs(value - target) <= maxDistance; -} -function calcAxisDelta(delta, source, target, origin = 0.5) { - delta.origin = origin; - delta.originPoint = mixNumber$1(source.min, source.max, delta.origin); - delta.scale = calcLength(target) / calcLength(source); - delta.translate = - mixNumber$1(target.min, target.max, delta.origin) - delta.originPoint; - if ((delta.scale >= SCALE_MIN && delta.scale <= SCALE_MAX) || - isNaN(delta.scale)) { - delta.scale = 1.0; - } - if ((delta.translate >= TRANSLATE_MIN && - delta.translate <= TRANSLATE_MAX) || - isNaN(delta.translate)) { - delta.translate = 0.0; - } -} -function calcBoxDelta(delta, source, target, origin) { - calcAxisDelta(delta.x, source.x, target.x, origin ? origin.originX : undefined); - calcAxisDelta(delta.y, source.y, target.y, origin ? origin.originY : undefined); -} -function calcRelativeAxis(target, relative, parent, anchor = 0) { - const anchorPoint = anchor - ? mixNumber$1(parent.min, parent.max, anchor) - : parent.min; - target.min = anchorPoint + relative.min; - target.max = target.min + calcLength(relative); -} -function calcRelativeBox(target, relative, parent, anchor) { - calcRelativeAxis(target.x, relative.x, parent.x, anchor?.x); - calcRelativeAxis(target.y, relative.y, parent.y, anchor?.y); -} -function calcRelativeAxisPosition(target, layout, parent, anchor = 0) { - const anchorPoint = anchor - ? mixNumber$1(parent.min, parent.max, anchor) - : parent.min; - target.min = layout.min - anchorPoint; - target.max = target.min + calcLength(layout); -} -function calcRelativePosition(target, layout, parent, anchor) { - calcRelativeAxisPosition(target.x, layout.x, parent.x, anchor?.x); - calcRelativeAxisPosition(target.y, layout.y, parent.y, anchor?.y); -} - -/** - * Remove a delta from a point. This is essentially the steps of applyPointDelta in reverse - */ -function removePointDelta(point, translate, scale, originPoint, boxScale) { - point -= translate; - point = scalePoint(point, 1 / scale, originPoint); - if (boxScale !== undefined) { - point = scalePoint(point, 1 / boxScale, originPoint); - } - return point; -} -/** - * Remove a delta from an axis. This is essentially the steps of applyAxisDelta in reverse - */ -function removeAxisDelta(axis, translate = 0, scale = 1, origin = 0.5, boxScale, originAxis = axis, sourceAxis = axis) { - if (percent.test(translate)) { - translate = parseFloat(translate); - const relativeProgress = mixNumber$1(sourceAxis.min, sourceAxis.max, translate / 100); - translate = relativeProgress - sourceAxis.min; - } - if (typeof translate !== "number") - return; - let originPoint = mixNumber$1(originAxis.min, originAxis.max, origin); - if (axis === originAxis) - originPoint -= translate; - axis.min = removePointDelta(axis.min, translate, scale, originPoint, boxScale); - axis.max = removePointDelta(axis.max, translate, scale, originPoint, boxScale); -} -/** - * Remove a transforms from an axis. This is essentially the steps of applyAxisTransforms in reverse - * and acts as a bridge between motion values and removeAxisDelta - */ -function removeAxisTransforms(axis, transforms, [key, scaleKey, originKey], origin, sourceAxis) { - removeAxisDelta(axis, transforms[key], transforms[scaleKey], transforms[originKey], transforms.scale, origin, sourceAxis); -} -/** - * The names of the motion values we want to apply as translation, scale and origin. - */ -const xKeys = ["x", "scaleX", "originX"]; -const yKeys = ["y", "scaleY", "originY"]; -/** - * Remove a transforms from an box. This is essentially the steps of applyAxisBox in reverse - * and acts as a bridge between motion values and removeAxisDelta - */ -function removeBoxTransforms(box, transforms, originBox, sourceBox) { - removeAxisTransforms(box.x, transforms, xKeys, originBox ? originBox.x : undefined, sourceBox ? sourceBox.x : undefined); - removeAxisTransforms(box.y, transforms, yKeys, originBox ? originBox.y : undefined, sourceBox ? sourceBox.y : undefined); -} - -function isAxisDeltaZero(delta) { - return delta.translate === 0 && delta.scale === 1; -} -function isDeltaZero(delta) { - return isAxisDeltaZero(delta.x) && isAxisDeltaZero(delta.y); -} -function axisEquals(a, b) { - return a.min === b.min && a.max === b.max; -} -function boxEquals(a, b) { - return axisEquals(a.x, b.x) && axisEquals(a.y, b.y); -} -function axisEqualsRounded(a, b) { - return (Math.round(a.min) === Math.round(b.min) && - Math.round(a.max) === Math.round(b.max)); -} -function boxEqualsRounded(a, b) { - return axisEqualsRounded(a.x, b.x) && axisEqualsRounded(a.y, b.y); -} -function aspectRatio(box) { - return calcLength(box.x) / calcLength(box.y); -} -function axisDeltaEquals(a, b) { - return (a.translate === b.translate && - a.scale === b.scale && - a.originPoint === b.originPoint); -} - -function eachAxis(callback) { - return [callback("x"), callback("y")]; -} - -function buildProjectionTransform(delta, treeScale, latestTransform) { - let transform = ""; - /** - * The translations we use to calculate are always relative to the viewport coordinate space. - * But when we apply scales, we also scale the coordinate space of an element and its children. - * For instance if we have a treeScale (the culmination of all parent scales) of 0.5 and we need - * to move an element 100 pixels, we actually need to move it 200 in within that scaled space. - */ - const xTranslate = delta.x.translate / treeScale.x; - const yTranslate = delta.y.translate / treeScale.y; - const zTranslate = latestTransform?.z || 0; - if (xTranslate || yTranslate || zTranslate) { - transform = `translate3d(${xTranslate}px, ${yTranslate}px, ${zTranslate}px) `; - } - /** - * Apply scale correction for the tree transform. - * This will apply scale to the screen-orientated axes. - */ - if (treeScale.x !== 1 || treeScale.y !== 1) { - transform += `scale(${1 / treeScale.x}, ${1 / treeScale.y}) `; - } - if (latestTransform) { - const { transformPerspective, rotate, pathRotation, rotateX, rotateY, skewX, skewY, } = latestTransform; - if (transformPerspective) - transform = `perspective(${transformPerspective}px) ${transform}`; - if (rotate) - transform += `rotate(${rotate}deg) `; - // Additive `rotate()` so user `rotate` isn't clobbered. - if (pathRotation) - transform += `rotate(${pathRotation}deg) `; - if (rotateX) - transform += `rotateX(${rotateX}deg) `; - if (rotateY) - transform += `rotateY(${rotateY}deg) `; - if (skewX) - transform += `skewX(${skewX}deg) `; - if (skewY) - transform += `skewY(${skewY}deg) `; - } - /** - * Apply scale to match the size of the element to the size we want it. - * This will apply scale to the element-orientated axes. - */ - const elementScaleX = delta.x.scale * treeScale.x; - const elementScaleY = delta.y.scale * treeScale.y; - if (elementScaleX !== 1 || elementScaleY !== 1) { - transform += `scale(${elementScaleX}, ${elementScaleY})`; - } - return transform || "none"; -} - -const numBorders = cornerRadiusProps.length; -const asNumber = (value) => typeof value === "string" ? parseFloat(value) : value; -const isPx = (value) => typeof value === "number" || px.test(value); -function mixValues(target, follow, lead, progress, shouldCrossfadeOpacity, isOnlyMember) { - if (shouldCrossfadeOpacity) { - target.opacity = mixNumber$1(0, lead.opacity ?? 1, easeCrossfadeIn(progress)); - target.opacityExit = mixNumber$1(follow.opacity ?? 1, 0, easeCrossfadeOut(progress)); - } - else if (isOnlyMember) { - target.opacity = mixNumber$1(follow.opacity ?? 1, lead.opacity ?? 1, progress); - } - /** - * Mix border radius - */ - for (let i = 0; i < numBorders; i++) { - const borderLabel = cornerRadiusProps[i]; - let followRadius = getRadius(follow, borderLabel); - let leadRadius = getRadius(lead, borderLabel); - if (followRadius === undefined && leadRadius === undefined) - continue; - followRadius || (followRadius = 0); - leadRadius || (leadRadius = 0); - const canMix = followRadius === 0 || - leadRadius === 0 || - isPx(followRadius) === isPx(leadRadius); - if (canMix) { - target[borderLabel] = Math.max(mixNumber$1(asNumber(followRadius), asNumber(leadRadius), progress), 0); - if (percent.test(leadRadius) || percent.test(followRadius)) { - target[borderLabel] += "%"; - } - } - else { - target[borderLabel] = leadRadius; - } - } - /** - * Mix rotation - */ - if (follow.rotate || lead.rotate) { - target.rotate = mixNumber$1(follow.rotate || 0, lead.rotate || 0, progress); - } -} -function getRadius(values, radiusName) { - return values[radiusName] !== undefined - ? values[radiusName] - : values.borderRadius; -} -const easeCrossfadeIn = /*@__PURE__*/ compress(0, 0.5, motionUtils.circOut); -const easeCrossfadeOut = /*@__PURE__*/ compress(0.5, 0.95, motionUtils.noop); -function compress(min, max, easing) { - return (p) => { - // Could replace ifs with clamp - if (p < min) - return 0; - if (p > max) - return 1; - return easing(motionUtils.progress(min, max, p)); - }; -} - -function animateSingleValue(value, keyframes, options) { - const motionValue$1 = isMotionValue(value) ? value : motionValue(value); - motionValue$1.start(animateMotionValue("", motionValue$1, keyframes, options)); - return motionValue$1.animation; -} - -function addDomEvent(target, eventName, handler, options = { passive: true }) { - target.addEventListener(eventName, handler, options); - return () => target.removeEventListener(eventName, handler, options); -} - -const compareByDepth = (a, b) => a.depth - b.depth; - -class FlatTree { - constructor() { - this.children = []; - this.isDirty = false; - } - add(child) { - motionUtils.addUniqueItem(this.children, child); - this.isDirty = true; - } - remove(child) { - motionUtils.removeItem(this.children, child); - this.isDirty = true; - } - forEach(callback) { - this.isDirty && this.children.sort(compareByDepth); - this.isDirty = false; - this.children.forEach(callback); - } -} - -/** - * Timeout defined in ms - */ -function delay(callback, timeout) { - const start = time.now(); - const checkElapsed = ({ timestamp }) => { - const elapsed = timestamp - start; - if (elapsed >= timeout) { - cancelFrame(checkElapsed); - callback(elapsed - timeout); - } - }; - frame.setup(checkElapsed, true); - return () => cancelFrame(checkElapsed); -} -function delayInSeconds(callback, timeout) { - return delay(callback, motionUtils.secondsToMilliseconds(timeout)); -} - -/** - * If the provided value is a MotionValue, this returns the actual value, otherwise just the value itself - */ -function resolveMotionValue(value) { - return isMotionValue(value) ? value.get() : value; -} - -class NodeStack { - constructor() { - this.members = []; - } - add(node) { - motionUtils.addUniqueItem(this.members, node); - for (let i = this.members.length - 1; i >= 0; i--) { - const member = this.members[i]; - if (member === node || member === this.lead || member === this.prevLead) - continue; - const inst = member.instance; - if ((!inst || inst.isConnected === false) && !member.snapshot) { - motionUtils.removeItem(this.members, member); - member.unmount(); - } - } - node.scheduleRender(); - } - remove(node) { - motionUtils.removeItem(this.members, node); - if (node === this.prevLead) - this.prevLead = undefined; - if (node === this.lead) { - const prevLead = this.members[this.members.length - 1]; - if (prevLead) - this.promote(prevLead); - } - } - relegate(node) { - for (let i = this.members.indexOf(node) - 1; i >= 0; i--) { - const member = this.members[i]; - if (member.isPresent !== false && member.instance?.isConnected !== false) { - this.promote(member); - return true; - } - } - return false; - } - promote(node, preserveFollowOpacity) { - const prevLead = this.lead; - if (node === prevLead) - return; - this.prevLead = prevLead; - this.lead = node; - node.show(); - if (prevLead) { - prevLead.updateSnapshot(); - node.scheduleRender(); - const { layoutDependency: prevDep } = prevLead.options; - const { layoutDependency: nextDep } = node.options; - if (prevDep === undefined || prevDep !== nextDep) { - node.resumeFrom = prevLead; - if (preserveFollowOpacity) - prevLead.preserveOpacity = true; - if (prevLead.snapshot) { - node.snapshot = prevLead.snapshot; - node.snapshot.latestValues = - prevLead.animationValues || prevLead.latestValues; - } - if (node.root?.isUpdating) - node.isLayoutDirty = true; - } - if (node.options.crossfade === false) - prevLead.hide(); - } - } - exitAnimationComplete() { - this.members.forEach((member) => { - member.options.onExitComplete?.(); - member.resumingFrom?.options.onExitComplete?.(); - }); - } - scheduleRender() { - this.members.forEach((member) => member.instance && member.scheduleRender(false)); - } - removeLeadSnapshot() { - if (this.lead?.snapshot) - this.lead.snapshot = undefined; - } -} - -/** - * This should only ever be modified on the client otherwise it'll - * persist through server requests. If we need instanced states we - * could lazy-init via root. - */ -const globalProjectionState = { - /** - * Global flag as to whether the tree has animated since the last time - * we resized the window - */ - hasAnimatedSinceResize: true, - /** - * We set this to true once, on the first update. Any nodes added to the tree beyond that - * update will be given a `data-projection-id` attribute. - */ - hasEverUpdated: false, -}; - -const metrics = { - nodes: 0, - calculatedTargetDeltas: 0, - calculatedProjections: 0, -}; -const transformAxes = ["", "X", "Y", "Z"]; -/** - * We use 1000 as the animation target as 0-1000 maps better to pixels than 0-1 - * which has a noticeable difference in spring animations - */ -const animationTarget = 1000; -let id = 0; -function resetDistortingTransform(key, visualElement, values, sharedAnimationValues) { - const { latestValues } = visualElement; - // Record the distorting transform and then temporarily set it to 0 - if (latestValues[key]) { - values[key] = latestValues[key]; - visualElement.setStaticValue(key, 0); - if (sharedAnimationValues) { - sharedAnimationValues[key] = 0; - } - } -} -function cancelTreeOptimisedTransformAnimations(projectionNode) { - projectionNode.hasCheckedOptimisedAppear = true; - if (projectionNode.root === projectionNode) - return; - const { visualElement } = projectionNode.options; - if (!visualElement) - return; - const appearId = getOptimisedAppearId(visualElement); - if (window.MotionHasOptimisedAnimation(appearId, "transform")) { - const { layout, layoutId } = projectionNode.options; - window.MotionCancelOptimisedAnimation(appearId, "transform", frame, !(layout || layoutId)); - } - const { parent } = projectionNode; - if (parent && !parent.hasCheckedOptimisedAppear) { - cancelTreeOptimisedTransformAnimations(parent); - } -} -function createProjectionNode({ attachResizeListener, defaultParent, measureScroll, checkIsScrollRoot, resetTransform, }) { - return class ProjectionNode { - constructor(latestValues = {}, parent = defaultParent?.()) { - /** - * A unique ID generated for every projection node. - */ - this.id = id++; - /** - * An id that represents a unique session instigated by startUpdate. - */ - this.animationId = 0; - this.animationCommitId = 0; - /** - * A Set containing all this component's children. This is used to iterate - * through the children. - * - * TODO: This could be faster to iterate as a flat array stored on the root node. - */ - this.children = new Set(); - /** - * Options for the node. We use this to configure what kind of layout animations - * we should perform (if any). - */ - this.options = {}; - /** - * We use this to detect when its safe to shut down part of a projection tree. - * We have to keep projecting children for scale correction and relative projection - * until all their parents stop performing layout animations. - */ - this.isTreeAnimating = false; - this.isAnimationBlocked = false; - /** - * Flag to true if we think this layout has been changed. We can't always know this, - * currently we set it to true every time a component renders, or if it has a layoutDependency - * if that has changed between renders. Additionally, components can be grouped by LayoutGroup - * and if one node is dirtied, they all are. - */ - this.isLayoutDirty = false; - /** - * Flag to true if we think the projection calculations for this node needs - * recalculating as a result of an updated transform or layout animation. - */ - this.isProjectionDirty = false; - /** - * Flag to true if the layout *or* transform has changed. This then gets propagated - * throughout the projection tree, forcing any element below to recalculate on the next frame. - */ - this.isSharedProjectionDirty = false; - /** - * Flag transform dirty. This gets propagated throughout the whole tree but is only - * respected by shared nodes. - */ - this.isTransformDirty = false; - /** - * Block layout updates for instant layout transitions throughout the tree. - */ - this.updateManuallyBlocked = false; - this.updateBlockedByResize = false; - /** - * Set to true between the start of the first `willUpdate` call and the end of the `didUpdate` - * call. - */ - this.isUpdating = false; - /** - * If this is an SVG element we currently disable projection transforms - */ - this.isSVG = false; - /** - * Flag to true (during promotion) if a node doing an instant layout transition needs to reset - * its projection styles. - */ - this.needsReset = false; - /** - * Flags whether this node should have its transform reset prior to measuring. - */ - this.shouldResetTransform = false; - /** - * Store whether this node has been checked for optimised appear animations. As - * effects fire bottom-up, and we want to look up the tree for appear animations, - * this makes sure we only check each path once, stopping at nodes that - * have already been checked. - */ - this.hasCheckedOptimisedAppear = false; - /** - * An object representing the calculated contextual/accumulated/tree scale. - * This will be used to scale calculcated projection transforms, as these are - * calculated in screen-space but need to be scaled for elements to layoutly - * make it to their calculated destinations. - * - * TODO: Lazy-init - */ - this.treeScale = { x: 1, y: 1 }; - /** - * - */ - this.eventHandlers = new Map(); - this.hasTreeAnimated = false; - this.layoutVersion = 0; - // Note: Currently only running on root node - this.updateScheduled = false; - this.scheduleUpdate = () => this.update(); - this.projectionUpdateScheduled = false; - this.checkUpdateFailed = () => { - if (this.isUpdating) { - this.isUpdating = false; - this.clearAllSnapshots(); - } - }; - /** - * This is a multi-step process as shared nodes might be of different depths. Nodes - * are sorted by depth order, so we need to resolve the entire tree before moving to - * the next step. - */ - this.updateProjection = () => { - this.projectionUpdateScheduled = false; - /** - * Reset debug counts. Manually resetting rather than creating a new - * object each frame. - */ - if (statsBuffer.value) { - metrics.nodes = - metrics.calculatedTargetDeltas = - metrics.calculatedProjections = - 0; - } - this.nodes.forEach(propagateDirtyNodes); - this.nodes.forEach(resolveTargetDelta); - this.nodes.forEach(calcProjection); - this.nodes.forEach(cleanDirtyNodes); - if (statsBuffer.addProjectionMetrics) { - statsBuffer.addProjectionMetrics(metrics); - } - }; - /** - * Frame calculations - */ - this.resolvedRelativeTargetAt = 0.0; - this.linkedParentVersion = 0; - this.hasProjected = false; - this.isVisible = true; - this.animationProgress = 0; - /** - * Shared layout - */ - // TODO Only running on root node - this.sharedNodes = new Map(); - this.latestValues = latestValues; - this.root = parent ? parent.root || parent : this; - this.path = parent ? [...parent.path, parent] : []; - this.parent = parent; - this.depth = parent ? parent.depth + 1 : 0; - for (let i = 0; i < this.path.length; i++) { - this.path[i].shouldResetTransform = true; - } - if (this.root === this) - this.nodes = new FlatTree(); - } - addEventListener(name, handler) { - if (!this.eventHandlers.has(name)) { - this.eventHandlers.set(name, new motionUtils.SubscriptionManager()); - } - return this.eventHandlers.get(name).add(handler); - } - notifyListeners(name, ...args) { - const subscriptionManager = this.eventHandlers.get(name); - subscriptionManager && subscriptionManager.notify(...args); - } - hasListeners(name) { - return this.eventHandlers.has(name); - } - /** - * Lifecycles - */ - mount(instance) { - if (this.instance) - return; - this.isSVG = isSVGElement(instance) && !isSVGSVGElement(instance); - this.instance = instance; - const { layoutId, layout, visualElement } = this.options; - if (visualElement && !visualElement.current) { - visualElement.mount(instance); - } - this.root.nodes.add(this); - this.parent && this.parent.children.add(this); - if (this.root.hasTreeAnimated && (layout || layoutId)) { - this.isLayoutDirty = true; - } - if (attachResizeListener) { - let cancelDelay; - let innerWidth = 0; - const resizeUnblockUpdate = () => (this.root.updateBlockedByResize = false); - // Set initial innerWidth in a frame.read callback to batch the read - frame.read(() => { - innerWidth = window.innerWidth; - }); - attachResizeListener(instance, () => { - const newInnerWidth = window.innerWidth; - if (newInnerWidth === innerWidth) - return; - innerWidth = newInnerWidth; - this.root.updateBlockedByResize = true; - cancelDelay && cancelDelay(); - cancelDelay = delay(resizeUnblockUpdate, 250); - if (globalProjectionState.hasAnimatedSinceResize) { - globalProjectionState.hasAnimatedSinceResize = false; - this.nodes.forEach(finishAnimation); - } - }); - } - if (layoutId) { - this.root.registerSharedNode(layoutId, this); - } - // Only register the handler if it requires layout animation - if (this.options.animate !== false && - visualElement && - (layoutId || layout)) { - this.addEventListener("didUpdate", ({ delta, hasLayoutChanged, hasRelativeLayoutChanged, layout: newLayout, }) => { - if (this.isTreeAnimationBlocked()) { - this.target = undefined; - this.relativeTarget = undefined; - return; - } - // TODO: Check here if an animation exists - const layoutTransition = this.options.transition || - visualElement.getDefaultTransition() || - defaultLayoutTransition; - const { onLayoutAnimationStart, onLayoutAnimationComplete, } = visualElement.getProps(); - /** - * The target layout of the element might stay the same, - * but its position relative to its parent has changed. - */ - const hasTargetChanged = !this.targetLayout || - !boxEqualsRounded(this.targetLayout, newLayout); - /* - * Note: Disabled to fix relative animations always triggering new - * layout animations. If this causes further issues, we can try - * a different approach to detecting relative target changes. - */ - // || hasRelativeLayoutChanged - /** - * If the layout hasn't seemed to have changed, it might be that the - * element is visually in the same place in the document but its position - * relative to its parent has indeed changed. So here we check for that. - */ - const hasOnlyRelativeTargetChanged = !hasLayoutChanged && hasRelativeLayoutChanged; - if (this.options.layoutRoot || - this.resumeFrom || - hasOnlyRelativeTargetChanged || - (hasLayoutChanged && - (hasTargetChanged || !this.currentAnimation))) { - if (this.resumeFrom) { - this.resumingFrom = this.resumeFrom; - this.resumingFrom.resumingFrom = undefined; - } - const animationOptions = { - ...getValueTransition(layoutTransition, "layout"), - onPlay: onLayoutAnimationStart, - onComplete: onLayoutAnimationComplete, - }; - if (visualElement.shouldReduceMotion || - this.options.layoutRoot) { - animationOptions.delay = 0; - animationOptions.type = false; - } - this.startAnimation(animationOptions); - /** - * Set animation origin after starting animation to avoid layout jump - * caused by stopping previous layout animation - */ - this.setAnimationOrigin(delta, hasOnlyRelativeTargetChanged, animationOptions - .path); - } - else { - /** - * If the layout hasn't changed and we have an animation that hasn't started yet, - * finish it immediately. Otherwise it will be animating from a location - * that was probably never committed to screen and look like a jumpy box. - */ - if (!hasLayoutChanged) { - finishAnimation(this); - } - if (this.isLead() && this.options.onExitComplete) { - this.options.onExitComplete(); - } - } - this.targetLayout = newLayout; - }); - } - } - unmount() { - this.options.layoutId && this.willUpdate(); - this.root.nodes.remove(this); - const stack = this.getStack(); - stack && stack.remove(this); - this.parent && this.parent.children.delete(this); - this.instance = undefined; - this.eventHandlers.clear(); - cancelFrame(this.updateProjection); - } - // only on the root - blockUpdate() { - this.updateManuallyBlocked = true; - } - unblockUpdate() { - this.updateManuallyBlocked = false; - } - isUpdateBlocked() { - return this.updateManuallyBlocked || this.updateBlockedByResize; - } - isTreeAnimationBlocked() { - return (this.isAnimationBlocked || - (this.parent && this.parent.isTreeAnimationBlocked()) || - false); - } - // Note: currently only running on root node - startUpdate() { - if (this.isUpdateBlocked()) - return; - this.isUpdating = true; - this.nodes && this.nodes.forEach(resetSkewAndRotation); - this.animationId++; - } - getTransformTemplate() { - const { visualElement } = this.options; - return visualElement && visualElement.getProps().transformTemplate; - } - willUpdate(shouldNotifyListeners = true) { - this.root.hasTreeAnimated = true; - if (this.root.isUpdateBlocked()) { - this.options.onExitComplete && this.options.onExitComplete(); - return; - } - /** - * If we're running optimised appear animations then these must be - * cancelled before measuring the DOM. This is so we can measure - * the true layout of the element rather than the WAAPI animation - * which will be unaffected by the resetSkewAndRotate step. - * - * Note: This is a DOM write. Worst case scenario is this is sandwiched - * between other snapshot reads which will cause unnecessary style recalculations. - * This has to happen here though, as we don't yet know which nodes will need - * snapshots in startUpdate(), but we only want to cancel optimised animations - * if a layout animation measurement is actually going to be affected by them. - */ - if (window.MotionCancelOptimisedAnimation && - !this.hasCheckedOptimisedAppear) { - cancelTreeOptimisedTransformAnimations(this); - } - !this.root.isUpdating && this.root.startUpdate(); - if (this.isLayoutDirty) - return; - this.isLayoutDirty = true; - for (let i = 0; i < this.path.length; i++) { - const node = this.path[i]; - node.shouldResetTransform = true; - /** - * Percentage translates resolve against layoutBox dimensions, - * so ancestors with them must be re-measured after transform reset. - */ - if (typeof node.latestValues.x === "string" || - typeof node.latestValues.y === "string") { - node.isLayoutDirty = true; - } - node.updateScroll("snapshot"); - if (node.options.layoutRoot) { - node.willUpdate(false); - } - } - const { layoutId, layout } = this.options; - if (layoutId === undefined && !layout) - return; - const transformTemplate = this.getTransformTemplate(); - this.prevTransformTemplateValue = transformTemplate - ? transformTemplate(this.latestValues, "") - : undefined; - this.updateSnapshot(); - shouldNotifyListeners && this.notifyListeners("willUpdate"); - } - update() { - this.updateScheduled = false; - const updateWasBlocked = this.isUpdateBlocked(); - // When doing an instant transition, we skip the layout update, - // but should still clean up the measurements so that the next - // snapshot could be taken correctly. - if (updateWasBlocked) { - const wasBlockedByResize = this.updateBlockedByResize; - this.unblockUpdate(); - this.updateBlockedByResize = false; - this.clearAllSnapshots(); - /** - * When blocked by resize, still measure layouts so - * callbacks like onLayoutMeasure fire (e.g. Reorder). - * Skip notifyLayoutUpdate to prevent animations. - */ - if (wasBlockedByResize) { - this.nodes.forEach(forceLayoutMeasure); - } - this.nodes.forEach(clearMeasurements); - return; - } - /** - * If this is a repeat of didUpdate then ignore the animation. - */ - if (this.animationId <= this.animationCommitId) { - this.nodes.forEach(clearIsLayoutDirty); - return; - } - this.animationCommitId = this.animationId; - if (!this.isUpdating) { - this.nodes.forEach(clearIsLayoutDirty); - } - else { - this.isUpdating = false; - /** - * Ensure animation-blocked nodes (e.g. during drag) - * get measured even when memoized (willUpdate skipped). - */ - this.nodes.forEach(ensureDraggedNodesSnapshotted); - /** - * Write - */ - this.nodes.forEach(resetTransformStyle); - /** - * Read ================== - */ - // Update layout measurements of updated children - this.nodes.forEach(updateLayout); - /** - * Write - */ - // Notify listeners that the layout is updated - this.nodes.forEach(notifyLayoutUpdate); - } - this.clearAllSnapshots(); - /** - * Manually flush any pending updates. Ideally - * we could leave this to the following requestAnimationFrame but this seems - * to leave a flash of incorrectly styled content. - */ - const now = time.now(); - frameData.delta = motionUtils.clamp(0, 1000 / 60, now - frameData.timestamp); - frameData.timestamp = now; - frameData.isProcessing = true; - frameSteps.update.process(frameData); - frameSteps.preRender.process(frameData); - frameSteps.render.process(frameData); - frameData.isProcessing = false; - } - didUpdate() { - if (!this.updateScheduled) { - this.updateScheduled = true; - microtask.read(this.scheduleUpdate); - } - } - clearAllSnapshots() { - this.nodes.forEach(clearSnapshot); - this.sharedNodes.forEach(removeLeadSnapshots); - } - scheduleUpdateProjection() { - if (!this.projectionUpdateScheduled) { - this.projectionUpdateScheduled = true; - frame.preRender(this.updateProjection, false, true); - } - } - scheduleCheckAfterUnmount() { - /** - * If the unmounting node is in a layoutGroup and did trigger a willUpdate, - * we manually call didUpdate to give a chance to the siblings to animate. - * Otherwise, cleanup all snapshots to prevents future nodes from reusing them. - */ - frame.postRender(() => { - if (this.isLayoutDirty) { - this.root.didUpdate(); - } - else { - this.root.checkUpdateFailed(); - } - }); - } - /** - * Update measurements - */ - updateSnapshot() { - if (this.snapshot || !this.instance) - return; - this.snapshot = this.measure(); - if (this.snapshot && - !calcLength(this.snapshot.measuredBox.x) && - !calcLength(this.snapshot.measuredBox.y)) { - this.snapshot = undefined; - } - } - updateLayout() { - if (!this.instance) - return; - this.updateScroll(); - if (!(this.options.alwaysMeasureLayout && this.isLead()) && - !this.isLayoutDirty) { - return; - } - /** - * When a node is mounted, it simply resumes from the prevLead's - * snapshot instead of taking a new one, but the ancestors scroll - * might have updated while the prevLead is unmounted. We need to - * update the scroll again to make sure the layout we measure is - * up to date. - */ - if (this.resumeFrom && !this.resumeFrom.instance) { - for (let i = 0; i < this.path.length; i++) { - const node = this.path[i]; - node.updateScroll(); - } - } - const prevLayout = this.layout; - this.layout = this.measure(false); - this.layoutVersion++; - if (!this.layoutCorrected) - this.layoutCorrected = createBox(); - this.isLayoutDirty = false; - this.projectionDelta = undefined; - this.notifyListeners("measure", this.layout.layoutBox); - const { visualElement } = this.options; - visualElement && - visualElement.notify("LayoutMeasure", this.layout.layoutBox, prevLayout ? prevLayout.layoutBox : undefined); - } - updateScroll(phase = "measure") { - let needsMeasurement = Boolean(this.options.layoutScroll && this.instance); - if (this.scroll && - this.scroll.animationId === this.root.animationId && - this.scroll.phase === phase) { - needsMeasurement = false; - } - if (needsMeasurement && this.instance) { - const isRoot = checkIsScrollRoot(this.instance); - this.scroll = { - animationId: this.root.animationId, - phase, - isRoot, - offset: measureScroll(this.instance), - wasRoot: this.scroll ? this.scroll.isRoot : isRoot, - }; - } - } - resetTransform() { - if (!resetTransform) - return; - const isResetRequested = this.isLayoutDirty || - this.shouldResetTransform || - this.options.alwaysMeasureLayout; - const hasProjection = this.projectionDelta && !isDeltaZero(this.projectionDelta); - const transformTemplate = this.getTransformTemplate(); - const transformTemplateValue = transformTemplate - ? transformTemplate(this.latestValues, "") - : undefined; - const transformTemplateHasChanged = transformTemplateValue !== this.prevTransformTemplateValue; - if (isResetRequested && - this.instance && - (hasProjection || - hasTransform(this.latestValues) || - transformTemplateHasChanged)) { - resetTransform(this.instance, transformTemplateValue); - this.shouldResetTransform = false; - this.scheduleRender(); - } - } - measure(removeTransform = true) { - const pageBox = this.measurePageBox(); - let layoutBox = this.removeElementScroll(pageBox); - /** - * Measurements taken during the pre-render stage - * still have transforms applied so we remove them - * via calculation. - */ - if (removeTransform) { - layoutBox = this.removeTransform(layoutBox); - } - roundBox(layoutBox); - return { - animationId: this.root.animationId, - measuredBox: pageBox, - layoutBox, - latestValues: {}, - source: this.id, - }; - } - measurePageBox() { - const { visualElement } = this.options; - if (!visualElement) - return createBox(); - const box = visualElement.measureViewportBox(); - const wasInScrollRoot = this.scroll?.wasRoot || this.path.some(checkNodeWasScrollRoot); - if (!wasInScrollRoot) { - // Remove viewport scroll to give page-relative coordinates - const { scroll } = this.root; - if (scroll) { - translateAxis(box.x, scroll.offset.x); - translateAxis(box.y, scroll.offset.y); - } - } - return box; - } - removeElementScroll(box) { - const boxWithoutScroll = createBox(); - copyBoxInto(boxWithoutScroll, box); - if (this.scroll?.wasRoot) { - return boxWithoutScroll; - } - /** - * Performance TODO: Keep a cumulative scroll offset down the tree - * rather than loop back up the path. - */ - for (let i = 0; i < this.path.length; i++) { - const node = this.path[i]; - const { scroll, options } = node; - if (node !== this.root && scroll && options.layoutScroll) { - /** - * If this is a new scroll root, we want to remove all previous scrolls - * from the viewport box. - */ - if (scroll.wasRoot) { - copyBoxInto(boxWithoutScroll, box); - } - translateAxis(boxWithoutScroll.x, scroll.offset.x); - translateAxis(boxWithoutScroll.y, scroll.offset.y); - } - } - return boxWithoutScroll; - } - applyTransform(box, transformOnly = false, output) { - const withTransforms = output || createBox(); - copyBoxInto(withTransforms, box); - for (let i = 0; i < this.path.length; i++) { - const node = this.path[i]; - if (!transformOnly && - node.options.layoutScroll && - node.scroll && - node !== node.root) { - translateAxis(withTransforms.x, -node.scroll.offset.x); - translateAxis(withTransforms.y, -node.scroll.offset.y); - } - if (!hasTransform(node.latestValues)) - continue; - transformBox(withTransforms, node.latestValues, node.layout?.layoutBox); - } - if (hasTransform(this.latestValues)) { - transformBox(withTransforms, this.latestValues, this.layout?.layoutBox); - } - return withTransforms; - } - removeTransform(box) { - const boxWithoutTransform = createBox(); - copyBoxInto(boxWithoutTransform, box); - for (let i = 0; i < this.path.length; i++) { - const node = this.path[i]; - if (!hasTransform(node.latestValues)) - continue; - let sourceBox; - if (node.instance) { - hasScale(node.latestValues) && node.updateSnapshot(); - sourceBox = createBox(); - copyBoxInto(sourceBox, node.measurePageBox()); - } - removeBoxTransforms(boxWithoutTransform, node.latestValues, node.snapshot?.layoutBox, sourceBox); - } - if (hasTransform(this.latestValues)) { - removeBoxTransforms(boxWithoutTransform, this.latestValues); - } - return boxWithoutTransform; - } - setTargetDelta(delta) { - this.targetDelta = delta; - this.root.scheduleUpdateProjection(); - this.isProjectionDirty = true; - } - setOptions(options) { - this.options = { - ...this.options, - ...options, - crossfade: options.crossfade !== undefined ? options.crossfade : true, - }; - } - clearMeasurements() { - this.scroll = undefined; - this.layout = undefined; - this.snapshot = undefined; - this.prevTransformTemplateValue = undefined; - this.targetDelta = undefined; - this.target = undefined; - this.isLayoutDirty = false; - } - forceRelativeParentToResolveTarget() { - if (!this.relativeParent) - return; - /** - * If the parent target isn't up-to-date, force it to update. - * This is an unfortunate de-optimisation as it means any updating relative - * projection will cause all the relative parents to recalculate back - * up the tree. - */ - if (this.relativeParent.resolvedRelativeTargetAt !== - frameData.timestamp) { - this.relativeParent.resolveTargetDelta(true); - } - } - resolveTargetDelta(forceRecalculation = false) { - /** - * Once the dirty status of nodes has been spread through the tree, we also - * need to check if we have a shared node of a different depth that has itself - * been dirtied. - */ - const lead = this.getLead(); - this.isProjectionDirty || (this.isProjectionDirty = lead.isProjectionDirty); - this.isTransformDirty || (this.isTransformDirty = lead.isTransformDirty); - this.isSharedProjectionDirty || (this.isSharedProjectionDirty = lead.isSharedProjectionDirty); - const isShared = Boolean(this.resumingFrom) || this !== lead; - /** - * We don't use transform for this step of processing so we don't - * need to check whether any nodes have changed transform. - */ - const canSkip = !(forceRecalculation || - (isShared && this.isSharedProjectionDirty) || - this.isProjectionDirty || - this.parent?.isProjectionDirty || - this.attemptToResolveRelativeTarget || - this.root.updateBlockedByResize); - if (canSkip) - return; - const { layout, layoutId } = this.options; - /** - * If we have no layout, we can't perform projection, so early return - */ - if (!this.layout || !(layout || layoutId)) - return; - this.resolvedRelativeTargetAt = frameData.timestamp; - const relativeParent = this.getClosestProjectingParent(); - if (relativeParent && - this.linkedParentVersion !== relativeParent.layoutVersion && - !relativeParent.options.layoutRoot) { - this.removeRelativeTarget(); - } - /** - * If we don't have a targetDelta but do have a layout, we can attempt to resolve - * a relativeParent. This will allow a component to perform scale correction - * even if no animation has started. - */ - if (!this.targetDelta && !this.relativeTarget) { - if (this.options.layoutAnchor !== false && - relativeParent && - relativeParent.layout) { - this.createRelativeTarget(relativeParent, this.layout.layoutBox, relativeParent.layout.layoutBox); - } - else { - this.removeRelativeTarget(); - } - } - /** - * If we have no relative target or no target delta our target isn't valid - * for this frame. - */ - if (!this.relativeTarget && !this.targetDelta) - return; - /** - * Lazy-init target data structure - */ - if (!this.target) { - this.target = createBox(); - this.targetWithTransforms = createBox(); - } - /** - * If we've got a relative box for this component, resolve it into a target relative to the parent. - */ - if (this.relativeTarget && - this.relativeTargetOrigin && - this.relativeParent && - this.relativeParent.target) { - this.forceRelativeParentToResolveTarget(); - calcRelativeBox(this.target, this.relativeTarget, this.relativeParent.target, this.options.layoutAnchor || undefined); - /** - * If we've only got a targetDelta, resolve it into a target - */ - } - else if (this.targetDelta) { - if (Boolean(this.resumingFrom)) { - this.applyTransform(this.layout.layoutBox, false, this.target); - } - else { - copyBoxInto(this.target, this.layout.layoutBox); - } - applyBoxDelta(this.target, this.targetDelta); - } - else { - /** - * If no target, use own layout as target - */ - copyBoxInto(this.target, this.layout.layoutBox); - } - /** - * If we've been told to attempt to resolve a relative target, do so. - */ - if (this.attemptToResolveRelativeTarget) { - this.attemptToResolveRelativeTarget = false; - if (this.options.layoutAnchor !== false && - relativeParent && - Boolean(relativeParent.resumingFrom) === - Boolean(this.resumingFrom) && - !relativeParent.options.layoutScroll && - relativeParent.target && - this.animationProgress !== 1) { - this.createRelativeTarget(relativeParent, this.target, relativeParent.target); - } - else { - this.relativeParent = this.relativeTarget = undefined; - } - } - /** - * Increase debug counter for resolved target deltas - */ - if (statsBuffer.value) { - metrics.calculatedTargetDeltas++; - } - } - getClosestProjectingParent() { - if (!this.parent || - hasScale(this.parent.latestValues) || - has2DTranslate(this.parent.latestValues)) { - return undefined; - } - if (this.parent.isProjecting()) { - return this.parent; - } - else { - return this.parent.getClosestProjectingParent(); - } - } - isProjecting() { - return Boolean((this.relativeTarget || - this.targetDelta || - this.options.layoutRoot) && - this.layout); - } - createRelativeTarget(relativeParent, layout, parentLayout) { - this.relativeParent = relativeParent; - this.linkedParentVersion = relativeParent.layoutVersion; - this.forceRelativeParentToResolveTarget(); - this.relativeTarget = createBox(); - this.relativeTargetOrigin = createBox(); - calcRelativePosition(this.relativeTargetOrigin, layout, parentLayout, this.options.layoutAnchor || undefined); - copyBoxInto(this.relativeTarget, this.relativeTargetOrigin); - } - removeRelativeTarget() { - this.relativeParent = this.relativeTarget = undefined; - } - calcProjection() { - const lead = this.getLead(); - const isShared = Boolean(this.resumingFrom) || this !== lead; - let canSkip = true; - /** - * If this is a normal layout animation and neither this node nor its nearest projecting - * is dirty then we can't skip. - */ - if (this.isProjectionDirty || this.parent?.isProjectionDirty) { - canSkip = false; - } - /** - * If this is a shared layout animation and this node's shared projection is dirty then - * we can't skip. - */ - if (isShared && - (this.isSharedProjectionDirty || this.isTransformDirty)) { - canSkip = false; - } - /** - * If we have resolved the target this frame we must recalculate the - * projection to ensure it visually represents the internal calculations. - */ - if (this.resolvedRelativeTargetAt === frameData.timestamp) { - canSkip = false; - } - if (canSkip) - return; - const { layout, layoutId } = this.options; - /** - * If this section of the tree isn't animating we can - * delete our target sources for the following frame. - */ - this.isTreeAnimating = Boolean((this.parent && this.parent.isTreeAnimating) || - this.currentAnimation || - this.pendingAnimation); - if (!this.isTreeAnimating) { - this.targetDelta = this.relativeTarget = undefined; - } - if (!this.layout || !(layout || layoutId)) - return; - /** - * Reset the corrected box with the latest values from box, as we're then going - * to perform mutative operations on it. - */ - copyBoxInto(this.layoutCorrected, this.layout.layoutBox); - /** - * Record previous tree scales before updating. - */ - const prevTreeScaleX = this.treeScale.x; - const prevTreeScaleY = this.treeScale.y; - /** - * Apply all the parent deltas to this box to produce the corrected box. This - * is the layout box, as it will appear on screen as a result of the transforms of its parents. - */ - applyTreeDeltas(this.layoutCorrected, this.treeScale, this.path, isShared); - /** - * If this layer needs to perform scale correction but doesn't have a target, - * use the layout as the target. - */ - if (lead.layout && - !lead.target && - (this.treeScale.x !== 1 || this.treeScale.y !== 1)) { - lead.target = lead.layout.layoutBox; - lead.targetWithTransforms = createBox(); - } - const { target } = lead; - if (!target) { - /** - * If we don't have a target to project into, but we were previously - * projecting, we want to remove the stored transform and schedule - * a render to ensure the elements reflect the removed transform. - */ - if (this.prevProjectionDelta) { - this.createProjectionDeltas(); - this.scheduleRender(); - } - return; - } - if (!this.projectionDelta || !this.prevProjectionDelta) { - this.createProjectionDeltas(); - } - else { - copyAxisDeltaInto(this.prevProjectionDelta.x, this.projectionDelta.x); - copyAxisDeltaInto(this.prevProjectionDelta.y, this.projectionDelta.y); - } - /** - * Update the delta between the corrected box and the target box before user-set transforms were applied. - * This will allow us to calculate the corrected borderRadius and boxShadow to compensate - * for our layout reprojection, but still allow them to be scaled correctly by the user. - * It might be that to simplify this we may want to accept that user-set scale is also corrected - * and we wouldn't have to keep and calc both deltas, OR we could support a user setting - * to allow people to choose whether these styles are corrected based on just the - * layout reprojection or the final bounding box. - */ - calcBoxDelta(this.projectionDelta, this.layoutCorrected, target, this.latestValues); - if (this.treeScale.x !== prevTreeScaleX || - this.treeScale.y !== prevTreeScaleY || - !axisDeltaEquals(this.projectionDelta.x, this.prevProjectionDelta.x) || - !axisDeltaEquals(this.projectionDelta.y, this.prevProjectionDelta.y)) { - this.hasProjected = true; - this.scheduleRender(); - this.notifyListeners("projectionUpdate", target); - } - /** - * Increase debug counter for recalculated projections - */ - if (statsBuffer.value) { - metrics.calculatedProjections++; - } - } - hide() { - this.isVisible = false; - // TODO: Schedule render - } - show() { - this.isVisible = true; - // TODO: Schedule render - } - scheduleRender(notifyAll = true) { - this.options.visualElement?.scheduleRender(); - if (notifyAll) { - const stack = this.getStack(); - stack && stack.scheduleRender(); - } - if (this.resumingFrom && !this.resumingFrom.instance) { - this.resumingFrom = undefined; - } - } - createProjectionDeltas() { - this.prevProjectionDelta = createDelta(); - this.projectionDelta = createDelta(); - this.projectionDeltaWithTransform = createDelta(); - } - setAnimationOrigin(delta, hasOnlyRelativeTargetChanged = false, pathFn) { - const snapshot = this.snapshot; - const snapshotLatestValues = snapshot ? snapshot.latestValues : {}; - const mixedValues = { ...this.latestValues }; - const targetDelta = createDelta(); - if (!this.relativeParent || - !this.relativeParent.options.layoutRoot) { - this.relativeTarget = this.relativeTargetOrigin = undefined; - } - this.attemptToResolveRelativeTarget = !hasOnlyRelativeTargetChanged; - const relativeLayout = createBox(); - const snapshotSource = snapshot ? snapshot.source : undefined; - const layoutSource = this.layout ? this.layout.source : undefined; - const isSharedLayoutAnimation = snapshotSource !== layoutSource; - const stack = this.getStack(); - const isOnlyMember = !stack || stack.members.length <= 1; - const shouldCrossfadeOpacity = Boolean(isSharedLayoutAnimation && - !isOnlyMember && - this.options.crossfade === true && - !this.path.some(hasOpacityCrossfade)); - this.animationProgress = 0; - let prevRelativeTarget; - // The path decides whether the layout shift is worth curving - // (distance floor) and resolves the interpolator from the delta. - const interpolate = pathFn?.interpolateProjection(delta); - this.mixTargetDelta = (latest) => { - const progress = latest / 1000; - const point = interpolate?.(progress); - if (point) { - targetDelta.x.translate = point.x; - targetDelta.x.scale = mixNumber$1(delta.x.scale, 1, progress); - targetDelta.x.origin = delta.x.origin; - targetDelta.x.originPoint = delta.x.originPoint; - targetDelta.y.translate = point.y; - targetDelta.y.scale = mixNumber$1(delta.y.scale, 1, progress); - targetDelta.y.origin = delta.y.origin; - targetDelta.y.originPoint = delta.y.originPoint; - } - else { - mixAxisDeltaLinear(targetDelta.x, delta.x, progress); - mixAxisDeltaLinear(targetDelta.y, delta.y, progress); - } - this.setTargetDelta(targetDelta); - if (this.relativeTarget && - this.relativeTargetOrigin && - this.layout && - this.relativeParent && - this.relativeParent.layout) { - calcRelativePosition(relativeLayout, this.layout.layoutBox, this.relativeParent.layout.layoutBox, this.options.layoutAnchor || undefined); - mixBox(this.relativeTarget, this.relativeTargetOrigin, relativeLayout, progress); - /** - * If this is an unchanged relative target we can consider the - * projection not dirty. - */ - if (prevRelativeTarget && - boxEquals(this.relativeTarget, prevRelativeTarget)) { - this.isProjectionDirty = false; - } - if (!prevRelativeTarget) - prevRelativeTarget = createBox(); - copyBoxInto(prevRelativeTarget, this.relativeTarget); - } - if (isSharedLayoutAnimation) { - this.animationValues = mixedValues; - mixValues(mixedValues, snapshotLatestValues, this.latestValues, progress, shouldCrossfadeOpacity, isOnlyMember); - } - if (point && point.rotate !== undefined) { - // Dedicated `pathRotation` channel, not `rotate`, so an - // animating `rotate` is composed with, never clobbered. - if (!this.animationValues) - this.animationValues = mixedValues; - this.animationValues.pathRotation = point.rotate; - } - this.root.scheduleUpdateProjection(); - this.scheduleRender(); - this.animationProgress = progress; - }; - this.mixTargetDelta(this.options.layoutRoot ? 1000 : 0); - } - startAnimation(options) { - this.notifyListeners("animationStart"); - this.currentAnimation?.stop(); - this.resumingFrom?.currentAnimation?.stop(); - if (this.pendingAnimation) { - cancelFrame(this.pendingAnimation); - this.pendingAnimation = undefined; - } - /** - * Start the animation in the next frame to have a frame with progress 0, - * where the target is the same as when the animation started, so we can - * calculate the relative positions correctly for instant transitions. - */ - this.pendingAnimation = frame.update(() => { - globalProjectionState.hasAnimatedSinceResize = true; - this.motionValue || (this.motionValue = motionValue(0)); - this.motionValue.jump(0, false); - this.currentAnimation = animateSingleValue(this.motionValue, [0, 1000], { - ...options, - velocity: 0, - isSync: true, - onUpdate: (latest) => { - this.mixTargetDelta(latest); - options.onUpdate && options.onUpdate(latest); - }, - onComplete: () => { - options.onComplete && options.onComplete(); - this.completeAnimation(); - }, - }); - if (this.resumingFrom) { - this.resumingFrom.currentAnimation = this.currentAnimation; - } - this.pendingAnimation = undefined; - }); - } - completeAnimation() { - if (this.resumingFrom) { - this.resumingFrom.currentAnimation = undefined; - this.resumingFrom.preserveOpacity = undefined; - } - const stack = this.getStack(); - stack && stack.exitAnimationComplete(); - this.resumingFrom = - this.currentAnimation = - this.animationValues = - undefined; - this.notifyListeners("animationComplete"); - } - finishAnimation() { - if (this.currentAnimation) { - this.mixTargetDelta && this.mixTargetDelta(animationTarget); - this.currentAnimation.stop(); - } - this.completeAnimation(); - } - applyTransformsToTarget() { - const lead = this.getLead(); - let { targetWithTransforms, target, layout, latestValues } = lead; - if (!targetWithTransforms || !target || !layout) - return; - /** - * If we're only animating position, and this element isn't the lead element, - * then instead of projecting into the lead box we instead want to calculate - * a new target that aligns the two boxes but maintains the layout shape. - */ - if (this !== lead && - this.layout && - layout && - shouldAnimatePositionOnly(this.options.animationType, this.layout.layoutBox, layout.layoutBox)) { - target = this.target || createBox(); - const xLength = calcLength(this.layout.layoutBox.x); - target.x.min = lead.target.x.min; - target.x.max = target.x.min + xLength; - const yLength = calcLength(this.layout.layoutBox.y); - target.y.min = lead.target.y.min; - target.y.max = target.y.min + yLength; - } - copyBoxInto(targetWithTransforms, target); - /** - * Apply the latest user-set transforms to the targetBox to produce the targetBoxFinal. - * This is the final box that we will then project into by calculating a transform delta and - * applying it to the corrected box. - */ - transformBox(targetWithTransforms, latestValues); - /** - * Update the delta between the corrected box and the final target box, after - * user-set transforms are applied to it. This will be used by the renderer to - * create a transform style that will reproject the element from its layout layout - * into the desired bounding box. - */ - calcBoxDelta(this.projectionDeltaWithTransform, this.layoutCorrected, targetWithTransforms, latestValues); - } - registerSharedNode(layoutId, node) { - if (!this.sharedNodes.has(layoutId)) { - this.sharedNodes.set(layoutId, new NodeStack()); - } - const stack = this.sharedNodes.get(layoutId); - stack.add(node); - const config = node.options.initialPromotionConfig; - node.promote({ - transition: config ? config.transition : undefined, - preserveFollowOpacity: config && config.shouldPreserveFollowOpacity - ? config.shouldPreserveFollowOpacity(node) - : undefined, - }); - } - isLead() { - const stack = this.getStack(); - return stack ? stack.lead === this : true; - } - getLead() { - const { layoutId } = this.options; - return layoutId ? this.getStack()?.lead || this : this; - } - getPrevLead() { - const { layoutId } = this.options; - return layoutId ? this.getStack()?.prevLead : undefined; - } - getStack() { - const { layoutId } = this.options; - if (layoutId) - return this.root.sharedNodes.get(layoutId); - } - promote({ needsReset, transition, preserveFollowOpacity, } = {}) { - const stack = this.getStack(); - if (stack) - stack.promote(this, preserveFollowOpacity); - if (needsReset) { - this.projectionDelta = undefined; - this.needsReset = true; - } - if (transition) - this.setOptions({ transition }); - } - relegate() { - const stack = this.getStack(); - if (stack) { - return stack.relegate(this); - } - else { - return false; - } - } - resetSkewAndRotation() { - const { visualElement } = this.options; - if (!visualElement) - return; - // If there's no detected skew or rotation values, we can early return without a forced render. - let hasDistortingTransform = false; - /** - * An unrolled check for rotation values. Most elements don't have any rotation and - * skipping the nested loop and new object creation is 50% faster. - */ - const { latestValues } = visualElement; - if (latestValues.z || - latestValues.rotate || - latestValues.rotateX || - latestValues.rotateY || - latestValues.rotateZ || - latestValues.skewX || - latestValues.skewY) { - hasDistortingTransform = true; - } - // If there's no distorting values, we don't need to do any more. - if (!hasDistortingTransform) - return; - const resetValues = {}; - if (latestValues.z) { - resetDistortingTransform("z", visualElement, resetValues, this.animationValues); - } - // Check the skew and rotate value of all axes and reset to 0 - for (let i = 0; i < transformAxes.length; i++) { - resetDistortingTransform(`rotate${transformAxes[i]}`, visualElement, resetValues, this.animationValues); - resetDistortingTransform(`skew${transformAxes[i]}`, visualElement, resetValues, this.animationValues); - } - // Force a render of this element to apply the transform with all skews and rotations - // set to 0. - visualElement.render(); - // Put back all the values we reset - for (const key in resetValues) { - visualElement.setStaticValue(key, resetValues[key]); - if (this.animationValues) { - this.animationValues[key] = resetValues[key]; - } - } - // Schedule a render for the next frame. This ensures we won't visually - // see the element with the reset rotate value applied. - visualElement.scheduleRender(); - } - applyProjectionStyles(targetStyle, // CSSStyleDeclaration - doesn't allow numbers to be assigned to properties - styleProp) { - if (!this.instance || this.isSVG) - return; - if (!this.isVisible) { - targetStyle.visibility = "hidden"; - return; - } - const transformTemplate = this.getTransformTemplate(); - if (this.needsReset) { - this.needsReset = false; - targetStyle.visibility = ""; - targetStyle.opacity = ""; - targetStyle.pointerEvents = - resolveMotionValue(styleProp?.pointerEvents) || ""; - targetStyle.transform = transformTemplate - ? transformTemplate(this.latestValues, "") - : "none"; - return; - } - const lead = this.getLead(); - if (!this.projectionDelta || !this.layout || !lead.target) { - if (this.options.layoutId) { - targetStyle.opacity = - this.latestValues.opacity !== undefined - ? this.latestValues.opacity - : 1; - targetStyle.pointerEvents = - resolveMotionValue(styleProp?.pointerEvents) || ""; - } - if (this.hasProjected && !hasTransform(this.latestValues)) { - targetStyle.transform = transformTemplate - ? transformTemplate({}, "") - : "none"; - this.hasProjected = false; - } - return; - } - targetStyle.visibility = ""; - const valuesToRender = lead.animationValues || lead.latestValues; - this.applyTransformsToTarget(); - let transform = buildProjectionTransform(this.projectionDeltaWithTransform, this.treeScale, valuesToRender); - if (transformTemplate) { - transform = transformTemplate(valuesToRender, transform); - } - targetStyle.transform = transform; - const { x, y } = this.projectionDelta; - targetStyle.transformOrigin = `${x.origin * 100}% ${y.origin * 100}% 0`; - if (lead.animationValues) { - /** - * If the lead component is animating, assign this either the entering/leaving - * opacity - */ - targetStyle.opacity = - lead === this - ? valuesToRender.opacity ?? - this.latestValues.opacity ?? - 1 - : this.preserveOpacity - ? this.latestValues.opacity - : valuesToRender.opacityExit; - } - else { - /** - * Or we're not animating at all, set the lead component to its layout - * opacity and other components to hidden. - */ - targetStyle.opacity = - lead === this - ? valuesToRender.opacity !== undefined - ? valuesToRender.opacity - : "" - : valuesToRender.opacityExit !== undefined - ? valuesToRender.opacityExit - : 0; - } - /** - * Apply scale correction - */ - for (const key in scaleCorrectors) { - if (valuesToRender[key] === undefined) - continue; - const { correct, applyTo, isCSSVariable } = scaleCorrectors[key]; - /** - * Only apply scale correction to the value if we have an - * active projection transform. Otherwise these values become - * vulnerable to distortion if the element changes size without - * a corresponding layout animation. - */ - const corrected = transform === "none" - ? valuesToRender[key] - : correct(valuesToRender[key], lead); - if (applyTo) { - const num = applyTo.length; - for (let i = 0; i < num; i++) { - targetStyle[applyTo[i]] = corrected; - } - } - else { - // If this is a CSS variable, set it directly on the instance. - // Replacing this function from creating styles to setting them - // would be a good place to remove per frame object creation - if (isCSSVariable) { - this.options.visualElement.renderState.vars[key] = corrected; - } - else { - targetStyle[key] = corrected; - } - } - } - /** - * Disable pointer events on follow components. This is to ensure - * that if a follow component covers a lead component it doesn't block - * pointer events on the lead. - */ - if (this.options.layoutId) { - targetStyle.pointerEvents = - lead === this - ? resolveMotionValue(styleProp?.pointerEvents) || "" - : "none"; - } - } - clearSnapshot() { - this.resumeFrom = this.snapshot = undefined; - } - // Only run on root - resetTree() { - this.root.nodes.forEach((node) => node.currentAnimation?.stop()); - this.root.nodes.forEach(clearMeasurements); - this.root.sharedNodes.clear(); - } - }; -} -function updateLayout(node) { - node.updateLayout(); -} -function notifyLayoutUpdate(node) { - const snapshot = node.resumeFrom?.snapshot || node.snapshot; - if (node.isLead() && - node.layout && - snapshot && - node.hasListeners("didUpdate")) { - const { layoutBox: layout, measuredBox: measuredLayout } = node.layout; - const { animationType } = node.options; - const isShared = snapshot.source !== node.layout.source; - // TODO Maybe we want to also resize the layout snapshot so we don't trigger - // animations for instance if layout="size" and an element has only changed position - if (animationType === "size") { - eachAxis((axis) => { - const axisSnapshot = isShared - ? snapshot.measuredBox[axis] - : snapshot.layoutBox[axis]; - const length = calcLength(axisSnapshot); - axisSnapshot.min = layout[axis].min; - axisSnapshot.max = axisSnapshot.min + length; - }); - } - else if (animationType === "x" || animationType === "y") { - const snapAxis = animationType === "x" ? "y" : "x"; - copyAxisInto(isShared - ? snapshot.measuredBox[snapAxis] - : snapshot.layoutBox[snapAxis], layout[snapAxis]); - } - else if (shouldAnimatePositionOnly(animationType, snapshot.layoutBox, layout)) { - eachAxis((axis) => { - const axisSnapshot = isShared - ? snapshot.measuredBox[axis] - : snapshot.layoutBox[axis]; - const length = calcLength(layout[axis]); - axisSnapshot.max = axisSnapshot.min + length; - /** - * Ensure relative target gets resized and rerendererd - */ - if (node.relativeTarget && !node.currentAnimation) { - node.isProjectionDirty = true; - node.relativeTarget[axis].max = - node.relativeTarget[axis].min + length; - } - }); - } - const layoutDelta = createDelta(); - calcBoxDelta(layoutDelta, layout, snapshot.layoutBox); - const visualDelta = createDelta(); - if (isShared) { - calcBoxDelta(visualDelta, node.applyTransform(measuredLayout, true), snapshot.measuredBox); - } - else { - calcBoxDelta(visualDelta, layout, snapshot.layoutBox); - } - const hasLayoutChanged = !isDeltaZero(layoutDelta); - let hasRelativeLayoutChanged = false; - if (!node.resumeFrom) { - const relativeParent = node.getClosestProjectingParent(); - /** - * If the relativeParent is itself resuming from a different element then - * the relative snapshot is not relavent - */ - if (relativeParent && !relativeParent.resumeFrom) { - const { snapshot: parentSnapshot, layout: parentLayout } = relativeParent; - if (parentSnapshot && parentLayout) { - const anchor = node.options.layoutAnchor || undefined; - const relativeSnapshot = createBox(); - calcRelativePosition(relativeSnapshot, snapshot.layoutBox, parentSnapshot.layoutBox, anchor); - const relativeLayout = createBox(); - calcRelativePosition(relativeLayout, layout, parentLayout.layoutBox, anchor); - if (!boxEqualsRounded(relativeSnapshot, relativeLayout)) { - hasRelativeLayoutChanged = true; - } - if (relativeParent.options.layoutRoot) { - node.relativeTarget = relativeLayout; - node.relativeTargetOrigin = relativeSnapshot; - node.relativeParent = relativeParent; - } - } - } - } - node.notifyListeners("didUpdate", { - layout, - snapshot, - delta: visualDelta, - layoutDelta, - hasLayoutChanged, - hasRelativeLayoutChanged, - }); - } - else if (node.isLead()) { - const { onExitComplete } = node.options; - onExitComplete && onExitComplete(); - } - /** - * Clearing transition - * TODO: Investigate why this transition is being passed in as {type: false } from Framer - * and why we need it at all - */ - node.options.transition = undefined; -} -function propagateDirtyNodes(node) { - /** - * Increase debug counter for nodes encountered this frame - */ - if (statsBuffer.value) { - metrics.nodes++; - } - if (!node.parent) - return; - /** - * If this node isn't projecting, propagate isProjectionDirty. It will have - * no performance impact but it will allow the next child that *is* projecting - * but *isn't* dirty to just check its parent to see if *any* ancestor needs - * correcting. - */ - if (!node.isProjecting()) { - node.isProjectionDirty = node.parent.isProjectionDirty; - } - /** - * Propagate isSharedProjectionDirty and isTransformDirty - * throughout the whole tree. A future revision can take another look at - * this but for safety we still recalcualte shared nodes. - */ - node.isSharedProjectionDirty || (node.isSharedProjectionDirty = Boolean(node.isProjectionDirty || - node.parent.isProjectionDirty || - node.parent.isSharedProjectionDirty)); - node.isTransformDirty || (node.isTransformDirty = node.parent.isTransformDirty); -} -function cleanDirtyNodes(node) { - node.isProjectionDirty = - node.isSharedProjectionDirty = - node.isTransformDirty = - false; -} -function clearSnapshot(node) { - node.clearSnapshot(); -} -function clearMeasurements(node) { - node.clearMeasurements(); -} -function forceLayoutMeasure(node) { - node.isLayoutDirty = true; - node.updateLayout(); -} -function clearIsLayoutDirty(node) { - node.isLayoutDirty = false; -} -/** - * When a node is animation-blocked (e.g. during drag) and its component - * didn't re-render (memoized), willUpdate() is never called so there's - * no snapshot. Use the previous layout as a snapshot and mark dirty so - * resetTransform/updateLayout/notifyLayoutUpdate process it normally. - */ -function ensureDraggedNodesSnapshotted(node) { - if (node.isAnimationBlocked && node.layout && !node.isLayoutDirty) { - node.snapshot = node.layout; - node.isLayoutDirty = true; - } -} -function resetTransformStyle(node) { - const { visualElement } = node.options; - if (visualElement && visualElement.getProps().onBeforeLayoutMeasure) { - visualElement.notify("BeforeLayoutMeasure"); - } - node.resetTransform(); -} -function finishAnimation(node) { - node.finishAnimation(); - node.targetDelta = node.relativeTarget = node.target = undefined; - node.isProjectionDirty = true; -} -function resolveTargetDelta(node) { - node.resolveTargetDelta(); -} -function calcProjection(node) { - node.calcProjection(); -} -function resetSkewAndRotation(node) { - node.resetSkewAndRotation(); -} -function removeLeadSnapshots(stack) { - stack.removeLeadSnapshot(); -} -function mixAxisDeltaLinear(output, delta, p) { - output.translate = mixNumber$1(delta.translate, 0, p); - output.scale = mixNumber$1(delta.scale, 1, p); - output.origin = delta.origin; - output.originPoint = delta.originPoint; -} -function mixAxis(output, from, to, p) { - output.min = mixNumber$1(from.min, to.min, p); - output.max = mixNumber$1(from.max, to.max, p); -} -function mixBox(output, from, to, p) { - mixAxis(output.x, from.x, to.x, p); - mixAxis(output.y, from.y, to.y, p); -} -function hasOpacityCrossfade(node) { - return (node.animationValues && node.animationValues.opacityExit !== undefined); -} -const defaultLayoutTransition = { - duration: 0.45, - ease: [0.4, 0, 0.1, 1], -}; -const userAgentContains = (string) => typeof navigator !== "undefined" && - navigator.userAgent && - navigator.userAgent.toLowerCase().includes(string); -/** - * Measured bounding boxes must be rounded in Safari and - * left untouched in Chrome, otherwise non-integer layouts within scaled-up elements - * can appear to jump. - */ -const roundPoint = userAgentContains("applewebkit/") && !userAgentContains("chrome/") - ? Math.round - : motionUtils.noop; -function roundAxis(axis) { - // Round to the nearest .5 pixels to support subpixel layouts - axis.min = roundPoint(axis.min); - axis.max = roundPoint(axis.max); -} -function roundBox(box) { - roundAxis(box.x); - roundAxis(box.y); -} -function shouldAnimatePositionOnly(animationType, snapshot, layout) { - return (animationType === "position" || - (animationType === "preserve-aspect" && - !isNear(aspectRatio(snapshot), aspectRatio(layout), 0.2))); -} -function checkNodeWasScrollRoot(node) { - return node !== node.root && node.scroll?.wasRoot; -} - -const DocumentProjectionNode = createProjectionNode({ - attachResizeListener: (ref, notify) => addDomEvent(ref, "resize", notify), - measureScroll: () => ({ - x: document.documentElement.scrollLeft || document.body?.scrollLeft || 0, - y: document.documentElement.scrollTop || document.body?.scrollTop || 0, - }), - checkIsScrollRoot: () => true, -}); - -const notify = (node) => !node.isLayoutDirty && node.willUpdate(false); -function nodeGroup() { - const nodes = new Set(); - const subscriptions = new WeakMap(); - const dirtyAll = () => nodes.forEach(notify); - return { - add: (node) => { - nodes.add(node); - subscriptions.set(node, node.addEventListener("willUpdate", dirtyAll)); - }, - remove: (node) => { - nodes.delete(node); - const unsubscribe = subscriptions.get(node); - if (unsubscribe) { - unsubscribe(); - subscriptions.delete(node); - } - dirtyAll(); - }, - dirty: dirtyAll, - }; -} - -const rootProjectionNode = { - current: undefined, -}; -const HTMLProjectionNode = createProjectionNode({ - measureScroll: (instance) => ({ - x: instance.scrollLeft, - y: instance.scrollTop, - }), - defaultParent: () => { - if (!rootProjectionNode.current) { - const documentNode = new DocumentProjectionNode({}); - documentNode.mount(window); - documentNode.setOptions({ layoutScroll: true }); - rootProjectionNode.current = documentNode; - } - return rootProjectionNode.current; - }, - resetTransform: (instance, value) => { - instance.style.transform = value !== undefined ? value : "none"; - }, - checkIsScrollRoot: (instance) => Boolean(window.getComputedStyle(instance).position === "fixed"), -}); - -const layoutSelector = "[data-layout],[data-layout-id]"; -/** - * All imperatively-created projection nodes live in one persistent tree, - * shared across animateLayout() calls (and with any React-created nodes, - * via the singleton document root). Keyed by element for reuse. - */ -const layoutNodes = new WeakMap(); -/** - * Builders created within the same synchronous tick are flushed together - * as a single "commit": every node is snapshotted before any updateDom - * runs, mirroring React batching renders from different parts of the tree. - */ -let pendingBuilders; -function collectLayoutElements(scope) { - const elements = []; - if (scope instanceof HTMLElement && scope.matches(layoutSelector)) { - elements.push(scope); - } - scope.querySelectorAll(layoutSelector).forEach((element) => { - if (element instanceof HTMLElement) - elements.push(element); - }); - return elements; -} -/** - * Process any work scheduled on the frameloop now. A previous animation - * may have been seeked while paused (controls.time = x) without a frame - * having rendered it - we must materialise that state into the DOM - * before taking snapshots. - */ -function flushPendingFrame() { - if (frameData.isProcessing) - return; - const now = time.now(); - frameData.delta = motionUtils.clamp(0, 1000 / 60, now - frameData.timestamp); - frameData.timestamp = now; - frameData.isProcessing = true; - frameSteps.update.process(frameData); - frameSteps.preRender.process(frameData); - frameSteps.render.process(frameData); - frameData.isProcessing = false; -} -function getProjectionParent(element) { - let ancestor = element.parentElement; - while (ancestor) { - const node = layoutNodes.get(ancestor); - if (node && node.instance) - return node; - ancestor = ancestor.parentElement; - } - return undefined; -} -function createVisualElement() { - return new HTMLVisualElement({ - props: {}, - presenceContext: null, - visualState: { - latestValues: {}, - renderState: { - transform: {}, - transformOrigin: {}, - style: {}, - vars: {}, - }, - }, - }, { allowProjection: true }); -} -function readNodeOptions(element, transition) { - const layoutAttr = element.getAttribute("data-layout"); - const layoutId = element.getAttribute("data-layout-id") ?? undefined; - return { - layoutId, - layout: layoutAttr !== null ? true : undefined, - animationType: (!layoutAttr || layoutAttr === "true" - ? "both" - : layoutAttr), - transition, - }; -} -function prepareNode(element, transition) { - let node = layoutNodes.get(element); - if (!node) { - let visualElement = visualElementStore.get(element); - if (!visualElement) - visualElement = createVisualElement(); - /** - * A first-time element may carry a projection transform in its - * inline style (e.g. it was cloned from an element mid-animation). - * That transform isn't tracked in latestValues so the engine can't - * reset it before measuring - clear it now so the first layout - * measurement isn't inflated. - */ - if (element.style.transform && - !hasTransform(visualElement.latestValues)) { - element.style.transform = ""; - } - node = new HTMLProjectionNode(visualElement.latestValues, getProjectionParent(element)); - visualElement.projection = node; - node.setOptions({ - ...readNodeOptions(element, transition), - visualElement, - }); - node.mount(element); - layoutNodes.set(element, node); - } - else { - node.setOptions(readNodeOptions(element, transition)); - } - node.isPresent = true; - if (node.options.onExitComplete) { - node.setOptions({ onExitComplete: undefined }); - } - return node; -} -function sortDocumentOrder(elements) { - return [...elements].sort((a, b) => a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1); -} -function dropNode(element, node) { - node.setOptions({ onExitComplete: undefined }); - /** - * Stop any lingering animation so it can't leak into future updates. - * A follow node can share its currentAnimation with a surviving lead - * (via resumingFrom), in which case it isn't ours to stop. - */ - const stack = node.getStack(); - if (!stack || node.isLead()) - node.currentAnimation?.stop(); - node.unmount(); - layoutNodes.delete(element); -} -function flushPendingBuilders() { - const builders = pendingBuilders; - pendingBuilders = undefined; - flushPendingFrame(); - /** - * Discover and mount every node across all builders before snapshotting - * any of them. Mounting during an active update flags isLayoutDirty, - * which would make that node's own willUpdate skip its snapshot. - * Document order guarantees ancestors mount before descendants, even - * when they're discovered by different builders. - */ - const targets = new Map(); - for (const builder of builders) { - for (const element of builder.collectTargets()) { - const owners = targets.get(element); - owners ? owners.push(builder) : targets.set(element, [builder]); - } - } - const union = new Map(); - for (const element of sortDocumentOrder(targets.keys())) { - const owners = targets.get(element); - const node = prepareNode(element, owners[owners.length - 1].transitionFor(element)); - for (const owner of owners) - owner.adopt(element, node); - union.set(element, node); - } - union.forEach((node) => { - node.isLayoutDirty = false; - node.willUpdate(); - }); - const updatePromises = []; - for (const builder of builders) { - const result = builder.runUpdate(); - if (result) - updatePromises.push(result); - } - const commit = () => { - /** - * Process all additions before any removals so that, even across - * builders, a removed member knows whether a replacement with the - * same layoutId was added in this commit. - */ - const newMemberIds = new Set(); - for (const builder of builders) { - builder.reconcileAdditions(newMemberIds); - } - for (const builder of builders) { - builder.reconcileRemovals(newMemberIds); - } - let root; - union.forEach((node) => (root || (root = node.root))); - for (const builder of builders) - root || (root = builder.getRoot()); - root?.didUpdate(); - /** - * The root flushes the update on a microtask, synchronously - * processing the frame that creates the layout animations. Collect - * them in a later microtask step of the same pass. - */ - microtask.render(() => { - for (const builder of builders) - builder.finalize(); - }); - }; - updatePromises.length ? Promise.all(updatePromises).then(commit) : commit(); -} -class LayoutAnimationBuilder { - constructor(scope, updateDom, defaultOptions) { - this.scope = scope; - this.updateDom = updateDom; - this.defaultOptions = defaultOptions; - this.sharedTransitions = new Map(); - this.notifyReady = () => { }; - this.rejectReady = () => { }; - this.tracked = new Map(); - this.restorePoints = new Map(); - this.readyPromise = new Promise((resolve, reject) => { - this.notifyReady = resolve; - this.rejectReady = reject; - }); - if (!pendingBuilders) { - pendingBuilders = []; - queueMicrotask(flushPendingBuilders); - } - pendingBuilders.push(this); - } - shared(id, transition) { - this.sharedTransitions.set(id, transition); - return this; - } - then(resolve, reject) { - return this.readyPromise.then(resolve, reject); - } - transitionFor(element) { - const layoutId = element.getAttribute("data-layout-id"); - return ((layoutId && this.sharedTransitions.get(layoutId)) || - this.defaultOptions); - } - adopt(element, node) { - this.tracked.set(element, node); - this.restorePoints.set(element, { - parent: element.parentElement, - next: element.nextSibling, - }); - } - collectTargets() { - return collectLayoutElements(this.scope); - } - runUpdate() { - try { - const result = this.updateDom(); - if (result && typeof result.then === "function") { - return result.then(undefined, (error) => { - this.updateError = error; - }); - } - } - catch (error) { - this.updateError = error; - } - return undefined; - } - reconcileAdditions(newMemberIds) { - for (const element of collectLayoutElements(this.scope)) { - if (this.tracked.has(element)) - continue; - const node = prepareNode(element, this.transitionFor(element)); - this.adopt(element, node); - node.options.layoutId && newMemberIds.add(node.options.layoutId); - } - } - reconcileRemovals(newMemberIds) { - this.tracked.forEach((node, element) => { - if (element.isConnected) - return; - const restore = this.restorePoints.get(element); - this.restorePoints.delete(element); - const { layoutId } = node.options; - const stack = node.getStack(); - const hasSurvivor = stack && - stack.members.some((member) => member !== node && - member.instance - ?.isConnected); - /** - * A removed lead with a surviving stack member - and no - * replacement member added this commit - runs an exit - * crossfade: restore the element to its old position in the - * DOM, relegate it and let the survivor take over. It's - * removed again once the animation completes. - */ - if (layoutId && - node.isLead() && - hasSurvivor && - !newMemberIds.has(layoutId)) { - if (restore && restore.parent.isConnected) { - restore.parent.insertBefore(element, restore.next && restore.next.parentNode === restore.parent - ? restore.next - : null); - node.isPresent = false; - node.setOptions({ - onExitComplete: () => { - element.remove(); - dropNode(element, node); - }, - }); - if (node.relegate()) - return; - element.remove(); - } - } - dropNode(element, node); - this.tracked.delete(element); - }); - } - getRoot() { - let root; - this.tracked.forEach((node) => (root || (root = node.root))); - return root; - } - finalize() { - if (this.updateError) { - this.rejectReady(this.updateError); - return; - } - const animations = new Set(); - this.tracked.forEach((node) => { - if (node.instance && node.currentAnimation) { - animations.add(node.currentAnimation); - } - }); - this.notifyReady(new GroupAnimation([...animations])); - } -} -function parseAnimateLayoutArgs(scopeOrUpdateDom, updateDomOrOptions, options) { - if (typeof scopeOrUpdateDom === "function") { - return { - scope: document, - updateDom: scopeOrUpdateDom, - defaultOptions: updateDomOrOptions, - }; - } - const scope = scopeOrUpdateDom instanceof Document - ? scopeOrUpdateDom - : resolveElements(scopeOrUpdateDom)[0] ?? document; - return { - scope, - updateDom: updateDomOrOptions, - defaultOptions: options, - }; -} - -/** - * @deprecated - * - * Import as `frame` instead. - */ -const sync = frame; -/** - * @deprecated - * - * Use cancelFrame(callback) instead. - */ -const cancelSync = stepsOrder.reduce((acc, key) => { - acc[key] = (process) => cancelFrame(process); - return acc; -}, {}); - -exports.AsyncMotionValueAnimation = AsyncMotionValueAnimation; -exports.DOMKeyframesResolver = DOMKeyframesResolver; -exports.DOMVisualElement = DOMVisualElement; -exports.DocumentProjectionNode = DocumentProjectionNode; -exports.Feature = Feature; -exports.FlatTree = FlatTree; -exports.GroupAnimation = GroupAnimation; -exports.GroupAnimationWithThen = GroupAnimationWithThen; -exports.HTMLProjectionNode = HTMLProjectionNode; -exports.HTMLVisualElement = HTMLVisualElement; -exports.JSAnimation = JSAnimation; -exports.KeyframeResolver = KeyframeResolver; -exports.LayoutAnimationBuilder = LayoutAnimationBuilder; -exports.MotionValue = MotionValue; -exports.NativeAnimation = NativeAnimation; -exports.NativeAnimationExtended = NativeAnimationExtended; -exports.NativeAnimationWrapper = NativeAnimationWrapper; -exports.NodeStack = NodeStack; -exports.ObjectVisualElement = ObjectVisualElement; -exports.SVGVisualElement = SVGVisualElement; -exports.ViewTransitionBuilder = ViewTransitionBuilder; -exports.VisualElement = VisualElement; -exports.acceleratedValues = acceleratedValues; -exports.addAttrValue = addAttrValue; -exports.addDomEvent = addDomEvent; -exports.addScaleCorrector = addScaleCorrector; -exports.addStyleValue = addStyleValue; -exports.addValueToWillChange = addValueToWillChange; -exports.alpha = alpha; -exports.analyseComplexValue = analyseComplexValue; -exports.animateMotionValue = animateMotionValue; -exports.animateSingleValue = animateSingleValue; -exports.animateTarget = animateTarget; -exports.animateValue = animateValue; -exports.animateVariant = animateVariant; -exports.animateView = animateView; -exports.animateVisualElement = animateVisualElement; -exports.animationMapKey = animationMapKey; -exports.applyAxisDelta = applyAxisDelta; -exports.applyBoxDelta = applyBoxDelta; -exports.applyGeneratorOptions = applyGeneratorOptions; -exports.applyPointDelta = applyPointDelta; -exports.applyPxDefaults = applyPxDefaults; -exports.applyTreeDeltas = applyTreeDeltas; -exports.arc = arc; -exports.aspectRatio = aspectRatio; -exports.attachFollow = attachFollow; -exports.attachSpring = attachSpring; -exports.attrEffect = attrEffect; -exports.axisDeltaEquals = axisDeltaEquals; -exports.axisEquals = axisEquals; -exports.axisEqualsRounded = axisEqualsRounded; -exports.boxEquals = boxEquals; -exports.boxEqualsRounded = boxEqualsRounded; -exports.buildHTMLStyles = buildHTMLStyles; -exports.buildProjectionTransform = buildProjectionTransform; -exports.buildSVGAttrs = buildSVGAttrs; -exports.buildSVGPath = buildSVGPath; -exports.buildTransform = buildTransform; -exports.calcAxisDelta = calcAxisDelta; -exports.calcBoxDelta = calcBoxDelta; -exports.calcChildStagger = calcChildStagger; -exports.calcGeneratorDuration = calcGeneratorDuration; -exports.calcLength = calcLength; -exports.calcRelativeAxis = calcRelativeAxis; -exports.calcRelativeAxisPosition = calcRelativeAxisPosition; -exports.calcRelativeBox = calcRelativeBox; -exports.calcRelativePosition = calcRelativePosition; -exports.camelCaseAttributes = camelCaseAttributes; -exports.camelToDash = camelToDash; -exports.cancelFrame = cancelFrame; -exports.cancelMicrotask = cancelMicrotask; -exports.cancelSync = cancelSync; -exports.checkVariantsDidChange = checkVariantsDidChange; -exports.cleanDirtyNodes = cleanDirtyNodes; -exports.collectMotionValues = collectMotionValues; -exports.color = color; -exports.compareByDepth = compareByDepth; -exports.complex = complex; -exports.containsCSSVariable = containsCSSVariable; -exports.convertBoundingBoxToBox = convertBoundingBoxToBox; -exports.convertBoxToBoundingBox = convertBoxToBoundingBox; -exports.convertOffsetToTimes = convertOffsetToTimes; -exports.copyAxisDeltaInto = copyAxisDeltaInto; -exports.copyAxisInto = copyAxisInto; -exports.copyBoxInto = copyBoxInto; -exports.correctBorderRadius = correctBorderRadius; -exports.correctBoxShadow = correctBoxShadow; -exports.createAnimationState = createAnimationState; -exports.createAxis = createAxis; -exports.createAxisDelta = createAxisDelta; -exports.createBox = createBox; -exports.createDelta = createDelta; -exports.createGeneratorEasing = createGeneratorEasing; -exports.createProjectionNode = createProjectionNode; -exports.createRenderBatcher = createRenderBatcher; -exports.cubicBezierAsString = cubicBezierAsString; -exports.defaultEasing = defaultEasing; -exports.defaultOffset = defaultOffset; -exports.defaultTransformValue = defaultTransformValue; -exports.defaultValueTypes = defaultValueTypes; -exports.degrees = degrees; -exports.delay = delay; -exports.delayInSeconds = delayInSeconds; -exports.dimensionValueTypes = dimensionValueTypes; -exports.eachAxis = eachAxis; -exports.fillOffset = fillOffset; -exports.fillWildcards = fillWildcards; -exports.findDimensionValueType = findDimensionValueType; -exports.findValueType = findValueType; -exports.flushKeyframeResolvers = flushKeyframeResolvers; -exports.followValue = followValue; -exports.frame = frame; -exports.frameData = frameData; -exports.frameSteps = frameSteps; -exports.generateLinearEasing = generateLinearEasing; -exports.getAnimatableNone = getAnimatableNone; -exports.getAnimationMap = getAnimationMap; -exports.getComputedStyle = getComputedStyle$2; -exports.getDefaultTransition = getDefaultTransition; -exports.getDefaultValueType = getDefaultValueType; -exports.getFeatureDefinitions = getFeatureDefinitions; -exports.getFinalKeyframe = getFinalKeyframe; -exports.getMixer = getMixer; -exports.getOptimisedAppearId = getOptimisedAppearId; -exports.getOriginIndex = getOriginIndex; -exports.getValueAsType = getValueAsType; -exports.getValueTransition = getValueTransition; -exports.getVariableValue = getVariableValue; -exports.getVariantContext = getVariantContext; -exports.getViewAnimationLayerInfo = getViewAnimationLayerInfo; -exports.getViewAnimations = getViewAnimations; -exports.globalProjectionState = globalProjectionState; -exports.has2DTranslate = has2DTranslate; -exports.hasReducedMotionListener = hasReducedMotionListener; -exports.hasScale = hasScale; -exports.hasTransform = hasTransform; -exports.hex = hex; -exports.hover = hover; -exports.hsla = hsla; -exports.hslaToRgba = hslaToRgba; -exports.inertia = inertia; -exports.initPrefersReducedMotion = initPrefersReducedMotion; -exports.interpolate = interpolate; -exports.invisibleValues = invisibleValues; -exports.isAnimationControls = isAnimationControls; -exports.isCSSVariableName = isCSSVariableName; -exports.isCSSVariableToken = isCSSVariableToken; -exports.isControllingVariants = isControllingVariants; -exports.isDeltaZero = isDeltaZero; -exports.isDragActive = isDragActive; -exports.isDragging = isDragging; -exports.isElementKeyboardAccessible = isElementKeyboardAccessible; -exports.isElementTextInput = isElementTextInput; -exports.isForcedMotionValue = isForcedMotionValue; -exports.isGenerator = isGenerator; -exports.isHTMLElement = isHTMLElement; -exports.isKeyframesTarget = isKeyframesTarget; -exports.isMotionValue = isMotionValue; -exports.isNear = isNear; -exports.isNodeOrChild = isNodeOrChild; -exports.isPrimaryPointer = isPrimaryPointer; -exports.isSVGElement = isSVGElement; -exports.isSVGSVGElement = isSVGSVGElement; -exports.isSVGTag = isSVGTag; -exports.isTransitionDefined = isTransitionDefined; -exports.isVariantLabel = isVariantLabel; -exports.isVariantNode = isVariantNode; -exports.isWaapiSupportedEasing = isWaapiSupportedEasing; -exports.isWillChangeMotionValue = isWillChangeMotionValue; -exports.keyframes = keyframes; -exports.makeAnimationInstant = makeAnimationInstant; -exports.mapEasingToNativeEasing = mapEasingToNativeEasing; -exports.mapValue = mapValue; -exports.maxGeneratorDuration = maxGeneratorDuration; -exports.measurePageBox = measurePageBox; -exports.measureViewportBox = measureViewportBox; -exports.microtask = microtask; -exports.mix = mix; -exports.mixArray = mixArray; -exports.mixColor = mixColor; -exports.mixComplex = mixComplex; -exports.mixImmediate = mixImmediate; -exports.mixLinearColor = mixLinearColor; -exports.mixNumber = mixNumber$1; -exports.mixObject = mixObject; -exports.mixValues = mixValues; -exports.mixVisibility = mixVisibility; -exports.motionValue = motionValue; -exports.nodeGroup = nodeGroup; -exports.number = number; -exports.numberValueTypes = numberValueTypes; -exports.observeTimeline = observeTimeline; -exports.optimizedAppearDataAttribute = optimizedAppearDataAttribute; -exports.optimizedAppearDataId = optimizedAppearDataId; -exports.parseAnimateLayoutArgs = parseAnimateLayoutArgs; -exports.parseCSSVariable = parseCSSVariable; -exports.parseValueFromTransform = parseValueFromTransform; -exports.percent = percent; -exports.pixelsToPercent = pixelsToPercent; -exports.positionalKeys = positionalKeys; -exports.prefersReducedMotion = prefersReducedMotion; -exports.press = press; -exports.progressPercentage = progressPercentage; -exports.propEffect = propEffect; -exports.propagateDirtyNodes = propagateDirtyNodes; -exports.px = px; -exports.readTransformValue = readTransformValue; -exports.recordStats = recordStats; -exports.removeAxisDelta = removeAxisDelta; -exports.removeAxisTransforms = removeAxisTransforms; -exports.removeBoxTransforms = removeBoxTransforms; -exports.removePointDelta = removePointDelta; -exports.renderHTML = renderHTML; -exports.renderSVG = renderSVG; -exports.resize = resize; -exports.resolveElements = resolveElements; -exports.resolveMotionValue = resolveMotionValue; -exports.resolveTransition = resolveTransition; -exports.resolveVariant = resolveVariant; -exports.resolveVariantFromProps = resolveVariantFromProps; -exports.rgbUnit = rgbUnit; -exports.rgba = rgba; -exports.rootProjectionNode = rootProjectionNode; -exports.scale = scale; -exports.scaleCorrectors = scaleCorrectors; -exports.scalePoint = scalePoint; -exports.scrapeHTMLMotionValuesFromProps = scrapeMotionValuesFromProps$1; -exports.scrapeSVGMotionValuesFromProps = scrapeMotionValuesFromProps; -exports.setDragLock = setDragLock; -exports.setFeatureDefinitions = setFeatureDefinitions; -exports.setStyle = setStyle; -exports.setTarget = setTarget; -exports.spring = spring; -exports.springValue = springValue; -exports.stagger = stagger; -exports.startWaapiAnimation = startWaapiAnimation; -exports.statsBuffer = statsBuffer; -exports.styleEffect = styleEffect; -exports.supportedWaapiEasing = supportedWaapiEasing; -exports.supportsBrowserAnimation = supportsBrowserAnimation; -exports.supportsFlags = supportsFlags; -exports.supportsLinearEasing = supportsLinearEasing; -exports.supportsPartialKeyframes = supportsPartialKeyframes; -exports.supportsScrollTimeline = supportsScrollTimeline; -exports.supportsViewTimeline = supportsViewTimeline; -exports.svgEffect = svgEffect; -exports.sync = sync; -exports.testValueType = testValueType; -exports.time = time; -exports.transform = transform; -exports.transformAxis = transformAxis; -exports.transformBox = transformBox; -exports.transformBoxPoints = transformBoxPoints; -exports.transformPropOrder = transformPropOrder; -exports.transformProps = transformProps; -exports.transformValue = transformValue; -exports.transformValueTypes = transformValueTypes; -exports.translateAxis = translateAxis; -exports.updateMotionValuesFromProps = updateMotionValuesFromProps; -exports.variantPriorityOrder = variantPriorityOrder; -exports.variantProps = variantProps; -exports.vh = vh; -exports.visualElementStore = visualElementStore; -exports.vw = vw; -//# sourceMappingURL=index.js.map diff --git a/node_modules/motion-dom/dist/cjs/index.js.map b/node_modules/motion-dom/dist/cjs/index.js.map deleted file mode 100644 index 5339345..0000000 --- a/node_modules/motion-dom/dist/cjs/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sources":["../../src/frameloop/order.ts","../../src/frameloop/render-step.ts","../../src/frameloop/batcher.ts","../../src/frameloop/frame.ts","../../src/frameloop/sync-time.ts","../../src/animation/utils/is-css-variable.ts","../../src/value/types/numbers/index.ts","../../src/value/types/utils/sanitize.ts","../../src/value/types/utils/float-regex.ts","../../src/value/types/utils/is-nullish.ts","../../src/value/types/utils/single-color-regex.ts","../../src/value/types/color/utils.ts","../../src/value/types/color/rgba.ts","../../src/value/types/color/hex.ts","../../src/value/types/numbers/units.ts","../../src/value/types/color/hsla.ts","../../src/value/types/color/index.ts","../../src/value/types/utils/color-regex.ts","../../src/value/types/complex/index.ts","../../src/value/types/color/hsla-to-rgba.ts","../../src/utils/mix/immediate.ts","../../src/utils/mix/number.ts","../../src/utils/mix/color.ts","../../src/utils/mix/visibility.ts","../../src/utils/mix/complex.ts","../../src/utils/mix/index.ts","../../src/animation/drivers/frame.ts","../../src/animation/waapi/utils/linear.ts","../../src/animation/generators/utils/calc-duration.ts","../../src/animation/generators/utils/create-generator-easing.ts","../../src/animation/generators/spring.ts","../../src/animation/generators/utils/velocity.ts","../../src/animation/generators/inertia.ts","../../src/utils/interpolate.ts","../../src/animation/keyframes/offsets/fill.ts","../../src/animation/keyframes/offsets/default.ts","../../src/animation/keyframes/offsets/time.ts","../../src/animation/generators/keyframes.ts","../../src/animation/keyframes/get-final.ts","../../src/animation/utils/replace-transition-type.ts","../../src/animation/utils/WithPromise.ts","../../src/animation/JSAnimation.ts","../../src/animation/keyframes/utils/fill-wildcards.ts","../../src/render/dom/parse-transform.ts","../../src/render/utils/keys-transform.ts","../../src/animation/keyframes/utils/unit-conversion.ts","../../src/animation/keyframes/KeyframesResolver.ts","../../src/render/dom/is-css-var.ts","../../src/render/dom/style-set.ts","../../src/utils/supports/flags.ts","../../src/utils/supports/memo.ts","../../src/utils/supports/scroll-timeline.ts","../../src/utils/supports/linear-easing.ts","../../src/animation/waapi/easing/cubic-bezier.ts","../../src/animation/waapi/easing/supported.ts","../../src/animation/waapi/easing/map-easing.ts","../../src/animation/waapi/start-waapi-animation.ts","../../src/animation/generators/utils/is-generator.ts","../../src/animation/waapi/utils/apply-generator.ts","../../src/animation/NativeAnimation.ts","../../src/animation/waapi/utils/unsupported-easing.ts","../../src/animation/NativeAnimationExtended.ts","../../src/animation/utils/is-animatable.ts","../../src/animation/utils/can-animate.ts","../../src/animation/utils/make-animation-instant.ts","../../src/animation/waapi/utils/accelerated-values.ts","../../src/animation/waapi/utils/is-browser-color.ts","../../src/animation/waapi/supports/waapi.ts","../../src/animation/AsyncMotionValueAnimation.ts","../../src/animation/GroupAnimation.ts","../../src/animation/GroupAnimationWithThen.ts","../../src/animation/NativeAnimationWrapper.ts","../../src/animation/utils/active-animations.ts","../../src/animation/utils/calc-child-stagger.ts","../../src/value/index.ts","../../src/animation/utils/resolve-transition.ts","../../src/animation/utils/get-value-transition.ts","../../src/animation/utils/default-transitions.ts","../../src/animation/utils/is-transition-defined.ts","../../src/animation/interfaces/motion-value.ts","../../src/animation/utils/arc.ts","../../src/animation/utils/css-variables-conversion.ts","../../src/render/utils/resolve-variants.ts","../../src/render/utils/resolve-dynamic-variants.ts","../../src/render/utils/keys-position.ts","../../src/render/utils/is-keyframes-target.ts","../../src/render/utils/setters.ts","../../src/value/utils/is-motion-value.ts","../../src/value/will-change/is.ts","../../src/value/will-change/add-will-change.ts","../../src/render/dom/utils/camel-to-dash.ts","../../src/animation/optimized-appear/data-id.ts","../../src/animation/optimized-appear/get-appear-id.ts","../../src/animation/interfaces/visual-element-target.ts","../../src/animation/interfaces/visual-element-variant.ts","../../src/animation/interfaces/visual-element.ts","../../src/value/types/auto.ts","../../src/value/types/test.ts","../../src/value/types/dimensions.ts","../../src/animation/keyframes/utils/is-none.ts","../../src/value/types/complex/filter.ts","../../src/value/types/complex/mask.ts","../../src/value/types/int.ts","../../src/value/types/maps/transform.ts","../../src/value/types/maps/number.ts","../../src/value/types/maps/defaults.ts","../../src/value/types/utils/animatable-none.ts","../../src/animation/keyframes/utils/make-none-animatable.ts","../../src/animation/keyframes/DOMKeyframesResolver.ts","../../src/utils/border-radius.ts","../../src/animation/waapi/utils/px-values.ts","../../src/animation/keyframes/utils/apply-px-defaults.ts","../../src/animation/waapi/easing/is-supported.ts","../../src/animation/waapi/supports/partial-keyframes.ts","../../src/utils/resolve-elements.ts","../../src/effects/utils/create-dom-effect.ts","../../src/value/types/utils/get-as-type.ts","../../src/effects/MotionValueState.ts","../../src/effects/utils/create-effect.ts","../../src/effects/attr/index.ts","../../src/effects/prop/index.ts","../../src/utils/is-html-element.ts","../../src/effects/style/transform.ts","../../src/effects/style/index.ts","../../src/effects/svg/index.ts","../../src/frameloop/microtask.ts","../../src/gestures/drag/state/is-active.ts","../../src/gestures/drag/state/set-active.ts","../../src/gestures/utils/setup.ts","../../src/gestures/hover.ts","../../src/gestures/utils/is-node-or-child.ts","../../src/gestures/utils/is-primary-pointer.ts","../../src/gestures/press/utils/is-keyboard-accessible.ts","../../src/gestures/press/utils/state.ts","../../src/gestures/press/utils/keyboard.ts","../../src/gestures/press/index.ts","../../src/render/dom/style-computed.ts","../../src/utils/is-svg-element.ts","../../src/resize/handle-element.ts","../../src/resize/handle-window.ts","../../src/resize/index.ts","../../src/scroll/observe.ts","../../src/stats/buffer.ts","../../src/stats/index.ts","../../src/utils/is-svg-svg-element.ts","../../src/utils/stagger.ts","../../src/utils/transform.ts","../../src/value/follow-value.ts","../../src/value/subscribe-value.ts","../../src/value/transform-value.ts","../../src/value/map-value.ts","../../src/value/spring-value.ts","../../src/value/types/utils/find.ts","../../src/view/utils/assign-names.ts","../../src/view/utils/choose-layer-type.ts","../../src/view/utils/css.ts","../../src/view/utils/get-layer-info.ts","../../src/view/utils/get-view-animations.ts","../../src/view/utils/has-target.ts","../../src/view/start.ts","../../src/view/queue.ts","../../src/view/index.ts","../../src/projection/geometry/models.ts","../../src/render/store.ts","../../src/render/utils/is-animation-controls.ts","../../src/render/utils/is-variant-label.ts","../../src/render/utils/variant-props.ts","../../src/render/utils/is-controlling-variants.ts","../../src/render/utils/motion-values.ts","../../src/render/utils/reduced-motion/state.ts","../../src/render/utils/reduced-motion/index.ts","../../src/render/VisualElement.ts","../../src/render/dom/DOMVisualElement.ts","../../src/render/Feature.ts","../../src/projection/geometry/conversion.ts","../../src/projection/utils/has-transform.ts","../../src/projection/geometry/delta-apply.ts","../../src/projection/utils/measure.ts","../../src/render/html/utils/build-transform.ts","../../src/render/html/utils/build-styles.ts","../../src/render/html/utils/render.ts","../../src/projection/styles/scale-border-radius.ts","../../src/projection/styles/scale-box-shadow.ts","../../src/projection/styles/scale-correction.ts","../../src/render/utils/is-forced-motion-value.ts","../../src/render/html/utils/scrape-motion-values.ts","../../src/render/html/HTMLVisualElement.ts","../../src/render/object/ObjectVisualElement.ts","../../src/render/svg/utils/path.ts","../../src/render/svg/utils/build-attrs.ts","../../src/render/svg/utils/camel-case-attrs.ts","../../src/render/svg/utils/is-svg-tag.ts","../../src/render/svg/utils/render.ts","../../src/render/svg/utils/scrape-motion-values.ts","../../src/render/svg/SVGVisualElement.ts","../../src/render/utils/get-variant-context.ts","../../src/render/utils/shallow-compare.ts","../../src/render/utils/animation-state.ts","../../src/projection/geometry/copy.ts","../../src/projection/geometry/delta-calc.ts","../../src/projection/geometry/delta-remove.ts","../../src/projection/geometry/utils.ts","../../src/projection/utils/each-axis.ts","../../src/projection/styles/transform.ts","../../src/projection/animation/mix-values.ts","../../src/animation/animate/single-value.ts","../../src/events/add-dom-event.ts","../../src/projection/utils/compare-by-depth.ts","../../src/projection/utils/flat-tree.ts","../../src/utils/delay.ts","../../src/value/utils/resolve-motion-value.ts","../../src/projection/shared/stack.ts","../../src/projection/node/state.ts","../../src/projection/node/create-projection-node.ts","../../src/projection/node/DocumentProjectionNode.ts","../../src/projection/node/group.ts","../../src/projection/node/HTMLProjectionNode.ts","../../src/layout/LayoutAnimationBuilder.ts","../../src/frameloop/index-legacy.ts"],"sourcesContent":["import { StepId } from \"./types\"\n\nexport const stepsOrder: StepId[] = [\n \"setup\", // Compute\n \"read\", // Read\n \"resolveKeyframes\", // Write/Read/Write/Read\n \"preUpdate\", // Compute\n \"update\", // Compute\n \"preRender\", // Compute\n \"render\", // Write\n \"postRender\", // Compute\n] as const\n\nexport type StepNames = (typeof stepsOrder)[number]\n","import { FrameData, Process, Step } from \"./types\"\n\nexport function createRenderStep(runNextFrame: () => void): Step {\n /**\n * We create and reuse two queues, one to queue jobs for the current frame\n * and one for the next. We reuse to avoid triggering GC after x frames.\n */\n let thisFrame = new Set()\n let nextFrame = new Set()\n\n /**\n * Track whether we're currently processing jobs in this step. This way\n * we can decide whether to schedule new jobs for this frame or next.\n */\n let isProcessing = false\n\n let flushNextFrame = false\n\n /**\n * A set of processes which were marked keepAlive when scheduled.\n */\n const toKeepAlive = new WeakSet()\n\n let latestFrameData: FrameData = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n }\n\n function triggerCallback(callback: Process) {\n if (toKeepAlive.has(callback)) {\n step.schedule(callback)\n runNextFrame()\n }\n\n callback(latestFrameData)\n }\n\n const step: Step = {\n /**\n * Schedule a process to run on the next frame.\n */\n schedule: (callback, keepAlive = false, immediate = false) => {\n const addToCurrentFrame = immediate && isProcessing\n const queue = addToCurrentFrame ? thisFrame : nextFrame\n\n if (keepAlive) toKeepAlive.add(callback)\n\n queue.add(callback)\n\n return callback\n },\n\n /**\n * Cancel the provided callback from running on the next frame.\n */\n cancel: (callback) => {\n nextFrame.delete(callback)\n toKeepAlive.delete(callback)\n },\n\n /**\n * Execute all schedule callbacks.\n */\n process: (frameData) => {\n latestFrameData = frameData\n\n /**\n * If we're already processing we've probably been triggered by a flushSync\n * inside an existing process. Instead of executing, mark flushNextFrame\n * as true and ensure we flush the following frame at the end of this one.\n */\n if (isProcessing) {\n flushNextFrame = true\n return\n }\n\n isProcessing = true\n\n // Swap this frame and the next to avoid GC\n const prevFrame = thisFrame\n thisFrame = nextFrame\n nextFrame = prevFrame\n\n // Execute this frame\n thisFrame.forEach(triggerCallback)\n\n // Clear the frame so no callbacks remain. This is to avoid\n // memory leaks should this render step not run for a while.\n thisFrame.clear()\n\n isProcessing = false\n\n if (flushNextFrame) {\n flushNextFrame = false\n step.process(frameData)\n }\n },\n }\n\n return step\n}\n","import { MotionGlobalConfig } from \"motion-utils\"\nimport { stepsOrder } from \"./order\"\nimport { createRenderStep } from \"./render-step\"\nimport { Batcher, FrameData, Process, Steps } from \"./types\"\n\nconst maxElapsed = 40\n\nexport function createRenderBatcher(\n scheduleNextBatch: (callback: Function) => void,\n allowKeepAlive: boolean\n) {\n let runNextFrame = false\n let useDefaultElapsed = true\n\n const state: FrameData = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n }\n\n const flagRunNextFrame = () => (runNextFrame = true)\n\n const steps = stepsOrder.reduce((acc, key) => {\n acc[key] = createRenderStep(flagRunNextFrame)\n return acc\n }, {} as Steps)\n\n const {\n setup,\n read,\n resolveKeyframes,\n preUpdate,\n update,\n preRender,\n render,\n postRender,\n } = steps\n\n const processBatch = () => {\n const useManualTiming = MotionGlobalConfig.useManualTiming\n const timestamp = useManualTiming\n ? state.timestamp\n : performance.now()\n runNextFrame = false\n\n if (!useManualTiming) {\n state.delta = useDefaultElapsed\n ? 1000 / 60\n : Math.max(Math.min(timestamp - state.timestamp, maxElapsed), 1)\n }\n\n state.timestamp = timestamp\n state.isProcessing = true\n\n // Unrolled render loop for better per-frame performance\n setup.process(state)\n read.process(state)\n resolveKeyframes.process(state)\n preUpdate.process(state)\n update.process(state)\n preRender.process(state)\n render.process(state)\n postRender.process(state)\n\n state.isProcessing = false\n\n if (runNextFrame && allowKeepAlive) {\n useDefaultElapsed = false\n scheduleNextBatch(processBatch)\n }\n }\n\n const wake = () => {\n runNextFrame = true\n useDefaultElapsed = true\n\n if (!state.isProcessing) {\n scheduleNextBatch(processBatch)\n }\n }\n\n const schedule = stepsOrder.reduce((acc, key) => {\n const step = steps[key]\n acc[key] = (process: Process, keepAlive = false, immediate = false) => {\n if (!runNextFrame) wake()\n\n return step.schedule(process, keepAlive, immediate)\n }\n return acc\n }, {} as Batcher)\n\n const cancel = (process: Process) => {\n for (let i = 0; i < stepsOrder.length; i++) {\n steps[stepsOrder[i]].cancel(process)\n }\n }\n\n return { schedule, cancel, state, steps }\n}\n","import { noop } from \"motion-utils\"\nimport { createRenderBatcher } from \"./batcher\"\n\nexport const {\n schedule: frame,\n cancel: cancelFrame,\n state: frameData,\n steps: frameSteps,\n} = /* @__PURE__ */ createRenderBatcher(\n typeof requestAnimationFrame !== \"undefined\" ? requestAnimationFrame : noop,\n true\n)\n","import { MotionGlobalConfig } from \"motion-utils\"\nimport { frameData } from \"./frame\"\n\nlet now: number | undefined\n\nfunction clearTime() {\n now = undefined\n}\n\n/**\n * An eventloop-synchronous alternative to performance.now().\n *\n * Ensures that time measurements remain consistent within a synchronous context.\n * Usually calling performance.now() twice within the same synchronous context\n * will return different values which isn't useful for animations when we're usually\n * trying to sync animations to the same frame.\n */\nexport const time = {\n now: (): number => {\n if (now === undefined) {\n time.set(\n frameData.isProcessing || MotionGlobalConfig.useManualTiming\n ? frameData.timestamp\n : performance.now()\n )\n }\n\n return now!\n },\n set: (newTime: number) => {\n now = newTime\n queueMicrotask(clearTime)\n },\n}\n","import { AnyResolvedKeyframe } from \"../types\"\n\nexport type CSSVariableName = `--${string}`\n\nexport type CSSVariableToken = `var(${CSSVariableName})`\n\nconst checkStringStartsWith =\n (token: string) =>\n (key?: AnyResolvedKeyframe | null): key is T =>\n typeof key === \"string\" && key.startsWith(token)\n\nexport const isCSSVariableName =\n /*@__PURE__*/ checkStringStartsWith(\"--\")\n\nconst startsAsVariableToken =\n /*@__PURE__*/ checkStringStartsWith(\"var(--\")\nexport const isCSSVariableToken = (\n value?: string\n): value is CSSVariableToken => {\n const startsWithToken = startsAsVariableToken(value)\n\n if (!startsWithToken) return false\n\n // Ensure any comments are stripped from the value as this can harm performance of the regex.\n return singleCssVariableRegex.test(value.split(\"/*\")[0].trim())\n}\n\nconst singleCssVariableRegex =\n /var\\(--(?:[\\w-]+\\s*|[\\w-]+\\s*,(?:\\s*[^)(\\s]|\\s*\\((?:[^)(]|\\([^)(]*\\))*\\))+\\s*)\\)$/iu\n\n/**\n * Check if a value contains a CSS variable anywhere (e.g. inside calc()).\n * Unlike isCSSVariableToken which checks if the value IS a var() token,\n * this checks if the value CONTAINS var() somewhere in the string.\n */\nexport function containsCSSVariable(\n value?: AnyResolvedKeyframe | null\n): boolean {\n if (typeof value !== \"string\") return false\n // Strip comments to avoid false positives\n return value.split(\"/*\")[0].includes(\"var(--\")\n}\n","import { clamp } from \"motion-utils\"\n\nexport const number = {\n test: (v: number) => typeof v === \"number\",\n parse: parseFloat,\n transform: (v: number) => v,\n}\n\nexport const alpha = {\n ...number,\n transform: (v: number) => clamp(0, 1, v),\n}\n\nexport const scale = {\n ...number,\n default: 1,\n}\n","// If this number is a decimal, make it just five decimal places\n// to avoid exponents\nexport const sanitize = (v: number) => Math.round(v * 100000) / 100000\n","export const floatRegex = /-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)/gu\n","export function isNullish(v: any): v is null | undefined {\n return v == null\n}\n","export const singleColorRegex =\n /^(?:#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\))$/iu\n","import { Color, HSLA, RGBA } from \"../types\"\nimport { floatRegex } from \"../utils/float-regex\"\nimport { isNullish } from \"../utils/is-nullish\"\nimport { singleColorRegex } from \"../utils/single-color-regex\"\n\n/**\n * Returns true if the provided string is a color, ie rgba(0,0,0,0) or #000,\n * but false if a number or multiple colors\n */\nexport const isColorString = (type: string, testProp?: string) => (v: any) => {\n return Boolean(\n (typeof v === \"string\" &&\n singleColorRegex.test(v) &&\n v.startsWith(type)) ||\n (testProp &&\n !isNullish(v) &&\n Object.prototype.hasOwnProperty.call(v, testProp))\n )\n}\n\nexport const splitColor =\n (aName: string, bName: string, cName: string) =>\n (v: string | Color): V => {\n if (typeof v !== \"string\") return v as any\n\n const [a, b, c, alpha] = v.match(floatRegex) as any\n\n return {\n [aName]: parseFloat(a),\n [bName]: parseFloat(b),\n [cName]: parseFloat(c),\n alpha: alpha !== undefined ? parseFloat(alpha) : 1,\n } as V\n }\n","import { clamp } from \"motion-utils\"\nimport { alpha as alphaType, number } from \"../numbers\"\nimport { RGBA } from \"../types\"\nimport { sanitize } from \"../utils/sanitize\"\nimport { isColorString, splitColor } from \"./utils\"\n\nconst clampRgbUnit = (v: number) => clamp(0, 255, v)\nexport const rgbUnit = {\n ...number,\n transform: (v: number) => Math.round(clampRgbUnit(v)),\n}\n\nexport const rgba = {\n test: /*@__PURE__*/ isColorString(\"rgb\", \"red\"),\n parse: /*@__PURE__*/ splitColor(\"red\", \"green\", \"blue\"),\n transform: ({ red, green, blue, alpha = 1 }: RGBA) =>\n \"rgba(\" +\n rgbUnit.transform(red) +\n \", \" +\n rgbUnit.transform(green) +\n \", \" +\n rgbUnit.transform(blue) +\n \", \" +\n sanitize(alphaType.transform(alpha)) +\n \")\",\n}\n","import { RGBA } from \"../types\"\nimport { rgba } from \"./rgba\"\nimport { isColorString } from \"./utils\"\n\nfunction parseHex(v: string): RGBA {\n let r = \"\"\n let g = \"\"\n let b = \"\"\n let a = \"\"\n\n // If we have 6 characters, ie #FF0000\n if (v.length > 5) {\n r = v.substring(1, 3)\n g = v.substring(3, 5)\n b = v.substring(5, 7)\n a = v.substring(7, 9)\n\n // Or we have 3 characters, ie #F00\n } else {\n r = v.substring(1, 2)\n g = v.substring(2, 3)\n b = v.substring(3, 4)\n a = v.substring(4, 5)\n r += r\n g += g\n b += b\n a += a\n }\n\n return {\n red: parseInt(r, 16),\n green: parseInt(g, 16),\n blue: parseInt(b, 16),\n alpha: a ? parseInt(a, 16) / 255 : 1,\n }\n}\n\nexport const hex = {\n test: /*@__PURE__*/ isColorString(\"#\"),\n parse: parseHex,\n transform: rgba.transform,\n}\n","import { AnyResolvedKeyframe } from \"../../../animation/types\"\n\n/*#__NO_SIDE_EFFECTS__*/\nconst createUnitType = (unit: string) => ({\n test: (v: AnyResolvedKeyframe) =>\n typeof v === \"string\" && v.endsWith(unit) && v.split(\" \").length === 1,\n parse: parseFloat,\n transform: (v: number | string) => `${v}${unit}`,\n})\n\nexport const degrees = /*@__PURE__*/ createUnitType(\"deg\")\nexport const percent = /*@__PURE__*/ createUnitType(\"%\")\nexport const px = /*@__PURE__*/ createUnitType(\"px\")\nexport const vh = /*@__PURE__*/ createUnitType(\"vh\")\nexport const vw = /*@__PURE__*/ createUnitType(\"vw\")\n\nexport const progressPercentage = /*@__PURE__*/ (() => ({\n ...percent,\n parse: (v: string) => percent.parse(v) / 100,\n transform: (v: number) => percent.transform(v * 100),\n}))()\n","import { alpha as alphaType } from \"../numbers\"\nimport { percent } from \"../numbers/units\"\nimport { HSLA } from \"../types\"\nimport { sanitize } from \"../utils/sanitize\"\nimport { isColorString, splitColor } from \"./utils\"\n\nexport const hsla = {\n test: /*@__PURE__*/ isColorString(\"hsl\", \"hue\"),\n parse: /*@__PURE__*/ splitColor(\"hue\", \"saturation\", \"lightness\"),\n transform: ({ hue, saturation, lightness, alpha = 1 }: HSLA) => {\n return (\n \"hsla(\" +\n Math.round(hue) +\n \", \" +\n percent.transform(sanitize(saturation)) +\n \", \" +\n percent.transform(sanitize(lightness)) +\n \", \" +\n sanitize(alphaType.transform(alpha)) +\n \")\"\n )\n },\n}\n","import { HSLA, RGBA } from \"../types\"\nimport { hex } from \"./hex\"\nimport { hsla } from \"./hsla\"\nimport { rgba } from \"./rgba\"\n\nexport const color = {\n test: (v: any) => rgba.test(v) || hex.test(v) || hsla.test(v),\n parse: (v: any): RGBA | HSLA => {\n if (rgba.test(v)) {\n return rgba.parse(v)\n } else if (hsla.test(v)) {\n return hsla.parse(v)\n } else {\n return hex.parse(v)\n }\n },\n transform: (v: HSLA | RGBA | string) => {\n return typeof v === \"string\"\n ? v\n : v.hasOwnProperty(\"red\")\n ? rgba.transform(v as RGBA)\n : hsla.transform(v as HSLA)\n },\n getAnimatableNone: (v: string) => {\n const parsed = color.parse(v)\n parsed.alpha = 0\n return color.transform(parsed)\n },\n}\n","export const colorRegex =\n /(?:#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\))/giu\n","import { AnyResolvedKeyframe } from \"../../../animation/types\"\nimport { CSSVariableToken } from \"../../../animation/utils/is-css-variable\"\nimport { color } from \"../color\"\nimport { Color } from \"../types\"\nimport { colorRegex } from \"../utils/color-regex\"\nimport { floatRegex } from \"../utils/float-regex\"\nimport { sanitize } from \"../utils/sanitize\"\n\nfunction test(v: any) {\n return (\n isNaN(v) &&\n typeof v === \"string\" &&\n (v.match(floatRegex)?.length || 0) +\n (v.match(colorRegex)?.length || 0) >\n 0\n )\n}\n\nconst NUMBER_TOKEN = \"number\"\nconst COLOR_TOKEN = \"color\"\nconst VAR_TOKEN = \"var\"\nconst VAR_FUNCTION_TOKEN = \"var(\"\nconst SPLIT_TOKEN = \"${}\"\n\nexport type ComplexValues = Array<\n CSSVariableToken | AnyResolvedKeyframe | Color\n>\n\nexport interface ValueIndexes {\n color: number[]\n number: number[]\n var: number[]\n}\n\nexport interface ComplexValueInfo {\n values: ComplexValues\n split: string[]\n indexes: ValueIndexes\n types: Array\n}\n\n// this regex consists of the `singleCssVariableRegex|rgbHSLValueRegex|digitRegex`\nconst complexRegex =\n /var\\s*\\(\\s*--(?:[\\w-]+\\s*|[\\w-]+\\s*,(?:\\s*[^)(\\s]|\\s*\\((?:[^)(]|\\([^)(]*\\))*\\))+\\s*)\\)|#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\)|-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)/giu\n\nexport function analyseComplexValue(\n value: AnyResolvedKeyframe\n): ComplexValueInfo {\n const originalValue = value.toString()\n\n const values: ComplexValues = []\n const indexes: ValueIndexes = {\n color: [],\n number: [],\n var: [],\n }\n const types: Array = []\n\n let i = 0\n const tokenised = originalValue.replace(complexRegex, (parsedValue) => {\n if (color.test(parsedValue)) {\n indexes.color.push(i)\n types.push(COLOR_TOKEN)\n values.push(color.parse(parsedValue))\n } else if (parsedValue.startsWith(VAR_FUNCTION_TOKEN)) {\n indexes.var.push(i)\n types.push(VAR_TOKEN)\n values.push(parsedValue)\n } else {\n indexes.number.push(i)\n types.push(NUMBER_TOKEN)\n values.push(parseFloat(parsedValue))\n }\n ++i\n return SPLIT_TOKEN\n })\n const split = tokenised.split(SPLIT_TOKEN)\n\n return { values, split, indexes, types }\n}\n\nfunction parseComplexValue(v: AnyResolvedKeyframe) {\n return analyseComplexValue(v).values\n}\n\nfunction buildTransformer({ split, types }: ComplexValueInfo) {\n const numSections = split.length\n return (v: Array) => {\n let output = \"\"\n for (let i = 0; i < numSections; i++) {\n output += split[i]\n if (v[i] !== undefined) {\n const type = types[i]\n if (type === NUMBER_TOKEN) {\n output += sanitize(v[i] as number)\n } else if (type === COLOR_TOKEN) {\n output += color.transform(v[i] as Color)\n } else {\n output += v[i]\n }\n }\n }\n\n return output\n }\n}\n\nfunction createTransformer(source: AnyResolvedKeyframe) {\n return buildTransformer(analyseComplexValue(source))\n}\n\nconst convertNumbersToZero = (v: number | string) =>\n typeof v === \"number\" ? 0 : color.test(v) ? color.getAnimatableNone(v) : v\n\n/**\n * Convert a parsed value to its zero equivalent, but preserve numbers\n * that act as divisors in CSS calc() expressions.\n *\n * analyseComplexValue extracts numbers from CSS strings and puts the\n * surrounding text into a `split` template array. For example:\n * \"calc(var(--gap) / 5)\" → values: [var(--gap), 5]\n * split: [\"calc(\", \" / \", \")\"]\n *\n * When building a zero-equivalent for animation, naively zeroing all\n * numbers turns the divisor into 0 → \"calc(var(--gap) / 0)\" → NaN.\n * We detect this by checking whether the text preceding a number\n * (split[i]) ends with \"/\" — the CSS calc division operator.\n */\nconst convertToZero = (\n value: ComplexValues[number],\n splitBefore: string\n): ComplexValues[number] => {\n if (typeof value === \"number\") {\n return splitBefore?.trim().endsWith(\"/\") ? value : 0\n }\n return convertNumbersToZero(value as string)\n}\n\nfunction getAnimatableNone(v: AnyResolvedKeyframe) {\n const info = analyseComplexValue(v)\n const transformer = buildTransformer(info)\n return transformer(\n info.values.map((value, i) => convertToZero(value, info.split[i]))\n )\n}\n\nexport const complex = {\n test,\n parse: parseComplexValue,\n createTransformer,\n getAnimatableNone,\n}\n","import { HSLA, RGBA } from \"../types\"\n\n// Adapted from https://gist.github.com/mjackson/5311256\nfunction hueToRgb(p: number, q: number, t: number) {\n if (t < 0) t += 1\n if (t > 1) t -= 1\n if (t < 1 / 6) return p + (q - p) * 6 * t\n if (t < 1 / 2) return q\n if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6\n return p\n}\n\nexport function hslaToRgba({ hue, saturation, lightness, alpha }: HSLA): RGBA {\n hue /= 360\n saturation /= 100\n lightness /= 100\n\n let red = 0\n let green = 0\n let blue = 0\n\n if (!saturation) {\n red = green = blue = lightness\n } else {\n const q =\n lightness < 0.5\n ? lightness * (1 + saturation)\n : lightness + saturation - lightness * saturation\n const p = 2 * lightness - q\n\n red = hueToRgb(p, q, hue + 1 / 3)\n green = hueToRgb(p, q, hue)\n blue = hueToRgb(p, q, hue - 1 / 3)\n }\n\n return {\n red: Math.round(red * 255),\n green: Math.round(green * 255),\n blue: Math.round(blue * 255),\n alpha,\n }\n}\n","export function mixImmediate(a: T, b: T) {\n return (p: number) => (p > 0 ? b : a)\n}\n","/*\n Value in range from progress\n\n Given a lower limit and an upper limit, we return the value within\n that range as expressed by progress (usually a number from 0 to 1)\n\n So progress = 0.5 would change\n\n from -------- to\n\n to\n\n from ---- to\n\n E.g. from = 10, to = 20, progress = 0.5 => 15\n\n @param [number]: Lower limit of range\n @param [number]: Upper limit of range\n @param [number]: The progress between lower and upper limits expressed 0-1\n @return [number]: Value as calculated from progress within range (not limited within range)\n*/\nexport const mixNumber = (from: number, to: number, progress: number) => {\n return from + (to - from) * progress\n}\n","import { warning } from \"motion-utils\"\nimport { hex } from \"../../value/types/color/hex\"\nimport { hsla } from \"../../value/types/color/hsla\"\nimport { hslaToRgba } from \"../../value/types/color/hsla-to-rgba\"\nimport { rgba } from \"../../value/types/color/rgba\"\nimport { Color, HSLA, RGBA } from \"../../value/types/types\"\nimport { mixImmediate } from \"./immediate\"\nimport { mixNumber } from \"./number\"\n\n// Linear color space blending\n// Explained https://www.youtube.com/watch?v=LKnqECcg6Gw\n// Demonstrated http://codepen.io/osublake/pen/xGVVaN\nexport const mixLinearColor = (from: number, to: number, v: number) => {\n const fromExpo = from * from\n const expo = v * (to * to - fromExpo) + fromExpo\n return expo < 0 ? 0 : Math.sqrt(expo)\n}\n\nconst colorTypes = [hex, rgba, hsla]\nconst getColorType = (v: Color | string) =>\n colorTypes.find((type) => type.test(v))\n\nfunction asRGBA(color: Color | string) {\n const type = getColorType(color)\n\n warning(\n Boolean(type),\n `'${color}' is not an animatable color. Use the equivalent color code instead.`,\n \"color-not-animatable\"\n )\n\n if (!Boolean(type)) return false\n\n let model = type!.parse(color)\n\n if (type === hsla) {\n // TODO Remove this cast - needed since Motion's stricter typing\n model = hslaToRgba(model as HSLA)\n }\n\n return model as RGBA\n}\n\nexport const mixColor = (from: Color | string, to: Color | string) => {\n const fromRGBA = asRGBA(from)\n const toRGBA = asRGBA(to)\n\n if (!fromRGBA || !toRGBA) {\n return mixImmediate(from, to)\n }\n\n const blended = { ...fromRGBA }\n\n return (v: number) => {\n blended.red = mixLinearColor(fromRGBA.red, toRGBA.red, v)\n blended.green = mixLinearColor(fromRGBA.green, toRGBA.green, v)\n blended.blue = mixLinearColor(fromRGBA.blue, toRGBA.blue, v)\n blended.alpha = mixNumber(fromRGBA.alpha, toRGBA.alpha, v)\n return rgba.transform!(blended)\n }\n}\n","export const invisibleValues = new Set([\"none\", \"hidden\"])\n\n/**\n * Returns a function that, when provided a progress value between 0 and 1,\n * will return the \"none\" or \"hidden\" string only when the progress is that of\n * the origin or target.\n */\nexport function mixVisibility(origin: string, target: string) {\n if (invisibleValues.has(origin)) {\n return (p: number) => (p <= 0 ? origin : target)\n } else {\n return (p: number) => (p >= 1 ? target : origin)\n }\n}\n","import { pipe, warning } from \"motion-utils\"\nimport { AnyResolvedKeyframe } from \"../../animation/types\"\nimport { isCSSVariableToken } from \"../../animation/utils/is-css-variable\"\nimport { color } from \"../../value/types/color\"\nimport {\n analyseComplexValue,\n complex,\n ComplexValueInfo,\n ComplexValues,\n} from \"../../value/types/complex\"\nimport { HSLA, RGBA } from \"../../value/types/types\"\nimport { mixColor } from \"./color\"\nimport { mixImmediate } from \"./immediate\"\nimport { mixNumber as mixNumberImmediate } from \"./number\"\nimport { invisibleValues, mixVisibility } from \"./visibility\"\n\ntype MixableArray = Array\ninterface MixableObject {\n [key: string]: AnyResolvedKeyframe | RGBA | HSLA\n}\n\nfunction mixNumber(a: number, b: number) {\n return (p: number) => mixNumberImmediate(a, b, p)\n}\n\nexport function getMixer(a: T) {\n if (typeof a === \"number\") {\n return mixNumber\n } else if (typeof a === \"string\") {\n return isCSSVariableToken(a)\n ? mixImmediate\n : color.test(a)\n ? mixColor\n : mixComplex\n } else if (Array.isArray(a)) {\n return mixArray\n } else if (typeof a === \"object\") {\n return color.test(a) ? mixColor : mixObject\n }\n\n return mixImmediate\n}\n\nexport function mixArray(a: MixableArray, b: MixableArray) {\n const output = [...a]\n const numValues = output.length\n\n const blendValue = a.map((v, i) => getMixer(v)(v as any, b[i] as any))\n\n return (p: number) => {\n for (let i = 0; i < numValues; i++) {\n output[i] = blendValue[i](p) as any\n }\n return output\n }\n}\n\nexport function mixObject(a: MixableObject, b: MixableObject) {\n const output = { ...a, ...b }\n const blendValue: { [key: string]: (v: number) => any } = {}\n\n for (const key in output) {\n if (a[key] !== undefined && b[key] !== undefined) {\n blendValue[key] = getMixer(a[key])(\n a[key] as any,\n b[key] as any\n ) as any\n }\n }\n\n return (v: number) => {\n for (const key in blendValue) {\n output[key] = blendValue[key](v)\n }\n return output\n }\n}\n\nfunction matchOrder(\n origin: ComplexValueInfo,\n target: ComplexValueInfo\n): ComplexValues {\n const orderedOrigin: ComplexValues = []\n\n const pointers = { color: 0, var: 0, number: 0 }\n\n for (let i = 0; i < target.values.length; i++) {\n const type = target.types[i]\n const originIndex = origin.indexes[type][pointers[type]]\n const originValue = origin.values[originIndex] ?? 0\n\n orderedOrigin[i] = originValue\n\n pointers[type]++\n }\n\n return orderedOrigin\n}\n\nexport const mixComplex = (\n origin: AnyResolvedKeyframe,\n target: AnyResolvedKeyframe\n) => {\n const template = complex.createTransformer(target)\n const originStats = analyseComplexValue(origin)\n const targetStats = analyseComplexValue(target)\n const canInterpolate =\n originStats.indexes.var.length === targetStats.indexes.var.length &&\n originStats.indexes.color.length === targetStats.indexes.color.length &&\n originStats.indexes.number.length >= targetStats.indexes.number.length\n\n if (canInterpolate) {\n if (\n (invisibleValues.has(origin as string) &&\n !targetStats.values.length) ||\n (invisibleValues.has(target as string) &&\n !originStats.values.length)\n ) {\n return mixVisibility(origin as string, target as string)\n }\n\n return pipe(\n mixArray(matchOrder(originStats, targetStats), targetStats.values),\n template\n )\n } else {\n warning(\n true,\n `Complex values '${origin}' and '${target}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,\n \"complex-values-different\"\n )\n\n return mixImmediate(origin, target)\n }\n}\n","import { getMixer } from \"./complex\"\nimport { mixNumber as mixNumberImmediate } from \"./number\"\nimport { Mixer } from \"./types\"\n\nexport function mix(from: T, to: T): Mixer\nexport function mix(from: number, to: number, p: number): number\nexport function mix(from: T, to: T, p?: T): Mixer | number {\n if (\n typeof from === \"number\" &&\n typeof to === \"number\" &&\n typeof p === \"number\"\n ) {\n return mixNumberImmediate(from, to, p)\n }\n\n const mixer = getMixer(from)\n return mixer(from as any, to as any) as Mixer\n}\n","import { cancelFrame, frame, frameData } from \"../../frameloop\"\nimport { time } from \"../../frameloop/sync-time\"\nimport { FrameData } from \"../../frameloop/types\"\nimport { Driver } from \"./types\"\n\nexport const frameloopDriver: Driver = (update) => {\n const passTimestamp = ({ timestamp }: FrameData) => update(timestamp)\n\n return {\n start: (keepAlive = true) => frame.update(passTimestamp, keepAlive),\n stop: () => cancelFrame(passTimestamp),\n /**\n * If we're processing this frame we can use the\n * framelocked timestamp to keep things in sync.\n */\n now: () => (frameData.isProcessing ? frameData.timestamp : time.now()),\n }\n}\n","import { EasingFunction } from \"motion-utils\"\n\nexport const generateLinearEasing = (\n easing: EasingFunction,\n duration: number, // as milliseconds\n resolution: number = 10 // as milliseconds\n): string => {\n let points = \"\"\n const numPoints = Math.max(Math.round(duration / resolution), 2)\n\n for (let i = 0; i < numPoints; i++) {\n points += Math.round(easing(i / (numPoints - 1)) * 10000) / 10000 + \", \"\n }\n\n return `linear(${points.substring(0, points.length - 2)})`\n}\n","import { KeyframeGenerator } from \"../../types\"\n\n/**\n * Implement a practical max duration for keyframe generation\n * to prevent infinite loops\n */\nexport const maxGeneratorDuration = 20_000\nexport function calcGeneratorDuration(\n generator: KeyframeGenerator\n): number {\n let duration = 0\n const timeStep = 50\n let state = generator.next(duration)\n while (!state.done && duration < maxGeneratorDuration) {\n duration += timeStep\n state = generator.next(duration)\n }\n\n return duration >= maxGeneratorDuration ? Infinity : duration\n}\n","import { millisecondsToSeconds } from \"motion-utils\"\nimport { GeneratorFactory, Transition } from \"../../types\"\nimport { calcGeneratorDuration, maxGeneratorDuration } from \"./calc-duration\"\n\n/**\n * Create a progress => progress easing function from a generator.\n */\nexport function createGeneratorEasing(\n options: Transition,\n scale = 100,\n createGenerator: GeneratorFactory\n) {\n const generator = createGenerator({ ...options, keyframes: [0, scale] })\n const duration = Math.min(\n calcGeneratorDuration(generator),\n maxGeneratorDuration\n )\n\n return {\n type: \"keyframes\",\n ease: (progress: number) => {\n return generator.next(duration * progress).value / scale\n },\n duration: millisecondsToSeconds(duration),\n }\n}\n","import {\n clamp,\n millisecondsToSeconds,\n secondsToMilliseconds,\n warning,\n} from \"motion-utils\"\nimport {\n AnimationState,\n KeyframeGenerator,\n SpringOptions,\n Transition,\n ValueAnimationOptions,\n} from \"../types\"\nimport { generateLinearEasing } from \"../waapi/utils/linear\"\nimport {\n calcGeneratorDuration,\n maxGeneratorDuration,\n} from \"./utils/calc-duration\"\nimport { createGeneratorEasing } from \"./utils/create-generator-easing\"\n\nconst springDefaults = {\n // Default spring physics\n stiffness: 100,\n damping: 10,\n mass: 1.0,\n velocity: 0.0,\n\n // Default duration/bounce-based options\n duration: 800, // in ms\n bounce: 0.3,\n visualDuration: 0.3, // in seconds\n\n // Rest thresholds\n restSpeed: {\n granular: 0.01,\n default: 2,\n },\n restDelta: {\n granular: 0.005,\n default: 0.5,\n },\n\n // Limits\n minDuration: 0.01, // in seconds\n maxDuration: 10.0, // in seconds\n minDamping: 0.05,\n maxDamping: 1,\n}\n\nfunction calcAngularFreq(undampedFreq: number, dampingRatio: number) {\n return undampedFreq * Math.sqrt(1 - dampingRatio * dampingRatio)\n}\n\nconst rootIterations = 12\nfunction approximateRoot(\n envelope: (num: number) => number,\n derivative: (num: number) => number,\n initialGuess: number\n): number {\n let result = initialGuess\n for (let i = 1; i < rootIterations; i++) {\n result = result - envelope(result) / derivative(result)\n }\n return result\n}\n\n/**\n * This is ported from the Framer implementation of duration-based spring resolution.\n */\nconst safeMin = 0.001\n\nfunction findSpring({\n duration = springDefaults.duration,\n bounce = springDefaults.bounce,\n velocity = springDefaults.velocity,\n mass = springDefaults.mass,\n}: SpringOptions) {\n let envelope: (num: number) => number\n let derivative: (num: number) => number\n\n warning(\n duration <= secondsToMilliseconds(springDefaults.maxDuration),\n \"Spring duration must be 10 seconds or less\",\n \"spring-duration-limit\"\n )\n\n let dampingRatio = 1 - bounce\n\n /**\n * Restrict dampingRatio and duration to within acceptable ranges.\n */\n dampingRatio = clamp(\n springDefaults.minDamping,\n springDefaults.maxDamping,\n dampingRatio\n )\n duration = clamp(\n springDefaults.minDuration,\n springDefaults.maxDuration,\n millisecondsToSeconds(duration)\n )\n\n if (dampingRatio < 1) {\n /**\n * Underdamped spring\n */\n envelope = (undampedFreq) => {\n const exponentialDecay = undampedFreq * dampingRatio\n const delta = exponentialDecay * duration\n const a = exponentialDecay - velocity\n const b = calcAngularFreq(undampedFreq, dampingRatio)\n const c = Math.exp(-delta)\n return safeMin - (a / b) * c\n }\n\n derivative = (undampedFreq) => {\n const exponentialDecay = undampedFreq * dampingRatio\n const delta = exponentialDecay * duration\n const d = delta * velocity + velocity\n const e =\n Math.pow(dampingRatio, 2) * Math.pow(undampedFreq, 2) * duration\n const f = Math.exp(-delta)\n const g = calcAngularFreq(Math.pow(undampedFreq, 2), dampingRatio)\n const factor = -envelope(undampedFreq) + safeMin > 0 ? -1 : 1\n return (factor * ((d - e) * f)) / g\n }\n } else {\n /**\n * Critically-damped spring\n */\n envelope = (undampedFreq) => {\n const a = Math.exp(-undampedFreq * duration)\n const b = (undampedFreq - velocity) * duration + 1\n return -safeMin + a * b\n }\n\n derivative = (undampedFreq) => {\n const a = Math.exp(-undampedFreq * duration)\n const b = (velocity - undampedFreq) * (duration * duration)\n return a * b\n }\n }\n\n const initialGuess = 5 / duration\n const undampedFreq = approximateRoot(envelope, derivative, initialGuess)\n\n duration = secondsToMilliseconds(duration)\n if (isNaN(undampedFreq)) {\n return {\n stiffness: springDefaults.stiffness,\n damping: springDefaults.damping,\n duration,\n }\n } else {\n const stiffness = Math.pow(undampedFreq, 2) * mass\n return {\n stiffness,\n damping: dampingRatio * 2 * Math.sqrt(mass * stiffness),\n duration,\n }\n }\n}\n\nconst durationKeys = [\"duration\", \"bounce\"]\nconst physicsKeys = [\"stiffness\", \"damping\", \"mass\"]\n\nfunction isSpringType(options: SpringOptions, keys: string[]) {\n return keys.some((key) => (options as any)[key] !== undefined)\n}\n\nfunction getSpringOptions(options: SpringOptions) {\n let springOptions = {\n velocity: springDefaults.velocity,\n stiffness: springDefaults.stiffness,\n damping: springDefaults.damping,\n mass: springDefaults.mass,\n isResolvedFromDuration: false,\n ...options,\n }\n // stiffness/damping/mass overrides duration/bounce\n if (\n !isSpringType(options, physicsKeys) &&\n isSpringType(options, durationKeys)\n ) {\n // Time-defined springs should ignore inherited velocity.\n // Velocity from interrupted animations can cause findSpring()\n // to compute wildly different spring parameters, leading to\n // massive oscillation on small-range animations.\n springOptions.velocity = 0\n\n if (options.visualDuration) {\n const visualDuration = options.visualDuration\n const root = (2 * Math.PI) / (visualDuration * 1.2)\n const stiffness = root * root\n const damping =\n 2 *\n clamp(0.05, 1, 1 - (options.bounce || 0)) *\n Math.sqrt(stiffness)\n\n springOptions = {\n ...springOptions,\n mass: springDefaults.mass,\n stiffness,\n damping,\n }\n } else {\n const derived = findSpring({ ...options, velocity: 0 })\n\n springOptions = {\n ...springOptions,\n ...derived,\n mass: springDefaults.mass,\n }\n springOptions.isResolvedFromDuration = true\n }\n }\n\n return springOptions\n}\n\nfunction spring(\n optionsOrVisualDuration:\n | ValueAnimationOptions\n | number = springDefaults.visualDuration,\n bounce = springDefaults.bounce\n): KeyframeGenerator {\n const options =\n typeof optionsOrVisualDuration !== \"object\"\n ? ({\n visualDuration: optionsOrVisualDuration,\n keyframes: [0, 1],\n bounce,\n } as ValueAnimationOptions)\n : optionsOrVisualDuration\n\n let { restSpeed, restDelta } = options\n\n const origin = options.keyframes[0]\n const target = options.keyframes[options.keyframes.length - 1]\n\n /**\n * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator\n * to reduce GC during animation.\n */\n const state: AnimationState = { done: false, value: origin }\n\n const {\n stiffness,\n damping,\n mass,\n duration,\n velocity,\n isResolvedFromDuration,\n } = getSpringOptions({\n ...options,\n velocity: -millisecondsToSeconds(options.velocity || 0),\n })\n\n const initialVelocity = velocity || 0.0\n const dampingRatio = damping / (2 * Math.sqrt(stiffness * mass))\n\n const initialDelta = target - origin\n const undampedAngularFreq = millisecondsToSeconds(\n Math.sqrt(stiffness / mass)\n )\n\n /**\n * If we're working on a granular scale, use smaller defaults for determining\n * when the spring is finished.\n *\n * These defaults have been selected emprically based on what strikes a good\n * ratio between feeling good and finishing as soon as changes are imperceptible.\n */\n const isGranularScale = Math.abs(initialDelta) < 5\n restSpeed ||= isGranularScale\n ? springDefaults.restSpeed.granular\n : springDefaults.restSpeed.default\n restDelta ||= isGranularScale\n ? springDefaults.restDelta.granular\n : springDefaults.restDelta.default\n\n let resolveSpring: (v: number) => number\n let resolveVelocity: (t: number) => number\n\n // Underdamped coefficients, hoisted for use in the inlined next() hot path\n let angularFreq: number\n let A: number\n let sinCoeff: number\n let cosCoeff: number\n\n if (dampingRatio < 1) {\n angularFreq = calcAngularFreq(undampedAngularFreq, dampingRatio)\n\n A =\n (initialVelocity +\n dampingRatio * undampedAngularFreq * initialDelta) /\n angularFreq\n\n // Underdamped spring\n resolveSpring = (t: number) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t)\n\n return (\n target -\n envelope *\n (A * Math.sin(angularFreq * t) +\n initialDelta * Math.cos(angularFreq * t))\n )\n }\n\n // Analytical derivative of underdamped spring (px/ms)\n sinCoeff =\n dampingRatio * undampedAngularFreq * A + initialDelta * angularFreq\n cosCoeff =\n dampingRatio * undampedAngularFreq * initialDelta - A * angularFreq\n resolveVelocity = (t: number) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t)\n return envelope *\n (sinCoeff * Math.sin(angularFreq * t) +\n cosCoeff * Math.cos(angularFreq * t))\n }\n } else if (dampingRatio === 1) {\n // Critically damped spring\n resolveSpring = (t: number) =>\n target -\n Math.exp(-undampedAngularFreq * t) *\n (initialDelta +\n (initialVelocity + undampedAngularFreq * initialDelta) * t)\n\n // Analytical derivative of critically damped spring (px/ms)\n const C = initialVelocity + undampedAngularFreq * initialDelta\n resolveVelocity = (t: number) =>\n Math.exp(-undampedAngularFreq * t) *\n (undampedAngularFreq * C * t - initialVelocity)\n } else {\n // Overdamped spring\n const dampedAngularFreq =\n undampedAngularFreq * Math.sqrt(dampingRatio * dampingRatio - 1)\n\n resolveSpring = (t: number) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t)\n\n // When performing sinh or cosh values can hit Infinity so we cap them here\n const freqForT = Math.min(dampedAngularFreq * t, 300)\n\n return (\n target -\n (envelope *\n ((initialVelocity +\n dampingRatio * undampedAngularFreq * initialDelta) *\n Math.sinh(freqForT) +\n dampedAngularFreq *\n initialDelta *\n Math.cosh(freqForT))) /\n dampedAngularFreq\n )\n }\n\n // Analytical derivative of overdamped spring (px/ms)\n const P =\n (initialVelocity +\n dampingRatio * undampedAngularFreq * initialDelta) /\n dampedAngularFreq\n const sinhCoeff =\n dampingRatio * undampedAngularFreq * P - initialDelta * dampedAngularFreq\n const coshCoeff =\n dampingRatio * undampedAngularFreq * initialDelta - P * dampedAngularFreq\n resolveVelocity = (t: number) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t)\n const freqForT = Math.min(dampedAngularFreq * t, 300)\n return envelope *\n (sinhCoeff * Math.sinh(freqForT) +\n coshCoeff * Math.cosh(freqForT))\n }\n }\n\n const generator = {\n calculatedDuration: isResolvedFromDuration ? duration || null : null,\n velocity: (t: number) => secondsToMilliseconds(resolveVelocity(t)),\n next: (t: number) => {\n /**\n * For underdamped physics springs we need both position and\n * velocity each tick. Compute shared trig values once to avoid\n * duplicate Math.exp/sin/cos calls on the hot path.\n */\n if (!isResolvedFromDuration && dampingRatio < 1) {\n const envelope = Math.exp(\n -dampingRatio * undampedAngularFreq * t\n )\n const sin = Math.sin(angularFreq * t)\n const cos = Math.cos(angularFreq * t)\n\n const current =\n target -\n envelope *\n (A * sin + initialDelta * cos)\n const currentVelocity = secondsToMilliseconds(\n envelope *\n (sinCoeff * sin + cosCoeff * cos)\n )\n\n state.done =\n Math.abs(currentVelocity) <= restSpeed! &&\n Math.abs(target - current) <= restDelta!\n state.value = state.done ? target : current\n\n return state\n }\n\n const current = resolveSpring(t)\n\n if (!isResolvedFromDuration) {\n const currentVelocity = secondsToMilliseconds(\n resolveVelocity(t)\n )\n state.done =\n Math.abs(currentVelocity) <= restSpeed! &&\n Math.abs(target - current) <= restDelta!\n } else {\n state.done = t >= duration!\n }\n\n state.value = state.done ? target : current\n\n return state\n },\n toString: () => {\n const calculatedDuration = Math.min(\n calcGeneratorDuration(generator),\n maxGeneratorDuration\n )\n\n const easing = generateLinearEasing(\n (progress: number) =>\n generator.next(calculatedDuration * progress).value,\n calculatedDuration,\n 30\n )\n\n return calculatedDuration + \"ms \" + easing\n },\n toTransition: () => {},\n }\n\n return generator\n}\n\nspring.applyToOptions = (options: Transition) => {\n const generatorOptions = createGeneratorEasing(options as any, 100, spring)\n\n options.ease = generatorOptions.ease\n options.duration = secondsToMilliseconds(generatorOptions.duration)\n options.type = \"keyframes\"\n return options\n}\n\nexport { spring }\n","import { velocityPerSecond } from \"motion-utils\"\n\nconst velocitySampleDuration = 5 // ms\n\nexport function getGeneratorVelocity(\n resolveValue: (v: number) => number,\n t: number,\n current: number\n) {\n const prevT = Math.max(t - velocitySampleDuration, 0)\n return velocityPerSecond(current - resolveValue(prevT), t - prevT)\n}\n","import {\n AnimationState,\n KeyframeGenerator,\n ValueAnimationOptions,\n} from \"../types\"\nimport { spring as createSpring } from \"./spring\"\nimport { getGeneratorVelocity } from \"./utils/velocity\"\n\nexport function inertia({\n keyframes,\n velocity = 0.0,\n power = 0.8,\n timeConstant = 325,\n bounceDamping = 10,\n bounceStiffness = 500,\n modifyTarget,\n min,\n max,\n restDelta = 0.5,\n restSpeed,\n}: ValueAnimationOptions): KeyframeGenerator {\n const origin = keyframes[0]\n\n const state: AnimationState = {\n done: false,\n value: origin,\n }\n\n const isOutOfBounds = (v: number) =>\n (min !== undefined && v < min) || (max !== undefined && v > max)\n\n const nearestBoundary = (v: number) => {\n if (min === undefined) return max\n if (max === undefined) return min\n\n return Math.abs(min - v) < Math.abs(max - v) ? min : max\n }\n\n let amplitude = power * velocity\n const ideal = origin + amplitude\n const target = modifyTarget === undefined ? ideal : modifyTarget(ideal)\n\n /**\n * If the target has changed we need to re-calculate the amplitude, otherwise\n * the animation will start from the wrong position.\n */\n if (target !== ideal) amplitude = target - origin\n\n const calcDelta = (t: number) => -amplitude * Math.exp(-t / timeConstant)\n\n const calcLatest = (t: number) => target + calcDelta(t)\n\n const applyFriction = (t: number) => {\n const delta = calcDelta(t)\n const latest = calcLatest(t)\n state.done = Math.abs(delta) <= restDelta\n state.value = state.done ? target : latest\n }\n\n /**\n * Ideally this would resolve for t in a stateless way, we could\n * do that by always precalculating the animation but as we know\n * this will be done anyway we can assume that spring will\n * be discovered during that.\n */\n let timeReachedBoundary: number | undefined\n let spring: KeyframeGenerator | undefined\n\n const checkCatchBoundary = (t: number) => {\n if (!isOutOfBounds(state.value)) return\n\n timeReachedBoundary = t\n\n spring = createSpring({\n keyframes: [state.value, nearestBoundary(state.value)!],\n velocity: getGeneratorVelocity(calcLatest, t, state.value), // TODO: This should be passing * 1000\n damping: bounceDamping,\n stiffness: bounceStiffness,\n restDelta,\n restSpeed,\n })\n }\n\n checkCatchBoundary(0)\n\n return {\n calculatedDuration: null,\n next: (t: number) => {\n /**\n * We need to resolve the friction to figure out if we need a\n * spring but we don't want to do this twice per frame. So here\n * we flag if we updated for this frame and later if we did\n * we can skip doing it again.\n */\n let hasUpdatedFrame = false\n if (!spring && timeReachedBoundary === undefined) {\n hasUpdatedFrame = true\n applyFriction(t)\n checkCatchBoundary(t)\n }\n\n /**\n * If we have a spring and the provided t is beyond the moment the friction\n * animation crossed the min/max boundary, use the spring.\n */\n if (timeReachedBoundary !== undefined && t >= timeReachedBoundary) {\n return spring!.next(t - timeReachedBoundary)\n } else {\n !hasUpdatedFrame && applyFriction(t)\n return state\n }\n },\n }\n}\n","import {\n clamp,\n EasingFunction,\n invariant,\n MotionGlobalConfig,\n noop,\n pipe,\n progress,\n} from \"motion-utils\"\nimport { mix } from \"./mix\"\nimport { Mixer, MixerFactory } from \"./mix/types\"\n\nexport interface InterpolateOptions {\n clamp?: boolean\n ease?: EasingFunction | EasingFunction[]\n mixer?: MixerFactory\n}\n\nfunction createMixers(\n output: T[],\n ease?: EasingFunction | EasingFunction[],\n customMixer?: MixerFactory\n) {\n const mixers: Array> = []\n const mixerFactory: MixerFactory =\n customMixer || MotionGlobalConfig.mix || mix\n const numMixers = output.length - 1\n\n for (let i = 0; i < numMixers; i++) {\n let mixer = mixerFactory(output[i], output[i + 1])\n\n if (ease) {\n const easingFunction = Array.isArray(ease) ? ease[i] || noop : ease\n mixer = pipe(easingFunction, mixer) as Mixer\n }\n\n mixers.push(mixer)\n }\n\n return mixers\n}\n\n/**\n * Create a function that maps from a numerical input array to a generic output array.\n *\n * Accepts:\n * - Numbers\n * - Colors (hex, hsl, hsla, rgb, rgba)\n * - Complex (combinations of one or more numbers or strings)\n *\n * ```jsx\n * const mixColor = interpolate([0, 1], ['#fff', '#000'])\n *\n * mixColor(0.5) // 'rgba(128, 128, 128, 1)'\n * ```\n *\n * TODO Revisit this approach once we've moved to data models for values,\n * probably not needed to pregenerate mixer functions.\n *\n * @public\n */\nexport function interpolate(\n input: number[],\n output: T[],\n { clamp: isClamp = true, ease, mixer }: InterpolateOptions = {}\n): (v: number) => T {\n const inputLength = input.length\n\n invariant(\n inputLength === output.length,\n \"Both input and output ranges must be the same length\",\n \"range-length\"\n )\n\n /**\n * If we're only provided a single input, we can just make a function\n * that returns the output.\n */\n if (inputLength === 1) return () => output[0]\n if (inputLength === 2 && output[0] === output[1]) return () => output[1]\n\n const isZeroDeltaRange = input[0] === input[1]\n\n // If input runs highest -> lowest, reverse both arrays\n if (input[0] > input[inputLength - 1]) {\n input = [...input].reverse()\n output = [...output].reverse()\n }\n\n const mixers = createMixers(output, ease, mixer)\n const numMixers = mixers.length\n\n const interpolator = (v: number): T => {\n if (isZeroDeltaRange && v < input[0]) return output[0]\n\n let i = 0\n\n if (numMixers > 1) {\n for (; i < input.length - 2; i++) {\n if (v < input[i + 1]) break\n }\n }\n\n const progressInRange = progress(input[i], input[i + 1], v)\n\n return mixers[i](progressInRange)\n }\n\n return isClamp\n ? (v: number) =>\n interpolator(clamp(input[0], input[inputLength - 1], v))\n : interpolator\n}\n","import { progress } from \"motion-utils\"\nimport { mixNumber } from \"../../../utils/mix/number\"\n\nexport function fillOffset(offset: number[], remaining: number): void {\n const min = offset[offset.length - 1]\n for (let i = 1; i <= remaining; i++) {\n const offsetProgress = progress(0, remaining, i)\n offset.push(mixNumber(min, 1, offsetProgress))\n }\n}\n","import { fillOffset } from \"./fill\"\n\nexport function defaultOffset(arr: any[]): number[] {\n const offset = [0]\n fillOffset(offset, arr.length - 1)\n return offset\n}\n","export function convertOffsetToTimes(offset: number[], duration: number) {\n return offset.map((o) => o * duration)\n}\n","import {\n easeInOut,\n easingDefinitionToFunction,\n EasingFunction,\n isEasingArray,\n} from \"motion-utils\"\nimport { interpolate } from \"../../utils/interpolate\"\nimport { defaultOffset } from \"../keyframes/offsets/default\"\nimport { convertOffsetToTimes } from \"../keyframes/offsets/time\"\nimport {\n AnimationState,\n AnyResolvedKeyframe,\n KeyframeGenerator,\n ValueAnimationOptions,\n} from \"../types\"\n\nexport function defaultEasing(\n values: any[],\n easing?: EasingFunction\n): EasingFunction[] {\n return values.map(() => easing || easeInOut).splice(0, values.length - 1)\n}\n\nexport function keyframes({\n duration = 300,\n keyframes: keyframeValues,\n times,\n ease = \"easeInOut\",\n}: ValueAnimationOptions): KeyframeGenerator {\n /**\n * Easing functions can be externally defined as strings. Here we convert them\n * into actual functions.\n */\n const easingFunctions = isEasingArray(ease)\n ? ease.map(easingDefinitionToFunction)\n : easingDefinitionToFunction(ease)\n\n /**\n * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator\n * to reduce GC during animation.\n */\n const state: AnimationState = {\n done: false,\n value: keyframeValues[0],\n }\n\n /**\n * Create a times array based on the provided 0-1 offsets\n */\n const absoluteTimes = convertOffsetToTimes(\n // Only use the provided offsets if they're the correct length\n // TODO Maybe we should warn here if there's a length mismatch\n times && times.length === keyframeValues.length\n ? times\n : defaultOffset(keyframeValues),\n duration\n )\n\n const mapTimeToKeyframe = interpolate(absoluteTimes, keyframeValues, {\n ease: Array.isArray(easingFunctions)\n ? easingFunctions\n : defaultEasing(keyframeValues, easingFunctions),\n })\n\n return {\n calculatedDuration: duration,\n next: (t: number) => {\n state.value = mapTimeToKeyframe(t)\n state.done = t >= duration\n return state\n },\n }\n}\n","import { AnimationPlaybackOptions } from \"../types\"\n\nconst isNotNull = (value: unknown) => value !== null\n\nexport function getFinalKeyframe(\n keyframes: T[],\n { repeat, repeatType = \"loop\" }: AnimationPlaybackOptions,\n finalKeyframe?: T,\n speed: number = 1\n): T {\n const resolvedKeyframes = keyframes.filter(isNotNull)\n const useFirstKeyframe =\n speed < 0 || (repeat && repeatType !== \"loop\" && repeat % 2 === 1)\n const index = useFirstKeyframe ? 0 : resolvedKeyframes.length - 1\n\n return !index || finalKeyframe === undefined\n ? resolvedKeyframes[index]\n : finalKeyframe\n}\n","import { inertia } from \"../generators/inertia\"\nimport { keyframes } from \"../generators/keyframes\"\nimport { spring } from \"../generators/spring\"\nimport { GeneratorFactory, ValueAnimationTransition } from \"../types\"\n\nconst transitionTypeMap: { [key: string]: GeneratorFactory } = {\n decay: inertia,\n inertia,\n tween: keyframes,\n keyframes: keyframes,\n spring,\n}\n\nexport function replaceTransitionType(transition: ValueAnimationTransition) {\n if (typeof transition.type === \"string\") {\n transition.type = transitionTypeMap[transition.type]\n }\n}\n","export class WithPromise {\n protected _finished: Promise\n\n resolve: VoidFunction\n\n constructor() {\n this.updateFinished()\n }\n\n get finished() {\n return this._finished\n }\n\n protected updateFinished() {\n this._finished = new Promise((resolve) => {\n this.resolve = resolve\n })\n }\n\n protected notifyFinished() {\n this.resolve()\n }\n\n /**\n * Allows the animation to be awaited.\n *\n * @deprecated Use `finished` instead.\n */\n then(onResolve: VoidFunction, onReject?: VoidFunction) {\n return this.finished.then(onResolve, onReject)\n }\n}\n","import {\n clamp,\n invariant,\n millisecondsToSeconds,\n pipe,\n secondsToMilliseconds,\n} from \"motion-utils\"\nimport { time } from \"../frameloop/sync-time\"\nimport { mix } from \"../utils/mix\"\nimport { Mixer } from \"../utils/mix/types\"\nimport { frameloopDriver } from \"./drivers/frame\"\nimport { DriverControls } from \"./drivers/types\"\nimport { inertia } from \"./generators/inertia\"\nimport { keyframes as keyframesGenerator } from \"./generators/keyframes\"\nimport { calcGeneratorDuration } from \"./generators/utils/calc-duration\"\nimport { getGeneratorVelocity } from \"./generators/utils/velocity\"\nimport { getFinalKeyframe } from \"./keyframes/get-final\"\nimport {\n AnimationPlaybackControlsWithThen,\n AnimationState,\n GeneratorFactory,\n KeyframeGenerator,\n TimelineWithFallback,\n ValueAnimationOptions,\n} from \"./types\"\nimport { replaceTransitionType } from \"./utils/replace-transition-type\"\nimport { WithPromise } from \"./utils/WithPromise\"\n\nconst percentToProgress = (percent: number) => percent / 100\n\nexport class JSAnimation\n extends WithPromise\n implements AnimationPlaybackControlsWithThen\n{\n state: AnimationPlayState = \"idle\"\n\n startTime: number | null = null\n\n /**\n * The driver that's controlling the animation loop. Normally this is a requestAnimationFrame loop\n * but in tests we can pass in a synchronous loop.\n */\n private driver?: DriverControls\n\n private isStopped = false\n\n private generator: KeyframeGenerator\n\n private calculatedDuration: number\n\n private resolvedDuration: number\n\n private totalDuration: number\n\n private options: ValueAnimationOptions\n\n /**\n * The current time of the animation.\n */\n private currentTime: number = 0\n\n /**\n * The time at which the animation was paused.\n */\n private holdTime: number | null = null\n\n /**\n * Playback speed as a factor. 0 would be stopped, -1 reverse and 2 double speed.\n */\n private playbackSpeed = 1\n\n /*\n * If our generator doesn't support mixing numbers, we need to replace keyframes with\n * [0, 100] and then make a function that maps that to the actual keyframes.\n *\n * 100 is chosen instead of 1 as it works nicer with spring animations.\n */\n private mixKeyframes: Mixer | undefined\n\n private mirroredGenerator: KeyframeGenerator | undefined\n\n /**\n * Reusable state object for the delay phase to avoid\n * allocating a new object every frame.\n */\n private delayState: AnimationState = {\n done: false,\n value: undefined as unknown as T,\n }\n\n constructor(options: ValueAnimationOptions) {\n super()\n\n this.options = options\n this.initAnimation()\n this.play()\n\n if (options.autoplay === false) this.pause()\n }\n\n initAnimation() {\n const { options } = this\n\n replaceTransitionType(options)\n\n const {\n type = keyframesGenerator,\n repeat = 0,\n repeatDelay = 0,\n repeatType,\n velocity = 0,\n } = options\n let { keyframes } = options\n\n const generatorFactory =\n (type as GeneratorFactory) || keyframesGenerator\n\n if (\n process.env.NODE_ENV !== \"production\" &&\n generatorFactory !== keyframesGenerator\n ) {\n invariant(\n keyframes.length <= 2,\n `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${keyframes}`,\n \"spring-two-frames\"\n )\n }\n\n if (\n generatorFactory !== keyframesGenerator &&\n typeof keyframes[0] !== \"number\"\n ) {\n this.mixKeyframes = pipe(\n percentToProgress,\n mix(keyframes[0], keyframes[1])\n ) as (t: number) => T\n\n keyframes = [0 as T, 100 as T]\n }\n\n const generator = generatorFactory({ ...options, keyframes })\n\n /**\n * If we have a mirror repeat type we need to create a second generator that outputs the\n * mirrored (not reversed) animation and later ping pong between the two generators.\n */\n if (repeatType === \"mirror\") {\n this.mirroredGenerator = generatorFactory({\n ...options,\n keyframes: [...keyframes].reverse(),\n velocity: -velocity,\n })\n }\n\n /**\n * If duration is undefined and we have repeat options,\n * we need to calculate a duration from the generator.\n *\n * We set it to the generator itself to cache the duration.\n * Any timeline resolver will need to have already precalculated\n * the duration by this step.\n */\n if (generator.calculatedDuration === null) {\n generator.calculatedDuration = calcGeneratorDuration(generator)\n }\n\n const { calculatedDuration } = generator\n this.calculatedDuration = calculatedDuration\n this.resolvedDuration = calculatedDuration + repeatDelay\n this.totalDuration = this.resolvedDuration * (repeat + 1) - repeatDelay\n this.generator = generator\n }\n\n updateTime(timestamp: number) {\n const animationTime =\n Math.round(timestamp - this.startTime!) * this.playbackSpeed\n\n // Update currentTime\n if (this.holdTime !== null) {\n this.currentTime = this.holdTime\n } else {\n // Rounding the time because floating point arithmetic is not always accurate, e.g. 3000.367 - 1000.367 =\n // 2000.0000000000002. This is a problem when we are comparing the currentTime with the duration, for\n // example.\n this.currentTime = animationTime\n }\n }\n\n tick(timestamp: number, sample = false) {\n const {\n generator,\n totalDuration,\n mixKeyframes,\n mirroredGenerator,\n resolvedDuration,\n calculatedDuration,\n } = this\n\n if (this.startTime === null) return generator.next(0)\n\n const {\n delay = 0,\n keyframes,\n repeat,\n repeatType,\n repeatDelay,\n type,\n onUpdate,\n finalKeyframe,\n } = this.options\n\n /**\n * requestAnimationFrame timestamps can come through as lower than\n * the startTime as set by performance.now(). Here we prevent this,\n * though in the future it could be possible to make setting startTime\n * a pending operation that gets resolved here.\n */\n if (this.speed > 0) {\n this.startTime = Math.min(this.startTime, timestamp)\n } else if (this.speed < 0) {\n this.startTime = Math.min(\n timestamp - totalDuration / this.speed,\n this.startTime\n )\n }\n\n if (sample) {\n this.currentTime = timestamp\n } else {\n this.updateTime(timestamp)\n }\n\n // Rebase on delay\n const timeWithoutDelay =\n this.currentTime - delay * (this.playbackSpeed >= 0 ? 1 : -1)\n const isInDelayPhase =\n this.playbackSpeed >= 0\n ? timeWithoutDelay < 0\n : timeWithoutDelay > totalDuration\n this.currentTime = Math.max(timeWithoutDelay, 0)\n\n // If this animation has finished, set the current time to the total duration.\n if (this.state === \"finished\" && this.holdTime === null) {\n this.currentTime = totalDuration\n }\n\n let elapsed = this.currentTime\n let frameGenerator = generator\n\n if (repeat) {\n /**\n * Get the current progress (0-1) of the animation. If t is >\n * than duration we'll get values like 2.5 (midway through the\n * third iteration)\n */\n const progress =\n Math.min(this.currentTime, totalDuration) / resolvedDuration\n\n /**\n * Get the current iteration (0 indexed). For instance the floor of\n * 2.5 is 2.\n */\n let currentIteration = Math.floor(progress)\n\n /**\n * Get the current progress of the iteration by taking the remainder\n * so 2.5 is 0.5 through iteration 2\n */\n let iterationProgress = progress % 1.0\n\n /**\n * If iteration progress is 1 we count that as the end\n * of the previous iteration.\n */\n if (!iterationProgress && progress >= 1) {\n iterationProgress = 1\n }\n\n iterationProgress === 1 && currentIteration--\n\n currentIteration = Math.min(currentIteration, repeat + 1)\n\n /**\n * Reverse progress if we're not running in \"normal\" direction\n */\n\n const isOddIteration = Boolean(currentIteration % 2)\n if (isOddIteration) {\n if (repeatType === \"reverse\") {\n iterationProgress = 1 - iterationProgress\n if (repeatDelay) {\n iterationProgress -= repeatDelay / resolvedDuration\n }\n } else if (repeatType === \"mirror\") {\n frameGenerator = mirroredGenerator!\n }\n }\n\n elapsed = clamp(0, 1, iterationProgress) * resolvedDuration\n }\n\n /**\n * If we're in negative time, set state as the initial keyframe.\n * This prevents delay: x, duration: 0 animations from finishing\n * instantly.\n */\n let state: AnimationState\n if (isInDelayPhase) {\n this.delayState.value = keyframes[0]\n state = this.delayState\n } else {\n state = frameGenerator.next(elapsed)\n }\n\n if (mixKeyframes && !isInDelayPhase) {\n state.value = mixKeyframes(state.value as number)\n }\n\n let { done } = state\n\n if (!isInDelayPhase && calculatedDuration !== null) {\n done =\n this.playbackSpeed >= 0\n ? this.currentTime >= totalDuration\n : this.currentTime <= 0\n }\n\n const isAnimationFinished =\n this.holdTime === null &&\n (this.state === \"finished\" || (this.state === \"running\" && done))\n\n // TODO: The exception for inertia could be cleaner here\n if (isAnimationFinished && type !== inertia) {\n state.value = getFinalKeyframe(\n keyframes,\n this.options,\n finalKeyframe,\n this.speed\n )\n }\n\n if (onUpdate) {\n onUpdate(state.value)\n }\n\n if (isAnimationFinished) {\n this.finish()\n }\n\n return state\n }\n\n /**\n * Allows the returned animation to be awaited or promise-chained. Currently\n * resolves when the animation finishes at all but in a future update could/should\n * reject if its cancels.\n */\n then(resolve: VoidFunction, reject?: VoidFunction) {\n return this.finished.then(resolve, reject)\n }\n\n get duration() {\n return millisecondsToSeconds(this.calculatedDuration)\n }\n\n get iterationDuration() {\n const { delay = 0 } = this.options || {}\n return this.duration + millisecondsToSeconds(delay)\n }\n\n get time() {\n return millisecondsToSeconds(this.currentTime)\n }\n\n set time(newTime: number) {\n newTime = secondsToMilliseconds(newTime)\n this.currentTime = newTime\n\n if (\n this.startTime === null ||\n this.holdTime !== null ||\n this.playbackSpeed === 0\n ) {\n this.holdTime = newTime\n } else if (this.driver) {\n this.startTime = this.driver.now() - newTime / this.playbackSpeed\n }\n\n if (this.driver) {\n this.driver.start(false)\n } else {\n this.startTime = 0\n this.state = \"paused\"\n this.holdTime = newTime\n this.tick(newTime)\n }\n }\n\n /**\n * Returns the generator's velocity at the current time in units/second.\n * Uses the analytical derivative when available (springs), avoiding\n * the MotionValue's frame-dependent velocity estimation.\n */\n getGeneratorVelocity(): number {\n const t = this.currentTime\n if (t <= 0) return this.options.velocity || 0\n\n if (this.generator.velocity) {\n return this.generator.velocity(t)\n }\n\n // Fallback: finite difference\n const current = this.generator.next(t).value as number\n return getGeneratorVelocity(\n (s) => this.generator.next(s).value as number,\n t,\n current\n )\n }\n\n get speed() {\n return this.playbackSpeed\n }\n\n set speed(newSpeed: number) {\n const hasChanged = this.playbackSpeed !== newSpeed\n\n if (hasChanged && this.driver) {\n this.updateTime(time.now())\n }\n\n this.playbackSpeed = newSpeed\n\n if (hasChanged && this.driver) {\n this.time = millisecondsToSeconds(this.currentTime)\n }\n }\n\n play() {\n if (this.isStopped) return\n\n const { driver = frameloopDriver, startTime } = this.options\n\n if (!this.driver) {\n this.driver = driver((timestamp) => this.tick(timestamp))\n }\n\n this.options.onPlay?.()\n\n const now = this.driver.now()\n\n if (this.state === \"finished\") {\n this.updateFinished()\n this.startTime = now\n } else if (this.holdTime !== null) {\n this.startTime = now - this.holdTime\n } else if (!this.startTime) {\n this.startTime = startTime ?? now\n }\n\n if (this.state === \"finished\" && this.speed < 0) {\n this.startTime += this.calculatedDuration\n }\n\n this.holdTime = null\n\n /**\n * Set playState to running only after we've used it in\n * the previous logic.\n */\n this.state = \"running\"\n\n this.driver.start()\n }\n\n pause() {\n this.state = \"paused\"\n this.updateTime(time.now())\n this.holdTime = this.currentTime\n }\n\n /**\n * This method is bound to the instance to fix a pattern where\n * animation.stop is returned as a reference from a useEffect.\n */\n stop = () => {\n const { motionValue } = this.options\n if (motionValue && motionValue.updatedAt !== time.now()) {\n this.tick(time.now())\n }\n\n this.isStopped = true\n if (this.state === \"idle\") return\n this.teardown()\n this.options.onStop?.()\n }\n\n complete() {\n if (this.state !== \"running\") {\n this.play()\n }\n\n this.state = \"finished\"\n this.holdTime = null\n }\n\n finish() {\n this.notifyFinished()\n this.teardown()\n this.state = \"finished\"\n\n this.options.onComplete?.()\n }\n\n cancel() {\n this.holdTime = null\n this.startTime = 0\n this.tick(0)\n this.teardown()\n this.options.onCancel?.()\n }\n\n private teardown() {\n this.state = \"idle\"\n this.stopDriver()\n this.startTime = this.holdTime = null\n }\n\n private stopDriver() {\n if (!this.driver) return\n this.driver.stop()\n this.driver = undefined\n }\n\n sample(sampleTime: number): AnimationState {\n this.startTime = 0\n return this.tick(sampleTime, true)\n }\n\n attachTimeline(timeline: TimelineWithFallback): VoidFunction {\n if (this.options.allowFlatten) {\n this.options.type = \"keyframes\"\n this.options.ease = \"linear\"\n this.initAnimation()\n }\n\n this.driver?.stop()\n return timeline.observe(this)\n }\n}\n\n// Legacy function support\nexport function animateValue(\n options: ValueAnimationOptions\n) {\n return new JSAnimation(options)\n}\n","import { UnresolvedValueKeyframe, ValueKeyframe } from \"../../types\"\n\nexport function fillWildcards(\n keyframes: ValueKeyframe[] | UnresolvedValueKeyframe[]\n) {\n for (let i = 1; i < keyframes.length; i++) {\n keyframes[i] ??= keyframes[i - 1]\n }\n}\n","import { transformPropOrder } from \"../utils/keys-transform\"\n\nconst radToDeg = (rad: number) => (rad * 180) / Math.PI\n\ntype MatrixParser = (values: number[]) => number\n\ntype MatrixParsers = Record<\n (typeof transformPropOrder)[number],\n number | MatrixParser\n>\n\nconst rotate = (v: number[]) => {\n const angle = radToDeg(Math.atan2(v[1], v[0]))\n return rebaseAngle(angle)\n}\n\nconst matrix2dParsers: MatrixParsers = {\n x: 4,\n y: 5,\n translateX: 4,\n translateY: 5,\n scaleX: 0,\n scaleY: 3,\n scale: (v) => (Math.abs(v[0]) + Math.abs(v[3])) / 2,\n rotate,\n rotateZ: rotate,\n skewX: (v) => radToDeg(Math.atan(v[1])),\n skewY: (v) => radToDeg(Math.atan(v[2])),\n skew: (v) => (Math.abs(v[1]) + Math.abs(v[2])) / 2,\n} as const\n\nconst rebaseAngle = (angle: number) => {\n angle = angle % 360\n if (angle < 0) angle += 360\n return angle\n}\n\nconst rotateZ = rotate\n\nconst scaleX = (v: number[]) => Math.sqrt(v[0] * v[0] + v[1] * v[1])\nconst scaleY = (v: number[]) => Math.sqrt(v[4] * v[4] + v[5] * v[5])\n\nconst matrix3dParsers: MatrixParsers = {\n x: 12,\n y: 13,\n z: 14,\n translateX: 12,\n translateY: 13,\n translateZ: 14,\n scaleX,\n scaleY,\n scale: (v) => (scaleX(v) + scaleY(v)) / 2,\n rotateX: (v) => rebaseAngle(radToDeg(Math.atan2(v[6], v[5]))),\n rotateY: (v) => rebaseAngle(radToDeg(Math.atan2(-v[2], v[0]))),\n rotateZ,\n rotate: rotateZ,\n skewX: (v) => radToDeg(Math.atan(v[4])),\n skewY: (v) => radToDeg(Math.atan(v[1])),\n skew: (v) => (Math.abs(v[1]) + Math.abs(v[4])) / 2,\n} as const\n\nexport function defaultTransformValue(name: string): number {\n return name.includes(\"scale\") ? 1 : 0\n}\n\nexport function parseValueFromTransform(\n transform: string | undefined,\n name: string\n): number {\n if (!transform || transform === \"none\") {\n return defaultTransformValue(name)\n }\n\n const matrix3dMatch = transform.match(/^matrix3d\\(([-\\d.e\\s,]+)\\)$/u)\n\n let parsers: MatrixParsers\n let match: RegExpMatchArray | null\n\n if (matrix3dMatch) {\n parsers = matrix3dParsers\n match = matrix3dMatch\n } else {\n const matrix2dMatch = transform.match(/^matrix\\(([-\\d.e\\s,]+)\\)$/u)\n\n parsers = matrix2dParsers\n match = matrix2dMatch\n }\n\n if (!match) {\n return defaultTransformValue(name)\n }\n\n const valueParser = parsers[name]\n const values = match[1].split(\",\").map(convertTransformToNumber)\n\n return typeof valueParser === \"function\"\n ? valueParser(values)\n : values[valueParser]\n}\n\nexport const readTransformValue = (instance: HTMLElement, name: string) => {\n const { transform = \"none\" } = getComputedStyle(instance)\n return parseValueFromTransform(transform, name)\n}\n\nfunction convertTransformToNumber(value: string): number {\n return parseFloat(value.trim())\n}\n","/**\n * Generate a list of every possible transform key.\n */\nexport const transformPropOrder = [\n \"transformPerspective\",\n \"x\",\n \"y\",\n \"z\",\n \"translateX\",\n \"translateY\",\n \"translateZ\",\n \"scale\",\n \"scaleX\",\n \"scaleY\",\n \"rotate\",\n \"rotateX\",\n \"rotateY\",\n \"rotateZ\",\n \"skew\",\n \"skewX\",\n \"skewY\",\n]\n\n/**\n * A quick lookup for transform props.\n *\n * `pathRotation` is a transform for routing purposes (skipped from raw\n * style application, wired to the transform composite, flags transform\n * dirty) but is intentionally NOT in `transformPropOrder` — it is\n * composed onto `rotate` at the build sites, not serialized in its own\n * slot, and must stay out of the order-array consumers (parse-transform,\n * unit-conversion, keys-position).\n */\nexport const transformProps = /*@__PURE__*/ (() =>\n new Set([...transformPropOrder, \"pathRotation\"]))()\n","import type { Box } from \"motion-utils\"\nimport { parseValueFromTransform } from \"../../../render/dom/parse-transform\"\nimport { transformPropOrder } from \"../../../render/utils/keys-transform\"\nimport { MotionValue } from \"../../../value\"\nimport { number } from \"../../../value/types/numbers\"\nimport { px } from \"../../../value/types/numbers/units\"\nimport { ValueType } from \"../../../value/types/types\"\nimport { AnyResolvedKeyframe } from \"../../types\"\nimport { WithRender } from \"../types\"\n\nexport const isNumOrPxType = (v?: ValueType): v is ValueType =>\n v === number || v === px\n\ntype GetActualMeasurementInPixels = (\n bbox: Box,\n computedStyle: Partial\n) => number\n\nconst transformKeys = new Set([\"x\", \"y\", \"z\"])\nconst nonTranslationalTransformKeys = transformPropOrder.filter(\n (key) => !transformKeys.has(key)\n)\n\ntype RemovedTransforms = [string, AnyResolvedKeyframe][]\nexport function removeNonTranslationalTransform(visualElement: WithRender) {\n const removedTransforms: RemovedTransforms = []\n\n nonTranslationalTransformKeys.forEach((key) => {\n const value: MotionValue | undefined =\n visualElement.getValue(key)\n if (value !== undefined) {\n removedTransforms.push([key, value.get()])\n value.set(key.startsWith(\"scale\") ? 1 : 0)\n }\n })\n\n return removedTransforms\n}\n\nexport const positionalValues: { [key: string]: GetActualMeasurementInPixels } =\n {\n // Dimensions\n width: (\n { x },\n { paddingLeft = \"0\", paddingRight = \"0\", boxSizing }\n ) => {\n const width = x.max - x.min\n return boxSizing === \"border-box\"\n ? width\n : width - parseFloat(paddingLeft) - parseFloat(paddingRight)\n },\n height: (\n { y },\n { paddingTop = \"0\", paddingBottom = \"0\", boxSizing }\n ) => {\n const height = y.max - y.min\n return boxSizing === \"border-box\"\n ? height\n : height - parseFloat(paddingTop) - parseFloat(paddingBottom)\n },\n\n top: (_bbox, { top }) => parseFloat(top as string),\n left: (_bbox, { left }) => parseFloat(left as string),\n bottom: ({ y }, { top }) => parseFloat(top as string) + (y.max - y.min),\n right: ({ x }, { left }) =>\n parseFloat(left as string) + (x.max - x.min),\n\n // Transform\n x: (_bbox, { transform }) => parseValueFromTransform(transform, \"x\"),\n y: (_bbox, { transform }) => parseValueFromTransform(transform, \"y\"),\n }\n\n// Alias translate longform names\npositionalValues.translateX = positionalValues.x\npositionalValues.translateY = positionalValues.y\n","import { frame } from \"../../frameloop\"\nimport { MotionValue } from \"../../value\"\nimport { AnyResolvedKeyframe } from \"../types\"\nimport { WithRender } from \"./types\"\nimport { fillWildcards } from \"./utils/fill-wildcards\"\nimport { removeNonTranslationalTransform } from \"./utils/unit-conversion\"\n\nexport type UnresolvedKeyframes = Array\n\nexport type ResolvedKeyframes = Array\n\nconst toResolve = new Set()\nlet isScheduled = false\nlet anyNeedsMeasurement = false\nlet isForced = false\n\nfunction measureAllKeyframes() {\n if (anyNeedsMeasurement) {\n const resolversToMeasure = Array.from(toResolve).filter(\n (resolver: KeyframeResolver) => resolver.needsMeasurement\n )\n const elementsToMeasure = new Set(\n resolversToMeasure.map((resolver) => resolver.element)\n )\n const transformsToRestore = new Map<\n WithRender,\n [string, AnyResolvedKeyframe][]\n >()\n\n /**\n * Write pass\n * If we're measuring elements we want to remove bounding box-changing transforms.\n */\n elementsToMeasure.forEach((element: WithRender) => {\n const removedTransforms = removeNonTranslationalTransform(\n element as any\n )\n\n if (!removedTransforms.length) return\n\n transformsToRestore.set(element, removedTransforms)\n\n element.render()\n })\n\n // Read\n resolversToMeasure.forEach((resolver) => resolver.measureInitialState())\n\n // Write\n elementsToMeasure.forEach((element: WithRender) => {\n element.render()\n\n const restore = transformsToRestore.get(element)\n if (restore) {\n restore.forEach(([key, value]) => {\n element.getValue(key)?.set(value)\n })\n }\n })\n\n // Read\n resolversToMeasure.forEach((resolver) => resolver.measureEndState())\n\n // Write\n resolversToMeasure.forEach((resolver) => {\n if (resolver.suspendedScrollY !== undefined) {\n window.scrollTo(0, resolver.suspendedScrollY)\n }\n })\n }\n\n anyNeedsMeasurement = false\n isScheduled = false\n\n toResolve.forEach((resolver) => resolver.complete(isForced))\n toResolve.clear()\n}\n\nfunction readAllKeyframes() {\n toResolve.forEach((resolver) => {\n resolver.readKeyframes()\n\n if (resolver.needsMeasurement) {\n anyNeedsMeasurement = true\n }\n })\n}\n\nexport function flushKeyframeResolvers() {\n isForced = true\n readAllKeyframes()\n measureAllKeyframes()\n isForced = false\n}\n\nexport type OnKeyframesResolved = (\n resolvedKeyframes: ResolvedKeyframes,\n finalKeyframe: T,\n forced: boolean\n) => void\n\nexport class KeyframeResolver {\n name?: string\n element?: WithRender\n finalKeyframe?: T\n suspendedScrollY?: number\n\n protected unresolvedKeyframes: UnresolvedKeyframes\n\n private motionValue?: MotionValue\n private onComplete: OnKeyframesResolved\n\n state: \"pending\" | \"scheduled\" | \"complete\" = \"pending\"\n\n /**\n * Track whether this resolver is async. If it is, it'll be added to the\n * resolver queue and flushed in the next frame. Resolvers that aren't going\n * to trigger read/write thrashing don't need to be async.\n */\n private isAsync = false\n\n /**\n * Track whether this resolver needs to perform a measurement\n * to resolve its keyframes.\n */\n needsMeasurement = false\n\n constructor(\n unresolvedKeyframes: UnresolvedKeyframes,\n onComplete: OnKeyframesResolved,\n name?: string,\n motionValue?: MotionValue,\n element?: WithRender,\n isAsync = false\n ) {\n this.unresolvedKeyframes = [...unresolvedKeyframes]\n this.onComplete = onComplete\n this.name = name\n this.motionValue = motionValue\n this.element = element\n this.isAsync = isAsync\n }\n\n scheduleResolve() {\n this.state = \"scheduled\"\n\n if (this.isAsync) {\n toResolve.add(this)\n\n if (!isScheduled) {\n isScheduled = true\n frame.read(readAllKeyframes)\n frame.resolveKeyframes(measureAllKeyframes)\n }\n } else {\n this.readKeyframes()\n this.complete()\n }\n }\n\n readKeyframes() {\n const { unresolvedKeyframes, name, element, motionValue } = this\n\n // If initial keyframe is null we need to read it from the DOM\n if (unresolvedKeyframes[0] === null) {\n const currentValue = motionValue?.get()\n\n // TODO: This doesn't work if the final keyframe is a wildcard\n const finalKeyframe =\n unresolvedKeyframes[unresolvedKeyframes.length - 1]\n\n if (currentValue !== undefined) {\n unresolvedKeyframes[0] = currentValue\n } else if (element && name) {\n const valueAsRead = element.readValue(name, finalKeyframe)\n\n if (valueAsRead !== undefined && valueAsRead !== null) {\n unresolvedKeyframes[0] = valueAsRead\n }\n }\n\n if (unresolvedKeyframes[0] === undefined) {\n unresolvedKeyframes[0] = finalKeyframe\n }\n\n if (motionValue && currentValue === undefined) {\n motionValue.set(unresolvedKeyframes[0] as T)\n }\n }\n\n fillWildcards(unresolvedKeyframes)\n }\n\n setFinalKeyframe() {}\n measureInitialState() {}\n renderEndStyles() {}\n measureEndState() {}\n\n complete(isForcedComplete = false) {\n this.state = \"complete\"\n\n this.onComplete(\n this.unresolvedKeyframes as ResolvedKeyframes,\n this.finalKeyframe as T,\n isForcedComplete\n )\n\n toResolve.delete(this)\n }\n\n cancel() {\n if (this.state === \"scheduled\") {\n toResolve.delete(this)\n this.state = \"pending\"\n }\n }\n\n resume() {\n if (this.state === \"pending\") this.scheduleResolve()\n }\n}\n","export const isCSSVar = (name: string) => name.startsWith(\"--\")\n","import { AnyResolvedKeyframe } from \"../../animation/types\"\nimport { isCSSVar } from \"./is-css-var\"\n\nexport function setStyle(\n element: HTMLElement | SVGElement,\n name: string,\n value: AnyResolvedKeyframe\n) {\n isCSSVar(name)\n ? element.style.setProperty(name, value as string)\n : (element.style[name as any] = value as string)\n}\n","/**\n * Add the ability for test suites to manually set support flags\n * to better test more environments.\n */\nexport const supportsFlags: Record = {}\n","import { memo } from \"motion-utils\"\nimport { supportsFlags } from \"./flags\"\n\nexport function memoSupports(\n callback: () => T,\n supportsFlag: keyof typeof supportsFlags\n) {\n const memoized = memo(callback)\n return () => supportsFlags[supportsFlag] ?? memoized()\n}\n","import { ProgressTimeline } from \"../..\"\nimport { memoSupports } from \"./memo\"\n\ndeclare global {\n interface Window {\n ScrollTimeline: ScrollTimeline\n ViewTimeline: ViewTimeline\n }\n}\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\nexport const supportsScrollTimeline = /* @__PURE__ */ memoSupports(\n () => window.ScrollTimeline !== undefined,\n \"scrollTimeline\"\n)\n\nexport const supportsViewTimeline = /* @__PURE__ */ memoSupports(\n () => window.ViewTimeline !== undefined,\n \"viewTimeline\"\n)\n","import { memoSupports } from \"./memo\"\n\nexport const supportsLinearEasing = /*@__PURE__*/ memoSupports(() => {\n try {\n document\n .createElement(\"div\")\n .animate({ opacity: 0 }, { easing: \"linear(0, 1)\" })\n } catch (e) {\n return false\n }\n return true\n}, \"linearEasing\")\n","import { BezierDefinition } from \"motion-utils\"\n\nexport const cubicBezierAsString = ([a, b, c, d]: BezierDefinition) =>\n `cubic-bezier(${a}, ${b}, ${c}, ${d})`\n","import { cubicBezierAsString } from \"./cubic-bezier\"\n\nexport const supportedWaapiEasing = {\n linear: \"linear\",\n ease: \"ease\",\n easeIn: \"ease-in\",\n easeOut: \"ease-out\",\n easeInOut: \"ease-in-out\",\n circIn: /*@__PURE__*/ cubicBezierAsString([0, 0.65, 0.55, 1]),\n circOut: /*@__PURE__*/ cubicBezierAsString([0.55, 0, 1, 0.45]),\n backIn: /*@__PURE__*/ cubicBezierAsString([0.31, 0.01, 0.66, -0.59]),\n backOut: /*@__PURE__*/ cubicBezierAsString([0.33, 1.53, 0.69, 0.99]),\n}\n","import { Easing, isBezierDefinition } from \"motion-utils\"\nimport { supportsLinearEasing } from \"../../../utils/supports/linear-easing\"\nimport { generateLinearEasing } from \"../utils/linear\"\nimport { cubicBezierAsString } from \"./cubic-bezier\"\nimport { supportedWaapiEasing } from \"./supported\"\n\nexport function mapEasingToNativeEasing(\n easing: Easing | Easing[] | undefined,\n duration: number\n): undefined | string | string[] {\n if (!easing) {\n return undefined\n } else if (typeof easing === \"function\") {\n return supportsLinearEasing()\n ? generateLinearEasing(easing, duration)\n : \"ease-out\"\n } else if (isBezierDefinition(easing)) {\n return cubicBezierAsString(easing)\n } else if (Array.isArray(easing)) {\n return easing.map(\n (segmentEasing) =>\n (mapEasingToNativeEasing(segmentEasing, duration) as string) ||\n supportedWaapiEasing.easeOut\n )\n } else {\n return supportedWaapiEasing[easing as keyof typeof supportedWaapiEasing]\n }\n}\n","import { ValueKeyframesDefinition, ValueTransition } from \"../types\"\nimport { mapEasingToNativeEasing } from \"./easing/map-easing\"\n\nexport function startWaapiAnimation(\n element: Element,\n valueName: string,\n keyframes: ValueKeyframesDefinition,\n {\n delay = 0,\n duration = 300,\n repeat = 0,\n repeatType = \"loop\",\n ease = \"easeOut\",\n times,\n }: ValueTransition = {},\n pseudoElement: string | undefined = undefined\n) {\n const keyframeOptions: PropertyIndexedKeyframes = {\n [valueName]: keyframes as string[],\n }\n if (times) keyframeOptions.offset = times\n\n const easing = mapEasingToNativeEasing(ease, duration)\n\n /**\n * If this is an easing array, apply to keyframes, not animation as a whole\n */\n if (Array.isArray(easing)) keyframeOptions.easing = easing\n\n const options: KeyframeAnimationOptions = {\n delay,\n duration,\n easing: !Array.isArray(easing) ? easing : \"linear\",\n fill: \"both\",\n iterations: repeat + 1,\n direction: repeatType === \"reverse\" ? \"alternate\" : \"normal\",\n }\n\n if (pseudoElement) options.pseudoElement = pseudoElement\n\n return element.animate(keyframeOptions, options)\n}\n","import { AnimationGeneratorType, GeneratorFactory } from \"../../types\"\n\nexport function isGenerator(\n type?: AnimationGeneratorType\n): type is GeneratorFactory {\n return typeof type === \"function\" && \"applyToOptions\" in type\n}\n","import { ValueTransition } from \"../../../animation/types\"\nimport { supportsLinearEasing } from \"../../../utils/supports/linear-easing\"\nimport { isGenerator } from \"../../generators/utils/is-generator\"\n\nexport function applyGeneratorOptions({\n type,\n ...options\n}: ValueTransition): ValueTransition {\n if (isGenerator(type) && supportsLinearEasing()) {\n return type.applyToOptions!(options)\n } else {\n options.duration ??= 300\n options.ease ??= \"easeOut\"\n }\n\n return options\n}\n","import {\n invariant,\n millisecondsToSeconds,\n noop,\n secondsToMilliseconds,\n} from \"motion-utils\"\nimport { setStyle } from \"../render/dom/style-set\"\nimport { supportsScrollTimeline } from \"../utils/supports/scroll-timeline\"\nimport { getFinalKeyframe } from \"./keyframes/get-final\"\nimport {\n AnimationPlaybackControlsWithThen,\n AnyResolvedKeyframe,\n DOMValueAnimationOptions,\n TimelineWithFallback,\n} from \"./types\"\nimport { WithPromise } from \"./utils/WithPromise\"\nimport { startWaapiAnimation } from \"./waapi/start-waapi-animation\"\nimport { applyGeneratorOptions } from \"./waapi/utils/apply-generator\"\n\nexport interface NativeAnimationOptions\n extends DOMValueAnimationOptions {\n pseudoElement?: string\n startTime?: number\n}\n\n/**\n * NativeAnimation implements AnimationPlaybackControls for the browser's Web Animations API.\n */\nexport class NativeAnimation\n extends WithPromise\n implements AnimationPlaybackControlsWithThen\n{\n /**\n * The interfaced Web Animation API animation\n */\n protected animation: Animation\n\n protected finishedTime: number | null = null\n\n protected options: NativeAnimationOptions\n\n private allowFlatten: boolean\n\n private isStopped = false\n\n private isPseudoElement: boolean\n\n /**\n * Tracks a manually-set start time that takes precedence over WAAPI's\n * dynamic startTime. This is cleared when play() or time setter is called,\n * allowing WAAPI to take over timing.\n */\n protected manualStartTime: number | null = null\n\n constructor(options?: NativeAnimationOptions) {\n super()\n\n if (!options) return\n\n const {\n element,\n name,\n keyframes,\n pseudoElement,\n allowFlatten = false,\n finalKeyframe,\n onComplete,\n } = options as any\n\n this.isPseudoElement = Boolean(pseudoElement)\n\n this.allowFlatten = allowFlatten\n this.options = options\n\n invariant(\n typeof options.type !== \"string\",\n `Mini animate() doesn't support \"type\" as a string.`,\n \"mini-spring\"\n )\n\n const transition = applyGeneratorOptions(options)\n\n this.animation = startWaapiAnimation(\n element,\n name,\n keyframes,\n transition,\n pseudoElement\n )\n\n if (transition.autoplay === false) {\n this.animation.pause()\n }\n\n this.animation.onfinish = () => {\n this.finishedTime = this.time\n\n if (!pseudoElement) {\n const keyframe = getFinalKeyframe(\n keyframes as any,\n this.options as any,\n finalKeyframe,\n this.speed\n )\n if (this.updateMotionValue) {\n this.updateMotionValue(keyframe)\n }\n\n /**\n * If we can, we want to commit the final style as set by the user,\n * rather than the computed keyframe value supplied by the animation.\n * We always do this, even when a motion value is present, to prevent\n * a visual flash in Firefox where the WAAPI animation's fill is removed\n * during cancel() before the scheduled render can apply the correct value.\n */\n setStyle(element, name, keyframe)\n\n this.animation.cancel()\n }\n\n onComplete?.()\n this.notifyFinished()\n }\n }\n\n updateMotionValue?(value?: T): void\n\n play() {\n if (this.isStopped) return\n\n this.manualStartTime = null\n this.animation.play()\n\n if (this.state === \"finished\") {\n this.updateFinished()\n }\n }\n\n pause() {\n this.animation.pause()\n }\n\n complete() {\n this.animation.finish?.()\n }\n\n cancel() {\n try {\n this.animation.cancel()\n } catch (e) {}\n }\n\n stop() {\n if (this.isStopped) return\n this.isStopped = true\n const { state } = this\n\n if (state === \"idle\" || state === \"finished\") {\n return\n }\n\n if (this.updateMotionValue) {\n this.updateMotionValue()\n } else {\n this.commitStyles()\n }\n\n if (!this.isPseudoElement) this.cancel()\n }\n\n /**\n * WAAPI doesn't natively have any interruption capabilities.\n *\n * In this method, we commit styles back to the DOM before cancelling\n * the animation.\n *\n * This is designed to be overridden by NativeAnimationExtended, which\n * will create a renderless JS animation and sample it twice to calculate\n * its current value, \"previous\" value, and therefore allow\n * Motion to also correctly calculate velocity for any subsequent animation\n * while deferring the commit until the next animation frame.\n */\n protected commitStyles() {\n const element = this.options?.element\n if (!this.isPseudoElement && element?.isConnected) {\n this.animation.commitStyles?.()\n }\n }\n\n get duration() {\n const duration =\n this.animation.effect?.getComputedTiming?.().duration || 0\n\n return millisecondsToSeconds(Number(duration))\n }\n\n get iterationDuration() {\n const { delay = 0 } = this.options || {}\n return this.duration + millisecondsToSeconds(delay)\n }\n\n get time() {\n return millisecondsToSeconds(Number(this.animation.currentTime) || 0)\n }\n\n set time(newTime: number) {\n const wasFinished = this.finishedTime !== null\n this.manualStartTime = null\n this.finishedTime = null\n this.animation.currentTime = secondsToMilliseconds(newTime)\n\n if (wasFinished) {\n this.animation.pause()\n }\n }\n\n /**\n * The playback speed of the animation.\n * 1 = normal speed, 2 = double speed, 0.5 = half speed.\n */\n get speed() {\n return this.animation.playbackRate\n }\n\n set speed(newSpeed: number) {\n // Allow backwards playback after finishing\n if (newSpeed < 0) this.finishedTime = null\n\n this.animation.playbackRate = newSpeed\n }\n\n get state() {\n return this.finishedTime !== null\n ? \"finished\"\n : this.animation.playState\n }\n\n get startTime() {\n return this.manualStartTime ?? Number(this.animation.startTime)\n }\n\n set startTime(newStartTime: number) {\n this.manualStartTime = this.animation.startTime = newStartTime\n }\n\n /**\n * Attaches a timeline to the animation, for instance the `ScrollTimeline`.\n */\n attachTimeline({\n timeline,\n rangeStart,\n rangeEnd,\n observe,\n }: TimelineWithFallback): VoidFunction {\n if (this.allowFlatten) {\n this.animation.effect?.updateTiming({ easing: \"linear\" })\n }\n\n this.animation.onfinish = null\n\n if (timeline && supportsScrollTimeline()) {\n this.animation.timeline = timeline as any\n\n if (rangeStart) (this.animation as any).rangeStart = rangeStart\n if (rangeEnd) (this.animation as any).rangeEnd = rangeEnd\n\n return noop\n } else {\n return observe(this)\n }\n }\n}\n","import { anticipate, backInOut, circInOut } from \"motion-utils\"\nimport { ValueAnimationTransition } from \"../../types\"\n\nconst unsupportedEasingFunctions = {\n anticipate,\n backInOut,\n circInOut,\n}\n\nfunction isUnsupportedEase(\n key: string\n): key is keyof typeof unsupportedEasingFunctions {\n return key in unsupportedEasingFunctions\n}\n\nexport function replaceStringEasing(transition: ValueAnimationTransition) {\n if (\n typeof transition.ease === \"string\" &&\n isUnsupportedEase(transition.ease)\n ) {\n transition.ease = unsupportedEasingFunctions[transition.ease]\n }\n}\n","import { clamp } from \"motion-utils\"\nimport { time } from \"../frameloop/sync-time\"\nimport { setStyle } from \"../render/dom/style-set\"\nimport { JSAnimation } from \"./JSAnimation\"\nimport { NativeAnimation, NativeAnimationOptions } from \"./NativeAnimation\"\nimport { AnyResolvedKeyframe, ValueAnimationOptions } from \"./types\"\nimport { replaceTransitionType } from \"./utils/replace-transition-type\"\nimport { replaceStringEasing } from \"./waapi/utils/unsupported-easing\"\n\nexport type NativeAnimationOptionsExtended =\n NativeAnimationOptions & ValueAnimationOptions & NativeAnimationOptions\n\n/**\n * 10ms is chosen here as it strikes a balance between smooth\n * results (more than one keyframe per frame at 60fps) and\n * keyframe quantity.\n */\nconst sampleDelta = 10 //ms\n\nexport class NativeAnimationExtended<\n T extends AnyResolvedKeyframe\n> extends NativeAnimation {\n options: NativeAnimationOptionsExtended\n\n constructor(options: NativeAnimationOptionsExtended) {\n /**\n * The base NativeAnimation function only supports a subset\n * of Motion easings, and WAAPI also only supports some\n * easing functions via string/cubic-bezier definitions.\n *\n * This function replaces those unsupported easing functions\n * with a JS easing function. This will later get compiled\n * to a linear() easing function.\n */\n replaceStringEasing(options)\n\n /**\n * Ensure we replace the transition type with a generator function\n * before passing to WAAPI.\n *\n * TODO: Does this have a better home? It could be shared with\n * JSAnimation.\n */\n replaceTransitionType(options)\n\n super(options)\n\n /**\n * Only set startTime when the animation should autoplay.\n * Setting startTime on a paused WAAPI animation unpauses it\n * (per the WAAPI spec), which breaks autoplay: false.\n */\n if (options.startTime !== undefined && options.autoplay !== false) {\n this.startTime = options.startTime\n }\n\n this.options = options\n }\n\n /**\n * WAAPI doesn't natively have any interruption capabilities.\n *\n * Rather than read committed styles back out of the DOM, we can\n * create a renderless JS animation and sample it twice to calculate\n * its current value, \"previous\" value, and therefore allow\n * Motion to calculate velocity for any subsequent animation.\n */\n updateMotionValue(value?: T) {\n const { motionValue, onUpdate, onComplete, element, ...options } =\n this.options\n\n if (!motionValue) return\n\n if (value !== undefined) {\n motionValue.set(value)\n return\n }\n\n const sampleAnimation = new JSAnimation({\n ...options,\n autoplay: false,\n })\n\n /**\n * Use wall-clock elapsed time for sampling.\n * Under CPU load, WAAPI's currentTime may not reflect actual\n * elapsed time, causing incorrect sampling and visual jumps.\n */\n const sampleTime = Math.max(sampleDelta, time.now() - this.startTime)\n const delta = clamp(0, sampleDelta, sampleTime - sampleDelta)\n const current = sampleAnimation.sample(sampleTime).value\n\n /**\n * Write the estimated value to inline style so it persists\n * after cancel(), covering the async gap before the next\n * animation starts.\n */\n const { name } = this.options\n if (element && name) setStyle(element, name, current)\n\n motionValue.setWithVelocity(\n sampleAnimation.sample(Math.max(0, sampleTime - delta)).value,\n current,\n delta\n )\n\n sampleAnimation.stop()\n }\n}\n","import { complex } from \"../../value/types/complex\"\nimport { ValueKeyframesDefinition } from \"../types\"\n\n/**\n * Check if a value is animatable. Examples:\n *\n * ✅: 100, \"100px\", \"#fff\"\n * ❌: \"block\", \"url(2.jpg)\"\n * @param value\n *\n * @internal\n */\nexport const isAnimatable = (\n value: ValueKeyframesDefinition,\n name?: string\n) => {\n // If the list of keys that might be non-animatable grows, replace with Set\n if (name === \"zIndex\") return false\n\n // If it's a number or a keyframes array, we can animate it. We might at some point\n // need to do a deep isAnimatable check of keyframes, or let Popmotion handle this,\n // but for now lets leave it like this for performance reasons\n if (typeof value === \"number\" || Array.isArray(value)) return true\n\n if (\n typeof value === \"string\" && // It's animatable if we have a string\n (complex.test(value) || value === \"0\") && // And it contains numbers and/or colors\n !value.startsWith(\"url(\") // Unless it starts with \"url(\"\n ) {\n return true\n }\n\n return false\n}\n","import { warning } from \"motion-utils\"\nimport { isGenerator } from \"../generators/utils/is-generator\"\nimport { ResolvedKeyframes } from \"../keyframes/KeyframesResolver\"\nimport { AnimationGeneratorType } from \"../types\"\nimport { isAnimatable } from \"./is-animatable\"\n\nfunction hasKeyframesChanged(keyframes: ResolvedKeyframes) {\n const current = keyframes[0]\n if (keyframes.length === 1) return true\n for (let i = 0; i < keyframes.length; i++) {\n if (keyframes[i] !== current) return true\n }\n}\n\nexport function canAnimate(\n keyframes: ResolvedKeyframes,\n name?: string,\n type?: AnimationGeneratorType,\n velocity?: number\n) {\n /**\n * Check if we're able to animate between the start and end keyframes,\n * and throw a warning if we're attempting to animate between one that's\n * animatable and another that isn't.\n */\n const originKeyframe = keyframes[0]\n if (originKeyframe === null) {\n return false\n }\n\n /**\n * These aren't traditionally animatable but we do support them.\n * In future we could look into making this more generic or replacing\n * this function with mix() === mixImmediate\n */\n if (name === \"display\" || name === \"visibility\") return true\n\n const targetKeyframe = keyframes[keyframes.length - 1]\n const isOriginAnimatable = isAnimatable(originKeyframe, name)\n const isTargetAnimatable = isAnimatable(targetKeyframe, name)\n\n warning(\n isOriginAnimatable === isTargetAnimatable,\n `You are trying to animate ${name} from \"${originKeyframe}\" to \"${targetKeyframe}\". \"${\n isOriginAnimatable ? targetKeyframe : originKeyframe\n }\" is not an animatable value.`,\n \"value-not-animatable\"\n )\n\n // Always skip if any of these are true\n if (!isOriginAnimatable || !isTargetAnimatable) {\n return false\n }\n\n return (\n hasKeyframesChanged(keyframes) ||\n ((type === \"spring\" || isGenerator(type)) && velocity)\n )\n}\n","import { ValueAnimationOptions } from \"../types\"\n\nexport function makeAnimationInstant(\n options: Partial<{\n duration: ValueAnimationOptions[\"duration\"]\n type: ValueAnimationOptions[\"type\"]\n }>\n): void {\n options.duration = 0\n options.type = \"keyframes\"\n}\n","/**\n * A list of values that can be hardware-accelerated.\n */\nexport const acceleratedValues = new Set([\n \"opacity\",\n \"clipPath\",\n \"filter\",\n \"transform\",\n \"backgroundColor\",\n])\n","const browserColorFunctions =\n /^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\\(/\n\nexport function hasBrowserOnlyColors(keyframes: any[]): boolean {\n for (let i = 0; i < keyframes.length; i++) {\n if (\n typeof keyframes[i] === \"string\" &&\n browserColorFunctions.test(keyframes[i])\n ) {\n return true\n }\n }\n return false\n}\n","import { memo } from \"motion-utils\"\nimport {\n AnyResolvedKeyframe,\n ValueAnimationOptionsWithRenderContext,\n} from \"../../types\"\nimport { acceleratedValues } from \"../utils/accelerated-values\"\nimport { hasBrowserOnlyColors } from \"../utils/is-browser-color\"\n\nconst colorProperties = new Set([\n \"color\",\n \"backgroundColor\",\n \"outlineColor\",\n \"fill\",\n \"stroke\",\n \"borderColor\",\n \"borderTopColor\",\n \"borderRightColor\",\n \"borderBottomColor\",\n \"borderLeftColor\",\n])\n\nconst supportsWaapi = /*@__PURE__*/ memo(() =>\n Object.hasOwnProperty.call(Element.prototype, \"animate\")\n)\n\nexport function supportsBrowserAnimation(\n options: ValueAnimationOptionsWithRenderContext\n) {\n const {\n motionValue,\n name,\n repeatDelay,\n repeatType,\n damping,\n type,\n keyframes,\n } = options\n\n const subject = motionValue?.owner?.current\n\n /**\n * We use instanceof checks instead of isHTMLElement()/isSVGElement()\n * because we explicitly **don't** want elements in different timing\n * contexts (i.e. popups) to be accelerated, as it's not possible to sync\n * these animations properly with those driven from the main window\n * frameloop.\n */\n if (\n !(subject instanceof HTMLElement) &&\n !(subject instanceof SVGElement)\n ) {\n return false\n }\n\n const { onUpdate, transformTemplate } = motionValue!.owner!.getProps()\n\n return (\n supportsWaapi() &&\n name &&\n /**\n * Force WAAPI for color properties with browser-only color formats\n * (oklch, oklab, lab, lch, etc.) that the JS animation path can't parse.\n */\n (acceleratedValues.has(name) ||\n (colorProperties.has(name) &&\n hasBrowserOnlyColors(keyframes))) &&\n (name !== \"transform\" || !transformTemplate) &&\n /**\n * If we're outputting values to onUpdate then we can't use WAAPI as there's\n * no way to read the value from WAAPI every frame.\n */\n !onUpdate &&\n !repeatDelay &&\n repeatType !== \"mirror\" &&\n damping !== 0 &&\n type !== \"inertia\"\n )\n}\n","import { MotionGlobalConfig, noop } from \"motion-utils\"\nimport { time } from \"../frameloop/sync-time\"\nimport { JSAnimation } from \"./JSAnimation\"\nimport { getFinalKeyframe } from \"./keyframes/get-final\"\nimport {\n KeyframeResolver as DefaultKeyframeResolver,\n flushKeyframeResolvers,\n ResolvedKeyframes,\n} from \"./keyframes/KeyframesResolver\"\nimport { NativeAnimationExtended } from \"./NativeAnimationExtended\"\nimport {\n AnimationPlaybackControls,\n AnyResolvedKeyframe,\n TimelineWithFallback,\n ValueAnimationOptions,\n} from \"./types\"\nimport { canAnimate } from \"./utils/can-animate\"\nimport { makeAnimationInstant } from \"./utils/make-animation-instant\"\nimport { WithPromise } from \"./utils/WithPromise\"\nimport { supportsBrowserAnimation } from \"./waapi/supports/waapi\"\n\n/**\n * Maximum time allowed between an animation being created and it being\n * resolved for us to use the latter as the start time.\n *\n * This is to ensure that while we prefer to \"start\" an animation as soon\n * as it's triggered, we also want to avoid a visual jump if there's a big delay\n * between these two moments.\n */\nconst MAX_RESOLVE_DELAY = 40\n\ntype OptionsWithoutKeyframes = Omit<\n ValueAnimationOptions,\n \"keyframes\"\n>\n\nexport class AsyncMotionValueAnimation\n extends WithPromise\n implements AnimationPlaybackControls\n{\n private createdAt: number\n\n private resolvedAt: number | undefined\n\n private _animation: AnimationPlaybackControls | undefined\n\n private pendingTimeline: TimelineWithFallback | undefined\n\n private keyframeResolver: DefaultKeyframeResolver | undefined\n\n private stopTimeline: VoidFunction | undefined\n\n constructor({\n autoplay = true,\n delay = 0,\n type = \"keyframes\",\n repeat = 0,\n repeatDelay = 0,\n repeatType = \"loop\",\n keyframes,\n name,\n motionValue,\n element,\n ...options\n }: ValueAnimationOptions) {\n super()\n\n this.createdAt = time.now()\n\n const optionsWithDefaults: OptionsWithoutKeyframes = {\n autoplay,\n delay,\n type,\n repeat,\n repeatDelay,\n repeatType,\n name,\n motionValue,\n element,\n ...options,\n }\n\n const KeyframeResolver =\n element?.KeyframeResolver || DefaultKeyframeResolver\n\n this.keyframeResolver = new KeyframeResolver(\n keyframes,\n (\n resolvedKeyframes: ResolvedKeyframes,\n finalKeyframe: T,\n forced: boolean\n ) =>\n this.onKeyframesResolved(\n resolvedKeyframes,\n finalKeyframe,\n optionsWithDefaults,\n !forced\n ),\n name,\n motionValue,\n element\n )\n this.keyframeResolver?.scheduleResolve()\n }\n\n onKeyframesResolved(\n keyframes: ResolvedKeyframes,\n finalKeyframe: T,\n options: OptionsWithoutKeyframes,\n sync: boolean\n ) {\n this.keyframeResolver = undefined\n\n const { name, type, velocity, delay, isHandoff, onUpdate } = options\n this.resolvedAt = time.now()\n\n /**\n * If we can't animate this value with the resolved keyframes\n * then we should complete it immediately.\n */\n let canAnimateValue = true\n if (!canAnimate(keyframes, name, type, velocity)) {\n canAnimateValue = false\n\n if (MotionGlobalConfig.instantAnimations || !delay) {\n onUpdate?.(getFinalKeyframe(keyframes, options, finalKeyframe))\n }\n\n keyframes[0] = keyframes[keyframes.length - 1]\n\n makeAnimationInstant(options)\n options.repeat = 0\n }\n\n /**\n * Resolve startTime for the animation.\n *\n * This method uses the createdAt and resolvedAt to calculate the\n * animation startTime. *Ideally*, we would use the createdAt time as t=0\n * as the following frame would then be the first frame of the animation in\n * progress, which would feel snappier.\n *\n * However, if there's a delay (main thread work) between the creation of\n * the animation and the first committed frame, we prefer to use resolvedAt\n * to avoid a sudden jump into the animation.\n */\n const startTime = sync\n ? !this.resolvedAt\n ? this.createdAt\n : this.resolvedAt - this.createdAt > MAX_RESOLVE_DELAY\n ? this.resolvedAt\n : this.createdAt\n : undefined\n\n const resolvedOptions = {\n startTime,\n finalKeyframe,\n ...options,\n keyframes,\n }\n\n /**\n * Animate via WAAPI if possible. If this is a handoff animation, the optimised animation will be running via\n * WAAPI. Therefore, this animation must be JS to ensure it runs \"under\" the\n * optimised animation.\n *\n * Also skip WAAPI when keyframes aren't animatable, as the resolved\n * values may not be valid CSS and would trigger browser warnings.\n */\n const useWaapi =\n canAnimateValue &&\n !isHandoff &&\n supportsBrowserAnimation(resolvedOptions)\n const element = resolvedOptions.motionValue?.owner?.current\n\n let animation: AnimationPlaybackControls\n if (useWaapi) {\n try {\n animation = new NativeAnimationExtended({\n ...resolvedOptions,\n element,\n } as any)\n } catch {\n animation = new JSAnimation(resolvedOptions)\n }\n } else {\n animation = new JSAnimation(resolvedOptions)\n }\n\n animation.finished.then(() => {\n this.notifyFinished()\n }).catch(noop)\n\n if (this.pendingTimeline) {\n this.stopTimeline = animation.attachTimeline(this.pendingTimeline)\n this.pendingTimeline = undefined\n }\n\n this._animation = animation\n }\n\n get finished() {\n if (!this._animation) {\n return this._finished\n } else {\n return this.animation.finished\n }\n }\n\n then(onResolve: VoidFunction, _onReject?: VoidFunction) {\n return this.finished.finally(onResolve).then(() => {})\n }\n\n get animation(): AnimationPlaybackControls {\n if (!this._animation) {\n this.keyframeResolver?.resume()\n flushKeyframeResolvers()\n }\n\n return this._animation!\n }\n\n get duration() {\n return this.animation.duration\n }\n\n get iterationDuration() {\n return this.animation.iterationDuration\n }\n\n get time() {\n return this.animation.time\n }\n\n set time(newTime: number) {\n this.animation.time = newTime\n }\n\n get speed() {\n return this.animation.speed\n }\n\n get state() {\n return this.animation.state\n }\n\n set speed(newSpeed: number) {\n this.animation.speed = newSpeed\n }\n\n get startTime() {\n return this.animation.startTime\n }\n\n attachTimeline(timeline: TimelineWithFallback) {\n if (this._animation) {\n this.stopTimeline = this.animation.attachTimeline(timeline)\n } else {\n this.pendingTimeline = timeline\n }\n\n return () => this.stop()\n }\n\n play() {\n this.animation.play()\n }\n\n pause() {\n this.animation.pause()\n }\n\n complete() {\n this.animation.complete()\n }\n\n cancel() {\n if (this._animation) {\n this.animation.cancel()\n }\n\n this.keyframeResolver?.cancel()\n }\n\n /**\n * Bound to support return animation.stop pattern\n */\n stop = () => {\n if (this._animation) {\n this._animation.stop()\n this.stopTimeline?.()\n }\n\n this.keyframeResolver?.cancel()\n }\n}\n","import { AnimationPlaybackControls, TimelineWithFallback } from \"./types\"\n\ntype PropNames =\n | \"time\"\n | \"speed\"\n | \"duration\"\n | \"attachTimeline\"\n | \"startTime\"\n | \"state\"\n\nexport type AcceptedAnimations = AnimationPlaybackControls\n\nexport type GroupedAnimations = AcceptedAnimations[]\n\nexport class GroupAnimation implements AnimationPlaybackControls {\n animations: GroupedAnimations\n\n constructor(animations: Array) {\n this.animations = animations.filter(Boolean) as GroupedAnimations\n }\n\n get finished() {\n return Promise.all(\n this.animations.map((animation) => animation.finished)\n )\n }\n\n /**\n * TODO: Filter out cancelled or stopped animations before returning\n */\n private getAll(propName: PropNames) {\n return this.animations[0][propName] as any\n }\n\n private setAll(propName: PropNames, newValue: any) {\n for (let i = 0; i < this.animations.length; i++) {\n ;(this.animations[i][propName] as any) = newValue\n }\n }\n\n attachTimeline(timeline: TimelineWithFallback) {\n const subscriptions = this.animations.map((animation) =>\n animation.attachTimeline(timeline)\n )\n\n return () => {\n subscriptions.forEach((cancel, i) => {\n cancel && cancel()\n this.animations[i].stop()\n })\n }\n }\n\n get time() {\n return this.getAll(\"time\")\n }\n\n set time(time: number) {\n this.setAll(\"time\", time)\n }\n\n get speed() {\n return this.getAll(\"speed\")\n }\n\n set speed(speed: number) {\n this.setAll(\"speed\", speed)\n }\n\n get state() {\n return this.getAll(\"state\")\n }\n\n get startTime() {\n return this.getAll(\"startTime\")\n }\n\n get duration() {\n return getMax(this.animations, \"duration\")\n }\n\n get iterationDuration() {\n return getMax(this.animations, \"iterationDuration\")\n }\n\n private runAll(\n methodName: keyof Omit<\n AnimationPlaybackControls,\n PropNames | \"then\" | \"finished\" | \"iterationDuration\"\n >\n ) {\n this.animations.forEach((controls) => controls[methodName]())\n }\n\n play() {\n this.runAll(\"play\")\n }\n\n pause() {\n this.runAll(\"pause\")\n }\n\n // Bound to accomadate common `return animation.stop` pattern\n stop = () => this.runAll(\"stop\")\n\n cancel() {\n this.runAll(\"cancel\")\n }\n\n complete() {\n this.runAll(\"complete\")\n }\n}\n\nfunction getMax(\n animations: GroupedAnimations,\n propName: \"iterationDuration\" | \"duration\"\n): number {\n let max = 0\n\n for (let i = 0; i < animations.length; i++) {\n const value = animations[i][propName]\n if (value !== null && value > max) {\n max = value\n }\n }\n return max\n}\n","import { GroupAnimation } from \"./GroupAnimation\"\nimport { AnimationPlaybackControlsWithThen } from \"./types\"\n\nexport class GroupAnimationWithThen\n extends GroupAnimation\n implements AnimationPlaybackControlsWithThen\n{\n then(onResolve: VoidFunction, _onReject?: VoidFunction) {\n return this.finished.finally(onResolve).then(() => {})\n }\n}\n","import { NativeAnimation } from \"./NativeAnimation\"\nimport { AnyResolvedKeyframe } from \"./types\"\n\nexport class NativeAnimationWrapper<\n T extends AnyResolvedKeyframe\n> extends NativeAnimation {\n constructor(animation: Animation) {\n super()\n\n this.animation = animation\n animation.onfinish = () => {\n this.finishedTime = this.time\n this.notifyFinished()\n }\n }\n}\n","import { NativeAnimation } from \"../NativeAnimation\"\nimport { AnyResolvedKeyframe } from \"../types\"\n\nconst animationMaps = new WeakMap<\n Element,\n Map>\n>()\nexport const animationMapKey = (name: string, pseudoElement: string = \"\") =>\n `${name}:${pseudoElement}`\n\nexport function getAnimationMap(element: Element) {\n let map = animationMaps.get(element)\n if (!map) {\n map = new Map()\n animationMaps.set(element, map)\n }\n return map\n}\n","import type { DynamicOption } from \"../types\"\nimport type { VisualElement } from \"../../render/VisualElement\"\n\nexport function calcChildStagger(\n children: Set,\n child: VisualElement,\n delayChildren?: number | DynamicOption,\n staggerChildren: number = 0,\n staggerDirection: number = 1\n): number {\n const index = Array.from(children)\n .sort((a, b) => a.sortNodePosition(b))\n .indexOf(child)\n const numChildren = children.size\n const maxStaggerDuration = (numChildren - 1) * staggerChildren\n const delayIsFunction = typeof delayChildren === \"function\"\n\n return delayIsFunction\n ? delayChildren(index, numChildren)\n : staggerDirection === 1\n ? index * staggerChildren\n : maxStaggerDuration - index * staggerChildren\n}\n","import {\n EasingFunction,\n SubscriptionManager,\n velocityPerSecond,\n warnOnce,\n} from \"motion-utils\"\nimport {\n AnimationPlaybackControlsWithThen,\n AnyResolvedKeyframe,\n TransformProperties,\n} from \"../animation/types\"\nimport { frame } from \"../frameloop\"\nimport { time } from \"../frameloop/sync-time\"\n\n/**\n * @public\n */\nexport type Subscriber = (v: T) => void\n\n/**\n * @public\n */\nexport type PassiveEffect = (v: T, safeSetter: (v: T) => void) => void\n\nexport type StartAnimation = (\n complete: () => void\n) => AnimationPlaybackControlsWithThen | undefined\n\nexport interface MotionValueEventCallbacks {\n animationStart: () => void\n animationComplete: () => void\n animationCancel: () => void\n change: (latestValue: V) => void\n destroy: () => void\n}\n\n/**\n * Maximum time between the value of two frames, beyond which we\n * assume the velocity has since been 0.\n */\nconst MAX_VELOCITY_DELTA = 30\n\nconst isFloat = (value: any): value is string => {\n return !isNaN(parseFloat(value))\n}\n\ninterface ResolvedValues {\n [key: string]: AnyResolvedKeyframe\n}\n\nexport interface Owner {\n current: HTMLElement | unknown\n getProps: () => {\n onUpdate?: (latest: ResolvedValues) => void\n transformTemplate?: (\n transform: TransformProperties,\n generatedTransform: string\n ) => string\n }\n}\n\nexport interface AccelerateConfig {\n factory: (animation: AnimationPlaybackControlsWithThen) => VoidFunction\n times: number[]\n keyframes: any[]\n ease?: EasingFunction | EasingFunction[]\n duration: number\n isTransformed?: boolean\n}\n\nexport interface MotionValueOptions {\n owner?: Owner\n}\n\nexport const collectMotionValues: { current: MotionValue[] | undefined } = {\n current: undefined,\n}\n\n/**\n * `MotionValue` is used to track the state and velocity of motion values.\n *\n * @public\n */\nexport class MotionValue {\n /**\n * If a MotionValue has an owner, it was created internally within Motion\n * and therefore has no external listeners. It is therefore safe to animate via WAAPI.\n */\n owner?: Owner\n\n /**\n * The current state of the `MotionValue`.\n */\n private current: V | undefined\n\n /**\n * The previous state of the `MotionValue`.\n */\n private prev: V | undefined\n\n /**\n * The previous state of the `MotionValue` at the end of the previous frame.\n */\n private prevFrameValue: V | undefined\n\n /**\n * The last time the `MotionValue` was updated.\n */\n updatedAt: number\n\n /**\n * The time `prevFrameValue` was updated.\n */\n prevUpdatedAt: number | undefined\n\n /**\n * Add a passive effect to this `MotionValue`.\n *\n * A passive effect intercepts calls to `set`. For instance, `useSpring` adds\n * a passive effect that attaches a `spring` to the latest\n * set value. Hypothetically there could be a `useSmooth` that attaches an input smoothing effect.\n *\n * @internal\n */\n private passiveEffect?: PassiveEffect\n private stopPassiveEffect?: VoidFunction\n\n /**\n * Whether the passive effect is active.\n */\n isEffectActive?: boolean\n\n /**\n * A reference to the currently-controlling animation.\n */\n animation?: AnimationPlaybackControlsWithThen\n\n /**\n * Tracks whether this value can output a velocity. Currently this is only true\n * if the value is numerical, but we might be able to widen the scope here and support\n * other value types.\n *\n * @internal\n */\n private canTrackVelocity: boolean | null = null\n\n /**\n * A list of MotionValues whose values are computed from this one.\n * This is a rough start to a proper signal-like dirtying system.\n */\n private dependents: Set | undefined\n\n /**\n * Tracks whether this value should be removed\n */\n liveStyle?: boolean\n\n /**\n * Scroll timeline acceleration metadata. When set, VisualElement\n * can create a native WAAPI animation attached to a scroll timeline\n * instead of driving updates through JS.\n */\n accelerate?: AccelerateConfig\n\n /**\n * @param init - The initiating value\n * @param config - Optional configuration options\n *\n * - `transformer`: A function to transform incoming values with.\n */\n constructor(init: V, options: MotionValueOptions = {}) {\n this.setCurrent(init)\n this.owner = options.owner\n }\n\n setCurrent(current: V) {\n this.current = current\n this.updatedAt = time.now()\n\n if (this.canTrackVelocity === null && current !== undefined) {\n this.canTrackVelocity = isFloat(this.current)\n }\n }\n\n setPrevFrameValue(prevFrameValue: V | undefined = this.current) {\n this.prevFrameValue = prevFrameValue\n this.prevUpdatedAt = this.updatedAt\n }\n\n /**\n * Adds a function that will be notified when the `MotionValue` is updated.\n *\n * It returns a function that, when called, will cancel the subscription.\n *\n * When calling `onChange` inside a React component, it should be wrapped with the\n * `useEffect` hook. As it returns an unsubscribe function, this should be returned\n * from the `useEffect` function to ensure you don't add duplicate subscribers..\n *\n * ```jsx\n * export const MyComponent = () => {\n * const x = useMotionValue(0)\n * const y = useMotionValue(0)\n * const opacity = useMotionValue(1)\n *\n * useEffect(() => {\n * function updateOpacity() {\n * const maxXY = Math.max(x.get(), y.get())\n * const newOpacity = transform(maxXY, [0, 100], [1, 0])\n * opacity.set(newOpacity)\n * }\n *\n * const unsubscribeX = x.on(\"change\", updateOpacity)\n * const unsubscribeY = y.on(\"change\", updateOpacity)\n *\n * return () => {\n * unsubscribeX()\n * unsubscribeY()\n * }\n * }, [])\n *\n * return \n * }\n * ```\n *\n * @param subscriber - A function that receives the latest value.\n * @returns A function that, when called, will cancel this subscription.\n *\n * @deprecated\n */\n onChange(subscription: Subscriber): () => void {\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(\n false,\n `value.onChange(callback) is deprecated. Switch to value.on(\"change\", callback).`\n )\n }\n return this.on(\"change\", subscription)\n }\n\n /**\n * An object containing a SubscriptionManager for each active event.\n */\n private events: {\n [key: string]: SubscriptionManager\n } = {}\n\n on>(\n eventName: EventName,\n callback: MotionValueEventCallbacks[EventName]\n ) {\n if (!this.events[eventName]) {\n this.events[eventName] = new SubscriptionManager()\n }\n\n const unsubscribe = this.events[eventName].add(callback)\n\n if (eventName === \"change\") {\n return () => {\n unsubscribe()\n\n /**\n * If we have no more change listeners by the start\n * of the next frame, stop active animations.\n */\n frame.read(() => {\n if (!this.events.change.getSize()) {\n this.stop()\n }\n })\n }\n }\n\n return unsubscribe\n }\n\n clearListeners() {\n for (const eventManagers in this.events) {\n this.events[eventManagers].clear()\n }\n }\n\n /**\n * Attaches a passive effect to the `MotionValue`.\n */\n attach(passiveEffect: PassiveEffect, stopPassiveEffect: VoidFunction) {\n this.passiveEffect = passiveEffect\n this.stopPassiveEffect = stopPassiveEffect\n }\n\n /**\n * Sets the state of the `MotionValue`.\n *\n * @remarks\n *\n * ```jsx\n * const x = useMotionValue(0)\n * x.set(10)\n * ```\n *\n * @param latest - Latest value to set.\n * @param render - Whether to notify render subscribers. Defaults to `true`\n *\n * @public\n */\n set(v: V) {\n if (!this.passiveEffect) {\n this.updateAndNotify(v)\n } else {\n this.passiveEffect(v, this.updateAndNotify)\n }\n }\n\n setWithVelocity(prev: V, current: V, delta: number) {\n this.set(current)\n this.prev = undefined\n this.prevFrameValue = prev\n this.prevUpdatedAt = this.updatedAt - delta\n }\n\n /**\n * Set the state of the `MotionValue`, stopping any active animations,\n * effects, and resets velocity to `0`.\n */\n jump(v: V, endAnimation = true) {\n this.updateAndNotify(v)\n this.prev = v\n this.prevUpdatedAt = this.prevFrameValue = undefined\n endAnimation && this.stop()\n if (this.stopPassiveEffect) this.stopPassiveEffect()\n }\n\n dirty() {\n this.events.change?.notify(this.current)\n }\n\n addDependent(dependent: MotionValue) {\n if (!this.dependents) {\n this.dependents = new Set()\n }\n this.dependents.add(dependent)\n }\n\n removeDependent(dependent: MotionValue) {\n if (this.dependents) {\n this.dependents.delete(dependent)\n }\n }\n\n updateAndNotify = (v: V) => {\n const currentTime = time.now()\n\n /**\n * If we're updating the value during another frame or eventloop\n * than the previous frame, then the we set the previous frame value\n * to current.\n */\n if (this.updatedAt !== currentTime) {\n this.setPrevFrameValue()\n }\n\n this.prev = this.current\n\n this.setCurrent(v)\n\n // Update update subscribers\n if (this.current !== this.prev) {\n this.events.change?.notify(this.current)\n\n if (this.dependents) {\n for (const dependent of this.dependents) {\n dependent.dirty()\n }\n }\n }\n }\n\n /**\n * Returns the latest state of `MotionValue`\n *\n * @returns - The latest state of `MotionValue`\n *\n * @public\n */\n get() {\n if (collectMotionValues.current) {\n collectMotionValues.current.push(this)\n }\n\n return this.current!\n }\n\n /**\n * @public\n */\n getPrevious() {\n return this.prev\n }\n\n /**\n * Returns the latest velocity of `MotionValue`\n *\n * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical.\n *\n * @public\n */\n getVelocity() {\n const currentTime = time.now()\n\n if (\n !this.canTrackVelocity ||\n this.prevFrameValue === undefined ||\n currentTime - this.updatedAt > MAX_VELOCITY_DELTA\n ) {\n return 0\n }\n\n const delta = Math.min(\n this.updatedAt - this.prevUpdatedAt!,\n MAX_VELOCITY_DELTA\n )\n\n // Casts because of parseFloat's poor typing\n return velocityPerSecond(\n parseFloat(this.current as any) -\n parseFloat(this.prevFrameValue as any),\n delta\n )\n }\n\n hasAnimated = false\n\n /**\n * Registers a new animation to control this `MotionValue`. Only one\n * animation can drive a `MotionValue` at one time.\n *\n * ```jsx\n * value.start()\n * ```\n *\n * @param animation - A function that starts the provided animation\n */\n start(startAnimation: StartAnimation) {\n this.stop()\n\n return new Promise((resolve) => {\n this.hasAnimated = true\n this.animation = startAnimation(resolve)\n\n if (this.events.animationStart) {\n this.events.animationStart.notify()\n }\n }).then(() => {\n if (this.events.animationComplete) {\n this.events.animationComplete.notify()\n }\n this.clearAnimation()\n })\n }\n\n /**\n * Stop the currently active animation.\n *\n * @public\n */\n stop() {\n if (this.animation) {\n this.animation.stop()\n if (this.events.animationCancel) {\n this.events.animationCancel.notify()\n }\n }\n this.clearAnimation()\n }\n\n /**\n * Returns `true` if this value is currently animating.\n *\n * @public\n */\n isAnimating() {\n return !!this.animation\n }\n\n private clearAnimation() {\n delete this.animation\n }\n\n /**\n * Destroy and clean up subscribers to this `MotionValue`.\n *\n * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically\n * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually\n * created a `MotionValue` via the `motionValue` function.\n *\n * @public\n */\n destroy() {\n this.dependents?.clear()\n this.events.destroy?.notify()\n this.clearListeners()\n this.stop()\n\n if (this.stopPassiveEffect) {\n this.stopPassiveEffect()\n }\n }\n}\n\nexport function motionValue(init: V, options?: MotionValueOptions) {\n return new MotionValue(init, options)\n}\n","/**\n * If `transition` has `inherit: true`, shallow-merge it with\n * `parentTransition` (child keys win) and strip the `inherit` key.\n * Otherwise return `transition` unchanged.\n */\nexport function resolveTransition(\n transition: any,\n parentTransition?: any\n) {\n if (transition?.inherit && parentTransition) {\n const { inherit: _, ...rest } = transition\n return { ...parentTransition, ...rest }\n }\n\n return transition\n}\n","import { resolveTransition } from \"./resolve-transition\"\n\nexport function getValueTransition(transition: any, key: string) {\n const valueTransition =\n transition?.[key as keyof typeof transition] ??\n transition?.[\"default\"] ??\n transition\n\n if (valueTransition !== transition) {\n return resolveTransition(valueTransition, transition)\n }\n\n return valueTransition\n}\n","import { transformProps } from \"../../render/utils/keys-transform\"\nimport type { ValueAnimationOptions } from \"../types\"\n\nconst underDampedSpring: Partial = {\n type: \"spring\",\n stiffness: 500,\n damping: 25,\n restSpeed: 10,\n}\n\nconst criticallyDampedSpring = (\n target: unknown\n): Partial => ({\n type: \"spring\",\n stiffness: 550,\n damping: target === 0 ? 2 * Math.sqrt(550) : 30,\n restSpeed: 10,\n})\n\nconst keyframesTransition: Partial = {\n type: \"keyframes\",\n duration: 0.8,\n}\n\n/**\n * Default easing curve is a slightly shallower version of\n * the default browser easing curve.\n */\nconst ease: Partial = {\n type: \"keyframes\",\n ease: [0.25, 0.1, 0.35, 1],\n duration: 0.3,\n}\n\nexport const getDefaultTransition = (\n valueKey: string,\n { keyframes }: ValueAnimationOptions\n): Partial => {\n if (keyframes.length > 2) {\n return keyframesTransition\n } else if (transformProps.has(valueKey)) {\n return valueKey.startsWith(\"scale\")\n ? criticallyDampedSpring(keyframes[1])\n : underDampedSpring\n }\n\n return ease\n}\n","import type { AnyResolvedKeyframe } from \"../types\"\nimport type { Transition } from \"../types\"\n\nconst orchestrationKeys = new Set([\n \"when\",\n \"delay\",\n \"delayChildren\",\n \"staggerChildren\",\n \"staggerDirection\",\n \"repeat\",\n \"repeatType\",\n \"repeatDelay\",\n \"from\",\n \"elapsed\",\n])\n\n/**\n * Decide whether a transition is defined on a given Transition.\n * This filters out orchestration options and returns true\n * if any options are left.\n */\nexport function isTransitionDefined(\n transition: Transition & { elapsed?: number; from?: AnyResolvedKeyframe }\n) {\n for (const key in transition) {\n if (!orchestrationKeys.has(key)) return true\n }\n return false\n}\n","import { MotionGlobalConfig, secondsToMilliseconds } from \"motion-utils\"\nimport { AsyncMotionValueAnimation } from \"../AsyncMotionValueAnimation\"\nimport { JSAnimation } from \"../JSAnimation\"\nimport type {\n AnyResolvedKeyframe,\n ValueAnimationOptions,\n ValueTransition,\n} from \"../types\"\nimport type { UnresolvedKeyframes } from \"../keyframes/KeyframesResolver\"\nimport { getValueTransition } from \"../utils/get-value-transition\"\nimport { makeAnimationInstant } from \"../utils/make-animation-instant\"\nimport { getDefaultTransition } from \"../utils/default-transitions\"\nimport { getFinalKeyframe } from \"../keyframes/get-final\"\nimport { isTransitionDefined } from \"../utils/is-transition-defined\"\nimport { frame } from \"../../frameloop\"\nimport type { MotionValue, StartAnimation } from \"../../value\"\nimport type { VisualElement } from \"../../render/VisualElement\"\n\nexport const animateMotionValue =\n (\n name: string,\n value: MotionValue,\n target: V | UnresolvedKeyframes,\n transition: ValueTransition & { elapsed?: number } = {},\n element?: VisualElement,\n isHandoff?: boolean\n ): StartAnimation =>\n (onComplete) => {\n const valueTransition = getValueTransition(transition, name) || {}\n\n /**\n * Most transition values are currently completely overwritten by value-specific\n * transitions. In the future it'd be nicer to blend these transitions. But for now\n * delay actually does inherit from the root transition if not value-specific.\n */\n const delay = valueTransition.delay || transition.delay || 0\n\n /**\n * Elapsed isn't a public transition option but can be passed through from\n * optimized appear effects in milliseconds.\n */\n let { elapsed = 0 } = transition\n elapsed = elapsed - secondsToMilliseconds(delay)\n\n const options: ValueAnimationOptions = {\n keyframes: Array.isArray(target) ? target : [null, target],\n ease: \"easeOut\",\n velocity: value.getVelocity(),\n ...valueTransition,\n delay: -elapsed,\n onUpdate: (v) => {\n value.set(v)\n valueTransition.onUpdate && valueTransition.onUpdate(v)\n },\n onComplete: () => {\n onComplete()\n valueTransition.onComplete && valueTransition.onComplete()\n },\n name,\n motionValue: value,\n element: isHandoff ? undefined : element,\n }\n\n /**\n * If there's no transition defined for this value, we can generate\n * unique transition settings for this value.\n */\n if (!isTransitionDefined(valueTransition)) {\n Object.assign(options, getDefaultTransition(name, options))\n }\n\n /**\n * Both WAAPI and our internal animation functions use durations\n * as defined by milliseconds, while our external API defines them\n * as seconds.\n */\n options.duration &&= secondsToMilliseconds(options.duration)\n options.repeatDelay &&= secondsToMilliseconds(options.repeatDelay)\n\n /**\n * Support deprecated way to set initial value. Prefer keyframe syntax.\n */\n if (options.from !== undefined) {\n options.keyframes[0] = options.from as any\n }\n\n let shouldSkip = false\n\n if (\n (options as any).type === false ||\n (options.duration === 0 && !options.repeatDelay)\n ) {\n makeAnimationInstant(options)\n\n if (options.delay === 0) {\n shouldSkip = true\n }\n }\n\n if (\n MotionGlobalConfig.instantAnimations ||\n MotionGlobalConfig.skipAnimations ||\n element?.shouldSkipAnimations ||\n valueTransition.skipAnimations\n ) {\n shouldSkip = true\n makeAnimationInstant(options)\n options.delay = 0\n }\n\n /**\n * If the transition type or easing has been explicitly set by the user\n * then we don't want to allow flattening the animation.\n */\n options.allowFlatten = !valueTransition.type && !valueTransition.ease\n\n /**\n * If we can or must skip creating the animation, and apply only\n * the final keyframe, do so. We also check once keyframes are resolved but\n * this early check prevents the need to create an animation at all.\n */\n if (shouldSkip && !isHandoff && value.get() !== undefined) {\n const finalKeyframe = getFinalKeyframe(\n options.keyframes as V[],\n valueTransition\n )\n\n if (finalKeyframe !== undefined) {\n frame.update(() => {\n options.onUpdate!(finalKeyframe)\n options.onComplete!()\n })\n\n return\n }\n }\n\n return valueTransition.isSync\n ? new JSAnimation(options)\n : new AsyncMotionValueAnimation(options)\n }\n","import { wrap } from \"motion-utils\"\nimport { motionValue } from \"../../value\"\nimport { animateMotionValue } from \"../interfaces/motion-value\"\nimport type { MotionPath, PathInterpolator, Point2D } from \"../types\"\nimport { getValueTransition } from \"./get-value-transition\"\n\nexport interface ArcOptions {\n /**\n * How far the arc bulges perpendicular to the straight-line path,\n * as a fraction of the total distance. A value of `1` means the arc\n * peaks at a height equal to the full travel distance. Default `0.5`.\n */\n strength?: number\n /**\n * Where along the path (0–1) the arc reaches its maximum height.\n * Default `0.5` (symmetric).\n */\n peak?: number\n /**\n * Which side the arc bulges toward.\n * - `\"cw\"` / `\"ccw\"` — locked relative to direction of travel\n * - unset — auto-pick a stable screen-space side\n */\n direction?: \"cw\" | \"ccw\"\n /**\n * Rotates the element to follow the tangent of the arc path.\n * - `true` — full tangent following (1.0)\n * - number 0–1 — scale factor\n */\n rotate?: boolean | number\n}\n\nconst MIN_LAYOUT_DISTANCE = 20\n\nfunction bezierPoint(\n t: number,\n origin: number,\n control: number,\n target: number\n): number {\n const inv = 1 - t\n return inv * inv * origin + 2 * inv * t * control + t * t * target\n}\n\nfunction bezierTangentAngle(\n t: number,\n originX: number,\n controlX: number,\n targetX: number,\n originY: number,\n controlY: number,\n targetY: number\n): number {\n const dx =\n 2 * (1 - t) * (controlX - originX) + 2 * t * (targetX - controlX)\n const dy =\n 2 * (1 - t) * (controlY - originY) + 2 * t * (targetY - controlY)\n return Math.atan2(dy, dx) * (180 / Math.PI)\n}\n\nfunction computeArcControlPoint(\n fromX: number,\n fromY: number,\n toX: number,\n toY: number,\n strength: number,\n peak: number\n): { x: number; y: number } {\n const deltaX = toX - fromX\n const deltaY = toY - fromY\n const distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY)\n\n if (distance > 0) {\n const normalPerpX = -deltaY / distance\n const normalPerpY = deltaX / distance\n const desiredHeight = strength * distance\n\n return {\n x: fromX + deltaX * peak + normalPerpX * desiredHeight,\n y: fromY + deltaY * peak + normalPerpY * desiredHeight,\n }\n }\n\n return { x: fromX, y: fromY }\n}\n\n/**\n * The pure sampling factory: `(from, to) => (t) => point`. Internal —\n * used by {@link arc} and the unit tests. Not part of the public surface.\n */\nexport function createArcPath({\n strength = 0.5,\n peak = 0.5,\n direction,\n rotate = false,\n}: ArcOptions = {}): (from: Point2D, to: Point2D) => PathInterpolator {\n const rotationScale =\n rotate === true ? 1 : typeof rotate === \"number\" ? rotate : 0\n\n // Auto-direction only: persists across calls to flip the bulge back\n // onto the same screen side when the dominant axis changes between\n // calls. Reuse the factory (module scope / useMemo) to keep this alive.\n let prevBulgeSign: number | undefined\n\n const createInterpolator = (\n from: Point2D,\n to: Point2D\n ): PathInterpolator => {\n const dx = to.x - from.x\n const dy = to.y - from.y\n\n let signed: number\n if (direction === \"cw\") {\n signed = -strength\n } else if (direction === \"ccw\") {\n signed = strength\n } else {\n const dom = Math.abs(dx) >= Math.abs(dy) ? dx : dy\n signed = dom < 0 ? -strength : strength\n }\n\n let control = computeArcControlPoint(\n from.x,\n from.y,\n to.x,\n to.y,\n signed,\n peak\n )\n\n if (direction === undefined) {\n const isVertical = Math.abs(dx) < Math.abs(dy)\n const midX = from.x + dx * peak\n const midY = from.y + dy * peak\n const bulgeSign = isVertical\n ? Math.sign(control.x - midX)\n : Math.sign(control.y - midY)\n\n if (\n prevBulgeSign !== undefined &&\n bulgeSign !== 0 &&\n bulgeSign !== prevBulgeSign\n ) {\n signed = -signed\n control = computeArcControlPoint(\n from.x,\n from.y,\n to.x,\n to.y,\n signed,\n peak\n )\n } else if (bulgeSign !== 0) {\n prevBulgeSign = bulgeSign\n }\n }\n\n const tangent0 = rotationScale\n ? bezierTangentAngle(\n 0,\n from.x,\n control.x,\n to.x,\n from.y,\n control.y,\n to.y\n )\n : 0\n const tangent1 = rotationScale\n ? bezierTangentAngle(\n 1,\n from.x,\n control.x,\n to.x,\n from.y,\n control.y,\n to.y\n )\n : 0\n const tangentDelta = rotationScale\n ? wrap(-180, 180, tangent1 - tangent0)\n : 0\n\n return (t: number) => {\n const out: { x: number; y: number; rotate?: number } = {\n x: bezierPoint(t, from.x, control.x, to.x),\n y: bezierPoint(t, from.y, control.y, to.y),\n }\n if (rotationScale) {\n const raw = bezierTangentAngle(\n t,\n from.x,\n control.x,\n to.x,\n from.y,\n control.y,\n to.y\n )\n const baseline = tangent0 + tangentDelta * t\n out.rotate = wrap(-180, 180, raw - baseline) * rotationScale\n }\n return out\n }\n }\n\n return createInterpolator\n}\n\n/**\n * Creates a curved path for `transition.path`:\n *\n * ```ts\n * \n * ```\n *\n * Reuse the returned value (module scope / useMemo / useRef) so its\n * continuity closure survives re-renders — a fresh `arc()` has no memory.\n */\nexport function arc(options: ArcOptions = {}): MotionPath {\n const sample = createArcPath(options)\n\n const path: MotionPath = {\n interpolateProjection(delta) {\n // `from` is the current translate offset (carries any in-flight\n // displacement when interrupted); `to` is the new layout origin.\n // The distance floor avoids visible wobble on tiny shifts.\n const tx = delta.x.translate\n const ty = delta.y.translate\n if (Math.sqrt(tx * tx + ty * ty) < MIN_LAYOUT_DISTANCE) {\n return undefined\n }\n return sample({ x: tx, y: ty }, { x: 0, y: 0 })\n },\n\n animateVisualElement(\n visualElement,\n target,\n transition,\n delay,\n animations\n ) {\n if (!(\"x\" in target || \"y\" in target)) return\n\n const xValue = visualElement.getValue(\n \"x\",\n visualElement.latestValues[\"x\"] ?? 0\n )\n const yValue = visualElement.getValue(\n \"y\",\n visualElement.latestValues[\"y\"] ?? 0\n )\n\n const xRaw = target.x as number | number[] | undefined\n const yRaw = target.y as number | number[] | undefined\n\n const xFrom = ((Array.isArray(xRaw) && xRaw[0] != null\n ? xRaw[0]\n : xValue?.get()) as number) ?? 0\n const yFrom = ((Array.isArray(yRaw) && yRaw[0] != null\n ? yRaw[0]\n : yValue?.get()) as number) ?? 0\n const xTo = (Array.isArray(xRaw)\n ? xRaw[xRaw.length - 1]\n : xRaw ?? xFrom) as number\n const yTo = (Array.isArray(yRaw)\n ? yRaw[yRaw.length - 1]\n : yRaw ?? yFrom) as number\n\n // Interruption needs no flag: x/y already hold the displaced\n // mid-arc position, so xFrom/yFrom carry the continuity geometry.\n const interpolate = sample(\n { x: xFrom, y: yFrom },\n { x: xTo, y: yTo }\n )\n\n // Drive a dedicated `pathRotation` value (composed onto `rotate`\n // at the build sites) rather than `rotate` itself, so a\n // concurrent rotate animation composes and nothing accumulates\n // on interrupt.\n const pathRotationValue =\n interpolate(0).rotate !== undefined\n ? visualElement.getValue(\"pathRotation\", 0)\n : undefined\n\n const pathTransition = {\n delay,\n ...getValueTransition(transition || {}, \"x\"),\n }\n delete (pathTransition as { path?: unknown }).path\n\n const progress = motionValue(0)\n progress.start(\n animateMotionValue(\"\", progress, [0, 1000] as any, {\n ...pathTransition,\n isSync: true,\n velocity: 0,\n onUpdate: (latest: number) => {\n const point = interpolate(latest / 1000)\n xValue?.set(point.x)\n yValue?.set(point.y)\n if (pathRotationValue && point.rotate !== undefined) {\n pathRotationValue.set(point.rotate)\n }\n },\n onComplete: () => {\n xValue?.set(xTo)\n yValue?.set(yTo)\n pathRotationValue?.set(0)\n },\n // Interrupt/cancel must clear our additive contribution\n // so it can't linger on top of the user's `rotate`.\n onStop: () => pathRotationValue?.set(0),\n onCancel: () => pathRotationValue?.set(0),\n })\n )\n\n if (progress.animation) animations.push(progress.animation)\n\n delete (target as { x?: unknown }).x\n delete (target as { y?: unknown }).y\n },\n }\n\n return path\n}\n","import { invariant, isNumericalString } from \"motion-utils\"\nimport { AnyResolvedKeyframe } from \"../types\"\nimport { CSSVariableToken, isCSSVariableToken } from \"./is-css-variable\"\n\n/**\n * Parse Framer's special CSS variable format into a CSS token and a fallback.\n *\n * ```\n * `var(--foo, #fff)` => [`--foo`, '#fff']\n * ```\n *\n * @param current\n */\n\nconst splitCSSVariableRegex =\n // eslint-disable-next-line redos-detector/no-unsafe-regex -- false positive, as it can match a lot of words\n /^var\\(--(?:([\\w-]+)|([\\w-]+), ?([a-zA-Z\\d ()%#.,-]+))\\)/u\nexport function parseCSSVariable(current: string) {\n const match = splitCSSVariableRegex.exec(current)\n if (!match) return [,]\n\n const [, token1, token2, fallback] = match\n return [`--${token1 ?? token2}`, fallback]\n}\n\nconst maxDepth = 4\nexport function getVariableValue(\n current: CSSVariableToken,\n element: Element,\n depth = 1\n): AnyResolvedKeyframe | undefined {\n invariant(\n depth <= maxDepth,\n `Max CSS variable fallback depth detected in property \"${current}\". This may indicate a circular fallback dependency.`,\n \"max-css-var-depth\"\n )\n\n const [token, fallback] = parseCSSVariable(current)\n\n // No CSS variable detected\n if (!token) return\n\n // Attempt to read this CSS variable off the element\n const resolved = window.getComputedStyle(element).getPropertyValue(token)\n\n if (resolved) {\n const trimmed = resolved.trim()\n return isNumericalString(trimmed) ? parseFloat(trimmed) : trimmed\n }\n\n return isCSSVariableToken(fallback)\n ? getVariableValue(fallback, element, depth + 1)\n : fallback\n}\n","import type {\n AnimationDefinition,\n MotionNodeOptions,\n TargetAndTransition,\n TargetResolver,\n} from \"../../node/types\"\nimport type { ResolvedValues } from \"../types\"\n\nfunction getValueState(visualElement?: any): [ResolvedValues, ResolvedValues] {\n const state: [ResolvedValues, ResolvedValues] = [{}, {}]\n\n visualElement?.values.forEach((value: any, key: string) => {\n state[0][key] = value.get()\n state[1][key] = value.getVelocity()\n })\n\n return state\n}\n\nexport function resolveVariantFromProps(\n props: MotionNodeOptions,\n definition: TargetAndTransition | TargetResolver,\n custom?: any,\n visualElement?: any\n): TargetAndTransition\nexport function resolveVariantFromProps(\n props: MotionNodeOptions,\n definition?: AnimationDefinition,\n custom?: any,\n visualElement?: any\n): undefined | TargetAndTransition\nexport function resolveVariantFromProps(\n props: MotionNodeOptions,\n definition?: AnimationDefinition,\n custom?: any,\n visualElement?: any\n) {\n /**\n * If the variant definition is a function, resolve.\n */\n if (typeof definition === \"function\") {\n const [current, velocity] = getValueState(visualElement)\n definition = definition(\n custom !== undefined ? custom : props.custom,\n current,\n velocity\n )\n }\n\n /**\n * If the variant definition is a variant label, or\n * the function returned a variant label, resolve.\n */\n if (typeof definition === \"string\") {\n definition = props.variants && props.variants[definition]\n }\n\n /**\n * At this point we've resolved both functions and variant labels,\n * but the resolved variant label might itself have been a function.\n * If so, resolve. This can only have returned a valid target object.\n */\n if (typeof definition === \"function\") {\n const [current, velocity] = getValueState(visualElement)\n definition = definition(\n custom !== undefined ? custom : props.custom,\n current,\n velocity\n )\n }\n\n return definition\n}\n","import type {\n AnimationDefinition,\n TargetAndTransition,\n TargetResolver,\n} from \"../../node/types\"\nimport { resolveVariantFromProps } from \"./resolve-variants\"\n\n/**\n * Resolves a variant if it's a variant resolver.\n * Uses `any` type for visualElement to avoid circular dependencies.\n */\nexport function resolveVariant(\n visualElement: any,\n definition?: TargetAndTransition | TargetResolver,\n custom?: any\n): TargetAndTransition\nexport function resolveVariant(\n visualElement: any,\n definition?: AnimationDefinition,\n custom?: any\n): TargetAndTransition | undefined\nexport function resolveVariant(\n visualElement: any,\n definition?: AnimationDefinition,\n custom?: any\n) {\n const props = visualElement.getProps()\n return resolveVariantFromProps(\n props,\n definition,\n custom !== undefined ? custom : props.custom,\n visualElement\n )\n}\n","import { transformPropOrder } from \"./keys-transform\"\n\nexport const positionalKeys = new Set([\n \"width\",\n \"height\",\n \"top\",\n \"left\",\n \"right\",\n \"bottom\",\n ...transformPropOrder,\n])\n","import type { UnresolvedValueKeyframe, ValueKeyframesDefinition } from \"../../animation/types\"\n\nexport const isKeyframesTarget = (\n v: ValueKeyframesDefinition\n): v is UnresolvedValueKeyframe[] => {\n return Array.isArray(v)\n}\n","import { motionValue } from \"../../value\"\nimport { resolveVariant } from \"./resolve-dynamic-variants\"\nimport { isKeyframesTarget } from \"./is-keyframes-target\"\nimport type { AnimationDefinition } from \"../../node/types\"\nimport type {\n AnyResolvedKeyframe,\n UnresolvedValueKeyframe,\n ValueKeyframesDefinition,\n} from \"../../animation/types\"\nimport type { VisualElement } from \"../VisualElement\"\n\n/**\n * Set VisualElement's MotionValue, creating a new MotionValue for it if\n * it doesn't exist.\n */\nfunction setMotionValue(\n visualElement: VisualElement,\n key: string,\n value: AnyResolvedKeyframe\n) {\n if (visualElement.hasValue(key)) {\n visualElement.getValue(key)!.set(value)\n } else {\n visualElement.addValue(key, motionValue(value))\n }\n}\n\nfunction resolveFinalValueInKeyframes(\n v: ValueKeyframesDefinition\n): UnresolvedValueKeyframe {\n // TODO maybe throw if v.length - 1 is placeholder token?\n return isKeyframesTarget(v) ? v[v.length - 1] || 0 : v\n}\n\nexport function setTarget(\n visualElement: VisualElement,\n definition: AnimationDefinition\n) {\n const resolved = resolveVariant(visualElement, definition)\n let { transitionEnd = {}, transition = {}, ...target } = resolved || {}\n\n target = { ...target, ...transitionEnd }\n\n for (const key in target) {\n const value = resolveFinalValueInKeyframes(\n target[key as keyof typeof target] as any\n )\n setMotionValue(visualElement, key, value as AnyResolvedKeyframe)\n }\n}\n","import type { MotionValue } from \"..\"\n\nexport const isMotionValue = (value: any): value is MotionValue =>\n Boolean(value && value.getVelocity)\n","import { isMotionValue } from \"../utils/is-motion-value\"\nimport type { WillChange } from \"./types\"\n\nexport function isWillChangeMotionValue(value: any): value is WillChange {\n return Boolean(isMotionValue(value) && (value as WillChange).add)\n}\n","import { MotionGlobalConfig } from \"motion-utils\"\nimport type { VisualElement } from \"../../render/VisualElement\"\nimport { isWillChangeMotionValue } from \"./is\"\n\nexport function addValueToWillChange(\n visualElement: VisualElement,\n key: string\n) {\n const willChange = visualElement.getValue(\"willChange\")\n\n /**\n * It could be that a user has set willChange to a regular MotionValue,\n * in which case we can't add the value to it.\n */\n if (isWillChangeMotionValue(willChange)) {\n return willChange.add(key)\n } else if (!willChange && MotionGlobalConfig.WillChange) {\n const newWillChange = new MotionGlobalConfig.WillChange(\"auto\")\n\n visualElement.addValue(\"willChange\", newWillChange)\n newWillChange.add(key)\n }\n}\n","export function camelToDash(str: string): string {\n return str.replace(/([A-Z])/g, (match) => `-${match.toLowerCase()}`)\n}\n","import { camelToDash } from \"../../render/dom/utils/camel-to-dash\"\n\nexport const optimizedAppearDataId = \"framerAppearId\"\n\nexport const optimizedAppearDataAttribute =\n \"data-\" + camelToDash(optimizedAppearDataId) as \"data-framer-appear-id\"\n","import { optimizedAppearDataAttribute } from \"./data-id\"\nimport type { WithAppearProps } from \"./types\"\n\nexport function getOptimisedAppearId(\n visualElement: WithAppearProps\n): string | undefined {\n return visualElement.props[optimizedAppearDataAttribute]\n}\n","import { frame } from \"../../frameloop\"\nimport { getValueTransition } from \"../utils/get-value-transition\"\nimport { resolveTransition } from \"../utils/resolve-transition\"\nimport { positionalKeys } from \"../../render/utils/keys-position\"\nimport { setTarget } from \"../../render/utils/setters\"\nimport { addValueToWillChange } from \"../../value/will-change/add-will-change\"\nimport { getOptimisedAppearId } from \"../optimized-appear/get-appear-id\"\nimport { animateMotionValue } from \"./motion-value\"\nimport type { MotionPath } from \"../types\"\nimport type { VisualElementAnimationOptions } from \"./types\"\nimport type { AnimationPlaybackControlsWithThen } from \"../types\"\nimport type { TargetAndTransition } from \"../../node/types\"\nimport type { AnimationTypeState } from \"../../render/utils/animation-state\"\nimport type { VisualElement } from \"../../render/VisualElement\"\n\n/**\n * Decide whether we should block this animation. Previously, we achieved this\n * just by checking whether the key was listed in protectedKeys, but this\n * posed problems if an animation was triggered by afterChildren and protectedKeys\n * had been set to true in the meantime.\n */\nfunction shouldBlockAnimation(\n { protectedKeys, needsAnimating }: AnimationTypeState,\n key: string\n) {\n const shouldBlock =\n protectedKeys.hasOwnProperty(key) && needsAnimating[key] !== true\n\n needsAnimating[key] = false\n return shouldBlock\n}\n\nexport function animateTarget(\n visualElement: VisualElement,\n targetAndTransition: TargetAndTransition,\n { delay = 0, transitionOverride, type }: VisualElementAnimationOptions = {}\n): AnimationPlaybackControlsWithThen[] {\n let {\n transition,\n transitionEnd,\n ...target\n } = targetAndTransition\n\n const defaultTransition = visualElement.getDefaultTransition()\n transition = transition\n ? resolveTransition(transition, defaultTransition)\n : defaultTransition\n\n const reduceMotion = (transition as { reduceMotion?: boolean })?.reduceMotion\n const skipAnimations = transition?.skipAnimations\n\n if (transitionOverride) transition = transitionOverride\n\n const animations: AnimationPlaybackControlsWithThen[] = []\n\n const animationTypeState =\n type &&\n visualElement.animationState &&\n visualElement.animationState.getState()[type]\n\n const path = (transition as { path?: MotionPath } | undefined)?.path\n if (path) {\n // path mutates `target` to claim x/y; loop below skips them.\n path.animateVisualElement(\n visualElement,\n target,\n transition,\n delay,\n animations\n )\n }\n\n for (const key in target) {\n const value = visualElement.getValue(\n key,\n visualElement.latestValues[key] ?? null\n )\n const valueTarget = target[key as keyof typeof target]\n\n if (\n valueTarget === undefined ||\n (animationTypeState &&\n shouldBlockAnimation(animationTypeState, key))\n ) {\n continue\n }\n\n const valueTransition = {\n delay,\n ...getValueTransition(transition || {}, key),\n }\n\n if (skipAnimations) valueTransition.skipAnimations = true\n\n /**\n * If the value is already at the defined target, skip the animation.\n * We still re-assert the value via frame.update to take precedence\n * over any stale transitionEnd callbacks from previous animations.\n */\n const currentValue = value.get()\n if (\n currentValue !== undefined &&\n !value.isAnimating() &&\n !Array.isArray(valueTarget) &&\n valueTarget === currentValue &&\n !valueTransition.velocity\n ) {\n frame.update(() => value.set(valueTarget as any))\n continue\n }\n\n /**\n * If this is the first time a value is being animated, check\n * to see if we're handling off from an existing animation.\n */\n let isHandoff = false\n if (window.MotionHandoffAnimation) {\n const appearId = getOptimisedAppearId(visualElement)\n\n if (appearId) {\n const startTime = window.MotionHandoffAnimation(\n appearId,\n key,\n frame\n )\n\n if (startTime !== null) {\n valueTransition.startTime = startTime\n isHandoff = true\n }\n }\n }\n\n addValueToWillChange(visualElement, key)\n\n const shouldReduceMotion =\n reduceMotion ?? visualElement.shouldReduceMotion\n\n value.start(\n animateMotionValue(\n key,\n value,\n valueTarget,\n shouldReduceMotion && positionalKeys.has(key)\n ? { type: false }\n : valueTransition,\n visualElement,\n isHandoff\n )\n )\n\n const animation = value.animation\n\n if (animation) {\n animations.push(animation)\n }\n }\n\n if (transitionEnd) {\n const applyTransitionEnd = () =>\n frame.update(() => {\n transitionEnd && setTarget(visualElement, transitionEnd)\n })\n\n if (animations.length) {\n Promise.all(animations).then(applyTransitionEnd)\n } else {\n applyTransitionEnd()\n }\n }\n\n return animations\n}\n","import { resolveVariant } from \"../../render/utils/resolve-dynamic-variants\"\nimport { calcChildStagger } from \"../utils/calc-child-stagger\"\nimport type { VisualElementAnimationOptions } from \"./types\"\nimport { animateTarget } from \"./visual-element-target\"\nimport type { DynamicOption } from \"../types\"\nimport type { VisualElement } from \"../../render/VisualElement\"\n\nexport function animateVariant(\n visualElement: VisualElement,\n variant: string,\n options: VisualElementAnimationOptions = {}\n): Promise {\n const resolved = resolveVariant(\n visualElement,\n variant,\n options.type === \"exit\"\n ? visualElement.presenceContext?.custom\n : undefined\n )\n\n let { transition = visualElement.getDefaultTransition() || {} } =\n resolved || {}\n\n if (options.transitionOverride) {\n transition = options.transitionOverride\n }\n\n /**\n * If we have a variant, create a callback that runs it as an animation.\n * Otherwise, we resolve a Promise immediately for a composable no-op.\n */\n const getAnimation: () => Promise = resolved\n ? () => Promise.all(animateTarget(visualElement, resolved, options))\n : () => Promise.resolve()\n\n /**\n * If we have children, create a callback that runs all their animations.\n * Otherwise, we resolve a Promise immediately for a composable no-op.\n */\n const getChildAnimations =\n visualElement.variantChildren && visualElement.variantChildren.size\n ? (forwardDelay = 0) => {\n const {\n delayChildren = 0,\n staggerChildren,\n staggerDirection,\n } = transition\n\n return animateChildren(\n visualElement,\n variant,\n forwardDelay,\n delayChildren,\n staggerChildren,\n staggerDirection,\n options\n )\n }\n : () => Promise.resolve()\n\n /**\n * If the transition explicitly defines a \"when\" option, we need to resolve either\n * this animation or all children animations before playing the other.\n */\n const { when } = transition\n if (when) {\n const [first, last] =\n when === \"beforeChildren\"\n ? [getAnimation, getChildAnimations]\n : [getChildAnimations, getAnimation]\n\n return first().then(() => last())\n } else {\n return Promise.all([getAnimation(), getChildAnimations(options.delay)])\n }\n}\n\nfunction animateChildren(\n visualElement: VisualElement,\n variant: string,\n delay: number = 0,\n delayChildren: number | DynamicOption = 0,\n staggerChildren = 0,\n staggerDirection = 1,\n options: VisualElementAnimationOptions\n) {\n const animations: Promise[] = []\n\n for (const child of visualElement.variantChildren!) {\n child.notify(\"AnimationStart\", variant)\n animations.push(\n animateVariant(child, variant, {\n ...options,\n delay:\n delay +\n (typeof delayChildren === \"function\" ? 0 : delayChildren) +\n calcChildStagger(\n visualElement.variantChildren!,\n child,\n delayChildren,\n staggerChildren,\n staggerDirection\n ),\n }).then(() => child.notify(\"AnimationComplete\", variant))\n )\n }\n\n return Promise.all(animations)\n}\n","import { resolveVariant } from \"../../render/utils/resolve-dynamic-variants\"\nimport type { AnimationDefinition } from \"../../node/types\"\nimport type { VisualElement } from \"../../render/VisualElement\"\nimport type { VisualElementAnimationOptions } from \"./types\"\nimport { animateTarget } from \"./visual-element-target\"\nimport { animateVariant } from \"./visual-element-variant\"\n\nexport function animateVisualElement(\n visualElement: VisualElement,\n definition: AnimationDefinition,\n options: VisualElementAnimationOptions = {}\n) {\n visualElement.notify(\"AnimationStart\", definition)\n let animation: Promise\n\n if (Array.isArray(definition)) {\n const animations = definition.map((variant) =>\n animateVariant(visualElement, variant, options)\n )\n animation = Promise.all(animations)\n } else if (typeof definition === \"string\") {\n animation = animateVariant(visualElement, definition, options)\n } else {\n const resolvedDefinition =\n typeof definition === \"function\"\n ? resolveVariant(visualElement, definition, options.custom)\n : definition\n\n animation = Promise.all(\n animateTarget(visualElement, resolvedDefinition, options)\n )\n }\n\n return animation.then(() => {\n visualElement.notify(\"AnimationComplete\", definition)\n })\n}\n","import { ValueType } from \"./types\"\n\n/**\n * ValueType for \"auto\"\n */\nexport const auto: ValueType = {\n test: (v: any) => v === \"auto\",\n parse: (v) => v,\n}\n","import { ValueType } from \"./types\"\n\n/**\n * Tests a provided value against a ValueType\n */\nexport const testValueType = (v: any) => (type: ValueType) => type.test(v)\n","import { auto } from \"./auto\"\nimport { number } from \"./numbers\"\nimport { degrees, percent, px, vh, vw } from \"./numbers/units\"\nimport { testValueType } from \"./test\"\n\n/**\n * A list of value types commonly used for dimensions\n */\nexport const dimensionValueTypes = [number, px, percent, degrees, vw, vh, auto]\n\n/**\n * Tests a dimensional value against the list of dimension ValueTypes\n */\nexport const findDimensionValueType = (v: any) =>\n dimensionValueTypes.find(testValueType(v))\n","import { isZeroValueString } from \"motion-utils\"\nimport { AnyResolvedKeyframe } from \"../../types\"\n\nexport function isNone(value: AnyResolvedKeyframe | null) {\n if (typeof value === \"number\") {\n return value === 0\n } else if (value !== null) {\n return value === \"none\" || value === \"0\" || isZeroValueString(value)\n } else {\n return true\n }\n}\n","import { complex } from \".\"\nimport { floatRegex } from \"../utils/float-regex\"\n\n/**\n * Properties that should default to 1 or 100%\n */\nconst maxDefaults = new Set([\"brightness\", \"contrast\", \"saturate\", \"opacity\"])\n\nfunction applyDefaultFilter(v: string) {\n const [name, value] = v.slice(0, -1).split(\"(\")\n\n if (name === \"drop-shadow\") return v\n\n const [number] = value.match(floatRegex) || []\n if (!number) return v\n\n const unit = value.replace(number, \"\")\n let defaultValue = maxDefaults.has(name) ? 1 : 0\n if (number !== value) defaultValue *= 100\n\n return name + \"(\" + defaultValue + unit + \")\"\n}\n\nconst functionRegex = /\\b([a-z-]*)\\(.*?\\)/gu\n\nexport const filter = {\n ...complex,\n getAnimatableNone: (v: string) => {\n const functions = v.match(functionRegex)\n return functions ? functions.map(applyDefaultFilter).join(\" \") : v\n },\n}\n","import { complex } from \".\"\nimport { AnyResolvedKeyframe } from \"../../../animation/types\"\n\nexport const mask = {\n ...complex,\n getAnimatableNone: (v: AnyResolvedKeyframe) => {\n const parsed = complex.parse(v)\n const transformer = complex.createTransformer(v)\n return transformer(\n parsed.map((v) =>\n typeof v === \"number\" ? 0 : typeof v === \"object\" ? { ...v, alpha: 1 } : v\n )\n )\n },\n}\n","import { number } from \"./numbers\"\n\nexport const int = {\n ...number,\n transform: Math.round,\n}\n","import { alpha, scale } from \"../numbers\"\nimport { degrees, progressPercentage, px } from \"../numbers/units\"\nimport { ValueTypeMap } from \"./types\"\n\nexport const transformValueTypes: ValueTypeMap = {\n rotate: degrees,\n /**\n * Internal channel for `transition.path` orientToPath. Composed onto\n * `rotate` at the transform-build sites so the user's `rotate` is\n * never read or overwritten. Not part of `transformPropOrder`.\n */\n pathRotation: degrees,\n rotateX: degrees,\n rotateY: degrees,\n rotateZ: degrees,\n scale,\n scaleX: scale,\n scaleY: scale,\n scaleZ: scale,\n skew: degrees,\n skewX: degrees,\n skewY: degrees,\n distance: px,\n translateX: px,\n translateY: px,\n translateZ: px,\n x: px,\n y: px,\n z: px,\n perspective: px,\n transformPerspective: px,\n opacity: alpha,\n originX: progressPercentage,\n originY: progressPercentage,\n originZ: px,\n}\n","import { int } from \"../int\"\nimport { alpha } from \"../numbers\"\nimport { px } from \"../numbers/units\"\nimport { transformValueTypes } from \"./transform\"\nimport { ValueTypeMap } from \"./types\"\n\nexport const numberValueTypes: ValueTypeMap = {\n // Border props\n borderWidth: px,\n borderTopWidth: px,\n borderRightWidth: px,\n borderBottomWidth: px,\n borderLeftWidth: px,\n borderRadius: px,\n borderTopLeftRadius: px,\n borderTopRightRadius: px,\n borderBottomRightRadius: px,\n borderBottomLeftRadius: px,\n\n // Positioning props\n width: px,\n maxWidth: px,\n height: px,\n maxHeight: px,\n top: px,\n right: px,\n bottom: px,\n left: px,\n inset: px,\n insetBlock: px,\n insetBlockStart: px,\n insetBlockEnd: px,\n insetInline: px,\n insetInlineStart: px,\n insetInlineEnd: px,\n\n // Spacing props\n padding: px,\n paddingTop: px,\n paddingRight: px,\n paddingBottom: px,\n paddingLeft: px,\n paddingBlock: px,\n paddingBlockStart: px,\n paddingBlockEnd: px,\n paddingInline: px,\n paddingInlineStart: px,\n paddingInlineEnd: px,\n margin: px,\n marginTop: px,\n marginRight: px,\n marginBottom: px,\n marginLeft: px,\n marginBlock: px,\n marginBlockStart: px,\n marginBlockEnd: px,\n marginInline: px,\n marginInlineStart: px,\n marginInlineEnd: px,\n\n // Typography\n fontSize: px,\n\n // Misc\n backgroundPositionX: px,\n backgroundPositionY: px,\n\n ...transformValueTypes,\n zIndex: int,\n\n // SVG\n fillOpacity: alpha,\n strokeOpacity: alpha,\n numOctaves: int,\n}\n","import { color } from \"../color\"\nimport { filter } from \"../complex/filter\"\nimport { mask } from \"../complex/mask\"\nimport { numberValueTypes } from \"./number\"\nimport { ValueTypeMap } from \"./types\"\n\n/**\n * A map of default value types for common values\n */\nexport const defaultValueTypes: ValueTypeMap = {\n ...numberValueTypes,\n\n // Color props\n color,\n backgroundColor: color,\n outlineColor: color,\n fill: color,\n stroke: color,\n\n // Border props\n borderColor: color,\n borderTopColor: color,\n borderRightColor: color,\n borderBottomColor: color,\n borderLeftColor: color,\n filter,\n WebkitFilter: filter,\n mask,\n WebkitMask: mask,\n}\n\n/**\n * Gets the default ValueType for the provided value key\n */\nexport const getDefaultValueType = (key: string) => defaultValueTypes[key]\n","import { complex } from \"../complex\"\nimport { filter } from \"../complex/filter\"\nimport { mask } from \"../complex/mask\"\nimport { getDefaultValueType } from \"../maps/defaults\"\n\nconst customTypes = /*@__PURE__*/ new Set([filter, mask])\n\nexport function getAnimatableNone(key: string, value: string) {\n let defaultValueType = getDefaultValueType(key)\n if (!customTypes.has(defaultValueType as any)) defaultValueType = complex\n // If value is not recognised as animatable, ie \"none\", create an animatable version origin based on the target\n return defaultValueType.getAnimatableNone\n ? defaultValueType.getAnimatableNone(value)\n : undefined\n}\n","import { analyseComplexValue } from \"../../../value/types/complex\"\nimport { getAnimatableNone } from \"../../../value/types/utils/animatable-none\"\nimport { AnyResolvedKeyframe } from \"../../types\"\nimport { UnresolvedKeyframes } from \"../KeyframesResolver\"\n\n/**\n * If we encounter keyframes like \"none\" or \"0\" and we also have keyframes like\n * \"#fff\" or \"200px 200px\" we want to find a keyframe to serve as a template for\n * the \"none\" keyframes. In this case \"#fff\" or \"200px 200px\" - then these get turned into\n * zero equivalents, i.e. \"#fff0\" or \"0px 0px\".\n */\nconst invalidTemplates = new Set([\"auto\", \"none\", \"0\"])\n\nexport function makeNoneKeyframesAnimatable(\n unresolvedKeyframes: UnresolvedKeyframes,\n noneKeyframeIndexes: number[],\n name?: string\n) {\n let i = 0\n let animatableTemplate: string | undefined = undefined\n while (i < unresolvedKeyframes.length && !animatableTemplate) {\n const keyframe = unresolvedKeyframes[i]\n if (\n typeof keyframe === \"string\" &&\n !invalidTemplates.has(keyframe) &&\n analyseComplexValue(keyframe).values.length\n ) {\n animatableTemplate = unresolvedKeyframes[i] as string\n }\n i++\n }\n\n if (animatableTemplate && name) {\n for (const noneIndex of noneKeyframeIndexes) {\n unresolvedKeyframes[noneIndex] = getAnimatableNone(\n name,\n animatableTemplate\n )\n }\n }\n}\n","import { positionalKeys } from \"../../render/utils/keys-position\"\nimport { MotionValue } from \"../../value\"\nimport { findDimensionValueType } from \"../../value/types/dimensions\"\nimport { AnyResolvedKeyframe } from \"../types\"\nimport { getVariableValue } from \"../utils/css-variables-conversion\"\nimport {\n containsCSSVariable,\n isCSSVariableToken,\n} from \"../utils/is-css-variable\"\nimport {\n KeyframeResolver,\n OnKeyframesResolved,\n UnresolvedKeyframes,\n} from \"./KeyframesResolver\"\nimport { WithRender } from \"./types\"\nimport { isNone } from \"./utils/is-none\"\nimport { makeNoneKeyframesAnimatable } from \"./utils/make-none-animatable\"\nimport { isNumOrPxType, positionalValues } from \"./utils/unit-conversion\"\n\nexport class DOMKeyframesResolver<\n T extends AnyResolvedKeyframe\n> extends KeyframeResolver {\n name: string\n element?: WithRender\n\n private removedTransforms?: [string, AnyResolvedKeyframe][]\n private measuredOrigin?: AnyResolvedKeyframe\n\n constructor(\n unresolvedKeyframes: UnresolvedKeyframes,\n onComplete: OnKeyframesResolved,\n name?: string,\n motionValue?: MotionValue,\n element?: WithRender\n ) {\n super(unresolvedKeyframes, onComplete, name, motionValue, element, true)\n }\n\n readKeyframes() {\n const { unresolvedKeyframes, element, name } = this\n\n if (!element || !element.current) return\n\n super.readKeyframes()\n\n /**\n * If any keyframe is a CSS variable, we need to find its value by sampling the element\n */\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n let keyframe = unresolvedKeyframes[i]\n\n if (typeof keyframe === \"string\") {\n keyframe = keyframe.trim()\n\n if (isCSSVariableToken(keyframe)) {\n const resolved = getVariableValue(keyframe, element.current)\n\n if (resolved !== undefined) {\n unresolvedKeyframes[i] = resolved as T\n }\n\n if (i === unresolvedKeyframes.length - 1) {\n this.finalKeyframe = keyframe as T\n }\n }\n }\n }\n\n /**\n * Resolve \"none\" values. We do this potentially twice - once before and once after measuring keyframes.\n * This could be seen as inefficient but it's a trade-off to avoid measurements in more situations, which\n * have a far bigger performance impact.\n */\n this.resolveNoneKeyframes()\n\n /**\n * Check to see if unit type has changed. If so schedule jobs that will\n * temporarily set styles to the destination keyframes.\n * Skip if we have more than two keyframes or this isn't a positional value.\n * TODO: We can throw if there are multiple keyframes and the value type changes.\n */\n if (!positionalKeys.has(name) || unresolvedKeyframes.length !== 2) {\n return\n }\n\n const [origin, target] = unresolvedKeyframes\n const originType = findDimensionValueType(origin)\n const targetType = findDimensionValueType(target)\n\n /**\n * If one keyframe contains embedded CSS variables (e.g. in calc()) and the other\n * doesn't, we need to measure to convert to pixels. This handles GitHub issue #3410.\n */\n const originHasVar = containsCSSVariable(origin)\n const targetHasVar = containsCSSVariable(target)\n\n if (originHasVar !== targetHasVar && positionalValues[name]) {\n this.needsMeasurement = true\n return\n }\n\n /**\n * Either we don't recognise these value types or we can animate between them.\n */\n if (originType === targetType) return\n\n /**\n * If both values are numbers or pixels, we can animate between them by\n * converting them to numbers.\n */\n if (isNumOrPxType(originType) && isNumOrPxType(targetType)) {\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n const value = unresolvedKeyframes[i]\n if (typeof value === \"string\") {\n unresolvedKeyframes[i] = parseFloat(value as string)\n }\n }\n } else if (positionalValues[name]) {\n /**\n * Else, the only way to resolve this is by measuring the element.\n */\n this.needsMeasurement = true\n }\n }\n\n resolveNoneKeyframes() {\n const { unresolvedKeyframes, name } = this\n\n const noneKeyframeIndexes: number[] = []\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n if (\n unresolvedKeyframes[i] === null ||\n isNone(unresolvedKeyframes[i])\n ) {\n noneKeyframeIndexes.push(i)\n }\n }\n\n if (noneKeyframeIndexes.length) {\n makeNoneKeyframesAnimatable(\n unresolvedKeyframes,\n noneKeyframeIndexes,\n name\n )\n }\n }\n\n measureInitialState() {\n const { element, unresolvedKeyframes, name } = this\n\n if (!element || !element.current) return\n\n if (name === \"height\") {\n this.suspendedScrollY = window.pageYOffset\n }\n\n this.measuredOrigin = positionalValues[name](\n element.measureViewportBox(),\n window.getComputedStyle(element.current)\n )\n\n unresolvedKeyframes[0] = this.measuredOrigin\n\n // Set final key frame to measure after next render\n const measureKeyframe =\n unresolvedKeyframes[unresolvedKeyframes.length - 1]\n\n if (measureKeyframe !== undefined) {\n element.getValue(name, measureKeyframe).jump(measureKeyframe, false)\n }\n }\n\n measureEndState() {\n const { element, name, unresolvedKeyframes } = this\n\n if (!element || !element.current) return\n\n const value = element.getValue(name)\n value && value.jump(this.measuredOrigin, false)\n\n const finalKeyframeIndex = unresolvedKeyframes.length - 1\n const finalKeyframe = unresolvedKeyframes[finalKeyframeIndex]\n\n unresolvedKeyframes[finalKeyframeIndex] = positionalValues[name](\n element.measureViewportBox(),\n window.getComputedStyle(element.current)\n ) as any\n\n if (finalKeyframe !== null && this.finalKeyframe === undefined) {\n this.finalKeyframe = finalKeyframe as T\n }\n\n // If we removed transform values, reapply them before the next render\n if (this.removedTransforms?.length) {\n this.removedTransforms.forEach(\n ([unsetTransformName, unsetTransformValue]) => {\n element\n .getValue(unsetTransformName)!\n .set(unsetTransformValue)\n }\n )\n }\n\n this.resolveNoneKeyframes()\n }\n}\n","/**\n * The four corner-radius longhands. Shared so the projection mixer, scale\n * corrector, WAAPI px-value set and view-transition crop pass don't each carry\n * their own copy. Order is irrelevant - every consumer mixes/corrects/animates\n * each corner independently.\n */\nexport const cornerRadiusProps = [\n \"borderTopLeftRadius\",\n \"borderTopRightRadius\",\n \"borderBottomRightRadius\",\n \"borderBottomLeftRadius\",\n] as const\n","import { cornerRadiusProps } from \"../../../utils/border-radius\"\n\nexport const pxValues = new Set([\n // Border props\n \"borderWidth\",\n \"borderTopWidth\",\n \"borderRightWidth\",\n \"borderBottomWidth\",\n \"borderLeftWidth\",\n \"borderRadius\",\n ...cornerRadiusProps,\n // Positioning props\n \"width\",\n \"maxWidth\",\n \"height\",\n \"maxHeight\",\n \"top\",\n \"right\",\n \"bottom\",\n \"left\",\n \"inset\",\n \"insetBlock\",\n \"insetBlockStart\",\n \"insetBlockEnd\",\n \"insetInline\",\n \"insetInlineStart\",\n \"insetInlineEnd\",\n // Spacing props\n \"padding\",\n \"paddingTop\",\n \"paddingRight\",\n \"paddingBottom\",\n \"paddingLeft\",\n \"paddingBlock\",\n \"paddingBlockStart\",\n \"paddingBlockEnd\",\n \"paddingInline\",\n \"paddingInlineStart\",\n \"paddingInlineEnd\",\n \"margin\",\n \"marginTop\",\n \"marginRight\",\n \"marginBottom\",\n \"marginLeft\",\n \"marginBlock\",\n \"marginBlockStart\",\n \"marginBlockEnd\",\n \"marginInline\",\n \"marginInlineStart\",\n \"marginInlineEnd\",\n // Typography\n \"fontSize\",\n // Misc\n \"backgroundPositionX\",\n \"backgroundPositionY\",\n])\n","import { UnresolvedValueKeyframe, ValueKeyframe } from \"../../types\"\nimport { pxValues } from \"../../waapi/utils/px-values\"\n\nexport function applyPxDefaults(\n keyframes: ValueKeyframe[] | UnresolvedValueKeyframe[],\n name: string\n) {\n for (let i = 0; i < keyframes.length; i++) {\n if (typeof keyframes[i] === \"number\" && pxValues.has(name)) {\n keyframes[i] = keyframes[i] + \"px\"\n }\n }\n}\n","import { Easing, isBezierDefinition } from \"motion-utils\"\nimport { supportsLinearEasing } from \"../../../utils/supports/linear-easing\"\nimport { supportedWaapiEasing } from \"./supported\"\n\nexport function isWaapiSupportedEasing(easing?: Easing | Easing[]): boolean {\n return Boolean(\n (typeof easing === \"function\" && supportsLinearEasing()) ||\n !easing ||\n (typeof easing === \"string\" &&\n (easing in supportedWaapiEasing || supportsLinearEasing())) ||\n isBezierDefinition(easing) ||\n (Array.isArray(easing) && easing.every(isWaapiSupportedEasing))\n )\n}\n","import { memo } from \"motion-utils\"\n\nexport const supportsPartialKeyframes = /*@__PURE__*/ memo(() => {\n try {\n document.createElement(\"div\").animate({ opacity: [1] })\n } catch (e) {\n return false\n }\n return true\n})\n","export type ElementOrSelector =\n | Element\n | Element[]\n | NodeListOf\n | string\n | null\n | undefined\n\nexport interface WithQuerySelectorAll {\n querySelectorAll: Element[\"querySelectorAll\"]\n}\n\nexport interface AnimationScope {\n readonly current: T\n animations: any[] // TODO: Refactor to types package AnimationPlaybackControls[]\n}\n\nexport interface SelectorCache {\n [key: string]: NodeListOf\n}\n\nexport function resolveElements(\n elementOrSelector: ElementOrSelector,\n scope?: AnimationScope,\n selectorCache?: SelectorCache\n): Element[] {\n if (elementOrSelector == null) {\n return []\n }\n\n if (elementOrSelector instanceof EventTarget) {\n return [elementOrSelector]\n } else if (typeof elementOrSelector === \"string\") {\n let root: WithQuerySelectorAll = document\n\n if (scope) {\n root = scope.current\n }\n\n const elements =\n selectorCache?.[elementOrSelector] ??\n root.querySelectorAll(elementOrSelector)\n\n return elements ? Array.from(elements) : []\n }\n\n return Array.from(elementOrSelector).filter(\n (element): element is Element => element != null\n )\n}\n","import {\n ElementOrSelector,\n resolveElements,\n} from \"../../utils/resolve-elements\"\nimport { MotionValue } from \"../../value\"\n\nexport function createSelectorEffect(\n subjectEffect: (\n subject: T,\n values: Record\n ) => VoidFunction\n) {\n return (\n subject: ElementOrSelector,\n values: Record\n ) => {\n const elements = resolveElements(subject)\n const subscriptions: VoidFunction[] = []\n\n for (const element of elements) {\n const remove = subjectEffect(element as T, values)\n subscriptions.push(remove)\n }\n\n return () => {\n for (const remove of subscriptions) remove()\n }\n }\n}\n","import { ValueType } from \"../types\"\n\n/**\n * Provided a value and a ValueType, returns the value as that value type.\n */\nexport const getValueAsType = (value: any, type?: ValueType) => {\n return type && typeof value === \"number\"\n ? (type as any).transform(value)\n : value\n}\n","import { AnyResolvedKeyframe } from \"../animation/types\"\nimport { cancelFrame, frame } from \"../frameloop/frame\"\nimport { MotionValue } from \"../value\"\nimport { numberValueTypes } from \"../value/types/maps/number\"\nimport { getValueAsType } from \"../value/types/utils/get-as-type\"\n\nexport class MotionValueState {\n latest: { [name: string]: AnyResolvedKeyframe } = {}\n\n private values = new Map<\n string,\n { value: MotionValue; onRemove: VoidFunction }\n >()\n\n set(\n name: string,\n value: MotionValue,\n render?: VoidFunction,\n computed?: MotionValue,\n useDefaultValueType = true\n ) {\n const existingValue = this.values.get(name)\n\n if (existingValue) {\n existingValue.onRemove()\n }\n\n const onChange = () => {\n const v = value.get()\n\n if (useDefaultValueType) {\n this.latest[name] = getValueAsType(v, numberValueTypes[name])\n } else {\n this.latest[name] = v\n }\n\n render && frame.render(render)\n }\n\n onChange()\n\n const cancelOnChange = value.on(\"change\", onChange)\n\n computed && value.addDependent(computed)\n\n const remove = () => {\n cancelOnChange()\n render && cancelFrame(render)\n this.values.delete(name)\n computed && value.removeDependent(computed)\n }\n\n this.values.set(name, { value, onRemove: remove })\n\n return remove\n }\n\n get(name: string): MotionValue | undefined {\n return this.values.get(name)?.value\n }\n}\n","import { MotionValue } from \"../../value\"\nimport { MotionValueState } from \"../MotionValueState\"\n\nexport function createEffect(\n addValue: (\n subject: Subject,\n state: MotionValueState,\n key: string,\n value: MotionValue\n ) => VoidFunction\n) {\n const stateCache = new WeakMap()\n\n return (\n subject: Subject,\n values: Record\n ): VoidFunction => {\n const state = stateCache.get(subject) ?? new MotionValueState()\n\n stateCache.set(subject, state)\n\n const subscriptions: VoidFunction[] = []\n\n for (const key in values) {\n const value = values[key]\n const remove = addValue(subject, state, key, value)\n subscriptions.push(remove)\n }\n\n return () => {\n for (const cancel of subscriptions) cancel()\n }\n }\n}\n","import { camelToDash } from \"../../render/dom/utils/camel-to-dash\"\nimport { MotionValue } from \"../../value\"\nimport { MotionValueState } from \"../MotionValueState\"\nimport { createSelectorEffect } from \"../utils/create-dom-effect\"\nimport { createEffect } from \"../utils/create-effect\"\n\nfunction canSetAsProperty(element: HTMLElement | SVGElement, name: string) {\n if (!(name in element)) return false\n\n const descriptor =\n Object.getOwnPropertyDescriptor(Object.getPrototypeOf(element), name) ||\n Object.getOwnPropertyDescriptor(element, name)\n\n // Check if it has a setter\n return descriptor && typeof descriptor.set === \"function\"\n}\n\nexport const addAttrValue = (\n element: HTMLElement | SVGElement,\n state: MotionValueState,\n key: string,\n value: MotionValue\n) => {\n const isProp = canSetAsProperty(element, key)\n const name = isProp\n ? key\n : key.startsWith(\"data\") || key.startsWith(\"aria\")\n ? camelToDash(key)\n : key\n\n /**\n * Set attribute directly via property if available\n */\n const render = isProp\n ? () => {\n ;(element as any)[name] = state.latest[key]\n }\n : () => {\n const v = state.latest[key]\n if (v === null || v === undefined) {\n element.removeAttribute(name)\n } else {\n element.setAttribute(name, String(v))\n }\n }\n\n return state.set(key, value, render)\n}\n\nexport const attrEffect = /*@__PURE__*/ createSelectorEffect(\n /*@__PURE__*/ createEffect(addAttrValue)\n)\n","import { MotionValue } from \"../../value\"\nimport { MotionValueState } from \"../MotionValueState\"\nimport { createEffect } from \"../utils/create-effect\"\n\nexport const propEffect = /*@__PURE__*/ createEffect(\n (\n subject: { [key: string]: any },\n state: MotionValueState,\n key: string,\n value: MotionValue\n ) => {\n return state.set(\n key,\n value,\n () => {\n subject[key] = state.latest[key]\n },\n undefined,\n false\n )\n }\n)\n","import { isObject } from \"motion-utils\"\n\n/**\n * Checks if an element is an HTML element in a way\n * that works across iframes\n */\nexport function isHTMLElement(element: unknown): element is HTMLElement {\n return (\n isObject(element) &&\n \"offsetHeight\" in element &&\n !(\"ownerSVGElement\" in element)\n )\n}\n","import { transformPropOrder } from \"../../render/utils/keys-transform\"\nimport { MotionValueState } from \"../MotionValueState\"\n\nconst translateAlias = {\n x: \"translateX\",\n y: \"translateY\",\n z: \"translateZ\",\n transformPerspective: \"perspective\",\n}\n\nexport function buildTransform(state: MotionValueState) {\n let transform = \"\"\n let transformIsDefault = true\n\n /**\n * Loop over all possible transforms in order, adding the ones that\n * are present to the transform string.\n */\n for (let i = 0; i < transformPropOrder.length; i++) {\n const key = transformPropOrder[i] as keyof typeof translateAlias\n const value = state.latest[key]\n\n if (value === undefined) continue\n\n let valueIsDefault = true\n if (typeof value === \"number\") {\n valueIsDefault = value === (key.startsWith(\"scale\") ? 1 : 0)\n } else {\n const parsed = parseFloat(value)\n valueIsDefault = key.startsWith(\"scale\") ? parsed === 1 : parsed === 0\n }\n\n if (!valueIsDefault) {\n transformIsDefault = false\n const transformName = translateAlias[key] || key\n transform += `${transformName}(${value}) `\n }\n }\n\n // See build-transform.ts: additive `rotate()` so user `rotate` isn't\n // clobbered. Not a `transformPropOrder` slot.\n const pathRotation = state.latest.pathRotation\n if (pathRotation) {\n transformIsDefault = false\n transform += `rotate(${\n typeof pathRotation === \"number\"\n ? `${pathRotation}deg`\n : pathRotation\n }) `\n }\n\n return transformIsDefault ? \"none\" : transform.trim()\n}\n","import { isCSSVar } from \"../../render/dom/is-css-var\"\nimport { transformProps } from \"../../render/utils/keys-transform\"\nimport { isHTMLElement } from \"../../utils/is-html-element\"\nimport { MotionValue } from \"../../value\"\nimport { MotionValueState } from \"../MotionValueState\"\nimport { createSelectorEffect } from \"../utils/create-dom-effect\"\nimport { createEffect } from \"../utils/create-effect\"\nimport { buildTransform } from \"./transform\"\n\nconst originProps = new Set([\"originX\", \"originY\", \"originZ\"])\n\nexport const addStyleValue = (\n element: HTMLElement | SVGElement,\n state: MotionValueState,\n key: string,\n value: MotionValue\n) => {\n let render: VoidFunction | undefined = undefined\n let computed: MotionValue | undefined = undefined\n\n if (transformProps.has(key)) {\n if (!state.get(\"transform\")) {\n // If this is an HTML element, we need to set the transform-box to fill-box\n // to normalise the transform relative to the element's bounding box\n if (!isHTMLElement(element) && !state.get(\"transformBox\")) {\n addStyleValue(\n element,\n state,\n \"transformBox\",\n new MotionValue(\"fill-box\")\n )\n }\n\n state.set(\"transform\", new MotionValue(\"none\"), () => {\n element.style.transform = buildTransform(state)\n })\n }\n\n computed = state.get(\"transform\")\n } else if (originProps.has(key)) {\n if (!state.get(\"transformOrigin\")) {\n state.set(\"transformOrigin\", new MotionValue(\"\"), () => {\n const originX = state.latest.originX ?? \"50%\"\n const originY = state.latest.originY ?? \"50%\"\n const originZ = state.latest.originZ ?? 0\n element.style.transformOrigin = `${originX} ${originY} ${originZ}`\n })\n }\n\n computed = state.get(\"transformOrigin\")\n } else if (isCSSVar(key)) {\n render = () => {\n element.style.setProperty(key, state.latest[key] as string)\n }\n } else {\n render = () => {\n element.style[key as any] = state.latest[key] as string\n }\n }\n\n return state.set(key, value, render, computed)\n}\n\nexport const styleEffect = /*@__PURE__*/ createSelectorEffect(\n /*@__PURE__*/ createEffect(addStyleValue)\n)\n","import { frame } from \"../../frameloop\"\nimport { MotionValue } from \"../../value\"\nimport { addAttrValue } from \"../attr\"\nimport { MotionValueState } from \"../MotionValueState\"\nimport { addStyleValue } from \"../style\"\nimport { createSelectorEffect } from \"../utils/create-dom-effect\"\nimport { createEffect } from \"../utils/create-effect\"\n\nfunction addSVGPathValue(\n element: SVGElement,\n state: MotionValueState,\n key: string,\n value: MotionValue\n) {\n frame.render(() => element.setAttribute(\"pathLength\", \"1\"))\n\n if (key === \"pathOffset\") {\n return state.set(key, value, () => {\n // Use unitless value to avoid Safari zoom bug\n const offset = state.latest[key]\n element.setAttribute(\"stroke-dashoffset\", `${-offset}`)\n })\n } else {\n if (!state.get(\"stroke-dasharray\")) {\n state.set(\"stroke-dasharray\", new MotionValue(\"1 1\"), () => {\n const { pathLength = 1, pathSpacing } = state.latest\n\n // Use unitless values to avoid Safari zoom bug\n element.setAttribute(\n \"stroke-dasharray\",\n `${pathLength} ${pathSpacing ?? 1 - Number(pathLength)}`\n )\n })\n }\n\n return state.set(key, value, undefined, state.get(\"stroke-dasharray\"))\n }\n}\n\nconst addSVGValue = (\n element: SVGElement,\n state: MotionValueState,\n key: string,\n value: MotionValue\n) => {\n if (key.startsWith(\"path\")) {\n return addSVGPathValue(element, state, key, value)\n } else if (key.startsWith(\"attr\")) {\n return addAttrValue(element, state, convertAttrKey(key), value)\n }\n\n const handler = key in element.style ? addStyleValue : addAttrValue\n return handler(element, state, key, value)\n}\n\nexport const svgEffect = /*@__PURE__*/ createSelectorEffect(\n /*@__PURE__*/ createEffect(addSVGValue)\n)\n\nfunction convertAttrKey(key: string) {\n return key.replace(/^attr([A-Z])/, (_, firstChar) =>\n firstChar.toLowerCase()\n )\n}\n","import { createRenderBatcher } from \"./batcher\"\n\nexport const { schedule: microtask, cancel: cancelMicrotask } =\n /* @__PURE__ */ createRenderBatcher(queueMicrotask, false)\n","export const isDragging = {\n x: false,\n y: false,\n}\n\nexport function isDragActive() {\n return isDragging.x || isDragging.y\n}\n","import { isDragging } from \"./is-active\"\n\nexport function setDragLock(axis: boolean | \"x\" | \"y\" | \"lockDirection\") {\n if (axis === \"x\" || axis === \"y\") {\n if (isDragging[axis]) {\n return null\n } else {\n isDragging[axis] = true\n return () => {\n isDragging[axis] = false\n }\n }\n } else {\n if (isDragging.x || isDragging.y) {\n return null\n } else {\n isDragging.x = isDragging.y = true\n return () => {\n isDragging.x = isDragging.y = false\n }\n }\n }\n}\n","import {\n ElementOrSelector,\n resolveElements,\n} from \"../../utils/resolve-elements\"\nimport { EventOptions } from \"../types\"\n\nexport function setupGesture(\n elementOrSelector: ElementOrSelector,\n options: EventOptions\n): [Element[], AddEventListenerOptions, VoidFunction] {\n const elements = resolveElements(elementOrSelector)\n\n const gestureAbortController = new AbortController()\n\n const eventOptions = {\n passive: true,\n ...options,\n signal: gestureAbortController.signal,\n }\n\n const cancel = () => gestureAbortController.abort()\n\n return [elements, eventOptions, cancel]\n}\n","import { ElementOrSelector } from \"../utils/resolve-elements\"\nimport { isDragActive } from \"./drag/state/is-active\"\nimport { EventOptions } from \"./types\"\nimport { setupGesture } from \"./utils/setup\"\n\n/**\n * A function to be called when a hover gesture starts.\n *\n * This function can optionally return a function that will be called\n * when the hover gesture ends.\n *\n * @public\n */\nexport type OnHoverStartEvent = (\n element: Element,\n event: PointerEvent\n) => void | OnHoverEndEvent\n\n/**\n * A function to be called when a hover gesture ends.\n *\n * @public\n */\nexport type OnHoverEndEvent = (event: PointerEvent) => void\n\nfunction isValidHover(event: PointerEvent) {\n return !(event.pointerType === \"touch\" || isDragActive())\n}\n\n/**\n * Create a hover gesture. hover() is different to .addEventListener(\"pointerenter\")\n * in that it has an easier syntax, filters out polyfilled touch events, interoperates\n * with drag gestures, and automatically removes the \"pointerennd\" event listener when the hover ends.\n *\n * @public\n */\nexport function hover(\n elementOrSelector: ElementOrSelector,\n onHoverStart: OnHoverStartEvent,\n options: EventOptions = {}\n): VoidFunction {\n const [elements, eventOptions, cancel] = setupGesture(\n elementOrSelector,\n options\n )\n\n elements.forEach((element) => {\n let isPressed = false\n let deferredHoverEnd = false\n let hoverEndCallback: OnHoverEndEvent | undefined\n\n const removePointerLeave = () => {\n element.removeEventListener(\n \"pointerleave\",\n onPointerLeave as EventListener\n )\n }\n\n const endHover = (event: PointerEvent) => {\n if (hoverEndCallback) {\n hoverEndCallback(event)\n hoverEndCallback = undefined\n }\n removePointerLeave()\n }\n\n const onPointerUp = (event: Event) => {\n isPressed = false\n window.removeEventListener(\n \"pointerup\",\n onPointerUp as EventListener\n )\n window.removeEventListener(\n \"pointercancel\",\n onPointerUp as EventListener\n )\n\n if (deferredHoverEnd) {\n deferredHoverEnd = false\n endHover(event as PointerEvent)\n }\n }\n\n const onPointerDown = () => {\n isPressed = true\n window.addEventListener(\n \"pointerup\",\n onPointerUp as EventListener,\n eventOptions\n )\n window.addEventListener(\n \"pointercancel\",\n onPointerUp as EventListener,\n eventOptions\n )\n }\n\n const onPointerLeave = (leaveEvent: PointerEvent) => {\n if (leaveEvent.pointerType === \"touch\") return\n\n if (isPressed) {\n deferredHoverEnd = true\n return\n }\n\n endHover(leaveEvent)\n }\n\n const onPointerEnter = (enterEvent: PointerEvent) => {\n if (!isValidHover(enterEvent)) return\n\n deferredHoverEnd = false\n\n const onHoverEnd = onHoverStart(\n element as Element,\n enterEvent\n )\n\n if (typeof onHoverEnd !== \"function\") return\n\n hoverEndCallback = onHoverEnd\n\n element.addEventListener(\n \"pointerleave\",\n onPointerLeave as EventListener,\n eventOptions\n )\n }\n\n element.addEventListener(\n \"pointerenter\",\n onPointerEnter as EventListener,\n eventOptions\n )\n element.addEventListener(\n \"pointerdown\",\n onPointerDown as EventListener,\n eventOptions\n )\n })\n\n return cancel\n}\n","/**\n * Recursively traverse up the tree to check whether the provided child node\n * is the parent or a descendant of it.\n *\n * @param parent - Element to find\n * @param child - Element to test against parent\n */\nexport const isNodeOrChild = (\n parent: Element | null,\n child?: Element | null\n): boolean => {\n if (!child) {\n return false\n } else if (parent === child) {\n return true\n } else {\n return isNodeOrChild(parent, child.parentElement)\n }\n}\n","export const isPrimaryPointer = (event: PointerEvent) => {\n if (event.pointerType === \"mouse\") {\n return typeof event.button !== \"number\" || event.button <= 0\n } else {\n /**\n * isPrimary is true for all mice buttons, whereas every touch point\n * is regarded as its own input. So subsequent concurrent touch points\n * will be false.\n *\n * Specifically match against false here as incomplete versions of\n * PointerEvents in very old browser might have it set as undefined.\n */\n return event.isPrimary !== false\n }\n}\n","const keyboardAccessibleElements = new Set([\n \"BUTTON\",\n \"INPUT\",\n \"SELECT\",\n \"TEXTAREA\",\n \"A\",\n])\n\n/**\n * Checks if an element is natively keyboard accessible (focusable).\n * Used by the press gesture to determine if we need to add tabIndex.\n */\nexport function isElementKeyboardAccessible(element: Element) {\n return (\n keyboardAccessibleElements.has(element.tagName) ||\n (element as HTMLElement).isContentEditable === true\n )\n}\n\nconst textInputElements = new Set([\"INPUT\", \"SELECT\", \"TEXTAREA\"])\n\n/**\n * Checks if an element has text selection or direct interaction behavior\n * that should block drag gestures from starting.\n *\n * This specifically targets form controls where the user might want to select\n * text or interact with the control (e.g., sliders, dropdowns).\n *\n * Buttons and links are NOT included because they don't have click-and-move\n * actions of their own - they only respond to click events, so dragging\n * should still work when initiated from these elements.\n */\nexport function isElementTextInput(element: Element) {\n return (\n textInputElements.has(element.tagName) ||\n (element as HTMLElement).isContentEditable === true\n )\n}\n","export const isPressing = new WeakSet()\n","import { isPressing } from \"./state\"\n\n/**\n * Filter out events that are not \"Enter\" keys.\n */\nfunction filterEvents(callback: (event: KeyboardEvent) => void) {\n return (event: KeyboardEvent) => {\n if (event.key !== \"Enter\") return\n callback(event)\n }\n}\n\nfunction firePointerEvent(target: EventTarget, type: \"down\" | \"up\" | \"cancel\") {\n target.dispatchEvent(\n new PointerEvent(\"pointer\" + type, { isPrimary: true, bubbles: true })\n )\n}\n\nexport const enableKeyboardPress = (\n focusEvent: FocusEvent,\n eventOptions: AddEventListenerOptions\n) => {\n const element = focusEvent.currentTarget as HTMLElement\n if (!element) return\n\n const handleKeydown = filterEvents(() => {\n if (isPressing.has(element)) return\n\n firePointerEvent(element, \"down\")\n\n const handleKeyup = filterEvents(() => {\n firePointerEvent(element, \"up\")\n })\n\n const handleBlur = () => firePointerEvent(element, \"cancel\")\n\n element.addEventListener(\"keyup\", handleKeyup, eventOptions)\n element.addEventListener(\"blur\", handleBlur, eventOptions)\n })\n\n element.addEventListener(\"keydown\", handleKeydown, eventOptions)\n\n /**\n * Add an event listener that fires on blur to remove the keydown events.\n */\n element.addEventListener(\n \"blur\",\n () => element.removeEventListener(\"keydown\", handleKeydown),\n eventOptions\n )\n}\n","import { isHTMLElement } from \"../../utils/is-html-element\"\nimport { ElementOrSelector } from \"../../utils/resolve-elements\"\nimport { isDragActive } from \"../drag/state/is-active\"\nimport { EventOptions } from \"../types\"\nimport { isNodeOrChild } from \"../utils/is-node-or-child\"\nimport { isPrimaryPointer } from \"../utils/is-primary-pointer\"\nimport { setupGesture } from \"../utils/setup\"\nimport { OnPressStartEvent } from \"./types\"\nimport { isElementKeyboardAccessible } from \"./utils/is-keyboard-accessible\"\nimport { enableKeyboardPress } from \"./utils/keyboard\"\nimport { isPressing } from \"./utils/state\"\n\n/**\n * Filter out events that are not primary pointer events, or are triggering\n * while a Motion gesture is active.\n */\nfunction isValidPressEvent(event: PointerEvent) {\n return isPrimaryPointer(event) && !isDragActive()\n}\n\nconst claimedPointerDownEvents = new WeakSet()\n\nexport interface PointerEventOptions extends EventOptions {\n useGlobalTarget?: boolean\n stopPropagation?: boolean\n}\n\n/**\n * Create a press gesture.\n *\n * Press is different to `\"pointerdown\"`, `\"pointerup\"` in that it\n * automatically filters out secondary pointer events like right\n * click and multitouch.\n *\n * It also adds accessibility support for keyboards, where\n * an element with a press gesture will receive focus and\n * trigger on Enter `\"keydown\"` and `\"keyup\"` events.\n *\n * This is different to a browser's `\"click\"` event, which does\n * respond to keyboards but only for the `\"click\"` itself, rather\n * than the press start and end/cancel. The element also needs\n * to be focusable for this to work, whereas a press gesture will\n * make an element focusable by default.\n *\n * @public\n */\nexport function press(\n targetOrSelector: ElementOrSelector,\n onPressStart: OnPressStartEvent,\n options: PointerEventOptions = {}\n): VoidFunction {\n const [targets, eventOptions, cancelEvents] = setupGesture(\n targetOrSelector,\n options\n )\n\n const startPress = (startEvent: PointerEvent) => {\n const target = startEvent.currentTarget as Element\n\n if (!isValidPressEvent(startEvent)) return\n if (claimedPointerDownEvents.has(startEvent)) return\n\n isPressing.add(target)\n\n if (options.stopPropagation) {\n claimedPointerDownEvents.add(startEvent)\n }\n\n const onPressEnd = onPressStart(target, startEvent)\n\n /**\n * End listeners run in the capture phase so a descendant calling\n * stopPropagation() in its own pointerup handler can't prevent the\n * press gesture from ending. This also keeps the gesture-end\n * ordering consistent with the drag gesture. See #2794.\n */\n const endEventOptions = { ...eventOptions, capture: true }\n\n const onPointerEnd = (endEvent: PointerEvent, success: boolean) => {\n window.removeEventListener(\n \"pointerup\",\n onPointerUp,\n endEventOptions\n )\n window.removeEventListener(\n \"pointercancel\",\n onPointerCancel,\n endEventOptions\n )\n\n if (isPressing.has(target)) {\n isPressing.delete(target)\n }\n\n if (!isValidPressEvent(endEvent)) {\n return\n }\n\n if (typeof onPressEnd === \"function\") {\n onPressEnd(endEvent, { success })\n }\n }\n\n const onPointerUp = (upEvent: PointerEvent) => {\n onPointerEnd(\n upEvent,\n (target as any) === window ||\n (target as any) === document ||\n options.useGlobalTarget ||\n isNodeOrChild(target, upEvent.target as Element)\n )\n }\n\n const onPointerCancel = (cancelEvent: PointerEvent) => {\n onPointerEnd(cancelEvent, false)\n }\n\n window.addEventListener(\"pointerup\", onPointerUp, endEventOptions)\n window.addEventListener(\n \"pointercancel\",\n onPointerCancel,\n endEventOptions\n )\n }\n\n targets.forEach((target: EventTarget) => {\n const pointerDownTarget = options.useGlobalTarget ? window : target\n pointerDownTarget.addEventListener(\n \"pointerdown\",\n startPress as EventListener,\n eventOptions\n )\n\n if (isHTMLElement(target)) {\n target.addEventListener(\"focus\", (event) =>\n enableKeyboardPress(event as FocusEvent, eventOptions)\n )\n\n if (\n !isElementKeyboardAccessible(target) &&\n !target.hasAttribute(\"tabindex\")\n ) {\n target.tabIndex = 0\n }\n }\n })\n\n return cancelEvents\n}\n","import { isCSSVar } from \"./is-css-var\"\n\nexport function getComputedStyle(\n element: HTMLElement | SVGElement,\n name: string\n) {\n const computedStyle = window.getComputedStyle(element)\n return isCSSVar(name)\n ? computedStyle.getPropertyValue(name)\n : computedStyle[name as any]\n}\n","import { isObject } from \"motion-utils\"\n\n/**\n * Checks if an element is an SVG element in a way\n * that works across iframes\n */\nexport function isSVGElement(element: unknown): element is SVGElement {\n return isObject(element) && \"ownerSVGElement\" in element\n}\n","import { isSVGElement } from \"../utils/is-svg-element\"\nimport { ElementOrSelector, resolveElements } from \"../utils/resolve-elements\"\nimport { ResizeHandler } from \"./types\"\n\nconst resizeHandlers = new WeakMap>>()\n\nlet observer: ResizeObserver | undefined\n\nconst getSize =\n (\n borderBoxAxis: \"inline\" | \"block\",\n svgAxis: \"width\" | \"height\",\n htmlAxis: \"offsetWidth\" | \"offsetHeight\"\n ) =>\n (target: Element, borderBoxSize?: ReadonlyArray) => {\n if (borderBoxSize && borderBoxSize[0]) {\n return borderBoxSize[0][\n (borderBoxAxis + \"Size\") as keyof ResizeObserverSize\n ]\n } else if (isSVGElement(target) && \"getBBox\" in target) {\n return (target as SVGGraphicsElement).getBBox()[svgAxis]\n } else {\n return (target as HTMLElement)[htmlAxis]\n }\n }\n\nconst getWidth = /*@__PURE__*/ getSize(\"inline\", \"width\", \"offsetWidth\")\nconst getHeight = /*@__PURE__*/ getSize(\"block\", \"height\", \"offsetHeight\")\n\nfunction notifyTarget({ target, borderBoxSize }: ResizeObserverEntry) {\n resizeHandlers.get(target)?.forEach((handler) => {\n handler(target, {\n get width() {\n return getWidth(target, borderBoxSize)\n },\n get height() {\n return getHeight(target, borderBoxSize)\n },\n })\n })\n}\n\nfunction notifyAll(entries: ResizeObserverEntry[]) {\n entries.forEach(notifyTarget)\n}\n\nfunction createResizeObserver() {\n if (typeof ResizeObserver === \"undefined\") return\n\n observer = new ResizeObserver(notifyAll)\n}\n\nexport function resizeElement(\n target: ElementOrSelector,\n handler: ResizeHandler\n) {\n if (!observer) createResizeObserver()\n\n const elements = resolveElements(target)\n\n elements.forEach((element) => {\n let elementHandlers = resizeHandlers.get(element)\n\n if (!elementHandlers) {\n elementHandlers = new Set()\n resizeHandlers.set(element, elementHandlers)\n }\n\n elementHandlers.add(handler)\n observer?.observe(element)\n })\n\n return () => {\n elements.forEach((element) => {\n const elementHandlers = resizeHandlers.get(element)\n\n elementHandlers?.delete(handler)\n\n if (!elementHandlers?.size) {\n observer?.unobserve(element)\n }\n })\n }\n}\n","import { WindowResizeHandler } from \"./types\"\n\nconst windowCallbacks = new Set()\n\nlet windowResizeHandler: VoidFunction | undefined\n\nfunction createWindowResizeHandler() {\n windowResizeHandler = () => {\n const info = {\n get width() {\n return window.innerWidth\n },\n get height() {\n return window.innerHeight\n },\n }\n\n windowCallbacks.forEach((callback) => callback(info))\n }\n\n window.addEventListener(\"resize\", windowResizeHandler)\n}\n\nexport function resizeWindow(callback: WindowResizeHandler) {\n windowCallbacks.add(callback)\n\n if (!windowResizeHandler) createWindowResizeHandler()\n\n return () => {\n windowCallbacks.delete(callback)\n\n if (\n !windowCallbacks.size &&\n typeof windowResizeHandler === \"function\"\n ) {\n window.removeEventListener(\"resize\", windowResizeHandler)\n windowResizeHandler = undefined\n }\n }\n}\n","import { ElementOrSelector } from \"../utils/resolve-elements\"\nimport { resizeElement } from \"./handle-element\"\nimport { resizeWindow } from \"./handle-window\"\nimport { ResizeHandler, WindowResizeHandler } from \"./types\"\n\nexport function resize(onResize: WindowResizeHandler): VoidFunction\nexport function resize(\n target: ElementOrSelector,\n onResize: ResizeHandler\n): VoidFunction\nexport function resize(\n a: WindowResizeHandler | ElementOrSelector,\n b?: ResizeHandler\n) {\n return typeof a === \"function\" ? resizeWindow(a) : resizeElement(a, b!)\n}\n","import { ProgressTimeline } from \"../animation/types\"\nimport { cancelFrame, frame } from \"../frameloop\"\n\ntype Update = (progress: number) => void\n\nexport function observeTimeline(update: Update, timeline: ProgressTimeline) {\n let prevProgress: number\n\n const onFrame = () => {\n const { currentTime } = timeline\n const percentage = currentTime === null ? 0 : currentTime.value\n const progress = percentage / 100\n\n if (prevProgress !== progress) {\n update(progress)\n }\n\n prevProgress = progress\n }\n\n frame.preUpdate(onFrame, true)\n\n return () => cancelFrame(onFrame)\n}\n","import type { LayoutProjectionMetrics, StatsRecording } from \"./types\"\n\nexport type InactiveStatsBuffer = {\n value: null\n addProjectionMetrics: null\n}\n\nexport type ActiveStatsBuffer = {\n value: StatsRecording\n addProjectionMetrics: (metrics: LayoutProjectionMetrics) => void\n}\n\nexport const statsBuffer: InactiveStatsBuffer | ActiveStatsBuffer = {\n value: null,\n addProjectionMetrics: null,\n}\n","import { ActiveStatsBuffer, statsBuffer } from \"./buffer\"\n\nfunction clearStatsBuffer() {\n statsBuffer.value = null\n statsBuffer.addProjectionMetrics = null\n}\n\nexport function recordStats() {\n if (statsBuffer.value) {\n clearStatsBuffer()\n throw new Error(\"Stats are already being measured\")\n }\n\n const buffer = statsBuffer as unknown as ActiveStatsBuffer\n\n buffer.value = {\n layoutProjection: {\n nodes: [],\n calculatedTargetDeltas: [],\n calculatedProjections: [],\n },\n }\n\n buffer.addProjectionMetrics = (metrics) => {\n const { layoutProjection } = buffer.value\n layoutProjection.nodes.push(metrics.nodes)\n layoutProjection.calculatedTargetDeltas.push(\n metrics.calculatedTargetDeltas\n )\n layoutProjection.calculatedProjections.push(\n metrics.calculatedProjections\n )\n }\n}\n","import { isSVGElement } from \"./is-svg-element\"\n\n/**\n * Checks if an element is specifically an SVGSVGElement (the root SVG element)\n * in a way that works across iframes\n */\nexport function isSVGSVGElement(element: unknown): element is SVGSVGElement {\n return isSVGElement(element) && element.tagName === \"svg\"\n}\n","import { Easing, easingDefinitionToFunction } from \"motion-utils\"\nimport { DynamicOption } from \"../animation/types\"\n\nexport type StaggerOrigin = \"first\" | \"last\" | \"center\" | number\n\nexport type StaggerOptions = {\n startDelay?: number\n from?: StaggerOrigin\n ease?: Easing\n}\n\nexport function getOriginIndex(from: StaggerOrigin, total: number) {\n if (from === \"first\") {\n return 0\n } else {\n const lastIndex = total - 1\n return from === \"last\" ? lastIndex : lastIndex / 2\n }\n}\n\nexport function stagger(\n duration: number = 0.1,\n { startDelay = 0, from = 0, ease }: StaggerOptions = {}\n): DynamicOption {\n return (i: number, total: number) => {\n const fromIndex =\n typeof from === \"number\" ? from : getOriginIndex(from, total)\n const distance = Math.abs(fromIndex - i)\n let delay = duration * distance\n\n if (ease) {\n const maxDelay = total * duration\n const easingFunction = easingDefinitionToFunction(ease)\n delay = easingFunction(delay / maxDelay) * maxDelay\n }\n\n return startDelay + delay\n }\n}\n","import { EasingFunction } from \"motion-utils\"\nimport { interpolate } from \"./interpolate\"\n\n/**\n * @public\n */\nexport interface TransformOptions {\n /**\n * Clamp values to within the given range. Defaults to `true`\n *\n * @public\n */\n clamp?: boolean\n\n /**\n * Easing functions to use on the interpolations between each value in the input and output ranges.\n *\n * If provided as an array, the array must be one item shorter than the input and output ranges, as the easings apply to the transition **between** each.\n *\n * @public\n */\n ease?: EasingFunction | EasingFunction[]\n\n /**\n * Provide a function that can interpolate between any two values in the provided range.\n *\n * @public\n */\n mixer?: (from: T, to: T) => (v: number) => any\n}\n\n/**\n * Transforms numbers into other values by mapping them from an input range to an output range.\n * Returns the type of the input provided.\n *\n * @remarks\n *\n * Given an input range of `[0, 200]` and an output range of\n * `[0, 1]`, this function will return a value between `0` and `1`.\n * The input range must be a linear series of numbers. The output range\n * can be any supported value type, such as numbers, colors, shadows, arrays, objects and more.\n * Every value in the output range must be of the same type and in the same format.\n *\n * ```jsx\n * export function MyComponent() {\n * const inputRange = [0, 200]\n * const outputRange = [0, 1]\n * const output = transform(100, inputRange, outputRange)\n *\n * // Returns 0.5\n * return
{output}
\n * }\n * ```\n *\n * @param inputValue - A number to transform between the input and output ranges.\n * @param inputRange - A linear series of numbers (either all increasing or decreasing).\n * @param outputRange - A series of numbers, colors, strings, or arrays/objects of those. Must be the same length as `inputRange`.\n * @param options - Clamp: Clamp values to within the given range. Defaults to `true`.\n *\n * @public\n */\nexport function transform(\n inputValue: number,\n inputRange: number[],\n outputRange: T[],\n options?: TransformOptions\n): T\n/**\n *\n * Transforms numbers into other values by mapping them from an input range to an output range.\n *\n * Given an input range of `[0, 200]` and an output range of\n * `[0, 1]`, this function will return a value between `0` and `1`.\n * The input range must be a linear series of numbers. The output range\n * can be any supported value type, such as numbers, colors, shadows, arrays, objects and more.\n * Every value in the output range must be of the same type and in the same format.\n *\n * ```jsx\n * export function MyComponent() {\n * const inputRange = [-200, -100, 100, 200]\n * const outputRange = [0, 1, 1, 0]\n * const convertRange = transform(inputRange, outputRange)\n * const output = convertRange(-150)\n *\n * // Returns 0.5\n * return
{output}
\n * }\n *\n * ```\n *\n * @param inputRange - A linear series of numbers (either all increasing or decreasing).\n * @param outputRange - A series of numbers, colors or strings. Must be the same length as `inputRange`.\n * @param options - Clamp: clamp values to within the given range. Defaults to `true`.\n *\n * @public\n */\nexport function transform(\n inputRange: number[],\n outputRange: T[],\n options?: TransformOptions\n): (inputValue: number) => T\nexport function transform(\n ...args:\n | [number, number[], T[], TransformOptions?]\n | [number[], T[], TransformOptions?]\n) {\n const useImmediate = !Array.isArray(args[0])\n const argOffset = useImmediate ? 0 : -1\n const inputValue = args[0 + argOffset] as number\n const inputRange = args[1 + argOffset] as number[]\n const outputRange = args[2 + argOffset] as T[]\n const options = args[3 + argOffset] as TransformOptions\n\n const interpolator = interpolate(inputRange, outputRange, options)\n\n return useImmediate ? interpolator(inputValue) : interpolator\n}\n","import { MotionValue, motionValue } from \".\"\nimport { JSAnimation } from \"../animation/JSAnimation\"\nimport { AnyResolvedKeyframe, ValueAnimationTransition } from \"../animation/types\"\nimport { frame } from \"../frameloop\"\nimport { isMotionValue } from \"./utils/is-motion-value\"\n\n/**\n * Options for useFollowValue hook, extending ValueAnimationTransition\n * but excluding lifecycle callbacks that don't make sense for the hook pattern.\n */\nexport type FollowValueOptions = Omit<\n ValueAnimationTransition,\n \"onUpdate\" | \"onComplete\" | \"onPlay\" | \"onRepeat\" | \"onStop\"\n> & {\n /**\n * When true, the first change from a tracked `MotionValue` source\n * will jump to the new value instead of animating. Subsequent\n * changes animate normally. This prevents unwanted animations\n * on page refresh or back navigation (e.g. `useScroll` + `useSpring`).\n *\n * @default false\n */\n skipInitialAnimation?: boolean\n}\n\n/**\n * Create a `MotionValue` that animates to its latest value using any transition type.\n * Can either be a value or track another `MotionValue`.\n *\n * ```jsx\n * const x = motionValue(0)\n * const y = followValue(x, { type: \"spring\", stiffness: 300 })\n * // or with tween\n * const z = followValue(x, { type: \"tween\", duration: 0.5, ease: \"easeOut\" })\n * ```\n *\n * @param source - Initial value or MotionValue to track\n * @param options - Animation transition options\n * @returns `MotionValue`\n *\n * @public\n */\nexport function followValue(\n source: T | MotionValue,\n options?: FollowValueOptions\n) {\n const initialValue = isMotionValue(source) ? source.get() : source\n const value = motionValue(initialValue)\n\n attachFollow(value, source, options)\n\n return value\n}\n\n/**\n * Attach an animation to a MotionValue that will animate whenever the value changes.\n * Similar to attachSpring but supports any transition type (spring, tween, inertia, etc.)\n *\n * @param value - The MotionValue to animate\n * @param source - Initial value or MotionValue to track\n * @param options - Animation transition options\n * @returns Cleanup function\n *\n * @public\n */\nexport function attachFollow(\n value: MotionValue,\n source: T | MotionValue,\n options: FollowValueOptions = {}\n): VoidFunction {\n const initialValue = value.get()\n\n let activeAnimation: JSAnimation | null = null\n let latestValue = initialValue\n let latestSetter: (v: T) => void\n\n const unit =\n typeof initialValue === \"string\"\n ? initialValue.replace(/[\\d.-]/g, \"\")\n : undefined\n\n const stopAnimation = () => {\n if (activeAnimation) {\n activeAnimation.stop()\n activeAnimation = null\n }\n value.animation = undefined\n }\n\n const startAnimation = () => {\n const currentValue = asNumber(value.get())\n const targetValue = asNumber(latestValue)\n\n // Don't animate if we're already at the target\n if (currentValue === targetValue) {\n stopAnimation()\n return\n }\n\n // Use the running animation's analytical velocity for accuracy,\n // falling back to the MotionValue's velocity for the initial animation.\n // This prevents systematic velocity loss at high frame rates (240hz+).\n const velocity = activeAnimation\n ? activeAnimation.getGeneratorVelocity()\n : value.getVelocity()\n\n stopAnimation()\n\n activeAnimation = new JSAnimation({\n keyframes: [currentValue, targetValue],\n velocity,\n // Default to spring if no type specified (matches useSpring behavior)\n type: \"spring\",\n restDelta: 0.001,\n restSpeed: 0.01,\n ...options,\n onUpdate: latestSetter,\n })\n }\n\n // Use a stable function reference so the frame loop Set deduplicates\n // multiple calls within the same frame (e.g. rapid mouse events)\n const scheduleAnimation = () => {\n startAnimation()\n value.animation = activeAnimation ?? undefined\n value[\"events\"].animationStart?.notify()\n activeAnimation?.then(() => {\n value.animation = undefined\n value[\"events\"].animationComplete?.notify()\n })\n }\n\n value.attach((v, set) => {\n latestValue = v\n latestSetter = (latest) => set(parseValue(latest, unit) as T)\n frame.postRender(scheduleAnimation)\n }, stopAnimation)\n\n if (isMotionValue(source)) {\n let skipNextAnimation = options.skipInitialAnimation === true\n\n const removeSourceOnChange = source.on(\"change\", (v) => {\n if (skipNextAnimation) {\n skipNextAnimation = false\n value.jump(parseValue(v, unit) as T, false)\n } else {\n value.set(parseValue(v, unit) as T)\n }\n })\n\n const removeValueOnDestroy = value.on(\"destroy\", removeSourceOnChange)\n\n return () => {\n removeSourceOnChange()\n removeValueOnDestroy()\n }\n }\n\n return stopAnimation\n}\n\nfunction parseValue(v: AnyResolvedKeyframe, unit?: string) {\n return unit ? v + unit : v\n}\n\nfunction asNumber(v: AnyResolvedKeyframe) {\n return typeof v === \"number\" ? v : parseFloat(v)\n}\n","import { MotionValue } from \".\"\nimport { cancelFrame, frame } from \"../frameloop\"\n\nexport function subscribeValue(\n inputValues: MotionValue[],\n outputValue: MotionValue,\n getLatest: () => O\n) {\n const update = () => outputValue.set(getLatest())\n const scheduleUpdate = () => frame.preRender(update, false, true)\n\n const subscriptions = inputValues.map((v) => v.on(\"change\", scheduleUpdate))\n\n outputValue.on(\"destroy\", () => {\n subscriptions.forEach((unsubscribe) => unsubscribe())\n cancelFrame(update)\n })\n}\n","import { MotionValue, collectMotionValues, motionValue } from \".\"\nimport { subscribeValue } from \"./subscribe-value\"\n\nexport type TransformInputRange = number[]\nexport type SingleTransformer = (input: I) => O\nexport type MultiTransformer = (input: I[]) => O\nexport type ValueTransformer =\n | SingleTransformer\n | MultiTransformer\n\n/**\n * Create a `MotionValue` that transforms the output of other `MotionValue`s by\n * passing their latest values through a transform function.\n *\n * Whenever a `MotionValue` referred to in the provided function is updated,\n * it will be re-evaluated.\n *\n * ```jsx\n * const x = motionValue(0)\n * const y = transformValue(() => x.get() * 2) // double x\n * ```\n *\n * @param transformer - A transform function. This function must be pure with no side-effects or conditional statements.\n * @returns `MotionValue`\n *\n * @public\n */\nexport function transformValue(transform: () => O): MotionValue {\n const collectedValues: MotionValue[] = []\n\n /**\n * Open session of collectMotionValues. Any MotionValue that calls get()\n * inside transform will be saved into this array.\n */\n collectMotionValues.current = collectedValues\n const initialValue = transform()\n collectMotionValues.current = undefined\n\n const value = motionValue(initialValue)\n\n subscribeValue(collectedValues, value, transform)\n\n return value\n}\n","import { MotionValue } from \".\"\nimport { transform, TransformOptions } from \"../utils/transform\"\nimport { transformValue } from \"./transform-value\"\n\nexport type MapInputRange = number[]\n\n/**\n * Create a `MotionValue` that maps the output of another `MotionValue` by\n * mapping it from one range of values into another.\n *\n * @remarks\n *\n * Given an input range of `[-200, -100, 100, 200]` and an output range of\n * `[0, 1, 1, 0]`, the returned `MotionValue` will:\n *\n * - When provided a value between `-200` and `-100`, will return a value between `0` and `1`.\n * - When provided a value between `-100` and `100`, will return `1`.\n * - When provided a value between `100` and `200`, will return a value between `1` and `0`\n *\n * The input range must be a linear series of numbers. The output range\n * can be any value type supported by Motion: numbers, colors, shadows, etc.\n *\n * Every value in the output range must be of the same type and in the same format.\n *\n * ```jsx\n * const x = motionValue(0)\n * const xRange = [-200, -100, 100, 200]\n * const opacityRange = [0, 1, 1, 0]\n * const opacity = mapValue(x, xRange, opacityRange)\n * ```\n *\n * @param inputValue - `MotionValue`\n * @param inputRange - A linear series of numbers (either all increasing or decreasing)\n * @param outputRange - A series of numbers, colors or strings. Must be the same length as `inputRange`.\n * @param options -\n *\n * - clamp: boolean. Clamp values to within the given range. Defaults to `true`\n * - ease: EasingFunction[]. Easing functions to use on the interpolations between each value in the input and output ranges. If provided as an array, the array must be one item shorter than the input and output ranges, as the easings apply to the transition between each.\n *\n * @returns `MotionValue`\n *\n * @public\n */\nexport function mapValue(\n inputValue: MotionValue,\n inputRange: MapInputRange,\n outputRange: O[],\n options?: TransformOptions\n): MotionValue {\n const map = transform(inputRange, outputRange, options)\n return transformValue(() => map(inputValue.get()))\n}\n","import { MotionValue } from \".\"\nimport { AnyResolvedKeyframe, SpringOptions } from \"../animation/types\"\nimport { attachFollow, followValue } from \"./follow-value\"\n\n/**\n * Create a `MotionValue` that animates to its latest value using a spring.\n * Can either be a value or track another `MotionValue`.\n *\n * ```jsx\n * const x = motionValue(0)\n * const y = springValue(x, { stiffness: 300 })\n * ```\n *\n * @param source - Initial value or MotionValue to track\n * @param options - Spring configuration options\n * @returns `MotionValue`\n *\n * @public\n */\nexport function springValue(\n source: T | MotionValue,\n options?: SpringOptions\n) {\n return followValue(source, { type: \"spring\", ...options })\n}\n\n/**\n * Attach a spring animation to a MotionValue that will animate whenever the value changes.\n *\n * @param value - The MotionValue to animate\n * @param source - Initial value or MotionValue to track\n * @param options - Spring configuration options\n * @returns Cleanup function\n *\n * @public\n */\nexport function attachSpring(\n value: MotionValue,\n source: T | MotionValue,\n options?: SpringOptions\n): VoidFunction {\n return attachFollow(value, source, { type: \"spring\", ...options })\n}\n","import { color } from \"../color\"\nimport { complex } from \"../complex\"\nimport { dimensionValueTypes } from \"../dimensions\"\nimport { testValueType } from \"../test\"\n\n/**\n * A list of all ValueTypes\n */\nconst valueTypes = [...dimensionValueTypes, color, complex]\n\n/**\n * Tests a value against the list of ValueTypes\n */\nexport const findValueType = (v: any) => valueTypes.find(testValueType(v))\n","import { ElementOrSelector, resolveElements } from \"../../utils/resolve-elements\"\n\nlet nameCount = 0\n\n/**\n * Generated names live in their own namespace so we can tell a name we own\n * (and must clean up) from an author-defined one - and so a stale generated\n * name left behind by an interrupted transition is re-owned, not mistaken for\n * the author's and leaked.\n */\nconst generatedName = () => `motion-view-${nameCount++}`\n\nconst isGeneratedName = (name: string) => name.startsWith(\"motion-view-\")\n\n/**\n * Tag a captured element with a `view-transition-class` so authors can target\n * its generated layer from CSS (e.g. `::view-transition-group(.hero)`) without\n * the opaque generated name. Tracked in `classed` - separate from the generated\n * names in `assigned` - so cleanup removes the class without ever stripping an\n * author's own inline `view-transition-name`.\n */\nfunction tagClass(\n element: Element,\n className: string | undefined,\n classed: Element[]\n) {\n if (!className) return\n ;(element as HTMLElement).style?.setProperty(\n \"view-transition-class\",\n className\n )\n classed.push(element)\n}\n\n/**\n * Set the element's `view-transition-group` so its layer reconstructs the DOM\n * hierarchy in the pseudo-tree (`contain`) - or stays flat (`none`). Tracked in\n * `grouped` for cleanup. When the element clips (any non-`visible` overflow) its\n * name is recorded in `clipChildren` so the caller can clip the nested children\n * (`::view-transition-group-children(name)`), mirroring the live clip through\n * the whole transition rather than only at the live-DOM handoff.\n *\n * Ignored by browsers without nested view-transition groups, where it harmlessly\n * degrades to the flat default.\n */\nfunction applyGroup(\n element: Element,\n name: string,\n group: string | undefined,\n grouped: Element[],\n clipChildren?: Set\n) {\n if (!group) return\n ;(element as HTMLElement).style?.setProperty(\"view-transition-group\", group)\n grouped.push(element)\n\n if (group !== \"none\" && clipChildren) {\n const style = getComputedStyle(element)\n if (style.overflowX !== \"visible\" || style.overflowY !== \"visible\") {\n clipChildren.add(name)\n }\n }\n}\n\n/**\n * Resolve a selector/Element to elements and ensure each one carries a\n * `view-transition-name` we can target from script.\n *\n * Author-defined names are reused as-is. Elements that are unnamed (or use\n * the browser's `auto`/`match-element`, whose generated name is not exposed\n * to script) are given a unique generated name, set inline so it's captured,\n * and tracked in `assigned` for later cleanup.\n *\n * `registry` maps each Element to its name so the same element keeps its name\n * across both captures (before and after the update), which is what allows a\n * persistent element to animate as a single `group` layer.\n */\nexport function assignViewTransitionNames(\n definition: ElementOrSelector,\n registry: Map,\n assigned: Element[],\n forcedNames?: string[],\n className?: string,\n classed: Element[] = [],\n group?: string,\n grouped: Element[] = [],\n clipChildren?: Set\n): string[] {\n const elements = resolveElements(definition)\n\n /**\n * The new end of a paired morph: give each element the matching name from\n * the old end (by index) so the two share one layer and morph. If the new\n * end resolves to *more* elements than the old end named, the extras have no\n * counterpart - give them a fresh name so they animate as newcomers rather\n * than being silently left unnamed. We return the names actually assigned\n * (sized to the resolved elements), not the raw `forcedNames`, so stagger\n * totals and the layer set stay in step with what's on the page.\n */\n if (forcedNames) {\n return elements.map((element, i) => {\n const existing = registry.get(element)\n if (existing) return existing\n\n const name = forcedNames[i] ?? generatedName()\n ;(element as HTMLElement).style?.setProperty(\n \"view-transition-name\",\n name\n )\n assigned.push(element)\n registry.set(element, name)\n tagClass(element, className, classed)\n applyGroup(element, name, group, grouped, clipChildren)\n\n return name\n })\n }\n\n /**\n * Read every current name up front, before assigning any. Interleaving the\n * reads with the inline `setProperty` writes below would dirty styles\n * between reads and force a style recalc per element; batching the reads\n * keeps it to one. Elements already in the registry keep their name and\n * need no read.\n */\n const currentNames = elements.map((element) =>\n registry.has(element)\n ? undefined\n : getComputedStyle(element).getPropertyValue(\"view-transition-name\")\n )\n\n return elements.map((element, i) => {\n const existing = registry.get(element)\n if (existing) return existing\n\n const current = currentNames[i]\n\n let name: string\n if (\n current &&\n current !== \"none\" &&\n current !== \"auto\" &&\n current !== \"match-element\" &&\n !isGeneratedName(current)\n ) {\n /**\n * The author already named this layer - target it as-is and leave\n * it to them to clean up. `auto`/`match-element` are overridden\n * because their generated name is not exposed to script, and a\n * stale `motion-view-*` (e.g. left by an interrupted transition) is\n * re-owned rather than adopted as an author name and leaked.\n */\n name = current\n } else {\n name = generatedName()\n ;(element as HTMLElement).style?.setProperty(\n \"view-transition-name\",\n name\n )\n assigned.push(element)\n }\n\n registry.set(element, name)\n tagClass(element, className, classed)\n applyGroup(element, name, group, grouped, clipChildren)\n\n return name\n })\n}\n\n/**\n * Remove the `view-transition-name`s we generated and the\n * `view-transition-class`es we applied. Author-defined names are never touched\n * (they're not in `assigned`). Safe to call more than once (e.g. on both a\n * finished and an interrupted transition).\n */\nexport function releaseViewTransitionNames(\n assigned: Element[],\n classed: Element[] = [],\n grouped: Element[] = []\n): void {\n for (const element of assigned) {\n ;(element as HTMLElement).style?.removeProperty(\"view-transition-name\")\n }\n for (const element of classed) {\n ;(element as HTMLElement).style?.removeProperty(\"view-transition-class\")\n }\n for (const element of grouped) {\n ;(element as HTMLElement).style?.removeProperty(\"view-transition-group\")\n }\n}\n","export function chooseLayerType(\n valueName: \"layout\" | \"enter\" | \"exit\" | \"new\" | \"old\"\n): \"group\" | \"old\" | \"new\" {\n if (valueName === \"layout\") return \"group\"\n if (valueName === \"enter\" || valueName === \"new\") return \"new\"\n return \"old\"\n}\n","let pendingRules: Record> = {}\n\nlet style: HTMLStyleElement | null = null\n\nexport const css = {\n set: (selector: string, values: Record) => {\n pendingRules[selector] = values\n },\n\n commit: () => {\n if (!style) {\n style = document.createElement(\"style\")\n style.id = \"motion-view\"\n }\n\n let cssText = \"\"\n\n for (const selector in pendingRules) {\n const rule = pendingRules[selector]\n cssText += `${selector} {\\n`\n for (const [property, value] of Object.entries(rule)) {\n cssText += ` ${property}: ${value};\\n`\n }\n cssText += \"}\\n\"\n }\n\n style.textContent = cssText\n document.head.appendChild(style)\n\n pendingRules = {}\n },\n\n remove: () => {\n if (style && style.parentElement) {\n style.parentElement.removeChild(style)\n }\n },\n}\n","export function getViewAnimationLayerInfo(pseudoElement: string) {\n const match = pseudoElement.match(\n // `group-children` (nested transitions) before `group` so it wins.\n /::view-transition-(old|new|group-children|group|image-pair)\\((.*?)\\)/\n )\n if (!match) return null\n\n return { layer: match[2], type: match[1] }\n}\n","export function getViewAnimations() {\n return document.getAnimations().filter((animation) => {\n const { effect } = animation\n return (\n !!effect &&\n effect.target === document.documentElement &&\n (effect as KeyframeEffect).pseudoElement?.startsWith(\n \"::view-transition\"\n )\n )\n })\n}\n","import { ViewTransitionTarget, ViewTransitionTargetDefinition } from \"../types\"\n\nexport function hasTarget(\n target: ViewTransitionTargetDefinition,\n targets: Map\n) {\n return targets.has(target) && Object.keys(targets.get(target)!).length > 0\n}\n","import { secondsToMilliseconds, warnOnce } from \"motion-utils\"\nimport { GroupAnimation } from \"../animation/GroupAnimation\"\nimport { NativeAnimation } from \"../animation/NativeAnimation\"\nimport { NativeAnimationWrapper } from \"../animation/NativeAnimationWrapper\"\nimport { AnimationPlaybackControls, DOMKeyframesDefinition } from \"../animation/types\"\nimport { getValueTransition } from \"../animation/utils/get-value-transition\"\nimport { mapEasingToNativeEasing } from \"../animation/waapi/easing/map-easing\"\nimport { applyGeneratorOptions } from \"../animation/waapi/utils/apply-generator\"\nimport { cornerRadiusProps } from \"../utils/border-radius\"\nimport { ElementOrSelector, resolveElements } from \"../utils/resolve-elements\"\nimport type { ViewTransitionBuilder } from \"./index\"\nimport { ViewTransitionTarget, ViewTransitionTargetDefinition } from \"./types\"\nimport {\n assignViewTransitionNames,\n releaseViewTransitionNames,\n} from \"./utils/assign-names\"\nimport { chooseLayerType } from \"./utils/choose-layer-type\"\nimport { css } from \"./utils/css\"\nimport { getViewAnimationLayerInfo } from \"./utils/get-layer-info\"\nimport { getViewAnimations } from \"./utils/get-view-animations\"\nimport { hasTarget } from \"./utils/has-target\"\n\nconst definitionNames = [\"layout\", \"enter\", \"exit\", \"new\", \"old\"] as const\n\ntype CornerRadii = Record<(typeof cornerRadiusProps)[number], string>\n\n/**\n * Whether a computed border-radius is square (every component zero). Splitting\n * on whitespace handles two-value/elliptical radii like \"0px 20px\" - a leading\n * `parseFloat` alone would misread the non-zero vertical radius as square.\n */\nconst isSquareRadius = (radius: string) =>\n radius.split(\" \").every((value) => parseFloat(value) === 0)\n\n/**\n * The `ViewTransitionTarget` buckets driving each generated layer type, in\n * priority order - the inverse of `chooseLayerType`. The new view is driven by\n * `new`/`enter`, the old by `old`/`exit`. `group-children`/`image-pair` have no\n * bucket; they follow the default layout timing.\n */\nconst typeBuckets: Record = {\n group: [\"layout\"],\n new: [\"new\", \"enter\"],\n old: [\"old\", \"exit\"],\n}\n\n/**\n * Default \"absent\" origin for a single-value keyframe, by pseudo type, so e.g.\n * `enter({ scale: 1 })` grows in from 0.85 and `exit({ opacity: 0 })` fades\n * from 1. `enter` prefers the matching `exit` value over these (see below).\n */\nconst ORIGIN_DEFAULTS: Record> = {\n new: { opacity: 0, scale: 0.85 },\n old: { opacity: 1, scale: 1 },\n}\n\n/**\n * How much two box aspect ratios must differ before a morph is treated as\n * aspect-changing (and so worth cropping). Matches the projection engine's\n * `preserve-aspect` threshold, so small layout jitter doesn't trigger a crop.\n */\nconst ASPECT_TOLERANCE = 0.2\n\nexport function startViewAnimation(\n builder: ViewTransitionBuilder\n): Promise {\n const {\n update,\n targets,\n resolveDefs,\n cropOverride,\n pairs,\n classNames,\n flatGroups,\n options: defaultOptions,\n } = builder\n\n if (!document.startViewTransition) {\n // An async IIFE (not `new Promise(async …)`) so a throwing/rejecting\n // update rejects this promise rather than leaving it unsettled.\n return (async () => {\n await update()\n return new GroupAnimation([])\n })()\n }\n\n /**\n * Resolve any selector/Element targets to layer names, assigning a\n * `view-transition-name` to each element as we go. We run this before the\n * update (so the elements are captured in the old snapshot) and again\n * after it (for the new snapshot). An element present in both keeps the\n * same name and animates as a single `group` layer.\n */\n const nameRegistry = new Map()\n const assigned: Element[] = []\n /**\n * Elements we tagged with a `view-transition-class` (via `.class()`),\n * tracked separately from `assigned` so cleanup removes the class without\n * ever stripping an author's own inline `view-transition-name`.\n */\n const classed: Element[] = []\n /**\n * Elements we set a `view-transition-group` on (for nesting), tracked for\n * cleanup. `clipChildren` collects the names of nested parents that clip in\n * the live layout, so their `::view-transition-group-children` is clipped\n * through the transition - not just once the live DOM takes back over.\n */\n const grouped: Element[] = []\n const clipChildren = new Set()\n const layerTargets = new Map()\n const croppedNames = new Set()\n /**\n * Each layer's explicit `.crop(true | false)` override (by resolved name),\n * so `finalizeCrop` can let an author's choice win over the morph default.\n */\n const cropForName = new Map()\n /**\n * Each layer's stagger position (index + total) within its subject, per\n * snapshot. Resolving against the snapshot the layer belongs to keeps\n * stagger correct when `update()` replaces the matched elements, and lets\n * us skip a layer that's absent from a snapshot (e.g. an exited element\n * has no `new` pseudo-element).\n */\n const layerStagger = new Map<\n string,\n { old?: [number, number]; new?: [number, number] }\n >()\n /**\n * Names allocated for a paired subject in the old snapshot, replayed onto\n * its new-snapshot target so both ends share a layer and morph.\n */\n const pairNames = new Map()\n /**\n * The old (`from`) elements of each paired subject, so their names can be\n * transferred off before the new (`to`) elements inherit them.\n */\n const pairFrom = new Map()\n\n const resolveLayers = (phase: \"old\" | \"new\") => {\n targets.forEach((target, definition) => {\n const className = classNames.get(definition)\n /**\n * Nest each resolved layer under its DOM-ancestor layer by default\n * (`contain`), so an ancestor's clip/transform/opacity reach it\n * through the transition; `.group(false)` opts a subject out (`none`)\n * to stay flat and escape. Skipped for root / pre-named layers, which\n * aren't elements we resolve and style.\n */\n const group =\n definition === \"root\" || !resolveDefs.has(definition)\n ? undefined\n : flatGroups.has(definition)\n ? \"none\"\n : \"contain\"\n let names: string[]\n if (definition === \"root\" || !resolveDefs.has(definition)) {\n names = [definition as string]\n } else if (pairs.has(definition)) {\n /**\n * Paired morph: name the old target in the old snapshot, then\n * force the same name(s) onto the new target in the new one, so\n * two different elements morph as a single layer.\n */\n if (phase === \"old\") {\n pairFrom.set(\n definition,\n resolveElements(definition as ElementOrSelector)\n )\n names = assignViewTransitionNames(\n definition as ElementOrSelector,\n nameRegistry,\n assigned,\n undefined,\n className,\n classed,\n group,\n grouped,\n clipChildren\n )\n pairNames.set(definition, names)\n } else {\n /**\n * Transfer the name(s) off the `from` elements before the\n * `to` elements inherit them. A `from` that survives into\n * the new snapshot (e.g. hidden with `visibility: hidden`\n * rather than removed) would otherwise keep the name and\n * collide - \"duplicate view-transition-name\".\n */\n for (const el of pairFrom.get(definition) ?? []) {\n ;(el as HTMLElement).style?.removeProperty(\n \"view-transition-name\"\n )\n /**\n * Drop the old end from the registry too, so the new\n * end alone supplies this name's `new` crop radii - we\n * neither re-measure nor get ordered by a stale element.\n */\n nameRegistry.delete(el)\n }\n names = assignViewTransitionNames(\n pairs.get(definition) as ElementOrSelector,\n nameRegistry,\n assigned,\n pairNames.get(definition),\n className,\n classed,\n group,\n grouped,\n clipChildren\n )\n }\n } else {\n names = assignViewTransitionNames(\n definition as ElementOrSelector,\n nameRegistry,\n assigned,\n undefined,\n className,\n classed,\n group,\n grouped,\n clipChildren\n )\n }\n\n // Record any explicit `.crop(true | false)` per resolved name; the\n // crop set itself is computed later by `finalizeCrop` (it needs both\n // snapshots to know which morphs change aspect ratio).\n const override = cropOverride.get(definition)\n\n names.forEach((name, index) => {\n /**\n * If two subjects resolve to the same element, merge their\n * definitions so neither subject's animations are dropped.\n */\n const existing = layerTargets.get(name)\n layerTargets.set(\n name,\n existing && existing !== target\n ? { ...existing, ...target }\n : target\n )\n\n if (override !== undefined) cropForName.set(name, override)\n\n const stagger = layerStagger.get(name) ?? {}\n stagger[phase] = [index, names.length]\n layerStagger.set(name, stagger)\n })\n })\n }\n\n /**\n * The stagger index/total for a layer, resolved against the snapshot it\n * belongs to. Returns index -1 when the layer is absent from that snapshot\n * so the caller can skip a pseudo-element that doesn't exist.\n */\n const staggerPosition = (name: string, type: string) => {\n const stagger = layerStagger.get(name)\n const position =\n type === \"old\"\n ? stagger?.old\n : type === \"new\"\n ? stagger?.new\n : // group / group-children / image-pair persist across both.\n stagger?.new ?? stagger?.old\n return position ?? ([-1, 1] as const)\n }\n\n /**\n * Merge default + per-layer transition options for a generated layer and\n * resolve any stagger/delay function against this element's position. Used\n * by both the morph-retiming and crop corner-radius passes.\n */\n const resolveLayerTransition = (\n target: ViewTransitionTarget | undefined,\n type: string,\n transitionName: string,\n index: number,\n total: number\n ) => {\n const transition = mergeTransition(\n getValueTransition(defaultOptions, transitionName),\n getValueTransition(\n (layerOptions(target, type) ?? {}) as any,\n transitionName\n )\n )\n\n if (typeof transition.delay === \"function\") {\n transition.delay = transition.delay(index, total)\n }\n\n return transition\n }\n\n /**\n * Resolve a layer's group (`layout`) timing to plain WAAPI values: native\n * ms `delay`/`duration` and a baked `ease`. The single source of group\n * timing, shared by the generated-group retiming and the crop corner-radius\n * pass so the rounded clip animates on exactly the box's timing. It returns\n * no generator `type` (the WAAPI-only `NativeAnimation` rejects a string\n * type) nor `repeat`/`times` (which the group's `updateTiming` ignores), so\n * none of them can leak into the radius animation and desync it.\n */\n const resolveGroupTiming = (name: string) => {\n const [index, total] = staggerPosition(name, \"group\")\n const transition = resolveLayerTransition(\n layerTargets.get(name),\n \"group\",\n \"layout\",\n index === -1 ? 0 : index,\n total\n )\n transition.duration &&= secondsToMilliseconds(transition.duration)\n const { delay = 0, duration, ease } = applyGeneratorOptions(transition)\n return { delay: secondsToMilliseconds(delay), duration, ease }\n }\n\n /**\n * Each layer's measured box + corner radii per snapshot. The box lets\n * `finalizeCrop` tell whether a morph's aspect ratio changed (the only case\n * worth cropping); the radii let a cropped morph's group clip animate each\n * corner from the old element's radius to the new element's, keeping it\n * rounded where `overflow: clip` would otherwise square the corners.\n *\n * We never flatten the source for capture (a snapshot is a paint of the live\n * DOM, so squaring an element just for its capture would flash one real\n * square frame). For an aspect-changing morph `object-fit: cover` crops each\n * snapshot's own baked corners off-screen mid-morph, so the animated clip is\n * the only visible corner; a near-same-aspect forced crop (`.crop(true)`)\n * can't hide the outgoing snapshot's silhouette, but the endpoints coincide.\n */\n const cropMeasurements = new Map<\n string,\n {\n old?: { width: number; height: number; radii: CornerRadii }\n new?: { width: number; height: number; radii: CornerRadii }\n }\n >()\n\n const measureLayers = (phase: \"old\" | \"new\") =>\n nameRegistry.forEach((name, element) => {\n const el = element as HTMLElement\n const rect = el.getBoundingClientRect?.()\n if (rect && rect.height) {\n const style = getComputedStyle(el)\n const radii = {} as CornerRadii\n for (const corner of cornerRadiusProps) {\n radii[corner] = style[corner]\n }\n const entry = cropMeasurements.get(name) ?? {}\n entry[phase] = { width: rect.width, height: rect.height, radii }\n cropMeasurements.set(name, entry)\n }\n })\n\n /**\n * With both snapshots measured, settle which layers crop. The default crops\n * only a morph whose aspect ratio *changes* between snapshots - the one case\n * where `object-fit: cover` does real work. A same-aspect morph or a\n * fade-only layer is left uncropped: its corners scale naturally (no flash\n * from squaring, no `overflow: clip` eating its shadow) and a backdrop can't\n * be clipped to nothing. An explicit `.crop(true | false)` overrides either\n * way. Runs after both snapshots are measured, since aspect needs both.\n */\n const finalizeCrop = () => {\n croppedNames.clear()\n for (const name of layerStagger.keys()) {\n if (name === \"root\") continue\n // An explicit `.crop(true | false)` wins; otherwise crop a morph\n // whose aspect ratio changed.\n if (cropForName.get(name) ?? aspectChanged(name)) {\n croppedNames.add(name)\n }\n }\n }\n\n /**\n * Whether a layer is a morph whose box aspect ratio changed between\n * snapshots (beyond a small tolerance). Fade-only layers (one snapshot) are\n * never \"changed\".\n */\n const aspectChanged = (name: string) => {\n const box = cropMeasurements.get(name)\n if (!box?.old || !box?.new || !box.old.height || !box.new.height) {\n return false\n }\n return (\n Math.abs(\n box.old.width / box.old.height -\n box.new.width / box.new.height\n ) > ASPECT_TOLERANCE\n )\n }\n\n /**\n * Write the persistent view-transition CSS: suppress root capture when the\n * root has no animations of its own; force linear timing (baked into the\n * keyframes, so we can retime later via updateTiming); and clip +\n * object-fit: cover every cropped morph (the UA default overflows on\n * aspect-ratio change).\n *\n * `css.commit` replaces rather than appends, so we re-set the full rule set\n * each call - the crop rules are only known after `finalizeCrop` runs in the\n * update callback, so the second call writes them.\n */\n const commitViewCSS = () => {\n if (!hasTarget(\"root\", targets)) {\n css.set(\":root\", { \"view-transition-name\": \"none\" })\n }\n\n css.set(\n \"::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)\",\n { \"animation-timing-function\": \"linear !important\" }\n )\n\n croppedNames.forEach((name) => {\n css.set(`::view-transition-group(${name})`, { overflow: \"clip\" })\n css.set(\n `::view-transition-old(${name}), ::view-transition-new(${name})`,\n { width: \"100%\", height: \"100%\", \"object-fit\": \"cover\" }\n )\n })\n\n /**\n * Clip the nested children of any layer that clips in the live layout,\n * so a wrapper crops its child for the whole morph (mirroring the DOM)\n * rather than only at the live-DOM handoff. No-op on browsers without\n * nested view-transition groups.\n */\n clipChildren.forEach((name) => {\n css.set(`::view-transition-group-children(${name})`, {\n overflow: \"clip\",\n })\n })\n\n css.commit() // Write\n }\n\n const cleanup = () => {\n releaseViewTransitionNames(assigned, classed, grouped)\n css.remove() // Write\n }\n\n const callback = async () => {\n await update()\n\n /**\n * Re-resolve so elements created by the update are named for the new\n * snapshot, then measure them. With both snapshots measured we can\n * settle the crop set (aspect-changing morphs + forced).\n */\n resolveLayers(\"new\")\n measureLayers(\"new\")\n finalizeCrop()\n\n /**\n * Re-commit the crop CSS unconditionally: `finalizeCrop` is computed\n * here (after both snapshots are measured), so the clip rules must be\n * (re)written to match the settled set.\n */\n commitViewCSS()\n }\n\n let transition: ViewTransition\n try {\n resolveLayers(\"old\")\n /**\n * Measure the old snapshot against the optimistic crop set (the new\n * snapshot doesn't exist yet, so aspect change can't be known here;\n * `finalizeCrop` settles it post-update).\n */\n measureLayers(\"old\")\n commitViewCSS()\n transition = document.startViewTransition(callback)\n } catch (error) {\n /**\n * The prelude writes inline names before the transition exists. If it\n * throws (e.g. startViewTransition rejects in a bad UA state), release\n * them so we neither leak DOM state nor stall the queue on a promise\n * that never settles - hand back a rejection it can advance past.\n */\n cleanup()\n return Promise.reject(error)\n }\n\n transition.finished.finally(cleanup)\n\n return new Promise((resolve, reject) => {\n transition.ready\n .then(() => {\n const generatedViewAnimations = getViewAnimations()\n\n const animations: AnimationPlaybackControls[] = []\n\n /**\n * Create animations for each of our explicitly-defined subjects.\n * `opacityAnimated` additionally tracks which `${name}:${type}`\n * we faded, so we can keep the UA `plus-lighter` blend only for a\n * genuine opacity crossfade (both sides fading) and drop it for a\n * slide/transform, where additive compositing would flash bright.\n */\n const explicitlyAnimated = new Set()\n const opacityAnimated = new Set()\n layerTargets.forEach((target, name) => {\n const stagger = layerStagger.get(name)\n /**\n * Presence: `enter` only fires for a pure newcomer (a new\n * view with no old), `exit` only for a pure leaver. A\n * survivor (both) gets neither - it just morphs.\n */\n const enterApplies = !!stagger?.new && !stagger?.old\n const exitApplies = !!stagger?.old && !stagger?.new\n\n for (const key of definitionNames) {\n if (!target[key]) continue\n if (key === \"enter\" && !enterApplies) continue\n if (key === \"exit\" && !exitApplies) continue\n\n const type = chooseLayerType(\n key as keyof ViewTransitionTarget\n )\n const [index, total] = staggerPosition(name, type)\n // Skip a layer absent from its snapshot.\n if (index === -1) continue\n\n const { keyframes, options } =\n target[key as keyof ViewTransitionTarget]!\n\n for (let [valueName, valueKeyframes] of Object.entries(\n keyframes\n )) {\n // Skip only missing values - `0` (e.g. opacity: 0)\n // is valid and must reach the from-value inference.\n if (valueKeyframes == null) continue\n\n /**\n * The view path hands keyframes straight to WAAPI,\n * so Motion's `x`/`y` shorthands (compiled to\n * `transform` only via the value pipeline) have no\n * effect. Warn and skip - use `transform`/`translate`.\n */\n if (valueName === \"x\" || valueName === \"y\") {\n warnOnce(\n false,\n `animateView() animates view-transition layers with CSS properties; the \"${valueName}\" shorthand has no effect - use transform, e.g. { transform: \"translateX(40px)\" }.`\n )\n continue\n }\n\n /**\n * enter/exit win over new/old on a shared property -\n * skip it here when the gated bucket also defines it.\n */\n if (\n key === \"new\" &&\n enterApplies &&\n target.enter?.keyframes[\n valueName as keyof DOMKeyframesDefinition\n ] != null\n ) {\n continue\n }\n if (\n key === \"old\" &&\n exitApplies &&\n target.exit?.keyframes[\n valueName as keyof DOMKeyframesDefinition\n ] != null\n ) {\n continue\n }\n\n const valueOptions = mergeTransition(\n getValueTransition(\n defaultOptions as any,\n valueName\n ),\n getValueTransition(options as any, valueName)\n )\n\n /**\n * Infer an origin for a single-value keyframe. An\n * `enter` mirrors the matching `exit` value (a\n * defined exit reverses into the enter for free);\n * otherwise the per-type default (opacity 0/1, scale\n * 0.85). No default -> left as-is (animates from the\n * live value).\n *\n * `new`/`old` fire for survivors too, where only the\n * opacity crossfade default applies - a transform\n * default like scale 0.85 would pop a persisting\n * element, so gate it on the layer actually\n * entering/leaving.\n */\n if (!Array.isArray(valueKeyframes)) {\n const exitValue =\n key === \"enter\"\n ? target.exit?.keyframes[\n valueName as keyof DOMKeyframesDefinition\n ]\n : undefined\n const allowDefault =\n valueName === \"opacity\" ||\n (type === \"new\" ? enterApplies : exitApplies)\n const from =\n exitValue != null\n ? Array.isArray(exitValue)\n ? exitValue[exitValue.length - 1]\n : exitValue\n : allowDefault\n ? ORIGIN_DEFAULTS[type]?.[valueName]\n : undefined\n if (from !== undefined) {\n valueKeyframes = [from, valueKeyframes]\n }\n }\n\n /**\n * Resolve stagger function if provided, per element\n * across this subject's resolved layers.\n */\n if (typeof valueOptions.delay === \"function\") {\n valueOptions.delay = valueOptions.delay(\n index,\n total\n )\n }\n\n valueOptions.duration &&= secondsToMilliseconds(\n valueOptions.duration\n )\n\n valueOptions.delay &&= secondsToMilliseconds(\n valueOptions.delay\n )\n\n animations.push(\n new NativeAnimation({\n ...valueOptions,\n element: document.documentElement,\n name: valueName,\n pseudoElement: `::view-transition-${type}(${name})`,\n keyframes: valueKeyframes,\n })\n )\n explicitlyAnimated.add(`${name}:${type}`)\n if (valueName === \"opacity\") {\n opacityAnimated.add(`${name}:${type}`)\n }\n }\n }\n })\n\n /**\n * Handle browser generated animations\n */\n for (const animation of generatedViewAnimations) {\n if (animation.playState === \"finished\") continue\n\n const { effect } = animation\n if (!effect || !(effect instanceof KeyframeEffect)) continue\n\n const { pseudoElement } = effect\n if (!pseudoElement) continue\n\n const name = getViewAnimationLayerInfo(pseudoElement)\n if (!name) continue\n\n const targetDefinition = layerTargets.get(name.layer)\n\n /**\n * We built our own animation for this layer, so drop the\n * browser-generated fade we're replacing. The UA\n * `plus-lighter` blend is a *separate* generated animation on\n * the same pseudo (it sets `mix-blend-mode` in its keyframes):\n * keep it *only* for a true opacity crossfade - both sides\n * fading - so a symmetric crossfade composites without\n * darkening, but a slide/transform (where both layers stay\n * opaque and overlap) doesn't flash bright from the addition.\n */\n if (explicitlyAnimated.has(`${name.layer}:${name.type}`)) {\n const isCrossfade =\n opacityAnimated.has(`${name.layer}:new`) &&\n opacityAnimated.has(`${name.layer}:old`)\n if (\n isCrossfade &&\n effect\n .getKeyframes()\n .some((keyframe) => keyframe.mixBlendMode)\n ) {\n animations.push(new NativeAnimationWrapper(animation))\n } else {\n animation.cancel()\n }\n continue\n }\n\n /**\n * Drop the orphaned half of the default crossfade. The UA\n * fades old out and new in as a *pair*; if the opposing half\n * was explicitly overridden with something other than an\n * opacity fade (a clip or transform reveal), this side's\n * default opacity fade has no partner - left to run it would\n * dissolve what should be a static backdrop (e.g.\n * `.new({ clipPath })` should reveal over a still old view,\n * not fade the old out around the growing clip). Cancel it -\n * and its `plus-lighter` sibling on the same pseudo, which\n * would otherwise flash bright where the two opaque layers\n * overlap. A genuine crossfade (the opposing side also fading\n * opacity) keeps both halves and is handled above.\n */\n const opposite =\n name.type === \"old\"\n ? \"new\"\n : name.type === \"new\"\n ? \"old\"\n : undefined\n if (\n opposite &&\n explicitlyAnimated.has(\n `${name.layer}:${opposite}`\n ) &&\n !opacityAnimated.has(`${name.layer}:${opposite}`)\n ) {\n animation.cancel()\n continue\n }\n\n /**\n * Otherwise retime the browser-generated animation to\n * Motion's timing. This auto-enables the layout (group)\n * morph for any resolved/named target, and applies the\n * default timing to old/new layers we haven't explicitly\n * overridden.\n *\n * group + group-children both follow the layout timing so\n * the nesting container stays in sync with the morph.\n */\n /**\n * A survivor's old + new are the two halves of one\n * `plus-lighter` crossfade. They must share identical timing\n * (so their opacities stay mirrored and sum to 1 - else the\n * additive blend flashes bright wherever both are partly\n * visible) and fade linearly (the bounce belongs on the\n * group's geometry, not the opacity). So time them as the\n * group, rather than via their own - potentially staggered,\n * or enter/exit-derived - old/new options.\n */\n const stagger = layerStagger.get(name.layer)\n const isMorphCrossfade =\n (name.type === \"old\" || name.type === \"new\") &&\n !!stagger?.old &&\n !!stagger?.new\n\n let timing: {\n delay: number\n duration?: number\n easing: string\n }\n if (name.type.startsWith(\"group\")) {\n // group + group-children follow the resolved group\n // timing - the single source shared with the crop\n // corner-radius pass below.\n const { delay, duration, ease } = resolveGroupTiming(\n name.layer\n )\n timing = {\n delay,\n duration,\n easing: mapEasingToNativeEasing(\n ease,\n duration!\n ) as string,\n }\n } else {\n const timingType = isMorphCrossfade ? \"group\" : name.type\n const [index, total] = staggerPosition(\n name.layer,\n timingType\n )\n const transitionName =\n timingType === \"group\" ? \"layout\" : \"\"\n let animationTransition = resolveLayerTransition(\n targetDefinition,\n timingType,\n transitionName,\n index === -1 ? 0 : index,\n total\n )\n\n /**\n * The crossfade should resolve at the spring's\n * *perceptual* (visual) duration - the geometry can keep\n * bouncing, but the opacity shouldn't drag through the\n * settle. So capture `visualDuration` before\n * `applyGeneratorOptions` replaces it with the full\n * overshoot duration, and use it for the fade.\n */\n const visualDuration = animationTransition.visualDuration\n\n animationTransition.duration &&= secondsToMilliseconds(\n animationTransition.duration\n )\n\n animationTransition =\n applyGeneratorOptions(animationTransition)\n\n timing = {\n delay: secondsToMilliseconds(\n animationTransition.delay ?? 0\n ),\n duration:\n isMorphCrossfade && visualDuration !== undefined\n ? secondsToMilliseconds(visualDuration)\n : animationTransition.duration,\n easing: isMorphCrossfade\n ? \"linear\"\n : (mapEasingToNativeEasing(\n animationTransition.ease,\n animationTransition.duration!\n ) as string),\n }\n }\n\n effect.updateTiming(timing)\n\n animations.push(new NativeAnimationWrapper(animation))\n }\n\n /**\n * Round each cropped layer's clip. Its `::view-transition-group`\n * has `overflow: clip`, which would otherwise square the corners\n * mid-morph; animate each corner from the old element's radius to\n * the new element's so the crop stays rounded. Timed as the group\n * (`layout`) so the radius tracks the morphing box.\n */\n cropMeasurements.forEach((entry, name) => {\n if (!croppedNames.has(name)) return\n\n // Reuse the group's resolved timing - native ms delay/\n // duration + a baked ease, with no generator `type` or\n // repeat/times to leak into (or throw inside) NativeAnimation.\n const { delay, duration, ease } = resolveGroupTiming(name)\n\n for (const corner of cornerRadiusProps) {\n // `||` (not `??`) so an empty measurement falls back to\n // the other snapshot rather than an invalid keyframe.\n const from =\n entry.old?.radii[corner] ||\n entry.new?.radii[corner] ||\n \"0px\"\n const to =\n entry.new?.radii[corner] ||\n entry.old?.radii[corner] ||\n \"0px\"\n // Nothing to round if the corner is square at both ends.\n if (isSquareRadius(from) && isSquareRadius(to)) continue\n\n animations.push(\n new NativeAnimation({\n element: document.documentElement,\n name: corner,\n pseudoElement: `::view-transition-group(${name})`,\n keyframes: [from, to],\n delay,\n duration,\n ease,\n })\n )\n }\n })\n\n resolve(new GroupAnimation(animations))\n })\n .catch(() =>\n /**\n * `ready` rejects when the transition is skipped - no visual\n * change, or superseded by an interrupting transition. The DOM\n * update still applied, so settle with no animations rather than\n * surfacing it as an error to an awaiting caller. A genuine\n * failure in `update()` rejects `updateCallbackDone` (already\n * settled by now), so propagate that instead.\n */\n transition.updateCallbackDone.then(\n () => resolve(new GroupAnimation([])),\n reject\n )\n )\n })\n}\n\n/**\n * The options that should time a given generated layer type, so a retimed\n * group/old/new picks up any per-target transition the user provided. Checks\n * the type's buckets in priority order (e.g. `new` before `enter`).\n */\nfunction layerOptions(target: ViewTransitionTarget | undefined, type: string) {\n for (const bucket of typeBuckets[type] ?? []) {\n const options = target?.[bucket]?.options\n if (options) return options\n }\n}\n\n/**\n * Merge a base transition (e.g. the default `options`) with a per-layer/value\n * override. An explicit `duration` on the override must win over an inherited\n * generator's own timing: a spring prefers `visualDuration`, and\n * `spring.applyToOptions` overwrites `duration` with the computed settle time -\n * so without this the override is silently discarded. Dropping the inherited\n * `type`/`visualDuration` makes the layer a plain tween of that duration, unless\n * it asked for its own generator `type`/`visualDuration`.\n */\nfunction mergeTransition(base: any, override: any) {\n const merged = { ...base, ...override }\n\n if (override.duration !== undefined) {\n if (override.visualDuration === undefined) delete merged.visualDuration\n if (override.type === undefined) delete merged.type\n }\n\n return merged\n}\n","import { removeItem } from \"motion-utils\"\nimport type { ViewTransitionBuilder } from \".\"\nimport { microtask } from \"../frameloop/microtask\"\nimport { startViewAnimation } from \"./start\"\n\nlet builders: ViewTransitionBuilder[] = []\n\nlet current: ViewTransitionBuilder | null = null\n\nfunction next() {\n current = null\n const [nextBuilder] = builders\n if (nextBuilder) start(nextBuilder)\n}\n\nfunction start(builder: ViewTransitionBuilder) {\n removeItem(builders, builder)\n current = builder\n startViewAnimation(builder)\n .then((animation) => {\n builder.notifyReady(animation)\n return animation.finished\n })\n // A genuinely failed transition (a throwing update) rejects the\n // builder; a skipped/interrupted one resolves with no animations (see\n // start.ts). Either way, advance the queue - else later transitions hang.\n .catch((error) => builder.notifyReject(error))\n .finally(next)\n}\n\nfunction processQueue() {\n /**\n * Iterate backwards over the builders array. We can ignore the\n * \"wait\" animations. If we have an interrupting animation in the\n * queue then we need to batch all preceeding animations into it.\n * Currently this only batches the update functions but will also\n * need to batch the targets.\n */\n for (let i = builders.length - 1; i >= 0; i--) {\n const builder = builders[i]\n const { interrupt } = builder.options\n\n if (interrupt === \"immediate\") {\n const batchedUpdates = builders.slice(0, i + 1).map((b) => b.update)\n const remaining = builders.slice(i + 1)\n\n builder.update = () => {\n batchedUpdates.forEach((update) => update())\n }\n\n // Put the current builder at the front, followed by any \"wait\" builders\n builders = [builder, ...remaining]\n\n break\n }\n }\n\n if (!current || builders[0]?.options.interrupt === \"immediate\") {\n next()\n }\n}\n\nexport function addToQueue(builder: ViewTransitionBuilder) {\n builders.push(builder)\n microtask.render(processQueue)\n}\n","import { noop } from \"motion-utils\"\nimport type { GroupAnimation } from \"../animation/GroupAnimation\"\nimport { AnimationOptions, DOMKeyframesDefinition } from \"../animation/types\"\nimport { addToQueue } from \"./queue\"\nimport {\n ViewTransitionOptions,\n ViewTransitionTarget,\n ViewTransitionTargetDefinition,\n} from \"./types\"\nimport \"./types.global\"\n\n// Re-export the public view-transition types so they flow out through\n// motion-dom -> framer-motion -> motion alongside `animateView`.\nexport type * from \"./types\"\n\nexport class ViewTransitionBuilder {\n private currentSubject: ViewTransitionTargetDefinition = \"root\"\n\n targets = new Map()\n\n /**\n * Definitions that must be resolved to elements (and assigned a\n * `view-transition-name`) rather than treated as pre-named layers.\n */\n resolveDefs = new Set()\n\n /**\n * Per-subject crop override: `true` forces the crop (clip + object-fit:\n * cover + animated corner radii) on, `false` forces it off. A subject with\n * no entry uses the default - crop only a genuine morph (a layer present in\n * both snapshots), so a fade-only enter/exit isn't clipped to nothing.\n */\n cropOverride = new Map()\n\n /**\n * Subjects paired with a different new-snapshot target (the second `.add()`\n * argument), so two distinct elements share one name and morph into each\n * other - a shared-element transition.\n */\n pairs = new Map<\n ViewTransitionTargetDefinition,\n ViewTransitionTargetDefinition\n >()\n\n /**\n * A `view-transition-class` to apply to each subject's resolved elements,\n * so authors can target the generated layers from CSS by class rather than\n * the opaque generated name.\n */\n classNames = new Map()\n\n /**\n * Subjects opted out of automatic group nesting via `.group(false)`. Their\n * layer stays a flat top-level group (`view-transition-group: none`) instead\n * of nesting under its DOM-ancestor layer - so it animates independently and\n * escapes an ancestor's clip/transform (e.g. an element that lifts out of a\n * card and flies across, which nesting would clip to the card).\n */\n flatGroups = new Set()\n\n update: () => void | Promise\n\n options: ViewTransitionOptions\n\n notifyReady: (value: GroupAnimation) => void = noop\n\n notifyReject: (error: unknown) => void = noop\n\n private readyPromise = new Promise((resolve, reject) => {\n this.notifyReady = resolve\n this.notifyReject = reject\n })\n\n constructor(\n update: () => void | Promise,\n options: ViewTransitionOptions = {}\n ) {\n this.update = update\n this.options = {\n interrupt: \"wait\",\n ...options,\n }\n // Avoid an unhandled rejection when a failed transition has no\n // `.then(_, reject)` handler attached (e.g. fire-and-forget).\n this.readyPromise.catch(noop)\n addToQueue(this)\n }\n\n /**\n * Target elements resolved from a selector or Element, each assigned a\n * `view-transition-name` automatically.\n *\n * Passing a second target pairs them: the first is resolved in the old\n * snapshot and the second in the new, sharing one name so two *different*\n * elements morph into each other (e.g. `.add(card, \".modal\")`). Symmetric -\n * pass them the other way round to morph back.\n */\n add(\n subject: ViewTransitionTargetDefinition,\n newSubject?: ViewTransitionTargetDefinition\n ) {\n this.currentSubject = subject\n this.resolveDefs.add(subject)\n if (newSubject !== undefined) this.pairs.set(subject, newSubject)\n // Register the subject so it participates (and gets an automatic\n // layout/morph animation) even without an explicit enter/exit/layout.\n if (!this.targets.has(subject)) this.targets.set(subject, {})\n\n return this\n }\n\n /**\n * Control this subject's crop (clip + `object-fit: cover` + animated\n * corners). By default a subject auto-crops only when it actually morphs -\n * present in both snapshots (a survivor, or an `.add(a, b)` pair). A\n * fade-only enter/exit has no second box to crop against, so it's left to\n * the browser default; in particular the `overflow: clip` a crop adds would\n * otherwise clip a mis-sized enter/exit layer to nothing.\n *\n * `.crop(false)` forces the crop off (e.g. a text morph, where\n * `object-fit: cover` clips glyphs as the box grows); `.crop(true)` forces\n * it on for a non-morph the default wouldn't otherwise crop.\n */\n crop(enabled = true) {\n this.cropOverride.set(this.currentSubject, enabled)\n\n return this\n }\n\n /**\n * By default a subject's layer nests under its nearest DOM-ancestor layer\n * (`view-transition-group: contain`), so the ancestor's clip/transform/opacity\n * apply to it through the transition - mirroring how the DOM actually paints,\n * and letting a wrapper crop its child for the whole morph rather than only\n * once the live DOM takes back over. (Needs a browser that supports nested\n * view-transition groups; elsewhere it degrades to the flat default.)\n *\n * Call `.group(false)` to opt out: the layer stays flat and top-level, so it\n * animates independently and escapes an ancestor's clip - e.g. an element\n * that should lift out of a card and fly across, which nesting would clip.\n */\n group(enabled = true) {\n enabled\n ? this.flatGroups.delete(this.currentSubject)\n : this.flatGroups.add(this.currentSubject)\n\n return this\n }\n\n /**\n * Tag this subject's generated layers with a `view-transition-class`, so\n * they can be targeted from CSS - `::view-transition-group(.name)`,\n * `::view-transition-old/new(.name)`, `::view-transition-image-pair(.name)`\n * - without the opaque generated `view-transition-name`. Because `.add()`\n * can match many elements, a shared class targets them all at once (and,\n * for a pair, both ends). The escape hatch for z-index / custom keyframes\n * on a morph layer.\n */\n class(name: string) {\n this.classNames.set(this.currentSubject, name)\n\n return this\n }\n\n /**\n * Set the transition for this subject's morph. The morph is enabled\n * automatically by `.add()`; this just customises its timing (duration,\n * easing, a `delay`/`stagger`, …). On the implicit `root` subject it also\n * opts the page into the transition (the root crossfade).\n */\n layout(options: AnimationOptions = {}) {\n this.updateTarget(\"layout\", {}, options)\n\n return this\n }\n\n enter(keyframes: DOMKeyframesDefinition, options?: AnimationOptions) {\n this.updateTarget(\"enter\", keyframes, options)\n\n return this\n }\n\n exit(keyframes: DOMKeyframesDefinition, options?: AnimationOptions) {\n this.updateTarget(\"exit\", keyframes, options)\n\n return this\n }\n\n /**\n * Animate the new view directly, whether the element is appearing or\n * persisting (unlike `.enter()`, which only fires for a pure newcomer).\n * Pair with `.old()` for a crossfade or slide-through.\n */\n new(keyframes: DOMKeyframesDefinition, options?: AnimationOptions) {\n this.updateTarget(\"new\", keyframes, options)\n\n return this\n }\n\n /**\n * Animate the old view directly, whether the element is leaving or\n * persisting (unlike `.exit()`, which only fires for a pure leaver).\n */\n old(keyframes: DOMKeyframesDefinition, options?: AnimationOptions) {\n this.updateTarget(\"old\", keyframes, options)\n\n return this\n }\n\n updateTarget(\n target: \"enter\" | \"exit\" | \"layout\" | \"new\" | \"old\",\n keyframes: DOMKeyframesDefinition,\n options: AnimationOptions = {}\n ) {\n const { currentSubject, targets } = this\n\n if (!targets.has(currentSubject)) {\n targets.set(currentSubject, {})\n }\n\n const targetData = targets.get(currentSubject)!\n\n targetData[target] = { keyframes, options }\n }\n\n then(resolve: () => void, reject?: () => void) {\n return this.readyPromise.then(resolve, reject)\n }\n}\n\nexport function animateView(\n update: () => void | Promise,\n options: ViewTransitionOptions = {}\n) {\n return new ViewTransitionBuilder(update, options)\n}\n","import { Axis, AxisDelta, Box, Delta } from \"motion-utils\"\n\nexport const createAxisDelta = (): AxisDelta => ({\n translate: 0,\n scale: 1,\n origin: 0,\n originPoint: 0,\n})\n\nexport const createDelta = (): Delta => ({\n x: createAxisDelta(),\n y: createAxisDelta(),\n})\n\nexport const createAxis = (): Axis => ({ min: 0, max: 0 })\n\nexport const createBox = (): Box => ({\n x: createAxis(),\n y: createAxis(),\n})\n","import type { VisualElement } from \"./VisualElement\"\n\nexport const visualElementStore = new WeakMap()\n","import type { LegacyAnimationControls } from \"../../node/types\"\n\nexport function isAnimationControls(v?: unknown): v is LegacyAnimationControls {\n return (\n v !== null &&\n typeof v === \"object\" &&\n typeof (v as LegacyAnimationControls).start === \"function\"\n )\n}\n","/**\n * Decides if the supplied variable is variant label\n */\nexport function isVariantLabel(v: unknown): v is string | string[] {\n return typeof v === \"string\" || Array.isArray(v)\n}\n","import type { AnimationType } from \"../types\"\n\nexport const variantPriorityOrder: AnimationType[] = [\n \"animate\",\n \"whileInView\",\n \"whileFocus\",\n \"whileHover\",\n \"whileTap\",\n \"whileDrag\",\n \"exit\",\n]\n\nexport const variantProps = [\"initial\", ...variantPriorityOrder]\n","import type { MotionNodeOptions } from \"../../node/types\"\nimport { isAnimationControls } from \"./is-animation-controls\"\nimport { isVariantLabel } from \"./is-variant-label\"\nimport { variantProps } from \"./variant-props\"\n\nexport function isControllingVariants(props: MotionNodeOptions) {\n return (\n isAnimationControls(props.animate) ||\n variantProps.some((name) =>\n isVariantLabel(props[name as keyof typeof props])\n )\n )\n}\n\nexport function isVariantNode(props: MotionNodeOptions) {\n return Boolean(isControllingVariants(props) || props.variants)\n}\n","import { motionValue } from \"../../value\"\nimport { isMotionValue } from \"../../value/utils/is-motion-value\"\n\ntype MotionStyleLike = Record\n\n/**\n * Updates motion values from props changes.\n * Uses `any` type for element to avoid circular dependencies with VisualElement.\n */\nexport function updateMotionValuesFromProps(\n element: any,\n next: MotionStyleLike,\n prev: MotionStyleLike\n) {\n for (const key in next) {\n const nextValue = next[key]\n const prevValue = prev[key]\n\n if (isMotionValue(nextValue)) {\n /**\n * If this is a motion value found in props or style, we want to add it\n * to our visual element's motion value map.\n */\n element.addValue(key, nextValue)\n } else if (isMotionValue(prevValue)) {\n /**\n * If we're swapping from a motion value to a static value,\n * create a new motion value from that\n */\n element.addValue(key, motionValue(nextValue, { owner: element }))\n } else if (prevValue !== nextValue) {\n /**\n * If this is a flat value that has changed, update the motion value\n * or create one if it doesn't exist. We only want to do this if we're\n * not handling the value with our animation state.\n */\n if (element.hasValue(key)) {\n const existingValue = element.getValue(key)!\n\n if (existingValue.liveStyle === true) {\n existingValue.jump(nextValue)\n } else if (!existingValue.hasAnimated) {\n existingValue.set(nextValue)\n }\n } else {\n const latestValue = element.getStaticValue(key)\n element.addValue(\n key,\n motionValue(\n latestValue !== undefined ? latestValue : nextValue,\n { owner: element }\n )\n )\n }\n }\n }\n\n // Handle removed values\n for (const key in prev) {\n if (next[key] === undefined) element.removeValue(key)\n }\n\n return next\n}\n","interface ReducedMotionState {\n current: boolean | null\n}\n\n// Does this device prefer reduced motion? Returns `null` server-side.\nexport const prefersReducedMotion: ReducedMotionState = { current: null }\n\nexport const hasReducedMotionListener = { current: false }\n","import { hasReducedMotionListener, prefersReducedMotion } from \"./state\"\n\nconst isBrowser = typeof window !== \"undefined\"\n\nexport function initPrefersReducedMotion() {\n hasReducedMotionListener.current = true\n if (!isBrowser) return\n\n if (window.matchMedia) {\n const motionMediaQuery = window.matchMedia(\"(prefers-reduced-motion)\")\n\n const setReducedMotionPreferences = () =>\n (prefersReducedMotion.current = motionMediaQuery.matches)\n\n motionMediaQuery.addEventListener(\"change\", setReducedMotionPreferences)\n\n setReducedMotionPreferences()\n } else {\n prefersReducedMotion.current = false\n }\n}\n\nexport { prefersReducedMotion, hasReducedMotionListener }\n","import {\n Box,\n isNumericalString,\n isZeroValueString,\n secondsToMilliseconds,\n SubscriptionManager,\n warnOnce,\n} from \"motion-utils\"\nimport { KeyframeResolver } from \"../animation/keyframes/KeyframesResolver\"\nimport { NativeAnimation } from \"../animation/NativeAnimation\"\nimport type { AnyResolvedKeyframe } from \"../animation/types\"\nimport { acceleratedValues } from \"../animation/waapi/utils/accelerated-values\"\nimport { cancelFrame, frame } from \"../frameloop\"\nimport { microtask } from \"../frameloop/microtask\"\nimport { time } from \"../frameloop/sync-time\"\nimport type { MotionNodeOptions } from \"../node/types\"\nimport { createBox } from \"../projection/geometry/models\"\nimport { motionValue, MotionValue } from \"../value\"\nimport { complex } from \"../value/types/complex\"\nimport { getAnimatableNone } from \"../value/types/utils/animatable-none\"\nimport { findValueType } from \"../value/types/utils/find\"\nimport { isMotionValue } from \"../value/utils/is-motion-value\"\nimport { Feature } from \"./Feature\"\nimport { visualElementStore } from \"./store\"\nimport {\n FeatureDefinitions,\n MotionConfigContextProps,\n PresenceContextProps,\n ReducedMotionConfig,\n ResolvedValues,\n VisualElementEventCallbacks,\n VisualElementOptions,\n} from \"./types\"\nimport { AnimationState } from \"./utils/animation-state\"\nimport {\n isControllingVariants as checkIsControllingVariants,\n isVariantNode as checkIsVariantNode,\n} from \"./utils/is-controlling-variants\"\nimport { transformProps } from \"./utils/keys-transform\"\nimport { updateMotionValuesFromProps } from \"./utils/motion-values\"\nimport {\n hasReducedMotionListener,\n initPrefersReducedMotion,\n prefersReducedMotion,\n} from \"./utils/reduced-motion\"\nimport { resolveVariantFromProps } from \"./utils/resolve-variants\"\n\nconst propEventHandlers = [\n \"AnimationStart\",\n \"AnimationComplete\",\n \"Update\",\n \"BeforeLayoutMeasure\",\n \"LayoutMeasure\",\n \"LayoutAnimationStart\",\n \"LayoutAnimationComplete\",\n] as const\n\n/**\n * Static feature definitions - can be injected by framework layer\n */\nlet featureDefinitions: Partial = {}\n\n/**\n * Set feature definitions for all VisualElements.\n * This should be called by the framework layer (e.g., framer-motion) during initialization.\n */\nexport function setFeatureDefinitions(\n definitions: Partial\n) {\n featureDefinitions = definitions\n}\n\n/**\n * Get the current feature definitions\n */\nexport function getFeatureDefinitions(): Partial {\n return featureDefinitions\n}\n\n/**\n * Motion style type - a subset of CSS properties that can contain motion values\n */\nexport type MotionStyle = {\n [K: string]: AnyResolvedKeyframe | MotionValue | undefined\n}\n\n/**\n * A VisualElement is an imperative abstraction around UI elements such as\n * HTMLElement, SVGElement, Three.Object3D etc.\n */\nexport abstract class VisualElement<\n Instance = unknown,\n RenderState = unknown,\n Options extends {} = {}\n> {\n /**\n * VisualElements are arranged in trees mirroring that of the React tree.\n * Each type of VisualElement has a unique name, to detect when we're crossing\n * type boundaries within that tree.\n */\n abstract type: string\n\n /**\n * An `Array.sort` compatible function that will compare two Instances and\n * compare their respective positions within the tree.\n */\n abstract sortInstanceNodePosition(a: Instance, b: Instance): number\n\n /**\n * Measure the viewport-relative bounding box of the Instance.\n */\n abstract measureInstanceViewportBox(\n instance: Instance,\n props: MotionNodeOptions & Partial\n ): Box\n\n /**\n * When a value has been removed from all animation props we need to\n * pick a target to animate back to. For instance, for HTMLElements\n * we can look in the style prop.\n */\n abstract getBaseTargetFromProps(\n props: MotionNodeOptions,\n key: string\n ): AnyResolvedKeyframe | undefined | MotionValue\n\n /**\n * When we first animate to a value we need to animate it *from* a value.\n * Often this have been specified via the initial prop but it might be\n * that the value needs to be read from the Instance.\n */\n abstract readValueFromInstance(\n instance: Instance,\n key: string,\n options: Options\n ): AnyResolvedKeyframe | null | undefined\n\n /**\n * When a value has been removed from the VisualElement we use this to remove\n * it from the inherting class' unique render state.\n */\n abstract removeValueFromRenderState(\n key: string,\n renderState: RenderState\n ): void\n\n /**\n * Run before a React or VisualElement render, builds the latest motion\n * values into an Instance-specific format. For example, HTMLVisualElement\n * will use this step to build `style` and `var` values.\n */\n abstract build(\n renderState: RenderState,\n latestValues: ResolvedValues,\n props: MotionNodeOptions\n ): void\n\n /**\n * Apply the built values to the Instance. For example, HTMLElements will have\n * styles applied via `setProperty` and the style attribute, whereas SVGElements\n * will have values applied to attributes.\n */\n abstract renderInstance(\n instance: Instance,\n renderState: RenderState,\n styleProp?: MotionStyle,\n projection?: any\n ): void\n\n /**\n * This method is called when a transform property is bound to a motion value.\n * It's currently used to measure SVG elements when a new transform property is bound.\n */\n onBindTransform?(): void\n\n /**\n * If the component child is provided as a motion value, handle subscriptions\n * with the renderer-specific VisualElement.\n */\n handleChildMotionValue?(): void\n\n /**\n * This method takes React props and returns found MotionValues. For example, HTML\n * MotionValues will be found within the style prop, whereas for Three.js within attribute arrays.\n *\n * This isn't an abstract method as it needs calling in the constructor, but it is\n * intended to be one.\n */\n scrapeMotionValuesFromProps(\n _props: MotionNodeOptions,\n _prevProps: MotionNodeOptions,\n _visualElement: VisualElement\n ): {\n [key: string]: MotionValue | AnyResolvedKeyframe\n } {\n return {}\n }\n\n /**\n * A reference to the current underlying Instance, e.g. a HTMLElement\n * or Three.Mesh etc.\n */\n current: Instance | null = null\n\n /**\n * A reference to the parent VisualElement (if exists).\n */\n parent: VisualElement | undefined\n\n /**\n * A set containing references to this VisualElement's children.\n */\n children = new Set()\n\n /**\n * A set containing the latest children of this VisualElement. This is flushed\n * at the start of every commit. We use it to calculate the stagger delay\n * for newly-added children.\n */\n enteringChildren?: Set\n\n /**\n * The depth of this VisualElement within the overall VisualElement tree.\n */\n depth: number\n\n /**\n * The current render state of this VisualElement. Defined by inherting VisualElements.\n */\n renderState: RenderState\n\n /**\n * An object containing the latest static values for each of this VisualElement's\n * MotionValues.\n */\n latestValues: ResolvedValues\n\n /**\n * Determine what role this visual element should take in the variant tree.\n */\n isVariantNode: boolean = false\n isControllingVariants: boolean = false\n\n /**\n * If this component is part of the variant tree, it should track\n * any children that are also part of the tree. This is essentially\n * a shadow tree to simplify logic around how to stagger over children.\n */\n variantChildren?: Set\n\n /**\n * Decides whether this VisualElement should animate in reduced motion\n * mode.\n *\n * TODO: This is currently set on every individual VisualElement but feels\n * like it could be set globally.\n */\n shouldReduceMotion: boolean | null = null\n\n /**\n * Decides whether animations should be skipped for this VisualElement.\n * Useful for E2E tests and visual regression testing.\n */\n shouldSkipAnimations: boolean = false\n\n /**\n * Normally, if a component is controlled by a parent's variants, it can\n * rely on that ancestor to trigger animations further down the tree.\n * However, if a component is created after its parent is mounted, the parent\n * won't trigger that mount animation so the child needs to.\n *\n * TODO: This might be better replaced with a method isParentMounted\n */\n manuallyAnimateOnMount: boolean\n\n /**\n * This can be set by AnimatePresence to force components that mount\n * at the same time as it to mount as if they have initial={false} set.\n */\n blockInitialAnimation: boolean\n\n /**\n * A reference to this VisualElement's projection node, used in layout animations.\n */\n projection?: any\n\n /**\n * A map of all motion values attached to this visual element. Motion\n * values are source of truth for any given animated value. A motion\n * value might be provided externally by the component via props.\n */\n values = new Map()\n\n /**\n * The AnimationState, this is hydrated by the animation Feature.\n */\n animationState?: AnimationState\n\n KeyframeResolver = KeyframeResolver\n\n /**\n * The options used to create this VisualElement. The Options type is defined\n * by the inheriting VisualElement and is passed straight through to the render functions.\n */\n readonly options: Options\n\n /**\n * A reference to the latest props provided to the VisualElement's host React component.\n */\n props: MotionNodeOptions\n prevProps?: MotionNodeOptions\n\n presenceContext: PresenceContextProps | null\n prevPresenceContext?: PresenceContextProps | null\n\n /**\n * Cleanup functions for active features (hover/tap/exit etc)\n */\n private features: {\n [K in keyof FeatureDefinitions]?: Feature\n } = {}\n\n /**\n * A map of every subscription that binds the provided or generated\n * motion values onChange listeners to this visual element.\n */\n private valueSubscriptions = new Map()\n\n /**\n * A reference to the ReducedMotionConfig passed to the VisualElement's host React component.\n */\n private reducedMotionConfig: ReducedMotionConfig | undefined\n\n /**\n * A reference to the skipAnimations config passed to the VisualElement's host React component.\n */\n private skipAnimationsConfig: boolean | undefined\n\n /**\n * On mount, this will be hydrated with a callback to disconnect\n * this visual element from its parent on unmount.\n */\n private removeFromVariantTree: undefined | VoidFunction\n\n /**\n * A reference to the previously-provided motion values as returned\n * from scrapeMotionValuesFromProps. We use the keys in here to determine\n * if any motion values need to be removed after props are updated.\n */\n private prevMotionValues: MotionStyle = {}\n\n /**\n * When values are removed from all animation props we need to search\n * for a fallback value to animate to. These values are tracked in baseTarget.\n */\n private baseTarget: ResolvedValues\n\n /**\n * Create an object of the values we initially animated from (if initial prop present).\n */\n private initialValues: ResolvedValues\n\n /**\n * Track whether this element has been mounted before, to detect\n * remounts after Suspense unmount/remount cycles.\n */\n private hasBeenMounted = false\n\n /**\n * An object containing a SubscriptionManager for each active event.\n */\n private events: {\n [key: string]: SubscriptionManager\n } = {}\n\n /**\n * An object containing an unsubscribe function for each prop event subscription.\n * For example, every \"Update\" event can have multiple subscribers via\n * VisualElement.on(), but only one of those can be defined via the onUpdate prop.\n */\n private propEventSubscriptions: {\n [key: string]: VoidFunction\n } = {}\n\n constructor(\n {\n parent,\n props,\n presenceContext,\n reducedMotionConfig,\n skipAnimations,\n blockInitialAnimation,\n visualState,\n }: VisualElementOptions,\n options: Options = {} as any\n ) {\n const { latestValues, renderState } = visualState\n this.latestValues = latestValues\n this.baseTarget = { ...latestValues }\n this.initialValues = props.initial ? { ...latestValues } : {}\n this.renderState = renderState\n this.parent = parent\n this.props = props\n this.presenceContext = presenceContext\n this.depth = parent ? parent.depth + 1 : 0\n this.reducedMotionConfig = reducedMotionConfig\n this.skipAnimationsConfig = skipAnimations\n this.options = options\n this.blockInitialAnimation = Boolean(blockInitialAnimation)\n\n this.isControllingVariants = checkIsControllingVariants(props)\n this.isVariantNode = checkIsVariantNode(props)\n if (this.isVariantNode) {\n this.variantChildren = new Set()\n }\n\n this.manuallyAnimateOnMount = Boolean(parent && parent.current)\n\n /**\n * Any motion values that are provided to the element when created\n * aren't yet bound to the element, as this would technically be impure.\n * However, we iterate through the motion values and set them to the\n * initial values for this component.\n *\n * TODO: This is impure and we should look at changing this to run on mount.\n * Doing so will break some tests but this isn't necessarily a breaking change,\n * more a reflection of the test.\n */\n const { willChange, ...initialMotionValues } =\n this.scrapeMotionValuesFromProps(props, {}, this)\n\n for (const key in initialMotionValues) {\n const value = initialMotionValues[key]\n\n if (latestValues[key] !== undefined && isMotionValue(value)) {\n value.set(latestValues[key])\n }\n }\n }\n\n mount(instance: Instance) {\n /**\n * If this element has been mounted before (e.g. after a Suspense\n * unmount/remount), reset motion values to their initial state\n * so animations replay correctly from initial → animate.\n */\n if (this.hasBeenMounted) {\n for (const key in this.initialValues) {\n this.values.get(key)?.jump(this.initialValues[key])\n this.latestValues[key] = this.initialValues[key]\n }\n }\n\n this.current = instance\n\n visualElementStore.set(instance, this)\n\n if (this.projection && !this.projection.instance) {\n this.projection.mount(instance)\n }\n\n if (this.parent && this.isVariantNode && !this.isControllingVariants) {\n this.removeFromVariantTree = this.parent.addVariantChild(this)\n }\n\n this.values.forEach((value, key) => this.bindToMotionValue(key, value))\n\n /**\n * Determine reduced motion preference. Only initialize the matchMedia\n * listener if we actually need the dynamic value (i.e., when config\n * is neither \"never\" nor \"always\").\n */\n if (this.reducedMotionConfig === \"never\") {\n this.shouldReduceMotion = false\n } else if (this.reducedMotionConfig === \"always\") {\n this.shouldReduceMotion = true\n } else {\n if (!hasReducedMotionListener.current) {\n initPrefersReducedMotion()\n }\n this.shouldReduceMotion = prefersReducedMotion.current\n }\n\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(\n this.shouldReduceMotion !== true,\n \"You have Reduced Motion enabled on your device. Animations may not appear as expected.\",\n \"reduced-motion-disabled\"\n )\n }\n\n /**\n * Set whether animations should be skipped based on the config.\n */\n this.shouldSkipAnimations = this.skipAnimationsConfig ?? false\n\n this.parent?.addChild(this)\n\n this.update(this.props, this.presenceContext)\n\n this.hasBeenMounted = true\n }\n\n unmount() {\n this.projection && this.projection.unmount()\n cancelFrame(this.notifyUpdate)\n cancelFrame(this.render)\n this.valueSubscriptions.forEach((remove) => remove())\n this.valueSubscriptions.clear()\n this.removeFromVariantTree && this.removeFromVariantTree()\n this.parent?.removeChild(this)\n\n for (const key in this.events) {\n this.events[key].clear()\n }\n\n for (const key in this.features) {\n const feature = this.features[key as keyof typeof this.features]\n if (feature) {\n feature.unmount()\n feature.isMounted = false\n }\n }\n this.current = null\n }\n\n addChild(child: VisualElement) {\n this.children.add(child)\n this.enteringChildren ??= new Set()\n this.enteringChildren.add(child)\n }\n\n removeChild(child: VisualElement) {\n this.children.delete(child)\n this.enteringChildren && this.enteringChildren.delete(child)\n }\n\n private bindToMotionValue(key: string, value: MotionValue) {\n if (this.valueSubscriptions.has(key)) {\n this.valueSubscriptions.get(key)!()\n }\n\n if (\n value.accelerate &&\n acceleratedValues.has(key) &&\n this.current instanceof HTMLElement\n ) {\n const { factory, keyframes, times, ease, duration } =\n value.accelerate\n\n const animation = new NativeAnimation({\n element: this.current,\n name: key,\n keyframes,\n times,\n ease,\n duration: secondsToMilliseconds(duration),\n })\n\n const cleanup = factory(animation)\n\n this.valueSubscriptions.set(key, () => {\n cleanup()\n animation.cancel()\n })\n return\n }\n\n const valueIsTransform = transformProps.has(key)\n\n if (valueIsTransform && this.onBindTransform) {\n this.onBindTransform()\n }\n\n const removeOnChange = value.on(\n \"change\",\n (latestValue: AnyResolvedKeyframe) => {\n this.latestValues[key] = latestValue\n\n this.props.onUpdate && frame.preRender(this.notifyUpdate)\n\n if (valueIsTransform && this.projection) {\n this.projection.isTransformDirty = true\n }\n\n this.scheduleRender()\n }\n )\n\n let removeSyncCheck: VoidFunction | void\n if (\n typeof window !== \"undefined\" &&\n (window as any).MotionCheckAppearSync\n ) {\n removeSyncCheck = (window as any).MotionCheckAppearSync(\n this,\n key,\n value\n )\n }\n\n this.valueSubscriptions.set(key, () => {\n removeOnChange()\n if (removeSyncCheck) removeSyncCheck()\n // Defer to MotionValue.on(\"change\") auto-stop so React 19 remounts\n // can resubscribe before the animation is cancelled (#3315).\n })\n }\n\n sortNodePosition(other: VisualElement) {\n /**\n * If these nodes aren't even of the same type we can't compare their depth.\n */\n if (\n !this.current ||\n !this.sortInstanceNodePosition ||\n this.type !== other.type\n ) {\n return 0\n }\n\n return this.sortInstanceNodePosition(\n this.current as Instance,\n other.current as Instance\n )\n }\n\n updateFeatures() {\n let key: keyof typeof featureDefinitions = \"animation\"\n\n for (key in featureDefinitions) {\n const featureDefinition = featureDefinitions[key]\n\n if (!featureDefinition) continue\n\n const { isEnabled, Feature: FeatureConstructor } = featureDefinition\n\n /**\n * If this feature is enabled but not active, make a new instance.\n */\n if (\n !this.features[key] &&\n FeatureConstructor &&\n isEnabled(this.props)\n ) {\n this.features[key] = new FeatureConstructor(this) as any\n }\n\n /**\n * If we have a feature, mount or update it.\n */\n if (this.features[key]) {\n const feature = this.features[key]!\n if (feature.isMounted) {\n feature.update()\n } else {\n feature.mount()\n feature.isMounted = true\n }\n }\n }\n }\n\n notifyUpdate = () => this.notify(\"Update\", this.latestValues)\n\n triggerBuild() {\n this.build(this.renderState, this.latestValues, this.props)\n }\n\n render = () => {\n if (!this.current) return\n this.triggerBuild()\n this.renderInstance(\n this.current,\n this.renderState,\n (this.props as any).style,\n this.projection\n )\n }\n\n private renderScheduledAt = 0.0\n scheduleRender = () => {\n const now = time.now()\n if (this.renderScheduledAt < now) {\n this.renderScheduledAt = now\n frame.render(this.render, false, true)\n }\n }\n\n /**\n * Measure the current viewport box with or without transforms.\n * Only measures axis-aligned boxes, rotate and skew must be manually\n * removed with a re-render to work.\n */\n measureViewportBox() {\n return this.current\n ? this.measureInstanceViewportBox(this.current, this.props)\n : createBox()\n }\n\n getStaticValue(key: string) {\n return this.latestValues[key]\n }\n\n setStaticValue(key: string, value: AnyResolvedKeyframe) {\n this.latestValues[key] = value\n }\n\n /**\n * Update the provided props. Ensure any newly-added motion values are\n * added to our map, old ones removed, and listeners updated.\n */\n update(\n props: MotionNodeOptions,\n presenceContext: PresenceContextProps | null\n ) {\n if (props.transformTemplate || this.props.transformTemplate) {\n this.scheduleRender()\n }\n\n this.prevProps = this.props\n this.props = props\n\n this.prevPresenceContext = this.presenceContext\n this.presenceContext = presenceContext\n\n /**\n * Update prop event handlers ie onAnimationStart, onAnimationComplete\n */\n for (let i = 0; i < propEventHandlers.length; i++) {\n const key = propEventHandlers[i]\n if (this.propEventSubscriptions[key]) {\n this.propEventSubscriptions[key]()\n delete this.propEventSubscriptions[key]\n }\n\n const listenerName = (\"on\" + key) as keyof typeof props\n const listener = props[listenerName]\n if (listener) {\n this.propEventSubscriptions[key] = this.on(key as any, listener)\n }\n }\n\n this.prevMotionValues = updateMotionValuesFromProps(\n this,\n this.scrapeMotionValuesFromProps(props, this.prevProps || {}, this),\n this.prevMotionValues\n )\n\n if (this.handleChildMotionValue) {\n this.handleChildMotionValue()\n }\n }\n\n getProps() {\n return this.props\n }\n\n /**\n * Returns the variant definition with a given name.\n */\n getVariant(name: string) {\n return this.props.variants ? this.props.variants[name] : undefined\n }\n\n /**\n * Returns the defined default transition on this component.\n */\n getDefaultTransition() {\n return this.props.transition\n }\n\n getTransformPagePoint() {\n return (this.props as any).transformPagePoint\n }\n\n getClosestVariantNode(): VisualElement | undefined {\n return this.isVariantNode\n ? this\n : this.parent\n ? this.parent.getClosestVariantNode()\n : undefined\n }\n\n /**\n * Add a child visual element to our set of children.\n */\n addVariantChild(child: VisualElement) {\n const closestVariantNode = this.getClosestVariantNode()\n if (closestVariantNode) {\n closestVariantNode.variantChildren &&\n closestVariantNode.variantChildren.add(child)\n return () => closestVariantNode.variantChildren!.delete(child)\n }\n }\n\n /**\n * Add a motion value and bind it to this visual element.\n */\n addValue(key: string, value: MotionValue) {\n // Remove existing value if it exists\n const existingValue = this.values.get(key)\n\n if (value !== existingValue) {\n if (existingValue) this.removeValue(key)\n this.bindToMotionValue(key, value)\n this.values.set(key, value)\n this.latestValues[key] = value.get()\n }\n }\n\n /**\n * Remove a motion value and unbind any active subscriptions.\n */\n removeValue(key: string) {\n this.values.delete(key)\n const unsubscribe = this.valueSubscriptions.get(key)\n if (unsubscribe) {\n unsubscribe()\n this.valueSubscriptions.delete(key)\n }\n delete this.latestValues[key]\n this.removeValueFromRenderState(key, this.renderState)\n }\n\n /**\n * Check whether we have a motion value for this key\n */\n hasValue(key: string) {\n return this.values.has(key)\n }\n\n /**\n * Get a motion value for this key. If called with a default\n * value, we'll create one if none exists.\n */\n getValue(key: string): MotionValue | undefined\n getValue(key: string, defaultValue: AnyResolvedKeyframe | null): MotionValue\n getValue(\n key: string,\n defaultValue?: AnyResolvedKeyframe | null\n ): MotionValue | undefined {\n if (this.props.values && this.props.values[key]) {\n return this.props.values[key]\n }\n\n let value = this.values.get(key)\n\n if (value === undefined && defaultValue !== undefined) {\n value = motionValue(\n defaultValue === null ? undefined : defaultValue,\n { owner: this }\n )\n this.addValue(key, value)\n }\n\n return value\n }\n\n /**\n * If we're trying to animate to a previously unencountered value,\n * we need to check for it in our state and as a last resort read it\n * directly from the instance (which might have performance implications).\n */\n readValue(key: string, target?: AnyResolvedKeyframe | null) {\n let value =\n this.latestValues[key] !== undefined || !this.current\n ? this.latestValues[key]\n : this.getBaseTargetFromProps(this.props, key) ??\n this.readValueFromInstance(this.current, key, this.options)\n\n if (value !== undefined && value !== null) {\n if (\n typeof value === \"string\" &&\n (isNumericalString(value) || isZeroValueString(value))\n ) {\n // If this is a number read as a string, ie \"0\" or \"200\", convert it to a number\n value = parseFloat(value)\n } else if (!findValueType(value) && complex.test(target)) {\n value = getAnimatableNone(key, target as string)\n }\n\n this.setBaseTarget(key, isMotionValue(value) ? value.get() : value)\n }\n\n return isMotionValue(value) ? value.get() : value\n }\n\n /**\n * Set the base target to later animate back to. This is currently\n * only hydrated on creation and when we first read a value.\n */\n setBaseTarget(key: string, value: AnyResolvedKeyframe) {\n this.baseTarget[key] = value\n }\n\n /**\n * Find the base target for a value thats been removed from all animation\n * props.\n */\n getBaseTarget(key: string): ResolvedValues[string] | undefined | null {\n const { initial } = this.props\n\n let valueFromInitial: ResolvedValues[string] | undefined | null\n\n if (typeof initial === \"string\" || typeof initial === \"object\") {\n const variant = resolveVariantFromProps(\n this.props,\n initial as any,\n this.presenceContext?.custom\n )\n if (variant) {\n valueFromInitial = variant[\n key as keyof typeof variant\n ] as string\n }\n }\n\n /**\n * If this value still exists in the current initial variant, read that.\n */\n if (initial && valueFromInitial !== undefined) {\n return valueFromInitial\n }\n\n /**\n * Alternatively, if this VisualElement config has defined a getBaseTarget\n * so we can read the value from an alternative source, try that.\n */\n const target = this.getBaseTargetFromProps(this.props, key)\n if (target !== undefined && !isMotionValue(target)) return target\n\n /**\n * If the value was initially defined on initial, but it doesn't any more,\n * return undefined. Otherwise return the value as initially read from the DOM.\n */\n return this.initialValues[key] !== undefined &&\n valueFromInitial === undefined\n ? undefined\n : this.baseTarget[key]\n }\n\n on(\n eventName: EventName,\n callback: VisualElementEventCallbacks[EventName]\n ) {\n if (!this.events[eventName]) {\n this.events[eventName] = new SubscriptionManager()\n }\n\n return this.events[eventName].add(callback)\n }\n\n notify(\n eventName: EventName,\n ...args: any\n ) {\n if (this.events[eventName]) {\n this.events[eventName].notify(...args)\n }\n }\n\n scheduleRenderMicrotask() {\n microtask.render(this.render)\n }\n}\n","import { isMotionValue } from \"../../value/utils/is-motion-value\"\nimport type { MotionValue } from \"../../value\"\nimport type { AnyResolvedKeyframe } from \"../../animation/types\"\nimport { DOMKeyframesResolver } from \"../../animation/keyframes/DOMKeyframesResolver\"\nimport type { MotionNodeOptions } from \"../../node/types\"\nimport type { DOMVisualElementOptions } from \"./types\"\nimport type { HTMLRenderState } from \"../html/types\"\nimport { VisualElement, MotionStyle } from \"../VisualElement\"\n\nexport abstract class DOMVisualElement<\n Instance extends HTMLElement | SVGElement = HTMLElement,\n State extends HTMLRenderState = HTMLRenderState,\n Options extends DOMVisualElementOptions = DOMVisualElementOptions\n> extends VisualElement {\n sortInstanceNodePosition(a: Instance, b: Instance): number {\n /**\n * compareDocumentPosition returns a bitmask, by using the bitwise &\n * we're returning true if 2 in that bitmask is set to true. 2 is set\n * to true if b preceeds a.\n */\n return a.compareDocumentPosition(b) & 2 ? 1 : -1\n }\n\n getBaseTargetFromProps(\n props: MotionNodeOptions,\n key: string\n ): AnyResolvedKeyframe | MotionValue | undefined {\n const style = (props as MotionNodeOptions & { style?: MotionStyle }).style\n return style ? (style[key] as string) : undefined\n }\n\n removeValueFromRenderState(\n key: string,\n { vars, style }: HTMLRenderState\n ): void {\n delete vars[key]\n delete style[key]\n }\n\n KeyframeResolver = DOMKeyframesResolver\n\n childSubscription?: VoidFunction\n handleChildMotionValue() {\n if (this.childSubscription) {\n this.childSubscription()\n delete this.childSubscription\n }\n\n const { children } = this.props as MotionNodeOptions & { children?: MotionValue | any }\n if (isMotionValue(children)) {\n this.childSubscription = children.on(\"change\", (latest) => {\n if (this.current) {\n this.current.textContent = `${latest}`\n }\n })\n }\n }\n}\n","import type { VisualElement } from \"./VisualElement\"\n\n/**\n * Feature base class for extending VisualElement functionality.\n * Features are plugins that can be mounted/unmounted to add behavior\n * like gestures, animations, or layout tracking.\n */\nexport abstract class Feature {\n isMounted = false\n\n node: VisualElement\n\n constructor(node: VisualElement) {\n this.node = node\n }\n\n abstract mount(): void\n\n abstract unmount(): void\n\n update(): void {}\n}\n","import { BoundingBox, Box, TransformPoint } from \"motion-utils\"\n\n/**\n * Bounding boxes tend to be defined as top, left, right, bottom. For various operations\n * it's easier to consider each axis individually. This function returns a bounding box\n * as a map of single-axis min/max values.\n */\nexport function convertBoundingBoxToBox({\n top,\n left,\n right,\n bottom,\n}: BoundingBox): Box {\n return {\n x: { min: left, max: right },\n y: { min: top, max: bottom },\n }\n}\n\nexport function convertBoxToBoundingBox({ x, y }: Box): BoundingBox {\n return { top: y.min, right: x.max, bottom: y.max, left: x.min }\n}\n\n/**\n * Applies a TransformPoint function to a bounding box. TransformPoint is usually a function\n * provided by Framer to allow measured points to be corrected for device scaling. This is used\n * when measuring DOM elements and DOM event points.\n */\nexport function transformBoxPoints(\n point: BoundingBox,\n transformPoint?: TransformPoint\n) {\n if (!transformPoint) return point\n const topLeft = transformPoint({ x: point.left, y: point.top })\n const bottomRight = transformPoint({ x: point.right, y: point.bottom })\n\n return {\n top: topLeft.y,\n left: topLeft.x,\n bottom: bottomRight.y,\n right: bottomRight.x,\n }\n}\n","import { type AnyResolvedKeyframe } from \"../../animation/types\"\nimport { ResolvedValues } from \"../../render/types\"\n\nfunction isIdentityScale(scale: AnyResolvedKeyframe | undefined) {\n return scale === undefined || scale === 1\n}\n\nexport function hasScale({ scale, scaleX, scaleY }: ResolvedValues) {\n return (\n !isIdentityScale(scale) ||\n !isIdentityScale(scaleX) ||\n !isIdentityScale(scaleY)\n )\n}\n\nexport function hasTransform(values: ResolvedValues) {\n return (\n hasScale(values) ||\n has2DTranslate(values) ||\n values.z ||\n values.rotate ||\n values.rotateX ||\n values.rotateY ||\n values.skewX ||\n values.skewY\n )\n}\n\nexport function has2DTranslate(values: ResolvedValues) {\n return is2DTranslate(values.x) || is2DTranslate(values.y)\n}\n\nfunction is2DTranslate(value: AnyResolvedKeyframe | undefined) {\n return value && value !== \"0%\"\n}\n","import { Axis, Box, Delta, Point } from \"motion-utils\"\nimport { mixNumber } from \"../../utils/mix/number\"\nimport { ResolvedValues } from \"../../render/types\"\nimport { hasTransform } from \"../utils/has-transform\"\n\n/**\n * Scales a point based on a factor and an originPoint\n */\nexport function scalePoint(point: number, scale: number, originPoint: number) {\n const distanceFromOrigin = point - originPoint\n const scaled = scale * distanceFromOrigin\n return originPoint + scaled\n}\n\n/**\n * Applies a translate/scale delta to a point\n */\nexport function applyPointDelta(\n point: number,\n translate: number,\n scale: number,\n originPoint: number,\n boxScale?: number\n): number {\n if (boxScale !== undefined) {\n point = scalePoint(point, boxScale, originPoint)\n }\n\n return scalePoint(point, scale, originPoint) + translate\n}\n\n/**\n * Applies a translate/scale delta to an axis\n */\nexport function applyAxisDelta(\n axis: Axis,\n translate: number = 0,\n scale: number = 1,\n originPoint: number,\n boxScale?: number\n): void {\n axis.min = applyPointDelta(\n axis.min,\n translate,\n scale,\n originPoint,\n boxScale\n )\n\n axis.max = applyPointDelta(\n axis.max,\n translate,\n scale,\n originPoint,\n boxScale\n )\n}\n\n/**\n * Applies a translate/scale delta to a box\n */\nexport function applyBoxDelta(box: Box, { x, y }: Delta): void {\n applyAxisDelta(box.x, x.translate, x.scale, x.originPoint)\n applyAxisDelta(box.y, y.translate, y.scale, y.originPoint)\n}\n\nconst TREE_SCALE_SNAP_MIN = 0.999999999999\nconst TREE_SCALE_SNAP_MAX = 1.0000000000001\n\n/**\n * Apply a tree of deltas to a box. We do this to calculate the effect of all the transforms\n * in a tree upon our box before then calculating how to project it into our desired viewport-relative box\n *\n * This is the final nested loop within updateLayoutDelta for future refactoring\n */\nexport function applyTreeDeltas(\n box: Box,\n treeScale: Point,\n treePath: any[],\n isSharedTransition: boolean = false\n) {\n const treeLength = treePath.length\n if (!treeLength) return\n\n // Reset the treeScale\n treeScale.x = treeScale.y = 1\n\n let node: any\n let delta: Delta | undefined\n\n for (let i = 0; i < treeLength; i++) {\n node = treePath[i]\n delta = node.projectionDelta\n\n /**\n * TODO: Prefer to remove this, but currently we have motion components with\n * display: contents in Framer.\n */\n const { visualElement } = node.options\n if (\n visualElement &&\n visualElement.props.style &&\n visualElement.props.style.display === \"contents\"\n ) {\n continue\n }\n\n if (\n isSharedTransition &&\n node.options.layoutScroll &&\n node.scroll &&\n node !== node.root\n ) {\n translateAxis(box.x, -node.scroll.offset.x)\n translateAxis(box.y, -node.scroll.offset.y)\n }\n\n if (delta) {\n // Incoporate each ancestor's scale into a cumulative treeScale for this component\n treeScale.x *= delta.x.scale\n treeScale.y *= delta.y.scale\n\n // Apply each ancestor's calculated delta into this component's recorded layout box\n applyBoxDelta(box, delta)\n }\n\n if (isSharedTransition && hasTransform(node.latestValues)) {\n transformBox(box, node.latestValues, node.layout?.layoutBox)\n }\n }\n\n /**\n * Snap tree scale back to 1 if it's within a non-perceivable threshold.\n * This will help reduce useless scales getting rendered.\n */\n if (\n treeScale.x < TREE_SCALE_SNAP_MAX &&\n treeScale.x > TREE_SCALE_SNAP_MIN\n ) {\n treeScale.x = 1.0\n }\n if (\n treeScale.y < TREE_SCALE_SNAP_MAX &&\n treeScale.y > TREE_SCALE_SNAP_MIN\n ) {\n treeScale.y = 1.0\n }\n}\n\nexport function translateAxis(axis: Axis, distance: number) {\n axis.min += distance\n axis.max += distance\n}\n\n/**\n * Apply a transform to an axis from the latest resolved motion values.\n * This function basically acts as a bridge between a flat motion value map\n * and applyAxisDelta\n */\nexport function transformAxis(\n axis: Axis,\n axisTranslate?: number,\n axisScale?: number,\n boxScale?: number,\n axisOrigin: number = 0.5\n): void {\n const originPoint = mixNumber(axis.min, axis.max, axisOrigin)\n\n // Apply the axis delta to the final axis\n applyAxisDelta(axis, axisTranslate, axisScale, originPoint, boxScale)\n}\n\nfunction resolveAxisTranslate(\n value: number | string | undefined,\n axis: Axis\n): number | undefined {\n if (typeof value === \"string\") {\n return (parseFloat(value) / 100) * (axis.max - axis.min)\n }\n return value as number | undefined\n}\n\n/**\n * Apply a transform to a box from the latest resolved motion values.\n */\nexport function transformBox(\n box: Box,\n transform: ResolvedValues,\n sourceBox?: Box\n) {\n const resolveBox = sourceBox ?? box\n transformAxis(\n box.x,\n resolveAxisTranslate(transform.x, resolveBox.x),\n transform.scaleX as number,\n transform.scale as number,\n transform.originX as number\n )\n transformAxis(\n box.y,\n resolveAxisTranslate(transform.y, resolveBox.y),\n transform.scaleY as number,\n transform.scale as number,\n transform.originY as number\n )\n}\n","import { TransformPoint } from \"motion-utils\"\nimport {\n convertBoundingBoxToBox,\n transformBoxPoints,\n} from \"../geometry/conversion\"\nimport { translateAxis } from \"../geometry/delta-apply\"\n\nexport function measureViewportBox(\n instance: HTMLElement,\n transformPoint?: TransformPoint\n) {\n return convertBoundingBoxToBox(\n transformBoxPoints(instance.getBoundingClientRect(), transformPoint)\n )\n}\n\nexport function measurePageBox(\n element: HTMLElement,\n rootProjectionNode: any,\n transformPagePoint?: TransformPoint\n) {\n const viewportBox = measureViewportBox(element, transformPagePoint)\n const { scroll } = rootProjectionNode\n\n if (scroll) {\n translateAxis(viewportBox.x, scroll.offset.x)\n translateAxis(viewportBox.y, scroll.offset.y)\n }\n\n return viewportBox\n}\n","import { getValueAsType } from \"../../../value/types/utils/get-as-type\"\nimport { numberValueTypes } from \"../../../value/types/maps/number\"\nimport { transformPropOrder } from \"../../utils/keys-transform\"\nimport { ResolvedValues } from \"../../types\"\nimport { HTMLRenderState } from \"../types\"\nimport type { MotionNodeOptions } from \"../../../node/types\"\n\nconst translateAlias = {\n x: \"translateX\",\n y: \"translateY\",\n z: \"translateZ\",\n transformPerspective: \"perspective\",\n}\n\nconst numTransforms = transformPropOrder.length\n\n/**\n * Build a CSS transform style from individual x/y/scale etc properties.\n *\n * This outputs with a default order of transforms/scales/rotations, this can be customised by\n * providing a transformTemplate function.\n */\nexport function buildTransform(\n latestValues: ResolvedValues,\n transform: HTMLRenderState[\"transform\"],\n transformTemplate?: MotionNodeOptions[\"transformTemplate\"]\n) {\n // The transform string we're going to build into.\n let transformString = \"\"\n let transformIsDefault = true\n\n /**\n * Loop over all possible transforms in order, adding the ones that\n * are present to the transform string.\n */\n for (let i = 0; i < numTransforms; i++) {\n const key = transformPropOrder[i] as keyof typeof translateAlias\n const value = latestValues[key]\n\n if (value === undefined) continue\n\n let valueIsDefault = true\n if (typeof value === \"number\") {\n valueIsDefault = value === (key.startsWith(\"scale\") ? 1 : 0)\n } else {\n const parsed = parseFloat(value)\n valueIsDefault = key.startsWith(\"scale\") ? parsed === 1 : parsed === 0\n }\n\n if (!valueIsDefault || transformTemplate) {\n const valueAsType = getValueAsType(value, numberValueTypes[key])\n\n if (!valueIsDefault) {\n transformIsDefault = false\n const transformName = translateAlias[key] || key\n transformString += `${transformName}(${valueAsType}) `\n }\n\n if (transformTemplate) {\n transform[key] = valueAsType\n }\n }\n }\n\n // `pathRotation` composes onto `rotate` as a separate additive term so\n // the user's `rotate` is never clobbered. Deliberately not a slot in\n // `transformPropOrder`.\n const pathRotation = latestValues.pathRotation\n if (pathRotation) {\n transformIsDefault = false\n transformString += `rotate(${getValueAsType(\n pathRotation,\n numberValueTypes.pathRotation\n )}) `\n }\n\n transformString = transformString.trim()\n\n // If we have a custom `transform` template, pass our transform values and\n // generated transformString to that before returning\n if (transformTemplate) {\n transformString = transformTemplate(\n transform,\n transformIsDefault ? \"\" : transformString\n )\n } else if (transformIsDefault) {\n transformString = \"none\"\n }\n\n return transformString\n}\n","import { getValueAsType } from \"../../../value/types/utils/get-as-type\"\nimport { numberValueTypes } from \"../../../value/types/maps/number\"\nimport { transformProps } from \"../../utils/keys-transform\"\nimport { isCSSVariableName } from \"../../../animation/utils/is-css-variable\"\nimport { ResolvedValues } from \"../../types\"\nimport { HTMLRenderState } from \"../types\"\nimport { buildTransform } from \"./build-transform\"\nimport type { MotionNodeOptions } from \"../../../node/types\"\n\nexport function buildHTMLStyles(\n state: HTMLRenderState,\n latestValues: ResolvedValues,\n transformTemplate?: MotionNodeOptions[\"transformTemplate\"]\n) {\n const { style, vars, transformOrigin } = state\n\n // Track whether we encounter any transform or transformOrigin values.\n let hasTransform = false\n let hasTransformOrigin = false\n\n /**\n * Loop over all our latest animated values and decide whether to handle them\n * as a style or CSS variable.\n *\n * Transforms and transform origins are kept separately for further processing.\n */\n for (const key in latestValues) {\n const value = latestValues[key]\n\n if (transformProps.has(key)) {\n // If this is a transform, flag to enable further transform processing\n hasTransform = true\n continue\n } else if (isCSSVariableName(key)) {\n vars[key] = value\n continue\n } else {\n // Convert the value to its default value type, ie 0 -> \"0px\"\n const valueAsType = getValueAsType(value, numberValueTypes[key])\n\n if (key.startsWith(\"origin\")) {\n // If this is a transform origin, flag and enable further transform-origin processing\n hasTransformOrigin = true\n transformOrigin[key as keyof typeof transformOrigin] =\n valueAsType\n } else {\n style[key] = valueAsType\n }\n }\n }\n\n if (!latestValues.transform) {\n if (hasTransform || transformTemplate) {\n style.transform = buildTransform(\n latestValues,\n state.transform,\n transformTemplate\n )\n } else if (style.transform) {\n /**\n * If we have previously created a transform but currently don't have any,\n * reset transform style to none.\n */\n style.transform = \"none\"\n }\n }\n\n /**\n * Build a transformOrigin style. Uses the same defaults as the browser for\n * undefined origins.\n */\n if (hasTransformOrigin) {\n const {\n originX = \"50%\",\n originY = \"50%\",\n originZ = 0,\n } = transformOrigin\n style.transformOrigin = `${originX} ${originY} ${originZ}`\n }\n}\n","import type { MotionStyle } from \"../../VisualElement\"\nimport { HTMLRenderState } from \"../types\"\n\nexport function renderHTML(\n element: HTMLElement,\n { style, vars }: HTMLRenderState,\n styleProp?: MotionStyle,\n projection?: any\n) {\n const elementStyle = element.style\n\n let key: string\n for (key in style) {\n // CSSStyleDeclaration has [index: number]: string; in the types, so we use that as key type.\n elementStyle[key as unknown as number] = style[key] as string\n }\n\n // Write projection styles directly to element style\n projection?.applyProjectionStyles(elementStyle, styleProp)\n\n for (key in vars) {\n // Loop over any CSS variables and assign those.\n // They can only be assigned using `setProperty`.\n elementStyle.setProperty(key, vars[key] as string)\n }\n}\n","import { px } from \"../../value/types/numbers/units\"\nimport type { Axis } from \"motion-utils\"\nimport type { ScaleCorrectorDefinition } from \"./types\"\n\nexport function pixelsToPercent(pixels: number, axis: Axis): number {\n if (axis.max === axis.min) return 0\n return (pixels / (axis.max - axis.min)) * 100\n}\n\n/**\n * We always correct borderRadius as a percentage rather than pixels to reduce paints.\n * For example, if you are projecting a box that is 100px wide with a 10px borderRadius\n * into a box that is 200px wide with a 20px borderRadius, that is actually a 10%\n * borderRadius in both states. If we animate between the two in pixels that will trigger\n * a paint each time. If we animate between the two in percentage we'll avoid a paint.\n */\nexport const correctBorderRadius: ScaleCorrectorDefinition = {\n correct: (latest, node) => {\n if (!node.target) return latest\n\n /**\n * If latest is a string, if it's a percentage we can return immediately as it's\n * going to be stretched appropriately. Otherwise, if it's a pixel, convert it to a number.\n */\n if (typeof latest === \"string\") {\n if (px.test(latest)) {\n latest = parseFloat(latest)\n } else {\n return latest\n }\n }\n\n /**\n * If latest is a number, it's a pixel value. We use the current viewportBox to calculate that\n * pixel value as a percentage of each axis\n */\n const x = pixelsToPercent(latest, node.target.x)\n const y = pixelsToPercent(latest, node.target.y)\n\n return `${x}% ${y}%`\n },\n}\n","import { complex } from \"../../value/types/complex\"\nimport { mixNumber } from \"../../utils/mix/number\"\nimport type { ScaleCorrectorDefinition } from \"./types\"\n\nexport const correctBoxShadow: ScaleCorrectorDefinition = {\n correct: (latest: string, { treeScale, projectionDelta }) => {\n const original = latest\n const shadow = complex.parse(latest)\n\n // TODO: Doesn't support multiple shadows\n if (shadow.length > 5) return original\n\n const template = complex.createTransformer(latest)\n const offset = typeof shadow[0] !== \"number\" ? 1 : 0\n\n // Calculate the overall context scale\n const xScale = projectionDelta!.x.scale * treeScale!.x\n const yScale = projectionDelta!.y.scale * treeScale!.y\n\n // Scale x/y\n ;(shadow[0 + offset] as number) /= xScale\n ;(shadow[1 + offset] as number) /= yScale\n\n /**\n * Ideally we'd correct x and y scales individually, but because blur and\n * spread apply to both we have to take a scale average and apply that instead.\n * We could potentially improve the outcome of this by incorporating the ratio between\n * the two scales.\n */\n const averageScale = mixNumber(xScale, yScale, 0.5)\n\n // Blur\n if (typeof shadow[2 + offset] === \"number\")\n (shadow[2 + offset] as number) /= averageScale\n\n // Spread\n if (typeof shadow[3 + offset] === \"number\")\n (shadow[3 + offset] as number) /= averageScale\n\n return template(shadow)\n },\n}\n","import { isCSSVariableName } from \"../../animation/utils/is-css-variable\"\nimport { cornerRadiusProps } from \"../../utils/border-radius\"\nimport { correctBorderRadius } from \"./scale-border-radius\"\nimport { correctBoxShadow } from \"./scale-box-shadow\"\nimport type { ScaleCorrectorMap } from \"./types\"\n\nexport const scaleCorrectors: ScaleCorrectorMap = {\n borderRadius: {\n ...correctBorderRadius,\n applyTo: [...cornerRadiusProps],\n },\n borderTopLeftRadius: correctBorderRadius,\n borderTopRightRadius: correctBorderRadius,\n borderBottomLeftRadius: correctBorderRadius,\n borderBottomRightRadius: correctBorderRadius,\n boxShadow: correctBoxShadow,\n}\n\nexport function addScaleCorrector(correctors: ScaleCorrectorMap) {\n for (const key in correctors) {\n scaleCorrectors[key] = correctors[key]\n if (isCSSVariableName(key)) {\n scaleCorrectors[key].isCSSVariable = true\n }\n }\n}\n","import { transformProps } from \"./keys-transform\"\nimport type { MotionNodeOptions } from \"../../node/types\"\nimport {\n scaleCorrectors,\n addScaleCorrector,\n} from \"../../projection/styles/scale-correction\"\n\nexport { scaleCorrectors, addScaleCorrector }\n\nexport function isForcedMotionValue(\n key: string,\n { layout, layoutId }: MotionNodeOptions\n) {\n return (\n transformProps.has(key) ||\n key.startsWith(\"origin\") ||\n ((layout || layoutId !== undefined) &&\n (!!scaleCorrectors[key] || key === \"opacity\"))\n )\n}\n","import { isMotionValue } from \"../../../value/utils/is-motion-value\"\nimport type { MotionNodeOptions } from \"../../../node/types\"\nimport { isForcedMotionValue } from \"../../utils/is-forced-motion-value\"\nimport type { VisualElement } from \"../../VisualElement\"\n\nexport function scrapeMotionValuesFromProps(\n props: MotionNodeOptions,\n prevProps: MotionNodeOptions,\n visualElement?: VisualElement\n) {\n const style = (props as any).style\n const prevStyle = (prevProps as any)?.style\n const newValues: { [key: string]: any } = {}\n\n if (!style) return newValues\n\n for (const key in style) {\n if (\n isMotionValue(style[key]) ||\n (prevStyle && isMotionValue(prevStyle[key])) ||\n isForcedMotionValue(key, props) ||\n visualElement?.getValue(key)?.liveStyle !== undefined\n ) {\n newValues[key] = style[key]\n }\n }\n\n return newValues\n}\n","import { invariant, type Box } from \"motion-utils\"\nimport type { AnyResolvedKeyframe } from \"../../animation/types\"\nimport { isCSSVariableName } from \"../../animation/utils/is-css-variable\"\nimport type { MotionNodeOptions } from \"../../node/types\"\nimport { transformProps } from \"../utils/keys-transform\"\nimport {\n defaultTransformValue,\n readTransformValue,\n} from \"../dom/parse-transform\"\nimport { measureViewportBox } from \"../../projection/utils/measure\"\nimport { DOMVisualElement } from \"../dom/DOMVisualElement\"\nimport type { DOMVisualElementOptions } from \"../dom/types\"\nimport type { ResolvedValues, MotionConfigContextProps } from \"../types\"\nimport type { VisualElement } from \"../VisualElement\"\nimport { HTMLRenderState } from \"./types\"\nimport { buildHTMLStyles } from \"./utils/build-styles\"\nimport { renderHTML } from \"./utils/render\"\nimport { scrapeMotionValuesFromProps } from \"./utils/scrape-motion-values\"\n\nexport function getComputedStyle(element: HTMLElement) {\n return window.getComputedStyle(element)\n}\n\nexport class HTMLVisualElement extends DOMVisualElement<\n HTMLElement,\n HTMLRenderState,\n DOMVisualElementOptions\n> {\n type = \"html\"\n\n mount(instance: HTMLElement) {\n /**\n * If a custom component forwards its ref to something other than a\n * HTML/SVG element (a class instance, an imperative handle) there's\n * nothing for Motion to style, measure or attach gestures to. #2777\n */\n invariant(\n Boolean(instance.style),\n \"motion.create() components must forward their ref to a HTML or SVG element\",\n \"custom-component-ref\"\n )\n\n super.mount(instance)\n }\n\n readValueFromInstance(\n instance: HTMLElement,\n key: string\n ): AnyResolvedKeyframe | null | undefined {\n if (transformProps.has(key)) {\n return this.projection?.isProjecting\n ? defaultTransformValue(key)\n : readTransformValue(instance, key)\n } else {\n const computedStyle = getComputedStyle(instance)\n const value =\n (isCSSVariableName(key)\n ? computedStyle.getPropertyValue(key)\n : computedStyle[key as keyof typeof computedStyle]) || 0\n\n return typeof value === \"string\" ? value.trim() : (value as number)\n }\n }\n\n measureInstanceViewportBox(\n instance: HTMLElement,\n { transformPagePoint }: MotionNodeOptions & Partial\n ): Box {\n return measureViewportBox(instance, transformPagePoint)\n }\n\n build(\n renderState: HTMLRenderState,\n latestValues: ResolvedValues,\n props: MotionNodeOptions\n ) {\n buildHTMLStyles(renderState, latestValues, props.transformTemplate)\n }\n\n scrapeMotionValuesFromProps(\n props: MotionNodeOptions,\n prevProps: MotionNodeOptions,\n visualElement: VisualElement\n ) {\n return scrapeMotionValuesFromProps(props, prevProps, visualElement)\n }\n\n renderInstance = renderHTML\n}\n","import { createBox } from \"../../projection/geometry/models\"\nimport { ResolvedValues } from \"../types\"\nimport { VisualElement } from \"../VisualElement\"\n\ninterface ObjectRenderState {\n output: ResolvedValues\n}\n\nfunction isObjectKey(key: string, object: Object): key is keyof Object {\n return key in object\n}\n\nexport class ObjectVisualElement extends VisualElement<\n Object,\n ObjectRenderState\n> {\n type = \"object\"\n\n readValueFromInstance(instance: Object, key: string) {\n if (isObjectKey(key, instance)) {\n const value = instance[key]\n if (typeof value === \"string\" || typeof value === \"number\") {\n return value\n }\n }\n\n return undefined\n }\n\n getBaseTargetFromProps() {\n return undefined\n }\n\n removeValueFromRenderState(\n key: string,\n renderState: ObjectRenderState\n ): void {\n delete renderState.output[key]\n }\n\n measureInstanceViewportBox() {\n return createBox()\n }\n\n build(renderState: ObjectRenderState, latestValues: ResolvedValues) {\n Object.assign(renderState.output, latestValues)\n }\n\n renderInstance(instance: Object, { output }: ObjectRenderState) {\n Object.assign(instance, output)\n }\n\n sortInstanceNodePosition() {\n return 0\n }\n}\n","import { ResolvedValues } from \"../../types\"\n\nconst dashKeys = {\n offset: \"stroke-dashoffset\",\n array: \"stroke-dasharray\",\n}\n\nconst camelKeys = {\n offset: \"strokeDashoffset\",\n array: \"strokeDasharray\",\n}\n\n/**\n * Build SVG path properties. Uses the path's measured length to convert\n * our custom pathLength, pathSpacing and pathOffset into stroke-dashoffset\n * and stroke-dasharray attributes.\n *\n * This function is mutative to reduce per-frame GC.\n *\n * Note: We use unitless values for stroke-dasharray and stroke-dashoffset\n * because Safari incorrectly scales px values when the page is zoomed.\n */\nexport function buildSVGPath(\n attrs: ResolvedValues,\n length: number,\n spacing = 1,\n offset = 0,\n useDashCase: boolean = true\n): void {\n // Normalise path length by setting SVG attribute pathLength to 1\n attrs.pathLength = 1\n\n // We use dash case when setting attributes directly to the DOM node and camel case\n // when defining props on a React component.\n const keys = useDashCase ? dashKeys : camelKeys\n\n // Build the dash offset (unitless to avoid Safari zoom bug)\n attrs[keys.offset] = `${-offset}`\n\n // Build the dash array (unitless to avoid Safari zoom bug)\n attrs[keys.array] = `${length} ${spacing}`\n}\n","import type { MotionNodeOptions } from \"../../../node/types\"\nimport { buildHTMLStyles } from \"../../html/utils/build-styles\"\nimport { ResolvedValues } from \"../../types\"\nimport { SVGRenderState } from \"../types\"\nimport { buildSVGPath } from \"./path\"\n\nexport const cssStyleProperties = [\n \"transform\",\n \"opacity\",\n \"offsetDistance\",\n \"offsetPath\",\n \"offsetRotate\",\n \"offsetAnchor\",\n]\n\n/**\n * Build SVG visual attributes, like cx and style.transform\n */\nexport function buildSVGAttrs(\n state: SVGRenderState,\n {\n attrX,\n attrY,\n attrScale,\n pathLength,\n pathSpacing = 1,\n pathOffset = 0,\n // This is object creation, which we try to avoid per-frame.\n ...latest\n }: ResolvedValues,\n isSVGTag: boolean,\n transformTemplate?: MotionNodeOptions[\"transformTemplate\"],\n styleProp?: Record\n) {\n buildHTMLStyles(state, latest, transformTemplate)\n\n /**\n * For svg tags we just want to make sure viewBox is animatable and treat all the styles\n * as normal HTML tags.\n */\n if (isSVGTag) {\n if (state.style.viewBox) {\n state.attrs.viewBox = state.style.viewBox\n }\n return\n }\n\n state.attrs = state.style\n state.style = {}\n const { attrs, style } = state\n\n for (const key of cssStyleProperties) {\n if (attrs[key] !== undefined) {\n style[key] = attrs[key]\n delete attrs[key]\n }\n }\n\n if (style.transform || attrs.transformOrigin) {\n style.transformOrigin = attrs.transformOrigin ?? \"50% 50%\"\n delete attrs.transformOrigin\n }\n\n if (style.transform) {\n /**\n * SVG's element transform-origin uses its own median as a reference.\n * Therefore, transformBox becomes a fill-box\n */\n style.transformBox = (styleProp?.transformBox as string) ?? \"fill-box\"\n delete attrs.transformBox\n }\n\n // Render attrX/attrY/attrScale as attributes\n if (attrX !== undefined) attrs.x = attrX\n if (attrY !== undefined) attrs.y = attrY\n if (attrScale !== undefined) attrs.scale = attrScale\n\n // Build SVG path if one has been defined\n if (pathLength !== undefined) {\n buildSVGPath(\n attrs,\n pathLength as number,\n pathSpacing as number,\n pathOffset as number,\n false\n )\n }\n}\n","/**\n * A set of attribute names that are always read/written as camel case.\n */\nexport const camelCaseAttributes = new Set([\n \"baseFrequency\",\n \"diffuseConstant\",\n \"kernelMatrix\",\n \"kernelUnitLength\",\n \"keySplines\",\n \"keyTimes\",\n \"limitingConeAngle\",\n \"markerHeight\",\n \"markerWidth\",\n \"numOctaves\",\n \"targetX\",\n \"targetY\",\n \"surfaceScale\",\n \"specularConstant\",\n \"specularExponent\",\n \"stdDeviation\",\n \"tableValues\",\n \"viewBox\",\n \"gradientTransform\",\n \"pathLength\",\n \"startOffset\",\n \"textLength\",\n \"lengthAdjust\",\n])\n","export const isSVGTag = (tag: unknown) =>\n typeof tag === \"string\" && tag.toLowerCase() === \"svg\"\n","import type { MotionStyle } from \"../../VisualElement\"\nimport { camelToDash } from \"../../dom/utils/camel-to-dash\"\nimport { renderHTML } from \"../../html/utils/render\"\nimport { SVGRenderState } from \"../types\"\nimport { camelCaseAttributes } from \"./camel-case-attrs\"\n\nexport function renderSVG(\n element: SVGElement,\n renderState: SVGRenderState,\n _styleProp?: MotionStyle,\n projection?: any\n) {\n renderHTML(element as any, renderState, undefined, projection)\n\n for (const key in renderState.attrs) {\n element.setAttribute(\n !camelCaseAttributes.has(key) ? camelToDash(key) : key,\n renderState.attrs[key] as string\n )\n }\n}\n","import { isMotionValue } from \"../../../value/utils/is-motion-value\"\nimport type { MotionNodeOptions } from \"../../../node/types\"\nimport { transformPropOrder } from \"../../utils/keys-transform\"\nimport { scrapeMotionValuesFromProps as scrapeHTMLMotionValuesFromProps } from \"../../html/utils/scrape-motion-values\"\nimport type { VisualElement } from \"../../VisualElement\"\n\nexport function scrapeMotionValuesFromProps(\n props: MotionNodeOptions,\n prevProps: MotionNodeOptions,\n visualElement?: VisualElement\n) {\n const newValues = scrapeHTMLMotionValuesFromProps(\n props,\n prevProps,\n visualElement\n )\n\n for (const key in props) {\n if (\n isMotionValue(props[key as keyof typeof props]) ||\n isMotionValue(prevProps[key as keyof typeof prevProps])\n ) {\n const targetKey =\n transformPropOrder.indexOf(key) !== -1\n ? \"attr\" + key.charAt(0).toUpperCase() + key.substring(1)\n : key\n\n newValues[targetKey] = props[key as keyof typeof props]\n }\n }\n\n return newValues\n}\n","import type { AnyResolvedKeyframe } from \"../../animation/types\"\nimport type { MotionValue } from \"../../value\"\nimport type { MotionNodeOptions } from \"../../node/types\"\nimport { transformProps } from \"../utils/keys-transform\"\nimport { getDefaultValueType } from \"../../value/types/maps/defaults\"\nimport { createBox } from \"../../projection/geometry/models\"\nimport { DOMVisualElement } from \"../dom/DOMVisualElement\"\nimport type { DOMVisualElementOptions } from \"../dom/types\"\nimport { camelToDash } from \"../dom/utils/camel-to-dash\"\nimport type { ResolvedValues } from \"../types\"\nimport type { VisualElement, MotionStyle } from \"../VisualElement\"\nimport { SVGRenderState } from \"./types\"\nimport { buildSVGAttrs, cssStyleProperties } from \"./utils/build-attrs\"\nimport { camelCaseAttributes } from \"./utils/camel-case-attrs\"\nimport { isSVGTag } from \"./utils/is-svg-tag\"\nimport { renderSVG } from \"./utils/render\"\nimport { scrapeMotionValuesFromProps } from \"./utils/scrape-motion-values\"\nexport class SVGVisualElement extends DOMVisualElement<\n SVGElement,\n SVGRenderState,\n DOMVisualElementOptions\n> {\n type = \"svg\"\n\n isSVGTag = false\n\n getBaseTargetFromProps(\n props: MotionNodeOptions,\n key: string\n ): AnyResolvedKeyframe | MotionValue | undefined {\n return props[key as keyof MotionNodeOptions]\n }\n\n readValueFromInstance(instance: SVGElement, key: string) {\n if (transformProps.has(key)) {\n const defaultType = getDefaultValueType(key)\n return defaultType ? defaultType.default || 0 : 0\n }\n\n if (cssStyleProperties.includes(key)) {\n const computedStyle = getComputedStyle(instance)\n const value = computedStyle[key as keyof typeof computedStyle]\n if (typeof value === \"string\" && value) return value.trim()\n }\n\n key = !camelCaseAttributes.has(key) ? camelToDash(key) : key\n return instance.getAttribute(key)\n }\n\n measureInstanceViewportBox = createBox\n\n scrapeMotionValuesFromProps(\n props: MotionNodeOptions,\n prevProps: MotionNodeOptions,\n visualElement: VisualElement\n ) {\n return scrapeMotionValuesFromProps(props, prevProps, visualElement)\n }\n\n build(\n renderState: SVGRenderState,\n latestValues: ResolvedValues,\n props: MotionNodeOptions\n ) {\n buildSVGAttrs(\n renderState,\n latestValues,\n this.isSVGTag,\n props.transformTemplate,\n (props as any).style\n )\n }\n\n renderInstance(\n instance: SVGElement,\n renderState: SVGRenderState,\n styleProp?: MotionStyle | undefined,\n projection?: any\n ): void {\n renderSVG(instance, renderState, styleProp, projection)\n }\n\n mount(instance: SVGElement) {\n this.isSVGTag = isSVGTag(instance.tagName)\n super.mount(instance)\n }\n}\n","import { isVariantLabel } from \"./is-variant-label\"\nimport { variantProps } from \"./variant-props\"\n\nconst numVariantProps = variantProps.length\n\ntype VariantStateContext = {\n initial?: string | string[]\n animate?: string | string[]\n exit?: string | string[]\n whileHover?: string | string[]\n whileDrag?: string | string[]\n whileFocus?: string | string[]\n whileTap?: string | string[]\n}\n\n/**\n * Get variant context from a visual element's parent chain.\n * Uses `any` type for visualElement to avoid circular dependencies.\n */\nexport function getVariantContext(\n visualElement?: any\n): undefined | VariantStateContext {\n if (!visualElement) return undefined\n\n if (!visualElement.isControllingVariants) {\n const context = visualElement.parent\n ? getVariantContext(visualElement.parent) || {}\n : {}\n if (visualElement.props.initial !== undefined) {\n context.initial = visualElement.props.initial as any\n }\n return context\n }\n\n const context: VariantStateContext = {}\n for (let i = 0; i < numVariantProps; i++) {\n const name = variantProps[i] as keyof typeof context\n const prop = visualElement.props[name]\n\n if (isVariantLabel(prop) || prop === false) {\n ;(context as any)[name] = prop\n }\n }\n\n return context\n}\n","export function shallowCompare(next: any[], prev: any[] | null) {\n if (!Array.isArray(prev)) return false\n\n const prevLength = prev.length\n\n if (prevLength !== next.length) return false\n\n for (let i = 0; i < prevLength; i++) {\n if (prev[i] !== next[i]) return false\n }\n\n return true\n}\n","import type {\n AnimationDefinition,\n TargetAndTransition,\n VariantLabels,\n} from \"../../node/types\"\nimport type { AnimationType } from \"../types\"\nimport type { VisualElementAnimationOptions } from \"../../animation/interfaces/types\"\nimport { animateVisualElement } from \"../../animation/interfaces/visual-element\"\nimport { calcChildStagger } from \"../../animation/utils/calc-child-stagger\"\nimport { getVariantContext } from \"./get-variant-context\"\nimport { isAnimationControls } from \"./is-animation-controls\"\nimport { isKeyframesTarget } from \"./is-keyframes-target\"\nimport { isVariantLabel } from \"./is-variant-label\"\nimport { resolveVariant } from \"./resolve-dynamic-variants\"\nimport { shallowCompare } from \"./shallow-compare\"\nimport { variantPriorityOrder } from \"./variant-props\"\n\nexport type { VisualElementAnimationOptions }\n\nexport interface AnimationState {\n animateChanges: (type?: AnimationType) => Promise\n setActive: (\n type: AnimationType,\n isActive: boolean,\n options?: VisualElementAnimationOptions\n ) => Promise\n setAnimateFunction: (fn: any) => void\n getState: () => { [key: string]: AnimationTypeState }\n reset: () => void\n}\n\ninterface DefinitionAndOptions {\n animation: AnimationDefinition\n options?: VisualElementAnimationOptions\n}\n\nexport type AnimationList = string[] | TargetAndTransition[]\n\nconst reversePriorityOrder = [...variantPriorityOrder].reverse()\nconst numAnimationTypes = variantPriorityOrder.length\n\n/**\n * Type for the animate function that can be injected.\n * This allows the animation implementation to be provided by the framework layer.\n */\nexport type AnimateFunction = (animations: DefinitionAndOptions[]) => Promise\n\nfunction createAnimateFunction(visualElement: any): AnimateFunction {\n return (animations: DefinitionAndOptions[]) => {\n return Promise.all(\n animations.map(({ animation, options }) =>\n animateVisualElement(visualElement, animation, options)\n )\n )\n }\n}\n\nexport function createAnimationState(visualElement: any): AnimationState {\n let animate = createAnimateFunction(visualElement)\n let state = createState()\n let isInitialRender = true\n /**\n * Track whether the animation state has been reset (e.g. via StrictMode\n * double-invocation or Suspense unmount/remount). On the first\n * animateChanges() call after a reset we need to behave like the initial\n * render for variant-inheritance checks, even though isInitialRender is\n * already false.\n */\n let wasReset = false\n\n /**\n * This function will be used to reduce the animation definitions for\n * each active animation type into an object of resolved values for it.\n */\n const buildResolvedTypeValues =\n (type: AnimationType) =>\n (\n acc: { [key: string]: any },\n definition: string | TargetAndTransition | undefined\n ) => {\n const resolved = resolveVariant(\n visualElement,\n definition,\n type === \"exit\"\n ? visualElement.presenceContext?.custom\n : undefined\n )\n\n if (resolved) {\n const { transition, transitionEnd, ...target } = resolved\n acc = { ...acc, ...target, ...transitionEnd }\n }\n\n return acc\n }\n\n /**\n * This just allows us to inject mocked animation functions\n * @internal\n */\n function setAnimateFunction(\n makeAnimator: (visualElement: any) => AnimateFunction\n ) {\n animate = makeAnimator(visualElement)\n }\n\n /**\n * When we receive new props, we need to:\n * 1. Create a list of protected keys for each type. This is a directory of\n * value keys that are currently being \"handled\" by types of a higher priority\n * so that whenever an animation is played of a given type, these values are\n * protected from being animated.\n * 2. Determine if an animation type needs animating.\n * 3. Determine if any values have been removed from a type and figure out\n * what to animate those to.\n */\n function animateChanges(changedActiveType?: AnimationType) {\n const { props } = visualElement\n const context = getVariantContext(visualElement.parent) || {}\n\n /**\n * A list of animations that we'll build into as we iterate through the animation\n * types. This will get executed at the end of the function.\n */\n const animations: DefinitionAndOptions[] = []\n\n /**\n * Keep track of which values have been removed. Then, as we hit lower priority\n * animation types, we can check if they contain removed values and animate to that.\n */\n const removedKeys = new Set()\n\n /**\n * A dictionary of all encountered keys. This is an object to let us build into and\n * copy it without iteration. Each time we hit an animation type we set its protected\n * keys - the keys its not allowed to animate - to the latest version of this object.\n */\n let encounteredKeys: { [key: string]: any } = {}\n\n /**\n * If a variant has been removed at a given index, and this component is controlling\n * variant animations, we want to ensure lower-priority variants are forced to animate.\n */\n let removedVariantIndex = Infinity\n\n /**\n * Iterate through all animation types in reverse priority order. For each, we want to\n * detect which values it's handling and whether or not they've changed (and therefore\n * need to be animated). If any values have been removed, we want to detect those in\n * lower priority props and flag for animation.\n */\n for (let i = 0; i < numAnimationTypes; i++) {\n const type = reversePriorityOrder[i]\n const typeState = state[type]\n const prop =\n props[type] !== undefined\n ? props[type]\n : context[type as keyof typeof context]\n const propIsVariant = isVariantLabel(prop)\n\n /**\n * If this type has *just* changed isActive status, set activeDelta\n * to that status. Otherwise set to null.\n */\n const activeDelta =\n type === changedActiveType ? typeState.isActive : null\n\n if (activeDelta === false) removedVariantIndex = i\n\n /**\n * If this prop is an inherited variant, rather than been set directly on the\n * component itself, we want to make sure we allow the parent to trigger animations.\n *\n * TODO: Can probably change this to a !isControllingVariants check\n */\n let isInherited =\n prop === context[type as keyof typeof context] &&\n prop !== props[type] &&\n propIsVariant\n\n if (\n isInherited &&\n (isInitialRender || wasReset) &&\n visualElement.manuallyAnimateOnMount\n ) {\n isInherited = false\n }\n\n /**\n * Set all encountered keys so far as the protected keys for this type. This will\n * be any key that has been animated or otherwise handled by active, higher-priortiy types.\n */\n typeState.protectedKeys = { ...encounteredKeys }\n\n // Check if we can skip analysing this prop early\n if (\n // If it isn't active and hasn't *just* been set as inactive\n (!typeState.isActive && activeDelta === null) ||\n // If we didn't and don't have any defined prop for this animation type\n (!prop && !typeState.prevProp) ||\n // Or if the prop doesn't define an animation\n isAnimationControls(prop) ||\n typeof prop === \"boolean\"\n ) {\n continue\n }\n\n /**\n * If exit is already active and wasn't just activated, skip\n * re-processing to prevent interrupting running exit animations.\n * Re-resolving exit with a changed custom value can start new\n * value animations that stop the originals, leaving the exit\n * animation promise unresolved and the component stuck in the DOM.\n */\n if (type === \"exit\" && typeState.isActive && activeDelta !== true) {\n if (typeState.prevResolvedValues) {\n encounteredKeys = {\n ...encounteredKeys,\n ...typeState.prevResolvedValues,\n }\n }\n continue\n }\n\n /**\n * As we go look through the values defined on this type, if we detect\n * a changed value or a value that was removed in a higher priority, we set\n * this to true and add this prop to the animation list.\n */\n const variantDidChange = checkVariantsDidChange(\n typeState.prevProp,\n prop\n )\n\n let shouldAnimateType =\n variantDidChange ||\n // If we're making this variant active, we want to always make it active\n (type === changedActiveType &&\n typeState.isActive &&\n !isInherited &&\n propIsVariant) ||\n // If we removed a higher-priority variant (i is in reverse order)\n (i > removedVariantIndex && propIsVariant)\n\n let handledRemovedValues = false\n\n /**\n * As animations can be set as variant lists, variants or target objects, we\n * coerce everything to an array if it isn't one already\n */\n const definitionList = Array.isArray(prop) ? prop : [prop]\n\n /**\n * Build an object of all the resolved values. We'll use this in the subsequent\n * animateChanges calls to determine whether a value has changed.\n */\n let resolvedValues = definitionList.reduce(\n buildResolvedTypeValues(type),\n {}\n )\n\n if (activeDelta === false) resolvedValues = {}\n\n /**\n * Now we need to loop through all the keys in the prev prop and this prop,\n * and decide:\n * 1. If the value has changed, and needs animating\n * 2. If it has been removed, and needs adding to the removedKeys set\n * 3. If it has been removed in a higher priority type and needs animating\n * 4. If it hasn't been removed in a higher priority but hasn't changed, and\n * needs adding to the type's protectedKeys list.\n */\n const { prevResolvedValues = {} } = typeState\n\n const allKeys = {\n ...prevResolvedValues,\n ...resolvedValues,\n }\n const markToAnimate = (key: string) => {\n shouldAnimateType = true\n if (removedKeys.has(key)) {\n handledRemovedValues = true\n removedKeys.delete(key)\n }\n typeState.needsAnimating[key] = true\n\n const motionValue = visualElement.getValue(key)\n if (motionValue) motionValue.liveStyle = false\n }\n\n for (const key in allKeys) {\n const next = resolvedValues[key]\n const prev = prevResolvedValues[key]\n\n // If we've already handled this we can just skip ahead\n if (encounteredKeys.hasOwnProperty(key)) continue\n\n /**\n * If the value has changed, we probably want to animate it.\n */\n let valueHasChanged = false\n if (isKeyframesTarget(next) && isKeyframesTarget(prev)) {\n valueHasChanged =\n !shallowCompare(next, prev) || variantDidChange\n } else {\n valueHasChanged = next !== prev\n }\n\n if (valueHasChanged) {\n if (next !== undefined && next !== null) {\n // If next is defined and doesn't equal prev, it needs animating\n markToAnimate(key)\n } else {\n // If it's undefined, it's been removed.\n removedKeys.add(key)\n }\n } else if (next !== undefined && removedKeys.has(key)) {\n /**\n * If next hasn't changed and it isn't undefined, we want to check if it's\n * been removed by a higher priority\n */\n markToAnimate(key)\n } else {\n /**\n * If it hasn't changed, we add it to the list of protected values\n * to ensure it doesn't get animated.\n */\n typeState.protectedKeys[key] = true\n }\n }\n\n /**\n * Update the typeState so next time animateChanges is called we can compare the\n * latest prop and resolvedValues to these.\n */\n typeState.prevProp = prop\n typeState.prevResolvedValues = resolvedValues\n\n if (typeState.isActive) {\n encounteredKeys = { ...encounteredKeys, ...resolvedValues }\n }\n\n if (\n (isInitialRender || wasReset) &&\n visualElement.blockInitialAnimation\n ) {\n shouldAnimateType = false\n }\n\n /**\n * If this is an inherited prop we want to skip this animation\n * unless the inherited variants haven't changed on this render.\n */\n const willAnimateViaParent = isInherited && variantDidChange\n const needsAnimating = !willAnimateViaParent || handledRemovedValues\n if (shouldAnimateType && needsAnimating) {\n animations.push(\n ...definitionList.map((animation) => {\n const options: VisualElementAnimationOptions = { type }\n\n /**\n * If we're performing the initial animation, but we're not\n * rendering at the same time as the variant-controlling parent,\n * we want to use the parent's transition to calculate the stagger.\n */\n if (\n typeof animation === \"string\" &&\n (isInitialRender || wasReset) &&\n !willAnimateViaParent &&\n visualElement.manuallyAnimateOnMount &&\n visualElement.parent\n ) {\n const { parent } = visualElement\n const parentVariant = resolveVariant(\n parent,\n animation\n )\n\n if (parent.enteringChildren && parentVariant) {\n const { delayChildren } =\n parentVariant.transition || {}\n options.delay = calcChildStagger(\n parent.enteringChildren,\n visualElement,\n delayChildren\n )\n }\n }\n\n return {\n animation: animation as AnimationDefinition,\n options,\n }\n })\n )\n }\n }\n\n /**\n * If there are some removed value that haven't been dealt with,\n * we need to create a new animation that falls back either to the value\n * defined in the style prop, or the last read value.\n */\n if (removedKeys.size) {\n const fallbackAnimation: TargetAndTransition = {}\n\n /**\n * If the initial prop contains a transition we can use that, otherwise\n * allow the animation function to use the visual element's default.\n */\n if (typeof props.initial !== \"boolean\") {\n const initialTransition = resolveVariant(\n visualElement,\n Array.isArray(props.initial)\n ? props.initial[0]\n : props.initial\n )\n\n if (initialTransition && initialTransition.transition) {\n fallbackAnimation.transition = initialTransition.transition\n }\n }\n\n removedKeys.forEach((key) => {\n const fallbackTarget = visualElement.getBaseTarget(key)\n\n const motionValue = visualElement.getValue(key)\n if (motionValue) motionValue.liveStyle = true\n\n // @ts-expect-error - @mattgperry to figure if we should do something here\n fallbackAnimation[key] = fallbackTarget ?? null\n })\n\n animations.push({ animation: fallbackAnimation })\n }\n\n let shouldAnimate = Boolean(animations.length)\n\n if (\n isInitialRender &&\n (props.initial === false || props.initial === props.animate) &&\n !visualElement.manuallyAnimateOnMount\n ) {\n shouldAnimate = false\n }\n\n isInitialRender = false\n wasReset = false\n return shouldAnimate ? animate(animations) : Promise.resolve()\n }\n\n /**\n * Change whether a certain animation type is active.\n */\n function setActive(type: AnimationType, isActive: boolean) {\n // If the active state hasn't changed, we can safely do nothing here\n if (state[type].isActive === isActive) return Promise.resolve()\n\n // Propagate active change to children\n visualElement.variantChildren?.forEach((child: any) =>\n child.animationState?.setActive(type, isActive)\n )\n\n state[type].isActive = isActive\n\n const animations = animateChanges(type)\n\n for (const key in state) {\n state[key as keyof typeof state].protectedKeys = {}\n }\n\n return animations\n }\n\n return {\n animateChanges,\n setActive,\n setAnimateFunction,\n getState: () => state,\n reset: () => {\n state = createState()\n wasReset = true\n },\n }\n}\n\nexport function checkVariantsDidChange(prev: any, next: any) {\n if (typeof next === \"string\") {\n return next !== prev\n } else if (Array.isArray(next)) {\n return !shallowCompare(next, prev)\n }\n\n return false\n}\n\nexport interface AnimationTypeState {\n isActive: boolean\n protectedKeys: { [key: string]: true }\n needsAnimating: { [key: string]: boolean }\n prevResolvedValues: { [key: string]: any }\n prevProp?: VariantLabels | TargetAndTransition\n}\n\nfunction createTypeState(isActive = false): AnimationTypeState {\n return {\n isActive,\n protectedKeys: {},\n needsAnimating: {},\n prevResolvedValues: {},\n }\n}\n\nfunction createState() {\n return {\n animate: createTypeState(true),\n whileInView: createTypeState(),\n whileHover: createTypeState(),\n whileTap: createTypeState(),\n whileDrag: createTypeState(),\n whileFocus: createTypeState(),\n exit: createTypeState(),\n }\n}\n","import { Axis, AxisDelta, Box } from \"motion-utils\"\n\n/**\n * Reset an axis to the provided origin box.\n *\n * This is a mutative operation.\n */\nexport function copyAxisInto(axis: Axis, originAxis: Axis) {\n axis.min = originAxis.min\n axis.max = originAxis.max\n}\n\n/**\n * Reset a box to the provided origin box.\n *\n * This is a mutative operation.\n */\nexport function copyBoxInto(box: Box, originBox: Box) {\n copyAxisInto(box.x, originBox.x)\n copyAxisInto(box.y, originBox.y)\n}\n\n/**\n * Reset a delta to the provided origin box.\n *\n * This is a mutative operation.\n */\nexport function copyAxisDeltaInto(delta: AxisDelta, originDelta: AxisDelta) {\n delta.translate = originDelta.translate\n delta.scale = originDelta.scale\n delta.originPoint = originDelta.originPoint\n delta.origin = originDelta.origin\n}\n","import { Axis, AxisDelta, Box, Delta, Point } from \"motion-utils\"\nimport { mixNumber } from \"../../utils/mix/number\"\nimport { ResolvedValues } from \"../../render/types\"\n\nconst SCALE_PRECISION = 0.0001\nconst SCALE_MIN = 1 - SCALE_PRECISION\nconst SCALE_MAX = 1 + SCALE_PRECISION\nconst TRANSLATE_PRECISION = 0.01\nconst TRANSLATE_MIN = 0 - TRANSLATE_PRECISION\nconst TRANSLATE_MAX = 0 + TRANSLATE_PRECISION\n\nexport function calcLength(axis: Axis) {\n return axis.max - axis.min\n}\n\nexport function isNear(\n value: number,\n target: number,\n maxDistance: number\n): boolean {\n return Math.abs(value - target) <= maxDistance\n}\n\nexport function calcAxisDelta(\n delta: AxisDelta,\n source: Axis,\n target: Axis,\n origin: number = 0.5\n) {\n delta.origin = origin\n delta.originPoint = mixNumber(source.min, source.max, delta.origin)\n delta.scale = calcLength(target) / calcLength(source)\n delta.translate =\n mixNumber(target.min, target.max, delta.origin) - delta.originPoint\n\n if (\n (delta.scale >= SCALE_MIN && delta.scale <= SCALE_MAX) ||\n isNaN(delta.scale)\n ) {\n delta.scale = 1.0\n }\n\n if (\n (delta.translate >= TRANSLATE_MIN &&\n delta.translate <= TRANSLATE_MAX) ||\n isNaN(delta.translate)\n ) {\n delta.translate = 0.0\n }\n}\n\nexport function calcBoxDelta(\n delta: Delta,\n source: Box,\n target: Box,\n origin?: ResolvedValues\n): void {\n calcAxisDelta(\n delta.x,\n source.x,\n target.x,\n origin ? (origin.originX as number) : undefined\n )\n calcAxisDelta(\n delta.y,\n source.y,\n target.y,\n origin ? (origin.originY as number) : undefined\n )\n}\n\nexport function calcRelativeAxis(\n target: Axis,\n relative: Axis,\n parent: Axis,\n anchor: number = 0\n) {\n const anchorPoint = anchor\n ? mixNumber(parent.min, parent.max, anchor)\n : parent.min\n target.min = anchorPoint + relative.min\n target.max = target.min + calcLength(relative)\n}\n\nexport function calcRelativeBox(\n target: Box,\n relative: Box,\n parent: Box,\n anchor?: Point\n) {\n calcRelativeAxis(target.x, relative.x, parent.x, anchor?.x)\n calcRelativeAxis(target.y, relative.y, parent.y, anchor?.y)\n}\n\nexport function calcRelativeAxisPosition(\n target: Axis,\n layout: Axis,\n parent: Axis,\n anchor: number = 0\n) {\n const anchorPoint = anchor\n ? mixNumber(parent.min, parent.max, anchor)\n : parent.min\n target.min = layout.min - anchorPoint\n target.max = target.min + calcLength(layout)\n}\n\nexport function calcRelativePosition(\n target: Box,\n layout: Box,\n parent: Box,\n anchor?: Point\n) {\n calcRelativeAxisPosition(target.x, layout.x, parent.x, anchor?.x)\n calcRelativeAxisPosition(target.y, layout.y, parent.y, anchor?.y)\n}\n","import { Axis, Box } from \"motion-utils\"\nimport { mixNumber } from \"../../utils/mix/number\"\nimport { percent } from \"../../value/types/numbers/units\"\nimport { ResolvedValues } from \"../../render/types\"\nimport { scalePoint } from \"./delta-apply\"\n\n/**\n * Remove a delta from a point. This is essentially the steps of applyPointDelta in reverse\n */\nexport function removePointDelta(\n point: number,\n translate: number,\n scale: number,\n originPoint: number,\n boxScale?: number\n): number {\n point -= translate\n point = scalePoint(point, 1 / scale, originPoint)\n\n if (boxScale !== undefined) {\n point = scalePoint(point, 1 / boxScale, originPoint)\n }\n\n return point\n}\n\n/**\n * Remove a delta from an axis. This is essentially the steps of applyAxisDelta in reverse\n */\nexport function removeAxisDelta(\n axis: Axis,\n translate: number | string = 0,\n scale: number = 1,\n origin: number = 0.5,\n boxScale?: number,\n originAxis: Axis = axis,\n sourceAxis: Axis = axis\n): void {\n if (percent.test(translate)) {\n translate = parseFloat(translate as string)\n const relativeProgress = mixNumber(\n sourceAxis.min,\n sourceAxis.max,\n translate / 100\n )\n translate = relativeProgress - sourceAxis.min\n }\n\n if (typeof translate !== \"number\") return\n\n let originPoint = mixNumber(originAxis.min, originAxis.max, origin)\n if (axis === originAxis) originPoint -= translate\n\n axis.min = removePointDelta(\n axis.min,\n translate,\n scale,\n originPoint,\n boxScale\n )\n\n axis.max = removePointDelta(\n axis.max,\n translate,\n scale,\n originPoint,\n boxScale\n )\n}\n\n/**\n * Remove a transforms from an axis. This is essentially the steps of applyAxisTransforms in reverse\n * and acts as a bridge between motion values and removeAxisDelta\n */\nexport function removeAxisTransforms(\n axis: Axis,\n transforms: ResolvedValues,\n [key, scaleKey, originKey]: string[],\n origin?: Axis,\n sourceAxis?: Axis\n) {\n removeAxisDelta(\n axis,\n transforms[key] as number,\n transforms[scaleKey] as number,\n transforms[originKey] as number,\n transforms.scale as number,\n origin,\n sourceAxis\n )\n}\n\n/**\n * The names of the motion values we want to apply as translation, scale and origin.\n */\nconst xKeys = [\"x\", \"scaleX\", \"originX\"]\nconst yKeys = [\"y\", \"scaleY\", \"originY\"]\n\n/**\n * Remove a transforms from an box. This is essentially the steps of applyAxisBox in reverse\n * and acts as a bridge between motion values and removeAxisDelta\n */\nexport function removeBoxTransforms(\n box: Box,\n transforms: ResolvedValues,\n originBox?: Box,\n sourceBox?: Box\n): void {\n removeAxisTransforms(\n box.x,\n transforms,\n xKeys,\n originBox ? originBox.x : undefined,\n sourceBox ? sourceBox.x : undefined\n )\n removeAxisTransforms(\n box.y,\n transforms,\n yKeys,\n originBox ? originBox.y : undefined,\n sourceBox ? sourceBox.y : undefined\n )\n}\n","import { Axis, AxisDelta, Box, Delta } from \"motion-utils\"\nimport { calcLength } from \"./delta-calc\"\n\nfunction isAxisDeltaZero(delta: AxisDelta) {\n return delta.translate === 0 && delta.scale === 1\n}\n\nexport function isDeltaZero(delta: Delta) {\n return isAxisDeltaZero(delta.x) && isAxisDeltaZero(delta.y)\n}\n\nexport function axisEquals(a: Axis, b: Axis) {\n return a.min === b.min && a.max === b.max\n}\n\nexport function boxEquals(a: Box, b: Box) {\n return axisEquals(a.x, b.x) && axisEquals(a.y, b.y)\n}\n\nexport function axisEqualsRounded(a: Axis, b: Axis) {\n return (\n Math.round(a.min) === Math.round(b.min) &&\n Math.round(a.max) === Math.round(b.max)\n )\n}\n\nexport function boxEqualsRounded(a: Box, b: Box) {\n return axisEqualsRounded(a.x, b.x) && axisEqualsRounded(a.y, b.y)\n}\n\nexport function aspectRatio(box: Box): number {\n return calcLength(box.x) / calcLength(box.y)\n}\n\nexport function axisDeltaEquals(a: AxisDelta, b: AxisDelta) {\n return (\n a.translate === b.translate &&\n a.scale === b.scale &&\n a.originPoint === b.originPoint\n )\n}\n","type Callback = (axis: \"x\" | \"y\") => void\n\nexport function eachAxis(callback: Callback) {\n return [callback(\"x\"), callback(\"y\")]\n}\n","import type { Delta, Point } from \"motion-utils\"\nimport type { ResolvedValues } from \"../../node/types\"\n\nexport function buildProjectionTransform(\n delta: Delta,\n treeScale: Point,\n latestTransform?: ResolvedValues\n): string {\n let transform = \"\"\n\n /**\n * The translations we use to calculate are always relative to the viewport coordinate space.\n * But when we apply scales, we also scale the coordinate space of an element and its children.\n * For instance if we have a treeScale (the culmination of all parent scales) of 0.5 and we need\n * to move an element 100 pixels, we actually need to move it 200 in within that scaled space.\n */\n const xTranslate = delta.x.translate / treeScale.x\n const yTranslate = delta.y.translate / treeScale.y\n const zTranslate = latestTransform?.z || 0\n if (xTranslate || yTranslate || zTranslate) {\n transform = `translate3d(${xTranslate}px, ${yTranslate}px, ${zTranslate}px) `\n }\n\n /**\n * Apply scale correction for the tree transform.\n * This will apply scale to the screen-orientated axes.\n */\n if (treeScale.x !== 1 || treeScale.y !== 1) {\n transform += `scale(${1 / treeScale.x}, ${1 / treeScale.y}) `\n }\n\n if (latestTransform) {\n const {\n transformPerspective,\n rotate,\n pathRotation,\n rotateX,\n rotateY,\n skewX,\n skewY,\n } = latestTransform\n if (transformPerspective)\n transform = `perspective(${transformPerspective}px) ${transform}`\n if (rotate) transform += `rotate(${rotate}deg) `\n // Additive `rotate()` so user `rotate` isn't clobbered.\n if (pathRotation) transform += `rotate(${pathRotation}deg) `\n if (rotateX) transform += `rotateX(${rotateX}deg) `\n if (rotateY) transform += `rotateY(${rotateY}deg) `\n if (skewX) transform += `skewX(${skewX}deg) `\n if (skewY) transform += `skewY(${skewY}deg) `\n }\n\n /**\n * Apply scale to match the size of the element to the size we want it.\n * This will apply scale to the element-orientated axes.\n */\n const elementScaleX = delta.x.scale * treeScale.x\n const elementScaleY = delta.y.scale * treeScale.y\n if (elementScaleX !== 1 || elementScaleY !== 1) {\n transform += `scale(${elementScaleX}, ${elementScaleY})`\n }\n\n return transform || \"none\"\n}\n","import { mixNumber } from \"../../utils/mix/number\"\nimport { percent, px } from \"../../value/types/numbers/units\"\nimport type { AnyResolvedKeyframe } from \"../../animation/types\"\nimport {\n progress as calcProgress,\n circOut,\n EasingFunction,\n noop,\n} from \"motion-utils\"\nimport type { ResolvedValues } from \"../../node/types\"\nimport { cornerRadiusProps } from \"../../utils/border-radius\"\n\nconst numBorders = cornerRadiusProps.length\n\nconst asNumber = (value: AnyResolvedKeyframe) =>\n typeof value === \"string\" ? parseFloat(value) : value\n\nconst isPx = (value: AnyResolvedKeyframe) =>\n typeof value === \"number\" || px.test(value)\n\nexport function mixValues(\n target: ResolvedValues,\n follow: ResolvedValues,\n lead: ResolvedValues,\n progress: number,\n shouldCrossfadeOpacity: boolean,\n isOnlyMember: boolean\n) {\n if (shouldCrossfadeOpacity) {\n target.opacity = mixNumber(\n 0,\n (lead.opacity as number) ?? 1,\n easeCrossfadeIn(progress)\n )\n target.opacityExit = mixNumber(\n (follow.opacity as number) ?? 1,\n 0,\n easeCrossfadeOut(progress)\n )\n } else if (isOnlyMember) {\n target.opacity = mixNumber(\n (follow.opacity as number) ?? 1,\n (lead.opacity as number) ?? 1,\n progress\n )\n }\n\n /**\n * Mix border radius\n */\n for (let i = 0; i < numBorders; i++) {\n const borderLabel = cornerRadiusProps[i]\n let followRadius = getRadius(follow, borderLabel)\n let leadRadius = getRadius(lead, borderLabel)\n\n if (followRadius === undefined && leadRadius === undefined) continue\n\n followRadius ||= 0\n leadRadius ||= 0\n\n const canMix =\n followRadius === 0 ||\n leadRadius === 0 ||\n isPx(followRadius) === isPx(leadRadius)\n\n if (canMix) {\n target[borderLabel] = Math.max(\n mixNumber(\n asNumber(followRadius),\n asNumber(leadRadius),\n progress\n ),\n 0\n )\n\n if (percent.test(leadRadius) || percent.test(followRadius)) {\n target[borderLabel] += \"%\"\n }\n } else {\n target[borderLabel] = leadRadius\n }\n }\n\n /**\n * Mix rotation\n */\n if (follow.rotate || lead.rotate) {\n target.rotate = mixNumber(\n (follow.rotate as number) || 0,\n (lead.rotate as number) || 0,\n progress\n )\n }\n}\n\nfunction getRadius(values: ResolvedValues, radiusName: string) {\n return values[radiusName] !== undefined\n ? values[radiusName]\n : values.borderRadius\n}\n\nconst easeCrossfadeIn = /*@__PURE__*/ compress(0, 0.5, circOut)\nconst easeCrossfadeOut = /*@__PURE__*/ compress(0.5, 0.95, noop)\n\nfunction compress(\n min: number,\n max: number,\n easing: EasingFunction\n): EasingFunction {\n return (p: number) => {\n // Could replace ifs with clamp\n if (p < min) return 0\n if (p > max) return 1\n return easing(calcProgress(min, max, p))\n }\n}\n","import { animateMotionValue } from \"../interfaces/motion-value\"\nimport type {\n AnimationPlaybackControlsWithThen,\n AnyResolvedKeyframe,\n UnresolvedValueKeyframe,\n ValueAnimationTransition,\n} from \"../types\"\nimport {\n motionValue as createMotionValue,\n MotionValue,\n} from \"../../value\"\nimport { isMotionValue } from \"../../value/utils/is-motion-value\"\n\nexport function animateSingleValue(\n value: MotionValue | V,\n keyframes: V | UnresolvedValueKeyframe[],\n options?: ValueAnimationTransition\n): AnimationPlaybackControlsWithThen {\n const motionValue = isMotionValue(value) ? value : createMotionValue(value)\n\n motionValue.start(animateMotionValue(\"\", motionValue, keyframes, options))\n\n return motionValue.animation!\n}\n","export function addDomEvent(\n target: EventTarget,\n eventName: string,\n handler: EventListener,\n options: AddEventListenerOptions = { passive: true }\n) {\n target.addEventListener(eventName, handler, options)\n\n return () => target.removeEventListener(eventName, handler, options)\n}\n","import type { VisualElement } from \"../../render/VisualElement\"\n\nexport interface WithDepth {\n depth: number\n}\n\nexport const compareByDepth = (a: VisualElement, b: VisualElement) =>\n a.depth - b.depth\n","import { addUniqueItem, removeItem } from \"motion-utils\"\nimport { compareByDepth, WithDepth } from \"./compare-by-depth\"\n\nexport class FlatTree {\n private children: WithDepth[] = []\n\n private isDirty: boolean = false\n\n add(child: WithDepth) {\n addUniqueItem(this.children, child)\n this.isDirty = true\n }\n\n remove(child: WithDepth) {\n removeItem(this.children, child)\n this.isDirty = true\n }\n\n forEach(callback: (child: WithDepth) => void) {\n this.isDirty && this.children.sort(compareByDepth)\n this.isDirty = false\n this.children.forEach(callback)\n }\n}\n","import { cancelFrame, frame } from \"../frameloop\"\nimport { time } from \"../frameloop/sync-time\"\nimport type { FrameData } from \"../frameloop/types\"\nimport { secondsToMilliseconds } from \"motion-utils\"\n\nexport type DelayedFunction = (overshoot: number) => void\n\n/**\n * Timeout defined in ms\n */\nexport function delay(callback: DelayedFunction, timeout: number) {\n const start = time.now()\n\n const checkElapsed = ({ timestamp }: FrameData) => {\n const elapsed = timestamp - start\n\n if (elapsed >= timeout) {\n cancelFrame(checkElapsed)\n callback(elapsed - timeout)\n }\n }\n\n frame.setup(checkElapsed, true)\n\n return () => cancelFrame(checkElapsed)\n}\n\nexport function delayInSeconds(callback: DelayedFunction, timeout: number) {\n return delay(callback, secondsToMilliseconds(timeout))\n}\n","import type { AnyResolvedKeyframe } from \"../../animation/types\"\nimport { isMotionValue } from \"./is-motion-value\"\nimport type { MotionValue } from \"../index\"\n\n/**\n * If the provided value is a MotionValue, this returns the actual value, otherwise just the value itself\n */\nexport function resolveMotionValue(\n value?: AnyResolvedKeyframe | MotionValue\n): AnyResolvedKeyframe {\n return isMotionValue(value) ? value.get() : value\n}\n","import { addUniqueItem, removeItem } from \"motion-utils\"\nimport type { IProjectionNode } from \"../node/types\"\n\nexport class NodeStack {\n lead?: IProjectionNode\n prevLead?: IProjectionNode\n members: IProjectionNode[] = []\n\n add(node: IProjectionNode) {\n addUniqueItem(this.members, node)\n\n for (let i = this.members.length - 1; i >= 0; i--) {\n const member = this.members[i]\n if (member === node || member === this.lead || member === this.prevLead) continue\n const inst = member.instance as HTMLElement | undefined\n if ((!inst || inst.isConnected === false) && !member.snapshot) {\n removeItem(this.members, member)\n member.unmount()\n }\n }\n\n node.scheduleRender()\n }\n\n remove(node: IProjectionNode) {\n removeItem(this.members, node)\n if (node === this.prevLead) this.prevLead = undefined\n if (node === this.lead) {\n const prevLead = this.members[this.members.length - 1]\n if (prevLead) this.promote(prevLead)\n }\n }\n\n relegate(node: IProjectionNode) {\n for (let i = this.members.indexOf(node) - 1; i >= 0; i--) {\n const member = this.members[i]\n if (member.isPresent !== false && (member.instance as HTMLElement)?.isConnected !== false) {\n this.promote(member)\n return true\n }\n }\n return false\n }\n\n promote(node: IProjectionNode, preserveFollowOpacity?: boolean) {\n const prevLead = this.lead\n if (node === prevLead) return\n\n this.prevLead = prevLead\n this.lead = node\n node.show()\n\n if (prevLead) {\n prevLead.updateSnapshot()\n node.scheduleRender()\n\n const { layoutDependency: prevDep } = prevLead.options\n const { layoutDependency: nextDep } = node.options\n\n if (prevDep === undefined || prevDep !== nextDep) {\n node.resumeFrom = prevLead\n if (preserveFollowOpacity) prevLead.preserveOpacity = true\n\n if (prevLead.snapshot) {\n node.snapshot = prevLead.snapshot\n node.snapshot.latestValues =\n prevLead.animationValues || prevLead.latestValues\n }\n\n if (node.root?.isUpdating) node.isLayoutDirty = true\n }\n if (node.options.crossfade === false) prevLead.hide()\n }\n }\n\n exitAnimationComplete() {\n this.members.forEach((member) => {\n member.options.onExitComplete?.()\n member.resumingFrom?.options.onExitComplete?.()\n })\n }\n\n scheduleRender() {\n this.members.forEach(\n (member) => member.instance && member.scheduleRender(false)\n )\n }\n\n removeLeadSnapshot() {\n if (this.lead?.snapshot) this.lead.snapshot = undefined\n }\n}\n","/**\n * This should only ever be modified on the client otherwise it'll\n * persist through server requests. If we need instanced states we\n * could lazy-init via root.\n */\nexport const globalProjectionState = {\n /**\n * Global flag as to whether the tree has animated since the last time\n * we resized the window\n */\n hasAnimatedSinceResize: true,\n\n /**\n * We set this to true once, on the first update. Any nodes added to the tree beyond that\n * update will be given a `data-projection-id` attribute.\n */\n hasEverUpdated: false,\n}\n","import {\n Axis,\n AxisDelta,\n Box,\n clamp,\n Delta,\n noop,\n Point,\n SubscriptionManager,\n} from \"motion-utils\"\nimport { animateSingleValue } from \"../../animation/animate/single-value\"\nimport { JSAnimation } from \"../../animation/JSAnimation\"\nimport { getOptimisedAppearId } from \"../../animation/optimized-appear/get-appear-id\"\nimport {\n MotionPath,\n PathInterpolator,\n Transition,\n ValueAnimationOptions,\n} from \"../../animation/types\"\nimport { getValueTransition } from \"../../animation/utils/get-value-transition\"\nimport { cancelFrame, frame, frameData, frameSteps } from \"../../frameloop\"\nimport { microtask } from \"../../frameloop/microtask\"\nimport { time } from \"../../frameloop/sync-time\"\nimport type { Process } from \"../../frameloop/types\"\nimport { HTMLVisualElement } from \"../../render/html/HTMLVisualElement\"\nimport type { ResolvedValues } from \"../../render/types\"\nimport { scaleCorrectors } from \"../../render/utils/is-forced-motion-value\"\nimport type { MotionStyle, VisualElement } from \"../../render/VisualElement\"\nimport { statsBuffer } from \"../../stats/buffer\"\nimport { delay } from \"../../utils/delay\"\nimport { isSVGElement } from \"../../utils/is-svg-element\"\nimport { isSVGSVGElement } from \"../../utils/is-svg-svg-element\"\nimport { mixNumber } from \"../../utils/mix/number\"\nimport { MotionValue, motionValue } from \"../../value\"\nimport { resolveMotionValue } from \"../../value/utils/resolve-motion-value\"\nimport { mixValues } from \"../animation/mix-values\"\nimport { copyAxisDeltaInto, copyAxisInto, copyBoxInto } from \"../geometry/copy\"\nimport {\n applyBoxDelta,\n applyTreeDeltas,\n transformBox,\n translateAxis,\n} from \"../geometry/delta-apply\"\nimport {\n calcBoxDelta,\n calcLength,\n calcRelativeBox,\n calcRelativePosition,\n isNear,\n} from \"../geometry/delta-calc\"\nimport { removeBoxTransforms } from \"../geometry/delta-remove\"\nimport { createBox, createDelta } from \"../geometry/models\"\nimport {\n aspectRatio,\n axisDeltaEquals,\n boxEquals,\n boxEqualsRounded,\n isDeltaZero,\n} from \"../geometry/utils\"\nimport { NodeStack } from \"../shared/stack\"\nimport { buildProjectionTransform } from \"../styles/transform\"\nimport { eachAxis } from \"../utils/each-axis\"\nimport { FlatTree } from \"../utils/flat-tree\"\nimport { has2DTranslate, hasScale, hasTransform } from \"../utils/has-transform\"\nimport { globalProjectionState } from \"./state\"\nimport {\n IProjectionNode,\n LayoutEvents,\n LayoutUpdateData,\n Measurements,\n Phase,\n ProjectionNodeConfig,\n ProjectionNodeOptions,\n ScrollMeasurements,\n} from \"./types\"\n\nconst metrics = {\n nodes: 0,\n calculatedTargetDeltas: 0,\n calculatedProjections: 0,\n}\n\nconst transformAxes = [\"\", \"X\", \"Y\", \"Z\"]\n\n/**\n * We use 1000 as the animation target as 0-1000 maps better to pixels than 0-1\n * which has a noticeable difference in spring animations\n */\nconst animationTarget = 1000\n\nlet id = 0\n\nfunction resetDistortingTransform(\n key: string,\n visualElement: VisualElement,\n values: ResolvedValues,\n sharedAnimationValues?: ResolvedValues\n) {\n const { latestValues } = visualElement\n\n // Record the distorting transform and then temporarily set it to 0\n if (latestValues[key]) {\n values[key] = latestValues[key]\n visualElement.setStaticValue(key, 0)\n if (sharedAnimationValues) {\n sharedAnimationValues[key] = 0\n }\n }\n}\n\nfunction cancelTreeOptimisedTransformAnimations(\n projectionNode: IProjectionNode\n) {\n projectionNode.hasCheckedOptimisedAppear = true\n if (projectionNode.root === projectionNode) return\n\n const { visualElement } = projectionNode.options\n\n if (!visualElement) return\n\n const appearId = getOptimisedAppearId(visualElement)\n\n if (window.MotionHasOptimisedAnimation!(appearId, \"transform\")) {\n const { layout, layoutId } = projectionNode.options\n window.MotionCancelOptimisedAnimation!(\n appearId,\n \"transform\",\n frame,\n !(layout || layoutId)\n )\n }\n\n const { parent } = projectionNode\n if (parent && !parent.hasCheckedOptimisedAppear) {\n cancelTreeOptimisedTransformAnimations(parent)\n }\n}\n\nexport function createProjectionNode({\n attachResizeListener,\n defaultParent,\n measureScroll,\n checkIsScrollRoot,\n resetTransform,\n}: ProjectionNodeConfig) {\n return class ProjectionNode implements IProjectionNode {\n /**\n * A unique ID generated for every projection node.\n */\n id: number = id++\n\n /**\n * An id that represents a unique session instigated by startUpdate.\n */\n animationId: number = 0\n\n animationCommitId = 0\n\n /**\n * A reference to the platform-native node (currently this will be a HTMLElement).\n */\n instance: I | undefined\n\n /**\n * A reference to the root projection node. There'll only ever be one tree and one root.\n */\n root: IProjectionNode\n\n /**\n * A reference to this node's parent.\n */\n parent?: IProjectionNode\n\n /**\n * A path from this node to the root node. This provides a fast way to iterate\n * back up the tree.\n */\n path: IProjectionNode[]\n\n /**\n * A Set containing all this component's children. This is used to iterate\n * through the children.\n *\n * TODO: This could be faster to iterate as a flat array stored on the root node.\n */\n children = new Set()\n\n /**\n * Options for the node. We use this to configure what kind of layout animations\n * we should perform (if any).\n */\n options: ProjectionNodeOptions = {}\n\n /**\n * A snapshot of the element's state just before the current update. This is\n * hydrated when this node's `willUpdate` method is called and scrubbed at the\n * end of the tree's `didUpdate` method.\n */\n snapshot: Measurements | undefined\n\n /**\n * A box defining the element's layout relative to the page. This will have been\n * captured with all parent scrolls and projection transforms unset.\n */\n layout: Measurements | undefined\n\n /**\n * The layout used to calculate the previous layout animation. We use this to compare\n * layouts between renders and decide whether we need to trigger a new layout animation\n * or just let the current one play out.\n */\n targetLayout?: Box\n\n /**\n * A mutable data structure we use to apply all parent transforms currently\n * acting on the element's layout. It's from here we can calculate the projectionDelta\n * required to get the element from its layout into its calculated target box.\n */\n layoutCorrected: Box\n\n /**\n * An ideal projection transform we want to apply to the element. This is calculated,\n * usually when an element's layout has changed, and we want the element to look as though\n * its in its previous layout on the next frame. From there, we animated it down to 0\n * to animate the element to its new layout.\n */\n targetDelta?: Delta\n\n /**\n * A mutable structure representing the visual bounding box on the page where we want\n * and element to appear. This can be set directly but is currently derived once a frame\n * from apply targetDelta to layout.\n */\n target?: Box\n\n /**\n * A mutable structure describing a visual bounding box relative to the element's\n * projected parent. If defined, target will be derived from this rather than targetDelta.\n * If not defined, we'll attempt to calculate on the first layout animation frame\n * based on the targets calculated from targetDelta. This will transfer a layout animation\n * from viewport-relative to parent-relative.\n */\n relativeTarget?: Box\n\n relativeTargetOrigin?: Box\n relativeParent?: IProjectionNode\n\n /**\n * We use this to detect when its safe to shut down part of a projection tree.\n * We have to keep projecting children for scale correction and relative projection\n * until all their parents stop performing layout animations.\n */\n isTreeAnimating = false\n\n isAnimationBlocked = false\n\n /**\n * If true, attempt to resolve relativeTarget.\n */\n attemptToResolveRelativeTarget?: boolean\n\n /**\n * A mutable structure that represents the target as transformed by the element's\n * latest user-set transforms (ie scale, x)\n */\n targetWithTransforms?: Box\n\n /**\n * The previous projection delta, which we can compare with the newly calculated\n * projection delta to see if we need to render.\n */\n prevProjectionDelta?: Delta\n\n /**\n * A calculated transform that will project an element from its layoutCorrected\n * into the target. This will be used by children to calculate their own layoutCorrect boxes.\n */\n projectionDelta?: Delta\n\n /**\n * A calculated transform that will project an element from its layoutCorrected\n * into the targetWithTransforms.\n */\n projectionDeltaWithTransform?: Delta\n\n /**\n * If we're tracking the scroll of this element, we store it here.\n */\n scroll?: ScrollMeasurements\n\n /**\n * Flag to true if we think this layout has been changed. We can't always know this,\n * currently we set it to true every time a component renders, or if it has a layoutDependency\n * if that has changed between renders. Additionally, components can be grouped by LayoutGroup\n * and if one node is dirtied, they all are.\n */\n isLayoutDirty = false\n\n /**\n * Flag to true if we think the projection calculations for this node needs\n * recalculating as a result of an updated transform or layout animation.\n */\n isProjectionDirty = false\n\n /**\n * Flag to true if the layout *or* transform has changed. This then gets propagated\n * throughout the projection tree, forcing any element below to recalculate on the next frame.\n */\n isSharedProjectionDirty = false\n\n /**\n * Flag transform dirty. This gets propagated throughout the whole tree but is only\n * respected by shared nodes.\n */\n isTransformDirty = false\n\n /**\n * Block layout updates for instant layout transitions throughout the tree.\n */\n updateManuallyBlocked = false\n\n updateBlockedByResize = false\n\n /**\n * Set to true between the start of the first `willUpdate` call and the end of the `didUpdate`\n * call.\n */\n isUpdating = false\n\n /**\n * If this is an SVG element we currently disable projection transforms\n */\n isSVG = false\n\n /**\n * Flag to true (during promotion) if a node doing an instant layout transition needs to reset\n * its projection styles.\n */\n needsReset = false\n\n /**\n * Flags whether this node should have its transform reset prior to measuring.\n */\n shouldResetTransform = false\n\n /**\n * Store whether this node has been checked for optimised appear animations. As\n * effects fire bottom-up, and we want to look up the tree for appear animations,\n * this makes sure we only check each path once, stopping at nodes that\n * have already been checked.\n */\n hasCheckedOptimisedAppear = false\n\n /**\n * An object representing the calculated contextual/accumulated/tree scale.\n * This will be used to scale calculcated projection transforms, as these are\n * calculated in screen-space but need to be scaled for elements to layoutly\n * make it to their calculated destinations.\n *\n * TODO: Lazy-init\n */\n treeScale: Point = { x: 1, y: 1 }\n\n /**\n * Is hydrated with a projection node if an element is animating from another.\n */\n resumeFrom?: IProjectionNode\n\n /**\n * Is hydrated with a projection node if an element is animating from another.\n */\n resumingFrom?: IProjectionNode\n\n /**\n * A reference to the element's latest animated values. This is a reference shared\n * between the element's VisualElement and the ProjectionNode.\n */\n latestValues: ResolvedValues\n\n /**\n *\n */\n eventHandlers = new Map>()\n\n nodes?: FlatTree\n\n depth: number\n\n /**\n * If transformTemplate generates a different value before/after the\n * update, we need to reset the transform.\n */\n prevTransformTemplateValue: string | undefined\n\n preserveOpacity?: boolean\n\n hasTreeAnimated = false\n\n layoutVersion: number = 0\n\n constructor(\n latestValues: ResolvedValues = {},\n parent: IProjectionNode | undefined = defaultParent?.()\n ) {\n this.latestValues = latestValues\n this.root = parent ? parent.root || parent : this\n this.path = parent ? [...parent.path, parent] : []\n this.parent = parent\n\n this.depth = parent ? parent.depth + 1 : 0\n\n for (let i = 0; i < this.path.length; i++) {\n this.path[i].shouldResetTransform = true\n }\n\n if (this.root === this) this.nodes = new FlatTree()\n }\n\n addEventListener(name: LayoutEvents, handler: any) {\n if (!this.eventHandlers.has(name)) {\n this.eventHandlers.set(name, new SubscriptionManager())\n }\n\n return this.eventHandlers.get(name)!.add(handler)\n }\n\n notifyListeners(name: LayoutEvents, ...args: any) {\n const subscriptionManager = this.eventHandlers.get(name)\n subscriptionManager && subscriptionManager.notify(...args)\n }\n\n hasListeners(name: LayoutEvents) {\n return this.eventHandlers.has(name)\n }\n\n /**\n * Lifecycles\n */\n mount(instance: I) {\n if (this.instance) return\n\n this.isSVG = isSVGElement(instance) && !isSVGSVGElement(instance)\n\n this.instance = instance\n\n const { layoutId, layout, visualElement } = this.options\n if (visualElement && !visualElement.current) {\n visualElement.mount(instance)\n }\n\n this.root.nodes!.add(this)\n this.parent && this.parent.children.add(this)\n\n if (this.root.hasTreeAnimated && (layout || layoutId)) {\n this.isLayoutDirty = true\n }\n\n if (attachResizeListener) {\n let cancelDelay: VoidFunction\n let innerWidth = 0\n\n const resizeUnblockUpdate = () =>\n (this.root.updateBlockedByResize = false)\n\n // Set initial innerWidth in a frame.read callback to batch the read\n frame.read(() => {\n innerWidth = window.innerWidth\n })\n\n attachResizeListener(instance, () => {\n const newInnerWidth = window.innerWidth\n if (newInnerWidth === innerWidth) return\n\n innerWidth = newInnerWidth\n\n this.root.updateBlockedByResize = true\n\n cancelDelay && cancelDelay()\n cancelDelay = delay(resizeUnblockUpdate, 250)\n\n if (globalProjectionState.hasAnimatedSinceResize) {\n globalProjectionState.hasAnimatedSinceResize = false\n this.nodes!.forEach(finishAnimation)\n }\n })\n }\n\n if (layoutId) {\n this.root.registerSharedNode(layoutId, this)\n }\n\n // Only register the handler if it requires layout animation\n if (\n this.options.animate !== false &&\n visualElement &&\n (layoutId || layout)\n ) {\n this.addEventListener(\n \"didUpdate\",\n ({\n delta,\n hasLayoutChanged,\n hasRelativeLayoutChanged,\n layout: newLayout,\n }: LayoutUpdateData) => {\n if (this.isTreeAnimationBlocked()) {\n this.target = undefined\n this.relativeTarget = undefined\n return\n }\n\n // TODO: Check here if an animation exists\n const layoutTransition =\n this.options.transition ||\n visualElement.getDefaultTransition() ||\n defaultLayoutTransition\n\n const {\n onLayoutAnimationStart,\n onLayoutAnimationComplete,\n } = visualElement.getProps()\n\n /**\n * The target layout of the element might stay the same,\n * but its position relative to its parent has changed.\n */\n const hasTargetChanged =\n !this.targetLayout ||\n !boxEqualsRounded(this.targetLayout, newLayout)\n /*\n * Note: Disabled to fix relative animations always triggering new\n * layout animations. If this causes further issues, we can try\n * a different approach to detecting relative target changes.\n */\n // || hasRelativeLayoutChanged\n\n /**\n * If the layout hasn't seemed to have changed, it might be that the\n * element is visually in the same place in the document but its position\n * relative to its parent has indeed changed. So here we check for that.\n */\n const hasOnlyRelativeTargetChanged =\n !hasLayoutChanged && hasRelativeLayoutChanged\n\n if (\n this.options.layoutRoot ||\n this.resumeFrom ||\n hasOnlyRelativeTargetChanged ||\n (hasLayoutChanged &&\n (hasTargetChanged || !this.currentAnimation))\n ) {\n if (this.resumeFrom) {\n this.resumingFrom = this.resumeFrom\n this.resumingFrom.resumingFrom = undefined\n }\n\n const animationOptions = {\n ...getValueTransition(\n layoutTransition,\n \"layout\"\n ),\n onPlay: onLayoutAnimationStart,\n onComplete: onLayoutAnimationComplete,\n }\n\n if (\n visualElement.shouldReduceMotion ||\n this.options.layoutRoot\n ) {\n animationOptions.delay = 0\n animationOptions.type = false\n }\n\n this.startAnimation(animationOptions)\n /**\n * Set animation origin after starting animation to avoid layout jump\n * caused by stopping previous layout animation\n */\n this.setAnimationOrigin(\n delta,\n hasOnlyRelativeTargetChanged,\n (animationOptions as { path?: MotionPath })\n .path\n )\n } else {\n /**\n * If the layout hasn't changed and we have an animation that hasn't started yet,\n * finish it immediately. Otherwise it will be animating from a location\n * that was probably never committed to screen and look like a jumpy box.\n */\n\n if (!hasLayoutChanged) {\n finishAnimation(this)\n }\n\n if (this.isLead() && this.options.onExitComplete) {\n this.options.onExitComplete()\n }\n }\n\n this.targetLayout = newLayout\n }\n )\n }\n }\n\n unmount() {\n this.options.layoutId && this.willUpdate()\n this.root.nodes!.remove(this)\n const stack = this.getStack()\n stack && stack.remove(this)\n this.parent && this.parent.children.delete(this)\n this.instance = undefined\n this.eventHandlers.clear()\n\n cancelFrame(this.updateProjection)\n }\n\n // only on the root\n blockUpdate() {\n this.updateManuallyBlocked = true\n }\n\n unblockUpdate() {\n this.updateManuallyBlocked = false\n }\n\n isUpdateBlocked() {\n return this.updateManuallyBlocked || this.updateBlockedByResize\n }\n\n isTreeAnimationBlocked() {\n return (\n this.isAnimationBlocked ||\n (this.parent && this.parent.isTreeAnimationBlocked()) ||\n false\n )\n }\n\n // Note: currently only running on root node\n startUpdate() {\n if (this.isUpdateBlocked()) return\n\n this.isUpdating = true\n\n this.nodes && this.nodes.forEach(resetSkewAndRotation)\n this.animationId++\n }\n\n getTransformTemplate() {\n const { visualElement } = this.options\n return visualElement && visualElement.getProps().transformTemplate\n }\n\n willUpdate(shouldNotifyListeners = true) {\n this.root.hasTreeAnimated = true\n\n if (this.root.isUpdateBlocked()) {\n this.options.onExitComplete && this.options.onExitComplete()\n return\n }\n\n /**\n * If we're running optimised appear animations then these must be\n * cancelled before measuring the DOM. This is so we can measure\n * the true layout of the element rather than the WAAPI animation\n * which will be unaffected by the resetSkewAndRotate step.\n *\n * Note: This is a DOM write. Worst case scenario is this is sandwiched\n * between other snapshot reads which will cause unnecessary style recalculations.\n * This has to happen here though, as we don't yet know which nodes will need\n * snapshots in startUpdate(), but we only want to cancel optimised animations\n * if a layout animation measurement is actually going to be affected by them.\n */\n if (\n window.MotionCancelOptimisedAnimation &&\n !this.hasCheckedOptimisedAppear\n ) {\n cancelTreeOptimisedTransformAnimations(this)\n }\n\n !this.root.isUpdating && this.root.startUpdate()\n\n if (this.isLayoutDirty) return\n\n this.isLayoutDirty = true\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i]\n node.shouldResetTransform = true\n\n /**\n * Percentage translates resolve against layoutBox dimensions,\n * so ancestors with them must be re-measured after transform reset.\n */\n if (\n typeof node.latestValues.x === \"string\" ||\n typeof node.latestValues.y === \"string\"\n ) {\n node.isLayoutDirty = true\n }\n\n node.updateScroll(\"snapshot\")\n\n if (node.options.layoutRoot) {\n node.willUpdate(false)\n }\n }\n\n const { layoutId, layout } = this.options\n if (layoutId === undefined && !layout) return\n\n const transformTemplate = this.getTransformTemplate()\n this.prevTransformTemplateValue = transformTemplate\n ? transformTemplate(this.latestValues, \"\")\n : undefined\n\n this.updateSnapshot()\n shouldNotifyListeners && this.notifyListeners(\"willUpdate\")\n }\n\n // Note: Currently only running on root node\n updateScheduled = false\n\n update() {\n this.updateScheduled = false\n\n const updateWasBlocked = this.isUpdateBlocked()\n\n // When doing an instant transition, we skip the layout update,\n // but should still clean up the measurements so that the next\n // snapshot could be taken correctly.\n if (updateWasBlocked) {\n const wasBlockedByResize = this.updateBlockedByResize\n\n this.unblockUpdate()\n this.updateBlockedByResize = false\n this.clearAllSnapshots()\n\n /**\n * When blocked by resize, still measure layouts so\n * callbacks like onLayoutMeasure fire (e.g. Reorder).\n * Skip notifyLayoutUpdate to prevent animations.\n */\n if (wasBlockedByResize) {\n this.nodes!.forEach(forceLayoutMeasure)\n }\n\n this.nodes!.forEach(clearMeasurements)\n return\n }\n\n /**\n * If this is a repeat of didUpdate then ignore the animation.\n */\n if (this.animationId <= this.animationCommitId) {\n this.nodes!.forEach(clearIsLayoutDirty)\n return\n }\n\n this.animationCommitId = this.animationId\n\n if (!this.isUpdating) {\n this.nodes!.forEach(clearIsLayoutDirty)\n } else {\n this.isUpdating = false\n\n /**\n * Ensure animation-blocked nodes (e.g. during drag)\n * get measured even when memoized (willUpdate skipped).\n */\n this.nodes!.forEach(ensureDraggedNodesSnapshotted)\n\n /**\n * Write\n */\n this.nodes!.forEach(resetTransformStyle)\n\n /**\n * Read ==================\n */\n // Update layout measurements of updated children\n this.nodes!.forEach(updateLayout)\n\n /**\n * Write\n */\n // Notify listeners that the layout is updated\n this.nodes!.forEach(notifyLayoutUpdate)\n }\n\n this.clearAllSnapshots()\n\n /**\n * Manually flush any pending updates. Ideally\n * we could leave this to the following requestAnimationFrame but this seems\n * to leave a flash of incorrectly styled content.\n */\n const now = time.now()\n frameData.delta = clamp(0, 1000 / 60, now - frameData.timestamp)\n frameData.timestamp = now\n frameData.isProcessing = true\n frameSteps.update.process(frameData)\n frameSteps.preRender.process(frameData)\n frameSteps.render.process(frameData)\n frameData.isProcessing = false\n }\n\n scheduleUpdate = () => this.update()\n\n didUpdate() {\n if (!this.updateScheduled) {\n this.updateScheduled = true\n microtask.read(this.scheduleUpdate)\n }\n }\n\n clearAllSnapshots() {\n this.nodes!.forEach(clearSnapshot)\n this.sharedNodes.forEach(removeLeadSnapshots)\n }\n\n projectionUpdateScheduled = false\n scheduleUpdateProjection() {\n if (!this.projectionUpdateScheduled) {\n this.projectionUpdateScheduled = true\n frame.preRender(this.updateProjection, false, true)\n }\n }\n\n scheduleCheckAfterUnmount() {\n /**\n * If the unmounting node is in a layoutGroup and did trigger a willUpdate,\n * we manually call didUpdate to give a chance to the siblings to animate.\n * Otherwise, cleanup all snapshots to prevents future nodes from reusing them.\n */\n frame.postRender(() => {\n if (this.isLayoutDirty) {\n this.root.didUpdate()\n } else {\n this.root.checkUpdateFailed()\n }\n })\n }\n\n checkUpdateFailed = () => {\n if (this.isUpdating) {\n this.isUpdating = false\n this.clearAllSnapshots()\n }\n }\n\n /**\n * This is a multi-step process as shared nodes might be of different depths. Nodes\n * are sorted by depth order, so we need to resolve the entire tree before moving to\n * the next step.\n */\n updateProjection = () => {\n this.projectionUpdateScheduled = false\n\n /**\n * Reset debug counts. Manually resetting rather than creating a new\n * object each frame.\n */\n if (statsBuffer.value) {\n metrics.nodes =\n metrics.calculatedTargetDeltas =\n metrics.calculatedProjections =\n 0\n }\n\n this.nodes!.forEach(propagateDirtyNodes)\n this.nodes!.forEach(resolveTargetDelta)\n this.nodes!.forEach(calcProjection)\n this.nodes!.forEach(cleanDirtyNodes)\n\n if (statsBuffer.addProjectionMetrics) {\n statsBuffer.addProjectionMetrics(metrics)\n }\n }\n\n /**\n * Update measurements\n */\n updateSnapshot() {\n if (this.snapshot || !this.instance) return\n\n this.snapshot = this.measure()\n\n if (\n this.snapshot &&\n !calcLength(this.snapshot.measuredBox.x) &&\n !calcLength(this.snapshot.measuredBox.y)\n ) {\n this.snapshot = undefined\n }\n }\n\n updateLayout() {\n if (!this.instance) return\n\n this.updateScroll()\n\n if (\n !(this.options.alwaysMeasureLayout && this.isLead()) &&\n !this.isLayoutDirty\n ) {\n return\n }\n\n /**\n * When a node is mounted, it simply resumes from the prevLead's\n * snapshot instead of taking a new one, but the ancestors scroll\n * might have updated while the prevLead is unmounted. We need to\n * update the scroll again to make sure the layout we measure is\n * up to date.\n */\n if (this.resumeFrom && !this.resumeFrom.instance) {\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i]\n node.updateScroll()\n }\n }\n\n const prevLayout = this.layout\n this.layout = this.measure(false)\n this.layoutVersion++\n if (!this.layoutCorrected) this.layoutCorrected = createBox()\n this.isLayoutDirty = false\n this.projectionDelta = undefined\n this.notifyListeners(\"measure\", this.layout.layoutBox)\n\n const { visualElement } = this.options\n visualElement &&\n visualElement.notify(\n \"LayoutMeasure\",\n this.layout.layoutBox,\n prevLayout ? prevLayout.layoutBox : undefined\n )\n }\n\n updateScroll(phase: Phase = \"measure\") {\n let needsMeasurement = Boolean(\n this.options.layoutScroll && this.instance\n )\n\n if (\n this.scroll &&\n this.scroll.animationId === this.root.animationId &&\n this.scroll.phase === phase\n ) {\n needsMeasurement = false\n }\n\n if (needsMeasurement && this.instance) {\n const isRoot = checkIsScrollRoot(this.instance)\n this.scroll = {\n animationId: this.root.animationId,\n phase,\n isRoot,\n offset: measureScroll(this.instance),\n wasRoot: this.scroll ? this.scroll.isRoot : isRoot,\n }\n }\n }\n\n resetTransform() {\n if (!resetTransform) return\n\n const isResetRequested =\n this.isLayoutDirty ||\n this.shouldResetTransform ||\n this.options.alwaysMeasureLayout\n\n const hasProjection =\n this.projectionDelta && !isDeltaZero(this.projectionDelta)\n\n const transformTemplate = this.getTransformTemplate()\n const transformTemplateValue = transformTemplate\n ? transformTemplate(this.latestValues, \"\")\n : undefined\n\n const transformTemplateHasChanged =\n transformTemplateValue !== this.prevTransformTemplateValue\n\n if (\n isResetRequested &&\n this.instance &&\n (hasProjection ||\n hasTransform(this.latestValues) ||\n transformTemplateHasChanged)\n ) {\n resetTransform(this.instance, transformTemplateValue)\n this.shouldResetTransform = false\n this.scheduleRender()\n }\n }\n\n measure(removeTransform = true) {\n const pageBox = this.measurePageBox()\n\n let layoutBox = this.removeElementScroll(pageBox)\n\n /**\n * Measurements taken during the pre-render stage\n * still have transforms applied so we remove them\n * via calculation.\n */\n if (removeTransform) {\n layoutBox = this.removeTransform(layoutBox)\n }\n\n roundBox(layoutBox)\n\n return {\n animationId: this.root.animationId,\n measuredBox: pageBox,\n layoutBox,\n latestValues: {},\n source: this.id,\n }\n }\n\n measurePageBox() {\n const { visualElement } = this.options\n if (!visualElement) return createBox()\n\n const box = visualElement.measureViewportBox()\n\n const wasInScrollRoot =\n this.scroll?.wasRoot || this.path.some(checkNodeWasScrollRoot)\n\n if (!wasInScrollRoot) {\n // Remove viewport scroll to give page-relative coordinates\n const { scroll } = this.root\n if (scroll) {\n translateAxis(box.x, scroll.offset.x)\n translateAxis(box.y, scroll.offset.y)\n }\n }\n\n return box\n }\n\n removeElementScroll(box: Box): Box {\n const boxWithoutScroll = createBox()\n copyBoxInto(boxWithoutScroll, box)\n\n if (this.scroll?.wasRoot) {\n return boxWithoutScroll\n }\n\n /**\n * Performance TODO: Keep a cumulative scroll offset down the tree\n * rather than loop back up the path.\n */\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i]\n const { scroll, options } = node\n\n if (node !== this.root && scroll && options.layoutScroll) {\n /**\n * If this is a new scroll root, we want to remove all previous scrolls\n * from the viewport box.\n */\n if (scroll.wasRoot) {\n copyBoxInto(boxWithoutScroll, box)\n }\n\n translateAxis(boxWithoutScroll.x, scroll.offset.x)\n translateAxis(boxWithoutScroll.y, scroll.offset.y)\n }\n }\n\n return boxWithoutScroll\n }\n\n applyTransform(box: Box, transformOnly = false, output?: Box): Box {\n const withTransforms = output || createBox()\n copyBoxInto(withTransforms, box)\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i]\n\n if (\n !transformOnly &&\n node.options.layoutScroll &&\n node.scroll &&\n node !== node.root\n ) {\n translateAxis(withTransforms.x, -node.scroll.offset.x)\n translateAxis(withTransforms.y, -node.scroll.offset.y)\n }\n\n if (!hasTransform(node.latestValues)) continue\n transformBox(\n withTransforms,\n node.latestValues,\n node.layout?.layoutBox\n )\n }\n\n if (hasTransform(this.latestValues)) {\n transformBox(\n withTransforms,\n this.latestValues,\n this.layout?.layoutBox\n )\n }\n\n return withTransforms\n }\n\n removeTransform(box: Box): Box {\n const boxWithoutTransform = createBox()\n copyBoxInto(boxWithoutTransform, box)\n\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i]\n if (!hasTransform(node.latestValues)) continue\n\n let sourceBox: Box | undefined\n\n if (node.instance) {\n hasScale(node.latestValues) && node.updateSnapshot()\n sourceBox = createBox()\n copyBoxInto(sourceBox, node.measurePageBox())\n }\n\n removeBoxTransforms(\n boxWithoutTransform,\n node.latestValues,\n node.snapshot?.layoutBox,\n sourceBox\n )\n }\n\n if (hasTransform(this.latestValues)) {\n removeBoxTransforms(boxWithoutTransform, this.latestValues)\n }\n\n return boxWithoutTransform\n }\n\n setTargetDelta(delta: Delta) {\n this.targetDelta = delta\n this.root.scheduleUpdateProjection()\n this.isProjectionDirty = true\n }\n\n setOptions(options: ProjectionNodeOptions) {\n this.options = {\n ...this.options,\n ...options,\n crossfade:\n options.crossfade !== undefined ? options.crossfade : true,\n }\n }\n\n clearMeasurements() {\n this.scroll = undefined\n this.layout = undefined\n this.snapshot = undefined\n this.prevTransformTemplateValue = undefined\n this.targetDelta = undefined\n this.target = undefined\n this.isLayoutDirty = false\n }\n\n forceRelativeParentToResolveTarget() {\n if (!this.relativeParent) return\n\n /**\n * If the parent target isn't up-to-date, force it to update.\n * This is an unfortunate de-optimisation as it means any updating relative\n * projection will cause all the relative parents to recalculate back\n * up the tree.\n */\n if (\n this.relativeParent.resolvedRelativeTargetAt !==\n frameData.timestamp\n ) {\n this.relativeParent.resolveTargetDelta(true)\n }\n }\n\n /**\n * Frame calculations\n */\n resolvedRelativeTargetAt: number = 0.0\n resolveTargetDelta(forceRecalculation = false) {\n /**\n * Once the dirty status of nodes has been spread through the tree, we also\n * need to check if we have a shared node of a different depth that has itself\n * been dirtied.\n */\n const lead = this.getLead()\n this.isProjectionDirty ||= lead.isProjectionDirty\n this.isTransformDirty ||= lead.isTransformDirty\n this.isSharedProjectionDirty ||= lead.isSharedProjectionDirty\n\n const isShared = Boolean(this.resumingFrom) || this !== lead\n\n /**\n * We don't use transform for this step of processing so we don't\n * need to check whether any nodes have changed transform.\n */\n const canSkip = !(\n forceRecalculation ||\n (isShared && this.isSharedProjectionDirty) ||\n this.isProjectionDirty ||\n this.parent?.isProjectionDirty ||\n this.attemptToResolveRelativeTarget ||\n this.root.updateBlockedByResize\n )\n\n if (canSkip) return\n\n const { layout, layoutId } = this.options\n\n /**\n * If we have no layout, we can't perform projection, so early return\n */\n if (!this.layout || !(layout || layoutId)) return\n\n this.resolvedRelativeTargetAt = frameData.timestamp\n\n const relativeParent = this.getClosestProjectingParent()\n\n if (\n relativeParent &&\n this.linkedParentVersion !== relativeParent.layoutVersion &&\n !relativeParent.options.layoutRoot\n ) {\n this.removeRelativeTarget()\n }\n\n /**\n * If we don't have a targetDelta but do have a layout, we can attempt to resolve\n * a relativeParent. This will allow a component to perform scale correction\n * even if no animation has started.\n */\n if (!this.targetDelta && !this.relativeTarget) {\n if (\n this.options.layoutAnchor !== false &&\n relativeParent &&\n relativeParent.layout\n ) {\n this.createRelativeTarget(\n relativeParent,\n this.layout.layoutBox,\n relativeParent.layout.layoutBox\n )\n } else {\n this.removeRelativeTarget()\n }\n }\n\n /**\n * If we have no relative target or no target delta our target isn't valid\n * for this frame.\n */\n if (!this.relativeTarget && !this.targetDelta) return\n\n /**\n * Lazy-init target data structure\n */\n if (!this.target) {\n this.target = createBox()\n this.targetWithTransforms = createBox()\n }\n\n /**\n * If we've got a relative box for this component, resolve it into a target relative to the parent.\n */\n if (\n this.relativeTarget &&\n this.relativeTargetOrigin &&\n this.relativeParent &&\n this.relativeParent.target\n ) {\n this.forceRelativeParentToResolveTarget()\n\n calcRelativeBox(\n this.target,\n this.relativeTarget,\n this.relativeParent.target,\n this.options.layoutAnchor || undefined\n )\n\n /**\n * If we've only got a targetDelta, resolve it into a target\n */\n } else if (this.targetDelta) {\n if (Boolean(this.resumingFrom)) {\n this.applyTransform(\n this.layout.layoutBox,\n false,\n this.target\n )\n } else {\n copyBoxInto(this.target, this.layout.layoutBox)\n }\n\n applyBoxDelta(this.target, this.targetDelta)\n } else {\n /**\n * If no target, use own layout as target\n */\n copyBoxInto(this.target, this.layout.layoutBox)\n }\n\n /**\n * If we've been told to attempt to resolve a relative target, do so.\n */\n if (this.attemptToResolveRelativeTarget) {\n this.attemptToResolveRelativeTarget = false\n\n if (\n this.options.layoutAnchor !== false &&\n relativeParent &&\n Boolean(relativeParent.resumingFrom) ===\n Boolean(this.resumingFrom) &&\n !relativeParent.options.layoutScroll &&\n relativeParent.target &&\n this.animationProgress !== 1\n ) {\n this.createRelativeTarget(\n relativeParent,\n this.target,\n relativeParent.target\n )\n } else {\n this.relativeParent = this.relativeTarget = undefined\n }\n }\n\n /**\n * Increase debug counter for resolved target deltas\n */\n if (statsBuffer.value) {\n metrics.calculatedTargetDeltas++\n }\n }\n\n getClosestProjectingParent() {\n if (\n !this.parent ||\n hasScale(this.parent.latestValues) ||\n has2DTranslate(this.parent.latestValues)\n ) {\n return undefined\n }\n\n if (this.parent.isProjecting()) {\n return this.parent\n } else {\n return this.parent.getClosestProjectingParent()\n }\n }\n\n isProjecting() {\n return Boolean(\n (this.relativeTarget ||\n this.targetDelta ||\n this.options.layoutRoot) &&\n this.layout\n )\n }\n\n linkedParentVersion: number = 0\n createRelativeTarget(\n relativeParent: IProjectionNode,\n layout: Box,\n parentLayout: Box\n ) {\n this.relativeParent = relativeParent\n this.linkedParentVersion = relativeParent.layoutVersion\n this.forceRelativeParentToResolveTarget()\n this.relativeTarget = createBox()\n this.relativeTargetOrigin = createBox()\n calcRelativePosition(\n this.relativeTargetOrigin,\n layout,\n parentLayout,\n this.options.layoutAnchor || undefined\n )\n\n copyBoxInto(this.relativeTarget, this.relativeTargetOrigin)\n }\n\n removeRelativeTarget() {\n this.relativeParent = this.relativeTarget = undefined\n }\n\n hasProjected: boolean = false\n\n calcProjection() {\n const lead = this.getLead()\n const isShared = Boolean(this.resumingFrom) || this !== lead\n\n let canSkip = true\n\n /**\n * If this is a normal layout animation and neither this node nor its nearest projecting\n * is dirty then we can't skip.\n */\n if (this.isProjectionDirty || this.parent?.isProjectionDirty) {\n canSkip = false\n }\n\n /**\n * If this is a shared layout animation and this node's shared projection is dirty then\n * we can't skip.\n */\n if (\n isShared &&\n (this.isSharedProjectionDirty || this.isTransformDirty)\n ) {\n canSkip = false\n }\n\n /**\n * If we have resolved the target this frame we must recalculate the\n * projection to ensure it visually represents the internal calculations.\n */\n if (this.resolvedRelativeTargetAt === frameData.timestamp) {\n canSkip = false\n }\n\n if (canSkip) return\n\n const { layout, layoutId } = this.options\n\n /**\n * If this section of the tree isn't animating we can\n * delete our target sources for the following frame.\n */\n this.isTreeAnimating = Boolean(\n (this.parent && this.parent.isTreeAnimating) ||\n this.currentAnimation ||\n this.pendingAnimation\n )\n if (!this.isTreeAnimating) {\n this.targetDelta = this.relativeTarget = undefined\n }\n\n if (!this.layout || !(layout || layoutId)) return\n\n /**\n * Reset the corrected box with the latest values from box, as we're then going\n * to perform mutative operations on it.\n */\n copyBoxInto(this.layoutCorrected, this.layout.layoutBox)\n\n /**\n * Record previous tree scales before updating.\n */\n const prevTreeScaleX = this.treeScale.x\n const prevTreeScaleY = this.treeScale.y\n /**\n * Apply all the parent deltas to this box to produce the corrected box. This\n * is the layout box, as it will appear on screen as a result of the transforms of its parents.\n */\n applyTreeDeltas(\n this.layoutCorrected,\n this.treeScale,\n this.path,\n isShared\n )\n\n /**\n * If this layer needs to perform scale correction but doesn't have a target,\n * use the layout as the target.\n */\n if (\n lead.layout &&\n !lead.target &&\n (this.treeScale.x !== 1 || this.treeScale.y !== 1)\n ) {\n lead.target = lead.layout.layoutBox\n lead.targetWithTransforms = createBox()\n }\n\n const { target } = lead\n\n if (!target) {\n /**\n * If we don't have a target to project into, but we were previously\n * projecting, we want to remove the stored transform and schedule\n * a render to ensure the elements reflect the removed transform.\n */\n if (this.prevProjectionDelta) {\n this.createProjectionDeltas()\n this.scheduleRender()\n }\n\n return\n }\n\n if (!this.projectionDelta || !this.prevProjectionDelta) {\n this.createProjectionDeltas()\n } else {\n copyAxisDeltaInto(\n this.prevProjectionDelta.x,\n this.projectionDelta.x\n )\n copyAxisDeltaInto(\n this.prevProjectionDelta.y,\n this.projectionDelta.y\n )\n }\n\n /**\n * Update the delta between the corrected box and the target box before user-set transforms were applied.\n * This will allow us to calculate the corrected borderRadius and boxShadow to compensate\n * for our layout reprojection, but still allow them to be scaled correctly by the user.\n * It might be that to simplify this we may want to accept that user-set scale is also corrected\n * and we wouldn't have to keep and calc both deltas, OR we could support a user setting\n * to allow people to choose whether these styles are corrected based on just the\n * layout reprojection or the final bounding box.\n */\n calcBoxDelta(\n this.projectionDelta!,\n this.layoutCorrected,\n target,\n this.latestValues\n )\n\n if (\n this.treeScale.x !== prevTreeScaleX ||\n this.treeScale.y !== prevTreeScaleY ||\n !axisDeltaEquals(\n this.projectionDelta!.x,\n this.prevProjectionDelta!.x\n ) ||\n !axisDeltaEquals(\n this.projectionDelta!.y,\n this.prevProjectionDelta!.y\n )\n ) {\n this.hasProjected = true\n this.scheduleRender()\n this.notifyListeners(\"projectionUpdate\", target)\n }\n\n /**\n * Increase debug counter for recalculated projections\n */\n if (statsBuffer.value) {\n metrics.calculatedProjections++\n }\n }\n\n isVisible = true\n hide() {\n this.isVisible = false\n // TODO: Schedule render\n }\n show() {\n this.isVisible = true\n // TODO: Schedule render\n }\n\n scheduleRender(notifyAll = true) {\n this.options.visualElement?.scheduleRender()\n if (notifyAll) {\n const stack = this.getStack()\n stack && stack.scheduleRender()\n }\n if (this.resumingFrom && !this.resumingFrom.instance) {\n this.resumingFrom = undefined\n }\n }\n\n createProjectionDeltas() {\n this.prevProjectionDelta = createDelta()\n this.projectionDelta = createDelta()\n this.projectionDeltaWithTransform = createDelta()\n }\n\n /**\n * Animation\n */\n animationValues?: ResolvedValues\n pendingAnimation?: Process\n currentAnimation?: JSAnimation\n mixTargetDelta: (progress: number) => void\n animationProgress = 0\n\n setAnimationOrigin(\n delta: Delta,\n hasOnlyRelativeTargetChanged: boolean = false,\n pathFn?: MotionPath\n ) {\n const snapshot = this.snapshot\n const snapshotLatestValues = snapshot ? snapshot.latestValues : {}\n const mixedValues = { ...this.latestValues }\n\n const targetDelta = createDelta()\n if (\n !this.relativeParent ||\n !this.relativeParent.options.layoutRoot\n ) {\n this.relativeTarget = this.relativeTargetOrigin = undefined\n }\n this.attemptToResolveRelativeTarget = !hasOnlyRelativeTargetChanged\n\n const relativeLayout = createBox()\n\n const snapshotSource = snapshot ? snapshot.source : undefined\n const layoutSource = this.layout ? this.layout.source : undefined\n const isSharedLayoutAnimation = snapshotSource !== layoutSource\n const stack = this.getStack()\n const isOnlyMember = !stack || stack.members.length <= 1\n const shouldCrossfadeOpacity = Boolean(\n isSharedLayoutAnimation &&\n !isOnlyMember &&\n this.options.crossfade === true &&\n !this.path.some(hasOpacityCrossfade)\n )\n\n this.animationProgress = 0\n\n let prevRelativeTarget: Box\n\n // The path decides whether the layout shift is worth curving\n // (distance floor) and resolves the interpolator from the delta.\n const interpolate: PathInterpolator | undefined =\n pathFn?.interpolateProjection(delta)\n\n this.mixTargetDelta = (latest: number) => {\n const progress = latest / 1000\n const point = interpolate?.(progress)\n\n if (point) {\n targetDelta.x.translate = point.x\n targetDelta.x.scale = mixNumber(delta.x.scale, 1, progress)\n targetDelta.x.origin = delta.x.origin\n targetDelta.x.originPoint = delta.x.originPoint\n targetDelta.y.translate = point.y\n targetDelta.y.scale = mixNumber(delta.y.scale, 1, progress)\n targetDelta.y.origin = delta.y.origin\n targetDelta.y.originPoint = delta.y.originPoint\n } else {\n mixAxisDeltaLinear(targetDelta.x, delta.x, progress)\n mixAxisDeltaLinear(targetDelta.y, delta.y, progress)\n }\n\n this.setTargetDelta(targetDelta)\n\n if (\n this.relativeTarget &&\n this.relativeTargetOrigin &&\n this.layout &&\n this.relativeParent &&\n this.relativeParent.layout\n ) {\n calcRelativePosition(\n relativeLayout,\n this.layout.layoutBox,\n this.relativeParent.layout.layoutBox,\n this.options.layoutAnchor || undefined\n )\n mixBox(\n this.relativeTarget,\n this.relativeTargetOrigin,\n relativeLayout,\n progress\n )\n\n /**\n * If this is an unchanged relative target we can consider the\n * projection not dirty.\n */\n if (\n prevRelativeTarget &&\n boxEquals(this.relativeTarget, prevRelativeTarget)\n ) {\n this.isProjectionDirty = false\n }\n\n if (!prevRelativeTarget) prevRelativeTarget = createBox()\n copyBoxInto(prevRelativeTarget, this.relativeTarget)\n }\n\n if (isSharedLayoutAnimation) {\n this.animationValues = mixedValues\n\n mixValues(\n mixedValues,\n snapshotLatestValues,\n this.latestValues,\n progress,\n shouldCrossfadeOpacity,\n isOnlyMember\n )\n }\n\n if (point && point.rotate !== undefined) {\n // Dedicated `pathRotation` channel, not `rotate`, so an\n // animating `rotate` is composed with, never clobbered.\n if (!this.animationValues)\n this.animationValues = mixedValues\n this.animationValues.pathRotation = point.rotate\n }\n\n this.root.scheduleUpdateProjection()\n this.scheduleRender()\n\n this.animationProgress = progress\n }\n\n this.mixTargetDelta(this.options.layoutRoot ? 1000 : 0)\n }\n\n motionValue?: MotionValue\n startAnimation(options: ValueAnimationOptions) {\n this.notifyListeners(\"animationStart\")\n\n this.currentAnimation?.stop()\n this.resumingFrom?.currentAnimation?.stop()\n\n if (this.pendingAnimation) {\n cancelFrame(this.pendingAnimation)\n this.pendingAnimation = undefined\n }\n\n /**\n * Start the animation in the next frame to have a frame with progress 0,\n * where the target is the same as when the animation started, so we can\n * calculate the relative positions correctly for instant transitions.\n */\n this.pendingAnimation = frame.update(() => {\n globalProjectionState.hasAnimatedSinceResize = true\n\n this.motionValue ||= motionValue(0)\n this.motionValue.jump(0, false)\n\n this.currentAnimation = animateSingleValue(\n this.motionValue,\n [0, 1000],\n {\n ...(options as any),\n velocity: 0,\n isSync: true,\n onUpdate: (latest: number) => {\n this.mixTargetDelta(latest)\n options.onUpdate && options.onUpdate(latest)\n },\n onComplete: () => {\n options.onComplete && options.onComplete()\n this.completeAnimation()\n },\n }\n ) as JSAnimation\n\n if (this.resumingFrom) {\n this.resumingFrom.currentAnimation = this.currentAnimation\n }\n\n this.pendingAnimation = undefined\n })\n }\n\n completeAnimation() {\n if (this.resumingFrom) {\n this.resumingFrom.currentAnimation = undefined\n this.resumingFrom.preserveOpacity = undefined\n }\n\n const stack = this.getStack()\n stack && stack.exitAnimationComplete()\n this.resumingFrom =\n this.currentAnimation =\n this.animationValues =\n undefined\n\n this.notifyListeners(\"animationComplete\")\n }\n\n finishAnimation() {\n if (this.currentAnimation) {\n this.mixTargetDelta && this.mixTargetDelta(animationTarget)\n this.currentAnimation.stop()\n }\n\n this.completeAnimation()\n }\n\n applyTransformsToTarget() {\n const lead = this.getLead()\n let { targetWithTransforms, target, layout, latestValues } = lead\n\n if (!targetWithTransforms || !target || !layout) return\n\n /**\n * If we're only animating position, and this element isn't the lead element,\n * then instead of projecting into the lead box we instead want to calculate\n * a new target that aligns the two boxes but maintains the layout shape.\n */\n if (\n this !== lead &&\n this.layout &&\n layout &&\n shouldAnimatePositionOnly(\n this.options.animationType,\n this.layout.layoutBox,\n layout.layoutBox\n )\n ) {\n target = this.target || createBox()\n\n const xLength = calcLength(this.layout!.layoutBox.x)\n target!.x.min = lead.target!.x.min\n target!.x.max = target.x.min + xLength\n\n const yLength = calcLength(this.layout!.layoutBox.y)\n target!.y.min = lead.target!.y.min\n target!.y.max = target.y.min + yLength\n }\n\n copyBoxInto(targetWithTransforms, target)\n\n /**\n * Apply the latest user-set transforms to the targetBox to produce the targetBoxFinal.\n * This is the final box that we will then project into by calculating a transform delta and\n * applying it to the corrected box.\n */\n transformBox(targetWithTransforms, latestValues)\n\n /**\n * Update the delta between the corrected box and the final target box, after\n * user-set transforms are applied to it. This will be used by the renderer to\n * create a transform style that will reproject the element from its layout layout\n * into the desired bounding box.\n */\n calcBoxDelta(\n this.projectionDeltaWithTransform!,\n this.layoutCorrected,\n targetWithTransforms!,\n latestValues\n )\n }\n\n /**\n * Shared layout\n */\n // TODO Only running on root node\n sharedNodes: Map = new Map()\n registerSharedNode(layoutId: string, node: IProjectionNode) {\n if (!this.sharedNodes.has(layoutId)) {\n this.sharedNodes.set(layoutId, new NodeStack())\n }\n\n const stack = this.sharedNodes.get(layoutId)!\n stack.add(node)\n\n const config = node.options.initialPromotionConfig\n node.promote({\n transition: config ? config.transition : undefined,\n preserveFollowOpacity:\n config && config.shouldPreserveFollowOpacity\n ? config.shouldPreserveFollowOpacity(node)\n : undefined,\n })\n }\n\n isLead(): boolean {\n const stack = this.getStack()\n return stack ? stack.lead === this : true\n }\n\n getLead() {\n const { layoutId } = this.options\n return layoutId ? this.getStack()?.lead || this : this\n }\n\n getPrevLead() {\n const { layoutId } = this.options\n return layoutId ? this.getStack()?.prevLead : undefined\n }\n\n getStack() {\n const { layoutId } = this.options\n if (layoutId) return this.root.sharedNodes.get(layoutId)\n }\n\n promote({\n needsReset,\n transition,\n preserveFollowOpacity,\n }: {\n needsReset?: boolean\n transition?: Transition\n preserveFollowOpacity?: boolean\n } = {}) {\n const stack = this.getStack()\n if (stack) stack.promote(this, preserveFollowOpacity)\n\n if (needsReset) {\n this.projectionDelta = undefined\n this.needsReset = true\n }\n if (transition) this.setOptions({ transition })\n }\n\n relegate(): boolean {\n const stack = this.getStack()\n if (stack) {\n return stack.relegate(this)\n } else {\n return false\n }\n }\n\n resetSkewAndRotation() {\n const { visualElement } = this.options\n\n if (!visualElement) return\n\n // If there's no detected skew or rotation values, we can early return without a forced render.\n let hasDistortingTransform = false\n\n /**\n * An unrolled check for rotation values. Most elements don't have any rotation and\n * skipping the nested loop and new object creation is 50% faster.\n */\n const { latestValues } = visualElement\n if (\n latestValues.z ||\n latestValues.rotate ||\n latestValues.rotateX ||\n latestValues.rotateY ||\n latestValues.rotateZ ||\n latestValues.skewX ||\n latestValues.skewY\n ) {\n hasDistortingTransform = true\n }\n\n // If there's no distorting values, we don't need to do any more.\n if (!hasDistortingTransform) return\n\n const resetValues: ResolvedValues = {}\n\n if (latestValues.z) {\n resetDistortingTransform(\n \"z\",\n visualElement,\n resetValues,\n this.animationValues\n )\n }\n\n // Check the skew and rotate value of all axes and reset to 0\n for (let i = 0; i < transformAxes.length; i++) {\n resetDistortingTransform(\n `rotate${transformAxes[i]}`,\n visualElement,\n resetValues,\n this.animationValues\n )\n resetDistortingTransform(\n `skew${transformAxes[i]}`,\n visualElement,\n resetValues,\n this.animationValues\n )\n }\n\n // Force a render of this element to apply the transform with all skews and rotations\n // set to 0.\n visualElement.render()\n\n // Put back all the values we reset\n for (const key in resetValues) {\n visualElement.setStaticValue(key, resetValues[key])\n if (this.animationValues) {\n this.animationValues[key] = resetValues[key]\n }\n }\n\n // Schedule a render for the next frame. This ensures we won't visually\n // see the element with the reset rotate value applied.\n visualElement.scheduleRender()\n }\n\n applyProjectionStyles(\n targetStyle: any, // CSSStyleDeclaration - doesn't allow numbers to be assigned to properties\n styleProp?: MotionStyle\n ) {\n if (!this.instance || this.isSVG) return\n\n if (!this.isVisible) {\n targetStyle.visibility = \"hidden\"\n return\n }\n\n const transformTemplate = this.getTransformTemplate()\n\n if (this.needsReset) {\n this.needsReset = false\n\n targetStyle.visibility = \"\"\n targetStyle.opacity = \"\"\n targetStyle.pointerEvents =\n resolveMotionValue(styleProp?.pointerEvents) || \"\"\n targetStyle.transform = transformTemplate\n ? transformTemplate(this.latestValues, \"\")\n : \"none\"\n return\n }\n\n const lead = this.getLead()\n if (!this.projectionDelta || !this.layout || !lead.target) {\n if (this.options.layoutId) {\n targetStyle.opacity =\n this.latestValues.opacity !== undefined\n ? this.latestValues.opacity\n : 1\n targetStyle.pointerEvents =\n resolveMotionValue(styleProp?.pointerEvents) || \"\"\n }\n if (this.hasProjected && !hasTransform(this.latestValues)) {\n targetStyle.transform = transformTemplate\n ? transformTemplate({}, \"\")\n : \"none\"\n this.hasProjected = false\n }\n\n return\n }\n\n targetStyle.visibility = \"\"\n\n const valuesToRender = lead.animationValues || lead.latestValues\n this.applyTransformsToTarget()\n\n let transform = buildProjectionTransform(\n this.projectionDeltaWithTransform!,\n this.treeScale,\n valuesToRender\n )\n\n if (transformTemplate) {\n transform = transformTemplate(valuesToRender, transform)\n }\n\n targetStyle.transform = transform\n\n const { x, y } = this.projectionDelta\n targetStyle.transformOrigin = `${x.origin * 100}% ${\n y.origin * 100\n }% 0`\n\n if (lead.animationValues) {\n /**\n * If the lead component is animating, assign this either the entering/leaving\n * opacity\n */\n targetStyle.opacity =\n lead === this\n ? valuesToRender.opacity ??\n this.latestValues.opacity ??\n 1\n : this.preserveOpacity\n ? this.latestValues.opacity\n : valuesToRender.opacityExit\n } else {\n /**\n * Or we're not animating at all, set the lead component to its layout\n * opacity and other components to hidden.\n */\n targetStyle.opacity =\n lead === this\n ? valuesToRender.opacity !== undefined\n ? valuesToRender.opacity\n : \"\"\n : valuesToRender.opacityExit !== undefined\n ? valuesToRender.opacityExit\n : 0\n }\n\n /**\n * Apply scale correction\n */\n for (const key in scaleCorrectors) {\n if (valuesToRender[key] === undefined) continue\n\n const { correct, applyTo, isCSSVariable } = scaleCorrectors[key]\n\n /**\n * Only apply scale correction to the value if we have an\n * active projection transform. Otherwise these values become\n * vulnerable to distortion if the element changes size without\n * a corresponding layout animation.\n */\n const corrected =\n transform === \"none\"\n ? valuesToRender[key]\n : correct(valuesToRender[key], lead)\n\n if (applyTo) {\n const num = applyTo.length\n for (let i = 0; i < num; i++) {\n targetStyle[applyTo[i] as any] = corrected\n }\n } else {\n // If this is a CSS variable, set it directly on the instance.\n // Replacing this function from creating styles to setting them\n // would be a good place to remove per frame object creation\n if (isCSSVariable) {\n ;(\n this.options.visualElement as HTMLVisualElement\n ).renderState.vars[key] = corrected\n } else {\n targetStyle[key as any] = corrected\n }\n }\n }\n\n /**\n * Disable pointer events on follow components. This is to ensure\n * that if a follow component covers a lead component it doesn't block\n * pointer events on the lead.\n */\n if (this.options.layoutId) {\n targetStyle.pointerEvents =\n lead === this\n ? resolveMotionValue(styleProp?.pointerEvents) || \"\"\n : \"none\"\n }\n }\n\n clearSnapshot() {\n this.resumeFrom = this.snapshot = undefined\n }\n\n // Only run on root\n resetTree() {\n this.root.nodes!.forEach((node: IProjectionNode) =>\n node.currentAnimation?.stop()\n )\n this.root.nodes!.forEach(clearMeasurements)\n this.root.sharedNodes.clear()\n }\n }\n}\n\nfunction updateLayout(node: IProjectionNode) {\n node.updateLayout()\n}\n\nfunction notifyLayoutUpdate(node: IProjectionNode) {\n const snapshot = node.resumeFrom?.snapshot || node.snapshot\n\n if (\n node.isLead() &&\n node.layout &&\n snapshot &&\n node.hasListeners(\"didUpdate\")\n ) {\n const { layoutBox: layout, measuredBox: measuredLayout } = node.layout\n const { animationType } = node.options\n\n const isShared = snapshot.source !== node.layout.source\n\n // TODO Maybe we want to also resize the layout snapshot so we don't trigger\n // animations for instance if layout=\"size\" and an element has only changed position\n if (animationType === \"size\") {\n eachAxis((axis) => {\n const axisSnapshot = isShared\n ? snapshot.measuredBox[axis]\n : snapshot.layoutBox[axis]\n const length = calcLength(axisSnapshot)\n axisSnapshot.min = layout[axis].min\n axisSnapshot.max = axisSnapshot.min + length\n })\n } else if (animationType === \"x\" || animationType === \"y\") {\n const snapAxis = animationType === \"x\" ? \"y\" : \"x\"\n copyAxisInto(\n isShared\n ? snapshot.measuredBox[snapAxis]\n : snapshot.layoutBox[snapAxis],\n layout[snapAxis]\n )\n } else if (\n shouldAnimatePositionOnly(animationType, snapshot.layoutBox, layout)\n ) {\n eachAxis((axis) => {\n const axisSnapshot = isShared\n ? snapshot.measuredBox[axis]\n : snapshot.layoutBox[axis]\n const length = calcLength(layout[axis])\n axisSnapshot.max = axisSnapshot.min + length\n\n /**\n * Ensure relative target gets resized and rerendererd\n */\n if (node.relativeTarget && !node.currentAnimation) {\n node.isProjectionDirty = true\n node.relativeTarget[axis].max =\n node.relativeTarget[axis].min + length\n }\n })\n }\n\n const layoutDelta = createDelta()\n\n calcBoxDelta(layoutDelta, layout, snapshot.layoutBox)\n const visualDelta = createDelta()\n if (isShared) {\n calcBoxDelta(\n visualDelta,\n node.applyTransform(measuredLayout, true),\n snapshot.measuredBox\n )\n } else {\n calcBoxDelta(visualDelta, layout, snapshot.layoutBox)\n }\n\n const hasLayoutChanged = !isDeltaZero(layoutDelta)\n let hasRelativeLayoutChanged = false\n\n if (!node.resumeFrom) {\n const relativeParent = node.getClosestProjectingParent()\n\n /**\n * If the relativeParent is itself resuming from a different element then\n * the relative snapshot is not relavent\n */\n if (relativeParent && !relativeParent.resumeFrom) {\n const { snapshot: parentSnapshot, layout: parentLayout } =\n relativeParent\n\n if (parentSnapshot && parentLayout) {\n const anchor =\n node.options.layoutAnchor || undefined\n\n const relativeSnapshot = createBox()\n calcRelativePosition(\n relativeSnapshot,\n snapshot.layoutBox,\n parentSnapshot.layoutBox,\n anchor\n )\n\n const relativeLayout = createBox()\n calcRelativePosition(\n relativeLayout,\n layout,\n parentLayout.layoutBox,\n anchor\n )\n\n if (!boxEqualsRounded(relativeSnapshot, relativeLayout)) {\n hasRelativeLayoutChanged = true\n }\n\n if (relativeParent.options.layoutRoot) {\n node.relativeTarget = relativeLayout\n node.relativeTargetOrigin = relativeSnapshot\n node.relativeParent = relativeParent\n }\n }\n }\n }\n\n node.notifyListeners(\"didUpdate\", {\n layout,\n snapshot,\n delta: visualDelta,\n layoutDelta,\n hasLayoutChanged,\n hasRelativeLayoutChanged,\n })\n } else if (node.isLead()) {\n const { onExitComplete } = node.options\n onExitComplete && onExitComplete()\n }\n\n /**\n * Clearing transition\n * TODO: Investigate why this transition is being passed in as {type: false } from Framer\n * and why we need it at all\n */\n node.options.transition = undefined\n}\n\nexport function propagateDirtyNodes(node: IProjectionNode) {\n /**\n * Increase debug counter for nodes encountered this frame\n */\n if (statsBuffer.value) {\n metrics.nodes++\n }\n\n if (!node.parent) return\n\n /**\n * If this node isn't projecting, propagate isProjectionDirty. It will have\n * no performance impact but it will allow the next child that *is* projecting\n * but *isn't* dirty to just check its parent to see if *any* ancestor needs\n * correcting.\n */\n if (!node.isProjecting()) {\n node.isProjectionDirty = node.parent.isProjectionDirty\n }\n\n /**\n * Propagate isSharedProjectionDirty and isTransformDirty\n * throughout the whole tree. A future revision can take another look at\n * this but for safety we still recalcualte shared nodes.\n */\n node.isSharedProjectionDirty ||= Boolean(\n node.isProjectionDirty ||\n node.parent.isProjectionDirty ||\n node.parent.isSharedProjectionDirty\n )\n\n node.isTransformDirty ||= node.parent.isTransformDirty\n}\n\nexport function cleanDirtyNodes(node: IProjectionNode) {\n node.isProjectionDirty =\n node.isSharedProjectionDirty =\n node.isTransformDirty =\n false\n}\n\nfunction clearSnapshot(node: IProjectionNode) {\n node.clearSnapshot()\n}\n\nfunction clearMeasurements(node: IProjectionNode) {\n node.clearMeasurements()\n}\n\nfunction forceLayoutMeasure(node: IProjectionNode) {\n node.isLayoutDirty = true\n node.updateLayout()\n}\n\nfunction clearIsLayoutDirty(node: IProjectionNode) {\n node.isLayoutDirty = false\n}\n\n/**\n * When a node is animation-blocked (e.g. during drag) and its component\n * didn't re-render (memoized), willUpdate() is never called so there's\n * no snapshot. Use the previous layout as a snapshot and mark dirty so\n * resetTransform/updateLayout/notifyLayoutUpdate process it normally.\n */\nfunction ensureDraggedNodesSnapshotted(node: IProjectionNode) {\n if (node.isAnimationBlocked && node.layout && !node.isLayoutDirty) {\n node.snapshot = node.layout\n node.isLayoutDirty = true\n }\n}\n\nfunction resetTransformStyle(node: IProjectionNode) {\n const { visualElement } = node.options\n if (visualElement && visualElement.getProps().onBeforeLayoutMeasure) {\n visualElement.notify(\"BeforeLayoutMeasure\")\n }\n\n node.resetTransform()\n}\n\nfunction finishAnimation(node: IProjectionNode) {\n node.finishAnimation()\n node.targetDelta = node.relativeTarget = node.target = undefined\n node.isProjectionDirty = true\n}\n\nfunction resolveTargetDelta(node: IProjectionNode) {\n node.resolveTargetDelta()\n}\n\nfunction calcProjection(node: IProjectionNode) {\n node.calcProjection()\n}\n\nfunction resetSkewAndRotation(node: IProjectionNode) {\n node.resetSkewAndRotation()\n}\n\nfunction removeLeadSnapshots(stack: NodeStack) {\n stack.removeLeadSnapshot()\n}\n\nfunction mixAxisDeltaLinear(output: AxisDelta, delta: AxisDelta, p: number) {\n output.translate = mixNumber(delta.translate, 0, p)\n output.scale = mixNumber(delta.scale, 1, p)\n output.origin = delta.origin\n output.originPoint = delta.originPoint\n}\n\nexport function mixAxis(output: Axis, from: Axis, to: Axis, p: number) {\n output.min = mixNumber(from.min, to.min, p)\n output.max = mixNumber(from.max, to.max, p)\n}\n\nexport function mixBox(output: Box, from: Box, to: Box, p: number) {\n mixAxis(output.x, from.x, to.x, p)\n mixAxis(output.y, from.y, to.y, p)\n}\n\nfunction hasOpacityCrossfade(node: IProjectionNode) {\n return (\n node.animationValues && node.animationValues.opacityExit !== undefined\n )\n}\n\nconst defaultLayoutTransition = {\n duration: 0.45,\n ease: [0.4, 0, 0.1, 1],\n}\n\nconst userAgentContains = (string: string) =>\n typeof navigator !== \"undefined\" &&\n navigator.userAgent &&\n navigator.userAgent.toLowerCase().includes(string)\n\n/**\n * Measured bounding boxes must be rounded in Safari and\n * left untouched in Chrome, otherwise non-integer layouts within scaled-up elements\n * can appear to jump.\n */\nconst roundPoint =\n userAgentContains(\"applewebkit/\") && !userAgentContains(\"chrome/\")\n ? Math.round\n : noop\n\nfunction roundAxis(axis: Axis): void {\n // Round to the nearest .5 pixels to support subpixel layouts\n axis.min = roundPoint(axis.min)\n axis.max = roundPoint(axis.max)\n}\n\nfunction roundBox(box: Box): void {\n roundAxis(box.x)\n roundAxis(box.y)\n}\n\nfunction shouldAnimatePositionOnly(\n animationType: string | undefined,\n snapshot: Box,\n layout: Box\n) {\n return (\n animationType === \"position\" ||\n (animationType === \"preserve-aspect\" &&\n !isNear(aspectRatio(snapshot), aspectRatio(layout), 0.2))\n )\n}\n\nfunction checkNodeWasScrollRoot(node: IProjectionNode) {\n return node !== node.root && node.scroll?.wasRoot\n}\n","import { addDomEvent } from \"../../events/add-dom-event\"\nimport { createProjectionNode } from \"./create-projection-node\"\n\nexport const DocumentProjectionNode = createProjectionNode({\n attachResizeListener: (\n ref: Window | Element,\n notify: VoidFunction\n ): VoidFunction => addDomEvent(ref, \"resize\", notify),\n measureScroll: () => ({\n x: document.documentElement.scrollLeft || document.body?.scrollLeft || 0,\n y: document.documentElement.scrollTop || document.body?.scrollTop || 0,\n }),\n checkIsScrollRoot: () => true,\n})\n","import { IProjectionNode } from \"./types\"\n\nconst notify = (node: IProjectionNode) =>\n !node.isLayoutDirty && node.willUpdate(false)\n\nexport interface NodeGroup {\n add: (node: IProjectionNode) => void\n remove: (node: IProjectionNode) => void\n dirty: VoidFunction\n}\n\nexport function nodeGroup(): NodeGroup {\n const nodes = new Set()\n const subscriptions = new WeakMap void>()\n\n const dirtyAll = () => nodes.forEach(notify)\n\n return {\n add: (node) => {\n nodes.add(node)\n subscriptions.set(\n node,\n node.addEventListener(\"willUpdate\", dirtyAll)\n )\n },\n remove: (node) => {\n nodes.delete(node)\n const unsubscribe = subscriptions.get(node)\n if (unsubscribe) {\n unsubscribe()\n subscriptions.delete(node)\n }\n dirtyAll()\n },\n dirty: dirtyAll,\n }\n}\n","import { createProjectionNode } from \"./create-projection-node\"\nimport { DocumentProjectionNode } from \"./DocumentProjectionNode\"\nimport { IProjectionNode } from \"./types\"\n\nexport const rootProjectionNode: { current: IProjectionNode | undefined } = {\n current: undefined,\n}\n\nexport const HTMLProjectionNode = createProjectionNode({\n measureScroll: (instance) => ({\n x: instance.scrollLeft,\n y: instance.scrollTop,\n }),\n defaultParent: () => {\n if (!rootProjectionNode.current) {\n const documentNode = new DocumentProjectionNode({})\n documentNode.mount(window)\n documentNode.setOptions({ layoutScroll: true })\n rootProjectionNode.current = documentNode\n }\n return rootProjectionNode.current\n },\n resetTransform: (instance, value) => {\n instance.style.transform = value !== undefined ? value : \"none\"\n },\n checkIsScrollRoot: (instance) =>\n Boolean(window.getComputedStyle(instance).position === \"fixed\"),\n})\n","import { clamp } from \"motion-utils\"\nimport { GroupAnimation } from \"../animation/GroupAnimation\"\nimport type { AnimationOptions, Transition } from \"../animation/types\"\nimport { frameData, frameSteps } from \"../frameloop\"\nimport { microtask } from \"../frameloop/microtask\"\nimport { time } from \"../frameloop/sync-time\"\nimport { HTMLProjectionNode } from \"../projection/node/HTMLProjectionNode\"\nimport type { IProjectionNode } from \"../projection/node/types\"\nimport { HTMLVisualElement } from \"../render/html/HTMLVisualElement\"\nimport { visualElementStore } from \"../render/store\"\nimport { hasTransform } from \"../projection/utils/has-transform\"\nimport {\n resolveElements,\n type ElementOrSelector,\n} from \"../utils/resolve-elements\"\n\ntype LayoutAnimationScope = Element | Document\ntype LayoutBuilderResolve = (animation: GroupAnimation) => void\ntype LayoutBuilderReject = (error: unknown) => void\n\ninterface RestorePoint {\n parent: Element\n next: ChildNode | null\n}\n\nconst layoutSelector = \"[data-layout],[data-layout-id]\"\n\n/**\n * All imperatively-created projection nodes live in one persistent tree,\n * shared across animateLayout() calls (and with any React-created nodes,\n * via the singleton document root). Keyed by element for reuse.\n */\nconst layoutNodes = new WeakMap()\n\n/**\n * Builders created within the same synchronous tick are flushed together\n * as a single \"commit\": every node is snapshotted before any updateDom\n * runs, mirroring React batching renders from different parts of the tree.\n */\nlet pendingBuilders: LayoutAnimationBuilder[] | undefined\n\nfunction collectLayoutElements(scope: LayoutAnimationScope): HTMLElement[] {\n const elements: HTMLElement[] = []\n\n if (scope instanceof HTMLElement && scope.matches(layoutSelector)) {\n elements.push(scope)\n }\n\n scope.querySelectorAll(layoutSelector).forEach((element) => {\n if (element instanceof HTMLElement) elements.push(element)\n })\n\n return elements\n}\n\n/**\n * Process any work scheduled on the frameloop now. A previous animation\n * may have been seeked while paused (controls.time = x) without a frame\n * having rendered it - we must materialise that state into the DOM\n * before taking snapshots.\n */\nfunction flushPendingFrame() {\n if (frameData.isProcessing) return\n\n const now = time.now()\n frameData.delta = clamp(0, 1000 / 60, now - frameData.timestamp)\n frameData.timestamp = now\n frameData.isProcessing = true\n frameSteps.update.process(frameData)\n frameSteps.preRender.process(frameData)\n frameSteps.render.process(frameData)\n frameData.isProcessing = false\n}\n\nfunction getProjectionParent(element: Element): IProjectionNode | undefined {\n let ancestor = element.parentElement\n while (ancestor) {\n const node = layoutNodes.get(ancestor)\n if (node && node.instance) return node\n ancestor = ancestor.parentElement\n }\n return undefined\n}\n\nfunction createVisualElement() {\n return new HTMLVisualElement(\n {\n props: {},\n presenceContext: null,\n visualState: {\n latestValues: {},\n renderState: {\n transform: {},\n transformOrigin: {},\n style: {},\n vars: {},\n },\n },\n },\n { allowProjection: true }\n )\n}\n\nfunction readNodeOptions(element: HTMLElement, transition?: Transition) {\n const layoutAttr = element.getAttribute(\"data-layout\")\n const layoutId = element.getAttribute(\"data-layout-id\") ?? undefined\n\n return {\n layoutId,\n layout: layoutAttr !== null ? true : undefined,\n animationType: (!layoutAttr || layoutAttr === \"true\"\n ? \"both\"\n : layoutAttr) as \"both\",\n transition,\n }\n}\n\nfunction prepareNode(\n element: HTMLElement,\n transition?: Transition\n): IProjectionNode {\n let node = layoutNodes.get(element)\n\n if (!node) {\n let visualElement = visualElementStore.get(element) as\n | HTMLVisualElement\n | undefined\n\n if (!visualElement) visualElement = createVisualElement()\n\n /**\n * A first-time element may carry a projection transform in its\n * inline style (e.g. it was cloned from an element mid-animation).\n * That transform isn't tracked in latestValues so the engine can't\n * reset it before measuring - clear it now so the first layout\n * measurement isn't inflated.\n */\n if (\n element.style.transform &&\n !hasTransform(visualElement.latestValues)\n ) {\n element.style.transform = \"\"\n }\n\n node = new HTMLProjectionNode(\n visualElement.latestValues,\n getProjectionParent(element)\n )\n visualElement.projection = node\n\n node.setOptions({\n ...readNodeOptions(element, transition),\n visualElement,\n })\n node.mount(element)\n layoutNodes.set(element, node)\n } else {\n node.setOptions(readNodeOptions(element, transition))\n }\n\n node.isPresent = true\n if (node.options.onExitComplete) {\n node.setOptions({ onExitComplete: undefined })\n }\n\n return node\n}\n\nfunction sortDocumentOrder(elements: Iterable) {\n return [...elements].sort((a, b) =>\n a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1\n )\n}\n\nfunction dropNode(element: Element, node: IProjectionNode) {\n node.setOptions({ onExitComplete: undefined })\n\n /**\n * Stop any lingering animation so it can't leak into future updates.\n * A follow node can share its currentAnimation with a surviving lead\n * (via resumingFrom), in which case it isn't ours to stop.\n */\n const stack = node.getStack()\n if (!stack || node.isLead()) node.currentAnimation?.stop()\n\n node.unmount()\n layoutNodes.delete(element)\n}\n\nfunction flushPendingBuilders() {\n const builders = pendingBuilders!\n pendingBuilders = undefined\n\n flushPendingFrame()\n\n /**\n * Discover and mount every node across all builders before snapshotting\n * any of them. Mounting during an active update flags isLayoutDirty,\n * which would make that node's own willUpdate skip its snapshot.\n * Document order guarantees ancestors mount before descendants, even\n * when they're discovered by different builders.\n */\n const targets = new Map()\n for (const builder of builders) {\n for (const element of builder.collectTargets()) {\n const owners = targets.get(element)\n owners ? owners.push(builder) : targets.set(element, [builder])\n }\n }\n\n const union = new Map()\n for (const element of sortDocumentOrder(targets.keys())) {\n const owners = targets.get(element)!\n const node = prepareNode(\n element,\n owners[owners.length - 1].transitionFor(element)\n )\n for (const owner of owners) owner.adopt(element, node)\n union.set(element, node)\n }\n\n union.forEach((node) => {\n node.isLayoutDirty = false\n node.willUpdate()\n })\n\n const updatePromises: Promise[] = []\n for (const builder of builders) {\n const result = builder.runUpdate()\n if (result) updatePromises.push(result)\n }\n\n const commit = () => {\n /**\n * Process all additions before any removals so that, even across\n * builders, a removed member knows whether a replacement with the\n * same layoutId was added in this commit.\n */\n const newMemberIds = new Set()\n for (const builder of builders) {\n builder.reconcileAdditions(newMemberIds)\n }\n for (const builder of builders) {\n builder.reconcileRemovals(newMemberIds)\n }\n\n let root: IProjectionNode | undefined\n union.forEach((node) => (root ||= node.root))\n for (const builder of builders) root ||= builder.getRoot()\n\n root?.didUpdate()\n\n /**\n * The root flushes the update on a microtask, synchronously\n * processing the frame that creates the layout animations. Collect\n * them in a later microtask step of the same pass.\n */\n microtask.render(() => {\n for (const builder of builders) builder.finalize()\n })\n }\n\n updatePromises.length ? Promise.all(updatePromises).then(commit) : commit()\n}\n\nexport class LayoutAnimationBuilder {\n private sharedTransitions = new Map()\n\n private notifyReady: LayoutBuilderResolve = () => {}\n private rejectReady: LayoutBuilderReject = () => {}\n private readyPromise: Promise\n\n private tracked = new Map()\n private restorePoints = new Map()\n private updateError: unknown\n\n constructor(\n private scope: LayoutAnimationScope,\n private updateDom: () => void | Promise,\n private defaultOptions?: AnimationOptions\n ) {\n this.readyPromise = new Promise((resolve, reject) => {\n this.notifyReady = resolve\n this.rejectReady = reject\n })\n\n if (!pendingBuilders) {\n pendingBuilders = []\n queueMicrotask(flushPendingBuilders)\n }\n pendingBuilders.push(this)\n }\n\n shared(id: string, transition: AnimationOptions): this {\n this.sharedTransitions.set(id, transition)\n return this\n }\n\n then(resolve: LayoutBuilderResolve, reject?: LayoutBuilderReject) {\n return this.readyPromise.then(resolve, reject)\n }\n\n transitionFor(element: HTMLElement): Transition | undefined {\n const layoutId = element.getAttribute(\"data-layout-id\")\n return ((layoutId && this.sharedTransitions.get(layoutId)) ||\n this.defaultOptions) as Transition | undefined\n }\n\n adopt(element: HTMLElement, node: IProjectionNode) {\n this.tracked.set(element, node)\n this.restorePoints.set(element, {\n parent: element.parentElement!,\n next: element.nextSibling,\n })\n }\n\n collectTargets() {\n return collectLayoutElements(this.scope)\n }\n\n runUpdate(): Promise | undefined {\n try {\n const result = this.updateDom()\n if (result && typeof result.then === \"function\") {\n return result.then(undefined, (error: unknown) => {\n this.updateError = error\n })\n }\n } catch (error) {\n this.updateError = error\n }\n return undefined\n }\n\n reconcileAdditions(newMemberIds: Set) {\n for (const element of collectLayoutElements(this.scope)) {\n if (this.tracked.has(element)) continue\n const node = prepareNode(element, this.transitionFor(element))\n this.adopt(element, node)\n node.options.layoutId && newMemberIds.add(node.options.layoutId)\n }\n }\n\n reconcileRemovals(newMemberIds: Set) {\n this.tracked.forEach((node, element) => {\n if (element.isConnected) return\n\n const restore = this.restorePoints.get(element)\n this.restorePoints.delete(element)\n\n const { layoutId } = node.options\n const stack = node.getStack()\n const hasSurvivor =\n stack &&\n stack.members.some(\n (member) =>\n member !== node &&\n (member.instance as HTMLElement | undefined)\n ?.isConnected\n )\n\n /**\n * A removed lead with a surviving stack member - and no\n * replacement member added this commit - runs an exit\n * crossfade: restore the element to its old position in the\n * DOM, relegate it and let the survivor take over. It's\n * removed again once the animation completes.\n */\n if (\n layoutId &&\n node.isLead() &&\n hasSurvivor &&\n !newMemberIds.has(layoutId)\n ) {\n if (restore && restore.parent.isConnected) {\n restore.parent.insertBefore(\n element,\n restore.next && restore.next.parentNode === restore.parent\n ? restore.next\n : null\n )\n node.isPresent = false\n node.setOptions({\n onExitComplete: () => {\n element.remove()\n dropNode(element, node)\n },\n })\n if (node.relegate()) return\n\n element.remove()\n }\n }\n\n dropNode(element, node)\n this.tracked.delete(element)\n })\n }\n\n getRoot(): IProjectionNode | undefined {\n let root: IProjectionNode | undefined\n this.tracked.forEach((node) => (root ||= node.root))\n return root\n }\n\n finalize() {\n if (this.updateError) {\n this.rejectReady(this.updateError)\n return\n }\n\n const animations = new Set()\n this.tracked.forEach((node) => {\n if (node.instance && node.currentAnimation) {\n animations.add(node.currentAnimation)\n }\n })\n\n this.notifyReady(new GroupAnimation([...animations]))\n }\n}\n\nexport function parseAnimateLayoutArgs(\n scopeOrUpdateDom: ElementOrSelector | (() => void),\n updateDomOrOptions?: (() => void) | AnimationOptions,\n options?: AnimationOptions\n): {\n scope: Element | Document\n updateDom: () => void\n defaultOptions?: AnimationOptions\n} {\n if (typeof scopeOrUpdateDom === \"function\") {\n return {\n scope: document,\n updateDom: scopeOrUpdateDom,\n defaultOptions: updateDomOrOptions as AnimationOptions | undefined,\n }\n }\n\n const scope =\n scopeOrUpdateDom instanceof Document\n ? scopeOrUpdateDom\n : resolveElements(scopeOrUpdateDom)[0] ?? document\n\n return {\n scope,\n updateDom: updateDomOrOptions as () => void,\n defaultOptions: options,\n }\n}\n","import { cancelFrame, frame } from \".\"\nimport { stepsOrder } from \"./order\"\nimport { Process } from \"./types\"\n\n/**\n * @deprecated\n *\n * Import as `frame` instead.\n */\nexport const sync = frame\n\n/**\n * @deprecated\n *\n * Use cancelFrame(callback) instead.\n */\nexport const cancelSync = stepsOrder.reduce((acc, key) => {\n acc[key] = (process: Process) => cancelFrame(process)\n return acc\n}, {} as Record void>)\n"],"names":["MotionGlobalConfig","noop","clamp","alpha","alphaType","getAnimatableNone","mixNumber","warning","mixNumberImmediate","pipe","millisecondsToSeconds","secondsToMilliseconds","velocityPerSecond","spring","createSpring","invariant","progress","easeInOut","isEasingArray","easingDefinitionToFunction","keyframesGenerator","keyframes","memo","isBezierDefinition","anticipate","backInOut","circInOut","KeyframeResolver","DefaultKeyframeResolver","warnOnce","SubscriptionManager","wrap","isNumericalString","isZeroValueString","isObject","translateAlias","buildTransform","getComputedStyle","asNumber","removeItem","checkIsControllingVariants","checkIsVariantNode","scrapeMotionValuesFromProps","scrapeHTMLMotionValuesFromProps","circOut","calcProgress","motionValue","createMotionValue","addUniqueItem"],"mappings":";;;;;;AAEO,MAAM,UAAU,GAAa;AAChC,IAAA,OAAO;AACP,IAAA,MAAM;AACN,IAAA,kBAAkB;AAClB,IAAA,WAAW;AACX,IAAA,QAAQ;AACR,IAAA,WAAW;AACX,IAAA,QAAQ;AACR,IAAA,YAAY;CACN;;ACTJ,SAAU,gBAAgB,CAAC,YAAwB,EAAA;AACrD;;;AAGG;AACH,IAAA,IAAI,SAAS,GAAG,IAAI,GAAG,EAAW;AAClC,IAAA,IAAI,SAAS,GAAG,IAAI,GAAG,EAAW;AAElC;;;AAGG;IACH,IAAI,YAAY,GAAG,KAAK;IAExB,IAAI,cAAc,GAAG,KAAK;AAE1B;;AAEG;AACH,IAAA,MAAM,WAAW,GAAG,IAAI,OAAO,EAAW;AAE1C,IAAA,IAAI,eAAe,GAAc;AAC7B,QAAA,KAAK,EAAE,GAAG;AACV,QAAA,SAAS,EAAE,GAAG;AACd,QAAA,YAAY,EAAE,KAAK;KACtB;IAED,SAAS,eAAe,CAAC,QAAiB,EAAA;AACtC,QAAA,IAAI,WAAW,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE;AAC3B,YAAA,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC;AACvB,YAAA,YAAY,EAAE;QAClB;QAEA,QAAQ,CAAC,eAAe,CAAC;IAC7B;AAEA,IAAA,MAAM,IAAI,GAAS;AACf;;AAEG;AACH,QAAA,QAAQ,EAAE,CAAC,QAAQ,EAAE,SAAS,GAAG,KAAK,EAAE,SAAS,GAAG,KAAK,KAAI;AACzD,YAAA,MAAM,iBAAiB,GAAG,SAAS,IAAI,YAAY;YACnD,MAAM,KAAK,GAAG,iBAAiB,GAAG,SAAS,GAAG,SAAS;AAEvD,YAAA,IAAI,SAAS;AAAE,gBAAA,WAAW,CAAC,GAAG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BAAoD,EACpD,OAA0B,EAAA;AAM1B,IAAA,IAAI,OAAO,gBAAgB,KAAK,UAAU,EAAE;QACxC,OAAO;AACH,YAAA,KAAK,EAAE,QAAQ;AACf,YAAA,SAAS,EAAE,gBAAgB;AAC3B,YAAA,cAAc,EAAE,kBAAkD;SACrE;IACL;AAEA,IAAA,MAAM,KAAK,GACP,gBAAgB,YAAY;AACxB,UAAE;UACA,eAAe,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,IAAI,QAAQ;IAE1D,OAAO;QACH,KAAK;AACL,QAAA,SAAS,EAAE,kBAAgC;AAC3C,QAAA,cAAc,EAAE,OAAO;KAC1B;AACL;;AC7bA;;;;AAIG;AACI,MAAM,IAAI,GAAG;AAEpB;;;;AAIG;AACI,MAAM,UAAU,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,KAAI;AACrD,IAAA,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,OAAgB,KAAK,WAAW,CAAC,OAAO,CAAC;AACrD,IAAA,OAAO,GAAG;AACd,CAAC,EAAE,EAAgD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.mjs b/node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.mjs deleted file mode 100644 index ef66494..0000000 --- a/node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.mjs +++ /dev/null @@ -1,199 +0,0 @@ -import { MotionGlobalConfig, noop } from 'motion-utils'; -import { time } from '../frameloop/sync-time.mjs'; -import { JSAnimation } from './JSAnimation.mjs'; -import { getFinalKeyframe } from './keyframes/get-final.mjs'; -import { KeyframeResolver, flushKeyframeResolvers } from './keyframes/KeyframesResolver.mjs'; -import { NativeAnimationExtended } from './NativeAnimationExtended.mjs'; -import { canAnimate } from './utils/can-animate.mjs'; -import { makeAnimationInstant } from './utils/make-animation-instant.mjs'; -import { WithPromise } from './utils/WithPromise.mjs'; -import { supportsBrowserAnimation } from './waapi/supports/waapi.mjs'; - -/** - * Maximum time allowed between an animation being created and it being - * resolved for us to use the latter as the start time. - * - * This is to ensure that while we prefer to "start" an animation as soon - * as it's triggered, we also want to avoid a visual jump if there's a big delay - * between these two moments. - */ -const MAX_RESOLVE_DELAY = 40; -class AsyncMotionValueAnimation extends WithPromise { - constructor({ autoplay = true, delay = 0, type = "keyframes", repeat = 0, repeatDelay = 0, repeatType = "loop", keyframes, name, motionValue, element, ...options }) { - super(); - /** - * Bound to support return animation.stop pattern - */ - this.stop = () => { - if (this._animation) { - this._animation.stop(); - this.stopTimeline?.(); - } - this.keyframeResolver?.cancel(); - }; - this.createdAt = time.now(); - const optionsWithDefaults = { - autoplay, - delay, - type, - repeat, - repeatDelay, - repeatType, - name, - motionValue, - element, - ...options, - }; - const KeyframeResolver$1 = element?.KeyframeResolver || KeyframeResolver; - this.keyframeResolver = new KeyframeResolver$1(keyframes, (resolvedKeyframes, finalKeyframe, forced) => this.onKeyframesResolved(resolvedKeyframes, finalKeyframe, optionsWithDefaults, !forced), name, motionValue, element); - this.keyframeResolver?.scheduleResolve(); - } - onKeyframesResolved(keyframes, finalKeyframe, options, sync) { - this.keyframeResolver = undefined; - const { name, type, velocity, delay, isHandoff, onUpdate } = options; - this.resolvedAt = time.now(); - /** - * If we can't animate this value with the resolved keyframes - * then we should complete it immediately. - */ - let canAnimateValue = true; - if (!canAnimate(keyframes, name, type, velocity)) { - canAnimateValue = false; - if (MotionGlobalConfig.instantAnimations || !delay) { - onUpdate?.(getFinalKeyframe(keyframes, options, finalKeyframe)); - } - keyframes[0] = keyframes[keyframes.length - 1]; - makeAnimationInstant(options); - options.repeat = 0; - } - /** - * Resolve startTime for the animation. - * - * This method uses the createdAt and resolvedAt to calculate the - * animation startTime. *Ideally*, we would use the createdAt time as t=0 - * as the following frame would then be the first frame of the animation in - * progress, which would feel snappier. - * - * However, if there's a delay (main thread work) between the creation of - * the animation and the first committed frame, we prefer to use resolvedAt - * to avoid a sudden jump into the animation. - */ - const startTime = sync - ? !this.resolvedAt - ? this.createdAt - : this.resolvedAt - this.createdAt > MAX_RESOLVE_DELAY - ? this.resolvedAt - : this.createdAt - : undefined; - const resolvedOptions = { - startTime, - finalKeyframe, - ...options, - keyframes, - }; - /** - * Animate via WAAPI if possible. If this is a handoff animation, the optimised animation will be running via - * WAAPI. Therefore, this animation must be JS to ensure it runs "under" the - * optimised animation. - * - * Also skip WAAPI when keyframes aren't animatable, as the resolved - * values may not be valid CSS and would trigger browser warnings. - */ - const useWaapi = canAnimateValue && - !isHandoff && - supportsBrowserAnimation(resolvedOptions); - const element = resolvedOptions.motionValue?.owner?.current; - let animation; - if (useWaapi) { - try { - animation = new NativeAnimationExtended({ - ...resolvedOptions, - element, - }); - } - catch { - animation = new JSAnimation(resolvedOptions); - } - } - else { - animation = new JSAnimation(resolvedOptions); - } - animation.finished.then(() => { - this.notifyFinished(); - }).catch(noop); - if (this.pendingTimeline) { - this.stopTimeline = animation.attachTimeline(this.pendingTimeline); - this.pendingTimeline = undefined; - } - this._animation = animation; - } - get finished() { - if (!this._animation) { - return this._finished; - } - else { - return this.animation.finished; - } - } - then(onResolve, _onReject) { - return this.finished.finally(onResolve).then(() => { }); - } - get animation() { - if (!this._animation) { - this.keyframeResolver?.resume(); - flushKeyframeResolvers(); - } - return this._animation; - } - get duration() { - return this.animation.duration; - } - get iterationDuration() { - return this.animation.iterationDuration; - } - get time() { - return this.animation.time; - } - set time(newTime) { - this.animation.time = newTime; - } - get speed() { - return this.animation.speed; - } - get state() { - return this.animation.state; - } - set speed(newSpeed) { - this.animation.speed = newSpeed; - } - get startTime() { - return this.animation.startTime; - } - attachTimeline(timeline) { - if (this._animation) { - this.stopTimeline = this.animation.attachTimeline(timeline); - } - else { - this.pendingTimeline = timeline; - } - return () => this.stop(); - } - play() { - this.animation.play(); - } - pause() { - this.animation.pause(); - } - complete() { - this.animation.complete(); - } - cancel() { - if (this._animation) { - this.animation.cancel(); - } - this.keyframeResolver?.cancel(); - } -} - -export { AsyncMotionValueAnimation }; -//# sourceMappingURL=AsyncMotionValueAnimation.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.mjs.map b/node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.mjs.map deleted file mode 100644 index 1c6cdf5..0000000 --- a/node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"AsyncMotionValueAnimation.mjs","sources":["../../../src/animation/AsyncMotionValueAnimation.ts"],"sourcesContent":["import { MotionGlobalConfig, noop } from \"motion-utils\"\nimport { time } from \"../frameloop/sync-time\"\nimport { JSAnimation } from \"./JSAnimation\"\nimport { getFinalKeyframe } from \"./keyframes/get-final\"\nimport {\n KeyframeResolver as DefaultKeyframeResolver,\n flushKeyframeResolvers,\n ResolvedKeyframes,\n} from \"./keyframes/KeyframesResolver\"\nimport { NativeAnimationExtended } from \"./NativeAnimationExtended\"\nimport {\n AnimationPlaybackControls,\n AnyResolvedKeyframe,\n TimelineWithFallback,\n ValueAnimationOptions,\n} from \"./types\"\nimport { canAnimate } from \"./utils/can-animate\"\nimport { makeAnimationInstant } from \"./utils/make-animation-instant\"\nimport { WithPromise } from \"./utils/WithPromise\"\nimport { supportsBrowserAnimation } from \"./waapi/supports/waapi\"\n\n/**\n * Maximum time allowed between an animation being created and it being\n * resolved for us to use the latter as the start time.\n *\n * This is to ensure that while we prefer to \"start\" an animation as soon\n * as it's triggered, we also want to avoid a visual jump if there's a big delay\n * between these two moments.\n */\nconst MAX_RESOLVE_DELAY = 40\n\ntype OptionsWithoutKeyframes = Omit<\n ValueAnimationOptions,\n \"keyframes\"\n>\n\nexport class AsyncMotionValueAnimation\n extends WithPromise\n implements AnimationPlaybackControls\n{\n private createdAt: number\n\n private resolvedAt: number | undefined\n\n private _animation: AnimationPlaybackControls | undefined\n\n private pendingTimeline: TimelineWithFallback | undefined\n\n private keyframeResolver: DefaultKeyframeResolver | undefined\n\n private stopTimeline: VoidFunction | undefined\n\n constructor({\n autoplay = true,\n delay = 0,\n type = \"keyframes\",\n repeat = 0,\n repeatDelay = 0,\n repeatType = \"loop\",\n keyframes,\n name,\n motionValue,\n element,\n ...options\n }: ValueAnimationOptions) {\n super()\n\n this.createdAt = time.now()\n\n const optionsWithDefaults: OptionsWithoutKeyframes = {\n autoplay,\n delay,\n type,\n repeat,\n repeatDelay,\n repeatType,\n name,\n motionValue,\n element,\n ...options,\n }\n\n const KeyframeResolver =\n element?.KeyframeResolver || DefaultKeyframeResolver\n\n this.keyframeResolver = new KeyframeResolver(\n keyframes,\n (\n resolvedKeyframes: ResolvedKeyframes,\n finalKeyframe: T,\n forced: boolean\n ) =>\n this.onKeyframesResolved(\n resolvedKeyframes,\n finalKeyframe,\n optionsWithDefaults,\n !forced\n ),\n name,\n motionValue,\n element\n )\n this.keyframeResolver?.scheduleResolve()\n }\n\n onKeyframesResolved(\n keyframes: ResolvedKeyframes,\n finalKeyframe: T,\n options: OptionsWithoutKeyframes,\n sync: boolean\n ) {\n this.keyframeResolver = undefined\n\n const { name, type, velocity, delay, isHandoff, onUpdate } = options\n this.resolvedAt = time.now()\n\n /**\n * If we can't animate this value with the resolved keyframes\n * then we should complete it immediately.\n */\n let canAnimateValue = true\n if (!canAnimate(keyframes, name, type, velocity)) {\n canAnimateValue = false\n\n if (MotionGlobalConfig.instantAnimations || !delay) {\n onUpdate?.(getFinalKeyframe(keyframes, options, finalKeyframe))\n }\n\n keyframes[0] = keyframes[keyframes.length - 1]\n\n makeAnimationInstant(options)\n options.repeat = 0\n }\n\n /**\n * Resolve startTime for the animation.\n *\n * This method uses the createdAt and resolvedAt to calculate the\n * animation startTime. *Ideally*, we would use the createdAt time as t=0\n * as the following frame would then be the first frame of the animation in\n * progress, which would feel snappier.\n *\n * However, if there's a delay (main thread work) between the creation of\n * the animation and the first committed frame, we prefer to use resolvedAt\n * to avoid a sudden jump into the animation.\n */\n const startTime = sync\n ? !this.resolvedAt\n ? this.createdAt\n : this.resolvedAt - this.createdAt > MAX_RESOLVE_DELAY\n ? this.resolvedAt\n : this.createdAt\n : undefined\n\n const resolvedOptions = {\n startTime,\n finalKeyframe,\n ...options,\n keyframes,\n }\n\n /**\n * Animate via WAAPI if possible. If this is a handoff animation, the optimised animation will be running via\n * WAAPI. Therefore, this animation must be JS to ensure it runs \"under\" the\n * optimised animation.\n *\n * Also skip WAAPI when keyframes aren't animatable, as the resolved\n * values may not be valid CSS and would trigger browser warnings.\n */\n const useWaapi =\n canAnimateValue &&\n !isHandoff &&\n supportsBrowserAnimation(resolvedOptions)\n const element = resolvedOptions.motionValue?.owner?.current\n\n let animation: AnimationPlaybackControls\n if (useWaapi) {\n try {\n animation = new NativeAnimationExtended({\n ...resolvedOptions,\n element,\n } as any)\n } catch {\n animation = new JSAnimation(resolvedOptions)\n }\n } else {\n animation = new JSAnimation(resolvedOptions)\n }\n\n animation.finished.then(() => {\n this.notifyFinished()\n }).catch(noop)\n\n if (this.pendingTimeline) {\n this.stopTimeline = animation.attachTimeline(this.pendingTimeline)\n this.pendingTimeline = undefined\n }\n\n this._animation = animation\n }\n\n get finished() {\n if (!this._animation) {\n return this._finished\n } else {\n return this.animation.finished\n }\n }\n\n then(onResolve: VoidFunction, _onReject?: VoidFunction) {\n return this.finished.finally(onResolve).then(() => {})\n }\n\n get animation(): AnimationPlaybackControls {\n if (!this._animation) {\n this.keyframeResolver?.resume()\n flushKeyframeResolvers()\n }\n\n return this._animation!\n }\n\n get duration() {\n return this.animation.duration\n }\n\n get iterationDuration() {\n return this.animation.iterationDuration\n }\n\n get time() {\n return this.animation.time\n }\n\n set time(newTime: number) {\n this.animation.time = newTime\n }\n\n get speed() {\n return this.animation.speed\n }\n\n get state() {\n return this.animation.state\n }\n\n set speed(newSpeed: number) {\n this.animation.speed = newSpeed\n }\n\n get startTime() {\n return this.animation.startTime\n }\n\n attachTimeline(timeline: TimelineWithFallback) {\n if (this._animation) {\n this.stopTimeline = this.animation.attachTimeline(timeline)\n } else {\n this.pendingTimeline = timeline\n }\n\n return () => this.stop()\n }\n\n play() {\n this.animation.play()\n }\n\n pause() {\n this.animation.pause()\n }\n\n complete() {\n this.animation.complete()\n }\n\n cancel() {\n if (this._animation) {\n this.animation.cancel()\n }\n\n this.keyframeResolver?.cancel()\n }\n\n /**\n * Bound to support return animation.stop pattern\n */\n stop = () => {\n if (this._animation) {\n this._animation.stop()\n this.stopTimeline?.()\n }\n\n this.keyframeResolver?.cancel()\n }\n}\n"],"names":["KeyframeResolver","DefaultKeyframeResolver"],"mappings":";;;;;;;;;;;AAqBA;;;;;;;AAOG;AACH,MAAM,iBAAiB,GAAG,EAAE;AAOtB,MAAO,yBACT,SAAQ,WAAW,CAAA;AAenB,IAAA,WAAA,CAAY,EACR,QAAQ,GAAG,IAAI,EACf,KAAK,GAAG,CAAC,EACT,IAAI,GAAG,WAAW,EAClB,MAAM,GAAG,CAAC,EACV,WAAW,GAAG,CAAC,EACf,UAAU,GAAG,MAAM,EACnB,SAAS,EACT,IAAI,EACJ,WAAW,EACX,OAAO,EACP,GAAG,OAAO,EACa,EAAA;AACvB,QAAA,KAAK,EAAE;AA2NX;;AAEG;QACH,IAAA,CAAA,IAAI,GAAG,MAAK;AACR,YAAA,IAAI,IAAI,CAAC,UAAU,EAAE;AACjB,gBAAA,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE;AACtB,gBAAA,IAAI,CAAC,YAAY,IAAI;YACzB;AAEA,YAAA,IAAI,CAAC,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,QAAQ;IACnC;AAEA,IAAA,IAAI,SAAS,GAAA;AACT,QAAA,OAAO,IAAI,CAAC,SAAS,CAAC,SAAS;IACnC;AAEA,IAAA,cAAc,CAAC,QAA8B,EAAA;AACzC,QAAA,IAAI,IAAI,CAAC,UAAU,EAAE;YACjB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,QAAQ,CAAC;QAC/D;aAAO;AACH,YAAA,IAAI,CAAC,eAAe,GAAG,QAAQ;QACnC;AAEA,QAAA,OAAO,MAAM,IAAI,CAAC,IAAI,EAAE;IAC5B;IAEA,IAAI,GAAA;AACA,QAAA,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE;IACzB;IAEA,KAAK,GAAA;AACD,QAAA,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE;IAC1B;IAEA,QAAQ,GAAA;AACJ,QAAA,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE;IAC7B;IAEA,MAAM,GAAA;AACF,QAAA,IAAI,IAAI,CAAC,UAAU,EAAE;AACjB,YAAA,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE;QAC3B;AAEA,QAAA,IAAI,CAAC,gBAAgB,EAAE,MAAM,EAAE;IACnC;AAaH;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/GroupAnimation.mjs b/node_modules/motion-dom/dist/es/animation/GroupAnimation.mjs deleted file mode 100644 index a959b95..0000000 --- a/node_modules/motion-dom/dist/es/animation/GroupAnimation.mjs +++ /dev/null @@ -1,82 +0,0 @@ -class GroupAnimation { - constructor(animations) { - // Bound to accomadate common `return animation.stop` pattern - this.stop = () => this.runAll("stop"); - this.animations = animations.filter(Boolean); - } - get finished() { - return Promise.all(this.animations.map((animation) => animation.finished)); - } - /** - * TODO: Filter out cancelled or stopped animations before returning - */ - getAll(propName) { - return this.animations[0][propName]; - } - setAll(propName, newValue) { - for (let i = 0; i < this.animations.length; i++) { - this.animations[i][propName] = newValue; - } - } - attachTimeline(timeline) { - const subscriptions = this.animations.map((animation) => animation.attachTimeline(timeline)); - return () => { - subscriptions.forEach((cancel, i) => { - cancel && cancel(); - this.animations[i].stop(); - }); - }; - } - get time() { - return this.getAll("time"); - } - set time(time) { - this.setAll("time", time); - } - get speed() { - return this.getAll("speed"); - } - set speed(speed) { - this.setAll("speed", speed); - } - get state() { - return this.getAll("state"); - } - get startTime() { - return this.getAll("startTime"); - } - get duration() { - return getMax(this.animations, "duration"); - } - get iterationDuration() { - return getMax(this.animations, "iterationDuration"); - } - runAll(methodName) { - this.animations.forEach((controls) => controls[methodName]()); - } - play() { - this.runAll("play"); - } - pause() { - this.runAll("pause"); - } - cancel() { - this.runAll("cancel"); - } - complete() { - this.runAll("complete"); - } -} -function getMax(animations, propName) { - let max = 0; - for (let i = 0; i < animations.length; i++) { - const value = animations[i][propName]; - if (value !== null && value > max) { - max = value; - } - } - return max; -} - -export { GroupAnimation }; -//# sourceMappingURL=GroupAnimation.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/GroupAnimation.mjs.map b/node_modules/motion-dom/dist/es/animation/GroupAnimation.mjs.map deleted file mode 100644 index d88a38d..0000000 --- a/node_modules/motion-dom/dist/es/animation/GroupAnimation.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"GroupAnimation.mjs","sources":["../../../src/animation/GroupAnimation.ts"],"sourcesContent":["import { AnimationPlaybackControls, TimelineWithFallback } from \"./types\"\n\ntype PropNames =\n | \"time\"\n | \"speed\"\n | \"duration\"\n | \"attachTimeline\"\n | \"startTime\"\n | \"state\"\n\nexport type AcceptedAnimations = AnimationPlaybackControls\n\nexport type GroupedAnimations = AcceptedAnimations[]\n\nexport class GroupAnimation implements AnimationPlaybackControls {\n animations: GroupedAnimations\n\n constructor(animations: Array) {\n this.animations = animations.filter(Boolean) as GroupedAnimations\n }\n\n get finished() {\n return Promise.all(\n this.animations.map((animation) => animation.finished)\n )\n }\n\n /**\n * TODO: Filter out cancelled or stopped animations before returning\n */\n private getAll(propName: PropNames) {\n return this.animations[0][propName] as any\n }\n\n private setAll(propName: PropNames, newValue: any) {\n for (let i = 0; i < this.animations.length; i++) {\n ;(this.animations[i][propName] as any) = newValue\n }\n }\n\n attachTimeline(timeline: TimelineWithFallback) {\n const subscriptions = this.animations.map((animation) =>\n animation.attachTimeline(timeline)\n )\n\n return () => {\n subscriptions.forEach((cancel, i) => {\n cancel && cancel()\n this.animations[i].stop()\n })\n }\n }\n\n get time() {\n return this.getAll(\"time\")\n }\n\n set time(time: number) {\n this.setAll(\"time\", time)\n }\n\n get speed() {\n return this.getAll(\"speed\")\n }\n\n set speed(speed: number) {\n this.setAll(\"speed\", speed)\n }\n\n get state() {\n return this.getAll(\"state\")\n }\n\n get startTime() {\n return this.getAll(\"startTime\")\n }\n\n get duration() {\n return getMax(this.animations, \"duration\")\n }\n\n get iterationDuration() {\n return getMax(this.animations, \"iterationDuration\")\n }\n\n private runAll(\n methodName: keyof Omit<\n AnimationPlaybackControls,\n PropNames | \"then\" | \"finished\" | \"iterationDuration\"\n >\n ) {\n this.animations.forEach((controls) => controls[methodName]())\n }\n\n play() {\n this.runAll(\"play\")\n }\n\n pause() {\n this.runAll(\"pause\")\n }\n\n // Bound to accomadate common `return animation.stop` pattern\n stop = () => this.runAll(\"stop\")\n\n cancel() {\n this.runAll(\"cancel\")\n }\n\n complete() {\n this.runAll(\"complete\")\n }\n}\n\nfunction getMax(\n animations: GroupedAnimations,\n propName: \"iterationDuration\" | \"duration\"\n): number {\n let max = 0\n\n for (let i = 0; i < animations.length; i++) {\n const value = animations[i][propName]\n if (value !== null && value > max) {\n max = value\n }\n }\n return max\n}\n"],"names":[],"mappings":"MAca,cAAc,CAAA;AAGvB,IAAA,WAAA,CAAY,UAAiD,EAAA;;QAsF7D,IAAA,CAAA,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;QArF5B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC,MAAM,CAAC,OAAO,CA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f;IACJ;AACA,IAAA,OAAO,GAAG;AACd;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/GroupAnimationWithThen.mjs b/node_modules/motion-dom/dist/es/animation/GroupAnimationWithThen.mjs deleted file mode 100644 index 7d8a536..0000000 --- a/node_modules/motion-dom/dist/es/animation/GroupAnimationWithThen.mjs +++ /dev/null @@ -1,10 +0,0 @@ -import { GroupAnimation } from './GroupAnimation.mjs'; - -class GroupAnimationWithThen extends GroupAnimation { - then(onResolve, _onReject) { - return this.finished.finally(onResolve).then(() => { }); - } -} - -export { GroupAnimationWithThen }; -//# sourceMappingURL=GroupAnimationWithThen.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/GroupAnimationWithThen.mjs.map b/node_modules/motion-dom/dist/es/animation/GroupAnimationWithThen.mjs.map deleted file mode 100644 index 7dc17fa..0000000 --- a/node_modules/motion-dom/dist/es/animation/GroupAnimationWithThen.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"GroupAnimationWithThen.mjs","sources":["../../../src/animation/GroupAnimationWithThen.ts"],"sourcesContent":["import { GroupAnimation } from \"./GroupAnimation\"\nimport { AnimationPlaybackControlsWithThen } from \"./types\"\n\nexport class GroupAnimationWithThen\n extends GroupAnimation\n implements AnimationPlaybackControlsWithThen\n{\n then(onResolve: VoidFunction, _onReject?: VoidFunction) {\n return this.finished.finally(onResolve).then(() => {})\n }\n}\n"],"names":[],"mappings":";;AAGM,MAAO,sBACT,SAAQ,cAAc,CAAA;IAGtB,IAAI,CAAC,SAAuB,EAAE,SAAwB,EAAA;AAClD,QAAA,OAAO,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,MAAK,EAAE,CAAC,CAAC;IAC1D;AACH;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/JSAnimation.mjs b/node_modules/motion-dom/dist/es/animation/JSAnimation.mjs deleted file mode 100644 index 8f8ee03..0000000 --- a/node_modules/motion-dom/dist/es/animation/JSAnimation.mjs +++ /dev/null @@ -1,387 +0,0 @@ -import { invariant, pipe, clamp, millisecondsToSeconds, secondsToMilliseconds } from 'motion-utils'; -import { time } from '../frameloop/sync-time.mjs'; -import { mix } from '../utils/mix/index.mjs'; -import { frameloopDriver } from './drivers/frame.mjs'; -import { inertia } from './generators/inertia.mjs'; -import { keyframes } from './generators/keyframes.mjs'; -import { calcGeneratorDuration } from './generators/utils/calc-duration.mjs'; -import { getGeneratorVelocity } from './generators/utils/velocity.mjs'; -import { getFinalKeyframe } from './keyframes/get-final.mjs'; -import { replaceTransitionType } from './utils/replace-transition-type.mjs'; -import { WithPromise } from './utils/WithPromise.mjs'; - -const percentToProgress = (percent) => percent / 100; -class JSAnimation extends WithPromise { - constructor(options) { - super(); - this.state = "idle"; - this.startTime = null; - this.isStopped = false; - /** - * The current time of the animation. - */ - this.currentTime = 0; - /** - * The time at which the animation was paused. - */ - this.holdTime = null; - /** - * Playback speed as a factor. 0 would be stopped, -1 reverse and 2 double speed. - */ - this.playbackSpeed = 1; - /** - * Reusable state object for the delay phase to avoid - * allocating a new object every frame. - */ - this.delayState = { - done: false, - value: undefined, - }; - /** - * This method is bound to the instance to fix a pattern where - * animation.stop is returned as a reference from a useEffect. - */ - this.stop = () => { - const { motionValue } = this.options; - if (motionValue && motionValue.updatedAt !== time.now()) { - this.tick(time.now()); - } - this.isStopped = true; - if (this.state === "idle") - return; - this.teardown(); - this.options.onStop?.(); - }; - this.options = options; - this.initAnimation(); - this.play(); - if (options.autoplay === false) - this.pause(); - } - initAnimation() { - const { options } = this; - replaceTransitionType(options); - const { type = keyframes, repeat = 0, repeatDelay = 0, repeatType, velocity = 0, } = options; - let { keyframes: keyframes$1 } = options; - const generatorFactory = type || keyframes; - if (process.env.NODE_ENV !== "production" && - generatorFactory !== keyframes) { - invariant(keyframes$1.length <= 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${keyframes$1}`, "spring-two-frames"); - } - if (generatorFactory !== keyframes && - typeof keyframes$1[0] !== "number") { - this.mixKeyframes = pipe(percentToProgress, mix(keyframes$1[0], keyframes$1[1])); - keyframes$1 = [0, 100]; - } - const generator = generatorFactory({ ...options, keyframes: keyframes$1 }); - /** - * If we have a mirror repeat type we need to create a second generator that outputs the - * mirrored (not reversed) animation and later ping pong between the two generators. - */ - if (repeatType === "mirror") { - this.mirroredGenerator = generatorFactory({ - ...options, - keyframes: [...keyframes$1].reverse(), - velocity: -velocity, - }); - } - /** - * If duration is undefined and we have repeat options, - * we need to calculate a duration from the generator. - * - * We set it to the generator itself to cache the duration. - * Any timeline resolver will need to have already precalculated - * the duration by this step. - */ - if (generator.calculatedDuration === null) { - generator.calculatedDuration = calcGeneratorDuration(generator); - } - const { calculatedDuration } = generator; - this.calculatedDuration = calculatedDuration; - this.resolvedDuration = calculatedDuration + repeatDelay; - this.totalDuration = this.resolvedDuration * (repeat + 1) - repeatDelay; - this.generator = generator; - } - updateTime(timestamp) { - const animationTime = Math.round(timestamp - this.startTime) * this.playbackSpeed; - // Update currentTime - if (this.holdTime !== null) { - this.currentTime = this.holdTime; - } - else { - // Rounding the time because floating point arithmetic is not always accurate, e.g. 3000.367 - 1000.367 = - // 2000.0000000000002. This is a problem when we are comparing the currentTime with the duration, for - // example. - this.currentTime = animationTime; - } - } - tick(timestamp, sample = false) { - const { generator, totalDuration, mixKeyframes, mirroredGenerator, resolvedDuration, calculatedDuration, } = this; - if (this.startTime === null) - return generator.next(0); - const { delay = 0, keyframes, repeat, repeatType, repeatDelay, type, onUpdate, finalKeyframe, } = this.options; - /** - * requestAnimationFrame timestamps can come through as lower than - * the startTime as set by performance.now(). Here we prevent this, - * though in the future it could be possible to make setting startTime - * a pending operation that gets resolved here. - */ - if (this.speed > 0) { - this.startTime = Math.min(this.startTime, timestamp); - } - else if (this.speed < 0) { - this.startTime = Math.min(timestamp - totalDuration / this.speed, this.startTime); - } - if (sample) { - this.currentTime = timestamp; - } - else { - this.updateTime(timestamp); - } - // Rebase on delay - const timeWithoutDelay = this.currentTime - delay * (this.playbackSpeed >= 0 ? 1 : -1); - const isInDelayPhase = this.playbackSpeed >= 0 - ? timeWithoutDelay < 0 - : timeWithoutDelay > totalDuration; - this.currentTime = Math.max(timeWithoutDelay, 0); - // If this animation has finished, set the current time to the total duration. - if (this.state === "finished" && this.holdTime === null) { - this.currentTime = totalDuration; - } - let elapsed = this.currentTime; - let frameGenerator = generator; - if (repeat) { - /** - * Get the current progress (0-1) of the animation. If t is > - * than duration we'll get values like 2.5 (midway through the - * third iteration) - */ - const progress = Math.min(this.currentTime, totalDuration) / resolvedDuration; - /** - * Get the current iteration (0 indexed). For instance the floor of - * 2.5 is 2. - */ - let currentIteration = Math.floor(progress); - /** - * Get the current progress of the iteration by taking the remainder - * so 2.5 is 0.5 through iteration 2 - */ - let iterationProgress = progress % 1.0; - /** - * If iteration progress is 1 we count that as the end - * of the previous iteration. - */ - if (!iterationProgress && progress >= 1) { - iterationProgress = 1; - } - iterationProgress === 1 && currentIteration--; - currentIteration = Math.min(currentIteration, repeat + 1); - /** - * Reverse progress if we're not running in "normal" direction - */ - const isOddIteration = Boolean(currentIteration % 2); - if (isOddIteration) { - if (repeatType === "reverse") { - iterationProgress = 1 - iterationProgress; - if (repeatDelay) { - iterationProgress -= repeatDelay / resolvedDuration; - } - } - else if (repeatType === "mirror") { - frameGenerator = mirroredGenerator; - } - } - elapsed = clamp(0, 1, iterationProgress) * resolvedDuration; - } - /** - * If we're in negative time, set state as the initial keyframe. - * This prevents delay: x, duration: 0 animations from finishing - * instantly. - */ - let state; - if (isInDelayPhase) { - this.delayState.value = keyframes[0]; - state = this.delayState; - } - else { - state = frameGenerator.next(elapsed); - } - if (mixKeyframes && !isInDelayPhase) { - state.value = mixKeyframes(state.value); - } - let { done } = state; - if (!isInDelayPhase && calculatedDuration !== null) { - done = - this.playbackSpeed >= 0 - ? this.currentTime >= totalDuration - : this.currentTime <= 0; - } - const isAnimationFinished = this.holdTime === null && - (this.state === "finished" || (this.state === "running" && done)); - // TODO: The exception for inertia could be cleaner here - if (isAnimationFinished && type !== inertia) { - state.value = getFinalKeyframe(keyframes, this.options, finalKeyframe, this.speed); - } - if (onUpdate) { - onUpdate(state.value); - } - if (isAnimationFinished) { - this.finish(); - } - return state; - } - /** - * Allows the returned animation to be awaited or promise-chained. Currently - * resolves when the animation finishes at all but in a future update could/should - * reject if its cancels. - */ - then(resolve, reject) { - return this.finished.then(resolve, reject); - } - get duration() { - return millisecondsToSeconds(this.calculatedDuration); - } - get iterationDuration() { - const { delay = 0 } = this.options || {}; - return this.duration + millisecondsToSeconds(delay); - } - get time() { - return millisecondsToSeconds(this.currentTime); - } - set time(newTime) { - newTime = secondsToMilliseconds(newTime); - this.currentTime = newTime; - if (this.startTime === null || - this.holdTime !== null || - this.playbackSpeed === 0) { - this.holdTime = newTime; - } - else if (this.driver) { - this.startTime = this.driver.now() - newTime / this.playbackSpeed; - } - if (this.driver) { - this.driver.start(false); - } - else { - this.startTime = 0; - this.state = "paused"; - this.holdTime = newTime; - this.tick(newTime); - } - } - /** - * Returns the generator's velocity at the current time in units/second. - * Uses the analytical derivative when available (springs), avoiding - * the MotionValue's frame-dependent velocity estimation. - */ - getGeneratorVelocity() { - const t = this.currentTime; - if (t <= 0) - return this.options.velocity || 0; - if (this.generator.velocity) { - return this.generator.velocity(t); - } - // Fallback: finite difference - const current = this.generator.next(t).value; - return getGeneratorVelocity((s) => this.generator.next(s).value, t, current); - } - get speed() { - return this.playbackSpeed; - } - set speed(newSpeed) { - const hasChanged = this.playbackSpeed !== newSpeed; - if (hasChanged && this.driver) { - this.updateTime(time.now()); - } - this.playbackSpeed = newSpeed; - if (hasChanged && this.driver) { - this.time = millisecondsToSeconds(this.currentTime); - } - } - play() { - if (this.isStopped) - return; - const { driver = frameloopDriver, startTime } = this.options; - if (!this.driver) { - this.driver = driver((timestamp) => this.tick(timestamp)); - } - this.options.onPlay?.(); - const now = this.driver.now(); - if (this.state === "finished") { - this.updateFinished(); - this.startTime = now; - } - else if (this.holdTime !== null) { - this.startTime = now - this.holdTime; - } - else if (!this.startTime) { - this.startTime = startTime ?? now; - } - if (this.state === "finished" && this.speed < 0) { - this.startTime += this.calculatedDuration; - } - this.holdTime = null; - /** - * Set playState to running only after we've used it in - * the previous logic. - */ - this.state = "running"; - this.driver.start(); - } - pause() { - this.state = "paused"; - this.updateTime(time.now()); - this.holdTime = this.currentTime; - } - complete() { - if (this.state !== "running") { - this.play(); - } - this.state = "finished"; - this.holdTime = null; - } - finish() { - this.notifyFinished(); - this.teardown(); - this.state = "finished"; - this.options.onComplete?.(); - } - cancel() { - this.holdTime = null; - this.startTime = 0; - this.tick(0); - this.teardown(); - this.options.onCancel?.(); - } - teardown() { - this.state = "idle"; - this.stopDriver(); - this.startTime = this.holdTime = null; - } - stopDriver() { - if (!this.driver) - return; - this.driver.stop(); - this.driver = undefined; - } - sample(sampleTime) { - this.startTime = 0; - return this.tick(sampleTime, true); - } - attachTimeline(timeline) { - if (this.options.allowFlatten) { - this.options.type = "keyframes"; - this.options.ease = "linear"; - this.initAnimation(); - } - this.driver?.stop(); - return timeline.observe(this); - } -} -// Legacy function support -function animateValue(options) { - return new JSAnimation(options); -} - -export { JSAnimation, animateValue }; -//# sourceMappingURL=JSAnimation.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/JSAnimation.mjs.map b/node_modules/motion-dom/dist/es/animation/JSAnimation.mjs.map deleted file mode 100644 index b2c52df..0000000 --- a/node_modules/motion-dom/dist/es/animation/JSAnimation.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"JSAnimation.mjs","sources":["../../../src/animation/JSAnimation.ts"],"sourcesContent":["import {\n clamp,\n invariant,\n millisecondsToSeconds,\n pipe,\n secondsToMilliseconds,\n} from \"motion-utils\"\nimport { time } from \"../frameloop/sync-time\"\nimport { mix } from \"../utils/mix\"\nimport { Mixer } from \"../utils/mix/types\"\nimport { frameloopDriver } from \"./drivers/frame\"\nimport { DriverControls } from \"./drivers/types\"\nimport { inertia } from \"./generators/inertia\"\nimport { keyframes as keyframesGenerator } from \"./generators/keyframes\"\nimport { calcGeneratorDuration } from \"./generators/utils/calc-duration\"\nimport { getGeneratorVelocity } from \"./generators/utils/velocity\"\nimport { getFinalKeyframe } from \"./keyframes/get-final\"\nimport {\n AnimationPlaybackControlsWithThen,\n AnimationState,\n GeneratorFactory,\n KeyframeGenerator,\n TimelineWithFallback,\n ValueAnimationOptions,\n} from \"./types\"\nimport { replaceTransitionType } from \"./utils/replace-transition-type\"\nimport { WithPromise } from \"./utils/WithPromise\"\n\nconst percentToProgress = (percent: number) => percent / 100\n\nexport class JSAnimation\n extends WithPromise\n implements AnimationPlaybackControlsWithThen\n{\n state: AnimationPlayState = \"idle\"\n\n startTime: number | null = null\n\n /**\n * The driver that's controlling the animation loop. Normally this is a requestAnimationFrame loop\n * but in tests we can pass in a synchronous loop.\n */\n private driver?: DriverControls\n\n private isStopped = false\n\n private generator: KeyframeGenerator\n\n private calculatedDuration: number\n\n private resolvedDuration: number\n\n private totalDuration: number\n\n private options: ValueAnimationOptions\n\n /**\n * The current time of the animation.\n */\n private currentTime: number = 0\n\n /**\n * The time at which the animation was paused.\n */\n private holdTime: number | null = null\n\n /**\n * Playback speed as a factor. 0 would be stopped, -1 reverse and 2 double speed.\n */\n private playbackSpeed = 1\n\n /*\n * If our generator doesn't support mixing numbers, we need to replace keyframes with\n * [0, 100] and then make a function that maps that to the actual keyframes.\n *\n * 100 is chosen instead of 1 as it works nicer with spring animations.\n */\n private mixKeyframes: Mixer | undefined\n\n private mirroredGenerator: KeyframeGenerator | undefined\n\n /**\n * Reusable state object for the delay phase to avoid\n * allocating a new object every frame.\n */\n private delayState: AnimationState = {\n done: false,\n value: undefined as unknown as T,\n }\n\n constructor(options: ValueAnimationOptions) {\n super()\n\n this.options = options\n this.initAnimation()\n this.play()\n\n if (options.autoplay === false) this.pause()\n }\n\n initAnimation() {\n const { options } = this\n\n replaceTransitionType(options)\n\n const {\n type = keyframesGenerator,\n repeat = 0,\n repeatDelay = 0,\n repeatType,\n velocity = 0,\n } = options\n let { keyframes } = options\n\n const generatorFactory =\n (type as GeneratorFactory) || keyframesGenerator\n\n if (\n process.env.NODE_ENV !== \"production\" &&\n generatorFactory !== keyframesGenerator\n ) {\n invariant(\n keyframes.length <= 2,\n `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${keyframes}`,\n \"spring-two-frames\"\n )\n }\n\n if (\n generatorFactory !== keyframesGenerator &&\n typeof keyframes[0] !== \"number\"\n ) {\n this.mixKeyframes = pipe(\n percentToProgress,\n mix(keyframes[0], keyframes[1])\n ) as (t: number) => T\n\n keyframes = [0 as T, 100 as T]\n }\n\n const generator = generatorFactory({ ...options, keyframes })\n\n /**\n * If we have a mirror repeat type we need to create a second generator that outputs the\n * mirrored (not reversed) animation and later ping pong between the two generators.\n */\n if (repeatType === \"mirror\") {\n this.mirroredGenerator = generatorFactory({\n ...options,\n keyframes: [...keyframes].reverse(),\n velocity: -velocity,\n })\n }\n\n /**\n * If duration is undefined and we have repeat options,\n * we need to calculate a duration from the generator.\n *\n * We set it to the generator itself to cache the duration.\n * Any timeline resolver will need to have already precalculated\n * the duration by this step.\n */\n if (generator.calculatedDuration === null) {\n generator.calculatedDuration = calcGeneratorDuration(generator)\n }\n\n const { calculatedDuration } = generator\n this.calculatedDuration = calculatedDuration\n this.resolvedDuration = calculatedDuration + repeatDelay\n this.totalDuration = this.resolvedDuration * (repeat + 1) - repeatDelay\n this.generator = generator\n }\n\n updateTime(timestamp: number) {\n const animationTime =\n Math.round(timestamp - this.startTime!) * this.playbackSpeed\n\n // Update currentTime\n if (this.holdTime !== null) {\n this.currentTime = this.holdTime\n } else {\n // Rounding the time because floating point arithmetic is not always accurate, e.g. 3000.367 - 1000.367 =\n // 2000.0000000000002. This is a problem when we are comparing the currentTime with the duration, for\n // example.\n this.currentTime = animationTime\n }\n }\n\n tick(timestamp: number, sample = false) {\n const {\n generator,\n totalDuration,\n mixKeyframes,\n mirroredGenerator,\n resolvedDuration,\n calculatedDuration,\n } = this\n\n if (this.startTime === null) return generator.next(0)\n\n const {\n delay = 0,\n keyframes,\n repeat,\n repeatType,\n repeatDelay,\n type,\n onUpdate,\n finalKeyframe,\n } = this.options\n\n /**\n * requestAnimationFrame timestamps can come through as lower than\n * the startTime as set by performance.now(). Here we prevent this,\n * though in the future it could be possible to make setting startTime\n * a pending operation that gets resolved here.\n */\n if (this.speed > 0) {\n this.startTime = Math.min(this.startTime, timestamp)\n } else if (this.speed < 0) {\n this.startTime = Math.min(\n timestamp - totalDuration / this.speed,\n this.startTime\n )\n }\n\n if (sample) {\n this.currentTime = timestamp\n } else {\n this.updateTime(timestamp)\n }\n\n // Rebase on delay\n const timeWithoutDelay =\n this.currentTime - delay * (this.playbackSpeed >= 0 ? 1 : -1)\n const isInDelayPhase =\n this.playbackSpeed >= 0\n ? timeWithoutDelay < 0\n : timeWithoutDelay > totalDuration\n this.currentTime = Math.max(timeWithoutDelay, 0)\n\n // If this animation has finished, set the current time to the total duration.\n if (this.state === \"finished\" && this.holdTime === null) {\n this.currentTime = totalDuration\n }\n\n let elapsed = this.currentTime\n let frameGenerator = generator\n\n if (repeat) {\n /**\n * Get the current progress (0-1) of the animation. If t is >\n * than duration we'll get values like 2.5 (midway through the\n * third iteration)\n */\n const progress =\n Math.min(this.currentTime, totalDuration) / resolvedDuration\n\n /**\n * Get the current iteration (0 indexed). For instance the floor of\n * 2.5 is 2.\n */\n let currentIteration = Math.floor(progress)\n\n /**\n * Get the current progress of the iteration by taking the remainder\n * so 2.5 is 0.5 through iteration 2\n */\n let iterationProgress = progress % 1.0\n\n /**\n * If iteration progress is 1 we count that as the end\n * of the previous iteration.\n */\n if (!iterationProgress && progress >= 1) {\n iterationProgress = 1\n }\n\n iterationProgress === 1 && currentIteration--\n\n currentIteration = Math.min(currentIteration, repeat + 1)\n\n /**\n * Reverse progress if we're not running in \"normal\" direction\n */\n\n const isOddIteration = Boolean(currentIteration % 2)\n if (isOddIteration) {\n if (repeatType === \"reverse\") {\n iterationProgress = 1 - iterationProgress\n if (repeatDelay) {\n iterationProgress -= repeatDelay / resolvedDuration\n }\n } else if (repeatType === \"mirror\") {\n frameGenerator = mirroredGenerator!\n }\n }\n\n elapsed = clamp(0, 1, iterationProgress) * resolvedDuration\n }\n\n /**\n * If we're in negative time, set state as the initial keyframe.\n * This prevents delay: x, duration: 0 animations from finishing\n * instantly.\n */\n let state: AnimationState\n if (isInDelayPhase) {\n this.delayState.value = keyframes[0]\n state = this.delayState\n } else {\n state = frameGenerator.next(elapsed)\n }\n\n if (mixKeyframes && !isInDelayPhase) {\n state.value = mixKeyframes(state.value as number)\n }\n\n let { done } = state\n\n if (!isInDelayPhase && calculatedDuration !== null) {\n done =\n this.playbackSpeed >= 0\n ? this.currentTime >= totalDuration\n : this.currentTime <= 0\n }\n\n const isAnimationFinished =\n this.holdTime === null &&\n (this.state === \"finished\" || (this.state === \"running\" && done))\n\n // TODO: The exception for inertia could be cleaner here\n if (isAnimationFinished && type !== inertia) {\n state.value = getFinalKeyframe(\n keyframes,\n this.options,\n finalKeyframe,\n this.speed\n )\n }\n\n if (onUpdate) {\n onUpdate(state.value)\n }\n\n if (isAnimationFinished) {\n this.finish()\n }\n\n return state\n }\n\n /**\n * Allows the returned animation to be awaited or promise-chained. Currently\n * resolves when the animation finishes at all but in a future update could/should\n * reject if its cancels.\n */\n then(resolve: VoidFunction, reject?: VoidFunction) {\n return this.finished.then(resolve, reject)\n }\n\n get duration() {\n return millisecondsToSeconds(this.calculatedDuration)\n }\n\n get iterationDuration() {\n const { delay = 0 } = this.options || {}\n return this.duration + millisecondsToSeconds(delay)\n }\n\n get time() {\n return millisecondsToSeconds(this.currentTime)\n }\n\n set time(newTime: number) {\n newTime = secondsToMilliseconds(newTime)\n this.currentTime = newTime\n\n if (\n this.startTime === null ||\n this.holdTime !== null ||\n this.playbackSpeed === 0\n ) {\n this.holdTime = newTime\n } else if (this.driver) {\n this.startTime = this.driver.now() - newTime / this.playbackSpeed\n }\n\n if (this.driver) {\n this.driver.start(false)\n } else {\n this.startTime = 0\n this.state = \"paused\"\n this.holdTime = newTime\n this.tick(newTime)\n }\n }\n\n /**\n * Returns the generator's velocity at the current time in units/second.\n * Uses the analytical derivative when available (springs), avoiding\n * the MotionValue's frame-dependent velocity estimation.\n */\n getGeneratorVelocity(): number {\n const t = this.currentTime\n if (t <= 0) return this.options.velocity || 0\n\n if (this.generator.velocity) {\n return this.generator.velocity(t)\n }\n\n // Fallback: finite difference\n const current = this.generator.next(t).value as number\n return getGeneratorVelocity(\n (s) => this.generator.next(s).value as number,\n t,\n current\n )\n }\n\n get speed() {\n return this.playbackSpeed\n }\n\n set speed(newSpeed: number) {\n const hasChanged = this.playbackSpeed !== newSpeed\n\n if (hasChanged && this.driver) {\n this.updateTime(time.now())\n }\n\n this.playbackSpeed = newSpeed\n\n if (hasChanged && this.driver) {\n this.time = millisecondsToSeconds(this.currentTime)\n }\n }\n\n play() {\n if (this.isStopped) return\n\n const { driver = frameloopDriver, startTime } = this.options\n\n if (!this.driver) {\n this.driver = driver((timestamp) => this.tick(timestamp))\n }\n\n this.options.onPlay?.()\n\n const now = this.driver.now()\n\n if (this.state === \"finished\") {\n this.updateFinished()\n this.startTime = now\n } else if (this.holdTime !== null) {\n this.startTime = now - this.holdTime\n } else if (!this.startTime) {\n this.startTime = startTime ?? now\n }\n\n if (this.state === \"finished\" && this.speed < 0) {\n this.startTime += this.calculatedDuration\n }\n\n this.holdTime = null\n\n /**\n * Set playState to running only after we've used it in\n * the previous logic.\n */\n this.state = \"running\"\n\n this.driver.start()\n }\n\n pause() {\n this.state = \"paused\"\n this.updateTime(time.now())\n this.holdTime = this.currentTime\n }\n\n /**\n * This method is bound to the instance to fix a pattern where\n * animation.stop is returned as a reference from a useEffect.\n */\n stop = () => {\n const { motionValue } = this.options\n if (motionValue && motionValue.updatedAt !== time.now()) {\n this.tick(time.now())\n }\n\n this.isStopped = true\n if (this.state === \"idle\") return\n this.teardown()\n this.options.onStop?.()\n }\n\n complete() {\n if (this.state !== \"running\") {\n this.play()\n }\n\n this.state = \"finished\"\n this.holdTime = null\n }\n\n finish() {\n this.notifyFinished()\n this.teardown()\n this.state = \"finished\"\n\n this.options.onComplete?.()\n }\n\n cancel() {\n this.holdTime = null\n this.startTime = 0\n this.tick(0)\n this.teardown()\n this.options.onCancel?.()\n }\n\n private teardown() {\n this.state = \"idle\"\n this.stopDriver()\n this.startTime = this.holdTime = null\n }\n\n private stopDriver() {\n if (!this.driver) return\n this.driver.stop()\n this.driver = undefined\n }\n\n sample(sampleTime: number): AnimationState {\n this.startTime = 0\n return this.tick(sampleTime, true)\n }\n\n attachTimeline(timeline: TimelineWithFallback): VoidFunction {\n if (this.options.allowFlatten) {\n this.options.type = \"keyframes\"\n this.options.ease = \"linear\"\n this.initAnimation()\n }\n\n this.driver?.stop()\n return timeline.observe(this)\n }\n}\n\n// Legacy function support\nexport function animateValue(\n options: ValueAnimationOptions\n) {\n return new JSAnimation(options)\n}\n"],"names":["keyframesGenerator","keyframes"],"mappings":";;;;;;;;;;;;AA4BA,MAAM,iBAAiB,GAAG,CAAC,OAAe,KAAK,OAAO,GAAG,GAAG;AAEtD,MAAO,WACT,SAAQ,WAAW,CAAA;AA2DnB,IAAA,WAAA,CAAY,OAAiC,EAAA;AACzC,QAAA,KAAK,EAAE;QAzDX,IAAA,CAAA,KAAK,GAAuB,MAAM;QAElC,IAAA,CAAA,SAAS,GAAkB,IAAI;QAQvB,IAAA,CAAA,SAAS,GAAG,KAAK;AAYzB;;AAEG;QACK,IAAA,CAAA,WAAW,GAAW,CAAC;AAE/B;;AAEG;QACK,IAAA,CAAA,QAAQ,GAAkB,IAAI;AAEtC;;AAEG;QACK,IAAA,CAAA,aAAa,GAAG,CAAC;AAYzB;;;AAGG;AACK,QAAA,IAAA,CAAA,UAAU,GAAsB;AACpC,YAAA,IAAI,EAAE,KAAK;AACX,YAAA,KAAK,EAAE,SAAyB;SACnC;AAyY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I,EAAE;AACnB,QAAA,OAAO,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC;IACjC;AACH;AAED;AACM,SAAU,YAAY,CACxB,OAAiC,EAAA;AAEjC,IAAA,OAAO,IAAI,WAAW,CAAC,OAAO,CAAC;AACnC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/NativeAnimation.mjs b/node_modules/motion-dom/dist/es/animation/NativeAnimation.mjs deleted file mode 100644 index aecdd88..0000000 --- a/node_modules/motion-dom/dist/es/animation/NativeAnimation.mjs +++ /dev/null @@ -1,179 +0,0 @@ -import { invariant, millisecondsToSeconds, secondsToMilliseconds, noop } from 'motion-utils'; -import { setStyle } from '../render/dom/style-set.mjs'; -import { supportsScrollTimeline } from '../utils/supports/scroll-timeline.mjs'; -import { getFinalKeyframe } from './keyframes/get-final.mjs'; -import { WithPromise } from './utils/WithPromise.mjs'; -import { startWaapiAnimation } from './waapi/start-waapi-animation.mjs'; -import { applyGeneratorOptions } from './waapi/utils/apply-generator.mjs'; - -/** - * NativeAnimation implements AnimationPlaybackControls for the browser's Web Animations API. - */ -class NativeAnimation extends WithPromise { - constructor(options) { - super(); - this.finishedTime = null; - this.isStopped = false; - /** - * Tracks a manually-set start time that takes precedence over WAAPI's - * dynamic startTime. This is cleared when play() or time setter is called, - * allowing WAAPI to take over timing. - */ - this.manualStartTime = null; - if (!options) - return; - const { element, name, keyframes, pseudoElement, allowFlatten = false, finalKeyframe, onComplete, } = options; - this.isPseudoElement = Boolean(pseudoElement); - this.allowFlatten = allowFlatten; - this.options = options; - invariant(typeof options.type !== "string", `Mini animate() doesn't support "type" as a string.`, "mini-spring"); - const transition = applyGeneratorOptions(options); - this.animation = startWaapiAnimation(element, name, keyframes, transition, pseudoElement); - if (transition.autoplay === false) { - this.animation.pause(); - } - this.animation.onfinish = () => { - this.finishedTime = this.time; - if (!pseudoElement) { - const keyframe = getFinalKeyframe(keyframes, this.options, finalKeyframe, this.speed); - if (this.updateMotionValue) { - this.updateMotionValue(keyframe); - } - /** - * If we can, we want to commit the final style as set by the user, - * rather than the computed keyframe value supplied by the animation. - * We always do this, even when a motion value is present, to prevent - * a visual flash in Firefox where the WAAPI animation's fill is removed - * during cancel() before the scheduled render can apply the correct value. - */ - setStyle(element, name, keyframe); - this.animation.cancel(); - } - onComplete?.(); - this.notifyFinished(); - }; - } - play() { - if (this.isStopped) - return; - this.manualStartTime = null; - this.animation.play(); - if (this.state === "finished") { - this.updateFinished(); - } - } - pause() { - this.animation.pause(); - } - complete() { - this.animation.finish?.(); - } - cancel() { - try { - this.animation.cancel(); - } - catch (e) { } - } - stop() { - if (this.isStopped) - return; - this.isStopped = true; - const { state } = this; - if (state === "idle" || state === "finished") { - return; - } - if (this.updateMotionValue) { - this.updateMotionValue(); - } - else { - this.commitStyles(); - } - if (!this.isPseudoElement) - this.cancel(); - } - /** - * WAAPI doesn't natively have any interruption capabilities. - * - * In this method, we commit styles back to the DOM before cancelling - * the animation. - * - * This is designed to be overridden by NativeAnimationExtended, which - * will create a renderless JS animation and sample it twice to calculate - * its current value, "previous" value, and therefore allow - * Motion to also correctly calculate velocity for any subsequent animation - * while deferring the commit until the next animation frame. - */ - commitStyles() { - const element = this.options?.element; - if (!this.isPseudoElement && element?.isConnected) { - this.animation.commitStyles?.(); - } - } - get duration() { - const duration = this.animation.effect?.getComputedTiming?.().duration || 0; - return millisecondsToSeconds(Number(duration)); - } - get iterationDuration() { - const { delay = 0 } = this.options || {}; - return this.duration + millisecondsToSeconds(delay); - } - get time() { - return millisecondsToSeconds(Number(this.animation.currentTime) || 0); - } - set time(newTime) { - const wasFinished = this.finishedTime !== null; - this.manualStartTime = null; - this.finishedTime = null; - this.animation.currentTime = secondsToMilliseconds(newTime); - if (wasFinished) { - this.animation.pause(); - } - } - /** - * The playback speed of the animation. - * 1 = normal speed, 2 = double speed, 0.5 = half speed. - */ - get speed() { - return this.animation.playbackRate; - } - set speed(newSpeed) { - // Allow backwards playback after finishing - if (newSpeed < 0) - this.finishedTime = null; - this.animation.playbackRate = newSpeed; - } - get state() { - return this.finishedTime !== null - ? "finished" - : this.animation.playState; - } - get startTime() { - return this.manualStartTime ?? Number(this.animation.startTime); - } - set startTime(newStartTime) { - this.manualStartTime = this.animation.startTime = newStartTime; - } - /** - * Attaches a timeline to the animation, for instance the `ScrollTimeline`. - */ - attachTimeline({ timeline, rangeStart, rangeEnd, observe, }) { - if (this.allowFlatten) { - this.animation.effect?.updateTiming({ easing: "linear" }); - } - this.animation.onfinish = null; - if (timeline && supportsScrollTimeline()) { - this.animation.timeline = timeline; - if (rangeStart) - this.animation.rangeStart = rangeStart; - if (rangeEnd) - this.animation.rangeEnd = rangeEnd; - return noop; - } - else { - return observe(this); - } - } -} - -export { NativeAnimation }; -//# sourceMappingURL=NativeAnimation.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/NativeAnimation.mjs.map b/node_modules/motion-dom/dist/es/animation/NativeAnimation.mjs.map deleted file mode 100644 index e37651e..0000000 --- a/node_modules/motion-dom/dist/es/animation/NativeAnimation.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"NativeAnimation.mjs","sources":["../../../src/animation/NativeAnimation.ts"],"sourcesContent":["import {\n invariant,\n millisecondsToSeconds,\n noop,\n secondsToMilliseconds,\n} from \"motion-utils\"\nimport { setStyle } from \"../render/dom/style-set\"\nimport { supportsScrollTimeline } from \"../utils/supports/scroll-timeline\"\nimport { getFinalKeyframe } from \"./keyframes/get-final\"\nimport {\n AnimationPlaybackControlsWithThen,\n AnyResolvedKeyframe,\n DOMValueAnimationOptions,\n TimelineWithFallback,\n} from \"./types\"\nimport { WithPromise } from \"./utils/WithPromise\"\nimport { startWaapiAnimation } from \"./waapi/start-waapi-animation\"\nimport { applyGeneratorOptions } from \"./waapi/utils/apply-generator\"\n\nexport interface NativeAnimationOptions\n extends DOMValueAnimationOptions {\n pseudoElement?: string\n startTime?: number\n}\n\n/**\n * NativeAnimation implements AnimationPlaybackControls for the browser's Web Animations API.\n */\nexport class NativeAnimation\n extends WithPromise\n implements AnimationPlaybackControlsWithThen\n{\n /**\n * The interfaced Web Animation API animation\n */\n protected animation: Animation\n\n protected finishedTime: number | null = null\n\n protected options: NativeAnimationOptions\n\n private allowFlatten: boolean\n\n private isStopped = false\n\n private isPseudoElement: boolean\n\n /**\n * Tracks a manually-set start time that takes precedence over WAAPI's\n * dynamic startTime. This is cleared when play() or time setter is called,\n * allowing WAAPI to take over timing.\n */\n protected manualStartTime: number | null = null\n\n constructor(options?: NativeAnimationOptions) {\n super()\n\n if (!options) return\n\n const {\n element,\n name,\n keyframes,\n pseudoElement,\n allowFlatten = false,\n finalKeyframe,\n onComplete,\n } = options as any\n\n this.isPseudoElement = Boolean(pseudoElement)\n\n this.allowFlatten = allowFlatten\n this.options = options\n\n invariant(\n typeof options.type !== \"string\",\n `Mini animate() doesn't support \"type\" as a string.`,\n \"mini-spring\"\n )\n\n const transition = applyGeneratorOptions(options)\n\n this.animation = startWaapiAnimation(\n element,\n name,\n keyframes,\n transition,\n pseudoElement\n )\n\n if (transition.autoplay === false) {\n this.animation.pause()\n }\n\n this.animation.onfinish = () => {\n this.finishedTime = this.time\n\n if (!pseudoElement) {\n const keyframe = getFinalKeyframe(\n keyframes as any,\n this.options as any,\n finalKeyframe,\n this.speed\n )\n if (this.updateMotionValue) {\n this.updateMotionValue(keyframe)\n }\n\n /**\n * If we can, we want to commit the final style as set by the user,\n * rather than the computed keyframe value supplied by the animation.\n * We always do this, even when a motion value is present, to prevent\n * a visual flash in Firefox where the WAAPI animation's fill is removed\n * during cancel() before the scheduled render can apply the correct value.\n */\n setStyle(element, name, keyframe)\n\n this.animation.cancel()\n }\n\n onComplete?.()\n this.notifyFinished()\n }\n }\n\n updateMotionValue?(value?: T): void\n\n play() {\n if (this.isStopped) return\n\n this.manualStartTime = null\n this.animation.play()\n\n if (this.state === \"finished\") {\n this.updateFinished()\n }\n }\n\n pause() {\n this.animation.pause()\n }\n\n complete() {\n this.animation.finish?.()\n }\n\n cancel() {\n try {\n this.animation.cancel()\n } catch (e) {}\n }\n\n stop() {\n if (this.isStopped) return\n this.isStopped = true\n const { state } = this\n\n if (state === \"idle\" || state === \"finished\") {\n return\n }\n\n if (this.updateMotionValue) {\n this.updateMotionValue()\n } else {\n this.commitStyles()\n }\n\n if (!this.isPseudoElement) this.cancel()\n }\n\n /**\n * WAAPI doesn't natively have any interruption capabilities.\n *\n * In this method, we commit styles back to the DOM before cancelling\n * the animation.\n *\n * This is designed to be overridden by NativeAnimationExtended, which\n * will create a renderless JS animation and sample it twice to calculate\n * its current value, \"previous\" value, and therefore allow\n * Motion to also correctly calculate velocity for any subsequent animation\n * while deferring the commit until the next animation frame.\n */\n protected commitStyles() {\n const element = this.options?.element\n if (!this.isPseudoElement && element?.isConnected) {\n this.animation.commitStyles?.()\n }\n }\n\n get duration() {\n const duration =\n this.animation.effect?.getComputedTiming?.().duration || 0\n\n return millisecondsToSeconds(Number(duration))\n }\n\n get iterationDuration() {\n const { delay = 0 } = this.options || {}\n return this.duration + millisecondsToSeconds(delay)\n }\n\n get time() {\n return millisecondsToSeconds(Number(this.animation.currentTime) || 0)\n }\n\n set time(newTime: number) {\n const wasFinished = this.finishedTime !== null\n this.manualStartTime = null\n this.finishedTime = null\n this.animation.currentTime = secondsToMilliseconds(newTime)\n\n if (wasFinished) {\n this.animation.pause()\n }\n }\n\n /**\n * The playback speed of the animation.\n * 1 = normal speed, 2 = double speed, 0.5 = half speed.\n */\n get speed() {\n return this.animation.playbackRate\n }\n\n set speed(newSpeed: number) {\n // Allow backwards playback after finishing\n if (newSpeed < 0) this.finishedTime = null\n\n this.animation.playbackRate = newSpeed\n }\n\n get state() {\n return this.finishedTime !== null\n ? \"finished\"\n : this.animation.playState\n }\n\n get startTime() {\n return this.manualStartTime ?? Number(this.animation.startTime)\n }\n\n set startTime(newStartTime: number) {\n this.manualStartTime = this.animation.startTime = newStartTime\n }\n\n /**\n * Attaches a timeline to the animation, for instance the `ScrollTimeline`.\n */\n attachTimeline({\n timeline,\n rangeStart,\n rangeEnd,\n observe,\n }: TimelineWithFallback): VoidFunction {\n if (this.allowFlatten) {\n this.animation.effect?.updateTiming({ easing: \"linear\" })\n }\n\n this.animation.onfinish = null\n\n if (timeline && supportsScrollTimeline()) {\n this.animation.timeline = timeline as any\n\n if (rangeStart) (this.animation as any).rangeStart = rangeStart\n if (rangeEnd) (this.animation as any).rangeEnd = rangeEnd\n\n return noop\n } else {\n return observe(this)\n }\n }\n}\n"],"names":[],"mappings":";;;;;;;;AAyBA;;AAEG;AACG,MAAO,eACT,SAAQ,WAAW,CAAA;AAyBnB,IAAA,WAAA,CAAY,OAAgC,EAAA;AACxC,QAAA,KAAK,EAAE;QAlBD,IAAA,CAAA,YAAY,GAAkB,IAAI;QAMpC,IAAA,CAAA,SAAS,GAAG,KAAK;AAIzB;;;;AAIG;QACO,IAAA,CAAA,eAAe,GAAkB,IAAI;AAK3C,QAAA,IAAI,CAAC,OAAO;YAAE;AAEd,QAAA,MAAM,EACF,OAAO,EACP,IAAI,EACJ,SAAS,EACT,aAAa,EACb,YAAY,GAAG,KAAK,EACpB,aAAa,EACb,UAAU,GACb,GAAG,OAAc;AAElB,QAAA,IAAI,CAAC,eAAe,GAAG,OAAO,CAAC,aAAa,CAAC;AAE7C,QAAA,IAAI,CAAC,YAAY,GAAG,YAAY;AAChC,QAAA,IAAI,CAAC,OAAO,GAAG,OAAO;AAEtB,QAAA,SAAS,CACL,OAAO,OAAO,CAAC,IAAI,KAAK,QAAQ,EAChC,CAAA,kDAAA,CAAoD,EACpD,aAAa,CAChB;AAED,QAAA,MAAM,UAAU,GAAG,qBAAqB,CAAC,OAAO,CAAC;AAEjD,QAAA,IAAI,CAAC,SAAS,GAAG,mBAAmB,CAChC,OAAO,EACP,IAAI,EACJ,SAAS,EACT,UAAU,EACV,aAAa,CAChB;AAED,QAAA,IAAI,UAAU,CAAC,QAAQ,KAAK,KAAK,EAAE;AAC/B,YAAA,IAAI,CAAC,SAAS,CA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BAAA,IAAI,CAAC,SAAiB,CAAC,UAAU,GAAG,UAAU;AAC/D,YAAA,IAAI,QAAQ;AAAG,gBAAA,IAAI,CAAC,SAAiB,CAAC,QAAQ,GAAG,QAAQ;AAEzD,YAAA,OAAO,IAAU;QACrB;aAAO;AACH,YAAA,OAAO,OAAO,CAAC,IAAI,CAAC;QACxB;IACJ;AACH;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/NativeAnimationExtended.mjs b/node_modules/motion-dom/dist/es/animation/NativeAnimationExtended.mjs deleted file mode 100644 index 06ece95..0000000 --- a/node_modules/motion-dom/dist/es/animation/NativeAnimationExtended.mjs +++ /dev/null @@ -1,88 +0,0 @@ -import { clamp } from 'motion-utils'; -import { time } from '../frameloop/sync-time.mjs'; -import { setStyle } from '../render/dom/style-set.mjs'; -import { JSAnimation } from './JSAnimation.mjs'; -import { NativeAnimation } from './NativeAnimation.mjs'; -import { replaceTransitionType } from './utils/replace-transition-type.mjs'; -import { replaceStringEasing } from './waapi/utils/unsupported-easing.mjs'; - -/** - * 10ms is chosen here as it strikes a balance between smooth - * results (more than one keyframe per frame at 60fps) and - * keyframe quantity. - */ -const sampleDelta = 10; //ms -class NativeAnimationExtended extends NativeAnimation { - constructor(options) { - /** - * The base NativeAnimation function only supports a subset - * of Motion easings, and WAAPI also only supports some - * easing functions via string/cubic-bezier definitions. - * - * This function replaces those unsupported easing functions - * with a JS easing function. This will later get compiled - * to a linear() easing function. - */ - replaceStringEasing(options); - /** - * Ensure we replace the transition type with a generator function - * before passing to WAAPI. - * - * TODO: Does this have a better home? It could be shared with - * JSAnimation. - */ - replaceTransitionType(options); - super(options); - /** - * Only set startTime when the animation should autoplay. - * Setting startTime on a paused WAAPI animation unpauses it - * (per the WAAPI spec), which breaks autoplay: false. - */ - if (options.startTime !== undefined && options.autoplay !== false) { - this.startTime = options.startTime; - } - this.options = options; - } - /** - * WAAPI doesn't natively have any interruption capabilities. - * - * Rather than read committed styles back out of the DOM, we can - * create a renderless JS animation and sample it twice to calculate - * its current value, "previous" value, and therefore allow - * Motion to calculate velocity for any subsequent animation. - */ - updateMotionValue(value) { - const { motionValue, onUpdate, onComplete, element, ...options } = this.options; - if (!motionValue) - return; - if (value !== undefined) { - motionValue.set(value); - return; - } - const sampleAnimation = new JSAnimation({ - ...options, - autoplay: false, - }); - /** - * Use wall-clock elapsed time for sampling. - * Under CPU load, WAAPI's currentTime may not reflect actual - * elapsed time, causing incorrect sampling and visual jumps. - */ - const sampleTime = Math.max(sampleDelta, time.now() - this.startTime); - const delta = clamp(0, sampleDelta, sampleTime - sampleDelta); - const current = sampleAnimation.sample(sampleTime).value; - /** - * Write the estimated value to inline style so it persists - * after cancel(), covering the async gap before the next - * animation starts. - */ - const { name } = this.options; - if (element && name) - setStyle(element, name, current); - motionValue.setWithVelocity(sampleAnimation.sample(Math.max(0, sampleTime - delta)).value, current, delta); - sampleAnimation.stop(); - } -} - -export { NativeAnimationExtended }; -//# sourceMappingURL=NativeAnimationExtended.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/NativeAnimationExtended.mjs.map b/node_modules/motion-dom/dist/es/animation/NativeAnimationExtended.mjs.map deleted file mode 100644 index 9b2fb9c..0000000 --- a/node_modules/motion-dom/dist/es/animation/NativeAnimationExtended.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"NativeAnimationExtended.mjs","sources":["../../../src/animation/NativeAnimationExtended.ts"],"sourcesContent":["import { clamp } from \"motion-utils\"\nimport { time } from \"../frameloop/sync-time\"\nimport { setStyle } from \"../render/dom/style-set\"\nimport { JSAnimation } from \"./JSAnimation\"\nimport { NativeAnimation, NativeAnimationOptions } from \"./NativeAnimation\"\nimport { AnyResolvedKeyframe, ValueAnimationOptions } from \"./types\"\nimport { replaceTransitionType } from \"./utils/replace-transition-type\"\nimport { replaceStringEasing } from \"./waapi/utils/unsupported-easing\"\n\nexport type NativeAnimationOptionsExtended =\n NativeAnimationOptions & ValueAnimationOptions & NativeAnimationOptions\n\n/**\n * 10ms is chosen here as it strikes a balance between smooth\n * results (more than one keyframe per frame at 60fps) and\n * keyframe quantity.\n */\nconst sampleDelta = 10 //ms\n\nexport class NativeAnimationExtended<\n T extends AnyResolvedKeyframe\n> extends NativeAnimation {\n options: NativeAnimationOptionsExtended\n\n constructor(options: NativeAnimationOptionsExtended) {\n /**\n * The base NativeAnimation function only supports a subset\n * of Motion easings, and WAAPI also only supports some\n * easing functions via string/cubic-bezier definitions.\n *\n * This function replaces those unsupported easing functions\n * with a JS easing function. This will later get compiled\n * to a linear() easing function.\n */\n replaceStringEasing(options)\n\n /**\n * Ensure we replace the transition type with a generator function\n * before passing to WAAPI.\n *\n * TODO: Does this have a better home? It could be shared with\n * JSAnimation.\n */\n replaceTransitionType(options)\n\n super(options)\n\n /**\n * Only set startTime when the animation should autoplay.\n * Setting startTime on a paused WAAPI animation unpauses it\n * (per the WAAPI spec), which breaks autoplay: false.\n */\n if (options.startTime !== undefined && options.autoplay !== false) {\n this.startTime = options.startTime\n }\n\n this.options = options\n }\n\n /**\n * WAAPI doesn't natively have any interruption capabilities.\n *\n * Rather than read committed styles back out of the DOM, we can\n * create a renderless JS animation and sample it twice to calculate\n * its current value, \"previous\" value, and therefore allow\n * Motion to calculate velocity for any subsequent animation.\n */\n updateMotionValue(value?: T) {\n const { motionValue, onUpdate, onComplete, element, ...options } =\n this.options\n\n if (!motionValue) return\n\n if (value !== undefined) {\n motionValue.set(value)\n return\n }\n\n const sampleAnimation = new JSAnimation({\n ...options,\n autoplay: false,\n })\n\n /**\n * Use wall-clock elapsed time for sampling.\n * Under CPU load, WAAPI's currentTime may not reflect actual\n * elapsed time, causing incorrect sampling and visual jumps.\n */\n const sampleTime = Math.max(sampleDelta, time.now() - this.startTime)\n const delta = clamp(0, sampleDelta, sampleTime - sampleDelta)\n const current = sampleAnimation.sample(sampleTime).value\n\n /**\n * Write the estimated value to inline style so it persists\n * after cancel(), covering the async gap before the next\n * animation starts.\n */\n const { name } = this.options\n if (element && name) setStyle(element, name, current)\n\n motionValue.setWithVelocity(\n sampleAnimation.sample(Math.max(0, sampleTime - delta)).value,\n current,\n delta\n )\n\n sampleAnimation.stop()\n }\n}\n"],"names":[],"mappings":";;;;;;;;AAYA;;;;AAIG;AACH,MAAM,WAAW,GAAG,EAAE,CAAA;AAEhB,MAAO,uBAEX,SAAQ,eAAkB,CAAA;AAGxB,IAAA,WAAA,CAAY,OAA0C,EAAA;AAClD;;;;;;;;AAQG;QACH,mBAAmB,CAAC,OAAO,CAAC;AAE5B;;;;;;AAMG;QACH,qBAAqB,CAAC,OAAO,CAAC;QAE9B,KAAK,CAAC,OAAO,CAAC;AAEd;;;;AAIG;AACH,QAAA,IAAI,OAAO,CAAC,SAAS,KAAK,SAAS,IAAI,OAAO,CAAC,QAAQ,KAAK,KAAK,EAAE;AAC/D,YAAA,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS;QACtC;AAEA,QAAA,IAAI,CAAC,OAAO,GAAG,OAAO;IAC1B;AAEA;;;;;;;AAOG;AACH,IAAA,iBAAiB,CAAC,KAAS,EAAA;AACvB,QAAA,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,OAAO,EAAE,GAC5D,IAAI,CAAC,OAAO;AAEhB,QAAA,IAAI,CAAC,WAAW;YAAE;AAElB,QAAA,IAAI,KAAK,KAAK,SAAS,EAAE;AACrB,YAAA,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC;YACtB;QACJ;AAEA,QAAA,MAAM,eAAe,GAAG,IAAI,WAAW,CAAC;AACpC,YAAA,GAAG,OAAO;AACV,YAAA,QAAQ,EAAE,KAAK;AAClB,SAAA,CAAC;AAEF;;;;AAIG;AACH,QAAA,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC;AACrE,QAAA,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,EAAE,WAAW,EAAE,UAAU,GAAG,WAAW,CAAC;QAC7D,MAAM,OAAO,GAAG,eAAe,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,KAAK;AAExD;;;;AAIG;AACH,QAAA,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC,OAAO;QAC7B,IAAI,OAAO,IAAI,IAAI;AAAE,YAAA,QAAQ,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC;QAErD,WAAW,CAAC,eAAe,CACvB,eAAe,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,UAAU,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,EAC7D,OAAO,EACP,KAAK,CACR;QAED,eAAe,CAAC,IAAI,EAAE;IAC1B;AACH;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/NativeAnimationWrapper.mjs b/node_modules/motion-dom/dist/es/animation/NativeAnimationWrapper.mjs deleted file mode 100644 index 797a913..0000000 --- a/node_modules/motion-dom/dist/es/animation/NativeAnimationWrapper.mjs +++ /dev/null @@ -1,15 +0,0 @@ -import { NativeAnimation } from './NativeAnimation.mjs'; - -class NativeAnimationWrapper extends NativeAnimation { - constructor(animation) { - super(); - this.animation = animation; - animation.onfinish = () => { - this.finishedTime = this.time; - this.notifyFinished(); - }; - } -} - -export { NativeAnimationWrapper }; -//# sourceMappingURL=NativeAnimationWrapper.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/NativeAnimationWrapper.mjs.map b/node_modules/motion-dom/dist/es/animation/NativeAnimationWrapper.mjs.map deleted file mode 100644 index 7990d58..0000000 --- a/node_modules/motion-dom/dist/es/animation/NativeAnimationWrapper.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"NativeAnimationWrapper.mjs","sources":["../../../src/animation/NativeAnimationWrapper.ts"],"sourcesContent":["import { NativeAnimation } from \"./NativeAnimation\"\nimport { AnyResolvedKeyframe } from \"./types\"\n\nexport class NativeAnimationWrapper<\n T extends AnyResolvedKeyframe\n> extends NativeAnimation {\n constructor(animation: Animation) {\n super()\n\n this.animation = animation\n animation.onfinish = () => {\n this.finishedTime = this.time\n this.notifyFinished()\n }\n }\n}\n"],"names":[],"mappings":";;AAGM,MAAO,sBAEX,SAAQ,eAAkB,CAAA;AACxB,IAAA,WAAA,CAAY,SAAoB,EAAA;AAC5B,QAAA,KAAK,EAAE;AAEP,QAAA,IAAI,CAAC,SAAS,GAAG,SAAS;AAC1B,QAAA,SAAS,CAAC,QAAQ,GAAG,MAAK;AACtB,YAAA,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,IAAI;YAC7B,IAAI,CAAC,cAAc,EAAE;AACzB,QAAA,CAAC;IACL;AACH;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/animate/single-value.mjs b/node_modules/motion-dom/dist/es/animation/animate/single-value.mjs deleted file mode 100644 index 45767f1..0000000 --- a/node_modules/motion-dom/dist/es/animation/animate/single-value.mjs +++ /dev/null @@ -1,12 +0,0 @@ -import { animateMotionValue } from '../interfaces/motion-value.mjs'; -import { motionValue } from '../../value/index.mjs'; -import { isMotionValue } from '../../value/utils/is-motion-value.mjs'; - -function animateSingleValue(value, keyframes, options) { - const motionValue$1 = isMotionValue(value) ? value : motionValue(value); - motionValue$1.start(animateMotionValue("", motionValue$1, keyframes, options)); - return motionValue$1.animation; -} - -export { animateSingleValue }; -//# sourceMappingURL=single-value.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/animate/single-value.mjs.map b/node_modules/motion-dom/dist/es/animation/animate/single-value.mjs.map deleted file mode 100644 index 64d11eb..0000000 --- a/node_modules/motion-dom/dist/es/animation/animate/single-value.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"single-value.mjs","sources":["../../../../src/animation/animate/single-value.ts"],"sourcesContent":["import { animateMotionValue } from \"../interfaces/motion-value\"\nimport type {\n AnimationPlaybackControlsWithThen,\n AnyResolvedKeyframe,\n UnresolvedValueKeyframe,\n ValueAnimationTransition,\n} from \"../types\"\nimport {\n motionValue as createMotionValue,\n MotionValue,\n} from \"../../value\"\nimport { isMotionValue } from \"../../value/utils/is-motion-value\"\n\nexport function animateSingleValue(\n value: MotionValue | V,\n keyframes: V | UnresolvedValueKeyframe[],\n options?: ValueAnimationTransition\n): AnimationPlaybackControlsWithThen {\n const motionValue = isMotionValue(value) ? value : createMotionValue(value)\n\n motionValue.start(animateMotionValue(\"\", motionValue, keyframes, options))\n\n return motionValue.animation!\n}\n"],"names":["motionValue","createMotionValue"],"mappings":";;;;SAagB,kBAAkB,CAC9B,KAAyB,EACzB,SAA2C,EAC3C,OAAkC,EAAA;AAElC,IAAA,MAAMA,aAAW,GAAG,aAAa,CAAC,KAAK,CAAC,GAAG,KAAK,GAAGC,WAAiB,CAAC,KAAK,CAAC;AAE3E,IAAAD,aAAW,CAAC,KAAK,CAAC,kBAAkB,CAAC,EAAE,EAAEA,aAAW,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;IAE1E,OAAOA,aAAW,CAAC,SAAU;AACjC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/drivers/frame.mjs b/node_modules/motion-dom/dist/es/animation/drivers/frame.mjs deleted file mode 100644 index 92eecd8..0000000 --- a/node_modules/motion-dom/dist/es/animation/drivers/frame.mjs +++ /dev/null @@ -1,18 +0,0 @@ -import { time } from '../../frameloop/sync-time.mjs'; -import { frameData, cancelFrame, frame } from '../../frameloop/frame.mjs'; - -const frameloopDriver = (update) => { - const passTimestamp = ({ timestamp }) => update(timestamp); - return { - start: (keepAlive = true) => frame.update(passTimestamp, keepAlive), - stop: () => cancelFrame(passTimestamp), - /** - * If we're processing this frame we can use the - * framelocked timestamp to keep things in sync. - */ - now: () => (frameData.isProcessing ? frameData.timestamp : time.now()), - }; -}; - -export { frameloopDriver }; -//# sourceMappingURL=frame.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/drivers/frame.mjs.map b/node_modules/motion-dom/dist/es/animation/drivers/frame.mjs.map deleted file mode 100644 index 99f6315..0000000 --- a/node_modules/motion-dom/dist/es/animation/drivers/frame.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"frame.mjs","sources":["../../../../src/animation/drivers/frame.ts"],"sourcesContent":["import { cancelFrame, frame, frameData } from \"../../frameloop\"\nimport { time } from \"../../frameloop/sync-time\"\nimport { FrameData } from \"../../frameloop/types\"\nimport { Driver } from \"./types\"\n\nexport const frameloopDriver: Driver = (update) => {\n const passTimestamp = ({ timestamp }: FrameData) => update(timestamp)\n\n return {\n start: (keepAlive = true) => frame.update(passTimestamp, keepAlive),\n stop: () => cancelFrame(passTimestamp),\n /**\n * If we're processing this frame we can use the\n * framelocked timestamp to keep things in sync.\n */\n now: () => (frameData.isProcessing ? frameData.timestamp : time.now()),\n }\n}\n"],"names":[],"mappings":";;;AAKO,MAAM,eAAe,GAAW,CAAC,MAAM,KAAI;AAC9C,IAAA,MAAM,aAAa,GAAG,CAAC,EAAE,SAAS,EAAa,KAAK,MAAM,CAAC,SAAS,CAAC;IAErE,OAAO;AACH,QAAA,KAAK,EAAE,CAAC,SAAS,GAAG,IAAI,KAAK,KAAK,CAAC,MAAM,CAAC,aAAa,EAAE,SAAS,CAAC;AACnE,QAAA,IAAI,EAAE,MAAM,WAAW,CAAC,aAAa,CAAC;AACtC;;;AAGG;QACH,GAAG,EAAE,OAAO,SAAS,CAAC,YAAY,GAAG,SAAS,CAAC,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;KACzE;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/generators/inertia.mjs b/node_modules/motion-dom/dist/es/animation/generators/inertia.mjs deleted file mode 100644 index dc6789a..0000000 --- a/node_modules/motion-dom/dist/es/animation/generators/inertia.mjs +++ /dev/null @@ -1,88 +0,0 @@ -import { spring } from './spring.mjs'; -import { getGeneratorVelocity } from './utils/velocity.mjs'; - -function inertia({ keyframes, velocity = 0.0, power = 0.8, timeConstant = 325, bounceDamping = 10, bounceStiffness = 500, modifyTarget, min, max, restDelta = 0.5, restSpeed, }) { - const origin = keyframes[0]; - const state = { - done: false, - value: origin, - }; - const isOutOfBounds = (v) => (min !== undefined && v < min) || (max !== undefined && v > max); - const nearestBoundary = (v) => { - if (min === undefined) - return max; - if (max === undefined) - return min; - return Math.abs(min - v) < Math.abs(max - v) ? min : max; - }; - let amplitude = power * velocity; - const ideal = origin + amplitude; - const target = modifyTarget === undefined ? ideal : modifyTarget(ideal); - /** - * If the target has changed we need to re-calculate the amplitude, otherwise - * the animation will start from the wrong position. - */ - if (target !== ideal) - amplitude = target - origin; - const calcDelta = (t) => -amplitude * Math.exp(-t / timeConstant); - const calcLatest = (t) => target + calcDelta(t); - const applyFriction = (t) => { - const delta = calcDelta(t); - const latest = calcLatest(t); - state.done = Math.abs(delta) <= restDelta; - state.value = state.done ? target : latest; - }; - /** - * Ideally this would resolve for t in a stateless way, we could - * do that by always precalculating the animation but as we know - * this will be done anyway we can assume that spring will - * be discovered during that. - */ - let timeReachedBoundary; - let spring$1; - const checkCatchBoundary = (t) => { - if (!isOutOfBounds(state.value)) - return; - timeReachedBoundary = t; - spring$1 = spring({ - keyframes: [state.value, nearestBoundary(state.value)], - velocity: getGeneratorVelocity(calcLatest, t, state.value), // TODO: This should be passing * 1000 - damping: bounceDamping, - stiffness: bounceStiffness, - restDelta, - restSpeed, - }); - }; - checkCatchBoundary(0); - return { - calculatedDuration: null, - next: (t) => { - /** - * We need to resolve the friction to figure out if we need a - * spring but we don't want to do this twice per frame. So here - * we flag if we updated for this frame and later if we did - * we can skip doing it again. - */ - let hasUpdatedFrame = false; - if (!spring$1 && timeReachedBoundary === undefined) { - hasUpdatedFrame = true; - applyFriction(t); - checkCatchBoundary(t); - } - /** - * If we have a spring and the provided t is beyond the moment the friction - * animation crossed the min/max boundary, use the spring. - */ - if (timeReachedBoundary !== undefined && t >= timeReachedBoundary) { - return spring$1.next(t - timeReachedBoundary); - } - else { - !hasUpdatedFrame && applyFriction(t); - return state; - } - }, - }; -} - -export { inertia }; -//# sourceMappingURL=inertia.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/generators/inertia.mjs.map b/node_modules/motion-dom/dist/es/animation/generators/inertia.mjs.map deleted file mode 100644 index 11402a7..0000000 --- a/node_modules/motion-dom/dist/es/animation/generators/inertia.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"inertia.mjs","sources":["../../../../src/animation/generators/inertia.ts"],"sourcesContent":["import {\n AnimationState,\n KeyframeGenerator,\n ValueAnimationOptions,\n} from \"../types\"\nimport { spring as createSpring } from \"./spring\"\nimport { getGeneratorVelocity } from \"./utils/velocity\"\n\nexport function inertia({\n keyframes,\n velocity = 0.0,\n power = 0.8,\n timeConstant = 325,\n bounceDamping = 10,\n bounceStiffness = 500,\n modifyTarget,\n min,\n max,\n restDelta = 0.5,\n restSpeed,\n}: ValueAnimationOptions): KeyframeGenerator {\n const origin = keyframes[0]\n\n const state: AnimationState = {\n done: false,\n value: origin,\n }\n\n const isOutOfBounds = (v: number) =>\n (min !== undefined && v < min) || (max !== undefined && v > max)\n\n const nearestBoundary = (v: number) => {\n if (min === undefined) return max\n if (max === undefined) return min\n\n return Math.abs(min - v) < Math.abs(max - v) ? min : max\n }\n\n let amplitude = power * velocity\n const ideal = origin + amplitude\n const target = modifyTarget === undefined ? ideal : modifyTarget(ideal)\n\n /**\n * If the target has changed we need to re-calculate the amplitude, otherwise\n * the animation will start from the wrong position.\n */\n if (target !== ideal) amplitude = target - origin\n\n const calcDelta = (t: number) => -amplitude * Math.exp(-t / timeConstant)\n\n const calcLatest = (t: number) => target + calcDelta(t)\n\n const applyFriction = (t: number) => {\n const delta = calcDelta(t)\n const latest = calcLatest(t)\n state.done = Math.abs(delta) <= restDelta\n state.value = state.done ? target : latest\n }\n\n /**\n * Ideally this would resolve for t in a stateless way, we could\n * do that by always precalculating the animation but as we know\n * this will be done anyway we can assume that spring will\n * be discovered during that.\n */\n let timeReachedBoundary: number | undefined\n let spring: KeyframeGenerator | undefined\n\n const checkCatchBoundary = (t: number) => {\n if (!isOutOfBounds(state.value)) return\n\n timeReachedBoundary = t\n\n spring = createSpring({\n keyframes: [state.value, nearestBoundary(state.value)!],\n velocity: getGeneratorVelocity(calcLatest, t, state.value), // TODO: This should be passing * 1000\n damping: bounceDamping,\n stiffness: bounceStiffness,\n restDelta,\n restSpeed,\n })\n }\n\n checkCatchBoundary(0)\n\n return {\n calculatedDuration: null,\n next: (t: number) => {\n /**\n * We need to resolve the friction to figure out if we need a\n * spring but we don't want to do this twice per frame. So here\n * we flag if we updated for this frame and later if we did\n * we can skip doing it again.\n */\n let hasUpdatedFrame = false\n if (!spring && timeReachedBoundary === undefined) {\n hasUpdatedFrame = true\n applyFriction(t)\n checkCatchBoundary(t)\n }\n\n /**\n * If we have a spring and the provided t is beyond the moment the friction\n * animation crossed the min/max boundary, use the spring.\n */\n if (timeReachedBoundary !== undefined && t >= timeReachedBoundary) {\n return spring!.next(t - timeReachedBoundary)\n } else {\n !hasUpdatedFrame && applyFriction(t)\n return state\n }\n },\n }\n}\n"],"names":["spring","createSpring"],"mappings":";;;SAQgB,OAAO,CAAC,EACpB,SAAS,EACT,QAAQ,GAAG,GAAG,EACd,KAAK,GAAG,GAAG,EACX,YAAY,GAAG,GAAG,EAClB,aAAa,GAAG,EAAE,EAClB,eAAe,GAAG,GAAG,EACrB,YAAY,EACZ,GAAG,EACH,GAAG,EACH,SAAS,GAAG,GAAG,EACf,SAAS,GACmB,EAAA;AAC5B,IAAA,MAAM,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;AAE3B,IAAA,MAAM,KAAK,GAA2B;AAClC,QAAA,IAAI,EAAE,KAAK;AACX,QAAA,KAAK,EAAE,MAAM;KAChB;IAED,MAAM,aAAa,GAAG,CAAC,CAAS,KAC5B,CAAC,GAAG,KAAK,SAAS,IAAI,CAAC,GAAG,GAAG,MAAM,GAAG,KAAK,SAAS,I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EjD,IAAA,MAAM,kBAAkB,GAAG,CAAC,CAAS,KAAI;AACrC,QAAA,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,KAAK,CAAC;YAAE;QAEjC,mBAAmB,GAAG,CAAC;QAEvBA,QAAM,GAAGC,MAAY,CAAC;AAClB,YAAA,SAAS,EAAE,CAAC,KAAK,CAAC,KAAK,EAAE,eAAe,CAAC,KAAK,CAAC,KAAK,CAAE,CAAC;AACvD,YAAA,QAAQ,EAAE,oBAAoB,CAAC,UAAU,EAAE,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC;AAC1D,YAAA,OAAO,EAAE,aAAa;AACtB,YAAA,SAAS,EAAE,eAAe;YAC1B,SAAS;YACT,SAAS;AACZ,SAAA,CAAC;AACN,IAAA,CAAC;IAED,kBAAkB,CAAC,CAAC,CAAC;IAErB,OAAO;AACH,QAAA,kBAAkB,EAAE,IAAI;AACxB,QAAA,IAAI,EAAE,CAAC,CAAS,KAAI;AAChB;;;;;AAKG;YACH,IAAI,eAAe,GAAG,KAAK;AAC3B,YAAA,IAAI,CAACD,QAAM,IAAI,mBAAmB,KAAK,SAAS,EAAE;gBAC9C,eAAe,GAAG,IAAI;gBACtB,aAAa,CAAC,CAAC,CAAC;gBAChB,kBAAkB,CAAC,CAAC,CAAC;YACzB;AAEA;;;AAGG;YACH,IAAI,mBAAmB,KAAK,SAAS,IAAI,CAAC,IAAI,mBAAmB,EAAE;gBAC/D,OAAOA,QAAO,CAAC,IAAI,CAAC,CAAC,GAAG,mBAAmB,CAAC;YAChD;iBAAO;AACH,gBAAA,CAAC,eAAe,IAAI,aAAa,CAAC,CAAC,CAAC;AACpC,gBAAA,OAAO,KAAK;YAChB;QACJ,CAAC;KACJ;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/generators/keyframes.mjs b/node_modules/motion-dom/dist/es/animation/generators/keyframes.mjs deleted file mode 100644 index aeca916..0000000 --- a/node_modules/motion-dom/dist/es/animation/generators/keyframes.mjs +++ /dev/null @@ -1,50 +0,0 @@ -import { easeInOut, isEasingArray, easingDefinitionToFunction } from 'motion-utils'; -import { interpolate } from '../../utils/interpolate.mjs'; -import { defaultOffset } from '../keyframes/offsets/default.mjs'; -import { convertOffsetToTimes } from '../keyframes/offsets/time.mjs'; - -function defaultEasing(values, easing) { - return values.map(() => easing || easeInOut).splice(0, values.length - 1); -} -function keyframes({ duration = 300, keyframes: keyframeValues, times, ease = "easeInOut", }) { - /** - * Easing functions can be externally defined as strings. Here we convert them - * into actual functions. - */ - const easingFunctions = isEasingArray(ease) - ? ease.map(easingDefinitionToFunction) - : easingDefinitionToFunction(ease); - /** - * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator - * to reduce GC during animation. - */ - const state = { - done: false, - value: keyframeValues[0], - }; - /** - * Create a times array based on the provided 0-1 offsets - */ - const absoluteTimes = convertOffsetToTimes( - // Only use the provided offsets if they're the correct length - // TODO Maybe we should warn here if there's a length mismatch - times && times.length === keyframeValues.length - ? times - : defaultOffset(keyframeValues), duration); - const mapTimeToKeyframe = interpolate(absoluteTimes, keyframeValues, { - ease: Array.isArray(easingFunctions) - ? easingFunctions - : defaultEasing(keyframeValues, easingFunctions), - }); - return { - calculatedDuration: duration, - next: (t) => { - state.value = mapTimeToKeyframe(t); - state.done = t >= duration; - return state; - }, - }; -} - -export { defaultEasing, keyframes }; -//# sourceMappingURL=keyframes.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/generators/keyframes.mjs.map b/node_modules/motion-dom/dist/es/animation/generators/keyframes.mjs.map deleted file mode 100644 index 0cb3bdc..0000000 --- a/node_modules/motion-dom/dist/es/animation/generators/keyframes.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"keyframes.mjs","sources":["../../../../src/animation/generators/keyframes.ts"],"sourcesContent":["import {\n easeInOut,\n easingDefinitionToFunction,\n EasingFunction,\n isEasingArray,\n} from \"motion-utils\"\nimport { interpolate } from \"../../utils/interpolate\"\nimport { defaultOffset } from \"../keyframes/offsets/default\"\nimport { convertOffsetToTimes } from \"../keyframes/offsets/time\"\nimport {\n AnimationState,\n AnyResolvedKeyframe,\n KeyframeGenerator,\n ValueAnimationOptions,\n} from \"../types\"\n\nexport function defaultEasing(\n values: any[],\n easing?: EasingFunction\n): EasingFunction[] {\n return values.map(() => easing || easeInOut).splice(0, values.length - 1)\n}\n\nexport function keyframes({\n duration = 300,\n keyframes: keyframeValues,\n times,\n ease = \"easeInOut\",\n}: ValueAnimationOptions): KeyframeGenerator {\n /**\n * Easing functions can be externally defined as strings. Here we convert them\n * into actual functions.\n */\n const easingFunctions = isEasingArray(ease)\n ? ease.map(easingDefinitionToFunction)\n : easingDefinitionToFunction(ease)\n\n /**\n * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator\n * to reduce GC during animation.\n */\n const state: AnimationState = {\n done: false,\n value: keyframeValues[0],\n }\n\n /**\n * Create a times array based on the provided 0-1 offsets\n */\n const absoluteTimes = convertOffsetToTimes(\n // Only use the provided offsets if they're the correct length\n // TODO Maybe we should warn here if there's a length mismatch\n times && times.length === keyframeValues.length\n ? times\n : defaultOffset(keyframeValues),\n duration\n )\n\n const mapTimeToKeyframe = interpolate(absoluteTimes, keyframeValues, {\n ease: Array.isArray(easingFunctions)\n ? easingFunctions\n : defaultEasing(keyframeValues, easingFunctions),\n })\n\n return {\n calculatedDuration: duration,\n next: (t: number) => {\n state.value = mapTimeToKeyframe(t)\n state.done = t >= duration\n return state\n },\n }\n}\n"],"names":[],"mappings":";;;;;AAgBM,SAAU,aAAa,CACzB,MAAa,EACb,MAAuB,EAAA;IAEvB,OAAO,MAAM,CAAC,GAAG,CAAC,MAAM,MAAM,IAAI,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;AAC7E;SAEgB,SAAS,CAAgC,EACrD,QAAQ,GAAG,GAAG,EACd,SAAS,EAAE,cAAc,EACzB,KAAK,EACL,IAAI,GAAG,WAAW,GACK,EAAA;AACvB;;;AAGG;AACH,IAAA,MAAM,eAAe,GAAG,aAAa,CAAC,IAAI;AACtC,UAAE,IAAI,CAAC,GAAG,CAAC,0BAA0B;AACrC,UAAE,0BAA0B,CAAC,IAAI,CAAC;AAEtC;;;AAGG;AACH,IAAA,MAAM,KAAK,GAAsB;AAC7B,QAAA,IAAI,EAAE,KAAK;AACX,QAAA,KAAK,EAAE,cAAc,CAAC,CAAC,CAAC;KAC3B;AAED;;AAEG;IACH,MAAM,aAAa,GAAG,oBAAoB;;;AAGtC,IAAA,KAAK,IAAI,KAAK,CAAC,MAAM,KAAK,cAAc,CAAC;AACrC,UAAE;UACA,aAAa,CAAC,cAAc,CAAC,EACnC,QAAQ,CACX;AAED,IAAA,MAAM,iBAAiB,GAAG,WAAW,CAAI,aAAa,EAAE,cAAc,EAAE;AACpE,QAAA,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,eAAe;AAC/B,cAAE;AACF,cAAE,aAAa,CAAC,cAAc,EAAE,eAAe,CAAC;AACvD,KAAA,CAAC;IAEF,OAAO;AACH,QAAA,kBAAkB,EAAE,QAAQ;AAC5B,QAAA,IAAI,EAAE,CAAC,CAAS,KAAI;AAChB,YAAA,KAAK,CAAC,KAAK,GAAG,iBAAiB,CAAC,CAAC,CAAC;AAClC,YAAA,KAAK,CAAC,IAAI,GAAG,CAAC,IAAI,QAAQ;AAC1B,YAAA,OAAO,KAAK;QAChB,CAAC;KACJ;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/generators/spring.mjs b/node_modules/motion-dom/dist/es/animation/generators/spring.mjs deleted file mode 100644 index 2615a91..0000000 --- a/node_modules/motion-dom/dist/es/animation/generators/spring.mjs +++ /dev/null @@ -1,329 +0,0 @@ -import { millisecondsToSeconds, clamp, secondsToMilliseconds, warning } from 'motion-utils'; -import { generateLinearEasing } from '../waapi/utils/linear.mjs'; -import { calcGeneratorDuration, maxGeneratorDuration } from './utils/calc-duration.mjs'; -import { createGeneratorEasing } from './utils/create-generator-easing.mjs'; - -const springDefaults = { - // Default spring physics - stiffness: 100, - damping: 10, - mass: 1.0, - velocity: 0.0, - // Default duration/bounce-based options - duration: 800, // in ms - bounce: 0.3, - visualDuration: 0.3, // in seconds - // Rest thresholds - restSpeed: { - granular: 0.01, - default: 2, - }, - restDelta: { - granular: 0.005, - default: 0.5, - }, - // Limits - minDuration: 0.01, // in seconds - maxDuration: 10.0, // in seconds - minDamping: 0.05, - maxDamping: 1, -}; -function calcAngularFreq(undampedFreq, dampingRatio) { - return undampedFreq * Math.sqrt(1 - dampingRatio * dampingRatio); -} -const rootIterations = 12; -function approximateRoot(envelope, derivative, initialGuess) { - let result = initialGuess; - for (let i = 1; i < rootIterations; i++) { - result = result - envelope(result) / derivative(result); - } - return result; -} -/** - * This is ported from the Framer implementation of duration-based spring resolution. - */ -const safeMin = 0.001; -function findSpring({ duration = springDefaults.duration, bounce = springDefaults.bounce, velocity = springDefaults.velocity, mass = springDefaults.mass, }) { - let envelope; - let derivative; - warning(duration <= secondsToMilliseconds(springDefaults.maxDuration), "Spring duration must be 10 seconds or less", "spring-duration-limit"); - let dampingRatio = 1 - bounce; - /** - * Restrict dampingRatio and duration to within acceptable ranges. - */ - dampingRatio = clamp(springDefaults.minDamping, springDefaults.maxDamping, dampingRatio); - duration = clamp(springDefaults.minDuration, springDefaults.maxDuration, millisecondsToSeconds(duration)); - if (dampingRatio < 1) { - /** - * Underdamped spring - */ - envelope = (undampedFreq) => { - const exponentialDecay = undampedFreq * dampingRatio; - const delta = exponentialDecay * duration; - const a = exponentialDecay - velocity; - const b = calcAngularFreq(undampedFreq, dampingRatio); - const c = Math.exp(-delta); - return safeMin - (a / b) * c; - }; - derivative = (undampedFreq) => { - const exponentialDecay = undampedFreq * dampingRatio; - const delta = exponentialDecay * duration; - const d = delta * velocity + velocity; - const e = Math.pow(dampingRatio, 2) * Math.pow(undampedFreq, 2) * duration; - const f = Math.exp(-delta); - const g = calcAngularFreq(Math.pow(undampedFreq, 2), dampingRatio); - const factor = -envelope(undampedFreq) + safeMin > 0 ? -1 : 1; - return (factor * ((d - e) * f)) / g; - }; - } - else { - /** - * Critically-damped spring - */ - envelope = (undampedFreq) => { - const a = Math.exp(-undampedFreq * duration); - const b = (undampedFreq - velocity) * duration + 1; - return -safeMin + a * b; - }; - derivative = (undampedFreq) => { - const a = Math.exp(-undampedFreq * duration); - const b = (velocity - undampedFreq) * (duration * duration); - return a * b; - }; - } - const initialGuess = 5 / duration; - const undampedFreq = approximateRoot(envelope, derivative, initialGuess); - duration = secondsToMilliseconds(duration); - if (isNaN(undampedFreq)) { - return { - stiffness: springDefaults.stiffness, - damping: springDefaults.damping, - duration, - }; - } - else { - const stiffness = Math.pow(undampedFreq, 2) * mass; - return { - stiffness, - damping: dampingRatio * 2 * Math.sqrt(mass * stiffness), - duration, - }; - } -} -const durationKeys = ["duration", "bounce"]; -const physicsKeys = ["stiffness", "damping", "mass"]; -function isSpringType(options, keys) { - return keys.some((key) => options[key] !== undefined); -} -function getSpringOptions(options) { - let springOptions = { - velocity: springDefaults.velocity, - stiffness: springDefaults.stiffness, - damping: springDefaults.damping, - mass: springDefaults.mass, - isResolvedFromDuration: false, - ...options, - }; - // stiffness/damping/mass overrides duration/bounce - if (!isSpringType(options, physicsKeys) && - isSpringType(options, durationKeys)) { - // Time-defined springs should ignore inherited velocity. - // Velocity from interrupted animations can cause findSpring() - // to compute wildly different spring parameters, leading to - // massive oscillation on small-range animations. - springOptions.velocity = 0; - if (options.visualDuration) { - const visualDuration = options.visualDuration; - const root = (2 * Math.PI) / (visualDuration * 1.2); - const stiffness = root * root; - const damping = 2 * - clamp(0.05, 1, 1 - (options.bounce || 0)) * - Math.sqrt(stiffness); - springOptions = { - ...springOptions, - mass: springDefaults.mass, - stiffness, - damping, - }; - } - else { - const derived = findSpring({ ...options, velocity: 0 }); - springOptions = { - ...springOptions, - ...derived, - mass: springDefaults.mass, - }; - springOptions.isResolvedFromDuration = true; - } - } - return springOptions; -} -function spring(optionsOrVisualDuration = springDefaults.visualDuration, bounce = springDefaults.bounce) { - const options = typeof optionsOrVisualDuration !== "object" - ? { - visualDuration: optionsOrVisualDuration, - keyframes: [0, 1], - bounce, - } - : optionsOrVisualDuration; - let { restSpeed, restDelta } = options; - const origin = options.keyframes[0]; - const target = options.keyframes[options.keyframes.length - 1]; - /** - * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator - * to reduce GC during animation. - */ - const state = { done: false, value: origin }; - const { stiffness, damping, mass, duration, velocity, isResolvedFromDuration, } = getSpringOptions({ - ...options, - velocity: -millisecondsToSeconds(options.velocity || 0), - }); - const initialVelocity = velocity || 0.0; - const dampingRatio = damping / (2 * Math.sqrt(stiffness * mass)); - const initialDelta = target - origin; - const undampedAngularFreq = millisecondsToSeconds(Math.sqrt(stiffness / mass)); - /** - * If we're working on a granular scale, use smaller defaults for determining - * when the spring is finished. - * - * These defaults have been selected emprically based on what strikes a good - * ratio between feeling good and finishing as soon as changes are imperceptible. - */ - const isGranularScale = Math.abs(initialDelta) < 5; - restSpeed || (restSpeed = isGranularScale - ? springDefaults.restSpeed.granular - : springDefaults.restSpeed.default); - restDelta || (restDelta = isGranularScale - ? springDefaults.restDelta.granular - : springDefaults.restDelta.default); - let resolveSpring; - let resolveVelocity; - // Underdamped coefficients, hoisted for use in the inlined next() hot path - let angularFreq; - let A; - let sinCoeff; - let cosCoeff; - if (dampingRatio < 1) { - angularFreq = calcAngularFreq(undampedAngularFreq, dampingRatio); - A = - (initialVelocity + - dampingRatio * undampedAngularFreq * initialDelta) / - angularFreq; - // Underdamped spring - resolveSpring = (t) => { - const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); - return (target - - envelope * - (A * Math.sin(angularFreq * t) + - initialDelta * Math.cos(angularFreq * t))); - }; - // Analytical derivative of underdamped spring (px/ms) - sinCoeff = - dampingRatio * undampedAngularFreq * A + initialDelta * angularFreq; - cosCoeff = - dampingRatio * undampedAngularFreq * initialDelta - A * angularFreq; - resolveVelocity = (t) => { - const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); - return envelope * - (sinCoeff * Math.sin(angularFreq * t) + - cosCoeff * Math.cos(angularFreq * t)); - }; - } - else if (dampingRatio === 1) { - // Critically damped spring - resolveSpring = (t) => target - - Math.exp(-undampedAngularFreq * t) * - (initialDelta + - (initialVelocity + undampedAngularFreq * initialDelta) * t); - // Analytical derivative of critically damped spring (px/ms) - const C = initialVelocity + undampedAngularFreq * initialDelta; - resolveVelocity = (t) => Math.exp(-undampedAngularFreq * t) * - (undampedAngularFreq * C * t - initialVelocity); - } - else { - // Overdamped spring - const dampedAngularFreq = undampedAngularFreq * Math.sqrt(dampingRatio * dampingRatio - 1); - resolveSpring = (t) => { - const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); - // When performing sinh or cosh values can hit Infinity so we cap them here - const freqForT = Math.min(dampedAngularFreq * t, 300); - return (target - - (envelope * - ((initialVelocity + - dampingRatio * undampedAngularFreq * initialDelta) * - Math.sinh(freqForT) + - dampedAngularFreq * - initialDelta * - Math.cosh(freqForT))) / - dampedAngularFreq); - }; - // Analytical derivative of overdamped spring (px/ms) - const P = (initialVelocity + - dampingRatio * undampedAngularFreq * initialDelta) / - dampedAngularFreq; - const sinhCoeff = dampingRatio * undampedAngularFreq * P - initialDelta * dampedAngularFreq; - const coshCoeff = dampingRatio * undampedAngularFreq * initialDelta - P * dampedAngularFreq; - resolveVelocity = (t) => { - const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); - const freqForT = Math.min(dampedAngularFreq * t, 300); - return envelope * - (sinhCoeff * Math.sinh(freqForT) + - coshCoeff * Math.cosh(freqForT)); - }; - } - const generator = { - calculatedDuration: isResolvedFromDuration ? duration || null : null, - velocity: (t) => secondsToMilliseconds(resolveVelocity(t)), - next: (t) => { - /** - * For underdamped physics springs we need both position and - * velocity each tick. Compute shared trig values once to avoid - * duplicate Math.exp/sin/cos calls on the hot path. - */ - if (!isResolvedFromDuration && dampingRatio < 1) { - const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); - const sin = Math.sin(angularFreq * t); - const cos = Math.cos(angularFreq * t); - const current = target - - envelope * - (A * sin + initialDelta * cos); - const currentVelocity = secondsToMilliseconds(envelope * - (sinCoeff * sin + cosCoeff * cos)); - state.done = - Math.abs(currentVelocity) <= restSpeed && - Math.abs(target - current) <= restDelta; - state.value = state.done ? target : current; - return state; - } - const current = resolveSpring(t); - if (!isResolvedFromDuration) { - const currentVelocity = secondsToMilliseconds(resolveVelocity(t)); - state.done = - Math.abs(currentVelocity) <= restSpeed && - Math.abs(target - current) <= restDelta; - } - else { - state.done = t >= duration; - } - state.value = state.done ? target : current; - return state; - }, - toString: () => { - const calculatedDuration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration); - const easing = generateLinearEasing((progress) => generator.next(calculatedDuration * progress).value, calculatedDuration, 30); - return calculatedDuration + "ms " + easing; - }, - toTransition: () => { }, - }; - return generator; -} -spring.applyToOptions = (options) => { - const generatorOptions = createGeneratorEasing(options, 100, spring); - options.ease = generatorOptions.ease; - options.duration = secondsToMilliseconds(generatorOptions.duration); - options.type = "keyframes"; - return options; -}; - -export { spring }; -//# sourceMappingURL=spring.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/generators/spring.mjs.map b/node_modules/motion-dom/dist/es/animation/generators/spring.mjs.map deleted file mode 100644 index 5c18f97..0000000 --- a/node_modules/motion-dom/dist/es/animation/generators/spring.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"spring.mjs","sources":["../../../../src/animation/generators/spring.ts"],"sourcesContent":["import {\n clamp,\n millisecondsToSeconds,\n secondsToMilliseconds,\n warning,\n} from \"motion-utils\"\nimport {\n AnimationState,\n KeyframeGenerator,\n SpringOptions,\n Transition,\n ValueAnimationOptions,\n} from \"../types\"\nimport { generateLinearEasing } from \"../waapi/utils/linear\"\nimport {\n calcGeneratorDuration,\n maxGeneratorDuration,\n} from \"./utils/calc-duration\"\nimport { createGeneratorEasing } from \"./utils/create-generator-easing\"\n\nconst springDefaults = {\n // Default spring physics\n stiffness: 100,\n damping: 10,\n mass: 1.0,\n velocity: 0.0,\n\n // Default duration/bounce-based options\n duration: 800, // in ms\n bounce: 0.3,\n visualDuration: 0.3, // in seconds\n\n // Rest thresholds\n restSpeed: {\n granular: 0.01,\n default: 2,\n },\n restDelta: {\n granular: 0.005,\n default: 0.5,\n },\n\n // Limits\n minDuration: 0.01, // in seconds\n maxDuration: 10.0, // in seconds\n minDamping: 0.05,\n maxDamping: 1,\n}\n\nfunction calcAngularFreq(undampedFreq: number, dampingRatio: number) {\n return undampedFreq * Math.sqrt(1 - dampingRatio * dampingRatio)\n}\n\nconst rootIterations = 12\nfunction approximateRoot(\n envelope: (num: number) => number,\n derivative: (num: number) => number,\n initialGuess: number\n): number {\n let result = initialGuess\n for (let i = 1; i < rootIterations; i++) {\n result = result - envelope(result) / derivative(result)\n }\n return result\n}\n\n/**\n * This is ported from the Framer implementation of duration-based spring resolution.\n */\nconst safeMin = 0.001\n\nfunction findSpring({\n duration = springDefaults.duration,\n bounce = springDefaults.bounce,\n velocity = springDefaults.velocity,\n mass = springDefaults.mass,\n}: SpringOptions) {\n let envelope: (num: number) => number\n let derivative: (num: number) => number\n\n warning(\n duration <= secondsToMilliseconds(springDefaults.maxDuration),\n \"Spring duration must be 10 seconds or less\",\n \"spring-duration-limit\"\n )\n\n let dampingRatio = 1 - bounce\n\n /**\n * Restrict dampingRatio and duration to within acceptable ranges.\n */\n dampingRatio = clamp(\n springDefaults.minDamping,\n springDefaults.maxDamping,\n dampingRatio\n )\n duration = clamp(\n springDefaults.minDuration,\n springDefaults.maxDuration,\n millisecondsToSeconds(duration)\n )\n\n if (dampingRatio < 1) {\n /**\n * Underdamped spring\n */\n envelope = (undampedFreq) => {\n const exponentialDecay = undampedFreq * dampingRatio\n const delta = exponentialDecay * duration\n const a = exponentialDecay - velocity\n const b = calcAngularFreq(undampedFreq, dampingRatio)\n const c = Math.exp(-delta)\n return safeMin - (a / b) * c\n }\n\n derivative = (undampedFreq) => {\n const exponentialDecay = undampedFreq * dampingRatio\n const delta = exponentialDecay * duration\n const d = delta * velocity + velocity\n const e =\n Math.pow(dampingRatio, 2) * Math.pow(undampedFreq, 2) * duration\n const f = Math.exp(-delta)\n const g = calcAngularFreq(Math.pow(undampedFreq, 2), dampingRatio)\n const factor = -envelope(undampedFreq) + safeMin > 0 ? -1 : 1\n return (factor * ((d - e) * f)) / g\n }\n } else {\n /**\n * Critically-damped spring\n */\n envelope = (undampedFreq) => {\n const a = Math.exp(-undampedFreq * duration)\n const b = (undampedFreq - velocity) * duration + 1\n return -safeMin + a * b\n }\n\n derivative = (undampedFreq) => {\n const a = Math.exp(-undampedFreq * duration)\n const b = (velocity - undampedFreq) * (duration * duration)\n return a * b\n }\n }\n\n const initialGuess = 5 / duration\n const undampedFreq = approximateRoot(envelope, derivative, initialGuess)\n\n duration = secondsToMilliseconds(duration)\n if (isNaN(undampedFreq)) {\n return {\n stiffness: springDefaults.stiffness,\n damping: springDefaults.damping,\n duration,\n }\n } else {\n const stiffness = Math.pow(undampedFreq, 2) * mass\n return {\n stiffness,\n damping: dampingRatio * 2 * Math.sqrt(mass * stiffness),\n duration,\n }\n }\n}\n\nconst durationKeys = [\"duration\", \"bounce\"]\nconst physicsKeys = [\"stiffness\", \"damping\", \"mass\"]\n\nfunction isSpringType(options: SpringOptions, keys: string[]) {\n return keys.some((key) => (options as any)[key] !== undefined)\n}\n\nfunction getSpringOptions(options: SpringOptions) {\n let springOptions = {\n velocity: springDefaults.velocity,\n stiffness: springDefaults.stiffness,\n damping: springDefaults.damping,\n mass: springDefaults.mass,\n isResolvedFromDuration: false,\n ...options,\n }\n // stiffness/damping/mass overrides duration/bounce\n if (\n !isSpringType(options, physicsKeys) &&\n isSpringType(options, durationKeys)\n ) {\n // Time-defined springs should ignore inherited velocity.\n // Velocity from interrupted animations can cause findSpring()\n // to compute wildly different spring parameters, leading to\n // massive oscillation on small-range animations.\n springOptions.velocity = 0\n\n if (options.visualDuration) {\n const visualDuration = options.visualDuration\n const root = (2 * Math.PI) / (visualDuration * 1.2)\n const stiffness = root * root\n const damping =\n 2 *\n clamp(0.05, 1, 1 - (options.bounce || 0)) *\n Math.sqrt(stiffness)\n\n springOptions = {\n ...springOptions,\n mass: springDefaults.mass,\n stiffness,\n damping,\n }\n } else {\n const derived = findSpring({ ...options, velocity: 0 })\n\n springOptions = {\n ...springOptions,\n ...derived,\n mass: springDefaults.mass,\n }\n springOptions.isResolvedFromDuration = true\n }\n }\n\n return springOptions\n}\n\nfunction spring(\n optionsOrVisualDuration:\n | ValueAnimationOptions\n | number = springDefaults.visualDuration,\n bounce = springDefaults.bounce\n): KeyframeGenerator {\n const options =\n typeof optionsOrVisualDuration !== \"object\"\n ? ({\n visualDuration: optionsOrVisualDuration,\n keyframes: [0, 1],\n bounce,\n } as ValueAnimationOptions)\n : optionsOrVisualDuration\n\n let { restSpeed, restDelta } = options\n\n const origin = options.keyframes[0]\n const target = options.keyframes[options.keyframes.length - 1]\n\n /**\n * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator\n * to reduce GC during animation.\n */\n const state: AnimationState = { done: false, value: origin }\n\n const {\n stiffness,\n damping,\n mass,\n duration,\n velocity,\n isResolvedFromDuration,\n } = getSpringOptions({\n ...options,\n velocity: -millisecondsToSeconds(options.velocity || 0),\n })\n\n const initialVelocity = velocity || 0.0\n const dampingRatio = damping / (2 * Math.sqrt(stiffness * mass))\n\n const initialDelta = target - origin\n const undampedAngularFreq = millisecondsToSeconds(\n Math.sqrt(stiffness / mass)\n )\n\n /**\n * If we're working on a granular scale, use smaller defaults for determining\n * when the spring is finished.\n *\n * These defaults have been selected emprically based on what strikes a good\n * ratio between feeling good and finishing as soon as changes are imperceptible.\n */\n const isGranularScale = Math.abs(initialDelta) < 5\n restSpeed ||= isGranularScale\n ? springDefaults.restSpeed.granular\n : springDefaults.restSpeed.default\n restDelta ||= isGranularScale\n ? springDefaults.restDelta.granular\n : springDefaults.restDelta.default\n\n let resolveSpring: (v: number) => number\n let resolveVelocity: (t: number) => number\n\n // Underdamped coefficients, hoisted for use in the inlined next() hot path\n let angularFreq: number\n let A: number\n let sinCoeff: number\n let cosCoeff: number\n\n if (dampingRatio < 1) {\n angularFreq = calcAngularFreq(undampedAngularFreq, dampingRatio)\n\n A =\n (initialVelocity +\n dampingRatio * undampedAngularFreq * initialDelta) /\n angularFreq\n\n // Underdamped spring\n resolveSpring = (t: number) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t)\n\n return (\n target -\n envelope *\n (A * Math.sin(angularFreq * t) +\n initialDelta * Math.cos(angularFreq * t))\n )\n }\n\n // Analytical derivative of underdamped spring (px/ms)\n sinCoeff =\n dampingRatio * undampedAngularFreq * A + initialDelta * angularFreq\n cosCoeff =\n dampingRatio * undampedAngularFreq * initialDelta - A * angularFreq\n resolveVelocity = (t: number) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t)\n return envelope *\n (sinCoeff * Math.sin(angularFreq * t) +\n cosCoeff * Math.cos(angularFreq * t))\n }\n } else if (dampingRatio === 1) {\n // Critically damped spring\n resolveSpring = (t: number) =>\n target -\n Math.exp(-undampedAngularFreq * t) *\n (initialDelta +\n (initialVelocity + undampedAngularFreq * initialDelta) * t)\n\n // Analytical derivative of critically damped spring (px/ms)\n const C = initialVelocity + undampedAngularFreq * initialDelta\n resolveVelocity = (t: number) =>\n Math.exp(-undampedAngularFreq * t) *\n (undampedAngularFreq * C * t - initialVelocity)\n } else {\n // Overdamped spring\n const dampedAngularFreq =\n undampedAngularFreq * Math.sqrt(dampingRatio * dampingRatio - 1)\n\n resolveSpring = (t: number) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t)\n\n // When performing sinh or cosh values can hit Infinity so we cap them here\n const freqForT = Math.min(dampedAngularFreq * t, 300)\n\n return (\n target -\n (envelope *\n ((initialVelocity +\n dampingRatio * undampedAngularFreq * initialDelta) *\n Math.sinh(freqForT) +\n dampedAngularFreq *\n initialDelta *\n Math.cosh(freqForT))) /\n dampedAngularFreq\n )\n }\n\n // Analytical derivative of overdamped spring (px/ms)\n const P =\n (initialVelocity +\n dampingRatio * undampedAngularFreq * initialDelta) /\n dampedAngularFreq\n const sinhCoeff =\n dampingRatio * undampedAngularFreq * P - initialDelta * dampedAngularFreq\n const coshCoeff =\n dampingRatio * undampedAngularFreq * initialDelta - P * dampedAngularFreq\n resolveVelocity = (t: number) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t)\n const freqForT = Math.min(dampedAngularFreq * t, 300)\n return envelope *\n (sinhCoeff * Math.sinh(freqForT) +\n coshCoeff * Math.cosh(freqForT))\n }\n }\n\n const generator = {\n calculatedDuration: isResolvedFromDuration ? duration || null : null,\n velocity: (t: number) => secondsToMilliseconds(resolveVelocity(t)),\n next: (t: number) => {\n /**\n * For underdamped physics springs we need both position and\n * velocity each tick. Compute shared trig values once to avoid\n * duplicate Math.exp/sin/cos calls on the hot path.\n */\n if (!isResolvedFromDuration && dampingRatio < 1) {\n const envelope = Math.exp(\n -dampingRatio * undampedAngularFreq * t\n )\n const sin = Math.sin(angularFreq * t)\n const cos = Math.cos(angularFreq * t)\n\n const current =\n target -\n envelope *\n (A * sin + initialDelta * cos)\n const currentVelocity = secondsToMilliseconds(\n envelope *\n (sinCoeff * sin + cosCoeff * cos)\n )\n\n state.done =\n Math.abs(currentVelocity) <= restSpeed! &&\n Math.abs(target - current) <= restDelta!\n state.value = state.done ? target : current\n\n return state\n }\n\n const current = resolveSpring(t)\n\n if (!isResolvedFromDuration) {\n const currentVelocity = secondsToMilliseconds(\n resolveVelocity(t)\n )\n state.done =\n Math.abs(currentVelocity) <= restSpeed! &&\n Math.abs(target - current) <= restDelta!\n } else {\n state.done = t >= duration!\n }\n\n state.value = state.done ? target : current\n\n return state\n },\n toString: () => {\n const calculatedDuration = Math.min(\n calcGeneratorDuration(generator),\n maxGeneratorDuration\n )\n\n const easing = generateLinearEasing(\n (progress: number) =>\n generator.next(calculatedDuration * progress).value,\n calculatedDuration,\n 30\n )\n\n return calculatedDuration + \"ms \" + easing\n },\n toTransition: () => {},\n }\n\n return generator\n}\n\nspring.applyToOptions = (options: Transition) => {\n const generatorOptions = createGeneratorEasing(options as any, 100, spring)\n\n options.ease = generatorOptions.ease\n options.duration = secondsToMilliseconds(generatorOptions.duration)\n options.type = \"keyframes\"\n return options\n}\n\nexport { spring }\n"],"names":[],"mappings":";;;;;AAoBA,MAAM,cAAc,GAAG;;AAEnB,IAAA,SAAS,EAAE,GAAG;AACd,IAAA,OAAO,EAAE,EAAE;AACX,IAAA,IAAI,EAAE,GAAG;AACT,IAAA,QAAQ,EAAE,GAAG;;IAGb,QAAQ,EAAE,GAAG;AACb,IAAA,MAAM,EAAE,GAAG;IACX,cAAc,EAAE,GAAG;;AAGnB,IAAA,SAAS,EAAE;AACP,QAAA,QAAQ,EAAE,IAAI;AACd,QAAA,OAAO,EAAE,CAAC;AACb,KAAA;AACD,IAAA,SAAS,EAAE;AACP,QAAA,QAAQ,EAAE,KAAK;AACf,QAAA,OAAO,EAAE,GAAG;AACf,KAAA;;IAGD,WAAW,EAAE,IAAI;IACjB,WAAW,EAAE,IAAI;AACjB,IAAA,UAAU,EAAE,IAAI;AAChB,IAAA,UAAU,EAAE,CAAC;CAChB;AAED,SAAS,eAAe,CAAC,YAAoB,EAAE,YAAoB,EAAA;AAC/D,IAAA,OAAO,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,YAAY,GAAG,YAAY,CAAC;AACpE;AAEA,MAAM,cAAc,GAAG,EAAE;AACzB,SAAS,eAAe,CACpB,QAAiC,EACjC,UAAmC,EACnC,YAAoB,EAAA;IAEpB,IAAI,MAAM,GAAG,YAAY;AACzB,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,cAAc,EAAE,CAAC,EAAE,EAAE;AACrC,QAAA,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAC,MAAM,C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AC5C,MAAM,gBAAgB,GAAG,qBAAqB,CAAC,OAAc,EAAE,GAAG,EAAE,MAAM,CAAC;AAE3E,IAAA,OAAO,CAAC,IAAI,GAAG,gBAAgB,CAAC,IAAI;IACpC,OAAO,CAAC,QAAQ,GAAG,qBAAqB,CAAC,gBAAgB,CAAC,QAAQ,CAAC;AACnE,IAAA,OAAO,CAAC,IAAI,GAAG,WAAW;AAC1B,IAAA,OAAO,OAAO;AAClB,CAAC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/generators/utils/calc-duration.mjs b/node_modules/motion-dom/dist/es/animation/generators/utils/calc-duration.mjs deleted file mode 100644 index 03d8077..0000000 --- a/node_modules/motion-dom/dist/es/animation/generators/utils/calc-duration.mjs +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Implement a practical max duration for keyframe generation - * to prevent infinite loops - */ -const maxGeneratorDuration = 20000; -function calcGeneratorDuration(generator) { - let duration = 0; - const timeStep = 50; - let state = generator.next(duration); - while (!state.done && duration < maxGeneratorDuration) { - duration += timeStep; - state = generator.next(duration); - } - return duration >= maxGeneratorDuration ? Infinity : duration; -} - -export { calcGeneratorDuration, maxGeneratorDuration }; -//# sourceMappingURL=calc-duration.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/generators/utils/calc-duration.mjs.map b/node_modules/motion-dom/dist/es/animation/generators/utils/calc-duration.mjs.map deleted file mode 100644 index b2c3d50..0000000 --- a/node_modules/motion-dom/dist/es/animation/generators/utils/calc-duration.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"calc-duration.mjs","sources":["../../../../../src/animation/generators/utils/calc-duration.ts"],"sourcesContent":["import { KeyframeGenerator } from \"../../types\"\n\n/**\n * Implement a practical max duration for keyframe generation\n * to prevent infinite loops\n */\nexport const maxGeneratorDuration = 20_000\nexport function calcGeneratorDuration(\n generator: KeyframeGenerator\n): number {\n let duration = 0\n const timeStep = 50\n let state = generator.next(duration)\n while (!state.done && duration < maxGeneratorDuration) {\n duration += timeStep\n state = generator.next(duration)\n }\n\n return duration >= maxGeneratorDuration ? Infinity : duration\n}\n"],"names":[],"mappings":"AAEA;;;AAGG;AACI,MAAM,oBAAoB,GAAG;AAC9B,SAAU,qBAAqB,CACjC,SAAqC,EAAA;IAErC,IAAI,QAAQ,GAAG,CAAC;IAChB,MAAM,QAAQ,GAAG,EAAE;IACnB,IAAI,KAAK,GAAG,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC;IACpC,OAAO,CAAC,KAAK,CAAC,IAAI,IAAI,QAAQ,GAAG,oBAAoB,EAAE;QACnD,QAAQ,IAAI,QAAQ;AACpB,QAAA,KAAK,GAAG,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC;IACpC;IAEA,OAAO,QAAQ,IAAI,oBAAoB,GAAG,QAAQ,GAAG,QAAQ;AACjE;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.mjs b/node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.mjs deleted file mode 100644 index 7609efe..0000000 --- a/node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.mjs +++ /dev/null @@ -1,20 +0,0 @@ -import { millisecondsToSeconds } from 'motion-utils'; -import { calcGeneratorDuration, maxGeneratorDuration } from './calc-duration.mjs'; - -/** - * Create a progress => progress easing function from a generator. - */ -function createGeneratorEasing(options, scale = 100, createGenerator) { - const generator = createGenerator({ ...options, keyframes: [0, scale] }); - const duration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration); - return { - type: "keyframes", - ease: (progress) => { - return generator.next(duration * progress).value / scale; - }, - duration: millisecondsToSeconds(duration), - }; -} - -export { createGeneratorEasing }; -//# sourceMappingURL=create-generator-easing.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.mjs.map b/node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.mjs.map deleted file mode 100644 index 86fbc80..0000000 --- a/node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"create-generator-easing.mjs","sources":["../../../../../src/animation/generators/utils/create-generator-easing.ts"],"sourcesContent":["import { millisecondsToSeconds } from \"motion-utils\"\nimport { GeneratorFactory, Transition } from \"../../types\"\nimport { calcGeneratorDuration, maxGeneratorDuration } from \"./calc-duration\"\n\n/**\n * Create a progress => progress easing function from a generator.\n */\nexport function createGeneratorEasing(\n options: Transition,\n scale = 100,\n createGenerator: GeneratorFactory\n) {\n const generator = createGenerator({ ...options, keyframes: [0, scale] })\n const duration = Math.min(\n calcGeneratorDuration(generator),\n maxGeneratorDuration\n )\n\n return {\n type: \"keyframes\",\n ease: (progress: number) => {\n return generator.next(duration * progress).value / scale\n },\n duration: millisecondsToSeconds(duration),\n }\n}\n"],"names":[],"mappings":";;;AAIA;;AAEG;AACG,SAAU,qBAAqB,CACjC,OAAmB,EACnB,KAAK,GAAG,GAAG,EACX,eAAiC,EAAA;AAEjC,IAAA,MAAM,SAAS,GAAG,eAAe,CAAC,EAAE,GAAG,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC;AACxE,IAAA,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CACrB,qBAAqB,CAAC,SAAS,CAAC,EAChC,oBAAoB,CACvB;IAED,OAAO;AACH,QAAA,IAAI,EAAE,WAAW;AACjB,QAAA,IAAI,EAAE,CAAC,QAAgB,KAAI;AACvB,YAAA,OAAO,SAAS,CAAC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC,CAAC,KAAK,GAAG,KAAK;QAC5D,CAAC;AACD,QAAA,QAAQ,EAAE,qBAAqB,CAAC,QAAQ,CAAC;KAC5C;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/generators/utils/is-generator.mjs b/node_modules/motion-dom/dist/es/animation/generators/utils/is-generator.mjs deleted file mode 100644 index e240fd2..0000000 --- a/node_modules/motion-dom/dist/es/animation/generators/utils/is-generator.mjs +++ /dev/null @@ -1,6 +0,0 @@ -function isGenerator(type) { - return typeof type === "function" && "applyToOptions" in type; -} - -export { isGenerator }; -//# sourceMappingURL=is-generator.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/generators/utils/is-generator.mjs.map b/node_modules/motion-dom/dist/es/animation/generators/utils/is-generator.mjs.map deleted file mode 100644 index e54cc1c..0000000 --- a/node_modules/motion-dom/dist/es/animation/generators/utils/is-generator.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"is-generator.mjs","sources":["../../../../../src/animation/generators/utils/is-generator.ts"],"sourcesContent":["import { AnimationGeneratorType, GeneratorFactory } from \"../../types\"\n\nexport function isGenerator(\n type?: AnimationGeneratorType\n): type is GeneratorFactory {\n return typeof type === \"function\" && \"applyToOptions\" in type\n}\n"],"names":[],"mappings":"AAEM,SAAU,WAAW,CACvB,IAA6B,EAAA;IAE7B,OAAO,OAAO,IAAI,KAAK,UAAU,IAAI,gBAAgB,IAAI,IAAI;AACjE;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/generators/utils/velocity.mjs b/node_modules/motion-dom/dist/es/animation/generators/utils/velocity.mjs deleted file mode 100644 index d697ac0..0000000 --- a/node_modules/motion-dom/dist/es/animation/generators/utils/velocity.mjs +++ /dev/null @@ -1,10 +0,0 @@ -import { velocityPerSecond } from 'motion-utils'; - -const velocitySampleDuration = 5; // ms -function getGeneratorVelocity(resolveValue, t, current) { - const prevT = Math.max(t - velocitySampleDuration, 0); - return velocityPerSecond(current - resolveValue(prevT), t - prevT); -} - -export { getGeneratorVelocity }; -//# sourceMappingURL=velocity.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/generators/utils/velocity.mjs.map b/node_modules/motion-dom/dist/es/animation/generators/utils/velocity.mjs.map deleted file mode 100644 index 2800cf1..0000000 --- a/node_modules/motion-dom/dist/es/animation/generators/utils/velocity.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"velocity.mjs","sources":["../../../../../src/animation/generators/utils/velocity.ts"],"sourcesContent":["import { velocityPerSecond } from \"motion-utils\"\n\nconst velocitySampleDuration = 5 // ms\n\nexport function getGeneratorVelocity(\n resolveValue: (v: number) => number,\n t: number,\n current: number\n) {\n const prevT = Math.max(t - velocitySampleDuration, 0)\n return velocityPerSecond(current - resolveValue(prevT), t - prevT)\n}\n"],"names":[],"mappings":";;AAEA,MAAM,sBAAsB,GAAG,CAAC,CAAA;SAEhB,oBAAoB,CAChC,YAAmC,EACnC,CAAS,EACT,OAAe,EAAA;AAEf,IAAA,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,sBAAsB,EAAE,CAAC,CAAC;AACrD,IAAA,OAAO,iBAAiB,CAAC,OAAO,GAAG,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC;AACtE;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/interfaces/motion-value.mjs b/node_modules/motion-dom/dist/es/animation/interfaces/motion-value.mjs deleted file mode 100644 index 36cc86b..0000000 --- a/node_modules/motion-dom/dist/es/animation/interfaces/motion-value.mjs +++ /dev/null @@ -1,105 +0,0 @@ -import { secondsToMilliseconds, MotionGlobalConfig } from 'motion-utils'; -import { AsyncMotionValueAnimation } from '../AsyncMotionValueAnimation.mjs'; -import { JSAnimation } from '../JSAnimation.mjs'; -import { getValueTransition } from '../utils/get-value-transition.mjs'; -import { makeAnimationInstant } from '../utils/make-animation-instant.mjs'; -import { getDefaultTransition } from '../utils/default-transitions.mjs'; -import { getFinalKeyframe } from '../keyframes/get-final.mjs'; -import { isTransitionDefined } from '../utils/is-transition-defined.mjs'; -import { frame } from '../../frameloop/frame.mjs'; - -const animateMotionValue = (name, value, target, transition = {}, element, isHandoff) => (onComplete) => { - const valueTransition = getValueTransition(transition, name) || {}; - /** - * Most transition values are currently completely overwritten by value-specific - * transitions. In the future it'd be nicer to blend these transitions. But for now - * delay actually does inherit from the root transition if not value-specific. - */ - const delay = valueTransition.delay || transition.delay || 0; - /** - * Elapsed isn't a public transition option but can be passed through from - * optimized appear effects in milliseconds. - */ - let { elapsed = 0 } = transition; - elapsed = elapsed - secondsToMilliseconds(delay); - const options = { - keyframes: Array.isArray(target) ? target : [null, target], - ease: "easeOut", - velocity: value.getVelocity(), - ...valueTransition, - delay: -elapsed, - onUpdate: (v) => { - value.set(v); - valueTransition.onUpdate && valueTransition.onUpdate(v); - }, - onComplete: () => { - onComplete(); - valueTransition.onComplete && valueTransition.onComplete(); - }, - name, - motionValue: value, - element: isHandoff ? undefined : element, - }; - /** - * If there's no transition defined for this value, we can generate - * unique transition settings for this value. - */ - if (!isTransitionDefined(valueTransition)) { - Object.assign(options, getDefaultTransition(name, options)); - } - /** - * Both WAAPI and our internal animation functions use durations - * as defined by milliseconds, while our external API defines them - * as seconds. - */ - options.duration && (options.duration = secondsToMilliseconds(options.duration)); - options.repeatDelay && (options.repeatDelay = secondsToMilliseconds(options.repeatDelay)); - /** - * Support deprecated way to set initial value. Prefer keyframe syntax. - */ - if (options.from !== undefined) { - options.keyframes[0] = options.from; - } - let shouldSkip = false; - if (options.type === false || - (options.duration === 0 && !options.repeatDelay)) { - makeAnimationInstant(options); - if (options.delay === 0) { - shouldSkip = true; - } - } - if (MotionGlobalConfig.instantAnimations || - MotionGlobalConfig.skipAnimations || - element?.shouldSkipAnimations || - valueTransition.skipAnimations) { - shouldSkip = true; - makeAnimationInstant(options); - options.delay = 0; - } - /** - * If the transition type or easing has been explicitly set by the user - * then we don't want to allow flattening the animation. - */ - options.allowFlatten = !valueTransition.type && !valueTransition.ease; - /** - * If we can or must skip creating the animation, and apply only - * the final keyframe, do so. We also check once keyframes are resolved but - * this early check prevents the need to create an animation at all. - */ - if (shouldSkip && !isHandoff && value.get() !== undefined) { - const finalKeyframe = getFinalKeyframe(options.keyframes, valueTransition); - if (finalKeyframe !== undefined) { - frame.update(() => { - options.onUpdate(finalKeyframe); - options.onComplete(); - }); - return; - } - } - return valueTransition.isSync - ? new JSAnimation(options) - : new AsyncMotionValueAnimation(options); -}; - -export { animateMotionValue }; -//# sourceMappingURL=motion-value.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/interfaces/motion-value.mjs.map b/node_modules/motion-dom/dist/es/animation/interfaces/motion-value.mjs.map deleted file mode 100644 index 97a7cac..0000000 --- a/node_modules/motion-dom/dist/es/animation/interfaces/motion-value.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"motion-value.mjs","sources":["../../../../src/animation/interfaces/motion-value.ts"],"sourcesContent":["import { MotionGlobalConfig, secondsToMilliseconds } from \"motion-utils\"\nimport { AsyncMotionValueAnimation } from \"../AsyncMotionValueAnimation\"\nimport { JSAnimation } from \"../JSAnimation\"\nimport type {\n AnyResolvedKeyframe,\n ValueAnimationOptions,\n ValueTransition,\n} from \"../types\"\nimport type { UnresolvedKeyframes } from \"../keyframes/KeyframesResolver\"\nimport { getValueTransition } from \"../utils/get-value-transition\"\nimport { makeAnimationInstant } from \"../utils/make-animation-instant\"\nimport { getDefaultTransition } from \"../utils/default-transitions\"\nimport { getFinalKeyframe } from \"../keyframes/get-final\"\nimport { isTransitionDefined } from \"../utils/is-transition-defined\"\nimport { frame } from \"../../frameloop\"\nimport type { MotionValue, StartAnimation } from \"../../value\"\nimport type { VisualElement } from \"../../render/VisualElement\"\n\nexport const animateMotionValue =\n (\n name: string,\n value: MotionValue,\n target: V | UnresolvedKeyframes,\n transition: ValueTransition & { elapsed?: number } = {},\n element?: VisualElement,\n isHandoff?: boolean\n ): StartAnimation =>\n (onComplete) => {\n const valueTransition = getValueTransition(transition, name) || {}\n\n /**\n * Most transition values are currently completely overwritten by value-specific\n * transitions. In the future it'd be nicer to blend these transitions. But for now\n * delay actually does inherit from the root transition if not value-specific.\n */\n const delay = valueTransition.delay || transition.delay || 0\n\n /**\n * Elapsed isn't a public transition option but can be passed through from\n * optimized appear effects in milliseconds.\n */\n let { elapsed = 0 } = transition\n elapsed = elapsed - secondsToMilliseconds(delay)\n\n const options: ValueAnimationOptions = {\n keyframes: Array.isArray(target) ? target : [null, target],\n ease: \"easeOut\",\n velocity: value.getVelocity(),\n ...valueTransition,\n delay: -elapsed,\n onUpdate: (v) => {\n value.set(v)\n valueTransition.onUpdate && valueTransition.onUpdate(v)\n },\n onComplete: () => {\n onComplete()\n valueTransition.onComplete && valueTransition.onComplete()\n },\n name,\n motionValue: value,\n element: isHandoff ? undefined : element,\n }\n\n /**\n * If there's no transition defined for this value, we can generate\n * unique transition settings for this value.\n */\n if (!isTransitionDefined(valueTransition)) {\n Object.assign(options, getDefaultTransition(name, options))\n }\n\n /**\n * Both WAAPI and our internal animation functions use durations\n * as defined by milliseconds, while our external API defines them\n * as seconds.\n */\n options.duration &&= secondsToMilliseconds(options.duration)\n options.repeatDelay &&= secondsToMilliseconds(options.repeatDelay)\n\n /**\n * Support deprecated way to set initial value. Prefer keyframe syntax.\n */\n if (options.from !== undefined) {\n options.keyframes[0] = options.from as any\n }\n\n let shouldSkip = false\n\n if (\n (options as any).type === false ||\n (options.duration === 0 && !options.repeatDelay)\n ) {\n makeAnimationInstant(options)\n\n if (options.delay === 0) {\n shouldSkip = true\n }\n }\n\n if (\n MotionGlobalConfig.instantAnimations ||\n MotionGlobalConfig.skipAnimations ||\n element?.shouldSkipAnimations ||\n valueTransition.skipAnimations\n ) {\n shouldSkip = true\n makeAnimationInstant(options)\n options.delay = 0\n }\n\n /**\n * If the transition type or easing has been explicitly set by the user\n * then we don't want to allow flattening the animation.\n */\n options.allowFlatten = !valueTransition.type && !valueTransition.ease\n\n /**\n * If we can or must skip creating the animation, and apply only\n * the final keyframe, do so. We also check once keyframes are resolved but\n * this early check prevents the need to create an animation at all.\n */\n if (shouldSkip && !isHandoff && value.get() !== undefined) {\n const finalKeyframe = getFinalKeyframe(\n options.keyframes as V[],\n valueTransition\n )\n\n if (finalKeyframe !== undefined) {\n frame.update(() => {\n options.onUpdate!(finalKeyframe)\n options.onComplete!()\n })\n\n return\n }\n }\n\n return valueTransition.isSync\n ? new JSAnimation(options)\n : new AsyncMotionValueAnimation(options)\n }\n"],"names":[],"mappings":";;;;;;;;;;MAkBa,kBAAkB,GAC3B,CACI,IAAY,EACZ,KAAqB,EACrB,MAAkC,EAClC,aAAqD,EAAE,EACvD,OAA4B,EAC5B,SAAmB,KAEvB,CAAC,UAAU,KAAI;IACX,MAAM,eAAe,GAAG,kBAAkB,CAAC,UAAU,EAAE,IAAI,CAAC,IAAI,EAAE;AAElE;;;;AAIG;IACH,MAAM,KAAK,GAAG,eAAe,CAAC,KAAK,IAAI,UAAU,CAAC,KAAK,IAAI,CAAC;AAE5D;;;AAGG;AACH,IAAA,IAAI,EAAE,OAAO,GAAG,CAAC,EAAE,GAAG,UAAU;AAChC,IAAA,OAAO,GAAG,OAAO,GAAG,qBAAqB,CAAC,KAAK,CAAC;AAEhD,IAAA,MAAM,OAAO,GAA0B;AACnC,QAAA,SAAS,EAAE,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC;AAC1D,QAAA,IAAI,EAAE,SAAS;AACf,QAAA,QAAQ,EAAE,KAAK,CAAC,WAAW,EAAE;AAC7B,QAAA,GAAG,eAAe;QAClB,KAAK,EAAE,CAAC,OAAO;AACf,QAAA,QAAQ,EAAE,CAAC,CAAC,KAAI;AACZ,YAAA,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;YACZ,eAAe,CAAC,QAAQ,IAAI,eAAe,CAAC,QAAQ,CAAC,CAAC,CAAC;QAC3D,CAAC;QACD,UAAU,EAAE,MAAK;AACb,YAAA,UAAU,EAAE;AACZ,YAAA,eAAe,CAAC,UAAU,IAAI,eAAe,CAAC,UAAU,EAAE;QAC9D,CAAC;QACD,IAAI;AACJ,QAAA,WAAW,EAAE,KAAK;QAClB,OAAO,EAAE,SAAS,GAAG,SAAS,GAAG,OAAO;KAC3C;AAED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AAC,GAAG,EAAE,KAAK,SAAS,EAAE;QACvD,MAAM,aAAa,GAAG,gBAAgB,CAClC,OAAO,CAAC,SAAgB,EACxB,eAAe,CAClB;AAED,QAAA,IAAI,aAAa,KAAK,SAAS,EAAE;AAC7B,YAAA,KAAK,CAAC,MAAM,CAAC,MAAK;AACd,gBAAA,OAAO,CAAC,QAAS,CAAC,aAAa,CAAC;gBAChC,OAAO,CAAC,UAAW,EAAE;AACzB,YAAA,CAAC,CAAC;YAEF;QACJ;IACJ;IAEA,OAAO,eAAe,CAAC;AACnB,UAAE,IAAI,WAAW,CAAC,OAAO;AACzB,UAAE,IAAI,yBAAyB,CAAC,OAAO,CAAC;AAChD;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-target.mjs b/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-target.mjs deleted file mode 100644 index 836bb0c..0000000 --- a/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-target.mjs +++ /dev/null @@ -1,108 +0,0 @@ -import { getValueTransition } from '../utils/get-value-transition.mjs'; -import { resolveTransition } from '../utils/resolve-transition.mjs'; -import { positionalKeys } from '../../render/utils/keys-position.mjs'; -import { setTarget } from '../../render/utils/setters.mjs'; -import { addValueToWillChange } from '../../value/will-change/add-will-change.mjs'; -import { getOptimisedAppearId } from '../optimized-appear/get-appear-id.mjs'; -import { animateMotionValue } from './motion-value.mjs'; -import { frame } from '../../frameloop/frame.mjs'; - -/** - * Decide whether we should block this animation. Previously, we achieved this - * just by checking whether the key was listed in protectedKeys, but this - * posed problems if an animation was triggered by afterChildren and protectedKeys - * had been set to true in the meantime. - */ -function shouldBlockAnimation({ protectedKeys, needsAnimating }, key) { - const shouldBlock = protectedKeys.hasOwnProperty(key) && needsAnimating[key] !== true; - needsAnimating[key] = false; - return shouldBlock; -} -function animateTarget(visualElement, targetAndTransition, { delay = 0, transitionOverride, type } = {}) { - let { transition, transitionEnd, ...target } = targetAndTransition; - const defaultTransition = visualElement.getDefaultTransition(); - transition = transition - ? resolveTransition(transition, defaultTransition) - : defaultTransition; - const reduceMotion = transition?.reduceMotion; - const skipAnimations = transition?.skipAnimations; - if (transitionOverride) - transition = transitionOverride; - const animations = []; - const animationTypeState = type && - visualElement.animationState && - visualElement.animationState.getState()[type]; - const path = transition?.path; - if (path) { - // path mutates `target` to claim x/y; loop below skips them. - path.animateVisualElement(visualElement, target, transition, delay, animations); - } - for (const key in target) { - const value = visualElement.getValue(key, visualElement.latestValues[key] ?? null); - const valueTarget = target[key]; - if (valueTarget === undefined || - (animationTypeState && - shouldBlockAnimation(animationTypeState, key))) { - continue; - } - const valueTransition = { - delay, - ...getValueTransition(transition || {}, key), - }; - if (skipAnimations) - valueTransition.skipAnimations = true; - /** - * If the value is already at the defined target, skip the animation. - * We still re-assert the value via frame.update to take precedence - * over any stale transitionEnd callbacks from previous animations. - */ - const currentValue = value.get(); - if (currentValue !== undefined && - !value.isAnimating() && - !Array.isArray(valueTarget) && - valueTarget === currentValue && - !valueTransition.velocity) { - frame.update(() => value.set(valueTarget)); - continue; - } - /** - * If this is the first time a value is being animated, check - * to see if we're handling off from an existing animation. - */ - let isHandoff = false; - if (window.MotionHandoffAnimation) { - const appearId = getOptimisedAppearId(visualElement); - if (appearId) { - const startTime = window.MotionHandoffAnimation(appearId, key, frame); - if (startTime !== null) { - valueTransition.startTime = startTime; - isHandoff = true; - } - } - } - addValueToWillChange(visualElement, key); - const shouldReduceMotion = reduceMotion ?? visualElement.shouldReduceMotion; - value.start(animateMotionValue(key, value, valueTarget, shouldReduceMotion && positionalKeys.has(key) - ? { type: false } - : valueTransition, visualElement, isHandoff)); - const animation = value.animation; - if (animation) { - animations.push(animation); - } - } - if (transitionEnd) { - const applyTransitionEnd = () => frame.update(() => { - transitionEnd && setTarget(visualElement, transitionEnd); - }); - if (animations.length) { - Promise.all(animations).then(applyTransitionEnd); - } - else { - applyTransitionEnd(); - } - } - return animations; -} - -export { animateTarget }; -//# sourceMappingURL=visual-element-target.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-target.mjs.map b/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-target.mjs.map deleted file mode 100644 index eb87d59..0000000 --- a/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-target.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"visual-element-target.mjs","sources":["../../../../src/animation/interfaces/visual-element-target.ts"],"sourcesContent":["import { frame } from \"../../frameloop\"\nimport { getValueTransition } from \"../utils/get-value-transition\"\nimport { resolveTransition } from \"../utils/resolve-transition\"\nimport { positionalKeys } from \"../../render/utils/keys-position\"\nimport { setTarget } from \"../../render/utils/setters\"\nimport { addValueToWillChange } from \"../../value/will-change/add-will-change\"\nimport { getOptimisedAppearId } from \"../optimized-appear/get-appear-id\"\nimport { animateMotionValue } from \"./motion-value\"\nimport type { MotionPath } from \"../types\"\nimport type { VisualElementAnimationOptions } from \"./types\"\nimport type { AnimationPlaybackControlsWithThen } from \"../types\"\nimport type { TargetAndTransition } from \"../../node/types\"\nimport type { AnimationTypeState } from \"../../render/utils/animation-state\"\nimport type { VisualElement } from \"../../render/VisualElement\"\n\n/**\n * Decide whether we should block this animation. Previously, we achieved this\n * just by checking whether the key was listed in protectedKeys, but this\n * posed problems if an animation was triggered by afterChildren and protectedKeys\n * had been set to true in the meantime.\n */\nfunction shouldBlockAnimation(\n { protectedKeys, needsAnimating }: AnimationTypeState,\n key: string\n) {\n const shouldBlock =\n protectedKeys.hasOwnProperty(key) && needsAnimating[key] !== true\n\n needsAnimating[key] = false\n return shouldBlock\n}\n\nexport function animateTarget(\n visualElement: VisualElement,\n targetAndTransition: TargetAndTransition,\n { delay = 0, transitionOverride, type }: VisualElementAnimationOptions = {}\n): AnimationPlaybackControlsWithThen[] {\n let {\n transition,\n transitionEnd,\n ...target\n } = targetAndTransition\n\n const defaultTransition = visualElement.getDefaultTransition()\n transition = transition\n ? resolveTransition(transition, defaultTransition)\n : defaultTransition\n\n const reduceMotion = (transition as { reduceMotion?: boolean })?.reduceMotion\n const skipAnimations = transition?.skipAnimations\n\n if (transitionOverride) transition = transitionOverride\n\n const animations: AnimationPlaybackControlsWithThen[] = []\n\n const animationTypeState =\n type &&\n visualElement.animationState &&\n visualElement.animationState.getState()[type]\n\n const path = (transition as { path?: MotionPath } | undefined)?.path\n if (path) {\n // path mutates `target` to claim x/y; loop below skips them.\n path.animateVisualElement(\n visualElement,\n target,\n transition,\n delay,\n animations\n )\n }\n\n for (const key in target) {\n const value = visualElement.getValue(\n key,\n visualElement.latestValues[key] ?? null\n )\n const valueTarget = target[key as keyof typeof target]\n\n if (\n valueTarget === undefined ||\n (animationTypeState &&\n shouldBlockAnimation(animationTypeState, key))\n ) {\n continue\n }\n\n const valueTransition = {\n delay,\n ...getValueTransition(transition || {}, key),\n }\n\n if (skipAnimations) valueTransition.skipAnimations = true\n\n /**\n * If the value is already at the defined target, skip the animation.\n * We still re-assert the value via frame.update to take precedence\n * over any stale transitionEnd callbacks from previous animations.\n */\n const currentValue = value.get()\n if (\n currentValue !== undefined &&\n !value.isAnimating() &&\n !Array.isArray(valueTarget) &&\n valueTarget === currentValue &&\n !valueTransition.velocity\n ) {\n frame.update(() => value.set(valueTarget as any))\n continue\n }\n\n /**\n * If this is the first time a value is being animated, check\n * to see if we're handling off from an existing animation.\n */\n let isHandoff = false\n if (window.MotionHandoffAnimation) {\n const appearId = getOptimisedAppearId(visualElement)\n\n if (appearId) {\n const startTime = window.MotionHandoffAnimation(\n appearId,\n key,\n frame\n )\n\n if (startTime !== null) {\n valueTransition.startTime = startTime\n isHandoff = true\n }\n }\n }\n\n addValueToWillChange(visualElement, key)\n\n const shouldReduceMotion =\n reduceMotion ?? visualElement.shouldReduceMotion\n\n value.start(\n animateMotionValue(\n key,\n value,\n valueTarget,\n shouldReduceMotion && positionalKeys.has(key)\n ? { type: false }\n : valueTransition,\n visualElement,\n isHandoff\n )\n )\n\n const animation = value.animation\n\n if (animation) {\n animations.push(animation)\n }\n }\n\n if (transitionEnd) {\n const applyTransitionEnd = () =>\n frame.update(() => {\n transitionEnd && setTarget(visualElement, transitionEnd)\n })\n\n if (animations.length) {\n Promise.all(animations).then(applyTransitionEnd)\n } else {\n applyTransitionEnd()\n }\n }\n\n return animations\n}\n"],"names":[],"mappings":";;;;;;;;;AAeA;;;;;AAKG;AACH,SAAS,oBAAoB,CACzB,EAAE,aAAa,EAAE,cAAc,EAAsB,EACrD,GAAW,EAAA;AAEX,IAAA,MAAM,WAAW,GACb,aAAa,CAAC,cAAc,CAAC,GAAG,CAAC,IAAI,cAAc,CAAC,GAAG,CAAC,KAAK,IAAI;AAErE,IAAA,cAAc,CAAC,GAAG,CAAC,GAAG,KAAK;AAC3B,IAAA,OAAO,WAAW;AACtB;SAEgB,aAAa,CACzB,aAA4B,EAC5B,mBAAwC,EACxC,EAAE,KAAK,GAAG,CAAC,EAAE,kBAAkB,EAAE,IAAI,KAAoC,EAAE,EAAA;IAE3E,IAAI,EACA,UAAU,EACV,aAAa,EACb,GAAG,MAAM,EACZ,GAAG,mBAAmB;AAEvB,IAAA,MAAM,iBAAiB,GAAG,aAAa,CAAC,oBAAoB,EAAE;AAC9D,IAAA,UAAU,GAAG;AACT,UAAE,iBAAiB,CAAC,UAAU,EAAE,iBAAiB;UAC/C,iBAAiB;AAEvB,IAAA,MAAM,YAAY,GAAI,UAAyC,EAAE,YAAY;AAC7E,IAAA,MAAM,cAAc,GAAG,UAAU,EAAE,cAAc;AAEjD,IAAA,IAAI,kBAAkB;QAAE,UAAU,GAAG,kBAAkB;IAEvD,MAAM,UAAU,GAAwC,EAAE;IAE1D,MAAM,kBAAkB,GACpB,IAAI;AACJ,QAAA,aAAa,CAAC,cAAc;QAC5B,aAAa,CAAC,cAAc,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC;AAEjD,IAAA,MAAM,IAAI,GAAI,UAAgD,EAAE,IAAI;IACpE,IAAI,IAAI,EAAE;;AAEN,QAAA,IAAI,CAAC,oBAA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,gBAAA,IAAI,SAAS,KAAK,IAAI,EAAE;AACpB,oBAAA,eAAe,CAAC,SAAS,GAAG,SAAS;oBACrC,SAAS,GAAG,IAAI;gBACpB;YACJ;QACJ;AAEA,QAAA,oBAAoB,CAAC,aAAa,EAAE,GAAG,CAAC;AAExC,QAAA,MAAM,kBAAkB,GACpB,YAAY,IAAI,aAAa,CAAC,kBAAkB;AAEpD,QAAA,KAAK,CAAC,KAAK,CACP,kBAAkB,CACd,GAAG,EACH,KAAK,EACL,WAAW,EACX,kBAAkB,IAAI,cAAc,CAAC,GAAG,CAAC,GAAG;AACxC,cAAE,EAAE,IAAI,EAAE,KAAK;cACb,eAAe,EACrB,aAAa,EACb,SAAS,CACZ,CACJ;AAED,QAAA,MAAM,SAAS,GAAG,KAAK,CAAC,SAAS;QAEjC,IAAI,SAAS,EAAE;AACX,YAAA,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC;QAC9B;IACJ;IAEA,IAAI,aAAa,EAAE;QACf,MAAM,kBAAkB,GAAG,MACvB,KAAK,CAAC,MAAM,CAAC,MAAK;AACd,YAAA,aAAa,IAAI,SAAS,CAAC,aAAa,EAAE,aAAa,CAAC;AAC5D,QAAA,CAAC,CAAC;AAEN,QAAA,IAAI,UAAU,CAAC,MAAM,EAAE;YACnB,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC;QACpD;aAAO;AACH,YAAA,kBAAkB,EAAE;QACxB;IACJ;AAEA,IAAA,OAAO,UAAU;AACrB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-variant.mjs b/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-variant.mjs deleted file mode 100644 index 65af372..0000000 --- a/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-variant.mjs +++ /dev/null @@ -1,60 +0,0 @@ -import { resolveVariant } from '../../render/utils/resolve-dynamic-variants.mjs'; -import { calcChildStagger } from '../utils/calc-child-stagger.mjs'; -import { animateTarget } from './visual-element-target.mjs'; - -function animateVariant(visualElement, variant, options = {}) { - const resolved = resolveVariant(visualElement, variant, options.type === "exit" - ? visualElement.presenceContext?.custom - : undefined); - let { transition = visualElement.getDefaultTransition() || {} } = resolved || {}; - if (options.transitionOverride) { - transition = options.transitionOverride; - } - /** - * If we have a variant, create a callback that runs it as an animation. - * Otherwise, we resolve a Promise immediately for a composable no-op. - */ - const getAnimation = resolved - ? () => Promise.all(animateTarget(visualElement, resolved, options)) - : () => Promise.resolve(); - /** - * If we have children, create a callback that runs all their animations. - * Otherwise, we resolve a Promise immediately for a composable no-op. - */ - const getChildAnimations = visualElement.variantChildren && visualElement.variantChildren.size - ? (forwardDelay = 0) => { - const { delayChildren = 0, staggerChildren, staggerDirection, } = transition; - return animateChildren(visualElement, variant, forwardDelay, delayChildren, staggerChildren, staggerDirection, options); - } - : () => Promise.resolve(); - /** - * If the transition explicitly defines a "when" option, we need to resolve either - * this animation or all children animations before playing the other. - */ - const { when } = transition; - if (when) { - const [first, last] = when === "beforeChildren" - ? [getAnimation, getChildAnimations] - : [getChildAnimations, getAnimation]; - return first().then(() => last()); - } - else { - return Promise.all([getAnimation(), getChildAnimations(options.delay)]); - } -} -function animateChildren(visualElement, variant, delay = 0, delayChildren = 0, staggerChildren = 0, staggerDirection = 1, options) { - const animations = []; - for (const child of visualElement.variantChildren) { - child.notify("AnimationStart", variant); - animations.push(animateVariant(child, variant, { - ...options, - delay: delay + - (typeof delayChildren === "function" ? 0 : delayChildren) + - calcChildStagger(visualElement.variantChildren, child, delayChildren, staggerChildren, staggerDirection), - }).then(() => child.notify("AnimationComplete", variant))); - } - return Promise.all(animations); -} - -export { animateVariant }; -//# sourceMappingURL=visual-element-variant.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-variant.mjs.map b/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-variant.mjs.map deleted file mode 100644 index 76b006c..0000000 --- a/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-variant.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"visual-element-variant.mjs","sources":["../../../../src/animation/interfaces/visual-element-variant.ts"],"sourcesContent":["import { resolveVariant } from \"../../render/utils/resolve-dynamic-variants\"\nimport { calcChildStagger } from \"../utils/calc-child-stagger\"\nimport type { VisualElementAnimationOptions } from \"./types\"\nimport { animateTarget } from \"./visual-element-target\"\nimport type { DynamicOption } from \"../types\"\nimport type { VisualElement } from \"../../render/VisualElement\"\n\nexport function animateVariant(\n visualElement: VisualElement,\n variant: string,\n options: VisualElementAnimationOptions = {}\n): Promise {\n const resolved = resolveVariant(\n visualElement,\n variant,\n options.type === \"exit\"\n ? visualElement.presenceContext?.custom\n : undefined\n )\n\n let { transition = visualElement.getDefaultTransition() || {} } =\n resolved || {}\n\n if (options.transitionOverride) {\n transition = options.transitionOverride\n }\n\n /**\n * If we have a variant, create a callback that runs it as an animation.\n * Otherwise, we resolve a Promise immediately for a composable no-op.\n */\n const getAnimation: () => Promise = resolved\n ? () => Promise.all(animateTarget(visualElement, resolved, options))\n : () => Promise.resolve()\n\n /**\n * If we have children, create a callback that runs all their animations.\n * Otherwise, we resolve a Promise immediately for a composable no-op.\n */\n const getChildAnimations =\n visualElement.variantChildren && visualElement.variantChildren.size\n ? (forwardDelay = 0) => {\n const {\n delayChildren = 0,\n staggerChildren,\n staggerDirection,\n } = transition\n\n return animateChildren(\n visualElement,\n variant,\n forwardDelay,\n delayChildren,\n staggerChildren,\n staggerDirection,\n options\n )\n }\n : () => Promise.resolve()\n\n /**\n * If the transition explicitly defines a \"when\" option, we need to resolve either\n * this animation or all children animations before playing the other.\n */\n const { when } = transition\n if (when) {\n const [first, last] =\n when === \"beforeChildren\"\n ? [getAnimation, getChildAnimations]\n : [getChildAnimations, getAnimation]\n\n return first().then(() => last())\n } else {\n return Promise.all([getAnimation(), getChildAnimations(options.delay)])\n }\n}\n\nfunction animateChildren(\n visualElement: VisualElement,\n variant: string,\n delay: number = 0,\n delayChildren: number | DynamicOption = 0,\n staggerChildren = 0,\n staggerDirection = 1,\n options: VisualElementAnimationOptions\n) {\n const animations: Promise[] = []\n\n for (const child of visualElement.variantChildren!) {\n child.notify(\"AnimationStart\", variant)\n animations.push(\n animateVariant(child, variant, {\n ...options,\n delay:\n delay +\n (typeof delayChildren === \"function\" ? 0 : delayChildren) +\n calcChildStagger(\n visualElement.variantChildren!,\n child,\n delayChildren,\n staggerChildren,\n staggerDirection\n ),\n }).then(() => child.notify(\"AnimationComplete\", variant))\n )\n }\n\n return Promise.all(animations)\n}\n"],"names":[],"mappings":";;;;AAOM,SAAU,cAAc,CAC1B,aAA4B,EAC5B,OAAe,EACf,UAAyC,EAAE,EAAA;AAE3C,IAAA,MAAM,QAAQ,GAAG,cAAc,CAC3B,aAAa,EACb,OAAO,EACP,OAAO,CAAC,IAAI,KAAK;AACb,UAAE,aAAa,CAAC,eAAe,EAAE;UAC/B,SAAS,CAClB;AAED,IAAA,IAAI,EAAE,UAAU,GAAG,aAAa,CAAC,oBAAoB,EAAE,IAAI,EAAE,EAAE,GAC3D,QAAQ,IAAI,EAAE;AAElB,IAAA,IAAI,OAAO,CAAC,kBAAkB,EAAE;AAC5B,QAAA,UAAU,GAAG,OAAO,CAAC,kBAAkB;IAC3C;AAEA;;;AAGG;IACH,MAAM,YAAY,GAAuB;AACrC,UAAE,MAAM,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,aAAa,EAAE,QAAQ,EAAE,OAAO,CAAC;UACjE,MAAM,OAAO,CAAC,OAAO,EAAE;AAE7B;;;AAGG;IACH,MAAM,kBAAkB,GACpB,aAAa,CAAC,eAAe,IAAI,aAAa,CAAC,eAAe,CAAC;AAC3D,UAAE,CAAC,YAAY,GAAG,CAAC,KAAI;YACjB,MAAM,EACF,aAAa,GAAG,CAAC,EACjB,eAAe,EACf,gBAAgB,GACnB,GAAG,UAAU;AAEd,YAAA,OAAO,eAAe,CAClB,aAAa,EACb,OAAO,EACP,YAAY,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AC5D;IACL;AAEA,IAAA,OAAO,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC;AAClC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/interfaces/visual-element.mjs b/node_modules/motion-dom/dist/es/animation/interfaces/visual-element.mjs deleted file mode 100644 index ecf983b..0000000 --- a/node_modules/motion-dom/dist/es/animation/interfaces/visual-element.mjs +++ /dev/null @@ -1,27 +0,0 @@ -import { resolveVariant } from '../../render/utils/resolve-dynamic-variants.mjs'; -import { animateTarget } from './visual-element-target.mjs'; -import { animateVariant } from './visual-element-variant.mjs'; - -function animateVisualElement(visualElement, definition, options = {}) { - visualElement.notify("AnimationStart", definition); - let animation; - if (Array.isArray(definition)) { - const animations = definition.map((variant) => animateVariant(visualElement, variant, options)); - animation = Promise.all(animations); - } - else if (typeof definition === "string") { - animation = animateVariant(visualElement, definition, options); - } - else { - const resolvedDefinition = typeof definition === "function" - ? resolveVariant(visualElement, definition, options.custom) - : definition; - animation = Promise.all(animateTarget(visualElement, resolvedDefinition, options)); - } - return animation.then(() => { - visualElement.notify("AnimationComplete", definition); - }); -} - -export { animateVisualElement }; -//# sourceMappingURL=visual-element.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/interfaces/visual-element.mjs.map b/node_modules/motion-dom/dist/es/animation/interfaces/visual-element.mjs.map deleted file mode 100644 index 487dabb..0000000 --- a/node_modules/motion-dom/dist/es/animation/interfaces/visual-element.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"visual-element.mjs","sources":["../../../../src/animation/interfaces/visual-element.ts"],"sourcesContent":["import { resolveVariant } from \"../../render/utils/resolve-dynamic-variants\"\nimport type { AnimationDefinition } from \"../../node/types\"\nimport type { VisualElement } from \"../../render/VisualElement\"\nimport type { VisualElementAnimationOptions } from \"./types\"\nimport { animateTarget } from \"./visual-element-target\"\nimport { animateVariant } from \"./visual-element-variant\"\n\nexport function animateVisualElement(\n visualElement: VisualElement,\n definition: AnimationDefinition,\n options: VisualElementAnimationOptions = {}\n) {\n visualElement.notify(\"AnimationStart\", definition)\n let animation: Promise\n\n if (Array.isArray(definition)) {\n const animations = definition.map((variant) =>\n animateVariant(visualElement, variant, options)\n )\n animation = Promise.all(animations)\n } else if (typeof definition === \"string\") {\n animation = animateVariant(visualElement, definition, options)\n } else {\n const resolvedDefinition =\n typeof definition === \"function\"\n ? resolveVariant(visualElement, definition, options.custom)\n : definition\n\n animation = Promise.all(\n animateTarget(visualElement, resolvedDefinition, options)\n )\n }\n\n return animation.then(() => {\n visualElement.notify(\"AnimationComplete\", definition)\n })\n}\n"],"names":[],"mappings":";;;;AAOM,SAAU,oBAAoB,CAChC,aAA4B,EAC5B,UAA+B,EAC/B,UAAyC,EAAE,EAAA;AAE3C,IAAA,aAAa,CAAC,MAAM,CAAC,gBAAgB,EAAE,UAAU,CAAC;AAClD,IAAA,IAAI,SAAuB;AAE3B,IAAA,IAAI,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;QAC3B,MAAM,UAAU,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,OAAO,KACtC,cAAc,CAAC,aAAa,EAAE,OAAO,EAAE,OAAO,CAAC,CAClD;AACD,QAAA,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC;IACvC;AAAO,SAAA,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE;QACvC,SAAS,GAAG,cAAc,CAAC,aAAa,EAAE,UAAU,EAAE,OAAO,CAAC;IAClE;SAAO;AACH,QAAA,MAAM,kBAAkB,GACpB,OAAO,UAAU,KAAK;cAChB,cAAc,CAAC,aAAa,EAAE,UAAU,EAAE,OAAO,CAAC,MAAM;cACxD,UAAU;AAEpB,QAAA,SAAS,GAAG,OAAO,CAAC,GAAG,CACnB,aAAa,CAAC,aAAa,EAAE,kBAAkB,EAAE,OAAO,CAAC,CAC5D;IACL;AAEA,IAAA,OAAO,SAAS,CAAC,IAAI,CAAC,MAAK;AACvB,QAAA,aAAa,CAAC,MAAM,CAAC,mBAAmB,EAAE,UAAU,CAAC;AACzD,IAAA,CAAC,CAAC;AACN;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.mjs b/node_modules/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.mjs deleted file mode 100644 index efd2f77..0000000 --- a/node_modules/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.mjs +++ /dev/null @@ -1,142 +0,0 @@ -import { positionalKeys } from '../../render/utils/keys-position.mjs'; -import { findDimensionValueType } from '../../value/types/dimensions.mjs'; -import { getVariableValue } from '../utils/css-variables-conversion.mjs'; -import { isCSSVariableToken, containsCSSVariable } from '../utils/is-css-variable.mjs'; -import { KeyframeResolver } from './KeyframesResolver.mjs'; -import { isNone } from './utils/is-none.mjs'; -import { makeNoneKeyframesAnimatable } from './utils/make-none-animatable.mjs'; -import { positionalValues, isNumOrPxType } from './utils/unit-conversion.mjs'; - -class DOMKeyframesResolver extends KeyframeResolver { - constructor(unresolvedKeyframes, onComplete, name, motionValue, element) { - super(unresolvedKeyframes, onComplete, name, motionValue, element, true); - } - readKeyframes() { - const { unresolvedKeyframes, element, name } = this; - if (!element || !element.current) - return; - super.readKeyframes(); - /** - * If any keyframe is a CSS variable, we need to find its value by sampling the element - */ - for (let i = 0; i < unresolvedKeyframes.length; i++) { - let keyframe = unresolvedKeyframes[i]; - if (typeof keyframe === "string") { - keyframe = keyframe.trim(); - if (isCSSVariableToken(keyframe)) { - const resolved = getVariableValue(keyframe, element.current); - if (resolved !== undefined) { - unresolvedKeyframes[i] = resolved; - } - if (i === unresolvedKeyframes.length - 1) { - this.finalKeyframe = keyframe; - } - } - } - } - /** - * Resolve "none" values. We do this potentially twice - once before and once after measuring keyframes. - * This could be seen as inefficient but it's a trade-off to avoid measurements in more situations, which - * have a far bigger performance impact. - */ - this.resolveNoneKeyframes(); - /** - * Check to see if unit type has changed. If so schedule jobs that will - * temporarily set styles to the destination keyframes. - * Skip if we have more than two keyframes or this isn't a positional value. - * TODO: We can throw if there are multiple keyframes and the value type changes. - */ - if (!positionalKeys.has(name) || unresolvedKeyframes.length !== 2) { - return; - } - const [origin, target] = unresolvedKeyframes; - const originType = findDimensionValueType(origin); - const targetType = findDimensionValueType(target); - /** - * If one keyframe contains embedded CSS variables (e.g. in calc()) and the other - * doesn't, we need to measure to convert to pixels. This handles GitHub issue #3410. - */ - const originHasVar = containsCSSVariable(origin); - const targetHasVar = containsCSSVariable(target); - if (originHasVar !== targetHasVar && positionalValues[name]) { - this.needsMeasurement = true; - return; - } - /** - * Either we don't recognise these value types or we can animate between them. - */ - if (originType === targetType) - return; - /** - * If both values are numbers or pixels, we can animate between them by - * converting them to numbers. - */ - if (isNumOrPxType(originType) && isNumOrPxType(targetType)) { - for (let i = 0; i < unresolvedKeyframes.length; i++) { - const value = unresolvedKeyframes[i]; - if (typeof value === "string") { - unresolvedKeyframes[i] = parseFloat(value); - } - } - } - else if (positionalValues[name]) { - /** - * Else, the only way to resolve this is by measuring the element. - */ - this.needsMeasurement = true; - } - } - resolveNoneKeyframes() { - const { unresolvedKeyframes, name } = this; - const noneKeyframeIndexes = []; - for (let i = 0; i < unresolvedKeyframes.length; i++) { - if (unresolvedKeyframes[i] === null || - isNone(unresolvedKeyframes[i])) { - noneKeyframeIndexes.push(i); - } - } - if (noneKeyframeIndexes.length) { - makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, name); - } - } - measureInitialState() { - const { element, unresolvedKeyframes, name } = this; - if (!element || !element.current) - return; - if (name === "height") { - this.suspendedScrollY = window.pageYOffset; - } - this.measuredOrigin = positionalValues[name](element.measureViewportBox(), window.getComputedStyle(element.current)); - unresolvedKeyframes[0] = this.measuredOrigin; - // Set final key frame to measure after next render - const measureKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1]; - if (measureKeyframe !== undefined) { - element.getValue(name, measureKeyframe).jump(measureKeyframe, false); - } - } - measureEndState() { - const { element, name, unresolvedKeyframes } = this; - if (!element || !element.current) - return; - const value = element.getValue(name); - value && value.jump(this.measuredOrigin, false); - const finalKeyframeIndex = unresolvedKeyframes.length - 1; - const finalKeyframe = unresolvedKeyframes[finalKeyframeIndex]; - unresolvedKeyframes[finalKeyframeIndex] = positionalValues[name](element.measureViewportBox(), window.getComputedStyle(element.current)); - if (finalKeyframe !== null && this.finalKeyframe === undefined) { - this.finalKeyframe = finalKeyframe; - } - // If we removed transform values, reapply them before the next render - if (this.removedTransforms?.length) { - this.removedTransforms.forEach(([unsetTransformName, unsetTransformValue]) => { - element - .getValue(unsetTransformName) - .set(unsetTransformValue); - }); - } - this.resolveNoneKeyframes(); - } -} - -export { DOMKeyframesResolver }; -//# sourceMappingURL=DOMKeyframesResolver.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.mjs.map b/node_modules/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.mjs.map deleted file mode 100644 index 4d5ea9e..0000000 --- a/node_modules/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"DOMKeyframesResolver.mjs","sources":["../../../../src/animation/keyframes/DOMKeyframesResolver.ts"],"sourcesContent":["import { positionalKeys } from \"../../render/utils/keys-position\"\nimport { MotionValue } from \"../../value\"\nimport { findDimensionValueType } from \"../../value/types/dimensions\"\nimport { AnyResolvedKeyframe } from \"../types\"\nimport { getVariableValue } from \"../utils/css-variables-conversion\"\nimport {\n containsCSSVariable,\n isCSSVariableToken,\n} from \"../utils/is-css-variable\"\nimport {\n KeyframeResolver,\n OnKeyframesResolved,\n UnresolvedKeyframes,\n} from \"./KeyframesResolver\"\nimport { WithRender } from \"./types\"\nimport { isNone } from \"./utils/is-none\"\nimport { makeNoneKeyframesAnimatable } from \"./utils/make-none-animatable\"\nimport { isNumOrPxType, positionalValues } from \"./utils/unit-conversion\"\n\nexport class DOMKeyframesResolver<\n T extends AnyResolvedKeyframe\n> extends KeyframeResolver {\n name: string\n element?: WithRender\n\n private removedTransforms?: [string, AnyResolvedKeyframe][]\n private measuredOrigin?: AnyResolvedKeyframe\n\n constructor(\n unresolvedKeyframes: UnresolvedKeyframes,\n onComplete: OnKeyframesResolved,\n name?: string,\n motionValue?: MotionValue,\n element?: WithRender\n ) {\n super(unresolvedKeyframes, onComplete, name, motionValue, element, true)\n }\n\n readKeyframes() {\n const { unresolvedKeyframes, element, name } = this\n\n if (!element || !element.current) return\n\n super.readKeyframes()\n\n /**\n * If any keyframe is a CSS variable, we need to find its value by sampling the element\n */\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n let keyframe = unresolvedKeyframes[i]\n\n if (typeof keyframe === \"string\") {\n keyframe = keyframe.trim()\n\n if (isCSSVariableToken(keyframe)) {\n const resolved = getVariableValue(keyframe, element.current)\n\n if (resolved !== undefined) {\n unresolvedKeyframes[i] = resolved as T\n }\n\n if (i === unresolvedKeyframes.length - 1) {\n this.finalKeyframe = keyframe as T\n }\n }\n }\n }\n\n /**\n * Resolve \"none\" values. We do this potentially twice - once before and once after measuring keyframes.\n * This could be seen as inefficient but it's a trade-off to avoid measurements in more situations, which\n * have a far bigger performance impact.\n */\n this.resolveNoneKeyframes()\n\n /**\n * Check to see if unit type has changed. If so schedule jobs that will\n * temporarily set styles to the destination keyframes.\n * Skip if we have more than two keyframes or this isn't a positional value.\n * TODO: We can throw if there are multiple keyframes and the value type changes.\n */\n if (!positionalKeys.has(name) || unresolvedKeyframes.length !== 2) {\n return\n }\n\n const [origin, target] = unresolvedKeyframes\n const originType = findDimensionValueType(origin)\n const targetType = findDimensionValueType(target)\n\n /**\n * If one keyframe contains embedded CSS variables (e.g. in calc()) and the other\n * doesn't, we need to measure to convert to pixels. This handles GitHub issue #3410.\n */\n const originHasVar = containsCSSVariable(origin)\n const targetHasVar = containsCSSVariable(target)\n\n if (originHasVar !== targetHasVar && positionalValues[name]) {\n this.needsMeasurement = true\n return\n }\n\n /**\n * Either we don't recognise these value types or we can animate between them.\n */\n if (originType === targetType) return\n\n /**\n * If both values are numbers or pixels, we can animate between them by\n * converting them to numbers.\n */\n if (isNumOrPxType(originType) && isNumOrPxType(targetType)) {\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n const value = unresolvedKeyframes[i]\n if (typeof value === \"string\") {\n unresolvedKeyframes[i] = parseFloat(value as string)\n }\n }\n } else if (positionalValues[name]) {\n /**\n * Else, the only way to resolve this is by measuring the element.\n */\n this.needsMeasurement = true\n }\n }\n\n resolveNoneKeyframes() {\n const { unresolvedKeyframes, name } = this\n\n const noneKeyframeIndexes: number[] = []\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n if (\n unresolvedKeyframes[i] === null ||\n isNone(unresolvedKeyframes[i])\n ) {\n noneKeyframeIndexes.push(i)\n }\n }\n\n if (noneKeyframeIndexes.length) {\n makeNoneKeyframesAnimatable(\n unresolvedKeyframes,\n noneKeyframeIndexes,\n name\n )\n }\n }\n\n measureInitialState() {\n const { element, unresolvedKeyframes, name } = this\n\n if (!element || !element.current) return\n\n if (name === \"height\") {\n this.suspendedScrollY = window.pageYOffset\n }\n\n this.measuredOrigin = positionalValues[name](\n element.measureViewportBox(),\n window.getComputedStyle(element.current)\n )\n\n unresolvedKeyframes[0] = this.measuredOrigin\n\n // Set final key frame to measure after next render\n const measureKeyframe =\n unresolvedKeyframes[unresolvedKeyframes.length - 1]\n\n if (measureKeyframe !== undefined) {\n element.getValue(name, measureKeyframe).jump(measureKeyframe, false)\n }\n }\n\n measureEndState() {\n const { element, name, unresolvedKeyframes } = this\n\n if (!element || !element.current) return\n\n const value = element.getValue(name)\n value && value.jump(this.measuredOrigin, false)\n\n const finalKeyframeIndex = unresolvedKeyframes.length - 1\n const finalKeyframe = unresolvedKeyframes[finalKeyframeIndex]\n\n unresolvedKeyframes[finalKeyframeIndex] = positionalValues[name](\n element.measureViewportBox(),\n window.getComputedStyle(element.current)\n ) as any\n\n if (finalKeyframe !== null && this.finalKeyframe === undefined) {\n this.finalKeyframe = finalKeyframe as T\n }\n\n // If we removed transform values, reapply them before the next render\n if (this.removedTransforms?.length) {\n this.removedTransforms.forEach(\n ([unsetTransformName, unsetTransformValue]) => {\n element\n .getValue(unsetTransformName)!\n .set(unsetTransformValue)\n }\n )\n }\n\n this.resolveNoneKeyframes()\n }\n}\n"],"names":[],"mappings":";;;;;;;;;AAmBM,MAAO,oBAEX,SAAQ,gBAAmB,CAAA;IAOzB,WAAA,CACI,mBAA6D,EAC7D,UAAkC,EAClC,IAAa,EACb,WAA4B,EAC5B,OAAoB,EAAA;AAEpB,QAAA,KAAK,CAAC,mBAAmB,EAAE,UAAU,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,IAAI,CAAC;IAC5E;IAEA,aAAa,GAAA;QACT,MAAM,EAAE,mBAAmB,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,IAAI;AAEnD,QAAA,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO;YAAE;QAElC,KAAK,CAAC,aAAa,EAAE;AAErB;;AAEG;AACH,QAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,mBAAmB,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AACjD,YAAA,IAAI,QAAQ,GAAG,mBAAmB,CAAC,CAAC,CAAC;AAErC,YAAA,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE;AAC9B,gBAAA,QAAQ,GAAG,QAAQ,CAAC,IAAI,EAAE;AAE1B,gBAAA,IAAI,kBAAkB,CAAC,QAAQ,CAAC,EAAE;oBAC9B,MAAM,QAAQ,GAAG,gBAAgB,CAAC,QAAQ,EAAE,OAAO,CAAC,OAAO,CAAC;AAE5D,oBAAA,IAAI,QAAQ,KAAK,SAAS,EAAE;AACxB,wBAAA,mBAAmB,CAAC,CAAC,CAAC,GAAG,QAAa;oBAC1C;oBAEA,IAAI,CAAC,KAAK,mBAAmB,CAAC,MAAM,GAAG,CAAC,EAAE;AACtC,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ACxE;IACJ;IAEA,eAAe,GAAA;QACX,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,mBAAmB,EAAE,GAAG,IAAI;AAEnD,QAAA,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO;YAAE;QAElC,MAAM,KAAK,GAAG,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC;QACpC,KAAK,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,KAAK,CAAC;AAE/C,QAAA,MAAM,kBAAkB,GAAG,mBAAmB,CAAC,MAAM,GAAG,CAAC;AACzD,QAAA,MAAM,aAAa,GAAG,mBAAmB,CAAC,kBAAkB,CAAC;QAE7D,mBAAmB,CAAC,kBAAkB,CAAC,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAC5D,OAAO,CAAC,kBAAkB,EAAE,EAC5B,MAAM,CAAC,gBAAgB,CAAC,OAAO,CAAC,OAAO,CAAC,CACpC;QAER,IAAI,aAAa,KAAK,IAAI,IAAI,IAAI,CAAC,aAAa,KAAK,SAAS,EAAE;AAC5D,YAAA,IAAI,CAAC,aAAa,GAAG,aAAkB;QAC3C;;AAGA,QAAA,IAAI,IAAI,CAAC,iBAAiB,EAAE,MAAM,EAAE;AAChC,YAAA,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAC1B,CAAC,CAAC,kBAAkB,EAAE,mBAAmB,CAAC,KAAI;gBAC1C;qBACK,QAAQ,CAAC,kBAAkB;qBAC3B,GAAG,CAAC,mBAAmB,CAAC;AACjC,YAAA,CAAC,CACJ;QACL;QAEA,IAAI,CAAC,oBAAoB,EAAE;IAC/B;AACH;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/keyframes/KeyframesResolver.mjs b/node_modules/motion-dom/dist/es/animation/keyframes/KeyframesResolver.mjs deleted file mode 100644 index 262a2f3..0000000 --- a/node_modules/motion-dom/dist/es/animation/keyframes/KeyframesResolver.mjs +++ /dev/null @@ -1,148 +0,0 @@ -import { fillWildcards } from './utils/fill-wildcards.mjs'; -import { removeNonTranslationalTransform } from './utils/unit-conversion.mjs'; -import { frame } from '../../frameloop/frame.mjs'; - -const toResolve = new Set(); -let isScheduled = false; -let anyNeedsMeasurement = false; -let isForced = false; -function measureAllKeyframes() { - if (anyNeedsMeasurement) { - const resolversToMeasure = Array.from(toResolve).filter((resolver) => resolver.needsMeasurement); - const elementsToMeasure = new Set(resolversToMeasure.map((resolver) => resolver.element)); - const transformsToRestore = new Map(); - /** - * Write pass - * If we're measuring elements we want to remove bounding box-changing transforms. - */ - elementsToMeasure.forEach((element) => { - const removedTransforms = removeNonTranslationalTransform(element); - if (!removedTransforms.length) - return; - transformsToRestore.set(element, removedTransforms); - element.render(); - }); - // Read - resolversToMeasure.forEach((resolver) => resolver.measureInitialState()); - // Write - elementsToMeasure.forEach((element) => { - element.render(); - const restore = transformsToRestore.get(element); - if (restore) { - restore.forEach(([key, value]) => { - element.getValue(key)?.set(value); - }); - } - }); - // Read - resolversToMeasure.forEach((resolver) => resolver.measureEndState()); - // Write - resolversToMeasure.forEach((resolver) => { - if (resolver.suspendedScrollY !== undefined) { - window.scrollTo(0, resolver.suspendedScrollY); - } - }); - } - anyNeedsMeasurement = false; - isScheduled = false; - toResolve.forEach((resolver) => resolver.complete(isForced)); - toResolve.clear(); -} -function readAllKeyframes() { - toResolve.forEach((resolver) => { - resolver.readKeyframes(); - if (resolver.needsMeasurement) { - anyNeedsMeasurement = true; - } - }); -} -function flushKeyframeResolvers() { - isForced = true; - readAllKeyframes(); - measureAllKeyframes(); - isForced = false; -} -class KeyframeResolver { - constructor(unresolvedKeyframes, onComplete, name, motionValue, element, isAsync = false) { - this.state = "pending"; - /** - * Track whether this resolver is async. If it is, it'll be added to the - * resolver queue and flushed in the next frame. Resolvers that aren't going - * to trigger read/write thrashing don't need to be async. - */ - this.isAsync = false; - /** - * Track whether this resolver needs to perform a measurement - * to resolve its keyframes. - */ - this.needsMeasurement = false; - this.unresolvedKeyframes = [...unresolvedKeyframes]; - this.onComplete = onComplete; - this.name = name; - this.motionValue = motionValue; - this.element = element; - this.isAsync = isAsync; - } - scheduleResolve() { - this.state = "scheduled"; - if (this.isAsync) { - toResolve.add(this); - if (!isScheduled) { - isScheduled = true; - frame.read(readAllKeyframes); - frame.resolveKeyframes(measureAllKeyframes); - } - } - else { - this.readKeyframes(); - this.complete(); - } - } - readKeyframes() { - const { unresolvedKeyframes, name, element, motionValue } = this; - // If initial keyframe is null we need to read it from the DOM - if (unresolvedKeyframes[0] === null) { - const currentValue = motionValue?.get(); - // TODO: This doesn't work if the final keyframe is a wildcard - const finalKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1]; - if (currentValue !== undefined) { - unresolvedKeyframes[0] = currentValue; - } - else if (element && name) { - const valueAsRead = element.readValue(name, finalKeyframe); - if (valueAsRead !== undefined && valueAsRead !== null) { - unresolvedKeyframes[0] = valueAsRead; - } - } - if (unresolvedKeyframes[0] === undefined) { - unresolvedKeyframes[0] = finalKeyframe; - } - if (motionValue && currentValue === undefined) { - motionValue.set(unresolvedKeyframes[0]); - } - } - fillWildcards(unresolvedKeyframes); - } - setFinalKeyframe() { } - measureInitialState() { } - renderEndStyles() { } - measureEndState() { } - complete(isForcedComplete = false) { - this.state = "complete"; - this.onComplete(this.unresolvedKeyframes, this.finalKeyframe, isForcedComplete); - toResolve.delete(this); - } - cancel() { - if (this.state === "scheduled") { - toResolve.delete(this); - this.state = "pending"; - } - } - resume() { - if (this.state === "pending") - this.scheduleResolve(); - } -} - -export { KeyframeResolver, flushKeyframeResolvers }; -//# sourceMappingURL=KeyframesResolver.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/keyframes/KeyframesResolver.mjs.map b/node_modules/motion-dom/dist/es/animation/keyframes/KeyframesResolver.mjs.map deleted file mode 100644 index 32e68e2..0000000 --- a/node_modules/motion-dom/dist/es/animation/keyframes/KeyframesResolver.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"KeyframesResolver.mjs","sources":["../../../../src/animation/keyframes/KeyframesResolver.ts"],"sourcesContent":["import { frame } from \"../../frameloop\"\nimport { MotionValue } from \"../../value\"\nimport { AnyResolvedKeyframe } from \"../types\"\nimport { WithRender } from \"./types\"\nimport { fillWildcards } from \"./utils/fill-wildcards\"\nimport { removeNonTranslationalTransform } from \"./utils/unit-conversion\"\n\nexport type UnresolvedKeyframes = Array\n\nexport type ResolvedKeyframes = Array\n\nconst toResolve = new Set()\nlet isScheduled = false\nlet anyNeedsMeasurement = false\nlet isForced = false\n\nfunction measureAllKeyframes() {\n if (anyNeedsMeasurement) {\n const resolversToMeasure = Array.from(toResolve).filter(\n (resolver: KeyframeResolver) => resolver.needsMeasurement\n )\n const elementsToMeasure = new Set(\n resolversToMeasure.map((resolver) => resolver.element)\n )\n const transformsToRestore = new Map<\n WithRender,\n [string, AnyResolvedKeyframe][]\n >()\n\n /**\n * Write pass\n * If we're measuring elements we want to remove bounding box-changing transforms.\n */\n elementsToMeasure.forEach((element: WithRender) => {\n const removedTransforms = removeNonTranslationalTransform(\n element as any\n )\n\n if (!removedTransforms.length) return\n\n transformsToRestore.set(element, removedTransforms)\n\n element.render()\n })\n\n // Read\n resolversToMeasure.forEach((resolver) => resolver.measureInitialState())\n\n // Write\n elementsToMeasure.forEach((element: WithRender) => {\n element.render()\n\n const restore = transformsToRestore.get(element)\n if (restore) {\n restore.forEach(([key, value]) => {\n element.getValue(key)?.set(value)\n })\n }\n })\n\n // Read\n resolversToMeasure.forEach((resolver) => resolver.measureEndState())\n\n // Write\n resolversToMeasure.forEach((resolver) => {\n if (resolver.suspendedScrollY !== undefined) {\n window.scrollTo(0, resolver.suspendedScrollY)\n }\n })\n }\n\n anyNeedsMeasurement = false\n isScheduled = false\n\n toResolve.forEach((resolver) => resolver.complete(isForced))\n toResolve.clear()\n}\n\nfunction readAllKeyframes() {\n toResolve.forEach((resolver) => {\n resolver.readKeyframes()\n\n if (resolver.needsMeasurement) {\n anyNeedsMeasurement = true\n }\n })\n}\n\nexport function flushKeyframeResolvers() {\n isForced = true\n readAllKeyframes()\n measureAllKeyframes()\n isForced = false\n}\n\nexport type OnKeyframesResolved = (\n resolvedKeyframes: ResolvedKeyframes,\n finalKeyframe: T,\n forced: boolean\n) => void\n\nexport class KeyframeResolver {\n name?: string\n element?: WithRender\n finalKeyframe?: T\n suspendedScrollY?: number\n\n protected unresolvedKeyframes: UnresolvedKeyframes\n\n private motionValue?: MotionValue\n private onComplete: OnKeyframesResolved\n\n state: \"pending\" | \"scheduled\" | \"complete\" = \"pending\"\n\n /**\n * Track whether this resolver is async. If it is, it'll be added to the\n * resolver queue and flushed in the next frame. Resolvers that aren't going\n * to trigger read/write thrashing don't need to be async.\n */\n private isAsync = false\n\n /**\n * Track whether this resolver needs to perform a measurement\n * to resolve its keyframes.\n */\n needsMeasurement = false\n\n constructor(\n unresolvedKeyframes: UnresolvedKeyframes,\n onComplete: OnKeyframesResolved,\n name?: string,\n motionValue?: MotionValue,\n element?: WithRender,\n isAsync = false\n ) {\n this.unresolvedKeyframes = [...unresolvedKeyframes]\n this.onComplete = onComplete\n this.name = name\n this.motionValue = motionValue\n this.element = element\n this.isAsync = isAsync\n }\n\n scheduleResolve() {\n this.state = \"scheduled\"\n\n if (this.isAsync) {\n toResolve.add(this)\n\n if (!isScheduled) {\n isScheduled = true\n frame.read(readAllKeyframes)\n frame.resolveKeyframes(measureAllKeyframes)\n }\n } else {\n this.readKeyframes()\n this.complete()\n }\n }\n\n readKeyframes() {\n const { unresolvedKeyframes, name, element, motionValue } = this\n\n // If initial keyframe is null we need to read it from the DOM\n if (unresolvedKeyframes[0] === null) {\n const currentValue = motionValue?.get()\n\n // TODO: This doesn't work if the final keyframe is a wildcard\n const finalKeyframe =\n unresolvedKeyframes[unresolvedKeyframes.length - 1]\n\n if (currentValue !== undefined) {\n unresolvedKeyframes[0] = currentValue\n } else if (element && name) {\n const valueAsRead = element.readValue(name, finalKeyframe)\n\n if (valueAsRead !== undefined && valueAsRead !== null) {\n unresolvedKeyframes[0] = valueAsRead\n }\n }\n\n if (unresolvedKeyframes[0] === undefined) {\n unresolvedKeyframes[0] = finalKeyframe\n }\n\n if (motionValue && currentValue === undefined) {\n motionValue.set(unresolvedKeyframes[0] as T)\n }\n }\n\n fillWildcards(unresolvedKeyframes)\n }\n\n setFinalKeyframe() {}\n measureInitialState() {}\n renderEndStyles() {}\n measureEndState() {}\n\n complete(isForcedComplete = false) {\n this.state = \"complete\"\n\n this.onComplete(\n this.unresolvedKeyframes as ResolvedKeyframes,\n this.finalKeyframe as T,\n isForcedComplete\n )\n\n toResolve.delete(this)\n }\n\n cancel() {\n if (this.state === \"scheduled\") {\n toResolve.delete(this)\n this.state = \"pending\"\n }\n }\n\n resume() {\n if (this.state === \"pending\") this.scheduleResolve()\n }\n}\n"],"names":[],"mappings":";;;;AAWA,MAAM,SAAS,GAAG,IAAI,GAAG,EAAoB;AAC7C,IAAI,WAAW,GAAG,KAAK;AACvB,IAAI,mBAAmB,GAAG,KAAK;AAC/B,IAAI,QAAQ,GAAG,KAAK;AAEpB,SAAS,mBAAmB,GAAA;IACxB,IAAI,mBAAmB,EAAE;QACrB,MAAM,kBAAkB,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,MAAM,CACnD,CAAC,QAA0B,KAAK,QAAQ,CAAC,gBAAgB,CAC5D;AACD,QAAA,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAC7B,kBAAkB,CAAC,GAAG,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC,OAAO,CAAC,CACzD;AACD,QAAA,MAAM,mBAAmB,GAAG,IAAI,GAAG,EAGhC;AAEH;;;AAGG;AACH,QAAA,iBAAiB,CAAC,OAAO,CAAC,CAAC,OAAmB,KAAI;AAC9C,YAAA,MAAM,iBAAiB,GAAG,+BAA+B,CACrD,OAAc,CACjB;YAED,IAAI,CAAC,iBAAiB,CAAC,MAAM;gBAAE;AAE/B,YAAA,mBAAmB,CAAC,GAAG,CAA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IAAI,IAAI,CAAC,KAAK,KAAK,WAAW,EAAE;AAC5B,YAAA,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC;AACtB,YAAA,IAAI,CAAC,KAAK,GAAG,SAAS;QAC1B;IACJ;IAEA,MAAM,GAAA;AACF,QAAA,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS;YAAE,IAAI,CAAC,eAAe,EAAE;IACxD;AACH;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/keyframes/get-final.mjs b/node_modules/motion-dom/dist/es/animation/keyframes/get-final.mjs deleted file mode 100644 index 4306bd8..0000000 --- a/node_modules/motion-dom/dist/es/animation/keyframes/get-final.mjs +++ /dev/null @@ -1,12 +0,0 @@ -const isNotNull = (value) => value !== null; -function getFinalKeyframe(keyframes, { repeat, repeatType = "loop" }, finalKeyframe, speed = 1) { - const resolvedKeyframes = keyframes.filter(isNotNull); - const useFirstKeyframe = speed < 0 || (repeat && repeatType !== "loop" && repeat % 2 === 1); - const index = useFirstKeyframe ? 0 : resolvedKeyframes.length - 1; - return !index || finalKeyframe === undefined - ? resolvedKeyframes[index] - : finalKeyframe; -} - -export { getFinalKeyframe }; -//# sourceMappingURL=get-final.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/keyframes/get-final.mjs.map b/node_modules/motion-dom/dist/es/animation/keyframes/get-final.mjs.map deleted file mode 100644 index e364cbf..0000000 --- a/node_modules/motion-dom/dist/es/animation/keyframes/get-final.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"get-final.mjs","sources":["../../../../src/animation/keyframes/get-final.ts"],"sourcesContent":["import { AnimationPlaybackOptions } from \"../types\"\n\nconst isNotNull = (value: unknown) => value !== null\n\nexport function getFinalKeyframe(\n keyframes: T[],\n { repeat, repeatType = \"loop\" }: AnimationPlaybackOptions,\n finalKeyframe?: T,\n speed: number = 1\n): T {\n const resolvedKeyframes = keyframes.filter(isNotNull)\n const useFirstKeyframe =\n speed < 0 || (repeat && repeatType !== \"loop\" && repeat % 2 === 1)\n const index = useFirstKeyframe ? 0 : resolvedKeyframes.length - 1\n\n return !index || finalKeyframe === undefined\n ? resolvedKeyframes[index]\n : finalKeyframe\n}\n"],"names":[],"mappings":"AAEA,MAAM,SAAS,GAAG,CAAC,KAAc,KAAK,KAAK,KAAK,IAAI;SAEpC,gBAAgB,CAC5B,SAAc,EACd,EAAE,MAAM,EAAE,UAAU,GAAG,MAAM,EAA4B,EACzD,aAAiB,EACjB,QAAgB,CAAC,EAAA;IAEjB,MAAM,iBAAiB,GAAG,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC;AACrD,IAAA,MAAM,gBAAgB,GAClB,KAAK,GAAG,CAAC,KAAK,MAAM,IAAI,UAAU,KAAK,MAAM,IAAI,MAAM,GAAG,CAAC,KAAK,CAAC,CAAC;AACtE,IAAA,MAAM,KAAK,GAAG,gBAAgB,GAAG,CAAC,GAAG,iBAAiB,CAAC,MAAM,GAAG,CAAC;AAEjE,IAAA,OAAO,CAAC,KAAK,IAAI,aAAa,KAAK;AAC/B,UAAE,iBAAiB,CAAC,KAAK;UACvB,aAAa;AACvB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/keyframes/offsets/default.mjs b/node_modules/motion-dom/dist/es/animation/keyframes/offsets/default.mjs deleted file mode 100644 index c2735fe..0000000 --- a/node_modules/motion-dom/dist/es/animation/keyframes/offsets/default.mjs +++ /dev/null @@ -1,10 +0,0 @@ -import { fillOffset } from './fill.mjs'; - -function defaultOffset(arr) { - const offset = [0]; - fillOffset(offset, arr.length - 1); - return offset; -} - -export { defaultOffset }; -//# sourceMappingURL=default.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/keyframes/offsets/default.mjs.map b/node_modules/motion-dom/dist/es/animation/keyframes/offsets/default.mjs.map deleted file mode 100644 index 108037c..0000000 --- a/node_modules/motion-dom/dist/es/animation/keyframes/offsets/default.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"default.mjs","sources":["../../../../../src/animation/keyframes/offsets/default.ts"],"sourcesContent":["import { fillOffset } from \"./fill\"\n\nexport function defaultOffset(arr: any[]): number[] {\n const offset = [0]\n fillOffset(offset, arr.length - 1)\n return offset\n}\n"],"names":[],"mappings":";;AAEM,SAAU,aAAa,CAAC,GAAU,EAAA;AACpC,IAAA,MAAM,MAAM,GAAG,CAAC,CAAC,CAAC;IAClB,UAAU,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC;AAClC,IAAA,OAAO,MAAM;AACjB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/keyframes/offsets/fill.mjs b/node_modules/motion-dom/dist/es/animation/keyframes/offsets/fill.mjs deleted file mode 100644 index 9f1f783..0000000 --- a/node_modules/motion-dom/dist/es/animation/keyframes/offsets/fill.mjs +++ /dev/null @@ -1,13 +0,0 @@ -import { progress } from 'motion-utils'; -import { mixNumber } from '../../../utils/mix/number.mjs'; - -function fillOffset(offset, remaining) { - const min = offset[offset.length - 1]; - for (let i = 1; i <= remaining; i++) { - const offsetProgress = progress(0, remaining, i); - offset.push(mixNumber(min, 1, offsetProgress)); - } -} - -export { fillOffset }; -//# sourceMappingURL=fill.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/keyframes/offsets/fill.mjs.map b/node_modules/motion-dom/dist/es/animation/keyframes/offsets/fill.mjs.map deleted file mode 100644 index 6c2896a..0000000 --- a/node_modules/motion-dom/dist/es/animation/keyframes/offsets/fill.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"fill.mjs","sources":["../../../../../src/animation/keyframes/offsets/fill.ts"],"sourcesContent":["import { progress } from \"motion-utils\"\nimport { mixNumber } from \"../../../utils/mix/number\"\n\nexport function fillOffset(offset: number[], remaining: number): void {\n const min = offset[offset.length - 1]\n for (let i = 1; i <= remaining; i++) {\n const offsetProgress = progress(0, remaining, i)\n offset.push(mixNumber(min, 1, offsetProgress))\n }\n}\n"],"names":[],"mappings":";;;AAGM,SAAU,UAAU,CAAC,MAAgB,EAAE,SAAiB,EAAA;IAC1D,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;AACrC,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,SAAS,EAAE,CAAC,EAAE,EAAE;QACjC,MAAM,cAAc,GAAG,QAAQ,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC;AAChD,QAAA,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,EAAE,cAAc,CAAC,CAAC;IAClD;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/keyframes/offsets/time.mjs b/node_modules/motion-dom/dist/es/animation/keyframes/offsets/time.mjs deleted file mode 100644 index 9c2a8cf..0000000 --- a/node_modules/motion-dom/dist/es/animation/keyframes/offsets/time.mjs +++ /dev/null @@ -1,6 +0,0 @@ -function convertOffsetToTimes(offset, duration) { - return offset.map((o) => o * duration); -} - -export { convertOffsetToTimes }; -//# sourceMappingURL=time.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/keyframes/offsets/time.mjs.map b/node_modules/motion-dom/dist/es/animation/keyframes/offsets/time.mjs.map deleted file mode 100644 index f79b799..0000000 --- a/node_modules/motion-dom/dist/es/animation/keyframes/offsets/time.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"time.mjs","sources":["../../../../../src/animation/keyframes/offsets/time.ts"],"sourcesContent":["export function convertOffsetToTimes(offset: number[], duration: number) {\n return offset.map((o) => o * duration)\n}\n"],"names":[],"mappings":"AAAM,SAAU,oBAAoB,CAAC,MAAgB,EAAE,QAAgB,EAAA;AACnE,IAAA,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,QAAQ,CAAC;AAC1C;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/keyframes/utils/apply-px-defaults.mjs b/node_modules/motion-dom/dist/es/animation/keyframes/utils/apply-px-defaults.mjs deleted file mode 100644 index 1f37035..0000000 --- a/node_modules/motion-dom/dist/es/animation/keyframes/utils/apply-px-defaults.mjs +++ /dev/null @@ -1,12 +0,0 @@ -import { pxValues } from '../../waapi/utils/px-values.mjs'; - -function applyPxDefaults(keyframes, name) { - for (let i = 0; i < keyframes.length; i++) { - if (typeof keyframes[i] === "number" && pxValues.has(name)) { - keyframes[i] = keyframes[i] + "px"; - } - } -} - -export { applyPxDefaults }; -//# sourceMappingURL=apply-px-defaults.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/keyframes/utils/apply-px-defaults.mjs.map b/node_modules/motion-dom/dist/es/animation/keyframes/utils/apply-px-defaults.mjs.map deleted file mode 100644 index b5894c2..0000000 --- a/node_modules/motion-dom/dist/es/animation/keyframes/utils/apply-px-defaults.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"apply-px-defaults.mjs","sources":["../../../../../src/animation/keyframes/utils/apply-px-defaults.ts"],"sourcesContent":["import { UnresolvedValueKeyframe, ValueKeyframe } from \"../../types\"\nimport { pxValues } from \"../../waapi/utils/px-values\"\n\nexport function applyPxDefaults(\n keyframes: ValueKeyframe[] | UnresolvedValueKeyframe[],\n name: string\n) {\n for (let i = 0; i < keyframes.length; i++) {\n if (typeof keyframes[i] === \"number\" && pxValues.has(name)) {\n keyframes[i] = keyframes[i] + \"px\"\n }\n }\n}\n"],"names":[],"mappings":";;AAGM,SAAU,eAAe,CAC3B,SAAsD,EACtD,IAAY,EAAA;AAEZ,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AACvC,QAAA,IAAI,OAAO,SAAS,CAAC,CAAC,CAAC,KAAK,QAAQ,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;YACxD,SAAS,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,GAAG,IAAI;QACtC;IACJ;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.mjs b/node_modules/motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.mjs deleted file mode 100644 index 3875853..0000000 --- a/node_modules/motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.mjs +++ /dev/null @@ -1,8 +0,0 @@ -function fillWildcards(keyframes) { - for (let i = 1; i < keyframes.length; i++) { - keyframes[i] ?? (keyframes[i] = keyframes[i - 1]); - } -} - -export { fillWildcards }; -//# sourceMappingURL=fill-wildcards.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.mjs.map b/node_modules/motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.mjs.map deleted file mode 100644 index 9dd7452..0000000 --- a/node_modules/motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"fill-wildcards.mjs","sources":["../../../../../src/animation/keyframes/utils/fill-wildcards.ts"],"sourcesContent":["import { UnresolvedValueKeyframe, ValueKeyframe } from \"../../types\"\n\nexport function fillWildcards(\n keyframes: ValueKeyframe[] | UnresolvedValueKeyframe[]\n) {\n for (let i = 1; i < keyframes.length; i++) {\n keyframes[i] ??= keyframes[i - 1]\n }\n}\n"],"names":[],"mappings":"AAEM,SAAU,aAAa,CACzB,SAAsD,EAAA;AAEtD,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AACvC,QAAA,SAAS,CAAC,CAAC,CAAA,KAAX,SAAS,CAAC,CAAC,CAAA,GAAM,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,CAAA;IACrC;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/keyframes/utils/is-none.mjs b/node_modules/motion-dom/dist/es/animation/keyframes/utils/is-none.mjs deleted file mode 100644 index 70b7539..0000000 --- a/node_modules/motion-dom/dist/es/animation/keyframes/utils/is-none.mjs +++ /dev/null @@ -1,16 +0,0 @@ -import { isZeroValueString } from 'motion-utils'; - -function isNone(value) { - if (typeof value === "number") { - return value === 0; - } - else if (value !== null) { - return value === "none" || value === "0" || isZeroValueString(value); - } - else { - return true; - } -} - -export { isNone }; -//# sourceMappingURL=is-none.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/keyframes/utils/is-none.mjs.map b/node_modules/motion-dom/dist/es/animation/keyframes/utils/is-none.mjs.map deleted file mode 100644 index bcb4eac..0000000 --- a/node_modules/motion-dom/dist/es/animation/keyframes/utils/is-none.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"is-none.mjs","sources":["../../../../../src/animation/keyframes/utils/is-none.ts"],"sourcesContent":["import { isZeroValueString } from \"motion-utils\"\nimport { AnyResolvedKeyframe } from \"../../types\"\n\nexport function isNone(value: AnyResolvedKeyframe | null) {\n if (typeof value === \"number\") {\n return value === 0\n } else if (value !== null) {\n return value === \"none\" || value === \"0\" || isZeroValueString(value)\n } else {\n return true\n }\n}\n"],"names":[],"mappings":";;AAGM,SAAU,MAAM,CAAC,KAAiC,EAAA;AACpD,IAAA,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAC3B,OAAO,KAAK,KAAK,CAAC;IACtB;AAAO,SAAA,IAAI,KAAK,KAAK,IAAI,EAAE;AACvB,QAAA,OAAO,KAAK,KAAK,MAAM,IAAI,KAAK,KAAK,GAAG,IAAI,iBAAiB,CAAC,KAAK,CAAC;IACxE;SAAO;AACH,QAAA,OAAO,IAAI;IACf;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/keyframes/utils/make-none-animatable.mjs b/node_modules/motion-dom/dist/es/animation/keyframes/utils/make-none-animatable.mjs deleted file mode 100644 index 878d19f..0000000 --- a/node_modules/motion-dom/dist/es/animation/keyframes/utils/make-none-animatable.mjs +++ /dev/null @@ -1,31 +0,0 @@ -import { analyseComplexValue } from '../../../value/types/complex/index.mjs'; -import { getAnimatableNone } from '../../../value/types/utils/animatable-none.mjs'; - -/** - * If we encounter keyframes like "none" or "0" and we also have keyframes like - * "#fff" or "200px 200px" we want to find a keyframe to serve as a template for - * the "none" keyframes. In this case "#fff" or "200px 200px" - then these get turned into - * zero equivalents, i.e. "#fff0" or "0px 0px". - */ -const invalidTemplates = new Set(["auto", "none", "0"]); -function makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, name) { - let i = 0; - let animatableTemplate = undefined; - while (i < unresolvedKeyframes.length && !animatableTemplate) { - const keyframe = unresolvedKeyframes[i]; - if (typeof keyframe === "string" && - !invalidTemplates.has(keyframe) && - analyseComplexValue(keyframe).values.length) { - animatableTemplate = unresolvedKeyframes[i]; - } - i++; - } - if (animatableTemplate && name) { - for (const noneIndex of noneKeyframeIndexes) { - unresolvedKeyframes[noneIndex] = getAnimatableNone(name, animatableTemplate); - } - } -} - -export { makeNoneKeyframesAnimatable }; -//# sourceMappingURL=make-none-animatable.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/keyframes/utils/make-none-animatable.mjs.map b/node_modules/motion-dom/dist/es/animation/keyframes/utils/make-none-animatable.mjs.map deleted file mode 100644 index 44ce2ff..0000000 --- a/node_modules/motion-dom/dist/es/animation/keyframes/utils/make-none-animatable.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"make-none-animatable.mjs","sources":["../../../../../src/animation/keyframes/utils/make-none-animatable.ts"],"sourcesContent":["import { analyseComplexValue } from \"../../../value/types/complex\"\nimport { getAnimatableNone } from \"../../../value/types/utils/animatable-none\"\nimport { AnyResolvedKeyframe } from \"../../types\"\nimport { UnresolvedKeyframes } from \"../KeyframesResolver\"\n\n/**\n * If we encounter keyframes like \"none\" or \"0\" and we also have keyframes like\n * \"#fff\" or \"200px 200px\" we want to find a keyframe to serve as a template for\n * the \"none\" keyframes. In this case \"#fff\" or \"200px 200px\" - then these get turned into\n * zero equivalents, i.e. \"#fff0\" or \"0px 0px\".\n */\nconst invalidTemplates = new Set([\"auto\", \"none\", \"0\"])\n\nexport function makeNoneKeyframesAnimatable(\n unresolvedKeyframes: UnresolvedKeyframes,\n noneKeyframeIndexes: number[],\n name?: string\n) {\n let i = 0\n let animatableTemplate: string | undefined = undefined\n while (i < unresolvedKeyframes.length && !animatableTemplate) {\n const keyframe = unresolvedKeyframes[i]\n if (\n typeof keyframe === \"string\" &&\n !invalidTemplates.has(keyframe) &&\n analyseComplexValue(keyframe).values.length\n ) {\n animatableTemplate = unresolvedKeyframes[i] as string\n }\n i++\n }\n\n if (animatableTemplate && name) {\n for (const noneIndex of noneKeyframeIndexes) {\n unresolvedKeyframes[noneIndex] = getAnimatableNone(\n name,\n animatableTemplate\n )\n }\n }\n}\n"],"names":[],"mappings":";;;AAKA;;;;;AAKG;AACH,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC;SAEvC,2BAA2B,CACvC,mBAA6D,EAC7D,mBAA6B,EAC7B,IAAa,EAAA;IAEb,IAAI,CAAC,GAAG,CAAC;IACT,IAAI,kBAAkB,GAAuB,SAAS;IACtD,OAAO,CAAC,GAAG,mBAAmB,CAAC,MAAM,IAAI,CAAC,kBAAkB,EAAE;AAC1D,QAAA,MAAM,QAAQ,GAAG,mBAAmB,CAAC,CAAC,CAAC;QACvC,IACI,OAAO,QAAQ,KAAK,QAAQ;AAC5B,YAAA,CAAC,gBAAgB,CAAC,GAAG,CAAC,QAAQ,CAAC;YAC/B,mBAAmB,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,MAAM,EAC7C;AACE,YAAA,kBAAkB,GAAG,mBAAmB,CAAC,CAAC,CAAW;QACzD;AACA,QAAA,CAAC,EAAE;IACP;AAEA,IAAA,IAAI,kBAAkB,IAAI,IAAI,EAAE;AAC5B,QAAA,KAAK,MAAM,SAAS,IAAI,mBAAmB,EAAE;YACzC,mBAAmB,CAAC,SAAS,CAAC,GAAG,iBAAiB,CAC9C,IAAI,EACJ,kBAAkB,CACrB;QACL;IACJ;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/keyframes/utils/unit-conversion.mjs b/node_modules/motion-dom/dist/es/animation/keyframes/utils/unit-conversion.mjs deleted file mode 100644 index b76cfc3..0000000 --- a/node_modules/motion-dom/dist/es/animation/keyframes/utils/unit-conversion.mjs +++ /dev/null @@ -1,47 +0,0 @@ -import { parseValueFromTransform } from '../../../render/dom/parse-transform.mjs'; -import { transformPropOrder } from '../../../render/utils/keys-transform.mjs'; -import { number } from '../../../value/types/numbers/index.mjs'; -import { px } from '../../../value/types/numbers/units.mjs'; - -const isNumOrPxType = (v) => v === number || v === px; -const transformKeys = new Set(["x", "y", "z"]); -const nonTranslationalTransformKeys = transformPropOrder.filter((key) => !transformKeys.has(key)); -function removeNonTranslationalTransform(visualElement) { - const removedTransforms = []; - nonTranslationalTransformKeys.forEach((key) => { - const value = visualElement.getValue(key); - if (value !== undefined) { - removedTransforms.push([key, value.get()]); - value.set(key.startsWith("scale") ? 1 : 0); - } - }); - return removedTransforms; -} -const positionalValues = { - // Dimensions - width: ({ x }, { paddingLeft = "0", paddingRight = "0", boxSizing }) => { - const width = x.max - x.min; - return boxSizing === "border-box" - ? width - : width - parseFloat(paddingLeft) - parseFloat(paddingRight); - }, - height: ({ y }, { paddingTop = "0", paddingBottom = "0", boxSizing }) => { - const height = y.max - y.min; - return boxSizing === "border-box" - ? height - : height - parseFloat(paddingTop) - parseFloat(paddingBottom); - }, - top: (_bbox, { top }) => parseFloat(top), - left: (_bbox, { left }) => parseFloat(left), - bottom: ({ y }, { top }) => parseFloat(top) + (y.max - y.min), - right: ({ x }, { left }) => parseFloat(left) + (x.max - x.min), - // Transform - x: (_bbox, { transform }) => parseValueFromTransform(transform, "x"), - y: (_bbox, { transform }) => parseValueFromTransform(transform, "y"), -}; -// Alias translate longform names -positionalValues.translateX = positionalValues.x; -positionalValues.translateY = positionalValues.y; - -export { isNumOrPxType, positionalValues, removeNonTranslationalTransform }; -//# sourceMappingURL=unit-conversion.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/keyframes/utils/unit-conversion.mjs.map b/node_modules/motion-dom/dist/es/animation/keyframes/utils/unit-conversion.mjs.map deleted file mode 100644 index 361ab89..0000000 --- a/node_modules/motion-dom/dist/es/animation/keyframes/utils/unit-conversion.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"unit-conversion.mjs","sources":["../../../../../src/animation/keyframes/utils/unit-conversion.ts"],"sourcesContent":["import type { Box } from \"motion-utils\"\nimport { parseValueFromTransform } from \"../../../render/dom/parse-transform\"\nimport { transformPropOrder } from \"../../../render/utils/keys-transform\"\nimport { MotionValue } from \"../../../value\"\nimport { number } from \"../../../value/types/numbers\"\nimport { px } from \"../../../value/types/numbers/units\"\nimport { ValueType } from \"../../../value/types/types\"\nimport { AnyResolvedKeyframe } from \"../../types\"\nimport { WithRender } from \"../types\"\n\nexport const isNumOrPxType = (v?: ValueType): v is ValueType =>\n v === number || v === px\n\ntype GetActualMeasurementInPixels = (\n bbox: Box,\n computedStyle: Partial\n) => number\n\nconst transformKeys = new Set([\"x\", \"y\", \"z\"])\nconst nonTranslationalTransformKeys = transformPropOrder.filter(\n (key) => !transformKeys.has(key)\n)\n\ntype RemovedTransforms = [string, AnyResolvedKeyframe][]\nexport function removeNonTranslationalTransform(visualElement: WithRender) {\n const removedTransforms: RemovedTransforms = []\n\n nonTranslationalTransformKeys.forEach((key) => {\n const value: MotionValue | undefined =\n visualElement.getValue(key)\n if (value !== undefined) {\n removedTransforms.push([key, value.get()])\n value.set(key.startsWith(\"scale\") ? 1 : 0)\n }\n })\n\n return removedTransforms\n}\n\nexport const positionalValues: { [key: string]: GetActualMeasurementInPixels } =\n {\n // Dimensions\n width: (\n { x },\n { paddingLeft = \"0\", paddingRight = \"0\", boxSizing }\n ) => {\n const width = x.max - x.min\n return boxSizing === \"border-box\"\n ? width\n : width - parseFloat(paddingLeft) - parseFloat(paddingRight)\n },\n height: (\n { y },\n { paddingTop = \"0\", paddingBottom = \"0\", boxSizing }\n ) => {\n const height = y.max - y.min\n return boxSizing === \"border-box\"\n ? height\n : height - parseFloat(paddingTop) - parseFloat(paddingBottom)\n },\n\n top: (_bbox, { top }) => parseFloat(top as string),\n left: (_bbox, { left }) => parseFloat(left as string),\n bottom: ({ y }, { top }) => parseFloat(top as string) + (y.max - y.min),\n right: ({ x }, { left }) =>\n parseFloat(left as string) + (x.max - x.min),\n\n // Transform\n x: (_bbox, { transform }) => parseValueFromTransform(transform, \"x\"),\n y: (_bbox, { transform }) => parseValueFromTransform(transform, \"y\"),\n }\n\n// Alias translate longform names\npositionalValues.translateX = positionalValues.x\npositionalValues.translateY = positionalValues.y\n"],"names":[],"mappings":";;;;;AAUO,MAAM,aAAa,GAAG,CAAC,CAAa,KACvC,CAAC,KAAK,MAAM,IAAI,CAAC,KAAK;AAO1B,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AAC9C,MAAM,6BAA6B,GAAG,kBAAkB,CAAC,MAAM,CAC3D,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,GAAG,CAAC,CACnC;AAGK,SAAU,+BAA+B,CAAC,aAAyB,EAAA;IACrE,MAAM,iBAAiB,GAAsB,EAAE;AAE/C,IAAA,6BAA6B,CAAC,OAAO,CAAC,CAAC,GAAG,KAAI;QAC1C,MAAM,KAAK,GACP,aAAa,CAAC,QAAQ,CAAC,GAAG,CAAC;AAC/B,QAAA,IAAI,KAAK,KAAK,SAAS,EAAE;AACrB,YAAA,iBAAiB,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC;AAC1C,YAAA,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,UAAU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C,CAAC,GAAG,CAAC;;AAGhD,IAAA,CAAC,EAAE,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,KAAK,uBAAuB,CAAC,SAAS,EAAE,GAAG,CAAC;AACpE,IAAA,CAAC,EAAE,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,KAAK,uBAAuB,CAAC,SAAS,EAAE,GAAG,CAAC;;AAG5E;AACA,gBAAgB,CAAC,UAAU,GAAG,gBAAgB,CAAC,CAAC;AAChD,gBAAgB,CAAC,UAAU,GAAG,gBAAgB,CAAC,CAAC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/optimized-appear/data-id.mjs b/node_modules/motion-dom/dist/es/animation/optimized-appear/data-id.mjs deleted file mode 100644 index a15a511..0000000 --- a/node_modules/motion-dom/dist/es/animation/optimized-appear/data-id.mjs +++ /dev/null @@ -1,7 +0,0 @@ -import { camelToDash } from '../../render/dom/utils/camel-to-dash.mjs'; - -const optimizedAppearDataId = "framerAppearId"; -const optimizedAppearDataAttribute = "data-" + camelToDash(optimizedAppearDataId); - -export { optimizedAppearDataAttribute, optimizedAppearDataId }; -//# sourceMappingURL=data-id.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/optimized-appear/data-id.mjs.map b/node_modules/motion-dom/dist/es/animation/optimized-appear/data-id.mjs.map deleted file mode 100644 index 387ed16..0000000 --- a/node_modules/motion-dom/dist/es/animation/optimized-appear/data-id.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"data-id.mjs","sources":["../../../../src/animation/optimized-appear/data-id.ts"],"sourcesContent":["import { camelToDash } from \"../../render/dom/utils/camel-to-dash\"\n\nexport const optimizedAppearDataId = \"framerAppearId\"\n\nexport const optimizedAppearDataAttribute =\n \"data-\" + camelToDash(optimizedAppearDataId) as \"data-framer-appear-id\"\n"],"names":[],"mappings":";;AAEO,MAAM,qBAAqB,GAAG;AAE9B,MAAM,4BAA4B,GACrC,OAAO,GAAG,WAAW,CAAC,qBAAqB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/optimized-appear/get-appear-id.mjs b/node_modules/motion-dom/dist/es/animation/optimized-appear/get-appear-id.mjs deleted file mode 100644 index 7026149..0000000 --- a/node_modules/motion-dom/dist/es/animation/optimized-appear/get-appear-id.mjs +++ /dev/null @@ -1,8 +0,0 @@ -import { optimizedAppearDataAttribute } from './data-id.mjs'; - -function getOptimisedAppearId(visualElement) { - return visualElement.props[optimizedAppearDataAttribute]; -} - -export { getOptimisedAppearId }; -//# sourceMappingURL=get-appear-id.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/optimized-appear/get-appear-id.mjs.map b/node_modules/motion-dom/dist/es/animation/optimized-appear/get-appear-id.mjs.map deleted file mode 100644 index 1b18bdf..0000000 --- a/node_modules/motion-dom/dist/es/animation/optimized-appear/get-appear-id.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"get-appear-id.mjs","sources":["../../../../src/animation/optimized-appear/get-appear-id.ts"],"sourcesContent":["import { optimizedAppearDataAttribute } from \"./data-id\"\nimport type { WithAppearProps } from \"./types\"\n\nexport function getOptimisedAppearId(\n visualElement: WithAppearProps\n): string | undefined {\n return visualElement.props[optimizedAppearDataAttribute]\n}\n"],"names":[],"mappings":";;AAGM,SAAU,oBAAoB,CAChC,aAA8B,EAAA;AAE9B,IAAA,OAAO,aAAa,CAAC,KAAK,CAAC,4BAA4B,CAAC;AAC5D;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/utils/WithPromise.mjs b/node_modules/motion-dom/dist/es/animation/utils/WithPromise.mjs deleted file mode 100644 index 54a42a1..0000000 --- a/node_modules/motion-dom/dist/es/animation/utils/WithPromise.mjs +++ /dev/null @@ -1,27 +0,0 @@ -class WithPromise { - constructor() { - this.updateFinished(); - } - get finished() { - return this._finished; - } - updateFinished() { - this._finished = new Promise((resolve) => { - this.resolve = resolve; - }); - } - notifyFinished() { - this.resolve(); - } - /** - * Allows the animation to be awaited. - * - * @deprecated Use `finished` instead. - */ - then(onResolve, onReject) { - return this.finished.then(onResolve, onReject); - } -} - -export { WithPromise }; -//# sourceMappingURL=WithPromise.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/utils/WithPromise.mjs.map b/node_modules/motion-dom/dist/es/animation/utils/WithPromise.mjs.map deleted file mode 100644 index 7a80df3..0000000 --- a/node_modules/motion-dom/dist/es/animation/utils/WithPromise.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"WithPromise.mjs","sources":["../../../../src/animation/utils/WithPromise.ts"],"sourcesContent":["export class WithPromise {\n protected _finished: Promise\n\n resolve: VoidFunction\n\n constructor() {\n this.updateFinished()\n }\n\n get finished() {\n return this._finished\n }\n\n protected updateFinished() {\n this._finished = new Promise((resolve) => {\n this.resolve = resolve\n })\n }\n\n protected notifyFinished() {\n this.resolve()\n }\n\n /**\n * Allows the animation to be awaited.\n *\n * @deprecated Use `finished` instead.\n */\n then(onResolve: VoidFunction, onReject?: VoidFunction) {\n return this.finished.then(onResolve, onReject)\n }\n}\n"],"names":[],"mappings":"MAAa,WAAW,CAAA;AAKpB,IAAA,WAAA,GAAA;QACI,IAAI,CAAC,cAAc,EAAE;IACzB;AAEA,IAAA,IAAI,QAAQ,GAAA;QACR,OAAO,IAAI,CAAC,SAAS;IACzB;IAEU,cAAc,GAAA;QACpB,IAAI,CAAC,SAAS,GAAG,IAAI,OAAO,CAAO,CAAC,OAAO,KAAI;AAC3C,YAAA,IAAI,CAAC,OAAO,GAAG,OAAO;AAC1B,QAAA,CAAC,CAAC;IACN;IAEU,cAAc,GAAA;QACpB,IAAI,CAAC,OAAO,EAAE;IAClB;AAEA;;;;AAIG;IACH,IAAI,CAAC,SAAuB,EAAE,QAAuB,EAAA;QACjD,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC;IAClD;AACH;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/utils/active-animations.mjs b/node_modules/motion-dom/dist/es/animation/utils/active-animations.mjs deleted file mode 100644 index e548994..0000000 --- a/node_modules/motion-dom/dist/es/animation/utils/active-animations.mjs +++ /dev/null @@ -1,13 +0,0 @@ -const animationMaps = new WeakMap(); -const animationMapKey = (name, pseudoElement = "") => `${name}:${pseudoElement}`; -function getAnimationMap(element) { - let map = animationMaps.get(element); - if (!map) { - map = new Map(); - animationMaps.set(element, map); - } - return map; -} - -export { animationMapKey, getAnimationMap }; -//# sourceMappingURL=active-animations.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/utils/active-animations.mjs.map b/node_modules/motion-dom/dist/es/animation/utils/active-animations.mjs.map deleted file mode 100644 index 7fb8326..0000000 --- a/node_modules/motion-dom/dist/es/animation/utils/active-animations.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"active-animations.mjs","sources":["../../../../src/animation/utils/active-animations.ts"],"sourcesContent":["import { NativeAnimation } from \"../NativeAnimation\"\nimport { AnyResolvedKeyframe } from \"../types\"\n\nconst animationMaps = new WeakMap<\n Element,\n Map>\n>()\nexport const animationMapKey = (name: string, pseudoElement: string = \"\") =>\n `${name}:${pseudoElement}`\n\nexport function getAnimationMap(element: Element) {\n let map = animationMaps.get(element)\n if (!map) {\n map = new Map()\n animationMaps.set(element, map)\n }\n return map\n}\n"],"names":[],"mappings":"AAGA,MAAM,aAAa,GAAG,IAAI,OAAO,EAG9B;AACI,MAAM,eAAe,GAAG,CAAC,IAAY,EAAE,aAAA,GAAwB,EAAE,KACpE,CAAA,EAAG,IAAI,CAAA,CAAA,EAAI,aAAa;AAEtB,SAAU,eAAe,CAAC,OAAgB,EAAA;IAC5C,IAAI,GAAG,GAAG,aAAa,CAAC,GAAG,CAAC,OAAO,CAAC;IACpC,IAAI,CAAC,GAAG,EAAE;AACN,QAAA,GAAG,GAAG,IAAI,GAAG,EAAE;AACf,QAAA,aAAa,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC;IACnC;AACA,IAAA,OAAO,GAAG;AACd;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/utils/arc.mjs b/node_modules/motion-dom/dist/es/animation/utils/arc.mjs deleted file mode 100644 index df08205..0000000 --- a/node_modules/motion-dom/dist/es/animation/utils/arc.mjs +++ /dev/null @@ -1,188 +0,0 @@ -import { wrap } from 'motion-utils'; -import { motionValue } from '../../value/index.mjs'; -import { animateMotionValue } from '../interfaces/motion-value.mjs'; -import { getValueTransition } from './get-value-transition.mjs'; - -const MIN_LAYOUT_DISTANCE = 20; -function bezierPoint(t, origin, control, target) { - const inv = 1 - t; - return inv * inv * origin + 2 * inv * t * control + t * t * target; -} -function bezierTangentAngle(t, originX, controlX, targetX, originY, controlY, targetY) { - const dx = 2 * (1 - t) * (controlX - originX) + 2 * t * (targetX - controlX); - const dy = 2 * (1 - t) * (controlY - originY) + 2 * t * (targetY - controlY); - return Math.atan2(dy, dx) * (180 / Math.PI); -} -function computeArcControlPoint(fromX, fromY, toX, toY, strength, peak) { - const deltaX = toX - fromX; - const deltaY = toY - fromY; - const distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY); - if (distance > 0) { - const normalPerpX = -deltaY / distance; - const normalPerpY = deltaX / distance; - const desiredHeight = strength * distance; - return { - x: fromX + deltaX * peak + normalPerpX * desiredHeight, - y: fromY + deltaY * peak + normalPerpY * desiredHeight, - }; - } - return { x: fromX, y: fromY }; -} -/** - * The pure sampling factory: `(from, to) => (t) => point`. Internal — - * used by {@link arc} and the unit tests. Not part of the public surface. - */ -function createArcPath({ strength = 0.5, peak = 0.5, direction, rotate = false, } = {}) { - const rotationScale = rotate === true ? 1 : typeof rotate === "number" ? rotate : 0; - // Auto-direction only: persists across calls to flip the bulge back - // onto the same screen side when the dominant axis changes between - // calls. Reuse the factory (module scope / useMemo) to keep this alive. - let prevBulgeSign; - const createInterpolator = (from, to) => { - const dx = to.x - from.x; - const dy = to.y - from.y; - let signed; - if (direction === "cw") { - signed = -strength; - } - else if (direction === "ccw") { - signed = strength; - } - else { - const dom = Math.abs(dx) >= Math.abs(dy) ? dx : dy; - signed = dom < 0 ? -strength : strength; - } - let control = computeArcControlPoint(from.x, from.y, to.x, to.y, signed, peak); - if (direction === undefined) { - const isVertical = Math.abs(dx) < Math.abs(dy); - const midX = from.x + dx * peak; - const midY = from.y + dy * peak; - const bulgeSign = isVertical - ? Math.sign(control.x - midX) - : Math.sign(control.y - midY); - if (prevBulgeSign !== undefined && - bulgeSign !== 0 && - bulgeSign !== prevBulgeSign) { - signed = -signed; - control = computeArcControlPoint(from.x, from.y, to.x, to.y, signed, peak); - } - else if (bulgeSign !== 0) { - prevBulgeSign = bulgeSign; - } - } - const tangent0 = rotationScale - ? bezierTangentAngle(0, from.x, control.x, to.x, from.y, control.y, to.y) - : 0; - const tangent1 = rotationScale - ? bezierTangentAngle(1, from.x, control.x, to.x, from.y, control.y, to.y) - : 0; - const tangentDelta = rotationScale - ? wrap(-180, 180, tangent1 - tangent0) - : 0; - return (t) => { - const out = { - x: bezierPoint(t, from.x, control.x, to.x), - y: bezierPoint(t, from.y, control.y, to.y), - }; - if (rotationScale) { - const raw = bezierTangentAngle(t, from.x, control.x, to.x, from.y, control.y, to.y); - const baseline = tangent0 + tangentDelta * t; - out.rotate = wrap(-180, 180, raw - baseline) * rotationScale; - } - return out; - }; - }; - return createInterpolator; -} -/** - * Creates a curved path for `transition.path`: - * - * ```ts - * - * ``` - * - * Reuse the returned value (module scope / useMemo / useRef) so its - * continuity closure survives re-renders — a fresh `arc()` has no memory. - */ -function arc(options = {}) { - const sample = createArcPath(options); - const path = { - interpolateProjection(delta) { - // `from` is the current translate offset (carries any in-flight - // displacement when interrupted); `to` is the new layout origin. - // The distance floor avoids visible wobble on tiny shifts. - const tx = delta.x.translate; - const ty = delta.y.translate; - if (Math.sqrt(tx * tx + ty * ty) < MIN_LAYOUT_DISTANCE) { - return undefined; - } - return sample({ x: tx, y: ty }, { x: 0, y: 0 }); - }, - animateVisualElement(visualElement, target, transition, delay, animations) { - if (!("x" in target || "y" in target)) - return; - const xValue = visualElement.getValue("x", visualElement.latestValues["x"] ?? 0); - const yValue = visualElement.getValue("y", visualElement.latestValues["y"] ?? 0); - const xRaw = target.x; - const yRaw = target.y; - const xFrom = (Array.isArray(xRaw) && xRaw[0] != null - ? xRaw[0] - : xValue?.get()) ?? 0; - const yFrom = (Array.isArray(yRaw) && yRaw[0] != null - ? yRaw[0] - : yValue?.get()) ?? 0; - const xTo = (Array.isArray(xRaw) - ? xRaw[xRaw.length - 1] - : xRaw ?? xFrom); - const yTo = (Array.isArray(yRaw) - ? yRaw[yRaw.length - 1] - : yRaw ?? yFrom); - // Interruption needs no flag: x/y already hold the displaced - // mid-arc position, so xFrom/yFrom carry the continuity geometry. - const interpolate = sample({ x: xFrom, y: yFrom }, { x: xTo, y: yTo }); - // Drive a dedicated `pathRotation` value (composed onto `rotate` - // at the build sites) rather than `rotate` itself, so a - // concurrent rotate animation composes and nothing accumulates - // on interrupt. - const pathRotationValue = interpolate(0).rotate !== undefined - ? visualElement.getValue("pathRotation", 0) - : undefined; - const pathTransition = { - delay, - ...getValueTransition(transition || {}, "x"), - }; - delete pathTransition.path; - const progress = motionValue(0); - progress.start(animateMotionValue("", progress, [0, 1000], { - ...pathTransition, - isSync: true, - velocity: 0, - onUpdate: (latest) => { - const point = interpolate(latest / 1000); - xValue?.set(point.x); - yValue?.set(point.y); - if (pathRotationValue && point.rotate !== undefined) { - pathRotationValue.set(point.rotate); - } - }, - onComplete: () => { - xValue?.set(xTo); - yValue?.set(yTo); - pathRotationValue?.set(0); - }, - // Interrupt/cancel must clear our additive contribution - // so it can't linger on top of the user's `rotate`. - onStop: () => pathRotationValue?.set(0), - onCancel: () => pathRotationValue?.set(0), - })); - if (progress.animation) - animations.push(progress.animation); - delete target.x; - delete target.y; - }, - }; - return path; -} - -export { arc, createArcPath }; -//# sourceMappingURL=arc.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/utils/arc.mjs.map b/node_modules/motion-dom/dist/es/animation/utils/arc.mjs.map deleted file mode 100644 index ef5bfdd..0000000 --- a/node_modules/motion-dom/dist/es/animation/utils/arc.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"arc.mjs","sources":["../../../../src/animation/utils/arc.ts"],"sourcesContent":["import { wrap } from \"motion-utils\"\nimport { motionValue } from \"../../value\"\nimport { animateMotionValue } from \"../interfaces/motion-value\"\nimport type { MotionPath, PathInterpolator, Point2D } from \"../types\"\nimport { getValueTransition } from \"./get-value-transition\"\n\nexport interface ArcOptions {\n /**\n * How far the arc bulges perpendicular to the straight-line path,\n * as a fraction of the total distance. A value of `1` means the arc\n * peaks at a height equal to the full travel distance. Default `0.5`.\n */\n strength?: number\n /**\n * Where along the path (0–1) the arc reaches its maximum height.\n * Default `0.5` (symmetric).\n */\n peak?: number\n /**\n * Which side the arc bulges toward.\n * - `\"cw\"` / `\"ccw\"` — locked relative to direction of travel\n * - unset — auto-pick a stable screen-space side\n */\n direction?: \"cw\" | \"ccw\"\n /**\n * Rotates the element to follow the tangent of the arc path.\n * - `true` — full tangent following (1.0)\n * - number 0–1 — scale factor\n */\n rotate?: boolean | number\n}\n\nconst MIN_LAYOUT_DISTANCE = 20\n\nfunction bezierPoint(\n t: number,\n origin: number,\n control: number,\n target: number\n): number {\n const inv = 1 - t\n return inv * inv * origin + 2 * inv * t * control + t * t * target\n}\n\nfunction bezierTangentAngle(\n t: number,\n originX: number,\n controlX: number,\n targetX: number,\n originY: number,\n controlY: number,\n targetY: number\n): number {\n const dx =\n 2 * (1 - t) * (controlX - originX) + 2 * t * (targetX - controlX)\n const dy =\n 2 * (1 - t) * (controlY - originY) + 2 * t * (targetY - controlY)\n return Math.atan2(dy, dx) * (180 / Math.PI)\n}\n\nfunction computeArcControlPoint(\n fromX: number,\n fromY: number,\n toX: number,\n toY: number,\n strength: number,\n peak: number\n): { x: number; y: number } {\n const deltaX = toX - fromX\n const deltaY = toY - fromY\n const distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY)\n\n if (distance > 0) {\n const normalPerpX = -deltaY / distance\n const normalPerpY = deltaX / distance\n const desiredHeight = strength * distance\n\n return {\n x: fromX + deltaX * peak + normalPerpX * desiredHeight,\n y: fromY + deltaY * peak + normalPerpY * desiredHeight,\n }\n }\n\n return { x: fromX, y: fromY }\n}\n\n/**\n * The pure sampling factory: `(from, to) => (t) => point`. Internal —\n * used by {@link arc} and the unit tests. Not part of the public surface.\n */\nexport function createArcPath({\n strength = 0.5,\n peak = 0.5,\n direction,\n rotate = false,\n}: ArcOptions = {}): (from: Point2D, to: Point2D) => PathInterpolator {\n const rotationScale =\n rotate === true ? 1 : typeof rotate === \"number\" ? rotate : 0\n\n // Auto-direction only: persists across calls to flip the bulge back\n // onto the same screen side when the dominant axis changes between\n // calls. Reuse the factory (module scope / useMemo) to keep this alive.\n let prevBulgeSign: number | undefined\n\n const createInterpolator = (\n from: Point2D,\n to: Point2D\n ): PathInterpolator => {\n const dx = to.x - from.x\n const dy = to.y - from.y\n\n let signed: number\n if (direction === \"cw\") {\n signed = -strength\n } else if (direction === \"ccw\") {\n signed = strength\n } else {\n const dom = Math.abs(dx) >= Math.abs(dy) ? dx : dy\n signed = dom < 0 ? -strength : strength\n }\n\n let control = computeArcControlPoint(\n from.x,\n from.y,\n to.x,\n to.y,\n signed,\n peak\n )\n\n if (direction === undefined) {\n const isVertical = Math.abs(dx) < Math.abs(dy)\n const midX = from.x + dx * peak\n const midY = from.y + dy * peak\n const bulgeSign = isVertical\n ? Math.sign(control.x - midX)\n : Math.sign(control.y - midY)\n\n if (\n prevBulgeSign !== undefined &&\n bulgeSign !== 0 &&\n bulgeSign !== prevBulgeSign\n ) {\n signed = -signed\n control = computeArcControlPoint(\n from.x,\n from.y,\n to.x,\n to.y,\n signed,\n peak\n )\n } else if (bulgeSign !== 0) {\n prevBulgeSign = bulgeSign\n }\n }\n\n const tangent0 = rotationScale\n ? bezierTangentAngle(\n 0,\n from.x,\n control.x,\n to.x,\n from.y,\n control.y,\n to.y\n )\n : 0\n const tangent1 = rotationScale\n ? bezierTangentAngle(\n 1,\n from.x,\n control.x,\n to.x,\n from.y,\n control.y,\n to.y\n )\n : 0\n const tangentDelta = rotationScale\n ? wrap(-180, 180, tangent1 - tangent0)\n : 0\n\n return (t: number) => {\n const out: { x: number; y: number; rotate?: number } = {\n x: bezierPoint(t, from.x, control.x, to.x),\n y: bezierPoint(t, from.y, control.y, to.y),\n }\n if (rotationScale) {\n const raw = bezierTangentAngle(\n t,\n from.x,\n control.x,\n to.x,\n from.y,\n control.y,\n to.y\n )\n const baseline = tangent0 + tangentDelta * t\n out.rotate = wrap(-180, 180, raw - baseline) * rotationScale\n }\n return out\n }\n }\n\n return createInterpolator\n}\n\n/**\n * Creates a curved path for `transition.path`:\n *\n * ```ts\n * \n * ```\n *\n * Reuse the returned value (module scope / useMemo / useRef) so its\n * continuity closure survives re-renders — a fresh `arc()` has no memory.\n */\nexport function arc(options: ArcOptions = {}): MotionPath {\n const sample = createArcPath(options)\n\n const path: MotionPath = {\n interpolateProjection(delta) {\n // `from` is the current translate offset (carries any in-flight\n // displacement when interrupted); `to` is the new layout origin.\n // The distance floor avoids visible wobble on tiny shifts.\n const tx = delta.x.translate\n const ty = delta.y.translate\n if (Math.sqrt(tx * tx + ty * ty) < MIN_LAYOUT_DISTANCE) {\n return undefined\n }\n return sample({ x: tx, y: ty }, { x: 0, y: 0 })\n },\n\n animateVisualElement(\n visualElement,\n target,\n transition,\n delay,\n animations\n ) {\n if (!(\"x\" in target || \"y\" in target)) return\n\n const xValue = visualElement.getValue(\n \"x\",\n visualElement.latestValues[\"x\"] ?? 0\n )\n const yValue = visualElement.getValue(\n \"y\",\n visualElement.latestValues[\"y\"] ?? 0\n )\n\n const xRaw = target.x as number | number[] | undefined\n const yRaw = target.y as number | number[] | undefined\n\n const xFrom = ((Array.isArray(xRaw) && xRaw[0] != null\n ? xRaw[0]\n : xValue?.get()) as number) ?? 0\n const yFrom = ((Array.isArray(yRaw) && yRaw[0] != null\n ? yRaw[0]\n : yValue?.get()) as number) ?? 0\n const xTo = (Array.isArray(xRaw)\n ? xRaw[xRaw.length - 1]\n : xRaw ?? xFrom) as number\n const yTo = (Array.isArray(yRaw)\n ? yRaw[yRaw.length - 1]\n : yRaw ?? yFrom) as number\n\n // Interruption needs no flag: x/y already hold the displaced\n // mid-arc position, so xFrom/yFrom carry the continuity geometry.\n const interpolate = sample(\n { x: xFrom, y: yFrom },\n { x: xTo, y: yTo }\n )\n\n // Drive a dedicated `pathRotation` value (composed onto `rotate`\n // at the build sites) rather than `rotate` itself, so a\n // concurrent rotate animation composes and nothing accumulates\n // on interrupt.\n const pathRotationValue =\n interpolate(0).rotate !== undefined\n ? visualElement.getValue(\"pathRotation\", 0)\n : undefined\n\n const pathTransition = {\n delay,\n ...getValueTransition(transition || {}, \"x\"),\n }\n delete (pathTransition as { path?: unknown }).path\n\n const progress = motionValue(0)\n progress.start(\n animateMotionValue(\"\", progress, [0, 1000] as any, {\n ...pathTransition,\n isSync: true,\n velocity: 0,\n onUpdate: (latest: number) => {\n const point = interpolate(latest / 1000)\n xValue?.set(point.x)\n yValue?.set(point.y)\n if (pathRotationValue && point.rotate !== undefined) {\n pathRotationValue.set(point.rotate)\n }\n },\n onComplete: () => {\n xValue?.set(xTo)\n yValue?.set(yTo)\n pathRotationValue?.set(0)\n },\n // Interrupt/cancel must clear our additive contribution\n // so it can't linger on top of the user's `rotate`.\n onStop: () => pathRotationValue?.set(0),\n onCancel: () => pathRotationValue?.set(0),\n })\n )\n\n if (progress.animation) animations.push(progress.animation)\n\n delete (target as { x?: unknown }).x\n delete (target as { y?: unknown }).y\n },\n }\n\n return path\n}\n"],"names":[],"mappings":";;;;;AAgCA,MAAM,mBAAmB,GAAG,EAAE;AAE9B,SAAS,WAAW,CAChB,CAAS,EACT,MAAc,EACd,OAAe,EACf,MAAc,EAAA;AAEd,IAAA,MAAM,GAAG,GAAG,CAAC,GAAG,CAAC;AACjB,IAAA,OA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,CAAC;AAChB,oBAAA,MAAM,EAAE,GAAG,CAAC,GAAG,CAAC;AAChB,oBAAA,iBAAiB,EAAE,GAAG,CAAC,CAAC,CAAC;gBAC7B,CAAC;;;gBAGD,MAAM,EAAE,MAAM,iBAAiB,EAAE,GAAG,CAAC,CAAC,CAAC;gBACvC,QAAQ,EAAE,MAAM,iBAAiB,EAAE,GAAG,CAAC,CAAC,CAAC;AAC5C,aAAA,CAAC,CACL;YAED,IAAI,QAAQ,CAAC,SAAS;AAAE,gBAAA,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC;YAE3D,OAAQ,MAA0B,CAAC,CAAC;YACpC,OAAQ,MAA0B,CAAC,CAAC;QACxC,CAAC;KACJ;AAED,IAAA,OAAO,IAAI;AACf;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/utils/calc-child-stagger.mjs b/node_modules/motion-dom/dist/es/animation/utils/calc-child-stagger.mjs deleted file mode 100644 index 4ddf789..0000000 --- a/node_modules/motion-dom/dist/es/animation/utils/calc-child-stagger.mjs +++ /dev/null @@ -1,16 +0,0 @@ -function calcChildStagger(children, child, delayChildren, staggerChildren = 0, staggerDirection = 1) { - const index = Array.from(children) - .sort((a, b) => a.sortNodePosition(b)) - .indexOf(child); - const numChildren = children.size; - const maxStaggerDuration = (numChildren - 1) * staggerChildren; - const delayIsFunction = typeof delayChildren === "function"; - return delayIsFunction - ? delayChildren(index, numChildren) - : staggerDirection === 1 - ? index * staggerChildren - : maxStaggerDuration - index * staggerChildren; -} - -export { calcChildStagger }; -//# sourceMappingURL=calc-child-stagger.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/utils/calc-child-stagger.mjs.map b/node_modules/motion-dom/dist/es/animation/utils/calc-child-stagger.mjs.map deleted file mode 100644 index 0a44c64..0000000 --- a/node_modules/motion-dom/dist/es/animation/utils/calc-child-stagger.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"calc-child-stagger.mjs","sources":["../../../../src/animation/utils/calc-child-stagger.ts"],"sourcesContent":["import type { DynamicOption } from \"../types\"\nimport type { VisualElement } from \"../../render/VisualElement\"\n\nexport function calcChildStagger(\n children: Set,\n child: VisualElement,\n delayChildren?: number | DynamicOption,\n staggerChildren: number = 0,\n staggerDirection: number = 1\n): number {\n const index = Array.from(children)\n .sort((a, b) => a.sortNodePosition(b))\n .indexOf(child)\n const numChildren = children.size\n const maxStaggerDuration = (numChildren - 1) * staggerChildren\n const delayIsFunction = typeof delayChildren === \"function\"\n\n return delayIsFunction\n ? delayChildren(index, numChildren)\n : staggerDirection === 1\n ? index * staggerChildren\n : maxStaggerDuration - index * staggerChildren\n}\n"],"names":[],"mappings":"AAGM,SAAU,gBAAgB,CAC5B,QAA4B,EAC5B,KAAoB,EACpB,aAA8C,EAC9C,eAAA,GAA0B,CAAC,EAC3B,mBAA2B,CAAC,EAAA;AAE5B,IAAA,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,QAAQ;AAC5B,SAAA,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC;SACpC,OAAO,CAAC,KAAK,CAAC;AACnB,IAAA,MAAM,WAAW,GAAG,QAAQ,CAAC,IAAI;IACjC,MAAM,kBAAkB,GAAG,CAAC,WAAW,GAAG,CAAC,IAAI,eAAe;AAC9D,IAAA,MAAM,eAAe,GAAG,OAAO,aAAa,KAAK,UAAU;AAE3D,IAAA,OAAO;AACH,UAAE,aAAa,CAAC,KAAK,EAAE,WAAW;UAChC,gBAAgB,KAAK;cACrB,KAAK,GAAG;AACV,cAAE,kBAAkB,GAAG,KAAK,GAAG,eAAe;AACtD;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/utils/can-animate.mjs b/node_modules/motion-dom/dist/es/animation/utils/can-animate.mjs deleted file mode 100644 index 0df4172..0000000 --- a/node_modules/motion-dom/dist/es/animation/utils/can-animate.mjs +++ /dev/null @@ -1,44 +0,0 @@ -import { warning } from 'motion-utils'; -import { isGenerator } from '../generators/utils/is-generator.mjs'; -import { isAnimatable } from './is-animatable.mjs'; - -function hasKeyframesChanged(keyframes) { - const current = keyframes[0]; - if (keyframes.length === 1) - return true; - for (let i = 0; i < keyframes.length; i++) { - if (keyframes[i] !== current) - return true; - } -} -function canAnimate(keyframes, name, type, velocity) { - /** - * Check if we're able to animate between the start and end keyframes, - * and throw a warning if we're attempting to animate between one that's - * animatable and another that isn't. - */ - const originKeyframe = keyframes[0]; - if (originKeyframe === null) { - return false; - } - /** - * These aren't traditionally animatable but we do support them. - * In future we could look into making this more generic or replacing - * this function with mix() === mixImmediate - */ - if (name === "display" || name === "visibility") - return true; - const targetKeyframe = keyframes[keyframes.length - 1]; - const isOriginAnimatable = isAnimatable(originKeyframe, name); - const isTargetAnimatable = isAnimatable(targetKeyframe, name); - warning(isOriginAnimatable === isTargetAnimatable, `You are trying to animate ${name} from "${originKeyframe}" to "${targetKeyframe}". "${isOriginAnimatable ? targetKeyframe : originKeyframe}" is not an animatable value.`, "value-not-animatable"); - // Always skip if any of these are true - if (!isOriginAnimatable || !isTargetAnimatable) { - return false; - } - return (hasKeyframesChanged(keyframes) || - ((type === "spring" || isGenerator(type)) && velocity)); -} - -export { canAnimate }; -//# sourceMappingURL=can-animate.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/utils/can-animate.mjs.map b/node_modules/motion-dom/dist/es/animation/utils/can-animate.mjs.map deleted file mode 100644 index 09c1c48..0000000 --- a/node_modules/motion-dom/dist/es/animation/utils/can-animate.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"can-animate.mjs","sources":["../../../../src/animation/utils/can-animate.ts"],"sourcesContent":["import { warning } from \"motion-utils\"\nimport { isGenerator } from \"../generators/utils/is-generator\"\nimport { ResolvedKeyframes } from \"../keyframes/KeyframesResolver\"\nimport { AnimationGeneratorType } from \"../types\"\nimport { isAnimatable } from \"./is-animatable\"\n\nfunction hasKeyframesChanged(keyframes: ResolvedKeyframes) {\n const current = keyframes[0]\n if (keyframes.length === 1) return true\n for (let i = 0; i < keyframes.length; i++) {\n if (keyframes[i] !== current) return true\n }\n}\n\nexport function canAnimate(\n keyframes: ResolvedKeyframes,\n name?: string,\n type?: AnimationGeneratorType,\n velocity?: number\n) {\n /**\n * Check if we're able to animate between the start and end keyframes,\n * and throw a warning if we're attempting to animate between one that's\n * animatable and another that isn't.\n */\n const originKeyframe = keyframes[0]\n if (originKeyframe === null) {\n return false\n }\n\n /**\n * These aren't traditionally animatable but we do support them.\n * In future we could look into making this more generic or replacing\n * this function with mix() === mixImmediate\n */\n if (name === \"display\" || name === \"visibility\") return true\n\n const targetKeyframe = keyframes[keyframes.length - 1]\n const isOriginAnimatable = isAnimatable(originKeyframe, name)\n const isTargetAnimatable = isAnimatable(targetKeyframe, name)\n\n warning(\n isOriginAnimatable === isTargetAnimatable,\n `You are trying to animate ${name} from \"${originKeyframe}\" to \"${targetKeyframe}\". \"${\n isOriginAnimatable ? targetKeyframe : originKeyframe\n }\" is not an animatable value.`,\n \"value-not-animatable\"\n )\n\n // Always skip if any of these are true\n if (!isOriginAnimatable || !isTargetAnimatable) {\n return false\n }\n\n return (\n hasKeyframesChanged(keyframes) ||\n ((type === \"spring\" || isGenerator(type)) && velocity)\n )\n}\n"],"names":[],"mappings":";;;;AAMA,SAAS,mBAAmB,CAAC,SAAiC,EAAA;AAC1D,IAAA,MAAM,OAAO,GAAG,SAAS,CAAC,CAAC,CAAC;AAC5B,IAAA,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC;AAAE,QAAA,OAAO,IAAI;AACvC,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AACvC,QAAA,IAAI,SAAS,CAAC,CAAC,CAAC,KAAK,OAAO;AAAE,YAAA,OAAO,IAAI;IAC7C;AACJ;AAEM,SAAU,UAAU,CACtB,SAAiC,EACjC,IAAa,EACb,IAA6B,EAC7B,QAAiB,EAAA;AAEjB;;;;AAIG;AACH,IAAA,MAAM,cAAc,GAAG,SAAS,CAAC,CAAC,CAAC;AACnC,IAAA,IAAI,cAAc,KAAK,IAAI,EAAE;AACzB,QAAA,OAAO,KAAK;IAChB;AAEA;;;;AAIG;AACH,IAAA,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,YAAY;AAAE,QAAA,OAAO,IAAI;IAE5D,MAAM,cAAc,GAAG,SAAS,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC;IACtD,MAAM,kBAAkB,GAAG,YAAY,CAAC,cAAc,EAAE,IAAI,CAAC;IAC7D,MAAM,kBAAkB,GAAG,YAAY,CAAC,cAAc,EAAE,IAAI,CAAC;IAE7D,OAAO,CACH,kBAAkB,KAAK,kBAAkB,EACzC,6BAA6B,IAAI,CAAA,OAAA,EAAU,cAAc,CAAA,MAAA,EAAS,cAAc,CAAA,IAAA,EAC5E,kBAAkB,GAAG,cAAc,GAAG,cAC1C,CAAA,6BAAA,CAA+B,EAC/B,sBAAsB,CACzB;;AAGD,IAAA,IAAI,CAAC,kBAAkB,IAAI,CAAC,kBAAkB,EAAE;AAC5C,QAAA,OAAO,KAAK;IAChB;AAEA,IAAA,QACI,mBAAmB,CAAC,SAAS,CAAC;AAC9B,SAAC,CAAC,IAAI,KAAK,QAAQ,IAAI,WAAW,CAAC,IAAI,CAAC,KAAK,QAAQ,CAAC;AAE9D;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/utils/css-variables-conversion.mjs b/node_modules/motion-dom/dist/es/animation/utils/css-variables-conversion.mjs deleted file mode 100644 index 78c8b40..0000000 --- a/node_modules/motion-dom/dist/es/animation/utils/css-variables-conversion.mjs +++ /dev/null @@ -1,42 +0,0 @@ -import { invariant, isNumericalString } from 'motion-utils'; -import { isCSSVariableToken } from './is-css-variable.mjs'; - -/** - * Parse Framer's special CSS variable format into a CSS token and a fallback. - * - * ``` - * `var(--foo, #fff)` => [`--foo`, '#fff'] - * ``` - * - * @param current - */ -const splitCSSVariableRegex = -// eslint-disable-next-line redos-detector/no-unsafe-regex -- false positive, as it can match a lot of words -/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u; -function parseCSSVariable(current) { - const match = splitCSSVariableRegex.exec(current); - if (!match) - return [,]; - const [, token1, token2, fallback] = match; - return [`--${token1 ?? token2}`, fallback]; -} -const maxDepth = 4; -function getVariableValue(current, element, depth = 1) { - invariant(depth <= maxDepth, `Max CSS variable fallback depth detected in property "${current}". This may indicate a circular fallback dependency.`, "max-css-var-depth"); - const [token, fallback] = parseCSSVariable(current); - // No CSS variable detected - if (!token) - return; - // Attempt to read this CSS variable off the element - const resolved = window.getComputedStyle(element).getPropertyValue(token); - if (resolved) { - const trimmed = resolved.trim(); - return isNumericalString(trimmed) ? parseFloat(trimmed) : trimmed; - } - return isCSSVariableToken(fallback) - ? getVariableValue(fallback, element, depth + 1) - : fallback; -} - -export { getVariableValue, parseCSSVariable }; -//# sourceMappingURL=css-variables-conversion.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/utils/css-variables-conversion.mjs.map b/node_modules/motion-dom/dist/es/animation/utils/css-variables-conversion.mjs.map deleted file mode 100644 index 6b17497..0000000 --- a/node_modules/motion-dom/dist/es/animation/utils/css-variables-conversion.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"css-variables-conversion.mjs","sources":["../../../../src/animation/utils/css-variables-conversion.ts"],"sourcesContent":["import { invariant, isNumericalString } from \"motion-utils\"\nimport { AnyResolvedKeyframe } from \"../types\"\nimport { CSSVariableToken, isCSSVariableToken } from \"./is-css-variable\"\n\n/**\n * Parse Framer's special CSS variable format into a CSS token and a fallback.\n *\n * ```\n * `var(--foo, #fff)` => [`--foo`, '#fff']\n * ```\n *\n * @param current\n */\n\nconst splitCSSVariableRegex =\n // eslint-disable-next-line redos-detector/no-unsafe-regex -- false positive, as it can match a lot of words\n /^var\\(--(?:([\\w-]+)|([\\w-]+), ?([a-zA-Z\\d ()%#.,-]+))\\)/u\nexport function parseCSSVariable(current: string) {\n const match = splitCSSVariableRegex.exec(current)\n if (!match) return [,]\n\n const [, token1, token2, fallback] = match\n return [`--${token1 ?? token2}`, fallback]\n}\n\nconst maxDepth = 4\nexport function getVariableValue(\n current: CSSVariableToken,\n element: Element,\n depth = 1\n): AnyResolvedKeyframe | undefined {\n invariant(\n depth <= maxDepth,\n `Max CSS variable fallback depth detected in property \"${current}\". This may indicate a circular fallback dependency.`,\n \"max-css-var-depth\"\n )\n\n const [token, fallback] = parseCSSVariable(current)\n\n // No CSS variable detected\n if (!token) return\n\n // Attempt to read this CSS variable off the element\n const resolved = window.getComputedStyle(element).getPropertyValue(token)\n\n if (resolved) {\n const trimmed = resolved.trim()\n return isNumericalString(trimmed) ? parseFloat(trimmed) : trimmed\n }\n\n return isCSSVariableToken(fallback)\n ? getVariableValue(fallback, element, depth + 1)\n : fallback\n}\n"],"names":[],"mappings":";;;AAIA;;;;;;;;AAQG;AAEH,MAAM,qBAAqB;AACvB;AACA,0DAA0D;AACxD,SAAU,gBAAgB,CAAC,OAAe,EAAA;IAC5C,MAAM,KAAK,GAAG,qBAAqB,CAAC,IAAI,CAAC,OAAO,CAAC;AACjD,IAAA,IAAI,CAAC,KAAK;QAAE,OAAO,GAAG;IAEtB,MAAM,GAAG,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,GAAG,KAAK;IAC1C,OAAO,CAAC,KAAK,MAAM,IAAI,MAAM,CAAA,CAAE,EAAE,QAAQ,CAAC;AAC9C;AAEA,MAAM,QAAQ,GAAG,CAAC;AACZ,SAAU,gBAAgB,CAC5B,OAAyB,EACzB,OAAgB,EAChB,KAAK,GAAG,CAAC,EAAA;IAET,SAAS,CACL,KAAK,IAAI,QAAQ,EACjB,CAAA,sDAAA,EAAyD,OAAO,CAAA,oDAAA,CAAsD,EACtH,mBAAmB,CACtB;IAED,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,gBAAgB,CAAC,OAAO,CAAC;;AAGnD,IAAA,IAAI,CAAC,KAAK;QAAE;;AAGZ,IAAA,MAAM,QAAQ,GAAG,MAAM,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC;IAEzE,IAAI,QAAQ,EAAE;AACV,QAAA,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,EAAE;AAC/B,QAAA,OAAO,iBAAiB,CAAC,OAAO,CAAC,GAAG,UAAU,CAAC,OAAO,CAAC,GAAG,OAAO;IACrE;IAEA,OAAO,kBAAkB,CAAC,QAAQ;UAC5B,gBAAgB,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,GAAG,CAAC;UAC7C,QAAQ;AAClB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/utils/default-transitions.mjs b/node_modules/motion-dom/dist/es/animation/utils/default-transitions.mjs deleted file mode 100644 index 00ca169..0000000 --- a/node_modules/motion-dom/dist/es/animation/utils/default-transitions.mjs +++ /dev/null @@ -1,41 +0,0 @@ -import { transformProps } from '../../render/utils/keys-transform.mjs'; - -const underDampedSpring = { - type: "spring", - stiffness: 500, - damping: 25, - restSpeed: 10, -}; -const criticallyDampedSpring = (target) => ({ - type: "spring", - stiffness: 550, - damping: target === 0 ? 2 * Math.sqrt(550) : 30, - restSpeed: 10, -}); -const keyframesTransition = { - type: "keyframes", - duration: 0.8, -}; -/** - * Default easing curve is a slightly shallower version of - * the default browser easing curve. - */ -const ease = { - type: "keyframes", - ease: [0.25, 0.1, 0.35, 1], - duration: 0.3, -}; -const getDefaultTransition = (valueKey, { keyframes }) => { - if (keyframes.length > 2) { - return keyframesTransition; - } - else if (transformProps.has(valueKey)) { - return valueKey.startsWith("scale") - ? criticallyDampedSpring(keyframes[1]) - : underDampedSpring; - } - return ease; -}; - -export { getDefaultTransition }; -//# sourceMappingURL=default-transitions.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/utils/default-transitions.mjs.map b/node_modules/motion-dom/dist/es/animation/utils/default-transitions.mjs.map deleted file mode 100644 index f7ef1ae..0000000 --- a/node_modules/motion-dom/dist/es/animation/utils/default-transitions.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"default-transitions.mjs","sources":["../../../../src/animation/utils/default-transitions.ts"],"sourcesContent":["import { transformProps } from \"../../render/utils/keys-transform\"\nimport type { ValueAnimationOptions } from \"../types\"\n\nconst underDampedSpring: Partial = {\n type: \"spring\",\n stiffness: 500,\n damping: 25,\n restSpeed: 10,\n}\n\nconst criticallyDampedSpring = (\n target: unknown\n): Partial => ({\n type: \"spring\",\n stiffness: 550,\n damping: target === 0 ? 2 * Math.sqrt(550) : 30,\n restSpeed: 10,\n})\n\nconst keyframesTransition: Partial = {\n type: \"keyframes\",\n duration: 0.8,\n}\n\n/**\n * Default easing curve is a slightly shallower version of\n * the default browser easing curve.\n */\nconst ease: Partial = {\n type: \"keyframes\",\n ease: [0.25, 0.1, 0.35, 1],\n duration: 0.3,\n}\n\nexport const getDefaultTransition = (\n valueKey: string,\n { keyframes }: ValueAnimationOptions\n): Partial => {\n if (keyframes.length > 2) {\n return keyframesTransition\n } else if (transformProps.has(valueKey)) {\n return valueKey.startsWith(\"scale\")\n ? criticallyDampedSpring(keyframes[1])\n : underDampedSpring\n }\n\n return ease\n}\n"],"names":[],"mappings":";;AAGA,MAAM,iBAAiB,GAAmC;AACtD,IAAA,IAAI,EAAE,QAAQ;AACd,IAAA,SAAS,EAAE,GAAG;AACd,IAAA,OAAO,EAAE,EAAE;AACX,IAAA,SAAS,EAAE,EAAE;CAChB;AAED,MAAM,sBAAsB,GAAG,CAC3B,MAAe,MACmB;AAClC,IAAA,IAAI,EAAE,QAAQ;AACd,IAAA,SAAS,EAAE,GAAG;AACd,IAAA,OAAO,EAAE,MAAM,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE;AAC/C,IAAA,SAAS,EAAE,EAAE;AAChB,CAAA,CAAC;AAEF,MAAM,mBAAmB,GAAmC;AACxD,IAAA,IAAI,EAAE,WAAW;AACjB,IAAA,QAAQ,EAAE,GAAG;CAChB;AAED;;;AAGG;AACH,MAAM,IAAI,GAAmC;AACzC,IAAA,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC;AAC1B,IAAA,QAAQ,EAAE,GAAG;CAChB;AAEM,MAAM,oBAAoB,GAAG,CAChC,QAAgB,EAChB,EAAE,SAAS,EAAyB,KACJ;AAChC,IAAA,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE;AACtB,QAAA,OAAO,mBAAmB;IAC9B;AAAO,SAAA,IAAI,cAAc,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE;AACrC,QAAA,OAAO,QAAQ,CAAC,UAAU,CAAC,OAAO;AAC9B,cAAE,sBAAsB,CAAC,SAAS,CAAC,CAAC,CAAC;cACnC,iBAAiB;IAC3B;AAEA,IAAA,OAAO,IAAI;AACf;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/utils/get-value-transition.mjs b/node_modules/motion-dom/dist/es/animation/utils/get-value-transition.mjs deleted file mode 100644 index d616d23..0000000 --- a/node_modules/motion-dom/dist/es/animation/utils/get-value-transition.mjs +++ /dev/null @@ -1,14 +0,0 @@ -import { resolveTransition } from './resolve-transition.mjs'; - -function getValueTransition(transition, key) { - const valueTransition = transition?.[key] ?? - transition?.["default"] ?? - transition; - if (valueTransition !== transition) { - return resolveTransition(valueTransition, transition); - } - return valueTransition; -} - -export { getValueTransition }; -//# sourceMappingURL=get-value-transition.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/utils/get-value-transition.mjs.map b/node_modules/motion-dom/dist/es/animation/utils/get-value-transition.mjs.map deleted file mode 100644 index 4e9313c..0000000 --- a/node_modules/motion-dom/dist/es/animation/utils/get-value-transition.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"get-value-transition.mjs","sources":["../../../../src/animation/utils/get-value-transition.ts"],"sourcesContent":["import { resolveTransition } from \"./resolve-transition\"\n\nexport function getValueTransition(transition: any, key: string) {\n const valueTransition =\n transition?.[key as keyof typeof transition] ??\n transition?.[\"default\"] ??\n transition\n\n if (valueTransition !== transition) {\n return resolveTransition(valueTransition, transition)\n }\n\n return valueTransition\n}\n"],"names":[],"mappings":";;AAEM,SAAU,kBAAkB,CAAC,UAAe,EAAE,GAAW,EAAA;AAC3D,IAAA,MAAM,eAAe,GACjB,UAAU,GAAG,GAA8B,CAAC;QAC5C,UAAU,GAAG,SAAS,CAAC;AACvB,QAAA,UAAU;AAEd,IAAA,IAAI,eAAe,KAAK,UAAU,EAAE;AAChC,QAAA,OAAO,iBAAiB,CAAC,eAAe,EAAE,UAAU,CAAC;IACzD;AAEA,IAAA,OAAO,eAAe;AAC1B;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/utils/is-animatable.mjs b/node_modules/motion-dom/dist/es/animation/utils/is-animatable.mjs deleted file mode 100644 index b1ca0da..0000000 --- a/node_modules/motion-dom/dist/es/animation/utils/is-animatable.mjs +++ /dev/null @@ -1,31 +0,0 @@ -import { complex } from '../../value/types/complex/index.mjs'; - -/** - * Check if a value is animatable. Examples: - * - * ✅: 100, "100px", "#fff" - * ❌: "block", "url(2.jpg)" - * @param value - * - * @internal - */ -const isAnimatable = (value, name) => { - // If the list of keys that might be non-animatable grows, replace with Set - if (name === "zIndex") - return false; - // If it's a number or a keyframes array, we can animate it. We might at some point - // need to do a deep isAnimatable check of keyframes, or let Popmotion handle this, - // but for now lets leave it like this for performance reasons - if (typeof value === "number" || Array.isArray(value)) - return true; - if (typeof value === "string" && // It's animatable if we have a string - (complex.test(value) || value === "0") && // And it contains numbers and/or colors - !value.startsWith("url(") // Unless it starts with "url(" - ) { - return true; - } - return false; -}; - -export { isAnimatable }; -//# sourceMappingURL=is-animatable.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/utils/is-animatable.mjs.map b/node_modules/motion-dom/dist/es/animation/utils/is-animatable.mjs.map deleted file mode 100644 index 6e0d955..0000000 --- a/node_modules/motion-dom/dist/es/animation/utils/is-animatable.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"is-animatable.mjs","sources":["../../../../src/animation/utils/is-animatable.ts"],"sourcesContent":["import { complex } from \"../../value/types/complex\"\nimport { ValueKeyframesDefinition } from \"../types\"\n\n/**\n * Check if a value is animatable. Examples:\n *\n * ✅: 100, \"100px\", \"#fff\"\n * ❌: \"block\", \"url(2.jpg)\"\n * @param value\n *\n * @internal\n */\nexport const isAnimatable = (\n value: ValueKeyframesDefinition,\n name?: string\n) => {\n // If the list of keys that might be non-animatable grows, replace with Set\n if (name === \"zIndex\") return false\n\n // If it's a number or a keyframes array, we can animate it. We might at some point\n // need to do a deep isAnimatable check of keyframes, or let Popmotion handle this,\n // but for now lets leave it like this for performance reasons\n if (typeof value === \"number\" || Array.isArray(value)) return true\n\n if (\n typeof value === \"string\" && // It's animatable if we have a string\n (complex.test(value) || value === \"0\") && // And it contains numbers and/or colors\n !value.startsWith(\"url(\") // Unless it starts with \"url(\"\n ) {\n return true\n }\n\n return false\n}\n"],"names":[],"mappings":";;AAGA;;;;;;;;AAQG;MACU,YAAY,GAAG,CACxB,KAA+B,EAC/B,IAAa,KACb;;IAEA,IAAI,IAAI,KAAK,QAAQ;AAAE,QAAA,OAAO,KAAK;;;;IAKnC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;AAAE,QAAA,OAAO,IAAI;AAElE,IAAA,IACI,OAAO,KAAK,KAAK,QAAQ;AACzB,SAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,KAAK,GAAG,CAAC;AACtC,QAAA,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC;MAC3B;AACE,QAAA,OAAO,IAAI;IACf;AAEA,IAAA,OAAO,KAAK;AAChB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/utils/is-css-variable.mjs b/node_modules/motion-dom/dist/es/animation/utils/is-css-variable.mjs deleted file mode 100644 index f0d3618..0000000 --- a/node_modules/motion-dom/dist/es/animation/utils/is-css-variable.mjs +++ /dev/null @@ -1,27 +0,0 @@ -const checkStringStartsWith = (token) => (key) => typeof key === "string" && key.startsWith(token); -const isCSSVariableName = -/*@__PURE__*/ checkStringStartsWith("--"); -const startsAsVariableToken = -/*@__PURE__*/ checkStringStartsWith("var(--"); -const isCSSVariableToken = (value) => { - const startsWithToken = startsAsVariableToken(value); - if (!startsWithToken) - return false; - // Ensure any comments are stripped from the value as this can harm performance of the regex. - return singleCssVariableRegex.test(value.split("/*")[0].trim()); -}; -const singleCssVariableRegex = /var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu; -/** - * Check if a value contains a CSS variable anywhere (e.g. inside calc()). - * Unlike isCSSVariableToken which checks if the value IS a var() token, - * this checks if the value CONTAINS var() somewhere in the string. - */ -function containsCSSVariable(value) { - if (typeof value !== "string") - return false; - // Strip comments to avoid false positives - return value.split("/*")[0].includes("var(--"); -} - -export { containsCSSVariable, isCSSVariableName, isCSSVariableToken }; -//# sourceMappingURL=is-css-variable.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/utils/is-css-variable.mjs.map b/node_modules/motion-dom/dist/es/animation/utils/is-css-variable.mjs.map deleted file mode 100644 index 24aaa22..0000000 --- a/node_modules/motion-dom/dist/es/animation/utils/is-css-variable.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"is-css-variable.mjs","sources":["../../../../src/animation/utils/is-css-variable.ts"],"sourcesContent":["import { AnyResolvedKeyframe } from \"../types\"\n\nexport type CSSVariableName = `--${string}`\n\nexport type CSSVariableToken = `var(${CSSVariableName})`\n\nconst checkStringStartsWith =\n (token: string) =>\n (key?: AnyResolvedKeyframe | null): key is T =>\n typeof key === \"string\" && key.startsWith(token)\n\nexport const isCSSVariableName =\n /*@__PURE__*/ checkStringStartsWith(\"--\")\n\nconst startsAsVariableToken =\n /*@__PURE__*/ checkStringStartsWith(\"var(--\")\nexport const isCSSVariableToken = (\n value?: string\n): value is CSSVariableToken => {\n const startsWithToken = startsAsVariableToken(value)\n\n if (!startsWithToken) return false\n\n // Ensure any comments are stripped from the value as this can harm performance of the regex.\n return singleCssVariableRegex.test(value.split(\"/*\")[0].trim())\n}\n\nconst singleCssVariableRegex =\n /var\\(--(?:[\\w-]+\\s*|[\\w-]+\\s*,(?:\\s*[^)(\\s]|\\s*\\((?:[^)(]|\\([^)(]*\\))*\\))+\\s*)\\)$/iu\n\n/**\n * Check if a value contains a CSS variable anywhere (e.g. inside calc()).\n * Unlike isCSSVariableToken which checks if the value IS a var() token,\n * this checks if the value CONTAINS var() somewhere in the string.\n */\nexport function containsCSSVariable(\n value?: AnyResolvedKeyframe | null\n): boolean {\n if (typeof value !== \"string\") return false\n // Strip comments to avoid false positives\n return value.split(\"/*\")[0].includes(\"var(--\")\n}\n"],"names":[],"mappings":"AAMA,MAAM,qBAAqB,GACvB,CAAmB,KAAa,KAChC,CAAC,GAAgC,KAC7B,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,CAAC,UAAU,CAAC,KAAK,CAAC;MAE3C,iBAAiB;AAC1B,cAAc,qBAAqB,CAAkB,IAAI;AAE7D,MAAM,qBAAqB;AACvB,cAAc,qBAAqB,CAAmB,QAAQ,CAAC;AAC5D,MAAM,kBAAkB,GAAG,CAC9B,KAAc,KACa;AAC3B,IAAA,MAAM,eAAe,GAAG,qBAAqB,CAAC,KAAK,CAAC;AAEpD,IAAA,IAAI,CAAC,eAAe;AAAE,QAAA,OAAO,KAAK;;AAGlC,IAAA,OAAO,sBAAsB,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;AACnE;AAEA,MAAM,sBAAsB,GACxB,qFAAqF;AAEzF;;;;AAIG;AACG,SAAU,mBAAmB,CAC/B,KAAkC,EAAA;IAElC,IAAI,OAAO,KAAK,KAAK,QAAQ;AAAE,QAAA,OAAO,KAAK;;AAE3C,IAAA,OAAO,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC;AAClD;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/utils/is-transition-defined.mjs b/node_modules/motion-dom/dist/es/animation/utils/is-transition-defined.mjs deleted file mode 100644 index 394fca4..0000000 --- a/node_modules/motion-dom/dist/es/animation/utils/is-transition-defined.mjs +++ /dev/null @@ -1,27 +0,0 @@ -const orchestrationKeys = new Set([ - "when", - "delay", - "delayChildren", - "staggerChildren", - "staggerDirection", - "repeat", - "repeatType", - "repeatDelay", - "from", - "elapsed", -]); -/** - * Decide whether a transition is defined on a given Transition. - * This filters out orchestration options and returns true - * if any options are left. - */ -function isTransitionDefined(transition) { - for (const key in transition) { - if (!orchestrationKeys.has(key)) - return true; - } - return false; -} - -export { isTransitionDefined }; -//# sourceMappingURL=is-transition-defined.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/utils/is-transition-defined.mjs.map b/node_modules/motion-dom/dist/es/animation/utils/is-transition-defined.mjs.map deleted file mode 100644 index 619fcce..0000000 --- a/node_modules/motion-dom/dist/es/animation/utils/is-transition-defined.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"is-transition-defined.mjs","sources":["../../../../src/animation/utils/is-transition-defined.ts"],"sourcesContent":["import type { AnyResolvedKeyframe } from \"../types\"\nimport type { Transition } from \"../types\"\n\nconst orchestrationKeys = new Set([\n \"when\",\n \"delay\",\n \"delayChildren\",\n \"staggerChildren\",\n \"staggerDirection\",\n \"repeat\",\n \"repeatType\",\n \"repeatDelay\",\n \"from\",\n \"elapsed\",\n])\n\n/**\n * Decide whether a transition is defined on a given Transition.\n * This filters out orchestration options and returns true\n * if any options are left.\n */\nexport function isTransitionDefined(\n transition: Transition & { elapsed?: number; from?: AnyResolvedKeyframe }\n) {\n for (const key in transition) {\n if (!orchestrationKeys.has(key)) return true\n }\n return false\n}\n"],"names":[],"mappings":"AAGA,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAC;IAC9B,MAAM;IACN,OAAO;IACP,eAAe;IACf,iBAAiB;IACjB,kBAAkB;IAClB,QAAQ;IACR,YAAY;IACZ,aAAa;IACb,MAAM;IACN,SAAS;AACZ,CAAA,CAAC;AAEF;;;;AAIG;AACG,SAAU,mBAAmB,CAC/B,UAAyE,EAAA;AAEzE,IAAA,KAAK,MAAM,GAAG,IAAI,UAAU,EAAE;AAC1B,QAAA,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,GAAG,CAAC;AAAE,YAAA,OAAO,IAAI;IAChD;AACA,IAAA,OAAO,KAAK;AAChB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/utils/make-animation-instant.mjs b/node_modules/motion-dom/dist/es/animation/utils/make-animation-instant.mjs deleted file mode 100644 index 2c66615..0000000 --- a/node_modules/motion-dom/dist/es/animation/utils/make-animation-instant.mjs +++ /dev/null @@ -1,7 +0,0 @@ -function makeAnimationInstant(options) { - options.duration = 0; - options.type = "keyframes"; -} - -export { makeAnimationInstant }; -//# sourceMappingURL=make-animation-instant.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/utils/make-animation-instant.mjs.map b/node_modules/motion-dom/dist/es/animation/utils/make-animation-instant.mjs.map deleted file mode 100644 index 38fa574..0000000 --- a/node_modules/motion-dom/dist/es/animation/utils/make-animation-instant.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"make-animation-instant.mjs","sources":["../../../../src/animation/utils/make-animation-instant.ts"],"sourcesContent":["import { ValueAnimationOptions } from \"../types\"\n\nexport function makeAnimationInstant(\n options: Partial<{\n duration: ValueAnimationOptions[\"duration\"]\n type: ValueAnimationOptions[\"type\"]\n }>\n): void {\n options.duration = 0\n options.type = \"keyframes\"\n}\n"],"names":[],"mappings":"AAEM,SAAU,oBAAoB,CAChC,OAGE,EAAA;AAEF,IAAA,OAAO,CAAC,QAAQ,GAAG,CAAC;AACpB,IAAA,OAAO,CAAC,IAAI,GAAG,WAAW;AAC9B;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/utils/replace-transition-type.mjs b/node_modules/motion-dom/dist/es/animation/utils/replace-transition-type.mjs deleted file mode 100644 index 5d06ecb..0000000 --- a/node_modules/motion-dom/dist/es/animation/utils/replace-transition-type.mjs +++ /dev/null @@ -1,19 +0,0 @@ -import { inertia } from '../generators/inertia.mjs'; -import { keyframes } from '../generators/keyframes.mjs'; -import { spring } from '../generators/spring.mjs'; - -const transitionTypeMap = { - decay: inertia, - inertia, - tween: keyframes, - keyframes: keyframes, - spring, -}; -function replaceTransitionType(transition) { - if (typeof transition.type === "string") { - transition.type = transitionTypeMap[transition.type]; - } -} - -export { replaceTransitionType }; -//# sourceMappingURL=replace-transition-type.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/utils/replace-transition-type.mjs.map b/node_modules/motion-dom/dist/es/animation/utils/replace-transition-type.mjs.map deleted file mode 100644 index f196392..0000000 --- a/node_modules/motion-dom/dist/es/animation/utils/replace-transition-type.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"replace-transition-type.mjs","sources":["../../../../src/animation/utils/replace-transition-type.ts"],"sourcesContent":["import { inertia } from \"../generators/inertia\"\nimport { keyframes } from \"../generators/keyframes\"\nimport { spring } from \"../generators/spring\"\nimport { GeneratorFactory, ValueAnimationTransition } from \"../types\"\n\nconst transitionTypeMap: { [key: string]: GeneratorFactory } = {\n decay: inertia,\n inertia,\n tween: keyframes,\n keyframes: keyframes,\n spring,\n}\n\nexport function replaceTransitionType(transition: ValueAnimationTransition) {\n if (typeof transition.type === \"string\") {\n transition.type = transitionTypeMap[transition.type]\n }\n}\n"],"names":[],"mappings":";;;;AAKA,MAAM,iBAAiB,GAAwC;AAC3D,IAAA,KAAK,EAAE,OAAO;IACd,OAAO;AACP,IAAA,KAAK,EAAE,SAAS;AAChB,IAAA,SAAS,EAAE,SAAS;IACpB,MAAM;CACT;AAEK,SAAU,qBAAqB,CAAC,UAAoC,EAAA;AACtE,IAAA,IAAI,OAAO,UAAU,CAAC,IAAI,KAAK,QAAQ,EAAE;QACrC,UAAU,CAAC,IAAI,GAAG,iBAAiB,CAAC,UAAU,CAAC,IAAI,CAAC;IACxD;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/utils/resolve-transition.mjs b/node_modules/motion-dom/dist/es/animation/utils/resolve-transition.mjs deleted file mode 100644 index c49df0b..0000000 --- a/node_modules/motion-dom/dist/es/animation/utils/resolve-transition.mjs +++ /dev/null @@ -1,15 +0,0 @@ -/** - * If `transition` has `inherit: true`, shallow-merge it with - * `parentTransition` (child keys win) and strip the `inherit` key. - * Otherwise return `transition` unchanged. - */ -function resolveTransition(transition, parentTransition) { - if (transition?.inherit && parentTransition) { - const { inherit: _, ...rest } = transition; - return { ...parentTransition, ...rest }; - } - return transition; -} - -export { resolveTransition }; -//# sourceMappingURL=resolve-transition.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/utils/resolve-transition.mjs.map b/node_modules/motion-dom/dist/es/animation/utils/resolve-transition.mjs.map deleted file mode 100644 index 1e54351..0000000 --- a/node_modules/motion-dom/dist/es/animation/utils/resolve-transition.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"resolve-transition.mjs","sources":["../../../../src/animation/utils/resolve-transition.ts"],"sourcesContent":["/**\n * If `transition` has `inherit: true`, shallow-merge it with\n * `parentTransition` (child keys win) and strip the `inherit` key.\n * Otherwise return `transition` unchanged.\n */\nexport function resolveTransition(\n transition: any,\n parentTransition?: any\n) {\n if (transition?.inherit && parentTransition) {\n const { inherit: _, ...rest } = transition\n return { ...parentTransition, ...rest }\n }\n\n return transition\n}\n"],"names":[],"mappings":"AAAA;;;;AAIG;AACG,SAAU,iBAAiB,CAC7B,UAAe,EACf,gBAAsB,EAAA;AAEtB,IAAA,IAAI,UAAU,EAAE,OAAO,IAAI,gBAAgB,EAAE;QACzC,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,GAAG,IAAI,EAAE,GAAG,UAAU;AAC1C,QAAA,OAAO,EAAE,GAAG,gBAAgB,EAAE,GAAG,IAAI,EAAE;IAC3C;AAEA,IAAA,OAAO,UAAU;AACrB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/waapi/easing/cubic-bezier.mjs b/node_modules/motion-dom/dist/es/animation/waapi/easing/cubic-bezier.mjs deleted file mode 100644 index 3b9c686..0000000 --- a/node_modules/motion-dom/dist/es/animation/waapi/easing/cubic-bezier.mjs +++ /dev/null @@ -1,4 +0,0 @@ -const cubicBezierAsString = ([a, b, c, d]) => `cubic-bezier(${a}, ${b}, ${c}, ${d})`; - -export { cubicBezierAsString }; -//# sourceMappingURL=cubic-bezier.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/waapi/easing/cubic-bezier.mjs.map b/node_modules/motion-dom/dist/es/animation/waapi/easing/cubic-bezier.mjs.map deleted file mode 100644 index dc2f3e4..0000000 --- a/node_modules/motion-dom/dist/es/animation/waapi/easing/cubic-bezier.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"cubic-bezier.mjs","sources":["../../../../../src/animation/waapi/easing/cubic-bezier.ts"],"sourcesContent":["import { BezierDefinition } from \"motion-utils\"\n\nexport const cubicBezierAsString = ([a, b, c, d]: BezierDefinition) =>\n `cubic-bezier(${a}, ${b}, ${c}, ${d})`\n"],"names":[],"mappings":"AAEO,MAAM,mBAAmB,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAmB,KAC9D,CAAA,aAAA,EAAgB,CAAC,CAAA,EAAA,EAAK,CAAC,CAAA,EAAA,EAAK,CAAC,CAAA,EAAA,EAAK,CAAC,CAAA,CAAA;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/waapi/easing/is-supported.mjs b/node_modules/motion-dom/dist/es/animation/waapi/easing/is-supported.mjs deleted file mode 100644 index 73ec416..0000000 --- a/node_modules/motion-dom/dist/es/animation/waapi/easing/is-supported.mjs +++ /dev/null @@ -1,15 +0,0 @@ -import { isBezierDefinition } from 'motion-utils'; -import { supportsLinearEasing } from '../../../utils/supports/linear-easing.mjs'; -import { supportedWaapiEasing } from './supported.mjs'; - -function isWaapiSupportedEasing(easing) { - return Boolean((typeof easing === "function" && supportsLinearEasing()) || - !easing || - (typeof easing === "string" && - (easing in supportedWaapiEasing || supportsLinearEasing())) || - isBezierDefinition(easing) || - (Array.isArray(easing) && easing.every(isWaapiSupportedEasing))); -} - -export { isWaapiSupportedEasing }; -//# sourceMappingURL=is-supported.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/waapi/easing/is-supported.mjs.map b/node_modules/motion-dom/dist/es/animation/waapi/easing/is-supported.mjs.map deleted file mode 100644 index 67bd993..0000000 --- a/node_modules/motion-dom/dist/es/animation/waapi/easing/is-supported.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"is-supported.mjs","sources":["../../../../../src/animation/waapi/easing/is-supported.ts"],"sourcesContent":["import { Easing, isBezierDefinition } from \"motion-utils\"\nimport { supportsLinearEasing } from \"../../../utils/supports/linear-easing\"\nimport { supportedWaapiEasing } from \"./supported\"\n\nexport function isWaapiSupportedEasing(easing?: Easing | Easing[]): boolean {\n return Boolean(\n (typeof easing === \"function\" && supportsLinearEasing()) ||\n !easing ||\n (typeof easing === \"string\" &&\n (easing in supportedWaapiEasing || supportsLinearEasing())) ||\n isBezierDefinition(easing) ||\n (Array.isArray(easing) && easing.every(isWaapiSupportedEasing))\n )\n}\n"],"names":[],"mappings":";;;;AAIM,SAAU,sBAAsB,CAAC,MAA0B,EAAA;IAC7D,OAAO,OAAO,CACV,CAAC,OAAO,MAAM,KAAK,UAAU,IAAI,oBAAoB,EAAE;AACnD,QAAA,CAAC,MAAM;SACN,OAAO,MAAM,KAAK,QAAQ;AACvB,aAAC,MAAM,IAAI,oBAAoB,IAAI,oBAAoB,EAAE,CAAC,CAAC;QAC/D,kBAAkB,CAAC,MAAM,CAAC;AAC1B,SAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC,CACtE;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/waapi/easing/map-easing.mjs b/node_modules/motion-dom/dist/es/animation/waapi/easing/map-easing.mjs deleted file mode 100644 index 4928688..0000000 --- a/node_modules/motion-dom/dist/es/animation/waapi/easing/map-easing.mjs +++ /dev/null @@ -1,29 +0,0 @@ -import { isBezierDefinition } from 'motion-utils'; -import { supportsLinearEasing } from '../../../utils/supports/linear-easing.mjs'; -import { generateLinearEasing } from '../utils/linear.mjs'; -import { cubicBezierAsString } from './cubic-bezier.mjs'; -import { supportedWaapiEasing } from './supported.mjs'; - -function mapEasingToNativeEasing(easing, duration) { - if (!easing) { - return undefined; - } - else if (typeof easing === "function") { - return supportsLinearEasing() - ? generateLinearEasing(easing, duration) - : "ease-out"; - } - else if (isBezierDefinition(easing)) { - return cubicBezierAsString(easing); - } - else if (Array.isArray(easing)) { - return easing.map((segmentEasing) => mapEasingToNativeEasing(segmentEasing, duration) || - supportedWaapiEasing.easeOut); - } - else { - return supportedWaapiEasing[easing]; - } -} - -export { mapEasingToNativeEasing }; -//# sourceMappingURL=map-easing.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/waapi/easing/map-easing.mjs.map b/node_modules/motion-dom/dist/es/animation/waapi/easing/map-easing.mjs.map deleted file mode 100644 index 8a0e028..0000000 --- a/node_modules/motion-dom/dist/es/animation/waapi/easing/map-easing.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"map-easing.mjs","sources":["../../../../../src/animation/waapi/easing/map-easing.ts"],"sourcesContent":["import { Easing, isBezierDefinition } from \"motion-utils\"\nimport { supportsLinearEasing } from \"../../../utils/supports/linear-easing\"\nimport { generateLinearEasing } from \"../utils/linear\"\nimport { cubicBezierAsString } from \"./cubic-bezier\"\nimport { supportedWaapiEasing } from \"./supported\"\n\nexport function mapEasingToNativeEasing(\n easing: Easing | Easing[] | undefined,\n duration: number\n): undefined | string | string[] {\n if (!easing) {\n return undefined\n } else if (typeof easing === \"function\") {\n return supportsLinearEasing()\n ? generateLinearEasing(easing, duration)\n : \"ease-out\"\n } else if (isBezierDefinition(easing)) {\n return cubicBezierAsString(easing)\n } else if (Array.isArray(easing)) {\n return easing.map(\n (segmentEasing) =>\n (mapEasingToNativeEasing(segmentEasing, duration) as string) ||\n supportedWaapiEasing.easeOut\n )\n } else {\n return supportedWaapiEasing[easing as keyof typeof supportedWaapiEasing]\n }\n}\n"],"names":[],"mappings":";;;;;;AAMM,SAAU,uBAAuB,CACnC,MAAqC,EACrC,QAAgB,EAAA;IAEhB,IAAI,CAAC,MAAM,EAAE;AACT,QAAA,OAAO,SAAS;IACpB;AAAO,SAAA,IAAI,OAAO,MAAM,KAAK,UAAU,EAAE;AACrC,QAAA,OAAO,oBAAoB;AACvB,cAAE,oBAAoB,CAAC,MAAM,EAAE,QAAQ;cACrC,UAAU;IACpB;AAAO,SAAA,IAAI,kBAAkB,CAAC,MAAM,CAAC,EAAE;AACnC,QAAA,OAAO,mBAAmB,CAAC,MAAM,CAAC;IACtC;AAAO,SAAA,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;AAC9B,QAAA,OAAO,MAAM,CAAC,GAAG,CACb,CAAC,aAAa,KACT,uBAAuB,CAAC,aAAa,EAAE,QAAQ,CAAY;YAC5D,oBAAoB,CAAC,OAAO,CACnC;IACL;SAAO;AACH,QAAA,OAAO,oBAAoB,CAAC,MAA2C,CAAC;IAC5E;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/waapi/easing/supported.mjs b/node_modules/motion-dom/dist/es/animation/waapi/easing/supported.mjs deleted file mode 100644 index ae315b0..0000000 --- a/node_modules/motion-dom/dist/es/animation/waapi/easing/supported.mjs +++ /dev/null @@ -1,16 +0,0 @@ -import { cubicBezierAsString } from './cubic-bezier.mjs'; - -const supportedWaapiEasing = { - linear: "linear", - ease: "ease", - easeIn: "ease-in", - easeOut: "ease-out", - easeInOut: "ease-in-out", - circIn: /*@__PURE__*/ cubicBezierAsString([0, 0.65, 0.55, 1]), - circOut: /*@__PURE__*/ cubicBezierAsString([0.55, 0, 1, 0.45]), - backIn: /*@__PURE__*/ cubicBezierAsString([0.31, 0.01, 0.66, -0.59]), - backOut: /*@__PURE__*/ cubicBezierAsString([0.33, 1.53, 0.69, 0.99]), -}; - -export { supportedWaapiEasing }; -//# sourceMappingURL=supported.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/waapi/easing/supported.mjs.map b/node_modules/motion-dom/dist/es/animation/waapi/easing/supported.mjs.map deleted file mode 100644 index 686bcd7..0000000 --- a/node_modules/motion-dom/dist/es/animation/waapi/easing/supported.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"supported.mjs","sources":["../../../../../src/animation/waapi/easing/supported.ts"],"sourcesContent":["import { cubicBezierAsString } from \"./cubic-bezier\"\n\nexport const supportedWaapiEasing = {\n linear: \"linear\",\n ease: \"ease\",\n easeIn: \"ease-in\",\n easeOut: \"ease-out\",\n easeInOut: \"ease-in-out\",\n circIn: /*@__PURE__*/ cubicBezierAsString([0, 0.65, 0.55, 1]),\n circOut: /*@__PURE__*/ cubicBezierAsString([0.55, 0, 1, 0.45]),\n backIn: /*@__PURE__*/ cubicBezierAsString([0.31, 0.01, 0.66, -0.59]),\n backOut: /*@__PURE__*/ cubicBezierAsString([0.33, 1.53, 0.69, 0.99]),\n}\n"],"names":[],"mappings":";;AAEO,MAAM,oBAAoB,GAAG;AAChC,IAAA,MAAM,EAAE,QAAQ;AAChB,IAAA,IAAI,EAAE,MAAM;AACZ,IAAA,MAAM,EAAE,SAAS;AACjB,IAAA,OAAO,EAAE,UAAU;AACnB,IAAA,SAAS,EAAE,aAAa;AACxB,IAAA,MAAM,gBAAgB,mBAAmB,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AAC7D,IAAA,OAAO,gBAAgB,mBAAmB,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC;AAC9D,IAAA,MAAM,gBAAgB,mBAAmB,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;AACpE,IAAA,OAAO,gBAAgB,mBAAmB,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/waapi/start-waapi-animation.mjs b/node_modules/motion-dom/dist/es/animation/waapi/start-waapi-animation.mjs deleted file mode 100644 index 8f46e1b..0000000 --- a/node_modules/motion-dom/dist/es/animation/waapi/start-waapi-animation.mjs +++ /dev/null @@ -1,29 +0,0 @@ -import { mapEasingToNativeEasing } from './easing/map-easing.mjs'; - -function startWaapiAnimation(element, valueName, keyframes, { delay = 0, duration = 300, repeat = 0, repeatType = "loop", ease = "easeOut", times, } = {}, pseudoElement = undefined) { - const keyframeOptions = { - [valueName]: keyframes, - }; - if (times) - keyframeOptions.offset = times; - const easing = mapEasingToNativeEasing(ease, duration); - /** - * If this is an easing array, apply to keyframes, not animation as a whole - */ - if (Array.isArray(easing)) - keyframeOptions.easing = easing; - const options = { - delay, - duration, - easing: !Array.isArray(easing) ? easing : "linear", - fill: "both", - iterations: repeat + 1, - direction: repeatType === "reverse" ? "alternate" : "normal", - }; - if (pseudoElement) - options.pseudoElement = pseudoElement; - return element.animate(keyframeOptions, options); -} - -export { startWaapiAnimation }; -//# sourceMappingURL=start-waapi-animation.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/waapi/start-waapi-animation.mjs.map b/node_modules/motion-dom/dist/es/animation/waapi/start-waapi-animation.mjs.map deleted file mode 100644 index 22d6d49..0000000 --- a/node_modules/motion-dom/dist/es/animation/waapi/start-waapi-animation.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"start-waapi-animation.mjs","sources":["../../../../src/animation/waapi/start-waapi-animation.ts"],"sourcesContent":["import { ValueKeyframesDefinition, ValueTransition } from \"../types\"\nimport { mapEasingToNativeEasing } from \"./easing/map-easing\"\n\nexport function startWaapiAnimation(\n element: Element,\n valueName: string,\n keyframes: ValueKeyframesDefinition,\n {\n delay = 0,\n duration = 300,\n repeat = 0,\n repeatType = \"loop\",\n ease = \"easeOut\",\n times,\n }: ValueTransition = {},\n pseudoElement: string | undefined = undefined\n) {\n const keyframeOptions: PropertyIndexedKeyframes = {\n [valueName]: keyframes as string[],\n }\n if (times) keyframeOptions.offset = times\n\n const easing = mapEasingToNativeEasing(ease, duration)\n\n /**\n * If this is an easing array, apply to keyframes, not animation as a whole\n */\n if (Array.isArray(easing)) keyframeOptions.easing = easing\n\n const options: KeyframeAnimationOptions = {\n delay,\n duration,\n easing: !Array.isArray(easing) ? easing : \"linear\",\n fill: \"both\",\n iterations: repeat + 1,\n direction: repeatType === \"reverse\" ? \"alternate\" : \"normal\",\n }\n\n if (pseudoElement) options.pseudoElement = pseudoElement\n\n return element.animate(keyframeOptions, options)\n}\n"],"names":[],"mappings":";;AAGM,SAAU,mBAAmB,CAC/B,OAAgB,EAChB,SAAiB,EACjB,SAAmC,EACnC,EACI,KAAK,GAAG,CAAC,EACT,QAAQ,GAAG,GAAG,EACd,MAAM,GAAG,CAAC,EACV,UAAU,GAAG,MAAM,EACnB,IAAI,GAAG,SAAS,EAChB,KAAK,GAAA,GACY,EAAE,EACvB,gBAAoC,SAAS,EAAA;AAE7C,IAAA,MAAM,eAAe,GAA6B;QAC9C,CAAC,SAAS,GAAG,SAAqB;KACrC;AACD,IAAA,IAAI,KAAK;AAAE,QAAA,eAAe,CAAC,MAAM,GAAG,KAAK;IAEzC,MAAM,MAAM,GAAG,uBAAuB,CAAC,IAAI,EAAE,QAAQ,CAAC;AAEtD;;AAEG;AACH,IAAA,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;AAAE,QAAA,eAAe,CAAC,MAAM,GAAG,MAAM;AAE1D,IAAA,MAAM,OAAO,GAA6B;QACtC,KAAK;QACL,QAAQ;AACR,QAAA,MAAM,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,GAAG,QAAQ;AAClD,QAAA,IAAI,EAAE,MAAM;QACZ,UAAU,EAAE,MAAM,GAAG,CAAC;QACtB,SAAS,EAAE,UAAU,KAAK,SAAS,GAAG,WAAW,GAAG,QAAQ;KAC/D;AAED,IAAA,IAAI,aAAa;AAAE,QAAA,OAAO,CAAC,aAAa,GAAG,aAAa;IAExD,OAAO,OAAO,CAAC,OAAO,CAAC,eAAe,EAAE,OAAO,CAAC;AACpD;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/waapi/supports/partial-keyframes.mjs b/node_modules/motion-dom/dist/es/animation/waapi/supports/partial-keyframes.mjs deleted file mode 100644 index 8250ebb..0000000 --- a/node_modules/motion-dom/dist/es/animation/waapi/supports/partial-keyframes.mjs +++ /dev/null @@ -1,14 +0,0 @@ -import { memo } from 'motion-utils'; - -const supportsPartialKeyframes = /*@__PURE__*/ memo(() => { - try { - document.createElement("div").animate({ opacity: [1] }); - } - catch (e) { - return false; - } - return true; -}); - -export { supportsPartialKeyframes }; -//# sourceMappingURL=partial-keyframes.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/waapi/supports/partial-keyframes.mjs.map b/node_modules/motion-dom/dist/es/animation/waapi/supports/partial-keyframes.mjs.map deleted file mode 100644 index f345259..0000000 --- a/node_modules/motion-dom/dist/es/animation/waapi/supports/partial-keyframes.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"partial-keyframes.mjs","sources":["../../../../../src/animation/waapi/supports/partial-keyframes.ts"],"sourcesContent":["import { memo } from \"motion-utils\"\n\nexport const supportsPartialKeyframes = /*@__PURE__*/ memo(() => {\n try {\n document.createElement(\"div\").animate({ opacity: [1] })\n } catch (e) {\n return false\n }\n return true\n})\n"],"names":[],"mappings":";;MAEa,wBAAwB,iBAAiB,IAAI,CAAC,MAAK;AAC5D,IAAA,IAAI;AACA,QAAA,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAC3D;IAAE,OAAO,CAAC,EAAE;AACR,QAAA,OAAO,KAAK;IAChB;AACA,IAAA,OAAO,IAAI;AACf,CAAC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/waapi/supports/waapi.mjs b/node_modules/motion-dom/dist/es/animation/waapi/supports/waapi.mjs deleted file mode 100644 index 65c5bcc..0000000 --- a/node_modules/motion-dom/dist/es/animation/waapi/supports/waapi.mjs +++ /dev/null @@ -1,55 +0,0 @@ -import { memo } from 'motion-utils'; -import { acceleratedValues } from '../utils/accelerated-values.mjs'; -import { hasBrowserOnlyColors } from '../utils/is-browser-color.mjs'; - -const colorProperties = new Set([ - "color", - "backgroundColor", - "outlineColor", - "fill", - "stroke", - "borderColor", - "borderTopColor", - "borderRightColor", - "borderBottomColor", - "borderLeftColor", -]); -const supportsWaapi = /*@__PURE__*/ memo(() => Object.hasOwnProperty.call(Element.prototype, "animate")); -function supportsBrowserAnimation(options) { - const { motionValue, name, repeatDelay, repeatType, damping, type, keyframes, } = options; - const subject = motionValue?.owner?.current; - /** - * We use instanceof checks instead of isHTMLElement()/isSVGElement() - * because we explicitly **don't** want elements in different timing - * contexts (i.e. popups) to be accelerated, as it's not possible to sync - * these animations properly with those driven from the main window - * frameloop. - */ - if (!(subject instanceof HTMLElement) && - !(subject instanceof SVGElement)) { - return false; - } - const { onUpdate, transformTemplate } = motionValue.owner.getProps(); - return (supportsWaapi() && - name && - /** - * Force WAAPI for color properties with browser-only color formats - * (oklch, oklab, lab, lch, etc.) that the JS animation path can't parse. - */ - (acceleratedValues.has(name) || - (colorProperties.has(name) && - hasBrowserOnlyColors(keyframes))) && - (name !== "transform" || !transformTemplate) && - /** - * If we're outputting values to onUpdate then we can't use WAAPI as there's - * no way to read the value from WAAPI every frame. - */ - !onUpdate && - !repeatDelay && - repeatType !== "mirror" && - damping !== 0 && - type !== "inertia"); -} - -export { supportsBrowserAnimation }; -//# sourceMappingURL=waapi.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/waapi/supports/waapi.mjs.map b/node_modules/motion-dom/dist/es/animation/waapi/supports/waapi.mjs.map deleted file mode 100644 index 7faffb7..0000000 --- a/node_modules/motion-dom/dist/es/animation/waapi/supports/waapi.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"waapi.mjs","sources":["../../../../../src/animation/waapi/supports/waapi.ts"],"sourcesContent":["import { memo } from \"motion-utils\"\nimport {\n AnyResolvedKeyframe,\n ValueAnimationOptionsWithRenderContext,\n} from \"../../types\"\nimport { acceleratedValues } from \"../utils/accelerated-values\"\nimport { hasBrowserOnlyColors } from \"../utils/is-browser-color\"\n\nconst colorProperties = new Set([\n \"color\",\n \"backgroundColor\",\n \"outlineColor\",\n \"fill\",\n \"stroke\",\n \"borderColor\",\n \"borderTopColor\",\n \"borderRightColor\",\n \"borderBottomColor\",\n \"borderLeftColor\",\n])\n\nconst supportsWaapi = /*@__PURE__*/ memo(() =>\n Object.hasOwnProperty.call(Element.prototype, \"animate\")\n)\n\nexport function supportsBrowserAnimation(\n options: ValueAnimationOptionsWithRenderContext\n) {\n const {\n motionValue,\n name,\n repeatDelay,\n repeatType,\n damping,\n type,\n keyframes,\n } = options\n\n const subject = motionValue?.owner?.current\n\n /**\n * We use instanceof checks instead of isHTMLElement()/isSVGElement()\n * because we explicitly **don't** want elements in different timing\n * contexts (i.e. popups) to be accelerated, as it's not possible to sync\n * these animations properly with those driven from the main window\n * frameloop.\n */\n if (\n !(subject instanceof HTMLElement) &&\n !(subject instanceof SVGElement)\n ) {\n return false\n }\n\n const { onUpdate, transformTemplate } = motionValue!.owner!.getProps()\n\n return (\n supportsWaapi() &&\n name &&\n /**\n * Force WAAPI for color properties with browser-only color formats\n * (oklch, oklab, lab, lch, etc.) that the JS animation path can't parse.\n */\n (acceleratedValues.has(name) ||\n (colorProperties.has(name) &&\n hasBrowserOnlyColors(keyframes))) &&\n (name !== \"transform\" || !transformTemplate) &&\n /**\n * If we're outputting values to onUpdate then we can't use WAAPI as there's\n * no way to read the value from WAAPI every frame.\n */\n !onUpdate &&\n !repeatDelay &&\n repeatType !== \"mirror\" &&\n damping !== 0 &&\n type !== \"inertia\"\n )\n}\n"],"names":[],"mappings":";;;;AAQA,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC;IAC5B,OAAO;IACP,iBAAiB;IACjB,cAAc;IACd,MAAM;IACN,QAAQ;IACR,aAAa;IACb,gBAAgB;IAChB,kBAAkB;IAClB,mBAAmB;IACnB,iBAAiB;AACpB,CAAA,CAAC;AAEF,MAAM,aAAa,iBAAiB,IAAI,CAAC,MACrC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,CAC3D;AAEK,SAAU,wBAAwB,CACpC,OAAkD,EAAA;AAElD,IAAA,MAAM,EACF,WAAW,EACX,IAAI,EACJ,WAAW,EACX,UAAU,EACV,OAAO,EACP,IAAI,EACJ,SAAS,GACZ,GAAG,OAAO;AAEX,IAAA,MAAM,OAAO,GAAG,WAAW,EAAE,KAAK,EAAE,OAAO;AAE3C;;;;;;AAMG;AACH,IAAA,IACI,EAAE,OAAO,YAAY,WAAW,CAAC;AACjC,QAAA,EAAE,OAAO,YAAY,UAAU,CAAC,EAClC;AACE,QAAA,OAAO,KAAK;IAChB;AAEA,IAAA,MAAM,EAAE,QAAQ,EAAE,iBAAiB,EAAE,GAAG,WAAY,CAAC,KAAM,CAAC,QAAQ,EAAE;IAEtE,QACI,aAAa,EAAE;QACf,IAAI;AACJ;;;AAGG;AACH,SAAC,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC;AACxB,aAAC,eAAe,CAAC,GAAG,CAAC,IAAI,CAAC;AACtB,gBAAA,oBAAoB,CAAC,SAAS,CAAC,CAAC,CAAC;AACzC,SAAC,IAAI,KAAK,WAAW,IAAI,CAAC,iBAAiB,CAAC;AAC5C;;;AAGG;AACH,QAAA,CAAC,QAAQ;AACT,QAAA,CAAC,WAAW;AACZ,QAAA,UAAU,KAAK,QAAQ;AACvB,QAAA,OAAO,KAAK,CAAC;QACb,IAAI,KAAK,SAAS;AAE1B;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/waapi/utils/accelerated-values.mjs b/node_modules/motion-dom/dist/es/animation/waapi/utils/accelerated-values.mjs deleted file mode 100644 index 37c36f1..0000000 --- a/node_modules/motion-dom/dist/es/animation/waapi/utils/accelerated-values.mjs +++ /dev/null @@ -1,13 +0,0 @@ -/** - * A list of values that can be hardware-accelerated. - */ -const acceleratedValues = new Set([ - "opacity", - "clipPath", - "filter", - "transform", - "backgroundColor", -]); - -export { acceleratedValues }; -//# sourceMappingURL=accelerated-values.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/waapi/utils/accelerated-values.mjs.map b/node_modules/motion-dom/dist/es/animation/waapi/utils/accelerated-values.mjs.map deleted file mode 100644 index 46b6d51..0000000 --- a/node_modules/motion-dom/dist/es/animation/waapi/utils/accelerated-values.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"accelerated-values.mjs","sources":["../../../../../src/animation/waapi/utils/accelerated-values.ts"],"sourcesContent":["/**\n * A list of values that can be hardware-accelerated.\n */\nexport const acceleratedValues = new Set([\n \"opacity\",\n \"clipPath\",\n \"filter\",\n \"transform\",\n \"backgroundColor\",\n])\n"],"names":[],"mappings":"AAAA;;AAEG;AACI,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAS;IAC7C,SAAS;IACT,UAAU;IACV,QAAQ;IACR,WAAW;IACX,iBAAiB;AACpB,CAAA;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/waapi/utils/apply-generator.mjs b/node_modules/motion-dom/dist/es/animation/waapi/utils/apply-generator.mjs deleted file mode 100644 index 6a828d7..0000000 --- a/node_modules/motion-dom/dist/es/animation/waapi/utils/apply-generator.mjs +++ /dev/null @@ -1,16 +0,0 @@ -import { supportsLinearEasing } from '../../../utils/supports/linear-easing.mjs'; -import { isGenerator } from '../../generators/utils/is-generator.mjs'; - -function applyGeneratorOptions({ type, ...options }) { - if (isGenerator(type) && supportsLinearEasing()) { - return type.applyToOptions(options); - } - else { - options.duration ?? (options.duration = 300); - options.ease ?? (options.ease = "easeOut"); - } - return options; -} - -export { applyGeneratorOptions }; -//# sourceMappingURL=apply-generator.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/waapi/utils/apply-generator.mjs.map b/node_modules/motion-dom/dist/es/animation/waapi/utils/apply-generator.mjs.map deleted file mode 100644 index 27221ed..0000000 --- a/node_modules/motion-dom/dist/es/animation/waapi/utils/apply-generator.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"apply-generator.mjs","sources":["../../../../../src/animation/waapi/utils/apply-generator.ts"],"sourcesContent":["import { ValueTransition } from \"../../../animation/types\"\nimport { supportsLinearEasing } from \"../../../utils/supports/linear-easing\"\nimport { isGenerator } from \"../../generators/utils/is-generator\"\n\nexport function applyGeneratorOptions({\n type,\n ...options\n}: ValueTransition): ValueTransition {\n if (isGenerator(type) && supportsLinearEasing()) {\n return type.applyToOptions!(options)\n } else {\n options.duration ??= 300\n options.ease ??= \"easeOut\"\n }\n\n return options\n}\n"],"names":[],"mappings":";;;AAIM,SAAU,qBAAqB,CAAC,EAClC,IAAI,EACJ,GAAG,OAAO,EACI,EAAA;IACd,IAAI,WAAW,CAAC,IAAI,CAAC,IAAI,oBAAoB,EAAE,EAAE;AAC7C,QAAA,OAAO,IAAI,CAAC,cAAe,CAAC,OAAO,CAAC;IACxC;SAAO;QACH,OAAO,CAAC,QAAQ,KAAhB,OAAO,CAAC,QAAQ,GAAK,GAAG,CAAA;QACxB,OAAO,CAAC,IAAI,KAAZ,OAAO,CAAC,IAAI,GAAK,SAAS,CAAA;IAC9B;AAEA,IAAA,OAAO,OAAO;AAClB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/waapi/utils/is-browser-color.mjs b/node_modules/motion-dom/dist/es/animation/waapi/utils/is-browser-color.mjs deleted file mode 100644 index fa9eca8..0000000 --- a/node_modules/motion-dom/dist/es/animation/waapi/utils/is-browser-color.mjs +++ /dev/null @@ -1,13 +0,0 @@ -const browserColorFunctions = /^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/; -function hasBrowserOnlyColors(keyframes) { - for (let i = 0; i < keyframes.length; i++) { - if (typeof keyframes[i] === "string" && - browserColorFunctions.test(keyframes[i])) { - return true; - } - } - return false; -} - -export { hasBrowserOnlyColors }; -//# sourceMappingURL=is-browser-color.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/waapi/utils/is-browser-color.mjs.map b/node_modules/motion-dom/dist/es/animation/waapi/utils/is-browser-color.mjs.map deleted file mode 100644 index d54d58e..0000000 --- a/node_modules/motion-dom/dist/es/animation/waapi/utils/is-browser-color.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"is-browser-color.mjs","sources":["../../../../../src/animation/waapi/utils/is-browser-color.ts"],"sourcesContent":["const browserColorFunctions =\n /^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\\(/\n\nexport function hasBrowserOnlyColors(keyframes: any[]): boolean {\n for (let i = 0; i < keyframes.length; i++) {\n if (\n typeof keyframes[i] === \"string\" &&\n browserColorFunctions.test(keyframes[i])\n ) {\n return true\n }\n }\n return false\n}\n"],"names":[],"mappings":"AAAA,MAAM,qBAAqB,GACvB,uDAAuD;AAErD,SAAU,oBAAoB,CAAC,SAAgB,EAAA;AACjD,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AACvC,QAAA,IACI,OAAO,SAAS,CAAC,CAAC,CAAC,KAAK,QAAQ;YAChC,qBAAqB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAC1C;AACE,YAAA,OAAO,IAAI;QACf;IACJ;AACA,IAAA,OAAO,KAAK;AAChB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/waapi/utils/linear.mjs b/node_modules/motion-dom/dist/es/animation/waapi/utils/linear.mjs deleted file mode 100644 index 7cb72e2..0000000 --- a/node_modules/motion-dom/dist/es/animation/waapi/utils/linear.mjs +++ /dev/null @@ -1,13 +0,0 @@ -const generateLinearEasing = (easing, duration, // as milliseconds -resolution = 10 // as milliseconds -) => { - let points = ""; - const numPoints = Math.max(Math.round(duration / resolution), 2); - for (let i = 0; i < numPoints; i++) { - points += Math.round(easing(i / (numPoints - 1)) * 10000) / 10000 + ", "; - } - return `linear(${points.substring(0, points.length - 2)})`; -}; - -export { generateLinearEasing }; -//# sourceMappingURL=linear.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/waapi/utils/linear.mjs.map b/node_modules/motion-dom/dist/es/animation/waapi/utils/linear.mjs.map deleted file mode 100644 index 5de407c..0000000 --- a/node_modules/motion-dom/dist/es/animation/waapi/utils/linear.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"linear.mjs","sources":["../../../../../src/animation/waapi/utils/linear.ts"],"sourcesContent":["import { EasingFunction } from \"motion-utils\"\n\nexport const generateLinearEasing = (\n easing: EasingFunction,\n duration: number, // as milliseconds\n resolution: number = 10 // as milliseconds\n): string => {\n let points = \"\"\n const numPoints = Math.max(Math.round(duration / resolution), 2)\n\n for (let i = 0; i < numPoints; i++) {\n points += Math.round(easing(i / (numPoints - 1)) * 10000) / 10000 + \", \"\n }\n\n return `linear(${points.substring(0, points.length - 2)})`\n}\n"],"names":[],"mappings":"MAEa,oBAAoB,GAAG,CAChC,MAAsB,EACtB,QAAgB;AAChB,UAAA,GAAqB,EAAE;KACf;IACR,IAAI,MAAM,GAAG,EAAE;AACf,IAAA,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,UAAU,CAAC,EAAE,CAAC,CAAC;AAEhE,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,EAAE,CAAC,EAAE,EAAE;QAChC,MAAM,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,SAAS,GAAG,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,GAAG,KAAK,GAAG,IAAI;IAC5E;AAEA,IAAA,OAAO,CAAA,OAAA,EAAU,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG;AAC9D;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/waapi/utils/px-values.mjs b/node_modules/motion-dom/dist/es/animation/waapi/utils/px-values.mjs deleted file mode 100644 index f4282b4..0000000 --- a/node_modules/motion-dom/dist/es/animation/waapi/utils/px-values.mjs +++ /dev/null @@ -1,59 +0,0 @@ -import { cornerRadiusProps } from '../../../utils/border-radius.mjs'; - -const pxValues = new Set([ - // Border props - "borderWidth", - "borderTopWidth", - "borderRightWidth", - "borderBottomWidth", - "borderLeftWidth", - "borderRadius", - ...cornerRadiusProps, - // Positioning props - "width", - "maxWidth", - "height", - "maxHeight", - "top", - "right", - "bottom", - "left", - "inset", - "insetBlock", - "insetBlockStart", - "insetBlockEnd", - "insetInline", - "insetInlineStart", - "insetInlineEnd", - // Spacing props - "padding", - "paddingTop", - "paddingRight", - "paddingBottom", - "paddingLeft", - "paddingBlock", - "paddingBlockStart", - "paddingBlockEnd", - "paddingInline", - "paddingInlineStart", - "paddingInlineEnd", - "margin", - "marginTop", - "marginRight", - "marginBottom", - "marginLeft", - "marginBlock", - "marginBlockStart", - "marginBlockEnd", - "marginInline", - "marginInlineStart", - "marginInlineEnd", - // Typography - "fontSize", - // Misc - "backgroundPositionX", - "backgroundPositionY", -]); - -export { pxValues }; -//# sourceMappingURL=px-values.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/waapi/utils/px-values.mjs.map b/node_modules/motion-dom/dist/es/animation/waapi/utils/px-values.mjs.map deleted file mode 100644 index 58cc8d4..0000000 --- a/node_modules/motion-dom/dist/es/animation/waapi/utils/px-values.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"px-values.mjs","sources":["../../../../../src/animation/waapi/utils/px-values.ts"],"sourcesContent":["import { cornerRadiusProps } from \"../../../utils/border-radius\"\n\nexport const pxValues = new Set([\n // Border props\n \"borderWidth\",\n \"borderTopWidth\",\n \"borderRightWidth\",\n \"borderBottomWidth\",\n \"borderLeftWidth\",\n \"borderRadius\",\n ...cornerRadiusProps,\n // Positioning props\n \"width\",\n \"maxWidth\",\n \"height\",\n \"maxHeight\",\n \"top\",\n \"right\",\n \"bottom\",\n \"left\",\n \"inset\",\n \"insetBlock\",\n \"insetBlockStart\",\n \"insetBlockEnd\",\n \"insetInline\",\n \"insetInlineStart\",\n \"insetInlineEnd\",\n // Spacing props\n \"padding\",\n \"paddingTop\",\n \"paddingRight\",\n \"paddingBottom\",\n \"paddingLeft\",\n \"paddingBlock\",\n \"paddingBlockStart\",\n \"paddingBlockEnd\",\n \"paddingInline\",\n \"paddingInlineStart\",\n \"paddingInlineEnd\",\n \"margin\",\n \"marginTop\",\n \"marginRight\",\n \"marginBottom\",\n \"marginLeft\",\n \"marginBlock\",\n \"marginBlockStart\",\n \"marginBlockEnd\",\n \"marginInline\",\n \"marginInlineStart\",\n \"marginInlineEnd\",\n // Typography\n \"fontSize\",\n // Misc\n \"backgroundPositionX\",\n \"backgroundPositionY\",\n])\n"],"names":[],"mappings":";;AAEO,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC;;IAE5B,aAAa;IACb,gBAAgB;IAChB,kBAAkB;IAClB,mBAAmB;IACnB,iBAAiB;IACjB,cAAc;AACd,IAAA,GAAG,iBAAiB;;IAEpB,OAAO;IACP,UAAU;IACV,QAAQ;IACR,WAAW;IACX,KAAK;IACL,OAAO;IACP,QAAQ;IACR,MAAM;IACN,OAAO;IACP,YAAY;IACZ,iBAAiB;IACjB,eAAe;IACf,aAAa;IACb,kBAAkB;IAClB,gBAAgB;;IAEhB,SAAS;IACT,YAAY;IACZ,cAAc;IACd,eAAe;IACf,aAAa;IACb,cAAc;IACd,mBAAmB;IACnB,iBAAiB;IACjB,eAAe;IACf,oBAAoB;IACpB,kBAAkB;IAClB,QAAQ;IACR,WAAW;IACX,aAAa;IACb,cAAc;IACd,YAAY;IACZ,aAAa;IACb,kBAAkB;IAClB,gBAAgB;IAChB,cAAc;IACd,mBAAmB;IACnB,iBAAiB;;IAEjB,UAAU;;IAEV,qBAAqB;IACrB,qBAAqB;AACxB,CAAA;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/waapi/utils/unsupported-easing.mjs b/node_modules/motion-dom/dist/es/animation/waapi/utils/unsupported-easing.mjs deleted file mode 100644 index b641587..0000000 --- a/node_modules/motion-dom/dist/es/animation/waapi/utils/unsupported-easing.mjs +++ /dev/null @@ -1,19 +0,0 @@ -import { circInOut, backInOut, anticipate } from 'motion-utils'; - -const unsupportedEasingFunctions = { - anticipate, - backInOut, - circInOut, -}; -function isUnsupportedEase(key) { - return key in unsupportedEasingFunctions; -} -function replaceStringEasing(transition) { - if (typeof transition.ease === "string" && - isUnsupportedEase(transition.ease)) { - transition.ease = unsupportedEasingFunctions[transition.ease]; - } -} - -export { replaceStringEasing }; -//# sourceMappingURL=unsupported-easing.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/waapi/utils/unsupported-easing.mjs.map b/node_modules/motion-dom/dist/es/animation/waapi/utils/unsupported-easing.mjs.map deleted file mode 100644 index de1539f..0000000 --- a/node_modules/motion-dom/dist/es/animation/waapi/utils/unsupported-easing.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"unsupported-easing.mjs","sources":["../../../../../src/animation/waapi/utils/unsupported-easing.ts"],"sourcesContent":["import { anticipate, backInOut, circInOut } from \"motion-utils\"\nimport { ValueAnimationTransition } from \"../../types\"\n\nconst unsupportedEasingFunctions = {\n anticipate,\n backInOut,\n circInOut,\n}\n\nfunction isUnsupportedEase(\n key: string\n): key is keyof typeof unsupportedEasingFunctions {\n return key in unsupportedEasingFunctions\n}\n\nexport function replaceStringEasing(transition: ValueAnimationTransition) {\n if (\n typeof transition.ease === \"string\" &&\n isUnsupportedEase(transition.ease)\n ) {\n transition.ease = unsupportedEasingFunctions[transition.ease]\n }\n}\n"],"names":[],"mappings":";;AAGA,MAAM,0BAA0B,GAAG;IAC/B,UAAU;IACV,SAAS;IACT,SAAS;CACZ;AAED,SAAS,iBAAiB,CACtB,GAAW,EAAA;IAEX,OAAO,GAAG,IAAI,0BAA0B;AAC5C;AAEM,SAAU,mBAAmB,CAAC,UAAoC,EAAA;AACpE,IAAA,IACI,OAAO,UAAU,CAAC,IAAI,KAAK,QAAQ;AACnC,QAAA,iBAAiB,CAAC,UAAU,CAAC,IAAI,CAAC,EACpC;QACE,UAAU,CAAC,IAAI,GAAG,0BAA0B,CAAC,UAAU,CAAC,IAAI,CAAC;IACjE;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/effects/MotionValueState.mjs b/node_modules/motion-dom/dist/es/effects/MotionValueState.mjs deleted file mode 100644 index 908922d..0000000 --- a/node_modules/motion-dom/dist/es/effects/MotionValueState.mjs +++ /dev/null @@ -1,43 +0,0 @@ -import { frame, cancelFrame } from '../frameloop/frame.mjs'; -import { numberValueTypes } from '../value/types/maps/number.mjs'; -import { getValueAsType } from '../value/types/utils/get-as-type.mjs'; - -class MotionValueState { - constructor() { - this.latest = {}; - this.values = new Map(); - } - set(name, value, render, computed, useDefaultValueType = true) { - const existingValue = this.values.get(name); - if (existingValue) { - existingValue.onRemove(); - } - const onChange = () => { - const v = value.get(); - if (useDefaultValueType) { - this.latest[name] = getValueAsType(v, numberValueTypes[name]); - } - else { - this.latest[name] = v; - } - render && frame.render(render); - }; - onChange(); - const cancelOnChange = value.on("change", onChange); - computed && value.addDependent(computed); - const remove = () => { - cancelOnChange(); - render && cancelFrame(render); - this.values.delete(name); - computed && value.removeDependent(computed); - }; - this.values.set(name, { value, onRemove: remove }); - return remove; - } - get(name) { - return this.values.get(name)?.value; - } -} - -export { MotionValueState }; -//# sourceMappingURL=MotionValueState.mjs.map diff --git a/node_modules/motion-dom/dist/es/effects/MotionValueState.mjs.map b/node_modules/motion-dom/dist/es/effects/MotionValueState.mjs.map deleted file mode 100644 index c59b390..0000000 --- a/node_modules/motion-dom/dist/es/effects/MotionValueState.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"MotionValueState.mjs","sources":["../../../src/effects/MotionValueState.ts"],"sourcesContent":["import { AnyResolvedKeyframe } from \"../animation/types\"\nimport { cancelFrame, frame } from \"../frameloop/frame\"\nimport { MotionValue } from \"../value\"\nimport { numberValueTypes } from \"../value/types/maps/number\"\nimport { getValueAsType } from \"../value/types/utils/get-as-type\"\n\nexport class MotionValueState {\n latest: { [name: string]: AnyResolvedKeyframe } = {}\n\n private values = new Map<\n string,\n { value: MotionValue; onRemove: VoidFunction }\n >()\n\n set(\n name: string,\n value: MotionValue,\n render?: VoidFunction,\n computed?: MotionValue,\n useDefaultValueType = true\n ) {\n const existingValue = this.values.get(name)\n\n if (existingValue) {\n existingValue.onRemove()\n }\n\n const onChange = () => {\n const v = value.get()\n\n if (useDefaultValueType) {\n this.latest[name] = getValueAsType(v, numberValueTypes[name])\n } else {\n this.latest[name] = v\n }\n\n render && frame.render(render)\n }\n\n onChange()\n\n const cancelOnChange = value.on(\"change\", onChange)\n\n computed && value.addDependent(computed)\n\n const remove = () => {\n cancelOnChange()\n render && cancelFrame(render)\n this.values.delete(name)\n computed && value.removeDependent(computed)\n }\n\n this.values.set(name, { value, onRemove: remove })\n\n return remove\n }\n\n get(name: string): MotionValue | undefined {\n return this.values.get(name)?.value\n }\n}\n"],"names":[],"mappings":";;;;MAMa,gBAAgB,CAAA;AAA7B,IAAA,WAAA,GAAA;QACI,IAAA,CAAA,MAAM,GAA4C,EAAE;AAE5C,QAAA,IAAA,CAAA,MAAM,GAAG,IAAI,GAAG,EAGrB;IAgDP;IA9CI,GAAG,CACC,IAAY,EACZ,KAAkB,EAClB,MAAqB,EACrB,QAAsB,EACtB,mBAAmB,GAAG,IAAI,EAAA;QAE1B,MAAM,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC;QAE3C,IAAI,aAAa,EAAE;YACf,aAAa,CAAC,QAAQ,EAAE;QAC5B;QAEA,MAAM,QAAQ,GAAG,MAAK;AAClB,YAAA,MAAM,CAAC,GAAG,KAAK,CAAC,GAAG,EAAE;YAErB,IAAI,mBAAmB,EAAE;AACrB,gBAAA,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,cAAc,CAAC,CAAC,EAAE,gBAAgB,CAAC,IAAI,CAAC,CAAC;YACjE;iBAAO;AACH,gBAAA,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;YACzB;AAEA,YAAA,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC;AAClC,QAAA,CAAC;AAED,QAAA,QAAQ,EAAE;QAEV,MAAM,cAAc,GAAG,KAAK,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC;AAEnD,QAAA,QAAQ,IAAI,KAAK,CAAC,YAAY,CAAC,QAAQ,CAAC;QAExC,MAAM,MAAM,GAAG,MAAK;AAChB,YAAA,cAAc,EAAE;AAChB,YAAA,MAAM,IAAI,WAAW,CAAC,MAAM,CAAC;AAC7B,YAAA,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;AACxB,YAAA,QAAQ,IAAI,KAAK,CAAC,eAAe,CAAC,QAAQ,CAAC;AAC/C,QAAA,CAAC;AAED,QAAA,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;AAElD,QAAA,OAAO,MAAM;IACjB;AAEA,IAAA,GAAG,CAAC,IAAY,EAAA;QACZ,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,KAAK;IACvC;AACH;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/effects/attr/index.mjs b/node_modules/motion-dom/dist/es/effects/attr/index.mjs deleted file mode 100644 index 08067fd..0000000 --- a/node_modules/motion-dom/dist/es/effects/attr/index.mjs +++ /dev/null @@ -1,42 +0,0 @@ -import { camelToDash } from '../../render/dom/utils/camel-to-dash.mjs'; -import { createSelectorEffect } from '../utils/create-dom-effect.mjs'; -import { createEffect } from '../utils/create-effect.mjs'; - -function canSetAsProperty(element, name) { - if (!(name in element)) - return false; - const descriptor = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(element), name) || - Object.getOwnPropertyDescriptor(element, name); - // Check if it has a setter - return descriptor && typeof descriptor.set === "function"; -} -const addAttrValue = (element, state, key, value) => { - const isProp = canSetAsProperty(element, key); - const name = isProp - ? key - : key.startsWith("data") || key.startsWith("aria") - ? camelToDash(key) - : key; - /** - * Set attribute directly via property if available - */ - const render = isProp - ? () => { - element[name] = state.latest[key]; - } - : () => { - const v = state.latest[key]; - if (v === null || v === undefined) { - element.removeAttribute(name); - } - else { - element.setAttribute(name, String(v)); - } - }; - return state.set(key, value, render); -}; -const attrEffect = /*@__PURE__*/ createSelectorEffect( -/*@__PURE__*/ createEffect(addAttrValue)); - -export { addAttrValue, attrEffect }; -//# sourceMappingURL=index.mjs.map diff --git a/node_modules/motion-dom/dist/es/effects/attr/index.mjs.map b/node_modules/motion-dom/dist/es/effects/attr/index.mjs.map deleted file mode 100644 index da48db2..0000000 --- a/node_modules/motion-dom/dist/es/effects/attr/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs","sources":["../../../../src/effects/attr/index.ts"],"sourcesContent":["import { camelToDash } from \"../../render/dom/utils/camel-to-dash\"\nimport { MotionValue } from \"../../value\"\nimport { MotionValueState } from \"../MotionValueState\"\nimport { createSelectorEffect } from \"../utils/create-dom-effect\"\nimport { createEffect } from \"../utils/create-effect\"\n\nfunction canSetAsProperty(element: HTMLElement | SVGElement, name: string) {\n if (!(name in element)) return false\n\n const descriptor =\n Object.getOwnPropertyDescriptor(Object.getPrototypeOf(element), name) ||\n Object.getOwnPropertyDescriptor(element, name)\n\n // Check if it has a setter\n return descriptor && typeof descriptor.set === \"function\"\n}\n\nexport const addAttrValue = (\n element: HTMLElement | SVGElement,\n state: MotionValueState,\n key: string,\n value: MotionValue\n) => {\n const isProp = canSetAsProperty(element, key)\n const name = isProp\n ? key\n : key.startsWith(\"data\") || key.startsWith(\"aria\")\n ? camelToDash(key)\n : key\n\n /**\n * Set attribute directly via property if available\n */\n const render = isProp\n ? () => {\n ;(element as any)[name] = state.latest[key]\n }\n : () => {\n const v = state.latest[key]\n if (v === null || v === undefined) {\n element.removeAttribute(name)\n } else {\n element.setAttribute(name, String(v))\n }\n }\n\n return state.set(key, value, render)\n}\n\nexport const attrEffect = /*@__PURE__*/ createSelectorEffect(\n /*@__PURE__*/ createEffect(addAttrValue)\n)\n"],"names":[],"mappings":";;;;AAMA,SAAS,gBAAgB,CAAC,OAAiC,EAAE,IAAY,EAAA;AACrE,IAAA,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modules/motion-dom/dist/es/effects/prop/index.mjs deleted file mode 100644 index 2b5e988..0000000 --- a/node_modules/motion-dom/dist/es/effects/prop/index.mjs +++ /dev/null @@ -1,10 +0,0 @@ -import { createEffect } from '../utils/create-effect.mjs'; - -const propEffect = /*@__PURE__*/ createEffect((subject, state, key, value) => { - return state.set(key, value, () => { - subject[key] = state.latest[key]; - }, undefined, false); -}); - -export { propEffect }; -//# sourceMappingURL=index.mjs.map diff --git a/node_modules/motion-dom/dist/es/effects/prop/index.mjs.map b/node_modules/motion-dom/dist/es/effects/prop/index.mjs.map deleted file mode 100644 index b1705c0..0000000 --- a/node_modules/motion-dom/dist/es/effects/prop/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs","sources":["../../../../src/effects/prop/index.ts"],"sourcesContent":["import { MotionValue } from \"../../value\"\nimport { MotionValueState } from \"../MotionValueState\"\nimport { createEffect } from \"../utils/create-effect\"\n\nexport const propEffect = /*@__PURE__*/ createEffect(\n (\n subject: { [key: string]: any },\n state: MotionValueState,\n key: string,\n value: MotionValue\n ) => {\n return state.set(\n key,\n value,\n () => {\n subject[key] = state.latest[key]\n },\n undefined,\n false\n )\n }\n)\n"],"names":[],"mappings":";;AAIO,MAAM,UAAU,iBAAiB,YAAY,CAChD,CACI,OAA+B,EAC/B,KAAuB,EACvB,GAAW,EACX,KAAkB,KAClB;IACA,OAAO,KAAK,CAAC,GAAG,CACZ,GAAG,EACH,KAAK,EACL,MAAK;QACD,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC;AACpC,IAAA,CAAC,EACD,SAAS,EACT,KAAK,CACR;AACL,CAAC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/effects/style/index.mjs b/node_modules/motion-dom/dist/es/effects/style/index.mjs deleted file mode 100644 index a7e290c..0000000 --- a/node_modules/motion-dom/dist/es/effects/style/index.mjs +++ /dev/null @@ -1,53 +0,0 @@ -import { isCSSVar } from '../../render/dom/is-css-var.mjs'; -import { transformProps } from '../../render/utils/keys-transform.mjs'; -import { isHTMLElement } from '../../utils/is-html-element.mjs'; -import { MotionValue } from '../../value/index.mjs'; -import { createSelectorEffect } from '../utils/create-dom-effect.mjs'; -import { createEffect } from '../utils/create-effect.mjs'; -import { buildTransform } from './transform.mjs'; - -const originProps = new Set(["originX", "originY", "originZ"]); -const addStyleValue = (element, state, key, value) => { - let render = undefined; - let computed = undefined; - if (transformProps.has(key)) { - if (!state.get("transform")) { - // If this is an HTML element, we need to set the transform-box to fill-box - // to normalise the transform relative to the element's bounding box - if (!isHTMLElement(element) && !state.get("transformBox")) { - addStyleValue(element, state, "transformBox", new MotionValue("fill-box")); - } - state.set("transform", new MotionValue("none"), () => { - element.style.transform = buildTransform(state); - }); - } - computed = state.get("transform"); - } - else if (originProps.has(key)) { - if (!state.get("transformOrigin")) { - state.set("transformOrigin", new MotionValue(""), () => { - const originX = state.latest.originX ?? "50%"; - const originY = state.latest.originY ?? "50%"; - const originZ = state.latest.originZ ?? 0; - element.style.transformOrigin = `${originX} ${originY} ${originZ}`; - }); - } - computed = state.get("transformOrigin"); - } - else if (isCSSVar(key)) { - render = () => { - element.style.setProperty(key, state.latest[key]); - }; - } - else { - render = () => { - element.style[key] = state.latest[key]; - }; - } - return state.set(key, value, render, computed); -}; -const styleEffect = /*@__PURE__*/ createSelectorEffect( -/*@__PURE__*/ createEffect(addStyleValue)); - -export { addStyleValue, styleEffect }; -//# sourceMappingURL=index.mjs.map diff --git a/node_modules/motion-dom/dist/es/effects/style/index.mjs.map b/node_modules/motion-dom/dist/es/effects/style/index.mjs.map deleted file mode 100644 index 7e53ba0..0000000 --- a/node_modules/motion-dom/dist/es/effects/style/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs","sources":["../../../../src/effects/style/index.ts"],"sourcesContent":["import { isCSSVar } from \"../../render/dom/is-css-var\"\nimport { transformProps } from \"../../render/utils/keys-transform\"\nimport { isHTMLElement } from \"../../utils/is-html-element\"\nimport { MotionValue } from \"../../value\"\nimport { MotionValueState } from \"../MotionValueState\"\nimport { createSelectorEffect } from \"../utils/create-dom-effect\"\nimport { createEffect } from \"../utils/create-effect\"\nimport { buildTransform } from \"./transform\"\n\nconst originProps = new Set([\"originX\", \"originY\", \"originZ\"])\n\nexport const addStyleValue = (\n element: HTMLElement | SVGElement,\n state: MotionValueState,\n key: string,\n value: MotionValue\n) => {\n let render: VoidFunction | undefined = undefined\n let computed: MotionValue | undefined = undefined\n\n if (transformProps.has(key)) {\n if (!state.get(\"transform\")) {\n // If this is an HTML element, we need to set the transform-box to fill-box\n // to normalise the transform relative to the element's bounding box\n if (!isHTMLElement(element) && !state.get(\"transformBox\")) {\n addStyleValue(\n element,\n state,\n \"transformBox\",\n new MotionValue(\"fill-box\")\n )\n }\n\n state.set(\"transform\", new MotionValue(\"none\"), () => {\n element.style.transform = buildTransform(state)\n })\n }\n\n computed = state.get(\"transform\")\n } else if (originProps.has(key)) {\n if (!state.get(\"transformOrigin\")) {\n state.set(\"transformOrigin\", new MotionValue(\"\"), () => {\n const originX = state.latest.originX ?? \"50%\"\n const originY = state.latest.originY ?? \"50%\"\n const originZ = state.latest.originZ ?? 0\n element.style.transformOrigin = `${originX} ${originY} ${originZ}`\n })\n }\n\n computed = state.get(\"transformOrigin\")\n } else if (isCSSVar(key)) {\n render = () => {\n element.style.setProperty(key, state.latest[key] as string)\n }\n } else {\n render = () => {\n element.style[key as any] = state.latest[key] as string\n }\n }\n\n return state.set(key, value, render, computed)\n}\n\nexport const styleEffect = /*@__PURE__*/ createSelectorEffect(\n /*@__PURE__*/ createEffect(addStyleValue)\n)\n"],"names":[],"mappings":";;;;;;;;AASA,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;AAEvD,MAAM,aAAa,GAAG,CACzB,OAAiC,EACjC,KAAuB,EACvB,GAAW,EACX,KAAkB,KA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AAA,QAAQ,GAAG,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC;IAC3C;AAAO,SAAA,IAAI,QAAQ,CAAC,GAAG,CAAC,EAAE;QACtB,MAAM,GAAG,MAAK;AACV,YAAA,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,CAAW,CAAC;AAC/D,QAAA,CAAC;IACL;SAAO;QACH,MAAM,GAAG,MAAK;AACV,YAAA,OAAO,CAAC,KAAK,CAAC,GAAU,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAW;AAC3D,QAAA,CAAC;IACL;AAEA,IAAA,OAAO,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC;AAClD;AAEO,MAAM,WAAW,iBAAiB,oBAAoB;AACzD,cAAc,YAAY,CAAC,aAAa,CAAC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/effects/style/transform.mjs b/node_modules/motion-dom/dist/es/effects/style/transform.mjs deleted file mode 100644 index ccb5c63..0000000 --- a/node_modules/motion-dom/dist/es/effects/style/transform.mjs +++ /dev/null @@ -1,48 +0,0 @@ -import { transformPropOrder } from '../../render/utils/keys-transform.mjs'; - -const translateAlias = { - x: "translateX", - y: "translateY", - z: "translateZ", - transformPerspective: "perspective", -}; -function buildTransform(state) { - let transform = ""; - let transformIsDefault = true; - /** - * Loop over all possible transforms in order, adding the ones that - * are present to the transform string. - */ - for (let i = 0; i < transformPropOrder.length; i++) { - const key = transformPropOrder[i]; - const value = state.latest[key]; - if (value === undefined) - continue; - let valueIsDefault = true; - if (typeof value === "number") { - valueIsDefault = value === (key.startsWith("scale") ? 1 : 0); - } - else { - const parsed = parseFloat(value); - valueIsDefault = key.startsWith("scale") ? parsed === 1 : parsed === 0; - } - if (!valueIsDefault) { - transformIsDefault = false; - const transformName = translateAlias[key] || key; - transform += `${transformName}(${value}) `; - } - } - // See build-transform.ts: additive `rotate()` so user `rotate` isn't - // clobbered. Not a `transformPropOrder` slot. - const pathRotation = state.latest.pathRotation; - if (pathRotation) { - transformIsDefault = false; - transform += `rotate(${typeof pathRotation === "number" - ? `${pathRotation}deg` - : pathRotation}) `; - } - return transformIsDefault ? "none" : transform.trim(); -} - -export { buildTransform }; -//# sourceMappingURL=transform.mjs.map diff --git a/node_modules/motion-dom/dist/es/effects/style/transform.mjs.map b/node_modules/motion-dom/dist/es/effects/style/transform.mjs.map deleted file mode 100644 index 8553fb4..0000000 --- a/node_modules/motion-dom/dist/es/effects/style/transform.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"transform.mjs","sources":["../../../../src/effects/style/transform.ts"],"sourcesContent":["import { transformPropOrder } from \"../../render/utils/keys-transform\"\nimport { MotionValueState } from \"../MotionValueState\"\n\nconst translateAlias = {\n x: \"translateX\",\n y: \"translateY\",\n z: \"translateZ\",\n transformPerspective: \"perspective\",\n}\n\nexport function buildTransform(state: MotionValueState) {\n let transform = \"\"\n let transformIsDefault = true\n\n /**\n * Loop over all possible transforms in order, adding the ones that\n * are present to the transform string.\n */\n for (let i = 0; i < transformPropOrder.length; i++) {\n const key = transformPropOrder[i] as keyof typeof translateAlias\n const value = state.latest[key]\n\n if (value === undefined) continue\n\n let valueIsDefault = true\n if (typeof value === \"number\") {\n valueIsDefault = value === (key.startsWith(\"scale\") ? 1 : 0)\n } else {\n const parsed = parseFloat(value)\n valueIsDefault = key.startsWith(\"scale\") ? parsed === 1 : parsed === 0\n }\n\n if (!valueIsDefault) {\n transformIsDefault = false\n const transformName = translateAlias[key] || key\n transform += `${transformName}(${value}) `\n }\n }\n\n // See build-transform.ts: additive `rotate()` so user `rotate` isn't\n // clobbered. Not a `transformPropOrder` slot.\n const pathRotation = state.latest.pathRotation\n if (pathRotation) {\n transformIsDefault = false\n transform += `rotate(${\n typeof pathRotation === \"number\"\n ? `${pathRotation}deg`\n : pathRotation\n }) `\n }\n\n return transformIsDefault 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AAG,KAAK;AAC1B,QAAA,SAAS,IAAI,CAAA,OAAA,EACT,OAAO,YAAY,KAAK;cAClB,CAAA,EAAG,YAAY,CAAA,GAAA;cACf,YACV,CAAA,EAAA,CAAI;IACR;AAEA,IAAA,OAAO,kBAAkB,GAAG,MAAM,GAAG,SAAS,CAAC,IAAI,EAAE;AACzD;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/effects/svg/index.mjs b/node_modules/motion-dom/dist/es/effects/svg/index.mjs deleted file mode 100644 index 83bc656..0000000 --- a/node_modules/motion-dom/dist/es/effects/svg/index.mjs +++ /dev/null @@ -1,45 +0,0 @@ -import { MotionValue } from '../../value/index.mjs'; -import { addAttrValue } from '../attr/index.mjs'; -import { addStyleValue } from '../style/index.mjs'; -import { createSelectorEffect } from '../utils/create-dom-effect.mjs'; -import { createEffect } from '../utils/create-effect.mjs'; -import { frame } from '../../frameloop/frame.mjs'; - -function addSVGPathValue(element, state, key, value) { - frame.render(() => element.setAttribute("pathLength", "1")); - if (key === "pathOffset") { - return state.set(key, value, () => { - // Use unitless value to avoid Safari zoom bug - const offset = state.latest[key]; - element.setAttribute("stroke-dashoffset", `${-offset}`); - }); - } - else { - if (!state.get("stroke-dasharray")) { - state.set("stroke-dasharray", new MotionValue("1 1"), () => { - const { pathLength = 1, pathSpacing } = state.latest; - // Use unitless values to avoid Safari zoom bug - element.setAttribute("stroke-dasharray", `${pathLength} ${pathSpacing ?? 1 - Number(pathLength)}`); - }); - } - return state.set(key, value, undefined, state.get("stroke-dasharray")); - } -} -const addSVGValue = (element, state, key, value) => { - if (key.startsWith("path")) { - return addSVGPathValue(element, state, key, value); - } - else if (key.startsWith("attr")) { - return addAttrValue(element, state, convertAttrKey(key), value); - } - const handler = key in element.style ? addStyleValue : addAttrValue; - return handler(element, state, key, value); -}; -const svgEffect = /*@__PURE__*/ createSelectorEffect( -/*@__PURE__*/ createEffect(addSVGValue)); -function convertAttrKey(key) { - return key.replace(/^attr([A-Z])/, (_, firstChar) => firstChar.toLowerCase()); -} - -export { svgEffect }; -//# sourceMappingURL=index.mjs.map diff --git a/node_modules/motion-dom/dist/es/effects/svg/index.mjs.map b/node_modules/motion-dom/dist/es/effects/svg/index.mjs.map deleted file mode 100644 index 8548e1f..0000000 --- a/node_modules/motion-dom/dist/es/effects/svg/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs","sources":["../../../../src/effects/svg/index.ts"],"sourcesContent":["import { frame } from \"../../frameloop\"\nimport { MotionValue } from \"../../value\"\nimport { addAttrValue } from \"../attr\"\nimport { MotionValueState } from \"../MotionValueState\"\nimport { addStyleValue } from \"../style\"\nimport { createSelectorEffect } from \"../utils/create-dom-effect\"\nimport { createEffect } from \"../utils/create-effect\"\n\nfunction addSVGPathValue(\n element: SVGElement,\n state: MotionValueState,\n key: string,\n value: MotionValue\n) {\n frame.render(() => element.setAttribute(\"pathLength\", \"1\"))\n\n if (key === \"pathOffset\") {\n return state.set(key, value, () => {\n // Use unitless value to avoid Safari zoom bug\n const offset = state.latest[key]\n element.setAttribute(\"stroke-dashoffset\", `${-offset}`)\n })\n } else {\n if (!state.get(\"stroke-dasharray\")) {\n state.set(\"stroke-dasharray\", new MotionValue(\"1 1\"), () => {\n const { pathLength = 1, pathSpacing } = state.latest\n\n // Use unitless values to avoid Safari zoom bug\n element.setAttribute(\n \"stroke-dasharray\",\n `${pathLength} ${pathSpacing ?? 1 - Number(pathLength)}`\n )\n })\n }\n\n return state.set(key, value, undefined, state.get(\"stroke-dasharray\"))\n }\n}\n\nconst addSVGValue = (\n element: SVGElement,\n state: MotionValueState,\n key: string,\n value: MotionValue\n) => {\n if (key.startsWith(\"path\")) {\n return addSVGPathValue(element, state, key, value)\n } else if (key.startsWith(\"attr\")) {\n return addAttrValue(element, state, convertAttrKey(key), value)\n }\n\n const handler = key in element.style ? addStyleValue : addAttrValue\n return handler(element, state, key, value)\n}\n\nexport const svgEffect = /*@__PURE__*/ createSelectorEffect(\n /*@__PURE__*/ createEffect(addSVGValue)\n)\n\nfunction convertAttrKey(key: string) {\n return key.replace(/^attr([A-Z])/, (_, firstChar) =>\n firstChar.toLowerCase()\n )\n}\n"],"names":[],"mappings":";;;;;;;AAQA,SAAS,eAAe,CACpB,OAAmB,EACnB,KAAuB,EACvB,GAAW,EACX,KAAkB,EAAA;AAElB,IAAA,KAAK,CAAC,MAAM,CAAC,MAAM,OAAO,CAAC,YAAY,CAAC,YAAY,EAAE,GAAG,CAAC,CAAC;AAE3D,IAAA,IAAI,GAAG,KAAK,YAAY,EAAE;QACtB,OAAO,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,EAAE,MAAK;;YAE9B,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC;YAChC,OAAO,CAAC,YAAY,CAAC,mBAAmB,EAAE,GAAG,CAAC,MAAM,CAAA,CAAE,CAAC;AAC3D,QAAA,CAAC,CAAC;IACN;SAAO;QACH,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,kBAAkB,CAAC,EAAE;AAChC,YAAA,KAAK,CAAC,GAAG,CAAC,kBAAkB,EAAE,IAAI,WAAW,CAAC,KAAK,CAAC,EAAE,MAAK;gBACvD,MAAM,EAAE,UAAU,GAAG,CAAC,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC,MAAM;;AAGpD,gBAAA,OAAO,CAAC,YAAY,CAChB,kBAAkB,EAClB,CAAA,EAAG,UAAU,CAAA,CAAA,EAAI,WAAW,IAAI,CAAC,GAAG,MAAM,CAAC,UAAU,CAAC,CAAA,CAAE,CAC3D;AACL,YAAA,CAAC,CAAC;QACN;AAEA,QAAA,OAAO,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;IAC1E;AACJ;AAEA,MAAM,WAAW,GAAG,CAChB,OAAmB,EACnB,KAAuB,EACvB,GAAW,EACX,KAAkB,KAClB;AACA,IAAA,IAAI,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE;QACxB,OAAO,eAAe,CAAC,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,CAAC;IACtD;AAAO,SAAA,IAAI,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE;AAC/B,QAAA,OAAO,YAAY,CAAC,OAAO,EAAE,KAAK,EAAE,cAAc,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC;IACnE;AAEA,IAAA,MAAM,OAAO,GAAG,GAAG,IAAI,OAAO,CAAC,KAAK,GAAG,aAAa,GAAG,YAAY;IACnE,OAAO,OAAO,CAAC,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,CAAC;AAC9C,CAAC;AAEM,MAAM,SAAS,iBAAiB,oBAAoB;AACvD,cAAc,YAAY,CAAC,WAAW,CAAC;AAG3C,SAAS,cAAc,CAAC,GAAW,EAAA;AAC/B,IAAA,OAAO,GAAG,CAAC,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC,EAAE,SAAS,KAC5C,SAAS,CAAC,WAAW,EAAE,CAC1B;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/effects/utils/create-dom-effect.mjs b/node_modules/motion-dom/dist/es/effects/utils/create-dom-effect.mjs deleted file mode 100644 index ede6a43..0000000 --- a/node_modules/motion-dom/dist/es/effects/utils/create-dom-effect.mjs +++ /dev/null @@ -1,19 +0,0 @@ -import { resolveElements } from '../../utils/resolve-elements.mjs'; - -function createSelectorEffect(subjectEffect) { - return (subject, values) => { - const elements = resolveElements(subject); - const subscriptions = []; - for (const element of elements) { - const remove = subjectEffect(element, values); - subscriptions.push(remove); - } - return () => { - for (const remove of subscriptions) - remove(); - }; - }; -} - -export { createSelectorEffect }; -//# sourceMappingURL=create-dom-effect.mjs.map diff --git a/node_modules/motion-dom/dist/es/effects/utils/create-dom-effect.mjs.map b/node_modules/motion-dom/dist/es/effects/utils/create-dom-effect.mjs.map deleted file mode 100644 index f750c00..0000000 --- a/node_modules/motion-dom/dist/es/effects/utils/create-dom-effect.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"create-dom-effect.mjs","sources":["../../../../src/effects/utils/create-dom-effect.ts"],"sourcesContent":["import {\n ElementOrSelector,\n resolveElements,\n} from \"../../utils/resolve-elements\"\nimport { MotionValue } from \"../../value\"\n\nexport function createSelectorEffect(\n subjectEffect: (\n subject: T,\n values: Record\n ) => VoidFunction\n) {\n return (\n subject: ElementOrSelector,\n values: Record\n ) => {\n const elements = resolveElements(subject)\n const subscriptions: VoidFunction[] = []\n\n for (const element of elements) {\n const remove = subjectEffect(element as T, values)\n subscriptions.push(remove)\n }\n\n return () => {\n for (const remove of subscriptions) remove()\n }\n }\n}\n"],"names":[],"mappings":";;AAMM,SAAU,oBAAoB,CAChC,aAGiB,EAAA;AAEjB,IAAA,OAAO,CACH,OAA0B,EAC1B,MAAmC,KACnC;AACA,QAAA,MAAM,QAAQ,GAAG,eAAe,CAAC,OAAO,CAAC;QACzC,MAAM,aAAa,GAAmB,EAAE;AAExC,QAAA,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE;YAC5B,MAAM,MAAM,GAAG,aAAa,CAAC,OAAY,EAAE,MAAM,CAAC;AAClD,YAAA,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC;QAC9B;AAEA,QAAA,OAAO,MAAK;YACR,KAAK,MAAM,MAAM,IAAI,aAAa;AAAE,gBAAA,MAAM,EAAE;AAChD,QAAA,CAAC;AACL,IAAA,CAAC;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/effects/utils/create-effect.mjs b/node_modules/motion-dom/dist/es/effects/utils/create-effect.mjs deleted file mode 100644 index 7bd4599..0000000 --- a/node_modules/motion-dom/dist/es/effects/utils/create-effect.mjs +++ /dev/null @@ -1,22 +0,0 @@ -import { MotionValueState } from '../MotionValueState.mjs'; - -function createEffect(addValue) { - const stateCache = new WeakMap(); - return (subject, values) => { - const state = stateCache.get(subject) ?? new MotionValueState(); - stateCache.set(subject, state); - const subscriptions = []; - for (const key in values) { - const value = values[key]; - const remove = addValue(subject, state, key, value); - subscriptions.push(remove); - } - return () => { - for (const cancel of subscriptions) - cancel(); - }; - }; -} - -export { createEffect }; -//# sourceMappingURL=create-effect.mjs.map diff --git a/node_modules/motion-dom/dist/es/effects/utils/create-effect.mjs.map b/node_modules/motion-dom/dist/es/effects/utils/create-effect.mjs.map deleted file mode 100644 index 10631da..0000000 --- a/node_modules/motion-dom/dist/es/effects/utils/create-effect.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"create-effect.mjs","sources":["../../../../src/effects/utils/create-effect.ts"],"sourcesContent":["import { MotionValue } from \"../../value\"\nimport { MotionValueState } from \"../MotionValueState\"\n\nexport function createEffect(\n addValue: (\n subject: Subject,\n state: MotionValueState,\n key: string,\n value: MotionValue\n ) => VoidFunction\n) {\n const stateCache = new WeakMap()\n\n return (\n subject: Subject,\n values: Record\n ): VoidFunction => {\n const state = stateCache.get(subject) ?? new MotionValueState()\n\n stateCache.set(subject, state)\n\n const subscriptions: VoidFunction[] = []\n\n for (const key in values) {\n const value = values[key]\n const remove = addValue(subject, state, key, value)\n subscriptions.push(remove)\n }\n\n return () => {\n for (const cancel of subscriptions) cancel()\n }\n }\n}\n"],"names":[],"mappings":";;AAGM,SAAU,YAAY,CACxB,QAKiB,EAAA;AAEjB,IAAA,MAAM,UAAU,GAAG,IAAI,OAAO,EAA6B;AAE3D,IAAA,OAAO,CACH,OAAgB,EAChB,MAAmC,KACrB;AACd,QAAA,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,IAAI,gBAAgB,EAAE;AAE/D,QAAA,UAAU,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC;QAE9B,MAAM,aAAa,GAAmB,EAAE;AAExC,QAAA,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE;AACtB,YAAA,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC;AACzB,YAAA,MAAM,MAAM,GAAG,QAAQ,CAAC,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,CAAC;AACnD,YAAA,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC;QAC9B;AAEA,QAAA,OAAO,MAAK;YACR,KAAK,MAAM,MAAM,IAAI,aAAa;AAAE,gBAAA,MAAM,EAAE;AAChD,QAAA,CAAC;AACL,IAAA,CAAC;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/events/add-dom-event.mjs b/node_modules/motion-dom/dist/es/events/add-dom-event.mjs deleted file mode 100644 index af9a3c7..0000000 --- a/node_modules/motion-dom/dist/es/events/add-dom-event.mjs +++ /dev/null @@ -1,7 +0,0 @@ -function addDomEvent(target, eventName, handler, options = { passive: true }) { - target.addEventListener(eventName, handler, options); - return () => target.removeEventListener(eventName, handler, options); -} - -export { addDomEvent }; -//# sourceMappingURL=add-dom-event.mjs.map diff --git a/node_modules/motion-dom/dist/es/events/add-dom-event.mjs.map b/node_modules/motion-dom/dist/es/events/add-dom-event.mjs.map deleted file mode 100644 index 207eadb..0000000 --- a/node_modules/motion-dom/dist/es/events/add-dom-event.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"add-dom-event.mjs","sources":["../../../src/events/add-dom-event.ts"],"sourcesContent":["export function addDomEvent(\n target: EventTarget,\n eventName: string,\n handler: EventListener,\n options: AddEventListenerOptions = { passive: true }\n) {\n target.addEventListener(eventName, handler, options)\n\n return () => target.removeEventListener(eventName, handler, options)\n}\n"],"names":[],"mappings":"AAAM,SAAU,WAAW,CACvB,MAAmB,EACnB,SAAiB,EACjB,OAAsB,EACtB,OAAA,GAAmC,EAAE,OAAO,EAAE,IAAI,EAAE,EAAA;IAEpD,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC;AAEpD,IAAA,OAAO,MAAM,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC;AACxE;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/frameloop/batcher.mjs b/node_modules/motion-dom/dist/es/frameloop/batcher.mjs deleted file mode 100644 index 5e72a6c..0000000 --- a/node_modules/motion-dom/dist/es/frameloop/batcher.mjs +++ /dev/null @@ -1,73 +0,0 @@ -import { MotionGlobalConfig } from 'motion-utils'; -import { stepsOrder } from './order.mjs'; -import { createRenderStep } from './render-step.mjs'; - -const maxElapsed = 40; -function createRenderBatcher(scheduleNextBatch, allowKeepAlive) { - let runNextFrame = false; - let useDefaultElapsed = true; - const state = { - delta: 0.0, - timestamp: 0.0, - isProcessing: false, - }; - const flagRunNextFrame = () => (runNextFrame = true); - const steps = stepsOrder.reduce((acc, key) => { - acc[key] = createRenderStep(flagRunNextFrame); - return acc; - }, {}); - const { setup, read, resolveKeyframes, preUpdate, update, preRender, render, postRender, } = steps; - const processBatch = () => { - const useManualTiming = MotionGlobalConfig.useManualTiming; - const timestamp = useManualTiming - ? state.timestamp - : performance.now(); - runNextFrame = false; - if (!useManualTiming) { - state.delta = useDefaultElapsed - ? 1000 / 60 - : Math.max(Math.min(timestamp - state.timestamp, maxElapsed), 1); - } - state.timestamp = timestamp; - state.isProcessing = true; - // Unrolled render loop for better per-frame performance - setup.process(state); - read.process(state); - resolveKeyframes.process(state); - preUpdate.process(state); - update.process(state); - preRender.process(state); - render.process(state); - postRender.process(state); - state.isProcessing = false; - if (runNextFrame && allowKeepAlive) { - useDefaultElapsed = false; - scheduleNextBatch(processBatch); - } - }; - const wake = () => { - runNextFrame = true; - useDefaultElapsed = true; - if (!state.isProcessing) { - scheduleNextBatch(processBatch); - } - }; - const schedule = stepsOrder.reduce((acc, key) => { - const step = steps[key]; - acc[key] = (process, keepAlive = false, immediate = false) => { - if (!runNextFrame) - wake(); - return step.schedule(process, keepAlive, immediate); - }; - return acc; - }, {}); - const cancel = (process) => { - for (let i = 0; i < stepsOrder.length; i++) { - steps[stepsOrder[i]].cancel(process); - } - }; - return { schedule, cancel, state, steps }; -} - -export { createRenderBatcher }; -//# sourceMappingURL=batcher.mjs.map diff --git a/node_modules/motion-dom/dist/es/frameloop/batcher.mjs.map b/node_modules/motion-dom/dist/es/frameloop/batcher.mjs.map deleted file mode 100644 index 505435b..0000000 --- a/node_modules/motion-dom/dist/es/frameloop/batcher.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"batcher.mjs","sources":["../../../src/frameloop/batcher.ts"],"sourcesContent":["import { MotionGlobalConfig } from \"motion-utils\"\nimport { stepsOrder } from \"./order\"\nimport { createRenderStep } from \"./render-step\"\nimport { Batcher, FrameData, Process, Steps } from \"./types\"\n\nconst maxElapsed = 40\n\nexport function createRenderBatcher(\n scheduleNextBatch: (callback: Function) => void,\n allowKeepAlive: boolean\n) {\n let runNextFrame = false\n let useDefaultElapsed = true\n\n const state: FrameData = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n }\n\n const flagRunNextFrame = () => (runNextFrame = true)\n\n const steps = stepsOrder.reduce((acc, key) => {\n acc[key] = createRenderStep(flagRunNextFrame)\n return acc\n }, {} as Steps)\n\n const {\n setup,\n read,\n resolveKeyframes,\n preUpdate,\n update,\n preRender,\n render,\n postRender,\n } = steps\n\n const processBatch = () => {\n const useManualTiming = MotionGlobalConfig.useManualTiming\n const timestamp = useManualTiming\n ? state.timestamp\n : performance.now()\n runNextFrame = false\n\n if (!useManualTiming) {\n state.delta = useDefaultElapsed\n ? 1000 / 60\n : Math.max(Math.min(timestamp - state.timestamp, maxElapsed), 1)\n }\n\n state.timestamp = timestamp\n state.isProcessing = true\n\n // Unrolled render loop for better per-frame performance\n setup.process(state)\n read.process(state)\n resolveKeyframes.process(state)\n preUpdate.process(state)\n update.process(state)\n preRender.process(state)\n render.process(state)\n postRender.process(state)\n\n state.isProcessing = false\n\n if (runNextFrame && allowKeepAlive) {\n useDefaultElapsed = false\n scheduleNextBatch(processBatch)\n }\n }\n\n const wake = () => {\n runNextFrame = true\n useDefaultElapsed = true\n\n if (!state.isProcessing) {\n scheduleNextBatch(processBatch)\n }\n }\n\n const schedule = stepsOrder.reduce((acc, key) => {\n const step = steps[key]\n acc[key] = (process: Process, keepAlive = false, immediate = false) => {\n if (!runNextFrame) wake()\n\n return step.schedule(process, keepAlive, immediate)\n }\n return acc\n }, {} as Batcher)\n\n const cancel = (process: Process) => {\n for (let i = 0; i < stepsOrder.length; i++) {\n steps[stepsOrder[i]].cancel(process)\n }\n }\n\n return { schedule, cancel, state, steps }\n}\n"],"names":[],"mappings":";;;;AAKA,MAAM,UAAU,GAAG,EAAE;AAEf,SAAU,mBAAmB,CAC/B,iBAA+C,EAC/C,cAAuB,EAAA;IAEvB,IAAI,YAAY,GAAG,KAAK;IACxB,IAAI,iBAAiB,GAAG,IAAI;AAE5B,IAAA,MAAM,KAAK,GAAc;AACrB,QAAA,KAAK,EAAE,GAAG;AACV,QAAA,SAAS,EAAE,GAAG;AACd,QAAA,YAAY,EAAE,KAAK;KACtB;IAED,MAAM,gBAAgB,GAAG,OAAO,YAAY,GAAG,IAAI,CAAC;IAEpD,MAAM,KAAK,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,KAAI;QACzC,GAAG,CAAC,GAAG,CAAC,GAAG,gBAAgB,CAAC,gBAAgB,CAAC;AAC7C,QAAA,OAAO,GAAG;IACd,CAAC,EAAE,EAAW,CAAC;AAEf,IAAA,MAAM,EACF,KAAK,EACL,IAAI,EACJ,gBAAgB,EAChB,SAAS,EACT,MAAM,EACN,SAAS,EACT,MAAM,EACN,UAAU,GACb,GAAG,KAAK;IAET,MAAM,YAAY,GAAG,MAAK;AACtB,QAAA,MAAM,eAAe,GAAG,kBAAkB,CAAC,eAAe;QAC1D,MAAM,SAAS,GAAG;cACZ,KAAK,CAAC;AACR,cAAE,WAAW,CAAC,GAAG,EAAE;QACvB,YAAY,GAAG,KAAK;QAEpB,IAAI,C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,EAAE,SAAS,GAAG,KAAK,KAAI;AAClE,YAAA,IAAI,CAAC,YAAY;AAAE,gBAAA,IAAI,EAAE;YAEzB,OAAO,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,SAAS,EAAE,SAAS,CAAC;AACvD,QAAA,CAAC;AACD,QAAA,OAAO,GAAG;IACd,CAAC,EAAE,EAAa,CAAC;AAEjB,IAAA,MAAM,MAAM,GAAG,CAAC,OAAgB,KAAI;AAChC,QAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACxC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC;QACxC;AACJ,IAAA,CAAC;IAED,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE;AAC7C;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/frameloop/frame.mjs b/node_modules/motion-dom/dist/es/frameloop/frame.mjs deleted file mode 100644 index fa001b1..0000000 --- a/node_modules/motion-dom/dist/es/frameloop/frame.mjs +++ /dev/null @@ -1,7 +0,0 @@ -import { noop } from 'motion-utils'; -import { createRenderBatcher } from './batcher.mjs'; - -const { schedule: frame, cancel: cancelFrame, state: frameData, steps: frameSteps, } = /* @__PURE__ */ createRenderBatcher(typeof requestAnimationFrame !== "undefined" ? requestAnimationFrame : noop, true); - -export { cancelFrame, frame, frameData, frameSteps }; -//# sourceMappingURL=frame.mjs.map diff --git a/node_modules/motion-dom/dist/es/frameloop/frame.mjs.map b/node_modules/motion-dom/dist/es/frameloop/frame.mjs.map deleted file mode 100644 index 37d67b0..0000000 --- a/node_modules/motion-dom/dist/es/frameloop/frame.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"frame.mjs","sources":["../../../src/frameloop/frame.ts"],"sourcesContent":["import { noop } from \"motion-utils\"\nimport { createRenderBatcher } from \"./batcher\"\n\nexport const {\n schedule: frame,\n cancel: cancelFrame,\n state: frameData,\n steps: frameSteps,\n} = /* @__PURE__ */ createRenderBatcher(\n typeof requestAnimationFrame !== \"undefined\" ? requestAnimationFrame : noop,\n true\n)\n"],"names":[],"mappings":";;;AAGO,MAAM,EACT,QAAQ,EAAE,KAAK,EACf,MAAM,EAAE,WAAW,EACnB,KAAK,EAAE,SAAS,EAChB,KAAK,EAAE,UAAU,GACpB,mBAAmB,mBAAmB,CACnC,OAAO,qBAAqB,KAAK,WAAW,GAAG,qBAAqB,GAAG,IAAI,EAC3E,IAAI;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/frameloop/index-legacy.mjs b/node_modules/motion-dom/dist/es/frameloop/index-legacy.mjs deleted file mode 100644 index aa3de45..0000000 --- a/node_modules/motion-dom/dist/es/frameloop/index-legacy.mjs +++ /dev/null @@ -1,21 +0,0 @@ -import { stepsOrder } from './order.mjs'; -import { frame, cancelFrame } from './frame.mjs'; - -/** - * @deprecated - * - * Import as `frame` instead. - */ -const sync = frame; -/** - * @deprecated - * - * Use cancelFrame(callback) instead. - */ -const cancelSync = stepsOrder.reduce((acc, key) => { - acc[key] = (process) => cancelFrame(process); - return acc; -}, {}); - -export { cancelSync, sync }; -//# sourceMappingURL=index-legacy.mjs.map diff --git a/node_modules/motion-dom/dist/es/frameloop/index-legacy.mjs.map b/node_modules/motion-dom/dist/es/frameloop/index-legacy.mjs.map deleted file mode 100644 index 26f7d7e..0000000 --- a/node_modules/motion-dom/dist/es/frameloop/index-legacy.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index-legacy.mjs","sources":["../../../src/frameloop/index-legacy.ts"],"sourcesContent":["import { cancelFrame, frame } from \".\"\nimport { stepsOrder } from \"./order\"\nimport { Process } from \"./types\"\n\n/**\n * @deprecated\n *\n * Import as `frame` instead.\n */\nexport const sync = frame\n\n/**\n * @deprecated\n *\n * Use cancelFrame(callback) instead.\n */\nexport const cancelSync = stepsOrder.reduce((acc, key) => {\n acc[key] = (process: Process) => cancelFrame(process)\n return acc\n}, {} as Record void>)\n"],"names":[],"mappings":";;;AAIA;;;;AAIG;AACI,MAAM,IAAI,GAAG;AAEpB;;;;AAIG;AACI,MAAM,UAAU,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,KAAI;AACrD,IAAA,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,OAAgB,KAAK,WAAW,CAAC,OAAO,CAAC;AACrD,IAAA,OAAO,GAAG;AACd,CAAC,EAAE,EAAgD;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/frameloop/microtask.mjs b/node_modules/motion-dom/dist/es/frameloop/microtask.mjs deleted file mode 100644 index d81e76c..0000000 --- a/node_modules/motion-dom/dist/es/frameloop/microtask.mjs +++ /dev/null @@ -1,7 +0,0 @@ -import { createRenderBatcher } from './batcher.mjs'; - -const { schedule: microtask, cancel: cancelMicrotask } = -/* @__PURE__ */ createRenderBatcher(queueMicrotask, false); - -export { cancelMicrotask, microtask }; -//# sourceMappingURL=microtask.mjs.map diff --git a/node_modules/motion-dom/dist/es/frameloop/microtask.mjs.map b/node_modules/motion-dom/dist/es/frameloop/microtask.mjs.map deleted file mode 100644 index 8e8e7cd..0000000 --- a/node_modules/motion-dom/dist/es/frameloop/microtask.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"microtask.mjs","sources":["../../../src/frameloop/microtask.ts"],"sourcesContent":["import { createRenderBatcher } from \"./batcher\"\n\nexport const { schedule: microtask, cancel: cancelMicrotask } =\n /* @__PURE__ */ createRenderBatcher(queueMicrotask, false)\n"],"names":[],"mappings":";;AAEO,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,EAAE;AACzD,gBAAgB,mBAAmB,CAAC,cAAc,EAAE,KAAK;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/frameloop/order.mjs b/node_modules/motion-dom/dist/es/frameloop/order.mjs deleted file mode 100644 index f2fb09f..0000000 --- a/node_modules/motion-dom/dist/es/frameloop/order.mjs +++ /dev/null @@ -1,13 +0,0 @@ -const stepsOrder = [ - "setup", // Compute - "read", // Read - "resolveKeyframes", // Write/Read/Write/Read - "preUpdate", // Compute - "update", // Compute - "preRender", // Compute - "render", // Write - "postRender", // Compute -]; - -export { stepsOrder }; -//# sourceMappingURL=order.mjs.map diff --git a/node_modules/motion-dom/dist/es/frameloop/order.mjs.map b/node_modules/motion-dom/dist/es/frameloop/order.mjs.map deleted file mode 100644 index 19ceee3..0000000 --- a/node_modules/motion-dom/dist/es/frameloop/order.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"order.mjs","sources":["../../../src/frameloop/order.ts"],"sourcesContent":["import { StepId } from \"./types\"\n\nexport const stepsOrder: StepId[] = [\n \"setup\", // Compute\n \"read\", // Read\n \"resolveKeyframes\", // Write/Read/Write/Read\n \"preUpdate\", // Compute\n \"update\", // Compute\n \"preRender\", // Compute\n \"render\", // Write\n \"postRender\", // Compute\n] as const\n\nexport type StepNames = (typeof stepsOrder)[number]\n"],"names":[],"mappings":"AAEO,MAAM,UAAU,GAAa;AAChC,IAAA,OAAO;AACP,IAAA,MAAM;AACN,IAAA,kBAAkB;AAClB,IAAA,WAAW;AACX,IAAA,QAAQ;AACR,IAAA,WAAW;AACX,IAAA,QAAQ;AACR,IAAA,YAAY;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/frameloop/render-step.mjs b/node_modules/motion-dom/dist/es/frameloop/render-step.mjs deleted file mode 100644 index 34f5542..0000000 --- a/node_modules/motion-dom/dist/es/frameloop/render-step.mjs +++ /dev/null @@ -1,84 +0,0 @@ -function createRenderStep(runNextFrame) { - /** - * We create and reuse two queues, one to queue jobs for the current frame - * and one for the next. We reuse to avoid triggering GC after x frames. - */ - let thisFrame = new Set(); - let nextFrame = new Set(); - /** - * Track whether we're currently processing jobs in this step. This way - * we can decide whether to schedule new jobs for this frame or next. - */ - let isProcessing = false; - let flushNextFrame = false; - /** - * A set of processes which were marked keepAlive when scheduled. - */ - const toKeepAlive = new WeakSet(); - let latestFrameData = { - delta: 0.0, - timestamp: 0.0, - isProcessing: false, - }; - function triggerCallback(callback) { - if (toKeepAlive.has(callback)) { - step.schedule(callback); - runNextFrame(); - } - callback(latestFrameData); - } - const step = { - /** - * Schedule a process to run on the next frame. - */ - schedule: (callback, keepAlive = false, immediate = false) => { - const addToCurrentFrame = immediate && isProcessing; - const queue = addToCurrentFrame ? thisFrame : nextFrame; - if (keepAlive) - toKeepAlive.add(callback); - queue.add(callback); - return callback; - }, - /** - * Cancel the provided callback from running on the next frame. - */ - cancel: (callback) => { - nextFrame.delete(callback); - toKeepAlive.delete(callback); - }, - /** - * Execute all schedule callbacks. - */ - process: (frameData) => { - latestFrameData = frameData; - /** - * If we're already processing we've probably been triggered by a flushSync - * inside an existing process. Instead of executing, mark flushNextFrame - * as true and ensure we flush the following frame at the end of this one. - */ - if (isProcessing) { - flushNextFrame = true; - return; - } - isProcessing = true; - // Swap this frame and the next to avoid GC - const prevFrame = thisFrame; - thisFrame = nextFrame; - nextFrame = prevFrame; - // Execute this frame - thisFrame.forEach(triggerCallback); - // Clear the frame so no callbacks remain. This is to avoid - // memory leaks should this render step not run for a while. - thisFrame.clear(); - isProcessing = false; - if (flushNextFrame) { - flushNextFrame = false; - step.process(frameData); - } - }, - }; - return step; -} - -export { createRenderStep }; -//# sourceMappingURL=render-step.mjs.map diff --git a/node_modules/motion-dom/dist/es/frameloop/render-step.mjs.map b/node_modules/motion-dom/dist/es/frameloop/render-step.mjs.map deleted file mode 100644 index 463153f..0000000 --- a/node_modules/motion-dom/dist/es/frameloop/render-step.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"render-step.mjs","sources":["../../../src/frameloop/render-step.ts"],"sourcesContent":["import { FrameData, Process, Step } from \"./types\"\n\nexport function createRenderStep(runNextFrame: () => void): Step {\n /**\n * We create and reuse two queues, one to queue jobs for the current frame\n * and one for the next. We reuse to avoid triggering GC after x frames.\n */\n let thisFrame = new Set()\n let nextFrame = new Set()\n\n /**\n * Track whether we're currently processing jobs in this step. This way\n * we can decide whether to schedule new jobs for this frame or next.\n */\n let isProcessing = false\n\n let flushNextFrame = false\n\n /**\n * A set of processes which were marked keepAlive when scheduled.\n */\n const toKeepAlive = new WeakSet()\n\n let latestFrameData: FrameData = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n }\n\n function triggerCallback(callback: Process) {\n if (toKeepAlive.has(callback)) {\n step.schedule(callback)\n runNextFrame()\n }\n\n callback(latestFrameData)\n }\n\n const step: Step = {\n /**\n * Schedule a process to run on the next frame.\n */\n schedule: (callback, keepAlive = false, immediate = false) => {\n const addToCurrentFrame = immediate && isProcessing\n const queue = addToCurrentFrame ? thisFrame : nextFrame\n\n if (keepAlive) toKeepAlive.add(callback)\n\n queue.add(callback)\n\n return callback\n },\n\n /**\n * Cancel the provided callback from running on the next frame.\n */\n cancel: (callback) => {\n nextFrame.delete(callback)\n toKeepAlive.delete(callback)\n },\n\n /**\n * Execute all schedule callbacks.\n */\n process: (frameData) => {\n latestFrameData = frameData\n\n /**\n * If we're already processing we've probably been triggered by a flushSync\n * inside an existing process. Instead of executing, mark flushNextFrame\n * as true and ensure we flush the following frame at the end of this one.\n */\n if (isProcessing) {\n flushNextFrame = true\n return\n }\n\n isProcessing = true\n\n // Swap this frame and the next to avoid GC\n const prevFrame = thisFrame\n thisFrame = nextFrame\n nextFrame = prevFrame\n\n // Execute this frame\n thisFrame.forEach(triggerCallback)\n\n // Clear the frame so no callbacks remain. This is to avoid\n // memory leaks should this render step not run for a while.\n thisFrame.clear()\n\n isProcessing = false\n\n if (flushNextFrame) {\n flushNextFrame = false\n step.process(frameData)\n }\n },\n }\n\n return step\n}\n"],"names":[],"mappings":"AAEM,SAAU,gBAAgB,CAAC,YAAwB,EAAA;AACrD;;;AAGG;AACH,IAAA,IAAI,SAAS,GAAG,IA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ACd,cAAc,GAAG,IAAI;gBACrB;YACJ;YAEA,YAAY,GAAG,IAAI;;YAGnB,MAAM,SAAS,GAAG,SAAS;YAC3B,SAAS,GAAG,SAAS;YACrB,SAAS,GAAG,SAAS;;AAGrB,YAAA,SAAS,CAAC,OAAO,CAAC,eAAe,CAAC;;;YAIlC,SAAS,CAAC,KAAK,EAAE;YAEjB,YAAY,GAAG,KAAK;YAEpB,IAAI,cAAc,EAAE;gBAChB,cAAc,GAAG,KAAK;AACtB,gBAAA,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC;YAC3B;QACJ,CAAC;KACJ;AAED,IAAA,OAAO,IAAI;AACf;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/frameloop/sync-time.mjs b/node_modules/motion-dom/dist/es/frameloop/sync-time.mjs deleted file mode 100644 index e24804c..0000000 --- a/node_modules/motion-dom/dist/es/frameloop/sync-time.mjs +++ /dev/null @@ -1,32 +0,0 @@ -import { MotionGlobalConfig } from 'motion-utils'; -import { frameData } from './frame.mjs'; - -let now; -function clearTime() { - now = undefined; -} -/** - * An eventloop-synchronous alternative to performance.now(). - * - * Ensures that time measurements remain consistent within a synchronous context. - * Usually calling performance.now() twice within the same synchronous context - * will return different values which isn't useful for animations when we're usually - * trying to sync animations to the same frame. - */ -const time = { - now: () => { - if (now === undefined) { - time.set(frameData.isProcessing || MotionGlobalConfig.useManualTiming - ? frameData.timestamp - : performance.now()); - } - return now; - }, - set: (newTime) => { - now = newTime; - queueMicrotask(clearTime); - }, -}; - -export { time }; -//# sourceMappingURL=sync-time.mjs.map diff --git a/node_modules/motion-dom/dist/es/frameloop/sync-time.mjs.map b/node_modules/motion-dom/dist/es/frameloop/sync-time.mjs.map deleted file mode 100644 index 55cb987..0000000 --- a/node_modules/motion-dom/dist/es/frameloop/sync-time.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sync-time.mjs","sources":["../../../src/frameloop/sync-time.ts"],"sourcesContent":["import { MotionGlobalConfig } from \"motion-utils\"\nimport { frameData } from \"./frame\"\n\nlet now: number | undefined\n\nfunction clearTime() {\n now = undefined\n}\n\n/**\n * An eventloop-synchronous alternative to performance.now().\n *\n * Ensures that time measurements remain consistent within a synchronous context.\n * Usually calling performance.now() twice within the same synchronous context\n * will return different values which isn't useful for animations when we're usually\n * trying to sync animations to the same frame.\n */\nexport const time = {\n now: (): number => {\n if (now === undefined) {\n time.set(\n frameData.isProcessing || MotionGlobalConfig.useManualTiming\n ? frameData.timestamp\n : performance.now()\n )\n }\n\n return now!\n },\n set: (newTime: number) => {\n now = newTime\n queueMicrotask(clearTime)\n },\n}\n"],"names":[],"mappings":";;;AAGA,IAAI,GAAuB;AAE3B,SAAS,SAAS,GAAA;IACd,GAAG,GAAG,SAAS;AACnB;AAEA;;;;;;;AAOG;AACI,MAAM,IAAI,GAAG;IAChB,GAAG,EAAE,MAAa;AACd,QAAA,IAAI,GAAG,KAAK,SAAS,EAAE;YACnB,IAAI,CAAC,GAAG,CACJ,SAAS,CAAC,YAAY,IAAI,kBAAkB,CAAC;kBACvC,SAAS,CAAC;AACZ,kBAAE,WAAW,CAAC,GAAG,EAAE,CAC1B;QACL;AAEA,QAAA,OAAO,GAAI;IACf,CAAC;AACD,IAAA,GAAG,EAAE,CAAC,OAAe,KAAI;QACrB,GAAG,GAAG,OAAO;QACb,cAAc,CAAC,SAAS,CAAC;IAC7B,CAAC;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/gestures/drag/state/is-active.mjs b/node_modules/motion-dom/dist/es/gestures/drag/state/is-active.mjs deleted file mode 100644 index f5bfa77..0000000 --- a/node_modules/motion-dom/dist/es/gestures/drag/state/is-active.mjs +++ /dev/null @@ -1,10 +0,0 @@ -const isDragging = { - x: false, - y: false, -}; -function isDragActive() { - return isDragging.x || isDragging.y; -} - -export { isDragActive, isDragging }; -//# sourceMappingURL=is-active.mjs.map diff --git a/node_modules/motion-dom/dist/es/gestures/drag/state/is-active.mjs.map b/node_modules/motion-dom/dist/es/gestures/drag/state/is-active.mjs.map deleted file mode 100644 index 80f56c4..0000000 --- a/node_modules/motion-dom/dist/es/gestures/drag/state/is-active.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"is-active.mjs","sources":["../../../../../src/gestures/drag/state/is-active.ts"],"sourcesContent":["export const isDragging = {\n x: false,\n y: false,\n}\n\nexport function isDragActive() {\n return isDragging.x || isDragging.y\n}\n"],"names":[],"mappings":"AAAO,MAAM,UAAU,GAAG;AACtB,IAAA,CAAC,EAAE,KAAK;AACR,IAAA,CAAC,EAAE,KAAK;;SAGI,YAAY,GAAA;AACxB,IAAA,OAAO,UAAU,CAAC,CAAC,IAAI,UAAU,CAAC,CAAC;AACvC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/gestures/drag/state/set-active.mjs b/node_modules/motion-dom/dist/es/gestures/drag/state/set-active.mjs deleted file mode 100644 index 78e2661..0000000 --- a/node_modules/motion-dom/dist/es/gestures/drag/state/set-active.mjs +++ /dev/null @@ -1,29 +0,0 @@ -import { isDragging } from './is-active.mjs'; - -function setDragLock(axis) { - if (axis === "x" || axis === "y") { - if (isDragging[axis]) { - return null; - } - else { - isDragging[axis] = true; - return () => { - isDragging[axis] = false; - }; - } - } - else { - if (isDragging.x || isDragging.y) { - return null; - } - else { - isDragging.x = isDragging.y = true; - return () => { - isDragging.x = isDragging.y = false; - }; - } - } -} - -export { setDragLock }; -//# sourceMappingURL=set-active.mjs.map diff --git a/node_modules/motion-dom/dist/es/gestures/drag/state/set-active.mjs.map b/node_modules/motion-dom/dist/es/gestures/drag/state/set-active.mjs.map deleted file mode 100644 index b3c08e3..0000000 --- a/node_modules/motion-dom/dist/es/gestures/drag/state/set-active.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"set-active.mjs","sources":["../../../../../src/gestures/drag/state/set-active.ts"],"sourcesContent":["import { isDragging } from \"./is-active\"\n\nexport function setDragLock(axis: boolean | \"x\" | \"y\" | \"lockDirection\") {\n if (axis === \"x\" || axis === \"y\") {\n if (isDragging[axis]) {\n return null\n } else {\n isDragging[axis] = true\n return () => {\n isDragging[axis] = false\n }\n }\n } else {\n if (isDragging.x || isDragging.y) {\n return null\n } else {\n isDragging.x = isDragging.y = true\n return () => {\n isDragging.x = isDragging.y = false\n }\n }\n }\n}\n"],"names":[],"mappings":";;AAEM,SAAU,WAAW,CAAC,IAA2C,EAAA;IACnE,IAAI,IAAI,KAAK,GAAG,IAAI,IAAI,KAAK,GAAG,EAAE;AAC9B,QAAA,IAAI,UAAU,CAAC,IAAI,CAAC,EAAE;AAClB,YAAA,OAAO,IAAI;QACf;aAAO;AACH,YAAA,UAAU,CAAC,IAAI,CAAC,GAAG,IAAI;AACvB,YAAA,OAAO,MAAK;AACR,gBAAA,UAAU,CAAC,IAAI,CAAC,GAAG,KAAK;AAC5B,YAAA,CAAC;QACL;IACJ;SAAO;QACH,IAAI,UAAU,CAAC,CAAC,IAAI,UAAU,CAAC,CAAC,EAAE;AAC9B,YAAA,OAAO,IAAI;QACf;aAAO;YACH,UAAU,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,GAAG,IAAI;AAClC,YAAA,OAAO,MAAK;gBACR,UAAU,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,GAAG,KAAK;AACvC,YAAA,CAAC;QACL;IACJ;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/gestures/hover.mjs b/node_modules/motion-dom/dist/es/gestures/hover.mjs deleted file mode 100644 index 2d540e9..0000000 --- a/node_modules/motion-dom/dist/es/gestures/hover.mjs +++ /dev/null @@ -1,70 +0,0 @@ -import { isDragActive } from './drag/state/is-active.mjs'; -import { setupGesture } from './utils/setup.mjs'; - -function isValidHover(event) { - return !(event.pointerType === "touch" || isDragActive()); -} -/** - * Create a hover gesture. hover() is different to .addEventListener("pointerenter") - * in that it has an easier syntax, filters out polyfilled touch events, interoperates - * with drag gestures, and automatically removes the "pointerennd" event listener when the hover ends. - * - * @public - */ -function hover(elementOrSelector, onHoverStart, options = {}) { - const [elements, eventOptions, cancel] = setupGesture(elementOrSelector, options); - elements.forEach((element) => { - let isPressed = false; - let deferredHoverEnd = false; - let hoverEndCallback; - const removePointerLeave = () => { - element.removeEventListener("pointerleave", onPointerLeave); - }; - const endHover = (event) => { - if (hoverEndCallback) { - hoverEndCallback(event); - hoverEndCallback = undefined; - } - removePointerLeave(); - }; - const onPointerUp = (event) => { - isPressed = false; - window.removeEventListener("pointerup", onPointerUp); - window.removeEventListener("pointercancel", onPointerUp); - if (deferredHoverEnd) { - deferredHoverEnd = false; - endHover(event); - } - }; - const onPointerDown = () => { - isPressed = true; - window.addEventListener("pointerup", onPointerUp, eventOptions); - window.addEventListener("pointercancel", onPointerUp, eventOptions); - }; - const onPointerLeave = (leaveEvent) => { - if (leaveEvent.pointerType === "touch") - return; - if (isPressed) { - deferredHoverEnd = true; - return; - } - endHover(leaveEvent); - }; - const onPointerEnter = (enterEvent) => { - if (!isValidHover(enterEvent)) - return; - deferredHoverEnd = false; - const onHoverEnd = onHoverStart(element, enterEvent); - if (typeof onHoverEnd !== "function") - return; - hoverEndCallback = onHoverEnd; - element.addEventListener("pointerleave", onPointerLeave, eventOptions); - }; - element.addEventListener("pointerenter", onPointerEnter, eventOptions); - element.addEventListener("pointerdown", onPointerDown, eventOptions); - }); - return cancel; -} - -export { hover }; -//# sourceMappingURL=hover.mjs.map diff --git a/node_modules/motion-dom/dist/es/gestures/hover.mjs.map b/node_modules/motion-dom/dist/es/gestures/hover.mjs.map deleted file mode 100644 index 78e6f7e..0000000 --- a/node_modules/motion-dom/dist/es/gestures/hover.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"hover.mjs","sources":["../../../src/gestures/hover.ts"],"sourcesContent":["import { ElementOrSelector } from \"../utils/resolve-elements\"\nimport { isDragActive } from \"./drag/state/is-active\"\nimport { EventOptions } from \"./types\"\nimport { setupGesture } from \"./utils/setup\"\n\n/**\n * A function to be called when a hover gesture starts.\n *\n * This function can optionally return a function that will be called\n * when the hover gesture ends.\n *\n * @public\n */\nexport type OnHoverStartEvent = (\n element: Element,\n event: PointerEvent\n) => void | OnHoverEndEvent\n\n/**\n * A function to be called when a hover gesture ends.\n *\n * @public\n */\nexport type OnHoverEndEvent = (event: PointerEvent) => void\n\nfunction isValidHover(event: PointerEvent) {\n return !(event.pointerType === \"touch\" || isDragActive())\n}\n\n/**\n * Create a hover gesture. hover() is different to .addEventListener(\"pointerenter\")\n * in that it has an easier syntax, filters out polyfilled touch events, interoperates\n * with drag gestures, and automatically removes the \"pointerennd\" event listener when the hover ends.\n *\n * @public\n */\nexport function hover(\n elementOrSelector: ElementOrSelector,\n onHoverStart: OnHoverStartEvent,\n options: EventOptions = {}\n): VoidFunction {\n const [elements, eventOptions, cancel] = setupGesture(\n elementOrSelector,\n options\n )\n\n elements.forEach((element) => {\n let isPressed = false\n let deferredHoverEnd = false\n let hoverEndCallback: OnHoverEndEvent | undefined\n\n const removePointerLeave = () => {\n element.removeEventListener(\n \"pointerleave\",\n onPointerLeave as EventListener\n )\n }\n\n const endHover = (event: PointerEvent) => {\n if (hoverEndCallback) {\n hoverEndCallback(event)\n hoverEndCallback = undefined\n }\n removePointerLeave()\n }\n\n const onPointerUp = (event: Event) => {\n isPressed = false\n window.removeEventListener(\n \"pointerup\",\n onPointerUp as EventListener\n )\n window.removeEventListener(\n \"pointercancel\",\n onPointerUp as EventListener\n )\n\n if (deferredHoverEnd) {\n deferredHoverEnd = false\n endHover(event as PointerEvent)\n }\n }\n\n const onPointerDown = () => {\n isPressed = true\n window.addEventListener(\n \"pointerup\",\n onPointerUp as EventListener,\n eventOptions\n )\n window.addEventListener(\n \"pointercancel\",\n onPointerUp as EventListener,\n eventOptions\n )\n }\n\n const onPointerLeave = (leaveEvent: PointerEvent) => {\n if (leaveEvent.pointerType === \"touch\") return\n\n if (isPressed) {\n deferredHoverEnd = true\n return\n }\n\n endHover(leaveEvent)\n }\n\n const onPointerEnter = (enterEvent: PointerEvent) => {\n if (!isValidHover(enterEvent)) return\n\n deferredHoverEnd = false\n\n const onHoverEnd = onHoverStart(\n element as Element,\n enterEvent\n )\n\n if (typeof onHoverEnd !== \"function\") return\n\n hoverEndCallback = onHoverEnd\n\n element.addEventListener(\n \"pointerleave\",\n onPointerLeave as EventListener,\n eventOptions\n )\n }\n\n element.addEventListener(\n \"pointerenter\",\n onPointerEnter as EventListener,\n eventOptions\n )\n element.addEventListener(\n \"pointerdown\",\n onPointerDown as EventListener,\n eventOptions\n )\n })\n\n return cancel\n}\n"],"names":[],"mappings":";;;AAyBA,SAAS,YAAY,CAAC,KAAmB,EAAA;IACrC,OAAO,EAAE,KAAK,CAAC,WAAW,KAAK,OAAO,IAAI,YAAY,EAAE,CAAC;AAC7D;AAEA;;;;;;AAMG;AACG,SAAU,KAAK,CACjB,iBAAoC,EACpC,YAA+B,EAC/B,UAAwB,EAAE,EAAA;AAE1B,IAAA,MAAM,CAAC,QAAQ,EAAE,YAAY,EAAE,MAAM,CAAC,GAAG,YAAY,CACjD,iBAAiB,EACjB,OAAO,CACV;AAED,IAAA,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,KAAI;QACzB,IAAI,SAAS,GAAG,KAAK;QACrB,IAAI,gBAAgB,GAAG,KAAK;AAC5B,QAAA,IAAI,gBAA6C;QAEjD,MAAM,kBAAkB,GAAG,MAAK;AAC5B,YAAA,OAAO,CAAC,mBAAmB,CACvB,cAAc,EACd,cAA+B,CAClC;AACL,QAAA,CAAC;AAED,QAAA,MAAM,QAAQ,GAAG,CAAC,KAAmB,KAAI;YACrC,IAAI,gBAAgB,EAAE;gBAClB,gBAAgB,CAAC,KAAK,CAAC;gBACvB,gBAAgB,GAAG,SAAS;YAChC;AACA,YAAA,kBAAkB,EAAE;AACxB,QAAA,CAAC;AAED,QAAA,MAAM,WAAW,GAAG,CAAC,KAAY,KAAI;YACjC,SAAS,GAAG,KAAK;AACjB,YAAA,MAAM,CAAC,mBAAmB,CACtB,WAAW,EACX,WAA4B,CAC/B;AACD,YAAA,MAAM,CAAC,mBAAmB,CACtB,eAAe,EACf,WAA4B,CAC/B;YAED,IAAI,gBAAgB,EAAE;gBAClB,gBAAgB,GAAG,KAAK;gBACxB,QAAQ,CAAC,KAAqB,CAAC;YACnC;AACJ,QAAA,CAAC;QAED,MAAM,aAAa,GAAG,MAAK;YACvB,SAAS,GAAG,IAAI;YAChB,MAAM,CAAC,gBAAgB,CACnB,WAAW,EACX,WAA4B,EAC5B,YAAY,CACf;YACD,MAAM,CAAC,gBAAgB,CACnB,eAAe,EACf,WAA4B,EAC5B,YAAY,CACf;AACL,QAAA,CAAC;AAED,QAAA,MAAM,cAAc,GAAG,CAAC,UAAwB,KAAI;AAChD,YAAA,IAAI,UAAU,CAAC,WAAW,KAAK,OAAO;gBAAE;YAExC,IAAI,SAAS,EAAE;gBACX,gBAAgB,GAAG,IAAI;gBACvB;YACJ;YAEA,QAAQ,CAAC,UAAU,CAAC;AACxB,QAAA,CAAC;AAED,QAAA,MAAM,cAAc,GAAG,CAAC,UAAwB,KAAI;AAChD,YAAA,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC;gBAAE;YAE/B,gBAAgB,GAAG,KAAK;YAExB,MAAM,UAAU,GAAG,YAAY,CAC3B,OAAkB,EAClB,UAAU,CACb;YAED,IAAI,OAAO,UAAU,KAAK,UAAU;gBAAE;YAEtC,gBAAgB,GAAG,UAAU;YAE7B,OAAO,CAAC,gBAAgB,CACpB,cAAc,EACd,cAA+B,EAC/B,YAAY,CACf;AACL,QAAA,CAAC;QAED,OAAO,CAAC,gBAAgB,CACpB,cAAc,EACd,cAA+B,EAC/B,YAAY,CACf;QACD,OAAO,CAAC,gBAAgB,CACpB,aAAa,EACb,aAA8B,EAC9B,YAAY,CACf;AACL,IAAA,CAAC,CAAC;AAEF,IAAA,OAAO,MAAM;AACjB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/gestures/press/index.mjs b/node_modules/motion-dom/dist/es/gestures/press/index.mjs deleted file mode 100644 index b46a409..0000000 --- a/node_modules/motion-dom/dist/es/gestures/press/index.mjs +++ /dev/null @@ -1,97 +0,0 @@ -import { isHTMLElement } from '../../utils/is-html-element.mjs'; -import { isDragActive } from '../drag/state/is-active.mjs'; -import { isNodeOrChild } from '../utils/is-node-or-child.mjs'; -import { isPrimaryPointer } from '../utils/is-primary-pointer.mjs'; -import { setupGesture } from '../utils/setup.mjs'; -import { isElementKeyboardAccessible } from './utils/is-keyboard-accessible.mjs'; -import { enableKeyboardPress } from './utils/keyboard.mjs'; -import { isPressing } from './utils/state.mjs'; - -/** - * Filter out events that are not primary pointer events, or are triggering - * while a Motion gesture is active. - */ -function isValidPressEvent(event) { - return isPrimaryPointer(event) && !isDragActive(); -} -const claimedPointerDownEvents = new WeakSet(); -/** - * Create a press gesture. - * - * Press is different to `"pointerdown"`, `"pointerup"` in that it - * automatically filters out secondary pointer events like right - * click and multitouch. - * - * It also adds accessibility support for keyboards, where - * an element with a press gesture will receive focus and - * trigger on Enter `"keydown"` and `"keyup"` events. - * - * This is different to a browser's `"click"` event, which does - * respond to keyboards but only for the `"click"` itself, rather - * than the press start and end/cancel. The element also needs - * to be focusable for this to work, whereas a press gesture will - * make an element focusable by default. - * - * @public - */ -function press(targetOrSelector, onPressStart, options = {}) { - const [targets, eventOptions, cancelEvents] = setupGesture(targetOrSelector, options); - const startPress = (startEvent) => { - const target = startEvent.currentTarget; - if (!isValidPressEvent(startEvent)) - return; - if (claimedPointerDownEvents.has(startEvent)) - return; - isPressing.add(target); - if (options.stopPropagation) { - claimedPointerDownEvents.add(startEvent); - } - const onPressEnd = onPressStart(target, startEvent); - /** - * End listeners run in the capture phase so a descendant calling - * stopPropagation() in its own pointerup handler can't prevent the - * press gesture from ending. This also keeps the gesture-end - * ordering consistent with the drag gesture. See #2794. - */ - const endEventOptions = { ...eventOptions, capture: true }; - const onPointerEnd = (endEvent, success) => { - window.removeEventListener("pointerup", onPointerUp, endEventOptions); - window.removeEventListener("pointercancel", onPointerCancel, endEventOptions); - if (isPressing.has(target)) { - isPressing.delete(target); - } - if (!isValidPressEvent(endEvent)) { - return; - } - if (typeof onPressEnd === "function") { - onPressEnd(endEvent, { success }); - } - }; - const onPointerUp = (upEvent) => { - onPointerEnd(upEvent, target === window || - target === document || - options.useGlobalTarget || - isNodeOrChild(target, upEvent.target)); - }; - const onPointerCancel = (cancelEvent) => { - onPointerEnd(cancelEvent, false); - }; - window.addEventListener("pointerup", onPointerUp, endEventOptions); - window.addEventListener("pointercancel", onPointerCancel, endEventOptions); - }; - targets.forEach((target) => { - const pointerDownTarget = options.useGlobalTarget ? window : target; - pointerDownTarget.addEventListener("pointerdown", startPress, eventOptions); - if (isHTMLElement(target)) { - target.addEventListener("focus", (event) => enableKeyboardPress(event, eventOptions)); - if (!isElementKeyboardAccessible(target) && - !target.hasAttribute("tabindex")) { - target.tabIndex = 0; - } - } - }); - return cancelEvents; -} - -export { press }; -//# sourceMappingURL=index.mjs.map diff --git a/node_modules/motion-dom/dist/es/gestures/press/index.mjs.map b/node_modules/motion-dom/dist/es/gestures/press/index.mjs.map deleted file mode 100644 index e614a5e..0000000 --- a/node_modules/motion-dom/dist/es/gestures/press/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs","sources":["../../../../src/gestures/press/index.ts"],"sourcesContent":["import { isHTMLElement } from \"../../utils/is-html-element\"\nimport { ElementOrSelector } from \"../../utils/resolve-elements\"\nimport { isDragActive } from \"../drag/state/is-active\"\nimport { EventOptions } from \"../types\"\nimport { isNodeOrChild } from \"../utils/is-node-or-child\"\nimport { isPrimaryPointer } from \"../utils/is-primary-pointer\"\nimport { setupGesture } from \"../utils/setup\"\nimport { OnPressStartEvent } from \"./types\"\nimport { isElementKeyboardAccessible } from \"./utils/is-keyboard-accessible\"\nimport { enableKeyboardPress } from \"./utils/keyboard\"\nimport { isPressing } from \"./utils/state\"\n\n/**\n * Filter out events that are not primary pointer events, or are triggering\n * while a Motion gesture is active.\n */\nfunction isValidPressEvent(event: PointerEvent) {\n return isPrimaryPointer(event) && !isDragActive()\n}\n\nconst claimedPointerDownEvents = new WeakSet()\n\nexport interface PointerEventOptions extends EventOptions {\n useGlobalTarget?: boolean\n stopPropagation?: boolean\n}\n\n/**\n * Create a press gesture.\n *\n * Press is different to `\"pointerdown\"`, `\"pointerup\"` in that it\n * automatically filters out secondary pointer events like right\n * click and multitouch.\n *\n * It also adds accessibility support for keyboards, where\n * an element with a press gesture will receive focus and\n * trigger on Enter `\"keydown\"` and `\"keyup\"` events.\n *\n * This is different to a browser's `\"click\"` event, which does\n * respond to keyboards but only for the `\"click\"` itself, rather\n * than the press start and end/cancel. The element also needs\n * to be focusable for this to work, whereas a press gesture will\n * make an element focusable by default.\n *\n * @public\n */\nexport function press(\n targetOrSelector: ElementOrSelector,\n onPressStart: OnPressStartEvent,\n options: PointerEventOptions = {}\n): VoidFunction {\n const [targets, eventOptions, cancelEvents] = setupGesture(\n targetOrSelector,\n options\n )\n\n const startPress = (startEvent: PointerEvent) => {\n const target = startEvent.currentTarget as Element\n\n if (!isValidPressEvent(startEvent)) return\n if (claimedPointerDownEvents.has(startEvent)) return\n\n isPressing.add(target)\n\n if (options.stopPropagation) {\n claimedPointerDownEvents.add(startEvent)\n }\n\n const onPressEnd = onPressStart(target, startEvent)\n\n /**\n * End listeners run in the capture phase so a descendant calling\n * stopPropagation() in its own pointerup handler can't prevent the\n * press gesture from ending. This also keeps the gesture-end\n * ordering consistent with the drag gesture. See #2794.\n */\n const endEventOptions = { ...eventOptions, capture: true }\n\n const onPointerEnd = (endEvent: PointerEvent, success: boolean) => {\n window.removeEventListener(\n \"pointerup\",\n onPointerUp,\n endEventOptions\n )\n window.removeEventListener(\n \"pointercancel\",\n onPointerCancel,\n endEventOptions\n )\n\n if (isPressing.has(target)) {\n isPressing.delete(target)\n }\n\n if (!isValidPressEvent(endEvent)) {\n return\n }\n\n if (typeof onPressEnd === \"function\") {\n onPressEnd(endEvent, { success })\n }\n }\n\n const onPointerUp = (upEvent: PointerEvent) => {\n onPointerEnd(\n upEvent,\n (target as any) === window ||\n (target as any) === document ||\n options.useGlobalTarget ||\n isNodeOrChild(target, upEvent.target as Element)\n )\n }\n\n const onPointerCancel = (cancelEvent: PointerEvent) => {\n onPointerEnd(cancelEvent, false)\n }\n\n window.addEventListener(\"pointerup\", onPointerUp, endEventOptions)\n window.addEventListener(\n \"pointercancel\",\n onPointerCancel,\n endEventOptions\n )\n }\n\n targets.forEach((target: EventTarget) => {\n const pointerDownTarget = options.useGlobalTarget ? window : target\n pointerDownTarget.addEventListener(\n \"pointerdown\",\n startPress as EventListener,\n eventOptions\n )\n\n if (isHTMLElement(target)) {\n target.addEventListener(\"focus\", (event) =>\n enableKeyboardPress(event as FocusEvent, eventOptions)\n )\n\n if (\n !isElementKeyboardAccessible(target) &&\n !target.hasAttribute(\"tabindex\")\n ) {\n target.tabIndex = 0\n }\n }\n })\n\n return cancelEvents\n}\n"],"names":[],"mappings":";;;;;;;;;AAYA;;;AAGG;AACH,SAAS,iBAAiB,CAAC,KAAmB,EAAA;IAC1C,OAAO,gBAAgB,CAAC,KAAK,CAAC,IAAI,CAAC,YAAY,EAAE;AACrD;AAEA,MAAM,wBAAwB,GAAG,IAAI,OAAO,EAAS;AAOrD;;;;;;;;;;;;;;;;;;AAkBG;AACG,SAAU,KAAK,CACjB,gBAAmC,EACnC,YAA+B,EAC/B,UAA+B,EAAE,EAAA;AAEjC,IAAA,MAAM,CAAC,OAAO,EAAE,YAAY,EAAE,YAAY,CAAC,GAAG,YAAY,CACtD,gBAAgB,EAChB,OAAO,CACV;AAED,IAAA,MAAM,UAAU,GAAG,CAAC,UAAwB,KAAI;AAC5C,QAAA,MAAM,MAAM,GAAG,UAAU,CAAC,aAAwB;AAElD,QAAA,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC;YAAE;AACpC,QAAA,IAAI,wBAAwB,CAAC,GAAG,CAAC,UAAU,CA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AAW,EAAE,eAAe,CAAC;QAClE,MAAM,CAAC,gBAAgB,CACnB,eAAe,EACf,eAAe,EACf,eAAe,CAClB;AACL,IAAA,CAAC;AAED,IAAA,OAAO,CAAC,OAAO,CAAC,CAAC,MAAmB,KAAI;AACpC,QAAA,MAAM,iBAAiB,GAAG,OAAO,CAAC,eAAe,GAAG,MAAM,GAAG,MAAM;QACnE,iBAAiB,CAAC,gBAAgB,CAC9B,aAAa,EACb,UAA2B,EAC3B,YAAY,CACf;AAED,QAAA,IAAI,aAAa,CAAC,MAAM,CAAC,EAAE;AACvB,YAAA,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,CAAC,KAAK,KACnC,mBAAmB,CAAC,KAAmB,EAAE,YAAY,CAAC,CACzD;AAED,YAAA,IACI,CAAC,2BAA2B,CAAC,MAAM,CAAC;AACpC,gBAAA,CAAC,MAAM,CAAC,YAAY,CAAC,UAAU,CAAC,EAClC;AACE,gBAAA,MAAM,CAAC,QAAQ,GAAG,CAAC;YACvB;QACJ;AACJ,IAAA,CAAC,CAAC;AAEF,IAAA,OAAO,YAAY;AACvB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.mjs b/node_modules/motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.mjs deleted file mode 100644 index defa4bf..0000000 --- a/node_modules/motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.mjs +++ /dev/null @@ -1,34 +0,0 @@ -const keyboardAccessibleElements = new Set([ - "BUTTON", - "INPUT", - "SELECT", - "TEXTAREA", - "A", -]); -/** - * Checks if an element is natively keyboard accessible (focusable). - * Used by the press gesture to determine if we need to add tabIndex. - */ -function isElementKeyboardAccessible(element) { - return (keyboardAccessibleElements.has(element.tagName) || - element.isContentEditable === true); -} -const textInputElements = new Set(["INPUT", "SELECT", "TEXTAREA"]); -/** - * Checks if an element has text selection or direct interaction behavior - * that should block drag gestures from starting. - * - * This specifically targets form controls where the user might want to select - * text or interact with the control (e.g., sliders, dropdowns). - * - * Buttons and links are NOT included because they don't have click-and-move - * actions of their own - they only respond to click events, so dragging - * should still work when initiated from these elements. - */ -function isElementTextInput(element) { - return (textInputElements.has(element.tagName) || - element.isContentEditable === true); -} - -export { isElementKeyboardAccessible, isElementTextInput }; -//# sourceMappingURL=is-keyboard-accessible.mjs.map diff --git a/node_modules/motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.mjs.map b/node_modules/motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.mjs.map deleted file mode 100644 index cc94517..0000000 --- a/node_modules/motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"is-keyboard-accessible.mjs","sources":["../../../../../src/gestures/press/utils/is-keyboard-accessible.ts"],"sourcesContent":["const keyboardAccessibleElements = new Set([\n \"BUTTON\",\n \"INPUT\",\n \"SELECT\",\n \"TEXTAREA\",\n \"A\",\n])\n\n/**\n * Checks if an element is natively keyboard accessible (focusable).\n * Used by the press gesture to determine if we need to add tabIndex.\n */\nexport function isElementKeyboardAccessible(element: Element) {\n return (\n keyboardAccessibleElements.has(element.tagName) ||\n (element as HTMLElement).isContentEditable === true\n )\n}\n\nconst textInputElements = new Set([\"INPUT\", \"SELECT\", \"TEXTAREA\"])\n\n/**\n * Checks if an element has text selection or direct interaction behavior\n * that should block drag gestures from starting.\n *\n * This specifically targets form controls where the user might want to select\n * text or interact with the control (e.g., sliders, dropdowns).\n *\n * Buttons and links are NOT included because they don't have click-and-move\n * actions of their own - they only respond to click events, so dragging\n * should still work when initiated from these elements.\n */\nexport function isElementTextInput(element: Element) {\n return (\n textInputElements.has(element.tagName) ||\n (element as HTMLElement).isContentEditable === true\n )\n}\n"],"names":[],"mappings":"AAAA,MAAM,0BAA0B,GAAG,IAAI,GAAG,CAAC;IACvC,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,UAAU;IACV,GAAG;AACN,CAAA,CAAC;AAEF;;;AAGG;AACG,SAAU,2BAA2B,CAAC,OAAgB,EAAA;IACxD,QACI,0BAA0B,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC;AAC9C,QAAA,OAAuB,CAAC,iBAAiB,KAAK,IAAI;AAE3D;AAEA,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC;AAElE;;;;;;;;;;AAUG;AACG,SAAU,kBAAkB,CAAC,OAAgB,EAAA;IAC/C,QACI,iBAAiB,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC;AACrC,QAAA,OAAuB,CAAC,iBAAiB,KAAK,IAAI;AAE3D;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/gestures/press/utils/keyboard.mjs b/node_modules/motion-dom/dist/es/gestures/press/utils/keyboard.mjs deleted file mode 100644 index 8186599..0000000 --- a/node_modules/motion-dom/dist/es/gestures/press/utils/keyboard.mjs +++ /dev/null @@ -1,39 +0,0 @@ -import { isPressing } from './state.mjs'; - -/** - * Filter out events that are not "Enter" keys. - */ -function filterEvents(callback) { - return (event) => { - if (event.key !== "Enter") - return; - callback(event); - }; -} -function firePointerEvent(target, type) { - target.dispatchEvent(new PointerEvent("pointer" + type, { isPrimary: true, bubbles: true })); -} -const enableKeyboardPress = (focusEvent, eventOptions) => { - const element = focusEvent.currentTarget; - if (!element) - return; - const handleKeydown = filterEvents(() => { - if (isPressing.has(element)) - return; - firePointerEvent(element, "down"); - const handleKeyup = filterEvents(() => { - firePointerEvent(element, "up"); - }); - const handleBlur = () => firePointerEvent(element, "cancel"); - element.addEventListener("keyup", handleKeyup, eventOptions); - element.addEventListener("blur", handleBlur, eventOptions); - }); - element.addEventListener("keydown", handleKeydown, eventOptions); - /** - * Add an event listener that fires on blur to remove the keydown events. - */ - element.addEventListener("blur", () => element.removeEventListener("keydown", handleKeydown), eventOptions); -}; - -export { enableKeyboardPress }; -//# sourceMappingURL=keyboard.mjs.map diff --git a/node_modules/motion-dom/dist/es/gestures/press/utils/keyboard.mjs.map b/node_modules/motion-dom/dist/es/gestures/press/utils/keyboard.mjs.map deleted file mode 100644 index d83f7b6..0000000 --- a/node_modules/motion-dom/dist/es/gestures/press/utils/keyboard.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"keyboard.mjs","sources":["../../../../../src/gestures/press/utils/keyboard.ts"],"sourcesContent":["import { isPressing } from \"./state\"\n\n/**\n * Filter out events that are not \"Enter\" keys.\n */\nfunction filterEvents(callback: (event: KeyboardEvent) => void) {\n return (event: KeyboardEvent) => {\n if (event.key !== \"Enter\") return\n callback(event)\n }\n}\n\nfunction firePointerEvent(target: EventTarget, type: \"down\" | \"up\" | \"cancel\") {\n target.dispatchEvent(\n new PointerEvent(\"pointer\" + type, { isPrimary: true, bubbles: true })\n )\n}\n\nexport const enableKeyboardPress = (\n focusEvent: FocusEvent,\n eventOptions: AddEventListenerOptions\n) => {\n const element = focusEvent.currentTarget as HTMLElement\n if (!element) return\n\n const handleKeydown = filterEvents(() => {\n if (isPressing.has(element)) return\n\n firePointerEvent(element, \"down\")\n\n const handleKeyup = filterEvents(() => {\n firePointerEvent(element, \"up\")\n })\n\n const handleBlur = () => firePointerEvent(element, \"cancel\")\n\n element.addEventListener(\"keyup\", handleKeyup, eventOptions)\n element.addEventListener(\"blur\", handleBlur, eventOptions)\n })\n\n element.addEventListener(\"keydown\", handleKeydown, eventOptions)\n\n /**\n * Add an event listener that fires on blur to remove the keydown events.\n */\n element.addEventListener(\n \"blur\",\n () => element.removeEventListener(\"keydown\", handleKeydown),\n eventOptions\n )\n}\n"],"names":[],"mappings":";;AAEA;;AAEG;AACH,SAAS,YAAY,CAAC,QAAwC,EAAA;IAC1D,OAAO,CAAC,KAAoB,KAAI;AAC5B,QAAA,IAAI,KAAK,CAAC,GAAG,KAAK,OAAO;YAAE;QAC3B,QAAQ,CAAC,KAAK,CAAC;AACnB,IAAA,CAAC;AACL;AAEA,SAAS,gBAAgB,CAAC,MAAmB,EAAE,IAA8B,EAAA;IACzE,MAAM,CAAC,aAAa,CAChB,IAAI,YAAY,CAAC,SAAS,GAAG,IAAI,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CACzE;AACL;MAEa,mBAAmB,GAAG,CAC/B,UAAsB,EACtB,YAAqC,KACrC;AACA,IAAA,MAAM,OAAO,GAAG,UAAU,CAAC,aAA4B;AACvD,IAAA,IAAI,CAAC,OAAO;QAAE;AAEd,IAAA,MAAM,aAAa,GAAG,YAAY,CAAC,MAAK;AACpC,QAAA,IAAI,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC;YAAE;AAE7B,QAAA,gBAAgB,CAAC,OAAO,EAAE,MAAM,CAAC;AAEjC,QAAA,MAAM,WAAW,GAAG,YAAY,CAAC,MAAK;AAClC,YAAA,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC;AACnC,QAAA,CAAC,CAAC;QAEF,MAAM,UAAU,GAAG,MAAM,gBAAgB,CAAC,OAAO,EAAE,QAAQ,CAAC;QAE5D,OAAO,CAAC,gBAAgB,CAAC,OAAO,EAAE,WAAW,EAAE,YAAY,CAAC;QAC5D,OAAO,CAAC,gBAAgB,CAAC,MAAM,EAAE,UAAU,EAAE,YAAY,CAAC;AAC9D,IAAA,CAAC,CAAC;IAEF,OAAO,CAAC,gBAAgB,CAAC,SAAS,EAAE,aAAa,EAAE,YAAY,CAAC;AAEhE;;AAEG;AACH,IAAA,OAAO,CAAC,gBAAgB,CACpB,MAAM,EACN,MAAM,OAAO,CAAC,mBAAmB,CAAC,SAAS,EAAE,aAAa,CAAC,EAC3D,YAAY,CACf;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/gestures/press/utils/state.mjs b/node_modules/motion-dom/dist/es/gestures/press/utils/state.mjs deleted file mode 100644 index ac86eab..0000000 --- a/node_modules/motion-dom/dist/es/gestures/press/utils/state.mjs +++ /dev/null @@ -1,4 +0,0 @@ -const isPressing = new WeakSet(); - -export { isPressing }; -//# sourceMappingURL=state.mjs.map diff --git a/node_modules/motion-dom/dist/es/gestures/press/utils/state.mjs.map b/node_modules/motion-dom/dist/es/gestures/press/utils/state.mjs.map deleted file mode 100644 index ee9c7c1..0000000 --- a/node_modules/motion-dom/dist/es/gestures/press/utils/state.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"state.mjs","sources":["../../../../../src/gestures/press/utils/state.ts"],"sourcesContent":["export const isPressing = new WeakSet()\n"],"names":[],"mappings":"AAAO,MAAM,UAAU,GAAG,IAAI,OAAO;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/gestures/utils/is-node-or-child.mjs b/node_modules/motion-dom/dist/es/gestures/utils/is-node-or-child.mjs deleted file mode 100644 index 7cc1da6..0000000 --- a/node_modules/motion-dom/dist/es/gestures/utils/is-node-or-child.mjs +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Recursively traverse up the tree to check whether the provided child node - * is the parent or a descendant of it. - * - * @param parent - Element to find - * @param child - Element to test against parent - */ -const isNodeOrChild = (parent, child) => { - if (!child) { - return false; - } - else if (parent === child) { - return true; - } - else { - return isNodeOrChild(parent, child.parentElement); - } -}; - -export { isNodeOrChild }; -//# sourceMappingURL=is-node-or-child.mjs.map diff --git a/node_modules/motion-dom/dist/es/gestures/utils/is-node-or-child.mjs.map b/node_modules/motion-dom/dist/es/gestures/utils/is-node-or-child.mjs.map deleted file mode 100644 index 9160375..0000000 --- a/node_modules/motion-dom/dist/es/gestures/utils/is-node-or-child.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"is-node-or-child.mjs","sources":["../../../../src/gestures/utils/is-node-or-child.ts"],"sourcesContent":["/**\n * Recursively traverse up the tree to check whether the provided child node\n * is the parent or a descendant of it.\n *\n * @param parent - Element to find\n * @param child - Element to test against parent\n */\nexport const isNodeOrChild = (\n parent: Element | null,\n child?: Element | null\n): boolean => {\n if (!child) {\n return false\n } else if (parent === child) {\n return true\n } else {\n return isNodeOrChild(parent, child.parentElement)\n }\n}\n"],"names":[],"mappings":"AAAA;;;;;;AAMG;MACU,aAAa,GAAG,CACzB,MAAsB,EACtB,KAAsB,KACb;IACT,IAAI,CAAC,KAAK,EAAE;AACR,QAAA,OAAO,KAAK;IAChB;AAAO,SAAA,IAAI,MAAM,KAAK,KAAK,EAAE;AACzB,QAAA,OAAO,IAAI;IACf;SAAO;QACH,OAAO,aAAa,CAAC,MAAM,EAAE,KAAK,CAAC,aAAa,CAAC;IACrD;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/gestures/utils/is-primary-pointer.mjs b/node_modules/motion-dom/dist/es/gestures/utils/is-primary-pointer.mjs deleted file mode 100644 index c013d7e..0000000 --- a/node_modules/motion-dom/dist/es/gestures/utils/is-primary-pointer.mjs +++ /dev/null @@ -1,19 +0,0 @@ -const isPrimaryPointer = (event) => { - if (event.pointerType === "mouse") { - return typeof event.button !== "number" || event.button <= 0; - } - else { - /** - * isPrimary is true for all mice buttons, whereas every touch point - * is regarded as its own input. So subsequent concurrent touch points - * will be false. - * - * Specifically match against false here as incomplete versions of - * PointerEvents in very old browser might have it set as undefined. - */ - return event.isPrimary !== false; - } -}; - -export { isPrimaryPointer }; -//# sourceMappingURL=is-primary-pointer.mjs.map diff --git a/node_modules/motion-dom/dist/es/gestures/utils/is-primary-pointer.mjs.map b/node_modules/motion-dom/dist/es/gestures/utils/is-primary-pointer.mjs.map deleted file mode 100644 index d391a32..0000000 --- a/node_modules/motion-dom/dist/es/gestures/utils/is-primary-pointer.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"is-primary-pointer.mjs","sources":["../../../../src/gestures/utils/is-primary-pointer.ts"],"sourcesContent":["export const isPrimaryPointer = (event: PointerEvent) => {\n if (event.pointerType === \"mouse\") {\n return typeof event.button !== \"number\" || event.button <= 0\n } else {\n /**\n * isPrimary is true for all mice buttons, whereas every touch point\n * is regarded as its own input. So subsequent concurrent touch points\n * will be false.\n *\n * Specifically match against false here as incomplete versions of\n * PointerEvents in very old browser might have it set as undefined.\n */\n return event.isPrimary !== false\n }\n}\n"],"names":[],"mappings":"AAAO,MAAM,gBAAgB,GAAG,CAAC,KAAmB,KAAI;AACpD,IAAA,IAAI,KAAK,CAAC,WAAW,KAAK,OAAO,EAAE;AAC/B,QAAA,OAAO,OAAO,KAAK,CAAC,MAAM,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,IAAI,CAAC;IAChE;SAAO;AACH;;;;;;;AAOG;AACH,QAAA,OAAO,KAAK,CAAC,SAAS,KAAK,KAAK;IACpC;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/gestures/utils/setup.mjs b/node_modules/motion-dom/dist/es/gestures/utils/setup.mjs deleted file mode 100644 index 9505c06..0000000 --- a/node_modules/motion-dom/dist/es/gestures/utils/setup.mjs +++ /dev/null @@ -1,16 +0,0 @@ -import { resolveElements } from '../../utils/resolve-elements.mjs'; - -function setupGesture(elementOrSelector, options) { - const elements = resolveElements(elementOrSelector); - const gestureAbortController = new AbortController(); - const eventOptions = { - passive: true, - ...options, - signal: gestureAbortController.signal, - }; - const cancel = () => gestureAbortController.abort(); - return [elements, eventOptions, cancel]; -} - -export { setupGesture }; -//# sourceMappingURL=setup.mjs.map diff --git a/node_modules/motion-dom/dist/es/gestures/utils/setup.mjs.map b/node_modules/motion-dom/dist/es/gestures/utils/setup.mjs.map deleted file mode 100644 index 5bfea58..0000000 --- a/node_modules/motion-dom/dist/es/gestures/utils/setup.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"setup.mjs","sources":["../../../../src/gestures/utils/setup.ts"],"sourcesContent":["import {\n ElementOrSelector,\n resolveElements,\n} from \"../../utils/resolve-elements\"\nimport { EventOptions } from \"../types\"\n\nexport function setupGesture(\n elementOrSelector: ElementOrSelector,\n options: EventOptions\n): [Element[], AddEventListenerOptions, VoidFunction] {\n const elements = resolveElements(elementOrSelector)\n\n const gestureAbortController = new AbortController()\n\n const eventOptions = {\n passive: true,\n ...options,\n signal: gestureAbortController.signal,\n }\n\n const cancel = () => gestureAbortController.abort()\n\n return [elements, eventOptions, cancel]\n}\n"],"names":[],"mappings":";;AAMM,SAAU,YAAY,CACxB,iBAAoC,EACpC,OAAqB,EAAA;AAErB,IAAA,MAAM,QAAQ,GAAG,eAAe,CAAC,iBAAiB,CAAC;AAEnD,IAAA,MAAM,sBAAsB,GAAG,IAAI,eAAe,EAAE;AAEpD,IAAA,MAAM,YAAY,GAAG;AACjB,QAAA,OAAO,EAAE,IAAI;AACb,QAAA,GAAG,OAAO;QACV,MAAM,EAAE,sBAAsB,CAAC,MAAM;KACxC;IAED,MAAM,MAAM,GAAG,MAAM,sBAAsB,CAAC,KAAK,EAAE;AAEnD,IAAA,OAAO,CAAC,QAAQ,EAAE,YAAY,EAAE,MAAM,CAAC;AAC3C;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/index.mjs b/node_modules/motion-dom/dist/es/index.mjs deleted file mode 100644 index b7d94a4..0000000 --- a/node_modules/motion-dom/dist/es/index.mjs +++ /dev/null @@ -1,176 +0,0 @@ -export { AsyncMotionValueAnimation } from './animation/AsyncMotionValueAnimation.mjs'; -export { GroupAnimation } from './animation/GroupAnimation.mjs'; -export { GroupAnimationWithThen } from './animation/GroupAnimationWithThen.mjs'; -export { JSAnimation, animateValue } from './animation/JSAnimation.mjs'; -export { NativeAnimation } from './animation/NativeAnimation.mjs'; -export { NativeAnimationExtended } from './animation/NativeAnimationExtended.mjs'; -export { NativeAnimationWrapper } from './animation/NativeAnimationWrapper.mjs'; -export { animationMapKey, getAnimationMap } from './animation/utils/active-animations.mjs'; -export { calcChildStagger } from './animation/utils/calc-child-stagger.mjs'; -export { arc } from './animation/utils/arc.mjs'; -export { getVariableValue, parseCSSVariable } from './animation/utils/css-variables-conversion.mjs'; -export { getDefaultTransition } from './animation/utils/default-transitions.mjs'; -export { getFinalKeyframe } from './animation/keyframes/get-final.mjs'; -export { getValueTransition } from './animation/utils/get-value-transition.mjs'; -export { resolveTransition } from './animation/utils/resolve-transition.mjs'; -export { containsCSSVariable, isCSSVariableName, isCSSVariableToken } from './animation/utils/is-css-variable.mjs'; -export { isTransitionDefined } from './animation/utils/is-transition-defined.mjs'; -export { makeAnimationInstant } from './animation/utils/make-animation-instant.mjs'; -export { animateMotionValue } from './animation/interfaces/motion-value.mjs'; -export { animateVisualElement } from './animation/interfaces/visual-element.mjs'; -export { animateTarget } from './animation/interfaces/visual-element-target.mjs'; -export { animateVariant } from './animation/interfaces/visual-element-variant.mjs'; -export { optimizedAppearDataAttribute, optimizedAppearDataId } from './animation/optimized-appear/data-id.mjs'; -export { getOptimisedAppearId } from './animation/optimized-appear/get-appear-id.mjs'; -export { inertia } from './animation/generators/inertia.mjs'; -export { defaultEasing, keyframes } from './animation/generators/keyframes.mjs'; -export { spring } from './animation/generators/spring.mjs'; -export { calcGeneratorDuration, maxGeneratorDuration } from './animation/generators/utils/calc-duration.mjs'; -export { createGeneratorEasing } from './animation/generators/utils/create-generator-easing.mjs'; -export { isGenerator } from './animation/generators/utils/is-generator.mjs'; -export { DOMKeyframesResolver } from './animation/keyframes/DOMKeyframesResolver.mjs'; -export { KeyframeResolver, flushKeyframeResolvers } from './animation/keyframes/KeyframesResolver.mjs'; -export { defaultOffset } from './animation/keyframes/offsets/default.mjs'; -export { fillOffset } from './animation/keyframes/offsets/fill.mjs'; -export { convertOffsetToTimes } from './animation/keyframes/offsets/time.mjs'; -export { applyPxDefaults } from './animation/keyframes/utils/apply-px-defaults.mjs'; -export { fillWildcards } from './animation/keyframes/utils/fill-wildcards.mjs'; -export { cubicBezierAsString } from './animation/waapi/easing/cubic-bezier.mjs'; -export { isWaapiSupportedEasing } from './animation/waapi/easing/is-supported.mjs'; -export { mapEasingToNativeEasing } from './animation/waapi/easing/map-easing.mjs'; -export { supportedWaapiEasing } from './animation/waapi/easing/supported.mjs'; -export { startWaapiAnimation } from './animation/waapi/start-waapi-animation.mjs'; -export { supportsPartialKeyframes } from './animation/waapi/supports/partial-keyframes.mjs'; -export { supportsBrowserAnimation } from './animation/waapi/supports/waapi.mjs'; -export { acceleratedValues } from './animation/waapi/utils/accelerated-values.mjs'; -export { applyGeneratorOptions } from './animation/waapi/utils/apply-generator.mjs'; -export { generateLinearEasing } from './animation/waapi/utils/linear.mjs'; -export { addAttrValue, attrEffect } from './effects/attr/index.mjs'; -export { propEffect } from './effects/prop/index.mjs'; -export { addStyleValue, styleEffect } from './effects/style/index.mjs'; -export { svgEffect } from './effects/svg/index.mjs'; -export { createRenderBatcher } from './frameloop/batcher.mjs'; -export { cancelMicrotask, microtask } from './frameloop/microtask.mjs'; -export { time } from './frameloop/sync-time.mjs'; -export { isDragActive, isDragging } from './gestures/drag/state/is-active.mjs'; -export { setDragLock } from './gestures/drag/state/set-active.mjs'; -export { hover } from './gestures/hover.mjs'; -export { press } from './gestures/press/index.mjs'; -export { isElementKeyboardAccessible, isElementTextInput } from './gestures/press/utils/is-keyboard-accessible.mjs'; -export { isNodeOrChild } from './gestures/utils/is-node-or-child.mjs'; -export { isPrimaryPointer } from './gestures/utils/is-primary-pointer.mjs'; -export { defaultTransformValue, parseValueFromTransform, readTransformValue } from './render/dom/parse-transform.mjs'; -export { getComputedStyle } from './render/dom/style-computed.mjs'; -export { setStyle } from './render/dom/style-set.mjs'; -export { isKeyframesTarget } from './render/utils/is-keyframes-target.mjs'; -export { positionalKeys } from './render/utils/keys-position.mjs'; -export { transformPropOrder, transformProps } from './render/utils/keys-transform.mjs'; -export { resize } from './resize/index.mjs'; -export { observeTimeline } from './scroll/observe.mjs'; -export { recordStats } from './stats/index.mjs'; -export { statsBuffer } from './stats/buffer.mjs'; -export { interpolate } from './utils/interpolate.mjs'; -export { isHTMLElement } from './utils/is-html-element.mjs'; -export { isSVGElement } from './utils/is-svg-element.mjs'; -export { isSVGSVGElement } from './utils/is-svg-svg-element.mjs'; -export { mix } from './utils/mix/index.mjs'; -export { mixColor, mixLinearColor } from './utils/mix/color.mjs'; -export { getMixer, mixArray, mixComplex, mixObject } from './utils/mix/complex.mjs'; -export { mixImmediate } from './utils/mix/immediate.mjs'; -export { mixNumber } from './utils/mix/number.mjs'; -export { invisibleValues, mixVisibility } from './utils/mix/visibility.mjs'; -export { resolveElements } from './utils/resolve-elements.mjs'; -export { getOriginIndex, stagger } from './utils/stagger.mjs'; -export { supportsFlags } from './utils/supports/flags.mjs'; -export { supportsLinearEasing } from './utils/supports/linear-easing.mjs'; -export { supportsScrollTimeline, supportsViewTimeline } from './utils/supports/scroll-timeline.mjs'; -export { transform } from './utils/transform.mjs'; -export { MotionValue, collectMotionValues, motionValue } from './value/index.mjs'; -export { attachFollow, followValue } from './value/follow-value.mjs'; -export { mapValue } from './value/map-value.mjs'; -export { attachSpring, springValue } from './value/spring-value.mjs'; -export { transformValue } from './value/transform-value.mjs'; -export { color } from './value/types/color/index.mjs'; -export { hex } from './value/types/color/hex.mjs'; -export { hsla } from './value/types/color/hsla.mjs'; -export { hslaToRgba } from './value/types/color/hsla-to-rgba.mjs'; -export { rgbUnit, rgba } from './value/types/color/rgba.mjs'; -export { analyseComplexValue, complex } from './value/types/complex/index.mjs'; -export { dimensionValueTypes, findDimensionValueType } from './value/types/dimensions.mjs'; -export { defaultValueTypes, getDefaultValueType } from './value/types/maps/defaults.mjs'; -export { numberValueTypes } from './value/types/maps/number.mjs'; -export { transformValueTypes } from './value/types/maps/transform.mjs'; -export { alpha, number, scale } from './value/types/numbers/index.mjs'; -export { degrees, percent, progressPercentage, px, vh, vw } from './value/types/numbers/units.mjs'; -export { testValueType } from './value/types/test.mjs'; -export { getAnimatableNone } from './value/types/utils/animatable-none.mjs'; -export { findValueType } from './value/types/utils/find.mjs'; -export { getValueAsType } from './value/types/utils/get-as-type.mjs'; -export { isMotionValue } from './value/utils/is-motion-value.mjs'; -export { addValueToWillChange } from './value/will-change/add-will-change.mjs'; -export { isWillChangeMotionValue } from './value/will-change/is.mjs'; -export { ViewTransitionBuilder, animateView } from './view/index.mjs'; -export { getViewAnimationLayerInfo } from './view/utils/get-layer-info.mjs'; -export { getViewAnimations } from './view/utils/get-view-animations.mjs'; -export { DOMVisualElement } from './render/dom/DOMVisualElement.mjs'; -export { Feature } from './render/Feature.mjs'; -export { HTMLVisualElement } from './render/html/HTMLVisualElement.mjs'; -export { ObjectVisualElement } from './render/object/ObjectVisualElement.mjs'; -export { visualElementStore } from './render/store.mjs'; -export { SVGVisualElement } from './render/svg/SVGVisualElement.mjs'; -export { VisualElement, getFeatureDefinitions, setFeatureDefinitions } from './render/VisualElement.mjs'; -export { checkVariantsDidChange, createAnimationState } from './render/utils/animation-state.mjs'; -export { getVariantContext } from './render/utils/get-variant-context.mjs'; -export { isAnimationControls } from './render/utils/is-animation-controls.mjs'; -export { isControllingVariants, isVariantNode } from './render/utils/is-controlling-variants.mjs'; -export { isForcedMotionValue } from './render/utils/is-forced-motion-value.mjs'; -export { isVariantLabel } from './render/utils/is-variant-label.mjs'; -export { updateMotionValuesFromProps } from './render/utils/motion-values.mjs'; -export { resolveVariant } from './render/utils/resolve-dynamic-variants.mjs'; -export { resolveVariantFromProps } from './render/utils/resolve-variants.mjs'; -export { setTarget } from './render/utils/setters.mjs'; -export { variantPriorityOrder, variantProps } from './render/utils/variant-props.mjs'; -export { initPrefersReducedMotion } from './render/utils/reduced-motion/index.mjs'; -export { convertBoundingBoxToBox, convertBoxToBoundingBox, transformBoxPoints } from './projection/geometry/conversion.mjs'; -export { copyAxisDeltaInto, copyAxisInto, copyBoxInto } from './projection/geometry/copy.mjs'; -export { applyAxisDelta, applyBoxDelta, applyPointDelta, applyTreeDeltas, scalePoint, transformAxis, transformBox, translateAxis } from './projection/geometry/delta-apply.mjs'; -export { calcAxisDelta, calcBoxDelta, calcLength, calcRelativeAxis, calcRelativeAxisPosition, calcRelativeBox, calcRelativePosition, isNear } from './projection/geometry/delta-calc.mjs'; -export { removeAxisDelta, removeAxisTransforms, removeBoxTransforms, removePointDelta } from './projection/geometry/delta-remove.mjs'; -export { createAxis, createAxisDelta, createBox, createDelta } from './projection/geometry/models.mjs'; -export { aspectRatio, axisDeltaEquals, axisEquals, axisEqualsRounded, boxEquals, boxEqualsRounded, isDeltaZero } from './projection/geometry/utils.mjs'; -export { eachAxis } from './projection/utils/each-axis.mjs'; -export { has2DTranslate, hasScale, hasTransform } from './projection/utils/has-transform.mjs'; -export { measurePageBox, measureViewportBox } from './projection/utils/measure.mjs'; -export { correctBorderRadius, pixelsToPercent } from './projection/styles/scale-border-radius.mjs'; -export { correctBoxShadow } from './projection/styles/scale-box-shadow.mjs'; -export { buildProjectionTransform } from './projection/styles/transform.mjs'; -export { mixValues } from './projection/animation/mix-values.mjs'; -export { animateSingleValue } from './animation/animate/single-value.mjs'; -export { addDomEvent } from './events/add-dom-event.mjs'; -export { compareByDepth } from './projection/utils/compare-by-depth.mjs'; -export { FlatTree } from './projection/utils/flat-tree.mjs'; -export { delay, delayInSeconds } from './utils/delay.mjs'; -export { resolveMotionValue } from './value/utils/resolve-motion-value.mjs'; -export { cleanDirtyNodes, createProjectionNode, propagateDirtyNodes } from './projection/node/create-projection-node.mjs'; -export { DocumentProjectionNode } from './projection/node/DocumentProjectionNode.mjs'; -export { nodeGroup } from './projection/node/group.mjs'; -export { HTMLProjectionNode, rootProjectionNode } from './projection/node/HTMLProjectionNode.mjs'; -export { globalProjectionState } from './projection/node/state.mjs'; -export { NodeStack } from './projection/shared/stack.mjs'; -export { camelToDash } from './render/dom/utils/camel-to-dash.mjs'; -export { buildHTMLStyles } from './render/html/utils/build-styles.mjs'; -export { buildTransform } from './render/html/utils/build-transform.mjs'; -export { renderHTML } from './render/html/utils/render.mjs'; -export { scrapeMotionValuesFromProps as scrapeHTMLMotionValuesFromProps } from './render/html/utils/scrape-motion-values.mjs'; -export { buildSVGAttrs } from './render/svg/utils/build-attrs.mjs'; -export { camelCaseAttributes } from './render/svg/utils/camel-case-attrs.mjs'; -export { isSVGTag } from './render/svg/utils/is-svg-tag.mjs'; -export { buildSVGPath } from './render/svg/utils/path.mjs'; -export { renderSVG } from './render/svg/utils/render.mjs'; -export { scrapeMotionValuesFromProps as scrapeSVGMotionValuesFromProps } from './render/svg/utils/scrape-motion-values.mjs'; -export { LayoutAnimationBuilder, parseAnimateLayoutArgs } from './layout/LayoutAnimationBuilder.mjs'; -export { cancelSync, sync } from './frameloop/index-legacy.mjs'; -export { addScaleCorrector, scaleCorrectors } from './projection/styles/scale-correction.mjs'; -export { cancelFrame, frame, frameData, frameSteps } from './frameloop/frame.mjs'; -export { hasReducedMotionListener, prefersReducedMotion } from './render/utils/reduced-motion/state.mjs'; -//# sourceMappingURL=index.mjs.map diff --git a/node_modules/motion-dom/dist/es/index.mjs.map b/node_modules/motion-dom/dist/es/index.mjs.map deleted file mode 100644 index 0dd9c36..0000000 --- a/node_modules/motion-dom/dist/es/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/layout/LayoutAnimationBuilder.mjs b/node_modules/motion-dom/dist/es/layout/LayoutAnimationBuilder.mjs deleted file mode 100644 index 1a7c533..0000000 --- a/node_modules/motion-dom/dist/es/layout/LayoutAnimationBuilder.mjs +++ /dev/null @@ -1,354 +0,0 @@ -import { clamp } from 'motion-utils'; -import { GroupAnimation } from '../animation/GroupAnimation.mjs'; -import { microtask } from '../frameloop/microtask.mjs'; -import { time } from '../frameloop/sync-time.mjs'; -import { HTMLProjectionNode } from '../projection/node/HTMLProjectionNode.mjs'; -import { HTMLVisualElement } from '../render/html/HTMLVisualElement.mjs'; -import { visualElementStore } from '../render/store.mjs'; -import { hasTransform } from '../projection/utils/has-transform.mjs'; -import { resolveElements } from '../utils/resolve-elements.mjs'; -import { frameData, frameSteps } from '../frameloop/frame.mjs'; - -const layoutSelector = "[data-layout],[data-layout-id]"; -/** - * All imperatively-created projection nodes live in one persistent tree, - * shared across animateLayout() calls (and with any React-created nodes, - * via the singleton document root). Keyed by element for reuse. - */ -const layoutNodes = new WeakMap(); -/** - * Builders created within the same synchronous tick are flushed together - * as a single "commit": every node is snapshotted before any updateDom - * runs, mirroring React batching renders from different parts of the tree. - */ -let pendingBuilders; -function collectLayoutElements(scope) { - const elements = []; - if (scope instanceof HTMLElement && scope.matches(layoutSelector)) { - elements.push(scope); - } - scope.querySelectorAll(layoutSelector).forEach((element) => { - if (element instanceof HTMLElement) - elements.push(element); - }); - return elements; -} -/** - * Process any work scheduled on the frameloop now. A previous animation - * may have been seeked while paused (controls.time = x) without a frame - * having rendered it - we must materialise that state into the DOM - * before taking snapshots. - */ -function flushPendingFrame() { - if (frameData.isProcessing) - return; - const now = time.now(); - frameData.delta = clamp(0, 1000 / 60, now - frameData.timestamp); - frameData.timestamp = now; - frameData.isProcessing = true; - frameSteps.update.process(frameData); - frameSteps.preRender.process(frameData); - frameSteps.render.process(frameData); - frameData.isProcessing = false; -} -function getProjectionParent(element) { - let ancestor = element.parentElement; - while (ancestor) { - const node = layoutNodes.get(ancestor); - if (node && node.instance) - return node; - ancestor = ancestor.parentElement; - } - return undefined; -} -function createVisualElement() { - return new HTMLVisualElement({ - props: {}, - presenceContext: null, - visualState: { - latestValues: {}, - renderState: { - transform: {}, - transformOrigin: {}, - style: {}, - vars: {}, - }, - }, - }, { allowProjection: true }); -} -function readNodeOptions(element, transition) { - const layoutAttr = element.getAttribute("data-layout"); - const layoutId = element.getAttribute("data-layout-id") ?? undefined; - return { - layoutId, - layout: layoutAttr !== null ? true : undefined, - animationType: (!layoutAttr || layoutAttr === "true" - ? "both" - : layoutAttr), - transition, - }; -} -function prepareNode(element, transition) { - let node = layoutNodes.get(element); - if (!node) { - let visualElement = visualElementStore.get(element); - if (!visualElement) - visualElement = createVisualElement(); - /** - * A first-time element may carry a projection transform in its - * inline style (e.g. it was cloned from an element mid-animation). - * That transform isn't tracked in latestValues so the engine can't - * reset it before measuring - clear it now so the first layout - * measurement isn't inflated. - */ - if (element.style.transform && - !hasTransform(visualElement.latestValues)) { - element.style.transform = ""; - } - node = new HTMLProjectionNode(visualElement.latestValues, getProjectionParent(element)); - visualElement.projection = node; - node.setOptions({ - ...readNodeOptions(element, transition), - visualElement, - }); - node.mount(element); - layoutNodes.set(element, node); - } - else { - node.setOptions(readNodeOptions(element, transition)); - } - node.isPresent = true; - if (node.options.onExitComplete) { - node.setOptions({ onExitComplete: undefined }); - } - return node; -} -function sortDocumentOrder(elements) { - return [...elements].sort((a, b) => a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1); -} -function dropNode(element, node) { - node.setOptions({ onExitComplete: undefined }); - /** - * Stop any lingering animation so it can't leak into future updates. - * A follow node can share its currentAnimation with a surviving lead - * (via resumingFrom), in which case it isn't ours to stop. - */ - const stack = node.getStack(); - if (!stack || node.isLead()) - node.currentAnimation?.stop(); - node.unmount(); - layoutNodes.delete(element); -} -function flushPendingBuilders() { - const builders = pendingBuilders; - pendingBuilders = undefined; - flushPendingFrame(); - /** - * Discover and mount every node across all builders before snapshotting - * any of them. Mounting during an active update flags isLayoutDirty, - * which would make that node's own willUpdate skip its snapshot. - * Document order guarantees ancestors mount before descendants, even - * when they're discovered by different builders. - */ - const targets = new Map(); - for (const builder of builders) { - for (const element of builder.collectTargets()) { - const owners = targets.get(element); - owners ? owners.push(builder) : targets.set(element, [builder]); - } - } - const union = new Map(); - for (const element of sortDocumentOrder(targets.keys())) { - const owners = targets.get(element); - const node = prepareNode(element, owners[owners.length - 1].transitionFor(element)); - for (const owner of owners) - owner.adopt(element, node); - union.set(element, node); - } - union.forEach((node) => { - node.isLayoutDirty = false; - node.willUpdate(); - }); - const updatePromises = []; - for (const builder of builders) { - const result = builder.runUpdate(); - if (result) - updatePromises.push(result); - } - const commit = () => { - /** - * Process all additions before any removals so that, even across - * builders, a removed member knows whether a replacement with the - * same layoutId was added in this commit. - */ - const newMemberIds = new Set(); - for (const builder of builders) { - builder.reconcileAdditions(newMemberIds); - } - for (const builder of builders) { - builder.reconcileRemovals(newMemberIds); - } - let root; - union.forEach((node) => (root || (root = node.root))); - for (const builder of builders) - root || (root = builder.getRoot()); - root?.didUpdate(); - /** - * The root flushes the update on a microtask, synchronously - * processing the frame that creates the layout animations. Collect - * them in a later microtask step of the same pass. - */ - microtask.render(() => { - for (const builder of builders) - builder.finalize(); - }); - }; - updatePromises.length ? Promise.all(updatePromises).then(commit) : commit(); -} -class LayoutAnimationBuilder { - constructor(scope, updateDom, defaultOptions) { - this.scope = scope; - this.updateDom = updateDom; - this.defaultOptions = defaultOptions; - this.sharedTransitions = new Map(); - this.notifyReady = () => { }; - this.rejectReady = () => { }; - this.tracked = new Map(); - this.restorePoints = new Map(); - this.readyPromise = new Promise((resolve, reject) => { - this.notifyReady = resolve; - this.rejectReady = reject; - }); - if (!pendingBuilders) { - pendingBuilders = []; - queueMicrotask(flushPendingBuilders); - } - pendingBuilders.push(this); - } - shared(id, transition) { - this.sharedTransitions.set(id, transition); - return this; - } - then(resolve, reject) { - return this.readyPromise.then(resolve, reject); - } - transitionFor(element) { - const layoutId = element.getAttribute("data-layout-id"); - return ((layoutId && this.sharedTransitions.get(layoutId)) || - this.defaultOptions); - } - adopt(element, node) { - this.tracked.set(element, node); - this.restorePoints.set(element, { - parent: element.parentElement, - next: element.nextSibling, - }); - } - collectTargets() { - return collectLayoutElements(this.scope); - } - runUpdate() { - try { - const result = this.updateDom(); - if (result && typeof result.then === "function") { - return result.then(undefined, (error) => { - this.updateError = error; - }); - } - } - catch (error) { - this.updateError = error; - } - return undefined; - } - reconcileAdditions(newMemberIds) { - for (const element of collectLayoutElements(this.scope)) { - if (this.tracked.has(element)) - continue; - const node = prepareNode(element, this.transitionFor(element)); - this.adopt(element, node); - node.options.layoutId && newMemberIds.add(node.options.layoutId); - } - } - reconcileRemovals(newMemberIds) { - this.tracked.forEach((node, element) => { - if (element.isConnected) - return; - const restore = this.restorePoints.get(element); - this.restorePoints.delete(element); - const { layoutId } = node.options; - const stack = node.getStack(); - const hasSurvivor = stack && - stack.members.some((member) => member !== node && - member.instance - ?.isConnected); - /** - * A removed lead with a surviving stack member - and no - * replacement member added this commit - runs an exit - * crossfade: restore the element to its old position in the - * DOM, relegate it and let the survivor take over. It's - * removed again once the animation completes. - */ - if (layoutId && - node.isLead() && - hasSurvivor && - !newMemberIds.has(layoutId)) { - if (restore && restore.parent.isConnected) { - restore.parent.insertBefore(element, restore.next && restore.next.parentNode === restore.parent - ? restore.next - : null); - node.isPresent = false; - node.setOptions({ - onExitComplete: () => { - element.remove(); - dropNode(element, node); - }, - }); - if (node.relegate()) - return; - element.remove(); - } - } - dropNode(element, node); - this.tracked.delete(element); - }); - } - getRoot() { - let root; - this.tracked.forEach((node) => (root || (root = node.root))); - return root; - } - finalize() { - if (this.updateError) { - this.rejectReady(this.updateError); - return; - } - const animations = new Set(); - this.tracked.forEach((node) => { - if (node.instance && node.currentAnimation) { - animations.add(node.currentAnimation); - } - }); - this.notifyReady(new GroupAnimation([...animations])); - } -} -function parseAnimateLayoutArgs(scopeOrUpdateDom, updateDomOrOptions, options) { - if (typeof scopeOrUpdateDom === "function") { - return { - scope: document, - updateDom: scopeOrUpdateDom, - defaultOptions: updateDomOrOptions, - }; - } - const scope = scopeOrUpdateDom instanceof Document - ? scopeOrUpdateDom - : resolveElements(scopeOrUpdateDom)[0] ?? document; - return { - scope, - updateDom: updateDomOrOptions, - defaultOptions: options, - }; -} - -export { LayoutAnimationBuilder, parseAnimateLayoutArgs }; -//# sourceMappingURL=LayoutAnimationBuilder.mjs.map diff --git a/node_modules/motion-dom/dist/es/layout/LayoutAnimationBuilder.mjs.map b/node_modules/motion-dom/dist/es/layout/LayoutAnimationBuilder.mjs.map deleted file mode 100644 index 7189e3f..0000000 --- a/node_modules/motion-dom/dist/es/layout/LayoutAnimationBuilder.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"LayoutAnimationBuilder.mjs","sources":["../../../src/layout/LayoutAnimationBuilder.ts"],"sourcesContent":["import { clamp } from \"motion-utils\"\nimport { GroupAnimation } from \"../animation/GroupAnimation\"\nimport type { AnimationOptions, Transition } from \"../animation/types\"\nimport { frameData, frameSteps } from \"../frameloop\"\nimport { microtask } from \"../frameloop/microtask\"\nimport { time } from \"../frameloop/sync-time\"\nimport { HTMLProjectionNode } from \"../projection/node/HTMLProjectionNode\"\nimport type { IProjectionNode } from \"../projection/node/types\"\nimport { HTMLVisualElement } from \"../render/html/HTMLVisualElement\"\nimport { visualElementStore } from \"../render/store\"\nimport { hasTransform } from \"../projection/utils/has-transform\"\nimport {\n resolveElements,\n type ElementOrSelector,\n} from \"../utils/resolve-elements\"\n\ntype LayoutAnimationScope = Element | Document\ntype LayoutBuilderResolve = (animation: GroupAnimation) => void\ntype LayoutBuilderReject = (error: unknown) => void\n\ninterface RestorePoint {\n parent: Element\n next: ChildNode | null\n}\n\nconst layoutSelector = \"[data-layout],[data-layout-id]\"\n\n/**\n * All imperatively-created projection nodes live in one persistent tree,\n * shared across animateLayout() calls (and with any React-created nodes,\n * via the singleton document root). Keyed by element for reuse.\n */\nconst layoutNodes = new WeakMap()\n\n/**\n * Builders created within the same synchronous tick are flushed together\n * as a single \"commit\": every node is snapshotted before any updateDom\n * runs, mirroring React batching renders from different parts of the tree.\n */\nlet pendingBuilders: LayoutAnimationBuilder[] | undefined\n\nfunction collectLayoutElements(scope: LayoutAnimationScope): HTMLElement[] {\n const elements: HTMLElement[] = []\n\n if (scope instanceof HTMLElement && scope.matches(layoutSelector)) {\n elements.push(scope)\n }\n\n scope.querySelectorAll(layoutSelector).forEach((element) => {\n if (element instanceof HTMLElement) elements.push(element)\n })\n\n return elements\n}\n\n/**\n * Process any work scheduled on the frameloop now. A previous animation\n * may have been seeked while paused (controls.time = x) without a frame\n * having rendered it - we must materialise that state into the DOM\n * before taking snapshots.\n */\nfunction flushPendingFrame() {\n if (frameData.isProcessing) return\n\n const now = time.now()\n frameData.delta = clamp(0, 1000 / 60, now - frameData.timestamp)\n frameData.timestamp = now\n frameData.isProcessing = true\n frameSteps.update.process(frameData)\n frameSteps.preRender.process(frameData)\n frameSteps.render.process(frameData)\n frameData.isProcessing = false\n}\n\nfunction getProjectionParent(element: Element): IProjectionNode | undefined {\n let ancestor = element.parentElement\n while (ancestor) {\n const node = layoutNodes.get(ancestor)\n if (node && node.instance) return node\n ancestor = ancestor.parentElement\n }\n return undefined\n}\n\nfunction createVisualElement() {\n return new HTMLVisualElement(\n {\n props: {},\n presenceContext: null,\n visualState: {\n latestValues: {},\n renderState: {\n transform: {},\n transformOrigin: {},\n style: {},\n vars: {},\n },\n },\n },\n { allowProjection: true }\n )\n}\n\nfunction readNodeOptions(element: HTMLElement, transition?: Transition) {\n const layoutAttr = element.getAttribute(\"data-layout\")\n const layoutId = element.getAttribute(\"data-layout-id\") ?? undefined\n\n return {\n layoutId,\n layout: layoutAttr !== null ? true : undefined,\n animationType: (!layoutAttr || layoutAttr === \"true\"\n ? \"both\"\n : layoutAttr) as \"both\",\n transition,\n }\n}\n\nfunction prepareNode(\n element: HTMLElement,\n transition?: Transition\n): IProjectionNode {\n let node = layoutNodes.get(element)\n\n if (!node) {\n let visualElement = visualElementStore.get(element) as\n | HTMLVisualElement\n | undefined\n\n if (!visualElement) visualElement = createVisualElement()\n\n /**\n * A first-time element may carry a projection transform in its\n * inline style (e.g. it was cloned from an element mid-animation).\n * That transform isn't tracked in latestValues so the engine can't\n * reset it before measuring - clear it now so the first layout\n * measurement isn't inflated.\n */\n if (\n element.style.transform &&\n !hasTransform(visualElement.latestValues)\n ) {\n element.style.transform = \"\"\n }\n\n node = new HTMLProjectionNode(\n visualElement.latestValues,\n getProjectionParent(element)\n )\n visualElement.projection = node\n\n node.setOptions({\n ...readNodeOptions(element, transition),\n visualElement,\n })\n node.mount(element)\n layoutNodes.set(element, node)\n } else {\n node.setOptions(readNodeOptions(element, transition))\n }\n\n node.isPresent = true\n if (node.options.onExitComplete) {\n node.setOptions({ onExitComplete: undefined })\n }\n\n return node\n}\n\nfunction sortDocumentOrder(elements: Iterable) {\n return [...elements].sort((a, b) =>\n a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1\n )\n}\n\nfunction dropNode(element: Element, node: IProjectionNode) {\n node.setOptions({ onExitComplete: undefined })\n\n /**\n * Stop any lingering animation so it can't leak into future updates.\n * A follow node can share its currentAnimation with a surviving lead\n * (via resumingFrom), in which case it isn't ours to stop.\n */\n const stack = node.getStack()\n if (!stack || node.isLead()) node.currentAnimation?.stop()\n\n node.unmount()\n layoutNodes.delete(element)\n}\n\nfunction flushPendingBuilders() {\n const builders = pendingBuilders!\n pendingBuilders = undefined\n\n flushPendingFrame()\n\n /**\n * Discover and mount every node across all builders before snapshotting\n * any of them. Mounting during an active update flags isLayoutDirty,\n * which would make that node's own willUpdate skip its snapshot.\n * Document order guarantees ancestors mount before descendants, even\n * when they're discovered by different builders.\n */\n const targets = new Map()\n for (const builder of builders) {\n for (const element of builder.collectTargets()) {\n const owners = targets.get(element)\n owners ? owners.push(builder) : targets.set(element, [builder])\n }\n }\n\n const union = new Map()\n for (const element of sortDocumentOrder(targets.keys())) {\n const owners = targets.get(element)!\n const node = prepareNode(\n element,\n owners[owners.length - 1].transitionFor(element)\n )\n for (const owner of owners) owner.adopt(element, node)\n union.set(element, node)\n }\n\n union.forEach((node) => {\n node.isLayoutDirty = false\n node.willUpdate()\n })\n\n const updatePromises: Promise[] = []\n for (const builder of builders) {\n const result = builder.runUpdate()\n if (result) updatePromises.push(result)\n }\n\n const commit = () => {\n /**\n * Process all additions before any removals so that, even across\n * builders, a removed member knows whether a replacement with the\n * same layoutId was added in this commit.\n */\n const newMemberIds = new Set()\n for (const builder of builders) {\n builder.reconcileAdditions(newMemberIds)\n }\n for (const builder of builders) {\n builder.reconcileRemovals(newMemberIds)\n }\n\n let root: IProjectionNode | undefined\n union.forEach((node) => (root ||= node.root))\n for (const builder of builders) root ||= builder.getRoot()\n\n root?.didUpdate()\n\n /**\n * The root flushes the update on a microtask, synchronously\n * processing the frame that creates the layout animations. Collect\n * them in a later microtask step of the same pass.\n */\n microtask.render(() => {\n for (const builder of builders) builder.finalize()\n })\n }\n\n updatePromises.length ? Promise.all(updatePromises).then(commit) : commit()\n}\n\nexport class LayoutAnimationBuilder {\n private sharedTransitions = new Map()\n\n private notifyReady: LayoutBuilderResolve = () => {}\n private rejectReady: LayoutBuilderReject = () => {}\n private readyPromise: Promise\n\n private tracked = new Map()\n private restorePoints = new Map()\n private updateError: unknown\n\n constructor(\n private scope: LayoutAnimationScope,\n private updateDom: () => void | Promise,\n private defaultOptions?: AnimationOptions\n ) {\n this.readyPromise = new Promise((resolve, reject) => {\n this.notifyReady = resolve\n this.rejectReady = reject\n })\n\n if (!pendingBuilders) {\n pendingBuilders = []\n queueMicrotask(flushPendingBuilders)\n }\n pendingBuilders.push(this)\n }\n\n shared(id: string, transition: AnimationOptions): this {\n this.sharedTransitions.set(id, transition)\n return this\n }\n\n then(resolve: LayoutBuilderResolve, reject?: LayoutBuilderReject) {\n return this.readyPromise.then(resolve, reject)\n }\n\n transitionFor(element: HTMLElement): Transition | undefined {\n const layoutId = element.getAttribute(\"data-layout-id\")\n return ((layoutId && this.sharedTransitions.get(layoutId)) ||\n this.defaultOptions) as Transition | undefined\n }\n\n adopt(element: HTMLElement, node: IProjectionNode) {\n this.tracked.set(element, node)\n this.restorePoints.set(element, {\n parent: element.parentElement!,\n next: element.nextSibling,\n })\n }\n\n collectTargets() {\n return collectLayoutElements(this.scope)\n }\n\n runUpdate(): Promise | undefined {\n try {\n const result = this.updateDom()\n if (result && typeof result.then === \"function\") {\n return result.then(undefined, (error: unknown) => {\n this.updateError = error\n })\n }\n } catch (error) {\n this.updateError = error\n }\n return undefined\n }\n\n reconcileAdditions(newMemberIds: Set) {\n for (const element of collectLayoutElements(this.scope)) {\n if (this.tracked.has(element)) continue\n const node = prepareNode(element, this.transitionFor(element))\n this.adopt(element, node)\n node.options.layoutId && newMemberIds.add(node.options.layoutId)\n }\n }\n\n reconcileRemovals(newMemberIds: Set) {\n this.tracked.forEach((node, element) => {\n if (element.isConnected) return\n\n const restore = this.restorePoints.get(element)\n this.restorePoints.delete(element)\n\n const { layoutId } = node.options\n const stack = node.getStack()\n const hasSurvivor =\n stack &&\n stack.members.some(\n (member) =>\n member !== node &&\n (member.instance as HTMLElement | undefined)\n ?.isConnected\n )\n\n /**\n * A removed lead with a surviving stack member - and no\n * replacement member added this commit - runs an exit\n * crossfade: restore the element to its old position in the\n * DOM, relegate it and let the survivor take over. It's\n * removed again once the animation completes.\n */\n if (\n layoutId &&\n node.isLead() &&\n hasSurvivor &&\n !newMemberIds.has(layoutId)\n ) {\n if (restore && restore.parent.isConnected) {\n restore.parent.insertBefore(\n element,\n restore.next && restore.next.parentNode === restore.parent\n ? restore.next\n : null\n )\n node.isPresent = false\n node.setOptions({\n onExitComplete: () => {\n element.remove()\n dropNode(element, node)\n },\n })\n if (node.relegate()) return\n\n element.remove()\n }\n }\n\n dropNode(element, node)\n this.tracked.delete(element)\n })\n }\n\n getRoot(): IProjectionNode | undefined {\n let root: IProjectionNode | undefined\n this.tracked.forEach((node) => (root ||= node.root))\n return root\n }\n\n finalize() {\n if (this.updateError) {\n this.rejectReady(this.updateError)\n return\n }\n\n const animations = new Set()\n this.tracked.forEach((node) => {\n if (node.instance && node.currentAnimation) {\n animations.add(node.currentAnimation)\n }\n })\n\n this.notifyReady(new GroupAnimation([...animations]))\n }\n}\n\nexport function parseAnimateLayoutArgs(\n scopeOrUpdateDom: ElementOrSelector | (() => void),\n updateDomOrOptions?: (() => void) | AnimationOptions,\n options?: AnimationOptions\n): {\n scope: Element | Document\n updateDom: () => void\n defaultOptions?: AnimationOptions\n} {\n if (typeof scopeOrUpdateDom === \"function\") {\n return {\n scope: document,\n updateDom: scopeOrUpdateDom,\n defaultOptions: updateDomOrOptions as AnimationOptions | undefined,\n }\n }\n\n const scope =\n scopeOrUpdateDom instanceof Document\n ? scopeOrUpdateDom\n : resolveElements(scopeOrUpdateDom)[0] ?? document\n\n return {\n scope,\n updateDom: updateDomOrOptions as () => void,\n defaultOptions: options,\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAyBA,MAAM,cAAc,GAAG,gCAAgC;AAEvD;;;;AAIG;AACH,MAAM,WAAW,GAAG,IAAI,OAAO,EAA4B;AAE3D;;;;AAIG;AACH,IAAI,eAAqD;AAEzD,SAAS,qBAAqB,CAAC,KAA2B,EAAA;IACtD,MAAM,QAAQ,GAAkB,EAAE;IAElC,IAAI,KAAK,YAAY,WAAW,IAAI,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE;AAC/D,QAAA,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC;IACxB;IAEA,KAAK,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,KAAI;QACvD,IAAI,OAAO,YAAY,WAAW;AAAE,YAAA,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC;AAC9D,IAAA,CAAC,CAAC;AAEF,IAAA,OAAO,QAAQ;AACnB;AAEA;;;;;AAKG;AACH,SAAS,iBAAiB,GAAA;IACtB,IAAI,SAAS,CAAC,YAAY;QAAE;AAE5B,IAAA,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE;AACtB,IAAA,SAAS,CAAC,KAAK,GAAG,KAAK,CAAC,CAAC,EAAE,IAAI,GAAG,EAAE,EAAE,GAAG,GAAG,SAAS,CAAC,SAAS,CAAC;AAChE,IAAA,SAAS,CAAC,SAAS,GAAG,GAAG;AACzB,IAAA,SAAS,CAAC,YAAY,GAA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CAAC,CAAC;IACzD;AACH;SAEe,sBAAsB,CAClC,gBAAkD,EAClD,kBAAoD,EACpD,OAA0B,EAAA;AAM1B,IAAA,IAAI,OAAO,gBAAgB,KAAK,UAAU,EAAE;QACxC,OAAO;AACH,YAAA,KAAK,EAAE,QAAQ;AACf,YAAA,SAAS,EAAE,gBAAgB;AAC3B,YAAA,cAAc,EAAE,kBAAkD;SACrE;IACL;AAEA,IAAA,MAAM,KAAK,GACP,gBAAgB,YAAY;AACxB,UAAE;UACA,eAAe,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,IAAI,QAAQ;IAE1D,OAAO;QACH,KAAK;AACL,QAAA,SAAS,EAAE,kBAAgC;AAC3C,QAAA,cAAc,EAAE,OAAO;KAC1B;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/projection/animation/mix-values.mjs b/node_modules/motion-dom/dist/es/projection/animation/mix-values.mjs deleted file mode 100644 index c336f1f..0000000 --- a/node_modules/motion-dom/dist/es/projection/animation/mix-values.mjs +++ /dev/null @@ -1,67 +0,0 @@ -import { mixNumber } from '../../utils/mix/number.mjs'; -import { percent, px } from '../../value/types/numbers/units.mjs'; -import { progress, circOut, noop } from 'motion-utils'; -import { cornerRadiusProps } from '../../utils/border-radius.mjs'; - -const numBorders = cornerRadiusProps.length; -const asNumber = (value) => typeof value === "string" ? parseFloat(value) : value; -const isPx = (value) => typeof value === "number" || px.test(value); -function mixValues(target, follow, lead, progress, shouldCrossfadeOpacity, isOnlyMember) { - if (shouldCrossfadeOpacity) { - target.opacity = mixNumber(0, lead.opacity ?? 1, easeCrossfadeIn(progress)); - target.opacityExit = mixNumber(follow.opacity ?? 1, 0, easeCrossfadeOut(progress)); - } - else if (isOnlyMember) { - target.opacity = mixNumber(follow.opacity ?? 1, lead.opacity ?? 1, progress); - } - /** - * Mix border radius - */ - for (let i = 0; i < numBorders; i++) { - const borderLabel = cornerRadiusProps[i]; - let followRadius = getRadius(follow, borderLabel); - let leadRadius = getRadius(lead, borderLabel); - if (followRadius === undefined && leadRadius === undefined) - continue; - followRadius || (followRadius = 0); - leadRadius || (leadRadius = 0); - const canMix = followRadius === 0 || - leadRadius === 0 || - isPx(followRadius) === isPx(leadRadius); - if (canMix) { - target[borderLabel] = Math.max(mixNumber(asNumber(followRadius), asNumber(leadRadius), progress), 0); - if (percent.test(leadRadius) || percent.test(followRadius)) { - target[borderLabel] += "%"; - } - } - else { - target[borderLabel] = leadRadius; - } - } - /** - * Mix rotation - */ - if (follow.rotate || lead.rotate) { - target.rotate = mixNumber(follow.rotate || 0, lead.rotate || 0, progress); - } -} -function getRadius(values, radiusName) { - return values[radiusName] !== undefined - ? values[radiusName] - : values.borderRadius; -} -const easeCrossfadeIn = /*@__PURE__*/ compress(0, 0.5, circOut); -const easeCrossfadeOut = /*@__PURE__*/ compress(0.5, 0.95, noop); -function compress(min, max, easing) { - return (p) => { - // Could replace ifs with clamp - if (p < min) - return 0; - if (p > max) - return 1; - return easing(progress(min, max, p)); - }; -} - -export { mixValues }; -//# sourceMappingURL=mix-values.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/animation/mix-values.mjs.map b/node_modules/motion-dom/dist/es/projection/animation/mix-values.mjs.map deleted file mode 100644 index 4559e57..0000000 --- a/node_modules/motion-dom/dist/es/projection/animation/mix-values.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mix-values.mjs","sources":["../../../../src/projection/animation/mix-values.ts"],"sourcesContent":["import { mixNumber } from \"../../utils/mix/number\"\nimport { percent, px } from \"../../value/types/numbers/units\"\nimport type { AnyResolvedKeyframe } from \"../../animation/types\"\nimport {\n progress as calcProgress,\n circOut,\n EasingFunction,\n noop,\n} from \"motion-utils\"\nimport type { ResolvedValues } from \"../../node/types\"\nimport { cornerRadiusProps } from \"../../utils/border-radius\"\n\nconst numBorders = cornerRadiusProps.length\n\nconst asNumber = (value: AnyResolvedKeyframe) =>\n typeof value === \"string\" ? parseFloat(value) : value\n\nconst isPx = (value: AnyResolvedKeyframe) =>\n typeof value === \"number\" || px.test(value)\n\nexport function mixValues(\n target: ResolvedValues,\n follow: ResolvedValues,\n lead: ResolvedValues,\n progress: number,\n shouldCrossfadeOpacity: boolean,\n isOnlyMember: boolean\n) {\n if (shouldCrossfadeOpacity) {\n target.opacity = mixNumber(\n 0,\n (lead.opacity as number) ?? 1,\n easeCrossfadeIn(progress)\n )\n target.opacityExit = mixNumber(\n (follow.opacity as number) ?? 1,\n 0,\n easeCrossfadeOut(progress)\n )\n } else if (isOnlyMember) {\n target.opacity = mixNumber(\n (follow.opacity as number) ?? 1,\n (lead.opacity as number) ?? 1,\n progress\n )\n }\n\n /**\n * Mix border radius\n */\n for (let i = 0; i < numBorders; i++) {\n const borderLabel = cornerRadiusProps[i]\n let followRadius = getRadius(follow, borderLabel)\n let leadRadius = getRadius(lead, borderLabel)\n\n if (followRadius === undefined && leadRadius === undefined) continue\n\n followRadius ||= 0\n leadRadius ||= 0\n\n const canMix =\n followRadius === 0 ||\n leadRadius === 0 ||\n isPx(followRadius) === isPx(leadRadius)\n\n if (canMix) {\n target[borderLabel] = Math.max(\n mixNumber(\n asNumber(followRadius),\n asNumber(leadRadius),\n progress\n ),\n 0\n )\n\n if (percent.test(leadRadius) || percent.test(followRadius)) {\n target[borderLabel] += \"%\"\n }\n } else {\n target[borderLabel] = leadRadius\n }\n }\n\n /**\n * Mix rotation\n */\n if (follow.rotate || lead.rotate) {\n target.rotate = mixNumber(\n (follow.rotate as number) || 0,\n (lead.rotate as number) || 0,\n progress\n )\n }\n}\n\nfunction getRadius(values: ResolvedValues, radiusName: string) {\n return values[radiusName] !== undefined\n ? values[radiusName]\n : values.borderRadius\n}\n\nconst easeCrossfadeIn = /*@__PURE__*/ compress(0, 0.5, circOut)\nconst easeCrossfadeOut = /*@__PURE__*/ compress(0.5, 0.95, noop)\n\nfunction compress(\n min: number,\n max: number,\n easing: EasingFunction\n): EasingFunction {\n return (p: number) => {\n // Could replace ifs with clamp\n if (p < min) return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S,QAAQ,CACb,GAAW,EACX,GAAW,EACX,MAAsB,EAAA;IAEtB,OAAO,CAAC,CAAS,KAAI;;QAEjB,IAAI,CAAC,GAAG,GAAG;AAAE,YAAA,OAAO,CAAC;QACrB,IAAI,CAAC,GAAG,GAAG;AAAE,YAAA,OAAO,CAAC;QACrB,OAAO,MAAM,CAACA,QAAY,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;AAC5C,IAAA,CAAC;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/projection/geometry/conversion.mjs b/node_modules/motion-dom/dist/es/projection/geometry/conversion.mjs deleted file mode 100644 index fa9b9a0..0000000 --- a/node_modules/motion-dom/dist/es/projection/geometry/conversion.mjs +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Bounding boxes tend to be defined as top, left, right, bottom. For various operations - * it's easier to consider each axis individually. This function returns a bounding box - * as a map of single-axis min/max values. - */ -function convertBoundingBoxToBox({ top, left, right, bottom, }) { - return { - x: { min: left, max: right }, - y: { min: top, max: bottom }, - }; -} -function convertBoxToBoundingBox({ x, y }) { - return { top: y.min, right: x.max, bottom: y.max, left: x.min }; -} -/** - * Applies a TransformPoint function to a bounding box. TransformPoint is usually a function - * provided by Framer to allow measured points to be corrected for device scaling. This is used - * when measuring DOM elements and DOM event points. - */ -function transformBoxPoints(point, transformPoint) { - if (!transformPoint) - return point; - const topLeft = transformPoint({ x: point.left, y: point.top }); - const bottomRight = transformPoint({ x: point.right, y: point.bottom }); - return { - top: topLeft.y, - left: topLeft.x, - bottom: bottomRight.y, - right: bottomRight.x, - }; -} - -export { convertBoundingBoxToBox, convertBoxToBoundingBox, transformBoxPoints }; -//# sourceMappingURL=conversion.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/geometry/conversion.mjs.map b/node_modules/motion-dom/dist/es/projection/geometry/conversion.mjs.map deleted file mode 100644 index 6d31dea..0000000 --- a/node_modules/motion-dom/dist/es/projection/geometry/conversion.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"conversion.mjs","sources":["../../../../src/projection/geometry/conversion.ts"],"sourcesContent":["import { BoundingBox, Box, TransformPoint } from \"motion-utils\"\n\n/**\n * Bounding boxes tend to be defined as top, left, right, bottom. For various operations\n * it's easier to consider each axis individually. This function returns a bounding box\n * as a map of single-axis min/max values.\n */\nexport function convertBoundingBoxToBox({\n top,\n left,\n right,\n bottom,\n}: BoundingBox): Box {\n return {\n x: { min: left, max: right },\n y: { min: top, max: bottom },\n }\n}\n\nexport function convertBoxToBoundingBox({ x, y }: Box): BoundingBox {\n return { top: y.min, right: x.max, bottom: y.max, left: x.min }\n}\n\n/**\n * Applies a TransformPoint function to a bounding box. TransformPoint is usually a function\n * provided by Framer to allow measured points to be corrected for device scaling. This is used\n * when measuring DOM elements and DOM event points.\n */\nexport function transformBoxPoints(\n point: BoundingBox,\n transformPoint?: TransformPoint\n) {\n if (!transformPoint) return point\n const topLeft = transformPoint({ x: point.left, y: point.top })\n const bottomRight = transformPoint({ x: point.right, y: point.bottom })\n\n return {\n top: topLeft.y,\n left: topLeft.x,\n bottom: bottomRight.y,\n right: bottomRight.x,\n }\n}\n"],"names":[],"mappings":"AAEA;;;;AAIG;AACG,SAAU,uBAAuB,CAAC,EACpC,GAAG,EACH,IAAI,EACJ,KAAK,EACL,MAAM,GACI,EAAA;IACV,OAAO;QACH,CAAC,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE;QAC5B,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE;KAC/B;AACL;SAEgB,uBAAuB,CAAC,EAAE,CAAC,EAAE,CAAC,EAAO,EAAA;IACjD,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,CAAC,CAAC,GAAG,EAAE,MAAM,EAAE,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,EAAE;AACnE;AAEA;;;;AAIG;AACG,SAAU,kBAAkB,CAC9B,KAAkB,EAClB,cAA+B,EAAA;AAE/B,IAAA,IAAI,CAAC,cAAc;AAAE,QAAA,OAAO,KAAK;AACjC,IAAA,MAAM,OAAO,GAAG,cAAc,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,CAAC,GAAG,EAAE,CAAC;AAC/D,IAAA,MAAM,WAAW,GAAG,cAAc,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC;IAEvE,OAAO;QACH,GAAG,EAAE,OAAO,CAAC,CAAC;QACd,IAAI,EAAE,OAAO,CAAC,CAAC;QACf,MAAM,EAAE,WAAW,CAAC,CAAC;QACrB,KAAK,EAAE,WAAW,CAAC,CAAC;KACvB;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/projection/geometry/copy.mjs b/node_modules/motion-dom/dist/es/projection/geometry/copy.mjs deleted file mode 100644 index 5269ba1..0000000 --- a/node_modules/motion-dom/dist/es/projection/geometry/copy.mjs +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Reset an axis to the provided origin box. - * - * This is a mutative operation. - */ -function copyAxisInto(axis, originAxis) { - axis.min = originAxis.min; - axis.max = originAxis.max; -} -/** - * Reset a box to the provided origin box. - * - * This is a mutative operation. - */ -function copyBoxInto(box, originBox) { - copyAxisInto(box.x, originBox.x); - copyAxisInto(box.y, originBox.y); -} -/** - * Reset a delta to the provided origin box. - * - * This is a mutative operation. - */ -function copyAxisDeltaInto(delta, originDelta) { - delta.translate = originDelta.translate; - delta.scale = originDelta.scale; - delta.originPoint = originDelta.originPoint; - delta.origin = originDelta.origin; -} - -export { copyAxisDeltaInto, copyAxisInto, copyBoxInto }; -//# sourceMappingURL=copy.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/geometry/copy.mjs.map b/node_modules/motion-dom/dist/es/projection/geometry/copy.mjs.map deleted file mode 100644 index 310e797..0000000 --- a/node_modules/motion-dom/dist/es/projection/geometry/copy.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"copy.mjs","sources":["../../../../src/projection/geometry/copy.ts"],"sourcesContent":["import { Axis, AxisDelta, Box } from \"motion-utils\"\n\n/**\n * Reset an axis to the provided origin box.\n *\n * This is a mutative operation.\n */\nexport function copyAxisInto(axis: Axis, originAxis: Axis) {\n axis.min = originAxis.min\n axis.max = originAxis.max\n}\n\n/**\n * Reset a box to the provided origin box.\n *\n * This is a mutative operation.\n */\nexport function copyBoxInto(box: Box, originBox: Box) {\n copyAxisInto(box.x, originBox.x)\n copyAxisInto(box.y, originBox.y)\n}\n\n/**\n * Reset a delta to the provided origin box.\n *\n * This is a mutative operation.\n */\nexport function copyAxisDeltaInto(delta: AxisDelta, originDelta: AxisDelta) {\n delta.translate = originDelta.translate\n delta.scale = originDelta.scale\n delta.originPoint = originDelta.originPoint\n delta.origin = originDelta.origin\n}\n"],"names":[],"mappings":"AAEA;;;;AAIG;AACG,SAAU,YAAY,CAAC,IAAU,EAAE,UAAgB,EAAA;AACrD,IAAA,IAAI,CAAC,GAAG,GAAG,UAAU,CAAC,GAAG;AACzB,IAAA,IAAI,CAAC,GAAG,GAAG,UAAU,CAAC,GAAG;AAC7B;AAEA;;;;AAIG;AACG,SAAU,WAAW,CAAC,GAAQ,EAAE,SAAc,EAAA;IAChD,YAAY,CAAC,GAAG,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC;IAChC,YAAY,CAAC,GAAG,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC;AACpC;AAEA;;;;AAIG;AACG,SAAU,iBAAiB,CAAC,KAAgB,EAAE,WAAsB,EAAA;AACtE,IAAA,KAAK,CAAC,SAAS,GAAG,WAAW,CAAC,SAAS;AACvC,IAAA,KAAK,CAAC,KAAK,GAAG,WAAW,CAAC,KAAK;AAC/B,IAAA,KAAK,CAAC,WAAW,GAAG,WAAW,CAAC,WAAW;AAC3C,IAAA,KAAK,CAAC,MAAM,GAAG,WAAW,CAAC,MAAM;AACrC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/projection/geometry/delta-apply.mjs b/node_modules/motion-dom/dist/es/projection/geometry/delta-apply.mjs deleted file mode 100644 index f60e7c8..0000000 --- a/node_modules/motion-dom/dist/es/projection/geometry/delta-apply.mjs +++ /dev/null @@ -1,125 +0,0 @@ -import { mixNumber } from '../../utils/mix/number.mjs'; -import { hasTransform } from '../utils/has-transform.mjs'; - -/** - * Scales a point based on a factor and an originPoint - */ -function scalePoint(point, scale, originPoint) { - const distanceFromOrigin = point - originPoint; - const scaled = scale * distanceFromOrigin; - return originPoint + scaled; -} -/** - * Applies a translate/scale delta to a point - */ -function applyPointDelta(point, translate, scale, originPoint, boxScale) { - if (boxScale !== undefined) { - point = scalePoint(point, boxScale, originPoint); - } - return scalePoint(point, scale, originPoint) + translate; -} -/** - * Applies a translate/scale delta to an axis - */ -function applyAxisDelta(axis, translate = 0, scale = 1, originPoint, boxScale) { - axis.min = applyPointDelta(axis.min, translate, scale, originPoint, boxScale); - axis.max = applyPointDelta(axis.max, translate, scale, originPoint, boxScale); -} -/** - * Applies a translate/scale delta to a box - */ -function applyBoxDelta(box, { x, y }) { - applyAxisDelta(box.x, x.translate, x.scale, x.originPoint); - applyAxisDelta(box.y, y.translate, y.scale, y.originPoint); -} -const TREE_SCALE_SNAP_MIN = 0.999999999999; -const TREE_SCALE_SNAP_MAX = 1.0000000000001; -/** - * Apply a tree of deltas to a box. We do this to calculate the effect of all the transforms - * in a tree upon our box before then calculating how to project it into our desired viewport-relative box - * - * This is the final nested loop within updateLayoutDelta for future refactoring - */ -function applyTreeDeltas(box, treeScale, treePath, isSharedTransition = false) { - const treeLength = treePath.length; - if (!treeLength) - return; - // Reset the treeScale - treeScale.x = treeScale.y = 1; - let node; - let delta; - for (let i = 0; i < treeLength; i++) { - node = treePath[i]; - delta = node.projectionDelta; - /** - * TODO: Prefer to remove this, but currently we have motion components with - * display: contents in Framer. - */ - const { visualElement } = node.options; - if (visualElement && - visualElement.props.style && - visualElement.props.style.display === "contents") { - continue; - } - if (isSharedTransition && - node.options.layoutScroll && - node.scroll && - node !== node.root) { - translateAxis(box.x, -node.scroll.offset.x); - translateAxis(box.y, -node.scroll.offset.y); - } - if (delta) { - // Incoporate each ancestor's scale into a cumulative treeScale for this component - treeScale.x *= delta.x.scale; - treeScale.y *= delta.y.scale; - // Apply each ancestor's calculated delta into this component's recorded layout box - applyBoxDelta(box, delta); - } - if (isSharedTransition && hasTransform(node.latestValues)) { - transformBox(box, node.latestValues, node.layout?.layoutBox); - } - } - /** - * Snap tree scale back to 1 if it's within a non-perceivable threshold. - * This will help reduce useless scales getting rendered. - */ - if (treeScale.x < TREE_SCALE_SNAP_MAX && - treeScale.x > TREE_SCALE_SNAP_MIN) { - treeScale.x = 1.0; - } - if (treeScale.y < TREE_SCALE_SNAP_MAX && - treeScale.y > TREE_SCALE_SNAP_MIN) { - treeScale.y = 1.0; - } -} -function translateAxis(axis, distance) { - axis.min += distance; - axis.max += distance; -} -/** - * Apply a transform to an axis from the latest resolved motion values. - * This function basically acts as a bridge between a flat motion value map - * and applyAxisDelta - */ -function transformAxis(axis, axisTranslate, axisScale, boxScale, axisOrigin = 0.5) { - const originPoint = mixNumber(axis.min, axis.max, axisOrigin); - // Apply the axis delta to the final axis - applyAxisDelta(axis, axisTranslate, axisScale, originPoint, boxScale); -} -function resolveAxisTranslate(value, axis) { - if (typeof value === "string") { - return (parseFloat(value) / 100) * (axis.max - axis.min); - } - return value; -} -/** - * Apply a transform to a box from the latest resolved motion values. - */ -function transformBox(box, transform, sourceBox) { - const resolveBox = sourceBox ?? box; - transformAxis(box.x, resolveAxisTranslate(transform.x, resolveBox.x), transform.scaleX, transform.scale, transform.originX); - transformAxis(box.y, resolveAxisTranslate(transform.y, resolveBox.y), transform.scaleY, transform.scale, transform.originY); -} - -export { applyAxisDelta, applyBoxDelta, applyPointDelta, applyTreeDeltas, scalePoint, transformAxis, transformBox, translateAxis }; -//# sourceMappingURL=delta-apply.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/geometry/delta-apply.mjs.map b/node_modules/motion-dom/dist/es/projection/geometry/delta-apply.mjs.map deleted file mode 100644 index a2eae43..0000000 --- a/node_modules/motion-dom/dist/es/projection/geometry/delta-apply.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"delta-apply.mjs","sources":["../../../../src/projection/geometry/delta-apply.ts"],"sourcesContent":["import { Axis, Box, Delta, Point } from \"motion-utils\"\nimport { mixNumber } from \"../../utils/mix/number\"\nimport { ResolvedValues } from \"../../render/types\"\nimport { hasTransform } from \"../utils/has-transform\"\n\n/**\n * Scales a point based on a factor and an originPoint\n */\nexport function scalePoint(point: number, scale: number, originPoint: number) {\n const distanceFromOrigin = point - originPoint\n const scaled = scale * distanceFromOrigin\n return originPoint + scaled\n}\n\n/**\n * Applies a translate/scale delta to a point\n */\nexport function applyPointDelta(\n point: number,\n translate: number,\n scale: number,\n originPoint: number,\n boxScale?: number\n): number {\n if (boxScale !== undefined) {\n point = scalePoint(point, boxScale, originPoint)\n }\n\n return scalePoint(point, scale, originPoint) + translate\n}\n\n/**\n * Applies a translate/scale delta to an axis\n */\nexport function applyAxisDelta(\n axis: Axis,\n translate: number = 0,\n scale: number = 1,\n originPoint: number,\n boxScale?: number\n): void {\n axis.min = applyPointDelta(\n axis.min,\n translate,\n scale,\n originPoint,\n boxScale\n )\n\n axis.max = applyPointDelta(\n axis.max,\n translate,\n scale,\n originPoint,\n boxScale\n )\n}\n\n/**\n * Applies a translate/scale delta to a box\n */\nexport function applyBoxDelta(box: Box, { x, y }: Delta): void {\n applyAxisDelta(box.x, x.translate, x.scale, x.originPoint)\n applyAxisDelta(box.y, y.translate, y.scale, y.originPoint)\n}\n\nconst TREE_SCALE_SNAP_MIN = 0.999999999999\nconst TREE_SCALE_SNAP_MAX = 1.0000000000001\n\n/**\n * Apply a tree of deltas to a box. We do this to calculate the effect of all the transforms\n * in a tree upon our box before then calculating how to project it into our desired viewport-relative box\n *\n * This is the final nested loop within updateLayoutDelta for future refactoring\n */\nexport function applyTreeDeltas(\n box: Box,\n treeScale: Point,\n treePath: any[],\n isSharedTransition: boolean = false\n) {\n const treeLength = treePath.length\n if (!treeLength) return\n\n // Reset the treeScale\n treeScale.x = treeScale.y = 1\n\n let node: any\n let delta: Delta | undefined\n\n for (let i = 0; i < treeLength; i++) {\n node = treePath[i]\n delta = node.projectionDelta\n\n /**\n * TODO: Prefer to remove this, but currently we have motion components with\n * display: contents in Framer.\n */\n const { visualElement } = node.options\n if (\n visualElement &&\n visualElement.props.style &&\n visualElement.props.style.display === \"contents\"\n ) {\n continue\n }\n\n if (\n isSharedTransition &&\n node.options.layoutScroll &&\n node.scroll &&\n node !== node.root\n ) {\n translateAxis(box.x, -node.scroll.offset.x)\n translateAxis(box.y, -node.scroll.offset.y)\n }\n\n if (delta) {\n // Incoporate each ancestor's scale into a cumulative treeScale for this component\n treeScale.x *= delta.x.scale\n treeScale.y *= delta.y.scale\n\n // Apply each ancestor's calculated delta into this component's recorded layout box\n applyBoxDelta(box, delta)\n }\n\n if (isSharedTransition && hasTransform(node.latestValues)) {\n transformBox(box, node.latestValues, node.layout?.layoutBox)\n }\n }\n\n /**\n * Snap tree scale back to 1 if it's within a non-perceivable threshold.\n * This will help reduce useless scales getting rendered.\n */\n if (\n treeScale.x < TREE_SCALE_SNAP_MAX &&\n treeScale.x > TREE_SCALE_SNAP_MIN\n ) {\n treeScale.x = 1.0\n }\n if (\n treeScale.y < TREE_SCALE_SNAP_MAX &&\n treeScale.y > TREE_SCALE_SNAP_MIN\n ) {\n treeScale.y = 1.0\n }\n}\n\nexport function translateAxis(axis: Axis, distance: number) {\n axis.min += distance\n axis.max += distance\n}\n\n/**\n * Apply a transform to an axis from the latest resolved motion values.\n * This function basically acts as a bridge between a flat motion value map\n * and applyAxisDelta\n */\nexport function transformAxis(\n axis: Axis,\n axisTranslate?: number,\n axisScale?: number,\n boxScale?: number,\n axisOrigin: number = 0.5\n): void {\n const originPoint = mixNumber(axis.min, axis.max, axisOrigin)\n\n // Apply the axis delta to the final axis\n applyAxisDelta(axis, axisTranslate, axisScale, originPoint, boxScale)\n}\n\nfunction resolveAxisTranslate(\n value: number | string | undefined,\n axis: Axis\n): number | undefined {\n if (typeof value === \"string\") {\n return (parseFloat(value) / 100) * (axis.max - axis.min)\n }\n return value as number | undefined\n}\n\n/**\n * Apply a transform to a box from the latest resolved motion values.\n */\nexport function transformBox(\n box: Box,\n transform: ResolvedValues,\n sourceBox?: Box\n) {\n const resolveBox = sourceBox ?? box\n transformAxis(\n box.x,\n resolveAxisTranslate(transform.x, resolveBox.x),\n transform.scaleX as number,\n transform.scale as number,\n transform.originX as number\n )\n transformAxis(\n box.y,\n resolveAxisTranslate(transform.y, resolveBox.y),\n transform.scaleY as number,\n transform.scale as number,\n transform.originY as number\n )\n}\n"],"names":[],"mappings":";;;AAKA;;AAEG;SACa,UAAU,CAAC,KAAa,EAAE,KAAa,EAAE,WAAmB,EAAA;AACxE,IAAA,MAAM,kBAAkB,GAAG,KAAK,GAAG,WAAW;AAC9C,IAAA,MAAM,MAAM,GAAG,KAAK,GAAG,kBAAkB;IACzC,OAAO,WAAW,GAAG,MAAM;AAC/B;AAEA;;AAEG;AACG,SAAU,eAAe,CAC3B,KAAa,EACb,SAAiB,EACjB,KAAa,EACb,WAAmB,EACnB,QAAiB,EAAA;AAEjB,IAAA,IAAI,QAAQ,KAAK,SAAS,EAAE;QACxB,KAAK,GAAG,UAAU,CAAC,KAAK,EAAE,QAAQ,EAAE,WAAW,CAAC;IACpD;IAEA,OAAO,UAAU,CAAC,KAAK,EAAE,KAAK,EAAE,WAAW,CAAC,GAAG,SAAS;AAC5D;AAEA;;AAEG;AACG,SAAU,cAAc,CAC1B,IAAU,EACV,SAAA,GAAoB,CAAC,EACrB,KAAA,GAAgB,CAAC,EACjB,WAAmB,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AC,GAAG,IAAI,QAAQ;AACpB,IAAA,IAAI,CAAC,GAAG,IAAI,QAAQ;AACxB;AAEA;;;;AAIG;AACG,SAAU,aAAa,CACzB,IAAU,EACV,aAAsB,EACtB,SAAkB,EAClB,QAAiB,EACjB,UAAA,GAAqB,GAAG,EAAA;AAExB,IAAA,MAAM,WAAW,GAAG,SAAS,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,UAAU,CAAC;;IAG7D,cAAc,CAAC,IAAI,EAAE,aAAa,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,CAAC;AACzE;AAEA,SAAS,oBAAoB,CACzB,KAAkC,EAClC,IAAU,EAAA;AAEV,IAAA,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AAC3B,QAAA,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,GAAG,KAAK,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC;IAC5D;AACA,IAAA,OAAO,KAA2B;AACtC;AAEA;;AAEG;SACa,YAAY,CACxB,GAAQ,EACR,SAAyB,EACzB,SAAe,EAAA;AAEf,IAAA,MAAM,UAAU,GAAG,SAAS,IAAI,GAAG;AACnC,IAAA,aAAa,CACT,GAAG,CAAC,CAAC,EACL,oBAAoB,CAAC,SAAS,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,EAC/C,SAAS,CAAC,MAAgB,EAC1B,SAAS,CAAC,KAAe,EACzB,SAAS,CAAC,OAAiB,CAC9B;AACD,IAAA,aAAa,CACT,GAAG,CAAC,CAAC,EACL,oBAAoB,CAAC,SAAS,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,EAC/C,SAAS,CAAC,MAAgB,EAC1B,SAAS,CAAC,KAAe,EACzB,SAAS,CAAC,OAAiB,CAC9B;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/projection/geometry/delta-calc.mjs b/node_modules/motion-dom/dist/es/projection/geometry/delta-calc.mjs deleted file mode 100644 index 39e0f7b..0000000 --- a/node_modules/motion-dom/dist/es/projection/geometry/delta-calc.mjs +++ /dev/null @@ -1,59 +0,0 @@ -import { mixNumber } from '../../utils/mix/number.mjs'; - -const SCALE_PRECISION = 0.0001; -const SCALE_MIN = 1 - SCALE_PRECISION; -const SCALE_MAX = 1 + SCALE_PRECISION; -const TRANSLATE_PRECISION = 0.01; -const TRANSLATE_MIN = 0 - TRANSLATE_PRECISION; -const TRANSLATE_MAX = 0 + TRANSLATE_PRECISION; -function calcLength(axis) { - return axis.max - axis.min; -} -function isNear(value, target, maxDistance) { - return Math.abs(value - target) <= maxDistance; -} -function calcAxisDelta(delta, source, target, origin = 0.5) { - delta.origin = origin; - delta.originPoint = mixNumber(source.min, source.max, delta.origin); - delta.scale = calcLength(target) / calcLength(source); - delta.translate = - mixNumber(target.min, target.max, delta.origin) - delta.originPoint; - if ((delta.scale >= SCALE_MIN && delta.scale <= SCALE_MAX) || - isNaN(delta.scale)) { - delta.scale = 1.0; - } - if ((delta.translate >= TRANSLATE_MIN && - delta.translate <= TRANSLATE_MAX) || - isNaN(delta.translate)) { - delta.translate = 0.0; - } -} -function calcBoxDelta(delta, source, target, origin) { - calcAxisDelta(delta.x, source.x, target.x, origin ? origin.originX : undefined); - calcAxisDelta(delta.y, source.y, target.y, origin ? origin.originY : undefined); -} -function calcRelativeAxis(target, relative, parent, anchor = 0) { - const anchorPoint = anchor - ? mixNumber(parent.min, parent.max, anchor) - : parent.min; - target.min = anchorPoint + relative.min; - target.max = target.min + calcLength(relative); -} -function calcRelativeBox(target, relative, parent, anchor) { - calcRelativeAxis(target.x, relative.x, parent.x, anchor?.x); - calcRelativeAxis(target.y, relative.y, parent.y, anchor?.y); -} -function calcRelativeAxisPosition(target, layout, parent, anchor = 0) { - const anchorPoint = anchor - ? mixNumber(parent.min, parent.max, anchor) - : parent.min; - target.min = layout.min - anchorPoint; - target.max = target.min + calcLength(layout); -} -function calcRelativePosition(target, layout, parent, anchor) { - calcRelativeAxisPosition(target.x, layout.x, parent.x, anchor?.x); - calcRelativeAxisPosition(target.y, layout.y, parent.y, anchor?.y); -} - -export { calcAxisDelta, calcBoxDelta, calcLength, calcRelativeAxis, calcRelativeAxisPosition, calcRelativeBox, calcRelativePosition, isNear }; -//# sourceMappingURL=delta-calc.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/geometry/delta-calc.mjs.map b/node_modules/motion-dom/dist/es/projection/geometry/delta-calc.mjs.map deleted file mode 100644 index b9b53e0..0000000 --- a/node_modules/motion-dom/dist/es/projection/geometry/delta-calc.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"delta-calc.mjs","sources":["../../../../src/projection/geometry/delta-calc.ts"],"sourcesContent":["import { Axis, AxisDelta, Box, Delta, Point } from \"motion-utils\"\nimport { mixNumber } from \"../../utils/mix/number\"\nimport { ResolvedValues } from \"../../render/types\"\n\nconst SCALE_PRECISION = 0.0001\nconst SCALE_MIN = 1 - SCALE_PRECISION\nconst SCALE_MAX = 1 + SCALE_PRECISION\nconst TRANSLATE_PRECISION = 0.01\nconst TRANSLATE_MIN = 0 - TRANSLATE_PRECISION\nconst TRANSLATE_MAX = 0 + TRANSLATE_PRECISION\n\nexport function calcLength(axis: Axis) {\n return axis.max - axis.min\n}\n\nexport function isNear(\n value: number,\n target: number,\n maxDistance: number\n): boolean {\n return Math.abs(value - target) <= maxDistance\n}\n\nexport function calcAxisDelta(\n delta: AxisDelta,\n source: Axis,\n target: Axis,\n origin: number = 0.5\n) {\n delta.origin = origin\n delta.originPoint = mixNumber(source.min, source.max, delta.origin)\n delta.scale = calcLength(target) / calcLength(source)\n delta.translate =\n mixNumber(target.min, target.max, delta.origin) - delta.originPoint\n\n if (\n (delta.scale >= SCALE_MIN && delta.scale <= SCALE_MAX) ||\n isNaN(delta.scale)\n ) {\n delta.scale = 1.0\n }\n\n if (\n (delta.translate >= TRANSLATE_MIN &&\n delta.translate <= TRANSLATE_MAX) ||\n isNaN(delta.translate)\n ) {\n delta.translate = 0.0\n }\n}\n\nexport function calcBoxDelta(\n delta: Delta,\n source: Box,\n target: Box,\n origin?: ResolvedValues\n): void {\n calcAxisDelta(\n delta.x,\n source.x,\n target.x,\n origin ? (origin.originX as number) : undefined\n )\n calcAxisDelta(\n delta.y,\n source.y,\n target.y,\n origin ? (origin.originY as number) : undefined\n )\n}\n\nexport function calcRelativeAxis(\n target: Axis,\n relative: Axis,\n parent: Axis,\n anchor: number = 0\n) {\n const anchorPoint = anchor\n ? mixNumber(parent.min, parent.max, anchor)\n : parent.min\n target.min = anchorPoint + relative.min\n target.max = target.min + calcLength(relative)\n}\n\nexport function calcRelativeBox(\n target: Box,\n relative: Box,\n parent: Box,\n anchor?: Point\n) {\n calcRelativeAxis(target.x, relative.x, parent.x, anchor?.x)\n calcRelativeAxis(target.y, relative.y, parent.y, anchor?.y)\n}\n\nexport function calcRelativeAxisPosition(\n target: Axis,\n layout: Axis,\n parent: Axis,\n anchor: number = 0\n) {\n const anchorPoint = anchor\n ? mixNumber(parent.min, parent.max, anchor)\n : parent.min\n target.min = layout.min - anchorPoint\n target.max = target.min + calcLength(layout)\n}\n\nexport function calcRelativePosition(\n target: Box,\n layout: Box,\n parent: Box,\n anchor?: Point\n) {\n calcRelativeAxisPosition(target.x, layout.x, parent.x, anchor?.x)\n calcRelativeAxisPosition(target.y, layout.y, parent.y, anchor?.y)\n}\n"],"names":[],"mappings":";;AAIA,MAAM,eAAe,GAAG,MAAM;AAC9B,MAAM,SAAS,GAAG,CAAC,GAAG,eAAe;AACrC,MAAM,SAAS,GAAG,CAAC,GAAG,eAAe;AACrC,MAAM,mBAAmB,GAAG,IAAI;AAChC,MAAM,aAAa,GAAG,CAAC,GAAG,mBAAmB;AAC7C,MAAM,aAAa,GAAG,CAAC,GAAG,mBAAmB;AAEvC,SAAU,UAAU,CAAC,IAAU,EAAA;AACjC,IAAA,OAAO,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG;AAC9B;SAE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ACX,MAAW,EACX,MAAc,EAAA;AAEd,IAAA,wBAAwB,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;AACjE,IAAA,wBAAwB,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;AACrE;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/projection/geometry/delta-remove.mjs b/node_modules/motion-dom/dist/es/projection/geometry/delta-remove.mjs deleted file mode 100644 index 59915ad..0000000 --- a/node_modules/motion-dom/dist/es/projection/geometry/delta-remove.mjs +++ /dev/null @@ -1,55 +0,0 @@ -import { mixNumber } from '../../utils/mix/number.mjs'; -import { percent } from '../../value/types/numbers/units.mjs'; -import { scalePoint } from './delta-apply.mjs'; - -/** - * Remove a delta from a point. This is essentially the steps of applyPointDelta in reverse - */ -function removePointDelta(point, translate, scale, originPoint, boxScale) { - point -= translate; - point = scalePoint(point, 1 / scale, originPoint); - if (boxScale !== undefined) { - point = scalePoint(point, 1 / boxScale, originPoint); - } - return point; -} -/** - * Remove a delta from an axis. This is essentially the steps of applyAxisDelta in reverse - */ -function removeAxisDelta(axis, translate = 0, scale = 1, origin = 0.5, boxScale, originAxis = axis, sourceAxis = axis) { - if (percent.test(translate)) { - translate = parseFloat(translate); - const relativeProgress = mixNumber(sourceAxis.min, sourceAxis.max, translate / 100); - translate = relativeProgress - sourceAxis.min; - } - if (typeof translate !== "number") - return; - let originPoint = mixNumber(originAxis.min, originAxis.max, origin); - if (axis === originAxis) - originPoint -= translate; - axis.min = removePointDelta(axis.min, translate, scale, originPoint, boxScale); - axis.max = removePointDelta(axis.max, translate, scale, originPoint, boxScale); -} -/** - * Remove a transforms from an axis. This is essentially the steps of applyAxisTransforms in reverse - * and acts as a bridge between motion values and removeAxisDelta - */ -function removeAxisTransforms(axis, transforms, [key, scaleKey, originKey], origin, sourceAxis) { - removeAxisDelta(axis, transforms[key], transforms[scaleKey], transforms[originKey], transforms.scale, origin, sourceAxis); -} -/** - * The names of the motion values we want to apply as translation, scale and origin. - */ -const xKeys = ["x", "scaleX", "originX"]; -const yKeys = ["y", "scaleY", "originY"]; -/** - * Remove a transforms from an box. This is essentially the steps of applyAxisBox in reverse - * and acts as a bridge between motion values and removeAxisDelta - */ -function removeBoxTransforms(box, transforms, originBox, sourceBox) { - removeAxisTransforms(box.x, transforms, xKeys, originBox ? originBox.x : undefined, sourceBox ? sourceBox.x : undefined); - removeAxisTransforms(box.y, transforms, yKeys, originBox ? originBox.y : undefined, sourceBox ? sourceBox.y : undefined); -} - -export { removeAxisDelta, removeAxisTransforms, removeBoxTransforms, removePointDelta }; -//# sourceMappingURL=delta-remove.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/geometry/delta-remove.mjs.map b/node_modules/motion-dom/dist/es/projection/geometry/delta-remove.mjs.map deleted file mode 100644 index f413dde..0000000 --- a/node_modules/motion-dom/dist/es/projection/geometry/delta-remove.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"delta-remove.mjs","sources":["../../../../src/projection/geometry/delta-remove.ts"],"sourcesContent":["import { Axis, Box } from \"motion-utils\"\nimport { mixNumber } from \"../../utils/mix/number\"\nimport { percent } from \"../../value/types/numbers/units\"\nimport { ResolvedValues } from \"../../render/types\"\nimport { scalePoint } from \"./delta-apply\"\n\n/**\n * Remove a delta from a point. This is essentially the steps of applyPointDelta in reverse\n */\nexport function removePointDelta(\n point: number,\n translate: number,\n scale: number,\n originPoint: number,\n boxScale?: number\n): number {\n point -= translate\n point = scalePoint(point, 1 / scale, originPoint)\n\n if (boxScale !== undefined) {\n point = scalePoint(point, 1 / boxScale, originPoint)\n }\n\n return point\n}\n\n/**\n * Remove a delta from an axis. This is essentially the steps of applyAxisDelta in reverse\n */\nexport function removeAxisDelta(\n axis: Axis,\n translate: number | string = 0,\n scale: number = 1,\n origin: number = 0.5,\n boxScale?: number,\n originAxis: Axis = axis,\n sourceAxis: Axis = axis\n): void {\n if (percent.test(translate)) {\n translate = parseFloat(translate as string)\n const relativeProgress = mixNumber(\n sourceAxis.min,\n sourceAxis.max,\n translate / 100\n )\n translate = relativeProgress - sourceAxis.min\n }\n\n if (typeof translate !== \"number\") return\n\n let originPoint = mixNumber(originAxis.min, originAxis.max, origin)\n if (axis === originAxis) originPoint -= translate\n\n axis.min = removePointDelta(\n axis.min,\n translate,\n scale,\n originPoint,\n boxScale\n )\n\n axis.max = removePointDelta(\n axis.max,\n translate,\n scale,\n originPoint,\n boxScale\n )\n}\n\n/**\n * Remove a transforms from an axis. This is essentially the steps of applyAxisTransforms in reverse\n * and acts as a bridge between motion values and removeAxisDelta\n */\nexport function removeAxisTransforms(\n axis: Axis,\n transforms: ResolvedValues,\n [key, scaleKey, originKey]: string[],\n origin?: Axis,\n sourceAxis?: Axis\n) {\n removeAxisDelta(\n axis,\n transforms[key] as number,\n transforms[scaleKey] as number,\n transforms[originKey] as number,\n transforms.scale as number,\n origin,\n sourceAxis\n )\n}\n\n/**\n * The names of the motion values we want to apply as translation, scale and origin.\n */\nconst xKeys = [\"x\", \"scaleX\", \"originX\"]\nconst yKeys = [\"y\", \"scaleY\", \"originY\"]\n\n/**\n * Remove a transforms from an box. This is essentially the steps of applyAxisBox in reverse\n * and acts as a bridge between motion values and removeAxisDelta\n */\nexport function removeBoxTransforms(\n box: Box,\n transforms: ResolvedValues,\n originBox?: Box,\n sourceBox?: Box\n): void {\n removeAxisTransforms(\n box.x,\n transforms,\n xKeys,\n originBox ? originBox.x : undefined,\n sourceBox ? sourceBox.x : undefined\n )\n removeAxisTransforms(\n box.y,\n transforms,\n yKeys,\n originBox ? originBox.y : undefined,\n sourceBox ? sourceBox.y : undefined\n )\n}\n"],"names":[],"mappings":";;;;AAMA;;AAEG;AACG,SAAU,gBAAgB,CAC5B,KAAa,EACb,SAAiB,EACjB,KAAa,EACb,WAAmB,E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,UAA0B,EAC1B,CAAC,GAAG,EAAE,QAAQ,EAAE,SAAS,CAAW,EACpC,MAAa,EACb,UAAiB,EAAA;IAEjB,eAAe,CACX,IAAI,EACJ,UAAU,CAAC,GAAG,CAAW,EACzB,UAAU,CAAC,QAAQ,CAAW,EAC9B,UAAU,CAAC,SAAS,CAAW,EAC/B,UAAU,CAAC,KAAe,EAC1B,MAAM,EACN,UAAU,CACb;AACL;AAEA;;AAEG;AACH,MAAM,KAAK,GAAG,CAAC,GAAG,EAAE,QAAQ,EAAE,SAAS,CAAC;AACxC,MAAM,KAAK,GAAG,CAAC,GAAG,EAAE,QAAQ,EAAE,SAAS,CAAC;AAExC;;;AAGG;AACG,SAAU,mBAAmB,CAC/B,GAAQ,EACR,UAA0B,EAC1B,SAAe,EACf,SAAe,EAAA;AAEf,IAAA,oBAAoB,CAChB,GAAG,CAAC,CAAC,EACL,UAAU,EACV,KAAK,EACL,SAAS,GAAG,SAAS,CAAC,CAAC,GAAG,SAAS,EACnC,SAAS,GAAG,SAAS,CAAC,CAAC,GAAG,SAAS,CACtC;AACD,IAAA,oBAAoB,CAChB,GAAG,CAAC,CAAC,EACL,UAAU,EACV,KAAK,EACL,SAAS,GAAG,SAAS,CAAC,CAAC,GAAG,SAAS,EACnC,SAAS,GAAG,SAAS,CAAC,CAAC,GAAG,SAAS,CACtC;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/projection/geometry/models.mjs b/node_modules/motion-dom/dist/es/projection/geometry/models.mjs deleted file mode 100644 index f6ca4f0..0000000 --- a/node_modules/motion-dom/dist/es/projection/geometry/models.mjs +++ /dev/null @@ -1,18 +0,0 @@ -const createAxisDelta = () => ({ - translate: 0, - scale: 1, - origin: 0, - originPoint: 0, -}); -const createDelta = () => ({ - x: createAxisDelta(), - y: createAxisDelta(), -}); -const createAxis = () => ({ min: 0, max: 0 }); -const createBox = () => ({ - x: createAxis(), - y: createAxis(), -}); - -export { createAxis, createAxisDelta, createBox, createDelta }; -//# sourceMappingURL=models.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/geometry/models.mjs.map b/node_modules/motion-dom/dist/es/projection/geometry/models.mjs.map deleted file mode 100644 index 5e571a9..0000000 --- a/node_modules/motion-dom/dist/es/projection/geometry/models.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"models.mjs","sources":["../../../../src/projection/geometry/models.ts"],"sourcesContent":["import { Axis, AxisDelta, Box, Delta } from \"motion-utils\"\n\nexport const createAxisDelta = (): AxisDelta => ({\n translate: 0,\n scale: 1,\n origin: 0,\n originPoint: 0,\n})\n\nexport const createDelta = (): Delta => ({\n x: createAxisDelta(),\n y: createAxisDelta(),\n})\n\nexport const createAxis = (): Axis => ({ min: 0, max: 0 })\n\nexport const createBox = (): Box => ({\n x: createAxis(),\n y: createAxis(),\n})\n"],"names":[],"mappings":"AAEO,MAAM,eAAe,GAAG,OAAkB;AAC7C,IAAA,SAAS,EAAE,CAAC;AACZ,IAAA,KAAK,EAAE,CAAC;AACR,IAAA,MAAM,EAAE,CAAC;AACT,IAAA,WAAW,EAAE,CAAC;AACjB,CAAA;AAEM,MAAM,WAAW,GAAG,OAAc;IACrC,CAAC,EAAE,eAAe,EAAE;IACpB,CAAC,EAAE,eAAe,EAAE;AACvB,CAAA;AAEM,MAAM,UAAU,GAAG,OAAa,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE;AAElD,MAAM,SAAS,GAAG,OAAY;IACjC,CAAC,EAAE,UAAU,EAAE;IACf,CAAC,EAAE,UAAU,EAAE;AAClB,CAAA;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/projection/geometry/utils.mjs b/node_modules/motion-dom/dist/es/projection/geometry/utils.mjs deleted file mode 100644 index 807d96d..0000000 --- a/node_modules/motion-dom/dist/es/projection/geometry/utils.mjs +++ /dev/null @@ -1,32 +0,0 @@ -import { calcLength } from './delta-calc.mjs'; - -function isAxisDeltaZero(delta) { - return delta.translate === 0 && delta.scale === 1; -} -function isDeltaZero(delta) { - return isAxisDeltaZero(delta.x) && isAxisDeltaZero(delta.y); -} -function axisEquals(a, b) { - return a.min === b.min && a.max === b.max; -} -function boxEquals(a, b) { - return axisEquals(a.x, b.x) && axisEquals(a.y, b.y); -} -function axisEqualsRounded(a, b) { - return (Math.round(a.min) === Math.round(b.min) && - Math.round(a.max) === Math.round(b.max)); -} -function boxEqualsRounded(a, b) { - return axisEqualsRounded(a.x, b.x) && axisEqualsRounded(a.y, b.y); -} -function aspectRatio(box) { - return calcLength(box.x) / calcLength(box.y); -} -function axisDeltaEquals(a, b) { - return (a.translate === b.translate && - a.scale === b.scale && - a.originPoint === b.originPoint); -} - -export { aspectRatio, axisDeltaEquals, axisEquals, axisEqualsRounded, boxEquals, boxEqualsRounded, isDeltaZero }; -//# sourceMappingURL=utils.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/geometry/utils.mjs.map b/node_modules/motion-dom/dist/es/projection/geometry/utils.mjs.map deleted file mode 100644 index 2cb527d..0000000 --- a/node_modules/motion-dom/dist/es/projection/geometry/utils.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.mjs","sources":["../../../../src/projection/geometry/utils.ts"],"sourcesContent":["import { Axis, AxisDelta, Box, Delta } from \"motion-utils\"\nimport { calcLength } from \"./delta-calc\"\n\nfunction isAxisDeltaZero(delta: AxisDelta) {\n return delta.translate === 0 && delta.scale === 1\n}\n\nexport function isDeltaZero(delta: Delta) {\n return isAxisDeltaZero(delta.x) && isAxisDeltaZero(delta.y)\n}\n\nexport function axisEquals(a: Axis, b: Axis) {\n return a.min === b.min && a.max === b.max\n}\n\nexport function boxEquals(a: Box, b: Box) {\n return axisEquals(a.x, b.x) && axisEquals(a.y, b.y)\n}\n\nexport function axisEqualsRounded(a: Axis, b: Axis) {\n return (\n Math.round(a.min) === Math.round(b.min) &&\n Math.round(a.max) === Math.round(b.max)\n )\n}\n\nexport function boxEqualsRounded(a: Box, b: Box) {\n return axisEqualsRounded(a.x, b.x) && axisEqualsRounded(a.y, b.y)\n}\n\nexport function aspectRatio(box: Box): number {\n return calcLength(box.x) / calcLength(box.y)\n}\n\nexport function axisDeltaEquals(a: AxisDelta, b: AxisDelta) {\n return (\n a.translate === b.translate &&\n a.scale === b.scale &&\n a.originPoint === b.originPoint\n )\n}\n"],"names":[],"mappings":";;AAGA,SAAS,eAAe,CAAC,KAAgB,EAAA;IACrC,OAAO,KAAK,CAAC,SAAS,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,KAAK,CAAC;AACrD;AAEM,SAAU,WAAW,CAAC,KAAY,EAAA;AACpC,IAAA,OAAO,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC;AAC/D;AAEM,SAAU,UAAU,CAAC,CAAO,EAAE,CAAO,EAAA;AACvC,IAAA,OAAO,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG;AAC7C;AAEM,SAAU,SAAS,CAAC,CAAM,EAAE,CAAM,EAAA;IACpC,OAAO,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AACvD;AAEM,SAAU,iBAAiB,CAAC,CAAO,EAAE,CAAO,EAAA;AAC9C,IAAA,QACI,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC;AACvC,QAAA,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC;AAE/C;AAEM,SAAU,gBAAgB,CAAC,CAAM,EAAE,CAAM,EAAA;IAC3C,OAAO,iBAAiB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,iBAAiB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AACrE;AAEM,SAAU,WAAW,CAAC,GAAQ,EAAA;AAChC,IAAA,OAAO,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;AAChD;AAEM,SAAU,eAAe,CAAC,CAAY,EAAE,CAAY,EAAA;AACtD,IAAA,QACI,CAAC,CAAC,SAAS,KAAK,CAAC,CAAC,SAAS;AAC3B,QAAA,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,KAAK;AACnB,QAAA,CAAC,CAAC,WAAW,KAAK,CAAC,CAAC,WAAW;AAEvC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/projection/node/DocumentProjectionNode.mjs b/node_modules/motion-dom/dist/es/projection/node/DocumentProjectionNode.mjs deleted file mode 100644 index e6755c8..0000000 --- a/node_modules/motion-dom/dist/es/projection/node/DocumentProjectionNode.mjs +++ /dev/null @@ -1,14 +0,0 @@ -import { addDomEvent } from '../../events/add-dom-event.mjs'; -import { createProjectionNode } from './create-projection-node.mjs'; - -const DocumentProjectionNode = createProjectionNode({ - attachResizeListener: (ref, notify) => addDomEvent(ref, "resize", notify), - measureScroll: () => ({ - x: document.documentElement.scrollLeft || document.body?.scrollLeft || 0, - y: document.documentElement.scrollTop || document.body?.scrollTop || 0, - }), - checkIsScrollRoot: () => true, -}); - -export { DocumentProjectionNode }; -//# sourceMappingURL=DocumentProjectionNode.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/node/DocumentProjectionNode.mjs.map b/node_modules/motion-dom/dist/es/projection/node/DocumentProjectionNode.mjs.map deleted file mode 100644 index aaa5c4d..0000000 --- a/node_modules/motion-dom/dist/es/projection/node/DocumentProjectionNode.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"DocumentProjectionNode.mjs","sources":["../../../../src/projection/node/DocumentProjectionNode.ts"],"sourcesContent":["import { addDomEvent } from \"../../events/add-dom-event\"\nimport { createProjectionNode } from \"./create-projection-node\"\n\nexport const DocumentProjectionNode = createProjectionNode({\n attachResizeListener: (\n ref: Window | Element,\n notify: VoidFunction\n ): VoidFunction => addDomEvent(ref, \"resize\", notify),\n measureScroll: () => ({\n x: document.documentElement.scrollLeft || document.body?.scrollLeft || 0,\n y: document.documentElement.scrollTop || document.body?.scrollTop || 0,\n }),\n checkIsScrollRoot: () => true,\n})\n"],"names":[],"mappings":";;;AAGO,MAAM,sBAAsB,GAAG,oBAAoB,CAAS;AAC/D,IAAA,oBAAoB,EAAE,CAClB,GAAqB,EACrB,MAAoB,KACL,WAAW,CAAC,GAAG,EAAE,QAAQ,EAAE,MAAM,CAAC;AACrD,IAAA,aAAa,EAAE,OAAO;AAClB,QAAA,CAAC,EAAE,QAAQ,CAAC,eAAe,CAAC,UAAU,IAAI,QAAQ,CAAC,IAAI,EAAE,UAAU,IAAI,CAAC;AACxE,QAAA,CAAC,EAAE,QAAQ,CAAC,eAAe,CAAC,SAAS,IAAI,QAAQ,CAAC,IAAI,EAAE,SAAS,IAAI,CAAC;KACzE,CAAC;AACF,IAAA,iBAAiB,EAAE,MAAM,IAAI;AAChC,CAAA;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/projection/node/HTMLProjectionNode.mjs b/node_modules/motion-dom/dist/es/projection/node/HTMLProjectionNode.mjs deleted file mode 100644 index 2fb7f4c..0000000 --- a/node_modules/motion-dom/dist/es/projection/node/HTMLProjectionNode.mjs +++ /dev/null @@ -1,28 +0,0 @@ -import { createProjectionNode } from './create-projection-node.mjs'; -import { DocumentProjectionNode } from './DocumentProjectionNode.mjs'; - -const rootProjectionNode = { - current: undefined, -}; -const HTMLProjectionNode = createProjectionNode({ - measureScroll: (instance) => ({ - x: instance.scrollLeft, - y: instance.scrollTop, - }), - defaultParent: () => { - if (!rootProjectionNode.current) { - const documentNode = new DocumentProjectionNode({}); - documentNode.mount(window); - documentNode.setOptions({ layoutScroll: true }); - rootProjectionNode.current = documentNode; - } - return rootProjectionNode.current; - }, - resetTransform: (instance, value) => { - instance.style.transform = value !== undefined ? value : "none"; - }, - checkIsScrollRoot: (instance) => Boolean(window.getComputedStyle(instance).position === "fixed"), -}); - -export { HTMLProjectionNode, rootProjectionNode }; -//# sourceMappingURL=HTMLProjectionNode.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/node/HTMLProjectionNode.mjs.map b/node_modules/motion-dom/dist/es/projection/node/HTMLProjectionNode.mjs.map deleted file mode 100644 index 57d847d..0000000 --- a/node_modules/motion-dom/dist/es/projection/node/HTMLProjectionNode.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"HTMLProjectionNode.mjs","sources":["../../../../src/projection/node/HTMLProjectionNode.ts"],"sourcesContent":["import { createProjectionNode } from \"./create-projection-node\"\nimport { DocumentProjectionNode } from \"./DocumentProjectionNode\"\nimport { IProjectionNode } from \"./types\"\n\nexport const rootProjectionNode: { current: IProjectionNode | undefined } = {\n current: undefined,\n}\n\nexport const HTMLProjectionNode = createProjectionNode({\n measureScroll: (instance) => ({\n x: instance.scrollLeft,\n y: instance.scrollTop,\n }),\n defaultParent: () => {\n if (!rootProjectionNode.current) {\n const documentNode = new DocumentProjectionNode({})\n documentNode.mount(window)\n documentNode.setOptions({ layoutScroll: true })\n rootProjectionNode.current = documentNode\n }\n return rootProjectionNode.current\n },\n resetTransform: (instance, value) => {\n instance.style.transform = value !== undefined ? value : \"none\"\n },\n checkIsScrollRoot: (instance) =>\n Boolean(window.getComputedStyle(instance).position === \"fixed\"),\n})\n"],"names":[],"mappings":";;;AAIO,MAAM,kBAAkB,GAA6C;AACxE,IAAA,OAAO,EAAE,SAAS;;AAGf,MAAM,kBAAkB,GAAG,oBAAoB,CAAc;AAChE,IAAA,aAAa,EAAE,CAAC,QAAQ,MAAM;QAC1B,CAAC,EAAE,QAAQ,CAAC,UAAU;QACtB,CAAC,EAAE,QAAQ,CAAC,SAAS;KACxB,CAAC;IACF,aAAa,EAAE,MAAK;AAChB,QAAA,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE;AAC7B,YAAA,MAAM,YAAY,GAAG,IAAI,sBAAsB,CAAC,EAAE,CAAC;AACnD,YAAA,YAAY,CAAC,KAAK,CAAC,MAAM,CAAC;YAC1B,YAAY,CAAC,UAAU,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC;AAC/C,YAAA,kBAAkB,CAAC,OAAO,GAAG,YAAY;QAC7C;QACA,OAAO,kBAAkB,CAAC,OAAO;IACrC,CAAC;AACD,IAAA,cAAc,EAAE,CAAC,QAAQ,EAAE,KAAK,KAAI;AAChC,QAAA,QAAQ,CAAC,KAAK,CAAC,SAAS,GAAG,KAAK,KAAK,SAAS,GAAG,KAAK,GAAG,MAAM;IACnE,CAAC;AACD,IAAA,iBAAiB,EAAE,CAAC,QAAQ,KACxB,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,QAAQ,KAAK,OAAO,CAAC;AACtE,CAAA;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/projection/node/create-projection-node.mjs b/node_modules/motion-dom/dist/es/projection/node/create-projection-node.mjs deleted file mode 100644 index 93311ce..0000000 --- a/node_modules/motion-dom/dist/es/projection/node/create-projection-node.mjs +++ /dev/null @@ -1,1695 +0,0 @@ -import { SubscriptionManager, clamp, noop } from 'motion-utils'; -import { animateSingleValue } from '../../animation/animate/single-value.mjs'; -import { getOptimisedAppearId } from '../../animation/optimized-appear/get-appear-id.mjs'; -import { getValueTransition } from '../../animation/utils/get-value-transition.mjs'; -import { microtask } from '../../frameloop/microtask.mjs'; -import { time } from '../../frameloop/sync-time.mjs'; -import { scaleCorrectors } from '../styles/scale-correction.mjs'; -import { statsBuffer } from '../../stats/buffer.mjs'; -import { delay } from '../../utils/delay.mjs'; -import { isSVGElement } from '../../utils/is-svg-element.mjs'; -import { isSVGSVGElement } from '../../utils/is-svg-svg-element.mjs'; -import { mixNumber } from '../../utils/mix/number.mjs'; -import { motionValue } from '../../value/index.mjs'; -import { resolveMotionValue } from '../../value/utils/resolve-motion-value.mjs'; -import { mixValues } from '../animation/mix-values.mjs'; -import { copyBoxInto, copyAxisDeltaInto, copyAxisInto } from '../geometry/copy.mjs'; -import { translateAxis, transformBox, applyBoxDelta, applyTreeDeltas } from '../geometry/delta-apply.mjs'; -import { calcLength, calcRelativeBox, calcRelativePosition, calcBoxDelta, isNear } from '../geometry/delta-calc.mjs'; -import { removeBoxTransforms } from '../geometry/delta-remove.mjs'; -import { createBox, createDelta } from '../geometry/models.mjs'; -import { boxEqualsRounded, isDeltaZero, axisDeltaEquals, boxEquals, aspectRatio } from '../geometry/utils.mjs'; -import { NodeStack } from '../shared/stack.mjs'; -import { buildProjectionTransform } from '../styles/transform.mjs'; -import { eachAxis } from '../utils/each-axis.mjs'; -import { FlatTree } from '../utils/flat-tree.mjs'; -import { hasTransform, hasScale, has2DTranslate } from '../utils/has-transform.mjs'; -import { globalProjectionState } from './state.mjs'; -import { frame, cancelFrame, frameData, frameSteps } from '../../frameloop/frame.mjs'; - -const metrics = { - nodes: 0, - calculatedTargetDeltas: 0, - calculatedProjections: 0, -}; -const transformAxes = ["", "X", "Y", "Z"]; -/** - * We use 1000 as the animation target as 0-1000 maps better to pixels than 0-1 - * which has a noticeable difference in spring animations - */ -const animationTarget = 1000; -let id = 0; -function resetDistortingTransform(key, visualElement, values, sharedAnimationValues) { - const { latestValues } = visualElement; - // Record the distorting transform and then temporarily set it to 0 - if (latestValues[key]) { - values[key] = latestValues[key]; - visualElement.setStaticValue(key, 0); - if (sharedAnimationValues) { - sharedAnimationValues[key] = 0; - } - } -} -function cancelTreeOptimisedTransformAnimations(projectionNode) { - projectionNode.hasCheckedOptimisedAppear = true; - if (projectionNode.root === projectionNode) - return; - const { visualElement } = projectionNode.options; - if (!visualElement) - return; - const appearId = getOptimisedAppearId(visualElement); - if (window.MotionHasOptimisedAnimation(appearId, "transform")) { - const { layout, layoutId } = projectionNode.options; - window.MotionCancelOptimisedAnimation(appearId, "transform", frame, !(layout || layoutId)); - } - const { parent } = projectionNode; - if (parent && !parent.hasCheckedOptimisedAppear) { - cancelTreeOptimisedTransformAnimations(parent); - } -} -function createProjectionNode({ attachResizeListener, defaultParent, measureScroll, checkIsScrollRoot, resetTransform, }) { - return class ProjectionNode { - constructor(latestValues = {}, parent = defaultParent?.()) { - /** - * A unique ID generated for every projection node. - */ - this.id = id++; - /** - * An id that represents a unique session instigated by startUpdate. - */ - this.animationId = 0; - this.animationCommitId = 0; - /** - * A Set containing all this component's children. This is used to iterate - * through the children. - * - * TODO: This could be faster to iterate as a flat array stored on the root node. - */ - this.children = new Set(); - /** - * Options for the node. We use this to configure what kind of layout animations - * we should perform (if any). - */ - this.options = {}; - /** - * We use this to detect when its safe to shut down part of a projection tree. - * We have to keep projecting children for scale correction and relative projection - * until all their parents stop performing layout animations. - */ - this.isTreeAnimating = false; - this.isAnimationBlocked = false; - /** - * Flag to true if we think this layout has been changed. We can't always know this, - * currently we set it to true every time a component renders, or if it has a layoutDependency - * if that has changed between renders. Additionally, components can be grouped by LayoutGroup - * and if one node is dirtied, they all are. - */ - this.isLayoutDirty = false; - /** - * Flag to true if we think the projection calculations for this node needs - * recalculating as a result of an updated transform or layout animation. - */ - this.isProjectionDirty = false; - /** - * Flag to true if the layout *or* transform has changed. This then gets propagated - * throughout the projection tree, forcing any element below to recalculate on the next frame. - */ - this.isSharedProjectionDirty = false; - /** - * Flag transform dirty. This gets propagated throughout the whole tree but is only - * respected by shared nodes. - */ - this.isTransformDirty = false; - /** - * Block layout updates for instant layout transitions throughout the tree. - */ - this.updateManuallyBlocked = false; - this.updateBlockedByResize = false; - /** - * Set to true between the start of the first `willUpdate` call and the end of the `didUpdate` - * call. - */ - this.isUpdating = false; - /** - * If this is an SVG element we currently disable projection transforms - */ - this.isSVG = false; - /** - * Flag to true (during promotion) if a node doing an instant layout transition needs to reset - * its projection styles. - */ - this.needsReset = false; - /** - * Flags whether this node should have its transform reset prior to measuring. - */ - this.shouldResetTransform = false; - /** - * Store whether this node has been checked for optimised appear animations. As - * effects fire bottom-up, and we want to look up the tree for appear animations, - * this makes sure we only check each path once, stopping at nodes that - * have already been checked. - */ - this.hasCheckedOptimisedAppear = false; - /** - * An object representing the calculated contextual/accumulated/tree scale. - * This will be used to scale calculcated projection transforms, as these are - * calculated in screen-space but need to be scaled for elements to layoutly - * make it to their calculated destinations. - * - * TODO: Lazy-init - */ - this.treeScale = { x: 1, y: 1 }; - /** - * - */ - this.eventHandlers = new Map(); - this.hasTreeAnimated = false; - this.layoutVersion = 0; - // Note: Currently only running on root node - this.updateScheduled = false; - this.scheduleUpdate = () => this.update(); - this.projectionUpdateScheduled = false; - this.checkUpdateFailed = () => { - if (this.isUpdating) { - this.isUpdating = false; - this.clearAllSnapshots(); - } - }; - /** - * This is a multi-step process as shared nodes might be of different depths. Nodes - * are sorted by depth order, so we need to resolve the entire tree before moving to - * the next step. - */ - this.updateProjection = () => { - this.projectionUpdateScheduled = false; - /** - * Reset debug counts. Manually resetting rather than creating a new - * object each frame. - */ - if (statsBuffer.value) { - metrics.nodes = - metrics.calculatedTargetDeltas = - metrics.calculatedProjections = - 0; - } - this.nodes.forEach(propagateDirtyNodes); - this.nodes.forEach(resolveTargetDelta); - this.nodes.forEach(calcProjection); - this.nodes.forEach(cleanDirtyNodes); - if (statsBuffer.addProjectionMetrics) { - statsBuffer.addProjectionMetrics(metrics); - } - }; - /** - * Frame calculations - */ - this.resolvedRelativeTargetAt = 0.0; - this.linkedParentVersion = 0; - this.hasProjected = false; - this.isVisible = true; - this.animationProgress = 0; - /** - * Shared layout - */ - // TODO Only running on root node - this.sharedNodes = new Map(); - this.latestValues = latestValues; - this.root = parent ? parent.root || parent : this; - this.path = parent ? [...parent.path, parent] : []; - this.parent = parent; - this.depth = parent ? parent.depth + 1 : 0; - for (let i = 0; i < this.path.length; i++) { - this.path[i].shouldResetTransform = true; - } - if (this.root === this) - this.nodes = new FlatTree(); - } - addEventListener(name, handler) { - if (!this.eventHandlers.has(name)) { - this.eventHandlers.set(name, new SubscriptionManager()); - } - return this.eventHandlers.get(name).add(handler); - } - notifyListeners(name, ...args) { - const subscriptionManager = this.eventHandlers.get(name); - subscriptionManager && subscriptionManager.notify(...args); - } - hasListeners(name) { - return this.eventHandlers.has(name); - } - /** - * Lifecycles - */ - mount(instance) { - if (this.instance) - return; - this.isSVG = isSVGElement(instance) && !isSVGSVGElement(instance); - this.instance = instance; - const { layoutId, layout, visualElement } = this.options; - if (visualElement && !visualElement.current) { - visualElement.mount(instance); - } - this.root.nodes.add(this); - this.parent && this.parent.children.add(this); - if (this.root.hasTreeAnimated && (layout || layoutId)) { - this.isLayoutDirty = true; - } - if (attachResizeListener) { - let cancelDelay; - let innerWidth = 0; - const resizeUnblockUpdate = () => (this.root.updateBlockedByResize = false); - // Set initial innerWidth in a frame.read callback to batch the read - frame.read(() => { - innerWidth = window.innerWidth; - }); - attachResizeListener(instance, () => { - const newInnerWidth = window.innerWidth; - if (newInnerWidth === innerWidth) - return; - innerWidth = newInnerWidth; - this.root.updateBlockedByResize = true; - cancelDelay && cancelDelay(); - cancelDelay = delay(resizeUnblockUpdate, 250); - if (globalProjectionState.hasAnimatedSinceResize) { - globalProjectionState.hasAnimatedSinceResize = false; - this.nodes.forEach(finishAnimation); - } - }); - } - if (layoutId) { - this.root.registerSharedNode(layoutId, this); - } - // Only register the handler if it requires layout animation - if (this.options.animate !== false && - visualElement && - (layoutId || layout)) { - this.addEventListener("didUpdate", ({ delta, hasLayoutChanged, hasRelativeLayoutChanged, layout: newLayout, }) => { - if (this.isTreeAnimationBlocked()) { - this.target = undefined; - this.relativeTarget = undefined; - return; - } - // TODO: Check here if an animation exists - const layoutTransition = this.options.transition || - visualElement.getDefaultTransition() || - defaultLayoutTransition; - const { onLayoutAnimationStart, onLayoutAnimationComplete, } = visualElement.getProps(); - /** - * The target layout of the element might stay the same, - * but its position relative to its parent has changed. - */ - const hasTargetChanged = !this.targetLayout || - !boxEqualsRounded(this.targetLayout, newLayout); - /* - * Note: Disabled to fix relative animations always triggering new - * layout animations. If this causes further issues, we can try - * a different approach to detecting relative target changes. - */ - // || hasRelativeLayoutChanged - /** - * If the layout hasn't seemed to have changed, it might be that the - * element is visually in the same place in the document but its position - * relative to its parent has indeed changed. So here we check for that. - */ - const hasOnlyRelativeTargetChanged = !hasLayoutChanged && hasRelativeLayoutChanged; - if (this.options.layoutRoot || - this.resumeFrom || - hasOnlyRelativeTargetChanged || - (hasLayoutChanged && - (hasTargetChanged || !this.currentAnimation))) { - if (this.resumeFrom) { - this.resumingFrom = this.resumeFrom; - this.resumingFrom.resumingFrom = undefined; - } - const animationOptions = { - ...getValueTransition(layoutTransition, "layout"), - onPlay: onLayoutAnimationStart, - onComplete: onLayoutAnimationComplete, - }; - if (visualElement.shouldReduceMotion || - this.options.layoutRoot) { - animationOptions.delay = 0; - animationOptions.type = false; - } - this.startAnimation(animationOptions); - /** - * Set animation origin after starting animation to avoid layout jump - * caused by stopping previous layout animation - */ - this.setAnimationOrigin(delta, hasOnlyRelativeTargetChanged, animationOptions - .path); - } - else { - /** - * If the layout hasn't changed and we have an animation that hasn't started yet, - * finish it immediately. Otherwise it will be animating from a location - * that was probably never committed to screen and look like a jumpy box. - */ - if (!hasLayoutChanged) { - finishAnimation(this); - } - if (this.isLead() && this.options.onExitComplete) { - this.options.onExitComplete(); - } - } - this.targetLayout = newLayout; - }); - } - } - unmount() { - this.options.layoutId && this.willUpdate(); - this.root.nodes.remove(this); - const stack = this.getStack(); - stack && stack.remove(this); - this.parent && this.parent.children.delete(this); - this.instance = undefined; - this.eventHandlers.clear(); - cancelFrame(this.updateProjection); - } - // only on the root - blockUpdate() { - this.updateManuallyBlocked = true; - } - unblockUpdate() { - this.updateManuallyBlocked = false; - } - isUpdateBlocked() { - return this.updateManuallyBlocked || this.updateBlockedByResize; - } - isTreeAnimationBlocked() { - return (this.isAnimationBlocked || - (this.parent && this.parent.isTreeAnimationBlocked()) || - false); - } - // Note: currently only running on root node - startUpdate() { - if (this.isUpdateBlocked()) - return; - this.isUpdating = true; - this.nodes && this.nodes.forEach(resetSkewAndRotation); - this.animationId++; - } - getTransformTemplate() { - const { visualElement } = this.options; - return visualElement && visualElement.getProps().transformTemplate; - } - willUpdate(shouldNotifyListeners = true) { - this.root.hasTreeAnimated = true; - if (this.root.isUpdateBlocked()) { - this.options.onExitComplete && this.options.onExitComplete(); - return; - } - /** - * If we're running optimised appear animations then these must be - * cancelled before measuring the DOM. This is so we can measure - * the true layout of the element rather than the WAAPI animation - * which will be unaffected by the resetSkewAndRotate step. - * - * Note: This is a DOM write. Worst case scenario is this is sandwiched - * between other snapshot reads which will cause unnecessary style recalculations. - * This has to happen here though, as we don't yet know which nodes will need - * snapshots in startUpdate(), but we only want to cancel optimised animations - * if a layout animation measurement is actually going to be affected by them. - */ - if (window.MotionCancelOptimisedAnimation && - !this.hasCheckedOptimisedAppear) { - cancelTreeOptimisedTransformAnimations(this); - } - !this.root.isUpdating && this.root.startUpdate(); - if (this.isLayoutDirty) - return; - this.isLayoutDirty = true; - for (let i = 0; i < this.path.length; i++) { - const node = this.path[i]; - node.shouldResetTransform = true; - /** - * Percentage translates resolve against layoutBox dimensions, - * so ancestors with them must be re-measured after transform reset. - */ - if (typeof node.latestValues.x === "string" || - typeof node.latestValues.y === "string") { - node.isLayoutDirty = true; - } - node.updateScroll("snapshot"); - if (node.options.layoutRoot) { - node.willUpdate(false); - } - } - const { layoutId, layout } = this.options; - if (layoutId === undefined && !layout) - return; - const transformTemplate = this.getTransformTemplate(); - this.prevTransformTemplateValue = transformTemplate - ? transformTemplate(this.latestValues, "") - : undefined; - this.updateSnapshot(); - shouldNotifyListeners && this.notifyListeners("willUpdate"); - } - update() { - this.updateScheduled = false; - const updateWasBlocked = this.isUpdateBlocked(); - // When doing an instant transition, we skip the layout update, - // but should still clean up the measurements so that the next - // snapshot could be taken correctly. - if (updateWasBlocked) { - const wasBlockedByResize = this.updateBlockedByResize; - this.unblockUpdate(); - this.updateBlockedByResize = false; - this.clearAllSnapshots(); - /** - * When blocked by resize, still measure layouts so - * callbacks like onLayoutMeasure fire (e.g. Reorder). - * Skip notifyLayoutUpdate to prevent animations. - */ - if (wasBlockedByResize) { - this.nodes.forEach(forceLayoutMeasure); - } - this.nodes.forEach(clearMeasurements); - return; - } - /** - * If this is a repeat of didUpdate then ignore the animation. - */ - if (this.animationId <= this.animationCommitId) { - this.nodes.forEach(clearIsLayoutDirty); - return; - } - this.animationCommitId = this.animationId; - if (!this.isUpdating) { - this.nodes.forEach(clearIsLayoutDirty); - } - else { - this.isUpdating = false; - /** - * Ensure animation-blocked nodes (e.g. during drag) - * get measured even when memoized (willUpdate skipped). - */ - this.nodes.forEach(ensureDraggedNodesSnapshotted); - /** - * Write - */ - this.nodes.forEach(resetTransformStyle); - /** - * Read ================== - */ - // Update layout measurements of updated children - this.nodes.forEach(updateLayout); - /** - * Write - */ - // Notify listeners that the layout is updated - this.nodes.forEach(notifyLayoutUpdate); - } - this.clearAllSnapshots(); - /** - * Manually flush any pending updates. Ideally - * we could leave this to the following requestAnimationFrame but this seems - * to leave a flash of incorrectly styled content. - */ - const now = time.now(); - frameData.delta = clamp(0, 1000 / 60, now - frameData.timestamp); - frameData.timestamp = now; - frameData.isProcessing = true; - frameSteps.update.process(frameData); - frameSteps.preRender.process(frameData); - frameSteps.render.process(frameData); - frameData.isProcessing = false; - } - didUpdate() { - if (!this.updateScheduled) { - this.updateScheduled = true; - microtask.read(this.scheduleUpdate); - } - } - clearAllSnapshots() { - this.nodes.forEach(clearSnapshot); - this.sharedNodes.forEach(removeLeadSnapshots); - } - scheduleUpdateProjection() { - if (!this.projectionUpdateScheduled) { - this.projectionUpdateScheduled = true; - frame.preRender(this.updateProjection, false, true); - } - } - scheduleCheckAfterUnmount() { - /** - * If the unmounting node is in a layoutGroup and did trigger a willUpdate, - * we manually call didUpdate to give a chance to the siblings to animate. - * Otherwise, cleanup all snapshots to prevents future nodes from reusing them. - */ - frame.postRender(() => { - if (this.isLayoutDirty) { - this.root.didUpdate(); - } - else { - this.root.checkUpdateFailed(); - } - }); - } - /** - * Update measurements - */ - updateSnapshot() { - if (this.snapshot || !this.instance) - return; - this.snapshot = this.measure(); - if (this.snapshot && - !calcLength(this.snapshot.measuredBox.x) && - !calcLength(this.snapshot.measuredBox.y)) { - this.snapshot = undefined; - } - } - updateLayout() { - if (!this.instance) - return; - this.updateScroll(); - if (!(this.options.alwaysMeasureLayout && this.isLead()) && - !this.isLayoutDirty) { - return; - } - /** - * When a node is mounted, it simply resumes from the prevLead's - * snapshot instead of taking a new one, but the ancestors scroll - * might have updated while the prevLead is unmounted. We need to - * update the scroll again to make sure the layout we measure is - * up to date. - */ - if (this.resumeFrom && !this.resumeFrom.instance) { - for (let i = 0; i < this.path.length; i++) { - const node = this.path[i]; - node.updateScroll(); - } - } - const prevLayout = this.layout; - this.layout = this.measure(false); - this.layoutVersion++; - if (!this.layoutCorrected) - this.layoutCorrected = createBox(); - this.isLayoutDirty = false; - this.projectionDelta = undefined; - this.notifyListeners("measure", this.layout.layoutBox); - const { visualElement } = this.options; - visualElement && - visualElement.notify("LayoutMeasure", this.layout.layoutBox, prevLayout ? prevLayout.layoutBox : undefined); - } - updateScroll(phase = "measure") { - let needsMeasurement = Boolean(this.options.layoutScroll && this.instance); - if (this.scroll && - this.scroll.animationId === this.root.animationId && - this.scroll.phase === phase) { - needsMeasurement = false; - } - if (needsMeasurement && this.instance) { - const isRoot = checkIsScrollRoot(this.instance); - this.scroll = { - animationId: this.root.animationId, - phase, - isRoot, - offset: measureScroll(this.instance), - wasRoot: this.scroll ? this.scroll.isRoot : isRoot, - }; - } - } - resetTransform() { - if (!resetTransform) - return; - const isResetRequested = this.isLayoutDirty || - this.shouldResetTransform || - this.options.alwaysMeasureLayout; - const hasProjection = this.projectionDelta && !isDeltaZero(this.projectionDelta); - const transformTemplate = this.getTransformTemplate(); - const transformTemplateValue = transformTemplate - ? transformTemplate(this.latestValues, "") - : undefined; - const transformTemplateHasChanged = transformTemplateValue !== this.prevTransformTemplateValue; - if (isResetRequested && - this.instance && - (hasProjection || - hasTransform(this.latestValues) || - transformTemplateHasChanged)) { - resetTransform(this.instance, transformTemplateValue); - this.shouldResetTransform = false; - this.scheduleRender(); - } - } - measure(removeTransform = true) { - const pageBox = this.measurePageBox(); - let layoutBox = this.removeElementScroll(pageBox); - /** - * Measurements taken during the pre-render stage - * still have transforms applied so we remove them - * via calculation. - */ - if (removeTransform) { - layoutBox = this.removeTransform(layoutBox); - } - roundBox(layoutBox); - return { - animationId: this.root.animationId, - measuredBox: pageBox, - layoutBox, - latestValues: {}, - source: this.id, - }; - } - measurePageBox() { - const { visualElement } = this.options; - if (!visualElement) - return createBox(); - const box = visualElement.measureViewportBox(); - const wasInScrollRoot = this.scroll?.wasRoot || this.path.some(checkNodeWasScrollRoot); - if (!wasInScrollRoot) { - // Remove viewport scroll to give page-relative coordinates - const { scroll } = this.root; - if (scroll) { - translateAxis(box.x, scroll.offset.x); - translateAxis(box.y, scroll.offset.y); - } - } - return box; - } - removeElementScroll(box) { - const boxWithoutScroll = createBox(); - copyBoxInto(boxWithoutScroll, box); - if (this.scroll?.wasRoot) { - return boxWithoutScroll; - } - /** - * Performance TODO: Keep a cumulative scroll offset down the tree - * rather than loop back up the path. - */ - for (let i = 0; i < this.path.length; i++) { - const node = this.path[i]; - const { scroll, options } = node; - if (node !== this.root && scroll && options.layoutScroll) { - /** - * If this is a new scroll root, we want to remove all previous scrolls - * from the viewport box. - */ - if (scroll.wasRoot) { - copyBoxInto(boxWithoutScroll, box); - } - translateAxis(boxWithoutScroll.x, scroll.offset.x); - translateAxis(boxWithoutScroll.y, scroll.offset.y); - } - } - return boxWithoutScroll; - } - applyTransform(box, transformOnly = false, output) { - const withTransforms = output || createBox(); - copyBoxInto(withTransforms, box); - for (let i = 0; i < this.path.length; i++) { - const node = this.path[i]; - if (!transformOnly && - node.options.layoutScroll && - node.scroll && - node !== node.root) { - translateAxis(withTransforms.x, -node.scroll.offset.x); - translateAxis(withTransforms.y, -node.scroll.offset.y); - } - if (!hasTransform(node.latestValues)) - continue; - transformBox(withTransforms, node.latestValues, node.layout?.layoutBox); - } - if (hasTransform(this.latestValues)) { - transformBox(withTransforms, this.latestValues, this.layout?.layoutBox); - } - return withTransforms; - } - removeTransform(box) { - const boxWithoutTransform = createBox(); - copyBoxInto(boxWithoutTransform, box); - for (let i = 0; i < this.path.length; i++) { - const node = this.path[i]; - if (!hasTransform(node.latestValues)) - continue; - let sourceBox; - if (node.instance) { - hasScale(node.latestValues) && node.updateSnapshot(); - sourceBox = createBox(); - copyBoxInto(sourceBox, node.measurePageBox()); - } - removeBoxTransforms(boxWithoutTransform, node.latestValues, node.snapshot?.layoutBox, sourceBox); - } - if (hasTransform(this.latestValues)) { - removeBoxTransforms(boxWithoutTransform, this.latestValues); - } - return boxWithoutTransform; - } - setTargetDelta(delta) { - this.targetDelta = delta; - this.root.scheduleUpdateProjection(); - this.isProjectionDirty = true; - } - setOptions(options) { - this.options = { - ...this.options, - ...options, - crossfade: options.crossfade !== undefined ? options.crossfade : true, - }; - } - clearMeasurements() { - this.scroll = undefined; - this.layout = undefined; - this.snapshot = undefined; - this.prevTransformTemplateValue = undefined; - this.targetDelta = undefined; - this.target = undefined; - this.isLayoutDirty = false; - } - forceRelativeParentToResolveTarget() { - if (!this.relativeParent) - return; - /** - * If the parent target isn't up-to-date, force it to update. - * This is an unfortunate de-optimisation as it means any updating relative - * projection will cause all the relative parents to recalculate back - * up the tree. - */ - if (this.relativeParent.resolvedRelativeTargetAt !== - frameData.timestamp) { - this.relativeParent.resolveTargetDelta(true); - } - } - resolveTargetDelta(forceRecalculation = false) { - /** - * Once the dirty status of nodes has been spread through the tree, we also - * need to check if we have a shared node of a different depth that has itself - * been dirtied. - */ - const lead = this.getLead(); - this.isProjectionDirty || (this.isProjectionDirty = lead.isProjectionDirty); - this.isTransformDirty || (this.isTransformDirty = lead.isTransformDirty); - this.isSharedProjectionDirty || (this.isSharedProjectionDirty = lead.isSharedProjectionDirty); - const isShared = Boolean(this.resumingFrom) || this !== lead; - /** - * We don't use transform for this step of processing so we don't - * need to check whether any nodes have changed transform. - */ - const canSkip = !(forceRecalculation || - (isShared && this.isSharedProjectionDirty) || - this.isProjectionDirty || - this.parent?.isProjectionDirty || - this.attemptToResolveRelativeTarget || - this.root.updateBlockedByResize); - if (canSkip) - return; - const { layout, layoutId } = this.options; - /** - * If we have no layout, we can't perform projection, so early return - */ - if (!this.layout || !(layout || layoutId)) - return; - this.resolvedRelativeTargetAt = frameData.timestamp; - const relativeParent = this.getClosestProjectingParent(); - if (relativeParent && - this.linkedParentVersion !== relativeParent.layoutVersion && - !relativeParent.options.layoutRoot) { - this.removeRelativeTarget(); - } - /** - * If we don't have a targetDelta but do have a layout, we can attempt to resolve - * a relativeParent. This will allow a component to perform scale correction - * even if no animation has started. - */ - if (!this.targetDelta && !this.relativeTarget) { - if (this.options.layoutAnchor !== false && - relativeParent && - relativeParent.layout) { - this.createRelativeTarget(relativeParent, this.layout.layoutBox, relativeParent.layout.layoutBox); - } - else { - this.removeRelativeTarget(); - } - } - /** - * If we have no relative target or no target delta our target isn't valid - * for this frame. - */ - if (!this.relativeTarget && !this.targetDelta) - return; - /** - * Lazy-init target data structure - */ - if (!this.target) { - this.target = createBox(); - this.targetWithTransforms = createBox(); - } - /** - * If we've got a relative box for this component, resolve it into a target relative to the parent. - */ - if (this.relativeTarget && - this.relativeTargetOrigin && - this.relativeParent && - this.relativeParent.target) { - this.forceRelativeParentToResolveTarget(); - calcRelativeBox(this.target, this.relativeTarget, this.relativeParent.target, this.options.layoutAnchor || undefined); - /** - * If we've only got a targetDelta, resolve it into a target - */ - } - else if (this.targetDelta) { - if (Boolean(this.resumingFrom)) { - this.applyTransform(this.layout.layoutBox, false, this.target); - } - else { - copyBoxInto(this.target, this.layout.layoutBox); - } - applyBoxDelta(this.target, this.targetDelta); - } - else { - /** - * If no target, use own layout as target - */ - copyBoxInto(this.target, this.layout.layoutBox); - } - /** - * If we've been told to attempt to resolve a relative target, do so. - */ - if (this.attemptToResolveRelativeTarget) { - this.attemptToResolveRelativeTarget = false; - if (this.options.layoutAnchor !== false && - relativeParent && - Boolean(relativeParent.resumingFrom) === - Boolean(this.resumingFrom) && - !relativeParent.options.layoutScroll && - relativeParent.target && - this.animationProgress !== 1) { - this.createRelativeTarget(relativeParent, this.target, relativeParent.target); - } - else { - this.relativeParent = this.relativeTarget = undefined; - } - } - /** - * Increase debug counter for resolved target deltas - */ - if (statsBuffer.value) { - metrics.calculatedTargetDeltas++; - } - } - getClosestProjectingParent() { - if (!this.parent || - hasScale(this.parent.latestValues) || - has2DTranslate(this.parent.latestValues)) { - return undefined; - } - if (this.parent.isProjecting()) { - return this.parent; - } - else { - return this.parent.getClosestProjectingParent(); - } - } - isProjecting() { - return Boolean((this.relativeTarget || - this.targetDelta || - this.options.layoutRoot) && - this.layout); - } - createRelativeTarget(relativeParent, layout, parentLayout) { - this.relativeParent = relativeParent; - this.linkedParentVersion = relativeParent.layoutVersion; - this.forceRelativeParentToResolveTarget(); - this.relativeTarget = createBox(); - this.relativeTargetOrigin = createBox(); - calcRelativePosition(this.relativeTargetOrigin, layout, parentLayout, this.options.layoutAnchor || undefined); - copyBoxInto(this.relativeTarget, this.relativeTargetOrigin); - } - removeRelativeTarget() { - this.relativeParent = this.relativeTarget = undefined; - } - calcProjection() { - const lead = this.getLead(); - const isShared = Boolean(this.resumingFrom) || this !== lead; - let canSkip = true; - /** - * If this is a normal layout animation and neither this node nor its nearest projecting - * is dirty then we can't skip. - */ - if (this.isProjectionDirty || this.parent?.isProjectionDirty) { - canSkip = false; - } - /** - * If this is a shared layout animation and this node's shared projection is dirty then - * we can't skip. - */ - if (isShared && - (this.isSharedProjectionDirty || this.isTransformDirty)) { - canSkip = false; - } - /** - * If we have resolved the target this frame we must recalculate the - * projection to ensure it visually represents the internal calculations. - */ - if (this.resolvedRelativeTargetAt === frameData.timestamp) { - canSkip = false; - } - if (canSkip) - return; - const { layout, layoutId } = this.options; - /** - * If this section of the tree isn't animating we can - * delete our target sources for the following frame. - */ - this.isTreeAnimating = Boolean((this.parent && this.parent.isTreeAnimating) || - this.currentAnimation || - this.pendingAnimation); - if (!this.isTreeAnimating) { - this.targetDelta = this.relativeTarget = undefined; - } - if (!this.layout || !(layout || layoutId)) - return; - /** - * Reset the corrected box with the latest values from box, as we're then going - * to perform mutative operations on it. - */ - copyBoxInto(this.layoutCorrected, this.layout.layoutBox); - /** - * Record previous tree scales before updating. - */ - const prevTreeScaleX = this.treeScale.x; - const prevTreeScaleY = this.treeScale.y; - /** - * Apply all the parent deltas to this box to produce the corrected box. This - * is the layout box, as it will appear on screen as a result of the transforms of its parents. - */ - applyTreeDeltas(this.layoutCorrected, this.treeScale, this.path, isShared); - /** - * If this layer needs to perform scale correction but doesn't have a target, - * use the layout as the target. - */ - if (lead.layout && - !lead.target && - (this.treeScale.x !== 1 || this.treeScale.y !== 1)) { - lead.target = lead.layout.layoutBox; - lead.targetWithTransforms = createBox(); - } - const { target } = lead; - if (!target) { - /** - * If we don't have a target to project into, but we were previously - * projecting, we want to remove the stored transform and schedule - * a render to ensure the elements reflect the removed transform. - */ - if (this.prevProjectionDelta) { - this.createProjectionDeltas(); - this.scheduleRender(); - } - return; - } - if (!this.projectionDelta || !this.prevProjectionDelta) { - this.createProjectionDeltas(); - } - else { - copyAxisDeltaInto(this.prevProjectionDelta.x, this.projectionDelta.x); - copyAxisDeltaInto(this.prevProjectionDelta.y, this.projectionDelta.y); - } - /** - * Update the delta between the corrected box and the target box before user-set transforms were applied. - * This will allow us to calculate the corrected borderRadius and boxShadow to compensate - * for our layout reprojection, but still allow them to be scaled correctly by the user. - * It might be that to simplify this we may want to accept that user-set scale is also corrected - * and we wouldn't have to keep and calc both deltas, OR we could support a user setting - * to allow people to choose whether these styles are corrected based on just the - * layout reprojection or the final bounding box. - */ - calcBoxDelta(this.projectionDelta, this.layoutCorrected, target, this.latestValues); - if (this.treeScale.x !== prevTreeScaleX || - this.treeScale.y !== prevTreeScaleY || - !axisDeltaEquals(this.projectionDelta.x, this.prevProjectionDelta.x) || - !axisDeltaEquals(this.projectionDelta.y, this.prevProjectionDelta.y)) { - this.hasProjected = true; - this.scheduleRender(); - this.notifyListeners("projectionUpdate", target); - } - /** - * Increase debug counter for recalculated projections - */ - if (statsBuffer.value) { - metrics.calculatedProjections++; - } - } - hide() { - this.isVisible = false; - // TODO: Schedule render - } - show() { - this.isVisible = true; - // TODO: Schedule render - } - scheduleRender(notifyAll = true) { - this.options.visualElement?.scheduleRender(); - if (notifyAll) { - const stack = this.getStack(); - stack && stack.scheduleRender(); - } - if (this.resumingFrom && !this.resumingFrom.instance) { - this.resumingFrom = undefined; - } - } - createProjectionDeltas() { - this.prevProjectionDelta = createDelta(); - this.projectionDelta = createDelta(); - this.projectionDeltaWithTransform = createDelta(); - } - setAnimationOrigin(delta, hasOnlyRelativeTargetChanged = false, pathFn) { - const snapshot = this.snapshot; - const snapshotLatestValues = snapshot ? snapshot.latestValues : {}; - const mixedValues = { ...this.latestValues }; - const targetDelta = createDelta(); - if (!this.relativeParent || - !this.relativeParent.options.layoutRoot) { - this.relativeTarget = this.relativeTargetOrigin = undefined; - } - this.attemptToResolveRelativeTarget = !hasOnlyRelativeTargetChanged; - const relativeLayout = createBox(); - const snapshotSource = snapshot ? snapshot.source : undefined; - const layoutSource = this.layout ? this.layout.source : undefined; - const isSharedLayoutAnimation = snapshotSource !== layoutSource; - const stack = this.getStack(); - const isOnlyMember = !stack || stack.members.length <= 1; - const shouldCrossfadeOpacity = Boolean(isSharedLayoutAnimation && - !isOnlyMember && - this.options.crossfade === true && - !this.path.some(hasOpacityCrossfade)); - this.animationProgress = 0; - let prevRelativeTarget; - // The path decides whether the layout shift is worth curving - // (distance floor) and resolves the interpolator from the delta. - const interpolate = pathFn?.interpolateProjection(delta); - this.mixTargetDelta = (latest) => { - const progress = latest / 1000; - const point = interpolate?.(progress); - if (point) { - targetDelta.x.translate = point.x; - targetDelta.x.scale = mixNumber(delta.x.scale, 1, progress); - targetDelta.x.origin = delta.x.origin; - targetDelta.x.originPoint = delta.x.originPoint; - targetDelta.y.translate = point.y; - targetDelta.y.scale = mixNumber(delta.y.scale, 1, progress); - targetDelta.y.origin = delta.y.origin; - targetDelta.y.originPoint = delta.y.originPoint; - } - else { - mixAxisDeltaLinear(targetDelta.x, delta.x, progress); - mixAxisDeltaLinear(targetDelta.y, delta.y, progress); - } - this.setTargetDelta(targetDelta); - if (this.relativeTarget && - this.relativeTargetOrigin && - this.layout && - this.relativeParent && - this.relativeParent.layout) { - calcRelativePosition(relativeLayout, this.layout.layoutBox, this.relativeParent.layout.layoutBox, this.options.layoutAnchor || undefined); - mixBox(this.relativeTarget, this.relativeTargetOrigin, relativeLayout, progress); - /** - * If this is an unchanged relative target we can consider the - * projection not dirty. - */ - if (prevRelativeTarget && - boxEquals(this.relativeTarget, prevRelativeTarget)) { - this.isProjectionDirty = false; - } - if (!prevRelativeTarget) - prevRelativeTarget = createBox(); - copyBoxInto(prevRelativeTarget, this.relativeTarget); - } - if (isSharedLayoutAnimation) { - this.animationValues = mixedValues; - mixValues(mixedValues, snapshotLatestValues, this.latestValues, progress, shouldCrossfadeOpacity, isOnlyMember); - } - if (point && point.rotate !== undefined) { - // Dedicated `pathRotation` channel, not `rotate`, so an - // animating `rotate` is composed with, never clobbered. - if (!this.animationValues) - this.animationValues = mixedValues; - this.animationValues.pathRotation = point.rotate; - } - this.root.scheduleUpdateProjection(); - this.scheduleRender(); - this.animationProgress = progress; - }; - this.mixTargetDelta(this.options.layoutRoot ? 1000 : 0); - } - startAnimation(options) { - this.notifyListeners("animationStart"); - this.currentAnimation?.stop(); - this.resumingFrom?.currentAnimation?.stop(); - if (this.pendingAnimation) { - cancelFrame(this.pendingAnimation); - this.pendingAnimation = undefined; - } - /** - * Start the animation in the next frame to have a frame with progress 0, - * where the target is the same as when the animation started, so we can - * calculate the relative positions correctly for instant transitions. - */ - this.pendingAnimation = frame.update(() => { - globalProjectionState.hasAnimatedSinceResize = true; - this.motionValue || (this.motionValue = motionValue(0)); - this.motionValue.jump(0, false); - this.currentAnimation = animateSingleValue(this.motionValue, [0, 1000], { - ...options, - velocity: 0, - isSync: true, - onUpdate: (latest) => { - this.mixTargetDelta(latest); - options.onUpdate && options.onUpdate(latest); - }, - onComplete: () => { - options.onComplete && options.onComplete(); - this.completeAnimation(); - }, - }); - if (this.resumingFrom) { - this.resumingFrom.currentAnimation = this.currentAnimation; - } - this.pendingAnimation = undefined; - }); - } - completeAnimation() { - if (this.resumingFrom) { - this.resumingFrom.currentAnimation = undefined; - this.resumingFrom.preserveOpacity = undefined; - } - const stack = this.getStack(); - stack && stack.exitAnimationComplete(); - this.resumingFrom = - this.currentAnimation = - this.animationValues = - undefined; - this.notifyListeners("animationComplete"); - } - finishAnimation() { - if (this.currentAnimation) { - this.mixTargetDelta && this.mixTargetDelta(animationTarget); - this.currentAnimation.stop(); - } - this.completeAnimation(); - } - applyTransformsToTarget() { - const lead = this.getLead(); - let { targetWithTransforms, target, layout, latestValues } = lead; - if (!targetWithTransforms || !target || !layout) - return; - /** - * If we're only animating position, and this element isn't the lead element, - * then instead of projecting into the lead box we instead want to calculate - * a new target that aligns the two boxes but maintains the layout shape. - */ - if (this !== lead && - this.layout && - layout && - shouldAnimatePositionOnly(this.options.animationType, this.layout.layoutBox, layout.layoutBox)) { - target = this.target || createBox(); - const xLength = calcLength(this.layout.layoutBox.x); - target.x.min = lead.target.x.min; - target.x.max = target.x.min + xLength; - const yLength = calcLength(this.layout.layoutBox.y); - target.y.min = lead.target.y.min; - target.y.max = target.y.min + yLength; - } - copyBoxInto(targetWithTransforms, target); - /** - * Apply the latest user-set transforms to the targetBox to produce the targetBoxFinal. - * This is the final box that we will then project into by calculating a transform delta and - * applying it to the corrected box. - */ - transformBox(targetWithTransforms, latestValues); - /** - * Update the delta between the corrected box and the final target box, after - * user-set transforms are applied to it. This will be used by the renderer to - * create a transform style that will reproject the element from its layout layout - * into the desired bounding box. - */ - calcBoxDelta(this.projectionDeltaWithTransform, this.layoutCorrected, targetWithTransforms, latestValues); - } - registerSharedNode(layoutId, node) { - if (!this.sharedNodes.has(layoutId)) { - this.sharedNodes.set(layoutId, new NodeStack()); - } - const stack = this.sharedNodes.get(layoutId); - stack.add(node); - const config = node.options.initialPromotionConfig; - node.promote({ - transition: config ? config.transition : undefined, - preserveFollowOpacity: config && config.shouldPreserveFollowOpacity - ? config.shouldPreserveFollowOpacity(node) - : undefined, - }); - } - isLead() { - const stack = this.getStack(); - return stack ? stack.lead === this : true; - } - getLead() { - const { layoutId } = this.options; - return layoutId ? this.getStack()?.lead || this : this; - } - getPrevLead() { - const { layoutId } = this.options; - return layoutId ? this.getStack()?.prevLead : undefined; - } - getStack() { - const { layoutId } = this.options; - if (layoutId) - return this.root.sharedNodes.get(layoutId); - } - promote({ needsReset, transition, preserveFollowOpacity, } = {}) { - const stack = this.getStack(); - if (stack) - stack.promote(this, preserveFollowOpacity); - if (needsReset) { - this.projectionDelta = undefined; - this.needsReset = true; - } - if (transition) - this.setOptions({ transition }); - } - relegate() { - const stack = this.getStack(); - if (stack) { - return stack.relegate(this); - } - else { - return false; - } - } - resetSkewAndRotation() { - const { visualElement } = this.options; - if (!visualElement) - return; - // If there's no detected skew or rotation values, we can early return without a forced render. - let hasDistortingTransform = false; - /** - * An unrolled check for rotation values. Most elements don't have any rotation and - * skipping the nested loop and new object creation is 50% faster. - */ - const { latestValues } = visualElement; - if (latestValues.z || - latestValues.rotate || - latestValues.rotateX || - latestValues.rotateY || - latestValues.rotateZ || - latestValues.skewX || - latestValues.skewY) { - hasDistortingTransform = true; - } - // If there's no distorting values, we don't need to do any more. - if (!hasDistortingTransform) - return; - const resetValues = {}; - if (latestValues.z) { - resetDistortingTransform("z", visualElement, resetValues, this.animationValues); - } - // Check the skew and rotate value of all axes and reset to 0 - for (let i = 0; i < transformAxes.length; i++) { - resetDistortingTransform(`rotate${transformAxes[i]}`, visualElement, resetValues, this.animationValues); - resetDistortingTransform(`skew${transformAxes[i]}`, visualElement, resetValues, this.animationValues); - } - // Force a render of this element to apply the transform with all skews and rotations - // set to 0. - visualElement.render(); - // Put back all the values we reset - for (const key in resetValues) { - visualElement.setStaticValue(key, resetValues[key]); - if (this.animationValues) { - this.animationValues[key] = resetValues[key]; - } - } - // Schedule a render for the next frame. This ensures we won't visually - // see the element with the reset rotate value applied. - visualElement.scheduleRender(); - } - applyProjectionStyles(targetStyle, // CSSStyleDeclaration - doesn't allow numbers to be assigned to properties - styleProp) { - if (!this.instance || this.isSVG) - return; - if (!this.isVisible) { - targetStyle.visibility = "hidden"; - return; - } - const transformTemplate = this.getTransformTemplate(); - if (this.needsReset) { - this.needsReset = false; - targetStyle.visibility = ""; - targetStyle.opacity = ""; - targetStyle.pointerEvents = - resolveMotionValue(styleProp?.pointerEvents) || ""; - targetStyle.transform = transformTemplate - ? transformTemplate(this.latestValues, "") - : "none"; - return; - } - const lead = this.getLead(); - if (!this.projectionDelta || !this.layout || !lead.target) { - if (this.options.layoutId) { - targetStyle.opacity = - this.latestValues.opacity !== undefined - ? this.latestValues.opacity - : 1; - targetStyle.pointerEvents = - resolveMotionValue(styleProp?.pointerEvents) || ""; - } - if (this.hasProjected && !hasTransform(this.latestValues)) { - targetStyle.transform = transformTemplate - ? transformTemplate({}, "") - : "none"; - this.hasProjected = false; - } - return; - } - targetStyle.visibility = ""; - const valuesToRender = lead.animationValues || lead.latestValues; - this.applyTransformsToTarget(); - let transform = buildProjectionTransform(this.projectionDeltaWithTransform, this.treeScale, valuesToRender); - if (transformTemplate) { - transform = transformTemplate(valuesToRender, transform); - } - targetStyle.transform = transform; - const { x, y } = this.projectionDelta; - targetStyle.transformOrigin = `${x.origin * 100}% ${y.origin * 100}% 0`; - if (lead.animationValues) { - /** - * If the lead component is animating, assign this either the entering/leaving - * opacity - */ - targetStyle.opacity = - lead === this - ? valuesToRender.opacity ?? - this.latestValues.opacity ?? - 1 - : this.preserveOpacity - ? this.latestValues.opacity - : valuesToRender.opacityExit; - } - else { - /** - * Or we're not animating at all, set the lead component to its layout - * opacity and other components to hidden. - */ - targetStyle.opacity = - lead === this - ? valuesToRender.opacity !== undefined - ? valuesToRender.opacity - : "" - : valuesToRender.opacityExit !== undefined - ? valuesToRender.opacityExit - : 0; - } - /** - * Apply scale correction - */ - for (const key in scaleCorrectors) { - if (valuesToRender[key] === undefined) - continue; - const { correct, applyTo, isCSSVariable } = scaleCorrectors[key]; - /** - * Only apply scale correction to the value if we have an - * active projection transform. Otherwise these values become - * vulnerable to distortion if the element changes size without - * a corresponding layout animation. - */ - const corrected = transform === "none" - ? valuesToRender[key] - : correct(valuesToRender[key], lead); - if (applyTo) { - const num = applyTo.length; - for (let i = 0; i < num; i++) { - targetStyle[applyTo[i]] = corrected; - } - } - else { - // If this is a CSS variable, set it directly on the instance. - // Replacing this function from creating styles to setting them - // would be a good place to remove per frame object creation - if (isCSSVariable) { - this.options.visualElement.renderState.vars[key] = corrected; - } - else { - targetStyle[key] = corrected; - } - } - } - /** - * Disable pointer events on follow components. This is to ensure - * that if a follow component covers a lead component it doesn't block - * pointer events on the lead. - */ - if (this.options.layoutId) { - targetStyle.pointerEvents = - lead === this - ? resolveMotionValue(styleProp?.pointerEvents) || "" - : "none"; - } - } - clearSnapshot() { - this.resumeFrom = this.snapshot = undefined; - } - // Only run on root - resetTree() { - this.root.nodes.forEach((node) => node.currentAnimation?.stop()); - this.root.nodes.forEach(clearMeasurements); - this.root.sharedNodes.clear(); - } - }; -} -function updateLayout(node) { - node.updateLayout(); -} -function notifyLayoutUpdate(node) { - const snapshot = node.resumeFrom?.snapshot || node.snapshot; - if (node.isLead() && - node.layout && - snapshot && - node.hasListeners("didUpdate")) { - const { layoutBox: layout, measuredBox: measuredLayout } = node.layout; - const { animationType } = node.options; - const isShared = snapshot.source !== node.layout.source; - // TODO Maybe we want to also resize the layout snapshot so we don't trigger - // animations for instance if layout="size" and an element has only changed position - if (animationType === "size") { - eachAxis((axis) => { - const axisSnapshot = isShared - ? snapshot.measuredBox[axis] - : snapshot.layoutBox[axis]; - const length = calcLength(axisSnapshot); - axisSnapshot.min = layout[axis].min; - axisSnapshot.max = axisSnapshot.min + length; - }); - } - else if (animationType === "x" || animationType === "y") { - const snapAxis = animationType === "x" ? "y" : "x"; - copyAxisInto(isShared - ? snapshot.measuredBox[snapAxis] - : snapshot.layoutBox[snapAxis], layout[snapAxis]); - } - else if (shouldAnimatePositionOnly(animationType, snapshot.layoutBox, layout)) { - eachAxis((axis) => { - const axisSnapshot = isShared - ? snapshot.measuredBox[axis] - : snapshot.layoutBox[axis]; - const length = calcLength(layout[axis]); - axisSnapshot.max = axisSnapshot.min + length; - /** - * Ensure relative target gets resized and rerendererd - */ - if (node.relativeTarget && !node.currentAnimation) { - node.isProjectionDirty = true; - node.relativeTarget[axis].max = - node.relativeTarget[axis].min + length; - } - }); - } - const layoutDelta = createDelta(); - calcBoxDelta(layoutDelta, layout, snapshot.layoutBox); - const visualDelta = createDelta(); - if (isShared) { - calcBoxDelta(visualDelta, node.applyTransform(measuredLayout, true), snapshot.measuredBox); - } - else { - calcBoxDelta(visualDelta, layout, snapshot.layoutBox); - } - const hasLayoutChanged = !isDeltaZero(layoutDelta); - let hasRelativeLayoutChanged = false; - if (!node.resumeFrom) { - const relativeParent = node.getClosestProjectingParent(); - /** - * If the relativeParent is itself resuming from a different element then - * the relative snapshot is not relavent - */ - if (relativeParent && !relativeParent.resumeFrom) { - const { snapshot: parentSnapshot, layout: parentLayout } = relativeParent; - if (parentSnapshot && parentLayout) { - const anchor = node.options.layoutAnchor || undefined; - const relativeSnapshot = createBox(); - calcRelativePosition(relativeSnapshot, snapshot.layoutBox, parentSnapshot.layoutBox, anchor); - const relativeLayout = createBox(); - calcRelativePosition(relativeLayout, layout, parentLayout.layoutBox, anchor); - if (!boxEqualsRounded(relativeSnapshot, relativeLayout)) { - hasRelativeLayoutChanged = true; - } - if (relativeParent.options.layoutRoot) { - node.relativeTarget = relativeLayout; - node.relativeTargetOrigin = relativeSnapshot; - node.relativeParent = relativeParent; - } - } - } - } - node.notifyListeners("didUpdate", { - layout, - snapshot, - delta: visualDelta, - layoutDelta, - hasLayoutChanged, - hasRelativeLayoutChanged, - }); - } - else if (node.isLead()) { - const { onExitComplete } = node.options; - onExitComplete && onExitComplete(); - } - /** - * Clearing transition - * TODO: Investigate why this transition is being passed in as {type: false } from Framer - * and why we need it at all - */ - node.options.transition = undefined; -} -function propagateDirtyNodes(node) { - /** - * Increase debug counter for nodes encountered this frame - */ - if (statsBuffer.value) { - metrics.nodes++; - } - if (!node.parent) - return; - /** - * If this node isn't projecting, propagate isProjectionDirty. It will have - * no performance impact but it will allow the next child that *is* projecting - * but *isn't* dirty to just check its parent to see if *any* ancestor needs - * correcting. - */ - if (!node.isProjecting()) { - node.isProjectionDirty = node.parent.isProjectionDirty; - } - /** - * Propagate isSharedProjectionDirty and isTransformDirty - * throughout the whole tree. A future revision can take another look at - * this but for safety we still recalcualte shared nodes. - */ - node.isSharedProjectionDirty || (node.isSharedProjectionDirty = Boolean(node.isProjectionDirty || - node.parent.isProjectionDirty || - node.parent.isSharedProjectionDirty)); - node.isTransformDirty || (node.isTransformDirty = node.parent.isTransformDirty); -} -function cleanDirtyNodes(node) { - node.isProjectionDirty = - node.isSharedProjectionDirty = - node.isTransformDirty = - false; -} -function clearSnapshot(node) { - node.clearSnapshot(); -} -function clearMeasurements(node) { - node.clearMeasurements(); -} -function forceLayoutMeasure(node) { - node.isLayoutDirty = true; - node.updateLayout(); -} -function clearIsLayoutDirty(node) { - node.isLayoutDirty = false; -} -/** - * When a node is animation-blocked (e.g. during drag) and its component - * didn't re-render (memoized), willUpdate() is never called so there's - * no snapshot. Use the previous layout as a snapshot and mark dirty so - * resetTransform/updateLayout/notifyLayoutUpdate process it normally. - */ -function ensureDraggedNodesSnapshotted(node) { - if (node.isAnimationBlocked && node.layout && !node.isLayoutDirty) { - node.snapshot = node.layout; - node.isLayoutDirty = true; - } -} -function resetTransformStyle(node) { - const { visualElement } = node.options; - if (visualElement && visualElement.getProps().onBeforeLayoutMeasure) { - visualElement.notify("BeforeLayoutMeasure"); - } - node.resetTransform(); -} -function finishAnimation(node) { - node.finishAnimation(); - node.targetDelta = node.relativeTarget = node.target = undefined; - node.isProjectionDirty = true; -} -function resolveTargetDelta(node) { - node.resolveTargetDelta(); -} -function calcProjection(node) { - node.calcProjection(); -} -function resetSkewAndRotation(node) { - node.resetSkewAndRotation(); -} -function removeLeadSnapshots(stack) { - stack.removeLeadSnapshot(); -} -function mixAxisDeltaLinear(output, delta, p) { - output.translate = mixNumber(delta.translate, 0, p); - output.scale = mixNumber(delta.scale, 1, p); - output.origin = delta.origin; - output.originPoint = delta.originPoint; -} -function mixAxis(output, from, to, p) { - output.min = mixNumber(from.min, to.min, p); - output.max = mixNumber(from.max, to.max, p); -} -function mixBox(output, from, to, p) { - mixAxis(output.x, from.x, to.x, p); - mixAxis(output.y, from.y, to.y, p); -} -function hasOpacityCrossfade(node) { - return (node.animationValues && node.animationValues.opacityExit !== undefined); -} -const defaultLayoutTransition = { - duration: 0.45, - ease: [0.4, 0, 0.1, 1], -}; -const userAgentContains = (string) => typeof navigator !== "undefined" && - navigator.userAgent && - navigator.userAgent.toLowerCase().includes(string); -/** - * Measured bounding boxes must be rounded in Safari and - * left untouched in Chrome, otherwise non-integer layouts within scaled-up elements - * can appear to jump. - */ -const roundPoint = userAgentContains("applewebkit/") && !userAgentContains("chrome/") - ? Math.round - : noop; -function roundAxis(axis) { - // Round to the nearest .5 pixels to support subpixel layouts - axis.min = roundPoint(axis.min); - axis.max = roundPoint(axis.max); -} -function roundBox(box) { - roundAxis(box.x); - roundAxis(box.y); -} -function shouldAnimatePositionOnly(animationType, snapshot, layout) { - return (animationType === "position" || - (animationType === "preserve-aspect" && - !isNear(aspectRatio(snapshot), aspectRatio(layout), 0.2))); -} -function checkNodeWasScrollRoot(node) { - return node !== node.root && node.scroll?.wasRoot; -} - -export { cleanDirtyNodes, createProjectionNode, mixAxis, mixBox, propagateDirtyNodes }; -//# sourceMappingURL=create-projection-node.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/node/create-projection-node.mjs.map b/node_modules/motion-dom/dist/es/projection/node/create-projection-node.mjs.map deleted file mode 100644 index 20479b7..0000000 --- a/node_modules/motion-dom/dist/es/projection/node/create-projection-node.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"create-projection-node.mjs","sources":["../../../../src/projection/node/create-projection-node.ts"],"sourcesContent":["import {\n Axis,\n AxisDelta,\n Box,\n clamp,\n Delta,\n noop,\n Point,\n SubscriptionManager,\n} from \"motion-utils\"\nimport { animateSingleValue } from \"../../animation/animate/single-value\"\nimport { JSAnimation } from \"../../animation/JSAnimation\"\nimport { getOptimisedAppearId } from \"../../animation/optimized-appear/get-appear-id\"\nimport {\n MotionPath,\n PathInterpolator,\n Transition,\n ValueAnimationOptions,\n} from \"../../animation/types\"\nimport { getValueTransition } from \"../../animation/utils/get-value-transition\"\nimport { cancelFrame, frame, frameData, frameSteps } from \"../../frameloop\"\nimport { microtask } from \"../../frameloop/microtask\"\nimport { time } from \"../../frameloop/sync-time\"\nimport type { Process } from \"../../frameloop/types\"\nimport { HTMLVisualElement } from \"../../render/html/HTMLVisualElement\"\nimport type { ResolvedValues } from \"../../render/types\"\nimport { scaleCorrectors } from \"../../render/utils/is-forced-motion-value\"\nimport type { MotionStyle, VisualElement } from \"../../render/VisualElement\"\nimport { statsBuffer } from \"../../stats/buffer\"\nimport { delay } from \"../../utils/delay\"\nimport { isSVGElement } from \"../../utils/is-svg-element\"\nimport { isSVGSVGElement } from \"../../utils/is-svg-svg-element\"\nimport { mixNumber } from \"../../utils/mix/number\"\nimport { MotionValue, motionValue } from \"../../value\"\nimport { resolveMotionValue } from \"../../value/utils/resolve-motion-value\"\nimport { mixValues } from \"../animation/mix-values\"\nimport { copyAxisDeltaInto, copyAxisInto, copyBoxInto } from \"../geometry/copy\"\nimport {\n applyBoxDelta,\n applyTreeDeltas,\n transformBox,\n translateAxis,\n} from \"../geometry/delta-apply\"\nimport {\n calcBoxDelta,\n calcLength,\n calcRelativeBox,\n calcRelativePosition,\n isNear,\n} from \"../geometry/delta-calc\"\nimport { removeBoxTransforms } from \"../geometry/delta-remove\"\nimport { createBox, createDelta } from \"../geometry/models\"\nimport {\n aspectRatio,\n axisDeltaEquals,\n boxEquals,\n boxEqualsRounded,\n isDeltaZero,\n} from \"../geometry/utils\"\nimport { NodeStack } from \"../shared/stack\"\nimport { buildProjectionTransform } from \"../styles/transform\"\nimport { eachAxis } from \"../utils/each-axis\"\nimport { FlatTree } from \"../utils/flat-tree\"\nimport { has2DTranslate, hasScale, hasTransform } from \"../utils/has-transform\"\nimport { globalProjectionState } from \"./state\"\nimport {\n IProjectionNode,\n LayoutEvents,\n LayoutUpdateData,\n Measurements,\n Phase,\n ProjectionNodeConfig,\n ProjectionNodeOptions,\n ScrollMeasurements,\n} from \"./types\"\n\nconst metrics = {\n nodes: 0,\n calculatedTargetDeltas: 0,\n calculatedProjections: 0,\n}\n\nconst transformAxes = [\"\", \"X\", \"Y\", \"Z\"]\n\n/**\n * We use 1000 as the animation target as 0-1000 maps better to pixels than 0-1\n * which has a noticeable difference in spring animations\n */\nconst animationTarget = 1000\n\nlet id = 0\n\nfunction resetDistortingTransform(\n key: string,\n visualElement: VisualElement,\n values: ResolvedValues,\n sharedAnimationValues?: ResolvedValues\n) {\n const { latestValues } = visualElement\n\n // Record the distorting transform and then temporarily set it to 0\n if (latestValues[key]) {\n values[key] = latestValues[key]\n visualElement.setStaticValue(key, 0)\n if (sharedAnimationValues) {\n sharedAnimationValues[key] = 0\n }\n }\n}\n\nfunction cancelTreeOptimisedTransformAnimations(\n projectionNode: IProjectionNode\n) {\n projectionNode.hasCheckedOptimisedAppear = true\n if (projectionNode.root === projectionNode) return\n\n const { visualElement } = projectionNode.options\n\n if (!visualElement) return\n\n const appearId = getOptimisedAppearId(visualElement)\n\n if (window.MotionHasOptimisedAnimation!(appearId, \"transform\")) {\n const { layout, layoutId } = projectionNode.options\n window.MotionCancelOptimisedAnimation!(\n appearId,\n \"transform\",\n frame,\n !(layout || layoutId)\n )\n }\n\n const { parent } = projectionNode\n if (parent && !parent.hasCheckedOptimisedAppear) {\n cancelTreeOptimisedTransformAnimations(parent)\n }\n}\n\nexport function createProjectionNode({\n attachResizeListener,\n defaultParent,\n measureScroll,\n checkIsScrollRoot,\n resetTransform,\n}: ProjectionNodeConfig) {\n return class ProjectionNode implements IProjectionNode {\n /**\n * A unique ID generated for every projection node.\n */\n id: number = id++\n\n /**\n * An id that represents a unique session instigated by startUpdate.\n */\n animationId: number = 0\n\n animationCommitId = 0\n\n /**\n * A reference to the platform-native node (currently this will be a HTMLElement).\n */\n instance: I | undefined\n\n /**\n * A reference to the root projection node. There'll only ever be one tree and one root.\n */\n root: IProjectionNode\n\n /**\n * A reference to this node's parent.\n */\n parent?: IProjectionNode\n\n /**\n * A path from this node to the root node. This provides a fast way to iterate\n * back up the tree.\n */\n path: IProjectionNode[]\n\n /**\n * A Set containing all this component's children. This is used to iterate\n * through the children.\n *\n * TODO: This could be faster to iterate as a flat array stored on the root node.\n */\n children = new Set()\n\n /**\n * Options for the node. We use this to configure what kind of layout animations\n * we should perform (if any).\n */\n options: ProjectionNodeOptions = {}\n\n /**\n * A snapshot of the element's state just before the current update. This is\n * hydrated when this node's `willUpdate` method is called and scrubbed at the\n * end of the tree's `didUpdate` method.\n */\n snapshot: Measurements | undefined\n\n /**\n * A box defining the element's layout relative to the page. This will have been\n * captured with all parent scrolls and projection transforms unset.\n */\n layout: Measurements | undefined\n\n /**\n * The layout used to calculate the previous layout animation. We use this to compare\n * layouts between renders and decide whether we need to trigger a new layout animation\n * or just let the current one play out.\n */\n targetLayout?: Box\n\n /**\n * A mutable data structure we use to apply all parent transforms currently\n * acting on the element's layout. It's from here we can calculate the projectionDelta\n * required to get the element from its layout into its calculated target box.\n */\n layoutCorrected: Box\n\n /**\n * An ideal projection transform we want to apply to the element. This is calculated,\n * usually when an element's layout has changed, and we want the element to look as though\n * its in its previous layout on the next frame. From there, we animated it down to 0\n * to animate the element to its new layout.\n */\n targetDelta?: Delta\n\n /**\n * A mutable structure representing the visual bounding box on the page where we want\n * and element to appear. This can be set directly but is currently derived once a frame\n * from apply targetDelta to layout.\n */\n target?: Box\n\n /**\n * A mutable structure describing a visual bounding box relative to the element's\n * projected parent. If defined, target will be derived from this rather than targetDelta.\n * If not defined, we'll attempt to calculate on the first layout animation frame\n * based on the targets calculated from targetDelta. This will transfer a layout animation\n * from viewport-relative to parent-relative.\n */\n relativeTarget?: Box\n\n relativeTargetOrigin?: Box\n relativeParent?: IProjectionNode\n\n /**\n * We use this to detect when its safe to shut down part of a projection tree.\n * We have to keep projecting children for scale correction and relative projection\n * until all their parents stop performing layout animations.\n */\n isTreeAnimating = false\n\n isAnimationBlocked = false\n\n /**\n * If true, attempt to resolve relativeTarget.\n */\n attemptToResolveRelativeTarget?: boolean\n\n /**\n * A mutable structure that represents the target as transformed by the element's\n * latest user-set transforms (ie scale, x)\n */\n targetWithTransforms?: Box\n\n /**\n * The previous projection delta, which we can compare with the newly calculated\n * projection delta to see if we need to render.\n */\n prevProjectionDelta?: Delta\n\n /**\n * A calculated transform that will project an element from its layoutCorrected\n * into the target. This will be used by children to calculate their own layoutCorrect boxes.\n */\n projectionDelta?: Delta\n\n /**\n * A calculated transform that will project an element from its layoutCorrected\n * into the targetWithTransforms.\n */\n projectionDeltaWithTransform?: Delta\n\n /**\n * If we're tracking the scroll of this element, we store it here.\n */\n scroll?: ScrollMeasurements\n\n /**\n * Flag to true if we think this layout has been changed. We can't always know this,\n * currently we set it to true every time a component renders, or if it has a layoutDependency\n * if that has changed between renders. Additionally, components can be grouped by LayoutGroup\n * and if one node is dirtied, they all are.\n */\n isLayoutDirty = false\n\n /**\n * Flag to true if we think the projection calculations for this node needs\n * recalculating as a result of an updated transform or layout animation.\n */\n isProjectionDirty = false\n\n /**\n * Flag to true if the layout *or* transform has changed. This then gets propagated\n * throughout the projection tree, forcing any element below to recalculate on the next frame.\n */\n isSharedProjectionDirty = false\n\n /**\n * Flag transform dirty. This gets propagated throughout the whole tree but is only\n * respected by shared nodes.\n */\n isTransformDirty = false\n\n /**\n * Block layout updates for instant layout transitions throughout the tree.\n */\n updateManuallyBlocked = false\n\n updateBlockedByResize = false\n\n /**\n * Set to true between the start of the first `willUpdate` call and the end of the `didUpdate`\n * call.\n */\n isUpdating = false\n\n /**\n * If this is an SVG element we currently disable projection transforms\n */\n isSVG = false\n\n /**\n * Flag to true (during promotion) if a node doing an instant layout transition needs to reset\n * its projection styles.\n */\n needsReset = false\n\n /**\n * Flags whether this node should have its transform reset prior to measuring.\n */\n shouldResetTransform = false\n\n /**\n * Store whether this node has been checked for optimised appear animations. As\n * effects fire bottom-up, and we want to look up the tree for appear animations,\n * this makes sure we only check each path once, stopping at nodes that\n * have already been checked.\n */\n hasCheckedOptimisedAppear = false\n\n /**\n * An object representing the calculated contextual/accumulated/tree scale.\n * This will be used to scale calculcated projection transforms, as these are\n * calculated in screen-space but need to be scaled for elements to layoutly\n * make it to their calculated destinations.\n *\n * TODO: Lazy-init\n */\n treeScale: Point = { x: 1, y: 1 }\n\n /**\n * Is hydrated with a projection node if an element is animating from another.\n */\n resumeFrom?: IProjectionNode\n\n /**\n * Is hydrated with a projection node if an element is animating from another.\n */\n resumingFrom?: IProjectionNode\n\n /**\n * A reference to the element's latest animated values. This is a reference shared\n * between the element's VisualElement and the ProjectionNode.\n */\n latestValues: ResolvedValues\n\n /**\n *\n */\n eventHandlers = new Map>()\n\n nodes?: FlatTree\n\n depth: number\n\n /**\n * If transformTemplate generates a different value before/after the\n * update, we need to reset the transform.\n */\n prevTransformTemplateValue: string | undefined\n\n preserveOpacity?: boolean\n\n hasTreeAnimated = false\n\n layoutVersion: number = 0\n\n constructor(\n latestValues: ResolvedValues = {},\n parent: IProjectionNode | undefined = defaultParent?.()\n ) {\n this.latestValues = latestValues\n this.root = parent ? parent.root || parent : this\n this.path = parent ? [...parent.path, parent] : []\n this.parent = parent\n\n this.depth = parent ? parent.depth + 1 : 0\n\n for (let i = 0; i < this.path.length; i++) {\n this.path[i].shouldResetTransform = true\n }\n\n if (this.root === this) this.nodes = new FlatTree()\n }\n\n addEventListener(name: LayoutEvents, handler: any) {\n if (!this.eventHandlers.has(name)) {\n this.eventHandlers.set(name, new SubscriptionManager())\n }\n\n return this.eventHandlers.get(name)!.add(handler)\n }\n\n notifyListeners(name: LayoutEvents, ...args: any) {\n const subscriptionManager = this.eventHandlers.get(name)\n subscriptionManager && subscriptionManager.notify(...args)\n }\n\n hasListeners(name: LayoutEvents) {\n return this.eventHandlers.has(name)\n }\n\n /**\n * Lifecycles\n */\n mount(instance: I) {\n if (this.instance) return\n\n this.isSVG = isSVGElement(instance) && !isSVGSVGElement(instance)\n\n this.instance = instance\n\n const { layoutId, layout, visualElement } = this.options\n if (visualElement && !visualElement.current) {\n visualElement.mount(instance)\n }\n\n this.root.nodes!.add(this)\n this.parent && this.parent.children.add(this)\n\n if (this.root.hasTreeAnimated && (layout || layoutId)) {\n this.isLayoutDirty = true\n }\n\n if (attachResizeListener) {\n let cancelDelay: VoidFunction\n let innerWidth = 0\n\n const resizeUnblockUpdate = () =>\n (this.root.updateBlockedByResize = false)\n\n // Set initial innerWidth in a frame.read callback to batch the read\n frame.read(() => {\n innerWidth = window.innerWidth\n })\n\n attachResizeListener(instance, () => {\n const newInnerWidth = window.innerWidth\n if (newInnerWidth === innerWidth) return\n\n innerWidth = newInnerWidth\n\n this.root.updateBlockedByResize = true\n\n cancelDelay && cancelDelay()\n cancelDelay = delay(resizeUnblockUpdate, 250)\n\n if (globalProjectionState.hasAnimatedSinceResize) {\n globalProjectionState.hasAnimatedSinceResize = false\n this.nodes!.forEach(finishAnimation)\n }\n })\n }\n\n if (layoutId) {\n this.root.registerSharedNode(layoutId, this)\n }\n\n // Only register the handler if it requires layout animation\n if (\n this.options.animate !== false &&\n visualElement &&\n (layoutId || layout)\n ) {\n this.addEventListener(\n \"didUpdate\",\n ({\n delta,\n hasLayoutChanged,\n hasRelativeLayoutChanged,\n layout: newLayout,\n }: LayoutUpdateData) => {\n if (this.isTreeAnimationBlocked()) {\n this.target = undefined\n this.relativeTarget = undefined\n return\n }\n\n // TODO: Check here if an animation exists\n const layoutTransition =\n this.options.transition ||\n visualElement.getDefaultTransition() ||\n defaultLayoutTransition\n\n const {\n onLayoutAnimationStart,\n onLayoutAnimationComplete,\n } = visualElement.getProps()\n\n /**\n * The target layout of the element might stay the same,\n * but its position relative to its parent has changed.\n */\n const hasTargetChanged =\n !this.targetLayout ||\n !boxEqualsRounded(this.targetLayout, newLayout)\n /*\n * Note: Disabled to fix relative animations always triggering new\n * layout animations. If this causes further issues, we can try\n * a different approach to detecting relative target changes.\n */\n // || hasRelativeLayoutChanged\n\n /**\n * If the layout hasn't seemed to have changed, it might be that the\n * element is visually in the same place in the document but its position\n * relative to its parent has indeed changed. So here we check for that.\n */\n const hasOnlyRelativeTargetChanged =\n !hasLayoutChanged && hasRelativeLayoutChanged\n\n if (\n this.options.layoutRoot ||\n this.resumeFrom ||\n hasOnlyRelativeTargetChanged ||\n (hasLayoutChanged &&\n (hasTargetChanged || !this.currentAnimation))\n ) {\n if (this.resumeFrom) {\n this.resumingFrom = this.resumeFrom\n this.resumingFrom.resumingFrom = undefined\n }\n\n const animationOptions = {\n ...getValueTransition(\n layoutTransition,\n \"layout\"\n ),\n onPlay: onLayoutAnimationStart,\n onComplete: onLayoutAnimationComplete,\n }\n\n if (\n visualElement.shouldReduceMotion ||\n this.options.layoutRoot\n ) {\n animationOptions.delay = 0\n animationOptions.type = false\n }\n\n this.startAnimation(animationOptions)\n /**\n * Set animation origin after starting animation to avoid layout jump\n * caused by stopping previous layout animation\n */\n this.setAnimationOrigin(\n delta,\n hasOnlyRelativeTargetChanged,\n (animationOptions as { path?: MotionPath })\n .path\n )\n } else {\n /**\n * If the layout hasn't changed and we have an animation that hasn't started yet,\n * finish it immediately. Otherwise it will be animating from a location\n * that was probably never committed to screen and look like a jumpy box.\n */\n\n if (!hasLayoutChanged) {\n finishAnimation(this)\n }\n\n if (this.isLead() && this.options.onExitComplete) {\n this.options.onExitComplete()\n }\n }\n\n this.targetLayout = newLayout\n }\n )\n }\n }\n\n unmount() {\n this.options.layoutId && this.willUpdate()\n this.root.nodes!.remove(this)\n const stack = this.getStack()\n stack && stack.remove(this)\n this.parent && this.parent.children.delete(this)\n this.instance = undefined\n this.eventHandlers.clear()\n\n cancelFrame(this.updateProjection)\n }\n\n // only on the root\n blockUpdate() {\n this.updateManuallyBlocked = true\n }\n\n unblockUpdate() {\n this.updateManuallyBlocked = false\n }\n\n isUpdateBlocked() {\n return this.updateManuallyBlocked || this.updateBlockedByResize\n }\n\n isTreeAnimationBlocked() {\n return (\n this.isAnimationBlocked ||\n (this.parent && this.parent.isTreeAnimationBlocked()) ||\n false\n )\n }\n\n // Note: currently only running on root node\n startUpdate() {\n if (this.isUpdateBlocked()) return\n\n this.isUpdating = true\n\n this.nodes && this.nodes.forEach(resetSkewAndRotation)\n this.animationId++\n }\n\n getTransformTemplate() {\n const { visualElement } = this.options\n return visualElement && visualElement.getProps().transformTemplate\n }\n\n willUpdate(shouldNotifyListeners = true) {\n this.root.hasTreeAnimated = true\n\n if (this.root.isUpdateBlocked()) {\n this.options.onExitComplete && this.options.onExitComplete()\n return\n }\n\n /**\n * If we're running optimised appear animations then these must be\n * cancelled before measuring the DOM. This is so we can measure\n * the true layout of the element rather than the WAAPI animation\n * which will be unaffected by the resetSkewAndRotate step.\n *\n * Note: This is a DOM write. Worst case scenario is this is sandwiched\n * between other snapshot reads which will cause unnecessary style recalculations.\n * This has to happen here though, as we don't yet know which nodes will need\n * snapshots in startUpdate(), but we only want to cancel optimised animations\n * if a layout animation measurement is actually going to be affected by them.\n */\n if (\n window.MotionCancelOptimisedAnimation &&\n !this.hasCheckedOptimisedAppear\n ) {\n cancelTreeOptimisedTransformAnimations(this)\n }\n\n !this.root.isUpdating && this.root.startUpdate()\n\n if (this.isLayoutDirty) return\n\n this.isLayoutDirty = true\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i]\n node.shouldResetTransform = true\n\n /**\n * Percentage translates resolve against layoutBox dimensions,\n * so ancestors with them must be re-measured after transform reset.\n */\n if (\n typeof node.latestValues.x === \"string\" ||\n typeof node.latestValues.y === \"string\"\n ) {\n node.isLayoutDirty = true\n }\n\n node.updateScroll(\"snapshot\")\n\n if (node.options.layoutRoot) {\n node.willUpdate(false)\n }\n }\n\n const { layoutId, layout } = this.options\n if (layoutId === undefined && !layout) return\n\n const transformTemplate = this.getTransformTemplate()\n this.prevTransformTemplateValue = transformTemplate\n ? transformTemplate(this.latestValues, \"\")\n : undefined\n\n this.updateSnapshot()\n shouldNotifyListeners && this.notifyListeners(\"willUpdate\")\n }\n\n // Note: Currently only running on root node\n updateScheduled = false\n\n update() {\n this.updateScheduled = false\n\n const updateWasBlocked = this.isUpdateBlocked()\n\n // When doing an instant transition, we skip the layout update,\n // but should still clean up the measurements so that the next\n // snapshot could be taken correctly.\n if (updateWasBlocked) {\n const wasBlockedByResize = this.updateBlockedByResize\n\n this.unblockUpdate()\n this.updateBlockedByResize = false\n this.clearAllSnapshots()\n\n /**\n * When blocked by resize, still measure layouts so\n * callbacks like onLayoutMeasure fire (e.g. Reorder).\n * Skip notifyLayoutUpdate to prevent animations.\n */\n if (wasBlockedByResize) {\n this.nodes!.forEach(forceLayoutMeasure)\n }\n\n this.nodes!.forEach(clearMeasurements)\n return\n }\n\n /**\n * If this is a repeat of didUpdate then ignore the animation.\n */\n if (this.animationId <= this.animationCommitId) {\n this.nodes!.forEach(clearIsLayoutDirty)\n return\n }\n\n this.animationCommitId = this.animationId\n\n if (!this.isUpdating) {\n this.nodes!.forEach(clearIsLayoutDirty)\n } else {\n this.isUpdating = false\n\n /**\n * Ensure animation-blocked nodes (e.g. during drag)\n * get measured even when memoized (willUpdate skipped).\n */\n this.nodes!.forEach(ensureDraggedNodesSnapshotted)\n\n /**\n * Write\n */\n this.nodes!.forEach(resetTransformStyle)\n\n /**\n * Read ==================\n */\n // Update layout measurements of updated children\n this.nodes!.forEach(updateLayout)\n\n /**\n * Write\n */\n // Notify listeners that the layout is updated\n this.nodes!.forEach(notifyLayoutUpdate)\n }\n\n this.clearAllSnapshots()\n\n /**\n * Manually flush any pending updates. Ideally\n * we could leave this to the following requestAnimationFrame but this seems\n * to leave a flash of incorrectly styled content.\n */\n const now = time.now()\n frameData.delta = clamp(0, 1000 / 60, now - frameData.timestamp)\n frameData.timestamp = now\n frameData.isProcessing = true\n frameSteps.update.process(frameData)\n frameSteps.preRender.process(frameData)\n frameSteps.render.process(frameData)\n frameData.isProcessing = false\n }\n\n scheduleUpdate = () => this.update()\n\n didUpdate() {\n if (!this.updateScheduled) {\n this.updateScheduled = true\n microtask.read(this.scheduleUpdate)\n }\n }\n\n clearAllSnapshots() {\n this.nodes!.forEach(clearSnapshot)\n this.sharedNodes.forEach(removeLeadSnapshots)\n }\n\n projectionUpdateScheduled = false\n scheduleUpdateProjection() {\n if (!this.projectionUpdateScheduled) {\n this.projectionUpdateScheduled = true\n frame.preRender(this.updateProjection, false, true)\n }\n }\n\n scheduleCheckAfterUnmount() {\n /**\n * If the unmounting node is in a layoutGroup and did trigger a willUpdate,\n * we manually call didUpdate to give a chance to the siblings to animate.\n * Otherwise, cleanup all snapshots to prevents future nodes from reusing them.\n */\n frame.postRender(() => {\n if (this.isLayoutDirty) {\n this.root.didUpdate()\n } else {\n this.root.checkUpdateFailed()\n }\n })\n }\n\n checkUpdateFailed = () => {\n if (this.isUpdating) {\n this.isUpdating = false\n this.clearAllSnapshots()\n }\n }\n\n /**\n * This is a multi-step process as shared nodes might be of different depths. Nodes\n * are sorted by depth order, so we need to resolve the entire tree before moving to\n * the next step.\n */\n updateProjection = () => {\n this.projectionUpdateScheduled = false\n\n /**\n * Reset debug counts. Manually resetting rather than creating a new\n * object each frame.\n */\n if (statsBuffer.value) {\n metrics.nodes =\n metrics.calculatedTargetDeltas =\n metrics.calculatedProjections =\n 0\n }\n\n this.nodes!.forEach(propagateDirtyNodes)\n this.nodes!.forEach(resolveTargetDelta)\n this.nodes!.forEach(calcProjection)\n this.nodes!.forEach(cleanDirtyNodes)\n\n if (statsBuffer.addProjectionMetrics) {\n statsBuffer.addProjectionMetrics(metrics)\n }\n }\n\n /**\n * Update measurements\n */\n updateSnapshot() {\n if (this.snapshot || !this.instance) return\n\n this.snapshot = this.measure()\n\n if (\n this.snapshot &&\n !calcLength(this.snapshot.measuredBox.x) &&\n !calcLength(this.snapshot.measuredBox.y)\n ) {\n this.snapshot = undefined\n }\n }\n\n updateLayout() {\n if (!this.instance) return\n\n this.updateScroll()\n\n if (\n !(this.options.alwaysMeasureLayout && this.isLead()) &&\n !this.isLayoutDirty\n ) {\n return\n }\n\n /**\n * When a node is mounted, it simply resumes from the prevLead's\n * snapshot instead of taking a new one, but the ancestors scroll\n * might have updated while the prevLead is unmounted. We need to\n * update the scroll again to make sure the layout we measure is\n * up to date.\n */\n if (this.resumeFrom && !this.resumeFrom.instance) {\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i]\n node.updateScroll()\n }\n }\n\n const prevLayout = this.layout\n this.layout = this.measure(false)\n this.layoutVersion++\n if (!this.layoutCorrected) this.layoutCorrected = createBox()\n this.isLayoutDirty = false\n this.projectionDelta = undefined\n this.notifyListeners(\"measure\", this.layout.layoutBox)\n\n const { visualElement } = this.options\n visualElement &&\n visualElement.notify(\n \"LayoutMeasure\",\n this.layout.layoutBox,\n prevLayout ? prevLayout.layoutBox : undefined\n )\n }\n\n updateScroll(phase: Phase = \"measure\") {\n let needsMeasurement = Boolean(\n this.options.layoutScroll && this.instance\n )\n\n if (\n this.scroll &&\n this.scroll.animationId === this.root.animationId &&\n this.scroll.phase === phase\n ) {\n needsMeasurement = false\n }\n\n if (needsMeasurement && this.instance) {\n const isRoot = checkIsScrollRoot(this.instance)\n this.scroll = {\n animationId: this.root.animationId,\n phase,\n isRoot,\n offset: measureScroll(this.instance),\n wasRoot: this.scroll ? this.scroll.isRoot : isRoot,\n }\n }\n }\n\n resetTransform() {\n if (!resetTransform) return\n\n const isResetRequested =\n this.isLayoutDirty ||\n this.shouldResetTransform ||\n this.options.alwaysMeasureLayout\n\n const hasProjection =\n this.projectionDelta && !isDeltaZero(this.projectionDelta)\n\n const transformTemplate = this.getTransformTemplate()\n const transformTemplateValue = transformTemplate\n ? transformTemplate(this.latestValues, \"\")\n : undefined\n\n const transformTemplateHasChanged =\n transformTemplateValue !== this.prevTransformTemplateValue\n\n if (\n isResetRequested &&\n this.instance &&\n (hasProjection ||\n hasTransform(this.latestValues) ||\n transformTemplateHasChanged)\n ) {\n resetTransform(this.instance, transformTemplateValue)\n this.shouldResetTransform = false\n this.scheduleRender()\n }\n }\n\n measure(removeTransform = true) {\n const pageBox = this.measurePageBox()\n\n let layoutBox = this.removeElementScroll(pageBox)\n\n /**\n * Measurements taken during the pre-render stage\n * still have transforms applied so we remove them\n * via calculation.\n */\n if (removeTransform) {\n layoutBox = this.removeTransform(layoutBox)\n }\n\n roundBox(layoutBox)\n\n return {\n animationId: this.root.animationId,\n measuredBox: pageBox,\n layoutBox,\n latestValues: {},\n source: this.id,\n }\n }\n\n measurePageBox() {\n const { visualElement } = this.options\n if (!visualElement) return createBox()\n\n const box = visualElement.measureViewportBox()\n\n const wasInScrollRoot =\n this.scroll?.wasRoot || this.path.some(checkNodeWasScrollRoot)\n\n if (!wasInScrollRoot) {\n // Remove viewport scroll to give page-relative coordinates\n const { scroll } = this.root\n if (scroll) {\n translateAxis(box.x, scroll.offset.x)\n translateAxis(box.y, scroll.offset.y)\n }\n }\n\n return box\n }\n\n removeElementScroll(box: Box): Box {\n const boxWithoutScroll = createBox()\n copyBoxInto(boxWithoutScroll, box)\n\n if (this.scroll?.wasRoot) {\n return boxWithoutScroll\n }\n\n /**\n * Performance TODO: Keep a cumulative scroll offset down the tree\n * rather than loop back up the path.\n */\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i]\n const { scroll, options } = node\n\n if (node !== this.root && scroll && options.layoutScroll) {\n /**\n * If this is a new scroll root, we want to remove all previous scrolls\n * from the viewport box.\n */\n if (scroll.wasRoot) {\n copyBoxInto(boxWithoutScroll, box)\n }\n\n translateAxis(boxWithoutScroll.x, scroll.offset.x)\n translateAxis(boxWithoutScroll.y, scroll.offset.y)\n }\n }\n\n return boxWithoutScroll\n }\n\n applyTransform(box: Box, transformOnly = false, output?: Box): Box {\n const withTransforms = output || createBox()\n copyBoxInto(withTransforms, box)\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i]\n\n if (\n !transformOnly &&\n node.options.layoutScroll &&\n node.scroll &&\n node !== node.root\n ) {\n translateAxis(withTransforms.x, -node.scroll.offset.x)\n translateAxis(withTransforms.y, -node.scroll.offset.y)\n }\n\n if (!hasTransform(node.latestValues)) continue\n transformBox(\n withTransforms,\n node.latestValues,\n node.layout?.layoutBox\n )\n }\n\n if (hasTransform(this.latestValues)) {\n transformBox(\n withTransforms,\n this.latestValues,\n this.layout?.layoutBox\n )\n }\n\n return withTransforms\n }\n\n removeTransform(box: Box): Box {\n const boxWithoutTransform = createBox()\n copyBoxInto(boxWithoutTransform, box)\n\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i]\n if (!hasTransform(node.latestValues)) continue\n\n let sourceBox: Box | undefined\n\n if (node.instance) {\n hasScale(node.latestValues) && node.updateSnapshot()\n sourceBox = createBox()\n copyBoxInto(sourceBox, node.measurePageBox())\n }\n\n removeBoxTransforms(\n boxWithoutTransform,\n node.latestValues,\n node.snapshot?.layoutBox,\n sourceBox\n )\n }\n\n if (hasTransform(this.latestValues)) {\n removeBoxTransforms(boxWithoutTransform, this.latestValues)\n }\n\n return boxWithoutTransform\n }\n\n setTargetDelta(delta: Delta) {\n this.targetDelta = delta\n this.root.scheduleUpdateProjection()\n this.isProjectionDirty = true\n }\n\n setOptions(options: ProjectionNodeOptions) {\n this.options = {\n ...this.options,\n ...options,\n crossfade:\n options.crossfade !== undefined ? options.crossfade : true,\n }\n }\n\n clearMeasurements() {\n this.scroll = undefined\n this.layout = undefined\n this.snapshot = undefined\n this.prevTransformTemplateValue = undefined\n this.targetDelta = undefined\n this.target = undefined\n this.isLayoutDirty = false\n }\n\n forceRelativeParentToResolveTarget() {\n if (!this.relativeParent) return\n\n /**\n * If the parent target isn't up-to-date, force it to update.\n * This is an unfortunate de-optimisation as it means any updating relative\n * projection will cause all the relative parents to recalculate back\n * up the tree.\n */\n if (\n this.relativeParent.resolvedRelativeTargetAt !==\n frameData.timestamp\n ) {\n this.relativeParent.resolveTargetDelta(true)\n }\n }\n\n /**\n * Frame calculations\n */\n resolvedRelativeTargetAt: number = 0.0\n resolveTargetDelta(forceRecalculation = false) {\n /**\n * Once the dirty status of nodes has been spread through the tree, we also\n * need to check if we have a shared node of a different depth that has itself\n * been dirtied.\n */\n const lead = this.getLead()\n this.isProjectionDirty ||= lead.isProjectionDirty\n this.isTransformDirty ||= lead.isTransformDirty\n this.isSharedProjectionDirty ||= lead.isSharedProjectionDirty\n\n const isShared = Boolean(this.resumingFrom) || this !== lead\n\n /**\n * We don't use transform for this step of processing so we don't\n * need to check whether any nodes have changed transform.\n */\n const canSkip = !(\n forceRecalculation ||\n (isShared && this.isSharedProjectionDirty) ||\n this.isProjectionDirty ||\n this.parent?.isProjectionDirty ||\n this.attemptToResolveRelativeTarget ||\n this.root.updateBlockedByResize\n )\n\n if (canSkip) return\n\n const { layout, layoutId } = this.options\n\n /**\n * If we have no layout, we can't perform projection, so early return\n */\n if (!this.layout || !(layout || layoutId)) return\n\n this.resolvedRelativeTargetAt = frameData.timestamp\n\n const relativeParent = this.getClosestProjectingParent()\n\n if (\n relativeParent &&\n this.linkedParentVersion !== relativeParent.layoutVersion &&\n !relativeParent.options.layoutRoot\n ) {\n this.removeRelativeTarget()\n }\n\n /**\n * If we don't have a targetDelta but do have a layout, we can attempt to resolve\n * a relativeParent. This will allow a component to perform scale correction\n * even if no animation has started.\n */\n if (!this.targetDelta && !this.relativeTarget) {\n if (\n this.options.layoutAnchor !== false &&\n relativeParent &&\n relativeParent.layout\n ) {\n this.createRelativeTarget(\n relativeParent,\n this.layout.layoutBox,\n relativeParent.layout.layoutBox\n )\n } else {\n this.removeRelativeTarget()\n }\n }\n\n /**\n * If we have no relative target or no target delta our target isn't valid\n * for this frame.\n */\n if (!this.relativeTarget && !this.targetDelta) return\n\n /**\n * Lazy-init target data structure\n */\n if (!this.target) {\n this.target = createBox()\n this.targetWithTransforms = createBox()\n }\n\n /**\n * If we've got a relative box for this component, resolve it into a target relative to the parent.\n */\n if (\n this.relativeTarget &&\n this.relativeTargetOrigin &&\n this.relativeParent &&\n this.relativeParent.target\n ) {\n this.forceRelativeParentToResolveTarget()\n\n calcRelativeBox(\n this.target,\n this.relativeTarget,\n this.relativeParent.target,\n this.options.layoutAnchor || undefined\n )\n\n /**\n * If we've only got a targetDelta, resolve it into a target\n */\n } else if (this.targetDelta) {\n if (Boolean(this.resumingFrom)) {\n this.applyTransform(\n this.layout.layoutBox,\n false,\n this.target\n )\n } else {\n copyBoxInto(this.target, this.layout.layoutBox)\n }\n\n applyBoxDelta(this.target, this.targetDelta)\n } else {\n /**\n * If no target, use own layout as target\n */\n copyBoxInto(this.target, this.layout.layoutBox)\n }\n\n /**\n * If we've been told to attempt to resolve a relative target, do so.\n */\n if (this.attemptToResolveRelativeTarget) {\n this.attemptToResolveRelativeTarget = false\n\n if (\n this.options.layoutAnchor !== false &&\n relativeParent &&\n Boolean(relativeParent.resumingFrom) ===\n Boolean(this.resumingFrom) &&\n !relativeParent.options.layoutScroll &&\n relativeParent.target &&\n this.animationProgress !== 1\n ) {\n this.createRelativeTarget(\n relativeParent,\n this.target,\n relativeParent.target\n )\n } else {\n this.relativeParent = this.relativeTarget = undefined\n }\n }\n\n /**\n * Increase debug counter for resolved target deltas\n */\n if (statsBuffer.value) {\n metrics.calculatedTargetDeltas++\n }\n }\n\n getClosestProjectingParent() {\n if (\n !this.parent ||\n hasScale(this.parent.latestValues) ||\n has2DTranslate(this.parent.latestValues)\n ) {\n return undefined\n }\n\n if (this.parent.isProjecting()) {\n return this.parent\n } else {\n return this.parent.getClosestProjectingParent()\n }\n }\n\n isProjecting() {\n return Boolean(\n (this.relativeTarget ||\n this.targetDelta ||\n this.options.layoutRoot) &&\n this.layout\n )\n }\n\n linkedParentVersion: number = 0\n createRelativeTarget(\n relativeParent: IProjectionNode,\n layout: Box,\n parentLayout: Box\n ) {\n this.relativeParent = relativeParent\n this.linkedParentVersion = relativeParent.layoutVersion\n this.forceRelativeParentToResolveTarget()\n this.relativeTarget = createBox()\n this.relativeTargetOrigin = createBox()\n calcRelativePosition(\n this.relativeTargetOrigin,\n layout,\n parentLayout,\n this.options.layoutAnchor || undefined\n )\n\n copyBoxInto(this.relativeTarget, this.relativeTargetOrigin)\n }\n\n removeRelativeTarget() {\n this.relativeParent = this.relativeTarget = undefined\n }\n\n hasProjected: boolean = false\n\n calcProjection() {\n const lead = this.getLead()\n const isShared = Boolean(this.resumingFrom) || this !== lead\n\n let canSkip = true\n\n /**\n * If this is a normal layout animation and neither this node nor its nearest projecting\n * is dirty then we can't skip.\n */\n if (this.isProjectionDirty || this.parent?.isProjectionDirty) {\n canSkip = false\n }\n\n /**\n * If this is a shared layout animation and this node's shared projection is dirty then\n * we can't skip.\n */\n if (\n isShared &&\n (this.isSharedProjectionDirty || this.isTransformDirty)\n ) {\n canSkip = false\n }\n\n /**\n * If we have resolved the target this frame we must recalculate the\n * projection to ensure it visually represents the internal calculations.\n */\n if (this.resolvedRelativeTargetAt === frameData.timestamp) {\n canSkip = false\n }\n\n if (canSkip) return\n\n const { layout, layoutId } = this.options\n\n /**\n * If this section of the tree isn't animating we can\n * delete our target sources for the following frame.\n */\n this.isTreeAnimating = Boolean(\n (this.parent && this.parent.isTreeAnimating) ||\n this.currentAnimation ||\n this.pendingAnimation\n )\n if (!this.isTreeAnimating) {\n this.targetDelta = this.relativeTarget = undefined\n }\n\n if (!this.layout || !(layout || layoutId)) return\n\n /**\n * Reset the corrected box with the latest values from box, as we're then going\n * to perform mutative operations on it.\n */\n copyBoxInto(this.layoutCorrected, this.layout.layoutBox)\n\n /**\n * Record previous tree scales before updating.\n */\n const prevTreeScaleX = this.treeScale.x\n const prevTreeScaleY = this.treeScale.y\n /**\n * Apply all the parent deltas to this box to produce the corrected box. This\n * is the layout box, as it will appear on screen as a result of the transforms of its parents.\n */\n applyTreeDeltas(\n this.layoutCorrected,\n this.treeScale,\n this.path,\n isShared\n )\n\n /**\n * If this layer needs to perform scale correction but doesn't have a target,\n * use the layout as the target.\n */\n if (\n lead.layout &&\n !lead.target &&\n (this.treeScale.x !== 1 || this.treeScale.y !== 1)\n ) {\n lead.target = lead.layout.layoutBox\n lead.targetWithTransforms = createBox()\n }\n\n const { target } = lead\n\n if (!target) {\n /**\n * If we don't have a target to project into, but we were previously\n * projecting, we want to remove the stored transform and schedule\n * a render to ensure the elements reflect the removed transform.\n */\n if (this.prevProjectionDelta) {\n this.createProjectionDeltas()\n this.scheduleRender()\n }\n\n return\n }\n\n if (!this.projectionDelta || !this.prevProjectionDelta) {\n this.createProjectionDeltas()\n } else {\n copyAxisDeltaInto(\n this.prevProjectionDelta.x,\n this.projectionDelta.x\n )\n copyAxisDeltaInto(\n this.prevProjectionDelta.y,\n this.projectionDelta.y\n )\n }\n\n /**\n * Update the delta between the corrected box and the target box before user-set transforms were applied.\n * This will allow us to calculate the corrected borderRadius and boxShadow to compensate\n * for our layout reprojection, but still allow them to be scaled correctly by the user.\n * It might be that to simplify this we may want to accept that user-set scale is also corrected\n * and we wouldn't have to keep and calc both deltas, OR we could support a user setting\n * to allow people to choose whether these styles are corrected based on just the\n * layout reprojection or the final bounding box.\n */\n calcBoxDelta(\n this.projectionDelta!,\n this.layoutCorrected,\n target,\n this.latestValues\n )\n\n if (\n this.treeScale.x !== prevTreeScaleX ||\n this.treeScale.y !== prevTreeScaleY ||\n !axisDeltaEquals(\n this.projectionDelta!.x,\n this.prevProjectionDelta!.x\n ) ||\n !axisDeltaEquals(\n this.projectionDelta!.y,\n this.prevProjectionDelta!.y\n )\n ) {\n this.hasProjected = true\n this.scheduleRender()\n this.notifyListeners(\"projectionUpdate\", target)\n }\n\n /**\n * Increase debug counter for recalculated projections\n */\n if (statsBuffer.value) {\n metrics.calculatedProjections++\n }\n }\n\n isVisible = true\n hide() {\n this.isVisible = false\n // TODO: Schedule render\n }\n show() {\n this.isVisible = true\n // TODO: Schedule render\n }\n\n scheduleRender(notifyAll = true) {\n this.options.visualElement?.scheduleRender()\n if (notifyAll) {\n const stack = this.getStack()\n stack && stack.scheduleRender()\n }\n if (this.resumingFrom && !this.resumingFrom.instance) {\n this.resumingFrom = undefined\n }\n }\n\n createProjectionDeltas() {\n this.prevProjectionDelta = createDelta()\n this.projectionDelta = createDelta()\n this.projectionDeltaWithTransform = createDelta()\n }\n\n /**\n * Animation\n */\n animationValues?: ResolvedValues\n pendingAnimation?: Process\n currentAnimation?: JSAnimation\n mixTargetDelta: (progress: number) => void\n animationProgress = 0\n\n setAnimationOrigin(\n delta: Delta,\n hasOnlyRelativeTargetChanged: boolean = false,\n pathFn?: MotionPath\n ) {\n const snapshot = this.snapshot\n const snapshotLatestValues = snapshot ? snapshot.latestValues : {}\n const mixedValues = { ...this.latestValues }\n\n const targetDelta = createDelta()\n if (\n !this.relativeParent ||\n !this.relativeParent.options.layoutRoot\n ) {\n this.relativeTarget = this.relativeTargetOrigin = undefined\n }\n this.attemptToResolveRelativeTarget = !hasOnlyRelativeTargetChanged\n\n const relativeLayout = createBox()\n\n const snapshotSource = snapshot ? snapshot.source : undefined\n const layoutSource = this.layout ? this.layout.source : undefined\n const isSharedLayoutAnimation = snapshotSource !== layoutSource\n const stack = this.getStack()\n const isOnlyMember = !stack || stack.members.length <= 1\n const shouldCrossfadeOpacity = Boolean(\n isSharedLayoutAnimation &&\n !isOnlyMember &&\n this.options.crossfade === true &&\n !this.path.some(hasOpacityCrossfade)\n )\n\n this.animationProgress = 0\n\n let prevRelativeTarget: Box\n\n // The path decides whether the layout shift is worth curving\n // (distance floor) and resolves the interpolator from the delta.\n const interpolate: PathInterpolator | undefined =\n pathFn?.interpolateProjection(delta)\n\n this.mixTargetDelta = (latest: number) => {\n const progress = latest / 1000\n const point = interpolate?.(progress)\n\n if (point) {\n targetDelta.x.translate = point.x\n targetDelta.x.scale = mixNumber(delta.x.scale, 1, progress)\n targetDelta.x.origin = delta.x.origin\n targetDelta.x.originPoint = delta.x.originPoint\n targetDelta.y.translate = point.y\n targetDelta.y.scale = mixNumber(delta.y.scale, 1, progress)\n targetDelta.y.origin = delta.y.origin\n targetDelta.y.originPoint = delta.y.originPoint\n } else {\n mixAxisDeltaLinear(targetDelta.x, delta.x, progress)\n mixAxisDeltaLinear(targetDelta.y, delta.y, progress)\n }\n\n this.setTargetDelta(targetDelta)\n\n if (\n this.relativeTarget &&\n this.relativeTargetOrigin &&\n this.layout &&\n this.relativeParent &&\n this.relativeParent.layout\n ) {\n calcRelativePosition(\n relativeLayout,\n this.layout.layoutBox,\n this.relativeParent.layout.layoutBox,\n this.options.layoutAnchor || undefined\n )\n mixBox(\n this.relativeTarget,\n this.relativeTargetOrigin,\n relativeLayout,\n progress\n )\n\n /**\n * If this is an unchanged relative target we can consider the\n * projection not dirty.\n */\n if (\n prevRelativeTarget &&\n boxEquals(this.relativeTarget, prevRelativeTarget)\n ) {\n this.isProjectionDirty = false\n }\n\n if (!prevRelativeTarget) prevRelativeTarget = createBox()\n copyBoxInto(prevRelativeTarget, this.relativeTarget)\n }\n\n if (isSharedLayoutAnimation) {\n this.animationValues = mixedValues\n\n mixValues(\n mixedValues,\n snapshotLatestValues,\n this.latestValues,\n progress,\n shouldCrossfadeOpacity,\n isOnlyMember\n )\n }\n\n if (point && point.rotate !== undefined) {\n // Dedicated `pathRotation` channel, not `rotate`, so an\n // animating `rotate` is composed with, never clobbered.\n if (!this.animationValues)\n this.animationValues = mixedValues\n this.animationValues.pathRotation = point.rotate\n }\n\n this.root.scheduleUpdateProjection()\n this.scheduleRender()\n\n this.animationProgress = progress\n }\n\n this.mixTargetDelta(this.options.layoutRoot ? 1000 : 0)\n }\n\n motionValue?: MotionValue\n startAnimation(options: ValueAnimationOptions) {\n this.notifyListeners(\"animationStart\")\n\n this.currentAnimation?.stop()\n this.resumingFrom?.currentAnimation?.stop()\n\n if (this.pendingAnimation) {\n cancelFrame(this.pendingAnimation)\n this.pendingAnimation = undefined\n }\n\n /**\n * Start the animation in the next frame to have a frame with progress 0,\n * where the target is the same as when the animation started, so we can\n * calculate the relative positions correctly for instant transitions.\n */\n this.pendingAnimation = frame.update(() => {\n globalProjectionState.hasAnimatedSinceResize = true\n\n this.motionValue ||= motionValue(0)\n this.motionValue.jump(0, false)\n\n this.currentAnimation = animateSingleValue(\n this.motionValue,\n [0, 1000],\n {\n ...(options as any),\n velocity: 0,\n isSync: true,\n onUpdate: (latest: number) => {\n this.mixTargetDelta(latest)\n options.onUpdate && options.onUpdate(latest)\n },\n onComplete: () => {\n options.onComplete && options.onComplete()\n this.completeAnimation()\n },\n }\n ) as JSAnimation\n\n if (this.resumingFrom) {\n this.resumingFrom.currentAnimation = this.currentAnimation\n }\n\n this.pendingAnimation = undefined\n })\n }\n\n completeAnimation() {\n if (this.resumingFrom) {\n this.resumingFrom.currentAnimation = undefined\n this.resumingFrom.preserveOpacity = undefined\n }\n\n const stack = this.getStack()\n stack && stack.exitAnimationComplete()\n this.resumingFrom =\n this.currentAnimation =\n this.animationValues =\n undefined\n\n this.notifyListeners(\"animationComplete\")\n }\n\n finishAnimation() {\n if (this.currentAnimation) {\n this.mixTargetDelta && this.mixTargetDelta(animationTarget)\n this.currentAnimation.stop()\n }\n\n this.completeAnimation()\n }\n\n applyTransformsToTarget() {\n const lead = this.getLead()\n let { targetWithTransforms, target, layout, latestValues } = lead\n\n if (!targetWithTransforms || !target || !layout) return\n\n /**\n * If we're only animating position, and this element isn't the lead element,\n * then instead of projecting into the lead box we instead want to calculate\n * a new target that aligns the two boxes but maintains the layout shape.\n */\n if (\n this !== lead &&\n this.layout &&\n layout &&\n shouldAnimatePositionOnly(\n this.options.animationType,\n this.layout.layoutBox,\n layout.layoutBox\n )\n ) {\n target = this.target || createBox()\n\n const xLength = calcLength(this.layout!.layoutBox.x)\n target!.x.min = lead.target!.x.min\n target!.x.max = target.x.min + xLength\n\n const yLength = calcLength(this.layout!.layoutBox.y)\n target!.y.min = lead.target!.y.min\n target!.y.max = target.y.min + yLength\n }\n\n copyBoxInto(targetWithTransforms, target)\n\n /**\n * Apply the latest user-set transforms to the targetBox to produce the targetBoxFinal.\n * This is the final box that we will then project into by calculating a transform delta and\n * applying it to the corrected box.\n */\n transformBox(targetWithTransforms, latestValues)\n\n /**\n * Update the delta between the corrected box and the final target box, after\n * user-set transforms are applied to it. This will be used by the renderer to\n * create a transform style that will reproject the element from its layout layout\n * into the desired bounding box.\n */\n calcBoxDelta(\n this.projectionDeltaWithTransform!,\n this.layoutCorrected,\n targetWithTransforms!,\n latestValues\n )\n }\n\n /**\n * Shared layout\n */\n // TODO Only running on root node\n sharedNodes: Map = new Map()\n registerSharedNode(layoutId: string, node: IProjectionNode) {\n if (!this.sharedNodes.has(layoutId)) {\n this.sharedNodes.set(layoutId, new NodeStack())\n }\n\n const stack = this.sharedNodes.get(layoutId)!\n stack.add(node)\n\n const config = node.options.initialPromotionConfig\n node.promote({\n transition: config ? config.transition : undefined,\n preserveFollowOpacity:\n config && config.shouldPreserveFollowOpacity\n ? config.shouldPreserveFollowOpacity(node)\n : undefined,\n })\n }\n\n isLead(): boolean {\n const stack = this.getStack()\n return stack ? stack.lead === this : true\n }\n\n getLead() {\n const { layoutId } = this.options\n return layoutId ? this.getStack()?.lead || this : this\n }\n\n getPrevLead() {\n const { layoutId } = this.options\n return layoutId ? this.getStack()?.prevLead : undefined\n }\n\n getStack() {\n const { layoutId } = this.options\n if (layoutId) return this.root.sharedNodes.get(layoutId)\n }\n\n promote({\n needsReset,\n transition,\n preserveFollowOpacity,\n }: {\n needsReset?: boolean\n transition?: Transition\n preserveFollowOpacity?: boolean\n } = {}) {\n const stack = this.getStack()\n if (stack) stack.promote(this, preserveFollowOpacity)\n\n if (needsReset) {\n this.projectionDelta = undefined\n this.needsReset = true\n }\n if (transition) this.setOptions({ transition })\n }\n\n relegate(): boolean {\n const stack = this.getStack()\n if (stack) {\n return stack.relegate(this)\n } else {\n return false\n }\n }\n\n resetSkewAndRotation() {\n const { visualElement } = this.options\n\n if (!visualElement) return\n\n // If there's no detected skew or rotation values, we can early return without a forced render.\n let hasDistortingTransform = false\n\n /**\n * An unrolled check for rotation values. Most elements don't have any rotation and\n * skipping the nested loop and new object creation is 50% faster.\n */\n const { latestValues } = visualElement\n if (\n latestValues.z ||\n latestValues.rotate ||\n latestValues.rotateX ||\n latestValues.rotateY ||\n latestValues.rotateZ ||\n latestValues.skewX ||\n latestValues.skewY\n ) {\n hasDistortingTransform = true\n }\n\n // If there's no distorting values, we don't need to do any more.\n if (!hasDistortingTransform) return\n\n const resetValues: ResolvedValues = {}\n\n if (latestValues.z) {\n resetDistortingTransform(\n \"z\",\n visualElement,\n resetValues,\n this.animationValues\n )\n }\n\n // Check the skew and rotate value of all axes and reset to 0\n for (let i = 0; i < transformAxes.length; i++) {\n resetDistortingTransform(\n `rotate${transformAxes[i]}`,\n visualElement,\n resetValues,\n this.animationValues\n )\n resetDistortingTransform(\n `skew${transformAxes[i]}`,\n visualElement,\n resetValues,\n this.animationValues\n )\n }\n\n // Force a render of this element to apply the transform with all skews and rotations\n // set to 0.\n visualElement.render()\n\n // Put back all the values we reset\n for (const key in resetValues) {\n visualElement.setStaticValue(key, resetValues[key])\n if (this.animationValues) {\n this.animationValues[key] = resetValues[key]\n }\n }\n\n // Schedule a render for the next frame. This ensures we won't visually\n // see the element with the reset rotate value applied.\n visualElement.scheduleRender()\n }\n\n applyProjectionStyles(\n targetStyle: any, // CSSStyleDeclaration - doesn't allow numbers to be assigned to properties\n styleProp?: MotionStyle\n ) {\n if (!this.instance || this.isSVG) return\n\n if (!this.isVisible) {\n targetStyle.visibility = \"hidden\"\n return\n }\n\n const transformTemplate = this.getTransformTemplate()\n\n if (this.needsReset) {\n this.needsReset = false\n\n targetStyle.visibility = \"\"\n targetStyle.opacity = \"\"\n targetStyle.pointerEvents =\n resolveMotionValue(styleProp?.pointerEvents) || \"\"\n targetStyle.transform = transformTemplate\n ? transformTemplate(this.latestValues, \"\")\n : \"none\"\n return\n }\n\n const lead = this.getLead()\n if (!this.projectionDelta || !this.layout || !lead.target) {\n if (this.options.layoutId) {\n targetStyle.opacity =\n this.latestValues.opacity !== undefined\n ? this.latestValues.opacity\n : 1\n targetStyle.pointerEvents =\n resolveMotionValue(styleProp?.pointerEvents) || \"\"\n }\n if (this.hasProjected && !hasTransform(this.latestValues)) {\n targetStyle.transform = transformTemplate\n ? transformTemplate({}, \"\")\n : \"none\"\n this.hasProjected = false\n }\n\n return\n }\n\n targetStyle.visibility = \"\"\n\n const valuesToRender = lead.animationValues || lead.latestValues\n this.applyTransformsToTarget()\n\n let transform = buildProjectionTransform(\n this.projectionDeltaWithTransform!,\n this.treeScale,\n valuesToRender\n )\n\n if (transformTemplate) {\n transform = transformTemplate(valuesToRender, transform)\n }\n\n targetStyle.transform = transform\n\n const { x, y } = this.projectionDelta\n targetStyle.transformOrigin = `${x.origin * 100}% ${\n y.origin * 100\n }% 0`\n\n if (lead.animationValues) {\n /**\n * If the lead component is animating, assign this either the entering/leaving\n * opacity\n */\n targetStyle.opacity =\n lead === this\n ? valuesToRender.opacity ??\n this.latestValues.opacity ??\n 1\n : this.preserveOpacity\n ? this.latestValues.opacity\n : valuesToRender.opacityExit\n } else {\n /**\n * Or we're not animating at all, set the lead component to its layout\n * opacity and other components to hidden.\n */\n targetStyle.opacity =\n lead === this\n ? valuesToRender.opacity !== undefined\n ? valuesToRender.opacity\n : \"\"\n : valuesToRender.opacityExit !== undefined\n ? valuesToRender.opacityExit\n : 0\n }\n\n /**\n * Apply scale correction\n */\n for (const key in scaleCorrectors) {\n if (valuesToRender[key] === undefined) continue\n\n const { correct, applyTo, isCSSVariable } = scaleCorrectors[key]\n\n /**\n * Only apply scale correction to the value if we have an\n * active projection transform. Otherwise these values become\n * vulnerable to distortion if the element changes size without\n * a corresponding layout animation.\n */\n const corrected =\n transform === \"none\"\n ? valuesToRender[key]\n : correct(valuesToRender[key], lead)\n\n if (applyTo) {\n const num = applyTo.length\n for (let i = 0; i < num; i++) {\n targetStyle[applyTo[i] as any] = corrected\n }\n } else {\n // If this is a CSS variable, set it directly on the instance.\n // Replacing this function from creating styles to setting them\n // would be a good place to remove per frame object creation\n if (isCSSVariable) {\n ;(\n this.options.visualElement as HTMLVisualElement\n ).renderState.vars[key] = corrected\n } else {\n targetStyle[key as any] = corrected\n }\n }\n }\n\n /**\n * Disable pointer events on follow components. This is to ensure\n * that if a follow component covers a lead component it doesn't block\n * pointer events on the lead.\n */\n if (this.options.layoutId) {\n targetStyle.pointerEvents =\n lead === this\n ? resolveMotionValue(styleProp?.pointerEvents) || \"\"\n : \"none\"\n }\n }\n\n clearSnapshot() {\n this.resumeFrom = this.snapshot = undefined\n }\n\n // Only run on root\n resetTree() {\n this.root.nodes!.forEach((node: IProjectionNode) =>\n node.currentAnimation?.stop()\n )\n this.root.nodes!.forEach(clearMeasurements)\n this.root.sharedNodes.clear()\n }\n }\n}\n\nfunction updateLayout(node: IProjectionNode) {\n node.updateLayout()\n}\n\nfunction notifyLayoutUpdate(node: IProjectionNode) {\n const snapshot = node.resumeFrom?.snapshot || node.snapshot\n\n if (\n node.isLead() &&\n node.layout &&\n snapshot &&\n node.hasListeners(\"didUpdate\")\n ) {\n const { layoutBox: layout, measuredBox: measuredLayout } = node.layout\n const { animationType } = node.options\n\n const isShared = snapshot.source !== node.layout.source\n\n // TODO Maybe we want to also resize the layout snapshot so we don't trigger\n // animations for instance if layout=\"size\" and an element has only changed position\n if (animationType === \"size\") {\n eachAxis((axis) => {\n const axisSnapshot = isShared\n ? snapshot.measuredBox[axis]\n : snapshot.layoutBox[axis]\n const length = calcLength(axisSnapshot)\n axisSnapshot.min = layout[axis].min\n axisSnapshot.max = axisSnapshot.min + length\n })\n } else if (animationType === \"x\" || animationType === \"y\") {\n const snapAxis = animationType === \"x\" ? \"y\" : \"x\"\n copyAxisInto(\n isShared\n ? snapshot.measuredBox[snapAxis]\n : snapshot.layoutBox[snapAxis],\n layout[snapAxis]\n )\n } else if (\n shouldAnimatePositionOnly(animationType, snapshot.layoutBox, layout)\n ) {\n eachAxis((axis) => {\n const axisSnapshot = isShared\n ? snapshot.measuredBox[axis]\n : snapshot.layoutBox[axis]\n const length = calcLength(layout[axis])\n axisSnapshot.max = axisSnapshot.min + length\n\n /**\n * Ensure relative target gets resized and rerendererd\n */\n if (node.relativeTarget && !node.currentAnimation) {\n node.isProjectionDirty = true\n node.relativeTarget[axis].max =\n node.relativeTarget[axis].min + length\n }\n })\n }\n\n const layoutDelta = createDelta()\n\n calcBoxDelta(layoutDelta, layout, snapshot.layoutBox)\n const visualDelta = createDelta()\n if (isShared) {\n calcBoxDelta(\n visualDelta,\n node.applyTransform(measuredLayout, true),\n snapshot.measuredBox\n )\n } else {\n calcBoxDelta(visualDelta, layout, snapshot.layoutBox)\n }\n\n const hasLayoutChanged = !isDeltaZero(layoutDelta)\n let hasRelativeLayoutChanged = false\n\n if (!node.resumeFrom) {\n const relativeParent = node.getClosestProjectingParent()\n\n /**\n * If the relativeParent is itself resuming from a different element then\n * the relative snapshot is not relavent\n */\n if (relativeParent && !relativeParent.resumeFrom) {\n const { snapshot: parentSnapshot, layout: parentLayout } =\n relativeParent\n\n if (parentSnapshot && parentLayout) {\n const anchor =\n node.options.layoutAnchor || undefined\n\n const relativeSnapshot = createBox()\n calcRelativePosition(\n relativeSnapshot,\n snapshot.layoutBox,\n parentSnapshot.layoutBox,\n anchor\n )\n\n const relativeLayout = createBox()\n calcRelativePosition(\n relativeLayout,\n layout,\n parentLayout.layoutBox,\n anchor\n )\n\n if (!boxEqualsRounded(relativeSnapshot, relativeLayout)) {\n hasRelativeLayoutChanged = true\n }\n\n if (relativeParent.options.layoutRoot) {\n node.relativeTarget = relativeLayout\n node.relativeTargetOrigin = relativeSnapshot\n node.relativeParent = relativeParent\n }\n }\n }\n }\n\n node.notifyListeners(\"didUpdate\", {\n layout,\n snapshot,\n delta: visualDelta,\n layoutDelta,\n hasLayoutChanged,\n hasRelativeLayoutChanged,\n })\n } else if (node.isLead()) {\n const { onExitComplete } = node.options\n onExitComplete && onExitComplete()\n }\n\n /**\n * Clearing transition\n * TODO: Investigate why this transition is being passed in as {type: false } from Framer\n * and why we need it at all\n */\n node.options.transition = undefined\n}\n\nexport function propagateDirtyNodes(node: IProjectionNode) {\n /**\n * Increase debug counter for nodes encountered this frame\n */\n if (statsBuffer.value) {\n metrics.nodes++\n }\n\n if (!node.parent) return\n\n /**\n * If this node isn't projecting, propagate isProjectionDirty. It will have\n * no performance impact but it will allow the next child that *is* projecting\n * but *isn't* dirty to just check its parent to see if *any* ancestor needs\n * correcting.\n */\n if (!node.isProjecting()) {\n node.isProjectionDirty = node.parent.isProjectionDirty\n }\n\n /**\n * Propagate isSharedProjectionDirty and isTransformDirty\n * throughout the whole tree. A future revision can take another look at\n * this but for safety we still recalcualte shared nodes.\n */\n node.isSharedProjectionDirty ||= Boolean(\n node.isProjectionDirty ||\n node.parent.isProjectionDirty ||\n node.parent.isSharedProjectionDirty\n )\n\n node.isTransformDirty ||= node.parent.isTransformDirty\n}\n\nexport function cleanDirtyNodes(node: IProjectionNode) {\n node.isProjectionDirty =\n node.isSharedProjectionDirty =\n node.isTransformDirty =\n false\n}\n\nfunction clearSnapshot(node: IProjectionNode) {\n node.clearSnapshot()\n}\n\nfunction clearMeasurements(node: IProjectionNode) {\n node.clearMeasurements()\n}\n\nfunction forceLayoutMeasure(node: IProjectionNode) {\n node.isLayoutDirty = true\n node.updateLayout()\n}\n\nfunction clearIsLayoutDirty(node: IProjectionNode) {\n node.isLayoutDirty = false\n}\n\n/**\n * When a node is animation-blocked (e.g. during drag) and its component\n * didn't re-render (memoized), willUpdate() is never called so there's\n * no snapshot. Use the previous layout as a snapshot and mark dirty so\n * resetTransform/updateLayout/notifyLayoutUpdate process it normally.\n */\nfunction ensureDraggedNodesSnapshotted(node: IProjectionNode) {\n if (node.isAnimationBlocked && node.layout && !node.isLayoutDirty) {\n node.snapshot = node.layout\n node.isLayoutDirty = true\n }\n}\n\nfunction resetTransformStyle(node: IProjectionNode) {\n const { visualElement } = node.options\n if (visualElement && visualElement.getProps().onBeforeLayoutMeasure) {\n visualElement.notify(\"BeforeLayoutMeasure\")\n }\n\n node.resetTransform()\n}\n\nfunction finishAnimation(node: IProjectionNode) {\n node.finishAnimation()\n node.targetDelta = node.relativeTarget = node.target = undefined\n node.isProjectionDirty = true\n}\n\nfunction resolveTargetDelta(node: IProjectionNode) {\n node.resolveTargetDelta()\n}\n\nfunction calcProjection(node: IProjectionNode) {\n node.calcProjection()\n}\n\nfunction resetSkewAndRotation(node: IProjectionNode) {\n node.resetSkewAndRotation()\n}\n\nfunction removeLeadSnapshots(stack: NodeStack) {\n stack.removeLeadSnapshot()\n}\n\nfunction mixAxisDeltaLinear(output: AxisDelta, delta: AxisDelta, p: number) {\n output.translate = mixNumber(delta.translate, 0, p)\n output.scale = mixNumber(delta.scale, 1, p)\n output.origin = delta.origin\n output.originPoint = delta.originPoint\n}\n\nexport function mixAxis(output: Axis, from: Axis, to: Axis, p: number) {\n output.min = mixNumber(from.min, to.min, p)\n output.max = mixNumber(from.max, to.max, p)\n}\n\nexport function mixBox(output: Box, from: Box, to: Box, p: number) {\n mixAxis(output.x, from.x, to.x, p)\n mixAxis(output.y, from.y, to.y, p)\n}\n\nfunction hasOpacityCrossfade(node: IProjectionNode) {\n return (\n node.animationValues && node.animationValues.opacityExit !== undefined\n )\n}\n\nconst defaultLayoutTransition = {\n duration: 0.45,\n ease: [0.4, 0, 0.1, 1],\n}\n\nconst userAgentContains = (string: string) =>\n typeof navigator !== \"undefined\" &&\n navigator.userAgent &&\n navigator.userAgent.toLowerCase().includes(string)\n\n/**\n * Measured bounding boxes must be rounded in Safari and\n * left untouched in Chrome, otherwise non-integer layouts within scaled-up elements\n * can appear to jump.\n */\nconst roundPoint =\n userAgentContains(\"applewebkit/\") && !userAgentContains(\"chrome/\")\n ? Math.round\n : noop\n\nfunction roundAxis(axis: Axis): void {\n // Round to the nearest .5 pixels to support subpixel layouts\n axis.min = roundPoint(axis.min)\n axis.max = roundPoint(axis.max)\n}\n\nfunction roundBox(box: Box): void {\n roundAxis(box.x)\n roundAxis(box.y)\n}\n\nfunction shouldAnimatePositionOnly(\n animationType: string | undefined,\n snapshot: Box,\n layout: Box\n) {\n return (\n animationType === \"position\" ||\n (animationType === \"preserve-aspect\" &&\n !isNear(aspectRatio(snapshot), aspectRatio(layout), 0.2))\n )\n}\n\nfunction checkNodeWasScrollRoot(node: IProjectionNode) {\n return node !== node.root && node.scroll?.wasRoot\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4EA,MAAM,OAAO,GAAG;AACZ,IAAA,KAAK,EAAE,CAAC;AACR,IAAA,sBAAsB,EAAE,CAAC;AACzB,IAAA,qBAAqB,EAAE,CAAC;CAC3B;AAED,MAAM,aAAa,GAAG,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;AAEzC;;;AAGG;AACH,MAAM,eAAe,GAAG,IAAI;AAE5B,IAAI,EAAE,GAAG,CAAC;AAEV,SAAS,wBAAwB,CAC7B,GAAW,EACX,aAA4B,EAC5B,MAAsB,EACtB,qBAAsC,EAAA;AAEtC,IAAA,MAAM,EAAE,YAAY,EAAE,GAAG,aAAa;;AAGtC,IAAA,IAAI,YAAY,CAAC,GAAG,CAAC,EAAE;QACnB,MAAM,CAAC,GAAG,CAAC,GAAG,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,iBAAiB,CAAC,cAAc,CAAC,IAAI,CAAC,iBAAiB,CAAC,SAAS;MAC3D,IAAI,CAAC;MACL,IAAI;AAEd,SAAS,SAAS,CAAC,IAAU,EAAA;;IAEzB,IAAI,CAAC,GAAG,GAAG,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC;IAC/B,IAAI,CAAC,GAAG,GAAG,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC;AACnC;AAEA,SAAS,QAAQ,CAAC,GAAQ,EAAA;AACtB,IAAA,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;AAChB,IAAA,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;AACpB;AAEA,SAAS,yBAAyB,CAC9B,aAAiC,EACjC,QAAa,EACb,MAAW,EAAA;IAEX,QACI,aAAa,KAAK,UAAU;SAC3B,aAAa,KAAK,iBAAiB;AAChC,YAAA,CAAC,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,EAAE,GAAG,CAAC,CAAC;AAErE;AAEA,SAAS,sBAAsB,CAAC,IAAqB,EAAA;IACjD,OAAO,IAAI,KAAK,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,EAAE,OAAO;AACrD;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/projection/node/group.mjs b/node_modules/motion-dom/dist/es/projection/node/group.mjs deleted file mode 100644 index ad789a5..0000000 --- a/node_modules/motion-dom/dist/es/projection/node/group.mjs +++ /dev/null @@ -1,25 +0,0 @@ -const notify = (node) => !node.isLayoutDirty && node.willUpdate(false); -function nodeGroup() { - const nodes = new Set(); - const subscriptions = new WeakMap(); - const dirtyAll = () => nodes.forEach(notify); - return { - add: (node) => { - nodes.add(node); - subscriptions.set(node, node.addEventListener("willUpdate", dirtyAll)); - }, - remove: (node) => { - nodes.delete(node); - const unsubscribe = subscriptions.get(node); - if (unsubscribe) { - unsubscribe(); - subscriptions.delete(node); - } - dirtyAll(); - }, - dirty: dirtyAll, - }; -} - -export { nodeGroup }; -//# sourceMappingURL=group.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/node/group.mjs.map b/node_modules/motion-dom/dist/es/projection/node/group.mjs.map deleted file mode 100644 index 11aadc9..0000000 --- a/node_modules/motion-dom/dist/es/projection/node/group.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"group.mjs","sources":["../../../../src/projection/node/group.ts"],"sourcesContent":["import { IProjectionNode } from \"./types\"\n\nconst notify = (node: IProjectionNode) =>\n !node.isLayoutDirty && node.willUpdate(false)\n\nexport interface NodeGroup {\n add: (node: IProjectionNode) => void\n remove: (node: IProjectionNode) => void\n dirty: VoidFunction\n}\n\nexport function nodeGroup(): NodeGroup {\n const nodes = new Set()\n const subscriptions = new WeakMap void>()\n\n const dirtyAll = () => nodes.forEach(notify)\n\n return {\n add: (node) => {\n nodes.add(node)\n subscriptions.set(\n node,\n node.addEventListener(\"willUpdate\", dirtyAll)\n )\n },\n remove: (node) => {\n nodes.delete(node)\n const unsubscribe = subscriptions.get(node)\n if (unsubscribe) {\n unsubscribe()\n subscriptions.delete(node)\n }\n dirtyAll()\n },\n dirty: dirtyAll,\n }\n}\n"],"names":[],"mappings":"AAEA,MAAM,MAAM,GAAG,CAAC,IAAqB,KACjC,CAAC,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC;SAQjC,SAAS,GAAA;AACrB,IAAA,MAAM,KAAK,GAAG,IAAI,GAAG,EAAmB;AACxC,IAAA,MAAM,aAAa,GAAG,IAAI,OAAO,EAA+B;IAEhE,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;IAE5C,OAAO;AACH,QAAA,GAAG,EAAE,CAAC,IAAI,KAAI;AACV,YAAA,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC;AACf,YAAA,aAAa,CAAC,GAAG,CACb,IAAI,EACJ,IAAI,CAAC,gBAAgB,CAAC,YAAY,EAAE,QAAQ,CAAC,CAChD;QACL,CAAC;AACD,QAAA,MAAM,EAAE,CAAC,IAAI,KAAI;AACb,YAAA,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC;YAClB,MAAM,WAAW,GAAG,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC;YAC3C,IAAI,WAAW,EAAE;AACb,gBAAA,WAAW,EAAE;AACb,gBAAA,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC;YAC9B;AACA,YAAA,QAAQ,EAAE;QACd,CAAC;AACD,QAAA,KAAK,EAAE,QAAQ;KAClB;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/projection/node/state.mjs b/node_modules/motion-dom/dist/es/projection/node/state.mjs deleted file mode 100644 index 5ad856c..0000000 --- a/node_modules/motion-dom/dist/es/projection/node/state.mjs +++ /dev/null @@ -1,20 +0,0 @@ -/** - * This should only ever be modified on the client otherwise it'll - * persist through server requests. If we need instanced states we - * could lazy-init via root. - */ -const globalProjectionState = { - /** - * Global flag as to whether the tree has animated since the last time - * we resized the window - */ - hasAnimatedSinceResize: true, - /** - * We set this to true once, on the first update. Any nodes added to the tree beyond that - * update will be given a `data-projection-id` attribute. - */ - hasEverUpdated: false, -}; - -export { globalProjectionState }; -//# sourceMappingURL=state.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/node/state.mjs.map b/node_modules/motion-dom/dist/es/projection/node/state.mjs.map deleted file mode 100644 index 1597f76..0000000 --- a/node_modules/motion-dom/dist/es/projection/node/state.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"state.mjs","sources":["../../../../src/projection/node/state.ts"],"sourcesContent":["/**\n * This should only ever be modified on the client otherwise it'll\n * persist through server requests. If we need instanced states we\n * could lazy-init via root.\n */\nexport const globalProjectionState = {\n /**\n * Global flag as to whether the tree has animated since the last time\n * we resized the window\n */\n hasAnimatedSinceResize: true,\n\n /**\n * We set this to true once, on the first update. Any nodes added to the tree beyond that\n * update will be given a `data-projection-id` attribute.\n */\n hasEverUpdated: false,\n}\n"],"names":[],"mappings":"AAAA;;;;AAIG;AACI,MAAM,qBAAqB,GAAG;AACjC;;;AAGG;AACH,IAAA,sBAAsB,EAAE,IAAI;AAE5B;;;AAGG;AACH,IAAA,cAAc,EAAE,KAAK;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/projection/shared/stack.mjs b/node_modules/motion-dom/dist/es/projection/shared/stack.mjs deleted file mode 100644 index 3dd23ec..0000000 --- a/node_modules/motion-dom/dist/es/projection/shared/stack.mjs +++ /dev/null @@ -1,85 +0,0 @@ -import { addUniqueItem, removeItem } from 'motion-utils'; - -class NodeStack { - constructor() { - this.members = []; - } - add(node) { - addUniqueItem(this.members, node); - for (let i = this.members.length - 1; i >= 0; i--) { - const member = this.members[i]; - if (member === node || member === this.lead || member === this.prevLead) - continue; - const inst = member.instance; - if ((!inst || inst.isConnected === false) && !member.snapshot) { - removeItem(this.members, member); - member.unmount(); - } - } - node.scheduleRender(); - } - remove(node) { - removeItem(this.members, node); - if (node === this.prevLead) - this.prevLead = undefined; - if (node === this.lead) { - const prevLead = this.members[this.members.length - 1]; - if (prevLead) - this.promote(prevLead); - } - } - relegate(node) { - for (let i = this.members.indexOf(node) - 1; i >= 0; i--) { - const member = this.members[i]; - if (member.isPresent !== false && member.instance?.isConnected !== false) { - this.promote(member); - return true; - } - } - return false; - } - promote(node, preserveFollowOpacity) { - const prevLead = this.lead; - if (node === prevLead) - return; - this.prevLead = prevLead; - this.lead = node; - node.show(); - if (prevLead) { - prevLead.updateSnapshot(); - node.scheduleRender(); - const { layoutDependency: prevDep } = prevLead.options; - const { layoutDependency: nextDep } = node.options; - if (prevDep === undefined || prevDep !== nextDep) { - node.resumeFrom = prevLead; - if (preserveFollowOpacity) - prevLead.preserveOpacity = true; - if (prevLead.snapshot) { - node.snapshot = prevLead.snapshot; - node.snapshot.latestValues = - prevLead.animationValues || prevLead.latestValues; - } - if (node.root?.isUpdating) - node.isLayoutDirty = true; - } - if (node.options.crossfade === false) - prevLead.hide(); - } - } - exitAnimationComplete() { - this.members.forEach((member) => { - member.options.onExitComplete?.(); - member.resumingFrom?.options.onExitComplete?.(); - }); - } - scheduleRender() { - this.members.forEach((member) => member.instance && member.scheduleRender(false)); - } - removeLeadSnapshot() { - if (this.lead?.snapshot) - this.lead.snapshot = undefined; - } -} - -export { NodeStack }; -//# sourceMappingURL=stack.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/shared/stack.mjs.map b/node_modules/motion-dom/dist/es/projection/shared/stack.mjs.map deleted file mode 100644 index c1b7470..0000000 --- a/node_modules/motion-dom/dist/es/projection/shared/stack.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"stack.mjs","sources":["../../../../src/projection/shared/stack.ts"],"sourcesContent":["import { addUniqueItem, removeItem } from \"motion-utils\"\nimport type { IProjectionNode } from \"../node/types\"\n\nexport class NodeStack {\n lead?: IProjectionNode\n prevLead?: IProjectionNode\n members: IProjectionNode[] = []\n\n add(node: IProjectionNode) {\n addUniqueItem(this.members, node)\n\n for (let i = this.members.length - 1; i >= 0; i--) {\n const member = this.members[i]\n if (member === node || member === this.lead || member === this.prevLead) continue\n const inst = member.instance as HTMLElement | undefined\n if ((!inst || inst.isConnected === false) && !member.snapshot) {\n removeItem(this.members, member)\n member.unmount()\n }\n }\n\n node.scheduleRender()\n }\n\n remove(node: IProjectionNode) {\n removeItem(this.members, node)\n if (node === this.prevLead) this.prevLead = undefined\n if (node === this.lead) {\n const prevLead = this.members[this.members.length - 1]\n if (prevLead) this.promote(prevLead)\n }\n }\n\n relegate(node: IProjectionNode) {\n for (let i = this.members.indexOf(node) - 1; i >= 0; i--) {\n const member = this.members[i]\n if (member.isPresent !== false && (member.instance as HTMLElement)?.isConnected !== false) {\n this.promote(member)\n return true\n }\n }\n return false\n }\n\n promote(node: IProjectionNode, preserveFollowOpacity?: boolean) {\n const prevLead = this.lead\n if (node === prevLead) return\n\n this.prevLead = prevLead\n this.lead = node\n node.show()\n\n if (prevLead) {\n prevLead.updateSnapshot()\n node.scheduleRender()\n\n const { layoutDependency: prevDep } = prevLead.options\n const { layoutDependency: nextDep } = node.options\n\n if (prevDep === undefined || prevDep !== nextDep) {\n node.resumeFrom = prevLead\n if (preserveFollowOpacity) prevLead.preserveOpacity = true\n\n if (prevLead.snapshot) {\n node.snapshot = prevLead.snapshot\n node.snapshot.latestValues =\n prevLead.animationValues || prevLead.latestValues\n }\n\n if (node.root?.isUpdating) node.isLayoutDirty = true\n }\n if (node.options.crossfade === false) prevLead.hide()\n }\n }\n\n exitAnimationComplete() {\n this.members.forEach((member) => {\n member.options.onExitComplete?.()\n member.resumingFrom?.options.onExitComplete?.()\n })\n }\n\n scheduleRender() {\n this.members.forEach(\n (member) => member.instance && member.scheduleRender(false)\n )\n }\n\n removeLeadSnapshot() {\n if (this.lead?.snapshot) this.lead.snapshot = undefined\n }\n}\n"],"names":[],"mappings":";;MAGa,SAAS,CAAA;AAAtB,IAAA,WAAA,GAAA;QAGI,IAAA,CAAA,OAAO,GAAsB,EAAE;IAqFnC;AAnFI,IAAA,GAAG,CAAC,IAAqB,EAAA;AACrB,QAAA,aAAa,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC;AAEjC,QAAA,KAAK,IAAI,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE;YAC/C,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;AAC9B,YAAA,IAAI,MAAM,KAAK,IAAI,IAAI,MAAM,KAAK,IAAI,CAAC,IAAI,IAAI,MAAM,KAAK,IAAI,CAAC,QAAQ;gBAAE;AACzE,YAAA,MAAM,IAAI,GAAG,MAAM,CAAC,QAAmC;AACvD,YAAA,IAAI,CAAC,CAAC,IAAI,IAAI,IAAI,CAAC,WAAW,KAAK,KAAK,KAAK,CAAC,MAAM,CAAC,QAAQ,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9D;IACL;IAEA,kBAAkB,GAAA;AACd,QAAA,IAAI,IAAI,CAAC,IAAI,EAAE,QAAQ;AAAE,YAAA,IAAI,CAAC,IAAI,CAAC,QAAQ,GAAG,SAAS;IAC3D;AACH;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/projection/styles/scale-border-radius.mjs b/node_modules/motion-dom/dist/es/projection/styles/scale-border-radius.mjs deleted file mode 100644 index 769cd50..0000000 --- a/node_modules/motion-dom/dist/es/projection/styles/scale-border-radius.mjs +++ /dev/null @@ -1,42 +0,0 @@ -import { px } from '../../value/types/numbers/units.mjs'; - -function pixelsToPercent(pixels, axis) { - if (axis.max === axis.min) - return 0; - return (pixels / (axis.max - axis.min)) * 100; -} -/** - * We always correct borderRadius as a percentage rather than pixels to reduce paints. - * For example, if you are projecting a box that is 100px wide with a 10px borderRadius - * into a box that is 200px wide with a 20px borderRadius, that is actually a 10% - * borderRadius in both states. If we animate between the two in pixels that will trigger - * a paint each time. If we animate between the two in percentage we'll avoid a paint. - */ -const correctBorderRadius = { - correct: (latest, node) => { - if (!node.target) - return latest; - /** - * If latest is a string, if it's a percentage we can return immediately as it's - * going to be stretched appropriately. Otherwise, if it's a pixel, convert it to a number. - */ - if (typeof latest === "string") { - if (px.test(latest)) { - latest = parseFloat(latest); - } - else { - return latest; - } - } - /** - * If latest is a number, it's a pixel value. We use the current viewportBox to calculate that - * pixel value as a percentage of each axis - */ - const x = pixelsToPercent(latest, node.target.x); - const y = pixelsToPercent(latest, node.target.y); - return `${x}% ${y}%`; - }, -}; - -export { correctBorderRadius, pixelsToPercent }; -//# sourceMappingURL=scale-border-radius.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/styles/scale-border-radius.mjs.map b/node_modules/motion-dom/dist/es/projection/styles/scale-border-radius.mjs.map deleted file mode 100644 index 4e1f220..0000000 --- a/node_modules/motion-dom/dist/es/projection/styles/scale-border-radius.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"scale-border-radius.mjs","sources":["../../../../src/projection/styles/scale-border-radius.ts"],"sourcesContent":["import { px } from \"../../value/types/numbers/units\"\nimport type { Axis } from \"motion-utils\"\nimport type { ScaleCorrectorDefinition } from \"./types\"\n\nexport function pixelsToPercent(pixels: number, axis: Axis): number {\n if (axis.max === axis.min) return 0\n return (pixels / (axis.max - axis.min)) * 100\n}\n\n/**\n * We always correct borderRadius as a percentage rather than pixels to reduce paints.\n * For example, if you are projecting a box that is 100px wide with a 10px borderRadius\n * into a box that is 200px wide with a 20px borderRadius, that is actually a 10%\n * borderRadius in both states. If we animate between the two in pixels that will trigger\n * a paint each time. If we animate between the two in percentage we'll avoid a paint.\n */\nexport const correctBorderRadius: ScaleCorrectorDefinition = {\n correct: (latest, node) => {\n if (!node.target) return latest\n\n /**\n * If latest is a string, if it's a percentage we can return immediately as it's\n * going to be stretched appropriately. Otherwise, if it's a pixel, convert it to a number.\n */\n if (typeof latest === \"string\") {\n if (px.test(latest)) {\n latest = parseFloat(latest)\n } else {\n return latest\n }\n }\n\n /**\n * If latest is a number, it's a pixel value. We use the current viewportBox to calculate that\n * pixel value as a percentage of each axis\n */\n const x = pixelsToPercent(latest, node.target.x)\n const y = pixelsToPercent(latest, node.target.y)\n\n return `${x}% ${y}%`\n },\n}\n"],"names":[],"mappings":";;AAIM,SAAU,eAAe,CAAC,MAAc,EAAE,IAAU,EAAA;AACtD,IAAA,IAAI,IAAI,CAAC,GAAG,KAAK,IAAI,CAAC,GAAG;AAAE,QAAA,OAAO,CAAC;AACnC,IAAA,OAAO,CAAC,MAAM,IAAI,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,GAAG;AACjD;AAEA;;;;;;AAMG;AACI,MAAM,mBAAmB,GAA6B;AACzD,IAAA,OAAO,EAAE,CAAC,MAAM,EAAE,IAAI,KAAI;QACtB,IAAI,CAAC,IAAI,CAAC,MAAM;AAAE,YAAA,OAAO,MAAM;AAE/B;;;AAGG;AACH,QAAA,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;AAC5B,YAAA,IAAI,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;AACjB,gBAAA,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;YAC/B;iBAAO;AACH,gBAAA,OAAO,MAAM;YACjB;QACJ;AAEA;;;AAGG;AACH,QAAA,MAAM,CAAC,GAAG,eAAe,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;AAChD,QAAA,MAAM,CAAC,GAAG,eAAe,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;AAEhD,QAAA,OAAO,CAAA,EAAG,CAAC,CAAA,EAAA,EAAK,CAAC,GAAG;IACxB,CAAC;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/projection/styles/scale-box-shadow.mjs b/node_modules/motion-dom/dist/es/projection/styles/scale-box-shadow.mjs deleted file mode 100644 index 8d6464f..0000000 --- a/node_modules/motion-dom/dist/es/projection/styles/scale-box-shadow.mjs +++ /dev/null @@ -1,36 +0,0 @@ -import { complex } from '../../value/types/complex/index.mjs'; -import { mixNumber } from '../../utils/mix/number.mjs'; - -const correctBoxShadow = { - correct: (latest, { treeScale, projectionDelta }) => { - const original = latest; - const shadow = complex.parse(latest); - // TODO: Doesn't support multiple shadows - if (shadow.length > 5) - return original; - const template = complex.createTransformer(latest); - const offset = typeof shadow[0] !== "number" ? 1 : 0; - // Calculate the overall context scale - const xScale = projectionDelta.x.scale * treeScale.x; - const yScale = projectionDelta.y.scale * treeScale.y; - shadow[0 + offset] /= xScale; - shadow[1 + offset] /= yScale; - /** - * Ideally we'd correct x and y scales individually, but because blur and - * spread apply to both we have to take a scale average and apply that instead. - * We could potentially improve the outcome of this by incorporating the ratio between - * the two scales. - */ - const averageScale = mixNumber(xScale, yScale, 0.5); - // Blur - if (typeof shadow[2 + offset] === "number") - shadow[2 + offset] /= averageScale; - // Spread - if (typeof shadow[3 + offset] === "number") - shadow[3 + offset] /= averageScale; - return template(shadow); - }, -}; - -export { correctBoxShadow }; -//# sourceMappingURL=scale-box-shadow.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/styles/scale-box-shadow.mjs.map b/node_modules/motion-dom/dist/es/projection/styles/scale-box-shadow.mjs.map deleted file mode 100644 index 2498366..0000000 --- a/node_modules/motion-dom/dist/es/projection/styles/scale-box-shadow.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"scale-box-shadow.mjs","sources":["../../../../src/projection/styles/scale-box-shadow.ts"],"sourcesContent":["import { complex } from \"../../value/types/complex\"\nimport { mixNumber } from \"../../utils/mix/number\"\nimport type { ScaleCorrectorDefinition } from \"./types\"\n\nexport const correctBoxShadow: ScaleCorrectorDefinition = {\n correct: (latest: string, { treeScale, projectionDelta }) => {\n const original = latest\n const shadow = complex.parse(latest)\n\n // TODO: Doesn't support multiple shadows\n if (shadow.length > 5) return original\n\n const template = complex.createTransformer(latest)\n const offset = typeof shadow[0] !== \"number\" ? 1 : 0\n\n // Calculate the overall context scale\n const xScale = projectionDelta!.x.scale * treeScale!.x\n const yScale = projectionDelta!.y.scale * treeScale!.y\n\n // Scale x/y\n ;(shadow[0 + offset] as number) /= xScale\n ;(shadow[1 + offset] as number) /= yScale\n\n /**\n * Ideally we'd correct x and y scales individually, but because blur and\n * spread apply to both we have to take a scale average and apply that instead.\n * We could potentially improve the outcome of this by incorporating the ratio between\n * the two scales.\n */\n const averageScale = mixNumber(xScale, yScale, 0.5)\n\n // Blur\n if (typeof shadow[2 + offset] === \"number\")\n (shadow[2 + offset] as number) /= averageScale\n\n // Spread\n if (typeof shadow[3 + offset] === \"number\")\n (shadow[3 + offset] as number) /= averageScale\n\n return template(shadow)\n },\n}\n"],"names":[],"mappings":";;;AAIO,MAAM,gBAAgB,GAA6B;IACtD,OAAO,EAAE,CAAC,MAAc,EAAE,EAAE,SAAS,EAAE,eAAe,EAAE,KAAI;QACxD,MAAM,QAAQ,GAAG,MAAM;QACvB,MAAM,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC;;AAGpC,QAAA,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC;AAAE,YAAA,OAAO,QAAQ;QAEtC,MAAM,QAAQ,GAAG,OAAO,CAAC,iBAAiB,CAAC,MAAM,CAAC;AAClD,QAAA,MAAM,MAAM,GAAG,OAAO,MAAM,CAAC,CAAC,CAAC,KAAK,QAAQ,GAAG,CAAC,GAAG,CAAC;;QAGpD,MAAM,MAAM,GAAG,eAAgB,CAAC,CAAC,CAAC,KAAK,GAAG,SAAU,CAAC,CAAC;QACtD,MAAM,MAAM,GAAG,eAAgB,CAAC,CAAC,CAAC,KAAK,GAAG,SAAU,CAAC,CAAC;AAGpD,QAAA,MAAM,CAAC,CAAC,GAAG,MAAM,CAAY,IAAI,MAAM;AACvC,QAAA,MAAM,CAAC,CAAC,GAAG,MAAM,CAAY,IAAI,MAAM;AAEzC;;;;;AAKG;QACH,MAAM,YAAY,GAAG,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,CAAC;;QAGnD,IAAI,OAAO,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,KAAK,QAAQ;AACrC,YAAA,MAAM,CAAC,CAAC,GAAG,MAAM,CAAY,IAAI,YAAY;;QAGlD,IAAI,OAAO,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,KAAK,QAAQ;AACrC,YAAA,MAAM,CAAC,CAAC,GAAG,MAAM,CAAY,IAAI,YAAY;AAElD,QAAA,OAAO,QAAQ,CAAC,MAAM,CAAC;IAC3B,CAAC;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/projection/styles/scale-correction.mjs b/node_modules/motion-dom/dist/es/projection/styles/scale-correction.mjs deleted file mode 100644 index 7ae2e4e..0000000 --- a/node_modules/motion-dom/dist/es/projection/styles/scale-correction.mjs +++ /dev/null @@ -1,27 +0,0 @@ -import { isCSSVariableName } from '../../animation/utils/is-css-variable.mjs'; -import { cornerRadiusProps } from '../../utils/border-radius.mjs'; -import { correctBorderRadius } from './scale-border-radius.mjs'; -import { correctBoxShadow } from './scale-box-shadow.mjs'; - -const scaleCorrectors = { - borderRadius: { - ...correctBorderRadius, - applyTo: [...cornerRadiusProps], - }, - borderTopLeftRadius: correctBorderRadius, - borderTopRightRadius: correctBorderRadius, - borderBottomLeftRadius: correctBorderRadius, - borderBottomRightRadius: correctBorderRadius, - boxShadow: correctBoxShadow, -}; -function addScaleCorrector(correctors) { - for (const key in correctors) { - scaleCorrectors[key] = correctors[key]; - if (isCSSVariableName(key)) { - scaleCorrectors[key].isCSSVariable = true; - } - } -} - -export { addScaleCorrector, scaleCorrectors }; -//# sourceMappingURL=scale-correction.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/styles/scale-correction.mjs.map b/node_modules/motion-dom/dist/es/projection/styles/scale-correction.mjs.map deleted file mode 100644 index 00f23b4..0000000 --- a/node_modules/motion-dom/dist/es/projection/styles/scale-correction.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"scale-correction.mjs","sources":["../../../../src/projection/styles/scale-correction.ts"],"sourcesContent":["import { isCSSVariableName } from \"../../animation/utils/is-css-variable\"\nimport { cornerRadiusProps } from \"../../utils/border-radius\"\nimport { correctBorderRadius } from \"./scale-border-radius\"\nimport { correctBoxShadow } from \"./scale-box-shadow\"\nimport type { ScaleCorrectorMap } from \"./types\"\n\nexport const scaleCorrectors: ScaleCorrectorMap = {\n borderRadius: {\n ...correctBorderRadius,\n applyTo: [...cornerRadiusProps],\n },\n borderTopLeftRadius: correctBorderRadius,\n borderTopRightRadius: correctBorderRadius,\n borderBottomLeftRadius: correctBorderRadius,\n borderBottomRightRadius: correctBorderRadius,\n boxShadow: correctBoxShadow,\n}\n\nexport function addScaleCorrector(correctors: ScaleCorrectorMap) {\n for (const key in correctors) {\n scaleCorrectors[key] = correctors[key]\n if (isCSSVariableName(key)) {\n scaleCorrectors[key].isCSSVariable = true\n }\n }\n}\n"],"names":[],"mappings":";;;;;AAMO,MAAM,eAAe,GAAsB;AAC9C,IAAA,YAAY,EAAE;AACV,QAAA,GAAG,mBAAmB;AACtB,QAAA,OAAO,EAAE,CAAC,GAAG,iBAAiB,CAAC;AAClC,KAAA;AACD,IAAA,mBAAmB,EAAE,mBAAmB;AACxC,IAAA,oBAAoB,EAAE,mBAAmB;AACzC,IAAA,sBAAsB,EAAE,mBAAmB;AAC3C,IAAA,uBAAuB,EAAE,mBAAmB;AAC5C,IAAA,SAAS,EAAE,gBAAgB;;AAGzB,SAAU,iBAAiB,CAAC,UAA6B,EAAA;AAC3D,IAAA,KAAK,MAAM,GAAG,IAAI,UAAU,EAAE;QAC1B,eAAe,CAAC,GAAG,CAAC,GAAG,UAAU,CAAC,GAAG,CAAC;AACtC,QAAA,IAAI,iBAAiB,CAAC,GAAG,CAAC,EAAE;AACxB,YAAA,eAAe,CAAC,GAAG,CAAC,CAAC,aAAa,GAAG,IAAI;QAC7C;IACJ;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/projection/styles/transform.mjs b/node_modules/motion-dom/dist/es/projection/styles/transform.mjs deleted file mode 100644 index aba77bf..0000000 --- a/node_modules/motion-dom/dist/es/projection/styles/transform.mjs +++ /dev/null @@ -1,53 +0,0 @@ -function buildProjectionTransform(delta, treeScale, latestTransform) { - let transform = ""; - /** - * The translations we use to calculate are always relative to the viewport coordinate space. - * But when we apply scales, we also scale the coordinate space of an element and its children. - * For instance if we have a treeScale (the culmination of all parent scales) of 0.5 and we need - * to move an element 100 pixels, we actually need to move it 200 in within that scaled space. - */ - const xTranslate = delta.x.translate / treeScale.x; - const yTranslate = delta.y.translate / treeScale.y; - const zTranslate = latestTransform?.z || 0; - if (xTranslate || yTranslate || zTranslate) { - transform = `translate3d(${xTranslate}px, ${yTranslate}px, ${zTranslate}px) `; - } - /** - * Apply scale correction for the tree transform. - * This will apply scale to the screen-orientated axes. - */ - if (treeScale.x !== 1 || treeScale.y !== 1) { - transform += `scale(${1 / treeScale.x}, ${1 / treeScale.y}) `; - } - if (latestTransform) { - const { transformPerspective, rotate, pathRotation, rotateX, rotateY, skewX, skewY, } = latestTransform; - if (transformPerspective) - transform = `perspective(${transformPerspective}px) ${transform}`; - if (rotate) - transform += `rotate(${rotate}deg) `; - // Additive `rotate()` so user `rotate` isn't clobbered. - if (pathRotation) - transform += `rotate(${pathRotation}deg) `; - if (rotateX) - transform += `rotateX(${rotateX}deg) `; - if (rotateY) - transform += `rotateY(${rotateY}deg) `; - if (skewX) - transform += `skewX(${skewX}deg) `; - if (skewY) - transform += `skewY(${skewY}deg) `; - } - /** - * Apply scale to match the size of the element to the size we want it. - * This will apply scale to the element-orientated axes. - */ - const elementScaleX = delta.x.scale * treeScale.x; - const elementScaleY = delta.y.scale * treeScale.y; - if (elementScaleX !== 1 || elementScaleY !== 1) { - transform += `scale(${elementScaleX}, ${elementScaleY})`; - } - return transform || "none"; -} - -export { buildProjectionTransform }; -//# sourceMappingURL=transform.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/styles/transform.mjs.map b/node_modules/motion-dom/dist/es/projection/styles/transform.mjs.map deleted file mode 100644 index 2ef27a9..0000000 --- a/node_modules/motion-dom/dist/es/projection/styles/transform.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"transform.mjs","sources":["../../../../src/projection/styles/transform.ts"],"sourcesContent":["import type { Delta, Point } from \"motion-utils\"\nimport type { ResolvedValues } from \"../../node/types\"\n\nexport function buildProjectionTransform(\n delta: Delta,\n treeScale: Point,\n latestTransform?: ResolvedValues\n): string {\n let transform = \"\"\n\n /**\n * The translations we use to calculate are always relative to the viewport coordinate space.\n * But when we apply scales, we also scale the coordinate space of an element and its children.\n * For instance if we have a treeScale (the culmination of all parent scales) of 0.5 and we need\n * to move an element 100 pixels, we actually need to move it 200 in within that scaled space.\n */\n const xTranslate = delta.x.translate / treeScale.x\n const yTranslate = delta.y.translate / treeScale.y\n const zTranslate = latestTransform?.z || 0\n if (xTranslate || yTranslate || zTranslate) {\n transform = `translate3d(${xTranslate}px, ${yTranslate}px, ${zTranslate}px) `\n }\n\n /**\n * Apply scale correction for the tree transform.\n * This will apply scale to the screen-orientated axes.\n */\n if (treeScale.x !== 1 || treeScale.y !== 1) {\n transform += `scale(${1 / treeScale.x}, ${1 / treeScale.y}) `\n }\n\n if (latestTransform) {\n const {\n transformPerspective,\n rotate,\n pathRotation,\n rotateX,\n rotateY,\n skewX,\n skewY,\n } = latestTransform\n if (transformPerspective)\n transform = `perspective(${transformPerspective}px) ${transform}`\n if (rotate) transform += `rotate(${rotate}deg) `\n // Additive `rotate()` so user `rotate` isn't clobbered.\n if (pathRotation) transform += `rotate(${pathRotation}deg) `\n if (rotateX) transform += `rotateX(${rotateX}deg) `\n if (rotateY) transform += `rotateY(${rotateY}deg) `\n if (skewX) transform += `skewX(${skewX}deg) `\n if (skewY) transform += `skewY(${skewY}deg) `\n }\n\n /**\n * Apply scale to match the size of the element to the size we want it.\n * This will apply scale to the element-orientated axes.\n */\n const elementScaleX = delta.x.scale * treeScale.x\n const elementScaleY = delta.y.scale * treeScale.y\n if (elementScaleX !== 1 || elementScaleY !== 1) {\n transform += `scale(${elementScaleX}, ${elementScaleY})`\n }\n\n return transform || \"none\"\n}\n"],"names":[],"mappings":"SAGgB,wBAAwB,CACpC,KAAY,EACZ,SAAgB,EAChB,eAAgC,EAAA;IAEhC,IAAI,SAAS,GAAG,EAAE;AAElB;;;;;AAKG;IACH,MAAM,UAAU,GAAG,KAAK,CAAC,CAAC,CAAC,SAAS,GAAG,SAAS,CAAC,CAAC;IAClD,MAAM,UAAU,GAAG,KAAK,CAAC,CAAC,CAAC,SAAS,GAAG,SAAS,CAAC,CAAC;AAClD,IAAA,MAAM,UAAU,GAAG,eAAe,EAAE,CAAC,IAAI,CAAC;AAC1C,IAAA,IAAI,UAAU,IAAI,UAAU,IAAI,UAAU,EAAE;QACxC,SAAS,GAAG,eAAe,UAAU,CAAA,IAAA,EAAO,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S,CAAC,CAAC;IACjD,IAAI,aAAa,KAAK,CAAC,IAAI,aAAa,KAAK,CAAC,EAAE;AAC5C,QAAA,SAAS,IAAI,CAAA,MAAA,EAAS,aAAa,CAAA,EAAA,EAAK,aAAa,GAAG;IAC5D;IAEA,OAAO,SAAS,IAAI,MAAM;AAC9B;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/projection/utils/compare-by-depth.mjs b/node_modules/motion-dom/dist/es/projection/utils/compare-by-depth.mjs deleted file mode 100644 index 463a184..0000000 --- a/node_modules/motion-dom/dist/es/projection/utils/compare-by-depth.mjs +++ /dev/null @@ -1,4 +0,0 @@ -const compareByDepth = (a, b) => a.depth - b.depth; - -export { compareByDepth }; -//# sourceMappingURL=compare-by-depth.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/utils/compare-by-depth.mjs.map b/node_modules/motion-dom/dist/es/projection/utils/compare-by-depth.mjs.map deleted file mode 100644 index 789454d..0000000 --- a/node_modules/motion-dom/dist/es/projection/utils/compare-by-depth.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"compare-by-depth.mjs","sources":["../../../../src/projection/utils/compare-by-depth.ts"],"sourcesContent":["import type { VisualElement } from \"../../render/VisualElement\"\n\nexport interface WithDepth {\n depth: number\n}\n\nexport const compareByDepth = (a: VisualElement, b: VisualElement) =>\n a.depth - b.depth\n"],"names":[],"mappings":"AAMO,MAAM,cAAc,GAAG,CAAC,CAAgB,EAAE,CAAgB,KAC7D,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/projection/utils/each-axis.mjs b/node_modules/motion-dom/dist/es/projection/utils/each-axis.mjs deleted file mode 100644 index 00e4c66..0000000 --- a/node_modules/motion-dom/dist/es/projection/utils/each-axis.mjs +++ /dev/null @@ -1,6 +0,0 @@ -function eachAxis(callback) { - return [callback("x"), callback("y")]; -} - -export { eachAxis }; -//# sourceMappingURL=each-axis.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/utils/each-axis.mjs.map b/node_modules/motion-dom/dist/es/projection/utils/each-axis.mjs.map deleted file mode 100644 index c3cb6c4..0000000 --- a/node_modules/motion-dom/dist/es/projection/utils/each-axis.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"each-axis.mjs","sources":["../../../../src/projection/utils/each-axis.ts"],"sourcesContent":["type Callback = (axis: \"x\" | \"y\") => void\n\nexport function eachAxis(callback: Callback) {\n return [callback(\"x\"), callback(\"y\")]\n}\n"],"names":[],"mappings":"AAEM,SAAU,QAAQ,CAAC,QAAkB,EAAA;IACvC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC;AACzC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/projection/utils/flat-tree.mjs b/node_modules/motion-dom/dist/es/projection/utils/flat-tree.mjs deleted file mode 100644 index d9d6817..0000000 --- a/node_modules/motion-dom/dist/es/projection/utils/flat-tree.mjs +++ /dev/null @@ -1,25 +0,0 @@ -import { addUniqueItem, removeItem } from 'motion-utils'; -import { compareByDepth } from './compare-by-depth.mjs'; - -class FlatTree { - constructor() { - this.children = []; - this.isDirty = false; - } - add(child) { - addUniqueItem(this.children, child); - this.isDirty = true; - } - remove(child) { - removeItem(this.children, child); - this.isDirty = true; - } - forEach(callback) { - this.isDirty && this.children.sort(compareByDepth); - this.isDirty = false; - this.children.forEach(callback); - } -} - -export { FlatTree }; -//# sourceMappingURL=flat-tree.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/utils/flat-tree.mjs.map b/node_modules/motion-dom/dist/es/projection/utils/flat-tree.mjs.map deleted file mode 100644 index c9d0b75..0000000 --- a/node_modules/motion-dom/dist/es/projection/utils/flat-tree.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"flat-tree.mjs","sources":["../../../../src/projection/utils/flat-tree.ts"],"sourcesContent":["import { addUniqueItem, removeItem } from \"motion-utils\"\nimport { compareByDepth, WithDepth } from \"./compare-by-depth\"\n\nexport class FlatTree {\n private children: WithDepth[] = []\n\n private isDirty: boolean = false\n\n add(child: WithDepth) {\n addUniqueItem(this.children, child)\n this.isDirty = true\n }\n\n remove(child: WithDepth) {\n removeItem(this.children, child)\n this.isDirty = true\n }\n\n forEach(callback: (child: WithDepth) => void) {\n this.isDirty && this.children.sort(compareByDepth)\n this.isDirty = false\n this.children.forEach(callback)\n }\n}\n"],"names":[],"mappings":";;;MAGa,QAAQ,CAAA;AAArB,IAAA,WAAA,GAAA;QACY,IAAA,CAAA,QAAQ,GAAgB,EAAE;QAE1B,IAAA,CAAA,OAAO,GAAY,KAAK;IAiBpC;AAfI,IAAA,GAAG,CAAC,KAAgB,EAAA;AAChB,QAAA,aAAa,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC;AACnC,QAAA,IAAI,CAAC,OAAO,GAAG,IAAI;IACvB;AAEA,IAAA,MAAM,CAAC,KAAgB,EAAA;AACnB,QAAA,UAAU,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC;AAChC,QAAA,IAAI,CAAC,OAAO,GAAG,IAAI;IACvB;AAEA,IAAA,OAAO,CAAC,QAAoC,EAAA;QACxC,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,cAAc,CAAC;AAClD,QAAA,IAAI,CAAC,OAAO,GAAG,KAAK;AACpB,QAAA,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC;IACnC;AACH;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/projection/utils/has-transform.mjs b/node_modules/motion-dom/dist/es/projection/utils/has-transform.mjs deleted file mode 100644 index bf5d324..0000000 --- a/node_modules/motion-dom/dist/es/projection/utils/has-transform.mjs +++ /dev/null @@ -1,27 +0,0 @@ -function isIdentityScale(scale) { - return scale === undefined || scale === 1; -} -function hasScale({ scale, scaleX, scaleY }) { - return (!isIdentityScale(scale) || - !isIdentityScale(scaleX) || - !isIdentityScale(scaleY)); -} -function hasTransform(values) { - return (hasScale(values) || - has2DTranslate(values) || - values.z || - values.rotate || - values.rotateX || - values.rotateY || - values.skewX || - values.skewY); -} -function has2DTranslate(values) { - return is2DTranslate(values.x) || is2DTranslate(values.y); -} -function is2DTranslate(value) { - return value && value !== "0%"; -} - -export { has2DTranslate, hasScale, hasTransform }; -//# sourceMappingURL=has-transform.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/utils/has-transform.mjs.map b/node_modules/motion-dom/dist/es/projection/utils/has-transform.mjs.map deleted file mode 100644 index 40ba0e5..0000000 --- a/node_modules/motion-dom/dist/es/projection/utils/has-transform.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"has-transform.mjs","sources":["../../../../src/projection/utils/has-transform.ts"],"sourcesContent":["import { type AnyResolvedKeyframe } from \"../../animation/types\"\nimport { ResolvedValues } from \"../../render/types\"\n\nfunction isIdentityScale(scale: AnyResolvedKeyframe | undefined) {\n return scale === undefined || scale === 1\n}\n\nexport function hasScale({ scale, scaleX, scaleY }: ResolvedValues) {\n return (\n !isIdentityScale(scale) ||\n !isIdentityScale(scaleX) ||\n !isIdentityScale(scaleY)\n )\n}\n\nexport function hasTransform(values: ResolvedValues) {\n return (\n hasScale(values) ||\n has2DTranslate(values) ||\n values.z ||\n values.rotate ||\n values.rotateX ||\n values.rotateY ||\n values.skewX ||\n values.skewY\n )\n}\n\nexport function has2DTranslate(values: ResolvedValues) {\n return is2DTranslate(values.x) || is2DTranslate(values.y)\n}\n\nfunction is2DTranslate(value: AnyResolvedKeyframe | undefined) {\n return value && value !== \"0%\"\n}\n"],"names":[],"mappings":"AAGA,SAAS,eAAe,CAAC,KAAsC,EAAA;AAC3D,IAAA,OAAO,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,CAAC;AAC7C;AAEM,SAAU,QAAQ,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAkB,EAAA;AAC9D,IAAA,QACI,CAAC,eAAe,CAAC,KAAK,CAAC;QACvB,CAAC,eAAe,CAAC,MAAM,CAAC;AACxB,QAAA,CAAC,eAAe,CAAC,MAAM,CAAC;AAEhC;AAEM,SAAU,YAAY,CAAC,MAAsB,EAAA;AAC/C,IAAA,QACI,QAAQ,CAAC,MAAM,CAAC;QAChB,cAAc,CAAC,MAAM,CAAC;AACtB,QAAA,MAAM,CAAC,CAAC;AACR,QAAA,MAAM,CAAC,MAAM;AACb,QAAA,MAAM,CAAC,OAAO;AACd,QAAA,MAAM,CAAC,OAAO;AACd,QAAA,MAAM,CAAC,KAAK;QACZ,MAAM,CAAC,KAAK;AAEpB;AAEM,SAAU,cAAc,CAAC,MAAsB,EAAA;AACjD,IAAA,OAAO,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC;AAC7D;AAEA,SAAS,aAAa,CAAC,KAAsC,EAAA;AACzD,IAAA,OAAO,KAAK,IAAI,KAAK,KAAK,IAAI;AAClC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/projection/utils/measure.mjs b/node_modules/motion-dom/dist/es/projection/utils/measure.mjs deleted file mode 100644 index 33e0a65..0000000 --- a/node_modules/motion-dom/dist/es/projection/utils/measure.mjs +++ /dev/null @@ -1,18 +0,0 @@ -import { convertBoundingBoxToBox, transformBoxPoints } from '../geometry/conversion.mjs'; -import { translateAxis } from '../geometry/delta-apply.mjs'; - -function measureViewportBox(instance, transformPoint) { - return convertBoundingBoxToBox(transformBoxPoints(instance.getBoundingClientRect(), transformPoint)); -} -function measurePageBox(element, rootProjectionNode, transformPagePoint) { - const viewportBox = measureViewportBox(element, transformPagePoint); - const { scroll } = rootProjectionNode; - if (scroll) { - translateAxis(viewportBox.x, scroll.offset.x); - translateAxis(viewportBox.y, scroll.offset.y); - } - return viewportBox; -} - -export { measurePageBox, measureViewportBox }; -//# sourceMappingURL=measure.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/utils/measure.mjs.map b/node_modules/motion-dom/dist/es/projection/utils/measure.mjs.map deleted file mode 100644 index d1c0d8d..0000000 --- a/node_modules/motion-dom/dist/es/projection/utils/measure.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"measure.mjs","sources":["../../../../src/projection/utils/measure.ts"],"sourcesContent":["import { TransformPoint } from \"motion-utils\"\nimport {\n convertBoundingBoxToBox,\n transformBoxPoints,\n} from \"../geometry/conversion\"\nimport { translateAxis } from \"../geometry/delta-apply\"\n\nexport function measureViewportBox(\n instance: HTMLElement,\n transformPoint?: TransformPoint\n) {\n return convertBoundingBoxToBox(\n transformBoxPoints(instance.getBoundingClientRect(), transformPoint)\n )\n}\n\nexport function measurePageBox(\n element: HTMLElement,\n rootProjectionNode: any,\n transformPagePoint?: TransformPoint\n) {\n const viewportBox = measureViewportBox(element, transformPagePoint)\n const { scroll } = rootProjectionNode\n\n if (scroll) {\n translateAxis(viewportBox.x, scroll.offset.x)\n translateAxis(viewportBox.y, scroll.offset.y)\n }\n\n return viewportBox\n}\n"],"names":[],"mappings":";;;AAOM,SAAU,kBAAkB,CAC9B,QAAqB,EACrB,cAA+B,EAAA;AAE/B,IAAA,OAAO,uBAAuB,CAC1B,kBAAkB,CAAC,QAAQ,CAAC,qBAAqB,EAAE,EAAE,cAAc,CAAC,CACvE;AACL;SAEgB,cAAc,CAC1B,OAAoB,EACpB,kBAAuB,EACvB,kBAAmC,EAAA;IAEnC,MAAM,WAAW,GAAG,kBAAkB,CAAC,OAAO,EAAE,kBAAkB,CAAC;AACnE,IAAA,MAAM,EAAE,MAAM,EAAE,GAAG,kBAAkB;IAErC,IAAI,MAAM,EAAE;QACR,aAAa,CAAC,WAAW,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;QAC7C,aAAa,CAAC,WAAW,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;IACjD;AAEA,IAAA,OAAO,WAAW;AACtB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/Feature.mjs b/node_modules/motion-dom/dist/es/render/Feature.mjs deleted file mode 100644 index d614c3c..0000000 --- a/node_modules/motion-dom/dist/es/render/Feature.mjs +++ /dev/null @@ -1,15 +0,0 @@ -/** - * Feature base class for extending VisualElement functionality. - * Features are plugins that can be mounted/unmounted to add behavior - * like gestures, animations, or layout tracking. - */ -class Feature { - constructor(node) { - this.isMounted = false; - this.node = node; - } - update() { } -} - -export { Feature }; -//# sourceMappingURL=Feature.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/Feature.mjs.map b/node_modules/motion-dom/dist/es/render/Feature.mjs.map deleted file mode 100644 index c627149..0000000 --- a/node_modules/motion-dom/dist/es/render/Feature.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Feature.mjs","sources":["../../../src/render/Feature.ts"],"sourcesContent":["import type { VisualElement } from \"./VisualElement\"\n\n/**\n * Feature base class for extending VisualElement functionality.\n * Features are plugins that can be mounted/unmounted to add behavior\n * like gestures, animations, or layout tracking.\n */\nexport abstract class Feature {\n isMounted = false\n\n node: VisualElement\n\n constructor(node: VisualElement) {\n this.node = node\n }\n\n abstract mount(): void\n\n abstract unmount(): void\n\n update(): void {}\n}\n"],"names":[],"mappings":"AAEA;;;;AAIG;MACmB,OAAO,CAAA;AAKzB,IAAA,WAAA,CAAY,IAAsB,EAAA;QAJlC,IAAA,CAAA,SAAS,GAAG,KAAK;AAKb,QAAA,IAAI,CAAC,IAAI,GAAG,IAAI;IACpB;AAMA,IAAA,MAAM,KAAU;AACnB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/VisualElement.mjs b/node_modules/motion-dom/dist/es/render/VisualElement.mjs deleted file mode 100644 index fba5cd3..0000000 --- a/node_modules/motion-dom/dist/es/render/VisualElement.mjs +++ /dev/null @@ -1,560 +0,0 @@ -import { warnOnce, secondsToMilliseconds, isNumericalString, isZeroValueString, SubscriptionManager } from 'motion-utils'; -import { KeyframeResolver } from '../animation/keyframes/KeyframesResolver.mjs'; -import { NativeAnimation } from '../animation/NativeAnimation.mjs'; -import { acceleratedValues } from '../animation/waapi/utils/accelerated-values.mjs'; -import { microtask } from '../frameloop/microtask.mjs'; -import { time } from '../frameloop/sync-time.mjs'; -import { createBox } from '../projection/geometry/models.mjs'; -import { motionValue } from '../value/index.mjs'; -import { complex } from '../value/types/complex/index.mjs'; -import { getAnimatableNone } from '../value/types/utils/animatable-none.mjs'; -import { findValueType } from '../value/types/utils/find.mjs'; -import { isMotionValue } from '../value/utils/is-motion-value.mjs'; -import { visualElementStore } from './store.mjs'; -import { isControllingVariants, isVariantNode } from './utils/is-controlling-variants.mjs'; -import { transformProps } from './utils/keys-transform.mjs'; -import { updateMotionValuesFromProps } from './utils/motion-values.mjs'; -import { initPrefersReducedMotion } from './utils/reduced-motion/index.mjs'; -import { resolveVariantFromProps } from './utils/resolve-variants.mjs'; -import { hasReducedMotionListener, prefersReducedMotion } from './utils/reduced-motion/state.mjs'; -import { frame, cancelFrame } from '../frameloop/frame.mjs'; - -const propEventHandlers = [ - "AnimationStart", - "AnimationComplete", - "Update", - "BeforeLayoutMeasure", - "LayoutMeasure", - "LayoutAnimationStart", - "LayoutAnimationComplete", -]; -/** - * Static feature definitions - can be injected by framework layer - */ -let featureDefinitions = {}; -/** - * Set feature definitions for all VisualElements. - * This should be called by the framework layer (e.g., framer-motion) during initialization. - */ -function setFeatureDefinitions(definitions) { - featureDefinitions = definitions; -} -/** - * Get the current feature definitions - */ -function getFeatureDefinitions() { - return featureDefinitions; -} -/** - * A VisualElement is an imperative abstraction around UI elements such as - * HTMLElement, SVGElement, Three.Object3D etc. - */ -class VisualElement { - /** - * This method takes React props and returns found MotionValues. For example, HTML - * MotionValues will be found within the style prop, whereas for Three.js within attribute arrays. - * - * This isn't an abstract method as it needs calling in the constructor, but it is - * intended to be one. - */ - scrapeMotionValuesFromProps(_props, _prevProps, _visualElement) { - return {}; - } - constructor({ parent, props, presenceContext, reducedMotionConfig, skipAnimations, blockInitialAnimation, visualState, }, options = {}) { - /** - * A reference to the current underlying Instance, e.g. a HTMLElement - * or Three.Mesh etc. - */ - this.current = null; - /** - * A set containing references to this VisualElement's children. - */ - this.children = new Set(); - /** - * Determine what role this visual element should take in the variant tree. - */ - this.isVariantNode = false; - this.isControllingVariants = false; - /** - * Decides whether this VisualElement should animate in reduced motion - * mode. - * - * TODO: This is currently set on every individual VisualElement but feels - * like it could be set globally. - */ - this.shouldReduceMotion = null; - /** - * Decides whether animations should be skipped for this VisualElement. - * Useful for E2E tests and visual regression testing. - */ - this.shouldSkipAnimations = false; - /** - * A map of all motion values attached to this visual element. Motion - * values are source of truth for any given animated value. A motion - * value might be provided externally by the component via props. - */ - this.values = new Map(); - this.KeyframeResolver = KeyframeResolver; - /** - * Cleanup functions for active features (hover/tap/exit etc) - */ - this.features = {}; - /** - * A map of every subscription that binds the provided or generated - * motion values onChange listeners to this visual element. - */ - this.valueSubscriptions = new Map(); - /** - * A reference to the previously-provided motion values as returned - * from scrapeMotionValuesFromProps. We use the keys in here to determine - * if any motion values need to be removed after props are updated. - */ - this.prevMotionValues = {}; - /** - * Track whether this element has been mounted before, to detect - * remounts after Suspense unmount/remount cycles. - */ - this.hasBeenMounted = false; - /** - * An object containing a SubscriptionManager for each active event. - */ - this.events = {}; - /** - * An object containing an unsubscribe function for each prop event subscription. - * For example, every "Update" event can have multiple subscribers via - * VisualElement.on(), but only one of those can be defined via the onUpdate prop. - */ - this.propEventSubscriptions = {}; - this.notifyUpdate = () => this.notify("Update", this.latestValues); - this.render = () => { - if (!this.current) - return; - this.triggerBuild(); - this.renderInstance(this.current, this.renderState, this.props.style, this.projection); - }; - this.renderScheduledAt = 0.0; - this.scheduleRender = () => { - const now = time.now(); - if (this.renderScheduledAt < now) { - this.renderScheduledAt = now; - frame.render(this.render, false, true); - } - }; - const { latestValues, renderState } = visualState; - this.latestValues = latestValues; - this.baseTarget = { ...latestValues }; - this.initialValues = props.initial ? { ...latestValues } : {}; - this.renderState = renderState; - this.parent = parent; - this.props = props; - this.presenceContext = presenceContext; - this.depth = parent ? parent.depth + 1 : 0; - this.reducedMotionConfig = reducedMotionConfig; - this.skipAnimationsConfig = skipAnimations; - this.options = options; - this.blockInitialAnimation = Boolean(blockInitialAnimation); - this.isControllingVariants = isControllingVariants(props); - this.isVariantNode = isVariantNode(props); - if (this.isVariantNode) { - this.variantChildren = new Set(); - } - this.manuallyAnimateOnMount = Boolean(parent && parent.current); - /** - * Any motion values that are provided to the element when created - * aren't yet bound to the element, as this would technically be impure. - * However, we iterate through the motion values and set them to the - * initial values for this component. - * - * TODO: This is impure and we should look at changing this to run on mount. - * Doing so will break some tests but this isn't necessarily a breaking change, - * more a reflection of the test. - */ - const { willChange, ...initialMotionValues } = this.scrapeMotionValuesFromProps(props, {}, this); - for (const key in initialMotionValues) { - const value = initialMotionValues[key]; - if (latestValues[key] !== undefined && isMotionValue(value)) { - value.set(latestValues[key]); - } - } - } - mount(instance) { - /** - * If this element has been mounted before (e.g. after a Suspense - * unmount/remount), reset motion values to their initial state - * so animations replay correctly from initial → animate. - */ - if (this.hasBeenMounted) { - for (const key in this.initialValues) { - this.values.get(key)?.jump(this.initialValues[key]); - this.latestValues[key] = this.initialValues[key]; - } - } - this.current = instance; - visualElementStore.set(instance, this); - if (this.projection && !this.projection.instance) { - this.projection.mount(instance); - } - if (this.parent && this.isVariantNode && !this.isControllingVariants) { - this.removeFromVariantTree = this.parent.addVariantChild(this); - } - this.values.forEach((value, key) => this.bindToMotionValue(key, value)); - /** - * Determine reduced motion preference. Only initialize the matchMedia - * listener if we actually need the dynamic value (i.e., when config - * is neither "never" nor "always"). - */ - if (this.reducedMotionConfig === "never") { - this.shouldReduceMotion = false; - } - else if (this.reducedMotionConfig === "always") { - this.shouldReduceMotion = true; - } - else { - if (!hasReducedMotionListener.current) { - initPrefersReducedMotion(); - } - this.shouldReduceMotion = prefersReducedMotion.current; - } - if (process.env.NODE_ENV !== "production") { - warnOnce(this.shouldReduceMotion !== true, "You have Reduced Motion enabled on your device. Animations may not appear as expected.", "reduced-motion-disabled"); - } - /** - * Set whether animations should be skipped based on the config. - */ - this.shouldSkipAnimations = this.skipAnimationsConfig ?? false; - this.parent?.addChild(this); - this.update(this.props, this.presenceContext); - this.hasBeenMounted = true; - } - unmount() { - this.projection && this.projection.unmount(); - cancelFrame(this.notifyUpdate); - cancelFrame(this.render); - this.valueSubscriptions.forEach((remove) => remove()); - this.valueSubscriptions.clear(); - this.removeFromVariantTree && this.removeFromVariantTree(); - this.parent?.removeChild(this); - for (const key in this.events) { - this.events[key].clear(); - } - for (const key in this.features) { - const feature = this.features[key]; - if (feature) { - feature.unmount(); - feature.isMounted = false; - } - } - this.current = null; - } - addChild(child) { - this.children.add(child); - this.enteringChildren ?? (this.enteringChildren = new Set()); - this.enteringChildren.add(child); - } - removeChild(child) { - this.children.delete(child); - this.enteringChildren && this.enteringChildren.delete(child); - } - bindToMotionValue(key, value) { - if (this.valueSubscriptions.has(key)) { - this.valueSubscriptions.get(key)(); - } - if (value.accelerate && - acceleratedValues.has(key) && - this.current instanceof HTMLElement) { - const { factory, keyframes, times, ease, duration } = value.accelerate; - const animation = new NativeAnimation({ - element: this.current, - name: key, - keyframes, - times, - ease, - duration: secondsToMilliseconds(duration), - }); - const cleanup = factory(animation); - this.valueSubscriptions.set(key, () => { - cleanup(); - animation.cancel(); - }); - return; - } - const valueIsTransform = transformProps.has(key); - if (valueIsTransform && this.onBindTransform) { - this.onBindTransform(); - } - const removeOnChange = value.on("change", (latestValue) => { - this.latestValues[key] = latestValue; - this.props.onUpdate && frame.preRender(this.notifyUpdate); - if (valueIsTransform && this.projection) { - this.projection.isTransformDirty = true; - } - this.scheduleRender(); - }); - let removeSyncCheck; - if (typeof window !== "undefined" && - window.MotionCheckAppearSync) { - removeSyncCheck = window.MotionCheckAppearSync(this, key, value); - } - this.valueSubscriptions.set(key, () => { - removeOnChange(); - if (removeSyncCheck) - removeSyncCheck(); - // Defer to MotionValue.on("change") auto-stop so React 19 remounts - // can resubscribe before the animation is cancelled (#3315). - }); - } - sortNodePosition(other) { - /** - * If these nodes aren't even of the same type we can't compare their depth. - */ - if (!this.current || - !this.sortInstanceNodePosition || - this.type !== other.type) { - return 0; - } - return this.sortInstanceNodePosition(this.current, other.current); - } - updateFeatures() { - let key = "animation"; - for (key in featureDefinitions) { - const featureDefinition = featureDefinitions[key]; - if (!featureDefinition) - continue; - const { isEnabled, Feature: FeatureConstructor } = featureDefinition; - /** - * If this feature is enabled but not active, make a new instance. - */ - if (!this.features[key] && - FeatureConstructor && - isEnabled(this.props)) { - this.features[key] = new FeatureConstructor(this); - } - /** - * If we have a feature, mount or update it. - */ - if (this.features[key]) { - const feature = this.features[key]; - if (feature.isMounted) { - feature.update(); - } - else { - feature.mount(); - feature.isMounted = true; - } - } - } - } - triggerBuild() { - this.build(this.renderState, this.latestValues, this.props); - } - /** - * Measure the current viewport box with or without transforms. - * Only measures axis-aligned boxes, rotate and skew must be manually - * removed with a re-render to work. - */ - measureViewportBox() { - return this.current - ? this.measureInstanceViewportBox(this.current, this.props) - : createBox(); - } - getStaticValue(key) { - return this.latestValues[key]; - } - setStaticValue(key, value) { - this.latestValues[key] = value; - } - /** - * Update the provided props. Ensure any newly-added motion values are - * added to our map, old ones removed, and listeners updated. - */ - update(props, presenceContext) { - if (props.transformTemplate || this.props.transformTemplate) { - this.scheduleRender(); - } - this.prevProps = this.props; - this.props = props; - this.prevPresenceContext = this.presenceContext; - this.presenceContext = presenceContext; - /** - * Update prop event handlers ie onAnimationStart, onAnimationComplete - */ - for (let i = 0; i < propEventHandlers.length; i++) { - const key = propEventHandlers[i]; - if (this.propEventSubscriptions[key]) { - this.propEventSubscriptions[key](); - delete this.propEventSubscriptions[key]; - } - const listenerName = ("on" + key); - const listener = props[listenerName]; - if (listener) { - this.propEventSubscriptions[key] = this.on(key, listener); - } - } - this.prevMotionValues = updateMotionValuesFromProps(this, this.scrapeMotionValuesFromProps(props, this.prevProps || {}, this), this.prevMotionValues); - if (this.handleChildMotionValue) { - this.handleChildMotionValue(); - } - } - getProps() { - return this.props; - } - /** - * Returns the variant definition with a given name. - */ - getVariant(name) { - return this.props.variants ? this.props.variants[name] : undefined; - } - /** - * Returns the defined default transition on this component. - */ - getDefaultTransition() { - return this.props.transition; - } - getTransformPagePoint() { - return this.props.transformPagePoint; - } - getClosestVariantNode() { - return this.isVariantNode - ? this - : this.parent - ? this.parent.getClosestVariantNode() - : undefined; - } - /** - * Add a child visual element to our set of children. - */ - addVariantChild(child) { - const closestVariantNode = this.getClosestVariantNode(); - if (closestVariantNode) { - closestVariantNode.variantChildren && - closestVariantNode.variantChildren.add(child); - return () => closestVariantNode.variantChildren.delete(child); - } - } - /** - * Add a motion value and bind it to this visual element. - */ - addValue(key, value) { - // Remove existing value if it exists - const existingValue = this.values.get(key); - if (value !== existingValue) { - if (existingValue) - this.removeValue(key); - this.bindToMotionValue(key, value); - this.values.set(key, value); - this.latestValues[key] = value.get(); - } - } - /** - * Remove a motion value and unbind any active subscriptions. - */ - removeValue(key) { - this.values.delete(key); - const unsubscribe = this.valueSubscriptions.get(key); - if (unsubscribe) { - unsubscribe(); - this.valueSubscriptions.delete(key); - } - delete this.latestValues[key]; - this.removeValueFromRenderState(key, this.renderState); - } - /** - * Check whether we have a motion value for this key - */ - hasValue(key) { - return this.values.has(key); - } - getValue(key, defaultValue) { - if (this.props.values && this.props.values[key]) { - return this.props.values[key]; - } - let value = this.values.get(key); - if (value === undefined && defaultValue !== undefined) { - value = motionValue(defaultValue === null ? undefined : defaultValue, { owner: this }); - this.addValue(key, value); - } - return value; - } - /** - * If we're trying to animate to a previously unencountered value, - * we need to check for it in our state and as a last resort read it - * directly from the instance (which might have performance implications). - */ - readValue(key, target) { - let value = this.latestValues[key] !== undefined || !this.current - ? this.latestValues[key] - : this.getBaseTargetFromProps(this.props, key) ?? - this.readValueFromInstance(this.current, key, this.options); - if (value !== undefined && value !== null) { - if (typeof value === "string" && - (isNumericalString(value) || isZeroValueString(value))) { - // If this is a number read as a string, ie "0" or "200", convert it to a number - value = parseFloat(value); - } - else if (!findValueType(value) && complex.test(target)) { - value = getAnimatableNone(key, target); - } - this.setBaseTarget(key, isMotionValue(value) ? value.get() : value); - } - return isMotionValue(value) ? value.get() : value; - } - /** - * Set the base target to later animate back to. This is currently - * only hydrated on creation and when we first read a value. - */ - setBaseTarget(key, value) { - this.baseTarget[key] = value; - } - /** - * Find the base target for a value thats been removed from all animation - * props. - */ - getBaseTarget(key) { - const { initial } = this.props; - let valueFromInitial; - if (typeof initial === "string" || typeof initial === "object") { - const variant = resolveVariantFromProps(this.props, initial, this.presenceContext?.custom); - if (variant) { - valueFromInitial = variant[key]; - } - } - /** - * If this value still exists in the current initial variant, read that. - */ - if (initial && valueFromInitial !== undefined) { - return valueFromInitial; - } - /** - * Alternatively, if this VisualElement config has defined a getBaseTarget - * so we can read the value from an alternative source, try that. - */ - const target = this.getBaseTargetFromProps(this.props, key); - if (target !== undefined && !isMotionValue(target)) - return target; - /** - * If the value was initially defined on initial, but it doesn't any more, - * return undefined. Otherwise return the value as initially read from the DOM. - */ - return this.initialValues[key] !== undefined && - valueFromInitial === undefined - ? undefined - : this.baseTarget[key]; - } - on(eventName, callback) { - if (!this.events[eventName]) { - this.events[eventName] = new SubscriptionManager(); - } - return this.events[eventName].add(callback); - } - notify(eventName, ...args) { - if (this.events[eventName]) { - this.events[eventName].notify(...args); - } - } - scheduleRenderMicrotask() { - microtask.render(this.render); - } -} - -export { VisualElement, getFeatureDefinitions, setFeatureDefinitions }; -//# sourceMappingURL=VisualElement.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/VisualElement.mjs.map b/node_modules/motion-dom/dist/es/render/VisualElement.mjs.map deleted file mode 100644 index 5ea221b..0000000 --- a/node_modules/motion-dom/dist/es/render/VisualElement.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"VisualElement.mjs","sources":["../../../src/render/VisualElement.ts"],"sourcesContent":["import {\n Box,\n isNumericalString,\n isZeroValueString,\n secondsToMilliseconds,\n SubscriptionManager,\n warnOnce,\n} from \"motion-utils\"\nimport { KeyframeResolver } from \"../animation/keyframes/KeyframesResolver\"\nimport { NativeAnimation } from \"../animation/NativeAnimation\"\nimport type { AnyResolvedKeyframe } from \"../animation/types\"\nimport { acceleratedValues } from \"../animation/waapi/utils/accelerated-values\"\nimport { cancelFrame, frame } from \"../frameloop\"\nimport { microtask } from \"../frameloop/microtask\"\nimport { time } from \"../frameloop/sync-time\"\nimport type { MotionNodeOptions } from \"../node/types\"\nimport { createBox } from \"../projection/geometry/models\"\nimport { motionValue, MotionValue } from \"../value\"\nimport { complex } from \"../value/types/complex\"\nimport { getAnimatableNone } from \"../value/types/utils/animatable-none\"\nimport { findValueType } from \"../value/types/utils/find\"\nimport { isMotionValue } from \"../value/utils/is-motion-value\"\nimport { Feature } from \"./Feature\"\nimport { visualElementStore } from \"./store\"\nimport {\n FeatureDefinitions,\n MotionConfigContextProps,\n PresenceContextProps,\n ReducedMotionConfig,\n ResolvedValues,\n VisualElementEventCallbacks,\n VisualElementOptions,\n} from \"./types\"\nimport { AnimationState } from \"./utils/animation-state\"\nimport {\n isControllingVariants as checkIsControllingVariants,\n isVariantNode as checkIsVariantNode,\n} from \"./utils/is-controlling-variants\"\nimport { transformProps } from \"./utils/keys-transform\"\nimport { updateMotionValuesFromProps } from \"./utils/motion-values\"\nimport {\n hasReducedMotionListener,\n initPrefersReducedMotion,\n prefersReducedMotion,\n} from \"./utils/reduced-motion\"\nimport { resolveVariantFromProps } from \"./utils/resolve-variants\"\n\nconst propEventHandlers = [\n \"AnimationStart\",\n \"AnimationComplete\",\n \"Update\",\n \"BeforeLayoutMeasure\",\n \"LayoutMeasure\",\n \"LayoutAnimationStart\",\n \"LayoutAnimationComplete\",\n] as const\n\n/**\n * Static feature definitions - can be injected by framework layer\n */\nlet featureDefinitions: Partial = {}\n\n/**\n * Set feature definitions for all VisualElements.\n * This should be called by the framework layer (e.g., framer-motion) during initialization.\n */\nexport function setFeatureDefinitions(\n definitions: Partial\n) {\n featureDefinitions = definitions\n}\n\n/**\n * Get the current feature definitions\n */\nexport function getFeatureDefinitions(): Partial {\n return featureDefinitions\n}\n\n/**\n * Motion style type - a subset of CSS properties that can contain motion values\n */\nexport type MotionStyle = {\n [K: string]: AnyResolvedKeyframe | MotionValue | undefined\n}\n\n/**\n * A VisualElement is an imperative abstraction around UI elements such as\n * HTMLElement, SVGElement, Three.Object3D etc.\n */\nexport abstract class VisualElement<\n Instance = unknown,\n RenderState = unknown,\n Options extends {} = {}\n> {\n /**\n * VisualElements are arranged in trees mirroring that of the React tree.\n * Each type of VisualElement has a unique name, to detect when we're crossing\n * type boundaries within that tree.\n */\n abstract type: string\n\n /**\n * An `Array.sort` compatible function that will compare two Instances and\n * compare their respective positions within the tree.\n */\n abstract sortInstanceNodePosition(a: Instance, b: Instance): number\n\n /**\n * Measure the viewport-relative bounding box of the Instance.\n */\n abstract measureInstanceViewportBox(\n instance: Instance,\n props: MotionNodeOptions & Partial\n ): Box\n\n /**\n * When a value has been removed from all animation props we need to\n * pick a target to animate back to. For instance, for HTMLElements\n * we can look in the style prop.\n */\n abstract getBaseTargetFromProps(\n props: MotionNodeOptions,\n key: string\n ): AnyResolvedKeyframe | undefined | MotionValue\n\n /**\n * When we first animate to a value we need to animate it *from* a value.\n * Often this have been specified via the initial prop but it might be\n * that the value needs to be read from the Instance.\n */\n abstract readValueFromInstance(\n instance: Instance,\n key: string,\n options: Options\n ): AnyResolvedKeyframe | null | undefined\n\n /**\n * When a value has been removed from the VisualElement we use this to remove\n * it from the inherting class' unique render state.\n */\n abstract removeValueFromRenderState(\n key: string,\n renderState: RenderState\n ): void\n\n /**\n * Run before a React or VisualElement render, builds the latest motion\n * values into an Instance-specific format. For example, HTMLVisualElement\n * will use this step to build `style` and `var` values.\n */\n abstract build(\n renderState: RenderState,\n latestValues: ResolvedValues,\n props: MotionNodeOptions\n ): void\n\n /**\n * Apply the built values to the Instance. For example, HTMLElements will have\n * styles applied via `setProperty` and the style attribute, whereas SVGElements\n * will have values applied to attributes.\n */\n abstract renderInstance(\n instance: Instance,\n renderState: RenderState,\n styleProp?: MotionStyle,\n projection?: any\n ): void\n\n /**\n * This method is called when a transform property is bound to a motion value.\n * It's currently used to measure SVG elements when a new transform property is bound.\n */\n onBindTransform?(): void\n\n /**\n * If the component child is provided as a motion value, handle subscriptions\n * with the renderer-specific VisualElement.\n */\n handleChildMotionValue?(): void\n\n /**\n * This method takes React props and returns found MotionValues. For example, HTML\n * MotionValues will be found within the style prop, whereas for Three.js within attribute arrays.\n *\n * This isn't an abstract method as it needs calling in the constructor, but it is\n * intended to be one.\n */\n scrapeMotionValuesFromProps(\n _props: MotionNodeOptions,\n _prevProps: MotionNodeOptions,\n _visualElement: VisualElement\n ): {\n [key: string]: MotionValue | AnyResolvedKeyframe\n } {\n return {}\n }\n\n /**\n * A reference to the current underlying Instance, e.g. a HTMLElement\n * or Three.Mesh etc.\n */\n current: Instance | null = null\n\n /**\n * A reference to the parent VisualElement (if exists).\n */\n parent: VisualElement | undefined\n\n /**\n * A set containing references to this VisualElement's children.\n */\n children = new Set()\n\n /**\n * A set containing the latest children of this VisualElement. This is flushed\n * at the start of every commit. We use it to calculate the stagger delay\n * for newly-added children.\n */\n enteringChildren?: Set\n\n /**\n * The depth of this VisualElement within the overall VisualElement tree.\n */\n depth: number\n\n /**\n * The current render state of this VisualElement. Defined by inherting VisualElements.\n */\n renderState: RenderState\n\n /**\n * An object containing the latest static values for each of this VisualElement's\n * MotionValues.\n */\n latestValues: ResolvedValues\n\n /**\n * Determine what role this visual element should take in the variant tree.\n */\n isVariantNode: boolean = false\n isControllingVariants: boolean = false\n\n /**\n * If this component is part of the variant tree, it should track\n * any children that are also part of the tree. This is essentially\n * a shadow tree to simplify logic around how to stagger over children.\n */\n variantChildren?: Set\n\n /**\n * Decides whether this VisualElement should animate in reduced motion\n * mode.\n *\n * TODO: This is currently set on every individual VisualElement but feels\n * like it could be set globally.\n */\n shouldReduceMotion: boolean | null = null\n\n /**\n * Decides whether animations should be skipped for this VisualElement.\n * Useful for E2E tests and visual regression testing.\n */\n shouldSkipAnimations: boolean = false\n\n /**\n * Normally, if a component is controlled by a parent's variants, it can\n * rely on that ancestor to trigger animations further down the tree.\n * However, if a component is created after its parent is mounted, the parent\n * won't trigger that mount animation so the child needs to.\n *\n * TODO: This might be better replaced with a method isParentMounted\n */\n manuallyAnimateOnMount: boolean\n\n /**\n * This can be set by AnimatePresence to force components that mount\n * at the same time as it to mount as if they have initial={false} set.\n */\n blockInitialAnimation: boolean\n\n /**\n * A reference to this VisualElement's projection node, used in layout animations.\n */\n projection?: any\n\n /**\n * A map of all motion values attached to this visual element. Motion\n * values are source of truth for any given animated value. A motion\n * value might be provided externally by the component via props.\n */\n values = new Map()\n\n /**\n * The AnimationState, this is hydrated by the animation Feature.\n */\n animationState?: AnimationState\n\n KeyframeResolver = KeyframeResolver\n\n /**\n * The options used to create this VisualElement. The Options type is defined\n * by the inheriting VisualElement and is passed straight through to the render functions.\n */\n readonly options: Options\n\n /**\n * A reference to the latest props provided to the VisualElement's host React component.\n */\n props: MotionNodeOptions\n prevProps?: MotionNodeOptions\n\n presenceContext: PresenceContextProps | null\n prevPresenceContext?: PresenceContextProps | null\n\n /**\n * Cleanup functions for active features (hover/tap/exit etc)\n */\n private features: {\n [K in keyof FeatureDefinitions]?: Feature\n } = {}\n\n /**\n * A map of every subscription that binds the provided or generated\n * motion values onChange listeners to this visual element.\n */\n private valueSubscriptions = new Map()\n\n /**\n * A reference to the ReducedMotionConfig passed to the VisualElement's host React component.\n */\n private reducedMotionConfig: ReducedMotionConfig | undefined\n\n /**\n * A reference to the skipAnimations config passed to the VisualElement's host React component.\n */\n private skipAnimationsConfig: boolean | undefined\n\n /**\n * On mount, this will be hydrated with a callback to disconnect\n * this visual element from its parent on unmount.\n */\n private removeFromVariantTree: undefined | VoidFunction\n\n /**\n * A reference to the previously-provided motion values as returned\n * from scrapeMotionValuesFromProps. We use the keys in here to determine\n * if any motion values need to be removed after props are updated.\n */\n private prevMotionValues: MotionStyle = {}\n\n /**\n * When values are removed from all animation props we need to search\n * for a fallback value to animate to. These values are tracked in baseTarget.\n */\n private baseTarget: ResolvedValues\n\n /**\n * Create an object of the values we initially animated from (if initial prop present).\n */\n private initialValues: ResolvedValues\n\n /**\n * Track whether this element has been mounted before, to detect\n * remounts after Suspense unmount/remount cycles.\n */\n private hasBeenMounted = false\n\n /**\n * An object containing a SubscriptionManager for each active event.\n */\n private events: {\n [key: string]: SubscriptionManager\n } = {}\n\n /**\n * An object containing an unsubscribe function for each prop event subscription.\n * For example, every \"Update\" event can have multiple subscribers via\n * VisualElement.on(), but only one of those can be defined via the onUpdate prop.\n */\n private propEventSubscriptions: {\n [key: string]: VoidFunction\n } = {}\n\n constructor(\n {\n parent,\n props,\n presenceContext,\n reducedMotionConfig,\n skipAnimations,\n blockInitialAnimation,\n visualState,\n }: VisualElementOptions,\n options: Options = {} as any\n ) {\n const { latestValues, renderState } = visualState\n this.latestValues = latestValues\n this.baseTarget = { ...latestValues }\n this.initialValues = props.initial ? { ...latestValues } : {}\n this.renderState = renderState\n this.parent = parent\n this.props = props\n this.presenceContext = presenceContext\n this.depth = parent ? parent.depth + 1 : 0\n this.reducedMotionConfig = reducedMotionConfig\n this.skipAnimationsConfig = skipAnimations\n this.options = options\n this.blockInitialAnimation = Boolean(blockInitialAnimation)\n\n this.isControllingVariants = checkIsControllingVariants(props)\n this.isVariantNode = checkIsVariantNode(props)\n if (this.isVariantNode) {\n this.variantChildren = new Set()\n }\n\n this.manuallyAnimateOnMount = Boolean(parent && parent.current)\n\n /**\n * Any motion values that are provided to the element when created\n * aren't yet bound to the element, as this would technically be impure.\n * However, we iterate through the motion values and set them to the\n * initial values for this component.\n *\n * TODO: This is impure and we should look at changing this to run on mount.\n * Doing so will break some tests but this isn't necessarily a breaking change,\n * more a reflection of the test.\n */\n const { willChange, ...initialMotionValues } =\n this.scrapeMotionValuesFromProps(props, {}, this)\n\n for (const key in initialMotionValues) {\n const value = initialMotionValues[key]\n\n if (latestValues[key] !== undefined && isMotionValue(value)) {\n value.set(latestValues[key])\n }\n }\n }\n\n mount(instance: Instance) {\n /**\n * If this element has been mounted before (e.g. after a Suspense\n * unmount/remount), reset motion values to their initial state\n * so animations replay correctly from initial → animate.\n */\n if (this.hasBeenMounted) {\n for (const key in this.initialValues) {\n this.values.get(key)?.jump(this.initialValues[key])\n this.latestValues[key] = this.initialValues[key]\n }\n }\n\n this.current = instance\n\n visualElementStore.set(instance, this)\n\n if (this.projection && !this.projection.instance) {\n this.projection.mount(instance)\n }\n\n if (this.parent && this.isVariantNode && !this.isControllingVariants) {\n this.removeFromVariantTree = this.parent.addVariantChild(this)\n }\n\n this.values.forEach((value, key) => this.bindToMotionValue(key, value))\n\n /**\n * Determine reduced motion preference. Only initialize the matchMedia\n * listener if we actually need the dynamic value (i.e., when config\n * is neither \"never\" nor \"always\").\n */\n if (this.reducedMotionConfig === \"never\") {\n this.shouldReduceMotion = false\n } else if (this.reducedMotionConfig === \"always\") {\n this.shouldReduceMotion = true\n } else {\n if (!hasReducedMotionListener.current) {\n initPrefersReducedMotion()\n }\n this.shouldReduceMotion = prefersReducedMotion.current\n }\n\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(\n this.shouldReduceMotion !== true,\n \"You have Reduced Motion enabled on your device. Animations may not appear as expected.\",\n \"reduced-motion-disabled\"\n )\n }\n\n /**\n * Set whether animations should be skipped based on the config.\n */\n this.shouldSkipAnimations = this.skipAnimationsConfig ?? false\n\n this.parent?.addChild(this)\n\n this.update(this.props, this.presenceContext)\n\n this.hasBeenMounted = true\n }\n\n unmount() {\n this.projection && this.projection.unmount()\n cancelFrame(this.notifyUpdate)\n cancelFrame(this.render)\n this.valueSubscriptions.forEach((remove) => remove())\n this.valueSubscriptions.clear()\n this.removeFromVariantTree && this.removeFromVariantTree()\n this.parent?.removeChild(this)\n\n for (const key in this.events) {\n this.events[key].clear()\n }\n\n for (const key in this.features) {\n const feature = this.features[key as keyof typeof this.features]\n if (feature) {\n feature.unmount()\n feature.isMounted = false\n }\n }\n this.current = null\n }\n\n addChild(child: VisualElement) {\n this.children.add(child)\n this.enteringChildren ??= new Set()\n this.enteringChildren.add(child)\n }\n\n removeChild(child: VisualElement) {\n this.children.delete(child)\n this.enteringChildren && this.enteringChildren.delete(child)\n }\n\n private bindToMotionValue(key: string, value: MotionValue) {\n if (this.valueSubscriptions.has(key)) {\n this.valueSubscriptions.get(key)!()\n }\n\n if (\n value.accelerate &&\n acceleratedValues.has(key) &&\n this.current instanceof HTMLElement\n ) {\n const { factory, keyframes, times, ease, duration } =\n value.accelerate\n\n const animation = new NativeAnimation({\n element: this.current,\n name: key,\n keyframes,\n times,\n ease,\n duration: secondsToMilliseconds(duration),\n })\n\n const cleanup = factory(animation)\n\n this.valueSubscriptions.set(key, () => {\n cleanup()\n animation.cancel()\n })\n return\n }\n\n const valueIsTransform = transformProps.has(key)\n\n if (valueIsTransform && this.onBindTransform) {\n this.onBindTransform()\n }\n\n const removeOnChange = value.on(\n \"change\",\n (latestValue: AnyResolvedKeyframe) => {\n this.latestValues[key] = latestValue\n\n this.props.onUpdate && frame.preRender(this.notifyUpdate)\n\n if (valueIsTransform && this.projection) {\n this.projection.isTransformDirty = true\n }\n\n this.scheduleRender()\n }\n )\n\n let removeSyncCheck: VoidFunction | void\n if (\n typeof window !== \"undefined\" &&\n (window as any).MotionCheckAppearSync\n ) {\n removeSyncCheck = (window as any).MotionCheckAppearSync(\n this,\n key,\n value\n )\n }\n\n this.valueSubscriptions.set(key, () => {\n removeOnChange()\n if (removeSyncCheck) removeSyncCheck()\n // Defer to MotionValue.on(\"change\") auto-stop so React 19 remounts\n // can resubscribe before the animation is cancelled (#3315).\n })\n }\n\n sortNodePosition(other: VisualElement) {\n /**\n * If these nodes aren't even of the same type we can't compare their depth.\n */\n if (\n !this.current ||\n !this.sortInstanceNodePosition ||\n this.type !== other.type\n ) {\n return 0\n }\n\n return this.sortInstanceNodePosition(\n this.current as Instance,\n other.current as Instance\n )\n }\n\n updateFeatures() {\n let key: keyof typeof featureDefinitions = \"animation\"\n\n for (key in featureDefinitions) {\n const featureDefinition = featureDefinitions[key]\n\n if (!featureDefinition) continue\n\n const { isEnabled, Feature: FeatureConstructor } = featureDefinition\n\n /**\n * If this feature is enabled but not active, make a new instance.\n */\n if (\n !this.features[key] &&\n FeatureConstructor &&\n isEnabled(this.props)\n ) {\n this.features[key] = new FeatureConstructor(this) as any\n }\n\n /**\n * If we have a feature, mount or update it.\n */\n if (this.features[key]) {\n const feature = this.features[key]!\n if (feature.isMounted) {\n feature.update()\n } else {\n feature.mount()\n feature.isMounted = true\n }\n }\n }\n }\n\n notifyUpdate = () => this.notify(\"Update\", this.latestValues)\n\n triggerBuild() {\n this.build(this.renderState, this.latestValues, this.props)\n }\n\n render = () => {\n if (!this.current) return\n this.triggerBuild()\n this.renderInstance(\n this.current,\n this.renderState,\n (this.props as any).style,\n this.projection\n )\n }\n\n private renderScheduledAt = 0.0\n scheduleRender = () => {\n const now = time.now()\n if (this.renderScheduledAt < now) {\n this.renderScheduledAt = now\n frame.render(this.render, false, true)\n }\n }\n\n /**\n * Measure the current viewport box with or without transforms.\n * Only measures axis-aligned boxes, rotate and skew must be manually\n * removed with a re-render to work.\n */\n measureViewportBox() {\n return this.current\n ? this.measureInstanceViewportBox(this.current, this.props)\n : createBox()\n }\n\n getStaticValue(key: string) {\n return this.latestValues[key]\n }\n\n setStaticValue(key: string, value: AnyResolvedKeyframe) {\n this.latestValues[key] = value\n }\n\n /**\n * Update the provided props. Ensure any newly-added motion values are\n * added to our map, old ones removed, and listeners updated.\n */\n update(\n props: MotionNodeOptions,\n presenceContext: PresenceContextProps | null\n ) {\n if (props.transformTemplate || this.props.transformTemplate) {\n this.scheduleRender()\n }\n\n this.prevProps = this.props\n this.props = props\n\n this.prevPresenceContext = this.presenceContext\n this.presenceContext = presenceContext\n\n /**\n * Update prop event handlers ie onAnimationStart, onAnimationComplete\n */\n for (let i = 0; i < propEventHandlers.length; i++) {\n const key = propEventHandlers[i]\n if (this.propEventSubscriptions[key]) {\n this.propEventSubscriptions[key]()\n delete this.propEventSubscriptions[key]\n }\n\n const listenerName = (\"on\" + key) as keyof typeof props\n const listener = props[listenerName]\n if (listener) {\n this.propEventSubscriptions[key] = this.on(key as any, listener)\n }\n }\n\n this.prevMotionValues = updateMotionValuesFromProps(\n this,\n this.scrapeMotionValuesFromProps(props, this.prevProps || {}, this),\n this.prevMotionValues\n )\n\n if (this.handleChildMotionValue) {\n this.handleChildMotionValue()\n }\n }\n\n getProps() {\n return this.props\n }\n\n /**\n * Returns the variant definition with a given name.\n */\n getVariant(name: string) {\n return this.props.variants ? this.props.variants[name] : undefined\n }\n\n /**\n * Returns the defined default transition on this component.\n */\n getDefaultTransition() {\n return this.props.transition\n }\n\n getTransformPagePoint() {\n return (this.props as any).transformPagePoint\n }\n\n getClosestVariantNode(): VisualElement | undefined {\n return this.isVariantNode\n ? this\n : this.parent\n ? this.parent.getClosestVariantNode()\n : undefined\n }\n\n /**\n * Add a child visual element to our set of children.\n */\n addVariantChild(child: VisualElement) {\n const closestVariantNode = this.getClosestVariantNode()\n if (closestVariantNode) {\n closestVariantNode.variantChildren &&\n closestVariantNode.variantChildren.add(child)\n return () => closestVariantNode.variantChildren!.delete(child)\n }\n }\n\n /**\n * Add a motion value and bind it to this visual element.\n */\n addValue(key: string, value: MotionValue) {\n // Remove existing value if it exists\n const existingValue = this.values.get(key)\n\n if (value !== existingValue) {\n if (existingValue) this.removeValue(key)\n this.bindToMotionValue(key, value)\n this.values.set(key, value)\n this.latestValues[key] = value.get()\n }\n }\n\n /**\n * Remove a motion value and unbind any active subscriptions.\n */\n removeValue(key: string) {\n this.values.delete(key)\n const unsubscribe = this.valueSubscriptions.get(key)\n if (unsubscribe) {\n unsubscribe()\n this.valueSubscriptions.delete(key)\n }\n delete this.latestValues[key]\n this.removeValueFromRenderState(key, this.renderState)\n }\n\n /**\n * Check whether we have a motion value for this key\n */\n hasValue(key: string) {\n return this.values.has(key)\n }\n\n /**\n * Get a motion value for this key. If called with a default\n * value, we'll create one if none exists.\n */\n getValue(key: string): MotionValue | undefined\n getValue(key: string, defaultValue: AnyResolvedKeyframe | null): MotionValue\n getValue(\n key: string,\n defaultValue?: AnyResolvedKeyframe | null\n ): MotionValue | undefined {\n if (this.props.values && this.props.values[key]) {\n return this.props.values[key]\n }\n\n let value = this.values.get(key)\n\n if (value === undefined && defaultValue !== undefined) {\n value = motionValue(\n defaultValue === null ? undefined : defaultValue,\n { owner: this }\n )\n this.addValue(key, value)\n }\n\n return value\n }\n\n /**\n * If we're trying to animate to a previously unencountered value,\n * we need to check for it in our state and as a last resort read it\n * directly from the instance (which might have performance implications).\n */\n readValue(key: string, target?: AnyResolvedKeyframe | null) {\n let value =\n this.latestValues[key] !== undefined || !this.current\n ? this.latestValues[key]\n : this.getBaseTargetFromProps(this.props, key) ??\n this.readValueFromInstance(this.current, key, this.options)\n\n if (value !== undefined && value !== null) {\n if (\n typeof value === \"string\" &&\n (isNumericalString(value) || isZeroValueString(value))\n ) {\n // If this is a number read as a string, ie \"0\" or \"200\", convert it to a number\n value = parseFloat(value)\n } else if (!findValueType(value) && complex.test(target)) {\n value = getAnimatableNone(key, target as string)\n }\n\n this.setBaseTarget(key, isMotionValue(value) ? value.get() : value)\n }\n\n return isMotionValue(value) ? value.get() : value\n }\n\n /**\n * Set the base target to later animate back to. This is currently\n * only hydrated on creation and when we first read a value.\n */\n setBaseTarget(key: string, value: AnyResolvedKeyframe) {\n this.baseTarget[key] = value\n }\n\n /**\n * Find the base target for a value thats been removed from all animation\n * props.\n */\n getBaseTarget(key: string): ResolvedValues[string] | undefined | null {\n const { initial } = this.props\n\n let valueFromInitial: ResolvedValues[string] | undefined | null\n\n if (typeof initial === \"string\" || typeof initial === \"object\") {\n const variant = resolveVariantFromProps(\n this.props,\n initial as any,\n this.presenceContext?.custom\n )\n if (variant) {\n valueFromInitial = variant[\n key as keyof typeof variant\n ] as string\n }\n }\n\n /**\n * If this value still exists in the current initial variant, read that.\n */\n if (initial && valueFromInitial !== undefined) {\n return valueFromInitial\n }\n\n /**\n * Alternatively, if this VisualElement config has defined a getBaseTarget\n * so we can read the value from an alternative source, try that.\n */\n const target = this.getBaseTargetFromProps(this.props, key)\n if (target !== undefined && !isMotionValue(target)) return target\n\n /**\n * If the value was initially defined on initial, but it doesn't any more,\n * return undefined. Otherwise return the value as initially read from the DOM.\n */\n return this.initialValues[key] !== undefined &&\n valueFromInitial === undefined\n ? undefined\n : this.baseTarget[key]\n }\n\n on(\n eventName: EventName,\n callback: VisualElementEventCallbacks[EventName]\n ) {\n if (!this.events[eventName]) {\n this.events[eventName] = new SubscriptionManager()\n }\n\n return this.events[eventName].add(callback)\n }\n\n notify(\n eventName: EventName,\n ...args: any\n ) {\n if (this.events[eventName]) {\n this.events[eventName].notify(...args)\n }\n }\n\n scheduleRenderMicrotask() {\n microtask.render(this.render)\n }\n}\n"],"names":["checkIsControllingVariants","checkIsVariantNode"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA+CA,MAAM,iBAAiB,GAAG;IACtB,gBAAgB;IAChB,mBAAmB;IACnB,QAAQ;IACR,qBAAqB;IACrB,eAAe;IACf,sBAAsB;IACtB,yBAAyB;CACnB;AAEV;;AAEG;AACH,IAAI,kBAAkB,GAAgC,EAAE;AAExD;;;AAGG;AACG,SAAU,qBAAqB,CACjC,WAAwC,EAAA;IAExC,kBAAkB,GAAG,WAAW;AACpC;AAEA;;AAEG;SACa,qBAAqB,GAAA;AACjC,IAAA,OAAO,kBAAkB;AAC7B;AASA;;;AAGG;MACmB,aAAa,CAAA;AA2F/B;;;;;;AAMG;AACH,IAAA,2BAA2B,CACvB,MAAyB,EACzB,UAA6B,EAC7B,cAA6B,EAAA;AAI7B,QAAA,OAAO,EAAE;IACb;AA4LA,IAAA,WAAA,C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YAAA,OAAO,gBAAgB;QAC3B;AAEA;;;AAGG;AACH,QAAA,MAAM,MAAM,GAAG,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,CAAC;QAC3D,IAAI,MAAM,KAAK,SAAS,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC;AAAE,YAAA,OAAO,MAAM;AAEjE;;;AAGG;AACH,QAAA,OAAO,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,KAAK,SAAS;AACxC,YAAA,gBAAgB,KAAK;AACrB,cAAE;AACF,cAAE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC;IAC9B;IAEA,EAAE,CACE,SAAoB,EACpB,QAAgD,EAAA;QAEhD,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE;YACzB,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,IAAI,mBAAmB,EAAE;QACtD;QAEA,OAAO,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC;IAC/C;AAEA,IAAA,MAAM,CACF,SAAoB,EACpB,GAAG,IAAS,EAAA;AAEZ,QAAA,IAAI,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE;YACxB,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;QAC1C;IACJ;IAEA,uBAAuB,GAAA;AACnB,QAAA,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;IACjC;AACH;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/dom/DOMVisualElement.mjs b/node_modules/motion-dom/dist/es/render/dom/DOMVisualElement.mjs deleted file mode 100644 index ee72b5e..0000000 --- a/node_modules/motion-dom/dist/es/render/dom/DOMVisualElement.mjs +++ /dev/null @@ -1,43 +0,0 @@ -import { isMotionValue } from '../../value/utils/is-motion-value.mjs'; -import { DOMKeyframesResolver } from '../../animation/keyframes/DOMKeyframesResolver.mjs'; -import { VisualElement } from '../VisualElement.mjs'; - -class DOMVisualElement extends VisualElement { - constructor() { - super(...arguments); - this.KeyframeResolver = DOMKeyframesResolver; - } - sortInstanceNodePosition(a, b) { - /** - * compareDocumentPosition returns a bitmask, by using the bitwise & - * we're returning true if 2 in that bitmask is set to true. 2 is set - * to true if b preceeds a. - */ - return a.compareDocumentPosition(b) & 2 ? 1 : -1; - } - getBaseTargetFromProps(props, key) { - const style = props.style; - return style ? style[key] : undefined; - } - removeValueFromRenderState(key, { vars, style }) { - delete vars[key]; - delete style[key]; - } - handleChildMotionValue() { - if (this.childSubscription) { - this.childSubscription(); - delete this.childSubscription; - } - const { children } = this.props; - if (isMotionValue(children)) { - this.childSubscription = children.on("change", (latest) => { - if (this.current) { - this.current.textContent = `${latest}`; - } - }); - } - } -} - -export { DOMVisualElement }; -//# sourceMappingURL=DOMVisualElement.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/dom/DOMVisualElement.mjs.map b/node_modules/motion-dom/dist/es/render/dom/DOMVisualElement.mjs.map deleted file mode 100644 index 99b2be9..0000000 --- a/node_modules/motion-dom/dist/es/render/dom/DOMVisualElement.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"DOMVisualElement.mjs","sources":["../../../../src/render/dom/DOMVisualElement.ts"],"sourcesContent":["import { isMotionValue } from \"../../value/utils/is-motion-value\"\nimport type { MotionValue } from \"../../value\"\nimport type { AnyResolvedKeyframe } from \"../../animation/types\"\nimport { DOMKeyframesResolver } from \"../../animation/keyframes/DOMKeyframesResolver\"\nimport type { MotionNodeOptions } from \"../../node/types\"\nimport type { DOMVisualElementOptions } from \"./types\"\nimport type { HTMLRenderState } from \"../html/types\"\nimport { VisualElement, MotionStyle } from \"../VisualElement\"\n\nexport abstract class DOMVisualElement<\n Instance extends HTMLElement | SVGElement = HTMLElement,\n State extends HTMLRenderState = HTMLRenderState,\n Options extends DOMVisualElementOptions = DOMVisualElementOptions\n> extends VisualElement {\n sortInstanceNodePosition(a: Instance, b: Instance): number {\n /**\n * compareDocumentPosition returns a bitmask, by using the bitwise &\n * we're returning true if 2 in that bitmask is set to true. 2 is set\n * to true if b preceeds a.\n */\n return a.compareDocumentPosition(b) & 2 ? 1 : -1\n }\n\n getBaseTargetFromProps(\n props: MotionNodeOptions,\n key: string\n ): AnyResolvedKeyframe | MotionValue | undefined {\n const style = (props as MotionNodeOptions & { style?: MotionStyle }).style\n return style ? (style[key] as string) : undefined\n }\n\n removeValueFromRenderState(\n key: string,\n { vars, style }: HTMLRenderState\n ): void {\n delete vars[key]\n delete style[key]\n }\n\n KeyframeResolver = DOMKeyframesResolver\n\n childSubscription?: VoidFunction\n handleChildMotionValue() {\n if (this.childSubscription) {\n this.childSubscription()\n delete this.childSubscription\n }\n\n const { children } = this.props as MotionNodeOptions & { children?: MotionValue | any }\n if (isMotionValue(children)) {\n this.childSubscription = children.on(\"change\", (latest) => {\n if (this.current) {\n this.current.textContent = `${latest}`\n }\n })\n }\n }\n}\n"],"names":[],"mappings":";;;;AASM,MAAgB,gBAIpB,SAAQ,aAAuC,CAAA;AAJjD,IAAA,WAAA,GAAA;;QA8BI,IAAA,CAAA,gBAAgB,GAAG,oBAAoB;IAkB3C;IA3CI,wBAAwB,CAAC,CAAW,EAAE,CAAW,EAAA;AAC7C;;;;AAIG;AACH,QAAA,OAAO,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE;IACpD;IAEA,sBAAsB,CAClB,KAAwB,EACxB,GAAW,EAAA;AAEX,QAAA,MAAM,KAAK,GAAI,KAAqD,CAAC,KAAK;AAC1E,QAAA,OAAO,KAAK,GAAI,KAAK,CAAC,GAAG,CAAY,GAAG,SAAS;IACrD;AAEA,IAAA,0BAA0B,CACtB,GAAW,EACX,EAAE,IAAI,EAAE,KAAK,EAAmB,EAAA;AAEhC,QAAA,OAAO,IAAI,CAAC,GAAG,CAAC;AAChB,QAAA,OAAO,KAAK,CAAC,GAAG,CAAC;IACrB;IAKA,sBAAsB,GAAA;AAClB,QAAA,IAAI,IAAI,CAAC,iBAAiB,EAAE;YACxB,IAAI,CAAC,iBAAiB,EAAE;YACxB,OAAO,IAAI,CAAC,iBAAiB;QACjC;AAEA,QAAA,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC,KAA6D;AACvF,QAAA,IAAI,aAAa,CAAC,QAAQ,CAAC,EAAE;AACzB,YAAA,IAAI,CAAC,iBAAiB,GAAG,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,MAAM,KAAI;AACtD,gBAAA,IAAI,IAAI,CAAC,OAAO,EAAE;oBACd,IAAI,CAAC,OAAO,CAAC,WAAW,GAAG,CAAA,EAAG,MAAM,EAAE;gBAC1C;AACJ,YAAA,CAAC,CAAC;QACN;IACJ;AACH;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/dom/is-css-var.mjs b/node_modules/motion-dom/dist/es/render/dom/is-css-var.mjs deleted file mode 100644 index 7ee34f4..0000000 --- a/node_modules/motion-dom/dist/es/render/dom/is-css-var.mjs +++ /dev/null @@ -1,4 +0,0 @@ -const isCSSVar = (name) => name.startsWith("--"); - -export { isCSSVar }; -//# sourceMappingURL=is-css-var.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/dom/is-css-var.mjs.map b/node_modules/motion-dom/dist/es/render/dom/is-css-var.mjs.map deleted file mode 100644 index 55eaadb..0000000 --- a/node_modules/motion-dom/dist/es/render/dom/is-css-var.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"is-css-var.mjs","sources":["../../../../src/render/dom/is-css-var.ts"],"sourcesContent":["export const isCSSVar = (name: string) => name.startsWith(\"--\")\n"],"names":[],"mappings":"AAAO,MAAM,QAAQ,GAAG,CAAC,IAAY,KAAK,IAAI,CAAC,UAAU,CAAC,IAAI;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/dom/parse-transform.mjs b/node_modules/motion-dom/dist/es/render/dom/parse-transform.mjs deleted file mode 100644 index 414bdf3..0000000 --- a/node_modules/motion-dom/dist/es/render/dom/parse-transform.mjs +++ /dev/null @@ -1,84 +0,0 @@ -const radToDeg = (rad) => (rad * 180) / Math.PI; -const rotate = (v) => { - const angle = radToDeg(Math.atan2(v[1], v[0])); - return rebaseAngle(angle); -}; -const matrix2dParsers = { - x: 4, - y: 5, - translateX: 4, - translateY: 5, - scaleX: 0, - scaleY: 3, - scale: (v) => (Math.abs(v[0]) + Math.abs(v[3])) / 2, - rotate, - rotateZ: rotate, - skewX: (v) => radToDeg(Math.atan(v[1])), - skewY: (v) => radToDeg(Math.atan(v[2])), - skew: (v) => (Math.abs(v[1]) + Math.abs(v[2])) / 2, -}; -const rebaseAngle = (angle) => { - angle = angle % 360; - if (angle < 0) - angle += 360; - return angle; -}; -const rotateZ = rotate; -const scaleX = (v) => Math.sqrt(v[0] * v[0] + v[1] * v[1]); -const scaleY = (v) => Math.sqrt(v[4] * v[4] + v[5] * v[5]); -const matrix3dParsers = { - x: 12, - y: 13, - z: 14, - translateX: 12, - translateY: 13, - translateZ: 14, - scaleX, - scaleY, - scale: (v) => (scaleX(v) + scaleY(v)) / 2, - rotateX: (v) => rebaseAngle(radToDeg(Math.atan2(v[6], v[5]))), - rotateY: (v) => rebaseAngle(radToDeg(Math.atan2(-v[2], v[0]))), - rotateZ, - rotate: rotateZ, - skewX: (v) => radToDeg(Math.atan(v[4])), - skewY: (v) => radToDeg(Math.atan(v[1])), - skew: (v) => (Math.abs(v[1]) + Math.abs(v[4])) / 2, -}; -function defaultTransformValue(name) { - return name.includes("scale") ? 1 : 0; -} -function parseValueFromTransform(transform, name) { - if (!transform || transform === "none") { - return defaultTransformValue(name); - } - const matrix3dMatch = transform.match(/^matrix3d\(([-\d.e\s,]+)\)$/u); - let parsers; - let match; - if (matrix3dMatch) { - parsers = matrix3dParsers; - match = matrix3dMatch; - } - else { - const matrix2dMatch = transform.match(/^matrix\(([-\d.e\s,]+)\)$/u); - parsers = matrix2dParsers; - match = matrix2dMatch; - } - if (!match) { - return defaultTransformValue(name); - } - const valueParser = parsers[name]; - const values = match[1].split(",").map(convertTransformToNumber); - return typeof valueParser === "function" - ? valueParser(values) - : values[valueParser]; -} -const readTransformValue = (instance, name) => { - const { transform = "none" } = getComputedStyle(instance); - return parseValueFromTransform(transform, name); -}; -function convertTransformToNumber(value) { - return parseFloat(value.trim()); -} - -export { defaultTransformValue, parseValueFromTransform, readTransformValue }; -//# sourceMappingURL=parse-transform.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/dom/parse-transform.mjs.map b/node_modules/motion-dom/dist/es/render/dom/parse-transform.mjs.map deleted file mode 100644 index 0a97a8c..0000000 --- a/node_modules/motion-dom/dist/es/render/dom/parse-transform.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"parse-transform.mjs","sources":["../../../../src/render/dom/parse-transform.ts"],"sourcesContent":["import { transformPropOrder } from \"../utils/keys-transform\"\n\nconst radToDeg = (rad: number) => (rad * 180) / Math.PI\n\ntype MatrixParser = (values: number[]) => number\n\ntype MatrixParsers = Record<\n (typeof transformPropOrder)[number],\n number | MatrixParser\n>\n\nconst rotate = (v: number[]) => {\n const angle = radToDeg(Math.atan2(v[1], v[0]))\n return rebaseAngle(angle)\n}\n\nconst matrix2dParsers: MatrixParsers = {\n x: 4,\n y: 5,\n translateX: 4,\n translateY: 5,\n scaleX: 0,\n scaleY: 3,\n scale: (v) => (Math.abs(v[0]) + Math.abs(v[3])) / 2,\n rotate,\n rotateZ: rotate,\n skewX: (v) => radToDeg(Math.atan(v[1])),\n skewY: (v) => radToDeg(Math.atan(v[2])),\n skew: (v) => (Math.abs(v[1]) + Math.abs(v[2])) / 2,\n} as const\n\nconst rebaseAngle = (angle: number) => {\n angle = angle % 360\n if (angle < 0) angle += 360\n return angle\n}\n\nconst rotateZ = rotate\n\nconst scaleX = (v: number[]) => Math.sqrt(v[0] * v[0] + v[1] * v[1])\nconst scaleY = (v: number[]) => Math.sqrt(v[4] * v[4] + v[5] * v[5])\n\nconst matrix3dParsers: MatrixParsers = {\n x: 12,\n y: 13,\n z: 14,\n translateX: 12,\n translateY: 13,\n translateZ: 14,\n scaleX,\n scaleY,\n scale: (v) => (scaleX(v) + scaleY(v)) / 2,\n rotateX: (v) => rebaseAngle(radToDeg(Math.atan2(v[6], v[5]))),\n rotateY: (v) => rebaseAngle(radToDeg(Math.atan2(-v[2], v[0]))),\n rotateZ,\n rotate: rotateZ,\n skewX: (v) => radToDeg(Math.atan(v[4])),\n skewY: (v) => radToDeg(Math.atan(v[1])),\n skew: (v) => (Math.abs(v[1]) + Math.abs(v[4])) / 2,\n} as const\n\nexport function defaultTransformValue(name: string): number {\n return name.includes(\"scale\") ? 1 : 0\n}\n\nexport function parseValueFromTransform(\n transform: string | undefined,\n name: string\n): number {\n if (!transform || transform === \"none\") {\n return defaultTransformValue(name)\n }\n\n const matrix3dMatch = transform.match(/^matrix3d\\(([-\\d.e\\s,]+)\\)$/u)\n\n let parsers: MatrixParsers\n let match: RegExpMatchArray | null\n\n if (matrix3dMatch) {\n parsers = matrix3dParsers\n match = matrix3dMatch\n } else {\n const matrix2dMatch = transform.match(/^matrix\\(([-\\d.e\\s,]+)\\)$/u)\n\n parsers = matrix2dParsers\n match = matrix2dMatch\n }\n\n if (!match) {\n return defaultTransformValue(name)\n }\n\n const valueParser = parsers[name]\n const values = match[1].split(\",\").map(convertTransformToNumber)\n\n return typeof valueParser === \"function\"\n ? valueParser(values)\n : values[valueParser]\n}\n\nexport const readTransformValue = (instance: HTMLElement, name: string) => {\n const { transform = \"none\" } = getComputedStyle(instance)\n return parseValueFromTransform(transform, name)\n}\n\nfunction convertTransformToNumber(value: string): number {\n return parseFloat(value.trim())\n}\n"],"names":[],"mappings":"AAEA,MAAM,QAAQ,GAAG,CAAC,GAAW,KAAK,CAAC,GAAG,GAAG,GAAG,IAAI,IAAI,CAAC,EAAE;AASvD,MAAM,MAAM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AEa,kBAAkB,GAAG,CAAC,QAAqB,EAAE,IAAY,KAAI;IACtE,MAAM,EAAE,SAAS,GAAG,MAAM,EAAE,GAAG,gBAAgB,CAAC,QAAQ,CAAC;AACzD,IAAA,OAAO,uBAAuB,CAAC,SAAS,EAAE,IAAI,CAAC;AACnD;AAEA,SAAS,wBAAwB,CAAC,KAAa,EAAA;AAC3C,IAAA,OAAO,UAAU,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;AACnC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/dom/style-computed.mjs b/node_modules/motion-dom/dist/es/render/dom/style-computed.mjs deleted file mode 100644 index 73002fb..0000000 --- a/node_modules/motion-dom/dist/es/render/dom/style-computed.mjs +++ /dev/null @@ -1,11 +0,0 @@ -import { isCSSVar } from './is-css-var.mjs'; - -function getComputedStyle(element, name) { - const computedStyle = window.getComputedStyle(element); - return isCSSVar(name) - ? computedStyle.getPropertyValue(name) - : computedStyle[name]; -} - -export { getComputedStyle }; -//# sourceMappingURL=style-computed.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/dom/style-computed.mjs.map b/node_modules/motion-dom/dist/es/render/dom/style-computed.mjs.map deleted file mode 100644 index 4a930db..0000000 --- a/node_modules/motion-dom/dist/es/render/dom/style-computed.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"style-computed.mjs","sources":["../../../../src/render/dom/style-computed.ts"],"sourcesContent":["import { isCSSVar } from \"./is-css-var\"\n\nexport function getComputedStyle(\n element: HTMLElement | SVGElement,\n name: string\n) {\n const computedStyle = window.getComputedStyle(element)\n return isCSSVar(name)\n ? computedStyle.getPropertyValue(name)\n : computedStyle[name as any]\n}\n"],"names":[],"mappings":";;AAEM,SAAU,gBAAgB,CAC5B,OAAiC,EACjC,IAAY,EAAA;IAEZ,MAAM,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC,OAAO,CAAC;IACtD,OAAO,QAAQ,CAAC,IAAI;AAChB,UAAE,aAAa,CAAC,gBAAgB,CAAC,IAAI;AACrC,UAAE,aAAa,CAAC,IAAW,CAAC;AACpC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/dom/style-set.mjs b/node_modules/motion-dom/dist/es/render/dom/style-set.mjs deleted file mode 100644 index e4389cc..0000000 --- a/node_modules/motion-dom/dist/es/render/dom/style-set.mjs +++ /dev/null @@ -1,10 +0,0 @@ -import { isCSSVar } from './is-css-var.mjs'; - -function setStyle(element, name, value) { - isCSSVar(name) - ? element.style.setProperty(name, value) - : (element.style[name] = value); -} - -export { setStyle }; -//# sourceMappingURL=style-set.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/dom/style-set.mjs.map b/node_modules/motion-dom/dist/es/render/dom/style-set.mjs.map deleted file mode 100644 index 68ee566..0000000 --- a/node_modules/motion-dom/dist/es/render/dom/style-set.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"style-set.mjs","sources":["../../../../src/render/dom/style-set.ts"],"sourcesContent":["import { AnyResolvedKeyframe } from \"../../animation/types\"\nimport { isCSSVar } from \"./is-css-var\"\n\nexport function setStyle(\n element: HTMLElement | SVGElement,\n name: string,\n value: AnyResolvedKeyframe\n) {\n isCSSVar(name)\n ? element.style.setProperty(name, value as string)\n : (element.style[name as any] = value as string)\n}\n"],"names":[],"mappings":";;SAGgB,QAAQ,CACpB,OAAiC,EACjC,IAAY,EACZ,KAA0B,EAAA;IAE1B,QAAQ,CAAC,IAAI;UACP,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,EAAE,KAAe;WAC9C,OAAO,CAAC,KAAK,CAAC,IAAW,CAAC,GAAG,KAAe,CAAC;AACxD;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/dom/utils/camel-to-dash.mjs b/node_modules/motion-dom/dist/es/render/dom/utils/camel-to-dash.mjs deleted file mode 100644 index aa8caef..0000000 --- a/node_modules/motion-dom/dist/es/render/dom/utils/camel-to-dash.mjs +++ /dev/null @@ -1,6 +0,0 @@ -function camelToDash(str) { - return str.replace(/([A-Z])/g, (match) => `-${match.toLowerCase()}`); -} - -export { camelToDash }; -//# sourceMappingURL=camel-to-dash.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/dom/utils/camel-to-dash.mjs.map b/node_modules/motion-dom/dist/es/render/dom/utils/camel-to-dash.mjs.map deleted file mode 100644 index 6942af2..0000000 --- a/node_modules/motion-dom/dist/es/render/dom/utils/camel-to-dash.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"camel-to-dash.mjs","sources":["../../../../../src/render/dom/utils/camel-to-dash.ts"],"sourcesContent":["export function camelToDash(str: string): string {\n return str.replace(/([A-Z])/g, (match) => `-${match.toLowerCase()}`)\n}\n"],"names":[],"mappings":"AAAM,SAAU,WAAW,CAAC,GAAW,EAAA;AACnC,IAAA,OAAO,GAAG,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC,KAAK,KAAK,IAAI,KAAK,CAAC,WAAW,EAAE,CAAA,CAAE,CAAC;AACxE;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/html/HTMLVisualElement.mjs b/node_modules/motion-dom/dist/es/render/html/HTMLVisualElement.mjs deleted file mode 100644 index 80604c6..0000000 --- a/node_modules/motion-dom/dist/es/render/html/HTMLVisualElement.mjs +++ /dev/null @@ -1,55 +0,0 @@ -import { invariant } from 'motion-utils'; -import { isCSSVariableName } from '../../animation/utils/is-css-variable.mjs'; -import { transformProps } from '../utils/keys-transform.mjs'; -import { defaultTransformValue, readTransformValue } from '../dom/parse-transform.mjs'; -import { measureViewportBox } from '../../projection/utils/measure.mjs'; -import { DOMVisualElement } from '../dom/DOMVisualElement.mjs'; -import { buildHTMLStyles } from './utils/build-styles.mjs'; -import { renderHTML } from './utils/render.mjs'; -import { scrapeMotionValuesFromProps } from './utils/scrape-motion-values.mjs'; - -function getComputedStyle(element) { - return window.getComputedStyle(element); -} -class HTMLVisualElement extends DOMVisualElement { - constructor() { - super(...arguments); - this.type = "html"; - this.renderInstance = renderHTML; - } - mount(instance) { - /** - * If a custom component forwards its ref to something other than a - * HTML/SVG element (a class instance, an imperative handle) there's - * nothing for Motion to style, measure or attach gestures to. #2777 - */ - invariant(Boolean(instance.style), "motion.create() components must forward their ref to a HTML or SVG element", "custom-component-ref"); - super.mount(instance); - } - readValueFromInstance(instance, key) { - if (transformProps.has(key)) { - return this.projection?.isProjecting - ? defaultTransformValue(key) - : readTransformValue(instance, key); - } - else { - const computedStyle = getComputedStyle(instance); - const value = (isCSSVariableName(key) - ? computedStyle.getPropertyValue(key) - : computedStyle[key]) || 0; - return typeof value === "string" ? value.trim() : value; - } - } - measureInstanceViewportBox(instance, { transformPagePoint }) { - return measureViewportBox(instance, transformPagePoint); - } - build(renderState, latestValues, props) { - buildHTMLStyles(renderState, latestValues, props.transformTemplate); - } - scrapeMotionValuesFromProps(props, prevProps, visualElement) { - return scrapeMotionValuesFromProps(props, prevProps, visualElement); - } -} - -export { HTMLVisualElement, getComputedStyle }; -//# sourceMappingURL=HTMLVisualElement.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/html/HTMLVisualElement.mjs.map b/node_modules/motion-dom/dist/es/render/html/HTMLVisualElement.mjs.map deleted file mode 100644 index 05755b5..0000000 --- a/node_modules/motion-dom/dist/es/render/html/HTMLVisualElement.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"HTMLVisualElement.mjs","sources":["../../../../src/render/html/HTMLVisualElement.ts"],"sourcesContent":["import { invariant, type Box } from \"motion-utils\"\nimport type { AnyResolvedKeyframe } from \"../../animation/types\"\nimport { isCSSVariableName } from \"../../animation/utils/is-css-variable\"\nimport type { MotionNodeOptions } from \"../../node/types\"\nimport { transformProps } from \"../utils/keys-transform\"\nimport {\n defaultTransformValue,\n readTransformValue,\n} from \"../dom/parse-transform\"\nimport { measureViewportBox } from \"../../projection/utils/measure\"\nimport { DOMVisualElement } from \"../dom/DOMVisualElement\"\nimport type { DOMVisualElementOptions } from \"../dom/types\"\nimport type { ResolvedValues, MotionConfigContextProps } from \"../types\"\nimport type { VisualElement } from \"../VisualElement\"\nimport { HTMLRenderState } from \"./types\"\nimport { buildHTMLStyles } from \"./utils/build-styles\"\nimport { renderHTML } from \"./utils/render\"\nimport { scrapeMotionValuesFromProps } from \"./utils/scrape-motion-values\"\n\nexport function getComputedStyle(element: HTMLElement) {\n return window.getComputedStyle(element)\n}\n\nexport class HTMLVisualElement extends DOMVisualElement<\n HTMLElement,\n HTMLRenderState,\n DOMVisualElementOptions\n> {\n type = \"html\"\n\n mount(instance: HTMLElement) {\n /**\n * If a custom component forwards its ref to something other than a\n * HTML/SVG element (a class instance, an imperative handle) there's\n * nothing for Motion to style, measure or attach gestures to. #2777\n */\n invariant(\n Boolean(instance.style),\n \"motion.create() components must forward their ref to a HTML or SVG element\",\n \"custom-component-ref\"\n )\n\n super.mount(instance)\n }\n\n readValueFromInstance(\n instance: HTMLElement,\n key: string\n ): AnyResolvedKeyframe | null | undefined {\n if (transformProps.has(key)) {\n return this.projection?.isProjecting\n ? defaultTransformValue(key)\n : readTransformValue(instance, key)\n } else {\n const computedStyle = getComputedStyle(instance)\n const value =\n (isCSSVariableName(key)\n ? computedStyle.getPropertyValue(key)\n : computedStyle[key as keyof typeof computedStyle]) || 0\n\n return typeof value === \"string\" ? value.trim() : (value as number)\n }\n }\n\n measureInstanceViewportBox(\n instance: HTMLElement,\n { transformPagePoint }: MotionNodeOptions & Partial\n ): Box {\n return measureViewportBox(instance, transformPagePoint)\n }\n\n build(\n renderState: HTMLRenderState,\n latestValues: ResolvedValues,\n props: MotionNodeOptions\n ) {\n buildHTMLStyles(renderState, latestValues, props.transformTemplate)\n }\n\n scrapeMotionValuesFromProps(\n props: MotionNodeOptions,\n prevProps: MotionNodeOptions,\n visualElement: VisualElement\n ) {\n return scrapeMotionValuesFromProps(props, prevProps, visualElement)\n }\n\n renderInstance = renderHTML\n}\n"],"names":[],"mappings":";;;;;;;;;;AAmBM,SAAU,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AE,KAAK,CAAC,iBAAiB,CAAC;IACvE;AAEA,IAAA,2BAA2B,CACvB,KAAwB,EACxB,SAA4B,EAC5B,aAA4B,EAAA;QAE5B,OAAO,2BAA2B,CAAC,KAAK,EAAE,SAAS,EAAE,aAAa,CAAC;IACvE;AAGH;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/html/utils/build-styles.mjs b/node_modules/motion-dom/dist/es/render/html/utils/build-styles.mjs deleted file mode 100644 index bd068f2..0000000 --- a/node_modules/motion-dom/dist/es/render/html/utils/build-styles.mjs +++ /dev/null @@ -1,66 +0,0 @@ -import { getValueAsType } from '../../../value/types/utils/get-as-type.mjs'; -import { numberValueTypes } from '../../../value/types/maps/number.mjs'; -import { transformProps } from '../../utils/keys-transform.mjs'; -import { isCSSVariableName } from '../../../animation/utils/is-css-variable.mjs'; -import { buildTransform } from './build-transform.mjs'; - -function buildHTMLStyles(state, latestValues, transformTemplate) { - const { style, vars, transformOrigin } = state; - // Track whether we encounter any transform or transformOrigin values. - let hasTransform = false; - let hasTransformOrigin = false; - /** - * Loop over all our latest animated values and decide whether to handle them - * as a style or CSS variable. - * - * Transforms and transform origins are kept separately for further processing. - */ - for (const key in latestValues) { - const value = latestValues[key]; - if (transformProps.has(key)) { - // If this is a transform, flag to enable further transform processing - hasTransform = true; - continue; - } - else if (isCSSVariableName(key)) { - vars[key] = value; - continue; - } - else { - // Convert the value to its default value type, ie 0 -> "0px" - const valueAsType = getValueAsType(value, numberValueTypes[key]); - if (key.startsWith("origin")) { - // If this is a transform origin, flag and enable further transform-origin processing - hasTransformOrigin = true; - transformOrigin[key] = - valueAsType; - } - else { - style[key] = valueAsType; - } - } - } - if (!latestValues.transform) { - if (hasTransform || transformTemplate) { - style.transform = buildTransform(latestValues, state.transform, transformTemplate); - } - else if (style.transform) { - /** - * If we have previously created a transform but currently don't have any, - * reset transform style to none. - */ - style.transform = "none"; - } - } - /** - * Build a transformOrigin style. Uses the same defaults as the browser for - * undefined origins. - */ - if (hasTransformOrigin) { - const { originX = "50%", originY = "50%", originZ = 0, } = transformOrigin; - style.transformOrigin = `${originX} ${originY} ${originZ}`; - } -} - -export { buildHTMLStyles }; -//# sourceMappingURL=build-styles.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/html/utils/build-styles.mjs.map b/node_modules/motion-dom/dist/es/render/html/utils/build-styles.mjs.map deleted file mode 100644 index cb0f620..0000000 --- a/node_modules/motion-dom/dist/es/render/html/utils/build-styles.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"build-styles.mjs","sources":["../../../../../src/render/html/utils/build-styles.ts"],"sourcesContent":["import { getValueAsType } from \"../../../value/types/utils/get-as-type\"\nimport { numberValueTypes } from \"../../../value/types/maps/number\"\nimport { transformProps } from \"../../utils/keys-transform\"\nimport { isCSSVariableName } from \"../../../animation/utils/is-css-variable\"\nimport { ResolvedValues } from \"../../types\"\nimport { HTMLRenderState } from \"../types\"\nimport { buildTransform } from \"./build-transform\"\nimport type { MotionNodeOptions } from \"../../../node/types\"\n\nexport function buildHTMLStyles(\n state: HTMLRenderState,\n latestValues: ResolvedValues,\n transformTemplate?: MotionNodeOptions[\"transformTemplate\"]\n) {\n const { style, vars, transformOrigin } = state\n\n // Track whether we encounter any transform or transformOrigin values.\n let hasTransform = false\n let hasTransformOrigin = false\n\n /**\n * Loop over all our latest animated values and decide whether to handle them\n * as a style or CSS variable.\n *\n * Transforms and transform origins are kept separately for further processing.\n */\n for (const key in latestValues) {\n const value = latestValues[key]\n\n if (transformProps.has(key)) {\n // If this is a transform, flag to enable further transform processing\n hasTransform = true\n continue\n } else if (isCSSVariableName(key)) {\n vars[key] = value\n continue\n } else {\n // Convert the value to its default value type, ie 0 -> \"0px\"\n const valueAsType = getValueAsType(value, numberValueTypes[key])\n\n if (key.startsWith(\"origin\")) {\n // If this is a transform origin, flag and enable further transform-origin processing\n hasTransformOrigin = true\n transformOrigin[key as keyof typeof transformOrigin] =\n valueAsType\n } else {\n style[key] = valueAsType\n }\n }\n }\n\n if (!latestValues.transform) {\n if (hasTransform || transformTemplate) {\n style.transform = buildTransform(\n latestValues,\n state.transform,\n transformTemplate\n )\n } else if (style.transform) {\n /**\n * If we have previously created a transform but currently don't have any,\n * reset transform style to none.\n */\n style.transform = \"none\"\n }\n }\n\n /**\n * Build a transformOrigin style. Uses the same defaults as the browser for\n * undefined origins.\n */\n if (hasTransformOrigin) {\n const {\n originX = \"50%\",\n originY = \"50%\",\n originZ = 0,\n } = transformOrigin\n style.transformOrigin = `${originX} ${originY} ${originZ}`\n }\n}\n"],"names":[],"mappings":";;;;;;SASgB,eAAe,CAC3B,KAAsB,EACtB,YAA4B,EAC5B,iBAA0D,EAAA;IAE1D,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,eAAe,EAAE,GAAG,KAAK;;IAG9C,IAAI,YAAY,GAAG,KAAK;IACxB,IAAI,kBAAkB,GAAG,KAAK;AAE9B;;;;;AAKG;AACH,IAAA,KAAK,MAAM,GAAG,IAAI,YAAY,EAAE;AAC5B,QAAA,MAAM,KAAK,GAAG,YAAY,CAAC,GAAG,CAAC;AAE/B,QAAA,IAAI,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;;YAEzB,YAAY,GAAG,IAAI;YACnB;QACJ;AAAO,aAAA,IAAI,iBAAiB,CAAC,GAAG,CAAC,EAAE;AAC/B,YAAA,IAAI,CAAC,GAAG,CAAC,GAAG,KAAK;YACjB;QACJ;aAAO;;YAEH,MAAM,WAAW,GAAG,cAAc,CAAC,KAAK,EAAE,gBAAgB,CAAC,GAAG,CAAC,CAAC;AAEhE,YAAA,IAAI,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE;;gBAE1B,kBAAkB,GAAG,IAAI;gBACzB,eAAe,CAAC,GAAmC,CAAC;AAChD,oBAAA,WAAW;YACnB;iBAAO;AACH,gBAAA,KAAK,CAAC,GAAG,CAAC,GAAG,WAAW;YAC5B;QACJ;IACJ;AAEA,IAAA,IAAI,CAAC,YAAY,CAAC,SAAS,EAAE;AACzB,QAAA,IAAI,YAAY,IAAI,iBAAiB,EAAE;AACnC,YAAA,KAAK,CAAC,SAAS,GAAG,cAAc,CAC5B,YAAY,EACZ,KAAK,CAAC,SAAS,EACf,iBAAiB,CACpB;QACL;AAAO,aAAA,IAAI,KAAK,CAAC,SAAS,EAAE;AACxB;;;AAGG;AACH,YAAA,KAAK,CAAC,SAAS,GAAG,MAAM;QAC5B;IACJ;AAEA;;;AAGG;IACH,IAAI,kBAAkB,EAAE;AACpB,QAAA,MAAM,EACF,OAAO,GAAG,KAAK,EACf,OAAO,GAAG,KAAK,EACf,OAAO,GAAG,CAAC,GACd,GAAG,eAAe;QACnB,KAAK,CAAC,eAAe,GAAG,CAAA,EAAG,OAAO,IAAI,OAAO,CAAA,CAAA,EAAI,OAAO,CAAA,CAAE;IAC9D;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/html/utils/build-transform.mjs b/node_modules/motion-dom/dist/es/render/html/utils/build-transform.mjs deleted file mode 100644 index 30f8a57..0000000 --- a/node_modules/motion-dom/dist/es/render/html/utils/build-transform.mjs +++ /dev/null @@ -1,72 +0,0 @@ -import { getValueAsType } from '../../../value/types/utils/get-as-type.mjs'; -import { numberValueTypes } from '../../../value/types/maps/number.mjs'; -import { transformPropOrder } from '../../utils/keys-transform.mjs'; - -const translateAlias = { - x: "translateX", - y: "translateY", - z: "translateZ", - transformPerspective: "perspective", -}; -const numTransforms = transformPropOrder.length; -/** - * Build a CSS transform style from individual x/y/scale etc properties. - * - * This outputs with a default order of transforms/scales/rotations, this can be customised by - * providing a transformTemplate function. - */ -function buildTransform(latestValues, transform, transformTemplate) { - // The transform string we're going to build into. - let transformString = ""; - let transformIsDefault = true; - /** - * Loop over all possible transforms in order, adding the ones that - * are present to the transform string. - */ - for (let i = 0; i < numTransforms; i++) { - const key = transformPropOrder[i]; - const value = latestValues[key]; - if (value === undefined) - continue; - let valueIsDefault = true; - if (typeof value === "number") { - valueIsDefault = value === (key.startsWith("scale") ? 1 : 0); - } - else { - const parsed = parseFloat(value); - valueIsDefault = key.startsWith("scale") ? parsed === 1 : parsed === 0; - } - if (!valueIsDefault || transformTemplate) { - const valueAsType = getValueAsType(value, numberValueTypes[key]); - if (!valueIsDefault) { - transformIsDefault = false; - const transformName = translateAlias[key] || key; - transformString += `${transformName}(${valueAsType}) `; - } - if (transformTemplate) { - transform[key] = valueAsType; - } - } - } - // `pathRotation` composes onto `rotate` as a separate additive term so - // the user's `rotate` is never clobbered. Deliberately not a slot in - // `transformPropOrder`. - const pathRotation = latestValues.pathRotation; - if (pathRotation) { - transformIsDefault = false; - transformString += `rotate(${getValueAsType(pathRotation, numberValueTypes.pathRotation)}) `; - } - transformString = transformString.trim(); - // If we have a custom `transform` template, pass our transform values and - // generated transformString to that before returning - if (transformTemplate) { - transformString = transformTemplate(transform, transformIsDefault ? "" : transformString); - } - else if (transformIsDefault) { - transformString = "none"; - } - return transformString; -} - -export { buildTransform }; -//# sourceMappingURL=build-transform.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/html/utils/build-transform.mjs.map b/node_modules/motion-dom/dist/es/render/html/utils/build-transform.mjs.map deleted file mode 100644 index fe879d2..0000000 --- a/node_modules/motion-dom/dist/es/render/html/utils/build-transform.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"build-transform.mjs","sources":["../../../../../src/render/html/utils/build-transform.ts"],"sourcesContent":["import { getValueAsType } from \"../../../value/types/utils/get-as-type\"\nimport { numberValueTypes } from \"../../../value/types/maps/number\"\nimport { transformPropOrder } from \"../../utils/keys-transform\"\nimport { ResolvedValues } from \"../../types\"\nimport { HTMLRenderState } from \"../types\"\nimport type { MotionNodeOptions } from \"../../../node/types\"\n\nconst translateAlias = {\n x: \"translateX\",\n y: \"translateY\",\n z: \"translateZ\",\n transformPerspective: \"perspective\",\n}\n\nconst numTransforms = transformPropOrder.length\n\n/**\n * Build a CSS transform style from individual x/y/scale etc properties.\n *\n * This outputs with a default order of transforms/scales/rotations, this can be customised by\n * providing a transformTemplate function.\n */\nexport function buildTransform(\n latestValues: ResolvedValues,\n transform: HTMLRenderState[\"transform\"],\n transformTemplate?: MotionNodeOptions[\"transformTemplate\"]\n) {\n // The transform string we're going to build into.\n let transformString = \"\"\n let transformIsDefault = true\n\n /**\n * Loop over all possible transforms in order, adding the ones that\n * are present to the transform string.\n */\n for (let i = 0; i < numTransforms; i++) {\n const key = transformPropOrder[i] as keyof typeof translateAlias\n const value = latestValues[key]\n\n if (value === undefined) continue\n\n let valueIsDefault = true\n if (typeof value === \"number\") {\n valueIsDefault = value === (key.startsWith(\"scale\") ? 1 : 0)\n } else {\n const parsed = parseFloat(value)\n valueIsDefault = key.startsWith(\"scale\") ? parsed === 1 : parsed === 0\n }\n\n if (!valueIsDefault || transformTemplate) {\n const valueAsType = getValueAsType(value, numberValueTypes[key])\n\n if (!valueIsDefault) {\n transformIsDefault = false\n const transformName = translateAlias[key] || key\n transformString += `${transformName}(${valueAsType}) `\n }\n\n if (transformTemplate) {\n transform[key] = valueAsType\n }\n }\n }\n\n // `pathRotation` composes onto `rotate` as a separate additive term so\n // the user's `rotate` is never clobbered. Deliberately not a slot in\n // `transformPropOrder`.\n const pathRotation = latestValues.pathRotation\n if (pathRotation) {\n transformIsDefault = false\n transformString += `rotate(${getValueAsType(\n pathRotation,\n numberValueTypes.pathRotation\n )}) `\n }\n\n transformString = transformString.trim()\n\n // If we have a custom `transform` template, pass our transform values and\n // generated transformString to that before returning\n if (transformTemplate) {\n transformString = transformTemplate(\n transform,\n transformIsDefault ? \"\" : transformString\n )\n } else if (transformIsDefault) {\n transformString = \"none\"\n }\n\n return transformString\n}\n"],"names":[],"mappings":";;;;AAOA,MAAM,cAAc,GAAG;AACnB,IAAA,CAAC,EAAE,YAAY;AACf,IAAA,CAAC,EAAE,YAAY;AACf,IAAA,CAAC,EAAE,YAAY;AACf,IAAA,oBAAoB,EAAE,aAAa;CACtC;AAED,MAAM,a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AA,MAAM,YAAY,GAAG,YAAY,CAAC,YAAY;IAC9C,IAAI,YAAY,EAAE;QACd,kBAAkB,GAAG,KAAK;QAC1B,eAAe,IAAI,CAAA,OAAA,EAAU,cAAc,CACvC,YAAY,EACZ,gBAAgB,CAAC,YAAY,CAChC,CAAA,EAAA,CAAI;IACT;AAEA,IAAA,eAAe,GAAG,eAAe,CAAC,IAAI,EAAE;;;IAIxC,IAAI,iBAAiB,EAAE;AACnB,QAAA,eAAe,GAAG,iBAAiB,CAC/B,SAAS,EACT,kBAAkB,GAAG,EAAE,GAAG,eAAe,CAC5C;IACL;SAAO,IAAI,kBAAkB,EAAE;QAC3B,eAAe,GAAG,MAAM;IAC5B;AAEA,IAAA,OAAO,eAAe;AAC1B;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/html/utils/render.mjs b/node_modules/motion-dom/dist/es/render/html/utils/render.mjs deleted file mode 100644 index d5e5241..0000000 --- a/node_modules/motion-dom/dist/es/render/html/utils/render.mjs +++ /dev/null @@ -1,18 +0,0 @@ -function renderHTML(element, { style, vars }, styleProp, projection) { - const elementStyle = element.style; - let key; - for (key in style) { - // CSSStyleDeclaration has [index: number]: string; in the types, so we use that as key type. - elementStyle[key] = style[key]; - } - // Write projection styles directly to element style - projection?.applyProjectionStyles(elementStyle, styleProp); - for (key in vars) { - // Loop over any CSS variables and assign those. - // They can only be assigned using `setProperty`. - elementStyle.setProperty(key, vars[key]); - } -} - -export { renderHTML }; -//# sourceMappingURL=render.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/html/utils/render.mjs.map b/node_modules/motion-dom/dist/es/render/html/utils/render.mjs.map deleted file mode 100644 index c825249..0000000 --- a/node_modules/motion-dom/dist/es/render/html/utils/render.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"render.mjs","sources":["../../../../../src/render/html/utils/render.ts"],"sourcesContent":["import type { MotionStyle } from \"../../VisualElement\"\nimport { HTMLRenderState } from \"../types\"\n\nexport function renderHTML(\n element: HTMLElement,\n { style, vars }: HTMLRenderState,\n styleProp?: MotionStyle,\n projection?: any\n) {\n const elementStyle = element.style\n\n let key: string\n for (key in style) {\n // CSSStyleDeclaration has [index: number]: string; in the types, so we use that as key type.\n elementStyle[key as unknown as number] = style[key] as string\n }\n\n // Write projection styles directly to element style\n projection?.applyProjectionStyles(elementStyle, styleProp)\n\n for (key in vars) {\n // Loop over any CSS variables and assign those.\n // They can only be assigned using `setProperty`.\n elementStyle.setProperty(key, vars[key] as string)\n }\n}\n"],"names":[],"mappings":"AAGM,SAAU,UAAU,CACtB,OAAoB,EACpB,EAAE,KAAK,EAAE,IAAI,EAAmB,EAChC,SAAuB,EACvB,UAAgB,EAAA;AAEhB,IAAA,MAAM,YAAY,GAAG,OAAO,CAAC,KAAK;AAElC,IAAA,IAAI,GAAW;AACf,IAAA,KAAK,GAAG,IAAI,KAAK,EAAE;;QAEf,YAAY,CAAC,GAAwB,CAAC,GAAG,KAAK,CAAC,GAAG,CAAW;IACjE;;AAGA,IAAA,UAAU,EAAE,qBAAqB,CAAC,YAAY,EAAE,SAAS,CAAC;AAE1D,IAAA,KAAK,GAAG,IAAI,IAAI,EAAE;;;QAGd,YAAY,CAAC,WAAW,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAW,CAAC;IACtD;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/html/utils/scrape-motion-values.mjs b/node_modules/motion-dom/dist/es/render/html/utils/scrape-motion-values.mjs deleted file mode 100644 index fa40038..0000000 --- a/node_modules/motion-dom/dist/es/render/html/utils/scrape-motion-values.mjs +++ /dev/null @@ -1,22 +0,0 @@ -import { isMotionValue } from '../../../value/utils/is-motion-value.mjs'; -import { isForcedMotionValue } from '../../utils/is-forced-motion-value.mjs'; - -function scrapeMotionValuesFromProps(props, prevProps, visualElement) { - const style = props.style; - const prevStyle = prevProps?.style; - const newValues = {}; - if (!style) - return newValues; - for (const key in style) { - if (isMotionValue(style[key]) || - (prevStyle && isMotionValue(prevStyle[key])) || - isForcedMotionValue(key, props) || - visualElement?.getValue(key)?.liveStyle !== undefined) { - newValues[key] = style[key]; - } - } - return newValues; -} - -export { scrapeMotionValuesFromProps }; -//# sourceMappingURL=scrape-motion-values.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/html/utils/scrape-motion-values.mjs.map b/node_modules/motion-dom/dist/es/render/html/utils/scrape-motion-values.mjs.map deleted file mode 100644 index e8a85c5..0000000 --- a/node_modules/motion-dom/dist/es/render/html/utils/scrape-motion-values.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"scrape-motion-values.mjs","sources":["../../../../../src/render/html/utils/scrape-motion-values.ts"],"sourcesContent":["import { isMotionValue } from \"../../../value/utils/is-motion-value\"\nimport type { MotionNodeOptions } from \"../../../node/types\"\nimport { isForcedMotionValue } from \"../../utils/is-forced-motion-value\"\nimport type { VisualElement } from \"../../VisualElement\"\n\nexport function scrapeMotionValuesFromProps(\n props: MotionNodeOptions,\n prevProps: MotionNodeOptions,\n visualElement?: VisualElement\n) {\n const style = (props as any).style\n const prevStyle = (prevProps as any)?.style\n const newValues: { [key: string]: any } = {}\n\n if (!style) return newValues\n\n for (const key in style) {\n if (\n isMotionValue(style[key]) ||\n (prevStyle && isMotionValue(prevStyle[key])) ||\n isForcedMotionValue(key, props) ||\n visualElement?.getValue(key)?.liveStyle !== undefined\n ) {\n newValues[key] = style[key]\n }\n }\n\n return newValues\n}\n"],"names":[],"mappings":";;;SAKgB,2BAA2B,CACvC,KAAwB,EACxB,SAA4B,EAC5B,aAA6B,EAAA;AAE7B,IAAA,MAAM,KAAK,GAAI,KAAa,CAAC,KAAK;AAClC,IAAA,MAAM,SAAS,GAAI,SAAiB,EAAE,KAAK;IAC3C,MAAM,SAAS,GAA2B,EAAE;AAE5C,IAAA,IAAI,CAAC,KAAK;AAAE,QAAA,OAAO,SAAS;AAE5B,IAAA,KAAK,MAAM,GAAG,IAAI,KAAK,EAAE;AACrB,QAAA,IACI,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;aACxB,SAAS,IAAI,aAAa,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;AAC5C,YAAA,mBAAmB,CAAC,GAAG,EAAE,KAAK,CAAC;YAC/B,aAAa,EAAE,QAAQ,CAAC,GAAG,CAAC,EAAE,SAAS,KAAK,SAAS,EACvD;YACE,SAAS,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC;QAC/B;IACJ;AAEA,IAAA,OAAO,SAAS;AACpB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/object/ObjectVisualElement.mjs b/node_modules/motion-dom/dist/es/render/object/ObjectVisualElement.mjs deleted file mode 100644 index d2dedf7..0000000 --- a/node_modules/motion-dom/dist/es/render/object/ObjectVisualElement.mjs +++ /dev/null @@ -1,42 +0,0 @@ -import { createBox } from '../../projection/geometry/models.mjs'; -import { VisualElement } from '../VisualElement.mjs'; - -function isObjectKey(key, object) { - return key in object; -} -class ObjectVisualElement extends VisualElement { - constructor() { - super(...arguments); - this.type = "object"; - } - readValueFromInstance(instance, key) { - if (isObjectKey(key, instance)) { - const value = instance[key]; - if (typeof value === "string" || typeof value === "number") { - return value; - } - } - return undefined; - } - getBaseTargetFromProps() { - return undefined; - } - removeValueFromRenderState(key, renderState) { - delete renderState.output[key]; - } - measureInstanceViewportBox() { - return createBox(); - } - build(renderState, latestValues) { - Object.assign(renderState.output, latestValues); - } - renderInstance(instance, { output }) { - Object.assign(instance, output); - } - sortInstanceNodePosition() { - return 0; - } -} - -export { ObjectVisualElement }; -//# sourceMappingURL=ObjectVisualElement.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/object/ObjectVisualElement.mjs.map b/node_modules/motion-dom/dist/es/render/object/ObjectVisualElement.mjs.map deleted file mode 100644 index 8c1b18b..0000000 --- a/node_modules/motion-dom/dist/es/render/object/ObjectVisualElement.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ObjectVisualElement.mjs","sources":["../../../../src/render/object/ObjectVisualElement.ts"],"sourcesContent":["import { createBox } from \"../../projection/geometry/models\"\nimport { ResolvedValues } from \"../types\"\nimport { VisualElement } from \"../VisualElement\"\n\ninterface ObjectRenderState {\n output: ResolvedValues\n}\n\nfunction isObjectKey(key: string, object: Object): key is keyof Object {\n return key in object\n}\n\nexport class ObjectVisualElement extends VisualElement<\n Object,\n ObjectRenderState\n> {\n type = \"object\"\n\n readValueFromInstance(instance: Object, key: string) {\n if (isObjectKey(key, instance)) {\n const value = instance[key]\n if (typeof value === \"string\" || typeof value === \"number\") {\n return value\n }\n }\n\n return undefined\n }\n\n getBaseTargetFromProps() {\n return undefined\n }\n\n removeValueFromRenderState(\n key: string,\n renderState: ObjectRenderState\n ): void {\n delete renderState.output[key]\n }\n\n measureInstanceViewportBox() {\n return createBox()\n }\n\n build(renderState: ObjectRenderState, latestValues: ResolvedValues) {\n Object.assign(renderState.output, latestValues)\n }\n\n renderInstance(instance: Object, { output }: ObjectRenderState) {\n Object.assign(instance, output)\n }\n\n sortInstanceNodePosition() {\n return 0\n }\n}\n"],"names":[],"mappings":";;;AAQA,SAAS,WAAW,CAAC,GAAW,EAAE,MAAc,EAAA;IAC5C,OAAO,GAAG,IAAI,MAAM;AACxB;AAEM,MAAO,mBAAoB,SAAQ,aAGxC,CAAA;AAHD,IAAA,WAAA,GAAA;;QAII,IAAA,CAAA,IAAI,GAAG,QAAQ;IAuCnB;IArCI,qBAAqB,CAAC,QAAgB,EAAE,GAAW,EAAA;AAC/C,QAAA,IAAI,WAAW,CAAC,GAAG,EAAE,QAAQ,CAAC,EAAE;AAC5B,YAAA,MAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC;YAC3B,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AACxD,gBAAA,OAAO,KAAK;YAChB;QACJ;AAEA,QAAA,OAAO,SAAS;IACpB;IAEA,sBAAsB,GAAA;AAClB,QAAA,OAAO,SAAS;IACpB;IAEA,0BAA0B,CACtB,GAAW,EACX,WAA8B,EAAA;AAE9B,QAAA,OAAO,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC;IAClC;IAEA,0BAA0B,GAAA;QACtB,OAAO,SAAS,EAAE;IACtB;IAEA,KAAK,CAAC,WAA8B,EAAE,YAA4B,EAAA;QAC9D,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,YAAY,CAAC;IACnD;AAEA,IAAA,cAAc,CAAC,QAAgB,EAAE,EAAE,MAAM,EAAqB,EAAA;AAC1D,QAAA,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC;IACnC;IAEA,wBAAwB,GAAA;AACpB,QAAA,OAAO,CAAC;IACZ;AACH;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/store.mjs b/node_modules/motion-dom/dist/es/render/store.mjs deleted file mode 100644 index 9a65634..0000000 --- a/node_modules/motion-dom/dist/es/render/store.mjs +++ /dev/null @@ -1,4 +0,0 @@ -const visualElementStore = new WeakMap(); - -export { visualElementStore }; -//# sourceMappingURL=store.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/store.mjs.map b/node_modules/motion-dom/dist/es/render/store.mjs.map deleted file mode 100644 index cad62f9..0000000 --- a/node_modules/motion-dom/dist/es/render/store.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"store.mjs","sources":["../../../src/render/store.ts"],"sourcesContent":["import type { VisualElement } from \"./VisualElement\"\n\nexport const visualElementStore = new WeakMap()\n"],"names":[],"mappings":"AAEO,MAAM,kBAAkB,GAAG,IAAI,OAAO;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/svg/SVGVisualElement.mjs b/node_modules/motion-dom/dist/es/render/svg/SVGVisualElement.mjs deleted file mode 100644 index d219a07..0000000 --- a/node_modules/motion-dom/dist/es/render/svg/SVGVisualElement.mjs +++ /dev/null @@ -1,52 +0,0 @@ -import { transformProps } from '../utils/keys-transform.mjs'; -import { getDefaultValueType } from '../../value/types/maps/defaults.mjs'; -import { createBox } from '../../projection/geometry/models.mjs'; -import { DOMVisualElement } from '../dom/DOMVisualElement.mjs'; -import { camelToDash } from '../dom/utils/camel-to-dash.mjs'; -import { cssStyleProperties, buildSVGAttrs } from './utils/build-attrs.mjs'; -import { camelCaseAttributes } from './utils/camel-case-attrs.mjs'; -import { isSVGTag } from './utils/is-svg-tag.mjs'; -import { renderSVG } from './utils/render.mjs'; -import { scrapeMotionValuesFromProps } from './utils/scrape-motion-values.mjs'; - -class SVGVisualElement extends DOMVisualElement { - constructor() { - super(...arguments); - this.type = "svg"; - this.isSVGTag = false; - this.measureInstanceViewportBox = createBox; - } - getBaseTargetFromProps(props, key) { - return props[key]; - } - readValueFromInstance(instance, key) { - if (transformProps.has(key)) { - const defaultType = getDefaultValueType(key); - return defaultType ? defaultType.default || 0 : 0; - } - if (cssStyleProperties.includes(key)) { - const computedStyle = getComputedStyle(instance); - const value = computedStyle[key]; - if (typeof value === "string" && value) - return value.trim(); - } - key = !camelCaseAttributes.has(key) ? camelToDash(key) : key; - return instance.getAttribute(key); - } - scrapeMotionValuesFromProps(props, prevProps, visualElement) { - return scrapeMotionValuesFromProps(props, prevProps, visualElement); - } - build(renderState, latestValues, props) { - buildSVGAttrs(renderState, latestValues, this.isSVGTag, props.transformTemplate, props.style); - } - renderInstance(instance, renderState, styleProp, projection) { - renderSVG(instance, renderState, styleProp, projection); - } - mount(instance) { - this.isSVGTag = isSVGTag(instance.tagName); - super.mount(instance); - } -} - -export { SVGVisualElement }; -//# sourceMappingURL=SVGVisualElement.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/svg/SVGVisualElement.mjs.map b/node_modules/motion-dom/dist/es/render/svg/SVGVisualElement.mjs.map deleted file mode 100644 index 1f43cbc..0000000 --- a/node_modules/motion-dom/dist/es/render/svg/SVGVisualElement.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"SVGVisualElement.mjs","sources":["../../../../src/render/svg/SVGVisualElement.ts"],"sourcesContent":["import type { AnyResolvedKeyframe } from \"../../animation/types\"\nimport type { MotionValue } from \"../../value\"\nimport type { MotionNodeOptions } from \"../../node/types\"\nimport { transformProps } from \"../utils/keys-transform\"\nimport { getDefaultValueType } from \"../../value/types/maps/defaults\"\nimport { createBox } from \"../../projection/geometry/models\"\nimport { DOMVisualElement } from \"../dom/DOMVisualElement\"\nimport type { DOMVisualElementOptions } from \"../dom/types\"\nimport { camelToDash } from \"../dom/utils/camel-to-dash\"\nimport type { ResolvedValues } from \"../types\"\nimport type { VisualElement, MotionStyle } from \"../VisualElement\"\nimport { SVGRenderState } from \"./types\"\nimport { buildSVGAttrs, cssStyleProperties } from \"./utils/build-attrs\"\nimport { camelCaseAttributes } from \"./utils/camel-case-attrs\"\nimport { isSVGTag } from \"./utils/is-svg-tag\"\nimport { renderSVG } from \"./utils/render\"\nimport { scrapeMotionValuesFromProps } from \"./utils/scrape-motion-values\"\nexport class SVGVisualElement extends DOMVisualElement<\n SVGElement,\n SVGRenderState,\n DOMVisualElementOptions\n> {\n type = \"svg\"\n\n isSVGTag = false\n\n getBaseTargetFromProps(\n props: MotionNodeOptions,\n key: string\n ): AnyResolvedKeyframe | MotionValue | undefined {\n return props[key as keyof MotionNodeOptions]\n }\n\n readValueFromInstance(instance: SVGElement, key: string) {\n if (transformProps.has(key)) {\n const defaultType = getDefaultValueType(key)\n return defaultType ? defaultType.default || 0 : 0\n }\n\n if (cssStyleProperties.includes(key)) {\n const computedStyle = getComputedStyle(instance)\n const value = computedStyle[key as keyof typeof computedStyle]\n if (typeof value === \"string\" && value) return value.trim()\n }\n\n key = !camelCaseAttributes.has(key) ? camelToDash(key) : key\n return instance.getAttribute(key)\n }\n\n measureInstanceViewportBox = createBox\n\n scrapeMotionValuesFromProps(\n props: MotionNodeOptions,\n prevProps: MotionNodeOptions,\n visualElement: VisualElement\n ) {\n return scrapeMotionValuesFromProps(props, prevProps, visualElement)\n }\n\n build(\n renderState: SVGRenderState,\n latestValues: ResolvedValues,\n props: MotionNodeOptions\n ) {\n buildSVGAttrs(\n renderState,\n latestValues,\n this.isSVGTag,\n props.transformTemplate,\n (props as any).style\n )\n }\n\n renderInstance(\n instance: SVGElement,\n renderState: SVGRenderState,\n styleProp?: MotionStyle | undefined,\n projection?: any\n ): void {\n renderSVG(instance, renderState, styleProp, projection)\n }\n\n mount(instance: SVGElement) {\n this.isSVGTag = isSVGTag(instance.tagName)\n super.mount(instance)\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAiBM,MAAO,gBAAiB,SAAQ,gBAIrC,CAAA;AAJD,IAAA,WAAA,GAAA;;QAKI,IAAA,CAAA,IAAI,GAAG,KAAK;QAEZ,IAAA,CAAA,QAAQ,GAAG,KAAK;QAyBhB,IAAA,CAAA,0BAA0B,GAAG,SAAS;IAqC1C;IA5DI,sBAAsB,CAClB,KAAwB,EACxB,GAAW,EAAA;AAEX,QAAA,OAAO,KAAK,CAAC,GAA8B,CAAC;IAChD;IAEA,qBAAqB,CAAC,QAAoB,EAAE,GAAW,EAAA;AACnD,QAAA,IAAI,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;AACzB,YAAA,MAAM,WAAW,GAAG,mBAAmB,CAAC,GAAG,CAAC;AAC5C,YAAA,OAAO,WAAW,GAAG,WAAW,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC;QACrD;AAEA,QAAA,IAAI,kBAAkB,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;AAClC,YAAA,MAAM,aAAa,GAAG,gBAAgB,CAAC,QAAQ,CAAC;AAChD,YAAA,MAAM,KAAK,GAAG,aAAa,CAAC,GAAiC,CAAC;AAC9D,YAAA,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK;AAAE,gBAAA,OAAO,KAAK,CAAC,IAAI,EAAE;QAC/D;AAEA,QAAA,GAAG,GAAG,CAAC,mBAAmB,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC,GAAG,CAAC,GAAG,GAAG;AAC5D,QAAA,OAAO,QAAQ,CAAC,YAAY,CAAC,GAAG,CAAC;IACrC;AAIA,IAAA,2BAA2B,CACvB,KAAwB,EACxB,SAA4B,EAC5B,aAA4B,EAAA;QAE5B,OAAO,2BAA2B,CAAC,KAAK,EAAE,SAAS,EAAE,aAAa,CAAC;IACvE;AAEA,IAAA,KAAK,CACD,WAA2B,EAC3B,YAA4B,EAC5B,KAAwB,EAAA;AAExB,QAAA,aAAa,CACT,WAAW,EACX,YAAY,EACZ,IAAI,CAAC,QAAQ,EACb,KAAK,CAAC,iBAAiB,EACtB,KAAa,CAAC,KAAK,CACvB;IACL;AAEA,IAAA,cAAc,CACV,QAAoB,EACpB,WAA2B,EAC3B,SAAmC,EACnC,UAAgB,EAAA;QAEhB,SAAS,CAAC,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,CAAC;IAC3D;AAEA,IAAA,KAAK,CAAC,QAAoB,EAAA;QACtB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC;AAC1C,QAAA,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC;IACzB;AACH;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/svg/utils/build-attrs.mjs b/node_modules/motion-dom/dist/es/render/svg/utils/build-attrs.mjs deleted file mode 100644 index de2891a..0000000 --- a/node_modules/motion-dom/dist/es/render/svg/utils/build-attrs.mjs +++ /dev/null @@ -1,64 +0,0 @@ -import { buildHTMLStyles } from '../../html/utils/build-styles.mjs'; -import { buildSVGPath } from './path.mjs'; - -const cssStyleProperties = [ - "transform", - "opacity", - "offsetDistance", - "offsetPath", - "offsetRotate", - "offsetAnchor", -]; -/** - * Build SVG visual attributes, like cx and style.transform - */ -function buildSVGAttrs(state, { attrX, attrY, attrScale, pathLength, pathSpacing = 1, pathOffset = 0, -// This is object creation, which we try to avoid per-frame. -...latest }, isSVGTag, transformTemplate, styleProp) { - buildHTMLStyles(state, latest, transformTemplate); - /** - * For svg tags we just want to make sure viewBox is animatable and treat all the styles - * as normal HTML tags. - */ - if (isSVGTag) { - if (state.style.viewBox) { - state.attrs.viewBox = state.style.viewBox; - } - return; - } - state.attrs = state.style; - state.style = {}; - const { attrs, style } = state; - for (const key of cssStyleProperties) { - if (attrs[key] !== undefined) { - style[key] = attrs[key]; - delete attrs[key]; - } - } - if (style.transform || attrs.transformOrigin) { - style.transformOrigin = attrs.transformOrigin ?? "50% 50%"; - delete attrs.transformOrigin; - } - if (style.transform) { - /** - * SVG's element transform-origin uses its own median as a reference. - * Therefore, transformBox becomes a fill-box - */ - style.transformBox = styleProp?.transformBox ?? "fill-box"; - delete attrs.transformBox; - } - // Render attrX/attrY/attrScale as attributes - if (attrX !== undefined) - attrs.x = attrX; - if (attrY !== undefined) - attrs.y = attrY; - if (attrScale !== undefined) - attrs.scale = attrScale; - // Build SVG path if one has been defined - if (pathLength !== undefined) { - buildSVGPath(attrs, pathLength, pathSpacing, pathOffset, false); - } -} - -export { buildSVGAttrs, cssStyleProperties }; -//# sourceMappingURL=build-attrs.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/svg/utils/build-attrs.mjs.map b/node_modules/motion-dom/dist/es/render/svg/utils/build-attrs.mjs.map deleted file mode 100644 index d186868..0000000 --- a/node_modules/motion-dom/dist/es/render/svg/utils/build-attrs.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"build-attrs.mjs","sources":["../../../../../src/render/svg/utils/build-attrs.ts"],"sourcesContent":["import type { MotionNodeOptions } from \"../../../node/types\"\nimport { buildHTMLStyles } from \"../../html/utils/build-styles\"\nimport { ResolvedValues } from \"../../types\"\nimport { SVGRenderState } from \"../types\"\nimport { buildSVGPath } from \"./path\"\n\nexport const cssStyleProperties = [\n \"transform\",\n \"opacity\",\n \"offsetDistance\",\n \"offsetPath\",\n \"offsetRotate\",\n \"offsetAnchor\",\n]\n\n/**\n * Build SVG visual attributes, like cx and style.transform\n */\nexport function buildSVGAttrs(\n state: SVGRenderState,\n {\n attrX,\n attrY,\n attrScale,\n pathLength,\n pathSpacing = 1,\n pathOffset = 0,\n // This is object creation, which we try to avoid per-frame.\n ...latest\n }: ResolvedValues,\n isSVGTag: boolean,\n transformTemplate?: MotionNodeOptions[\"transformTemplate\"],\n styleProp?: Record\n) {\n buildHTMLStyles(state, latest, transformTemplate)\n\n /**\n * For svg tags we just want to make sure viewBox is animatable and treat all the styles\n * as normal HTML tags.\n */\n if (isSVGTag) {\n if (state.style.viewBox) {\n state.attrs.viewBox = state.style.viewBox\n }\n return\n }\n\n state.attrs = state.style\n state.style = {}\n const { attrs, style } = state\n\n for (const key of cssStyleProperties) {\n if (attrs[key] !== undefined) {\n style[key] = attrs[key]\n delete attrs[key]\n }\n }\n\n if (style.transform || attrs.transformOrigin) {\n style.transformOrigin = attrs.transformOrigin ?? \"50% 50%\"\n delete attrs.transformOrigin\n }\n\n if (style.transform) {\n /**\n * SVG's element transform-origin uses its own median as a reference.\n * Therefore, transformBox becomes a fill-box\n */\n style.transformBox = (styleProp?.transformBox as string) ?? \"fill-box\"\n delete attrs.transformBox\n }\n\n // Render attrX/attrY/attrScale as attributes\n if (attrX !== undefined) attrs.x = attrX\n if (attrY !== undefined) attrs.y = attrY\n if (attrScale !== undefined) attrs.scale = attrScale\n\n // Build SVG path if one has been defined\n if (pathLength !== undefined) {\n buildSVGPath(\n attrs,\n pathLength as number,\n pathSpacing as number,\n pathOffset as number,\n false\n )\n }\n}\n"],"names":[],"mappings":";;;AAMO,MAAM,kBAAkB,GAAG;IAC9B,WAAW;IACX,SAAS;IACT,gBAAgB;IAChB,YAAY;IACZ,cAAc;IACd,cAAc;;AAGlB;;AAEG;AACG,SAAU,aAAa,CACzB,KAAqB,EACrB,EACI,KAAK,EACL,KAAK,EACL,SAAS,EACT,UAAU,EACV,WAAW,GAAG,CAAC,EACf,UAAU,GAAG,CAAC;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AS;;AAGpD,IAAA,IAAI,UAAU,KAAK,SAAS,EAAE;QAC1B,YAAY,CACR,KAAK,EACL,UAAoB,EACpB,WAAqB,EACrB,UAAoB,EACpB,KAAK,CACR;IACL;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/svg/utils/camel-case-attrs.mjs b/node_modules/motion-dom/dist/es/render/svg/utils/camel-case-attrs.mjs deleted file mode 100644 index 4885a9b..0000000 --- a/node_modules/motion-dom/dist/es/render/svg/utils/camel-case-attrs.mjs +++ /dev/null @@ -1,31 +0,0 @@ -/** - * A set of attribute names that are always read/written as camel case. - */ -const camelCaseAttributes = new Set([ - "baseFrequency", - "diffuseConstant", - "kernelMatrix", - "kernelUnitLength", - "keySplines", - "keyTimes", - "limitingConeAngle", - "markerHeight", - "markerWidth", - "numOctaves", - "targetX", - "targetY", - "surfaceScale", - "specularConstant", - "specularExponent", - "stdDeviation", - "tableValues", - "viewBox", - "gradientTransform", - "pathLength", - "startOffset", - "textLength", - "lengthAdjust", -]); - -export { camelCaseAttributes }; -//# sourceMappingURL=camel-case-attrs.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/svg/utils/camel-case-attrs.mjs.map b/node_modules/motion-dom/dist/es/render/svg/utils/camel-case-attrs.mjs.map deleted file mode 100644 index 7ca6fe3..0000000 --- a/node_modules/motion-dom/dist/es/render/svg/utils/camel-case-attrs.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"camel-case-attrs.mjs","sources":["../../../../../src/render/svg/utils/camel-case-attrs.ts"],"sourcesContent":["/**\n * A set of attribute names that are always read/written as camel case.\n */\nexport const camelCaseAttributes = new Set([\n \"baseFrequency\",\n \"diffuseConstant\",\n \"kernelMatrix\",\n \"kernelUnitLength\",\n \"keySplines\",\n \"keyTimes\",\n \"limitingConeAngle\",\n \"markerHeight\",\n \"markerWidth\",\n \"numOctaves\",\n \"targetX\",\n \"targetY\",\n \"surfaceScale\",\n \"specularConstant\",\n \"specularExponent\",\n \"stdDeviation\",\n \"tableValues\",\n \"viewBox\",\n \"gradientTransform\",\n \"pathLength\",\n \"startOffset\",\n \"textLength\",\n \"lengthAdjust\",\n])\n"],"names":[],"mappings":"AAAA;;AAEG;AACI,MAAM,mBAAmB,GAAG,IAAI,GAAG,CAAC;IACvC,eAAe;IACf,iBAAiB;IACjB,cAAc;IACd,kBAAkB;IAClB,YAAY;IACZ,UAAU;IACV,mBAAmB;IACnB,cAAc;IACd,aAAa;IACb,YAAY;IACZ,SAAS;IACT,SAAS;IACT,cAAc;IACd,kBAAkB;IAClB,kBAAkB;IAClB,cAAc;IACd,aAAa;IACb,SAAS;IACT,mBAAmB;IACnB,YAAY;IACZ,aAAa;IACb,YAAY;IACZ,cAAc;AACjB,CAAA;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/svg/utils/is-svg-tag.mjs b/node_modules/motion-dom/dist/es/render/svg/utils/is-svg-tag.mjs deleted file mode 100644 index 37ab448..0000000 --- a/node_modules/motion-dom/dist/es/render/svg/utils/is-svg-tag.mjs +++ /dev/null @@ -1,4 +0,0 @@ -const isSVGTag = (tag) => typeof tag === "string" && tag.toLowerCase() === "svg"; - -export { isSVGTag }; -//# sourceMappingURL=is-svg-tag.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/svg/utils/is-svg-tag.mjs.map b/node_modules/motion-dom/dist/es/render/svg/utils/is-svg-tag.mjs.map deleted file mode 100644 index ce8c3ac..0000000 --- a/node_modules/motion-dom/dist/es/render/svg/utils/is-svg-tag.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"is-svg-tag.mjs","sources":["../../../../../src/render/svg/utils/is-svg-tag.ts"],"sourcesContent":["export const isSVGTag = (tag: unknown) =>\n typeof tag === \"string\" && tag.toLowerCase() === \"svg\"\n"],"names":[],"mappings":"MAAa,QAAQ,GAAG,CAAC,GAAY,KACjC,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,CAAC,WAAW,EAAE,KAAK;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/svg/utils/path.mjs b/node_modules/motion-dom/dist/es/render/svg/utils/path.mjs deleted file mode 100644 index 02aff41..0000000 --- a/node_modules/motion-dom/dist/es/render/svg/utils/path.mjs +++ /dev/null @@ -1,32 +0,0 @@ -const dashKeys = { - offset: "stroke-dashoffset", - array: "stroke-dasharray", -}; -const camelKeys = { - offset: "strokeDashoffset", - array: "strokeDasharray", -}; -/** - * Build SVG path properties. Uses the path's measured length to convert - * our custom pathLength, pathSpacing and pathOffset into stroke-dashoffset - * and stroke-dasharray attributes. - * - * This function is mutative to reduce per-frame GC. - * - * Note: We use unitless values for stroke-dasharray and stroke-dashoffset - * because Safari incorrectly scales px values when the page is zoomed. - */ -function buildSVGPath(attrs, length, spacing = 1, offset = 0, useDashCase = true) { - // Normalise path length by setting SVG attribute pathLength to 1 - attrs.pathLength = 1; - // We use dash case when setting attributes directly to the DOM node and camel case - // when defining props on a React component. - const keys = useDashCase ? dashKeys : camelKeys; - // Build the dash offset (unitless to avoid Safari zoom bug) - attrs[keys.offset] = `${-offset}`; - // Build the dash array (unitless to avoid Safari zoom bug) - attrs[keys.array] = `${length} ${spacing}`; -} - -export { buildSVGPath }; -//# sourceMappingURL=path.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/svg/utils/path.mjs.map b/node_modules/motion-dom/dist/es/render/svg/utils/path.mjs.map deleted file mode 100644 index 8bf0885..0000000 --- a/node_modules/motion-dom/dist/es/render/svg/utils/path.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"path.mjs","sources":["../../../../../src/render/svg/utils/path.ts"],"sourcesContent":["import { ResolvedValues } from \"../../types\"\n\nconst dashKeys = {\n offset: \"stroke-dashoffset\",\n array: \"stroke-dasharray\",\n}\n\nconst camelKeys = {\n offset: \"strokeDashoffset\",\n array: \"strokeDasharray\",\n}\n\n/**\n * Build SVG path properties. Uses the path's measured length to convert\n * our custom pathLength, pathSpacing and pathOffset into stroke-dashoffset\n * and stroke-dasharray attributes.\n *\n * This function is mutative to reduce per-frame GC.\n *\n * Note: We use unitless values for stroke-dasharray and stroke-dashoffset\n * because Safari incorrectly scales px values when the page is zoomed.\n */\nexport function buildSVGPath(\n attrs: ResolvedValues,\n length: number,\n spacing = 1,\n offset = 0,\n useDashCase: boolean = true\n): void {\n // Normalise path length by setting SVG attribute pathLength to 1\n attrs.pathLength = 1\n\n // We use dash case when setting attributes directly to the DOM node and camel case\n // when defining props on a React component.\n const keys = useDashCase ? dashKeys : camelKeys\n\n // Build the dash offset (unitless to avoid Safari zoom bug)\n attrs[keys.offset] = `${-offset}`\n\n // Build the dash array (unitless to avoid Safari zoom bug)\n attrs[keys.array] = `${length} ${spacing}`\n}\n"],"names":[],"mappings":"AAEA,MAAM,QAAQ,GAAG;AACb,IAAA,MAAM,EAAE,mBAAmB;AAC3B,IAAA,KAAK,EAAE,kBAAkB;CAC5B;AAED,MAAM,SAAS,GAAG;AACd,IAAA,MAAM,EAAE,kBAAkB;AAC1B,IAAA,KAAK,EAAE,iBAAiB;CAC3B;AAED;;;;;;;;;AASG;SACa,YAAY,CACxB,KAAqB,EACrB,MAAc,EACd,OAAO,GAAG,CAAC,EACX,MAAM,GAAG,CAAC,EACV,cAAuB,IAAI,EAAA;;AAG3B,IAAA,KAAK,CAAC,UAAU,GAAG,CAAC;;;IAIpB,MAAM,IAAI,GAAG,WAAW,GAAG,QAAQ,GAAG,SAAS;;IAG/C,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAA,EAAG,CAAC,MAAM,CAAA,CAAE;;IAGjC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAA,EAAG,MAAM,CAAA,CAAA,EAAI,OAAO,CAAA,CAAE;AAC9C;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/svg/utils/render.mjs b/node_modules/motion-dom/dist/es/render/svg/utils/render.mjs deleted file mode 100644 index 8171361..0000000 --- a/node_modules/motion-dom/dist/es/render/svg/utils/render.mjs +++ /dev/null @@ -1,13 +0,0 @@ -import { camelToDash } from '../../dom/utils/camel-to-dash.mjs'; -import { renderHTML } from '../../html/utils/render.mjs'; -import { camelCaseAttributes } from './camel-case-attrs.mjs'; - -function renderSVG(element, renderState, _styleProp, projection) { - renderHTML(element, renderState, undefined, projection); - for (const key in renderState.attrs) { - element.setAttribute(!camelCaseAttributes.has(key) ? camelToDash(key) : key, renderState.attrs[key]); - } -} - -export { renderSVG }; -//# sourceMappingURL=render.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/svg/utils/render.mjs.map b/node_modules/motion-dom/dist/es/render/svg/utils/render.mjs.map deleted file mode 100644 index 8fcd12e..0000000 --- a/node_modules/motion-dom/dist/es/render/svg/utils/render.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"render.mjs","sources":["../../../../../src/render/svg/utils/render.ts"],"sourcesContent":["import type { MotionStyle } from \"../../VisualElement\"\nimport { camelToDash } from \"../../dom/utils/camel-to-dash\"\nimport { renderHTML } from \"../../html/utils/render\"\nimport { SVGRenderState } from \"../types\"\nimport { camelCaseAttributes } from \"./camel-case-attrs\"\n\nexport function renderSVG(\n element: SVGElement,\n renderState: SVGRenderState,\n _styleProp?: MotionStyle,\n projection?: any\n) {\n renderHTML(element as any, renderState, undefined, projection)\n\n for (const key in renderState.attrs) {\n element.setAttribute(\n !camelCaseAttributes.has(key) ? camelToDash(key) : key,\n renderState.attrs[key] as string\n )\n }\n}\n"],"names":[],"mappings":";;;;AAMM,SAAU,SAAS,CACrB,OAAmB,EACnB,WAA2B,EAC3B,UAAwB,EACxB,UAAgB,EAAA;IAEhB,UAAU,CAAC,OAAc,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,CAAC;AAE9D,IAAA,KAAK,MAAM,GAAG,IAAI,WAAW,CAAC,KAAK,EAAE;AACjC,QAAA,OAAO,CAAC,YAAY,CAChB,CAAC,mBAAmB,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC,GAAG,CAAC,GAAG,GAAG,EACtD,WAAW,CAAC,KAAK,CAAC,GAAG,CAAW,CACnC;IACL;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/svg/utils/scrape-motion-values.mjs b/node_modules/motion-dom/dist/es/render/svg/utils/scrape-motion-values.mjs deleted file mode 100644 index 9c83e3d..0000000 --- a/node_modules/motion-dom/dist/es/render/svg/utils/scrape-motion-values.mjs +++ /dev/null @@ -1,20 +0,0 @@ -import { isMotionValue } from '../../../value/utils/is-motion-value.mjs'; -import { transformPropOrder } from '../../utils/keys-transform.mjs'; -import { scrapeMotionValuesFromProps as scrapeMotionValuesFromProps$1 } from '../../html/utils/scrape-motion-values.mjs'; - -function scrapeMotionValuesFromProps(props, prevProps, visualElement) { - const newValues = scrapeMotionValuesFromProps$1(props, prevProps, visualElement); - for (const key in props) { - if (isMotionValue(props[key]) || - isMotionValue(prevProps[key])) { - const targetKey = transformPropOrder.indexOf(key) !== -1 - ? "attr" + key.charAt(0).toUpperCase() + key.substring(1) - : key; - newValues[targetKey] = props[key]; - } - } - return newValues; -} - -export { scrapeMotionValuesFromProps }; -//# sourceMappingURL=scrape-motion-values.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/svg/utils/scrape-motion-values.mjs.map b/node_modules/motion-dom/dist/es/render/svg/utils/scrape-motion-values.mjs.map deleted file mode 100644 index 70be008..0000000 --- a/node_modules/motion-dom/dist/es/render/svg/utils/scrape-motion-values.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"scrape-motion-values.mjs","sources":["../../../../../src/render/svg/utils/scrape-motion-values.ts"],"sourcesContent":["import { isMotionValue } from \"../../../value/utils/is-motion-value\"\nimport type { MotionNodeOptions } from \"../../../node/types\"\nimport { transformPropOrder } from \"../../utils/keys-transform\"\nimport { scrapeMotionValuesFromProps as scrapeHTMLMotionValuesFromProps } from \"../../html/utils/scrape-motion-values\"\nimport type { VisualElement } from \"../../VisualElement\"\n\nexport function scrapeMotionValuesFromProps(\n props: MotionNodeOptions,\n prevProps: MotionNodeOptions,\n visualElement?: VisualElement\n) {\n const newValues = scrapeHTMLMotionValuesFromProps(\n props,\n prevProps,\n visualElement\n )\n\n for (const key in props) {\n if (\n isMotionValue(props[key as keyof typeof props]) ||\n isMotionValue(prevProps[key as keyof typeof prevProps])\n ) {\n const targetKey =\n transformPropOrder.indexOf(key) !== -1\n ? \"attr\" + key.charAt(0).toUpperCase() + key.substring(1)\n : key\n\n newValues[targetKey] = props[key as keyof typeof props]\n }\n }\n\n return newValues\n}\n"],"names":["scrapeHTMLMotionValuesFromProps"],"mappings":";;;;SAMgB,2BAA2B,CACvC,KAAwB,EACxB,SAA4B,EAC5B,aAA6B,EAAA;IAE7B,MAAM,SAAS,GAAGA,6BAA+B,CAC7C,KAAK,EACL,SAAS,EACT,aAAa,CAChB;AAED,IAAA,KAAK,MAAM,GAAG,IAAI,KAAK,EAAE;AACrB,QAAA,IACI,aAAa,CAAC,KAAK,CAAC,GAAyB,CAAC,CAAC;AAC/C,YAAA,aAAa,CAAC,SAAS,CAAC,GAA6B,CAAC,CAAC,EACzD;YACE,MAAM,SAAS,GACX,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK;AAChC,kBAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,SAAS,CAAC,CAAC;kBACtD,GAAG;YAEb,SAAS,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC,GAAyB,CAAC;QAC3D;IACJ;AAEA,IAAA,OAAO,SAAS;AACpB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/utils/animation-state.mjs b/node_modules/motion-dom/dist/es/render/utils/animation-state.mjs deleted file mode 100644 index 9d7b206..0000000 --- a/node_modules/motion-dom/dist/es/render/utils/animation-state.mjs +++ /dev/null @@ -1,387 +0,0 @@ -import { animateVisualElement } from '../../animation/interfaces/visual-element.mjs'; -import { calcChildStagger } from '../../animation/utils/calc-child-stagger.mjs'; -import { getVariantContext } from './get-variant-context.mjs'; -import { isAnimationControls } from './is-animation-controls.mjs'; -import { isKeyframesTarget } from './is-keyframes-target.mjs'; -import { isVariantLabel } from './is-variant-label.mjs'; -import { resolveVariant } from './resolve-dynamic-variants.mjs'; -import { shallowCompare } from './shallow-compare.mjs'; -import { variantPriorityOrder } from './variant-props.mjs'; - -const reversePriorityOrder = [...variantPriorityOrder].reverse(); -const numAnimationTypes = variantPriorityOrder.length; -function createAnimateFunction(visualElement) { - return (animations) => { - return Promise.all(animations.map(({ animation, options }) => animateVisualElement(visualElement, animation, options))); - }; -} -function createAnimationState(visualElement) { - let animate = createAnimateFunction(visualElement); - let state = createState(); - let isInitialRender = true; - /** - * Track whether the animation state has been reset (e.g. via StrictMode - * double-invocation or Suspense unmount/remount). On the first - * animateChanges() call after a reset we need to behave like the initial - * render for variant-inheritance checks, even though isInitialRender is - * already false. - */ - let wasReset = false; - /** - * This function will be used to reduce the animation definitions for - * each active animation type into an object of resolved values for it. - */ - const buildResolvedTypeValues = (type) => (acc, definition) => { - const resolved = resolveVariant(visualElement, definition, type === "exit" - ? visualElement.presenceContext?.custom - : undefined); - if (resolved) { - const { transition, transitionEnd, ...target } = resolved; - acc = { ...acc, ...target, ...transitionEnd }; - } - return acc; - }; - /** - * This just allows us to inject mocked animation functions - * @internal - */ - function setAnimateFunction(makeAnimator) { - animate = makeAnimator(visualElement); - } - /** - * When we receive new props, we need to: - * 1. Create a list of protected keys for each type. This is a directory of - * value keys that are currently being "handled" by types of a higher priority - * so that whenever an animation is played of a given type, these values are - * protected from being animated. - * 2. Determine if an animation type needs animating. - * 3. Determine if any values have been removed from a type and figure out - * what to animate those to. - */ - function animateChanges(changedActiveType) { - const { props } = visualElement; - const context = getVariantContext(visualElement.parent) || {}; - /** - * A list of animations that we'll build into as we iterate through the animation - * types. This will get executed at the end of the function. - */ - const animations = []; - /** - * Keep track of which values have been removed. Then, as we hit lower priority - * animation types, we can check if they contain removed values and animate to that. - */ - const removedKeys = new Set(); - /** - * A dictionary of all encountered keys. This is an object to let us build into and - * copy it without iteration. Each time we hit an animation type we set its protected - * keys - the keys its not allowed to animate - to the latest version of this object. - */ - let encounteredKeys = {}; - /** - * If a variant has been removed at a given index, and this component is controlling - * variant animations, we want to ensure lower-priority variants are forced to animate. - */ - let removedVariantIndex = Infinity; - /** - * Iterate through all animation types in reverse priority order. For each, we want to - * detect which values it's handling and whether or not they've changed (and therefore - * need to be animated). If any values have been removed, we want to detect those in - * lower priority props and flag for animation. - */ - for (let i = 0; i < numAnimationTypes; i++) { - const type = reversePriorityOrder[i]; - const typeState = state[type]; - const prop = props[type] !== undefined - ? props[type] - : context[type]; - const propIsVariant = isVariantLabel(prop); - /** - * If this type has *just* changed isActive status, set activeDelta - * to that status. Otherwise set to null. - */ - const activeDelta = type === changedActiveType ? typeState.isActive : null; - if (activeDelta === false) - removedVariantIndex = i; - /** - * If this prop is an inherited variant, rather than been set directly on the - * component itself, we want to make sure we allow the parent to trigger animations. - * - * TODO: Can probably change this to a !isControllingVariants check - */ - let isInherited = prop === context[type] && - prop !== props[type] && - propIsVariant; - if (isInherited && - (isInitialRender || wasReset) && - visualElement.manuallyAnimateOnMount) { - isInherited = false; - } - /** - * Set all encountered keys so far as the protected keys for this type. This will - * be any key that has been animated or otherwise handled by active, higher-priortiy types. - */ - typeState.protectedKeys = { ...encounteredKeys }; - // Check if we can skip analysing this prop early - if ( - // If it isn't active and hasn't *just* been set as inactive - (!typeState.isActive && activeDelta === null) || - // If we didn't and don't have any defined prop for this animation type - (!prop && !typeState.prevProp) || - // Or if the prop doesn't define an animation - isAnimationControls(prop) || - typeof prop === "boolean") { - continue; - } - /** - * If exit is already active and wasn't just activated, skip - * re-processing to prevent interrupting running exit animations. - * Re-resolving exit with a changed custom value can start new - * value animations that stop the originals, leaving the exit - * animation promise unresolved and the component stuck in the DOM. - */ - if (type === "exit" && typeState.isActive && activeDelta !== true) { - if (typeState.prevResolvedValues) { - encounteredKeys = { - ...encounteredKeys, - ...typeState.prevResolvedValues, - }; - } - continue; - } - /** - * As we go look through the values defined on this type, if we detect - * a changed value or a value that was removed in a higher priority, we set - * this to true and add this prop to the animation list. - */ - const variantDidChange = checkVariantsDidChange(typeState.prevProp, prop); - let shouldAnimateType = variantDidChange || - // If we're making this variant active, we want to always make it active - (type === changedActiveType && - typeState.isActive && - !isInherited && - propIsVariant) || - // If we removed a higher-priority variant (i is in reverse order) - (i > removedVariantIndex && propIsVariant); - let handledRemovedValues = false; - /** - * As animations can be set as variant lists, variants or target objects, we - * coerce everything to an array if it isn't one already - */ - const definitionList = Array.isArray(prop) ? prop : [prop]; - /** - * Build an object of all the resolved values. We'll use this in the subsequent - * animateChanges calls to determine whether a value has changed. - */ - let resolvedValues = definitionList.reduce(buildResolvedTypeValues(type), {}); - if (activeDelta === false) - resolvedValues = {}; - /** - * Now we need to loop through all the keys in the prev prop and this prop, - * and decide: - * 1. If the value has changed, and needs animating - * 2. If it has been removed, and needs adding to the removedKeys set - * 3. If it has been removed in a higher priority type and needs animating - * 4. If it hasn't been removed in a higher priority but hasn't changed, and - * needs adding to the type's protectedKeys list. - */ - const { prevResolvedValues = {} } = typeState; - const allKeys = { - ...prevResolvedValues, - ...resolvedValues, - }; - const markToAnimate = (key) => { - shouldAnimateType = true; - if (removedKeys.has(key)) { - handledRemovedValues = true; - removedKeys.delete(key); - } - typeState.needsAnimating[key] = true; - const motionValue = visualElement.getValue(key); - if (motionValue) - motionValue.liveStyle = false; - }; - for (const key in allKeys) { - const next = resolvedValues[key]; - const prev = prevResolvedValues[key]; - // If we've already handled this we can just skip ahead - if (encounteredKeys.hasOwnProperty(key)) - continue; - /** - * If the value has changed, we probably want to animate it. - */ - let valueHasChanged = false; - if (isKeyframesTarget(next) && isKeyframesTarget(prev)) { - valueHasChanged = - !shallowCompare(next, prev) || variantDidChange; - } - else { - valueHasChanged = next !== prev; - } - if (valueHasChanged) { - if (next !== undefined && next !== null) { - // If next is defined and doesn't equal prev, it needs animating - markToAnimate(key); - } - else { - // If it's undefined, it's been removed. - removedKeys.add(key); - } - } - else if (next !== undefined && removedKeys.has(key)) { - /** - * If next hasn't changed and it isn't undefined, we want to check if it's - * been removed by a higher priority - */ - markToAnimate(key); - } - else { - /** - * If it hasn't changed, we add it to the list of protected values - * to ensure it doesn't get animated. - */ - typeState.protectedKeys[key] = true; - } - } - /** - * Update the typeState so next time animateChanges is called we can compare the - * latest prop and resolvedValues to these. - */ - typeState.prevProp = prop; - typeState.prevResolvedValues = resolvedValues; - if (typeState.isActive) { - encounteredKeys = { ...encounteredKeys, ...resolvedValues }; - } - if ((isInitialRender || wasReset) && - visualElement.blockInitialAnimation) { - shouldAnimateType = false; - } - /** - * If this is an inherited prop we want to skip this animation - * unless the inherited variants haven't changed on this render. - */ - const willAnimateViaParent = isInherited && variantDidChange; - const needsAnimating = !willAnimateViaParent || handledRemovedValues; - if (shouldAnimateType && needsAnimating) { - animations.push(...definitionList.map((animation) => { - const options = { type }; - /** - * If we're performing the initial animation, but we're not - * rendering at the same time as the variant-controlling parent, - * we want to use the parent's transition to calculate the stagger. - */ - if (typeof animation === "string" && - (isInitialRender || wasReset) && - !willAnimateViaParent && - visualElement.manuallyAnimateOnMount && - visualElement.parent) { - const { parent } = visualElement; - const parentVariant = resolveVariant(parent, animation); - if (parent.enteringChildren && parentVariant) { - const { delayChildren } = parentVariant.transition || {}; - options.delay = calcChildStagger(parent.enteringChildren, visualElement, delayChildren); - } - } - return { - animation: animation, - options, - }; - })); - } - } - /** - * If there are some removed value that haven't been dealt with, - * we need to create a new animation that falls back either to the value - * defined in the style prop, or the last read value. - */ - if (removedKeys.size) { - const fallbackAnimation = {}; - /** - * If the initial prop contains a transition we can use that, otherwise - * allow the animation function to use the visual element's default. - */ - if (typeof props.initial !== "boolean") { - const initialTransition = resolveVariant(visualElement, Array.isArray(props.initial) - ? props.initial[0] - : props.initial); - if (initialTransition && initialTransition.transition) { - fallbackAnimation.transition = initialTransition.transition; - } - } - removedKeys.forEach((key) => { - const fallbackTarget = visualElement.getBaseTarget(key); - const motionValue = visualElement.getValue(key); - if (motionValue) - motionValue.liveStyle = true; - // @ts-expect-error - @mattgperry to figure if we should do something here - fallbackAnimation[key] = fallbackTarget ?? null; - }); - animations.push({ animation: fallbackAnimation }); - } - let shouldAnimate = Boolean(animations.length); - if (isInitialRender && - (props.initial === false || props.initial === props.animate) && - !visualElement.manuallyAnimateOnMount) { - shouldAnimate = false; - } - isInitialRender = false; - wasReset = false; - return shouldAnimate ? animate(animations) : Promise.resolve(); - } - /** - * Change whether a certain animation type is active. - */ - function setActive(type, isActive) { - // If the active state hasn't changed, we can safely do nothing here - if (state[type].isActive === isActive) - return Promise.resolve(); - // Propagate active change to children - visualElement.variantChildren?.forEach((child) => child.animationState?.setActive(type, isActive)); - state[type].isActive = isActive; - const animations = animateChanges(type); - for (const key in state) { - state[key].protectedKeys = {}; - } - return animations; - } - return { - animateChanges, - setActive, - setAnimateFunction, - getState: () => state, - reset: () => { - state = createState(); - wasReset = true; - }, - }; -} -function checkVariantsDidChange(prev, next) { - if (typeof next === "string") { - return next !== prev; - } - else if (Array.isArray(next)) { - return !shallowCompare(next, prev); - } - return false; -} -function createTypeState(isActive = false) { - return { - isActive, - protectedKeys: {}, - needsAnimating: {}, - prevResolvedValues: {}, - }; -} -function createState() { - return { - animate: createTypeState(true), - whileInView: createTypeState(), - whileHover: createTypeState(), - whileTap: createTypeState(), - whileDrag: createTypeState(), - whileFocus: createTypeState(), - exit: createTypeState(), - }; -} - -export { checkVariantsDidChange, createAnimationState }; -//# sourceMappingURL=animation-state.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/utils/animation-state.mjs.map b/node_modules/motion-dom/dist/es/render/utils/animation-state.mjs.map deleted file mode 100644 index 7786bfd..0000000 --- a/node_modules/motion-dom/dist/es/render/utils/animation-state.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"animation-state.mjs","sources":["../../../../src/render/utils/animation-state.ts"],"sourcesContent":["import type {\n AnimationDefinition,\n TargetAndTransition,\n VariantLabels,\n} from \"../../node/types\"\nimport type { AnimationType } from \"../types\"\nimport type { VisualElementAnimationOptions } from \"../../animation/interfaces/types\"\nimport { animateVisualElement } from \"../../animation/interfaces/visual-element\"\nimport { calcChildStagger } from \"../../animation/utils/calc-child-stagger\"\nimport { getVariantContext } from \"./get-variant-context\"\nimport { isAnimationControls } from \"./is-animation-controls\"\nimport { isKeyframesTarget } from \"./is-keyframes-target\"\nimport { isVariantLabel } from \"./is-variant-label\"\nimport { resolveVariant } from \"./resolve-dynamic-variants\"\nimport { shallowCompare } from \"./shallow-compare\"\nimport { variantPriorityOrder } from \"./variant-props\"\n\nexport type { VisualElementAnimationOptions }\n\nexport interface AnimationState {\n animateChanges: (type?: AnimationType) => Promise\n setActive: (\n type: AnimationType,\n isActive: boolean,\n options?: VisualElementAnimationOptions\n ) => Promise\n setAnimateFunction: (fn: any) => void\n getState: () => { [key: string]: AnimationTypeState }\n reset: () => void\n}\n\ninterface DefinitionAndOptions {\n animation: AnimationDefinition\n options?: VisualElementAnimationOptions\n}\n\nexport type AnimationList = string[] | TargetAndTransition[]\n\nconst reversePriorityOrder = [...variantPriorityOrder].reverse()\nconst numAnimationTypes = variantPriorityOrder.length\n\n/**\n * Type for the animate function that can be injected.\n * This allows the animation implementation to be provided by the framework layer.\n */\nexport type AnimateFunction = (animations: DefinitionAndOptions[]) => Promise\n\nfunction createAnimateFunction(visualElement: any): AnimateFunction {\n return (animations: DefinitionAndOptions[]) => {\n return Promise.all(\n animations.map(({ animation, options }) =>\n animateVisualElement(visualElement, animation, options)\n )\n )\n }\n}\n\nexport function createAnimationState(visualElement: any): AnimationState {\n let animate = createAnimateFunction(visualElement)\n let state = createState()\n let isInitialRender = true\n /**\n * Track whether the animation state has been reset (e.g. via StrictMode\n * double-invocation or Suspense unmount/remount). On the first\n * animateChanges() call after a reset we need to behave like the initial\n * render for variant-inheritance checks, even though isInitialRender is\n * already false.\n */\n let wasReset = false\n\n /**\n * This function will be used to reduce the animation definitions for\n * each active animation type into an object of resolved values for it.\n */\n const buildResolvedTypeValues =\n (type: AnimationType) =>\n (\n acc: { [key: string]: any },\n definition: string | TargetAndTransition | undefined\n ) => {\n const resolved = resolveVariant(\n visualElement,\n definition,\n type === \"exit\"\n ? visualElement.presenceContext?.custom\n : undefined\n )\n\n if (resolved) {\n const { transition, transitionEnd, ...target } = resolved\n acc = { ...acc, ...target, ...transitionEnd }\n }\n\n return acc\n }\n\n /**\n * This just allows us to inject mocked animation functions\n * @internal\n */\n function setAnimateFunction(\n makeAnimator: (visualElement: any) => AnimateFunction\n ) {\n animate = makeAnimator(visualElement)\n }\n\n /**\n * When we receive new props, we need to:\n * 1. Create a list of protected keys for each type. This is a directory of\n * value keys that are currently being \"handled\" by types of a higher priority\n * so that whenever an animation is played of a given type, these values are\n * protected from being animated.\n * 2. Determine if an animation type needs animating.\n * 3. Determine if any values have been removed from a type and figure out\n * what to animate those to.\n */\n function animateChanges(changedActiveType?: AnimationType) {\n const { props } = visualElement\n const context = getVariantContext(visualElement.parent) || {}\n\n /**\n * A list of animations that we'll build into as we iterate through the animation\n * types. This will get executed at the end of the function.\n */\n const animations: DefinitionAndOptions[] = []\n\n /**\n * Keep track of which values have been removed. Then, as we hit lower priority\n * animation types, we can check if they contain removed values and animate to that.\n */\n const removedKeys = new Set()\n\n /**\n * A dictionary of all encountered keys. This is an object to let us build into and\n * copy it without iteration. Each time we hit an animation type we set its protected\n * keys - the keys its not allowed to animate - to the latest version of this object.\n */\n let encounteredKeys: { [key: string]: any } = {}\n\n /**\n * If a variant has been removed at a given index, and this component is controlling\n * variant animations, we want to ensure lower-priority variants are forced to animate.\n */\n let removedVariantIndex = Infinity\n\n /**\n * Iterate through all animation types in reverse priority order. For each, we want to\n * detect which values it's handling and whether or not they've changed (and therefore\n * need to be animated). If any values have been removed, we want to detect those in\n * lower priority props and flag for animation.\n */\n for (let i = 0; i < numAnimationTypes; i++) {\n const type = reversePriorityOrder[i]\n const typeState = state[type]\n const prop =\n props[type] !== undefined\n ? props[type]\n : context[type as keyof typeof context]\n const propIsVariant = isVariantLabel(prop)\n\n /**\n * If this type has *just* changed isActive status, set activeDelta\n * to that status. Otherwise set to null.\n */\n const activeDelta =\n type === changedActiveType ? typeState.isActive : null\n\n if (activeDelta === false) removedVariantIndex = i\n\n /**\n * If this prop is an inherited variant, rather than been set directly on the\n * component itself, we want to make sure we allow the parent to trigger animations.\n *\n * TODO: Can probably change this to a !isControllingVariants check\n */\n let isInherited =\n prop === context[type as keyof typeof context] &&\n prop !== props[type] &&\n propIsVariant\n\n if (\n isInherited &&\n (isInitialRender || wasReset) &&\n visualElement.manuallyAnimateOnMount\n ) {\n isInherited = false\n }\n\n /**\n * Set all encountered keys so far as the protected keys for this type. This will\n * be any key that has been animated or otherwise handled by active, higher-priortiy types.\n */\n typeState.protectedKeys = { ...encounteredKeys }\n\n // Check if we can skip analysing this prop early\n if (\n // If it isn't active and hasn't *just* been set as inactive\n (!typeState.isActive && activeDelta === null) ||\n // If we didn't and don't have any defined prop for this animation type\n (!prop && !typeState.prevProp) ||\n // Or if the prop doesn't define an animation\n isAnimationControls(prop) ||\n typeof prop === \"boolean\"\n ) {\n continue\n }\n\n /**\n * If exit is already active and wasn't just activated, skip\n * re-processing to prevent interrupting running exit animations.\n * Re-resolving exit with a changed custom value can start new\n * value animations that stop the originals, leaving the exit\n * animation promise unresolved and the component stuck in the DOM.\n */\n if (type === \"exit\" && typeState.isActive && activeDelta !== true) {\n if (typeState.prevResolvedValues) {\n encounteredKeys = {\n ...encounteredKeys,\n ...typeState.prevResolvedValues,\n }\n }\n continue\n }\n\n /**\n * As we go look through the values defined on this type, if we detect\n * a changed value or a value that was removed in a higher priority, we set\n * this to true and add this prop to the animation list.\n */\n const variantDidChange = checkVariantsDidChange(\n typeState.prevProp,\n prop\n )\n\n let shouldAnimateType =\n variantDidChange ||\n // If we're making this variant active, we want to always make it active\n (type === changedActiveType &&\n typeState.isActive &&\n !isInherited &&\n propIsVariant) ||\n // If we removed a higher-priority variant (i is in reverse order)\n (i > removedVariantIndex && propIsVariant)\n\n let handledRemovedValues = false\n\n /**\n * As animations can be set as variant lists, variants or target objects, we\n * coerce everything to an array if it isn't one already\n */\n const definitionList = Array.isArray(prop) ? prop : [prop]\n\n /**\n * Build an object of all the resolved values. We'll use this in the subsequent\n * animateChanges calls to determine whether a value has changed.\n */\n let resolvedValues = definitionList.reduce(\n buildResolvedTypeValues(type),\n {}\n )\n\n if (activeDelta === false) resolvedValues = {}\n\n /**\n * Now we need to loop through all the keys in the prev prop and this prop,\n * and decide:\n * 1. If the value has changed, and needs animating\n * 2. If it has been removed, and needs adding to the removedKeys set\n * 3. If it has been removed in a higher priority type and needs animating\n * 4. If it hasn't been removed in a higher priority but hasn't changed, and\n * needs adding to the type's protectedKeys list.\n */\n const { prevResolvedValues = {} } = typeState\n\n const allKeys = {\n ...prevResolvedValues,\n ...resolvedValues,\n }\n const markToAnimate = (key: string) => {\n shouldAnimateType = true\n if (removedKeys.has(key)) {\n handledRemovedValues = true\n removedKeys.delete(key)\n }\n typeState.needsAnimating[key] = true\n\n const motionValue = visualElement.getValue(key)\n if (motionValue) motionValue.liveStyle = false\n }\n\n for (const key in allKeys) {\n const next = resolvedValues[key]\n const prev = prevResolvedValues[key]\n\n // If we've already handled this we can just skip ahead\n if (encounteredKeys.hasOwnProperty(key)) continue\n\n /**\n * If the value has changed, we probably want to animate it.\n */\n let valueHasChanged = false\n if (isKeyframesTarget(next) && isKeyframesTarget(prev)) {\n valueHasChanged =\n !shallowCompare(next, prev) || variantDidChange\n } else {\n valueHasChanged = next !== prev\n }\n\n if (valueHasChanged) {\n if (next !== undefined && next !== null) {\n // If next is defined and doesn't equal prev, it needs animating\n markToAnimate(key)\n } else {\n // If it's undefined, it's been removed.\n removedKeys.add(key)\n }\n } else if (next !== undefined && removedKeys.has(key)) {\n /**\n * If next hasn't changed and it isn't undefined, we want to check if it's\n * been removed by a higher priority\n */\n markToAnimate(key)\n } else {\n /**\n * If it hasn't changed, we add it to the list of protected values\n * to ensure it doesn't get animated.\n */\n typeState.protectedKeys[key] = true\n }\n }\n\n /**\n * Update the typeState so next time animateChanges is called we can compare the\n * latest prop and resolvedValues to these.\n */\n typeState.prevProp = prop\n typeState.prevResolvedValues = resolvedValues\n\n if (typeState.isActive) {\n encounteredKeys = { ...encounteredKeys, ...resolvedValues }\n }\n\n if (\n (isInitialRender || wasReset) &&\n visualElement.blockInitialAnimation\n ) {\n shouldAnimateType = false\n }\n\n /**\n * If this is an inherited prop we want to skip this animation\n * unless the inherited variants haven't changed on this render.\n */\n const willAnimateViaParent = isInherited && variantDidChange\n const needsAnimating = !willAnimateViaParent || handledRemovedValues\n if (shouldAnimateType && needsAnimating) {\n animations.push(\n ...definitionList.map((animation) => {\n const options: VisualElementAnimationOptions = { type }\n\n /**\n * If we're performing the initial animation, but we're not\n * rendering at the same time as the variant-controlling parent,\n * we want to use the parent's transition to calculate the stagger.\n */\n if (\n typeof animation === \"string\" &&\n (isInitialRender || wasReset) &&\n !willAnimateViaParent &&\n visualElement.manuallyAnimateOnMount &&\n visualElement.parent\n ) {\n const { parent } = visualElement\n const parentVariant = resolveVariant(\n parent,\n animation\n )\n\n if (parent.enteringChildren && parentVariant) {\n const { delayChildren } =\n parentVariant.transition || {}\n options.delay = calcChildStagger(\n parent.enteringChildren,\n visualElement,\n delayChildren\n )\n }\n }\n\n return {\n animation: animation as AnimationDefinition,\n options,\n }\n })\n )\n }\n }\n\n /**\n * If there are some removed value that haven't been dealt with,\n * we need to create a new animation that falls back either to the value\n * defined in the style prop, or the last read value.\n */\n if (removedKeys.size) {\n const fallbackAnimation: TargetAndTransition = {}\n\n /**\n * If the initial prop contains a transition we can use that, otherwise\n * allow the animation function to use the visual element's default.\n */\n if (typeof props.initial !== \"boolean\") {\n const initialTransition = resolveVariant(\n visualElement,\n Array.isArray(props.initial)\n ? props.initial[0]\n : props.initial\n )\n\n if (initialTransition && initialTransition.transition) {\n fallbackAnimation.transition = initialTransition.transition\n }\n }\n\n removedKeys.forEach((key) => {\n const fallbackTarget = visualElement.getBaseTarget(key)\n\n const motionValue = visualElement.getValue(key)\n if (motionValue) motionValue.liveStyle = true\n\n // @ts-expect-error - @mattgperry to figure if we should do something here\n fallbackAnimation[key] = fallbackTarget ?? null\n })\n\n animations.push({ animation: fallbackAnimation })\n }\n\n let shouldAnimate = Boolean(animations.length)\n\n if (\n isInitialRender &&\n (props.initial === false || props.initial === props.animate) &&\n !visualElement.manuallyAnimateOnMount\n ) {\n shouldAnimate = false\n }\n\n isInitialRender = false\n wasReset = false\n return shouldAnimate ? animate(animations) : Promise.resolve()\n }\n\n /**\n * Change whether a certain animation type is active.\n */\n function setActive(type: AnimationType, isActive: boolean) {\n // If the active state hasn't changed, we can safely do nothing here\n if (state[type].isActive === isActive) return Promise.resolve()\n\n // Propagate active change to children\n visualElement.variantChildren?.forEach((child: any) =>\n child.animationState?.setActive(type, isActive)\n )\n\n state[type].isActive = isActive\n\n const animations = animateChanges(type)\n\n for (const key in state) {\n state[key as keyof typeof state].protectedKeys = {}\n }\n\n return animations\n }\n\n return {\n animateChanges,\n setActive,\n setAnimateFunction,\n getState: () => state,\n reset: () => {\n state = createState()\n wasReset = true\n },\n }\n}\n\nexport function checkVariantsDidChange(prev: any, next: any) {\n if (typeof next === \"string\") {\n return next !== prev\n } else if (Array.isArray(next)) {\n return !shallowCompare(next, prev)\n }\n\n return false\n}\n\nexport interface AnimationTypeState {\n isActive: boolean\n protectedKeys: { [key: string]: true }\n needsAnimating: { [key: string]: boolean }\n prevResolvedValues: { [key: string]: any }\n prevProp?: VariantLabels | TargetAndTransition\n}\n\nfunction createTypeState(isActive = false): AnimationTypeState {\n return {\n isActive,\n protectedKeys: {},\n needsAnimating: {},\n prevResolvedValues: {},\n }\n}\n\nfunction createState() {\n return {\n animate: createTypeState(true),\n whileInView: createTypeState(),\n whileHover: createTypeState(),\n whileTap: createTypeState(),\n whileDrag: createTypeState(),\n whileFocus: createTypeState(),\n exit: createTypeState(),\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;AAsCA,MAAM,oBAAoB,GAAG,CAAC,GAAG,oBAAoB,CAAC,CAAC,OAAO,EAAE;AAChE,MAAM,iBAAiB,GAAG,oBAAoB,CAAC,MAAM;AAQrD,SAAS,qBAAqB,CAAC,aAAkB,EAAA;IAC7C,OAAO,CAAC,UAAkC,KAAI;QAC1C,OAAO,OAAO,CAAC,GAAG,CACd,UAAU,CAAC,GAAG,CAAC,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,KAClC,oBAAoB,CAAC,aAAa,EAAE,SAAS,EAAE,OAAO,CAAC,CAC1D,CACJ;AACL,IAAA,CAAC;AACL;AAEM,SAAU,oBAAoB,CAAC,aAAkB,EAAA;AACnD,IAAA,IAAI,OAAO,GAAG,qBAAqB,CAAC,aAAa,CAAC;AAClD,IAAA,IAAI,KAAK,GAAG,WAAW,EAAE;IACzB,IAAI,eAAe,GAAG,IAAI;AAC1B;;;;;;AAMG;IACH,IAAI,QAAQ,GAAG,KAAK;AAEpB;;;AAGG;AACH,IAAA,MAAM,uBAAuB,GACzB,CAAC,IAAmB,KACpB,CACI,GAA2B,EAC3B,UAAoD,KACpD;QACA,MAAM,QAAQ,GAAG,cAAc,CAC3B,aAAa,EACb,UAAU,EACV,IAAI,KAAK;AACL,cAAE,aAAa,CAAC,eAAe,EAAE;cAC/B,SAAS,CAClB;QAED,IAAI,QAAQ,EAAE;YACV,MAAM,EAAE,UAAU,EAAE,aAAa,EAAE,GAAG,MAAM,EAAE,GAAG,QAAQ;YACzD,GAAG,GAAG,EAAE,GAAG,GAAG,EAAE,GAAG,MAAM,EAAE,GAAG,aAAa,EAAE;QACjD;AAEA,QAAA,OAAO,GAAG;AACd,IAAA,CAAC;AAEL;;;AAGG;IACH,SAAS,kBAAkB,CACvB,YAAqD,EAAA;AAErD,QAAA,OAAO,GAAG,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SAAA,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;AAC5B,QAAA,OAAO,CAAC,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC;IACtC;AAEA,IAAA,OAAO,KAAK;AAChB;AAUA,SAAS,eAAe,CAAC,QAAQ,GAAG,KAAK,EAAA;IACrC,OAAO;QACH,QAAQ;AACR,QAAA,aAAa,EAAE,EAAE;AACjB,QAAA,cAAc,EAAE,EAAE;AAClB,QAAA,kBAAkB,EAAE,EAAE;KACzB;AACL;AAEA,SAAS,WAAW,GAAA;IAChB,OAAO;AACH,QAAA,OAAO,EAAE,eAAe,CAAC,IAAI,CAAC;QAC9B,WAAW,EAAE,eAAe,EAAE;QAC9B,UAAU,EAAE,eAAe,EAAE;QAC7B,QAAQ,EAAE,eAAe,EAAE;QAC3B,SAAS,EAAE,eAAe,EAAE;QAC5B,UAAU,EAAE,eAAe,EAAE;QAC7B,IAAI,EAAE,eAAe,EAAE;KAC1B;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/utils/get-variant-context.mjs b/node_modules/motion-dom/dist/es/render/utils/get-variant-context.mjs deleted file mode 100644 index 6866d11..0000000 --- a/node_modules/motion-dom/dist/es/render/utils/get-variant-context.mjs +++ /dev/null @@ -1,33 +0,0 @@ -import { isVariantLabel } from './is-variant-label.mjs'; -import { variantProps } from './variant-props.mjs'; - -const numVariantProps = variantProps.length; -/** - * Get variant context from a visual element's parent chain. - * Uses `any` type for visualElement to avoid circular dependencies. - */ -function getVariantContext(visualElement) { - if (!visualElement) - return undefined; - if (!visualElement.isControllingVariants) { - const context = visualElement.parent - ? getVariantContext(visualElement.parent) || {} - : {}; - if (visualElement.props.initial !== undefined) { - context.initial = visualElement.props.initial; - } - return context; - } - const context = {}; - for (let i = 0; i < numVariantProps; i++) { - const name = variantProps[i]; - const prop = visualElement.props[name]; - if (isVariantLabel(prop) || prop === false) { - context[name] = prop; - } - } - return context; -} - -export { getVariantContext }; -//# sourceMappingURL=get-variant-context.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/utils/get-variant-context.mjs.map b/node_modules/motion-dom/dist/es/render/utils/get-variant-context.mjs.map deleted file mode 100644 index 08e36cd..0000000 --- a/node_modules/motion-dom/dist/es/render/utils/get-variant-context.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"get-variant-context.mjs","sources":["../../../../src/render/utils/get-variant-context.ts"],"sourcesContent":["import { isVariantLabel } from \"./is-variant-label\"\nimport { variantProps } from \"./variant-props\"\n\nconst numVariantProps = variantProps.length\n\ntype VariantStateContext = {\n initial?: string | string[]\n animate?: string | string[]\n exit?: string | string[]\n whileHover?: string | string[]\n whileDrag?: string | string[]\n whileFocus?: string | string[]\n whileTap?: string | string[]\n}\n\n/**\n * Get variant context from a visual element's parent chain.\n * Uses `any` type for visualElement to avoid circular dependencies.\n */\nexport function getVariantContext(\n visualElement?: any\n): undefined | VariantStateContext {\n if (!visualElement) return undefined\n\n if (!visualElement.isControllingVariants) {\n const context = visualElement.parent\n ? getVariantContext(visualElement.parent) || {}\n : {}\n if (visualElement.props.initial !== undefined) {\n context.initial = visualElement.props.initial as any\n }\n return context\n }\n\n const context: VariantStateContext = {}\n for (let i = 0; i < numVariantProps; i++) {\n const name = variantProps[i] as keyof typeof context\n const prop = visualElement.props[name]\n\n if (isVariantLabel(prop) || prop === false) {\n ;(context as any)[name] = prop\n }\n }\n\n return context\n}\n"],"names":[],"mappings":";;;AAGA,MAAM,eAAe,GAAG,YAAY,CAAC,MAAM;AAY3C;;;AAGG;AACG,SAAU,iBAAiB,CAC7B,aAAmB,EAAA;AAEnB,IAAA,IAAI,CAAC,aAAa;AAAE,QAAA,OAAO,SAAS;AAEpC,IAAA,IAAI,CAAC,aAAa,CAAC,qBAAqB,EAAE;AACtC,QAAA,MAAM,OAAO,GAAG,aAAa,CAAC;cACxB,iBAAiB,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI;cAC3C,EAAE;QACR,IAAI,aAAa,CAAC,KAAK,CAAC,OAAO,KAAK,SAAS,EAAE;YAC3C,OAAO,CAAC,OAAO,GAAG,aAAa,CAAC,KAAK,CAAC,OAAc;QACxD;AACA,QAAA,OAAO,OAAO;IAClB;IAEA,MAAM,OAAO,GAAwB,EAAE;AACvC,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,eAAe,EAAE,CAAC,EAAE,EAAE;AACtC,QAAA,MAAM,IAAI,GAAG,YAAY,CAAC,CAAC,CAAyB;QACpD,MAAM,IAAI,GAAG,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC;QAEtC,IAAI,cAAc,CAAC,IAAI,CAAC,IAAI,IAAI,KAAK,KAAK,EAAE;AACtC,YAAA,OAAe,CAAC,IAAI,CAAC,GAAG,IAAI;QAClC;IACJ;AAEA,IAAA,OAAO,OAAO;AAClB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/utils/is-animation-controls.mjs b/node_modules/motion-dom/dist/es/render/utils/is-animation-controls.mjs deleted file mode 100644 index 17f587f..0000000 --- a/node_modules/motion-dom/dist/es/render/utils/is-animation-controls.mjs +++ /dev/null @@ -1,8 +0,0 @@ -function isAnimationControls(v) { - return (v !== null && - typeof v === "object" && - typeof v.start === "function"); -} - -export { isAnimationControls }; -//# sourceMappingURL=is-animation-controls.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/utils/is-animation-controls.mjs.map b/node_modules/motion-dom/dist/es/render/utils/is-animation-controls.mjs.map deleted file mode 100644 index 985f804..0000000 --- a/node_modules/motion-dom/dist/es/render/utils/is-animation-controls.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"is-animation-controls.mjs","sources":["../../../../src/render/utils/is-animation-controls.ts"],"sourcesContent":["import type { LegacyAnimationControls } from \"../../node/types\"\n\nexport function isAnimationControls(v?: unknown): v is LegacyAnimationControls {\n return (\n v !== null &&\n typeof v === \"object\" &&\n typeof (v as LegacyAnimationControls).start === \"function\"\n )\n}\n"],"names":[],"mappings":"AAEM,SAAU,mBAAmB,CAAC,CAAW,EAAA;IAC3C,QACI,CAAC,KAAK,IAAI;QACV,OAAO,CAAC,KAAK,QAAQ;AACrB,QAAA,OAAQ,CAA6B,CAAC,KAAK,KAAK,UAAU;AAElE;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/utils/is-controlling-variants.mjs b/node_modules/motion-dom/dist/es/render/utils/is-controlling-variants.mjs deleted file mode 100644 index 724ace7..0000000 --- a/node_modules/motion-dom/dist/es/render/utils/is-controlling-variants.mjs +++ /dev/null @@ -1,14 +0,0 @@ -import { isAnimationControls } from './is-animation-controls.mjs'; -import { isVariantLabel } from './is-variant-label.mjs'; -import { variantProps } from './variant-props.mjs'; - -function isControllingVariants(props) { - return (isAnimationControls(props.animate) || - variantProps.some((name) => isVariantLabel(props[name]))); -} -function isVariantNode(props) { - return Boolean(isControllingVariants(props) || props.variants); -} - -export { isControllingVariants, isVariantNode }; -//# sourceMappingURL=is-controlling-variants.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/utils/is-controlling-variants.mjs.map b/node_modules/motion-dom/dist/es/render/utils/is-controlling-variants.mjs.map deleted file mode 100644 index 8476a49..0000000 --- a/node_modules/motion-dom/dist/es/render/utils/is-controlling-variants.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"is-controlling-variants.mjs","sources":["../../../../src/render/utils/is-controlling-variants.ts"],"sourcesContent":["import type { MotionNodeOptions } from \"../../node/types\"\nimport { isAnimationControls } from \"./is-animation-controls\"\nimport { isVariantLabel } from \"./is-variant-label\"\nimport { variantProps } from \"./variant-props\"\n\nexport function isControllingVariants(props: MotionNodeOptions) {\n return (\n isAnimationControls(props.animate) ||\n variantProps.some((name) =>\n isVariantLabel(props[name as keyof typeof props])\n )\n )\n}\n\nexport function isVariantNode(props: MotionNodeOptions) {\n return Boolean(isControllingVariants(props) || props.variants)\n}\n"],"names":[],"mappings":";;;;AAKM,SAAU,qBAAqB,CAAC,KAAwB,EAAA;AAC1D,IAAA,QACI,mBAAmB,CAAC,KAAK,CAAC,OAAO,CAAC;AAClC,QAAA,YAAY,CAAC,IAAI,CAAC,CAAC,IAAI,KACnB,cAAc,CAAC,KAAK,CAAC,IAA0B,CAAC,CAAC,CACpD;AAET;AAEM,SAAU,aAAa,CAAC,KAAwB,EAAA;IAClD,OAAO,OAAO,CAAC,qBAAqB,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC;AAClE;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/utils/is-forced-motion-value.mjs b/node_modules/motion-dom/dist/es/render/utils/is-forced-motion-value.mjs deleted file mode 100644 index e9bb0bd..0000000 --- a/node_modules/motion-dom/dist/es/render/utils/is-forced-motion-value.mjs +++ /dev/null @@ -1,13 +0,0 @@ -import { transformProps } from './keys-transform.mjs'; -import { scaleCorrectors } from '../../projection/styles/scale-correction.mjs'; -export { addScaleCorrector } from '../../projection/styles/scale-correction.mjs'; - -function isForcedMotionValue(key, { layout, layoutId }) { - return (transformProps.has(key) || - key.startsWith("origin") || - ((layout || layoutId !== undefined) && - (!!scaleCorrectors[key] || key === "opacity"))); -} - -export { isForcedMotionValue, scaleCorrectors }; -//# sourceMappingURL=is-forced-motion-value.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/utils/is-forced-motion-value.mjs.map b/node_modules/motion-dom/dist/es/render/utils/is-forced-motion-value.mjs.map deleted file mode 100644 index 5ecd4e6..0000000 --- a/node_modules/motion-dom/dist/es/render/utils/is-forced-motion-value.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"is-forced-motion-value.mjs","sources":["../../../../src/render/utils/is-forced-motion-value.ts"],"sourcesContent":["import { transformProps } from \"./keys-transform\"\nimport type { MotionNodeOptions } from \"../../node/types\"\nimport {\n scaleCorrectors,\n addScaleCorrector,\n} from \"../../projection/styles/scale-correction\"\n\nexport { scaleCorrectors, addScaleCorrector }\n\nexport function isForcedMotionValue(\n key: string,\n { layout, layoutId }: MotionNodeOptions\n) {\n return (\n transformProps.has(key) ||\n key.startsWith(\"origin\") ||\n ((layout || layoutId !== undefined) &&\n (!!scaleCorrectors[key] || key === \"opacity\"))\n )\n}\n"],"names":[],"mappings":";;;;AASM,SAAU,mBAAmB,CAC/B,GAAW,EACX,EAAE,MAAM,EAAE,QAAQ,EAAqB,EAAA;AAEvC,IAAA,QACI,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC;AACvB,QAAA,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC;AACxB,SAAC,CAAC,MAAM,IAAI,QAAQ,KAAK,SAAS;AAC9B,aAAC,CAAC,CAAC,eAAe,CAAC,GAAG,CAAC,IAAI,GAAG,KAAK,SAAS,CAAC,CAAC;AAE1D;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/utils/is-keyframes-target.mjs b/node_modules/motion-dom/dist/es/render/utils/is-keyframes-target.mjs deleted file mode 100644 index 9e01dbe..0000000 --- a/node_modules/motion-dom/dist/es/render/utils/is-keyframes-target.mjs +++ /dev/null @@ -1,6 +0,0 @@ -const isKeyframesTarget = (v) => { - return Array.isArray(v); -}; - -export { isKeyframesTarget }; -//# sourceMappingURL=is-keyframes-target.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/utils/is-keyframes-target.mjs.map b/node_modules/motion-dom/dist/es/render/utils/is-keyframes-target.mjs.map deleted file mode 100644 index 7c69a6a..0000000 --- a/node_modules/motion-dom/dist/es/render/utils/is-keyframes-target.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"is-keyframes-target.mjs","sources":["../../../../src/render/utils/is-keyframes-target.ts"],"sourcesContent":["import type { UnresolvedValueKeyframe, ValueKeyframesDefinition } from \"../../animation/types\"\n\nexport const isKeyframesTarget = (\n v: ValueKeyframesDefinition\n): v is UnresolvedValueKeyframe[] => {\n return Array.isArray(v)\n}\n"],"names":[],"mappings":"AAEO,MAAM,iBAAiB,GAAG,CAC7B,CAA2B,KACK;AAChC,IAAA,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AAC3B;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/utils/is-variant-label.mjs b/node_modules/motion-dom/dist/es/render/utils/is-variant-label.mjs deleted file mode 100644 index 1064983..0000000 --- a/node_modules/motion-dom/dist/es/render/utils/is-variant-label.mjs +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Decides if the supplied variable is variant label - */ -function isVariantLabel(v) { - return typeof v === "string" || Array.isArray(v); -} - -export { isVariantLabel }; -//# sourceMappingURL=is-variant-label.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/utils/is-variant-label.mjs.map b/node_modules/motion-dom/dist/es/render/utils/is-variant-label.mjs.map deleted file mode 100644 index 154c8c7..0000000 --- a/node_modules/motion-dom/dist/es/render/utils/is-variant-label.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"is-variant-label.mjs","sources":["../../../../src/render/utils/is-variant-label.ts"],"sourcesContent":["/**\n * Decides if the supplied variable is variant label\n */\nexport function isVariantLabel(v: unknown): v is string | string[] {\n return typeof v === \"string\" || Array.isArray(v)\n}\n"],"names":[],"mappings":"AAAA;;AAEG;AACG,SAAU,cAAc,CAAC,CAAU,EAAA;IACrC,OAAO,OAAO,CAAC,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AACpD;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/utils/keys-position.mjs b/node_modules/motion-dom/dist/es/render/utils/keys-position.mjs deleted file mode 100644 index d000529..0000000 --- a/node_modules/motion-dom/dist/es/render/utils/keys-position.mjs +++ /dev/null @@ -1,14 +0,0 @@ -import { transformPropOrder } from './keys-transform.mjs'; - -const positionalKeys = new Set([ - "width", - "height", - "top", - "left", - "right", - "bottom", - ...transformPropOrder, -]); - -export { positionalKeys }; -//# sourceMappingURL=keys-position.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/utils/keys-position.mjs.map b/node_modules/motion-dom/dist/es/render/utils/keys-position.mjs.map deleted file mode 100644 index 12f42fd..0000000 --- a/node_modules/motion-dom/dist/es/render/utils/keys-position.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"keys-position.mjs","sources":["../../../../src/render/utils/keys-position.ts"],"sourcesContent":["import { transformPropOrder } from \"./keys-transform\"\n\nexport const positionalKeys = new Set([\n \"width\",\n \"height\",\n \"top\",\n \"left\",\n \"right\",\n \"bottom\",\n ...transformPropOrder,\n])\n"],"names":[],"mappings":";;AAEO,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC;IAClC,OAAO;IACP,QAAQ;IACR,KAAK;IACL,MAAM;IACN,OAAO;IACP,QAAQ;AACR,IAAA,GAAG,kBAAkB;AACxB,CAAA;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/utils/keys-transform.mjs b/node_modules/motion-dom/dist/es/render/utils/keys-transform.mjs deleted file mode 100644 index 8a2b687..0000000 --- a/node_modules/motion-dom/dist/es/render/utils/keys-transform.mjs +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Generate a list of every possible transform key. - */ -const transformPropOrder = [ - "transformPerspective", - "x", - "y", - "z", - "translateX", - "translateY", - "translateZ", - "scale", - "scaleX", - "scaleY", - "rotate", - "rotateX", - "rotateY", - "rotateZ", - "skew", - "skewX", - "skewY", -]; -/** - * A quick lookup for transform props. - * - * `pathRotation` is a transform for routing purposes (skipped from raw - * style application, wired to the transform composite, flags transform - * dirty) but is intentionally NOT in `transformPropOrder` — it is - * composed onto `rotate` at the build sites, not serialized in its own - * slot, and must stay out of the order-array consumers (parse-transform, - * unit-conversion, keys-position). - */ -const transformProps = /*@__PURE__*/ (() => new Set([...transformPropOrder, "pathRotation"]))(); - -export { transformPropOrder, transformProps }; -//# sourceMappingURL=keys-transform.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/utils/keys-transform.mjs.map b/node_modules/motion-dom/dist/es/render/utils/keys-transform.mjs.map deleted file mode 100644 index aec5e45..0000000 --- a/node_modules/motion-dom/dist/es/render/utils/keys-transform.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"keys-transform.mjs","sources":["../../../../src/render/utils/keys-transform.ts"],"sourcesContent":["/**\n * Generate a list of every possible transform key.\n */\nexport const transformPropOrder = [\n \"transformPerspective\",\n \"x\",\n \"y\",\n \"z\",\n \"translateX\",\n \"translateY\",\n \"translateZ\",\n \"scale\",\n \"scaleX\",\n \"scaleY\",\n \"rotate\",\n \"rotateX\",\n \"rotateY\",\n \"rotateZ\",\n \"skew\",\n \"skewX\",\n \"skewY\",\n]\n\n/**\n * A quick lookup for transform props.\n *\n * `pathRotation` is a transform for routing purposes (skipped from raw\n * style application, wired to the transform composite, flags transform\n * dirty) but is intentionally NOT in `transformPropOrder` — it is\n * composed onto `rotate` at the build sites, not serialized in its own\n * slot, and must stay out of the order-array consumers (parse-transform,\n * unit-conversion, keys-position).\n */\nexport const transformProps = /*@__PURE__*/ (() =>\n new Set([...transformPropOrder, \"pathRotation\"]))()\n"],"names":[],"mappings":"AAAA;;AAEG;AACI,MAAM,kBAAkB,GAAG;IAC9B,sBAAsB;IACtB,GAAG;IACH,GAAG;IACH,GAAG;IACH,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,OAAO;IACP,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,SAAS;IACT,SAAS;IACT,SAAS;IACT,MAAM;IACN,OAAO;IACP,OAAO;;AAGX;;;;;;;;;AASG;MACU,cAAc,iBAAiB,CAAC,MACzC,IAAI,GAAG,CAAC,CAAC,GAAG,kBAAkB,EAAE,cAAc,CAAC,CAAC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/utils/motion-values.mjs b/node_modules/motion-dom/dist/es/render/utils/motion-values.mjs deleted file mode 100644 index be01fdf..0000000 --- a/node_modules/motion-dom/dist/es/render/utils/motion-values.mjs +++ /dev/null @@ -1,56 +0,0 @@ -import { motionValue } from '../../value/index.mjs'; -import { isMotionValue } from '../../value/utils/is-motion-value.mjs'; - -/** - * Updates motion values from props changes. - * Uses `any` type for element to avoid circular dependencies with VisualElement. - */ -function updateMotionValuesFromProps(element, next, prev) { - for (const key in next) { - const nextValue = next[key]; - const prevValue = prev[key]; - if (isMotionValue(nextValue)) { - /** - * If this is a motion value found in props or style, we want to add it - * to our visual element's motion value map. - */ - element.addValue(key, nextValue); - } - else if (isMotionValue(prevValue)) { - /** - * If we're swapping from a motion value to a static value, - * create a new motion value from that - */ - element.addValue(key, motionValue(nextValue, { owner: element })); - } - else if (prevValue !== nextValue) { - /** - * If this is a flat value that has changed, update the motion value - * or create one if it doesn't exist. We only want to do this if we're - * not handling the value with our animation state. - */ - if (element.hasValue(key)) { - const existingValue = element.getValue(key); - if (existingValue.liveStyle === true) { - existingValue.jump(nextValue); - } - else if (!existingValue.hasAnimated) { - existingValue.set(nextValue); - } - } - else { - const latestValue = element.getStaticValue(key); - element.addValue(key, motionValue(latestValue !== undefined ? latestValue : nextValue, { owner: element })); - } - } - } - // Handle removed values - for (const key in prev) { - if (next[key] === undefined) - element.removeValue(key); - } - return next; -} - -export { updateMotionValuesFromProps }; -//# sourceMappingURL=motion-values.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/utils/motion-values.mjs.map b/node_modules/motion-dom/dist/es/render/utils/motion-values.mjs.map deleted file mode 100644 index 30b05c5..0000000 --- a/node_modules/motion-dom/dist/es/render/utils/motion-values.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"motion-values.mjs","sources":["../../../../src/render/utils/motion-values.ts"],"sourcesContent":["import { motionValue } from \"../../value\"\nimport { isMotionValue } from \"../../value/utils/is-motion-value\"\n\ntype MotionStyleLike = Record\n\n/**\n * Updates motion values from props changes.\n * Uses `any` type for element to avoid circular dependencies with VisualElement.\n */\nexport function updateMotionValuesFromProps(\n element: any,\n next: MotionStyleLike,\n prev: MotionStyleLike\n) {\n for (const key in next) {\n const nextValue = next[key]\n const prevValue = prev[key]\n\n if (isMotionValue(nextValue)) {\n /**\n * If this is a motion value found in props or style, we want to add it\n * to our visual element's motion value map.\n */\n element.addValue(key, nextValue)\n } else if (isMotionValue(prevValue)) {\n /**\n * If we're swapping from a motion value to a static value,\n * create a new motion value from that\n */\n element.addValue(key, motionValue(nextValue, { owner: element }))\n } else if (prevValue !== nextValue) {\n /**\n * If this is a flat value that has changed, update the motion value\n * or create one if it doesn't exist. We only want to do this if we're\n * not handling the value with our animation state.\n */\n if (element.hasValue(key)) {\n const existingValue = element.getValue(key)!\n\n if (existingValue.liveStyle === true) {\n existingValue.jump(nextValue)\n } else if (!existingValue.hasAnimated) {\n existingValue.set(nextValue)\n }\n } else {\n const latestValue = element.getStaticValue(key)\n element.addValue(\n key,\n motionValue(\n latestValue !== undefined ? latestValue : nextValue,\n { owner: element }\n )\n )\n }\n }\n }\n\n // Handle removed values\n for (const key in prev) {\n if (next[key] === undefined) element.removeValue(key)\n }\n\n return next\n}\n"],"names":[],"mappings":";;;AAKA;;;AAGG;SACa,2BAA2B,CACvC,OAAY,EACZ,IAAqB,EACrB,IAAqB,EAAA;AAErB,IAAA,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE;AACpB,QAAA,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC;AAC3B,QAAA,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC;AAE3B,QAAA,IAAI,aAAa,CAAC,SAAS,CAAC,EAAE;AAC1B;;;AAGG;AACH,YAAA,OAAO,CAAC,QAAQ,CAAC,GAAG,EAAE,SAAS,CAAC;QACpC;AAAO,aAAA,IAAI,aAAa,CAAC,SAAS,CAAC,EAAE;AACjC;;;AAGG;AACH,YAAA,OAAO,CAAC,QAAQ,CAAC,GAAG,EAAE,WAAW,CAAC,SAAS,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC;QACrE;AAAO,aAAA,IAAI,SAAS,KAAK,SAAS,EAAE;AAChC;;;;AAIG;AACH,YAAA,IAAI,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;gBACvB,MAAM,aAAa,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAE;AAE5C,gBAAA,IAAI,aAAa,CAAC,SAAS,KAAK,IAAI,EAAE;AAClC,oBAAA,aAAa,CAAC,IAAI,CAAC,SAAS,CAAC;gBACjC;AAAO,qBAAA,IAAI,CAAC,aAAa,CAAC,WAAW,EAAE;AACnC,oBAAA,aAAa,CAAC,GAAG,CAAC,SAAS,CAAC;gBAChC;YACJ;iBAAO;gBACH,MAAM,WAAW,GAAG,OAAO,CAAC,cAAc,CAAC,GAAG,CAAC;gBAC/C,OAAO,CAAC,QAAQ,CACZ,GAAG,EACH,WAAW,CACP,WAAW,KAAK,SAAS,GAAG,WAAW,GAAG,SAAS,EACnD,EAAE,KAAK,EAAE,OAAO,EAAE,CACrB,CACJ;YACL;QACJ;IACJ;;AAGA,IAAA,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE;AACpB,QAAA,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,SAAS;AAAE,YAAA,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC;IACzD;AAEA,IAAA,OAAO,IAAI;AACf;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/utils/reduced-motion/index.mjs b/node_modules/motion-dom/dist/es/render/utils/reduced-motion/index.mjs deleted file mode 100644 index a9550a2..0000000 --- a/node_modules/motion-dom/dist/es/render/utils/reduced-motion/index.mjs +++ /dev/null @@ -1,20 +0,0 @@ -import { hasReducedMotionListener, prefersReducedMotion } from './state.mjs'; - -const isBrowser = typeof window !== "undefined"; -function initPrefersReducedMotion() { - hasReducedMotionListener.current = true; - if (!isBrowser) - return; - if (window.matchMedia) { - const motionMediaQuery = window.matchMedia("(prefers-reduced-motion)"); - const setReducedMotionPreferences = () => (prefersReducedMotion.current = motionMediaQuery.matches); - motionMediaQuery.addEventListener("change", setReducedMotionPreferences); - setReducedMotionPreferences(); - } - else { - prefersReducedMotion.current = false; - } -} - -export { hasReducedMotionListener, initPrefersReducedMotion, prefersReducedMotion }; -//# sourceMappingURL=index.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/utils/reduced-motion/index.mjs.map b/node_modules/motion-dom/dist/es/render/utils/reduced-motion/index.mjs.map deleted file mode 100644 index 2fb891c..0000000 --- a/node_modules/motion-dom/dist/es/render/utils/reduced-motion/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs","sources":["../../../../../src/render/utils/reduced-motion/index.ts"],"sourcesContent":["import { hasReducedMotionListener, prefersReducedMotion } from \"./state\"\n\nconst isBrowser = typeof window !== \"undefined\"\n\nexport function initPrefersReducedMotion() {\n hasReducedMotionListener.current = true\n if (!isBrowser) return\n\n if (window.matchMedia) {\n const motionMediaQuery = window.matchMedia(\"(prefers-reduced-motion)\")\n\n const setReducedMotionPreferences = () =>\n (prefersReducedMotion.current = motionMediaQuery.matches)\n\n motionMediaQuery.addEventListener(\"change\", setReducedMotionPreferences)\n\n setReducedMotionPreferences()\n } else {\n prefersReducedMotion.current = false\n }\n}\n\nexport { prefersReducedMotion, hasReducedMotionListener }\n"],"names":[],"mappings":";;AAEA,MAAM,SAAS,GAAG,OAAO,MAAM,KAAK,WAAW;SAE/B,wBAAwB,GAAA;AACpC,IAAA,wBAAwB,CAAC,OAAO,GAAG,IAAI;AACvC,IAAA,IAAI,CAAC,SAAS;QAAE;AAEhB,IAAA,IAAI,MAAM,CAAC,UAAU,EAAE;QACnB,MAAM,gBAAgB,GAAG,MAAM,CAAC,UAAU,CAAC,0BAA0B,CAAC;AAEtE,QAAA,MAAM,2BAA2B,GAAG,OAC/B,oBAAoB,CAAC,OAAO,GAAG,gBAAgB,CAAC,OAAO,CAAC;AAE7D,QAAA,gBAAgB,CAAC,gBAAgB,CAAC,QAAQ,EAAE,2BAA2B,CAAC;AAExE,QAAA,2BAA2B,EAAE;IACjC;SAAO;AACH,QAAA,oBAAoB,CAAC,OAAO,GAAG,KAAK;IACxC;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/utils/reduced-motion/state.mjs b/node_modules/motion-dom/dist/es/render/utils/reduced-motion/state.mjs deleted file mode 100644 index c846f8f..0000000 --- a/node_modules/motion-dom/dist/es/render/utils/reduced-motion/state.mjs +++ /dev/null @@ -1,6 +0,0 @@ -// Does this device prefer reduced motion? Returns `null` server-side. -const prefersReducedMotion = { current: null }; -const hasReducedMotionListener = { current: false }; - -export { hasReducedMotionListener, prefersReducedMotion }; -//# sourceMappingURL=state.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/utils/reduced-motion/state.mjs.map b/node_modules/motion-dom/dist/es/render/utils/reduced-motion/state.mjs.map deleted file mode 100644 index 33df383..0000000 --- a/node_modules/motion-dom/dist/es/render/utils/reduced-motion/state.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"state.mjs","sources":["../../../../../src/render/utils/reduced-motion/state.ts"],"sourcesContent":["interface ReducedMotionState {\n current: boolean | null\n}\n\n// Does this device prefer reduced motion? Returns `null` server-side.\nexport const prefersReducedMotion: ReducedMotionState = { current: null }\n\nexport const hasReducedMotionListener = { current: false }\n"],"names":[],"mappings":"AAIA;MACa,oBAAoB,GAAuB,EAAE,OAAO,EAAE,IAAI;MAE1D,wBAAwB,GAAG,EAAE,OAAO,EAAE,KAAK;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/utils/resolve-dynamic-variants.mjs b/node_modules/motion-dom/dist/es/render/utils/resolve-dynamic-variants.mjs deleted file mode 100644 index e7b6fc4..0000000 --- a/node_modules/motion-dom/dist/es/render/utils/resolve-dynamic-variants.mjs +++ /dev/null @@ -1,9 +0,0 @@ -import { resolveVariantFromProps } from './resolve-variants.mjs'; - -function resolveVariant(visualElement, definition, custom) { - const props = visualElement.getProps(); - return resolveVariantFromProps(props, definition, custom !== undefined ? custom : props.custom, visualElement); -} - -export { resolveVariant }; -//# sourceMappingURL=resolve-dynamic-variants.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/utils/resolve-dynamic-variants.mjs.map b/node_modules/motion-dom/dist/es/render/utils/resolve-dynamic-variants.mjs.map deleted file mode 100644 index ceef8b4..0000000 --- a/node_modules/motion-dom/dist/es/render/utils/resolve-dynamic-variants.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"resolve-dynamic-variants.mjs","sources":["../../../../src/render/utils/resolve-dynamic-variants.ts"],"sourcesContent":["import type {\n AnimationDefinition,\n TargetAndTransition,\n TargetResolver,\n} from \"../../node/types\"\nimport { resolveVariantFromProps } from \"./resolve-variants\"\n\n/**\n * Resolves a variant if it's a variant resolver.\n * Uses `any` type for visualElement to avoid circular dependencies.\n */\nexport function resolveVariant(\n visualElement: any,\n definition?: TargetAndTransition | TargetResolver,\n custom?: any\n): TargetAndTransition\nexport function resolveVariant(\n visualElement: any,\n definition?: AnimationDefinition,\n custom?: any\n): TargetAndTransition | undefined\nexport function resolveVariant(\n visualElement: any,\n definition?: AnimationDefinition,\n custom?: any\n) {\n const props = visualElement.getProps()\n return resolveVariantFromProps(\n props,\n definition,\n custom !== undefined ? custom : props.custom,\n visualElement\n )\n}\n"],"names":[],"mappings":";;SAqBgB,cAAc,CAC1B,aAAkB,EAClB,UAAgC,EAChC,MAAY,EAAA;AAEZ,IAAA,MAAM,KAAK,GAAG,aAAa,CAAC,QAAQ,EAAE;IACtC,OAAO,uBAAuB,CAC1B,KAAK,EACL,UAAU,EACV,MAAM,KAAK,SAAS,GAAG,MAAM,GAAG,KAAK,CAAC,MAAM,EAC5C,aAAa,CAChB;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/utils/resolve-variants.mjs b/node_modules/motion-dom/dist/es/render/utils/resolve-variants.mjs deleted file mode 100644 index 61756dd..0000000 --- a/node_modules/motion-dom/dist/es/render/utils/resolve-variants.mjs +++ /dev/null @@ -1,37 +0,0 @@ -function getValueState(visualElement) { - const state = [{}, {}]; - visualElement?.values.forEach((value, key) => { - state[0][key] = value.get(); - state[1][key] = value.getVelocity(); - }); - return state; -} -function resolveVariantFromProps(props, definition, custom, visualElement) { - /** - * If the variant definition is a function, resolve. - */ - if (typeof definition === "function") { - const [current, velocity] = getValueState(visualElement); - definition = definition(custom !== undefined ? custom : props.custom, current, velocity); - } - /** - * If the variant definition is a variant label, or - * the function returned a variant label, resolve. - */ - if (typeof definition === "string") { - definition = props.variants && props.variants[definition]; - } - /** - * At this point we've resolved both functions and variant labels, - * but the resolved variant label might itself have been a function. - * If so, resolve. This can only have returned a valid target object. - */ - if (typeof definition === "function") { - const [current, velocity] = getValueState(visualElement); - definition = definition(custom !== undefined ? custom : props.custom, current, velocity); - } - return definition; -} - -export { resolveVariantFromProps }; -//# sourceMappingURL=resolve-variants.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/utils/resolve-variants.mjs.map b/node_modules/motion-dom/dist/es/render/utils/resolve-variants.mjs.map deleted file mode 100644 index 740741f..0000000 --- a/node_modules/motion-dom/dist/es/render/utils/resolve-variants.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"resolve-variants.mjs","sources":["../../../../src/render/utils/resolve-variants.ts"],"sourcesContent":["import type {\n AnimationDefinition,\n MotionNodeOptions,\n TargetAndTransition,\n TargetResolver,\n} from \"../../node/types\"\nimport type { ResolvedValues } from \"../types\"\n\nfunction getValueState(visualElement?: any): [ResolvedValues, ResolvedValues] {\n const state: [ResolvedValues, ResolvedValues] = [{}, {}]\n\n visualElement?.values.forEach((value: any, key: string) => {\n state[0][key] = value.get()\n state[1][key] = value.getVelocity()\n })\n\n return state\n}\n\nexport function resolveVariantFromProps(\n props: MotionNodeOptions,\n definition: TargetAndTransition | TargetResolver,\n custom?: any,\n visualElement?: any\n): TargetAndTransition\nexport function resolveVariantFromProps(\n props: MotionNodeOptions,\n definition?: AnimationDefinition,\n custom?: any,\n visualElement?: any\n): undefined | TargetAndTransition\nexport function resolveVariantFromProps(\n props: MotionNodeOptions,\n definition?: AnimationDefinition,\n custom?: any,\n visualElement?: any\n) {\n /**\n * If the variant definition is a function, resolve.\n */\n if (typeof definition === \"function\") {\n const [current, velocity] = getValueState(visualElement)\n definition = definition(\n custom !== undefined ? custom : props.custom,\n current,\n velocity\n )\n }\n\n /**\n * If the variant definition is a variant label, or\n * the function returned a variant label, resolve.\n */\n if (typeof definition === \"string\") {\n definition = props.variants && props.variants[definition]\n }\n\n /**\n * At this point we've resolved both functions and variant labels,\n * but the resolved variant label might itself have been a function.\n * If so, resolve. This can only have returned a valid target object.\n */\n if (typeof definition === \"function\") {\n const [current, velocity] = getValueState(visualElement)\n definition = definition(\n custom !== undefined ? custom : props.custom,\n current,\n velocity\n )\n }\n\n return definition\n}\n"],"names":[],"mappings":"AAQA,SAAS,aAAa,CAAC,aAAmB,EAAA;AACtC,IAAA,MAAM,KAAK,GAAqC,CAAC,EAAE,EAAE,EAAE,CAAC;IAExD,aAAa,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,KAAU,EAAE,GAAW,KAAI;QACtD,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,EAAE;QAC3B,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,WAAW,EAAE;AACvC,IAAA,CAAC,CAAC;AAEF,IAAA,OAAO,KAAK;AAChB;AAcM,SAAU,uBAAuB,CACnC,KAAwB,EACxB,UAAgC,EAChC,MAAY,EACZ,aAAmB,EAAA;AAEnB;;AAEG;AACH,IAAA,IAAI,OAAO,UAAU,KAAK,UAAU,EAAE;QAClC,MAAM,CAAC,OAAO,EAAE,QAAQ,CAAC,GAAG,aAAa,CAAC,aAAa,CAAC;QACxD,UAAU,GAAG,UAAU,CACnB,MAAM,KAAK,SAAS,GAAG,MAAM,GAAG,KAAK,CAAC,MAAM,EAC5C,OAAO,EACP,QAAQ,CACX;IACL;AAEA;;;AAGG;AACH,IAAA,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE;QAChC,UAAU,GAAG,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,QAAQ,CAAC,UAAU,CAAC;IAC7D;AAEA;;;;AAIG;AACH,IAAA,IAAI,OAAO,UAAU,KAAK,UAAU,EAAE;QAClC,MAAM,CAAC,OAAO,EAAE,QAAQ,CAAC,GAAG,aAAa,CAAC,aAAa,CAAC;QACxD,UAAU,GAAG,UAAU,CACnB,MAAM,KAAK,SAAS,GAAG,MAAM,GAAG,KAAK,CAAC,MAAM,EAC5C,OAAO,EACP,QAAQ,CACX;IACL;AAEA,IAAA,OAAO,UAAU;AACrB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/utils/setters.mjs b/node_modules/motion-dom/dist/es/render/utils/setters.mjs deleted file mode 100644 index 9c94d6e..0000000 --- a/node_modules/motion-dom/dist/es/render/utils/setters.mjs +++ /dev/null @@ -1,32 +0,0 @@ -import { motionValue } from '../../value/index.mjs'; -import { resolveVariant } from './resolve-dynamic-variants.mjs'; -import { isKeyframesTarget } from './is-keyframes-target.mjs'; - -/** - * Set VisualElement's MotionValue, creating a new MotionValue for it if - * it doesn't exist. - */ -function setMotionValue(visualElement, key, value) { - if (visualElement.hasValue(key)) { - visualElement.getValue(key).set(value); - } - else { - visualElement.addValue(key, motionValue(value)); - } -} -function resolveFinalValueInKeyframes(v) { - // TODO maybe throw if v.length - 1 is placeholder token? - return isKeyframesTarget(v) ? v[v.length - 1] || 0 : v; -} -function setTarget(visualElement, definition) { - const resolved = resolveVariant(visualElement, definition); - let { transitionEnd = {}, transition = {}, ...target } = resolved || {}; - target = { ...target, ...transitionEnd }; - for (const key in target) { - const value = resolveFinalValueInKeyframes(target[key]); - setMotionValue(visualElement, key, value); - } -} - -export { setTarget }; -//# sourceMappingURL=setters.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/utils/setters.mjs.map b/node_modules/motion-dom/dist/es/render/utils/setters.mjs.map deleted file mode 100644 index c7e9915..0000000 --- a/node_modules/motion-dom/dist/es/render/utils/setters.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"setters.mjs","sources":["../../../../src/render/utils/setters.ts"],"sourcesContent":["import { motionValue } from \"../../value\"\nimport { resolveVariant } from \"./resolve-dynamic-variants\"\nimport { isKeyframesTarget } from \"./is-keyframes-target\"\nimport type { AnimationDefinition } from \"../../node/types\"\nimport type {\n AnyResolvedKeyframe,\n UnresolvedValueKeyframe,\n ValueKeyframesDefinition,\n} from \"../../animation/types\"\nimport type { VisualElement } from \"../VisualElement\"\n\n/**\n * Set VisualElement's MotionValue, creating a new MotionValue for it if\n * it doesn't exist.\n */\nfunction setMotionValue(\n visualElement: VisualElement,\n key: string,\n value: AnyResolvedKeyframe\n) {\n if (visualElement.hasValue(key)) {\n visualElement.getValue(key)!.set(value)\n } else {\n visualElement.addValue(key, motionValue(value))\n }\n}\n\nfunction resolveFinalValueInKeyframes(\n v: ValueKeyframesDefinition\n): UnresolvedValueKeyframe {\n // TODO maybe throw if v.length - 1 is placeholder token?\n return isKeyframesTarget(v) ? v[v.length - 1] || 0 : v\n}\n\nexport function setTarget(\n visualElement: VisualElement,\n definition: AnimationDefinition\n) {\n const resolved = resolveVariant(visualElement, definition)\n let { transitionEnd = {}, transition = {}, ...target } = resolved || {}\n\n target = { ...target, ...transitionEnd }\n\n for (const key in target) {\n const value = resolveFinalValueInKeyframes(\n target[key as keyof typeof target] as any\n )\n setMotionValue(visualElement, key, value as AnyResolvedKeyframe)\n }\n}\n"],"names":[],"mappings":";;;;AAWA;;;AAGG;AACH,SAAS,cAAc,CACnB,aAA4B,EAC5B,GAAW,EACX,KAA0B,EAAA;AAE1B,IAAA,IAAI,aAAa,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;QAC7B,aAAa,CAAC,QAAQ,CAAC,GAAG,CAAE,CAAC,GAAG,CAAC,KAAK,CAAC;IAC3C;SAAO;QACH,aAAa,CAAC,QAAQ,CAAC,GAAG,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;IACnD;AACJ;AAEA,SAAS,4BAA4B,CACjC,CAA2B,EAAA;;IAG3B,OAAO,iBAAiB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;AAC1D;AAEM,SAAU,SAAS,CACrB,aAA4B,EAC5B,UAA+B,EAAA;IAE/B,MAAM,QAAQ,GAAG,cAAc,CAAC,aAAa,EAAE,UAAU,CAAC;AAC1D,IAAA,IAAI,EAAE,aAAa,GAAG,EAAE,EAAE,UAAU,GAAG,EAAE,EAAE,GAAG,MAAM,EAAE,GAAG,QAAQ,IAAI,EAAE;IAEvE,MAAM,GAAG,EAAE,GAAG,MAAM,EAAE,GAAG,aAAa,EAAE;AAExC,IAAA,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE;QACtB,MAAM,KAAK,GAAG,4BAA4B,CACtC,MAAM,CAAC,GAA0B,CAAQ,CAC5C;AACD,QAAA,cAAc,CAAC,aAAa,EAAE,GAAG,EAAE,KAA4B,CAAC;IACpE;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/utils/shallow-compare.mjs b/node_modules/motion-dom/dist/es/render/utils/shallow-compare.mjs deleted file mode 100644 index a6bf308..0000000 --- a/node_modules/motion-dom/dist/es/render/utils/shallow-compare.mjs +++ /dev/null @@ -1,15 +0,0 @@ -function shallowCompare(next, prev) { - if (!Array.isArray(prev)) - return false; - const prevLength = prev.length; - if (prevLength !== next.length) - return false; - for (let i = 0; i < prevLength; i++) { - if (prev[i] !== next[i]) - return false; - } - return true; -} - -export { shallowCompare }; -//# sourceMappingURL=shallow-compare.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/utils/shallow-compare.mjs.map b/node_modules/motion-dom/dist/es/render/utils/shallow-compare.mjs.map deleted file mode 100644 index a76ba4e..0000000 --- a/node_modules/motion-dom/dist/es/render/utils/shallow-compare.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"shallow-compare.mjs","sources":["../../../../src/render/utils/shallow-compare.ts"],"sourcesContent":["export function shallowCompare(next: any[], prev: any[] | null) {\n if (!Array.isArray(prev)) return false\n\n const prevLength = prev.length\n\n if (prevLength !== next.length) return false\n\n for (let i = 0; i < prevLength; i++) {\n if (prev[i] !== next[i]) return false\n }\n\n return true\n}\n"],"names":[],"mappings":"AAAM,SAAU,cAAc,CAAC,IAAW,EAAE,IAAkB,EAAA;AAC1D,IAAA,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;AAAE,QAAA,OAAO,KAAK;AAEtC,IAAA,MAAM,UAAU,GAAG,IAAI,CAAC,MAAM;AAE9B,IAAA,IAAI,UAAU,KAAK,IAAI,CAAC,MAAM;AAAE,QAAA,OAAO,KAAK;AAE5C,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,EAAE,CAAC,EAAE,EAAE;QACjC,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC;AAAE,YAAA,OAAO,KAAK;IACzC;AAEA,IAAA,OAAO,IAAI;AACf;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/utils/variant-props.mjs b/node_modules/motion-dom/dist/es/render/utils/variant-props.mjs deleted file mode 100644 index 56a3899..0000000 --- a/node_modules/motion-dom/dist/es/render/utils/variant-props.mjs +++ /dev/null @@ -1,13 +0,0 @@ -const variantPriorityOrder = [ - "animate", - "whileInView", - "whileFocus", - "whileHover", - "whileTap", - "whileDrag", - "exit", -]; -const variantProps = ["initial", ...variantPriorityOrder]; - -export { variantPriorityOrder, variantProps }; -//# sourceMappingURL=variant-props.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/utils/variant-props.mjs.map b/node_modules/motion-dom/dist/es/render/utils/variant-props.mjs.map deleted file mode 100644 index 86915c1..0000000 --- a/node_modules/motion-dom/dist/es/render/utils/variant-props.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"variant-props.mjs","sources":["../../../../src/render/utils/variant-props.ts"],"sourcesContent":["import type { AnimationType } from \"../types\"\n\nexport const variantPriorityOrder: AnimationType[] = [\n \"animate\",\n \"whileInView\",\n \"whileFocus\",\n \"whileHover\",\n \"whileTap\",\n \"whileDrag\",\n \"exit\",\n]\n\nexport const variantProps = [\"initial\", ...variantPriorityOrder]\n"],"names":[],"mappings":"AAEO,MAAM,oBAAoB,GAAoB;IACjD,SAAS;IACT,aAAa;IACb,YAAY;IACZ,YAAY;IACZ,UAAU;IACV,WAAW;IACX,MAAM;;AAGH,MAAM,YAAY,GAAG,CAAC,SAAS,EAAE,GAAG,oBAAoB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/resize/handle-element.mjs b/node_modules/motion-dom/dist/es/resize/handle-element.mjs deleted file mode 100644 index 7b4abe3..0000000 --- a/node_modules/motion-dom/dist/es/resize/handle-element.mjs +++ /dev/null @@ -1,64 +0,0 @@ -import { isSVGElement } from '../utils/is-svg-element.mjs'; -import { resolveElements } from '../utils/resolve-elements.mjs'; - -const resizeHandlers = new WeakMap(); -let observer; -const getSize = (borderBoxAxis, svgAxis, htmlAxis) => (target, borderBoxSize) => { - if (borderBoxSize && borderBoxSize[0]) { - return borderBoxSize[0][(borderBoxAxis + "Size")]; - } - else if (isSVGElement(target) && "getBBox" in target) { - return target.getBBox()[svgAxis]; - } - else { - return target[htmlAxis]; - } -}; -const getWidth = /*@__PURE__*/ getSize("inline", "width", "offsetWidth"); -const getHeight = /*@__PURE__*/ getSize("block", "height", "offsetHeight"); -function notifyTarget({ target, borderBoxSize }) { - resizeHandlers.get(target)?.forEach((handler) => { - handler(target, { - get width() { - return getWidth(target, borderBoxSize); - }, - get height() { - return getHeight(target, borderBoxSize); - }, - }); - }); -} -function notifyAll(entries) { - entries.forEach(notifyTarget); -} -function createResizeObserver() { - if (typeof ResizeObserver === "undefined") - return; - observer = new ResizeObserver(notifyAll); -} -function resizeElement(target, handler) { - if (!observer) - createResizeObserver(); - const elements = resolveElements(target); - elements.forEach((element) => { - let elementHandlers = resizeHandlers.get(element); - if (!elementHandlers) { - elementHandlers = new Set(); - resizeHandlers.set(element, elementHandlers); - } - elementHandlers.add(handler); - observer?.observe(element); - }); - return () => { - elements.forEach((element) => { - const elementHandlers = resizeHandlers.get(element); - elementHandlers?.delete(handler); - if (!elementHandlers?.size) { - observer?.unobserve(element); - } - }); - }; -} - -export { resizeElement }; -//# sourceMappingURL=handle-element.mjs.map diff --git a/node_modules/motion-dom/dist/es/resize/handle-element.mjs.map b/node_modules/motion-dom/dist/es/resize/handle-element.mjs.map deleted file mode 100644 index b86aac0..0000000 --- a/node_modules/motion-dom/dist/es/resize/handle-element.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"handle-element.mjs","sources":["../../../src/resize/handle-element.ts"],"sourcesContent":["import { isSVGElement } from \"../utils/is-svg-element\"\nimport { ElementOrSelector, resolveElements } from \"../utils/resolve-elements\"\nimport { ResizeHandler } from \"./types\"\n\nconst resizeHandlers = new WeakMap>>()\n\nlet observer: ResizeObserver | undefined\n\nconst getSize =\n (\n borderBoxAxis: \"inline\" | \"block\",\n svgAxis: \"width\" | \"height\",\n htmlAxis: \"offsetWidth\" | \"offsetHeight\"\n ) =>\n (target: Element, borderBoxSize?: ReadonlyArray) => {\n if (borderBoxSize && borderBoxSize[0]) {\n return borderBoxSize[0][\n (borderBoxAxis + \"Size\") as keyof ResizeObserverSize\n ]\n } else if (isSVGElement(target) && \"getBBox\" in target) {\n return (target as SVGGraphicsElement).getBBox()[svgAxis]\n } else {\n return (target as HTMLElement)[htmlAxis]\n }\n }\n\nconst getWidth = /*@__PURE__*/ getSize(\"inline\", \"width\", \"offsetWidth\")\nconst getHeight = /*@__PURE__*/ getSize(\"block\", \"height\", \"offsetHeight\")\n\nfunction notifyTarget({ target, borderBoxSize }: ResizeObserverEntry) {\n resizeHandlers.get(target)?.forEach((handler) => {\n handler(target, {\n get width() {\n return getWidth(target, borderBoxSize)\n },\n get height() {\n return getHeight(target, borderBoxSize)\n },\n })\n })\n}\n\nfunction notifyAll(entries: ResizeObserverEntry[]) {\n entries.forEach(notifyTarget)\n}\n\nfunction createResizeObserver() {\n if (typeof ResizeObserver === \"undefined\") return\n\n observer = new ResizeObserver(notifyAll)\n}\n\nexport function resizeElement(\n target: ElementOrSelector,\n handler: ResizeHandler\n) {\n if (!observer) createResizeObserver()\n\n const elements = resolveElements(target)\n\n elements.forEach((element) => {\n let elementHandlers = resizeHandlers.get(element)\n\n if (!elementHandlers) {\n elementHandlers = new Set()\n resizeHandlers.set(element, elementHandlers)\n }\n\n elementHandlers.add(handler)\n observer?.observe(element)\n })\n\n return () => {\n elements.forEach((element) => {\n const elementHandlers = resizeHandlers.get(element)\n\n elementHandlers?.delete(handler)\n\n if (!elementHandlers?.size) {\n observer?.unobserve(element)\n }\n })\n }\n}\n"],"names":[],"mappings":";;;AAIA,MAAM,cAAc,GAAG,IAAI,OAAO,EAAwC;AAE1E,IAAI,QAAoC;AAExC,MAAM,OAAO,GACT,CACI,aAAiC,EACjC,OAA2B,EAC3B,QAAwC,KAE5C,CAAC,MAAe,EAAE,aAAiD,KAAI;AACnE,IAAA,IAAI,aAAa,IAAI,aAAa,CAAC,CAAC,CAAC,EAAE;QACnC,OAAO,aAAa,CAAC,CAAC,CAAC,EAClB,aAAa,GAAG,MAAM,EAC1B;IACL;SAAO,IAAI,YAAY,CAAC,MAAM,CAAC,IAAI,SAAS,IAAI,MAAM,EAAE;AACpD,QAAA,OAAQ,MAA6B,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC;IAC5D;SAAO;AACH,QAAA,OAAQ,MAAsB,CAAC,QAAQ,CAAC;IAC5C;AACJ,CAAC;AAEL,MAAM,QAAQ,iBAAiB,OAAO,CAAC,QAAQ,EAAE,OAAO,EAAE,aAAa,CAAC;AACxE,MAAM,SAAS,iBAAiB,OA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EF,IAAA,OAAO,MAAK;AACR,QAAA,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,KAAI;YACzB,MAAM,eAAe,GAAG,cAAc,CAAC,GAAG,CAAC,OAAO,CAAC;AAEnD,YAAA,eAAe,EAAE,MAAM,CAAC,OAAO,CAAC;AAEhC,YAAA,IAAI,CAAC,eAAe,EAAE,IAAI,EAAE;AACxB,gBAAA,QAAQ,EAAE,SAAS,CAAC,OAAO,CAAC;YAChC;AACJ,QAAA,CAAC,CAAC;AACN,IAAA,CAAC;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/resize/handle-window.mjs b/node_modules/motion-dom/dist/es/resize/handle-window.mjs deleted file mode 100644 index cdc8977..0000000 --- a/node_modules/motion-dom/dist/es/resize/handle-window.mjs +++ /dev/null @@ -1,32 +0,0 @@ -const windowCallbacks = new Set(); -let windowResizeHandler; -function createWindowResizeHandler() { - windowResizeHandler = () => { - const info = { - get width() { - return window.innerWidth; - }, - get height() { - return window.innerHeight; - }, - }; - windowCallbacks.forEach((callback) => callback(info)); - }; - window.addEventListener("resize", windowResizeHandler); -} -function resizeWindow(callback) { - windowCallbacks.add(callback); - if (!windowResizeHandler) - createWindowResizeHandler(); - return () => { - windowCallbacks.delete(callback); - if (!windowCallbacks.size && - typeof windowResizeHandler === "function") { - window.removeEventListener("resize", windowResizeHandler); - windowResizeHandler = undefined; - } - }; -} - -export { resizeWindow }; -//# sourceMappingURL=handle-window.mjs.map diff --git a/node_modules/motion-dom/dist/es/resize/handle-window.mjs.map b/node_modules/motion-dom/dist/es/resize/handle-window.mjs.map deleted file mode 100644 index 59fb9b6..0000000 --- a/node_modules/motion-dom/dist/es/resize/handle-window.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"handle-window.mjs","sources":["../../../src/resize/handle-window.ts"],"sourcesContent":["import { WindowResizeHandler } from \"./types\"\n\nconst windowCallbacks = new Set()\n\nlet windowResizeHandler: VoidFunction | undefined\n\nfunction createWindowResizeHandler() {\n windowResizeHandler = () => {\n const info = {\n get width() {\n return window.innerWidth\n },\n get height() {\n return window.innerHeight\n },\n }\n\n windowCallbacks.forEach((callback) => callback(info))\n }\n\n window.addEventListener(\"resize\", windowResizeHandler)\n}\n\nexport function resizeWindow(callback: WindowResizeHandler) {\n windowCallbacks.add(callback)\n\n if (!windowResizeHandler) createWindowResizeHandler()\n\n return () => {\n windowCallbacks.delete(callback)\n\n if (\n !windowCallbacks.size &&\n typeof windowResizeHandler === \"function\"\n ) {\n window.removeEventListener(\"resize\", windowResizeHandler)\n windowResizeHandler = undefined\n }\n }\n}\n"],"names":[],"mappings":"AAEA,MAAM,eAAe,GAAG,IAAI,GAAG,EAAuB;AAEtD,IAAI,mBAA6C;AAEjD,SAAS,yBAAyB,GAAA;IAC9B,mBAAmB,GAAG,MAAK;AACvB,QAAA,MAAM,IAAI,GAAG;AACT,YAAA,IAAI,KAAK,GAAA;gBACL,OAAO,MAAM,CAAC,UAAU;YAC5B,CAAC;AACD,YAAA,IAAI,MAAM,GAAA;gBACN,OAAO,MAAM,CAAC,WAAW;YAC7B,CAAC;SACJ;AAED,QAAA,eAAe,CAAC,OAAO,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC,IAAI,CAAC,CAAC;AACzD,IAAA,CAAC;AAED,IAAA,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,mBAAmB,CAAC;AAC1D;AAEM,SAAU,YAAY,CAAC,QAA6B,EAAA;AACtD,IAAA,eAAe,CAAC,GAAG,CAAC,QAAQ,CAAC;AAE7B,IAAA,IAAI,CAAC,mBAAmB;AAAE,QAAA,yBAAyB,EAAE;AAErD,IAAA,OAAO,MAAK;AACR,QAAA,eAAe,CAAC,MAAM,CAAC,QAAQ,CAAC;QAEhC,IACI,CAAC,eAAe,CAAC,IAAI;AACrB,YAAA,OAAO,mBAAmB,KAAK,UAAU,EAC3C;AACE,YAAA,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,mBAAmB,CAAC;YACzD,mBAAmB,GAAG,SAAS;QACnC;AACJ,IAAA,CAAC;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/resize/index.mjs b/node_modules/motion-dom/dist/es/resize/index.mjs deleted file mode 100644 index 5d871a6..0000000 --- a/node_modules/motion-dom/dist/es/resize/index.mjs +++ /dev/null @@ -1,9 +0,0 @@ -import { resizeElement } from './handle-element.mjs'; -import { resizeWindow } from './handle-window.mjs'; - -function resize(a, b) { - return typeof a === "function" ? resizeWindow(a) : resizeElement(a, b); -} - -export { resize }; -//# sourceMappingURL=index.mjs.map diff --git a/node_modules/motion-dom/dist/es/resize/index.mjs.map b/node_modules/motion-dom/dist/es/resize/index.mjs.map deleted file mode 100644 index 5622721..0000000 --- a/node_modules/motion-dom/dist/es/resize/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs","sources":["../../../src/resize/index.ts"],"sourcesContent":["import { ElementOrSelector } from \"../utils/resolve-elements\"\nimport { resizeElement } from \"./handle-element\"\nimport { resizeWindow } from \"./handle-window\"\nimport { ResizeHandler, WindowResizeHandler } from \"./types\"\n\nexport function resize(onResize: WindowResizeHandler): VoidFunction\nexport function resize(\n target: ElementOrSelector,\n onResize: ResizeHandler\n): VoidFunction\nexport function resize(\n a: WindowResizeHandler | ElementOrSelector,\n b?: ResizeHandler\n) {\n return typeof a === \"function\" ? resizeWindow(a) : resizeElement(a, b!)\n}\n"],"names":[],"mappings":";;;AAUM,SAAU,MAAM,CAClB,CAA0C,EAC1C,CAA0B,EAAA;IAE1B,OAAO,OAAO,CAAC,KAAK,UAAU,GAAG,YAAY,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,EAAE,CAAE,CAAC;AAC3E;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/scroll/observe.mjs b/node_modules/motion-dom/dist/es/scroll/observe.mjs deleted file mode 100644 index 52c4a84..0000000 --- a/node_modules/motion-dom/dist/es/scroll/observe.mjs +++ /dev/null @@ -1,19 +0,0 @@ -import { frame, cancelFrame } from '../frameloop/frame.mjs'; - -function observeTimeline(update, timeline) { - let prevProgress; - const onFrame = () => { - const { currentTime } = timeline; - const percentage = currentTime === null ? 0 : currentTime.value; - const progress = percentage / 100; - if (prevProgress !== progress) { - update(progress); - } - prevProgress = progress; - }; - frame.preUpdate(onFrame, true); - return () => cancelFrame(onFrame); -} - -export { observeTimeline }; -//# sourceMappingURL=observe.mjs.map diff --git a/node_modules/motion-dom/dist/es/scroll/observe.mjs.map b/node_modules/motion-dom/dist/es/scroll/observe.mjs.map deleted file mode 100644 index 3af2572..0000000 --- a/node_modules/motion-dom/dist/es/scroll/observe.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"observe.mjs","sources":["../../../src/scroll/observe.ts"],"sourcesContent":["import { ProgressTimeline } from \"../animation/types\"\nimport { cancelFrame, frame } from \"../frameloop\"\n\ntype Update = (progress: number) => void\n\nexport function observeTimeline(update: Update, timeline: ProgressTimeline) {\n let prevProgress: number\n\n const onFrame = () => {\n const { currentTime } = timeline\n const percentage = currentTime === null ? 0 : currentTime.value\n const progress = percentage / 100\n\n if (prevProgress !== progress) {\n update(progress)\n }\n\n prevProgress = progress\n }\n\n frame.preUpdate(onFrame, true)\n\n return () => cancelFrame(onFrame)\n}\n"],"names":[],"mappings":";;AAKM,SAAU,eAAe,CAAC,MAAc,EAAE,QAA0B,EAAA;AACtE,IAAA,IAAI,YAAoB;IAExB,MAAM,OAAO,GAAG,MAAK;AACjB,QAAA,MAAM,EAAE,WAAW,EAAE,GAAG,QAAQ;AAChC,QAAA,MAAM,UAAU,GAAG,WAAW,KAAK,IAAI,GAAG,CAAC,GAAG,WAAW,CAAC,KAAK;AAC/D,QAAA,MAAM,QAAQ,GAAG,UAAU,GAAG,GAAG;AAEjC,QAAA,IAAI,YAAY,KAAK,QAAQ,EAAE;YAC3B,MAAM,CAAC,QAAQ,CAAC;QACpB;QAEA,YAAY,GAAG,QAAQ;AAC3B,IAAA,CAAC;AAED,IAAA,KAAK,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,CAAC;AAE9B,IAAA,OAAO,MAAM,WAAW,CAAC,OAAO,CAAC;AACrC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/stats/buffer.mjs b/node_modules/motion-dom/dist/es/stats/buffer.mjs deleted file mode 100644 index 6349d90..0000000 --- a/node_modules/motion-dom/dist/es/stats/buffer.mjs +++ /dev/null @@ -1,7 +0,0 @@ -const statsBuffer = { - value: null, - addProjectionMetrics: null, -}; - -export { statsBuffer }; -//# sourceMappingURL=buffer.mjs.map diff --git a/node_modules/motion-dom/dist/es/stats/buffer.mjs.map b/node_modules/motion-dom/dist/es/stats/buffer.mjs.map deleted file mode 100644 index 9863699..0000000 --- a/node_modules/motion-dom/dist/es/stats/buffer.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"buffer.mjs","sources":["../../../src/stats/buffer.ts"],"sourcesContent":["import type { LayoutProjectionMetrics, StatsRecording } from \"./types\"\n\nexport type InactiveStatsBuffer = {\n value: null\n addProjectionMetrics: null\n}\n\nexport type ActiveStatsBuffer = {\n value: StatsRecording\n addProjectionMetrics: (metrics: LayoutProjectionMetrics) => void\n}\n\nexport const statsBuffer: InactiveStatsBuffer | ActiveStatsBuffer = {\n value: null,\n addProjectionMetrics: null,\n}\n"],"names":[],"mappings":"AAYO,MAAM,WAAW,GAA4C;AAChE,IAAA,KAAK,EAAE,IAAI;AACX,IAAA,oBAAoB,EAAE,IAAI;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/stats/index.mjs b/node_modules/motion-dom/dist/es/stats/index.mjs deleted file mode 100644 index 9a78f93..0000000 --- a/node_modules/motion-dom/dist/es/stats/index.mjs +++ /dev/null @@ -1,29 +0,0 @@ -import { statsBuffer } from './buffer.mjs'; - -function clearStatsBuffer() { - statsBuffer.value = null; - statsBuffer.addProjectionMetrics = null; -} -function recordStats() { - if (statsBuffer.value) { - clearStatsBuffer(); - throw new Error("Stats are already being measured"); - } - const buffer = statsBuffer; - buffer.value = { - layoutProjection: { - nodes: [], - calculatedTargetDeltas: [], - calculatedProjections: [], - }, - }; - buffer.addProjectionMetrics = (metrics) => { - const { layoutProjection } = buffer.value; - layoutProjection.nodes.push(metrics.nodes); - layoutProjection.calculatedTargetDeltas.push(metrics.calculatedTargetDeltas); - layoutProjection.calculatedProjections.push(metrics.calculatedProjections); - }; -} - -export { recordStats }; -//# sourceMappingURL=index.mjs.map diff --git a/node_modules/motion-dom/dist/es/stats/index.mjs.map b/node_modules/motion-dom/dist/es/stats/index.mjs.map deleted file mode 100644 index 7b45403..0000000 --- a/node_modules/motion-dom/dist/es/stats/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs","sources":["../../../src/stats/index.ts"],"sourcesContent":["import { ActiveStatsBuffer, statsBuffer } from \"./buffer\"\n\nfunction clearStatsBuffer() {\n statsBuffer.value = null\n statsBuffer.addProjectionMetrics = null\n}\n\nexport function recordStats() {\n if (statsBuffer.value) {\n clearStatsBuffer()\n throw new Error(\"Stats are already being measured\")\n }\n\n const buffer = statsBuffer as unknown as ActiveStatsBuffer\n\n buffer.value = {\n layoutProjection: {\n nodes: [],\n calculatedTargetDeltas: [],\n calculatedProjections: [],\n },\n }\n\n buffer.addProjectionMetrics = (metrics) => {\n const { layoutProjection } = buffer.value\n layoutProjection.nodes.push(metrics.nodes)\n layoutProjection.calculatedTargetDeltas.push(\n metrics.calculatedTargetDeltas\n )\n layoutProjection.calculatedProjections.push(\n metrics.calculatedProjections\n )\n }\n}\n"],"names":[],"mappings":";;AAEA,SAAS,gBAAgB,GAAA;AACrB,IAAA,WAAW,CAAC,KAAK,GAAG,IAAI;AACxB,IAAA,WAAW,CAAC,oBAAoB,GAAG,IAAI;AAC3C;SAEgB,WAAW,GAAA;AACvB,IAAA,IAAI,WAAW,CAAC,KAAK,EAAE;AACnB,QAAA,gBAAgB,EAAE;AAClB,QAAA,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC;IACvD;IAEA,MAAM,MAAM,GAAG,WAA2C;IAE1D,MAAM,CAAC,KAAK,GAAG;AACX,QAAA,gBAAgB,EAAE;AACd,YAAA,KAAK,EAAE,EAAE;AACT,YAAA,sBAAsB,EAAE,EAAE;AAC1B,YAAA,qBAAqB,EAAE,EAAE;AAC5B,SAAA;KACJ;AAED,IAAA,MAAM,CAAC,oBAAoB,GAAG,CAAC,OAAO,KAAI;AACtC,QAAA,MAAM,EAAE,gBAAgB,EAAE,GAAG,MAAM,CAAC,KAAK;QACzC,gBAAgB,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;QAC1C,gBAAgB,CAAC,sBAAsB,CAAC,IAAI,CACxC,OAAO,CAAC,sBAAsB,CACjC;QACD,gBAAgB,CAAC,qBAAqB,CAAC,IAAI,CACvC,OAAO,CAAC,qBAAqB,CAChC;AACL,IAAA,CAAC;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/utils/border-radius.mjs b/node_modules/motion-dom/dist/es/utils/border-radius.mjs deleted file mode 100644 index 8fc6f60..0000000 --- a/node_modules/motion-dom/dist/es/utils/border-radius.mjs +++ /dev/null @@ -1,15 +0,0 @@ -/** - * The four corner-radius longhands. Shared so the projection mixer, scale - * corrector, WAAPI px-value set and view-transition crop pass don't each carry - * their own copy. Order is irrelevant - every consumer mixes/corrects/animates - * each corner independently. - */ -const cornerRadiusProps = [ - "borderTopLeftRadius", - "borderTopRightRadius", - "borderBottomRightRadius", - "borderBottomLeftRadius", -]; - -export { cornerRadiusProps }; -//# sourceMappingURL=border-radius.mjs.map diff --git a/node_modules/motion-dom/dist/es/utils/border-radius.mjs.map b/node_modules/motion-dom/dist/es/utils/border-radius.mjs.map deleted file mode 100644 index 485e22b..0000000 --- a/node_modules/motion-dom/dist/es/utils/border-radius.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"border-radius.mjs","sources":["../../../src/utils/border-radius.ts"],"sourcesContent":["/**\n * The four corner-radius longhands. Shared so the projection mixer, scale\n * corrector, WAAPI px-value set and view-transition crop pass don't each carry\n * their own copy. Order is irrelevant - every consumer mixes/corrects/animates\n * each corner independently.\n */\nexport const cornerRadiusProps = [\n \"borderTopLeftRadius\",\n \"borderTopRightRadius\",\n \"borderBottomRightRadius\",\n \"borderBottomLeftRadius\",\n] as const\n"],"names":[],"mappings":"AAAA;;;;;AAKG;AACI,MAAM,iBAAiB,GAAG;IAC7B,qBAAqB;IACrB,sBAAsB;IACtB,yBAAyB;IACzB,wBAAwB;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/utils/delay.mjs b/node_modules/motion-dom/dist/es/utils/delay.mjs deleted file mode 100644 index 55bfdf8..0000000 --- a/node_modules/motion-dom/dist/es/utils/delay.mjs +++ /dev/null @@ -1,25 +0,0 @@ -import { time } from '../frameloop/sync-time.mjs'; -import { secondsToMilliseconds } from 'motion-utils'; -import { frame, cancelFrame } from '../frameloop/frame.mjs'; - -/** - * Timeout defined in ms - */ -function delay(callback, timeout) { - const start = time.now(); - const checkElapsed = ({ timestamp }) => { - const elapsed = timestamp - start; - if (elapsed >= timeout) { - cancelFrame(checkElapsed); - callback(elapsed - timeout); - } - }; - frame.setup(checkElapsed, true); - return () => cancelFrame(checkElapsed); -} -function delayInSeconds(callback, timeout) { - return delay(callback, secondsToMilliseconds(timeout)); -} - -export { delay, delayInSeconds }; -//# sourceMappingURL=delay.mjs.map diff --git a/node_modules/motion-dom/dist/es/utils/delay.mjs.map b/node_modules/motion-dom/dist/es/utils/delay.mjs.map deleted file mode 100644 index 7520457..0000000 --- a/node_modules/motion-dom/dist/es/utils/delay.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"delay.mjs","sources":["../../../src/utils/delay.ts"],"sourcesContent":["import { cancelFrame, frame } from \"../frameloop\"\nimport { time } from \"../frameloop/sync-time\"\nimport type { FrameData } from \"../frameloop/types\"\nimport { secondsToMilliseconds } from \"motion-utils\"\n\nexport type DelayedFunction = (overshoot: number) => void\n\n/**\n * Timeout defined in ms\n */\nexport function delay(callback: DelayedFunction, timeout: number) {\n const start = time.now()\n\n const checkElapsed = ({ timestamp }: FrameData) => {\n const elapsed = timestamp - start\n\n if (elapsed >= timeout) {\n cancelFrame(checkElapsed)\n callback(elapsed - timeout)\n }\n }\n\n frame.setup(checkElapsed, true)\n\n return () => cancelFrame(checkElapsed)\n}\n\nexport function delayInSeconds(callback: DelayedFunction, timeout: number) {\n return delay(callback, secondsToMilliseconds(timeout))\n}\n"],"names":[],"mappings":";;;;AAOA;;AAEG;AACG,SAAU,KAAK,CAAC,QAAyB,EAAE,OAAe,EAAA;AAC5D,IAAA,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,EAAE;AAExB,IAAA,MAAM,YAAY,GAAG,CAAC,EAAE,SAAS,EAAa,KAAI;AAC9C,QAAA,MAAM,OAAO,GAAG,SAAS,GAAG,KAAK;AAEjC,QAAA,IAAI,OAAO,IAAI,OAAO,EAAE;YACpB,WAAW,CAAC,YAAY,CAAC;AACzB,YAAA,QAAQ,CAAC,OAAO,GAAG,OAAO,CAAC;QAC/B;AACJ,IAAA,CAAC;AAED,IAAA,KAAK,CAAC,KAAK,CAAC,YAAY,EAAE,IAAI,CAAC;AAE/B,IAAA,OAAO,MAAM,WAAW,CAAC,YAAY,CAAC;AAC1C;AAEM,SAAU,cAAc,CAAC,QAAyB,EAAE,OAAe,EAAA;IACrE,OAAO,KAAK,CAAC,QAAQ,EAAE,qBAAqB,CAAC,OAAO,CAAC,CAAC;AAC1D;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/utils/interpolate.mjs b/node_modules/motion-dom/dist/es/utils/interpolate.mjs deleted file mode 100644 index a7260c7..0000000 --- a/node_modules/motion-dom/dist/es/utils/interpolate.mjs +++ /dev/null @@ -1,75 +0,0 @@ -import { invariant, clamp, MotionGlobalConfig, noop, pipe, progress } from 'motion-utils'; -import { mix } from './mix/index.mjs'; - -function createMixers(output, ease, customMixer) { - const mixers = []; - const mixerFactory = customMixer || MotionGlobalConfig.mix || mix; - const numMixers = output.length - 1; - for (let i = 0; i < numMixers; i++) { - let mixer = mixerFactory(output[i], output[i + 1]); - if (ease) { - const easingFunction = Array.isArray(ease) ? ease[i] || noop : ease; - mixer = pipe(easingFunction, mixer); - } - mixers.push(mixer); - } - return mixers; -} -/** - * Create a function that maps from a numerical input array to a generic output array. - * - * Accepts: - * - Numbers - * - Colors (hex, hsl, hsla, rgb, rgba) - * - Complex (combinations of one or more numbers or strings) - * - * ```jsx - * const mixColor = interpolate([0, 1], ['#fff', '#000']) - * - * mixColor(0.5) // 'rgba(128, 128, 128, 1)' - * ``` - * - * TODO Revisit this approach once we've moved to data models for values, - * probably not needed to pregenerate mixer functions. - * - * @public - */ -function interpolate(input, output, { clamp: isClamp = true, ease, mixer } = {}) { - const inputLength = input.length; - invariant(inputLength === output.length, "Both input and output ranges must be the same length", "range-length"); - /** - * If we're only provided a single input, we can just make a function - * that returns the output. - */ - if (inputLength === 1) - return () => output[0]; - if (inputLength === 2 && output[0] === output[1]) - return () => output[1]; - const isZeroDeltaRange = input[0] === input[1]; - // If input runs highest -> lowest, reverse both arrays - if (input[0] > input[inputLength - 1]) { - input = [...input].reverse(); - output = [...output].reverse(); - } - const mixers = createMixers(output, ease, mixer); - const numMixers = mixers.length; - const interpolator = (v) => { - if (isZeroDeltaRange && v < input[0]) - return output[0]; - let i = 0; - if (numMixers > 1) { - for (; i < input.length - 2; i++) { - if (v < input[i + 1]) - break; - } - } - const progressInRange = progress(input[i], input[i + 1], v); - return mixers[i](progressInRange); - }; - return isClamp - ? (v) => interpolator(clamp(input[0], input[inputLength - 1], v)) - : interpolator; -} - -export { interpolate }; -//# sourceMappingURL=interpolate.mjs.map diff --git a/node_modules/motion-dom/dist/es/utils/interpolate.mjs.map b/node_modules/motion-dom/dist/es/utils/interpolate.mjs.map deleted file mode 100644 index c5dcae1..0000000 --- a/node_modules/motion-dom/dist/es/utils/interpolate.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"interpolate.mjs","sources":["../../../src/utils/interpolate.ts"],"sourcesContent":["import {\n clamp,\n EasingFunction,\n invariant,\n MotionGlobalConfig,\n noop,\n pipe,\n progress,\n} from \"motion-utils\"\nimport { mix } from \"./mix\"\nimport { Mixer, MixerFactory } from \"./mix/types\"\n\nexport interface InterpolateOptions {\n clamp?: boolean\n ease?: EasingFunction | EasingFunction[]\n mixer?: MixerFactory\n}\n\nfunction createMixers(\n output: T[],\n ease?: EasingFunction | EasingFunction[],\n customMixer?: MixerFactory\n) {\n const mixers: Array> = []\n const mixerFactory: MixerFactory =\n customMixer || MotionGlobalConfig.mix || mix\n const numMixers = output.length - 1\n\n for (let i = 0; i < numMixers; i++) {\n let mixer = mixerFactory(output[i], output[i + 1])\n\n if (ease) {\n const easingFunction = Array.isArray(ease) ? ease[i] || noop : ease\n mixer = pipe(easingFunction, mixer) as Mixer\n }\n\n mixers.push(mixer)\n }\n\n return mixers\n}\n\n/**\n * Create a function that maps from a numerical input array to a generic output array.\n *\n * Accepts:\n * - Numbers\n * - Colors (hex, hsl, hsla, rgb, rgba)\n * - Complex (combinations of one or more numbers or strings)\n *\n * ```jsx\n * const mixColor = interpolate([0, 1], ['#fff', '#000'])\n *\n * mixColor(0.5) // 'rgba(128, 128, 128, 1)'\n * ```\n *\n * TODO Revisit this approach once we've moved to data models for values,\n * probably not needed to pregenerate mixer functions.\n *\n * @public\n */\nexport function interpolate(\n input: number[],\n output: T[],\n { clamp: isClamp = true, ease, mixer }: InterpolateOptions = {}\n): (v: number) => T {\n const inputLength = input.length\n\n invariant(\n inputLength === output.length,\n \"Both input and output ranges must be the same length\",\n \"range-length\"\n )\n\n /**\n * If we're only provided a single input, we can just make a function\n * that returns the output.\n */\n if (inputLength === 1) return () => output[0]\n if (inputLength === 2 && output[0] === output[1]) return () => output[1]\n\n const isZeroDeltaRange = input[0] === input[1]\n\n // If input runs highest -> lowest, reverse both arrays\n if (input[0] > input[inputLength - 1]) {\n input = [...input].reverse()\n output = [...output].reverse()\n }\n\n const mixers = createMixers(output, ease, mixer)\n const numMixers = mixers.length\n\n const interpolator = (v: number): T => {\n if (isZeroDeltaRange && v < input[0]) return output[0]\n\n let i = 0\n\n if (numMixers > 1) {\n for (; i < input.length - 2; i++) {\n if (v < input[i + 1]) break\n }\n }\n\n const progressInRange = progress(input[i], input[i + 1], v)\n\n return mixers[i](progressInRange)\n }\n\n return isClamp\n ? (v: number) =>\n interpolator(clamp(input[0], input[inputLength - 1], v))\n : interpolator\n}\n"],"names":[],"mappings":";;;AAkBA,SAAS,YAAY,CACjB,MAAW,EACX,IAAwC,EACxC,WAA6B,EAAA;IAE7B,MAAM,MAAM,GAAoB,EAAE;IAClC,MAAM,YAAY,GACd,WAAW,IAAI,kBAAkB,CAAC,GAAG,IAAI,GAAG;AAChD,IAAA,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,GAAG,CAAC;AAEnC,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,EAAE,CAAC,EAAE,EAAE;AAChC,QAAA,IAAI,KAAK,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QAElD,IAAI,IAAI,EAAE;YACN,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,GAAG,IAAI;AACnE,YAAA,KAAK,GAAG,IAAI,CAAC,cAAc,EAAE,KAAK,CAAa;QACnD;AAEA,QAAA,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;IACtB;AAEA,IAAA,OAAO,MAAM;AACjB;AAEA;;;;;;;;;;;;;;;;;;AAkBG;SACa,WAAW,CACvB,KAAe,EACf,MAAW,EACX,EAAE,KAAK,EAAE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E;YAC1B;QACJ;AAEA,QAAA,MAAM,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;AAE3D,QAAA,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC;AACrC,IAAA,CAAC;AAED,IAAA,OAAO;UACD,CAAC,CAAS,KACN,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,WAAW,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;UAC3D,YAAY;AACtB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/utils/is-html-element.mjs b/node_modules/motion-dom/dist/es/utils/is-html-element.mjs deleted file mode 100644 index 9ead44d..0000000 --- a/node_modules/motion-dom/dist/es/utils/is-html-element.mjs +++ /dev/null @@ -1,14 +0,0 @@ -import { isObject } from 'motion-utils'; - -/** - * Checks if an element is an HTML element in a way - * that works across iframes - */ -function isHTMLElement(element) { - return (isObject(element) && - "offsetHeight" in element && - !("ownerSVGElement" in element)); -} - -export { isHTMLElement }; -//# sourceMappingURL=is-html-element.mjs.map diff --git a/node_modules/motion-dom/dist/es/utils/is-html-element.mjs.map b/node_modules/motion-dom/dist/es/utils/is-html-element.mjs.map deleted file mode 100644 index 3e9f032..0000000 --- a/node_modules/motion-dom/dist/es/utils/is-html-element.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"is-html-element.mjs","sources":["../../../src/utils/is-html-element.ts"],"sourcesContent":["import { isObject } from \"motion-utils\"\n\n/**\n * Checks if an element is an HTML element in a way\n * that works across iframes\n */\nexport function isHTMLElement(element: unknown): element is HTMLElement {\n return (\n isObject(element) &&\n \"offsetHeight\" in element &&\n !(\"ownerSVGElement\" in element)\n )\n}\n"],"names":[],"mappings":";;AAEA;;;AAGG;AACG,SAAU,aAAa,CAAC,OAAgB,EAAA;AAC1C,IAAA,QACI,QAAQ,CAAC,OAAO,CAAC;AACjB,QAAA,cAAc,IAAI,OAAO;AACzB,QAAA,EAAE,iBAAiB,IAAI,OAAO,CAAC;AAEvC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/utils/is-svg-element.mjs b/node_modules/motion-dom/dist/es/utils/is-svg-element.mjs deleted file mode 100644 index f529a49..0000000 --- a/node_modules/motion-dom/dist/es/utils/is-svg-element.mjs +++ /dev/null @@ -1,12 +0,0 @@ -import { isObject } from 'motion-utils'; - -/** - * Checks if an element is an SVG element in a way - * that works across iframes - */ -function isSVGElement(element) { - return isObject(element) && "ownerSVGElement" in element; -} - -export { isSVGElement }; -//# sourceMappingURL=is-svg-element.mjs.map diff --git a/node_modules/motion-dom/dist/es/utils/is-svg-element.mjs.map b/node_modules/motion-dom/dist/es/utils/is-svg-element.mjs.map deleted file mode 100644 index bf9056c..0000000 --- a/node_modules/motion-dom/dist/es/utils/is-svg-element.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"is-svg-element.mjs","sources":["../../../src/utils/is-svg-element.ts"],"sourcesContent":["import { isObject } from \"motion-utils\"\n\n/**\n * Checks if an element is an SVG element in a way\n * that works across iframes\n */\nexport function isSVGElement(element: unknown): element is SVGElement {\n return isObject(element) && \"ownerSVGElement\" in element\n}\n"],"names":[],"mappings":";;AAEA;;;AAGG;AACG,SAAU,YAAY,CAAC,OAAgB,EAAA;IACzC,OAAO,QAAQ,CAAC,OAAO,CAAC,IAAI,iBAAiB,IAAI,OAAO;AAC5D;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/utils/is-svg-svg-element.mjs b/node_modules/motion-dom/dist/es/utils/is-svg-svg-element.mjs deleted file mode 100644 index e61de12..0000000 --- a/node_modules/motion-dom/dist/es/utils/is-svg-svg-element.mjs +++ /dev/null @@ -1,12 +0,0 @@ -import { isSVGElement } from './is-svg-element.mjs'; - -/** - * Checks if an element is specifically an SVGSVGElement (the root SVG element) - * in a way that works across iframes - */ -function isSVGSVGElement(element) { - return isSVGElement(element) && element.tagName === "svg"; -} - -export { isSVGSVGElement }; -//# sourceMappingURL=is-svg-svg-element.mjs.map diff --git a/node_modules/motion-dom/dist/es/utils/is-svg-svg-element.mjs.map b/node_modules/motion-dom/dist/es/utils/is-svg-svg-element.mjs.map deleted file mode 100644 index 80b46cf..0000000 --- a/node_modules/motion-dom/dist/es/utils/is-svg-svg-element.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"is-svg-svg-element.mjs","sources":["../../../src/utils/is-svg-svg-element.ts"],"sourcesContent":["import { isSVGElement } from \"./is-svg-element\"\n\n/**\n * Checks if an element is specifically an SVGSVGElement (the root SVG element)\n * in a way that works across iframes\n */\nexport function isSVGSVGElement(element: unknown): element is SVGSVGElement {\n return isSVGElement(element) && element.tagName === \"svg\"\n}\n"],"names":[],"mappings":";;AAEA;;;AAGG;AACG,SAAU,eAAe,CAAC,OAAgB,EAAA;IAC5C,OAAO,YAAY,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC,OAAO,KAAK,KAAK;AAC7D;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/utils/mix/color.mjs b/node_modules/motion-dom/dist/es/utils/mix/color.mjs deleted file mode 100644 index 5c1bc4b..0000000 --- a/node_modules/motion-dom/dist/es/utils/mix/color.mjs +++ /dev/null @@ -1,48 +0,0 @@ -import { warning } from 'motion-utils'; -import { hex } from '../../value/types/color/hex.mjs'; -import { hsla } from '../../value/types/color/hsla.mjs'; -import { hslaToRgba } from '../../value/types/color/hsla-to-rgba.mjs'; -import { rgba } from '../../value/types/color/rgba.mjs'; -import { mixImmediate } from './immediate.mjs'; -import { mixNumber } from './number.mjs'; - -// Linear color space blending -// Explained https://www.youtube.com/watch?v=LKnqECcg6Gw -// Demonstrated http://codepen.io/osublake/pen/xGVVaN -const mixLinearColor = (from, to, v) => { - const fromExpo = from * from; - const expo = v * (to * to - fromExpo) + fromExpo; - return expo < 0 ? 0 : Math.sqrt(expo); -}; -const colorTypes = [hex, rgba, hsla]; -const getColorType = (v) => colorTypes.find((type) => type.test(v)); -function asRGBA(color) { - const type = getColorType(color); - warning(Boolean(type), `'${color}' is not an animatable color. Use the equivalent color code instead.`, "color-not-animatable"); - if (!Boolean(type)) - return false; - let model = type.parse(color); - if (type === hsla) { - // TODO Remove this cast - needed since Motion's stricter typing - model = hslaToRgba(model); - } - return model; -} -const mixColor = (from, to) => { - const fromRGBA = asRGBA(from); - const toRGBA = asRGBA(to); - if (!fromRGBA || !toRGBA) { - return mixImmediate(from, to); - } - const blended = { ...fromRGBA }; - return (v) => { - blended.red = mixLinearColor(fromRGBA.red, toRGBA.red, v); - blended.green = mixLinearColor(fromRGBA.green, toRGBA.green, v); - blended.blue = mixLinearColor(fromRGBA.blue, toRGBA.blue, v); - blended.alpha = mixNumber(fromRGBA.alpha, toRGBA.alpha, v); - return rgba.transform(blended); - }; -}; - -export { mixColor, mixLinearColor }; -//# sourceMappingURL=color.mjs.map diff --git a/node_modules/motion-dom/dist/es/utils/mix/color.mjs.map b/node_modules/motion-dom/dist/es/utils/mix/color.mjs.map deleted file mode 100644 index e5228d6..0000000 --- a/node_modules/motion-dom/dist/es/utils/mix/color.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"color.mjs","sources":["../../../../src/utils/mix/color.ts"],"sourcesContent":["import { warning } from \"motion-utils\"\nimport { hex } from \"../../value/types/color/hex\"\nimport { hsla } from \"../../value/types/color/hsla\"\nimport { hslaToRgba } from \"../../value/types/color/hsla-to-rgba\"\nimport { rgba } from \"../../value/types/color/rgba\"\nimport { Color, HSLA, RGBA } from \"../../value/types/types\"\nimport { mixImmediate } from \"./immediate\"\nimport { mixNumber } from \"./number\"\n\n// Linear color space blending\n// Explained https://www.youtube.com/watch?v=LKnqECcg6Gw\n// Demonstrated http://codepen.io/osublake/pen/xGVVaN\nexport const mixLinearColor = (from: number, to: number, v: number) => {\n const fromExpo = from * from\n const expo = v * (to * to - fromExpo) + fromExpo\n return expo < 0 ? 0 : Math.sqrt(expo)\n}\n\nconst colorTypes = [hex, rgba, hsla]\nconst getColorType = (v: Color | string) =>\n colorTypes.find((type) => type.test(v))\n\nfunction asRGBA(color: Color | string) {\n const type = getColorType(color)\n\n warning(\n Boolean(type),\n `'${color}' is not an animatable color. Use the equivalent color code instead.`,\n \"color-not-animatable\"\n )\n\n if (!Boolean(type)) return false\n\n let model = type!.parse(color)\n\n if (type === hsla) {\n // TODO Remove this cast - needed since Motion's stricter typing\n model = hslaToRgba(model as HSLA)\n }\n\n return model as RGBA\n}\n\nexport const mixColor = (from: Color | string, to: Color | string) => {\n const fromRGBA = asRGBA(from)\n const toRGBA = asRGBA(to)\n\n if (!fromRGBA || !toRGBA) {\n return mixImmediate(from, to)\n }\n\n const blended = { ...fromRGBA }\n\n return (v: number) => {\n blended.red = mixLinearColor(fromRGBA.red, toRGBA.red, v)\n blended.green = mixLinearColor(fromRGBA.green, toRGBA.green, v)\n blended.blue = mixLinearColor(fromRGBA.blue, toRGBA.blue, v)\n blended.alpha = mixNumber(fromRGBA.alpha, toRGBA.alpha, v)\n return rgba.transform!(blended)\n }\n}\n"],"names":[],"mappings":";;;;;;;;AASA;AACA;AACA;AACO,MAAM,cAAc,GAAG,CAAC,IAAY,EAAE,EAAU,EAAE,CAAS,KAAI;AAClE,IAAA,MAAM,QAAQ,GAAG,IAAI,GAAG,IAAI;AAC5B,IAAA,MAAM,IAAI,GAAG,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,QAAQ,CAAC,GAAG,QAAQ;AAChD,IAAA,OAAO,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;AACzC;AAEA,MAAM,UAAU,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC;AACpC,MAAM,YAAY,GAAG,CAAC,CAAiB,KACnC,UAAU,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,IAA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SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;AAC1D,QAAA,OAAO,IAAI,CAAC,SAAU,CAAC,OAAO,CAAC;AACnC,IAAA,CAAC;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/utils/mix/complex.mjs b/node_modules/motion-dom/dist/es/utils/mix/complex.mjs deleted file mode 100644 index 687a641..0000000 --- a/node_modules/motion-dom/dist/es/utils/mix/complex.mjs +++ /dev/null @@ -1,93 +0,0 @@ -import { pipe, warning } from 'motion-utils'; -import { isCSSVariableToken } from '../../animation/utils/is-css-variable.mjs'; -import { color } from '../../value/types/color/index.mjs'; -import { complex, analyseComplexValue } from '../../value/types/complex/index.mjs'; -import { mixColor } from './color.mjs'; -import { mixImmediate } from './immediate.mjs'; -import { mixNumber as mixNumber$1 } from './number.mjs'; -import { invisibleValues, mixVisibility } from './visibility.mjs'; - -function mixNumber(a, b) { - return (p) => mixNumber$1(a, b, p); -} -function getMixer(a) { - if (typeof a === "number") { - return mixNumber; - } - else if (typeof a === "string") { - return isCSSVariableToken(a) - ? mixImmediate - : color.test(a) - ? mixColor - : mixComplex; - } - else if (Array.isArray(a)) { - return mixArray; - } - else if (typeof a === "object") { - return color.test(a) ? mixColor : mixObject; - } - return mixImmediate; -} -function mixArray(a, b) { - const output = [...a]; - const numValues = output.length; - const blendValue = a.map((v, i) => getMixer(v)(v, b[i])); - return (p) => { - for (let i = 0; i < numValues; i++) { - output[i] = blendValue[i](p); - } - return output; - }; -} -function mixObject(a, b) { - const output = { ...a, ...b }; - const blendValue = {}; - for (const key in output) { - if (a[key] !== undefined && b[key] !== undefined) { - blendValue[key] = getMixer(a[key])(a[key], b[key]); - } - } - return (v) => { - for (const key in blendValue) { - output[key] = blendValue[key](v); - } - return output; - }; -} -function matchOrder(origin, target) { - const orderedOrigin = []; - const pointers = { color: 0, var: 0, number: 0 }; - for (let i = 0; i < target.values.length; i++) { - const type = target.types[i]; - const originIndex = origin.indexes[type][pointers[type]]; - const originValue = origin.values[originIndex] ?? 0; - orderedOrigin[i] = originValue; - pointers[type]++; - } - return orderedOrigin; -} -const mixComplex = (origin, target) => { - const template = complex.createTransformer(target); - const originStats = analyseComplexValue(origin); - const targetStats = analyseComplexValue(target); - const canInterpolate = originStats.indexes.var.length === targetStats.indexes.var.length && - originStats.indexes.color.length === targetStats.indexes.color.length && - originStats.indexes.number.length >= targetStats.indexes.number.length; - if (canInterpolate) { - if ((invisibleValues.has(origin) && - !targetStats.values.length) || - (invisibleValues.has(target) && - !originStats.values.length)) { - return mixVisibility(origin, target); - } - return pipe(mixArray(matchOrder(originStats, targetStats), targetStats.values), template); - } - else { - warning(true, `Complex values '${origin}' and '${target}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`, "complex-values-different"); - return mixImmediate(origin, target); - } -}; - -export { getMixer, mixArray, mixComplex, mixObject }; -//# sourceMappingURL=complex.mjs.map diff --git a/node_modules/motion-dom/dist/es/utils/mix/complex.mjs.map b/node_modules/motion-dom/dist/es/utils/mix/complex.mjs.map deleted file mode 100644 index 61d8812..0000000 --- a/node_modules/motion-dom/dist/es/utils/mix/complex.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"complex.mjs","sources":["../../../../src/utils/mix/complex.ts"],"sourcesContent":["import { pipe, warning } from \"motion-utils\"\nimport { AnyResolvedKeyframe } from \"../../animation/types\"\nimport { isCSSVariableToken } from \"../../animation/utils/is-css-variable\"\nimport { color } from \"../../value/types/color\"\nimport {\n analyseComplexValue,\n complex,\n ComplexValueInfo,\n ComplexValues,\n} from \"../../value/types/complex\"\nimport { HSLA, RGBA } from \"../../value/types/types\"\nimport { mixColor } from \"./color\"\nimport { mixImmediate } from \"./immediate\"\nimport { mixNumber as mixNumberImmediate } from \"./number\"\nimport { invisibleValues, mixVisibility } from \"./visibility\"\n\ntype MixableArray = Array\ninterface MixableObject {\n [key: string]: AnyResolvedKeyframe | RGBA | HSLA\n}\n\nfunction mixNumber(a: number, b: number) {\n return (p: number) => mixNumberImmediate(a, b, p)\n}\n\nexport function getMixer(a: T) {\n if (typeof a === \"number\") {\n return mixNumber\n } else if (typeof a === \"string\") {\n return isCSSVariableToken(a)\n ? mixImmediate\n : color.test(a)\n ? mixColor\n : mixComplex\n } else if (Array.isArray(a)) {\n return mixArray\n } else if (typeof a === \"object\") {\n return color.test(a) ? mixColor : mixObject\n }\n\n return mixImmediate\n}\n\nexport function mixArray(a: MixableArray, b: MixableArray) {\n const output = [...a]\n const numValues = output.length\n\n const blendValue = a.map((v, i) => getMixer(v)(v as any, b[i] as any))\n\n return (p: number) => {\n for (let i = 0; i < numValues; i++) {\n output[i] = blendValue[i](p) as any\n }\n return output\n }\n}\n\nexport function mixObject(a: MixableObject, b: MixableObject) {\n const output = { ...a, ...b }\n const blendValue: { [key: string]: (v: number) => any } = {}\n\n for (const key in output) {\n if (a[key] !== undefined && b[key] !== undefined) {\n blendValue[key] = getMixer(a[key])(\n a[key] as any,\n b[key] as any\n ) as any\n }\n }\n\n return (v: number) => {\n for (const key in blendValue) {\n output[key] = blendValue[key](v)\n }\n return output\n }\n}\n\nfunction matchOrder(\n origin: ComplexValueInfo,\n target: ComplexValueInfo\n): ComplexValues {\n const orderedOrigin: ComplexValues = []\n\n const pointers = { color: 0, var: 0, number: 0 }\n\n for (let i = 0; i < target.values.length; i++) {\n const type = target.types[i]\n const originIndex = origin.indexes[type][pointers[type]]\n const originValue = origin.values[originIndex] ?? 0\n\n orderedOrigin[i] = originValue\n\n pointers[type]++\n }\n\n return orderedOrigin\n}\n\nexport const mixComplex = (\n origin: AnyResolvedKeyframe,\n target: AnyResolvedKeyframe\n) => {\n const template = complex.createTransformer(target)\n const originStats = analyseComplexValue(origin)\n const targetStats = analyseComplexValue(target)\n const canInterpolate =\n originStats.indexes.var.length === targetStats.indexes.var.length &&\n originStats.indexes.color.length === targetStats.indexes.color.length &&\n originStats.indexes.number.length >= targetStats.indexes.number.length\n\n if (canInterpolate) {\n if (\n (invisibleValues.has(origin as string) &&\n !targetStats.values.length) ||\n (invisibleValues.has(target as string) &&\n !originStats.values.length)\n ) {\n return mixVisibility(origin as string, target as string)\n }\n\n return pipe(\n mixArray(matchOrder(originStats, targetStats), targetStats.values),\n template\n )\n } else {\n warning(\n true,\n `Complex values '${origin}' and '${target}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,\n \"complex-values-different\"\n )\n\n return mixImmediate(origin, target)\n }\n}\n"],"names":["mixNumberImmediate"],"mappings":";;;;;;;;;AAqBA,SAAS,SAAS,CAAC,CAAS,EAAE,CAAS,EAAA;AACnC,IAAA,OAAO,CAAC,CAAS,KAAKA,WAAkB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;AACrD;AAEM,SAAU,QAAQ,CAAI,CAAI,EAAA;AAC5B,IAAA,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE;AACvB,QAAA,OAAO,SAAS;IACpB;AAAO,SAAA,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE;QAC9B,OAAO,kBAAkB,CAAC,CAAC;AACvB,cAAE;AACF,cAAE,KAAK,CAAC,IAAI,CAAC,CAAC;AACd,kBAAE;kBACA,UAAU;IACpB;AAAO,SAAA,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;AACzB,QAAA,OAAO,QAAQ;IACnB;AAAO,SAAA,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE;AAC9B,QAAA,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,QAAQ,GAAG,SAAS;IAC/C;AAEA,IAAA,OAAO,YAAY;AACvB;AAEM,SAAU,QAAQ,CAAC,CAAe,EAAE,CAAe,EAAA;AACrD,IAAA,MAAM,MAAM,GAAG,CAAC,GAAG,CAAC,CAAC;AACrB,IAAA,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM;IAE/B,MAAM,UAAU,GAAG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AgB,CAAC;AAClC,gBAAA,CAAC,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,EACjC;AACE,YAAA,OAAO,aAAa,CAAC,MAAgB,EAAE,MAAgB,CAAC;QAC5D;AAEA,QAAA,OAAO,IAAI,CACP,QAAQ,CAAC,UAAU,CAAC,WAAW,EAAE,WAAW,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,EAClE,QAAQ,CACX;IACL;SAAO;QACH,OAAO,CACH,IAAI,EACJ,CAAA,gBAAA,EAAmB,MAAM,CAAA,OAAA,EAAU,MAAM,CAAA,wKAAA,CAA0K,EACnN,0BAA0B,CAC7B;AAED,QAAA,OAAO,YAAY,CAAC,MAAM,EAAE,MAAM,CAAC;IACvC;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/utils/mix/immediate.mjs b/node_modules/motion-dom/dist/es/utils/mix/immediate.mjs deleted file mode 100644 index 12ca872..0000000 --- a/node_modules/motion-dom/dist/es/utils/mix/immediate.mjs +++ /dev/null @@ -1,6 +0,0 @@ -function mixImmediate(a, b) { - return (p) => (p > 0 ? b : a); -} - -export { mixImmediate }; -//# sourceMappingURL=immediate.mjs.map diff --git a/node_modules/motion-dom/dist/es/utils/mix/immediate.mjs.map b/node_modules/motion-dom/dist/es/utils/mix/immediate.mjs.map deleted file mode 100644 index 7b75737..0000000 --- a/node_modules/motion-dom/dist/es/utils/mix/immediate.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"immediate.mjs","sources":["../../../../src/utils/mix/immediate.ts"],"sourcesContent":["export function mixImmediate(a: T, b: T) {\n return (p: number) => (p > 0 ? b : a)\n}\n"],"names":[],"mappings":"AAAM,SAAU,YAAY,CAAI,CAAI,EAAE,CAAI,EAAA;AACtC,IAAA,OAAO,CAAC,CAAS,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AACzC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/utils/mix/index.mjs b/node_modules/motion-dom/dist/es/utils/mix/index.mjs deleted file mode 100644 index e41e103..0000000 --- a/node_modules/motion-dom/dist/es/utils/mix/index.mjs +++ /dev/null @@ -1,15 +0,0 @@ -import { getMixer } from './complex.mjs'; -import { mixNumber } from './number.mjs'; - -function mix(from, to, p) { - if (typeof from === "number" && - typeof to === "number" && - typeof p === "number") { - return mixNumber(from, to, p); - } - const mixer = getMixer(from); - return mixer(from, to); -} - -export { mix }; -//# sourceMappingURL=index.mjs.map diff --git a/node_modules/motion-dom/dist/es/utils/mix/index.mjs.map b/node_modules/motion-dom/dist/es/utils/mix/index.mjs.map deleted file mode 100644 index 3b7d1d9..0000000 --- a/node_modules/motion-dom/dist/es/utils/mix/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs","sources":["../../../../src/utils/mix/index.ts"],"sourcesContent":["import { getMixer } from \"./complex\"\nimport { mixNumber as mixNumberImmediate } from \"./number\"\nimport { Mixer } from \"./types\"\n\nexport function mix(from: T, to: T): Mixer\nexport function mix(from: number, to: number, p: number): number\nexport function mix(from: T, to: T, p?: T): Mixer | number {\n if (\n typeof from === \"number\" &&\n typeof to === \"number\" &&\n typeof p === \"number\"\n ) {\n return mixNumberImmediate(from, to, p)\n }\n\n const mixer = getMixer(from)\n return mixer(from as any, to as any) as Mixer\n}\n"],"names":["mixNumberImmediate"],"mappings":";;;SAMgB,GAAG,CAAI,IAAO,EAAE,EAAK,EAAE,CAAK,EAAA;IACxC,IACI,OAAO,IAAI,KAAK,QAAQ;QACxB,OAAO,EAAE,KAAK,QAAQ;AACtB,QAAA,OAAO,CAAC,KAAK,QAAQ,EACvB;QACE,OAAOA,SAAkB,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;IAC1C;AAEA,IAAA,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC;AAC5B,IAAA,OAAO,KAAK,CAAC,IAAW,EAAE,EAAS,CAAa;AACpD;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/utils/mix/number.mjs b/node_modules/motion-dom/dist/es/utils/mix/number.mjs deleted file mode 100644 index 1e19dfc..0000000 --- a/node_modules/motion-dom/dist/es/utils/mix/number.mjs +++ /dev/null @@ -1,27 +0,0 @@ -/* - Value in range from progress - - Given a lower limit and an upper limit, we return the value within - that range as expressed by progress (usually a number from 0 to 1) - - So progress = 0.5 would change - - from -------- to - - to - - from ---- to - - E.g. from = 10, to = 20, progress = 0.5 => 15 - - @param [number]: Lower limit of range - @param [number]: Upper limit of range - @param [number]: The progress between lower and upper limits expressed 0-1 - @return [number]: Value as calculated from progress within range (not limited within range) -*/ -const mixNumber = (from, to, progress) => { - return from + (to - from) * progress; -}; - -export { mixNumber }; -//# sourceMappingURL=number.mjs.map diff --git a/node_modules/motion-dom/dist/es/utils/mix/number.mjs.map b/node_modules/motion-dom/dist/es/utils/mix/number.mjs.map deleted file mode 100644 index c4414bc..0000000 --- a/node_modules/motion-dom/dist/es/utils/mix/number.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"number.mjs","sources":["../../../../src/utils/mix/number.ts"],"sourcesContent":["/*\n Value in range from progress\n\n Given a lower limit and an upper limit, we return the value within\n that range as expressed by progress (usually a number from 0 to 1)\n\n So progress = 0.5 would change\n\n from -------- to\n\n to\n\n from ---- to\n\n E.g. from = 10, to = 20, progress = 0.5 => 15\n\n @param [number]: Lower limit of range\n @param [number]: Upper limit of range\n @param [number]: The progress between lower and upper limits expressed 0-1\n @return [number]: Value as calculated from progress within range (not limited within range)\n*/\nexport const mixNumber = (from: number, to: number, progress: number) => {\n return from + (to - from) * progress\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;AAoBE;AACK,MAAM,SAAS,GAAG,CAAC,IAAY,EAAE,EAAU,EAAE,QAAgB,KAAI;IACpE,OAAO,IAAI,GAAG,CAAC,EAAE,GAAG,IAAI,IAAI,QAAQ;AACxC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/utils/mix/visibility.mjs b/node_modules/motion-dom/dist/es/utils/mix/visibility.mjs deleted file mode 100644 index 3810ffe..0000000 --- a/node_modules/motion-dom/dist/es/utils/mix/visibility.mjs +++ /dev/null @@ -1,17 +0,0 @@ -const invisibleValues = new Set(["none", "hidden"]); -/** - * Returns a function that, when provided a progress value between 0 and 1, - * will return the "none" or "hidden" string only when the progress is that of - * the origin or target. - */ -function mixVisibility(origin, target) { - if (invisibleValues.has(origin)) { - return (p) => (p <= 0 ? origin : target); - } - else { - return (p) => (p >= 1 ? target : origin); - } -} - -export { invisibleValues, mixVisibility }; -//# sourceMappingURL=visibility.mjs.map diff --git a/node_modules/motion-dom/dist/es/utils/mix/visibility.mjs.map b/node_modules/motion-dom/dist/es/utils/mix/visibility.mjs.map deleted file mode 100644 index 76ac7b6..0000000 --- a/node_modules/motion-dom/dist/es/utils/mix/visibility.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"visibility.mjs","sources":["../../../../src/utils/mix/visibility.ts"],"sourcesContent":["export const invisibleValues = new Set([\"none\", \"hidden\"])\n\n/**\n * Returns a function that, when provided a progress value between 0 and 1,\n * will return the \"none\" or \"hidden\" string only when the progress is that of\n * the origin or target.\n */\nexport function mixVisibility(origin: string, target: string) {\n if (invisibleValues.has(origin)) {\n return (p: number) => (p <= 0 ? origin : target)\n } else {\n return (p: number) => (p >= 1 ? target : origin)\n }\n}\n"],"names":[],"mappings":"AAAO,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,QAAQ,CAAC;AAEzD;;;;AAIG;AACG,SAAU,aAAa,CAAC,MAAc,EAAE,MAAc,EAAA;AACxD,IAAA,IAAI,eAAe,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;AAC7B,QAAA,OAAO,CAAC,CAAS,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,GAAG,MAAM,CAAC;IACpD;SAAO;AACH,QAAA,OAAO,CAAC,CAAS,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,GAAG,MAAM,CAAC;IACpD;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/utils/resolve-elements.mjs b/node_modules/motion-dom/dist/es/utils/resolve-elements.mjs deleted file mode 100644 index a90b0c3..0000000 --- a/node_modules/motion-dom/dist/es/utils/resolve-elements.mjs +++ /dev/null @@ -1,21 +0,0 @@ -function resolveElements(elementOrSelector, scope, selectorCache) { - if (elementOrSelector == null) { - return []; - } - if (elementOrSelector instanceof EventTarget) { - return [elementOrSelector]; - } - else if (typeof elementOrSelector === "string") { - let root = document; - if (scope) { - root = scope.current; - } - const elements = selectorCache?.[elementOrSelector] ?? - root.querySelectorAll(elementOrSelector); - return elements ? Array.from(elements) : []; - } - return Array.from(elementOrSelector).filter((element) => element != null); -} - -export { resolveElements }; -//# sourceMappingURL=resolve-elements.mjs.map diff --git a/node_modules/motion-dom/dist/es/utils/resolve-elements.mjs.map b/node_modules/motion-dom/dist/es/utils/resolve-elements.mjs.map deleted file mode 100644 index 3944813..0000000 --- a/node_modules/motion-dom/dist/es/utils/resolve-elements.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"resolve-elements.mjs","sources":["../../../src/utils/resolve-elements.ts"],"sourcesContent":["export type ElementOrSelector =\n | Element\n | Element[]\n | NodeListOf\n | string\n | null\n | undefined\n\nexport interface WithQuerySelectorAll {\n querySelectorAll: Element[\"querySelectorAll\"]\n}\n\nexport interface AnimationScope {\n readonly current: T\n animations: any[] // TODO: Refactor to types package AnimationPlaybackControls[]\n}\n\nexport interface SelectorCache {\n [key: string]: NodeListOf\n}\n\nexport function resolveElements(\n elementOrSelector: ElementOrSelector,\n scope?: AnimationScope,\n selectorCache?: SelectorCache\n): Element[] {\n if (elementOrSelector == null) {\n return []\n }\n\n if (elementOrSelector instanceof EventTarget) {\n return [elementOrSelector]\n } else if (typeof elementOrSelector === \"string\") {\n let root: WithQuerySelectorAll = document\n\n if (scope) {\n root = scope.current\n }\n\n const elements =\n selectorCache?.[elementOrSelector] ??\n root.querySelectorAll(elementOrSelector)\n\n return elements ? Array.from(elements) : []\n }\n\n return Array.from(elementOrSelector).filter(\n (element): element is Element => element != null\n )\n}\n"],"names":[],"mappings":"SAqBgB,eAAe,CAC3B,iBAAoC,EACpC,KAAsB,EACtB,aAA6B,EAAA;AAE7B,IAAA,IAAI,iBAAiB,IAAI,IAAI,EAAE;AAC3B,QAAA,OAAO,EAAE;IACb;AAEA,IAAA,IAAI,iBAAiB,YAAY,WAAW,EAAE;QAC1C,OAAO,CAAC,iBAAiB,CAAC;IAC9B;AAAO,SAAA,IAAI,OAAO,iBAAiB,KAAK,QAAQ,EAAE;QAC9C,IAAI,IAAI,GAAyB,QAAQ;QAEzC,IAAI,KAAK,EAAE;AACP,YAAA,IAAI,GAAG,KAAK,CAAC,OAAO;QACxB;AAEA,QAAA,MAAM,QAAQ,GACV,aAAa,GAAG,iBAAiB,CAAC;AAClC,YAAA,IAAI,CAAC,gBAAgB,CAAC,iBAAiB,CAAC;AAE5C,QAAA,OAAO,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE;IAC/C;AAEA,IAAA,OAAO,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,MAAM,CACvC,CAAC,OAAO,KAAyB,OAAO,IAAI,IAAI,CACnD;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/utils/stagger.mjs b/node_modules/motion-dom/dist/es/utils/stagger.mjs deleted file mode 100644 index ed9b469..0000000 --- a/node_modules/motion-dom/dist/es/utils/stagger.mjs +++ /dev/null @@ -1,27 +0,0 @@ -import { easingDefinitionToFunction } from 'motion-utils'; - -function getOriginIndex(from, total) { - if (from === "first") { - return 0; - } - else { - const lastIndex = total - 1; - return from === "last" ? lastIndex : lastIndex / 2; - } -} -function stagger(duration = 0.1, { startDelay = 0, from = 0, ease } = {}) { - return (i, total) => { - const fromIndex = typeof from === "number" ? from : getOriginIndex(from, total); - const distance = Math.abs(fromIndex - i); - let delay = duration * distance; - if (ease) { - const maxDelay = total * duration; - const easingFunction = easingDefinitionToFunction(ease); - delay = easingFunction(delay / maxDelay) * maxDelay; - } - return startDelay + delay; - }; -} - -export { getOriginIndex, stagger }; -//# sourceMappingURL=stagger.mjs.map diff --git a/node_modules/motion-dom/dist/es/utils/stagger.mjs.map b/node_modules/motion-dom/dist/es/utils/stagger.mjs.map deleted file mode 100644 index 96d6e9c..0000000 --- a/node_modules/motion-dom/dist/es/utils/stagger.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"stagger.mjs","sources":["../../../src/utils/stagger.ts"],"sourcesContent":["import { Easing, easingDefinitionToFunction } from \"motion-utils\"\nimport { DynamicOption } from \"../animation/types\"\n\nexport type StaggerOrigin = \"first\" | \"last\" | \"center\" | number\n\nexport type StaggerOptions = {\n startDelay?: number\n from?: StaggerOrigin\n ease?: Easing\n}\n\nexport function getOriginIndex(from: StaggerOrigin, total: number) {\n if (from === \"first\") {\n return 0\n } else {\n const lastIndex = total - 1\n return from === \"last\" ? lastIndex : lastIndex / 2\n }\n}\n\nexport function stagger(\n duration: number = 0.1,\n { startDelay = 0, from = 0, ease }: StaggerOptions = {}\n): DynamicOption {\n return (i: number, total: number) => {\n const fromIndex =\n typeof from === \"number\" ? from : getOriginIndex(from, total)\n const distance = Math.abs(fromIndex - i)\n let delay = duration * distance\n\n if (ease) {\n const maxDelay = total * duration\n const easingFunction = easingDefinitionToFunction(ease)\n delay = easingFunction(delay / maxDelay) * maxDelay\n }\n\n return startDelay + delay\n }\n}\n"],"names":[],"mappings":";;AAWM,SAAU,cAAc,CAAC,IAAmB,EAAE,KAAa,EAAA;AAC7D,IAAA,IAAI,IAAI,KAAK,OAAO,EAAE;AAClB,QAAA,OAAO,CAAC;IACZ;SAAO;AACH,QAAA,MAAM,SAAS,GAAG,KAAK,GAAG,CAAC;AAC3B,QAAA,OAAO,IAAI,KAAK,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,CAAC;IACtD;AACJ;SAEgB,OAAO,CACnB,QAAA,GAAmB,GAAG,EACtB,EAAE,UAAU,GAAG,CAAC,EAAE,IAAI,GAAG,CAAC,EAAE,IAAI,KAAqB,EAAE,EAAA;AAEvD,IAAA,OAAO,CAAC,CAAS,EAAE,KAAa,KAAI;AAChC,QAAA,MAAM,SAAS,GACX,OAAO,IAAI,KAAK,QAAQ,GAAG,IAAI,GAAG,cAAc,CAAC,IAAI,EAAE,KAAK,CAAC;QACjE,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,GAAG,CAAC,CAAC;AACxC,QAAA,IAAI,KAAK,GAAG,QAAQ,GAAG,QAAQ;QAE/B,IAAI,IAAI,EAAE;AACN,YAAA,MAAM,QAAQ,GAAG,KAAK,GAAG,QAAQ;AACjC,YAAA,MAAM,cAAc,GAAG,0BAA0B,CAAC,IAAI,CAAC;YACvD,KAAK,GAAG,cAAc,CAAC,KAAK,GAAG,QAAQ,CAAC,GAAG,QAAQ;QACvD;QAEA,OAAO,UAAU,GAAG,KAAK;AAC7B,IAAA,CAAC;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/utils/supports/flags.mjs b/node_modules/motion-dom/dist/es/utils/supports/flags.mjs deleted file mode 100644 index e0682b1..0000000 --- a/node_modules/motion-dom/dist/es/utils/supports/flags.mjs +++ /dev/null @@ -1,8 +0,0 @@ -/** - * Add the ability for test suites to manually set support flags - * to better test more environments. - */ -const supportsFlags = {}; - -export { supportsFlags }; -//# sourceMappingURL=flags.mjs.map diff --git a/node_modules/motion-dom/dist/es/utils/supports/flags.mjs.map b/node_modules/motion-dom/dist/es/utils/supports/flags.mjs.map deleted file mode 100644 index bd44b30..0000000 --- a/node_modules/motion-dom/dist/es/utils/supports/flags.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"flags.mjs","sources":["../../../../src/utils/supports/flags.ts"],"sourcesContent":["/**\n * Add the ability for test suites to manually set support flags\n * to better test more environments.\n */\nexport const supportsFlags: Record = {}\n"],"names":[],"mappings":"AAAA;;;AAGG;AACI,MAAM,aAAa,GAAwC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/utils/supports/linear-easing.mjs b/node_modules/motion-dom/dist/es/utils/supports/linear-easing.mjs deleted file mode 100644 index 38f3729..0000000 --- a/node_modules/motion-dom/dist/es/utils/supports/linear-easing.mjs +++ /dev/null @@ -1,16 +0,0 @@ -import { memoSupports } from './memo.mjs'; - -const supportsLinearEasing = /*@__PURE__*/ memoSupports(() => { - try { - document - .createElement("div") - .animate({ opacity: 0 }, { easing: "linear(0, 1)" }); - } - catch (e) { - return false; - } - return true; -}, "linearEasing"); - -export { supportsLinearEasing }; -//# sourceMappingURL=linear-easing.mjs.map diff --git a/node_modules/motion-dom/dist/es/utils/supports/linear-easing.mjs.map b/node_modules/motion-dom/dist/es/utils/supports/linear-easing.mjs.map deleted file mode 100644 index e44c3a6..0000000 --- a/node_modules/motion-dom/dist/es/utils/supports/linear-easing.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"linear-easing.mjs","sources":["../../../../src/utils/supports/linear-easing.ts"],"sourcesContent":["import { memoSupports } from \"./memo\"\n\nexport const supportsLinearEasing = /*@__PURE__*/ memoSupports(() => {\n try {\n document\n .createElement(\"div\")\n .animate({ opacity: 0 }, { easing: \"linear(0, 1)\" })\n } catch (e) {\n return false\n }\n return true\n}, \"linearEasing\")\n"],"names":[],"mappings":";;MAEa,oBAAoB,iBAAiB,YAAY,CAAC,MAAK;AAChE,IAAA,IAAI;QACA;aACK,aAAa,CAAC,KAAK;AACnB,aAAA,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC;IAC5D;IAAE,OAAO,CAAC,EAAE;AACR,QAAA,OAAO,KAAK;IAChB;AACA,IAAA,OAAO,IAAI;AACf,CAAC,EAAE,cAAc;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/utils/supports/memo.mjs b/node_modules/motion-dom/dist/es/utils/supports/memo.mjs deleted file mode 100644 index e8dd26a..0000000 --- a/node_modules/motion-dom/dist/es/utils/supports/memo.mjs +++ /dev/null @@ -1,10 +0,0 @@ -import { memo } from 'motion-utils'; -import { supportsFlags } from './flags.mjs'; - -function memoSupports(callback, supportsFlag) { - const memoized = memo(callback); - return () => supportsFlags[supportsFlag] ?? memoized(); -} - -export { memoSupports }; -//# sourceMappingURL=memo.mjs.map diff --git a/node_modules/motion-dom/dist/es/utils/supports/memo.mjs.map b/node_modules/motion-dom/dist/es/utils/supports/memo.mjs.map deleted file mode 100644 index 285c529..0000000 --- a/node_modules/motion-dom/dist/es/utils/supports/memo.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"memo.mjs","sources":["../../../../src/utils/supports/memo.ts"],"sourcesContent":["import { memo } from \"motion-utils\"\nimport { supportsFlags } from \"./flags\"\n\nexport function memoSupports(\n callback: () => T,\n supportsFlag: keyof typeof supportsFlags\n) {\n const memoized = memo(callback)\n return () => supportsFlags[supportsFlag] ?? memoized()\n}\n"],"names":[],"mappings":";;;AAGM,SAAU,YAAY,CACxB,QAAiB,EACjB,YAAwC,EAAA;AAExC,IAAA,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;IAC/B,OAAO,MAAM,aAAa,CAAC,YAAY,CAAC,IAAI,QAAQ,EAAE;AAC1D;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/utils/supports/scroll-timeline.mjs b/node_modules/motion-dom/dist/es/utils/supports/scroll-timeline.mjs deleted file mode 100644 index 59d9549..0000000 --- a/node_modules/motion-dom/dist/es/utils/supports/scroll-timeline.mjs +++ /dev/null @@ -1,7 +0,0 @@ -import { memoSupports } from './memo.mjs'; - -const supportsScrollTimeline = /* @__PURE__ */ memoSupports(() => window.ScrollTimeline !== undefined, "scrollTimeline"); -const supportsViewTimeline = /* @__PURE__ */ memoSupports(() => window.ViewTimeline !== undefined, "viewTimeline"); - -export { supportsScrollTimeline, supportsViewTimeline }; -//# sourceMappingURL=scroll-timeline.mjs.map diff --git a/node_modules/motion-dom/dist/es/utils/supports/scroll-timeline.mjs.map b/node_modules/motion-dom/dist/es/utils/supports/scroll-timeline.mjs.map deleted file mode 100644 index f05adaa..0000000 --- a/node_modules/motion-dom/dist/es/utils/supports/scroll-timeline.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"scroll-timeline.mjs","sources":["../../../../src/utils/supports/scroll-timeline.ts"],"sourcesContent":["import { ProgressTimeline } from \"../..\"\nimport { memoSupports } from \"./memo\"\n\ndeclare global {\n interface Window {\n ScrollTimeline: ScrollTimeline\n ViewTimeline: ViewTimeline\n }\n}\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\nexport const supportsScrollTimeline = /* @__PURE__ */ memoSupports(\n () => window.ScrollTimeline !== undefined,\n \"scrollTimeline\"\n)\n\nexport const supportsViewTimeline = /* @__PURE__ */ memoSupports(\n () => window.ViewTimeline !== undefined,\n \"viewTimeline\"\n)\n"],"names":[],"mappings":";;AA0BO,MAAM,sBAAsB,mBAAmB,YAAY,CAC9D,MAAM,MAAM,CAAC,cAAc,KAAK,SAAS,EACzC,gBAAgB;AAGb,MAAM,oBAAoB,mBAAmB,YAAY,CAC5D,MAAM,MAAM,CAAC,YAAY,KAAK,SAAS,EACvC,cAAc;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/utils/transform.mjs b/node_modules/motion-dom/dist/es/utils/transform.mjs deleted file mode 100644 index 74b624e..0000000 --- a/node_modules/motion-dom/dist/es/utils/transform.mjs +++ /dev/null @@ -1,15 +0,0 @@ -import { interpolate } from './interpolate.mjs'; - -function transform(...args) { - const useImmediate = !Array.isArray(args[0]); - const argOffset = useImmediate ? 0 : -1; - const inputValue = args[0 + argOffset]; - const inputRange = args[1 + argOffset]; - const outputRange = args[2 + argOffset]; - const options = args[3 + argOffset]; - const interpolator = interpolate(inputRange, outputRange, options); - return useImmediate ? interpolator(inputValue) : interpolator; -} - -export { transform }; -//# sourceMappingURL=transform.mjs.map diff --git a/node_modules/motion-dom/dist/es/utils/transform.mjs.map b/node_modules/motion-dom/dist/es/utils/transform.mjs.map deleted file mode 100644 index 462be81..0000000 --- a/node_modules/motion-dom/dist/es/utils/transform.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"transform.mjs","sources":["../../../src/utils/transform.ts"],"sourcesContent":["import { EasingFunction } from \"motion-utils\"\nimport { interpolate } from \"./interpolate\"\n\n/**\n * @public\n */\nexport interface TransformOptions {\n /**\n * Clamp values to within the given range. Defaults to `true`\n *\n * @public\n */\n clamp?: boolean\n\n /**\n * Easing functions to use on the interpolations between each value in the input and output ranges.\n *\n * If provided as an array, the array must be one item shorter than the input and output ranges, as the easings apply to the transition **between** each.\n *\n * @public\n */\n ease?: EasingFunction | EasingFunction[]\n\n /**\n * Provide a function that can interpolate between any two values in the provided range.\n *\n * @public\n */\n mixer?: (from: T, to: T) => (v: number) => any\n}\n\n/**\n * Transforms numbers into other values by mapping them from an input range to an output range.\n * Returns the type of the input provided.\n *\n * @remarks\n *\n * Given an input range of `[0, 200]` and an output range of\n * `[0, 1]`, this function will return a value between `0` and `1`.\n * The input range must be a linear series of numbers. The output range\n * can be any supported value type, such as numbers, colors, shadows, arrays, objects and more.\n * Every value in the output range must be of the same type and in the same format.\n *\n * ```jsx\n * export function MyComponent() {\n * const inputRange = [0, 200]\n * const outputRange = [0, 1]\n * const output = transform(100, inputRange, outputRange)\n *\n * // Returns 0.5\n * return
{output}
\n * }\n * ```\n *\n * @param inputValue - A number to transform between the input and output ranges.\n * @param inputRange - A linear series of numbers (either all increasing or decreasing).\n * @param outputRange - A series of numbers, colors, strings, or arrays/objects of those. Must be the same length as `inputRange`.\n * @param options - Clamp: Clamp values to within the given range. Defaults to `true`.\n *\n * @public\n */\nexport function transform(\n inputValue: number,\n inputRange: number[],\n outputRange: T[],\n options?: TransformOptions\n): T\n/**\n *\n * Transforms numbers into other values by mapping them from an input range to an output range.\n *\n * Given an input range of `[0, 200]` and an output range of\n * `[0, 1]`, this function will return a value between `0` and `1`.\n * The input range must be a linear series of numbers. The output range\n * can be any supported value type, such as numbers, colors, shadows, arrays, objects and more.\n * Every value in the output range must be of the same type and in the same format.\n *\n * ```jsx\n * export function MyComponent() {\n * const inputRange = [-200, -100, 100, 200]\n * const outputRange = [0, 1, 1, 0]\n * const convertRange = transform(inputRange, outputRange)\n * const output = convertRange(-150)\n *\n * // Returns 0.5\n * return
{output}
\n * }\n *\n * ```\n *\n * @param inputRange - A linear series of numbers (either all increasing or decreasing).\n * @param outputRange - A series of numbers, colors or strings. Must be the same length as `inputRange`.\n * @param options - Clamp: clamp values to within the given range. Defaults to `true`.\n *\n * @public\n */\nexport function transform(\n inputRange: number[],\n outputRange: T[],\n options?: TransformOptions\n): (inputValue: number) => T\nexport function transform(\n ...args:\n | [number, number[], T[], TransformOptions?]\n | [number[], T[], TransformOptions?]\n) {\n const useImmediate = !Array.isArray(args[0])\n const argOffset = useImmediate ? 0 : -1\n const inputValue = args[0 + argOffset] as number\n const inputRange = args[1 + argOffset] as number[]\n const outputRange = args[2 + argOffset] as T[]\n const options = args[3 + argOffset] as TransformOptions\n\n const interpolator = interpolate(inputRange, outputRange, options)\n\n return useImmediate ? interpolator(inputValue) : interpolator\n}\n"],"names":[],"mappings":";;AAqGM,SAAU,SAAS,CACrB,GAAG,IAEwC,EAAA;AAE3C,IAAA,MAAM,YAAY,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAC5C,IAAA,MAAM,SAAS,GAAG,YAAY,GAAG,CAAC,GAAG,EAAE;IACvC,MAAM,UAAU,GAAG,IAAI,CAAC,CAAC,GAAG,SAAS,CAAW;IAChD,MAAM,UAAU,GAAG,IAAI,CAAC,CAAC,GAAG,SAAS,CAAa;IAClD,MAAM,WAAW,GAAG,IAAI,CAAC,CAAC,GAAG,SAAS,CAAQ;IAC9C,MAAM,OAAO,GAAG,IAAI,CAAC,CAAC,GAAG,SAAS,CAAwB;IAE1D,MAAM,YAAY,GAAG,WAAW,CAAC,UAAU,EAAE,WAAW,EAAE,OAAO,CAAC;AAElE,IAAA,OAAO,YAAY,GAAG,YAAY,CAAC,UAAU,CAAC,GAAG,YAAY;AACjE;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/follow-value.mjs b/node_modules/motion-dom/dist/es/value/follow-value.mjs deleted file mode 100644 index 8a23743..0000000 --- a/node_modules/motion-dom/dist/es/value/follow-value.mjs +++ /dev/null @@ -1,124 +0,0 @@ -import { motionValue } from './index.mjs'; -import { JSAnimation } from '../animation/JSAnimation.mjs'; -import { isMotionValue } from './utils/is-motion-value.mjs'; -import { frame } from '../frameloop/frame.mjs'; - -/** - * Create a `MotionValue` that animates to its latest value using any transition type. - * Can either be a value or track another `MotionValue`. - * - * ```jsx - * const x = motionValue(0) - * const y = followValue(x, { type: "spring", stiffness: 300 }) - * // or with tween - * const z = followValue(x, { type: "tween", duration: 0.5, ease: "easeOut" }) - * ``` - * - * @param source - Initial value or MotionValue to track - * @param options - Animation transition options - * @returns `MotionValue` - * - * @public - */ -function followValue(source, options) { - const initialValue = isMotionValue(source) ? source.get() : source; - const value = motionValue(initialValue); - attachFollow(value, source, options); - return value; -} -/** - * Attach an animation to a MotionValue that will animate whenever the value changes. - * Similar to attachSpring but supports any transition type (spring, tween, inertia, etc.) - * - * @param value - The MotionValue to animate - * @param source - Initial value or MotionValue to track - * @param options - Animation transition options - * @returns Cleanup function - * - * @public - */ -function attachFollow(value, source, options = {}) { - const initialValue = value.get(); - let activeAnimation = null; - let latestValue = initialValue; - let latestSetter; - const unit = typeof initialValue === "string" - ? initialValue.replace(/[\d.-]/g, "") - : undefined; - const stopAnimation = () => { - if (activeAnimation) { - activeAnimation.stop(); - activeAnimation = null; - } - value.animation = undefined; - }; - const startAnimation = () => { - const currentValue = asNumber(value.get()); - const targetValue = asNumber(latestValue); - // Don't animate if we're already at the target - if (currentValue === targetValue) { - stopAnimation(); - return; - } - // Use the running animation's analytical velocity for accuracy, - // falling back to the MotionValue's velocity for the initial animation. - // This prevents systematic velocity loss at high frame rates (240hz+). - const velocity = activeAnimation - ? activeAnimation.getGeneratorVelocity() - : value.getVelocity(); - stopAnimation(); - activeAnimation = new JSAnimation({ - keyframes: [currentValue, targetValue], - velocity, - // Default to spring if no type specified (matches useSpring behavior) - type: "spring", - restDelta: 0.001, - restSpeed: 0.01, - ...options, - onUpdate: latestSetter, - }); - }; - // Use a stable function reference so the frame loop Set deduplicates - // multiple calls within the same frame (e.g. rapid mouse events) - const scheduleAnimation = () => { - startAnimation(); - value.animation = activeAnimation ?? undefined; - value["events"].animationStart?.notify(); - activeAnimation?.then(() => { - value.animation = undefined; - value["events"].animationComplete?.notify(); - }); - }; - value.attach((v, set) => { - latestValue = v; - latestSetter = (latest) => set(parseValue(latest, unit)); - frame.postRender(scheduleAnimation); - }, stopAnimation); - if (isMotionValue(source)) { - let skipNextAnimation = options.skipInitialAnimation === true; - const removeSourceOnChange = source.on("change", (v) => { - if (skipNextAnimation) { - skipNextAnimation = false; - value.jump(parseValue(v, unit), false); - } - else { - value.set(parseValue(v, unit)); - } - }); - const removeValueOnDestroy = value.on("destroy", removeSourceOnChange); - return () => { - removeSourceOnChange(); - removeValueOnDestroy(); - }; - } - return stopAnimation; -} -function parseValue(v, unit) { - return unit ? v + unit : v; -} -function asNumber(v) { - return typeof v === "number" ? v : parseFloat(v); -} - -export { attachFollow, followValue }; -//# sourceMappingURL=follow-value.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/follow-value.mjs.map b/node_modules/motion-dom/dist/es/value/follow-value.mjs.map deleted file mode 100644 index ed56786..0000000 --- a/node_modules/motion-dom/dist/es/value/follow-value.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"follow-value.mjs","sources":["../../../src/value/follow-value.ts"],"sourcesContent":["import { MotionValue, motionValue } from \".\"\nimport { JSAnimation } from \"../animation/JSAnimation\"\nimport { AnyResolvedKeyframe, ValueAnimationTransition } from \"../animation/types\"\nimport { frame } from \"../frameloop\"\nimport { isMotionValue } from \"./utils/is-motion-value\"\n\n/**\n * Options for useFollowValue hook, extending ValueAnimationTransition\n * but excluding lifecycle callbacks that don't make sense for the hook pattern.\n */\nexport type FollowValueOptions = Omit<\n ValueAnimationTransition,\n \"onUpdate\" | \"onComplete\" | \"onPlay\" | \"onRepeat\" | \"onStop\"\n> & {\n /**\n * When true, the first change from a tracked `MotionValue` source\n * will jump to the new value instead of animating. Subsequent\n * changes animate normally. This prevents unwanted animations\n * on page refresh or back navigation (e.g. `useScroll` + `useSpring`).\n *\n * @default false\n */\n skipInitialAnimation?: boolean\n}\n\n/**\n * Create a `MotionValue` that animates to its latest value using any transition type.\n * Can either be a value or track another `MotionValue`.\n *\n * ```jsx\n * const x = motionValue(0)\n * const y = followValue(x, { type: \"spring\", stiffness: 300 })\n * // or with tween\n * const z = followValue(x, { type: \"tween\", duration: 0.5, ease: \"easeOut\" })\n * ```\n *\n * @param source - Initial value or MotionValue to track\n * @param options - Animation transition options\n * @returns `MotionValue`\n *\n * @public\n */\nexport function followValue(\n source: T | MotionValue,\n options?: FollowValueOptions\n) {\n const initialValue = isMotionValue(source) ? source.get() : source\n const value = motionValue(initialValue)\n\n attachFollow(value, source, options)\n\n return value\n}\n\n/**\n * Attach an animation to a MotionValue that will animate whenever the value changes.\n * Similar to attachSpring but supports any transition type (spring, tween, inertia, etc.)\n *\n * @param value - The MotionValue to animate\n * @param source - Initial value or MotionValue to track\n * @param options - Animation transition options\n * @returns Cleanup function\n *\n * @public\n */\nexport function attachFollow(\n value: MotionValue,\n source: T | MotionValue,\n options: FollowValueOptions = {}\n): VoidFunction {\n const initialValue = value.get()\n\n let activeAnimation: JSAnimation | null = null\n let latestValue = initialValue\n let latestSetter: (v: T) => void\n\n const unit =\n typeof initialValue === \"string\"\n ? initialValue.replace(/[\\d.-]/g, \"\")\n : undefined\n\n const stopAnimation = () => {\n if (activeAnimation) {\n activeAnimation.stop()\n activeAnimation = null\n }\n value.animation = undefined\n }\n\n const startAnimation = () => {\n const currentValue = asNumber(value.get())\n const targetValue = asNumber(latestValue)\n\n // Don't animate if we're already at the target\n if (currentValue === targetValue) {\n stopAnimation()\n return\n }\n\n // Use the running animation's analytical velocity for accuracy,\n // falling back to the MotionValue's velocity for the initial animation.\n // This prevents systematic velocity loss at high frame rates (240hz+).\n const velocity = activeAnimation\n ? activeAnimation.getGeneratorVelocity()\n : value.getVelocity()\n\n stopAnimation()\n\n activeAnimation = new JSAnimation({\n keyframes: [currentValue, targetValue],\n velocity,\n // Default to spring if no type specified (matches useSpring behavior)\n type: \"spring\",\n restDelta: 0.001,\n restSpeed: 0.01,\n ...options,\n onUpdate: latestSetter,\n })\n }\n\n // Use a stable function reference so the frame loop Set deduplicates\n // multiple calls within the same frame (e.g. rapid mouse events)\n const scheduleAnimation = () => {\n startAnimation()\n value.animation = activeAnimation ?? undefined\n value[\"events\"].animationStart?.notify()\n activeAnimation?.then(() => {\n value.animation = undefined\n value[\"events\"].animationComplete?.notify()\n })\n }\n\n value.attach((v, set) => {\n latestValue = v\n latestSetter = (latest) => set(parseValue(latest, unit) as T)\n frame.postRender(scheduleAnimation)\n }, stopAnimation)\n\n if (isMotionValue(source)) {\n let skipNextAnimation = options.skipInitialAnimation === true\n\n const removeSourceOnChange = source.on(\"change\", (v) => {\n if (skipNextAnimation) {\n skipNextAnimation = false\n value.jump(parseValue(v, unit) as T, false)\n } else {\n value.set(parseValue(v, unit) as T)\n }\n })\n\n const removeValueOnDestroy = value.on(\"destroy\", removeSourceOnChange)\n\n return () => {\n removeSourceOnChange()\n removeValueOnDestroy()\n }\n }\n\n return stopAnimation\n}\n\nfunction parseValue(v: AnyResolvedKeyframe, unit?: string) {\n return unit ? v + unit : v\n}\n\nfunction asNumber(v: AnyResolvedKeyframe) {\n return typeof v === \"number\" ? v : parseFloat(v)\n}\n"],"names":[],"mappings":";;;;;AAyBA;;;;;;;;;;;;;;;;AAgBG;AACG,SAAU,WAAW,CACvB,MAA0B,EAC1B,OAA4B,EAAA;AAE5B,IAAA,MAAM,YAAY,GAAG,aAAa,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,GAAG,EAAE,GAAG,MAAM;AAClE,IAAA,MAAM,KAAK,GAAG,WAAW,CAAC,YAAY,CAAC;AAEvC,IAAA,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC;AAEpC,IAAA,OAAO,KAAK;AAChB;AAEA;;;;;;;;;;AAUG;AACG,SAAU,YAAY,CACxB,KAAqB,EACrB,MAA0B,EAC1B,UAA8B,EAAE,EAAA;AAEhC,IAAA,MAAM,YAAY,GAAG,KAAK,CAAC,GAAG,EAAE;IAEhC,IAAI,eAAe,GAA+B,IAAI;IACtD,IAAI,WAAW,GAAG,YAAY;AAC9B,IAAA,IAAI,YAA4B;AAEhC,IAAA,MAAM,IAAI,GACN,OAAO,YAAY,KAAK;UAClB,YAAY,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE;UAClC,SAAS;IAEnB,MAAM,aAAa,GAAG,MAAK;QACvB,IAAI,eAAe,EAAE;YACjB,eAAe,CAAC,IAAI,EAAE;YACtB,eAAe,GAAG,IAAI;QAC1B;AACA,QAAA,KAAK,CAAC,SAAS,GAAG,SAAS;AAC/B,IAAA,CAAC;IAED,MAAM,cAAc,GAAG,MAAK;QACxB,MAAM,YAAY,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;AAC1C,QAAA,MAAM,WAAW,GAAG,QAAQ,CAAC,WAAW,CAAC;;AAGzC,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BAAoB,GAAG,MAAM,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC,KAAI;YACnD,IAAI,iBAAiB,EAAE;gBACnB,iBAAiB,GAAG,KAAK;AACzB,gBAAA,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,EAAE,IAAI,CAAM,EAAE,KAAK,CAAC;YAC/C;iBAAO;gBACH,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,EAAE,IAAI,CAAM,CAAC;YACvC;AACJ,QAAA,CAAC,CAAC;QAEF,MAAM,oBAAoB,GAAG,KAAK,CAAC,EAAE,CAAC,SAAS,EAAE,oBAAoB,CAAC;AAEtE,QAAA,OAAO,MAAK;AACR,YAAA,oBAAoB,EAAE;AACtB,YAAA,oBAAoB,EAAE;AAC1B,QAAA,CAAC;IACL;AAEA,IAAA,OAAO,aAAa;AACxB;AAEA,SAAS,UAAU,CAAC,CAAsB,EAAE,IAAa,EAAA;IACrD,OAAO,IAAI,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC;AAC9B;AAEA,SAAS,QAAQ,CAAC,CAAsB,EAAA;AACpC,IAAA,OAAO,OAAO,CAAC,KAAK,QAAQ,GAAG,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC;AACpD;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/index.mjs b/node_modules/motion-dom/dist/es/value/index.mjs deleted file mode 100644 index 3699391..0000000 --- a/node_modules/motion-dom/dist/es/value/index.mjs +++ /dev/null @@ -1,324 +0,0 @@ -import { warnOnce, SubscriptionManager, velocityPerSecond } from 'motion-utils'; -import { time } from '../frameloop/sync-time.mjs'; -import { frame } from '../frameloop/frame.mjs'; - -/** - * Maximum time between the value of two frames, beyond which we - * assume the velocity has since been 0. - */ -const MAX_VELOCITY_DELTA = 30; -const isFloat = (value) => { - return !isNaN(parseFloat(value)); -}; -const collectMotionValues = { - current: undefined, -}; -/** - * `MotionValue` is used to track the state and velocity of motion values. - * - * @public - */ -class MotionValue { - /** - * @param init - The initiating value - * @param config - Optional configuration options - * - * - `transformer`: A function to transform incoming values with. - */ - constructor(init, options = {}) { - /** - * Tracks whether this value can output a velocity. Currently this is only true - * if the value is numerical, but we might be able to widen the scope here and support - * other value types. - * - * @internal - */ - this.canTrackVelocity = null; - /** - * An object containing a SubscriptionManager for each active event. - */ - this.events = {}; - this.updateAndNotify = (v) => { - const currentTime = time.now(); - /** - * If we're updating the value during another frame or eventloop - * than the previous frame, then the we set the previous frame value - * to current. - */ - if (this.updatedAt !== currentTime) { - this.setPrevFrameValue(); - } - this.prev = this.current; - this.setCurrent(v); - // Update update subscribers - if (this.current !== this.prev) { - this.events.change?.notify(this.current); - if (this.dependents) { - for (const dependent of this.dependents) { - dependent.dirty(); - } - } - } - }; - this.hasAnimated = false; - this.setCurrent(init); - this.owner = options.owner; - } - setCurrent(current) { - this.current = current; - this.updatedAt = time.now(); - if (this.canTrackVelocity === null && current !== undefined) { - this.canTrackVelocity = isFloat(this.current); - } - } - setPrevFrameValue(prevFrameValue = this.current) { - this.prevFrameValue = prevFrameValue; - this.prevUpdatedAt = this.updatedAt; - } - /** - * Adds a function that will be notified when the `MotionValue` is updated. - * - * It returns a function that, when called, will cancel the subscription. - * - * When calling `onChange` inside a React component, it should be wrapped with the - * `useEffect` hook. As it returns an unsubscribe function, this should be returned - * from the `useEffect` function to ensure you don't add duplicate subscribers.. - * - * ```jsx - * export const MyComponent = () => { - * const x = useMotionValue(0) - * const y = useMotionValue(0) - * const opacity = useMotionValue(1) - * - * useEffect(() => { - * function updateOpacity() { - * const maxXY = Math.max(x.get(), y.get()) - * const newOpacity = transform(maxXY, [0, 100], [1, 0]) - * opacity.set(newOpacity) - * } - * - * const unsubscribeX = x.on("change", updateOpacity) - * const unsubscribeY = y.on("change", updateOpacity) - * - * return () => { - * unsubscribeX() - * unsubscribeY() - * } - * }, []) - * - * return - * } - * ``` - * - * @param subscriber - A function that receives the latest value. - * @returns A function that, when called, will cancel this subscription. - * - * @deprecated - */ - onChange(subscription) { - if (process.env.NODE_ENV !== "production") { - warnOnce(false, `value.onChange(callback) is deprecated. Switch to value.on("change", callback).`); - } - return this.on("change", subscription); - } - on(eventName, callback) { - if (!this.events[eventName]) { - this.events[eventName] = new SubscriptionManager(); - } - const unsubscribe = this.events[eventName].add(callback); - if (eventName === "change") { - return () => { - unsubscribe(); - /** - * If we have no more change listeners by the start - * of the next frame, stop active animations. - */ - frame.read(() => { - if (!this.events.change.getSize()) { - this.stop(); - } - }); - }; - } - return unsubscribe; - } - clearListeners() { - for (const eventManagers in this.events) { - this.events[eventManagers].clear(); - } - } - /** - * Attaches a passive effect to the `MotionValue`. - */ - attach(passiveEffect, stopPassiveEffect) { - this.passiveEffect = passiveEffect; - this.stopPassiveEffect = stopPassiveEffect; - } - /** - * Sets the state of the `MotionValue`. - * - * @remarks - * - * ```jsx - * const x = useMotionValue(0) - * x.set(10) - * ``` - * - * @param latest - Latest value to set. - * @param render - Whether to notify render subscribers. Defaults to `true` - * - * @public - */ - set(v) { - if (!this.passiveEffect) { - this.updateAndNotify(v); - } - else { - this.passiveEffect(v, this.updateAndNotify); - } - } - setWithVelocity(prev, current, delta) { - this.set(current); - this.prev = undefined; - this.prevFrameValue = prev; - this.prevUpdatedAt = this.updatedAt - delta; - } - /** - * Set the state of the `MotionValue`, stopping any active animations, - * effects, and resets velocity to `0`. - */ - jump(v, endAnimation = true) { - this.updateAndNotify(v); - this.prev = v; - this.prevUpdatedAt = this.prevFrameValue = undefined; - endAnimation && this.stop(); - if (this.stopPassiveEffect) - this.stopPassiveEffect(); - } - dirty() { - this.events.change?.notify(this.current); - } - addDependent(dependent) { - if (!this.dependents) { - this.dependents = new Set(); - } - this.dependents.add(dependent); - } - removeDependent(dependent) { - if (this.dependents) { - this.dependents.delete(dependent); - } - } - /** - * Returns the latest state of `MotionValue` - * - * @returns - The latest state of `MotionValue` - * - * @public - */ - get() { - if (collectMotionValues.current) { - collectMotionValues.current.push(this); - } - return this.current; - } - /** - * @public - */ - getPrevious() { - return this.prev; - } - /** - * Returns the latest velocity of `MotionValue` - * - * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical. - * - * @public - */ - getVelocity() { - const currentTime = time.now(); - if (!this.canTrackVelocity || - this.prevFrameValue === undefined || - currentTime - this.updatedAt > MAX_VELOCITY_DELTA) { - return 0; - } - const delta = Math.min(this.updatedAt - this.prevUpdatedAt, MAX_VELOCITY_DELTA); - // Casts because of parseFloat's poor typing - return velocityPerSecond(parseFloat(this.current) - - parseFloat(this.prevFrameValue), delta); - } - /** - * Registers a new animation to control this `MotionValue`. Only one - * animation can drive a `MotionValue` at one time. - * - * ```jsx - * value.start() - * ``` - * - * @param animation - A function that starts the provided animation - */ - start(startAnimation) { - this.stop(); - return new Promise((resolve) => { - this.hasAnimated = true; - this.animation = startAnimation(resolve); - if (this.events.animationStart) { - this.events.animationStart.notify(); - } - }).then(() => { - if (this.events.animationComplete) { - this.events.animationComplete.notify(); - } - this.clearAnimation(); - }); - } - /** - * Stop the currently active animation. - * - * @public - */ - stop() { - if (this.animation) { - this.animation.stop(); - if (this.events.animationCancel) { - this.events.animationCancel.notify(); - } - } - this.clearAnimation(); - } - /** - * Returns `true` if this value is currently animating. - * - * @public - */ - isAnimating() { - return !!this.animation; - } - clearAnimation() { - delete this.animation; - } - /** - * Destroy and clean up subscribers to this `MotionValue`. - * - * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically - * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually - * created a `MotionValue` via the `motionValue` function. - * - * @public - */ - destroy() { - this.dependents?.clear(); - this.events.destroy?.notify(); - this.clearListeners(); - this.stop(); - if (this.stopPassiveEffect) { - this.stopPassiveEffect(); - } - } -} -function motionValue(init, options) { - return new MotionValue(init, options); -} - -export { MotionValue, collectMotionValues, motionValue }; -//# sourceMappingURL=index.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/index.mjs.map b/node_modules/motion-dom/dist/es/value/index.mjs.map deleted file mode 100644 index f8a3c4e..0000000 --- a/node_modules/motion-dom/dist/es/value/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs","sources":["../../../src/value/index.ts"],"sourcesContent":["import {\n EasingFunction,\n SubscriptionManager,\n velocityPerSecond,\n warnOnce,\n} from \"motion-utils\"\nimport {\n AnimationPlaybackControlsWithThen,\n AnyResolvedKeyframe,\n TransformProperties,\n} from \"../animation/types\"\nimport { frame } from \"../frameloop\"\nimport { time } from \"../frameloop/sync-time\"\n\n/**\n * @public\n */\nexport type Subscriber = (v: T) => void\n\n/**\n * @public\n */\nexport type PassiveEffect = (v: T, safeSetter: (v: T) => void) => void\n\nexport type StartAnimation = (\n complete: () => void\n) => AnimationPlaybackControlsWithThen | undefined\n\nexport interface MotionValueEventCallbacks {\n animationStart: () => void\n animationComplete: () => void\n animationCancel: () => void\n change: (latestValue: V) => void\n destroy: () => void\n}\n\n/**\n * Maximum time between the value of two frames, beyond which we\n * assume the velocity has since been 0.\n */\nconst MAX_VELOCITY_DELTA = 30\n\nconst isFloat = (value: any): value is string => {\n return !isNaN(parseFloat(value))\n}\n\ninterface ResolvedValues {\n [key: string]: AnyResolvedKeyframe\n}\n\nexport interface Owner {\n current: HTMLElement | unknown\n getProps: () => {\n onUpdate?: (latest: ResolvedValues) => void\n transformTemplate?: (\n transform: TransformProperties,\n generatedTransform: string\n ) => string\n }\n}\n\nexport interface AccelerateConfig {\n factory: (animation: AnimationPlaybackControlsWithThen) => VoidFunction\n times: number[]\n keyframes: any[]\n ease?: EasingFunction | EasingFunction[]\n duration: number\n isTransformed?: boolean\n}\n\nexport interface MotionValueOptions {\n owner?: Owner\n}\n\nexport const collectMotionValues: { current: MotionValue[] | undefined } = {\n current: undefined,\n}\n\n/**\n * `MotionValue` is used to track the state and velocity of motion values.\n *\n * @public\n */\nexport class MotionValue {\n /**\n * If a MotionValue has an owner, it was created internally within Motion\n * and therefore has no external listeners. It is therefore safe to animate via WAAPI.\n */\n owner?: Owner\n\n /**\n * The current state of the `MotionValue`.\n */\n private current: V | undefined\n\n /**\n * The previous state of the `MotionValue`.\n */\n private prev: V | undefined\n\n /**\n * The previous state of the `MotionValue` at the end of the previous frame.\n */\n private prevFrameValue: V | undefined\n\n /**\n * The last time the `MotionValue` was updated.\n */\n updatedAt: number\n\n /**\n * The time `prevFrameValue` was updated.\n */\n prevUpdatedAt: number | undefined\n\n /**\n * Add a passive effect to this `MotionValue`.\n *\n * A passive effect intercepts calls to `set`. For instance, `useSpring` adds\n * a passive effect that attaches a `spring` to the latest\n * set value. Hypothetically there could be a `useSmooth` that attaches an input smoothing effect.\n *\n * @internal\n */\n private passiveEffect?: PassiveEffect\n private stopPassiveEffect?: VoidFunction\n\n /**\n * Whether the passive effect is active.\n */\n isEffectActive?: boolean\n\n /**\n * A reference to the currently-controlling animation.\n */\n animation?: AnimationPlaybackControlsWithThen\n\n /**\n * Tracks whether this value can output a velocity. Currently this is only true\n * if the value is numerical, but we might be able to widen the scope here and support\n * other value types.\n *\n * @internal\n */\n private canTrackVelocity: boolean | null = null\n\n /**\n * A list of MotionValues whose values are computed from this one.\n * This is a rough start to a proper signal-like dirtying system.\n */\n private dependents: Set | undefined\n\n /**\n * Tracks whether this value should be removed\n */\n liveStyle?: boolean\n\n /**\n * Scroll timeline acceleration metadata. When set, VisualElement\n * can create a native WAAPI animation attached to a scroll timeline\n * instead of driving updates through JS.\n */\n accelerate?: AccelerateConfig\n\n /**\n * @param init - The initiating value\n * @param config - Optional configuration options\n *\n * - `transformer`: A function to transform incoming values with.\n */\n constructor(init: V, options: MotionValueOptions = {}) {\n this.setCurrent(init)\n this.owner = options.owner\n }\n\n setCurrent(current: V) {\n this.current = current\n this.updatedAt = time.now()\n\n if (this.canTrackVelocity === null && current !== undefined) {\n this.canTrackVelocity = isFloat(this.current)\n }\n }\n\n setPrevFrameValue(prevFrameValue: V | undefined = this.current) {\n this.prevFrameValue = prevFrameValue\n this.prevUpdatedAt = this.updatedAt\n }\n\n /**\n * Adds a function that will be notified when the `MotionValue` is updated.\n *\n * It returns a function that, when called, will cancel the subscription.\n *\n * When calling `onChange` inside a React component, it should be wrapped with the\n * `useEffect` hook. As it returns an unsubscribe function, this should be returned\n * from the `useEffect` function to ensure you don't add duplicate subscribers..\n *\n * ```jsx\n * export const MyComponent = () => {\n * const x = useMotionValue(0)\n * const y = useMotionValue(0)\n * const opacity = useMotionValue(1)\n *\n * useEffect(() => {\n * function updateOpacity() {\n * const maxXY = Math.max(x.get(), y.get())\n * const newOpacity = transform(maxXY, [0, 100], [1, 0])\n * opacity.set(newOpacity)\n * }\n *\n * const unsubscribeX = x.on(\"change\", updateOpacity)\n * const unsubscribeY = y.on(\"change\", updateOpacity)\n *\n * return () => {\n * unsubscribeX()\n * unsubscribeY()\n * }\n * }, [])\n *\n * return \n * }\n * ```\n *\n * @param subscriber - A function that receives the latest value.\n * @returns A function that, when called, will cancel this subscription.\n *\n * @deprecated\n */\n onChange(subscription: Subscriber): () => void {\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(\n false,\n `value.onChange(callback) is deprecated. Switch to value.on(\"change\", callback).`\n )\n }\n return this.on(\"change\", subscription)\n }\n\n /**\n * An object containing a SubscriptionManager for each active event.\n */\n private events: {\n [key: string]: SubscriptionManager\n } = {}\n\n on>(\n eventName: EventName,\n callback: MotionValueEventCallbacks[EventName]\n ) {\n if (!this.events[eventName]) {\n this.events[eventName] = new SubscriptionManager()\n }\n\n const unsubscribe = this.events[eventName].add(callback)\n\n if (eventName === \"change\") {\n return () => {\n unsubscribe()\n\n /**\n * If we have no more change listeners by the start\n * of the next frame, stop active animations.\n */\n frame.read(() => {\n if (!this.events.change.getSize()) {\n this.stop()\n }\n })\n }\n }\n\n return unsubscribe\n }\n\n clearListeners() {\n for (const eventManagers in this.events) {\n this.events[eventManagers].clear()\n }\n }\n\n /**\n * Attaches a passive effect to the `MotionValue`.\n */\n attach(passiveEffect: PassiveEffect, stopPassiveEffect: VoidFunction) {\n this.passiveEffect = passiveEffect\n this.stopPassiveEffect = stopPassiveEffect\n }\n\n /**\n * Sets the state of the `MotionValue`.\n *\n * @remarks\n *\n * ```jsx\n * const x = useMotionValue(0)\n * x.set(10)\n * ```\n *\n * @param latest - Latest value to set.\n * @param render - Whether to notify render subscribers. Defaults to `true`\n *\n * @public\n */\n set(v: V) {\n if (!this.passiveEffect) {\n this.updateAndNotify(v)\n } else {\n this.passiveEffect(v, this.updateAndNotify)\n }\n }\n\n setWithVelocity(prev: V, current: V, delta: number) {\n this.set(current)\n this.prev = undefined\n this.prevFrameValue = prev\n this.prevUpdatedAt = this.updatedAt - delta\n }\n\n /**\n * Set the state of the `MotionValue`, stopping any active animations,\n * effects, and resets velocity to `0`.\n */\n jump(v: V, endAnimation = true) {\n this.updateAndNotify(v)\n this.prev = v\n this.prevUpdatedAt = this.prevFrameValue = undefined\n endAnimation && this.stop()\n if (this.stopPassiveEffect) this.stopPassiveEffect()\n }\n\n dirty() {\n this.events.change?.notify(this.current)\n }\n\n addDependent(dependent: MotionValue) {\n if (!this.dependents) {\n this.dependents = new Set()\n }\n this.dependents.add(dependent)\n }\n\n removeDependent(dependent: MotionValue) {\n if (this.dependents) {\n this.dependents.delete(dependent)\n }\n }\n\n updateAndNotify = (v: V) => {\n const currentTime = time.now()\n\n /**\n * If we're updating the value during another frame or eventloop\n * than the previous frame, then the we set the previous frame value\n * to current.\n */\n if (this.updatedAt !== currentTime) {\n this.setPrevFrameValue()\n }\n\n this.prev = this.current\n\n this.setCurrent(v)\n\n // Update update subscribers\n if (this.current !== this.prev) {\n this.events.change?.notify(this.current)\n\n if (this.dependents) {\n for (const dependent of this.dependents) {\n dependent.dirty()\n }\n }\n }\n }\n\n /**\n * Returns the latest state of `MotionValue`\n *\n * @returns - The latest state of `MotionValue`\n *\n * @public\n */\n get() {\n if (collectMotionValues.current) {\n collectMotionValues.current.push(this)\n }\n\n return this.current!\n }\n\n /**\n * @public\n */\n getPrevious() {\n return this.prev\n }\n\n /**\n * Returns the latest velocity of `MotionValue`\n *\n * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical.\n *\n * @public\n */\n getVelocity() {\n const currentTime = time.now()\n\n if (\n !this.canTrackVelocity ||\n this.prevFrameValue === undefined ||\n currentTime - this.updatedAt > MAX_VELOCITY_DELTA\n ) {\n return 0\n }\n\n const delta = Math.min(\n this.updatedAt - this.prevUpdatedAt!,\n MAX_VELOCITY_DELTA\n )\n\n // Casts because of parseFloat's poor typing\n return velocityPerSecond(\n parseFloat(this.current as any) -\n parseFloat(this.prevFrameValue as any),\n delta\n )\n }\n\n hasAnimated = false\n\n /**\n * Registers a new animation to control this `MotionValue`. Only one\n * animation can drive a `MotionValue` at one time.\n *\n * ```jsx\n * value.start()\n * ```\n *\n * @param animation - A function that starts the provided animation\n */\n start(startAnimation: StartAnimation) {\n this.stop()\n\n return new Promise((resolve) => {\n this.hasAnimated = true\n this.animation = startAnimation(resolve)\n\n if (this.events.animationStart) {\n this.events.animationStart.notify()\n }\n }).then(() => {\n if (this.events.animationComplete) {\n this.events.animationComplete.notify()\n }\n this.clearAnimation()\n })\n }\n\n /**\n * Stop the currently active animation.\n *\n * @public\n */\n stop() {\n if (this.animation) {\n this.animation.stop()\n if (this.events.animationCancel) {\n this.events.animationCancel.notify()\n }\n }\n this.clearAnimation()\n }\n\n /**\n * Returns `true` if this value is currently animating.\n *\n * @public\n */\n isAnimating() {\n return !!this.animation\n }\n\n private clearAnimation() {\n delete this.animation\n }\n\n /**\n * Destroy and clean up subscribers to this `MotionValue`.\n *\n * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically\n * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually\n * created a `MotionValue` via the `motionValue` function.\n *\n * @public\n */\n destroy() {\n this.dependents?.clear()\n this.events.destroy?.notify()\n this.clearListeners()\n this.stop()\n\n if (this.stopPassiveEffect) {\n this.stopPassiveEffect()\n }\n }\n}\n\nexport function motionValue(init: V, options?: MotionValueOptions) {\n return new MotionValue(init, options)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,EAAE,MAAM,EAAE;QAC7B,IAAI,CAAC,cAAc,EAAE;QACrB,IAAI,CAAC,IAAI,EAAE;AAEX,QAAA,IAAI,IAAI,CAAC,iBAAiB,EAAE;YACxB,IAAI,CAAC,iBAAiB,EAAE;QAC5B;IACJ;AACH;AAEK,SAAU,WAAW,CAAI,IAAO,EAAE,OAA4B,EAAA;AAChE,IAAA,OAAO,IAAI,WAAW,CAAI,IAAI,EAAE,OAAO,CAAC;AAC5C;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/map-value.mjs b/node_modules/motion-dom/dist/es/value/map-value.mjs deleted file mode 100644 index d3eb12f..0000000 --- a/node_modules/motion-dom/dist/es/value/map-value.mjs +++ /dev/null @@ -1,47 +0,0 @@ -import { transform } from '../utils/transform.mjs'; -import { transformValue } from './transform-value.mjs'; - -/** - * Create a `MotionValue` that maps the output of another `MotionValue` by - * mapping it from one range of values into another. - * - * @remarks - * - * Given an input range of `[-200, -100, 100, 200]` and an output range of - * `[0, 1, 1, 0]`, the returned `MotionValue` will: - * - * - When provided a value between `-200` and `-100`, will return a value between `0` and `1`. - * - When provided a value between `-100` and `100`, will return `1`. - * - When provided a value between `100` and `200`, will return a value between `1` and `0` - * - * The input range must be a linear series of numbers. The output range - * can be any value type supported by Motion: numbers, colors, shadows, etc. - * - * Every value in the output range must be of the same type and in the same format. - * - * ```jsx - * const x = motionValue(0) - * const xRange = [-200, -100, 100, 200] - * const opacityRange = [0, 1, 1, 0] - * const opacity = mapValue(x, xRange, opacityRange) - * ``` - * - * @param inputValue - `MotionValue` - * @param inputRange - A linear series of numbers (either all increasing or decreasing) - * @param outputRange - A series of numbers, colors or strings. Must be the same length as `inputRange`. - * @param options - - * - * - clamp: boolean. Clamp values to within the given range. Defaults to `true` - * - ease: EasingFunction[]. Easing functions to use on the interpolations between each value in the input and output ranges. If provided as an array, the array must be one item shorter than the input and output ranges, as the easings apply to the transition between each. - * - * @returns `MotionValue` - * - * @public - */ -function mapValue(inputValue, inputRange, outputRange, options) { - const map = transform(inputRange, outputRange, options); - return transformValue(() => map(inputValue.get())); -} - -export { mapValue }; -//# sourceMappingURL=map-value.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/map-value.mjs.map b/node_modules/motion-dom/dist/es/value/map-value.mjs.map deleted file mode 100644 index 02c07cd..0000000 --- a/node_modules/motion-dom/dist/es/value/map-value.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"map-value.mjs","sources":["../../../src/value/map-value.ts"],"sourcesContent":["import { MotionValue } from \".\"\nimport { transform, TransformOptions } from \"../utils/transform\"\nimport { transformValue } from \"./transform-value\"\n\nexport type MapInputRange = number[]\n\n/**\n * Create a `MotionValue` that maps the output of another `MotionValue` by\n * mapping it from one range of values into another.\n *\n * @remarks\n *\n * Given an input range of `[-200, -100, 100, 200]` and an output range of\n * `[0, 1, 1, 0]`, the returned `MotionValue` will:\n *\n * - When provided a value between `-200` and `-100`, will return a value between `0` and `1`.\n * - When provided a value between `-100` and `100`, will return `1`.\n * - When provided a value between `100` and `200`, will return a value between `1` and `0`\n *\n * The input range must be a linear series of numbers. The output range\n * can be any value type supported by Motion: numbers, colors, shadows, etc.\n *\n * Every value in the output range must be of the same type and in the same format.\n *\n * ```jsx\n * const x = motionValue(0)\n * const xRange = [-200, -100, 100, 200]\n * const opacityRange = [0, 1, 1, 0]\n * const opacity = mapValue(x, xRange, opacityRange)\n * ```\n *\n * @param inputValue - `MotionValue`\n * @param inputRange - A linear series of numbers (either all increasing or decreasing)\n * @param outputRange - A series of numbers, colors or strings. Must be the same length as `inputRange`.\n * @param options -\n *\n * - clamp: boolean. Clamp values to within the given range. Defaults to `true`\n * - ease: EasingFunction[]. Easing functions to use on the interpolations between each value in the input and output ranges. If provided as an array, the array must be one item shorter than the input and output ranges, as the easings apply to the transition between each.\n *\n * @returns `MotionValue`\n *\n * @public\n */\nexport function mapValue(\n inputValue: MotionValue,\n inputRange: MapInputRange,\n outputRange: O[],\n options?: TransformOptions\n): MotionValue {\n const map = transform(inputRange, outputRange, options)\n return transformValue(() => map(inputValue.get()))\n}\n"],"names":[],"mappings":";;;AAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCG;AACG,SAAU,QAAQ,CACpB,UAA+B,EAC/B,UAAyB,EACzB,WAAgB,EAChB,OAA6B,EAAA;IAE7B,MAAM,GAAG,GAAG,SAAS,CAAC,UAAU,EAAE,WAAW,EAAE,OAAO,CAAC;AACvD,IAAA,OAAO,cAAc,CAAC,MAAM,GAAG,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC,CAAC;AACtD;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/spring-value.mjs b/node_modules/motion-dom/dist/es/value/spring-value.mjs deleted file mode 100644 index 72b28b1..0000000 --- a/node_modules/motion-dom/dist/es/value/spring-value.mjs +++ /dev/null @@ -1,36 +0,0 @@ -import { attachFollow, followValue } from './follow-value.mjs'; - -/** - * Create a `MotionValue` that animates to its latest value using a spring. - * Can either be a value or track another `MotionValue`. - * - * ```jsx - * const x = motionValue(0) - * const y = springValue(x, { stiffness: 300 }) - * ``` - * - * @param source - Initial value or MotionValue to track - * @param options - Spring configuration options - * @returns `MotionValue` - * - * @public - */ -function springValue(source, options) { - return followValue(source, { type: "spring", ...options }); -} -/** - * Attach a spring animation to a MotionValue that will animate whenever the value changes. - * - * @param value - The MotionValue to animate - * @param source - Initial value or MotionValue to track - * @param options - Spring configuration options - * @returns Cleanup function - * - * @public - */ -function attachSpring(value, source, options) { - return attachFollow(value, source, { type: "spring", ...options }); -} - -export { attachSpring, springValue }; -//# sourceMappingURL=spring-value.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/spring-value.mjs.map b/node_modules/motion-dom/dist/es/value/spring-value.mjs.map deleted file mode 100644 index 7b9b761..0000000 --- a/node_modules/motion-dom/dist/es/value/spring-value.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"spring-value.mjs","sources":["../../../src/value/spring-value.ts"],"sourcesContent":["import { MotionValue } from \".\"\nimport { AnyResolvedKeyframe, SpringOptions } from \"../animation/types\"\nimport { attachFollow, followValue } from \"./follow-value\"\n\n/**\n * Create a `MotionValue` that animates to its latest value using a spring.\n * Can either be a value or track another `MotionValue`.\n *\n * ```jsx\n * const x = motionValue(0)\n * const y = springValue(x, { stiffness: 300 })\n * ```\n *\n * @param source - Initial value or MotionValue to track\n * @param options - Spring configuration options\n * @returns `MotionValue`\n *\n * @public\n */\nexport function springValue(\n source: T | MotionValue,\n options?: SpringOptions\n) {\n return followValue(source, { type: \"spring\", ...options })\n}\n\n/**\n * Attach a spring animation to a MotionValue that will animate whenever the value changes.\n *\n * @param value - The MotionValue to animate\n * @param source - Initial value or MotionValue to track\n * @param options - Spring configuration options\n * @returns Cleanup function\n *\n * @public\n */\nexport function attachSpring(\n value: MotionValue,\n source: T | MotionValue,\n options?: SpringOptions\n): VoidFunction {\n return attachFollow(value, source, { type: \"spring\", ...options })\n}\n"],"names":[],"mappings":";;AAIA;;;;;;;;;;;;;;AAcG;AACG,SAAU,WAAW,CACvB,MAA0B,EAC1B,OAAuB,EAAA;AAEvB,IAAA,OAAO,WAAW,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,OAAO,EAAE,CAAC;AAC9D;AAEA;;;;;;;;;AASG;SACa,YAAY,CACxB,KAAqB,EACrB,MAA0B,EAC1B,OAAuB,EAAA;AAEvB,IAAA,OAAO,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,OAAO,EAAE,CAAC;AACtE;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/subscribe-value.mjs b/node_modules/motion-dom/dist/es/value/subscribe-value.mjs deleted file mode 100644 index 166c874..0000000 --- a/node_modules/motion-dom/dist/es/value/subscribe-value.mjs +++ /dev/null @@ -1,14 +0,0 @@ -import { cancelFrame, frame } from '../frameloop/frame.mjs'; - -function subscribeValue(inputValues, outputValue, getLatest) { - const update = () => outputValue.set(getLatest()); - const scheduleUpdate = () => frame.preRender(update, false, true); - const subscriptions = inputValues.map((v) => v.on("change", scheduleUpdate)); - outputValue.on("destroy", () => { - subscriptions.forEach((unsubscribe) => unsubscribe()); - cancelFrame(update); - }); -} - -export { subscribeValue }; -//# sourceMappingURL=subscribe-value.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/subscribe-value.mjs.map b/node_modules/motion-dom/dist/es/value/subscribe-value.mjs.map deleted file mode 100644 index 1678e50..0000000 --- a/node_modules/motion-dom/dist/es/value/subscribe-value.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"subscribe-value.mjs","sources":["../../../src/value/subscribe-value.ts"],"sourcesContent":["import { MotionValue } from \".\"\nimport { cancelFrame, frame } from \"../frameloop\"\n\nexport function subscribeValue(\n inputValues: MotionValue[],\n outputValue: MotionValue,\n getLatest: () => O\n) {\n const update = () => outputValue.set(getLatest())\n const scheduleUpdate = () => frame.preRender(update, false, true)\n\n const subscriptions = inputValues.map((v) => v.on(\"change\", scheduleUpdate))\n\n outputValue.on(\"destroy\", () => {\n subscriptions.forEach((unsubscribe) => unsubscribe())\n cancelFrame(update)\n })\n}\n"],"names":[],"mappings":";;SAGgB,cAAc,CAC1B,WAA0B,EAC1B,WAA2B,EAC3B,SAAkB,EAAA;AAElB,IAAA,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC;AACjD,IAAA,MAAM,cAAc,GAAG,MAAM,KAAK,CAAC,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC;IAEjE,MAAM,aAAa,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;AAE5E,IAAA,WAAW,CAAC,EAAE,CAAC,SAAS,EAAE,MAAK;QAC3B,aAAa,CAAC,OAAO,CAAC,CAAC,WAAW,KAAK,WAAW,EAAE,CAAC;QACrD,WAAW,CAAC,MAAM,CAAC;AACvB,IAAA,CAAC,CAAC;AACN;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/transform-value.mjs b/node_modules/motion-dom/dist/es/value/transform-value.mjs deleted file mode 100644 index fd2c4e0..0000000 --- a/node_modules/motion-dom/dist/es/value/transform-value.mjs +++ /dev/null @@ -1,36 +0,0 @@ -import { collectMotionValues, motionValue } from './index.mjs'; -import { subscribeValue } from './subscribe-value.mjs'; - -/** - * Create a `MotionValue` that transforms the output of other `MotionValue`s by - * passing their latest values through a transform function. - * - * Whenever a `MotionValue` referred to in the provided function is updated, - * it will be re-evaluated. - * - * ```jsx - * const x = motionValue(0) - * const y = transformValue(() => x.get() * 2) // double x - * ``` - * - * @param transformer - A transform function. This function must be pure with no side-effects or conditional statements. - * @returns `MotionValue` - * - * @public - */ -function transformValue(transform) { - const collectedValues = []; - /** - * Open session of collectMotionValues. Any MotionValue that calls get() - * inside transform will be saved into this array. - */ - collectMotionValues.current = collectedValues; - const initialValue = transform(); - collectMotionValues.current = undefined; - const value = motionValue(initialValue); - subscribeValue(collectedValues, value, transform); - return value; -} - -export { transformValue }; -//# sourceMappingURL=transform-value.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/transform-value.mjs.map b/node_modules/motion-dom/dist/es/value/transform-value.mjs.map deleted file mode 100644 index 3f5c525..0000000 --- a/node_modules/motion-dom/dist/es/value/transform-value.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"transform-value.mjs","sources":["../../../src/value/transform-value.ts"],"sourcesContent":["import { MotionValue, collectMotionValues, motionValue } from \".\"\nimport { subscribeValue } from \"./subscribe-value\"\n\nexport type TransformInputRange = number[]\nexport type SingleTransformer = (input: I) => O\nexport type MultiTransformer = (input: I[]) => O\nexport type ValueTransformer =\n | SingleTransformer\n | MultiTransformer\n\n/**\n * Create a `MotionValue` that transforms the output of other `MotionValue`s by\n * passing their latest values through a transform function.\n *\n * Whenever a `MotionValue` referred to in the provided function is updated,\n * it will be re-evaluated.\n *\n * ```jsx\n * const x = motionValue(0)\n * const y = transformValue(() => x.get() * 2) // double x\n * ```\n *\n * @param transformer - A transform function. This function must be pure with no side-effects or conditional statements.\n * @returns `MotionValue`\n *\n * @public\n */\nexport function transformValue(transform: () => O): MotionValue {\n const collectedValues: MotionValue[] = []\n\n /**\n * Open session of collectMotionValues. Any MotionValue that calls get()\n * inside transform will be saved into this array.\n */\n collectMotionValues.current = collectedValues\n const initialValue = transform()\n collectMotionValues.current = undefined\n\n const value = motionValue(initialValue)\n\n subscribeValue(collectedValues, value, transform)\n\n return value\n}\n"],"names":[],"mappings":";;;AAUA;;;;;;;;;;;;;;;;AAgBG;AACG,SAAU,cAAc,CAAI,SAAkB,EAAA;IAChD,MAAM,eAAe,GAAkB,EAAE;AAEzC;;;AAGG;AACH,IAAA,mBAAmB,CAAC,OAAO,GAAG,eAAe;AAC7C,IAAA,MAAM,YAAY,GAAG,SAAS,EAAE;AAChC,IAAA,mBAAmB,CAAC,OAAO,GAAG,SAAS;AAEvC,IAAA,MAAM,KAAK,GAAG,WAAW,CAAC,YAAY,CAAC;AAEvC,IAAA,cAAc,CAAC,eAAe,EAAE,KAAK,EAAE,SAAS,CAAC;AAEjD,IAAA,OAAO,KAAK;AAChB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/auto.mjs b/node_modules/motion-dom/dist/es/value/types/auto.mjs deleted file mode 100644 index b514b87..0000000 --- a/node_modules/motion-dom/dist/es/value/types/auto.mjs +++ /dev/null @@ -1,10 +0,0 @@ -/** - * ValueType for "auto" - */ -const auto = { - test: (v) => v === "auto", - parse: (v) => v, -}; - -export { auto }; -//# sourceMappingURL=auto.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/auto.mjs.map b/node_modules/motion-dom/dist/es/value/types/auto.mjs.map deleted file mode 100644 index 3f0517d..0000000 --- a/node_modules/motion-dom/dist/es/value/types/auto.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"auto.mjs","sources":["../../../../src/value/types/auto.ts"],"sourcesContent":["import { ValueType } from \"./types\"\n\n/**\n * ValueType for \"auto\"\n */\nexport const auto: ValueType = {\n test: (v: any) => v === \"auto\",\n parse: (v) => v,\n}\n"],"names":[],"mappings":"AAEA;;AAEG;AACI,MAAM,IAAI,GAAc;IAC3B,IAAI,EAAE,CAAC,CAAM,KAAK,CAAC,KAAK,MAAM;AAC9B,IAAA,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/color/hex.mjs b/node_modules/motion-dom/dist/es/value/types/color/hex.mjs deleted file mode 100644 index 1ec7840..0000000 --- a/node_modules/motion-dom/dist/es/value/types/color/hex.mjs +++ /dev/null @@ -1,41 +0,0 @@ -import { rgba } from './rgba.mjs'; -import { isColorString } from './utils.mjs'; - -function parseHex(v) { - let r = ""; - let g = ""; - let b = ""; - let a = ""; - // If we have 6 characters, ie #FF0000 - if (v.length > 5) { - r = v.substring(1, 3); - g = v.substring(3, 5); - b = v.substring(5, 7); - a = v.substring(7, 9); - // Or we have 3 characters, ie #F00 - } - else { - r = v.substring(1, 2); - g = v.substring(2, 3); - b = v.substring(3, 4); - a = v.substring(4, 5); - r += r; - g += g; - b += b; - a += a; - } - return { - red: parseInt(r, 16), - green: parseInt(g, 16), - blue: parseInt(b, 16), - alpha: a ? parseInt(a, 16) / 255 : 1, - }; -} -const hex = { - test: /*@__PURE__*/ isColorString("#"), - parse: parseHex, - transform: rgba.transform, -}; - -export { hex }; -//# sourceMappingURL=hex.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/color/hex.mjs.map b/node_modules/motion-dom/dist/es/value/types/color/hex.mjs.map deleted file mode 100644 index 1ae6fff..0000000 --- a/node_modules/motion-dom/dist/es/value/types/color/hex.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"hex.mjs","sources":["../../../../../src/value/types/color/hex.ts"],"sourcesContent":["import { RGBA } from \"../types\"\nimport { rgba } from \"./rgba\"\nimport { isColorString } from \"./utils\"\n\nfunction parseHex(v: string): RGBA {\n let r = \"\"\n let g = \"\"\n let b = \"\"\n let a = \"\"\n\n // If we have 6 characters, ie #FF0000\n if (v.length > 5) {\n r = v.substring(1, 3)\n g = v.substring(3, 5)\n b = v.substring(5, 7)\n a = v.substring(7, 9)\n\n // Or we have 3 characters, ie #F00\n } else {\n r = v.substring(1, 2)\n g = v.substring(2, 3)\n b = v.substring(3, 4)\n a = v.substring(4, 5)\n r += r\n g += g\n b += b\n a += a\n }\n\n return {\n red: parseInt(r, 16),\n green: parseInt(g, 16),\n blue: parseInt(b, 16),\n alpha: a ? parseInt(a, 16) / 255 : 1,\n }\n}\n\nexport const hex = {\n test: /*@__PURE__*/ isColorString(\"#\"),\n parse: parseHex,\n transform: rgba.transform,\n}\n"],"names":[],"mappings":";;;AAIA,SAAS,QAAQ,CAAC,CAAS,EAAA;IACvB,IAAI,CAAC,GAAG,EAAE;IACV,IAAI,CAAC,GAAG,EAAE;IACV,IAAI,CAAC,GAAG,EAAE;IACV,IAAI,CAAC,GAAG,EAAE;;AAGV,IAAA,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE;QACd,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC;QACrB,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC;QACrB,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC;QACrB,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC;;IAGzB;SAAO;QACH,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC;QACrB,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC;QACrB,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC;QACrB,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC;QACrB,CAAC,IAAI,CAAC;QACN,CAAC,IAAI,CAAC;QACN,CAAC,IAAI,CAAC;QACN,CAAC,IAAI,CAAC;IACV;IAEA,OAAO;AACH,QAAA,GAAG,EAAE,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC;AACpB,QAAA,KAAK,EAAE,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC;AACtB,QAAA,IAAI,EAAE,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC;AACrB,QAAA,KAAK,EAAE,CAAC,GAAG,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,GAAG,CAAC;KACvC;AACL;AAEO,MAAM,GAAG,GAAG;AACf,IAAA,IAAI,gBAAgB,aAAa,CAAC,GAAG,CAAC;AACtC,IAAA,KAAK,EAAE,QAAQ;IACf,SAAS,EAAE,IAAI,CAAC,SAAS;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/color/hsla-to-rgba.mjs b/node_modules/motion-dom/dist/es/value/types/color/hsla-to-rgba.mjs deleted file mode 100644 index 75a4e52..0000000 --- a/node_modules/motion-dom/dist/es/value/types/color/hsla-to-rgba.mjs +++ /dev/null @@ -1,43 +0,0 @@ -// Adapted from https://gist.github.com/mjackson/5311256 -function hueToRgb(p, q, t) { - if (t < 0) - t += 1; - if (t > 1) - t -= 1; - if (t < 1 / 6) - return p + (q - p) * 6 * t; - if (t < 1 / 2) - return q; - if (t < 2 / 3) - return p + (q - p) * (2 / 3 - t) * 6; - return p; -} -function hslaToRgba({ hue, saturation, lightness, alpha }) { - hue /= 360; - saturation /= 100; - lightness /= 100; - let red = 0; - let green = 0; - let blue = 0; - if (!saturation) { - red = green = blue = lightness; - } - else { - const q = lightness < 0.5 - ? lightness * (1 + saturation) - : lightness + saturation - lightness * saturation; - const p = 2 * lightness - q; - red = hueToRgb(p, q, hue + 1 / 3); - green = hueToRgb(p, q, hue); - blue = hueToRgb(p, q, hue - 1 / 3); - } - return { - red: Math.round(red * 255), - green: Math.round(green * 255), - blue: Math.round(blue * 255), - alpha, - }; -} - -export { hslaToRgba }; -//# sourceMappingURL=hsla-to-rgba.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/color/hsla-to-rgba.mjs.map b/node_modules/motion-dom/dist/es/value/types/color/hsla-to-rgba.mjs.map deleted file mode 100644 index eebe3a0..0000000 --- a/node_modules/motion-dom/dist/es/value/types/color/hsla-to-rgba.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"hsla-to-rgba.mjs","sources":["../../../../../src/value/types/color/hsla-to-rgba.ts"],"sourcesContent":["import { HSLA, RGBA } from \"../types\"\n\n// Adapted from https://gist.github.com/mjackson/5311256\nfunction hueToRgb(p: number, q: number, t: number) {\n if (t < 0) t += 1\n if (t > 1) t -= 1\n if (t < 1 / 6) return p + (q - p) * 6 * t\n if (t < 1 / 2) return q\n if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6\n return p\n}\n\nexport function hslaToRgba({ hue, saturation, lightness, alpha }: HSLA): RGBA {\n hue /= 360\n saturation /= 100\n lightness /= 100\n\n let red = 0\n let green = 0\n let blue = 0\n\n if (!saturation) {\n red = green = blue = lightness\n } else {\n const q =\n lightness < 0.5\n ? lightness * (1 + saturation)\n : lightness + saturation - lightness * saturation\n const p = 2 * lightness - q\n\n red = hueToRgb(p, q, hue + 1 / 3)\n green = hueToRgb(p, q, hue)\n blue = hueToRgb(p, q, hue - 1 / 3)\n }\n\n return {\n red: Math.round(red * 255),\n green: Math.round(green * 255),\n blue: Math.round(blue * 255),\n alpha,\n }\n}\n"],"names":[],"mappings":"AAEA;AACA,SAAS,QAAQ,CAAC,CAAS,EAAE,CAAS,EAAE,CAAS,EAAA;IAC7C,IAAI,CAAC,GAAG,CAAC;QAAE,CAAC,IAAI,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AC;IACtC;IAEA,OAAO;QACH,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,GAAG,CAAC;QAC1B,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,GAAG,CAAC;QAC9B,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,GAAG,CAAC;QAC5B,KAAK;KACR;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/color/hsla.mjs b/node_modules/motion-dom/dist/es/value/types/color/hsla.mjs deleted file mode 100644 index d1af665..0000000 --- a/node_modules/motion-dom/dist/es/value/types/color/hsla.mjs +++ /dev/null @@ -1,23 +0,0 @@ -import { alpha } from '../numbers/index.mjs'; -import { percent } from '../numbers/units.mjs'; -import { sanitize } from '../utils/sanitize.mjs'; -import { splitColor, isColorString } from './utils.mjs'; - -const hsla = { - test: /*@__PURE__*/ isColorString("hsl", "hue"), - parse: /*@__PURE__*/ splitColor("hue", "saturation", "lightness"), - transform: ({ hue, saturation, lightness, alpha: alpha$1 = 1 }) => { - return ("hsla(" + - Math.round(hue) + - ", " + - percent.transform(sanitize(saturation)) + - ", " + - percent.transform(sanitize(lightness)) + - ", " + - sanitize(alpha.transform(alpha$1)) + - ")"); - }, -}; - -export { hsla }; -//# sourceMappingURL=hsla.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/color/hsla.mjs.map b/node_modules/motion-dom/dist/es/value/types/color/hsla.mjs.map deleted file mode 100644 index a67baaa..0000000 --- a/node_modules/motion-dom/dist/es/value/types/color/hsla.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"hsla.mjs","sources":["../../../../../src/value/types/color/hsla.ts"],"sourcesContent":["import { alpha as alphaType } from \"../numbers\"\nimport { percent } from \"../numbers/units\"\nimport { HSLA } from \"../types\"\nimport { sanitize } from \"../utils/sanitize\"\nimport { isColorString, splitColor } from \"./utils\"\n\nexport const hsla = {\n test: /*@__PURE__*/ isColorString(\"hsl\", \"hue\"),\n parse: /*@__PURE__*/ splitColor(\"hue\", \"saturation\", \"lightness\"),\n transform: ({ hue, saturation, lightness, alpha = 1 }: HSLA) => {\n return (\n \"hsla(\" +\n Math.round(hue) +\n \", \" +\n percent.transform(sanitize(saturation)) +\n \", \" +\n percent.transform(sanitize(lightness)) +\n \", \" +\n sanitize(alphaType.transform(alpha)) +\n \")\"\n )\n },\n}\n"],"names":["alpha","alphaType"],"mappings":";;;;;AAMO,MAAM,IAAI,GAAG;IAChB,IAAI,gBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,CAAC;IAC/C,KAAK,gBAAgB,UAAU,CAAO,KAAK,EAAE,YAAY,EAAE,WAAW,CAAC;AACvE,IAAA,SAAS,EAAE,CAAC,EAAE,GAAG,EAAE,UAAU,EAAE,SAAS,SAAEA,OAAK,GAAG,CAAC,EAAQ,KAAI;AAC3D,QAAA,QACI,OAAO;AACP,YAAA,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC;YACf,IAAI;AACJ,YAAA,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;YACvC,IAAI;AACJ,YAAA,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;YACtC,IAAI;AACJ,YAAA,QAAQ,CAACC,KAAS,CAAC,SAAS,CAACD,OAAK,CAAC,CAAC;AACpC,YAAA,GAAG;IAEX,CAAC;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/color/index.mjs b/node_modules/motion-dom/dist/es/value/types/color/index.mjs deleted file mode 100644 index 8de642b..0000000 --- a/node_modules/motion-dom/dist/es/value/types/color/index.mjs +++ /dev/null @@ -1,33 +0,0 @@ -import { hex } from './hex.mjs'; -import { hsla } from './hsla.mjs'; -import { rgba } from './rgba.mjs'; - -const color = { - test: (v) => rgba.test(v) || hex.test(v) || hsla.test(v), - parse: (v) => { - if (rgba.test(v)) { - return rgba.parse(v); - } - else if (hsla.test(v)) { - return hsla.parse(v); - } - else { - return hex.parse(v); - } - }, - transform: (v) => { - return typeof v === "string" - ? v - : v.hasOwnProperty("red") - ? rgba.transform(v) - : hsla.transform(v); - }, - getAnimatableNone: (v) => { - const parsed = color.parse(v); - parsed.alpha = 0; - return color.transform(parsed); - }, -}; - -export { color }; -//# sourceMappingURL=index.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/color/index.mjs.map b/node_modules/motion-dom/dist/es/value/types/color/index.mjs.map deleted file mode 100644 index d2c99a9..0000000 --- a/node_modules/motion-dom/dist/es/value/types/color/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs","sources":["../../../../../src/value/types/color/index.ts"],"sourcesContent":["import { HSLA, RGBA } from \"../types\"\nimport { hex } from \"./hex\"\nimport { hsla } from \"./hsla\"\nimport { rgba } from \"./rgba\"\n\nexport const color = {\n test: (v: any) => rgba.test(v) || hex.test(v) || hsla.test(v),\n parse: (v: any): RGBA | HSLA => {\n if (rgba.test(v)) {\n return rgba.parse(v)\n } else if (hsla.test(v)) {\n return hsla.parse(v)\n } else {\n return hex.parse(v)\n }\n },\n transform: (v: HSLA | RGBA | string) => {\n return typeof v === \"string\"\n ? v\n : v.hasOwnProperty(\"red\")\n ? rgba.transform(v as RGBA)\n : hsla.transform(v as HSLA)\n },\n getAnimatableNone: (v: string) => {\n const parsed = color.parse(v)\n parsed.alpha = 0\n return color.transform(parsed)\n },\n}\n"],"names":[],"mappings":";;;;AAKO,MAAM,KAAK,GAAG;IACjB,IAAI,EAAE,CAAC,CAAM,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;AAC7D,IAAA,KAAK,EAAE,CAAC,CAAM,KAAiB;AAC3B,QAAA,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE;AACd,YAAA,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;QACxB;AAAO,aAAA,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE;AACrB,YAAA,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;QACxB;aAAO;AACH,YAAA,OAAO,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;QACvB;IACJ,CAAC;AACD,IAAA,SAAS,EAAE,CAAC,CAAuB,KAAI;QACnC,OAAO,OAAO,CAAC,KAAK;AAChB,cAAE;AACF,cAAE,CAAC,CAAC,cAAc,CAAC,KAAK;AACxB,kBAAE,IAAI,CAAC,SAAS,CAAC,CAAS;AAC1B,kBAAE,IAAI,CAAC,SAAS,CAAC,CAAS,CAAC;IACnC,CAAC;AACD,IAAA,iBAAiB,EAAE,CAAC,CAAS,KAAI;QAC7B,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;AAC7B,QAAA,MAAM,CAAC,KAAK,GAAG,CAAC;AAChB,QAAA,OAAO,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC;IAClC,CAAC;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/color/rgba.mjs b/node_modules/motion-dom/dist/es/value/types/color/rgba.mjs deleted file mode 100644 index 8c27af7..0000000 --- a/node_modules/motion-dom/dist/es/value/types/color/rgba.mjs +++ /dev/null @@ -1,26 +0,0 @@ -import { clamp } from 'motion-utils'; -import { number, alpha } from '../numbers/index.mjs'; -import { sanitize } from '../utils/sanitize.mjs'; -import { splitColor, isColorString } from './utils.mjs'; - -const clampRgbUnit = (v) => clamp(0, 255, v); -const rgbUnit = { - ...number, - transform: (v) => Math.round(clampRgbUnit(v)), -}; -const rgba = { - test: /*@__PURE__*/ isColorString("rgb", "red"), - parse: /*@__PURE__*/ splitColor("red", "green", "blue"), - transform: ({ red, green, blue, alpha: alpha$1 = 1 }) => "rgba(" + - rgbUnit.transform(red) + - ", " + - rgbUnit.transform(green) + - ", " + - rgbUnit.transform(blue) + - ", " + - sanitize(alpha.transform(alpha$1)) + - ")", -}; - -export { rgbUnit, rgba }; -//# sourceMappingURL=rgba.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/color/rgba.mjs.map b/node_modules/motion-dom/dist/es/value/types/color/rgba.mjs.map deleted file mode 100644 index 57b3f0b..0000000 --- a/node_modules/motion-dom/dist/es/value/types/color/rgba.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"rgba.mjs","sources":["../../../../../src/value/types/color/rgba.ts"],"sourcesContent":["import { clamp } from \"motion-utils\"\nimport { alpha as alphaType, number } from \"../numbers\"\nimport { RGBA } from \"../types\"\nimport { sanitize } from \"../utils/sanitize\"\nimport { isColorString, splitColor } from \"./utils\"\n\nconst clampRgbUnit = (v: number) => clamp(0, 255, v)\nexport const rgbUnit = {\n ...number,\n transform: (v: number) => Math.round(clampRgbUnit(v)),\n}\n\nexport const rgba = {\n test: /*@__PURE__*/ isColorString(\"rgb\", \"red\"),\n parse: /*@__PURE__*/ splitColor(\"red\", \"green\", \"blue\"),\n transform: ({ red, green, blue, alpha = 1 }: RGBA) =>\n \"rgba(\" +\n rgbUnit.transform(red) +\n \", \" +\n rgbUnit.transform(green) +\n \", \" +\n rgbUnit.transform(blue) +\n \", \" +\n sanitize(alphaType.transform(alpha)) +\n \")\",\n}\n"],"names":["alpha","alphaType"],"mappings":";;;;;AAMA,MAAM,YAAY,GAAG,CAAC,CAAS,KAAK,KAAK,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;AAC7C,MAAM,OAAO,GAAG;AACnB,IAAA,GAAG,MAAM;AACT,IAAA,SAAS,EAAE,CAAC,CAAS,KAAK,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;;AAGlD,MAAM,IAAI,GAAG;IAChB,IAAI,gBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,CAAC;IAC/C,KAAK,gBAAgB,UAAU,CAAO,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC;AAC7D,IAAA,SAAS,EAAE,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,SAAEA,OAAK,GAAG,CAAC,EAAQ,KAC7C,OAAO;AACP,QAAA,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC;QACtB,IAAI;AACJ,QAAA,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC;QACxB,IAAI;AACJ,QAAA,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC;QACvB,IAAI;AACJ,QAAA,QAAQ,CAACC,KAAS,CAAC,SAAS,CAACD,OAAK,CAAC,CAAC;QACpC,GAAG;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/color/utils.mjs b/node_modules/motion-dom/dist/es/value/types/color/utils.mjs deleted file mode 100644 index cc4bd12..0000000 --- a/node_modules/motion-dom/dist/es/value/types/color/utils.mjs +++ /dev/null @@ -1,30 +0,0 @@ -import { floatRegex } from '../utils/float-regex.mjs'; -import { isNullish } from '../utils/is-nullish.mjs'; -import { singleColorRegex } from '../utils/single-color-regex.mjs'; - -/** - * Returns true if the provided string is a color, ie rgba(0,0,0,0) or #000, - * but false if a number or multiple colors - */ -const isColorString = (type, testProp) => (v) => { - return Boolean((typeof v === "string" && - singleColorRegex.test(v) && - v.startsWith(type)) || - (testProp && - !isNullish(v) && - Object.prototype.hasOwnProperty.call(v, testProp))); -}; -const splitColor = (aName, bName, cName) => (v) => { - if (typeof v !== "string") - return v; - const [a, b, c, alpha] = v.match(floatRegex); - return { - [aName]: parseFloat(a), - [bName]: parseFloat(b), - [cName]: parseFloat(c), - alpha: alpha !== undefined ? parseFloat(alpha) : 1, - }; -}; - -export { isColorString, splitColor }; -//# sourceMappingURL=utils.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/color/utils.mjs.map b/node_modules/motion-dom/dist/es/value/types/color/utils.mjs.map deleted file mode 100644 index 7b9b54a..0000000 --- a/node_modules/motion-dom/dist/es/value/types/color/utils.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.mjs","sources":["../../../../../src/value/types/color/utils.ts"],"sourcesContent":["import { Color, HSLA, RGBA } from \"../types\"\nimport { floatRegex } from \"../utils/float-regex\"\nimport { isNullish } from \"../utils/is-nullish\"\nimport { singleColorRegex } from \"../utils/single-color-regex\"\n\n/**\n * Returns true if the provided string is a color, ie rgba(0,0,0,0) or #000,\n * but false if a number or multiple colors\n */\nexport const isColorString = (type: string, testProp?: string) => (v: any) => {\n return Boolean(\n (typeof v === \"string\" &&\n singleColorRegex.test(v) &&\n v.startsWith(type)) ||\n (testProp &&\n !isNullish(v) &&\n Object.prototype.hasOwnProperty.call(v, testProp))\n )\n}\n\nexport const splitColor =\n (aName: string, bName: string, cName: string) =>\n (v: string | Color): V => {\n if (typeof v !== \"string\") return v as any\n\n const [a, b, c, alpha] = v.match(floatRegex) as any\n\n return {\n [aName]: parseFloat(a),\n [bName]: parseFloat(b),\n [cName]: parseFloat(c),\n alpha: alpha !== undefined ? parseFloat(alpha) : 1,\n } as V\n }\n"],"names":[],"mappings":";;;;AAKA;;;AAGG;AACI,MAAM,aAAa,GAAG,CAAC,IAAY,EAAE,QAAiB,KAAK,CAAC,CAAM,KAAI;AACzE,IAAA,OAAO,OAAO,CACV,CAAC,OAAO,CAAC,KAAK,QAAQ;AAClB,QAAA,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC;AACxB,QAAA,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC;AAClB,SAAC,QAAQ;YACL,CAAC,SAAS,CAAC,CAAC,CAAC;AACb,YAAA,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAC7D;AACL;AAEO,MAAM,UAAU,GACnB,CAAwB,KAAa,EAAE,KAAa,EAAE,KAAa,KACnE,CAAC,CAAiB,KAAO;IACrB,IAAI,OAAO,CAAC,KAAK,QAAQ;AAAE,QAAA,OAAO,CAAQ;AAE1C,IAAA,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,UAAU,CAAQ;IAEnD,OAAO;AACH,QAAA,CAAC,KAAK,GAAG,UAAU,CAAC,CAAC,CAAC;AACtB,QAAA,CAAC,KAAK,GAAG,UAAU,CAAC,CAAC,CAAC;AACtB,QAAA,CAAC,KAAK,GAAG,UAAU,CAAC,CAAC,CAAC;AACtB,QAAA,KAAK,EAAE,KAAK,KAAK,SAAS,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC;KAChD;AACV;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/complex/filter.mjs b/node_modules/motion-dom/dist/es/value/types/complex/filter.mjs deleted file mode 100644 index c0237bc..0000000 --- a/node_modules/motion-dom/dist/es/value/types/complex/filter.mjs +++ /dev/null @@ -1,31 +0,0 @@ -import { complex } from './index.mjs'; -import { floatRegex } from '../utils/float-regex.mjs'; - -/** - * Properties that should default to 1 or 100% - */ -const maxDefaults = new Set(["brightness", "contrast", "saturate", "opacity"]); -function applyDefaultFilter(v) { - const [name, value] = v.slice(0, -1).split("("); - if (name === "drop-shadow") - return v; - const [number] = value.match(floatRegex) || []; - if (!number) - return v; - const unit = value.replace(number, ""); - let defaultValue = maxDefaults.has(name) ? 1 : 0; - if (number !== value) - defaultValue *= 100; - return name + "(" + defaultValue + unit + ")"; -} -const functionRegex = /\b([a-z-]*)\(.*?\)/gu; -const filter = { - ...complex, - getAnimatableNone: (v) => { - const functions = v.match(functionRegex); - return functions ? functions.map(applyDefaultFilter).join(" ") : v; - }, -}; - -export { filter }; -//# sourceMappingURL=filter.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/complex/filter.mjs.map b/node_modules/motion-dom/dist/es/value/types/complex/filter.mjs.map deleted file mode 100644 index 6df1c29..0000000 --- a/node_modules/motion-dom/dist/es/value/types/complex/filter.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"filter.mjs","sources":["../../../../../src/value/types/complex/filter.ts"],"sourcesContent":["import { complex } from \".\"\nimport { floatRegex } from \"../utils/float-regex\"\n\n/**\n * Properties that should default to 1 or 100%\n */\nconst maxDefaults = new Set([\"brightness\", \"contrast\", \"saturate\", \"opacity\"])\n\nfunction applyDefaultFilter(v: string) {\n const [name, value] = v.slice(0, -1).split(\"(\")\n\n if (name === \"drop-shadow\") return v\n\n const [number] = value.match(floatRegex) || []\n if (!number) return v\n\n const unit = value.replace(number, \"\")\n let defaultValue = maxDefaults.has(name) ? 1 : 0\n if (number !== value) defaultValue *= 100\n\n return name + \"(\" + defaultValue + unit + \")\"\n}\n\nconst functionRegex = /\\b([a-z-]*)\\(.*?\\)/gu\n\nexport const filter = {\n ...complex,\n getAnimatableNone: (v: string) => {\n const functions = v.match(functionRegex)\n return functions ? functions.map(applyDefaultFilter).join(\" \") : v\n },\n}\n"],"names":[],"mappings":";;;AAGA;;AAEG;AACH,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,CAAC,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC;AAE9E,SAAS,kBAAkB,CAAC,CAAS,EAAA;IACjC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC;IAE/C,IAAI,IAAI,KAAK,aAAa;AAAE,QAAA,OAAO,CAAC;AAEpC,IAAA,MAAM,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,EAAE;AAC9C,IAAA,IAAI,CAAC,MAAM;AAAE,QAAA,OAAO,CAAC;IAErB,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;AACtC,IAAA,IAAI,YAAY,GAAG,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;IAChD,IAAI,MAAM,KAAK,KAAK;QAAE,YAAY,IAAI,GAAG;IAEzC,OAAO,IAAI,GAAG,GAAG,GAAG,YAAY,GAAG,IAAI,GAAG,GAAG;AACjD;AAEA,MAAM,aAAa,GAAG,sBAAsB;AAErC,MAAM,MAAM,GAAG;AAClB,IAAA,GAAG,OAAO;AACV,IAAA,iBAAiB,EAAE,CAAC,CAAS,KAAI;QAC7B,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC;AACxC,QAAA,OAAO,SAAS,GAAG,SAAS,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;IACtE,CAAC;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/complex/index.mjs b/node_modules/motion-dom/dist/es/value/types/complex/index.mjs deleted file mode 100644 index 66f4c01..0000000 --- a/node_modules/motion-dom/dist/es/value/types/complex/index.mjs +++ /dev/null @@ -1,114 +0,0 @@ -import { color } from '../color/index.mjs'; -import { colorRegex } from '../utils/color-regex.mjs'; -import { floatRegex } from '../utils/float-regex.mjs'; -import { sanitize } from '../utils/sanitize.mjs'; - -function test(v) { - return (isNaN(v) && - typeof v === "string" && - (v.match(floatRegex)?.length || 0) + - (v.match(colorRegex)?.length || 0) > - 0); -} -const NUMBER_TOKEN = "number"; -const COLOR_TOKEN = "color"; -const VAR_TOKEN = "var"; -const VAR_FUNCTION_TOKEN = "var("; -const SPLIT_TOKEN = "${}"; -// this regex consists of the `singleCssVariableRegex|rgbHSLValueRegex|digitRegex` -const complexRegex = /var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu; -function analyseComplexValue(value) { - const originalValue = value.toString(); - const values = []; - const indexes = { - color: [], - number: [], - var: [], - }; - const types = []; - let i = 0; - const tokenised = originalValue.replace(complexRegex, (parsedValue) => { - if (color.test(parsedValue)) { - indexes.color.push(i); - types.push(COLOR_TOKEN); - values.push(color.parse(parsedValue)); - } - else if (parsedValue.startsWith(VAR_FUNCTION_TOKEN)) { - indexes.var.push(i); - types.push(VAR_TOKEN); - values.push(parsedValue); - } - else { - indexes.number.push(i); - types.push(NUMBER_TOKEN); - values.push(parseFloat(parsedValue)); - } - ++i; - return SPLIT_TOKEN; - }); - const split = tokenised.split(SPLIT_TOKEN); - return { values, split, indexes, types }; -} -function parseComplexValue(v) { - return analyseComplexValue(v).values; -} -function buildTransformer({ split, types }) { - const numSections = split.length; - return (v) => { - let output = ""; - for (let i = 0; i < numSections; i++) { - output += split[i]; - if (v[i] !== undefined) { - const type = types[i]; - if (type === NUMBER_TOKEN) { - output += sanitize(v[i]); - } - else if (type === COLOR_TOKEN) { - output += color.transform(v[i]); - } - else { - output += v[i]; - } - } - } - return output; - }; -} -function createTransformer(source) { - return buildTransformer(analyseComplexValue(source)); -} -const convertNumbersToZero = (v) => typeof v === "number" ? 0 : color.test(v) ? color.getAnimatableNone(v) : v; -/** - * Convert a parsed value to its zero equivalent, but preserve numbers - * that act as divisors in CSS calc() expressions. - * - * analyseComplexValue extracts numbers from CSS strings and puts the - * surrounding text into a `split` template array. For example: - * "calc(var(--gap) / 5)" → values: [var(--gap), 5] - * split: ["calc(", " / ", ")"] - * - * When building a zero-equivalent for animation, naively zeroing all - * numbers turns the divisor into 0 → "calc(var(--gap) / 0)" → NaN. - * We detect this by checking whether the text preceding a number - * (split[i]) ends with "/" — the CSS calc division operator. - */ -const convertToZero = (value, splitBefore) => { - if (typeof value === "number") { - return splitBefore?.trim().endsWith("/") ? value : 0; - } - return convertNumbersToZero(value); -}; -function getAnimatableNone(v) { - const info = analyseComplexValue(v); - const transformer = buildTransformer(info); - return transformer(info.values.map((value, i) => convertToZero(value, info.split[i]))); -} -const complex = { - test, - parse: parseComplexValue, - createTransformer, - getAnimatableNone, -}; - -export { analyseComplexValue, complex }; -//# sourceMappingURL=index.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/complex/index.mjs.map b/node_modules/motion-dom/dist/es/value/types/complex/index.mjs.map deleted file mode 100644 index fc24e81..0000000 --- a/node_modules/motion-dom/dist/es/value/types/complex/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs","sources":["../../../../../src/value/types/complex/index.ts"],"sourcesContent":["import { AnyResolvedKeyframe } from \"../../../animation/types\"\nimport { CSSVariableToken } from \"../../../animation/utils/is-css-variable\"\nimport { color } from \"../color\"\nimport { Color } from \"../types\"\nimport { colorRegex } from \"../utils/color-regex\"\nimport { floatRegex } from \"../utils/float-regex\"\nimport { sanitize } from \"../utils/sanitize\"\n\nfunction test(v: any) {\n return (\n isNaN(v) &&\n typeof v === \"string\" &&\n (v.match(floatRegex)?.length || 0) +\n (v.match(colorRegex)?.length || 0) >\n 0\n )\n}\n\nconst NUMBER_TOKEN = \"number\"\nconst COLOR_TOKEN = \"color\"\nconst VAR_TOKEN = \"var\"\nconst VAR_FUNCTION_TOKEN = \"var(\"\nconst SPLIT_TOKEN = \"${}\"\n\nexport type ComplexValues = Array<\n CSSVariableToken | AnyResolvedKeyframe | Color\n>\n\nexport interface ValueIndexes {\n color: number[]\n number: number[]\n var: number[]\n}\n\nexport interface ComplexValueInfo {\n values: ComplexValues\n split: string[]\n indexes: ValueIndexes\n types: Array\n}\n\n// this regex consists of the `singleCssVariableRegex|rgbHSLValueRegex|digitRegex`\nconst complexRegex =\n /var\\s*\\(\\s*--(?:[\\w-]+\\s*|[\\w-]+\\s*,(?:\\s*[^)(\\s]|\\s*\\((?:[^)(]|\\([^)(]*\\))*\\))+\\s*)\\)|#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\)|-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)/giu\n\nexport function analyseComplexValue(\n value: AnyResolvedKeyframe\n): ComplexValueInfo {\n const originalValue = value.toString()\n\n const values: ComplexValues = []\n const indexes: ValueIndexes = {\n color: [],\n number: [],\n var: [],\n }\n const types: Array = []\n\n let i = 0\n const tokenised = originalValue.replace(complexRegex, (parsedValue) => {\n if (color.test(parsedValue)) {\n indexes.color.push(i)\n types.push(COLOR_TOKEN)\n values.push(color.parse(parsedValue))\n } else if (parsedValue.startsWith(VAR_FUNCTION_TOKEN)) {\n indexes.var.push(i)\n types.push(VAR_TOKEN)\n values.push(parsedValue)\n } else {\n indexes.number.push(i)\n types.push(NUMBER_TOKEN)\n values.push(parseFloat(parsedValue))\n }\n ++i\n return SPLIT_TOKEN\n })\n const split = tokenised.split(SPLIT_TOKEN)\n\n return { values, split, indexes, types }\n}\n\nfunction parseComplexValue(v: AnyResolvedKeyframe) {\n return analyseComplexValue(v).values\n}\n\nfunction buildTransformer({ split, types }: ComplexValueInfo) {\n const numSections = split.length\n return (v: Array) => {\n let output = \"\"\n for (let i = 0; i < numSections; i++) {\n output += split[i]\n if (v[i] !== undefined) {\n const type = types[i]\n if (type === NUMBER_TOKEN) {\n output += sanitize(v[i] as number)\n } else if (type === COLOR_TOKEN) {\n output += color.transform(v[i] as Color)\n } else {\n output += v[i]\n }\n }\n }\n\n return output\n }\n}\n\nfunction createTransformer(source: AnyResolvedKeyframe) {\n return buildTransformer(analyseComplexValue(source))\n}\n\nconst convertNumbersToZero = (v: number | string) =>\n typeof v === \"number\" ? 0 : color.test(v) ? color.getAnimatableNone(v) : v\n\n/**\n * Convert a parsed value to its zero equivalent, but preserve numbers\n * that act as divisors in CSS calc() expressions.\n *\n * analyseComplexValue extracts numbers from CSS strings and puts the\n * surrounding text into a `split` template array. For example:\n * \"calc(var(--gap) / 5)\" → values: [var(--gap), 5]\n * split: [\"calc(\", \" / \", \")\"]\n *\n * When building a zero-equivalent for animation, naively zeroing all\n * numbers turns the divisor into 0 → \"calc(var(--gap) / 0)\" → NaN.\n * We detect this by checking whether the text preceding a number\n * (split[i]) ends with \"/\" — the CSS calc division operator.\n */\nconst convertToZero = (\n value: ComplexValues[number],\n splitBefore: string\n): ComplexValues[number] => {\n if (typeof value === \"number\") {\n return splitBefore?.trim().endsWith(\"/\") ? value : 0\n }\n return convertNumbersToZero(value as string)\n}\n\nfunction getAnimatableNone(v: AnyResolvedKeyframe) {\n const info = analyseComplexValue(v)\n const transformer = buildTransformer(info)\n return transformer(\n info.values.map((value, i) => convertToZero(value, info.split[i]))\n )\n}\n\nexport const complex = {\n test,\n parse: parseComplexValue,\n createTransformer,\n getAnimatableNone,\n}\n"],"names":[],"mappings":";;;;;AAQA,SAAS,IAAI,CAAC,CAAM,EAAA;AAChB,IAAA,QACI,KAAK,CAAC,CAAC,CAAC;QACR,OAAO,CAAC,KAAK,QAAQ;QACrB,CAAC,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;aAC5B,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC,CAAC;AAClC,YAAA,CAAC;AAEb;AAEA,MAAM,YAAY,GAAG,QAAQ;AAC7B,MAAM,WAAW,GAAG,OAAO;AAC3B,MAAM,SAAS,GAAG,KAAK;AACvB,MAAM,kBAAkB,GAAG,MAAM;AACjC,MAAM,WAAW,GAAG,KAAK;AAmBzB;AACA,MAAM,YAAY,GACd,iOAAiO;AAE/N,SAAU,mBAAmB,CAC/B,KAA0B,EAAA;AAE1B,IAAA,MAAM,aAAa,GAAG,KAAK,CAAC,QAAQ,EAAE;IAEtC,MAAM,MAAM,GAAkB,EAAE;AAChC,IAAA,MAAM,OAAO,GAAiB;AAC1B,QAAA,KAAK,EAAE,EAAE;AACT,QAAA,MAAM,EAAE,EAAE;AAC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oBAAoB,CAAC,KAAe,CAAC;AAChD,CAAC;AAED,SAAS,iBAAiB,CAAC,CAAsB,EAAA;AAC7C,IAAA,MAAM,IAAI,GAAG,mBAAmB,CAAC,CAAC,CAAC;AACnC,IAAA,MAAM,WAAW,GAAG,gBAAgB,CAAC,IAAI,CAAC;AAC1C,IAAA,OAAO,WAAW,CACd,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,KAAK,aAAa,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CACrE;AACL;AAEO,MAAM,OAAO,GAAG;IACnB,IAAI;AACJ,IAAA,KAAK,EAAE,iBAAiB;IACxB,iBAAiB;IACjB,iBAAiB;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/complex/mask.mjs b/node_modules/motion-dom/dist/es/value/types/complex/mask.mjs deleted file mode 100644 index 2a3bb77..0000000 --- a/node_modules/motion-dom/dist/es/value/types/complex/mask.mjs +++ /dev/null @@ -1,13 +0,0 @@ -import { complex } from './index.mjs'; - -const mask = { - ...complex, - getAnimatableNone: (v) => { - const parsed = complex.parse(v); - const transformer = complex.createTransformer(v); - return transformer(parsed.map((v) => typeof v === "number" ? 0 : typeof v === "object" ? { ...v, alpha: 1 } : v)); - }, -}; - -export { mask }; -//# sourceMappingURL=mask.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/complex/mask.mjs.map b/node_modules/motion-dom/dist/es/value/types/complex/mask.mjs.map deleted file mode 100644 index e287f1e..0000000 --- a/node_modules/motion-dom/dist/es/value/types/complex/mask.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mask.mjs","sources":["../../../../../src/value/types/complex/mask.ts"],"sourcesContent":["import { complex } from \".\"\nimport { AnyResolvedKeyframe } from \"../../../animation/types\"\n\nexport const mask = {\n ...complex,\n getAnimatableNone: (v: AnyResolvedKeyframe) => {\n const parsed = complex.parse(v)\n const transformer = complex.createTransformer(v)\n return transformer(\n parsed.map((v) =>\n typeof v === \"number\" ? 0 : typeof v === \"object\" ? { ...v, alpha: 1 } : v\n )\n )\n },\n}\n"],"names":[],"mappings":";;AAGO,MAAM,IAAI,GAAG;AAChB,IAAA,GAAG,OAAO;AACV,IAAA,iBAAiB,EAAE,CAAC,CAAsB,KAAI;QAC1C,MAAM,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;QAC/B,MAAM,WAAW,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC;AAChD,QAAA,OAAO,WAAW,CACd,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,KACT,OAAO,CAAC,KAAK,QAAQ,GAAG,CAAC,GAAG,OAAO,CAAC,KAAK,QAAQ,GAAG,EAAE,GAAG,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,CAAC,CAC7E,CACJ;IACL,CAAC;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/dimensions.mjs b/node_modules/motion-dom/dist/es/value/types/dimensions.mjs deleted file mode 100644 index de40047..0000000 --- a/node_modules/motion-dom/dist/es/value/types/dimensions.mjs +++ /dev/null @@ -1,16 +0,0 @@ -import { auto } from './auto.mjs'; -import { number } from './numbers/index.mjs'; -import { px, percent, degrees, vw, vh } from './numbers/units.mjs'; -import { testValueType } from './test.mjs'; - -/** - * A list of value types commonly used for dimensions - */ -const dimensionValueTypes = [number, px, percent, degrees, vw, vh, auto]; -/** - * Tests a dimensional value against the list of dimension ValueTypes - */ -const findDimensionValueType = (v) => dimensionValueTypes.find(testValueType(v)); - -export { dimensionValueTypes, findDimensionValueType }; -//# sourceMappingURL=dimensions.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/dimensions.mjs.map b/node_modules/motion-dom/dist/es/value/types/dimensions.mjs.map deleted file mode 100644 index 79f7dc1..0000000 --- a/node_modules/motion-dom/dist/es/value/types/dimensions.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"dimensions.mjs","sources":["../../../../src/value/types/dimensions.ts"],"sourcesContent":["import { auto } from \"./auto\"\nimport { number } from \"./numbers\"\nimport { degrees, percent, px, vh, vw } from \"./numbers/units\"\nimport { testValueType } from \"./test\"\n\n/**\n * A list of value types commonly used for dimensions\n */\nexport const dimensionValueTypes = [number, px, percent, degrees, vw, vh, auto]\n\n/**\n * Tests a dimensional value against the list of dimension ValueTypes\n */\nexport const findDimensionValueType = (v: any) =>\n dimensionValueTypes.find(testValueType(v))\n"],"names":[],"mappings":";;;;;AAKA;;AAEG;AACI,MAAM,mBAAmB,GAAG,CAAC,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE,IAAI;AAE9E;;AAEG;AACI,MAAM,sBAAsB,GAAG,CAAC,CAAM,KACzC,mBAAmB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/int.mjs b/node_modules/motion-dom/dist/es/value/types/int.mjs deleted file mode 100644 index 065c6ad..0000000 --- a/node_modules/motion-dom/dist/es/value/types/int.mjs +++ /dev/null @@ -1,9 +0,0 @@ -import { number } from './numbers/index.mjs'; - -const int = { - ...number, - transform: Math.round, -}; - -export { int }; -//# sourceMappingURL=int.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/int.mjs.map b/node_modules/motion-dom/dist/es/value/types/int.mjs.map deleted file mode 100644 index 8a3a6e8..0000000 --- a/node_modules/motion-dom/dist/es/value/types/int.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"int.mjs","sources":["../../../../src/value/types/int.ts"],"sourcesContent":["import { number } from \"./numbers\"\n\nexport const int = {\n ...number,\n transform: Math.round,\n}\n"],"names":[],"mappings":";;AAEO,MAAM,GAAG,GAAG;AACf,IAAA,GAAG,MAAM;IACT,SAAS,EAAE,IAAI,CAAC,KAAK;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/maps/defaults.mjs b/node_modules/motion-dom/dist/es/value/types/maps/defaults.mjs deleted file mode 100644 index ebca742..0000000 --- a/node_modules/motion-dom/dist/es/value/types/maps/defaults.mjs +++ /dev/null @@ -1,34 +0,0 @@ -import { color } from '../color/index.mjs'; -import { filter } from '../complex/filter.mjs'; -import { mask } from '../complex/mask.mjs'; -import { numberValueTypes } from './number.mjs'; - -/** - * A map of default value types for common values - */ -const defaultValueTypes = { - ...numberValueTypes, - // Color props - color, - backgroundColor: color, - outlineColor: color, - fill: color, - stroke: color, - // Border props - borderColor: color, - borderTopColor: color, - borderRightColor: color, - borderBottomColor: color, - borderLeftColor: color, - filter, - WebkitFilter: filter, - mask, - WebkitMask: mask, -}; -/** - * Gets the default ValueType for the provided value key - */ -const getDefaultValueType = (key) => defaultValueTypes[key]; - -export { defaultValueTypes, getDefaultValueType }; -//# sourceMappingURL=defaults.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/maps/defaults.mjs.map b/node_modules/motion-dom/dist/es/value/types/maps/defaults.mjs.map deleted file mode 100644 index 1e279cc..0000000 --- a/node_modules/motion-dom/dist/es/value/types/maps/defaults.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"defaults.mjs","sources":["../../../../../src/value/types/maps/defaults.ts"],"sourcesContent":["import { color } from \"../color\"\nimport { filter } from \"../complex/filter\"\nimport { mask } from \"../complex/mask\"\nimport { numberValueTypes } from \"./number\"\nimport { ValueTypeMap } from \"./types\"\n\n/**\n * A map of default value types for common values\n */\nexport const defaultValueTypes: ValueTypeMap = {\n ...numberValueTypes,\n\n // Color props\n color,\n backgroundColor: color,\n outlineColor: color,\n fill: color,\n stroke: color,\n\n // Border props\n borderColor: color,\n borderTopColor: color,\n borderRightColor: color,\n borderBottomColor: color,\n borderLeftColor: color,\n filter,\n WebkitFilter: filter,\n mask,\n WebkitMask: mask,\n}\n\n/**\n * Gets the default ValueType for the provided value key\n */\nexport const getDefaultValueType = (key: string) => defaultValueTypes[key]\n"],"names":[],"mappings":";;;;;AAMA;;AAEG;AACI,MAAM,iBAAiB,GAAiB;AAC3C,IAAA,GAAG,gBAAgB;;IAGnB,KAAK;AACL,IAAA,eAAe,EAAE,KAAK;AACtB,IAAA,YAAY,EAAE,KAAK;AACnB,IAAA,IAAI,EAAE,KAAK;AACX,IAAA,MAAM,EAAE,KAAK;;AAGb,IAAA,WAAW,EAAE,KAAK;AAClB,IAAA,cAAc,EAAE,KAAK;AACrB,IAAA,gBAAgB,EAAE,KAAK;AACvB,IAAA,iBAAiB,EAAE,KAAK;AACxB,IAAA,eAAe,EAAE,KAAK;IACtB,MAAM;AACN,IAAA,YAAY,EAAE,MAAM;IACpB,IAAI;AACJ,IAAA,UAAU,EAAE,IAAI;;AAGpB;;AAEG;AACI,MAAM,mBAAmB,GAAG,CAAC,GAAW,KAAK,iBAAiB,CAAC,GAAG;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/maps/number.mjs b/node_modules/motion-dom/dist/es/value/types/maps/number.mjs deleted file mode 100644 index e3ee5a2..0000000 --- a/node_modules/motion-dom/dist/es/value/types/maps/number.mjs +++ /dev/null @@ -1,71 +0,0 @@ -import { int } from '../int.mjs'; -import { alpha } from '../numbers/index.mjs'; -import { px } from '../numbers/units.mjs'; -import { transformValueTypes } from './transform.mjs'; - -const numberValueTypes = { - // Border props - borderWidth: px, - borderTopWidth: px, - borderRightWidth: px, - borderBottomWidth: px, - borderLeftWidth: px, - borderRadius: px, - borderTopLeftRadius: px, - borderTopRightRadius: px, - borderBottomRightRadius: px, - borderBottomLeftRadius: px, - // Positioning props - width: px, - maxWidth: px, - height: px, - maxHeight: px, - top: px, - right: px, - bottom: px, - left: px, - inset: px, - insetBlock: px, - insetBlockStart: px, - insetBlockEnd: px, - insetInline: px, - insetInlineStart: px, - insetInlineEnd: px, - // Spacing props - padding: px, - paddingTop: px, - paddingRight: px, - paddingBottom: px, - paddingLeft: px, - paddingBlock: px, - paddingBlockStart: px, - paddingBlockEnd: px, - paddingInline: px, - paddingInlineStart: px, - paddingInlineEnd: px, - margin: px, - marginTop: px, - marginRight: px, - marginBottom: px, - marginLeft: px, - marginBlock: px, - marginBlockStart: px, - marginBlockEnd: px, - marginInline: px, - marginInlineStart: px, - marginInlineEnd: px, - // Typography - fontSize: px, - // Misc - backgroundPositionX: px, - backgroundPositionY: px, - ...transformValueTypes, - zIndex: int, - // SVG - fillOpacity: alpha, - strokeOpacity: alpha, - numOctaves: int, -}; - -export { numberValueTypes }; -//# sourceMappingURL=number.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/maps/number.mjs.map b/node_modules/motion-dom/dist/es/value/types/maps/number.mjs.map deleted file mode 100644 index 4c9cc78..0000000 --- a/node_modules/motion-dom/dist/es/value/types/maps/number.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"number.mjs","sources":["../../../../../src/value/types/maps/number.ts"],"sourcesContent":["import { int } from \"../int\"\nimport { alpha } from \"../numbers\"\nimport { px } from \"../numbers/units\"\nimport { transformValueTypes } from \"./transform\"\nimport { ValueTypeMap } from \"./types\"\n\nexport const numberValueTypes: ValueTypeMap = {\n // Border props\n borderWidth: px,\n borderTopWidth: px,\n borderRightWidth: px,\n borderBottomWidth: px,\n borderLeftWidth: px,\n borderRadius: px,\n borderTopLeftRadius: px,\n borderTopRightRadius: px,\n borderBottomRightRadius: px,\n borderBottomLeftRadius: px,\n\n // Positioning props\n width: px,\n maxWidth: px,\n height: px,\n maxHeight: px,\n top: px,\n right: px,\n bottom: px,\n left: px,\n inset: px,\n insetBlock: px,\n insetBlockStart: px,\n insetBlockEnd: px,\n insetInline: px,\n insetInlineStart: px,\n insetInlineEnd: px,\n\n // Spacing props\n padding: px,\n paddingTop: px,\n paddingRight: px,\n paddingBottom: px,\n paddingLeft: px,\n paddingBlock: px,\n paddingBlockStart: px,\n paddingBlockEnd: px,\n paddingInline: px,\n paddingInlineStart: px,\n paddingInlineEnd: px,\n margin: px,\n marginTop: px,\n marginRight: px,\n marginBottom: px,\n marginLeft: px,\n marginBlock: px,\n marginBlockStart: px,\n marginBlockEnd: px,\n marginInline: px,\n marginInlineStart: px,\n marginInlineEnd: px,\n\n // Typography\n fontSize: px,\n\n // Misc\n backgroundPositionX: px,\n backgroundPositionY: px,\n\n ...transformValueTypes,\n zIndex: int,\n\n // SVG\n fillOpacity: alpha,\n strokeOpacity: alpha,\n numOctaves: int,\n}\n"],"names":[],"mappings":";;;;;AAMO,MAAM,gBAAgB,GAAiB;;AAE1C,IAAA,WAAW,EAAE,EAAE;AACf,IAAA,cAAc,EAAE,EAAE;AAClB,IAAA,gBAAgB,EAAE,EAAE;AACpB,IAAA,iBAAiB,EAAE,EAAE;AACrB,IAAA,eAAe,EAAE,EAAE;AACnB,IAAA,YAAY,EAAE,EAAE;AAChB,IAAA,mBAAmB,EAAE,EAAE;AACvB,IAAA,oBAAoB,EAAE,EAAE;AACxB,IAAA,uBAAuB,EAAE,EAAE;AAC3B,IAAA,sBAAsB,EAAE,EAAE;;AAG1B,IAAA,KAAK,EAAE,EAAE;AACT,IAAA,QAAQ,EAAE,EAAE;AACZ,IAAA,MAAM,EAAE,EAAE;AACV,IAAA,SAAS,EAAE,EAAE;AACb,IAAA,GAAG,EAAE,EAAE;AACP,IAAA,KAAK,EAAE,EAAE;AACT,IAAA,MAAM,EAAE,EAAE;AACV,IAAA,IAAI,EAAE,EAAE;AACR,IAAA,KAAK,EAAE,EAAE;AACT,IAAA,UAAU,EAAE,EAAE;AACd,IAAA,eAAe,EAAE,EAAE;AACnB,IAAA,aAAa,EAAE,EAAE;AACjB,IAAA,WAAW,EAAE,EAAE;AACf,IAAA,gBAAgB,EAAE,EAAE;AACpB,IAAA,cAAc,EAAE,EAAE;;AAGlB,IAAA,OAAO,EAAE,EAAE;AACX,IAAA,UAAU,EAAE,EAAE;AACd,IAAA,YAAY,EAAE,EAAE;AAChB,IAAA,aAAa,EAAE,EAAE;AACjB,IAAA,WAAW,EAAE,EAAE;AACf,IAAA,YAAY,EAAE,EAAE;AAChB,IAAA,iBAAiB,EAAE,EAAE;AACrB,IAAA,eAAe,EAAE,EAAE;AACnB,IAAA,aAAa,EAAE,EAAE;AACjB,IAAA,kBAAkB,EAAE,EAAE;AACtB,IAAA,gBAAgB,EAAE,EAAE;AACpB,IAAA,MAAM,EAAE,EAAE;AACV,IAAA,SAAS,EAAE,EAAE;AACb,IAAA,WAAW,EAAE,EAAE;AACf,IAAA,YAAY,EAAE,EAAE;AAChB,IAAA,UAAU,EAAE,EAAE;AACd,IAAA,WAAW,EAAE,EAAE;AACf,IAAA,gBAAgB,EAAE,EAAE;AACpB,IAAA,cAAc,EAAE,EAAE;AAClB,IAAA,YAAY,EAAE,EAAE;AAChB,IAAA,iBAAiB,EAAE,EAAE;AACrB,IAAA,eAAe,EAAE,EAAE;;AAGnB,IAAA,QAAQ,EAAE,EAAE;;AAGZ,IAAA,mBAAmB,EAAE,EAAE;AACvB,IAAA,mBAAmB,EAAE,EAAE;AAEvB,IAAA,GAAG,mBAAmB;AACtB,IAAA,MAAM,EAAE,GAAG;;AAGX,IAAA,WAAW,EAAE,KAAK;AAClB,IAAA,aAAa,EAAE,KAAK;AACpB,IAAA,UAAU,EAAE,GAAG;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/maps/transform.mjs b/node_modules/motion-dom/dist/es/value/types/maps/transform.mjs deleted file mode 100644 index b5cc0d9..0000000 --- a/node_modules/motion-dom/dist/es/value/types/maps/transform.mjs +++ /dev/null @@ -1,38 +0,0 @@ -import { alpha, scale } from '../numbers/index.mjs'; -import { px, progressPercentage, degrees } from '../numbers/units.mjs'; - -const transformValueTypes = { - rotate: degrees, - /** - * Internal channel for `transition.path` orientToPath. Composed onto - * `rotate` at the transform-build sites so the user's `rotate` is - * never read or overwritten. Not part of `transformPropOrder`. - */ - pathRotation: degrees, - rotateX: degrees, - rotateY: degrees, - rotateZ: degrees, - scale, - scaleX: scale, - scaleY: scale, - scaleZ: scale, - skew: degrees, - skewX: degrees, - skewY: degrees, - distance: px, - translateX: px, - translateY: px, - translateZ: px, - x: px, - y: px, - z: px, - perspective: px, - transformPerspective: px, - opacity: alpha, - originX: progressPercentage, - originY: progressPercentage, - originZ: px, -}; - -export { transformValueTypes }; -//# sourceMappingURL=transform.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/maps/transform.mjs.map b/node_modules/motion-dom/dist/es/value/types/maps/transform.mjs.map deleted file mode 100644 index 6490b6b..0000000 --- a/node_modules/motion-dom/dist/es/value/types/maps/transform.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"transform.mjs","sources":["../../../../../src/value/types/maps/transform.ts"],"sourcesContent":["import { alpha, scale } from \"../numbers\"\nimport { degrees, progressPercentage, px } from \"../numbers/units\"\nimport { ValueTypeMap } from \"./types\"\n\nexport const transformValueTypes: ValueTypeMap = {\n rotate: degrees,\n /**\n * Internal channel for `transition.path` orientToPath. Composed onto\n * `rotate` at the transform-build sites so the user's `rotate` is\n * never read or overwritten. Not part of `transformPropOrder`.\n */\n pathRotation: degrees,\n rotateX: degrees,\n rotateY: degrees,\n rotateZ: degrees,\n scale,\n scaleX: scale,\n scaleY: scale,\n scaleZ: scale,\n skew: degrees,\n skewX: degrees,\n skewY: degrees,\n distance: px,\n translateX: px,\n translateY: px,\n translateZ: px,\n x: px,\n y: px,\n z: px,\n perspective: px,\n transformPerspective: px,\n opacity: alpha,\n originX: progressPercentage,\n originY: progressPercentage,\n originZ: px,\n}\n"],"names":[],"mappings":";;;AAIO,MAAM,mBAAmB,GAAiB;AAC7C,IAAA,MAAM,EAAE,OAAO;AACf;;;;AAIG;AACH,IAAA,YAAY,EAAE,OAAO;AACrB,IAAA,OAAO,EAAE,OAAO;AAChB,IAAA,OAAO,EAAE,OAAO;AAChB,IAAA,OAAO,EAAE,OAAO;IAChB,KAAK;AACL,IAAA,MAAM,EAAE,KAAK;AACb,IAAA,MAAM,EAAE,KAAK;AACb,IAAA,MAAM,EAAE,KAAK;AACb,IAAA,IAAI,EAAE,OAAO;AACb,IAAA,KAAK,EAAE,OAAO;AACd,IAAA,KAAK,EAAE,OAAO;AACd,IAAA,QAAQ,EAAE,EAAE;AACZ,IAAA,UAAU,EAAE,EAAE;AACd,IAAA,UAAU,EAAE,EAAE;AACd,IAAA,UAAU,EAAE,EAAE;AACd,IAAA,CAAC,EAAE,EAAE;AACL,IAAA,CAAC,EAAE,EAAE;AACL,IAAA,CAAC,EAAE,EAAE;AACL,IAAA,WAAW,EAAE,EAAE;AACf,IAAA,oBAAoB,EAAE,EAAE;AACxB,IAAA,OAAO,EAAE,KAAK;AACd,IAAA,OAAO,EAAE,kBAAkB;AAC3B,IAAA,OAAO,EAAE,kBAAkB;AAC3B,IAAA,OAAO,EAAE,EAAE;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/numbers/index.mjs b/node_modules/motion-dom/dist/es/value/types/numbers/index.mjs deleted file mode 100644 index 9639305..0000000 --- a/node_modules/motion-dom/dist/es/value/types/numbers/index.mjs +++ /dev/null @@ -1,18 +0,0 @@ -import { clamp } from 'motion-utils'; - -const number = { - test: (v) => typeof v === "number", - parse: parseFloat, - transform: (v) => v, -}; -const alpha = { - ...number, - transform: (v) => clamp(0, 1, v), -}; -const scale = { - ...number, - default: 1, -}; - -export { alpha, number, scale }; -//# sourceMappingURL=index.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/numbers/index.mjs.map b/node_modules/motion-dom/dist/es/value/types/numbers/index.mjs.map deleted file mode 100644 index d4ca6a2..0000000 --- a/node_modules/motion-dom/dist/es/value/types/numbers/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs","sources":["../../../../../src/value/types/numbers/index.ts"],"sourcesContent":["import { clamp } from \"motion-utils\"\n\nexport const number = {\n test: (v: number) => typeof v === \"number\",\n parse: parseFloat,\n transform: (v: number) => v,\n}\n\nexport const alpha = {\n ...number,\n transform: (v: number) => clamp(0, 1, v),\n}\n\nexport const scale = {\n ...number,\n default: 1,\n}\n"],"names":[],"mappings":";;AAEO,MAAM,MAAM,GAAG;IAClB,IAAI,EAAE,CAAC,CAAS,KAAK,OAAO,CAAC,KAAK,QAAQ;AAC1C,IAAA,KAAK,EAAE,UAAU;AACjB,IAAA,SAAS,EAAE,CAAC,CAAS,KAAK,CAAC;;AAGxB,MAAM,KAAK,GAAG;AACjB,IAAA,GAAG,MAAM;AACT,IAAA,SAAS,EAAE,CAAC,CAAS,KAAK,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;;AAGrC,MAAM,KAAK,GAAG;AACjB,IAAA,GAAG,MAAM;AACT,IAAA,OAAO,EAAE,CAAC;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/numbers/units.mjs b/node_modules/motion-dom/dist/es/value/types/numbers/units.mjs deleted file mode 100644 index 5f59238..0000000 --- a/node_modules/motion-dom/dist/es/value/types/numbers/units.mjs +++ /dev/null @@ -1,19 +0,0 @@ -/*#__NO_SIDE_EFFECTS__*/ -const createUnitType = (unit) => ({ - test: (v) => typeof v === "string" && v.endsWith(unit) && v.split(" ").length === 1, - parse: parseFloat, - transform: (v) => `${v}${unit}`, -}); -const degrees = /*@__PURE__*/ createUnitType("deg"); -const percent = /*@__PURE__*/ createUnitType("%"); -const px = /*@__PURE__*/ createUnitType("px"); -const vh = /*@__PURE__*/ createUnitType("vh"); -const vw = /*@__PURE__*/ createUnitType("vw"); -const progressPercentage = /*@__PURE__*/ (() => ({ - ...percent, - parse: (v) => percent.parse(v) / 100, - transform: (v) => percent.transform(v * 100), -}))(); - -export { degrees, percent, progressPercentage, px, vh, vw }; -//# sourceMappingURL=units.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/numbers/units.mjs.map b/node_modules/motion-dom/dist/es/value/types/numbers/units.mjs.map deleted file mode 100644 index 66cb853..0000000 --- a/node_modules/motion-dom/dist/es/value/types/numbers/units.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"units.mjs","sources":["../../../../../src/value/types/numbers/units.ts"],"sourcesContent":["import { AnyResolvedKeyframe } from \"../../../animation/types\"\n\n/*#__NO_SIDE_EFFECTS__*/\nconst createUnitType = (unit: string) => ({\n test: (v: AnyResolvedKeyframe) =>\n typeof v === \"string\" && v.endsWith(unit) && v.split(\" \").length === 1,\n parse: parseFloat,\n transform: (v: number | string) => `${v}${unit}`,\n})\n\nexport const degrees = /*@__PURE__*/ createUnitType(\"deg\")\nexport const percent = /*@__PURE__*/ createUnitType(\"%\")\nexport const px = /*@__PURE__*/ createUnitType(\"px\")\nexport const vh = /*@__PURE__*/ createUnitType(\"vh\")\nexport const vw = /*@__PURE__*/ createUnitType(\"vw\")\n\nexport const progressPercentage = /*@__PURE__*/ (() => ({\n ...percent,\n parse: (v: string) => percent.parse(v) / 100,\n transform: (v: number) => percent.transform(v * 100),\n}))()\n"],"names":[],"mappings":"AAEA;AACA,MAAM,cAAc,GAAG,CAAC,IAAY,MAAM;IACtC,IAAI,EAAE,CAAC,CAAsB,KACzB,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,KAAK,CAAC;AAC1E,IAAA,KAAK,EAAE,UAAU;IACjB,SAAS,EAAE,CAAC,CAAkB,KAAK,CAAA,EAAG,CAAC,CAAA,EAAG,IAAI,CAAA,CAAE;AACnD,CAAA,CAAC;AAEK,MAAM,OAAO,iBAAiB,cAAc,CAAC,KAAK;AAClD,MAAM,OAAO,iBAAiB,cAAc,CAAC,GAAG;AAChD,MAAM,EAAE,iBAAiB,cAAc,CAAC,IAAI;AAC5C,MAAM,EAAE,iBAAiB,cAAc,CAAC,IAAI;AAC5C,MAAM,EAAE,iBAAiB,cAAc,CAAC,IAAI;AAE5C,MAAM,kBAAkB,iBAAiB,CAAC,OAAO;AACpD,IAAA,GAAG,OAAO;AACV,IAAA,KAAK,EAAE,CAAC,CAAS,KAAK,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG;AAC5C,IAAA,SAAS,EAAE,CAAC,CAAS,KAAK,OAAO,CAAC,SAAS,CAAC,CAAC,GAAG,GAAG,CAAC;CACvD,CAAC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/test.mjs b/node_modules/motion-dom/dist/es/value/types/test.mjs deleted file mode 100644 index 26cb26e..0000000 --- a/node_modules/motion-dom/dist/es/value/types/test.mjs +++ /dev/null @@ -1,7 +0,0 @@ -/** - * Tests a provided value against a ValueType - */ -const testValueType = (v) => (type) => type.test(v); - -export { testValueType }; -//# sourceMappingURL=test.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/test.mjs.map b/node_modules/motion-dom/dist/es/value/types/test.mjs.map deleted file mode 100644 index b0ecce0..0000000 --- a/node_modules/motion-dom/dist/es/value/types/test.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"test.mjs","sources":["../../../../src/value/types/test.ts"],"sourcesContent":["import { ValueType } from \"./types\"\n\n/**\n * Tests a provided value against a ValueType\n */\nexport const testValueType = (v: any) => (type: ValueType) => type.test(v)\n"],"names":[],"mappings":"AAEA;;AAEG;MACU,aAAa,GAAG,CAAC,CAAM,KAAK,CAAC,IAAe,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/utils/animatable-none.mjs b/node_modules/motion-dom/dist/es/value/types/utils/animatable-none.mjs deleted file mode 100644 index c4efbc2..0000000 --- a/node_modules/motion-dom/dist/es/value/types/utils/animatable-none.mjs +++ /dev/null @@ -1,18 +0,0 @@ -import { complex } from '../complex/index.mjs'; -import { filter } from '../complex/filter.mjs'; -import { mask } from '../complex/mask.mjs'; -import { getDefaultValueType } from '../maps/defaults.mjs'; - -const customTypes = /*@__PURE__*/ new Set([filter, mask]); -function getAnimatableNone(key, value) { - let defaultValueType = getDefaultValueType(key); - if (!customTypes.has(defaultValueType)) - defaultValueType = complex; - // If value is not recognised as animatable, ie "none", create an animatable version origin based on the target - return defaultValueType.getAnimatableNone - ? defaultValueType.getAnimatableNone(value) - : undefined; -} - -export { getAnimatableNone }; -//# sourceMappingURL=animatable-none.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/utils/animatable-none.mjs.map b/node_modules/motion-dom/dist/es/value/types/utils/animatable-none.mjs.map deleted file mode 100644 index f832871..0000000 --- a/node_modules/motion-dom/dist/es/value/types/utils/animatable-none.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"animatable-none.mjs","sources":["../../../../../src/value/types/utils/animatable-none.ts"],"sourcesContent":["import { complex } from \"../complex\"\nimport { filter } from \"../complex/filter\"\nimport { mask } from \"../complex/mask\"\nimport { getDefaultValueType } from \"../maps/defaults\"\n\nconst customTypes = /*@__PURE__*/ new Set([filter, mask])\n\nexport function getAnimatableNone(key: string, value: string) {\n let defaultValueType = getDefaultValueType(key)\n if (!customTypes.has(defaultValueType as any)) defaultValueType = complex\n // If value is not recognised as animatable, ie \"none\", create an animatable version origin based on the target\n return defaultValueType.getAnimatableNone\n ? defaultValueType.getAnimatableNone(value)\n : undefined\n}\n"],"names":[],"mappings":";;;;;AAKA,MAAM,WAAW,iBAAiB,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;AAEnD,SAAU,iBAAiB,CAAC,GAAW,EAAE,KAAa,EAAA;AACxD,IAAA,IAAI,gBAAgB,GAAG,mBAAmB,CAAC,GAAG,CAAC;AAC/C,IAAA,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,gBAAuB,CAAC;QAAE,gBAAgB,GAAG,OAAO;;IAEzE,OAAO,gBAAgB,CAAC;AACpB,UAAE,gBAAgB,CAAC,iBAAiB,CAAC,KAAK;UACxC,SAAS;AACnB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/utils/color-regex.mjs b/node_modules/motion-dom/dist/es/value/types/utils/color-regex.mjs deleted file mode 100644 index 645be1e..0000000 --- a/node_modules/motion-dom/dist/es/value/types/utils/color-regex.mjs +++ /dev/null @@ -1,4 +0,0 @@ -const colorRegex = /(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu; - -export { colorRegex }; -//# sourceMappingURL=color-regex.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/utils/color-regex.mjs.map b/node_modules/motion-dom/dist/es/value/types/utils/color-regex.mjs.map deleted file mode 100644 index fcfdf78..0000000 --- a/node_modules/motion-dom/dist/es/value/types/utils/color-regex.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"color-regex.mjs","sources":["../../../../../src/value/types/utils/color-regex.ts"],"sourcesContent":["export const colorRegex =\n /(?:#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\))/giu\n"],"names":[],"mappings":"AAAO,MAAM,UAAU,GACnB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/utils/find.mjs b/node_modules/motion-dom/dist/es/value/types/utils/find.mjs deleted file mode 100644 index aac4531..0000000 --- a/node_modules/motion-dom/dist/es/value/types/utils/find.mjs +++ /dev/null @@ -1,16 +0,0 @@ -import { color } from '../color/index.mjs'; -import { complex } from '../complex/index.mjs'; -import { dimensionValueTypes } from '../dimensions.mjs'; -import { testValueType } from '../test.mjs'; - -/** - * A list of all ValueTypes - */ -const valueTypes = [...dimensionValueTypes, color, complex]; -/** - * Tests a value against the list of ValueTypes - */ -const findValueType = (v) => valueTypes.find(testValueType(v)); - -export { findValueType }; -//# sourceMappingURL=find.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/utils/find.mjs.map b/node_modules/motion-dom/dist/es/value/types/utils/find.mjs.map deleted file mode 100644 index 9de8942..0000000 --- a/node_modules/motion-dom/dist/es/value/types/utils/find.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"find.mjs","sources":["../../../../../src/value/types/utils/find.ts"],"sourcesContent":["import { color } from \"../color\"\nimport { complex } from \"../complex\"\nimport { dimensionValueTypes } from \"../dimensions\"\nimport { testValueType } from \"../test\"\n\n/**\n * A list of all ValueTypes\n */\nconst valueTypes = [...dimensionValueTypes, color, complex]\n\n/**\n * Tests a value against the list of ValueTypes\n */\nexport const findValueType = (v: any) => valueTypes.find(testValueType(v))\n"],"names":[],"mappings":";;;;;AAKA;;AAEG;AACH,MAAM,UAAU,GAAG,CAAC,GAAG,mBAAmB,EAAE,KAAK,EAAE,OAAO,CAAC;AAE3D;;AAEG;AACI,MAAM,aAAa,GAAG,CAAC,CAAM,KAAK,UAAU,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/utils/float-regex.mjs b/node_modules/motion-dom/dist/es/value/types/utils/float-regex.mjs deleted file mode 100644 index 2e1cd7d..0000000 --- a/node_modules/motion-dom/dist/es/value/types/utils/float-regex.mjs +++ /dev/null @@ -1,4 +0,0 @@ -const floatRegex = /-?(?:\d+(?:\.\d+)?|\.\d+)/gu; - -export { floatRegex }; -//# sourceMappingURL=float-regex.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/utils/float-regex.mjs.map b/node_modules/motion-dom/dist/es/value/types/utils/float-regex.mjs.map deleted file mode 100644 index 76a6c87..0000000 --- a/node_modules/motion-dom/dist/es/value/types/utils/float-regex.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"float-regex.mjs","sources":["../../../../../src/value/types/utils/float-regex.ts"],"sourcesContent":["export const floatRegex = /-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)/gu\n"],"names":[],"mappings":"AAAO,MAAM,UAAU,GAAG;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/utils/get-as-type.mjs b/node_modules/motion-dom/dist/es/value/types/utils/get-as-type.mjs deleted file mode 100644 index 768d566..0000000 --- a/node_modules/motion-dom/dist/es/value/types/utils/get-as-type.mjs +++ /dev/null @@ -1,11 +0,0 @@ -/** - * Provided a value and a ValueType, returns the value as that value type. - */ -const getValueAsType = (value, type) => { - return type && typeof value === "number" - ? type.transform(value) - : value; -}; - -export { getValueAsType }; -//# sourceMappingURL=get-as-type.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/utils/get-as-type.mjs.map b/node_modules/motion-dom/dist/es/value/types/utils/get-as-type.mjs.map deleted file mode 100644 index 20ce63e..0000000 --- a/node_modules/motion-dom/dist/es/value/types/utils/get-as-type.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"get-as-type.mjs","sources":["../../../../../src/value/types/utils/get-as-type.ts"],"sourcesContent":["import { ValueType } from \"../types\"\n\n/**\n * Provided a value and a ValueType, returns the value as that value type.\n */\nexport const getValueAsType = (value: any, type?: ValueType) => {\n return type && typeof value === \"number\"\n ? (type as any).transform(value)\n : value\n}\n"],"names":[],"mappings":"AAEA;;AAEG;MACU,cAAc,GAAG,CAAC,KAAU,EAAE,IAAgB,KAAI;AAC3D,IAAA,OAAO,IAAI,IAAI,OAAO,KAAK,KAAK;AAC5B,UAAG,IAAY,CAAC,SAAS,CAAC,KAAK;UAC7B,KAAK;AACf;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/utils/is-nullish.mjs b/node_modules/motion-dom/dist/es/value/types/utils/is-nullish.mjs deleted file mode 100644 index 28ccf2f..0000000 --- a/node_modules/motion-dom/dist/es/value/types/utils/is-nullish.mjs +++ /dev/null @@ -1,6 +0,0 @@ -function isNullish(v) { - return v == null; -} - -export { isNullish }; -//# sourceMappingURL=is-nullish.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/utils/is-nullish.mjs.map b/node_modules/motion-dom/dist/es/value/types/utils/is-nullish.mjs.map deleted file mode 100644 index d883f28..0000000 --- a/node_modules/motion-dom/dist/es/value/types/utils/is-nullish.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"is-nullish.mjs","sources":["../../../../../src/value/types/utils/is-nullish.ts"],"sourcesContent":["export function isNullish(v: any): v is null | undefined {\n return v == null\n}\n"],"names":[],"mappings":"AAAM,SAAU,SAAS,CAAC,CAAM,EAAA;IAC5B,OAAO,CAAC,IAAI,IAAI;AACpB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/utils/sanitize.mjs b/node_modules/motion-dom/dist/es/value/types/utils/sanitize.mjs deleted file mode 100644 index 8285b23..0000000 --- a/node_modules/motion-dom/dist/es/value/types/utils/sanitize.mjs +++ /dev/null @@ -1,6 +0,0 @@ -// If this number is a decimal, make it just five decimal places -// to avoid exponents -const sanitize = (v) => Math.round(v * 100000) / 100000; - -export { sanitize }; -//# sourceMappingURL=sanitize.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/utils/sanitize.mjs.map b/node_modules/motion-dom/dist/es/value/types/utils/sanitize.mjs.map deleted file mode 100644 index 2400656..0000000 --- a/node_modules/motion-dom/dist/es/value/types/utils/sanitize.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sanitize.mjs","sources":["../../../../../src/value/types/utils/sanitize.ts"],"sourcesContent":["// If this number is a decimal, make it just five decimal places\n// to avoid exponents\nexport const sanitize = (v: number) => Math.round(v * 100000) / 100000\n"],"names":[],"mappings":"AAAA;AACA;AACO,MAAM,QAAQ,GAAG,CAAC,CAAS,KAAK,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,MAAM,CAAC,GAAG;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/utils/single-color-regex.mjs b/node_modules/motion-dom/dist/es/value/types/utils/single-color-regex.mjs deleted file mode 100644 index cf67f20..0000000 --- a/node_modules/motion-dom/dist/es/value/types/utils/single-color-regex.mjs +++ /dev/null @@ -1,4 +0,0 @@ -const singleColorRegex = /^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu; - -export { singleColorRegex }; -//# sourceMappingURL=single-color-regex.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/utils/single-color-regex.mjs.map b/node_modules/motion-dom/dist/es/value/types/utils/single-color-regex.mjs.map deleted file mode 100644 index 706651b..0000000 --- a/node_modules/motion-dom/dist/es/value/types/utils/single-color-regex.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"single-color-regex.mjs","sources":["../../../../../src/value/types/utils/single-color-regex.ts"],"sourcesContent":["export const singleColorRegex =\n /^(?:#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\))$/iu\n"],"names":[],"mappings":"AAAO,MAAM,gBAAgB,GACzB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/utils/is-motion-value.mjs b/node_modules/motion-dom/dist/es/value/utils/is-motion-value.mjs deleted file mode 100644 index ae80d22..0000000 --- a/node_modules/motion-dom/dist/es/value/utils/is-motion-value.mjs +++ /dev/null @@ -1,4 +0,0 @@ -const isMotionValue = (value) => Boolean(value && value.getVelocity); - -export { isMotionValue }; -//# sourceMappingURL=is-motion-value.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/utils/is-motion-value.mjs.map b/node_modules/motion-dom/dist/es/value/utils/is-motion-value.mjs.map deleted file mode 100644 index 171e74e..0000000 --- a/node_modules/motion-dom/dist/es/value/utils/is-motion-value.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"is-motion-value.mjs","sources":["../../../../src/value/utils/is-motion-value.ts"],"sourcesContent":["import type { MotionValue } from \"..\"\n\nexport const isMotionValue = (value: any): value is MotionValue =>\n Boolean(value && value.getVelocity)\n"],"names":[],"mappings":"AAEO,MAAM,aAAa,GAAG,CAAC,KAAU,KACpC,OAAO,CAAC,KAAK,IAAI,KAAK,CAAC,WAAW;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/utils/resolve-motion-value.mjs b/node_modules/motion-dom/dist/es/value/utils/resolve-motion-value.mjs deleted file mode 100644 index 72614b6..0000000 --- a/node_modules/motion-dom/dist/es/value/utils/resolve-motion-value.mjs +++ /dev/null @@ -1,11 +0,0 @@ -import { isMotionValue } from './is-motion-value.mjs'; - -/** - * If the provided value is a MotionValue, this returns the actual value, otherwise just the value itself - */ -function resolveMotionValue(value) { - return isMotionValue(value) ? value.get() : value; -} - -export { resolveMotionValue }; -//# sourceMappingURL=resolve-motion-value.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/utils/resolve-motion-value.mjs.map b/node_modules/motion-dom/dist/es/value/utils/resolve-motion-value.mjs.map deleted file mode 100644 index 1960b2c..0000000 --- a/node_modules/motion-dom/dist/es/value/utils/resolve-motion-value.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"resolve-motion-value.mjs","sources":["../../../../src/value/utils/resolve-motion-value.ts"],"sourcesContent":["import type { AnyResolvedKeyframe } from \"../../animation/types\"\nimport { isMotionValue } from \"./is-motion-value\"\nimport type { MotionValue } from \"../index\"\n\n/**\n * If the provided value is a MotionValue, this returns the actual value, otherwise just the value itself\n */\nexport function resolveMotionValue(\n value?: AnyResolvedKeyframe | MotionValue\n): AnyResolvedKeyframe {\n return isMotionValue(value) ? value.get() : value\n}\n"],"names":[],"mappings":";;AAIA;;AAEG;AACG,SAAU,kBAAkB,CAC9B,KAAyC,EAAA;AAEzC,IAAA,OAAO,aAAa,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,GAAG,EAAE,GAAG,KAAK;AACrD;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/will-change/add-will-change.mjs b/node_modules/motion-dom/dist/es/value/will-change/add-will-change.mjs deleted file mode 100644 index 6c9ab79..0000000 --- a/node_modules/motion-dom/dist/es/value/will-change/add-will-change.mjs +++ /dev/null @@ -1,21 +0,0 @@ -import { MotionGlobalConfig } from 'motion-utils'; -import { isWillChangeMotionValue } from './is.mjs'; - -function addValueToWillChange(visualElement, key) { - const willChange = visualElement.getValue("willChange"); - /** - * It could be that a user has set willChange to a regular MotionValue, - * in which case we can't add the value to it. - */ - if (isWillChangeMotionValue(willChange)) { - return willChange.add(key); - } - else if (!willChange && MotionGlobalConfig.WillChange) { - const newWillChange = new MotionGlobalConfig.WillChange("auto"); - visualElement.addValue("willChange", newWillChange); - newWillChange.add(key); - } -} - -export { addValueToWillChange }; -//# sourceMappingURL=add-will-change.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/will-change/add-will-change.mjs.map b/node_modules/motion-dom/dist/es/value/will-change/add-will-change.mjs.map deleted file mode 100644 index ef5a237..0000000 --- a/node_modules/motion-dom/dist/es/value/will-change/add-will-change.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"add-will-change.mjs","sources":["../../../../src/value/will-change/add-will-change.ts"],"sourcesContent":["import { MotionGlobalConfig } from \"motion-utils\"\nimport type { VisualElement } from \"../../render/VisualElement\"\nimport { isWillChangeMotionValue } from \"./is\"\n\nexport function addValueToWillChange(\n visualElement: VisualElement,\n key: string\n) {\n const willChange = visualElement.getValue(\"willChange\")\n\n /**\n * It could be that a user has set willChange to a regular MotionValue,\n * in which case we can't add the value to it.\n */\n if (isWillChangeMotionValue(willChange)) {\n return willChange.add(key)\n } else if (!willChange && MotionGlobalConfig.WillChange) {\n const newWillChange = new MotionGlobalConfig.WillChange(\"auto\")\n\n visualElement.addValue(\"willChange\", newWillChange)\n newWillChange.add(key)\n }\n}\n"],"names":[],"mappings":";;;AAIM,SAAU,oBAAoB,CAChC,aAA4B,EAC5B,GAAW,EAAA;IAEX,MAAM,UAAU,GAAG,aAAa,CAAC,QAAQ,CAAC,YAAY,CAAC;AAEvD;;;AAGG;AACH,IAAA,IAAI,uBAAuB,CAAC,UAAU,CAAC,EAAE;AACrC,QAAA,OAAO,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC;IAC9B;AAAO,SAAA,IAAI,CAAC,UAAU,IAAI,kBAAkB,CAAC,UAAU,EAAE;QACrD,MAAM,aAAa,GAAG,IAAI,kBAAkB,CAAC,UAAU,CAAC,MAAM,CAAC;AAE/D,QAAA,aAAa,CAAC,QAAQ,CAAC,YAAY,EAAE,aAAa,CAAC;AACnD,QAAA,aAAa,CAAC,GAAG,CAAC,GAAG,CAAC;IAC1B;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/will-change/is.mjs b/node_modules/motion-dom/dist/es/value/will-change/is.mjs deleted file mode 100644 index b36be11..0000000 --- a/node_modules/motion-dom/dist/es/value/will-change/is.mjs +++ /dev/null @@ -1,8 +0,0 @@ -import { isMotionValue } from '../utils/is-motion-value.mjs'; - -function isWillChangeMotionValue(value) { - return Boolean(isMotionValue(value) && value.add); -} - -export { isWillChangeMotionValue }; -//# sourceMappingURL=is.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/will-change/is.mjs.map b/node_modules/motion-dom/dist/es/value/will-change/is.mjs.map deleted file mode 100644 index f68ce5f..0000000 --- a/node_modules/motion-dom/dist/es/value/will-change/is.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"is.mjs","sources":["../../../../src/value/will-change/is.ts"],"sourcesContent":["import { isMotionValue } from \"../utils/is-motion-value\"\nimport type { WillChange } from \"./types\"\n\nexport function isWillChangeMotionValue(value: any): value is WillChange {\n return Boolean(isMotionValue(value) && (value as WillChange).add)\n}\n"],"names":[],"mappings":";;AAGM,SAAU,uBAAuB,CAAC,KAAU,EAAA;IAC9C,OAAO,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,IAAK,KAAoB,CAAC,GAAG,CAAC;AACrE;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/view/index.mjs b/node_modules/motion-dom/dist/es/view/index.mjs deleted file mode 100644 index 639a694..0000000 --- a/node_modules/motion-dom/dist/es/view/index.mjs +++ /dev/null @@ -1,175 +0,0 @@ -import { noop } from 'motion-utils'; -import { addToQueue } from './queue.mjs'; - -class ViewTransitionBuilder { - constructor(update, options = {}) { - this.currentSubject = "root"; - this.targets = new Map(); - /** - * Definitions that must be resolved to elements (and assigned a - * `view-transition-name`) rather than treated as pre-named layers. - */ - this.resolveDefs = new Set(); - /** - * Per-subject crop override: `true` forces the crop (clip + object-fit: - * cover + animated corner radii) on, `false` forces it off. A subject with - * no entry uses the default - crop only a genuine morph (a layer present in - * both snapshots), so a fade-only enter/exit isn't clipped to nothing. - */ - this.cropOverride = new Map(); - /** - * Subjects paired with a different new-snapshot target (the second `.add()` - * argument), so two distinct elements share one name and morph into each - * other - a shared-element transition. - */ - this.pairs = new Map(); - /** - * A `view-transition-class` to apply to each subject's resolved elements, - * so authors can target the generated layers from CSS by class rather than - * the opaque generated name. - */ - this.classNames = new Map(); - /** - * Subjects opted out of automatic group nesting via `.group(false)`. Their - * layer stays a flat top-level group (`view-transition-group: none`) instead - * of nesting under its DOM-ancestor layer - so it animates independently and - * escapes an ancestor's clip/transform (e.g. an element that lifts out of a - * card and flies across, which nesting would clip to the card). - */ - this.flatGroups = new Set(); - this.notifyReady = noop; - this.notifyReject = noop; - this.readyPromise = new Promise((resolve, reject) => { - this.notifyReady = resolve; - this.notifyReject = reject; - }); - this.update = update; - this.options = { - interrupt: "wait", - ...options, - }; - // Avoid an unhandled rejection when a failed transition has no - // `.then(_, reject)` handler attached (e.g. fire-and-forget). - this.readyPromise.catch(noop); - addToQueue(this); - } - /** - * Target elements resolved from a selector or Element, each assigned a - * `view-transition-name` automatically. - * - * Passing a second target pairs them: the first is resolved in the old - * snapshot and the second in the new, sharing one name so two *different* - * elements morph into each other (e.g. `.add(card, ".modal")`). Symmetric - - * pass them the other way round to morph back. - */ - add(subject, newSubject) { - this.currentSubject = subject; - this.resolveDefs.add(subject); - if (newSubject !== undefined) - this.pairs.set(subject, newSubject); - // Register the subject so it participates (and gets an automatic - // layout/morph animation) even without an explicit enter/exit/layout. - if (!this.targets.has(subject)) - this.targets.set(subject, {}); - return this; - } - /** - * Control this subject's crop (clip + `object-fit: cover` + animated - * corners). By default a subject auto-crops only when it actually morphs - - * present in both snapshots (a survivor, or an `.add(a, b)` pair). A - * fade-only enter/exit has no second box to crop against, so it's left to - * the browser default; in particular the `overflow: clip` a crop adds would - * otherwise clip a mis-sized enter/exit layer to nothing. - * - * `.crop(false)` forces the crop off (e.g. a text morph, where - * `object-fit: cover` clips glyphs as the box grows); `.crop(true)` forces - * it on for a non-morph the default wouldn't otherwise crop. - */ - crop(enabled = true) { - this.cropOverride.set(this.currentSubject, enabled); - return this; - } - /** - * By default a subject's layer nests under its nearest DOM-ancestor layer - * (`view-transition-group: contain`), so the ancestor's clip/transform/opacity - * apply to it through the transition - mirroring how the DOM actually paints, - * and letting a wrapper crop its child for the whole morph rather than only - * once the live DOM takes back over. (Needs a browser that supports nested - * view-transition groups; elsewhere it degrades to the flat default.) - * - * Call `.group(false)` to opt out: the layer stays flat and top-level, so it - * animates independently and escapes an ancestor's clip - e.g. an element - * that should lift out of a card and fly across, which nesting would clip. - */ - group(enabled = true) { - enabled - ? this.flatGroups.delete(this.currentSubject) - : this.flatGroups.add(this.currentSubject); - return this; - } - /** - * Tag this subject's generated layers with a `view-transition-class`, so - * they can be targeted from CSS - `::view-transition-group(.name)`, - * `::view-transition-old/new(.name)`, `::view-transition-image-pair(.name)` - * - without the opaque generated `view-transition-name`. Because `.add()` - * can match many elements, a shared class targets them all at once (and, - * for a pair, both ends). The escape hatch for z-index / custom keyframes - * on a morph layer. - */ - class(name) { - this.classNames.set(this.currentSubject, name); - return this; - } - /** - * Set the transition for this subject's morph. The morph is enabled - * automatically by `.add()`; this just customises its timing (duration, - * easing, a `delay`/`stagger`, …). On the implicit `root` subject it also - * opts the page into the transition (the root crossfade). - */ - layout(options = {}) { - this.updateTarget("layout", {}, options); - return this; - } - enter(keyframes, options) { - this.updateTarget("enter", keyframes, options); - return this; - } - exit(keyframes, options) { - this.updateTarget("exit", keyframes, options); - return this; - } - /** - * Animate the new view directly, whether the element is appearing or - * persisting (unlike `.enter()`, which only fires for a pure newcomer). - * Pair with `.old()` for a crossfade or slide-through. - */ - new(keyframes, options) { - this.updateTarget("new", keyframes, options); - return this; - } - /** - * Animate the old view directly, whether the element is leaving or - * persisting (unlike `.exit()`, which only fires for a pure leaver). - */ - old(keyframes, options) { - this.updateTarget("old", keyframes, options); - return this; - } - updateTarget(target, keyframes, options = {}) { - const { currentSubject, targets } = this; - if (!targets.has(currentSubject)) { - targets.set(currentSubject, {}); - } - const targetData = targets.get(currentSubject); - targetData[target] = { keyframes, options }; - } - then(resolve, reject) { - return this.readyPromise.then(resolve, reject); - } -} -function animateView(update, options = {}) { - return new ViewTransitionBuilder(update, options); -} - -export { ViewTransitionBuilder, animateView }; -//# sourceMappingURL=index.mjs.map diff --git a/node_modules/motion-dom/dist/es/view/index.mjs.map b/node_modules/motion-dom/dist/es/view/index.mjs.map deleted file mode 100644 index 5f15e68..0000000 --- a/node_modules/motion-dom/dist/es/view/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs","sources":["../../../src/view/index.ts"],"sourcesContent":["import { noop } from \"motion-utils\"\nimport type { GroupAnimation } from \"../animation/GroupAnimation\"\nimport { AnimationOptions, DOMKeyframesDefinition } from \"../animation/types\"\nimport { addToQueue } from \"./queue\"\nimport {\n ViewTransitionOptions,\n ViewTransitionTarget,\n ViewTransitionTargetDefinition,\n} from \"./types\"\nimport \"./types.global\"\n\n// Re-export the public view-transition types so they flow out through\n// motion-dom -> framer-motion -> motion alongside `animateView`.\nexport type * from \"./types\"\n\nexport class ViewTransitionBuilder {\n private currentSubject: ViewTransitionTargetDefinition = \"root\"\n\n targets = new Map()\n\n /**\n * Definitions that must be resolved to elements (and assigned a\n * `view-transition-name`) rather than treated as pre-named layers.\n */\n resolveDefs = new Set()\n\n /**\n * Per-subject crop override: `true` forces the crop (clip + object-fit:\n * cover + animated corner radii) on, `false` forces it off. A subject with\n * no entry uses the default - crop only a genuine morph (a layer present in\n * both snapshots), so a fade-only enter/exit isn't clipped to nothing.\n */\n cropOverride = new Map()\n\n /**\n * Subjects paired with a different new-snapshot target (the second `.add()`\n * argument), so two distinct elements share one name and morph into each\n * other - a shared-element transition.\n */\n pairs = new Map<\n ViewTransitionTargetDefinition,\n ViewTransitionTargetDefinition\n >()\n\n /**\n * A `view-transition-class` to apply to each subject's resolved elements,\n * so authors can target the generated layers from CSS by class rather than\n * the opaque generated name.\n */\n classNames = new Map()\n\n /**\n * Subjects opted out of automatic group nesting via `.group(false)`. Their\n * layer stays a flat top-level group (`view-transition-group: none`) instead\n * of nesting under its DOM-ancestor layer - so it animates independently and\n * escapes an ancestor's clip/transform (e.g. an element that lifts out of a\n * card and flies across, which nesting would clip to the card).\n */\n flatGroups = new Set()\n\n update: () => void | Promise\n\n options: ViewTransitionOptions\n\n notifyReady: (value: GroupAnimation) => void = noop\n\n notifyReject: (error: unknown) => void = noop\n\n private readyPromise = new Promise((resolve, reject) => {\n this.notifyReady = resolve\n this.notifyReject = reject\n })\n\n constructor(\n update: () => void | Promise,\n options: ViewTransitionOptions = {}\n ) {\n this.update = update\n this.options = {\n interrupt: \"wait\",\n ...options,\n }\n // Avoid an unhandled rejection when a failed transition has no\n // `.then(_, reject)` handler attached (e.g. fire-and-forget).\n this.readyPromise.catch(noop)\n addToQueue(this)\n }\n\n /**\n * Target elements resolved from a selector or Element, each assigned a\n * `view-transition-name` automatically.\n *\n * Passing a second target pairs them: the first is resolved in the old\n * snapshot and the second in the new, sharing one name so two *different*\n * elements morph into each other (e.g. `.add(card, \".modal\")`). Symmetric -\n * pass them the other way round to morph back.\n */\n add(\n subject: ViewTransitionTargetDefinition,\n newSubject?: ViewTransitionTargetDefinition\n ) {\n this.currentSubject = subject\n this.resolveDefs.add(subject)\n if (newSubject !== undefined) this.pairs.set(subject, newSubject)\n // Register the subject so it participates (and gets an automatic\n // layout/morph animation) even without an explicit enter/exit/layout.\n if (!this.targets.has(subject)) this.targets.set(subject, {})\n\n return this\n }\n\n /**\n * Control this subject's crop (clip + `object-fit: cover` + animated\n * corners). By default a subject auto-crops only when it actually morphs -\n * present in both snapshots (a survivor, or an `.add(a, b)` pair). A\n * fade-only enter/exit has no second box to crop against, so it's left to\n * the browser default; in particular the `overflow: clip` a crop adds would\n * otherwise clip a mis-sized enter/exit layer to nothing.\n *\n * `.crop(false)` forces the crop off (e.g. a text morph, where\n * `object-fit: cover` clips glyphs as the box grows); `.crop(true)` forces\n * it on for a non-morph the default wouldn't otherwise crop.\n */\n crop(enabled = true) {\n this.cropOverride.set(this.currentSubject, enabled)\n\n return this\n }\n\n /**\n * By default a subject's layer nests under its nearest DOM-ancestor layer\n * (`view-transition-group: contain`), so the ancestor's clip/transform/opacity\n * apply to it through the transition - mirroring how the DOM actually paints,\n * and letting a wrapper crop its child for the whole morph rather than only\n * once the live DOM takes back over. (Needs a browser that supports nested\n * view-transition groups; elsewhere it degrades to the flat default.)\n *\n * Call `.group(false)` to opt out: the layer stays flat and top-level, so it\n * animates independently and escapes an ancestor's clip - e.g. an element\n * that should lift out of a card and fly across, which nesting would clip.\n */\n group(enabled = true) {\n enabled\n ? this.flatGroups.delete(this.currentSubject)\n : this.flatGroups.add(this.currentSubject)\n\n return this\n }\n\n /**\n * Tag this subject's generated layers with a `view-transition-class`, so\n * they can be targeted from CSS - `::view-transition-group(.name)`,\n * `::view-transition-old/new(.name)`, `::view-transition-image-pair(.name)`\n * - without the opaque generated `view-transition-name`. Because `.add()`\n * can match many elements, a shared class targets them all at once (and,\n * for a pair, both ends). The escape hatch for z-index / custom keyframes\n * on a morph layer.\n */\n class(name: string) {\n this.classNames.set(this.currentSubject, name)\n\n return this\n }\n\n /**\n * Set the transition for this subject's morph. The morph is enabled\n * automatically by `.add()`; this just customises its timing (duration,\n * easing, a `delay`/`stagger`, …). On the implicit `root` subject it also\n * opts the page into the transition (the root crossfade).\n */\n layout(options: AnimationOptions = {}) {\n this.updateTarget(\"layout\", {}, options)\n\n return this\n }\n\n enter(keyframes: DOMKeyframesDefinition, options?: AnimationOptions) {\n this.updateTarget(\"enter\", keyframes, options)\n\n return this\n }\n\n exit(keyframes: DOMKeyframesDefinition, options?: AnimationOptions) {\n this.updateTarget(\"exit\", keyframes, options)\n\n return this\n }\n\n /**\n * Animate the new view directly, whether the element is appearing or\n * persisting (unlike `.enter()`, which only fires for a pure newcomer).\n * Pair with `.old()` for a crossfade or slide-through.\n */\n new(keyframes: DOMKeyframesDefinition, options?: AnimationOptions) {\n this.updateTarget(\"new\", keyframes, options)\n\n return this\n }\n\n /**\n * Animate the old view directly, whether the element is leaving or\n * persisting (unlike `.exit()`, which only fires for a pure leaver).\n */\n old(keyframes: DOMKeyframesDefinition, options?: AnimationOptions) {\n this.updateTarget(\"old\", keyframes, options)\n\n return this\n }\n\n updateTarget(\n target: \"enter\" | \"exit\" | \"layout\" | \"new\" | \"old\",\n keyframes: DOMKeyframesDefinition,\n options: AnimationOptions = {}\n ) {\n const { currentSubject, targets } = this\n\n if (!targets.has(currentSubject)) {\n targets.set(currentSubject, {})\n }\n\n const targetData = targets.get(currentSubject)!\n\n targetData[target] = { keyframes, options }\n }\n\n then(resolve: () => void, reject?: () => void) {\n return this.readyPromise.then(resolve, reject)\n }\n}\n\nexport function animateView(\n update: () => void | Promise,\n options: ViewTransitionOptions = {}\n) {\n return new ViewTransitionBuilder(update, options)\n}\n"],"names":[],"mappings":";;;MAea,qBAAqB,CAAA;IA0D9B,WAAA,CACI,MAAkC,EAClC,OAAA,GAAiC,EAAE,EAAA;QA3D/B,IAAA,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AS,EAAE,OAAO,CAAC;AAE5C,QAAA,OAAO,IAAI;IACf;AAEA;;;AAGG;IACH,GAAG,CAAC,SAAiC,EAAE,OAA0B,EAAA;QAC7D,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,SAAS,EAAE,OAAO,CAAC;AAE5C,QAAA,OAAO,IAAI;IACf;AAEA,IAAA,YAAY,CACR,MAAmD,EACnD,SAAiC,EACjC,UAA4B,EAAE,EAAA;AAE9B,QAAA,MAAM,EAAE,cAAc,EAAE,OAAO,EAAE,GAAG,IAAI;QAExC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,EAAE;AAC9B,YAAA,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,EAAE,CAAC;QACnC;QAEA,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,CAAE;QAE/C,UAAU,CAAC,MAAM,CAAC,GAAG,EAAE,SAAS,EAAE,OAAO,EAAE;IAC/C;IAEA,IAAI,CAAC,OAAmB,EAAE,MAAmB,EAAA;QACzC,OAAO,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC;IAClD;AACH;SAEe,WAAW,CACvB,MAAkC,EAClC,UAAiC,EAAE,EAAA;AAEnC,IAAA,OAAO,IAAI,qBAAqB,CAAC,MAAM,EAAE,OAAO,CAAC;AACrD;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/view/queue.mjs b/node_modules/motion-dom/dist/es/view/queue.mjs deleted file mode 100644 index 80439b6..0000000 --- a/node_modules/motion-dom/dist/es/view/queue.mjs +++ /dev/null @@ -1,59 +0,0 @@ -import { removeItem } from 'motion-utils'; -import { microtask } from '../frameloop/microtask.mjs'; -import { startViewAnimation } from './start.mjs'; - -let builders = []; -let current = null; -function next() { - current = null; - const [nextBuilder] = builders; - if (nextBuilder) - start(nextBuilder); -} -function start(builder) { - removeItem(builders, builder); - current = builder; - startViewAnimation(builder) - .then((animation) => { - builder.notifyReady(animation); - return animation.finished; - }) - // A genuinely failed transition (a throwing update) rejects the - // builder; a skipped/interrupted one resolves with no animations (see - // start.ts). Either way, advance the queue - else later transitions hang. - .catch((error) => builder.notifyReject(error)) - .finally(next); -} -function processQueue() { - /** - * Iterate backwards over the builders array. We can ignore the - * "wait" animations. If we have an interrupting animation in the - * queue then we need to batch all preceeding animations into it. - * Currently this only batches the update functions but will also - * need to batch the targets. - */ - for (let i = builders.length - 1; i >= 0; i--) { - const builder = builders[i]; - const { interrupt } = builder.options; - if (interrupt === "immediate") { - const batchedUpdates = builders.slice(0, i + 1).map((b) => b.update); - const remaining = builders.slice(i + 1); - builder.update = () => { - batchedUpdates.forEach((update) => update()); - }; - // Put the current builder at the front, followed by any "wait" builders - builders = [builder, ...remaining]; - break; - } - } - if (!current || builders[0]?.options.interrupt === "immediate") { - next(); - } -} -function addToQueue(builder) { - builders.push(builder); - microtask.render(processQueue); -} - -export { addToQueue }; -//# sourceMappingURL=queue.mjs.map diff --git a/node_modules/motion-dom/dist/es/view/queue.mjs.map b/node_modules/motion-dom/dist/es/view/queue.mjs.map deleted file mode 100644 index 03f5d6d..0000000 --- a/node_modules/motion-dom/dist/es/view/queue.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"queue.mjs","sources":["../../../src/view/queue.ts"],"sourcesContent":["import { removeItem } from \"motion-utils\"\nimport type { ViewTransitionBuilder } from \".\"\nimport { microtask } from \"../frameloop/microtask\"\nimport { startViewAnimation } from \"./start\"\n\nlet builders: ViewTransitionBuilder[] = []\n\nlet current: ViewTransitionBuilder | null = null\n\nfunction next() {\n current = null\n const [nextBuilder] = builders\n if (nextBuilder) start(nextBuilder)\n}\n\nfunction start(builder: ViewTransitionBuilder) {\n removeItem(builders, builder)\n current = builder\n startViewAnimation(builder)\n .then((animation) => {\n builder.notifyReady(animation)\n return animation.finished\n })\n // A genuinely failed transition (a throwing update) rejects the\n // builder; a skipped/interrupted one resolves with no animations (see\n // start.ts). Either way, advance the queue - else later transitions hang.\n .catch((error) => builder.notifyReject(error))\n .finally(next)\n}\n\nfunction processQueue() {\n /**\n * Iterate backwards over the builders array. We can ignore the\n * \"wait\" animations. If we have an interrupting animation in the\n * queue then we need to batch all preceeding animations into it.\n * Currently this only batches the update functions but will also\n * need to batch the targets.\n */\n for (let i = builders.length - 1; i >= 0; i--) {\n const builder = builders[i]\n const { interrupt } = builder.options\n\n if (interrupt === \"immediate\") {\n const batchedUpdates = builders.slice(0, i + 1).map((b) => b.update)\n const remaining = builders.slice(i + 1)\n\n builder.update = () => {\n batchedUpdates.forEach((update) => update())\n }\n\n // Put the current builder at the front, followed by any \"wait\" builders\n builders = [builder, ...remaining]\n\n break\n }\n }\n\n if (!current || builders[0]?.options.interrupt === \"immediate\") {\n next()\n }\n}\n\nexport function addToQueue(builder: ViewTransitionBuilder) {\n builders.push(builder)\n microtask.render(processQueue)\n}\n"],"names":[],"mappings":";;;;AAKA,IAAI,QAAQ,GAA4B,EAAE;AAE1C,IAAI,OAAO,GAAiC,IAAI;AAEhD,SAAS,IAAI,GAAA;IACT,OAAO,GAAG,IAAI;AACd,IAAA,MAAM,CAAC,WAAW,CAAC,GAAG,QAAQ;AAC9B,IAAA,IAAI,WAAW;QAAE,KAAK,CAAC,WAAW,CAAC;AACvC;AAEA,SAAS,KAAK,CAAC,OAA8B,EAAA;AACzC,IAAA,UAAU,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC7B,OAAO,GAAG,OAAO;IACjB,kBAAkB,CAAC,OAAO;AACrB,SAAA,IAAI,CAAC,CAAC,SAAS,KAAI;AAChB,QAAA,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC;QAC9B,OAAO,SAAS,CAAC,QAAQ;AAC7B,IAAA,CAAC;;;;AAIA,SAAA,KAAK,CAAC,CAAC,KAAK,KAAK,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC;SAC5C,OAAO,CAAC,IAAI,CAAC;AACtB;AAEA,SAAS,YAAY,GAAA;AACjB;;;;;;AAMG;AACH,IAAA,KAAK,IAAI,CAAC,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE;AAC3C,QAAA,MAAM,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC;AAC3B,QAAA,MAAM,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,OAAO;AAErC,QAAA,IAAI,SAAS,KAAK,WAAW,EAAE;YAC3B,MAAM,cAAc,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC;YACpE,MAAM,SAAS,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC;AAEvC,YAAA,OAAO,CAAC,MAAM,GAAG,MAAK;gBAClB,cAAc,CAAC,OAAO,CAAC,CAAC,MAAM,KAAK,MAAM,EAAE,CAAC;AAChD,YAAA,CAAC;;AAGD,YAAA,QAAQ,GAAG,CAAC,OAAO,EAAE,GAAG,SAAS,CAAC;YAElC;QACJ;IACJ;AAEA,IAAA,IAAI,CAAC,OAAO,IAAI,QAAQ,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,SAAS,KAAK,WAAW,EAAE;AAC5D,QAAA,IAAI,EAAE;IACV;AACJ;AAEM,SAAU,UAAU,CAAC,OAA8B,EAAA;AACrD,IAAA,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC;AACtB,IAAA,SAAS,CAAC,MAAM,CAAC,YAAY,CAAC;AAClC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/view/start.mjs b/node_modules/motion-dom/dist/es/view/start.mjs deleted file mode 100644 index 869be6c..0000000 --- a/node_modules/motion-dom/dist/es/view/start.mjs +++ /dev/null @@ -1,700 +0,0 @@ -import { warnOnce, secondsToMilliseconds } from 'motion-utils'; -import { GroupAnimation } from '../animation/GroupAnimation.mjs'; -import { NativeAnimation } from '../animation/NativeAnimation.mjs'; -import { NativeAnimationWrapper } from '../animation/NativeAnimationWrapper.mjs'; -import { getValueTransition } from '../animation/utils/get-value-transition.mjs'; -import { mapEasingToNativeEasing } from '../animation/waapi/easing/map-easing.mjs'; -import { applyGeneratorOptions } from '../animation/waapi/utils/apply-generator.mjs'; -import { cornerRadiusProps } from '../utils/border-radius.mjs'; -import { resolveElements } from '../utils/resolve-elements.mjs'; -import { assignViewTransitionNames, releaseViewTransitionNames } from './utils/assign-names.mjs'; -import { chooseLayerType } from './utils/choose-layer-type.mjs'; -import { css } from './utils/css.mjs'; -import { getViewAnimationLayerInfo } from './utils/get-layer-info.mjs'; -import { getViewAnimations } from './utils/get-view-animations.mjs'; -import { hasTarget } from './utils/has-target.mjs'; - -const definitionNames = ["layout", "enter", "exit", "new", "old"]; -/** - * Whether a computed border-radius is square (every component zero). Splitting - * on whitespace handles two-value/elliptical radii like "0px 20px" - a leading - * `parseFloat` alone would misread the non-zero vertical radius as square. - */ -const isSquareRadius = (radius) => radius.split(" ").every((value) => parseFloat(value) === 0); -/** - * The `ViewTransitionTarget` buckets driving each generated layer type, in - * priority order - the inverse of `chooseLayerType`. The new view is driven by - * `new`/`enter`, the old by `old`/`exit`. `group-children`/`image-pair` have no - * bucket; they follow the default layout timing. - */ -const typeBuckets = { - group: ["layout"], - new: ["new", "enter"], - old: ["old", "exit"], -}; -/** - * Default "absent" origin for a single-value keyframe, by pseudo type, so e.g. - * `enter({ scale: 1 })` grows in from 0.85 and `exit({ opacity: 0 })` fades - * from 1. `enter` prefers the matching `exit` value over these (see below). - */ -const ORIGIN_DEFAULTS = { - new: { opacity: 0, scale: 0.85 }, - old: { opacity: 1, scale: 1 }, -}; -/** - * How much two box aspect ratios must differ before a morph is treated as - * aspect-changing (and so worth cropping). Matches the projection engine's - * `preserve-aspect` threshold, so small layout jitter doesn't trigger a crop. - */ -const ASPECT_TOLERANCE = 0.2; -function startViewAnimation(builder) { - const { update, targets, resolveDefs, cropOverride, pairs, classNames, flatGroups, options: defaultOptions, } = builder; - if (!document.startViewTransition) { - // An async IIFE (not `new Promise(async …)`) so a throwing/rejecting - // update rejects this promise rather than leaving it unsettled. - return (async () => { - await update(); - return new GroupAnimation([]); - })(); - } - /** - * Resolve any selector/Element targets to layer names, assigning a - * `view-transition-name` to each element as we go. We run this before the - * update (so the elements are captured in the old snapshot) and again - * after it (for the new snapshot). An element present in both keeps the - * same name and animates as a single `group` layer. - */ - const nameRegistry = new Map(); - const assigned = []; - /** - * Elements we tagged with a `view-transition-class` (via `.class()`), - * tracked separately from `assigned` so cleanup removes the class without - * ever stripping an author's own inline `view-transition-name`. - */ - const classed = []; - /** - * Elements we set a `view-transition-group` on (for nesting), tracked for - * cleanup. `clipChildren` collects the names of nested parents that clip in - * the live layout, so their `::view-transition-group-children` is clipped - * through the transition - not just once the live DOM takes back over. - */ - const grouped = []; - const clipChildren = new Set(); - const layerTargets = new Map(); - const croppedNames = new Set(); - /** - * Each layer's explicit `.crop(true | false)` override (by resolved name), - * so `finalizeCrop` can let an author's choice win over the morph default. - */ - const cropForName = new Map(); - /** - * Each layer's stagger position (index + total) within its subject, per - * snapshot. Resolving against the snapshot the layer belongs to keeps - * stagger correct when `update()` replaces the matched elements, and lets - * us skip a layer that's absent from a snapshot (e.g. an exited element - * has no `new` pseudo-element). - */ - const layerStagger = new Map(); - /** - * Names allocated for a paired subject in the old snapshot, replayed onto - * its new-snapshot target so both ends share a layer and morph. - */ - const pairNames = new Map(); - /** - * The old (`from`) elements of each paired subject, so their names can be - * transferred off before the new (`to`) elements inherit them. - */ - const pairFrom = new Map(); - const resolveLayers = (phase) => { - targets.forEach((target, definition) => { - const className = classNames.get(definition); - /** - * Nest each resolved layer under its DOM-ancestor layer by default - * (`contain`), so an ancestor's clip/transform/opacity reach it - * through the transition; `.group(false)` opts a subject out (`none`) - * to stay flat and escape. Skipped for root / pre-named layers, which - * aren't elements we resolve and style. - */ - const group = definition === "root" || !resolveDefs.has(definition) - ? undefined - : flatGroups.has(definition) - ? "none" - : "contain"; - let names; - if (definition === "root" || !resolveDefs.has(definition)) { - names = [definition]; - } - else if (pairs.has(definition)) { - /** - * Paired morph: name the old target in the old snapshot, then - * force the same name(s) onto the new target in the new one, so - * two different elements morph as a single layer. - */ - if (phase === "old") { - pairFrom.set(definition, resolveElements(definition)); - names = assignViewTransitionNames(definition, nameRegistry, assigned, undefined, className, classed, group, grouped, clipChildren); - pairNames.set(definition, names); - } - else { - /** - * Transfer the name(s) off the `from` elements before the - * `to` elements inherit them. A `from` that survives into - * the new snapshot (e.g. hidden with `visibility: hidden` - * rather than removed) would otherwise keep the name and - * collide - "duplicate view-transition-name". - */ - for (const el of pairFrom.get(definition) ?? []) { - el.style?.removeProperty("view-transition-name"); - /** - * Drop the old end from the registry too, so the new - * end alone supplies this name's `new` crop radii - we - * neither re-measure nor get ordered by a stale element. - */ - nameRegistry.delete(el); - } - names = assignViewTransitionNames(pairs.get(definition), nameRegistry, assigned, pairNames.get(definition), className, classed, group, grouped, clipChildren); - } - } - else { - names = assignViewTransitionNames(definition, nameRegistry, assigned, undefined, className, classed, group, grouped, clipChildren); - } - // Record any explicit `.crop(true | false)` per resolved name; the - // crop set itself is computed later by `finalizeCrop` (it needs both - // snapshots to know which morphs change aspect ratio). - const override = cropOverride.get(definition); - names.forEach((name, index) => { - /** - * If two subjects resolve to the same element, merge their - * definitions so neither subject's animations are dropped. - */ - const existing = layerTargets.get(name); - layerTargets.set(name, existing && existing !== target - ? { ...existing, ...target } - : target); - if (override !== undefined) - cropForName.set(name, override); - const stagger = layerStagger.get(name) ?? {}; - stagger[phase] = [index, names.length]; - layerStagger.set(name, stagger); - }); - }); - }; - /** - * The stagger index/total for a layer, resolved against the snapshot it - * belongs to. Returns index -1 when the layer is absent from that snapshot - * so the caller can skip a pseudo-element that doesn't exist. - */ - const staggerPosition = (name, type) => { - const stagger = layerStagger.get(name); - const position = type === "old" - ? stagger?.old - : type === "new" - ? stagger?.new - : // group / group-children / image-pair persist across both. - stagger?.new ?? stagger?.old; - return position ?? [-1, 1]; - }; - /** - * Merge default + per-layer transition options for a generated layer and - * resolve any stagger/delay function against this element's position. Used - * by both the morph-retiming and crop corner-radius passes. - */ - const resolveLayerTransition = (target, type, transitionName, index, total) => { - const transition = mergeTransition(getValueTransition(defaultOptions, transitionName), getValueTransition((layerOptions(target, type) ?? {}), transitionName)); - if (typeof transition.delay === "function") { - transition.delay = transition.delay(index, total); - } - return transition; - }; - /** - * Resolve a layer's group (`layout`) timing to plain WAAPI values: native - * ms `delay`/`duration` and a baked `ease`. The single source of group - * timing, shared by the generated-group retiming and the crop corner-radius - * pass so the rounded clip animates on exactly the box's timing. It returns - * no generator `type` (the WAAPI-only `NativeAnimation` rejects a string - * type) nor `repeat`/`times` (which the group's `updateTiming` ignores), so - * none of them can leak into the radius animation and desync it. - */ - const resolveGroupTiming = (name) => { - const [index, total] = staggerPosition(name, "group"); - const transition = resolveLayerTransition(layerTargets.get(name), "group", "layout", index === -1 ? 0 : index, total); - transition.duration && (transition.duration = secondsToMilliseconds(transition.duration)); - const { delay = 0, duration, ease } = applyGeneratorOptions(transition); - return { delay: secondsToMilliseconds(delay), duration, ease }; - }; - /** - * Each layer's measured box + corner radii per snapshot. The box lets - * `finalizeCrop` tell whether a morph's aspect ratio changed (the only case - * worth cropping); the radii let a cropped morph's group clip animate each - * corner from the old element's radius to the new element's, keeping it - * rounded where `overflow: clip` would otherwise square the corners. - * - * We never flatten the source for capture (a snapshot is a paint of the live - * DOM, so squaring an element just for its capture would flash one real - * square frame). For an aspect-changing morph `object-fit: cover` crops each - * snapshot's own baked corners off-screen mid-morph, so the animated clip is - * the only visible corner; a near-same-aspect forced crop (`.crop(true)`) - * can't hide the outgoing snapshot's silhouette, but the endpoints coincide. - */ - const cropMeasurements = new Map(); - const measureLayers = (phase) => nameRegistry.forEach((name, element) => { - const el = element; - const rect = el.getBoundingClientRect?.(); - if (rect && rect.height) { - const style = getComputedStyle(el); - const radii = {}; - for (const corner of cornerRadiusProps) { - radii[corner] = style[corner]; - } - const entry = cropMeasurements.get(name) ?? {}; - entry[phase] = { width: rect.width, height: rect.height, radii }; - cropMeasurements.set(name, entry); - } - }); - /** - * With both snapshots measured, settle which layers crop. The default crops - * only a morph whose aspect ratio *changes* between snapshots - the one case - * where `object-fit: cover` does real work. A same-aspect morph or a - * fade-only layer is left uncropped: its corners scale naturally (no flash - * from squaring, no `overflow: clip` eating its shadow) and a backdrop can't - * be clipped to nothing. An explicit `.crop(true | false)` overrides either - * way. Runs after both snapshots are measured, since aspect needs both. - */ - const finalizeCrop = () => { - croppedNames.clear(); - for (const name of layerStagger.keys()) { - if (name === "root") - continue; - // An explicit `.crop(true | false)` wins; otherwise crop a morph - // whose aspect ratio changed. - if (cropForName.get(name) ?? aspectChanged(name)) { - croppedNames.add(name); - } - } - }; - /** - * Whether a layer is a morph whose box aspect ratio changed between - * snapshots (beyond a small tolerance). Fade-only layers (one snapshot) are - * never "changed". - */ - const aspectChanged = (name) => { - const box = cropMeasurements.get(name); - if (!box?.old || !box?.new || !box.old.height || !box.new.height) { - return false; - } - return (Math.abs(box.old.width / box.old.height - - box.new.width / box.new.height) > ASPECT_TOLERANCE); - }; - /** - * Write the persistent view-transition CSS: suppress root capture when the - * root has no animations of its own; force linear timing (baked into the - * keyframes, so we can retime later via updateTiming); and clip + - * object-fit: cover every cropped morph (the UA default overflows on - * aspect-ratio change). - * - * `css.commit` replaces rather than appends, so we re-set the full rule set - * each call - the crop rules are only known after `finalizeCrop` runs in the - * update callback, so the second call writes them. - */ - const commitViewCSS = () => { - if (!hasTarget("root", targets)) { - css.set(":root", { "view-transition-name": "none" }); - } - css.set("::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)", { "animation-timing-function": "linear !important" }); - croppedNames.forEach((name) => { - css.set(`::view-transition-group(${name})`, { overflow: "clip" }); - css.set(`::view-transition-old(${name}), ::view-transition-new(${name})`, { width: "100%", height: "100%", "object-fit": "cover" }); - }); - /** - * Clip the nested children of any layer that clips in the live layout, - * so a wrapper crops its child for the whole morph (mirroring the DOM) - * rather than only at the live-DOM handoff. No-op on browsers without - * nested view-transition groups. - */ - clipChildren.forEach((name) => { - css.set(`::view-transition-group-children(${name})`, { - overflow: "clip", - }); - }); - css.commit(); // Write - }; - const cleanup = () => { - releaseViewTransitionNames(assigned, classed, grouped); - css.remove(); // Write - }; - const callback = async () => { - await update(); - /** - * Re-resolve so elements created by the update are named for the new - * snapshot, then measure them. With both snapshots measured we can - * settle the crop set (aspect-changing morphs + forced). - */ - resolveLayers("new"); - measureLayers("new"); - finalizeCrop(); - /** - * Re-commit the crop CSS unconditionally: `finalizeCrop` is computed - * here (after both snapshots are measured), so the clip rules must be - * (re)written to match the settled set. - */ - commitViewCSS(); - }; - let transition; - try { - resolveLayers("old"); - /** - * Measure the old snapshot against the optimistic crop set (the new - * snapshot doesn't exist yet, so aspect change can't be known here; - * `finalizeCrop` settles it post-update). - */ - measureLayers("old"); - commitViewCSS(); - transition = document.startViewTransition(callback); - } - catch (error) { - /** - * The prelude writes inline names before the transition exists. If it - * throws (e.g. startViewTransition rejects in a bad UA state), release - * them so we neither leak DOM state nor stall the queue on a promise - * that never settles - hand back a rejection it can advance past. - */ - cleanup(); - return Promise.reject(error); - } - transition.finished.finally(cleanup); - return new Promise((resolve, reject) => { - transition.ready - .then(() => { - const generatedViewAnimations = getViewAnimations(); - const animations = []; - /** - * Create animations for each of our explicitly-defined subjects. - * `opacityAnimated` additionally tracks which `${name}:${type}` - * we faded, so we can keep the UA `plus-lighter` blend only for a - * genuine opacity crossfade (both sides fading) and drop it for a - * slide/transform, where additive compositing would flash bright. - */ - const explicitlyAnimated = new Set(); - const opacityAnimated = new Set(); - layerTargets.forEach((target, name) => { - const stagger = layerStagger.get(name); - /** - * Presence: `enter` only fires for a pure newcomer (a new - * view with no old), `exit` only for a pure leaver. A - * survivor (both) gets neither - it just morphs. - */ - const enterApplies = !!stagger?.new && !stagger?.old; - const exitApplies = !!stagger?.old && !stagger?.new; - for (const key of definitionNames) { - if (!target[key]) - continue; - if (key === "enter" && !enterApplies) - continue; - if (key === "exit" && !exitApplies) - continue; - const type = chooseLayerType(key); - const [index, total] = staggerPosition(name, type); - // Skip a layer absent from its snapshot. - if (index === -1) - continue; - const { keyframes, options } = target[key]; - for (let [valueName, valueKeyframes] of Object.entries(keyframes)) { - // Skip only missing values - `0` (e.g. opacity: 0) - // is valid and must reach the from-value inference. - if (valueKeyframes == null) - continue; - /** - * The view path hands keyframes straight to WAAPI, - * so Motion's `x`/`y` shorthands (compiled to - * `transform` only via the value pipeline) have no - * effect. Warn and skip - use `transform`/`translate`. - */ - if (valueName === "x" || valueName === "y") { - warnOnce(false, `animateView() animates view-transition layers with CSS properties; the "${valueName}" shorthand has no effect - use transform, e.g. { transform: "translateX(40px)" }.`); - continue; - } - /** - * enter/exit win over new/old on a shared property - - * skip it here when the gated bucket also defines it. - */ - if (key === "new" && - enterApplies && - target.enter?.keyframes[valueName] != null) { - continue; - } - if (key === "old" && - exitApplies && - target.exit?.keyframes[valueName] != null) { - continue; - } - const valueOptions = mergeTransition(getValueTransition(defaultOptions, valueName), getValueTransition(options, valueName)); - /** - * Infer an origin for a single-value keyframe. An - * `enter` mirrors the matching `exit` value (a - * defined exit reverses into the enter for free); - * otherwise the per-type default (opacity 0/1, scale - * 0.85). No default -> left as-is (animates from the - * live value). - * - * `new`/`old` fire for survivors too, where only the - * opacity crossfade default applies - a transform - * default like scale 0.85 would pop a persisting - * element, so gate it on the layer actually - * entering/leaving. - */ - if (!Array.isArray(valueKeyframes)) { - const exitValue = key === "enter" - ? target.exit?.keyframes[valueName] - : undefined; - const allowDefault = valueName === "opacity" || - (type === "new" ? enterApplies : exitApplies); - const from = exitValue != null - ? Array.isArray(exitValue) - ? exitValue[exitValue.length - 1] - : exitValue - : allowDefault - ? ORIGIN_DEFAULTS[type]?.[valueName] - : undefined; - if (from !== undefined) { - valueKeyframes = [from, valueKeyframes]; - } - } - /** - * Resolve stagger function if provided, per element - * across this subject's resolved layers. - */ - if (typeof valueOptions.delay === "function") { - valueOptions.delay = valueOptions.delay(index, total); - } - valueOptions.duration && (valueOptions.duration = secondsToMilliseconds(valueOptions.duration)); - valueOptions.delay && (valueOptions.delay = secondsToMilliseconds(valueOptions.delay)); - animations.push(new NativeAnimation({ - ...valueOptions, - element: document.documentElement, - name: valueName, - pseudoElement: `::view-transition-${type}(${name})`, - keyframes: valueKeyframes, - })); - explicitlyAnimated.add(`${name}:${type}`); - if (valueName === "opacity") { - opacityAnimated.add(`${name}:${type}`); - } - } - } - }); - /** - * Handle browser generated animations - */ - for (const animation of generatedViewAnimations) { - if (animation.playState === "finished") - continue; - const { effect } = animation; - if (!effect || !(effect instanceof KeyframeEffect)) - continue; - const { pseudoElement } = effect; - if (!pseudoElement) - continue; - const name = getViewAnimationLayerInfo(pseudoElement); - if (!name) - continue; - const targetDefinition = layerTargets.get(name.layer); - /** - * We built our own animation for this layer, so drop the - * browser-generated fade we're replacing. The UA - * `plus-lighter` blend is a *separate* generated animation on - * the same pseudo (it sets `mix-blend-mode` in its keyframes): - * keep it *only* for a true opacity crossfade - both sides - * fading - so a symmetric crossfade composites without - * darkening, but a slide/transform (where both layers stay - * opaque and overlap) doesn't flash bright from the addition. - */ - if (explicitlyAnimated.has(`${name.layer}:${name.type}`)) { - const isCrossfade = opacityAnimated.has(`${name.layer}:new`) && - opacityAnimated.has(`${name.layer}:old`); - if (isCrossfade && - effect - .getKeyframes() - .some((keyframe) => keyframe.mixBlendMode)) { - animations.push(new NativeAnimationWrapper(animation)); - } - else { - animation.cancel(); - } - continue; - } - /** - * Drop the orphaned half of the default crossfade. The UA - * fades old out and new in as a *pair*; if the opposing half - * was explicitly overridden with something other than an - * opacity fade (a clip or transform reveal), this side's - * default opacity fade has no partner - left to run it would - * dissolve what should be a static backdrop (e.g. - * `.new({ clipPath })` should reveal over a still old view, - * not fade the old out around the growing clip). Cancel it - - * and its `plus-lighter` sibling on the same pseudo, which - * would otherwise flash bright where the two opaque layers - * overlap. A genuine crossfade (the opposing side also fading - * opacity) keeps both halves and is handled above. - */ - const opposite = name.type === "old" - ? "new" - : name.type === "new" - ? "old" - : undefined; - if (opposite && - explicitlyAnimated.has(`${name.layer}:${opposite}`) && - !opacityAnimated.has(`${name.layer}:${opposite}`)) { - animation.cancel(); - continue; - } - /** - * Otherwise retime the browser-generated animation to - * Motion's timing. This auto-enables the layout (group) - * morph for any resolved/named target, and applies the - * default timing to old/new layers we haven't explicitly - * overridden. - * - * group + group-children both follow the layout timing so - * the nesting container stays in sync with the morph. - */ - /** - * A survivor's old + new are the two halves of one - * `plus-lighter` crossfade. They must share identical timing - * (so their opacities stay mirrored and sum to 1 - else the - * additive blend flashes bright wherever both are partly - * visible) and fade linearly (the bounce belongs on the - * group's geometry, not the opacity). So time them as the - * group, rather than via their own - potentially staggered, - * or enter/exit-derived - old/new options. - */ - const stagger = layerStagger.get(name.layer); - const isMorphCrossfade = (name.type === "old" || name.type === "new") && - !!stagger?.old && - !!stagger?.new; - let timing; - if (name.type.startsWith("group")) { - // group + group-children follow the resolved group - // timing - the single source shared with the crop - // corner-radius pass below. - const { delay, duration, ease } = resolveGroupTiming(name.layer); - timing = { - delay, - duration, - easing: mapEasingToNativeEasing(ease, duration), - }; - } - else { - const timingType = isMorphCrossfade ? "group" : name.type; - const [index, total] = staggerPosition(name.layer, timingType); - const transitionName = timingType === "group" ? "layout" : ""; - let animationTransition = resolveLayerTransition(targetDefinition, timingType, transitionName, index === -1 ? 0 : index, total); - /** - * The crossfade should resolve at the spring's - * *perceptual* (visual) duration - the geometry can keep - * bouncing, but the opacity shouldn't drag through the - * settle. So capture `visualDuration` before - * `applyGeneratorOptions` replaces it with the full - * overshoot duration, and use it for the fade. - */ - const visualDuration = animationTransition.visualDuration; - animationTransition.duration && (animationTransition.duration = secondsToMilliseconds(animationTransition.duration)); - animationTransition = - applyGeneratorOptions(animationTransition); - timing = { - delay: secondsToMilliseconds(animationTransition.delay ?? 0), - duration: isMorphCrossfade && visualDuration !== undefined - ? secondsToMilliseconds(visualDuration) - : animationTransition.duration, - easing: isMorphCrossfade - ? "linear" - : mapEasingToNativeEasing(animationTransition.ease, animationTransition.duration), - }; - } - effect.updateTiming(timing); - animations.push(new NativeAnimationWrapper(animation)); - } - /** - * Round each cropped layer's clip. Its `::view-transition-group` - * has `overflow: clip`, which would otherwise square the corners - * mid-morph; animate each corner from the old element's radius to - * the new element's so the crop stays rounded. Timed as the group - * (`layout`) so the radius tracks the morphing box. - */ - cropMeasurements.forEach((entry, name) => { - if (!croppedNames.has(name)) - return; - // Reuse the group's resolved timing - native ms delay/ - // duration + a baked ease, with no generator `type` or - // repeat/times to leak into (or throw inside) NativeAnimation. - const { delay, duration, ease } = resolveGroupTiming(name); - for (const corner of cornerRadiusProps) { - // `||` (not `??`) so an empty measurement falls back to - // the other snapshot rather than an invalid keyframe. - const from = entry.old?.radii[corner] || - entry.new?.radii[corner] || - "0px"; - const to = entry.new?.radii[corner] || - entry.old?.radii[corner] || - "0px"; - // Nothing to round if the corner is square at both ends. - if (isSquareRadius(from) && isSquareRadius(to)) - continue; - animations.push(new NativeAnimation({ - element: document.documentElement, - name: corner, - pseudoElement: `::view-transition-group(${name})`, - keyframes: [from, to], - delay, - duration, - ease, - })); - } - }); - resolve(new GroupAnimation(animations)); - }) - .catch(() => - /** - * `ready` rejects when the transition is skipped - no visual - * change, or superseded by an interrupting transition. The DOM - * update still applied, so settle with no animations rather than - * surfacing it as an error to an awaiting caller. A genuine - * failure in `update()` rejects `updateCallbackDone` (already - * settled by now), so propagate that instead. - */ - transition.updateCallbackDone.then(() => resolve(new GroupAnimation([])), reject)); - }); -} -/** - * The options that should time a given generated layer type, so a retimed - * group/old/new picks up any per-target transition the user provided. Checks - * the type's buckets in priority order (e.g. `new` before `enter`). - */ -function layerOptions(target, type) { - for (const bucket of typeBuckets[type] ?? []) { - const options = target?.[bucket]?.options; - if (options) - return options; - } -} -/** - * Merge a base transition (e.g. the default `options`) with a per-layer/value - * override. An explicit `duration` on the override must win over an inherited - * generator's own timing: a spring prefers `visualDuration`, and - * `spring.applyToOptions` overwrites `duration` with the computed settle time - - * so without this the override is silently discarded. Dropping the inherited - * `type`/`visualDuration` makes the layer a plain tween of that duration, unless - * it asked for its own generator `type`/`visualDuration`. - */ -function mergeTransition(base, override) { - const merged = { ...base, ...override }; - if (override.duration !== undefined) { - if (override.visualDuration === undefined) - delete merged.visualDuration; - if (override.type === undefined) - delete merged.type; - } - return merged; -} - -export { startViewAnimation }; -//# sourceMappingURL=start.mjs.map diff --git a/node_modules/motion-dom/dist/es/view/start.mjs.map b/node_modules/motion-dom/dist/es/view/start.mjs.map deleted file mode 100644 index 9e58043..0000000 --- a/node_modules/motion-dom/dist/es/view/start.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"start.mjs","sources":["../../../src/view/start.ts"],"sourcesContent":["import { secondsToMilliseconds, warnOnce } from \"motion-utils\"\nimport { GroupAnimation } from \"../animation/GroupAnimation\"\nimport { NativeAnimation } from \"../animation/NativeAnimation\"\nimport { NativeAnimationWrapper } from \"../animation/NativeAnimationWrapper\"\nimport { AnimationPlaybackControls, DOMKeyframesDefinition } from \"../animation/types\"\nimport { getValueTransition } from \"../animation/utils/get-value-transition\"\nimport { mapEasingToNativeEasing } from \"../animation/waapi/easing/map-easing\"\nimport { applyGeneratorOptions } from \"../animation/waapi/utils/apply-generator\"\nimport { cornerRadiusProps } from \"../utils/border-radius\"\nimport { ElementOrSelector, resolveElements } from \"../utils/resolve-elements\"\nimport type { ViewTransitionBuilder } from \"./index\"\nimport { ViewTransitionTarget, ViewTransitionTargetDefinition } from \"./types\"\nimport {\n assignViewTransitionNames,\n releaseViewTransitionNames,\n} from \"./utils/assign-names\"\nimport { chooseLayerType } from \"./utils/choose-layer-type\"\nimport { css } from \"./utils/css\"\nimport { getViewAnimationLayerInfo } from \"./utils/get-layer-info\"\nimport { getViewAnimations } from \"./utils/get-view-animations\"\nimport { hasTarget } from \"./utils/has-target\"\n\nconst definitionNames = [\"layout\", \"enter\", \"exit\", \"new\", \"old\"] as const\n\ntype CornerRadii = Record<(typeof cornerRadiusProps)[number], string>\n\n/**\n * Whether a computed border-radius is square (every component zero). Splitting\n * on whitespace handles two-value/elliptical radii like \"0px 20px\" - a leading\n * `parseFloat` alone would misread the non-zero vertical radius as square.\n */\nconst isSquareRadius = (radius: string) =>\n radius.split(\" \").every((value) => parseFloat(value) === 0)\n\n/**\n * The `ViewTransitionTarget` buckets driving each generated layer type, in\n * priority order - the inverse of `chooseLayerType`. The new view is driven by\n * `new`/`enter`, the old by `old`/`exit`. `group-children`/`image-pair` have no\n * bucket; they follow the default layout timing.\n */\nconst typeBuckets: Record = {\n group: [\"layout\"],\n new: [\"new\", \"enter\"],\n old: [\"old\", \"exit\"],\n}\n\n/**\n * Default \"absent\" origin for a single-value keyframe, by pseudo type, so e.g.\n * `enter({ scale: 1 })` grows in from 0.85 and `exit({ opacity: 0 })` fades\n * from 1. `enter` prefers the matching `exit` value over these (see below).\n */\nconst ORIGIN_DEFAULTS: Record> = {\n new: { opacity: 0, scale: 0.85 },\n old: { opacity: 1, scale: 1 },\n}\n\n/**\n * How much two box aspect ratios must differ before a morph is treated as\n * aspect-changing (and so worth cropping). Matches the projection engine's\n * `preserve-aspect` threshold, so small layout jitter doesn't trigger a crop.\n */\nconst ASPECT_TOLERANCE = 0.2\n\nexport function startViewAnimation(\n builder: ViewTransitionBuilder\n): Promise {\n const {\n update,\n targets,\n resolveDefs,\n cropOverride,\n pairs,\n classNames,\n flatGroups,\n options: defaultOptions,\n } = builder\n\n if (!document.startViewTransition) {\n // An async IIFE (not `new Promise(async …)`) so a throwing/rejecting\n // update rejects this promise rather than leaving it unsettled.\n return (async () => {\n await update()\n return new GroupAnimation([])\n })()\n }\n\n /**\n * Resolve any selector/Element targets to layer names, assigning a\n * `view-transition-name` to each element as we go. We run this before the\n * update (so the elements are captured in the old snapshot) and again\n * after it (for the new snapshot). An element present in both keeps the\n * same name and animates as a single `group` layer.\n */\n const nameRegistry = new Map()\n const assigned: Element[] = []\n /**\n * Elements we tagged with a `view-transition-class` (via `.class()`),\n * tracked separately from `assigned` so cleanup removes the class without\n * ever stripping an author's own inline `view-transition-name`.\n */\n const classed: Element[] = []\n /**\n * Elements we set a `view-transition-group` on (for nesting), tracked for\n * cleanup. `clipChildren` collects the names of nested parents that clip in\n * the live layout, so their `::view-transition-group-children` is clipped\n * through the transition - not just once the live DOM takes back over.\n */\n const grouped: Element[] = []\n const clipChildren = new Set()\n const layerTargets = new Map()\n const croppedNames = new Set()\n /**\n * Each layer's explicit `.crop(true | false)` override (by resolved name),\n * so `finalizeCrop` can let an author's choice win over the morph default.\n */\n const cropForName = new Map()\n /**\n * Each layer's stagger position (index + total) within its subject, per\n * snapshot. Resolving against the snapshot the layer belongs to keeps\n * stagger correct when `update()` replaces the matched elements, and lets\n * us skip a layer that's absent from a snapshot (e.g. an exited element\n * has no `new` pseudo-element).\n */\n const layerStagger = new Map<\n string,\n { old?: [number, number]; new?: [number, number] }\n >()\n /**\n * Names allocated for a paired subject in the old snapshot, replayed onto\n * its new-snapshot target so both ends share a layer and morph.\n */\n const pairNames = new Map()\n /**\n * The old (`from`) elements of each paired subject, so their names can be\n * transferred off before the new (`to`) elements inherit them.\n */\n const pairFrom = new Map()\n\n const resolveLayers = (phase: \"old\" | \"new\") => {\n targets.forEach((target, definition) => {\n const className = classNames.get(definition)\n /**\n * Nest each resolved layer under its DOM-ancestor layer by default\n * (`contain`), so an ancestor's clip/transform/opacity reach it\n * through the transition; `.group(false)` opts a subject out (`none`)\n * to stay flat and escape. Skipped for root / pre-named layers, which\n * aren't elements we resolve and style.\n */\n const group =\n definition === \"root\" || !resolveDefs.has(definition)\n ? undefined\n : flatGroups.has(definition)\n ? \"none\"\n : \"contain\"\n let names: string[]\n if (definition === \"root\" || !resolveDefs.has(definition)) {\n names = [definition as string]\n } else if (pairs.has(definition)) {\n /**\n * Paired morph: name the old target in the old snapshot, then\n * force the same name(s) onto the new target in the new one, so\n * two different elements morph as a single layer.\n */\n if (phase === \"old\") {\n pairFrom.set(\n definition,\n resolveElements(definition as ElementOrSelector)\n )\n names = assignViewTransitionNames(\n definition as ElementOrSelector,\n nameRegistry,\n assigned,\n undefined,\n className,\n classed,\n group,\n grouped,\n clipChildren\n )\n pairNames.set(definition, names)\n } else {\n /**\n * Transfer the name(s) off the `from` elements before the\n * `to` elements inherit them. A `from` that survives into\n * the new snapshot (e.g. hidden with `visibility: hidden`\n * rather than removed) would otherwise keep the name and\n * collide - \"duplicate view-transition-name\".\n */\n for (const el of pairFrom.get(definition) ?? []) {\n ;(el as HTMLElement).style?.removeProperty(\n \"view-transition-name\"\n )\n /**\n * Drop the old end from the registry too, so the new\n * end alone supplies this name's `new` crop radii - we\n * neither re-measure nor get ordered by a stale element.\n */\n nameRegistry.delete(el)\n }\n names = assignViewTransitionNames(\n pairs.get(definition) as ElementOrSelector,\n nameRegistry,\n assigned,\n pairNames.get(definition),\n className,\n classed,\n group,\n grouped,\n clipChildren\n )\n }\n } else {\n names = assignViewTransitionNames(\n definition as ElementOrSelector,\n nameRegistry,\n assigned,\n undefined,\n className,\n classed,\n group,\n grouped,\n clipChildren\n )\n }\n\n // Record any explicit `.crop(true | false)` per resolved name; the\n // crop set itself is computed later by `finalizeCrop` (it needs both\n // snapshots to know which morphs change aspect ratio).\n const override = cropOverride.get(definition)\n\n names.forEach((name, index) => {\n /**\n * If two subjects resolve to the same element, merge their\n * definitions so neither subject's animations are dropped.\n */\n const existing = layerTargets.get(name)\n layerTargets.set(\n name,\n existing && existing !== target\n ? { ...existing, ...target }\n : target\n )\n\n if (override !== undefined) cropForName.set(name, override)\n\n const stagger = layerStagger.get(name) ?? {}\n stagger[phase] = [index, names.length]\n layerStagger.set(name, stagger)\n })\n })\n }\n\n /**\n * The stagger index/total for a layer, resolved against the snapshot it\n * belongs to. Returns index -1 when the layer is absent from that snapshot\n * so the caller can skip a pseudo-element that doesn't exist.\n */\n const staggerPosition = (name: string, type: string) => {\n const stagger = layerStagger.get(name)\n const position =\n type === \"old\"\n ? stagger?.old\n : type === \"new\"\n ? stagger?.new\n : // group / group-children / image-pair persist across both.\n stagger?.new ?? stagger?.old\n return position ?? ([-1, 1] as const)\n }\n\n /**\n * Merge default + per-layer transition options for a generated layer and\n * resolve any stagger/delay function against this element's position. Used\n * by both the morph-retiming and crop corner-radius passes.\n */\n const resolveLayerTransition = (\n target: ViewTransitionTarget | undefined,\n type: string,\n transitionName: string,\n index: number,\n total: number\n ) => {\n const transition = mergeTransition(\n getValueTransition(defaultOptions, transitionName),\n getValueTransition(\n (layerOptions(target, type) ?? {}) as any,\n transitionName\n )\n )\n\n if (typeof transition.delay === \"function\") {\n transition.delay = transition.delay(index, total)\n }\n\n return transition\n }\n\n /**\n * Resolve a layer's group (`layout`) timing to plain WAAPI values: native\n * ms `delay`/`duration` and a baked `ease`. The single source of group\n * timing, shared by the generated-group retiming and the crop corner-radius\n * pass so the rounded clip animates on exactly the box's timing. It returns\n * no generator `type` (the WAAPI-only `NativeAnimation` rejects a string\n * type) nor `repeat`/`times` (which the group's `updateTiming` ignores), so\n * none of them can leak into the radius animation and desync it.\n */\n const resolveGroupTiming = (name: string) => {\n const [index, total] = staggerPosition(name, \"group\")\n const transition = resolveLayerTransition(\n layerTargets.get(name),\n \"group\",\n \"layout\",\n index === -1 ? 0 : index,\n total\n )\n transition.duration &&= secondsToMilliseconds(transition.duration)\n const { delay = 0, duration, ease } = applyGeneratorOptions(transition)\n return { delay: secondsToMilliseconds(delay), duration, ease }\n }\n\n /**\n * Each layer's measured box + corner radii per snapshot. The box lets\n * `finalizeCrop` tell whether a morph's aspect ratio changed (the only case\n * worth cropping); the radii let a cropped morph's group clip animate each\n * corner from the old element's radius to the new element's, keeping it\n * rounded where `overflow: clip` would otherwise square the corners.\n *\n * We never flatten the source for capture (a snapshot is a paint of the live\n * DOM, so squaring an element just for its capture would flash one real\n * square frame). For an aspect-changing morph `object-fit: cover` crops each\n * snapshot's own baked corners off-screen mid-morph, so the animated clip is\n * the only visible corner; a near-same-aspect forced crop (`.crop(true)`)\n * can't hide the outgoing snapshot's silhouette, but the endpoints coincide.\n */\n const cropMeasurements = new Map<\n string,\n {\n old?: { width: number; height: number; radii: CornerRadii }\n new?: { width: number; height: number; radii: CornerRadii }\n }\n >()\n\n const measureLayers = (phase: \"old\" | \"new\") =>\n nameRegistry.forEach((name, element) => {\n const el = element as HTMLElement\n const rect = el.getBoundingClientRect?.()\n if (rect && rect.height) {\n const style = getComputedStyle(el)\n const radii = {} as CornerRadii\n for (const corner of cornerRadiusProps) {\n radii[corner] = style[corner]\n }\n const entry = cropMeasurements.get(name) ?? {}\n entry[phase] = { width: rect.width, height: rect.height, radii }\n cropMeasurements.set(name, entry)\n }\n })\n\n /**\n * With both snapshots measured, settle which layers crop. The default crops\n * only a morph whose aspect ratio *changes* between snapshots - the one case\n * where `object-fit: cover` does real work. A same-aspect morph or a\n * fade-only layer is left uncropped: its corners scale naturally (no flash\n * from squaring, no `overflow: clip` eating its shadow) and a backdrop can't\n * be clipped to nothing. An explicit `.crop(true | false)` overrides either\n * way. Runs after both snapshots are measured, since aspect needs both.\n */\n const finalizeCrop = () => {\n croppedNames.clear()\n for (const name of layerStagger.keys()) {\n if (name === \"root\") continue\n // An explicit `.crop(true | false)` wins; otherwise crop a morph\n // whose aspect ratio changed.\n if (cropForName.get(name) ?? aspectChanged(name)) {\n croppedNames.add(name)\n }\n }\n }\n\n /**\n * Whether a layer is a morph whose box aspect ratio changed between\n * snapshots (beyond a small tolerance). Fade-only layers (one snapshot) are\n * never \"changed\".\n */\n const aspectChanged = (name: string) => {\n const box = cropMeasurements.get(name)\n if (!box?.old || !box?.new || !box.old.height || !box.new.height) {\n return false\n }\n return (\n Math.abs(\n box.old.width / box.old.height -\n box.new.width / box.new.height\n ) > ASPECT_TOLERANCE\n )\n }\n\n /**\n * Write the persistent view-transition CSS: suppress root capture when the\n * root has no animations of its own; force linear timing (baked into the\n * keyframes, so we can retime later via updateTiming); and clip +\n * object-fit: cover every cropped morph (the UA default overflows on\n * aspect-ratio change).\n *\n * `css.commit` replaces rather than appends, so we re-set the full rule set\n * each call - the crop rules are only known after `finalizeCrop` runs in the\n * update callback, so the second call writes them.\n */\n const commitViewCSS = () => {\n if (!hasTarget(\"root\", targets)) {\n css.set(\":root\", { \"view-transition-name\": \"none\" })\n }\n\n css.set(\n \"::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)\",\n { \"animation-timing-function\": \"linear !important\" }\n )\n\n croppedNames.forEach((name) => {\n css.set(`::view-transition-group(${name})`, { overflow: \"clip\" })\n css.set(\n `::view-transition-old(${name}), ::view-transition-new(${name})`,\n { width: \"100%\", height: \"100%\", \"object-fit\": \"cover\" }\n )\n })\n\n /**\n * Clip the nested children of any layer that clips in the live layout,\n * so a wrapper crops its child for the whole morph (mirroring the DOM)\n * rather than only at the live-DOM handoff. No-op on browsers without\n * nested view-transition groups.\n */\n clipChildren.forEach((name) => {\n css.set(`::view-transition-group-children(${name})`, {\n overflow: \"clip\",\n })\n })\n\n css.commit() // Write\n }\n\n const cleanup = () => {\n releaseViewTransitionNames(assigned, classed, grouped)\n css.remove() // Write\n }\n\n const callback = async () => {\n await update()\n\n /**\n * Re-resolve so elements created by the update are named for the new\n * snapshot, then measure them. With both snapshots measured we can\n * settle the crop set (aspect-changing morphs + forced).\n */\n resolveLayers(\"new\")\n measureLayers(\"new\")\n finalizeCrop()\n\n /**\n * Re-commit the crop CSS unconditionally: `finalizeCrop` is computed\n * here (after both snapshots are measured), so the clip rules must be\n * (re)written to match the settled set.\n */\n commitViewCSS()\n }\n\n let transition: ViewTransition\n try {\n resolveLayers(\"old\")\n /**\n * Measure the old snapshot against the optimistic crop set (the new\n * snapshot doesn't exist yet, so aspect change can't be known here;\n * `finalizeCrop` settles it post-update).\n */\n measureLayers(\"old\")\n commitViewCSS()\n transition = document.startViewTransition(callback)\n } catch (error) {\n /**\n * The prelude writes inline names before the transition exists. If it\n * throws (e.g. startViewTransition rejects in a bad UA state), release\n * them so we neither leak DOM state nor stall the queue on a promise\n * that never settles - hand back a rejection it can advance past.\n */\n cleanup()\n return Promise.reject(error)\n }\n\n transition.finished.finally(cleanup)\n\n return new Promise((resolve, reject) => {\n transition.ready\n .then(() => {\n const generatedViewAnimations = getViewAnimations()\n\n const animations: AnimationPlaybackControls[] = []\n\n /**\n * Create animations for each of our explicitly-defined subjects.\n * `opacityAnimated` additionally tracks which `${name}:${type}`\n * we faded, so we can keep the UA `plus-lighter` blend only for a\n * genuine opacity crossfade (both sides fading) and drop it for a\n * slide/transform, where additive compositing would flash bright.\n */\n const explicitlyAnimated = new Set()\n const opacityAnimated = new Set()\n layerTargets.forEach((target, name) => {\n const stagger = layerStagger.get(name)\n /**\n * Presence: `enter` only fires for a pure newcomer (a new\n * view with no old), `exit` only for a pure leaver. A\n * survivor (both) gets neither - it just morphs.\n */\n const enterApplies = !!stagger?.new && !stagger?.old\n const exitApplies = !!stagger?.old && !stagger?.new\n\n for (const key of definitionNames) {\n if (!target[key]) continue\n if (key === \"enter\" && !enterApplies) continue\n if (key === \"exit\" && !exitApplies) continue\n\n const type = chooseLayerType(\n key as keyof ViewTransitionTarget\n )\n const [index, total] = staggerPosition(name, type)\n // Skip a layer absent from its snapshot.\n if (index === -1) continue\n\n const { keyframes, options } =\n target[key as keyof ViewTransitionTarget]!\n\n for (let [valueName, valueKeyframes] of Object.entries(\n keyframes\n )) {\n // Skip only missing values - `0` (e.g. opacity: 0)\n // is valid and must reach the from-value inference.\n if (valueKeyframes == null) continue\n\n /**\n * The view path hands keyframes straight to WAAPI,\n * so Motion's `x`/`y` shorthands (compiled to\n * `transform` only via the value pipeline) have no\n * effect. Warn and skip - use `transform`/`translate`.\n */\n if (valueName === \"x\" || valueName === \"y\") {\n warnOnce(\n false,\n `animateView() animates view-transition layers with CSS properties; the \"${valueName}\" shorthand has no effect - use transform, e.g. { transform: \"translateX(40px)\" }.`\n )\n continue\n }\n\n /**\n * enter/exit win over new/old on a shared property -\n * skip it here when the gated bucket also defines it.\n */\n if (\n key === \"new\" &&\n enterApplies &&\n target.enter?.keyframes[\n valueName as keyof DOMKeyframesDefinition\n ] != null\n ) {\n continue\n }\n if (\n key === \"old\" &&\n exitApplies &&\n target.exit?.keyframes[\n valueName as keyof DOMKeyframesDefinition\n ] != null\n ) {\n continue\n }\n\n const valueOptions = mergeTransition(\n getValueTransition(\n defaultOptions as any,\n valueName\n ),\n getValueTransition(options as any, valueName)\n )\n\n /**\n * Infer an origin for a single-value keyframe. An\n * `enter` mirrors the matching `exit` value (a\n * defined exit reverses into the enter for free);\n * otherwise the per-type default (opacity 0/1, scale\n * 0.85). No default -> left as-is (animates from the\n * live value).\n *\n * `new`/`old` fire for survivors too, where only the\n * opacity crossfade default applies - a transform\n * default like scale 0.85 would pop a persisting\n * element, so gate it on the layer actually\n * entering/leaving.\n */\n if (!Array.isArray(valueKeyframes)) {\n const exitValue =\n key === \"enter\"\n ? target.exit?.keyframes[\n valueName as keyof DOMKeyframesDefinition\n ]\n : undefined\n const allowDefault =\n valueName === \"opacity\" ||\n (type === \"new\" ? enterApplies : exitApplies)\n const from =\n exitValue != null\n ? Array.isArray(exitValue)\n ? exitValue[exitValue.length - 1]\n : exitValue\n : allowDefault\n ? ORIGIN_DEFAULTS[type]?.[valueName]\n : undefined\n if (from !== undefined) {\n valueKeyframes = [from, valueKeyframes]\n }\n }\n\n /**\n * Resolve stagger function if provided, per element\n * across this subject's resolved layers.\n */\n if (typeof valueOptions.delay === \"function\") {\n valueOptions.delay = valueOptions.delay(\n index,\n total\n )\n }\n\n valueOptions.duration &&= secondsToMilliseconds(\n valueOptions.duration\n )\n\n valueOptions.delay &&= secondsToMilliseconds(\n valueOptions.delay\n )\n\n animations.push(\n new NativeAnimation({\n ...valueOptions,\n element: document.documentElement,\n name: valueName,\n pseudoElement: `::view-transition-${type}(${name})`,\n keyframes: valueKeyframes,\n })\n )\n explicitlyAnimated.add(`${name}:${type}`)\n if (valueName === \"opacity\") {\n opacityAnimated.add(`${name}:${type}`)\n }\n }\n }\n })\n\n /**\n * Handle browser generated animations\n */\n for (const animation of generatedViewAnimations) {\n if (animation.playState === \"finished\") continue\n\n const { effect } = animation\n if (!effect || !(effect instanceof KeyframeEffect)) continue\n\n const { pseudoElement } = effect\n if (!pseudoElement) continue\n\n const name = getViewAnimationLayerInfo(pseudoElement)\n if (!name) continue\n\n const targetDefinition = layerTargets.get(name.layer)\n\n /**\n * We built our own animation for this layer, so drop the\n * browser-generated fade we're replacing. The UA\n * `plus-lighter` blend is a *separate* generated animation on\n * the same pseudo (it sets `mix-blend-mode` in its keyframes):\n * keep it *only* for a true opacity crossfade - both sides\n * fading - so a symmetric crossfade composites without\n * darkening, but a slide/transform (where both layers stay\n * opaque and overlap) doesn't flash bright from the addition.\n */\n if (explicitlyAnimated.has(`${name.layer}:${name.type}`)) {\n const isCrossfade =\n opacityAnimated.has(`${name.layer}:new`) &&\n opacityAnimated.has(`${name.layer}:old`)\n if (\n isCrossfade &&\n effect\n .getKeyframes()\n .some((keyframe) => keyframe.mixBlendMode)\n ) {\n animations.push(new NativeAnimationWrapper(animation))\n } else {\n animation.cancel()\n }\n continue\n }\n\n /**\n * Drop the orphaned half of the default crossfade. The UA\n * fades old out and new in as a *pair*; if the opposing half\n * was explicitly overridden with something other than an\n * opacity fade (a clip or transform reveal), this side's\n * default opacity fade has no partner - left to run it would\n * dissolve what should be a static backdrop (e.g.\n * `.new({ clipPath })` should reveal over a still old view,\n * not fade the old out around the growing clip). Cancel it -\n * and its `plus-lighter` sibling on the same pseudo, which\n * would otherwise flash bright where the two opaque layers\n * overlap. A genuine crossfade (the opposing side also fading\n * opacity) keeps both halves and is handled above.\n */\n const opposite =\n name.type === \"old\"\n ? \"new\"\n : name.type === \"new\"\n ? \"old\"\n : undefined\n if (\n opposite &&\n explicitlyAnimated.has(\n `${name.layer}:${opposite}`\n ) &&\n !opacityAnimated.has(`${name.layer}:${opposite}`)\n ) {\n animation.cancel()\n continue\n }\n\n /**\n * Otherwise retime the browser-generated animation to\n * Motion's timing. This auto-enables the layout (group)\n * morph for any resolved/named target, and applies the\n * default timing to old/new layers we haven't explicitly\n * overridden.\n *\n * group + group-children both follow the layout timing so\n * the nesting container stays in sync with the morph.\n */\n /**\n * A survivor's old + new are the two halves of one\n * `plus-lighter` crossfade. They must share identical timing\n * (so their opacities stay mirrored and sum to 1 - else the\n * additive blend flashes bright wherever both are partly\n * visible) and fade linearly (the bounce belongs on the\n * group's geometry, not the opacity). So time them as the\n * group, rather than via their own - potentially staggered,\n * or enter/exit-derived - old/new options.\n */\n const stagger = layerStagger.get(name.layer)\n const isMorphCrossfade =\n (name.type === \"old\" || name.type === \"new\") &&\n !!stagger?.old &&\n !!stagger?.new\n\n let timing: {\n delay: number\n duration?: number\n easing: string\n }\n if (name.type.startsWith(\"group\")) {\n // group + group-children follow the resolved group\n // timing - the single source shared with the crop\n // corner-radius pass below.\n const { delay, duration, ease } = resolveGroupTiming(\n name.layer\n )\n timing = {\n delay,\n duration,\n easing: mapEasingToNativeEasing(\n ease,\n duration!\n ) as string,\n }\n } else {\n const timingType = isMorphCrossfade ? \"group\" : name.type\n const [index, total] = staggerPosition(\n name.layer,\n timingType\n )\n const transitionName =\n timingType === \"group\" ? \"layout\" : \"\"\n let animationTransition = resolveLayerTransition(\n targetDefinition,\n timingType,\n transitionName,\n index === -1 ? 0 : index,\n total\n )\n\n /**\n * The crossfade should resolve at the spring's\n * *perceptual* (visual) duration - the geometry can keep\n * bouncing, but the opacity shouldn't drag through the\n * settle. So capture `visualDuration` before\n * `applyGeneratorOptions` replaces it with the full\n * overshoot duration, and use it for the fade.\n */\n const visualDuration = animationTransition.visualDuration\n\n animationTransition.duration &&= secondsToMilliseconds(\n animationTransition.duration\n )\n\n animationTransition =\n applyGeneratorOptions(animationTransition)\n\n timing = {\n delay: secondsToMilliseconds(\n animationTransition.delay ?? 0\n ),\n duration:\n isMorphCrossfade && visualDuration !== undefined\n ? secondsToMilliseconds(visualDuration)\n : animationTransition.duration,\n easing: isMorphCrossfade\n ? \"linear\"\n : (mapEasingToNativeEasing(\n animationTransition.ease,\n animationTransition.duration!\n ) as string),\n }\n }\n\n effect.updateTiming(timing)\n\n animations.push(new NativeAnimationWrapper(animation))\n }\n\n /**\n * Round each cropped layer's clip. Its `::view-transition-group`\n * has `overflow: clip`, which would otherwise square the corners\n * mid-morph; animate each corner from the old element's radius to\n * the new element's so the crop stays rounded. Timed as the group\n * (`layout`) so the radius tracks the morphing box.\n */\n cropMeasurements.forEach((entry, name) => {\n if (!croppedNames.has(name)) return\n\n // Reuse the group's resolved timing - native ms delay/\n // duration + a baked ease, with no generator `type` or\n // repeat/times to leak into (or throw inside) NativeAnimation.\n const { delay, duration, ease } = resolveGroupTiming(name)\n\n for (const corner of cornerRadiusProps) {\n // `||` (not `??`) so an empty measurement falls back to\n // the other snapshot rather than an invalid keyframe.\n const from =\n entry.old?.radii[corner] ||\n entry.new?.radii[corner] ||\n \"0px\"\n const to =\n entry.new?.radii[corner] ||\n entry.old?.radii[corner] ||\n \"0px\"\n // Nothing to round if the corner is square at both ends.\n if (isSquareRadius(from) && isSquareRadius(to)) continue\n\n animations.push(\n new NativeAnimation({\n element: document.documentElement,\n name: corner,\n pseudoElement: `::view-transition-group(${name})`,\n keyframes: [from, to],\n delay,\n duration,\n ease,\n })\n )\n }\n })\n\n resolve(new GroupAnimation(animations))\n })\n .catch(() =>\n /**\n * `ready` rejects when the transition is skipped - no visual\n * change, or superseded by an interrupting transition. The DOM\n * update still applied, so settle with no animations rather than\n * surfacing it as an error to an awaiting caller. A genuine\n * failure in `update()` rejects `updateCallbackDone` (already\n * settled by now), so propagate that instead.\n */\n transition.updateCallbackDone.then(\n () => resolve(new GroupAnimation([])),\n reject\n )\n )\n })\n}\n\n/**\n * The options that should time a given generated layer type, so a retimed\n * group/old/new picks up any per-target transition the user provided. Checks\n * the type's buckets in priority order (e.g. `new` before `enter`).\n */\nfunction layerOptions(target: ViewTransitionTarget | undefined, type: string) {\n for (const bucket of typeBuckets[type] ?? []) {\n const options = target?.[bucket]?.options\n if (options) return options\n }\n}\n\n/**\n * Merge a base transition (e.g. the default `options`) with a per-layer/value\n * override. An explicit `duration` on the override must win over an inherited\n * generator's own timing: a spring prefers `visualDuration`, and\n * `spring.applyToOptions` overwrites `duration` with the computed settle time -\n * so without this the override is silently discarded. Dropping the inherited\n * `type`/`visualDuration` makes the layer a plain tween of that duration, unless\n * it asked for its own generator `type`/`visualDuration`.\n */\nfunction mergeTransition(base: any, override: any) {\n const merged = { ...base, ...override }\n\n if (override.duration !== undefined) {\n if (override.visualDuration === undefined) delete merged.visualDuration\n if (override.type === undefined) delete merged.type\n }\n\n return merged\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAsBA,MAAM,eAAe,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAU;AAI1E;;;;AAIG;AACH,MAAM,cAAc,GAAG,CAAC,MAAc,KAClC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,KAAK,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AAE/D;;;;;AAKG;AACH,MAAM,WAAW,GAAmD;IAChE,KAAK,EAAE,CAAC,QAAQ,CAAC;AACjB,IAAA,GAAG,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC;AACrB,IAAA,GAAG,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC;CACvB;AAED;;;;AAIG;AACH,MAAM,eAAe,GAA2C;IAC5D,GAAG,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE;IAChC,GAAG,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE;CAChC;AAED;;;;AAIG;AACH,MAAM,gBAAgB,GAAG,GAAG;AAEtB,SAAU,kBAAkB,CAC9B,OAA8B,EA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CAAC,CAAC;AACN;AAEA;;;;AAIG;AACH,SAAS,YAAY,CAAC,MAAwC,EAAE,IAAY,EAAA;IACxE,KAAK,MAAM,MAAM,IAAI,WAAW,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE;QAC1C,MAAM,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC,EAAE,OAAO;AACzC,QAAA,IAAI,OAAO;AAAE,YAAA,OAAO,OAAO;IAC/B;AACJ;AAEA;;;;;;;;AAQG;AACH,SAAS,eAAe,CAAC,IAAS,EAAE,QAAa,EAAA;IAC7C,MAAM,MAAM,GAAG,EAAE,GAAG,IAAI,EAAE,GAAG,QAAQ,EAAE;AAEvC,IAAA,IAAI,QAAQ,CAAC,QAAQ,KAAK,SAAS,EAAE;AACjC,QAAA,IAAI,QAAQ,CAAC,cAAc,KAAK,SAAS;YAAE,OAAO,MAAM,CAAC,cAAc;AACvE,QAAA,IAAI,QAAQ,CAAC,IAAI,KAAK,SAAS;YAAE,OAAO,MAAM,CAAC,IAAI;IACvD;AAEA,IAAA,OAAO,MAAM;AACjB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/view/utils/assign-names.mjs b/node_modules/motion-dom/dist/es/view/utils/assign-names.mjs deleted file mode 100644 index c8a17a3..0000000 --- a/node_modules/motion-dom/dist/es/view/utils/assign-names.mjs +++ /dev/null @@ -1,146 +0,0 @@ -import { resolveElements } from '../../utils/resolve-elements.mjs'; - -let nameCount = 0; -/** - * Generated names live in their own namespace so we can tell a name we own - * (and must clean up) from an author-defined one - and so a stale generated - * name left behind by an interrupted transition is re-owned, not mistaken for - * the author's and leaked. - */ -const generatedName = () => `motion-view-${nameCount++}`; -const isGeneratedName = (name) => name.startsWith("motion-view-"); -/** - * Tag a captured element with a `view-transition-class` so authors can target - * its generated layer from CSS (e.g. `::view-transition-group(.hero)`) without - * the opaque generated name. Tracked in `classed` - separate from the generated - * names in `assigned` - so cleanup removes the class without ever stripping an - * author's own inline `view-transition-name`. - */ -function tagClass(element, className, classed) { - if (!className) - return; - element.style?.setProperty("view-transition-class", className); - classed.push(element); -} -/** - * Set the element's `view-transition-group` so its layer reconstructs the DOM - * hierarchy in the pseudo-tree (`contain`) - or stays flat (`none`). Tracked in - * `grouped` for cleanup. When the element clips (any non-`visible` overflow) its - * name is recorded in `clipChildren` so the caller can clip the nested children - * (`::view-transition-group-children(name)`), mirroring the live clip through - * the whole transition rather than only at the live-DOM handoff. - * - * Ignored by browsers without nested view-transition groups, where it harmlessly - * degrades to the flat default. - */ -function applyGroup(element, name, group, grouped, clipChildren) { - if (!group) - return; - element.style?.setProperty("view-transition-group", group); - grouped.push(element); - if (group !== "none" && clipChildren) { - const style = getComputedStyle(element); - if (style.overflowX !== "visible" || style.overflowY !== "visible") { - clipChildren.add(name); - } - } -} -/** - * Resolve a selector/Element to elements and ensure each one carries a - * `view-transition-name` we can target from script. - * - * Author-defined names are reused as-is. Elements that are unnamed (or use - * the browser's `auto`/`match-element`, whose generated name is not exposed - * to script) are given a unique generated name, set inline so it's captured, - * and tracked in `assigned` for later cleanup. - * - * `registry` maps each Element to its name so the same element keeps its name - * across both captures (before and after the update), which is what allows a - * persistent element to animate as a single `group` layer. - */ -function assignViewTransitionNames(definition, registry, assigned, forcedNames, className, classed = [], group, grouped = [], clipChildren) { - const elements = resolveElements(definition); - /** - * The new end of a paired morph: give each element the matching name from - * the old end (by index) so the two share one layer and morph. If the new - * end resolves to *more* elements than the old end named, the extras have no - * counterpart - give them a fresh name so they animate as newcomers rather - * than being silently left unnamed. We return the names actually assigned - * (sized to the resolved elements), not the raw `forcedNames`, so stagger - * totals and the layer set stay in step with what's on the page. - */ - if (forcedNames) { - return elements.map((element, i) => { - const existing = registry.get(element); - if (existing) - return existing; - const name = forcedNames[i] ?? generatedName(); - element.style?.setProperty("view-transition-name", name); - assigned.push(element); - registry.set(element, name); - tagClass(element, className, classed); - applyGroup(element, name, group, grouped, clipChildren); - return name; - }); - } - /** - * Read every current name up front, before assigning any. Interleaving the - * reads with the inline `setProperty` writes below would dirty styles - * between reads and force a style recalc per element; batching the reads - * keeps it to one. Elements already in the registry keep their name and - * need no read. - */ - const currentNames = elements.map((element) => registry.has(element) - ? undefined - : getComputedStyle(element).getPropertyValue("view-transition-name")); - return elements.map((element, i) => { - const existing = registry.get(element); - if (existing) - return existing; - const current = currentNames[i]; - let name; - if (current && - current !== "none" && - current !== "auto" && - current !== "match-element" && - !isGeneratedName(current)) { - /** - * The author already named this layer - target it as-is and leave - * it to them to clean up. `auto`/`match-element` are overridden - * because their generated name is not exposed to script, and a - * stale `motion-view-*` (e.g. left by an interrupted transition) is - * re-owned rather than adopted as an author name and leaked. - */ - name = current; - } - else { - name = generatedName(); - element.style?.setProperty("view-transition-name", name); - assigned.push(element); - } - registry.set(element, name); - tagClass(element, className, classed); - applyGroup(element, name, group, grouped, clipChildren); - return name; - }); -} -/** - * Remove the `view-transition-name`s we generated and the - * `view-transition-class`es we applied. Author-defined names are never touched - * (they're not in `assigned`). Safe to call more than once (e.g. on both a - * finished and an interrupted transition). - */ -function releaseViewTransitionNames(assigned, classed = [], grouped = []) { - for (const element of assigned) { - element.style?.removeProperty("view-transition-name"); - } - for (const element of classed) { - element.style?.removeProperty("view-transition-class"); - } - for (const element of grouped) { - element.style?.removeProperty("view-transition-group"); - } -} - -export { assignViewTransitionNames, releaseViewTransitionNames }; -//# sourceMappingURL=assign-names.mjs.map diff --git a/node_modules/motion-dom/dist/es/view/utils/assign-names.mjs.map b/node_modules/motion-dom/dist/es/view/utils/assign-names.mjs.map deleted file mode 100644 index 4e77299..0000000 --- a/node_modules/motion-dom/dist/es/view/utils/assign-names.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"assign-names.mjs","sources":["../../../../src/view/utils/assign-names.ts"],"sourcesContent":["import { ElementOrSelector, resolveElements } from \"../../utils/resolve-elements\"\n\nlet nameCount = 0\n\n/**\n * Generated names live in their own namespace so we can tell a name we own\n * (and must clean up) from an author-defined one - and so a stale generated\n * name left behind by an interrupted transition is re-owned, not mistaken for\n * the author's and leaked.\n */\nconst generatedName = () => `motion-view-${nameCount++}`\n\nconst isGeneratedName = (name: string) => name.startsWith(\"motion-view-\")\n\n/**\n * Tag a captured element with a `view-transition-class` so authors can target\n * its generated layer from CSS (e.g. `::view-transition-group(.hero)`) without\n * the opaque generated name. Tracked in `classed` - separate from the generated\n * names in `assigned` - so cleanup removes the class without ever stripping an\n * author's own inline `view-transition-name`.\n */\nfunction tagClass(\n element: Element,\n className: string | undefined,\n classed: Element[]\n) {\n if (!className) return\n ;(element as HTMLElement).style?.setProperty(\n \"view-transition-class\",\n className\n )\n classed.push(element)\n}\n\n/**\n * Set the element's `view-transition-group` so its layer reconstructs the DOM\n * hierarchy in the pseudo-tree (`contain`) - or stays flat (`none`). Tracked in\n * `grouped` for cleanup. When the element clips (any non-`visible` overflow) its\n * name is recorded in `clipChildren` so the caller can clip the nested children\n * (`::view-transition-group-children(name)`), mirroring the live clip through\n * the whole transition rather than only at the live-DOM handoff.\n *\n * Ignored by browsers without nested view-transition groups, where it harmlessly\n * degrades to the flat default.\n */\nfunction applyGroup(\n element: Element,\n name: string,\n group: string | undefined,\n grouped: Element[],\n clipChildren?: Set\n) {\n if (!group) return\n ;(element as HTMLElement).style?.setProperty(\"view-transition-group\", group)\n grouped.push(element)\n\n if (group !== \"none\" && clipChildren) {\n const style = getComputedStyle(element)\n if (style.overflowX !== \"visible\" || style.overflowY !== \"visible\") {\n clipChildren.add(name)\n }\n }\n}\n\n/**\n * Resolve a selector/Element to elements and ensure each one carries a\n * `view-transition-name` we can target from script.\n *\n * Author-defined names are reused as-is. Elements that are unnamed (or use\n * the browser's `auto`/`match-element`, whose generated name is not exposed\n * to script) are given a unique generated name, set inline so it's captured,\n * and tracked in `assigned` for later cleanup.\n *\n * `registry` maps each Element to its name so the same element keeps its name\n * across both captures (before and after the update), which is what allows a\n * persistent element to animate as a single `group` layer.\n */\nexport function assignViewTransitionNames(\n definition: ElementOrSelector,\n registry: Map,\n assigned: Element[],\n forcedNames?: string[],\n className?: string,\n classed: Element[] = [],\n group?: string,\n grouped: Element[] = [],\n clipChildren?: Set\n): string[] {\n const elements = resolveElements(definition)\n\n /**\n * The new end of a paired morph: give each element the matching name from\n * the old end (by index) so the two share one layer and morph. If the new\n * end resolves to *more* elements than the old end named, the extras have no\n * counterpart - give them a fresh name so they animate as newcomers rather\n * than being silently left unnamed. We return the names actually assigned\n * (sized to the resolved elements), not the raw `forcedNames`, so stagger\n * totals and the layer set stay in step with what's on the page.\n */\n if (forcedNames) {\n return elements.map((element, i) => {\n const existing = registry.get(element)\n if (existing) return existing\n\n const name = forcedNames[i] ?? generatedName()\n ;(element as HTMLElement).style?.setProperty(\n \"view-transition-name\",\n name\n )\n assigned.push(element)\n registry.set(element, name)\n tagClass(element, className, classed)\n applyGroup(element, name, group, grouped, clipChildren)\n\n return name\n })\n }\n\n /**\n * Read every current name up front, before assigning any. Interleaving the\n * reads with the inline `setProperty` writes below would dirty styles\n * between reads and force a style recalc per element; batching the reads\n * keeps it to one. Elements already in the registry keep their name and\n * need no read.\n */\n const currentNames = elements.map((element) =>\n registry.has(element)\n ? undefined\n : getComputedStyle(element).getPropertyValue(\"view-transition-name\")\n )\n\n return elements.map((element, i) => {\n const existing = registry.get(element)\n if (existing) return existing\n\n const current = currentNames[i]\n\n let name: string\n if (\n current &&\n current !== \"none\" &&\n current !== \"auto\" &&\n current !== \"match-element\" &&\n !isGeneratedName(current)\n ) {\n /**\n * The author already named this layer - target it as-is and leave\n * it to them to clean up. `auto`/`match-element` are overridden\n * because their generated name is not exposed to script, and a\n * stale `motion-view-*` (e.g. left by an interrupted transition) is\n * re-owned rather than adopted as an author name and leaked.\n */\n name = current\n } else {\n name = generatedName()\n ;(element as HTMLElement).style?.setProperty(\n \"view-transition-name\",\n name\n )\n assigned.push(element)\n }\n\n registry.set(element, name)\n tagClass(element, className, classed)\n applyGroup(element, name, group, grouped, clipChildren)\n\n return name\n })\n}\n\n/**\n * Remove the `view-transition-name`s we generated and the\n * `view-transition-class`es we applied. Author-defined names are never touched\n * (they're not in `assigned`). Safe to call more than once (e.g. on both a\n * finished and an interrupted transition).\n */\nexport function releaseViewTransitionNames(\n assigned: Element[],\n classed: Element[] = [],\n grouped: Element[] = []\n): void {\n for (const element of assigned) {\n ;(element as HTMLElement).style?.removeProperty(\"view-transition-name\")\n }\n for (const element of classed) {\n ;(element as HTMLElement).style?.removeProperty(\"view-transition-class\")\n }\n for (const element of grouped) {\n ;(element as HTMLElement).style?.removeProperty(\"view-transition-group\")\n }\n}\n"],"names":[],"mappings":";;AAEA,IAAI,SAAS,GAAG,CAAC;AAEjB;;;;;AAKG;AACH,MAAM,aAAa,GAAG,MAAM,CAAA,YAAA,EAAe,SAAS,EAAE,CAAA,CAAE;AAExD,MAAM,eAAe,GAAG,CAAC,IAAY,KAAK,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC;AAEzE;;;;;;AAMG;AACH,SAAS,QAAQ,CACb,OAAgB,EAChB,SAA6B,EAC7B,OAAkB,EAAA;AAElB,IAAA,IAAI,CAAC,SAAS;QAAE;IACd,OAAuB,CAAC,KAAK,EAAE,WAAW,CACxC,uBAAuB,EACvB,SAAS,CACZ;AACD,IAAA,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC;AACzB;AAEA;;;;;;;;;;AAUG;AACH,SAAS,UAAU,CACf,OAAgB,EAChB,IAAY,EACZ,KAAyB,EACzB,OAAkB,EAClB,YAA0B,EAAA;AAE1B,IAAA,IAAI,CAAC,KAAK;QAAE;IACV,OAAuB,CAAC,KAAK,EAAE,WAAW,CAAC,uBAAuB,EAAE,KAAK,CAAC;AAC5E,IAAA,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC;AAErB,IAAA,IAAI,KAAK,KAAK,MAAM,IAAI,YAAY,EAAE;AAClC,QAAA,MAAM,KAAK,GAAG,gBAAgB,CAAC,OAAO,CAAC;AACvC,QAAA,IAAI,KAAK,CAAC,SAAS,KAAK,SAAS,IAA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KAAK,MAAM,OAAO,IAAI,OAAO,EAAE;AACzB,QAAA,OAAuB,CAAC,KAAK,EAAE,cAAc,CAAC,uBAAuB,CAAC;IAC5E;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/view/utils/choose-layer-type.mjs b/node_modules/motion-dom/dist/es/view/utils/choose-layer-type.mjs deleted file mode 100644 index bf7e9e0..0000000 --- a/node_modules/motion-dom/dist/es/view/utils/choose-layer-type.mjs +++ /dev/null @@ -1,10 +0,0 @@ -function chooseLayerType(valueName) { - if (valueName === "layout") - return "group"; - if (valueName === "enter" || valueName === "new") - return "new"; - return "old"; -} - -export { chooseLayerType }; -//# sourceMappingURL=choose-layer-type.mjs.map diff --git a/node_modules/motion-dom/dist/es/view/utils/choose-layer-type.mjs.map b/node_modules/motion-dom/dist/es/view/utils/choose-layer-type.mjs.map deleted file mode 100644 index dd303b4..0000000 --- a/node_modules/motion-dom/dist/es/view/utils/choose-layer-type.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"choose-layer-type.mjs","sources":["../../../../src/view/utils/choose-layer-type.ts"],"sourcesContent":["export function chooseLayerType(\n valueName: \"layout\" | \"enter\" | \"exit\" | \"new\" | \"old\"\n): \"group\" | \"old\" | \"new\" {\n if (valueName === \"layout\") return \"group\"\n if (valueName === \"enter\" || valueName === \"new\") return \"new\"\n return \"old\"\n}\n"],"names":[],"mappings":"AAAM,SAAU,eAAe,CAC3B,SAAsD,EAAA;IAEtD,IAAI,SAAS,KAAK,QAAQ;AAAE,QAAA,OAAO,OAAO;AAC1C,IAAA,IAAI,SAAS,KAAK,OAAO,IAAI,SAAS,KAAK,KAAK;AAAE,QAAA,OAAO,KAAK;AAC9D,IAAA,OAAO,KAAK;AAChB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/view/utils/css.mjs b/node_modules/motion-dom/dist/es/view/utils/css.mjs deleted file mode 100644 index 24f9b67..0000000 --- a/node_modules/motion-dom/dist/es/view/utils/css.mjs +++ /dev/null @@ -1,33 +0,0 @@ -let pendingRules = {}; -let style = null; -const css = { - set: (selector, values) => { - pendingRules[selector] = values; - }, - commit: () => { - if (!style) { - style = document.createElement("style"); - style.id = "motion-view"; - } - let cssText = ""; - for (const selector in pendingRules) { - const rule = pendingRules[selector]; - cssText += `${selector} {\n`; - for (const [property, value] of Object.entries(rule)) { - cssText += ` ${property}: ${value};\n`; - } - cssText += "}\n"; - } - style.textContent = cssText; - document.head.appendChild(style); - pendingRules = {}; - }, - remove: () => { - if (style && style.parentElement) { - style.parentElement.removeChild(style); - } - }, -}; - -export { css }; -//# sourceMappingURL=css.mjs.map diff --git a/node_modules/motion-dom/dist/es/view/utils/css.mjs.map b/node_modules/motion-dom/dist/es/view/utils/css.mjs.map deleted file mode 100644 index bf16924..0000000 --- a/node_modules/motion-dom/dist/es/view/utils/css.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"css.mjs","sources":["../../../../src/view/utils/css.ts"],"sourcesContent":["let pendingRules: Record> = {}\n\nlet style: HTMLStyleElement | null = null\n\nexport const css = {\n set: (selector: string, values: Record) => {\n pendingRules[selector] = values\n },\n\n commit: () => {\n if (!style) {\n style = document.createElement(\"style\")\n style.id = \"motion-view\"\n }\n\n let cssText = \"\"\n\n for (const selector in pendingRules) {\n const rule = pendingRules[selector]\n cssText += `${selector} {\\n`\n for (const [property, value] of Object.entries(rule)) {\n cssText += ` ${property}: ${value};\\n`\n }\n cssText += \"}\\n\"\n }\n\n style.textContent = cssText\n document.head.appendChild(style)\n\n pendingRules = {}\n },\n\n remove: () => {\n if (style && style.parentElement) {\n style.parentElement.removeChild(style)\n }\n },\n}\n"],"names":[],"mappings":"AAAA,IAAI,YAAY,GAA2C,EAAE;AAE7D,IAAI,KAAK,GAA4B,IAAI;AAElC,MAAM,GAAG,GAAG;AACf,IAAA,GAAG,EAAE,CAAC,QAAgB,EAAE,MAA8B,KAAI;AACtD,QAAA,YAAY,CAAC,QAAQ,CAAC,GAAG,MAAM;IACnC,CAAC;IAED,MAAM,EAAE,MAAK;QACT,IAAI,CAAC,KAAK,EAAE;AACR,YAAA,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC;AACvC,YAAA,KAAK,CAAC,EAAE,GAAG,aAAa;QAC5B;QAEA,IAAI,OAAO,GAAG,EAAE;AAEhB,QAAA,KAAK,MAAM,QAAQ,IAAI,YAAY,EAAE;AACjC,YAAA,MAAM,IAAI,GAAG,YAAY,CAAC,QAAQ,CAAC;AACnC,YAAA,OAAO,IAAI,CAAA,EAAG,QAAQ,CAAA,IAAA,CAAM;AAC5B,YAAA,KAAK,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;AAClD,gBAAA,OAAO,IAAI,CAAA,EAAA,EAAK,QAAQ,CAAA,EAAA,EAAK,KAAK,KAAK;YAC3C;YACA,OAAO,IAAI,KAAK;QACpB;AAEA,QAAA,KAAK,CAAC,WAAW,GAAG,OAAO;AAC3B,QAAA,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC;QAEhC,YAAY,GAAG,EAAE;IACrB,CAAC;IAED,MAAM,EAAE,MAAK;AACT,QAAA,IAAI,KAAK,IAAI,KAAK,CAAC,aAAa,EAAE;AAC9B,YAAA,KAAK,CAAC,aAAa,CAAC,WAAW,CAAC,KAAK,CAAC;QAC1C;IACJ,CAAC;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/view/utils/get-layer-info.mjs b/node_modules/motion-dom/dist/es/view/utils/get-layer-info.mjs deleted file mode 100644 index 3aff9a5..0000000 --- a/node_modules/motion-dom/dist/es/view/utils/get-layer-info.mjs +++ /dev/null @@ -1,11 +0,0 @@ -function getViewAnimationLayerInfo(pseudoElement) { - const match = pseudoElement.match( - // `group-children` (nested transitions) before `group` so it wins. - /::view-transition-(old|new|group-children|group|image-pair)\((.*?)\)/); - if (!match) - return null; - return { layer: match[2], type: match[1] }; -} - -export { getViewAnimationLayerInfo }; -//# sourceMappingURL=get-layer-info.mjs.map diff --git a/node_modules/motion-dom/dist/es/view/utils/get-layer-info.mjs.map b/node_modules/motion-dom/dist/es/view/utils/get-layer-info.mjs.map deleted file mode 100644 index 7bde2e2..0000000 --- a/node_modules/motion-dom/dist/es/view/utils/get-layer-info.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"get-layer-info.mjs","sources":["../../../../src/view/utils/get-layer-info.ts"],"sourcesContent":["export function getViewAnimationLayerInfo(pseudoElement: string) {\n const match = pseudoElement.match(\n // `group-children` (nested transitions) before `group` so it wins.\n /::view-transition-(old|new|group-children|group|image-pair)\\((.*?)\\)/\n )\n if (!match) return null\n\n return { layer: match[2], type: match[1] }\n}\n"],"names":[],"mappings":"AAAM,SAAU,yBAAyB,CAAC,aAAqB,EAAA;AAC3D,IAAA,MAAM,KAAK,GAAG,aAAa,CAAC,KAAK;;AAE7B,IAAA,sEAAsE,CACzE;AACD,IAAA,IAAI,CAAC,KAAK;AAAE,QAAA,OAAO,IAAI;AAEvB,IAAA,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE;AAC9C;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/view/utils/get-view-animations.mjs b/node_modules/motion-dom/dist/es/view/utils/get-view-animations.mjs deleted file mode 100644 index a249893..0000000 --- a/node_modules/motion-dom/dist/es/view/utils/get-view-animations.mjs +++ /dev/null @@ -1,11 +0,0 @@ -function getViewAnimations() { - return document.getAnimations().filter((animation) => { - const { effect } = animation; - return (!!effect && - effect.target === document.documentElement && - effect.pseudoElement?.startsWith("::view-transition")); - }); -} - -export { getViewAnimations }; -//# sourceMappingURL=get-view-animations.mjs.map diff --git a/node_modules/motion-dom/dist/es/view/utils/get-view-animations.mjs.map b/node_modules/motion-dom/dist/es/view/utils/get-view-animations.mjs.map deleted file mode 100644 index 2fd42a6..0000000 --- a/node_modules/motion-dom/dist/es/view/utils/get-view-animations.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"get-view-animations.mjs","sources":["../../../../src/view/utils/get-view-animations.ts"],"sourcesContent":["export function getViewAnimations() {\n return document.getAnimations().filter((animation) => {\n const { effect } = animation\n return (\n !!effect &&\n effect.target === document.documentElement &&\n (effect as KeyframeEffect).pseudoElement?.startsWith(\n \"::view-transition\"\n )\n )\n })\n}\n"],"names":[],"mappings":"SAAgB,iBAAiB,GAAA;IAC7B,OAAO,QAAQ,CAAC,aAAa,EAAE,CAAC,MAAM,CAAC,CAAC,SAAS,KAAI;AACjD,QAAA,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS;QAC5B,QACI,CAAC,CAAC,MAAM;AACR,YAAA,MAAM,CAAC,MAAM,KAAK,QAAQ,CAAC,eAAe;YACzC,MAAyB,CAAC,aAAa,EAAE,UAAU,CAChD,mBAAmB,CACtB;AAET,IAAA,CAAC,CAAC;AACN;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/view/utils/has-target.mjs b/node_modules/motion-dom/dist/es/view/utils/has-target.mjs deleted file mode 100644 index ae14a10..0000000 --- a/node_modules/motion-dom/dist/es/view/utils/has-target.mjs +++ /dev/null @@ -1,6 +0,0 @@ -function hasTarget(target, targets) { - return targets.has(target) && Object.keys(targets.get(target)).length > 0; -} - -export { hasTarget }; -//# sourceMappingURL=has-target.mjs.map diff --git a/node_modules/motion-dom/dist/es/view/utils/has-target.mjs.map b/node_modules/motion-dom/dist/es/view/utils/has-target.mjs.map deleted file mode 100644 index 4ef9574..0000000 --- a/node_modules/motion-dom/dist/es/view/utils/has-target.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"has-target.mjs","sources":["../../../../src/view/utils/has-target.ts"],"sourcesContent":["import { ViewTransitionTarget, ViewTransitionTargetDefinition } from \"../types\"\n\nexport function hasTarget(\n target: ViewTransitionTargetDefinition,\n targets: Map\n) {\n return targets.has(target) && Object.keys(targets.get(target)!).length > 0\n}\n"],"names":[],"mappings":"AAEM,SAAU,SAAS,CACrB,MAAsC,EACtC,OAAkE,EAAA;IAElE,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAE,CAAC,CAAC,MAAM,GAAG,CAAC;AAC9E;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/index.d.ts b/node_modules/motion-dom/dist/index.d.ts deleted file mode 100644 index 2114701..0000000 --- a/node_modules/motion-dom/dist/index.d.ts +++ /dev/null @@ -1,5293 +0,0 @@ -import * as motion_utils from 'motion-utils'; -import { Point, BoundingBox, Axis, Box, TransformPoint, Easing, Delta, EasingFunction, BezierDefinition, AxisDelta, SubscriptionManager } from 'motion-utils'; - -/** - * Passed in to pan event handlers like `onPan` the `PanInfo` object contains - * information about the current state of the tap gesture such as its - * `point`, `delta`, `offset` and `velocity`. - * - * ```jsx - * { - * console.log(info.point.x, info.point.y) - * }} /> - * ``` - * - * @public - */ -interface PanInfo { - /** - * Contains `x` and `y` values for the current pan position relative - * to the device or page. - * - * ```jsx - * function onPan(event, info) { - * console.log(info.point.x, info.point.y) - * } - * - * - * ``` - * - * @public - */ - point: Point; - /** - * Contains `x` and `y` values for the distance moved since - * the last event. - * - * ```jsx - * function onPan(event, info) { - * console.log(info.delta.x, info.delta.y) - * } - * - * - * ``` - * - * @public - */ - delta: Point; - /** - * Contains `x` and `y` values for the distance moved from - * the first pan event. - * - * ```jsx - * function onPan(event, info) { - * console.log(info.offset.x, info.offset.y) - * } - * - * - * ``` - * - * @public - */ - offset: Point; - /** - * Contains `x` and `y` values for the current velocity of the pointer, in px/ms. - * - * ```jsx - * function onPan(event, info) { - * console.log(info.velocity.x, info.velocity.y) - * } - * - * - * ``` - * - * @public - */ - velocity: Point; -} -type PanHandler = (event: Event, info: PanInfo) => void; - -type DragHandler = (event: MouseEvent | TouchEvent | PointerEvent, info: PanInfo) => void; -type DragElastic = boolean | number | Partial; -interface ResolvedConstraints { - x: Partial; - y: Partial; -} -interface ResolvedElastic { - x: Axis; - y: Axis; -} - -interface EventInfo { - point: Point; -} -/** - * A generic set of string/number values - */ -interface ResolvedValues$1 { - [key: string]: AnyResolvedKeyframe; -} -type AnimationDefinition = VariantLabels | TargetAndTransition | TargetResolver; -/** - * An object that specifies values to animate to. Each value may be set either as - * a single value, or an array of values. - * - * It may also option contain these properties: - * - * - `transition`: Specifies transitions for all or individual values. - * - `transitionEnd`: Specifies values to set when the animation finishes. - * - * ```jsx - * const target = { - * x: "0%", - * opacity: 0, - * transition: { duration: 1 }, - * transitionEnd: { display: "none" } - * } - * ``` - * - * @public - */ -type TargetAndTransition = Target & { - transition?: Transition; - transitionEnd?: ResolvedValues$1; -}; -type TargetResolver = (custom: any, current: ResolvedValues$1, velocity: ResolvedValues$1) => TargetAndTransition | string; -/** - * Either a string, or array of strings, that reference variants defined via the `variants` prop. - * @public - */ -type VariantLabels = string | string[]; -type Variant = TargetAndTransition | TargetResolver; -interface Variants { - [key: string]: Variant; -} -/** - * @deprecated - */ -type LegacyAnimationControls = { - /** - * Subscribes a component's animation controls to this. - * - * @param controls - The controls to subscribe - * @returns An unsubscribe function. - */ - subscribe(visualElement: any): () => void; - /** - * Starts an animation on all linked components. - * - * @remarks - * - * ```jsx - * controls.start("variantLabel") - * controls.start({ - * x: 0, - * transition: { duration: 1 } - * }) - * ``` - * - * @param definition - Properties or variant label to animate to - * @param transition - Optional `transition` to apply to a variant - * @returns - A `Promise` that resolves when all animations have completed. - * - * @public - */ - start(definition: AnimationDefinition, transitionOverride?: Transition): Promise; - /** - * Instantly set to a set of properties or a variant. - * - * ```jsx - * // With properties - * controls.set({ opacity: 0 }) - * - * // With variants - * controls.set("hidden") - * ``` - * - * @privateRemarks - * We could perform a similar trick to `.start` where this can be called before mount - * and we maintain a list of of pending actions that get applied on mount. But the - * expectation of `set` is that it happens synchronously and this would be difficult - * to do before any children have even attached themselves. It's also poor practise - * and we should discourage render-synchronous `.start` calls rather than lean into this. - * - * @public - */ - set(definition: AnimationDefinition): void; - /** - * Stops animations on all linked components. - * - * ```jsx - * controls.stop() - * ``` - * - * @public - */ - stop(): void; - mount(): () => void; -}; -interface MotionNodeAnimationOptions { - /** - * Properties, variant label or array of variant labels to start in. - * - * Set to `false` to initialise with the values in `animate` (disabling the mount animation) - * - * ```jsx - * // As values - * - * - * // As variant - * - * - * // Multiple variants - * - * - * // As false (disable mount animation) - * - * ``` - */ - initial?: TargetAndTransition | VariantLabels | boolean; - /** - * Values to animate to, variant label(s), or `LegacyAnimationControls`. - * - * ```jsx - * // As values - * - * - * // As variant - * - * - * // Multiple variants - * - * - * // LegacyAnimationControls - * - * ``` - */ - animate?: TargetAndTransition | VariantLabels | boolean | LegacyAnimationControls; - /** - * A target to animate to when this component is removed from the tree. - * - * This component **must** be the first animatable child of an `AnimatePresence` to enable this exit animation. - * - * This limitation exists because React doesn't allow components to defer unmounting until after - * an animation is complete. Once this limitation is fixed, the `AnimatePresence` component will be unnecessary. - * - * ```jsx - * import { AnimatePresence, motion } from 'framer-motion' - * - * export const MyComponent = ({ isVisible }) => { - * return ( - * - * {isVisible && ( - * - * )} - * - * ) - * } - * ``` - */ - exit?: TargetAndTransition | VariantLabels; - /** - * Variants allow you to define animation states and organise them by name. They allow - * you to control animations throughout a component tree by switching a single `animate` prop. - * - * Using `transition` options like `delayChildren` and `when`, you can orchestrate - * when children animations play relative to their parent. - - * - * After passing variants to one or more `motion` component's `variants` prop, these variants - * can be used in place of values on the `animate`, `initial`, `whileFocus`, `whileTap` and `whileHover` props. - * - * ```jsx - * const variants = { - * active: { - * backgroundColor: "#f00" - * }, - * inactive: { - * backgroundColor: "#fff", - * transition: { duration: 2 } - * } - * } - * - * - * ``` - */ - variants?: Variants; - /** - * Default transition. If no `transition` is defined in `animate`, it will use the transition defined here. - * ```jsx - * const spring = { - * type: "spring", - * damping: 10, - * stiffness: 100 - * } - * - * - * ``` - */ - transition?: Transition; -} -interface MotionNodeEventOptions { - /** - * Callback with latest motion values, fired max once per frame. - * - * ```jsx - * function onUpdate(latest) { - * console.log(latest.x, latest.opacity) - * } - * - * - * ``` - */ - onUpdate?(latest: ResolvedValues$1): void; - /** - * Callback when animation defined in `animate` begins. - * - * The provided callback will be called with the triggering animation definition. - * If this is a variant, it'll be the variant name, and if a target object - * then it'll be the target object. - * - * This way, it's possible to figure out which animation has started. - * - * ```jsx - * function onStart() { - * console.log("Animation started") - * } - * - * - * ``` - */ - onAnimationStart?(definition: AnimationDefinition): void; - /** - * Callback when animation defined in `animate` is complete. - * - * The provided callback will be called with the triggering animation definition. - * If this is a variant, it'll be the variant name, and if a target object - * then it'll be the target object. - * - * This way, it's possible to figure out which animation has completed. - * - * ```jsx - * function onComplete() { - * console.log("Animation completed") - * } - * - * { - * console.log('Completed animating', definition) - * }} - * /> - * ``` - */ - onAnimationComplete?(definition: AnimationDefinition): void; - onBeforeLayoutMeasure?(box: Box): void; - onLayoutMeasure?(box: Box, prevBox: Box): void; - onLayoutAnimationStart?(): void; - onLayoutAnimationComplete?(): void; -} -interface MotionNodePanHandlers { - /** - * Callback function that fires when the pan gesture is recognised on this element. - * - * **Note:** For pan gestures to work correctly with touch input, the element needs - * touch scrolling to be disabled on either x/y or both axis with the - * [touch-action](https://developer.mozilla.org/en-US/docs/Web/CSS/touch-action) CSS rule. - * - * ```jsx - * function onPan(event, info) { - * console.log(info.point.x, info.point.y) - * } - * - * - * ``` - * - * @param event - The originating pointer event. - * @param info - A {@link PanInfo} object containing `x` and `y` values for: - * - * - `point`: Relative to the device or page. - * - `delta`: Distance moved since the last event. - * - `offset`: Offset from the original pan event. - * - `velocity`: Current velocity of the pointer. - */ - onPan?(event: PointerEvent, info: PanInfo): void; - /** - * Callback function that fires when the pan gesture begins on this element. - * - * ```jsx - * function onPanStart(event, info) { - * console.log(info.point.x, info.point.y) - * } - * - * - * ``` - * - * @param event - The originating pointer event. - * @param info - A {@link PanInfo} object containing `x`/`y` values for: - * - * - `point`: Relative to the device or page. - * - `delta`: Distance moved since the last event. - * - `offset`: Offset from the original pan event. - * - `velocity`: Current velocity of the pointer. - */ - onPanStart?(event: PointerEvent, info: PanInfo): void; - /** - * Callback function that fires when we begin detecting a pan gesture. This - * is analogous to `onMouseStart` or `onTouchStart`. - * - * ```jsx - * function onPanSessionStart(event, info) { - * console.log(info.point.x, info.point.y) - * } - * - * - * ``` - * - * @param event - The originating pointer event. - * @param info - An {@link EventInfo} object containing `x`/`y` values for: - * - * - `point`: Relative to the device or page. - */ - onPanSessionStart?(event: PointerEvent, info: EventInfo): void; - /** - * Callback function that fires when the pan gesture ends on this element. - * - * ```jsx - * function onPanEnd(event, info) { - * console.log(info.point.x, info.point.y) - * } - * - * - * ``` - * - * @param event - The originating pointer event. - * @param info - A {@link PanInfo} object containing `x`/`y` values for: - * - * - `point`: Relative to the device or page. - * - `delta`: Distance moved since the last event. - * - `offset`: Offset from the original pan event. - * - `velocity`: Current velocity of the pointer. - */ - onPanEnd?(event: PointerEvent, info: PanInfo): void; -} -interface MotionNodeHoverHandlers { - /** - * Properties or variant label to animate to while the hover gesture is recognised. - * - * ```jsx - * - * ``` - */ - whileHover?: VariantLabels | TargetAndTransition; - /** - * Callback function that fires when pointer starts hovering over the component. - * - * ```jsx - * console.log('Hover starts')} /> - * ``` - */ - onHoverStart?(event: PointerEvent, info: EventInfo): void; - /** - * Callback function that fires when pointer stops hovering over the component. - * - * ```jsx - * console.log("Hover ends")} /> - * ``` - */ - onHoverEnd?(event: PointerEvent, info: EventInfo): void; -} -/** - * Passed in to tap event handlers like `onTap` the `TapInfo` object contains - * information about the tap gesture such as it‘s location. - * - * ```jsx - * function onTap(event, info) { - * console.log(info.point.x, info.point.y) - * } - * - * - * ``` - * - * @public - */ -interface TapInfo { - /** - * Contains `x` and `y` values for the tap gesture relative to the - * device or page. - * - * ```jsx - * function onTapStart(event, info) { - * console.log(info.point.x, info.point.y) - * } - * - * - * ``` - * - * @public - */ - point: Point; -} -interface MotionNodeTapHandlers { - /** - * Callback when the tap gesture successfully ends on this element. - * - * ```jsx - * function onTap(event, info) { - * console.log(info.point.x, info.point.y) - * } - * - * - * ``` - * - * @param event - The originating pointer event. - * @param info - An {@link TapInfo} object containing `x` and `y` values for the `point` relative to the device or page. - */ - onTap?(event: MouseEvent | TouchEvent | PointerEvent, info: TapInfo): void; - /** - * Callback when the tap gesture starts on this element. - * - * ```jsx - * function onTapStart(event, info) { - * console.log(info.point.x, info.point.y) - * } - * - * - * ``` - * - * @param event - The originating pointer event. - * @param info - An {@link TapInfo} object containing `x` and `y` values for the `point` relative to the device or page. - */ - onTapStart?(event: MouseEvent | TouchEvent | PointerEvent, info: TapInfo): void; - /** - * Callback when the tap gesture ends outside this element. - * - * ```jsx - * function onTapCancel(event, info) { - * console.log(info.point.x, info.point.y) - * } - * - * - * ``` - * - * @param event - The originating pointer event. - * @param info - An {@link TapInfo} object containing `x` and `y` values for the `point` relative to the device or page. - */ - onTapCancel?(event: MouseEvent | TouchEvent | PointerEvent, info: TapInfo): void; - /** - * Properties or variant label to animate to while the component is pressed. - * - * ```jsx - * - * ``` - */ - whileTap?: VariantLabels | TargetAndTransition; - /** - * If `true`, the tap gesture will attach its start listener to window. - * - * Note: This is not supported publically. - */ - globalTapTarget?: boolean; -} -/** - * @deprecated - Use MotionNodeTapHandlers - */ -interface TapHandlers extends MotionNodeTapHandlers { -} -interface MotionNodeFocusHandlers { - /** - * Properties or variant label to animate to while the focus gesture is recognised. - * - * ```jsx - * - * ``` - */ - whileFocus?: VariantLabels | TargetAndTransition; -} -/** - * TODO: Replace with types from inView() - */ -type ViewportEventHandler = (entry: IntersectionObserverEntry | null) => void; -interface ViewportOptions { - root?: { - current: Element | null; - }; - once?: boolean; - margin?: string; - amount?: "some" | "all" | number; -} -interface MotionNodeViewportOptions { - whileInView?: VariantLabels | TargetAndTransition; - onViewportEnter?: ViewportEventHandler; - onViewportLeave?: ViewportEventHandler; - viewport?: ViewportOptions; -} -interface MotionNodeDraggableOptions { - /** - * Enable dragging for this element. Set to `false` by default. - * Set `true` to drag in both directions. - * Set `"x"` or `"y"` to only drag in a specific direction. - * - * ```jsx - * - * ``` - */ - drag?: boolean | "x" | "y"; - /** - * Properties or variant label to animate to while the drag gesture is recognised. - * - * ```jsx - * - * ``` - */ - whileDrag?: VariantLabels | TargetAndTransition; - /** - * If `true`, this will lock dragging to the initially-detected direction. Defaults to `false`. - * - * ```jsx - * - * ``` - */ - dragDirectionLock?: boolean; - /** - * Allows drag gesture propagation to child components. Set to `false` by - * default. - * - * ```jsx - * - * ``` - */ - dragPropagation?: boolean; - /** - * Applies constraints on the permitted draggable area. - * - * It can accept an object of optional `top`, `left`, `right`, and `bottom` values, measured in pixels. - * This will define a distance from the named edge of the draggable component. - * - * Alternatively, it can accept a `ref` to another component created with React's `useRef` hook. - * This `ref` should be passed both to the draggable component's `dragConstraints` prop, and the `ref` - * of the component you want to use as constraints. - * - * ```jsx - * // In pixels - * - * - * // As a ref to another component - * const MyComponent = () => { - * const constraintsRef = useRef(null) - * - * return ( - * - * - * - * ) - * } - * ``` - */ - dragConstraints?: false | Partial | { - current: Element | null; - }; - /** - * The degree of movement allowed outside constraints. 0 = no movement, 1 = - * full movement. - * - * Set to `0.5` by default. Can also be set as `false` to disable movement. - * - * By passing an object of `top`/`right`/`bottom`/`left`, individual values can be set - * per constraint. Any missing values will be set to `0`. - * - * ```jsx - * - * ``` - */ - dragElastic?: DragElastic; - /** - * Apply momentum from the pan gesture to the component when dragging - * finishes. Set to `true` by default. - * - * ```jsx - * - * ``` - */ - dragMomentum?: boolean; - /** - * Allows you to change dragging inertia parameters. - * When releasing a draggable Frame, an animation with type `inertia` starts. The animation is based on your dragging velocity. This property allows you to customize it. - * See {@link https://motion.dev/docs/react-motion-component#dragtransition | Inertia} for all properties you can use. - * - * ```jsx - * - * ``` - */ - dragTransition?: InertiaOptions; - /** - * Usually, dragging is initiated by pressing down on a component and moving it. For some - * use-cases, for instance clicking at an arbitrary point on a video scrubber, we - * might want to initiate dragging from a different component than the draggable one. - * - * By creating a `dragControls` using the `useDragControls` hook, we can pass this into - * the draggable component's `dragControls` prop. It exposes a `start` method - * that can start dragging from pointer events on other components. - * - * ```jsx - * const dragControls = useDragControls() - * - * function startDrag(event) { - * dragControls.start(event, { snapToCursor: true }) - * } - * - * return ( - * <> - *
- * - * - * ) - * ``` - */ - dragControls?: any; - /** - * If `true`, element will snap back to its origin when dragging ends. - * Set to `"x"` or `"y"` to only snap back on a specific axis. - * - * Enabling this is the equivalent of setting all `dragConstraints` axes to `0` - * with `dragElastic={1}`, but when used together `dragConstraints` can define - * a wider draggable area and `dragSnapToOrigin` will ensure the element - * animates back to its origin on release. - */ - dragSnapToOrigin?: boolean | "x" | "y"; - /** - * By default, if `drag` is defined on a component then an event listener will be attached - * to automatically initiate dragging when a user presses down on it. - * - * By setting `dragListener` to `false`, this event listener will not be created. - * - * ```jsx - * const dragControls = useDragControls() - * - * function startDrag(event) { - * dragControls.start(event, { snapToCursor: true }) - * } - * - * return ( - * <> - *
- * - * - * ) - * ``` - */ - dragListener?: boolean; - /** - * If `dragConstraints` is set to a React ref, this callback will call with the measured drag constraints. - * - * @public - */ - onMeasureDragConstraints?: (constraints: BoundingBox) => BoundingBox | void; - /** - * Usually, dragging uses the layout project engine, and applies transforms to the underlying VisualElement. - * Passing MotionValues as _dragX and _dragY instead applies drag updates to these motion values. - * This allows you to manually control how updates from a drag gesture on an element is applied. - * - * @public - */ - _dragX?: MotionValue; - /** - * Usually, dragging uses the layout project engine, and applies transforms to the underlying VisualElement. - * Passing MotionValues as _dragX and _dragY instead applies drag updates to these motion values. - * This allows you to manually control how updates from a drag gesture on an element is applied. - * - * @public - */ - _dragY?: MotionValue; -} -interface MotionNodeDragHandlers { - /** - * Callback function that fires when dragging starts. - * - * ```jsx - * console.log(info.point.x, info.point.y) - * } - * /> - * ``` - * - * @public - */ - onDragStart?(event: MouseEvent | TouchEvent | PointerEvent, info: PanInfo): void; - /** - * Callback function that fires when dragging ends. - * - * ```jsx - * console.log(info.point.x, info.point.y) - * } - * /> - * ``` - * - * @public - */ - onDragEnd?(event: MouseEvent | TouchEvent | PointerEvent, info: PanInfo): void; - /** - * Callback function that fires when the component is dragged. - * - * ```jsx - * console.log(info.point.x, info.point.y) - * } - * /> - * ``` - * - * @public - */ - onDrag?(event: MouseEvent | TouchEvent | PointerEvent, info: PanInfo): void; - /** - * Callback function that fires a drag direction is determined. - * - * ```jsx - * console.log(axis)} - * /> - * ``` - * - * @public - */ - onDirectionLock?(axis: "x" | "y"): void; - /** - * Callback function that fires when drag momentum/bounce transition finishes. - * - * ```jsx - * console.log('Drag transition complete')} - * /> - * ``` - * - * @public - */ - onDragTransitionEnd?(): void; -} -interface MotionNodeLayoutOptions { - /** - * If `true`, this component will automatically animate to its new position when - * its layout changes. - * - * ```jsx - * - * ``` - * - * This will perform a layout animation using performant transforms. Part of this technique - * involved animating an element's scale. This can introduce visual distortions on children, - * `boxShadow` and `borderRadius`. - * - * To correct distortion on immediate children, add `layout` to those too. - * - * `boxShadow` and `borderRadius` will automatically be corrected if they are already being - * animated on this component. Otherwise, set them directly via the `initial` prop. - * - * If `layout` is set to `"position"`, the size of the component will change instantly and - * only its position will animate. - * - * If `layout` is set to `"size"`, the position of the component will change instantly and - * only its size will animate. - * - * If `layout` is set to `"preserve-aspect"`, the component will animate size & position if - * the aspect ratio remains the same between renders, and just position if the ratio changes. - * - * @public - */ - layout?: boolean | "position" | "size" | "preserve-aspect" | "x" | "y"; - /** - * Enable shared layout transitions between different components with the same `layoutId`. - * - * When a component with a layoutId is removed from the React tree, and then - * added elsewhere, it will visually animate from the previous component's bounding box - * and its latest animated values. - * - * ```jsx - * {items.map(item => ( - * - * {item.name} - * {item.isSelected && } - * - * ))} - * ``` - * - * If the previous component remains in the tree it will crossfade with the new component. - * - * @public - */ - layoutId?: string; - /** - * A callback that will fire when a layout animation on this component starts. - * - * @public - */ - onLayoutAnimationStart?(): void; - /** - * A callback that will fire when a layout animation on this component completes. - * - * @public - */ - onLayoutAnimationComplete?(): void; - /** - * @public - */ - layoutDependency?: any; - /** - * Whether a projection node should measure its scroll when it or its descendants update their layout. - * - * @public - */ - layoutScroll?: boolean; - /** - * Whether an element should be considered a "layout root", where - * all children will be forced to resolve relatively to it. - * Currently used for `position: sticky` elements in Framer. - */ - layoutRoot?: boolean; - /** - * The anchor point for relative layout projection. This defines which - * point on the parent is used as the reference for the child's position. - * - * `{ x: 0, y: 0 }` (default) anchors to the top-left corner. - * `{ x: 0.5, y: 0.5 }` anchors to the center, useful for centered layouts - * (e.g., flexbox) to prevent drift during parent layout animations. - * `false` disables relative projection entirely. - */ - layoutAnchor?: { - x: number; - y: number; - } | false; - /** - * Attached to a portal root to ensure we attach the child to the document root and don't - * perform scale correction on it. - */ - "data-framer-portal-id"?: string; - /** - * By default, shared layout elements will crossfade. By setting this - * to `false`, this element will take its default opacity throughout the animation. - */ - layoutCrossfade?: boolean; -} -/** - * @deprecated - Use MotionNodeDragHandlers/MotionNodeDraggableOptions - */ -interface DraggableProps extends MotionNodeDragHandlers, MotionNodeDraggableOptions { -} -type TransformTemplate = (transform: TransformProperties, generatedTransform: string) => string; -interface MotionNodeAdvancedOptions { - /** - * Custom data to use to resolve dynamic variants differently for each animating component. - * - * ```jsx - * const variants = { - * visible: (custom) => ({ - * opacity: 1, - * transition: { delay: custom * 0.2 } - * }) - * } - * - * - * - * - * ``` - * - * @public - */ - custom?: any; - /** - * @public - * Set to `false` to prevent inheriting variant changes from its parent. - */ - inherit?: boolean; - /** - * @public - * Set to `false` to prevent throwing an error when a `motion` component is used within a `LazyMotion` set to strict. - */ - ignoreStrict?: boolean; - /** - * Provide a set of motion values to perform animations on. - */ - values?: { - [key: string]: MotionValue | MotionValue; - }; - /** - * By default, Motion generates a `transform` property with a sensible transform order. `transformTemplate` - * can be used to create a different order, or to append/preprend the automatically generated `transform` property. - * - * ```jsx - * `rotate(${rotate}deg) translateX(${x}px)` - * } - * /> - * ``` - * - * @param transform - The latest animated transform props. - * @param generatedTransform - The transform string as automatically generated by Motion - * - * @public - */ - transformTemplate?: TransformTemplate; - "data-framer-appear-id"?: string; -} -interface PropagateOptions { - /** - * If `false`, this element's tap gesture will prevent any parent - * element's tap gesture handlers (`onTap`, `onTapStart`, `whileTap`) - * from firing. Defaults to `true`. - */ - tap?: boolean; -} -interface MotionNodeOptions extends MotionNodeAnimationOptions, MotionNodeEventOptions, MotionNodePanHandlers, MotionNodeTapHandlers, MotionNodeHoverHandlers, MotionNodeFocusHandlers, MotionNodeViewportOptions, MotionNodeDragHandlers, MotionNodeDraggableOptions, MotionNodeLayoutOptions, MotionNodeAdvancedOptions { - /** - * Controls whether gesture events propagate to parent motion components. - * By default all gestures propagate. Set individual gestures to `false` - * to prevent parent handlers from firing. - * - * ```jsx - * - * - * - * ``` - */ - propagate?: PropagateOptions; -} - -/** - * @public - */ -interface PresenceContextProps { - id: string; - isPresent: boolean; - register: (id: string | number) => () => void; - onExitComplete?: (id: string | number) => void; - initial?: false | VariantLabels; - custom?: any; -} -/** - * @public - */ -type ReducedMotionConfig = "always" | "never" | "user"; -/** - * @public - */ -interface MotionConfigContextProps { - /** - * Internal, exported only for usage in Framer - */ - transformPagePoint: TransformPoint; - /** - * Internal. Determines whether this is a static context ie the Framer canvas. If so, - * it'll disable all dynamic functionality. - */ - isStatic: boolean; - /** - * Defines a new default transition for the entire tree. - * - * @public - */ - transition?: Transition; - /** - * If true, will respect the device prefersReducedMotion setting by switching - * transform animations off. - * - * @public - */ - reducedMotion?: ReducedMotionConfig; - /** - * A custom `nonce` attribute used when wanting to enforce a Content Security Policy (CSP). - * For more details see: - * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/style-src#unsafe_inline_styles - * - * @public - */ - nonce?: string; - /** - * If true, all animations will be skipped and values will be set instantly. - * Useful for E2E tests and visual regression testing. - * - * @public - */ - skipAnimations?: boolean; -} -interface VisualState<_Instance, RenderState> { - latestValues: ResolvedValues$1; - renderState: RenderState; -} -interface VisualElementOptions { - visualState: VisualState; - parent?: any; - variantParent?: any; - presenceContext: PresenceContextProps | null; - props: MotionNodeOptions; - blockInitialAnimation?: boolean; - reducedMotionConfig?: ReducedMotionConfig; - /** - * If true, all animations will be skipped and values will be set instantly. - * Useful for E2E tests and visual regression testing. - */ - skipAnimations?: boolean; - /** - * Explicit override for SVG detection. When true, uses SVG rendering; - * when false, uses HTML rendering. If undefined, auto-detects. - */ - isSVG?: boolean; -} -interface VisualElementEventCallbacks { - BeforeLayoutMeasure: () => void; - LayoutMeasure: (layout: Box, prevLayout?: Box) => void; - LayoutUpdate: (layout: Axis, prevLayout: Axis) => void; - Update: (latest: ResolvedValues$1) => void; - AnimationStart: (definition: AnimationDefinition) => void; - AnimationComplete: (definition: AnimationDefinition) => void; - LayoutAnimationStart: () => void; - LayoutAnimationComplete: () => void; - SetAxisTarget: () => void; - Unmount: () => void; -} -interface LayoutLifecycles { - onBeforeLayoutMeasure?(box: Box): void; - onLayoutMeasure?(box: Box, prevBox: Box): void; -} -type ScrapeMotionValuesFromProps = (props: MotionNodeOptions, prevProps: MotionNodeOptions, visualElement?: any) => { - [key: string]: MotionValue | AnyResolvedKeyframe; -}; -type UseRenderState = () => RenderState; -/** - * Animation type for variant state management - */ -type AnimationType = "animate" | "whileHover" | "whileTap" | "whileDrag" | "whileFocus" | "whileInView" | "exit"; -interface FeatureClass { - new (props: Props): any; -} -interface FeatureDefinition { - isEnabled: (props: MotionNodeOptions) => boolean; - Feature?: FeatureClass; - ProjectionNode?: any; - MeasureLayout?: any; -} -type FeatureDefinitions = { - animation?: FeatureDefinition; - exit?: FeatureDefinition; - drag?: FeatureDefinition; - tap?: FeatureDefinition; - focus?: FeatureDefinition; - hover?: FeatureDefinition; - pan?: FeatureDefinition; - inView?: FeatureDefinition; - layout?: FeatureDefinition; -}; - -interface TransformOrigin { - originX?: number | string; - originY?: number | string; - originZ?: number | string; -} -interface HTMLRenderState { - /** - * A mutable record of transforms we want to apply directly to the rendered Element - * every frame. We use a mutable data structure to reduce GC during animations. - */ - transform: ResolvedValues$1; - /** - * A mutable record of transform origins we want to apply directly to the rendered Element - * every frame. We use a mutable data structure to reduce GC during animations. - */ - transformOrigin: TransformOrigin; - /** - * A mutable record of styles we want to apply directly to the rendered Element - * every frame. We use a mutable data structure to reduce GC during animations. - */ - style: ResolvedValues$1; - /** - * A mutable record of CSS variables we want to apply directly to the rendered Element - * every frame. We use a mutable data structure to reduce GC during animations. - */ - vars: ResolvedValues$1; -} - -interface SVGRenderState extends HTMLRenderState { - /** - * A mutable record of attributes we want to apply directly to the rendered Element - * every frame. We use a mutable data structure to reduce GC during animations. - */ - attrs: ResolvedValues$1; -} -interface SVGAttributes { - accentHeight?: AnyResolvedKeyframe | undefined; - accumulate?: "none" | "sum" | undefined; - additive?: "replace" | "sum" | undefined; - alignmentBaseline?: "auto" | "baseline" | "before-edge" | "text-before-edge" | "middle" | "central" | "after-edge" | "text-after-edge" | "ideographic" | "alphabetic" | "hanging" | "mathematical" | "inherit" | undefined; - allowReorder?: "no" | "yes" | undefined; - alphabetic?: AnyResolvedKeyframe | undefined; - amplitude?: AnyResolvedKeyframe | undefined; - arabicForm?: "initial" | "medial" | "terminal" | "isolated" | undefined; - ascent?: AnyResolvedKeyframe | undefined; - attributeName?: string | undefined; - attributeType?: string | undefined; - autoReverse?: boolean | undefined; - azimuth?: AnyResolvedKeyframe | undefined; - baseFrequency?: AnyResolvedKeyframe | undefined; - baselineShift?: AnyResolvedKeyframe | undefined; - baseProfile?: AnyResolvedKeyframe | undefined; - bbox?: AnyResolvedKeyframe | undefined; - begin?: AnyResolvedKeyframe | undefined; - bias?: AnyResolvedKeyframe | undefined; - by?: AnyResolvedKeyframe | undefined; - calcMode?: AnyResolvedKeyframe | undefined; - capHeight?: AnyResolvedKeyframe | undefined; - clip?: AnyResolvedKeyframe | undefined; - clipPath?: string | undefined; - clipPathUnits?: AnyResolvedKeyframe | undefined; - clipRule?: AnyResolvedKeyframe | undefined; - colorInterpolation?: AnyResolvedKeyframe | undefined; - colorInterpolationFilters?: "auto" | "sRGB" | "linearRGB" | "inherit" | undefined; - colorProfile?: AnyResolvedKeyframe | undefined; - colorRendering?: AnyResolvedKeyframe | undefined; - contentScriptType?: AnyResolvedKeyframe | undefined; - contentStyleType?: AnyResolvedKeyframe | undefined; - cursor?: AnyResolvedKeyframe | undefined; - cx?: AnyResolvedKeyframe | undefined; - cy?: AnyResolvedKeyframe | undefined; - d?: string | undefined; - decelerate?: AnyResolvedKeyframe | undefined; - descent?: AnyResolvedKeyframe | undefined; - diffuseConstant?: AnyResolvedKeyframe | undefined; - direction?: AnyResolvedKeyframe | undefined; - display?: AnyResolvedKeyframe | undefined; - divisor?: AnyResolvedKeyframe | undefined; - dominantBaseline?: AnyResolvedKeyframe | undefined; - dur?: AnyResolvedKeyframe | undefined; - dx?: AnyResolvedKeyframe | undefined; - dy?: AnyResolvedKeyframe | undefined; - edgeMode?: AnyResolvedKeyframe | undefined; - elevation?: AnyResolvedKeyframe | undefined; - enableBackground?: AnyResolvedKeyframe | undefined; - end?: AnyResolvedKeyframe | undefined; - exponent?: AnyResolvedKeyframe | undefined; - externalResourcesRequired?: boolean | undefined; - fill?: string | undefined; - fillOpacity?: AnyResolvedKeyframe | undefined; - fillRule?: "nonzero" | "evenodd" | "inherit" | undefined; - filter?: string | undefined; - filterRes?: AnyResolvedKeyframe | undefined; - filterUnits?: AnyResolvedKeyframe | undefined; - floodColor?: AnyResolvedKeyframe | undefined; - floodOpacity?: AnyResolvedKeyframe | undefined; - focusable?: boolean | "auto" | undefined; - fontFamily?: string | undefined; - fontSize?: AnyResolvedKeyframe | undefined; - fontSizeAdjust?: AnyResolvedKeyframe | undefined; - fontStretch?: AnyResolvedKeyframe | undefined; - fontStyle?: AnyResolvedKeyframe | undefined; - fontVariant?: AnyResolvedKeyframe | undefined; - fontWeight?: AnyResolvedKeyframe | undefined; - format?: AnyResolvedKeyframe | undefined; - fr?: AnyResolvedKeyframe | undefined; - from?: AnyResolvedKeyframe | undefined; - fx?: AnyResolvedKeyframe | undefined; - fy?: AnyResolvedKeyframe | undefined; - g1?: AnyResolvedKeyframe | undefined; - g2?: AnyResolvedKeyframe | undefined; - glyphName?: AnyResolvedKeyframe | undefined; - glyphOrientationHorizontal?: AnyResolvedKeyframe | undefined; - glyphOrientationVertical?: AnyResolvedKeyframe | undefined; - glyphRef?: AnyResolvedKeyframe | undefined; - gradientTransform?: string | undefined; - gradientUnits?: string | undefined; - hanging?: AnyResolvedKeyframe | undefined; - horizAdvX?: AnyResolvedKeyframe | undefined; - horizOriginX?: AnyResolvedKeyframe | undefined; - href?: string | undefined; - ideographic?: AnyResolvedKeyframe | undefined; - imageRendering?: AnyResolvedKeyframe | undefined; - in2?: AnyResolvedKeyframe | undefined; - in?: string | undefined; - intercept?: AnyResolvedKeyframe | undefined; - k1?: AnyResolvedKeyframe | undefined; - k2?: AnyResolvedKeyframe | undefined; - k3?: AnyResolvedKeyframe | undefined; - k4?: AnyResolvedKeyframe | undefined; - k?: AnyResolvedKeyframe | undefined; - kernelMatrix?: AnyResolvedKeyframe | undefined; - kernelUnitLength?: AnyResolvedKeyframe | undefined; - kerning?: AnyResolvedKeyframe | undefined; - keyPoints?: AnyResolvedKeyframe | undefined; - keySplines?: AnyResolvedKeyframe | undefined; - keyTimes?: AnyResolvedKeyframe | undefined; - lengthAdjust?: AnyResolvedKeyframe | undefined; - letterSpacing?: AnyResolvedKeyframe | undefined; - lightingColor?: AnyResolvedKeyframe | undefined; - limitingConeAngle?: AnyResolvedKeyframe | undefined; - local?: AnyResolvedKeyframe | undefined; - markerEnd?: string | undefined; - markerHeight?: AnyResolvedKeyframe | undefined; - markerMid?: string | undefined; - markerStart?: string | undefined; - markerUnits?: AnyResolvedKeyframe | undefined; - markerWidth?: AnyResolvedKeyframe | undefined; - mask?: string | undefined; - maskContentUnits?: AnyResolvedKeyframe | undefined; - maskUnits?: AnyResolvedKeyframe | undefined; - mathematical?: AnyResolvedKeyframe | undefined; - mode?: AnyResolvedKeyframe | undefined; - numOctaves?: AnyResolvedKeyframe | undefined; - offset?: AnyResolvedKeyframe | undefined; - opacity?: AnyResolvedKeyframe | undefined; - operator?: AnyResolvedKeyframe | undefined; - order?: AnyResolvedKeyframe | undefined; - orient?: AnyResolvedKeyframe | undefined; - orientation?: AnyResolvedKeyframe | undefined; - origin?: AnyResolvedKeyframe | undefined; - overflow?: AnyResolvedKeyframe | undefined; - overlinePosition?: AnyResolvedKeyframe | undefined; - overlineThickness?: AnyResolvedKeyframe | undefined; - paintOrder?: AnyResolvedKeyframe | undefined; - panose1?: AnyResolvedKeyframe | undefined; - path?: string | undefined; - pathLength?: AnyResolvedKeyframe | undefined; - patternContentUnits?: string | undefined; - patternTransform?: AnyResolvedKeyframe | undefined; - patternUnits?: string | undefined; - pointerEvents?: AnyResolvedKeyframe | undefined; - points?: string | undefined; - pointsAtX?: AnyResolvedKeyframe | undefined; - pointsAtY?: AnyResolvedKeyframe | undefined; - pointsAtZ?: AnyResolvedKeyframe | undefined; - preserveAlpha?: boolean | undefined; - preserveAspectRatio?: string | undefined; - primitiveUnits?: AnyResolvedKeyframe | undefined; - r?: AnyResolvedKeyframe | undefined; - radius?: AnyResolvedKeyframe | undefined; - refX?: AnyResolvedKeyframe | undefined; - refY?: AnyResolvedKeyframe | undefined; - renderingIntent?: AnyResolvedKeyframe | undefined; - repeatCount?: AnyResolvedKeyframe | undefined; - repeatDur?: AnyResolvedKeyframe | undefined; - requiredExtensions?: AnyResolvedKeyframe | undefined; - requiredFeatures?: AnyResolvedKeyframe | undefined; - restart?: AnyResolvedKeyframe | undefined; - result?: string | undefined; - rotate?: AnyResolvedKeyframe | undefined; - rx?: AnyResolvedKeyframe | undefined; - ry?: AnyResolvedKeyframe | undefined; - scale?: AnyResolvedKeyframe | undefined; - seed?: AnyResolvedKeyframe | undefined; - shapeRendering?: AnyResolvedKeyframe | undefined; - slope?: AnyResolvedKeyframe | undefined; - spacing?: AnyResolvedKeyframe | undefined; - specularConstant?: AnyResolvedKeyframe | undefined; - specularExponent?: AnyResolvedKeyframe | undefined; - speed?: AnyResolvedKeyframe | undefined; - spreadMethod?: string | undefined; - startOffset?: AnyResolvedKeyframe | undefined; - stdDeviation?: AnyResolvedKeyframe | undefined; - stemh?: AnyResolvedKeyframe | undefined; - stemv?: AnyResolvedKeyframe | undefined; - stitchTiles?: AnyResolvedKeyframe | undefined; - stopColor?: string | undefined; - stopOpacity?: AnyResolvedKeyframe | undefined; - strikethroughPosition?: AnyResolvedKeyframe | undefined; - strikethroughThickness?: AnyResolvedKeyframe | undefined; - string?: AnyResolvedKeyframe | undefined; - stroke?: string | undefined; - strokeDasharray?: AnyResolvedKeyframe | undefined; - strokeDashoffset?: AnyResolvedKeyframe | undefined; - strokeLinecap?: "butt" | "round" | "square" | "inherit" | undefined; - strokeLinejoin?: "miter" | "round" | "bevel" | "inherit" | undefined; - strokeMiterlimit?: AnyResolvedKeyframe | undefined; - strokeOpacity?: AnyResolvedKeyframe | undefined; - strokeWidth?: AnyResolvedKeyframe | undefined; - surfaceScale?: AnyResolvedKeyframe | undefined; - systemLanguage?: AnyResolvedKeyframe | undefined; - tableValues?: AnyResolvedKeyframe | undefined; - targetX?: AnyResolvedKeyframe | undefined; - targetY?: AnyResolvedKeyframe | undefined; - textAnchor?: string | undefined; - textDecoration?: AnyResolvedKeyframe | undefined; - textLength?: AnyResolvedKeyframe | undefined; - textRendering?: AnyResolvedKeyframe | undefined; - to?: AnyResolvedKeyframe | undefined; - transform?: string | undefined; - u1?: AnyResolvedKeyframe | undefined; - u2?: AnyResolvedKeyframe | undefined; - underlinePosition?: AnyResolvedKeyframe | undefined; - underlineThickness?: AnyResolvedKeyframe | undefined; - unicode?: AnyResolvedKeyframe | undefined; - unicodeBidi?: AnyResolvedKeyframe | undefined; - unicodeRange?: AnyResolvedKeyframe | undefined; - unitsPerEm?: AnyResolvedKeyframe | undefined; - vAlphabetic?: AnyResolvedKeyframe | undefined; - values?: string | undefined; - vectorEffect?: AnyResolvedKeyframe | undefined; - version?: string | undefined; - vertAdvY?: AnyResolvedKeyframe | undefined; - vertOriginX?: AnyResolvedKeyframe | undefined; - vertOriginY?: AnyResolvedKeyframe | undefined; - vHanging?: AnyResolvedKeyframe | undefined; - vIdeographic?: AnyResolvedKeyframe | undefined; - viewBox?: string | undefined; - viewTarget?: AnyResolvedKeyframe | undefined; - visibility?: AnyResolvedKeyframe | undefined; - vMathematical?: AnyResolvedKeyframe | undefined; - widths?: AnyResolvedKeyframe | undefined; - wordSpacing?: AnyResolvedKeyframe | undefined; - writingMode?: AnyResolvedKeyframe | undefined; - x1?: AnyResolvedKeyframe | undefined; - x2?: AnyResolvedKeyframe | undefined; - x?: AnyResolvedKeyframe | undefined; - xChannelSelector?: string | undefined; - xHeight?: AnyResolvedKeyframe | undefined; - xlinkActuate?: string | undefined; - xlinkArcrole?: string | undefined; - xlinkHref?: string | undefined; - xlinkRole?: string | undefined; - xlinkShow?: string | undefined; - xlinkTitle?: string | undefined; - xlinkType?: string | undefined; - xmlBase?: string | undefined; - xmlLang?: string | undefined; - xmlns?: string | undefined; - xmlnsXlink?: string | undefined; - xmlSpace?: string | undefined; - y1?: AnyResolvedKeyframe | undefined; - y2?: AnyResolvedKeyframe | undefined; - y?: AnyResolvedKeyframe | undefined; - yChannelSelector?: string | undefined; - z?: AnyResolvedKeyframe | undefined; - zoomAndPan?: string | undefined; -} - -interface VisualElementAnimationOptions { - delay?: number; - transitionOverride?: Transition; - custom?: any; - type?: AnimationType; -} - -interface AnimationState$1 { - animateChanges: (type?: AnimationType) => Promise; - setActive: (type: AnimationType, isActive: boolean, options?: VisualElementAnimationOptions) => Promise; - setAnimateFunction: (fn: any) => void; - getState: () => { - [key: string]: AnimationTypeState; - }; - reset: () => void; -} -type AnimationList = string[] | TargetAndTransition[]; -declare function createAnimationState(visualElement: any): AnimationState$1; -declare function checkVariantsDidChange(prev: any, next: any): boolean; -interface AnimationTypeState { - isActive: boolean; - protectedKeys: { - [key: string]: true; - }; - needsAnimating: { - [key: string]: boolean; - }; - prevResolvedValues: { - [key: string]: any; - }; - prevProp?: VariantLabels | TargetAndTransition; -} - -/** - * Set feature definitions for all VisualElements. - * This should be called by the framework layer (e.g., framer-motion) during initialization. - */ -declare function setFeatureDefinitions(definitions: Partial): void; -/** - * Get the current feature definitions - */ -declare function getFeatureDefinitions(): Partial; -/** - * Motion style type - a subset of CSS properties that can contain motion values - */ -type MotionStyle = { - [K: string]: AnyResolvedKeyframe | MotionValue | undefined; -}; -/** - * A VisualElement is an imperative abstraction around UI elements such as - * HTMLElement, SVGElement, Three.Object3D etc. - */ -declare abstract class VisualElement { - /** - * VisualElements are arranged in trees mirroring that of the React tree. - * Each type of VisualElement has a unique name, to detect when we're crossing - * type boundaries within that tree. - */ - abstract type: string; - /** - * An `Array.sort` compatible function that will compare two Instances and - * compare their respective positions within the tree. - */ - abstract sortInstanceNodePosition(a: Instance, b: Instance): number; - /** - * Measure the viewport-relative bounding box of the Instance. - */ - abstract measureInstanceViewportBox(instance: Instance, props: MotionNodeOptions & Partial): Box; - /** - * When a value has been removed from all animation props we need to - * pick a target to animate back to. For instance, for HTMLElements - * we can look in the style prop. - */ - abstract getBaseTargetFromProps(props: MotionNodeOptions, key: string): AnyResolvedKeyframe | undefined | MotionValue; - /** - * When we first animate to a value we need to animate it *from* a value. - * Often this have been specified via the initial prop but it might be - * that the value needs to be read from the Instance. - */ - abstract readValueFromInstance(instance: Instance, key: string, options: Options): AnyResolvedKeyframe | null | undefined; - /** - * When a value has been removed from the VisualElement we use this to remove - * it from the inherting class' unique render state. - */ - abstract removeValueFromRenderState(key: string, renderState: RenderState): void; - /** - * Run before a React or VisualElement render, builds the latest motion - * values into an Instance-specific format. For example, HTMLVisualElement - * will use this step to build `style` and `var` values. - */ - abstract build(renderState: RenderState, latestValues: ResolvedValues$1, props: MotionNodeOptions): void; - /** - * Apply the built values to the Instance. For example, HTMLElements will have - * styles applied via `setProperty` and the style attribute, whereas SVGElements - * will have values applied to attributes. - */ - abstract renderInstance(instance: Instance, renderState: RenderState, styleProp?: MotionStyle, projection?: any): void; - /** - * This method is called when a transform property is bound to a motion value. - * It's currently used to measure SVG elements when a new transform property is bound. - */ - onBindTransform?(): void; - /** - * If the component child is provided as a motion value, handle subscriptions - * with the renderer-specific VisualElement. - */ - handleChildMotionValue?(): void; - /** - * This method takes React props and returns found MotionValues. For example, HTML - * MotionValues will be found within the style prop, whereas for Three.js within attribute arrays. - * - * This isn't an abstract method as it needs calling in the constructor, but it is - * intended to be one. - */ - scrapeMotionValuesFromProps(_props: MotionNodeOptions, _prevProps: MotionNodeOptions, _visualElement: VisualElement): { - [key: string]: MotionValue | AnyResolvedKeyframe; - }; - /** - * A reference to the current underlying Instance, e.g. a HTMLElement - * or Three.Mesh etc. - */ - current: Instance | null; - /** - * A reference to the parent VisualElement (if exists). - */ - parent: VisualElement | undefined; - /** - * A set containing references to this VisualElement's children. - */ - children: Set>; - /** - * A set containing the latest children of this VisualElement. This is flushed - * at the start of every commit. We use it to calculate the stagger delay - * for newly-added children. - */ - enteringChildren?: Set; - /** - * The depth of this VisualElement within the overall VisualElement tree. - */ - depth: number; - /** - * The current render state of this VisualElement. Defined by inherting VisualElements. - */ - renderState: RenderState; - /** - * An object containing the latest static values for each of this VisualElement's - * MotionValues. - */ - latestValues: ResolvedValues$1; - /** - * Determine what role this visual element should take in the variant tree. - */ - isVariantNode: boolean; - isControllingVariants: boolean; - /** - * If this component is part of the variant tree, it should track - * any children that are also part of the tree. This is essentially - * a shadow tree to simplify logic around how to stagger over children. - */ - variantChildren?: Set; - /** - * Decides whether this VisualElement should animate in reduced motion - * mode. - * - * TODO: This is currently set on every individual VisualElement but feels - * like it could be set globally. - */ - shouldReduceMotion: boolean | null; - /** - * Decides whether animations should be skipped for this VisualElement. - * Useful for E2E tests and visual regression testing. - */ - shouldSkipAnimations: boolean; - /** - * Normally, if a component is controlled by a parent's variants, it can - * rely on that ancestor to trigger animations further down the tree. - * However, if a component is created after its parent is mounted, the parent - * won't trigger that mount animation so the child needs to. - * - * TODO: This might be better replaced with a method isParentMounted - */ - manuallyAnimateOnMount: boolean; - /** - * This can be set by AnimatePresence to force components that mount - * at the same time as it to mount as if they have initial={false} set. - */ - blockInitialAnimation: boolean; - /** - * A reference to this VisualElement's projection node, used in layout animations. - */ - projection?: any; - /** - * A map of all motion values attached to this visual element. Motion - * values are source of truth for any given animated value. A motion - * value might be provided externally by the component via props. - */ - values: Map>; - /** - * The AnimationState, this is hydrated by the animation Feature. - */ - animationState?: AnimationState$1; - KeyframeResolver: typeof KeyframeResolver; - /** - * The options used to create this VisualElement. The Options type is defined - * by the inheriting VisualElement and is passed straight through to the render functions. - */ - readonly options: Options; - /** - * A reference to the latest props provided to the VisualElement's host React component. - */ - props: MotionNodeOptions; - prevProps?: MotionNodeOptions; - presenceContext: PresenceContextProps | null; - prevPresenceContext?: PresenceContextProps | null; - /** - * Cleanup functions for active features (hover/tap/exit etc) - */ - private features; - /** - * A map of every subscription that binds the provided or generated - * motion values onChange listeners to this visual element. - */ - private valueSubscriptions; - /** - * A reference to the ReducedMotionConfig passed to the VisualElement's host React component. - */ - private reducedMotionConfig; - /** - * A reference to the skipAnimations config passed to the VisualElement's host React component. - */ - private skipAnimationsConfig; - /** - * On mount, this will be hydrated with a callback to disconnect - * this visual element from its parent on unmount. - */ - private removeFromVariantTree; - /** - * A reference to the previously-provided motion values as returned - * from scrapeMotionValuesFromProps. We use the keys in here to determine - * if any motion values need to be removed after props are updated. - */ - private prevMotionValues; - /** - * When values are removed from all animation props we need to search - * for a fallback value to animate to. These values are tracked in baseTarget. - */ - private baseTarget; - /** - * Create an object of the values we initially animated from (if initial prop present). - */ - private initialValues; - /** - * Track whether this element has been mounted before, to detect - * remounts after Suspense unmount/remount cycles. - */ - private hasBeenMounted; - /** - * An object containing a SubscriptionManager for each active event. - */ - private events; - /** - * An object containing an unsubscribe function for each prop event subscription. - * For example, every "Update" event can have multiple subscribers via - * VisualElement.on(), but only one of those can be defined via the onUpdate prop. - */ - private propEventSubscriptions; - constructor({ parent, props, presenceContext, reducedMotionConfig, skipAnimations, blockInitialAnimation, visualState, }: VisualElementOptions, options?: Options); - mount(instance: Instance): void; - unmount(): void; - addChild(child: VisualElement): void; - removeChild(child: VisualElement): void; - private bindToMotionValue; - sortNodePosition(other: VisualElement): number; - updateFeatures(): void; - notifyUpdate: () => void; - triggerBuild(): void; - render: () => void; - private renderScheduledAt; - scheduleRender: () => void; - /** - * Measure the current viewport box with or without transforms. - * Only measures axis-aligned boxes, rotate and skew must be manually - * removed with a re-render to work. - */ - measureViewportBox(): Box; - getStaticValue(key: string): AnyResolvedKeyframe; - setStaticValue(key: string, value: AnyResolvedKeyframe): void; - /** - * Update the provided props. Ensure any newly-added motion values are - * added to our map, old ones removed, and listeners updated. - */ - update(props: MotionNodeOptions, presenceContext: PresenceContextProps | null): void; - getProps(): MotionNodeOptions; - /** - * Returns the variant definition with a given name. - */ - getVariant(name: string): Variant | undefined; - /** - * Returns the defined default transition on this component. - */ - getDefaultTransition(): Transition | undefined; - getTransformPagePoint(): any; - getClosestVariantNode(): VisualElement | undefined; - /** - * Add a child visual element to our set of children. - */ - addVariantChild(child: VisualElement): (() => boolean) | undefined; - /** - * Add a motion value and bind it to this visual element. - */ - addValue(key: string, value: MotionValue): void; - /** - * Remove a motion value and unbind any active subscriptions. - */ - removeValue(key: string): void; - /** - * Check whether we have a motion value for this key - */ - hasValue(key: string): boolean; - /** - * Get a motion value for this key. If called with a default - * value, we'll create one if none exists. - */ - getValue(key: string): MotionValue | undefined; - getValue(key: string, defaultValue: AnyResolvedKeyframe | null): MotionValue; - /** - * If we're trying to animate to a previously unencountered value, - * we need to check for it in our state and as a last resort read it - * directly from the instance (which might have performance implications). - */ - readValue(key: string, target?: AnyResolvedKeyframe | null): any; - /** - * Set the base target to later animate back to. This is currently - * only hydrated on creation and when we first read a value. - */ - setBaseTarget(key: string, value: AnyResolvedKeyframe): void; - /** - * Find the base target for a value thats been removed from all animation - * props. - */ - getBaseTarget(key: string): ResolvedValues$1[string] | undefined | null; - on(eventName: EventName, callback: VisualElementEventCallbacks[EventName]): VoidFunction; - notify(eventName: EventName, ...args: any): void; - scheduleRenderMicrotask(): void; -} - -/** - * An update function. It accepts a timestamp used to advance the animation. - */ -type Update$1 = (timestamp: number) => void; -/** - * Drivers accept a update function and call it at an interval. This interval - * could be a synchronous loop, a setInterval, or tied to the device's framerate. - */ -interface DriverControls { - start: (keepAlive?: boolean) => void; - stop: () => void; - now: () => number; -} -type Driver = (update: Update$1) => DriverControls; - -/** - * Temporary subset of VisualElement until VisualElement is - * moved to motion-dom - */ -interface WithRender { - render: () => void; - readValue: (name: string, keyframe: any) => any; - getValue: (name: string, defaultValue?: any) => any; - current?: HTMLElement | SVGElement; - measureViewportBox: () => Box; -} - -type AnyResolvedKeyframe = string | number; -interface ProgressTimeline { - currentTime: null | { - value: number; - }; - cancel?: VoidFunction; -} -interface ValueAnimationOptionsWithRenderContext extends ValueAnimationOptions { - KeyframeResolver?: typeof KeyframeResolver; - motionValue?: MotionValue; - element?: WithRender; -} -interface TimelineWithFallback { - timeline?: ProgressTimeline; - rangeStart?: string; - rangeEnd?: string; - observe: (animation: AnimationPlaybackControls) => VoidFunction; -} -/** - * Methods to control an animation. - */ -interface AnimationPlaybackControls { - /** - * The current time of the animation, in seconds. - */ - time: number; - /** - * The playback speed of the animation. - * 1 = normal speed, 2 = double speed, 0.5 = half speed. - */ - speed: number; - /** - * The start time of the animation, in milliseconds. - */ - startTime: number | null; - /** - * The state of the animation. - * - * This is currently for internal use only. - */ - state: AnimationPlayState; - duration: number; - /** - * The duration of the animation, including any delay. - */ - iterationDuration: number; - /** - * Stops the animation at its current state, and prevents it from - * resuming when the animation is played again. - */ - stop: () => void; - /** - * Plays the animation. - */ - play: () => void; - /** - * Pauses the animation. - */ - pause: () => void; - /** - * Completes the animation and applies the final state. - */ - complete: () => void; - /** - * Cancels the animation and applies the initial state. - */ - cancel: () => void; - /** - * Attaches a timeline to the animation, for instance the `ScrollTimeline`. - * - * This is currently for internal use only. - */ - attachTimeline: (timeline: TimelineWithFallback) => VoidFunction; - finished: Promise; -} -type AnimationPlaybackControlsWithThen = AnimationPlaybackControls & { - then: (onResolve: VoidFunction, onReject?: VoidFunction) => Promise; -}; -interface AnimationState { - value: V; - done: boolean; -} -interface KeyframeGenerator { - calculatedDuration: null | number; - next: (t: number) => AnimationState; - velocity?: (t: number) => number; - toString: () => string; -} -interface DOMValueAnimationOptions extends ValueAnimationTransition { - element: HTMLElement | SVGElement; - keyframes: ValueKeyframesDefinition; - name: string; - pseudoElement?: string; - allowFlatten?: boolean; -} -interface ValueAnimationOptions extends ValueAnimationTransition { - keyframes: V[]; - element?: any; - name?: string; - motionValue?: MotionValue; - from?: any; - isHandoff?: boolean; - allowFlatten?: boolean; - finalKeyframe?: V; -} -type GeneratorFactoryFunction = (options: ValueAnimationOptions) => KeyframeGenerator; -interface GeneratorFactory extends GeneratorFactoryFunction { - applyToOptions?: (options: Transition) => Transition; -} -type AnimationGeneratorName = "decay" | "spring" | "keyframes" | "tween" | "inertia"; -type AnimationGeneratorType = GeneratorFactory | AnimationGeneratorName | false; -interface AnimationPlaybackLifecycles { - onUpdate?: (latest: V) => void; - onPlay?: () => void; - onComplete?: () => void; - onRepeat?: () => void; - onStop?: () => void; -} -interface ValueAnimationTransition extends ValueTransition, AnimationPlaybackLifecycles { - isSync?: boolean; -} -type RepeatType = "loop" | "reverse" | "mirror"; -interface AnimationPlaybackOptions { - /** - * The number of times to repeat the transition. Set to `Infinity` for perpetual repeating. - * - * Without setting `repeatType`, this will loop the animation. - * - * @public - */ - repeat?: number; - /** - * How to repeat the animation. This can be either: - * - * "loop": Repeats the animation from the start - * - * "reverse": Alternates between forward and backwards playback - * - * "mirror": Switches `from` and `to` alternately - * - * @public - */ - repeatType?: RepeatType; - /** - * When repeating an animation, `repeatDelay` will set the - * duration of the time to wait, in seconds, between each repetition. - * - * @public - */ - repeatDelay?: number; -} -interface VelocityOptions { - velocity?: number; - /** - * End animation if absolute speed (in units per second) drops below this - * value and delta is smaller than `restDelta`. Set to `0.01` by default. - * - * @public - */ - restSpeed?: number; - /** - * End animation if distance is below this value and speed is below - * `restSpeed`. When animation ends, spring gets "snapped" to. Set to - * `0.01` by default. - * - * @public - */ - restDelta?: number; -} -interface DurationSpringOptions { - /** - * The total duration of the animation. Set to `0.3` by default. - * - * @public - */ - duration?: number; - /** - * If visualDuration is set, this will override duration. - * - * The visual duration is a time, set in seconds, that the animation will take to visually appear to reach its target. - * - * In other words, the bulk of the transition will occur before this time, and the "bouncy bit" will mostly happen after. - * - * This makes it easier to edit a spring, as well as visually coordinate it with other time-based animations. - * - * @public - */ - visualDuration?: number; - /** - * `bounce` determines the "bounciness" of a spring animation. - * - * `0` is no bounce, and `1` is extremely bouncy. - * - * If `duration` is set, this defaults to `0.25`. - * - * Note: `bounce` and `duration` will be overridden if `stiffness`, `damping` or `mass` are set. - * - * @public - */ - bounce?: number; -} -interface SpringOptions extends DurationSpringOptions, VelocityOptions { - /** - * Stiffness of the spring. Higher values will create more sudden movement. - * Set to `100` by default. - * - * @default 100 - * - * @public - */ - stiffness?: number; - /** - * Strength of opposing force. If set to 0, spring will oscillate - * indefinitely. Set to `10` by default. - * - * @default 10 - * - * @public - */ - damping?: number; - /** - * Mass of the moving object. Higher values will result in more lethargic - * movement. Set to `1` by default. - * - * @default 1 - * - * @public - */ - mass?: number; -} -/** - * @deprecated Use SpringOptions instead - */ -interface Spring extends SpringOptions { -} -interface DecayOptions extends VelocityOptions { - keyframes?: number[]; - /** - * A higher power value equals a further target. Set to `0.8` by default. - * - * @public - */ - power?: number; - /** - * Adjusting the time constant will change the duration of the - * deceleration, thereby affecting its feel. Set to `700` by default. - * - * @public - */ - timeConstant?: number; - /** - * A function that receives the automatically-calculated target and returns a new one. Useful for snapping the target to a grid. - * - * @public - */ - modifyTarget?: (v: number) => number; -} -interface InertiaOptions extends DecayOptions { - /** - * If `min` or `max` is set, this affects the stiffness of the bounce - * spring. Higher values will create more sudden movement. Set to `500` by - * default. - * - * @public - */ - bounceStiffness?: number; - /** - * If `min` or `max` is set, this affects the damping of the bounce spring. - * If set to `0`, spring will oscillate indefinitely. Set to `10` by - * default. - * - * @public - */ - bounceDamping?: number; - /** - * Minimum constraint. If set, the value will "bump" against this value (or immediately spring to it if the animation starts as less than this value). - * - * @public - */ - min?: number; - /** - * Maximum constraint. If set, the value will "bump" against this value (or immediately snap to it, if the initial animation value exceeds this value). - * - * @public - */ - max?: number; -} -interface AnimationOrchestrationOptions { - /** - * Delay the animation by this duration (in seconds). Defaults to `0`. - * - * @public - */ - delay?: number; - /** - * Describes the relationship between the transition and its children. Set - * to `false` by default. - * - * @remarks - * When using variants, the transition can be scheduled in relation to its - * children with either `"beforeChildren"` to finish this transition before - * starting children transitions, `"afterChildren"` to finish children - * transitions before starting this transition. - * - * @public - */ - when?: false | "beforeChildren" | "afterChildren" | string; - /** - * When using variants, children animations will start after this duration - * (in seconds). You can add the `transition` property to both the `motion.div` and the - * `variant` directly. Adding it to the `variant` generally offers more flexibility, - * as it allows you to customize the delay per visual state. - * - * @public - */ - delayChildren?: number | DynamicOption; - /** - * When using variants, animations of child components can be staggered by this - * duration (in seconds). - * - * For instance, if `staggerChildren` is `0.01`, the first child will be - * delayed by `0` seconds, the second by `0.01`, the third by `0.02` and so - * on. - * - * The calculated stagger delay will be added to `delayChildren`. - * - * @deprecated - Use `delayChildren: stagger(interval)` instead. - */ - staggerChildren?: number; - /** - * The direction in which to stagger children. - * - * A value of `1` staggers from the first to the last while `-1` - * staggers from the last to the first. - * - * @deprecated - Use `delayChildren: stagger(interval, { from: "last" })` instead. - */ - staggerDirection?: number; -} -interface KeyframeOptions { - /** - * The total duration of the animation. Set to `0.3` by default. - * - * @public - */ - duration?: number; - ease?: Easing | Easing[]; - times?: number[]; -} -interface ValueTransition extends AnimationOrchestrationOptions, AnimationPlaybackOptions, Omit, Omit, KeyframeOptions { - /** - * Delay the animation by this duration (in seconds). Defaults to `0`. - * - * @public - */ - delay?: number; - /** - * The duration of time already elapsed in the animation. Set to `0` by - * default. - */ - elapsed?: number; - driver?: Driver; - /** - * Type of animation to use. - * - * - "tween": Duration-based animation with ease curve - * - "spring": Physics or duration-based spring animation - * - false: Use an instant animation - */ - type?: AnimationGeneratorType; - /** - * The duration of the tween animation. Set to `0.3` by default, 0r `0.8` if animating a series of keyframes. - * - * @public - */ - duration?: number; - autoplay?: boolean; - startTime?: number; - from?: any; - /** - * If true, this transition will shallow-merge with its parent transition - * instead of replacing it. Inner keys win. - * - * @public - */ - inherit?: boolean; - /** - * If true, the animation skips straight to its final value instead of - * tweening. Used by `MotionConfig`'s `skipAnimations` to opt entire - * subtrees out of animation (e.g. for E2E screenshot stability). - * - * @public - */ - skipAnimations?: boolean; - /** - * The path the element travels between its old and new x/y positions. - * Slot in a path factory (e.g. `arc()`) to swap the default - * straight-line interpolation for something curved. - * - * Can be used in keyframe animations (`transition.path`) and layout - * animations (`transition.layout.path`), including with `useAnimate`. - * - * @public - */ - path?: MotionPath; -} -/** - * @deprecated Use KeyframeOptions instead - */ -interface Tween extends KeyframeOptions { -} -type SVGForcedAttrTransitions = { - [K in keyof SVGForcedAttrProperties]: ValueTransition; -}; -type SVGPathTransitions = { - [K in keyof SVGPathProperties]: ValueTransition; -}; -type SVGTransitions = { - [K in keyof Omit]: ValueTransition; -}; -interface VariableTransitions { - [key: `--${string}`]: ValueTransition; -} -type StyleTransitions = { - [K in keyof CSSStyleDeclarationWithTransform]?: ValueTransition; -}; -type ValueKeyframe = T; -type UnresolvedValueKeyframe = ValueKeyframe | null; -type ResolvedValueKeyframe = ValueKeyframe | ValueKeyframe[]; -type ValueKeyframesDefinition = ValueKeyframe | ValueKeyframe[] | UnresolvedValueKeyframe[]; -type StyleKeyframesDefinition = { - [K in keyof CSSStyleDeclarationWithTransform]?: ValueKeyframesDefinition; -}; -type SVGKeyframesDefinition = { - [K in keyof Omit]?: ValueKeyframesDefinition; -}; -interface VariableKeyframesDefinition { - [key: `--${string}`]: ValueKeyframesDefinition; -} -type SVGForcedAttrKeyframesDefinition = { - [K in keyof SVGForcedAttrProperties]?: ValueKeyframesDefinition; -}; -type SVGPathKeyframesDefinition = { - [K in keyof SVGPathProperties]?: ValueKeyframesDefinition; -}; -type DOMKeyframesDefinition = StyleKeyframesDefinition & SVGKeyframesDefinition & SVGPathKeyframesDefinition & SVGForcedAttrKeyframesDefinition & VariableKeyframesDefinition; -interface Target extends DOMKeyframesDefinition { -} -type CSSPropertyKeys = { - [K in keyof CSSStyleDeclaration as K extends string ? CSSStyleDeclaration[K] extends AnyResolvedKeyframe ? K : never : never]: CSSStyleDeclaration[K]; -}; -interface CSSStyleDeclarationWithTransform extends Omit { - x: number | string; - y: number | string; - z: number | string; - originX: number; - originY: number; - originZ: number; - translateX: number | string; - translateY: number | string; - translateZ: number | string; - rotateX: number | string; - rotateY: number | string; - rotateZ: number | string; - scaleX: number; - scaleY: number; - scaleZ: number; - skewX: number | string; - skewY: number | string; - transformPerspective: number; -} -type TransitionWithValueOverrides = ValueAnimationTransition & StyleTransitions & SVGPathTransitions & SVGForcedAttrTransitions & SVGTransitions & VariableTransitions & { - default?: ValueTransition; - layout?: ValueTransition; -}; -type Transition = ValueAnimationTransition | TransitionWithValueOverrides; -interface Point2D { - x: number; - y: number; -} -interface PathState { - x: number; - y: number; - /** - * Optional rotation in degrees. If returned, the engine will apply it - * to the element's `rotate` value for the duration of the animation. - */ - rotate?: number; -} -/** - * Sampling function — returns position (and optionally rotation) at - * progress `t` (0–1). - */ -interface PathInterpolator { - (t: number): PathState; -} -/** - * Returned by a path factory such as `arc()` and passed to `transition.path`. - * Implements both the keyframe-animation hook (`animateVisualElement`) and - * the layout-projection hook (`interpolateProjection`). - */ -interface MotionPath { - animateVisualElement(visualElement: VisualElement, target: TargetAndTransition, transition: Transition | undefined, delay: number, animations: AnimationPlaybackControlsWithThen[]): void; - interpolateProjection(delta: Delta): PathInterpolator | undefined; -} -type DynamicOption = (i: number, total: number) => T; -type ValueAnimationWithDynamicDelay = Omit, "delay"> & { - delay?: number | DynamicOption; -}; -interface ReduceMotionOption { - /** - * Whether to reduce motion for transform/layout animations. - * - * - `true`: Skip transform/layout animations (instant transition) - * - `false`: Always animate transforms/layout - * - `undefined`: Use device preference (default behavior) - */ - reduceMotion?: boolean; -} -type AnimationOptions = (ValueAnimationWithDynamicDelay & ReduceMotionOption) | (ValueAnimationWithDynamicDelay & ReduceMotionOption & StyleTransitions & SVGPathTransitions & SVGForcedAttrTransitions & SVGTransitions & VariableTransitions & { - default?: ValueTransition; - layout?: ValueTransition; -}); -interface TransformProperties { - x?: AnyResolvedKeyframe; - y?: AnyResolvedKeyframe; - z?: AnyResolvedKeyframe; - translateX?: AnyResolvedKeyframe; - translateY?: AnyResolvedKeyframe; - translateZ?: AnyResolvedKeyframe; - rotate?: AnyResolvedKeyframe; - rotateX?: AnyResolvedKeyframe; - rotateY?: AnyResolvedKeyframe; - rotateZ?: AnyResolvedKeyframe; - scale?: AnyResolvedKeyframe; - scaleX?: AnyResolvedKeyframe; - scaleY?: AnyResolvedKeyframe; - scaleZ?: AnyResolvedKeyframe; - skew?: AnyResolvedKeyframe; - skewX?: AnyResolvedKeyframe; - skewY?: AnyResolvedKeyframe; - originX?: AnyResolvedKeyframe; - originY?: AnyResolvedKeyframe; - originZ?: AnyResolvedKeyframe; - perspective?: AnyResolvedKeyframe; - transformPerspective?: AnyResolvedKeyframe; -} -interface SVGForcedAttrProperties { - attrX?: number; - attrY?: number; - attrScale?: number; -} -interface SVGPathProperties { - pathLength?: number; - pathOffset?: number; - pathSpacing?: number; -} - -/** - * @public - */ -type Subscriber = (v: T) => void; -/** - * @public - */ -type PassiveEffect = (v: T, safeSetter: (v: T) => void) => void; -type StartAnimation = (complete: () => void) => AnimationPlaybackControlsWithThen | undefined; -interface MotionValueEventCallbacks { - animationStart: () => void; - animationComplete: () => void; - animationCancel: () => void; - change: (latestValue: V) => void; - destroy: () => void; -} -interface ResolvedValues { - [key: string]: AnyResolvedKeyframe; -} -interface Owner { - current: HTMLElement | unknown; - getProps: () => { - onUpdate?: (latest: ResolvedValues) => void; - transformTemplate?: (transform: TransformProperties, generatedTransform: string) => string; - }; -} -interface AccelerateConfig { - factory: (animation: AnimationPlaybackControlsWithThen) => VoidFunction; - times: number[]; - keyframes: any[]; - ease?: EasingFunction | EasingFunction[]; - duration: number; - isTransformed?: boolean; -} -interface MotionValueOptions { - owner?: Owner; -} -declare const collectMotionValues: { - current: MotionValue[] | undefined; -}; -/** - * `MotionValue` is used to track the state and velocity of motion values. - * - * @public - */ -declare class MotionValue { - /** - * If a MotionValue has an owner, it was created internally within Motion - * and therefore has no external listeners. It is therefore safe to animate via WAAPI. - */ - owner?: Owner; - /** - * The current state of the `MotionValue`. - */ - private current; - /** - * The previous state of the `MotionValue`. - */ - private prev; - /** - * The previous state of the `MotionValue` at the end of the previous frame. - */ - private prevFrameValue; - /** - * The last time the `MotionValue` was updated. - */ - updatedAt: number; - /** - * The time `prevFrameValue` was updated. - */ - prevUpdatedAt: number | undefined; - private stopPassiveEffect?; - /** - * Whether the passive effect is active. - */ - isEffectActive?: boolean; - /** - * A reference to the currently-controlling animation. - */ - animation?: AnimationPlaybackControlsWithThen; - /** - * A list of MotionValues whose values are computed from this one. - * This is a rough start to a proper signal-like dirtying system. - */ - private dependents; - /** - * Tracks whether this value should be removed - */ - liveStyle?: boolean; - /** - * Scroll timeline acceleration metadata. When set, VisualElement - * can create a native WAAPI animation attached to a scroll timeline - * instead of driving updates through JS. - */ - accelerate?: AccelerateConfig; - /** - * @param init - The initiating value - * @param config - Optional configuration options - * - * - `transformer`: A function to transform incoming values with. - */ - constructor(init: V, options?: MotionValueOptions); - setCurrent(current: V): void; - setPrevFrameValue(prevFrameValue?: V | undefined): void; - /** - * Adds a function that will be notified when the `MotionValue` is updated. - * - * It returns a function that, when called, will cancel the subscription. - * - * When calling `onChange` inside a React component, it should be wrapped with the - * `useEffect` hook. As it returns an unsubscribe function, this should be returned - * from the `useEffect` function to ensure you don't add duplicate subscribers.. - * - * ```jsx - * export const MyComponent = () => { - * const x = useMotionValue(0) - * const y = useMotionValue(0) - * const opacity = useMotionValue(1) - * - * useEffect(() => { - * function updateOpacity() { - * const maxXY = Math.max(x.get(), y.get()) - * const newOpacity = transform(maxXY, [0, 100], [1, 0]) - * opacity.set(newOpacity) - * } - * - * const unsubscribeX = x.on("change", updateOpacity) - * const unsubscribeY = y.on("change", updateOpacity) - * - * return () => { - * unsubscribeX() - * unsubscribeY() - * } - * }, []) - * - * return - * } - * ``` - * - * @param subscriber - A function that receives the latest value. - * @returns A function that, when called, will cancel this subscription. - * - * @deprecated - */ - onChange(subscription: Subscriber): () => void; - /** - * An object containing a SubscriptionManager for each active event. - */ - private events; - on>(eventName: EventName, callback: MotionValueEventCallbacks[EventName]): VoidFunction; - clearListeners(): void; - /** - * Attaches a passive effect to the `MotionValue`. - */ - attach(passiveEffect: PassiveEffect, stopPassiveEffect: VoidFunction): void; - /** - * Sets the state of the `MotionValue`. - * - * @remarks - * - * ```jsx - * const x = useMotionValue(0) - * x.set(10) - * ``` - * - * @param latest - Latest value to set. - * @param render - Whether to notify render subscribers. Defaults to `true` - * - * @public - */ - set(v: V): void; - setWithVelocity(prev: V, current: V, delta: number): void; - /** - * Set the state of the `MotionValue`, stopping any active animations, - * effects, and resets velocity to `0`. - */ - jump(v: V, endAnimation?: boolean): void; - dirty(): void; - addDependent(dependent: MotionValue): void; - removeDependent(dependent: MotionValue): void; - updateAndNotify: (v: V) => void; - /** - * Returns the latest state of `MotionValue` - * - * @returns - The latest state of `MotionValue` - * - * @public - */ - get(): NonNullable; - /** - * @public - */ - getPrevious(): V | undefined; - /** - * Returns the latest velocity of `MotionValue` - * - * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical. - * - * @public - */ - getVelocity(): number; - hasAnimated: boolean; - /** - * Registers a new animation to control this `MotionValue`. Only one - * animation can drive a `MotionValue` at one time. - * - * ```jsx - * value.start() - * ``` - * - * @param animation - A function that starts the provided animation - */ - start(startAnimation: StartAnimation): Promise; - /** - * Stop the currently active animation. - * - * @public - */ - stop(): void; - /** - * Returns `true` if this value is currently animating. - * - * @public - */ - isAnimating(): boolean; - private clearAnimation; - /** - * Destroy and clean up subscribers to this `MotionValue`. - * - * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically - * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually - * created a `MotionValue` via the `motionValue` function. - * - * @public - */ - destroy(): void; -} -declare function motionValue(init: V, options?: MotionValueOptions): MotionValue; - -type UnresolvedKeyframes = Array; -type ResolvedKeyframes = Array; -declare function flushKeyframeResolvers(): void; -type OnKeyframesResolved = (resolvedKeyframes: ResolvedKeyframes, finalKeyframe: T, forced: boolean) => void; -declare class KeyframeResolver { - name?: string; - element?: WithRender; - finalKeyframe?: T; - suspendedScrollY?: number; - protected unresolvedKeyframes: UnresolvedKeyframes; - private motionValue?; - private onComplete; - state: "pending" | "scheduled" | "complete"; - /** - * Track whether this resolver is async. If it is, it'll be added to the - * resolver queue and flushed in the next frame. Resolvers that aren't going - * to trigger read/write thrashing don't need to be async. - */ - private isAsync; - /** - * Track whether this resolver needs to perform a measurement - * to resolve its keyframes. - */ - needsMeasurement: boolean; - constructor(unresolvedKeyframes: UnresolvedKeyframes, onComplete: OnKeyframesResolved, name?: string, motionValue?: MotionValue, element?: WithRender, isAsync?: boolean); - scheduleResolve(): void; - readKeyframes(): void; - setFinalKeyframe(): void; - measureInitialState(): void; - renderEndStyles(): void; - measureEndState(): void; - complete(isForcedComplete?: boolean): void; - cancel(): void; - resume(): void; -} - -declare class WithPromise { - protected _finished: Promise; - resolve: VoidFunction; - constructor(); - get finished(): Promise; - protected updateFinished(): void; - protected notifyFinished(): void; - /** - * Allows the animation to be awaited. - * - * @deprecated Use `finished` instead. - */ - then(onResolve: VoidFunction, onReject?: VoidFunction): Promise; -} - -type OptionsWithoutKeyframes = Omit, "keyframes">; -declare class AsyncMotionValueAnimation extends WithPromise implements AnimationPlaybackControls { - private createdAt; - private resolvedAt; - private _animation; - private pendingTimeline; - private keyframeResolver; - private stopTimeline; - constructor({ autoplay, delay, type, repeat, repeatDelay, repeatType, keyframes, name, motionValue, element, ...options }: ValueAnimationOptions); - onKeyframesResolved(keyframes: ResolvedKeyframes, finalKeyframe: T, options: OptionsWithoutKeyframes, sync: boolean): void; - get finished(): Promise; - then(onResolve: VoidFunction, _onReject?: VoidFunction): Promise; - get animation(): AnimationPlaybackControls; - get duration(): number; - get iterationDuration(): number; - get time(): number; - set time(newTime: number); - get speed(): number; - get state(): AnimationPlayState; - set speed(newSpeed: number); - get startTime(): number | null; - attachTimeline(timeline: TimelineWithFallback): () => void; - play(): void; - pause(): void; - complete(): void; - cancel(): void; - /** - * Bound to support return animation.stop pattern - */ - stop: () => void; -} - -type AcceptedAnimations = AnimationPlaybackControls; -type GroupedAnimations = AcceptedAnimations[]; -declare class GroupAnimation implements AnimationPlaybackControls { - animations: GroupedAnimations; - constructor(animations: Array); - get finished(): Promise; - /** - * TODO: Filter out cancelled or stopped animations before returning - */ - private getAll; - private setAll; - attachTimeline(timeline: TimelineWithFallback): () => void; - get time(): number; - set time(time: number); - get speed(): number; - set speed(speed: number); - get state(): any; - get startTime(): any; - get duration(): number; - get iterationDuration(): number; - private runAll; - play(): void; - pause(): void; - stop: () => void; - cancel(): void; - complete(): void; -} - -declare class GroupAnimationWithThen extends GroupAnimation implements AnimationPlaybackControlsWithThen { - then(onResolve: VoidFunction, _onReject?: VoidFunction): Promise; -} - -declare class JSAnimation extends WithPromise implements AnimationPlaybackControlsWithThen { - state: AnimationPlayState; - startTime: number | null; - /** - * The driver that's controlling the animation loop. Normally this is a requestAnimationFrame loop - * but in tests we can pass in a synchronous loop. - */ - private driver?; - private isStopped; - private generator; - private calculatedDuration; - private resolvedDuration; - private totalDuration; - private options; - /** - * The current time of the animation. - */ - private currentTime; - /** - * The time at which the animation was paused. - */ - private holdTime; - /** - * Playback speed as a factor. 0 would be stopped, -1 reverse and 2 double speed. - */ - private playbackSpeed; - private mixKeyframes; - private mirroredGenerator; - /** - * Reusable state object for the delay phase to avoid - * allocating a new object every frame. - */ - private delayState; - constructor(options: ValueAnimationOptions); - initAnimation(): void; - updateTime(timestamp: number): void; - tick(timestamp: number, sample?: boolean): AnimationState; - /** - * Allows the returned animation to be awaited or promise-chained. Currently - * resolves when the animation finishes at all but in a future update could/should - * reject if its cancels. - */ - then(resolve: VoidFunction, reject?: VoidFunction): Promise; - get duration(): number; - get iterationDuration(): number; - get time(): number; - set time(newTime: number); - /** - * Returns the generator's velocity at the current time in units/second. - * Uses the analytical derivative when available (springs), avoiding - * the MotionValue's frame-dependent velocity estimation. - */ - getGeneratorVelocity(): number; - get speed(): number; - set speed(newSpeed: number); - play(): void; - pause(): void; - /** - * This method is bound to the instance to fix a pattern where - * animation.stop is returned as a reference from a useEffect. - */ - stop: () => void; - complete(): void; - finish(): void; - cancel(): void; - private teardown; - private stopDriver; - sample(sampleTime: number): AnimationState; - attachTimeline(timeline: TimelineWithFallback): VoidFunction; -} -declare function animateValue(options: ValueAnimationOptions): JSAnimation; - -interface NativeAnimationOptions extends DOMValueAnimationOptions { - pseudoElement?: string; - startTime?: number; -} -/** - * NativeAnimation implements AnimationPlaybackControls for the browser's Web Animations API. - */ -declare class NativeAnimation extends WithPromise implements AnimationPlaybackControlsWithThen { - /** - * The interfaced Web Animation API animation - */ - protected animation: Animation; - protected finishedTime: number | null; - protected options: NativeAnimationOptions; - private allowFlatten; - private isStopped; - private isPseudoElement; - /** - * Tracks a manually-set start time that takes precedence over WAAPI's - * dynamic startTime. This is cleared when play() or time setter is called, - * allowing WAAPI to take over timing. - */ - protected manualStartTime: number | null; - constructor(options?: NativeAnimationOptions); - updateMotionValue?(value?: T): void; - play(): void; - pause(): void; - complete(): void; - cancel(): void; - stop(): void; - /** - * WAAPI doesn't natively have any interruption capabilities. - * - * In this method, we commit styles back to the DOM before cancelling - * the animation. - * - * This is designed to be overridden by NativeAnimationExtended, which - * will create a renderless JS animation and sample it twice to calculate - * its current value, "previous" value, and therefore allow - * Motion to also correctly calculate velocity for any subsequent animation - * while deferring the commit until the next animation frame. - */ - protected commitStyles(): void; - get duration(): number; - get iterationDuration(): number; - get time(): number; - set time(newTime: number); - /** - * The playback speed of the animation. - * 1 = normal speed, 2 = double speed, 0.5 = half speed. - */ - get speed(): number; - set speed(newSpeed: number); - get state(): AnimationPlayState; - get startTime(): number; - set startTime(newStartTime: number); - /** - * Attaches a timeline to the animation, for instance the `ScrollTimeline`. - */ - attachTimeline({ timeline, rangeStart, rangeEnd, observe, }: TimelineWithFallback): VoidFunction; -} - -type NativeAnimationOptionsExtended = NativeAnimationOptions & ValueAnimationOptions & NativeAnimationOptions; -declare class NativeAnimationExtended extends NativeAnimation { - options: NativeAnimationOptionsExtended; - constructor(options: NativeAnimationOptionsExtended); - /** - * WAAPI doesn't natively have any interruption capabilities. - * - * Rather than read committed styles back out of the DOM, we can - * create a renderless JS animation and sample it twice to calculate - * its current value, "previous" value, and therefore allow - * Motion to calculate velocity for any subsequent animation. - */ - updateMotionValue(value?: T): void; -} - -declare class NativeAnimationWrapper extends NativeAnimation { - constructor(animation: Animation); -} - -declare const animationMapKey: (name: string, pseudoElement?: string) => string; -declare function getAnimationMap(element: Element): Map>; - -declare function calcChildStagger(children: Set, child: VisualElement, delayChildren?: number | DynamicOption, staggerChildren?: number, staggerDirection?: number): number; - -interface ArcOptions { - /** - * How far the arc bulges perpendicular to the straight-line path, - * as a fraction of the total distance. A value of `1` means the arc - * peaks at a height equal to the full travel distance. Default `0.5`. - */ - strength?: number; - /** - * Where along the path (0–1) the arc reaches its maximum height. - * Default `0.5` (symmetric). - */ - peak?: number; - /** - * Which side the arc bulges toward. - * - `"cw"` / `"ccw"` — locked relative to direction of travel - * - unset — auto-pick a stable screen-space side - */ - direction?: "cw" | "ccw"; - /** - * Rotates the element to follow the tangent of the arc path. - * - `true` — full tangent following (1.0) - * - number 0–1 — scale factor - */ - rotate?: boolean | number; -} -/** - * Creates a curved path for `transition.path`: - * - * ```ts - * - * ``` - * - * Reuse the returned value (module scope / useMemo / useRef) so its - * continuity closure survives re-renders — a fresh `arc()` has no memory. - */ -declare function arc(options?: ArcOptions): MotionPath; - -type CSSVariableName = `--${string}`; -type CSSVariableToken = `var(${CSSVariableName})`; -declare const isCSSVariableName: (key?: AnyResolvedKeyframe | null) => key is `--${string}`; -declare const isCSSVariableToken: (value?: string) => value is `var(--${string})`; -/** - * Check if a value contains a CSS variable anywhere (e.g. inside calc()). - * Unlike isCSSVariableToken which checks if the value IS a var() token, - * this checks if the value CONTAINS var() somewhere in the string. - */ -declare function containsCSSVariable(value?: AnyResolvedKeyframe | null): boolean; - -declare function parseCSSVariable(current: string): string[] | undefined[]; -declare function getVariableValue(current: CSSVariableToken, element: Element, depth?: number): AnyResolvedKeyframe | undefined; - -declare const getDefaultTransition: (valueKey: string, { keyframes }: ValueAnimationOptions) => Partial; - -declare function getFinalKeyframe(keyframes: T[], { repeat, repeatType }: AnimationPlaybackOptions, finalKeyframe?: T, speed?: number): T; - -declare function getValueTransition(transition: any, key: string): any; - -/** - * If `transition` has `inherit: true`, shallow-merge it with - * `parentTransition` (child keys win) and strip the `inherit` key. - * Otherwise return `transition` unchanged. - */ -declare function resolveTransition(transition: any, parentTransition?: any): any; - -/** - * Decide whether a transition is defined on a given Transition. - * This filters out orchestration options and returns true - * if any options are left. - */ -declare function isTransitionDefined(transition: Transition & { - elapsed?: number; - from?: AnyResolvedKeyframe; -}): boolean; - -declare function makeAnimationInstant(options: Partial<{ - duration: ValueAnimationOptions["duration"]; - type: ValueAnimationOptions["type"]; -}>): void; - -declare const animateMotionValue: (name: string, value: MotionValue, target: V | UnresolvedKeyframes, transition?: ValueTransition & { - elapsed?: number; -}, element?: VisualElement, isHandoff?: boolean) => StartAnimation; - -declare function animateVisualElement(visualElement: VisualElement, definition: AnimationDefinition, options?: VisualElementAnimationOptions): Promise; - -declare function animateTarget(visualElement: VisualElement, targetAndTransition: TargetAndTransition, { delay, transitionOverride, type }?: VisualElementAnimationOptions): AnimationPlaybackControlsWithThen[]; - -declare function animateVariant(visualElement: VisualElement, variant: string, options?: VisualElementAnimationOptions): Promise; - -declare const optimizedAppearDataId = "framerAppearId"; -declare const optimizedAppearDataAttribute: "data-framer-appear-id"; - -type Process = (data: FrameData) => void; -type Schedule = (process: Process, keepAlive?: boolean, immediate?: boolean) => Process; -interface Step { - schedule: Schedule; - cancel: (process: Process) => void; - process: (data: FrameData) => void; -} -type StepId = "setup" | "read" | "resolveKeyframes" | "preUpdate" | "update" | "preRender" | "render" | "postRender"; -type CancelProcess = (process: Process) => void; -type Batcher = { - [key in StepId]: Schedule; -}; -type Steps = { - [key in StepId]: Step; -}; -interface FrameData { - delta: number; - timestamp: number; - isProcessing: boolean; -} - -/** - * Expose only the needed part of the VisualElement interface to - * ensure React types don't end up in the generic DOM bundle. - */ -interface WithAppearProps { - props: { - [optimizedAppearDataAttribute]?: string; - values?: { - [key: string]: MotionValue | MotionValue; - }; - }; -} -type HandoffFunction = (storeId: string, valueName: string, frame: Batcher) => number | null; -/** - * The window global object acts as a bridge between our inline script - * triggering the optimized appear animations, and Motion. - */ -declare global { - interface Window { - MotionHandoffAnimation?: HandoffFunction; - MotionHandoffMarkAsComplete?: (elementId: string) => void; - MotionHandoffIsComplete?: (elementId: string) => boolean; - MotionHasOptimisedAnimation?: (elementId?: string, valueName?: string) => boolean; - MotionCancelOptimisedAnimation?: (elementId?: string, valueName?: string, frame?: Batcher, canResume?: boolean) => void; - MotionCheckAppearSync?: (visualElement: WithAppearProps, valueName: string, value: MotionValue) => VoidFunction | void; - MotionIsMounted?: boolean; - } -} - -declare function getOptimisedAppearId(visualElement: WithAppearProps): string | undefined; - -declare function inertia({ keyframes, velocity, power, timeConstant, bounceDamping, bounceStiffness, modifyTarget, min, max, restDelta, restSpeed, }: ValueAnimationOptions): KeyframeGenerator; - -declare function defaultEasing(values: any[], easing?: EasingFunction): EasingFunction[]; -declare function keyframes({ duration, keyframes: keyframeValues, times, ease, }: ValueAnimationOptions): KeyframeGenerator; - -declare function spring(optionsOrVisualDuration?: ValueAnimationOptions | number, bounce?: number): KeyframeGenerator; -declare namespace spring { - var applyToOptions: (options: Transition) => Transition; -} - -/** - * Implement a practical max duration for keyframe generation - * to prevent infinite loops - */ -declare const maxGeneratorDuration = 20000; -declare function calcGeneratorDuration(generator: KeyframeGenerator): number; - -/** - * Create a progress => progress easing function from a generator. - */ -declare function createGeneratorEasing(options: Transition, scale: number | undefined, createGenerator: GeneratorFactory): { - type: string; - ease: (progress: number) => number; - duration: number; -}; - -declare function isGenerator(type?: AnimationGeneratorType): type is GeneratorFactory; - -declare class DOMKeyframesResolver extends KeyframeResolver { - name: string; - element?: WithRender; - private removedTransforms?; - private measuredOrigin?; - constructor(unresolvedKeyframes: UnresolvedKeyframes, onComplete: OnKeyframesResolved, name?: string, motionValue?: MotionValue, element?: WithRender); - readKeyframes(): void; - resolveNoneKeyframes(): void; - measureInitialState(): void; - measureEndState(): void; -} - -declare function defaultOffset(arr: any[]): number[]; - -declare function fillOffset(offset: number[], remaining: number): void; - -declare function convertOffsetToTimes(offset: number[], duration: number): number[]; - -declare function applyPxDefaults(keyframes: ValueKeyframe[] | UnresolvedValueKeyframe[], name: string): void; - -declare function fillWildcards(keyframes: ValueKeyframe[] | UnresolvedValueKeyframe[]): void; - -declare const cubicBezierAsString: ([a, b, c, d]: BezierDefinition) => string; - -declare function isWaapiSupportedEasing(easing?: Easing | Easing[]): boolean; - -declare function mapEasingToNativeEasing(easing: Easing | Easing[] | undefined, duration: number): undefined | string | string[]; - -declare const supportedWaapiEasing: { - linear: string; - ease: string; - easeIn: string; - easeOut: string; - easeInOut: string; - circIn: string; - circOut: string; - backIn: string; - backOut: string; -}; - -declare function startWaapiAnimation(element: Element, valueName: string, keyframes: ValueKeyframesDefinition, { delay, duration, repeat, repeatType, ease, times, }?: ValueTransition, pseudoElement?: string | undefined): Animation; - -declare const supportsPartialKeyframes: () => boolean; - -declare function supportsBrowserAnimation(options: ValueAnimationOptionsWithRenderContext): any; - -/** - * A list of values that can be hardware-accelerated. - */ -declare const acceleratedValues: Set; - -declare function applyGeneratorOptions({ type, ...options }: ValueTransition): ValueTransition; - -declare const generateLinearEasing: (easing: EasingFunction, duration: number, resolution?: number) => string; - -declare class MotionValueState { - latest: { - [name: string]: AnyResolvedKeyframe; - }; - private values; - set(name: string, value: MotionValue, render?: VoidFunction, computed?: MotionValue, useDefaultValueType?: boolean): () => void; - get(name: string): MotionValue | undefined; -} - -declare const addAttrValue: (element: HTMLElement | SVGElement, state: MotionValueState, key: string, value: MotionValue) => () => void; -declare const attrEffect: (subject: ElementOrSelector, values: Record>) => () => void; - -declare const propEffect: (subject: { - [key: string]: any; -}, values: Record>) => VoidFunction; - -declare const addStyleValue: (element: HTMLElement | SVGElement, state: MotionValueState, key: string, value: MotionValue) => () => void; -declare const styleEffect: (subject: ElementOrSelector, values: Record>) => () => void; - -declare const svgEffect: (subject: ElementOrSelector, values: Record>) => () => void; - -declare const frame: Batcher; -declare const cancelFrame: (process: Process) => void; -declare const frameData: FrameData; -declare const frameSteps: Steps; - -declare function createRenderBatcher(scheduleNextBatch: (callback: Function) => void, allowKeepAlive: boolean): { - schedule: Batcher; - cancel: (process: Process) => void; - state: FrameData; - steps: Steps; -}; - -declare const microtask: Batcher; -declare const cancelMicrotask: (process: Process) => void; - -/** - * An eventloop-synchronous alternative to performance.now(). - * - * Ensures that time measurements remain consistent within a synchronous context. - * Usually calling performance.now() twice within the same synchronous context - * will return different values which isn't useful for animations when we're usually - * trying to sync animations to the same frame. - */ -declare const time: { - now: () => number; - set: (newTime: number) => void; -}; - -declare const isDragging: { - x: boolean; - y: boolean; -}; -declare function isDragActive(): boolean; - -declare function setDragLock(axis: boolean | "x" | "y" | "lockDirection"): (() => void) | null; - -type ElementOrSelector = Element | Element[] | NodeListOf | string | null | undefined; -interface WithQuerySelectorAll { - querySelectorAll: Element["querySelectorAll"]; -} -interface AnimationScope { - readonly current: T; - animations: any[]; -} -interface SelectorCache { - [key: string]: NodeListOf; -} -declare function resolveElements(elementOrSelector: ElementOrSelector, scope?: AnimationScope, selectorCache?: SelectorCache): Element[]; - -/** - * Options for event listeners. - * - * @public - */ -interface EventOptions { - /** - * Use passive event listeners. Doing so allows the browser to optimize - * scrolling performance by not allowing the use of `preventDefault()`. - * - * @default true - */ - passive?: boolean; - /** - * Remove the event listener after the first event. - * - * @default false - */ - once?: boolean; -} - -/** - * A function to be called when a hover gesture starts. - * - * This function can optionally return a function that will be called - * when the hover gesture ends. - * - * @public - */ -type OnHoverStartEvent = (element: Element, event: PointerEvent) => void | OnHoverEndEvent; -/** - * A function to be called when a hover gesture ends. - * - * @public - */ -type OnHoverEndEvent = (event: PointerEvent) => void; -/** - * Create a hover gesture. hover() is different to .addEventListener("pointerenter") - * in that it has an easier syntax, filters out polyfilled touch events, interoperates - * with drag gestures, and automatically removes the "pointerennd" event listener when the hover ends. - * - * @public - */ -declare function hover(elementOrSelector: ElementOrSelector, onHoverStart: OnHoverStartEvent, options?: EventOptions): VoidFunction; - -interface PressGestureInfo { - success: boolean; -} -type OnPressEndEvent = (event: PointerEvent, info: PressGestureInfo) => void; -type OnPressStartEvent = (element: Element, event: PointerEvent) => OnPressEndEvent | void; - -interface PointerEventOptions extends EventOptions { - useGlobalTarget?: boolean; - stopPropagation?: boolean; -} -/** - * Create a press gesture. - * - * Press is different to `"pointerdown"`, `"pointerup"` in that it - * automatically filters out secondary pointer events like right - * click and multitouch. - * - * It also adds accessibility support for keyboards, where - * an element with a press gesture will receive focus and - * trigger on Enter `"keydown"` and `"keyup"` events. - * - * This is different to a browser's `"click"` event, which does - * respond to keyboards but only for the `"click"` itself, rather - * than the press start and end/cancel. The element also needs - * to be focusable for this to work, whereas a press gesture will - * make an element focusable by default. - * - * @public - */ -declare function press(targetOrSelector: ElementOrSelector, onPressStart: OnPressStartEvent, options?: PointerEventOptions): VoidFunction; - -/** - * Checks if an element is natively keyboard accessible (focusable). - * Used by the press gesture to determine if we need to add tabIndex. - */ -declare function isElementKeyboardAccessible(element: Element): boolean; -/** - * Checks if an element has text selection or direct interaction behavior - * that should block drag gestures from starting. - * - * This specifically targets form controls where the user might want to select - * text or interact with the control (e.g., sliders, dropdowns). - * - * Buttons and links are NOT included because they don't have click-and-move - * actions of their own - they only respond to click events, so dragging - * should still work when initiated from these elements. - */ -declare function isElementTextInput(element: Element): boolean; - -/** - * Recursively traverse up the tree to check whether the provided child node - * is the parent or a descendant of it. - * - * @param parent - Element to find - * @param child - Element to test against parent - */ -declare const isNodeOrChild: (parent: Element | null, child?: Element | null) => boolean; - -declare const isPrimaryPointer: (event: PointerEvent) => boolean; - -declare function defaultTransformValue(name: string): number; -declare function parseValueFromTransform(transform: string | undefined, name: string): number; -declare const readTransformValue: (instance: HTMLElement, name: string) => number; - -declare function getComputedStyle(element: HTMLElement | SVGElement, name: string): string; - -declare function setStyle(element: HTMLElement | SVGElement, name: string, value: AnyResolvedKeyframe): void; - -declare const isKeyframesTarget: (v: ValueKeyframesDefinition) => v is UnresolvedValueKeyframe[]; - -declare const positionalKeys: Set; - -/** - * Generate a list of every possible transform key. - */ -declare const transformPropOrder: string[]; -/** - * A quick lookup for transform props. - * - * `pathRotation` is a transform for routing purposes (skipped from raw - * style application, wired to the transform composite, flags transform - * dirty) but is intentionally NOT in `transformPropOrder` — it is - * composed onto `rotate` at the build sites, not serialized in its own - * slot, and must stay out of the order-array consumers (parse-transform, - * unit-conversion, keys-position). - */ -declare const transformProps: Set; - -interface ResizeInfo { - width: number; - height: number; -} -type ResizeHandler = (element: I, info: ResizeInfo) => void; -type WindowResizeHandler = (info: ResizeInfo) => void; - -declare function resize(onResize: WindowResizeHandler): VoidFunction; -declare function resize(target: ElementOrSelector, onResize: ResizeHandler): VoidFunction; - -type Update = (progress: number) => void; -declare function observeTimeline(update: Update, timeline: ProgressTimeline): () => void; - -declare function recordStats(): void; - -interface LayoutProjectionMetrics { - nodes: number; - calculatedTargetDeltas: number; - calculatedProjections: number; -} -interface LayoutProjectionStats { - nodes: number[]; - calculatedTargetDeltas: number[]; - calculatedProjections: number[]; -} -interface StatsRecording { - layoutProjection: LayoutProjectionStats; -} - -type InactiveStatsBuffer = { - value: null; - addProjectionMetrics: null; -}; -type ActiveStatsBuffer = { - value: StatsRecording; - addProjectionMetrics: (metrics: LayoutProjectionMetrics) => void; -}; -declare const statsBuffer: InactiveStatsBuffer | ActiveStatsBuffer; - -type Mixer = (p: number) => T; -type MixerFactory = (a: T, b: T) => Mixer; - -interface InterpolateOptions { - clamp?: boolean; - ease?: EasingFunction | EasingFunction[]; - mixer?: MixerFactory; -} -/** - * Create a function that maps from a numerical input array to a generic output array. - * - * Accepts: - * - Numbers - * - Colors (hex, hsl, hsla, rgb, rgba) - * - Complex (combinations of one or more numbers or strings) - * - * ```jsx - * const mixColor = interpolate([0, 1], ['#fff', '#000']) - * - * mixColor(0.5) // 'rgba(128, 128, 128, 1)' - * ``` - * - * TODO Revisit this approach once we've moved to data models for values, - * probably not needed to pregenerate mixer functions. - * - * @public - */ -declare function interpolate(input: number[], output: T[], { clamp: isClamp, ease, mixer }?: InterpolateOptions): (v: number) => T; - -/** - * Checks if an element is an HTML element in a way - * that works across iframes - */ -declare function isHTMLElement(element: unknown): element is HTMLElement; - -/** - * Checks if an element is an SVG element in a way - * that works across iframes - */ -declare function isSVGElement(element: unknown): element is SVGElement; - -/** - * Checks if an element is specifically an SVGSVGElement (the root SVG element) - * in a way that works across iframes - */ -declare function isSVGSVGElement(element: unknown): element is SVGSVGElement; - -declare function mix(from: T, to: T): Mixer; -declare function mix(from: number, to: number, p: number): number; - -type Transformer = (v: any) => any; -type ValueType = { - test: (v: any) => boolean; - parse: (v: any) => any; - transform?: Transformer; - createTransformer?: (template: string) => Transformer; - default?: any; - getAnimatableNone?: (v: any) => any; -}; -type NumberMap = { - [key: string]: number; -}; -type RGBA = { - red: number; - green: number; - blue: number; - alpha: number; -}; -type HSLA = { - hue: number; - saturation: number; - lightness: number; - alpha: number; -}; -type Color = HSLA | RGBA; - -declare const mixLinearColor: (from: number, to: number, v: number) => number; -declare const mixColor: (from: Color | string, to: Color | string) => (p: number) => string | Color; - -type MixableArray = Array; -interface MixableObject { - [key: string]: AnyResolvedKeyframe | RGBA | HSLA; -} -declare function getMixer(a: T): ((from: string | Color, to: string | Color) => (p: number) => string | Color) | ((origin: AnyResolvedKeyframe, target: AnyResolvedKeyframe) => Function) | typeof mixArray | typeof mixObject; -declare function mixArray(a: MixableArray, b: MixableArray): (p: number) => (string | number | RGBA | HSLA)[]; -declare function mixObject(a: MixableObject, b: MixableObject): (v: number) => { - [x: string]: AnyResolvedKeyframe | RGBA | HSLA; -}; -declare const mixComplex: (origin: AnyResolvedKeyframe, target: AnyResolvedKeyframe) => Function; - -declare function mixImmediate(a: T, b: T): (p: number) => T; - -declare const mixNumber: (from: number, to: number, progress: number) => number; - -declare const invisibleValues: Set; -/** - * Returns a function that, when provided a progress value between 0 and 1, - * will return the "none" or "hidden" string only when the progress is that of - * the origin or target. - */ -declare function mixVisibility(origin: string, target: string): (p: number) => string; - -type StaggerOrigin = "first" | "last" | "center" | number; -type StaggerOptions = { - startDelay?: number; - from?: StaggerOrigin; - ease?: Easing; -}; -declare function getOriginIndex(from: StaggerOrigin, total: number): number; -declare function stagger(duration?: number, { startDelay, from, ease }?: StaggerOptions): DynamicOption; - -/** - * Add the ability for test suites to manually set support flags - * to better test more environments. - */ -declare const supportsFlags: Record; - -declare const supportsLinearEasing: () => boolean; - -declare global { - interface Window { - ScrollTimeline: ScrollTimeline; - ViewTimeline: ViewTimeline; - } -} -declare class ScrollTimeline implements ProgressTimeline { - constructor(options: ScrollOptions); - currentTime: null | { - value: number; - }; - cancel?: VoidFunction; -} -declare class ViewTimeline implements ProgressTimeline { - constructor(options: { - subject: Element; - axis?: string; - }); - currentTime: null | { - value: number; - }; - cancel?: VoidFunction; -} -declare const supportsScrollTimeline: () => boolean; -declare const supportsViewTimeline: () => boolean; - -/** - * @public - */ -interface TransformOptions { - /** - * Clamp values to within the given range. Defaults to `true` - * - * @public - */ - clamp?: boolean; - /** - * Easing functions to use on the interpolations between each value in the input and output ranges. - * - * If provided as an array, the array must be one item shorter than the input and output ranges, as the easings apply to the transition **between** each. - * - * @public - */ - ease?: EasingFunction | EasingFunction[]; - /** - * Provide a function that can interpolate between any two values in the provided range. - * - * @public - */ - mixer?: (from: T, to: T) => (v: number) => any; -} -/** - * Transforms numbers into other values by mapping them from an input range to an output range. - * Returns the type of the input provided. - * - * @remarks - * - * Given an input range of `[0, 200]` and an output range of - * `[0, 1]`, this function will return a value between `0` and `1`. - * The input range must be a linear series of numbers. The output range - * can be any supported value type, such as numbers, colors, shadows, arrays, objects and more. - * Every value in the output range must be of the same type and in the same format. - * - * ```jsx - * export function MyComponent() { - * const inputRange = [0, 200] - * const outputRange = [0, 1] - * const output = transform(100, inputRange, outputRange) - * - * // Returns 0.5 - * return
{output}
- * } - * ``` - * - * @param inputValue - A number to transform between the input and output ranges. - * @param inputRange - A linear series of numbers (either all increasing or decreasing). - * @param outputRange - A series of numbers, colors, strings, or arrays/objects of those. Must be the same length as `inputRange`. - * @param options - Clamp: Clamp values to within the given range. Defaults to `true`. - * - * @public - */ -declare function transform(inputValue: number, inputRange: number[], outputRange: T[], options?: TransformOptions): T; -/** - * - * Transforms numbers into other values by mapping them from an input range to an output range. - * - * Given an input range of `[0, 200]` and an output range of - * `[0, 1]`, this function will return a value between `0` and `1`. - * The input range must be a linear series of numbers. The output range - * can be any supported value type, such as numbers, colors, shadows, arrays, objects and more. - * Every value in the output range must be of the same type and in the same format. - * - * ```jsx - * export function MyComponent() { - * const inputRange = [-200, -100, 100, 200] - * const outputRange = [0, 1, 1, 0] - * const convertRange = transform(inputRange, outputRange) - * const output = convertRange(-150) - * - * // Returns 0.5 - * return
{output}
- * } - * - * ``` - * - * @param inputRange - A linear series of numbers (either all increasing or decreasing). - * @param outputRange - A series of numbers, colors or strings. Must be the same length as `inputRange`. - * @param options - Clamp: clamp values to within the given range. Defaults to `true`. - * - * @public - */ -declare function transform(inputRange: number[], outputRange: T[], options?: TransformOptions): (inputValue: number) => T; - -/** - * Options for useFollowValue hook, extending ValueAnimationTransition - * but excluding lifecycle callbacks that don't make sense for the hook pattern. - */ -type FollowValueOptions = Omit & { - /** - * When true, the first change from a tracked `MotionValue` source - * will jump to the new value instead of animating. Subsequent - * changes animate normally. This prevents unwanted animations - * on page refresh or back navigation (e.g. `useScroll` + `useSpring`). - * - * @default false - */ - skipInitialAnimation?: boolean; -}; -/** - * Create a `MotionValue` that animates to its latest value using any transition type. - * Can either be a value or track another `MotionValue`. - * - * ```jsx - * const x = motionValue(0) - * const y = followValue(x, { type: "spring", stiffness: 300 }) - * // or with tween - * const z = followValue(x, { type: "tween", duration: 0.5, ease: "easeOut" }) - * ``` - * - * @param source - Initial value or MotionValue to track - * @param options - Animation transition options - * @returns `MotionValue` - * - * @public - */ -declare function followValue(source: T | MotionValue, options?: FollowValueOptions): MotionValue; -/** - * Attach an animation to a MotionValue that will animate whenever the value changes. - * Similar to attachSpring but supports any transition type (spring, tween, inertia, etc.) - * - * @param value - The MotionValue to animate - * @param source - Initial value or MotionValue to track - * @param options - Animation transition options - * @returns Cleanup function - * - * @public - */ -declare function attachFollow(value: MotionValue, source: T | MotionValue, options?: FollowValueOptions): VoidFunction; - -type MapInputRange = number[]; -/** - * Create a `MotionValue` that maps the output of another `MotionValue` by - * mapping it from one range of values into another. - * - * @remarks - * - * Given an input range of `[-200, -100, 100, 200]` and an output range of - * `[0, 1, 1, 0]`, the returned `MotionValue` will: - * - * - When provided a value between `-200` and `-100`, will return a value between `0` and `1`. - * - When provided a value between `-100` and `100`, will return `1`. - * - When provided a value between `100` and `200`, will return a value between `1` and `0` - * - * The input range must be a linear series of numbers. The output range - * can be any value type supported by Motion: numbers, colors, shadows, etc. - * - * Every value in the output range must be of the same type and in the same format. - * - * ```jsx - * const x = motionValue(0) - * const xRange = [-200, -100, 100, 200] - * const opacityRange = [0, 1, 1, 0] - * const opacity = mapValue(x, xRange, opacityRange) - * ``` - * - * @param inputValue - `MotionValue` - * @param inputRange - A linear series of numbers (either all increasing or decreasing) - * @param outputRange - A series of numbers, colors or strings. Must be the same length as `inputRange`. - * @param options - - * - * - clamp: boolean. Clamp values to within the given range. Defaults to `true` - * - ease: EasingFunction[]. Easing functions to use on the interpolations between each value in the input and output ranges. If provided as an array, the array must be one item shorter than the input and output ranges, as the easings apply to the transition between each. - * - * @returns `MotionValue` - * - * @public - */ -declare function mapValue(inputValue: MotionValue, inputRange: MapInputRange, outputRange: O[], options?: TransformOptions): MotionValue; - -/** - * Create a `MotionValue` that animates to its latest value using a spring. - * Can either be a value or track another `MotionValue`. - * - * ```jsx - * const x = motionValue(0) - * const y = springValue(x, { stiffness: 300 }) - * ``` - * - * @param source - Initial value or MotionValue to track - * @param options - Spring configuration options - * @returns `MotionValue` - * - * @public - */ -declare function springValue(source: T | MotionValue, options?: SpringOptions): MotionValue; -/** - * Attach a spring animation to a MotionValue that will animate whenever the value changes. - * - * @param value - The MotionValue to animate - * @param source - Initial value or MotionValue to track - * @param options - Spring configuration options - * @returns Cleanup function - * - * @public - */ -declare function attachSpring(value: MotionValue, source: T | MotionValue, options?: SpringOptions): VoidFunction; - -type TransformInputRange = number[]; -type SingleTransformer = (input: I) => O; -type MultiTransformer = (input: I[]) => O; -type ValueTransformer = SingleTransformer | MultiTransformer; -/** - * Create a `MotionValue` that transforms the output of other `MotionValue`s by - * passing their latest values through a transform function. - * - * Whenever a `MotionValue` referred to in the provided function is updated, - * it will be re-evaluated. - * - * ```jsx - * const x = motionValue(0) - * const y = transformValue(() => x.get() * 2) // double x - * ``` - * - * @param transformer - A transform function. This function must be pure with no side-effects or conditional statements. - * @returns `MotionValue` - * - * @public - */ -declare function transformValue(transform: () => O): MotionValue; - -declare const color: { - test: (v: any) => boolean; - parse: (v: any) => RGBA | HSLA; - transform: (v: HSLA | RGBA | string) => string; - getAnimatableNone: (v: string) => string; -}; - -declare function parseHex(v: string): RGBA; -declare const hex: { - test: (v: any) => boolean; - parse: typeof parseHex; - transform: ({ red, green, blue, alpha }: RGBA) => string; -}; - -declare const hsla: { - test: (v: any) => boolean; - parse: (v: string | Color) => HSLA; - transform: ({ hue, saturation, lightness, alpha }: HSLA) => string; -}; - -declare function hslaToRgba({ hue, saturation, lightness, alpha }: HSLA): RGBA; - -declare const rgbUnit: { - transform: (v: number) => number; - test: (v: number) => boolean; - parse: typeof parseFloat; -}; -declare const rgba: { - test: (v: any) => boolean; - parse: (v: string | Color) => RGBA; - transform: ({ red, green, blue, alpha }: RGBA) => string; -}; - -declare function test(v: any): boolean; -type ComplexValues = Array; -interface ValueIndexes { - color: number[]; - number: number[]; - var: number[]; -} -interface ComplexValueInfo { - values: ComplexValues; - split: string[]; - indexes: ValueIndexes; - types: Array; -} -declare function analyseComplexValue(value: AnyResolvedKeyframe): ComplexValueInfo; -declare function parseComplexValue(v: AnyResolvedKeyframe): ComplexValues; -declare function createTransformer(source: AnyResolvedKeyframe): (v: (string | number | Color)[]) => string; -declare function getAnimatableNone$1(v: AnyResolvedKeyframe): string; -declare const complex: { - test: typeof test; - parse: typeof parseComplexValue; - createTransformer: typeof createTransformer; - getAnimatableNone: typeof getAnimatableNone$1; -}; - -/** - * A list of value types commonly used for dimensions - */ -declare const dimensionValueTypes: ({ - test: (v: number) => boolean; - parse: typeof parseFloat; - transform: (v: number) => number; -} | { - test: (v: AnyResolvedKeyframe) => boolean; - parse: typeof parseFloat; - transform: (v: string | number) => string; -} | ValueType)[]; -/** - * Tests a dimensional value against the list of dimension ValueTypes - */ -declare const findDimensionValueType: (v: any) => { - test: (v: number) => boolean; - parse: typeof parseFloat; - transform: (v: number) => number; -} | { - test: (v: AnyResolvedKeyframe) => boolean; - parse: typeof parseFloat; - transform: (v: string | number) => string; -} | ValueType | undefined; - -interface ValueTypeMap { - [key: string]: ValueType; -} - -/** - * A map of default value types for common values - */ -declare const defaultValueTypes: ValueTypeMap; -/** - * Gets the default ValueType for the provided value key - */ -declare const getDefaultValueType: (key: string) => ValueType; - -declare const numberValueTypes: ValueTypeMap; - -declare const transformValueTypes: ValueTypeMap; - -declare const number: { - test: (v: number) => boolean; - parse: typeof parseFloat; - transform: (v: number) => number; -}; -declare const alpha: { - transform: (v: number) => number; - test: (v: number) => boolean; - parse: typeof parseFloat; -}; -declare const scale: { - default: number; - test: (v: number) => boolean; - parse: typeof parseFloat; - transform: (v: number) => number; -}; - -declare const degrees: { - test: (v: AnyResolvedKeyframe) => boolean; - parse: typeof parseFloat; - transform: (v: number | string) => string; -}; -declare const percent: { - test: (v: AnyResolvedKeyframe) => boolean; - parse: typeof parseFloat; - transform: (v: number | string) => string; -}; -declare const px: { - test: (v: AnyResolvedKeyframe) => boolean; - parse: typeof parseFloat; - transform: (v: number | string) => string; -}; -declare const vh: { - test: (v: AnyResolvedKeyframe) => boolean; - parse: typeof parseFloat; - transform: (v: number | string) => string; -}; -declare const vw: { - test: (v: AnyResolvedKeyframe) => boolean; - parse: typeof parseFloat; - transform: (v: number | string) => string; -}; -declare const progressPercentage: { - parse: (v: string) => number; - transform: (v: number) => string; - test: (v: AnyResolvedKeyframe) => boolean; -}; - -/** - * Tests a provided value against a ValueType - */ -declare const testValueType: (v: any) => (type: ValueType) => boolean; - -declare function getAnimatableNone(key: string, value: string): any; - -/** - * Tests a value against the list of ValueTypes - */ -declare const findValueType: (v: any) => { - test: (v: number) => boolean; - parse: typeof parseFloat; - transform: (v: number) => number; -} | { - test: (v: AnyResolvedKeyframe) => boolean; - parse: typeof parseFloat; - transform: (v: string | number) => string; -} | ValueType | { - test: (v: any) => boolean; - parse: (v: any) => RGBA | HSLA; - transform: (v: string | RGBA | HSLA) => string; - getAnimatableNone: (v: string) => string; -} | { - test: (v: any) => boolean; - parse: (v: AnyResolvedKeyframe) => ComplexValues; - createTransformer: (source: AnyResolvedKeyframe) => (v: (string | number | Color)[]) => string; - getAnimatableNone: (v: AnyResolvedKeyframe) => string; -} | undefined; - -/** - * Provided a value and a ValueType, returns the value as that value type. - */ -declare const getValueAsType: (value: any, type?: ValueType) => any; - -declare const isMotionValue: (value: any) => value is MotionValue; - -declare function addValueToWillChange(visualElement: VisualElement, key: string): void; - -interface WillChange extends MotionValue { - add(name: string): void; -} - -declare function isWillChangeMotionValue(value: any): value is WillChange; - -type ViewTransitionAnimationDefinition = { - keyframes: DOMKeyframesDefinition; - options: AnimationOptions; -}; -type ViewTransitionTarget = { - layout?: ViewTransitionAnimationDefinition; - /** - * Presence-gated: `enter` animates a pure newcomer's new view, `exit` a - * pure leaver's old view. A survivor (present in both snapshots) gets - * neither - it just morphs. - */ - enter?: ViewTransitionAnimationDefinition; - exit?: ViewTransitionAnimationDefinition; - /** - * View-targeted (ungated): `new`/`old` animate the new/old view whenever it - * exists - including a survivor's, for crossfades and slide-throughs. - */ - new?: ViewTransitionAnimationDefinition; - old?: ViewTransitionAnimationDefinition; -}; -type ViewTransitionOptions = AnimationOptions & { - interrupt?: "wait" | "immediate"; -}; -type ViewTransitionTargetDefinition = string | Element; - -declare class ViewTransitionBuilder { - private currentSubject; - targets: Map; - /** - * Definitions that must be resolved to elements (and assigned a - * `view-transition-name`) rather than treated as pre-named layers. - */ - resolveDefs: Set; - /** - * Per-subject crop override: `true` forces the crop (clip + object-fit: - * cover + animated corner radii) on, `false` forces it off. A subject with - * no entry uses the default - crop only a genuine morph (a layer present in - * both snapshots), so a fade-only enter/exit isn't clipped to nothing. - */ - cropOverride: Map; - /** - * Subjects paired with a different new-snapshot target (the second `.add()` - * argument), so two distinct elements share one name and morph into each - * other - a shared-element transition. - */ - pairs: Map; - /** - * A `view-transition-class` to apply to each subject's resolved elements, - * so authors can target the generated layers from CSS by class rather than - * the opaque generated name. - */ - classNames: Map; - /** - * Subjects opted out of automatic group nesting via `.group(false)`. Their - * layer stays a flat top-level group (`view-transition-group: none`) instead - * of nesting under its DOM-ancestor layer - so it animates independently and - * escapes an ancestor's clip/transform (e.g. an element that lifts out of a - * card and flies across, which nesting would clip to the card). - */ - flatGroups: Set; - update: () => void | Promise; - options: ViewTransitionOptions; - notifyReady: (value: GroupAnimation) => void; - notifyReject: (error: unknown) => void; - private readyPromise; - constructor(update: () => void | Promise, options?: ViewTransitionOptions); - /** - * Target elements resolved from a selector or Element, each assigned a - * `view-transition-name` automatically. - * - * Passing a second target pairs them: the first is resolved in the old - * snapshot and the second in the new, sharing one name so two *different* - * elements morph into each other (e.g. `.add(card, ".modal")`). Symmetric - - * pass them the other way round to morph back. - */ - add(subject: ViewTransitionTargetDefinition, newSubject?: ViewTransitionTargetDefinition): this; - /** - * Control this subject's crop (clip + `object-fit: cover` + animated - * corners). By default a subject auto-crops only when it actually morphs - - * present in both snapshots (a survivor, or an `.add(a, b)` pair). A - * fade-only enter/exit has no second box to crop against, so it's left to - * the browser default; in particular the `overflow: clip` a crop adds would - * otherwise clip a mis-sized enter/exit layer to nothing. - * - * `.crop(false)` forces the crop off (e.g. a text morph, where - * `object-fit: cover` clips glyphs as the box grows); `.crop(true)` forces - * it on for a non-morph the default wouldn't otherwise crop. - */ - crop(enabled?: boolean): this; - /** - * By default a subject's layer nests under its nearest DOM-ancestor layer - * (`view-transition-group: contain`), so the ancestor's clip/transform/opacity - * apply to it through the transition - mirroring how the DOM actually paints, - * and letting a wrapper crop its child for the whole morph rather than only - * once the live DOM takes back over. (Needs a browser that supports nested - * view-transition groups; elsewhere it degrades to the flat default.) - * - * Call `.group(false)` to opt out: the layer stays flat and top-level, so it - * animates independently and escapes an ancestor's clip - e.g. an element - * that should lift out of a card and fly across, which nesting would clip. - */ - group(enabled?: boolean): this; - /** - * Tag this subject's generated layers with a `view-transition-class`, so - * they can be targeted from CSS - `::view-transition-group(.name)`, - * `::view-transition-old/new(.name)`, `::view-transition-image-pair(.name)` - * - without the opaque generated `view-transition-name`. Because `.add()` - * can match many elements, a shared class targets them all at once (and, - * for a pair, both ends). The escape hatch for z-index / custom keyframes - * on a morph layer. - */ - class(name: string): this; - /** - * Set the transition for this subject's morph. The morph is enabled - * automatically by `.add()`; this just customises its timing (duration, - * easing, a `delay`/`stagger`, …). On the implicit `root` subject it also - * opts the page into the transition (the root crossfade). - */ - layout(options?: AnimationOptions): this; - enter(keyframes: DOMKeyframesDefinition, options?: AnimationOptions): this; - exit(keyframes: DOMKeyframesDefinition, options?: AnimationOptions): this; - /** - * Animate the new view directly, whether the element is appearing or - * persisting (unlike `.enter()`, which only fires for a pure newcomer). - * Pair with `.old()` for a crossfade or slide-through. - */ - new(keyframes: DOMKeyframesDefinition, options?: AnimationOptions): this; - /** - * Animate the old view directly, whether the element is leaving or - * persisting (unlike `.exit()`, which only fires for a pure leaver). - */ - old(keyframes: DOMKeyframesDefinition, options?: AnimationOptions): this; - updateTarget(target: "enter" | "exit" | "layout" | "new" | "old", keyframes: DOMKeyframesDefinition, options?: AnimationOptions): void; - then(resolve: () => void, reject?: () => void): Promise; -} -declare function animateView(update: () => void | Promise, options?: ViewTransitionOptions): ViewTransitionBuilder; - -declare function getViewAnimationLayerInfo(pseudoElement: string): { - layer: string; - type: string; -} | null; - -declare function getViewAnimations(): Animation[]; - -interface DOMVisualElementOptions { - /** - * If `true`, this element will be included in the projection tree. - * - * Default: `true` - * - * @public - */ - allowProjection?: boolean; - /** - * Allow this element to be GPU-accelerated. We currently enable this by - * adding a `translateZ(0)`. - * - * @public - */ - enableHardwareAcceleration?: boolean; -} - -declare abstract class DOMVisualElement extends VisualElement { - sortInstanceNodePosition(a: Instance, b: Instance): number; - getBaseTargetFromProps(props: MotionNodeOptions, key: string): AnyResolvedKeyframe | MotionValue | undefined; - removeValueFromRenderState(key: string, { vars, style }: HTMLRenderState): void; - KeyframeResolver: typeof DOMKeyframesResolver; - childSubscription?: VoidFunction; - handleChildMotionValue(): void; -} - -/** - * Feature base class for extending VisualElement functionality. - * Features are plugins that can be mounted/unmounted to add behavior - * like gestures, animations, or layout tracking. - */ -declare abstract class Feature { - isMounted: boolean; - node: VisualElement; - constructor(node: VisualElement); - abstract mount(): void; - abstract unmount(): void; - update(): void; -} - -declare function renderHTML(element: HTMLElement, { style, vars }: HTMLRenderState, styleProp?: MotionStyle, projection?: any): void; - -declare class HTMLVisualElement extends DOMVisualElement { - type: string; - mount(instance: HTMLElement): void; - readValueFromInstance(instance: HTMLElement, key: string): AnyResolvedKeyframe | null | undefined; - measureInstanceViewportBox(instance: HTMLElement, { transformPagePoint }: MotionNodeOptions & Partial): Box; - build(renderState: HTMLRenderState, latestValues: ResolvedValues$1, props: MotionNodeOptions): void; - scrapeMotionValuesFromProps(props: MotionNodeOptions, prevProps: MotionNodeOptions, visualElement: VisualElement): { - [key: string]: any; - }; - renderInstance: typeof renderHTML; -} - -interface ObjectRenderState { - output: ResolvedValues$1; -} -declare class ObjectVisualElement extends VisualElement { - type: string; - readValueFromInstance(instance: Object, key: string): undefined; - getBaseTargetFromProps(): undefined; - removeValueFromRenderState(key: string, renderState: ObjectRenderState): void; - measureInstanceViewportBox(): motion_utils.Box; - build(renderState: ObjectRenderState, latestValues: ResolvedValues$1): void; - renderInstance(instance: Object, { output }: ObjectRenderState): void; - sortInstanceNodePosition(): number; -} - -declare const visualElementStore: WeakMap>; - -declare class SVGVisualElement extends DOMVisualElement { - type: string; - isSVGTag: boolean; - getBaseTargetFromProps(props: MotionNodeOptions, key: string): AnyResolvedKeyframe | MotionValue | undefined; - readValueFromInstance(instance: SVGElement, key: string): any; - measureInstanceViewportBox: () => motion_utils.Box; - scrapeMotionValuesFromProps(props: MotionNodeOptions, prevProps: MotionNodeOptions, visualElement: VisualElement): { - [key: string]: any; - }; - build(renderState: SVGRenderState, latestValues: ResolvedValues$1, props: MotionNodeOptions): void; - renderInstance(instance: SVGElement, renderState: SVGRenderState, styleProp?: MotionStyle | undefined, projection?: any): void; - mount(instance: SVGElement): void; -} - -type VariantStateContext = { - initial?: string | string[]; - animate?: string | string[]; - exit?: string | string[]; - whileHover?: string | string[]; - whileDrag?: string | string[]; - whileFocus?: string | string[]; - whileTap?: string | string[]; -}; -/** - * Get variant context from a visual element's parent chain. - * Uses `any` type for visualElement to avoid circular dependencies. - */ -declare function getVariantContext(visualElement?: any): undefined | VariantStateContext; - -declare function isAnimationControls(v?: unknown): v is LegacyAnimationControls; - -declare function isControllingVariants(props: MotionNodeOptions): boolean; -declare function isVariantNode(props: MotionNodeOptions): boolean; - -/** - * Minimal interface for projection node properties used by scale correctors. - * This avoids circular dependencies with the full IProjectionNode interface. - */ -interface ScaleCorrectionNode { - target?: Box; - treeScale?: Point; - projectionDelta?: Delta; -} -type ScaleCorrector = (latest: AnyResolvedKeyframe, node: ScaleCorrectionNode) => AnyResolvedKeyframe; -interface ScaleCorrectorDefinition { - correct: ScaleCorrector; - applyTo?: string[]; - isCSSVariable?: boolean; -} -interface ScaleCorrectorMap { - [key: string]: ScaleCorrectorDefinition; -} - -declare const scaleCorrectors: ScaleCorrectorMap; -declare function addScaleCorrector(correctors: ScaleCorrectorMap): void; - -declare function isForcedMotionValue(key: string, { layout, layoutId }: MotionNodeOptions): boolean; - -/** - * Decides if the supplied variable is variant label - */ -declare function isVariantLabel(v: unknown): v is string | string[]; - -type MotionStyleLike = Record; -/** - * Updates motion values from props changes. - * Uses `any` type for element to avoid circular dependencies with VisualElement. - */ -declare function updateMotionValuesFromProps(element: any, next: MotionStyleLike, prev: MotionStyleLike): MotionStyleLike; - -/** - * Resolves a variant if it's a variant resolver. - * Uses `any` type for visualElement to avoid circular dependencies. - */ -declare function resolveVariant(visualElement: any, definition?: TargetAndTransition | TargetResolver, custom?: any): TargetAndTransition; -declare function resolveVariant(visualElement: any, definition?: AnimationDefinition, custom?: any): TargetAndTransition | undefined; - -declare function resolveVariantFromProps(props: MotionNodeOptions, definition: TargetAndTransition | TargetResolver, custom?: any, visualElement?: any): TargetAndTransition; -declare function resolveVariantFromProps(props: MotionNodeOptions, definition?: AnimationDefinition, custom?: any, visualElement?: any): undefined | TargetAndTransition; - -declare function setTarget(visualElement: VisualElement, definition: AnimationDefinition): void; - -declare const variantPriorityOrder: AnimationType[]; -declare const variantProps: string[]; - -interface ReducedMotionState { - current: boolean | null; -} -declare const prefersReducedMotion: ReducedMotionState; -declare const hasReducedMotionListener: { - current: boolean; -}; - -declare function initPrefersReducedMotion(): void; - -/** - * Bounding boxes tend to be defined as top, left, right, bottom. For various operations - * it's easier to consider each axis individually. This function returns a bounding box - * as a map of single-axis min/max values. - */ -declare function convertBoundingBoxToBox({ top, left, right, bottom, }: BoundingBox): Box; -declare function convertBoxToBoundingBox({ x, y }: Box): BoundingBox; -/** - * Applies a TransformPoint function to a bounding box. TransformPoint is usually a function - * provided by Framer to allow measured points to be corrected for device scaling. This is used - * when measuring DOM elements and DOM event points. - */ -declare function transformBoxPoints(point: BoundingBox, transformPoint?: TransformPoint): BoundingBox; - -/** - * Reset an axis to the provided origin box. - * - * This is a mutative operation. - */ -declare function copyAxisInto(axis: Axis, originAxis: Axis): void; -/** - * Reset a box to the provided origin box. - * - * This is a mutative operation. - */ -declare function copyBoxInto(box: Box, originBox: Box): void; -/** - * Reset a delta to the provided origin box. - * - * This is a mutative operation. - */ -declare function copyAxisDeltaInto(delta: AxisDelta, originDelta: AxisDelta): void; - -/** - * Scales a point based on a factor and an originPoint - */ -declare function scalePoint(point: number, scale: number, originPoint: number): number; -/** - * Applies a translate/scale delta to a point - */ -declare function applyPointDelta(point: number, translate: number, scale: number, originPoint: number, boxScale?: number): number; -/** - * Applies a translate/scale delta to an axis - */ -declare function applyAxisDelta(axis: Axis, translate: number | undefined, scale: number | undefined, originPoint: number, boxScale?: number): void; -/** - * Applies a translate/scale delta to a box - */ -declare function applyBoxDelta(box: Box, { x, y }: Delta): void; -/** - * Apply a tree of deltas to a box. We do this to calculate the effect of all the transforms - * in a tree upon our box before then calculating how to project it into our desired viewport-relative box - * - * This is the final nested loop within updateLayoutDelta for future refactoring - */ -declare function applyTreeDeltas(box: Box, treeScale: Point, treePath: any[], isSharedTransition?: boolean): void; -declare function translateAxis(axis: Axis, distance: number): void; -/** - * Apply a transform to an axis from the latest resolved motion values. - * This function basically acts as a bridge between a flat motion value map - * and applyAxisDelta - */ -declare function transformAxis(axis: Axis, axisTranslate?: number, axisScale?: number, boxScale?: number, axisOrigin?: number): void; -/** - * Apply a transform to a box from the latest resolved motion values. - */ -declare function transformBox(box: Box, transform: ResolvedValues$1, sourceBox?: Box): void; - -declare function calcLength(axis: Axis): number; -declare function isNear(value: number, target: number, maxDistance: number): boolean; -declare function calcAxisDelta(delta: AxisDelta, source: Axis, target: Axis, origin?: number): void; -declare function calcBoxDelta(delta: Delta, source: Box, target: Box, origin?: ResolvedValues$1): void; -declare function calcRelativeAxis(target: Axis, relative: Axis, parent: Axis, anchor?: number): void; -declare function calcRelativeBox(target: Box, relative: Box, parent: Box, anchor?: Point): void; -declare function calcRelativeAxisPosition(target: Axis, layout: Axis, parent: Axis, anchor?: number): void; -declare function calcRelativePosition(target: Box, layout: Box, parent: Box, anchor?: Point): void; - -/** - * Remove a delta from a point. This is essentially the steps of applyPointDelta in reverse - */ -declare function removePointDelta(point: number, translate: number, scale: number, originPoint: number, boxScale?: number): number; -/** - * Remove a delta from an axis. This is essentially the steps of applyAxisDelta in reverse - */ -declare function removeAxisDelta(axis: Axis, translate?: number | string, scale?: number, origin?: number, boxScale?: number, originAxis?: Axis, sourceAxis?: Axis): void; -/** - * Remove a transforms from an axis. This is essentially the steps of applyAxisTransforms in reverse - * and acts as a bridge between motion values and removeAxisDelta - */ -declare function removeAxisTransforms(axis: Axis, transforms: ResolvedValues$1, [key, scaleKey, originKey]: string[], origin?: Axis, sourceAxis?: Axis): void; -/** - * Remove a transforms from an box. This is essentially the steps of applyAxisBox in reverse - * and acts as a bridge between motion values and removeAxisDelta - */ -declare function removeBoxTransforms(box: Box, transforms: ResolvedValues$1, originBox?: Box, sourceBox?: Box): void; - -declare const createAxisDelta: () => AxisDelta; -declare const createDelta: () => Delta; -declare const createAxis: () => Axis; -declare const createBox: () => Box; - -declare function isDeltaZero(delta: Delta): boolean; -declare function axisEquals(a: Axis, b: Axis): boolean; -declare function boxEquals(a: Box, b: Box): boolean; -declare function axisEqualsRounded(a: Axis, b: Axis): boolean; -declare function boxEqualsRounded(a: Box, b: Box): boolean; -declare function aspectRatio(box: Box): number; -declare function axisDeltaEquals(a: AxisDelta, b: AxisDelta): boolean; - -type Callback = (axis: "x" | "y") => void; -declare function eachAxis(callback: Callback): void[]; - -declare function hasScale({ scale, scaleX, scaleY }: ResolvedValues$1): boolean; -declare function hasTransform(values: ResolvedValues$1): true | AnyResolvedKeyframe; -declare function has2DTranslate(values: ResolvedValues$1): boolean | "" | 0 | undefined; - -declare function measureViewportBox(instance: HTMLElement, transformPoint?: TransformPoint): motion_utils.Box; -declare function measurePageBox(element: HTMLElement, rootProjectionNode: any, transformPagePoint?: TransformPoint): motion_utils.Box; - -declare function pixelsToPercent(pixels: number, axis: Axis): number; -/** - * We always correct borderRadius as a percentage rather than pixels to reduce paints. - * For example, if you are projecting a box that is 100px wide with a 10px borderRadius - * into a box that is 200px wide with a 20px borderRadius, that is actually a 10% - * borderRadius in both states. If we animate between the two in pixels that will trigger - * a paint each time. If we animate between the two in percentage we'll avoid a paint. - */ -declare const correctBorderRadius: ScaleCorrectorDefinition; - -declare const correctBoxShadow: ScaleCorrectorDefinition; - -declare function buildProjectionTransform(delta: Delta, treeScale: Point, latestTransform?: ResolvedValues$1): string; - -declare function mixValues(target: ResolvedValues$1, follow: ResolvedValues$1, lead: ResolvedValues$1, progress: number, shouldCrossfadeOpacity: boolean, isOnlyMember: boolean): void; - -declare function animateSingleValue(value: MotionValue | V, keyframes: V | UnresolvedValueKeyframe[], options?: ValueAnimationTransition): AnimationPlaybackControlsWithThen; - -declare function addDomEvent(target: EventTarget, eventName: string, handler: EventListener, options?: AddEventListenerOptions): () => void; - -interface WithDepth { - depth: number; -} -declare const compareByDepth: (a: VisualElement, b: VisualElement) => number; - -declare class FlatTree { - private children; - private isDirty; - add(child: WithDepth): void; - remove(child: WithDepth): void; - forEach(callback: (child: WithDepth) => void): void; -} - -type DelayedFunction = (overshoot: number) => void; -/** - * Timeout defined in ms - */ -declare function delay(callback: DelayedFunction, timeout: number): () => void; -declare function delayInSeconds(callback: DelayedFunction, timeout: number): () => void; - -/** - * If the provided value is a MotionValue, this returns the actual value, otherwise just the value itself - */ -declare function resolveMotionValue(value?: AnyResolvedKeyframe | MotionValue): AnyResolvedKeyframe; - -interface Measurements { - animationId: number; - measuredBox: Box; - layoutBox: Box; - latestValues: ResolvedValues$1; - source: number; -} -type Phase = "snapshot" | "measure"; -interface ScrollMeasurements { - animationId: number; - phase: Phase; - offset: Point; - isRoot: boolean; - wasRoot: boolean; -} -type LayoutEvents = "willUpdate" | "didUpdate" | "beforeMeasure" | "measure" | "projectionUpdate" | "animationStart" | "animationComplete"; -interface IProjectionNode { - linkedParentVersion: number; - layoutVersion: number; - id: number; - animationId: number; - animationCommitId: number; - parent?: IProjectionNode; - relativeParent?: IProjectionNode; - root?: IProjectionNode; - children: Set; - path: IProjectionNode[]; - nodes?: FlatTree; - depth: number; - instance: I | undefined; - mount: (node: I, isLayoutDirty?: boolean) => void; - unmount: () => void; - options: ProjectionNodeOptions; - setOptions(options: ProjectionNodeOptions): void; - layout?: Measurements; - snapshot?: Measurements; - target?: Box; - relativeTarget?: Box; - relativeTargetOrigin?: Box; - targetDelta?: Delta; - targetWithTransforms?: Box; - scroll?: ScrollMeasurements; - treeScale?: Point; - projectionDelta?: Delta; - projectionDeltaWithTransform?: Delta; - latestValues: ResolvedValues$1; - isLayoutDirty: boolean; - isProjectionDirty: boolean; - isSharedProjectionDirty: boolean; - isTransformDirty: boolean; - resolvedRelativeTargetAt?: number; - shouldResetTransform: boolean; - prevTransformTemplateValue: string | undefined; - isUpdateBlocked(): boolean; - updateManuallyBlocked: boolean; - updateBlockedByResize: boolean; - blockUpdate(): void; - unblockUpdate(): void; - isUpdating: boolean; - needsReset: boolean; - startUpdate(): void; - willUpdate(notifyListeners?: boolean): void; - didUpdate(): void; - measure(removeTransform?: boolean): Measurements; - measurePageBox(): Box; - updateLayout(): void; - updateSnapshot(): void; - clearSnapshot(): void; - updateScroll(phase?: Phase): void; - scheduleUpdateProjection(): void; - scheduleCheckAfterUnmount(): void; - checkUpdateFailed(): void; - sharedNodes: Map; - registerSharedNode(id: string, node: IProjectionNode): void; - getStack(): NodeStack | undefined; - isVisible: boolean; - hide(): void; - show(): void; - scheduleRender(notifyAll?: boolean): void; - getClosestProjectingParent(): IProjectionNode | undefined; - setTargetDelta(delta: Delta): void; - resetTransform(): void; - resetSkewAndRotation(): void; - applyTransform(box: Box, transformOnly?: boolean, output?: Box): Box; - resolveTargetDelta(force?: boolean): void; - calcProjection(): void; - applyProjectionStyles(targetStyle: CSSStyleDeclaration, styleProp?: MotionStyle): void; - clearMeasurements(): void; - resetTree(): void; - isProjecting(): boolean; - animationValues?: ResolvedValues$1; - currentAnimation?: JSAnimation; - isTreeAnimating?: boolean; - isAnimationBlocked?: boolean; - isTreeAnimationBlocked: () => boolean; - setAnimationOrigin(delta: Delta, hasOnlyRelativeTargetChanged?: boolean, pathFn?: MotionPath): void; - startAnimation(transition: ValueTransition): void; - finishAnimation(): void; - hasCheckedOptimisedAppear: boolean; - isLead(): boolean; - promote(options?: { - needsReset?: boolean; - transition?: Transition; - preserveFollowOpacity?: boolean; - }): void; - relegate(): boolean; - resumeFrom?: IProjectionNode; - resumingFrom?: IProjectionNode; - isPresent?: boolean; - addEventListener(name: LayoutEvents, handler: any): VoidFunction; - notifyListeners(name: LayoutEvents, ...args: any): void; - hasListeners(name: LayoutEvents): boolean; - hasTreeAnimated: boolean; - preserveOpacity?: boolean; -} -interface LayoutUpdateData { - layout: Box; - snapshot: Measurements; - delta: Delta; - layoutDelta: Delta; - hasLayoutChanged: boolean; - hasRelativeLayoutChanged: boolean; -} -type LayoutUpdateHandler = (data: LayoutUpdateData) => void; -interface ProjectionNodeConfig { - defaultParent?: () => IProjectionNode; - attachResizeListener?: (instance: I, notifyResize: VoidFunction) => VoidFunction; - measureScroll: (instance: I) => Point; - checkIsScrollRoot: (instance: I) => boolean; - resetTransform?: (instance: I, value?: string) => void; -} -/** - * Configuration for initial promotion of shared layout elements. - * This was originally in React's SwitchLayoutGroupContext but is now - * framework-agnostic to support vanilla JS usage. - */ -interface InitialPromotionConfig { - /** - * The initial transition to use when the elements in this group mount (and automatically promoted). - * Subsequent updates should provide a transition in the promote method. - */ - transition?: Transition; - /** - * If the follow tree should preserve its opacity when the lead is promoted on mount - */ - shouldPreserveFollowOpacity?: (member: IProjectionNode) => boolean; -} -interface ProjectionNodeOptions { - animate?: boolean; - layoutScroll?: boolean; - layoutRoot?: boolean; - alwaysMeasureLayout?: boolean; - onExitComplete?: VoidFunction; - animationType?: "size" | "position" | "both" | "preserve-aspect" | "x" | "y"; - layoutId?: string; - layout?: boolean | string; - visualElement?: VisualElement; - crossfade?: boolean; - transition?: Transition; - initialPromotionConfig?: InitialPromotionConfig; - layoutDependency?: unknown; - layoutAnchor?: Point | false; -} -type ProjectionEventName = "layoutUpdate" | "projectionUpdate"; - -declare class NodeStack { - lead?: IProjectionNode; - prevLead?: IProjectionNode; - members: IProjectionNode[]; - add(node: IProjectionNode): void; - remove(node: IProjectionNode): void; - relegate(node: IProjectionNode): boolean; - promote(node: IProjectionNode, preserveFollowOpacity?: boolean): void; - exitAnimationComplete(): void; - scheduleRender(): void; - removeLeadSnapshot(): void; -} - -declare function createProjectionNode({ attachResizeListener, defaultParent, measureScroll, checkIsScrollRoot, resetTransform, }: ProjectionNodeConfig): { - new (latestValues?: ResolvedValues$1, parent?: IProjectionNode | undefined): { - /** - * A unique ID generated for every projection node. - */ - id: number; - /** - * An id that represents a unique session instigated by startUpdate. - */ - animationId: number; - animationCommitId: number; - /** - * A reference to the platform-native node (currently this will be a HTMLElement). - */ - instance: I | undefined; - /** - * A reference to the root projection node. There'll only ever be one tree and one root. - */ - root: IProjectionNode; - /** - * A reference to this node's parent. - */ - parent?: IProjectionNode | undefined; - /** - * A path from this node to the root node. This provides a fast way to iterate - * back up the tree. - */ - path: IProjectionNode[]; - /** - * A Set containing all this component's children. This is used to iterate - * through the children. - * - * TODO: This could be faster to iterate as a flat array stored on the root node. - */ - children: Set>; - /** - * Options for the node. We use this to configure what kind of layout animations - * we should perform (if any). - */ - options: ProjectionNodeOptions; - /** - * A snapshot of the element's state just before the current update. This is - * hydrated when this node's `willUpdate` method is called and scrubbed at the - * end of the tree's `didUpdate` method. - */ - snapshot: Measurements | undefined; - /** - * A box defining the element's layout relative to the page. This will have been - * captured with all parent scrolls and projection transforms unset. - */ - layout: Measurements | undefined; - /** - * The layout used to calculate the previous layout animation. We use this to compare - * layouts between renders and decide whether we need to trigger a new layout animation - * or just let the current one play out. - */ - targetLayout?: Box | undefined; - /** - * A mutable data structure we use to apply all parent transforms currently - * acting on the element's layout. It's from here we can calculate the projectionDelta - * required to get the element from its layout into its calculated target box. - */ - layoutCorrected: Box; - /** - * An ideal projection transform we want to apply to the element. This is calculated, - * usually when an element's layout has changed, and we want the element to look as though - * its in its previous layout on the next frame. From there, we animated it down to 0 - * to animate the element to its new layout. - */ - targetDelta?: Delta | undefined; - /** - * A mutable structure representing the visual bounding box on the page where we want - * and element to appear. This can be set directly but is currently derived once a frame - * from apply targetDelta to layout. - */ - target?: Box | undefined; - /** - * A mutable structure describing a visual bounding box relative to the element's - * projected parent. If defined, target will be derived from this rather than targetDelta. - * If not defined, we'll attempt to calculate on the first layout animation frame - * based on the targets calculated from targetDelta. This will transfer a layout animation - * from viewport-relative to parent-relative. - */ - relativeTarget?: Box | undefined; - relativeTargetOrigin?: Box | undefined; - relativeParent?: IProjectionNode | undefined; - /** - * We use this to detect when its safe to shut down part of a projection tree. - * We have to keep projecting children for scale correction and relative projection - * until all their parents stop performing layout animations. - */ - isTreeAnimating: boolean; - isAnimationBlocked: boolean; - /** - * If true, attempt to resolve relativeTarget. - */ - attemptToResolveRelativeTarget?: boolean | undefined; - /** - * A mutable structure that represents the target as transformed by the element's - * latest user-set transforms (ie scale, x) - */ - targetWithTransforms?: Box | undefined; - /** - * The previous projection delta, which we can compare with the newly calculated - * projection delta to see if we need to render. - */ - prevProjectionDelta?: Delta | undefined; - /** - * A calculated transform that will project an element from its layoutCorrected - * into the target. This will be used by children to calculate their own layoutCorrect boxes. - */ - projectionDelta?: Delta | undefined; - /** - * A calculated transform that will project an element from its layoutCorrected - * into the targetWithTransforms. - */ - projectionDeltaWithTransform?: Delta | undefined; - /** - * If we're tracking the scroll of this element, we store it here. - */ - scroll?: ScrollMeasurements | undefined; - /** - * Flag to true if we think this layout has been changed. We can't always know this, - * currently we set it to true every time a component renders, or if it has a layoutDependency - * if that has changed between renders. Additionally, components can be grouped by LayoutGroup - * and if one node is dirtied, they all are. - */ - isLayoutDirty: boolean; - /** - * Flag to true if we think the projection calculations for this node needs - * recalculating as a result of an updated transform or layout animation. - */ - isProjectionDirty: boolean; - /** - * Flag to true if the layout *or* transform has changed. This then gets propagated - * throughout the projection tree, forcing any element below to recalculate on the next frame. - */ - isSharedProjectionDirty: boolean; - /** - * Flag transform dirty. This gets propagated throughout the whole tree but is only - * respected by shared nodes. - */ - isTransformDirty: boolean; - /** - * Block layout updates for instant layout transitions throughout the tree. - */ - updateManuallyBlocked: boolean; - updateBlockedByResize: boolean; - /** - * Set to true between the start of the first `willUpdate` call and the end of the `didUpdate` - * call. - */ - isUpdating: boolean; - /** - * If this is an SVG element we currently disable projection transforms - */ - isSVG: boolean; - /** - * Flag to true (during promotion) if a node doing an instant layout transition needs to reset - * its projection styles. - */ - needsReset: boolean; - /** - * Flags whether this node should have its transform reset prior to measuring. - */ - shouldResetTransform: boolean; - /** - * Store whether this node has been checked for optimised appear animations. As - * effects fire bottom-up, and we want to look up the tree for appear animations, - * this makes sure we only check each path once, stopping at nodes that - * have already been checked. - */ - hasCheckedOptimisedAppear: boolean; - /** - * An object representing the calculated contextual/accumulated/tree scale. - * This will be used to scale calculcated projection transforms, as these are - * calculated in screen-space but need to be scaled for elements to layoutly - * make it to their calculated destinations. - * - * TODO: Lazy-init - */ - treeScale: Point; - /** - * Is hydrated with a projection node if an element is animating from another. - */ - resumeFrom?: IProjectionNode | undefined; - /** - * Is hydrated with a projection node if an element is animating from another. - */ - resumingFrom?: IProjectionNode | undefined; - /** - * A reference to the element's latest animated values. This is a reference shared - * between the element's VisualElement and the ProjectionNode. - */ - latestValues: ResolvedValues$1; - /** - * - */ - eventHandlers: Map>; - nodes?: FlatTree | undefined; - depth: number; - /** - * If transformTemplate generates a different value before/after the - * update, we need to reset the transform. - */ - prevTransformTemplateValue: string | undefined; - preserveOpacity?: boolean | undefined; - hasTreeAnimated: boolean; - layoutVersion: number; - addEventListener(name: LayoutEvents, handler: any): VoidFunction; - notifyListeners(name: LayoutEvents, ...args: any): void; - hasListeners(name: LayoutEvents): boolean; - /** - * Lifecycles - */ - mount(instance: I): void; - unmount(): void; - blockUpdate(): void; - unblockUpdate(): void; - isUpdateBlocked(): boolean; - isTreeAnimationBlocked(): boolean; - startUpdate(): void; - getTransformTemplate(): TransformTemplate | undefined; - willUpdate(shouldNotifyListeners?: boolean): void; - updateScheduled: boolean; - update(): void; - scheduleUpdate: () => void; - didUpdate(): void; - clearAllSnapshots(): void; - projectionUpdateScheduled: boolean; - scheduleUpdateProjection(): void; - scheduleCheckAfterUnmount(): void; - checkUpdateFailed: () => void; - /** - * This is a multi-step process as shared nodes might be of different depths. Nodes - * are sorted by depth order, so we need to resolve the entire tree before moving to - * the next step. - */ - updateProjection: () => void; - /** - * Update measurements - */ - updateSnapshot(): void; - updateLayout(): void; - updateScroll(phase?: Phase): void; - resetTransform(): void; - measure(removeTransform?: boolean): { - animationId: number; - measuredBox: Box; - layoutBox: Box; - latestValues: {}; - source: number; - }; - measurePageBox(): Box; - removeElementScroll(box: Box): Box; - applyTransform(box: Box, transformOnly?: boolean, output?: Box): Box; - removeTransform(box: Box): Box; - setTargetDelta(delta: Delta): void; - setOptions(options: ProjectionNodeOptions): void; - clearMeasurements(): void; - forceRelativeParentToResolveTarget(): void; - /** - * Frame calculations - */ - resolvedRelativeTargetAt: number; - resolveTargetDelta(forceRecalculation?: boolean): void; - getClosestProjectingParent(): IProjectionNode | undefined; - isProjecting(): boolean; - linkedParentVersion: number; - createRelativeTarget(relativeParent: IProjectionNode, layout: Box, parentLayout: Box): void; - removeRelativeTarget(): void; - hasProjected: boolean; - calcProjection(): void; - isVisible: boolean; - hide(): void; - show(): void; - scheduleRender(notifyAll?: boolean): void; - createProjectionDeltas(): void; - /** - * Animation - */ - animationValues?: ResolvedValues$1 | undefined; - pendingAnimation?: Process | undefined; - currentAnimation?: JSAnimation | undefined; - mixTargetDelta: (progress: number) => void; - animationProgress: number; - setAnimationOrigin(delta: Delta, hasOnlyRelativeTargetChanged?: boolean, pathFn?: MotionPath): void; - motionValue?: MotionValue | undefined; - startAnimation(options: ValueAnimationOptions): void; - completeAnimation(): void; - finishAnimation(): void; - applyTransformsToTarget(): void; - /** - * Shared layout - */ - sharedNodes: Map; - registerSharedNode(layoutId: string, node: IProjectionNode): void; - isLead(): boolean; - getLead(): IProjectionNode | any; - getPrevLead(): IProjectionNode | undefined; - getStack(): NodeStack | undefined; - promote({ needsReset, transition, preserveFollowOpacity, }?: { - needsReset?: boolean | undefined; - transition?: Transition | undefined; - preserveFollowOpacity?: boolean | undefined; - }): void; - relegate(): boolean; - resetSkewAndRotation(): void; - applyProjectionStyles(targetStyle: any, styleProp?: MotionStyle): void; - clearSnapshot(): void; - resetTree(): void; - }; -}; -declare function propagateDirtyNodes(node: IProjectionNode): void; -declare function cleanDirtyNodes(node: IProjectionNode): void; - -declare const DocumentProjectionNode: { - new (latestValues?: ResolvedValues$1, parent?: IProjectionNode | undefined): { - id: number; - animationId: number; - animationCommitId: number; - instance: Window | undefined; - root: IProjectionNode; - parent?: IProjectionNode | undefined; - path: IProjectionNode[]; - children: Set>; - options: ProjectionNodeOptions; - snapshot: Measurements | undefined; - layout: Measurements | undefined; - targetLayout?: motion_utils.Box | undefined; - layoutCorrected: motion_utils.Box; - targetDelta?: motion_utils.Delta | undefined; - target?: motion_utils.Box | undefined; - relativeTarget?: motion_utils.Box | undefined; - relativeTargetOrigin?: motion_utils.Box | undefined; - relativeParent?: IProjectionNode | undefined; - isTreeAnimating: boolean; - isAnimationBlocked: boolean; - attemptToResolveRelativeTarget?: boolean | undefined; - targetWithTransforms?: motion_utils.Box | undefined; - prevProjectionDelta?: motion_utils.Delta | undefined; - projectionDelta?: motion_utils.Delta | undefined; - projectionDeltaWithTransform?: motion_utils.Delta | undefined; - scroll?: ScrollMeasurements | undefined; - isLayoutDirty: boolean; - isProjectionDirty: boolean; - isSharedProjectionDirty: boolean; - isTransformDirty: boolean; - updateManuallyBlocked: boolean; - updateBlockedByResize: boolean; - isUpdating: boolean; - isSVG: boolean; - needsReset: boolean; - shouldResetTransform: boolean; - hasCheckedOptimisedAppear: boolean; - treeScale: motion_utils.Point; - resumeFrom?: IProjectionNode | undefined; - resumingFrom?: IProjectionNode | undefined; - latestValues: ResolvedValues$1; - eventHandlers: Map>; - nodes?: FlatTree | undefined; - depth: number; - prevTransformTemplateValue: string | undefined; - preserveOpacity?: boolean | undefined; - hasTreeAnimated: boolean; - layoutVersion: number; - addEventListener(name: LayoutEvents, handler: any): VoidFunction; - notifyListeners(name: LayoutEvents, ...args: any): void; - hasListeners(name: LayoutEvents): boolean; - mount(instance: Window): void; - unmount(): void; - blockUpdate(): void; - unblockUpdate(): void; - isUpdateBlocked(): boolean; - isTreeAnimationBlocked(): boolean; - startUpdate(): void; - getTransformTemplate(): TransformTemplate | undefined; - willUpdate(shouldNotifyListeners?: boolean): void; - updateScheduled: boolean; - update(): void; - scheduleUpdate: () => void; - didUpdate(): void; - clearAllSnapshots(): void; - projectionUpdateScheduled: boolean; - scheduleUpdateProjection(): void; - scheduleCheckAfterUnmount(): void; - checkUpdateFailed: () => void; - updateProjection: () => void; - updateSnapshot(): void; - updateLayout(): void; - updateScroll(phase?: Phase): void; - resetTransform(): void; - measure(removeTransform?: boolean): { - animationId: number; - measuredBox: motion_utils.Box; - layoutBox: motion_utils.Box; - latestValues: {}; - source: number; - }; - measurePageBox(): motion_utils.Box; - removeElementScroll(box: motion_utils.Box): motion_utils.Box; - applyTransform(box: motion_utils.Box, transformOnly?: boolean, output?: motion_utils.Box | undefined): motion_utils.Box; - removeTransform(box: motion_utils.Box): motion_utils.Box; - setTargetDelta(delta: motion_utils.Delta): void; - setOptions(options: ProjectionNodeOptions): void; - clearMeasurements(): void; - forceRelativeParentToResolveTarget(): void; - resolvedRelativeTargetAt: number; - resolveTargetDelta(forceRecalculation?: boolean): void; - getClosestProjectingParent(): IProjectionNode | undefined; - isProjecting(): boolean; - linkedParentVersion: number; - createRelativeTarget(relativeParent: IProjectionNode, layout: motion_utils.Box, parentLayout: motion_utils.Box): void; - removeRelativeTarget(): void; - hasProjected: boolean; - calcProjection(): void; - isVisible: boolean; - hide(): void; - show(): void; - scheduleRender(notifyAll?: boolean): void; - createProjectionDeltas(): void; - animationValues?: ResolvedValues$1 | undefined; - pendingAnimation?: Process | undefined; - currentAnimation?: JSAnimation | undefined; - mixTargetDelta: (progress: number) => void; - animationProgress: number; - setAnimationOrigin(delta: motion_utils.Delta, hasOnlyRelativeTargetChanged?: boolean, pathFn?: MotionPath | undefined): void; - motionValue?: MotionValue | undefined; - startAnimation(options: ValueAnimationOptions): void; - completeAnimation(): void; - finishAnimation(): void; - applyTransformsToTarget(): void; - sharedNodes: Map; - registerSharedNode(layoutId: string, node: IProjectionNode): void; - isLead(): boolean; - getLead(): IProjectionNode | any; - getPrevLead(): IProjectionNode | undefined; - getStack(): NodeStack | undefined; - promote({ needsReset, transition, preserveFollowOpacity, }?: { - needsReset?: boolean | undefined; - transition?: Transition | undefined; - preserveFollowOpacity?: boolean | undefined; - }): void; - relegate(): boolean; - resetSkewAndRotation(): void; - applyProjectionStyles(targetStyle: any, styleProp?: MotionStyle | undefined): void; - clearSnapshot(): void; - resetTree(): void; - }; -}; - -interface NodeGroup { - add: (node: IProjectionNode) => void; - remove: (node: IProjectionNode) => void; - dirty: VoidFunction; -} -declare function nodeGroup(): NodeGroup; - -declare const rootProjectionNode: { - current: IProjectionNode | undefined; -}; -declare const HTMLProjectionNode: { - new (latestValues?: ResolvedValues$1, parent?: IProjectionNode | undefined): { - id: number; - animationId: number; - animationCommitId: number; - instance: HTMLElement | undefined; - root: IProjectionNode; - parent?: IProjectionNode | undefined; - path: IProjectionNode[]; - children: Set>; - options: ProjectionNodeOptions; - snapshot: Measurements | undefined; - layout: Measurements | undefined; - targetLayout?: motion_utils.Box | undefined; - layoutCorrected: motion_utils.Box; - targetDelta?: motion_utils.Delta | undefined; - target?: motion_utils.Box | undefined; - relativeTarget?: motion_utils.Box | undefined; - relativeTargetOrigin?: motion_utils.Box | undefined; - relativeParent?: IProjectionNode | undefined; - isTreeAnimating: boolean; - isAnimationBlocked: boolean; - attemptToResolveRelativeTarget?: boolean | undefined; - targetWithTransforms?: motion_utils.Box | undefined; - prevProjectionDelta?: motion_utils.Delta | undefined; - projectionDelta?: motion_utils.Delta | undefined; - projectionDeltaWithTransform?: motion_utils.Delta | undefined; - scroll?: ScrollMeasurements | undefined; - isLayoutDirty: boolean; - isProjectionDirty: boolean; - isSharedProjectionDirty: boolean; - isTransformDirty: boolean; - updateManuallyBlocked: boolean; - updateBlockedByResize: boolean; - isUpdating: boolean; - isSVG: boolean; - needsReset: boolean; - shouldResetTransform: boolean; - hasCheckedOptimisedAppear: boolean; - treeScale: motion_utils.Point; - resumeFrom?: IProjectionNode | undefined; - resumingFrom?: IProjectionNode | undefined; - latestValues: ResolvedValues$1; - eventHandlers: Map>; - nodes?: FlatTree | undefined; - depth: number; - prevTransformTemplateValue: string | undefined; - preserveOpacity?: boolean | undefined; - hasTreeAnimated: boolean; - layoutVersion: number; - addEventListener(name: LayoutEvents, handler: any): VoidFunction; - notifyListeners(name: LayoutEvents, ...args: any): void; - hasListeners(name: LayoutEvents): boolean; - mount(instance: HTMLElement): void; - unmount(): void; - blockUpdate(): void; - unblockUpdate(): void; - isUpdateBlocked(): boolean; - isTreeAnimationBlocked(): boolean; - startUpdate(): void; - getTransformTemplate(): TransformTemplate | undefined; - willUpdate(shouldNotifyListeners?: boolean): void; - updateScheduled: boolean; - update(): void; - scheduleUpdate: () => void; - didUpdate(): void; - clearAllSnapshots(): void; - projectionUpdateScheduled: boolean; - scheduleUpdateProjection(): void; - scheduleCheckAfterUnmount(): void; - checkUpdateFailed: () => void; - updateProjection: () => void; - updateSnapshot(): void; - updateLayout(): void; - updateScroll(phase?: Phase): void; - resetTransform(): void; - measure(removeTransform?: boolean): { - animationId: number; - measuredBox: motion_utils.Box; - layoutBox: motion_utils.Box; - latestValues: {}; - source: number; - }; - measurePageBox(): motion_utils.Box; - removeElementScroll(box: motion_utils.Box): motion_utils.Box; - applyTransform(box: motion_utils.Box, transformOnly?: boolean, output?: motion_utils.Box | undefined): motion_utils.Box; - removeTransform(box: motion_utils.Box): motion_utils.Box; - setTargetDelta(delta: motion_utils.Delta): void; - setOptions(options: ProjectionNodeOptions): void; - clearMeasurements(): void; - forceRelativeParentToResolveTarget(): void; - resolvedRelativeTargetAt: number; - resolveTargetDelta(forceRecalculation?: boolean): void; - getClosestProjectingParent(): IProjectionNode | undefined; - isProjecting(): boolean; - linkedParentVersion: number; - createRelativeTarget(relativeParent: IProjectionNode, layout: motion_utils.Box, parentLayout: motion_utils.Box): void; - removeRelativeTarget(): void; - hasProjected: boolean; - calcProjection(): void; - isVisible: boolean; - hide(): void; - show(): void; - scheduleRender(notifyAll?: boolean): void; - createProjectionDeltas(): void; - animationValues?: ResolvedValues$1 | undefined; - pendingAnimation?: Process | undefined; - currentAnimation?: JSAnimation | undefined; - mixTargetDelta: (progress: number) => void; - animationProgress: number; - setAnimationOrigin(delta: motion_utils.Delta, hasOnlyRelativeTargetChanged?: boolean, pathFn?: MotionPath | undefined): void; - motionValue?: MotionValue | undefined; - startAnimation(options: ValueAnimationOptions): void; - completeAnimation(): void; - finishAnimation(): void; - applyTransformsToTarget(): void; - sharedNodes: Map; - registerSharedNode(layoutId: string, node: IProjectionNode): void; - isLead(): boolean; - getLead(): IProjectionNode | any; - getPrevLead(): IProjectionNode | undefined; - getStack(): NodeStack | undefined; - promote({ needsReset, transition, preserveFollowOpacity, }?: { - needsReset?: boolean | undefined; - transition?: Transition | undefined; - preserveFollowOpacity?: boolean | undefined; - }): void; - relegate(): boolean; - resetSkewAndRotation(): void; - applyProjectionStyles(targetStyle: any, styleProp?: MotionStyle | undefined): void; - clearSnapshot(): void; - resetTree(): void; - }; -}; - -/** - * This should only ever be modified on the client otherwise it'll - * persist through server requests. If we need instanced states we - * could lazy-init via root. - */ -declare const globalProjectionState: { - /** - * Global flag as to whether the tree has animated since the last time - * we resized the window - */ - hasAnimatedSinceResize: boolean; - /** - * We set this to true once, on the first update. Any nodes added to the tree beyond that - * update will be given a `data-projection-id` attribute. - */ - hasEverUpdated: boolean; -}; - -declare function camelToDash(str: string): string; - -declare function buildHTMLStyles(state: HTMLRenderState, latestValues: ResolvedValues$1, transformTemplate?: MotionNodeOptions["transformTemplate"]): void; - -/** - * Build a CSS transform style from individual x/y/scale etc properties. - * - * This outputs with a default order of transforms/scales/rotations, this can be customised by - * providing a transformTemplate function. - */ -declare function buildTransform(latestValues: ResolvedValues$1, transform: HTMLRenderState["transform"], transformTemplate?: MotionNodeOptions["transformTemplate"]): string; - -declare function scrapeMotionValuesFromProps$1(props: MotionNodeOptions, prevProps: MotionNodeOptions, visualElement?: VisualElement): { - [key: string]: any; -}; - -/** - * Build SVG visual attributes, like cx and style.transform - */ -declare function buildSVGAttrs(state: SVGRenderState, { attrX, attrY, attrScale, pathLength, pathSpacing, pathOffset, ...latest }: ResolvedValues$1, isSVGTag: boolean, transformTemplate?: MotionNodeOptions["transformTemplate"], styleProp?: Record): void; - -/** - * A set of attribute names that are always read/written as camel case. - */ -declare const camelCaseAttributes: Set; - -declare const isSVGTag: (tag: unknown) => boolean; - -/** - * Build SVG path properties. Uses the path's measured length to convert - * our custom pathLength, pathSpacing and pathOffset into stroke-dashoffset - * and stroke-dasharray attributes. - * - * This function is mutative to reduce per-frame GC. - * - * Note: We use unitless values for stroke-dasharray and stroke-dashoffset - * because Safari incorrectly scales px values when the page is zoomed. - */ -declare function buildSVGPath(attrs: ResolvedValues$1, length: number, spacing?: number, offset?: number, useDashCase?: boolean): void; - -declare function renderSVG(element: SVGElement, renderState: SVGRenderState, _styleProp?: MotionStyle, projection?: any): void; - -declare function scrapeMotionValuesFromProps(props: MotionNodeOptions, prevProps: MotionNodeOptions, visualElement?: VisualElement): { - [key: string]: any; -}; - -type LayoutAnimationScope = Element | Document; -type LayoutBuilderResolve = (animation: GroupAnimation) => void; -type LayoutBuilderReject = (error: unknown) => void; -declare class LayoutAnimationBuilder { - private scope; - private updateDom; - private defaultOptions?; - private sharedTransitions; - private notifyReady; - private rejectReady; - private readyPromise; - private tracked; - private restorePoints; - private updateError; - constructor(scope: LayoutAnimationScope, updateDom: () => void | Promise, defaultOptions?: AnimationOptions | undefined); - shared(id: string, transition: AnimationOptions): this; - then(resolve: LayoutBuilderResolve, reject?: LayoutBuilderReject): Promise; - transitionFor(element: HTMLElement): Transition | undefined; - adopt(element: HTMLElement, node: IProjectionNode): void; - collectTargets(): HTMLElement[]; - runUpdate(): Promise | undefined; - reconcileAdditions(newMemberIds: Set): void; - reconcileRemovals(newMemberIds: Set): void; - getRoot(): IProjectionNode | undefined; - finalize(): void; -} -declare function parseAnimateLayoutArgs(scopeOrUpdateDom: ElementOrSelector | (() => void), updateDomOrOptions?: (() => void) | AnimationOptions, options?: AnimationOptions): { - scope: Element | Document; - updateDom: () => void; - defaultOptions?: AnimationOptions; -}; - -/** - * @deprecated - * - * Import as `frame` instead. - */ -declare const sync: Batcher; -/** - * @deprecated - * - * Use cancelFrame(callback) instead. - */ -declare const cancelSync: Record void>; - -export { type AccelerateConfig, type AcceptedAnimations, type ActiveStatsBuffer, type AnimationDefinition, type AnimationGeneratorName, type AnimationGeneratorType, type AnimationList, type AnimationOptions, type AnimationOrchestrationOptions, type AnimationPlaybackControls, type AnimationPlaybackControlsWithThen, type AnimationPlaybackLifecycles, type AnimationPlaybackOptions, type AnimationScope, type AnimationState$1 as AnimationState, type AnimationType, type AnimationTypeState, type AnyResolvedKeyframe, type ArcOptions, AsyncMotionValueAnimation, type Batcher, type CSSStyleDeclarationWithTransform, type CSSVariableName, type CSSVariableToken, type CancelProcess, type Color, type ComplexValueInfo, type ComplexValues, type DOMKeyframesDefinition, DOMKeyframesResolver, type DOMValueAnimationOptions, DOMVisualElement, type DOMVisualElementOptions, type DecayOptions, type DelayedFunction, DocumentProjectionNode, type DragElastic, type DragHandler, type DraggableProps, type DurationSpringOptions, type DynamicOption, type ElementOrSelector, type EventInfo, type EventOptions, Feature, type FeatureClass, FlatTree, type FollowValueOptions, type FrameData, type GeneratorFactory, type GeneratorFactoryFunction, GroupAnimation, GroupAnimationWithThen, type GroupedAnimations, type HSLA, HTMLProjectionNode, type HTMLRenderState, HTMLVisualElement, type HandoffFunction, type IProjectionNode, type InactiveStatsBuffer, type InertiaOptions, type InitialPromotionConfig, type InterpolateOptions, JSAnimation, type KeyframeGenerator, type KeyframeOptions, KeyframeResolver, LayoutAnimationBuilder, type LayoutEvents, type LayoutLifecycles, type LayoutProjectionMetrics, type LayoutProjectionStats, type LayoutUpdateData, type LayoutUpdateHandler, type LegacyAnimationControls, type MapInputRange, type Measurements, type Mixer, type MixerFactory, type MotionConfigContextProps, type MotionNodeAdvancedOptions, type MotionNodeAnimationOptions, type MotionNodeDragHandlers, type MotionNodeDraggableOptions, type MotionNodeEventOptions, type MotionNodeFocusHandlers, type MotionNodeHoverHandlers, type MotionNodeLayoutOptions, type MotionNodeOptions, type MotionNodePanHandlers, type MotionNodeTapHandlers, type MotionNodeViewportOptions, type MotionPath, type MotionStyle, MotionValue, type MotionValueEventCallbacks, type MotionValueOptions, type MultiTransformer, NativeAnimation, NativeAnimationExtended, type NativeAnimationOptions, type NativeAnimationOptionsExtended, NativeAnimationWrapper, type NodeGroup, NodeStack, type NumberMap, ObjectVisualElement, type OnHoverEndEvent, type OnHoverStartEvent, type OnKeyframesResolved, type OnPressEndEvent, type OnPressStartEvent, type Owner, type PanHandler, type PanInfo, type PassiveEffect, type PathInterpolator, type PathState, type Phase, type Point2D, type PointerEventOptions, type PresenceContextProps, type PressGestureInfo, type Process, type ProgressTimeline, type ProjectionEventName, type ProjectionNodeConfig, type ProjectionNodeOptions, type PropagateOptions, type RGBA, type ReducedMotionConfig, type RepeatType, type ResolvedConstraints, type ResolvedElastic, type ResolvedKeyframes, type ResolvedValueKeyframe, type ResolvedValues$1 as ResolvedValues, type SVGAttributes, type SVGForcedAttrKeyframesDefinition, type SVGForcedAttrProperties, type SVGForcedAttrTransitions, type SVGKeyframesDefinition, type SVGPathKeyframesDefinition, type SVGPathProperties, type SVGPathTransitions, type SVGRenderState, type SVGTransitions, SVGVisualElement, type ScaleCorrectionNode, type ScaleCorrector, type ScaleCorrectorDefinition, type ScaleCorrectorMap, type Schedule, type ScrapeMotionValuesFromProps, type ScrollMeasurements, type SelectorCache, type SingleTransformer, type Spring, type SpringOptions, type StaggerOptions, type StaggerOrigin, type StartAnimation, type StatsRecording, type Step, type StepId, type Steps, type StyleKeyframesDefinition, type StyleTransitions, type Subscriber, type TapHandlers, type TapInfo, type Target, type TargetAndTransition, type TargetResolver, type TimelineWithFallback, type TransformInputRange, type TransformOptions, type TransformOrigin, type TransformProperties, type TransformTemplate, type Transformer, type Transition, type TransitionWithValueOverrides, type Tween, type UnresolvedKeyframes, type UnresolvedValueKeyframe, type UseRenderState, type ValueAnimationOptions, type ValueAnimationOptionsWithRenderContext, type ValueAnimationTransition, type ValueAnimationWithDynamicDelay, type ValueIndexes, type ValueKeyframe, type ValueKeyframesDefinition, type ValueTransformer, type ValueTransition, type ValueType, type ValueTypeMap, type VariableKeyframesDefinition, type VariableTransitions, type Variant, type VariantLabels, type Variants, type VelocityOptions, type ViewTransitionAnimationDefinition, ViewTransitionBuilder, type ViewTransitionOptions, type ViewTransitionTarget, type ViewTransitionTargetDefinition, type ViewportEventHandler, type ViewportOptions, VisualElement, type VisualElementAnimationOptions, type VisualElementEventCallbacks, type VisualElementOptions, type VisualState, type WillChange, type WithAppearProps, type WithDepth, type WithQuerySelectorAll, acceleratedValues, addAttrValue, addDomEvent, addScaleCorrector, addStyleValue, addValueToWillChange, alpha, analyseComplexValue, animateMotionValue, animateSingleValue, animateTarget, animateValue, animateVariant, animateView, animateVisualElement, animationMapKey, applyAxisDelta, applyBoxDelta, applyGeneratorOptions, applyPointDelta, applyPxDefaults, applyTreeDeltas, arc, aspectRatio, attachFollow, attachSpring, attrEffect, axisDeltaEquals, axisEquals, axisEqualsRounded, boxEquals, boxEqualsRounded, buildHTMLStyles, buildProjectionTransform, buildSVGAttrs, buildSVGPath, buildTransform, calcAxisDelta, calcBoxDelta, calcChildStagger, calcGeneratorDuration, calcLength, calcRelativeAxis, calcRelativeAxisPosition, calcRelativeBox, calcRelativePosition, camelCaseAttributes, camelToDash, cancelFrame, cancelMicrotask, cancelSync, checkVariantsDidChange, cleanDirtyNodes, collectMotionValues, color, compareByDepth, complex, containsCSSVariable, convertBoundingBoxToBox, convertBoxToBoundingBox, convertOffsetToTimes, copyAxisDeltaInto, copyAxisInto, copyBoxInto, correctBorderRadius, correctBoxShadow, createAnimationState, createAxis, createAxisDelta, createBox, createDelta, createGeneratorEasing, createProjectionNode, createRenderBatcher, cubicBezierAsString, defaultEasing, defaultOffset, defaultTransformValue, defaultValueTypes, degrees, delay, delayInSeconds, dimensionValueTypes, eachAxis, fillOffset, fillWildcards, findDimensionValueType, findValueType, flushKeyframeResolvers, followValue, frame, frameData, frameSteps, generateLinearEasing, getAnimatableNone, getAnimationMap, getComputedStyle, getDefaultTransition, getDefaultValueType, getFeatureDefinitions, getFinalKeyframe, getMixer, getOptimisedAppearId, getOriginIndex, getValueAsType, getValueTransition, getVariableValue, getVariantContext, getViewAnimationLayerInfo, getViewAnimations, globalProjectionState, has2DTranslate, hasReducedMotionListener, hasScale, hasTransform, hex, hover, hsla, hslaToRgba, inertia, initPrefersReducedMotion, interpolate, invisibleValues, isAnimationControls, isCSSVariableName, isCSSVariableToken, isControllingVariants, isDeltaZero, isDragActive, isDragging, isElementKeyboardAccessible, isElementTextInput, isForcedMotionValue, isGenerator, isHTMLElement, isKeyframesTarget, isMotionValue, isNear, isNodeOrChild, isPrimaryPointer, isSVGElement, isSVGSVGElement, isSVGTag, isTransitionDefined, isVariantLabel, isVariantNode, isWaapiSupportedEasing, isWillChangeMotionValue, keyframes, makeAnimationInstant, mapEasingToNativeEasing, mapValue, maxGeneratorDuration, measurePageBox, measureViewportBox, microtask, mix, mixArray, mixColor, mixComplex, mixImmediate, mixLinearColor, mixNumber, mixObject, mixValues, mixVisibility, motionValue, nodeGroup, number, numberValueTypes, observeTimeline, optimizedAppearDataAttribute, optimizedAppearDataId, parseAnimateLayoutArgs, parseCSSVariable, parseValueFromTransform, percent, pixelsToPercent, positionalKeys, prefersReducedMotion, press, progressPercentage, propEffect, propagateDirtyNodes, px, readTransformValue, recordStats, removeAxisDelta, removeAxisTransforms, removeBoxTransforms, removePointDelta, renderHTML, renderSVG, resize, resolveElements, resolveMotionValue, resolveTransition, resolveVariant, resolveVariantFromProps, rgbUnit, rgba, rootProjectionNode, scale, scaleCorrectors, scalePoint, scrapeMotionValuesFromProps$1 as scrapeHTMLMotionValuesFromProps, scrapeMotionValuesFromProps as scrapeSVGMotionValuesFromProps, setDragLock, setFeatureDefinitions, setStyle, setTarget, spring, springValue, stagger, startWaapiAnimation, statsBuffer, styleEffect, supportedWaapiEasing, supportsBrowserAnimation, supportsFlags, supportsLinearEasing, supportsPartialKeyframes, supportsScrollTimeline, supportsViewTimeline, svgEffect, sync, testValueType, time, transform, transformAxis, transformBox, transformBoxPoints, transformPropOrder, transformProps, transformValue, transformValueTypes, translateAxis, updateMotionValuesFromProps, variantPriorityOrder, variantProps, vh, visualElementStore, vw }; diff --git a/node_modules/motion-dom/dist/motion-dom.dev.js b/node_modules/motion-dom/dist/motion-dom.dev.js deleted file mode 100644 index 56d6a16..0000000 --- a/node_modules/motion-dom/dist/motion-dom.dev.js +++ /dev/null @@ -1,11036 +0,0 @@ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('motion-utils')) : - typeof define === 'function' && define.amd ? define(['exports', 'motion-utils'], factory) : - (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.MotionDom = {}, global.MotionUtils)); -})(this, (function (exports, motionUtils) { 'use strict'; - - const stepsOrder = [ - "setup", // Compute - "read", // Read - "resolveKeyframes", // Write/Read/Write/Read - "preUpdate", // Compute - "update", // Compute - "preRender", // Compute - "render", // Write - "postRender", // Compute - ]; - - function createRenderStep(runNextFrame) { - /** - * We create and reuse two queues, one to queue jobs for the current frame - * and one for the next. We reuse to avoid triggering GC after x frames. - */ - let thisFrame = new Set(); - let nextFrame = new Set(); - /** - * Track whether we're currently processing jobs in this step. This way - * we can decide whether to schedule new jobs for this frame or next. - */ - let isProcessing = false; - let flushNextFrame = false; - /** - * A set of processes which were marked keepAlive when scheduled. - */ - const toKeepAlive = new WeakSet(); - let latestFrameData = { - delta: 0.0, - timestamp: 0.0, - isProcessing: false, - }; - function triggerCallback(callback) { - if (toKeepAlive.has(callback)) { - step.schedule(callback); - runNextFrame(); - } - callback(latestFrameData); - } - const step = { - /** - * Schedule a process to run on the next frame. - */ - schedule: (callback, keepAlive = false, immediate = false) => { - const addToCurrentFrame = immediate && isProcessing; - const queue = addToCurrentFrame ? thisFrame : nextFrame; - if (keepAlive) - toKeepAlive.add(callback); - queue.add(callback); - return callback; - }, - /** - * Cancel the provided callback from running on the next frame. - */ - cancel: (callback) => { - nextFrame.delete(callback); - toKeepAlive.delete(callback); - }, - /** - * Execute all schedule callbacks. - */ - process: (frameData) => { - latestFrameData = frameData; - /** - * If we're already processing we've probably been triggered by a flushSync - * inside an existing process. Instead of executing, mark flushNextFrame - * as true and ensure we flush the following frame at the end of this one. - */ - if (isProcessing) { - flushNextFrame = true; - return; - } - isProcessing = true; - // Swap this frame and the next to avoid GC - const prevFrame = thisFrame; - thisFrame = nextFrame; - nextFrame = prevFrame; - // Execute this frame - thisFrame.forEach(triggerCallback); - // Clear the frame so no callbacks remain. This is to avoid - // memory leaks should this render step not run for a while. - thisFrame.clear(); - isProcessing = false; - if (flushNextFrame) { - flushNextFrame = false; - step.process(frameData); - } - }, - }; - return step; - } - - const maxElapsed = 40; - function createRenderBatcher(scheduleNextBatch, allowKeepAlive) { - let runNextFrame = false; - let useDefaultElapsed = true; - const state = { - delta: 0.0, - timestamp: 0.0, - isProcessing: false, - }; - const flagRunNextFrame = () => (runNextFrame = true); - const steps = stepsOrder.reduce((acc, key) => { - acc[key] = createRenderStep(flagRunNextFrame); - return acc; - }, {}); - const { setup, read, resolveKeyframes, preUpdate, update, preRender, render, postRender, } = steps; - const processBatch = () => { - const useManualTiming = motionUtils.MotionGlobalConfig.useManualTiming; - const timestamp = useManualTiming - ? state.timestamp - : performance.now(); - runNextFrame = false; - if (!useManualTiming) { - state.delta = useDefaultElapsed - ? 1000 / 60 - : Math.max(Math.min(timestamp - state.timestamp, maxElapsed), 1); - } - state.timestamp = timestamp; - state.isProcessing = true; - // Unrolled render loop for better per-frame performance - setup.process(state); - read.process(state); - resolveKeyframes.process(state); - preUpdate.process(state); - update.process(state); - preRender.process(state); - render.process(state); - postRender.process(state); - state.isProcessing = false; - if (runNextFrame && allowKeepAlive) { - useDefaultElapsed = false; - scheduleNextBatch(processBatch); - } - }; - const wake = () => { - runNextFrame = true; - useDefaultElapsed = true; - if (!state.isProcessing) { - scheduleNextBatch(processBatch); - } - }; - const schedule = stepsOrder.reduce((acc, key) => { - const step = steps[key]; - acc[key] = (process, keepAlive = false, immediate = false) => { - if (!runNextFrame) - wake(); - return step.schedule(process, keepAlive, immediate); - }; - return acc; - }, {}); - const cancel = (process) => { - for (let i = 0; i < stepsOrder.length; i++) { - steps[stepsOrder[i]].cancel(process); - } - }; - return { schedule, cancel, state, steps }; - } - - const { schedule: frame, cancel: cancelFrame, state: frameData, steps: frameSteps, } = /* @__PURE__ */ createRenderBatcher(typeof requestAnimationFrame !== "undefined" ? requestAnimationFrame : motionUtils.noop, true); - - let now; - function clearTime() { - now = undefined; - } - /** - * An eventloop-synchronous alternative to performance.now(). - * - * Ensures that time measurements remain consistent within a synchronous context. - * Usually calling performance.now() twice within the same synchronous context - * will return different values which isn't useful for animations when we're usually - * trying to sync animations to the same frame. - */ - const time = { - now: () => { - if (now === undefined) { - time.set(frameData.isProcessing || motionUtils.MotionGlobalConfig.useManualTiming - ? frameData.timestamp - : performance.now()); - } - return now; - }, - set: (newTime) => { - now = newTime; - queueMicrotask(clearTime); - }, - }; - - const checkStringStartsWith = (token) => (key) => typeof key === "string" && key.startsWith(token); - const isCSSVariableName = - /*@__PURE__*/ checkStringStartsWith("--"); - const startsAsVariableToken = - /*@__PURE__*/ checkStringStartsWith("var(--"); - const isCSSVariableToken = (value) => { - const startsWithToken = startsAsVariableToken(value); - if (!startsWithToken) - return false; - // Ensure any comments are stripped from the value as this can harm performance of the regex. - return singleCssVariableRegex.test(value.split("/*")[0].trim()); - }; - const singleCssVariableRegex = /var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu; - /** - * Check if a value contains a CSS variable anywhere (e.g. inside calc()). - * Unlike isCSSVariableToken which checks if the value IS a var() token, - * this checks if the value CONTAINS var() somewhere in the string. - */ - function containsCSSVariable(value) { - if (typeof value !== "string") - return false; - // Strip comments to avoid false positives - return value.split("/*")[0].includes("var(--"); - } - - const number = { - test: (v) => typeof v === "number", - parse: parseFloat, - transform: (v) => v, - }; - const alpha = { - ...number, - transform: (v) => motionUtils.clamp(0, 1, v), - }; - const scale = { - ...number, - default: 1, - }; - - // If this number is a decimal, make it just five decimal places - // to avoid exponents - const sanitize = (v) => Math.round(v * 100000) / 100000; - - const floatRegex = /-?(?:\d+(?:\.\d+)?|\.\d+)/gu; - - function isNullish(v) { - return v == null; - } - - const singleColorRegex = /^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu; - - /** - * Returns true if the provided string is a color, ie rgba(0,0,0,0) or #000, - * but false if a number or multiple colors - */ - const isColorString = (type, testProp) => (v) => { - return Boolean((typeof v === "string" && - singleColorRegex.test(v) && - v.startsWith(type)) || - (testProp && - !isNullish(v) && - Object.prototype.hasOwnProperty.call(v, testProp))); - }; - const splitColor = (aName, bName, cName) => (v) => { - if (typeof v !== "string") - return v; - const [a, b, c, alpha] = v.match(floatRegex); - return { - [aName]: parseFloat(a), - [bName]: parseFloat(b), - [cName]: parseFloat(c), - alpha: alpha !== undefined ? parseFloat(alpha) : 1, - }; - }; - - const clampRgbUnit = (v) => motionUtils.clamp(0, 255, v); - const rgbUnit = { - ...number, - transform: (v) => Math.round(clampRgbUnit(v)), - }; - const rgba = { - test: /*@__PURE__*/ isColorString("rgb", "red"), - parse: /*@__PURE__*/ splitColor("red", "green", "blue"), - transform: ({ red, green, blue, alpha: alpha$1 = 1 }) => "rgba(" + - rgbUnit.transform(red) + - ", " + - rgbUnit.transform(green) + - ", " + - rgbUnit.transform(blue) + - ", " + - sanitize(alpha.transform(alpha$1)) + - ")", - }; - - function parseHex(v) { - let r = ""; - let g = ""; - let b = ""; - let a = ""; - // If we have 6 characters, ie #FF0000 - if (v.length > 5) { - r = v.substring(1, 3); - g = v.substring(3, 5); - b = v.substring(5, 7); - a = v.substring(7, 9); - // Or we have 3 characters, ie #F00 - } - else { - r = v.substring(1, 2); - g = v.substring(2, 3); - b = v.substring(3, 4); - a = v.substring(4, 5); - r += r; - g += g; - b += b; - a += a; - } - return { - red: parseInt(r, 16), - green: parseInt(g, 16), - blue: parseInt(b, 16), - alpha: a ? parseInt(a, 16) / 255 : 1, - }; - } - const hex = { - test: /*@__PURE__*/ isColorString("#"), - parse: parseHex, - transform: rgba.transform, - }; - - /*#__NO_SIDE_EFFECTS__*/ - const createUnitType = (unit) => ({ - test: (v) => typeof v === "string" && v.endsWith(unit) && v.split(" ").length === 1, - parse: parseFloat, - transform: (v) => `${v}${unit}`, - }); - const degrees = /*@__PURE__*/ createUnitType("deg"); - const percent = /*@__PURE__*/ createUnitType("%"); - const px = /*@__PURE__*/ createUnitType("px"); - const vh = /*@__PURE__*/ createUnitType("vh"); - const vw = /*@__PURE__*/ createUnitType("vw"); - const progressPercentage = /*@__PURE__*/ (() => ({ - ...percent, - parse: (v) => percent.parse(v) / 100, - transform: (v) => percent.transform(v * 100), - }))(); - - const hsla = { - test: /*@__PURE__*/ isColorString("hsl", "hue"), - parse: /*@__PURE__*/ splitColor("hue", "saturation", "lightness"), - transform: ({ hue, saturation, lightness, alpha: alpha$1 = 1 }) => { - return ("hsla(" + - Math.round(hue) + - ", " + - percent.transform(sanitize(saturation)) + - ", " + - percent.transform(sanitize(lightness)) + - ", " + - sanitize(alpha.transform(alpha$1)) + - ")"); - }, - }; - - const color = { - test: (v) => rgba.test(v) || hex.test(v) || hsla.test(v), - parse: (v) => { - if (rgba.test(v)) { - return rgba.parse(v); - } - else if (hsla.test(v)) { - return hsla.parse(v); - } - else { - return hex.parse(v); - } - }, - transform: (v) => { - return typeof v === "string" - ? v - : v.hasOwnProperty("red") - ? rgba.transform(v) - : hsla.transform(v); - }, - getAnimatableNone: (v) => { - const parsed = color.parse(v); - parsed.alpha = 0; - return color.transform(parsed); - }, - }; - - const colorRegex = /(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu; - - function test(v) { - return (isNaN(v) && - typeof v === "string" && - (v.match(floatRegex)?.length || 0) + - (v.match(colorRegex)?.length || 0) > - 0); - } - const NUMBER_TOKEN = "number"; - const COLOR_TOKEN = "color"; - const VAR_TOKEN = "var"; - const VAR_FUNCTION_TOKEN = "var("; - const SPLIT_TOKEN = "${}"; - // this regex consists of the `singleCssVariableRegex|rgbHSLValueRegex|digitRegex` - const complexRegex = /var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu; - function analyseComplexValue(value) { - const originalValue = value.toString(); - const values = []; - const indexes = { - color: [], - number: [], - var: [], - }; - const types = []; - let i = 0; - const tokenised = originalValue.replace(complexRegex, (parsedValue) => { - if (color.test(parsedValue)) { - indexes.color.push(i); - types.push(COLOR_TOKEN); - values.push(color.parse(parsedValue)); - } - else if (parsedValue.startsWith(VAR_FUNCTION_TOKEN)) { - indexes.var.push(i); - types.push(VAR_TOKEN); - values.push(parsedValue); - } - else { - indexes.number.push(i); - types.push(NUMBER_TOKEN); - values.push(parseFloat(parsedValue)); - } - ++i; - return SPLIT_TOKEN; - }); - const split = tokenised.split(SPLIT_TOKEN); - return { values, split, indexes, types }; - } - function parseComplexValue(v) { - return analyseComplexValue(v).values; - } - function buildTransformer({ split, types }) { - const numSections = split.length; - return (v) => { - let output = ""; - for (let i = 0; i < numSections; i++) { - output += split[i]; - if (v[i] !== undefined) { - const type = types[i]; - if (type === NUMBER_TOKEN) { - output += sanitize(v[i]); - } - else if (type === COLOR_TOKEN) { - output += color.transform(v[i]); - } - else { - output += v[i]; - } - } - } - return output; - }; - } - function createTransformer(source) { - return buildTransformer(analyseComplexValue(source)); - } - const convertNumbersToZero = (v) => typeof v === "number" ? 0 : color.test(v) ? color.getAnimatableNone(v) : v; - /** - * Convert a parsed value to its zero equivalent, but preserve numbers - * that act as divisors in CSS calc() expressions. - * - * analyseComplexValue extracts numbers from CSS strings and puts the - * surrounding text into a `split` template array. For example: - * "calc(var(--gap) / 5)" → values: [var(--gap), 5] - * split: ["calc(", " / ", ")"] - * - * When building a zero-equivalent for animation, naively zeroing all - * numbers turns the divisor into 0 → "calc(var(--gap) / 0)" → NaN. - * We detect this by checking whether the text preceding a number - * (split[i]) ends with "/" — the CSS calc division operator. - */ - const convertToZero = (value, splitBefore) => { - if (typeof value === "number") { - return splitBefore?.trim().endsWith("/") ? value : 0; - } - return convertNumbersToZero(value); - }; - function getAnimatableNone$1(v) { - const info = analyseComplexValue(v); - const transformer = buildTransformer(info); - return transformer(info.values.map((value, i) => convertToZero(value, info.split[i]))); - } - const complex = { - test, - parse: parseComplexValue, - createTransformer, - getAnimatableNone: getAnimatableNone$1, - }; - - // Adapted from https://gist.github.com/mjackson/5311256 - function hueToRgb(p, q, t) { - if (t < 0) - t += 1; - if (t > 1) - t -= 1; - if (t < 1 / 6) - return p + (q - p) * 6 * t; - if (t < 1 / 2) - return q; - if (t < 2 / 3) - return p + (q - p) * (2 / 3 - t) * 6; - return p; - } - function hslaToRgba({ hue, saturation, lightness, alpha }) { - hue /= 360; - saturation /= 100; - lightness /= 100; - let red = 0; - let green = 0; - let blue = 0; - if (!saturation) { - red = green = blue = lightness; - } - else { - const q = lightness < 0.5 - ? lightness * (1 + saturation) - : lightness + saturation - lightness * saturation; - const p = 2 * lightness - q; - red = hueToRgb(p, q, hue + 1 / 3); - green = hueToRgb(p, q, hue); - blue = hueToRgb(p, q, hue - 1 / 3); - } - return { - red: Math.round(red * 255), - green: Math.round(green * 255), - blue: Math.round(blue * 255), - alpha, - }; - } - - function mixImmediate(a, b) { - return (p) => (p > 0 ? b : a); - } - - /* - Value in range from progress - - Given a lower limit and an upper limit, we return the value within - that range as expressed by progress (usually a number from 0 to 1) - - So progress = 0.5 would change - - from -------- to - - to - - from ---- to - - E.g. from = 10, to = 20, progress = 0.5 => 15 - - @param [number]: Lower limit of range - @param [number]: Upper limit of range - @param [number]: The progress between lower and upper limits expressed 0-1 - @return [number]: Value as calculated from progress within range (not limited within range) - */ - const mixNumber$1 = (from, to, progress) => { - return from + (to - from) * progress; - }; - - // Linear color space blending - // Explained https://www.youtube.com/watch?v=LKnqECcg6Gw - // Demonstrated http://codepen.io/osublake/pen/xGVVaN - const mixLinearColor = (from, to, v) => { - const fromExpo = from * from; - const expo = v * (to * to - fromExpo) + fromExpo; - return expo < 0 ? 0 : Math.sqrt(expo); - }; - const colorTypes = [hex, rgba, hsla]; - const getColorType = (v) => colorTypes.find((type) => type.test(v)); - function asRGBA(color) { - const type = getColorType(color); - motionUtils.warning(Boolean(type), `'${color}' is not an animatable color. Use the equivalent color code instead.`, "color-not-animatable"); - if (!Boolean(type)) - return false; - let model = type.parse(color); - if (type === hsla) { - // TODO Remove this cast - needed since Motion's stricter typing - model = hslaToRgba(model); - } - return model; - } - const mixColor = (from, to) => { - const fromRGBA = asRGBA(from); - const toRGBA = asRGBA(to); - if (!fromRGBA || !toRGBA) { - return mixImmediate(from, to); - } - const blended = { ...fromRGBA }; - return (v) => { - blended.red = mixLinearColor(fromRGBA.red, toRGBA.red, v); - blended.green = mixLinearColor(fromRGBA.green, toRGBA.green, v); - blended.blue = mixLinearColor(fromRGBA.blue, toRGBA.blue, v); - blended.alpha = mixNumber$1(fromRGBA.alpha, toRGBA.alpha, v); - return rgba.transform(blended); - }; - }; - - const invisibleValues = new Set(["none", "hidden"]); - /** - * Returns a function that, when provided a progress value between 0 and 1, - * will return the "none" or "hidden" string only when the progress is that of - * the origin or target. - */ - function mixVisibility(origin, target) { - if (invisibleValues.has(origin)) { - return (p) => (p <= 0 ? origin : target); - } - else { - return (p) => (p >= 1 ? target : origin); - } - } - - function mixNumber(a, b) { - return (p) => mixNumber$1(a, b, p); - } - function getMixer(a) { - if (typeof a === "number") { - return mixNumber; - } - else if (typeof a === "string") { - return isCSSVariableToken(a) - ? mixImmediate - : color.test(a) - ? mixColor - : mixComplex; - } - else if (Array.isArray(a)) { - return mixArray; - } - else if (typeof a === "object") { - return color.test(a) ? mixColor : mixObject; - } - return mixImmediate; - } - function mixArray(a, b) { - const output = [...a]; - const numValues = output.length; - const blendValue = a.map((v, i) => getMixer(v)(v, b[i])); - return (p) => { - for (let i = 0; i < numValues; i++) { - output[i] = blendValue[i](p); - } - return output; - }; - } - function mixObject(a, b) { - const output = { ...a, ...b }; - const blendValue = {}; - for (const key in output) { - if (a[key] !== undefined && b[key] !== undefined) { - blendValue[key] = getMixer(a[key])(a[key], b[key]); - } - } - return (v) => { - for (const key in blendValue) { - output[key] = blendValue[key](v); - } - return output; - }; - } - function matchOrder(origin, target) { - const orderedOrigin = []; - const pointers = { color: 0, var: 0, number: 0 }; - for (let i = 0; i < target.values.length; i++) { - const type = target.types[i]; - const originIndex = origin.indexes[type][pointers[type]]; - const originValue = origin.values[originIndex] ?? 0; - orderedOrigin[i] = originValue; - pointers[type]++; - } - return orderedOrigin; - } - const mixComplex = (origin, target) => { - const template = complex.createTransformer(target); - const originStats = analyseComplexValue(origin); - const targetStats = analyseComplexValue(target); - const canInterpolate = originStats.indexes.var.length === targetStats.indexes.var.length && - originStats.indexes.color.length === targetStats.indexes.color.length && - originStats.indexes.number.length >= targetStats.indexes.number.length; - if (canInterpolate) { - if ((invisibleValues.has(origin) && - !targetStats.values.length) || - (invisibleValues.has(target) && - !originStats.values.length)) { - return mixVisibility(origin, target); - } - return motionUtils.pipe(mixArray(matchOrder(originStats, targetStats), targetStats.values), template); - } - else { - motionUtils.warning(true, `Complex values '${origin}' and '${target}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`, "complex-values-different"); - return mixImmediate(origin, target); - } - }; - - function mix(from, to, p) { - if (typeof from === "number" && - typeof to === "number" && - typeof p === "number") { - return mixNumber$1(from, to, p); - } - const mixer = getMixer(from); - return mixer(from, to); - } - - const frameloopDriver = (update) => { - const passTimestamp = ({ timestamp }) => update(timestamp); - return { - start: (keepAlive = true) => frame.update(passTimestamp, keepAlive), - stop: () => cancelFrame(passTimestamp), - /** - * If we're processing this frame we can use the - * framelocked timestamp to keep things in sync. - */ - now: () => (frameData.isProcessing ? frameData.timestamp : time.now()), - }; - }; - - const generateLinearEasing = (easing, duration, // as milliseconds - resolution = 10 // as milliseconds - ) => { - let points = ""; - const numPoints = Math.max(Math.round(duration / resolution), 2); - for (let i = 0; i < numPoints; i++) { - points += Math.round(easing(i / (numPoints - 1)) * 10000) / 10000 + ", "; - } - return `linear(${points.substring(0, points.length - 2)})`; - }; - - /** - * Implement a practical max duration for keyframe generation - * to prevent infinite loops - */ - const maxGeneratorDuration = 20000; - function calcGeneratorDuration(generator) { - let duration = 0; - const timeStep = 50; - let state = generator.next(duration); - while (!state.done && duration < maxGeneratorDuration) { - duration += timeStep; - state = generator.next(duration); - } - return duration >= maxGeneratorDuration ? Infinity : duration; - } - - /** - * Create a progress => progress easing function from a generator. - */ - function createGeneratorEasing(options, scale = 100, createGenerator) { - const generator = createGenerator({ ...options, keyframes: [0, scale] }); - const duration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration); - return { - type: "keyframes", - ease: (progress) => { - return generator.next(duration * progress).value / scale; - }, - duration: motionUtils.millisecondsToSeconds(duration), - }; - } - - const springDefaults = { - // Default spring physics - stiffness: 100, - damping: 10, - mass: 1.0, - velocity: 0.0, - // Default duration/bounce-based options - duration: 800, // in ms - bounce: 0.3, - visualDuration: 0.3, // in seconds - // Rest thresholds - restSpeed: { - granular: 0.01, - default: 2, - }, - restDelta: { - granular: 0.005, - default: 0.5, - }, - // Limits - minDuration: 0.01, // in seconds - maxDuration: 10.0, // in seconds - minDamping: 0.05, - maxDamping: 1, - }; - function calcAngularFreq(undampedFreq, dampingRatio) { - return undampedFreq * Math.sqrt(1 - dampingRatio * dampingRatio); - } - const rootIterations = 12; - function approximateRoot(envelope, derivative, initialGuess) { - let result = initialGuess; - for (let i = 1; i < rootIterations; i++) { - result = result - envelope(result) / derivative(result); - } - return result; - } - /** - * This is ported from the Framer implementation of duration-based spring resolution. - */ - const safeMin = 0.001; - function findSpring({ duration = springDefaults.duration, bounce = springDefaults.bounce, velocity = springDefaults.velocity, mass = springDefaults.mass, }) { - let envelope; - let derivative; - motionUtils.warning(duration <= motionUtils.secondsToMilliseconds(springDefaults.maxDuration), "Spring duration must be 10 seconds or less", "spring-duration-limit"); - let dampingRatio = 1 - bounce; - /** - * Restrict dampingRatio and duration to within acceptable ranges. - */ - dampingRatio = motionUtils.clamp(springDefaults.minDamping, springDefaults.maxDamping, dampingRatio); - duration = motionUtils.clamp(springDefaults.minDuration, springDefaults.maxDuration, motionUtils.millisecondsToSeconds(duration)); - if (dampingRatio < 1) { - /** - * Underdamped spring - */ - envelope = (undampedFreq) => { - const exponentialDecay = undampedFreq * dampingRatio; - const delta = exponentialDecay * duration; - const a = exponentialDecay - velocity; - const b = calcAngularFreq(undampedFreq, dampingRatio); - const c = Math.exp(-delta); - return safeMin - (a / b) * c; - }; - derivative = (undampedFreq) => { - const exponentialDecay = undampedFreq * dampingRatio; - const delta = exponentialDecay * duration; - const d = delta * velocity + velocity; - const e = Math.pow(dampingRatio, 2) * Math.pow(undampedFreq, 2) * duration; - const f = Math.exp(-delta); - const g = calcAngularFreq(Math.pow(undampedFreq, 2), dampingRatio); - const factor = -envelope(undampedFreq) + safeMin > 0 ? -1 : 1; - return (factor * ((d - e) * f)) / g; - }; - } - else { - /** - * Critically-damped spring - */ - envelope = (undampedFreq) => { - const a = Math.exp(-undampedFreq * duration); - const b = (undampedFreq - velocity) * duration + 1; - return -safeMin + a * b; - }; - derivative = (undampedFreq) => { - const a = Math.exp(-undampedFreq * duration); - const b = (velocity - undampedFreq) * (duration * duration); - return a * b; - }; - } - const initialGuess = 5 / duration; - const undampedFreq = approximateRoot(envelope, derivative, initialGuess); - duration = motionUtils.secondsToMilliseconds(duration); - if (isNaN(undampedFreq)) { - return { - stiffness: springDefaults.stiffness, - damping: springDefaults.damping, - duration, - }; - } - else { - const stiffness = Math.pow(undampedFreq, 2) * mass; - return { - stiffness, - damping: dampingRatio * 2 * Math.sqrt(mass * stiffness), - duration, - }; - } - } - const durationKeys = ["duration", "bounce"]; - const physicsKeys = ["stiffness", "damping", "mass"]; - function isSpringType(options, keys) { - return keys.some((key) => options[key] !== undefined); - } - function getSpringOptions(options) { - let springOptions = { - velocity: springDefaults.velocity, - stiffness: springDefaults.stiffness, - damping: springDefaults.damping, - mass: springDefaults.mass, - isResolvedFromDuration: false, - ...options, - }; - // stiffness/damping/mass overrides duration/bounce - if (!isSpringType(options, physicsKeys) && - isSpringType(options, durationKeys)) { - // Time-defined springs should ignore inherited velocity. - // Velocity from interrupted animations can cause findSpring() - // to compute wildly different spring parameters, leading to - // massive oscillation on small-range animations. - springOptions.velocity = 0; - if (options.visualDuration) { - const visualDuration = options.visualDuration; - const root = (2 * Math.PI) / (visualDuration * 1.2); - const stiffness = root * root; - const damping = 2 * - motionUtils.clamp(0.05, 1, 1 - (options.bounce || 0)) * - Math.sqrt(stiffness); - springOptions = { - ...springOptions, - mass: springDefaults.mass, - stiffness, - damping, - }; - } - else { - const derived = findSpring({ ...options, velocity: 0 }); - springOptions = { - ...springOptions, - ...derived, - mass: springDefaults.mass, - }; - springOptions.isResolvedFromDuration = true; - } - } - return springOptions; - } - function spring(optionsOrVisualDuration = springDefaults.visualDuration, bounce = springDefaults.bounce) { - const options = typeof optionsOrVisualDuration !== "object" - ? { - visualDuration: optionsOrVisualDuration, - keyframes: [0, 1], - bounce, - } - : optionsOrVisualDuration; - let { restSpeed, restDelta } = options; - const origin = options.keyframes[0]; - const target = options.keyframes[options.keyframes.length - 1]; - /** - * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator - * to reduce GC during animation. - */ - const state = { done: false, value: origin }; - const { stiffness, damping, mass, duration, velocity, isResolvedFromDuration, } = getSpringOptions({ - ...options, - velocity: -motionUtils.millisecondsToSeconds(options.velocity || 0), - }); - const initialVelocity = velocity || 0.0; - const dampingRatio = damping / (2 * Math.sqrt(stiffness * mass)); - const initialDelta = target - origin; - const undampedAngularFreq = motionUtils.millisecondsToSeconds(Math.sqrt(stiffness / mass)); - /** - * If we're working on a granular scale, use smaller defaults for determining - * when the spring is finished. - * - * These defaults have been selected emprically based on what strikes a good - * ratio between feeling good and finishing as soon as changes are imperceptible. - */ - const isGranularScale = Math.abs(initialDelta) < 5; - restSpeed || (restSpeed = isGranularScale - ? springDefaults.restSpeed.granular - : springDefaults.restSpeed.default); - restDelta || (restDelta = isGranularScale - ? springDefaults.restDelta.granular - : springDefaults.restDelta.default); - let resolveSpring; - let resolveVelocity; - // Underdamped coefficients, hoisted for use in the inlined next() hot path - let angularFreq; - let A; - let sinCoeff; - let cosCoeff; - if (dampingRatio < 1) { - angularFreq = calcAngularFreq(undampedAngularFreq, dampingRatio); - A = - (initialVelocity + - dampingRatio * undampedAngularFreq * initialDelta) / - angularFreq; - // Underdamped spring - resolveSpring = (t) => { - const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); - return (target - - envelope * - (A * Math.sin(angularFreq * t) + - initialDelta * Math.cos(angularFreq * t))); - }; - // Analytical derivative of underdamped spring (px/ms) - sinCoeff = - dampingRatio * undampedAngularFreq * A + initialDelta * angularFreq; - cosCoeff = - dampingRatio * undampedAngularFreq * initialDelta - A * angularFreq; - resolveVelocity = (t) => { - const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); - return envelope * - (sinCoeff * Math.sin(angularFreq * t) + - cosCoeff * Math.cos(angularFreq * t)); - }; - } - else if (dampingRatio === 1) { - // Critically damped spring - resolveSpring = (t) => target - - Math.exp(-undampedAngularFreq * t) * - (initialDelta + - (initialVelocity + undampedAngularFreq * initialDelta) * t); - // Analytical derivative of critically damped spring (px/ms) - const C = initialVelocity + undampedAngularFreq * initialDelta; - resolveVelocity = (t) => Math.exp(-undampedAngularFreq * t) * - (undampedAngularFreq * C * t - initialVelocity); - } - else { - // Overdamped spring - const dampedAngularFreq = undampedAngularFreq * Math.sqrt(dampingRatio * dampingRatio - 1); - resolveSpring = (t) => { - const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); - // When performing sinh or cosh values can hit Infinity so we cap them here - const freqForT = Math.min(dampedAngularFreq * t, 300); - return (target - - (envelope * - ((initialVelocity + - dampingRatio * undampedAngularFreq * initialDelta) * - Math.sinh(freqForT) + - dampedAngularFreq * - initialDelta * - Math.cosh(freqForT))) / - dampedAngularFreq); - }; - // Analytical derivative of overdamped spring (px/ms) - const P = (initialVelocity + - dampingRatio * undampedAngularFreq * initialDelta) / - dampedAngularFreq; - const sinhCoeff = dampingRatio * undampedAngularFreq * P - initialDelta * dampedAngularFreq; - const coshCoeff = dampingRatio * undampedAngularFreq * initialDelta - P * dampedAngularFreq; - resolveVelocity = (t) => { - const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); - const freqForT = Math.min(dampedAngularFreq * t, 300); - return envelope * - (sinhCoeff * Math.sinh(freqForT) + - coshCoeff * Math.cosh(freqForT)); - }; - } - const generator = { - calculatedDuration: isResolvedFromDuration ? duration || null : null, - velocity: (t) => motionUtils.secondsToMilliseconds(resolveVelocity(t)), - next: (t) => { - /** - * For underdamped physics springs we need both position and - * velocity each tick. Compute shared trig values once to avoid - * duplicate Math.exp/sin/cos calls on the hot path. - */ - if (!isResolvedFromDuration && dampingRatio < 1) { - const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); - const sin = Math.sin(angularFreq * t); - const cos = Math.cos(angularFreq * t); - const current = target - - envelope * - (A * sin + initialDelta * cos); - const currentVelocity = motionUtils.secondsToMilliseconds(envelope * - (sinCoeff * sin + cosCoeff * cos)); - state.done = - Math.abs(currentVelocity) <= restSpeed && - Math.abs(target - current) <= restDelta; - state.value = state.done ? target : current; - return state; - } - const current = resolveSpring(t); - if (!isResolvedFromDuration) { - const currentVelocity = motionUtils.secondsToMilliseconds(resolveVelocity(t)); - state.done = - Math.abs(currentVelocity) <= restSpeed && - Math.abs(target - current) <= restDelta; - } - else { - state.done = t >= duration; - } - state.value = state.done ? target : current; - return state; - }, - toString: () => { - const calculatedDuration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration); - const easing = generateLinearEasing((progress) => generator.next(calculatedDuration * progress).value, calculatedDuration, 30); - return calculatedDuration + "ms " + easing; - }, - toTransition: () => { }, - }; - return generator; - } - spring.applyToOptions = (options) => { - const generatorOptions = createGeneratorEasing(options, 100, spring); - options.ease = generatorOptions.ease; - options.duration = motionUtils.secondsToMilliseconds(generatorOptions.duration); - options.type = "keyframes"; - return options; - }; - - const velocitySampleDuration = 5; // ms - function getGeneratorVelocity(resolveValue, t, current) { - const prevT = Math.max(t - velocitySampleDuration, 0); - return motionUtils.velocityPerSecond(current - resolveValue(prevT), t - prevT); - } - - function inertia({ keyframes, velocity = 0.0, power = 0.8, timeConstant = 325, bounceDamping = 10, bounceStiffness = 500, modifyTarget, min, max, restDelta = 0.5, restSpeed, }) { - const origin = keyframes[0]; - const state = { - done: false, - value: origin, - }; - const isOutOfBounds = (v) => (min !== undefined && v < min) || (max !== undefined && v > max); - const nearestBoundary = (v) => { - if (min === undefined) - return max; - if (max === undefined) - return min; - return Math.abs(min - v) < Math.abs(max - v) ? min : max; - }; - let amplitude = power * velocity; - const ideal = origin + amplitude; - const target = modifyTarget === undefined ? ideal : modifyTarget(ideal); - /** - * If the target has changed we need to re-calculate the amplitude, otherwise - * the animation will start from the wrong position. - */ - if (target !== ideal) - amplitude = target - origin; - const calcDelta = (t) => -amplitude * Math.exp(-t / timeConstant); - const calcLatest = (t) => target + calcDelta(t); - const applyFriction = (t) => { - const delta = calcDelta(t); - const latest = calcLatest(t); - state.done = Math.abs(delta) <= restDelta; - state.value = state.done ? target : latest; - }; - /** - * Ideally this would resolve for t in a stateless way, we could - * do that by always precalculating the animation but as we know - * this will be done anyway we can assume that spring will - * be discovered during that. - */ - let timeReachedBoundary; - let spring$1; - const checkCatchBoundary = (t) => { - if (!isOutOfBounds(state.value)) - return; - timeReachedBoundary = t; - spring$1 = spring({ - keyframes: [state.value, nearestBoundary(state.value)], - velocity: getGeneratorVelocity(calcLatest, t, state.value), // TODO: This should be passing * 1000 - damping: bounceDamping, - stiffness: bounceStiffness, - restDelta, - restSpeed, - }); - }; - checkCatchBoundary(0); - return { - calculatedDuration: null, - next: (t) => { - /** - * We need to resolve the friction to figure out if we need a - * spring but we don't want to do this twice per frame. So here - * we flag if we updated for this frame and later if we did - * we can skip doing it again. - */ - let hasUpdatedFrame = false; - if (!spring$1 && timeReachedBoundary === undefined) { - hasUpdatedFrame = true; - applyFriction(t); - checkCatchBoundary(t); - } - /** - * If we have a spring and the provided t is beyond the moment the friction - * animation crossed the min/max boundary, use the spring. - */ - if (timeReachedBoundary !== undefined && t >= timeReachedBoundary) { - return spring$1.next(t - timeReachedBoundary); - } - else { - !hasUpdatedFrame && applyFriction(t); - return state; - } - }, - }; - } - - function createMixers(output, ease, customMixer) { - const mixers = []; - const mixerFactory = customMixer || motionUtils.MotionGlobalConfig.mix || mix; - const numMixers = output.length - 1; - for (let i = 0; i < numMixers; i++) { - let mixer = mixerFactory(output[i], output[i + 1]); - if (ease) { - const easingFunction = Array.isArray(ease) ? ease[i] || motionUtils.noop : ease; - mixer = motionUtils.pipe(easingFunction, mixer); - } - mixers.push(mixer); - } - return mixers; - } - /** - * Create a function that maps from a numerical input array to a generic output array. - * - * Accepts: - * - Numbers - * - Colors (hex, hsl, hsla, rgb, rgba) - * - Complex (combinations of one or more numbers or strings) - * - * ```jsx - * const mixColor = interpolate([0, 1], ['#fff', '#000']) - * - * mixColor(0.5) // 'rgba(128, 128, 128, 1)' - * ``` - * - * TODO Revisit this approach once we've moved to data models for values, - * probably not needed to pregenerate mixer functions. - * - * @public - */ - function interpolate(input, output, { clamp: isClamp = true, ease, mixer } = {}) { - const inputLength = input.length; - motionUtils.invariant(inputLength === output.length, "Both input and output ranges must be the same length", "range-length"); - /** - * If we're only provided a single input, we can just make a function - * that returns the output. - */ - if (inputLength === 1) - return () => output[0]; - if (inputLength === 2 && output[0] === output[1]) - return () => output[1]; - const isZeroDeltaRange = input[0] === input[1]; - // If input runs highest -> lowest, reverse both arrays - if (input[0] > input[inputLength - 1]) { - input = [...input].reverse(); - output = [...output].reverse(); - } - const mixers = createMixers(output, ease, mixer); - const numMixers = mixers.length; - const interpolator = (v) => { - if (isZeroDeltaRange && v < input[0]) - return output[0]; - let i = 0; - if (numMixers > 1) { - for (; i < input.length - 2; i++) { - if (v < input[i + 1]) - break; - } - } - const progressInRange = motionUtils.progress(input[i], input[i + 1], v); - return mixers[i](progressInRange); - }; - return isClamp - ? (v) => interpolator(motionUtils.clamp(input[0], input[inputLength - 1], v)) - : interpolator; - } - - function fillOffset(offset, remaining) { - const min = offset[offset.length - 1]; - for (let i = 1; i <= remaining; i++) { - const offsetProgress = motionUtils.progress(0, remaining, i); - offset.push(mixNumber$1(min, 1, offsetProgress)); - } - } - - function defaultOffset(arr) { - const offset = [0]; - fillOffset(offset, arr.length - 1); - return offset; - } - - function convertOffsetToTimes(offset, duration) { - return offset.map((o) => o * duration); - } - - function defaultEasing(values, easing) { - return values.map(() => easing || motionUtils.easeInOut).splice(0, values.length - 1); - } - function keyframes({ duration = 300, keyframes: keyframeValues, times, ease = "easeInOut", }) { - /** - * Easing functions can be externally defined as strings. Here we convert them - * into actual functions. - */ - const easingFunctions = motionUtils.isEasingArray(ease) - ? ease.map(motionUtils.easingDefinitionToFunction) - : motionUtils.easingDefinitionToFunction(ease); - /** - * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator - * to reduce GC during animation. - */ - const state = { - done: false, - value: keyframeValues[0], - }; - /** - * Create a times array based on the provided 0-1 offsets - */ - const absoluteTimes = convertOffsetToTimes( - // Only use the provided offsets if they're the correct length - // TODO Maybe we should warn here if there's a length mismatch - times && times.length === keyframeValues.length - ? times - : defaultOffset(keyframeValues), duration); - const mapTimeToKeyframe = interpolate(absoluteTimes, keyframeValues, { - ease: Array.isArray(easingFunctions) - ? easingFunctions - : defaultEasing(keyframeValues, easingFunctions), - }); - return { - calculatedDuration: duration, - next: (t) => { - state.value = mapTimeToKeyframe(t); - state.done = t >= duration; - return state; - }, - }; - } - - const isNotNull = (value) => value !== null; - function getFinalKeyframe(keyframes, { repeat, repeatType = "loop" }, finalKeyframe, speed = 1) { - const resolvedKeyframes = keyframes.filter(isNotNull); - const useFirstKeyframe = speed < 0 || (repeat && repeatType !== "loop" && repeat % 2 === 1); - const index = useFirstKeyframe ? 0 : resolvedKeyframes.length - 1; - return !index || finalKeyframe === undefined - ? resolvedKeyframes[index] - : finalKeyframe; - } - - const transitionTypeMap = { - decay: inertia, - inertia, - tween: keyframes, - keyframes: keyframes, - spring, - }; - function replaceTransitionType(transition) { - if (typeof transition.type === "string") { - transition.type = transitionTypeMap[transition.type]; - } - } - - class WithPromise { - constructor() { - this.updateFinished(); - } - get finished() { - return this._finished; - } - updateFinished() { - this._finished = new Promise((resolve) => { - this.resolve = resolve; - }); - } - notifyFinished() { - this.resolve(); - } - /** - * Allows the animation to be awaited. - * - * @deprecated Use `finished` instead. - */ - then(onResolve, onReject) { - return this.finished.then(onResolve, onReject); - } - } - - const percentToProgress = (percent) => percent / 100; - class JSAnimation extends WithPromise { - constructor(options) { - super(); - this.state = "idle"; - this.startTime = null; - this.isStopped = false; - /** - * The current time of the animation. - */ - this.currentTime = 0; - /** - * The time at which the animation was paused. - */ - this.holdTime = null; - /** - * Playback speed as a factor. 0 would be stopped, -1 reverse and 2 double speed. - */ - this.playbackSpeed = 1; - /** - * Reusable state object for the delay phase to avoid - * allocating a new object every frame. - */ - this.delayState = { - done: false, - value: undefined, - }; - /** - * This method is bound to the instance to fix a pattern where - * animation.stop is returned as a reference from a useEffect. - */ - this.stop = () => { - const { motionValue } = this.options; - if (motionValue && motionValue.updatedAt !== time.now()) { - this.tick(time.now()); - } - this.isStopped = true; - if (this.state === "idle") - return; - this.teardown(); - this.options.onStop?.(); - }; - this.options = options; - this.initAnimation(); - this.play(); - if (options.autoplay === false) - this.pause(); - } - initAnimation() { - const { options } = this; - replaceTransitionType(options); - const { type = keyframes, repeat = 0, repeatDelay = 0, repeatType, velocity = 0, } = options; - let { keyframes: keyframes$1 } = options; - const generatorFactory = type || keyframes; - if (generatorFactory !== keyframes) { - motionUtils.invariant(keyframes$1.length <= 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${keyframes$1}`, "spring-two-frames"); - } - if (generatorFactory !== keyframes && - typeof keyframes$1[0] !== "number") { - this.mixKeyframes = motionUtils.pipe(percentToProgress, mix(keyframes$1[0], keyframes$1[1])); - keyframes$1 = [0, 100]; - } - const generator = generatorFactory({ ...options, keyframes: keyframes$1 }); - /** - * If we have a mirror repeat type we need to create a second generator that outputs the - * mirrored (not reversed) animation and later ping pong between the two generators. - */ - if (repeatType === "mirror") { - this.mirroredGenerator = generatorFactory({ - ...options, - keyframes: [...keyframes$1].reverse(), - velocity: -velocity, - }); - } - /** - * If duration is undefined and we have repeat options, - * we need to calculate a duration from the generator. - * - * We set it to the generator itself to cache the duration. - * Any timeline resolver will need to have already precalculated - * the duration by this step. - */ - if (generator.calculatedDuration === null) { - generator.calculatedDuration = calcGeneratorDuration(generator); - } - const { calculatedDuration } = generator; - this.calculatedDuration = calculatedDuration; - this.resolvedDuration = calculatedDuration + repeatDelay; - this.totalDuration = this.resolvedDuration * (repeat + 1) - repeatDelay; - this.generator = generator; - } - updateTime(timestamp) { - const animationTime = Math.round(timestamp - this.startTime) * this.playbackSpeed; - // Update currentTime - if (this.holdTime !== null) { - this.currentTime = this.holdTime; - } - else { - // Rounding the time because floating point arithmetic is not always accurate, e.g. 3000.367 - 1000.367 = - // 2000.0000000000002. This is a problem when we are comparing the currentTime with the duration, for - // example. - this.currentTime = animationTime; - } - } - tick(timestamp, sample = false) { - const { generator, totalDuration, mixKeyframes, mirroredGenerator, resolvedDuration, calculatedDuration, } = this; - if (this.startTime === null) - return generator.next(0); - const { delay = 0, keyframes, repeat, repeatType, repeatDelay, type, onUpdate, finalKeyframe, } = this.options; - /** - * requestAnimationFrame timestamps can come through as lower than - * the startTime as set by performance.now(). Here we prevent this, - * though in the future it could be possible to make setting startTime - * a pending operation that gets resolved here. - */ - if (this.speed > 0) { - this.startTime = Math.min(this.startTime, timestamp); - } - else if (this.speed < 0) { - this.startTime = Math.min(timestamp - totalDuration / this.speed, this.startTime); - } - if (sample) { - this.currentTime = timestamp; - } - else { - this.updateTime(timestamp); - } - // Rebase on delay - const timeWithoutDelay = this.currentTime - delay * (this.playbackSpeed >= 0 ? 1 : -1); - const isInDelayPhase = this.playbackSpeed >= 0 - ? timeWithoutDelay < 0 - : timeWithoutDelay > totalDuration; - this.currentTime = Math.max(timeWithoutDelay, 0); - // If this animation has finished, set the current time to the total duration. - if (this.state === "finished" && this.holdTime === null) { - this.currentTime = totalDuration; - } - let elapsed = this.currentTime; - let frameGenerator = generator; - if (repeat) { - /** - * Get the current progress (0-1) of the animation. If t is > - * than duration we'll get values like 2.5 (midway through the - * third iteration) - */ - const progress = Math.min(this.currentTime, totalDuration) / resolvedDuration; - /** - * Get the current iteration (0 indexed). For instance the floor of - * 2.5 is 2. - */ - let currentIteration = Math.floor(progress); - /** - * Get the current progress of the iteration by taking the remainder - * so 2.5 is 0.5 through iteration 2 - */ - let iterationProgress = progress % 1.0; - /** - * If iteration progress is 1 we count that as the end - * of the previous iteration. - */ - if (!iterationProgress && progress >= 1) { - iterationProgress = 1; - } - iterationProgress === 1 && currentIteration--; - currentIteration = Math.min(currentIteration, repeat + 1); - /** - * Reverse progress if we're not running in "normal" direction - */ - const isOddIteration = Boolean(currentIteration % 2); - if (isOddIteration) { - if (repeatType === "reverse") { - iterationProgress = 1 - iterationProgress; - if (repeatDelay) { - iterationProgress -= repeatDelay / resolvedDuration; - } - } - else if (repeatType === "mirror") { - frameGenerator = mirroredGenerator; - } - } - elapsed = motionUtils.clamp(0, 1, iterationProgress) * resolvedDuration; - } - /** - * If we're in negative time, set state as the initial keyframe. - * This prevents delay: x, duration: 0 animations from finishing - * instantly. - */ - let state; - if (isInDelayPhase) { - this.delayState.value = keyframes[0]; - state = this.delayState; - } - else { - state = frameGenerator.next(elapsed); - } - if (mixKeyframes && !isInDelayPhase) { - state.value = mixKeyframes(state.value); - } - let { done } = state; - if (!isInDelayPhase && calculatedDuration !== null) { - done = - this.playbackSpeed >= 0 - ? this.currentTime >= totalDuration - : this.currentTime <= 0; - } - const isAnimationFinished = this.holdTime === null && - (this.state === "finished" || (this.state === "running" && done)); - // TODO: The exception for inertia could be cleaner here - if (isAnimationFinished && type !== inertia) { - state.value = getFinalKeyframe(keyframes, this.options, finalKeyframe, this.speed); - } - if (onUpdate) { - onUpdate(state.value); - } - if (isAnimationFinished) { - this.finish(); - } - return state; - } - /** - * Allows the returned animation to be awaited or promise-chained. Currently - * resolves when the animation finishes at all but in a future update could/should - * reject if its cancels. - */ - then(resolve, reject) { - return this.finished.then(resolve, reject); - } - get duration() { - return motionUtils.millisecondsToSeconds(this.calculatedDuration); - } - get iterationDuration() { - const { delay = 0 } = this.options || {}; - return this.duration + motionUtils.millisecondsToSeconds(delay); - } - get time() { - return motionUtils.millisecondsToSeconds(this.currentTime); - } - set time(newTime) { - newTime = motionUtils.secondsToMilliseconds(newTime); - this.currentTime = newTime; - if (this.startTime === null || - this.holdTime !== null || - this.playbackSpeed === 0) { - this.holdTime = newTime; - } - else if (this.driver) { - this.startTime = this.driver.now() - newTime / this.playbackSpeed; - } - if (this.driver) { - this.driver.start(false); - } - else { - this.startTime = 0; - this.state = "paused"; - this.holdTime = newTime; - this.tick(newTime); - } - } - /** - * Returns the generator's velocity at the current time in units/second. - * Uses the analytical derivative when available (springs), avoiding - * the MotionValue's frame-dependent velocity estimation. - */ - getGeneratorVelocity() { - const t = this.currentTime; - if (t <= 0) - return this.options.velocity || 0; - if (this.generator.velocity) { - return this.generator.velocity(t); - } - // Fallback: finite difference - const current = this.generator.next(t).value; - return getGeneratorVelocity((s) => this.generator.next(s).value, t, current); - } - get speed() { - return this.playbackSpeed; - } - set speed(newSpeed) { - const hasChanged = this.playbackSpeed !== newSpeed; - if (hasChanged && this.driver) { - this.updateTime(time.now()); - } - this.playbackSpeed = newSpeed; - if (hasChanged && this.driver) { - this.time = motionUtils.millisecondsToSeconds(this.currentTime); - } - } - play() { - if (this.isStopped) - return; - const { driver = frameloopDriver, startTime } = this.options; - if (!this.driver) { - this.driver = driver((timestamp) => this.tick(timestamp)); - } - this.options.onPlay?.(); - const now = this.driver.now(); - if (this.state === "finished") { - this.updateFinished(); - this.startTime = now; - } - else if (this.holdTime !== null) { - this.startTime = now - this.holdTime; - } - else if (!this.startTime) { - this.startTime = startTime ?? now; - } - if (this.state === "finished" && this.speed < 0) { - this.startTime += this.calculatedDuration; - } - this.holdTime = null; - /** - * Set playState to running only after we've used it in - * the previous logic. - */ - this.state = "running"; - this.driver.start(); - } - pause() { - this.state = "paused"; - this.updateTime(time.now()); - this.holdTime = this.currentTime; - } - complete() { - if (this.state !== "running") { - this.play(); - } - this.state = "finished"; - this.holdTime = null; - } - finish() { - this.notifyFinished(); - this.teardown(); - this.state = "finished"; - this.options.onComplete?.(); - } - cancel() { - this.holdTime = null; - this.startTime = 0; - this.tick(0); - this.teardown(); - this.options.onCancel?.(); - } - teardown() { - this.state = "idle"; - this.stopDriver(); - this.startTime = this.holdTime = null; - } - stopDriver() { - if (!this.driver) - return; - this.driver.stop(); - this.driver = undefined; - } - sample(sampleTime) { - this.startTime = 0; - return this.tick(sampleTime, true); - } - attachTimeline(timeline) { - if (this.options.allowFlatten) { - this.options.type = "keyframes"; - this.options.ease = "linear"; - this.initAnimation(); - } - this.driver?.stop(); - return timeline.observe(this); - } - } - // Legacy function support - function animateValue(options) { - return new JSAnimation(options); - } - - function fillWildcards(keyframes) { - for (let i = 1; i < keyframes.length; i++) { - keyframes[i] ?? (keyframes[i] = keyframes[i - 1]); - } - } - - const radToDeg = (rad) => (rad * 180) / Math.PI; - const rotate = (v) => { - const angle = radToDeg(Math.atan2(v[1], v[0])); - return rebaseAngle(angle); - }; - const matrix2dParsers = { - x: 4, - y: 5, - translateX: 4, - translateY: 5, - scaleX: 0, - scaleY: 3, - scale: (v) => (Math.abs(v[0]) + Math.abs(v[3])) / 2, - rotate, - rotateZ: rotate, - skewX: (v) => radToDeg(Math.atan(v[1])), - skewY: (v) => radToDeg(Math.atan(v[2])), - skew: (v) => (Math.abs(v[1]) + Math.abs(v[2])) / 2, - }; - const rebaseAngle = (angle) => { - angle = angle % 360; - if (angle < 0) - angle += 360; - return angle; - }; - const rotateZ = rotate; - const scaleX = (v) => Math.sqrt(v[0] * v[0] + v[1] * v[1]); - const scaleY = (v) => Math.sqrt(v[4] * v[4] + v[5] * v[5]); - const matrix3dParsers = { - x: 12, - y: 13, - z: 14, - translateX: 12, - translateY: 13, - translateZ: 14, - scaleX, - scaleY, - scale: (v) => (scaleX(v) + scaleY(v)) / 2, - rotateX: (v) => rebaseAngle(radToDeg(Math.atan2(v[6], v[5]))), - rotateY: (v) => rebaseAngle(radToDeg(Math.atan2(-v[2], v[0]))), - rotateZ, - rotate: rotateZ, - skewX: (v) => radToDeg(Math.atan(v[4])), - skewY: (v) => radToDeg(Math.atan(v[1])), - skew: (v) => (Math.abs(v[1]) + Math.abs(v[4])) / 2, - }; - function defaultTransformValue(name) { - return name.includes("scale") ? 1 : 0; - } - function parseValueFromTransform(transform, name) { - if (!transform || transform === "none") { - return defaultTransformValue(name); - } - const matrix3dMatch = transform.match(/^matrix3d\(([-\d.e\s,]+)\)$/u); - let parsers; - let match; - if (matrix3dMatch) { - parsers = matrix3dParsers; - match = matrix3dMatch; - } - else { - const matrix2dMatch = transform.match(/^matrix\(([-\d.e\s,]+)\)$/u); - parsers = matrix2dParsers; - match = matrix2dMatch; - } - if (!match) { - return defaultTransformValue(name); - } - const valueParser = parsers[name]; - const values = match[1].split(",").map(convertTransformToNumber); - return typeof valueParser === "function" - ? valueParser(values) - : values[valueParser]; - } - const readTransformValue = (instance, name) => { - const { transform = "none" } = getComputedStyle(instance); - return parseValueFromTransform(transform, name); - }; - function convertTransformToNumber(value) { - return parseFloat(value.trim()); - } - - /** - * Generate a list of every possible transform key. - */ - const transformPropOrder = [ - "transformPerspective", - "x", - "y", - "z", - "translateX", - "translateY", - "translateZ", - "scale", - "scaleX", - "scaleY", - "rotate", - "rotateX", - "rotateY", - "rotateZ", - "skew", - "skewX", - "skewY", - ]; - /** - * A quick lookup for transform props. - * - * `pathRotation` is a transform for routing purposes (skipped from raw - * style application, wired to the transform composite, flags transform - * dirty) but is intentionally NOT in `transformPropOrder` — it is - * composed onto `rotate` at the build sites, not serialized in its own - * slot, and must stay out of the order-array consumers (parse-transform, - * unit-conversion, keys-position). - */ - const transformProps = /*@__PURE__*/ (() => new Set([...transformPropOrder, "pathRotation"]))(); - - const isNumOrPxType = (v) => v === number || v === px; - const transformKeys = new Set(["x", "y", "z"]); - const nonTranslationalTransformKeys = transformPropOrder.filter((key) => !transformKeys.has(key)); - function removeNonTranslationalTransform(visualElement) { - const removedTransforms = []; - nonTranslationalTransformKeys.forEach((key) => { - const value = visualElement.getValue(key); - if (value !== undefined) { - removedTransforms.push([key, value.get()]); - value.set(key.startsWith("scale") ? 1 : 0); - } - }); - return removedTransforms; - } - const positionalValues = { - // Dimensions - width: ({ x }, { paddingLeft = "0", paddingRight = "0", boxSizing }) => { - const width = x.max - x.min; - return boxSizing === "border-box" - ? width - : width - parseFloat(paddingLeft) - parseFloat(paddingRight); - }, - height: ({ y }, { paddingTop = "0", paddingBottom = "0", boxSizing }) => { - const height = y.max - y.min; - return boxSizing === "border-box" - ? height - : height - parseFloat(paddingTop) - parseFloat(paddingBottom); - }, - top: (_bbox, { top }) => parseFloat(top), - left: (_bbox, { left }) => parseFloat(left), - bottom: ({ y }, { top }) => parseFloat(top) + (y.max - y.min), - right: ({ x }, { left }) => parseFloat(left) + (x.max - x.min), - // Transform - x: (_bbox, { transform }) => parseValueFromTransform(transform, "x"), - y: (_bbox, { transform }) => parseValueFromTransform(transform, "y"), - }; - // Alias translate longform names - positionalValues.translateX = positionalValues.x; - positionalValues.translateY = positionalValues.y; - - const toResolve = new Set(); - let isScheduled = false; - let anyNeedsMeasurement = false; - let isForced = false; - function measureAllKeyframes() { - if (anyNeedsMeasurement) { - const resolversToMeasure = Array.from(toResolve).filter((resolver) => resolver.needsMeasurement); - const elementsToMeasure = new Set(resolversToMeasure.map((resolver) => resolver.element)); - const transformsToRestore = new Map(); - /** - * Write pass - * If we're measuring elements we want to remove bounding box-changing transforms. - */ - elementsToMeasure.forEach((element) => { - const removedTransforms = removeNonTranslationalTransform(element); - if (!removedTransforms.length) - return; - transformsToRestore.set(element, removedTransforms); - element.render(); - }); - // Read - resolversToMeasure.forEach((resolver) => resolver.measureInitialState()); - // Write - elementsToMeasure.forEach((element) => { - element.render(); - const restore = transformsToRestore.get(element); - if (restore) { - restore.forEach(([key, value]) => { - element.getValue(key)?.set(value); - }); - } - }); - // Read - resolversToMeasure.forEach((resolver) => resolver.measureEndState()); - // Write - resolversToMeasure.forEach((resolver) => { - if (resolver.suspendedScrollY !== undefined) { - window.scrollTo(0, resolver.suspendedScrollY); - } - }); - } - anyNeedsMeasurement = false; - isScheduled = false; - toResolve.forEach((resolver) => resolver.complete(isForced)); - toResolve.clear(); - } - function readAllKeyframes() { - toResolve.forEach((resolver) => { - resolver.readKeyframes(); - if (resolver.needsMeasurement) { - anyNeedsMeasurement = true; - } - }); - } - function flushKeyframeResolvers() { - isForced = true; - readAllKeyframes(); - measureAllKeyframes(); - isForced = false; - } - class KeyframeResolver { - constructor(unresolvedKeyframes, onComplete, name, motionValue, element, isAsync = false) { - this.state = "pending"; - /** - * Track whether this resolver is async. If it is, it'll be added to the - * resolver queue and flushed in the next frame. Resolvers that aren't going - * to trigger read/write thrashing don't need to be async. - */ - this.isAsync = false; - /** - * Track whether this resolver needs to perform a measurement - * to resolve its keyframes. - */ - this.needsMeasurement = false; - this.unresolvedKeyframes = [...unresolvedKeyframes]; - this.onComplete = onComplete; - this.name = name; - this.motionValue = motionValue; - this.element = element; - this.isAsync = isAsync; - } - scheduleResolve() { - this.state = "scheduled"; - if (this.isAsync) { - toResolve.add(this); - if (!isScheduled) { - isScheduled = true; - frame.read(readAllKeyframes); - frame.resolveKeyframes(measureAllKeyframes); - } - } - else { - this.readKeyframes(); - this.complete(); - } - } - readKeyframes() { - const { unresolvedKeyframes, name, element, motionValue } = this; - // If initial keyframe is null we need to read it from the DOM - if (unresolvedKeyframes[0] === null) { - const currentValue = motionValue?.get(); - // TODO: This doesn't work if the final keyframe is a wildcard - const finalKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1]; - if (currentValue !== undefined) { - unresolvedKeyframes[0] = currentValue; - } - else if (element && name) { - const valueAsRead = element.readValue(name, finalKeyframe); - if (valueAsRead !== undefined && valueAsRead !== null) { - unresolvedKeyframes[0] = valueAsRead; - } - } - if (unresolvedKeyframes[0] === undefined) { - unresolvedKeyframes[0] = finalKeyframe; - } - if (motionValue && currentValue === undefined) { - motionValue.set(unresolvedKeyframes[0]); - } - } - fillWildcards(unresolvedKeyframes); - } - setFinalKeyframe() { } - measureInitialState() { } - renderEndStyles() { } - measureEndState() { } - complete(isForcedComplete = false) { - this.state = "complete"; - this.onComplete(this.unresolvedKeyframes, this.finalKeyframe, isForcedComplete); - toResolve.delete(this); - } - cancel() { - if (this.state === "scheduled") { - toResolve.delete(this); - this.state = "pending"; - } - } - resume() { - if (this.state === "pending") - this.scheduleResolve(); - } - } - - const isCSSVar = (name) => name.startsWith("--"); - - function setStyle(element, name, value) { - isCSSVar(name) - ? element.style.setProperty(name, value) - : (element.style[name] = value); - } - - /** - * Add the ability for test suites to manually set support flags - * to better test more environments. - */ - const supportsFlags = {}; - - function memoSupports(callback, supportsFlag) { - const memoized = motionUtils.memo(callback); - return () => supportsFlags[supportsFlag] ?? memoized(); - } - - const supportsScrollTimeline = /* @__PURE__ */ memoSupports(() => window.ScrollTimeline !== undefined, "scrollTimeline"); - const supportsViewTimeline = /* @__PURE__ */ memoSupports(() => window.ViewTimeline !== undefined, "viewTimeline"); - - const supportsLinearEasing = /*@__PURE__*/ memoSupports(() => { - try { - document - .createElement("div") - .animate({ opacity: 0 }, { easing: "linear(0, 1)" }); - } - catch (e) { - return false; - } - return true; - }, "linearEasing"); - - const cubicBezierAsString = ([a, b, c, d]) => `cubic-bezier(${a}, ${b}, ${c}, ${d})`; - - const supportedWaapiEasing = { - linear: "linear", - ease: "ease", - easeIn: "ease-in", - easeOut: "ease-out", - easeInOut: "ease-in-out", - circIn: /*@__PURE__*/ cubicBezierAsString([0, 0.65, 0.55, 1]), - circOut: /*@__PURE__*/ cubicBezierAsString([0.55, 0, 1, 0.45]), - backIn: /*@__PURE__*/ cubicBezierAsString([0.31, 0.01, 0.66, -0.59]), - backOut: /*@__PURE__*/ cubicBezierAsString([0.33, 1.53, 0.69, 0.99]), - }; - - function mapEasingToNativeEasing(easing, duration) { - if (!easing) { - return undefined; - } - else if (typeof easing === "function") { - return supportsLinearEasing() - ? generateLinearEasing(easing, duration) - : "ease-out"; - } - else if (motionUtils.isBezierDefinition(easing)) { - return cubicBezierAsString(easing); - } - else if (Array.isArray(easing)) { - return easing.map((segmentEasing) => mapEasingToNativeEasing(segmentEasing, duration) || - supportedWaapiEasing.easeOut); - } - else { - return supportedWaapiEasing[easing]; - } - } - - function startWaapiAnimation(element, valueName, keyframes, { delay = 0, duration = 300, repeat = 0, repeatType = "loop", ease = "easeOut", times, } = {}, pseudoElement = undefined) { - const keyframeOptions = { - [valueName]: keyframes, - }; - if (times) - keyframeOptions.offset = times; - const easing = mapEasingToNativeEasing(ease, duration); - /** - * If this is an easing array, apply to keyframes, not animation as a whole - */ - if (Array.isArray(easing)) - keyframeOptions.easing = easing; - const options = { - delay, - duration, - easing: !Array.isArray(easing) ? easing : "linear", - fill: "both", - iterations: repeat + 1, - direction: repeatType === "reverse" ? "alternate" : "normal", - }; - if (pseudoElement) - options.pseudoElement = pseudoElement; - return element.animate(keyframeOptions, options); - } - - function isGenerator(type) { - return typeof type === "function" && "applyToOptions" in type; - } - - function applyGeneratorOptions({ type, ...options }) { - if (isGenerator(type) && supportsLinearEasing()) { - return type.applyToOptions(options); - } - else { - options.duration ?? (options.duration = 300); - options.ease ?? (options.ease = "easeOut"); - } - return options; - } - - /** - * NativeAnimation implements AnimationPlaybackControls for the browser's Web Animations API. - */ - class NativeAnimation extends WithPromise { - constructor(options) { - super(); - this.finishedTime = null; - this.isStopped = false; - /** - * Tracks a manually-set start time that takes precedence over WAAPI's - * dynamic startTime. This is cleared when play() or time setter is called, - * allowing WAAPI to take over timing. - */ - this.manualStartTime = null; - if (!options) - return; - const { element, name, keyframes, pseudoElement, allowFlatten = false, finalKeyframe, onComplete, } = options; - this.isPseudoElement = Boolean(pseudoElement); - this.allowFlatten = allowFlatten; - this.options = options; - motionUtils.invariant(typeof options.type !== "string", `Mini animate() doesn't support "type" as a string.`, "mini-spring"); - const transition = applyGeneratorOptions(options); - this.animation = startWaapiAnimation(element, name, keyframes, transition, pseudoElement); - if (transition.autoplay === false) { - this.animation.pause(); - } - this.animation.onfinish = () => { - this.finishedTime = this.time; - if (!pseudoElement) { - const keyframe = getFinalKeyframe(keyframes, this.options, finalKeyframe, this.speed); - if (this.updateMotionValue) { - this.updateMotionValue(keyframe); - } - /** - * If we can, we want to commit the final style as set by the user, - * rather than the computed keyframe value supplied by the animation. - * We always do this, even when a motion value is present, to prevent - * a visual flash in Firefox where the WAAPI animation's fill is removed - * during cancel() before the scheduled render can apply the correct value. - */ - setStyle(element, name, keyframe); - this.animation.cancel(); - } - onComplete?.(); - this.notifyFinished(); - }; - } - play() { - if (this.isStopped) - return; - this.manualStartTime = null; - this.animation.play(); - if (this.state === "finished") { - this.updateFinished(); - } - } - pause() { - this.animation.pause(); - } - complete() { - this.animation.finish?.(); - } - cancel() { - try { - this.animation.cancel(); - } - catch (e) { } - } - stop() { - if (this.isStopped) - return; - this.isStopped = true; - const { state } = this; - if (state === "idle" || state === "finished") { - return; - } - if (this.updateMotionValue) { - this.updateMotionValue(); - } - else { - this.commitStyles(); - } - if (!this.isPseudoElement) - this.cancel(); - } - /** - * WAAPI doesn't natively have any interruption capabilities. - * - * In this method, we commit styles back to the DOM before cancelling - * the animation. - * - * This is designed to be overridden by NativeAnimationExtended, which - * will create a renderless JS animation and sample it twice to calculate - * its current value, "previous" value, and therefore allow - * Motion to also correctly calculate velocity for any subsequent animation - * while deferring the commit until the next animation frame. - */ - commitStyles() { - const element = this.options?.element; - if (!this.isPseudoElement && element?.isConnected) { - this.animation.commitStyles?.(); - } - } - get duration() { - const duration = this.animation.effect?.getComputedTiming?.().duration || 0; - return motionUtils.millisecondsToSeconds(Number(duration)); - } - get iterationDuration() { - const { delay = 0 } = this.options || {}; - return this.duration + motionUtils.millisecondsToSeconds(delay); - } - get time() { - return motionUtils.millisecondsToSeconds(Number(this.animation.currentTime) || 0); - } - set time(newTime) { - const wasFinished = this.finishedTime !== null; - this.manualStartTime = null; - this.finishedTime = null; - this.animation.currentTime = motionUtils.secondsToMilliseconds(newTime); - if (wasFinished) { - this.animation.pause(); - } - } - /** - * The playback speed of the animation. - * 1 = normal speed, 2 = double speed, 0.5 = half speed. - */ - get speed() { - return this.animation.playbackRate; - } - set speed(newSpeed) { - // Allow backwards playback after finishing - if (newSpeed < 0) - this.finishedTime = null; - this.animation.playbackRate = newSpeed; - } - get state() { - return this.finishedTime !== null - ? "finished" - : this.animation.playState; - } - get startTime() { - return this.manualStartTime ?? Number(this.animation.startTime); - } - set startTime(newStartTime) { - this.manualStartTime = this.animation.startTime = newStartTime; - } - /** - * Attaches a timeline to the animation, for instance the `ScrollTimeline`. - */ - attachTimeline({ timeline, rangeStart, rangeEnd, observe, }) { - if (this.allowFlatten) { - this.animation.effect?.updateTiming({ easing: "linear" }); - } - this.animation.onfinish = null; - if (timeline && supportsScrollTimeline()) { - this.animation.timeline = timeline; - if (rangeStart) - this.animation.rangeStart = rangeStart; - if (rangeEnd) - this.animation.rangeEnd = rangeEnd; - return motionUtils.noop; - } - else { - return observe(this); - } - } - } - - const unsupportedEasingFunctions = { - anticipate: motionUtils.anticipate, - backInOut: motionUtils.backInOut, - circInOut: motionUtils.circInOut, - }; - function isUnsupportedEase(key) { - return key in unsupportedEasingFunctions; - } - function replaceStringEasing(transition) { - if (typeof transition.ease === "string" && - isUnsupportedEase(transition.ease)) { - transition.ease = unsupportedEasingFunctions[transition.ease]; - } - } - - /** - * 10ms is chosen here as it strikes a balance between smooth - * results (more than one keyframe per frame at 60fps) and - * keyframe quantity. - */ - const sampleDelta = 10; //ms - class NativeAnimationExtended extends NativeAnimation { - constructor(options) { - /** - * The base NativeAnimation function only supports a subset - * of Motion easings, and WAAPI also only supports some - * easing functions via string/cubic-bezier definitions. - * - * This function replaces those unsupported easing functions - * with a JS easing function. This will later get compiled - * to a linear() easing function. - */ - replaceStringEasing(options); - /** - * Ensure we replace the transition type with a generator function - * before passing to WAAPI. - * - * TODO: Does this have a better home? It could be shared with - * JSAnimation. - */ - replaceTransitionType(options); - super(options); - /** - * Only set startTime when the animation should autoplay. - * Setting startTime on a paused WAAPI animation unpauses it - * (per the WAAPI spec), which breaks autoplay: false. - */ - if (options.startTime !== undefined && options.autoplay !== false) { - this.startTime = options.startTime; - } - this.options = options; - } - /** - * WAAPI doesn't natively have any interruption capabilities. - * - * Rather than read committed styles back out of the DOM, we can - * create a renderless JS animation and sample it twice to calculate - * its current value, "previous" value, and therefore allow - * Motion to calculate velocity for any subsequent animation. - */ - updateMotionValue(value) { - const { motionValue, onUpdate, onComplete, element, ...options } = this.options; - if (!motionValue) - return; - if (value !== undefined) { - motionValue.set(value); - return; - } - const sampleAnimation = new JSAnimation({ - ...options, - autoplay: false, - }); - /** - * Use wall-clock elapsed time for sampling. - * Under CPU load, WAAPI's currentTime may not reflect actual - * elapsed time, causing incorrect sampling and visual jumps. - */ - const sampleTime = Math.max(sampleDelta, time.now() - this.startTime); - const delta = motionUtils.clamp(0, sampleDelta, sampleTime - sampleDelta); - const current = sampleAnimation.sample(sampleTime).value; - /** - * Write the estimated value to inline style so it persists - * after cancel(), covering the async gap before the next - * animation starts. - */ - const { name } = this.options; - if (element && name) - setStyle(element, name, current); - motionValue.setWithVelocity(sampleAnimation.sample(Math.max(0, sampleTime - delta)).value, current, delta); - sampleAnimation.stop(); - } - } - - /** - * Check if a value is animatable. Examples: - * - * ✅: 100, "100px", "#fff" - * ❌: "block", "url(2.jpg)" - * @param value - * - * @internal - */ - const isAnimatable = (value, name) => { - // If the list of keys that might be non-animatable grows, replace with Set - if (name === "zIndex") - return false; - // If it's a number or a keyframes array, we can animate it. We might at some point - // need to do a deep isAnimatable check of keyframes, or let Popmotion handle this, - // but for now lets leave it like this for performance reasons - if (typeof value === "number" || Array.isArray(value)) - return true; - if (typeof value === "string" && // It's animatable if we have a string - (complex.test(value) || value === "0") && // And it contains numbers and/or colors - !value.startsWith("url(") // Unless it starts with "url(" - ) { - return true; - } - return false; - }; - - function hasKeyframesChanged(keyframes) { - const current = keyframes[0]; - if (keyframes.length === 1) - return true; - for (let i = 0; i < keyframes.length; i++) { - if (keyframes[i] !== current) - return true; - } - } - function canAnimate(keyframes, name, type, velocity) { - /** - * Check if we're able to animate between the start and end keyframes, - * and throw a warning if we're attempting to animate between one that's - * animatable and another that isn't. - */ - const originKeyframe = keyframes[0]; - if (originKeyframe === null) { - return false; - } - /** - * These aren't traditionally animatable but we do support them. - * In future we could look into making this more generic or replacing - * this function with mix() === mixImmediate - */ - if (name === "display" || name === "visibility") - return true; - const targetKeyframe = keyframes[keyframes.length - 1]; - const isOriginAnimatable = isAnimatable(originKeyframe, name); - const isTargetAnimatable = isAnimatable(targetKeyframe, name); - motionUtils.warning(isOriginAnimatable === isTargetAnimatable, `You are trying to animate ${name} from "${originKeyframe}" to "${targetKeyframe}". "${isOriginAnimatable ? targetKeyframe : originKeyframe}" is not an animatable value.`, "value-not-animatable"); - // Always skip if any of these are true - if (!isOriginAnimatable || !isTargetAnimatable) { - return false; - } - return (hasKeyframesChanged(keyframes) || - ((type === "spring" || isGenerator(type)) && velocity)); - } - - function makeAnimationInstant(options) { - options.duration = 0; - options.type = "keyframes"; - } - - /** - * A list of values that can be hardware-accelerated. - */ - const acceleratedValues = new Set([ - "opacity", - "clipPath", - "filter", - "transform", - "backgroundColor", - ]); - - const browserColorFunctions = /^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/; - function hasBrowserOnlyColors(keyframes) { - for (let i = 0; i < keyframes.length; i++) { - if (typeof keyframes[i] === "string" && - browserColorFunctions.test(keyframes[i])) { - return true; - } - } - return false; - } - - const colorProperties = new Set([ - "color", - "backgroundColor", - "outlineColor", - "fill", - "stroke", - "borderColor", - "borderTopColor", - "borderRightColor", - "borderBottomColor", - "borderLeftColor", - ]); - const supportsWaapi = /*@__PURE__*/ motionUtils.memo(() => Object.hasOwnProperty.call(Element.prototype, "animate")); - function supportsBrowserAnimation(options) { - const { motionValue, name, repeatDelay, repeatType, damping, type, keyframes, } = options; - const subject = motionValue?.owner?.current; - /** - * We use instanceof checks instead of isHTMLElement()/isSVGElement() - * because we explicitly **don't** want elements in different timing - * contexts (i.e. popups) to be accelerated, as it's not possible to sync - * these animations properly with those driven from the main window - * frameloop. - */ - if (!(subject instanceof HTMLElement) && - !(subject instanceof SVGElement)) { - return false; - } - const { onUpdate, transformTemplate } = motionValue.owner.getProps(); - return (supportsWaapi() && - name && - /** - * Force WAAPI for color properties with browser-only color formats - * (oklch, oklab, lab, lch, etc.) that the JS animation path can't parse. - */ - (acceleratedValues.has(name) || - (colorProperties.has(name) && - hasBrowserOnlyColors(keyframes))) && - (name !== "transform" || !transformTemplate) && - /** - * If we're outputting values to onUpdate then we can't use WAAPI as there's - * no way to read the value from WAAPI every frame. - */ - !onUpdate && - !repeatDelay && - repeatType !== "mirror" && - damping !== 0 && - type !== "inertia"); - } - - /** - * Maximum time allowed between an animation being created and it being - * resolved for us to use the latter as the start time. - * - * This is to ensure that while we prefer to "start" an animation as soon - * as it's triggered, we also want to avoid a visual jump if there's a big delay - * between these two moments. - */ - const MAX_RESOLVE_DELAY = 40; - class AsyncMotionValueAnimation extends WithPromise { - constructor({ autoplay = true, delay = 0, type = "keyframes", repeat = 0, repeatDelay = 0, repeatType = "loop", keyframes, name, motionValue, element, ...options }) { - super(); - /** - * Bound to support return animation.stop pattern - */ - this.stop = () => { - if (this._animation) { - this._animation.stop(); - this.stopTimeline?.(); - } - this.keyframeResolver?.cancel(); - }; - this.createdAt = time.now(); - const optionsWithDefaults = { - autoplay, - delay, - type, - repeat, - repeatDelay, - repeatType, - name, - motionValue, - element, - ...options, - }; - const KeyframeResolver$1 = element?.KeyframeResolver || KeyframeResolver; - this.keyframeResolver = new KeyframeResolver$1(keyframes, (resolvedKeyframes, finalKeyframe, forced) => this.onKeyframesResolved(resolvedKeyframes, finalKeyframe, optionsWithDefaults, !forced), name, motionValue, element); - this.keyframeResolver?.scheduleResolve(); - } - onKeyframesResolved(keyframes, finalKeyframe, options, sync) { - this.keyframeResolver = undefined; - const { name, type, velocity, delay, isHandoff, onUpdate } = options; - this.resolvedAt = time.now(); - /** - * If we can't animate this value with the resolved keyframes - * then we should complete it immediately. - */ - let canAnimateValue = true; - if (!canAnimate(keyframes, name, type, velocity)) { - canAnimateValue = false; - if (motionUtils.MotionGlobalConfig.instantAnimations || !delay) { - onUpdate?.(getFinalKeyframe(keyframes, options, finalKeyframe)); - } - keyframes[0] = keyframes[keyframes.length - 1]; - makeAnimationInstant(options); - options.repeat = 0; - } - /** - * Resolve startTime for the animation. - * - * This method uses the createdAt and resolvedAt to calculate the - * animation startTime. *Ideally*, we would use the createdAt time as t=0 - * as the following frame would then be the first frame of the animation in - * progress, which would feel snappier. - * - * However, if there's a delay (main thread work) between the creation of - * the animation and the first committed frame, we prefer to use resolvedAt - * to avoid a sudden jump into the animation. - */ - const startTime = sync - ? !this.resolvedAt - ? this.createdAt - : this.resolvedAt - this.createdAt > MAX_RESOLVE_DELAY - ? this.resolvedAt - : this.createdAt - : undefined; - const resolvedOptions = { - startTime, - finalKeyframe, - ...options, - keyframes, - }; - /** - * Animate via WAAPI if possible. If this is a handoff animation, the optimised animation will be running via - * WAAPI. Therefore, this animation must be JS to ensure it runs "under" the - * optimised animation. - * - * Also skip WAAPI when keyframes aren't animatable, as the resolved - * values may not be valid CSS and would trigger browser warnings. - */ - const useWaapi = canAnimateValue && - !isHandoff && - supportsBrowserAnimation(resolvedOptions); - const element = resolvedOptions.motionValue?.owner?.current; - let animation; - if (useWaapi) { - try { - animation = new NativeAnimationExtended({ - ...resolvedOptions, - element, - }); - } - catch { - animation = new JSAnimation(resolvedOptions); - } - } - else { - animation = new JSAnimation(resolvedOptions); - } - animation.finished.then(() => { - this.notifyFinished(); - }).catch(motionUtils.noop); - if (this.pendingTimeline) { - this.stopTimeline = animation.attachTimeline(this.pendingTimeline); - this.pendingTimeline = undefined; - } - this._animation = animation; - } - get finished() { - if (!this._animation) { - return this._finished; - } - else { - return this.animation.finished; - } - } - then(onResolve, _onReject) { - return this.finished.finally(onResolve).then(() => { }); - } - get animation() { - if (!this._animation) { - this.keyframeResolver?.resume(); - flushKeyframeResolvers(); - } - return this._animation; - } - get duration() { - return this.animation.duration; - } - get iterationDuration() { - return this.animation.iterationDuration; - } - get time() { - return this.animation.time; - } - set time(newTime) { - this.animation.time = newTime; - } - get speed() { - return this.animation.speed; - } - get state() { - return this.animation.state; - } - set speed(newSpeed) { - this.animation.speed = newSpeed; - } - get startTime() { - return this.animation.startTime; - } - attachTimeline(timeline) { - if (this._animation) { - this.stopTimeline = this.animation.attachTimeline(timeline); - } - else { - this.pendingTimeline = timeline; - } - return () => this.stop(); - } - play() { - this.animation.play(); - } - pause() { - this.animation.pause(); - } - complete() { - this.animation.complete(); - } - cancel() { - if (this._animation) { - this.animation.cancel(); - } - this.keyframeResolver?.cancel(); - } - } - - class GroupAnimation { - constructor(animations) { - // Bound to accomadate common `return animation.stop` pattern - this.stop = () => this.runAll("stop"); - this.animations = animations.filter(Boolean); - } - get finished() { - return Promise.all(this.animations.map((animation) => animation.finished)); - } - /** - * TODO: Filter out cancelled or stopped animations before returning - */ - getAll(propName) { - return this.animations[0][propName]; - } - setAll(propName, newValue) { - for (let i = 0; i < this.animations.length; i++) { - this.animations[i][propName] = newValue; - } - } - attachTimeline(timeline) { - const subscriptions = this.animations.map((animation) => animation.attachTimeline(timeline)); - return () => { - subscriptions.forEach((cancel, i) => { - cancel && cancel(); - this.animations[i].stop(); - }); - }; - } - get time() { - return this.getAll("time"); - } - set time(time) { - this.setAll("time", time); - } - get speed() { - return this.getAll("speed"); - } - set speed(speed) { - this.setAll("speed", speed); - } - get state() { - return this.getAll("state"); - } - get startTime() { - return this.getAll("startTime"); - } - get duration() { - return getMax(this.animations, "duration"); - } - get iterationDuration() { - return getMax(this.animations, "iterationDuration"); - } - runAll(methodName) { - this.animations.forEach((controls) => controls[methodName]()); - } - play() { - this.runAll("play"); - } - pause() { - this.runAll("pause"); - } - cancel() { - this.runAll("cancel"); - } - complete() { - this.runAll("complete"); - } - } - function getMax(animations, propName) { - let max = 0; - for (let i = 0; i < animations.length; i++) { - const value = animations[i][propName]; - if (value !== null && value > max) { - max = value; - } - } - return max; - } - - class GroupAnimationWithThen extends GroupAnimation { - then(onResolve, _onReject) { - return this.finished.finally(onResolve).then(() => { }); - } - } - - class NativeAnimationWrapper extends NativeAnimation { - constructor(animation) { - super(); - this.animation = animation; - animation.onfinish = () => { - this.finishedTime = this.time; - this.notifyFinished(); - }; - } - } - - const animationMaps = new WeakMap(); - const animationMapKey = (name, pseudoElement = "") => `${name}:${pseudoElement}`; - function getAnimationMap(element) { - let map = animationMaps.get(element); - if (!map) { - map = new Map(); - animationMaps.set(element, map); - } - return map; - } - - function calcChildStagger(children, child, delayChildren, staggerChildren = 0, staggerDirection = 1) { - const index = Array.from(children) - .sort((a, b) => a.sortNodePosition(b)) - .indexOf(child); - const numChildren = children.size; - const maxStaggerDuration = (numChildren - 1) * staggerChildren; - const delayIsFunction = typeof delayChildren === "function"; - return delayIsFunction - ? delayChildren(index, numChildren) - : staggerDirection === 1 - ? index * staggerChildren - : maxStaggerDuration - index * staggerChildren; - } - - /** - * Maximum time between the value of two frames, beyond which we - * assume the velocity has since been 0. - */ - const MAX_VELOCITY_DELTA = 30; - const isFloat = (value) => { - return !isNaN(parseFloat(value)); - }; - const collectMotionValues = { - current: undefined, - }; - /** - * `MotionValue` is used to track the state and velocity of motion values. - * - * @public - */ - class MotionValue { - /** - * @param init - The initiating value - * @param config - Optional configuration options - * - * - `transformer`: A function to transform incoming values with. - */ - constructor(init, options = {}) { - /** - * Tracks whether this value can output a velocity. Currently this is only true - * if the value is numerical, but we might be able to widen the scope here and support - * other value types. - * - * @internal - */ - this.canTrackVelocity = null; - /** - * An object containing a SubscriptionManager for each active event. - */ - this.events = {}; - this.updateAndNotify = (v) => { - const currentTime = time.now(); - /** - * If we're updating the value during another frame or eventloop - * than the previous frame, then the we set the previous frame value - * to current. - */ - if (this.updatedAt !== currentTime) { - this.setPrevFrameValue(); - } - this.prev = this.current; - this.setCurrent(v); - // Update update subscribers - if (this.current !== this.prev) { - this.events.change?.notify(this.current); - if (this.dependents) { - for (const dependent of this.dependents) { - dependent.dirty(); - } - } - } - }; - this.hasAnimated = false; - this.setCurrent(init); - this.owner = options.owner; - } - setCurrent(current) { - this.current = current; - this.updatedAt = time.now(); - if (this.canTrackVelocity === null && current !== undefined) { - this.canTrackVelocity = isFloat(this.current); - } - } - setPrevFrameValue(prevFrameValue = this.current) { - this.prevFrameValue = prevFrameValue; - this.prevUpdatedAt = this.updatedAt; - } - /** - * Adds a function that will be notified when the `MotionValue` is updated. - * - * It returns a function that, when called, will cancel the subscription. - * - * When calling `onChange` inside a React component, it should be wrapped with the - * `useEffect` hook. As it returns an unsubscribe function, this should be returned - * from the `useEffect` function to ensure you don't add duplicate subscribers.. - * - * ```jsx - * export const MyComponent = () => { - * const x = useMotionValue(0) - * const y = useMotionValue(0) - * const opacity = useMotionValue(1) - * - * useEffect(() => { - * function updateOpacity() { - * const maxXY = Math.max(x.get(), y.get()) - * const newOpacity = transform(maxXY, [0, 100], [1, 0]) - * opacity.set(newOpacity) - * } - * - * const unsubscribeX = x.on("change", updateOpacity) - * const unsubscribeY = y.on("change", updateOpacity) - * - * return () => { - * unsubscribeX() - * unsubscribeY() - * } - * }, []) - * - * return - * } - * ``` - * - * @param subscriber - A function that receives the latest value. - * @returns A function that, when called, will cancel this subscription. - * - * @deprecated - */ - onChange(subscription) { - { - motionUtils.warnOnce(false, `value.onChange(callback) is deprecated. Switch to value.on("change", callback).`); - } - return this.on("change", subscription); - } - on(eventName, callback) { - if (!this.events[eventName]) { - this.events[eventName] = new motionUtils.SubscriptionManager(); - } - const unsubscribe = this.events[eventName].add(callback); - if (eventName === "change") { - return () => { - unsubscribe(); - /** - * If we have no more change listeners by the start - * of the next frame, stop active animations. - */ - frame.read(() => { - if (!this.events.change.getSize()) { - this.stop(); - } - }); - }; - } - return unsubscribe; - } - clearListeners() { - for (const eventManagers in this.events) { - this.events[eventManagers].clear(); - } - } - /** - * Attaches a passive effect to the `MotionValue`. - */ - attach(passiveEffect, stopPassiveEffect) { - this.passiveEffect = passiveEffect; - this.stopPassiveEffect = stopPassiveEffect; - } - /** - * Sets the state of the `MotionValue`. - * - * @remarks - * - * ```jsx - * const x = useMotionValue(0) - * x.set(10) - * ``` - * - * @param latest - Latest value to set. - * @param render - Whether to notify render subscribers. Defaults to `true` - * - * @public - */ - set(v) { - if (!this.passiveEffect) { - this.updateAndNotify(v); - } - else { - this.passiveEffect(v, this.updateAndNotify); - } - } - setWithVelocity(prev, current, delta) { - this.set(current); - this.prev = undefined; - this.prevFrameValue = prev; - this.prevUpdatedAt = this.updatedAt - delta; - } - /** - * Set the state of the `MotionValue`, stopping any active animations, - * effects, and resets velocity to `0`. - */ - jump(v, endAnimation = true) { - this.updateAndNotify(v); - this.prev = v; - this.prevUpdatedAt = this.prevFrameValue = undefined; - endAnimation && this.stop(); - if (this.stopPassiveEffect) - this.stopPassiveEffect(); - } - dirty() { - this.events.change?.notify(this.current); - } - addDependent(dependent) { - if (!this.dependents) { - this.dependents = new Set(); - } - this.dependents.add(dependent); - } - removeDependent(dependent) { - if (this.dependents) { - this.dependents.delete(dependent); - } - } - /** - * Returns the latest state of `MotionValue` - * - * @returns - The latest state of `MotionValue` - * - * @public - */ - get() { - if (collectMotionValues.current) { - collectMotionValues.current.push(this); - } - return this.current; - } - /** - * @public - */ - getPrevious() { - return this.prev; - } - /** - * Returns the latest velocity of `MotionValue` - * - * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical. - * - * @public - */ - getVelocity() { - const currentTime = time.now(); - if (!this.canTrackVelocity || - this.prevFrameValue === undefined || - currentTime - this.updatedAt > MAX_VELOCITY_DELTA) { - return 0; - } - const delta = Math.min(this.updatedAt - this.prevUpdatedAt, MAX_VELOCITY_DELTA); - // Casts because of parseFloat's poor typing - return motionUtils.velocityPerSecond(parseFloat(this.current) - - parseFloat(this.prevFrameValue), delta); - } - /** - * Registers a new animation to control this `MotionValue`. Only one - * animation can drive a `MotionValue` at one time. - * - * ```jsx - * value.start() - * ``` - * - * @param animation - A function that starts the provided animation - */ - start(startAnimation) { - this.stop(); - return new Promise((resolve) => { - this.hasAnimated = true; - this.animation = startAnimation(resolve); - if (this.events.animationStart) { - this.events.animationStart.notify(); - } - }).then(() => { - if (this.events.animationComplete) { - this.events.animationComplete.notify(); - } - this.clearAnimation(); - }); - } - /** - * Stop the currently active animation. - * - * @public - */ - stop() { - if (this.animation) { - this.animation.stop(); - if (this.events.animationCancel) { - this.events.animationCancel.notify(); - } - } - this.clearAnimation(); - } - /** - * Returns `true` if this value is currently animating. - * - * @public - */ - isAnimating() { - return !!this.animation; - } - clearAnimation() { - delete this.animation; - } - /** - * Destroy and clean up subscribers to this `MotionValue`. - * - * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically - * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually - * created a `MotionValue` via the `motionValue` function. - * - * @public - */ - destroy() { - this.dependents?.clear(); - this.events.destroy?.notify(); - this.clearListeners(); - this.stop(); - if (this.stopPassiveEffect) { - this.stopPassiveEffect(); - } - } - } - function motionValue(init, options) { - return new MotionValue(init, options); - } - - /** - * If `transition` has `inherit: true`, shallow-merge it with - * `parentTransition` (child keys win) and strip the `inherit` key. - * Otherwise return `transition` unchanged. - */ - function resolveTransition(transition, parentTransition) { - if (transition?.inherit && parentTransition) { - const { inherit: _, ...rest } = transition; - return { ...parentTransition, ...rest }; - } - return transition; - } - - function getValueTransition(transition, key) { - const valueTransition = transition?.[key] ?? - transition?.["default"] ?? - transition; - if (valueTransition !== transition) { - return resolveTransition(valueTransition, transition); - } - return valueTransition; - } - - const underDampedSpring = { - type: "spring", - stiffness: 500, - damping: 25, - restSpeed: 10, - }; - const criticallyDampedSpring = (target) => ({ - type: "spring", - stiffness: 550, - damping: target === 0 ? 2 * Math.sqrt(550) : 30, - restSpeed: 10, - }); - const keyframesTransition = { - type: "keyframes", - duration: 0.8, - }; - /** - * Default easing curve is a slightly shallower version of - * the default browser easing curve. - */ - const ease = { - type: "keyframes", - ease: [0.25, 0.1, 0.35, 1], - duration: 0.3, - }; - const getDefaultTransition = (valueKey, { keyframes }) => { - if (keyframes.length > 2) { - return keyframesTransition; - } - else if (transformProps.has(valueKey)) { - return valueKey.startsWith("scale") - ? criticallyDampedSpring(keyframes[1]) - : underDampedSpring; - } - return ease; - }; - - const orchestrationKeys = new Set([ - "when", - "delay", - "delayChildren", - "staggerChildren", - "staggerDirection", - "repeat", - "repeatType", - "repeatDelay", - "from", - "elapsed", - ]); - /** - * Decide whether a transition is defined on a given Transition. - * This filters out orchestration options and returns true - * if any options are left. - */ - function isTransitionDefined(transition) { - for (const key in transition) { - if (!orchestrationKeys.has(key)) - return true; - } - return false; - } - - const animateMotionValue = (name, value, target, transition = {}, element, isHandoff) => (onComplete) => { - const valueTransition = getValueTransition(transition, name) || {}; - /** - * Most transition values are currently completely overwritten by value-specific - * transitions. In the future it'd be nicer to blend these transitions. But for now - * delay actually does inherit from the root transition if not value-specific. - */ - const delay = valueTransition.delay || transition.delay || 0; - /** - * Elapsed isn't a public transition option but can be passed through from - * optimized appear effects in milliseconds. - */ - let { elapsed = 0 } = transition; - elapsed = elapsed - motionUtils.secondsToMilliseconds(delay); - const options = { - keyframes: Array.isArray(target) ? target : [null, target], - ease: "easeOut", - velocity: value.getVelocity(), - ...valueTransition, - delay: -elapsed, - onUpdate: (v) => { - value.set(v); - valueTransition.onUpdate && valueTransition.onUpdate(v); - }, - onComplete: () => { - onComplete(); - valueTransition.onComplete && valueTransition.onComplete(); - }, - name, - motionValue: value, - element: isHandoff ? undefined : element, - }; - /** - * If there's no transition defined for this value, we can generate - * unique transition settings for this value. - */ - if (!isTransitionDefined(valueTransition)) { - Object.assign(options, getDefaultTransition(name, options)); - } - /** - * Both WAAPI and our internal animation functions use durations - * as defined by milliseconds, while our external API defines them - * as seconds. - */ - options.duration && (options.duration = motionUtils.secondsToMilliseconds(options.duration)); - options.repeatDelay && (options.repeatDelay = motionUtils.secondsToMilliseconds(options.repeatDelay)); - /** - * Support deprecated way to set initial value. Prefer keyframe syntax. - */ - if (options.from !== undefined) { - options.keyframes[0] = options.from; - } - let shouldSkip = false; - if (options.type === false || - (options.duration === 0 && !options.repeatDelay)) { - makeAnimationInstant(options); - if (options.delay === 0) { - shouldSkip = true; - } - } - if (motionUtils.MotionGlobalConfig.instantAnimations || - motionUtils.MotionGlobalConfig.skipAnimations || - element?.shouldSkipAnimations || - valueTransition.skipAnimations) { - shouldSkip = true; - makeAnimationInstant(options); - options.delay = 0; - } - /** - * If the transition type or easing has been explicitly set by the user - * then we don't want to allow flattening the animation. - */ - options.allowFlatten = !valueTransition.type && !valueTransition.ease; - /** - * If we can or must skip creating the animation, and apply only - * the final keyframe, do so. We also check once keyframes are resolved but - * this early check prevents the need to create an animation at all. - */ - if (shouldSkip && !isHandoff && value.get() !== undefined) { - const finalKeyframe = getFinalKeyframe(options.keyframes, valueTransition); - if (finalKeyframe !== undefined) { - frame.update(() => { - options.onUpdate(finalKeyframe); - options.onComplete(); - }); - return; - } - } - return valueTransition.isSync - ? new JSAnimation(options) - : new AsyncMotionValueAnimation(options); - }; - - const MIN_LAYOUT_DISTANCE = 20; - function bezierPoint(t, origin, control, target) { - const inv = 1 - t; - return inv * inv * origin + 2 * inv * t * control + t * t * target; - } - function bezierTangentAngle(t, originX, controlX, targetX, originY, controlY, targetY) { - const dx = 2 * (1 - t) * (controlX - originX) + 2 * t * (targetX - controlX); - const dy = 2 * (1 - t) * (controlY - originY) + 2 * t * (targetY - controlY); - return Math.atan2(dy, dx) * (180 / Math.PI); - } - function computeArcControlPoint(fromX, fromY, toX, toY, strength, peak) { - const deltaX = toX - fromX; - const deltaY = toY - fromY; - const distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY); - if (distance > 0) { - const normalPerpX = -deltaY / distance; - const normalPerpY = deltaX / distance; - const desiredHeight = strength * distance; - return { - x: fromX + deltaX * peak + normalPerpX * desiredHeight, - y: fromY + deltaY * peak + normalPerpY * desiredHeight, - }; - } - return { x: fromX, y: fromY }; - } - /** - * The pure sampling factory: `(from, to) => (t) => point`. Internal — - * used by {@link arc} and the unit tests. Not part of the public surface. - */ - function createArcPath({ strength = 0.5, peak = 0.5, direction, rotate = false, } = {}) { - const rotationScale = rotate === true ? 1 : typeof rotate === "number" ? rotate : 0; - // Auto-direction only: persists across calls to flip the bulge back - // onto the same screen side when the dominant axis changes between - // calls. Reuse the factory (module scope / useMemo) to keep this alive. - let prevBulgeSign; - const createInterpolator = (from, to) => { - const dx = to.x - from.x; - const dy = to.y - from.y; - let signed; - if (direction === "cw") { - signed = -strength; - } - else if (direction === "ccw") { - signed = strength; - } - else { - const dom = Math.abs(dx) >= Math.abs(dy) ? dx : dy; - signed = dom < 0 ? -strength : strength; - } - let control = computeArcControlPoint(from.x, from.y, to.x, to.y, signed, peak); - if (direction === undefined) { - const isVertical = Math.abs(dx) < Math.abs(dy); - const midX = from.x + dx * peak; - const midY = from.y + dy * peak; - const bulgeSign = isVertical - ? Math.sign(control.x - midX) - : Math.sign(control.y - midY); - if (prevBulgeSign !== undefined && - bulgeSign !== 0 && - bulgeSign !== prevBulgeSign) { - signed = -signed; - control = computeArcControlPoint(from.x, from.y, to.x, to.y, signed, peak); - } - else if (bulgeSign !== 0) { - prevBulgeSign = bulgeSign; - } - } - const tangent0 = rotationScale - ? bezierTangentAngle(0, from.x, control.x, to.x, from.y, control.y, to.y) - : 0; - const tangent1 = rotationScale - ? bezierTangentAngle(1, from.x, control.x, to.x, from.y, control.y, to.y) - : 0; - const tangentDelta = rotationScale - ? motionUtils.wrap(-180, 180, tangent1 - tangent0) - : 0; - return (t) => { - const out = { - x: bezierPoint(t, from.x, control.x, to.x), - y: bezierPoint(t, from.y, control.y, to.y), - }; - if (rotationScale) { - const raw = bezierTangentAngle(t, from.x, control.x, to.x, from.y, control.y, to.y); - const baseline = tangent0 + tangentDelta * t; - out.rotate = motionUtils.wrap(-180, 180, raw - baseline) * rotationScale; - } - return out; - }; - }; - return createInterpolator; - } - /** - * Creates a curved path for `transition.path`: - * - * ```ts - * - * ``` - * - * Reuse the returned value (module scope / useMemo / useRef) so its - * continuity closure survives re-renders — a fresh `arc()` has no memory. - */ - function arc(options = {}) { - const sample = createArcPath(options); - const path = { - interpolateProjection(delta) { - // `from` is the current translate offset (carries any in-flight - // displacement when interrupted); `to` is the new layout origin. - // The distance floor avoids visible wobble on tiny shifts. - const tx = delta.x.translate; - const ty = delta.y.translate; - if (Math.sqrt(tx * tx + ty * ty) < MIN_LAYOUT_DISTANCE) { - return undefined; - } - return sample({ x: tx, y: ty }, { x: 0, y: 0 }); - }, - animateVisualElement(visualElement, target, transition, delay, animations) { - if (!("x" in target || "y" in target)) - return; - const xValue = visualElement.getValue("x", visualElement.latestValues["x"] ?? 0); - const yValue = visualElement.getValue("y", visualElement.latestValues["y"] ?? 0); - const xRaw = target.x; - const yRaw = target.y; - const xFrom = (Array.isArray(xRaw) && xRaw[0] != null - ? xRaw[0] - : xValue?.get()) ?? 0; - const yFrom = (Array.isArray(yRaw) && yRaw[0] != null - ? yRaw[0] - : yValue?.get()) ?? 0; - const xTo = (Array.isArray(xRaw) - ? xRaw[xRaw.length - 1] - : xRaw ?? xFrom); - const yTo = (Array.isArray(yRaw) - ? yRaw[yRaw.length - 1] - : yRaw ?? yFrom); - // Interruption needs no flag: x/y already hold the displaced - // mid-arc position, so xFrom/yFrom carry the continuity geometry. - const interpolate = sample({ x: xFrom, y: yFrom }, { x: xTo, y: yTo }); - // Drive a dedicated `pathRotation` value (composed onto `rotate` - // at the build sites) rather than `rotate` itself, so a - // concurrent rotate animation composes and nothing accumulates - // on interrupt. - const pathRotationValue = interpolate(0).rotate !== undefined - ? visualElement.getValue("pathRotation", 0) - : undefined; - const pathTransition = { - delay, - ...getValueTransition(transition || {}, "x"), - }; - delete pathTransition.path; - const progress = motionValue(0); - progress.start(animateMotionValue("", progress, [0, 1000], { - ...pathTransition, - isSync: true, - velocity: 0, - onUpdate: (latest) => { - const point = interpolate(latest / 1000); - xValue?.set(point.x); - yValue?.set(point.y); - if (pathRotationValue && point.rotate !== undefined) { - pathRotationValue.set(point.rotate); - } - }, - onComplete: () => { - xValue?.set(xTo); - yValue?.set(yTo); - pathRotationValue?.set(0); - }, - // Interrupt/cancel must clear our additive contribution - // so it can't linger on top of the user's `rotate`. - onStop: () => pathRotationValue?.set(0), - onCancel: () => pathRotationValue?.set(0), - })); - if (progress.animation) - animations.push(progress.animation); - delete target.x; - delete target.y; - }, - }; - return path; - } - - /** - * Parse Framer's special CSS variable format into a CSS token and a fallback. - * - * ``` - * `var(--foo, #fff)` => [`--foo`, '#fff'] - * ``` - * - * @param current - */ - const splitCSSVariableRegex = - // eslint-disable-next-line redos-detector/no-unsafe-regex -- false positive, as it can match a lot of words - /^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u; - function parseCSSVariable(current) { - const match = splitCSSVariableRegex.exec(current); - if (!match) - return [,]; - const [, token1, token2, fallback] = match; - return [`--${token1 ?? token2}`, fallback]; - } - const maxDepth = 4; - function getVariableValue(current, element, depth = 1) { - motionUtils.invariant(depth <= maxDepth, `Max CSS variable fallback depth detected in property "${current}". This may indicate a circular fallback dependency.`, "max-css-var-depth"); - const [token, fallback] = parseCSSVariable(current); - // No CSS variable detected - if (!token) - return; - // Attempt to read this CSS variable off the element - const resolved = window.getComputedStyle(element).getPropertyValue(token); - if (resolved) { - const trimmed = resolved.trim(); - return motionUtils.isNumericalString(trimmed) ? parseFloat(trimmed) : trimmed; - } - return isCSSVariableToken(fallback) - ? getVariableValue(fallback, element, depth + 1) - : fallback; - } - - function getValueState(visualElement) { - const state = [{}, {}]; - visualElement?.values.forEach((value, key) => { - state[0][key] = value.get(); - state[1][key] = value.getVelocity(); - }); - return state; - } - function resolveVariantFromProps(props, definition, custom, visualElement) { - /** - * If the variant definition is a function, resolve. - */ - if (typeof definition === "function") { - const [current, velocity] = getValueState(visualElement); - definition = definition(custom !== undefined ? custom : props.custom, current, velocity); - } - /** - * If the variant definition is a variant label, or - * the function returned a variant label, resolve. - */ - if (typeof definition === "string") { - definition = props.variants && props.variants[definition]; - } - /** - * At this point we've resolved both functions and variant labels, - * but the resolved variant label might itself have been a function. - * If so, resolve. This can only have returned a valid target object. - */ - if (typeof definition === "function") { - const [current, velocity] = getValueState(visualElement); - definition = definition(custom !== undefined ? custom : props.custom, current, velocity); - } - return definition; - } - - function resolveVariant(visualElement, definition, custom) { - const props = visualElement.getProps(); - return resolveVariantFromProps(props, definition, custom !== undefined ? custom : props.custom, visualElement); - } - - const positionalKeys = new Set([ - "width", - "height", - "top", - "left", - "right", - "bottom", - ...transformPropOrder, - ]); - - const isKeyframesTarget = (v) => { - return Array.isArray(v); - }; - - /** - * Set VisualElement's MotionValue, creating a new MotionValue for it if - * it doesn't exist. - */ - function setMotionValue(visualElement, key, value) { - if (visualElement.hasValue(key)) { - visualElement.getValue(key).set(value); - } - else { - visualElement.addValue(key, motionValue(value)); - } - } - function resolveFinalValueInKeyframes(v) { - // TODO maybe throw if v.length - 1 is placeholder token? - return isKeyframesTarget(v) ? v[v.length - 1] || 0 : v; - } - function setTarget(visualElement, definition) { - const resolved = resolveVariant(visualElement, definition); - let { transitionEnd = {}, transition = {}, ...target } = resolved || {}; - target = { ...target, ...transitionEnd }; - for (const key in target) { - const value = resolveFinalValueInKeyframes(target[key]); - setMotionValue(visualElement, key, value); - } - } - - const isMotionValue = (value) => Boolean(value && value.getVelocity); - - function isWillChangeMotionValue(value) { - return Boolean(isMotionValue(value) && value.add); - } - - function addValueToWillChange(visualElement, key) { - const willChange = visualElement.getValue("willChange"); - /** - * It could be that a user has set willChange to a regular MotionValue, - * in which case we can't add the value to it. - */ - if (isWillChangeMotionValue(willChange)) { - return willChange.add(key); - } - else if (!willChange && motionUtils.MotionGlobalConfig.WillChange) { - const newWillChange = new motionUtils.MotionGlobalConfig.WillChange("auto"); - visualElement.addValue("willChange", newWillChange); - newWillChange.add(key); - } - } - - function camelToDash(str) { - return str.replace(/([A-Z])/g, (match) => `-${match.toLowerCase()}`); - } - - const optimizedAppearDataId = "framerAppearId"; - const optimizedAppearDataAttribute = "data-" + camelToDash(optimizedAppearDataId); - - function getOptimisedAppearId(visualElement) { - return visualElement.props[optimizedAppearDataAttribute]; - } - - /** - * Decide whether we should block this animation. Previously, we achieved this - * just by checking whether the key was listed in protectedKeys, but this - * posed problems if an animation was triggered by afterChildren and protectedKeys - * had been set to true in the meantime. - */ - function shouldBlockAnimation({ protectedKeys, needsAnimating }, key) { - const shouldBlock = protectedKeys.hasOwnProperty(key) && needsAnimating[key] !== true; - needsAnimating[key] = false; - return shouldBlock; - } - function animateTarget(visualElement, targetAndTransition, { delay = 0, transitionOverride, type } = {}) { - let { transition, transitionEnd, ...target } = targetAndTransition; - const defaultTransition = visualElement.getDefaultTransition(); - transition = transition - ? resolveTransition(transition, defaultTransition) - : defaultTransition; - const reduceMotion = transition?.reduceMotion; - const skipAnimations = transition?.skipAnimations; - if (transitionOverride) - transition = transitionOverride; - const animations = []; - const animationTypeState = type && - visualElement.animationState && - visualElement.animationState.getState()[type]; - const path = transition?.path; - if (path) { - // path mutates `target` to claim x/y; loop below skips them. - path.animateVisualElement(visualElement, target, transition, delay, animations); - } - for (const key in target) { - const value = visualElement.getValue(key, visualElement.latestValues[key] ?? null); - const valueTarget = target[key]; - if (valueTarget === undefined || - (animationTypeState && - shouldBlockAnimation(animationTypeState, key))) { - continue; - } - const valueTransition = { - delay, - ...getValueTransition(transition || {}, key), - }; - if (skipAnimations) - valueTransition.skipAnimations = true; - /** - * If the value is already at the defined target, skip the animation. - * We still re-assert the value via frame.update to take precedence - * over any stale transitionEnd callbacks from previous animations. - */ - const currentValue = value.get(); - if (currentValue !== undefined && - !value.isAnimating() && - !Array.isArray(valueTarget) && - valueTarget === currentValue && - !valueTransition.velocity) { - frame.update(() => value.set(valueTarget)); - continue; - } - /** - * If this is the first time a value is being animated, check - * to see if we're handling off from an existing animation. - */ - let isHandoff = false; - if (window.MotionHandoffAnimation) { - const appearId = getOptimisedAppearId(visualElement); - if (appearId) { - const startTime = window.MotionHandoffAnimation(appearId, key, frame); - if (startTime !== null) { - valueTransition.startTime = startTime; - isHandoff = true; - } - } - } - addValueToWillChange(visualElement, key); - const shouldReduceMotion = reduceMotion ?? visualElement.shouldReduceMotion; - value.start(animateMotionValue(key, value, valueTarget, shouldReduceMotion && positionalKeys.has(key) - ? { type: false } - : valueTransition, visualElement, isHandoff)); - const animation = value.animation; - if (animation) { - animations.push(animation); - } - } - if (transitionEnd) { - const applyTransitionEnd = () => frame.update(() => { - transitionEnd && setTarget(visualElement, transitionEnd); - }); - if (animations.length) { - Promise.all(animations).then(applyTransitionEnd); - } - else { - applyTransitionEnd(); - } - } - return animations; - } - - function animateVariant(visualElement, variant, options = {}) { - const resolved = resolveVariant(visualElement, variant, options.type === "exit" - ? visualElement.presenceContext?.custom - : undefined); - let { transition = visualElement.getDefaultTransition() || {} } = resolved || {}; - if (options.transitionOverride) { - transition = options.transitionOverride; - } - /** - * If we have a variant, create a callback that runs it as an animation. - * Otherwise, we resolve a Promise immediately for a composable no-op. - */ - const getAnimation = resolved - ? () => Promise.all(animateTarget(visualElement, resolved, options)) - : () => Promise.resolve(); - /** - * If we have children, create a callback that runs all their animations. - * Otherwise, we resolve a Promise immediately for a composable no-op. - */ - const getChildAnimations = visualElement.variantChildren && visualElement.variantChildren.size - ? (forwardDelay = 0) => { - const { delayChildren = 0, staggerChildren, staggerDirection, } = transition; - return animateChildren(visualElement, variant, forwardDelay, delayChildren, staggerChildren, staggerDirection, options); - } - : () => Promise.resolve(); - /** - * If the transition explicitly defines a "when" option, we need to resolve either - * this animation or all children animations before playing the other. - */ - const { when } = transition; - if (when) { - const [first, last] = when === "beforeChildren" - ? [getAnimation, getChildAnimations] - : [getChildAnimations, getAnimation]; - return first().then(() => last()); - } - else { - return Promise.all([getAnimation(), getChildAnimations(options.delay)]); - } - } - function animateChildren(visualElement, variant, delay = 0, delayChildren = 0, staggerChildren = 0, staggerDirection = 1, options) { - const animations = []; - for (const child of visualElement.variantChildren) { - child.notify("AnimationStart", variant); - animations.push(animateVariant(child, variant, { - ...options, - delay: delay + - (typeof delayChildren === "function" ? 0 : delayChildren) + - calcChildStagger(visualElement.variantChildren, child, delayChildren, staggerChildren, staggerDirection), - }).then(() => child.notify("AnimationComplete", variant))); - } - return Promise.all(animations); - } - - function animateVisualElement(visualElement, definition, options = {}) { - visualElement.notify("AnimationStart", definition); - let animation; - if (Array.isArray(definition)) { - const animations = definition.map((variant) => animateVariant(visualElement, variant, options)); - animation = Promise.all(animations); - } - else if (typeof definition === "string") { - animation = animateVariant(visualElement, definition, options); - } - else { - const resolvedDefinition = typeof definition === "function" - ? resolveVariant(visualElement, definition, options.custom) - : definition; - animation = Promise.all(animateTarget(visualElement, resolvedDefinition, options)); - } - return animation.then(() => { - visualElement.notify("AnimationComplete", definition); - }); - } - - /** - * ValueType for "auto" - */ - const auto = { - test: (v) => v === "auto", - parse: (v) => v, - }; - - /** - * Tests a provided value against a ValueType - */ - const testValueType = (v) => (type) => type.test(v); - - /** - * A list of value types commonly used for dimensions - */ - const dimensionValueTypes = [number, px, percent, degrees, vw, vh, auto]; - /** - * Tests a dimensional value against the list of dimension ValueTypes - */ - const findDimensionValueType = (v) => dimensionValueTypes.find(testValueType(v)); - - function isNone(value) { - if (typeof value === "number") { - return value === 0; - } - else if (value !== null) { - return value === "none" || value === "0" || motionUtils.isZeroValueString(value); - } - else { - return true; - } - } - - /** - * Properties that should default to 1 or 100% - */ - const maxDefaults = new Set(["brightness", "contrast", "saturate", "opacity"]); - function applyDefaultFilter(v) { - const [name, value] = v.slice(0, -1).split("("); - if (name === "drop-shadow") - return v; - const [number] = value.match(floatRegex) || []; - if (!number) - return v; - const unit = value.replace(number, ""); - let defaultValue = maxDefaults.has(name) ? 1 : 0; - if (number !== value) - defaultValue *= 100; - return name + "(" + defaultValue + unit + ")"; - } - const functionRegex = /\b([a-z-]*)\(.*?\)/gu; - const filter = { - ...complex, - getAnimatableNone: (v) => { - const functions = v.match(functionRegex); - return functions ? functions.map(applyDefaultFilter).join(" ") : v; - }, - }; - - const mask = { - ...complex, - getAnimatableNone: (v) => { - const parsed = complex.parse(v); - const transformer = complex.createTransformer(v); - return transformer(parsed.map((v) => typeof v === "number" ? 0 : typeof v === "object" ? { ...v, alpha: 1 } : v)); - }, - }; - - const int = { - ...number, - transform: Math.round, - }; - - const transformValueTypes = { - rotate: degrees, - /** - * Internal channel for `transition.path` orientToPath. Composed onto - * `rotate` at the transform-build sites so the user's `rotate` is - * never read or overwritten. Not part of `transformPropOrder`. - */ - pathRotation: degrees, - rotateX: degrees, - rotateY: degrees, - rotateZ: degrees, - scale, - scaleX: scale, - scaleY: scale, - scaleZ: scale, - skew: degrees, - skewX: degrees, - skewY: degrees, - distance: px, - translateX: px, - translateY: px, - translateZ: px, - x: px, - y: px, - z: px, - perspective: px, - transformPerspective: px, - opacity: alpha, - originX: progressPercentage, - originY: progressPercentage, - originZ: px, - }; - - const numberValueTypes = { - // Border props - borderWidth: px, - borderTopWidth: px, - borderRightWidth: px, - borderBottomWidth: px, - borderLeftWidth: px, - borderRadius: px, - borderTopLeftRadius: px, - borderTopRightRadius: px, - borderBottomRightRadius: px, - borderBottomLeftRadius: px, - // Positioning props - width: px, - maxWidth: px, - height: px, - maxHeight: px, - top: px, - right: px, - bottom: px, - left: px, - inset: px, - insetBlock: px, - insetBlockStart: px, - insetBlockEnd: px, - insetInline: px, - insetInlineStart: px, - insetInlineEnd: px, - // Spacing props - padding: px, - paddingTop: px, - paddingRight: px, - paddingBottom: px, - paddingLeft: px, - paddingBlock: px, - paddingBlockStart: px, - paddingBlockEnd: px, - paddingInline: px, - paddingInlineStart: px, - paddingInlineEnd: px, - margin: px, - marginTop: px, - marginRight: px, - marginBottom: px, - marginLeft: px, - marginBlock: px, - marginBlockStart: px, - marginBlockEnd: px, - marginInline: px, - marginInlineStart: px, - marginInlineEnd: px, - // Typography - fontSize: px, - // Misc - backgroundPositionX: px, - backgroundPositionY: px, - ...transformValueTypes, - zIndex: int, - // SVG - fillOpacity: alpha, - strokeOpacity: alpha, - numOctaves: int, - }; - - /** - * A map of default value types for common values - */ - const defaultValueTypes = { - ...numberValueTypes, - // Color props - color, - backgroundColor: color, - outlineColor: color, - fill: color, - stroke: color, - // Border props - borderColor: color, - borderTopColor: color, - borderRightColor: color, - borderBottomColor: color, - borderLeftColor: color, - filter, - WebkitFilter: filter, - mask, - WebkitMask: mask, - }; - /** - * Gets the default ValueType for the provided value key - */ - const getDefaultValueType = (key) => defaultValueTypes[key]; - - const customTypes = /*@__PURE__*/ new Set([filter, mask]); - function getAnimatableNone(key, value) { - let defaultValueType = getDefaultValueType(key); - if (!customTypes.has(defaultValueType)) - defaultValueType = complex; - // If value is not recognised as animatable, ie "none", create an animatable version origin based on the target - return defaultValueType.getAnimatableNone - ? defaultValueType.getAnimatableNone(value) - : undefined; - } - - /** - * If we encounter keyframes like "none" or "0" and we also have keyframes like - * "#fff" or "200px 200px" we want to find a keyframe to serve as a template for - * the "none" keyframes. In this case "#fff" or "200px 200px" - then these get turned into - * zero equivalents, i.e. "#fff0" or "0px 0px". - */ - const invalidTemplates = new Set(["auto", "none", "0"]); - function makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, name) { - let i = 0; - let animatableTemplate = undefined; - while (i < unresolvedKeyframes.length && !animatableTemplate) { - const keyframe = unresolvedKeyframes[i]; - if (typeof keyframe === "string" && - !invalidTemplates.has(keyframe) && - analyseComplexValue(keyframe).values.length) { - animatableTemplate = unresolvedKeyframes[i]; - } - i++; - } - if (animatableTemplate && name) { - for (const noneIndex of noneKeyframeIndexes) { - unresolvedKeyframes[noneIndex] = getAnimatableNone(name, animatableTemplate); - } - } - } - - class DOMKeyframesResolver extends KeyframeResolver { - constructor(unresolvedKeyframes, onComplete, name, motionValue, element) { - super(unresolvedKeyframes, onComplete, name, motionValue, element, true); - } - readKeyframes() { - const { unresolvedKeyframes, element, name } = this; - if (!element || !element.current) - return; - super.readKeyframes(); - /** - * If any keyframe is a CSS variable, we need to find its value by sampling the element - */ - for (let i = 0; i < unresolvedKeyframes.length; i++) { - let keyframe = unresolvedKeyframes[i]; - if (typeof keyframe === "string") { - keyframe = keyframe.trim(); - if (isCSSVariableToken(keyframe)) { - const resolved = getVariableValue(keyframe, element.current); - if (resolved !== undefined) { - unresolvedKeyframes[i] = resolved; - } - if (i === unresolvedKeyframes.length - 1) { - this.finalKeyframe = keyframe; - } - } - } - } - /** - * Resolve "none" values. We do this potentially twice - once before and once after measuring keyframes. - * This could be seen as inefficient but it's a trade-off to avoid measurements in more situations, which - * have a far bigger performance impact. - */ - this.resolveNoneKeyframes(); - /** - * Check to see if unit type has changed. If so schedule jobs that will - * temporarily set styles to the destination keyframes. - * Skip if we have more than two keyframes or this isn't a positional value. - * TODO: We can throw if there are multiple keyframes and the value type changes. - */ - if (!positionalKeys.has(name) || unresolvedKeyframes.length !== 2) { - return; - } - const [origin, target] = unresolvedKeyframes; - const originType = findDimensionValueType(origin); - const targetType = findDimensionValueType(target); - /** - * If one keyframe contains embedded CSS variables (e.g. in calc()) and the other - * doesn't, we need to measure to convert to pixels. This handles GitHub issue #3410. - */ - const originHasVar = containsCSSVariable(origin); - const targetHasVar = containsCSSVariable(target); - if (originHasVar !== targetHasVar && positionalValues[name]) { - this.needsMeasurement = true; - return; - } - /** - * Either we don't recognise these value types or we can animate between them. - */ - if (originType === targetType) - return; - /** - * If both values are numbers or pixels, we can animate between them by - * converting them to numbers. - */ - if (isNumOrPxType(originType) && isNumOrPxType(targetType)) { - for (let i = 0; i < unresolvedKeyframes.length; i++) { - const value = unresolvedKeyframes[i]; - if (typeof value === "string") { - unresolvedKeyframes[i] = parseFloat(value); - } - } - } - else if (positionalValues[name]) { - /** - * Else, the only way to resolve this is by measuring the element. - */ - this.needsMeasurement = true; - } - } - resolveNoneKeyframes() { - const { unresolvedKeyframes, name } = this; - const noneKeyframeIndexes = []; - for (let i = 0; i < unresolvedKeyframes.length; i++) { - if (unresolvedKeyframes[i] === null || - isNone(unresolvedKeyframes[i])) { - noneKeyframeIndexes.push(i); - } - } - if (noneKeyframeIndexes.length) { - makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, name); - } - } - measureInitialState() { - const { element, unresolvedKeyframes, name } = this; - if (!element || !element.current) - return; - if (name === "height") { - this.suspendedScrollY = window.pageYOffset; - } - this.measuredOrigin = positionalValues[name](element.measureViewportBox(), window.getComputedStyle(element.current)); - unresolvedKeyframes[0] = this.measuredOrigin; - // Set final key frame to measure after next render - const measureKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1]; - if (measureKeyframe !== undefined) { - element.getValue(name, measureKeyframe).jump(measureKeyframe, false); - } - } - measureEndState() { - const { element, name, unresolvedKeyframes } = this; - if (!element || !element.current) - return; - const value = element.getValue(name); - value && value.jump(this.measuredOrigin, false); - const finalKeyframeIndex = unresolvedKeyframes.length - 1; - const finalKeyframe = unresolvedKeyframes[finalKeyframeIndex]; - unresolvedKeyframes[finalKeyframeIndex] = positionalValues[name](element.measureViewportBox(), window.getComputedStyle(element.current)); - if (finalKeyframe !== null && this.finalKeyframe === undefined) { - this.finalKeyframe = finalKeyframe; - } - // If we removed transform values, reapply them before the next render - if (this.removedTransforms?.length) { - this.removedTransforms.forEach(([unsetTransformName, unsetTransformValue]) => { - element - .getValue(unsetTransformName) - .set(unsetTransformValue); - }); - } - this.resolveNoneKeyframes(); - } - } - - /** - * The four corner-radius longhands. Shared so the projection mixer, scale - * corrector, WAAPI px-value set and view-transition crop pass don't each carry - * their own copy. Order is irrelevant - every consumer mixes/corrects/animates - * each corner independently. - */ - const cornerRadiusProps = [ - "borderTopLeftRadius", - "borderTopRightRadius", - "borderBottomRightRadius", - "borderBottomLeftRadius", - ]; - - const pxValues = new Set([ - // Border props - "borderWidth", - "borderTopWidth", - "borderRightWidth", - "borderBottomWidth", - "borderLeftWidth", - "borderRadius", - ...cornerRadiusProps, - // Positioning props - "width", - "maxWidth", - "height", - "maxHeight", - "top", - "right", - "bottom", - "left", - "inset", - "insetBlock", - "insetBlockStart", - "insetBlockEnd", - "insetInline", - "insetInlineStart", - "insetInlineEnd", - // Spacing props - "padding", - "paddingTop", - "paddingRight", - "paddingBottom", - "paddingLeft", - "paddingBlock", - "paddingBlockStart", - "paddingBlockEnd", - "paddingInline", - "paddingInlineStart", - "paddingInlineEnd", - "margin", - "marginTop", - "marginRight", - "marginBottom", - "marginLeft", - "marginBlock", - "marginBlockStart", - "marginBlockEnd", - "marginInline", - "marginInlineStart", - "marginInlineEnd", - // Typography - "fontSize", - // Misc - "backgroundPositionX", - "backgroundPositionY", - ]); - - function applyPxDefaults(keyframes, name) { - for (let i = 0; i < keyframes.length; i++) { - if (typeof keyframes[i] === "number" && pxValues.has(name)) { - keyframes[i] = keyframes[i] + "px"; - } - } - } - - function isWaapiSupportedEasing(easing) { - return Boolean((typeof easing === "function" && supportsLinearEasing()) || - !easing || - (typeof easing === "string" && - (easing in supportedWaapiEasing || supportsLinearEasing())) || - motionUtils.isBezierDefinition(easing) || - (Array.isArray(easing) && easing.every(isWaapiSupportedEasing))); - } - - const supportsPartialKeyframes = /*@__PURE__*/ motionUtils.memo(() => { - try { - document.createElement("div").animate({ opacity: [1] }); - } - catch (e) { - return false; - } - return true; - }); - - function resolveElements(elementOrSelector, scope, selectorCache) { - if (elementOrSelector == null) { - return []; - } - if (elementOrSelector instanceof EventTarget) { - return [elementOrSelector]; - } - else if (typeof elementOrSelector === "string") { - let root = document; - if (scope) { - root = scope.current; - } - const elements = selectorCache?.[elementOrSelector] ?? - root.querySelectorAll(elementOrSelector); - return elements ? Array.from(elements) : []; - } - return Array.from(elementOrSelector).filter((element) => element != null); - } - - function createSelectorEffect(subjectEffect) { - return (subject, values) => { - const elements = resolveElements(subject); - const subscriptions = []; - for (const element of elements) { - const remove = subjectEffect(element, values); - subscriptions.push(remove); - } - return () => { - for (const remove of subscriptions) - remove(); - }; - }; - } - - /** - * Provided a value and a ValueType, returns the value as that value type. - */ - const getValueAsType = (value, type) => { - return type && typeof value === "number" - ? type.transform(value) - : value; - }; - - class MotionValueState { - constructor() { - this.latest = {}; - this.values = new Map(); - } - set(name, value, render, computed, useDefaultValueType = true) { - const existingValue = this.values.get(name); - if (existingValue) { - existingValue.onRemove(); - } - const onChange = () => { - const v = value.get(); - if (useDefaultValueType) { - this.latest[name] = getValueAsType(v, numberValueTypes[name]); - } - else { - this.latest[name] = v; - } - render && frame.render(render); - }; - onChange(); - const cancelOnChange = value.on("change", onChange); - computed && value.addDependent(computed); - const remove = () => { - cancelOnChange(); - render && cancelFrame(render); - this.values.delete(name); - computed && value.removeDependent(computed); - }; - this.values.set(name, { value, onRemove: remove }); - return remove; - } - get(name) { - return this.values.get(name)?.value; - } - } - - function createEffect(addValue) { - const stateCache = new WeakMap(); - return (subject, values) => { - const state = stateCache.get(subject) ?? new MotionValueState(); - stateCache.set(subject, state); - const subscriptions = []; - for (const key in values) { - const value = values[key]; - const remove = addValue(subject, state, key, value); - subscriptions.push(remove); - } - return () => { - for (const cancel of subscriptions) - cancel(); - }; - }; - } - - function canSetAsProperty(element, name) { - if (!(name in element)) - return false; - const descriptor = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(element), name) || - Object.getOwnPropertyDescriptor(element, name); - // Check if it has a setter - return descriptor && typeof descriptor.set === "function"; - } - const addAttrValue = (element, state, key, value) => { - const isProp = canSetAsProperty(element, key); - const name = isProp - ? key - : key.startsWith("data") || key.startsWith("aria") - ? camelToDash(key) - : key; - /** - * Set attribute directly via property if available - */ - const render = isProp - ? () => { - element[name] = state.latest[key]; - } - : () => { - const v = state.latest[key]; - if (v === null || v === undefined) { - element.removeAttribute(name); - } - else { - element.setAttribute(name, String(v)); - } - }; - return state.set(key, value, render); - }; - const attrEffect = /*@__PURE__*/ createSelectorEffect( - /*@__PURE__*/ createEffect(addAttrValue)); - - const propEffect = /*@__PURE__*/ createEffect((subject, state, key, value) => { - return state.set(key, value, () => { - subject[key] = state.latest[key]; - }, undefined, false); - }); - - /** - * Checks if an element is an HTML element in a way - * that works across iframes - */ - function isHTMLElement(element) { - return (motionUtils.isObject(element) && - "offsetHeight" in element && - !("ownerSVGElement" in element)); - } - - const translateAlias$1 = { - x: "translateX", - y: "translateY", - z: "translateZ", - transformPerspective: "perspective", - }; - function buildTransform$1(state) { - let transform = ""; - let transformIsDefault = true; - /** - * Loop over all possible transforms in order, adding the ones that - * are present to the transform string. - */ - for (let i = 0; i < transformPropOrder.length; i++) { - const key = transformPropOrder[i]; - const value = state.latest[key]; - if (value === undefined) - continue; - let valueIsDefault = true; - if (typeof value === "number") { - valueIsDefault = value === (key.startsWith("scale") ? 1 : 0); - } - else { - const parsed = parseFloat(value); - valueIsDefault = key.startsWith("scale") ? parsed === 1 : parsed === 0; - } - if (!valueIsDefault) { - transformIsDefault = false; - const transformName = translateAlias$1[key] || key; - transform += `${transformName}(${value}) `; - } - } - // See build-transform.ts: additive `rotate()` so user `rotate` isn't - // clobbered. Not a `transformPropOrder` slot. - const pathRotation = state.latest.pathRotation; - if (pathRotation) { - transformIsDefault = false; - transform += `rotate(${typeof pathRotation === "number" - ? `${pathRotation}deg` - : pathRotation}) `; - } - return transformIsDefault ? "none" : transform.trim(); - } - - const originProps = new Set(["originX", "originY", "originZ"]); - const addStyleValue = (element, state, key, value) => { - let render = undefined; - let computed = undefined; - if (transformProps.has(key)) { - if (!state.get("transform")) { - // If this is an HTML element, we need to set the transform-box to fill-box - // to normalise the transform relative to the element's bounding box - if (!isHTMLElement(element) && !state.get("transformBox")) { - addStyleValue(element, state, "transformBox", new MotionValue("fill-box")); - } - state.set("transform", new MotionValue("none"), () => { - element.style.transform = buildTransform$1(state); - }); - } - computed = state.get("transform"); - } - else if (originProps.has(key)) { - if (!state.get("transformOrigin")) { - state.set("transformOrigin", new MotionValue(""), () => { - const originX = state.latest.originX ?? "50%"; - const originY = state.latest.originY ?? "50%"; - const originZ = state.latest.originZ ?? 0; - element.style.transformOrigin = `${originX} ${originY} ${originZ}`; - }); - } - computed = state.get("transformOrigin"); - } - else if (isCSSVar(key)) { - render = () => { - element.style.setProperty(key, state.latest[key]); - }; - } - else { - render = () => { - element.style[key] = state.latest[key]; - }; - } - return state.set(key, value, render, computed); - }; - const styleEffect = /*@__PURE__*/ createSelectorEffect( - /*@__PURE__*/ createEffect(addStyleValue)); - - function addSVGPathValue(element, state, key, value) { - frame.render(() => element.setAttribute("pathLength", "1")); - if (key === "pathOffset") { - return state.set(key, value, () => { - // Use unitless value to avoid Safari zoom bug - const offset = state.latest[key]; - element.setAttribute("stroke-dashoffset", `${-offset}`); - }); - } - else { - if (!state.get("stroke-dasharray")) { - state.set("stroke-dasharray", new MotionValue("1 1"), () => { - const { pathLength = 1, pathSpacing } = state.latest; - // Use unitless values to avoid Safari zoom bug - element.setAttribute("stroke-dasharray", `${pathLength} ${pathSpacing ?? 1 - Number(pathLength)}`); - }); - } - return state.set(key, value, undefined, state.get("stroke-dasharray")); - } - } - const addSVGValue = (element, state, key, value) => { - if (key.startsWith("path")) { - return addSVGPathValue(element, state, key, value); - } - else if (key.startsWith("attr")) { - return addAttrValue(element, state, convertAttrKey(key), value); - } - const handler = key in element.style ? addStyleValue : addAttrValue; - return handler(element, state, key, value); - }; - const svgEffect = /*@__PURE__*/ createSelectorEffect( - /*@__PURE__*/ createEffect(addSVGValue)); - function convertAttrKey(key) { - return key.replace(/^attr([A-Z])/, (_, firstChar) => firstChar.toLowerCase()); - } - - const { schedule: microtask, cancel: cancelMicrotask } = - /* @__PURE__ */ createRenderBatcher(queueMicrotask, false); - - const isDragging = { - x: false, - y: false, - }; - function isDragActive() { - return isDragging.x || isDragging.y; - } - - function setDragLock(axis) { - if (axis === "x" || axis === "y") { - if (isDragging[axis]) { - return null; - } - else { - isDragging[axis] = true; - return () => { - isDragging[axis] = false; - }; - } - } - else { - if (isDragging.x || isDragging.y) { - return null; - } - else { - isDragging.x = isDragging.y = true; - return () => { - isDragging.x = isDragging.y = false; - }; - } - } - } - - function setupGesture(elementOrSelector, options) { - const elements = resolveElements(elementOrSelector); - const gestureAbortController = new AbortController(); - const eventOptions = { - passive: true, - ...options, - signal: gestureAbortController.signal, - }; - const cancel = () => gestureAbortController.abort(); - return [elements, eventOptions, cancel]; - } - - function isValidHover(event) { - return !(event.pointerType === "touch" || isDragActive()); - } - /** - * Create a hover gesture. hover() is different to .addEventListener("pointerenter") - * in that it has an easier syntax, filters out polyfilled touch events, interoperates - * with drag gestures, and automatically removes the "pointerennd" event listener when the hover ends. - * - * @public - */ - function hover(elementOrSelector, onHoverStart, options = {}) { - const [elements, eventOptions, cancel] = setupGesture(elementOrSelector, options); - elements.forEach((element) => { - let isPressed = false; - let deferredHoverEnd = false; - let hoverEndCallback; - const removePointerLeave = () => { - element.removeEventListener("pointerleave", onPointerLeave); - }; - const endHover = (event) => { - if (hoverEndCallback) { - hoverEndCallback(event); - hoverEndCallback = undefined; - } - removePointerLeave(); - }; - const onPointerUp = (event) => { - isPressed = false; - window.removeEventListener("pointerup", onPointerUp); - window.removeEventListener("pointercancel", onPointerUp); - if (deferredHoverEnd) { - deferredHoverEnd = false; - endHover(event); - } - }; - const onPointerDown = () => { - isPressed = true; - window.addEventListener("pointerup", onPointerUp, eventOptions); - window.addEventListener("pointercancel", onPointerUp, eventOptions); - }; - const onPointerLeave = (leaveEvent) => { - if (leaveEvent.pointerType === "touch") - return; - if (isPressed) { - deferredHoverEnd = true; - return; - } - endHover(leaveEvent); - }; - const onPointerEnter = (enterEvent) => { - if (!isValidHover(enterEvent)) - return; - deferredHoverEnd = false; - const onHoverEnd = onHoverStart(element, enterEvent); - if (typeof onHoverEnd !== "function") - return; - hoverEndCallback = onHoverEnd; - element.addEventListener("pointerleave", onPointerLeave, eventOptions); - }; - element.addEventListener("pointerenter", onPointerEnter, eventOptions); - element.addEventListener("pointerdown", onPointerDown, eventOptions); - }); - return cancel; - } - - /** - * Recursively traverse up the tree to check whether the provided child node - * is the parent or a descendant of it. - * - * @param parent - Element to find - * @param child - Element to test against parent - */ - const isNodeOrChild = (parent, child) => { - if (!child) { - return false; - } - else if (parent === child) { - return true; - } - else { - return isNodeOrChild(parent, child.parentElement); - } - }; - - const isPrimaryPointer = (event) => { - if (event.pointerType === "mouse") { - return typeof event.button !== "number" || event.button <= 0; - } - else { - /** - * isPrimary is true for all mice buttons, whereas every touch point - * is regarded as its own input. So subsequent concurrent touch points - * will be false. - * - * Specifically match against false here as incomplete versions of - * PointerEvents in very old browser might have it set as undefined. - */ - return event.isPrimary !== false; - } - }; - - const keyboardAccessibleElements = new Set([ - "BUTTON", - "INPUT", - "SELECT", - "TEXTAREA", - "A", - ]); - /** - * Checks if an element is natively keyboard accessible (focusable). - * Used by the press gesture to determine if we need to add tabIndex. - */ - function isElementKeyboardAccessible(element) { - return (keyboardAccessibleElements.has(element.tagName) || - element.isContentEditable === true); - } - const textInputElements = new Set(["INPUT", "SELECT", "TEXTAREA"]); - /** - * Checks if an element has text selection or direct interaction behavior - * that should block drag gestures from starting. - * - * This specifically targets form controls where the user might want to select - * text or interact with the control (e.g., sliders, dropdowns). - * - * Buttons and links are NOT included because they don't have click-and-move - * actions of their own - they only respond to click events, so dragging - * should still work when initiated from these elements. - */ - function isElementTextInput(element) { - return (textInputElements.has(element.tagName) || - element.isContentEditable === true); - } - - const isPressing = new WeakSet(); - - /** - * Filter out events that are not "Enter" keys. - */ - function filterEvents(callback) { - return (event) => { - if (event.key !== "Enter") - return; - callback(event); - }; - } - function firePointerEvent(target, type) { - target.dispatchEvent(new PointerEvent("pointer" + type, { isPrimary: true, bubbles: true })); - } - const enableKeyboardPress = (focusEvent, eventOptions) => { - const element = focusEvent.currentTarget; - if (!element) - return; - const handleKeydown = filterEvents(() => { - if (isPressing.has(element)) - return; - firePointerEvent(element, "down"); - const handleKeyup = filterEvents(() => { - firePointerEvent(element, "up"); - }); - const handleBlur = () => firePointerEvent(element, "cancel"); - element.addEventListener("keyup", handleKeyup, eventOptions); - element.addEventListener("blur", handleBlur, eventOptions); - }); - element.addEventListener("keydown", handleKeydown, eventOptions); - /** - * Add an event listener that fires on blur to remove the keydown events. - */ - element.addEventListener("blur", () => element.removeEventListener("keydown", handleKeydown), eventOptions); - }; - - /** - * Filter out events that are not primary pointer events, or are triggering - * while a Motion gesture is active. - */ - function isValidPressEvent(event) { - return isPrimaryPointer(event) && !isDragActive(); - } - const claimedPointerDownEvents = new WeakSet(); - /** - * Create a press gesture. - * - * Press is different to `"pointerdown"`, `"pointerup"` in that it - * automatically filters out secondary pointer events like right - * click and multitouch. - * - * It also adds accessibility support for keyboards, where - * an element with a press gesture will receive focus and - * trigger on Enter `"keydown"` and `"keyup"` events. - * - * This is different to a browser's `"click"` event, which does - * respond to keyboards but only for the `"click"` itself, rather - * than the press start and end/cancel. The element also needs - * to be focusable for this to work, whereas a press gesture will - * make an element focusable by default. - * - * @public - */ - function press(targetOrSelector, onPressStart, options = {}) { - const [targets, eventOptions, cancelEvents] = setupGesture(targetOrSelector, options); - const startPress = (startEvent) => { - const target = startEvent.currentTarget; - if (!isValidPressEvent(startEvent)) - return; - if (claimedPointerDownEvents.has(startEvent)) - return; - isPressing.add(target); - if (options.stopPropagation) { - claimedPointerDownEvents.add(startEvent); - } - const onPressEnd = onPressStart(target, startEvent); - /** - * End listeners run in the capture phase so a descendant calling - * stopPropagation() in its own pointerup handler can't prevent the - * press gesture from ending. This also keeps the gesture-end - * ordering consistent with the drag gesture. See #2794. - */ - const endEventOptions = { ...eventOptions, capture: true }; - const onPointerEnd = (endEvent, success) => { - window.removeEventListener("pointerup", onPointerUp, endEventOptions); - window.removeEventListener("pointercancel", onPointerCancel, endEventOptions); - if (isPressing.has(target)) { - isPressing.delete(target); - } - if (!isValidPressEvent(endEvent)) { - return; - } - if (typeof onPressEnd === "function") { - onPressEnd(endEvent, { success }); - } - }; - const onPointerUp = (upEvent) => { - onPointerEnd(upEvent, target === window || - target === document || - options.useGlobalTarget || - isNodeOrChild(target, upEvent.target)); - }; - const onPointerCancel = (cancelEvent) => { - onPointerEnd(cancelEvent, false); - }; - window.addEventListener("pointerup", onPointerUp, endEventOptions); - window.addEventListener("pointercancel", onPointerCancel, endEventOptions); - }; - targets.forEach((target) => { - const pointerDownTarget = options.useGlobalTarget ? window : target; - pointerDownTarget.addEventListener("pointerdown", startPress, eventOptions); - if (isHTMLElement(target)) { - target.addEventListener("focus", (event) => enableKeyboardPress(event, eventOptions)); - if (!isElementKeyboardAccessible(target) && - !target.hasAttribute("tabindex")) { - target.tabIndex = 0; - } - } - }); - return cancelEvents; - } - - function getComputedStyle$2(element, name) { - const computedStyle = window.getComputedStyle(element); - return isCSSVar(name) - ? computedStyle.getPropertyValue(name) - : computedStyle[name]; - } - - /** - * Checks if an element is an SVG element in a way - * that works across iframes - */ - function isSVGElement(element) { - return motionUtils.isObject(element) && "ownerSVGElement" in element; - } - - const resizeHandlers = new WeakMap(); - let observer; - const getSize = (borderBoxAxis, svgAxis, htmlAxis) => (target, borderBoxSize) => { - if (borderBoxSize && borderBoxSize[0]) { - return borderBoxSize[0][(borderBoxAxis + "Size")]; - } - else if (isSVGElement(target) && "getBBox" in target) { - return target.getBBox()[svgAxis]; - } - else { - return target[htmlAxis]; - } - }; - const getWidth = /*@__PURE__*/ getSize("inline", "width", "offsetWidth"); - const getHeight = /*@__PURE__*/ getSize("block", "height", "offsetHeight"); - function notifyTarget({ target, borderBoxSize }) { - resizeHandlers.get(target)?.forEach((handler) => { - handler(target, { - get width() { - return getWidth(target, borderBoxSize); - }, - get height() { - return getHeight(target, borderBoxSize); - }, - }); - }); - } - function notifyAll(entries) { - entries.forEach(notifyTarget); - } - function createResizeObserver() { - if (typeof ResizeObserver === "undefined") - return; - observer = new ResizeObserver(notifyAll); - } - function resizeElement(target, handler) { - if (!observer) - createResizeObserver(); - const elements = resolveElements(target); - elements.forEach((element) => { - let elementHandlers = resizeHandlers.get(element); - if (!elementHandlers) { - elementHandlers = new Set(); - resizeHandlers.set(element, elementHandlers); - } - elementHandlers.add(handler); - observer?.observe(element); - }); - return () => { - elements.forEach((element) => { - const elementHandlers = resizeHandlers.get(element); - elementHandlers?.delete(handler); - if (!elementHandlers?.size) { - observer?.unobserve(element); - } - }); - }; - } - - const windowCallbacks = new Set(); - let windowResizeHandler; - function createWindowResizeHandler() { - windowResizeHandler = () => { - const info = { - get width() { - return window.innerWidth; - }, - get height() { - return window.innerHeight; - }, - }; - windowCallbacks.forEach((callback) => callback(info)); - }; - window.addEventListener("resize", windowResizeHandler); - } - function resizeWindow(callback) { - windowCallbacks.add(callback); - if (!windowResizeHandler) - createWindowResizeHandler(); - return () => { - windowCallbacks.delete(callback); - if (!windowCallbacks.size && - typeof windowResizeHandler === "function") { - window.removeEventListener("resize", windowResizeHandler); - windowResizeHandler = undefined; - } - }; - } - - function resize(a, b) { - return typeof a === "function" ? resizeWindow(a) : resizeElement(a, b); - } - - function observeTimeline(update, timeline) { - let prevProgress; - const onFrame = () => { - const { currentTime } = timeline; - const percentage = currentTime === null ? 0 : currentTime.value; - const progress = percentage / 100; - if (prevProgress !== progress) { - update(progress); - } - prevProgress = progress; - }; - frame.preUpdate(onFrame, true); - return () => cancelFrame(onFrame); - } - - const statsBuffer = { - value: null, - addProjectionMetrics: null, - }; - - function clearStatsBuffer() { - statsBuffer.value = null; - statsBuffer.addProjectionMetrics = null; - } - function recordStats() { - if (statsBuffer.value) { - clearStatsBuffer(); - throw new Error("Stats are already being measured"); - } - const buffer = statsBuffer; - buffer.value = { - layoutProjection: { - nodes: [], - calculatedTargetDeltas: [], - calculatedProjections: [], - }, - }; - buffer.addProjectionMetrics = (metrics) => { - const { layoutProjection } = buffer.value; - layoutProjection.nodes.push(metrics.nodes); - layoutProjection.calculatedTargetDeltas.push(metrics.calculatedTargetDeltas); - layoutProjection.calculatedProjections.push(metrics.calculatedProjections); - }; - } - - /** - * Checks if an element is specifically an SVGSVGElement (the root SVG element) - * in a way that works across iframes - */ - function isSVGSVGElement(element) { - return isSVGElement(element) && element.tagName === "svg"; - } - - function getOriginIndex(from, total) { - if (from === "first") { - return 0; - } - else { - const lastIndex = total - 1; - return from === "last" ? lastIndex : lastIndex / 2; - } - } - function stagger(duration = 0.1, { startDelay = 0, from = 0, ease } = {}) { - return (i, total) => { - const fromIndex = typeof from === "number" ? from : getOriginIndex(from, total); - const distance = Math.abs(fromIndex - i); - let delay = duration * distance; - if (ease) { - const maxDelay = total * duration; - const easingFunction = motionUtils.easingDefinitionToFunction(ease); - delay = easingFunction(delay / maxDelay) * maxDelay; - } - return startDelay + delay; - }; - } - - function transform(...args) { - const useImmediate = !Array.isArray(args[0]); - const argOffset = useImmediate ? 0 : -1; - const inputValue = args[0 + argOffset]; - const inputRange = args[1 + argOffset]; - const outputRange = args[2 + argOffset]; - const options = args[3 + argOffset]; - const interpolator = interpolate(inputRange, outputRange, options); - return useImmediate ? interpolator(inputValue) : interpolator; - } - - /** - * Create a `MotionValue` that animates to its latest value using any transition type. - * Can either be a value or track another `MotionValue`. - * - * ```jsx - * const x = motionValue(0) - * const y = followValue(x, { type: "spring", stiffness: 300 }) - * // or with tween - * const z = followValue(x, { type: "tween", duration: 0.5, ease: "easeOut" }) - * ``` - * - * @param source - Initial value or MotionValue to track - * @param options - Animation transition options - * @returns `MotionValue` - * - * @public - */ - function followValue(source, options) { - const initialValue = isMotionValue(source) ? source.get() : source; - const value = motionValue(initialValue); - attachFollow(value, source, options); - return value; - } - /** - * Attach an animation to a MotionValue that will animate whenever the value changes. - * Similar to attachSpring but supports any transition type (spring, tween, inertia, etc.) - * - * @param value - The MotionValue to animate - * @param source - Initial value or MotionValue to track - * @param options - Animation transition options - * @returns Cleanup function - * - * @public - */ - function attachFollow(value, source, options = {}) { - const initialValue = value.get(); - let activeAnimation = null; - let latestValue = initialValue; - let latestSetter; - const unit = typeof initialValue === "string" - ? initialValue.replace(/[\d.-]/g, "") - : undefined; - const stopAnimation = () => { - if (activeAnimation) { - activeAnimation.stop(); - activeAnimation = null; - } - value.animation = undefined; - }; - const startAnimation = () => { - const currentValue = asNumber$1(value.get()); - const targetValue = asNumber$1(latestValue); - // Don't animate if we're already at the target - if (currentValue === targetValue) { - stopAnimation(); - return; - } - // Use the running animation's analytical velocity for accuracy, - // falling back to the MotionValue's velocity for the initial animation. - // This prevents systematic velocity loss at high frame rates (240hz+). - const velocity = activeAnimation - ? activeAnimation.getGeneratorVelocity() - : value.getVelocity(); - stopAnimation(); - activeAnimation = new JSAnimation({ - keyframes: [currentValue, targetValue], - velocity, - // Default to spring if no type specified (matches useSpring behavior) - type: "spring", - restDelta: 0.001, - restSpeed: 0.01, - ...options, - onUpdate: latestSetter, - }); - }; - // Use a stable function reference so the frame loop Set deduplicates - // multiple calls within the same frame (e.g. rapid mouse events) - const scheduleAnimation = () => { - startAnimation(); - value.animation = activeAnimation ?? undefined; - value["events"].animationStart?.notify(); - activeAnimation?.then(() => { - value.animation = undefined; - value["events"].animationComplete?.notify(); - }); - }; - value.attach((v, set) => { - latestValue = v; - latestSetter = (latest) => set(parseValue(latest, unit)); - frame.postRender(scheduleAnimation); - }, stopAnimation); - if (isMotionValue(source)) { - let skipNextAnimation = options.skipInitialAnimation === true; - const removeSourceOnChange = source.on("change", (v) => { - if (skipNextAnimation) { - skipNextAnimation = false; - value.jump(parseValue(v, unit), false); - } - else { - value.set(parseValue(v, unit)); - } - }); - const removeValueOnDestroy = value.on("destroy", removeSourceOnChange); - return () => { - removeSourceOnChange(); - removeValueOnDestroy(); - }; - } - return stopAnimation; - } - function parseValue(v, unit) { - return unit ? v + unit : v; - } - function asNumber$1(v) { - return typeof v === "number" ? v : parseFloat(v); - } - - function subscribeValue(inputValues, outputValue, getLatest) { - const update = () => outputValue.set(getLatest()); - const scheduleUpdate = () => frame.preRender(update, false, true); - const subscriptions = inputValues.map((v) => v.on("change", scheduleUpdate)); - outputValue.on("destroy", () => { - subscriptions.forEach((unsubscribe) => unsubscribe()); - cancelFrame(update); - }); - } - - /** - * Create a `MotionValue` that transforms the output of other `MotionValue`s by - * passing their latest values through a transform function. - * - * Whenever a `MotionValue` referred to in the provided function is updated, - * it will be re-evaluated. - * - * ```jsx - * const x = motionValue(0) - * const y = transformValue(() => x.get() * 2) // double x - * ``` - * - * @param transformer - A transform function. This function must be pure with no side-effects or conditional statements. - * @returns `MotionValue` - * - * @public - */ - function transformValue(transform) { - const collectedValues = []; - /** - * Open session of collectMotionValues. Any MotionValue that calls get() - * inside transform will be saved into this array. - */ - collectMotionValues.current = collectedValues; - const initialValue = transform(); - collectMotionValues.current = undefined; - const value = motionValue(initialValue); - subscribeValue(collectedValues, value, transform); - return value; - } - - /** - * Create a `MotionValue` that maps the output of another `MotionValue` by - * mapping it from one range of values into another. - * - * @remarks - * - * Given an input range of `[-200, -100, 100, 200]` and an output range of - * `[0, 1, 1, 0]`, the returned `MotionValue` will: - * - * - When provided a value between `-200` and `-100`, will return a value between `0` and `1`. - * - When provided a value between `-100` and `100`, will return `1`. - * - When provided a value between `100` and `200`, will return a value between `1` and `0` - * - * The input range must be a linear series of numbers. The output range - * can be any value type supported by Motion: numbers, colors, shadows, etc. - * - * Every value in the output range must be of the same type and in the same format. - * - * ```jsx - * const x = motionValue(0) - * const xRange = [-200, -100, 100, 200] - * const opacityRange = [0, 1, 1, 0] - * const opacity = mapValue(x, xRange, opacityRange) - * ``` - * - * @param inputValue - `MotionValue` - * @param inputRange - A linear series of numbers (either all increasing or decreasing) - * @param outputRange - A series of numbers, colors or strings. Must be the same length as `inputRange`. - * @param options - - * - * - clamp: boolean. Clamp values to within the given range. Defaults to `true` - * - ease: EasingFunction[]. Easing functions to use on the interpolations between each value in the input and output ranges. If provided as an array, the array must be one item shorter than the input and output ranges, as the easings apply to the transition between each. - * - * @returns `MotionValue` - * - * @public - */ - function mapValue(inputValue, inputRange, outputRange, options) { - const map = transform(inputRange, outputRange, options); - return transformValue(() => map(inputValue.get())); - } - - /** - * Create a `MotionValue` that animates to its latest value using a spring. - * Can either be a value or track another `MotionValue`. - * - * ```jsx - * const x = motionValue(0) - * const y = springValue(x, { stiffness: 300 }) - * ``` - * - * @param source - Initial value or MotionValue to track - * @param options - Spring configuration options - * @returns `MotionValue` - * - * @public - */ - function springValue(source, options) { - return followValue(source, { type: "spring", ...options }); - } - /** - * Attach a spring animation to a MotionValue that will animate whenever the value changes. - * - * @param value - The MotionValue to animate - * @param source - Initial value or MotionValue to track - * @param options - Spring configuration options - * @returns Cleanup function - * - * @public - */ - function attachSpring(value, source, options) { - return attachFollow(value, source, { type: "spring", ...options }); - } - - /** - * A list of all ValueTypes - */ - const valueTypes = [...dimensionValueTypes, color, complex]; - /** - * Tests a value against the list of ValueTypes - */ - const findValueType = (v) => valueTypes.find(testValueType(v)); - - let nameCount = 0; - /** - * Generated names live in their own namespace so we can tell a name we own - * (and must clean up) from an author-defined one - and so a stale generated - * name left behind by an interrupted transition is re-owned, not mistaken for - * the author's and leaked. - */ - const generatedName = () => `motion-view-${nameCount++}`; - const isGeneratedName = (name) => name.startsWith("motion-view-"); - /** - * Tag a captured element with a `view-transition-class` so authors can target - * its generated layer from CSS (e.g. `::view-transition-group(.hero)`) without - * the opaque generated name. Tracked in `classed` - separate from the generated - * names in `assigned` - so cleanup removes the class without ever stripping an - * author's own inline `view-transition-name`. - */ - function tagClass(element, className, classed) { - if (!className) - return; - element.style?.setProperty("view-transition-class", className); - classed.push(element); - } - /** - * Set the element's `view-transition-group` so its layer reconstructs the DOM - * hierarchy in the pseudo-tree (`contain`) - or stays flat (`none`). Tracked in - * `grouped` for cleanup. When the element clips (any non-`visible` overflow) its - * name is recorded in `clipChildren` so the caller can clip the nested children - * (`::view-transition-group-children(name)`), mirroring the live clip through - * the whole transition rather than only at the live-DOM handoff. - * - * Ignored by browsers without nested view-transition groups, where it harmlessly - * degrades to the flat default. - */ - function applyGroup(element, name, group, grouped, clipChildren) { - if (!group) - return; - element.style?.setProperty("view-transition-group", group); - grouped.push(element); - if (group !== "none" && clipChildren) { - const style = getComputedStyle(element); - if (style.overflowX !== "visible" || style.overflowY !== "visible") { - clipChildren.add(name); - } - } - } - /** - * Resolve a selector/Element to elements and ensure each one carries a - * `view-transition-name` we can target from script. - * - * Author-defined names are reused as-is. Elements that are unnamed (or use - * the browser's `auto`/`match-element`, whose generated name is not exposed - * to script) are given a unique generated name, set inline so it's captured, - * and tracked in `assigned` for later cleanup. - * - * `registry` maps each Element to its name so the same element keeps its name - * across both captures (before and after the update), which is what allows a - * persistent element to animate as a single `group` layer. - */ - function assignViewTransitionNames(definition, registry, assigned, forcedNames, className, classed = [], group, grouped = [], clipChildren) { - const elements = resolveElements(definition); - /** - * The new end of a paired morph: give each element the matching name from - * the old end (by index) so the two share one layer and morph. If the new - * end resolves to *more* elements than the old end named, the extras have no - * counterpart - give them a fresh name so they animate as newcomers rather - * than being silently left unnamed. We return the names actually assigned - * (sized to the resolved elements), not the raw `forcedNames`, so stagger - * totals and the layer set stay in step with what's on the page. - */ - if (forcedNames) { - return elements.map((element, i) => { - const existing = registry.get(element); - if (existing) - return existing; - const name = forcedNames[i] ?? generatedName(); - element.style?.setProperty("view-transition-name", name); - assigned.push(element); - registry.set(element, name); - tagClass(element, className, classed); - applyGroup(element, name, group, grouped, clipChildren); - return name; - }); - } - /** - * Read every current name up front, before assigning any. Interleaving the - * reads with the inline `setProperty` writes below would dirty styles - * between reads and force a style recalc per element; batching the reads - * keeps it to one. Elements already in the registry keep their name and - * need no read. - */ - const currentNames = elements.map((element) => registry.has(element) - ? undefined - : getComputedStyle(element).getPropertyValue("view-transition-name")); - return elements.map((element, i) => { - const existing = registry.get(element); - if (existing) - return existing; - const current = currentNames[i]; - let name; - if (current && - current !== "none" && - current !== "auto" && - current !== "match-element" && - !isGeneratedName(current)) { - /** - * The author already named this layer - target it as-is and leave - * it to them to clean up. `auto`/`match-element` are overridden - * because their generated name is not exposed to script, and a - * stale `motion-view-*` (e.g. left by an interrupted transition) is - * re-owned rather than adopted as an author name and leaked. - */ - name = current; - } - else { - name = generatedName(); - element.style?.setProperty("view-transition-name", name); - assigned.push(element); - } - registry.set(element, name); - tagClass(element, className, classed); - applyGroup(element, name, group, grouped, clipChildren); - return name; - }); - } - /** - * Remove the `view-transition-name`s we generated and the - * `view-transition-class`es we applied. Author-defined names are never touched - * (they're not in `assigned`). Safe to call more than once (e.g. on both a - * finished and an interrupted transition). - */ - function releaseViewTransitionNames(assigned, classed = [], grouped = []) { - for (const element of assigned) { - element.style?.removeProperty("view-transition-name"); - } - for (const element of classed) { - element.style?.removeProperty("view-transition-class"); - } - for (const element of grouped) { - element.style?.removeProperty("view-transition-group"); - } - } - - function chooseLayerType(valueName) { - if (valueName === "layout") - return "group"; - if (valueName === "enter" || valueName === "new") - return "new"; - return "old"; - } - - let pendingRules = {}; - let style = null; - const css = { - set: (selector, values) => { - pendingRules[selector] = values; - }, - commit: () => { - if (!style) { - style = document.createElement("style"); - style.id = "motion-view"; - } - let cssText = ""; - for (const selector in pendingRules) { - const rule = pendingRules[selector]; - cssText += `${selector} {\n`; - for (const [property, value] of Object.entries(rule)) { - cssText += ` ${property}: ${value};\n`; - } - cssText += "}\n"; - } - style.textContent = cssText; - document.head.appendChild(style); - pendingRules = {}; - }, - remove: () => { - if (style && style.parentElement) { - style.parentElement.removeChild(style); - } - }, - }; - - function getViewAnimationLayerInfo(pseudoElement) { - const match = pseudoElement.match( - // `group-children` (nested transitions) before `group` so it wins. - /::view-transition-(old|new|group-children|group|image-pair)\((.*?)\)/); - if (!match) - return null; - return { layer: match[2], type: match[1] }; - } - - function getViewAnimations() { - return document.getAnimations().filter((animation) => { - const { effect } = animation; - return (!!effect && - effect.target === document.documentElement && - effect.pseudoElement?.startsWith("::view-transition")); - }); - } - - function hasTarget(target, targets) { - return targets.has(target) && Object.keys(targets.get(target)).length > 0; - } - - const definitionNames = ["layout", "enter", "exit", "new", "old"]; - /** - * Whether a computed border-radius is square (every component zero). Splitting - * on whitespace handles two-value/elliptical radii like "0px 20px" - a leading - * `parseFloat` alone would misread the non-zero vertical radius as square. - */ - const isSquareRadius = (radius) => radius.split(" ").every((value) => parseFloat(value) === 0); - /** - * The `ViewTransitionTarget` buckets driving each generated layer type, in - * priority order - the inverse of `chooseLayerType`. The new view is driven by - * `new`/`enter`, the old by `old`/`exit`. `group-children`/`image-pair` have no - * bucket; they follow the default layout timing. - */ - const typeBuckets = { - group: ["layout"], - new: ["new", "enter"], - old: ["old", "exit"], - }; - /** - * Default "absent" origin for a single-value keyframe, by pseudo type, so e.g. - * `enter({ scale: 1 })` grows in from 0.85 and `exit({ opacity: 0 })` fades - * from 1. `enter` prefers the matching `exit` value over these (see below). - */ - const ORIGIN_DEFAULTS = { - new: { opacity: 0, scale: 0.85 }, - old: { opacity: 1, scale: 1 }, - }; - /** - * How much two box aspect ratios must differ before a morph is treated as - * aspect-changing (and so worth cropping). Matches the projection engine's - * `preserve-aspect` threshold, so small layout jitter doesn't trigger a crop. - */ - const ASPECT_TOLERANCE = 0.2; - function startViewAnimation(builder) { - const { update, targets, resolveDefs, cropOverride, pairs, classNames, flatGroups, options: defaultOptions, } = builder; - if (!document.startViewTransition) { - // An async IIFE (not `new Promise(async …)`) so a throwing/rejecting - // update rejects this promise rather than leaving it unsettled. - return (async () => { - await update(); - return new GroupAnimation([]); - })(); - } - /** - * Resolve any selector/Element targets to layer names, assigning a - * `view-transition-name` to each element as we go. We run this before the - * update (so the elements are captured in the old snapshot) and again - * after it (for the new snapshot). An element present in both keeps the - * same name and animates as a single `group` layer. - */ - const nameRegistry = new Map(); - const assigned = []; - /** - * Elements we tagged with a `view-transition-class` (via `.class()`), - * tracked separately from `assigned` so cleanup removes the class without - * ever stripping an author's own inline `view-transition-name`. - */ - const classed = []; - /** - * Elements we set a `view-transition-group` on (for nesting), tracked for - * cleanup. `clipChildren` collects the names of nested parents that clip in - * the live layout, so their `::view-transition-group-children` is clipped - * through the transition - not just once the live DOM takes back over. - */ - const grouped = []; - const clipChildren = new Set(); - const layerTargets = new Map(); - const croppedNames = new Set(); - /** - * Each layer's explicit `.crop(true | false)` override (by resolved name), - * so `finalizeCrop` can let an author's choice win over the morph default. - */ - const cropForName = new Map(); - /** - * Each layer's stagger position (index + total) within its subject, per - * snapshot. Resolving against the snapshot the layer belongs to keeps - * stagger correct when `update()` replaces the matched elements, and lets - * us skip a layer that's absent from a snapshot (e.g. an exited element - * has no `new` pseudo-element). - */ - const layerStagger = new Map(); - /** - * Names allocated for a paired subject in the old snapshot, replayed onto - * its new-snapshot target so both ends share a layer and morph. - */ - const pairNames = new Map(); - /** - * The old (`from`) elements of each paired subject, so their names can be - * transferred off before the new (`to`) elements inherit them. - */ - const pairFrom = new Map(); - const resolveLayers = (phase) => { - targets.forEach((target, definition) => { - const className = classNames.get(definition); - /** - * Nest each resolved layer under its DOM-ancestor layer by default - * (`contain`), so an ancestor's clip/transform/opacity reach it - * through the transition; `.group(false)` opts a subject out (`none`) - * to stay flat and escape. Skipped for root / pre-named layers, which - * aren't elements we resolve and style. - */ - const group = definition === "root" || !resolveDefs.has(definition) - ? undefined - : flatGroups.has(definition) - ? "none" - : "contain"; - let names; - if (definition === "root" || !resolveDefs.has(definition)) { - names = [definition]; - } - else if (pairs.has(definition)) { - /** - * Paired morph: name the old target in the old snapshot, then - * force the same name(s) onto the new target in the new one, so - * two different elements morph as a single layer. - */ - if (phase === "old") { - pairFrom.set(definition, resolveElements(definition)); - names = assignViewTransitionNames(definition, nameRegistry, assigned, undefined, className, classed, group, grouped, clipChildren); - pairNames.set(definition, names); - } - else { - /** - * Transfer the name(s) off the `from` elements before the - * `to` elements inherit them. A `from` that survives into - * the new snapshot (e.g. hidden with `visibility: hidden` - * rather than removed) would otherwise keep the name and - * collide - "duplicate view-transition-name". - */ - for (const el of pairFrom.get(definition) ?? []) { - el.style?.removeProperty("view-transition-name"); - /** - * Drop the old end from the registry too, so the new - * end alone supplies this name's `new` crop radii - we - * neither re-measure nor get ordered by a stale element. - */ - nameRegistry.delete(el); - } - names = assignViewTransitionNames(pairs.get(definition), nameRegistry, assigned, pairNames.get(definition), className, classed, group, grouped, clipChildren); - } - } - else { - names = assignViewTransitionNames(definition, nameRegistry, assigned, undefined, className, classed, group, grouped, clipChildren); - } - // Record any explicit `.crop(true | false)` per resolved name; the - // crop set itself is computed later by `finalizeCrop` (it needs both - // snapshots to know which morphs change aspect ratio). - const override = cropOverride.get(definition); - names.forEach((name, index) => { - /** - * If two subjects resolve to the same element, merge their - * definitions so neither subject's animations are dropped. - */ - const existing = layerTargets.get(name); - layerTargets.set(name, existing && existing !== target - ? { ...existing, ...target } - : target); - if (override !== undefined) - cropForName.set(name, override); - const stagger = layerStagger.get(name) ?? {}; - stagger[phase] = [index, names.length]; - layerStagger.set(name, stagger); - }); - }); - }; - /** - * The stagger index/total for a layer, resolved against the snapshot it - * belongs to. Returns index -1 when the layer is absent from that snapshot - * so the caller can skip a pseudo-element that doesn't exist. - */ - const staggerPosition = (name, type) => { - const stagger = layerStagger.get(name); - const position = type === "old" - ? stagger?.old - : type === "new" - ? stagger?.new - : // group / group-children / image-pair persist across both. - stagger?.new ?? stagger?.old; - return position ?? [-1, 1]; - }; - /** - * Merge default + per-layer transition options for a generated layer and - * resolve any stagger/delay function against this element's position. Used - * by both the morph-retiming and crop corner-radius passes. - */ - const resolveLayerTransition = (target, type, transitionName, index, total) => { - const transition = mergeTransition(getValueTransition(defaultOptions, transitionName), getValueTransition((layerOptions(target, type) ?? {}), transitionName)); - if (typeof transition.delay === "function") { - transition.delay = transition.delay(index, total); - } - return transition; - }; - /** - * Resolve a layer's group (`layout`) timing to plain WAAPI values: native - * ms `delay`/`duration` and a baked `ease`. The single source of group - * timing, shared by the generated-group retiming and the crop corner-radius - * pass so the rounded clip animates on exactly the box's timing. It returns - * no generator `type` (the WAAPI-only `NativeAnimation` rejects a string - * type) nor `repeat`/`times` (which the group's `updateTiming` ignores), so - * none of them can leak into the radius animation and desync it. - */ - const resolveGroupTiming = (name) => { - const [index, total] = staggerPosition(name, "group"); - const transition = resolveLayerTransition(layerTargets.get(name), "group", "layout", index === -1 ? 0 : index, total); - transition.duration && (transition.duration = motionUtils.secondsToMilliseconds(transition.duration)); - const { delay = 0, duration, ease } = applyGeneratorOptions(transition); - return { delay: motionUtils.secondsToMilliseconds(delay), duration, ease }; - }; - /** - * Each layer's measured box + corner radii per snapshot. The box lets - * `finalizeCrop` tell whether a morph's aspect ratio changed (the only case - * worth cropping); the radii let a cropped morph's group clip animate each - * corner from the old element's radius to the new element's, keeping it - * rounded where `overflow: clip` would otherwise square the corners. - * - * We never flatten the source for capture (a snapshot is a paint of the live - * DOM, so squaring an element just for its capture would flash one real - * square frame). For an aspect-changing morph `object-fit: cover` crops each - * snapshot's own baked corners off-screen mid-morph, so the animated clip is - * the only visible corner; a near-same-aspect forced crop (`.crop(true)`) - * can't hide the outgoing snapshot's silhouette, but the endpoints coincide. - */ - const cropMeasurements = new Map(); - const measureLayers = (phase) => nameRegistry.forEach((name, element) => { - const el = element; - const rect = el.getBoundingClientRect?.(); - if (rect && rect.height) { - const style = getComputedStyle(el); - const radii = {}; - for (const corner of cornerRadiusProps) { - radii[corner] = style[corner]; - } - const entry = cropMeasurements.get(name) ?? {}; - entry[phase] = { width: rect.width, height: rect.height, radii }; - cropMeasurements.set(name, entry); - } - }); - /** - * With both snapshots measured, settle which layers crop. The default crops - * only a morph whose aspect ratio *changes* between snapshots - the one case - * where `object-fit: cover` does real work. A same-aspect morph or a - * fade-only layer is left uncropped: its corners scale naturally (no flash - * from squaring, no `overflow: clip` eating its shadow) and a backdrop can't - * be clipped to nothing. An explicit `.crop(true | false)` overrides either - * way. Runs after both snapshots are measured, since aspect needs both. - */ - const finalizeCrop = () => { - croppedNames.clear(); - for (const name of layerStagger.keys()) { - if (name === "root") - continue; - // An explicit `.crop(true | false)` wins; otherwise crop a morph - // whose aspect ratio changed. - if (cropForName.get(name) ?? aspectChanged(name)) { - croppedNames.add(name); - } - } - }; - /** - * Whether a layer is a morph whose box aspect ratio changed between - * snapshots (beyond a small tolerance). Fade-only layers (one snapshot) are - * never "changed". - */ - const aspectChanged = (name) => { - const box = cropMeasurements.get(name); - if (!box?.old || !box?.new || !box.old.height || !box.new.height) { - return false; - } - return (Math.abs(box.old.width / box.old.height - - box.new.width / box.new.height) > ASPECT_TOLERANCE); - }; - /** - * Write the persistent view-transition CSS: suppress root capture when the - * root has no animations of its own; force linear timing (baked into the - * keyframes, so we can retime later via updateTiming); and clip + - * object-fit: cover every cropped morph (the UA default overflows on - * aspect-ratio change). - * - * `css.commit` replaces rather than appends, so we re-set the full rule set - * each call - the crop rules are only known after `finalizeCrop` runs in the - * update callback, so the second call writes them. - */ - const commitViewCSS = () => { - if (!hasTarget("root", targets)) { - css.set(":root", { "view-transition-name": "none" }); - } - css.set("::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)", { "animation-timing-function": "linear !important" }); - croppedNames.forEach((name) => { - css.set(`::view-transition-group(${name})`, { overflow: "clip" }); - css.set(`::view-transition-old(${name}), ::view-transition-new(${name})`, { width: "100%", height: "100%", "object-fit": "cover" }); - }); - /** - * Clip the nested children of any layer that clips in the live layout, - * so a wrapper crops its child for the whole morph (mirroring the DOM) - * rather than only at the live-DOM handoff. No-op on browsers without - * nested view-transition groups. - */ - clipChildren.forEach((name) => { - css.set(`::view-transition-group-children(${name})`, { - overflow: "clip", - }); - }); - css.commit(); // Write - }; - const cleanup = () => { - releaseViewTransitionNames(assigned, classed, grouped); - css.remove(); // Write - }; - const callback = async () => { - await update(); - /** - * Re-resolve so elements created by the update are named for the new - * snapshot, then measure them. With both snapshots measured we can - * settle the crop set (aspect-changing morphs + forced). - */ - resolveLayers("new"); - measureLayers("new"); - finalizeCrop(); - /** - * Re-commit the crop CSS unconditionally: `finalizeCrop` is computed - * here (after both snapshots are measured), so the clip rules must be - * (re)written to match the settled set. - */ - commitViewCSS(); - }; - let transition; - try { - resolveLayers("old"); - /** - * Measure the old snapshot against the optimistic crop set (the new - * snapshot doesn't exist yet, so aspect change can't be known here; - * `finalizeCrop` settles it post-update). - */ - measureLayers("old"); - commitViewCSS(); - transition = document.startViewTransition(callback); - } - catch (error) { - /** - * The prelude writes inline names before the transition exists. If it - * throws (e.g. startViewTransition rejects in a bad UA state), release - * them so we neither leak DOM state nor stall the queue on a promise - * that never settles - hand back a rejection it can advance past. - */ - cleanup(); - return Promise.reject(error); - } - transition.finished.finally(cleanup); - return new Promise((resolve, reject) => { - transition.ready - .then(() => { - const generatedViewAnimations = getViewAnimations(); - const animations = []; - /** - * Create animations for each of our explicitly-defined subjects. - * `opacityAnimated` additionally tracks which `${name}:${type}` - * we faded, so we can keep the UA `plus-lighter` blend only for a - * genuine opacity crossfade (both sides fading) and drop it for a - * slide/transform, where additive compositing would flash bright. - */ - const explicitlyAnimated = new Set(); - const opacityAnimated = new Set(); - layerTargets.forEach((target, name) => { - const stagger = layerStagger.get(name); - /** - * Presence: `enter` only fires for a pure newcomer (a new - * view with no old), `exit` only for a pure leaver. A - * survivor (both) gets neither - it just morphs. - */ - const enterApplies = !!stagger?.new && !stagger?.old; - const exitApplies = !!stagger?.old && !stagger?.new; - for (const key of definitionNames) { - if (!target[key]) - continue; - if (key === "enter" && !enterApplies) - continue; - if (key === "exit" && !exitApplies) - continue; - const type = chooseLayerType(key); - const [index, total] = staggerPosition(name, type); - // Skip a layer absent from its snapshot. - if (index === -1) - continue; - const { keyframes, options } = target[key]; - for (let [valueName, valueKeyframes] of Object.entries(keyframes)) { - // Skip only missing values - `0` (e.g. opacity: 0) - // is valid and must reach the from-value inference. - if (valueKeyframes == null) - continue; - /** - * The view path hands keyframes straight to WAAPI, - * so Motion's `x`/`y` shorthands (compiled to - * `transform` only via the value pipeline) have no - * effect. Warn and skip - use `transform`/`translate`. - */ - if (valueName === "x" || valueName === "y") { - motionUtils.warnOnce(false, `animateView() animates view-transition layers with CSS properties; the "${valueName}" shorthand has no effect - use transform, e.g. { transform: "translateX(40px)" }.`); - continue; - } - /** - * enter/exit win over new/old on a shared property - - * skip it here when the gated bucket also defines it. - */ - if (key === "new" && - enterApplies && - target.enter?.keyframes[valueName] != null) { - continue; - } - if (key === "old" && - exitApplies && - target.exit?.keyframes[valueName] != null) { - continue; - } - const valueOptions = mergeTransition(getValueTransition(defaultOptions, valueName), getValueTransition(options, valueName)); - /** - * Infer an origin for a single-value keyframe. An - * `enter` mirrors the matching `exit` value (a - * defined exit reverses into the enter for free); - * otherwise the per-type default (opacity 0/1, scale - * 0.85). No default -> left as-is (animates from the - * live value). - * - * `new`/`old` fire for survivors too, where only the - * opacity crossfade default applies - a transform - * default like scale 0.85 would pop a persisting - * element, so gate it on the layer actually - * entering/leaving. - */ - if (!Array.isArray(valueKeyframes)) { - const exitValue = key === "enter" - ? target.exit?.keyframes[valueName] - : undefined; - const allowDefault = valueName === "opacity" || - (type === "new" ? enterApplies : exitApplies); - const from = exitValue != null - ? Array.isArray(exitValue) - ? exitValue[exitValue.length - 1] - : exitValue - : allowDefault - ? ORIGIN_DEFAULTS[type]?.[valueName] - : undefined; - if (from !== undefined) { - valueKeyframes = [from, valueKeyframes]; - } - } - /** - * Resolve stagger function if provided, per element - * across this subject's resolved layers. - */ - if (typeof valueOptions.delay === "function") { - valueOptions.delay = valueOptions.delay(index, total); - } - valueOptions.duration && (valueOptions.duration = motionUtils.secondsToMilliseconds(valueOptions.duration)); - valueOptions.delay && (valueOptions.delay = motionUtils.secondsToMilliseconds(valueOptions.delay)); - animations.push(new NativeAnimation({ - ...valueOptions, - element: document.documentElement, - name: valueName, - pseudoElement: `::view-transition-${type}(${name})`, - keyframes: valueKeyframes, - })); - explicitlyAnimated.add(`${name}:${type}`); - if (valueName === "opacity") { - opacityAnimated.add(`${name}:${type}`); - } - } - } - }); - /** - * Handle browser generated animations - */ - for (const animation of generatedViewAnimations) { - if (animation.playState === "finished") - continue; - const { effect } = animation; - if (!effect || !(effect instanceof KeyframeEffect)) - continue; - const { pseudoElement } = effect; - if (!pseudoElement) - continue; - const name = getViewAnimationLayerInfo(pseudoElement); - if (!name) - continue; - const targetDefinition = layerTargets.get(name.layer); - /** - * We built our own animation for this layer, so drop the - * browser-generated fade we're replacing. The UA - * `plus-lighter` blend is a *separate* generated animation on - * the same pseudo (it sets `mix-blend-mode` in its keyframes): - * keep it *only* for a true opacity crossfade - both sides - * fading - so a symmetric crossfade composites without - * darkening, but a slide/transform (where both layers stay - * opaque and overlap) doesn't flash bright from the addition. - */ - if (explicitlyAnimated.has(`${name.layer}:${name.type}`)) { - const isCrossfade = opacityAnimated.has(`${name.layer}:new`) && - opacityAnimated.has(`${name.layer}:old`); - if (isCrossfade && - effect - .getKeyframes() - .some((keyframe) => keyframe.mixBlendMode)) { - animations.push(new NativeAnimationWrapper(animation)); - } - else { - animation.cancel(); - } - continue; - } - /** - * Drop the orphaned half of the default crossfade. The UA - * fades old out and new in as a *pair*; if the opposing half - * was explicitly overridden with something other than an - * opacity fade (a clip or transform reveal), this side's - * default opacity fade has no partner - left to run it would - * dissolve what should be a static backdrop (e.g. - * `.new({ clipPath })` should reveal over a still old view, - * not fade the old out around the growing clip). Cancel it - - * and its `plus-lighter` sibling on the same pseudo, which - * would otherwise flash bright where the two opaque layers - * overlap. A genuine crossfade (the opposing side also fading - * opacity) keeps both halves and is handled above. - */ - const opposite = name.type === "old" - ? "new" - : name.type === "new" - ? "old" - : undefined; - if (opposite && - explicitlyAnimated.has(`${name.layer}:${opposite}`) && - !opacityAnimated.has(`${name.layer}:${opposite}`)) { - animation.cancel(); - continue; - } - /** - * Otherwise retime the browser-generated animation to - * Motion's timing. This auto-enables the layout (group) - * morph for any resolved/named target, and applies the - * default timing to old/new layers we haven't explicitly - * overridden. - * - * group + group-children both follow the layout timing so - * the nesting container stays in sync with the morph. - */ - /** - * A survivor's old + new are the two halves of one - * `plus-lighter` crossfade. They must share identical timing - * (so their opacities stay mirrored and sum to 1 - else the - * additive blend flashes bright wherever both are partly - * visible) and fade linearly (the bounce belongs on the - * group's geometry, not the opacity). So time them as the - * group, rather than via their own - potentially staggered, - * or enter/exit-derived - old/new options. - */ - const stagger = layerStagger.get(name.layer); - const isMorphCrossfade = (name.type === "old" || name.type === "new") && - !!stagger?.old && - !!stagger?.new; - let timing; - if (name.type.startsWith("group")) { - // group + group-children follow the resolved group - // timing - the single source shared with the crop - // corner-radius pass below. - const { delay, duration, ease } = resolveGroupTiming(name.layer); - timing = { - delay, - duration, - easing: mapEasingToNativeEasing(ease, duration), - }; - } - else { - const timingType = isMorphCrossfade ? "group" : name.type; - const [index, total] = staggerPosition(name.layer, timingType); - const transitionName = timingType === "group" ? "layout" : ""; - let animationTransition = resolveLayerTransition(targetDefinition, timingType, transitionName, index === -1 ? 0 : index, total); - /** - * The crossfade should resolve at the spring's - * *perceptual* (visual) duration - the geometry can keep - * bouncing, but the opacity shouldn't drag through the - * settle. So capture `visualDuration` before - * `applyGeneratorOptions` replaces it with the full - * overshoot duration, and use it for the fade. - */ - const visualDuration = animationTransition.visualDuration; - animationTransition.duration && (animationTransition.duration = motionUtils.secondsToMilliseconds(animationTransition.duration)); - animationTransition = - applyGeneratorOptions(animationTransition); - timing = { - delay: motionUtils.secondsToMilliseconds(animationTransition.delay ?? 0), - duration: isMorphCrossfade && visualDuration !== undefined - ? motionUtils.secondsToMilliseconds(visualDuration) - : animationTransition.duration, - easing: isMorphCrossfade - ? "linear" - : mapEasingToNativeEasing(animationTransition.ease, animationTransition.duration), - }; - } - effect.updateTiming(timing); - animations.push(new NativeAnimationWrapper(animation)); - } - /** - * Round each cropped layer's clip. Its `::view-transition-group` - * has `overflow: clip`, which would otherwise square the corners - * mid-morph; animate each corner from the old element's radius to - * the new element's so the crop stays rounded. Timed as the group - * (`layout`) so the radius tracks the morphing box. - */ - cropMeasurements.forEach((entry, name) => { - if (!croppedNames.has(name)) - return; - // Reuse the group's resolved timing - native ms delay/ - // duration + a baked ease, with no generator `type` or - // repeat/times to leak into (or throw inside) NativeAnimation. - const { delay, duration, ease } = resolveGroupTiming(name); - for (const corner of cornerRadiusProps) { - // `||` (not `??`) so an empty measurement falls back to - // the other snapshot rather than an invalid keyframe. - const from = entry.old?.radii[corner] || - entry.new?.radii[corner] || - "0px"; - const to = entry.new?.radii[corner] || - entry.old?.radii[corner] || - "0px"; - // Nothing to round if the corner is square at both ends. - if (isSquareRadius(from) && isSquareRadius(to)) - continue; - animations.push(new NativeAnimation({ - element: document.documentElement, - name: corner, - pseudoElement: `::view-transition-group(${name})`, - keyframes: [from, to], - delay, - duration, - ease, - })); - } - }); - resolve(new GroupAnimation(animations)); - }) - .catch(() => - /** - * `ready` rejects when the transition is skipped - no visual - * change, or superseded by an interrupting transition. The DOM - * update still applied, so settle with no animations rather than - * surfacing it as an error to an awaiting caller. A genuine - * failure in `update()` rejects `updateCallbackDone` (already - * settled by now), so propagate that instead. - */ - transition.updateCallbackDone.then(() => resolve(new GroupAnimation([])), reject)); - }); - } - /** - * The options that should time a given generated layer type, so a retimed - * group/old/new picks up any per-target transition the user provided. Checks - * the type's buckets in priority order (e.g. `new` before `enter`). - */ - function layerOptions(target, type) { - for (const bucket of typeBuckets[type] ?? []) { - const options = target?.[bucket]?.options; - if (options) - return options; - } - } - /** - * Merge a base transition (e.g. the default `options`) with a per-layer/value - * override. An explicit `duration` on the override must win over an inherited - * generator's own timing: a spring prefers `visualDuration`, and - * `spring.applyToOptions` overwrites `duration` with the computed settle time - - * so without this the override is silently discarded. Dropping the inherited - * `type`/`visualDuration` makes the layer a plain tween of that duration, unless - * it asked for its own generator `type`/`visualDuration`. - */ - function mergeTransition(base, override) { - const merged = { ...base, ...override }; - if (override.duration !== undefined) { - if (override.visualDuration === undefined) - delete merged.visualDuration; - if (override.type === undefined) - delete merged.type; - } - return merged; - } - - let builders = []; - let current = null; - function next() { - current = null; - const [nextBuilder] = builders; - if (nextBuilder) - start(nextBuilder); - } - function start(builder) { - motionUtils.removeItem(builders, builder); - current = builder; - startViewAnimation(builder) - .then((animation) => { - builder.notifyReady(animation); - return animation.finished; - }) - // A genuinely failed transition (a throwing update) rejects the - // builder; a skipped/interrupted one resolves with no animations (see - // start.ts). Either way, advance the queue - else later transitions hang. - .catch((error) => builder.notifyReject(error)) - .finally(next); - } - function processQueue() { - /** - * Iterate backwards over the builders array. We can ignore the - * "wait" animations. If we have an interrupting animation in the - * queue then we need to batch all preceeding animations into it. - * Currently this only batches the update functions but will also - * need to batch the targets. - */ - for (let i = builders.length - 1; i >= 0; i--) { - const builder = builders[i]; - const { interrupt } = builder.options; - if (interrupt === "immediate") { - const batchedUpdates = builders.slice(0, i + 1).map((b) => b.update); - const remaining = builders.slice(i + 1); - builder.update = () => { - batchedUpdates.forEach((update) => update()); - }; - // Put the current builder at the front, followed by any "wait" builders - builders = [builder, ...remaining]; - break; - } - } - if (!current || builders[0]?.options.interrupt === "immediate") { - next(); - } - } - function addToQueue(builder) { - builders.push(builder); - microtask.render(processQueue); - } - - class ViewTransitionBuilder { - constructor(update, options = {}) { - this.currentSubject = "root"; - this.targets = new Map(); - /** - * Definitions that must be resolved to elements (and assigned a - * `view-transition-name`) rather than treated as pre-named layers. - */ - this.resolveDefs = new Set(); - /** - * Per-subject crop override: `true` forces the crop (clip + object-fit: - * cover + animated corner radii) on, `false` forces it off. A subject with - * no entry uses the default - crop only a genuine morph (a layer present in - * both snapshots), so a fade-only enter/exit isn't clipped to nothing. - */ - this.cropOverride = new Map(); - /** - * Subjects paired with a different new-snapshot target (the second `.add()` - * argument), so two distinct elements share one name and morph into each - * other - a shared-element transition. - */ - this.pairs = new Map(); - /** - * A `view-transition-class` to apply to each subject's resolved elements, - * so authors can target the generated layers from CSS by class rather than - * the opaque generated name. - */ - this.classNames = new Map(); - /** - * Subjects opted out of automatic group nesting via `.group(false)`. Their - * layer stays a flat top-level group (`view-transition-group: none`) instead - * of nesting under its DOM-ancestor layer - so it animates independently and - * escapes an ancestor's clip/transform (e.g. an element that lifts out of a - * card and flies across, which nesting would clip to the card). - */ - this.flatGroups = new Set(); - this.notifyReady = motionUtils.noop; - this.notifyReject = motionUtils.noop; - this.readyPromise = new Promise((resolve, reject) => { - this.notifyReady = resolve; - this.notifyReject = reject; - }); - this.update = update; - this.options = { - interrupt: "wait", - ...options, - }; - // Avoid an unhandled rejection when a failed transition has no - // `.then(_, reject)` handler attached (e.g. fire-and-forget). - this.readyPromise.catch(motionUtils.noop); - addToQueue(this); - } - /** - * Target elements resolved from a selector or Element, each assigned a - * `view-transition-name` automatically. - * - * Passing a second target pairs them: the first is resolved in the old - * snapshot and the second in the new, sharing one name so two *different* - * elements morph into each other (e.g. `.add(card, ".modal")`). Symmetric - - * pass them the other way round to morph back. - */ - add(subject, newSubject) { - this.currentSubject = subject; - this.resolveDefs.add(subject); - if (newSubject !== undefined) - this.pairs.set(subject, newSubject); - // Register the subject so it participates (and gets an automatic - // layout/morph animation) even without an explicit enter/exit/layout. - if (!this.targets.has(subject)) - this.targets.set(subject, {}); - return this; - } - /** - * Control this subject's crop (clip + `object-fit: cover` + animated - * corners). By default a subject auto-crops only when it actually morphs - - * present in both snapshots (a survivor, or an `.add(a, b)` pair). A - * fade-only enter/exit has no second box to crop against, so it's left to - * the browser default; in particular the `overflow: clip` a crop adds would - * otherwise clip a mis-sized enter/exit layer to nothing. - * - * `.crop(false)` forces the crop off (e.g. a text morph, where - * `object-fit: cover` clips glyphs as the box grows); `.crop(true)` forces - * it on for a non-morph the default wouldn't otherwise crop. - */ - crop(enabled = true) { - this.cropOverride.set(this.currentSubject, enabled); - return this; - } - /** - * By default a subject's layer nests under its nearest DOM-ancestor layer - * (`view-transition-group: contain`), so the ancestor's clip/transform/opacity - * apply to it through the transition - mirroring how the DOM actually paints, - * and letting a wrapper crop its child for the whole morph rather than only - * once the live DOM takes back over. (Needs a browser that supports nested - * view-transition groups; elsewhere it degrades to the flat default.) - * - * Call `.group(false)` to opt out: the layer stays flat and top-level, so it - * animates independently and escapes an ancestor's clip - e.g. an element - * that should lift out of a card and fly across, which nesting would clip. - */ - group(enabled = true) { - enabled - ? this.flatGroups.delete(this.currentSubject) - : this.flatGroups.add(this.currentSubject); - return this; - } - /** - * Tag this subject's generated layers with a `view-transition-class`, so - * they can be targeted from CSS - `::view-transition-group(.name)`, - * `::view-transition-old/new(.name)`, `::view-transition-image-pair(.name)` - * - without the opaque generated `view-transition-name`. Because `.add()` - * can match many elements, a shared class targets them all at once (and, - * for a pair, both ends). The escape hatch for z-index / custom keyframes - * on a morph layer. - */ - class(name) { - this.classNames.set(this.currentSubject, name); - return this; - } - /** - * Set the transition for this subject's morph. The morph is enabled - * automatically by `.add()`; this just customises its timing (duration, - * easing, a `delay`/`stagger`, …). On the implicit `root` subject it also - * opts the page into the transition (the root crossfade). - */ - layout(options = {}) { - this.updateTarget("layout", {}, options); - return this; - } - enter(keyframes, options) { - this.updateTarget("enter", keyframes, options); - return this; - } - exit(keyframes, options) { - this.updateTarget("exit", keyframes, options); - return this; - } - /** - * Animate the new view directly, whether the element is appearing or - * persisting (unlike `.enter()`, which only fires for a pure newcomer). - * Pair with `.old()` for a crossfade or slide-through. - */ - new(keyframes, options) { - this.updateTarget("new", keyframes, options); - return this; - } - /** - * Animate the old view directly, whether the element is leaving or - * persisting (unlike `.exit()`, which only fires for a pure leaver). - */ - old(keyframes, options) { - this.updateTarget("old", keyframes, options); - return this; - } - updateTarget(target, keyframes, options = {}) { - const { currentSubject, targets } = this; - if (!targets.has(currentSubject)) { - targets.set(currentSubject, {}); - } - const targetData = targets.get(currentSubject); - targetData[target] = { keyframes, options }; - } - then(resolve, reject) { - return this.readyPromise.then(resolve, reject); - } - } - function animateView(update, options = {}) { - return new ViewTransitionBuilder(update, options); - } - - const createAxisDelta = () => ({ - translate: 0, - scale: 1, - origin: 0, - originPoint: 0, - }); - const createDelta = () => ({ - x: createAxisDelta(), - y: createAxisDelta(), - }); - const createAxis = () => ({ min: 0, max: 0 }); - const createBox = () => ({ - x: createAxis(), - y: createAxis(), - }); - - const visualElementStore = new WeakMap(); - - function isAnimationControls(v) { - return (v !== null && - typeof v === "object" && - typeof v.start === "function"); - } - - /** - * Decides if the supplied variable is variant label - */ - function isVariantLabel(v) { - return typeof v === "string" || Array.isArray(v); - } - - const variantPriorityOrder = [ - "animate", - "whileInView", - "whileFocus", - "whileHover", - "whileTap", - "whileDrag", - "exit", - ]; - const variantProps = ["initial", ...variantPriorityOrder]; - - function isControllingVariants(props) { - return (isAnimationControls(props.animate) || - variantProps.some((name) => isVariantLabel(props[name]))); - } - function isVariantNode(props) { - return Boolean(isControllingVariants(props) || props.variants); - } - - /** - * Updates motion values from props changes. - * Uses `any` type for element to avoid circular dependencies with VisualElement. - */ - function updateMotionValuesFromProps(element, next, prev) { - for (const key in next) { - const nextValue = next[key]; - const prevValue = prev[key]; - if (isMotionValue(nextValue)) { - /** - * If this is a motion value found in props or style, we want to add it - * to our visual element's motion value map. - */ - element.addValue(key, nextValue); - } - else if (isMotionValue(prevValue)) { - /** - * If we're swapping from a motion value to a static value, - * create a new motion value from that - */ - element.addValue(key, motionValue(nextValue, { owner: element })); - } - else if (prevValue !== nextValue) { - /** - * If this is a flat value that has changed, update the motion value - * or create one if it doesn't exist. We only want to do this if we're - * not handling the value with our animation state. - */ - if (element.hasValue(key)) { - const existingValue = element.getValue(key); - if (existingValue.liveStyle === true) { - existingValue.jump(nextValue); - } - else if (!existingValue.hasAnimated) { - existingValue.set(nextValue); - } - } - else { - const latestValue = element.getStaticValue(key); - element.addValue(key, motionValue(latestValue !== undefined ? latestValue : nextValue, { owner: element })); - } - } - } - // Handle removed values - for (const key in prev) { - if (next[key] === undefined) - element.removeValue(key); - } - return next; - } - - // Does this device prefer reduced motion? Returns `null` server-side. - const prefersReducedMotion = { current: null }; - const hasReducedMotionListener = { current: false }; - - const isBrowser = typeof window !== "undefined"; - function initPrefersReducedMotion() { - hasReducedMotionListener.current = true; - if (!isBrowser) - return; - if (window.matchMedia) { - const motionMediaQuery = window.matchMedia("(prefers-reduced-motion)"); - const setReducedMotionPreferences = () => (prefersReducedMotion.current = motionMediaQuery.matches); - motionMediaQuery.addEventListener("change", setReducedMotionPreferences); - setReducedMotionPreferences(); - } - else { - prefersReducedMotion.current = false; - } - } - - const propEventHandlers = [ - "AnimationStart", - "AnimationComplete", - "Update", - "BeforeLayoutMeasure", - "LayoutMeasure", - "LayoutAnimationStart", - "LayoutAnimationComplete", - ]; - /** - * Static feature definitions - can be injected by framework layer - */ - let featureDefinitions = {}; - /** - * Set feature definitions for all VisualElements. - * This should be called by the framework layer (e.g., framer-motion) during initialization. - */ - function setFeatureDefinitions(definitions) { - featureDefinitions = definitions; - } - /** - * Get the current feature definitions - */ - function getFeatureDefinitions() { - return featureDefinitions; - } - /** - * A VisualElement is an imperative abstraction around UI elements such as - * HTMLElement, SVGElement, Three.Object3D etc. - */ - class VisualElement { - /** - * This method takes React props and returns found MotionValues. For example, HTML - * MotionValues will be found within the style prop, whereas for Three.js within attribute arrays. - * - * This isn't an abstract method as it needs calling in the constructor, but it is - * intended to be one. - */ - scrapeMotionValuesFromProps(_props, _prevProps, _visualElement) { - return {}; - } - constructor({ parent, props, presenceContext, reducedMotionConfig, skipAnimations, blockInitialAnimation, visualState, }, options = {}) { - /** - * A reference to the current underlying Instance, e.g. a HTMLElement - * or Three.Mesh etc. - */ - this.current = null; - /** - * A set containing references to this VisualElement's children. - */ - this.children = new Set(); - /** - * Determine what role this visual element should take in the variant tree. - */ - this.isVariantNode = false; - this.isControllingVariants = false; - /** - * Decides whether this VisualElement should animate in reduced motion - * mode. - * - * TODO: This is currently set on every individual VisualElement but feels - * like it could be set globally. - */ - this.shouldReduceMotion = null; - /** - * Decides whether animations should be skipped for this VisualElement. - * Useful for E2E tests and visual regression testing. - */ - this.shouldSkipAnimations = false; - /** - * A map of all motion values attached to this visual element. Motion - * values are source of truth for any given animated value. A motion - * value might be provided externally by the component via props. - */ - this.values = new Map(); - this.KeyframeResolver = KeyframeResolver; - /** - * Cleanup functions for active features (hover/tap/exit etc) - */ - this.features = {}; - /** - * A map of every subscription that binds the provided or generated - * motion values onChange listeners to this visual element. - */ - this.valueSubscriptions = new Map(); - /** - * A reference to the previously-provided motion values as returned - * from scrapeMotionValuesFromProps. We use the keys in here to determine - * if any motion values need to be removed after props are updated. - */ - this.prevMotionValues = {}; - /** - * Track whether this element has been mounted before, to detect - * remounts after Suspense unmount/remount cycles. - */ - this.hasBeenMounted = false; - /** - * An object containing a SubscriptionManager for each active event. - */ - this.events = {}; - /** - * An object containing an unsubscribe function for each prop event subscription. - * For example, every "Update" event can have multiple subscribers via - * VisualElement.on(), but only one of those can be defined via the onUpdate prop. - */ - this.propEventSubscriptions = {}; - this.notifyUpdate = () => this.notify("Update", this.latestValues); - this.render = () => { - if (!this.current) - return; - this.triggerBuild(); - this.renderInstance(this.current, this.renderState, this.props.style, this.projection); - }; - this.renderScheduledAt = 0.0; - this.scheduleRender = () => { - const now = time.now(); - if (this.renderScheduledAt < now) { - this.renderScheduledAt = now; - frame.render(this.render, false, true); - } - }; - const { latestValues, renderState } = visualState; - this.latestValues = latestValues; - this.baseTarget = { ...latestValues }; - this.initialValues = props.initial ? { ...latestValues } : {}; - this.renderState = renderState; - this.parent = parent; - this.props = props; - this.presenceContext = presenceContext; - this.depth = parent ? parent.depth + 1 : 0; - this.reducedMotionConfig = reducedMotionConfig; - this.skipAnimationsConfig = skipAnimations; - this.options = options; - this.blockInitialAnimation = Boolean(blockInitialAnimation); - this.isControllingVariants = isControllingVariants(props); - this.isVariantNode = isVariantNode(props); - if (this.isVariantNode) { - this.variantChildren = new Set(); - } - this.manuallyAnimateOnMount = Boolean(parent && parent.current); - /** - * Any motion values that are provided to the element when created - * aren't yet bound to the element, as this would technically be impure. - * However, we iterate through the motion values and set them to the - * initial values for this component. - * - * TODO: This is impure and we should look at changing this to run on mount. - * Doing so will break some tests but this isn't necessarily a breaking change, - * more a reflection of the test. - */ - const { willChange, ...initialMotionValues } = this.scrapeMotionValuesFromProps(props, {}, this); - for (const key in initialMotionValues) { - const value = initialMotionValues[key]; - if (latestValues[key] !== undefined && isMotionValue(value)) { - value.set(latestValues[key]); - } - } - } - mount(instance) { - /** - * If this element has been mounted before (e.g. after a Suspense - * unmount/remount), reset motion values to their initial state - * so animations replay correctly from initial → animate. - */ - if (this.hasBeenMounted) { - for (const key in this.initialValues) { - this.values.get(key)?.jump(this.initialValues[key]); - this.latestValues[key] = this.initialValues[key]; - } - } - this.current = instance; - visualElementStore.set(instance, this); - if (this.projection && !this.projection.instance) { - this.projection.mount(instance); - } - if (this.parent && this.isVariantNode && !this.isControllingVariants) { - this.removeFromVariantTree = this.parent.addVariantChild(this); - } - this.values.forEach((value, key) => this.bindToMotionValue(key, value)); - /** - * Determine reduced motion preference. Only initialize the matchMedia - * listener if we actually need the dynamic value (i.e., when config - * is neither "never" nor "always"). - */ - if (this.reducedMotionConfig === "never") { - this.shouldReduceMotion = false; - } - else if (this.reducedMotionConfig === "always") { - this.shouldReduceMotion = true; - } - else { - if (!hasReducedMotionListener.current) { - initPrefersReducedMotion(); - } - this.shouldReduceMotion = prefersReducedMotion.current; - } - { - motionUtils.warnOnce(this.shouldReduceMotion !== true, "You have Reduced Motion enabled on your device. Animations may not appear as expected.", "reduced-motion-disabled"); - } - /** - * Set whether animations should be skipped based on the config. - */ - this.shouldSkipAnimations = this.skipAnimationsConfig ?? false; - this.parent?.addChild(this); - this.update(this.props, this.presenceContext); - this.hasBeenMounted = true; - } - unmount() { - this.projection && this.projection.unmount(); - cancelFrame(this.notifyUpdate); - cancelFrame(this.render); - this.valueSubscriptions.forEach((remove) => remove()); - this.valueSubscriptions.clear(); - this.removeFromVariantTree && this.removeFromVariantTree(); - this.parent?.removeChild(this); - for (const key in this.events) { - this.events[key].clear(); - } - for (const key in this.features) { - const feature = this.features[key]; - if (feature) { - feature.unmount(); - feature.isMounted = false; - } - } - this.current = null; - } - addChild(child) { - this.children.add(child); - this.enteringChildren ?? (this.enteringChildren = new Set()); - this.enteringChildren.add(child); - } - removeChild(child) { - this.children.delete(child); - this.enteringChildren && this.enteringChildren.delete(child); - } - bindToMotionValue(key, value) { - if (this.valueSubscriptions.has(key)) { - this.valueSubscriptions.get(key)(); - } - if (value.accelerate && - acceleratedValues.has(key) && - this.current instanceof HTMLElement) { - const { factory, keyframes, times, ease, duration } = value.accelerate; - const animation = new NativeAnimation({ - element: this.current, - name: key, - keyframes, - times, - ease, - duration: motionUtils.secondsToMilliseconds(duration), - }); - const cleanup = factory(animation); - this.valueSubscriptions.set(key, () => { - cleanup(); - animation.cancel(); - }); - return; - } - const valueIsTransform = transformProps.has(key); - if (valueIsTransform && this.onBindTransform) { - this.onBindTransform(); - } - const removeOnChange = value.on("change", (latestValue) => { - this.latestValues[key] = latestValue; - this.props.onUpdate && frame.preRender(this.notifyUpdate); - if (valueIsTransform && this.projection) { - this.projection.isTransformDirty = true; - } - this.scheduleRender(); - }); - let removeSyncCheck; - if (typeof window !== "undefined" && - window.MotionCheckAppearSync) { - removeSyncCheck = window.MotionCheckAppearSync(this, key, value); - } - this.valueSubscriptions.set(key, () => { - removeOnChange(); - if (removeSyncCheck) - removeSyncCheck(); - // Defer to MotionValue.on("change") auto-stop so React 19 remounts - // can resubscribe before the animation is cancelled (#3315). - }); - } - sortNodePosition(other) { - /** - * If these nodes aren't even of the same type we can't compare their depth. - */ - if (!this.current || - !this.sortInstanceNodePosition || - this.type !== other.type) { - return 0; - } - return this.sortInstanceNodePosition(this.current, other.current); - } - updateFeatures() { - let key = "animation"; - for (key in featureDefinitions) { - const featureDefinition = featureDefinitions[key]; - if (!featureDefinition) - continue; - const { isEnabled, Feature: FeatureConstructor } = featureDefinition; - /** - * If this feature is enabled but not active, make a new instance. - */ - if (!this.features[key] && - FeatureConstructor && - isEnabled(this.props)) { - this.features[key] = new FeatureConstructor(this); - } - /** - * If we have a feature, mount or update it. - */ - if (this.features[key]) { - const feature = this.features[key]; - if (feature.isMounted) { - feature.update(); - } - else { - feature.mount(); - feature.isMounted = true; - } - } - } - } - triggerBuild() { - this.build(this.renderState, this.latestValues, this.props); - } - /** - * Measure the current viewport box with or without transforms. - * Only measures axis-aligned boxes, rotate and skew must be manually - * removed with a re-render to work. - */ - measureViewportBox() { - return this.current - ? this.measureInstanceViewportBox(this.current, this.props) - : createBox(); - } - getStaticValue(key) { - return this.latestValues[key]; - } - setStaticValue(key, value) { - this.latestValues[key] = value; - } - /** - * Update the provided props. Ensure any newly-added motion values are - * added to our map, old ones removed, and listeners updated. - */ - update(props, presenceContext) { - if (props.transformTemplate || this.props.transformTemplate) { - this.scheduleRender(); - } - this.prevProps = this.props; - this.props = props; - this.prevPresenceContext = this.presenceContext; - this.presenceContext = presenceContext; - /** - * Update prop event handlers ie onAnimationStart, onAnimationComplete - */ - for (let i = 0; i < propEventHandlers.length; i++) { - const key = propEventHandlers[i]; - if (this.propEventSubscriptions[key]) { - this.propEventSubscriptions[key](); - delete this.propEventSubscriptions[key]; - } - const listenerName = ("on" + key); - const listener = props[listenerName]; - if (listener) { - this.propEventSubscriptions[key] = this.on(key, listener); - } - } - this.prevMotionValues = updateMotionValuesFromProps(this, this.scrapeMotionValuesFromProps(props, this.prevProps || {}, this), this.prevMotionValues); - if (this.handleChildMotionValue) { - this.handleChildMotionValue(); - } - } - getProps() { - return this.props; - } - /** - * Returns the variant definition with a given name. - */ - getVariant(name) { - return this.props.variants ? this.props.variants[name] : undefined; - } - /** - * Returns the defined default transition on this component. - */ - getDefaultTransition() { - return this.props.transition; - } - getTransformPagePoint() { - return this.props.transformPagePoint; - } - getClosestVariantNode() { - return this.isVariantNode - ? this - : this.parent - ? this.parent.getClosestVariantNode() - : undefined; - } - /** - * Add a child visual element to our set of children. - */ - addVariantChild(child) { - const closestVariantNode = this.getClosestVariantNode(); - if (closestVariantNode) { - closestVariantNode.variantChildren && - closestVariantNode.variantChildren.add(child); - return () => closestVariantNode.variantChildren.delete(child); - } - } - /** - * Add a motion value and bind it to this visual element. - */ - addValue(key, value) { - // Remove existing value if it exists - const existingValue = this.values.get(key); - if (value !== existingValue) { - if (existingValue) - this.removeValue(key); - this.bindToMotionValue(key, value); - this.values.set(key, value); - this.latestValues[key] = value.get(); - } - } - /** - * Remove a motion value and unbind any active subscriptions. - */ - removeValue(key) { - this.values.delete(key); - const unsubscribe = this.valueSubscriptions.get(key); - if (unsubscribe) { - unsubscribe(); - this.valueSubscriptions.delete(key); - } - delete this.latestValues[key]; - this.removeValueFromRenderState(key, this.renderState); - } - /** - * Check whether we have a motion value for this key - */ - hasValue(key) { - return this.values.has(key); - } - getValue(key, defaultValue) { - if (this.props.values && this.props.values[key]) { - return this.props.values[key]; - } - let value = this.values.get(key); - if (value === undefined && defaultValue !== undefined) { - value = motionValue(defaultValue === null ? undefined : defaultValue, { owner: this }); - this.addValue(key, value); - } - return value; - } - /** - * If we're trying to animate to a previously unencountered value, - * we need to check for it in our state and as a last resort read it - * directly from the instance (which might have performance implications). - */ - readValue(key, target) { - let value = this.latestValues[key] !== undefined || !this.current - ? this.latestValues[key] - : this.getBaseTargetFromProps(this.props, key) ?? - this.readValueFromInstance(this.current, key, this.options); - if (value !== undefined && value !== null) { - if (typeof value === "string" && - (motionUtils.isNumericalString(value) || motionUtils.isZeroValueString(value))) { - // If this is a number read as a string, ie "0" or "200", convert it to a number - value = parseFloat(value); - } - else if (!findValueType(value) && complex.test(target)) { - value = getAnimatableNone(key, target); - } - this.setBaseTarget(key, isMotionValue(value) ? value.get() : value); - } - return isMotionValue(value) ? value.get() : value; - } - /** - * Set the base target to later animate back to. This is currently - * only hydrated on creation and when we first read a value. - */ - setBaseTarget(key, value) { - this.baseTarget[key] = value; - } - /** - * Find the base target for a value thats been removed from all animation - * props. - */ - getBaseTarget(key) { - const { initial } = this.props; - let valueFromInitial; - if (typeof initial === "string" || typeof initial === "object") { - const variant = resolveVariantFromProps(this.props, initial, this.presenceContext?.custom); - if (variant) { - valueFromInitial = variant[key]; - } - } - /** - * If this value still exists in the current initial variant, read that. - */ - if (initial && valueFromInitial !== undefined) { - return valueFromInitial; - } - /** - * Alternatively, if this VisualElement config has defined a getBaseTarget - * so we can read the value from an alternative source, try that. - */ - const target = this.getBaseTargetFromProps(this.props, key); - if (target !== undefined && !isMotionValue(target)) - return target; - /** - * If the value was initially defined on initial, but it doesn't any more, - * return undefined. Otherwise return the value as initially read from the DOM. - */ - return this.initialValues[key] !== undefined && - valueFromInitial === undefined - ? undefined - : this.baseTarget[key]; - } - on(eventName, callback) { - if (!this.events[eventName]) { - this.events[eventName] = new motionUtils.SubscriptionManager(); - } - return this.events[eventName].add(callback); - } - notify(eventName, ...args) { - if (this.events[eventName]) { - this.events[eventName].notify(...args); - } - } - scheduleRenderMicrotask() { - microtask.render(this.render); - } - } - - class DOMVisualElement extends VisualElement { - constructor() { - super(...arguments); - this.KeyframeResolver = DOMKeyframesResolver; - } - sortInstanceNodePosition(a, b) { - /** - * compareDocumentPosition returns a bitmask, by using the bitwise & - * we're returning true if 2 in that bitmask is set to true. 2 is set - * to true if b preceeds a. - */ - return a.compareDocumentPosition(b) & 2 ? 1 : -1; - } - getBaseTargetFromProps(props, key) { - const style = props.style; - return style ? style[key] : undefined; - } - removeValueFromRenderState(key, { vars, style }) { - delete vars[key]; - delete style[key]; - } - handleChildMotionValue() { - if (this.childSubscription) { - this.childSubscription(); - delete this.childSubscription; - } - const { children } = this.props; - if (isMotionValue(children)) { - this.childSubscription = children.on("change", (latest) => { - if (this.current) { - this.current.textContent = `${latest}`; - } - }); - } - } - } - - /** - * Feature base class for extending VisualElement functionality. - * Features are plugins that can be mounted/unmounted to add behavior - * like gestures, animations, or layout tracking. - */ - class Feature { - constructor(node) { - this.isMounted = false; - this.node = node; - } - update() { } - } - - /** - * Bounding boxes tend to be defined as top, left, right, bottom. For various operations - * it's easier to consider each axis individually. This function returns a bounding box - * as a map of single-axis min/max values. - */ - function convertBoundingBoxToBox({ top, left, right, bottom, }) { - return { - x: { min: left, max: right }, - y: { min: top, max: bottom }, - }; - } - function convertBoxToBoundingBox({ x, y }) { - return { top: y.min, right: x.max, bottom: y.max, left: x.min }; - } - /** - * Applies a TransformPoint function to a bounding box. TransformPoint is usually a function - * provided by Framer to allow measured points to be corrected for device scaling. This is used - * when measuring DOM elements and DOM event points. - */ - function transformBoxPoints(point, transformPoint) { - if (!transformPoint) - return point; - const topLeft = transformPoint({ x: point.left, y: point.top }); - const bottomRight = transformPoint({ x: point.right, y: point.bottom }); - return { - top: topLeft.y, - left: topLeft.x, - bottom: bottomRight.y, - right: bottomRight.x, - }; - } - - function isIdentityScale(scale) { - return scale === undefined || scale === 1; - } - function hasScale({ scale, scaleX, scaleY }) { - return (!isIdentityScale(scale) || - !isIdentityScale(scaleX) || - !isIdentityScale(scaleY)); - } - function hasTransform(values) { - return (hasScale(values) || - has2DTranslate(values) || - values.z || - values.rotate || - values.rotateX || - values.rotateY || - values.skewX || - values.skewY); - } - function has2DTranslate(values) { - return is2DTranslate(values.x) || is2DTranslate(values.y); - } - function is2DTranslate(value) { - return value && value !== "0%"; - } - - /** - * Scales a point based on a factor and an originPoint - */ - function scalePoint(point, scale, originPoint) { - const distanceFromOrigin = point - originPoint; - const scaled = scale * distanceFromOrigin; - return originPoint + scaled; - } - /** - * Applies a translate/scale delta to a point - */ - function applyPointDelta(point, translate, scale, originPoint, boxScale) { - if (boxScale !== undefined) { - point = scalePoint(point, boxScale, originPoint); - } - return scalePoint(point, scale, originPoint) + translate; - } - /** - * Applies a translate/scale delta to an axis - */ - function applyAxisDelta(axis, translate = 0, scale = 1, originPoint, boxScale) { - axis.min = applyPointDelta(axis.min, translate, scale, originPoint, boxScale); - axis.max = applyPointDelta(axis.max, translate, scale, originPoint, boxScale); - } - /** - * Applies a translate/scale delta to a box - */ - function applyBoxDelta(box, { x, y }) { - applyAxisDelta(box.x, x.translate, x.scale, x.originPoint); - applyAxisDelta(box.y, y.translate, y.scale, y.originPoint); - } - const TREE_SCALE_SNAP_MIN = 0.999999999999; - const TREE_SCALE_SNAP_MAX = 1.0000000000001; - /** - * Apply a tree of deltas to a box. We do this to calculate the effect of all the transforms - * in a tree upon our box before then calculating how to project it into our desired viewport-relative box - * - * This is the final nested loop within updateLayoutDelta for future refactoring - */ - function applyTreeDeltas(box, treeScale, treePath, isSharedTransition = false) { - const treeLength = treePath.length; - if (!treeLength) - return; - // Reset the treeScale - treeScale.x = treeScale.y = 1; - let node; - let delta; - for (let i = 0; i < treeLength; i++) { - node = treePath[i]; - delta = node.projectionDelta; - /** - * TODO: Prefer to remove this, but currently we have motion components with - * display: contents in Framer. - */ - const { visualElement } = node.options; - if (visualElement && - visualElement.props.style && - visualElement.props.style.display === "contents") { - continue; - } - if (isSharedTransition && - node.options.layoutScroll && - node.scroll && - node !== node.root) { - translateAxis(box.x, -node.scroll.offset.x); - translateAxis(box.y, -node.scroll.offset.y); - } - if (delta) { - // Incoporate each ancestor's scale into a cumulative treeScale for this component - treeScale.x *= delta.x.scale; - treeScale.y *= delta.y.scale; - // Apply each ancestor's calculated delta into this component's recorded layout box - applyBoxDelta(box, delta); - } - if (isSharedTransition && hasTransform(node.latestValues)) { - transformBox(box, node.latestValues, node.layout?.layoutBox); - } - } - /** - * Snap tree scale back to 1 if it's within a non-perceivable threshold. - * This will help reduce useless scales getting rendered. - */ - if (treeScale.x < TREE_SCALE_SNAP_MAX && - treeScale.x > TREE_SCALE_SNAP_MIN) { - treeScale.x = 1.0; - } - if (treeScale.y < TREE_SCALE_SNAP_MAX && - treeScale.y > TREE_SCALE_SNAP_MIN) { - treeScale.y = 1.0; - } - } - function translateAxis(axis, distance) { - axis.min += distance; - axis.max += distance; - } - /** - * Apply a transform to an axis from the latest resolved motion values. - * This function basically acts as a bridge between a flat motion value map - * and applyAxisDelta - */ - function transformAxis(axis, axisTranslate, axisScale, boxScale, axisOrigin = 0.5) { - const originPoint = mixNumber$1(axis.min, axis.max, axisOrigin); - // Apply the axis delta to the final axis - applyAxisDelta(axis, axisTranslate, axisScale, originPoint, boxScale); - } - function resolveAxisTranslate(value, axis) { - if (typeof value === "string") { - return (parseFloat(value) / 100) * (axis.max - axis.min); - } - return value; - } - /** - * Apply a transform to a box from the latest resolved motion values. - */ - function transformBox(box, transform, sourceBox) { - const resolveBox = sourceBox ?? box; - transformAxis(box.x, resolveAxisTranslate(transform.x, resolveBox.x), transform.scaleX, transform.scale, transform.originX); - transformAxis(box.y, resolveAxisTranslate(transform.y, resolveBox.y), transform.scaleY, transform.scale, transform.originY); - } - - function measureViewportBox(instance, transformPoint) { - return convertBoundingBoxToBox(transformBoxPoints(instance.getBoundingClientRect(), transformPoint)); - } - function measurePageBox(element, rootProjectionNode, transformPagePoint) { - const viewportBox = measureViewportBox(element, transformPagePoint); - const { scroll } = rootProjectionNode; - if (scroll) { - translateAxis(viewportBox.x, scroll.offset.x); - translateAxis(viewportBox.y, scroll.offset.y); - } - return viewportBox; - } - - const translateAlias = { - x: "translateX", - y: "translateY", - z: "translateZ", - transformPerspective: "perspective", - }; - const numTransforms = transformPropOrder.length; - /** - * Build a CSS transform style from individual x/y/scale etc properties. - * - * This outputs with a default order of transforms/scales/rotations, this can be customised by - * providing a transformTemplate function. - */ - function buildTransform(latestValues, transform, transformTemplate) { - // The transform string we're going to build into. - let transformString = ""; - let transformIsDefault = true; - /** - * Loop over all possible transforms in order, adding the ones that - * are present to the transform string. - */ - for (let i = 0; i < numTransforms; i++) { - const key = transformPropOrder[i]; - const value = latestValues[key]; - if (value === undefined) - continue; - let valueIsDefault = true; - if (typeof value === "number") { - valueIsDefault = value === (key.startsWith("scale") ? 1 : 0); - } - else { - const parsed = parseFloat(value); - valueIsDefault = key.startsWith("scale") ? parsed === 1 : parsed === 0; - } - if (!valueIsDefault || transformTemplate) { - const valueAsType = getValueAsType(value, numberValueTypes[key]); - if (!valueIsDefault) { - transformIsDefault = false; - const transformName = translateAlias[key] || key; - transformString += `${transformName}(${valueAsType}) `; - } - if (transformTemplate) { - transform[key] = valueAsType; - } - } - } - // `pathRotation` composes onto `rotate` as a separate additive term so - // the user's `rotate` is never clobbered. Deliberately not a slot in - // `transformPropOrder`. - const pathRotation = latestValues.pathRotation; - if (pathRotation) { - transformIsDefault = false; - transformString += `rotate(${getValueAsType(pathRotation, numberValueTypes.pathRotation)}) `; - } - transformString = transformString.trim(); - // If we have a custom `transform` template, pass our transform values and - // generated transformString to that before returning - if (transformTemplate) { - transformString = transformTemplate(transform, transformIsDefault ? "" : transformString); - } - else if (transformIsDefault) { - transformString = "none"; - } - return transformString; - } - - function buildHTMLStyles(state, latestValues, transformTemplate) { - const { style, vars, transformOrigin } = state; - // Track whether we encounter any transform or transformOrigin values. - let hasTransform = false; - let hasTransformOrigin = false; - /** - * Loop over all our latest animated values and decide whether to handle them - * as a style or CSS variable. - * - * Transforms and transform origins are kept separately for further processing. - */ - for (const key in latestValues) { - const value = latestValues[key]; - if (transformProps.has(key)) { - // If this is a transform, flag to enable further transform processing - hasTransform = true; - continue; - } - else if (isCSSVariableName(key)) { - vars[key] = value; - continue; - } - else { - // Convert the value to its default value type, ie 0 -> "0px" - const valueAsType = getValueAsType(value, numberValueTypes[key]); - if (key.startsWith("origin")) { - // If this is a transform origin, flag and enable further transform-origin processing - hasTransformOrigin = true; - transformOrigin[key] = - valueAsType; - } - else { - style[key] = valueAsType; - } - } - } - if (!latestValues.transform) { - if (hasTransform || transformTemplate) { - style.transform = buildTransform(latestValues, state.transform, transformTemplate); - } - else if (style.transform) { - /** - * If we have previously created a transform but currently don't have any, - * reset transform style to none. - */ - style.transform = "none"; - } - } - /** - * Build a transformOrigin style. Uses the same defaults as the browser for - * undefined origins. - */ - if (hasTransformOrigin) { - const { originX = "50%", originY = "50%", originZ = 0, } = transformOrigin; - style.transformOrigin = `${originX} ${originY} ${originZ}`; - } - } - - function renderHTML(element, { style, vars }, styleProp, projection) { - const elementStyle = element.style; - let key; - for (key in style) { - // CSSStyleDeclaration has [index: number]: string; in the types, so we use that as key type. - elementStyle[key] = style[key]; - } - // Write projection styles directly to element style - projection?.applyProjectionStyles(elementStyle, styleProp); - for (key in vars) { - // Loop over any CSS variables and assign those. - // They can only be assigned using `setProperty`. - elementStyle.setProperty(key, vars[key]); - } - } - - function pixelsToPercent(pixels, axis) { - if (axis.max === axis.min) - return 0; - return (pixels / (axis.max - axis.min)) * 100; - } - /** - * We always correct borderRadius as a percentage rather than pixels to reduce paints. - * For example, if you are projecting a box that is 100px wide with a 10px borderRadius - * into a box that is 200px wide with a 20px borderRadius, that is actually a 10% - * borderRadius in both states. If we animate between the two in pixels that will trigger - * a paint each time. If we animate between the two in percentage we'll avoid a paint. - */ - const correctBorderRadius = { - correct: (latest, node) => { - if (!node.target) - return latest; - /** - * If latest is a string, if it's a percentage we can return immediately as it's - * going to be stretched appropriately. Otherwise, if it's a pixel, convert it to a number. - */ - if (typeof latest === "string") { - if (px.test(latest)) { - latest = parseFloat(latest); - } - else { - return latest; - } - } - /** - * If latest is a number, it's a pixel value. We use the current viewportBox to calculate that - * pixel value as a percentage of each axis - */ - const x = pixelsToPercent(latest, node.target.x); - const y = pixelsToPercent(latest, node.target.y); - return `${x}% ${y}%`; - }, - }; - - const correctBoxShadow = { - correct: (latest, { treeScale, projectionDelta }) => { - const original = latest; - const shadow = complex.parse(latest); - // TODO: Doesn't support multiple shadows - if (shadow.length > 5) - return original; - const template = complex.createTransformer(latest); - const offset = typeof shadow[0] !== "number" ? 1 : 0; - // Calculate the overall context scale - const xScale = projectionDelta.x.scale * treeScale.x; - const yScale = projectionDelta.y.scale * treeScale.y; - shadow[0 + offset] /= xScale; - shadow[1 + offset] /= yScale; - /** - * Ideally we'd correct x and y scales individually, but because blur and - * spread apply to both we have to take a scale average and apply that instead. - * We could potentially improve the outcome of this by incorporating the ratio between - * the two scales. - */ - const averageScale = mixNumber$1(xScale, yScale, 0.5); - // Blur - if (typeof shadow[2 + offset] === "number") - shadow[2 + offset] /= averageScale; - // Spread - if (typeof shadow[3 + offset] === "number") - shadow[3 + offset] /= averageScale; - return template(shadow); - }, - }; - - const scaleCorrectors = { - borderRadius: { - ...correctBorderRadius, - applyTo: [...cornerRadiusProps], - }, - borderTopLeftRadius: correctBorderRadius, - borderTopRightRadius: correctBorderRadius, - borderBottomLeftRadius: correctBorderRadius, - borderBottomRightRadius: correctBorderRadius, - boxShadow: correctBoxShadow, - }; - function addScaleCorrector(correctors) { - for (const key in correctors) { - scaleCorrectors[key] = correctors[key]; - if (isCSSVariableName(key)) { - scaleCorrectors[key].isCSSVariable = true; - } - } - } - - function isForcedMotionValue(key, { layout, layoutId }) { - return (transformProps.has(key) || - key.startsWith("origin") || - ((layout || layoutId !== undefined) && - (!!scaleCorrectors[key] || key === "opacity"))); - } - - function scrapeMotionValuesFromProps$1(props, prevProps, visualElement) { - const style = props.style; - const prevStyle = prevProps?.style; - const newValues = {}; - if (!style) - return newValues; - for (const key in style) { - if (isMotionValue(style[key]) || - (prevStyle && isMotionValue(prevStyle[key])) || - isForcedMotionValue(key, props) || - visualElement?.getValue(key)?.liveStyle !== undefined) { - newValues[key] = style[key]; - } - } - return newValues; - } - - function getComputedStyle$1(element) { - return window.getComputedStyle(element); - } - class HTMLVisualElement extends DOMVisualElement { - constructor() { - super(...arguments); - this.type = "html"; - this.renderInstance = renderHTML; - } - mount(instance) { - /** - * If a custom component forwards its ref to something other than a - * HTML/SVG element (a class instance, an imperative handle) there's - * nothing for Motion to style, measure or attach gestures to. #2777 - */ - motionUtils.invariant(Boolean(instance.style), "motion.create() components must forward their ref to a HTML or SVG element", "custom-component-ref"); - super.mount(instance); - } - readValueFromInstance(instance, key) { - if (transformProps.has(key)) { - return this.projection?.isProjecting - ? defaultTransformValue(key) - : readTransformValue(instance, key); - } - else { - const computedStyle = getComputedStyle$1(instance); - const value = (isCSSVariableName(key) - ? computedStyle.getPropertyValue(key) - : computedStyle[key]) || 0; - return typeof value === "string" ? value.trim() : value; - } - } - measureInstanceViewportBox(instance, { transformPagePoint }) { - return measureViewportBox(instance, transformPagePoint); - } - build(renderState, latestValues, props) { - buildHTMLStyles(renderState, latestValues, props.transformTemplate); - } - scrapeMotionValuesFromProps(props, prevProps, visualElement) { - return scrapeMotionValuesFromProps$1(props, prevProps, visualElement); - } - } - - function isObjectKey(key, object) { - return key in object; - } - class ObjectVisualElement extends VisualElement { - constructor() { - super(...arguments); - this.type = "object"; - } - readValueFromInstance(instance, key) { - if (isObjectKey(key, instance)) { - const value = instance[key]; - if (typeof value === "string" || typeof value === "number") { - return value; - } - } - return undefined; - } - getBaseTargetFromProps() { - return undefined; - } - removeValueFromRenderState(key, renderState) { - delete renderState.output[key]; - } - measureInstanceViewportBox() { - return createBox(); - } - build(renderState, latestValues) { - Object.assign(renderState.output, latestValues); - } - renderInstance(instance, { output }) { - Object.assign(instance, output); - } - sortInstanceNodePosition() { - return 0; - } - } - - const dashKeys = { - offset: "stroke-dashoffset", - array: "stroke-dasharray", - }; - const camelKeys = { - offset: "strokeDashoffset", - array: "strokeDasharray", - }; - /** - * Build SVG path properties. Uses the path's measured length to convert - * our custom pathLength, pathSpacing and pathOffset into stroke-dashoffset - * and stroke-dasharray attributes. - * - * This function is mutative to reduce per-frame GC. - * - * Note: We use unitless values for stroke-dasharray and stroke-dashoffset - * because Safari incorrectly scales px values when the page is zoomed. - */ - function buildSVGPath(attrs, length, spacing = 1, offset = 0, useDashCase = true) { - // Normalise path length by setting SVG attribute pathLength to 1 - attrs.pathLength = 1; - // We use dash case when setting attributes directly to the DOM node and camel case - // when defining props on a React component. - const keys = useDashCase ? dashKeys : camelKeys; - // Build the dash offset (unitless to avoid Safari zoom bug) - attrs[keys.offset] = `${-offset}`; - // Build the dash array (unitless to avoid Safari zoom bug) - attrs[keys.array] = `${length} ${spacing}`; - } - - const cssStyleProperties = [ - "transform", - "opacity", - "offsetDistance", - "offsetPath", - "offsetRotate", - "offsetAnchor", - ]; - /** - * Build SVG visual attributes, like cx and style.transform - */ - function buildSVGAttrs(state, { attrX, attrY, attrScale, pathLength, pathSpacing = 1, pathOffset = 0, - // This is object creation, which we try to avoid per-frame. - ...latest }, isSVGTag, transformTemplate, styleProp) { - buildHTMLStyles(state, latest, transformTemplate); - /** - * For svg tags we just want to make sure viewBox is animatable and treat all the styles - * as normal HTML tags. - */ - if (isSVGTag) { - if (state.style.viewBox) { - state.attrs.viewBox = state.style.viewBox; - } - return; - } - state.attrs = state.style; - state.style = {}; - const { attrs, style } = state; - for (const key of cssStyleProperties) { - if (attrs[key] !== undefined) { - style[key] = attrs[key]; - delete attrs[key]; - } - } - if (style.transform || attrs.transformOrigin) { - style.transformOrigin = attrs.transformOrigin ?? "50% 50%"; - delete attrs.transformOrigin; - } - if (style.transform) { - /** - * SVG's element transform-origin uses its own median as a reference. - * Therefore, transformBox becomes a fill-box - */ - style.transformBox = styleProp?.transformBox ?? "fill-box"; - delete attrs.transformBox; - } - // Render attrX/attrY/attrScale as attributes - if (attrX !== undefined) - attrs.x = attrX; - if (attrY !== undefined) - attrs.y = attrY; - if (attrScale !== undefined) - attrs.scale = attrScale; - // Build SVG path if one has been defined - if (pathLength !== undefined) { - buildSVGPath(attrs, pathLength, pathSpacing, pathOffset, false); - } - } - - /** - * A set of attribute names that are always read/written as camel case. - */ - const camelCaseAttributes = new Set([ - "baseFrequency", - "diffuseConstant", - "kernelMatrix", - "kernelUnitLength", - "keySplines", - "keyTimes", - "limitingConeAngle", - "markerHeight", - "markerWidth", - "numOctaves", - "targetX", - "targetY", - "surfaceScale", - "specularConstant", - "specularExponent", - "stdDeviation", - "tableValues", - "viewBox", - "gradientTransform", - "pathLength", - "startOffset", - "textLength", - "lengthAdjust", - ]); - - const isSVGTag = (tag) => typeof tag === "string" && tag.toLowerCase() === "svg"; - - function renderSVG(element, renderState, _styleProp, projection) { - renderHTML(element, renderState, undefined, projection); - for (const key in renderState.attrs) { - element.setAttribute(!camelCaseAttributes.has(key) ? camelToDash(key) : key, renderState.attrs[key]); - } - } - - function scrapeMotionValuesFromProps(props, prevProps, visualElement) { - const newValues = scrapeMotionValuesFromProps$1(props, prevProps, visualElement); - for (const key in props) { - if (isMotionValue(props[key]) || - isMotionValue(prevProps[key])) { - const targetKey = transformPropOrder.indexOf(key) !== -1 - ? "attr" + key.charAt(0).toUpperCase() + key.substring(1) - : key; - newValues[targetKey] = props[key]; - } - } - return newValues; - } - - class SVGVisualElement extends DOMVisualElement { - constructor() { - super(...arguments); - this.type = "svg"; - this.isSVGTag = false; - this.measureInstanceViewportBox = createBox; - } - getBaseTargetFromProps(props, key) { - return props[key]; - } - readValueFromInstance(instance, key) { - if (transformProps.has(key)) { - const defaultType = getDefaultValueType(key); - return defaultType ? defaultType.default || 0 : 0; - } - if (cssStyleProperties.includes(key)) { - const computedStyle = getComputedStyle(instance); - const value = computedStyle[key]; - if (typeof value === "string" && value) - return value.trim(); - } - key = !camelCaseAttributes.has(key) ? camelToDash(key) : key; - return instance.getAttribute(key); - } - scrapeMotionValuesFromProps(props, prevProps, visualElement) { - return scrapeMotionValuesFromProps(props, prevProps, visualElement); - } - build(renderState, latestValues, props) { - buildSVGAttrs(renderState, latestValues, this.isSVGTag, props.transformTemplate, props.style); - } - renderInstance(instance, renderState, styleProp, projection) { - renderSVG(instance, renderState, styleProp, projection); - } - mount(instance) { - this.isSVGTag = isSVGTag(instance.tagName); - super.mount(instance); - } - } - - const numVariantProps = variantProps.length; - /** - * Get variant context from a visual element's parent chain. - * Uses `any` type for visualElement to avoid circular dependencies. - */ - function getVariantContext(visualElement) { - if (!visualElement) - return undefined; - if (!visualElement.isControllingVariants) { - const context = visualElement.parent - ? getVariantContext(visualElement.parent) || {} - : {}; - if (visualElement.props.initial !== undefined) { - context.initial = visualElement.props.initial; - } - return context; - } - const context = {}; - for (let i = 0; i < numVariantProps; i++) { - const name = variantProps[i]; - const prop = visualElement.props[name]; - if (isVariantLabel(prop) || prop === false) { - context[name] = prop; - } - } - return context; - } - - function shallowCompare(next, prev) { - if (!Array.isArray(prev)) - return false; - const prevLength = prev.length; - if (prevLength !== next.length) - return false; - for (let i = 0; i < prevLength; i++) { - if (prev[i] !== next[i]) - return false; - } - return true; - } - - const reversePriorityOrder = [...variantPriorityOrder].reverse(); - const numAnimationTypes = variantPriorityOrder.length; - function createAnimateFunction(visualElement) { - return (animations) => { - return Promise.all(animations.map(({ animation, options }) => animateVisualElement(visualElement, animation, options))); - }; - } - function createAnimationState(visualElement) { - let animate = createAnimateFunction(visualElement); - let state = createState(); - let isInitialRender = true; - /** - * Track whether the animation state has been reset (e.g. via StrictMode - * double-invocation or Suspense unmount/remount). On the first - * animateChanges() call after a reset we need to behave like the initial - * render for variant-inheritance checks, even though isInitialRender is - * already false. - */ - let wasReset = false; - /** - * This function will be used to reduce the animation definitions for - * each active animation type into an object of resolved values for it. - */ - const buildResolvedTypeValues = (type) => (acc, definition) => { - const resolved = resolveVariant(visualElement, definition, type === "exit" - ? visualElement.presenceContext?.custom - : undefined); - if (resolved) { - const { transition, transitionEnd, ...target } = resolved; - acc = { ...acc, ...target, ...transitionEnd }; - } - return acc; - }; - /** - * This just allows us to inject mocked animation functions - * @internal - */ - function setAnimateFunction(makeAnimator) { - animate = makeAnimator(visualElement); - } - /** - * When we receive new props, we need to: - * 1. Create a list of protected keys for each type. This is a directory of - * value keys that are currently being "handled" by types of a higher priority - * so that whenever an animation is played of a given type, these values are - * protected from being animated. - * 2. Determine if an animation type needs animating. - * 3. Determine if any values have been removed from a type and figure out - * what to animate those to. - */ - function animateChanges(changedActiveType) { - const { props } = visualElement; - const context = getVariantContext(visualElement.parent) || {}; - /** - * A list of animations that we'll build into as we iterate through the animation - * types. This will get executed at the end of the function. - */ - const animations = []; - /** - * Keep track of which values have been removed. Then, as we hit lower priority - * animation types, we can check if they contain removed values and animate to that. - */ - const removedKeys = new Set(); - /** - * A dictionary of all encountered keys. This is an object to let us build into and - * copy it without iteration. Each time we hit an animation type we set its protected - * keys - the keys its not allowed to animate - to the latest version of this object. - */ - let encounteredKeys = {}; - /** - * If a variant has been removed at a given index, and this component is controlling - * variant animations, we want to ensure lower-priority variants are forced to animate. - */ - let removedVariantIndex = Infinity; - /** - * Iterate through all animation types in reverse priority order. For each, we want to - * detect which values it's handling and whether or not they've changed (and therefore - * need to be animated). If any values have been removed, we want to detect those in - * lower priority props and flag for animation. - */ - for (let i = 0; i < numAnimationTypes; i++) { - const type = reversePriorityOrder[i]; - const typeState = state[type]; - const prop = props[type] !== undefined - ? props[type] - : context[type]; - const propIsVariant = isVariantLabel(prop); - /** - * If this type has *just* changed isActive status, set activeDelta - * to that status. Otherwise set to null. - */ - const activeDelta = type === changedActiveType ? typeState.isActive : null; - if (activeDelta === false) - removedVariantIndex = i; - /** - * If this prop is an inherited variant, rather than been set directly on the - * component itself, we want to make sure we allow the parent to trigger animations. - * - * TODO: Can probably change this to a !isControllingVariants check - */ - let isInherited = prop === context[type] && - prop !== props[type] && - propIsVariant; - if (isInherited && - (isInitialRender || wasReset) && - visualElement.manuallyAnimateOnMount) { - isInherited = false; - } - /** - * Set all encountered keys so far as the protected keys for this type. This will - * be any key that has been animated or otherwise handled by active, higher-priortiy types. - */ - typeState.protectedKeys = { ...encounteredKeys }; - // Check if we can skip analysing this prop early - if ( - // If it isn't active and hasn't *just* been set as inactive - (!typeState.isActive && activeDelta === null) || - // If we didn't and don't have any defined prop for this animation type - (!prop && !typeState.prevProp) || - // Or if the prop doesn't define an animation - isAnimationControls(prop) || - typeof prop === "boolean") { - continue; - } - /** - * If exit is already active and wasn't just activated, skip - * re-processing to prevent interrupting running exit animations. - * Re-resolving exit with a changed custom value can start new - * value animations that stop the originals, leaving the exit - * animation promise unresolved and the component stuck in the DOM. - */ - if (type === "exit" && typeState.isActive && activeDelta !== true) { - if (typeState.prevResolvedValues) { - encounteredKeys = { - ...encounteredKeys, - ...typeState.prevResolvedValues, - }; - } - continue; - } - /** - * As we go look through the values defined on this type, if we detect - * a changed value or a value that was removed in a higher priority, we set - * this to true and add this prop to the animation list. - */ - const variantDidChange = checkVariantsDidChange(typeState.prevProp, prop); - let shouldAnimateType = variantDidChange || - // If we're making this variant active, we want to always make it active - (type === changedActiveType && - typeState.isActive && - !isInherited && - propIsVariant) || - // If we removed a higher-priority variant (i is in reverse order) - (i > removedVariantIndex && propIsVariant); - let handledRemovedValues = false; - /** - * As animations can be set as variant lists, variants or target objects, we - * coerce everything to an array if it isn't one already - */ - const definitionList = Array.isArray(prop) ? prop : [prop]; - /** - * Build an object of all the resolved values. We'll use this in the subsequent - * animateChanges calls to determine whether a value has changed. - */ - let resolvedValues = definitionList.reduce(buildResolvedTypeValues(type), {}); - if (activeDelta === false) - resolvedValues = {}; - /** - * Now we need to loop through all the keys in the prev prop and this prop, - * and decide: - * 1. If the value has changed, and needs animating - * 2. If it has been removed, and needs adding to the removedKeys set - * 3. If it has been removed in a higher priority type and needs animating - * 4. If it hasn't been removed in a higher priority but hasn't changed, and - * needs adding to the type's protectedKeys list. - */ - const { prevResolvedValues = {} } = typeState; - const allKeys = { - ...prevResolvedValues, - ...resolvedValues, - }; - const markToAnimate = (key) => { - shouldAnimateType = true; - if (removedKeys.has(key)) { - handledRemovedValues = true; - removedKeys.delete(key); - } - typeState.needsAnimating[key] = true; - const motionValue = visualElement.getValue(key); - if (motionValue) - motionValue.liveStyle = false; - }; - for (const key in allKeys) { - const next = resolvedValues[key]; - const prev = prevResolvedValues[key]; - // If we've already handled this we can just skip ahead - if (encounteredKeys.hasOwnProperty(key)) - continue; - /** - * If the value has changed, we probably want to animate it. - */ - let valueHasChanged = false; - if (isKeyframesTarget(next) && isKeyframesTarget(prev)) { - valueHasChanged = - !shallowCompare(next, prev) || variantDidChange; - } - else { - valueHasChanged = next !== prev; - } - if (valueHasChanged) { - if (next !== undefined && next !== null) { - // If next is defined and doesn't equal prev, it needs animating - markToAnimate(key); - } - else { - // If it's undefined, it's been removed. - removedKeys.add(key); - } - } - else if (next !== undefined && removedKeys.has(key)) { - /** - * If next hasn't changed and it isn't undefined, we want to check if it's - * been removed by a higher priority - */ - markToAnimate(key); - } - else { - /** - * If it hasn't changed, we add it to the list of protected values - * to ensure it doesn't get animated. - */ - typeState.protectedKeys[key] = true; - } - } - /** - * Update the typeState so next time animateChanges is called we can compare the - * latest prop and resolvedValues to these. - */ - typeState.prevProp = prop; - typeState.prevResolvedValues = resolvedValues; - if (typeState.isActive) { - encounteredKeys = { ...encounteredKeys, ...resolvedValues }; - } - if ((isInitialRender || wasReset) && - visualElement.blockInitialAnimation) { - shouldAnimateType = false; - } - /** - * If this is an inherited prop we want to skip this animation - * unless the inherited variants haven't changed on this render. - */ - const willAnimateViaParent = isInherited && variantDidChange; - const needsAnimating = !willAnimateViaParent || handledRemovedValues; - if (shouldAnimateType && needsAnimating) { - animations.push(...definitionList.map((animation) => { - const options = { type }; - /** - * If we're performing the initial animation, but we're not - * rendering at the same time as the variant-controlling parent, - * we want to use the parent's transition to calculate the stagger. - */ - if (typeof animation === "string" && - (isInitialRender || wasReset) && - !willAnimateViaParent && - visualElement.manuallyAnimateOnMount && - visualElement.parent) { - const { parent } = visualElement; - const parentVariant = resolveVariant(parent, animation); - if (parent.enteringChildren && parentVariant) { - const { delayChildren } = parentVariant.transition || {}; - options.delay = calcChildStagger(parent.enteringChildren, visualElement, delayChildren); - } - } - return { - animation: animation, - options, - }; - })); - } - } - /** - * If there are some removed value that haven't been dealt with, - * we need to create a new animation that falls back either to the value - * defined in the style prop, or the last read value. - */ - if (removedKeys.size) { - const fallbackAnimation = {}; - /** - * If the initial prop contains a transition we can use that, otherwise - * allow the animation function to use the visual element's default. - */ - if (typeof props.initial !== "boolean") { - const initialTransition = resolveVariant(visualElement, Array.isArray(props.initial) - ? props.initial[0] - : props.initial); - if (initialTransition && initialTransition.transition) { - fallbackAnimation.transition = initialTransition.transition; - } - } - removedKeys.forEach((key) => { - const fallbackTarget = visualElement.getBaseTarget(key); - const motionValue = visualElement.getValue(key); - if (motionValue) - motionValue.liveStyle = true; - // @ts-expect-error - @mattgperry to figure if we should do something here - fallbackAnimation[key] = fallbackTarget ?? null; - }); - animations.push({ animation: fallbackAnimation }); - } - let shouldAnimate = Boolean(animations.length); - if (isInitialRender && - (props.initial === false || props.initial === props.animate) && - !visualElement.manuallyAnimateOnMount) { - shouldAnimate = false; - } - isInitialRender = false; - wasReset = false; - return shouldAnimate ? animate(animations) : Promise.resolve(); - } - /** - * Change whether a certain animation type is active. - */ - function setActive(type, isActive) { - // If the active state hasn't changed, we can safely do nothing here - if (state[type].isActive === isActive) - return Promise.resolve(); - // Propagate active change to children - visualElement.variantChildren?.forEach((child) => child.animationState?.setActive(type, isActive)); - state[type].isActive = isActive; - const animations = animateChanges(type); - for (const key in state) { - state[key].protectedKeys = {}; - } - return animations; - } - return { - animateChanges, - setActive, - setAnimateFunction, - getState: () => state, - reset: () => { - state = createState(); - wasReset = true; - }, - }; - } - function checkVariantsDidChange(prev, next) { - if (typeof next === "string") { - return next !== prev; - } - else if (Array.isArray(next)) { - return !shallowCompare(next, prev); - } - return false; - } - function createTypeState(isActive = false) { - return { - isActive, - protectedKeys: {}, - needsAnimating: {}, - prevResolvedValues: {}, - }; - } - function createState() { - return { - animate: createTypeState(true), - whileInView: createTypeState(), - whileHover: createTypeState(), - whileTap: createTypeState(), - whileDrag: createTypeState(), - whileFocus: createTypeState(), - exit: createTypeState(), - }; - } - - /** - * Reset an axis to the provided origin box. - * - * This is a mutative operation. - */ - function copyAxisInto(axis, originAxis) { - axis.min = originAxis.min; - axis.max = originAxis.max; - } - /** - * Reset a box to the provided origin box. - * - * This is a mutative operation. - */ - function copyBoxInto(box, originBox) { - copyAxisInto(box.x, originBox.x); - copyAxisInto(box.y, originBox.y); - } - /** - * Reset a delta to the provided origin box. - * - * This is a mutative operation. - */ - function copyAxisDeltaInto(delta, originDelta) { - delta.translate = originDelta.translate; - delta.scale = originDelta.scale; - delta.originPoint = originDelta.originPoint; - delta.origin = originDelta.origin; - } - - const SCALE_PRECISION = 0.0001; - const SCALE_MIN = 1 - SCALE_PRECISION; - const SCALE_MAX = 1 + SCALE_PRECISION; - const TRANSLATE_PRECISION = 0.01; - const TRANSLATE_MIN = 0 - TRANSLATE_PRECISION; - const TRANSLATE_MAX = 0 + TRANSLATE_PRECISION; - function calcLength(axis) { - return axis.max - axis.min; - } - function isNear(value, target, maxDistance) { - return Math.abs(value - target) <= maxDistance; - } - function calcAxisDelta(delta, source, target, origin = 0.5) { - delta.origin = origin; - delta.originPoint = mixNumber$1(source.min, source.max, delta.origin); - delta.scale = calcLength(target) / calcLength(source); - delta.translate = - mixNumber$1(target.min, target.max, delta.origin) - delta.originPoint; - if ((delta.scale >= SCALE_MIN && delta.scale <= SCALE_MAX) || - isNaN(delta.scale)) { - delta.scale = 1.0; - } - if ((delta.translate >= TRANSLATE_MIN && - delta.translate <= TRANSLATE_MAX) || - isNaN(delta.translate)) { - delta.translate = 0.0; - } - } - function calcBoxDelta(delta, source, target, origin) { - calcAxisDelta(delta.x, source.x, target.x, origin ? origin.originX : undefined); - calcAxisDelta(delta.y, source.y, target.y, origin ? origin.originY : undefined); - } - function calcRelativeAxis(target, relative, parent, anchor = 0) { - const anchorPoint = anchor - ? mixNumber$1(parent.min, parent.max, anchor) - : parent.min; - target.min = anchorPoint + relative.min; - target.max = target.min + calcLength(relative); - } - function calcRelativeBox(target, relative, parent, anchor) { - calcRelativeAxis(target.x, relative.x, parent.x, anchor?.x); - calcRelativeAxis(target.y, relative.y, parent.y, anchor?.y); - } - function calcRelativeAxisPosition(target, layout, parent, anchor = 0) { - const anchorPoint = anchor - ? mixNumber$1(parent.min, parent.max, anchor) - : parent.min; - target.min = layout.min - anchorPoint; - target.max = target.min + calcLength(layout); - } - function calcRelativePosition(target, layout, parent, anchor) { - calcRelativeAxisPosition(target.x, layout.x, parent.x, anchor?.x); - calcRelativeAxisPosition(target.y, layout.y, parent.y, anchor?.y); - } - - /** - * Remove a delta from a point. This is essentially the steps of applyPointDelta in reverse - */ - function removePointDelta(point, translate, scale, originPoint, boxScale) { - point -= translate; - point = scalePoint(point, 1 / scale, originPoint); - if (boxScale !== undefined) { - point = scalePoint(point, 1 / boxScale, originPoint); - } - return point; - } - /** - * Remove a delta from an axis. This is essentially the steps of applyAxisDelta in reverse - */ - function removeAxisDelta(axis, translate = 0, scale = 1, origin = 0.5, boxScale, originAxis = axis, sourceAxis = axis) { - if (percent.test(translate)) { - translate = parseFloat(translate); - const relativeProgress = mixNumber$1(sourceAxis.min, sourceAxis.max, translate / 100); - translate = relativeProgress - sourceAxis.min; - } - if (typeof translate !== "number") - return; - let originPoint = mixNumber$1(originAxis.min, originAxis.max, origin); - if (axis === originAxis) - originPoint -= translate; - axis.min = removePointDelta(axis.min, translate, scale, originPoint, boxScale); - axis.max = removePointDelta(axis.max, translate, scale, originPoint, boxScale); - } - /** - * Remove a transforms from an axis. This is essentially the steps of applyAxisTransforms in reverse - * and acts as a bridge between motion values and removeAxisDelta - */ - function removeAxisTransforms(axis, transforms, [key, scaleKey, originKey], origin, sourceAxis) { - removeAxisDelta(axis, transforms[key], transforms[scaleKey], transforms[originKey], transforms.scale, origin, sourceAxis); - } - /** - * The names of the motion values we want to apply as translation, scale and origin. - */ - const xKeys = ["x", "scaleX", "originX"]; - const yKeys = ["y", "scaleY", "originY"]; - /** - * Remove a transforms from an box. This is essentially the steps of applyAxisBox in reverse - * and acts as a bridge between motion values and removeAxisDelta - */ - function removeBoxTransforms(box, transforms, originBox, sourceBox) { - removeAxisTransforms(box.x, transforms, xKeys, originBox ? originBox.x : undefined, sourceBox ? sourceBox.x : undefined); - removeAxisTransforms(box.y, transforms, yKeys, originBox ? originBox.y : undefined, sourceBox ? sourceBox.y : undefined); - } - - function isAxisDeltaZero(delta) { - return delta.translate === 0 && delta.scale === 1; - } - function isDeltaZero(delta) { - return isAxisDeltaZero(delta.x) && isAxisDeltaZero(delta.y); - } - function axisEquals(a, b) { - return a.min === b.min && a.max === b.max; - } - function boxEquals(a, b) { - return axisEquals(a.x, b.x) && axisEquals(a.y, b.y); - } - function axisEqualsRounded(a, b) { - return (Math.round(a.min) === Math.round(b.min) && - Math.round(a.max) === Math.round(b.max)); - } - function boxEqualsRounded(a, b) { - return axisEqualsRounded(a.x, b.x) && axisEqualsRounded(a.y, b.y); - } - function aspectRatio(box) { - return calcLength(box.x) / calcLength(box.y); - } - function axisDeltaEquals(a, b) { - return (a.translate === b.translate && - a.scale === b.scale && - a.originPoint === b.originPoint); - } - - function eachAxis(callback) { - return [callback("x"), callback("y")]; - } - - function buildProjectionTransform(delta, treeScale, latestTransform) { - let transform = ""; - /** - * The translations we use to calculate are always relative to the viewport coordinate space. - * But when we apply scales, we also scale the coordinate space of an element and its children. - * For instance if we have a treeScale (the culmination of all parent scales) of 0.5 and we need - * to move an element 100 pixels, we actually need to move it 200 in within that scaled space. - */ - const xTranslate = delta.x.translate / treeScale.x; - const yTranslate = delta.y.translate / treeScale.y; - const zTranslate = latestTransform?.z || 0; - if (xTranslate || yTranslate || zTranslate) { - transform = `translate3d(${xTranslate}px, ${yTranslate}px, ${zTranslate}px) `; - } - /** - * Apply scale correction for the tree transform. - * This will apply scale to the screen-orientated axes. - */ - if (treeScale.x !== 1 || treeScale.y !== 1) { - transform += `scale(${1 / treeScale.x}, ${1 / treeScale.y}) `; - } - if (latestTransform) { - const { transformPerspective, rotate, pathRotation, rotateX, rotateY, skewX, skewY, } = latestTransform; - if (transformPerspective) - transform = `perspective(${transformPerspective}px) ${transform}`; - if (rotate) - transform += `rotate(${rotate}deg) `; - // Additive `rotate()` so user `rotate` isn't clobbered. - if (pathRotation) - transform += `rotate(${pathRotation}deg) `; - if (rotateX) - transform += `rotateX(${rotateX}deg) `; - if (rotateY) - transform += `rotateY(${rotateY}deg) `; - if (skewX) - transform += `skewX(${skewX}deg) `; - if (skewY) - transform += `skewY(${skewY}deg) `; - } - /** - * Apply scale to match the size of the element to the size we want it. - * This will apply scale to the element-orientated axes. - */ - const elementScaleX = delta.x.scale * treeScale.x; - const elementScaleY = delta.y.scale * treeScale.y; - if (elementScaleX !== 1 || elementScaleY !== 1) { - transform += `scale(${elementScaleX}, ${elementScaleY})`; - } - return transform || "none"; - } - - const numBorders = cornerRadiusProps.length; - const asNumber = (value) => typeof value === "string" ? parseFloat(value) : value; - const isPx = (value) => typeof value === "number" || px.test(value); - function mixValues(target, follow, lead, progress, shouldCrossfadeOpacity, isOnlyMember) { - if (shouldCrossfadeOpacity) { - target.opacity = mixNumber$1(0, lead.opacity ?? 1, easeCrossfadeIn(progress)); - target.opacityExit = mixNumber$1(follow.opacity ?? 1, 0, easeCrossfadeOut(progress)); - } - else if (isOnlyMember) { - target.opacity = mixNumber$1(follow.opacity ?? 1, lead.opacity ?? 1, progress); - } - /** - * Mix border radius - */ - for (let i = 0; i < numBorders; i++) { - const borderLabel = cornerRadiusProps[i]; - let followRadius = getRadius(follow, borderLabel); - let leadRadius = getRadius(lead, borderLabel); - if (followRadius === undefined && leadRadius === undefined) - continue; - followRadius || (followRadius = 0); - leadRadius || (leadRadius = 0); - const canMix = followRadius === 0 || - leadRadius === 0 || - isPx(followRadius) === isPx(leadRadius); - if (canMix) { - target[borderLabel] = Math.max(mixNumber$1(asNumber(followRadius), asNumber(leadRadius), progress), 0); - if (percent.test(leadRadius) || percent.test(followRadius)) { - target[borderLabel] += "%"; - } - } - else { - target[borderLabel] = leadRadius; - } - } - /** - * Mix rotation - */ - if (follow.rotate || lead.rotate) { - target.rotate = mixNumber$1(follow.rotate || 0, lead.rotate || 0, progress); - } - } - function getRadius(values, radiusName) { - return values[radiusName] !== undefined - ? values[radiusName] - : values.borderRadius; - } - const easeCrossfadeIn = /*@__PURE__*/ compress(0, 0.5, motionUtils.circOut); - const easeCrossfadeOut = /*@__PURE__*/ compress(0.5, 0.95, motionUtils.noop); - function compress(min, max, easing) { - return (p) => { - // Could replace ifs with clamp - if (p < min) - return 0; - if (p > max) - return 1; - return easing(motionUtils.progress(min, max, p)); - }; - } - - function animateSingleValue(value, keyframes, options) { - const motionValue$1 = isMotionValue(value) ? value : motionValue(value); - motionValue$1.start(animateMotionValue("", motionValue$1, keyframes, options)); - return motionValue$1.animation; - } - - function addDomEvent(target, eventName, handler, options = { passive: true }) { - target.addEventListener(eventName, handler, options); - return () => target.removeEventListener(eventName, handler, options); - } - - const compareByDepth = (a, b) => a.depth - b.depth; - - class FlatTree { - constructor() { - this.children = []; - this.isDirty = false; - } - add(child) { - motionUtils.addUniqueItem(this.children, child); - this.isDirty = true; - } - remove(child) { - motionUtils.removeItem(this.children, child); - this.isDirty = true; - } - forEach(callback) { - this.isDirty && this.children.sort(compareByDepth); - this.isDirty = false; - this.children.forEach(callback); - } - } - - /** - * Timeout defined in ms - */ - function delay(callback, timeout) { - const start = time.now(); - const checkElapsed = ({ timestamp }) => { - const elapsed = timestamp - start; - if (elapsed >= timeout) { - cancelFrame(checkElapsed); - callback(elapsed - timeout); - } - }; - frame.setup(checkElapsed, true); - return () => cancelFrame(checkElapsed); - } - function delayInSeconds(callback, timeout) { - return delay(callback, motionUtils.secondsToMilliseconds(timeout)); - } - - /** - * If the provided value is a MotionValue, this returns the actual value, otherwise just the value itself - */ - function resolveMotionValue(value) { - return isMotionValue(value) ? value.get() : value; - } - - class NodeStack { - constructor() { - this.members = []; - } - add(node) { - motionUtils.addUniqueItem(this.members, node); - for (let i = this.members.length - 1; i >= 0; i--) { - const member = this.members[i]; - if (member === node || member === this.lead || member === this.prevLead) - continue; - const inst = member.instance; - if ((!inst || inst.isConnected === false) && !member.snapshot) { - motionUtils.removeItem(this.members, member); - member.unmount(); - } - } - node.scheduleRender(); - } - remove(node) { - motionUtils.removeItem(this.members, node); - if (node === this.prevLead) - this.prevLead = undefined; - if (node === this.lead) { - const prevLead = this.members[this.members.length - 1]; - if (prevLead) - this.promote(prevLead); - } - } - relegate(node) { - for (let i = this.members.indexOf(node) - 1; i >= 0; i--) { - const member = this.members[i]; - if (member.isPresent !== false && member.instance?.isConnected !== false) { - this.promote(member); - return true; - } - } - return false; - } - promote(node, preserveFollowOpacity) { - const prevLead = this.lead; - if (node === prevLead) - return; - this.prevLead = prevLead; - this.lead = node; - node.show(); - if (prevLead) { - prevLead.updateSnapshot(); - node.scheduleRender(); - const { layoutDependency: prevDep } = prevLead.options; - const { layoutDependency: nextDep } = node.options; - if (prevDep === undefined || prevDep !== nextDep) { - node.resumeFrom = prevLead; - if (preserveFollowOpacity) - prevLead.preserveOpacity = true; - if (prevLead.snapshot) { - node.snapshot = prevLead.snapshot; - node.snapshot.latestValues = - prevLead.animationValues || prevLead.latestValues; - } - if (node.root?.isUpdating) - node.isLayoutDirty = true; - } - if (node.options.crossfade === false) - prevLead.hide(); - } - } - exitAnimationComplete() { - this.members.forEach((member) => { - member.options.onExitComplete?.(); - member.resumingFrom?.options.onExitComplete?.(); - }); - } - scheduleRender() { - this.members.forEach((member) => member.instance && member.scheduleRender(false)); - } - removeLeadSnapshot() { - if (this.lead?.snapshot) - this.lead.snapshot = undefined; - } - } - - /** - * This should only ever be modified on the client otherwise it'll - * persist through server requests. If we need instanced states we - * could lazy-init via root. - */ - const globalProjectionState = { - /** - * Global flag as to whether the tree has animated since the last time - * we resized the window - */ - hasAnimatedSinceResize: true, - /** - * We set this to true once, on the first update. Any nodes added to the tree beyond that - * update will be given a `data-projection-id` attribute. - */ - hasEverUpdated: false, - }; - - const metrics = { - nodes: 0, - calculatedTargetDeltas: 0, - calculatedProjections: 0, - }; - const transformAxes = ["", "X", "Y", "Z"]; - /** - * We use 1000 as the animation target as 0-1000 maps better to pixels than 0-1 - * which has a noticeable difference in spring animations - */ - const animationTarget = 1000; - let id = 0; - function resetDistortingTransform(key, visualElement, values, sharedAnimationValues) { - const { latestValues } = visualElement; - // Record the distorting transform and then temporarily set it to 0 - if (latestValues[key]) { - values[key] = latestValues[key]; - visualElement.setStaticValue(key, 0); - if (sharedAnimationValues) { - sharedAnimationValues[key] = 0; - } - } - } - function cancelTreeOptimisedTransformAnimations(projectionNode) { - projectionNode.hasCheckedOptimisedAppear = true; - if (projectionNode.root === projectionNode) - return; - const { visualElement } = projectionNode.options; - if (!visualElement) - return; - const appearId = getOptimisedAppearId(visualElement); - if (window.MotionHasOptimisedAnimation(appearId, "transform")) { - const { layout, layoutId } = projectionNode.options; - window.MotionCancelOptimisedAnimation(appearId, "transform", frame, !(layout || layoutId)); - } - const { parent } = projectionNode; - if (parent && !parent.hasCheckedOptimisedAppear) { - cancelTreeOptimisedTransformAnimations(parent); - } - } - function createProjectionNode({ attachResizeListener, defaultParent, measureScroll, checkIsScrollRoot, resetTransform, }) { - return class ProjectionNode { - constructor(latestValues = {}, parent = defaultParent?.()) { - /** - * A unique ID generated for every projection node. - */ - this.id = id++; - /** - * An id that represents a unique session instigated by startUpdate. - */ - this.animationId = 0; - this.animationCommitId = 0; - /** - * A Set containing all this component's children. This is used to iterate - * through the children. - * - * TODO: This could be faster to iterate as a flat array stored on the root node. - */ - this.children = new Set(); - /** - * Options for the node. We use this to configure what kind of layout animations - * we should perform (if any). - */ - this.options = {}; - /** - * We use this to detect when its safe to shut down part of a projection tree. - * We have to keep projecting children for scale correction and relative projection - * until all their parents stop performing layout animations. - */ - this.isTreeAnimating = false; - this.isAnimationBlocked = false; - /** - * Flag to true if we think this layout has been changed. We can't always know this, - * currently we set it to true every time a component renders, or if it has a layoutDependency - * if that has changed between renders. Additionally, components can be grouped by LayoutGroup - * and if one node is dirtied, they all are. - */ - this.isLayoutDirty = false; - /** - * Flag to true if we think the projection calculations for this node needs - * recalculating as a result of an updated transform or layout animation. - */ - this.isProjectionDirty = false; - /** - * Flag to true if the layout *or* transform has changed. This then gets propagated - * throughout the projection tree, forcing any element below to recalculate on the next frame. - */ - this.isSharedProjectionDirty = false; - /** - * Flag transform dirty. This gets propagated throughout the whole tree but is only - * respected by shared nodes. - */ - this.isTransformDirty = false; - /** - * Block layout updates for instant layout transitions throughout the tree. - */ - this.updateManuallyBlocked = false; - this.updateBlockedByResize = false; - /** - * Set to true between the start of the first `willUpdate` call and the end of the `didUpdate` - * call. - */ - this.isUpdating = false; - /** - * If this is an SVG element we currently disable projection transforms - */ - this.isSVG = false; - /** - * Flag to true (during promotion) if a node doing an instant layout transition needs to reset - * its projection styles. - */ - this.needsReset = false; - /** - * Flags whether this node should have its transform reset prior to measuring. - */ - this.shouldResetTransform = false; - /** - * Store whether this node has been checked for optimised appear animations. As - * effects fire bottom-up, and we want to look up the tree for appear animations, - * this makes sure we only check each path once, stopping at nodes that - * have already been checked. - */ - this.hasCheckedOptimisedAppear = false; - /** - * An object representing the calculated contextual/accumulated/tree scale. - * This will be used to scale calculcated projection transforms, as these are - * calculated in screen-space but need to be scaled for elements to layoutly - * make it to their calculated destinations. - * - * TODO: Lazy-init - */ - this.treeScale = { x: 1, y: 1 }; - /** - * - */ - this.eventHandlers = new Map(); - this.hasTreeAnimated = false; - this.layoutVersion = 0; - // Note: Currently only running on root node - this.updateScheduled = false; - this.scheduleUpdate = () => this.update(); - this.projectionUpdateScheduled = false; - this.checkUpdateFailed = () => { - if (this.isUpdating) { - this.isUpdating = false; - this.clearAllSnapshots(); - } - }; - /** - * This is a multi-step process as shared nodes might be of different depths. Nodes - * are sorted by depth order, so we need to resolve the entire tree before moving to - * the next step. - */ - this.updateProjection = () => { - this.projectionUpdateScheduled = false; - /** - * Reset debug counts. Manually resetting rather than creating a new - * object each frame. - */ - if (statsBuffer.value) { - metrics.nodes = - metrics.calculatedTargetDeltas = - metrics.calculatedProjections = - 0; - } - this.nodes.forEach(propagateDirtyNodes); - this.nodes.forEach(resolveTargetDelta); - this.nodes.forEach(calcProjection); - this.nodes.forEach(cleanDirtyNodes); - if (statsBuffer.addProjectionMetrics) { - statsBuffer.addProjectionMetrics(metrics); - } - }; - /** - * Frame calculations - */ - this.resolvedRelativeTargetAt = 0.0; - this.linkedParentVersion = 0; - this.hasProjected = false; - this.isVisible = true; - this.animationProgress = 0; - /** - * Shared layout - */ - // TODO Only running on root node - this.sharedNodes = new Map(); - this.latestValues = latestValues; - this.root = parent ? parent.root || parent : this; - this.path = parent ? [...parent.path, parent] : []; - this.parent = parent; - this.depth = parent ? parent.depth + 1 : 0; - for (let i = 0; i < this.path.length; i++) { - this.path[i].shouldResetTransform = true; - } - if (this.root === this) - this.nodes = new FlatTree(); - } - addEventListener(name, handler) { - if (!this.eventHandlers.has(name)) { - this.eventHandlers.set(name, new motionUtils.SubscriptionManager()); - } - return this.eventHandlers.get(name).add(handler); - } - notifyListeners(name, ...args) { - const subscriptionManager = this.eventHandlers.get(name); - subscriptionManager && subscriptionManager.notify(...args); - } - hasListeners(name) { - return this.eventHandlers.has(name); - } - /** - * Lifecycles - */ - mount(instance) { - if (this.instance) - return; - this.isSVG = isSVGElement(instance) && !isSVGSVGElement(instance); - this.instance = instance; - const { layoutId, layout, visualElement } = this.options; - if (visualElement && !visualElement.current) { - visualElement.mount(instance); - } - this.root.nodes.add(this); - this.parent && this.parent.children.add(this); - if (this.root.hasTreeAnimated && (layout || layoutId)) { - this.isLayoutDirty = true; - } - if (attachResizeListener) { - let cancelDelay; - let innerWidth = 0; - const resizeUnblockUpdate = () => (this.root.updateBlockedByResize = false); - // Set initial innerWidth in a frame.read callback to batch the read - frame.read(() => { - innerWidth = window.innerWidth; - }); - attachResizeListener(instance, () => { - const newInnerWidth = window.innerWidth; - if (newInnerWidth === innerWidth) - return; - innerWidth = newInnerWidth; - this.root.updateBlockedByResize = true; - cancelDelay && cancelDelay(); - cancelDelay = delay(resizeUnblockUpdate, 250); - if (globalProjectionState.hasAnimatedSinceResize) { - globalProjectionState.hasAnimatedSinceResize = false; - this.nodes.forEach(finishAnimation); - } - }); - } - if (layoutId) { - this.root.registerSharedNode(layoutId, this); - } - // Only register the handler if it requires layout animation - if (this.options.animate !== false && - visualElement && - (layoutId || layout)) { - this.addEventListener("didUpdate", ({ delta, hasLayoutChanged, hasRelativeLayoutChanged, layout: newLayout, }) => { - if (this.isTreeAnimationBlocked()) { - this.target = undefined; - this.relativeTarget = undefined; - return; - } - // TODO: Check here if an animation exists - const layoutTransition = this.options.transition || - visualElement.getDefaultTransition() || - defaultLayoutTransition; - const { onLayoutAnimationStart, onLayoutAnimationComplete, } = visualElement.getProps(); - /** - * The target layout of the element might stay the same, - * but its position relative to its parent has changed. - */ - const hasTargetChanged = !this.targetLayout || - !boxEqualsRounded(this.targetLayout, newLayout); - /* - * Note: Disabled to fix relative animations always triggering new - * layout animations. If this causes further issues, we can try - * a different approach to detecting relative target changes. - */ - // || hasRelativeLayoutChanged - /** - * If the layout hasn't seemed to have changed, it might be that the - * element is visually in the same place in the document but its position - * relative to its parent has indeed changed. So here we check for that. - */ - const hasOnlyRelativeTargetChanged = !hasLayoutChanged && hasRelativeLayoutChanged; - if (this.options.layoutRoot || - this.resumeFrom || - hasOnlyRelativeTargetChanged || - (hasLayoutChanged && - (hasTargetChanged || !this.currentAnimation))) { - if (this.resumeFrom) { - this.resumingFrom = this.resumeFrom; - this.resumingFrom.resumingFrom = undefined; - } - const animationOptions = { - ...getValueTransition(layoutTransition, "layout"), - onPlay: onLayoutAnimationStart, - onComplete: onLayoutAnimationComplete, - }; - if (visualElement.shouldReduceMotion || - this.options.layoutRoot) { - animationOptions.delay = 0; - animationOptions.type = false; - } - this.startAnimation(animationOptions); - /** - * Set animation origin after starting animation to avoid layout jump - * caused by stopping previous layout animation - */ - this.setAnimationOrigin(delta, hasOnlyRelativeTargetChanged, animationOptions - .path); - } - else { - /** - * If the layout hasn't changed and we have an animation that hasn't started yet, - * finish it immediately. Otherwise it will be animating from a location - * that was probably never committed to screen and look like a jumpy box. - */ - if (!hasLayoutChanged) { - finishAnimation(this); - } - if (this.isLead() && this.options.onExitComplete) { - this.options.onExitComplete(); - } - } - this.targetLayout = newLayout; - }); - } - } - unmount() { - this.options.layoutId && this.willUpdate(); - this.root.nodes.remove(this); - const stack = this.getStack(); - stack && stack.remove(this); - this.parent && this.parent.children.delete(this); - this.instance = undefined; - this.eventHandlers.clear(); - cancelFrame(this.updateProjection); - } - // only on the root - blockUpdate() { - this.updateManuallyBlocked = true; - } - unblockUpdate() { - this.updateManuallyBlocked = false; - } - isUpdateBlocked() { - return this.updateManuallyBlocked || this.updateBlockedByResize; - } - isTreeAnimationBlocked() { - return (this.isAnimationBlocked || - (this.parent && this.parent.isTreeAnimationBlocked()) || - false); - } - // Note: currently only running on root node - startUpdate() { - if (this.isUpdateBlocked()) - return; - this.isUpdating = true; - this.nodes && this.nodes.forEach(resetSkewAndRotation); - this.animationId++; - } - getTransformTemplate() { - const { visualElement } = this.options; - return visualElement && visualElement.getProps().transformTemplate; - } - willUpdate(shouldNotifyListeners = true) { - this.root.hasTreeAnimated = true; - if (this.root.isUpdateBlocked()) { - this.options.onExitComplete && this.options.onExitComplete(); - return; - } - /** - * If we're running optimised appear animations then these must be - * cancelled before measuring the DOM. This is so we can measure - * the true layout of the element rather than the WAAPI animation - * which will be unaffected by the resetSkewAndRotate step. - * - * Note: This is a DOM write. Worst case scenario is this is sandwiched - * between other snapshot reads which will cause unnecessary style recalculations. - * This has to happen here though, as we don't yet know which nodes will need - * snapshots in startUpdate(), but we only want to cancel optimised animations - * if a layout animation measurement is actually going to be affected by them. - */ - if (window.MotionCancelOptimisedAnimation && - !this.hasCheckedOptimisedAppear) { - cancelTreeOptimisedTransformAnimations(this); - } - !this.root.isUpdating && this.root.startUpdate(); - if (this.isLayoutDirty) - return; - this.isLayoutDirty = true; - for (let i = 0; i < this.path.length; i++) { - const node = this.path[i]; - node.shouldResetTransform = true; - /** - * Percentage translates resolve against layoutBox dimensions, - * so ancestors with them must be re-measured after transform reset. - */ - if (typeof node.latestValues.x === "string" || - typeof node.latestValues.y === "string") { - node.isLayoutDirty = true; - } - node.updateScroll("snapshot"); - if (node.options.layoutRoot) { - node.willUpdate(false); - } - } - const { layoutId, layout } = this.options; - if (layoutId === undefined && !layout) - return; - const transformTemplate = this.getTransformTemplate(); - this.prevTransformTemplateValue = transformTemplate - ? transformTemplate(this.latestValues, "") - : undefined; - this.updateSnapshot(); - shouldNotifyListeners && this.notifyListeners("willUpdate"); - } - update() { - this.updateScheduled = false; - const updateWasBlocked = this.isUpdateBlocked(); - // When doing an instant transition, we skip the layout update, - // but should still clean up the measurements so that the next - // snapshot could be taken correctly. - if (updateWasBlocked) { - const wasBlockedByResize = this.updateBlockedByResize; - this.unblockUpdate(); - this.updateBlockedByResize = false; - this.clearAllSnapshots(); - /** - * When blocked by resize, still measure layouts so - * callbacks like onLayoutMeasure fire (e.g. Reorder). - * Skip notifyLayoutUpdate to prevent animations. - */ - if (wasBlockedByResize) { - this.nodes.forEach(forceLayoutMeasure); - } - this.nodes.forEach(clearMeasurements); - return; - } - /** - * If this is a repeat of didUpdate then ignore the animation. - */ - if (this.animationId <= this.animationCommitId) { - this.nodes.forEach(clearIsLayoutDirty); - return; - } - this.animationCommitId = this.animationId; - if (!this.isUpdating) { - this.nodes.forEach(clearIsLayoutDirty); - } - else { - this.isUpdating = false; - /** - * Ensure animation-blocked nodes (e.g. during drag) - * get measured even when memoized (willUpdate skipped). - */ - this.nodes.forEach(ensureDraggedNodesSnapshotted); - /** - * Write - */ - this.nodes.forEach(resetTransformStyle); - /** - * Read ================== - */ - // Update layout measurements of updated children - this.nodes.forEach(updateLayout); - /** - * Write - */ - // Notify listeners that the layout is updated - this.nodes.forEach(notifyLayoutUpdate); - } - this.clearAllSnapshots(); - /** - * Manually flush any pending updates. Ideally - * we could leave this to the following requestAnimationFrame but this seems - * to leave a flash of incorrectly styled content. - */ - const now = time.now(); - frameData.delta = motionUtils.clamp(0, 1000 / 60, now - frameData.timestamp); - frameData.timestamp = now; - frameData.isProcessing = true; - frameSteps.update.process(frameData); - frameSteps.preRender.process(frameData); - frameSteps.render.process(frameData); - frameData.isProcessing = false; - } - didUpdate() { - if (!this.updateScheduled) { - this.updateScheduled = true; - microtask.read(this.scheduleUpdate); - } - } - clearAllSnapshots() { - this.nodes.forEach(clearSnapshot); - this.sharedNodes.forEach(removeLeadSnapshots); - } - scheduleUpdateProjection() { - if (!this.projectionUpdateScheduled) { - this.projectionUpdateScheduled = true; - frame.preRender(this.updateProjection, false, true); - } - } - scheduleCheckAfterUnmount() { - /** - * If the unmounting node is in a layoutGroup and did trigger a willUpdate, - * we manually call didUpdate to give a chance to the siblings to animate. - * Otherwise, cleanup all snapshots to prevents future nodes from reusing them. - */ - frame.postRender(() => { - if (this.isLayoutDirty) { - this.root.didUpdate(); - } - else { - this.root.checkUpdateFailed(); - } - }); - } - /** - * Update measurements - */ - updateSnapshot() { - if (this.snapshot || !this.instance) - return; - this.snapshot = this.measure(); - if (this.snapshot && - !calcLength(this.snapshot.measuredBox.x) && - !calcLength(this.snapshot.measuredBox.y)) { - this.snapshot = undefined; - } - } - updateLayout() { - if (!this.instance) - return; - this.updateScroll(); - if (!(this.options.alwaysMeasureLayout && this.isLead()) && - !this.isLayoutDirty) { - return; - } - /** - * When a node is mounted, it simply resumes from the prevLead's - * snapshot instead of taking a new one, but the ancestors scroll - * might have updated while the prevLead is unmounted. We need to - * update the scroll again to make sure the layout we measure is - * up to date. - */ - if (this.resumeFrom && !this.resumeFrom.instance) { - for (let i = 0; i < this.path.length; i++) { - const node = this.path[i]; - node.updateScroll(); - } - } - const prevLayout = this.layout; - this.layout = this.measure(false); - this.layoutVersion++; - if (!this.layoutCorrected) - this.layoutCorrected = createBox(); - this.isLayoutDirty = false; - this.projectionDelta = undefined; - this.notifyListeners("measure", this.layout.layoutBox); - const { visualElement } = this.options; - visualElement && - visualElement.notify("LayoutMeasure", this.layout.layoutBox, prevLayout ? prevLayout.layoutBox : undefined); - } - updateScroll(phase = "measure") { - let needsMeasurement = Boolean(this.options.layoutScroll && this.instance); - if (this.scroll && - this.scroll.animationId === this.root.animationId && - this.scroll.phase === phase) { - needsMeasurement = false; - } - if (needsMeasurement && this.instance) { - const isRoot = checkIsScrollRoot(this.instance); - this.scroll = { - animationId: this.root.animationId, - phase, - isRoot, - offset: measureScroll(this.instance), - wasRoot: this.scroll ? this.scroll.isRoot : isRoot, - }; - } - } - resetTransform() { - if (!resetTransform) - return; - const isResetRequested = this.isLayoutDirty || - this.shouldResetTransform || - this.options.alwaysMeasureLayout; - const hasProjection = this.projectionDelta && !isDeltaZero(this.projectionDelta); - const transformTemplate = this.getTransformTemplate(); - const transformTemplateValue = transformTemplate - ? transformTemplate(this.latestValues, "") - : undefined; - const transformTemplateHasChanged = transformTemplateValue !== this.prevTransformTemplateValue; - if (isResetRequested && - this.instance && - (hasProjection || - hasTransform(this.latestValues) || - transformTemplateHasChanged)) { - resetTransform(this.instance, transformTemplateValue); - this.shouldResetTransform = false; - this.scheduleRender(); - } - } - measure(removeTransform = true) { - const pageBox = this.measurePageBox(); - let layoutBox = this.removeElementScroll(pageBox); - /** - * Measurements taken during the pre-render stage - * still have transforms applied so we remove them - * via calculation. - */ - if (removeTransform) { - layoutBox = this.removeTransform(layoutBox); - } - roundBox(layoutBox); - return { - animationId: this.root.animationId, - measuredBox: pageBox, - layoutBox, - latestValues: {}, - source: this.id, - }; - } - measurePageBox() { - const { visualElement } = this.options; - if (!visualElement) - return createBox(); - const box = visualElement.measureViewportBox(); - const wasInScrollRoot = this.scroll?.wasRoot || this.path.some(checkNodeWasScrollRoot); - if (!wasInScrollRoot) { - // Remove viewport scroll to give page-relative coordinates - const { scroll } = this.root; - if (scroll) { - translateAxis(box.x, scroll.offset.x); - translateAxis(box.y, scroll.offset.y); - } - } - return box; - } - removeElementScroll(box) { - const boxWithoutScroll = createBox(); - copyBoxInto(boxWithoutScroll, box); - if (this.scroll?.wasRoot) { - return boxWithoutScroll; - } - /** - * Performance TODO: Keep a cumulative scroll offset down the tree - * rather than loop back up the path. - */ - for (let i = 0; i < this.path.length; i++) { - const node = this.path[i]; - const { scroll, options } = node; - if (node !== this.root && scroll && options.layoutScroll) { - /** - * If this is a new scroll root, we want to remove all previous scrolls - * from the viewport box. - */ - if (scroll.wasRoot) { - copyBoxInto(boxWithoutScroll, box); - } - translateAxis(boxWithoutScroll.x, scroll.offset.x); - translateAxis(boxWithoutScroll.y, scroll.offset.y); - } - } - return boxWithoutScroll; - } - applyTransform(box, transformOnly = false, output) { - const withTransforms = output || createBox(); - copyBoxInto(withTransforms, box); - for (let i = 0; i < this.path.length; i++) { - const node = this.path[i]; - if (!transformOnly && - node.options.layoutScroll && - node.scroll && - node !== node.root) { - translateAxis(withTransforms.x, -node.scroll.offset.x); - translateAxis(withTransforms.y, -node.scroll.offset.y); - } - if (!hasTransform(node.latestValues)) - continue; - transformBox(withTransforms, node.latestValues, node.layout?.layoutBox); - } - if (hasTransform(this.latestValues)) { - transformBox(withTransforms, this.latestValues, this.layout?.layoutBox); - } - return withTransforms; - } - removeTransform(box) { - const boxWithoutTransform = createBox(); - copyBoxInto(boxWithoutTransform, box); - for (let i = 0; i < this.path.length; i++) { - const node = this.path[i]; - if (!hasTransform(node.latestValues)) - continue; - let sourceBox; - if (node.instance) { - hasScale(node.latestValues) && node.updateSnapshot(); - sourceBox = createBox(); - copyBoxInto(sourceBox, node.measurePageBox()); - } - removeBoxTransforms(boxWithoutTransform, node.latestValues, node.snapshot?.layoutBox, sourceBox); - } - if (hasTransform(this.latestValues)) { - removeBoxTransforms(boxWithoutTransform, this.latestValues); - } - return boxWithoutTransform; - } - setTargetDelta(delta) { - this.targetDelta = delta; - this.root.scheduleUpdateProjection(); - this.isProjectionDirty = true; - } - setOptions(options) { - this.options = { - ...this.options, - ...options, - crossfade: options.crossfade !== undefined ? options.crossfade : true, - }; - } - clearMeasurements() { - this.scroll = undefined; - this.layout = undefined; - this.snapshot = undefined; - this.prevTransformTemplateValue = undefined; - this.targetDelta = undefined; - this.target = undefined; - this.isLayoutDirty = false; - } - forceRelativeParentToResolveTarget() { - if (!this.relativeParent) - return; - /** - * If the parent target isn't up-to-date, force it to update. - * This is an unfortunate de-optimisation as it means any updating relative - * projection will cause all the relative parents to recalculate back - * up the tree. - */ - if (this.relativeParent.resolvedRelativeTargetAt !== - frameData.timestamp) { - this.relativeParent.resolveTargetDelta(true); - } - } - resolveTargetDelta(forceRecalculation = false) { - /** - * Once the dirty status of nodes has been spread through the tree, we also - * need to check if we have a shared node of a different depth that has itself - * been dirtied. - */ - const lead = this.getLead(); - this.isProjectionDirty || (this.isProjectionDirty = lead.isProjectionDirty); - this.isTransformDirty || (this.isTransformDirty = lead.isTransformDirty); - this.isSharedProjectionDirty || (this.isSharedProjectionDirty = lead.isSharedProjectionDirty); - const isShared = Boolean(this.resumingFrom) || this !== lead; - /** - * We don't use transform for this step of processing so we don't - * need to check whether any nodes have changed transform. - */ - const canSkip = !(forceRecalculation || - (isShared && this.isSharedProjectionDirty) || - this.isProjectionDirty || - this.parent?.isProjectionDirty || - this.attemptToResolveRelativeTarget || - this.root.updateBlockedByResize); - if (canSkip) - return; - const { layout, layoutId } = this.options; - /** - * If we have no layout, we can't perform projection, so early return - */ - if (!this.layout || !(layout || layoutId)) - return; - this.resolvedRelativeTargetAt = frameData.timestamp; - const relativeParent = this.getClosestProjectingParent(); - if (relativeParent && - this.linkedParentVersion !== relativeParent.layoutVersion && - !relativeParent.options.layoutRoot) { - this.removeRelativeTarget(); - } - /** - * If we don't have a targetDelta but do have a layout, we can attempt to resolve - * a relativeParent. This will allow a component to perform scale correction - * even if no animation has started. - */ - if (!this.targetDelta && !this.relativeTarget) { - if (this.options.layoutAnchor !== false && - relativeParent && - relativeParent.layout) { - this.createRelativeTarget(relativeParent, this.layout.layoutBox, relativeParent.layout.layoutBox); - } - else { - this.removeRelativeTarget(); - } - } - /** - * If we have no relative target or no target delta our target isn't valid - * for this frame. - */ - if (!this.relativeTarget && !this.targetDelta) - return; - /** - * Lazy-init target data structure - */ - if (!this.target) { - this.target = createBox(); - this.targetWithTransforms = createBox(); - } - /** - * If we've got a relative box for this component, resolve it into a target relative to the parent. - */ - if (this.relativeTarget && - this.relativeTargetOrigin && - this.relativeParent && - this.relativeParent.target) { - this.forceRelativeParentToResolveTarget(); - calcRelativeBox(this.target, this.relativeTarget, this.relativeParent.target, this.options.layoutAnchor || undefined); - /** - * If we've only got a targetDelta, resolve it into a target - */ - } - else if (this.targetDelta) { - if (Boolean(this.resumingFrom)) { - this.applyTransform(this.layout.layoutBox, false, this.target); - } - else { - copyBoxInto(this.target, this.layout.layoutBox); - } - applyBoxDelta(this.target, this.targetDelta); - } - else { - /** - * If no target, use own layout as target - */ - copyBoxInto(this.target, this.layout.layoutBox); - } - /** - * If we've been told to attempt to resolve a relative target, do so. - */ - if (this.attemptToResolveRelativeTarget) { - this.attemptToResolveRelativeTarget = false; - if (this.options.layoutAnchor !== false && - relativeParent && - Boolean(relativeParent.resumingFrom) === - Boolean(this.resumingFrom) && - !relativeParent.options.layoutScroll && - relativeParent.target && - this.animationProgress !== 1) { - this.createRelativeTarget(relativeParent, this.target, relativeParent.target); - } - else { - this.relativeParent = this.relativeTarget = undefined; - } - } - /** - * Increase debug counter for resolved target deltas - */ - if (statsBuffer.value) { - metrics.calculatedTargetDeltas++; - } - } - getClosestProjectingParent() { - if (!this.parent || - hasScale(this.parent.latestValues) || - has2DTranslate(this.parent.latestValues)) { - return undefined; - } - if (this.parent.isProjecting()) { - return this.parent; - } - else { - return this.parent.getClosestProjectingParent(); - } - } - isProjecting() { - return Boolean((this.relativeTarget || - this.targetDelta || - this.options.layoutRoot) && - this.layout); - } - createRelativeTarget(relativeParent, layout, parentLayout) { - this.relativeParent = relativeParent; - this.linkedParentVersion = relativeParent.layoutVersion; - this.forceRelativeParentToResolveTarget(); - this.relativeTarget = createBox(); - this.relativeTargetOrigin = createBox(); - calcRelativePosition(this.relativeTargetOrigin, layout, parentLayout, this.options.layoutAnchor || undefined); - copyBoxInto(this.relativeTarget, this.relativeTargetOrigin); - } - removeRelativeTarget() { - this.relativeParent = this.relativeTarget = undefined; - } - calcProjection() { - const lead = this.getLead(); - const isShared = Boolean(this.resumingFrom) || this !== lead; - let canSkip = true; - /** - * If this is a normal layout animation and neither this node nor its nearest projecting - * is dirty then we can't skip. - */ - if (this.isProjectionDirty || this.parent?.isProjectionDirty) { - canSkip = false; - } - /** - * If this is a shared layout animation and this node's shared projection is dirty then - * we can't skip. - */ - if (isShared && - (this.isSharedProjectionDirty || this.isTransformDirty)) { - canSkip = false; - } - /** - * If we have resolved the target this frame we must recalculate the - * projection to ensure it visually represents the internal calculations. - */ - if (this.resolvedRelativeTargetAt === frameData.timestamp) { - canSkip = false; - } - if (canSkip) - return; - const { layout, layoutId } = this.options; - /** - * If this section of the tree isn't animating we can - * delete our target sources for the following frame. - */ - this.isTreeAnimating = Boolean((this.parent && this.parent.isTreeAnimating) || - this.currentAnimation || - this.pendingAnimation); - if (!this.isTreeAnimating) { - this.targetDelta = this.relativeTarget = undefined; - } - if (!this.layout || !(layout || layoutId)) - return; - /** - * Reset the corrected box with the latest values from box, as we're then going - * to perform mutative operations on it. - */ - copyBoxInto(this.layoutCorrected, this.layout.layoutBox); - /** - * Record previous tree scales before updating. - */ - const prevTreeScaleX = this.treeScale.x; - const prevTreeScaleY = this.treeScale.y; - /** - * Apply all the parent deltas to this box to produce the corrected box. This - * is the layout box, as it will appear on screen as a result of the transforms of its parents. - */ - applyTreeDeltas(this.layoutCorrected, this.treeScale, this.path, isShared); - /** - * If this layer needs to perform scale correction but doesn't have a target, - * use the layout as the target. - */ - if (lead.layout && - !lead.target && - (this.treeScale.x !== 1 || this.treeScale.y !== 1)) { - lead.target = lead.layout.layoutBox; - lead.targetWithTransforms = createBox(); - } - const { target } = lead; - if (!target) { - /** - * If we don't have a target to project into, but we were previously - * projecting, we want to remove the stored transform and schedule - * a render to ensure the elements reflect the removed transform. - */ - if (this.prevProjectionDelta) { - this.createProjectionDeltas(); - this.scheduleRender(); - } - return; - } - if (!this.projectionDelta || !this.prevProjectionDelta) { - this.createProjectionDeltas(); - } - else { - copyAxisDeltaInto(this.prevProjectionDelta.x, this.projectionDelta.x); - copyAxisDeltaInto(this.prevProjectionDelta.y, this.projectionDelta.y); - } - /** - * Update the delta between the corrected box and the target box before user-set transforms were applied. - * This will allow us to calculate the corrected borderRadius and boxShadow to compensate - * for our layout reprojection, but still allow them to be scaled correctly by the user. - * It might be that to simplify this we may want to accept that user-set scale is also corrected - * and we wouldn't have to keep and calc both deltas, OR we could support a user setting - * to allow people to choose whether these styles are corrected based on just the - * layout reprojection or the final bounding box. - */ - calcBoxDelta(this.projectionDelta, this.layoutCorrected, target, this.latestValues); - if (this.treeScale.x !== prevTreeScaleX || - this.treeScale.y !== prevTreeScaleY || - !axisDeltaEquals(this.projectionDelta.x, this.prevProjectionDelta.x) || - !axisDeltaEquals(this.projectionDelta.y, this.prevProjectionDelta.y)) { - this.hasProjected = true; - this.scheduleRender(); - this.notifyListeners("projectionUpdate", target); - } - /** - * Increase debug counter for recalculated projections - */ - if (statsBuffer.value) { - metrics.calculatedProjections++; - } - } - hide() { - this.isVisible = false; - // TODO: Schedule render - } - show() { - this.isVisible = true; - // TODO: Schedule render - } - scheduleRender(notifyAll = true) { - this.options.visualElement?.scheduleRender(); - if (notifyAll) { - const stack = this.getStack(); - stack && stack.scheduleRender(); - } - if (this.resumingFrom && !this.resumingFrom.instance) { - this.resumingFrom = undefined; - } - } - createProjectionDeltas() { - this.prevProjectionDelta = createDelta(); - this.projectionDelta = createDelta(); - this.projectionDeltaWithTransform = createDelta(); - } - setAnimationOrigin(delta, hasOnlyRelativeTargetChanged = false, pathFn) { - const snapshot = this.snapshot; - const snapshotLatestValues = snapshot ? snapshot.latestValues : {}; - const mixedValues = { ...this.latestValues }; - const targetDelta = createDelta(); - if (!this.relativeParent || - !this.relativeParent.options.layoutRoot) { - this.relativeTarget = this.relativeTargetOrigin = undefined; - } - this.attemptToResolveRelativeTarget = !hasOnlyRelativeTargetChanged; - const relativeLayout = createBox(); - const snapshotSource = snapshot ? snapshot.source : undefined; - const layoutSource = this.layout ? this.layout.source : undefined; - const isSharedLayoutAnimation = snapshotSource !== layoutSource; - const stack = this.getStack(); - const isOnlyMember = !stack || stack.members.length <= 1; - const shouldCrossfadeOpacity = Boolean(isSharedLayoutAnimation && - !isOnlyMember && - this.options.crossfade === true && - !this.path.some(hasOpacityCrossfade)); - this.animationProgress = 0; - let prevRelativeTarget; - // The path decides whether the layout shift is worth curving - // (distance floor) and resolves the interpolator from the delta. - const interpolate = pathFn?.interpolateProjection(delta); - this.mixTargetDelta = (latest) => { - const progress = latest / 1000; - const point = interpolate?.(progress); - if (point) { - targetDelta.x.translate = point.x; - targetDelta.x.scale = mixNumber$1(delta.x.scale, 1, progress); - targetDelta.x.origin = delta.x.origin; - targetDelta.x.originPoint = delta.x.originPoint; - targetDelta.y.translate = point.y; - targetDelta.y.scale = mixNumber$1(delta.y.scale, 1, progress); - targetDelta.y.origin = delta.y.origin; - targetDelta.y.originPoint = delta.y.originPoint; - } - else { - mixAxisDeltaLinear(targetDelta.x, delta.x, progress); - mixAxisDeltaLinear(targetDelta.y, delta.y, progress); - } - this.setTargetDelta(targetDelta); - if (this.relativeTarget && - this.relativeTargetOrigin && - this.layout && - this.relativeParent && - this.relativeParent.layout) { - calcRelativePosition(relativeLayout, this.layout.layoutBox, this.relativeParent.layout.layoutBox, this.options.layoutAnchor || undefined); - mixBox(this.relativeTarget, this.relativeTargetOrigin, relativeLayout, progress); - /** - * If this is an unchanged relative target we can consider the - * projection not dirty. - */ - if (prevRelativeTarget && - boxEquals(this.relativeTarget, prevRelativeTarget)) { - this.isProjectionDirty = false; - } - if (!prevRelativeTarget) - prevRelativeTarget = createBox(); - copyBoxInto(prevRelativeTarget, this.relativeTarget); - } - if (isSharedLayoutAnimation) { - this.animationValues = mixedValues; - mixValues(mixedValues, snapshotLatestValues, this.latestValues, progress, shouldCrossfadeOpacity, isOnlyMember); - } - if (point && point.rotate !== undefined) { - // Dedicated `pathRotation` channel, not `rotate`, so an - // animating `rotate` is composed with, never clobbered. - if (!this.animationValues) - this.animationValues = mixedValues; - this.animationValues.pathRotation = point.rotate; - } - this.root.scheduleUpdateProjection(); - this.scheduleRender(); - this.animationProgress = progress; - }; - this.mixTargetDelta(this.options.layoutRoot ? 1000 : 0); - } - startAnimation(options) { - this.notifyListeners("animationStart"); - this.currentAnimation?.stop(); - this.resumingFrom?.currentAnimation?.stop(); - if (this.pendingAnimation) { - cancelFrame(this.pendingAnimation); - this.pendingAnimation = undefined; - } - /** - * Start the animation in the next frame to have a frame with progress 0, - * where the target is the same as when the animation started, so we can - * calculate the relative positions correctly for instant transitions. - */ - this.pendingAnimation = frame.update(() => { - globalProjectionState.hasAnimatedSinceResize = true; - this.motionValue || (this.motionValue = motionValue(0)); - this.motionValue.jump(0, false); - this.currentAnimation = animateSingleValue(this.motionValue, [0, 1000], { - ...options, - velocity: 0, - isSync: true, - onUpdate: (latest) => { - this.mixTargetDelta(latest); - options.onUpdate && options.onUpdate(latest); - }, - onComplete: () => { - options.onComplete && options.onComplete(); - this.completeAnimation(); - }, - }); - if (this.resumingFrom) { - this.resumingFrom.currentAnimation = this.currentAnimation; - } - this.pendingAnimation = undefined; - }); - } - completeAnimation() { - if (this.resumingFrom) { - this.resumingFrom.currentAnimation = undefined; - this.resumingFrom.preserveOpacity = undefined; - } - const stack = this.getStack(); - stack && stack.exitAnimationComplete(); - this.resumingFrom = - this.currentAnimation = - this.animationValues = - undefined; - this.notifyListeners("animationComplete"); - } - finishAnimation() { - if (this.currentAnimation) { - this.mixTargetDelta && this.mixTargetDelta(animationTarget); - this.currentAnimation.stop(); - } - this.completeAnimation(); - } - applyTransformsToTarget() { - const lead = this.getLead(); - let { targetWithTransforms, target, layout, latestValues } = lead; - if (!targetWithTransforms || !target || !layout) - return; - /** - * If we're only animating position, and this element isn't the lead element, - * then instead of projecting into the lead box we instead want to calculate - * a new target that aligns the two boxes but maintains the layout shape. - */ - if (this !== lead && - this.layout && - layout && - shouldAnimatePositionOnly(this.options.animationType, this.layout.layoutBox, layout.layoutBox)) { - target = this.target || createBox(); - const xLength = calcLength(this.layout.layoutBox.x); - target.x.min = lead.target.x.min; - target.x.max = target.x.min + xLength; - const yLength = calcLength(this.layout.layoutBox.y); - target.y.min = lead.target.y.min; - target.y.max = target.y.min + yLength; - } - copyBoxInto(targetWithTransforms, target); - /** - * Apply the latest user-set transforms to the targetBox to produce the targetBoxFinal. - * This is the final box that we will then project into by calculating a transform delta and - * applying it to the corrected box. - */ - transformBox(targetWithTransforms, latestValues); - /** - * Update the delta between the corrected box and the final target box, after - * user-set transforms are applied to it. This will be used by the renderer to - * create a transform style that will reproject the element from its layout layout - * into the desired bounding box. - */ - calcBoxDelta(this.projectionDeltaWithTransform, this.layoutCorrected, targetWithTransforms, latestValues); - } - registerSharedNode(layoutId, node) { - if (!this.sharedNodes.has(layoutId)) { - this.sharedNodes.set(layoutId, new NodeStack()); - } - const stack = this.sharedNodes.get(layoutId); - stack.add(node); - const config = node.options.initialPromotionConfig; - node.promote({ - transition: config ? config.transition : undefined, - preserveFollowOpacity: config && config.shouldPreserveFollowOpacity - ? config.shouldPreserveFollowOpacity(node) - : undefined, - }); - } - isLead() { - const stack = this.getStack(); - return stack ? stack.lead === this : true; - } - getLead() { - const { layoutId } = this.options; - return layoutId ? this.getStack()?.lead || this : this; - } - getPrevLead() { - const { layoutId } = this.options; - return layoutId ? this.getStack()?.prevLead : undefined; - } - getStack() { - const { layoutId } = this.options; - if (layoutId) - return this.root.sharedNodes.get(layoutId); - } - promote({ needsReset, transition, preserveFollowOpacity, } = {}) { - const stack = this.getStack(); - if (stack) - stack.promote(this, preserveFollowOpacity); - if (needsReset) { - this.projectionDelta = undefined; - this.needsReset = true; - } - if (transition) - this.setOptions({ transition }); - } - relegate() { - const stack = this.getStack(); - if (stack) { - return stack.relegate(this); - } - else { - return false; - } - } - resetSkewAndRotation() { - const { visualElement } = this.options; - if (!visualElement) - return; - // If there's no detected skew or rotation values, we can early return without a forced render. - let hasDistortingTransform = false; - /** - * An unrolled check for rotation values. Most elements don't have any rotation and - * skipping the nested loop and new object creation is 50% faster. - */ - const { latestValues } = visualElement; - if (latestValues.z || - latestValues.rotate || - latestValues.rotateX || - latestValues.rotateY || - latestValues.rotateZ || - latestValues.skewX || - latestValues.skewY) { - hasDistortingTransform = true; - } - // If there's no distorting values, we don't need to do any more. - if (!hasDistortingTransform) - return; - const resetValues = {}; - if (latestValues.z) { - resetDistortingTransform("z", visualElement, resetValues, this.animationValues); - } - // Check the skew and rotate value of all axes and reset to 0 - for (let i = 0; i < transformAxes.length; i++) { - resetDistortingTransform(`rotate${transformAxes[i]}`, visualElement, resetValues, this.animationValues); - resetDistortingTransform(`skew${transformAxes[i]}`, visualElement, resetValues, this.animationValues); - } - // Force a render of this element to apply the transform with all skews and rotations - // set to 0. - visualElement.render(); - // Put back all the values we reset - for (const key in resetValues) { - visualElement.setStaticValue(key, resetValues[key]); - if (this.animationValues) { - this.animationValues[key] = resetValues[key]; - } - } - // Schedule a render for the next frame. This ensures we won't visually - // see the element with the reset rotate value applied. - visualElement.scheduleRender(); - } - applyProjectionStyles(targetStyle, // CSSStyleDeclaration - doesn't allow numbers to be assigned to properties - styleProp) { - if (!this.instance || this.isSVG) - return; - if (!this.isVisible) { - targetStyle.visibility = "hidden"; - return; - } - const transformTemplate = this.getTransformTemplate(); - if (this.needsReset) { - this.needsReset = false; - targetStyle.visibility = ""; - targetStyle.opacity = ""; - targetStyle.pointerEvents = - resolveMotionValue(styleProp?.pointerEvents) || ""; - targetStyle.transform = transformTemplate - ? transformTemplate(this.latestValues, "") - : "none"; - return; - } - const lead = this.getLead(); - if (!this.projectionDelta || !this.layout || !lead.target) { - if (this.options.layoutId) { - targetStyle.opacity = - this.latestValues.opacity !== undefined - ? this.latestValues.opacity - : 1; - targetStyle.pointerEvents = - resolveMotionValue(styleProp?.pointerEvents) || ""; - } - if (this.hasProjected && !hasTransform(this.latestValues)) { - targetStyle.transform = transformTemplate - ? transformTemplate({}, "") - : "none"; - this.hasProjected = false; - } - return; - } - targetStyle.visibility = ""; - const valuesToRender = lead.animationValues || lead.latestValues; - this.applyTransformsToTarget(); - let transform = buildProjectionTransform(this.projectionDeltaWithTransform, this.treeScale, valuesToRender); - if (transformTemplate) { - transform = transformTemplate(valuesToRender, transform); - } - targetStyle.transform = transform; - const { x, y } = this.projectionDelta; - targetStyle.transformOrigin = `${x.origin * 100}% ${y.origin * 100}% 0`; - if (lead.animationValues) { - /** - * If the lead component is animating, assign this either the entering/leaving - * opacity - */ - targetStyle.opacity = - lead === this - ? valuesToRender.opacity ?? - this.latestValues.opacity ?? - 1 - : this.preserveOpacity - ? this.latestValues.opacity - : valuesToRender.opacityExit; - } - else { - /** - * Or we're not animating at all, set the lead component to its layout - * opacity and other components to hidden. - */ - targetStyle.opacity = - lead === this - ? valuesToRender.opacity !== undefined - ? valuesToRender.opacity - : "" - : valuesToRender.opacityExit !== undefined - ? valuesToRender.opacityExit - : 0; - } - /** - * Apply scale correction - */ - for (const key in scaleCorrectors) { - if (valuesToRender[key] === undefined) - continue; - const { correct, applyTo, isCSSVariable } = scaleCorrectors[key]; - /** - * Only apply scale correction to the value if we have an - * active projection transform. Otherwise these values become - * vulnerable to distortion if the element changes size without - * a corresponding layout animation. - */ - const corrected = transform === "none" - ? valuesToRender[key] - : correct(valuesToRender[key], lead); - if (applyTo) { - const num = applyTo.length; - for (let i = 0; i < num; i++) { - targetStyle[applyTo[i]] = corrected; - } - } - else { - // If this is a CSS variable, set it directly on the instance. - // Replacing this function from creating styles to setting them - // would be a good place to remove per frame object creation - if (isCSSVariable) { - this.options.visualElement.renderState.vars[key] = corrected; - } - else { - targetStyle[key] = corrected; - } - } - } - /** - * Disable pointer events on follow components. This is to ensure - * that if a follow component covers a lead component it doesn't block - * pointer events on the lead. - */ - if (this.options.layoutId) { - targetStyle.pointerEvents = - lead === this - ? resolveMotionValue(styleProp?.pointerEvents) || "" - : "none"; - } - } - clearSnapshot() { - this.resumeFrom = this.snapshot = undefined; - } - // Only run on root - resetTree() { - this.root.nodes.forEach((node) => node.currentAnimation?.stop()); - this.root.nodes.forEach(clearMeasurements); - this.root.sharedNodes.clear(); - } - }; - } - function updateLayout(node) { - node.updateLayout(); - } - function notifyLayoutUpdate(node) { - const snapshot = node.resumeFrom?.snapshot || node.snapshot; - if (node.isLead() && - node.layout && - snapshot && - node.hasListeners("didUpdate")) { - const { layoutBox: layout, measuredBox: measuredLayout } = node.layout; - const { animationType } = node.options; - const isShared = snapshot.source !== node.layout.source; - // TODO Maybe we want to also resize the layout snapshot so we don't trigger - // animations for instance if layout="size" and an element has only changed position - if (animationType === "size") { - eachAxis((axis) => { - const axisSnapshot = isShared - ? snapshot.measuredBox[axis] - : snapshot.layoutBox[axis]; - const length = calcLength(axisSnapshot); - axisSnapshot.min = layout[axis].min; - axisSnapshot.max = axisSnapshot.min + length; - }); - } - else if (animationType === "x" || animationType === "y") { - const snapAxis = animationType === "x" ? "y" : "x"; - copyAxisInto(isShared - ? snapshot.measuredBox[snapAxis] - : snapshot.layoutBox[snapAxis], layout[snapAxis]); - } - else if (shouldAnimatePositionOnly(animationType, snapshot.layoutBox, layout)) { - eachAxis((axis) => { - const axisSnapshot = isShared - ? snapshot.measuredBox[axis] - : snapshot.layoutBox[axis]; - const length = calcLength(layout[axis]); - axisSnapshot.max = axisSnapshot.min + length; - /** - * Ensure relative target gets resized and rerendererd - */ - if (node.relativeTarget && !node.currentAnimation) { - node.isProjectionDirty = true; - node.relativeTarget[axis].max = - node.relativeTarget[axis].min + length; - } - }); - } - const layoutDelta = createDelta(); - calcBoxDelta(layoutDelta, layout, snapshot.layoutBox); - const visualDelta = createDelta(); - if (isShared) { - calcBoxDelta(visualDelta, node.applyTransform(measuredLayout, true), snapshot.measuredBox); - } - else { - calcBoxDelta(visualDelta, layout, snapshot.layoutBox); - } - const hasLayoutChanged = !isDeltaZero(layoutDelta); - let hasRelativeLayoutChanged = false; - if (!node.resumeFrom) { - const relativeParent = node.getClosestProjectingParent(); - /** - * If the relativeParent is itself resuming from a different element then - * the relative snapshot is not relavent - */ - if (relativeParent && !relativeParent.resumeFrom) { - const { snapshot: parentSnapshot, layout: parentLayout } = relativeParent; - if (parentSnapshot && parentLayout) { - const anchor = node.options.layoutAnchor || undefined; - const relativeSnapshot = createBox(); - calcRelativePosition(relativeSnapshot, snapshot.layoutBox, parentSnapshot.layoutBox, anchor); - const relativeLayout = createBox(); - calcRelativePosition(relativeLayout, layout, parentLayout.layoutBox, anchor); - if (!boxEqualsRounded(relativeSnapshot, relativeLayout)) { - hasRelativeLayoutChanged = true; - } - if (relativeParent.options.layoutRoot) { - node.relativeTarget = relativeLayout; - node.relativeTargetOrigin = relativeSnapshot; - node.relativeParent = relativeParent; - } - } - } - } - node.notifyListeners("didUpdate", { - layout, - snapshot, - delta: visualDelta, - layoutDelta, - hasLayoutChanged, - hasRelativeLayoutChanged, - }); - } - else if (node.isLead()) { - const { onExitComplete } = node.options; - onExitComplete && onExitComplete(); - } - /** - * Clearing transition - * TODO: Investigate why this transition is being passed in as {type: false } from Framer - * and why we need it at all - */ - node.options.transition = undefined; - } - function propagateDirtyNodes(node) { - /** - * Increase debug counter for nodes encountered this frame - */ - if (statsBuffer.value) { - metrics.nodes++; - } - if (!node.parent) - return; - /** - * If this node isn't projecting, propagate isProjectionDirty. It will have - * no performance impact but it will allow the next child that *is* projecting - * but *isn't* dirty to just check its parent to see if *any* ancestor needs - * correcting. - */ - if (!node.isProjecting()) { - node.isProjectionDirty = node.parent.isProjectionDirty; - } - /** - * Propagate isSharedProjectionDirty and isTransformDirty - * throughout the whole tree. A future revision can take another look at - * this but for safety we still recalcualte shared nodes. - */ - node.isSharedProjectionDirty || (node.isSharedProjectionDirty = Boolean(node.isProjectionDirty || - node.parent.isProjectionDirty || - node.parent.isSharedProjectionDirty)); - node.isTransformDirty || (node.isTransformDirty = node.parent.isTransformDirty); - } - function cleanDirtyNodes(node) { - node.isProjectionDirty = - node.isSharedProjectionDirty = - node.isTransformDirty = - false; - } - function clearSnapshot(node) { - node.clearSnapshot(); - } - function clearMeasurements(node) { - node.clearMeasurements(); - } - function forceLayoutMeasure(node) { - node.isLayoutDirty = true; - node.updateLayout(); - } - function clearIsLayoutDirty(node) { - node.isLayoutDirty = false; - } - /** - * When a node is animation-blocked (e.g. during drag) and its component - * didn't re-render (memoized), willUpdate() is never called so there's - * no snapshot. Use the previous layout as a snapshot and mark dirty so - * resetTransform/updateLayout/notifyLayoutUpdate process it normally. - */ - function ensureDraggedNodesSnapshotted(node) { - if (node.isAnimationBlocked && node.layout && !node.isLayoutDirty) { - node.snapshot = node.layout; - node.isLayoutDirty = true; - } - } - function resetTransformStyle(node) { - const { visualElement } = node.options; - if (visualElement && visualElement.getProps().onBeforeLayoutMeasure) { - visualElement.notify("BeforeLayoutMeasure"); - } - node.resetTransform(); - } - function finishAnimation(node) { - node.finishAnimation(); - node.targetDelta = node.relativeTarget = node.target = undefined; - node.isProjectionDirty = true; - } - function resolveTargetDelta(node) { - node.resolveTargetDelta(); - } - function calcProjection(node) { - node.calcProjection(); - } - function resetSkewAndRotation(node) { - node.resetSkewAndRotation(); - } - function removeLeadSnapshots(stack) { - stack.removeLeadSnapshot(); - } - function mixAxisDeltaLinear(output, delta, p) { - output.translate = mixNumber$1(delta.translate, 0, p); - output.scale = mixNumber$1(delta.scale, 1, p); - output.origin = delta.origin; - output.originPoint = delta.originPoint; - } - function mixAxis(output, from, to, p) { - output.min = mixNumber$1(from.min, to.min, p); - output.max = mixNumber$1(from.max, to.max, p); - } - function mixBox(output, from, to, p) { - mixAxis(output.x, from.x, to.x, p); - mixAxis(output.y, from.y, to.y, p); - } - function hasOpacityCrossfade(node) { - return (node.animationValues && node.animationValues.opacityExit !== undefined); - } - const defaultLayoutTransition = { - duration: 0.45, - ease: [0.4, 0, 0.1, 1], - }; - const userAgentContains = (string) => typeof navigator !== "undefined" && - navigator.userAgent && - navigator.userAgent.toLowerCase().includes(string); - /** - * Measured bounding boxes must be rounded in Safari and - * left untouched in Chrome, otherwise non-integer layouts within scaled-up elements - * can appear to jump. - */ - const roundPoint = userAgentContains("applewebkit/") && !userAgentContains("chrome/") - ? Math.round - : motionUtils.noop; - function roundAxis(axis) { - // Round to the nearest .5 pixels to support subpixel layouts - axis.min = roundPoint(axis.min); - axis.max = roundPoint(axis.max); - } - function roundBox(box) { - roundAxis(box.x); - roundAxis(box.y); - } - function shouldAnimatePositionOnly(animationType, snapshot, layout) { - return (animationType === "position" || - (animationType === "preserve-aspect" && - !isNear(aspectRatio(snapshot), aspectRatio(layout), 0.2))); - } - function checkNodeWasScrollRoot(node) { - return node !== node.root && node.scroll?.wasRoot; - } - - const DocumentProjectionNode = createProjectionNode({ - attachResizeListener: (ref, notify) => addDomEvent(ref, "resize", notify), - measureScroll: () => ({ - x: document.documentElement.scrollLeft || document.body?.scrollLeft || 0, - y: document.documentElement.scrollTop || document.body?.scrollTop || 0, - }), - checkIsScrollRoot: () => true, - }); - - const notify = (node) => !node.isLayoutDirty && node.willUpdate(false); - function nodeGroup() { - const nodes = new Set(); - const subscriptions = new WeakMap(); - const dirtyAll = () => nodes.forEach(notify); - return { - add: (node) => { - nodes.add(node); - subscriptions.set(node, node.addEventListener("willUpdate", dirtyAll)); - }, - remove: (node) => { - nodes.delete(node); - const unsubscribe = subscriptions.get(node); - if (unsubscribe) { - unsubscribe(); - subscriptions.delete(node); - } - dirtyAll(); - }, - dirty: dirtyAll, - }; - } - - const rootProjectionNode = { - current: undefined, - }; - const HTMLProjectionNode = createProjectionNode({ - measureScroll: (instance) => ({ - x: instance.scrollLeft, - y: instance.scrollTop, - }), - defaultParent: () => { - if (!rootProjectionNode.current) { - const documentNode = new DocumentProjectionNode({}); - documentNode.mount(window); - documentNode.setOptions({ layoutScroll: true }); - rootProjectionNode.current = documentNode; - } - return rootProjectionNode.current; - }, - resetTransform: (instance, value) => { - instance.style.transform = value !== undefined ? value : "none"; - }, - checkIsScrollRoot: (instance) => Boolean(window.getComputedStyle(instance).position === "fixed"), - }); - - const layoutSelector = "[data-layout],[data-layout-id]"; - /** - * All imperatively-created projection nodes live in one persistent tree, - * shared across animateLayout() calls (and with any React-created nodes, - * via the singleton document root). Keyed by element for reuse. - */ - const layoutNodes = new WeakMap(); - /** - * Builders created within the same synchronous tick are flushed together - * as a single "commit": every node is snapshotted before any updateDom - * runs, mirroring React batching renders from different parts of the tree. - */ - let pendingBuilders; - function collectLayoutElements(scope) { - const elements = []; - if (scope instanceof HTMLElement && scope.matches(layoutSelector)) { - elements.push(scope); - } - scope.querySelectorAll(layoutSelector).forEach((element) => { - if (element instanceof HTMLElement) - elements.push(element); - }); - return elements; - } - /** - * Process any work scheduled on the frameloop now. A previous animation - * may have been seeked while paused (controls.time = x) without a frame - * having rendered it - we must materialise that state into the DOM - * before taking snapshots. - */ - function flushPendingFrame() { - if (frameData.isProcessing) - return; - const now = time.now(); - frameData.delta = motionUtils.clamp(0, 1000 / 60, now - frameData.timestamp); - frameData.timestamp = now; - frameData.isProcessing = true; - frameSteps.update.process(frameData); - frameSteps.preRender.process(frameData); - frameSteps.render.process(frameData); - frameData.isProcessing = false; - } - function getProjectionParent(element) { - let ancestor = element.parentElement; - while (ancestor) { - const node = layoutNodes.get(ancestor); - if (node && node.instance) - return node; - ancestor = ancestor.parentElement; - } - return undefined; - } - function createVisualElement() { - return new HTMLVisualElement({ - props: {}, - presenceContext: null, - visualState: { - latestValues: {}, - renderState: { - transform: {}, - transformOrigin: {}, - style: {}, - vars: {}, - }, - }, - }, { allowProjection: true }); - } - function readNodeOptions(element, transition) { - const layoutAttr = element.getAttribute("data-layout"); - const layoutId = element.getAttribute("data-layout-id") ?? undefined; - return { - layoutId, - layout: layoutAttr !== null ? true : undefined, - animationType: (!layoutAttr || layoutAttr === "true" - ? "both" - : layoutAttr), - transition, - }; - } - function prepareNode(element, transition) { - let node = layoutNodes.get(element); - if (!node) { - let visualElement = visualElementStore.get(element); - if (!visualElement) - visualElement = createVisualElement(); - /** - * A first-time element may carry a projection transform in its - * inline style (e.g. it was cloned from an element mid-animation). - * That transform isn't tracked in latestValues so the engine can't - * reset it before measuring - clear it now so the first layout - * measurement isn't inflated. - */ - if (element.style.transform && - !hasTransform(visualElement.latestValues)) { - element.style.transform = ""; - } - node = new HTMLProjectionNode(visualElement.latestValues, getProjectionParent(element)); - visualElement.projection = node; - node.setOptions({ - ...readNodeOptions(element, transition), - visualElement, - }); - node.mount(element); - layoutNodes.set(element, node); - } - else { - node.setOptions(readNodeOptions(element, transition)); - } - node.isPresent = true; - if (node.options.onExitComplete) { - node.setOptions({ onExitComplete: undefined }); - } - return node; - } - function sortDocumentOrder(elements) { - return [...elements].sort((a, b) => a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1); - } - function dropNode(element, node) { - node.setOptions({ onExitComplete: undefined }); - /** - * Stop any lingering animation so it can't leak into future updates. - * A follow node can share its currentAnimation with a surviving lead - * (via resumingFrom), in which case it isn't ours to stop. - */ - const stack = node.getStack(); - if (!stack || node.isLead()) - node.currentAnimation?.stop(); - node.unmount(); - layoutNodes.delete(element); - } - function flushPendingBuilders() { - const builders = pendingBuilders; - pendingBuilders = undefined; - flushPendingFrame(); - /** - * Discover and mount every node across all builders before snapshotting - * any of them. Mounting during an active update flags isLayoutDirty, - * which would make that node's own willUpdate skip its snapshot. - * Document order guarantees ancestors mount before descendants, even - * when they're discovered by different builders. - */ - const targets = new Map(); - for (const builder of builders) { - for (const element of builder.collectTargets()) { - const owners = targets.get(element); - owners ? owners.push(builder) : targets.set(element, [builder]); - } - } - const union = new Map(); - for (const element of sortDocumentOrder(targets.keys())) { - const owners = targets.get(element); - const node = prepareNode(element, owners[owners.length - 1].transitionFor(element)); - for (const owner of owners) - owner.adopt(element, node); - union.set(element, node); - } - union.forEach((node) => { - node.isLayoutDirty = false; - node.willUpdate(); - }); - const updatePromises = []; - for (const builder of builders) { - const result = builder.runUpdate(); - if (result) - updatePromises.push(result); - } - const commit = () => { - /** - * Process all additions before any removals so that, even across - * builders, a removed member knows whether a replacement with the - * same layoutId was added in this commit. - */ - const newMemberIds = new Set(); - for (const builder of builders) { - builder.reconcileAdditions(newMemberIds); - } - for (const builder of builders) { - builder.reconcileRemovals(newMemberIds); - } - let root; - union.forEach((node) => (root || (root = node.root))); - for (const builder of builders) - root || (root = builder.getRoot()); - root?.didUpdate(); - /** - * The root flushes the update on a microtask, synchronously - * processing the frame that creates the layout animations. Collect - * them in a later microtask step of the same pass. - */ - microtask.render(() => { - for (const builder of builders) - builder.finalize(); - }); - }; - updatePromises.length ? Promise.all(updatePromises).then(commit) : commit(); - } - class LayoutAnimationBuilder { - constructor(scope, updateDom, defaultOptions) { - this.scope = scope; - this.updateDom = updateDom; - this.defaultOptions = defaultOptions; - this.sharedTransitions = new Map(); - this.notifyReady = () => { }; - this.rejectReady = () => { }; - this.tracked = new Map(); - this.restorePoints = new Map(); - this.readyPromise = new Promise((resolve, reject) => { - this.notifyReady = resolve; - this.rejectReady = reject; - }); - if (!pendingBuilders) { - pendingBuilders = []; - queueMicrotask(flushPendingBuilders); - } - pendingBuilders.push(this); - } - shared(id, transition) { - this.sharedTransitions.set(id, transition); - return this; - } - then(resolve, reject) { - return this.readyPromise.then(resolve, reject); - } - transitionFor(element) { - const layoutId = element.getAttribute("data-layout-id"); - return ((layoutId && this.sharedTransitions.get(layoutId)) || - this.defaultOptions); - } - adopt(element, node) { - this.tracked.set(element, node); - this.restorePoints.set(element, { - parent: element.parentElement, - next: element.nextSibling, - }); - } - collectTargets() { - return collectLayoutElements(this.scope); - } - runUpdate() { - try { - const result = this.updateDom(); - if (result && typeof result.then === "function") { - return result.then(undefined, (error) => { - this.updateError = error; - }); - } - } - catch (error) { - this.updateError = error; - } - return undefined; - } - reconcileAdditions(newMemberIds) { - for (const element of collectLayoutElements(this.scope)) { - if (this.tracked.has(element)) - continue; - const node = prepareNode(element, this.transitionFor(element)); - this.adopt(element, node); - node.options.layoutId && newMemberIds.add(node.options.layoutId); - } - } - reconcileRemovals(newMemberIds) { - this.tracked.forEach((node, element) => { - if (element.isConnected) - return; - const restore = this.restorePoints.get(element); - this.restorePoints.delete(element); - const { layoutId } = node.options; - const stack = node.getStack(); - const hasSurvivor = stack && - stack.members.some((member) => member !== node && - member.instance - ?.isConnected); - /** - * A removed lead with a surviving stack member - and no - * replacement member added this commit - runs an exit - * crossfade: restore the element to its old position in the - * DOM, relegate it and let the survivor take over. It's - * removed again once the animation completes. - */ - if (layoutId && - node.isLead() && - hasSurvivor && - !newMemberIds.has(layoutId)) { - if (restore && restore.parent.isConnected) { - restore.parent.insertBefore(element, restore.next && restore.next.parentNode === restore.parent - ? restore.next - : null); - node.isPresent = false; - node.setOptions({ - onExitComplete: () => { - element.remove(); - dropNode(element, node); - }, - }); - if (node.relegate()) - return; - element.remove(); - } - } - dropNode(element, node); - this.tracked.delete(element); - }); - } - getRoot() { - let root; - this.tracked.forEach((node) => (root || (root = node.root))); - return root; - } - finalize() { - if (this.updateError) { - this.rejectReady(this.updateError); - return; - } - const animations = new Set(); - this.tracked.forEach((node) => { - if (node.instance && node.currentAnimation) { - animations.add(node.currentAnimation); - } - }); - this.notifyReady(new GroupAnimation([...animations])); - } - } - function parseAnimateLayoutArgs(scopeOrUpdateDom, updateDomOrOptions, options) { - if (typeof scopeOrUpdateDom === "function") { - return { - scope: document, - updateDom: scopeOrUpdateDom, - defaultOptions: updateDomOrOptions, - }; - } - const scope = scopeOrUpdateDom instanceof Document - ? scopeOrUpdateDom - : resolveElements(scopeOrUpdateDom)[0] ?? document; - return { - scope, - updateDom: updateDomOrOptions, - defaultOptions: options, - }; - } - - /** - * @deprecated - * - * Import as `frame` instead. - */ - const sync = frame; - /** - * @deprecated - * - * Use cancelFrame(callback) instead. - */ - const cancelSync = stepsOrder.reduce((acc, key) => { - acc[key] = (process) => cancelFrame(process); - return acc; - }, {}); - - exports.AsyncMotionValueAnimation = AsyncMotionValueAnimation; - exports.DOMKeyframesResolver = DOMKeyframesResolver; - exports.DOMVisualElement = DOMVisualElement; - exports.DocumentProjectionNode = DocumentProjectionNode; - exports.Feature = Feature; - exports.FlatTree = FlatTree; - exports.GroupAnimation = GroupAnimation; - exports.GroupAnimationWithThen = GroupAnimationWithThen; - exports.HTMLProjectionNode = HTMLProjectionNode; - exports.HTMLVisualElement = HTMLVisualElement; - exports.JSAnimation = JSAnimation; - exports.KeyframeResolver = KeyframeResolver; - exports.LayoutAnimationBuilder = LayoutAnimationBuilder; - exports.MotionValue = MotionValue; - exports.NativeAnimation = NativeAnimation; - exports.NativeAnimationExtended = NativeAnimationExtended; - exports.NativeAnimationWrapper = NativeAnimationWrapper; - exports.NodeStack = NodeStack; - exports.ObjectVisualElement = ObjectVisualElement; - exports.SVGVisualElement = SVGVisualElement; - exports.ViewTransitionBuilder = ViewTransitionBuilder; - exports.VisualElement = VisualElement; - exports.acceleratedValues = acceleratedValues; - exports.addAttrValue = addAttrValue; - exports.addDomEvent = addDomEvent; - exports.addScaleCorrector = addScaleCorrector; - exports.addStyleValue = addStyleValue; - exports.addValueToWillChange = addValueToWillChange; - exports.alpha = alpha; - exports.analyseComplexValue = analyseComplexValue; - exports.animateMotionValue = animateMotionValue; - exports.animateSingleValue = animateSingleValue; - exports.animateTarget = animateTarget; - exports.animateValue = animateValue; - exports.animateVariant = animateVariant; - exports.animateView = animateView; - exports.animateVisualElement = animateVisualElement; - exports.animationMapKey = animationMapKey; - exports.applyAxisDelta = applyAxisDelta; - exports.applyBoxDelta = applyBoxDelta; - exports.applyGeneratorOptions = applyGeneratorOptions; - exports.applyPointDelta = applyPointDelta; - exports.applyPxDefaults = applyPxDefaults; - exports.applyTreeDeltas = applyTreeDeltas; - exports.arc = arc; - exports.aspectRatio = aspectRatio; - exports.attachFollow = attachFollow; - exports.attachSpring = attachSpring; - exports.attrEffect = attrEffect; - exports.axisDeltaEquals = axisDeltaEquals; - exports.axisEquals = axisEquals; - exports.axisEqualsRounded = axisEqualsRounded; - exports.boxEquals = boxEquals; - exports.boxEqualsRounded = boxEqualsRounded; - exports.buildHTMLStyles = buildHTMLStyles; - exports.buildProjectionTransform = buildProjectionTransform; - exports.buildSVGAttrs = buildSVGAttrs; - exports.buildSVGPath = buildSVGPath; - exports.buildTransform = buildTransform; - exports.calcAxisDelta = calcAxisDelta; - exports.calcBoxDelta = calcBoxDelta; - exports.calcChildStagger = calcChildStagger; - exports.calcGeneratorDuration = calcGeneratorDuration; - exports.calcLength = calcLength; - exports.calcRelativeAxis = calcRelativeAxis; - exports.calcRelativeAxisPosition = calcRelativeAxisPosition; - exports.calcRelativeBox = calcRelativeBox; - exports.calcRelativePosition = calcRelativePosition; - exports.camelCaseAttributes = camelCaseAttributes; - exports.camelToDash = camelToDash; - exports.cancelFrame = cancelFrame; - exports.cancelMicrotask = cancelMicrotask; - exports.cancelSync = cancelSync; - exports.checkVariantsDidChange = checkVariantsDidChange; - exports.cleanDirtyNodes = cleanDirtyNodes; - exports.collectMotionValues = collectMotionValues; - exports.color = color; - exports.compareByDepth = compareByDepth; - exports.complex = complex; - exports.containsCSSVariable = containsCSSVariable; - exports.convertBoundingBoxToBox = convertBoundingBoxToBox; - exports.convertBoxToBoundingBox = convertBoxToBoundingBox; - exports.convertOffsetToTimes = convertOffsetToTimes; - exports.copyAxisDeltaInto = copyAxisDeltaInto; - exports.copyAxisInto = copyAxisInto; - exports.copyBoxInto = copyBoxInto; - exports.correctBorderRadius = correctBorderRadius; - exports.correctBoxShadow = correctBoxShadow; - exports.createAnimationState = createAnimationState; - exports.createAxis = createAxis; - exports.createAxisDelta = createAxisDelta; - exports.createBox = createBox; - exports.createDelta = createDelta; - exports.createGeneratorEasing = createGeneratorEasing; - exports.createProjectionNode = createProjectionNode; - exports.createRenderBatcher = createRenderBatcher; - exports.cubicBezierAsString = cubicBezierAsString; - exports.defaultEasing = defaultEasing; - exports.defaultOffset = defaultOffset; - exports.defaultTransformValue = defaultTransformValue; - exports.defaultValueTypes = defaultValueTypes; - exports.degrees = degrees; - exports.delay = delay; - exports.delayInSeconds = delayInSeconds; - exports.dimensionValueTypes = dimensionValueTypes; - exports.eachAxis = eachAxis; - exports.fillOffset = fillOffset; - exports.fillWildcards = fillWildcards; - exports.findDimensionValueType = findDimensionValueType; - exports.findValueType = findValueType; - exports.flushKeyframeResolvers = flushKeyframeResolvers; - exports.followValue = followValue; - exports.frame = frame; - exports.frameData = frameData; - exports.frameSteps = frameSteps; - exports.generateLinearEasing = generateLinearEasing; - exports.getAnimatableNone = getAnimatableNone; - exports.getAnimationMap = getAnimationMap; - exports.getComputedStyle = getComputedStyle$2; - exports.getDefaultTransition = getDefaultTransition; - exports.getDefaultValueType = getDefaultValueType; - exports.getFeatureDefinitions = getFeatureDefinitions; - exports.getFinalKeyframe = getFinalKeyframe; - exports.getMixer = getMixer; - exports.getOptimisedAppearId = getOptimisedAppearId; - exports.getOriginIndex = getOriginIndex; - exports.getValueAsType = getValueAsType; - exports.getValueTransition = getValueTransition; - exports.getVariableValue = getVariableValue; - exports.getVariantContext = getVariantContext; - exports.getViewAnimationLayerInfo = getViewAnimationLayerInfo; - exports.getViewAnimations = getViewAnimations; - exports.globalProjectionState = globalProjectionState; - exports.has2DTranslate = has2DTranslate; - exports.hasReducedMotionListener = hasReducedMotionListener; - exports.hasScale = hasScale; - exports.hasTransform = hasTransform; - exports.hex = hex; - exports.hover = hover; - exports.hsla = hsla; - exports.hslaToRgba = hslaToRgba; - exports.inertia = inertia; - exports.initPrefersReducedMotion = initPrefersReducedMotion; - exports.interpolate = interpolate; - exports.invisibleValues = invisibleValues; - exports.isAnimationControls = isAnimationControls; - exports.isCSSVariableName = isCSSVariableName; - exports.isCSSVariableToken = isCSSVariableToken; - exports.isControllingVariants = isControllingVariants; - exports.isDeltaZero = isDeltaZero; - exports.isDragActive = isDragActive; - exports.isDragging = isDragging; - exports.isElementKeyboardAccessible = isElementKeyboardAccessible; - exports.isElementTextInput = isElementTextInput; - exports.isForcedMotionValue = isForcedMotionValue; - exports.isGenerator = isGenerator; - exports.isHTMLElement = isHTMLElement; - exports.isKeyframesTarget = isKeyframesTarget; - exports.isMotionValue = isMotionValue; - exports.isNear = isNear; - exports.isNodeOrChild = isNodeOrChild; - exports.isPrimaryPointer = isPrimaryPointer; - exports.isSVGElement = isSVGElement; - exports.isSVGSVGElement = isSVGSVGElement; - exports.isSVGTag = isSVGTag; - exports.isTransitionDefined = isTransitionDefined; - exports.isVariantLabel = isVariantLabel; - exports.isVariantNode = isVariantNode; - exports.isWaapiSupportedEasing = isWaapiSupportedEasing; - exports.isWillChangeMotionValue = isWillChangeMotionValue; - exports.keyframes = keyframes; - exports.makeAnimationInstant = makeAnimationInstant; - exports.mapEasingToNativeEasing = mapEasingToNativeEasing; - exports.mapValue = mapValue; - exports.maxGeneratorDuration = maxGeneratorDuration; - exports.measurePageBox = measurePageBox; - exports.measureViewportBox = measureViewportBox; - exports.microtask = microtask; - exports.mix = mix; - exports.mixArray = mixArray; - exports.mixColor = mixColor; - exports.mixComplex = mixComplex; - exports.mixImmediate = mixImmediate; - exports.mixLinearColor = mixLinearColor; - exports.mixNumber = mixNumber$1; - exports.mixObject = mixObject; - exports.mixValues = mixValues; - exports.mixVisibility = mixVisibility; - exports.motionValue = motionValue; - exports.nodeGroup = nodeGroup; - exports.number = number; - exports.numberValueTypes = numberValueTypes; - exports.observeTimeline = observeTimeline; - exports.optimizedAppearDataAttribute = optimizedAppearDataAttribute; - exports.optimizedAppearDataId = optimizedAppearDataId; - exports.parseAnimateLayoutArgs = parseAnimateLayoutArgs; - exports.parseCSSVariable = parseCSSVariable; - exports.parseValueFromTransform = parseValueFromTransform; - exports.percent = percent; - exports.pixelsToPercent = pixelsToPercent; - exports.positionalKeys = positionalKeys; - exports.prefersReducedMotion = prefersReducedMotion; - exports.press = press; - exports.progressPercentage = progressPercentage; - exports.propEffect = propEffect; - exports.propagateDirtyNodes = propagateDirtyNodes; - exports.px = px; - exports.readTransformValue = readTransformValue; - exports.recordStats = recordStats; - exports.removeAxisDelta = removeAxisDelta; - exports.removeAxisTransforms = removeAxisTransforms; - exports.removeBoxTransforms = removeBoxTransforms; - exports.removePointDelta = removePointDelta; - exports.renderHTML = renderHTML; - exports.renderSVG = renderSVG; - exports.resize = resize; - exports.resolveElements = resolveElements; - exports.resolveMotionValue = resolveMotionValue; - exports.resolveTransition = resolveTransition; - exports.resolveVariant = resolveVariant; - exports.resolveVariantFromProps = resolveVariantFromProps; - exports.rgbUnit = rgbUnit; - exports.rgba = rgba; - exports.rootProjectionNode = rootProjectionNode; - exports.scale = scale; - exports.scaleCorrectors = scaleCorrectors; - exports.scalePoint = scalePoint; - exports.scrapeHTMLMotionValuesFromProps = scrapeMotionValuesFromProps$1; - exports.scrapeSVGMotionValuesFromProps = scrapeMotionValuesFromProps; - exports.setDragLock = setDragLock; - exports.setFeatureDefinitions = setFeatureDefinitions; - exports.setStyle = setStyle; - exports.setTarget = setTarget; - exports.spring = spring; - exports.springValue = springValue; - exports.stagger = stagger; - exports.startWaapiAnimation = startWaapiAnimation; - exports.statsBuffer = statsBuffer; - exports.styleEffect = styleEffect; - exports.supportedWaapiEasing = supportedWaapiEasing; - exports.supportsBrowserAnimation = supportsBrowserAnimation; - exports.supportsFlags = supportsFlags; - exports.supportsLinearEasing = supportsLinearEasing; - exports.supportsPartialKeyframes = supportsPartialKeyframes; - exports.supportsScrollTimeline = supportsScrollTimeline; - exports.supportsViewTimeline = supportsViewTimeline; - exports.svgEffect = svgEffect; - exports.sync = sync; - exports.testValueType = testValueType; - exports.time = time; - exports.transform = transform; - exports.transformAxis = transformAxis; - exports.transformBox = transformBox; - exports.transformBoxPoints = transformBoxPoints; - exports.transformPropOrder = transformPropOrder; - exports.transformProps = transformProps; - exports.transformValue = transformValue; - exports.transformValueTypes = transformValueTypes; - exports.translateAxis = translateAxis; - exports.updateMotionValuesFromProps = updateMotionValuesFromProps; - exports.variantPriorityOrder = variantPriorityOrder; - exports.variantProps = variantProps; - exports.vh = vh; - exports.visualElementStore = visualElementStore; - exports.vw = vw; - -})); diff --git a/node_modules/motion-dom/dist/motion-dom.js b/node_modules/motion-dom/dist/motion-dom.js deleted file mode 100644 index 313be4d..0000000 --- a/node_modules/motion-dom/dist/motion-dom.js +++ /dev/null @@ -1 +0,0 @@ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("motion-utils")):"function"==typeof define&&define.amd?define(["exports","motion-utils"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).MotionDom={},t.MotionUtils)}(this,function(t,e){"use strict";const n=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function i(t,i){let s=!1,o=!0;const r={delta:0,timestamp:0,isProcessing:!1},a=()=>s=!0,l=n.reduce((t,e)=>(t[e]=function(t){let e=new Set,n=new Set,i=!1,s=!1;const o=new WeakSet;let r={delta:0,timestamp:0,isProcessing:!1};function a(e){o.has(e)&&(l.schedule(e),t()),e(r)}const l={schedule:(t,s=!1,r=!1)=>{const a=r&&i?e:n;return s&&o.add(t),a.add(t),t},cancel:t=>{n.delete(t),o.delete(t)},process:t=>{if(r=t,i)return void(s=!0);i=!0;const o=e;e=n,n=o,e.forEach(a),e.clear(),i=!1,s&&(s=!1,l.process(t))}};return l}(a),t),{}),{setup:c,read:u,resolveKeyframes:h,preUpdate:d,update:p,preRender:m,render:f,postRender:y}=l,g=()=>{const n=e.MotionGlobalConfig.useManualTiming,a=n?r.timestamp:performance.now();s=!1,n||(r.delta=o?1e3/60:Math.max(Math.min(a-r.timestamp,40),1)),r.timestamp=a,r.isProcessing=!0,c.process(r),u.process(r),h.process(r),d.process(r),p.process(r),m.process(r),f.process(r),y.process(r),r.isProcessing=!1,s&&i&&(o=!1,t(g))};return{schedule:n.reduce((e,n)=>{const i=l[n];return e[n]=(e,n=!1,a=!1)=>(s||(s=!0,o=!0,r.isProcessing||t(g)),i.schedule(e,n,a)),e},{}),cancel:t=>{for(let e=0;e(void 0===l&&u.set(r.isProcessing||e.MotionGlobalConfig.useManualTiming?r.timestamp:performance.now()),l),set:t=>{l=t,queueMicrotask(c)}},h=t=>e=>"string"==typeof e&&e.startsWith(t),d=h("--"),p=h("var(--"),m=t=>!!p(t)&&f.test(t.split("/*")[0].trim()),f=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function y(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const g={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},v={...g,transform:t=>e.clamp(0,1,t)},x={...g,default:1},T=t=>Math.round(1e5*t)/1e5,w=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const b=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,S=(t,e)=>n=>Boolean("string"==typeof n&&b.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),V=(t,e,n)=>i=>{if("string"!=typeof i)return i;const[s,o,r,a]=i.match(w);return{[t]:parseFloat(s),[e]:parseFloat(o),[n]:parseFloat(r),alpha:void 0!==a?parseFloat(a):1}},A={...g,transform:t=>Math.round((t=>e.clamp(0,255,t))(t))},P={test:S("rgb","red"),parse:V("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+A.transform(t)+", "+A.transform(e)+", "+A.transform(n)+", "+T(v.transform(i))+")"};const M={test:S("#"),parse:function(t){let e="",n="",i="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),i=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),i=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,i+=i,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:s?parseInt(s,16)/255:1}},transform:P.transform},k=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),E=k("deg"),D=k("%"),C=k("px"),R=k("vh"),B=k("vw"),j=(()=>({...D,parse:t=>D.parse(t)/100,transform:t=>D.transform(100*t)}))(),L={test:S("hsl","hue"),parse:V("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+D.transform(T(e))+", "+D.transform(T(n))+", "+T(v.transform(i))+")"},F={test:t=>P.test(t)||M.test(t)||L.test(t),parse:t=>P.test(t)?P.parse(t):L.test(t)?L.parse(t):M.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?P.transform(t):L.transform(t),getAnimatableNone:t=>{const e=F.parse(t);return e.alpha=0,F.transform(e)}},O=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const I="number",$="color",N=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function U(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},s=[];let o=0;const r=e.replace(N,t=>(F.test(t)?(i.color.push(o),s.push($),n.push(F.parse(t))):t.startsWith("var(")?(i.var.push(o),s.push("var"),n.push(t)):(i.number.push(o),s.push(I),n.push(parseFloat(t))),++o,"${}")).split("${}");return{values:n,split:r,indexes:i,types:s}}function W({split:t,types:e}){const n=t.length;return i=>{let s="";for(let o=0;o{return"number"==typeof t?e?.trim().endsWith("/")?t:0:"number"==typeof(n=t)?0:F.test(n)?F.getAnimatableNone(n):n;var n};const K={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(w)?.length||0)+(t.match(O)?.length||0)>0},parse:function(t){return U(t).values},createTransformer:function(t){return W(U(t))},getAnimatableNone:function(t){const e=U(t);return W(e)(e.values.map((t,n)=>z(t,e.split[n])))}};function Y(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function G({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let s=0,o=0,r=0;if(e/=100){const i=n<.5?n*(1+e):n+e-n*e,a=2*n-i;s=Y(a,i,t+1/3),o=Y(a,i,t),r=Y(a,i,t-1/3)}else s=o=r=n;return{red:Math.round(255*s),green:Math.round(255*o),blue:Math.round(255*r),alpha:i}}function X(t,e){return n=>n>0?e:t}const q=(t,e,n)=>t+(e-t)*n,H=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},Z=[M,P,L];function _(t){const n=(i=t,Z.find(t=>t.test(i)));var i;if(e.warning(Boolean(n),`'${t}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!Boolean(n))return!1;let s=n.parse(t);return n===L&&(s=G(s)),s}const J=(t,e)=>{const n=_(t),i=_(e);if(!n||!i)return X(t,e);const s={...n};return t=>(s.red=H(n.red,i.red,t),s.green=H(n.green,i.green,t),s.blue=H(n.blue,i.blue,t),s.alpha=q(n.alpha,i.alpha,t),P.transform(s))},Q=new Set(["none","hidden"]);function tt(t,e){return Q.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function et(t,e){return n=>q(t,e,n)}function nt(t){return"number"==typeof t?et:"string"==typeof t?m(t)?X:F.test(t)?J:ot:Array.isArray(t)?it:"object"==typeof t?F.test(t)?J:st:X}function it(t,e){const n=[...t],i=n.length,s=t.map((t,n)=>nt(t)(t,e[n]));return t=>{for(let e=0;e{for(const e in i)n[e]=i[e](t);return n}}const ot=(t,n)=>{const i=K.createTransformer(n),s=U(t),o=U(n);return s.indexes.var.length===o.indexes.var.length&&s.indexes.color.length===o.indexes.color.length&&s.indexes.number.length>=o.indexes.number.length?Q.has(t)&&!o.values.length||Q.has(n)&&!s.values.length?tt(t,n):e.pipe(it(function(t,e){const n=[],i={color:0,var:0,number:0};for(let s=0;s{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>s.update(e,t),stop:()=>o(e),now:()=>r.isProcessing?r.timestamp:u.now()}},lt=(t,e,n=10)=>{let i="";const s=Math.max(Math.round(e/n),2);for(let e=0;e=ct?1/0:e}function ht(t,n=100,i){const s=i({...t,keyframes:[0,n]}),o=Math.min(ut(s),ct);return{type:"keyframes",ease:t=>s.next(o*t).value/n,duration:e.millisecondsToSeconds(o)}}const dt=100,pt=10,mt=1,ft=0,yt=800,gt=.3,vt=.3,xt={granular:.01,default:2},Tt={granular:.005,default:.5},wt=.01,bt=10,St=.05,Vt=1;function At(t,e){return t*Math.sqrt(1-e*e)}const Pt=.001;const Mt=["duration","bounce"],kt=["stiffness","damping","mass"];function Et(t,e){return e.some(e=>void 0!==t[e])}function Dt(t){let n={velocity:ft,stiffness:dt,damping:pt,mass:mt,isResolvedFromDuration:!1,...t};if(!Et(t,kt)&&Et(t,Mt))if(n.velocity=0,t.visualDuration){const i=t.visualDuration,s=2*Math.PI/(1.2*i),o=s*s,r=2*e.clamp(.05,1,1-(t.bounce||0))*Math.sqrt(o);n={...n,mass:mt,stiffness:o,damping:r}}else{const i=function({duration:t=yt,bounce:n=gt,velocity:i=ft,mass:s=mt}){let o,r;e.warning(t<=e.secondsToMilliseconds(bt),"Spring duration must be 10 seconds or less","spring-duration-limit");let a=1-n;a=e.clamp(St,Vt,a),t=e.clamp(wt,bt,e.millisecondsToSeconds(t)),a<1?(o=e=>{const n=e*a,s=n*t,o=n-i,r=At(e,a),l=Math.exp(-s);return Pt-o/r*l},r=e=>{const n=e*a*t,s=n*i+i,r=Math.pow(a,2)*Math.pow(e,2)*t,l=Math.exp(-n),c=At(Math.pow(e,2),a);return(-o(e)+Pt>0?-1:1)*((s-r)*l)/c}):(o=e=>Math.exp(-e*t)*((e-i)*t+1)-.001,r=e=>Math.exp(-e*t)*(t*t*(i-e)));const l=function(t,e,n){let i=n;for(let n=1;n<12;n++)i-=t(i)/e(i);return i}(o,r,5/t);if(t=e.secondsToMilliseconds(t),isNaN(l))return{stiffness:dt,damping:pt,duration:t};{const e=Math.pow(l,2)*s;return{stiffness:e,damping:2*a*Math.sqrt(s*e),duration:t}}}({...t,velocity:0});n={...n,...i,mass:mt},n.isResolvedFromDuration=!0}return n}function Ct(t=vt,n=gt){const i="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:n}:t;let{restSpeed:s,restDelta:o}=i;const r=i.keyframes[0],a=i.keyframes[i.keyframes.length-1],l={done:!1,value:r},{stiffness:c,damping:u,mass:h,duration:d,velocity:p,isResolvedFromDuration:m}=Dt({...i,velocity:-e.millisecondsToSeconds(i.velocity||0)}),f=p||0,y=u/(2*Math.sqrt(c*h)),g=a-r,v=e.millisecondsToSeconds(Math.sqrt(c/h)),x=Math.abs(g)<5;let T,w,b,S,V,A;if(s||(s=x?xt.granular:xt.default),o||(o=x?Tt.granular:Tt.default),y<1)b=At(v,y),S=(f+y*v*g)/b,T=t=>{const e=Math.exp(-y*v*t);return a-e*(S*Math.sin(b*t)+g*Math.cos(b*t))},V=y*v*S+g*b,A=y*v*g-S*b,w=t=>Math.exp(-y*v*t)*(V*Math.sin(b*t)+A*Math.cos(b*t));else if(1===y){T=t=>a-Math.exp(-v*t)*(g+(f+v*g)*t);const t=f+v*g;w=e=>Math.exp(-v*e)*(v*t*e-f)}else{const t=v*Math.sqrt(y*y-1);T=e=>{const n=Math.exp(-y*v*e),i=Math.min(t*e,300);return a-n*((f+y*v*g)*Math.sinh(i)+t*g*Math.cosh(i))/t};const e=(f+y*v*g)/t,n=y*v*e-g*t,i=y*v*g-e*t;w=e=>{const s=Math.exp(-y*v*e),o=Math.min(t*e,300);return s*(n*Math.sinh(o)+i*Math.cosh(o))}}const P={calculatedDuration:m&&d||null,velocity:t=>e.secondsToMilliseconds(w(t)),next:t=>{if(!m&&y<1){const n=Math.exp(-y*v*t),i=Math.sin(b*t),r=Math.cos(b*t),c=a-n*(S*i+g*r),u=e.secondsToMilliseconds(n*(V*i+A*r));return l.done=Math.abs(u)<=s&&Math.abs(a-c)<=o,l.value=l.done?a:c,l}const n=T(t);if(m)l.done=t>=d;else{const i=e.secondsToMilliseconds(w(t));l.done=Math.abs(i)<=s&&Math.abs(a-n)<=o}return l.value=l.done?a:n,l},toString:()=>{const t=Math.min(ut(P),ct),e=lt(e=>P.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return P}Ct.applyToOptions=t=>{const n=ht(t,100,Ct);return t.ease=n.ease,t.duration=e.secondsToMilliseconds(n.duration),t.type="keyframes",t};function Rt(t,n,i){const s=Math.max(n-5,0);return e.velocityPerSecond(i-t(s),n-s)}function Bt({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:l,restDelta:c=.5,restSpeed:u}){const h=t[0],d={done:!1,value:h},p=t=>void 0===a?l:void 0===l||Math.abs(a-t)-m*Math.exp(-t/i),v=t=>y+g(t),x=t=>{const e=g(t),n=v(t);d.done=Math.abs(e)<=c,d.value=d.done?y:n};let T,w;const b=t=>{var e;(e=d.value,void 0!==a&&el)&&(T=t,w=Ct({keyframes:[d.value,p(d.value)],velocity:Rt(v,t,d.value),damping:s,stiffness:o,restDelta:c,restSpeed:u}))};return b(0),{calculatedDuration:null,next:t=>{let e=!1;return w||void 0!==T||(e=!0,x(t),b(t)),void 0!==T&&t>=T?w.next(t-T):(!e&&x(t),d)}}}function jt(t,n,{clamp:i=!0,ease:s,mixer:o}={}){const r=t.length;if(e.invariant(r===n.length,"Both input and output ranges must be the same length","range-length"),1===r)return()=>n[0];if(2===r&&n[0]===n[1])return()=>n[1];const a=t[0]===t[1];t[0]>t[r-1]&&(t=[...t].reverse(),n=[...n].reverse());const l=function(t,n,i){const s=[],o=i||e.MotionGlobalConfig.mix||rt,r=t.length-1;for(let i=0;i{if(a&&i1)for(;su(e.clamp(t[0],t[r-1],n)):u}function Lt(t,n){const i=t[t.length-1];for(let s=1;s<=n;s++){const o=e.progress(0,n,s);t.push(q(i,1,o))}}function Ft(t){const e=[0];return Lt(e,t.length-1),e}function Ot(t,e){return t.map(t=>t*e)}function It(t,n){return t.map(()=>n||e.easeInOut).splice(0,t.length-1)}function $t({duration:t=300,keyframes:n,times:i,ease:s="easeInOut"}){const o=e.isEasingArray(s)?s.map(e.easingDefinitionToFunction):e.easingDefinitionToFunction(s),r={done:!1,value:n[0]},a=jt(Ot(i&&i.length===n.length?i:Ft(n),t),n,{ease:Array.isArray(o)?o:It(n,o)});return{calculatedDuration:t,next:e=>(r.value=a(e),r.done=e>=t,r)}}const Nt=t=>null!==t;function Ut(t,{repeat:e,repeatType:n="loop"},i,s=1){const o=t.filter(Nt),r=s<0||e&&"loop"!==n&&e%2==1?0:o.length-1;return r&&void 0!==i?i:o[r]}const Wt={decay:Bt,inertia:Bt,tween:$t,keyframes:$t,spring:Ct};function zt(t){"string"==typeof t.type&&(t.type=Wt[t.type])}class Kt{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const Yt=t=>t/100;class Gt extends Kt{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:t}=this.options;t&&t.updatedAt!==u.now()&&this.tick(u.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;zt(t);const{type:n=$t,repeat:i=0,repeatDelay:s=0,repeatType:o,velocity:r=0}=t;let{keyframes:a}=t;const l=n||$t;l!==$t&&"number"!=typeof a[0]&&(this.mixKeyframes=e.pipe(Yt,rt(a[0],a[1])),a=[0,100]);const c=l({...t,keyframes:a});"mirror"===o&&(this.mirroredGenerator=l({...t,keyframes:[...a].reverse(),velocity:-r})),null===c.calculatedDuration&&(c.calculatedDuration=ut(c));const{calculatedDuration:u}=c;this.calculatedDuration=u,this.resolvedDuration=u+s,this.totalDuration=this.resolvedDuration*(i+1)-s,this.generator=c}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,n=!1){const{generator:i,totalDuration:s,mixKeyframes:o,mirroredGenerator:r,resolvedDuration:a,calculatedDuration:l}=this;if(null===this.startTime)return i.next(0);const{delay:c=0,keyframes:u,repeat:h,repeatType:d,repeatDelay:p,type:m,onUpdate:f,finalKeyframe:y}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?g<0:g>s;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=s);let x,T=this.currentTime,w=i;if(h){const t=Math.min(this.currentTime,s)/a;let n=Math.floor(t),i=t%1;!i&&t>=1&&(i=1),1===i&&n--,n=Math.min(n,h+1);Boolean(n%2)&&("reverse"===d?(i=1-i,p&&(i-=p/a)):"mirror"===d&&(w=r)),T=e.clamp(0,1,i)*a}v?(this.delayState.value=u[0],x=this.delayState):x=w.next(T),o&&!v&&(x.value=o(x.value));let{done:b}=x;v||null===l||(b=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const S=null===this.holdTime&&("finished"===this.state||"running"===this.state&&b);return S&&m!==Bt&&(x.value=Ut(u,this.options,y,this.speed)),f&&f(x.value),S&&this.finish(),x}then(t,e){return this.finished.then(t,e)}get duration(){return e.millisecondsToSeconds(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+e.millisecondsToSeconds(t)}get time(){return e.millisecondsToSeconds(this.currentTime)}set time(t){t=e.secondsToMilliseconds(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);return Rt(t=>this.generator.next(t).value,t,this.generator.next(t).value)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;n&&this.driver&&this.updateTime(u.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=e.millisecondsToSeconds(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=at,startTime:e}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),this.options.onPlay?.();const n=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=n):null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime||(this.startTime=e??n),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(u.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function Xt(t){for(let e=1;e180*t/Math.PI,Ht=t=>{const e=qt(Math.atan2(t[1],t[0]));return _t(e)},Zt={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Ht,rotateZ:Ht,skewX:t=>qt(Math.atan(t[1])),skewY:t=>qt(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},_t=t=>((t%=360)<0&&(t+=360),t),Jt=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Qt=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),te={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Jt,scaleY:Qt,scale:t=>(Jt(t)+Qt(t))/2,rotateX:t=>_t(qt(Math.atan2(t[6],t[5]))),rotateY:t=>_t(qt(Math.atan2(-t[2],t[0]))),rotateZ:Ht,rotate:Ht,skewX:t=>qt(Math.atan(t[4])),skewY:t=>qt(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function ee(t){return t.includes("scale")?1:0}function ne(t,e){if(!t||"none"===t)return ee(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,s;if(n)i=te,s=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=Zt,s=e}if(!s)return ee(e);const o=i[e],r=s[1].split(",").map(se);return"function"==typeof o?o(r):r[o]}const ie=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return ne(n,e)};function se(t){return parseFloat(t.trim())}const oe=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],re=(()=>new Set([...oe,"pathRotation"]))(),ae=t=>t===g||t===C,le=new Set(["x","y","z"]),ce=oe.filter(t=>!le.has(t));const ue={width:({x:t},{paddingLeft:e="0",paddingRight:n="0",boxSizing:i})=>{const s=t.max-t.min;return"border-box"===i?s:s-parseFloat(e)-parseFloat(n)},height:({y:t},{paddingTop:e="0",paddingBottom:n="0",boxSizing:i})=>{const s=t.max-t.min;return"border-box"===i?s:s-parseFloat(e)-parseFloat(n)},top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>ne(e,"x"),y:(t,{transform:e})=>ne(e,"y")};ue.translateX=ue.x,ue.translateY=ue.y;const he=new Set;let de=!1,pe=!1,me=!1;function fe(){if(pe){const t=Array.from(he).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),n=new Map;e.forEach(t=>{const e=function(t){const e=[];return ce.forEach(n=>{const i=t.getValue(n);void 0!==i&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),e}(t);e.length&&(n.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=n.get(t);e&&e.forEach(([e,n])=>{t.getValue(e)?.set(n)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}pe=!1,de=!1,he.forEach(t=>t.complete(me)),he.clear()}function ye(){he.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(pe=!0)})}function ge(){me=!0,ye(),fe(),me=!1}class ve{constructor(t,e,n,i,s,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(he.add(this),de||(de=!0,s.read(ye),s.resolveKeyframes(fe))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:i}=this;if(null===t[0]){const s=i?.get(),o=t[t.length-1];if(void 0!==s)t[0]=s;else if(n&&e){const i=n.readValue(e,o);null!=i&&(t[0]=i)}void 0===t[0]&&(t[0]=o),i&&void 0===s&&i.set(t[0])}Xt(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),he.delete(this)}cancel(){"scheduled"===this.state&&(he.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}const xe=t=>t.startsWith("--");function Te(t,e,n){xe(e)?t.style.setProperty(e,n):t.style[e]=n}const we={};function be(t,n){const i=e.memo(t);return()=>we[n]??i()}const Se=be(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),Ve=be(()=>void 0!==window.ViewTimeline,"viewTimeline"),Ae=be(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),Pe=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,Me={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Pe([0,.65,.55,1]),circOut:Pe([.55,0,1,.45]),backIn:Pe([.31,.01,.66,-.59]),backOut:Pe([.33,1.53,.69,.99])};function ke(t,n){return t?"function"==typeof t?Ae()?lt(t,n):"ease-out":e.isBezierDefinition(t)?Pe(t):Array.isArray(t)?t.map(t=>ke(t,n)||Me.easeOut):Me[t]:void 0}function Ee(t,e,n,{delay:i=0,duration:s=300,repeat:o=0,repeatType:r="loop",ease:a="easeOut",times:l}={},c=void 0){const u={[e]:n};l&&(u.offset=l);const h=ke(a,s);Array.isArray(h)&&(u.easing=h);const d={delay:i,duration:s,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:o+1,direction:"reverse"===r?"alternate":"normal"};return c&&(d.pseudoElement=c),t.animate(u,d)}function De(t){return"function"==typeof t&&"applyToOptions"in t}function Ce({type:t,...e}){return De(t)&&Ae()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class Re extends Kt{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:i,keyframes:s,pseudoElement:o,allowFlatten:r=!1,finalKeyframe:a,onComplete:l}=t;this.isPseudoElement=Boolean(o),this.allowFlatten=r,this.options=t,e.invariant("string"!=typeof t.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const c=Ce(t);this.animation=Ee(n,i,s,c,o),!1===c.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const t=Ut(s,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(t),Te(n,i,t),this.animation.cancel()}l?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return e.millisecondsToSeconds(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+e.millisecondsToSeconds(t)}get time(){return e.millisecondsToSeconds(Number(this.animation.currentTime)||0)}set time(t){const n=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=e.secondsToMilliseconds(t),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:n,rangeEnd:i,observe:s}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&Se()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),i&&(this.animation.rangeEnd=i),e.noop):s(this)}}const Be={anticipate:e.anticipate,backInOut:e.backInOut,circInOut:e.circInOut};function je(t){"string"==typeof t.ease&&t.ease in Be&&(t.ease=Be[t.ease])}class Le extends Re{constructor(t){je(t),zt(t),super(t),void 0!==t.startTime&&!1!==t.autoplay&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:i,onComplete:s,element:o,...r}=this.options;if(!n)return;if(void 0!==t)return void n.set(t);const a=new Gt({...r,autoplay:!1}),l=Math.max(10,u.now()-this.startTime),c=e.clamp(0,10,l-10),h=a.sample(l).value,{name:d}=this.options;o&&d&&Te(o,d,h),n.setWithVelocity(a.sample(Math.max(0,l-c)).value,h,c),a.stop()}}const Fe=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!K.test(t)&&"0"!==t||t.startsWith("url(")));function Oe(t){t.duration=0,t.type="keyframes"}const Ie=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),$e=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;const Ne=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),Ue=e.memo(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function We(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:s,damping:o,type:r,keyframes:a}=t,l=e?.owner?.current;if(!(l instanceof HTMLElement||l instanceof SVGElement))return!1;const{onUpdate:c,transformTemplate:u}=e.owner.getProps();return Ue()&&n&&(Ie.has(n)||Ne.has(n)&&function(t){for(let e=0;e{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=u.now();const d={autoplay:t,delay:e,type:n,repeat:i,repeatDelay:s,repeatType:o,name:a,motionValue:l,element:c,...h},p=c?.KeyframeResolver||ve;this.keyframeResolver=new p(r,(t,e,n)=>this.onKeyframesResolved(t,e,d,!n),a,l,c),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,n,i,s){this.keyframeResolver=void 0;const{name:o,type:r,velocity:a,delay:l,isHandoff:c,onUpdate:h}=i;this.resolvedAt=u.now();let d=!0;(function(t,n,i,s){const o=t[0];if(null===o)return!1;if("display"===n||"visibility"===n)return!0;const r=t[t.length-1],a=Fe(o,n),l=Fe(r,n);return e.warning(a===l,`You are trying to animate ${n} from "${o}" to "${r}". "${a?r:o}" is not an animatable value.`,"value-not-animatable"),!(!a||!l)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:n,...i,keyframes:t},m=d&&!c&&We(p),f=p.motionValue?.owner?.current;let y;if(m)try{y=new Le({...p,element:f})}catch{y=new Gt(p)}else y=new Gt(p);y.finished.then(()=>{this.notifyFinished()}).catch(e.noop),this.pendingTimeline&&(this.stopTimeline=y.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=y}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),ge()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}class Ke{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;ne.attachTimeline(t));return()=>{e.forEach((t,e)=>{t&&t(),this.animations[e].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return Ye(this.animations,"duration")}get iterationDuration(){return Ye(this.animations,"iterationDuration")}runAll(t){this.animations.forEach(e=>e[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function Ye(t,e){let n=0;for(let i=0;in&&(n=s)}return n}class Ge extends Re{constructor(t){super(),this.animation=t,t.onfinish=()=>{this.finishedTime=this.time,this.notifyFinished()}}}const Xe=new WeakMap;function qe(t,e,n,i=0,s=1){const o=Array.from(t).sort((t,e)=>t.sortNodePosition(e)).indexOf(e),r=t.size,a=(r-1)*i;return"function"==typeof n?n(o,r):1===s?o*i:a-o*i}const He={current:void 0};class Ze{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=u.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=u.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new e.SubscriptionManager);const i=this.events[t].add(n);return"change"===t?()=>{i(),s.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return He.current&&He.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=u.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,30);return e.velocityPerSecond(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function _e(t,e){return new Ze(t,e)}function Je(t,e){if(t?.inherit&&e){const{inherit:n,...i}=t;return{...e,...i}}return t}function Qe(t,e){const n=t?.[e]??t?.default??t;return n!==t?Je(n,t):n}const tn={type:"spring",stiffness:500,damping:25,restSpeed:10},en={type:"keyframes",duration:.8},nn={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},sn=(t,{keyframes:e})=>e.length>2?en:re.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:tn:nn,on=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function rn(t){for(const e in t)if(!on.has(e))return!0;return!1}const an=(t,n,i,o={},r,a)=>l=>{const c=Qe(o,t)||{},u=c.delay||o.delay||0;let{elapsed:h=0}=o;h-=e.secondsToMilliseconds(u);const d={keyframes:Array.isArray(i)?i:[null,i],ease:"easeOut",velocity:n.getVelocity(),...c,delay:-h,onUpdate:t=>{n.set(t),c.onUpdate&&c.onUpdate(t)},onComplete:()=>{l(),c.onComplete&&c.onComplete()},name:t,motionValue:n,element:a?void 0:r};rn(c)||Object.assign(d,sn(t,d)),d.duration&&(d.duration=e.secondsToMilliseconds(d.duration)),d.repeatDelay&&(d.repeatDelay=e.secondsToMilliseconds(d.repeatDelay)),void 0!==d.from&&(d.keyframes[0]=d.from);let p=!1;if((!1===d.type||0===d.duration&&!d.repeatDelay)&&(Oe(d),0===d.delay&&(p=!0)),(e.MotionGlobalConfig.instantAnimations||e.MotionGlobalConfig.skipAnimations||r?.shouldSkipAnimations||c.skipAnimations)&&(p=!0,Oe(d),d.delay=0),d.allowFlatten=!c.type&&!c.ease,p&&!a&&void 0!==n.get()){const t=Ut(d.keyframes,c);if(void 0!==t)return void s.update(()=>{d.onUpdate(t),d.onComplete()})}return c.isSync?new Gt(d):new ze(d)};function ln(t,e,n,i){const s=1-t;return s*s*e+2*s*t*n+t*t*i}function cn(t,e,n,i,s,o,r){const a=2*(1-t)*(n-e)+2*t*(i-n),l=2*(1-t)*(o-s)+2*t*(r-o);return Math.atan2(l,a)*(180/Math.PI)}function un(t,e,n,i,s,o){const r=n-t,a=i-e,l=Math.sqrt(r*r+a*a);if(l>0){const n=s*l;return{x:t+r*o+-a/l*n,y:e+a*o+r/l*n}}return{x:t,y:e}}const hn=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function dn(t){const e=hn.exec(t);if(!e)return[,];const[,n,i,s]=e;return[`--${n??i}`,s]}function pn(t,n,i=1){e.invariant(i<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[s,o]=dn(t);if(!s)return;const r=window.getComputedStyle(n).getPropertyValue(s);if(r){const t=r.trim();return e.isNumericalString(t)?parseFloat(t):t}return m(o)?pn(o,n,i+1):o}function mn(t){const e=[{},{}];return t?.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}function fn(t,e,n,i){if("function"==typeof e){const[s,o]=mn(i);e=e(void 0!==n?n:t.custom,s,o)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[s,o]=mn(i);e=e(void 0!==n?n:t.custom,s,o)}return e}function yn(t,e,n){const i=t.getProps();return fn(i,e,void 0!==n?n:i.custom,t)}const gn=new Set(["width","height","top","left","right","bottom",...oe]),vn=t=>Array.isArray(t);function xn(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,_e(n))}function Tn(t){return vn(t)?t[t.length-1]||0:t}function wn(t,e){const n=yn(t,e);let{transitionEnd:i={},transition:s={},...o}=n||{};o={...o,...i};for(const e in o){xn(t,e,Tn(o[e]))}}const bn=t=>Boolean(t&&t.getVelocity);function Sn(t){return Boolean(bn(t)&&t.add)}function Vn(t,n){const i=t.getValue("willChange");if(Sn(i))return i.add(n);if(!i&&e.MotionGlobalConfig.WillChange){const i=new e.MotionGlobalConfig.WillChange("auto");t.addValue("willChange",i),i.add(n)}}function An(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const Pn="framerAppearId",Mn="data-"+An(Pn);function kn(t){return t.props[Mn]}function En({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}function Dn(t,e,{delay:n=0,transitionOverride:i,type:o}={}){let{transition:r,transitionEnd:a,...l}=e;const c=t.getDefaultTransition();r=r?Je(r,c):c;const u=r?.reduceMotion,h=r?.skipAnimations;i&&(r=i);const d=[],p=o&&t.animationState&&t.animationState.getState()[o],m=r?.path;m&&m.animateVisualElement(t,l,r,n,d);for(const e in l){const i=t.getValue(e,t.latestValues[e]??null),o=l[e];if(void 0===o||p&&En(p,e))continue;const a={delay:n,...Qe(r||{},e)};h&&(a.skipAnimations=!0);const c=i.get();if(void 0!==c&&!i.isAnimating()&&!Array.isArray(o)&&o===c&&!a.velocity){s.update(()=>i.set(o));continue}let m=!1;if(window.MotionHandoffAnimation){const n=kn(t);if(n){const t=window.MotionHandoffAnimation(n,e,s);null!==t&&(a.startTime=t,m=!0)}}Vn(t,e);const f=u??t.shouldReduceMotion;i.start(an(e,i,o,f&&gn.has(e)?{type:!1}:a,t,m));const y=i.animation;y&&d.push(y)}if(a){const e=()=>s.update(()=>{a&&wn(t,a)});d.length?Promise.all(d).then(e):e()}return d}function Cn(t,e,n={}){const i=yn(t,e,"exit"===n.type?t.presenceContext?.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const o=i?()=>Promise.all(Dn(t,i,n)):()=>Promise.resolve(),r=t.variantChildren&&t.variantChildren.size?(i=0)=>{const{delayChildren:o=0,staggerChildren:r,staggerDirection:a}=s;return function(t,e,n=0,i=0,s=0,o=1,r){const a=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),a.push(Cn(l,e,{...r,delay:n+("function"==typeof i?0:i)+qe(t.variantChildren,l,i,s,o)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(a)}(t,e,i,o,r,a,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[t,e]="beforeChildren"===a?[o,r]:[r,o];return t().then(()=>e())}return Promise.all([o(),r(n.delay)])}function Rn(t,e,n={}){let i;if(t.notify("AnimationStart",e),Array.isArray(e)){const s=e.map(e=>Cn(t,e,n));i=Promise.all(s)}else if("string"==typeof e)i=Cn(t,e,n);else{const s="function"==typeof e?yn(t,e,n.custom):e;i=Promise.all(Dn(t,s,n))}return i.then(()=>{t.notify("AnimationComplete",e)})}const Bn=t=>e=>e.test(t),jn=[g,C,D,E,B,R,{test:t=>"auto"===t,parse:t=>t}],Ln=t=>jn.find(Bn(t));function Fn(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||e.isZeroValueString(t))}const On=new Set(["brightness","contrast","saturate","opacity"]);function In(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(w)||[];if(!i)return t;const s=n.replace(i,"");let o=On.has(e)?1:0;return i!==n&&(o*=100),e+"("+o+s+")"}const $n=/\b([a-z-]*)\(.*?\)/gu,Nn={...K,getAnimatableNone:t=>{const e=t.match($n);return e?e.map(In).join(" "):t}},Un={...K,getAnimatableNone:t=>{const e=K.parse(t);return K.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},Wn={...g,transform:Math.round},zn={rotate:E,pathRotation:E,rotateX:E,rotateY:E,rotateZ:E,scale:x,scaleX:x,scaleY:x,scaleZ:x,skew:E,skewX:E,skewY:E,distance:C,translateX:C,translateY:C,translateZ:C,x:C,y:C,z:C,perspective:C,transformPerspective:C,opacity:v,originX:j,originY:j,originZ:C},Kn={borderWidth:C,borderTopWidth:C,borderRightWidth:C,borderBottomWidth:C,borderLeftWidth:C,borderRadius:C,borderTopLeftRadius:C,borderTopRightRadius:C,borderBottomRightRadius:C,borderBottomLeftRadius:C,width:C,maxWidth:C,height:C,maxHeight:C,top:C,right:C,bottom:C,left:C,inset:C,insetBlock:C,insetBlockStart:C,insetBlockEnd:C,insetInline:C,insetInlineStart:C,insetInlineEnd:C,padding:C,paddingTop:C,paddingRight:C,paddingBottom:C,paddingLeft:C,paddingBlock:C,paddingBlockStart:C,paddingBlockEnd:C,paddingInline:C,paddingInlineStart:C,paddingInlineEnd:C,margin:C,marginTop:C,marginRight:C,marginBottom:C,marginLeft:C,marginBlock:C,marginBlockStart:C,marginBlockEnd:C,marginInline:C,marginInlineStart:C,marginInlineEnd:C,fontSize:C,backgroundPositionX:C,backgroundPositionY:C,...zn,zIndex:Wn,fillOpacity:v,strokeOpacity:v,numOctaves:Wn},Yn={...Kn,color:F,backgroundColor:F,outlineColor:F,fill:F,stroke:F,borderColor:F,borderTopColor:F,borderRightColor:F,borderBottomColor:F,borderLeftColor:F,filter:Nn,WebkitFilter:Nn,mask:Un,WebkitMask:Un},Gn=t=>Yn[t],Xn=new Set([Nn,Un]);function qn(t,e){let n=Gn(t);return Xn.has(n)||(n=K),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Hn=new Set(["auto","none","0"]);class Zn extends ve{constructor(t,e,n,i,s){super(t,e,n,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n{t.getValue(e).set(n)}),this.resolveNoneKeyframes()}}const _n=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"],Jn=new Set(["borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius",..._n,"width","maxWidth","height","maxHeight","top","right","bottom","left","inset","insetBlock","insetBlockStart","insetBlockEnd","insetInline","insetInlineStart","insetInlineEnd","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingBlock","paddingBlockStart","paddingBlockEnd","paddingInline","paddingInlineStart","paddingInlineEnd","margin","marginTop","marginRight","marginBottom","marginLeft","marginBlock","marginBlockStart","marginBlockEnd","marginInline","marginInlineStart","marginInlineEnd","fontSize","backgroundPositionX","backgroundPositionY"]);const Qn=e.memo(()=>{try{document.createElement("div").animate({opacity:[1]})}catch(t){return!1}return!0});function ti(t,e,n){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){let i=document;e&&(i=e.current);const s=n?.[t]??i.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t).filter(t=>null!=t)}function ei(t){return(e,n)=>{const i=ti(e),s=[];for(const e of i){const i=t(e,n);s.push(i)}return()=>{for(const t of s)t()}}}const ni=(t,e)=>e&&"number"==typeof t?e.transform(t):t;class ii{constructor(){this.latest={},this.values=new Map}set(t,e,n,i,r=!0){const a=this.values.get(t);a&&a.onRemove();const l=()=>{const i=e.get();this.latest[t]=r?ni(i,Kn[t]):i,n&&s.render(n)};l();const c=e.on("change",l);i&&e.addDependent(i);const u=()=>{c(),n&&o(n),this.values.delete(t),i&&e.removeDependent(i)};return this.values.set(t,{value:e,onRemove:u}),u}get(t){return this.values.get(t)?.value}}function si(t){const e=new WeakMap;return(n,i)=>{const s=e.get(n)??new ii;e.set(n,s);const o=[];for(const e in i){const r=i[e],a=t(n,s,e,r);o.push(a)}return()=>{for(const t of o)t()}}}const oi=(t,e,n,i)=>{const s=function(t,e){if(!(e in t))return!1;const n=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(t),e)||Object.getOwnPropertyDescriptor(t,e);return n&&"function"==typeof n.set}(t,n),o=s?n:n.startsWith("data")||n.startsWith("aria")?An(n):n,r=s?()=>{t[o]=e.latest[n]}:()=>{const i=e.latest[n];null==i?t.removeAttribute(o):t.setAttribute(o,String(i))};return e.set(n,i,r)},ri=ei(si(oi)),ai=si((t,e,n,i)=>e.set(n,i,()=>{t[n]=e.latest[n]},void 0,!1));function li(t){return e.isObject(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const ci={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"};const ui=new Set(["originX","originY","originZ"]),hi=(t,e,n,i)=>{let s,o;return re.has(n)?(e.get("transform")||(li(t)||e.get("transformBox")||hi(t,e,"transformBox",new Ze("fill-box")),e.set("transform",new Ze("none"),()=>{t.style.transform=function(t){let e="",n=!0;for(let i=0;i{const n=e.latest.originX??"50%",i=e.latest.originY??"50%",s=e.latest.originZ??0;t.style.transformOrigin=`${n} ${i} ${s}`}),o=e.get("transformOrigin")):s=xe(n)?()=>{t.style.setProperty(n,e.latest[n])}:()=>{t.style[n]=e.latest[n]},e.set(n,i,s,o)},di=ei(si(hi));const pi=ei(si((t,e,n,i)=>{if(n.startsWith("path"))return function(t,e,n,i){return s.render(()=>t.setAttribute("pathLength","1")),"pathOffset"===n?e.set(n,i,()=>{const i=e.latest[n];t.setAttribute("stroke-dashoffset",""+-i)}):(e.get("stroke-dasharray")||e.set("stroke-dasharray",new Ze("1 1"),()=>{const{pathLength:n=1,pathSpacing:i}=e.latest;t.setAttribute("stroke-dasharray",`${n} ${i??1-Number(n)}`)}),e.set(n,i,void 0,e.get("stroke-dasharray")))}(t,e,n,i);if(n.startsWith("attr"))return oi(t,e,function(t){return t.replace(/^attr([A-Z])/,(t,e)=>e.toLowerCase())}(n),i);return(n in t.style?hi:oi)(t,e,n,i)}));const{schedule:mi,cancel:fi}=i(queueMicrotask,!1),yi={x:!1,y:!1};function gi(){return yi.x||yi.y}function vi(t,e){const n=ti(t),i=new AbortController;return[n,{passive:!0,...e,signal:i.signal},()=>i.abort()]}const xi=(t,e)=>!!e&&(t===e||xi(t,e.parentElement)),Ti=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,wi=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function bi(t){return wi.has(t.tagName)||!0===t.isContentEditable}const Si=new Set(["INPUT","SELECT","TEXTAREA"]);const Vi=new WeakSet;function Ai(t){return e=>{"Enter"===e.key&&t(e)}}function Pi(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function Mi(t){return Ti(t)&&!gi()}const ki=new WeakSet;function Ei(t){return e.isObject(t)&&"ownerSVGElement"in t}const Di=new WeakMap;let Ci;const Ri=(t,e,n)=>(i,s)=>s&&s[0]?s[0][t+"Size"]:Ei(i)&&"getBBox"in i?i.getBBox()[e]:i[n],Bi=Ri("inline","width","offsetWidth"),ji=Ri("block","height","offsetHeight");function Li({target:t,borderBoxSize:e}){Di.get(t)?.forEach(n=>{n(t,{get width(){return Bi(t,e)},get height(){return ji(t,e)}})})}function Fi(t){t.forEach(Li)}function Oi(t,e){Ci||"undefined"!=typeof ResizeObserver&&(Ci=new ResizeObserver(Fi));const n=ti(t);return n.forEach(t=>{let n=Di.get(t);n||(n=new Set,Di.set(t,n)),n.add(e),Ci?.observe(t)}),()=>{n.forEach(t=>{const n=Di.get(t);n?.delete(e),n?.size||Ci?.unobserve(t)})}}const Ii=new Set;let $i;function Ni(t){return Ii.add(t),$i||($i=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};Ii.forEach(e=>e(t))},window.addEventListener("resize",$i)),()=>{Ii.delete(t),Ii.size||"function"!=typeof $i||(window.removeEventListener("resize",$i),$i=void 0)}}const Ui={value:null,addProjectionMetrics:null};function Wi(t){return Ei(t)&&"svg"===t.tagName}function zi(t,e){if("first"===t)return 0;{const n=e-1;return"last"===t?n:n/2}}function Ki(...t){const e=!Array.isArray(t[0]),n=e?0:-1,i=t[0+n],s=jt(t[1+n],t[2+n],t[3+n]);return e?s(i):s}function Yi(t,e){const n=_e(bn(t)?t.get():t);return Gi(n,t,e),n}function Gi(t,e,n={}){const i=t.get();let o,r=null,a=i;const l="string"==typeof i?i.replace(/[\d.-]/g,""):void 0,c=()=>{r&&(r.stop(),r=null),t.animation=void 0},u=()=>{(()=>{const e=qi(t.get()),i=qi(a);if(e===i)return void c();const s=r?r.getGeneratorVelocity():t.getVelocity();c(),r=new Gt({keyframes:[e,i],velocity:s,type:"spring",restDelta:.001,restSpeed:.01,...n,onUpdate:o})})(),t.animation=r??void 0,t.events.animationStart?.notify(),r?.then(()=>{t.animation=void 0,t.events.animationComplete?.notify()})};if(t.attach((t,e)=>{a=t,o=t=>e(Xi(t,l)),s.postRender(u)},c),bn(e)){let i=!0===n.skipInitialAnimation;const s=e.on("change",e=>{i?(i=!1,t.jump(Xi(e,l),!1)):t.set(Xi(e,l))}),o=t.on("destroy",s);return()=>{s(),o()}}return c}function Xi(t,e){return e?t+e:t}function qi(t){return"number"==typeof t?t:parseFloat(t)}function Hi(t){const e=[];He.current=e;const n=t();He.current=void 0;const i=_e(n);return function(t,e,n){const i=()=>e.set(n()),r=()=>s.preRender(i,!1,!0),a=t.map(t=>t.on("change",r));e.on("destroy",()=>{a.forEach(t=>t()),o(i)})}(e,i,t),i}const Zi=[...jn,F,K],_i=t=>Zi.find(Bn(t));let Ji=0;const Qi=()=>"motion-view-"+Ji++;function ts(t,e,n){e&&(t.style?.setProperty("view-transition-class",e),n.push(t))}function es(t,e,n,i,s){if(n&&(t.style?.setProperty("view-transition-group",n),i.push(t),"none"!==n&&s)){const n=getComputedStyle(t);"visible"===n.overflowX&&"visible"===n.overflowY||s.add(e)}}function ns(t,e,n,i,s,o=[],r,a=[],l){const c=ti(t);if(i)return c.map((t,c)=>{const u=e.get(t);if(u)return u;const h=i[c]??Qi();return t.style?.setProperty("view-transition-name",h),n.push(t),e.set(t,h),ts(t,s,o),es(t,h,r,a,l),h});const u=c.map(t=>e.has(t)?void 0:getComputedStyle(t).getPropertyValue("view-transition-name"));return c.map((t,i)=>{const c=e.get(t);if(c)return c;const h=u[i];let d;return h&&"none"!==h&&"auto"!==h&&"match-element"!==h&&!(t=>t.startsWith("motion-view-"))(h)?d=h:(d=Qi(),t.style?.setProperty("view-transition-name",d),n.push(t)),e.set(t,d),ts(t,s,o),es(t,d,r,a,l),d})}function is(t){return"layout"===t?"group":"enter"===t||"new"===t?"new":"old"}let ss={},os=null;const rs=(t,e)=>{ss[t]=e},as=()=>{os||(os=document.createElement("style"),os.id="motion-view");let t="";for(const e in ss){const n=ss[e];t+=`${e} {\n`;for(const[e,i]of Object.entries(n))t+=` ${e}: ${i};\n`;t+="}\n"}os.textContent=t,document.head.appendChild(os),ss={}},ls=()=>{os&&os.parentElement&&os.parentElement.removeChild(os)};function cs(t){const e=t.match(/::view-transition-(old|new|group-children|group|image-pair)\((.*?)\)/);return e?{layer:e[2],type:e[1]}:null}function us(){return document.getAnimations().filter(t=>{const{effect:e}=t;return!!e&&e.target===document.documentElement&&e.pseudoElement?.startsWith("::view-transition")})}const hs=["layout","enter","exit","new","old"],ds=t=>t.split(" ").every(t=>0===parseFloat(t)),ps={group:["layout"],new:["new","enter"],old:["old","exit"]},ms={new:{opacity:0,scale:.85},old:{opacity:1,scale:1}};function fs(t){const{update:n,targets:i,resolveDefs:s,cropOverride:o,pairs:r,classNames:a,flatGroups:l,options:c}=t;if(!document.startViewTransition)return(async()=>(await n(),new Ke([])))();const u=new Map,h=[],d=[],p=[],m=new Set,f=new Map,y=new Set,g=new Map,v=new Map,x=new Map,T=new Map,w=t=>{i.forEach((e,n)=>{const i=a.get(n),c="root"!==n&&s.has(n)?l.has(n)?"none":"contain":void 0;let y;if("root"!==n&&s.has(n))if(r.has(n))if("old"===t)T.set(n,ti(n)),y=ns(n,u,h,void 0,i,d,c,p,m),x.set(n,y);else{for(const t of T.get(n)??[])t.style?.removeProperty("view-transition-name"),u.delete(t);y=ns(r.get(n),u,h,x.get(n),i,d,c,p,m)}else y=ns(n,u,h,void 0,i,d,c,p,m);else y=[n];const w=o.get(n);y.forEach((n,i)=>{const s=f.get(n);f.set(n,s&&s!==e?{...s,...e}:e),void 0!==w&&g.set(n,w);const o=v.get(n)??{};o[t]=[i,y.length],v.set(n,o)})})},b=(t,e)=>{const n=v.get(t);return("old"===e?n?.old:"new"===e?n?.new:n?.new??n?.old)??[-1,1]},S=(t,e,n,i,s)=>{const o=ys(Qe(c,n),Qe(function(t,e){for(const n of ps[e]??[]){const e=t?.[n]?.options;if(e)return e}}(t,e)??{},n));return"function"==typeof o.delay&&(o.delay=o.delay(i,s)),o},V=t=>{const[n,i]=b(t,"group"),s=S(f.get(t),"group","layout",-1===n?0:n,i);s.duration&&(s.duration=e.secondsToMilliseconds(s.duration));const{delay:o=0,duration:r,ease:a}=Ce(s);return{delay:e.secondsToMilliseconds(o),duration:r,ease:a}},A=new Map,P=t=>u.forEach((e,n)=>{const i=n,s=i.getBoundingClientRect?.();if(s&&s.height){const n=getComputedStyle(i),o={};for(const t of _n)o[t]=n[t];const r=A.get(e)??{};r[t]={width:s.width,height:s.height,radii:o},A.set(e,r)}}),M=t=>{const e=A.get(t);return!!(e?.old&&e?.new&&e.old.height&&e.new.height)&&Math.abs(e.old.width/e.old.height-e.new.width/e.new.height)>.2},k=()=>{(function(t,e){return e.has(t)&&Object.keys(e.get(t)).length>0})("root",i)||rs(":root",{"view-transition-name":"none"}),rs("::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)",{"animation-timing-function":"linear !important"}),y.forEach(t=>{rs(`::view-transition-group(${t})`,{overflow:"clip"}),rs(`::view-transition-old(${t}), ::view-transition-new(${t})`,{width:"100%",height:"100%","object-fit":"cover"})}),m.forEach(t=>{rs(`::view-transition-group-children(${t})`,{overflow:"clip"})}),as()},E=()=>{!function(t,e=[],n=[]){for(const e of t)e.style?.removeProperty("view-transition-name");for(const t of e)t.style?.removeProperty("view-transition-class");for(const t of n)t.style?.removeProperty("view-transition-group")}(h,d,p),ls()},D=async()=>{await n(),w("new"),P("new"),(()=>{y.clear();for(const t of v.keys())"root"!==t&&(g.get(t)??M(t))&&y.add(t)})(),k()};let C;try{w("old"),P("old"),k(),C=document.startViewTransition(D)}catch(t){return E(),Promise.reject(t)}return C.finished.finally(E),new Promise((t,n)=>{C.ready.then(()=>{const n=us(),i=[],s=new Set,o=new Set;f.forEach((t,n)=>{const r=v.get(n),a=!!r?.new&&!r?.old,l=!!r?.old&&!r?.new;for(const r of hs){if(!t[r])continue;if("enter"===r&&!a)continue;if("exit"===r&&!l)continue;const u=is(r),[h,d]=b(n,u);if(-1===h)continue;const{keyframes:p,options:m}=t[r];for(let[f,y]of Object.entries(p)){if(null==y)continue;if("x"===f||"y"===f){e.warnOnce(!1,`animateView() animates view-transition layers with CSS properties; the "${f}" shorthand has no effect - use transform, e.g. { transform: "translateX(40px)" }.`);continue}if("new"===r&&a&&null!=t.enter?.keyframes[f])continue;if("old"===r&&l&&null!=t.exit?.keyframes[f])continue;const p=ys(Qe(c,f),Qe(m,f));if(!Array.isArray(y)){const e="enter"===r?t.exit?.keyframes[f]:void 0,n="opacity"===f||("new"===u?a:l),i=null!=e?Array.isArray(e)?e[e.length-1]:e:n?ms[u]?.[f]:void 0;void 0!==i&&(y=[i,y])}"function"==typeof p.delay&&(p.delay=p.delay(h,d)),p.duration&&(p.duration=e.secondsToMilliseconds(p.duration)),p.delay&&(p.delay=e.secondsToMilliseconds(p.delay)),i.push(new Re({...p,element:document.documentElement,name:f,pseudoElement:`::view-transition-${u}(${n})`,keyframes:y})),s.add(`${n}:${u}`),"opacity"===f&&o.add(`${n}:${u}`)}}});for(const t of n){if("finished"===t.playState)continue;const{effect:n}=t;if(!(n&&n instanceof KeyframeEffect))continue;const{pseudoElement:r}=n;if(!r)continue;const a=cs(r);if(!a)continue;const l=f.get(a.layer);if(s.has(`${a.layer}:${a.type}`)){o.has(`${a.layer}:new`)&&o.has(`${a.layer}:old`)&&n.getKeyframes().some(t=>t.mixBlendMode)?i.push(new Ge(t)):t.cancel();continue}const c="old"===a.type?"new":"new"===a.type?"old":void 0;if(c&&s.has(`${a.layer}:${c}`)&&!o.has(`${a.layer}:${c}`)){t.cancel();continue}const u=v.get(a.layer),h=!("old"!==a.type&&"new"!==a.type||!u?.old||!u?.new);let d;if(a.type.startsWith("group")){const{delay:t,duration:e,ease:n}=V(a.layer);d={delay:t,duration:e,easing:ke(n,e)}}else{const t=h?"group":a.type,[n,i]=b(a.layer,t);let s=S(l,t,"group"===t?"layout":"",-1===n?0:n,i);const o=s.visualDuration;s.duration&&(s.duration=e.secondsToMilliseconds(s.duration)),s=Ce(s),d={delay:e.secondsToMilliseconds(s.delay??0),duration:h&&void 0!==o?e.secondsToMilliseconds(o):s.duration,easing:h?"linear":ke(s.ease,s.duration)}}n.updateTiming(d),i.push(new Ge(t))}A.forEach((t,e)=>{if(!y.has(e))return;const{delay:n,duration:s,ease:o}=V(e);for(const r of _n){const a=t.old?.radii[r]||t.new?.radii[r]||"0px",l=t.new?.radii[r]||t.old?.radii[r]||"0px";ds(a)&&ds(l)||i.push(new Re({element:document.documentElement,name:r,pseudoElement:`::view-transition-group(${e})`,keyframes:[a,l],delay:n,duration:s,ease:o}))}}),t(new Ke(i))}).catch(()=>C.updateCallbackDone.then(()=>t(new Ke([])),n))})}function ys(t,e){const n={...t,...e};return void 0!==e.duration&&(void 0===e.visualDuration&&delete n.visualDuration,void 0===e.type&&delete n.type),n}let gs=[],vs=null;function xs(){vs=null;const[t]=gs;var n;t&&(n=t,e.removeItem(gs,n),vs=n,fs(n).then(t=>(n.notifyReady(t),t.finished)).catch(t=>n.notifyReject(t)).finally(xs))}function Ts(){for(let t=gs.length-1;t>=0;t--){const e=gs[t],{interrupt:n}=e.options;if("immediate"===n){const n=gs.slice(0,t+1).map(t=>t.update),i=gs.slice(t+1);e.update=()=>{n.forEach(t=>t())},gs=[e,...i];break}}vs&&"immediate"!==gs[0]?.options.interrupt||xs()}class ws{constructor(t,n={}){var i;this.currentSubject="root",this.targets=new Map,this.resolveDefs=new Set,this.cropOverride=new Map,this.pairs=new Map,this.classNames=new Map,this.flatGroups=new Set,this.notifyReady=e.noop,this.notifyReject=e.noop,this.readyPromise=new Promise((t,e)=>{this.notifyReady=t,this.notifyReject=e}),this.update=t,this.options={interrupt:"wait",...n},this.readyPromise.catch(e.noop),i=this,gs.push(i),mi.render(Ts)}add(t,e){return this.currentSubject=t,this.resolveDefs.add(t),void 0!==e&&this.pairs.set(t,e),this.targets.has(t)||this.targets.set(t,{}),this}crop(t=!0){return this.cropOverride.set(this.currentSubject,t),this}group(t=!0){return t?this.flatGroups.delete(this.currentSubject):this.flatGroups.add(this.currentSubject),this}class(t){return this.classNames.set(this.currentSubject,t),this}layout(t={}){return this.updateTarget("layout",{},t),this}enter(t,e){return this.updateTarget("enter",t,e),this}exit(t,e){return this.updateTarget("exit",t,e),this}new(t,e){return this.updateTarget("new",t,e),this}old(t,e){return this.updateTarget("old",t,e),this}updateTarget(t,e,n={}){const{currentSubject:i,targets:s}=this;s.has(i)||s.set(i,{});s.get(i)[t]={keyframes:e,options:n}}then(t,e){return this.readyPromise.then(t,e)}}const bs=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ss=()=>({x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}),Vs=()=>({min:0,max:0}),As=()=>({x:{min:0,max:0},y:{min:0,max:0}}),Ps=new WeakMap;function Ms(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function ks(t){return"string"==typeof t||Array.isArray(t)}const Es=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Ds=["initial",...Es];function Cs(t){return Ms(t.animate)||Ds.some(e=>ks(t[e]))}function Rs(t){return Boolean(Cs(t)||t.variants)}function Bs(t,e,n){for(const i in e){const s=e[i],o=n[i];if(bn(s))t.addValue(i,s);else if(bn(o))t.addValue(i,_e(s,{owner:t}));else if(o!==s)if(t.hasValue(i)){const e=t.getValue(i);!0===e.liveStyle?e.jump(s):e.hasAnimated||e.set(s)}else{const e=t.getStaticValue(i);t.addValue(i,_e(void 0!==e?e:s,{owner:t}))}}for(const i in n)void 0===e[i]&&t.removeValue(i);return e}const js={current:null},Ls={current:!1},Fs="undefined"!=typeof window;function Os(){if(Ls.current=!0,Fs)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>js.current=t.matches;t.addEventListener("change",e),e()}else js.current=!1}const Is=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let $s={};class Ns{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:i,skipAnimations:o,blockInitialAnimation:r,visualState:a},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=ve,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const t=u.now();this.renderScheduledAtthis.bindToMotionValue(e,t)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(Ls.current||Os(),this.shouldReduceMotion=js.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),o(this.notifyUpdate),o(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&Ie.has(t)&&this.current instanceof HTMLElement){const{factory:i,keyframes:s,times:o,ease:r,duration:a}=n.accelerate,l=new Re({element:this.current,name:t,keyframes:s,times:o,ease:r,duration:e.secondsToMilliseconds(a)}),c=i(l);return void this.valueSubscriptions.set(t,()=>{c(),l.cancel()})}const i=re.has(t);i&&this.onBindTransform&&this.onBindTransform();const o=n.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&s.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let r;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{o(),r&&r()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in $s){const e=$s[t];if(!e)continue;const{isEnabled:n,Feature:i}=e;if(!this.features[t]&&i&&n(this.props)&&(this.features[t]=new i(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;ee.variantChildren.delete(t)}addValue(t,e){const n=this.values.get(t);e!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=_e(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,n){let i=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];return null!=i&&("string"==typeof i&&(e.isNumericalString(i)||e.isZeroValueString(i))?i=parseFloat(i):!_i(i)&&K.test(n)&&(i=qn(t,n)),this.setBaseTarget(t,bn(i)?i.get():i)),bn(i)?i.get():i}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let n;if("string"==typeof e||"object"==typeof e){const i=fn(this.props,e,this.presenceContext?.custom);i&&(n=i[t])}if(e&&void 0!==n)return n;const i=this.getBaseTargetFromProps(this.props,t);return void 0===i||bn(i)?void 0!==this.initialValues[t]&&void 0===n?void 0:this.baseTarget[t]:i}on(t,n){return this.events[t]||(this.events[t]=new e.SubscriptionManager),this.events[t].add(n)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){mi.render(this.render)}}class Us extends Ns{constructor(){super(...arguments),this.KeyframeResolver=Zn}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){const n=t.style;return n?n[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;bn(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}function Ws({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function zs(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),i=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}function Ks(t){return void 0===t||1===t}function Ys({scale:t,scaleX:e,scaleY:n}){return!Ks(t)||!Ks(e)||!Ks(n)}function Gs(t){return Ys(t)||Xs(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Xs(t){return qs(t.x)||qs(t.y)}function qs(t){return t&&"0%"!==t}function Hs(t,e,n){return n+e*(t-n)}function Zs(t,e,n,i,s){return void 0!==s&&(t=Hs(t,s,i)),Hs(t,n,i)+e}function _s(t,e=0,n=1,i,s){t.min=Zs(t.min,e,n,i,s),t.max=Zs(t.max,e,n,i,s)}function Js(t,{x:e,y:n}){_s(t.x,e.translate,e.scale,e.originPoint),_s(t.y,n.translate,n.scale,n.originPoint)}const Qs=.999999999999,to=1.0000000000001;function eo(t,e,n,i=!1){const s=n.length;if(!s)return;let o,r;e.x=e.y=1;for(let a=0;aQs&&(e.x=1),e.yQs&&(e.y=1)}function no(t,e){t.min+=e,t.max+=e}function io(t,e,n,i,s=.5){_s(t,e,n,q(t.min,t.max,s),i)}function so(t,e){return"string"==typeof t?parseFloat(t)/100*(e.max-e.min):t}function oo(t,e,n){const i=n??t;io(t.x,so(e.x,i.x),e.scaleX,e.scale,e.originX),io(t.y,so(e.y,i.y),e.scaleY,e.scale,e.originY)}function ro(t,e){return Ws(zs(t.getBoundingClientRect(),e))}const ao={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},lo=oe.length;function co(t,e,n){let i="",s=!0;for(let o=0;o{if(!e.target)return t;if("string"==typeof t){if(!C.test(t))return t;t=parseFloat(t)}return`${po(t,e.target.x)}% ${po(t,e.target.y)}%`}},fo={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,s=K.parse(t);if(s.length>5)return i;const o=K.createTransformer(t),r="number"!=typeof s[0]?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;s[0+r]/=a,s[1+r]/=l;const c=q(a,l,.5);return"number"==typeof s[2+r]&&(s[2+r]/=c),"number"==typeof s[3+r]&&(s[3+r]/=c),o(s)}},yo={borderRadius:{...mo,applyTo:[..._n]},borderTopLeftRadius:mo,borderTopRightRadius:mo,borderBottomLeftRadius:mo,borderBottomRightRadius:mo,boxShadow:fo};function go(t,{layout:e,layoutId:n}){return re.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!yo[t]||"opacity"===t)}function vo(t,e,n){const i=t.style,s=e?.style,o={};if(!i)return o;for(const e in i)(bn(i[e])||s&&bn(s[e])||go(e,t)||void 0!==n?.getValue(e)?.liveStyle)&&(o[e]=i[e]);return o}class xo extends Us{constructor(){super(...arguments),this.type="html",this.renderInstance=ho}mount(t){e.invariant(Boolean(t.style),"motion.create() components must forward their ref to a HTML or SVG element","custom-component-ref"),super.mount(t)}readValueFromInstance(t,e){if(re.has(e))return this.projection?.isProjecting?ee(e):ie(t,e);{const i=(n=t,window.getComputedStyle(n)),s=(d(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof s?s.trim():s}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return ro(t,e)}build(t,e,n){uo(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return vo(t,e,n)}}const To={offset:"stroke-dashoffset",array:"stroke-dasharray"},wo={offset:"strokeDashoffset",array:"strokeDasharray"};function bo(t,e,n=1,i=0,s=!0){t.pathLength=1;const o=s?To:wo;t[o.offset]=""+-i,t[o.array]=`${e} ${n}`}const So=["transform","opacity","offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Vo(t,{attrX:e,attrY:n,attrScale:i,pathLength:s,pathSpacing:o=1,pathOffset:r=0,...a},l,c,u){if(uo(t,a,c),l)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:h,style:d}=t;for(const t of So)void 0!==h[t]&&(d[t]=h[t],delete h[t]);(d.transform||h.transformOrigin)&&(d.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),d.transform&&(d.transformBox=u?.transformBox??"fill-box",delete h.transformBox),void 0!==e&&(h.x=e),void 0!==n&&(h.y=n),void 0!==i&&(h.scale=i),void 0!==s&&bo(h,s,o,r,!1)}const Ao=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),Po=t=>"string"==typeof t&&"svg"===t.toLowerCase();function Mo(t,e,n,i){ho(t,e,void 0,i);for(const n in e.attrs)t.setAttribute(Ao.has(n)?n:An(n),e.attrs[n])}function ko(t,e,n){const i=vo(t,e,n);for(const n in t)if(bn(t[n])||bn(e[n])){i[-1!==oe.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]}return i}const Eo=Ds.length;function Do(t){if(!t)return;if(!t.isControllingVariants){const e=t.parent&&Do(t.parent)||{};return void 0!==t.props.initial&&(e.initial=t.props.initial),e}const e={};for(let n=0;n=.9999&&t.scale<=1.0001||isNaN(t.scale))&&(t.scale=1),(t.translate>=-.01&&t.translate<=.01||isNaN(t.translate))&&(t.translate=0)}function zo(t,e,n,i){Wo(t.x,e.x,n.x,i?i.originX:void 0),Wo(t.y,e.y,n.y,i?i.originY:void 0)}function Ko(t,e,n,i=0){const s=i?q(n.min,n.max,i):n.min;t.min=s+e.min,t.max=t.min+No(e)}function Yo(t,e,n,i){Ko(t.x,e.x,n.x,i?.x),Ko(t.y,e.y,n.y,i?.y)}function Go(t,e,n,i=0){const s=i?q(n.min,n.max,i):n.min;t.min=e.min-s,t.max=t.min+No(e)}function Xo(t,e,n,i){Go(t.x,e.x,n.x,i?.x),Go(t.y,e.y,n.y,i?.y)}function qo(t,e,n,i,s){return t=Hs(t-=e,1/n,i),void 0!==s&&(t=Hs(t,1/s,i)),t}function Ho(t,e=0,n=1,i=.5,s,o=t,r=t){if(D.test(e)){e=parseFloat(e);e=q(r.min,r.max,e/100)-r.min}if("number"!=typeof e)return;let a=q(o.min,o.max,i);t===o&&(a-=e),t.min=qo(t.min,e,n,a,s),t.max=qo(t.max,e,n,a,s)}function Zo(t,e,[n,i,s],o,r){Ho(t,e[n],e[i],e[s],e.scale,o,r)}const _o=["x","scaleX","originX"],Jo=["y","scaleY","originY"];function Qo(t,e,n,i){Zo(t.x,e,_o,n?n.x:void 0,i?i.x:void 0),Zo(t.y,e,Jo,n?n.y:void 0,i?i.y:void 0)}function tr(t){return 0===t.translate&&1===t.scale}function er(t){return tr(t.x)&&tr(t.y)}function nr(t,e){return t.min===e.min&&t.max===e.max}function ir(t,e){return nr(t.x,e.x)&&nr(t.y,e.y)}function sr(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function or(t,e){return sr(t.x,e.x)&&sr(t.y,e.y)}function rr(t){return No(t.x)/No(t.y)}function ar(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function lr(t){return[t("x"),t("y")]}function cr(t,e,n){let i="";const s=t.x.translate/e.x,o=t.y.translate/e.y,r=n?.z||0;if((s||o||r)&&(i=`translate3d(${s}px, ${o}px, ${r}px) `),1===e.x&&1===e.y||(i+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:t,rotate:e,pathRotation:s,rotateX:o,rotateY:r,skewX:a,skewY:l}=n;t&&(i=`perspective(${t}px) ${i}`),e&&(i+=`rotate(${e}deg) `),s&&(i+=`rotate(${s}deg) `),o&&(i+=`rotateX(${o}deg) `),r&&(i+=`rotateY(${r}deg) `),a&&(i+=`skewX(${a}deg) `),l&&(i+=`skewY(${l}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return 1===a&&1===l||(i+=`scale(${a}, ${l})`),i||"none"}const ur=_n.length,hr=t=>"string"==typeof t?parseFloat(t):t,dr=t=>"number"==typeof t||C.test(t);function pr(t,e,n,i,s,o){s?(t.opacity=q(0,n.opacity??1,fr(i)),t.opacityExit=q(e.opacity??1,0,yr(i))):o&&(t.opacity=q(e.opacity??1,n.opacity??1,i));for(let s=0;ssn?1:i(e.progress(t,n,s))}function vr(t,e,n){const i=bn(t)?t:_e(t);return i.start(an("",i,e,n)),i.animation}function xr(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n,i)}const Tr=(t,e)=>t.depth-e.depth;class wr{constructor(){this.children=[],this.isDirty=!1}add(t){e.addUniqueItem(this.children,t),this.isDirty=!0}remove(t){e.removeItem(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Tr),this.isDirty=!1,this.children.forEach(t)}}function br(t,e){const n=u.now(),i=({timestamp:s})=>{const r=s-n;r>=e&&(o(i),t(r-e))};return s.setup(i,!0),()=>o(i)}function Sr(t){return bn(t)?t.get():t}class Vr{constructor(){this.members=[]}add(t){e.addUniqueItem(this.members,t);for(let n=this.members.length-1;n>=0;n--){const i=this.members[n];if(i===t||i===this.lead||i===this.prevLead)continue;const s=i.instance;s&&!1!==s.isConnected||i.snapshot||(e.removeItem(this.members,i),i.unmount())}t.scheduleRender()}remove(t){if(e.removeItem(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){for(let e=this.members.indexOf(t)-1;e>=0;e--){const t=this.members[e];if(!1!==t.isPresent&&!1!==t.instance?.isConnected)return this.promote(t),!0}return!1}promote(t,e){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.updateSnapshot(),t.scheduleRender();const{layoutDependency:i}=n.options,{layoutDependency:s}=t.options;void 0!==i&&i===s||(t.resumeFrom=n,e&&(n.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root?.isUpdating&&(t.isLayoutDirty=!0)),!1===t.options.crossfade&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{t.options.onExitComplete?.(),t.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}const Ar={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Pr={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},Mr=["","X","Y","Z"];let kr=0;function Er(t,e,n,i){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),i&&(i[t]=0))}function Dr(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=kn(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:e,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",s,!(e||i))}const{parent:i}=t;i&&!i.hasCheckedOptimisedAppear&&Dr(i)}function Cr({attachResizeListener:t,defaultParent:n,measureScroll:i,checkIsScrollRoot:l,resetTransform:c}){return class{constructor(t={},e=n?.()){this.id=kr++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Ui.value&&(Pr.nodes=Pr.calculatedTargetDeltas=Pr.calculatedProjections=0),this.nodes.forEach(jr),this.nodes.forEach(zr),this.nodes.forEach(Kr),this.nodes.forEach(Lr),Ui.addProjectionMetrics&&Ui.addProjectionMetrics(Pr)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=t,this.root=e?e.root||e:this,this.path=e?[...e.path,e]:[],this.parent=e,this.depth=e?e.depth+1:0;for(let t=0;tthis.root.updateBlockedByResize=!1;s.read(()=>{i=window.innerWidth}),t(e,()=>{const t=window.innerWidth;t!==i&&(i=t,this.root.updateBlockedByResize=!0,n&&n(),n=br(o,250),Ar.hasAnimatedSinceResize&&(Ar.hasAnimatedSinceResize=!1,this.nodes.forEach(Wr)))})}n&&this.root.registerSharedNode(n,this),!1!==this.options.animate&&o&&(n||i)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeLayoutChanged:n,layout:i})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const s=this.options.transition||o.getDefaultTransition()||Zr,{onLayoutAnimationStart:r,onLayoutAnimationComplete:a}=o.getProps(),l=!this.targetLayout||!or(this.targetLayout,i),c=!e&&n;if(this.options.layoutRoot||this.resumeFrom||c||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const e={...Qe(s,"layout"),onPlay:r,onComplete:a};(o.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e),this.setAnimationOrigin(t,c,e.path)}else e||Wr(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=i})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const t=this.getStack();t&&t.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),o(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Yr),this.animationId++)}getTransformTemplate(){const{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Dr(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||No(this.snapshot.measuredBox.x)||No(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;t{const n=e/1e3,i=p?.(n);var c,m,f,y;i?(r.x.translate=i.x,r.x.scale=q(t.x.scale,1,n),r.x.origin=t.x.origin,r.x.originPoint=t.x.originPoint,r.y.translate=i.y,r.y.scale=q(t.y.scale,1,n),r.y.origin=t.y.origin,r.y.originPoint=t.y.originPoint):(Xr(r.x,t.x,n),Xr(r.y,t.y,n)),this.setTargetDelta(r),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Xo(a,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),c=this.relativeTarget,m=this.relativeTargetOrigin,f=a,y=n,qr(c.x,m.x,f.x,y),qr(c.y,m.y,f.y,y),d&&ir(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||(d={x:{min:0,max:0},y:{min:0,max:0}}),Io(d,this.relativeTarget)),l&&(this.animationValues=o,pr(o,s,this.latestValues,n,h,u)),i&&void 0!==i.rotate&&(this.animationValues||(this.animationValues=o),this.animationValues.pathRotation=i.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(t){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(o(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=s.update(()=>{Ar.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=_e(0)),this.motionValue.jump(0,!1),this.currentAnimation=vr(this.motionValue,[0,1e3],{...t,velocity:0,isSync:!0,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onComplete:()=>{t.onComplete&&t.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const t=this.getStack();t&&t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead();let{targetWithTransforms:e,target:n,layout:i,latestValues:s}=t;if(e&&n&&i){if(this!==t&&this.layout&&i&&ta(this.options.animationType,this.layout.layoutBox,i.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=No(this.layout.layoutBox.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const i=No(this.layout.layoutBox.y);n.y.min=t.target.y.min,n.y.max=n.y.min+i}Io(e,n),oo(e,s),zo(this.projectionDeltaWithTransform,this.layoutCorrected,e,s)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new Vr);this.sharedNodes.get(t).add(e);const n=e.options.initialPromotionConfig;e.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(e):void 0})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){const{layoutId:t}=this.options;return t&&this.getStack()?.lead||this}getPrevLead(){const{layoutId:t}=this.options;return t?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:n}={}){const i=this.getStack();i&&i.promote(this,n),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetSkewAndRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const{latestValues:n}=t;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(e=!0),!e)return;const i={};n.z&&Er("z",t,i,this.animationValues);for(let e=0;et.currentAnimation?.stop()),this.root.nodes.forEach(Or),this.root.sharedNodes.clear()}}}function Rr(t){t.updateLayout()}function Br(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=t.layout,{animationType:s}=t.options,o=e.source!==t.layout.source;if("size"===s)lr(t=>{const i=o?e.measuredBox[t]:e.layoutBox[t],s=No(i);i.min=n[t].min,i.max=i.min+s});else if("x"===s||"y"===s){const t="x"===s?"y":"x";Oo(o?e.measuredBox[t]:e.layoutBox[t],n[t])}else ta(s,e.layoutBox,n)&&lr(i=>{const s=o?e.measuredBox[i]:e.layoutBox[i],r=No(n[i]);s.max=s.min+r,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[i].max=t.relativeTarget[i].min+r)});const r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};zo(r,n,e.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};o?zo(a,t.applyTransform(i,!0),e.measuredBox):zo(a,n,e.layoutBox);const l=!er(r);let c=!1;if(!t.resumeFrom){const i=t.getClosestProjectingParent();if(i&&!i.resumeFrom){const{snapshot:s,layout:o}=i;if(s&&o){const r=t.options.layoutAnchor||void 0,a={x:{min:0,max:0},y:{min:0,max:0}};Xo(a,e.layoutBox,s.layoutBox,r);const l={x:{min:0,max:0},y:{min:0,max:0}};Xo(l,n,o.layoutBox,r),or(a,l)||(c=!0),i.options.layoutRoot&&(t.relativeTarget=l,t.relativeTargetOrigin=a,t.relativeParent=i)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:a,layoutDelta:r,hasLayoutChanged:l,hasRelativeLayoutChanged:c})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function jr(t){Ui.value&&Pr.nodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=Boolean(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function Lr(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Fr(t){t.clearSnapshot()}function Or(t){t.clearMeasurements()}function Ir(t){t.isLayoutDirty=!0,t.updateLayout()}function $r(t){t.isLayoutDirty=!1}function Nr(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function Ur(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Wr(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function zr(t){t.resolveTargetDelta()}function Kr(t){t.calcProjection()}function Yr(t){t.resetSkewAndRotation()}function Gr(t){t.removeLeadSnapshot()}function Xr(t,e,n){t.translate=q(e.translate,0,n),t.scale=q(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function qr(t,e,n,i){t.min=q(e.min,n.min,i),t.max=q(e.max,n.max,i)}function Hr(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const Zr={duration:.45,ease:[.4,0,.1,1]},_r=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Jr=_r("applewebkit/")&&!_r("chrome/")?Math.round:e.noop;function Qr(t){t.min=Jr(t.min),t.max=Jr(t.max)}function ta(t,e,n){return"position"===t||"preserve-aspect"===t&&!Uo(rr(e),rr(n),.2)}function ea(t){return t!==t.root&&t.scroll?.wasRoot}const na=Cr({attachResizeListener:(t,e)=>xr(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),ia=t=>!t.isLayoutDirty&&t.willUpdate(!1);const sa={current:void 0},oa=Cr({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!sa.current){const t=new na({});t.mount(window),t.setOptions({layoutScroll:!0}),sa.current=t}return sa.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),ra="[data-layout],[data-layout-id]",aa=new WeakMap;let la;function ca(t){const e=[];return t instanceof HTMLElement&&t.matches(ra)&&e.push(t),t.querySelectorAll(ra).forEach(t=>{t instanceof HTMLElement&&e.push(t)}),e}function ua(t,e){const n=t.getAttribute("data-layout");return{layoutId:t.getAttribute("data-layout-id")??void 0,layout:null!==n||void 0,animationType:n&&"true"!==n?n:"both",transition:e}}function ha(t,e){let n=aa.get(t);if(n)n.setOptions(ua(t,e));else{let i=Ps.get(t);i||(i=new xo({props:{},presenceContext:null,visualState:{latestValues:{},renderState:{transform:{},transformOrigin:{},style:{},vars:{}}}},{allowProjection:!0})),t.style.transform&&!Gs(i.latestValues)&&(t.style.transform=""),n=new oa(i.latestValues,function(t){let e=t.parentElement;for(;e;){const t=aa.get(e);if(t&&t.instance)return t;e=e.parentElement}}(t)),i.projection=n,n.setOptions({...ua(t,e),visualElement:i}),n.mount(t),aa.set(t,n)}return n.isPresent=!0,n.options.onExitComplete&&n.setOptions({onExitComplete:void 0}),n}function da(t,e){e.setOptions({onExitComplete:void 0});e.getStack()&&!e.isLead()||e.currentAnimation?.stop(),e.unmount(),aa.delete(t)}function pa(){const t=la;la=void 0,function(){if(r.isProcessing)return;const t=u.now();r.delta=e.clamp(0,1e3/60,t-r.timestamp),r.timestamp=t,r.isProcessing=!0,a.update.process(r),a.preRender.process(r),a.render.process(r),r.isProcessing=!1}();const n=new Map;for(const e of t)for(const t of e.collectTargets()){const i=n.get(t);i?i.push(e):n.set(t,[e])}const i=new Map;for(const t of(s=n.keys(),[...s].sort((t,e)=>t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1))){const e=n.get(t),s=ha(t,e[e.length-1].transitionFor(t));for(const n of e)n.adopt(t,s);i.set(t,s)}var s;i.forEach(t=>{t.isLayoutDirty=!1,t.willUpdate()});const o=[];for(const e of t){const t=e.runUpdate();t&&o.push(t)}const l=()=>{const e=new Set;for(const n of t)n.reconcileAdditions(e);for(const n of t)n.reconcileRemovals(e);let n;i.forEach(t=>n||(n=t.root));for(const e of t)n||(n=e.getRoot());n?.didUpdate(),mi.render(()=>{for(const e of t)e.finalize()})};o.length?Promise.all(o).then(l):l()}const ma=s,fa=n.reduce((t,e)=>(t[e]=t=>o(t),t),{});t.AsyncMotionValueAnimation=ze,t.DOMKeyframesResolver=Zn,t.DOMVisualElement=Us,t.DocumentProjectionNode=na,t.Feature=class{constructor(t){this.isMounted=!1,this.node=t}update(){}},t.FlatTree=wr,t.GroupAnimation=Ke,t.GroupAnimationWithThen=class extends Ke{then(t,e){return this.finished.finally(t).then(()=>{})}},t.HTMLProjectionNode=oa,t.HTMLVisualElement=xo,t.JSAnimation=Gt,t.KeyframeResolver=ve,t.LayoutAnimationBuilder=class{constructor(t,e,n){this.scope=t,this.updateDom=e,this.defaultOptions=n,this.sharedTransitions=new Map,this.notifyReady=()=>{},this.rejectReady=()=>{},this.tracked=new Map,this.restorePoints=new Map,this.readyPromise=new Promise((t,e)=>{this.notifyReady=t,this.rejectReady=e}),la||(la=[],queueMicrotask(pa)),la.push(this)}shared(t,e){return this.sharedTransitions.set(t,e),this}then(t,e){return this.readyPromise.then(t,e)}transitionFor(t){const e=t.getAttribute("data-layout-id");return e&&this.sharedTransitions.get(e)||this.defaultOptions}adopt(t,e){this.tracked.set(t,e),this.restorePoints.set(t,{parent:t.parentElement,next:t.nextSibling})}collectTargets(){return ca(this.scope)}runUpdate(){try{const t=this.updateDom();if(t&&"function"==typeof t.then)return t.then(void 0,t=>{this.updateError=t})}catch(t){this.updateError=t}}reconcileAdditions(t){for(const e of ca(this.scope)){if(this.tracked.has(e))continue;const n=ha(e,this.transitionFor(e));this.adopt(e,n),n.options.layoutId&&t.add(n.options.layoutId)}}reconcileRemovals(t){this.tracked.forEach((e,n)=>{if(n.isConnected)return;const i=this.restorePoints.get(n);this.restorePoints.delete(n);const{layoutId:s}=e.options,o=e.getStack(),r=o&&o.members.some(t=>t!==e&&t.instance?.isConnected);if(s&&e.isLead()&&r&&!t.has(s)&&i&&i.parent.isConnected){if(i.parent.insertBefore(n,i.next&&i.next.parentNode===i.parent?i.next:null),e.isPresent=!1,e.setOptions({onExitComplete:()=>{n.remove(),da(n,e)}}),e.relegate())return;n.remove()}da(n,e),this.tracked.delete(n)})}getRoot(){let t;return this.tracked.forEach(e=>t||(t=e.root)),t}finalize(){if(this.updateError)return void this.rejectReady(this.updateError);const t=new Set;this.tracked.forEach(e=>{e.instance&&e.currentAnimation&&t.add(e.currentAnimation)}),this.notifyReady(new Ke([...t]))}},t.MotionValue=Ze,t.NativeAnimation=Re,t.NativeAnimationExtended=Le,t.NativeAnimationWrapper=Ge,t.NodeStack=Vr,t.ObjectVisualElement=class extends Ns{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,e){if(function(t,e){return t in e}(e,t)){const n=t[e];if("string"==typeof n||"number"==typeof n)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(t,e){delete e.output[t]}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}build(t,e){Object.assign(t.output,e)}renderInstance(t,{output:e}){Object.assign(t,e)}sortInstanceNodePosition(){return 0}},t.SVGVisualElement=class extends Us{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=As}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(re.has(e)){const t=Gn(e);return t&&t.default||0}if(So.includes(e)){const n=getComputedStyle(t)[e];if("string"==typeof n&&n)return n.trim()}return e=Ao.has(e)?e:An(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return ko(t,e,n)}build(t,e,n){Vo(t,e,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,e,n,i){Mo(t,e,0,i)}mount(t){this.isSVGTag=Po(t.tagName),super.mount(t)}},t.ViewTransitionBuilder=ws,t.VisualElement=Ns,t.acceleratedValues=Ie,t.addAttrValue=oi,t.addDomEvent=xr,t.addScaleCorrector=function(t){for(const e in t)yo[e]=t[e],d(e)&&(yo[e].isCSSVariable=!0)},t.addStyleValue=hi,t.addValueToWillChange=Vn,t.alpha=v,t.analyseComplexValue=U,t.animateMotionValue=an,t.animateSingleValue=vr,t.animateTarget=Dn,t.animateValue=function(t){return new Gt(t)},t.animateVariant=Cn,t.animateView=function(t,e={}){return new ws(t,e)},t.animateVisualElement=Rn,t.animationMapKey=(t,e="")=>`${t}:${e}`,t.applyAxisDelta=_s,t.applyBoxDelta=Js,t.applyGeneratorOptions=Ce,t.applyPointDelta=Zs,t.applyPxDefaults=function(t,e){for(let n=0;n{const l=a.x-s.x,c=a.y-s.y;let u;u="cw"===i?-t:"ccw"===i?t:(Math.abs(l)>=Math.abs(c)?l:c)<0?-t:t;let h=un(s.x,s.y,a.x,a.y,u,n);if(void 0===i){const t=Math.abs(l){const n={x:ln(t,s.x,h.x,a.x),y:ln(t,s.y,h.y,a.y)};if(o){const i=cn(t,s.x,h.x,a.x,s.y,h.y,a.y),r=d+m*t;n.rotate=e.wrap(-180,180,i-r)*o}return n}}}(t),i={interpolateProjection(t){const e=t.x.translate,i=t.y.translate;if(!(Math.sqrt(e*e+i*i)<20))return n({x:e,y:i},{x:0,y:0})},animateVisualElement(t,e,i,s,o){if(!("x"in e)&&!("y"in e))return;const r=t.getValue("x",t.latestValues.x??0),a=t.getValue("y",t.latestValues.y??0),l=e.x,c=e.y,u=(Array.isArray(l)&&null!=l[0]?l[0]:r?.get())??0,h=(Array.isArray(c)&&null!=c[0]?c[0]:a?.get())??0,d=Array.isArray(l)?l[l.length-1]:l??u,p=Array.isArray(c)?c[c.length-1]:c??h,m=n({x:u,y:h},{x:d,y:p}),f=void 0!==m(0).rotate?t.getValue("pathRotation",0):void 0,y={delay:s,...Qe(i||{},"x")};delete y.path;const g=_e(0);g.start(an("",g,[0,1e3],{...y,isSync:!0,velocity:0,onUpdate:t=>{const e=m(t/1e3);r?.set(e.x),a?.set(e.y),f&&void 0!==e.rotate&&f.set(e.rotate)},onComplete:()=>{r?.set(d),a?.set(p),f?.set(0)},onStop:()=>f?.set(0),onCancel:()=>f?.set(0)})),g.animation&&o.push(g.animation),delete e.x,delete e.y}};return i},t.aspectRatio=rr,t.attachFollow=Gi,t.attachSpring=function(t,e,n){return Gi(t,e,{type:"spring",...n})},t.attrEffect=ri,t.axisDeltaEquals=ar,t.axisEquals=nr,t.axisEqualsRounded=sr,t.boxEquals=ir,t.boxEqualsRounded=or,t.buildHTMLStyles=uo,t.buildProjectionTransform=cr,t.buildSVGAttrs=Vo,t.buildSVGPath=bo,t.buildTransform=co,t.calcAxisDelta=Wo,t.calcBoxDelta=zo,t.calcChildStagger=qe,t.calcGeneratorDuration=ut,t.calcLength=No,t.calcRelativeAxis=Ko,t.calcRelativeAxisPosition=Go,t.calcRelativeBox=Yo,t.calcRelativePosition=Xo,t.camelCaseAttributes=Ao,t.camelToDash=An,t.cancelFrame=o,t.cancelMicrotask=fi,t.cancelSync=fa,t.checkVariantsDidChange=jo,t.cleanDirtyNodes=Lr,t.collectMotionValues=He,t.color=F,t.compareByDepth=Tr,t.complex=K,t.containsCSSVariable=y,t.convertBoundingBoxToBox=Ws,t.convertBoxToBoundingBox=function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}},t.convertOffsetToTimes=Ot,t.copyAxisDeltaInto=$o,t.copyAxisInto=Oo,t.copyBoxInto=Io,t.correctBorderRadius=mo,t.correctBoxShadow=fo,t.createAnimationState=function(t){let e=function(t){return e=>Promise.all(e.map(({animation:e,options:n})=>Rn(t,e,n)))}(t),n=Fo(),i=!0,s=!1;const o=e=>(n,i)=>{const s=yn(t,i,"exit"===e?t.presenceContext?.custom:void 0);if(s){const{transition:t,transitionEnd:e,...i}=s;n={...n,...i,...e}}return n};function r(r){const{props:a}=t,l=Do(t.parent)||{},c=[],u=new Set;let h={},d=1/0;for(let e=0;ed&&y,w=!1;const b=Array.isArray(f)?f:[f];let S=b.reduce(o(p),{});!1===g&&(S={});const{prevResolvedValues:V={}}=m,A={...V,...S},P=e=>{T=!0,u.has(e)&&(w=!0,u.delete(e)),m.needsAnimating[e]=!0;const n=t.getValue(e);n&&(n.liveStyle=!1)};for(const t in A){const e=S[t],n=V[t];if(h.hasOwnProperty(t))continue;let i=!1;i=vn(e)&&vn(n)?!Co(e,n)||x:e!==n,i?null!=e?P(t):u.add(t):void 0!==e&&u.has(t)?P(t):m.protectedKeys[t]=!0}m.prevProp=f,m.prevResolvedValues=S,m.isActive&&(h={...h,...S}),(i||s)&&t.blockInitialAnimation&&(T=!1);const M=v&&x;T&&(!M||w)&&c.push(...b.map(e=>{const n={type:p};if("string"==typeof e&&(i||s)&&!M&&t.manuallyAnimateOnMount&&t.parent){const{parent:i}=t,s=yn(i,e);if(i.enteringChildren&&s){const{delayChildren:e}=s.transition||{};n.delay=qe(i.enteringChildren,t,e)}}return{animation:e,options:n}}))}if(u.size){const e={};if("boolean"!=typeof a.initial){const n=yn(t,Array.isArray(a.initial)?a.initial[0]:a.initial);n&&n.transition&&(e.transition=n.transition)}u.forEach(n=>{const i=t.getBaseTarget(n),s=t.getValue(n);s&&(s.liveStyle=!0),e[n]=i??null}),c.push({animation:e})}let p=Boolean(c.length);return!i||!1!==a.initial&&a.initial!==a.animate||t.manuallyAnimateOnMount||(p=!1),i=!1,s=!1,p?e(c):Promise.resolve()}return{animateChanges:r,setActive:function(e,i){if(n[e].isActive===i)return Promise.resolve();t.variantChildren?.forEach(t=>t.animationState?.setActive(e,i)),n[e].isActive=i;const s=r(e);for(const t in n)n[t].protectedKeys={};return s},setAnimateFunction:function(n){e=n(t)},getState:()=>n,reset:()=>{n=Fo(),s=!0}}},t.createAxis=Vs,t.createAxisDelta=bs,t.createBox=As,t.createDelta=Ss,t.createGeneratorEasing=ht,t.createProjectionNode=Cr,t.createRenderBatcher=i,t.cubicBezierAsString=Pe,t.defaultEasing=It,t.defaultOffset=Ft,t.defaultTransformValue=ee,t.defaultValueTypes=Yn,t.degrees=E,t.delay=br,t.delayInSeconds=function(t,n){return br(t,e.secondsToMilliseconds(n))},t.dimensionValueTypes=jn,t.eachAxis=lr,t.fillOffset=Lt,t.fillWildcards=Xt,t.findDimensionValueType=Ln,t.findValueType=_i,t.flushKeyframeResolvers=ge,t.followValue=Yi,t.frame=s,t.frameData=r,t.frameSteps=a,t.generateLinearEasing=lt,t.getAnimatableNone=qn,t.getAnimationMap=function(t){let e=Xe.get(t);return e||(e=new Map,Xe.set(t,e)),e},t.getComputedStyle=function(t,e){const n=window.getComputedStyle(t);return xe(e)?n.getPropertyValue(e):n[e]},t.getDefaultTransition=sn,t.getDefaultValueType=Gn,t.getFeatureDefinitions=function(){return $s},t.getFinalKeyframe=Ut,t.getMixer=nt,t.getOptimisedAppearId=kn,t.getOriginIndex=zi,t.getValueAsType=ni,t.getValueTransition=Qe,t.getVariableValue=pn,t.getVariantContext=Do,t.getViewAnimationLayerInfo=cs,t.getViewAnimations=us,t.globalProjectionState=Ar,t.has2DTranslate=Xs,t.hasReducedMotionListener=Ls,t.hasScale=Ys,t.hasTransform=Gs,t.hex=M,t.hover=function(t,e,n={}){const[i,s,o]=vi(t,n);return i.forEach(t=>{let n,i=!1,o=!1;const r=e=>{n&&(n(e),n=void 0),t.removeEventListener("pointerleave",l)},a=t=>{i=!1,window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",a),o&&(o=!1,r(t))},l=t=>{"touch"!==t.pointerType&&(i?o=!0:r(t))};t.addEventListener("pointerenter",i=>{if("touch"===i.pointerType||gi())return;o=!1;const r=e(t,i);"function"==typeof r&&(n=r,t.addEventListener("pointerleave",l,s))},s),t.addEventListener("pointerdown",()=>{i=!0,window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",a,s)},s)}),o},t.hsla=L,t.hslaToRgba=G,t.inertia=Bt,t.initPrefersReducedMotion=Os,t.interpolate=jt,t.invisibleValues=Q,t.isAnimationControls=Ms,t.isCSSVariableName=d,t.isCSSVariableToken=m,t.isControllingVariants=Cs,t.isDeltaZero=er,t.isDragActive=gi,t.isDragging=yi,t.isElementKeyboardAccessible=bi,t.isElementTextInput=function(t){return Si.has(t.tagName)||!0===t.isContentEditable},t.isForcedMotionValue=go,t.isGenerator=De,t.isHTMLElement=li,t.isKeyframesTarget=vn,t.isMotionValue=bn,t.isNear=Uo,t.isNodeOrChild=xi,t.isPrimaryPointer=Ti,t.isSVGElement=Ei,t.isSVGSVGElement=Wi,t.isSVGTag=Po,t.isTransitionDefined=rn,t.isVariantLabel=ks,t.isVariantNode=Rs,t.isWaapiSupportedEasing=function t(n){return Boolean("function"==typeof n&&Ae()||!n||"string"==typeof n&&(n in Me||Ae())||e.isBezierDefinition(n)||Array.isArray(n)&&n.every(t))},t.isWillChangeMotionValue=Sn,t.keyframes=$t,t.makeAnimationInstant=Oe,t.mapEasingToNativeEasing=ke,t.mapValue=function(t,e,n,i){const s=Ki(e,n,i);return Hi(()=>s(t.get()))},t.maxGeneratorDuration=ct,t.measurePageBox=function(t,e,n){const i=ro(t,n),{scroll:s}=e;return s&&(no(i.x,s.offset.x),no(i.y,s.offset.y)),i},t.measureViewportBox=ro,t.microtask=mi,t.mix=rt,t.mixArray=it,t.mixColor=J,t.mixComplex=ot,t.mixImmediate=X,t.mixLinearColor=H,t.mixNumber=q,t.mixObject=st,t.mixValues=pr,t.mixVisibility=tt,t.motionValue=_e,t.nodeGroup=function(){const t=new Set,e=new WeakMap,n=()=>t.forEach(ia);return{add:i=>{t.add(i),e.set(i,i.addEventListener("willUpdate",n))},remove:i=>{t.delete(i);const s=e.get(i);s&&(s(),e.delete(i)),n()},dirty:n}},t.number=g,t.numberValueTypes=Kn,t.observeTimeline=function(t,e){let n;const i=()=>{const{currentTime:i}=e,s=(null===i?0:i.value)/100;n!==s&&t(s),n=s};return s.preUpdate(i,!0),()=>o(i)},t.optimizedAppearDataAttribute=Mn,t.optimizedAppearDataId=Pn,t.parseAnimateLayoutArgs=function(t,e,n){return"function"==typeof t?{scope:document,updateDom:t,defaultOptions:e}:{scope:t instanceof Document?t:ti(t)[0]??document,updateDom:e,defaultOptions:n}},t.parseCSSVariable=dn,t.parseValueFromTransform=ne,t.percent=D,t.pixelsToPercent=po,t.positionalKeys=gn,t.prefersReducedMotion=js,t.press=function(t,e,n={}){const[i,s,o]=vi(t,n),r=t=>{const i=t.currentTarget;if(!Mi(t))return;if(ki.has(t))return;Vi.add(i),n.stopPropagation&&ki.add(t);const o=e(i,t),r={...s,capture:!0},a=(t,e)=>{window.removeEventListener("pointerup",l,r),window.removeEventListener("pointercancel",c,r),Vi.has(i)&&Vi.delete(i),Mi(t)&&"function"==typeof o&&o(t,{success:e})},l=t=>{a(t,i===window||i===document||n.useGlobalTarget||xi(i,t.target))},c=t=>{a(t,!1)};window.addEventListener("pointerup",l,r),window.addEventListener("pointercancel",c,r)};return i.forEach(t=>{(n.useGlobalTarget?window:t).addEventListener("pointerdown",r,s),li(t)&&(t.addEventListener("focus",t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const i=Ai(()=>{if(Vi.has(n))return;Pi(n,"down");const t=Ai(()=>{Pi(n,"up")});n.addEventListener("keyup",t,e),n.addEventListener("blur",()=>Pi(n,"cancel"),e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)})(t,s)),bi(t)||t.hasAttribute("tabindex")||(t.tabIndex=0))}),o},t.progressPercentage=j,t.propEffect=ai,t.propagateDirtyNodes=jr,t.px=C,t.readTransformValue=ie,t.recordStats=function(){if(Ui.value)throw Ui.value=null,Ui.addProjectionMetrics=null,new Error("Stats are already being measured");const t=Ui;t.value={layoutProjection:{nodes:[],calculatedTargetDeltas:[],calculatedProjections:[]}},t.addProjectionMetrics=e=>{const{layoutProjection:n}=t.value;n.nodes.push(e.nodes),n.calculatedTargetDeltas.push(e.calculatedTargetDeltas),n.calculatedProjections.push(e.calculatedProjections)}},t.removeAxisDelta=Ho,t.removeAxisTransforms=Zo,t.removeBoxTransforms=Qo,t.removePointDelta=qo,t.renderHTML=ho,t.renderSVG=Mo,t.resize=function(t,e){return"function"==typeof t?Ni(t):Oi(t,e)},t.resolveElements=ti,t.resolveMotionValue=Sr,t.resolveTransition=Je,t.resolveVariant=yn,t.resolveVariantFromProps=fn,t.rgbUnit=A,t.rgba=P,t.rootProjectionNode=sa,t.scale=x,t.scaleCorrectors=yo,t.scalePoint=Hs,t.scrapeHTMLMotionValuesFromProps=vo,t.scrapeSVGMotionValuesFromProps=ko,t.setDragLock=function(t){return"x"===t||"y"===t?yi[t]?null:(yi[t]=!0,()=>{yi[t]=!1}):yi.x||yi.y?null:(yi.x=yi.y=!0,()=>{yi.x=yi.y=!1})},t.setFeatureDefinitions=function(t){$s=t},t.setStyle=Te,t.setTarget=wn,t.spring=Ct,t.springValue=function(t,e){return Yi(t,{type:"spring",...e})},t.stagger=function(t=.1,{startDelay:n=0,from:i=0,ease:s}={}){return(o,r)=>{const a="number"==typeof i?i:zi(i,r),l=Math.abs(a-o);let c=t*l;if(s){const n=r*t;c=e.easingDefinitionToFunction(s)(c/n)*n}return n+c}},t.startWaapiAnimation=Ee,t.statsBuffer=Ui,t.styleEffect=di,t.supportedWaapiEasing=Me,t.supportsBrowserAnimation=We,t.supportsFlags=we,t.supportsLinearEasing=Ae,t.supportsPartialKeyframes=Qn,t.supportsScrollTimeline=Se,t.supportsViewTimeline=Ve,t.svgEffect=pi,t.sync=ma,t.testValueType=Bn,t.time=u,t.transform=Ki,t.transformAxis=io,t.transformBox=oo,t.transformBoxPoints=zs,t.transformPropOrder=oe,t.transformProps=re,t.transformValue=Hi,t.transformValueTypes=zn,t.translateAxis=no,t.updateMotionValuesFromProps=Bs,t.variantPriorityOrder=Es,t.variantProps=Ds,t.vh=R,t.visualElementStore=Ps,t.vw=B}); diff --git a/node_modules/motion-dom/dist/size-rollup-motion-value.js b/node_modules/motion-dom/dist/size-rollup-motion-value.js deleted file mode 100644 index 9ecc640..0000000 --- a/node_modules/motion-dom/dist/size-rollup-motion-value.js +++ /dev/null @@ -1,2 +0,0 @@ -const t={};class e{constructor(){this.subscriptions=[]}add(t){var e,s;return e=this.subscriptions,s=t,-1===e.indexOf(s)&&e.push(s),()=>function(t,e){const s=t.indexOf(e);s>-1&&t.splice(s,1)}(this.subscriptions,t)}notify(t,e,s){const i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](t,e,s);else for(let n=0;nn=!0,c=s.reduce((t,e)=>(t[e]=function(t){let e=new Set,s=new Set,i=!1,n=!1;const r=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function o(e){r.has(e)&&(c.schedule(e),t()),e(a)}const c={schedule:(t,n=!1,a=!1)=>{const o=a&&i?e:s;return n&&r.add(t),o.add(t),t},cancel:t=>{s.delete(t),r.delete(t)},process:t=>{if(a=t,i)return void(n=!0);i=!0;const r=e;e=s,s=r,e.forEach(o),e.clear(),i=!1,n&&(n=!1,c.process(t))}};return c}(o),t),{}),{setup:h,read:d,resolveKeyframes:p,preUpdate:u,update:l,preRender:v,render:m,postRender:f}=c,g=()=>{const s=t.useManualTiming,o=s?a.timestamp:performance.now();n=!1,s||(a.delta=r?1e3/60:Math.max(Math.min(o-a.timestamp,40),1)),a.timestamp=o,a.isProcessing=!0,h.process(a),d.process(a),p.process(a),u.process(a),l.process(a),v.process(a),m.process(a),f.process(a),a.isProcessing=!1,n&&i&&(r=!1,e(g))};return{schedule:s.reduce((t,s)=>{const i=c[s];return t[s]=(t,s=!1,o=!1)=>(n||(n=!0,r=!0,a.isProcessing||e(g)),i.schedule(t,s,o)),t},{}),cancel:t=>{for(let e=0;et,!0);let a;function o(){a=void 0}const c={now:()=>(void 0===a&&c.set(r.isProcessing||t.useManualTiming?r.timestamp:performance.now()),a),set:t=>{a=t,queueMicrotask(o)}},h={current:void 0};class d{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=c.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=c.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,s){this.events[t]||(this.events[t]=new e);const i=this.events[t].add(s);return"change"===t?()=>{i(),n.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,s){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-s}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return h.current&&h.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=c.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return s=parseFloat(this.current)-parseFloat(this.prevFrameValue),(i=e)?s*(1e3/i):0;var s,i}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function p(t,e){return new d(t,e)}export{d as MotionValue,h as collectMotionValues,p as motionValue}; -//# sourceMappingURL=size-rollup-motion-value.js.map diff --git a/node_modules/motion-dom/dist/size-rollup-motion-value.js.map b/node_modules/motion-dom/dist/size-rollup-motion-value.js.map deleted file mode 100644 index 4a69ebd..0000000 --- a/node_modules/motion-dom/dist/size-rollup-motion-value.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"size-rollup-motion-value.js","sources":["../../motion-utils/dist/es/global-config.mjs","../../motion-utils/dist/es/subscription-manager.mjs","../../motion-utils/dist/es/array.mjs","../../motion-utils/dist/es/velocity-per-second.mjs","../lib/frameloop/order.js","../lib/frameloop/batcher.js","../lib/frameloop/render-step.js","../lib/frameloop/frame.js","../../motion-utils/dist/es/noop.mjs","../lib/frameloop/sync-time.js","../lib/value/index.js"],"sourcesContent":["const MotionGlobalConfig = {};\n\nexport { MotionGlobalConfig };\n//# sourceMappingURL=global-config.mjs.map\n","import { addUniqueItem, removeItem } from './array.mjs';\n\nclass SubscriptionManager {\n constructor() {\n this.subscriptions = [];\n }\n add(handler) {\n addUniqueItem(this.subscriptions, handler);\n return () => removeItem(this.subscriptions, handler);\n }\n notify(a, b, c) {\n const numSubscriptions = this.subscriptions.length;\n if (!numSubscriptions)\n return;\n if (numSubscriptions === 1) {\n /**\n * If there's only a single handler we can just call it without invoking a loop.\n */\n this.subscriptions[0](a, b, c);\n }\n else {\n for (let i = 0; i < numSubscriptions; i++) {\n /**\n * Check whether the handler exists before firing as it's possible\n * the subscriptions were modified during this loop running.\n */\n const handler = this.subscriptions[i];\n handler && handler(a, b, c);\n }\n }\n }\n getSize() {\n return this.subscriptions.length;\n }\n clear() {\n this.subscriptions.length = 0;\n }\n}\n\nexport { SubscriptionManager };\n//# sourceMappingURL=subscription-manager.mjs.map\n","function addUniqueItem(arr, item) {\n if (arr.indexOf(item) === -1)\n arr.push(item);\n}\nfunction removeItem(arr, item) {\n const index = arr.indexOf(item);\n if (index > -1)\n arr.splice(index, 1);\n}\n// Adapted from array-move\nfunction moveItem([...arr], fromIndex, toIndex) {\n const startIndex = fromIndex < 0 ? arr.length + fromIndex : fromIndex;\n if (startIndex >= 0 && startIndex < arr.length) {\n const endIndex = toIndex < 0 ? arr.length + toIndex : toIndex;\n const [item] = arr.splice(fromIndex, 1);\n arr.splice(endIndex, 0, item);\n }\n return arr;\n}\n\nexport { addUniqueItem, moveItem, removeItem };\n//# sourceMappingURL=array.mjs.map\n","/*\n Convert velocity into velocity per second\n*/\n/*#__NO_SIDE_EFFECTS__*/\nconst velocityPerSecond = (velocity, frameDuration) => frameDuration ? velocity * (1000 / frameDuration) : 0;\n\nexport { velocityPerSecond };\n//# sourceMappingURL=velocity-per-second.mjs.map\n","export const stepsOrder = [\n \"setup\", // Compute\n \"read\", // Read\n \"resolveKeyframes\", // Write/Read/Write/Read\n \"preUpdate\", // Compute\n \"update\", // Compute\n \"preRender\", // Compute\n \"render\", // Write\n \"postRender\", // Compute\n];\n//# sourceMappingURL=order.js.map","import { MotionGlobalConfig } from \"motion-utils\";\nimport { stepsOrder } from \"./order\";\nimport { createRenderStep } from \"./render-step\";\nconst maxElapsed = 40;\nexport function createRenderBatcher(scheduleNextBatch, allowKeepAlive) {\n let runNextFrame = false;\n let useDefaultElapsed = true;\n const state = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n };\n const flagRunNextFrame = () => (runNextFrame = true);\n const steps = stepsOrder.reduce((acc, key) => {\n acc[key] = createRenderStep(flagRunNextFrame);\n return acc;\n }, {});\n const { setup, read, resolveKeyframes, preUpdate, update, preRender, render, postRender, } = steps;\n const processBatch = () => {\n const useManualTiming = MotionGlobalConfig.useManualTiming;\n const timestamp = useManualTiming\n ? state.timestamp\n : performance.now();\n runNextFrame = false;\n if (!useManualTiming) {\n state.delta = useDefaultElapsed\n ? 1000 / 60\n : Math.max(Math.min(timestamp - state.timestamp, maxElapsed), 1);\n }\n state.timestamp = timestamp;\n state.isProcessing = true;\n // Unrolled render loop for better per-frame performance\n setup.process(state);\n read.process(state);\n resolveKeyframes.process(state);\n preUpdate.process(state);\n update.process(state);\n preRender.process(state);\n render.process(state);\n postRender.process(state);\n state.isProcessing = false;\n if (runNextFrame && allowKeepAlive) {\n useDefaultElapsed = false;\n scheduleNextBatch(processBatch);\n }\n };\n const wake = () => {\n runNextFrame = true;\n useDefaultElapsed = true;\n if (!state.isProcessing) {\n scheduleNextBatch(processBatch);\n }\n };\n const schedule = stepsOrder.reduce((acc, key) => {\n const step = steps[key];\n acc[key] = (process, keepAlive = false, immediate = false) => {\n if (!runNextFrame)\n wake();\n return step.schedule(process, keepAlive, immediate);\n };\n return acc;\n }, {});\n const cancel = (process) => {\n for (let i = 0; i < stepsOrder.length; i++) {\n steps[stepsOrder[i]].cancel(process);\n }\n };\n return { schedule, cancel, state, steps };\n}\n//# sourceMappingURL=batcher.js.map","export function createRenderStep(runNextFrame) {\n /**\n * We create and reuse two queues, one to queue jobs for the current frame\n * and one for the next. We reuse to avoid triggering GC after x frames.\n */\n let thisFrame = new Set();\n let nextFrame = new Set();\n /**\n * Track whether we're currently processing jobs in this step. This way\n * we can decide whether to schedule new jobs for this frame or next.\n */\n let isProcessing = false;\n let flushNextFrame = false;\n /**\n * A set of processes which were marked keepAlive when scheduled.\n */\n const toKeepAlive = new WeakSet();\n let latestFrameData = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n };\n function triggerCallback(callback) {\n if (toKeepAlive.has(callback)) {\n step.schedule(callback);\n runNextFrame();\n }\n callback(latestFrameData);\n }\n const step = {\n /**\n * Schedule a process to run on the next frame.\n */\n schedule: (callback, keepAlive = false, immediate = false) => {\n const addToCurrentFrame = immediate && isProcessing;\n const queue = addToCurrentFrame ? thisFrame : nextFrame;\n if (keepAlive)\n toKeepAlive.add(callback);\n queue.add(callback);\n return callback;\n },\n /**\n * Cancel the provided callback from running on the next frame.\n */\n cancel: (callback) => {\n nextFrame.delete(callback);\n toKeepAlive.delete(callback);\n },\n /**\n * Execute all schedule callbacks.\n */\n process: (frameData) => {\n latestFrameData = frameData;\n /**\n * If we're already processing we've probably been triggered by a flushSync\n * inside an existing process. Instead of executing, mark flushNextFrame\n * as true and ensure we flush the following frame at the end of this one.\n */\n if (isProcessing) {\n flushNextFrame = true;\n return;\n }\n isProcessing = true;\n // Swap this frame and the next to avoid GC\n const prevFrame = thisFrame;\n thisFrame = nextFrame;\n nextFrame = prevFrame;\n // Execute this frame\n thisFrame.forEach(triggerCallback);\n // Clear the frame so no callbacks remain. This is to avoid\n // memory leaks should this render step not run for a while.\n thisFrame.clear();\n isProcessing = false;\n if (flushNextFrame) {\n flushNextFrame = false;\n step.process(frameData);\n }\n },\n };\n return step;\n}\n//# sourceMappingURL=render-step.js.map","import { noop } from \"motion-utils\";\nimport { createRenderBatcher } from \"./batcher\";\nexport const { schedule: frame, cancel: cancelFrame, state: frameData, steps: frameSteps, } = /* @__PURE__ */ createRenderBatcher(typeof requestAnimationFrame !== \"undefined\" ? requestAnimationFrame : noop, true);\n//# sourceMappingURL=frame.js.map","/*#__NO_SIDE_EFFECTS__*/\nconst noop = (any) => any;\n\nexport { noop };\n//# sourceMappingURL=noop.mjs.map\n","import { MotionGlobalConfig } from \"motion-utils\";\nimport { frameData } from \"./frame\";\nlet now;\nfunction clearTime() {\n now = undefined;\n}\n/**\n * An eventloop-synchronous alternative to performance.now().\n *\n * Ensures that time measurements remain consistent within a synchronous context.\n * Usually calling performance.now() twice within the same synchronous context\n * will return different values which isn't useful for animations when we're usually\n * trying to sync animations to the same frame.\n */\nexport const time = {\n now: () => {\n if (now === undefined) {\n time.set(frameData.isProcessing || MotionGlobalConfig.useManualTiming\n ? frameData.timestamp\n : performance.now());\n }\n return now;\n },\n set: (newTime) => {\n now = newTime;\n queueMicrotask(clearTime);\n },\n};\n//# sourceMappingURL=sync-time.js.map","import { SubscriptionManager, velocityPerSecond, warnOnce, } from \"motion-utils\";\nimport { frame } from \"../frameloop\";\nimport { time } from \"../frameloop/sync-time\";\n/**\n * Maximum time between the value of two frames, beyond which we\n * assume the velocity has since been 0.\n */\nconst MAX_VELOCITY_DELTA = 30;\nconst isFloat = (value) => {\n return !isNaN(parseFloat(value));\n};\nexport const collectMotionValues = {\n current: undefined,\n};\n/**\n * `MotionValue` is used to track the state and velocity of motion values.\n *\n * @public\n */\nexport class MotionValue {\n /**\n * @param init - The initiating value\n * @param config - Optional configuration options\n *\n * - `transformer`: A function to transform incoming values with.\n */\n constructor(init, options = {}) {\n /**\n * Tracks whether this value can output a velocity. Currently this is only true\n * if the value is numerical, but we might be able to widen the scope here and support\n * other value types.\n *\n * @internal\n */\n this.canTrackVelocity = null;\n /**\n * An object containing a SubscriptionManager for each active event.\n */\n this.events = {};\n this.updateAndNotify = (v) => {\n const currentTime = time.now();\n /**\n * If we're updating the value during another frame or eventloop\n * than the previous frame, then the we set the previous frame value\n * to current.\n */\n if (this.updatedAt !== currentTime) {\n this.setPrevFrameValue();\n }\n this.prev = this.current;\n this.setCurrent(v);\n // Update update subscribers\n if (this.current !== this.prev) {\n this.events.change?.notify(this.current);\n if (this.dependents) {\n for (const dependent of this.dependents) {\n dependent.dirty();\n }\n }\n }\n };\n this.hasAnimated = false;\n this.setCurrent(init);\n this.owner = options.owner;\n }\n setCurrent(current) {\n this.current = current;\n this.updatedAt = time.now();\n if (this.canTrackVelocity === null && current !== undefined) {\n this.canTrackVelocity = isFloat(this.current);\n }\n }\n setPrevFrameValue(prevFrameValue = this.current) {\n this.prevFrameValue = prevFrameValue;\n this.prevUpdatedAt = this.updatedAt;\n }\n /**\n * Adds a function that will be notified when the `MotionValue` is updated.\n *\n * It returns a function that, when called, will cancel the subscription.\n *\n * When calling `onChange` inside a React component, it should be wrapped with the\n * `useEffect` hook. As it returns an unsubscribe function, this should be returned\n * from the `useEffect` function to ensure you don't add duplicate subscribers..\n *\n * ```jsx\n * export const MyComponent = () => {\n * const x = useMotionValue(0)\n * const y = useMotionValue(0)\n * const opacity = useMotionValue(1)\n *\n * useEffect(() => {\n * function updateOpacity() {\n * const maxXY = Math.max(x.get(), y.get())\n * const newOpacity = transform(maxXY, [0, 100], [1, 0])\n * opacity.set(newOpacity)\n * }\n *\n * const unsubscribeX = x.on(\"change\", updateOpacity)\n * const unsubscribeY = y.on(\"change\", updateOpacity)\n *\n * return () => {\n * unsubscribeX()\n * unsubscribeY()\n * }\n * }, [])\n *\n * return \n * }\n * ```\n *\n * @param subscriber - A function that receives the latest value.\n * @returns A function that, when called, will cancel this subscription.\n *\n * @deprecated\n */\n onChange(subscription) {\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(false, `value.onChange(callback) is deprecated. Switch to value.on(\"change\", callback).`);\n }\n return this.on(\"change\", subscription);\n }\n on(eventName, callback) {\n if (!this.events[eventName]) {\n this.events[eventName] = new SubscriptionManager();\n }\n const unsubscribe = this.events[eventName].add(callback);\n if (eventName === \"change\") {\n return () => {\n unsubscribe();\n /**\n * If we have no more change listeners by the start\n * of the next frame, stop active animations.\n */\n frame.read(() => {\n if (!this.events.change.getSize()) {\n this.stop();\n }\n });\n };\n }\n return unsubscribe;\n }\n clearListeners() {\n for (const eventManagers in this.events) {\n this.events[eventManagers].clear();\n }\n }\n /**\n * Attaches a passive effect to the `MotionValue`.\n */\n attach(passiveEffect, stopPassiveEffect) {\n this.passiveEffect = passiveEffect;\n this.stopPassiveEffect = stopPassiveEffect;\n }\n /**\n * Sets the state of the `MotionValue`.\n *\n * @remarks\n *\n * ```jsx\n * const x = useMotionValue(0)\n * x.set(10)\n * ```\n *\n * @param latest - Latest value to set.\n * @param render - Whether to notify render subscribers. Defaults to `true`\n *\n * @public\n */\n set(v) {\n if (!this.passiveEffect) {\n this.updateAndNotify(v);\n }\n else {\n this.passiveEffect(v, this.updateAndNotify);\n }\n }\n setWithVelocity(prev, current, delta) {\n this.set(current);\n this.prev = undefined;\n this.prevFrameValue = prev;\n this.prevUpdatedAt = this.updatedAt - delta;\n }\n /**\n * Set the state of the `MotionValue`, stopping any active animations,\n * effects, and resets velocity to `0`.\n */\n jump(v, endAnimation = true) {\n this.updateAndNotify(v);\n this.prev = v;\n this.prevUpdatedAt = this.prevFrameValue = undefined;\n endAnimation && this.stop();\n if (this.stopPassiveEffect)\n this.stopPassiveEffect();\n }\n dirty() {\n this.events.change?.notify(this.current);\n }\n addDependent(dependent) {\n if (!this.dependents) {\n this.dependents = new Set();\n }\n this.dependents.add(dependent);\n }\n removeDependent(dependent) {\n if (this.dependents) {\n this.dependents.delete(dependent);\n }\n }\n /**\n * Returns the latest state of `MotionValue`\n *\n * @returns - The latest state of `MotionValue`\n *\n * @public\n */\n get() {\n if (collectMotionValues.current) {\n collectMotionValues.current.push(this);\n }\n return this.current;\n }\n /**\n * @public\n */\n getPrevious() {\n return this.prev;\n }\n /**\n * Returns the latest velocity of `MotionValue`\n *\n * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical.\n *\n * @public\n */\n getVelocity() {\n const currentTime = time.now();\n if (!this.canTrackVelocity ||\n this.prevFrameValue === undefined ||\n currentTime - this.updatedAt > MAX_VELOCITY_DELTA) {\n return 0;\n }\n const delta = Math.min(this.updatedAt - this.prevUpdatedAt, MAX_VELOCITY_DELTA);\n // Casts because of parseFloat's poor typing\n return velocityPerSecond(parseFloat(this.current) -\n parseFloat(this.prevFrameValue), delta);\n }\n /**\n * Registers a new animation to control this `MotionValue`. Only one\n * animation can drive a `MotionValue` at one time.\n *\n * ```jsx\n * value.start()\n * ```\n *\n * @param animation - A function that starts the provided animation\n */\n start(startAnimation) {\n this.stop();\n return new Promise((resolve) => {\n this.hasAnimated = true;\n this.animation = startAnimation(resolve);\n if (this.events.animationStart) {\n this.events.animationStart.notify();\n }\n }).then(() => {\n if (this.events.animationComplete) {\n this.events.animationComplete.notify();\n }\n this.clearAnimation();\n });\n }\n /**\n * Stop the currently active animation.\n *\n * @public\n */\n stop() {\n if (this.animation) {\n this.animation.stop();\n if (this.events.animationCancel) {\n this.events.animationCancel.notify();\n }\n }\n this.clearAnimation();\n }\n /**\n * Returns `true` if this value is currently animating.\n *\n * @public\n */\n isAnimating() {\n return !!this.animation;\n }\n clearAnimation() {\n delete this.animation;\n }\n /**\n * Destroy and clean up subscribers to this `MotionValue`.\n *\n * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically\n * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually\n * created a `MotionValue` via the `motionValue` function.\n *\n * @public\n */\n destroy() {\n this.dependents?.clear();\n this.events.destroy?.notify();\n this.clearListeners();\n this.stop();\n if (this.stopPassiveEffect) {\n this.stopPassiveEffect();\n }\n }\n}\nexport function motionValue(init, options) {\n return new MotionValue(init, options);\n}\n//# sourceMappingURL=index.js.map"],"names":["MotionGlobalConfig","SubscriptionManager","constructor","this","subscriptions","add","handler","arr","item","indexOf","push","index","splice","removeItem","notify","a","b","c","numSubscriptions","length","i","getSize","clear","stepsOrder","createRenderBatcher","scheduleNextBatch","allowKeepAlive","runNextFrame","useDefaultElapsed","state","delta","timestamp","isProcessing","flagRunNextFrame","steps","reduce","acc","key","thisFrame","Set","nextFrame","flushNextFrame","toKeepAlive","WeakSet","latestFrameData","triggerCallback","callback","has","step","schedule","keepAlive","immediate","queue","cancel","delete","process","frameData","prevFrame","forEach","createRenderStep","setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender","processBatch","useManualTiming","performance","now","Math","max","min","frame","requestAnimationFrame","any","clearTime","undefined","time","set","newTime","queueMicrotask","collectMotionValues","current","MotionValue","init","options","canTrackVelocity","events","updateAndNotify","v","currentTime","updatedAt","setPrevFrameValue","prev","setCurrent","change","dependents","dependent","dirty","hasAnimated","owner","value","isNaN","parseFloat","prevFrameValue","prevUpdatedAt","onChange","subscription","on","eventName","unsubscribe","stop","clearListeners","eventManagers","attach","passiveEffect","stopPassiveEffect","setWithVelocity","jump","endAnimation","addDependent","removeDependent","get","getPrevious","getVelocity","velocity","frameDuration","start","startAnimation","Promise","resolve","animation","animationStart","then","animationComplete","clearAnimation","animationCancel","isAnimating","destroy","motionValue"],"mappings":"AAAA,MAAMA,EAAqB,CAAA,ECE3B,MAAMC,EACF,WAAAC,GACIC,KAAKC,cAAgB,EACzB,CACA,GAAAC,CAAIC,GCNR,IAAuBC,EAAKC,EDQpB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OACD/G,KAAKoH,mBACLpH,KAAKoH,mBAEb,EAEG,SAASuB,EAAYvD,EAAMC,GAC9B,OAAO,IAAIF,EAAYC,EAAMC,EACjC"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/size-rollup-style-effect.js b/node_modules/motion-dom/dist/size-rollup-style-effect.js deleted file mode 100644 index 0ec672e..0000000 --- a/node_modules/motion-dom/dist/size-rollup-style-effect.js +++ /dev/null @@ -1,2 +0,0 @@ -const t=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],e=(()=>new Set([...t,"pathRotation"]))();const s={};class n{constructor(){this.subscriptions=[]}add(t){var e,s;return e=this.subscriptions,s=t,-1===e.indexOf(s)&&e.push(s),()=>function(t,e){const s=t.indexOf(e);s>-1&&t.splice(s,1)}(this.subscriptions,t)}notify(t,e,s){const n=this.subscriptions.length;if(n)if(1===n)this.subscriptions[0](t,e,s);else for(let i=0;in=!0,c=i.reduce((t,e)=>(t[e]=function(t){let e=new Set,s=new Set,n=!1,i=!1;const r=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function o(e){r.has(e)&&(c.schedule(e),t()),e(a)}const c={schedule:(t,i=!1,a=!1)=>{const o=a&&n?e:s;return i&&r.add(t),o.add(t),t},cancel:t=>{s.delete(t),r.delete(t)},process:t=>{if(a=t,n)return void(i=!0);n=!0;const r=e;e=s,s=r,e.forEach(o),e.clear(),n=!1,i&&(i=!1,c.process(t))}};return c}(o),t),{}),{setup:d,read:h,resolveKeyframes:p,preUpdate:l,update:u,preRender:f,render:m,postRender:g}=c,v=()=>{const i=s.useManualTiming,o=i?a.timestamp:performance.now();n=!1,i||(a.delta=r?1e3/60:Math.max(Math.min(o-a.timestamp,40),1)),a.timestamp=o,a.isProcessing=!0,d.process(a),h.process(a),p.process(a),l.process(a),u.process(a),f.process(a),m.process(a),g.process(a),a.isProcessing=!1,n&&e&&(r=!1,t(v))};return{schedule:i.reduce((e,s)=>{const i=c[s];return e[s]=(e,s=!1,o=!1)=>(n||(n=!0,r=!0,a.isProcessing||t(v)),i.schedule(e,s,o)),e},{}),cancel:t=>{for(let e=0;et,!0);let d;function h(){d=void 0}const p={now:()=>(void 0===d&&p.set(c.isProcessing||s.useManualTiming?c.timestamp:performance.now()),d),set:t=>{d=t,queueMicrotask(h)}};class l{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=p.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=p.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new n);const s=this.events[t].add(e);return"change"===t?()=>{s(),a.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,s){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-s}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=p.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return s=parseFloat(this.current)-parseFloat(this.prevFrameValue),(n=e)?s*(1e3/n):0;var s,n}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function u(t){return(e,s)=>{const n=function(t){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){const e=document.querySelectorAll(t);return e?Array.from(e):[]}return Array.from(t).filter(t=>null!=t)}(e),i=[];for(const e of n){const n=t(e,s);i.push(n)}return()=>{for(const t of i)t()}}}const f={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},m={...f,transform:t=>((t,e,s)=>s>e?e:s({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),w=y("deg"),b=y("%"),k=y("px"),A=(()=>({...b,parse:t=>b.parse(t)/100,transform:t=>b.transform(100*t)}))(),P={borderWidth:k,borderTopWidth:k,borderRightWidth:k,borderBottomWidth:k,borderLeftWidth:k,borderRadius:k,borderTopLeftRadius:k,borderTopRightRadius:k,borderBottomRightRadius:k,borderBottomLeftRadius:k,width:k,maxWidth:k,height:k,maxHeight:k,top:k,right:k,bottom:k,left:k,inset:k,insetBlock:k,insetBlockStart:k,insetBlockEnd:k,insetInline:k,insetInlineStart:k,insetInlineEnd:k,padding:k,paddingTop:k,paddingRight:k,paddingBottom:k,paddingLeft:k,paddingBlock:k,paddingBlockStart:k,paddingBlockEnd:k,paddingInline:k,paddingInlineStart:k,paddingInlineEnd:k,margin:k,marginTop:k,marginRight:k,marginBottom:k,marginLeft:k,marginBlock:k,marginBlockStart:k,marginBlockEnd:k,marginInline:k,marginInlineStart:k,marginInlineEnd:k,fontSize:k,backgroundPositionX:k,backgroundPositionY:k,...{rotate:w,pathRotation:w,rotateX:w,rotateY:w,rotateZ:w,scale:g,scaleX:g,scaleY:g,scaleZ:g,skew:w,skewX:w,skewY:w,distance:k,translateX:k,translateY:k,translateZ:k,x:k,y:k,z:k,perspective:k,transformPerspective:k,opacity:m,originX:A,originY:A,originZ:k},zIndex:v,fillOpacity:m,strokeOpacity:m,numOctaves:v};class R{constructor(){this.latest={},this.values=new Map}set(t,e,s,n,i=!0){const r=this.values.get(t);r&&r.onRemove();const c=()=>{const n=e.get();this.latest[t]=i?((t,e)=>e&&"number"==typeof t?e.transform(t):t)(n,P[t]):n,s&&a.render(s)};c();const d=e.on("change",c);n&&e.addDependent(n);const h=()=>{d(),s&&o(s),this.values.delete(t),n&&e.removeDependent(n)};return this.values.set(t,{value:e,onRemove:h}),h}get(t){return this.values.get(t)?.value}}function S(t){const e=new WeakMap;return(s,n)=>{const i=e.get(s)??new R;e.set(s,i);const r=[];for(const e in n){const a=n[e],o=t(s,i,e,a);r.push(o)}return()=>{for(const t of r)t()}}}const E={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"};const B=new Set(["originX","originY","originZ"]),F=(s,n,i,r)=>{let a,o;return e.has(i)?(n.get("transform")||(function(t){return"object"==typeof(e=t)&&null!==e&&"offsetHeight"in t&&!("ownerSVGElement"in t);var e}(s)||n.get("transformBox")||F(s,n,"transformBox",new l("fill-box")),n.set("transform",new l("none"),()=>{s.style.transform=function(e){let s="",n=!0;for(let i=0;i{const t=n.latest.originX??"50%",e=n.latest.originY??"50%",i=n.latest.originZ??0;s.style.transformOrigin=`${t} ${e} ${i}`}),o=n.get("transformOrigin")):a=i.startsWith("--")?()=>{s.style.setProperty(i,n.latest[i])}:()=>{s.style[i]=n.latest[i]},n.set(i,r,a,o)},x=u(S(F));export{F as addStyleValue,x as styleEffect}; -//# sourceMappingURL=size-rollup-style-effect.js.map diff --git a/node_modules/motion-dom/dist/size-rollup-style-effect.js.map b/node_modules/motion-dom/dist/size-rollup-style-effect.js.map deleted file mode 100644 index be95fc0..0000000 --- a/node_modules/motion-dom/dist/size-rollup-style-effect.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"size-rollup-style-effect.js","sources":["../lib/render/dom/is-css-var.js","../lib/render/utils/keys-transform.js","../../motion-utils/dist/es/clamp.mjs","../../motion-utils/dist/es/global-config.mjs","../../motion-utils/dist/es/subscription-manager.mjs","../../motion-utils/dist/es/array.mjs","../lib/frameloop/order.js","../lib/frameloop/batcher.js","../lib/frameloop/render-step.js","../lib/frameloop/frame.js","../../motion-utils/dist/es/noop.mjs","../lib/frameloop/sync-time.js","../lib/value/index.js","../../motion-utils/dist/es/velocity-per-second.mjs","../lib/effects/utils/create-dom-effect.js","../lib/utils/resolve-elements.js","../lib/value/types/numbers/index.js","../lib/value/types/int.js","../lib/value/types/numbers/units.js","../lib/value/types/maps/number.js","../lib/value/types/maps/transform.js","../lib/effects/MotionValueState.js","../lib/value/types/utils/get-as-type.js","../lib/effects/utils/create-effect.js","../lib/effects/style/transform.js","../lib/effects/style/index.js","../lib/utils/is-html-element.js","../../motion-utils/dist/es/is-object.mjs"],"sourcesContent":["export const isCSSVar = (name) => name.startsWith(\"--\");\n//# sourceMappingURL=is-css-var.js.map","/**\n * Generate a list of every possible transform key.\n */\nexport const transformPropOrder = [\n \"transformPerspective\",\n \"x\",\n \"y\",\n \"z\",\n \"translateX\",\n \"translateY\",\n \"translateZ\",\n \"scale\",\n \"scaleX\",\n \"scaleY\",\n \"rotate\",\n \"rotateX\",\n \"rotateY\",\n \"rotateZ\",\n \"skew\",\n \"skewX\",\n \"skewY\",\n];\n/**\n * A quick lookup for transform props.\n *\n * `pathRotation` is a transform for routing purposes (skipped from raw\n * style application, wired to the transform composite, flags transform\n * dirty) but is intentionally NOT in `transformPropOrder` — it is\n * composed onto `rotate` at the build sites, not serialized in its own\n * slot, and must stay out of the order-array consumers (parse-transform,\n * unit-conversion, keys-position).\n */\nexport const transformProps = /*@__PURE__*/ (() => new Set([...transformPropOrder, \"pathRotation\"]))();\n//# sourceMappingURL=keys-transform.js.map","const clamp = (min, max, v) => {\n if (v > max)\n return max;\n if (v < min)\n return min;\n return v;\n};\n\nexport { clamp };\n//# sourceMappingURL=clamp.mjs.map\n","const MotionGlobalConfig = {};\n\nexport { MotionGlobalConfig };\n//# sourceMappingURL=global-config.mjs.map\n","import { addUniqueItem, removeItem } from './array.mjs';\n\nclass SubscriptionManager {\n constructor() {\n this.subscriptions = [];\n }\n add(handler) {\n addUniqueItem(this.subscriptions, handler);\n return () => removeItem(this.subscriptions, handler);\n }\n notify(a, b, c) {\n const numSubscriptions = this.subscriptions.length;\n if (!numSubscriptions)\n return;\n if (numSubscriptions === 1) {\n /**\n * If there's only a single handler we can just call it without invoking a loop.\n */\n this.subscriptions[0](a, b, c);\n }\n else {\n for (let i = 0; i < numSubscriptions; i++) {\n /**\n * Check whether the handler exists before firing as it's possible\n * the subscriptions were modified during this loop running.\n */\n const handler = this.subscriptions[i];\n handler && handler(a, b, c);\n }\n }\n }\n getSize() {\n return this.subscriptions.length;\n }\n clear() {\n this.subscriptions.length = 0;\n }\n}\n\nexport { SubscriptionManager };\n//# sourceMappingURL=subscription-manager.mjs.map\n","function addUniqueItem(arr, item) {\n if (arr.indexOf(item) === -1)\n arr.push(item);\n}\nfunction removeItem(arr, item) {\n const index = arr.indexOf(item);\n if (index > -1)\n arr.splice(index, 1);\n}\n// Adapted from array-move\nfunction moveItem([...arr], fromIndex, toIndex) {\n const startIndex = fromIndex < 0 ? arr.length + fromIndex : fromIndex;\n if (startIndex >= 0 && startIndex < arr.length) {\n const endIndex = toIndex < 0 ? arr.length + toIndex : toIndex;\n const [item] = arr.splice(fromIndex, 1);\n arr.splice(endIndex, 0, item);\n }\n return arr;\n}\n\nexport { addUniqueItem, moveItem, removeItem };\n//# sourceMappingURL=array.mjs.map\n","export const stepsOrder = [\n \"setup\", // Compute\n \"read\", // Read\n \"resolveKeyframes\", // Write/Read/Write/Read\n \"preUpdate\", // Compute\n \"update\", // Compute\n \"preRender\", // Compute\n \"render\", // Write\n \"postRender\", // Compute\n];\n//# sourceMappingURL=order.js.map","import { MotionGlobalConfig } from \"motion-utils\";\nimport { stepsOrder } from \"./order\";\nimport { createRenderStep } from \"./render-step\";\nconst maxElapsed = 40;\nexport function createRenderBatcher(scheduleNextBatch, allowKeepAlive) {\n let runNextFrame = false;\n let useDefaultElapsed = true;\n const state = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n };\n const flagRunNextFrame = () => (runNextFrame = true);\n const steps = stepsOrder.reduce((acc, key) => {\n acc[key] = createRenderStep(flagRunNextFrame);\n return acc;\n }, {});\n const { setup, read, resolveKeyframes, preUpdate, update, preRender, render, postRender, } = steps;\n const processBatch = () => {\n const useManualTiming = MotionGlobalConfig.useManualTiming;\n const timestamp = useManualTiming\n ? state.timestamp\n : performance.now();\n runNextFrame = false;\n if (!useManualTiming) {\n state.delta = useDefaultElapsed\n ? 1000 / 60\n : Math.max(Math.min(timestamp - state.timestamp, maxElapsed), 1);\n }\n state.timestamp = timestamp;\n state.isProcessing = true;\n // Unrolled render loop for better per-frame performance\n setup.process(state);\n read.process(state);\n resolveKeyframes.process(state);\n preUpdate.process(state);\n update.process(state);\n preRender.process(state);\n render.process(state);\n postRender.process(state);\n state.isProcessing = false;\n if (runNextFrame && allowKeepAlive) {\n useDefaultElapsed = false;\n scheduleNextBatch(processBatch);\n }\n };\n const wake = () => {\n runNextFrame = true;\n useDefaultElapsed = true;\n if (!state.isProcessing) {\n scheduleNextBatch(processBatch);\n }\n };\n const schedule = stepsOrder.reduce((acc, key) => {\n const step = steps[key];\n acc[key] = (process, keepAlive = false, immediate = false) => {\n if (!runNextFrame)\n wake();\n return step.schedule(process, keepAlive, immediate);\n };\n return acc;\n }, {});\n const cancel = (process) => {\n for (let i = 0; i < stepsOrder.length; i++) {\n steps[stepsOrder[i]].cancel(process);\n }\n };\n return { schedule, cancel, state, steps };\n}\n//# sourceMappingURL=batcher.js.map","export function createRenderStep(runNextFrame) {\n /**\n * We create and reuse two queues, one to queue jobs for the current frame\n * and one for the next. We reuse to avoid triggering GC after x frames.\n */\n let thisFrame = new Set();\n let nextFrame = new Set();\n /**\n * Track whether we're currently processing jobs in this step. This way\n * we can decide whether to schedule new jobs for this frame or next.\n */\n let isProcessing = false;\n let flushNextFrame = false;\n /**\n * A set of processes which were marked keepAlive when scheduled.\n */\n const toKeepAlive = new WeakSet();\n let latestFrameData = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n };\n function triggerCallback(callback) {\n if (toKeepAlive.has(callback)) {\n step.schedule(callback);\n runNextFrame();\n }\n callback(latestFrameData);\n }\n const step = {\n /**\n * Schedule a process to run on the next frame.\n */\n schedule: (callback, keepAlive = false, immediate = false) => {\n const addToCurrentFrame = immediate && isProcessing;\n const queue = addToCurrentFrame ? thisFrame : nextFrame;\n if (keepAlive)\n toKeepAlive.add(callback);\n queue.add(callback);\n return callback;\n },\n /**\n * Cancel the provided callback from running on the next frame.\n */\n cancel: (callback) => {\n nextFrame.delete(callback);\n toKeepAlive.delete(callback);\n },\n /**\n * Execute all schedule callbacks.\n */\n process: (frameData) => {\n latestFrameData = frameData;\n /**\n * If we're already processing we've probably been triggered by a flushSync\n * inside an existing process. Instead of executing, mark flushNextFrame\n * as true and ensure we flush the following frame at the end of this one.\n */\n if (isProcessing) {\n flushNextFrame = true;\n return;\n }\n isProcessing = true;\n // Swap this frame and the next to avoid GC\n const prevFrame = thisFrame;\n thisFrame = nextFrame;\n nextFrame = prevFrame;\n // Execute this frame\n thisFrame.forEach(triggerCallback);\n // Clear the frame so no callbacks remain. This is to avoid\n // memory leaks should this render step not run for a while.\n thisFrame.clear();\n isProcessing = false;\n if (flushNextFrame) {\n flushNextFrame = false;\n step.process(frameData);\n }\n },\n };\n return step;\n}\n//# sourceMappingURL=render-step.js.map","import { noop } from \"motion-utils\";\nimport { createRenderBatcher } from \"./batcher\";\nexport const { schedule: frame, cancel: cancelFrame, state: frameData, steps: frameSteps, } = /* @__PURE__ */ createRenderBatcher(typeof requestAnimationFrame !== \"undefined\" ? requestAnimationFrame : noop, true);\n//# sourceMappingURL=frame.js.map","/*#__NO_SIDE_EFFECTS__*/\nconst noop = (any) => any;\n\nexport { noop };\n//# sourceMappingURL=noop.mjs.map\n","import { MotionGlobalConfig } from \"motion-utils\";\nimport { frameData } from \"./frame\";\nlet now;\nfunction clearTime() {\n now = undefined;\n}\n/**\n * An eventloop-synchronous alternative to performance.now().\n *\n * Ensures that time measurements remain consistent within a synchronous context.\n * Usually calling performance.now() twice within the same synchronous context\n * will return different values which isn't useful for animations when we're usually\n * trying to sync animations to the same frame.\n */\nexport const time = {\n now: () => {\n if (now === undefined) {\n time.set(frameData.isProcessing || MotionGlobalConfig.useManualTiming\n ? frameData.timestamp\n : performance.now());\n }\n return now;\n },\n set: (newTime) => {\n now = newTime;\n queueMicrotask(clearTime);\n },\n};\n//# sourceMappingURL=sync-time.js.map","import { SubscriptionManager, velocityPerSecond, warnOnce, } from \"motion-utils\";\nimport { frame } from \"../frameloop\";\nimport { time } from \"../frameloop/sync-time\";\n/**\n * Maximum time between the value of two frames, beyond which we\n * assume the velocity has since been 0.\n */\nconst MAX_VELOCITY_DELTA = 30;\nconst isFloat = (value) => {\n return !isNaN(parseFloat(value));\n};\nexport const collectMotionValues = {\n current: undefined,\n};\n/**\n * `MotionValue` is used to track the state and velocity of motion values.\n *\n * @public\n */\nexport class MotionValue {\n /**\n * @param init - The initiating value\n * @param config - Optional configuration options\n *\n * - `transformer`: A function to transform incoming values with.\n */\n constructor(init, options = {}) {\n /**\n * Tracks whether this value can output a velocity. Currently this is only true\n * if the value is numerical, but we might be able to widen the scope here and support\n * other value types.\n *\n * @internal\n */\n this.canTrackVelocity = null;\n /**\n * An object containing a SubscriptionManager for each active event.\n */\n this.events = {};\n this.updateAndNotify = (v) => {\n const currentTime = time.now();\n /**\n * If we're updating the value during another frame or eventloop\n * than the previous frame, then the we set the previous frame value\n * to current.\n */\n if (this.updatedAt !== currentTime) {\n this.setPrevFrameValue();\n }\n this.prev = this.current;\n this.setCurrent(v);\n // Update update subscribers\n if (this.current !== this.prev) {\n this.events.change?.notify(this.current);\n if (this.dependents) {\n for (const dependent of this.dependents) {\n dependent.dirty();\n }\n }\n }\n };\n this.hasAnimated = false;\n this.setCurrent(init);\n this.owner = options.owner;\n }\n setCurrent(current) {\n this.current = current;\n this.updatedAt = time.now();\n if (this.canTrackVelocity === null && current !== undefined) {\n this.canTrackVelocity = isFloat(this.current);\n }\n }\n setPrevFrameValue(prevFrameValue = this.current) {\n this.prevFrameValue = prevFrameValue;\n this.prevUpdatedAt = this.updatedAt;\n }\n /**\n * Adds a function that will be notified when the `MotionValue` is updated.\n *\n * It returns a function that, when called, will cancel the subscription.\n *\n * When calling `onChange` inside a React component, it should be wrapped with the\n * `useEffect` hook. As it returns an unsubscribe function, this should be returned\n * from the `useEffect` function to ensure you don't add duplicate subscribers..\n *\n * ```jsx\n * export const MyComponent = () => {\n * const x = useMotionValue(0)\n * const y = useMotionValue(0)\n * const opacity = useMotionValue(1)\n *\n * useEffect(() => {\n * function updateOpacity() {\n * const maxXY = Math.max(x.get(), y.get())\n * const newOpacity = transform(maxXY, [0, 100], [1, 0])\n * opacity.set(newOpacity)\n * }\n *\n * const unsubscribeX = x.on(\"change\", updateOpacity)\n * const unsubscribeY = y.on(\"change\", updateOpacity)\n *\n * return () => {\n * unsubscribeX()\n * unsubscribeY()\n * }\n * }, [])\n *\n * return \n * }\n * ```\n *\n * @param subscriber - A function that receives the latest value.\n * @returns A function that, when called, will cancel this subscription.\n *\n * @deprecated\n */\n onChange(subscription) {\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(false, `value.onChange(callback) is deprecated. Switch to value.on(\"change\", callback).`);\n }\n return this.on(\"change\", subscription);\n }\n on(eventName, callback) {\n if (!this.events[eventName]) {\n this.events[eventName] = new SubscriptionManager();\n }\n const unsubscribe = this.events[eventName].add(callback);\n if (eventName === \"change\") {\n return () => {\n unsubscribe();\n /**\n * If we have no more change listeners by the start\n * of the next frame, stop active animations.\n */\n frame.read(() => {\n if (!this.events.change.getSize()) {\n this.stop();\n }\n });\n };\n }\n return unsubscribe;\n }\n clearListeners() {\n for (const eventManagers in this.events) {\n this.events[eventManagers].clear();\n }\n }\n /**\n * Attaches a passive effect to the `MotionValue`.\n */\n attach(passiveEffect, stopPassiveEffect) {\n this.passiveEffect = passiveEffect;\n this.stopPassiveEffect = stopPassiveEffect;\n }\n /**\n * Sets the state of the `MotionValue`.\n *\n * @remarks\n *\n * ```jsx\n * const x = useMotionValue(0)\n * x.set(10)\n * ```\n *\n * @param latest - Latest value to set.\n * @param render - Whether to notify render subscribers. Defaults to `true`\n *\n * @public\n */\n set(v) {\n if (!this.passiveEffect) {\n this.updateAndNotify(v);\n }\n else {\n this.passiveEffect(v, this.updateAndNotify);\n }\n }\n setWithVelocity(prev, current, delta) {\n this.set(current);\n this.prev = undefined;\n this.prevFrameValue = prev;\n this.prevUpdatedAt = this.updatedAt - delta;\n }\n /**\n * Set the state of the `MotionValue`, stopping any active animations,\n * effects, and resets velocity to `0`.\n */\n jump(v, endAnimation = true) {\n this.updateAndNotify(v);\n this.prev = v;\n this.prevUpdatedAt = this.prevFrameValue = undefined;\n endAnimation && this.stop();\n if (this.stopPassiveEffect)\n this.stopPassiveEffect();\n }\n dirty() {\n this.events.change?.notify(this.current);\n }\n addDependent(dependent) {\n if (!this.dependents) {\n this.dependents = new Set();\n }\n this.dependents.add(dependent);\n }\n removeDependent(dependent) {\n if (this.dependents) {\n this.dependents.delete(dependent);\n }\n }\n /**\n * Returns the latest state of `MotionValue`\n *\n * @returns - The latest state of `MotionValue`\n *\n * @public\n */\n get() {\n if (collectMotionValues.current) {\n collectMotionValues.current.push(this);\n }\n return this.current;\n }\n /**\n * @public\n */\n getPrevious() {\n return this.prev;\n }\n /**\n * Returns the latest velocity of `MotionValue`\n *\n * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical.\n *\n * @public\n */\n getVelocity() {\n const currentTime = time.now();\n if (!this.canTrackVelocity ||\n this.prevFrameValue === undefined ||\n currentTime - this.updatedAt > MAX_VELOCITY_DELTA) {\n return 0;\n }\n const delta = Math.min(this.updatedAt - this.prevUpdatedAt, MAX_VELOCITY_DELTA);\n // Casts because of parseFloat's poor typing\n return velocityPerSecond(parseFloat(this.current) -\n parseFloat(this.prevFrameValue), delta);\n }\n /**\n * Registers a new animation to control this `MotionValue`. Only one\n * animation can drive a `MotionValue` at one time.\n *\n * ```jsx\n * value.start()\n * ```\n *\n * @param animation - A function that starts the provided animation\n */\n start(startAnimation) {\n this.stop();\n return new Promise((resolve) => {\n this.hasAnimated = true;\n this.animation = startAnimation(resolve);\n if (this.events.animationStart) {\n this.events.animationStart.notify();\n }\n }).then(() => {\n if (this.events.animationComplete) {\n this.events.animationComplete.notify();\n }\n this.clearAnimation();\n });\n }\n /**\n * Stop the currently active animation.\n *\n * @public\n */\n stop() {\n if (this.animation) {\n this.animation.stop();\n if (this.events.animationCancel) {\n this.events.animationCancel.notify();\n }\n }\n this.clearAnimation();\n }\n /**\n * Returns `true` if this value is currently animating.\n *\n * @public\n */\n isAnimating() {\n return !!this.animation;\n }\n clearAnimation() {\n delete this.animation;\n }\n /**\n * Destroy and clean up subscribers to this `MotionValue`.\n *\n * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically\n * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually\n * created a `MotionValue` via the `motionValue` function.\n *\n * @public\n */\n destroy() {\n this.dependents?.clear();\n this.events.destroy?.notify();\n this.clearListeners();\n this.stop();\n if (this.stopPassiveEffect) {\n this.stopPassiveEffect();\n }\n }\n}\nexport function motionValue(init, options) {\n return new MotionValue(init, options);\n}\n//# sourceMappingURL=index.js.map","/*\n Convert velocity into velocity per second\n*/\n/*#__NO_SIDE_EFFECTS__*/\nconst velocityPerSecond = (velocity, frameDuration) => frameDuration ? velocity * (1000 / frameDuration) : 0;\n\nexport { velocityPerSecond };\n//# sourceMappingURL=velocity-per-second.mjs.map\n","import { resolveElements, } from \"../../utils/resolve-elements\";\nexport function createSelectorEffect(subjectEffect) {\n return (subject, values) => {\n const elements = resolveElements(subject);\n const subscriptions = [];\n for (const element of elements) {\n const remove = subjectEffect(element, values);\n subscriptions.push(remove);\n }\n return () => {\n for (const remove of subscriptions)\n remove();\n };\n };\n}\n//# sourceMappingURL=create-dom-effect.js.map","export function resolveElements(elementOrSelector, scope, selectorCache) {\n if (elementOrSelector == null) {\n return [];\n }\n if (elementOrSelector instanceof EventTarget) {\n return [elementOrSelector];\n }\n else if (typeof elementOrSelector === \"string\") {\n let root = document;\n if (scope) {\n root = scope.current;\n }\n const elements = selectorCache?.[elementOrSelector] ??\n root.querySelectorAll(elementOrSelector);\n return elements ? Array.from(elements) : [];\n }\n return Array.from(elementOrSelector).filter((element) => element != null);\n}\n//# sourceMappingURL=resolve-elements.js.map","import { clamp } from \"motion-utils\";\nexport const number = {\n test: (v) => typeof v === \"number\",\n parse: parseFloat,\n transform: (v) => v,\n};\nexport const alpha = {\n ...number,\n transform: (v) => clamp(0, 1, v),\n};\nexport const scale = {\n ...number,\n default: 1,\n};\n//# sourceMappingURL=index.js.map","import { number } from \"./numbers\";\nexport const int = {\n ...number,\n transform: Math.round,\n};\n//# sourceMappingURL=int.js.map","/*#__NO_SIDE_EFFECTS__*/\nconst createUnitType = (unit) => ({\n test: (v) => typeof v === \"string\" && v.endsWith(unit) && v.split(\" \").length === 1,\n parse: parseFloat,\n transform: (v) => `${v}${unit}`,\n});\nexport const degrees = /*@__PURE__*/ createUnitType(\"deg\");\nexport const percent = /*@__PURE__*/ createUnitType(\"%\");\nexport const px = /*@__PURE__*/ createUnitType(\"px\");\nexport const vh = /*@__PURE__*/ createUnitType(\"vh\");\nexport const vw = /*@__PURE__*/ createUnitType(\"vw\");\nexport const progressPercentage = /*@__PURE__*/ (() => ({\n ...percent,\n parse: (v) => percent.parse(v) / 100,\n transform: (v) => percent.transform(v * 100),\n}))();\n//# sourceMappingURL=units.js.map","import { int } from \"../int\";\nimport { alpha } from \"../numbers\";\nimport { px } from \"../numbers/units\";\nimport { transformValueTypes } from \"./transform\";\nexport const numberValueTypes = {\n // Border props\n borderWidth: px,\n borderTopWidth: px,\n borderRightWidth: px,\n borderBottomWidth: px,\n borderLeftWidth: px,\n borderRadius: px,\n borderTopLeftRadius: px,\n borderTopRightRadius: px,\n borderBottomRightRadius: px,\n borderBottomLeftRadius: px,\n // Positioning props\n width: px,\n maxWidth: px,\n height: px,\n maxHeight: px,\n top: px,\n right: px,\n bottom: px,\n left: px,\n inset: px,\n insetBlock: px,\n insetBlockStart: px,\n insetBlockEnd: px,\n insetInline: px,\n insetInlineStart: px,\n insetInlineEnd: px,\n // Spacing props\n padding: px,\n paddingTop: px,\n paddingRight: px,\n paddingBottom: px,\n paddingLeft: px,\n paddingBlock: px,\n paddingBlockStart: px,\n paddingBlockEnd: px,\n paddingInline: px,\n paddingInlineStart: px,\n paddingInlineEnd: px,\n margin: px,\n marginTop: px,\n marginRight: px,\n marginBottom: px,\n marginLeft: px,\n marginBlock: px,\n marginBlockStart: px,\n marginBlockEnd: px,\n marginInline: px,\n marginInlineStart: px,\n marginInlineEnd: px,\n // Typography\n fontSize: px,\n // Misc\n backgroundPositionX: px,\n backgroundPositionY: px,\n ...transformValueTypes,\n zIndex: int,\n // SVG\n fillOpacity: alpha,\n strokeOpacity: alpha,\n numOctaves: int,\n};\n//# sourceMappingURL=number.js.map","import { alpha, scale } from \"../numbers\";\nimport { degrees, progressPercentage, px } from \"../numbers/units\";\nexport const transformValueTypes = {\n rotate: degrees,\n /**\n * Internal channel for `transition.path` orientToPath. Composed onto\n * `rotate` at the transform-build sites so the user's `rotate` is\n * never read or overwritten. Not part of `transformPropOrder`.\n */\n pathRotation: degrees,\n rotateX: degrees,\n rotateY: degrees,\n rotateZ: degrees,\n scale,\n scaleX: scale,\n scaleY: scale,\n scaleZ: scale,\n skew: degrees,\n skewX: degrees,\n skewY: degrees,\n distance: px,\n translateX: px,\n translateY: px,\n translateZ: px,\n x: px,\n y: px,\n z: px,\n perspective: px,\n transformPerspective: px,\n opacity: alpha,\n originX: progressPercentage,\n originY: progressPercentage,\n originZ: px,\n};\n//# sourceMappingURL=transform.js.map","import { cancelFrame, frame } from \"../frameloop/frame\";\nimport { numberValueTypes } from \"../value/types/maps/number\";\nimport { getValueAsType } from \"../value/types/utils/get-as-type\";\nexport class MotionValueState {\n constructor() {\n this.latest = {};\n this.values = new Map();\n }\n set(name, value, render, computed, useDefaultValueType = true) {\n const existingValue = this.values.get(name);\n if (existingValue) {\n existingValue.onRemove();\n }\n const onChange = () => {\n const v = value.get();\n if (useDefaultValueType) {\n this.latest[name] = getValueAsType(v, numberValueTypes[name]);\n }\n else {\n this.latest[name] = v;\n }\n render && frame.render(render);\n };\n onChange();\n const cancelOnChange = value.on(\"change\", onChange);\n computed && value.addDependent(computed);\n const remove = () => {\n cancelOnChange();\n render && cancelFrame(render);\n this.values.delete(name);\n computed && value.removeDependent(computed);\n };\n this.values.set(name, { value, onRemove: remove });\n return remove;\n }\n get(name) {\n return this.values.get(name)?.value;\n }\n}\n//# sourceMappingURL=MotionValueState.js.map","/**\n * Provided a value and a ValueType, returns the value as that value type.\n */\nexport const getValueAsType = (value, type) => {\n return type && typeof value === \"number\"\n ? type.transform(value)\n : value;\n};\n//# sourceMappingURL=get-as-type.js.map","import { MotionValueState } from \"../MotionValueState\";\nexport function createEffect(addValue) {\n const stateCache = new WeakMap();\n return (subject, values) => {\n const state = stateCache.get(subject) ?? new MotionValueState();\n stateCache.set(subject, state);\n const subscriptions = [];\n for (const key in values) {\n const value = values[key];\n const remove = addValue(subject, state, key, value);\n subscriptions.push(remove);\n }\n return () => {\n for (const cancel of subscriptions)\n cancel();\n };\n };\n}\n//# sourceMappingURL=create-effect.js.map","import { transformPropOrder } from \"../../render/utils/keys-transform\";\nconst translateAlias = {\n x: \"translateX\",\n y: \"translateY\",\n z: \"translateZ\",\n transformPerspective: \"perspective\",\n};\nexport function buildTransform(state) {\n let transform = \"\";\n let transformIsDefault = true;\n /**\n * Loop over all possible transforms in order, adding the ones that\n * are present to the transform string.\n */\n for (let i = 0; i < transformPropOrder.length; i++) {\n const key = transformPropOrder[i];\n const value = state.latest[key];\n if (value === undefined)\n continue;\n let valueIsDefault = true;\n if (typeof value === \"number\") {\n valueIsDefault = value === (key.startsWith(\"scale\") ? 1 : 0);\n }\n else {\n const parsed = parseFloat(value);\n valueIsDefault = key.startsWith(\"scale\") ? parsed === 1 : parsed === 0;\n }\n if (!valueIsDefault) {\n transformIsDefault = false;\n const transformName = translateAlias[key] || key;\n transform += `${transformName}(${value}) `;\n }\n }\n // See build-transform.ts: additive `rotate()` so user `rotate` isn't\n // clobbered. Not a `transformPropOrder` slot.\n const pathRotation = state.latest.pathRotation;\n if (pathRotation) {\n transformIsDefault = false;\n transform += `rotate(${typeof pathRotation === \"number\"\n ? `${pathRotation}deg`\n : pathRotation}) `;\n }\n return transformIsDefault ? \"none\" : transform.trim();\n}\n//# sourceMappingURL=transform.js.map","import { isCSSVar } from \"../../render/dom/is-css-var\";\nimport { transformProps } from \"../../render/utils/keys-transform\";\nimport { isHTMLElement } from \"../../utils/is-html-element\";\nimport { MotionValue } from \"../../value\";\nimport { createSelectorEffect } from \"../utils/create-dom-effect\";\nimport { createEffect } from \"../utils/create-effect\";\nimport { buildTransform } from \"./transform\";\nconst originProps = new Set([\"originX\", \"originY\", \"originZ\"]);\nexport const addStyleValue = (element, state, key, value) => {\n let render = undefined;\n let computed = undefined;\n if (transformProps.has(key)) {\n if (!state.get(\"transform\")) {\n // If this is an HTML element, we need to set the transform-box to fill-box\n // to normalise the transform relative to the element's bounding box\n if (!isHTMLElement(element) && !state.get(\"transformBox\")) {\n addStyleValue(element, state, \"transformBox\", new MotionValue(\"fill-box\"));\n }\n state.set(\"transform\", new MotionValue(\"none\"), () => {\n element.style.transform = buildTransform(state);\n });\n }\n computed = state.get(\"transform\");\n }\n else if (originProps.has(key)) {\n if (!state.get(\"transformOrigin\")) {\n state.set(\"transformOrigin\", new MotionValue(\"\"), () => {\n const originX = state.latest.originX ?? \"50%\";\n const originY = state.latest.originY ?? \"50%\";\n const originZ = state.latest.originZ ?? 0;\n element.style.transformOrigin = `${originX} ${originY} ${originZ}`;\n });\n }\n computed = state.get(\"transformOrigin\");\n }\n else if (isCSSVar(key)) {\n render = () => {\n element.style.setProperty(key, state.latest[key]);\n };\n }\n else {\n render = () => {\n element.style[key] = state.latest[key];\n };\n }\n return state.set(key, value, render, computed);\n};\nexport const styleEffect = /*@__PURE__*/ createSelectorEffect(\n/*@__PURE__*/ createEffect(addStyleValue));\n//# sourceMappingURL=index.js.map","import { isObject } from \"motion-utils\";\n/**\n * Checks if an element is an HTML element in a way\n * that works across iframes\n */\nexport function isHTMLElement(element) {\n return (isObject(element) &&\n \"offsetHeight\" in element &&\n !(\"ownerSVGElement\" in element));\n}\n//# sourceMappingURL=is-html-element.js.map","const isObject = (value) => typeof value === \"object\" && value !== null;\n\nexport { isObject };\n//# sourceMappingURL=is-object.mjs.map\n"],"names":["transformPropOrder","transformProps","Set","MotionGlobalConfig","SubscriptionManager","constructor","this","subscriptions","add","handler","arr","item","indexOf","push","index","splice","removeItem","notify","a","b","c","numSubscriptions","length","i","getSize","clear","stepsOrder","createRenderBatcher","scheduleNextBatch","allowKeepAlive","runNextFrame","useDefaultElapsed","state","delta","timestamp","isProcessing","flagRunNextFrame","steps","reduce","acc","key","thisFrame","nextFrame","flushNextFrame","toKeepAlive","WeakSet","latestFrameData","triggerCallback","callback","has","step","schedule","keepAlive","immediate","queue","cancel","delete","process","frameData","prevFrame","forEach","createRenderStep","setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender","processBatch","useManualTiming","performance","now","Math","max","min","frame","cancelFrame","requestAnimationFrame","any","clearTime","undefined","time","set","newTime","queueMicrotask","MotionValue","init","options","canTrackVelocity","events","updateAndNotify","v","currentTime","updatedAt","setPrevFrameValue","prev","current","setCurrent","change","dependents","dependent","dirty","hasAnimated","owner","value","isNaN","parseFloat","prevFrameValue","prevUpdatedAt","onChange","subscription","on","eventName","unsubscribe","stop","clearListeners","eventManagers","attach","passiveEffect","stopPassiveEffect","setWithVelocity","jump","endAnimation","addDependent","removeDependent","get","getPrevious","getVelocity","velocity","frameDuration","start","startAnimation","Promise","resolve","animation","animationStart","then","animationComplete","clearAnimation","animationCancel","isAnimating","destroy","createSelectorEffect","subjectEffect","subject","values","elements","elementOrSelector","EventTarget","document","querySelectorAll","Array","from","filter","element","resolveElements","remove","number","test","parse","transform","alpha","clamp","scale","default","int","round","createUnitType","unit","endsWith","split","degrees","percent","px","progressPercentage","numberValueTypes","borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","width","maxWidth","height","maxHeight","top","right","bottom","left","inset","insetBlock","insetBlockStart","insetBlockEnd","insetInline","insetInlineStart","insetInlineEnd","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingBlock","paddingBlockStart","paddingBlockEnd","paddingInline","paddingInlineStart","paddingInlineEnd","margin","marginTop","marginRight","marginBottom","marginLeft","marginBlock","marginBlockStart","marginBlockEnd","marginInline","marginInlineStart","marginInlineEnd","fontSize","backgroundPositionX","backgroundPositionY","rotate","pathRotation","rotateX","rotateY","rotateZ","scaleX","scaleY","scaleZ","skew","skewX","skewY","distance","translateX","translateY","translateZ","x","y","z","perspective","transformPerspective","opacity","originX","originY","originZ","zIndex","fillOpacity","strokeOpacity","numOctaves","MotionValueState","latest","Map","name","computed","useDefaultValueType","existingValue","onRemove","type","getValueAsType","cancelOnChange","createEffect","addValue","stateCache","WeakMap","translateAlias","originProps","addStyleValue","isHTMLElement","style","transformIsDefault","valueIsDefault","startsWith","parsed","trim","buildTransform","transformOrigin","setProperty","styleEffect"],"mappings":"AAAO,MCGMA,EAAqB,CAC9B,uBACA,IACA,IACA,IACA,aACA,aACA,aACA,QACA,SACA,SACA,SACA,UACA,UACA,UACA,OACA,QACA,SAYSC,EAA+B,KAAO,IAAIC,IAAI,IAAIF,EAAoB,iBAAvC,GChC5C,MCAMG,EAAqB,CAAA,ECE3B,MAAMC,EACF,WAAAC,GACIC,KAAKC,cAAgB,EACzB,CACA,GAAAC,CAAIC,GCNR,IAAuBC,EAAKC,EDQpB,OCReD,EDODJ,KAAKC,cCPCI,EDOcF,GCNZ,IAAtBC,EAAIE,QAAQD,IACZD,EAAIG,KAAKF,GDMF,ICJf,SAAoBD,EAAKC,GACrB,MAAMG,EAAQJ,EAAIE,QAAQD,GACtBG,GAAQ,GACRJ,EAAIK,OAAOD,EAAO,EAC1B,CDAqBE,CAAWV,KAAKC,cAAeE,EAChD,CACA,MAAAQ,CAAOC,EAAGC,EAAGC,GACT,MAAMC,EAAmBf,KAAKC,cAAce,OAC5C,GAAKD,EAEL,GAAyB,IAArBA,EAIAf,KAAKC,cAAc,GAAGW,EAAGC,EAAGC,QAG5B,IAAK,IAAIG,EAAI,EAAGA,EAAIF,EAAkBE,IAAK,CAKvC,MAAMd,EAAUH,KAAKC,cAAcgB,GACnCd,GAAWA,EAAQS,EAAGC,EAAGC,EAC7B,CAER,CACA,OAAAI,GACI,OAAOlB,KAAKC,cAAce,MAC9B,CACA,KAAAG,GACInB,KAAKC,cAAce,OAAS,CAChC,EEpCG,MAAMI,EAAa,CACtB,QACA,OACA,mBACA,YACA,SACA,YACA,SACA,cCJG,SAASC,EAAoBC,EAAmBC,GACnD,IAAIC,GAAe,EACfC,GAAoB,EACxB,MAAMC,EAAQ,CACVC,MAAO,EACPC,UAAW,EACXC,cAAc,GAEZC,EAAmB,IAAON,GAAe,EACzCO,EAAQX,EAAWY,OAAO,CAACC,EAAKC,KAClCD,EAAIC,GCdL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2K,EAAiB7O,EAAI8O,WAAW,SAAsB,IAAXC,EAA0B,IAAXA,CAC9D,CACKF,IACDD,GAAqB,EAErBlH,GAAa,GADS6G,EAAevO,IAAQA,KACZkE,MAEzC,CAGA,MAAM2H,EAAerM,EAAMiO,OAAO5B,aAOlC,OANIA,IACA+C,GAAqB,EACrBlH,GAAa,UAAkC,iBAAjBmE,EACxB,GAAGA,OACHA,OAEH+C,EAAqB,OAASlH,EAAUsH,MACnD,CCxB0CC,CAAezP,MAGjDoO,EAAWpO,EAAM+F,IAAI,cAEhBiJ,EAAY/N,IAAIT,IAChBR,EAAM+F,IAAI,oBACX/F,EAAMoD,IAAI,kBAAmB,IAAIG,EAAY,IAAK,KAC9C,MAAMkK,EAAUzN,EAAMiO,OAAOR,SAAW,MAClCC,EAAU1N,EAAMiO,OAAOP,SAAW,MAClCC,EAAU3N,EAAMiO,OAAON,SAAW,EACxC/F,EAAQuH,MAAMO,gBAAkB,GAAGjC,KAAWC,KAAWC,MAGjES,EAAWpO,EAAM+F,IAAI,oBAGrB3D,EADc5B,EzBnCiB8O,WAAW,MyBoCjC,KACL1H,EAAQuH,MAAMQ,YAAYnP,EAAKR,EAAMiO,OAAOzN,KAIvC,KACLoH,EAAQuH,MAAM3O,GAAOR,EAAMiO,OAAOzN,IAGnCR,EAAMoD,IAAI5C,EAAKkE,EAAOtC,EAAQgM,IAE5BwB,EAA4B5I,EAC3B2H,EAAaM"} \ No newline at end of file diff --git a/node_modules/motion-dom/package.json b/node_modules/motion-dom/package.json deleted file mode 100644 index 74125d8..0000000 --- a/node_modules/motion-dom/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "motion-dom", - "version": "13.0.0", - "author": "Matt Perry", - "license": "MIT", - "repository": "https://github.com/motiondivision/motion", - "main": "./dist/cjs/index.js", - "types": "./dist/index.d.ts", - "module": "./dist/es/index.mjs", - "sideEffects": false, - "exports": { - ".": { - "types": "./dist/index.d.ts", - "require": "./dist/cjs/index.js", - "import": "./dist/es/index.mjs", - "default": "./dist/cjs/index.js" - } - }, - "dependencies": { - "motion-utils": "^13.0.0" - }, - "scripts": { - "clean": "rm -rf types dist lib", - "build": "yarn clean && tsc -p . && rollup -c && node ./scripts/check-bundle.js", - "dev": "concurrently -c blue,red -n tsc,rollup --kill-others \"tsc --watch -p . --preserveWatchOutput\" \"rollup --config --watch --no-watch.clearScreen\"", - "test": "jest --config jest.config.json --max-workers=2", - "measure": "rollup -c ./rollup.size.config.mjs" - }, - "bundlesize": [ - { - "path": "./dist/size-rollup-style-effect.js", - "maxSize": "2.9 kB" - }, - { - "path": "./dist/size-rollup-motion-value.js", - "maxSize": "1.8 kB" - } - ], - "gitHead": "e4029ce071bddaed2a539b861f5d9c509bea40da" -} diff --git a/node_modules/motion-utils/LICENSE.md b/node_modules/motion-utils/LICENSE.md deleted file mode 100644 index 8111044..0000000 --- a/node_modules/motion-utils/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2024 [Motion](https://motion.dev) B.V. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/motion-utils/dist/cjs/index.js b/node_modules/motion-utils/dist/cjs/index.js deleted file mode 100644 index a33f3dd..0000000 --- a/node_modules/motion-utils/dist/cjs/index.js +++ /dev/null @@ -1,345 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { value: true }); - -function addUniqueItem(arr, item) { - if (arr.indexOf(item) === -1) - arr.push(item); -} -function removeItem(arr, item) { - const index = arr.indexOf(item); - if (index > -1) - arr.splice(index, 1); -} -// Adapted from array-move -function moveItem([...arr], fromIndex, toIndex) { - const startIndex = fromIndex < 0 ? arr.length + fromIndex : fromIndex; - if (startIndex >= 0 && startIndex < arr.length) { - const endIndex = toIndex < 0 ? arr.length + toIndex : toIndex; - const [item] = arr.splice(fromIndex, 1); - arr.splice(endIndex, 0, item); - } - return arr; -} - -const clamp = (min, max, v) => { - if (v > max) - return max; - if (v < min) - return min; - return v; -}; - -function formatErrorMessage(message, errorCode) { - return errorCode - ? `${message}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${errorCode}` - : message; -} - -exports.warning = () => { }; -exports.invariant = () => { }; -if (typeof process !== "undefined" && - process.env?.NODE_ENV !== "production") { - exports.warning = (check, message, errorCode) => { - if (!check && typeof console !== "undefined") { - console.warn(formatErrorMessage(message, errorCode)); - } - }; - exports.invariant = (check, message, errorCode) => { - if (!check) { - throw new Error(formatErrorMessage(message, errorCode)); - } - }; -} - -const MotionGlobalConfig = {}; - -/** - * Check if value is a numerical string, ie a string that is purely a number eg "100" or "-100.1" - */ -const isNumericalString = (v) => /^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(v); - -const isObject = (value) => typeof value === "object" && value !== null; - -/** - * Check if the value is a zero value string like "0px" or "0%" - */ -const isZeroValueString = (v) => /^0[^.\s]+$/u.test(v); - -/*#__NO_SIDE_EFFECTS__*/ -function memo(callback) { - let result; - return () => { - if (result === undefined) - result = callback(); - return result; - }; -} - -/*#__NO_SIDE_EFFECTS__*/ -const noop = (any) => any; - -/** - * Pipe - * Compose other transformers to run linearily - * pipe(min(20), max(40)) - * @param {...functions} transformers - * @return {function} - */ -const pipe = (...transformers) => transformers.reduce((a, b) => (v) => b(a(v))); - -/* - Progress within given range - - Given a lower limit and an upper limit, we return the progress - (expressed as a number 0-1) represented by the given value, and - limit that progress to within 0-1. -*/ -/*#__NO_SIDE_EFFECTS__*/ -const progress = (from, to, value) => { - const range = to - from; - return range ? (value - from) / range : 1; -}; - -class SubscriptionManager { - constructor() { - this.subscriptions = []; - } - add(handler) { - addUniqueItem(this.subscriptions, handler); - return () => removeItem(this.subscriptions, handler); - } - notify(a, b, c) { - const numSubscriptions = this.subscriptions.length; - if (!numSubscriptions) - return; - if (numSubscriptions === 1) { - /** - * If there's only a single handler we can just call it without invoking a loop. - */ - this.subscriptions[0](a, b, c); - } - else { - for (let i = 0; i < numSubscriptions; i++) { - /** - * Check whether the handler exists before firing as it's possible - * the subscriptions were modified during this loop running. - */ - const handler = this.subscriptions[i]; - handler && handler(a, b, c); - } - } - } - getSize() { - return this.subscriptions.length; - } - clear() { - this.subscriptions.length = 0; - } -} - -/** - * Converts seconds to milliseconds - * - * @param seconds - Time in seconds. - * @return milliseconds - Converted time in milliseconds. - */ -/*#__NO_SIDE_EFFECTS__*/ -const secondsToMilliseconds = (seconds) => seconds * 1000; -/*#__NO_SIDE_EFFECTS__*/ -const millisecondsToSeconds = (milliseconds) => milliseconds / 1000; - -/* - Convert velocity into velocity per second -*/ -/*#__NO_SIDE_EFFECTS__*/ -const velocityPerSecond = (velocity, frameDuration) => frameDuration ? velocity * (1000 / frameDuration) : 0; - -const warned = new Set(); -function hasWarned(message) { - return warned.has(message); -} -function warnOnce(condition, message, errorCode) { - if (condition || warned.has(message)) - return; - console.warn(formatErrorMessage(message, errorCode)); - warned.add(message); -} - -const wrap = (min, max, v) => { - const rangeSize = max - min; - return ((((v - min) % rangeSize) + rangeSize) % rangeSize) + min; -}; - -/* - Bezier function generator - This has been modified from Gaëtan Renaudeau's BezierEasing - https://github.com/gre/bezier-easing/blob/master/src/index.js - https://github.com/gre/bezier-easing/blob/master/LICENSE - - I've removed the newtonRaphsonIterate algo because in benchmarking it - wasn't noticeably faster than binarySubdivision, indeed removing it - usually improved times, depending on the curve. - I also removed the lookup table, as for the added bundle size and loop we're - only cutting ~4 or so subdivision iterations. I bumped the max iterations up - to 12 to compensate and this still tended to be faster for no perceivable - loss in accuracy. - Usage - const easeOut = cubicBezier(.17,.67,.83,.67); - const x = easeOut(0.5); // returns 0.627... -*/ -// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2. -const calcBezier = (t, a1, a2) => (((1.0 - 3.0 * a2 + 3.0 * a1) * t + (3.0 * a2 - 6.0 * a1)) * t + 3.0 * a1) * - t; -const subdivisionPrecision = 0.0000001; -const subdivisionMaxIterations = 12; -function binarySubdivide(x, lowerBound, upperBound, mX1, mX2) { - let currentX; - let currentT; - let i = 0; - do { - currentT = lowerBound + (upperBound - lowerBound) / 2.0; - currentX = calcBezier(currentT, mX1, mX2) - x; - if (currentX > 0.0) { - upperBound = currentT; - } - else { - lowerBound = currentT; - } - } while (Math.abs(currentX) > subdivisionPrecision && - ++i < subdivisionMaxIterations); - return currentT; -} -/*#__NO_SIDE_EFFECTS__*/ -function cubicBezier(mX1, mY1, mX2, mY2) { - // If this is a linear gradient, return linear easing - if (mX1 === mY1 && mX2 === mY2) - return noop; - const getTForX = (aX) => binarySubdivide(aX, 0, 1, mX1, mX2); - // If animation is at start/end, return t without easing - return (t) => t === 0 || t === 1 ? t : calcBezier(getTForX(t), mY1, mY2); -} - -// Accepts an easing function and returns a new one that outputs mirrored values for -// the second half of the animation. Turns easeIn into easeInOut. -/*#__NO_SIDE_EFFECTS__*/ -const mirrorEasing = (easing) => (p) => p <= 0.5 ? easing(2 * p) / 2 : (2 - easing(2 * (1 - p))) / 2; - -// Accepts an easing function and returns a new one that outputs reversed values. -// Turns easeIn into easeOut. -/*#__NO_SIDE_EFFECTS__*/ -const reverseEasing = (easing) => (p) => 1 - easing(1 - p); - -const backOut = /*@__PURE__*/ cubicBezier(0.33, 1.53, 0.69, 0.99); -const backIn = /*@__PURE__*/ reverseEasing(backOut); -const backInOut = /*@__PURE__*/ mirrorEasing(backIn); - -const anticipate = (p) => p >= 1 - ? 1 - : (p *= 2) < 1 - ? 0.5 * backIn(p) - : 0.5 * (2 - Math.pow(2, -10 * (p - 1))); - -const circIn = (p) => 1 - Math.sin(Math.acos(p)); -const circOut = reverseEasing(circIn); -const circInOut = mirrorEasing(circIn); - -const easeIn = /*@__PURE__*/ cubicBezier(0.42, 0, 1, 1); -const easeOut = /*@__PURE__*/ cubicBezier(0, 0, 0.58, 1); -const easeInOut = /*@__PURE__*/ cubicBezier(0.42, 0, 0.58, 1); - -/*#__NO_SIDE_EFFECTS__*/ -function steps(numSteps, direction = "end") { - return (progress) => { - progress = - direction === "end" - ? Math.min(progress, 0.999) - : Math.max(progress, 0.001); - const expanded = progress * numSteps; - const rounded = direction === "end" ? Math.floor(expanded) : Math.ceil(expanded); - return clamp(0, 1, rounded / numSteps); - }; -} - -/*#__NO_SIDE_EFFECTS__*/ -const isEasingArray = (ease) => { - return Array.isArray(ease) && typeof ease[0] !== "number"; -}; - -/*#__NO_SIDE_EFFECTS__*/ -function getEasingForSegment(easing, i) { - return isEasingArray(easing) ? easing[wrap(0, easing.length, i)] : easing; -} - -/*#__NO_SIDE_EFFECTS__*/ -const isBezierDefinition = (easing) => Array.isArray(easing) && typeof easing[0] === "number"; - -const easingLookup = { - linear: noop, - easeIn, - easeInOut, - easeOut, - circIn, - circInOut, - circOut, - backIn, - backInOut, - backOut, - anticipate, -}; -const isValidEasing = (easing) => { - return typeof easing === "string"; -}; -const easingDefinitionToFunction = (definition) => { - if (isBezierDefinition(definition)) { - // If cubic bezier definition, create bezier curve - exports.invariant(definition.length === 4, `Cubic bezier arrays must contain four numerical values.`, "cubic-bezier-length"); - const [x1, y1, x2, y2] = definition; - return cubicBezier(x1, y1, x2, y2); - } - else if (isValidEasing(definition)) { - // Else lookup from table - exports.invariant(easingLookup[definition] !== undefined, `Invalid easing type '${definition}'`, "invalid-easing-type"); - return easingLookup[definition]; - } - return definition; -}; - -exports.MotionGlobalConfig = MotionGlobalConfig; -exports.SubscriptionManager = SubscriptionManager; -exports.addUniqueItem = addUniqueItem; -exports.anticipate = anticipate; -exports.backIn = backIn; -exports.backInOut = backInOut; -exports.backOut = backOut; -exports.circIn = circIn; -exports.circInOut = circInOut; -exports.circOut = circOut; -exports.clamp = clamp; -exports.cubicBezier = cubicBezier; -exports.easeIn = easeIn; -exports.easeInOut = easeInOut; -exports.easeOut = easeOut; -exports.easingDefinitionToFunction = easingDefinitionToFunction; -exports.getEasingForSegment = getEasingForSegment; -exports.hasWarned = hasWarned; -exports.isBezierDefinition = isBezierDefinition; -exports.isEasingArray = isEasingArray; -exports.isNumericalString = isNumericalString; -exports.isObject = isObject; -exports.isZeroValueString = isZeroValueString; -exports.memo = memo; -exports.millisecondsToSeconds = millisecondsToSeconds; -exports.mirrorEasing = mirrorEasing; -exports.moveItem = moveItem; -exports.noop = noop; -exports.pipe = pipe; -exports.progress = progress; -exports.removeItem = removeItem; -exports.reverseEasing = reverseEasing; -exports.secondsToMilliseconds = secondsToMilliseconds; -exports.steps = steps; -exports.velocityPerSecond = velocityPerSecond; -exports.warnOnce = warnOnce; -exports.wrap = wrap; -//# sourceMappingURL=index.js.map diff --git a/node_modules/motion-utils/dist/cjs/index.js.map b/node_modules/motion-utils/dist/cjs/index.js.map deleted file mode 100644 index 660d213..0000000 --- a/node_modules/motion-utils/dist/cjs/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sources":["../../src/array.ts","../../src/clamp.ts","../../src/format-error-message.ts","../../src/errors.ts","../../src/global-config.ts","../../src/is-numerical-string.ts","../../src/is-object.ts","../../src/is-zero-value-string.ts","../../src/memo.ts","../../src/noop.ts","../../src/pipe.ts","../../src/progress.ts","../../src/subscription-manager.ts","../../src/time-conversion.ts","../../src/velocity-per-second.ts","../../src/warn-once.ts","../../src/wrap.ts","../../src/easing/cubic-bezier.ts","../../src/easing/modifiers/mirror.ts","../../src/easing/modifiers/reverse.ts","../../src/easing/back.ts","../../src/easing/anticipate.ts","../../src/easing/circ.ts","../../src/easing/ease.ts","../../src/easing/steps.ts","../../src/easing/utils/is-easing-array.ts","../../src/easing/utils/get-easing-for-segment.ts","../../src/easing/utils/is-bezier-definition.ts","../../src/easing/utils/map.ts"],"sourcesContent":["export function addUniqueItem(arr: T[], item: T) {\n if (arr.indexOf(item) === -1) arr.push(item)\n}\n\nexport function removeItem(arr: T[], item: T) {\n const index = arr.indexOf(item)\n if (index > -1) arr.splice(index, 1)\n}\n\n// Adapted from array-move\nexport function moveItem([...arr]: T[], fromIndex: number, toIndex: number) {\n const startIndex = fromIndex < 0 ? arr.length + fromIndex : fromIndex\n\n if (startIndex >= 0 && startIndex < arr.length) {\n const endIndex = toIndex < 0 ? arr.length + toIndex : toIndex\n\n const [item] = arr.splice(fromIndex, 1)\n arr.splice(endIndex, 0, item)\n }\n\n return arr\n}\n","export const clamp = (min: number, max: number, v: number) => {\n if (v > max) return max\n if (v < min) return min\n return v\n}\n","export function formatErrorMessage(message: string, errorCode?: string) {\n return errorCode\n ? `${message}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${errorCode}`\n : message\n}\n","import { formatErrorMessage } from \"./format-error-message\"\n\nexport type DevMessage = (\n check: boolean,\n message: string,\n errorCode?: string\n) => void\n\nlet warning: DevMessage = () => {}\nlet invariant: DevMessage = () => {}\n\nif (\n typeof process !== \"undefined\" &&\n process.env?.NODE_ENV !== \"production\"\n) {\n warning = (check, message, errorCode) => {\n if (!check && typeof console !== \"undefined\") {\n console.warn(formatErrorMessage(message, errorCode))\n }\n }\n\n invariant = (check, message, errorCode) => {\n if (!check) {\n throw new Error(formatErrorMessage(message, errorCode))\n }\n }\n}\n\nexport { invariant, warning }\n","export const MotionGlobalConfig: {\n skipAnimations?: boolean\n instantAnimations?: boolean\n useManualTiming?: boolean\n WillChange?: any\n mix?: (a: T, b: T) => (p: number) => T\n} = {}\n","/**\n * Check if value is a numerical string, ie a string that is purely a number eg \"100\" or \"-100.1\"\n */\nexport const isNumericalString = (v: string) => /^-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)$/u.test(v)\n","export const isObject = (value: unknown): value is object =>\n typeof value === \"object\" && value !== null\n","/**\n * Check if the value is a zero value string like \"0px\" or \"0%\"\n */\nexport const isZeroValueString = (v: string) => /^0[^.\\s]+$/u.test(v)\n","/*#__NO_SIDE_EFFECTS__*/\nexport function memo(callback: () => T) {\n let result: T | undefined\n\n return () => {\n if (result === undefined) result = callback()\n return result\n }\n}\n","/*#__NO_SIDE_EFFECTS__*/\nexport const noop = (any: T): T => any\n","/**\n * Pipe\n * Compose other transformers to run linearily\n * pipe(min(20), max(40))\n * @param {...functions} transformers\n * @return {function}\n */\nexport const pipe = (...transformers: Function[]) =>\n transformers.reduce((a, b) => (v: any) => b(a(v)))\n","/*\n Progress within given range\n\n Given a lower limit and an upper limit, we return the progress\n (expressed as a number 0-1) represented by the given value, and\n limit that progress to within 0-1.\n*/\n/*#__NO_SIDE_EFFECTS__*/\nexport const progress = (from: number, to: number, value: number) => {\n const range = to - from\n return range ? (value - from) / range : 1\n}\n","import { addUniqueItem, removeItem } from \"./array\"\n\ntype GenericHandler = (...args: any) => void\n\nexport class SubscriptionManager {\n private subscriptions: Handler[] = []\n\n add(handler: Handler): VoidFunction {\n addUniqueItem(this.subscriptions, handler)\n return () => removeItem(this.subscriptions, handler)\n }\n\n notify(\n a?: Parameters[0],\n b?: Parameters[1],\n c?: Parameters[2]\n ) {\n const numSubscriptions = this.subscriptions.length\n\n if (!numSubscriptions) return\n\n if (numSubscriptions === 1) {\n /**\n * If there's only a single handler we can just call it without invoking a loop.\n */\n this.subscriptions[0](a, b, c)\n } else {\n for (let i = 0; i < numSubscriptions; i++) {\n /**\n * Check whether the handler exists before firing as it's possible\n * the subscriptions were modified during this loop running.\n */\n const handler = this.subscriptions[i]\n handler && handler(a, b, c)\n }\n }\n }\n\n getSize() {\n return this.subscriptions.length\n }\n\n clear() {\n this.subscriptions.length = 0\n }\n}\n","/**\n * Converts seconds to milliseconds\n *\n * @param seconds - Time in seconds.\n * @return milliseconds - Converted time in milliseconds.\n */\n\n/*#__NO_SIDE_EFFECTS__*/\nexport const secondsToMilliseconds = (seconds: number) => seconds * 1000\n\n/*#__NO_SIDE_EFFECTS__*/\nexport const millisecondsToSeconds = (milliseconds: number) =>\n milliseconds / 1000\n","/*\n Convert velocity into velocity per second\n*/\n/*#__NO_SIDE_EFFECTS__*/\nexport const velocityPerSecond = (velocity: number, frameDuration: number) =>\n frameDuration ? velocity * (1000 / frameDuration) : 0\n","import { formatErrorMessage } from \"./format-error-message\"\n\nconst warned = new Set()\n\nexport function hasWarned(message: string) {\n return warned.has(message)\n}\n\nexport function warnOnce(\n condition: boolean,\n message: string,\n errorCode?: string\n) {\n if (condition || warned.has(message)) return\n\n console.warn(formatErrorMessage(message, errorCode))\n warned.add(message)\n}\n","export const wrap = (min: number, max: number, v: number) => {\n const rangeSize = max - min\n return ((((v - min) % rangeSize) + rangeSize) % rangeSize) + min\n}\n","/*\n Bezier function generator\n This has been modified from Gaëtan Renaudeau's BezierEasing\n https://github.com/gre/bezier-easing/blob/master/src/index.js\n https://github.com/gre/bezier-easing/blob/master/LICENSE\n \n I've removed the newtonRaphsonIterate algo because in benchmarking it\n wasn't noticeably faster than binarySubdivision, indeed removing it\n usually improved times, depending on the curve.\n I also removed the lookup table, as for the added bundle size and loop we're\n only cutting ~4 or so subdivision iterations. I bumped the max iterations up\n to 12 to compensate and this still tended to be faster for no perceivable\n loss in accuracy.\n Usage\n const easeOut = cubicBezier(.17,.67,.83,.67);\n const x = easeOut(0.5); // returns 0.627...\n*/\n\nimport { noop } from \"../noop\"\n\n// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.\nconst calcBezier = (t: number, a1: number, a2: number) =>\n (((1.0 - 3.0 * a2 + 3.0 * a1) * t + (3.0 * a2 - 6.0 * a1)) * t + 3.0 * a1) *\n t\n\nconst subdivisionPrecision = 0.0000001\nconst subdivisionMaxIterations = 12\n\nfunction binarySubdivide(\n x: number,\n lowerBound: number,\n upperBound: number,\n mX1: number,\n mX2: number\n) {\n let currentX: number\n let currentT: number\n let i: number = 0\n\n do {\n currentT = lowerBound + (upperBound - lowerBound) / 2.0\n currentX = calcBezier(currentT, mX1, mX2) - x\n if (currentX > 0.0) {\n upperBound = currentT\n } else {\n lowerBound = currentT\n }\n } while (\n Math.abs(currentX) > subdivisionPrecision &&\n ++i < subdivisionMaxIterations\n )\n\n return currentT\n}\n\n/*#__NO_SIDE_EFFECTS__*/\nexport function cubicBezier(\n mX1: number,\n mY1: number,\n mX2: number,\n mY2: number\n) {\n // If this is a linear gradient, return linear easing\n if (mX1 === mY1 && mX2 === mY2) return noop\n\n const getTForX = (aX: number) => binarySubdivide(aX, 0, 1, mX1, mX2)\n\n // If animation is at start/end, return t without easing\n return (t: number) =>\n t === 0 || t === 1 ? t : calcBezier(getTForX(t), mY1, mY2)\n}\n","// Accepts an easing function and returns a new one that outputs mirrored values for\n\nimport { EasingModifier } from \"../types\"\n\n// the second half of the animation. Turns easeIn into easeInOut.\n/*#__NO_SIDE_EFFECTS__*/\nexport const mirrorEasing: EasingModifier = (easing) => (p) =>\n p <= 0.5 ? easing(2 * p) / 2 : (2 - easing(2 * (1 - p))) / 2\n","// Accepts an easing function and returns a new one that outputs reversed values.\n\nimport { EasingModifier } from \"../types\"\n\n// Turns easeIn into easeOut.\n/*#__NO_SIDE_EFFECTS__*/\nexport const reverseEasing: EasingModifier = (easing) => (p) =>\n 1 - easing(1 - p)\n","import { cubicBezier } from \"./cubic-bezier\"\nimport { mirrorEasing } from \"./modifiers/mirror\"\nimport { reverseEasing } from \"./modifiers/reverse\"\n\nexport const backOut = /*@__PURE__*/ cubicBezier(0.33, 1.53, 0.69, 0.99)\nexport const backIn = /*@__PURE__*/ reverseEasing(backOut)\nexport const backInOut = /*@__PURE__*/ mirrorEasing(backIn)\n","import { backIn } from \"./back\"\n\nexport const anticipate = (p: number) =>\n p >= 1\n ? 1\n : (p *= 2) < 1\n ? 0.5 * backIn(p)\n : 0.5 * (2 - Math.pow(2, -10 * (p - 1)))\n","import { mirrorEasing } from \"./modifiers/mirror\"\nimport { reverseEasing } from \"./modifiers/reverse\"\nimport { EasingFunction } from \"./types\"\n\nexport const circIn: EasingFunction = (p) => 1 - Math.sin(Math.acos(p))\nexport const circOut = reverseEasing(circIn)\nexport const circInOut = mirrorEasing(circIn)\n","import { cubicBezier } from \"./cubic-bezier\"\n\nexport const easeIn = /*@__PURE__*/ cubicBezier(0.42, 0, 1, 1)\nexport const easeOut = /*@__PURE__*/ cubicBezier(0, 0, 0.58, 1)\nexport const easeInOut = /*@__PURE__*/ cubicBezier(0.42, 0, 0.58, 1)\n","import { clamp } from \"../clamp\"\nimport type { EasingFunction } from \"./types\"\n\n/*\n Create stepped version of 0-1 progress\n\n @param [int]: Number of steps\n @param [number]: Current value\n @return [number]: Stepped value\n*/\nexport type Direction = \"start\" | \"end\"\n\n/*#__NO_SIDE_EFFECTS__*/\nexport function steps(\n numSteps: number,\n direction: Direction = \"end\"\n): EasingFunction {\n return (progress: number) => {\n progress =\n direction === \"end\"\n ? Math.min(progress, 0.999)\n : Math.max(progress, 0.001)\n const expanded = progress * numSteps\n const rounded =\n direction === \"end\" ? Math.floor(expanded) : Math.ceil(expanded)\n\n return clamp(0, 1, rounded / numSteps)\n }\n}\n","import { Easing } from \"../types\"\n\n/*#__NO_SIDE_EFFECTS__*/\nexport const isEasingArray = (ease: any): ease is Easing[] => {\n return Array.isArray(ease) && typeof ease[0] !== \"number\"\n}\n","import { wrap } from \"../../wrap\"\nimport { Easing } from \"../types\"\nimport { isEasingArray } from \"./is-easing-array\"\n\n/*#__NO_SIDE_EFFECTS__*/\nexport function getEasingForSegment(\n easing: Easing | Easing[],\n i: number\n): Easing {\n return isEasingArray(easing) ? easing[wrap(0, easing.length, i)] : easing\n}\n","import { BezierDefinition, Easing } from \"../types\"\n\n/*#__NO_SIDE_EFFECTS__*/\nexport const isBezierDefinition = (\n easing: Easing | Easing[]\n): easing is BezierDefinition =>\n Array.isArray(easing) && typeof easing[0] === \"number\"\n","import { invariant } from \"../../errors\"\nimport { noop } from \"../../noop\"\nimport { anticipate } from \"../anticipate\"\nimport { backIn, backInOut, backOut } from \"../back\"\nimport { circIn, circInOut, circOut } from \"../circ\"\nimport { cubicBezier } from \"../cubic-bezier\"\nimport { easeIn, easeInOut, easeOut } from \"../ease\"\nimport { Easing, EasingFunction } from \"../types\"\nimport { isBezierDefinition } from \"./is-bezier-definition\"\n\nconst easingLookup = {\n linear: noop,\n easeIn,\n easeInOut,\n easeOut,\n circIn,\n circInOut,\n circOut,\n backIn,\n backInOut,\n backOut,\n anticipate,\n}\n\nconst isValidEasing = (easing: Easing): easing is keyof typeof easingLookup => {\n return typeof easing === \"string\"\n}\n\nexport const easingDefinitionToFunction = (\n definition: Easing\n): EasingFunction => {\n if (isBezierDefinition(definition)) {\n // If cubic bezier definition, create bezier curve\n invariant(\n definition.length === 4,\n `Cubic bezier arrays must contain four numerical values.`,\n \"cubic-bezier-length\"\n )\n\n const [x1, y1, x2, y2] = definition\n return cubicBezier(x1, y1, x2, y2)\n } else if (isValidEasing(definition)) {\n // Else lookup from table\n invariant(\n easingLookup[definition] !== undefined,\n `Invalid easing type '${definition}'`,\n \"invalid-easing-type\"\n )\n return easingLookup[definition]\n }\n\n return definition\n}\n"],"names":["warning","invariant"],"mappings":";;;;AAAM,SAAU,aAAa,CAAI,GAAQ,EAAE,IAAO,EAAA;IAC9C,IAAI,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE;AAAE,QAAA,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC;AAChD;AAEM,SAAU,UAAU,CAAI,GAAQ,EAAE,IAAO,EAAA;IAC3C,MAAM,KAAK,GAAG,GAAG,CAAC,OAAO,CA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AE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC;IACtC;AAAO,SAAA,IAAI,aAAa,CAAC,UAAU,CAAC,EAAE;;AAElC,QAAAA,iBAAS,CACL,YAAY,CAAC,UAAU,CAAC,KAAK,SAAS,EACtC,CAAA,qBAAA,EAAwB,UAAU,CAAA,CAAA,CAAG,EACrC,qBAAqB,CACxB;AACD,QAAA,OAAO,YAAY,CAAC,UAAU,CAAC;IACnC;AAEA,IAAA,OAAO,UAAU;AACrB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/array.mjs b/node_modules/motion-utils/dist/es/array.mjs deleted file mode 100644 index 773d47a..0000000 --- a/node_modules/motion-utils/dist/es/array.mjs +++ /dev/null @@ -1,22 +0,0 @@ -function addUniqueItem(arr, item) { - if (arr.indexOf(item) === -1) - arr.push(item); -} -function removeItem(arr, item) { - const index = arr.indexOf(item); - if (index > -1) - arr.splice(index, 1); -} -// Adapted from array-move -function moveItem([...arr], fromIndex, toIndex) { - const startIndex = fromIndex < 0 ? arr.length + fromIndex : fromIndex; - if (startIndex >= 0 && startIndex < arr.length) { - const endIndex = toIndex < 0 ? arr.length + toIndex : toIndex; - const [item] = arr.splice(fromIndex, 1); - arr.splice(endIndex, 0, item); - } - return arr; -} - -export { addUniqueItem, moveItem, removeItem }; -//# sourceMappingURL=array.mjs.map diff --git a/node_modules/motion-utils/dist/es/array.mjs.map b/node_modules/motion-utils/dist/es/array.mjs.map deleted file mode 100644 index aaad1ad..0000000 --- a/node_modules/motion-utils/dist/es/array.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"array.mjs","sources":["../../src/array.ts"],"sourcesContent":["export function addUniqueItem(arr: T[], item: T) {\n if (arr.indexOf(item) === -1) arr.push(item)\n}\n\nexport function removeItem(arr: T[], item: T) {\n const index = arr.indexOf(item)\n if (index > -1) arr.splice(index, 1)\n}\n\n// Adapted from array-move\nexport function moveItem([...arr]: T[], fromIndex: number, toIndex: number) {\n const startIndex = fromIndex < 0 ? arr.length + fromIndex : fromIndex\n\n if (startIndex >= 0 && startIndex < arr.length) {\n const endIndex = toIndex < 0 ? arr.length + toIndex : toIndex\n\n const [item] = arr.splice(fromIndex, 1)\n arr.splice(endIndex, 0, item)\n }\n\n return arr\n}\n"],"names":[],"mappings":"AAAM,SAAU,aAAa,CAAI,GAAQ,EAAE,IAAO,EAAA;IAC9C,IAAI,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE;AAAE,QAAA,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC;AAChD;AAEM,SAAU,UAAU,CAAI,GAAQ,EAAE,IAAO,EAAA;IAC3C,MAAM,KAAK,GAAG,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC;IAC/B,IAAI,KAAK,GAAG,EAAE;AAAE,QAAA,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;AACxC;AAEA;AACM,SAAU,QAAQ,CAAI,CAAC,GAAG,GAAG,CAAM,EAAE,SAAiB,EAAE,OAAe,EAAA;AACzE,IAAA,MAAM,UAAU,GAAG,SAAS,GAAG,CAAC,GAAG,GAAG,CAAC,MAAM,GAAG,SAAS,GAAG,SAAS;IAErE,IAAI,UAAU,IAAI,CAAC,IAAI,UAAU,GAAG,GAAG,CAAC,MAAM,EAAE;AAC5C,QAAA,MAAM,QAAQ,GAAG,OAAO,GAAG,CAAC,GAAG,GAAG,CAAC,MAAM,GAAG,OAAO,GAAG,OAAO;AAE7D,QAAA,MAAM,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC;QACvC,GAAG,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,EAAE,IAAI,CAAC;IACjC;AAEA,IAAA,OAAO,GAAG;AACd;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/clamp.mjs b/node_modules/motion-utils/dist/es/clamp.mjs deleted file mode 100644 index 1cfe237..0000000 --- a/node_modules/motion-utils/dist/es/clamp.mjs +++ /dev/null @@ -1,10 +0,0 @@ -const clamp = (min, max, v) => { - if (v > max) - return max; - if (v < min) - return min; - return v; -}; - -export { clamp }; -//# sourceMappingURL=clamp.mjs.map diff --git a/node_modules/motion-utils/dist/es/clamp.mjs.map b/node_modules/motion-utils/dist/es/clamp.mjs.map deleted file mode 100644 index 1613330..0000000 --- a/node_modules/motion-utils/dist/es/clamp.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"clamp.mjs","sources":["../../src/clamp.ts"],"sourcesContent":["export const clamp = (min: number, max: number, v: number) => {\n if (v > max) return max\n if (v < min) return min\n return v\n}\n"],"names":[],"mappings":"AAAO,MAAM,KAAK,GAAG,CAAC,GAAW,EAAE,GAAW,EAAE,CAAS,KAAI;IACzD,IAAI,CAAC,GAAG,GAAG;AAAE,QAAA,OAAO,GAAG;IACvB,IAAI,CAAC,GAAG,GAAG;AAAE,QAAA,OAAO,GAAG;AACvB,IAAA,OAAO,CAAC;AACZ;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/easing/anticipate.mjs b/node_modules/motion-utils/dist/es/easing/anticipate.mjs deleted file mode 100644 index 0367d40..0000000 --- a/node_modules/motion-utils/dist/es/easing/anticipate.mjs +++ /dev/null @@ -1,10 +0,0 @@ -import { backIn } from './back.mjs'; - -const anticipate = (p) => p >= 1 - ? 1 - : (p *= 2) < 1 - ? 0.5 * backIn(p) - : 0.5 * (2 - Math.pow(2, -10 * (p - 1))); - -export { anticipate }; -//# sourceMappingURL=anticipate.mjs.map diff --git a/node_modules/motion-utils/dist/es/easing/anticipate.mjs.map b/node_modules/motion-utils/dist/es/easing/anticipate.mjs.map deleted file mode 100644 index 28a651e..0000000 --- a/node_modules/motion-utils/dist/es/easing/anticipate.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"anticipate.mjs","sources":["../../../src/easing/anticipate.ts"],"sourcesContent":["import { backIn } from \"./back\"\n\nexport const anticipate = (p: number) =>\n p >= 1\n ? 1\n : (p *= 2) < 1\n ? 0.5 * backIn(p)\n : 0.5 * (2 - Math.pow(2, -10 * (p - 1)))\n"],"names":[],"mappings":";;AAEO,MAAM,UAAU,GAAG,CAAC,CAAS,KAChC,CAAC,IAAI;AACD,MAAE;AACF,MAAE,CAAC,CAAC,IAAI,CAAC,IAAI;AACX,UAAE,GAAG,GAAG,MAAM,CAAC,CAAC;UACd,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/easing/back.mjs b/node_modules/motion-utils/dist/es/easing/back.mjs deleted file mode 100644 index 7498800..0000000 --- a/node_modules/motion-utils/dist/es/easing/back.mjs +++ /dev/null @@ -1,10 +0,0 @@ -import { cubicBezier } from './cubic-bezier.mjs'; -import { mirrorEasing } from './modifiers/mirror.mjs'; -import { reverseEasing } from './modifiers/reverse.mjs'; - -const backOut = /*@__PURE__*/ cubicBezier(0.33, 1.53, 0.69, 0.99); -const backIn = /*@__PURE__*/ reverseEasing(backOut); -const backInOut = /*@__PURE__*/ mirrorEasing(backIn); - -export { backIn, backInOut, backOut }; -//# sourceMappingURL=back.mjs.map diff --git a/node_modules/motion-utils/dist/es/easing/back.mjs.map b/node_modules/motion-utils/dist/es/easing/back.mjs.map deleted file mode 100644 index de464db..0000000 --- a/node_modules/motion-utils/dist/es/easing/back.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"back.mjs","sources":["../../../src/easing/back.ts"],"sourcesContent":["import { cubicBezier } from \"./cubic-bezier\"\nimport { mirrorEasing } from \"./modifiers/mirror\"\nimport { reverseEasing } from \"./modifiers/reverse\"\n\nexport const backOut = /*@__PURE__*/ cubicBezier(0.33, 1.53, 0.69, 0.99)\nexport const backIn = /*@__PURE__*/ reverseEasing(backOut)\nexport const backInOut = /*@__PURE__*/ mirrorEasing(backIn)\n"],"names":[],"mappings":";;;;AAIO,MAAM,OAAO,iBAAiB,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;AAChE,MAAM,MAAM,iBAAiB,aAAa,CAAC,OAAO;AAClD,MAAM,SAAS,iBAAiB,YAAY,CAAC,MAAM;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/easing/circ.mjs b/node_modules/motion-utils/dist/es/easing/circ.mjs deleted file mode 100644 index 5e24dc4..0000000 --- a/node_modules/motion-utils/dist/es/easing/circ.mjs +++ /dev/null @@ -1,9 +0,0 @@ -import { mirrorEasing } from './modifiers/mirror.mjs'; -import { reverseEasing } from './modifiers/reverse.mjs'; - -const circIn = (p) => 1 - Math.sin(Math.acos(p)); -const circOut = reverseEasing(circIn); -const circInOut = mirrorEasing(circIn); - -export { circIn, circInOut, circOut }; -//# sourceMappingURL=circ.mjs.map diff --git a/node_modules/motion-utils/dist/es/easing/circ.mjs.map b/node_modules/motion-utils/dist/es/easing/circ.mjs.map deleted file mode 100644 index 280b467..0000000 --- a/node_modules/motion-utils/dist/es/easing/circ.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"circ.mjs","sources":["../../../src/easing/circ.ts"],"sourcesContent":["import { mirrorEasing } from \"./modifiers/mirror\"\nimport { reverseEasing } from \"./modifiers/reverse\"\nimport { EasingFunction } from \"./types\"\n\nexport const circIn: EasingFunction = (p) => 1 - Math.sin(Math.acos(p))\nexport const circOut = reverseEasing(circIn)\nexport const circInOut = mirrorEasing(circIn)\n"],"names":[],"mappings":";;;MAIa,MAAM,GAAmB,CAAC,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;MACzD,OAAO,GAAG,aAAa,CAAC,MAAM;MAC9B,SAAS,GAAG,YAAY,CAAC,MAAM;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/easing/cubic-bezier.mjs b/node_modules/motion-utils/dist/es/easing/cubic-bezier.mjs deleted file mode 100644 index 4b13a5d..0000000 --- a/node_modules/motion-utils/dist/es/easing/cubic-bezier.mjs +++ /dev/null @@ -1,53 +0,0 @@ -import { noop } from '../noop.mjs'; - -/* - Bezier function generator - This has been modified from Gaëtan Renaudeau's BezierEasing - https://github.com/gre/bezier-easing/blob/master/src/index.js - https://github.com/gre/bezier-easing/blob/master/LICENSE - - I've removed the newtonRaphsonIterate algo because in benchmarking it - wasn't noticeably faster than binarySubdivision, indeed removing it - usually improved times, depending on the curve. - I also removed the lookup table, as for the added bundle size and loop we're - only cutting ~4 or so subdivision iterations. I bumped the max iterations up - to 12 to compensate and this still tended to be faster for no perceivable - loss in accuracy. - Usage - const easeOut = cubicBezier(.17,.67,.83,.67); - const x = easeOut(0.5); // returns 0.627... -*/ -// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2. -const calcBezier = (t, a1, a2) => (((1.0 - 3.0 * a2 + 3.0 * a1) * t + (3.0 * a2 - 6.0 * a1)) * t + 3.0 * a1) * - t; -const subdivisionPrecision = 0.0000001; -const subdivisionMaxIterations = 12; -function binarySubdivide(x, lowerBound, upperBound, mX1, mX2) { - let currentX; - let currentT; - let i = 0; - do { - currentT = lowerBound + (upperBound - lowerBound) / 2.0; - currentX = calcBezier(currentT, mX1, mX2) - x; - if (currentX > 0.0) { - upperBound = currentT; - } - else { - lowerBound = currentT; - } - } while (Math.abs(currentX) > subdivisionPrecision && - ++i < subdivisionMaxIterations); - return currentT; -} -/*#__NO_SIDE_EFFECTS__*/ -function cubicBezier(mX1, mY1, mX2, mY2) { - // If this is a linear gradient, return linear easing - if (mX1 === mY1 && mX2 === mY2) - return noop; - const getTForX = (aX) => binarySubdivide(aX, 0, 1, mX1, mX2); - // If animation is at start/end, return t without easing - return (t) => t === 0 || t === 1 ? t : calcBezier(getTForX(t), mY1, mY2); -} - -export { cubicBezier }; -//# sourceMappingURL=cubic-bezier.mjs.map diff --git a/node_modules/motion-utils/dist/es/easing/cubic-bezier.mjs.map b/node_modules/motion-utils/dist/es/easing/cubic-bezier.mjs.map deleted file mode 100644 index 711fe2e..0000000 --- a/node_modules/motion-utils/dist/es/easing/cubic-bezier.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"cubic-bezier.mjs","sources":["../../../src/easing/cubic-bezier.ts"],"sourcesContent":["/*\n Bezier function generator\n This has been modified from Gaëtan Renaudeau's BezierEasing\n https://github.com/gre/bezier-easing/blob/master/src/index.js\n https://github.com/gre/bezier-easing/blob/master/LICENSE\n \n I've removed the newtonRaphsonIterate algo because in benchmarking it\n wasn't noticeably faster than binarySubdivision, indeed removing it\n usually improved times, depending on the curve.\n I also removed the lookup table, as for the added bundle size and loop we're\n only cutting ~4 or so subdivision iterations. I bumped the max iterations up\n to 12 to compensate and this still tended to be faster for no perceivable\n loss in accuracy.\n Usage\n const easeOut = cubicBezier(.17,.67,.83,.67);\n const x = easeOut(0.5); // returns 0.627...\n*/\n\nimport { noop } from \"../noop\"\n\n// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.\nconst calcBezier = (t: number, a1: number, a2: number) =>\n (((1.0 - 3.0 * a2 + 3.0 * a1) * t + (3.0 * a2 - 6.0 * a1)) * t + 3.0 * a1) *\n t\n\nconst subdivisionPrecision = 0.0000001\nconst subdivisionMaxIterations = 12\n\nfunction binarySubdivide(\n x: number,\n lowerBound: number,\n upperBound: number,\n mX1: number,\n mX2: number\n) {\n let currentX: number\n let currentT: number\n let i: number = 0\n\n do {\n currentT = lowerBound + (upperBound - lowerBound) / 2.0\n currentX = calcBezier(currentT, mX1, mX2) - x\n if (currentX > 0.0) {\n upperBound = currentT\n } else {\n lowerBound = currentT\n }\n } while (\n Math.abs(currentX) > subdivisionPrecision &&\n ++i < subdivisionMaxIterations\n )\n\n return currentT\n}\n\n/*#__NO_SIDE_EFFECTS__*/\nexport function cubicBezier(\n mX1: number,\n mY1: number,\n mX2: number,\n mY2: number\n) {\n // If this is a linear gradient, return linear easing\n if (mX1 === mY1 && mX2 === mY2) return noop\n\n const getTForX = (aX: number) => binarySubdivide(aX, 0, 1, mX1, mX2)\n\n // If animation is at start/end, return t without easing\n return (t: number) =>\n t === 0 || t === 1 ? t : calcBezier(getTForX(t), mY1, mY2)\n}\n"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;;;AAgBE;AAIF;AACA,MAAM,UAAU,GAAG,CAAC,CAAS,EAAE,EAAU,EAAE,EAAU,KACjD,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,GAAG,EAAE,GAAG,GAAG,GAAG,EAAE,IAAI,CAAC,IAAI,GAAG,GAAG,EAAE,GAAG,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,GAAG,GAAG,EAAE;AACzE,IAAA,CAAC;AAEL,MAAM,oBAAoB,GAAG,SAAS;AACtC,MAAM,wBAAwB,GAAG,EAAE;AAEnC,SAAS,eAAe,CACpB,CAAS,EACT,UAAkB,EAClB,UAAkB,EAClB,GAAW,EACX,GAAW,EAAA;AAEX,IAAA,IAAI,QAAgB;AACpB,IAAA,IAAI,QAAgB;IACpB,IAAI,CAAC,GAAW,CAAC;AAEjB,IAAA,GAAG;QACC,QAAQ,GAAG,UAAU,GAAG,CAAC,UAAU,GAAG,UAAU,IAAI,GAAG;QACvD,QAAQ,GAAG,UAAU,CAAC,QAAQ,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,CAAC;AAC7C,QAAA,IAAI,QAAQ,GAAG,GAAG,EAAE;YAChB,UAAU,GAAG,QAAQ;QACzB;aAAO;YACH,UAAU,GAAG,QAAQ;QACzB;IACJ,CAAC,QACG,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,oBAAoB;QACzC,EAAE,CAAC,GAAG,wBAAwB;AAGlC,IAAA,OAAO,QAAQ;AACnB;AAEA;AACM,SAAU,WAAW,CACvB,GAAW,EACX,GAAW,EACX,GAAW,EACX,GAAW,EAAA;;AAGX,IAAA,IAAI,GAAG,KAAK,GAAG,IAAI,GAAG,KAAK,GAAG;AAAE,QAAA,OAAO,IAAI;AAE3C,IAAA,MAAM,QAAQ,GAAG,CAAC,EAAU,KAAK,eAAe,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC;;AAGpE,IAAA,OAAO,CAAC,CAAS,KACb,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC;AAClE;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/easing/ease.mjs b/node_modules/motion-utils/dist/es/easing/ease.mjs deleted file mode 100644 index 10cabac..0000000 --- a/node_modules/motion-utils/dist/es/easing/ease.mjs +++ /dev/null @@ -1,8 +0,0 @@ -import { cubicBezier } from './cubic-bezier.mjs'; - -const easeIn = /*@__PURE__*/ cubicBezier(0.42, 0, 1, 1); -const easeOut = /*@__PURE__*/ cubicBezier(0, 0, 0.58, 1); -const easeInOut = /*@__PURE__*/ cubicBezier(0.42, 0, 0.58, 1); - -export { easeIn, easeInOut, easeOut }; -//# sourceMappingURL=ease.mjs.map diff --git a/node_modules/motion-utils/dist/es/easing/ease.mjs.map b/node_modules/motion-utils/dist/es/easing/ease.mjs.map deleted file mode 100644 index cb24bf3..0000000 --- a/node_modules/motion-utils/dist/es/easing/ease.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ease.mjs","sources":["../../../src/easing/ease.ts"],"sourcesContent":["import { cubicBezier } from \"./cubic-bezier\"\n\nexport const easeIn = /*@__PURE__*/ cubicBezier(0.42, 0, 1, 1)\nexport const easeOut = /*@__PURE__*/ cubicBezier(0, 0, 0.58, 1)\nexport const easeInOut = /*@__PURE__*/ cubicBezier(0.42, 0, 0.58, 1)\n"],"names":[],"mappings":";;AAEO,MAAM,MAAM,iBAAiB,WAAW,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;AACtD,MAAM,OAAO,iBAAiB,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC;AACvD,MAAM,SAAS,iBAAiB,WAAW,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/easing/modifiers/mirror.mjs b/node_modules/motion-utils/dist/es/easing/modifiers/mirror.mjs deleted file mode 100644 index 1ed7de1..0000000 --- a/node_modules/motion-utils/dist/es/easing/modifiers/mirror.mjs +++ /dev/null @@ -1,7 +0,0 @@ -// Accepts an easing function and returns a new one that outputs mirrored values for -// the second half of the animation. Turns easeIn into easeInOut. -/*#__NO_SIDE_EFFECTS__*/ -const mirrorEasing = (easing) => (p) => p <= 0.5 ? easing(2 * p) / 2 : (2 - easing(2 * (1 - p))) / 2; - -export { mirrorEasing }; -//# sourceMappingURL=mirror.mjs.map diff --git a/node_modules/motion-utils/dist/es/easing/modifiers/mirror.mjs.map b/node_modules/motion-utils/dist/es/easing/modifiers/mirror.mjs.map deleted file mode 100644 index a6b594d..0000000 --- a/node_modules/motion-utils/dist/es/easing/modifiers/mirror.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mirror.mjs","sources":["../../../../src/easing/modifiers/mirror.ts"],"sourcesContent":["// Accepts an easing function and returns a new one that outputs mirrored values for\n\nimport { EasingModifier } from \"../types\"\n\n// the second half of the animation. Turns easeIn into easeInOut.\n/*#__NO_SIDE_EFFECTS__*/\nexport const mirrorEasing: EasingModifier = (easing) => (p) =>\n p <= 0.5 ? easing(2 * p) / 2 : (2 - easing(2 * (1 - p))) / 2\n"],"names":[],"mappings":"AAAA;AAIA;AACA;MACa,YAAY,GAAmB,CAAC,MAAM,KAAK,CAAC,CAAC,KACtD,CAAC,IAAI,GAAG,GAAG,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/easing/modifiers/reverse.mjs b/node_modules/motion-utils/dist/es/easing/modifiers/reverse.mjs deleted file mode 100644 index 3a6d942..0000000 --- a/node_modules/motion-utils/dist/es/easing/modifiers/reverse.mjs +++ /dev/null @@ -1,7 +0,0 @@ -// Accepts an easing function and returns a new one that outputs reversed values. -// Turns easeIn into easeOut. -/*#__NO_SIDE_EFFECTS__*/ -const reverseEasing = (easing) => (p) => 1 - easing(1 - p); - -export { reverseEasing }; -//# sourceMappingURL=reverse.mjs.map diff --git a/node_modules/motion-utils/dist/es/easing/modifiers/reverse.mjs.map b/node_modules/motion-utils/dist/es/easing/modifiers/reverse.mjs.map deleted file mode 100644 index 613d1de..0000000 --- a/node_modules/motion-utils/dist/es/easing/modifiers/reverse.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"reverse.mjs","sources":["../../../../src/easing/modifiers/reverse.ts"],"sourcesContent":["// Accepts an easing function and returns a new one that outputs reversed values.\n\nimport { EasingModifier } from \"../types\"\n\n// Turns easeIn into easeOut.\n/*#__NO_SIDE_EFFECTS__*/\nexport const reverseEasing: EasingModifier = (easing) => (p) =>\n 1 - easing(1 - p)\n"],"names":[],"mappings":"AAAA;AAIA;AACA;MACa,aAAa,GAAmB,CAAC,MAAM,KAAK,CAAC,CAAC,KACvD,CAAC,GAAG,MAAM,CAAC,CAAC,GAAG,CAAC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/easing/steps.mjs b/node_modules/motion-utils/dist/es/easing/steps.mjs deleted file mode 100644 index 3e3961c..0000000 --- a/node_modules/motion-utils/dist/es/easing/steps.mjs +++ /dev/null @@ -1,17 +0,0 @@ -import { clamp } from '../clamp.mjs'; - -/*#__NO_SIDE_EFFECTS__*/ -function steps(numSteps, direction = "end") { - return (progress) => { - progress = - direction === "end" - ? Math.min(progress, 0.999) - : Math.max(progress, 0.001); - const expanded = progress * numSteps; - const rounded = direction === "end" ? Math.floor(expanded) : Math.ceil(expanded); - return clamp(0, 1, rounded / numSteps); - }; -} - -export { steps }; -//# sourceMappingURL=steps.mjs.map diff --git a/node_modules/motion-utils/dist/es/easing/steps.mjs.map b/node_modules/motion-utils/dist/es/easing/steps.mjs.map deleted file mode 100644 index 1beaa69..0000000 --- a/node_modules/motion-utils/dist/es/easing/steps.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"steps.mjs","sources":["../../../src/easing/steps.ts"],"sourcesContent":["import { clamp } from \"../clamp\"\nimport type { EasingFunction } from \"./types\"\n\n/*\n Create stepped version of 0-1 progress\n\n @param [int]: Number of steps\n @param [number]: Current value\n @return [number]: Stepped value\n*/\nexport type Direction = \"start\" | \"end\"\n\n/*#__NO_SIDE_EFFECTS__*/\nexport function steps(\n numSteps: number,\n direction: Direction = \"end\"\n): EasingFunction {\n return (progress: number) => {\n progress =\n direction === \"end\"\n ? Math.min(progress, 0.999)\n : Math.max(progress, 0.001)\n const expanded = progress * numSteps\n const rounded =\n direction === \"end\" ? Math.floor(expanded) : Math.ceil(expanded)\n\n return clamp(0, 1, rounded / numSteps)\n }\n}\n"],"names":[],"mappings":";;AAYA;SACgB,KAAK,CACjB,QAAgB,EAChB,YAAuB,KAAK,EAAA;IAE5B,OAAO,CAAC,QAAgB,KAAI;QACxB,QAAQ;AACJ,YAAA,SAAS,KAAK;kBACR,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK;kBACxB,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAC;AACnC,QAAA,MAAM,QAAQ,GAAG,QAAQ,GAAG,QAAQ;QACpC,MAAM,OAAO,GACT,SAAS,KAAK,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;QAEpE,OAAO,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;AAC1C,IAAA,CAAC;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/easing/utils/get-easing-for-segment.mjs b/node_modules/motion-utils/dist/es/easing/utils/get-easing-for-segment.mjs deleted file mode 100644 index 79a8519..0000000 --- a/node_modules/motion-utils/dist/es/easing/utils/get-easing-for-segment.mjs +++ /dev/null @@ -1,10 +0,0 @@ -import { wrap } from '../../wrap.mjs'; -import { isEasingArray } from './is-easing-array.mjs'; - -/*#__NO_SIDE_EFFECTS__*/ -function getEasingForSegment(easing, i) { - return isEasingArray(easing) ? easing[wrap(0, easing.length, i)] : easing; -} - -export { getEasingForSegment }; -//# sourceMappingURL=get-easing-for-segment.mjs.map diff --git a/node_modules/motion-utils/dist/es/easing/utils/get-easing-for-segment.mjs.map b/node_modules/motion-utils/dist/es/easing/utils/get-easing-for-segment.mjs.map deleted file mode 100644 index 32b3b48..0000000 --- a/node_modules/motion-utils/dist/es/easing/utils/get-easing-for-segment.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"get-easing-for-segment.mjs","sources":["../../../../src/easing/utils/get-easing-for-segment.ts"],"sourcesContent":["import { wrap } from \"../../wrap\"\nimport { Easing } from \"../types\"\nimport { isEasingArray } from \"./is-easing-array\"\n\n/*#__NO_SIDE_EFFECTS__*/\nexport function getEasingForSegment(\n easing: Easing | Easing[],\n i: number\n): Easing {\n return isEasingArray(easing) ? easing[wrap(0, easing.length, i)] : easing\n}\n"],"names":[],"mappings":";;;AAIA;AACM,SAAU,mBAAmB,CAC/B,MAAyB,EACzB,CAAS,EAAA;IAET,OAAO,aAAa,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,GAAG,MAAM;AAC7E;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/easing/utils/is-bezier-definition.mjs b/node_modules/motion-utils/dist/es/easing/utils/is-bezier-definition.mjs deleted file mode 100644 index 1a3c736..0000000 --- a/node_modules/motion-utils/dist/es/easing/utils/is-bezier-definition.mjs +++ /dev/null @@ -1,5 +0,0 @@ -/*#__NO_SIDE_EFFECTS__*/ -const isBezierDefinition = (easing) => Array.isArray(easing) && typeof easing[0] === "number"; - -export { isBezierDefinition }; -//# sourceMappingURL=is-bezier-definition.mjs.map diff --git a/node_modules/motion-utils/dist/es/easing/utils/is-bezier-definition.mjs.map b/node_modules/motion-utils/dist/es/easing/utils/is-bezier-definition.mjs.map deleted file mode 100644 index ffbdd27..0000000 --- a/node_modules/motion-utils/dist/es/easing/utils/is-bezier-definition.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"is-bezier-definition.mjs","sources":["../../../../src/easing/utils/is-bezier-definition.ts"],"sourcesContent":["import { BezierDefinition, Easing } from \"../types\"\n\n/*#__NO_SIDE_EFFECTS__*/\nexport const isBezierDefinition = (\n easing: Easing | Easing[]\n): easing is BezierDefinition =>\n Array.isArray(easing) && typeof easing[0] === \"number\"\n"],"names":[],"mappings":"AAEA;MACa,kBAAkB,GAAG,CAC9B,MAAyB,KAEzB,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,OAAO,MAAM,CAAC,CAAC,CAAC,KAAK;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/easing/utils/is-easing-array.mjs b/node_modules/motion-utils/dist/es/easing/utils/is-easing-array.mjs deleted file mode 100644 index 6b01de0..0000000 --- a/node_modules/motion-utils/dist/es/easing/utils/is-easing-array.mjs +++ /dev/null @@ -1,7 +0,0 @@ -/*#__NO_SIDE_EFFECTS__*/ -const isEasingArray = (ease) => { - return Array.isArray(ease) && typeof ease[0] !== "number"; -}; - -export { isEasingArray }; -//# sourceMappingURL=is-easing-array.mjs.map diff --git a/node_modules/motion-utils/dist/es/easing/utils/is-easing-array.mjs.map b/node_modules/motion-utils/dist/es/easing/utils/is-easing-array.mjs.map deleted file mode 100644 index 4fd993d..0000000 --- a/node_modules/motion-utils/dist/es/easing/utils/is-easing-array.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"is-easing-array.mjs","sources":["../../../../src/easing/utils/is-easing-array.ts"],"sourcesContent":["import { Easing } from \"../types\"\n\n/*#__NO_SIDE_EFFECTS__*/\nexport const isEasingArray = (ease: any): ease is Easing[] => {\n return Array.isArray(ease) && typeof ease[0] !== \"number\"\n}\n"],"names":[],"mappings":"AAEA;AACO,MAAM,aAAa,GAAG,CAAC,IAAS,KAAsB;AACzD,IAAA,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,OAAO,IAAI,CAAC,CAAC,CAAC,KAAK,QAAQ;AAC7D;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/easing/utils/map.mjs b/node_modules/motion-utils/dist/es/easing/utils/map.mjs deleted file mode 100644 index 83b042d..0000000 --- a/node_modules/motion-utils/dist/es/easing/utils/map.mjs +++ /dev/null @@ -1,42 +0,0 @@ -import { invariant } from '../../errors.mjs'; -import { noop } from '../../noop.mjs'; -import { anticipate } from '../anticipate.mjs'; -import { backOut, backInOut, backIn } from '../back.mjs'; -import { circOut, circInOut, circIn } from '../circ.mjs'; -import { cubicBezier } from '../cubic-bezier.mjs'; -import { easeOut, easeInOut, easeIn } from '../ease.mjs'; -import { isBezierDefinition } from './is-bezier-definition.mjs'; - -const easingLookup = { - linear: noop, - easeIn, - easeInOut, - easeOut, - circIn, - circInOut, - circOut, - backIn, - backInOut, - backOut, - anticipate, -}; -const isValidEasing = (easing) => { - return typeof easing === "string"; -}; -const easingDefinitionToFunction = (definition) => { - if (isBezierDefinition(definition)) { - // If cubic bezier definition, create bezier curve - invariant(definition.length === 4, `Cubic bezier arrays must contain four numerical values.`, "cubic-bezier-length"); - const [x1, y1, x2, y2] = definition; - return cubicBezier(x1, y1, x2, y2); - } - else if (isValidEasing(definition)) { - // Else lookup from table - invariant(easingLookup[definition] !== undefined, `Invalid easing type '${definition}'`, "invalid-easing-type"); - return easingLookup[definition]; - } - return definition; -}; - -export { easingDefinitionToFunction }; -//# sourceMappingURL=map.mjs.map diff --git a/node_modules/motion-utils/dist/es/easing/utils/map.mjs.map b/node_modules/motion-utils/dist/es/easing/utils/map.mjs.map deleted file mode 100644 index c9d19ff..0000000 --- a/node_modules/motion-utils/dist/es/easing/utils/map.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"map.mjs","sources":["../../../../src/easing/utils/map.ts"],"sourcesContent":["import { invariant } from \"../../errors\"\nimport { noop } from \"../../noop\"\nimport { anticipate } from \"../anticipate\"\nimport { backIn, backInOut, backOut } from \"../back\"\nimport { circIn, circInOut, circOut } from \"../circ\"\nimport { cubicBezier } from \"../cubic-bezier\"\nimport { easeIn, easeInOut, easeOut } from \"../ease\"\nimport { Easing, EasingFunction } from \"../types\"\nimport { isBezierDefinition } from \"./is-bezier-definition\"\n\nconst easingLookup = {\n linear: noop,\n easeIn,\n easeInOut,\n easeOut,\n circIn,\n circInOut,\n circOut,\n backIn,\n backInOut,\n backOut,\n anticipate,\n}\n\nconst isValidEasing = (easing: Easing): easing is keyof typeof easingLookup => {\n return typeof easing === \"string\"\n}\n\nexport const easingDefinitionToFunction = (\n definition: Easing\n): EasingFunction => {\n if (isBezierDefinition(definition)) {\n // If cubic bezier definition, create bezier curve\n invariant(\n definition.length === 4,\n `Cubic bezier arrays must contain four numerical values.`,\n \"cubic-bezier-length\"\n )\n\n const [x1, y1, x2, y2] = definition\n return cubicBezier(x1, y1, x2, y2)\n } else if (isValidEasing(definition)) {\n // Else lookup from table\n invariant(\n easingLookup[definition] !== undefined,\n `Invalid easing type '${definition}'`,\n \"invalid-easing-type\"\n )\n return easingLookup[definition]\n }\n\n return definition\n}\n"],"names":[],"mappings":";;;;;;;;;AAUA,MAAM,YAAY,GAAG;AACjB,IAAA,MAAM,EAAE,IAAI;IACZ,MAAM;IACN,SAAS;IACT,OAAO;IACP,MAAM;IACN,SAAS;IACT,OAAO;IACP,MAAM;IACN,SAAS;IACT,OAAO;IACP,UAAU;CACb;AAED,MAAM,aAAa,GAAG,CAAC,MAAc,KAAyC;AAC1E,IAAA,OAAO,OAAO,MAAM,KAAK,QAAQ;AACrC,CAAC;AAEM,MAAM,0BAA0B,GAAG,CACtC,UAAkB,KACF;AAChB,IAAA,IAAI,kBAAkB,CAAC,UAAU,CAAC,EAAE;;QAEhC,SAAS,CACL,UAAU,CAAC,MAAM,KAAK,CAAC,EACvB,CAAA,uDAAA,CAAyD,EACzD,qBAAqB,CACxB;QAED,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,GAAG,UAAU;QACnC,OAAO,WAAW,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC;IACtC;AAAO,SAAA,IAAI,aAAa,CAAC,UAAU,CAAC,EAAE;;AAElC,QAAA,SAAS,CACL,YAAY,CAAC,UAAU,CAAC,KAAK,SAAS,EACtC,CAAA,qBAAA,EAAwB,UAAU,CAAA,CAAA,CAAG,EACrC,qBAAqB,CACxB;AACD,QAAA,OAAO,YAAY,CAAC,UAAU,CAAC;IACnC;AAEA,IAAA,OAAO,UAAU;AACrB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/errors.mjs b/node_modules/motion-utils/dist/es/errors.mjs deleted file mode 100644 index 851adc9..0000000 --- a/node_modules/motion-utils/dist/es/errors.mjs +++ /dev/null @@ -1,20 +0,0 @@ -import { formatErrorMessage } from './format-error-message.mjs'; - -let warning = () => { }; -let invariant = () => { }; -if (typeof process !== "undefined" && - process.env?.NODE_ENV !== "production") { - warning = (check, message, errorCode) => { - if (!check && typeof console !== "undefined") { - console.warn(formatErrorMessage(message, errorCode)); - } - }; - invariant = (check, message, errorCode) => { - if (!check) { - throw new Error(formatErrorMessage(message, errorCode)); - } - }; -} - -export { invariant, warning }; -//# sourceMappingURL=errors.mjs.map diff --git a/node_modules/motion-utils/dist/es/errors.mjs.map b/node_modules/motion-utils/dist/es/errors.mjs.map deleted file mode 100644 index 837d6ef..0000000 --- a/node_modules/motion-utils/dist/es/errors.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"errors.mjs","sources":["../../src/errors.ts"],"sourcesContent":["import { formatErrorMessage } from \"./format-error-message\"\n\nexport type DevMessage = (\n check: boolean,\n message: string,\n errorCode?: string\n) => void\n\nlet warning: DevMessage = () => {}\nlet invariant: DevMessage = () => {}\n\nif (\n typeof process !== \"undefined\" &&\n process.env?.NODE_ENV !== \"production\"\n) {\n warning = (check, message, errorCode) => {\n if (!check && typeof console !== \"undefined\") {\n console.warn(formatErrorMessage(message, errorCode))\n }\n }\n\n invariant = (check, message, errorCode) => {\n if (!check) {\n throw new Error(formatErrorMessage(message, errorCode))\n }\n }\n}\n\nexport { invariant, warning }\n"],"names":[],"mappings":";;AAQA,IAAI,OAAO,GAAe,MAAK,EAAE;AACjC,IAAI,SAAS,GAAe,MAAK,EAAE;AAEnC,IACI,OAAO,OAAO,KAAK,WAAW;AAC9B,IAAA,OAAO,CAAC,GAAG,EAAE,QAAQ,KAAK,YAAY,EACxC;IACE,OAAO,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,SAAS,KAAI;QACpC,IAAI,CAAC,KAAK,IAAI,OAAO,OAAO,KAAK,WAAW,EAAE;YAC1C,OAAO,CAAC,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;QACxD;AACJ,IAAA,CAAC;IAED,SAAS,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,SAAS,KAAI;QACtC,IAAI,CAAC,KAAK,EAAE;YACR,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;QAC3D;AACJ,IAAA,CAAC;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/format-error-message.mjs b/node_modules/motion-utils/dist/es/format-error-message.mjs deleted file mode 100644 index dee97cc..0000000 --- a/node_modules/motion-utils/dist/es/format-error-message.mjs +++ /dev/null @@ -1,8 +0,0 @@ -function formatErrorMessage(message, errorCode) { - return errorCode - ? `${message}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${errorCode}` - : message; -} - -export { formatErrorMessage }; -//# sourceMappingURL=format-error-message.mjs.map diff --git a/node_modules/motion-utils/dist/es/format-error-message.mjs.map b/node_modules/motion-utils/dist/es/format-error-message.mjs.map deleted file mode 100644 index d2ce8ba..0000000 --- a/node_modules/motion-utils/dist/es/format-error-message.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"format-error-message.mjs","sources":["../../src/format-error-message.ts"],"sourcesContent":["export function formatErrorMessage(message: string, errorCode?: string) {\n return errorCode\n ? `${message}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${errorCode}`\n : message\n}\n"],"names":[],"mappings":"AAAM,SAAU,kBAAkB,CAAC,OAAe,EAAE,SAAkB,EAAA;AAClE,IAAA,OAAO;AACH,UAAE,CAAA,EAAG,OAAO,CAAA,uFAAA,EAA0F,SAAS,CAAA;UAC7G,OAAO;AACjB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/global-config.mjs b/node_modules/motion-utils/dist/es/global-config.mjs deleted file mode 100644 index 66ed577..0000000 --- a/node_modules/motion-utils/dist/es/global-config.mjs +++ /dev/null @@ -1,4 +0,0 @@ -const MotionGlobalConfig = {}; - -export { MotionGlobalConfig }; -//# sourceMappingURL=global-config.mjs.map diff --git a/node_modules/motion-utils/dist/es/global-config.mjs.map b/node_modules/motion-utils/dist/es/global-config.mjs.map deleted file mode 100644 index 664cd85..0000000 --- a/node_modules/motion-utils/dist/es/global-config.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"global-config.mjs","sources":["../../src/global-config.ts"],"sourcesContent":["export const MotionGlobalConfig: {\n skipAnimations?: boolean\n instantAnimations?: boolean\n useManualTiming?: boolean\n WillChange?: any\n mix?: (a: T, b: T) => (p: number) => T\n} = {}\n"],"names":[],"mappings":"AAAO,MAAM,kBAAkB,GAM3B;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/index.mjs b/node_modules/motion-utils/dist/es/index.mjs deleted file mode 100644 index 2f07b9a..0000000 --- a/node_modules/motion-utils/dist/es/index.mjs +++ /dev/null @@ -1,29 +0,0 @@ -export { addUniqueItem, moveItem, removeItem } from './array.mjs'; -export { clamp } from './clamp.mjs'; -export { invariant, warning } from './errors.mjs'; -export { MotionGlobalConfig } from './global-config.mjs'; -export { isNumericalString } from './is-numerical-string.mjs'; -export { isObject } from './is-object.mjs'; -export { isZeroValueString } from './is-zero-value-string.mjs'; -export { memo } from './memo.mjs'; -export { noop } from './noop.mjs'; -export { pipe } from './pipe.mjs'; -export { progress } from './progress.mjs'; -export { SubscriptionManager } from './subscription-manager.mjs'; -export { millisecondsToSeconds, secondsToMilliseconds } from './time-conversion.mjs'; -export { velocityPerSecond } from './velocity-per-second.mjs'; -export { hasWarned, warnOnce } from './warn-once.mjs'; -export { wrap } from './wrap.mjs'; -export { anticipate } from './easing/anticipate.mjs'; -export { backIn, backInOut, backOut } from './easing/back.mjs'; -export { circIn, circInOut, circOut } from './easing/circ.mjs'; -export { cubicBezier } from './easing/cubic-bezier.mjs'; -export { easeIn, easeInOut, easeOut } from './easing/ease.mjs'; -export { mirrorEasing } from './easing/modifiers/mirror.mjs'; -export { reverseEasing } from './easing/modifiers/reverse.mjs'; -export { steps } from './easing/steps.mjs'; -export { getEasingForSegment } from './easing/utils/get-easing-for-segment.mjs'; -export { isBezierDefinition } from './easing/utils/is-bezier-definition.mjs'; -export { isEasingArray } from './easing/utils/is-easing-array.mjs'; -export { easingDefinitionToFunction } from './easing/utils/map.mjs'; -//# sourceMappingURL=index.mjs.map diff --git a/node_modules/motion-utils/dist/es/index.mjs.map b/node_modules/motion-utils/dist/es/index.mjs.map deleted file mode 100644 index 9b2660b..0000000 --- a/node_modules/motion-utils/dist/es/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/is-numerical-string.mjs b/node_modules/motion-utils/dist/es/is-numerical-string.mjs deleted file mode 100644 index cb4ce6e..0000000 --- a/node_modules/motion-utils/dist/es/is-numerical-string.mjs +++ /dev/null @@ -1,7 +0,0 @@ -/** - * Check if value is a numerical string, ie a string that is purely a number eg "100" or "-100.1" - */ -const isNumericalString = (v) => /^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(v); - -export { isNumericalString }; -//# sourceMappingURL=is-numerical-string.mjs.map diff --git a/node_modules/motion-utils/dist/es/is-numerical-string.mjs.map b/node_modules/motion-utils/dist/es/is-numerical-string.mjs.map deleted file mode 100644 index f8a9eae..0000000 --- a/node_modules/motion-utils/dist/es/is-numerical-string.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"is-numerical-string.mjs","sources":["../../src/is-numerical-string.ts"],"sourcesContent":["/**\n * Check if value is a numerical string, ie a string that is purely a number eg \"100\" or \"-100.1\"\n */\nexport const isNumericalString = (v: string) => /^-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)$/u.test(v)\n"],"names":[],"mappings":"AAAA;;AAEG;AACI,MAAM,iBAAiB,GAAG,CAAC,CAAS,KAAK,8BAA8B,CAAC,IAAI,CAAC,CAAC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/is-object.mjs b/node_modules/motion-utils/dist/es/is-object.mjs deleted file mode 100644 index 7f9bd3e..0000000 --- a/node_modules/motion-utils/dist/es/is-object.mjs +++ /dev/null @@ -1,4 +0,0 @@ -const isObject = (value) => typeof value === "object" && value !== null; - -export { isObject }; -//# sourceMappingURL=is-object.mjs.map diff --git a/node_modules/motion-utils/dist/es/is-object.mjs.map b/node_modules/motion-utils/dist/es/is-object.mjs.map deleted file mode 100644 index 44b4814..0000000 --- a/node_modules/motion-utils/dist/es/is-object.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"is-object.mjs","sources":["../../src/is-object.ts"],"sourcesContent":["export const isObject = (value: unknown): value is object =>\n typeof value === \"object\" && value !== null\n"],"names":[],"mappings":"AAAO,MAAM,QAAQ,GAAG,CAAC,KAAc,KACnC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/is-zero-value-string.mjs b/node_modules/motion-utils/dist/es/is-zero-value-string.mjs deleted file mode 100644 index ba89398..0000000 --- a/node_modules/motion-utils/dist/es/is-zero-value-string.mjs +++ /dev/null @@ -1,7 +0,0 @@ -/** - * Check if the value is a zero value string like "0px" or "0%" - */ -const isZeroValueString = (v) => /^0[^.\s]+$/u.test(v); - -export { isZeroValueString }; -//# sourceMappingURL=is-zero-value-string.mjs.map diff --git a/node_modules/motion-utils/dist/es/is-zero-value-string.mjs.map b/node_modules/motion-utils/dist/es/is-zero-value-string.mjs.map deleted file mode 100644 index 8c7f2af..0000000 --- a/node_modules/motion-utils/dist/es/is-zero-value-string.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"is-zero-value-string.mjs","sources":["../../src/is-zero-value-string.ts"],"sourcesContent":["/**\n * Check if the value is a zero value string like \"0px\" or \"0%\"\n */\nexport const isZeroValueString = (v: string) => /^0[^.\\s]+$/u.test(v)\n"],"names":[],"mappings":"AAAA;;AAEG;AACI,MAAM,iBAAiB,GAAG,CAAC,CAAS,KAAK,aAAa,CAAC,IAAI,CAAC,CAAC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/memo.mjs b/node_modules/motion-utils/dist/es/memo.mjs deleted file mode 100644 index d164ae4..0000000 --- a/node_modules/motion-utils/dist/es/memo.mjs +++ /dev/null @@ -1,12 +0,0 @@ -/*#__NO_SIDE_EFFECTS__*/ -function memo(callback) { - let result; - return () => { - if (result === undefined) - result = callback(); - return result; - }; -} - -export { memo }; -//# sourceMappingURL=memo.mjs.map diff --git a/node_modules/motion-utils/dist/es/memo.mjs.map b/node_modules/motion-utils/dist/es/memo.mjs.map deleted file mode 100644 index 8b7e888..0000000 --- a/node_modules/motion-utils/dist/es/memo.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"memo.mjs","sources":["../../src/memo.ts"],"sourcesContent":["/*#__NO_SIDE_EFFECTS__*/\nexport function memo(callback: () => T) {\n let result: T | undefined\n\n return () => {\n if (result === undefined) result = callback()\n return result\n }\n}\n"],"names":[],"mappings":"AAAA;AACM,SAAU,IAAI,CAAgB,QAAiB,EAAA;AACjD,IAAA,IAAI,MAAqB;AAEzB,IAAA,OAAO,MAAK;QACR,IAAI,MAAM,KAAK,SAAS;YAAE,MAAM,GAAG,QAAQ,EAAE;AAC7C,QAAA,OAAO,MAAM;AACjB,IAAA,CAAC;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/noop.mjs b/node_modules/motion-utils/dist/es/noop.mjs deleted file mode 100644 index bd29da3..0000000 --- a/node_modules/motion-utils/dist/es/noop.mjs +++ /dev/null @@ -1,5 +0,0 @@ -/*#__NO_SIDE_EFFECTS__*/ -const noop = (any) => any; - -export { noop }; -//# sourceMappingURL=noop.mjs.map diff --git a/node_modules/motion-utils/dist/es/noop.mjs.map b/node_modules/motion-utils/dist/es/noop.mjs.map deleted file mode 100644 index fffdfa8..0000000 --- a/node_modules/motion-utils/dist/es/noop.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"noop.mjs","sources":["../../src/noop.ts"],"sourcesContent":["/*#__NO_SIDE_EFFECTS__*/\nexport const noop = (any: T): T => any\n"],"names":[],"mappings":"AAAA;AACO,MAAM,IAAI,GAAG,CAAI,GAAM,KAAQ;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/pipe.mjs b/node_modules/motion-utils/dist/es/pipe.mjs deleted file mode 100644 index bd4512c..0000000 --- a/node_modules/motion-utils/dist/es/pipe.mjs +++ /dev/null @@ -1,11 +0,0 @@ -/** - * Pipe - * Compose other transformers to run linearily - * pipe(min(20), max(40)) - * @param {...functions} transformers - * @return {function} - */ -const pipe = (...transformers) => transformers.reduce((a, b) => (v) => b(a(v))); - -export { pipe }; -//# sourceMappingURL=pipe.mjs.map diff --git a/node_modules/motion-utils/dist/es/pipe.mjs.map b/node_modules/motion-utils/dist/es/pipe.mjs.map deleted file mode 100644 index 12dd636..0000000 --- a/node_modules/motion-utils/dist/es/pipe.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"pipe.mjs","sources":["../../src/pipe.ts"],"sourcesContent":["/**\n * Pipe\n * Compose other transformers to run linearily\n * pipe(min(20), max(40))\n * @param {...functions} transformers\n * @return {function}\n */\nexport const pipe = (...transformers: Function[]) =>\n transformers.reduce((a, b) => (v: any) => b(a(v)))\n"],"names":[],"mappings":"AAAA;;;;;;AAMG;AACI,MAAM,IAAI,GAAG,CAAC,GAAG,YAAwB,KAC5C,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAM,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/progress.mjs b/node_modules/motion-utils/dist/es/progress.mjs deleted file mode 100644 index d964710..0000000 --- a/node_modules/motion-utils/dist/es/progress.mjs +++ /dev/null @@ -1,15 +0,0 @@ -/* - Progress within given range - - Given a lower limit and an upper limit, we return the progress - (expressed as a number 0-1) represented by the given value, and - limit that progress to within 0-1. -*/ -/*#__NO_SIDE_EFFECTS__*/ -const progress = (from, to, value) => { - const range = to - from; - return range ? (value - from) / range : 1; -}; - -export { progress }; -//# sourceMappingURL=progress.mjs.map diff --git a/node_modules/motion-utils/dist/es/progress.mjs.map b/node_modules/motion-utils/dist/es/progress.mjs.map deleted file mode 100644 index 99c498d..0000000 --- a/node_modules/motion-utils/dist/es/progress.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"progress.mjs","sources":["../../src/progress.ts"],"sourcesContent":["/*\n Progress within given range\n\n Given a lower limit and an upper limit, we return the progress\n (expressed as a number 0-1) represented by the given value, and\n limit that progress to within 0-1.\n*/\n/*#__NO_SIDE_EFFECTS__*/\nexport const progress = (from: number, to: number, value: number) => {\n const range = to - from\n return range ? (value - from) / range : 1\n}\n"],"names":[],"mappings":"AAAA;;;;;;AAME;AACF;AACO,MAAM,QAAQ,GAAG,CAAC,IAAY,EAAE,EAAU,EAAE,KAAa,KAAI;AAChE,IAAA,MAAM,KAAK,GAAG,EAAE,GAAG,IAAI;AACvB,IAAA,OAAO,KAAK,GAAG,CAAC,KAAK,GAAG,IAAI,IAAI,KAAK,GAAG,CAAC;AAC7C;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/subscription-manager.mjs b/node_modules/motion-utils/dist/es/subscription-manager.mjs deleted file mode 100644 index 7329b56..0000000 --- a/node_modules/motion-utils/dist/es/subscription-manager.mjs +++ /dev/null @@ -1,41 +0,0 @@ -import { addUniqueItem, removeItem } from './array.mjs'; - -class SubscriptionManager { - constructor() { - this.subscriptions = []; - } - add(handler) { - addUniqueItem(this.subscriptions, handler); - return () => removeItem(this.subscriptions, handler); - } - notify(a, b, c) { - const numSubscriptions = this.subscriptions.length; - if (!numSubscriptions) - return; - if (numSubscriptions === 1) { - /** - * If there's only a single handler we can just call it without invoking a loop. - */ - this.subscriptions[0](a, b, c); - } - else { - for (let i = 0; i < numSubscriptions; i++) { - /** - * Check whether the handler exists before firing as it's possible - * the subscriptions were modified during this loop running. - */ - const handler = this.subscriptions[i]; - handler && handler(a, b, c); - } - } - } - getSize() { - return this.subscriptions.length; - } - clear() { - this.subscriptions.length = 0; - } -} - -export { SubscriptionManager }; -//# sourceMappingURL=subscription-manager.mjs.map diff --git a/node_modules/motion-utils/dist/es/subscription-manager.mjs.map b/node_modules/motion-utils/dist/es/subscription-manager.mjs.map deleted file mode 100644 index 8a2a74d..0000000 --- a/node_modules/motion-utils/dist/es/subscription-manager.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"subscription-manager.mjs","sources":["../../src/subscription-manager.ts"],"sourcesContent":["import { addUniqueItem, removeItem } from \"./array\"\n\ntype GenericHandler = (...args: any) => void\n\nexport class SubscriptionManager {\n private subscriptions: Handler[] = []\n\n add(handler: Handler): VoidFunction {\n addUniqueItem(this.subscriptions, handler)\n return () => removeItem(this.subscriptions, handler)\n }\n\n notify(\n a?: Parameters[0],\n b?: Parameters[1],\n c?: Parameters[2]\n ) {\n const numSubscriptions = this.subscriptions.length\n\n if (!numSubscriptions) return\n\n if (numSubscriptions === 1) {\n /**\n * If there's only a single handler we can just call it without invoking a loop.\n */\n this.subscriptions[0](a, b, c)\n } else {\n for (let i = 0; i < numSubscriptions; i++) {\n /**\n * Check whether the handler exists before firing as it's possible\n * the subscriptions were modified during this loop running.\n */\n const handler = this.subscriptions[i]\n handler && handler(a, b, c)\n }\n }\n }\n\n getSize() {\n return this.subscriptions.length\n }\n\n clear() {\n this.subscriptions.length = 0\n }\n}\n"],"names":[],"mappings":";;MAIa,mBAAmB,CAAA;AAAhC,IAAA,WAAA,GAAA;QACY,IAAA,CAAA,aAAa,GAAc,EAAE;IAwCzC;AAtCI,IAAA,GAAG,CAAC,OAAgB,EAAA;AAChB,QAAA,aAAa,CAAC,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC;QAC1C,OAAO,MAAM,UAAU,CAAC,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC;IACxD;AAEA,IAAA,MAAM,CACF,CAA0B,EAC1B,CAA0B,EAC1B,CAA0B,EAAA;AAE1B,QAAA,MAAM,gBAAgB,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM;AAElD,QAAA,IAAI,CAAC,gBAAgB;YAAE;AAEvB,QAAA,IAAI,gBAAgB,KAAK,CAAC,EAAE;AACxB;;AAEG;AACH,YAAA,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;QAClC;aAAO;AACH,YAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,gBAAgB,EAAE,CAAC,EAAE,EAAE;AACvC;;;AAGG;gBACH,MAAM,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC;gBACrC,OAAO,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;YAC/B;QACJ;IACJ;IAEA,OAAO,GAAA;AACH,QAAA,OAAO,IAAI,CAAC,aAAa,CAAC,MAAM;IACpC;IAEA,KAAK,GAAA;AACD,QAAA,IAAI,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC;IACjC;AACH;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/time-conversion.mjs b/node_modules/motion-utils/dist/es/time-conversion.mjs deleted file mode 100644 index f770399..0000000 --- a/node_modules/motion-utils/dist/es/time-conversion.mjs +++ /dev/null @@ -1,13 +0,0 @@ -/** - * Converts seconds to milliseconds - * - * @param seconds - Time in seconds. - * @return milliseconds - Converted time in milliseconds. - */ -/*#__NO_SIDE_EFFECTS__*/ -const secondsToMilliseconds = (seconds) => seconds * 1000; -/*#__NO_SIDE_EFFECTS__*/ -const millisecondsToSeconds = (milliseconds) => milliseconds / 1000; - -export { millisecondsToSeconds, secondsToMilliseconds }; -//# sourceMappingURL=time-conversion.mjs.map diff --git a/node_modules/motion-utils/dist/es/time-conversion.mjs.map b/node_modules/motion-utils/dist/es/time-conversion.mjs.map deleted file mode 100644 index 3b40c54..0000000 --- a/node_modules/motion-utils/dist/es/time-conversion.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"time-conversion.mjs","sources":["../../src/time-conversion.ts"],"sourcesContent":["/**\n * Converts seconds to milliseconds\n *\n * @param seconds - Time in seconds.\n * @return milliseconds - Converted time in milliseconds.\n */\n\n/*#__NO_SIDE_EFFECTS__*/\nexport const secondsToMilliseconds = (seconds: number) => seconds * 1000\n\n/*#__NO_SIDE_EFFECTS__*/\nexport const millisecondsToSeconds = (milliseconds: number) =>\n milliseconds / 1000\n"],"names":[],"mappings":"AAAA;;;;;AAKG;AAEH;AACO,MAAM,qBAAqB,GAAG,CAAC,OAAe,KAAK,OAAO,GAAG;AAEpE;AACO,MAAM,qBAAqB,GAAG,CAAC,YAAoB,KACtD,YAAY,GAAG;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/velocity-per-second.mjs b/node_modules/motion-utils/dist/es/velocity-per-second.mjs deleted file mode 100644 index 6fc328a..0000000 --- a/node_modules/motion-utils/dist/es/velocity-per-second.mjs +++ /dev/null @@ -1,8 +0,0 @@ -/* - Convert velocity into velocity per second -*/ -/*#__NO_SIDE_EFFECTS__*/ -const velocityPerSecond = (velocity, frameDuration) => frameDuration ? velocity * (1000 / frameDuration) : 0; - -export { velocityPerSecond }; -//# sourceMappingURL=velocity-per-second.mjs.map diff --git a/node_modules/motion-utils/dist/es/velocity-per-second.mjs.map b/node_modules/motion-utils/dist/es/velocity-per-second.mjs.map deleted file mode 100644 index d1a94d7..0000000 --- a/node_modules/motion-utils/dist/es/velocity-per-second.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"velocity-per-second.mjs","sources":["../../src/velocity-per-second.ts"],"sourcesContent":["/*\n Convert velocity into velocity per second\n*/\n/*#__NO_SIDE_EFFECTS__*/\nexport const velocityPerSecond = (velocity: number, frameDuration: number) =>\n frameDuration ? velocity * (1000 / frameDuration) : 0\n"],"names":[],"mappings":"AAAA;;AAEE;AACF;AACO,MAAM,iBAAiB,GAAG,CAAC,QAAgB,EAAE,aAAqB,KACrE,aAAa,GAAG,QAAQ,IAAI,IAAI,GAAG,aAAa,CAAC,GAAG;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/warn-once.mjs b/node_modules/motion-utils/dist/es/warn-once.mjs deleted file mode 100644 index 8d68e96..0000000 --- a/node_modules/motion-utils/dist/es/warn-once.mjs +++ /dev/null @@ -1,15 +0,0 @@ -import { formatErrorMessage } from './format-error-message.mjs'; - -const warned = new Set(); -function hasWarned(message) { - return warned.has(message); -} -function warnOnce(condition, message, errorCode) { - if (condition || warned.has(message)) - return; - console.warn(formatErrorMessage(message, errorCode)); - warned.add(message); -} - -export { hasWarned, warnOnce }; -//# sourceMappingURL=warn-once.mjs.map diff --git a/node_modules/motion-utils/dist/es/warn-once.mjs.map b/node_modules/motion-utils/dist/es/warn-once.mjs.map deleted file mode 100644 index 6c6b6f7..0000000 --- a/node_modules/motion-utils/dist/es/warn-once.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"warn-once.mjs","sources":["../../src/warn-once.ts"],"sourcesContent":["import { formatErrorMessage } from \"./format-error-message\"\n\nconst warned = new Set()\n\nexport function hasWarned(message: string) {\n return warned.has(message)\n}\n\nexport function warnOnce(\n condition: boolean,\n message: string,\n errorCode?: string\n) {\n if (condition || warned.has(message)) return\n\n console.warn(formatErrorMessage(message, errorCode))\n warned.add(message)\n}\n"],"names":[],"mappings":";;AAEA,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU;AAE1B,SAAU,SAAS,CAAC,OAAe,EAAA;AACrC,IAAA,OAAO,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC;AAC9B;SAEgB,QAAQ,CACpB,SAAkB,EAClB,OAAe,EACf,SAAkB,EAAA;AAElB,IAAA,IAAI,SAAS,IAAI,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC;QAAE;IAEtC,OAAO,CAAC,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;AACpD,IAAA,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC;AACvB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/wrap.mjs b/node_modules/motion-utils/dist/es/wrap.mjs deleted file mode 100644 index 5fc9fba..0000000 --- a/node_modules/motion-utils/dist/es/wrap.mjs +++ /dev/null @@ -1,7 +0,0 @@ -const wrap = (min, max, v) => { - const rangeSize = max - min; - return ((((v - min) % rangeSize) + rangeSize) % rangeSize) + min; -}; - -export { wrap }; -//# sourceMappingURL=wrap.mjs.map diff --git a/node_modules/motion-utils/dist/es/wrap.mjs.map b/node_modules/motion-utils/dist/es/wrap.mjs.map deleted file mode 100644 index e2fd2d7..0000000 --- a/node_modules/motion-utils/dist/es/wrap.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wrap.mjs","sources":["../../src/wrap.ts"],"sourcesContent":["export const wrap = (min: number, max: number, v: number) => {\n const rangeSize = max - min\n return ((((v - min) % rangeSize) + rangeSize) % rangeSize) + min\n}\n"],"names":[],"mappings":"AAAO,MAAM,IAAI,GAAG,CAAC,GAAW,EAAE,GAAW,EAAE,CAAS,KAAI;AACxD,IAAA,MAAM,SAAS,GAAG,GAAG,GAAG,GAAG;AAC3B,IAAA,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,IAAI,SAAS,IAAI,SAAS,IAAI,SAAS,IAAI,GAAG;AACpE;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/index.d.ts b/node_modules/motion-utils/dist/index.d.ts deleted file mode 100644 index 5ef1fae..0000000 --- a/node_modules/motion-utils/dist/index.d.ts +++ /dev/null @@ -1,147 +0,0 @@ -declare function addUniqueItem(arr: T[], item: T): void; -declare function removeItem(arr: T[], item: T): void; -declare function moveItem([...arr]: T[], fromIndex: number, toIndex: number): T[]; - -declare const clamp: (min: number, max: number, v: number) => number; - -type DevMessage = (check: boolean, message: string, errorCode?: string) => void; -declare let warning: DevMessage; -declare let invariant: DevMessage; - -declare const MotionGlobalConfig: { - skipAnimations?: boolean; - instantAnimations?: boolean; - useManualTiming?: boolean; - WillChange?: any; - mix?: (a: T, b: T) => (p: number) => T; -}; - -/** - * Check if value is a numerical string, ie a string that is purely a number eg "100" or "-100.1" - */ -declare const isNumericalString: (v: string) => boolean; - -declare const isObject: (value: unknown) => value is object; - -/** - * Check if the value is a zero value string like "0px" or "0%" - */ -declare const isZeroValueString: (v: string) => boolean; - -declare function memo(callback: () => T): () => T; - -declare const noop: (any: T) => T; - -/** - * Pipe - * Compose other transformers to run linearily - * pipe(min(20), max(40)) - * @param {...functions} transformers - * @return {function} - */ -declare const pipe: (...transformers: Function[]) => Function; - -declare const progress: (from: number, to: number, value: number) => number; - -type GenericHandler = (...args: any) => void; -declare class SubscriptionManager { - private subscriptions; - add(handler: Handler): VoidFunction; - notify(a?: Parameters[0], b?: Parameters[1], c?: Parameters[2]): void; - getSize(): number; - clear(): void; -} - -/** - * Converts seconds to milliseconds - * - * @param seconds - Time in seconds. - * @return milliseconds - Converted time in milliseconds. - */ -declare const secondsToMilliseconds: (seconds: number) => number; -declare const millisecondsToSeconds: (milliseconds: number) => number; - -declare const velocityPerSecond: (velocity: number, frameDuration: number) => number; - -declare function hasWarned(message: string): boolean; -declare function warnOnce(condition: boolean, message: string, errorCode?: string): void; - -declare const wrap: (min: number, max: number, v: number) => number; - -declare const anticipate: (p: number) => number; - -declare const backOut: (t: number) => number; -declare const backIn: EasingFunction; -declare const backInOut: EasingFunction; - -type EasingFunction = (v: number) => number; -type EasingModifier = (easing: EasingFunction) => EasingFunction; -type BezierDefinition = readonly [number, number, number, number]; -type EasingDefinition = BezierDefinition | "linear" | "easeIn" | "easeOut" | "easeInOut" | "circIn" | "circOut" | "circInOut" | "backIn" | "backOut" | "backInOut" | "anticipate"; -/** - * The easing function to use. Set as one of: - * - * - The name of an in-built easing function. - * - An array of four numbers to define a cubic bezier curve. - * - An easing function, that accepts and returns a progress value between `0` and `1`. - * - * @public - */ -type Easing = EasingDefinition | EasingFunction; - -declare const circIn: EasingFunction; -declare const circOut: EasingFunction; -declare const circInOut: EasingFunction; - -declare function cubicBezier(mX1: number, mY1: number, mX2: number, mY2: number): (t: number) => number; - -declare const easeIn: (t: number) => number; -declare const easeOut: (t: number) => number; -declare const easeInOut: (t: number) => number; - -declare const mirrorEasing: EasingModifier; - -declare const reverseEasing: EasingModifier; - -type Direction = "start" | "end"; -declare function steps(numSteps: number, direction?: Direction): EasingFunction; - -declare function getEasingForSegment(easing: Easing | Easing[], i: number): Easing; - -declare const isBezierDefinition: (easing: Easing | Easing[]) => easing is BezierDefinition; - -declare const isEasingArray: (ease: any) => ease is Easing[]; - -declare const easingDefinitionToFunction: (definition: Easing) => EasingFunction; - -interface Point { - x: number; - y: number; -} -interface Axis { - min: number; - max: number; -} -interface Box { - x: Axis; - y: Axis; -} -interface BoundingBox { - top: number; - right: number; - bottom: number; - left: number; -} -interface AxisDelta { - translate: number; - scale: number; - origin: number; - originPoint: number; -} -interface Delta { - x: AxisDelta; - y: AxisDelta; -} -type TransformPoint = (point: Point) => Point; - -export { type Axis, type AxisDelta, type BezierDefinition, type BoundingBox, type Box, type Delta, type DevMessage, type Direction, type Easing, type EasingDefinition, type EasingFunction, type EasingModifier, MotionGlobalConfig, type Point, SubscriptionManager, type TransformPoint, addUniqueItem, anticipate, backIn, backInOut, backOut, circIn, circInOut, circOut, clamp, cubicBezier, easeIn, easeInOut, easeOut, easingDefinitionToFunction, getEasingForSegment, hasWarned, invariant, isBezierDefinition, isEasingArray, isNumericalString, isObject, isZeroValueString, memo, millisecondsToSeconds, mirrorEasing, moveItem, noop, pipe, progress, removeItem, reverseEasing, secondsToMilliseconds, steps, velocityPerSecond, warnOnce, warning, wrap }; diff --git a/node_modules/motion-utils/dist/motion-utils.dev.js b/node_modules/motion-utils/dist/motion-utils.dev.js deleted file mode 100644 index dc5d721..0000000 --- a/node_modules/motion-utils/dist/motion-utils.dev.js +++ /dev/null @@ -1,348 +0,0 @@ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : - typeof define === 'function' && define.amd ? define(['exports'], factory) : - (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.MotionUtils = {})); -})(this, (function (exports) { 'use strict'; - - function addUniqueItem(arr, item) { - if (arr.indexOf(item) === -1) - arr.push(item); - } - function removeItem(arr, item) { - const index = arr.indexOf(item); - if (index > -1) - arr.splice(index, 1); - } - // Adapted from array-move - function moveItem([...arr], fromIndex, toIndex) { - const startIndex = fromIndex < 0 ? arr.length + fromIndex : fromIndex; - if (startIndex >= 0 && startIndex < arr.length) { - const endIndex = toIndex < 0 ? arr.length + toIndex : toIndex; - const [item] = arr.splice(fromIndex, 1); - arr.splice(endIndex, 0, item); - } - return arr; - } - - const clamp = (min, max, v) => { - if (v > max) - return max; - if (v < min) - return min; - return v; - }; - - function formatErrorMessage(message, errorCode) { - return errorCode - ? `${message}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${errorCode}` - : message; - } - - exports.warning = () => { }; - exports.invariant = () => { }; - if (typeof process !== "undefined" && - process.env?.NODE_ENV !== "production") { - exports.warning = (check, message, errorCode) => { - if (!check && typeof console !== "undefined") { - console.warn(formatErrorMessage(message, errorCode)); - } - }; - exports.invariant = (check, message, errorCode) => { - if (!check) { - throw new Error(formatErrorMessage(message, errorCode)); - } - }; - } - - const MotionGlobalConfig = {}; - - /** - * Check if value is a numerical string, ie a string that is purely a number eg "100" or "-100.1" - */ - const isNumericalString = (v) => /^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(v); - - const isObject = (value) => typeof value === "object" && value !== null; - - /** - * Check if the value is a zero value string like "0px" or "0%" - */ - const isZeroValueString = (v) => /^0[^.\s]+$/u.test(v); - - /*#__NO_SIDE_EFFECTS__*/ - function memo(callback) { - let result; - return () => { - if (result === undefined) - result = callback(); - return result; - }; - } - - /*#__NO_SIDE_EFFECTS__*/ - const noop = (any) => any; - - /** - * Pipe - * Compose other transformers to run linearily - * pipe(min(20), max(40)) - * @param {...functions} transformers - * @return {function} - */ - const pipe = (...transformers) => transformers.reduce((a, b) => (v) => b(a(v))); - - /* - Progress within given range - - Given a lower limit and an upper limit, we return the progress - (expressed as a number 0-1) represented by the given value, and - limit that progress to within 0-1. - */ - /*#__NO_SIDE_EFFECTS__*/ - const progress = (from, to, value) => { - const range = to - from; - return range ? (value - from) / range : 1; - }; - - class SubscriptionManager { - constructor() { - this.subscriptions = []; - } - add(handler) { - addUniqueItem(this.subscriptions, handler); - return () => removeItem(this.subscriptions, handler); - } - notify(a, b, c) { - const numSubscriptions = this.subscriptions.length; - if (!numSubscriptions) - return; - if (numSubscriptions === 1) { - /** - * If there's only a single handler we can just call it without invoking a loop. - */ - this.subscriptions[0](a, b, c); - } - else { - for (let i = 0; i < numSubscriptions; i++) { - /** - * Check whether the handler exists before firing as it's possible - * the subscriptions were modified during this loop running. - */ - const handler = this.subscriptions[i]; - handler && handler(a, b, c); - } - } - } - getSize() { - return this.subscriptions.length; - } - clear() { - this.subscriptions.length = 0; - } - } - - /** - * Converts seconds to milliseconds - * - * @param seconds - Time in seconds. - * @return milliseconds - Converted time in milliseconds. - */ - /*#__NO_SIDE_EFFECTS__*/ - const secondsToMilliseconds = (seconds) => seconds * 1000; - /*#__NO_SIDE_EFFECTS__*/ - const millisecondsToSeconds = (milliseconds) => milliseconds / 1000; - - /* - Convert velocity into velocity per second - */ - /*#__NO_SIDE_EFFECTS__*/ - const velocityPerSecond = (velocity, frameDuration) => frameDuration ? velocity * (1000 / frameDuration) : 0; - - const warned = new Set(); - function hasWarned(message) { - return warned.has(message); - } - function warnOnce(condition, message, errorCode) { - if (condition || warned.has(message)) - return; - console.warn(formatErrorMessage(message, errorCode)); - warned.add(message); - } - - const wrap = (min, max, v) => { - const rangeSize = max - min; - return ((((v - min) % rangeSize) + rangeSize) % rangeSize) + min; - }; - - /* - Bezier function generator - This has been modified from Gaëtan Renaudeau's BezierEasing - https://github.com/gre/bezier-easing/blob/master/src/index.js - https://github.com/gre/bezier-easing/blob/master/LICENSE - - I've removed the newtonRaphsonIterate algo because in benchmarking it - wasn't noticeably faster than binarySubdivision, indeed removing it - usually improved times, depending on the curve. - I also removed the lookup table, as for the added bundle size and loop we're - only cutting ~4 or so subdivision iterations. I bumped the max iterations up - to 12 to compensate and this still tended to be faster for no perceivable - loss in accuracy. - Usage - const easeOut = cubicBezier(.17,.67,.83,.67); - const x = easeOut(0.5); // returns 0.627... - */ - // Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2. - const calcBezier = (t, a1, a2) => (((1.0 - 3.0 * a2 + 3.0 * a1) * t + (3.0 * a2 - 6.0 * a1)) * t + 3.0 * a1) * - t; - const subdivisionPrecision = 0.0000001; - const subdivisionMaxIterations = 12; - function binarySubdivide(x, lowerBound, upperBound, mX1, mX2) { - let currentX; - let currentT; - let i = 0; - do { - currentT = lowerBound + (upperBound - lowerBound) / 2.0; - currentX = calcBezier(currentT, mX1, mX2) - x; - if (currentX > 0.0) { - upperBound = currentT; - } - else { - lowerBound = currentT; - } - } while (Math.abs(currentX) > subdivisionPrecision && - ++i < subdivisionMaxIterations); - return currentT; - } - /*#__NO_SIDE_EFFECTS__*/ - function cubicBezier(mX1, mY1, mX2, mY2) { - // If this is a linear gradient, return linear easing - if (mX1 === mY1 && mX2 === mY2) - return noop; - const getTForX = (aX) => binarySubdivide(aX, 0, 1, mX1, mX2); - // If animation is at start/end, return t without easing - return (t) => t === 0 || t === 1 ? t : calcBezier(getTForX(t), mY1, mY2); - } - - // Accepts an easing function and returns a new one that outputs mirrored values for - // the second half of the animation. Turns easeIn into easeInOut. - /*#__NO_SIDE_EFFECTS__*/ - const mirrorEasing = (easing) => (p) => p <= 0.5 ? easing(2 * p) / 2 : (2 - easing(2 * (1 - p))) / 2; - - // Accepts an easing function and returns a new one that outputs reversed values. - // Turns easeIn into easeOut. - /*#__NO_SIDE_EFFECTS__*/ - const reverseEasing = (easing) => (p) => 1 - easing(1 - p); - - const backOut = /*@__PURE__*/ cubicBezier(0.33, 1.53, 0.69, 0.99); - const backIn = /*@__PURE__*/ reverseEasing(backOut); - const backInOut = /*@__PURE__*/ mirrorEasing(backIn); - - const anticipate = (p) => p >= 1 - ? 1 - : (p *= 2) < 1 - ? 0.5 * backIn(p) - : 0.5 * (2 - Math.pow(2, -10 * (p - 1))); - - const circIn = (p) => 1 - Math.sin(Math.acos(p)); - const circOut = reverseEasing(circIn); - const circInOut = mirrorEasing(circIn); - - const easeIn = /*@__PURE__*/ cubicBezier(0.42, 0, 1, 1); - const easeOut = /*@__PURE__*/ cubicBezier(0, 0, 0.58, 1); - const easeInOut = /*@__PURE__*/ cubicBezier(0.42, 0, 0.58, 1); - - /*#__NO_SIDE_EFFECTS__*/ - function steps(numSteps, direction = "end") { - return (progress) => { - progress = - direction === "end" - ? Math.min(progress, 0.999) - : Math.max(progress, 0.001); - const expanded = progress * numSteps; - const rounded = direction === "end" ? Math.floor(expanded) : Math.ceil(expanded); - return clamp(0, 1, rounded / numSteps); - }; - } - - /*#__NO_SIDE_EFFECTS__*/ - const isEasingArray = (ease) => { - return Array.isArray(ease) && typeof ease[0] !== "number"; - }; - - /*#__NO_SIDE_EFFECTS__*/ - function getEasingForSegment(easing, i) { - return isEasingArray(easing) ? easing[wrap(0, easing.length, i)] : easing; - } - - /*#__NO_SIDE_EFFECTS__*/ - const isBezierDefinition = (easing) => Array.isArray(easing) && typeof easing[0] === "number"; - - const easingLookup = { - linear: noop, - easeIn, - easeInOut, - easeOut, - circIn, - circInOut, - circOut, - backIn, - backInOut, - backOut, - anticipate, - }; - const isValidEasing = (easing) => { - return typeof easing === "string"; - }; - const easingDefinitionToFunction = (definition) => { - if (isBezierDefinition(definition)) { - // If cubic bezier definition, create bezier curve - exports.invariant(definition.length === 4, `Cubic bezier arrays must contain four numerical values.`, "cubic-bezier-length"); - const [x1, y1, x2, y2] = definition; - return cubicBezier(x1, y1, x2, y2); - } - else if (isValidEasing(definition)) { - // Else lookup from table - exports.invariant(easingLookup[definition] !== undefined, `Invalid easing type '${definition}'`, "invalid-easing-type"); - return easingLookup[definition]; - } - return definition; - }; - - exports.MotionGlobalConfig = MotionGlobalConfig; - exports.SubscriptionManager = SubscriptionManager; - exports.addUniqueItem = addUniqueItem; - exports.anticipate = anticipate; - exports.backIn = backIn; - exports.backInOut = backInOut; - exports.backOut = backOut; - exports.circIn = circIn; - exports.circInOut = circInOut; - exports.circOut = circOut; - exports.clamp = clamp; - exports.cubicBezier = cubicBezier; - exports.easeIn = easeIn; - exports.easeInOut = easeInOut; - exports.easeOut = easeOut; - exports.easingDefinitionToFunction = easingDefinitionToFunction; - exports.getEasingForSegment = getEasingForSegment; - exports.hasWarned = hasWarned; - exports.isBezierDefinition = isBezierDefinition; - exports.isEasingArray = isEasingArray; - exports.isNumericalString = isNumericalString; - exports.isObject = isObject; - exports.isZeroValueString = isZeroValueString; - exports.memo = memo; - exports.millisecondsToSeconds = millisecondsToSeconds; - exports.mirrorEasing = mirrorEasing; - exports.moveItem = moveItem; - exports.noop = noop; - exports.pipe = pipe; - exports.progress = progress; - exports.removeItem = removeItem; - exports.reverseEasing = reverseEasing; - exports.secondsToMilliseconds = secondsToMilliseconds; - exports.steps = steps; - exports.velocityPerSecond = velocityPerSecond; - exports.warnOnce = warnOnce; - exports.wrap = wrap; - -})); diff --git a/node_modules/motion-utils/dist/motion-utils.js b/node_modules/motion-utils/dist/motion-utils.js deleted file mode 100644 index 34f8b07..0000000 --- a/node_modules/motion-utils/dist/motion-utils.js +++ /dev/null @@ -1 +0,0 @@ -!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((n="undefined"!=typeof globalThis?globalThis:n||self).MotionUtils={})}(this,function(n){"use strict";function t(n,t){-1===n.indexOf(t)&&n.push(t)}function e(n,t){const e=n.indexOf(t);e>-1&&n.splice(e,1)}const i=(n,t,e)=>e>t?t:e{},n.invariant=()=>{},"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(n.warning=(n,t,e)=>{n||"undefined"==typeof console||console.warn(s(t,e))},n.invariant=(n,t,e)=>{if(!n)throw new Error(s(t,e))});const o=n=>n;const r=new Set;const c=(n,t,e)=>{const i=t-n;return((e-n)%i+i)%i+n},a=(n,t,e)=>(((1-3*e+3*t)*n+(3*e-6*t))*n+3*t)*n;function u(n,t,e,i){if(n===t&&e===i)return o;const s=t=>function(n,t,e,i,s){let o,r,c=0;do{r=t+(e-t)/2,o=a(r,i,s)-n,o>0?e=r:t=r}while(Math.abs(o)>1e-7&&++c<12);return r}(t,0,1,n,e);return n=>0===n||1===n?n:a(s(n),t,i)}const l=n=>t=>t<=.5?n(2*t)/2:(2-n(2*(1-t)))/2,f=n=>t=>1-n(1-t),p=u(.33,1.53,.69,.99),d=f(p),h=l(d),g=n=>n>=1?1:(n*=2)<1?.5*d(n):.5*(2-Math.pow(2,-10*(n-1))),b=n=>1-Math.sin(Math.acos(n)),m=f(b),y=l(b),v=u(.42,0,1,1),O=u(0,0,.58,1),I=u(.42,0,.58,1);const M=n=>Array.isArray(n)&&"number"!=typeof n[0];const w=n=>Array.isArray(n)&&"number"==typeof n[0],S={linear:o,easeIn:v,easeInOut:I,easeOut:O,circIn:b,circInOut:y,circOut:m,backIn:d,backInOut:h,backOut:p,anticipate:g};n.MotionGlobalConfig={},n.SubscriptionManager=class{constructor(){this.subscriptions=[]}add(n){return t(this.subscriptions,n),()=>e(this.subscriptions,n)}notify(n,t,e){const i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](n,t,e);else for(let s=0;s{if(w(t)){n.invariant(4===t.length,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[e,i,s,o]=t;return u(e,i,s,o)}return"string"==typeof t?(n.invariant(void 0!==S[t],`Invalid easing type '${t}'`,"invalid-easing-type"),S[t]):t},n.getEasingForSegment=function(n,t){return M(n)?n[c(0,n.length,t)]:n},n.hasWarned=function(n){return r.has(n)},n.isBezierDefinition=w,n.isEasingArray=M,n.isNumericalString=n=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(n),n.isObject=n=>"object"==typeof n&&null!==n,n.isZeroValueString=n=>/^0[^.\s]+$/u.test(n),n.memo=function(n){let t;return()=>(void 0===t&&(t=n()),t)},n.millisecondsToSeconds=n=>n/1e3,n.mirrorEasing=l,n.moveItem=function([...n],t,e){const i=t<0?n.length+t:t;if(i>=0&&in.reduce((n,t)=>e=>t(n(e))),n.progress=(n,t,e)=>{const i=t-n;return i?(e-n)/i:1},n.removeItem=e,n.reverseEasing=f,n.secondsToMilliseconds=n=>1e3*n,n.steps=function(n,t="end"){return e=>{const s=(e="end"===t?Math.min(e,.999):Math.max(e,.001))*n,o="end"===t?Math.floor(s):Math.ceil(s);return i(0,1,o/n)}},n.velocityPerSecond=(n,t)=>t?n*(1e3/t):0,n.warnOnce=function(n,t,e){n||r.has(t)||(console.warn(s(t,e)),r.add(t))},n.wrap=c}); diff --git a/node_modules/motion-utils/package.json b/node_modules/motion-utils/package.json deleted file mode 100644 index 2ed6dff..0000000 --- a/node_modules/motion-utils/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "motion-utils", - "version": "13.0.0", - "author": "Matt Perry", - "license": "MIT", - "repository": "https://github.com/motiondivision/motion", - "main": "./dist/cjs/index.js", - "types": "./dist/index.d.ts", - "module": "./dist/es/index.mjs", - "sideEffects": false, - "exports": { - ".": { - "types": "./dist/index.d.ts", - "require": "./dist/cjs/index.js", - "import": "./dist/es/index.mjs", - "default": "./dist/cjs/index.js" - } - }, - "scripts": { - "clean": "rm -rf types dist lib", - "build": "yarn clean && tsc -p . && rollup -c", - "dev": "concurrently -c blue,red -n tsc,rollup --kill-others \"tsc --watch -p . --preserveWatchOutput\" \"rollup --config --watch --no-watch.clearScreen\"", - "test": "jest --config jest.config.json --max-workers=2" - }, - "gitHead": "e4029ce071bddaed2a539b861f5d9c509bea40da" -} diff --git a/node_modules/motion/LICENSE.md b/node_modules/motion/LICENSE.md deleted file mode 100644 index 8111044..0000000 --- a/node_modules/motion/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2024 [Motion](https://motion.dev) B.V. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/motion/README.md b/node_modules/motion/README.md deleted file mode 100644 index e25e148..0000000 --- a/node_modules/motion/README.md +++ /dev/null @@ -1,141 +0,0 @@ -

Motion logo
Motion

-

- An open source animation library
for JavaScript, React and Vue -

- -

- npm version - npm downloads per month - jsDelivr hits (npm) - NPM License - MotionScore grade -

- -```bash -# React / JavaScript -npm install motion - -# Vue -npm install motion-v -``` - -## Table of Contents - -1. [Why Motion?](#why-motion) -2. [🍦 Platforms](#-platforms) -3. [🎓 Examples](#-examples) -4. [⚡️ Motion+](#-motion) -5. [👩🏻‍⚖️ License](#-license) -6. [💎 Contribute](#-contribute) -7. [✨ Sponsors](#-sponsors) - -## Why Motion? - -- **Simple API:** First-class React, JavaScript, and Vue packages. -- **Hybrid engine:** Power of JavaScript combined with native browser APIs for 120fps, GPU-accelerated animations. -- **Production-ready:** TypeScript, extensive test suite, tree-shakable, tiny footprint. - **Batteries included:** Gestures, springs, layout transitions, scroll-linked effects, timelines. - -## 🍦 Platforms - -Motion is available for [React](https://motion.dev/docs/react), [JavaScript](https://motion.dev/docs/quick-start) and [Vue](https://motion.dev/docs/vue). - -### React - -```jsx -import { motion } from "motion/react" - -function Component() { - return -} -``` - -Get started with [Motion for React](https://motion.dev/docs/react). - -**Note:** Framer Motion is now Motion. Import from `motion/react` instead of `framer-motion`. - -### JS - -```javascript -import { animate } from "motion" - -animate("#box", { x: 100 }) -``` - -Get started with [JavaScript](https://motion.dev/docs/quick-start). - -### Vue - -```html - - - -``` - -Get started with [Motion for Vue](https://motion.dev/docs/vue). - -## 🎓 Examples & tutorials - -Browse 330+ [official examples](https://motion.dev/examples), with copy-paste code that'll level-up your animations whether you're a beginner or an expert. - -Over 100 examples come with a full step-by-step [tutorial](https://motion.dev/tutorials). - -## ⚡️ Motion+ - -A one-time payment, lifetime-updates membership: - -- **330+ examples** -- **100+ tutorials** -- **Premium APIs** like [Cursor](https://motion.dev/docs/cursor) and [Ticker](https://motion.dev/docs/react-ticker) -- **Transition editor** for Cursor and VS Code -- **AI skills** -- **Private Discord** -- **Early access content** - -[Get Motion+](https://motion.dev/plus) - -## 👩🏻‍⚖️ License - -- Motion is MIT licensed. - -## 💎 Contribute - -- Want to contribute to Motion? Our [contributing guide](https://github.com/motiondivision/motion/blob/master/CONTRIBUTING.md) has you covered. - -## ✨ Sponsors - -Motion is sustainable thanks to the kind support of its sponsors. - -[Become a sponsor](https://motion.dev/sponsor) - -### Partners - -Motion powers the animations for all websites built with Framer, the web builder for creative pros. The Motion website itself is built on Framer, for its delightful canvas-based editing and powerful CMS features. - - - Framer - - -Motion drives the animations on the Cursor homepage, and is working with Cursor to bring powerful AI workflows to the Motion examples and docs. - - - Cursor - - -### Platinum - -Linear Figma Sanity Sanity Clerk - -### Gold - -### Silver - -Liveblocks Frontend.fyi Firecrawl Bolt.new - -### Personal - -- [OlegWock](https://sinja.io) -- [Lambert Weller](https://github.com/l-mbert) -- [Jake LeBoeuf](https://jklb.wf) diff --git a/node_modules/motion/dist/cjs/debug.js b/node_modules/motion/dist/cjs/debug.js deleted file mode 100644 index c13331a..0000000 --- a/node_modules/motion/dist/cjs/debug.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { value: true }); - -var debug = require('framer-motion/debug'); - - - -Object.keys(debug).forEach(function (k) { - if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { - enumerable: true, - get: function () { return debug[k]; } - }); -}); diff --git a/node_modules/motion/dist/cjs/index.js b/node_modules/motion/dist/cjs/index.js deleted file mode 100644 index c851699..0000000 --- a/node_modules/motion/dist/cjs/index.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { value: true }); - -var dom = require('framer-motion/dom'); - - - -Object.keys(dom).forEach(function (k) { - if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { - enumerable: true, - get: function () { return dom[k]; } - }); -}); diff --git a/node_modules/motion/dist/cjs/mini.js b/node_modules/motion/dist/cjs/mini.js deleted file mode 100644 index d4f10a5..0000000 --- a/node_modules/motion/dist/cjs/mini.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { value: true }); - -var mini = require('framer-motion/dom/mini'); - - - -Object.keys(mini).forEach(function (k) { - if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { - enumerable: true, - get: function () { return mini[k]; } - }); -}); diff --git a/node_modules/motion/dist/cjs/react-client.js b/node_modules/motion/dist/cjs/react-client.js deleted file mode 100644 index 6f8722f..0000000 --- a/node_modules/motion/dist/cjs/react-client.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { value: true }); - -var client = require('framer-motion/client'); - - - -Object.keys(client).forEach(function (k) { - if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { - enumerable: true, - get: function () { return client[k]; } - }); -}); diff --git a/node_modules/motion/dist/cjs/react-m.js b/node_modules/motion/dist/cjs/react-m.js deleted file mode 100644 index 69f738a..0000000 --- a/node_modules/motion/dist/cjs/react-m.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { value: true }); - -var m = require('framer-motion/m'); - - - -Object.keys(m).forEach(function (k) { - if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { - enumerable: true, - get: function () { return m[k]; } - }); -}); diff --git a/node_modules/motion/dist/cjs/react-mini.js b/node_modules/motion/dist/cjs/react-mini.js deleted file mode 100644 index 7c137c9..0000000 --- a/node_modules/motion/dist/cjs/react-mini.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { value: true }); - -var mini = require('framer-motion/mini'); - - - -Object.keys(mini).forEach(function (k) { - if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { - enumerable: true, - get: function () { return mini[k]; } - }); -}); diff --git a/node_modules/motion/dist/cjs/react.js b/node_modules/motion/dist/cjs/react.js deleted file mode 100644 index 9743a9c..0000000 --- a/node_modules/motion/dist/cjs/react.js +++ /dev/null @@ -1,46 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { value: true }); - -var fm = require('framer-motion'); - -function _interopNamespaceDefault(e) { - var n = Object.create(null); - if (e) { - Object.keys(e).forEach(function (k) { - if (k !== 'default') { - var d = Object.getOwnPropertyDescriptor(e, k); - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: function () { return e[k]; } - }); - } - }); - } - n.default = e; - return Object.freeze(n); -} - -var fm__namespace = /*#__PURE__*/_interopNamespaceDefault(fm); - -// Re-export everything from framer-motion. -// -// `motion` and `m` are aliased through local bindings so the module has -// explicit named exports for IDE auto-import (see #3432). The previous -// `export { motion, m } from "framer-motion"` line — sitting alongside -// `export * from "framer-motion"` — was a duplicate-source re-export pattern -// that caused Next.js Turbopack to OOM during module-graph analysis (#3741). -// Local declarations shadow the wildcard re-export per the ES spec, so -// `motion` and `m` come from the explicit bindings below and the rest from -// `export *`. -const motion = fm__namespace.motion; -const m = fm__namespace.m; - -exports.m = m; -exports.motion = motion; -Object.keys(fm).forEach(function (k) { - if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { - enumerable: true, - get: function () { return fm[k]; } - }); -}); diff --git a/node_modules/motion/dist/debug.d.ts b/node_modules/motion/dist/debug.d.ts deleted file mode 100644 index 8c55be2..0000000 --- a/node_modules/motion/dist/debug.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from 'framer-motion/debug'; diff --git a/node_modules/motion/dist/es/debug.mjs b/node_modules/motion/dist/es/debug.mjs deleted file mode 100644 index 8c55be2..0000000 --- a/node_modules/motion/dist/es/debug.mjs +++ /dev/null @@ -1 +0,0 @@ -export * from 'framer-motion/debug'; diff --git a/node_modules/motion/dist/es/index.mjs b/node_modules/motion/dist/es/index.mjs deleted file mode 100644 index 6bcc19b..0000000 --- a/node_modules/motion/dist/es/index.mjs +++ /dev/null @@ -1 +0,0 @@ -export * from 'framer-motion/dom'; diff --git a/node_modules/motion/dist/es/mini.mjs b/node_modules/motion/dist/es/mini.mjs deleted file mode 100644 index 8c6de40..0000000 --- a/node_modules/motion/dist/es/mini.mjs +++ /dev/null @@ -1 +0,0 @@ -export * from 'framer-motion/dom/mini'; diff --git a/node_modules/motion/dist/es/react-client.mjs b/node_modules/motion/dist/es/react-client.mjs deleted file mode 100644 index dd39a72..0000000 --- a/node_modules/motion/dist/es/react-client.mjs +++ /dev/null @@ -1 +0,0 @@ -export * from 'framer-motion/client'; diff --git a/node_modules/motion/dist/es/react-m.mjs b/node_modules/motion/dist/es/react-m.mjs deleted file mode 100644 index c7ed1b1..0000000 --- a/node_modules/motion/dist/es/react-m.mjs +++ /dev/null @@ -1 +0,0 @@ -export * from 'framer-motion/m'; diff --git a/node_modules/motion/dist/es/react-mini.mjs b/node_modules/motion/dist/es/react-mini.mjs deleted file mode 100644 index ef5bdae..0000000 --- a/node_modules/motion/dist/es/react-mini.mjs +++ /dev/null @@ -1 +0,0 @@ -export * from 'framer-motion/mini'; diff --git a/node_modules/motion/dist/es/react.mjs b/node_modules/motion/dist/es/react.mjs deleted file mode 100644 index 8d67cfa..0000000 --- a/node_modules/motion/dist/es/react.mjs +++ /dev/null @@ -1,17 +0,0 @@ -import * as fm from 'framer-motion'; -export * from 'framer-motion'; - -// Re-export everything from framer-motion. -// -// `motion` and `m` are aliased through local bindings so the module has -// explicit named exports for IDE auto-import (see #3432). The previous -// `export { motion, m } from "framer-motion"` line — sitting alongside -// `export * from "framer-motion"` — was a duplicate-source re-export pattern -// that caused Next.js Turbopack to OOM during module-graph analysis (#3741). -// Local declarations shadow the wildcard re-export per the ES spec, so -// `motion` and `m` come from the explicit bindings below and the rest from -// `export *`. -const motion = fm.motion; -const m = fm.m; - -export { m, motion }; diff --git a/node_modules/motion/dist/index.d.ts b/node_modules/motion/dist/index.d.ts deleted file mode 100644 index 6bcc19b..0000000 --- a/node_modules/motion/dist/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from 'framer-motion/dom'; diff --git a/node_modules/motion/dist/mini.d.ts b/node_modules/motion/dist/mini.d.ts deleted file mode 100644 index 8c6de40..0000000 --- a/node_modules/motion/dist/mini.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from 'framer-motion/dom/mini'; diff --git a/node_modules/motion/dist/motion.dev.js b/node_modules/motion/dist/motion.dev.js deleted file mode 100644 index e1d038d..0000000 --- a/node_modules/motion/dist/motion.dev.js +++ /dev/null @@ -1,12706 +0,0 @@ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : - typeof define === 'function' && define.amd ? define(['exports'], factory) : - (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Motion = {})); -})(this, (function (exports) { 'use strict'; - - function addUniqueItem(arr, item) { - if (arr.indexOf(item) === -1) - arr.push(item); - } - function removeItem(arr, item) { - const index = arr.indexOf(item); - if (index > -1) - arr.splice(index, 1); - } - // Adapted from array-move - function moveItem([...arr], fromIndex, toIndex) { - const startIndex = fromIndex < 0 ? arr.length + fromIndex : fromIndex; - if (startIndex >= 0 && startIndex < arr.length) { - const endIndex = toIndex < 0 ? arr.length + toIndex : toIndex; - const [item] = arr.splice(fromIndex, 1); - arr.splice(endIndex, 0, item); - } - return arr; - } - - const clamp = (min, max, v) => { - if (v > max) - return max; - if (v < min) - return min; - return v; - }; - - function formatErrorMessage(message, errorCode) { - return errorCode - ? `${message}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${errorCode}` - : message; - } - - exports.warning = () => { }; - exports.invariant = () => { }; - if (typeof process !== "undefined" && - process.env?.NODE_ENV !== "production") { - exports.warning = (check, message, errorCode) => { - if (!check && typeof console !== "undefined") { - console.warn(formatErrorMessage(message, errorCode)); - } - }; - exports.invariant = (check, message, errorCode) => { - if (!check) { - throw new Error(formatErrorMessage(message, errorCode)); - } - }; - } - - const MotionGlobalConfig = {}; - - /** - * Check if value is a numerical string, ie a string that is purely a number eg "100" or "-100.1" - */ - const isNumericalString = (v) => /^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(v); - - const isObject = (value) => typeof value === "object" && value !== null; - - /** - * Check if the value is a zero value string like "0px" or "0%" - */ - const isZeroValueString = (v) => /^0[^.\s]+$/u.test(v); - - /*#__NO_SIDE_EFFECTS__*/ - function memo(callback) { - let result; - return () => { - if (result === undefined) - result = callback(); - return result; - }; - } - - /*#__NO_SIDE_EFFECTS__*/ - const noop = (any) => any; - - /** - * Pipe - * Compose other transformers to run linearily - * pipe(min(20), max(40)) - * @param {...functions} transformers - * @return {function} - */ - const pipe = (...transformers) => transformers.reduce((a, b) => (v) => b(a(v))); - - /* - Progress within given range - - Given a lower limit and an upper limit, we return the progress - (expressed as a number 0-1) represented by the given value, and - limit that progress to within 0-1. - */ - /*#__NO_SIDE_EFFECTS__*/ - const progress = (from, to, value) => { - const range = to - from; - return range ? (value - from) / range : 1; - }; - - class SubscriptionManager { - constructor() { - this.subscriptions = []; - } - add(handler) { - addUniqueItem(this.subscriptions, handler); - return () => removeItem(this.subscriptions, handler); - } - notify(a, b, c) { - const numSubscriptions = this.subscriptions.length; - if (!numSubscriptions) - return; - if (numSubscriptions === 1) { - /** - * If there's only a single handler we can just call it without invoking a loop. - */ - this.subscriptions[0](a, b, c); - } - else { - for (let i = 0; i < numSubscriptions; i++) { - /** - * Check whether the handler exists before firing as it's possible - * the subscriptions were modified during this loop running. - */ - const handler = this.subscriptions[i]; - handler && handler(a, b, c); - } - } - } - getSize() { - return this.subscriptions.length; - } - clear() { - this.subscriptions.length = 0; - } - } - - /** - * Converts seconds to milliseconds - * - * @param seconds - Time in seconds. - * @return milliseconds - Converted time in milliseconds. - */ - /*#__NO_SIDE_EFFECTS__*/ - const secondsToMilliseconds = (seconds) => seconds * 1000; - /*#__NO_SIDE_EFFECTS__*/ - const millisecondsToSeconds = (milliseconds) => milliseconds / 1000; - - /* - Convert velocity into velocity per second - */ - /*#__NO_SIDE_EFFECTS__*/ - const velocityPerSecond = (velocity, frameDuration) => frameDuration ? velocity * (1000 / frameDuration) : 0; - - const warned = new Set(); - function hasWarned(message) { - return warned.has(message); - } - function warnOnce(condition, message, errorCode) { - if (condition || warned.has(message)) - return; - console.warn(formatErrorMessage(message, errorCode)); - warned.add(message); - } - - const wrap = (min, max, v) => { - const rangeSize = max - min; - return ((((v - min) % rangeSize) + rangeSize) % rangeSize) + min; - }; - - /* - Bezier function generator - This has been modified from Gaëtan Renaudeau's BezierEasing - https://github.com/gre/bezier-easing/blob/master/src/index.js - https://github.com/gre/bezier-easing/blob/master/LICENSE - - I've removed the newtonRaphsonIterate algo because in benchmarking it - wasn't noticeably faster than binarySubdivision, indeed removing it - usually improved times, depending on the curve. - I also removed the lookup table, as for the added bundle size and loop we're - only cutting ~4 or so subdivision iterations. I bumped the max iterations up - to 12 to compensate and this still tended to be faster for no perceivable - loss in accuracy. - Usage - const easeOut = cubicBezier(.17,.67,.83,.67); - const x = easeOut(0.5); // returns 0.627... - */ - // Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2. - const calcBezier = (t, a1, a2) => (((1.0 - 3.0 * a2 + 3.0 * a1) * t + (3.0 * a2 - 6.0 * a1)) * t + 3.0 * a1) * - t; - const subdivisionPrecision = 0.0000001; - const subdivisionMaxIterations = 12; - function binarySubdivide(x, lowerBound, upperBound, mX1, mX2) { - let currentX; - let currentT; - let i = 0; - do { - currentT = lowerBound + (upperBound - lowerBound) / 2.0; - currentX = calcBezier(currentT, mX1, mX2) - x; - if (currentX > 0.0) { - upperBound = currentT; - } - else { - lowerBound = currentT; - } - } while (Math.abs(currentX) > subdivisionPrecision && - ++i < subdivisionMaxIterations); - return currentT; - } - /*#__NO_SIDE_EFFECTS__*/ - function cubicBezier(mX1, mY1, mX2, mY2) { - // If this is a linear gradient, return linear easing - if (mX1 === mY1 && mX2 === mY2) - return noop; - const getTForX = (aX) => binarySubdivide(aX, 0, 1, mX1, mX2); - // If animation is at start/end, return t without easing - return (t) => t === 0 || t === 1 ? t : calcBezier(getTForX(t), mY1, mY2); - } - - // Accepts an easing function and returns a new one that outputs mirrored values for - // the second half of the animation. Turns easeIn into easeInOut. - /*#__NO_SIDE_EFFECTS__*/ - const mirrorEasing = (easing) => (p) => p <= 0.5 ? easing(2 * p) / 2 : (2 - easing(2 * (1 - p))) / 2; - - // Accepts an easing function and returns a new one that outputs reversed values. - // Turns easeIn into easeOut. - /*#__NO_SIDE_EFFECTS__*/ - const reverseEasing = (easing) => (p) => 1 - easing(1 - p); - - const backOut = /*@__PURE__*/ cubicBezier(0.33, 1.53, 0.69, 0.99); - const backIn = /*@__PURE__*/ reverseEasing(backOut); - const backInOut = /*@__PURE__*/ mirrorEasing(backIn); - - const anticipate = (p) => p >= 1 - ? 1 - : (p *= 2) < 1 - ? 0.5 * backIn(p) - : 0.5 * (2 - Math.pow(2, -10 * (p - 1))); - - const circIn = (p) => 1 - Math.sin(Math.acos(p)); - const circOut = reverseEasing(circIn); - const circInOut = mirrorEasing(circIn); - - const easeIn = /*@__PURE__*/ cubicBezier(0.42, 0, 1, 1); - const easeOut = /*@__PURE__*/ cubicBezier(0, 0, 0.58, 1); - const easeInOut = /*@__PURE__*/ cubicBezier(0.42, 0, 0.58, 1); - - /*#__NO_SIDE_EFFECTS__*/ - function steps(numSteps, direction = "end") { - return (progress) => { - progress = - direction === "end" - ? Math.min(progress, 0.999) - : Math.max(progress, 0.001); - const expanded = progress * numSteps; - const rounded = direction === "end" ? Math.floor(expanded) : Math.ceil(expanded); - return clamp(0, 1, rounded / numSteps); - }; - } - - /*#__NO_SIDE_EFFECTS__*/ - const isEasingArray = (ease) => { - return Array.isArray(ease) && typeof ease[0] !== "number"; - }; - - /*#__NO_SIDE_EFFECTS__*/ - function getEasingForSegment(easing, i) { - return isEasingArray(easing) ? easing[wrap(0, easing.length, i)] : easing; - } - - /*#__NO_SIDE_EFFECTS__*/ - const isBezierDefinition = (easing) => Array.isArray(easing) && typeof easing[0] === "number"; - - const easingLookup = { - linear: noop, - easeIn, - easeInOut, - easeOut, - circIn, - circInOut, - circOut, - backIn, - backInOut, - backOut, - anticipate, - }; - const isValidEasing = (easing) => { - return typeof easing === "string"; - }; - const easingDefinitionToFunction = (definition) => { - if (isBezierDefinition(definition)) { - // If cubic bezier definition, create bezier curve - exports.invariant(definition.length === 4, `Cubic bezier arrays must contain four numerical values.`, "cubic-bezier-length"); - const [x1, y1, x2, y2] = definition; - return cubicBezier(x1, y1, x2, y2); - } - else if (isValidEasing(definition)) { - // Else lookup from table - exports.invariant(easingLookup[definition] !== undefined, `Invalid easing type '${definition}'`, "invalid-easing-type"); - return easingLookup[definition]; - } - return definition; - }; - - const stepsOrder = [ - "setup", // Compute - "read", // Read - "resolveKeyframes", // Write/Read/Write/Read - "preUpdate", // Compute - "update", // Compute - "preRender", // Compute - "render", // Write - "postRender", // Compute - ]; - - function createRenderStep(runNextFrame) { - /** - * We create and reuse two queues, one to queue jobs for the current frame - * and one for the next. We reuse to avoid triggering GC after x frames. - */ - let thisFrame = new Set(); - let nextFrame = new Set(); - /** - * Track whether we're currently processing jobs in this step. This way - * we can decide whether to schedule new jobs for this frame or next. - */ - let isProcessing = false; - let flushNextFrame = false; - /** - * A set of processes which were marked keepAlive when scheduled. - */ - const toKeepAlive = new WeakSet(); - let latestFrameData = { - delta: 0.0, - timestamp: 0.0, - isProcessing: false, - }; - function triggerCallback(callback) { - if (toKeepAlive.has(callback)) { - step.schedule(callback); - runNextFrame(); - } - callback(latestFrameData); - } - const step = { - /** - * Schedule a process to run on the next frame. - */ - schedule: (callback, keepAlive = false, immediate = false) => { - const addToCurrentFrame = immediate && isProcessing; - const queue = addToCurrentFrame ? thisFrame : nextFrame; - if (keepAlive) - toKeepAlive.add(callback); - queue.add(callback); - return callback; - }, - /** - * Cancel the provided callback from running on the next frame. - */ - cancel: (callback) => { - nextFrame.delete(callback); - toKeepAlive.delete(callback); - }, - /** - * Execute all schedule callbacks. - */ - process: (frameData) => { - latestFrameData = frameData; - /** - * If we're already processing we've probably been triggered by a flushSync - * inside an existing process. Instead of executing, mark flushNextFrame - * as true and ensure we flush the following frame at the end of this one. - */ - if (isProcessing) { - flushNextFrame = true; - return; - } - isProcessing = true; - // Swap this frame and the next to avoid GC - const prevFrame = thisFrame; - thisFrame = nextFrame; - nextFrame = prevFrame; - // Execute this frame - thisFrame.forEach(triggerCallback); - // Clear the frame so no callbacks remain. This is to avoid - // memory leaks should this render step not run for a while. - thisFrame.clear(); - isProcessing = false; - if (flushNextFrame) { - flushNextFrame = false; - step.process(frameData); - } - }, - }; - return step; - } - - const maxElapsed$1 = 40; - function createRenderBatcher(scheduleNextBatch, allowKeepAlive) { - let runNextFrame = false; - let useDefaultElapsed = true; - const state = { - delta: 0.0, - timestamp: 0.0, - isProcessing: false, - }; - const flagRunNextFrame = () => (runNextFrame = true); - const steps = stepsOrder.reduce((acc, key) => { - acc[key] = createRenderStep(flagRunNextFrame); - return acc; - }, {}); - const { setup, read, resolveKeyframes, preUpdate, update, preRender, render, postRender, } = steps; - const processBatch = () => { - const useManualTiming = MotionGlobalConfig.useManualTiming; - const timestamp = useManualTiming - ? state.timestamp - : performance.now(); - runNextFrame = false; - if (!useManualTiming) { - state.delta = useDefaultElapsed - ? 1000 / 60 - : Math.max(Math.min(timestamp - state.timestamp, maxElapsed$1), 1); - } - state.timestamp = timestamp; - state.isProcessing = true; - // Unrolled render loop for better per-frame performance - setup.process(state); - read.process(state); - resolveKeyframes.process(state); - preUpdate.process(state); - update.process(state); - preRender.process(state); - render.process(state); - postRender.process(state); - state.isProcessing = false; - if (runNextFrame && allowKeepAlive) { - useDefaultElapsed = false; - scheduleNextBatch(processBatch); - } - }; - const wake = () => { - runNextFrame = true; - useDefaultElapsed = true; - if (!state.isProcessing) { - scheduleNextBatch(processBatch); - } - }; - const schedule = stepsOrder.reduce((acc, key) => { - const step = steps[key]; - acc[key] = (process, keepAlive = false, immediate = false) => { - if (!runNextFrame) - wake(); - return step.schedule(process, keepAlive, immediate); - }; - return acc; - }, {}); - const cancel = (process) => { - for (let i = 0; i < stepsOrder.length; i++) { - steps[stepsOrder[i]].cancel(process); - } - }; - return { schedule, cancel, state, steps }; - } - - const { schedule: frame, cancel: cancelFrame, state: frameData, steps: frameSteps, } = /* @__PURE__ */ createRenderBatcher(typeof requestAnimationFrame !== "undefined" ? requestAnimationFrame : noop, true); - - let now; - function clearTime() { - now = undefined; - } - /** - * An eventloop-synchronous alternative to performance.now(). - * - * Ensures that time measurements remain consistent within a synchronous context. - * Usually calling performance.now() twice within the same synchronous context - * will return different values which isn't useful for animations when we're usually - * trying to sync animations to the same frame. - */ - const time = { - now: () => { - if (now === undefined) { - time.set(frameData.isProcessing || MotionGlobalConfig.useManualTiming - ? frameData.timestamp - : performance.now()); - } - return now; - }, - set: (newTime) => { - now = newTime; - queueMicrotask(clearTime); - }, - }; - - const checkStringStartsWith = (token) => (key) => typeof key === "string" && key.startsWith(token); - const isCSSVariableName = - /*@__PURE__*/ checkStringStartsWith("--"); - const startsAsVariableToken = - /*@__PURE__*/ checkStringStartsWith("var(--"); - const isCSSVariableToken = (value) => { - const startsWithToken = startsAsVariableToken(value); - if (!startsWithToken) - return false; - // Ensure any comments are stripped from the value as this can harm performance of the regex. - return singleCssVariableRegex.test(value.split("/*")[0].trim()); - }; - const singleCssVariableRegex = /var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu; - /** - * Check if a value contains a CSS variable anywhere (e.g. inside calc()). - * Unlike isCSSVariableToken which checks if the value IS a var() token, - * this checks if the value CONTAINS var() somewhere in the string. - */ - function containsCSSVariable(value) { - if (typeof value !== "string") - return false; - // Strip comments to avoid false positives - return value.split("/*")[0].includes("var(--"); - } - - const number = { - test: (v) => typeof v === "number", - parse: parseFloat, - transform: (v) => v, - }; - const alpha = { - ...number, - transform: (v) => clamp(0, 1, v), - }; - const scale = { - ...number, - default: 1, - }; - - // If this number is a decimal, make it just five decimal places - // to avoid exponents - const sanitize = (v) => Math.round(v * 100000) / 100000; - - const floatRegex = /-?(?:\d+(?:\.\d+)?|\.\d+)/gu; - - function isNullish(v) { - return v == null; - } - - const singleColorRegex = /^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu; - - /** - * Returns true if the provided string is a color, ie rgba(0,0,0,0) or #000, - * but false if a number or multiple colors - */ - const isColorString = (type, testProp) => (v) => { - return Boolean((typeof v === "string" && - singleColorRegex.test(v) && - v.startsWith(type)) || - (testProp && - !isNullish(v) && - Object.prototype.hasOwnProperty.call(v, testProp))); - }; - const splitColor = (aName, bName, cName) => (v) => { - if (typeof v !== "string") - return v; - const [a, b, c, alpha] = v.match(floatRegex); - return { - [aName]: parseFloat(a), - [bName]: parseFloat(b), - [cName]: parseFloat(c), - alpha: alpha !== undefined ? parseFloat(alpha) : 1, - }; - }; - - const clampRgbUnit = (v) => clamp(0, 255, v); - const rgbUnit = { - ...number, - transform: (v) => Math.round(clampRgbUnit(v)), - }; - const rgba = { - test: /*@__PURE__*/ isColorString("rgb", "red"), - parse: /*@__PURE__*/ splitColor("red", "green", "blue"), - transform: ({ red, green, blue, alpha: alpha$1 = 1 }) => "rgba(" + - rgbUnit.transform(red) + - ", " + - rgbUnit.transform(green) + - ", " + - rgbUnit.transform(blue) + - ", " + - sanitize(alpha.transform(alpha$1)) + - ")", - }; - - function parseHex(v) { - let r = ""; - let g = ""; - let b = ""; - let a = ""; - // If we have 6 characters, ie #FF0000 - if (v.length > 5) { - r = v.substring(1, 3); - g = v.substring(3, 5); - b = v.substring(5, 7); - a = v.substring(7, 9); - // Or we have 3 characters, ie #F00 - } - else { - r = v.substring(1, 2); - g = v.substring(2, 3); - b = v.substring(3, 4); - a = v.substring(4, 5); - r += r; - g += g; - b += b; - a += a; - } - return { - red: parseInt(r, 16), - green: parseInt(g, 16), - blue: parseInt(b, 16), - alpha: a ? parseInt(a, 16) / 255 : 1, - }; - } - const hex = { - test: /*@__PURE__*/ isColorString("#"), - parse: parseHex, - transform: rgba.transform, - }; - - /*#__NO_SIDE_EFFECTS__*/ - const createUnitType = (unit) => ({ - test: (v) => typeof v === "string" && v.endsWith(unit) && v.split(" ").length === 1, - parse: parseFloat, - transform: (v) => `${v}${unit}`, - }); - const degrees = /*@__PURE__*/ createUnitType("deg"); - const percent = /*@__PURE__*/ createUnitType("%"); - const px = /*@__PURE__*/ createUnitType("px"); - const vh = /*@__PURE__*/ createUnitType("vh"); - const vw = /*@__PURE__*/ createUnitType("vw"); - const progressPercentage = /*@__PURE__*/ (() => ({ - ...percent, - parse: (v) => percent.parse(v) / 100, - transform: (v) => percent.transform(v * 100), - }))(); - - const hsla = { - test: /*@__PURE__*/ isColorString("hsl", "hue"), - parse: /*@__PURE__*/ splitColor("hue", "saturation", "lightness"), - transform: ({ hue, saturation, lightness, alpha: alpha$1 = 1 }) => { - return ("hsla(" + - Math.round(hue) + - ", " + - percent.transform(sanitize(saturation)) + - ", " + - percent.transform(sanitize(lightness)) + - ", " + - sanitize(alpha.transform(alpha$1)) + - ")"); - }, - }; - - const color = { - test: (v) => rgba.test(v) || hex.test(v) || hsla.test(v), - parse: (v) => { - if (rgba.test(v)) { - return rgba.parse(v); - } - else if (hsla.test(v)) { - return hsla.parse(v); - } - else { - return hex.parse(v); - } - }, - transform: (v) => { - return typeof v === "string" - ? v - : v.hasOwnProperty("red") - ? rgba.transform(v) - : hsla.transform(v); - }, - getAnimatableNone: (v) => { - const parsed = color.parse(v); - parsed.alpha = 0; - return color.transform(parsed); - }, - }; - - const colorRegex = /(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu; - - function test(v) { - return (isNaN(v) && - typeof v === "string" && - (v.match(floatRegex)?.length || 0) + - (v.match(colorRegex)?.length || 0) > - 0); - } - const NUMBER_TOKEN = "number"; - const COLOR_TOKEN = "color"; - const VAR_TOKEN = "var"; - const VAR_FUNCTION_TOKEN = "var("; - const SPLIT_TOKEN = "${}"; - // this regex consists of the `singleCssVariableRegex|rgbHSLValueRegex|digitRegex` - const complexRegex = /var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu; - function analyseComplexValue(value) { - const originalValue = value.toString(); - const values = []; - const indexes = { - color: [], - number: [], - var: [], - }; - const types = []; - let i = 0; - const tokenised = originalValue.replace(complexRegex, (parsedValue) => { - if (color.test(parsedValue)) { - indexes.color.push(i); - types.push(COLOR_TOKEN); - values.push(color.parse(parsedValue)); - } - else if (parsedValue.startsWith(VAR_FUNCTION_TOKEN)) { - indexes.var.push(i); - types.push(VAR_TOKEN); - values.push(parsedValue); - } - else { - indexes.number.push(i); - types.push(NUMBER_TOKEN); - values.push(parseFloat(parsedValue)); - } - ++i; - return SPLIT_TOKEN; - }); - const split = tokenised.split(SPLIT_TOKEN); - return { values, split, indexes, types }; - } - function parseComplexValue(v) { - return analyseComplexValue(v).values; - } - function buildTransformer({ split, types }) { - const numSections = split.length; - return (v) => { - let output = ""; - for (let i = 0; i < numSections; i++) { - output += split[i]; - if (v[i] !== undefined) { - const type = types[i]; - if (type === NUMBER_TOKEN) { - output += sanitize(v[i]); - } - else if (type === COLOR_TOKEN) { - output += color.transform(v[i]); - } - else { - output += v[i]; - } - } - } - return output; - }; - } - function createTransformer(source) { - return buildTransformer(analyseComplexValue(source)); - } - const convertNumbersToZero = (v) => typeof v === "number" ? 0 : color.test(v) ? color.getAnimatableNone(v) : v; - /** - * Convert a parsed value to its zero equivalent, but preserve numbers - * that act as divisors in CSS calc() expressions. - * - * analyseComplexValue extracts numbers from CSS strings and puts the - * surrounding text into a `split` template array. For example: - * "calc(var(--gap) / 5)" → values: [var(--gap), 5] - * split: ["calc(", " / ", ")"] - * - * When building a zero-equivalent for animation, naively zeroing all - * numbers turns the divisor into 0 → "calc(var(--gap) / 0)" → NaN. - * We detect this by checking whether the text preceding a number - * (split[i]) ends with "/" — the CSS calc division operator. - */ - const convertToZero = (value, splitBefore) => { - if (typeof value === "number") { - return splitBefore?.trim().endsWith("/") ? value : 0; - } - return convertNumbersToZero(value); - }; - function getAnimatableNone$1(v) { - const info = analyseComplexValue(v); - const transformer = buildTransformer(info); - return transformer(info.values.map((value, i) => convertToZero(value, info.split[i]))); - } - const complex = { - test, - parse: parseComplexValue, - createTransformer, - getAnimatableNone: getAnimatableNone$1, - }; - - // Adapted from https://gist.github.com/mjackson/5311256 - function hueToRgb(p, q, t) { - if (t < 0) - t += 1; - if (t > 1) - t -= 1; - if (t < 1 / 6) - return p + (q - p) * 6 * t; - if (t < 1 / 2) - return q; - if (t < 2 / 3) - return p + (q - p) * (2 / 3 - t) * 6; - return p; - } - function hslaToRgba({ hue, saturation, lightness, alpha }) { - hue /= 360; - saturation /= 100; - lightness /= 100; - let red = 0; - let green = 0; - let blue = 0; - if (!saturation) { - red = green = blue = lightness; - } - else { - const q = lightness < 0.5 - ? lightness * (1 + saturation) - : lightness + saturation - lightness * saturation; - const p = 2 * lightness - q; - red = hueToRgb(p, q, hue + 1 / 3); - green = hueToRgb(p, q, hue); - blue = hueToRgb(p, q, hue - 1 / 3); - } - return { - red: Math.round(red * 255), - green: Math.round(green * 255), - blue: Math.round(blue * 255), - alpha, - }; - } - - function mixImmediate(a, b) { - return (p) => (p > 0 ? b : a); - } - - /* - Value in range from progress - - Given a lower limit and an upper limit, we return the value within - that range as expressed by progress (usually a number from 0 to 1) - - So progress = 0.5 would change - - from -------- to - - to - - from ---- to - - E.g. from = 10, to = 20, progress = 0.5 => 15 - - @param [number]: Lower limit of range - @param [number]: Upper limit of range - @param [number]: The progress between lower and upper limits expressed 0-1 - @return [number]: Value as calculated from progress within range (not limited within range) - */ - const mixNumber$1 = (from, to, progress) => { - return from + (to - from) * progress; - }; - - // Linear color space blending - // Explained https://www.youtube.com/watch?v=LKnqECcg6Gw - // Demonstrated http://codepen.io/osublake/pen/xGVVaN - const mixLinearColor = (from, to, v) => { - const fromExpo = from * from; - const expo = v * (to * to - fromExpo) + fromExpo; - return expo < 0 ? 0 : Math.sqrt(expo); - }; - const colorTypes = [hex, rgba, hsla]; - const getColorType = (v) => colorTypes.find((type) => type.test(v)); - function asRGBA(color) { - const type = getColorType(color); - exports.warning(Boolean(type), `'${color}' is not an animatable color. Use the equivalent color code instead.`, "color-not-animatable"); - if (!Boolean(type)) - return false; - let model = type.parse(color); - if (type === hsla) { - // TODO Remove this cast - needed since Motion's stricter typing - model = hslaToRgba(model); - } - return model; - } - const mixColor = (from, to) => { - const fromRGBA = asRGBA(from); - const toRGBA = asRGBA(to); - if (!fromRGBA || !toRGBA) { - return mixImmediate(from, to); - } - const blended = { ...fromRGBA }; - return (v) => { - blended.red = mixLinearColor(fromRGBA.red, toRGBA.red, v); - blended.green = mixLinearColor(fromRGBA.green, toRGBA.green, v); - blended.blue = mixLinearColor(fromRGBA.blue, toRGBA.blue, v); - blended.alpha = mixNumber$1(fromRGBA.alpha, toRGBA.alpha, v); - return rgba.transform(blended); - }; - }; - - const invisibleValues = new Set(["none", "hidden"]); - /** - * Returns a function that, when provided a progress value between 0 and 1, - * will return the "none" or "hidden" string only when the progress is that of - * the origin or target. - */ - function mixVisibility(origin, target) { - if (invisibleValues.has(origin)) { - return (p) => (p <= 0 ? origin : target); - } - else { - return (p) => (p >= 1 ? target : origin); - } - } - - function mixNumber(a, b) { - return (p) => mixNumber$1(a, b, p); - } - function getMixer(a) { - if (typeof a === "number") { - return mixNumber; - } - else if (typeof a === "string") { - return isCSSVariableToken(a) - ? mixImmediate - : color.test(a) - ? mixColor - : mixComplex; - } - else if (Array.isArray(a)) { - return mixArray; - } - else if (typeof a === "object") { - return color.test(a) ? mixColor : mixObject; - } - return mixImmediate; - } - function mixArray(a, b) { - const output = [...a]; - const numValues = output.length; - const blendValue = a.map((v, i) => getMixer(v)(v, b[i])); - return (p) => { - for (let i = 0; i < numValues; i++) { - output[i] = blendValue[i](p); - } - return output; - }; - } - function mixObject(a, b) { - const output = { ...a, ...b }; - const blendValue = {}; - for (const key in output) { - if (a[key] !== undefined && b[key] !== undefined) { - blendValue[key] = getMixer(a[key])(a[key], b[key]); - } - } - return (v) => { - for (const key in blendValue) { - output[key] = blendValue[key](v); - } - return output; - }; - } - function matchOrder(origin, target) { - const orderedOrigin = []; - const pointers = { color: 0, var: 0, number: 0 }; - for (let i = 0; i < target.values.length; i++) { - const type = target.types[i]; - const originIndex = origin.indexes[type][pointers[type]]; - const originValue = origin.values[originIndex] ?? 0; - orderedOrigin[i] = originValue; - pointers[type]++; - } - return orderedOrigin; - } - const mixComplex = (origin, target) => { - const template = complex.createTransformer(target); - const originStats = analyseComplexValue(origin); - const targetStats = analyseComplexValue(target); - const canInterpolate = originStats.indexes.var.length === targetStats.indexes.var.length && - originStats.indexes.color.length === targetStats.indexes.color.length && - originStats.indexes.number.length >= targetStats.indexes.number.length; - if (canInterpolate) { - if ((invisibleValues.has(origin) && - !targetStats.values.length) || - (invisibleValues.has(target) && - !originStats.values.length)) { - return mixVisibility(origin, target); - } - return pipe(mixArray(matchOrder(originStats, targetStats), targetStats.values), template); - } - else { - exports.warning(true, `Complex values '${origin}' and '${target}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`, "complex-values-different"); - return mixImmediate(origin, target); - } - }; - - function mix(from, to, p) { - if (typeof from === "number" && - typeof to === "number" && - typeof p === "number") { - return mixNumber$1(from, to, p); - } - const mixer = getMixer(from); - return mixer(from, to); - } - - const frameloopDriver = (update) => { - const passTimestamp = ({ timestamp }) => update(timestamp); - return { - start: (keepAlive = true) => frame.update(passTimestamp, keepAlive), - stop: () => cancelFrame(passTimestamp), - /** - * If we're processing this frame we can use the - * framelocked timestamp to keep things in sync. - */ - now: () => (frameData.isProcessing ? frameData.timestamp : time.now()), - }; - }; - - const generateLinearEasing = (easing, duration, // as milliseconds - resolution = 10 // as milliseconds - ) => { - let points = ""; - const numPoints = Math.max(Math.round(duration / resolution), 2); - for (let i = 0; i < numPoints; i++) { - points += Math.round(easing(i / (numPoints - 1)) * 10000) / 10000 + ", "; - } - return `linear(${points.substring(0, points.length - 2)})`; - }; - - /** - * Implement a practical max duration for keyframe generation - * to prevent infinite loops - */ - const maxGeneratorDuration = 20000; - function calcGeneratorDuration(generator) { - let duration = 0; - const timeStep = 50; - let state = generator.next(duration); - while (!state.done && duration < maxGeneratorDuration) { - duration += timeStep; - state = generator.next(duration); - } - return duration >= maxGeneratorDuration ? Infinity : duration; - } - - /** - * Create a progress => progress easing function from a generator. - */ - function createGeneratorEasing(options, scale = 100, createGenerator) { - const generator = createGenerator({ ...options, keyframes: [0, scale] }); - const duration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration); - return { - type: "keyframes", - ease: (progress) => { - return generator.next(duration * progress).value / scale; - }, - duration: millisecondsToSeconds(duration), - }; - } - - const springDefaults = { - // Default spring physics - stiffness: 100, - damping: 10, - mass: 1.0, - velocity: 0.0, - // Default duration/bounce-based options - duration: 800, // in ms - bounce: 0.3, - visualDuration: 0.3, // in seconds - // Rest thresholds - restSpeed: { - granular: 0.01, - default: 2, - }, - restDelta: { - granular: 0.005, - default: 0.5, - }, - // Limits - minDuration: 0.01, // in seconds - maxDuration: 10.0, // in seconds - minDamping: 0.05, - maxDamping: 1, - }; - function calcAngularFreq(undampedFreq, dampingRatio) { - return undampedFreq * Math.sqrt(1 - dampingRatio * dampingRatio); - } - const rootIterations = 12; - function approximateRoot(envelope, derivative, initialGuess) { - let result = initialGuess; - for (let i = 1; i < rootIterations; i++) { - result = result - envelope(result) / derivative(result); - } - return result; - } - /** - * This is ported from the Framer implementation of duration-based spring resolution. - */ - const safeMin = 0.001; - function findSpring({ duration = springDefaults.duration, bounce = springDefaults.bounce, velocity = springDefaults.velocity, mass = springDefaults.mass, }) { - let envelope; - let derivative; - exports.warning(duration <= secondsToMilliseconds(springDefaults.maxDuration), "Spring duration must be 10 seconds or less", "spring-duration-limit"); - let dampingRatio = 1 - bounce; - /** - * Restrict dampingRatio and duration to within acceptable ranges. - */ - dampingRatio = clamp(springDefaults.minDamping, springDefaults.maxDamping, dampingRatio); - duration = clamp(springDefaults.minDuration, springDefaults.maxDuration, millisecondsToSeconds(duration)); - if (dampingRatio < 1) { - /** - * Underdamped spring - */ - envelope = (undampedFreq) => { - const exponentialDecay = undampedFreq * dampingRatio; - const delta = exponentialDecay * duration; - const a = exponentialDecay - velocity; - const b = calcAngularFreq(undampedFreq, dampingRatio); - const c = Math.exp(-delta); - return safeMin - (a / b) * c; - }; - derivative = (undampedFreq) => { - const exponentialDecay = undampedFreq * dampingRatio; - const delta = exponentialDecay * duration; - const d = delta * velocity + velocity; - const e = Math.pow(dampingRatio, 2) * Math.pow(undampedFreq, 2) * duration; - const f = Math.exp(-delta); - const g = calcAngularFreq(Math.pow(undampedFreq, 2), dampingRatio); - const factor = -envelope(undampedFreq) + safeMin > 0 ? -1 : 1; - return (factor * ((d - e) * f)) / g; - }; - } - else { - /** - * Critically-damped spring - */ - envelope = (undampedFreq) => { - const a = Math.exp(-undampedFreq * duration); - const b = (undampedFreq - velocity) * duration + 1; - return -safeMin + a * b; - }; - derivative = (undampedFreq) => { - const a = Math.exp(-undampedFreq * duration); - const b = (velocity - undampedFreq) * (duration * duration); - return a * b; - }; - } - const initialGuess = 5 / duration; - const undampedFreq = approximateRoot(envelope, derivative, initialGuess); - duration = secondsToMilliseconds(duration); - if (isNaN(undampedFreq)) { - return { - stiffness: springDefaults.stiffness, - damping: springDefaults.damping, - duration, - }; - } - else { - const stiffness = Math.pow(undampedFreq, 2) * mass; - return { - stiffness, - damping: dampingRatio * 2 * Math.sqrt(mass * stiffness), - duration, - }; - } - } - const durationKeys = ["duration", "bounce"]; - const physicsKeys = ["stiffness", "damping", "mass"]; - function isSpringType(options, keys) { - return keys.some((key) => options[key] !== undefined); - } - function getSpringOptions(options) { - let springOptions = { - velocity: springDefaults.velocity, - stiffness: springDefaults.stiffness, - damping: springDefaults.damping, - mass: springDefaults.mass, - isResolvedFromDuration: false, - ...options, - }; - // stiffness/damping/mass overrides duration/bounce - if (!isSpringType(options, physicsKeys) && - isSpringType(options, durationKeys)) { - // Time-defined springs should ignore inherited velocity. - // Velocity from interrupted animations can cause findSpring() - // to compute wildly different spring parameters, leading to - // massive oscillation on small-range animations. - springOptions.velocity = 0; - if (options.visualDuration) { - const visualDuration = options.visualDuration; - const root = (2 * Math.PI) / (visualDuration * 1.2); - const stiffness = root * root; - const damping = 2 * - clamp(0.05, 1, 1 - (options.bounce || 0)) * - Math.sqrt(stiffness); - springOptions = { - ...springOptions, - mass: springDefaults.mass, - stiffness, - damping, - }; - } - else { - const derived = findSpring({ ...options, velocity: 0 }); - springOptions = { - ...springOptions, - ...derived, - mass: springDefaults.mass, - }; - springOptions.isResolvedFromDuration = true; - } - } - return springOptions; - } - function spring(optionsOrVisualDuration = springDefaults.visualDuration, bounce = springDefaults.bounce) { - const options = typeof optionsOrVisualDuration !== "object" - ? { - visualDuration: optionsOrVisualDuration, - keyframes: [0, 1], - bounce, - } - : optionsOrVisualDuration; - let { restSpeed, restDelta } = options; - const origin = options.keyframes[0]; - const target = options.keyframes[options.keyframes.length - 1]; - /** - * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator - * to reduce GC during animation. - */ - const state = { done: false, value: origin }; - const { stiffness, damping, mass, duration, velocity, isResolvedFromDuration, } = getSpringOptions({ - ...options, - velocity: -millisecondsToSeconds(options.velocity || 0), - }); - const initialVelocity = velocity || 0.0; - const dampingRatio = damping / (2 * Math.sqrt(stiffness * mass)); - const initialDelta = target - origin; - const undampedAngularFreq = millisecondsToSeconds(Math.sqrt(stiffness / mass)); - /** - * If we're working on a granular scale, use smaller defaults for determining - * when the spring is finished. - * - * These defaults have been selected emprically based on what strikes a good - * ratio between feeling good and finishing as soon as changes are imperceptible. - */ - const isGranularScale = Math.abs(initialDelta) < 5; - restSpeed || (restSpeed = isGranularScale - ? springDefaults.restSpeed.granular - : springDefaults.restSpeed.default); - restDelta || (restDelta = isGranularScale - ? springDefaults.restDelta.granular - : springDefaults.restDelta.default); - let resolveSpring; - let resolveVelocity; - // Underdamped coefficients, hoisted for use in the inlined next() hot path - let angularFreq; - let A; - let sinCoeff; - let cosCoeff; - if (dampingRatio < 1) { - angularFreq = calcAngularFreq(undampedAngularFreq, dampingRatio); - A = - (initialVelocity + - dampingRatio * undampedAngularFreq * initialDelta) / - angularFreq; - // Underdamped spring - resolveSpring = (t) => { - const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); - return (target - - envelope * - (A * Math.sin(angularFreq * t) + - initialDelta * Math.cos(angularFreq * t))); - }; - // Analytical derivative of underdamped spring (px/ms) - sinCoeff = - dampingRatio * undampedAngularFreq * A + initialDelta * angularFreq; - cosCoeff = - dampingRatio * undampedAngularFreq * initialDelta - A * angularFreq; - resolveVelocity = (t) => { - const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); - return envelope * - (sinCoeff * Math.sin(angularFreq * t) + - cosCoeff * Math.cos(angularFreq * t)); - }; - } - else if (dampingRatio === 1) { - // Critically damped spring - resolveSpring = (t) => target - - Math.exp(-undampedAngularFreq * t) * - (initialDelta + - (initialVelocity + undampedAngularFreq * initialDelta) * t); - // Analytical derivative of critically damped spring (px/ms) - const C = initialVelocity + undampedAngularFreq * initialDelta; - resolveVelocity = (t) => Math.exp(-undampedAngularFreq * t) * - (undampedAngularFreq * C * t - initialVelocity); - } - else { - // Overdamped spring - const dampedAngularFreq = undampedAngularFreq * Math.sqrt(dampingRatio * dampingRatio - 1); - resolveSpring = (t) => { - const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); - // When performing sinh or cosh values can hit Infinity so we cap them here - const freqForT = Math.min(dampedAngularFreq * t, 300); - return (target - - (envelope * - ((initialVelocity + - dampingRatio * undampedAngularFreq * initialDelta) * - Math.sinh(freqForT) + - dampedAngularFreq * - initialDelta * - Math.cosh(freqForT))) / - dampedAngularFreq); - }; - // Analytical derivative of overdamped spring (px/ms) - const P = (initialVelocity + - dampingRatio * undampedAngularFreq * initialDelta) / - dampedAngularFreq; - const sinhCoeff = dampingRatio * undampedAngularFreq * P - initialDelta * dampedAngularFreq; - const coshCoeff = dampingRatio * undampedAngularFreq * initialDelta - P * dampedAngularFreq; - resolveVelocity = (t) => { - const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); - const freqForT = Math.min(dampedAngularFreq * t, 300); - return envelope * - (sinhCoeff * Math.sinh(freqForT) + - coshCoeff * Math.cosh(freqForT)); - }; - } - const generator = { - calculatedDuration: isResolvedFromDuration ? duration || null : null, - velocity: (t) => secondsToMilliseconds(resolveVelocity(t)), - next: (t) => { - /** - * For underdamped physics springs we need both position and - * velocity each tick. Compute shared trig values once to avoid - * duplicate Math.exp/sin/cos calls on the hot path. - */ - if (!isResolvedFromDuration && dampingRatio < 1) { - const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); - const sin = Math.sin(angularFreq * t); - const cos = Math.cos(angularFreq * t); - const current = target - - envelope * - (A * sin + initialDelta * cos); - const currentVelocity = secondsToMilliseconds(envelope * - (sinCoeff * sin + cosCoeff * cos)); - state.done = - Math.abs(currentVelocity) <= restSpeed && - Math.abs(target - current) <= restDelta; - state.value = state.done ? target : current; - return state; - } - const current = resolveSpring(t); - if (!isResolvedFromDuration) { - const currentVelocity = secondsToMilliseconds(resolveVelocity(t)); - state.done = - Math.abs(currentVelocity) <= restSpeed && - Math.abs(target - current) <= restDelta; - } - else { - state.done = t >= duration; - } - state.value = state.done ? target : current; - return state; - }, - toString: () => { - const calculatedDuration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration); - const easing = generateLinearEasing((progress) => generator.next(calculatedDuration * progress).value, calculatedDuration, 30); - return calculatedDuration + "ms " + easing; - }, - toTransition: () => { }, - }; - return generator; - } - spring.applyToOptions = (options) => { - const generatorOptions = createGeneratorEasing(options, 100, spring); - options.ease = generatorOptions.ease; - options.duration = secondsToMilliseconds(generatorOptions.duration); - options.type = "keyframes"; - return options; - }; - - const velocitySampleDuration = 5; // ms - function getGeneratorVelocity(resolveValue, t, current) { - const prevT = Math.max(t - velocitySampleDuration, 0); - return velocityPerSecond(current - resolveValue(prevT), t - prevT); - } - - function inertia({ keyframes, velocity = 0.0, power = 0.8, timeConstant = 325, bounceDamping = 10, bounceStiffness = 500, modifyTarget, min, max, restDelta = 0.5, restSpeed, }) { - const origin = keyframes[0]; - const state = { - done: false, - value: origin, - }; - const isOutOfBounds = (v) => (min !== undefined && v < min) || (max !== undefined && v > max); - const nearestBoundary = (v) => { - if (min === undefined) - return max; - if (max === undefined) - return min; - return Math.abs(min - v) < Math.abs(max - v) ? min : max; - }; - let amplitude = power * velocity; - const ideal = origin + amplitude; - const target = modifyTarget === undefined ? ideal : modifyTarget(ideal); - /** - * If the target has changed we need to re-calculate the amplitude, otherwise - * the animation will start from the wrong position. - */ - if (target !== ideal) - amplitude = target - origin; - const calcDelta = (t) => -amplitude * Math.exp(-t / timeConstant); - const calcLatest = (t) => target + calcDelta(t); - const applyFriction = (t) => { - const delta = calcDelta(t); - const latest = calcLatest(t); - state.done = Math.abs(delta) <= restDelta; - state.value = state.done ? target : latest; - }; - /** - * Ideally this would resolve for t in a stateless way, we could - * do that by always precalculating the animation but as we know - * this will be done anyway we can assume that spring will - * be discovered during that. - */ - let timeReachedBoundary; - let spring$1; - const checkCatchBoundary = (t) => { - if (!isOutOfBounds(state.value)) - return; - timeReachedBoundary = t; - spring$1 = spring({ - keyframes: [state.value, nearestBoundary(state.value)], - velocity: getGeneratorVelocity(calcLatest, t, state.value), // TODO: This should be passing * 1000 - damping: bounceDamping, - stiffness: bounceStiffness, - restDelta, - restSpeed, - }); - }; - checkCatchBoundary(0); - return { - calculatedDuration: null, - next: (t) => { - /** - * We need to resolve the friction to figure out if we need a - * spring but we don't want to do this twice per frame. So here - * we flag if we updated for this frame and later if we did - * we can skip doing it again. - */ - let hasUpdatedFrame = false; - if (!spring$1 && timeReachedBoundary === undefined) { - hasUpdatedFrame = true; - applyFriction(t); - checkCatchBoundary(t); - } - /** - * If we have a spring and the provided t is beyond the moment the friction - * animation crossed the min/max boundary, use the spring. - */ - if (timeReachedBoundary !== undefined && t >= timeReachedBoundary) { - return spring$1.next(t - timeReachedBoundary); - } - else { - !hasUpdatedFrame && applyFriction(t); - return state; - } - }, - }; - } - - function createMixers(output, ease, customMixer) { - const mixers = []; - const mixerFactory = customMixer || MotionGlobalConfig.mix || mix; - const numMixers = output.length - 1; - for (let i = 0; i < numMixers; i++) { - let mixer = mixerFactory(output[i], output[i + 1]); - if (ease) { - const easingFunction = Array.isArray(ease) ? ease[i] || noop : ease; - mixer = pipe(easingFunction, mixer); - } - mixers.push(mixer); - } - return mixers; - } - /** - * Create a function that maps from a numerical input array to a generic output array. - * - * Accepts: - * - Numbers - * - Colors (hex, hsl, hsla, rgb, rgba) - * - Complex (combinations of one or more numbers or strings) - * - * ```jsx - * const mixColor = interpolate([0, 1], ['#fff', '#000']) - * - * mixColor(0.5) // 'rgba(128, 128, 128, 1)' - * ``` - * - * TODO Revisit this approach once we've moved to data models for values, - * probably not needed to pregenerate mixer functions. - * - * @public - */ - function interpolate(input, output, { clamp: isClamp = true, ease, mixer } = {}) { - const inputLength = input.length; - exports.invariant(inputLength === output.length, "Both input and output ranges must be the same length", "range-length"); - /** - * If we're only provided a single input, we can just make a function - * that returns the output. - */ - if (inputLength === 1) - return () => output[0]; - if (inputLength === 2 && output[0] === output[1]) - return () => output[1]; - const isZeroDeltaRange = input[0] === input[1]; - // If input runs highest -> lowest, reverse both arrays - if (input[0] > input[inputLength - 1]) { - input = [...input].reverse(); - output = [...output].reverse(); - } - const mixers = createMixers(output, ease, mixer); - const numMixers = mixers.length; - const interpolator = (v) => { - if (isZeroDeltaRange && v < input[0]) - return output[0]; - let i = 0; - if (numMixers > 1) { - for (; i < input.length - 2; i++) { - if (v < input[i + 1]) - break; - } - } - const progressInRange = progress(input[i], input[i + 1], v); - return mixers[i](progressInRange); - }; - return isClamp - ? (v) => interpolator(clamp(input[0], input[inputLength - 1], v)) - : interpolator; - } - - function fillOffset(offset, remaining) { - const min = offset[offset.length - 1]; - for (let i = 1; i <= remaining; i++) { - const offsetProgress = progress(0, remaining, i); - offset.push(mixNumber$1(min, 1, offsetProgress)); - } - } - - function defaultOffset$1(arr) { - const offset = [0]; - fillOffset(offset, arr.length - 1); - return offset; - } - - function convertOffsetToTimes(offset, duration) { - return offset.map((o) => o * duration); - } - - function defaultEasing(values, easing) { - return values.map(() => easing || easeInOut).splice(0, values.length - 1); - } - function keyframes({ duration = 300, keyframes: keyframeValues, times, ease = "easeInOut", }) { - /** - * Easing functions can be externally defined as strings. Here we convert them - * into actual functions. - */ - const easingFunctions = isEasingArray(ease) - ? ease.map(easingDefinitionToFunction) - : easingDefinitionToFunction(ease); - /** - * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator - * to reduce GC during animation. - */ - const state = { - done: false, - value: keyframeValues[0], - }; - /** - * Create a times array based on the provided 0-1 offsets - */ - const absoluteTimes = convertOffsetToTimes( - // Only use the provided offsets if they're the correct length - // TODO Maybe we should warn here if there's a length mismatch - times && times.length === keyframeValues.length - ? times - : defaultOffset$1(keyframeValues), duration); - const mapTimeToKeyframe = interpolate(absoluteTimes, keyframeValues, { - ease: Array.isArray(easingFunctions) - ? easingFunctions - : defaultEasing(keyframeValues, easingFunctions), - }); - return { - calculatedDuration: duration, - next: (t) => { - state.value = mapTimeToKeyframe(t); - state.done = t >= duration; - return state; - }, - }; - } - - const isNotNull = (value) => value !== null; - function getFinalKeyframe(keyframes, { repeat, repeatType = "loop" }, finalKeyframe, speed = 1) { - const resolvedKeyframes = keyframes.filter(isNotNull); - const useFirstKeyframe = speed < 0 || (repeat && repeatType !== "loop" && repeat % 2 === 1); - const index = useFirstKeyframe ? 0 : resolvedKeyframes.length - 1; - return !index || finalKeyframe === undefined - ? resolvedKeyframes[index] - : finalKeyframe; - } - - const transitionTypeMap = { - decay: inertia, - inertia, - tween: keyframes, - keyframes: keyframes, - spring, - }; - function replaceTransitionType(transition) { - if (typeof transition.type === "string") { - transition.type = transitionTypeMap[transition.type]; - } - } - - class WithPromise { - constructor() { - this.updateFinished(); - } - get finished() { - return this._finished; - } - updateFinished() { - this._finished = new Promise((resolve) => { - this.resolve = resolve; - }); - } - notifyFinished() { - this.resolve(); - } - /** - * Allows the animation to be awaited. - * - * @deprecated Use `finished` instead. - */ - then(onResolve, onReject) { - return this.finished.then(onResolve, onReject); - } - } - - const percentToProgress = (percent) => percent / 100; - class JSAnimation extends WithPromise { - constructor(options) { - super(); - this.state = "idle"; - this.startTime = null; - this.isStopped = false; - /** - * The current time of the animation. - */ - this.currentTime = 0; - /** - * The time at which the animation was paused. - */ - this.holdTime = null; - /** - * Playback speed as a factor. 0 would be stopped, -1 reverse and 2 double speed. - */ - this.playbackSpeed = 1; - /** - * Reusable state object for the delay phase to avoid - * allocating a new object every frame. - */ - this.delayState = { - done: false, - value: undefined, - }; - /** - * This method is bound to the instance to fix a pattern where - * animation.stop is returned as a reference from a useEffect. - */ - this.stop = () => { - const { motionValue } = this.options; - if (motionValue && motionValue.updatedAt !== time.now()) { - this.tick(time.now()); - } - this.isStopped = true; - if (this.state === "idle") - return; - this.teardown(); - this.options.onStop?.(); - }; - this.options = options; - this.initAnimation(); - this.play(); - if (options.autoplay === false) - this.pause(); - } - initAnimation() { - const { options } = this; - replaceTransitionType(options); - const { type = keyframes, repeat = 0, repeatDelay = 0, repeatType, velocity = 0, } = options; - let { keyframes: keyframes$1 } = options; - const generatorFactory = type || keyframes; - if (generatorFactory !== keyframes) { - exports.invariant(keyframes$1.length <= 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${keyframes$1}`, "spring-two-frames"); - } - if (generatorFactory !== keyframes && - typeof keyframes$1[0] !== "number") { - this.mixKeyframes = pipe(percentToProgress, mix(keyframes$1[0], keyframes$1[1])); - keyframes$1 = [0, 100]; - } - const generator = generatorFactory({ ...options, keyframes: keyframes$1 }); - /** - * If we have a mirror repeat type we need to create a second generator that outputs the - * mirrored (not reversed) animation and later ping pong between the two generators. - */ - if (repeatType === "mirror") { - this.mirroredGenerator = generatorFactory({ - ...options, - keyframes: [...keyframes$1].reverse(), - velocity: -velocity, - }); - } - /** - * If duration is undefined and we have repeat options, - * we need to calculate a duration from the generator. - * - * We set it to the generator itself to cache the duration. - * Any timeline resolver will need to have already precalculated - * the duration by this step. - */ - if (generator.calculatedDuration === null) { - generator.calculatedDuration = calcGeneratorDuration(generator); - } - const { calculatedDuration } = generator; - this.calculatedDuration = calculatedDuration; - this.resolvedDuration = calculatedDuration + repeatDelay; - this.totalDuration = this.resolvedDuration * (repeat + 1) - repeatDelay; - this.generator = generator; - } - updateTime(timestamp) { - const animationTime = Math.round(timestamp - this.startTime) * this.playbackSpeed; - // Update currentTime - if (this.holdTime !== null) { - this.currentTime = this.holdTime; - } - else { - // Rounding the time because floating point arithmetic is not always accurate, e.g. 3000.367 - 1000.367 = - // 2000.0000000000002. This is a problem when we are comparing the currentTime with the duration, for - // example. - this.currentTime = animationTime; - } - } - tick(timestamp, sample = false) { - const { generator, totalDuration, mixKeyframes, mirroredGenerator, resolvedDuration, calculatedDuration, } = this; - if (this.startTime === null) - return generator.next(0); - const { delay = 0, keyframes, repeat, repeatType, repeatDelay, type, onUpdate, finalKeyframe, } = this.options; - /** - * requestAnimationFrame timestamps can come through as lower than - * the startTime as set by performance.now(). Here we prevent this, - * though in the future it could be possible to make setting startTime - * a pending operation that gets resolved here. - */ - if (this.speed > 0) { - this.startTime = Math.min(this.startTime, timestamp); - } - else if (this.speed < 0) { - this.startTime = Math.min(timestamp - totalDuration / this.speed, this.startTime); - } - if (sample) { - this.currentTime = timestamp; - } - else { - this.updateTime(timestamp); - } - // Rebase on delay - const timeWithoutDelay = this.currentTime - delay * (this.playbackSpeed >= 0 ? 1 : -1); - const isInDelayPhase = this.playbackSpeed >= 0 - ? timeWithoutDelay < 0 - : timeWithoutDelay > totalDuration; - this.currentTime = Math.max(timeWithoutDelay, 0); - // If this animation has finished, set the current time to the total duration. - if (this.state === "finished" && this.holdTime === null) { - this.currentTime = totalDuration; - } - let elapsed = this.currentTime; - let frameGenerator = generator; - if (repeat) { - /** - * Get the current progress (0-1) of the animation. If t is > - * than duration we'll get values like 2.5 (midway through the - * third iteration) - */ - const progress = Math.min(this.currentTime, totalDuration) / resolvedDuration; - /** - * Get the current iteration (0 indexed). For instance the floor of - * 2.5 is 2. - */ - let currentIteration = Math.floor(progress); - /** - * Get the current progress of the iteration by taking the remainder - * so 2.5 is 0.5 through iteration 2 - */ - let iterationProgress = progress % 1.0; - /** - * If iteration progress is 1 we count that as the end - * of the previous iteration. - */ - if (!iterationProgress && progress >= 1) { - iterationProgress = 1; - } - iterationProgress === 1 && currentIteration--; - currentIteration = Math.min(currentIteration, repeat + 1); - /** - * Reverse progress if we're not running in "normal" direction - */ - const isOddIteration = Boolean(currentIteration % 2); - if (isOddIteration) { - if (repeatType === "reverse") { - iterationProgress = 1 - iterationProgress; - if (repeatDelay) { - iterationProgress -= repeatDelay / resolvedDuration; - } - } - else if (repeatType === "mirror") { - frameGenerator = mirroredGenerator; - } - } - elapsed = clamp(0, 1, iterationProgress) * resolvedDuration; - } - /** - * If we're in negative time, set state as the initial keyframe. - * This prevents delay: x, duration: 0 animations from finishing - * instantly. - */ - let state; - if (isInDelayPhase) { - this.delayState.value = keyframes[0]; - state = this.delayState; - } - else { - state = frameGenerator.next(elapsed); - } - if (mixKeyframes && !isInDelayPhase) { - state.value = mixKeyframes(state.value); - } - let { done } = state; - if (!isInDelayPhase && calculatedDuration !== null) { - done = - this.playbackSpeed >= 0 - ? this.currentTime >= totalDuration - : this.currentTime <= 0; - } - const isAnimationFinished = this.holdTime === null && - (this.state === "finished" || (this.state === "running" && done)); - // TODO: The exception for inertia could be cleaner here - if (isAnimationFinished && type !== inertia) { - state.value = getFinalKeyframe(keyframes, this.options, finalKeyframe, this.speed); - } - if (onUpdate) { - onUpdate(state.value); - } - if (isAnimationFinished) { - this.finish(); - } - return state; - } - /** - * Allows the returned animation to be awaited or promise-chained. Currently - * resolves when the animation finishes at all but in a future update could/should - * reject if its cancels. - */ - then(resolve, reject) { - return this.finished.then(resolve, reject); - } - get duration() { - return millisecondsToSeconds(this.calculatedDuration); - } - get iterationDuration() { - const { delay = 0 } = this.options || {}; - return this.duration + millisecondsToSeconds(delay); - } - get time() { - return millisecondsToSeconds(this.currentTime); - } - set time(newTime) { - newTime = secondsToMilliseconds(newTime); - this.currentTime = newTime; - if (this.startTime === null || - this.holdTime !== null || - this.playbackSpeed === 0) { - this.holdTime = newTime; - } - else if (this.driver) { - this.startTime = this.driver.now() - newTime / this.playbackSpeed; - } - if (this.driver) { - this.driver.start(false); - } - else { - this.startTime = 0; - this.state = "paused"; - this.holdTime = newTime; - this.tick(newTime); - } - } - /** - * Returns the generator's velocity at the current time in units/second. - * Uses the analytical derivative when available (springs), avoiding - * the MotionValue's frame-dependent velocity estimation. - */ - getGeneratorVelocity() { - const t = this.currentTime; - if (t <= 0) - return this.options.velocity || 0; - if (this.generator.velocity) { - return this.generator.velocity(t); - } - // Fallback: finite difference - const current = this.generator.next(t).value; - return getGeneratorVelocity((s) => this.generator.next(s).value, t, current); - } - get speed() { - return this.playbackSpeed; - } - set speed(newSpeed) { - const hasChanged = this.playbackSpeed !== newSpeed; - if (hasChanged && this.driver) { - this.updateTime(time.now()); - } - this.playbackSpeed = newSpeed; - if (hasChanged && this.driver) { - this.time = millisecondsToSeconds(this.currentTime); - } - } - play() { - if (this.isStopped) - return; - const { driver = frameloopDriver, startTime } = this.options; - if (!this.driver) { - this.driver = driver((timestamp) => this.tick(timestamp)); - } - this.options.onPlay?.(); - const now = this.driver.now(); - if (this.state === "finished") { - this.updateFinished(); - this.startTime = now; - } - else if (this.holdTime !== null) { - this.startTime = now - this.holdTime; - } - else if (!this.startTime) { - this.startTime = startTime ?? now; - } - if (this.state === "finished" && this.speed < 0) { - this.startTime += this.calculatedDuration; - } - this.holdTime = null; - /** - * Set playState to running only after we've used it in - * the previous logic. - */ - this.state = "running"; - this.driver.start(); - } - pause() { - this.state = "paused"; - this.updateTime(time.now()); - this.holdTime = this.currentTime; - } - complete() { - if (this.state !== "running") { - this.play(); - } - this.state = "finished"; - this.holdTime = null; - } - finish() { - this.notifyFinished(); - this.teardown(); - this.state = "finished"; - this.options.onComplete?.(); - } - cancel() { - this.holdTime = null; - this.startTime = 0; - this.tick(0); - this.teardown(); - this.options.onCancel?.(); - } - teardown() { - this.state = "idle"; - this.stopDriver(); - this.startTime = this.holdTime = null; - } - stopDriver() { - if (!this.driver) - return; - this.driver.stop(); - this.driver = undefined; - } - sample(sampleTime) { - this.startTime = 0; - return this.tick(sampleTime, true); - } - attachTimeline(timeline) { - if (this.options.allowFlatten) { - this.options.type = "keyframes"; - this.options.ease = "linear"; - this.initAnimation(); - } - this.driver?.stop(); - return timeline.observe(this); - } - } - // Legacy function support - function animateValue(options) { - return new JSAnimation(options); - } - - function fillWildcards(keyframes) { - for (let i = 1; i < keyframes.length; i++) { - keyframes[i] ?? (keyframes[i] = keyframes[i - 1]); - } - } - - const radToDeg = (rad) => (rad * 180) / Math.PI; - const rotate = (v) => { - const angle = radToDeg(Math.atan2(v[1], v[0])); - return rebaseAngle(angle); - }; - const matrix2dParsers = { - x: 4, - y: 5, - translateX: 4, - translateY: 5, - scaleX: 0, - scaleY: 3, - scale: (v) => (Math.abs(v[0]) + Math.abs(v[3])) / 2, - rotate, - rotateZ: rotate, - skewX: (v) => radToDeg(Math.atan(v[1])), - skewY: (v) => radToDeg(Math.atan(v[2])), - skew: (v) => (Math.abs(v[1]) + Math.abs(v[2])) / 2, - }; - const rebaseAngle = (angle) => { - angle = angle % 360; - if (angle < 0) - angle += 360; - return angle; - }; - const rotateZ = rotate; - const scaleX = (v) => Math.sqrt(v[0] * v[0] + v[1] * v[1]); - const scaleY = (v) => Math.sqrt(v[4] * v[4] + v[5] * v[5]); - const matrix3dParsers = { - x: 12, - y: 13, - z: 14, - translateX: 12, - translateY: 13, - translateZ: 14, - scaleX, - scaleY, - scale: (v) => (scaleX(v) + scaleY(v)) / 2, - rotateX: (v) => rebaseAngle(radToDeg(Math.atan2(v[6], v[5]))), - rotateY: (v) => rebaseAngle(radToDeg(Math.atan2(-v[2], v[0]))), - rotateZ, - rotate: rotateZ, - skewX: (v) => radToDeg(Math.atan(v[4])), - skewY: (v) => radToDeg(Math.atan(v[1])), - skew: (v) => (Math.abs(v[1]) + Math.abs(v[4])) / 2, - }; - function defaultTransformValue(name) { - return name.includes("scale") ? 1 : 0; - } - function parseValueFromTransform(transform, name) { - if (!transform || transform === "none") { - return defaultTransformValue(name); - } - const matrix3dMatch = transform.match(/^matrix3d\(([-\d.e\s,]+)\)$/u); - let parsers; - let match; - if (matrix3dMatch) { - parsers = matrix3dParsers; - match = matrix3dMatch; - } - else { - const matrix2dMatch = transform.match(/^matrix\(([-\d.e\s,]+)\)$/u); - parsers = matrix2dParsers; - match = matrix2dMatch; - } - if (!match) { - return defaultTransformValue(name); - } - const valueParser = parsers[name]; - const values = match[1].split(",").map(convertTransformToNumber); - return typeof valueParser === "function" - ? valueParser(values) - : values[valueParser]; - } - const readTransformValue = (instance, name) => { - const { transform = "none" } = getComputedStyle(instance); - return parseValueFromTransform(transform, name); - }; - function convertTransformToNumber(value) { - return parseFloat(value.trim()); - } - - /** - * Generate a list of every possible transform key. - */ - const transformPropOrder = [ - "transformPerspective", - "x", - "y", - "z", - "translateX", - "translateY", - "translateZ", - "scale", - "scaleX", - "scaleY", - "rotate", - "rotateX", - "rotateY", - "rotateZ", - "skew", - "skewX", - "skewY", - ]; - /** - * A quick lookup for transform props. - * - * `pathRotation` is a transform for routing purposes (skipped from raw - * style application, wired to the transform composite, flags transform - * dirty) but is intentionally NOT in `transformPropOrder` — it is - * composed onto `rotate` at the build sites, not serialized in its own - * slot, and must stay out of the order-array consumers (parse-transform, - * unit-conversion, keys-position). - */ - const transformProps = /*@__PURE__*/ (() => new Set([...transformPropOrder, "pathRotation"]))(); - - const isNumOrPxType = (v) => v === number || v === px; - const transformKeys = new Set(["x", "y", "z"]); - const nonTranslationalTransformKeys = transformPropOrder.filter((key) => !transformKeys.has(key)); - function removeNonTranslationalTransform(visualElement) { - const removedTransforms = []; - nonTranslationalTransformKeys.forEach((key) => { - const value = visualElement.getValue(key); - if (value !== undefined) { - removedTransforms.push([key, value.get()]); - value.set(key.startsWith("scale") ? 1 : 0); - } - }); - return removedTransforms; - } - const positionalValues = { - // Dimensions - width: ({ x }, { paddingLeft = "0", paddingRight = "0", boxSizing }) => { - const width = x.max - x.min; - return boxSizing === "border-box" - ? width - : width - parseFloat(paddingLeft) - parseFloat(paddingRight); - }, - height: ({ y }, { paddingTop = "0", paddingBottom = "0", boxSizing }) => { - const height = y.max - y.min; - return boxSizing === "border-box" - ? height - : height - parseFloat(paddingTop) - parseFloat(paddingBottom); - }, - top: (_bbox, { top }) => parseFloat(top), - left: (_bbox, { left }) => parseFloat(left), - bottom: ({ y }, { top }) => parseFloat(top) + (y.max - y.min), - right: ({ x }, { left }) => parseFloat(left) + (x.max - x.min), - // Transform - x: (_bbox, { transform }) => parseValueFromTransform(transform, "x"), - y: (_bbox, { transform }) => parseValueFromTransform(transform, "y"), - }; - // Alias translate longform names - positionalValues.translateX = positionalValues.x; - positionalValues.translateY = positionalValues.y; - - const toResolve = new Set(); - let isScheduled = false; - let anyNeedsMeasurement = false; - let isForced = false; - function measureAllKeyframes() { - if (anyNeedsMeasurement) { - const resolversToMeasure = Array.from(toResolve).filter((resolver) => resolver.needsMeasurement); - const elementsToMeasure = new Set(resolversToMeasure.map((resolver) => resolver.element)); - const transformsToRestore = new Map(); - /** - * Write pass - * If we're measuring elements we want to remove bounding box-changing transforms. - */ - elementsToMeasure.forEach((element) => { - const removedTransforms = removeNonTranslationalTransform(element); - if (!removedTransforms.length) - return; - transformsToRestore.set(element, removedTransforms); - element.render(); - }); - // Read - resolversToMeasure.forEach((resolver) => resolver.measureInitialState()); - // Write - elementsToMeasure.forEach((element) => { - element.render(); - const restore = transformsToRestore.get(element); - if (restore) { - restore.forEach(([key, value]) => { - element.getValue(key)?.set(value); - }); - } - }); - // Read - resolversToMeasure.forEach((resolver) => resolver.measureEndState()); - // Write - resolversToMeasure.forEach((resolver) => { - if (resolver.suspendedScrollY !== undefined) { - window.scrollTo(0, resolver.suspendedScrollY); - } - }); - } - anyNeedsMeasurement = false; - isScheduled = false; - toResolve.forEach((resolver) => resolver.complete(isForced)); - toResolve.clear(); - } - function readAllKeyframes() { - toResolve.forEach((resolver) => { - resolver.readKeyframes(); - if (resolver.needsMeasurement) { - anyNeedsMeasurement = true; - } - }); - } - function flushKeyframeResolvers() { - isForced = true; - readAllKeyframes(); - measureAllKeyframes(); - isForced = false; - } - class KeyframeResolver { - constructor(unresolvedKeyframes, onComplete, name, motionValue, element, isAsync = false) { - this.state = "pending"; - /** - * Track whether this resolver is async. If it is, it'll be added to the - * resolver queue and flushed in the next frame. Resolvers that aren't going - * to trigger read/write thrashing don't need to be async. - */ - this.isAsync = false; - /** - * Track whether this resolver needs to perform a measurement - * to resolve its keyframes. - */ - this.needsMeasurement = false; - this.unresolvedKeyframes = [...unresolvedKeyframes]; - this.onComplete = onComplete; - this.name = name; - this.motionValue = motionValue; - this.element = element; - this.isAsync = isAsync; - } - scheduleResolve() { - this.state = "scheduled"; - if (this.isAsync) { - toResolve.add(this); - if (!isScheduled) { - isScheduled = true; - frame.read(readAllKeyframes); - frame.resolveKeyframes(measureAllKeyframes); - } - } - else { - this.readKeyframes(); - this.complete(); - } - } - readKeyframes() { - const { unresolvedKeyframes, name, element, motionValue } = this; - // If initial keyframe is null we need to read it from the DOM - if (unresolvedKeyframes[0] === null) { - const currentValue = motionValue?.get(); - // TODO: This doesn't work if the final keyframe is a wildcard - const finalKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1]; - if (currentValue !== undefined) { - unresolvedKeyframes[0] = currentValue; - } - else if (element && name) { - const valueAsRead = element.readValue(name, finalKeyframe); - if (valueAsRead !== undefined && valueAsRead !== null) { - unresolvedKeyframes[0] = valueAsRead; - } - } - if (unresolvedKeyframes[0] === undefined) { - unresolvedKeyframes[0] = finalKeyframe; - } - if (motionValue && currentValue === undefined) { - motionValue.set(unresolvedKeyframes[0]); - } - } - fillWildcards(unresolvedKeyframes); - } - setFinalKeyframe() { } - measureInitialState() { } - renderEndStyles() { } - measureEndState() { } - complete(isForcedComplete = false) { - this.state = "complete"; - this.onComplete(this.unresolvedKeyframes, this.finalKeyframe, isForcedComplete); - toResolve.delete(this); - } - cancel() { - if (this.state === "scheduled") { - toResolve.delete(this); - this.state = "pending"; - } - } - resume() { - if (this.state === "pending") - this.scheduleResolve(); - } - } - - const isCSSVar = (name) => name.startsWith("--"); - - function setStyle(element, name, value) { - isCSSVar(name) - ? element.style.setProperty(name, value) - : (element.style[name] = value); - } - - /** - * Add the ability for test suites to manually set support flags - * to better test more environments. - */ - const supportsFlags = {}; - - function memoSupports(callback, supportsFlag) { - const memoized = memo(callback); - return () => supportsFlags[supportsFlag] ?? memoized(); - } - - const supportsScrollTimeline = /* @__PURE__ */ memoSupports(() => window.ScrollTimeline !== undefined, "scrollTimeline"); - const supportsViewTimeline = /* @__PURE__ */ memoSupports(() => window.ViewTimeline !== undefined, "viewTimeline"); - - const supportsLinearEasing = /*@__PURE__*/ memoSupports(() => { - try { - document - .createElement("div") - .animate({ opacity: 0 }, { easing: "linear(0, 1)" }); - } - catch (e) { - return false; - } - return true; - }, "linearEasing"); - - const cubicBezierAsString = ([a, b, c, d]) => `cubic-bezier(${a}, ${b}, ${c}, ${d})`; - - const supportedWaapiEasing = { - linear: "linear", - ease: "ease", - easeIn: "ease-in", - easeOut: "ease-out", - easeInOut: "ease-in-out", - circIn: /*@__PURE__*/ cubicBezierAsString([0, 0.65, 0.55, 1]), - circOut: /*@__PURE__*/ cubicBezierAsString([0.55, 0, 1, 0.45]), - backIn: /*@__PURE__*/ cubicBezierAsString([0.31, 0.01, 0.66, -0.59]), - backOut: /*@__PURE__*/ cubicBezierAsString([0.33, 1.53, 0.69, 0.99]), - }; - - function mapEasingToNativeEasing(easing, duration) { - if (!easing) { - return undefined; - } - else if (typeof easing === "function") { - return supportsLinearEasing() - ? generateLinearEasing(easing, duration) - : "ease-out"; - } - else if (isBezierDefinition(easing)) { - return cubicBezierAsString(easing); - } - else if (Array.isArray(easing)) { - return easing.map((segmentEasing) => mapEasingToNativeEasing(segmentEasing, duration) || - supportedWaapiEasing.easeOut); - } - else { - return supportedWaapiEasing[easing]; - } - } - - function startWaapiAnimation(element, valueName, keyframes, { delay = 0, duration = 300, repeat = 0, repeatType = "loop", ease = "easeOut", times, } = {}, pseudoElement = undefined) { - const keyframeOptions = { - [valueName]: keyframes, - }; - if (times) - keyframeOptions.offset = times; - const easing = mapEasingToNativeEasing(ease, duration); - /** - * If this is an easing array, apply to keyframes, not animation as a whole - */ - if (Array.isArray(easing)) - keyframeOptions.easing = easing; - const options = { - delay, - duration, - easing: !Array.isArray(easing) ? easing : "linear", - fill: "both", - iterations: repeat + 1, - direction: repeatType === "reverse" ? "alternate" : "normal", - }; - if (pseudoElement) - options.pseudoElement = pseudoElement; - return element.animate(keyframeOptions, options); - } - - function isGenerator(type) { - return typeof type === "function" && "applyToOptions" in type; - } - - function applyGeneratorOptions({ type, ...options }) { - if (isGenerator(type) && supportsLinearEasing()) { - return type.applyToOptions(options); - } - else { - options.duration ?? (options.duration = 300); - options.ease ?? (options.ease = "easeOut"); - } - return options; - } - - /** - * NativeAnimation implements AnimationPlaybackControls for the browser's Web Animations API. - */ - class NativeAnimation extends WithPromise { - constructor(options) { - super(); - this.finishedTime = null; - this.isStopped = false; - /** - * Tracks a manually-set start time that takes precedence over WAAPI's - * dynamic startTime. This is cleared when play() or time setter is called, - * allowing WAAPI to take over timing. - */ - this.manualStartTime = null; - if (!options) - return; - const { element, name, keyframes, pseudoElement, allowFlatten = false, finalKeyframe, onComplete, } = options; - this.isPseudoElement = Boolean(pseudoElement); - this.allowFlatten = allowFlatten; - this.options = options; - exports.invariant(typeof options.type !== "string", `Mini animate() doesn't support "type" as a string.`, "mini-spring"); - const transition = applyGeneratorOptions(options); - this.animation = startWaapiAnimation(element, name, keyframes, transition, pseudoElement); - if (transition.autoplay === false) { - this.animation.pause(); - } - this.animation.onfinish = () => { - this.finishedTime = this.time; - if (!pseudoElement) { - const keyframe = getFinalKeyframe(keyframes, this.options, finalKeyframe, this.speed); - if (this.updateMotionValue) { - this.updateMotionValue(keyframe); - } - /** - * If we can, we want to commit the final style as set by the user, - * rather than the computed keyframe value supplied by the animation. - * We always do this, even when a motion value is present, to prevent - * a visual flash in Firefox where the WAAPI animation's fill is removed - * during cancel() before the scheduled render can apply the correct value. - */ - setStyle(element, name, keyframe); - this.animation.cancel(); - } - onComplete?.(); - this.notifyFinished(); - }; - } - play() { - if (this.isStopped) - return; - this.manualStartTime = null; - this.animation.play(); - if (this.state === "finished") { - this.updateFinished(); - } - } - pause() { - this.animation.pause(); - } - complete() { - this.animation.finish?.(); - } - cancel() { - try { - this.animation.cancel(); - } - catch (e) { } - } - stop() { - if (this.isStopped) - return; - this.isStopped = true; - const { state } = this; - if (state === "idle" || state === "finished") { - return; - } - if (this.updateMotionValue) { - this.updateMotionValue(); - } - else { - this.commitStyles(); - } - if (!this.isPseudoElement) - this.cancel(); - } - /** - * WAAPI doesn't natively have any interruption capabilities. - * - * In this method, we commit styles back to the DOM before cancelling - * the animation. - * - * This is designed to be overridden by NativeAnimationExtended, which - * will create a renderless JS animation and sample it twice to calculate - * its current value, "previous" value, and therefore allow - * Motion to also correctly calculate velocity for any subsequent animation - * while deferring the commit until the next animation frame. - */ - commitStyles() { - const element = this.options?.element; - if (!this.isPseudoElement && element?.isConnected) { - this.animation.commitStyles?.(); - } - } - get duration() { - const duration = this.animation.effect?.getComputedTiming?.().duration || 0; - return millisecondsToSeconds(Number(duration)); - } - get iterationDuration() { - const { delay = 0 } = this.options || {}; - return this.duration + millisecondsToSeconds(delay); - } - get time() { - return millisecondsToSeconds(Number(this.animation.currentTime) || 0); - } - set time(newTime) { - const wasFinished = this.finishedTime !== null; - this.manualStartTime = null; - this.finishedTime = null; - this.animation.currentTime = secondsToMilliseconds(newTime); - if (wasFinished) { - this.animation.pause(); - } - } - /** - * The playback speed of the animation. - * 1 = normal speed, 2 = double speed, 0.5 = half speed. - */ - get speed() { - return this.animation.playbackRate; - } - set speed(newSpeed) { - // Allow backwards playback after finishing - if (newSpeed < 0) - this.finishedTime = null; - this.animation.playbackRate = newSpeed; - } - get state() { - return this.finishedTime !== null - ? "finished" - : this.animation.playState; - } - get startTime() { - return this.manualStartTime ?? Number(this.animation.startTime); - } - set startTime(newStartTime) { - this.manualStartTime = this.animation.startTime = newStartTime; - } - /** - * Attaches a timeline to the animation, for instance the `ScrollTimeline`. - */ - attachTimeline({ timeline, rangeStart, rangeEnd, observe, }) { - if (this.allowFlatten) { - this.animation.effect?.updateTiming({ easing: "linear" }); - } - this.animation.onfinish = null; - if (timeline && supportsScrollTimeline()) { - this.animation.timeline = timeline; - if (rangeStart) - this.animation.rangeStart = rangeStart; - if (rangeEnd) - this.animation.rangeEnd = rangeEnd; - return noop; - } - else { - return observe(this); - } - } - } - - const unsupportedEasingFunctions = { - anticipate, - backInOut, - circInOut, - }; - function isUnsupportedEase(key) { - return key in unsupportedEasingFunctions; - } - function replaceStringEasing(transition) { - if (typeof transition.ease === "string" && - isUnsupportedEase(transition.ease)) { - transition.ease = unsupportedEasingFunctions[transition.ease]; - } - } - - /** - * 10ms is chosen here as it strikes a balance between smooth - * results (more than one keyframe per frame at 60fps) and - * keyframe quantity. - */ - const sampleDelta = 10; //ms - class NativeAnimationExtended extends NativeAnimation { - constructor(options) { - /** - * The base NativeAnimation function only supports a subset - * of Motion easings, and WAAPI also only supports some - * easing functions via string/cubic-bezier definitions. - * - * This function replaces those unsupported easing functions - * with a JS easing function. This will later get compiled - * to a linear() easing function. - */ - replaceStringEasing(options); - /** - * Ensure we replace the transition type with a generator function - * before passing to WAAPI. - * - * TODO: Does this have a better home? It could be shared with - * JSAnimation. - */ - replaceTransitionType(options); - super(options); - /** - * Only set startTime when the animation should autoplay. - * Setting startTime on a paused WAAPI animation unpauses it - * (per the WAAPI spec), which breaks autoplay: false. - */ - if (options.startTime !== undefined && options.autoplay !== false) { - this.startTime = options.startTime; - } - this.options = options; - } - /** - * WAAPI doesn't natively have any interruption capabilities. - * - * Rather than read committed styles back out of the DOM, we can - * create a renderless JS animation and sample it twice to calculate - * its current value, "previous" value, and therefore allow - * Motion to calculate velocity for any subsequent animation. - */ - updateMotionValue(value) { - const { motionValue, onUpdate, onComplete, element, ...options } = this.options; - if (!motionValue) - return; - if (value !== undefined) { - motionValue.set(value); - return; - } - const sampleAnimation = new JSAnimation({ - ...options, - autoplay: false, - }); - /** - * Use wall-clock elapsed time for sampling. - * Under CPU load, WAAPI's currentTime may not reflect actual - * elapsed time, causing incorrect sampling and visual jumps. - */ - const sampleTime = Math.max(sampleDelta, time.now() - this.startTime); - const delta = clamp(0, sampleDelta, sampleTime - sampleDelta); - const current = sampleAnimation.sample(sampleTime).value; - /** - * Write the estimated value to inline style so it persists - * after cancel(), covering the async gap before the next - * animation starts. - */ - const { name } = this.options; - if (element && name) - setStyle(element, name, current); - motionValue.setWithVelocity(sampleAnimation.sample(Math.max(0, sampleTime - delta)).value, current, delta); - sampleAnimation.stop(); - } - } - - /** - * Check if a value is animatable. Examples: - * - * ✅: 100, "100px", "#fff" - * ❌: "block", "url(2.jpg)" - * @param value - * - * @internal - */ - const isAnimatable = (value, name) => { - // If the list of keys that might be non-animatable grows, replace with Set - if (name === "zIndex") - return false; - // If it's a number or a keyframes array, we can animate it. We might at some point - // need to do a deep isAnimatable check of keyframes, or let Popmotion handle this, - // but for now lets leave it like this for performance reasons - if (typeof value === "number" || Array.isArray(value)) - return true; - if (typeof value === "string" && // It's animatable if we have a string - (complex.test(value) || value === "0") && // And it contains numbers and/or colors - !value.startsWith("url(") // Unless it starts with "url(" - ) { - return true; - } - return false; - }; - - function hasKeyframesChanged(keyframes) { - const current = keyframes[0]; - if (keyframes.length === 1) - return true; - for (let i = 0; i < keyframes.length; i++) { - if (keyframes[i] !== current) - return true; - } - } - function canAnimate(keyframes, name, type, velocity) { - /** - * Check if we're able to animate between the start and end keyframes, - * and throw a warning if we're attempting to animate between one that's - * animatable and another that isn't. - */ - const originKeyframe = keyframes[0]; - if (originKeyframe === null) { - return false; - } - /** - * These aren't traditionally animatable but we do support them. - * In future we could look into making this more generic or replacing - * this function with mix() === mixImmediate - */ - if (name === "display" || name === "visibility") - return true; - const targetKeyframe = keyframes[keyframes.length - 1]; - const isOriginAnimatable = isAnimatable(originKeyframe, name); - const isTargetAnimatable = isAnimatable(targetKeyframe, name); - exports.warning(isOriginAnimatable === isTargetAnimatable, `You are trying to animate ${name} from "${originKeyframe}" to "${targetKeyframe}". "${isOriginAnimatable ? targetKeyframe : originKeyframe}" is not an animatable value.`, "value-not-animatable"); - // Always skip if any of these are true - if (!isOriginAnimatable || !isTargetAnimatable) { - return false; - } - return (hasKeyframesChanged(keyframes) || - ((type === "spring" || isGenerator(type)) && velocity)); - } - - function makeAnimationInstant(options) { - options.duration = 0; - options.type = "keyframes"; - } - - /** - * A list of values that can be hardware-accelerated. - */ - const acceleratedValues = new Set([ - "opacity", - "clipPath", - "filter", - "transform", - "backgroundColor", - ]); - - const browserColorFunctions = /^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/; - function hasBrowserOnlyColors(keyframes) { - for (let i = 0; i < keyframes.length; i++) { - if (typeof keyframes[i] === "string" && - browserColorFunctions.test(keyframes[i])) { - return true; - } - } - return false; - } - - const colorProperties = new Set([ - "color", - "backgroundColor", - "outlineColor", - "fill", - "stroke", - "borderColor", - "borderTopColor", - "borderRightColor", - "borderBottomColor", - "borderLeftColor", - ]); - const supportsWaapi = /*@__PURE__*/ memo(() => Object.hasOwnProperty.call(Element.prototype, "animate")); - function supportsBrowserAnimation(options) { - const { motionValue, name, repeatDelay, repeatType, damping, type, keyframes, } = options; - const subject = motionValue?.owner?.current; - /** - * We use instanceof checks instead of isHTMLElement()/isSVGElement() - * because we explicitly **don't** want elements in different timing - * contexts (i.e. popups) to be accelerated, as it's not possible to sync - * these animations properly with those driven from the main window - * frameloop. - */ - if (!(subject instanceof HTMLElement) && - !(subject instanceof SVGElement)) { - return false; - } - const { onUpdate, transformTemplate } = motionValue.owner.getProps(); - return (supportsWaapi() && - name && - /** - * Force WAAPI for color properties with browser-only color formats - * (oklch, oklab, lab, lch, etc.) that the JS animation path can't parse. - */ - (acceleratedValues.has(name) || - (colorProperties.has(name) && - hasBrowserOnlyColors(keyframes))) && - (name !== "transform" || !transformTemplate) && - /** - * If we're outputting values to onUpdate then we can't use WAAPI as there's - * no way to read the value from WAAPI every frame. - */ - !onUpdate && - !repeatDelay && - repeatType !== "mirror" && - damping !== 0 && - type !== "inertia"); - } - - /** - * Maximum time allowed between an animation being created and it being - * resolved for us to use the latter as the start time. - * - * This is to ensure that while we prefer to "start" an animation as soon - * as it's triggered, we also want to avoid a visual jump if there's a big delay - * between these two moments. - */ - const MAX_RESOLVE_DELAY = 40; - class AsyncMotionValueAnimation extends WithPromise { - constructor({ autoplay = true, delay = 0, type = "keyframes", repeat = 0, repeatDelay = 0, repeatType = "loop", keyframes, name, motionValue, element, ...options }) { - super(); - /** - * Bound to support return animation.stop pattern - */ - this.stop = () => { - if (this._animation) { - this._animation.stop(); - this.stopTimeline?.(); - } - this.keyframeResolver?.cancel(); - }; - this.createdAt = time.now(); - const optionsWithDefaults = { - autoplay, - delay, - type, - repeat, - repeatDelay, - repeatType, - name, - motionValue, - element, - ...options, - }; - const KeyframeResolver$1 = element?.KeyframeResolver || KeyframeResolver; - this.keyframeResolver = new KeyframeResolver$1(keyframes, (resolvedKeyframes, finalKeyframe, forced) => this.onKeyframesResolved(resolvedKeyframes, finalKeyframe, optionsWithDefaults, !forced), name, motionValue, element); - this.keyframeResolver?.scheduleResolve(); - } - onKeyframesResolved(keyframes, finalKeyframe, options, sync) { - this.keyframeResolver = undefined; - const { name, type, velocity, delay, isHandoff, onUpdate } = options; - this.resolvedAt = time.now(); - /** - * If we can't animate this value with the resolved keyframes - * then we should complete it immediately. - */ - let canAnimateValue = true; - if (!canAnimate(keyframes, name, type, velocity)) { - canAnimateValue = false; - if (MotionGlobalConfig.instantAnimations || !delay) { - onUpdate?.(getFinalKeyframe(keyframes, options, finalKeyframe)); - } - keyframes[0] = keyframes[keyframes.length - 1]; - makeAnimationInstant(options); - options.repeat = 0; - } - /** - * Resolve startTime for the animation. - * - * This method uses the createdAt and resolvedAt to calculate the - * animation startTime. *Ideally*, we would use the createdAt time as t=0 - * as the following frame would then be the first frame of the animation in - * progress, which would feel snappier. - * - * However, if there's a delay (main thread work) between the creation of - * the animation and the first committed frame, we prefer to use resolvedAt - * to avoid a sudden jump into the animation. - */ - const startTime = sync - ? !this.resolvedAt - ? this.createdAt - : this.resolvedAt - this.createdAt > MAX_RESOLVE_DELAY - ? this.resolvedAt - : this.createdAt - : undefined; - const resolvedOptions = { - startTime, - finalKeyframe, - ...options, - keyframes, - }; - /** - * Animate via WAAPI if possible. If this is a handoff animation, the optimised animation will be running via - * WAAPI. Therefore, this animation must be JS to ensure it runs "under" the - * optimised animation. - * - * Also skip WAAPI when keyframes aren't animatable, as the resolved - * values may not be valid CSS and would trigger browser warnings. - */ - const useWaapi = canAnimateValue && - !isHandoff && - supportsBrowserAnimation(resolvedOptions); - const element = resolvedOptions.motionValue?.owner?.current; - let animation; - if (useWaapi) { - try { - animation = new NativeAnimationExtended({ - ...resolvedOptions, - element, - }); - } - catch { - animation = new JSAnimation(resolvedOptions); - } - } - else { - animation = new JSAnimation(resolvedOptions); - } - animation.finished.then(() => { - this.notifyFinished(); - }).catch(noop); - if (this.pendingTimeline) { - this.stopTimeline = animation.attachTimeline(this.pendingTimeline); - this.pendingTimeline = undefined; - } - this._animation = animation; - } - get finished() { - if (!this._animation) { - return this._finished; - } - else { - return this.animation.finished; - } - } - then(onResolve, _onReject) { - return this.finished.finally(onResolve).then(() => { }); - } - get animation() { - if (!this._animation) { - this.keyframeResolver?.resume(); - flushKeyframeResolvers(); - } - return this._animation; - } - get duration() { - return this.animation.duration; - } - get iterationDuration() { - return this.animation.iterationDuration; - } - get time() { - return this.animation.time; - } - set time(newTime) { - this.animation.time = newTime; - } - get speed() { - return this.animation.speed; - } - get state() { - return this.animation.state; - } - set speed(newSpeed) { - this.animation.speed = newSpeed; - } - get startTime() { - return this.animation.startTime; - } - attachTimeline(timeline) { - if (this._animation) { - this.stopTimeline = this.animation.attachTimeline(timeline); - } - else { - this.pendingTimeline = timeline; - } - return () => this.stop(); - } - play() { - this.animation.play(); - } - pause() { - this.animation.pause(); - } - complete() { - this.animation.complete(); - } - cancel() { - if (this._animation) { - this.animation.cancel(); - } - this.keyframeResolver?.cancel(); - } - } - - class GroupAnimation { - constructor(animations) { - // Bound to accomadate common `return animation.stop` pattern - this.stop = () => this.runAll("stop"); - this.animations = animations.filter(Boolean); - } - get finished() { - return Promise.all(this.animations.map((animation) => animation.finished)); - } - /** - * TODO: Filter out cancelled or stopped animations before returning - */ - getAll(propName) { - return this.animations[0][propName]; - } - setAll(propName, newValue) { - for (let i = 0; i < this.animations.length; i++) { - this.animations[i][propName] = newValue; - } - } - attachTimeline(timeline) { - const subscriptions = this.animations.map((animation) => animation.attachTimeline(timeline)); - return () => { - subscriptions.forEach((cancel, i) => { - cancel && cancel(); - this.animations[i].stop(); - }); - }; - } - get time() { - return this.getAll("time"); - } - set time(time) { - this.setAll("time", time); - } - get speed() { - return this.getAll("speed"); - } - set speed(speed) { - this.setAll("speed", speed); - } - get state() { - return this.getAll("state"); - } - get startTime() { - return this.getAll("startTime"); - } - get duration() { - return getMax(this.animations, "duration"); - } - get iterationDuration() { - return getMax(this.animations, "iterationDuration"); - } - runAll(methodName) { - this.animations.forEach((controls) => controls[methodName]()); - } - play() { - this.runAll("play"); - } - pause() { - this.runAll("pause"); - } - cancel() { - this.runAll("cancel"); - } - complete() { - this.runAll("complete"); - } - } - function getMax(animations, propName) { - let max = 0; - for (let i = 0; i < animations.length; i++) { - const value = animations[i][propName]; - if (value !== null && value > max) { - max = value; - } - } - return max; - } - - class GroupAnimationWithThen extends GroupAnimation { - then(onResolve, _onReject) { - return this.finished.finally(onResolve).then(() => { }); - } - } - - class NativeAnimationWrapper extends NativeAnimation { - constructor(animation) { - super(); - this.animation = animation; - animation.onfinish = () => { - this.finishedTime = this.time; - this.notifyFinished(); - }; - } - } - - const animationMaps = new WeakMap(); - const animationMapKey = (name, pseudoElement = "") => `${name}:${pseudoElement}`; - function getAnimationMap(element) { - let map = animationMaps.get(element); - if (!map) { - map = new Map(); - animationMaps.set(element, map); - } - return map; - } - - function calcChildStagger(children, child, delayChildren, staggerChildren = 0, staggerDirection = 1) { - const index = Array.from(children) - .sort((a, b) => a.sortNodePosition(b)) - .indexOf(child); - const numChildren = children.size; - const maxStaggerDuration = (numChildren - 1) * staggerChildren; - const delayIsFunction = typeof delayChildren === "function"; - return delayIsFunction - ? delayChildren(index, numChildren) - : staggerDirection === 1 - ? index * staggerChildren - : maxStaggerDuration - index * staggerChildren; - } - - /** - * Maximum time between the value of two frames, beyond which we - * assume the velocity has since been 0. - */ - const MAX_VELOCITY_DELTA = 30; - const isFloat = (value) => { - return !isNaN(parseFloat(value)); - }; - const collectMotionValues = { - current: undefined, - }; - /** - * `MotionValue` is used to track the state and velocity of motion values. - * - * @public - */ - class MotionValue { - /** - * @param init - The initiating value - * @param config - Optional configuration options - * - * - `transformer`: A function to transform incoming values with. - */ - constructor(init, options = {}) { - /** - * Tracks whether this value can output a velocity. Currently this is only true - * if the value is numerical, but we might be able to widen the scope here and support - * other value types. - * - * @internal - */ - this.canTrackVelocity = null; - /** - * An object containing a SubscriptionManager for each active event. - */ - this.events = {}; - this.updateAndNotify = (v) => { - const currentTime = time.now(); - /** - * If we're updating the value during another frame or eventloop - * than the previous frame, then the we set the previous frame value - * to current. - */ - if (this.updatedAt !== currentTime) { - this.setPrevFrameValue(); - } - this.prev = this.current; - this.setCurrent(v); - // Update update subscribers - if (this.current !== this.prev) { - this.events.change?.notify(this.current); - if (this.dependents) { - for (const dependent of this.dependents) { - dependent.dirty(); - } - } - } - }; - this.hasAnimated = false; - this.setCurrent(init); - this.owner = options.owner; - } - setCurrent(current) { - this.current = current; - this.updatedAt = time.now(); - if (this.canTrackVelocity === null && current !== undefined) { - this.canTrackVelocity = isFloat(this.current); - } - } - setPrevFrameValue(prevFrameValue = this.current) { - this.prevFrameValue = prevFrameValue; - this.prevUpdatedAt = this.updatedAt; - } - /** - * Adds a function that will be notified when the `MotionValue` is updated. - * - * It returns a function that, when called, will cancel the subscription. - * - * When calling `onChange` inside a React component, it should be wrapped with the - * `useEffect` hook. As it returns an unsubscribe function, this should be returned - * from the `useEffect` function to ensure you don't add duplicate subscribers.. - * - * ```jsx - * export const MyComponent = () => { - * const x = useMotionValue(0) - * const y = useMotionValue(0) - * const opacity = useMotionValue(1) - * - * useEffect(() => { - * function updateOpacity() { - * const maxXY = Math.max(x.get(), y.get()) - * const newOpacity = transform(maxXY, [0, 100], [1, 0]) - * opacity.set(newOpacity) - * } - * - * const unsubscribeX = x.on("change", updateOpacity) - * const unsubscribeY = y.on("change", updateOpacity) - * - * return () => { - * unsubscribeX() - * unsubscribeY() - * } - * }, []) - * - * return - * } - * ``` - * - * @param subscriber - A function that receives the latest value. - * @returns A function that, when called, will cancel this subscription. - * - * @deprecated - */ - onChange(subscription) { - { - warnOnce(false, `value.onChange(callback) is deprecated. Switch to value.on("change", callback).`); - } - return this.on("change", subscription); - } - on(eventName, callback) { - if (!this.events[eventName]) { - this.events[eventName] = new SubscriptionManager(); - } - const unsubscribe = this.events[eventName].add(callback); - if (eventName === "change") { - return () => { - unsubscribe(); - /** - * If we have no more change listeners by the start - * of the next frame, stop active animations. - */ - frame.read(() => { - if (!this.events.change.getSize()) { - this.stop(); - } - }); - }; - } - return unsubscribe; - } - clearListeners() { - for (const eventManagers in this.events) { - this.events[eventManagers].clear(); - } - } - /** - * Attaches a passive effect to the `MotionValue`. - */ - attach(passiveEffect, stopPassiveEffect) { - this.passiveEffect = passiveEffect; - this.stopPassiveEffect = stopPassiveEffect; - } - /** - * Sets the state of the `MotionValue`. - * - * @remarks - * - * ```jsx - * const x = useMotionValue(0) - * x.set(10) - * ``` - * - * @param latest - Latest value to set. - * @param render - Whether to notify render subscribers. Defaults to `true` - * - * @public - */ - set(v) { - if (!this.passiveEffect) { - this.updateAndNotify(v); - } - else { - this.passiveEffect(v, this.updateAndNotify); - } - } - setWithVelocity(prev, current, delta) { - this.set(current); - this.prev = undefined; - this.prevFrameValue = prev; - this.prevUpdatedAt = this.updatedAt - delta; - } - /** - * Set the state of the `MotionValue`, stopping any active animations, - * effects, and resets velocity to `0`. - */ - jump(v, endAnimation = true) { - this.updateAndNotify(v); - this.prev = v; - this.prevUpdatedAt = this.prevFrameValue = undefined; - endAnimation && this.stop(); - if (this.stopPassiveEffect) - this.stopPassiveEffect(); - } - dirty() { - this.events.change?.notify(this.current); - } - addDependent(dependent) { - if (!this.dependents) { - this.dependents = new Set(); - } - this.dependents.add(dependent); - } - removeDependent(dependent) { - if (this.dependents) { - this.dependents.delete(dependent); - } - } - /** - * Returns the latest state of `MotionValue` - * - * @returns - The latest state of `MotionValue` - * - * @public - */ - get() { - if (collectMotionValues.current) { - collectMotionValues.current.push(this); - } - return this.current; - } - /** - * @public - */ - getPrevious() { - return this.prev; - } - /** - * Returns the latest velocity of `MotionValue` - * - * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical. - * - * @public - */ - getVelocity() { - const currentTime = time.now(); - if (!this.canTrackVelocity || - this.prevFrameValue === undefined || - currentTime - this.updatedAt > MAX_VELOCITY_DELTA) { - return 0; - } - const delta = Math.min(this.updatedAt - this.prevUpdatedAt, MAX_VELOCITY_DELTA); - // Casts because of parseFloat's poor typing - return velocityPerSecond(parseFloat(this.current) - - parseFloat(this.prevFrameValue), delta); - } - /** - * Registers a new animation to control this `MotionValue`. Only one - * animation can drive a `MotionValue` at one time. - * - * ```jsx - * value.start() - * ``` - * - * @param animation - A function that starts the provided animation - */ - start(startAnimation) { - this.stop(); - return new Promise((resolve) => { - this.hasAnimated = true; - this.animation = startAnimation(resolve); - if (this.events.animationStart) { - this.events.animationStart.notify(); - } - }).then(() => { - if (this.events.animationComplete) { - this.events.animationComplete.notify(); - } - this.clearAnimation(); - }); - } - /** - * Stop the currently active animation. - * - * @public - */ - stop() { - if (this.animation) { - this.animation.stop(); - if (this.events.animationCancel) { - this.events.animationCancel.notify(); - } - } - this.clearAnimation(); - } - /** - * Returns `true` if this value is currently animating. - * - * @public - */ - isAnimating() { - return !!this.animation; - } - clearAnimation() { - delete this.animation; - } - /** - * Destroy and clean up subscribers to this `MotionValue`. - * - * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically - * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually - * created a `MotionValue` via the `motionValue` function. - * - * @public - */ - destroy() { - this.dependents?.clear(); - this.events.destroy?.notify(); - this.clearListeners(); - this.stop(); - if (this.stopPassiveEffect) { - this.stopPassiveEffect(); - } - } - } - function motionValue(init, options) { - return new MotionValue(init, options); - } - - /** - * If `transition` has `inherit: true`, shallow-merge it with - * `parentTransition` (child keys win) and strip the `inherit` key. - * Otherwise return `transition` unchanged. - */ - function resolveTransition(transition, parentTransition) { - if (transition?.inherit && parentTransition) { - const { inherit: _, ...rest } = transition; - return { ...parentTransition, ...rest }; - } - return transition; - } - - function getValueTransition$1(transition, key) { - const valueTransition = transition?.[key] ?? - transition?.["default"] ?? - transition; - if (valueTransition !== transition) { - return resolveTransition(valueTransition, transition); - } - return valueTransition; - } - - const underDampedSpring = { - type: "spring", - stiffness: 500, - damping: 25, - restSpeed: 10, - }; - const criticallyDampedSpring = (target) => ({ - type: "spring", - stiffness: 550, - damping: target === 0 ? 2 * Math.sqrt(550) : 30, - restSpeed: 10, - }); - const keyframesTransition = { - type: "keyframes", - duration: 0.8, - }; - /** - * Default easing curve is a slightly shallower version of - * the default browser easing curve. - */ - const ease = { - type: "keyframes", - ease: [0.25, 0.1, 0.35, 1], - duration: 0.3, - }; - const getDefaultTransition = (valueKey, { keyframes }) => { - if (keyframes.length > 2) { - return keyframesTransition; - } - else if (transformProps.has(valueKey)) { - return valueKey.startsWith("scale") - ? criticallyDampedSpring(keyframes[1]) - : underDampedSpring; - } - return ease; - }; - - const orchestrationKeys = new Set([ - "when", - "delay", - "delayChildren", - "staggerChildren", - "staggerDirection", - "repeat", - "repeatType", - "repeatDelay", - "from", - "elapsed", - ]); - /** - * Decide whether a transition is defined on a given Transition. - * This filters out orchestration options and returns true - * if any options are left. - */ - function isTransitionDefined(transition) { - for (const key in transition) { - if (!orchestrationKeys.has(key)) - return true; - } - return false; - } - - const animateMotionValue = (name, value, target, transition = {}, element, isHandoff) => (onComplete) => { - const valueTransition = getValueTransition$1(transition, name) || {}; - /** - * Most transition values are currently completely overwritten by value-specific - * transitions. In the future it'd be nicer to blend these transitions. But for now - * delay actually does inherit from the root transition if not value-specific. - */ - const delay = valueTransition.delay || transition.delay || 0; - /** - * Elapsed isn't a public transition option but can be passed through from - * optimized appear effects in milliseconds. - */ - let { elapsed = 0 } = transition; - elapsed = elapsed - secondsToMilliseconds(delay); - const options = { - keyframes: Array.isArray(target) ? target : [null, target], - ease: "easeOut", - velocity: value.getVelocity(), - ...valueTransition, - delay: -elapsed, - onUpdate: (v) => { - value.set(v); - valueTransition.onUpdate && valueTransition.onUpdate(v); - }, - onComplete: () => { - onComplete(); - valueTransition.onComplete && valueTransition.onComplete(); - }, - name, - motionValue: value, - element: isHandoff ? undefined : element, - }; - /** - * If there's no transition defined for this value, we can generate - * unique transition settings for this value. - */ - if (!isTransitionDefined(valueTransition)) { - Object.assign(options, getDefaultTransition(name, options)); - } - /** - * Both WAAPI and our internal animation functions use durations - * as defined by milliseconds, while our external API defines them - * as seconds. - */ - options.duration && (options.duration = secondsToMilliseconds(options.duration)); - options.repeatDelay && (options.repeatDelay = secondsToMilliseconds(options.repeatDelay)); - /** - * Support deprecated way to set initial value. Prefer keyframe syntax. - */ - if (options.from !== undefined) { - options.keyframes[0] = options.from; - } - let shouldSkip = false; - if (options.type === false || - (options.duration === 0 && !options.repeatDelay)) { - makeAnimationInstant(options); - if (options.delay === 0) { - shouldSkip = true; - } - } - if (MotionGlobalConfig.instantAnimations || - MotionGlobalConfig.skipAnimations || - element?.shouldSkipAnimations || - valueTransition.skipAnimations) { - shouldSkip = true; - makeAnimationInstant(options); - options.delay = 0; - } - /** - * If the transition type or easing has been explicitly set by the user - * then we don't want to allow flattening the animation. - */ - options.allowFlatten = !valueTransition.type && !valueTransition.ease; - /** - * If we can or must skip creating the animation, and apply only - * the final keyframe, do so. We also check once keyframes are resolved but - * this early check prevents the need to create an animation at all. - */ - if (shouldSkip && !isHandoff && value.get() !== undefined) { - const finalKeyframe = getFinalKeyframe(options.keyframes, valueTransition); - if (finalKeyframe !== undefined) { - frame.update(() => { - options.onUpdate(finalKeyframe); - options.onComplete(); - }); - return; - } - } - return valueTransition.isSync - ? new JSAnimation(options) - : new AsyncMotionValueAnimation(options); - }; - - const MIN_LAYOUT_DISTANCE = 20; - function bezierPoint(t, origin, control, target) { - const inv = 1 - t; - return inv * inv * origin + 2 * inv * t * control + t * t * target; - } - function bezierTangentAngle(t, originX, controlX, targetX, originY, controlY, targetY) { - const dx = 2 * (1 - t) * (controlX - originX) + 2 * t * (targetX - controlX); - const dy = 2 * (1 - t) * (controlY - originY) + 2 * t * (targetY - controlY); - return Math.atan2(dy, dx) * (180 / Math.PI); - } - function computeArcControlPoint(fromX, fromY, toX, toY, strength, peak) { - const deltaX = toX - fromX; - const deltaY = toY - fromY; - const distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY); - if (distance > 0) { - const normalPerpX = -deltaY / distance; - const normalPerpY = deltaX / distance; - const desiredHeight = strength * distance; - return { - x: fromX + deltaX * peak + normalPerpX * desiredHeight, - y: fromY + deltaY * peak + normalPerpY * desiredHeight, - }; - } - return { x: fromX, y: fromY }; - } - /** - * The pure sampling factory: `(from, to) => (t) => point`. Internal — - * used by {@link arc} and the unit tests. Not part of the public surface. - */ - function createArcPath({ strength = 0.5, peak = 0.5, direction, rotate = false, } = {}) { - const rotationScale = rotate === true ? 1 : typeof rotate === "number" ? rotate : 0; - // Auto-direction only: persists across calls to flip the bulge back - // onto the same screen side when the dominant axis changes between - // calls. Reuse the factory (module scope / useMemo) to keep this alive. - let prevBulgeSign; - const createInterpolator = (from, to) => { - const dx = to.x - from.x; - const dy = to.y - from.y; - let signed; - if (direction === "cw") { - signed = -strength; - } - else if (direction === "ccw") { - signed = strength; - } - else { - const dom = Math.abs(dx) >= Math.abs(dy) ? dx : dy; - signed = dom < 0 ? -strength : strength; - } - let control = computeArcControlPoint(from.x, from.y, to.x, to.y, signed, peak); - if (direction === undefined) { - const isVertical = Math.abs(dx) < Math.abs(dy); - const midX = from.x + dx * peak; - const midY = from.y + dy * peak; - const bulgeSign = isVertical - ? Math.sign(control.x - midX) - : Math.sign(control.y - midY); - if (prevBulgeSign !== undefined && - bulgeSign !== 0 && - bulgeSign !== prevBulgeSign) { - signed = -signed; - control = computeArcControlPoint(from.x, from.y, to.x, to.y, signed, peak); - } - else if (bulgeSign !== 0) { - prevBulgeSign = bulgeSign; - } - } - const tangent0 = rotationScale - ? bezierTangentAngle(0, from.x, control.x, to.x, from.y, control.y, to.y) - : 0; - const tangent1 = rotationScale - ? bezierTangentAngle(1, from.x, control.x, to.x, from.y, control.y, to.y) - : 0; - const tangentDelta = rotationScale - ? wrap(-180, 180, tangent1 - tangent0) - : 0; - return (t) => { - const out = { - x: bezierPoint(t, from.x, control.x, to.x), - y: bezierPoint(t, from.y, control.y, to.y), - }; - if (rotationScale) { - const raw = bezierTangentAngle(t, from.x, control.x, to.x, from.y, control.y, to.y); - const baseline = tangent0 + tangentDelta * t; - out.rotate = wrap(-180, 180, raw - baseline) * rotationScale; - } - return out; - }; - }; - return createInterpolator; - } - /** - * Creates a curved path for `transition.path`: - * - * ```ts - * - * ``` - * - * Reuse the returned value (module scope / useMemo / useRef) so its - * continuity closure survives re-renders — a fresh `arc()` has no memory. - */ - function arc(options = {}) { - const sample = createArcPath(options); - const path = { - interpolateProjection(delta) { - // `from` is the current translate offset (carries any in-flight - // displacement when interrupted); `to` is the new layout origin. - // The distance floor avoids visible wobble on tiny shifts. - const tx = delta.x.translate; - const ty = delta.y.translate; - if (Math.sqrt(tx * tx + ty * ty) < MIN_LAYOUT_DISTANCE) { - return undefined; - } - return sample({ x: tx, y: ty }, { x: 0, y: 0 }); - }, - animateVisualElement(visualElement, target, transition, delay, animations) { - if (!("x" in target || "y" in target)) - return; - const xValue = visualElement.getValue("x", visualElement.latestValues["x"] ?? 0); - const yValue = visualElement.getValue("y", visualElement.latestValues["y"] ?? 0); - const xRaw = target.x; - const yRaw = target.y; - const xFrom = (Array.isArray(xRaw) && xRaw[0] != null - ? xRaw[0] - : xValue?.get()) ?? 0; - const yFrom = (Array.isArray(yRaw) && yRaw[0] != null - ? yRaw[0] - : yValue?.get()) ?? 0; - const xTo = (Array.isArray(xRaw) - ? xRaw[xRaw.length - 1] - : xRaw ?? xFrom); - const yTo = (Array.isArray(yRaw) - ? yRaw[yRaw.length - 1] - : yRaw ?? yFrom); - // Interruption needs no flag: x/y already hold the displaced - // mid-arc position, so xFrom/yFrom carry the continuity geometry. - const interpolate = sample({ x: xFrom, y: yFrom }, { x: xTo, y: yTo }); - // Drive a dedicated `pathRotation` value (composed onto `rotate` - // at the build sites) rather than `rotate` itself, so a - // concurrent rotate animation composes and nothing accumulates - // on interrupt. - const pathRotationValue = interpolate(0).rotate !== undefined - ? visualElement.getValue("pathRotation", 0) - : undefined; - const pathTransition = { - delay, - ...getValueTransition$1(transition || {}, "x"), - }; - delete pathTransition.path; - const progress = motionValue(0); - progress.start(animateMotionValue("", progress, [0, 1000], { - ...pathTransition, - isSync: true, - velocity: 0, - onUpdate: (latest) => { - const point = interpolate(latest / 1000); - xValue?.set(point.x); - yValue?.set(point.y); - if (pathRotationValue && point.rotate !== undefined) { - pathRotationValue.set(point.rotate); - } - }, - onComplete: () => { - xValue?.set(xTo); - yValue?.set(yTo); - pathRotationValue?.set(0); - }, - // Interrupt/cancel must clear our additive contribution - // so it can't linger on top of the user's `rotate`. - onStop: () => pathRotationValue?.set(0), - onCancel: () => pathRotationValue?.set(0), - })); - if (progress.animation) - animations.push(progress.animation); - delete target.x; - delete target.y; - }, - }; - return path; - } - - /** - * Parse Framer's special CSS variable format into a CSS token and a fallback. - * - * ``` - * `var(--foo, #fff)` => [`--foo`, '#fff'] - * ``` - * - * @param current - */ - const splitCSSVariableRegex = - // eslint-disable-next-line redos-detector/no-unsafe-regex -- false positive, as it can match a lot of words - /^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u; - function parseCSSVariable(current) { - const match = splitCSSVariableRegex.exec(current); - if (!match) - return [,]; - const [, token1, token2, fallback] = match; - return [`--${token1 ?? token2}`, fallback]; - } - const maxDepth = 4; - function getVariableValue(current, element, depth = 1) { - exports.invariant(depth <= maxDepth, `Max CSS variable fallback depth detected in property "${current}". This may indicate a circular fallback dependency.`, "max-css-var-depth"); - const [token, fallback] = parseCSSVariable(current); - // No CSS variable detected - if (!token) - return; - // Attempt to read this CSS variable off the element - const resolved = window.getComputedStyle(element).getPropertyValue(token); - if (resolved) { - const trimmed = resolved.trim(); - return isNumericalString(trimmed) ? parseFloat(trimmed) : trimmed; - } - return isCSSVariableToken(fallback) - ? getVariableValue(fallback, element, depth + 1) - : fallback; - } - - function getValueState(visualElement) { - const state = [{}, {}]; - visualElement?.values.forEach((value, key) => { - state[0][key] = value.get(); - state[1][key] = value.getVelocity(); - }); - return state; - } - function resolveVariantFromProps(props, definition, custom, visualElement) { - /** - * If the variant definition is a function, resolve. - */ - if (typeof definition === "function") { - const [current, velocity] = getValueState(visualElement); - definition = definition(custom !== undefined ? custom : props.custom, current, velocity); - } - /** - * If the variant definition is a variant label, or - * the function returned a variant label, resolve. - */ - if (typeof definition === "string") { - definition = props.variants && props.variants[definition]; - } - /** - * At this point we've resolved both functions and variant labels, - * but the resolved variant label might itself have been a function. - * If so, resolve. This can only have returned a valid target object. - */ - if (typeof definition === "function") { - const [current, velocity] = getValueState(visualElement); - definition = definition(custom !== undefined ? custom : props.custom, current, velocity); - } - return definition; - } - - function resolveVariant(visualElement, definition, custom) { - const props = visualElement.getProps(); - return resolveVariantFromProps(props, definition, custom !== undefined ? custom : props.custom, visualElement); - } - - const positionalKeys = new Set([ - "width", - "height", - "top", - "left", - "right", - "bottom", - ...transformPropOrder, - ]); - - const isKeyframesTarget = (v) => { - return Array.isArray(v); - }; - - /** - * Set VisualElement's MotionValue, creating a new MotionValue for it if - * it doesn't exist. - */ - function setMotionValue(visualElement, key, value) { - if (visualElement.hasValue(key)) { - visualElement.getValue(key).set(value); - } - else { - visualElement.addValue(key, motionValue(value)); - } - } - function resolveFinalValueInKeyframes(v) { - // TODO maybe throw if v.length - 1 is placeholder token? - return isKeyframesTarget(v) ? v[v.length - 1] || 0 : v; - } - function setTarget(visualElement, definition) { - const resolved = resolveVariant(visualElement, definition); - let { transitionEnd = {}, transition = {}, ...target } = resolved || {}; - target = { ...target, ...transitionEnd }; - for (const key in target) { - const value = resolveFinalValueInKeyframes(target[key]); - setMotionValue(visualElement, key, value); - } - } - - const isMotionValue = (value) => Boolean(value && value.getVelocity); - - function isWillChangeMotionValue(value) { - return Boolean(isMotionValue(value) && value.add); - } - - function addValueToWillChange(visualElement, key) { - const willChange = visualElement.getValue("willChange"); - /** - * It could be that a user has set willChange to a regular MotionValue, - * in which case we can't add the value to it. - */ - if (isWillChangeMotionValue(willChange)) { - return willChange.add(key); - } - else if (!willChange && MotionGlobalConfig.WillChange) { - const newWillChange = new MotionGlobalConfig.WillChange("auto"); - visualElement.addValue("willChange", newWillChange); - newWillChange.add(key); - } - } - - function camelToDash(str) { - return str.replace(/([A-Z])/g, (match) => `-${match.toLowerCase()}`); - } - - const optimizedAppearDataId = "framerAppearId"; - const optimizedAppearDataAttribute = "data-" + camelToDash(optimizedAppearDataId); - - function getOptimisedAppearId(visualElement) { - return visualElement.props[optimizedAppearDataAttribute]; - } - - /** - * Decide whether we should block this animation. Previously, we achieved this - * just by checking whether the key was listed in protectedKeys, but this - * posed problems if an animation was triggered by afterChildren and protectedKeys - * had been set to true in the meantime. - */ - function shouldBlockAnimation({ protectedKeys, needsAnimating }, key) { - const shouldBlock = protectedKeys.hasOwnProperty(key) && needsAnimating[key] !== true; - needsAnimating[key] = false; - return shouldBlock; - } - function animateTarget(visualElement, targetAndTransition, { delay = 0, transitionOverride, type } = {}) { - let { transition, transitionEnd, ...target } = targetAndTransition; - const defaultTransition = visualElement.getDefaultTransition(); - transition = transition - ? resolveTransition(transition, defaultTransition) - : defaultTransition; - const reduceMotion = transition?.reduceMotion; - const skipAnimations = transition?.skipAnimations; - if (transitionOverride) - transition = transitionOverride; - const animations = []; - const animationTypeState = type && - visualElement.animationState && - visualElement.animationState.getState()[type]; - const path = transition?.path; - if (path) { - // path mutates `target` to claim x/y; loop below skips them. - path.animateVisualElement(visualElement, target, transition, delay, animations); - } - for (const key in target) { - const value = visualElement.getValue(key, visualElement.latestValues[key] ?? null); - const valueTarget = target[key]; - if (valueTarget === undefined || - (animationTypeState && - shouldBlockAnimation(animationTypeState, key))) { - continue; - } - const valueTransition = { - delay, - ...getValueTransition$1(transition || {}, key), - }; - if (skipAnimations) - valueTransition.skipAnimations = true; - /** - * If the value is already at the defined target, skip the animation. - * We still re-assert the value via frame.update to take precedence - * over any stale transitionEnd callbacks from previous animations. - */ - const currentValue = value.get(); - if (currentValue !== undefined && - !value.isAnimating() && - !Array.isArray(valueTarget) && - valueTarget === currentValue && - !valueTransition.velocity) { - frame.update(() => value.set(valueTarget)); - continue; - } - /** - * If this is the first time a value is being animated, check - * to see if we're handling off from an existing animation. - */ - let isHandoff = false; - if (window.MotionHandoffAnimation) { - const appearId = getOptimisedAppearId(visualElement); - if (appearId) { - const startTime = window.MotionHandoffAnimation(appearId, key, frame); - if (startTime !== null) { - valueTransition.startTime = startTime; - isHandoff = true; - } - } - } - addValueToWillChange(visualElement, key); - const shouldReduceMotion = reduceMotion ?? visualElement.shouldReduceMotion; - value.start(animateMotionValue(key, value, valueTarget, shouldReduceMotion && positionalKeys.has(key) - ? { type: false } - : valueTransition, visualElement, isHandoff)); - const animation = value.animation; - if (animation) { - animations.push(animation); - } - } - if (transitionEnd) { - const applyTransitionEnd = () => frame.update(() => { - transitionEnd && setTarget(visualElement, transitionEnd); - }); - if (animations.length) { - Promise.all(animations).then(applyTransitionEnd); - } - else { - applyTransitionEnd(); - } - } - return animations; - } - - function animateVariant(visualElement, variant, options = {}) { - const resolved = resolveVariant(visualElement, variant, options.type === "exit" - ? visualElement.presenceContext?.custom - : undefined); - let { transition = visualElement.getDefaultTransition() || {} } = resolved || {}; - if (options.transitionOverride) { - transition = options.transitionOverride; - } - /** - * If we have a variant, create a callback that runs it as an animation. - * Otherwise, we resolve a Promise immediately for a composable no-op. - */ - const getAnimation = resolved - ? () => Promise.all(animateTarget(visualElement, resolved, options)) - : () => Promise.resolve(); - /** - * If we have children, create a callback that runs all their animations. - * Otherwise, we resolve a Promise immediately for a composable no-op. - */ - const getChildAnimations = visualElement.variantChildren && visualElement.variantChildren.size - ? (forwardDelay = 0) => { - const { delayChildren = 0, staggerChildren, staggerDirection, } = transition; - return animateChildren(visualElement, variant, forwardDelay, delayChildren, staggerChildren, staggerDirection, options); - } - : () => Promise.resolve(); - /** - * If the transition explicitly defines a "when" option, we need to resolve either - * this animation or all children animations before playing the other. - */ - const { when } = transition; - if (when) { - const [first, last] = when === "beforeChildren" - ? [getAnimation, getChildAnimations] - : [getChildAnimations, getAnimation]; - return first().then(() => last()); - } - else { - return Promise.all([getAnimation(), getChildAnimations(options.delay)]); - } - } - function animateChildren(visualElement, variant, delay = 0, delayChildren = 0, staggerChildren = 0, staggerDirection = 1, options) { - const animations = []; - for (const child of visualElement.variantChildren) { - child.notify("AnimationStart", variant); - animations.push(animateVariant(child, variant, { - ...options, - delay: delay + - (typeof delayChildren === "function" ? 0 : delayChildren) + - calcChildStagger(visualElement.variantChildren, child, delayChildren, staggerChildren, staggerDirection), - }).then(() => child.notify("AnimationComplete", variant))); - } - return Promise.all(animations); - } - - function animateVisualElement(visualElement, definition, options = {}) { - visualElement.notify("AnimationStart", definition); - let animation; - if (Array.isArray(definition)) { - const animations = definition.map((variant) => animateVariant(visualElement, variant, options)); - animation = Promise.all(animations); - } - else if (typeof definition === "string") { - animation = animateVariant(visualElement, definition, options); - } - else { - const resolvedDefinition = typeof definition === "function" - ? resolveVariant(visualElement, definition, options.custom) - : definition; - animation = Promise.all(animateTarget(visualElement, resolvedDefinition, options)); - } - return animation.then(() => { - visualElement.notify("AnimationComplete", definition); - }); - } - - /** - * ValueType for "auto" - */ - const auto = { - test: (v) => v === "auto", - parse: (v) => v, - }; - - /** - * Tests a provided value against a ValueType - */ - const testValueType = (v) => (type) => type.test(v); - - /** - * A list of value types commonly used for dimensions - */ - const dimensionValueTypes = [number, px, percent, degrees, vw, vh, auto]; - /** - * Tests a dimensional value against the list of dimension ValueTypes - */ - const findDimensionValueType = (v) => dimensionValueTypes.find(testValueType(v)); - - function isNone(value) { - if (typeof value === "number") { - return value === 0; - } - else if (value !== null) { - return value === "none" || value === "0" || isZeroValueString(value); - } - else { - return true; - } - } - - /** - * Properties that should default to 1 or 100% - */ - const maxDefaults = new Set(["brightness", "contrast", "saturate", "opacity"]); - function applyDefaultFilter(v) { - const [name, value] = v.slice(0, -1).split("("); - if (name === "drop-shadow") - return v; - const [number] = value.match(floatRegex) || []; - if (!number) - return v; - const unit = value.replace(number, ""); - let defaultValue = maxDefaults.has(name) ? 1 : 0; - if (number !== value) - defaultValue *= 100; - return name + "(" + defaultValue + unit + ")"; - } - const functionRegex = /\b([a-z-]*)\(.*?\)/gu; - const filter = { - ...complex, - getAnimatableNone: (v) => { - const functions = v.match(functionRegex); - return functions ? functions.map(applyDefaultFilter).join(" ") : v; - }, - }; - - const mask = { - ...complex, - getAnimatableNone: (v) => { - const parsed = complex.parse(v); - const transformer = complex.createTransformer(v); - return transformer(parsed.map((v) => typeof v === "number" ? 0 : typeof v === "object" ? { ...v, alpha: 1 } : v)); - }, - }; - - const int = { - ...number, - transform: Math.round, - }; - - const transformValueTypes = { - rotate: degrees, - /** - * Internal channel for `transition.path` orientToPath. Composed onto - * `rotate` at the transform-build sites so the user's `rotate` is - * never read or overwritten. Not part of `transformPropOrder`. - */ - pathRotation: degrees, - rotateX: degrees, - rotateY: degrees, - rotateZ: degrees, - scale, - scaleX: scale, - scaleY: scale, - scaleZ: scale, - skew: degrees, - skewX: degrees, - skewY: degrees, - distance: px, - translateX: px, - translateY: px, - translateZ: px, - x: px, - y: px, - z: px, - perspective: px, - transformPerspective: px, - opacity: alpha, - originX: progressPercentage, - originY: progressPercentage, - originZ: px, - }; - - const numberValueTypes = { - // Border props - borderWidth: px, - borderTopWidth: px, - borderRightWidth: px, - borderBottomWidth: px, - borderLeftWidth: px, - borderRadius: px, - borderTopLeftRadius: px, - borderTopRightRadius: px, - borderBottomRightRadius: px, - borderBottomLeftRadius: px, - // Positioning props - width: px, - maxWidth: px, - height: px, - maxHeight: px, - top: px, - right: px, - bottom: px, - left: px, - inset: px, - insetBlock: px, - insetBlockStart: px, - insetBlockEnd: px, - insetInline: px, - insetInlineStart: px, - insetInlineEnd: px, - // Spacing props - padding: px, - paddingTop: px, - paddingRight: px, - paddingBottom: px, - paddingLeft: px, - paddingBlock: px, - paddingBlockStart: px, - paddingBlockEnd: px, - paddingInline: px, - paddingInlineStart: px, - paddingInlineEnd: px, - margin: px, - marginTop: px, - marginRight: px, - marginBottom: px, - marginLeft: px, - marginBlock: px, - marginBlockStart: px, - marginBlockEnd: px, - marginInline: px, - marginInlineStart: px, - marginInlineEnd: px, - // Typography - fontSize: px, - // Misc - backgroundPositionX: px, - backgroundPositionY: px, - ...transformValueTypes, - zIndex: int, - // SVG - fillOpacity: alpha, - strokeOpacity: alpha, - numOctaves: int, - }; - - /** - * A map of default value types for common values - */ - const defaultValueTypes = { - ...numberValueTypes, - // Color props - color, - backgroundColor: color, - outlineColor: color, - fill: color, - stroke: color, - // Border props - borderColor: color, - borderTopColor: color, - borderRightColor: color, - borderBottomColor: color, - borderLeftColor: color, - filter, - WebkitFilter: filter, - mask, - WebkitMask: mask, - }; - /** - * Gets the default ValueType for the provided value key - */ - const getDefaultValueType = (key) => defaultValueTypes[key]; - - const customTypes = /*@__PURE__*/ new Set([filter, mask]); - function getAnimatableNone(key, value) { - let defaultValueType = getDefaultValueType(key); - if (!customTypes.has(defaultValueType)) - defaultValueType = complex; - // If value is not recognised as animatable, ie "none", create an animatable version origin based on the target - return defaultValueType.getAnimatableNone - ? defaultValueType.getAnimatableNone(value) - : undefined; - } - - /** - * If we encounter keyframes like "none" or "0" and we also have keyframes like - * "#fff" or "200px 200px" we want to find a keyframe to serve as a template for - * the "none" keyframes. In this case "#fff" or "200px 200px" - then these get turned into - * zero equivalents, i.e. "#fff0" or "0px 0px". - */ - const invalidTemplates = new Set(["auto", "none", "0"]); - function makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, name) { - let i = 0; - let animatableTemplate = undefined; - while (i < unresolvedKeyframes.length && !animatableTemplate) { - const keyframe = unresolvedKeyframes[i]; - if (typeof keyframe === "string" && - !invalidTemplates.has(keyframe) && - analyseComplexValue(keyframe).values.length) { - animatableTemplate = unresolvedKeyframes[i]; - } - i++; - } - if (animatableTemplate && name) { - for (const noneIndex of noneKeyframeIndexes) { - unresolvedKeyframes[noneIndex] = getAnimatableNone(name, animatableTemplate); - } - } - } - - class DOMKeyframesResolver extends KeyframeResolver { - constructor(unresolvedKeyframes, onComplete, name, motionValue, element) { - super(unresolvedKeyframes, onComplete, name, motionValue, element, true); - } - readKeyframes() { - const { unresolvedKeyframes, element, name } = this; - if (!element || !element.current) - return; - super.readKeyframes(); - /** - * If any keyframe is a CSS variable, we need to find its value by sampling the element - */ - for (let i = 0; i < unresolvedKeyframes.length; i++) { - let keyframe = unresolvedKeyframes[i]; - if (typeof keyframe === "string") { - keyframe = keyframe.trim(); - if (isCSSVariableToken(keyframe)) { - const resolved = getVariableValue(keyframe, element.current); - if (resolved !== undefined) { - unresolvedKeyframes[i] = resolved; - } - if (i === unresolvedKeyframes.length - 1) { - this.finalKeyframe = keyframe; - } - } - } - } - /** - * Resolve "none" values. We do this potentially twice - once before and once after measuring keyframes. - * This could be seen as inefficient but it's a trade-off to avoid measurements in more situations, which - * have a far bigger performance impact. - */ - this.resolveNoneKeyframes(); - /** - * Check to see if unit type has changed. If so schedule jobs that will - * temporarily set styles to the destination keyframes. - * Skip if we have more than two keyframes or this isn't a positional value. - * TODO: We can throw if there are multiple keyframes and the value type changes. - */ - if (!positionalKeys.has(name) || unresolvedKeyframes.length !== 2) { - return; - } - const [origin, target] = unresolvedKeyframes; - const originType = findDimensionValueType(origin); - const targetType = findDimensionValueType(target); - /** - * If one keyframe contains embedded CSS variables (e.g. in calc()) and the other - * doesn't, we need to measure to convert to pixels. This handles GitHub issue #3410. - */ - const originHasVar = containsCSSVariable(origin); - const targetHasVar = containsCSSVariable(target); - if (originHasVar !== targetHasVar && positionalValues[name]) { - this.needsMeasurement = true; - return; - } - /** - * Either we don't recognise these value types or we can animate between them. - */ - if (originType === targetType) - return; - /** - * If both values are numbers or pixels, we can animate between them by - * converting them to numbers. - */ - if (isNumOrPxType(originType) && isNumOrPxType(targetType)) { - for (let i = 0; i < unresolvedKeyframes.length; i++) { - const value = unresolvedKeyframes[i]; - if (typeof value === "string") { - unresolvedKeyframes[i] = parseFloat(value); - } - } - } - else if (positionalValues[name]) { - /** - * Else, the only way to resolve this is by measuring the element. - */ - this.needsMeasurement = true; - } - } - resolveNoneKeyframes() { - const { unresolvedKeyframes, name } = this; - const noneKeyframeIndexes = []; - for (let i = 0; i < unresolvedKeyframes.length; i++) { - if (unresolvedKeyframes[i] === null || - isNone(unresolvedKeyframes[i])) { - noneKeyframeIndexes.push(i); - } - } - if (noneKeyframeIndexes.length) { - makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, name); - } - } - measureInitialState() { - const { element, unresolvedKeyframes, name } = this; - if (!element || !element.current) - return; - if (name === "height") { - this.suspendedScrollY = window.pageYOffset; - } - this.measuredOrigin = positionalValues[name](element.measureViewportBox(), window.getComputedStyle(element.current)); - unresolvedKeyframes[0] = this.measuredOrigin; - // Set final key frame to measure after next render - const measureKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1]; - if (measureKeyframe !== undefined) { - element.getValue(name, measureKeyframe).jump(measureKeyframe, false); - } - } - measureEndState() { - const { element, name, unresolvedKeyframes } = this; - if (!element || !element.current) - return; - const value = element.getValue(name); - value && value.jump(this.measuredOrigin, false); - const finalKeyframeIndex = unresolvedKeyframes.length - 1; - const finalKeyframe = unresolvedKeyframes[finalKeyframeIndex]; - unresolvedKeyframes[finalKeyframeIndex] = positionalValues[name](element.measureViewportBox(), window.getComputedStyle(element.current)); - if (finalKeyframe !== null && this.finalKeyframe === undefined) { - this.finalKeyframe = finalKeyframe; - } - // If we removed transform values, reapply them before the next render - if (this.removedTransforms?.length) { - this.removedTransforms.forEach(([unsetTransformName, unsetTransformValue]) => { - element - .getValue(unsetTransformName) - .set(unsetTransformValue); - }); - } - this.resolveNoneKeyframes(); - } - } - - /** - * The four corner-radius longhands. Shared so the projection mixer, scale - * corrector, WAAPI px-value set and view-transition crop pass don't each carry - * their own copy. Order is irrelevant - every consumer mixes/corrects/animates - * each corner independently. - */ - const cornerRadiusProps = [ - "borderTopLeftRadius", - "borderTopRightRadius", - "borderBottomRightRadius", - "borderBottomLeftRadius", - ]; - - const pxValues = new Set([ - // Border props - "borderWidth", - "borderTopWidth", - "borderRightWidth", - "borderBottomWidth", - "borderLeftWidth", - "borderRadius", - ...cornerRadiusProps, - // Positioning props - "width", - "maxWidth", - "height", - "maxHeight", - "top", - "right", - "bottom", - "left", - "inset", - "insetBlock", - "insetBlockStart", - "insetBlockEnd", - "insetInline", - "insetInlineStart", - "insetInlineEnd", - // Spacing props - "padding", - "paddingTop", - "paddingRight", - "paddingBottom", - "paddingLeft", - "paddingBlock", - "paddingBlockStart", - "paddingBlockEnd", - "paddingInline", - "paddingInlineStart", - "paddingInlineEnd", - "margin", - "marginTop", - "marginRight", - "marginBottom", - "marginLeft", - "marginBlock", - "marginBlockStart", - "marginBlockEnd", - "marginInline", - "marginInlineStart", - "marginInlineEnd", - // Typography - "fontSize", - // Misc - "backgroundPositionX", - "backgroundPositionY", - ]); - - function applyPxDefaults(keyframes, name) { - for (let i = 0; i < keyframes.length; i++) { - if (typeof keyframes[i] === "number" && pxValues.has(name)) { - keyframes[i] = keyframes[i] + "px"; - } - } - } - - function isWaapiSupportedEasing(easing) { - return Boolean((typeof easing === "function" && supportsLinearEasing()) || - !easing || - (typeof easing === "string" && - (easing in supportedWaapiEasing || supportsLinearEasing())) || - isBezierDefinition(easing) || - (Array.isArray(easing) && easing.every(isWaapiSupportedEasing))); - } - - const supportsPartialKeyframes = /*@__PURE__*/ memo(() => { - try { - document.createElement("div").animate({ opacity: [1] }); - } - catch (e) { - return false; - } - return true; - }); - - function resolveElements(elementOrSelector, scope, selectorCache) { - if (elementOrSelector == null) { - return []; - } - if (elementOrSelector instanceof EventTarget) { - return [elementOrSelector]; - } - else if (typeof elementOrSelector === "string") { - let root = document; - if (scope) { - root = scope.current; - } - const elements = selectorCache?.[elementOrSelector] ?? - root.querySelectorAll(elementOrSelector); - return elements ? Array.from(elements) : []; - } - return Array.from(elementOrSelector).filter((element) => element != null); - } - - function createSelectorEffect(subjectEffect) { - return (subject, values) => { - const elements = resolveElements(subject); - const subscriptions = []; - for (const element of elements) { - const remove = subjectEffect(element, values); - subscriptions.push(remove); - } - return () => { - for (const remove of subscriptions) - remove(); - }; - }; - } - - /** - * Provided a value and a ValueType, returns the value as that value type. - */ - const getValueAsType = (value, type) => { - return type && typeof value === "number" - ? type.transform(value) - : value; - }; - - class MotionValueState { - constructor() { - this.latest = {}; - this.values = new Map(); - } - set(name, value, render, computed, useDefaultValueType = true) { - const existingValue = this.values.get(name); - if (existingValue) { - existingValue.onRemove(); - } - const onChange = () => { - const v = value.get(); - if (useDefaultValueType) { - this.latest[name] = getValueAsType(v, numberValueTypes[name]); - } - else { - this.latest[name] = v; - } - render && frame.render(render); - }; - onChange(); - const cancelOnChange = value.on("change", onChange); - computed && value.addDependent(computed); - const remove = () => { - cancelOnChange(); - render && cancelFrame(render); - this.values.delete(name); - computed && value.removeDependent(computed); - }; - this.values.set(name, { value, onRemove: remove }); - return remove; - } - get(name) { - return this.values.get(name)?.value; - } - } - - function createEffect(addValue) { - const stateCache = new WeakMap(); - return (subject, values) => { - const state = stateCache.get(subject) ?? new MotionValueState(); - stateCache.set(subject, state); - const subscriptions = []; - for (const key in values) { - const value = values[key]; - const remove = addValue(subject, state, key, value); - subscriptions.push(remove); - } - return () => { - for (const cancel of subscriptions) - cancel(); - }; - }; - } - - function canSetAsProperty(element, name) { - if (!(name in element)) - return false; - const descriptor = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(element), name) || - Object.getOwnPropertyDescriptor(element, name); - // Check if it has a setter - return descriptor && typeof descriptor.set === "function"; - } - const addAttrValue = (element, state, key, value) => { - const isProp = canSetAsProperty(element, key); - const name = isProp - ? key - : key.startsWith("data") || key.startsWith("aria") - ? camelToDash(key) - : key; - /** - * Set attribute directly via property if available - */ - const render = isProp - ? () => { - element[name] = state.latest[key]; - } - : () => { - const v = state.latest[key]; - if (v === null || v === undefined) { - element.removeAttribute(name); - } - else { - element.setAttribute(name, String(v)); - } - }; - return state.set(key, value, render); - }; - const attrEffect = /*@__PURE__*/ createSelectorEffect( - /*@__PURE__*/ createEffect(addAttrValue)); - - const propEffect = /*@__PURE__*/ createEffect((subject, state, key, value) => { - return state.set(key, value, () => { - subject[key] = state.latest[key]; - }, undefined, false); - }); - - /** - * Checks if an element is an HTML element in a way - * that works across iframes - */ - function isHTMLElement(element) { - return (isObject(element) && - "offsetHeight" in element && - !("ownerSVGElement" in element)); - } - - const translateAlias$1 = { - x: "translateX", - y: "translateY", - z: "translateZ", - transformPerspective: "perspective", - }; - function buildTransform$1(state) { - let transform = ""; - let transformIsDefault = true; - /** - * Loop over all possible transforms in order, adding the ones that - * are present to the transform string. - */ - for (let i = 0; i < transformPropOrder.length; i++) { - const key = transformPropOrder[i]; - const value = state.latest[key]; - if (value === undefined) - continue; - let valueIsDefault = true; - if (typeof value === "number") { - valueIsDefault = value === (key.startsWith("scale") ? 1 : 0); - } - else { - const parsed = parseFloat(value); - valueIsDefault = key.startsWith("scale") ? parsed === 1 : parsed === 0; - } - if (!valueIsDefault) { - transformIsDefault = false; - const transformName = translateAlias$1[key] || key; - transform += `${transformName}(${value}) `; - } - } - // See build-transform.ts: additive `rotate()` so user `rotate` isn't - // clobbered. Not a `transformPropOrder` slot. - const pathRotation = state.latest.pathRotation; - if (pathRotation) { - transformIsDefault = false; - transform += `rotate(${typeof pathRotation === "number" - ? `${pathRotation}deg` - : pathRotation}) `; - } - return transformIsDefault ? "none" : transform.trim(); - } - - const originProps = new Set(["originX", "originY", "originZ"]); - const addStyleValue = (element, state, key, value) => { - let render = undefined; - let computed = undefined; - if (transformProps.has(key)) { - if (!state.get("transform")) { - // If this is an HTML element, we need to set the transform-box to fill-box - // to normalise the transform relative to the element's bounding box - if (!isHTMLElement(element) && !state.get("transformBox")) { - addStyleValue(element, state, "transformBox", new MotionValue("fill-box")); - } - state.set("transform", new MotionValue("none"), () => { - element.style.transform = buildTransform$1(state); - }); - } - computed = state.get("transform"); - } - else if (originProps.has(key)) { - if (!state.get("transformOrigin")) { - state.set("transformOrigin", new MotionValue(""), () => { - const originX = state.latest.originX ?? "50%"; - const originY = state.latest.originY ?? "50%"; - const originZ = state.latest.originZ ?? 0; - element.style.transformOrigin = `${originX} ${originY} ${originZ}`; - }); - } - computed = state.get("transformOrigin"); - } - else if (isCSSVar(key)) { - render = () => { - element.style.setProperty(key, state.latest[key]); - }; - } - else { - render = () => { - element.style[key] = state.latest[key]; - }; - } - return state.set(key, value, render, computed); - }; - const styleEffect = /*@__PURE__*/ createSelectorEffect( - /*@__PURE__*/ createEffect(addStyleValue)); - - function addSVGPathValue(element, state, key, value) { - frame.render(() => element.setAttribute("pathLength", "1")); - if (key === "pathOffset") { - return state.set(key, value, () => { - // Use unitless value to avoid Safari zoom bug - const offset = state.latest[key]; - element.setAttribute("stroke-dashoffset", `${-offset}`); - }); - } - else { - if (!state.get("stroke-dasharray")) { - state.set("stroke-dasharray", new MotionValue("1 1"), () => { - const { pathLength = 1, pathSpacing } = state.latest; - // Use unitless values to avoid Safari zoom bug - element.setAttribute("stroke-dasharray", `${pathLength} ${pathSpacing ?? 1 - Number(pathLength)}`); - }); - } - return state.set(key, value, undefined, state.get("stroke-dasharray")); - } - } - const addSVGValue = (element, state, key, value) => { - if (key.startsWith("path")) { - return addSVGPathValue(element, state, key, value); - } - else if (key.startsWith("attr")) { - return addAttrValue(element, state, convertAttrKey(key), value); - } - const handler = key in element.style ? addStyleValue : addAttrValue; - return handler(element, state, key, value); - }; - const svgEffect = /*@__PURE__*/ createSelectorEffect( - /*@__PURE__*/ createEffect(addSVGValue)); - function convertAttrKey(key) { - return key.replace(/^attr([A-Z])/, (_, firstChar) => firstChar.toLowerCase()); - } - - const { schedule: microtask, cancel: cancelMicrotask } = - /* @__PURE__ */ createRenderBatcher(queueMicrotask, false); - - const isDragging = { - x: false, - y: false, - }; - function isDragActive() { - return isDragging.x || isDragging.y; - } - - function setDragLock(axis) { - if (axis === "x" || axis === "y") { - if (isDragging[axis]) { - return null; - } - else { - isDragging[axis] = true; - return () => { - isDragging[axis] = false; - }; - } - } - else { - if (isDragging.x || isDragging.y) { - return null; - } - else { - isDragging.x = isDragging.y = true; - return () => { - isDragging.x = isDragging.y = false; - }; - } - } - } - - function setupGesture(elementOrSelector, options) { - const elements = resolveElements(elementOrSelector); - const gestureAbortController = new AbortController(); - const eventOptions = { - passive: true, - ...options, - signal: gestureAbortController.signal, - }; - const cancel = () => gestureAbortController.abort(); - return [elements, eventOptions, cancel]; - } - - function isValidHover(event) { - return !(event.pointerType === "touch" || isDragActive()); - } - /** - * Create a hover gesture. hover() is different to .addEventListener("pointerenter") - * in that it has an easier syntax, filters out polyfilled touch events, interoperates - * with drag gestures, and automatically removes the "pointerennd" event listener when the hover ends. - * - * @public - */ - function hover(elementOrSelector, onHoverStart, options = {}) { - const [elements, eventOptions, cancel] = setupGesture(elementOrSelector, options); - elements.forEach((element) => { - let isPressed = false; - let deferredHoverEnd = false; - let hoverEndCallback; - const removePointerLeave = () => { - element.removeEventListener("pointerleave", onPointerLeave); - }; - const endHover = (event) => { - if (hoverEndCallback) { - hoverEndCallback(event); - hoverEndCallback = undefined; - } - removePointerLeave(); - }; - const onPointerUp = (event) => { - isPressed = false; - window.removeEventListener("pointerup", onPointerUp); - window.removeEventListener("pointercancel", onPointerUp); - if (deferredHoverEnd) { - deferredHoverEnd = false; - endHover(event); - } - }; - const onPointerDown = () => { - isPressed = true; - window.addEventListener("pointerup", onPointerUp, eventOptions); - window.addEventListener("pointercancel", onPointerUp, eventOptions); - }; - const onPointerLeave = (leaveEvent) => { - if (leaveEvent.pointerType === "touch") - return; - if (isPressed) { - deferredHoverEnd = true; - return; - } - endHover(leaveEvent); - }; - const onPointerEnter = (enterEvent) => { - if (!isValidHover(enterEvent)) - return; - deferredHoverEnd = false; - const onHoverEnd = onHoverStart(element, enterEvent); - if (typeof onHoverEnd !== "function") - return; - hoverEndCallback = onHoverEnd; - element.addEventListener("pointerleave", onPointerLeave, eventOptions); - }; - element.addEventListener("pointerenter", onPointerEnter, eventOptions); - element.addEventListener("pointerdown", onPointerDown, eventOptions); - }); - return cancel; - } - - /** - * Recursively traverse up the tree to check whether the provided child node - * is the parent or a descendant of it. - * - * @param parent - Element to find - * @param child - Element to test against parent - */ - const isNodeOrChild = (parent, child) => { - if (!child) { - return false; - } - else if (parent === child) { - return true; - } - else { - return isNodeOrChild(parent, child.parentElement); - } - }; - - const isPrimaryPointer = (event) => { - if (event.pointerType === "mouse") { - return typeof event.button !== "number" || event.button <= 0; - } - else { - /** - * isPrimary is true for all mice buttons, whereas every touch point - * is regarded as its own input. So subsequent concurrent touch points - * will be false. - * - * Specifically match against false here as incomplete versions of - * PointerEvents in very old browser might have it set as undefined. - */ - return event.isPrimary !== false; - } - }; - - const keyboardAccessibleElements = new Set([ - "BUTTON", - "INPUT", - "SELECT", - "TEXTAREA", - "A", - ]); - /** - * Checks if an element is natively keyboard accessible (focusable). - * Used by the press gesture to determine if we need to add tabIndex. - */ - function isElementKeyboardAccessible(element) { - return (keyboardAccessibleElements.has(element.tagName) || - element.isContentEditable === true); - } - const textInputElements = new Set(["INPUT", "SELECT", "TEXTAREA"]); - /** - * Checks if an element has text selection or direct interaction behavior - * that should block drag gestures from starting. - * - * This specifically targets form controls where the user might want to select - * text or interact with the control (e.g., sliders, dropdowns). - * - * Buttons and links are NOT included because they don't have click-and-move - * actions of their own - they only respond to click events, so dragging - * should still work when initiated from these elements. - */ - function isElementTextInput(element) { - return (textInputElements.has(element.tagName) || - element.isContentEditable === true); - } - - const isPressing = new WeakSet(); - - /** - * Filter out events that are not "Enter" keys. - */ - function filterEvents(callback) { - return (event) => { - if (event.key !== "Enter") - return; - callback(event); - }; - } - function firePointerEvent(target, type) { - target.dispatchEvent(new PointerEvent("pointer" + type, { isPrimary: true, bubbles: true })); - } - const enableKeyboardPress = (focusEvent, eventOptions) => { - const element = focusEvent.currentTarget; - if (!element) - return; - const handleKeydown = filterEvents(() => { - if (isPressing.has(element)) - return; - firePointerEvent(element, "down"); - const handleKeyup = filterEvents(() => { - firePointerEvent(element, "up"); - }); - const handleBlur = () => firePointerEvent(element, "cancel"); - element.addEventListener("keyup", handleKeyup, eventOptions); - element.addEventListener("blur", handleBlur, eventOptions); - }); - element.addEventListener("keydown", handleKeydown, eventOptions); - /** - * Add an event listener that fires on blur to remove the keydown events. - */ - element.addEventListener("blur", () => element.removeEventListener("keydown", handleKeydown), eventOptions); - }; - - /** - * Filter out events that are not primary pointer events, or are triggering - * while a Motion gesture is active. - */ - function isValidPressEvent(event) { - return isPrimaryPointer(event) && !isDragActive(); - } - const claimedPointerDownEvents = new WeakSet(); - /** - * Create a press gesture. - * - * Press is different to `"pointerdown"`, `"pointerup"` in that it - * automatically filters out secondary pointer events like right - * click and multitouch. - * - * It also adds accessibility support for keyboards, where - * an element with a press gesture will receive focus and - * trigger on Enter `"keydown"` and `"keyup"` events. - * - * This is different to a browser's `"click"` event, which does - * respond to keyboards but only for the `"click"` itself, rather - * than the press start and end/cancel. The element also needs - * to be focusable for this to work, whereas a press gesture will - * make an element focusable by default. - * - * @public - */ - function press(targetOrSelector, onPressStart, options = {}) { - const [targets, eventOptions, cancelEvents] = setupGesture(targetOrSelector, options); - const startPress = (startEvent) => { - const target = startEvent.currentTarget; - if (!isValidPressEvent(startEvent)) - return; - if (claimedPointerDownEvents.has(startEvent)) - return; - isPressing.add(target); - if (options.stopPropagation) { - claimedPointerDownEvents.add(startEvent); - } - const onPressEnd = onPressStart(target, startEvent); - /** - * End listeners run in the capture phase so a descendant calling - * stopPropagation() in its own pointerup handler can't prevent the - * press gesture from ending. This also keeps the gesture-end - * ordering consistent with the drag gesture. See #2794. - */ - const endEventOptions = { ...eventOptions, capture: true }; - const onPointerEnd = (endEvent, success) => { - window.removeEventListener("pointerup", onPointerUp, endEventOptions); - window.removeEventListener("pointercancel", onPointerCancel, endEventOptions); - if (isPressing.has(target)) { - isPressing.delete(target); - } - if (!isValidPressEvent(endEvent)) { - return; - } - if (typeof onPressEnd === "function") { - onPressEnd(endEvent, { success }); - } - }; - const onPointerUp = (upEvent) => { - onPointerEnd(upEvent, target === window || - target === document || - options.useGlobalTarget || - isNodeOrChild(target, upEvent.target)); - }; - const onPointerCancel = (cancelEvent) => { - onPointerEnd(cancelEvent, false); - }; - window.addEventListener("pointerup", onPointerUp, endEventOptions); - window.addEventListener("pointercancel", onPointerCancel, endEventOptions); - }; - targets.forEach((target) => { - const pointerDownTarget = options.useGlobalTarget ? window : target; - pointerDownTarget.addEventListener("pointerdown", startPress, eventOptions); - if (isHTMLElement(target)) { - target.addEventListener("focus", (event) => enableKeyboardPress(event, eventOptions)); - if (!isElementKeyboardAccessible(target) && - !target.hasAttribute("tabindex")) { - target.tabIndex = 0; - } - } - }); - return cancelEvents; - } - - function getComputedStyle$2(element, name) { - const computedStyle = window.getComputedStyle(element); - return isCSSVar(name) - ? computedStyle.getPropertyValue(name) - : computedStyle[name]; - } - - /** - * Checks if an element is an SVG element in a way - * that works across iframes - */ - function isSVGElement(element) { - return isObject(element) && "ownerSVGElement" in element; - } - - const resizeHandlers = new WeakMap(); - let observer; - const getSize = (borderBoxAxis, svgAxis, htmlAxis) => (target, borderBoxSize) => { - if (borderBoxSize && borderBoxSize[0]) { - return borderBoxSize[0][(borderBoxAxis + "Size")]; - } - else if (isSVGElement(target) && "getBBox" in target) { - return target.getBBox()[svgAxis]; - } - else { - return target[htmlAxis]; - } - }; - const getWidth = /*@__PURE__*/ getSize("inline", "width", "offsetWidth"); - const getHeight = /*@__PURE__*/ getSize("block", "height", "offsetHeight"); - function notifyTarget({ target, borderBoxSize }) { - resizeHandlers.get(target)?.forEach((handler) => { - handler(target, { - get width() { - return getWidth(target, borderBoxSize); - }, - get height() { - return getHeight(target, borderBoxSize); - }, - }); - }); - } - function notifyAll(entries) { - entries.forEach(notifyTarget); - } - function createResizeObserver() { - if (typeof ResizeObserver === "undefined") - return; - observer = new ResizeObserver(notifyAll); - } - function resizeElement(target, handler) { - if (!observer) - createResizeObserver(); - const elements = resolveElements(target); - elements.forEach((element) => { - let elementHandlers = resizeHandlers.get(element); - if (!elementHandlers) { - elementHandlers = new Set(); - resizeHandlers.set(element, elementHandlers); - } - elementHandlers.add(handler); - observer?.observe(element); - }); - return () => { - elements.forEach((element) => { - const elementHandlers = resizeHandlers.get(element); - elementHandlers?.delete(handler); - if (!elementHandlers?.size) { - observer?.unobserve(element); - } - }); - }; - } - - const windowCallbacks = new Set(); - let windowResizeHandler; - function createWindowResizeHandler() { - windowResizeHandler = () => { - const info = { - get width() { - return window.innerWidth; - }, - get height() { - return window.innerHeight; - }, - }; - windowCallbacks.forEach((callback) => callback(info)); - }; - window.addEventListener("resize", windowResizeHandler); - } - function resizeWindow(callback) { - windowCallbacks.add(callback); - if (!windowResizeHandler) - createWindowResizeHandler(); - return () => { - windowCallbacks.delete(callback); - if (!windowCallbacks.size && - typeof windowResizeHandler === "function") { - window.removeEventListener("resize", windowResizeHandler); - windowResizeHandler = undefined; - } - }; - } - - function resize(a, b) { - return typeof a === "function" ? resizeWindow(a) : resizeElement(a, b); - } - - function observeTimeline(update, timeline) { - let prevProgress; - const onFrame = () => { - const { currentTime } = timeline; - const percentage = currentTime === null ? 0 : currentTime.value; - const progress = percentage / 100; - if (prevProgress !== progress) { - update(progress); - } - prevProgress = progress; - }; - frame.preUpdate(onFrame, true); - return () => cancelFrame(onFrame); - } - - const statsBuffer = { - value: null, - addProjectionMetrics: null, - }; - - function clearStatsBuffer() { - statsBuffer.value = null; - statsBuffer.addProjectionMetrics = null; - } - function recordStats() { - if (statsBuffer.value) { - clearStatsBuffer(); - throw new Error("Stats are already being measured"); - } - const buffer = statsBuffer; - buffer.value = { - layoutProjection: { - nodes: [], - calculatedTargetDeltas: [], - calculatedProjections: [], - }, - }; - buffer.addProjectionMetrics = (metrics) => { - const { layoutProjection } = buffer.value; - layoutProjection.nodes.push(metrics.nodes); - layoutProjection.calculatedTargetDeltas.push(metrics.calculatedTargetDeltas); - layoutProjection.calculatedProjections.push(metrics.calculatedProjections); - }; - } - - /** - * Checks if an element is specifically an SVGSVGElement (the root SVG element) - * in a way that works across iframes - */ - function isSVGSVGElement(element) { - return isSVGElement(element) && element.tagName === "svg"; - } - - function getOriginIndex(from, total) { - if (from === "first") { - return 0; - } - else { - const lastIndex = total - 1; - return from === "last" ? lastIndex : lastIndex / 2; - } - } - function stagger(duration = 0.1, { startDelay = 0, from = 0, ease } = {}) { - return (i, total) => { - const fromIndex = typeof from === "number" ? from : getOriginIndex(from, total); - const distance = Math.abs(fromIndex - i); - let delay = duration * distance; - if (ease) { - const maxDelay = total * duration; - const easingFunction = easingDefinitionToFunction(ease); - delay = easingFunction(delay / maxDelay) * maxDelay; - } - return startDelay + delay; - }; - } - - function transform(...args) { - const useImmediate = !Array.isArray(args[0]); - const argOffset = useImmediate ? 0 : -1; - const inputValue = args[0 + argOffset]; - const inputRange = args[1 + argOffset]; - const outputRange = args[2 + argOffset]; - const options = args[3 + argOffset]; - const interpolator = interpolate(inputRange, outputRange, options); - return useImmediate ? interpolator(inputValue) : interpolator; - } - - /** - * Create a `MotionValue` that animates to its latest value using any transition type. - * Can either be a value or track another `MotionValue`. - * - * ```jsx - * const x = motionValue(0) - * const y = followValue(x, { type: "spring", stiffness: 300 }) - * // or with tween - * const z = followValue(x, { type: "tween", duration: 0.5, ease: "easeOut" }) - * ``` - * - * @param source - Initial value or MotionValue to track - * @param options - Animation transition options - * @returns `MotionValue` - * - * @public - */ - function followValue(source, options) { - const initialValue = isMotionValue(source) ? source.get() : source; - const value = motionValue(initialValue); - attachFollow(value, source, options); - return value; - } - /** - * Attach an animation to a MotionValue that will animate whenever the value changes. - * Similar to attachSpring but supports any transition type (spring, tween, inertia, etc.) - * - * @param value - The MotionValue to animate - * @param source - Initial value or MotionValue to track - * @param options - Animation transition options - * @returns Cleanup function - * - * @public - */ - function attachFollow(value, source, options = {}) { - const initialValue = value.get(); - let activeAnimation = null; - let latestValue = initialValue; - let latestSetter; - const unit = typeof initialValue === "string" - ? initialValue.replace(/[\d.-]/g, "") - : undefined; - const stopAnimation = () => { - if (activeAnimation) { - activeAnimation.stop(); - activeAnimation = null; - } - value.animation = undefined; - }; - const startAnimation = () => { - const currentValue = asNumber$1(value.get()); - const targetValue = asNumber$1(latestValue); - // Don't animate if we're already at the target - if (currentValue === targetValue) { - stopAnimation(); - return; - } - // Use the running animation's analytical velocity for accuracy, - // falling back to the MotionValue's velocity for the initial animation. - // This prevents systematic velocity loss at high frame rates (240hz+). - const velocity = activeAnimation - ? activeAnimation.getGeneratorVelocity() - : value.getVelocity(); - stopAnimation(); - activeAnimation = new JSAnimation({ - keyframes: [currentValue, targetValue], - velocity, - // Default to spring if no type specified (matches useSpring behavior) - type: "spring", - restDelta: 0.001, - restSpeed: 0.01, - ...options, - onUpdate: latestSetter, - }); - }; - // Use a stable function reference so the frame loop Set deduplicates - // multiple calls within the same frame (e.g. rapid mouse events) - const scheduleAnimation = () => { - startAnimation(); - value.animation = activeAnimation ?? undefined; - value["events"].animationStart?.notify(); - activeAnimation?.then(() => { - value.animation = undefined; - value["events"].animationComplete?.notify(); - }); - }; - value.attach((v, set) => { - latestValue = v; - latestSetter = (latest) => set(parseValue(latest, unit)); - frame.postRender(scheduleAnimation); - }, stopAnimation); - if (isMotionValue(source)) { - let skipNextAnimation = options.skipInitialAnimation === true; - const removeSourceOnChange = source.on("change", (v) => { - if (skipNextAnimation) { - skipNextAnimation = false; - value.jump(parseValue(v, unit), false); - } - else { - value.set(parseValue(v, unit)); - } - }); - const removeValueOnDestroy = value.on("destroy", removeSourceOnChange); - return () => { - removeSourceOnChange(); - removeValueOnDestroy(); - }; - } - return stopAnimation; - } - function parseValue(v, unit) { - return unit ? v + unit : v; - } - function asNumber$1(v) { - return typeof v === "number" ? v : parseFloat(v); - } - - function subscribeValue(inputValues, outputValue, getLatest) { - const update = () => outputValue.set(getLatest()); - const scheduleUpdate = () => frame.preRender(update, false, true); - const subscriptions = inputValues.map((v) => v.on("change", scheduleUpdate)); - outputValue.on("destroy", () => { - subscriptions.forEach((unsubscribe) => unsubscribe()); - cancelFrame(update); - }); - } - - /** - * Create a `MotionValue` that transforms the output of other `MotionValue`s by - * passing their latest values through a transform function. - * - * Whenever a `MotionValue` referred to in the provided function is updated, - * it will be re-evaluated. - * - * ```jsx - * const x = motionValue(0) - * const y = transformValue(() => x.get() * 2) // double x - * ``` - * - * @param transformer - A transform function. This function must be pure with no side-effects or conditional statements. - * @returns `MotionValue` - * - * @public - */ - function transformValue(transform) { - const collectedValues = []; - /** - * Open session of collectMotionValues. Any MotionValue that calls get() - * inside transform will be saved into this array. - */ - collectMotionValues.current = collectedValues; - const initialValue = transform(); - collectMotionValues.current = undefined; - const value = motionValue(initialValue); - subscribeValue(collectedValues, value, transform); - return value; - } - - /** - * Create a `MotionValue` that maps the output of another `MotionValue` by - * mapping it from one range of values into another. - * - * @remarks - * - * Given an input range of `[-200, -100, 100, 200]` and an output range of - * `[0, 1, 1, 0]`, the returned `MotionValue` will: - * - * - When provided a value between `-200` and `-100`, will return a value between `0` and `1`. - * - When provided a value between `-100` and `100`, will return `1`. - * - When provided a value between `100` and `200`, will return a value between `1` and `0` - * - * The input range must be a linear series of numbers. The output range - * can be any value type supported by Motion: numbers, colors, shadows, etc. - * - * Every value in the output range must be of the same type and in the same format. - * - * ```jsx - * const x = motionValue(0) - * const xRange = [-200, -100, 100, 200] - * const opacityRange = [0, 1, 1, 0] - * const opacity = mapValue(x, xRange, opacityRange) - * ``` - * - * @param inputValue - `MotionValue` - * @param inputRange - A linear series of numbers (either all increasing or decreasing) - * @param outputRange - A series of numbers, colors or strings. Must be the same length as `inputRange`. - * @param options - - * - * - clamp: boolean. Clamp values to within the given range. Defaults to `true` - * - ease: EasingFunction[]. Easing functions to use on the interpolations between each value in the input and output ranges. If provided as an array, the array must be one item shorter than the input and output ranges, as the easings apply to the transition between each. - * - * @returns `MotionValue` - * - * @public - */ - function mapValue(inputValue, inputRange, outputRange, options) { - const map = transform(inputRange, outputRange, options); - return transformValue(() => map(inputValue.get())); - } - - /** - * Create a `MotionValue` that animates to its latest value using a spring. - * Can either be a value or track another `MotionValue`. - * - * ```jsx - * const x = motionValue(0) - * const y = springValue(x, { stiffness: 300 }) - * ``` - * - * @param source - Initial value or MotionValue to track - * @param options - Spring configuration options - * @returns `MotionValue` - * - * @public - */ - function springValue(source, options) { - return followValue(source, { type: "spring", ...options }); - } - /** - * Attach a spring animation to a MotionValue that will animate whenever the value changes. - * - * @param value - The MotionValue to animate - * @param source - Initial value or MotionValue to track - * @param options - Spring configuration options - * @returns Cleanup function - * - * @public - */ - function attachSpring(value, source, options) { - return attachFollow(value, source, { type: "spring", ...options }); - } - - /** - * A list of all ValueTypes - */ - const valueTypes = [...dimensionValueTypes, color, complex]; - /** - * Tests a value against the list of ValueTypes - */ - const findValueType = (v) => valueTypes.find(testValueType(v)); - - let nameCount = 0; - /** - * Generated names live in their own namespace so we can tell a name we own - * (and must clean up) from an author-defined one - and so a stale generated - * name left behind by an interrupted transition is re-owned, not mistaken for - * the author's and leaked. - */ - const generatedName = () => `motion-view-${nameCount++}`; - const isGeneratedName = (name) => name.startsWith("motion-view-"); - /** - * Tag a captured element with a `view-transition-class` so authors can target - * its generated layer from CSS (e.g. `::view-transition-group(.hero)`) without - * the opaque generated name. Tracked in `classed` - separate from the generated - * names in `assigned` - so cleanup removes the class without ever stripping an - * author's own inline `view-transition-name`. - */ - function tagClass(element, className, classed) { - if (!className) - return; - element.style?.setProperty("view-transition-class", className); - classed.push(element); - } - /** - * Set the element's `view-transition-group` so its layer reconstructs the DOM - * hierarchy in the pseudo-tree (`contain`) - or stays flat (`none`). Tracked in - * `grouped` for cleanup. When the element clips (any non-`visible` overflow) its - * name is recorded in `clipChildren` so the caller can clip the nested children - * (`::view-transition-group-children(name)`), mirroring the live clip through - * the whole transition rather than only at the live-DOM handoff. - * - * Ignored by browsers without nested view-transition groups, where it harmlessly - * degrades to the flat default. - */ - function applyGroup(element, name, group, grouped, clipChildren) { - if (!group) - return; - element.style?.setProperty("view-transition-group", group); - grouped.push(element); - if (group !== "none" && clipChildren) { - const style = getComputedStyle(element); - if (style.overflowX !== "visible" || style.overflowY !== "visible") { - clipChildren.add(name); - } - } - } - /** - * Resolve a selector/Element to elements and ensure each one carries a - * `view-transition-name` we can target from script. - * - * Author-defined names are reused as-is. Elements that are unnamed (or use - * the browser's `auto`/`match-element`, whose generated name is not exposed - * to script) are given a unique generated name, set inline so it's captured, - * and tracked in `assigned` for later cleanup. - * - * `registry` maps each Element to its name so the same element keeps its name - * across both captures (before and after the update), which is what allows a - * persistent element to animate as a single `group` layer. - */ - function assignViewTransitionNames(definition, registry, assigned, forcedNames, className, classed = [], group, grouped = [], clipChildren) { - const elements = resolveElements(definition); - /** - * The new end of a paired morph: give each element the matching name from - * the old end (by index) so the two share one layer and morph. If the new - * end resolves to *more* elements than the old end named, the extras have no - * counterpart - give them a fresh name so they animate as newcomers rather - * than being silently left unnamed. We return the names actually assigned - * (sized to the resolved elements), not the raw `forcedNames`, so stagger - * totals and the layer set stay in step with what's on the page. - */ - if (forcedNames) { - return elements.map((element, i) => { - const existing = registry.get(element); - if (existing) - return existing; - const name = forcedNames[i] ?? generatedName(); - element.style?.setProperty("view-transition-name", name); - assigned.push(element); - registry.set(element, name); - tagClass(element, className, classed); - applyGroup(element, name, group, grouped, clipChildren); - return name; - }); - } - /** - * Read every current name up front, before assigning any. Interleaving the - * reads with the inline `setProperty` writes below would dirty styles - * between reads and force a style recalc per element; batching the reads - * keeps it to one. Elements already in the registry keep their name and - * need no read. - */ - const currentNames = elements.map((element) => registry.has(element) - ? undefined - : getComputedStyle(element).getPropertyValue("view-transition-name")); - return elements.map((element, i) => { - const existing = registry.get(element); - if (existing) - return existing; - const current = currentNames[i]; - let name; - if (current && - current !== "none" && - current !== "auto" && - current !== "match-element" && - !isGeneratedName(current)) { - /** - * The author already named this layer - target it as-is and leave - * it to them to clean up. `auto`/`match-element` are overridden - * because their generated name is not exposed to script, and a - * stale `motion-view-*` (e.g. left by an interrupted transition) is - * re-owned rather than adopted as an author name and leaked. - */ - name = current; - } - else { - name = generatedName(); - element.style?.setProperty("view-transition-name", name); - assigned.push(element); - } - registry.set(element, name); - tagClass(element, className, classed); - applyGroup(element, name, group, grouped, clipChildren); - return name; - }); - } - /** - * Remove the `view-transition-name`s we generated and the - * `view-transition-class`es we applied. Author-defined names are never touched - * (they're not in `assigned`). Safe to call more than once (e.g. on both a - * finished and an interrupted transition). - */ - function releaseViewTransitionNames(assigned, classed = [], grouped = []) { - for (const element of assigned) { - element.style?.removeProperty("view-transition-name"); - } - for (const element of classed) { - element.style?.removeProperty("view-transition-class"); - } - for (const element of grouped) { - element.style?.removeProperty("view-transition-group"); - } - } - - function chooseLayerType(valueName) { - if (valueName === "layout") - return "group"; - if (valueName === "enter" || valueName === "new") - return "new"; - return "old"; - } - - let pendingRules = {}; - let style = null; - const css = { - set: (selector, values) => { - pendingRules[selector] = values; - }, - commit: () => { - if (!style) { - style = document.createElement("style"); - style.id = "motion-view"; - } - let cssText = ""; - for (const selector in pendingRules) { - const rule = pendingRules[selector]; - cssText += `${selector} {\n`; - for (const [property, value] of Object.entries(rule)) { - cssText += ` ${property}: ${value};\n`; - } - cssText += "}\n"; - } - style.textContent = cssText; - document.head.appendChild(style); - pendingRules = {}; - }, - remove: () => { - if (style && style.parentElement) { - style.parentElement.removeChild(style); - } - }, - }; - - function getViewAnimationLayerInfo(pseudoElement) { - const match = pseudoElement.match( - // `group-children` (nested transitions) before `group` so it wins. - /::view-transition-(old|new|group-children|group|image-pair)\((.*?)\)/); - if (!match) - return null; - return { layer: match[2], type: match[1] }; - } - - function getViewAnimations() { - return document.getAnimations().filter((animation) => { - const { effect } = animation; - return (!!effect && - effect.target === document.documentElement && - effect.pseudoElement?.startsWith("::view-transition")); - }); - } - - function hasTarget(target, targets) { - return targets.has(target) && Object.keys(targets.get(target)).length > 0; - } - - const definitionNames = ["layout", "enter", "exit", "new", "old"]; - /** - * Whether a computed border-radius is square (every component zero). Splitting - * on whitespace handles two-value/elliptical radii like "0px 20px" - a leading - * `parseFloat` alone would misread the non-zero vertical radius as square. - */ - const isSquareRadius = (radius) => radius.split(" ").every((value) => parseFloat(value) === 0); - /** - * The `ViewTransitionTarget` buckets driving each generated layer type, in - * priority order - the inverse of `chooseLayerType`. The new view is driven by - * `new`/`enter`, the old by `old`/`exit`. `group-children`/`image-pair` have no - * bucket; they follow the default layout timing. - */ - const typeBuckets = { - group: ["layout"], - new: ["new", "enter"], - old: ["old", "exit"], - }; - /** - * Default "absent" origin for a single-value keyframe, by pseudo type, so e.g. - * `enter({ scale: 1 })` grows in from 0.85 and `exit({ opacity: 0 })` fades - * from 1. `enter` prefers the matching `exit` value over these (see below). - */ - const ORIGIN_DEFAULTS = { - new: { opacity: 0, scale: 0.85 }, - old: { opacity: 1, scale: 1 }, - }; - /** - * How much two box aspect ratios must differ before a morph is treated as - * aspect-changing (and so worth cropping). Matches the projection engine's - * `preserve-aspect` threshold, so small layout jitter doesn't trigger a crop. - */ - const ASPECT_TOLERANCE = 0.2; - function startViewAnimation(builder) { - const { update, targets, resolveDefs, cropOverride, pairs, classNames, flatGroups, options: defaultOptions, } = builder; - if (!document.startViewTransition) { - // An async IIFE (not `new Promise(async …)`) so a throwing/rejecting - // update rejects this promise rather than leaving it unsettled. - return (async () => { - await update(); - return new GroupAnimation([]); - })(); - } - /** - * Resolve any selector/Element targets to layer names, assigning a - * `view-transition-name` to each element as we go. We run this before the - * update (so the elements are captured in the old snapshot) and again - * after it (for the new snapshot). An element present in both keeps the - * same name and animates as a single `group` layer. - */ - const nameRegistry = new Map(); - const assigned = []; - /** - * Elements we tagged with a `view-transition-class` (via `.class()`), - * tracked separately from `assigned` so cleanup removes the class without - * ever stripping an author's own inline `view-transition-name`. - */ - const classed = []; - /** - * Elements we set a `view-transition-group` on (for nesting), tracked for - * cleanup. `clipChildren` collects the names of nested parents that clip in - * the live layout, so their `::view-transition-group-children` is clipped - * through the transition - not just once the live DOM takes back over. - */ - const grouped = []; - const clipChildren = new Set(); - const layerTargets = new Map(); - const croppedNames = new Set(); - /** - * Each layer's explicit `.crop(true | false)` override (by resolved name), - * so `finalizeCrop` can let an author's choice win over the morph default. - */ - const cropForName = new Map(); - /** - * Each layer's stagger position (index + total) within its subject, per - * snapshot. Resolving against the snapshot the layer belongs to keeps - * stagger correct when `update()` replaces the matched elements, and lets - * us skip a layer that's absent from a snapshot (e.g. an exited element - * has no `new` pseudo-element). - */ - const layerStagger = new Map(); - /** - * Names allocated for a paired subject in the old snapshot, replayed onto - * its new-snapshot target so both ends share a layer and morph. - */ - const pairNames = new Map(); - /** - * The old (`from`) elements of each paired subject, so their names can be - * transferred off before the new (`to`) elements inherit them. - */ - const pairFrom = new Map(); - const resolveLayers = (phase) => { - targets.forEach((target, definition) => { - const className = classNames.get(definition); - /** - * Nest each resolved layer under its DOM-ancestor layer by default - * (`contain`), so an ancestor's clip/transform/opacity reach it - * through the transition; `.group(false)` opts a subject out (`none`) - * to stay flat and escape. Skipped for root / pre-named layers, which - * aren't elements we resolve and style. - */ - const group = definition === "root" || !resolveDefs.has(definition) - ? undefined - : flatGroups.has(definition) - ? "none" - : "contain"; - let names; - if (definition === "root" || !resolveDefs.has(definition)) { - names = [definition]; - } - else if (pairs.has(definition)) { - /** - * Paired morph: name the old target in the old snapshot, then - * force the same name(s) onto the new target in the new one, so - * two different elements morph as a single layer. - */ - if (phase === "old") { - pairFrom.set(definition, resolveElements(definition)); - names = assignViewTransitionNames(definition, nameRegistry, assigned, undefined, className, classed, group, grouped, clipChildren); - pairNames.set(definition, names); - } - else { - /** - * Transfer the name(s) off the `from` elements before the - * `to` elements inherit them. A `from` that survives into - * the new snapshot (e.g. hidden with `visibility: hidden` - * rather than removed) would otherwise keep the name and - * collide - "duplicate view-transition-name". - */ - for (const el of pairFrom.get(definition) ?? []) { - el.style?.removeProperty("view-transition-name"); - /** - * Drop the old end from the registry too, so the new - * end alone supplies this name's `new` crop radii - we - * neither re-measure nor get ordered by a stale element. - */ - nameRegistry.delete(el); - } - names = assignViewTransitionNames(pairs.get(definition), nameRegistry, assigned, pairNames.get(definition), className, classed, group, grouped, clipChildren); - } - } - else { - names = assignViewTransitionNames(definition, nameRegistry, assigned, undefined, className, classed, group, grouped, clipChildren); - } - // Record any explicit `.crop(true | false)` per resolved name; the - // crop set itself is computed later by `finalizeCrop` (it needs both - // snapshots to know which morphs change aspect ratio). - const override = cropOverride.get(definition); - names.forEach((name, index) => { - /** - * If two subjects resolve to the same element, merge their - * definitions so neither subject's animations are dropped. - */ - const existing = layerTargets.get(name); - layerTargets.set(name, existing && existing !== target - ? { ...existing, ...target } - : target); - if (override !== undefined) - cropForName.set(name, override); - const stagger = layerStagger.get(name) ?? {}; - stagger[phase] = [index, names.length]; - layerStagger.set(name, stagger); - }); - }); - }; - /** - * The stagger index/total for a layer, resolved against the snapshot it - * belongs to. Returns index -1 when the layer is absent from that snapshot - * so the caller can skip a pseudo-element that doesn't exist. - */ - const staggerPosition = (name, type) => { - const stagger = layerStagger.get(name); - const position = type === "old" - ? stagger?.old - : type === "new" - ? stagger?.new - : // group / group-children / image-pair persist across both. - stagger?.new ?? stagger?.old; - return position ?? [-1, 1]; - }; - /** - * Merge default + per-layer transition options for a generated layer and - * resolve any stagger/delay function against this element's position. Used - * by both the morph-retiming and crop corner-radius passes. - */ - const resolveLayerTransition = (target, type, transitionName, index, total) => { - const transition = mergeTransition(getValueTransition$1(defaultOptions, transitionName), getValueTransition$1((layerOptions(target, type) ?? {}), transitionName)); - if (typeof transition.delay === "function") { - transition.delay = transition.delay(index, total); - } - return transition; - }; - /** - * Resolve a layer's group (`layout`) timing to plain WAAPI values: native - * ms `delay`/`duration` and a baked `ease`. The single source of group - * timing, shared by the generated-group retiming and the crop corner-radius - * pass so the rounded clip animates on exactly the box's timing. It returns - * no generator `type` (the WAAPI-only `NativeAnimation` rejects a string - * type) nor `repeat`/`times` (which the group's `updateTiming` ignores), so - * none of them can leak into the radius animation and desync it. - */ - const resolveGroupTiming = (name) => { - const [index, total] = staggerPosition(name, "group"); - const transition = resolveLayerTransition(layerTargets.get(name), "group", "layout", index === -1 ? 0 : index, total); - transition.duration && (transition.duration = secondsToMilliseconds(transition.duration)); - const { delay = 0, duration, ease } = applyGeneratorOptions(transition); - return { delay: secondsToMilliseconds(delay), duration, ease }; - }; - /** - * Each layer's measured box + corner radii per snapshot. The box lets - * `finalizeCrop` tell whether a morph's aspect ratio changed (the only case - * worth cropping); the radii let a cropped morph's group clip animate each - * corner from the old element's radius to the new element's, keeping it - * rounded where `overflow: clip` would otherwise square the corners. - * - * We never flatten the source for capture (a snapshot is a paint of the live - * DOM, so squaring an element just for its capture would flash one real - * square frame). For an aspect-changing morph `object-fit: cover` crops each - * snapshot's own baked corners off-screen mid-morph, so the animated clip is - * the only visible corner; a near-same-aspect forced crop (`.crop(true)`) - * can't hide the outgoing snapshot's silhouette, but the endpoints coincide. - */ - const cropMeasurements = new Map(); - const measureLayers = (phase) => nameRegistry.forEach((name, element) => { - const el = element; - const rect = el.getBoundingClientRect?.(); - if (rect && rect.height) { - const style = getComputedStyle(el); - const radii = {}; - for (const corner of cornerRadiusProps) { - radii[corner] = style[corner]; - } - const entry = cropMeasurements.get(name) ?? {}; - entry[phase] = { width: rect.width, height: rect.height, radii }; - cropMeasurements.set(name, entry); - } - }); - /** - * With both snapshots measured, settle which layers crop. The default crops - * only a morph whose aspect ratio *changes* between snapshots - the one case - * where `object-fit: cover` does real work. A same-aspect morph or a - * fade-only layer is left uncropped: its corners scale naturally (no flash - * from squaring, no `overflow: clip` eating its shadow) and a backdrop can't - * be clipped to nothing. An explicit `.crop(true | false)` overrides either - * way. Runs after both snapshots are measured, since aspect needs both. - */ - const finalizeCrop = () => { - croppedNames.clear(); - for (const name of layerStagger.keys()) { - if (name === "root") - continue; - // An explicit `.crop(true | false)` wins; otherwise crop a morph - // whose aspect ratio changed. - if (cropForName.get(name) ?? aspectChanged(name)) { - croppedNames.add(name); - } - } - }; - /** - * Whether a layer is a morph whose box aspect ratio changed between - * snapshots (beyond a small tolerance). Fade-only layers (one snapshot) are - * never "changed". - */ - const aspectChanged = (name) => { - const box = cropMeasurements.get(name); - if (!box?.old || !box?.new || !box.old.height || !box.new.height) { - return false; - } - return (Math.abs(box.old.width / box.old.height - - box.new.width / box.new.height) > ASPECT_TOLERANCE); - }; - /** - * Write the persistent view-transition CSS: suppress root capture when the - * root has no animations of its own; force linear timing (baked into the - * keyframes, so we can retime later via updateTiming); and clip + - * object-fit: cover every cropped morph (the UA default overflows on - * aspect-ratio change). - * - * `css.commit` replaces rather than appends, so we re-set the full rule set - * each call - the crop rules are only known after `finalizeCrop` runs in the - * update callback, so the second call writes them. - */ - const commitViewCSS = () => { - if (!hasTarget("root", targets)) { - css.set(":root", { "view-transition-name": "none" }); - } - css.set("::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)", { "animation-timing-function": "linear !important" }); - croppedNames.forEach((name) => { - css.set(`::view-transition-group(${name})`, { overflow: "clip" }); - css.set(`::view-transition-old(${name}), ::view-transition-new(${name})`, { width: "100%", height: "100%", "object-fit": "cover" }); - }); - /** - * Clip the nested children of any layer that clips in the live layout, - * so a wrapper crops its child for the whole morph (mirroring the DOM) - * rather than only at the live-DOM handoff. No-op on browsers without - * nested view-transition groups. - */ - clipChildren.forEach((name) => { - css.set(`::view-transition-group-children(${name})`, { - overflow: "clip", - }); - }); - css.commit(); // Write - }; - const cleanup = () => { - releaseViewTransitionNames(assigned, classed, grouped); - css.remove(); // Write - }; - const callback = async () => { - await update(); - /** - * Re-resolve so elements created by the update are named for the new - * snapshot, then measure them. With both snapshots measured we can - * settle the crop set (aspect-changing morphs + forced). - */ - resolveLayers("new"); - measureLayers("new"); - finalizeCrop(); - /** - * Re-commit the crop CSS unconditionally: `finalizeCrop` is computed - * here (after both snapshots are measured), so the clip rules must be - * (re)written to match the settled set. - */ - commitViewCSS(); - }; - let transition; - try { - resolveLayers("old"); - /** - * Measure the old snapshot against the optimistic crop set (the new - * snapshot doesn't exist yet, so aspect change can't be known here; - * `finalizeCrop` settles it post-update). - */ - measureLayers("old"); - commitViewCSS(); - transition = document.startViewTransition(callback); - } - catch (error) { - /** - * The prelude writes inline names before the transition exists. If it - * throws (e.g. startViewTransition rejects in a bad UA state), release - * them so we neither leak DOM state nor stall the queue on a promise - * that never settles - hand back a rejection it can advance past. - */ - cleanup(); - return Promise.reject(error); - } - transition.finished.finally(cleanup); - return new Promise((resolve, reject) => { - transition.ready - .then(() => { - const generatedViewAnimations = getViewAnimations(); - const animations = []; - /** - * Create animations for each of our explicitly-defined subjects. - * `opacityAnimated` additionally tracks which `${name}:${type}` - * we faded, so we can keep the UA `plus-lighter` blend only for a - * genuine opacity crossfade (both sides fading) and drop it for a - * slide/transform, where additive compositing would flash bright. - */ - const explicitlyAnimated = new Set(); - const opacityAnimated = new Set(); - layerTargets.forEach((target, name) => { - const stagger = layerStagger.get(name); - /** - * Presence: `enter` only fires for a pure newcomer (a new - * view with no old), `exit` only for a pure leaver. A - * survivor (both) gets neither - it just morphs. - */ - const enterApplies = !!stagger?.new && !stagger?.old; - const exitApplies = !!stagger?.old && !stagger?.new; - for (const key of definitionNames) { - if (!target[key]) - continue; - if (key === "enter" && !enterApplies) - continue; - if (key === "exit" && !exitApplies) - continue; - const type = chooseLayerType(key); - const [index, total] = staggerPosition(name, type); - // Skip a layer absent from its snapshot. - if (index === -1) - continue; - const { keyframes, options } = target[key]; - for (let [valueName, valueKeyframes] of Object.entries(keyframes)) { - // Skip only missing values - `0` (e.g. opacity: 0) - // is valid and must reach the from-value inference. - if (valueKeyframes == null) - continue; - /** - * The view path hands keyframes straight to WAAPI, - * so Motion's `x`/`y` shorthands (compiled to - * `transform` only via the value pipeline) have no - * effect. Warn and skip - use `transform`/`translate`. - */ - if (valueName === "x" || valueName === "y") { - warnOnce(false, `animateView() animates view-transition layers with CSS properties; the "${valueName}" shorthand has no effect - use transform, e.g. { transform: "translateX(40px)" }.`); - continue; - } - /** - * enter/exit win over new/old on a shared property - - * skip it here when the gated bucket also defines it. - */ - if (key === "new" && - enterApplies && - target.enter?.keyframes[valueName] != null) { - continue; - } - if (key === "old" && - exitApplies && - target.exit?.keyframes[valueName] != null) { - continue; - } - const valueOptions = mergeTransition(getValueTransition$1(defaultOptions, valueName), getValueTransition$1(options, valueName)); - /** - * Infer an origin for a single-value keyframe. An - * `enter` mirrors the matching `exit` value (a - * defined exit reverses into the enter for free); - * otherwise the per-type default (opacity 0/1, scale - * 0.85). No default -> left as-is (animates from the - * live value). - * - * `new`/`old` fire for survivors too, where only the - * opacity crossfade default applies - a transform - * default like scale 0.85 would pop a persisting - * element, so gate it on the layer actually - * entering/leaving. - */ - if (!Array.isArray(valueKeyframes)) { - const exitValue = key === "enter" - ? target.exit?.keyframes[valueName] - : undefined; - const allowDefault = valueName === "opacity" || - (type === "new" ? enterApplies : exitApplies); - const from = exitValue != null - ? Array.isArray(exitValue) - ? exitValue[exitValue.length - 1] - : exitValue - : allowDefault - ? ORIGIN_DEFAULTS[type]?.[valueName] - : undefined; - if (from !== undefined) { - valueKeyframes = [from, valueKeyframes]; - } - } - /** - * Resolve stagger function if provided, per element - * across this subject's resolved layers. - */ - if (typeof valueOptions.delay === "function") { - valueOptions.delay = valueOptions.delay(index, total); - } - valueOptions.duration && (valueOptions.duration = secondsToMilliseconds(valueOptions.duration)); - valueOptions.delay && (valueOptions.delay = secondsToMilliseconds(valueOptions.delay)); - animations.push(new NativeAnimation({ - ...valueOptions, - element: document.documentElement, - name: valueName, - pseudoElement: `::view-transition-${type}(${name})`, - keyframes: valueKeyframes, - })); - explicitlyAnimated.add(`${name}:${type}`); - if (valueName === "opacity") { - opacityAnimated.add(`${name}:${type}`); - } - } - } - }); - /** - * Handle browser generated animations - */ - for (const animation of generatedViewAnimations) { - if (animation.playState === "finished") - continue; - const { effect } = animation; - if (!effect || !(effect instanceof KeyframeEffect)) - continue; - const { pseudoElement } = effect; - if (!pseudoElement) - continue; - const name = getViewAnimationLayerInfo(pseudoElement); - if (!name) - continue; - const targetDefinition = layerTargets.get(name.layer); - /** - * We built our own animation for this layer, so drop the - * browser-generated fade we're replacing. The UA - * `plus-lighter` blend is a *separate* generated animation on - * the same pseudo (it sets `mix-blend-mode` in its keyframes): - * keep it *only* for a true opacity crossfade - both sides - * fading - so a symmetric crossfade composites without - * darkening, but a slide/transform (where both layers stay - * opaque and overlap) doesn't flash bright from the addition. - */ - if (explicitlyAnimated.has(`${name.layer}:${name.type}`)) { - const isCrossfade = opacityAnimated.has(`${name.layer}:new`) && - opacityAnimated.has(`${name.layer}:old`); - if (isCrossfade && - effect - .getKeyframes() - .some((keyframe) => keyframe.mixBlendMode)) { - animations.push(new NativeAnimationWrapper(animation)); - } - else { - animation.cancel(); - } - continue; - } - /** - * Drop the orphaned half of the default crossfade. The UA - * fades old out and new in as a *pair*; if the opposing half - * was explicitly overridden with something other than an - * opacity fade (a clip or transform reveal), this side's - * default opacity fade has no partner - left to run it would - * dissolve what should be a static backdrop (e.g. - * `.new({ clipPath })` should reveal over a still old view, - * not fade the old out around the growing clip). Cancel it - - * and its `plus-lighter` sibling on the same pseudo, which - * would otherwise flash bright where the two opaque layers - * overlap. A genuine crossfade (the opposing side also fading - * opacity) keeps both halves and is handled above. - */ - const opposite = name.type === "old" - ? "new" - : name.type === "new" - ? "old" - : undefined; - if (opposite && - explicitlyAnimated.has(`${name.layer}:${opposite}`) && - !opacityAnimated.has(`${name.layer}:${opposite}`)) { - animation.cancel(); - continue; - } - /** - * Otherwise retime the browser-generated animation to - * Motion's timing. This auto-enables the layout (group) - * morph for any resolved/named target, and applies the - * default timing to old/new layers we haven't explicitly - * overridden. - * - * group + group-children both follow the layout timing so - * the nesting container stays in sync with the morph. - */ - /** - * A survivor's old + new are the two halves of one - * `plus-lighter` crossfade. They must share identical timing - * (so their opacities stay mirrored and sum to 1 - else the - * additive blend flashes bright wherever both are partly - * visible) and fade linearly (the bounce belongs on the - * group's geometry, not the opacity). So time them as the - * group, rather than via their own - potentially staggered, - * or enter/exit-derived - old/new options. - */ - const stagger = layerStagger.get(name.layer); - const isMorphCrossfade = (name.type === "old" || name.type === "new") && - !!stagger?.old && - !!stagger?.new; - let timing; - if (name.type.startsWith("group")) { - // group + group-children follow the resolved group - // timing - the single source shared with the crop - // corner-radius pass below. - const { delay, duration, ease } = resolveGroupTiming(name.layer); - timing = { - delay, - duration, - easing: mapEasingToNativeEasing(ease, duration), - }; - } - else { - const timingType = isMorphCrossfade ? "group" : name.type; - const [index, total] = staggerPosition(name.layer, timingType); - const transitionName = timingType === "group" ? "layout" : ""; - let animationTransition = resolveLayerTransition(targetDefinition, timingType, transitionName, index === -1 ? 0 : index, total); - /** - * The crossfade should resolve at the spring's - * *perceptual* (visual) duration - the geometry can keep - * bouncing, but the opacity shouldn't drag through the - * settle. So capture `visualDuration` before - * `applyGeneratorOptions` replaces it with the full - * overshoot duration, and use it for the fade. - */ - const visualDuration = animationTransition.visualDuration; - animationTransition.duration && (animationTransition.duration = secondsToMilliseconds(animationTransition.duration)); - animationTransition = - applyGeneratorOptions(animationTransition); - timing = { - delay: secondsToMilliseconds(animationTransition.delay ?? 0), - duration: isMorphCrossfade && visualDuration !== undefined - ? secondsToMilliseconds(visualDuration) - : animationTransition.duration, - easing: isMorphCrossfade - ? "linear" - : mapEasingToNativeEasing(animationTransition.ease, animationTransition.duration), - }; - } - effect.updateTiming(timing); - animations.push(new NativeAnimationWrapper(animation)); - } - /** - * Round each cropped layer's clip. Its `::view-transition-group` - * has `overflow: clip`, which would otherwise square the corners - * mid-morph; animate each corner from the old element's radius to - * the new element's so the crop stays rounded. Timed as the group - * (`layout`) so the radius tracks the morphing box. - */ - cropMeasurements.forEach((entry, name) => { - if (!croppedNames.has(name)) - return; - // Reuse the group's resolved timing - native ms delay/ - // duration + a baked ease, with no generator `type` or - // repeat/times to leak into (or throw inside) NativeAnimation. - const { delay, duration, ease } = resolveGroupTiming(name); - for (const corner of cornerRadiusProps) { - // `||` (not `??`) so an empty measurement falls back to - // the other snapshot rather than an invalid keyframe. - const from = entry.old?.radii[corner] || - entry.new?.radii[corner] || - "0px"; - const to = entry.new?.radii[corner] || - entry.old?.radii[corner] || - "0px"; - // Nothing to round if the corner is square at both ends. - if (isSquareRadius(from) && isSquareRadius(to)) - continue; - animations.push(new NativeAnimation({ - element: document.documentElement, - name: corner, - pseudoElement: `::view-transition-group(${name})`, - keyframes: [from, to], - delay, - duration, - ease, - })); - } - }); - resolve(new GroupAnimation(animations)); - }) - .catch(() => - /** - * `ready` rejects when the transition is skipped - no visual - * change, or superseded by an interrupting transition. The DOM - * update still applied, so settle with no animations rather than - * surfacing it as an error to an awaiting caller. A genuine - * failure in `update()` rejects `updateCallbackDone` (already - * settled by now), so propagate that instead. - */ - transition.updateCallbackDone.then(() => resolve(new GroupAnimation([])), reject)); - }); - } - /** - * The options that should time a given generated layer type, so a retimed - * group/old/new picks up any per-target transition the user provided. Checks - * the type's buckets in priority order (e.g. `new` before `enter`). - */ - function layerOptions(target, type) { - for (const bucket of typeBuckets[type] ?? []) { - const options = target?.[bucket]?.options; - if (options) - return options; - } - } - /** - * Merge a base transition (e.g. the default `options`) with a per-layer/value - * override. An explicit `duration` on the override must win over an inherited - * generator's own timing: a spring prefers `visualDuration`, and - * `spring.applyToOptions` overwrites `duration` with the computed settle time - - * so without this the override is silently discarded. Dropping the inherited - * `type`/`visualDuration` makes the layer a plain tween of that duration, unless - * it asked for its own generator `type`/`visualDuration`. - */ - function mergeTransition(base, override) { - const merged = { ...base, ...override }; - if (override.duration !== undefined) { - if (override.visualDuration === undefined) - delete merged.visualDuration; - if (override.type === undefined) - delete merged.type; - } - return merged; - } - - let builders = []; - let current = null; - function next() { - current = null; - const [nextBuilder] = builders; - if (nextBuilder) - start(nextBuilder); - } - function start(builder) { - removeItem(builders, builder); - current = builder; - startViewAnimation(builder) - .then((animation) => { - builder.notifyReady(animation); - return animation.finished; - }) - // A genuinely failed transition (a throwing update) rejects the - // builder; a skipped/interrupted one resolves with no animations (see - // start.ts). Either way, advance the queue - else later transitions hang. - .catch((error) => builder.notifyReject(error)) - .finally(next); - } - function processQueue() { - /** - * Iterate backwards over the builders array. We can ignore the - * "wait" animations. If we have an interrupting animation in the - * queue then we need to batch all preceeding animations into it. - * Currently this only batches the update functions but will also - * need to batch the targets. - */ - for (let i = builders.length - 1; i >= 0; i--) { - const builder = builders[i]; - const { interrupt } = builder.options; - if (interrupt === "immediate") { - const batchedUpdates = builders.slice(0, i + 1).map((b) => b.update); - const remaining = builders.slice(i + 1); - builder.update = () => { - batchedUpdates.forEach((update) => update()); - }; - // Put the current builder at the front, followed by any "wait" builders - builders = [builder, ...remaining]; - break; - } - } - if (!current || builders[0]?.options.interrupt === "immediate") { - next(); - } - } - function addToQueue(builder) { - builders.push(builder); - microtask.render(processQueue); - } - - class ViewTransitionBuilder { - constructor(update, options = {}) { - this.currentSubject = "root"; - this.targets = new Map(); - /** - * Definitions that must be resolved to elements (and assigned a - * `view-transition-name`) rather than treated as pre-named layers. - */ - this.resolveDefs = new Set(); - /** - * Per-subject crop override: `true` forces the crop (clip + object-fit: - * cover + animated corner radii) on, `false` forces it off. A subject with - * no entry uses the default - crop only a genuine morph (a layer present in - * both snapshots), so a fade-only enter/exit isn't clipped to nothing. - */ - this.cropOverride = new Map(); - /** - * Subjects paired with a different new-snapshot target (the second `.add()` - * argument), so two distinct elements share one name and morph into each - * other - a shared-element transition. - */ - this.pairs = new Map(); - /** - * A `view-transition-class` to apply to each subject's resolved elements, - * so authors can target the generated layers from CSS by class rather than - * the opaque generated name. - */ - this.classNames = new Map(); - /** - * Subjects opted out of automatic group nesting via `.group(false)`. Their - * layer stays a flat top-level group (`view-transition-group: none`) instead - * of nesting under its DOM-ancestor layer - so it animates independently and - * escapes an ancestor's clip/transform (e.g. an element that lifts out of a - * card and flies across, which nesting would clip to the card). - */ - this.flatGroups = new Set(); - this.notifyReady = noop; - this.notifyReject = noop; - this.readyPromise = new Promise((resolve, reject) => { - this.notifyReady = resolve; - this.notifyReject = reject; - }); - this.update = update; - this.options = { - interrupt: "wait", - ...options, - }; - // Avoid an unhandled rejection when a failed transition has no - // `.then(_, reject)` handler attached (e.g. fire-and-forget). - this.readyPromise.catch(noop); - addToQueue(this); - } - /** - * Target elements resolved from a selector or Element, each assigned a - * `view-transition-name` automatically. - * - * Passing a second target pairs them: the first is resolved in the old - * snapshot and the second in the new, sharing one name so two *different* - * elements morph into each other (e.g. `.add(card, ".modal")`). Symmetric - - * pass them the other way round to morph back. - */ - add(subject, newSubject) { - this.currentSubject = subject; - this.resolveDefs.add(subject); - if (newSubject !== undefined) - this.pairs.set(subject, newSubject); - // Register the subject so it participates (and gets an automatic - // layout/morph animation) even without an explicit enter/exit/layout. - if (!this.targets.has(subject)) - this.targets.set(subject, {}); - return this; - } - /** - * Control this subject's crop (clip + `object-fit: cover` + animated - * corners). By default a subject auto-crops only when it actually morphs - - * present in both snapshots (a survivor, or an `.add(a, b)` pair). A - * fade-only enter/exit has no second box to crop against, so it's left to - * the browser default; in particular the `overflow: clip` a crop adds would - * otherwise clip a mis-sized enter/exit layer to nothing. - * - * `.crop(false)` forces the crop off (e.g. a text morph, where - * `object-fit: cover` clips glyphs as the box grows); `.crop(true)` forces - * it on for a non-morph the default wouldn't otherwise crop. - */ - crop(enabled = true) { - this.cropOverride.set(this.currentSubject, enabled); - return this; - } - /** - * By default a subject's layer nests under its nearest DOM-ancestor layer - * (`view-transition-group: contain`), so the ancestor's clip/transform/opacity - * apply to it through the transition - mirroring how the DOM actually paints, - * and letting a wrapper crop its child for the whole morph rather than only - * once the live DOM takes back over. (Needs a browser that supports nested - * view-transition groups; elsewhere it degrades to the flat default.) - * - * Call `.group(false)` to opt out: the layer stays flat and top-level, so it - * animates independently and escapes an ancestor's clip - e.g. an element - * that should lift out of a card and fly across, which nesting would clip. - */ - group(enabled = true) { - enabled - ? this.flatGroups.delete(this.currentSubject) - : this.flatGroups.add(this.currentSubject); - return this; - } - /** - * Tag this subject's generated layers with a `view-transition-class`, so - * they can be targeted from CSS - `::view-transition-group(.name)`, - * `::view-transition-old/new(.name)`, `::view-transition-image-pair(.name)` - * - without the opaque generated `view-transition-name`. Because `.add()` - * can match many elements, a shared class targets them all at once (and, - * for a pair, both ends). The escape hatch for z-index / custom keyframes - * on a morph layer. - */ - class(name) { - this.classNames.set(this.currentSubject, name); - return this; - } - /** - * Set the transition for this subject's morph. The morph is enabled - * automatically by `.add()`; this just customises its timing (duration, - * easing, a `delay`/`stagger`, …). On the implicit `root` subject it also - * opts the page into the transition (the root crossfade). - */ - layout(options = {}) { - this.updateTarget("layout", {}, options); - return this; - } - enter(keyframes, options) { - this.updateTarget("enter", keyframes, options); - return this; - } - exit(keyframes, options) { - this.updateTarget("exit", keyframes, options); - return this; - } - /** - * Animate the new view directly, whether the element is appearing or - * persisting (unlike `.enter()`, which only fires for a pure newcomer). - * Pair with `.old()` for a crossfade or slide-through. - */ - new(keyframes, options) { - this.updateTarget("new", keyframes, options); - return this; - } - /** - * Animate the old view directly, whether the element is leaving or - * persisting (unlike `.exit()`, which only fires for a pure leaver). - */ - old(keyframes, options) { - this.updateTarget("old", keyframes, options); - return this; - } - updateTarget(target, keyframes, options = {}) { - const { currentSubject, targets } = this; - if (!targets.has(currentSubject)) { - targets.set(currentSubject, {}); - } - const targetData = targets.get(currentSubject); - targetData[target] = { keyframes, options }; - } - then(resolve, reject) { - return this.readyPromise.then(resolve, reject); - } - } - function animateView(update, options = {}) { - return new ViewTransitionBuilder(update, options); - } - - const createAxisDelta = () => ({ - translate: 0, - scale: 1, - origin: 0, - originPoint: 0, - }); - const createDelta = () => ({ - x: createAxisDelta(), - y: createAxisDelta(), - }); - const createAxis = () => ({ min: 0, max: 0 }); - const createBox = () => ({ - x: createAxis(), - y: createAxis(), - }); - - const visualElementStore = new WeakMap(); - - function isAnimationControls(v) { - return (v !== null && - typeof v === "object" && - typeof v.start === "function"); - } - - /** - * Decides if the supplied variable is variant label - */ - function isVariantLabel(v) { - return typeof v === "string" || Array.isArray(v); - } - - const variantPriorityOrder = [ - "animate", - "whileInView", - "whileFocus", - "whileHover", - "whileTap", - "whileDrag", - "exit", - ]; - const variantProps = ["initial", ...variantPriorityOrder]; - - function isControllingVariants(props) { - return (isAnimationControls(props.animate) || - variantProps.some((name) => isVariantLabel(props[name]))); - } - function isVariantNode(props) { - return Boolean(isControllingVariants(props) || props.variants); - } - - /** - * Updates motion values from props changes. - * Uses `any` type for element to avoid circular dependencies with VisualElement. - */ - function updateMotionValuesFromProps(element, next, prev) { - for (const key in next) { - const nextValue = next[key]; - const prevValue = prev[key]; - if (isMotionValue(nextValue)) { - /** - * If this is a motion value found in props or style, we want to add it - * to our visual element's motion value map. - */ - element.addValue(key, nextValue); - } - else if (isMotionValue(prevValue)) { - /** - * If we're swapping from a motion value to a static value, - * create a new motion value from that - */ - element.addValue(key, motionValue(nextValue, { owner: element })); - } - else if (prevValue !== nextValue) { - /** - * If this is a flat value that has changed, update the motion value - * or create one if it doesn't exist. We only want to do this if we're - * not handling the value with our animation state. - */ - if (element.hasValue(key)) { - const existingValue = element.getValue(key); - if (existingValue.liveStyle === true) { - existingValue.jump(nextValue); - } - else if (!existingValue.hasAnimated) { - existingValue.set(nextValue); - } - } - else { - const latestValue = element.getStaticValue(key); - element.addValue(key, motionValue(latestValue !== undefined ? latestValue : nextValue, { owner: element })); - } - } - } - // Handle removed values - for (const key in prev) { - if (next[key] === undefined) - element.removeValue(key); - } - return next; - } - - // Does this device prefer reduced motion? Returns `null` server-side. - const prefersReducedMotion = { current: null }; - const hasReducedMotionListener = { current: false }; - - const isBrowser = typeof window !== "undefined"; - function initPrefersReducedMotion() { - hasReducedMotionListener.current = true; - if (!isBrowser) - return; - if (window.matchMedia) { - const motionMediaQuery = window.matchMedia("(prefers-reduced-motion)"); - const setReducedMotionPreferences = () => (prefersReducedMotion.current = motionMediaQuery.matches); - motionMediaQuery.addEventListener("change", setReducedMotionPreferences); - setReducedMotionPreferences(); - } - else { - prefersReducedMotion.current = false; - } - } - - const propEventHandlers = [ - "AnimationStart", - "AnimationComplete", - "Update", - "BeforeLayoutMeasure", - "LayoutMeasure", - "LayoutAnimationStart", - "LayoutAnimationComplete", - ]; - /** - * Static feature definitions - can be injected by framework layer - */ - let featureDefinitions = {}; - /** - * Set feature definitions for all VisualElements. - * This should be called by the framework layer (e.g., framer-motion) during initialization. - */ - function setFeatureDefinitions(definitions) { - featureDefinitions = definitions; - } - /** - * Get the current feature definitions - */ - function getFeatureDefinitions() { - return featureDefinitions; - } - /** - * A VisualElement is an imperative abstraction around UI elements such as - * HTMLElement, SVGElement, Three.Object3D etc. - */ - class VisualElement { - /** - * This method takes React props and returns found MotionValues. For example, HTML - * MotionValues will be found within the style prop, whereas for Three.js within attribute arrays. - * - * This isn't an abstract method as it needs calling in the constructor, but it is - * intended to be one. - */ - scrapeMotionValuesFromProps(_props, _prevProps, _visualElement) { - return {}; - } - constructor({ parent, props, presenceContext, reducedMotionConfig, skipAnimations, blockInitialAnimation, visualState, }, options = {}) { - /** - * A reference to the current underlying Instance, e.g. a HTMLElement - * or Three.Mesh etc. - */ - this.current = null; - /** - * A set containing references to this VisualElement's children. - */ - this.children = new Set(); - /** - * Determine what role this visual element should take in the variant tree. - */ - this.isVariantNode = false; - this.isControllingVariants = false; - /** - * Decides whether this VisualElement should animate in reduced motion - * mode. - * - * TODO: This is currently set on every individual VisualElement but feels - * like it could be set globally. - */ - this.shouldReduceMotion = null; - /** - * Decides whether animations should be skipped for this VisualElement. - * Useful for E2E tests and visual regression testing. - */ - this.shouldSkipAnimations = false; - /** - * A map of all motion values attached to this visual element. Motion - * values are source of truth for any given animated value. A motion - * value might be provided externally by the component via props. - */ - this.values = new Map(); - this.KeyframeResolver = KeyframeResolver; - /** - * Cleanup functions for active features (hover/tap/exit etc) - */ - this.features = {}; - /** - * A map of every subscription that binds the provided or generated - * motion values onChange listeners to this visual element. - */ - this.valueSubscriptions = new Map(); - /** - * A reference to the previously-provided motion values as returned - * from scrapeMotionValuesFromProps. We use the keys in here to determine - * if any motion values need to be removed after props are updated. - */ - this.prevMotionValues = {}; - /** - * Track whether this element has been mounted before, to detect - * remounts after Suspense unmount/remount cycles. - */ - this.hasBeenMounted = false; - /** - * An object containing a SubscriptionManager for each active event. - */ - this.events = {}; - /** - * An object containing an unsubscribe function for each prop event subscription. - * For example, every "Update" event can have multiple subscribers via - * VisualElement.on(), but only one of those can be defined via the onUpdate prop. - */ - this.propEventSubscriptions = {}; - this.notifyUpdate = () => this.notify("Update", this.latestValues); - this.render = () => { - if (!this.current) - return; - this.triggerBuild(); - this.renderInstance(this.current, this.renderState, this.props.style, this.projection); - }; - this.renderScheduledAt = 0.0; - this.scheduleRender = () => { - const now = time.now(); - if (this.renderScheduledAt < now) { - this.renderScheduledAt = now; - frame.render(this.render, false, true); - } - }; - const { latestValues, renderState } = visualState; - this.latestValues = latestValues; - this.baseTarget = { ...latestValues }; - this.initialValues = props.initial ? { ...latestValues } : {}; - this.renderState = renderState; - this.parent = parent; - this.props = props; - this.presenceContext = presenceContext; - this.depth = parent ? parent.depth + 1 : 0; - this.reducedMotionConfig = reducedMotionConfig; - this.skipAnimationsConfig = skipAnimations; - this.options = options; - this.blockInitialAnimation = Boolean(blockInitialAnimation); - this.isControllingVariants = isControllingVariants(props); - this.isVariantNode = isVariantNode(props); - if (this.isVariantNode) { - this.variantChildren = new Set(); - } - this.manuallyAnimateOnMount = Boolean(parent && parent.current); - /** - * Any motion values that are provided to the element when created - * aren't yet bound to the element, as this would technically be impure. - * However, we iterate through the motion values and set them to the - * initial values for this component. - * - * TODO: This is impure and we should look at changing this to run on mount. - * Doing so will break some tests but this isn't necessarily a breaking change, - * more a reflection of the test. - */ - const { willChange, ...initialMotionValues } = this.scrapeMotionValuesFromProps(props, {}, this); - for (const key in initialMotionValues) { - const value = initialMotionValues[key]; - if (latestValues[key] !== undefined && isMotionValue(value)) { - value.set(latestValues[key]); - } - } - } - mount(instance) { - /** - * If this element has been mounted before (e.g. after a Suspense - * unmount/remount), reset motion values to their initial state - * so animations replay correctly from initial → animate. - */ - if (this.hasBeenMounted) { - for (const key in this.initialValues) { - this.values.get(key)?.jump(this.initialValues[key]); - this.latestValues[key] = this.initialValues[key]; - } - } - this.current = instance; - visualElementStore.set(instance, this); - if (this.projection && !this.projection.instance) { - this.projection.mount(instance); - } - if (this.parent && this.isVariantNode && !this.isControllingVariants) { - this.removeFromVariantTree = this.parent.addVariantChild(this); - } - this.values.forEach((value, key) => this.bindToMotionValue(key, value)); - /** - * Determine reduced motion preference. Only initialize the matchMedia - * listener if we actually need the dynamic value (i.e., when config - * is neither "never" nor "always"). - */ - if (this.reducedMotionConfig === "never") { - this.shouldReduceMotion = false; - } - else if (this.reducedMotionConfig === "always") { - this.shouldReduceMotion = true; - } - else { - if (!hasReducedMotionListener.current) { - initPrefersReducedMotion(); - } - this.shouldReduceMotion = prefersReducedMotion.current; - } - { - warnOnce(this.shouldReduceMotion !== true, "You have Reduced Motion enabled on your device. Animations may not appear as expected.", "reduced-motion-disabled"); - } - /** - * Set whether animations should be skipped based on the config. - */ - this.shouldSkipAnimations = this.skipAnimationsConfig ?? false; - this.parent?.addChild(this); - this.update(this.props, this.presenceContext); - this.hasBeenMounted = true; - } - unmount() { - this.projection && this.projection.unmount(); - cancelFrame(this.notifyUpdate); - cancelFrame(this.render); - this.valueSubscriptions.forEach((remove) => remove()); - this.valueSubscriptions.clear(); - this.removeFromVariantTree && this.removeFromVariantTree(); - this.parent?.removeChild(this); - for (const key in this.events) { - this.events[key].clear(); - } - for (const key in this.features) { - const feature = this.features[key]; - if (feature) { - feature.unmount(); - feature.isMounted = false; - } - } - this.current = null; - } - addChild(child) { - this.children.add(child); - this.enteringChildren ?? (this.enteringChildren = new Set()); - this.enteringChildren.add(child); - } - removeChild(child) { - this.children.delete(child); - this.enteringChildren && this.enteringChildren.delete(child); - } - bindToMotionValue(key, value) { - if (this.valueSubscriptions.has(key)) { - this.valueSubscriptions.get(key)(); - } - if (value.accelerate && - acceleratedValues.has(key) && - this.current instanceof HTMLElement) { - const { factory, keyframes, times, ease, duration } = value.accelerate; - const animation = new NativeAnimation({ - element: this.current, - name: key, - keyframes, - times, - ease, - duration: secondsToMilliseconds(duration), - }); - const cleanup = factory(animation); - this.valueSubscriptions.set(key, () => { - cleanup(); - animation.cancel(); - }); - return; - } - const valueIsTransform = transformProps.has(key); - if (valueIsTransform && this.onBindTransform) { - this.onBindTransform(); - } - const removeOnChange = value.on("change", (latestValue) => { - this.latestValues[key] = latestValue; - this.props.onUpdate && frame.preRender(this.notifyUpdate); - if (valueIsTransform && this.projection) { - this.projection.isTransformDirty = true; - } - this.scheduleRender(); - }); - let removeSyncCheck; - if (typeof window !== "undefined" && - window.MotionCheckAppearSync) { - removeSyncCheck = window.MotionCheckAppearSync(this, key, value); - } - this.valueSubscriptions.set(key, () => { - removeOnChange(); - if (removeSyncCheck) - removeSyncCheck(); - // Defer to MotionValue.on("change") auto-stop so React 19 remounts - // can resubscribe before the animation is cancelled (#3315). - }); - } - sortNodePosition(other) { - /** - * If these nodes aren't even of the same type we can't compare their depth. - */ - if (!this.current || - !this.sortInstanceNodePosition || - this.type !== other.type) { - return 0; - } - return this.sortInstanceNodePosition(this.current, other.current); - } - updateFeatures() { - let key = "animation"; - for (key in featureDefinitions) { - const featureDefinition = featureDefinitions[key]; - if (!featureDefinition) - continue; - const { isEnabled, Feature: FeatureConstructor } = featureDefinition; - /** - * If this feature is enabled but not active, make a new instance. - */ - if (!this.features[key] && - FeatureConstructor && - isEnabled(this.props)) { - this.features[key] = new FeatureConstructor(this); - } - /** - * If we have a feature, mount or update it. - */ - if (this.features[key]) { - const feature = this.features[key]; - if (feature.isMounted) { - feature.update(); - } - else { - feature.mount(); - feature.isMounted = true; - } - } - } - } - triggerBuild() { - this.build(this.renderState, this.latestValues, this.props); - } - /** - * Measure the current viewport box with or without transforms. - * Only measures axis-aligned boxes, rotate and skew must be manually - * removed with a re-render to work. - */ - measureViewportBox() { - return this.current - ? this.measureInstanceViewportBox(this.current, this.props) - : createBox(); - } - getStaticValue(key) { - return this.latestValues[key]; - } - setStaticValue(key, value) { - this.latestValues[key] = value; - } - /** - * Update the provided props. Ensure any newly-added motion values are - * added to our map, old ones removed, and listeners updated. - */ - update(props, presenceContext) { - if (props.transformTemplate || this.props.transformTemplate) { - this.scheduleRender(); - } - this.prevProps = this.props; - this.props = props; - this.prevPresenceContext = this.presenceContext; - this.presenceContext = presenceContext; - /** - * Update prop event handlers ie onAnimationStart, onAnimationComplete - */ - for (let i = 0; i < propEventHandlers.length; i++) { - const key = propEventHandlers[i]; - if (this.propEventSubscriptions[key]) { - this.propEventSubscriptions[key](); - delete this.propEventSubscriptions[key]; - } - const listenerName = ("on" + key); - const listener = props[listenerName]; - if (listener) { - this.propEventSubscriptions[key] = this.on(key, listener); - } - } - this.prevMotionValues = updateMotionValuesFromProps(this, this.scrapeMotionValuesFromProps(props, this.prevProps || {}, this), this.prevMotionValues); - if (this.handleChildMotionValue) { - this.handleChildMotionValue(); - } - } - getProps() { - return this.props; - } - /** - * Returns the variant definition with a given name. - */ - getVariant(name) { - return this.props.variants ? this.props.variants[name] : undefined; - } - /** - * Returns the defined default transition on this component. - */ - getDefaultTransition() { - return this.props.transition; - } - getTransformPagePoint() { - return this.props.transformPagePoint; - } - getClosestVariantNode() { - return this.isVariantNode - ? this - : this.parent - ? this.parent.getClosestVariantNode() - : undefined; - } - /** - * Add a child visual element to our set of children. - */ - addVariantChild(child) { - const closestVariantNode = this.getClosestVariantNode(); - if (closestVariantNode) { - closestVariantNode.variantChildren && - closestVariantNode.variantChildren.add(child); - return () => closestVariantNode.variantChildren.delete(child); - } - } - /** - * Add a motion value and bind it to this visual element. - */ - addValue(key, value) { - // Remove existing value if it exists - const existingValue = this.values.get(key); - if (value !== existingValue) { - if (existingValue) - this.removeValue(key); - this.bindToMotionValue(key, value); - this.values.set(key, value); - this.latestValues[key] = value.get(); - } - } - /** - * Remove a motion value and unbind any active subscriptions. - */ - removeValue(key) { - this.values.delete(key); - const unsubscribe = this.valueSubscriptions.get(key); - if (unsubscribe) { - unsubscribe(); - this.valueSubscriptions.delete(key); - } - delete this.latestValues[key]; - this.removeValueFromRenderState(key, this.renderState); - } - /** - * Check whether we have a motion value for this key - */ - hasValue(key) { - return this.values.has(key); - } - getValue(key, defaultValue) { - if (this.props.values && this.props.values[key]) { - return this.props.values[key]; - } - let value = this.values.get(key); - if (value === undefined && defaultValue !== undefined) { - value = motionValue(defaultValue === null ? undefined : defaultValue, { owner: this }); - this.addValue(key, value); - } - return value; - } - /** - * If we're trying to animate to a previously unencountered value, - * we need to check for it in our state and as a last resort read it - * directly from the instance (which might have performance implications). - */ - readValue(key, target) { - let value = this.latestValues[key] !== undefined || !this.current - ? this.latestValues[key] - : this.getBaseTargetFromProps(this.props, key) ?? - this.readValueFromInstance(this.current, key, this.options); - if (value !== undefined && value !== null) { - if (typeof value === "string" && - (isNumericalString(value) || isZeroValueString(value))) { - // If this is a number read as a string, ie "0" or "200", convert it to a number - value = parseFloat(value); - } - else if (!findValueType(value) && complex.test(target)) { - value = getAnimatableNone(key, target); - } - this.setBaseTarget(key, isMotionValue(value) ? value.get() : value); - } - return isMotionValue(value) ? value.get() : value; - } - /** - * Set the base target to later animate back to. This is currently - * only hydrated on creation and when we first read a value. - */ - setBaseTarget(key, value) { - this.baseTarget[key] = value; - } - /** - * Find the base target for a value thats been removed from all animation - * props. - */ - getBaseTarget(key) { - const { initial } = this.props; - let valueFromInitial; - if (typeof initial === "string" || typeof initial === "object") { - const variant = resolveVariantFromProps(this.props, initial, this.presenceContext?.custom); - if (variant) { - valueFromInitial = variant[key]; - } - } - /** - * If this value still exists in the current initial variant, read that. - */ - if (initial && valueFromInitial !== undefined) { - return valueFromInitial; - } - /** - * Alternatively, if this VisualElement config has defined a getBaseTarget - * so we can read the value from an alternative source, try that. - */ - const target = this.getBaseTargetFromProps(this.props, key); - if (target !== undefined && !isMotionValue(target)) - return target; - /** - * If the value was initially defined on initial, but it doesn't any more, - * return undefined. Otherwise return the value as initially read from the DOM. - */ - return this.initialValues[key] !== undefined && - valueFromInitial === undefined - ? undefined - : this.baseTarget[key]; - } - on(eventName, callback) { - if (!this.events[eventName]) { - this.events[eventName] = new SubscriptionManager(); - } - return this.events[eventName].add(callback); - } - notify(eventName, ...args) { - if (this.events[eventName]) { - this.events[eventName].notify(...args); - } - } - scheduleRenderMicrotask() { - microtask.render(this.render); - } - } - - class DOMVisualElement extends VisualElement { - constructor() { - super(...arguments); - this.KeyframeResolver = DOMKeyframesResolver; - } - sortInstanceNodePosition(a, b) { - /** - * compareDocumentPosition returns a bitmask, by using the bitwise & - * we're returning true if 2 in that bitmask is set to true. 2 is set - * to true if b preceeds a. - */ - return a.compareDocumentPosition(b) & 2 ? 1 : -1; - } - getBaseTargetFromProps(props, key) { - const style = props.style; - return style ? style[key] : undefined; - } - removeValueFromRenderState(key, { vars, style }) { - delete vars[key]; - delete style[key]; - } - handleChildMotionValue() { - if (this.childSubscription) { - this.childSubscription(); - delete this.childSubscription; - } - const { children } = this.props; - if (isMotionValue(children)) { - this.childSubscription = children.on("change", (latest) => { - if (this.current) { - this.current.textContent = `${latest}`; - } - }); - } - } - } - - /** - * Feature base class for extending VisualElement functionality. - * Features are plugins that can be mounted/unmounted to add behavior - * like gestures, animations, or layout tracking. - */ - class Feature { - constructor(node) { - this.isMounted = false; - this.node = node; - } - update() { } - } - - /** - * Bounding boxes tend to be defined as top, left, right, bottom. For various operations - * it's easier to consider each axis individually. This function returns a bounding box - * as a map of single-axis min/max values. - */ - function convertBoundingBoxToBox({ top, left, right, bottom, }) { - return { - x: { min: left, max: right }, - y: { min: top, max: bottom }, - }; - } - function convertBoxToBoundingBox({ x, y }) { - return { top: y.min, right: x.max, bottom: y.max, left: x.min }; - } - /** - * Applies a TransformPoint function to a bounding box. TransformPoint is usually a function - * provided by Framer to allow measured points to be corrected for device scaling. This is used - * when measuring DOM elements and DOM event points. - */ - function transformBoxPoints(point, transformPoint) { - if (!transformPoint) - return point; - const topLeft = transformPoint({ x: point.left, y: point.top }); - const bottomRight = transformPoint({ x: point.right, y: point.bottom }); - return { - top: topLeft.y, - left: topLeft.x, - bottom: bottomRight.y, - right: bottomRight.x, - }; - } - - function isIdentityScale(scale) { - return scale === undefined || scale === 1; - } - function hasScale({ scale, scaleX, scaleY }) { - return (!isIdentityScale(scale) || - !isIdentityScale(scaleX) || - !isIdentityScale(scaleY)); - } - function hasTransform(values) { - return (hasScale(values) || - has2DTranslate(values) || - values.z || - values.rotate || - values.rotateX || - values.rotateY || - values.skewX || - values.skewY); - } - function has2DTranslate(values) { - return is2DTranslate(values.x) || is2DTranslate(values.y); - } - function is2DTranslate(value) { - return value && value !== "0%"; - } - - /** - * Scales a point based on a factor and an originPoint - */ - function scalePoint(point, scale, originPoint) { - const distanceFromOrigin = point - originPoint; - const scaled = scale * distanceFromOrigin; - return originPoint + scaled; - } - /** - * Applies a translate/scale delta to a point - */ - function applyPointDelta(point, translate, scale, originPoint, boxScale) { - if (boxScale !== undefined) { - point = scalePoint(point, boxScale, originPoint); - } - return scalePoint(point, scale, originPoint) + translate; - } - /** - * Applies a translate/scale delta to an axis - */ - function applyAxisDelta(axis, translate = 0, scale = 1, originPoint, boxScale) { - axis.min = applyPointDelta(axis.min, translate, scale, originPoint, boxScale); - axis.max = applyPointDelta(axis.max, translate, scale, originPoint, boxScale); - } - /** - * Applies a translate/scale delta to a box - */ - function applyBoxDelta(box, { x, y }) { - applyAxisDelta(box.x, x.translate, x.scale, x.originPoint); - applyAxisDelta(box.y, y.translate, y.scale, y.originPoint); - } - const TREE_SCALE_SNAP_MIN = 0.999999999999; - const TREE_SCALE_SNAP_MAX = 1.0000000000001; - /** - * Apply a tree of deltas to a box. We do this to calculate the effect of all the transforms - * in a tree upon our box before then calculating how to project it into our desired viewport-relative box - * - * This is the final nested loop within updateLayoutDelta for future refactoring - */ - function applyTreeDeltas(box, treeScale, treePath, isSharedTransition = false) { - const treeLength = treePath.length; - if (!treeLength) - return; - // Reset the treeScale - treeScale.x = treeScale.y = 1; - let node; - let delta; - for (let i = 0; i < treeLength; i++) { - node = treePath[i]; - delta = node.projectionDelta; - /** - * TODO: Prefer to remove this, but currently we have motion components with - * display: contents in Framer. - */ - const { visualElement } = node.options; - if (visualElement && - visualElement.props.style && - visualElement.props.style.display === "contents") { - continue; - } - if (isSharedTransition && - node.options.layoutScroll && - node.scroll && - node !== node.root) { - translateAxis(box.x, -node.scroll.offset.x); - translateAxis(box.y, -node.scroll.offset.y); - } - if (delta) { - // Incoporate each ancestor's scale into a cumulative treeScale for this component - treeScale.x *= delta.x.scale; - treeScale.y *= delta.y.scale; - // Apply each ancestor's calculated delta into this component's recorded layout box - applyBoxDelta(box, delta); - } - if (isSharedTransition && hasTransform(node.latestValues)) { - transformBox(box, node.latestValues, node.layout?.layoutBox); - } - } - /** - * Snap tree scale back to 1 if it's within a non-perceivable threshold. - * This will help reduce useless scales getting rendered. - */ - if (treeScale.x < TREE_SCALE_SNAP_MAX && - treeScale.x > TREE_SCALE_SNAP_MIN) { - treeScale.x = 1.0; - } - if (treeScale.y < TREE_SCALE_SNAP_MAX && - treeScale.y > TREE_SCALE_SNAP_MIN) { - treeScale.y = 1.0; - } - } - function translateAxis(axis, distance) { - axis.min += distance; - axis.max += distance; - } - /** - * Apply a transform to an axis from the latest resolved motion values. - * This function basically acts as a bridge between a flat motion value map - * and applyAxisDelta - */ - function transformAxis(axis, axisTranslate, axisScale, boxScale, axisOrigin = 0.5) { - const originPoint = mixNumber$1(axis.min, axis.max, axisOrigin); - // Apply the axis delta to the final axis - applyAxisDelta(axis, axisTranslate, axisScale, originPoint, boxScale); - } - function resolveAxisTranslate(value, axis) { - if (typeof value === "string") { - return (parseFloat(value) / 100) * (axis.max - axis.min); - } - return value; - } - /** - * Apply a transform to a box from the latest resolved motion values. - */ - function transformBox(box, transform, sourceBox) { - const resolveBox = sourceBox ?? box; - transformAxis(box.x, resolveAxisTranslate(transform.x, resolveBox.x), transform.scaleX, transform.scale, transform.originX); - transformAxis(box.y, resolveAxisTranslate(transform.y, resolveBox.y), transform.scaleY, transform.scale, transform.originY); - } - - function measureViewportBox(instance, transformPoint) { - return convertBoundingBoxToBox(transformBoxPoints(instance.getBoundingClientRect(), transformPoint)); - } - function measurePageBox(element, rootProjectionNode, transformPagePoint) { - const viewportBox = measureViewportBox(element, transformPagePoint); - const { scroll } = rootProjectionNode; - if (scroll) { - translateAxis(viewportBox.x, scroll.offset.x); - translateAxis(viewportBox.y, scroll.offset.y); - } - return viewportBox; - } - - const translateAlias = { - x: "translateX", - y: "translateY", - z: "translateZ", - transformPerspective: "perspective", - }; - const numTransforms = transformPropOrder.length; - /** - * Build a CSS transform style from individual x/y/scale etc properties. - * - * This outputs with a default order of transforms/scales/rotations, this can be customised by - * providing a transformTemplate function. - */ - function buildTransform(latestValues, transform, transformTemplate) { - // The transform string we're going to build into. - let transformString = ""; - let transformIsDefault = true; - /** - * Loop over all possible transforms in order, adding the ones that - * are present to the transform string. - */ - for (let i = 0; i < numTransforms; i++) { - const key = transformPropOrder[i]; - const value = latestValues[key]; - if (value === undefined) - continue; - let valueIsDefault = true; - if (typeof value === "number") { - valueIsDefault = value === (key.startsWith("scale") ? 1 : 0); - } - else { - const parsed = parseFloat(value); - valueIsDefault = key.startsWith("scale") ? parsed === 1 : parsed === 0; - } - if (!valueIsDefault || transformTemplate) { - const valueAsType = getValueAsType(value, numberValueTypes[key]); - if (!valueIsDefault) { - transformIsDefault = false; - const transformName = translateAlias[key] || key; - transformString += `${transformName}(${valueAsType}) `; - } - if (transformTemplate) { - transform[key] = valueAsType; - } - } - } - // `pathRotation` composes onto `rotate` as a separate additive term so - // the user's `rotate` is never clobbered. Deliberately not a slot in - // `transformPropOrder`. - const pathRotation = latestValues.pathRotation; - if (pathRotation) { - transformIsDefault = false; - transformString += `rotate(${getValueAsType(pathRotation, numberValueTypes.pathRotation)}) `; - } - transformString = transformString.trim(); - // If we have a custom `transform` template, pass our transform values and - // generated transformString to that before returning - if (transformTemplate) { - transformString = transformTemplate(transform, transformIsDefault ? "" : transformString); - } - else if (transformIsDefault) { - transformString = "none"; - } - return transformString; - } - - function buildHTMLStyles(state, latestValues, transformTemplate) { - const { style, vars, transformOrigin } = state; - // Track whether we encounter any transform or transformOrigin values. - let hasTransform = false; - let hasTransformOrigin = false; - /** - * Loop over all our latest animated values and decide whether to handle them - * as a style or CSS variable. - * - * Transforms and transform origins are kept separately for further processing. - */ - for (const key in latestValues) { - const value = latestValues[key]; - if (transformProps.has(key)) { - // If this is a transform, flag to enable further transform processing - hasTransform = true; - continue; - } - else if (isCSSVariableName(key)) { - vars[key] = value; - continue; - } - else { - // Convert the value to its default value type, ie 0 -> "0px" - const valueAsType = getValueAsType(value, numberValueTypes[key]); - if (key.startsWith("origin")) { - // If this is a transform origin, flag and enable further transform-origin processing - hasTransformOrigin = true; - transformOrigin[key] = - valueAsType; - } - else { - style[key] = valueAsType; - } - } - } - if (!latestValues.transform) { - if (hasTransform || transformTemplate) { - style.transform = buildTransform(latestValues, state.transform, transformTemplate); - } - else if (style.transform) { - /** - * If we have previously created a transform but currently don't have any, - * reset transform style to none. - */ - style.transform = "none"; - } - } - /** - * Build a transformOrigin style. Uses the same defaults as the browser for - * undefined origins. - */ - if (hasTransformOrigin) { - const { originX = "50%", originY = "50%", originZ = 0, } = transformOrigin; - style.transformOrigin = `${originX} ${originY} ${originZ}`; - } - } - - function renderHTML(element, { style, vars }, styleProp, projection) { - const elementStyle = element.style; - let key; - for (key in style) { - // CSSStyleDeclaration has [index: number]: string; in the types, so we use that as key type. - elementStyle[key] = style[key]; - } - // Write projection styles directly to element style - projection?.applyProjectionStyles(elementStyle, styleProp); - for (key in vars) { - // Loop over any CSS variables and assign those. - // They can only be assigned using `setProperty`. - elementStyle.setProperty(key, vars[key]); - } - } - - function pixelsToPercent(pixels, axis) { - if (axis.max === axis.min) - return 0; - return (pixels / (axis.max - axis.min)) * 100; - } - /** - * We always correct borderRadius as a percentage rather than pixels to reduce paints. - * For example, if you are projecting a box that is 100px wide with a 10px borderRadius - * into a box that is 200px wide with a 20px borderRadius, that is actually a 10% - * borderRadius in both states. If we animate between the two in pixels that will trigger - * a paint each time. If we animate between the two in percentage we'll avoid a paint. - */ - const correctBorderRadius = { - correct: (latest, node) => { - if (!node.target) - return latest; - /** - * If latest is a string, if it's a percentage we can return immediately as it's - * going to be stretched appropriately. Otherwise, if it's a pixel, convert it to a number. - */ - if (typeof latest === "string") { - if (px.test(latest)) { - latest = parseFloat(latest); - } - else { - return latest; - } - } - /** - * If latest is a number, it's a pixel value. We use the current viewportBox to calculate that - * pixel value as a percentage of each axis - */ - const x = pixelsToPercent(latest, node.target.x); - const y = pixelsToPercent(latest, node.target.y); - return `${x}% ${y}%`; - }, - }; - - const correctBoxShadow = { - correct: (latest, { treeScale, projectionDelta }) => { - const original = latest; - const shadow = complex.parse(latest); - // TODO: Doesn't support multiple shadows - if (shadow.length > 5) - return original; - const template = complex.createTransformer(latest); - const offset = typeof shadow[0] !== "number" ? 1 : 0; - // Calculate the overall context scale - const xScale = projectionDelta.x.scale * treeScale.x; - const yScale = projectionDelta.y.scale * treeScale.y; - shadow[0 + offset] /= xScale; - shadow[1 + offset] /= yScale; - /** - * Ideally we'd correct x and y scales individually, but because blur and - * spread apply to both we have to take a scale average and apply that instead. - * We could potentially improve the outcome of this by incorporating the ratio between - * the two scales. - */ - const averageScale = mixNumber$1(xScale, yScale, 0.5); - // Blur - if (typeof shadow[2 + offset] === "number") - shadow[2 + offset] /= averageScale; - // Spread - if (typeof shadow[3 + offset] === "number") - shadow[3 + offset] /= averageScale; - return template(shadow); - }, - }; - - const scaleCorrectors = { - borderRadius: { - ...correctBorderRadius, - applyTo: [...cornerRadiusProps], - }, - borderTopLeftRadius: correctBorderRadius, - borderTopRightRadius: correctBorderRadius, - borderBottomLeftRadius: correctBorderRadius, - borderBottomRightRadius: correctBorderRadius, - boxShadow: correctBoxShadow, - }; - function addScaleCorrector(correctors) { - for (const key in correctors) { - scaleCorrectors[key] = correctors[key]; - if (isCSSVariableName(key)) { - scaleCorrectors[key].isCSSVariable = true; - } - } - } - - function isForcedMotionValue(key, { layout, layoutId }) { - return (transformProps.has(key) || - key.startsWith("origin") || - ((layout || layoutId !== undefined) && - (!!scaleCorrectors[key] || key === "opacity"))); - } - - function scrapeMotionValuesFromProps$1(props, prevProps, visualElement) { - const style = props.style; - const prevStyle = prevProps?.style; - const newValues = {}; - if (!style) - return newValues; - for (const key in style) { - if (isMotionValue(style[key]) || - (prevStyle && isMotionValue(prevStyle[key])) || - isForcedMotionValue(key, props) || - visualElement?.getValue(key)?.liveStyle !== undefined) { - newValues[key] = style[key]; - } - } - return newValues; - } - - function getComputedStyle$1(element) { - return window.getComputedStyle(element); - } - class HTMLVisualElement extends DOMVisualElement { - constructor() { - super(...arguments); - this.type = "html"; - this.renderInstance = renderHTML; - } - mount(instance) { - /** - * If a custom component forwards its ref to something other than a - * HTML/SVG element (a class instance, an imperative handle) there's - * nothing for Motion to style, measure or attach gestures to. #2777 - */ - exports.invariant(Boolean(instance.style), "motion.create() components must forward their ref to a HTML or SVG element", "custom-component-ref"); - super.mount(instance); - } - readValueFromInstance(instance, key) { - if (transformProps.has(key)) { - return this.projection?.isProjecting - ? defaultTransformValue(key) - : readTransformValue(instance, key); - } - else { - const computedStyle = getComputedStyle$1(instance); - const value = (isCSSVariableName(key) - ? computedStyle.getPropertyValue(key) - : computedStyle[key]) || 0; - return typeof value === "string" ? value.trim() : value; - } - } - measureInstanceViewportBox(instance, { transformPagePoint }) { - return measureViewportBox(instance, transformPagePoint); - } - build(renderState, latestValues, props) { - buildHTMLStyles(renderState, latestValues, props.transformTemplate); - } - scrapeMotionValuesFromProps(props, prevProps, visualElement) { - return scrapeMotionValuesFromProps$1(props, prevProps, visualElement); - } - } - - function isObjectKey(key, object) { - return key in object; - } - class ObjectVisualElement extends VisualElement { - constructor() { - super(...arguments); - this.type = "object"; - } - readValueFromInstance(instance, key) { - if (isObjectKey(key, instance)) { - const value = instance[key]; - if (typeof value === "string" || typeof value === "number") { - return value; - } - } - return undefined; - } - getBaseTargetFromProps() { - return undefined; - } - removeValueFromRenderState(key, renderState) { - delete renderState.output[key]; - } - measureInstanceViewportBox() { - return createBox(); - } - build(renderState, latestValues) { - Object.assign(renderState.output, latestValues); - } - renderInstance(instance, { output }) { - Object.assign(instance, output); - } - sortInstanceNodePosition() { - return 0; - } - } - - const dashKeys = { - offset: "stroke-dashoffset", - array: "stroke-dasharray", - }; - const camelKeys = { - offset: "strokeDashoffset", - array: "strokeDasharray", - }; - /** - * Build SVG path properties. Uses the path's measured length to convert - * our custom pathLength, pathSpacing and pathOffset into stroke-dashoffset - * and stroke-dasharray attributes. - * - * This function is mutative to reduce per-frame GC. - * - * Note: We use unitless values for stroke-dasharray and stroke-dashoffset - * because Safari incorrectly scales px values when the page is zoomed. - */ - function buildSVGPath(attrs, length, spacing = 1, offset = 0, useDashCase = true) { - // Normalise path length by setting SVG attribute pathLength to 1 - attrs.pathLength = 1; - // We use dash case when setting attributes directly to the DOM node and camel case - // when defining props on a React component. - const keys = useDashCase ? dashKeys : camelKeys; - // Build the dash offset (unitless to avoid Safari zoom bug) - attrs[keys.offset] = `${-offset}`; - // Build the dash array (unitless to avoid Safari zoom bug) - attrs[keys.array] = `${length} ${spacing}`; - } - - const cssStyleProperties = [ - "transform", - "opacity", - "offsetDistance", - "offsetPath", - "offsetRotate", - "offsetAnchor", - ]; - /** - * Build SVG visual attributes, like cx and style.transform - */ - function buildSVGAttrs(state, { attrX, attrY, attrScale, pathLength, pathSpacing = 1, pathOffset = 0, - // This is object creation, which we try to avoid per-frame. - ...latest }, isSVGTag, transformTemplate, styleProp) { - buildHTMLStyles(state, latest, transformTemplate); - /** - * For svg tags we just want to make sure viewBox is animatable and treat all the styles - * as normal HTML tags. - */ - if (isSVGTag) { - if (state.style.viewBox) { - state.attrs.viewBox = state.style.viewBox; - } - return; - } - state.attrs = state.style; - state.style = {}; - const { attrs, style } = state; - for (const key of cssStyleProperties) { - if (attrs[key] !== undefined) { - style[key] = attrs[key]; - delete attrs[key]; - } - } - if (style.transform || attrs.transformOrigin) { - style.transformOrigin = attrs.transformOrigin ?? "50% 50%"; - delete attrs.transformOrigin; - } - if (style.transform) { - /** - * SVG's element transform-origin uses its own median as a reference. - * Therefore, transformBox becomes a fill-box - */ - style.transformBox = styleProp?.transformBox ?? "fill-box"; - delete attrs.transformBox; - } - // Render attrX/attrY/attrScale as attributes - if (attrX !== undefined) - attrs.x = attrX; - if (attrY !== undefined) - attrs.y = attrY; - if (attrScale !== undefined) - attrs.scale = attrScale; - // Build SVG path if one has been defined - if (pathLength !== undefined) { - buildSVGPath(attrs, pathLength, pathSpacing, pathOffset, false); - } - } - - /** - * A set of attribute names that are always read/written as camel case. - */ - const camelCaseAttributes = new Set([ - "baseFrequency", - "diffuseConstant", - "kernelMatrix", - "kernelUnitLength", - "keySplines", - "keyTimes", - "limitingConeAngle", - "markerHeight", - "markerWidth", - "numOctaves", - "targetX", - "targetY", - "surfaceScale", - "specularConstant", - "specularExponent", - "stdDeviation", - "tableValues", - "viewBox", - "gradientTransform", - "pathLength", - "startOffset", - "textLength", - "lengthAdjust", - ]); - - const isSVGTag = (tag) => typeof tag === "string" && tag.toLowerCase() === "svg"; - - function renderSVG(element, renderState, _styleProp, projection) { - renderHTML(element, renderState, undefined, projection); - for (const key in renderState.attrs) { - element.setAttribute(!camelCaseAttributes.has(key) ? camelToDash(key) : key, renderState.attrs[key]); - } - } - - function scrapeMotionValuesFromProps(props, prevProps, visualElement) { - const newValues = scrapeMotionValuesFromProps$1(props, prevProps, visualElement); - for (const key in props) { - if (isMotionValue(props[key]) || - isMotionValue(prevProps[key])) { - const targetKey = transformPropOrder.indexOf(key) !== -1 - ? "attr" + key.charAt(0).toUpperCase() + key.substring(1) - : key; - newValues[targetKey] = props[key]; - } - } - return newValues; - } - - class SVGVisualElement extends DOMVisualElement { - constructor() { - super(...arguments); - this.type = "svg"; - this.isSVGTag = false; - this.measureInstanceViewportBox = createBox; - } - getBaseTargetFromProps(props, key) { - return props[key]; - } - readValueFromInstance(instance, key) { - if (transformProps.has(key)) { - const defaultType = getDefaultValueType(key); - return defaultType ? defaultType.default || 0 : 0; - } - if (cssStyleProperties.includes(key)) { - const computedStyle = getComputedStyle(instance); - const value = computedStyle[key]; - if (typeof value === "string" && value) - return value.trim(); - } - key = !camelCaseAttributes.has(key) ? camelToDash(key) : key; - return instance.getAttribute(key); - } - scrapeMotionValuesFromProps(props, prevProps, visualElement) { - return scrapeMotionValuesFromProps(props, prevProps, visualElement); - } - build(renderState, latestValues, props) { - buildSVGAttrs(renderState, latestValues, this.isSVGTag, props.transformTemplate, props.style); - } - renderInstance(instance, renderState, styleProp, projection) { - renderSVG(instance, renderState, styleProp, projection); - } - mount(instance) { - this.isSVGTag = isSVGTag(instance.tagName); - super.mount(instance); - } - } - - const numVariantProps = variantProps.length; - /** - * Get variant context from a visual element's parent chain. - * Uses `any` type for visualElement to avoid circular dependencies. - */ - function getVariantContext(visualElement) { - if (!visualElement) - return undefined; - if (!visualElement.isControllingVariants) { - const context = visualElement.parent - ? getVariantContext(visualElement.parent) || {} - : {}; - if (visualElement.props.initial !== undefined) { - context.initial = visualElement.props.initial; - } - return context; - } - const context = {}; - for (let i = 0; i < numVariantProps; i++) { - const name = variantProps[i]; - const prop = visualElement.props[name]; - if (isVariantLabel(prop) || prop === false) { - context[name] = prop; - } - } - return context; - } - - function shallowCompare(next, prev) { - if (!Array.isArray(prev)) - return false; - const prevLength = prev.length; - if (prevLength !== next.length) - return false; - for (let i = 0; i < prevLength; i++) { - if (prev[i] !== next[i]) - return false; - } - return true; - } - - const reversePriorityOrder = [...variantPriorityOrder].reverse(); - const numAnimationTypes = variantPriorityOrder.length; - function createAnimateFunction(visualElement) { - return (animations) => { - return Promise.all(animations.map(({ animation, options }) => animateVisualElement(visualElement, animation, options))); - }; - } - function createAnimationState(visualElement) { - let animate = createAnimateFunction(visualElement); - let state = createState(); - let isInitialRender = true; - /** - * Track whether the animation state has been reset (e.g. via StrictMode - * double-invocation or Suspense unmount/remount). On the first - * animateChanges() call after a reset we need to behave like the initial - * render for variant-inheritance checks, even though isInitialRender is - * already false. - */ - let wasReset = false; - /** - * This function will be used to reduce the animation definitions for - * each active animation type into an object of resolved values for it. - */ - const buildResolvedTypeValues = (type) => (acc, definition) => { - const resolved = resolveVariant(visualElement, definition, type === "exit" - ? visualElement.presenceContext?.custom - : undefined); - if (resolved) { - const { transition, transitionEnd, ...target } = resolved; - acc = { ...acc, ...target, ...transitionEnd }; - } - return acc; - }; - /** - * This just allows us to inject mocked animation functions - * @internal - */ - function setAnimateFunction(makeAnimator) { - animate = makeAnimator(visualElement); - } - /** - * When we receive new props, we need to: - * 1. Create a list of protected keys for each type. This is a directory of - * value keys that are currently being "handled" by types of a higher priority - * so that whenever an animation is played of a given type, these values are - * protected from being animated. - * 2. Determine if an animation type needs animating. - * 3. Determine if any values have been removed from a type and figure out - * what to animate those to. - */ - function animateChanges(changedActiveType) { - const { props } = visualElement; - const context = getVariantContext(visualElement.parent) || {}; - /** - * A list of animations that we'll build into as we iterate through the animation - * types. This will get executed at the end of the function. - */ - const animations = []; - /** - * Keep track of which values have been removed. Then, as we hit lower priority - * animation types, we can check if they contain removed values and animate to that. - */ - const removedKeys = new Set(); - /** - * A dictionary of all encountered keys. This is an object to let us build into and - * copy it without iteration. Each time we hit an animation type we set its protected - * keys - the keys its not allowed to animate - to the latest version of this object. - */ - let encounteredKeys = {}; - /** - * If a variant has been removed at a given index, and this component is controlling - * variant animations, we want to ensure lower-priority variants are forced to animate. - */ - let removedVariantIndex = Infinity; - /** - * Iterate through all animation types in reverse priority order. For each, we want to - * detect which values it's handling and whether or not they've changed (and therefore - * need to be animated). If any values have been removed, we want to detect those in - * lower priority props and flag for animation. - */ - for (let i = 0; i < numAnimationTypes; i++) { - const type = reversePriorityOrder[i]; - const typeState = state[type]; - const prop = props[type] !== undefined - ? props[type] - : context[type]; - const propIsVariant = isVariantLabel(prop); - /** - * If this type has *just* changed isActive status, set activeDelta - * to that status. Otherwise set to null. - */ - const activeDelta = type === changedActiveType ? typeState.isActive : null; - if (activeDelta === false) - removedVariantIndex = i; - /** - * If this prop is an inherited variant, rather than been set directly on the - * component itself, we want to make sure we allow the parent to trigger animations. - * - * TODO: Can probably change this to a !isControllingVariants check - */ - let isInherited = prop === context[type] && - prop !== props[type] && - propIsVariant; - if (isInherited && - (isInitialRender || wasReset) && - visualElement.manuallyAnimateOnMount) { - isInherited = false; - } - /** - * Set all encountered keys so far as the protected keys for this type. This will - * be any key that has been animated or otherwise handled by active, higher-priortiy types. - */ - typeState.protectedKeys = { ...encounteredKeys }; - // Check if we can skip analysing this prop early - if ( - // If it isn't active and hasn't *just* been set as inactive - (!typeState.isActive && activeDelta === null) || - // If we didn't and don't have any defined prop for this animation type - (!prop && !typeState.prevProp) || - // Or if the prop doesn't define an animation - isAnimationControls(prop) || - typeof prop === "boolean") { - continue; - } - /** - * If exit is already active and wasn't just activated, skip - * re-processing to prevent interrupting running exit animations. - * Re-resolving exit with a changed custom value can start new - * value animations that stop the originals, leaving the exit - * animation promise unresolved and the component stuck in the DOM. - */ - if (type === "exit" && typeState.isActive && activeDelta !== true) { - if (typeState.prevResolvedValues) { - encounteredKeys = { - ...encounteredKeys, - ...typeState.prevResolvedValues, - }; - } - continue; - } - /** - * As we go look through the values defined on this type, if we detect - * a changed value or a value that was removed in a higher priority, we set - * this to true and add this prop to the animation list. - */ - const variantDidChange = checkVariantsDidChange(typeState.prevProp, prop); - let shouldAnimateType = variantDidChange || - // If we're making this variant active, we want to always make it active - (type === changedActiveType && - typeState.isActive && - !isInherited && - propIsVariant) || - // If we removed a higher-priority variant (i is in reverse order) - (i > removedVariantIndex && propIsVariant); - let handledRemovedValues = false; - /** - * As animations can be set as variant lists, variants or target objects, we - * coerce everything to an array if it isn't one already - */ - const definitionList = Array.isArray(prop) ? prop : [prop]; - /** - * Build an object of all the resolved values. We'll use this in the subsequent - * animateChanges calls to determine whether a value has changed. - */ - let resolvedValues = definitionList.reduce(buildResolvedTypeValues(type), {}); - if (activeDelta === false) - resolvedValues = {}; - /** - * Now we need to loop through all the keys in the prev prop and this prop, - * and decide: - * 1. If the value has changed, and needs animating - * 2. If it has been removed, and needs adding to the removedKeys set - * 3. If it has been removed in a higher priority type and needs animating - * 4. If it hasn't been removed in a higher priority but hasn't changed, and - * needs adding to the type's protectedKeys list. - */ - const { prevResolvedValues = {} } = typeState; - const allKeys = { - ...prevResolvedValues, - ...resolvedValues, - }; - const markToAnimate = (key) => { - shouldAnimateType = true; - if (removedKeys.has(key)) { - handledRemovedValues = true; - removedKeys.delete(key); - } - typeState.needsAnimating[key] = true; - const motionValue = visualElement.getValue(key); - if (motionValue) - motionValue.liveStyle = false; - }; - for (const key in allKeys) { - const next = resolvedValues[key]; - const prev = prevResolvedValues[key]; - // If we've already handled this we can just skip ahead - if (encounteredKeys.hasOwnProperty(key)) - continue; - /** - * If the value has changed, we probably want to animate it. - */ - let valueHasChanged = false; - if (isKeyframesTarget(next) && isKeyframesTarget(prev)) { - valueHasChanged = - !shallowCompare(next, prev) || variantDidChange; - } - else { - valueHasChanged = next !== prev; - } - if (valueHasChanged) { - if (next !== undefined && next !== null) { - // If next is defined and doesn't equal prev, it needs animating - markToAnimate(key); - } - else { - // If it's undefined, it's been removed. - removedKeys.add(key); - } - } - else if (next !== undefined && removedKeys.has(key)) { - /** - * If next hasn't changed and it isn't undefined, we want to check if it's - * been removed by a higher priority - */ - markToAnimate(key); - } - else { - /** - * If it hasn't changed, we add it to the list of protected values - * to ensure it doesn't get animated. - */ - typeState.protectedKeys[key] = true; - } - } - /** - * Update the typeState so next time animateChanges is called we can compare the - * latest prop and resolvedValues to these. - */ - typeState.prevProp = prop; - typeState.prevResolvedValues = resolvedValues; - if (typeState.isActive) { - encounteredKeys = { ...encounteredKeys, ...resolvedValues }; - } - if ((isInitialRender || wasReset) && - visualElement.blockInitialAnimation) { - shouldAnimateType = false; - } - /** - * If this is an inherited prop we want to skip this animation - * unless the inherited variants haven't changed on this render. - */ - const willAnimateViaParent = isInherited && variantDidChange; - const needsAnimating = !willAnimateViaParent || handledRemovedValues; - if (shouldAnimateType && needsAnimating) { - animations.push(...definitionList.map((animation) => { - const options = { type }; - /** - * If we're performing the initial animation, but we're not - * rendering at the same time as the variant-controlling parent, - * we want to use the parent's transition to calculate the stagger. - */ - if (typeof animation === "string" && - (isInitialRender || wasReset) && - !willAnimateViaParent && - visualElement.manuallyAnimateOnMount && - visualElement.parent) { - const { parent } = visualElement; - const parentVariant = resolveVariant(parent, animation); - if (parent.enteringChildren && parentVariant) { - const { delayChildren } = parentVariant.transition || {}; - options.delay = calcChildStagger(parent.enteringChildren, visualElement, delayChildren); - } - } - return { - animation: animation, - options, - }; - })); - } - } - /** - * If there are some removed value that haven't been dealt with, - * we need to create a new animation that falls back either to the value - * defined in the style prop, or the last read value. - */ - if (removedKeys.size) { - const fallbackAnimation = {}; - /** - * If the initial prop contains a transition we can use that, otherwise - * allow the animation function to use the visual element's default. - */ - if (typeof props.initial !== "boolean") { - const initialTransition = resolveVariant(visualElement, Array.isArray(props.initial) - ? props.initial[0] - : props.initial); - if (initialTransition && initialTransition.transition) { - fallbackAnimation.transition = initialTransition.transition; - } - } - removedKeys.forEach((key) => { - const fallbackTarget = visualElement.getBaseTarget(key); - const motionValue = visualElement.getValue(key); - if (motionValue) - motionValue.liveStyle = true; - // @ts-expect-error - @mattgperry to figure if we should do something here - fallbackAnimation[key] = fallbackTarget ?? null; - }); - animations.push({ animation: fallbackAnimation }); - } - let shouldAnimate = Boolean(animations.length); - if (isInitialRender && - (props.initial === false || props.initial === props.animate) && - !visualElement.manuallyAnimateOnMount) { - shouldAnimate = false; - } - isInitialRender = false; - wasReset = false; - return shouldAnimate ? animate(animations) : Promise.resolve(); - } - /** - * Change whether a certain animation type is active. - */ - function setActive(type, isActive) { - // If the active state hasn't changed, we can safely do nothing here - if (state[type].isActive === isActive) - return Promise.resolve(); - // Propagate active change to children - visualElement.variantChildren?.forEach((child) => child.animationState?.setActive(type, isActive)); - state[type].isActive = isActive; - const animations = animateChanges(type); - for (const key in state) { - state[key].protectedKeys = {}; - } - return animations; - } - return { - animateChanges, - setActive, - setAnimateFunction, - getState: () => state, - reset: () => { - state = createState(); - wasReset = true; - }, - }; - } - function checkVariantsDidChange(prev, next) { - if (typeof next === "string") { - return next !== prev; - } - else if (Array.isArray(next)) { - return !shallowCompare(next, prev); - } - return false; - } - function createTypeState(isActive = false) { - return { - isActive, - protectedKeys: {}, - needsAnimating: {}, - prevResolvedValues: {}, - }; - } - function createState() { - return { - animate: createTypeState(true), - whileInView: createTypeState(), - whileHover: createTypeState(), - whileTap: createTypeState(), - whileDrag: createTypeState(), - whileFocus: createTypeState(), - exit: createTypeState(), - }; - } - - /** - * Reset an axis to the provided origin box. - * - * This is a mutative operation. - */ - function copyAxisInto(axis, originAxis) { - axis.min = originAxis.min; - axis.max = originAxis.max; - } - /** - * Reset a box to the provided origin box. - * - * This is a mutative operation. - */ - function copyBoxInto(box, originBox) { - copyAxisInto(box.x, originBox.x); - copyAxisInto(box.y, originBox.y); - } - /** - * Reset a delta to the provided origin box. - * - * This is a mutative operation. - */ - function copyAxisDeltaInto(delta, originDelta) { - delta.translate = originDelta.translate; - delta.scale = originDelta.scale; - delta.originPoint = originDelta.originPoint; - delta.origin = originDelta.origin; - } - - const SCALE_PRECISION = 0.0001; - const SCALE_MIN = 1 - SCALE_PRECISION; - const SCALE_MAX = 1 + SCALE_PRECISION; - const TRANSLATE_PRECISION = 0.01; - const TRANSLATE_MIN = 0 - TRANSLATE_PRECISION; - const TRANSLATE_MAX = 0 + TRANSLATE_PRECISION; - function calcLength(axis) { - return axis.max - axis.min; - } - function isNear(value, target, maxDistance) { - return Math.abs(value - target) <= maxDistance; - } - function calcAxisDelta(delta, source, target, origin = 0.5) { - delta.origin = origin; - delta.originPoint = mixNumber$1(source.min, source.max, delta.origin); - delta.scale = calcLength(target) / calcLength(source); - delta.translate = - mixNumber$1(target.min, target.max, delta.origin) - delta.originPoint; - if ((delta.scale >= SCALE_MIN && delta.scale <= SCALE_MAX) || - isNaN(delta.scale)) { - delta.scale = 1.0; - } - if ((delta.translate >= TRANSLATE_MIN && - delta.translate <= TRANSLATE_MAX) || - isNaN(delta.translate)) { - delta.translate = 0.0; - } - } - function calcBoxDelta(delta, source, target, origin) { - calcAxisDelta(delta.x, source.x, target.x, origin ? origin.originX : undefined); - calcAxisDelta(delta.y, source.y, target.y, origin ? origin.originY : undefined); - } - function calcRelativeAxis(target, relative, parent, anchor = 0) { - const anchorPoint = anchor - ? mixNumber$1(parent.min, parent.max, anchor) - : parent.min; - target.min = anchorPoint + relative.min; - target.max = target.min + calcLength(relative); - } - function calcRelativeBox(target, relative, parent, anchor) { - calcRelativeAxis(target.x, relative.x, parent.x, anchor?.x); - calcRelativeAxis(target.y, relative.y, parent.y, anchor?.y); - } - function calcRelativeAxisPosition(target, layout, parent, anchor = 0) { - const anchorPoint = anchor - ? mixNumber$1(parent.min, parent.max, anchor) - : parent.min; - target.min = layout.min - anchorPoint; - target.max = target.min + calcLength(layout); - } - function calcRelativePosition(target, layout, parent, anchor) { - calcRelativeAxisPosition(target.x, layout.x, parent.x, anchor?.x); - calcRelativeAxisPosition(target.y, layout.y, parent.y, anchor?.y); - } - - /** - * Remove a delta from a point. This is essentially the steps of applyPointDelta in reverse - */ - function removePointDelta(point, translate, scale, originPoint, boxScale) { - point -= translate; - point = scalePoint(point, 1 / scale, originPoint); - if (boxScale !== undefined) { - point = scalePoint(point, 1 / boxScale, originPoint); - } - return point; - } - /** - * Remove a delta from an axis. This is essentially the steps of applyAxisDelta in reverse - */ - function removeAxisDelta(axis, translate = 0, scale = 1, origin = 0.5, boxScale, originAxis = axis, sourceAxis = axis) { - if (percent.test(translate)) { - translate = parseFloat(translate); - const relativeProgress = mixNumber$1(sourceAxis.min, sourceAxis.max, translate / 100); - translate = relativeProgress - sourceAxis.min; - } - if (typeof translate !== "number") - return; - let originPoint = mixNumber$1(originAxis.min, originAxis.max, origin); - if (axis === originAxis) - originPoint -= translate; - axis.min = removePointDelta(axis.min, translate, scale, originPoint, boxScale); - axis.max = removePointDelta(axis.max, translate, scale, originPoint, boxScale); - } - /** - * Remove a transforms from an axis. This is essentially the steps of applyAxisTransforms in reverse - * and acts as a bridge between motion values and removeAxisDelta - */ - function removeAxisTransforms(axis, transforms, [key, scaleKey, originKey], origin, sourceAxis) { - removeAxisDelta(axis, transforms[key], transforms[scaleKey], transforms[originKey], transforms.scale, origin, sourceAxis); - } - /** - * The names of the motion values we want to apply as translation, scale and origin. - */ - const xKeys = ["x", "scaleX", "originX"]; - const yKeys = ["y", "scaleY", "originY"]; - /** - * Remove a transforms from an box. This is essentially the steps of applyAxisBox in reverse - * and acts as a bridge between motion values and removeAxisDelta - */ - function removeBoxTransforms(box, transforms, originBox, sourceBox) { - removeAxisTransforms(box.x, transforms, xKeys, originBox ? originBox.x : undefined, sourceBox ? sourceBox.x : undefined); - removeAxisTransforms(box.y, transforms, yKeys, originBox ? originBox.y : undefined, sourceBox ? sourceBox.y : undefined); - } - - function isAxisDeltaZero(delta) { - return delta.translate === 0 && delta.scale === 1; - } - function isDeltaZero(delta) { - return isAxisDeltaZero(delta.x) && isAxisDeltaZero(delta.y); - } - function axisEquals(a, b) { - return a.min === b.min && a.max === b.max; - } - function boxEquals(a, b) { - return axisEquals(a.x, b.x) && axisEquals(a.y, b.y); - } - function axisEqualsRounded(a, b) { - return (Math.round(a.min) === Math.round(b.min) && - Math.round(a.max) === Math.round(b.max)); - } - function boxEqualsRounded(a, b) { - return axisEqualsRounded(a.x, b.x) && axisEqualsRounded(a.y, b.y); - } - function aspectRatio(box) { - return calcLength(box.x) / calcLength(box.y); - } - function axisDeltaEquals(a, b) { - return (a.translate === b.translate && - a.scale === b.scale && - a.originPoint === b.originPoint); - } - - function eachAxis(callback) { - return [callback("x"), callback("y")]; - } - - function buildProjectionTransform(delta, treeScale, latestTransform) { - let transform = ""; - /** - * The translations we use to calculate are always relative to the viewport coordinate space. - * But when we apply scales, we also scale the coordinate space of an element and its children. - * For instance if we have a treeScale (the culmination of all parent scales) of 0.5 and we need - * to move an element 100 pixels, we actually need to move it 200 in within that scaled space. - */ - const xTranslate = delta.x.translate / treeScale.x; - const yTranslate = delta.y.translate / treeScale.y; - const zTranslate = latestTransform?.z || 0; - if (xTranslate || yTranslate || zTranslate) { - transform = `translate3d(${xTranslate}px, ${yTranslate}px, ${zTranslate}px) `; - } - /** - * Apply scale correction for the tree transform. - * This will apply scale to the screen-orientated axes. - */ - if (treeScale.x !== 1 || treeScale.y !== 1) { - transform += `scale(${1 / treeScale.x}, ${1 / treeScale.y}) `; - } - if (latestTransform) { - const { transformPerspective, rotate, pathRotation, rotateX, rotateY, skewX, skewY, } = latestTransform; - if (transformPerspective) - transform = `perspective(${transformPerspective}px) ${transform}`; - if (rotate) - transform += `rotate(${rotate}deg) `; - // Additive `rotate()` so user `rotate` isn't clobbered. - if (pathRotation) - transform += `rotate(${pathRotation}deg) `; - if (rotateX) - transform += `rotateX(${rotateX}deg) `; - if (rotateY) - transform += `rotateY(${rotateY}deg) `; - if (skewX) - transform += `skewX(${skewX}deg) `; - if (skewY) - transform += `skewY(${skewY}deg) `; - } - /** - * Apply scale to match the size of the element to the size we want it. - * This will apply scale to the element-orientated axes. - */ - const elementScaleX = delta.x.scale * treeScale.x; - const elementScaleY = delta.y.scale * treeScale.y; - if (elementScaleX !== 1 || elementScaleY !== 1) { - transform += `scale(${elementScaleX}, ${elementScaleY})`; - } - return transform || "none"; - } - - const numBorders = cornerRadiusProps.length; - const asNumber = (value) => typeof value === "string" ? parseFloat(value) : value; - const isPx = (value) => typeof value === "number" || px.test(value); - function mixValues(target, follow, lead, progress, shouldCrossfadeOpacity, isOnlyMember) { - if (shouldCrossfadeOpacity) { - target.opacity = mixNumber$1(0, lead.opacity ?? 1, easeCrossfadeIn(progress)); - target.opacityExit = mixNumber$1(follow.opacity ?? 1, 0, easeCrossfadeOut(progress)); - } - else if (isOnlyMember) { - target.opacity = mixNumber$1(follow.opacity ?? 1, lead.opacity ?? 1, progress); - } - /** - * Mix border radius - */ - for (let i = 0; i < numBorders; i++) { - const borderLabel = cornerRadiusProps[i]; - let followRadius = getRadius(follow, borderLabel); - let leadRadius = getRadius(lead, borderLabel); - if (followRadius === undefined && leadRadius === undefined) - continue; - followRadius || (followRadius = 0); - leadRadius || (leadRadius = 0); - const canMix = followRadius === 0 || - leadRadius === 0 || - isPx(followRadius) === isPx(leadRadius); - if (canMix) { - target[borderLabel] = Math.max(mixNumber$1(asNumber(followRadius), asNumber(leadRadius), progress), 0); - if (percent.test(leadRadius) || percent.test(followRadius)) { - target[borderLabel] += "%"; - } - } - else { - target[borderLabel] = leadRadius; - } - } - /** - * Mix rotation - */ - if (follow.rotate || lead.rotate) { - target.rotate = mixNumber$1(follow.rotate || 0, lead.rotate || 0, progress); - } - } - function getRadius(values, radiusName) { - return values[radiusName] !== undefined - ? values[radiusName] - : values.borderRadius; - } - const easeCrossfadeIn = /*@__PURE__*/ compress(0, 0.5, circOut); - const easeCrossfadeOut = /*@__PURE__*/ compress(0.5, 0.95, noop); - function compress(min, max, easing) { - return (p) => { - // Could replace ifs with clamp - if (p < min) - return 0; - if (p > max) - return 1; - return easing(progress(min, max, p)); - }; - } - - function animateSingleValue(value, keyframes, options) { - const motionValue$1 = isMotionValue(value) ? value : motionValue(value); - motionValue$1.start(animateMotionValue("", motionValue$1, keyframes, options)); - return motionValue$1.animation; - } - - function addDomEvent(target, eventName, handler, options = { passive: true }) { - target.addEventListener(eventName, handler, options); - return () => target.removeEventListener(eventName, handler, options); - } - - const compareByDepth = (a, b) => a.depth - b.depth; - - class FlatTree { - constructor() { - this.children = []; - this.isDirty = false; - } - add(child) { - addUniqueItem(this.children, child); - this.isDirty = true; - } - remove(child) { - removeItem(this.children, child); - this.isDirty = true; - } - forEach(callback) { - this.isDirty && this.children.sort(compareByDepth); - this.isDirty = false; - this.children.forEach(callback); - } - } - - /** - * Timeout defined in ms - */ - function delay(callback, timeout) { - const start = time.now(); - const checkElapsed = ({ timestamp }) => { - const elapsed = timestamp - start; - if (elapsed >= timeout) { - cancelFrame(checkElapsed); - callback(elapsed - timeout); - } - }; - frame.setup(checkElapsed, true); - return () => cancelFrame(checkElapsed); - } - function delayInSeconds(callback, timeout) { - return delay(callback, secondsToMilliseconds(timeout)); - } - - /** - * If the provided value is a MotionValue, this returns the actual value, otherwise just the value itself - */ - function resolveMotionValue(value) { - return isMotionValue(value) ? value.get() : value; - } - - class NodeStack { - constructor() { - this.members = []; - } - add(node) { - addUniqueItem(this.members, node); - for (let i = this.members.length - 1; i >= 0; i--) { - const member = this.members[i]; - if (member === node || member === this.lead || member === this.prevLead) - continue; - const inst = member.instance; - if ((!inst || inst.isConnected === false) && !member.snapshot) { - removeItem(this.members, member); - member.unmount(); - } - } - node.scheduleRender(); - } - remove(node) { - removeItem(this.members, node); - if (node === this.prevLead) - this.prevLead = undefined; - if (node === this.lead) { - const prevLead = this.members[this.members.length - 1]; - if (prevLead) - this.promote(prevLead); - } - } - relegate(node) { - for (let i = this.members.indexOf(node) - 1; i >= 0; i--) { - const member = this.members[i]; - if (member.isPresent !== false && member.instance?.isConnected !== false) { - this.promote(member); - return true; - } - } - return false; - } - promote(node, preserveFollowOpacity) { - const prevLead = this.lead; - if (node === prevLead) - return; - this.prevLead = prevLead; - this.lead = node; - node.show(); - if (prevLead) { - prevLead.updateSnapshot(); - node.scheduleRender(); - const { layoutDependency: prevDep } = prevLead.options; - const { layoutDependency: nextDep } = node.options; - if (prevDep === undefined || prevDep !== nextDep) { - node.resumeFrom = prevLead; - if (preserveFollowOpacity) - prevLead.preserveOpacity = true; - if (prevLead.snapshot) { - node.snapshot = prevLead.snapshot; - node.snapshot.latestValues = - prevLead.animationValues || prevLead.latestValues; - } - if (node.root?.isUpdating) - node.isLayoutDirty = true; - } - if (node.options.crossfade === false) - prevLead.hide(); - } - } - exitAnimationComplete() { - this.members.forEach((member) => { - member.options.onExitComplete?.(); - member.resumingFrom?.options.onExitComplete?.(); - }); - } - scheduleRender() { - this.members.forEach((member) => member.instance && member.scheduleRender(false)); - } - removeLeadSnapshot() { - if (this.lead?.snapshot) - this.lead.snapshot = undefined; - } - } - - /** - * This should only ever be modified on the client otherwise it'll - * persist through server requests. If we need instanced states we - * could lazy-init via root. - */ - const globalProjectionState = { - /** - * Global flag as to whether the tree has animated since the last time - * we resized the window - */ - hasAnimatedSinceResize: true, - /** - * We set this to true once, on the first update. Any nodes added to the tree beyond that - * update will be given a `data-projection-id` attribute. - */ - hasEverUpdated: false, - }; - - const metrics = { - nodes: 0, - calculatedTargetDeltas: 0, - calculatedProjections: 0, - }; - const transformAxes = ["", "X", "Y", "Z"]; - /** - * We use 1000 as the animation target as 0-1000 maps better to pixels than 0-1 - * which has a noticeable difference in spring animations - */ - const animationTarget = 1000; - let id = 0; - function resetDistortingTransform(key, visualElement, values, sharedAnimationValues) { - const { latestValues } = visualElement; - // Record the distorting transform and then temporarily set it to 0 - if (latestValues[key]) { - values[key] = latestValues[key]; - visualElement.setStaticValue(key, 0); - if (sharedAnimationValues) { - sharedAnimationValues[key] = 0; - } - } - } - function cancelTreeOptimisedTransformAnimations(projectionNode) { - projectionNode.hasCheckedOptimisedAppear = true; - if (projectionNode.root === projectionNode) - return; - const { visualElement } = projectionNode.options; - if (!visualElement) - return; - const appearId = getOptimisedAppearId(visualElement); - if (window.MotionHasOptimisedAnimation(appearId, "transform")) { - const { layout, layoutId } = projectionNode.options; - window.MotionCancelOptimisedAnimation(appearId, "transform", frame, !(layout || layoutId)); - } - const { parent } = projectionNode; - if (parent && !parent.hasCheckedOptimisedAppear) { - cancelTreeOptimisedTransformAnimations(parent); - } - } - function createProjectionNode({ attachResizeListener, defaultParent, measureScroll, checkIsScrollRoot, resetTransform, }) { - return class ProjectionNode { - constructor(latestValues = {}, parent = defaultParent?.()) { - /** - * A unique ID generated for every projection node. - */ - this.id = id++; - /** - * An id that represents a unique session instigated by startUpdate. - */ - this.animationId = 0; - this.animationCommitId = 0; - /** - * A Set containing all this component's children. This is used to iterate - * through the children. - * - * TODO: This could be faster to iterate as a flat array stored on the root node. - */ - this.children = new Set(); - /** - * Options for the node. We use this to configure what kind of layout animations - * we should perform (if any). - */ - this.options = {}; - /** - * We use this to detect when its safe to shut down part of a projection tree. - * We have to keep projecting children for scale correction and relative projection - * until all their parents stop performing layout animations. - */ - this.isTreeAnimating = false; - this.isAnimationBlocked = false; - /** - * Flag to true if we think this layout has been changed. We can't always know this, - * currently we set it to true every time a component renders, or if it has a layoutDependency - * if that has changed between renders. Additionally, components can be grouped by LayoutGroup - * and if one node is dirtied, they all are. - */ - this.isLayoutDirty = false; - /** - * Flag to true if we think the projection calculations for this node needs - * recalculating as a result of an updated transform or layout animation. - */ - this.isProjectionDirty = false; - /** - * Flag to true if the layout *or* transform has changed. This then gets propagated - * throughout the projection tree, forcing any element below to recalculate on the next frame. - */ - this.isSharedProjectionDirty = false; - /** - * Flag transform dirty. This gets propagated throughout the whole tree but is only - * respected by shared nodes. - */ - this.isTransformDirty = false; - /** - * Block layout updates for instant layout transitions throughout the tree. - */ - this.updateManuallyBlocked = false; - this.updateBlockedByResize = false; - /** - * Set to true between the start of the first `willUpdate` call and the end of the `didUpdate` - * call. - */ - this.isUpdating = false; - /** - * If this is an SVG element we currently disable projection transforms - */ - this.isSVG = false; - /** - * Flag to true (during promotion) if a node doing an instant layout transition needs to reset - * its projection styles. - */ - this.needsReset = false; - /** - * Flags whether this node should have its transform reset prior to measuring. - */ - this.shouldResetTransform = false; - /** - * Store whether this node has been checked for optimised appear animations. As - * effects fire bottom-up, and we want to look up the tree for appear animations, - * this makes sure we only check each path once, stopping at nodes that - * have already been checked. - */ - this.hasCheckedOptimisedAppear = false; - /** - * An object representing the calculated contextual/accumulated/tree scale. - * This will be used to scale calculcated projection transforms, as these are - * calculated in screen-space but need to be scaled for elements to layoutly - * make it to their calculated destinations. - * - * TODO: Lazy-init - */ - this.treeScale = { x: 1, y: 1 }; - /** - * - */ - this.eventHandlers = new Map(); - this.hasTreeAnimated = false; - this.layoutVersion = 0; - // Note: Currently only running on root node - this.updateScheduled = false; - this.scheduleUpdate = () => this.update(); - this.projectionUpdateScheduled = false; - this.checkUpdateFailed = () => { - if (this.isUpdating) { - this.isUpdating = false; - this.clearAllSnapshots(); - } - }; - /** - * This is a multi-step process as shared nodes might be of different depths. Nodes - * are sorted by depth order, so we need to resolve the entire tree before moving to - * the next step. - */ - this.updateProjection = () => { - this.projectionUpdateScheduled = false; - /** - * Reset debug counts. Manually resetting rather than creating a new - * object each frame. - */ - if (statsBuffer.value) { - metrics.nodes = - metrics.calculatedTargetDeltas = - metrics.calculatedProjections = - 0; - } - this.nodes.forEach(propagateDirtyNodes); - this.nodes.forEach(resolveTargetDelta); - this.nodes.forEach(calcProjection); - this.nodes.forEach(cleanDirtyNodes); - if (statsBuffer.addProjectionMetrics) { - statsBuffer.addProjectionMetrics(metrics); - } - }; - /** - * Frame calculations - */ - this.resolvedRelativeTargetAt = 0.0; - this.linkedParentVersion = 0; - this.hasProjected = false; - this.isVisible = true; - this.animationProgress = 0; - /** - * Shared layout - */ - // TODO Only running on root node - this.sharedNodes = new Map(); - this.latestValues = latestValues; - this.root = parent ? parent.root || parent : this; - this.path = parent ? [...parent.path, parent] : []; - this.parent = parent; - this.depth = parent ? parent.depth + 1 : 0; - for (let i = 0; i < this.path.length; i++) { - this.path[i].shouldResetTransform = true; - } - if (this.root === this) - this.nodes = new FlatTree(); - } - addEventListener(name, handler) { - if (!this.eventHandlers.has(name)) { - this.eventHandlers.set(name, new SubscriptionManager()); - } - return this.eventHandlers.get(name).add(handler); - } - notifyListeners(name, ...args) { - const subscriptionManager = this.eventHandlers.get(name); - subscriptionManager && subscriptionManager.notify(...args); - } - hasListeners(name) { - return this.eventHandlers.has(name); - } - /** - * Lifecycles - */ - mount(instance) { - if (this.instance) - return; - this.isSVG = isSVGElement(instance) && !isSVGSVGElement(instance); - this.instance = instance; - const { layoutId, layout, visualElement } = this.options; - if (visualElement && !visualElement.current) { - visualElement.mount(instance); - } - this.root.nodes.add(this); - this.parent && this.parent.children.add(this); - if (this.root.hasTreeAnimated && (layout || layoutId)) { - this.isLayoutDirty = true; - } - if (attachResizeListener) { - let cancelDelay; - let innerWidth = 0; - const resizeUnblockUpdate = () => (this.root.updateBlockedByResize = false); - // Set initial innerWidth in a frame.read callback to batch the read - frame.read(() => { - innerWidth = window.innerWidth; - }); - attachResizeListener(instance, () => { - const newInnerWidth = window.innerWidth; - if (newInnerWidth === innerWidth) - return; - innerWidth = newInnerWidth; - this.root.updateBlockedByResize = true; - cancelDelay && cancelDelay(); - cancelDelay = delay(resizeUnblockUpdate, 250); - if (globalProjectionState.hasAnimatedSinceResize) { - globalProjectionState.hasAnimatedSinceResize = false; - this.nodes.forEach(finishAnimation); - } - }); - } - if (layoutId) { - this.root.registerSharedNode(layoutId, this); - } - // Only register the handler if it requires layout animation - if (this.options.animate !== false && - visualElement && - (layoutId || layout)) { - this.addEventListener("didUpdate", ({ delta, hasLayoutChanged, hasRelativeLayoutChanged, layout: newLayout, }) => { - if (this.isTreeAnimationBlocked()) { - this.target = undefined; - this.relativeTarget = undefined; - return; - } - // TODO: Check here if an animation exists - const layoutTransition = this.options.transition || - visualElement.getDefaultTransition() || - defaultLayoutTransition; - const { onLayoutAnimationStart, onLayoutAnimationComplete, } = visualElement.getProps(); - /** - * The target layout of the element might stay the same, - * but its position relative to its parent has changed. - */ - const hasTargetChanged = !this.targetLayout || - !boxEqualsRounded(this.targetLayout, newLayout); - /* - * Note: Disabled to fix relative animations always triggering new - * layout animations. If this causes further issues, we can try - * a different approach to detecting relative target changes. - */ - // || hasRelativeLayoutChanged - /** - * If the layout hasn't seemed to have changed, it might be that the - * element is visually in the same place in the document but its position - * relative to its parent has indeed changed. So here we check for that. - */ - const hasOnlyRelativeTargetChanged = !hasLayoutChanged && hasRelativeLayoutChanged; - if (this.options.layoutRoot || - this.resumeFrom || - hasOnlyRelativeTargetChanged || - (hasLayoutChanged && - (hasTargetChanged || !this.currentAnimation))) { - if (this.resumeFrom) { - this.resumingFrom = this.resumeFrom; - this.resumingFrom.resumingFrom = undefined; - } - const animationOptions = { - ...getValueTransition$1(layoutTransition, "layout"), - onPlay: onLayoutAnimationStart, - onComplete: onLayoutAnimationComplete, - }; - if (visualElement.shouldReduceMotion || - this.options.layoutRoot) { - animationOptions.delay = 0; - animationOptions.type = false; - } - this.startAnimation(animationOptions); - /** - * Set animation origin after starting animation to avoid layout jump - * caused by stopping previous layout animation - */ - this.setAnimationOrigin(delta, hasOnlyRelativeTargetChanged, animationOptions - .path); - } - else { - /** - * If the layout hasn't changed and we have an animation that hasn't started yet, - * finish it immediately. Otherwise it will be animating from a location - * that was probably never committed to screen and look like a jumpy box. - */ - if (!hasLayoutChanged) { - finishAnimation(this); - } - if (this.isLead() && this.options.onExitComplete) { - this.options.onExitComplete(); - } - } - this.targetLayout = newLayout; - }); - } - } - unmount() { - this.options.layoutId && this.willUpdate(); - this.root.nodes.remove(this); - const stack = this.getStack(); - stack && stack.remove(this); - this.parent && this.parent.children.delete(this); - this.instance = undefined; - this.eventHandlers.clear(); - cancelFrame(this.updateProjection); - } - // only on the root - blockUpdate() { - this.updateManuallyBlocked = true; - } - unblockUpdate() { - this.updateManuallyBlocked = false; - } - isUpdateBlocked() { - return this.updateManuallyBlocked || this.updateBlockedByResize; - } - isTreeAnimationBlocked() { - return (this.isAnimationBlocked || - (this.parent && this.parent.isTreeAnimationBlocked()) || - false); - } - // Note: currently only running on root node - startUpdate() { - if (this.isUpdateBlocked()) - return; - this.isUpdating = true; - this.nodes && this.nodes.forEach(resetSkewAndRotation); - this.animationId++; - } - getTransformTemplate() { - const { visualElement } = this.options; - return visualElement && visualElement.getProps().transformTemplate; - } - willUpdate(shouldNotifyListeners = true) { - this.root.hasTreeAnimated = true; - if (this.root.isUpdateBlocked()) { - this.options.onExitComplete && this.options.onExitComplete(); - return; - } - /** - * If we're running optimised appear animations then these must be - * cancelled before measuring the DOM. This is so we can measure - * the true layout of the element rather than the WAAPI animation - * which will be unaffected by the resetSkewAndRotate step. - * - * Note: This is a DOM write. Worst case scenario is this is sandwiched - * between other snapshot reads which will cause unnecessary style recalculations. - * This has to happen here though, as we don't yet know which nodes will need - * snapshots in startUpdate(), but we only want to cancel optimised animations - * if a layout animation measurement is actually going to be affected by them. - */ - if (window.MotionCancelOptimisedAnimation && - !this.hasCheckedOptimisedAppear) { - cancelTreeOptimisedTransformAnimations(this); - } - !this.root.isUpdating && this.root.startUpdate(); - if (this.isLayoutDirty) - return; - this.isLayoutDirty = true; - for (let i = 0; i < this.path.length; i++) { - const node = this.path[i]; - node.shouldResetTransform = true; - /** - * Percentage translates resolve against layoutBox dimensions, - * so ancestors with them must be re-measured after transform reset. - */ - if (typeof node.latestValues.x === "string" || - typeof node.latestValues.y === "string") { - node.isLayoutDirty = true; - } - node.updateScroll("snapshot"); - if (node.options.layoutRoot) { - node.willUpdate(false); - } - } - const { layoutId, layout } = this.options; - if (layoutId === undefined && !layout) - return; - const transformTemplate = this.getTransformTemplate(); - this.prevTransformTemplateValue = transformTemplate - ? transformTemplate(this.latestValues, "") - : undefined; - this.updateSnapshot(); - shouldNotifyListeners && this.notifyListeners("willUpdate"); - } - update() { - this.updateScheduled = false; - const updateWasBlocked = this.isUpdateBlocked(); - // When doing an instant transition, we skip the layout update, - // but should still clean up the measurements so that the next - // snapshot could be taken correctly. - if (updateWasBlocked) { - const wasBlockedByResize = this.updateBlockedByResize; - this.unblockUpdate(); - this.updateBlockedByResize = false; - this.clearAllSnapshots(); - /** - * When blocked by resize, still measure layouts so - * callbacks like onLayoutMeasure fire (e.g. Reorder). - * Skip notifyLayoutUpdate to prevent animations. - */ - if (wasBlockedByResize) { - this.nodes.forEach(forceLayoutMeasure); - } - this.nodes.forEach(clearMeasurements); - return; - } - /** - * If this is a repeat of didUpdate then ignore the animation. - */ - if (this.animationId <= this.animationCommitId) { - this.nodes.forEach(clearIsLayoutDirty); - return; - } - this.animationCommitId = this.animationId; - if (!this.isUpdating) { - this.nodes.forEach(clearIsLayoutDirty); - } - else { - this.isUpdating = false; - /** - * Ensure animation-blocked nodes (e.g. during drag) - * get measured even when memoized (willUpdate skipped). - */ - this.nodes.forEach(ensureDraggedNodesSnapshotted); - /** - * Write - */ - this.nodes.forEach(resetTransformStyle); - /** - * Read ================== - */ - // Update layout measurements of updated children - this.nodes.forEach(updateLayout); - /** - * Write - */ - // Notify listeners that the layout is updated - this.nodes.forEach(notifyLayoutUpdate); - } - this.clearAllSnapshots(); - /** - * Manually flush any pending updates. Ideally - * we could leave this to the following requestAnimationFrame but this seems - * to leave a flash of incorrectly styled content. - */ - const now = time.now(); - frameData.delta = clamp(0, 1000 / 60, now - frameData.timestamp); - frameData.timestamp = now; - frameData.isProcessing = true; - frameSteps.update.process(frameData); - frameSteps.preRender.process(frameData); - frameSteps.render.process(frameData); - frameData.isProcessing = false; - } - didUpdate() { - if (!this.updateScheduled) { - this.updateScheduled = true; - microtask.read(this.scheduleUpdate); - } - } - clearAllSnapshots() { - this.nodes.forEach(clearSnapshot); - this.sharedNodes.forEach(removeLeadSnapshots); - } - scheduleUpdateProjection() { - if (!this.projectionUpdateScheduled) { - this.projectionUpdateScheduled = true; - frame.preRender(this.updateProjection, false, true); - } - } - scheduleCheckAfterUnmount() { - /** - * If the unmounting node is in a layoutGroup and did trigger a willUpdate, - * we manually call didUpdate to give a chance to the siblings to animate. - * Otherwise, cleanup all snapshots to prevents future nodes from reusing them. - */ - frame.postRender(() => { - if (this.isLayoutDirty) { - this.root.didUpdate(); - } - else { - this.root.checkUpdateFailed(); - } - }); - } - /** - * Update measurements - */ - updateSnapshot() { - if (this.snapshot || !this.instance) - return; - this.snapshot = this.measure(); - if (this.snapshot && - !calcLength(this.snapshot.measuredBox.x) && - !calcLength(this.snapshot.measuredBox.y)) { - this.snapshot = undefined; - } - } - updateLayout() { - if (!this.instance) - return; - this.updateScroll(); - if (!(this.options.alwaysMeasureLayout && this.isLead()) && - !this.isLayoutDirty) { - return; - } - /** - * When a node is mounted, it simply resumes from the prevLead's - * snapshot instead of taking a new one, but the ancestors scroll - * might have updated while the prevLead is unmounted. We need to - * update the scroll again to make sure the layout we measure is - * up to date. - */ - if (this.resumeFrom && !this.resumeFrom.instance) { - for (let i = 0; i < this.path.length; i++) { - const node = this.path[i]; - node.updateScroll(); - } - } - const prevLayout = this.layout; - this.layout = this.measure(false); - this.layoutVersion++; - if (!this.layoutCorrected) - this.layoutCorrected = createBox(); - this.isLayoutDirty = false; - this.projectionDelta = undefined; - this.notifyListeners("measure", this.layout.layoutBox); - const { visualElement } = this.options; - visualElement && - visualElement.notify("LayoutMeasure", this.layout.layoutBox, prevLayout ? prevLayout.layoutBox : undefined); - } - updateScroll(phase = "measure") { - let needsMeasurement = Boolean(this.options.layoutScroll && this.instance); - if (this.scroll && - this.scroll.animationId === this.root.animationId && - this.scroll.phase === phase) { - needsMeasurement = false; - } - if (needsMeasurement && this.instance) { - const isRoot = checkIsScrollRoot(this.instance); - this.scroll = { - animationId: this.root.animationId, - phase, - isRoot, - offset: measureScroll(this.instance), - wasRoot: this.scroll ? this.scroll.isRoot : isRoot, - }; - } - } - resetTransform() { - if (!resetTransform) - return; - const isResetRequested = this.isLayoutDirty || - this.shouldResetTransform || - this.options.alwaysMeasureLayout; - const hasProjection = this.projectionDelta && !isDeltaZero(this.projectionDelta); - const transformTemplate = this.getTransformTemplate(); - const transformTemplateValue = transformTemplate - ? transformTemplate(this.latestValues, "") - : undefined; - const transformTemplateHasChanged = transformTemplateValue !== this.prevTransformTemplateValue; - if (isResetRequested && - this.instance && - (hasProjection || - hasTransform(this.latestValues) || - transformTemplateHasChanged)) { - resetTransform(this.instance, transformTemplateValue); - this.shouldResetTransform = false; - this.scheduleRender(); - } - } - measure(removeTransform = true) { - const pageBox = this.measurePageBox(); - let layoutBox = this.removeElementScroll(pageBox); - /** - * Measurements taken during the pre-render stage - * still have transforms applied so we remove them - * via calculation. - */ - if (removeTransform) { - layoutBox = this.removeTransform(layoutBox); - } - roundBox(layoutBox); - return { - animationId: this.root.animationId, - measuredBox: pageBox, - layoutBox, - latestValues: {}, - source: this.id, - }; - } - measurePageBox() { - const { visualElement } = this.options; - if (!visualElement) - return createBox(); - const box = visualElement.measureViewportBox(); - const wasInScrollRoot = this.scroll?.wasRoot || this.path.some(checkNodeWasScrollRoot); - if (!wasInScrollRoot) { - // Remove viewport scroll to give page-relative coordinates - const { scroll } = this.root; - if (scroll) { - translateAxis(box.x, scroll.offset.x); - translateAxis(box.y, scroll.offset.y); - } - } - return box; - } - removeElementScroll(box) { - const boxWithoutScroll = createBox(); - copyBoxInto(boxWithoutScroll, box); - if (this.scroll?.wasRoot) { - return boxWithoutScroll; - } - /** - * Performance TODO: Keep a cumulative scroll offset down the tree - * rather than loop back up the path. - */ - for (let i = 0; i < this.path.length; i++) { - const node = this.path[i]; - const { scroll, options } = node; - if (node !== this.root && scroll && options.layoutScroll) { - /** - * If this is a new scroll root, we want to remove all previous scrolls - * from the viewport box. - */ - if (scroll.wasRoot) { - copyBoxInto(boxWithoutScroll, box); - } - translateAxis(boxWithoutScroll.x, scroll.offset.x); - translateAxis(boxWithoutScroll.y, scroll.offset.y); - } - } - return boxWithoutScroll; - } - applyTransform(box, transformOnly = false, output) { - const withTransforms = output || createBox(); - copyBoxInto(withTransforms, box); - for (let i = 0; i < this.path.length; i++) { - const node = this.path[i]; - if (!transformOnly && - node.options.layoutScroll && - node.scroll && - node !== node.root) { - translateAxis(withTransforms.x, -node.scroll.offset.x); - translateAxis(withTransforms.y, -node.scroll.offset.y); - } - if (!hasTransform(node.latestValues)) - continue; - transformBox(withTransforms, node.latestValues, node.layout?.layoutBox); - } - if (hasTransform(this.latestValues)) { - transformBox(withTransforms, this.latestValues, this.layout?.layoutBox); - } - return withTransforms; - } - removeTransform(box) { - const boxWithoutTransform = createBox(); - copyBoxInto(boxWithoutTransform, box); - for (let i = 0; i < this.path.length; i++) { - const node = this.path[i]; - if (!hasTransform(node.latestValues)) - continue; - let sourceBox; - if (node.instance) { - hasScale(node.latestValues) && node.updateSnapshot(); - sourceBox = createBox(); - copyBoxInto(sourceBox, node.measurePageBox()); - } - removeBoxTransforms(boxWithoutTransform, node.latestValues, node.snapshot?.layoutBox, sourceBox); - } - if (hasTransform(this.latestValues)) { - removeBoxTransforms(boxWithoutTransform, this.latestValues); - } - return boxWithoutTransform; - } - setTargetDelta(delta) { - this.targetDelta = delta; - this.root.scheduleUpdateProjection(); - this.isProjectionDirty = true; - } - setOptions(options) { - this.options = { - ...this.options, - ...options, - crossfade: options.crossfade !== undefined ? options.crossfade : true, - }; - } - clearMeasurements() { - this.scroll = undefined; - this.layout = undefined; - this.snapshot = undefined; - this.prevTransformTemplateValue = undefined; - this.targetDelta = undefined; - this.target = undefined; - this.isLayoutDirty = false; - } - forceRelativeParentToResolveTarget() { - if (!this.relativeParent) - return; - /** - * If the parent target isn't up-to-date, force it to update. - * This is an unfortunate de-optimisation as it means any updating relative - * projection will cause all the relative parents to recalculate back - * up the tree. - */ - if (this.relativeParent.resolvedRelativeTargetAt !== - frameData.timestamp) { - this.relativeParent.resolveTargetDelta(true); - } - } - resolveTargetDelta(forceRecalculation = false) { - /** - * Once the dirty status of nodes has been spread through the tree, we also - * need to check if we have a shared node of a different depth that has itself - * been dirtied. - */ - const lead = this.getLead(); - this.isProjectionDirty || (this.isProjectionDirty = lead.isProjectionDirty); - this.isTransformDirty || (this.isTransformDirty = lead.isTransformDirty); - this.isSharedProjectionDirty || (this.isSharedProjectionDirty = lead.isSharedProjectionDirty); - const isShared = Boolean(this.resumingFrom) || this !== lead; - /** - * We don't use transform for this step of processing so we don't - * need to check whether any nodes have changed transform. - */ - const canSkip = !(forceRecalculation || - (isShared && this.isSharedProjectionDirty) || - this.isProjectionDirty || - this.parent?.isProjectionDirty || - this.attemptToResolveRelativeTarget || - this.root.updateBlockedByResize); - if (canSkip) - return; - const { layout, layoutId } = this.options; - /** - * If we have no layout, we can't perform projection, so early return - */ - if (!this.layout || !(layout || layoutId)) - return; - this.resolvedRelativeTargetAt = frameData.timestamp; - const relativeParent = this.getClosestProjectingParent(); - if (relativeParent && - this.linkedParentVersion !== relativeParent.layoutVersion && - !relativeParent.options.layoutRoot) { - this.removeRelativeTarget(); - } - /** - * If we don't have a targetDelta but do have a layout, we can attempt to resolve - * a relativeParent. This will allow a component to perform scale correction - * even if no animation has started. - */ - if (!this.targetDelta && !this.relativeTarget) { - if (this.options.layoutAnchor !== false && - relativeParent && - relativeParent.layout) { - this.createRelativeTarget(relativeParent, this.layout.layoutBox, relativeParent.layout.layoutBox); - } - else { - this.removeRelativeTarget(); - } - } - /** - * If we have no relative target or no target delta our target isn't valid - * for this frame. - */ - if (!this.relativeTarget && !this.targetDelta) - return; - /** - * Lazy-init target data structure - */ - if (!this.target) { - this.target = createBox(); - this.targetWithTransforms = createBox(); - } - /** - * If we've got a relative box for this component, resolve it into a target relative to the parent. - */ - if (this.relativeTarget && - this.relativeTargetOrigin && - this.relativeParent && - this.relativeParent.target) { - this.forceRelativeParentToResolveTarget(); - calcRelativeBox(this.target, this.relativeTarget, this.relativeParent.target, this.options.layoutAnchor || undefined); - /** - * If we've only got a targetDelta, resolve it into a target - */ - } - else if (this.targetDelta) { - if (Boolean(this.resumingFrom)) { - this.applyTransform(this.layout.layoutBox, false, this.target); - } - else { - copyBoxInto(this.target, this.layout.layoutBox); - } - applyBoxDelta(this.target, this.targetDelta); - } - else { - /** - * If no target, use own layout as target - */ - copyBoxInto(this.target, this.layout.layoutBox); - } - /** - * If we've been told to attempt to resolve a relative target, do so. - */ - if (this.attemptToResolveRelativeTarget) { - this.attemptToResolveRelativeTarget = false; - if (this.options.layoutAnchor !== false && - relativeParent && - Boolean(relativeParent.resumingFrom) === - Boolean(this.resumingFrom) && - !relativeParent.options.layoutScroll && - relativeParent.target && - this.animationProgress !== 1) { - this.createRelativeTarget(relativeParent, this.target, relativeParent.target); - } - else { - this.relativeParent = this.relativeTarget = undefined; - } - } - /** - * Increase debug counter for resolved target deltas - */ - if (statsBuffer.value) { - metrics.calculatedTargetDeltas++; - } - } - getClosestProjectingParent() { - if (!this.parent || - hasScale(this.parent.latestValues) || - has2DTranslate(this.parent.latestValues)) { - return undefined; - } - if (this.parent.isProjecting()) { - return this.parent; - } - else { - return this.parent.getClosestProjectingParent(); - } - } - isProjecting() { - return Boolean((this.relativeTarget || - this.targetDelta || - this.options.layoutRoot) && - this.layout); - } - createRelativeTarget(relativeParent, layout, parentLayout) { - this.relativeParent = relativeParent; - this.linkedParentVersion = relativeParent.layoutVersion; - this.forceRelativeParentToResolveTarget(); - this.relativeTarget = createBox(); - this.relativeTargetOrigin = createBox(); - calcRelativePosition(this.relativeTargetOrigin, layout, parentLayout, this.options.layoutAnchor || undefined); - copyBoxInto(this.relativeTarget, this.relativeTargetOrigin); - } - removeRelativeTarget() { - this.relativeParent = this.relativeTarget = undefined; - } - calcProjection() { - const lead = this.getLead(); - const isShared = Boolean(this.resumingFrom) || this !== lead; - let canSkip = true; - /** - * If this is a normal layout animation and neither this node nor its nearest projecting - * is dirty then we can't skip. - */ - if (this.isProjectionDirty || this.parent?.isProjectionDirty) { - canSkip = false; - } - /** - * If this is a shared layout animation and this node's shared projection is dirty then - * we can't skip. - */ - if (isShared && - (this.isSharedProjectionDirty || this.isTransformDirty)) { - canSkip = false; - } - /** - * If we have resolved the target this frame we must recalculate the - * projection to ensure it visually represents the internal calculations. - */ - if (this.resolvedRelativeTargetAt === frameData.timestamp) { - canSkip = false; - } - if (canSkip) - return; - const { layout, layoutId } = this.options; - /** - * If this section of the tree isn't animating we can - * delete our target sources for the following frame. - */ - this.isTreeAnimating = Boolean((this.parent && this.parent.isTreeAnimating) || - this.currentAnimation || - this.pendingAnimation); - if (!this.isTreeAnimating) { - this.targetDelta = this.relativeTarget = undefined; - } - if (!this.layout || !(layout || layoutId)) - return; - /** - * Reset the corrected box with the latest values from box, as we're then going - * to perform mutative operations on it. - */ - copyBoxInto(this.layoutCorrected, this.layout.layoutBox); - /** - * Record previous tree scales before updating. - */ - const prevTreeScaleX = this.treeScale.x; - const prevTreeScaleY = this.treeScale.y; - /** - * Apply all the parent deltas to this box to produce the corrected box. This - * is the layout box, as it will appear on screen as a result of the transforms of its parents. - */ - applyTreeDeltas(this.layoutCorrected, this.treeScale, this.path, isShared); - /** - * If this layer needs to perform scale correction but doesn't have a target, - * use the layout as the target. - */ - if (lead.layout && - !lead.target && - (this.treeScale.x !== 1 || this.treeScale.y !== 1)) { - lead.target = lead.layout.layoutBox; - lead.targetWithTransforms = createBox(); - } - const { target } = lead; - if (!target) { - /** - * If we don't have a target to project into, but we were previously - * projecting, we want to remove the stored transform and schedule - * a render to ensure the elements reflect the removed transform. - */ - if (this.prevProjectionDelta) { - this.createProjectionDeltas(); - this.scheduleRender(); - } - return; - } - if (!this.projectionDelta || !this.prevProjectionDelta) { - this.createProjectionDeltas(); - } - else { - copyAxisDeltaInto(this.prevProjectionDelta.x, this.projectionDelta.x); - copyAxisDeltaInto(this.prevProjectionDelta.y, this.projectionDelta.y); - } - /** - * Update the delta between the corrected box and the target box before user-set transforms were applied. - * This will allow us to calculate the corrected borderRadius and boxShadow to compensate - * for our layout reprojection, but still allow them to be scaled correctly by the user. - * It might be that to simplify this we may want to accept that user-set scale is also corrected - * and we wouldn't have to keep and calc both deltas, OR we could support a user setting - * to allow people to choose whether these styles are corrected based on just the - * layout reprojection or the final bounding box. - */ - calcBoxDelta(this.projectionDelta, this.layoutCorrected, target, this.latestValues); - if (this.treeScale.x !== prevTreeScaleX || - this.treeScale.y !== prevTreeScaleY || - !axisDeltaEquals(this.projectionDelta.x, this.prevProjectionDelta.x) || - !axisDeltaEquals(this.projectionDelta.y, this.prevProjectionDelta.y)) { - this.hasProjected = true; - this.scheduleRender(); - this.notifyListeners("projectionUpdate", target); - } - /** - * Increase debug counter for recalculated projections - */ - if (statsBuffer.value) { - metrics.calculatedProjections++; - } - } - hide() { - this.isVisible = false; - // TODO: Schedule render - } - show() { - this.isVisible = true; - // TODO: Schedule render - } - scheduleRender(notifyAll = true) { - this.options.visualElement?.scheduleRender(); - if (notifyAll) { - const stack = this.getStack(); - stack && stack.scheduleRender(); - } - if (this.resumingFrom && !this.resumingFrom.instance) { - this.resumingFrom = undefined; - } - } - createProjectionDeltas() { - this.prevProjectionDelta = createDelta(); - this.projectionDelta = createDelta(); - this.projectionDeltaWithTransform = createDelta(); - } - setAnimationOrigin(delta, hasOnlyRelativeTargetChanged = false, pathFn) { - const snapshot = this.snapshot; - const snapshotLatestValues = snapshot ? snapshot.latestValues : {}; - const mixedValues = { ...this.latestValues }; - const targetDelta = createDelta(); - if (!this.relativeParent || - !this.relativeParent.options.layoutRoot) { - this.relativeTarget = this.relativeTargetOrigin = undefined; - } - this.attemptToResolveRelativeTarget = !hasOnlyRelativeTargetChanged; - const relativeLayout = createBox(); - const snapshotSource = snapshot ? snapshot.source : undefined; - const layoutSource = this.layout ? this.layout.source : undefined; - const isSharedLayoutAnimation = snapshotSource !== layoutSource; - const stack = this.getStack(); - const isOnlyMember = !stack || stack.members.length <= 1; - const shouldCrossfadeOpacity = Boolean(isSharedLayoutAnimation && - !isOnlyMember && - this.options.crossfade === true && - !this.path.some(hasOpacityCrossfade)); - this.animationProgress = 0; - let prevRelativeTarget; - // The path decides whether the layout shift is worth curving - // (distance floor) and resolves the interpolator from the delta. - const interpolate = pathFn?.interpolateProjection(delta); - this.mixTargetDelta = (latest) => { - const progress = latest / 1000; - const point = interpolate?.(progress); - if (point) { - targetDelta.x.translate = point.x; - targetDelta.x.scale = mixNumber$1(delta.x.scale, 1, progress); - targetDelta.x.origin = delta.x.origin; - targetDelta.x.originPoint = delta.x.originPoint; - targetDelta.y.translate = point.y; - targetDelta.y.scale = mixNumber$1(delta.y.scale, 1, progress); - targetDelta.y.origin = delta.y.origin; - targetDelta.y.originPoint = delta.y.originPoint; - } - else { - mixAxisDeltaLinear(targetDelta.x, delta.x, progress); - mixAxisDeltaLinear(targetDelta.y, delta.y, progress); - } - this.setTargetDelta(targetDelta); - if (this.relativeTarget && - this.relativeTargetOrigin && - this.layout && - this.relativeParent && - this.relativeParent.layout) { - calcRelativePosition(relativeLayout, this.layout.layoutBox, this.relativeParent.layout.layoutBox, this.options.layoutAnchor || undefined); - mixBox(this.relativeTarget, this.relativeTargetOrigin, relativeLayout, progress); - /** - * If this is an unchanged relative target we can consider the - * projection not dirty. - */ - if (prevRelativeTarget && - boxEquals(this.relativeTarget, prevRelativeTarget)) { - this.isProjectionDirty = false; - } - if (!prevRelativeTarget) - prevRelativeTarget = createBox(); - copyBoxInto(prevRelativeTarget, this.relativeTarget); - } - if (isSharedLayoutAnimation) { - this.animationValues = mixedValues; - mixValues(mixedValues, snapshotLatestValues, this.latestValues, progress, shouldCrossfadeOpacity, isOnlyMember); - } - if (point && point.rotate !== undefined) { - // Dedicated `pathRotation` channel, not `rotate`, so an - // animating `rotate` is composed with, never clobbered. - if (!this.animationValues) - this.animationValues = mixedValues; - this.animationValues.pathRotation = point.rotate; - } - this.root.scheduleUpdateProjection(); - this.scheduleRender(); - this.animationProgress = progress; - }; - this.mixTargetDelta(this.options.layoutRoot ? 1000 : 0); - } - startAnimation(options) { - this.notifyListeners("animationStart"); - this.currentAnimation?.stop(); - this.resumingFrom?.currentAnimation?.stop(); - if (this.pendingAnimation) { - cancelFrame(this.pendingAnimation); - this.pendingAnimation = undefined; - } - /** - * Start the animation in the next frame to have a frame with progress 0, - * where the target is the same as when the animation started, so we can - * calculate the relative positions correctly for instant transitions. - */ - this.pendingAnimation = frame.update(() => { - globalProjectionState.hasAnimatedSinceResize = true; - this.motionValue || (this.motionValue = motionValue(0)); - this.motionValue.jump(0, false); - this.currentAnimation = animateSingleValue(this.motionValue, [0, 1000], { - ...options, - velocity: 0, - isSync: true, - onUpdate: (latest) => { - this.mixTargetDelta(latest); - options.onUpdate && options.onUpdate(latest); - }, - onComplete: () => { - options.onComplete && options.onComplete(); - this.completeAnimation(); - }, - }); - if (this.resumingFrom) { - this.resumingFrom.currentAnimation = this.currentAnimation; - } - this.pendingAnimation = undefined; - }); - } - completeAnimation() { - if (this.resumingFrom) { - this.resumingFrom.currentAnimation = undefined; - this.resumingFrom.preserveOpacity = undefined; - } - const stack = this.getStack(); - stack && stack.exitAnimationComplete(); - this.resumingFrom = - this.currentAnimation = - this.animationValues = - undefined; - this.notifyListeners("animationComplete"); - } - finishAnimation() { - if (this.currentAnimation) { - this.mixTargetDelta && this.mixTargetDelta(animationTarget); - this.currentAnimation.stop(); - } - this.completeAnimation(); - } - applyTransformsToTarget() { - const lead = this.getLead(); - let { targetWithTransforms, target, layout, latestValues } = lead; - if (!targetWithTransforms || !target || !layout) - return; - /** - * If we're only animating position, and this element isn't the lead element, - * then instead of projecting into the lead box we instead want to calculate - * a new target that aligns the two boxes but maintains the layout shape. - */ - if (this !== lead && - this.layout && - layout && - shouldAnimatePositionOnly(this.options.animationType, this.layout.layoutBox, layout.layoutBox)) { - target = this.target || createBox(); - const xLength = calcLength(this.layout.layoutBox.x); - target.x.min = lead.target.x.min; - target.x.max = target.x.min + xLength; - const yLength = calcLength(this.layout.layoutBox.y); - target.y.min = lead.target.y.min; - target.y.max = target.y.min + yLength; - } - copyBoxInto(targetWithTransforms, target); - /** - * Apply the latest user-set transforms to the targetBox to produce the targetBoxFinal. - * This is the final box that we will then project into by calculating a transform delta and - * applying it to the corrected box. - */ - transformBox(targetWithTransforms, latestValues); - /** - * Update the delta between the corrected box and the final target box, after - * user-set transforms are applied to it. This will be used by the renderer to - * create a transform style that will reproject the element from its layout layout - * into the desired bounding box. - */ - calcBoxDelta(this.projectionDeltaWithTransform, this.layoutCorrected, targetWithTransforms, latestValues); - } - registerSharedNode(layoutId, node) { - if (!this.sharedNodes.has(layoutId)) { - this.sharedNodes.set(layoutId, new NodeStack()); - } - const stack = this.sharedNodes.get(layoutId); - stack.add(node); - const config = node.options.initialPromotionConfig; - node.promote({ - transition: config ? config.transition : undefined, - preserveFollowOpacity: config && config.shouldPreserveFollowOpacity - ? config.shouldPreserveFollowOpacity(node) - : undefined, - }); - } - isLead() { - const stack = this.getStack(); - return stack ? stack.lead === this : true; - } - getLead() { - const { layoutId } = this.options; - return layoutId ? this.getStack()?.lead || this : this; - } - getPrevLead() { - const { layoutId } = this.options; - return layoutId ? this.getStack()?.prevLead : undefined; - } - getStack() { - const { layoutId } = this.options; - if (layoutId) - return this.root.sharedNodes.get(layoutId); - } - promote({ needsReset, transition, preserveFollowOpacity, } = {}) { - const stack = this.getStack(); - if (stack) - stack.promote(this, preserveFollowOpacity); - if (needsReset) { - this.projectionDelta = undefined; - this.needsReset = true; - } - if (transition) - this.setOptions({ transition }); - } - relegate() { - const stack = this.getStack(); - if (stack) { - return stack.relegate(this); - } - else { - return false; - } - } - resetSkewAndRotation() { - const { visualElement } = this.options; - if (!visualElement) - return; - // If there's no detected skew or rotation values, we can early return without a forced render. - let hasDistortingTransform = false; - /** - * An unrolled check for rotation values. Most elements don't have any rotation and - * skipping the nested loop and new object creation is 50% faster. - */ - const { latestValues } = visualElement; - if (latestValues.z || - latestValues.rotate || - latestValues.rotateX || - latestValues.rotateY || - latestValues.rotateZ || - latestValues.skewX || - latestValues.skewY) { - hasDistortingTransform = true; - } - // If there's no distorting values, we don't need to do any more. - if (!hasDistortingTransform) - return; - const resetValues = {}; - if (latestValues.z) { - resetDistortingTransform("z", visualElement, resetValues, this.animationValues); - } - // Check the skew and rotate value of all axes and reset to 0 - for (let i = 0; i < transformAxes.length; i++) { - resetDistortingTransform(`rotate${transformAxes[i]}`, visualElement, resetValues, this.animationValues); - resetDistortingTransform(`skew${transformAxes[i]}`, visualElement, resetValues, this.animationValues); - } - // Force a render of this element to apply the transform with all skews and rotations - // set to 0. - visualElement.render(); - // Put back all the values we reset - for (const key in resetValues) { - visualElement.setStaticValue(key, resetValues[key]); - if (this.animationValues) { - this.animationValues[key] = resetValues[key]; - } - } - // Schedule a render for the next frame. This ensures we won't visually - // see the element with the reset rotate value applied. - visualElement.scheduleRender(); - } - applyProjectionStyles(targetStyle, // CSSStyleDeclaration - doesn't allow numbers to be assigned to properties - styleProp) { - if (!this.instance || this.isSVG) - return; - if (!this.isVisible) { - targetStyle.visibility = "hidden"; - return; - } - const transformTemplate = this.getTransformTemplate(); - if (this.needsReset) { - this.needsReset = false; - targetStyle.visibility = ""; - targetStyle.opacity = ""; - targetStyle.pointerEvents = - resolveMotionValue(styleProp?.pointerEvents) || ""; - targetStyle.transform = transformTemplate - ? transformTemplate(this.latestValues, "") - : "none"; - return; - } - const lead = this.getLead(); - if (!this.projectionDelta || !this.layout || !lead.target) { - if (this.options.layoutId) { - targetStyle.opacity = - this.latestValues.opacity !== undefined - ? this.latestValues.opacity - : 1; - targetStyle.pointerEvents = - resolveMotionValue(styleProp?.pointerEvents) || ""; - } - if (this.hasProjected && !hasTransform(this.latestValues)) { - targetStyle.transform = transformTemplate - ? transformTemplate({}, "") - : "none"; - this.hasProjected = false; - } - return; - } - targetStyle.visibility = ""; - const valuesToRender = lead.animationValues || lead.latestValues; - this.applyTransformsToTarget(); - let transform = buildProjectionTransform(this.projectionDeltaWithTransform, this.treeScale, valuesToRender); - if (transformTemplate) { - transform = transformTemplate(valuesToRender, transform); - } - targetStyle.transform = transform; - const { x, y } = this.projectionDelta; - targetStyle.transformOrigin = `${x.origin * 100}% ${y.origin * 100}% 0`; - if (lead.animationValues) { - /** - * If the lead component is animating, assign this either the entering/leaving - * opacity - */ - targetStyle.opacity = - lead === this - ? valuesToRender.opacity ?? - this.latestValues.opacity ?? - 1 - : this.preserveOpacity - ? this.latestValues.opacity - : valuesToRender.opacityExit; - } - else { - /** - * Or we're not animating at all, set the lead component to its layout - * opacity and other components to hidden. - */ - targetStyle.opacity = - lead === this - ? valuesToRender.opacity !== undefined - ? valuesToRender.opacity - : "" - : valuesToRender.opacityExit !== undefined - ? valuesToRender.opacityExit - : 0; - } - /** - * Apply scale correction - */ - for (const key in scaleCorrectors) { - if (valuesToRender[key] === undefined) - continue; - const { correct, applyTo, isCSSVariable } = scaleCorrectors[key]; - /** - * Only apply scale correction to the value if we have an - * active projection transform. Otherwise these values become - * vulnerable to distortion if the element changes size without - * a corresponding layout animation. - */ - const corrected = transform === "none" - ? valuesToRender[key] - : correct(valuesToRender[key], lead); - if (applyTo) { - const num = applyTo.length; - for (let i = 0; i < num; i++) { - targetStyle[applyTo[i]] = corrected; - } - } - else { - // If this is a CSS variable, set it directly on the instance. - // Replacing this function from creating styles to setting them - // would be a good place to remove per frame object creation - if (isCSSVariable) { - this.options.visualElement.renderState.vars[key] = corrected; - } - else { - targetStyle[key] = corrected; - } - } - } - /** - * Disable pointer events on follow components. This is to ensure - * that if a follow component covers a lead component it doesn't block - * pointer events on the lead. - */ - if (this.options.layoutId) { - targetStyle.pointerEvents = - lead === this - ? resolveMotionValue(styleProp?.pointerEvents) || "" - : "none"; - } - } - clearSnapshot() { - this.resumeFrom = this.snapshot = undefined; - } - // Only run on root - resetTree() { - this.root.nodes.forEach((node) => node.currentAnimation?.stop()); - this.root.nodes.forEach(clearMeasurements); - this.root.sharedNodes.clear(); - } - }; - } - function updateLayout(node) { - node.updateLayout(); - } - function notifyLayoutUpdate(node) { - const snapshot = node.resumeFrom?.snapshot || node.snapshot; - if (node.isLead() && - node.layout && - snapshot && - node.hasListeners("didUpdate")) { - const { layoutBox: layout, measuredBox: measuredLayout } = node.layout; - const { animationType } = node.options; - const isShared = snapshot.source !== node.layout.source; - // TODO Maybe we want to also resize the layout snapshot so we don't trigger - // animations for instance if layout="size" and an element has only changed position - if (animationType === "size") { - eachAxis((axis) => { - const axisSnapshot = isShared - ? snapshot.measuredBox[axis] - : snapshot.layoutBox[axis]; - const length = calcLength(axisSnapshot); - axisSnapshot.min = layout[axis].min; - axisSnapshot.max = axisSnapshot.min + length; - }); - } - else if (animationType === "x" || animationType === "y") { - const snapAxis = animationType === "x" ? "y" : "x"; - copyAxisInto(isShared - ? snapshot.measuredBox[snapAxis] - : snapshot.layoutBox[snapAxis], layout[snapAxis]); - } - else if (shouldAnimatePositionOnly(animationType, snapshot.layoutBox, layout)) { - eachAxis((axis) => { - const axisSnapshot = isShared - ? snapshot.measuredBox[axis] - : snapshot.layoutBox[axis]; - const length = calcLength(layout[axis]); - axisSnapshot.max = axisSnapshot.min + length; - /** - * Ensure relative target gets resized and rerendererd - */ - if (node.relativeTarget && !node.currentAnimation) { - node.isProjectionDirty = true; - node.relativeTarget[axis].max = - node.relativeTarget[axis].min + length; - } - }); - } - const layoutDelta = createDelta(); - calcBoxDelta(layoutDelta, layout, snapshot.layoutBox); - const visualDelta = createDelta(); - if (isShared) { - calcBoxDelta(visualDelta, node.applyTransform(measuredLayout, true), snapshot.measuredBox); - } - else { - calcBoxDelta(visualDelta, layout, snapshot.layoutBox); - } - const hasLayoutChanged = !isDeltaZero(layoutDelta); - let hasRelativeLayoutChanged = false; - if (!node.resumeFrom) { - const relativeParent = node.getClosestProjectingParent(); - /** - * If the relativeParent is itself resuming from a different element then - * the relative snapshot is not relavent - */ - if (relativeParent && !relativeParent.resumeFrom) { - const { snapshot: parentSnapshot, layout: parentLayout } = relativeParent; - if (parentSnapshot && parentLayout) { - const anchor = node.options.layoutAnchor || undefined; - const relativeSnapshot = createBox(); - calcRelativePosition(relativeSnapshot, snapshot.layoutBox, parentSnapshot.layoutBox, anchor); - const relativeLayout = createBox(); - calcRelativePosition(relativeLayout, layout, parentLayout.layoutBox, anchor); - if (!boxEqualsRounded(relativeSnapshot, relativeLayout)) { - hasRelativeLayoutChanged = true; - } - if (relativeParent.options.layoutRoot) { - node.relativeTarget = relativeLayout; - node.relativeTargetOrigin = relativeSnapshot; - node.relativeParent = relativeParent; - } - } - } - } - node.notifyListeners("didUpdate", { - layout, - snapshot, - delta: visualDelta, - layoutDelta, - hasLayoutChanged, - hasRelativeLayoutChanged, - }); - } - else if (node.isLead()) { - const { onExitComplete } = node.options; - onExitComplete && onExitComplete(); - } - /** - * Clearing transition - * TODO: Investigate why this transition is being passed in as {type: false } from Framer - * and why we need it at all - */ - node.options.transition = undefined; - } - function propagateDirtyNodes(node) { - /** - * Increase debug counter for nodes encountered this frame - */ - if (statsBuffer.value) { - metrics.nodes++; - } - if (!node.parent) - return; - /** - * If this node isn't projecting, propagate isProjectionDirty. It will have - * no performance impact but it will allow the next child that *is* projecting - * but *isn't* dirty to just check its parent to see if *any* ancestor needs - * correcting. - */ - if (!node.isProjecting()) { - node.isProjectionDirty = node.parent.isProjectionDirty; - } - /** - * Propagate isSharedProjectionDirty and isTransformDirty - * throughout the whole tree. A future revision can take another look at - * this but for safety we still recalcualte shared nodes. - */ - node.isSharedProjectionDirty || (node.isSharedProjectionDirty = Boolean(node.isProjectionDirty || - node.parent.isProjectionDirty || - node.parent.isSharedProjectionDirty)); - node.isTransformDirty || (node.isTransformDirty = node.parent.isTransformDirty); - } - function cleanDirtyNodes(node) { - node.isProjectionDirty = - node.isSharedProjectionDirty = - node.isTransformDirty = - false; - } - function clearSnapshot(node) { - node.clearSnapshot(); - } - function clearMeasurements(node) { - node.clearMeasurements(); - } - function forceLayoutMeasure(node) { - node.isLayoutDirty = true; - node.updateLayout(); - } - function clearIsLayoutDirty(node) { - node.isLayoutDirty = false; - } - /** - * When a node is animation-blocked (e.g. during drag) and its component - * didn't re-render (memoized), willUpdate() is never called so there's - * no snapshot. Use the previous layout as a snapshot and mark dirty so - * resetTransform/updateLayout/notifyLayoutUpdate process it normally. - */ - function ensureDraggedNodesSnapshotted(node) { - if (node.isAnimationBlocked && node.layout && !node.isLayoutDirty) { - node.snapshot = node.layout; - node.isLayoutDirty = true; - } - } - function resetTransformStyle(node) { - const { visualElement } = node.options; - if (visualElement && visualElement.getProps().onBeforeLayoutMeasure) { - visualElement.notify("BeforeLayoutMeasure"); - } - node.resetTransform(); - } - function finishAnimation(node) { - node.finishAnimation(); - node.targetDelta = node.relativeTarget = node.target = undefined; - node.isProjectionDirty = true; - } - function resolveTargetDelta(node) { - node.resolveTargetDelta(); - } - function calcProjection(node) { - node.calcProjection(); - } - function resetSkewAndRotation(node) { - node.resetSkewAndRotation(); - } - function removeLeadSnapshots(stack) { - stack.removeLeadSnapshot(); - } - function mixAxisDeltaLinear(output, delta, p) { - output.translate = mixNumber$1(delta.translate, 0, p); - output.scale = mixNumber$1(delta.scale, 1, p); - output.origin = delta.origin; - output.originPoint = delta.originPoint; - } - function mixAxis(output, from, to, p) { - output.min = mixNumber$1(from.min, to.min, p); - output.max = mixNumber$1(from.max, to.max, p); - } - function mixBox(output, from, to, p) { - mixAxis(output.x, from.x, to.x, p); - mixAxis(output.y, from.y, to.y, p); - } - function hasOpacityCrossfade(node) { - return (node.animationValues && node.animationValues.opacityExit !== undefined); - } - const defaultLayoutTransition = { - duration: 0.45, - ease: [0.4, 0, 0.1, 1], - }; - const userAgentContains = (string) => typeof navigator !== "undefined" && - navigator.userAgent && - navigator.userAgent.toLowerCase().includes(string); - /** - * Measured bounding boxes must be rounded in Safari and - * left untouched in Chrome, otherwise non-integer layouts within scaled-up elements - * can appear to jump. - */ - const roundPoint = userAgentContains("applewebkit/") && !userAgentContains("chrome/") - ? Math.round - : noop; - function roundAxis(axis) { - // Round to the nearest .5 pixels to support subpixel layouts - axis.min = roundPoint(axis.min); - axis.max = roundPoint(axis.max); - } - function roundBox(box) { - roundAxis(box.x); - roundAxis(box.y); - } - function shouldAnimatePositionOnly(animationType, snapshot, layout) { - return (animationType === "position" || - (animationType === "preserve-aspect" && - !isNear(aspectRatio(snapshot), aspectRatio(layout), 0.2))); - } - function checkNodeWasScrollRoot(node) { - return node !== node.root && node.scroll?.wasRoot; - } - - const DocumentProjectionNode = createProjectionNode({ - attachResizeListener: (ref, notify) => addDomEvent(ref, "resize", notify), - measureScroll: () => ({ - x: document.documentElement.scrollLeft || document.body?.scrollLeft || 0, - y: document.documentElement.scrollTop || document.body?.scrollTop || 0, - }), - checkIsScrollRoot: () => true, - }); - - const notify = (node) => !node.isLayoutDirty && node.willUpdate(false); - function nodeGroup() { - const nodes = new Set(); - const subscriptions = new WeakMap(); - const dirtyAll = () => nodes.forEach(notify); - return { - add: (node) => { - nodes.add(node); - subscriptions.set(node, node.addEventListener("willUpdate", dirtyAll)); - }, - remove: (node) => { - nodes.delete(node); - const unsubscribe = subscriptions.get(node); - if (unsubscribe) { - unsubscribe(); - subscriptions.delete(node); - } - dirtyAll(); - }, - dirty: dirtyAll, - }; - } - - const rootProjectionNode = { - current: undefined, - }; - const HTMLProjectionNode = createProjectionNode({ - measureScroll: (instance) => ({ - x: instance.scrollLeft, - y: instance.scrollTop, - }), - defaultParent: () => { - if (!rootProjectionNode.current) { - const documentNode = new DocumentProjectionNode({}); - documentNode.mount(window); - documentNode.setOptions({ layoutScroll: true }); - rootProjectionNode.current = documentNode; - } - return rootProjectionNode.current; - }, - resetTransform: (instance, value) => { - instance.style.transform = value !== undefined ? value : "none"; - }, - checkIsScrollRoot: (instance) => Boolean(window.getComputedStyle(instance).position === "fixed"), - }); - - const layoutSelector = "[data-layout],[data-layout-id]"; - /** - * All imperatively-created projection nodes live in one persistent tree, - * shared across animateLayout() calls (and with any React-created nodes, - * via the singleton document root). Keyed by element for reuse. - */ - const layoutNodes = new WeakMap(); - /** - * Builders created within the same synchronous tick are flushed together - * as a single "commit": every node is snapshotted before any updateDom - * runs, mirroring React batching renders from different parts of the tree. - */ - let pendingBuilders; - function collectLayoutElements(scope) { - const elements = []; - if (scope instanceof HTMLElement && scope.matches(layoutSelector)) { - elements.push(scope); - } - scope.querySelectorAll(layoutSelector).forEach((element) => { - if (element instanceof HTMLElement) - elements.push(element); - }); - return elements; - } - /** - * Process any work scheduled on the frameloop now. A previous animation - * may have been seeked while paused (controls.time = x) without a frame - * having rendered it - we must materialise that state into the DOM - * before taking snapshots. - */ - function flushPendingFrame() { - if (frameData.isProcessing) - return; - const now = time.now(); - frameData.delta = clamp(0, 1000 / 60, now - frameData.timestamp); - frameData.timestamp = now; - frameData.isProcessing = true; - frameSteps.update.process(frameData); - frameSteps.preRender.process(frameData); - frameSteps.render.process(frameData); - frameData.isProcessing = false; - } - function getProjectionParent(element) { - let ancestor = element.parentElement; - while (ancestor) { - const node = layoutNodes.get(ancestor); - if (node && node.instance) - return node; - ancestor = ancestor.parentElement; - } - return undefined; - } - function createVisualElement() { - return new HTMLVisualElement({ - props: {}, - presenceContext: null, - visualState: { - latestValues: {}, - renderState: { - transform: {}, - transformOrigin: {}, - style: {}, - vars: {}, - }, - }, - }, { allowProjection: true }); - } - function readNodeOptions(element, transition) { - const layoutAttr = element.getAttribute("data-layout"); - const layoutId = element.getAttribute("data-layout-id") ?? undefined; - return { - layoutId, - layout: layoutAttr !== null ? true : undefined, - animationType: (!layoutAttr || layoutAttr === "true" - ? "both" - : layoutAttr), - transition, - }; - } - function prepareNode(element, transition) { - let node = layoutNodes.get(element); - if (!node) { - let visualElement = visualElementStore.get(element); - if (!visualElement) - visualElement = createVisualElement(); - /** - * A first-time element may carry a projection transform in its - * inline style (e.g. it was cloned from an element mid-animation). - * That transform isn't tracked in latestValues so the engine can't - * reset it before measuring - clear it now so the first layout - * measurement isn't inflated. - */ - if (element.style.transform && - !hasTransform(visualElement.latestValues)) { - element.style.transform = ""; - } - node = new HTMLProjectionNode(visualElement.latestValues, getProjectionParent(element)); - visualElement.projection = node; - node.setOptions({ - ...readNodeOptions(element, transition), - visualElement, - }); - node.mount(element); - layoutNodes.set(element, node); - } - else { - node.setOptions(readNodeOptions(element, transition)); - } - node.isPresent = true; - if (node.options.onExitComplete) { - node.setOptions({ onExitComplete: undefined }); - } - return node; - } - function sortDocumentOrder(elements) { - return [...elements].sort((a, b) => a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1); - } - function dropNode(element, node) { - node.setOptions({ onExitComplete: undefined }); - /** - * Stop any lingering animation so it can't leak into future updates. - * A follow node can share its currentAnimation with a surviving lead - * (via resumingFrom), in which case it isn't ours to stop. - */ - const stack = node.getStack(); - if (!stack || node.isLead()) - node.currentAnimation?.stop(); - node.unmount(); - layoutNodes.delete(element); - } - function flushPendingBuilders() { - const builders = pendingBuilders; - pendingBuilders = undefined; - flushPendingFrame(); - /** - * Discover and mount every node across all builders before snapshotting - * any of them. Mounting during an active update flags isLayoutDirty, - * which would make that node's own willUpdate skip its snapshot. - * Document order guarantees ancestors mount before descendants, even - * when they're discovered by different builders. - */ - const targets = new Map(); - for (const builder of builders) { - for (const element of builder.collectTargets()) { - const owners = targets.get(element); - owners ? owners.push(builder) : targets.set(element, [builder]); - } - } - const union = new Map(); - for (const element of sortDocumentOrder(targets.keys())) { - const owners = targets.get(element); - const node = prepareNode(element, owners[owners.length - 1].transitionFor(element)); - for (const owner of owners) - owner.adopt(element, node); - union.set(element, node); - } - union.forEach((node) => { - node.isLayoutDirty = false; - node.willUpdate(); - }); - const updatePromises = []; - for (const builder of builders) { - const result = builder.runUpdate(); - if (result) - updatePromises.push(result); - } - const commit = () => { - /** - * Process all additions before any removals so that, even across - * builders, a removed member knows whether a replacement with the - * same layoutId was added in this commit. - */ - const newMemberIds = new Set(); - for (const builder of builders) { - builder.reconcileAdditions(newMemberIds); - } - for (const builder of builders) { - builder.reconcileRemovals(newMemberIds); - } - let root; - union.forEach((node) => (root || (root = node.root))); - for (const builder of builders) - root || (root = builder.getRoot()); - root?.didUpdate(); - /** - * The root flushes the update on a microtask, synchronously - * processing the frame that creates the layout animations. Collect - * them in a later microtask step of the same pass. - */ - microtask.render(() => { - for (const builder of builders) - builder.finalize(); - }); - }; - updatePromises.length ? Promise.all(updatePromises).then(commit) : commit(); - } - class LayoutAnimationBuilder { - constructor(scope, updateDom, defaultOptions) { - this.scope = scope; - this.updateDom = updateDom; - this.defaultOptions = defaultOptions; - this.sharedTransitions = new Map(); - this.notifyReady = () => { }; - this.rejectReady = () => { }; - this.tracked = new Map(); - this.restorePoints = new Map(); - this.readyPromise = new Promise((resolve, reject) => { - this.notifyReady = resolve; - this.rejectReady = reject; - }); - if (!pendingBuilders) { - pendingBuilders = []; - queueMicrotask(flushPendingBuilders); - } - pendingBuilders.push(this); - } - shared(id, transition) { - this.sharedTransitions.set(id, transition); - return this; - } - then(resolve, reject) { - return this.readyPromise.then(resolve, reject); - } - transitionFor(element) { - const layoutId = element.getAttribute("data-layout-id"); - return ((layoutId && this.sharedTransitions.get(layoutId)) || - this.defaultOptions); - } - adopt(element, node) { - this.tracked.set(element, node); - this.restorePoints.set(element, { - parent: element.parentElement, - next: element.nextSibling, - }); - } - collectTargets() { - return collectLayoutElements(this.scope); - } - runUpdate() { - try { - const result = this.updateDom(); - if (result && typeof result.then === "function") { - return result.then(undefined, (error) => { - this.updateError = error; - }); - } - } - catch (error) { - this.updateError = error; - } - return undefined; - } - reconcileAdditions(newMemberIds) { - for (const element of collectLayoutElements(this.scope)) { - if (this.tracked.has(element)) - continue; - const node = prepareNode(element, this.transitionFor(element)); - this.adopt(element, node); - node.options.layoutId && newMemberIds.add(node.options.layoutId); - } - } - reconcileRemovals(newMemberIds) { - this.tracked.forEach((node, element) => { - if (element.isConnected) - return; - const restore = this.restorePoints.get(element); - this.restorePoints.delete(element); - const { layoutId } = node.options; - const stack = node.getStack(); - const hasSurvivor = stack && - stack.members.some((member) => member !== node && - member.instance - ?.isConnected); - /** - * A removed lead with a surviving stack member - and no - * replacement member added this commit - runs an exit - * crossfade: restore the element to its old position in the - * DOM, relegate it and let the survivor take over. It's - * removed again once the animation completes. - */ - if (layoutId && - node.isLead() && - hasSurvivor && - !newMemberIds.has(layoutId)) { - if (restore && restore.parent.isConnected) { - restore.parent.insertBefore(element, restore.next && restore.next.parentNode === restore.parent - ? restore.next - : null); - node.isPresent = false; - node.setOptions({ - onExitComplete: () => { - element.remove(); - dropNode(element, node); - }, - }); - if (node.relegate()) - return; - element.remove(); - } - } - dropNode(element, node); - this.tracked.delete(element); - }); - } - getRoot() { - let root; - this.tracked.forEach((node) => (root || (root = node.root))); - return root; - } - finalize() { - if (this.updateError) { - this.rejectReady(this.updateError); - return; - } - const animations = new Set(); - this.tracked.forEach((node) => { - if (node.instance && node.currentAnimation) { - animations.add(node.currentAnimation); - } - }); - this.notifyReady(new GroupAnimation([...animations])); - } - } - function parseAnimateLayoutArgs(scopeOrUpdateDom, updateDomOrOptions, options) { - if (typeof scopeOrUpdateDom === "function") { - return { - scope: document, - updateDom: scopeOrUpdateDom, - defaultOptions: updateDomOrOptions, - }; - } - const scope = scopeOrUpdateDom instanceof Document - ? scopeOrUpdateDom - : resolveElements(scopeOrUpdateDom)[0] ?? document; - return { - scope, - updateDom: updateDomOrOptions, - defaultOptions: options, - }; - } - - /** - * @deprecated - * - * Import as `frame` instead. - */ - const sync = frame; - /** - * @deprecated - * - * Use cancelFrame(callback) instead. - */ - const cancelSync = stepsOrder.reduce((acc, key) => { - acc[key] = (process) => cancelFrame(process); - return acc; - }, {}); - - function isDOMKeyframes(keyframes) { - return typeof keyframes === "object" && !Array.isArray(keyframes); - } - - function resolveSubjects(subject, keyframes, scope, selectorCache) { - if (subject == null) { - return []; - } - if (typeof subject === "string" && isDOMKeyframes(keyframes)) { - return resolveElements(subject, scope, selectorCache); - } - else if (subject instanceof NodeList) { - return Array.from(subject); - } - else if (Array.isArray(subject)) { - return subject.filter((s) => s != null); - } - else { - return [subject]; - } - } - - function calculateRepeatDuration(duration, repeat, repeatDelay) { - return duration * (repeat + 1) + repeatDelay * repeat; - } - - /** - * Given a absolute or relative time definition and current/prev time state of the sequence, - * calculate an absolute time for the next keyframes. - */ - function calcNextTime(current, next, prev, labels) { - if (typeof next === "number") { - return next; - } - else if (next.startsWith("-") || next.startsWith("+")) { - return Math.max(0, current + parseFloat(next)); - } - else if (next === "<") { - return prev; - } - else if (next.startsWith("<")) { - return Math.max(0, prev + parseFloat(next.slice(1))); - } - else { - return labels.get(next) ?? current; - } - } - - function eraseKeyframes(sequence, startTime, endTime) { - for (let i = 0; i < sequence.length; i++) { - const keyframe = sequence[i]; - if (keyframe.at > startTime && keyframe.at < endTime) { - removeItem(sequence, keyframe); - // If we remove this item we have to push the pointer back one - i--; - } - } - } - function addKeyframes(sequence, keyframes, easing, offset, startTime, endTime) { - /** - * Erase every existing value between currentTime and targetTime, - * this will essentially splice this timeline into any currently - * defined ones. - */ - eraseKeyframes(sequence, startTime, endTime); - for (let i = 0; i < keyframes.length; i++) { - sequence.push({ - value: keyframes[i], - at: mixNumber$1(startTime, endTime, offset[i]), - easing: getEasingForSegment(easing, i), - }); - } - } - - /** - * Take an array of times that represent repeated keyframes. For instance - * if we have original times of [0, 0.5, 1] then our repeated times will - * be [0, 0.5, 1, 1, 1.5, 2]. Loop over the times and scale them back - * down to a 0-1 scale. - * - * `repeatDelayUnits` is the repeatDelay expressed in units of a single - * iteration's duration, so the total span equals `(repeat + 1) + repeat * repeatDelayUnits`. - */ - function normalizeTimes(times, repeat, repeatDelayUnits = 0) { - const totalUnits = repeat + 1 + repeat * repeatDelayUnits; - for (let i = 0; i < times.length; i++) { - times[i] = times[i] / totalUnits; - } - } - - function compareByTime(a, b) { - if (a.at === b.at) { - if (a.value === null) - return 1; - if (b.value === null) - return -1; - return 0; - } - else { - return a.at - b.at; - } - } - - const defaultSegmentEasing = "easeInOut"; - const MAX_REPEAT = 20; - function createAnimationsFromSequence(sequence, { defaultTransition = {}, ...sequenceTransition } = {}, scope, generators) { - const defaultDuration = defaultTransition.duration || 0.3; - const animationDefinitions = new Map(); - const sequences = new Map(); - const elementCache = {}; - const timeLabels = new Map(); - let prevTime = 0; - let currentTime = 0; - let totalDuration = 0; - /** - * Build the timeline by mapping over the sequence array and converting - * the definitions into keyframes and offsets with absolute time values. - * These will later get converted into relative offsets in a second pass. - */ - for (let i = 0; i < sequence.length; i++) { - const segment = sequence[i]; - /** - * If this is a timeline label, mark it and skip the rest of this iteration. - */ - if (typeof segment === "string") { - timeLabels.set(segment, currentTime); - continue; - } - else if (!Array.isArray(segment)) { - timeLabels.set(segment.name, calcNextTime(currentTime, segment.at, prevTime, timeLabels)); - continue; - } - let [subject, keyframes, transition = {}] = segment; - /** - * If a relative or absolute time value has been specified we need to resolve - * it in relation to the currentTime. - */ - if (transition.at !== undefined) { - currentTime = calcNextTime(currentTime, transition.at, prevTime, timeLabels); - } - /** - * Keep track of the maximum duration in this definition. This will be - * applied to currentTime once the definition has been parsed. - */ - let maxDuration = 0; - const resolveValueSequence = (valueKeyframes, valueTransition, valueSequence, elementIndex = 0, numSubjects = 0) => { - const valueKeyframesAsList = keyframesAsList(valueKeyframes); - const { delay = 0, times = defaultOffset$1(valueKeyframesAsList), type = defaultTransition.type || "keyframes", repeat, repeatType, repeatDelay = 0, ...remainingTransition } = valueTransition; - let { ease = defaultTransition.ease || "easeOut", duration } = valueTransition; - /** - * Resolve stagger() if defined. - */ - const calculatedDelay = typeof delay === "function" - ? delay(elementIndex, numSubjects) - : delay; - /** - * If this animation should and can use a spring, generate a spring easing function. - */ - const numKeyframes = valueKeyframesAsList.length; - const createGenerator = isGenerator(type) - ? type - : generators?.[type || "keyframes"]; - if (numKeyframes <= 2 && createGenerator) { - /** - * As we're creating an easing function from a spring, - * ideally we want to generate it using the real distance - * between the two keyframes. However this isn't always - * possible - in these situations we use 0-100. - */ - let absoluteDelta = 100; - if (numKeyframes === 2 && - isNumberKeyframesArray(valueKeyframesAsList)) { - const delta = valueKeyframesAsList[1] - valueKeyframesAsList[0]; - absoluteDelta = Math.abs(delta); - } - const springTransition = { - ...defaultTransition, - ...remainingTransition, - }; - if (duration !== undefined) { - springTransition.duration = secondsToMilliseconds(duration); - } - const springEasing = createGeneratorEasing(springTransition, absoluteDelta, createGenerator); - ease = springEasing.ease; - duration = springEasing.duration; - } - duration ?? (duration = defaultDuration); - const startTime = currentTime + calculatedDelay; - /** - * If there's only one time offset of 0, fill in a second with length 1 - */ - if (times.length === 1 && times[0] === 0) { - times[1] = 1; - } - /** - * Fill out if offset if fewer offsets than keyframes - */ - const remainder = times.length - valueKeyframesAsList.length; - remainder > 0 && fillOffset(times, remainder); - /** - * If only one value has been set, ie [1], push a null to the start of - * the keyframe array. This will let us mark a keyframe at this point - * that will later be hydrated with the previous value. - */ - valueKeyframesAsList.length === 1 && - valueKeyframesAsList.unshift(null); - /** - * Segments can't express `repeat: Infinity` or very large - * counts — they'd leave dead time after the segment or - * explode the keyframe array. Ignore with a warning. - */ - if (repeat) { - exports.warning(repeat < MAX_REPEAT, `Sequence segments can't repeat ${repeat} times — ignoring repeat option. Use a value below ${MAX_REPEAT} or apply repeat at the sequence level instead.`); - } - if (repeat && repeat < MAX_REPEAT) { - /** - * Express repeatDelay in units of a single iteration's duration - * so it can be added to the per-iteration time offsets below - * before they're normalized to 0-1. - */ - const repeatDelayUnits = duration > 0 ? repeatDelay / duration : 0; - duration = calculateRepeatDuration(duration, repeat, repeatDelay); - const originalKeyframes = [...valueKeyframesAsList]; - const originalTimes = [...times]; - ease = Array.isArray(ease) ? [...ease] : [ease]; - const originalEase = [...ease]; - /** - * For reverse/mirror, alternate iterations play the segment - * backwards. mirror matches JSAnimation's mirroredGenerator: - * reversed keyframes, easings unchanged. reverse matches - * JSAnimation's iterationProgress = 1 - p: reversed - * keyframes, easing array reversed AND each function easing - * mapped through reverseEasing (string easings unchanged — - * they're resolved later by the keyframes engine). - */ - const isFlipping = repeatType === "reverse" || repeatType === "mirror"; - let flippedKeyframes = originalKeyframes; - let flippedEases = originalEase; - if (isFlipping) { - flippedKeyframes = [...originalKeyframes].reverse(); - if (repeatType === "reverse") { - flippedEases = [...originalEase] - .reverse() - .map((e) => typeof e === "function" - ? reverseEasing(e) - : e); - } - } - for (let repeatIndex = 0; repeatIndex < repeat; repeatIndex++) { - const isFlipped = isFlipping && repeatIndex % 2 === 0; - const iterKeyframes = isFlipped - ? flippedKeyframes - : originalKeyframes; - const iterEase = isFlipped ? flippedEases : originalEase; - const iterStartOffset = (repeatIndex + 1) * (1 + repeatDelayUnits); - /** - * If repeatDelay is set, hold the previous iteration's - * final value through the delay by inserting a keyframe - * at the moment the next iteration begins. - */ - if (repeatDelayUnits > 0) { - valueKeyframesAsList.push(valueKeyframesAsList[valueKeyframesAsList.length - 1]); - times.push(iterStartOffset); - ease.push("linear"); - } - valueKeyframesAsList.push(...iterKeyframes); - for (let keyframeIndex = 0; keyframeIndex < iterKeyframes.length; keyframeIndex++) { - times.push(originalTimes[keyframeIndex] + iterStartOffset); - ease.push(keyframeIndex === 0 - ? "linear" - : getEasingForSegment(iterEase, keyframeIndex - 1)); - } - } - normalizeTimes(times, repeat, repeatDelayUnits); - } - const targetTime = startTime + duration; - /** - * Add keyframes, mapping offsets to absolute time. - */ - addKeyframes(valueSequence, valueKeyframesAsList, ease, times, startTime, targetTime); - maxDuration = Math.max(calculatedDelay + duration, maxDuration); - totalDuration = Math.max(targetTime, totalDuration); - }; - if (isMotionValue(subject)) { - const subjectSequence = getSubjectSequence(subject, sequences); - resolveValueSequence(keyframes, transition, getValueSequence("default", subjectSequence)); - } - else { - const subjects = resolveSubjects(subject, keyframes, scope, elementCache); - const numSubjects = subjects.length; - /** - * For every element in this segment, process the defined values. - */ - for (let subjectIndex = 0; subjectIndex < numSubjects; subjectIndex++) { - /** - * Cast necessary, but we know these are of this type - */ - keyframes = keyframes; - transition = transition; - const thisSubject = subjects[subjectIndex]; - const subjectSequence = getSubjectSequence(thisSubject, sequences); - for (const key in keyframes) { - resolveValueSequence(keyframes[key], getValueTransition(transition, key), getValueSequence(key, subjectSequence), subjectIndex, numSubjects); - } - } - } - prevTime = currentTime; - currentTime += maxDuration; - } - /** - * For every element and value combination create a new animation. - */ - sequences.forEach((valueSequences, element) => { - for (const key in valueSequences) { - const valueSequence = valueSequences[key]; - /** - * Arrange all the keyframes in ascending time order. - */ - valueSequence.sort(compareByTime); - const keyframes = []; - const valueOffset = []; - const valueEasing = []; - /** - * For each keyframe, translate absolute times into - * relative offsets based on the total duration of the timeline. - */ - for (let i = 0; i < valueSequence.length; i++) { - const { at, value, easing } = valueSequence[i]; - keyframes.push(value); - valueOffset.push(progress(0, totalDuration, at)); - valueEasing.push(easing || "easeOut"); - } - /** - * If the first keyframe doesn't land on offset: 0 - * provide one by duplicating the initial keyframe. This ensures - * it snaps to the first keyframe when the animation starts. - */ - if (valueOffset[0] !== 0) { - valueOffset.unshift(0); - keyframes.unshift(keyframes[0]); - valueEasing.unshift(defaultSegmentEasing); - } - /** - * If the last keyframe doesn't land on offset: 1 - * provide one with a null wildcard value. This will ensure it - * stays static until the end of the animation. - */ - if (valueOffset[valueOffset.length - 1] !== 1) { - valueOffset.push(1); - keyframes.push(null); - } - if (!animationDefinitions.has(element)) { - animationDefinitions.set(element, { - keyframes: {}, - transition: {}, - }); - } - const definition = animationDefinitions.get(element); - definition.keyframes[key] = keyframes; - /** - * Exclude `type` from defaultTransition since springs have been - * converted to duration-based easing functions in resolveValueSequence. - * Including `type: "spring"` would cause JSAnimation to error when - * the merged keyframes array has more than 2 keyframes. - */ - const { type: _type, ...remainingDefaultTransition } = defaultTransition; - definition.transition[key] = { - ...remainingDefaultTransition, - duration: totalDuration, - ease: valueEasing, - times: valueOffset, - ...sequenceTransition, - }; - } - }); - return animationDefinitions; - } - function getSubjectSequence(subject, sequences) { - !sequences.has(subject) && sequences.set(subject, {}); - return sequences.get(subject); - } - function getValueSequence(name, sequences) { - if (!sequences[name]) - sequences[name] = []; - return sequences[name]; - } - function keyframesAsList(keyframes) { - return Array.isArray(keyframes) ? keyframes : [keyframes]; - } - function getValueTransition(transition, key) { - return transition && transition[key] - ? { - ...transition, - ...transition[key], - } - : { ...transition }; - } - const isNumber = (keyframe) => typeof keyframe === "number"; - const isNumberKeyframesArray = (keyframes) => keyframes.every(isNumber); - - function createDOMVisualElement(element) { - const options = { - presenceContext: null, - props: {}, - visualState: { - renderState: { - transform: {}, - transformOrigin: {}, - style: {}, - vars: {}, - attrs: {}, - }, - latestValues: {}, - }, - }; - const node = isSVGElement(element) && !isSVGSVGElement(element) - ? new SVGVisualElement(options) - : new HTMLVisualElement(options); - node.mount(element); - visualElementStore.set(element, node); - } - function createObjectVisualElement(subject) { - const options = { - presenceContext: null, - props: {}, - visualState: { - renderState: { - output: {}, - }, - latestValues: {}, - }, - }; - const node = new ObjectVisualElement(options); - node.mount(subject); - visualElementStore.set(subject, node); - } - - function isSingleValue(subject, keyframes) { - return (isMotionValue(subject) || - typeof subject === "number" || - (typeof subject === "string" && !isDOMKeyframes(keyframes))); - } - /** - * Implementation - */ - function animateSubject(subject, keyframes, options, scope) { - const animations = []; - if (isSingleValue(subject, keyframes)) { - animations.push(animateSingleValue(subject, isDOMKeyframes(keyframes) - ? keyframes.default || keyframes - : keyframes, options ? options.default || options : options)); - } - else { - // Gracefully handle null/undefined subjects (e.g., from querySelector returning null) - if (subject == null) { - return animations; - } - const subjects = resolveSubjects(subject, keyframes, scope); - const numSubjects = subjects.length; - exports.invariant(Boolean(numSubjects), "No valid elements provided.", "no-valid-elements"); - for (let i = 0; i < numSubjects; i++) { - const thisSubject = subjects[i]; - const createVisualElement = thisSubject instanceof Element - ? createDOMVisualElement - : createObjectVisualElement; - if (!visualElementStore.has(thisSubject)) { - createVisualElement(thisSubject); - } - const visualElement = visualElementStore.get(thisSubject); - const transition = { ...options }; - /** - * Resolve stagger function if provided. - */ - if ("delay" in transition && - typeof transition.delay === "function") { - transition.delay = transition.delay(i, numSubjects); - } - animations.push(...animateTarget(visualElement, { ...keyframes, transition }, {})); - } - } - return animations; - } - - function animateSequence(sequence, options, scope) { - const animations = []; - /** - * Pre-process: replace function segments with MotionValue segments, - * subscribe callbacks immediately - */ - const processedSequence = sequence.map((segment) => { - if (Array.isArray(segment) && typeof segment[0] === "function") { - const callback = segment[0]; - const mv = motionValue(0); - mv.on("change", callback); - if (segment.length === 1) { - return [mv, [0, 1]]; - } - else if (segment.length === 2) { - return [mv, [0, 1], segment[1]]; - } - else { - return [mv, segment[1], segment[2]]; - } - } - return segment; - }); - const animationDefinitions = createAnimationsFromSequence(processedSequence, options, scope, { spring }); - animationDefinitions.forEach(({ keyframes, transition }, subject) => { - animations.push(...animateSubject(subject, keyframes, transition)); - }); - return animations; - } - - function isSequence(value) { - return Array.isArray(value) && value.some(Array.isArray); - } - /** - * Creates an animation function that is optionally scoped - * to a specific element. - */ - function createScopedAnimate(options = {}) { - const { scope, reduceMotion, skipAnimations } = options; - /** - * Implementation - */ - function scopedAnimate(subjectOrSequence, optionsOrKeyframes, options) { - let animations = []; - let animationOnComplete; - const inherited = {}; - if (reduceMotion !== undefined) - inherited.reduceMotion = reduceMotion; - if (skipAnimations !== undefined) - inherited.skipAnimations = skipAnimations; - if (isSequence(subjectOrSequence)) { - const { onComplete, ...sequenceOptions } = optionsOrKeyframes || {}; - if (typeof onComplete === "function") { - animationOnComplete = onComplete; - } - animations = animateSequence(subjectOrSequence, { ...inherited, ...sequenceOptions }, scope); - } - else { - // Extract top-level onComplete so it doesn't get applied per-value - const { onComplete, ...rest } = options || {}; - if (typeof onComplete === "function") { - animationOnComplete = onComplete; - } - animations = animateSubject(subjectOrSequence, optionsOrKeyframes, { ...inherited, ...rest }, scope); - } - const animation = new GroupAnimationWithThen(animations); - if (animationOnComplete) { - animation.finished.then(animationOnComplete); - } - if (scope) { - scope.animations.push(animation); - animation.finished.then(() => { - removeItem(scope.animations, animation); - }); - } - return animation; - } - return scopedAnimate; - } - const animate = createScopedAnimate(); - - function animateElements(elementOrSelector, keyframes, options, scope) { - // Gracefully handle null/undefined elements (e.g., from querySelector returning null) - if (elementOrSelector == null) { - return []; - } - const elements = resolveElements(elementOrSelector, scope); - const numElements = elements.length; - exports.invariant(Boolean(numElements), "No valid elements provided.", "no-valid-elements"); - /** - * WAAPI doesn't support interrupting animations. - * - * Therefore, starting animations requires a three-step process: - * 1. Stop existing animations (write styles to DOM) - * 2. Resolve keyframes (read styles from DOM) - * 3. Create new animations (write styles to DOM) - * - * The hybrid `animate()` function uses AsyncAnimation to resolve - * keyframes before creating new animations, which removes style - * thrashing. Here, we have much stricter filesize constraints. - * Therefore we do this in a synchronous way that ensures that - * at least within `animate()` calls there is no style thrashing. - * - * In the motion-native-animate-mini-interrupt benchmark this - * was 80% faster than a single loop. - */ - const animationDefinitions = []; - /** - * Step 1: Build options and stop existing animations (write) - */ - for (let i = 0; i < numElements; i++) { - const element = elements[i]; - const elementTransition = { ...options }; - /** - * Resolve stagger function if provided. - */ - if (typeof elementTransition.delay === "function") { - elementTransition.delay = elementTransition.delay(i, numElements); - } - for (const valueName in keyframes) { - let valueKeyframes = keyframes[valueName]; - if (!Array.isArray(valueKeyframes)) { - valueKeyframes = [valueKeyframes]; - } - const valueOptions = { - ...getValueTransition$1(elementTransition, valueName), - }; - valueOptions.duration && (valueOptions.duration = secondsToMilliseconds(valueOptions.duration)); - valueOptions.delay && (valueOptions.delay = secondsToMilliseconds(valueOptions.delay)); - /** - * If there's an existing animation playing on this element then stop it - * before creating a new one. - */ - const map = getAnimationMap(element); - const key = animationMapKey(valueName, valueOptions.pseudoElement || ""); - const currentAnimation = map.get(key); - currentAnimation && currentAnimation.stop(); - animationDefinitions.push({ - map, - key, - unresolvedKeyframes: valueKeyframes, - options: { - ...valueOptions, - element, - name: valueName, - allowFlatten: !elementTransition.type && !elementTransition.ease, - }, - }); - } - } - /** - * Step 2: Resolve keyframes (read) - */ - for (let i = 0; i < animationDefinitions.length; i++) { - const { unresolvedKeyframes, options: animationOptions } = animationDefinitions[i]; - const { element, name, pseudoElement } = animationOptions; - if (!pseudoElement && unresolvedKeyframes[0] === null) { - unresolvedKeyframes[0] = getComputedStyle$2(element, name); - } - fillWildcards(unresolvedKeyframes); - applyPxDefaults(unresolvedKeyframes, name); - /** - * If we only have one keyframe, explicitly read the initial keyframe - * from the computed style. This is to ensure consistency with WAAPI behaviour - * for restarting animations, for instance .play() after finish, when it - * has one vs two keyframes. - */ - if (!pseudoElement && unresolvedKeyframes.length < 2) { - unresolvedKeyframes.unshift(getComputedStyle$2(element, name)); - } - animationOptions.keyframes = unresolvedKeyframes; - } - /** - * Step 3: Create new animations (write) - */ - const animations = []; - for (let i = 0; i < animationDefinitions.length; i++) { - const { map, key, options: animationOptions } = animationDefinitions[i]; - const animation = new NativeAnimation(animationOptions); - map.set(key, animation); - animation.finished.finally(() => map.delete(key)); - animations.push(animation); - } - return animations; - } - - const createScopedWaapiAnimate = (scope) => { - function scopedAnimate(elementOrSelector, keyframes, options) { - return new GroupAnimationWithThen(animateElements(elementOrSelector, keyframes, options, scope)); - } - return scopedAnimate; - }; - const animateMini = /*@__PURE__*/ createScopedWaapiAnimate(); - - function canUseNativeTimeline(target) { - if (typeof window === "undefined") - return false; - return target ? supportsViewTimeline() : supportsScrollTimeline(); - } - - /** - * A time in milliseconds, beyond which we consider the scroll velocity to be 0. - */ - const maxElapsed = 50; - const createAxisInfo = () => ({ - current: 0, - offset: [], - progress: 0, - scrollLength: 0, - targetOffset: 0, - targetLength: 0, - containerLength: 0, - velocity: 0, - }); - const createScrollInfo = () => ({ - time: 0, - x: createAxisInfo(), - y: createAxisInfo(), - }); - const keys = { - x: { - length: "Width", - position: "Left", - }, - y: { - length: "Height", - position: "Top", - }, - }; - function updateAxisInfo(element, axisName, info, time) { - const axis = info[axisName]; - const { length, position } = keys[axisName]; - const prev = axis.current; - const prevTime = info.time; - axis.current = Math.abs(element[`scroll${position}`]); - axis.scrollLength = element[`scroll${length}`] - element[`client${length}`]; - axis.offset.length = 0; - axis.offset[0] = 0; - axis.offset[1] = axis.scrollLength; - axis.progress = progress(0, axis.scrollLength, axis.current); - const elapsed = time - prevTime; - axis.velocity = - elapsed > maxElapsed - ? 0 - : velocityPerSecond(axis.current - prev, elapsed); - } - function updateScrollInfo(element, info, time) { - updateAxisInfo(element, "x", info, time); - updateAxisInfo(element, "y", info, time); - info.time = time; - } - - function calcInset(element, container) { - const inset = { x: 0, y: 0 }; - let current = element; - while (current && current !== container) { - if (isHTMLElement(current)) { - inset.x += current.offsetLeft; - inset.y += current.offsetTop; - current = current.offsetParent; - } - else if (current.tagName === "svg") { - /** - * This isn't an ideal approach to measuring the offset of tags. - * It would be preferable, given they behave like HTMLElements in most ways - * to use offsetLeft/Top. But these don't exist on . Likewise we - * can't use .getBBox() like most SVG elements as these provide the offset - * relative to the SVG itself, which for is usually 0x0. - */ - const svgBoundingBox = current.getBoundingClientRect(); - current = current.parentElement; - const parentBoundingBox = current.getBoundingClientRect(); - inset.x += svgBoundingBox.left - parentBoundingBox.left; - inset.y += svgBoundingBox.top - parentBoundingBox.top; - } - else if (current instanceof SVGGraphicsElement) { - const { x, y } = current.getBBox(); - inset.x += x; - inset.y += y; - let svg = null; - let parent = current.parentNode; - while (!svg) { - if (parent.tagName === "svg") { - svg = parent; - } - parent = current.parentNode; - } - current = svg; - } - else { - break; - } - } - return inset; - } - - const namedEdges = { - start: 0, - center: 0.5, - end: 1, - }; - function resolveEdge(edge, length, inset = 0) { - let delta = 0; - /** - * If we have this edge defined as a preset, replace the definition - * with the numerical value. - */ - if (edge in namedEdges) { - edge = namedEdges[edge]; - } - /** - * Handle unit values - */ - if (typeof edge === "string") { - const asNumber = parseFloat(edge); - if (edge.endsWith("px")) { - delta = asNumber; - } - else if (edge.endsWith("%")) { - edge = asNumber / 100; - } - else if (edge.endsWith("vw")) { - delta = (asNumber / 100) * document.documentElement.clientWidth; - } - else if (edge.endsWith("vh")) { - delta = (asNumber / 100) * document.documentElement.clientHeight; - } - else { - edge = asNumber; - } - } - /** - * If the edge is defined as a number, handle as a progress value. - */ - if (typeof edge === "number") { - delta = length * edge; - } - return inset + delta; - } - - const defaultOffset = [0, 0]; - function resolveOffset(offset, containerLength, targetLength, targetInset) { - let offsetDefinition = Array.isArray(offset) ? offset : defaultOffset; - let targetPoint = 0; - let containerPoint = 0; - if (typeof offset === "number") { - /** - * If we're provided offset: [0, 0.5, 1] then each number x should become - * [x, x], so we default to the behaviour of mapping 0 => 0 of both target - * and container etc. - */ - offsetDefinition = [offset, offset]; - } - else if (typeof offset === "string") { - offset = offset.trim(); - if (offset.includes(" ")) { - offsetDefinition = offset.split(" "); - } - else { - /** - * If we're provided a definition like "100px" then we want to apply - * that only to the top of the target point, leaving the container at 0. - * Whereas a named offset like "end" should be applied to both. - */ - offsetDefinition = [offset, namedEdges[offset] ? offset : `0`]; - } - } - targetPoint = resolveEdge(offsetDefinition[0], targetLength, targetInset); - containerPoint = resolveEdge(offsetDefinition[1], containerLength); - return targetPoint - containerPoint; - } - - const ScrollOffset = { - Enter: [ - [0, 1], - [1, 1], - ], - Exit: [ - [0, 0], - [1, 0], - ], - Any: [ - [1, 0], - [0, 1], - ], - All: [ - [0, 0], - [1, 1], - ], - }; - - const point = { x: 0, y: 0 }; - function getTargetSize(target) { - return "getBBox" in target && target.tagName !== "svg" - ? target.getBBox() - : { width: target.clientWidth, height: target.clientHeight }; - } - function resolveOffsets(container, info, options) { - const { offset: offsetDefinition = ScrollOffset.All } = options; - const { target = container, axis = "y" } = options; - const lengthLabel = axis === "y" ? "height" : "width"; - const inset = target !== container ? calcInset(target, container) : point; - /** - * Measure the target and container. If they're the same thing then we - * use the container's scrollWidth/Height as the target, from there - * all other calculations can remain the same. - */ - const targetSize = target === container - ? { width: container.scrollWidth, height: container.scrollHeight } - : getTargetSize(target); - const containerSize = { - width: container.clientWidth, - height: container.clientHeight, - }; - /** - * Reset the length of the resolved offset array rather than creating a new one. - * TODO: More reusable data structures for targetSize/containerSize would also be good. - */ - info[axis].offset.length = 0; - /** - * Populate the offset array by resolving the user's offset definition into - * a list of pixel scroll offets. - */ - let hasChanged = !info[axis].interpolate; - const numOffsets = offsetDefinition.length; - for (let i = 0; i < numOffsets; i++) { - const offset = resolveOffset(offsetDefinition[i], containerSize[lengthLabel], targetSize[lengthLabel], inset[axis]); - if (!hasChanged && offset !== info[axis].interpolatorOffsets[i]) { - hasChanged = true; - } - info[axis].offset[i] = offset; - } - /** - * If the pixel scroll offsets have changed, create a new interpolator function - * to map scroll value into a progress. - */ - if (hasChanged) { - info[axis].interpolate = interpolate(info[axis].offset, defaultOffset$1(offsetDefinition), { clamp: false }); - info[axis].interpolatorOffsets = [...info[axis].offset]; - } - info[axis].progress = clamp(0, 1, info[axis].interpolate(info[axis].current)); - } - - function measure(container, target = container, info) { - /** - * Find inset of target within scrollable container - */ - info.x.targetOffset = 0; - info.y.targetOffset = 0; - if (target !== container) { - let node = target; - while (node && node !== container) { - info.x.targetOffset += node.offsetLeft; - info.y.targetOffset += node.offsetTop; - node = node.offsetParent; - } - } - info.x.targetLength = - target === container ? target.scrollWidth : target.clientWidth; - info.y.targetLength = - target === container ? target.scrollHeight : target.clientHeight; - info.x.containerLength = container.clientWidth; - info.y.containerLength = container.clientHeight; - /** - * In development mode ensure scroll containers aren't position: static as this makes - * it difficult to measure their relative positions. The document scrolling element - * is exempt: offsetParent measurements naturally resolve relative to the document. - */ - { - if (container && - target && - target !== container && - container !== document.documentElement && - container !== document.scrollingElement && - container !== document.body) { - warnOnce(getComputedStyle(container).position !== "static", "Please ensure that the container has a non-static position, like 'relative', 'fixed', or 'absolute' to ensure scroll offset is calculated correctly."); - } - } - } - function createOnScrollHandler(element, onScroll, info, options = {}) { - return { - measure: (time) => { - measure(element, options.target, info); - updateScrollInfo(element, info, time); - if (options.offset || options.target) { - resolveOffsets(element, info, options); - } - }, - notify: () => onScroll(info), - }; - } - - const scrollListeners = new WeakMap(); - const resizeListeners = new WeakMap(); - const onScrollHandlers = new WeakMap(); - const scrollSize = new WeakMap(); - const dimensionCheckProcesses = new WeakMap(); - const getEventTarget = (element) => element === document.scrollingElement ? window : element; - function scrollInfo(onScroll, { container = document.scrollingElement, trackContentSize = false, ...options } = {}) { - if (!container) - return noop; - let containerHandlers = onScrollHandlers.get(container); - /** - * Get the onScroll handlers for this container. - * If one isn't found, create a new one. - */ - if (!containerHandlers) { - containerHandlers = new Set(); - onScrollHandlers.set(container, containerHandlers); - } - /** - * Create a new onScroll handler for the provided callback. - */ - const info = createScrollInfo(); - const containerHandler = createOnScrollHandler(container, onScroll, info, options); - containerHandlers.add(containerHandler); - /** - * Check if there's a scroll event listener for this container. - * If not, create one. - */ - if (!scrollListeners.has(container)) { - const measureAll = () => { - for (const handler of containerHandlers) { - handler.measure(frameData.timestamp); - } - frame.preUpdate(notifyAll); - }; - const notifyAll = () => { - for (const handler of containerHandlers) { - handler.notify(); - } - }; - const listener = () => frame.read(measureAll); - scrollListeners.set(container, listener); - const target = getEventTarget(container); - window.addEventListener("resize", listener); - if (container !== document.documentElement) { - resizeListeners.set(container, resize(container, listener)); - } - target.addEventListener("scroll", listener); - listener(); - } - /** - * Enable content size tracking if requested and not already enabled. - */ - if (trackContentSize && !dimensionCheckProcesses.has(container)) { - const listener = scrollListeners.get(container); - // Store initial scroll dimensions (object is reused to avoid allocation) - const size = { - width: container.scrollWidth, - height: container.scrollHeight, - }; - scrollSize.set(container, size); - // Add frame-based scroll dimension checking to detect content changes - const checkScrollDimensions = () => { - const newWidth = container.scrollWidth; - const newHeight = container.scrollHeight; - if (size.width !== newWidth || size.height !== newHeight) { - listener(); - size.width = newWidth; - size.height = newHeight; - } - }; - // Schedule with keepAlive=true to run every frame - const dimensionCheckProcess = frame.read(checkScrollDimensions, true); - dimensionCheckProcesses.set(container, dimensionCheckProcess); - } - const listener = scrollListeners.get(container); - frame.read(listener, false, true); - return () => { - cancelFrame(listener); - /** - * Check if we even have any handlers for this container. - */ - const currentHandlers = onScrollHandlers.get(container); - if (!currentHandlers) - return; - currentHandlers.delete(containerHandler); - if (currentHandlers.size) - return; - /** - * If no more handlers, remove the scroll listener too. - */ - const scrollListener = scrollListeners.get(container); - scrollListeners.delete(container); - if (scrollListener) { - getEventTarget(container).removeEventListener("scroll", scrollListener); - resizeListeners.get(container)?.(); - window.removeEventListener("resize", scrollListener); - } - // Clean up scroll dimension checking - const dimensionCheckProcess = dimensionCheckProcesses.get(container); - if (dimensionCheckProcess) { - cancelFrame(dimensionCheckProcess); - dimensionCheckProcesses.delete(container); - } - scrollSize.delete(container); - }; - } - - /** - * Maps from ProgressIntersection pairs used by Motion's preset offsets to - * ViewTimeline named ranges. Returns undefined for unrecognised patterns, - * which signals the caller to fall back to JS-based scroll tracking. - */ - const presets = [ - [ScrollOffset.Enter, "entry"], - [ScrollOffset.Exit, "exit"], - [ScrollOffset.Any, "cover"], - [ScrollOffset.All, "contain"], - ]; - const stringToProgress = { - start: 0, - end: 1, - }; - function parseStringOffset(s) { - const parts = s.trim().split(/\s+/); - if (parts.length !== 2) - return undefined; - const a = stringToProgress[parts[0]]; - const b = stringToProgress[parts[1]]; - if (a === undefined || b === undefined) - return undefined; - return [a, b]; - } - function normaliseOffset(offset) { - if (offset.length !== 2) - return undefined; - const result = []; - for (const item of offset) { - if (Array.isArray(item)) { - result.push(item); - } - else if (typeof item === "string") { - const parsed = parseStringOffset(item); - if (!parsed) - return undefined; - result.push(parsed); - } - else { - return undefined; - } - } - return result; - } - function matchesPreset(offset, preset) { - const normalised = normaliseOffset(offset); - if (!normalised) - return false; - for (let i = 0; i < 2; i++) { - const o = normalised[i]; - const p = preset[i]; - if (o[0] !== p[0] || o[1] !== p[1]) - return false; - } - return true; - } - function offsetToViewTimelineRange(offset) { - if (!offset) { - return { rangeStart: "contain 0%", rangeEnd: "contain 100%" }; - } - for (const [preset, name] of presets) { - if (matchesPreset(offset, preset)) { - return { rangeStart: `${name} 0%`, rangeEnd: `${name} 100%` }; - } - } - return undefined; - } - - const timelineCache = new Map(); - function scrollTimelineFallback(options) { - const currentTime = { value: 0 }; - const cancel = scrollInfo((info) => { - currentTime.value = info[options.axis].progress * 100; - }, options); - return { currentTime, cancel }; - } - function getTimeline({ source, container, ...options }) { - const { axis } = options; - if (source) - container = source; - let containerCache = timelineCache.get(container); - if (!containerCache) { - containerCache = new Map(); - timelineCache.set(container, containerCache); - } - const targetKey = options.target ?? "self"; - let targetCache = containerCache.get(targetKey); - if (!targetCache) { - targetCache = {}; - containerCache.set(targetKey, targetCache); - } - const axisKey = axis + (options.offset ?? []).join(","); - if (!targetCache[axisKey]) { - if (options.target && canUseNativeTimeline(options.target)) { - const range = offsetToViewTimelineRange(options.offset); - if (range) { - targetCache[axisKey] = new ViewTimeline({ - subject: options.target, - axis, - }); - } - else { - targetCache[axisKey] = scrollTimelineFallback({ - container, - ...options, - }); - } - } - else if (canUseNativeTimeline()) { - targetCache[axisKey] = new ScrollTimeline({ - source: container, - axis, - }); - } - else { - targetCache[axisKey] = scrollTimelineFallback({ - container, - ...options, - }); - } - } - return targetCache[axisKey]; - } - - function attachToAnimation(animation, options) { - const timeline = getTimeline(options); - const range = options.target - ? offsetToViewTimelineRange(options.offset) - : undefined; - /** - * Use native timeline when: - * - No target: ScrollTimeline (existing behaviour) - * - Target with mappable offset: ViewTimeline with named range - * - Target with unmappable offset: fall back to JS observe - */ - const useNative = options.target - ? canUseNativeTimeline(options.target) && !!range - : canUseNativeTimeline(); - return animation.attachTimeline({ - timeline: useNative ? timeline : undefined, - ...(range && - useNative && { - rangeStart: range.rangeStart, - rangeEnd: range.rangeEnd, - }), - observe: (valueAnimation) => { - valueAnimation.pause(); - return observeTimeline((progress) => { - valueAnimation.time = - valueAnimation.iterationDuration * progress; - }, timeline); - }, - }); - } - - /** - * Currently, we only support element tracking with `scrollInfo`, though in - * the future we can also offer ViewTimeline support. - */ - function isElementTracking(options) { - return options && (options.target || options.offset); - } - - /** - * If the onScroll function has two arguments, it's expecting - * more specific information about the scroll from scrollInfo. - */ - function isOnScrollWithInfo(onScroll) { - return onScroll.length === 2; - } - function attachToFunction(onScroll, options) { - if (isOnScrollWithInfo(onScroll) || isElementTracking(options)) { - return scrollInfo((info) => { - onScroll(info[options.axis].progress, info); - }, options); - } - else { - return observeTimeline(onScroll, getTimeline(options)); - } - } - - function scroll(onScroll, { axis = "y", container = document.scrollingElement, ...options } = {}) { - if (!container) - return noop; - const optionsWithDefaults = { axis, container, ...options }; - return typeof onScroll === "function" - ? attachToFunction(onScroll, optionsWithDefaults) - : attachToAnimation(onScroll, optionsWithDefaults); - } - - const thresholds = { - some: 0, - all: 1, - }; - function inView(elementOrSelector, onStart, { root, margin: rootMargin, amount = "some" } = {}) { - const elements = resolveElements(elementOrSelector); - const activeIntersections = new WeakMap(); - const onIntersectionChange = (entries) => { - entries.forEach((entry) => { - const onEnd = activeIntersections.get(entry.target); - /** - * If there's no change to the intersection, we don't need to - * do anything here. - */ - if (entry.isIntersecting === Boolean(onEnd)) - return; - if (entry.isIntersecting) { - const newOnEnd = onStart(entry.target, entry); - if (typeof newOnEnd === "function") { - activeIntersections.set(entry.target, newOnEnd); - } - else { - observer.unobserve(entry.target); - } - } - else if (typeof onEnd === "function") { - onEnd(entry); - activeIntersections.delete(entry.target); - } - }); - }; - const observer = new IntersectionObserver(onIntersectionChange, { - root, - rootMargin, - threshold: typeof amount === "number" ? amount : thresholds[amount], - }); - elements.forEach((element) => observer.observe(element)); - return () => observer.disconnect(); - } - - const distance = (a, b) => Math.abs(a - b); - function distance2D(a, b) { - // Multi-dimensional - const xDelta = distance(a.x, b.x); - const yDelta = distance(a.y, b.y); - return Math.sqrt(xDelta ** 2 + yDelta ** 2); - } - - exports.AsyncMotionValueAnimation = AsyncMotionValueAnimation; - exports.DOMKeyframesResolver = DOMKeyframesResolver; - exports.DOMVisualElement = DOMVisualElement; - exports.DocumentProjectionNode = DocumentProjectionNode; - exports.Feature = Feature; - exports.FlatTree = FlatTree; - exports.GroupAnimation = GroupAnimation; - exports.GroupAnimationWithThen = GroupAnimationWithThen; - exports.HTMLProjectionNode = HTMLProjectionNode; - exports.HTMLVisualElement = HTMLVisualElement; - exports.JSAnimation = JSAnimation; - exports.KeyframeResolver = KeyframeResolver; - exports.LayoutAnimationBuilder = LayoutAnimationBuilder; - exports.MotionGlobalConfig = MotionGlobalConfig; - exports.MotionValue = MotionValue; - exports.NativeAnimation = NativeAnimation; - exports.NativeAnimationExtended = NativeAnimationExtended; - exports.NativeAnimationWrapper = NativeAnimationWrapper; - exports.NodeStack = NodeStack; - exports.ObjectVisualElement = ObjectVisualElement; - exports.SVGVisualElement = SVGVisualElement; - exports.SubscriptionManager = SubscriptionManager; - exports.ViewTransitionBuilder = ViewTransitionBuilder; - exports.VisualElement = VisualElement; - exports.acceleratedValues = acceleratedValues; - exports.addAttrValue = addAttrValue; - exports.addDomEvent = addDomEvent; - exports.addScaleCorrector = addScaleCorrector; - exports.addStyleValue = addStyleValue; - exports.addUniqueItem = addUniqueItem; - exports.addValueToWillChange = addValueToWillChange; - exports.alpha = alpha; - exports.analyseComplexValue = analyseComplexValue; - exports.animate = animate; - exports.animateMini = animateMini; - exports.animateMotionValue = animateMotionValue; - exports.animateSingleValue = animateSingleValue; - exports.animateTarget = animateTarget; - exports.animateValue = animateValue; - exports.animateVariant = animateVariant; - exports.animateView = animateView; - exports.animateVisualElement = animateVisualElement; - exports.animationMapKey = animationMapKey; - exports.anticipate = anticipate; - exports.applyAxisDelta = applyAxisDelta; - exports.applyBoxDelta = applyBoxDelta; - exports.applyGeneratorOptions = applyGeneratorOptions; - exports.applyPointDelta = applyPointDelta; - exports.applyPxDefaults = applyPxDefaults; - exports.applyTreeDeltas = applyTreeDeltas; - exports.arc = arc; - exports.aspectRatio = aspectRatio; - exports.attachFollow = attachFollow; - exports.attachSpring = attachSpring; - exports.attrEffect = attrEffect; - exports.axisDeltaEquals = axisDeltaEquals; - exports.axisEquals = axisEquals; - exports.axisEqualsRounded = axisEqualsRounded; - exports.backIn = backIn; - exports.backInOut = backInOut; - exports.backOut = backOut; - exports.boxEquals = boxEquals; - exports.boxEqualsRounded = boxEqualsRounded; - exports.buildHTMLStyles = buildHTMLStyles; - exports.buildProjectionTransform = buildProjectionTransform; - exports.buildSVGAttrs = buildSVGAttrs; - exports.buildSVGPath = buildSVGPath; - exports.buildTransform = buildTransform; - exports.calcAxisDelta = calcAxisDelta; - exports.calcBoxDelta = calcBoxDelta; - exports.calcChildStagger = calcChildStagger; - exports.calcGeneratorDuration = calcGeneratorDuration; - exports.calcLength = calcLength; - exports.calcRelativeAxis = calcRelativeAxis; - exports.calcRelativeAxisPosition = calcRelativeAxisPosition; - exports.calcRelativeBox = calcRelativeBox; - exports.calcRelativePosition = calcRelativePosition; - exports.camelCaseAttributes = camelCaseAttributes; - exports.camelToDash = camelToDash; - exports.cancelFrame = cancelFrame; - exports.cancelMicrotask = cancelMicrotask; - exports.cancelSync = cancelSync; - exports.checkVariantsDidChange = checkVariantsDidChange; - exports.circIn = circIn; - exports.circInOut = circInOut; - exports.circOut = circOut; - exports.clamp = clamp; - exports.cleanDirtyNodes = cleanDirtyNodes; - exports.collectMotionValues = collectMotionValues; - exports.color = color; - exports.compareByDepth = compareByDepth; - exports.complex = complex; - exports.containsCSSVariable = containsCSSVariable; - exports.convertBoundingBoxToBox = convertBoundingBoxToBox; - exports.convertBoxToBoundingBox = convertBoxToBoundingBox; - exports.convertOffsetToTimes = convertOffsetToTimes; - exports.copyAxisDeltaInto = copyAxisDeltaInto; - exports.copyAxisInto = copyAxisInto; - exports.copyBoxInto = copyBoxInto; - exports.correctBorderRadius = correctBorderRadius; - exports.correctBoxShadow = correctBoxShadow; - exports.createAnimationState = createAnimationState; - exports.createAxis = createAxis; - exports.createAxisDelta = createAxisDelta; - exports.createBox = createBox; - exports.createDelta = createDelta; - exports.createGeneratorEasing = createGeneratorEasing; - exports.createProjectionNode = createProjectionNode; - exports.createRenderBatcher = createRenderBatcher; - exports.createScopedAnimate = createScopedAnimate; - exports.cubicBezier = cubicBezier; - exports.cubicBezierAsString = cubicBezierAsString; - exports.defaultEasing = defaultEasing; - exports.defaultOffset = defaultOffset$1; - exports.defaultTransformValue = defaultTransformValue; - exports.defaultValueTypes = defaultValueTypes; - exports.degrees = degrees; - exports.delay = delayInSeconds; - exports.delayInSeconds = delayInSeconds; - exports.dimensionValueTypes = dimensionValueTypes; - exports.distance = distance; - exports.distance2D = distance2D; - exports.eachAxis = eachAxis; - exports.easeIn = easeIn; - exports.easeInOut = easeInOut; - exports.easeOut = easeOut; - exports.easingDefinitionToFunction = easingDefinitionToFunction; - exports.fillOffset = fillOffset; - exports.fillWildcards = fillWildcards; - exports.findDimensionValueType = findDimensionValueType; - exports.findValueType = findValueType; - exports.flushKeyframeResolvers = flushKeyframeResolvers; - exports.followValue = followValue; - exports.frame = frame; - exports.frameData = frameData; - exports.frameSteps = frameSteps; - exports.generateLinearEasing = generateLinearEasing; - exports.getAnimatableNone = getAnimatableNone; - exports.getAnimationMap = getAnimationMap; - exports.getComputedStyle = getComputedStyle$2; - exports.getDefaultTransition = getDefaultTransition; - exports.getDefaultValueType = getDefaultValueType; - exports.getEasingForSegment = getEasingForSegment; - exports.getFeatureDefinitions = getFeatureDefinitions; - exports.getFinalKeyframe = getFinalKeyframe; - exports.getMixer = getMixer; - exports.getOptimisedAppearId = getOptimisedAppearId; - exports.getOriginIndex = getOriginIndex; - exports.getValueAsType = getValueAsType; - exports.getValueTransition = getValueTransition$1; - exports.getVariableValue = getVariableValue; - exports.getVariantContext = getVariantContext; - exports.getViewAnimationLayerInfo = getViewAnimationLayerInfo; - exports.getViewAnimations = getViewAnimations; - exports.globalProjectionState = globalProjectionState; - exports.has2DTranslate = has2DTranslate; - exports.hasReducedMotionListener = hasReducedMotionListener; - exports.hasScale = hasScale; - exports.hasTransform = hasTransform; - exports.hasWarned = hasWarned; - exports.hex = hex; - exports.hover = hover; - exports.hsla = hsla; - exports.hslaToRgba = hslaToRgba; - exports.inView = inView; - exports.inertia = inertia; - exports.initPrefersReducedMotion = initPrefersReducedMotion; - exports.interpolate = interpolate; - exports.invisibleValues = invisibleValues; - exports.isAnimationControls = isAnimationControls; - exports.isBezierDefinition = isBezierDefinition; - exports.isCSSVariableName = isCSSVariableName; - exports.isCSSVariableToken = isCSSVariableToken; - exports.isControllingVariants = isControllingVariants; - exports.isDeltaZero = isDeltaZero; - exports.isDragActive = isDragActive; - exports.isDragging = isDragging; - exports.isEasingArray = isEasingArray; - exports.isElementKeyboardAccessible = isElementKeyboardAccessible; - exports.isElementTextInput = isElementTextInput; - exports.isForcedMotionValue = isForcedMotionValue; - exports.isGenerator = isGenerator; - exports.isHTMLElement = isHTMLElement; - exports.isKeyframesTarget = isKeyframesTarget; - exports.isMotionValue = isMotionValue; - exports.isNear = isNear; - exports.isNodeOrChild = isNodeOrChild; - exports.isNumericalString = isNumericalString; - exports.isObject = isObject; - exports.isPrimaryPointer = isPrimaryPointer; - exports.isSVGElement = isSVGElement; - exports.isSVGSVGElement = isSVGSVGElement; - exports.isSVGTag = isSVGTag; - exports.isTransitionDefined = isTransitionDefined; - exports.isVariantLabel = isVariantLabel; - exports.isVariantNode = isVariantNode; - exports.isWaapiSupportedEasing = isWaapiSupportedEasing; - exports.isWillChangeMotionValue = isWillChangeMotionValue; - exports.isZeroValueString = isZeroValueString; - exports.keyframes = keyframes; - exports.makeAnimationInstant = makeAnimationInstant; - exports.mapEasingToNativeEasing = mapEasingToNativeEasing; - exports.mapValue = mapValue; - exports.maxGeneratorDuration = maxGeneratorDuration; - exports.measurePageBox = measurePageBox; - exports.measureViewportBox = measureViewportBox; - exports.memo = memo; - exports.microtask = microtask; - exports.millisecondsToSeconds = millisecondsToSeconds; - exports.mirrorEasing = mirrorEasing; - exports.mix = mix; - exports.mixArray = mixArray; - exports.mixColor = mixColor; - exports.mixComplex = mixComplex; - exports.mixImmediate = mixImmediate; - exports.mixLinearColor = mixLinearColor; - exports.mixNumber = mixNumber$1; - exports.mixObject = mixObject; - exports.mixValues = mixValues; - exports.mixVisibility = mixVisibility; - exports.motionValue = motionValue; - exports.moveItem = moveItem; - exports.nodeGroup = nodeGroup; - exports.noop = noop; - exports.number = number; - exports.numberValueTypes = numberValueTypes; - exports.observeTimeline = observeTimeline; - exports.optimizedAppearDataAttribute = optimizedAppearDataAttribute; - exports.optimizedAppearDataId = optimizedAppearDataId; - exports.parseAnimateLayoutArgs = parseAnimateLayoutArgs; - exports.parseCSSVariable = parseCSSVariable; - exports.parseValueFromTransform = parseValueFromTransform; - exports.percent = percent; - exports.pipe = pipe; - exports.pixelsToPercent = pixelsToPercent; - exports.positionalKeys = positionalKeys; - exports.prefersReducedMotion = prefersReducedMotion; - exports.press = press; - exports.progress = progress; - exports.progressPercentage = progressPercentage; - exports.propEffect = propEffect; - exports.propagateDirtyNodes = propagateDirtyNodes; - exports.px = px; - exports.readTransformValue = readTransformValue; - exports.recordStats = recordStats; - exports.removeAxisDelta = removeAxisDelta; - exports.removeAxisTransforms = removeAxisTransforms; - exports.removeBoxTransforms = removeBoxTransforms; - exports.removeItem = removeItem; - exports.removePointDelta = removePointDelta; - exports.renderHTML = renderHTML; - exports.renderSVG = renderSVG; - exports.resize = resize; - exports.resolveElements = resolveElements; - exports.resolveMotionValue = resolveMotionValue; - exports.resolveTransition = resolveTransition; - exports.resolveVariant = resolveVariant; - exports.resolveVariantFromProps = resolveVariantFromProps; - exports.reverseEasing = reverseEasing; - exports.rgbUnit = rgbUnit; - exports.rgba = rgba; - exports.rootProjectionNode = rootProjectionNode; - exports.scale = scale; - exports.scaleCorrectors = scaleCorrectors; - exports.scalePoint = scalePoint; - exports.scrapeHTMLMotionValuesFromProps = scrapeMotionValuesFromProps$1; - exports.scrapeSVGMotionValuesFromProps = scrapeMotionValuesFromProps; - exports.scroll = scroll; - exports.scrollInfo = scrollInfo; - exports.secondsToMilliseconds = secondsToMilliseconds; - exports.setDragLock = setDragLock; - exports.setFeatureDefinitions = setFeatureDefinitions; - exports.setStyle = setStyle; - exports.setTarget = setTarget; - exports.spring = spring; - exports.springValue = springValue; - exports.stagger = stagger; - exports.startWaapiAnimation = startWaapiAnimation; - exports.statsBuffer = statsBuffer; - exports.steps = steps; - exports.styleEffect = styleEffect; - exports.supportedWaapiEasing = supportedWaapiEasing; - exports.supportsBrowserAnimation = supportsBrowserAnimation; - exports.supportsFlags = supportsFlags; - exports.supportsLinearEasing = supportsLinearEasing; - exports.supportsPartialKeyframes = supportsPartialKeyframes; - exports.supportsScrollTimeline = supportsScrollTimeline; - exports.supportsViewTimeline = supportsViewTimeline; - exports.svgEffect = svgEffect; - exports.sync = sync; - exports.testValueType = testValueType; - exports.time = time; - exports.transform = transform; - exports.transformAxis = transformAxis; - exports.transformBox = transformBox; - exports.transformBoxPoints = transformBoxPoints; - exports.transformPropOrder = transformPropOrder; - exports.transformProps = transformProps; - exports.transformValue = transformValue; - exports.transformValueTypes = transformValueTypes; - exports.translateAxis = translateAxis; - exports.updateMotionValuesFromProps = updateMotionValuesFromProps; - exports.variantPriorityOrder = variantPriorityOrder; - exports.variantProps = variantProps; - exports.velocityPerSecond = velocityPerSecond; - exports.vh = vh; - exports.visualElementStore = visualElementStore; - exports.vw = vw; - exports.warnOnce = warnOnce; - exports.wrap = wrap; - -})); diff --git a/node_modules/motion/dist/motion.js b/node_modules/motion/dist/motion.js deleted file mode 100644 index b31abc4..0000000 --- a/node_modules/motion/dist/motion.js +++ /dev/null @@ -1 +0,0 @@ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Motion={})}(this,function(t){"use strict";function e(t,e){-1===t.indexOf(e)&&t.push(e)}function n(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const i=(t,e,n)=>n>e?e:n{},t.invariant=()=>{},"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(t.warning=(t,e,n)=>{t||"undefined"==typeof console||console.warn(s(e,n))},t.invariant=(t,e,n)=>{if(!t)throw new Error(s(e,n))});const o={},r=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),a=t=>"object"==typeof t&&null!==t,l=t=>/^0[^.\s]+$/u.test(t);function c(t){let e;return()=>(void 0===e&&(e=t()),e)}const u=t=>t,h=(...t)=>t.reduce((t,e)=>n=>e(t(n))),d=(t,e,n)=>{const i=e-t;return i?(n-t)/i:1};class p{constructor(){this.subscriptions=[]}add(t){return e(this.subscriptions,t),()=>n(this.subscriptions,t)}notify(t,e,n){const i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](t,e,n);else for(let s=0;s1e3*t,f=t=>t/1e3,y=(t,e)=>e?t*(1e3/e):0,g=new Set;function v(t,e,n){t||g.has(e)||(console.warn(s(e,n)),g.add(e))}const x=(t,e,n)=>{const i=e-t;return((n-t)%i+i)%i+t},w=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function T(t,e,n,i){if(t===e&&n===i)return u;const s=e=>function(t,e,n,i,s){let o,r,a=0;do{r=e+(n-e)/2,o=w(r,i,s)-t,o>0?n=r:e=r}while(Math.abs(o)>1e-7&&++a<12);return r}(e,0,1,t,n);return t=>0===t||1===t?t:w(s(t),e,i)}const b=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,S=t=>e=>1-t(1-e),A=T(.33,1.53,.69,.99),V=S(A),P=b(V),M=t=>t>=1?1:(t*=2)<1?.5*V(t):.5*(2-Math.pow(2,-10*(t-1))),E=t=>1-Math.sin(Math.acos(t)),k=S(E),D=b(E),C=T(.42,0,1,1),B=T(0,0,.58,1),R=T(.42,0,.58,1);const L=t=>Array.isArray(t)&&"number"!=typeof t[0];function j(t,e){return L(t)?t[x(0,t.length,e)]:t}const O=t=>Array.isArray(t)&&"number"==typeof t[0],F={linear:u,easeIn:C,easeInOut:R,easeOut:B,circIn:E,circInOut:D,circOut:k,backIn:V,backInOut:P,backOut:A,anticipate:M},I=e=>{if(O(e)){t.invariant(4===e.length,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[n,i,s,o]=e;return T(n,i,s,o)}return"string"==typeof e?(t.invariant(void 0!==F[e],`Invalid easing type '${e}'`,"invalid-easing-type"),F[e]):e},$=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function N(t,e){let n=!1,i=!0;const s={delta:0,timestamp:0,isProcessing:!1},r=()=>n=!0,a=$.reduce((t,e)=>(t[e]=function(t){let e=new Set,n=new Set,i=!1,s=!1;const o=new WeakSet;let r={delta:0,timestamp:0,isProcessing:!1};function a(e){o.has(e)&&(l.schedule(e),t()),e(r)}const l={schedule:(t,s=!1,r=!1)=>{const a=r&&i?e:n;return s&&o.add(t),a.add(t),t},cancel:t=>{n.delete(t),o.delete(t)},process:t=>{if(r=t,i)return void(s=!0);i=!0;const o=e;e=n,n=o,e.forEach(a),e.clear(),i=!1,s&&(s=!1,l.process(t))}};return l}(r),t),{}),{setup:l,read:c,resolveKeyframes:u,preUpdate:h,update:d,preRender:p,render:m,postRender:f}=a,y=()=>{const r=o.useManualTiming,a=r?s.timestamp:performance.now();n=!1,r||(s.delta=i?1e3/60:Math.max(Math.min(a-s.timestamp,40),1)),s.timestamp=a,s.isProcessing=!0,l.process(s),c.process(s),u.process(s),h.process(s),d.process(s),p.process(s),m.process(s),f.process(s),s.isProcessing=!1,n&&e&&(i=!1,t(y))};return{schedule:$.reduce((e,o)=>{const r=a[o];return e[o]=(e,o=!1,a=!1)=>(n||(n=!0,i=!0,s.isProcessing||t(y)),r.schedule(e,o,a)),e},{}),cancel:t=>{for(let e=0;e<$.length;e++)a[$[e]].cancel(t)},state:s,steps:a}}const{schedule:W,cancel:U,state:z,steps:K}=N("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:u,!0);let Y;function X(){Y=void 0}const G={now:()=>(void 0===Y&&G.set(z.isProcessing||o.useManualTiming?z.timestamp:performance.now()),Y),set:t=>{Y=t,queueMicrotask(X)}},H=t=>e=>"string"==typeof e&&e.startsWith(t),q=H("--"),Z=H("var(--"),_=t=>!!Z(t)&&J.test(t.split("/*")[0].trim()),J=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Q(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const tt={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},et={...tt,transform:t=>i(0,1,t)},nt={...tt,default:1},it=t=>Math.round(1e5*t)/1e5,st=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const ot=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,rt=(t,e)=>n=>Boolean("string"==typeof n&&ot.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),at=(t,e,n)=>i=>{if("string"!=typeof i)return i;const[s,o,r,a]=i.match(st);return{[t]:parseFloat(s),[e]:parseFloat(o),[n]:parseFloat(r),alpha:void 0!==a?parseFloat(a):1}},lt={...tt,transform:t=>Math.round((t=>i(0,255,t))(t))},ct={test:rt("rgb","red"),parse:at("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+lt.transform(t)+", "+lt.transform(e)+", "+lt.transform(n)+", "+it(et.transform(i))+")"};const ut={test:rt("#"),parse:function(t){let e="",n="",i="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),i=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),i=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,i+=i,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:s?parseInt(s,16)/255:1}},transform:ct.transform},ht=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),dt=ht("deg"),pt=ht("%"),mt=ht("px"),ft=ht("vh"),yt=ht("vw"),gt=(()=>({...pt,parse:t=>pt.parse(t)/100,transform:t=>pt.transform(100*t)}))(),vt={test:rt("hsl","hue"),parse:at("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+pt.transform(it(e))+", "+pt.transform(it(n))+", "+it(et.transform(i))+")"},xt={test:t=>ct.test(t)||ut.test(t)||vt.test(t),parse:t=>ct.test(t)?ct.parse(t):vt.test(t)?vt.parse(t):ut.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?ct.transform(t):vt.transform(t),getAnimatableNone:t=>{const e=xt.parse(t);return e.alpha=0,xt.transform(e)}},wt=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const Tt="number",bt="color",St=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function At(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},s=[];let o=0;const r=e.replace(St,t=>(xt.test(t)?(i.color.push(o),s.push(bt),n.push(xt.parse(t))):t.startsWith("var(")?(i.var.push(o),s.push("var"),n.push(t)):(i.number.push(o),s.push(Tt),n.push(parseFloat(t))),++o,"${}")).split("${}");return{values:n,split:r,indexes:i,types:s}}function Vt({split:t,types:e}){const n=t.length;return i=>{let s="";for(let o=0;o{return"number"==typeof t?e?.trim().endsWith("/")?t:0:"number"==typeof(n=t)?0:xt.test(n)?xt.getAnimatableNone(n):n;var n};const Mt={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(st)?.length||0)+(t.match(wt)?.length||0)>0},parse:function(t){return At(t).values},createTransformer:function(t){return Vt(At(t))},getAnimatableNone:function(t){const e=At(t);return Vt(e)(e.values.map((t,n)=>Pt(t,e.split[n])))}};function Et(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function kt({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let s=0,o=0,r=0;if(e/=100){const i=n<.5?n*(1+e):n+e-n*e,a=2*n-i;s=Et(a,i,t+1/3),o=Et(a,i,t),r=Et(a,i,t-1/3)}else s=o=r=n;return{red:Math.round(255*s),green:Math.round(255*o),blue:Math.round(255*r),alpha:i}}function Dt(t,e){return n=>n>0?e:t}const Ct=(t,e,n)=>t+(e-t)*n,Bt=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},Rt=[ut,ct,vt];function Lt(e){const n=(i=e,Rt.find(t=>t.test(i)));var i;if(t.warning(Boolean(n),`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!Boolean(n))return!1;let s=n.parse(e);return n===vt&&(s=kt(s)),s}const jt=(t,e)=>{const n=Lt(t),i=Lt(e);if(!n||!i)return Dt(t,e);const s={...n};return t=>(s.red=Bt(n.red,i.red,t),s.green=Bt(n.green,i.green,t),s.blue=Bt(n.blue,i.blue,t),s.alpha=Ct(n.alpha,i.alpha,t),ct.transform(s))},Ot=new Set(["none","hidden"]);function Ft(t,e){return Ot.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function It(t,e){return n=>Ct(t,e,n)}function $t(t){return"number"==typeof t?It:"string"==typeof t?_(t)?Dt:xt.test(t)?jt:Ut:Array.isArray(t)?Nt:"object"==typeof t?xt.test(t)?jt:Wt:Dt}function Nt(t,e){const n=[...t],i=n.length,s=t.map((t,n)=>$t(t)(t,e[n]));return t=>{for(let e=0;e{for(const e in i)n[e]=i[e](t);return n}}const Ut=(e,n)=>{const i=Mt.createTransformer(n),s=At(e),o=At(n);return s.indexes.var.length===o.indexes.var.length&&s.indexes.color.length===o.indexes.color.length&&s.indexes.number.length>=o.indexes.number.length?Ot.has(e)&&!o.values.length||Ot.has(n)&&!s.values.length?Ft(e,n):h(Nt(function(t,e){const n=[],i={color:0,var:0,number:0};for(let s=0;s{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>W.update(e,t),stop:()=>U(e),now:()=>z.isProcessing?z.timestamp:G.now()}},Yt=(t,e,n=10)=>{let i="";const s=Math.max(Math.round(e/n),2);for(let e=0;e=Xt?1/0:e}function Ht(t,e=100,n){const i=n({...t,keyframes:[0,e]}),s=Math.min(Gt(i),Xt);return{type:"keyframes",ease:t=>i.next(s*t).value/e,duration:f(s)}}const qt=100,Zt=10,_t=1,Jt=0,Qt=800,te=.3,ee=.3,ne={granular:.01,default:2},ie={granular:.005,default:.5},se=.01,oe=10,re=.05,ae=1;function le(t,e){return t*Math.sqrt(1-e*e)}const ce=.001;const ue=["duration","bounce"],he=["stiffness","damping","mass"];function de(t,e){return e.some(e=>void 0!==t[e])}function pe(e){let n={velocity:Jt,stiffness:qt,damping:Zt,mass:_t,isResolvedFromDuration:!1,...e};if(!de(e,he)&&de(e,ue))if(n.velocity=0,e.visualDuration){const t=e.visualDuration,s=2*Math.PI/(1.2*t),o=s*s,r=2*i(.05,1,1-(e.bounce||0))*Math.sqrt(o);n={...n,mass:_t,stiffness:o,damping:r}}else{const s=function({duration:e=Qt,bounce:n=te,velocity:s=Jt,mass:o=_t}){let r,a;t.warning(e<=m(oe),"Spring duration must be 10 seconds or less","spring-duration-limit");let l=1-n;l=i(re,ae,l),e=i(se,oe,f(e)),l<1?(r=t=>{const n=t*l,i=n*e,o=n-s,r=le(t,l),a=Math.exp(-i);return ce-o/r*a},a=t=>{const n=t*l*e,i=n*s+s,o=Math.pow(l,2)*Math.pow(t,2)*e,a=Math.exp(-n),c=le(Math.pow(t,2),l);return(-r(t)+ce>0?-1:1)*((i-o)*a)/c}):(r=t=>Math.exp(-t*e)*((t-s)*e+1)-.001,a=t=>Math.exp(-t*e)*(e*e*(s-t)));const c=function(t,e,n){let i=n;for(let n=1;n<12;n++)i-=t(i)/e(i);return i}(r,a,5/e);if(e=m(e),isNaN(c))return{stiffness:qt,damping:Zt,duration:e};{const t=Math.pow(c,2)*o;return{stiffness:t,damping:2*l*Math.sqrt(o*t),duration:e}}}({...e,velocity:0});n={...n,...s,mass:_t},n.isResolvedFromDuration=!0}return n}function me(t=ee,e=te){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:i,restDelta:s}=n;const o=n.keyframes[0],r=n.keyframes[n.keyframes.length-1],a={done:!1,value:o},{stiffness:l,damping:c,mass:u,duration:h,velocity:d,isResolvedFromDuration:p}=pe({...n,velocity:-f(n.velocity||0)}),y=d||0,g=c/(2*Math.sqrt(l*u)),v=r-o,x=f(Math.sqrt(l/u)),w=Math.abs(v)<5;let T,b,S,A,V,P;if(i||(i=w?ne.granular:ne.default),s||(s=w?ie.granular:ie.default),g<1)S=le(x,g),A=(y+g*x*v)/S,T=t=>{const e=Math.exp(-g*x*t);return r-e*(A*Math.sin(S*t)+v*Math.cos(S*t))},V=g*x*A+v*S,P=g*x*v-A*S,b=t=>Math.exp(-g*x*t)*(V*Math.sin(S*t)+P*Math.cos(S*t));else if(1===g){T=t=>r-Math.exp(-x*t)*(v+(y+x*v)*t);const t=y+x*v;b=e=>Math.exp(-x*e)*(x*t*e-y)}else{const t=x*Math.sqrt(g*g-1);T=e=>{const n=Math.exp(-g*x*e),i=Math.min(t*e,300);return r-n*((y+g*x*v)*Math.sinh(i)+t*v*Math.cosh(i))/t};const e=(y+g*x*v)/t,n=g*x*e-v*t,i=g*x*v-e*t;b=e=>{const s=Math.exp(-g*x*e),o=Math.min(t*e,300);return s*(n*Math.sinh(o)+i*Math.cosh(o))}}const M={calculatedDuration:p&&h||null,velocity:t=>m(b(t)),next:t=>{if(!p&&g<1){const e=Math.exp(-g*x*t),n=Math.sin(S*t),o=Math.cos(S*t),l=r-e*(A*n+v*o),c=m(e*(V*n+P*o));return a.done=Math.abs(c)<=i&&Math.abs(r-l)<=s,a.value=a.done?r:l,a}const e=T(t);if(p)a.done=t>=h;else{const n=m(b(t));a.done=Math.abs(n)<=i&&Math.abs(r-e)<=s}return a.value=a.done?r:e,a},toString:()=>{const t=Math.min(Gt(M),Xt),e=Yt(e=>M.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return M}me.applyToOptions=t=>{const e=Ht(t,100,me);return t.ease=e.ease,t.duration=m(e.duration),t.type="keyframes",t};function fe(t,e,n){const i=Math.max(e-5,0);return y(n-t(i),e-i)}function ye({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:l,restDelta:c=.5,restSpeed:u}){const h=t[0],d={done:!1,value:h},p=t=>void 0===a?l:void 0===l||Math.abs(a-t)-m*Math.exp(-t/i),v=t=>y+g(t),x=t=>{const e=g(t),n=v(t);d.done=Math.abs(e)<=c,d.value=d.done?y:n};let w,T;const b=t=>{var e;(e=d.value,void 0!==a&&el)&&(w=t,T=me({keyframes:[d.value,p(d.value)],velocity:fe(v,t,d.value),damping:s,stiffness:o,restDelta:c,restSpeed:u}))};return b(0),{calculatedDuration:null,next:t=>{let e=!1;return T||void 0!==w||(e=!0,x(t),b(t)),void 0!==w&&t>=w?T.next(t-w):(!e&&x(t),d)}}}function ge(e,n,{clamp:s=!0,ease:r,mixer:a}={}){const l=e.length;if(t.invariant(l===n.length,"Both input and output ranges must be the same length","range-length"),1===l)return()=>n[0];if(2===l&&n[0]===n[1])return()=>n[1];const c=e[0]===e[1];e[0]>e[l-1]&&(e=[...e].reverse(),n=[...n].reverse());const p=function(t,e,n){const i=[],s=n||o.mix||zt,r=t.length-1;for(let n=0;n{if(c&&t1)for(;if(i(e[0],e[l-1],t)):f}function ve(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const s=d(0,e,i);t.push(Ct(n,1,s))}}function xe(t){const e=[0];return ve(e,t.length-1),e}function we(t,e){return t.map(t=>t*e)}function Te(t,e){return t.map(()=>e||R).splice(0,t.length-1)}function be({duration:t=300,keyframes:e,times:n,ease:i="easeInOut"}){const s=L(i)?i.map(I):I(i),o={done:!1,value:e[0]},r=ge(we(n&&n.length===e.length?n:xe(e),t),e,{ease:Array.isArray(s)?s:Te(e,s)});return{calculatedDuration:t,next:e=>(o.value=r(e),o.done=e>=t,o)}}const Se=t=>null!==t;function Ae(t,{repeat:e,repeatType:n="loop"},i,s=1){const o=t.filter(Se),r=s<0||e&&"loop"!==n&&e%2==1?0:o.length-1;return r&&void 0!==i?i:o[r]}const Ve={decay:ye,inertia:ye,tween:be,keyframes:be,spring:me};function Pe(t){"string"==typeof t.type&&(t.type=Ve[t.type])}class Me{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const Ee=t=>t/100;class ke extends Me{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:t}=this.options;t&&t.updatedAt!==G.now()&&this.tick(G.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;Pe(t);const{type:e=be,repeat:n=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=t;let{keyframes:r}=t;const a=e||be;a!==be&&"number"!=typeof r[0]&&(this.mixKeyframes=h(Ee,zt(r[0],r[1])),r=[0,100]);const l=a({...t,keyframes:r});"mirror"===s&&(this.mirroredGenerator=a({...t,keyframes:[...r].reverse(),velocity:-o})),null===l.calculatedDuration&&(l.calculatedDuration=Gt(l));const{calculatedDuration:c}=l;this.calculatedDuration=c,this.resolvedDuration=c+i,this.totalDuration=this.resolvedDuration*(n+1)-i,this.generator=l}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,e=!1){const{generator:n,totalDuration:s,mixKeyframes:o,mirroredGenerator:r,resolvedDuration:a,calculatedDuration:l}=this;if(null===this.startTime)return n.next(0);const{delay:c=0,keyframes:u,repeat:h,repeatType:d,repeatDelay:p,type:m,onUpdate:f,finalKeyframe:y}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?g<0:g>s;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=s);let x,w=this.currentTime,T=n;if(h){const t=Math.min(this.currentTime,s)/a;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,h+1);Boolean(e%2)&&("reverse"===d?(n=1-n,p&&(n-=p/a)):"mirror"===d&&(T=r)),w=i(0,1,n)*a}v?(this.delayState.value=u[0],x=this.delayState):x=T.next(w),o&&!v&&(x.value=o(x.value));let{done:b}=x;v||null===l||(b=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const S=null===this.holdTime&&("finished"===this.state||"running"===this.state&&b);return S&&m!==ye&&(x.value=Ae(u,this.options,y,this.speed)),f&&f(x.value),S&&this.finish(),x}then(t,e){return this.finished.then(t,e)}get duration(){return f(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+f(t)}get time(){return f(this.currentTime)}set time(t){t=m(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);return fe(t=>this.generator.next(t).value,t,this.generator.next(t).value)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;e&&this.driver&&this.updateTime(G.now()),this.playbackSpeed=t,e&&this.driver&&(this.time=f(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=Kt,startTime:e}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),this.options.onPlay?.();const n=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=n):null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime||(this.startTime=e??n),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(G.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function De(t){for(let e=1;e180*t/Math.PI,Be=t=>{const e=Ce(Math.atan2(t[1],t[0]));return Le(e)},Re={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Be,rotateZ:Be,skewX:t=>Ce(Math.atan(t[1])),skewY:t=>Ce(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Le=t=>((t%=360)<0&&(t+=360),t),je=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Oe=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Fe={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:je,scaleY:Oe,scale:t=>(je(t)+Oe(t))/2,rotateX:t=>Le(Ce(Math.atan2(t[6],t[5]))),rotateY:t=>Le(Ce(Math.atan2(-t[2],t[0]))),rotateZ:Be,rotate:Be,skewX:t=>Ce(Math.atan(t[4])),skewY:t=>Ce(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Ie(t){return t.includes("scale")?1:0}function $e(t,e){if(!t||"none"===t)return Ie(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,s;if(n)i=Fe,s=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=Re,s=e}if(!s)return Ie(e);const o=i[e],r=s[1].split(",").map(We);return"function"==typeof o?o(r):r[o]}const Ne=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return $e(n,e)};function We(t){return parseFloat(t.trim())}const Ue=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ze=(()=>new Set([...Ue,"pathRotation"]))(),Ke=t=>t===tt||t===mt,Ye=new Set(["x","y","z"]),Xe=Ue.filter(t=>!Ye.has(t));const Ge={width:({x:t},{paddingLeft:e="0",paddingRight:n="0",boxSizing:i})=>{const s=t.max-t.min;return"border-box"===i?s:s-parseFloat(e)-parseFloat(n)},height:({y:t},{paddingTop:e="0",paddingBottom:n="0",boxSizing:i})=>{const s=t.max-t.min;return"border-box"===i?s:s-parseFloat(e)-parseFloat(n)},top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>$e(e,"x"),y:(t,{transform:e})=>$e(e,"y")};Ge.translateX=Ge.x,Ge.translateY=Ge.y;const He=new Set;let qe=!1,Ze=!1,_e=!1;function Je(){if(Ze){const t=Array.from(He).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),n=new Map;e.forEach(t=>{const e=function(t){const e=[];return Xe.forEach(n=>{const i=t.getValue(n);void 0!==i&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),e}(t);e.length&&(n.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=n.get(t);e&&e.forEach(([e,n])=>{t.getValue(e)?.set(n)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}Ze=!1,qe=!1,He.forEach(t=>t.complete(_e)),He.clear()}function Qe(){He.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Ze=!0)})}function tn(){_e=!0,Qe(),Je(),_e=!1}class en{constructor(t,e,n,i,s,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(He.add(this),qe||(qe=!0,W.read(Qe),W.resolveKeyframes(Je))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:i}=this;if(null===t[0]){const s=i?.get(),o=t[t.length-1];if(void 0!==s)t[0]=s;else if(n&&e){const i=n.readValue(e,o);null!=i&&(t[0]=i)}void 0===t[0]&&(t[0]=o),i&&void 0===s&&i.set(t[0])}De(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),He.delete(this)}cancel(){"scheduled"===this.state&&(He.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}const nn=t=>t.startsWith("--");function sn(t,e,n){nn(e)?t.style.setProperty(e,n):t.style[e]=n}const on={};function rn(t,e){const n=c(t);return()=>on[e]??n()}const an=rn(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),ln=rn(()=>void 0!==window.ViewTimeline,"viewTimeline"),cn=rn(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),un=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,hn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:un([0,.65,.55,1]),circOut:un([.55,0,1,.45]),backIn:un([.31,.01,.66,-.59]),backOut:un([.33,1.53,.69,.99])};function dn(t,e){return t?"function"==typeof t?cn()?Yt(t,e):"ease-out":O(t)?un(t):Array.isArray(t)?t.map(t=>dn(t,e)||hn.easeOut):hn[t]:void 0}function pn(t,e,n,{delay:i=0,duration:s=300,repeat:o=0,repeatType:r="loop",ease:a="easeOut",times:l}={},c=void 0){const u={[e]:n};l&&(u.offset=l);const h=dn(a,s);Array.isArray(h)&&(u.easing=h);const d={delay:i,duration:s,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:o+1,direction:"reverse"===r?"alternate":"normal"};return c&&(d.pseudoElement=c),t.animate(u,d)}function mn(t){return"function"==typeof t&&"applyToOptions"in t}function fn({type:t,...e}){return mn(t)&&cn()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class yn extends Me{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:i,keyframes:s,pseudoElement:o,allowFlatten:r=!1,finalKeyframe:a,onComplete:l}=e;this.isPseudoElement=Boolean(o),this.allowFlatten=r,this.options=e,t.invariant("string"!=typeof e.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const c=fn(e);this.animation=pn(n,i,s,c,o),!1===c.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const t=Ae(s,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(t),sn(n,i,t),this.animation.cancel()}l?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return f(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+f(t)}get time(){return f(Number(this.animation.currentTime)||0)}set time(t){const e=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=m(t),e&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:e,rangeEnd:n,observe:i}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&an()?(this.animation.timeline=t,e&&(this.animation.rangeStart=e),n&&(this.animation.rangeEnd=n),u):i(this)}}const gn={anticipate:M,backInOut:P,circInOut:D};function vn(t){"string"==typeof t.ease&&t.ease in gn&&(t.ease=gn[t.ease])}class xn extends yn{constructor(t){vn(t),Pe(t),super(t),void 0!==t.startTime&&!1!==t.autoplay&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:e,onUpdate:n,onComplete:s,element:o,...r}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);const a=new ke({...r,autoplay:!1}),l=Math.max(10,G.now()-this.startTime),c=i(0,10,l-10),u=a.sample(l).value,{name:h}=this.options;o&&h&&sn(o,h,u),e.setWithVelocity(a.sample(Math.max(0,l-c)).value,u,c),a.stop()}}const wn=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Mt.test(t)&&"0"!==t||t.startsWith("url(")));function Tn(t){t.duration=0,t.type="keyframes"}const bn=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),Sn=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;const An=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),Vn=c(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Pn(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:s,damping:o,type:r,keyframes:a}=t,l=e?.owner?.current;if(!(l instanceof HTMLElement||l instanceof SVGElement))return!1;const{onUpdate:c,transformTemplate:u}=e.owner.getProps();return Vn()&&n&&(bn.has(n)||An.has(n)&&function(t){for(let e=0;e{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=G.now();const h={autoplay:t,delay:e,type:n,repeat:i,repeatDelay:s,repeatType:o,name:a,motionValue:l,element:c,...u},d=c?.KeyframeResolver||en;this.keyframeResolver=new d(r,(t,e,n)=>this.onKeyframesResolved(t,e,h,!n),a,l,c),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,n,i,s){this.keyframeResolver=void 0;const{name:r,type:a,velocity:l,delay:c,isHandoff:h,onUpdate:d}=i;this.resolvedAt=G.now();let p=!0;(function(e,n,i,s){const o=e[0];if(null===o)return!1;if("display"===n||"visibility"===n)return!0;const r=e[e.length-1],a=wn(o,n),l=wn(r,n);return t.warning(a===l,`You are trying to animate ${n} from "${o}" to "${r}". "${a?r:o}" is not an animatable value.`,"value-not-animatable"),!(!a||!l)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:n,...i,keyframes:e},f=p&&!h&&Pn(m),y=m.motionValue?.owner?.current;let g;if(f)try{g=new xn({...m,element:y})}catch{g=new ke(m)}else g=new ke(m);g.finished.then(()=>{this.notifyFinished()}).catch(u),this.pendingTimeline&&(this.stopTimeline=g.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=g}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),tn()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}class En{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;ne.attachTimeline(t));return()=>{e.forEach((t,e)=>{t&&t(),this.animations[e].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return kn(this.animations,"duration")}get iterationDuration(){return kn(this.animations,"iterationDuration")}runAll(t){this.animations.forEach(e=>e[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function kn(t,e){let n=0;for(let i=0;in&&(n=s)}return n}class Dn extends En{then(t,e){return this.finished.finally(t).then(()=>{})}}class Cn extends yn{constructor(t){super(),this.animation=t,t.onfinish=()=>{this.finishedTime=this.time,this.notifyFinished()}}}const Bn=new WeakMap,Rn=(t,e="")=>`${t}:${e}`;function Ln(t){let e=Bn.get(t);return e||(e=new Map,Bn.set(t,e)),e}function jn(t,e,n,i=0,s=1){const o=Array.from(t).sort((t,e)=>t.sortNodePosition(e)).indexOf(e),r=t.size,a=(r-1)*i;return"function"==typeof n?n(o,r):1===s?o*i:a-o*i}const On={current:void 0};class Fn{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=G.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=G.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new p);const n=this.events[t].add(e);return"change"===t?()=>{n(),W.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return On.current&&On.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=G.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return y(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function In(t,e){return new Fn(t,e)}function $n(t,e){if(t?.inherit&&e){const{inherit:n,...i}=t;return{...e,...i}}return t}function Nn(t,e){const n=t?.[e]??t?.default??t;return n!==t?$n(n,t):n}const Wn={type:"spring",stiffness:500,damping:25,restSpeed:10},Un={type:"keyframes",duration:.8},zn={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Kn=(t,{keyframes:e})=>e.length>2?Un:ze.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:Wn:zn,Yn=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function Xn(t){for(const e in t)if(!Yn.has(e))return!0;return!1}const Gn=(t,e,n,i={},s,r)=>a=>{const l=Nn(i,t)||{},c=l.delay||i.delay||0;let{elapsed:u=0}=i;u-=m(c);const h={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...l,delay:-u,onUpdate:t=>{e.set(t),l.onUpdate&&l.onUpdate(t)},onComplete:()=>{a(),l.onComplete&&l.onComplete()},name:t,motionValue:e,element:r?void 0:s};Xn(l)||Object.assign(h,Kn(t,h)),h.duration&&(h.duration=m(h.duration)),h.repeatDelay&&(h.repeatDelay=m(h.repeatDelay)),void 0!==h.from&&(h.keyframes[0]=h.from);let d=!1;if((!1===h.type||0===h.duration&&!h.repeatDelay)&&(Tn(h),0===h.delay&&(d=!0)),(o.instantAnimations||o.skipAnimations||s?.shouldSkipAnimations||l.skipAnimations)&&(d=!0,Tn(h),h.delay=0),h.allowFlatten=!l.type&&!l.ease,d&&!r&&void 0!==e.get()){const t=Ae(h.keyframes,l);if(void 0!==t)return void W.update(()=>{h.onUpdate(t),h.onComplete()})}return l.isSync?new ke(h):new Mn(h)};function Hn(t,e,n,i){const s=1-t;return s*s*e+2*s*t*n+t*t*i}function qn(t,e,n,i,s,o,r){const a=2*(1-t)*(n-e)+2*t*(i-n),l=2*(1-t)*(o-s)+2*t*(r-o);return Math.atan2(l,a)*(180/Math.PI)}function Zn(t,e,n,i,s,o){const r=n-t,a=i-e,l=Math.sqrt(r*r+a*a);if(l>0){const n=s*l;return{x:t+r*o+-a/l*n,y:e+a*o+r/l*n}}return{x:t,y:e}}const _n=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Jn(t){const e=_n.exec(t);if(!e)return[,];const[,n,i,s]=e;return[`--${n??i}`,s]}function Qn(e,n,i=1){t.invariant(i<=4,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[s,o]=Jn(e);if(!s)return;const a=window.getComputedStyle(n).getPropertyValue(s);if(a){const t=a.trim();return r(t)?parseFloat(t):t}return _(o)?Qn(o,n,i+1):o}function ti(t){const e=[{},{}];return t?.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}function ei(t,e,n,i){if("function"==typeof e){const[s,o]=ti(i);e=e(void 0!==n?n:t.custom,s,o)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[s,o]=ti(i);e=e(void 0!==n?n:t.custom,s,o)}return e}function ni(t,e,n){const i=t.getProps();return ei(i,e,void 0!==n?n:i.custom,t)}const ii=new Set(["width","height","top","left","right","bottom",...Ue]),si=t=>Array.isArray(t);function oi(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,In(n))}function ri(t){return si(t)?t[t.length-1]||0:t}function ai(t,e){const n=ni(t,e);let{transitionEnd:i={},transition:s={},...o}=n||{};o={...o,...i};for(const e in o){oi(t,e,ri(o[e]))}}const li=t=>Boolean(t&&t.getVelocity);function ci(t){return Boolean(li(t)&&t.add)}function ui(t,e){const n=t.getValue("willChange");if(ci(n))return n.add(e);if(!n&&o.WillChange){const n=new o.WillChange("auto");t.addValue("willChange",n),n.add(e)}}function hi(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const di="framerAppearId",pi="data-"+hi(di);function mi(t){return t.props[pi]}function fi({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}function yi(t,e,{delay:n=0,transitionOverride:i,type:s}={}){let{transition:o,transitionEnd:r,...a}=e;const l=t.getDefaultTransition();o=o?$n(o,l):l;const c=o?.reduceMotion,u=o?.skipAnimations;i&&(o=i);const h=[],d=s&&t.animationState&&t.animationState.getState()[s],p=o?.path;p&&p.animateVisualElement(t,a,o,n,h);for(const e in a){const i=t.getValue(e,t.latestValues[e]??null),s=a[e];if(void 0===s||d&&fi(d,e))continue;const r={delay:n,...Nn(o||{},e)};u&&(r.skipAnimations=!0);const l=i.get();if(void 0!==l&&!i.isAnimating()&&!Array.isArray(s)&&s===l&&!r.velocity){W.update(()=>i.set(s));continue}let p=!1;if(window.MotionHandoffAnimation){const n=mi(t);if(n){const t=window.MotionHandoffAnimation(n,e,W);null!==t&&(r.startTime=t,p=!0)}}ui(t,e);const m=c??t.shouldReduceMotion;i.start(Gn(e,i,s,m&&ii.has(e)?{type:!1}:r,t,p));const f=i.animation;f&&h.push(f)}if(r){const e=()=>W.update(()=>{r&&ai(t,r)});h.length?Promise.all(h).then(e):e()}return h}function gi(t,e,n={}){const i=ni(t,e,"exit"===n.type?t.presenceContext?.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const o=i?()=>Promise.all(yi(t,i,n)):()=>Promise.resolve(),r=t.variantChildren&&t.variantChildren.size?(i=0)=>{const{delayChildren:o=0,staggerChildren:r,staggerDirection:a}=s;return function(t,e,n=0,i=0,s=0,o=1,r){const a=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),a.push(gi(l,e,{...r,delay:n+("function"==typeof i?0:i)+jn(t.variantChildren,l,i,s,o)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(a)}(t,e,i,o,r,a,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[t,e]="beforeChildren"===a?[o,r]:[r,o];return t().then(()=>e())}return Promise.all([o(),r(n.delay)])}function vi(t,e,n={}){let i;if(t.notify("AnimationStart",e),Array.isArray(e)){const s=e.map(e=>gi(t,e,n));i=Promise.all(s)}else if("string"==typeof e)i=gi(t,e,n);else{const s="function"==typeof e?ni(t,e,n.custom):e;i=Promise.all(yi(t,s,n))}return i.then(()=>{t.notify("AnimationComplete",e)})}const xi=t=>e=>e.test(t),wi=[tt,mt,pt,dt,yt,ft,{test:t=>"auto"===t,parse:t=>t}],Ti=t=>wi.find(xi(t));function bi(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||l(t))}const Si=new Set(["brightness","contrast","saturate","opacity"]);function Ai(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(st)||[];if(!i)return t;const s=n.replace(i,"");let o=Si.has(e)?1:0;return i!==n&&(o*=100),e+"("+o+s+")"}const Vi=/\b([a-z-]*)\(.*?\)/gu,Pi={...Mt,getAnimatableNone:t=>{const e=t.match(Vi);return e?e.map(Ai).join(" "):t}},Mi={...Mt,getAnimatableNone:t=>{const e=Mt.parse(t);return Mt.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},Ei={...tt,transform:Math.round},ki={rotate:dt,pathRotation:dt,rotateX:dt,rotateY:dt,rotateZ:dt,scale:nt,scaleX:nt,scaleY:nt,scaleZ:nt,skew:dt,skewX:dt,skewY:dt,distance:mt,translateX:mt,translateY:mt,translateZ:mt,x:mt,y:mt,z:mt,perspective:mt,transformPerspective:mt,opacity:et,originX:gt,originY:gt,originZ:mt},Di={borderWidth:mt,borderTopWidth:mt,borderRightWidth:mt,borderBottomWidth:mt,borderLeftWidth:mt,borderRadius:mt,borderTopLeftRadius:mt,borderTopRightRadius:mt,borderBottomRightRadius:mt,borderBottomLeftRadius:mt,width:mt,maxWidth:mt,height:mt,maxHeight:mt,top:mt,right:mt,bottom:mt,left:mt,inset:mt,insetBlock:mt,insetBlockStart:mt,insetBlockEnd:mt,insetInline:mt,insetInlineStart:mt,insetInlineEnd:mt,padding:mt,paddingTop:mt,paddingRight:mt,paddingBottom:mt,paddingLeft:mt,paddingBlock:mt,paddingBlockStart:mt,paddingBlockEnd:mt,paddingInline:mt,paddingInlineStart:mt,paddingInlineEnd:mt,margin:mt,marginTop:mt,marginRight:mt,marginBottom:mt,marginLeft:mt,marginBlock:mt,marginBlockStart:mt,marginBlockEnd:mt,marginInline:mt,marginInlineStart:mt,marginInlineEnd:mt,fontSize:mt,backgroundPositionX:mt,backgroundPositionY:mt,...ki,zIndex:Ei,fillOpacity:et,strokeOpacity:et,numOctaves:Ei},Ci={...Di,color:xt,backgroundColor:xt,outlineColor:xt,fill:xt,stroke:xt,borderColor:xt,borderTopColor:xt,borderRightColor:xt,borderBottomColor:xt,borderLeftColor:xt,filter:Pi,WebkitFilter:Pi,mask:Mi,WebkitMask:Mi},Bi=t=>Ci[t],Ri=new Set([Pi,Mi]);function Li(t,e){let n=Bi(t);return Ri.has(n)||(n=Mt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const ji=new Set(["auto","none","0"]);class Oi extends en{constructor(t,e,n,i,s){super(t,e,n,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n{t.getValue(e).set(n)}),this.resolveNoneKeyframes()}}const Fi=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"],Ii=new Set(["borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius",...Fi,"width","maxWidth","height","maxHeight","top","right","bottom","left","inset","insetBlock","insetBlockStart","insetBlockEnd","insetInline","insetInlineStart","insetInlineEnd","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingBlock","paddingBlockStart","paddingBlockEnd","paddingInline","paddingInlineStart","paddingInlineEnd","margin","marginTop","marginRight","marginBottom","marginLeft","marginBlock","marginBlockStart","marginBlockEnd","marginInline","marginInlineStart","marginInlineEnd","fontSize","backgroundPositionX","backgroundPositionY"]);function $i(t,e){for(let n=0;n{try{document.createElement("div").animate({opacity:[1]})}catch(t){return!1}return!0});function Wi(t,e,n){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){let i=document;e&&(i=e.current);const s=n?.[t]??i.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t).filter(t=>null!=t)}function Ui(t){return(e,n)=>{const i=Wi(e),s=[];for(const e of i){const i=t(e,n);s.push(i)}return()=>{for(const t of s)t()}}}const zi=(t,e)=>e&&"number"==typeof t?e.transform(t):t;class Ki{constructor(){this.latest={},this.values=new Map}set(t,e,n,i,s=!0){const o=this.values.get(t);o&&o.onRemove();const r=()=>{const i=e.get();this.latest[t]=s?zi(i,Di[t]):i,n&&W.render(n)};r();const a=e.on("change",r);i&&e.addDependent(i);const l=()=>{a(),n&&U(n),this.values.delete(t),i&&e.removeDependent(i)};return this.values.set(t,{value:e,onRemove:l}),l}get(t){return this.values.get(t)?.value}}function Yi(t){const e=new WeakMap;return(n,i)=>{const s=e.get(n)??new Ki;e.set(n,s);const o=[];for(const e in i){const r=i[e],a=t(n,s,e,r);o.push(a)}return()=>{for(const t of o)t()}}}const Xi=(t,e,n,i)=>{const s=function(t,e){if(!(e in t))return!1;const n=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(t),e)||Object.getOwnPropertyDescriptor(t,e);return n&&"function"==typeof n.set}(t,n),o=s?n:n.startsWith("data")||n.startsWith("aria")?hi(n):n,r=s?()=>{t[o]=e.latest[n]}:()=>{const i=e.latest[n];null==i?t.removeAttribute(o):t.setAttribute(o,String(i))};return e.set(n,i,r)},Gi=Ui(Yi(Xi)),Hi=Yi((t,e,n,i)=>e.set(n,i,()=>{t[n]=e.latest[n]},void 0,!1));function qi(t){return a(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const Zi={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"};const _i=new Set(["originX","originY","originZ"]),Ji=(t,e,n,i)=>{let s,o;return ze.has(n)?(e.get("transform")||(qi(t)||e.get("transformBox")||Ji(t,e,"transformBox",new Fn("fill-box")),e.set("transform",new Fn("none"),()=>{t.style.transform=function(t){let e="",n=!0;for(let i=0;i{const n=e.latest.originX??"50%",i=e.latest.originY??"50%",s=e.latest.originZ??0;t.style.transformOrigin=`${n} ${i} ${s}`}),o=e.get("transformOrigin")):s=nn(n)?()=>{t.style.setProperty(n,e.latest[n])}:()=>{t.style[n]=e.latest[n]},e.set(n,i,s,o)},Qi=Ui(Yi(Ji));const ts=Ui(Yi((t,e,n,i)=>{if(n.startsWith("path"))return function(t,e,n,i){return W.render(()=>t.setAttribute("pathLength","1")),"pathOffset"===n?e.set(n,i,()=>{const i=e.latest[n];t.setAttribute("stroke-dashoffset",""+-i)}):(e.get("stroke-dasharray")||e.set("stroke-dasharray",new Fn("1 1"),()=>{const{pathLength:n=1,pathSpacing:i}=e.latest;t.setAttribute("stroke-dasharray",`${n} ${i??1-Number(n)}`)}),e.set(n,i,void 0,e.get("stroke-dasharray")))}(t,e,n,i);if(n.startsWith("attr"))return Xi(t,e,function(t){return t.replace(/^attr([A-Z])/,(t,e)=>e.toLowerCase())}(n),i);return(n in t.style?Ji:Xi)(t,e,n,i)}));const{schedule:es,cancel:ns}=N(queueMicrotask,!1),is={x:!1,y:!1};function ss(){return is.x||is.y}function os(t,e){const n=Wi(t),i=new AbortController;return[n,{passive:!0,...e,signal:i.signal},()=>i.abort()]}const rs=(t,e)=>!!e&&(t===e||rs(t,e.parentElement)),as=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,ls=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function cs(t){return ls.has(t.tagName)||!0===t.isContentEditable}const us=new Set(["INPUT","SELECT","TEXTAREA"]);const hs=new WeakSet;function ds(t){return e=>{"Enter"===e.key&&t(e)}}function ps(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function ms(t){return as(t)&&!ss()}const fs=new WeakSet;function ys(t,e){const n=window.getComputedStyle(t);return nn(e)?n.getPropertyValue(e):n[e]}function gs(t){return a(t)&&"ownerSVGElement"in t}const vs=new WeakMap;let xs;const ws=(t,e,n)=>(i,s)=>s&&s[0]?s[0][t+"Size"]:gs(i)&&"getBBox"in i?i.getBBox()[e]:i[n],Ts=ws("inline","width","offsetWidth"),bs=ws("block","height","offsetHeight");function Ss({target:t,borderBoxSize:e}){vs.get(t)?.forEach(n=>{n(t,{get width(){return Ts(t,e)},get height(){return bs(t,e)}})})}function As(t){t.forEach(Ss)}function Vs(t,e){xs||"undefined"!=typeof ResizeObserver&&(xs=new ResizeObserver(As));const n=Wi(t);return n.forEach(t=>{let n=vs.get(t);n||(n=new Set,vs.set(t,n)),n.add(e),xs?.observe(t)}),()=>{n.forEach(t=>{const n=vs.get(t);n?.delete(e),n?.size||xs?.unobserve(t)})}}const Ps=new Set;let Ms;function Es(t){return Ps.add(t),Ms||(Ms=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};Ps.forEach(e=>e(t))},window.addEventListener("resize",Ms)),()=>{Ps.delete(t),Ps.size||"function"!=typeof Ms||(window.removeEventListener("resize",Ms),Ms=void 0)}}function ks(t,e){return"function"==typeof t?Es(t):Vs(t,e)}function Ds(t,e){let n;const i=()=>{const{currentTime:i}=e,s=(null===i?0:i.value)/100;n!==s&&t(s),n=s};return W.preUpdate(i,!0),()=>U(i)}const Cs={value:null,addProjectionMetrics:null};function Bs(t){return gs(t)&&"svg"===t.tagName}function Rs(t,e){if("first"===t)return 0;{const n=e-1;return"last"===t?n:n/2}}function Ls(...t){const e=!Array.isArray(t[0]),n=e?0:-1,i=t[0+n],s=ge(t[1+n],t[2+n],t[3+n]);return e?s(i):s}function js(t,e){const n=In(li(t)?t.get():t);return Os(n,t,e),n}function Os(t,e,n={}){const i=t.get();let s,o=null,r=i;const a="string"==typeof i?i.replace(/[\d.-]/g,""):void 0,l=()=>{o&&(o.stop(),o=null),t.animation=void 0},c=()=>{(()=>{const e=Is(t.get()),i=Is(r);if(e===i)return void l();const a=o?o.getGeneratorVelocity():t.getVelocity();l(),o=new ke({keyframes:[e,i],velocity:a,type:"spring",restDelta:.001,restSpeed:.01,...n,onUpdate:s})})(),t.animation=o??void 0,t.events.animationStart?.notify(),o?.then(()=>{t.animation=void 0,t.events.animationComplete?.notify()})};if(t.attach((t,e)=>{r=t,s=t=>e(Fs(t,a)),W.postRender(c)},l),li(e)){let i=!0===n.skipInitialAnimation;const s=e.on("change",e=>{i?(i=!1,t.jump(Fs(e,a),!1)):t.set(Fs(e,a))}),o=t.on("destroy",s);return()=>{s(),o()}}return l}function Fs(t,e){return e?t+e:t}function Is(t){return"number"==typeof t?t:parseFloat(t)}function $s(t){const e=[];On.current=e;const n=t();On.current=void 0;const i=In(n);return function(t,e,n){const i=()=>e.set(n()),s=()=>W.preRender(i,!1,!0),o=t.map(t=>t.on("change",s));e.on("destroy",()=>{o.forEach(t=>t()),U(i)})}(e,i,t),i}const Ns=[...wi,xt,Mt],Ws=t=>Ns.find(xi(t));let Us=0;const zs=()=>"motion-view-"+Us++;function Ks(t,e,n){e&&(t.style?.setProperty("view-transition-class",e),n.push(t))}function Ys(t,e,n,i,s){if(n&&(t.style?.setProperty("view-transition-group",n),i.push(t),"none"!==n&&s)){const n=getComputedStyle(t);"visible"===n.overflowX&&"visible"===n.overflowY||s.add(e)}}function Xs(t,e,n,i,s,o=[],r,a=[],l){const c=Wi(t);if(i)return c.map((t,c)=>{const u=e.get(t);if(u)return u;const h=i[c]??zs();return t.style?.setProperty("view-transition-name",h),n.push(t),e.set(t,h),Ks(t,s,o),Ys(t,h,r,a,l),h});const u=c.map(t=>e.has(t)?void 0:getComputedStyle(t).getPropertyValue("view-transition-name"));return c.map((t,i)=>{const c=e.get(t);if(c)return c;const h=u[i];let d;return h&&"none"!==h&&"auto"!==h&&"match-element"!==h&&!(t=>t.startsWith("motion-view-"))(h)?d=h:(d=zs(),t.style?.setProperty("view-transition-name",d),n.push(t)),e.set(t,d),Ks(t,s,o),Ys(t,d,r,a,l),d})}function Gs(t){return"layout"===t?"group":"enter"===t||"new"===t?"new":"old"}let Hs={},qs=null;const Zs=(t,e)=>{Hs[t]=e},_s=()=>{qs||(qs=document.createElement("style"),qs.id="motion-view");let t="";for(const e in Hs){const n=Hs[e];t+=`${e} {\n`;for(const[e,i]of Object.entries(n))t+=` ${e}: ${i};\n`;t+="}\n"}qs.textContent=t,document.head.appendChild(qs),Hs={}},Js=()=>{qs&&qs.parentElement&&qs.parentElement.removeChild(qs)};function Qs(t){const e=t.match(/::view-transition-(old|new|group-children|group|image-pair)\((.*?)\)/);return e?{layer:e[2],type:e[1]}:null}function to(){return document.getAnimations().filter(t=>{const{effect:e}=t;return!!e&&e.target===document.documentElement&&e.pseudoElement?.startsWith("::view-transition")})}const eo=["layout","enter","exit","new","old"],no=t=>t.split(" ").every(t=>0===parseFloat(t)),io={group:["layout"],new:["new","enter"],old:["old","exit"]},so={new:{opacity:0,scale:.85},old:{opacity:1,scale:1}};function oo(t){const{update:e,targets:n,resolveDefs:i,cropOverride:s,pairs:o,classNames:r,flatGroups:a,options:l}=t;if(!document.startViewTransition)return(async()=>(await e(),new En([])))();const c=new Map,u=[],h=[],d=[],p=new Set,f=new Map,y=new Set,g=new Map,x=new Map,w=new Map,T=new Map,b=t=>{n.forEach((e,n)=>{const l=r.get(n),m="root"!==n&&i.has(n)?a.has(n)?"none":"contain":void 0;let y;if("root"!==n&&i.has(n))if(o.has(n))if("old"===t)T.set(n,Wi(n)),y=Xs(n,c,u,void 0,l,h,m,d,p),w.set(n,y);else{for(const t of T.get(n)??[])t.style?.removeProperty("view-transition-name"),c.delete(t);y=Xs(o.get(n),c,u,w.get(n),l,h,m,d,p)}else y=Xs(n,c,u,void 0,l,h,m,d,p);else y=[n];const v=s.get(n);y.forEach((n,i)=>{const s=f.get(n);f.set(n,s&&s!==e?{...s,...e}:e),void 0!==v&&g.set(n,v);const o=x.get(n)??{};o[t]=[i,y.length],x.set(n,o)})})},S=(t,e)=>{const n=x.get(t);return("old"===e?n?.old:"new"===e?n?.new:n?.new??n?.old)??[-1,1]},A=(t,e,n,i,s)=>{const o=ro(Nn(l,n),Nn(function(t,e){for(const n of io[e]??[]){const e=t?.[n]?.options;if(e)return e}}(t,e)??{},n));return"function"==typeof o.delay&&(o.delay=o.delay(i,s)),o},V=t=>{const[e,n]=S(t,"group"),i=A(f.get(t),"group","layout",-1===e?0:e,n);i.duration&&(i.duration=m(i.duration));const{delay:s=0,duration:o,ease:r}=fn(i);return{delay:m(s),duration:o,ease:r}},P=new Map,M=t=>c.forEach((e,n)=>{const i=n,s=i.getBoundingClientRect?.();if(s&&s.height){const n=getComputedStyle(i),o={};for(const t of Fi)o[t]=n[t];const r=P.get(e)??{};r[t]={width:s.width,height:s.height,radii:o},P.set(e,r)}}),E=t=>{const e=P.get(t);return!!(e?.old&&e?.new&&e.old.height&&e.new.height)&&Math.abs(e.old.width/e.old.height-e.new.width/e.new.height)>.2},k=()=>{(function(t,e){return e.has(t)&&Object.keys(e.get(t)).length>0})("root",n)||Zs(":root",{"view-transition-name":"none"}),Zs("::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)",{"animation-timing-function":"linear !important"}),y.forEach(t=>{Zs(`::view-transition-group(${t})`,{overflow:"clip"}),Zs(`::view-transition-old(${t}), ::view-transition-new(${t})`,{width:"100%",height:"100%","object-fit":"cover"})}),p.forEach(t=>{Zs(`::view-transition-group-children(${t})`,{overflow:"clip"})}),_s()},D=()=>{!function(t,e=[],n=[]){for(const e of t)e.style?.removeProperty("view-transition-name");for(const t of e)t.style?.removeProperty("view-transition-class");for(const t of n)t.style?.removeProperty("view-transition-group")}(u,h,d),Js()},C=async()=>{await e(),b("new"),M("new"),(()=>{y.clear();for(const t of x.keys())"root"!==t&&(g.get(t)??E(t))&&y.add(t)})(),k()};let B;try{b("old"),M("old"),k(),B=document.startViewTransition(C)}catch(t){return D(),Promise.reject(t)}return B.finished.finally(D),new Promise((t,e)=>{B.ready.then(()=>{const e=to(),n=[],i=new Set,s=new Set;f.forEach((t,e)=>{const o=x.get(e),r=!!o?.new&&!o?.old,a=!!o?.old&&!o?.new;for(const o of eo){if(!t[o])continue;if("enter"===o&&!r)continue;if("exit"===o&&!a)continue;const c=Gs(o),[u,h]=S(e,c);if(-1===u)continue;const{keyframes:d,options:p}=t[o];for(let[f,y]of Object.entries(d)){if(null==y)continue;if("x"===f||"y"===f){v(!1,`animateView() animates view-transition layers with CSS properties; the "${f}" shorthand has no effect - use transform, e.g. { transform: "translateX(40px)" }.`);continue}if("new"===o&&r&&null!=t.enter?.keyframes[f])continue;if("old"===o&&a&&null!=t.exit?.keyframes[f])continue;const d=ro(Nn(l,f),Nn(p,f));if(!Array.isArray(y)){const e="enter"===o?t.exit?.keyframes[f]:void 0,n="opacity"===f||("new"===c?r:a),i=null!=e?Array.isArray(e)?e[e.length-1]:e:n?so[c]?.[f]:void 0;void 0!==i&&(y=[i,y])}"function"==typeof d.delay&&(d.delay=d.delay(u,h)),d.duration&&(d.duration=m(d.duration)),d.delay&&(d.delay=m(d.delay)),n.push(new yn({...d,element:document.documentElement,name:f,pseudoElement:`::view-transition-${c}(${e})`,keyframes:y})),i.add(`${e}:${c}`),"opacity"===f&&s.add(`${e}:${c}`)}}});for(const t of e){if("finished"===t.playState)continue;const{effect:e}=t;if(!(e&&e instanceof KeyframeEffect))continue;const{pseudoElement:o}=e;if(!o)continue;const r=Qs(o);if(!r)continue;const a=f.get(r.layer);if(i.has(`${r.layer}:${r.type}`)){s.has(`${r.layer}:new`)&&s.has(`${r.layer}:old`)&&e.getKeyframes().some(t=>t.mixBlendMode)?n.push(new Cn(t)):t.cancel();continue}const l="old"===r.type?"new":"new"===r.type?"old":void 0;if(l&&i.has(`${r.layer}:${l}`)&&!s.has(`${r.layer}:${l}`)){t.cancel();continue}const c=x.get(r.layer),u=!("old"!==r.type&&"new"!==r.type||!c?.old||!c?.new);let h;if(r.type.startsWith("group")){const{delay:t,duration:e,ease:n}=V(r.layer);h={delay:t,duration:e,easing:dn(n,e)}}else{const t=u?"group":r.type,[e,n]=S(r.layer,t);let i=A(a,t,"group"===t?"layout":"",-1===e?0:e,n);const s=i.visualDuration;i.duration&&(i.duration=m(i.duration)),i=fn(i),h={delay:m(i.delay??0),duration:u&&void 0!==s?m(s):i.duration,easing:u?"linear":dn(i.ease,i.duration)}}e.updateTiming(h),n.push(new Cn(t))}P.forEach((t,e)=>{if(!y.has(e))return;const{delay:i,duration:s,ease:o}=V(e);for(const r of Fi){const a=t.old?.radii[r]||t.new?.radii[r]||"0px",l=t.new?.radii[r]||t.old?.radii[r]||"0px";no(a)&&no(l)||n.push(new yn({element:document.documentElement,name:r,pseudoElement:`::view-transition-group(${e})`,keyframes:[a,l],delay:i,duration:s,ease:o}))}}),t(new En(n))}).catch(()=>B.updateCallbackDone.then(()=>t(new En([])),e))})}function ro(t,e){const n={...t,...e};return void 0!==e.duration&&(void 0===e.visualDuration&&delete n.visualDuration,void 0===e.type&&delete n.type),n}let ao=[],lo=null;function co(){lo=null;const[t]=ao;var e;t&&(n(ao,e=t),lo=e,oo(e).then(t=>(e.notifyReady(t),t.finished)).catch(t=>e.notifyReject(t)).finally(co))}function uo(){for(let t=ao.length-1;t>=0;t--){const e=ao[t],{interrupt:n}=e.options;if("immediate"===n){const n=ao.slice(0,t+1).map(t=>t.update),i=ao.slice(t+1);e.update=()=>{n.forEach(t=>t())},ao=[e,...i];break}}lo&&"immediate"!==ao[0]?.options.interrupt||co()}class ho{constructor(t,e={}){var n;this.currentSubject="root",this.targets=new Map,this.resolveDefs=new Set,this.cropOverride=new Map,this.pairs=new Map,this.classNames=new Map,this.flatGroups=new Set,this.notifyReady=u,this.notifyReject=u,this.readyPromise=new Promise((t,e)=>{this.notifyReady=t,this.notifyReject=e}),this.update=t,this.options={interrupt:"wait",...e},this.readyPromise.catch(u),n=this,ao.push(n),es.render(uo)}add(t,e){return this.currentSubject=t,this.resolveDefs.add(t),void 0!==e&&this.pairs.set(t,e),this.targets.has(t)||this.targets.set(t,{}),this}crop(t=!0){return this.cropOverride.set(this.currentSubject,t),this}group(t=!0){return t?this.flatGroups.delete(this.currentSubject):this.flatGroups.add(this.currentSubject),this}class(t){return this.classNames.set(this.currentSubject,t),this}layout(t={}){return this.updateTarget("layout",{},t),this}enter(t,e){return this.updateTarget("enter",t,e),this}exit(t,e){return this.updateTarget("exit",t,e),this}new(t,e){return this.updateTarget("new",t,e),this}old(t,e){return this.updateTarget("old",t,e),this}updateTarget(t,e,n={}){const{currentSubject:i,targets:s}=this;s.has(i)||s.set(i,{});s.get(i)[t]={keyframes:e,options:n}}then(t,e){return this.readyPromise.then(t,e)}}const po=()=>({translate:0,scale:1,origin:0,originPoint:0}),mo=()=>({x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}),fo=()=>({min:0,max:0}),yo=()=>({x:{min:0,max:0},y:{min:0,max:0}}),go=new WeakMap;function vo(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function xo(t){return"string"==typeof t||Array.isArray(t)}const wo=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],To=["initial",...wo];function bo(t){return vo(t.animate)||To.some(e=>xo(t[e]))}function So(t){return Boolean(bo(t)||t.variants)}function Ao(t,e,n){for(const i in e){const s=e[i],o=n[i];if(li(s))t.addValue(i,s);else if(li(o))t.addValue(i,In(s,{owner:t}));else if(o!==s)if(t.hasValue(i)){const e=t.getValue(i);!0===e.liveStyle?e.jump(s):e.hasAnimated||e.set(s)}else{const e=t.getStaticValue(i);t.addValue(i,In(void 0!==e?e:s,{owner:t}))}}for(const i in n)void 0===e[i]&&t.removeValue(i);return e}const Vo={current:null},Po={current:!1},Mo="undefined"!=typeof window;function Eo(){if(Po.current=!0,Mo)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Vo.current=t.matches;t.addEventListener("change",e),e()}else Vo.current=!1}const ko=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Do={};class Co{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:i,skipAnimations:s,blockInitialAnimation:o,visualState:r},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=en,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const t=G.now();this.renderScheduledAtthis.bindToMotionValue(e,t)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(Po.current||Eo(),this.shouldReduceMotion=Vo.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),U(this.notifyUpdate),U(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,e){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),e.accelerate&&bn.has(t)&&this.current instanceof HTMLElement){const{factory:n,keyframes:i,times:s,ease:o,duration:r}=e.accelerate,a=new yn({element:this.current,name:t,keyframes:i,times:s,ease:o,duration:m(r)}),l=n(a);return void this.valueSubscriptions.set(t,()=>{l(),a.cancel()})}const n=ze.has(t);n&&this.onBindTransform&&this.onBindTransform();const i=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&W.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let s;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{i(),s&&s()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in Do){const e=Do[t];if(!e)continue;const{isEnabled:n,Feature:i}=e;if(!this.features[t]&&i&&n(this.props)&&(this.features[t]=new i(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;ee.variantChildren.delete(t)}addValue(t,e){const n=this.values.get(t);e!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=In(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,e){let n=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];return null!=n&&("string"==typeof n&&(r(n)||l(n))?n=parseFloat(n):!Ws(n)&&Mt.test(e)&&(n=Li(t,e)),this.setBaseTarget(t,li(n)?n.get():n)),li(n)?n.get():n}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let n;if("string"==typeof e||"object"==typeof e){const i=ei(this.props,e,this.presenceContext?.custom);i&&(n=i[t])}if(e&&void 0!==n)return n;const i=this.getBaseTargetFromProps(this.props,t);return void 0===i||li(i)?void 0!==this.initialValues[t]&&void 0===n?void 0:this.baseTarget[t]:i}on(t,e){return this.events[t]||(this.events[t]=new p),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){es.render(this.render)}}class Bo extends Co{constructor(){super(...arguments),this.KeyframeResolver=Oi}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){const n=t.style;return n?n[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;li(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}function Ro({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function Lo(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),i=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}function jo(t){return void 0===t||1===t}function Oo({scale:t,scaleX:e,scaleY:n}){return!jo(t)||!jo(e)||!jo(n)}function Fo(t){return Oo(t)||Io(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Io(t){return $o(t.x)||$o(t.y)}function $o(t){return t&&"0%"!==t}function No(t,e,n){return n+e*(t-n)}function Wo(t,e,n,i,s){return void 0!==s&&(t=No(t,s,i)),No(t,n,i)+e}function Uo(t,e=0,n=1,i,s){t.min=Wo(t.min,e,n,i,s),t.max=Wo(t.max,e,n,i,s)}function zo(t,{x:e,y:n}){Uo(t.x,e.translate,e.scale,e.originPoint),Uo(t.y,n.translate,n.scale,n.originPoint)}const Ko=.999999999999,Yo=1.0000000000001;function Xo(t,e,n,i=!1){const s=n.length;if(!s)return;let o,r;e.x=e.y=1;for(let a=0;aKo&&(e.x=1),e.yKo&&(e.y=1)}function Go(t,e){t.min+=e,t.max+=e}function Ho(t,e,n,i,s=.5){Uo(t,e,n,Ct(t.min,t.max,s),i)}function qo(t,e){return"string"==typeof t?parseFloat(t)/100*(e.max-e.min):t}function Zo(t,e,n){const i=n??t;Ho(t.x,qo(e.x,i.x),e.scaleX,e.scale,e.originX),Ho(t.y,qo(e.y,i.y),e.scaleY,e.scale,e.originY)}function _o(t,e){return Ro(Lo(t.getBoundingClientRect(),e))}const Jo={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Qo=Ue.length;function tr(t,e,n){let i="",s=!0;for(let o=0;o{if(!e.target)return t;if("string"==typeof t){if(!mt.test(t))return t;t=parseFloat(t)}return`${ir(t,e.target.x)}% ${ir(t,e.target.y)}%`}},or={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,s=Mt.parse(t);if(s.length>5)return i;const o=Mt.createTransformer(t),r="number"!=typeof s[0]?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;s[0+r]/=a,s[1+r]/=l;const c=Ct(a,l,.5);return"number"==typeof s[2+r]&&(s[2+r]/=c),"number"==typeof s[3+r]&&(s[3+r]/=c),o(s)}},rr={borderRadius:{...sr,applyTo:[...Fi]},borderTopLeftRadius:sr,borderTopRightRadius:sr,borderBottomLeftRadius:sr,borderBottomRightRadius:sr,boxShadow:or};function ar(t,{layout:e,layoutId:n}){return ze.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!rr[t]||"opacity"===t)}function lr(t,e,n){const i=t.style,s=e?.style,o={};if(!i)return o;for(const e in i)(li(i[e])||s&&li(s[e])||ar(e,t)||void 0!==n?.getValue(e)?.liveStyle)&&(o[e]=i[e]);return o}class cr extends Bo{constructor(){super(...arguments),this.type="html",this.renderInstance=nr}mount(e){t.invariant(Boolean(e.style),"motion.create() components must forward their ref to a HTML or SVG element","custom-component-ref"),super.mount(e)}readValueFromInstance(t,e){if(ze.has(e))return this.projection?.isProjecting?Ie(e):Ne(t,e);{const i=(n=t,window.getComputedStyle(n)),s=(q(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof s?s.trim():s}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return _o(t,e)}build(t,e,n){er(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return lr(t,e,n)}}class ur extends Co{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,e){if(function(t,e){return t in e}(e,t)){const n=t[e];if("string"==typeof n||"number"==typeof n)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(t,e){delete e.output[t]}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}build(t,e){Object.assign(t.output,e)}renderInstance(t,{output:e}){Object.assign(t,e)}sortInstanceNodePosition(){return 0}}const hr={offset:"stroke-dashoffset",array:"stroke-dasharray"},dr={offset:"strokeDashoffset",array:"strokeDasharray"};function pr(t,e,n=1,i=0,s=!0){t.pathLength=1;const o=s?hr:dr;t[o.offset]=""+-i,t[o.array]=`${e} ${n}`}const mr=["transform","opacity","offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function fr(t,{attrX:e,attrY:n,attrScale:i,pathLength:s,pathSpacing:o=1,pathOffset:r=0,...a},l,c,u){if(er(t,a,c),l)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:h,style:d}=t;for(const t of mr)void 0!==h[t]&&(d[t]=h[t],delete h[t]);(d.transform||h.transformOrigin)&&(d.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),d.transform&&(d.transformBox=u?.transformBox??"fill-box",delete h.transformBox),void 0!==e&&(h.x=e),void 0!==n&&(h.y=n),void 0!==i&&(h.scale=i),void 0!==s&&pr(h,s,o,r,!1)}const yr=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),gr=t=>"string"==typeof t&&"svg"===t.toLowerCase();function vr(t,e,n,i){nr(t,e,void 0,i);for(const n in e.attrs)t.setAttribute(yr.has(n)?n:hi(n),e.attrs[n])}function xr(t,e,n){const i=lr(t,e,n);for(const n in t)if(li(t[n])||li(e[n])){i[-1!==Ue.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]}return i}class wr extends Bo{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=yo}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(ze.has(e)){const t=Bi(e);return t&&t.default||0}if(mr.includes(e)){const n=getComputedStyle(t)[e];if("string"==typeof n&&n)return n.trim()}return e=yr.has(e)?e:hi(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return xr(t,e,n)}build(t,e,n){fr(t,e,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,e,n,i){vr(t,e,0,i)}mount(t){this.isSVGTag=gr(t.tagName),super.mount(t)}}const Tr=To.length;function br(t){if(!t)return;if(!t.isControllingVariants){const e=t.parent&&br(t.parent)||{};return void 0!==t.props.initial&&(e.initial=t.props.initial),e}const e={};for(let n=0;n=.9999&&t.scale<=1.0001||isNaN(t.scale))&&(t.scale=1),(t.translate>=-.01&&t.translate<=.01||isNaN(t.translate))&&(t.translate=0)}function jr(t,e,n,i){Lr(t.x,e.x,n.x,i?i.originX:void 0),Lr(t.y,e.y,n.y,i?i.originY:void 0)}function Or(t,e,n,i=0){const s=i?Ct(n.min,n.max,i):n.min;t.min=s+e.min,t.max=t.min+Br(e)}function Fr(t,e,n,i){Or(t.x,e.x,n.x,i?.x),Or(t.y,e.y,n.y,i?.y)}function Ir(t,e,n,i=0){const s=i?Ct(n.min,n.max,i):n.min;t.min=e.min-s,t.max=t.min+Br(e)}function $r(t,e,n,i){Ir(t.x,e.x,n.x,i?.x),Ir(t.y,e.y,n.y,i?.y)}function Nr(t,e,n,i,s){return t=No(t-=e,1/n,i),void 0!==s&&(t=No(t,1/s,i)),t}function Wr(t,e=0,n=1,i=.5,s,o=t,r=t){if(pt.test(e)){e=parseFloat(e);e=Ct(r.min,r.max,e/100)-r.min}if("number"!=typeof e)return;let a=Ct(o.min,o.max,i);t===o&&(a-=e),t.min=Nr(t.min,e,n,a,s),t.max=Nr(t.max,e,n,a,s)}function Ur(t,e,[n,i,s],o,r){Wr(t,e[n],e[i],e[s],e.scale,o,r)}const zr=["x","scaleX","originX"],Kr=["y","scaleY","originY"];function Yr(t,e,n,i){Ur(t.x,e,zr,n?n.x:void 0,i?i.x:void 0),Ur(t.y,e,Kr,n?n.y:void 0,i?i.y:void 0)}function Xr(t){return 0===t.translate&&1===t.scale}function Gr(t){return Xr(t.x)&&Xr(t.y)}function Hr(t,e){return t.min===e.min&&t.max===e.max}function qr(t,e){return Hr(t.x,e.x)&&Hr(t.y,e.y)}function Zr(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function _r(t,e){return Zr(t.x,e.x)&&Zr(t.y,e.y)}function Jr(t){return Br(t.x)/Br(t.y)}function Qr(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function ta(t){return[t("x"),t("y")]}function ea(t,e,n){let i="";const s=t.x.translate/e.x,o=t.y.translate/e.y,r=n?.z||0;if((s||o||r)&&(i=`translate3d(${s}px, ${o}px, ${r}px) `),1===e.x&&1===e.y||(i+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:t,rotate:e,pathRotation:s,rotateX:o,rotateY:r,skewX:a,skewY:l}=n;t&&(i=`perspective(${t}px) ${i}`),e&&(i+=`rotate(${e}deg) `),s&&(i+=`rotate(${s}deg) `),o&&(i+=`rotateX(${o}deg) `),r&&(i+=`rotateY(${r}deg) `),a&&(i+=`skewX(${a}deg) `),l&&(i+=`skewY(${l}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return 1===a&&1===l||(i+=`scale(${a}, ${l})`),i||"none"}const na=Fi.length,ia=t=>"string"==typeof t?parseFloat(t):t,sa=t=>"number"==typeof t||mt.test(t);function oa(t,e,n,i,s,o){s?(t.opacity=Ct(0,n.opacity??1,aa(i)),t.opacityExit=Ct(e.opacity??1,0,la(i))):o&&(t.opacity=Ct(e.opacity??1,n.opacity??1,i));for(let s=0;sie?1:n(d(t,e,i))}function ua(t,e,n){const i=li(t)?t:In(t);return i.start(Gn("",i,e,n)),i.animation}function ha(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n,i)}const da=(t,e)=>t.depth-e.depth;class pa{constructor(){this.children=[],this.isDirty=!1}add(t){e(this.children,t),this.isDirty=!0}remove(t){n(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(da),this.isDirty=!1,this.children.forEach(t)}}function ma(t,e){const n=G.now(),i=({timestamp:s})=>{const o=s-n;o>=e&&(U(i),t(o-e))};return W.setup(i,!0),()=>U(i)}function fa(t,e){return ma(t,m(e))}function ya(t){return li(t)?t.get():t}class ga{constructor(){this.members=[]}add(t){e(this.members,t);for(let e=this.members.length-1;e>=0;e--){const i=this.members[e];if(i===t||i===this.lead||i===this.prevLead)continue;const s=i.instance;s&&!1!==s.isConnected||i.snapshot||(n(this.members,i),i.unmount())}t.scheduleRender()}remove(t){if(n(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){for(let e=this.members.indexOf(t)-1;e>=0;e--){const t=this.members[e];if(!1!==t.isPresent&&!1!==t.instance?.isConnected)return this.promote(t),!0}return!1}promote(t,e){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.updateSnapshot(),t.scheduleRender();const{layoutDependency:i}=n.options,{layoutDependency:s}=t.options;void 0!==i&&i===s||(t.resumeFrom=n,e&&(n.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root?.isUpdating&&(t.isLayoutDirty=!0)),!1===t.options.crossfade&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{t.options.onExitComplete?.(),t.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}const va={hasAnimatedSinceResize:!0,hasEverUpdated:!1},xa={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},wa=["","X","Y","Z"];let Ta=0;function ba(t,e,n,i){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),i&&(i[t]=0))}function Sa(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=mi(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:e,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",W,!(e||i))}const{parent:i}=t;i&&!i.hasCheckedOptimisedAppear&&Sa(i)}function Aa({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:o}){return class{constructor(t={},n=e?.()){this.id=Ta++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Cs.value&&(xa.nodes=xa.calculatedTargetDeltas=xa.calculatedProjections=0),this.nodes.forEach(Ma),this.nodes.forEach(Oa),this.nodes.forEach(Fa),this.nodes.forEach(Ea),Cs.addProjectionMetrics&&Cs.addProjectionMetrics(xa)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=t,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let t=0;tthis.root.updateBlockedByResize=!1;W.read(()=>{i=window.innerWidth}),t(e,()=>{const t=window.innerWidth;t!==i&&(i=t,this.root.updateBlockedByResize=!0,n&&n(),n=ma(s,250),va.hasAnimatedSinceResize&&(va.hasAnimatedSinceResize=!1,this.nodes.forEach(ja)))})}n&&this.root.registerSharedNode(n,this),!1!==this.options.animate&&s&&(n||i)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeLayoutChanged:n,layout:i})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const o=this.options.transition||s.getDefaultTransition()||za,{onLayoutAnimationStart:r,onLayoutAnimationComplete:a}=s.getProps(),l=!this.targetLayout||!_r(this.targetLayout,i),c=!e&&n;if(this.options.layoutRoot||this.resumeFrom||c||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const e={...Nn(o,"layout"),onPlay:r,onComplete:a};(s.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e),this.setAnimationOrigin(t,c,e.path)}else e||ja(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=i})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const t=this.getStack();t&&t.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),U(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Ia),this.animationId++)}getTransformTemplate(){const{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Sa(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||Br(this.snapshot.measuredBox.x)||Br(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;t{const n=e/1e3,i=p?.(n);var c,m,f,y;i?(r.x.translate=i.x,r.x.scale=Ct(t.x.scale,1,n),r.x.origin=t.x.origin,r.x.originPoint=t.x.originPoint,r.y.translate=i.y,r.y.scale=Ct(t.y.scale,1,n),r.y.origin=t.y.origin,r.y.originPoint=t.y.originPoint):(Na(r.x,t.x,n),Na(r.y,t.y,n)),this.setTargetDelta(r),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&($r(a,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),c=this.relativeTarget,m=this.relativeTargetOrigin,f=a,y=n,Wa(c.x,m.x,f.x,y),Wa(c.y,m.y,f.y,y),d&&qr(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||(d={x:{min:0,max:0},y:{min:0,max:0}}),Dr(d,this.relativeTarget)),l&&(this.animationValues=o,oa(o,s,this.latestValues,n,h,u)),i&&void 0!==i.rotate&&(this.animationValues||(this.animationValues=o),this.animationValues.pathRotation=i.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(t){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(U(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=W.update(()=>{va.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=In(0)),this.motionValue.jump(0,!1),this.currentAnimation=ua(this.motionValue,[0,1e3],{...t,velocity:0,isSync:!0,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onComplete:()=>{t.onComplete&&t.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const t=this.getStack();t&&t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead();let{targetWithTransforms:e,target:n,layout:i,latestValues:s}=t;if(e&&n&&i){if(this!==t&&this.layout&&i&&Ga(this.options.animationType,this.layout.layoutBox,i.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=Br(this.layout.layoutBox.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const i=Br(this.layout.layoutBox.y);n.y.min=t.target.y.min,n.y.max=n.y.min+i}Dr(e,n),Zo(e,s),jr(this.projectionDeltaWithTransform,this.layoutCorrected,e,s)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new ga);this.sharedNodes.get(t).add(e);const n=e.options.initialPromotionConfig;e.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(e):void 0})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){const{layoutId:t}=this.options;return t&&this.getStack()?.lead||this}getPrevLead(){const{layoutId:t}=this.options;return t?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:n}={}){const i=this.getStack();i&&i.promote(this,n),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetSkewAndRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const{latestValues:n}=t;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(e=!0),!e)return;const i={};n.z&&ba("z",t,i,this.animationValues);for(let e=0;et.currentAnimation?.stop()),this.root.nodes.forEach(Da),this.root.sharedNodes.clear()}}}function Va(t){t.updateLayout()}function Pa(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=t.layout,{animationType:s}=t.options,o=e.source!==t.layout.source;if("size"===s)ta(t=>{const i=o?e.measuredBox[t]:e.layoutBox[t],s=Br(i);i.min=n[t].min,i.max=i.min+s});else if("x"===s||"y"===s){const t="x"===s?"y":"x";kr(o?e.measuredBox[t]:e.layoutBox[t],n[t])}else Ga(s,e.layoutBox,n)&&ta(i=>{const s=o?e.measuredBox[i]:e.layoutBox[i],r=Br(n[i]);s.max=s.min+r,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[i].max=t.relativeTarget[i].min+r)});const r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};jr(r,n,e.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};o?jr(a,t.applyTransform(i,!0),e.measuredBox):jr(a,n,e.layoutBox);const l=!Gr(r);let c=!1;if(!t.resumeFrom){const i=t.getClosestProjectingParent();if(i&&!i.resumeFrom){const{snapshot:s,layout:o}=i;if(s&&o){const r=t.options.layoutAnchor||void 0,a={x:{min:0,max:0},y:{min:0,max:0}};$r(a,e.layoutBox,s.layoutBox,r);const l={x:{min:0,max:0},y:{min:0,max:0}};$r(l,n,o.layoutBox,r),_r(a,l)||(c=!0),i.options.layoutRoot&&(t.relativeTarget=l,t.relativeTargetOrigin=a,t.relativeParent=i)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:a,layoutDelta:r,hasLayoutChanged:l,hasRelativeLayoutChanged:c})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function Ma(t){Cs.value&&xa.nodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=Boolean(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function Ea(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function ka(t){t.clearSnapshot()}function Da(t){t.clearMeasurements()}function Ca(t){t.isLayoutDirty=!0,t.updateLayout()}function Ba(t){t.isLayoutDirty=!1}function Ra(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function La(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function ja(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Oa(t){t.resolveTargetDelta()}function Fa(t){t.calcProjection()}function Ia(t){t.resetSkewAndRotation()}function $a(t){t.removeLeadSnapshot()}function Na(t,e,n){t.translate=Ct(e.translate,0,n),t.scale=Ct(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Wa(t,e,n,i){t.min=Ct(e.min,n.min,i),t.max=Ct(e.max,n.max,i)}function Ua(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const za={duration:.45,ease:[.4,0,.1,1]},Ka=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Ya=Ka("applewebkit/")&&!Ka("chrome/")?Math.round:u;function Xa(t){t.min=Ya(t.min),t.max=Ya(t.max)}function Ga(t,e,n){return"position"===t||"preserve-aspect"===t&&!Rr(Jr(e),Jr(n),.2)}function Ha(t){return t!==t.root&&t.scroll?.wasRoot}const qa=Aa({attachResizeListener:(t,e)=>ha(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Za=t=>!t.isLayoutDirty&&t.willUpdate(!1);const _a={current:void 0},Ja=Aa({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!_a.current){const t=new qa({});t.mount(window),t.setOptions({layoutScroll:!0}),_a.current=t}return _a.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),Qa="[data-layout],[data-layout-id]",tl=new WeakMap;let el;function nl(t){const e=[];return t instanceof HTMLElement&&t.matches(Qa)&&e.push(t),t.querySelectorAll(Qa).forEach(t=>{t instanceof HTMLElement&&e.push(t)}),e}function il(t,e){const n=t.getAttribute("data-layout");return{layoutId:t.getAttribute("data-layout-id")??void 0,layout:null!==n||void 0,animationType:n&&"true"!==n?n:"both",transition:e}}function sl(t,e){let n=tl.get(t);if(n)n.setOptions(il(t,e));else{let i=go.get(t);i||(i=new cr({props:{},presenceContext:null,visualState:{latestValues:{},renderState:{transform:{},transformOrigin:{},style:{},vars:{}}}},{allowProjection:!0})),t.style.transform&&!Fo(i.latestValues)&&(t.style.transform=""),n=new Ja(i.latestValues,function(t){let e=t.parentElement;for(;e;){const t=tl.get(e);if(t&&t.instance)return t;e=e.parentElement}}(t)),i.projection=n,n.setOptions({...il(t,e),visualElement:i}),n.mount(t),tl.set(t,n)}return n.isPresent=!0,n.options.onExitComplete&&n.setOptions({onExitComplete:void 0}),n}function ol(t,e){e.setOptions({onExitComplete:void 0});e.getStack()&&!e.isLead()||e.currentAnimation?.stop(),e.unmount(),tl.delete(t)}function rl(){const t=el;el=void 0,function(){if(z.isProcessing)return;const t=G.now();z.delta=i(0,1e3/60,t-z.timestamp),z.timestamp=t,z.isProcessing=!0,K.update.process(z),K.preRender.process(z),K.render.process(z),z.isProcessing=!1}();const e=new Map;for(const n of t)for(const t of n.collectTargets()){const i=e.get(t);i?i.push(n):e.set(t,[n])}const n=new Map;for(const t of(s=e.keys(),[...s].sort((t,e)=>t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1))){const i=e.get(t),s=sl(t,i[i.length-1].transitionFor(t));for(const e of i)e.adopt(t,s);n.set(t,s)}var s;n.forEach(t=>{t.isLayoutDirty=!1,t.willUpdate()});const o=[];for(const e of t){const t=e.runUpdate();t&&o.push(t)}const r=()=>{const e=new Set;for(const n of t)n.reconcileAdditions(e);for(const n of t)n.reconcileRemovals(e);let i;n.forEach(t=>i||(i=t.root));for(const e of t)i||(i=e.getRoot());i?.didUpdate(),es.render(()=>{for(const e of t)e.finalize()})};o.length?Promise.all(o).then(r):r()}const al=W,ll=$.reduce((t,e)=>(t[e]=t=>U(t),t),{});function cl(t){return"object"==typeof t&&!Array.isArray(t)}function ul(t,e,n,i){return null==t?[]:"string"==typeof t&&cl(e)?Wi(t,n,i):t instanceof NodeList?Array.from(t):Array.isArray(t)?t.filter(t=>null!=t):[t]}function hl(t,e,n){return t*(e+1)+n*e}function dl(t,e,n,i){return"number"==typeof e?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?n:e.startsWith("<")?Math.max(0,n+parseFloat(e.slice(1))):i.get(e)??t}function pl(t,e,i,s,o,r){!function(t,e,i){for(let s=0;se&&o.at"number"==typeof t,Tl=t=>t.every(wl);function bl(t){const e={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=gs(t)&&!Bs(t)?new wr(e):new cr(e);n.mount(t),go.set(t,n)}function Sl(t){const e=new ur({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});e.mount(t),go.set(t,e)}function Al(e,n,i,s){const o=[];if(function(t,e){return li(t)||"number"==typeof t||"string"==typeof t&&!cl(e)}(e,n))o.push(ua(e,cl(n)&&n.default||n,i&&i.default||i));else{if(null==e)return o;const r=ul(e,n,s),a=r.length;t.invariant(Boolean(a),"No valid elements provided.","no-valid-elements");for(let t=0;t{const c=vl(e),{delay:u=0,times:h=xe(c),type:d=n.type||"keyframes",repeat:y,repeatType:g,repeatDelay:x=0,...w}=i;let{ease:T=n.ease||"easeOut",duration:b}=i;const A="function"==typeof u?u(a,l):u,V=c.length,P=mn(d)?d:o?.[d||"keyframes"];if(V<=2&&P){let t=100;if(2===V&&Tl(c)){const e=c[1]-c[0];t=Math.abs(e)}const e={...n,...w};void 0!==b&&(e.duration=m(b));const i=Ht(e,t,P);T=i.ease,b=i.duration}b??(b=r);const M=p+A;1===h.length&&0===h[0]&&(h[1]=1);const E=h.length-c.length;if(E>0&&ve(h,E),1===c.length&&c.unshift(null),y&&t.warning(y<20,`Sequence segments can't repeat ${y} times — ignoring repeat option. Use a value below 20 or apply repeat at the sequence level instead.`),y&&y<20){const t=b>0?x/b:0;b=hl(b,y,x);const e=[...c],n=[...h];T=Array.isArray(T)?[...T]:[T];const i=[...T],s="reverse"===g||"mirror"===g;let o=e,r=i;s&&(o=[...e].reverse(),"reverse"===g&&(r=[...i].reverse().map(t=>"function"==typeof t?S(t):t)));for(let a=0;a0&&(c.push(c[c.length-1]),h.push(p),T.push("linear")),c.push(...u);for(let t=0;t{for(const s in t){const o=t[s];o.sort(fl);const r=[],l=[],c=[];for(let t=0;t{if(Array.isArray(t)&&"function"==typeof t[0]){const e=t[0],n=In(0);return n.on("change",e),1===t.length?[n,[0,1]]:2===t.length?[n,[0,1],t[1]]:[n,t[1],t[2]]}return t}),n,i,{spring:me});return o.forEach(({keyframes:t,transition:e},n)=>{s.push(...Al(n,t,e))}),s}function Pl(t={}){const{scope:e,reduceMotion:i,skipAnimations:s}=t;return function(t,o,r){let a,l=[];const c={};if(void 0!==i&&(c.reduceMotion=i),void 0!==s&&(c.skipAnimations=s),u=t,Array.isArray(u)&&u.some(Array.isArray)){const{onComplete:n,...i}=o||{};"function"==typeof n&&(a=n),l=Vl(t,{...c,...i},e)}else{const{onComplete:n,...i}=r||{};"function"==typeof n&&(a=n),l=Al(t,o,{...c,...i},e)}var u;const h=new Dn(l);return a&&h.finished.then(a),e&&(e.animations.push(h),h.finished.then(()=>{n(e.animations,h)})),h}}const Ml=Pl();const El=e=>function(n,i,s){return new Dn(function(e,n,i,s){if(null==e)return[];const o=Wi(e,s),r=o.length;t.invariant(Boolean(r),"No valid elements provided.","no-valid-elements");const a=[];for(let t=0;te.delete(n)),l.push(s)}return l}(n,i,s,e))},kl=El();function Dl(t){return"undefined"!=typeof window&&(t?ln():an())}const Cl={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function Bl(t,e,n,i){const s=n[e],{length:o,position:r}=Cl[e],a=s.current,l=n.time;s.current=Math.abs(t[`scroll${r}`]),s.scrollLength=t[`scroll${o}`]-t[`client${o}`],s.offset.length=0,s.offset[0]=0,s.offset[1]=s.scrollLength,s.progress=d(0,s.scrollLength,s.current);const c=i-l;s.velocity=c>50?0:y(s.current-a,c)}const Rl={start:0,center:.5,end:1};function Ll(t,e,n=0){let i=0;if(t in Rl&&(t=Rl[t]),"string"==typeof t){const e=parseFloat(t);t.endsWith("px")?i=e:t.endsWith("%")?t=e/100:t.endsWith("vw")?i=e/100*document.documentElement.clientWidth:t.endsWith("vh")?i=e/100*document.documentElement.clientHeight:t=e}return"number"==typeof t&&(i=e*t),n+i}const jl=[0,0];function Ol(t,e,n,i){let s=Array.isArray(t)?t:jl,o=0,r=0;return"number"==typeof t?s=[t,t]:"string"==typeof t&&(s=(t=t.trim()).includes(" ")?t.split(" "):[t,Rl[t]?t:"0"]),o=Ll(s[0],n,i),r=Ll(s[1],e),o-r}const Fl={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},Il={x:0,y:0};function $l(t,e,n){const{offset:s=Fl.All}=n,{target:o=t,axis:r="y"}=n,a="y"===r?"height":"width",l=o!==t?function(t,e){const n={x:0,y:0};let i=t;for(;i&&i!==e;)if(qi(i))n.x+=i.offsetLeft,n.y+=i.offsetTop,i=i.offsetParent;else if("svg"===i.tagName){const t=i.getBoundingClientRect();i=i.parentElement;const e=i.getBoundingClientRect();n.x+=t.left-e.left,n.y+=t.top-e.top}else{if(!(i instanceof SVGGraphicsElement))break;{const{x:t,y:e}=i.getBBox();n.x+=t,n.y+=e;let s=null,o=i.parentNode;for(;!s;)"svg"===o.tagName&&(s=o),o=i.parentNode;i=s}}return n}(o,t):Il,c=o===t?{width:t.scrollWidth,height:t.scrollHeight}:function(t){return"getBBox"in t&&"svg"!==t.tagName?t.getBBox():{width:t.clientWidth,height:t.clientHeight}}(o),u={width:t.clientWidth,height:t.clientHeight};e[r].offset.length=0;let h=!e[r].interpolate;const d=s.length;for(let t=0;t{!function(t,e=t,n){if(n.x.targetOffset=0,n.y.targetOffset=0,e!==t){let i=e;for(;i&&i!==t;)n.x.targetOffset+=i.offsetLeft,n.y.targetOffset+=i.offsetTop,i=i.offsetParent}n.x.targetLength=e===t?e.scrollWidth:e.clientWidth,n.y.targetLength=e===t?e.scrollHeight:e.clientHeight,n.x.containerLength=t.clientWidth,n.y.containerLength=t.clientHeight}(t,i.target,n),function(t,e,n){Bl(t,"x",e,n),Bl(t,"y",e,n),e.time=n}(t,n,e),(i.offset||i.target)&&$l(t,n,i)},notify:()=>e(n)}}const Wl=new WeakMap,Ul=new WeakMap,zl=new WeakMap,Kl=new WeakMap,Yl=new WeakMap,Xl=t=>t===document.scrollingElement?window:t;function Gl(t,{container:e=document.scrollingElement,trackContentSize:n=!1,...i}={}){if(!e)return u;let s=zl.get(e);s||(s=new Set,zl.set(e,s));const o=Nl(e,t,{time:0,x:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0},y:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}},i);if(s.add(o),!Wl.has(e)){const t=()=>{for(const t of s)t.measure(z.timestamp);W.preUpdate(n)},n=()=>{for(const t of s)t.notify()},i=()=>W.read(t);Wl.set(e,i);const o=Xl(e);window.addEventListener("resize",i),e!==document.documentElement&&Ul.set(e,ks(e,i)),o.addEventListener("scroll",i),i()}if(n&&!Yl.has(e)){const t=Wl.get(e),n={width:e.scrollWidth,height:e.scrollHeight};Kl.set(e,n);const i=()=>{const i=e.scrollWidth,s=e.scrollHeight;n.width===i&&n.height===s||(t(),n.width=i,n.height=s)},s=W.read(i,!0);Yl.set(e,s)}const r=Wl.get(e);return W.read(r,!1,!0),()=>{U(r);const t=zl.get(e);if(!t)return;if(t.delete(o),t.size)return;const n=Wl.get(e);Wl.delete(e),n&&(Xl(e).removeEventListener("scroll",n),Ul.get(e)?.(),window.removeEventListener("resize",n));const i=Yl.get(e);i&&(U(i),Yl.delete(e)),Kl.delete(e)}}const Hl=[[Fl.Enter,"entry"],[Fl.Exit,"exit"],[Fl.Any,"cover"],[Fl.All,"contain"]],ql={start:0,end:1};function Zl(t){const e=t.trim().split(/\s+/);if(2!==e.length)return;const n=ql[e[0]],i=ql[e[1]];return void 0!==n&&void 0!==i?[n,i]:void 0}function _l(t,e){const n=function(t){if(2!==t.length)return;const e=[];for(const n of t)if(Array.isArray(n))e.push(n);else{if("string"!=typeof n)return;{const t=Zl(n);if(!t)return;e.push(t)}}return e}(t);if(!n)return!1;for(let t=0;t<2;t++){const i=n[t],s=e[t];if(i[0]!==s[0]||i[1]!==s[1])return!1}return!0}function Jl(t){if(!t)return{rangeStart:"contain 0%",rangeEnd:"contain 100%"};for(const[e,n]of Hl)if(_l(t,e))return{rangeStart:`${n} 0%`,rangeEnd:`${n} 100%`}}const Ql=new Map;function tc(t){const e={value:0},n=Gl(n=>{e.value=100*n[t.axis].progress},t);return{currentTime:e,cancel:n}}function ec({source:t,container:e,...n}){const{axis:i}=n;t&&(e=t);let s=Ql.get(e);s||(s=new Map,Ql.set(e,s));const o=n.target??"self";let r=s.get(o);r||(r={},s.set(o,r));const a=i+(n.offset??[]).join(",");if(!r[a])if(n.target&&Dl(n.target)){const t=Jl(n.offset);r[a]=t?new ViewTimeline({subject:n.target,axis:i}):tc({container:e,...n})}else Dl()?r[a]=new ScrollTimeline({source:e,axis:i}):r[a]=tc({container:e,...n});return r[a]}const nc={some:0,all:1};const ic=(t,e)=>Math.abs(t-e);t.AsyncMotionValueAnimation=Mn,t.DOMKeyframesResolver=Oi,t.DOMVisualElement=Bo,t.DocumentProjectionNode=qa,t.Feature=class{constructor(t){this.isMounted=!1,this.node=t}update(){}},t.FlatTree=pa,t.GroupAnimation=En,t.GroupAnimationWithThen=Dn,t.HTMLProjectionNode=Ja,t.HTMLVisualElement=cr,t.JSAnimation=ke,t.KeyframeResolver=en,t.LayoutAnimationBuilder=class{constructor(t,e,n){this.scope=t,this.updateDom=e,this.defaultOptions=n,this.sharedTransitions=new Map,this.notifyReady=()=>{},this.rejectReady=()=>{},this.tracked=new Map,this.restorePoints=new Map,this.readyPromise=new Promise((t,e)=>{this.notifyReady=t,this.rejectReady=e}),el||(el=[],queueMicrotask(rl)),el.push(this)}shared(t,e){return this.sharedTransitions.set(t,e),this}then(t,e){return this.readyPromise.then(t,e)}transitionFor(t){const e=t.getAttribute("data-layout-id");return e&&this.sharedTransitions.get(e)||this.defaultOptions}adopt(t,e){this.tracked.set(t,e),this.restorePoints.set(t,{parent:t.parentElement,next:t.nextSibling})}collectTargets(){return nl(this.scope)}runUpdate(){try{const t=this.updateDom();if(t&&"function"==typeof t.then)return t.then(void 0,t=>{this.updateError=t})}catch(t){this.updateError=t}}reconcileAdditions(t){for(const e of nl(this.scope)){if(this.tracked.has(e))continue;const n=sl(e,this.transitionFor(e));this.adopt(e,n),n.options.layoutId&&t.add(n.options.layoutId)}}reconcileRemovals(t){this.tracked.forEach((e,n)=>{if(n.isConnected)return;const i=this.restorePoints.get(n);this.restorePoints.delete(n);const{layoutId:s}=e.options,o=e.getStack(),r=o&&o.members.some(t=>t!==e&&t.instance?.isConnected);if(s&&e.isLead()&&r&&!t.has(s)&&i&&i.parent.isConnected){if(i.parent.insertBefore(n,i.next&&i.next.parentNode===i.parent?i.next:null),e.isPresent=!1,e.setOptions({onExitComplete:()=>{n.remove(),ol(n,e)}}),e.relegate())return;n.remove()}ol(n,e),this.tracked.delete(n)})}getRoot(){let t;return this.tracked.forEach(e=>t||(t=e.root)),t}finalize(){if(this.updateError)return void this.rejectReady(this.updateError);const t=new Set;this.tracked.forEach(e=>{e.instance&&e.currentAnimation&&t.add(e.currentAnimation)}),this.notifyReady(new En([...t]))}},t.MotionGlobalConfig=o,t.MotionValue=Fn,t.NativeAnimation=yn,t.NativeAnimationExtended=xn,t.NativeAnimationWrapper=Cn,t.NodeStack=ga,t.ObjectVisualElement=ur,t.SVGVisualElement=wr,t.SubscriptionManager=p,t.ViewTransitionBuilder=ho,t.VisualElement=Co,t.acceleratedValues=bn,t.addAttrValue=Xi,t.addDomEvent=ha,t.addScaleCorrector=function(t){for(const e in t)rr[e]=t[e],q(e)&&(rr[e].isCSSVariable=!0)},t.addStyleValue=Ji,t.addUniqueItem=e,t.addValueToWillChange=ui,t.alpha=et,t.analyseComplexValue=At,t.animate=Ml,t.animateMini=kl,t.animateMotionValue=Gn,t.animateSingleValue=ua,t.animateTarget=yi,t.animateValue=function(t){return new ke(t)},t.animateVariant=gi,t.animateView=function(t,e={}){return new ho(t,e)},t.animateVisualElement=vi,t.animationMapKey=Rn,t.anticipate=M,t.applyAxisDelta=Uo,t.applyBoxDelta=zo,t.applyGeneratorOptions=fn,t.applyPointDelta=Wo,t.applyPxDefaults=$i,t.applyTreeDeltas=Xo,t.arc=function(t={}){const e=function({strength:t=.5,peak:e=.5,direction:n,rotate:i=!1}={}){const s=!0===i?1:"number"==typeof i?i:0;let o;return(i,r)=>{const a=r.x-i.x,l=r.y-i.y;let c;c="cw"===n?-t:"ccw"===n?t:(Math.abs(a)>=Math.abs(l)?a:l)<0?-t:t;let u=Zn(i.x,i.y,r.x,r.y,c,e);if(void 0===n){const t=Math.abs(a){const e={x:Hn(t,i.x,u.x,r.x),y:Hn(t,i.y,u.y,r.y)};if(s){const n=qn(t,i.x,u.x,r.x,i.y,u.y,r.y),o=h+p*t;e.rotate=x(-180,180,n-o)*s}return e}}}(t),n={interpolateProjection(t){const n=t.x.translate,i=t.y.translate;if(!(Math.sqrt(n*n+i*i)<20))return e({x:n,y:i},{x:0,y:0})},animateVisualElement(t,n,i,s,o){if(!("x"in n)&&!("y"in n))return;const r=t.getValue("x",t.latestValues.x??0),a=t.getValue("y",t.latestValues.y??0),l=n.x,c=n.y,u=(Array.isArray(l)&&null!=l[0]?l[0]:r?.get())??0,h=(Array.isArray(c)&&null!=c[0]?c[0]:a?.get())??0,d=Array.isArray(l)?l[l.length-1]:l??u,p=Array.isArray(c)?c[c.length-1]:c??h,m=e({x:u,y:h},{x:d,y:p}),f=void 0!==m(0).rotate?t.getValue("pathRotation",0):void 0,y={delay:s,...Nn(i||{},"x")};delete y.path;const g=In(0);g.start(Gn("",g,[0,1e3],{...y,isSync:!0,velocity:0,onUpdate:t=>{const e=m(t/1e3);r?.set(e.x),a?.set(e.y),f&&void 0!==e.rotate&&f.set(e.rotate)},onComplete:()=>{r?.set(d),a?.set(p),f?.set(0)},onStop:()=>f?.set(0),onCancel:()=>f?.set(0)})),g.animation&&o.push(g.animation),delete n.x,delete n.y}};return n},t.aspectRatio=Jr,t.attachFollow=Os,t.attachSpring=function(t,e,n){return Os(t,e,{type:"spring",...n})},t.attrEffect=Gi,t.axisDeltaEquals=Qr,t.axisEquals=Hr,t.axisEqualsRounded=Zr,t.backIn=V,t.backInOut=P,t.backOut=A,t.boxEquals=qr,t.boxEqualsRounded=_r,t.buildHTMLStyles=er,t.buildProjectionTransform=ea,t.buildSVGAttrs=fr,t.buildSVGPath=pr,t.buildTransform=tr,t.calcAxisDelta=Lr,t.calcBoxDelta=jr,t.calcChildStagger=jn,t.calcGeneratorDuration=Gt,t.calcLength=Br,t.calcRelativeAxis=Or,t.calcRelativeAxisPosition=Ir,t.calcRelativeBox=Fr,t.calcRelativePosition=$r,t.camelCaseAttributes=yr,t.camelToDash=hi,t.cancelFrame=U,t.cancelMicrotask=ns,t.cancelSync=ll,t.checkVariantsDidChange=Pr,t.circIn=E,t.circInOut=D,t.circOut=k,t.clamp=i,t.cleanDirtyNodes=Ea,t.collectMotionValues=On,t.color=xt,t.compareByDepth=da,t.complex=Mt,t.containsCSSVariable=Q,t.convertBoundingBoxToBox=Ro,t.convertBoxToBoundingBox=function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}},t.convertOffsetToTimes=we,t.copyAxisDeltaInto=Cr,t.copyAxisInto=kr,t.copyBoxInto=Dr,t.correctBorderRadius=sr,t.correctBoxShadow=or,t.createAnimationState=function(t){let e=function(t){return e=>Promise.all(e.map(({animation:e,options:n})=>vi(t,e,n)))}(t),n=Er(),i=!0,s=!1;const o=e=>(n,i)=>{const s=ni(t,i,"exit"===e?t.presenceContext?.custom:void 0);if(s){const{transition:t,transitionEnd:e,...i}=s;n={...n,...i,...e}}return n};function r(r){const{props:a}=t,l=br(t.parent)||{},c=[],u=new Set;let h={},d=1/0;for(let e=0;ed&&y,T=!1;const b=Array.isArray(f)?f:[f];let S=b.reduce(o(p),{});!1===g&&(S={});const{prevResolvedValues:A={}}=m,V={...A,...S},P=e=>{w=!0,u.has(e)&&(T=!0,u.delete(e)),m.needsAnimating[e]=!0;const n=t.getValue(e);n&&(n.liveStyle=!1)};for(const t in V){const e=S[t],n=A[t];if(h.hasOwnProperty(t))continue;let i=!1;i=si(e)&&si(n)?!Sr(e,n)||x:e!==n,i?null!=e?P(t):u.add(t):void 0!==e&&u.has(t)?P(t):m.protectedKeys[t]=!0}m.prevProp=f,m.prevResolvedValues=S,m.isActive&&(h={...h,...S}),(i||s)&&t.blockInitialAnimation&&(w=!1);const M=v&&x;w&&(!M||T)&&c.push(...b.map(e=>{const n={type:p};if("string"==typeof e&&(i||s)&&!M&&t.manuallyAnimateOnMount&&t.parent){const{parent:i}=t,s=ni(i,e);if(i.enteringChildren&&s){const{delayChildren:e}=s.transition||{};n.delay=jn(i.enteringChildren,t,e)}}return{animation:e,options:n}}))}if(u.size){const e={};if("boolean"!=typeof a.initial){const n=ni(t,Array.isArray(a.initial)?a.initial[0]:a.initial);n&&n.transition&&(e.transition=n.transition)}u.forEach(n=>{const i=t.getBaseTarget(n),s=t.getValue(n);s&&(s.liveStyle=!0),e[n]=i??null}),c.push({animation:e})}let p=Boolean(c.length);return!i||!1!==a.initial&&a.initial!==a.animate||t.manuallyAnimateOnMount||(p=!1),i=!1,s=!1,p?e(c):Promise.resolve()}return{animateChanges:r,setActive:function(e,i){if(n[e].isActive===i)return Promise.resolve();t.variantChildren?.forEach(t=>t.animationState?.setActive(e,i)),n[e].isActive=i;const s=r(e);for(const t in n)n[t].protectedKeys={};return s},setAnimateFunction:function(n){e=n(t)},getState:()=>n,reset:()=>{n=Er(),s=!0}}},t.createAxis=fo,t.createAxisDelta=po,t.createBox=yo,t.createDelta=mo,t.createGeneratorEasing=Ht,t.createProjectionNode=Aa,t.createRenderBatcher=N,t.createScopedAnimate=Pl,t.cubicBezier=T,t.cubicBezierAsString=un,t.defaultEasing=Te,t.defaultOffset=xe,t.defaultTransformValue=Ie,t.defaultValueTypes=Ci,t.degrees=dt,t.delay=fa,t.delayInSeconds=fa,t.dimensionValueTypes=wi,t.distance=ic,t.distance2D=function(t,e){const n=ic(t.x,e.x),i=ic(t.y,e.y);return Math.sqrt(n**2+i**2)},t.eachAxis=ta,t.easeIn=C,t.easeInOut=R,t.easeOut=B,t.easingDefinitionToFunction=I,t.fillOffset=ve,t.fillWildcards=De,t.findDimensionValueType=Ti,t.findValueType=Ws,t.flushKeyframeResolvers=tn,t.followValue=js,t.frame=W,t.frameData=z,t.frameSteps=K,t.generateLinearEasing=Yt,t.getAnimatableNone=Li,t.getAnimationMap=Ln,t.getComputedStyle=ys,t.getDefaultTransition=Kn,t.getDefaultValueType=Bi,t.getEasingForSegment=j,t.getFeatureDefinitions=function(){return Do},t.getFinalKeyframe=Ae,t.getMixer=$t,t.getOptimisedAppearId=mi,t.getOriginIndex=Rs,t.getValueAsType=zi,t.getValueTransition=Nn,t.getVariableValue=Qn,t.getVariantContext=br,t.getViewAnimationLayerInfo=Qs,t.getViewAnimations=to,t.globalProjectionState=va,t.has2DTranslate=Io,t.hasReducedMotionListener=Po,t.hasScale=Oo,t.hasTransform=Fo,t.hasWarned=function(t){return g.has(t)},t.hex=ut,t.hover=function(t,e,n={}){const[i,s,o]=os(t,n);return i.forEach(t=>{let n,i=!1,o=!1;const r=e=>{n&&(n(e),n=void 0),t.removeEventListener("pointerleave",l)},a=t=>{i=!1,window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",a),o&&(o=!1,r(t))},l=t=>{"touch"!==t.pointerType&&(i?o=!0:r(t))};t.addEventListener("pointerenter",i=>{if("touch"===i.pointerType||ss())return;o=!1;const r=e(t,i);"function"==typeof r&&(n=r,t.addEventListener("pointerleave",l,s))},s),t.addEventListener("pointerdown",()=>{i=!0,window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",a,s)},s)}),o},t.hsla=vt,t.hslaToRgba=kt,t.inView=function(t,e,{root:n,margin:i,amount:s="some"}={}){const o=Wi(t),r=new WeakMap,a=new IntersectionObserver(t=>{t.forEach(t=>{const n=r.get(t.target);if(t.isIntersecting!==Boolean(n))if(t.isIntersecting){const n=e(t.target,t);"function"==typeof n?r.set(t.target,n):a.unobserve(t.target)}else"function"==typeof n&&(n(t),r.delete(t.target))})},{root:n,rootMargin:i,threshold:"number"==typeof s?s:nc[s]});return o.forEach(t=>a.observe(t)),()=>a.disconnect()},t.inertia=ye,t.initPrefersReducedMotion=Eo,t.interpolate=ge,t.invisibleValues=Ot,t.isAnimationControls=vo,t.isBezierDefinition=O,t.isCSSVariableName=q,t.isCSSVariableToken=_,t.isControllingVariants=bo,t.isDeltaZero=Gr,t.isDragActive=ss,t.isDragging=is,t.isEasingArray=L,t.isElementKeyboardAccessible=cs,t.isElementTextInput=function(t){return us.has(t.tagName)||!0===t.isContentEditable},t.isForcedMotionValue=ar,t.isGenerator=mn,t.isHTMLElement=qi,t.isKeyframesTarget=si,t.isMotionValue=li,t.isNear=Rr,t.isNodeOrChild=rs,t.isNumericalString=r,t.isObject=a,t.isPrimaryPointer=as,t.isSVGElement=gs,t.isSVGSVGElement=Bs,t.isSVGTag=gr,t.isTransitionDefined=Xn,t.isVariantLabel=xo,t.isVariantNode=So,t.isWaapiSupportedEasing=function t(e){return Boolean("function"==typeof e&&cn()||!e||"string"==typeof e&&(e in hn||cn())||O(e)||Array.isArray(e)&&e.every(t))},t.isWillChangeMotionValue=ci,t.isZeroValueString=l,t.keyframes=be,t.makeAnimationInstant=Tn,t.mapEasingToNativeEasing=dn,t.mapValue=function(t,e,n,i){const s=Ls(e,n,i);return $s(()=>s(t.get()))},t.maxGeneratorDuration=Xt,t.measurePageBox=function(t,e,n){const i=_o(t,n),{scroll:s}=e;return s&&(Go(i.x,s.offset.x),Go(i.y,s.offset.y)),i},t.measureViewportBox=_o,t.memo=c,t.microtask=es,t.millisecondsToSeconds=f,t.mirrorEasing=b,t.mix=zt,t.mixArray=Nt,t.mixColor=jt,t.mixComplex=Ut,t.mixImmediate=Dt,t.mixLinearColor=Bt,t.mixNumber=Ct,t.mixObject=Wt,t.mixValues=oa,t.mixVisibility=Ft,t.motionValue=In,t.moveItem=function([...t],e,n){const i=e<0?t.length+e:e;if(i>=0&&it.forEach(Za);return{add:i=>{t.add(i),e.set(i,i.addEventListener("willUpdate",n))},remove:i=>{t.delete(i);const s=e.get(i);s&&(s(),e.delete(i)),n()},dirty:n}},t.noop=u,t.number=tt,t.numberValueTypes=Di,t.observeTimeline=Ds,t.optimizedAppearDataAttribute=pi,t.optimizedAppearDataId=di,t.parseAnimateLayoutArgs=function(t,e,n){return"function"==typeof t?{scope:document,updateDom:t,defaultOptions:e}:{scope:t instanceof Document?t:Wi(t)[0]??document,updateDom:e,defaultOptions:n}},t.parseCSSVariable=Jn,t.parseValueFromTransform=$e,t.percent=pt,t.pipe=h,t.pixelsToPercent=ir,t.positionalKeys=ii,t.prefersReducedMotion=Vo,t.press=function(t,e,n={}){const[i,s,o]=os(t,n),r=t=>{const i=t.currentTarget;if(!ms(t))return;if(fs.has(t))return;hs.add(i),n.stopPropagation&&fs.add(t);const o=e(i,t),r={...s,capture:!0},a=(t,e)=>{window.removeEventListener("pointerup",l,r),window.removeEventListener("pointercancel",c,r),hs.has(i)&&hs.delete(i),ms(t)&&"function"==typeof o&&o(t,{success:e})},l=t=>{a(t,i===window||i===document||n.useGlobalTarget||rs(i,t.target))},c=t=>{a(t,!1)};window.addEventListener("pointerup",l,r),window.addEventListener("pointercancel",c,r)};return i.forEach(t=>{(n.useGlobalTarget?window:t).addEventListener("pointerdown",r,s),qi(t)&&(t.addEventListener("focus",t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const i=ds(()=>{if(hs.has(n))return;ps(n,"down");const t=ds(()=>{ps(n,"up")});n.addEventListener("keyup",t,e),n.addEventListener("blur",()=>ps(n,"cancel"),e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)})(t,s)),cs(t)||t.hasAttribute("tabindex")||(t.tabIndex=0))}),o},t.progress=d,t.progressPercentage=gt,t.propEffect=Hi,t.propagateDirtyNodes=Ma,t.px=mt,t.readTransformValue=Ne,t.recordStats=function(){if(Cs.value)throw Cs.value=null,Cs.addProjectionMetrics=null,new Error("Stats are already being measured");const t=Cs;t.value={layoutProjection:{nodes:[],calculatedTargetDeltas:[],calculatedProjections:[]}},t.addProjectionMetrics=e=>{const{layoutProjection:n}=t.value;n.nodes.push(e.nodes),n.calculatedTargetDeltas.push(e.calculatedTargetDeltas),n.calculatedProjections.push(e.calculatedProjections)}},t.removeAxisDelta=Wr,t.removeAxisTransforms=Ur,t.removeBoxTransforms=Yr,t.removeItem=n,t.removePointDelta=Nr,t.renderHTML=nr,t.renderSVG=vr,t.resize=ks,t.resolveElements=Wi,t.resolveMotionValue=ya,t.resolveTransition=$n,t.resolveVariant=ni,t.resolveVariantFromProps=ei,t.reverseEasing=S,t.rgbUnit=lt,t.rgba=ct,t.rootProjectionNode=_a,t.scale=nt,t.scaleCorrectors=rr,t.scalePoint=No,t.scrapeHTMLMotionValuesFromProps=lr,t.scrapeSVGMotionValuesFromProps=xr,t.scroll=function(t,{axis:e="y",container:n=document.scrollingElement,...i}={}){if(!n)return u;const s={axis:e,container:n,...i};return"function"==typeof t?function(t,e){return function(t){return 2===t.length}(t)||function(t){return t&&(t.target||t.offset)}(e)?Gl(n=>{t(n[e.axis].progress,n)},e):Ds(t,ec(e))}(t,s):function(t,e){const n=ec(e),i=e.target?Jl(e.offset):void 0,s=e.target?Dl(e.target)&&!!i:Dl();return t.attachTimeline({timeline:s?n:void 0,...i&&s&&{rangeStart:i.rangeStart,rangeEnd:i.rangeEnd},observe:t=>(t.pause(),Ds(e=>{t.time=t.iterationDuration*e},n))})}(t,s)},t.scrollInfo=Gl,t.secondsToMilliseconds=m,t.setDragLock=function(t){return"x"===t||"y"===t?is[t]?null:(is[t]=!0,()=>{is[t]=!1}):is.x||is.y?null:(is.x=is.y=!0,()=>{is.x=is.y=!1})},t.setFeatureDefinitions=function(t){Do=t},t.setStyle=sn,t.setTarget=ai,t.spring=me,t.springValue=function(t,e){return js(t,{type:"spring",...e})},t.stagger=function(t=.1,{startDelay:e=0,from:n=0,ease:i}={}){return(s,o)=>{const r="number"==typeof n?n:Rs(n,o),a=Math.abs(r-s);let l=t*a;if(i){const e=o*t;l=I(i)(l/e)*e}return e+l}},t.startWaapiAnimation=pn,t.statsBuffer=Cs,t.steps=function(t,e="end"){return n=>{const s=(n="end"===e?Math.min(n,.999):Math.max(n,.001))*t,o="end"===e?Math.floor(s):Math.ceil(s);return i(0,1,o/t)}},t.styleEffect=Qi,t.supportedWaapiEasing=hn,t.supportsBrowserAnimation=Pn,t.supportsFlags=on,t.supportsLinearEasing=cn,t.supportsPartialKeyframes=Ni,t.supportsScrollTimeline=an,t.supportsViewTimeline=ln,t.svgEffect=ts,t.sync=al,t.testValueType=xi,t.time=G,t.transform=Ls,t.transformAxis=Ho,t.transformBox=Zo,t.transformBoxPoints=Lo,t.transformPropOrder=Ue,t.transformProps=ze,t.transformValue=$s,t.transformValueTypes=ki,t.translateAxis=Go,t.updateMotionValuesFromProps=Ao,t.variantPriorityOrder=wo,t.variantProps=To,t.velocityPerSecond=y,t.vh=ft,t.visualElementStore=go,t.vw=yt,t.warnOnce=v,t.wrap=x}); diff --git a/node_modules/motion/dist/react-client.d.ts b/node_modules/motion/dist/react-client.d.ts deleted file mode 100644 index dd39a72..0000000 --- a/node_modules/motion/dist/react-client.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from 'framer-motion/client'; diff --git a/node_modules/motion/dist/react-m.d.ts b/node_modules/motion/dist/react-m.d.ts deleted file mode 100644 index c7ed1b1..0000000 --- a/node_modules/motion/dist/react-m.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from 'framer-motion/m'; diff --git a/node_modules/motion/dist/react-mini.d.ts b/node_modules/motion/dist/react-mini.d.ts deleted file mode 100644 index ef5bdae..0000000 --- a/node_modules/motion/dist/react-mini.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from 'framer-motion/mini'; diff --git a/node_modules/motion/dist/react.d.ts b/node_modules/motion/dist/react.d.ts deleted file mode 100644 index 4ba03bc..0000000 --- a/node_modules/motion/dist/react.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import * as fm from 'framer-motion'; -export * from 'framer-motion'; - -declare const motion: typeof fm.motion; -declare const m: typeof fm.m; - -export { m, motion }; diff --git a/node_modules/motion/mini/package.json b/node_modules/motion/mini/package.json deleted file mode 100644 index 1ed4407..0000000 --- a/node_modules/motion/mini/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "private": true, - "types": "../dist/mini.d.ts", - "main": "../dist/cjs/mini.js", - "module": "../dist/es/mini.mjs" -} diff --git a/node_modules/motion/package.json b/node_modules/motion/package.json deleted file mode 100644 index e3c31c4..0000000 --- a/node_modules/motion/package.json +++ /dev/null @@ -1,95 +0,0 @@ -{ - "name": "motion", - "version": "13.1.0", - "description": "An animation library for JavaScript and React.", - "main": "dist/cjs/index.js", - "module": "dist/es/index.mjs", - "exports": { - ".": { - "types": "./dist/index.d.ts", - "require": "./dist/cjs/index.js", - "import": "./dist/es/index.mjs", - "default": "./dist/cjs/index.js" - }, - "./debug": { - "types": "./dist/debug.d.ts", - "require": "./dist/cjs/debug.js", - "import": "./dist/es/debug.mjs", - "default": "./dist/cjs/debug.js" - }, - "./mini": { - "types": "./dist/mini.d.ts", - "require": "./dist/cjs/mini.js", - "import": "./dist/es/mini.mjs", - "default": "./dist/cjs/mini.js" - }, - "./react": { - "types": "./dist/react.d.ts", - "require": "./dist/cjs/react.js", - "import": "./dist/es/react.mjs", - "default": "./dist/cjs/react.js" - }, - "./react-client": { - "types": "./dist/react-client.d.ts", - "require": "./dist/cjs/react-client.js", - "import": "./dist/es/react-client.mjs", - "default": "./dist/cjs/react-client.js" - }, - "./react-m": { - "types": "./dist/react-m.d.ts", - "require": "./dist/cjs/react-m.js", - "import": "./dist/es/react-m.mjs", - "default": "./dist/cjs/react-m.js" - }, - "./react-mini": { - "types": "./dist/react-mini.d.ts", - "require": "./dist/cjs/react-mini.js", - "import": "./dist/es/react-mini.mjs", - "default": "./dist/cjs/react-mini.js" - }, - "./package.json": "./package.json" - }, - "types": "dist/index.d.ts", - "author": "Matt Perry", - "license": "MIT", - "repository": "https://github.com/motiondivision/motion", - "sideEffects": false, - "keywords": [ - "javascript animation", - "react animation", - "react", - "three", - "3d", - "animation", - "gestures", - "drag", - "spring", - "popmotion", - "framer", - "waapi" - ], - "scripts": { - "build": "yarn clean && tsc -p . && rollup -c", - "dev": "concurrently -c blue,red -n tsc,rollup --kill-others \"tsc --watch -p . --preserveWatchOutput\" \"rollup --config --watch --no-watch.clearScreen\"", - "clean": "rm -rf types dist lib", - "prepack": "yarn build", - "postpublish": "git push --tags" - }, - "dependencies": { - "framer-motion": "^13.1.0", - "tslib": "^2.4.0" - }, - "peerDependencies": { - "react": "^18.0.0 || ^19.0.0", - "react-dom": "^18.0.0 || ^19.0.0" - }, - "peerDependenciesMeta": { - "react": { - "optional": true - }, - "react-dom": { - "optional": true - } - }, - "gitHead": "adaf7a4e5368d704ea350669f6ac674fb26ff270" -} diff --git a/node_modules/motion/react-client/package.json b/node_modules/motion/react-client/package.json deleted file mode 100644 index 41e0c96..0000000 --- a/node_modules/motion/react-client/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "private": true, - "types": "../dist/react-client.d.ts", - "main": "../dist/cjs/react-client.js", - "module": "../dist/es/react-client.mjs" -} diff --git a/node_modules/motion/react-m/package.json b/node_modules/motion/react-m/package.json deleted file mode 100644 index 45b9dc1..0000000 --- a/node_modules/motion/react-m/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "private": true, - "types": "../dist/react-m.d.ts", - "main": "../dist/cjs/react-m.js", - "module": "../dist/es/react-m.mjs" -} diff --git a/node_modules/motion/react/package.json b/node_modules/motion/react/package.json deleted file mode 100644 index 27ab21c..0000000 --- a/node_modules/motion/react/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "private": true, - "types": "../dist/react.d.ts", - "main": "../dist/cjs/react.js", - "module": "../dist/es/react.mjs" -} diff --git a/node_modules/tslib/CopyrightNotice.txt b/node_modules/tslib/CopyrightNotice.txt deleted file mode 100644 index 5d7d2d9..0000000 --- a/node_modules/tslib/CopyrightNotice.txt +++ /dev/null @@ -1,15 +0,0 @@ -/****************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ - diff --git a/node_modules/tslib/LICENSE.txt b/node_modules/tslib/LICENSE.txt deleted file mode 100644 index fa7d1bd..0000000 --- a/node_modules/tslib/LICENSE.txt +++ /dev/null @@ -1,12 +0,0 @@ -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. \ No newline at end of file diff --git a/node_modules/tslib/README.md b/node_modules/tslib/README.md deleted file mode 100644 index 14b9a83..0000000 --- a/node_modules/tslib/README.md +++ /dev/null @@ -1,164 +0,0 @@ -# tslib - -This is a runtime library for [TypeScript](https://www.typescriptlang.org/) that contains all of the TypeScript helper functions. - -This library is primarily used by the `--importHelpers` flag in TypeScript. -When using `--importHelpers`, a module that uses helper functions like `__extends` and `__assign` in the following emitted file: - -```ts -var __assign = (this && this.__assign) || Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; -}; -exports.x = {}; -exports.y = __assign({}, exports.x); - -``` - -will instead be emitted as something like the following: - -```ts -var tslib_1 = require("tslib"); -exports.x = {}; -exports.y = tslib_1.__assign({}, exports.x); -``` - -Because this can avoid duplicate declarations of things like `__extends`, `__assign`, etc., this means delivering users smaller files on average, as well as less runtime overhead. -For optimized bundles with TypeScript, you should absolutely consider using `tslib` and `--importHelpers`. - -# Installing - -For the latest stable version, run: - -## npm - -```sh -# TypeScript 3.9.2 or later -npm install tslib - -# TypeScript 3.8.4 or earlier -npm install tslib@^1 - -# TypeScript 2.3.2 or earlier -npm install tslib@1.6.1 -``` - -## yarn - -```sh -# TypeScript 3.9.2 or later -yarn add tslib - -# TypeScript 3.8.4 or earlier -yarn add tslib@^1 - -# TypeScript 2.3.2 or earlier -yarn add tslib@1.6.1 -``` - -## bower - -```sh -# TypeScript 3.9.2 or later -bower install tslib - -# TypeScript 3.8.4 or earlier -bower install tslib@^1 - -# TypeScript 2.3.2 or earlier -bower install tslib@1.6.1 -``` - -## JSPM - -```sh -# TypeScript 3.9.2 or later -jspm install tslib - -# TypeScript 3.8.4 or earlier -jspm install tslib@^1 - -# TypeScript 2.3.2 or earlier -jspm install tslib@1.6.1 -``` - -# Usage - -Set the `importHelpers` compiler option on the command line: - -``` -tsc --importHelpers file.ts -``` - -or in your tsconfig.json: - -```json -{ - "compilerOptions": { - "importHelpers": true - } -} -``` - -#### For bower and JSPM users - -You will need to add a `paths` mapping for `tslib`, e.g. For Bower users: - -```json -{ - "compilerOptions": { - "module": "amd", - "importHelpers": true, - "baseUrl": "./", - "paths": { - "tslib" : ["bower_components/tslib/tslib.d.ts"] - } - } -} -``` - -For JSPM users: - -```json -{ - "compilerOptions": { - "module": "system", - "importHelpers": true, - "baseUrl": "./", - "paths": { - "tslib" : ["jspm_packages/npm/tslib@2.x.y/tslib.d.ts"] - } - } -} -``` - -## Deployment - -- Choose your new version number -- Set it in `package.json` and `bower.json` -- Create a tag: `git tag [version]` -- Push the tag: `git push --tags` -- Create a [release in GitHub](https://github.com/microsoft/tslib/releases) -- Run the [publish to npm](https://github.com/microsoft/tslib/actions?query=workflow%3A%22Publish+to+NPM%22) workflow - -Done. - -# Contribute - -There are many ways to [contribute](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md) to TypeScript. - -* [Submit bugs](https://github.com/Microsoft/TypeScript/issues) and help us verify fixes as they are checked in. -* Review the [source code changes](https://github.com/Microsoft/TypeScript/pulls). -* Engage with other TypeScript users and developers on [StackOverflow](http://stackoverflow.com/questions/tagged/typescript). -* Join the [#typescript](http://twitter.com/#!/search/realtime/%23typescript) discussion on Twitter. -* [Contribute bug fixes](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md). - -# Documentation - -* [Quick tutorial](http://www.typescriptlang.org/Tutorial) -* [Programming handbook](http://www.typescriptlang.org/Handbook) -* [Homepage](http://www.typescriptlang.org/) diff --git a/node_modules/tslib/SECURITY.md b/node_modules/tslib/SECURITY.md deleted file mode 100644 index 869fdfe..0000000 --- a/node_modules/tslib/SECURITY.md +++ /dev/null @@ -1,41 +0,0 @@ - - -## Security - -Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/). - -If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/opensource/security/definition), please report it to us as described below. - -## Reporting Security Issues - -**Please do not report security vulnerabilities through public GitHub issues.** - -Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report). - -If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey). - -You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc). - -Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: - - * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) - * Full paths of source file(s) related to the manifestation of the issue - * The location of the affected source code (tag/branch/commit or direct URL) - * Any special configuration required to reproduce the issue - * Step-by-step instructions to reproduce the issue - * Proof-of-concept or exploit code (if possible) - * Impact of the issue, including how an attacker might exploit the issue - -This information will help us triage your report more quickly. - -If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/opensource/security/bounty) page for more details about our active programs. - -## Preferred Languages - -We prefer all communications to be in English. - -## Policy - -Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd). - - diff --git a/node_modules/tslib/modules/index.d.ts b/node_modules/tslib/modules/index.d.ts deleted file mode 100644 index 3244fab..0000000 --- a/node_modules/tslib/modules/index.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -// Note: named reexports are used instead of `export *` because -// TypeScript itself doesn't resolve the `export *` when checking -// if a particular helper exists. -export { - __extends, - __assign, - __rest, - __decorate, - __param, - __esDecorate, - __runInitializers, - __propKey, - __setFunctionName, - __metadata, - __awaiter, - __generator, - __exportStar, - __values, - __read, - __spread, - __spreadArrays, - __spreadArray, - __await, - __asyncGenerator, - __asyncDelegator, - __asyncValues, - __makeTemplateObject, - __importStar, - __importDefault, - __classPrivateFieldGet, - __classPrivateFieldSet, - __classPrivateFieldIn, - __createBinding, - __addDisposableResource, - __disposeResources, - __rewriteRelativeImportExtension, -} from '../tslib.js'; -export * as default from '../tslib.js'; diff --git a/node_modules/tslib/modules/index.js b/node_modules/tslib/modules/index.js deleted file mode 100644 index f4f9a06..0000000 --- a/node_modules/tslib/modules/index.js +++ /dev/null @@ -1,70 +0,0 @@ -import tslib from '../tslib.js'; -const { - __extends, - __assign, - __rest, - __decorate, - __param, - __esDecorate, - __runInitializers, - __propKey, - __setFunctionName, - __metadata, - __awaiter, - __generator, - __exportStar, - __createBinding, - __values, - __read, - __spread, - __spreadArrays, - __spreadArray, - __await, - __asyncGenerator, - __asyncDelegator, - __asyncValues, - __makeTemplateObject, - __importStar, - __importDefault, - __classPrivateFieldGet, - __classPrivateFieldSet, - __classPrivateFieldIn, - __addDisposableResource, - __disposeResources, - __rewriteRelativeImportExtension, -} = tslib; -export { - __extends, - __assign, - __rest, - __decorate, - __param, - __esDecorate, - __runInitializers, - __propKey, - __setFunctionName, - __metadata, - __awaiter, - __generator, - __exportStar, - __createBinding, - __values, - __read, - __spread, - __spreadArrays, - __spreadArray, - __await, - __asyncGenerator, - __asyncDelegator, - __asyncValues, - __makeTemplateObject, - __importStar, - __importDefault, - __classPrivateFieldGet, - __classPrivateFieldSet, - __classPrivateFieldIn, - __addDisposableResource, - __disposeResources, - __rewriteRelativeImportExtension, -}; -export default tslib; diff --git a/node_modules/tslib/modules/package.json b/node_modules/tslib/modules/package.json deleted file mode 100644 index 96ae6e5..0000000 --- a/node_modules/tslib/modules/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "type": "module" -} \ No newline at end of file diff --git a/node_modules/tslib/package.json b/node_modules/tslib/package.json deleted file mode 100644 index 57d0578..0000000 --- a/node_modules/tslib/package.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "tslib", - "author": "Microsoft Corp.", - "homepage": "https://www.typescriptlang.org/", - "version": "2.8.1", - "license": "0BSD", - "description": "Runtime library for TypeScript helper functions", - "keywords": [ - "TypeScript", - "Microsoft", - "compiler", - "language", - "javascript", - "tslib", - "runtime" - ], - "bugs": { - "url": "https://github.com/Microsoft/TypeScript/issues" - }, - "repository": { - "type": "git", - "url": "https://github.com/Microsoft/tslib.git" - }, - "main": "tslib.js", - "module": "tslib.es6.js", - "jsnext:main": "tslib.es6.js", - "typings": "tslib.d.ts", - "sideEffects": false, - "exports": { - ".": { - "module": { - "types": "./modules/index.d.ts", - "default": "./tslib.es6.mjs" - }, - "import": { - "node": "./modules/index.js", - "default": { - "types": "./modules/index.d.ts", - "default": "./tslib.es6.mjs" - } - }, - "default": "./tslib.js" - }, - "./*": "./*", - "./": "./" - } -} diff --git a/node_modules/tslib/tslib.d.ts b/node_modules/tslib/tslib.d.ts deleted file mode 100644 index 9c27e05..0000000 --- a/node_modules/tslib/tslib.d.ts +++ /dev/null @@ -1,460 +0,0 @@ -/****************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ - -/** - * Used to shim class extends. - * - * @param d The derived class. - * @param b The base class. - */ -export declare function __extends(d: Function, b: Function): void; - -/** - * Copy the values of all of the enumerable own properties from one or more source objects to a - * target object. Returns the target object. - * - * @param t The target object to copy to. - * @param sources One or more source objects from which to copy properties - */ -export declare function __assign(t: any, ...sources: any[]): any; - -/** - * Performs a rest spread on an object. - * - * @param t The source value. - * @param propertyNames The property names excluded from the rest spread. - */ -export declare function __rest(t: any, propertyNames: (string | symbol)[]): any; - -/** - * Applies decorators to a target object - * - * @param decorators The set of decorators to apply. - * @param target The target object. - * @param key If specified, the own property to apply the decorators to. - * @param desc The property descriptor, defaults to fetching the descriptor from the target object. - * @experimental - */ -export declare function __decorate(decorators: Function[], target: any, key?: string | symbol, desc?: any): any; - -/** - * Creates an observing function decorator from a parameter decorator. - * - * @param paramIndex The parameter index to apply the decorator to. - * @param decorator The parameter decorator to apply. Note that the return value is ignored. - * @experimental - */ -export declare function __param(paramIndex: number, decorator: Function): Function; - -/** - * Applies decorators to a class or class member, following the native ECMAScript decorator specification. - * @param ctor For non-field class members, the class constructor. Otherwise, `null`. - * @param descriptorIn The `PropertyDescriptor` to use when unable to look up the property from `ctor`. - * @param decorators The decorators to apply - * @param contextIn The `DecoratorContext` to clone for each decorator application. - * @param initializers An array of field initializer mutation functions into which new initializers are written. - * @param extraInitializers An array of extra initializer functions into which new initializers are written. - */ -export declare function __esDecorate(ctor: Function | null, descriptorIn: object | null, decorators: Function[], contextIn: object, initializers: Function[] | null, extraInitializers: Function[]): void; - -/** - * Runs field initializers or extra initializers generated by `__esDecorate`. - * @param thisArg The `this` argument to use. - * @param initializers The array of initializers to evaluate. - * @param value The initial value to pass to the initializers. - */ -export declare function __runInitializers(thisArg: unknown, initializers: Function[], value?: any): any; - -/** - * Converts a computed property name into a `string` or `symbol` value. - */ -export declare function __propKey(x: any): string | symbol; - -/** - * Assigns the name of a function derived from the left-hand side of an assignment. - * @param f The function to rename. - * @param name The new name for the function. - * @param prefix A prefix (such as `"get"` or `"set"`) to insert before the name. - */ -export declare function __setFunctionName(f: Function, name: string | symbol, prefix?: string): Function; - -/** - * Creates a decorator that sets metadata. - * - * @param metadataKey The metadata key - * @param metadataValue The metadata value - * @experimental - */ -export declare function __metadata(metadataKey: any, metadataValue: any): Function; - -/** - * Converts a generator function into a pseudo-async function, by treating each `yield` as an `await`. - * - * @param thisArg The reference to use as the `this` value in the generator function - * @param _arguments The optional arguments array - * @param P The optional promise constructor argument, defaults to the `Promise` property of the global object. - * @param generator The generator function - */ -export declare function __awaiter(thisArg: any, _arguments: any, P: Function, generator: Function): any; - -/** - * Creates an Iterator object using the body as the implementation. - * - * @param thisArg The reference to use as the `this` value in the function - * @param body The generator state-machine based implementation. - * - * @see [./docs/generator.md] - */ -export declare function __generator(thisArg: any, body: Function): any; - -/** - * Creates bindings for all enumerable properties of `m` on `exports` - * - * @param m The source object - * @param o The `exports` object. - */ -export declare function __exportStar(m: any, o: any): void; - -/** - * Creates a value iterator from an `Iterable` or `ArrayLike` object. - * - * @param o The object. - * @throws {TypeError} If `o` is neither `Iterable`, nor an `ArrayLike`. - */ -export declare function __values(o: any): any; - -/** - * Reads values from an `Iterable` or `ArrayLike` object and returns the resulting array. - * - * @param o The object to read from. - * @param n The maximum number of arguments to read, defaults to `Infinity`. - */ -export declare function __read(o: any, n?: number): any[]; - -/** - * Creates an array from iterable spread. - * - * @param args The Iterable objects to spread. - * @deprecated since TypeScript 4.2 - Use `__spreadArray` - */ -export declare function __spread(...args: any[][]): any[]; - -/** - * Creates an array from array spread. - * - * @param args The ArrayLikes to spread into the resulting array. - * @deprecated since TypeScript 4.2 - Use `__spreadArray` - */ -export declare function __spreadArrays(...args: any[][]): any[]; - -/** - * Spreads the `from` array into the `to` array. - * - * @param pack Replace empty elements with `undefined`. - */ -export declare function __spreadArray(to: any[], from: any[], pack?: boolean): any[]; - -/** - * Creates an object that signals to `__asyncGenerator` that it shouldn't be yielded, - * and instead should be awaited and the resulting value passed back to the generator. - * - * @param v The value to await. - */ -export declare function __await(v: any): any; - -/** - * Converts a generator function into an async generator function, by using `yield __await` - * in place of normal `await`. - * - * @param thisArg The reference to use as the `this` value in the generator function - * @param _arguments The optional arguments array - * @param generator The generator function - */ -export declare function __asyncGenerator(thisArg: any, _arguments: any, generator: Function): any; - -/** - * Used to wrap a potentially async iterator in such a way so that it wraps the result - * of calling iterator methods of `o` in `__await` instances, and then yields the awaited values. - * - * @param o The potentially async iterator. - * @returns A synchronous iterator yielding `__await` instances on every odd invocation - * and returning the awaited `IteratorResult` passed to `next` every even invocation. - */ -export declare function __asyncDelegator(o: any): any; - -/** - * Creates a value async iterator from an `AsyncIterable`, `Iterable` or `ArrayLike` object. - * - * @param o The object. - * @throws {TypeError} If `o` is neither `AsyncIterable`, `Iterable`, nor an `ArrayLike`. - */ -export declare function __asyncValues(o: any): any; - -/** - * Creates a `TemplateStringsArray` frozen object from the `cooked` and `raw` arrays. - * - * @param cooked The cooked possibly-sparse array. - * @param raw The raw string content. - */ -export declare function __makeTemplateObject(cooked: string[], raw: string[]): TemplateStringsArray; - -/** - * Used to shim default and named imports in ECMAScript Modules transpiled to CommonJS. - * - * ```js - * import Default, { Named, Other } from "mod"; - * // or - * import { default as Default, Named, Other } from "mod"; - * ``` - * - * @param mod The CommonJS module exports object. - */ -export declare function __importStar(mod: T): T; - -/** - * Used to shim default imports in ECMAScript Modules transpiled to CommonJS. - * - * ```js - * import Default from "mod"; - * ``` - * - * @param mod The CommonJS module exports object. - */ -export declare function __importDefault(mod: T): T | { default: T }; - -/** - * Emulates reading a private instance field. - * - * @param receiver The instance from which to read the private field. - * @param state A WeakMap containing the private field value for an instance. - * @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method. - * - * @throws {TypeError} If `state` doesn't have an entry for `receiver`. - */ -export declare function __classPrivateFieldGet( - receiver: T, - state: { has(o: T): boolean, get(o: T): V | undefined }, - kind?: "f" -): V; - -/** - * Emulates reading a private static field. - * - * @param receiver The object from which to read the private static field. - * @param state The class constructor containing the definition of the static field. - * @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method. - * @param f The descriptor that holds the static field value. - * - * @throws {TypeError} If `receiver` is not `state`. - */ -export declare function __classPrivateFieldGet unknown, V>( - receiver: T, - state: T, - kind: "f", - f: { value: V } -): V; - -/** - * Emulates evaluating a private instance "get" accessor. - * - * @param receiver The instance on which to evaluate the private "get" accessor. - * @param state A WeakSet used to verify an instance supports the private "get" accessor. - * @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method. - * @param f The "get" accessor function to evaluate. - * - * @throws {TypeError} If `state` doesn't have an entry for `receiver`. - */ -export declare function __classPrivateFieldGet( - receiver: T, - state: { has(o: T): boolean }, - kind: "a", - f: () => V -): V; - -/** - * Emulates evaluating a private static "get" accessor. - * - * @param receiver The object on which to evaluate the private static "get" accessor. - * @param state The class constructor containing the definition of the static "get" accessor. - * @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method. - * @param f The "get" accessor function to evaluate. - * - * @throws {TypeError} If `receiver` is not `state`. - */ -export declare function __classPrivateFieldGet unknown, V>( - receiver: T, - state: T, - kind: "a", - f: () => V -): V; - -/** - * Emulates reading a private instance method. - * - * @param receiver The instance from which to read a private method. - * @param state A WeakSet used to verify an instance supports the private method. - * @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method. - * @param f The function to return as the private instance method. - * - * @throws {TypeError} If `state` doesn't have an entry for `receiver`. - */ -export declare function __classPrivateFieldGet unknown>( - receiver: T, - state: { has(o: T): boolean }, - kind: "m", - f: V -): V; - -/** - * Emulates reading a private static method. - * - * @param receiver The object from which to read the private static method. - * @param state The class constructor containing the definition of the static method. - * @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method. - * @param f The function to return as the private static method. - * - * @throws {TypeError} If `receiver` is not `state`. - */ -export declare function __classPrivateFieldGet unknown, V extends (...args: any[]) => unknown>( - receiver: T, - state: T, - kind: "m", - f: V -): V; - -/** - * Emulates writing to a private instance field. - * - * @param receiver The instance on which to set a private field value. - * @param state A WeakMap used to store the private field value for an instance. - * @param value The value to store in the private field. - * @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method. - * - * @throws {TypeError} If `state` doesn't have an entry for `receiver`. - */ -export declare function __classPrivateFieldSet( - receiver: T, - state: { has(o: T): boolean, set(o: T, value: V): unknown }, - value: V, - kind?: "f" -): V; - -/** - * Emulates writing to a private static field. - * - * @param receiver The object on which to set the private static field. - * @param state The class constructor containing the definition of the private static field. - * @param value The value to store in the private field. - * @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method. - * @param f The descriptor that holds the static field value. - * - * @throws {TypeError} If `receiver` is not `state`. - */ -export declare function __classPrivateFieldSet unknown, V>( - receiver: T, - state: T, - value: V, - kind: "f", - f: { value: V } -): V; - -/** - * Emulates writing to a private instance "set" accessor. - * - * @param receiver The instance on which to evaluate the private instance "set" accessor. - * @param state A WeakSet used to verify an instance supports the private "set" accessor. - * @param value The value to store in the private accessor. - * @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method. - * @param f The "set" accessor function to evaluate. - * - * @throws {TypeError} If `state` doesn't have an entry for `receiver`. - */ -export declare function __classPrivateFieldSet( - receiver: T, - state: { has(o: T): boolean }, - value: V, - kind: "a", - f: (v: V) => void -): V; - -/** - * Emulates writing to a private static "set" accessor. - * - * @param receiver The object on which to evaluate the private static "set" accessor. - * @param state The class constructor containing the definition of the static "set" accessor. - * @param value The value to store in the private field. - * @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method. - * @param f The "set" accessor function to evaluate. - * - * @throws {TypeError} If `receiver` is not `state`. - */ -export declare function __classPrivateFieldSet unknown, V>( - receiver: T, - state: T, - value: V, - kind: "a", - f: (v: V) => void -): V; - -/** - * Checks for the existence of a private field/method/accessor. - * - * @param state The class constructor containing the static member, or the WeakMap or WeakSet associated with a private instance member. - * @param receiver The object for which to test the presence of the private member. - */ -export declare function __classPrivateFieldIn( - state: (new (...args: any[]) => unknown) | { has(o: any): boolean }, - receiver: unknown, -): boolean; - -/** - * Creates a re-export binding on `object` with key `objectKey` that references `target[key]`. - * - * @param object The local `exports` object. - * @param target The object to re-export from. - * @param key The property key of `target` to re-export. - * @param objectKey The property key to re-export as. Defaults to `key`. - */ -export declare function __createBinding(object: object, target: object, key: PropertyKey, objectKey?: PropertyKey): void; - -/** - * Adds a disposable resource to a resource-tracking environment object. - * @param env A resource-tracking environment object. - * @param value Either a Disposable or AsyncDisposable object, `null`, or `undefined`. - * @param async When `true`, `AsyncDisposable` resources can be added. When `false`, `AsyncDisposable` resources cannot be added. - * @returns The {@link value} argument. - * - * @throws {TypeError} If {@link value} is not an object, or if either `Symbol.dispose` or `Symbol.asyncDispose` are not - * defined, or if {@link value} does not have an appropriate `Symbol.dispose` or `Symbol.asyncDispose` method. - */ -export declare function __addDisposableResource(env: { stack: { value?: unknown, dispose?: Function, async: boolean }[]; error: unknown; hasError: boolean; }, value: T, async: boolean): T; - -/** - * Disposes all resources in a resource-tracking environment object. - * @param env A resource-tracking environment object. - * @returns A {@link Promise} if any resources in the environment were marked as `async` when added; otherwise, `void`. - * - * @throws {SuppressedError} if an error thrown during disposal would have suppressed a prior error from disposal or the - * error recorded in the resource-tracking environment object. - * @seealso {@link __addDisposableResource} - */ -export declare function __disposeResources(env: { stack: { value?: unknown, dispose?: Function, async: boolean }[]; error: unknown; hasError: boolean; }): any; - -/** - * Transforms a relative import specifier ending in a non-declaration TypeScript file extension to its JavaScript file extension counterpart. - * @param path The import specifier. - * @param preserveJsx Causes '*.tsx' to transform to '*.jsx' instead of '*.js'. Should be true when `--jsx` is set to `preserve`. - */ -export declare function __rewriteRelativeImportExtension(path: string, preserveJsx?: boolean): string; \ No newline at end of file diff --git a/node_modules/tslib/tslib.es6.html b/node_modules/tslib/tslib.es6.html deleted file mode 100644 index b122e41..0000000 --- a/node_modules/tslib/tslib.es6.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/node_modules/tslib/tslib.es6.js b/node_modules/tslib/tslib.es6.js deleted file mode 100644 index 67ba5c5..0000000 --- a/node_modules/tslib/tslib.es6.js +++ /dev/null @@ -1,402 +0,0 @@ -/****************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global Reflect, Promise, SuppressedError, Symbol, Iterator */ - -var extendStatics = function(d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); -}; - -export function __extends(d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -} - -export var __assign = function() { - __assign = Object.assign || function __assign(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - } - return __assign.apply(this, arguments); -} - -export function __rest(s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; -} - -export function __decorate(decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -} - -export function __param(paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -} - -export function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; -}; - -export function __runInitializers(thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; -}; - -export function __propKey(x) { - return typeof x === "symbol" ? x : "".concat(x); -}; - -export function __setFunctionName(f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); -}; - -export function __metadata(metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); -} - -export function __awaiter(thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} - -export function __generator(thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); - return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -} - -export var __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -}); - -export function __exportStar(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); -} - -export function __values(o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); -} - -export function __read(o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; -} - -/** @deprecated */ -export function __spread() { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; -} - -/** @deprecated */ -export function __spreadArrays() { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; -} - -export function __spreadArray(to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); -} - -export function __await(v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); -} - -export function __asyncGenerator(thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i; - function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; } - function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } -} - -export function __asyncDelegator(o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } -} - -export function __asyncValues(o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } -} - -export function __makeTemplateObject(cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; -}; - -var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}; - -var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function (o) { - var ar = []; - for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); -}; - -export function __importStar(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - __setModuleDefault(result, mod); - return result; -} - -export function __importDefault(mod) { - return (mod && mod.__esModule) ? mod : { default: mod }; -} - -export function __classPrivateFieldGet(receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); -} - -export function __classPrivateFieldSet(receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; -} - -export function __classPrivateFieldIn(state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); -} - -export function __addDisposableResource(env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose, inner; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - if (async) inner = dispose; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } }; - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; - -} - -var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; -}; - -export function __disposeResources(env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - var r, s = 0; - function next() { - while (r = env.stack.pop()) { - try { - if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next); - if (r.dispose) { - var result = r.dispose.call(r.value); - if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - else s |= 1; - } - catch (e) { - fail(e); - } - } - if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); - if (env.hasError) throw env.error; - } - return next(); -} - -export function __rewriteRelativeImportExtension(path, preserveJsx) { - if (typeof path === "string" && /^\.\.?\//.test(path)) { - return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) { - return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js"); - }); - } - return path; -} - -export default { - __extends: __extends, - __assign: __assign, - __rest: __rest, - __decorate: __decorate, - __param: __param, - __esDecorate: __esDecorate, - __runInitializers: __runInitializers, - __propKey: __propKey, - __setFunctionName: __setFunctionName, - __metadata: __metadata, - __awaiter: __awaiter, - __generator: __generator, - __createBinding: __createBinding, - __exportStar: __exportStar, - __values: __values, - __read: __read, - __spread: __spread, - __spreadArrays: __spreadArrays, - __spreadArray: __spreadArray, - __await: __await, - __asyncGenerator: __asyncGenerator, - __asyncDelegator: __asyncDelegator, - __asyncValues: __asyncValues, - __makeTemplateObject: __makeTemplateObject, - __importStar: __importStar, - __importDefault: __importDefault, - __classPrivateFieldGet: __classPrivateFieldGet, - __classPrivateFieldSet: __classPrivateFieldSet, - __classPrivateFieldIn: __classPrivateFieldIn, - __addDisposableResource: __addDisposableResource, - __disposeResources: __disposeResources, - __rewriteRelativeImportExtension: __rewriteRelativeImportExtension, -}; diff --git a/node_modules/tslib/tslib.es6.mjs b/node_modules/tslib/tslib.es6.mjs deleted file mode 100644 index c17990a..0000000 --- a/node_modules/tslib/tslib.es6.mjs +++ /dev/null @@ -1,401 +0,0 @@ -/****************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global Reflect, Promise, SuppressedError, Symbol, Iterator */ - -var extendStatics = function(d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); -}; - -export function __extends(d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -} - -export var __assign = function() { - __assign = Object.assign || function __assign(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - } - return __assign.apply(this, arguments); -} - -export function __rest(s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; -} - -export function __decorate(decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -} - -export function __param(paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -} - -export function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; -}; - -export function __runInitializers(thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; -}; - -export function __propKey(x) { - return typeof x === "symbol" ? x : "".concat(x); -}; - -export function __setFunctionName(f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); -}; - -export function __metadata(metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); -} - -export function __awaiter(thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} - -export function __generator(thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); - return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -} - -export var __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -}); - -export function __exportStar(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); -} - -export function __values(o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); -} - -export function __read(o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; -} - -/** @deprecated */ -export function __spread() { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; -} - -/** @deprecated */ -export function __spreadArrays() { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; -} - -export function __spreadArray(to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); -} - -export function __await(v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); -} - -export function __asyncGenerator(thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i; - function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; } - function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } -} - -export function __asyncDelegator(o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } -} - -export function __asyncValues(o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } -} - -export function __makeTemplateObject(cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; -}; - -var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}; - -var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function (o) { - var ar = []; - for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); -}; - -export function __importStar(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - __setModuleDefault(result, mod); - return result; -} - -export function __importDefault(mod) { - return (mod && mod.__esModule) ? mod : { default: mod }; -} - -export function __classPrivateFieldGet(receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); -} - -export function __classPrivateFieldSet(receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; -} - -export function __classPrivateFieldIn(state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); -} - -export function __addDisposableResource(env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose, inner; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - if (async) inner = dispose; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } }; - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; -} - -var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; -}; - -export function __disposeResources(env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - var r, s = 0; - function next() { - while (r = env.stack.pop()) { - try { - if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next); - if (r.dispose) { - var result = r.dispose.call(r.value); - if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - else s |= 1; - } - catch (e) { - fail(e); - } - } - if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); - if (env.hasError) throw env.error; - } - return next(); -} - -export function __rewriteRelativeImportExtension(path, preserveJsx) { - if (typeof path === "string" && /^\.\.?\//.test(path)) { - return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) { - return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js"); - }); - } - return path; -} - -export default { - __extends, - __assign, - __rest, - __decorate, - __param, - __esDecorate, - __runInitializers, - __propKey, - __setFunctionName, - __metadata, - __awaiter, - __generator, - __createBinding, - __exportStar, - __values, - __read, - __spread, - __spreadArrays, - __spreadArray, - __await, - __asyncGenerator, - __asyncDelegator, - __asyncValues, - __makeTemplateObject, - __importStar, - __importDefault, - __classPrivateFieldGet, - __classPrivateFieldSet, - __classPrivateFieldIn, - __addDisposableResource, - __disposeResources, - __rewriteRelativeImportExtension, -}; diff --git a/node_modules/tslib/tslib.html b/node_modules/tslib/tslib.html deleted file mode 100644 index 44c9ba5..0000000 --- a/node_modules/tslib/tslib.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/node_modules/tslib/tslib.js b/node_modules/tslib/tslib.js deleted file mode 100644 index b6509f7..0000000 --- a/node_modules/tslib/tslib.js +++ /dev/null @@ -1,484 +0,0 @@ -/****************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, Symbol, Reflect, Promise, SuppressedError, Iterator */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __esDecorate; -var __runInitializers; -var __propKey; -var __setFunctionName; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -var __addDisposableResource; -var __disposeResources; -var __rewriteRelativeImportExtension; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if (typeof module === "object" && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); - } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; - } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; - - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; - - __esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; - }; - - __runInitializers = function (thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; - }; - - __propKey = function (x) { - return typeof x === "symbol" ? x : "".concat(x); - }; - - __setFunctionName = function (f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); - }; - - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; - - __awaiter = function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); - return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; - - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; - - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); - - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; - - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; - - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; - - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; - - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; - - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i; - function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; } - function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; - - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } - }; - - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; - - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; - - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function (o) { - var ar = []; - for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - __setModuleDefault(result, mod); - return result; - }; - - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; - - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; - - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; - - __addDisposableResource = function (env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose, inner; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - if (async) inner = dispose; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } }; - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; - }; - - var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; - }; - - __disposeResources = function (env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - var r, s = 0; - function next() { - while (r = env.stack.pop()) { - try { - if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next); - if (r.dispose) { - var result = r.dispose.call(r.value); - if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - else s |= 1; - } - catch (e) { - fail(e); - } - } - if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); - if (env.hasError) throw env.error; - } - return next(); - }; - - __rewriteRelativeImportExtension = function (path, preserveJsx) { - if (typeof path === "string" && /^\.\.?\//.test(path)) { - return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) { - return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js"); - }); - } - return path; - }; - - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__esDecorate", __esDecorate); - exporter("__runInitializers", __runInitializers); - exporter("__propKey", __propKey); - exporter("__setFunctionName", __setFunctionName); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); - exporter("__addDisposableResource", __addDisposableResource); - exporter("__disposeResources", __disposeResources); - exporter("__rewriteRelativeImportExtension", __rewriteRelativeImportExtension); -}); - -0 && (module.exports = { - __extends: __extends, - __assign: __assign, - __rest: __rest, - __decorate: __decorate, - __param: __param, - __esDecorate: __esDecorate, - __runInitializers: __runInitializers, - __propKey: __propKey, - __setFunctionName: __setFunctionName, - __metadata: __metadata, - __awaiter: __awaiter, - __generator: __generator, - __exportStar: __exportStar, - __createBinding: __createBinding, - __values: __values, - __read: __read, - __spread: __spread, - __spreadArrays: __spreadArrays, - __spreadArray: __spreadArray, - __await: __await, - __asyncGenerator: __asyncGenerator, - __asyncDelegator: __asyncDelegator, - __asyncValues: __asyncValues, - __makeTemplateObject: __makeTemplateObject, - __importStar: __importStar, - __importDefault: __importDefault, - __classPrivateFieldGet: __classPrivateFieldGet, - __classPrivateFieldSet: __classPrivateFieldSet, - __classPrivateFieldIn: __classPrivateFieldIn, - __addDisposableResource: __addDisposableResource, - __disposeResources: __disposeResources, - __rewriteRelativeImportExtension: __rewriteRelativeImportExtension, -}); From 20308777da1854085516fd7d8645c1e6fa7389da Mon Sep 17 00:00:00 2001 From: Aniketh Galla Date: Thu, 13 Aug 2026 23:32:57 +0530 Subject: [PATCH 3/5] Fix lockfile for Vercel deployment --- devjams/package-lock.json | 90 +- devjams/pnpm-lock.yaml | 4237 ------------------------------------- 2 files changed, 87 insertions(+), 4240 deletions(-) delete mode 100644 devjams/pnpm-lock.yaml diff --git a/devjams/package-lock.json b/devjams/package-lock.json index f6cfd1e..72ecbe5 100644 --- a/devjams/package-lock.json +++ b/devjams/package-lock.json @@ -8,6 +8,7 @@ "name": "devjams", "version": "0.1.0", "dependencies": { + "motion": "^13.0.0", "next": "16.3.0", "react": "19.2.8", "react-dom": "19.2.8" @@ -279,9 +280,9 @@ } }, "node_modules/@emnapi/wasi-threads": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.2.1.tgz", - "integrity": "sha512-uTII7OYF+/Mes/MrcIOYp5yOtSMLBWSIoLPpcgwipoiKbli6k322tcoFsxoIIxPDqW01SQGAgko4EzZi2BNv2w==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.2.3.tgz", + "integrity": "sha512-ELEBe8PsLvvJ6QMr0zLt8ffvOHW/dc1m3CEzNMg7aJUv3bMaoDtw2TXyDAwkYBuroxxuHEwhRTLJSe5sya547g==", "dev": true, "license": "MIT", "optional": true, @@ -2214,6 +2215,18 @@ "node": ">=14.0.0" } }, + "node_modules/@unrs/resolver-binding-wasm32-wasi/node_modules/@emnapi/core": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.10.0.tgz", + "integrity": "sha512-yq6OkJ4p82CAfPl0u9mQebQHKPJkY7WrIuk205cTYnYe+k2Z8YBh11FrbRG/H6ihirqcacOgl2BIO8oyMQLeXw==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/wasi-threads": "1.2.1", + "tslib": "^2.4.0" + } + }, "node_modules/@unrs/resolver-binding-wasm32-wasi/node_modules/@emnapi/runtime": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.10.0.tgz", @@ -2225,6 +2238,17 @@ "tslib": "^2.4.0" } }, + "node_modules/@unrs/resolver-binding-wasm32-wasi/node_modules/@emnapi/wasi-threads": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.2.1.tgz", + "integrity": "sha512-uTII7OYF+/Mes/MrcIOYp5yOtSMLBWSIoLPpcgwipoiKbli6k322tcoFsxoIIxPDqW01SQGAgko4EzZi2BNv2w==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, "node_modules/@unrs/resolver-binding-win32-arm64-msvc": { "version": "1.12.2", "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-win32-arm64-msvc/-/resolver-binding-win32-arm64-msvc-1.12.2.tgz", @@ -3750,6 +3774,29 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/framer-motion": { + "version": "13.1.0", + "resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-13.1.0.tgz", + "integrity": "sha512-QSZrF0Id3QGuHJ+OL+9PSY9pk86C8ERFalwAGSchzTm65+ZoGH/RM26lmEARLljcHj2lqhv0jZOOks+EI3COOw==", + "license": "MIT", + "dependencies": { + "motion-dom": "^13.0.0", + "motion-utils": "^13.0.0", + "tslib": "^2.4.0" + }, + "peerDependencies": { + "react": "^18.0.0 || ^19.0.0", + "react-dom": "^18.0.0 || ^19.0.0" + }, + "peerDependenciesMeta": { + "react": { + "optional": true + }, + "react-dom": { + "optional": true + } + } + }, "node_modules/function-bind": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", @@ -5094,6 +5141,43 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/motion": { + "version": "13.1.0", + "resolved": "https://registry.npmjs.org/motion/-/motion-13.1.0.tgz", + "integrity": "sha512-qtvscq59uCPdWnNW4SdSkrxR+BS/QYsa923bx7ocA+4p+ZGNbbVQwkSnG4aukB81QWjtl3AxX36plxNyZLmHCA==", + "license": "MIT", + "dependencies": { + "framer-motion": "^13.1.0", + "tslib": "^2.4.0" + }, + "peerDependencies": { + "react": "^18.0.0 || ^19.0.0", + "react-dom": "^18.0.0 || ^19.0.0" + }, + "peerDependenciesMeta": { + "react": { + "optional": true + }, + "react-dom": { + "optional": true + } + } + }, + "node_modules/motion-dom": { + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/motion-dom/-/motion-dom-13.0.0.tgz", + "integrity": "sha512-Xk+SJas70uMAUIApg+m3lZDShxI3LBFHq7mFGbBKoRXc2PVPDyAKmzN64Bbzt4CZdP/CItTiJxWtn4TA0v53Ng==", + "license": "MIT", + "dependencies": { + "motion-utils": "^13.0.0" + } + }, + "node_modules/motion-utils": { + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/motion-utils/-/motion-utils-13.0.0.tgz", + "integrity": "sha512-7DnN7TmbLcYXcG4RVadXIihWlyuM9afoUww8Y5Agg431kGKiuL2/OMyP4mJ5wLz+pvN3t5ySClLOaVXJ+wekRQ==", + "license": "MIT" + }, "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", diff --git a/devjams/pnpm-lock.yaml b/devjams/pnpm-lock.yaml deleted file mode 100644 index 3d9a7ab..0000000 --- a/devjams/pnpm-lock.yaml +++ /dev/null @@ -1,4237 +0,0 @@ -lockfileVersion: '9.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -importers: - - .: - dependencies: - motion: - specifier: ^13.0.0 - version: 13.0.0(react-dom@19.2.8(react@19.2.8))(react@19.2.8) - next: - specifier: 16.3.0 - version: 16.3.0(@babel/core@7.29.7)(@types/node@20.19.43)(react-dom@19.2.8(react@19.2.8))(react@19.2.8) - react: - specifier: 19.2.8 - version: 19.2.8 - react-dom: - specifier: 19.2.8 - version: 19.2.8(react@19.2.8) - devDependencies: - '@tailwindcss/postcss': - specifier: ^4 - version: 4.3.3 - '@types/node': - specifier: ^20 - version: 20.19.43 - '@types/react': - specifier: ^19 - version: 19.2.18 - '@types/react-dom': - specifier: ^19 - version: 19.2.4(@types/react@19.2.18) - eslint: - specifier: ^9 - version: 9.39.5(jiti@2.7.0) - eslint-config-next: - specifier: 16.3.0 - version: 16.3.0(@typescript-eslint/parser@8.66.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3))(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3) - tailwindcss: - specifier: ^4 - version: 4.3.3 - typescript: - specifier: ^5 - version: 5.9.3 - -packages: - - '@alloc/quick-lru@5.2.0': - resolution: {integrity: sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==} - engines: {node: '>=10'} - - '@babel/code-frame@7.29.7': - resolution: {integrity: sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw==} - engines: {node: '>=6.9.0'} - - '@babel/compat-data@7.29.7': - resolution: {integrity: sha512-locTkQyKvwIEgBzVrn8693ebc97F2U8ZHjbXwDXJ5Fn2TCpNwTlKcaKLkdHop5c/icOFE7qt7Q9JC5hnKNa6Gg==} - engines: {node: '>=6.9.0'} - - '@babel/core@7.29.7': - resolution: {integrity: sha512-RgHBCvtjbOK2gXSNBNIkNoEc9qoVEtau3hj8gEqKQuL3HZAibKarWFEI3Lfm6EYKkLalOh8eSrj9b+ch9H/VBA==} - engines: {node: '>=6.9.0'} - - '@babel/generator@7.29.8': - resolution: {integrity: sha512-gZbepsdh3WDtgZKWL+vTPh71LSBrm/Y4/QDZBVCcYfmeTEEuoOYwlSy+G1StfJg+/Zy550u/3TATbm7qDbbMtg==} - engines: {node: '>=6.9.0'} - - '@babel/helper-compilation-targets@7.29.7': - resolution: {integrity: sha512-wem6WaBj4NaVYVdNhLPPVacES6ZJ+KBBfSkTMD3YZxbP3rm3Di85tJU5ljaUNhaOynt+Aj0xruhYuzQBt8n71g==} - engines: {node: '>=6.9.0'} - - '@babel/helper-globals@7.29.7': - resolution: {integrity: sha512-3nQVUAtvkKH9zahfWgw96Jc/uFOmjACE1kQz82E2lqWmHBgjzbNlsC22nuQTfahmWeQtTq5nQ/4Nnd2A1wj4zA==} - engines: {node: '>=6.9.0'} - - '@babel/helper-module-imports@7.29.7': - resolution: {integrity: sha512-ejHwrQQYcm9xnTivShn2IDOlIzInN34AXskvq9QicvCtEzq1Vzclu/tKF8Jq1Cg8JG2GL6/EmjgsCT7lXepE3g==} - engines: {node: '>=6.9.0'} - - '@babel/helper-module-transforms@7.29.7': - resolution: {integrity: sha512-UPUVSyXbOh627KiCIGQSgwWzGeBKLkaJ9PJEdrngIwMSzxLR4jS4+f1f1jb7VzBbg8nFLaYotvVPFCTqdrmTAg==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0 - - '@babel/helper-string-parser@7.29.7': - resolution: {integrity: sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw==} - engines: {node: '>=6.9.0'} - - '@babel/helper-validator-identifier@7.29.7': - resolution: {integrity: sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==} - engines: {node: '>=6.9.0'} - - '@babel/helper-validator-option@7.29.7': - resolution: {integrity: sha512-N9ZErrD+yW5geCDtBqnOoxmR8+tNKiGuxKlDpuJxfsqpa2dFcexaziGAE/qoHLiDDreVNMupxGmSoNlyvsA3gw==} - engines: {node: '>=6.9.0'} - - '@babel/helpers@7.29.7': - resolution: {integrity: sha512-1k2lAGRMfHTcwuNYcCNUmaUffmQv8KWMfh2iJUUeRlwlwH4FdNG7mfPI10NPfLHJFThE4Tyr4mv7kTNZOiPuBg==} - engines: {node: '>=6.9.0'} - - '@babel/parser@7.29.8': - resolution: {integrity: sha512-E8lTAYNB1KW+FH+VGJuZM1ioAx2E6oVlvQFRrf5P8ZZmsiJXYAD9vTFV7yyEURNzgh1dFqMZuO6tUwcARbqFCA==} - engines: {node: '>=6.0.0'} - hasBin: true - - '@babel/template@7.29.7': - resolution: {integrity: sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg==} - engines: {node: '>=6.9.0'} - - '@babel/traverse@7.29.8': - resolution: {integrity: sha512-I5z7H3bf/41ktsNVLtpN0wAa336HkqIHQ5BuPLEhTkt1jVSyZpeNKIzTgEWmlxjdg81R0IgUCcaE+Ok3NvrfZg==} - engines: {node: '>=6.9.0'} - - '@babel/types@7.29.8': - resolution: {integrity: sha512-Vj1jF3cPfxg7OAfoI7QnVKLoILlm2JF9pnVHrX8qx7AHMiYWT+NDAA7jChlNgRS4WTLc/fD1lXLmPixluj+3Gg==} - engines: {node: '>=6.9.0'} - - '@emnapi/core@1.10.0': - resolution: {integrity: sha512-yq6OkJ4p82CAfPl0u9mQebQHKPJkY7WrIuk205cTYnYe+k2Z8YBh11FrbRG/H6ihirqcacOgl2BIO8oyMQLeXw==} - - '@emnapi/runtime@1.10.0': - resolution: {integrity: sha512-ewvYlk86xUoGI0zQRNq/mC+16R1QeDlKQy21Ki3oSYXNgLb45GV1P6A0M+/s6nyCuNDqe5VpaY84BzXGwVbwFA==} - - '@emnapi/runtime@1.11.3': - resolution: {integrity: sha512-Xz4Tpyki7XyrpbUK1jR1AhdAdaXyhhY4lZ3neLodmhpuWfy2PAQN5B46sAiU4liOXGLkHypn/qU+jvfWSCYYLA==} - - '@emnapi/wasi-threads@1.2.1': - resolution: {integrity: sha512-uTII7OYF+/Mes/MrcIOYp5yOtSMLBWSIoLPpcgwipoiKbli6k322tcoFsxoIIxPDqW01SQGAgko4EzZi2BNv2w==} - - '@eslint-community/eslint-utils@4.10.1': - resolution: {integrity: sha512-cuadcxVFE8sDK6iWJbs8Sn0av2Nrh2QSGQhVlBW9AaAHqHwjWsZHT8LJ4hFGPh7ASBV2deFdM7H/DPjulmh8rg==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 - - '@eslint-community/eslint-utils@4.9.1': - resolution: {integrity: sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 - - '@eslint-community/regexpp@4.12.2': - resolution: {integrity: sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==} - engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} - - '@eslint/config-array@0.21.2': - resolution: {integrity: sha512-nJl2KGTlrf9GjLimgIru+V/mzgSK0ABCDQRvxw5BjURL7WfH5uoWmizbH7QB6MmnMBd8cIC9uceWnezL1VZWWw==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - - '@eslint/config-helpers@0.4.2': - resolution: {integrity: sha512-gBrxN88gOIf3R7ja5K9slwNayVcZgK6SOUORm2uBzTeIEfeVaIhOpCtTox3P6R7o2jLFwLFTLnC7kU/RGcYEgw==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - - '@eslint/core@0.17.0': - resolution: {integrity: sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - - '@eslint/eslintrc@3.3.6': - resolution: {integrity: sha512-l2Ul9PrHsPCKcEY/ac7VgFj9D80C7S68sOKc618SyHDPK36s1XcFebXY0iTzUVn4Yq+YbwvSnDmCz9yxjX+QrA==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - - '@eslint/js@9.39.5': - resolution: {integrity: sha512-QywQuszQh77pIXCsq998c8hbhSTI/azTty1Z6N53dmAudKHhy573j3yvRLsX2BSp8YpLtoCEG8E9DJe+8zUh4A==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - - '@eslint/object-schema@2.1.7': - resolution: {integrity: sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - - '@eslint/plugin-kit@0.4.1': - resolution: {integrity: sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - - '@humanfs/core@0.19.2': - resolution: {integrity: sha512-UhXNm+CFMWcbChXywFwkmhqjs3PRCmcSa/hfBgLIb7oQ5HNb1wS0icWsGtSAUNgefHeI+eBrA8I1fxmbHsGdvA==} - engines: {node: '>=18.18.0'} - - '@humanfs/node@0.16.8': - resolution: {integrity: sha512-gE1eQNZ3R++kTzFUpdGlpmy8kDZD/MLyHqDwqjkVQI0JMdI1D51sy1H958PNXYkM2rAac7e5/CnIKZrHtPh3BQ==} - engines: {node: '>=18.18.0'} - - '@humanfs/types@0.15.0': - resolution: {integrity: sha512-ZZ1w0aoQkwuUuC7Yf+7sdeaNfqQiiLcSRbfI08oAxqLtpXQr9AIVX7Ay7HLDuiLYAaFPu8oBYNq/QIi9URHJ3Q==} - engines: {node: '>=18.18.0'} - - '@humanwhocodes/module-importer@1.0.1': - resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} - engines: {node: '>=12.22'} - - '@humanwhocodes/retry@0.4.3': - resolution: {integrity: sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==} - engines: {node: '>=18.18'} - - '@img/colour@1.1.0': - resolution: {integrity: sha512-Td76q7j57o/tLVdgS746cYARfSyxk8iEfRxewL9h4OMzYhbW4TAcppl0mT4eyqXddh6L/jwoM75mo7ixa/pCeQ==} - engines: {node: '>=18'} - - '@img/sharp-darwin-arm64@0.35.3': - resolution: {integrity: sha512-RMnFX7YQsMoh7lWfcM4NEHHymBX/rLuKNPVM84XE9ONPcaSCDgE7CHIHpSgPcO2xcRthgBy1HfNO319mwhIAkg==} - engines: {node: '>=20.9.0'} - cpu: [arm64] - os: [darwin] - - '@img/sharp-darwin-x64@0.35.3': - resolution: {integrity: sha512-Xo+5uFBtLN0BKqieTxiFzFPQAUlBbbH5iBKyRX/z1JrbnYsHTfKJnUfL8+p2TPXr1pXqao4eeL4Rl144uDpK9w==} - engines: {node: '>=20.9.0'} - cpu: [x64] - os: [darwin] - - '@img/sharp-freebsd-wasm32@0.35.3': - resolution: {integrity: sha512-lUxcqWIj2wMQ9BrwNjngcr1gWUr5xgaGThBRqPPalIC2n67Cqj1uPh8NnA/ZhAg8hUbKl+kVHKwgUIwe6ZYPrg==} - engines: {node: '>=20.9.0'} - os: [freebsd] - - '@img/sharp-libvips-darwin-arm64@1.3.2': - resolution: {integrity: sha512-9J6ypZFpQBj4YnePGoq/S38w6nz+vqg5WZLrLGY4YuSemdMq47GMLBPO42MzwdGwpg/agZ7xzZcFHa48xlywfg==} - cpu: [arm64] - os: [darwin] - - '@img/sharp-libvips-darwin-x64@1.3.2': - resolution: {integrity: sha512-m2pW1n6cns9VaubNwsZ+c3CRYjxNQWgJ5gPlnL1nbBcpkBvFm6SCFN5o0psFHI8w9n11NKhFkeEDns98tiqbEw==} - cpu: [x64] - os: [darwin] - - '@img/sharp-libvips-linux-arm64@1.3.2': - resolution: {integrity: sha512-dqVSFynCox4C/J8kT16V7SIFAns0IjgLwkvYT7p8LQVmJ5OS5b6tI9IGflxTeuBS//zXeFIUbwt5dwxyZ17cnA==} - cpu: [arm64] - os: [linux] - libc: [glibc] - - '@img/sharp-libvips-linux-arm@1.3.2': - resolution: {integrity: sha512-1eMLzy92I4J6rmi4mAT8yC3HxOtniyGELlzGbNMLLeqe052ahFQ0h6LFq+lh5DsDIdYViIDst08abvSbcEdLXQ==} - cpu: [arm] - os: [linux] - libc: [glibc] - - '@img/sharp-libvips-linux-ppc64@1.3.2': - resolution: {integrity: sha512-3z0NHDxD6n5I9gc05U1eW1AyRm+Gznzq3naMrthPNqE6oYykcogW0l/jfpJdjYnuNl8R7yI9pNbE1XiUeyq0Aw==} - cpu: [ppc64] - os: [linux] - libc: [glibc] - - '@img/sharp-libvips-linux-riscv64@1.3.2': - resolution: {integrity: sha512-bsb4rI+NldGOsXuej2r8OdSS8+zXDVaCWxyWrcv6kneTOlgAHtZABRzBBCwdsPiD90J4myNJuHpg6kA20ImW/w==} - cpu: [riscv64] - os: [linux] - libc: [glibc] - - '@img/sharp-libvips-linux-s390x@1.3.2': - resolution: {integrity: sha512-/ABshyj8gCpyIrNXnHn4LorDJ0HHm1VhXPBlxZ8zAtfVPAaSafXPGn+sUSIRiwaSBy0mmFjSjiXI5mkcwdChKQ==} - cpu: [s390x] - os: [linux] - libc: [glibc] - - '@img/sharp-libvips-linux-x64@1.3.2': - resolution: {integrity: sha512-ITPEtgffGJ0S6G9dRyw/366tJQqFRcHWPHhC+Stpg3Z8AEMrDrTr2lhdz4f/Y/HMbRh//7Z5mBzEpVdi62Oc3w==} - cpu: [x64] - os: [linux] - libc: [glibc] - - '@img/sharp-libvips-linuxmusl-arm64@1.3.2': - resolution: {integrity: sha512-zE9EdiUzUmg5mDT5a1rk5fYJ6GWPloTwWBYDS14naqHsL+EaMpDj1AWnpLgh3u0YCORv2Tt50wrcrpYqkP97Kw==} - cpu: [arm64] - os: [linux] - libc: [musl] - - '@img/sharp-libvips-linuxmusl-x64@1.3.2': - resolution: {integrity: sha512-m0lrLiUt+lBYnCFr8qV/65yMR4E/c7/wf78I5eKTdkEakFAlZ9QlzEM3QIhhAwVeUhLAHLcCq7a7Vszq/oFNZQ==} - cpu: [x64] - os: [linux] - libc: [musl] - - '@img/sharp-linux-arm64@0.35.3': - resolution: {integrity: sha512-QgKDspHPnrU+GQ55XPhGwyhC8acLVOOSyAvo1oVfFmrIXLkDNmGWzAfDZ4xK8oSA1qBQrALcHX0G5UZni/SuFQ==} - engines: {node: '>=20.9.0'} - cpu: [arm64] - os: [linux] - libc: [glibc] - - '@img/sharp-linux-arm@0.35.3': - resolution: {integrity: sha512-affVWCTLooy8TSxbDx2qkzuDeaWLNVBA+P//FNBirHsXpP2fuBhk5AuboYUnrDnzoXes8GFjpTx0SBFOCRg+FA==} - engines: {node: '>=20.9.0'} - cpu: [arm] - os: [linux] - libc: [glibc] - - '@img/sharp-linux-ppc64@0.35.3': - resolution: {integrity: sha512-sMd8rDxmpLOwv/7N44klFjOD5DUO7FLdjiXDI0hoxYaf7Ar262dQIEkosE98bps+5HPLtp/EvNqeqQtOycP/IA==} - engines: {node: '>=20.9.0'} - cpu: [ppc64] - os: [linux] - libc: [glibc] - - '@img/sharp-linux-riscv64@0.35.3': - resolution: {integrity: sha512-0Eob78yjlYPfL5vMNWAW55l3R9Y6BQS/gOfe0ZcP9mEz9ohhKSt4im1hayiknXgf8AWrFqMvJcKIdmLmEe7yeQ==} - engines: {node: '>=20.9.0'} - cpu: [riscv64] - os: [linux] - libc: [glibc] - - '@img/sharp-linux-s390x@0.35.3': - resolution: {integrity: sha512-KgAxQ0DxpNOq1rG2t5cgTgShJFGSuU7XO45cqC+1NVOuZnP6tlgZRuSYOfNupGkHID0o3cJOsw4DVeJpMovcGw==} - engines: {node: '>=20.9.0'} - cpu: [s390x] - os: [linux] - libc: [glibc] - - '@img/sharp-linux-x64@0.35.3': - resolution: {integrity: sha512-8pqvxubL2PGdhlPy6GLqzDYMUjyRmKAwKHYKixpdJYBUK7PJ0C029XdsnpFIdgRZG68fZiGdHVWcKPvtiPB4cA==} - engines: {node: '>=20.9.0'} - cpu: [x64] - os: [linux] - libc: [glibc] - - '@img/sharp-linuxmusl-arm64@0.35.3': - resolution: {integrity: sha512-Vz0iQjzzcSX3HCbfwFfCSG/9SCIqyO0mH2sXyiHaAYfBk0cRsCWXRyQYX0ovCK/PAQBbTzQ0dsPQHh5MAFL59w==} - engines: {node: '>=20.9.0'} - cpu: [arm64] - os: [linux] - libc: [musl] - - '@img/sharp-linuxmusl-x64@0.35.3': - resolution: {integrity: sha512-6O1NPKcDVj9QEdg7Hx549EX8U0rp6yXQERqru6yRN7fGBn32UvIRJUlWnk+8xDCiG76hXVBbX82NZ/ZKr0euIg==} - engines: {node: '>=20.9.0'} - cpu: [x64] - os: [linux] - libc: [musl] - - '@img/sharp-wasm32@0.35.3': - resolution: {integrity: sha512-cZ0XkcYGpHZkqW6iCkqTcmUC0CD9DhD5d/qeZlZkfRBn6GnHniZXLUo5+9xw8Iv76YE6LQFN9YNBlKREcCG76w==} - engines: {node: '>=20.9.0'} - - '@img/sharp-webcontainers-wasm32@0.35.3': - resolution: {integrity: sha512-2rnq7bX3NzeR2T4YWgz8qiG4h3TSdMe+vN1iQXpJleSJ3SM5zQ8Fy2SyyXAWlbxpEZ2Y+Z4u1BePgJEYbSy80Q==} - engines: {node: '>=20.9.0'} - cpu: [wasm32] - - '@img/sharp-win32-arm64@0.35.3': - resolution: {integrity: sha512-4bPwFdMbeC4JQ8L8LOyWp6nsHcboP5fxkp6iPOXz2Vg49R42TuMs2whkJ5OAP4/Ul035qOzy0AecOF9VOscn4w==} - engines: {node: '>=20.9.0'} - cpu: [arm64] - os: [win32] - - '@img/sharp-win32-ia32@0.35.3': - resolution: {integrity: sha512-r53mXsBN6lFUDiST764SvgwUdHAqM4rPAiDzAmf4fLoB6X/rkfyTrLCg6+g17wJJiCmB3JYgHuUldCWUIRFSXw==} - engines: {node: ^20.9.0} - cpu: [ia32] - os: [win32] - - '@img/sharp-win32-x64@0.35.3': - resolution: {integrity: sha512-D4y1vNeZrIIJCN+uHaWVtH86B+aCrdMYYjicy9pXHvbGZeGYLLSd3wdVuC37FxVXlU1ARsk84eKWfWMXGYEqvA==} - engines: {node: '>=20.9.0'} - cpu: [x64] - os: [win32] - - '@jridgewell/gen-mapping@0.3.13': - resolution: {integrity: sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==} - - '@jridgewell/remapping@2.3.5': - resolution: {integrity: sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==} - - '@jridgewell/resolve-uri@3.1.2': - resolution: {integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==} - engines: {node: '>=6.0.0'} - - '@jridgewell/sourcemap-codec@1.5.5': - resolution: {integrity: sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==} - - '@jridgewell/trace-mapping@0.3.31': - resolution: {integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==} - - '@napi-rs/wasm-runtime@1.2.2': - resolution: {integrity: sha512-JfB4kuJQjaoHuCTseIINHtHWeJnvgEcxjwA5t/Y00ZgaOO1Crz3fjT/p8kT28zA/Caz7oiUMn3d6H2yOVCVwuw==} - engines: {node: ^20.19.0 || ^22.13.0 || >=23.5.0} - peerDependencies: - '@emnapi/core': ^1.7.1 || ^2.0.0-alpha.3 - '@emnapi/runtime': ^1.7.1 || ^2.0.0-alpha.3 - - '@next/env@16.3.0': - resolution: {integrity: sha512-o9r1S0BNiNreHP9Vs+Qnqd9kviDkJh8xIACY7UFZSmiGbbQRzPBBosvHzAU4TULHOIuOj/18RSsyz2qrREmIFw==} - - '@next/eslint-plugin-next@16.3.0': - resolution: {integrity: sha512-OqgJ8PN0d04KcPhDX/PTY5tJUJZxlbrt7O7FBsm4XE0XW2JDrKnDXsc9uo9WUimJGPoo2j+JRGhyXApC//mvbw==} - - '@next/swc-darwin-arm64@16.3.0': - resolution: {integrity: sha512-55hpqq18bEVAlxedlTt3tFqZmKg2nUXT1kn1G/BGEy0R13h3LwtwHPVzzjG6P4LLeOHE32PFDQUVaJEWvBEZBw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@next/swc-darwin-x64@16.3.0': - resolution: {integrity: sha512-SOi96kSaF5T+0wW4koiM1bWzSPwjzTesC1p3df+FjdOi5LIQkBK/blxh7HdoKnNuI4PURF1OO7TZqtfnbWDSgw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@next/swc-linux-arm64-gnu@16.3.0': - resolution: {integrity: sha512-P0gZAoPMF4dyTRzhmkV4PrqVzSOB6t4mC1oI3c4dqijJ+OVEVx5clIXAKR4/uQpsqw2KKM/0D5tVumcR2r5blg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - libc: [glibc] - - '@next/swc-linux-arm64-musl@16.3.0': - resolution: {integrity: sha512-tXXGKJw0m37O0eKJARVTX/TheKPhz0QFVtVVZXmOig+9YKLQOSP6hvf2pxv5DO7CLEJyTHx3Pg043CDQkv1G4Q==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - libc: [musl] - - '@next/swc-linux-x64-gnu@16.3.0': - resolution: {integrity: sha512-pjGxK5EY7yWml78ALejFkWmgHsU7wbFQrISiugpH6FbUJhgEvw3xFZ/EBAtLl7QtL0WdQKiG9eWJ3mOKGTukHw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - libc: [glibc] - - '@next/swc-linux-x64-musl@16.3.0': - resolution: {integrity: sha512-sjo++Xx+lomlPs3HRsHWhVDyGG6ms1kGW5EtHLERdII8AyG1i+f6aq68xHREO6AEMlhjTNEWBSmfJfqm9orf7g==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - libc: [musl] - - '@next/swc-win32-arm64-msvc@16.3.0': - resolution: {integrity: sha512-C5JSgiO54wURdaxdEUIXqkz04uMqC9UmPX1gtDrV/5Tf1UowdWYI8uA5hfFbPolTlp0q4KZ60xlHePNibf0VIw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@next/swc-win32-x64-msvc@16.3.0': - resolution: {integrity: sha512-fDOggsweNb5SSw0ZKVk6U+gxSyGFFlIBY/LBc1r8GUj4u/6t6oArL+Pmkg0MBnsgR+KkdsURilVH4F3GXUGepA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@nodelib/fs.scandir@2.1.5': - resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} - engines: {node: '>= 8'} - - '@nodelib/fs.stat@2.0.5': - resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} - engines: {node: '>= 8'} - - '@nodelib/fs.walk@1.2.8': - resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} - engines: {node: '>= 8'} - - '@nolyfill/is-core-module@1.0.39': - resolution: {integrity: sha512-nn5ozdjYQpUCZlWGuxcJY/KpxkWQs4DcbMCmKojjyrYDEAGy4Ce19NN4v5MduafTwJlbKc99UA8YhSVqq9yPZA==} - engines: {node: '>=12.4.0'} - - '@rtsao/scc@1.1.0': - resolution: {integrity: sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g==} - - '@swc/helpers@0.5.15': - resolution: {integrity: sha512-JQ5TuMi45Owi4/BIMAJBoSQoOJu12oOk/gADqlcUL9JEdHB8vyjUSsxqeNXnmXHjYKMi2WcYtezGEEhqUI/E2g==} - - '@tailwindcss/node@4.3.3': - resolution: {integrity: sha512-/T8IKEsf9VTU6tLjgC7+sv2mOPtQxzE2jMw7u4Tt40Tx+QSZxpzh95/H6cMKoja9XuW7iMdLJYBB0o9G1CaAgg==} - - '@tailwindcss/oxide-android-arm64@4.3.3': - resolution: {integrity: sha512-Y85A2gmPSkl5Ve5qR86GL4HT509cFqQh1aes9p3sSkyTPwt0Pppf3GkwGe4JPACcRYjgJIEhQgM6dBClnr0NYw==} - engines: {node: '>= 20'} - cpu: [arm64] - os: [android] - - '@tailwindcss/oxide-darwin-arm64@4.3.3': - resolution: {integrity: sha512-BiaWatpBcERQFDlOjRDpIVXuFK5PJez5SA4JMg6VYZdBYU+qKfV/vqjcIs+IYmtitf1xYQZTwXvU/8y4lfZUGw==} - engines: {node: '>= 20'} - cpu: [arm64] - os: [darwin] - - '@tailwindcss/oxide-darwin-x64@4.3.3': - resolution: {integrity: sha512-fAeUqfV5ndhxRwai8cXGzdLvul9utWOmeTkv69unv4ZXixjn61Z+p9lCWdwOwA3TYboG3BwdVuN/RDjhBRl0mw==} - engines: {node: '>= 20'} - cpu: [x64] - os: [darwin] - - '@tailwindcss/oxide-freebsd-x64@4.3.3': - resolution: {integrity: sha512-iyf5bV6+wnAlflVeEy7R25dupxTNECZN5QMI0qNT6eT+EgaGdZcKhGkr5SdoaWiLJ3spLqIY9VCeSGrwmtg4kw==} - engines: {node: '>= 20'} - cpu: [x64] - os: [freebsd] - - '@tailwindcss/oxide-linux-arm-gnueabihf@4.3.3': - resolution: {integrity: sha512-aAYUprJAJQWWbRrPvtjdroZ56Md+JM8pMiopS6xGEwDfLhqj+2ver2p4nU4Mb3CRqcMmNBjo8KkUgcxhkzVQGQ==} - engines: {node: '>= 20'} - cpu: [arm] - os: [linux] - - '@tailwindcss/oxide-linux-arm64-gnu@4.3.3': - resolution: {integrity: sha512-nDxldcEENOxZRzC2uu9jrutZdAAQtb+8WWDCSnWL1zvBk1+FN+x6MtDViPB5AJMfttVCUhehGWus3XBPgatM/w==} - engines: {node: '>= 20'} - cpu: [arm64] - os: [linux] - libc: [glibc] - - '@tailwindcss/oxide-linux-arm64-musl@4.3.3': - resolution: {integrity: sha512-Md44bD6veX/PC5iyF8cDVnw4HBIANZepRZZ7a8DQOvkfo5WUBwcp6iAuCUz23u+4SUkhJlD3eL7hNdW8ezd/kA==} - engines: {node: '>= 20'} - cpu: [arm64] - os: [linux] - libc: [musl] - - '@tailwindcss/oxide-linux-x64-gnu@4.3.3': - resolution: {integrity: sha512-tx7us1muwOKAKWao2v/GaafFeQboE6aj88vC6ziN2NCGcRm8gWUhwjzg+YdVB1e4boAtdtma4L43onunI6NS4w==} - engines: {node: '>= 20'} - cpu: [x64] - os: [linux] - libc: [glibc] - - '@tailwindcss/oxide-linux-x64-musl@4.3.3': - resolution: {integrity: sha512-SJxX60smvHgasZoBy11dX6YRjXJFovwWBoedhbQPOBzgFWBHGB+TVPWB9BxzR7TTxU8FQZAI2AyiNCMzFm8Img==} - engines: {node: '>= 20'} - cpu: [x64] - os: [linux] - libc: [musl] - - '@tailwindcss/oxide-wasm32-wasi@4.3.3': - resolution: {integrity: sha512-jx1+rPhY/5Ympkktd656HBWEBLxP7dH06losBLjjf5vgCODXvi9KhtftWcMIwTFIDqBr7cRnQkdLnAG+IOlGvQ==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - bundledDependencies: - - '@napi-rs/wasm-runtime' - - '@emnapi/core' - - '@emnapi/runtime' - - '@tybys/wasm-util' - - '@emnapi/wasi-threads' - - tslib - - '@tailwindcss/oxide-win32-arm64-msvc@4.3.3': - resolution: {integrity: sha512-3rc292Ca2ceK6Ulcc/bAVnTs/3nDtoPhyEKlgPv+yQJQi/JS/AMJlqzxvlDacL1nekbrcf6bTqp/jV4qgnPxNQ==} - engines: {node: '>= 20'} - cpu: [arm64] - os: [win32] - - '@tailwindcss/oxide-win32-x64-msvc@4.3.3': - resolution: {integrity: sha512-yJ0pwIVc/nYeGoV02WtsN8KYyLQv7kyI2wDnkezyJlGGjkd4QLwDGAwl47YpPJeuI0M0ObaXGSPjvWDPeTPggw==} - engines: {node: '>= 20'} - cpu: [x64] - os: [win32] - - '@tailwindcss/oxide@4.3.3': - resolution: {integrity: sha512-krXjAikiaFSPaK/FkAQT5UTx3VormQaiZ5hBFlJZ9UFQGB/rwg1MZIhHAG9smMQRTdyJxP6Qt5MwMtdyU5FWrA==} - engines: {node: '>= 20'} - - '@tailwindcss/postcss@4.3.3': - resolution: {integrity: sha512-JTSZZGQi1AyKirbLN3azmjVzef92tcX7h+iSqPdaeStyFpGpDlKvvpxeOE8njhbUanbRwr3z8DyzhICWnMtQeg==} - - '@tybys/wasm-util@0.10.3': - resolution: {integrity: sha512-F3fo1MYrRJYL3zER0OUOmkutjr1Vp23m7OsSgp7nq4SP6OqX6C/56XFIPAl5bt3zaBRjmW7SGz3u/6LwFpYcOg==} - - '@types/estree@1.0.9': - resolution: {integrity: sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==} - - '@types/json-schema@7.0.15': - resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} - - '@types/json5@0.0.29': - resolution: {integrity: sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==} - - '@types/node@20.19.43': - resolution: {integrity: sha512-6oYBAi5ikg4Pl+kGsoYtawUMBT2zZMCvPNF7pVLnHZfd1zf38DRiWn/gT01RYCdUqkv7Fhr+C9ot4/tb+2sVvA==} - - '@types/react-dom@19.2.4': - resolution: {integrity: sha512-Bsc+QHgp+P/F02XDzNCY9jnZNCUuLki36KT7VKrTXXLdHf+vHMNZnW1rVu5DNW/rCK+fya3DATySbLM4yhtKUw==} - peerDependencies: - '@types/react': ^19.2.0 - - '@types/react@19.2.18': - resolution: {integrity: sha512-AnzbBERsrLKtk2XSfTbYRLjQPdy116Sty4q+T+Bp3IC4l6jNBvreVPAHmpq9qhXQM7CXZPjLVmGMw9sy+hxQ3w==} - - '@typescript-eslint/eslint-plugin@8.66.0': - resolution: {integrity: sha512-p088eaGrzYz1s+7cov0aMOCkNGTJlVxF4jgubf28c8L0Cv9Rloj8YBHnv4hXLq6IIEE1AsjNWavO+k+8kP2Y0A==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - peerDependencies: - '@typescript-eslint/parser': ^8.66.0 - eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 - typescript: '>=4.8.4 <6.1.0' - - '@typescript-eslint/parser@8.66.0': - resolution: {integrity: sha512-X6ypGChaWYk6PBtUg2BwuTZEFFcHJAtGTVJ9/lCTOufhZ4i9fNolQNnktq+kkMCwMj7V8Svsq7+TxSDslmhE0g==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - peerDependencies: - eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 - typescript: '>=4.8.4 <6.1.0' - - '@typescript-eslint/project-service@8.66.0': - resolution: {integrity: sha512-7MthGPTt4BP69lSryqpqq8HQqxuzynssckL/jyDyk3+TNMQ3y2jFWkptCrktWvBrP+EH787Nl5N5Qpw7WZg+5g==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - peerDependencies: - typescript: '>=4.8.4 <6.1.0' - - '@typescript-eslint/scope-manager@8.66.0': - resolution: {integrity: sha512-8TGcH25j9zqJ/IULB/ppyhRvxA8QYfFEZ7nfbg6/BN9spDgb8fPWQXlE5l8TWBL50EtUx007uZ1o9VOwrq2/9g==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - - '@typescript-eslint/tsconfig-utils@8.66.0': - resolution: {integrity: sha512-9D5gLYZG4rOjcoag8MQ/fWI8WqA9wcPDyOGyWtWFhvM1lHRbliqUSPIY5J3zqCU1tvSwzXxnnjhQhz5Ne7mJ4g==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - peerDependencies: - typescript: '>=4.8.4 <6.1.0' - - '@typescript-eslint/type-utils@8.66.0': - resolution: {integrity: sha512-LG2dWfjZQQp0ADtAu/EWJVayefGL2UEZ3CDeI44D9v3rXB/WYUqE/jpO28KrEKul5AySrmI+Zh1v6v+xW2U9+g==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - peerDependencies: - eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 - typescript: '>=4.8.4 <6.1.0' - - '@typescript-eslint/types@8.66.0': - resolution: {integrity: sha512-H6gcYaSDOyvL3AD/jHUtUFo2jqGgn/F6nuyuZSu0QTesxL+cP4dQoIMrODRofuJC09g64+WgZ6tE19Y1N2YIFQ==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - - '@typescript-eslint/typescript-estree@8.66.0': - resolution: {integrity: sha512-8/x4INiiQb10jGgXYD7116/zQ+OL84ZIFn0za68wwFHCanT/VLbBEroWht8RV8fn0/ZCAoazHLQgwUC0UQcDfg==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - peerDependencies: - typescript: '>=4.8.4 <6.1.0' - - '@typescript-eslint/utils@8.66.0': - resolution: {integrity: sha512-jasearZPolBw5NJNYGMwxzHMF83niVWmMU1VdHzG1CyfI2VS7f7nZltnKtHcg20hW+7Uo5GfK4MeDPoU3qI8EA==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - peerDependencies: - eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 - typescript: '>=4.8.4 <6.1.0' - - '@typescript-eslint/visitor-keys@8.66.0': - resolution: {integrity: sha512-dkKR8q+lKciskj1Y3vthHktl+3cMLWGyVUP23bRiPZ5O9BRT++4EqDDV+TVeIKBL1VXVEqrJlz8MYbcnvJcAlg==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - - '@unrs/resolver-binding-android-arm-eabi@1.12.2': - resolution: {integrity: sha512-g5T90pqg1bo/7mytQx6F4iBNC0Wsh9cu+z9veDbFjc7HjpesJFWD7QMS0NGStXM075+7dJPPVvBbpZlnrdpi/w==} - cpu: [arm] - os: [android] - - '@unrs/resolver-binding-android-arm64@1.12.2': - resolution: {integrity: sha512-YGCRZv/9GLhwmz6mYDeTsm/92BAyR28l6c2ReweVW5pWgfsitWLY8upvfRlGdoyD8HjeTHSYJWyZGD4KJA/nFQ==} - cpu: [arm64] - os: [android] - - '@unrs/resolver-binding-darwin-arm64@1.12.2': - resolution: {integrity: sha512-u9DiNT1auQMO20A9SyTuG3wUgQWB9Z7KjAg0uFuCDR1FsAY8A0CG2S6JpHS1xwm/w1G08bjXZDcyOCjv1WAm2w==} - cpu: [arm64] - os: [darwin] - - '@unrs/resolver-binding-darwin-x64@1.12.2': - resolution: {integrity: sha512-f7rPLi/T1HVKZu/u6t87lroib16n8vrSzcyxI7lg4BGO9UF26KhQL44sd9eOUgrTYhvRXtWOIZT5PejdPyJfUA==} - cpu: [x64] - os: [darwin] - - '@unrs/resolver-binding-freebsd-x64@1.12.2': - resolution: {integrity: sha512-BpcOjWCJub6nRZUS2zA20pmLvjtqAtGejETaIyRLiZiQf++cbrjltLA5NN/xaXfqeOBOSlMFbemIl5/S5tljmg==} - cpu: [x64] - os: [freebsd] - - '@unrs/resolver-binding-linux-arm-gnueabihf@1.12.2': - resolution: {integrity: sha512-vZTDvdSISZjJx66OzJqtsOhzifbqRjbmI1Mnu49fQDwog5GtDI4QidRiEAYbZCRj9C8YZEW+3ZjqsyS9GR4k2A==} - cpu: [arm] - os: [linux] - - '@unrs/resolver-binding-linux-arm-musleabihf@1.12.2': - resolution: {integrity: sha512-BiPI+IrIlwcW4nLLMM21+B1dFPzd55yAVgVGrdgDjNef+ch03GdxrcyaIz8X9SsQirh/kCQ7mviyWlMxdh2D7g==} - cpu: [arm] - os: [linux] - - '@unrs/resolver-binding-linux-arm64-gnu@1.12.2': - resolution: {integrity: sha512-zJc0H99FEPoFfSrNpa91HYfxzfAJCr502oxNK1cfdC9hlaFI43RT+JFCann9JUgZmLzzntChHyn13Sgn9ljHNg==} - cpu: [arm64] - os: [linux] - libc: [glibc] - - '@unrs/resolver-binding-linux-arm64-musl@1.12.2': - resolution: {integrity: sha512-KQ3Lki6l+Pz1k/eBipN41ES+YUK30beLGb9YqcB1O542cyLCNE6GaxrfcY3T6EezmGGk84wb5XyO9loTM9tkcA==} - cpu: [arm64] - os: [linux] - libc: [musl] - - '@unrs/resolver-binding-linux-loong64-gnu@1.12.2': - resolution: {integrity: sha512-3SJGEh1DborhG6pyxvhPzCT4bbSIVihsvgJc13P1bHG7KLdNDaF9T3gsTwFc7Jw/5Y5/iWOjkEx7Zy0NvCGX3Q==} - cpu: [loong64] - os: [linux] - libc: [glibc] - - '@unrs/resolver-binding-linux-loong64-musl@1.12.2': - resolution: {integrity: sha512-jiuG/Obbel7uw1PwHNFfrkiKhLAF6mnyZ6aWlOAVN9WqKm8v0OFGnciJIHu8+CMvXLQ8AD51LPzAoUfT21D5Ew==} - cpu: [loong64] - os: [linux] - libc: [musl] - - '@unrs/resolver-binding-linux-ppc64-gnu@1.12.2': - resolution: {integrity: sha512-q7xRvVpmcfeL+LlZg8Pbbo6QaTZwDU5BaGZbwfhkEsXJn3Was8xYfE0RBH266xZt0rM6B7i8xAYIvjthuUIWHg==} - cpu: [ppc64] - os: [linux] - libc: [glibc] - - '@unrs/resolver-binding-linux-riscv64-gnu@1.12.2': - resolution: {integrity: sha512-0CVdx6lcnT3Q9inOH8tsMIOJ6ImndllMjqJHg8RLVdB7Vq4SfkEXl9mCSsVNuNA4MCYycRicCUxPCabVHJRr6A==} - cpu: [riscv64] - os: [linux] - libc: [glibc] - - '@unrs/resolver-binding-linux-riscv64-musl@1.12.2': - resolution: {integrity: sha512-iOwlRo9vnp6R6ohHQS11n0NnfdXx/omhkocmIfaPRpQhKZ+3BDMkkdRVh53qjkFkpPddf+FETA28NwGN7l5l+w==} - cpu: [riscv64] - os: [linux] - libc: [musl] - - '@unrs/resolver-binding-linux-s390x-gnu@1.12.2': - resolution: {integrity: sha512-HYJtLfXq94q8iZNFT1lknx258wlkkWhZeUXJRqzKBBUJ00CvZ+N33zgbCqimLjsyw5Va6uUxhVa12mI+kaveEw==} - cpu: [s390x] - os: [linux] - libc: [glibc] - - '@unrs/resolver-binding-linux-x64-gnu@1.12.2': - resolution: {integrity: sha512-mPsUhunKKDih5O96Y6enDQyHc1SqBPlY1E/SfMWDM3EdJ95Z9CArPeCVwCCqbP45ljvivdEk8Fxn+SIb1rDAJQ==} - cpu: [x64] - os: [linux] - libc: [glibc] - - '@unrs/resolver-binding-linux-x64-musl@1.12.2': - resolution: {integrity: sha512-azrt6+5ydLd8Vt210AAFis/lZevSfPw93EJRIJG+xPu4WCJ8K0kppCTpMyLPcKT7H15M4Jnt2tMp5bOvCkRC6A==} - cpu: [x64] - os: [linux] - libc: [musl] - - '@unrs/resolver-binding-openharmony-arm64@1.12.2': - resolution: {integrity: sha512-YZ9hP4O0X9PQb8eO980qmLNGH4zT3I9+SZTdt0Pr0YyuGQhYKoOZkV02VzrzyOZJ5xIJ3UFIenKkUkGg8GjgWQ==} - cpu: [arm64] - os: [openharmony] - - '@unrs/resolver-binding-wasm32-wasi@1.12.2': - resolution: {integrity: sha512-tYFDIkMxSflfEc/h92ZWNsZlHSwgimbNHSO3PL2JWQHfCuC2q316jMyYU9TIWZsFK2bQwyK5VAdYgn8ygPj69A==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@unrs/resolver-binding-win32-arm64-msvc@1.12.2': - resolution: {integrity: sha512-qzNyg3xL0VPQmCaUh+N5jSitce6k+uCBfMDesWRnlULOZaqUkaJ0ybdT+UqlAWJoQjuqfIU/0Ptx9bteN4D82g==} - cpu: [arm64] - os: [win32] - - '@unrs/resolver-binding-win32-ia32-msvc@1.12.2': - resolution: {integrity: sha512-WD9sY00OfpHVGfsnHZoA8jVT+esS/Bg8z8jzxp5BnDCjjwsuKsPQrzswwpFy4J1AUJbXPRfkpcX0mXrzeXW79g==} - cpu: [ia32] - os: [win32] - - '@unrs/resolver-binding-win32-x64-msvc@1.12.2': - resolution: {integrity: sha512-nAB74NfSNKknqQ1RrYj6uz8FcXEomu/MATJZxh/x+BArzN2U3JbOYC0APYzUIGhVY3m5hRxA8VPNdPBoG8txlA==} - cpu: [x64] - os: [win32] - - acorn-jsx@5.3.2: - resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} - peerDependencies: - acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 - - acorn@8.18.0: - resolution: {integrity: sha512-lGq+9yr1/GuAWaVYIHRjvvySG5/4VfKIvC8EWxStPdcDh/Ka7FG3twP6v4d5BkravUilhIAsG4Qj83t02LWUPQ==} - engines: {node: '>=0.4.0'} - hasBin: true - - ajv@6.15.0: - resolution: {integrity: sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw==} - - ansi-styles@4.3.0: - resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} - engines: {node: '>=8'} - - argparse@2.0.1: - resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} - - aria-query@5.3.2: - resolution: {integrity: sha512-COROpnaoap1E2F000S62r6A60uHZnmlvomhfyT2DlTcrY1OrBKn2UhH7qn5wTC9zMvD0AY7csdPSNwKP+7WiQw==} - engines: {node: '>= 0.4'} - - array-buffer-byte-length@1.0.2: - resolution: {integrity: sha512-LHE+8BuR7RYGDKvnrmcuSq3tDcKv9OFEXQt/HpbZhY7V6h0zlUXutnAD82GiFx9rdieCMjkvtcsPqBwgUl1Iiw==} - engines: {node: '>= 0.4'} - - array-includes@3.1.9: - resolution: {integrity: sha512-FmeCCAenzH0KH381SPT5FZmiA/TmpndpcaShhfgEN9eCVjnFBqq3l1xrI42y8+PPLI6hypzou4GXw00WHmPBLQ==} - engines: {node: '>= 0.4'} - - array.prototype.findlast@1.2.5: - resolution: {integrity: sha512-CVvd6FHg1Z3POpBLxO6E6zr+rSKEQ9L6rZHAaY7lLfhKsWYUBBOuMs0e9o24oopj6H+geRCX0YJ+TJLBK2eHyQ==} - engines: {node: '>= 0.4'} - - array.prototype.findlastindex@1.2.6: - resolution: {integrity: sha512-F/TKATkzseUExPlfvmwQKGITM3DGTK+vkAsCZoDc5daVygbJBnjEUCbgkAvVFsgfXfX4YIqZ/27G3k3tdXrTxQ==} - engines: {node: '>= 0.4'} - - array.prototype.flat@1.3.3: - resolution: {integrity: sha512-rwG/ja1neyLqCuGZ5YYrznA62D4mZXg0i1cIskIUKSiqF3Cje9/wXAls9B9s1Wa2fomMsIv8czB8jZcPmxCXFg==} - engines: {node: '>= 0.4'} - - array.prototype.flatmap@1.3.3: - resolution: {integrity: sha512-Y7Wt51eKJSyi80hFrJCePGGNo5ktJCslFuboqJsbf57CCPcm5zztluPlc4/aD8sWsKvlwatezpV4U1efk8kpjg==} - engines: {node: '>= 0.4'} - - array.prototype.tosorted@1.1.4: - resolution: {integrity: sha512-p6Fx8B7b7ZhL/gmUsAy0D15WhvDccw3mnGNbZpi3pmeJdxtWsj2jEaI4Y6oo3XiHfzuSgPwKc04MYt6KgvC/wA==} - engines: {node: '>= 0.4'} - - arraybuffer.prototype.slice@1.0.4: - resolution: {integrity: sha512-BNoCY6SXXPQ7gF2opIP4GBE+Xw7U+pHMYKuzjgCN3GwiaIR09UUeKfheyIry77QtrCBlC0KK0q5/TER/tYh3PQ==} - engines: {node: '>= 0.4'} - - ast-types-flow@0.0.8: - resolution: {integrity: sha512-OH/2E5Fg20h2aPrbe+QL8JZQFko0YZaF+j4mnQ7BGhfavO7OpSLa8a0y9sBwomHdSbkhTS8TQNayBfnW5DwbvQ==} - - async-function@1.0.0: - resolution: {integrity: sha512-hsU18Ae8CDTR6Kgu9DYf0EbCr/a5iGL0rytQDobUcdpYOKokk8LEjVphnXkDkgpi0wYVsqrXuP0bZxJaTqdgoA==} - engines: {node: '>= 0.4'} - - available-typed-arrays@1.0.7: - resolution: {integrity: sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==} - engines: {node: '>= 0.4'} - - axe-core@4.13.0: - resolution: {integrity: sha512-UzGt8zg7Ny8djbYMhxl2zuEevVa7r2gJjYY5Lwr1xM7+XU2nd6CkIWFTVcCIbAP63vSz71NaVyyuSk9lHKcy0A==} - engines: {node: '>=4'} - - axobject-query@4.1.0: - resolution: {integrity: sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ==} - engines: {node: '>= 0.4'} - - balanced-match@1.0.2: - resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} - - balanced-match@4.0.4: - resolution: {integrity: sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==} - engines: {node: 18 || 20 || >=22} - - baseline-browser-mapping@2.11.12: - resolution: {integrity: sha512-r7WnVImvVCeFpf2DOXfy41aPWzeNg3H/A2X4dKmy1QL0MSyyk/e7z8ihJ3N6Nn2PsdhkVlqnEfnUE4a05P2aTA==} - engines: {node: '>=6.0.0'} - hasBin: true - - brace-expansion@1.1.18: - resolution: {integrity: sha512-Edep/X9fGqVNmzKBVsDYIOtD+z1tuezV70LBjdCst9Tqu76lsnvRiZ6oTic1n+/BIwX6QDGAO94PN4N2SADvtw==} - - brace-expansion@5.0.9: - resolution: {integrity: sha512-ScQ4IuvIEF1TMlP7Zt+vjJ//9zlPb2SDcxWxM3bk8s6t6GGdJ7KO1dCcTidOPJKePW30LE/2cT7wCyPho9/Wxg==} - engines: {node: 20 || >=22} - - braces@3.0.3: - resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} - engines: {node: '>=8'} - - browserslist@4.28.7: - resolution: {integrity: sha512-JxV13hNrFxqjOc8alRbq9dK1MM79NEXYpma2B2J4wAtpWS5zIEIKqWPGCl7N4o7Uc7B7itylh7SuDujATRyyTw==} - engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} - hasBin: true - - call-bind-apply-helpers@1.0.2: - resolution: {integrity: sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==} - engines: {node: '>= 0.4'} - - call-bind@1.0.9: - resolution: {integrity: sha512-a/hy+pNsFUTR+Iz8TCJvXudKVLAnz/DyeSUo10I5yvFDQJBFU2s9uqQpoSrJlroHUKoKqzg+epxyP9lqFdzfBQ==} - engines: {node: '>= 0.4'} - - call-bound@1.0.4: - resolution: {integrity: sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==} - engines: {node: '>= 0.4'} - - callsites@3.1.0: - resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} - engines: {node: '>=6'} - - caniuse-lite@1.0.30001809: - resolution: {integrity: sha512-xxWVywk6a6Arlk+hymeycyn/VgqEfLDxupvhH/xiY5SJ/18kmi9o6MiO320DCUzypORHLtvh0I4i04tUhCNHNQ==} - - chalk@4.1.2: - resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} - engines: {node: '>=10'} - - client-only@0.0.1: - resolution: {integrity: sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==} - - color-convert@2.0.1: - resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} - engines: {node: '>=7.0.0'} - - color-name@1.1.4: - resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} - - concat-map@0.0.1: - resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} - - convert-source-map@2.0.0: - resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} - - cross-spawn@7.0.6: - resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==} - engines: {node: '>= 8'} - - csstype@3.2.3: - resolution: {integrity: sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==} - - damerau-levenshtein@1.0.8: - resolution: {integrity: sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA==} - - data-view-buffer@1.0.2: - resolution: {integrity: sha512-EmKO5V3OLXh1rtK2wgXRansaK1/mtVdTUEiEI0W8RkvgT05kfxaH29PliLnpLP73yYO6142Q72QNa8Wx/A5CqQ==} - engines: {node: '>= 0.4'} - - data-view-byte-length@1.0.2: - resolution: {integrity: sha512-tuhGbE6CfTM9+5ANGf+oQb72Ky/0+s3xKUpHvShfiz2RxMFgFPjsXuRLBVMtvMs15awe45SRb83D6wH4ew6wlQ==} - engines: {node: '>= 0.4'} - - data-view-byte-offset@1.0.1: - resolution: {integrity: sha512-BS8PfmtDGnrgYdOonGZQdLZslWIeCGFP9tpan0hi1Co2Zr2NKADsvGYA8XxuG/4UWgJ6Cjtv+YJnB6MM69QGlQ==} - engines: {node: '>= 0.4'} - - debug@3.2.7: - resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - - debug@4.4.3: - resolution: {integrity: sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==} - engines: {node: '>=6.0'} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - - deep-is@0.1.4: - resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} - - define-data-property@1.1.4: - resolution: {integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==} - engines: {node: '>= 0.4'} - - define-properties@1.2.1: - resolution: {integrity: sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==} - engines: {node: '>= 0.4'} - - detect-libc@2.1.2: - resolution: {integrity: sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==} - engines: {node: '>=8'} - - doctrine@2.1.0: - resolution: {integrity: sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==} - engines: {node: '>=0.10.0'} - - dunder-proto@1.0.1: - resolution: {integrity: sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==} - engines: {node: '>= 0.4'} - - electron-to-chromium@1.5.402: - resolution: {integrity: sha512-/oOpMaPT6Yg+6/1XQhyIPlzgj7Ye9zf+nNM2Uh6OcE2G2oNptWazFa+qB2Pdqqbsc9KnIDzgAntoYN0dbwOXwA==} - - emoji-regex@9.2.2: - resolution: {integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==} - - enhanced-resolve@5.24.5: - resolution: {integrity: sha512-L1l8TNvomm6UVW5B253AGxQagSQr+vGwhMlrrfRS2qmhx46AMpMVJKQYLvWYbysTMY8VoicOvzHzoHMbyzB+4A==} - engines: {node: '>=10.13.0'} - - es-abstract-get@1.0.0: - resolution: {integrity: sha512-6PMWXpdhshVvFp+FoWYs1EvG1Nj0tvk0dZM+XcK0xMEM1czRVcP6ohqPWHy6qPagSpC8j4+p89WXlT+xXJs/fg==} - engines: {node: '>= 0.4'} - - es-abstract@1.24.2: - resolution: {integrity: sha512-2FpH9Q5i2RRwyEP1AylXe6nYLR5OhaJTZwmlcP0dL/+JCbgg7yyEo/sEK6HeGZRf3dFpWwThaRHVApXSkW3xeg==} - engines: {node: '>= 0.4'} - - es-define-property@1.0.1: - resolution: {integrity: sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==} - engines: {node: '>= 0.4'} - - es-errors@1.3.0: - resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} - engines: {node: '>= 0.4'} - - es-iterator-helpers@1.4.0: - resolution: {integrity: sha512-c/A0P0oxkACDc+cKWw8evLXK83oBKgn0qPOqCYT4x9uolpCIJAcYvJC9QYKNDRPsTeGyCrQ326jrvgZWdCdK5Q==} - engines: {node: '>= 0.4'} - - es-object-atoms@1.1.2: - resolution: {integrity: sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw==} - engines: {node: '>= 0.4'} - - es-set-tostringtag@2.1.0: - resolution: {integrity: sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==} - engines: {node: '>= 0.4'} - - es-shim-unscopables@1.1.0: - resolution: {integrity: sha512-d9T8ucsEhh8Bi1woXCf+TIKDIROLG5WCkxg8geBCbvk22kzwC5G2OnXVMO6FUsvQlgUUXQ2itephWDLqDzbeCw==} - engines: {node: '>= 0.4'} - - es-to-primitive@1.3.4: - resolution: {integrity: sha512-yPDz7wqpg1/mmHLmS3tcfTfbw5f1eryXvyghYBffGdERwe+mV7ZcWzTR8LR17Kvqt3qfPurjlonmnq3MKXIOXw==} - engines: {node: '>= 0.4'} - - escalade@3.2.0: - resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==} - engines: {node: '>=6'} - - escape-string-regexp@4.0.0: - resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} - engines: {node: '>=10'} - - eslint-config-next@16.3.0: - resolution: {integrity: sha512-lPrf1kHsMJEZqO0uXkNB400c5MGrhrTk3BNX7P0ol4gt61+iUlQfjy9TyIOEA9eOXrf+5+mYbT/JsY8+zqUByQ==} - peerDependencies: - eslint: '>=9.0.0' - typescript: '>=3.3.1' - peerDependenciesMeta: - typescript: - optional: true - - eslint-import-resolver-node@0.3.10: - resolution: {integrity: sha512-tRrKqFyCaKict5hOd244sL6EQFNycnMQnBe+j8uqGNXYzsImGbGUU4ibtoaBmv5FLwJwcFJNeg1GeVjQfbMrDQ==} - - eslint-import-resolver-typescript@3.10.1: - resolution: {integrity: sha512-A1rHYb06zjMGAxdLSkN2fXPBwuSaQ0iO5M/hdyS0Ajj1VBaRp0sPD3dn1FhME3c/JluGFbwSxyCfqdSbtQLAHQ==} - engines: {node: ^14.18.0 || >=16.0.0} - peerDependencies: - eslint: '*' - eslint-plugin-import: '*' - eslint-plugin-import-x: '*' - peerDependenciesMeta: - eslint-plugin-import: - optional: true - eslint-plugin-import-x: - optional: true - - eslint-module-utils@2.14.0: - resolution: {integrity: sha512-W2WCRZ9Dqntd+2u8jJcVMV2PKulc6RdLgUUoh/yQr3uB6lo/ZOeGx11sv60/8S4QFFKNslAlWhr9u0Ef7ZW6Ig==} - engines: {node: '>=4'} - peerDependencies: - '@typescript-eslint/parser': '*' - eslint: '*' - eslint-import-resolver-node: '*' - eslint-import-resolver-typescript: '*' - eslint-import-resolver-webpack: '*' - peerDependenciesMeta: - '@typescript-eslint/parser': - optional: true - eslint: - optional: true - eslint-import-resolver-node: - optional: true - eslint-import-resolver-typescript: - optional: true - eslint-import-resolver-webpack: - optional: true - - eslint-plugin-import@2.32.0: - resolution: {integrity: sha512-whOE1HFo/qJDyX4SnXzP4N6zOWn79WhnCUY/iDR0mPfQZO8wcYE4JClzI2oZrhBnnMUCBCHZhO6VQyoBU95mZA==} - engines: {node: '>=4'} - peerDependencies: - '@typescript-eslint/parser': '*' - eslint: ^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 || ^9 - peerDependenciesMeta: - '@typescript-eslint/parser': - optional: true - - eslint-plugin-jsx-a11y@6.10.2: - resolution: {integrity: sha512-scB3nz4WmG75pV8+3eRUQOHZlNSUhFNq37xnpgRkCCELU3XMvXAxLk1eqWWyE22Ki4Q01Fnsw9BA3cJHDPgn2Q==} - engines: {node: '>=4.0'} - peerDependencies: - eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9 - - eslint-plugin-react-hooks@7.1.1: - resolution: {integrity: sha512-f2I7Gw6JbvCexzIInuSbZpfdQ44D7iqdWX01FKLvrPgqxoE7oMj8clOfto8U6vYiz4yd5oKu39rRSVOe1zRu0g==} - engines: {node: '>=18'} - peerDependencies: - eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 || ^9.0.0 || ^10.0.0 - - eslint-plugin-react@7.37.5: - resolution: {integrity: sha512-Qteup0SqU15kdocexFNAJMvCJEfa2xUKNV4CC1xsVMrIIqEy3SQ/rqyxCWNzfrd3/ldy6HMlD2e0JDVpDg2qIA==} - engines: {node: '>=4'} - peerDependencies: - eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9.7 - - eslint-scope@8.4.0: - resolution: {integrity: sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - - eslint-visitor-keys@3.4.3: - resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - - eslint-visitor-keys@4.2.1: - resolution: {integrity: sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - - eslint-visitor-keys@5.0.1: - resolution: {integrity: sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA==} - engines: {node: ^20.19.0 || ^22.13.0 || >=24} - - eslint@9.39.5: - resolution: {integrity: sha512-DgZS62aPLXKlnxILS/AYCoRvHaZeXceIzlXPkkGGzJWSow1aEk0lbTlxUSlyjC8jcaKxAdOnTDz+o1JFSBsyjw==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - hasBin: true - peerDependencies: - jiti: '*' - peerDependenciesMeta: - jiti: - optional: true - - espree@10.4.0: - resolution: {integrity: sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - - esquery@1.7.0: - resolution: {integrity: sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g==} - engines: {node: '>=0.10'} - - esrecurse@4.3.0: - resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==} - engines: {node: '>=4.0'} - - estraverse@5.3.0: - resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} - engines: {node: '>=4.0'} - - esutils@2.0.3: - resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} - engines: {node: '>=0.10.0'} - - fast-deep-equal@3.1.3: - resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} - - fast-glob@3.3.1: - resolution: {integrity: sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==} - engines: {node: '>=8.6.0'} - - fast-json-stable-stringify@2.1.0: - resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} - - fast-levenshtein@2.0.6: - resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} - - fastq@1.20.1: - resolution: {integrity: sha512-GGToxJ/w1x32s/D2EKND7kTil4n8OVk/9mycTc4VDza13lOvpUZTGX3mFSCtV9ksdGBVzvsyAVLM6mHFThxXxw==} - - fdir@6.5.0: - resolution: {integrity: sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==} - engines: {node: '>=12.0.0'} - peerDependencies: - picomatch: ^3 || ^4 - peerDependenciesMeta: - picomatch: - optional: true - - file-entry-cache@8.0.0: - resolution: {integrity: sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==} - engines: {node: '>=16.0.0'} - - fill-range@7.1.1: - resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} - engines: {node: '>=8'} - - find-up@5.0.0: - resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} - engines: {node: '>=10'} - - flat-cache@4.0.1: - resolution: {integrity: sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==} - engines: {node: '>=16'} - - flatted@3.4.4: - resolution: {integrity: sha512-5+ybhBZANEJxaH3X5evAFatUxLfEHSr7n6kYJ+1Qd0mUqr4eu9gIf6GDbWHf8RJijHrjjO8G+la14SlL2SeS1Q==} - - for-each@0.3.5: - resolution: {integrity: sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg==} - engines: {node: '>= 0.4'} - - framer-motion@13.0.0: - resolution: {integrity: sha512-nQGZXlsiigN48nzvE7AL1GLekql+etcphp8v+PQ0X04oxO20yVmV9rU9XQ25c136RdeIYoaWlKT9oAwvJza3mg==} - peerDependencies: - react: ^18.0.0 || ^19.0.0 - react-dom: ^18.0.0 || ^19.0.0 - peerDependenciesMeta: - react: - optional: true - react-dom: - optional: true - - function-bind@1.1.2: - resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} - - function.prototype.name@1.2.0: - resolution: {integrity: sha512-jObKIik1P2QjPHP5nz5BaOtUlfgS0fWo8IUByNXkM+o+02sJOi94em77GwJKQSJ3gfPHdgzLNrHc1uokV4P/ew==} - engines: {node: '>= 0.4'} - - functions-have-names@1.2.3: - resolution: {integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==} - - generator-function@2.0.1: - resolution: {integrity: sha512-SFdFmIJi+ybC0vjlHN0ZGVGHc3lgE0DxPAT0djjVg+kjOnSqclqmj0KQ7ykTOLP6YxoqOvuAODGdcHJn+43q3g==} - engines: {node: '>= 0.4'} - - gensync@1.0.0-beta.2: - resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} - engines: {node: '>=6.9.0'} - - get-intrinsic@1.3.0: - resolution: {integrity: sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==} - engines: {node: '>= 0.4'} - - get-proto@1.0.1: - resolution: {integrity: sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==} - engines: {node: '>= 0.4'} - - get-symbol-description@1.1.0: - resolution: {integrity: sha512-w9UMqWwJxHNOvoNzSJ2oPF5wvYcvP7jUvYzhp67yEhTi17ZDBBC1z9pTdGuzjD+EFIqLSYRweZjqfiPzQ06Ebg==} - engines: {node: '>= 0.4'} - - get-tsconfig@4.14.1: - resolution: {integrity: sha512-Dz/6HxkrxgNehhxLVeyv8sad9UzF2xBVeaKBQNDfJ5XiSXmp2gTR0eO0RWiT2NCKS5aGP9jjkOMggTN90qU50A==} - - glob-parent@5.1.2: - resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} - engines: {node: '>= 6'} - - glob-parent@6.0.2: - resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} - engines: {node: '>=10.13.0'} - - globals@14.0.0: - resolution: {integrity: sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==} - engines: {node: '>=18'} - - globals@16.4.0: - resolution: {integrity: sha512-ob/2LcVVaVGCYN+r14cnwnoDPUufjiYgSqRhiFD0Q1iI4Odora5RE8Iv1D24hAz5oMophRGkGz+yuvQmmUMnMw==} - engines: {node: '>=18'} - - globalthis@1.0.4: - resolution: {integrity: sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==} - engines: {node: '>= 0.4'} - - gopd@1.2.0: - resolution: {integrity: sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==} - engines: {node: '>= 0.4'} - - graceful-fs@4.2.11: - resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} - - has-bigints@1.1.0: - resolution: {integrity: sha512-R3pbpkcIqv2Pm3dUwgjclDRVmWpTJW2DcMzcIhEXEx1oh/CEMObMm3KLmRJOdvhM7o4uQBnwr8pzRK2sJWIqfg==} - engines: {node: '>= 0.4'} - - has-flag@4.0.0: - resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} - engines: {node: '>=8'} - - has-property-descriptors@1.0.2: - resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==} - - has-proto@1.2.0: - resolution: {integrity: sha512-KIL7eQPfHQRC8+XluaIw7BHUwwqL19bQn4hzNgdr+1wXoU0KKj6rufu47lhY7KbJR2C6T6+PfyN0Ea7wkSS+qQ==} - engines: {node: '>= 0.4'} - - has-symbols@1.1.0: - resolution: {integrity: sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==} - engines: {node: '>= 0.4'} - - has-tostringtag@1.0.2: - resolution: {integrity: sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==} - engines: {node: '>= 0.4'} - - hasown@2.0.4: - resolution: {integrity: sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==} - engines: {node: '>= 0.4'} - - hermes-estree@0.25.1: - resolution: {integrity: sha512-0wUoCcLp+5Ev5pDW2OriHC2MJCbwLwuRx+gAqMTOkGKJJiBCLjtrvy4PWUGn6MIVefecRpzoOZ/UV6iGdOr+Cw==} - - hermes-parser@0.25.1: - resolution: {integrity: sha512-6pEjquH3rqaI6cYAXYPcz9MS4rY6R4ngRgrgfDshRptUZIc3lw0MCIJIGDj9++mfySOuPTHB4nrSW99BCvOPIA==} - - ignore@5.3.2: - resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==} - engines: {node: '>= 4'} - - ignore@7.0.6: - resolution: {integrity: sha512-BAg6QkE8W+TuQLrrw0Ugr7HegXduRuuj8/ti2kSOc+jz1dmx8/WNcjr6XGnq5YpDWxFwwaavqD0+jIUOKelTsw==} - engines: {node: '>= 4'} - - import-fresh@3.3.1: - resolution: {integrity: sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==} - engines: {node: '>=6'} - - imurmurhash@0.1.4: - resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} - engines: {node: '>=0.8.19'} - - internal-slot@1.1.0: - resolution: {integrity: sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==} - engines: {node: '>= 0.4'} - - is-array-buffer@3.0.5: - resolution: {integrity: sha512-DDfANUiiG2wC1qawP66qlTugJeL5HyzMpfr8lLK+jMQirGzNod0B12cFB/9q838Ru27sBwfw78/rdoU7RERz6A==} - engines: {node: '>= 0.4'} - - is-async-function@2.1.1: - resolution: {integrity: sha512-9dgM/cZBnNvjzaMYHVoxxfPj2QXt22Ev7SuuPrs+xav0ukGB0S6d4ydZdEiM48kLx5kDV+QBPrpVnFyefL8kkQ==} - engines: {node: '>= 0.4'} - - is-bigint@1.1.0: - resolution: {integrity: sha512-n4ZT37wG78iz03xPRKJrHTdZbe3IicyucEtdRsV5yglwc3GyUfbAfpSeD0FJ41NbUNSt5wbhqfp1fS+BgnvDFQ==} - engines: {node: '>= 0.4'} - - is-boolean-object@1.2.2: - resolution: {integrity: sha512-wa56o2/ElJMYqjCjGkXri7it5FbebW5usLw/nPmCMs5DeZ7eziSYZhSmPRn0txqeW4LnAmQQU7FgqLpsEFKM4A==} - engines: {node: '>= 0.4'} - - is-bun-module@2.0.0: - resolution: {integrity: sha512-gNCGbnnnnFAUGKeZ9PdbyeGYJqewpmc2aKHUEMO5nQPWU9lOmv7jcmQIv+qHD8fXW6W7qfuCwX4rY9LNRjXrkQ==} - - is-callable@1.2.7: - resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==} - engines: {node: '>= 0.4'} - - is-core-module@2.16.2: - resolution: {integrity: sha512-evOr8xfXKxE6qSR0hSXL2r3sd7ALj8+7jQEUvPYcm5sgZFdJ+AYzT6yNmJenvIYQBgIGwfwz08sL8zoL7yq2BA==} - engines: {node: '>= 0.4'} - - is-data-view@1.0.2: - resolution: {integrity: sha512-RKtWF8pGmS87i2D6gqQu/l7EYRlVdfzemCJN/P3UOs//x1QE7mfhvzHIApBTRf7axvT6DMGwSwBXYCT0nfB9xw==} - engines: {node: '>= 0.4'} - - is-date-object@1.1.0: - resolution: {integrity: sha512-PwwhEakHVKTdRNVOw+/Gyh0+MzlCl4R6qKvkhuvLtPMggI1WAHt9sOwZxQLSGpUaDnrdyDsomoRgNnCfKNSXXg==} - engines: {node: '>= 0.4'} - - is-document.all@1.0.0: - resolution: {integrity: sha512-+XSoyS05OdBbhFuELhgTCpFNHkpBOJqtsZfUFFpe5QTw+9Sjbh8zitxhQkYAo6wV7e1Vb8cAPvpCk9jGam/82g==} - engines: {node: '>= 0.4'} - - is-extglob@2.1.1: - resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} - engines: {node: '>=0.10.0'} - - is-finalizationregistry@1.1.1: - resolution: {integrity: sha512-1pC6N8qWJbWoPtEjgcL2xyhQOP491EQjeUo3qTKcmV8YSDDJrOepfG8pcC7h/QgnQHYSv0mJ3Z/ZWxmatVrysg==} - engines: {node: '>= 0.4'} - - is-generator-function@1.1.2: - resolution: {integrity: sha512-upqt1SkGkODW9tsGNG5mtXTXtECizwtS2kA161M+gJPc1xdb/Ax629af6YrTwcOeQHbewrPNlE5Dx7kzvXTizA==} - engines: {node: '>= 0.4'} - - is-glob@4.0.3: - resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} - engines: {node: '>=0.10.0'} - - is-map@2.0.3: - resolution: {integrity: sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==} - engines: {node: '>= 0.4'} - - is-negative-zero@2.0.3: - resolution: {integrity: sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==} - engines: {node: '>= 0.4'} - - is-number-object@1.1.1: - resolution: {integrity: sha512-lZhclumE1G6VYD8VHe35wFaIif+CTy5SJIi5+3y4psDgWu4wPDoBhF8NxUOinEc7pHgiTsT6MaBb92rKhhD+Xw==} - engines: {node: '>= 0.4'} - - is-number@7.0.0: - resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} - engines: {node: '>=0.12.0'} - - is-regex@1.2.1: - resolution: {integrity: sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==} - engines: {node: '>= 0.4'} - - is-set@2.0.3: - resolution: {integrity: sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg==} - engines: {node: '>= 0.4'} - - is-shared-array-buffer@1.0.4: - resolution: {integrity: sha512-ISWac8drv4ZGfwKl5slpHG9OwPNty4jOWPRIhBpxOoD+hqITiwuipOQ2bNthAzwA3B4fIjO4Nln74N0S9byq8A==} - engines: {node: '>= 0.4'} - - is-string@1.1.1: - resolution: {integrity: sha512-BtEeSsoaQjlSPBemMQIrY1MY0uM6vnS1g5fmufYOtnxLGUZM2178PKbhsk7Ffv58IX+ZtcvoGwccYsh0PglkAA==} - engines: {node: '>= 0.4'} - - is-symbol@1.1.1: - resolution: {integrity: sha512-9gGx6GTtCQM73BgmHQXfDmLtfjjTUDSyoxTCbp5WtoixAhfgsDirWIcVQ/IHpvI5Vgd5i/J5F7B9cN/WlVbC/w==} - engines: {node: '>= 0.4'} - - is-typed-array@1.1.15: - resolution: {integrity: sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ==} - engines: {node: '>= 0.4'} - - is-weakmap@2.0.2: - resolution: {integrity: sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==} - engines: {node: '>= 0.4'} - - is-weakref@1.1.1: - resolution: {integrity: sha512-6i9mGWSlqzNMEqpCp93KwRS1uUOodk2OJ6b+sq7ZPDSy2WuI5NFIxp/254TytR8ftefexkWn5xNiHUNpPOfSew==} - engines: {node: '>= 0.4'} - - is-weakset@2.0.4: - resolution: {integrity: sha512-mfcwb6IzQyOKTs84CQMrOwW4gQcaTOAWJ0zzJCl2WSPDrWk/OzDaImWFH3djXhb24g4eudZfLRozAvPGw4d9hQ==} - engines: {node: '>= 0.4'} - - isarray@2.0.5: - resolution: {integrity: sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==} - - isexe@2.0.0: - resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} - - iterator.prototype@1.1.5: - resolution: {integrity: sha512-H0dkQoCa3b2VEeKQBOxFph+JAbcrQdE7KC0UkqwpLmv2EC4P41QXP+rqo9wYodACiG5/WM5s9oDApTU8utwj9g==} - engines: {node: '>= 0.4'} - - jiti@2.7.0: - resolution: {integrity: sha512-AC/7JofJvZGrrneWNaEnJeOLUx+JlGt7tNa0wZiRPT4MY1wmfKjt2+6O2p2uz2+skll8OZZmJMNqeke7kKbNgQ==} - hasBin: true - - js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - - js-yaml@4.3.1: - resolution: {integrity: sha512-CY6crGq313MX8GkwvB7tzgp99vjQxY1++5y10/BKN/GUfHqWaOGQMNZkBvqSzsZKWk/ijwHlWzzkLulsGHhjWQ==} - hasBin: true - - jsesc@3.1.0: - resolution: {integrity: sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==} - engines: {node: '>=6'} - hasBin: true - - json-buffer@3.0.1: - resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==} - - json-schema-traverse@0.4.1: - resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} - - json-stable-stringify-without-jsonify@1.0.1: - resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} - - json5@1.0.2: - resolution: {integrity: sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==} - hasBin: true - - json5@2.2.3: - resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==} - engines: {node: '>=6'} - hasBin: true - - jsx-ast-utils@3.3.5: - resolution: {integrity: sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ==} - engines: {node: '>=4.0'} - - keyv@4.5.4: - resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} - - language-subtag-registry@0.3.23: - resolution: {integrity: sha512-0K65Lea881pHotoGEa5gDlMxt3pctLi2RplBb7Ezh4rRdLEOtgi7n4EwK9lamnUCkKBqaeKRVebTq6BAxSkpXQ==} - - language-tags@1.0.9: - resolution: {integrity: sha512-MbjN408fEndfiQXbFQ1vnd+1NoLDsnQW41410oQBXiyXDMYH5z505juWa4KUE1LqxRC7DgOgZDbKLxHIwm27hA==} - engines: {node: '>=0.10'} - - levn@0.4.1: - resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} - engines: {node: '>= 0.8.0'} - - lightningcss-android-arm64@1.32.0: - resolution: {integrity: sha512-YK7/ClTt4kAK0vo6w3X+Pnm0D2cf2vPHbhOXdoNti1Ga0al1P4TBZhwjATvjNwLEBCnKvjJc2jQgHXH0NEwlAg==} - engines: {node: '>= 12.0.0'} - cpu: [arm64] - os: [android] - - lightningcss-darwin-arm64@1.32.0: - resolution: {integrity: sha512-RzeG9Ju5bag2Bv1/lwlVJvBE3q6TtXskdZLLCyfg5pt+HLz9BqlICO7LZM7VHNTTn/5PRhHFBSjk5lc4cmscPQ==} - engines: {node: '>= 12.0.0'} - cpu: [arm64] - os: [darwin] - - lightningcss-darwin-x64@1.32.0: - resolution: {integrity: sha512-U+QsBp2m/s2wqpUYT/6wnlagdZbtZdndSmut/NJqlCcMLTWp5muCrID+K5UJ6jqD2BFshejCYXniPDbNh73V8w==} - engines: {node: '>= 12.0.0'} - cpu: [x64] - os: [darwin] - - lightningcss-freebsd-x64@1.32.0: - resolution: {integrity: sha512-JCTigedEksZk3tHTTthnMdVfGf61Fky8Ji2E4YjUTEQX14xiy/lTzXnu1vwiZe3bYe0q+SpsSH/CTeDXK6WHig==} - engines: {node: '>= 12.0.0'} - cpu: [x64] - os: [freebsd] - - lightningcss-linux-arm-gnueabihf@1.32.0: - resolution: {integrity: sha512-x6rnnpRa2GL0zQOkt6rts3YDPzduLpWvwAF6EMhXFVZXD4tPrBkEFqzGowzCsIWsPjqSK+tyNEODUBXeeVHSkw==} - engines: {node: '>= 12.0.0'} - cpu: [arm] - os: [linux] - - lightningcss-linux-arm64-gnu@1.32.0: - resolution: {integrity: sha512-0nnMyoyOLRJXfbMOilaSRcLH3Jw5z9HDNGfT/gwCPgaDjnx0i8w7vBzFLFR1f6CMLKF8gVbebmkUN3fa/kQJpQ==} - engines: {node: '>= 12.0.0'} - cpu: [arm64] - os: [linux] - libc: [glibc] - - lightningcss-linux-arm64-musl@1.32.0: - resolution: {integrity: sha512-UpQkoenr4UJEzgVIYpI80lDFvRmPVg6oqboNHfoH4CQIfNA+HOrZ7Mo7KZP02dC6LjghPQJeBsvXhJod/wnIBg==} - engines: {node: '>= 12.0.0'} - cpu: [arm64] - os: [linux] - libc: [musl] - - lightningcss-linux-x64-gnu@1.32.0: - resolution: {integrity: sha512-V7Qr52IhZmdKPVr+Vtw8o+WLsQJYCTd8loIfpDaMRWGUZfBOYEJeyJIkqGIDMZPwPx24pUMfwSxxI8phr/MbOA==} - engines: {node: '>= 12.0.0'} - cpu: [x64] - os: [linux] - libc: [glibc] - - lightningcss-linux-x64-musl@1.32.0: - resolution: {integrity: sha512-bYcLp+Vb0awsiXg/80uCRezCYHNg1/l3mt0gzHnWV9XP1W5sKa5/TCdGWaR/zBM2PeF/HbsQv/j2URNOiVuxWg==} - engines: {node: '>= 12.0.0'} - cpu: [x64] - os: [linux] - libc: [musl] - - lightningcss-win32-arm64-msvc@1.32.0: - resolution: {integrity: sha512-8SbC8BR40pS6baCM8sbtYDSwEVQd4JlFTOlaD3gWGHfThTcABnNDBda6eTZeqbofalIJhFx0qKzgHJmcPTnGdw==} - engines: {node: '>= 12.0.0'} - cpu: [arm64] - os: [win32] - - lightningcss-win32-x64-msvc@1.32.0: - resolution: {integrity: sha512-Amq9B/SoZYdDi1kFrojnoqPLxYhQ4Wo5XiL8EVJrVsB8ARoC1PWW6VGtT0WKCemjy8aC+louJnjS7U18x3b06Q==} - engines: {node: '>= 12.0.0'} - cpu: [x64] - os: [win32] - - lightningcss@1.32.0: - resolution: {integrity: sha512-NXYBzinNrblfraPGyrbPoD19C1h9lfI/1mzgWYvXUTe414Gz/X1FD2XBZSZM7rRTrMA8JL3OtAaGifrIKhQ5yQ==} - engines: {node: '>= 12.0.0'} - - locate-path@6.0.0: - resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} - engines: {node: '>=10'} - - lodash.merge@4.6.2: - resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} - - loose-envify@1.4.0: - resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} - hasBin: true - - lru-cache@5.1.1: - resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==} - - magic-string@0.30.21: - resolution: {integrity: sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==} - - math-intrinsics@1.1.0: - resolution: {integrity: sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==} - engines: {node: '>= 0.4'} - - merge2@1.4.1: - resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} - engines: {node: '>= 8'} - - micromatch@4.0.8: - resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==} - engines: {node: '>=8.6'} - - minimatch@10.2.6: - resolution: {integrity: sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==} - engines: {node: 18 || 20 || >=22} - - minimatch@3.1.5: - resolution: {integrity: sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==} - - minimist@1.2.8: - resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} - - motion-dom@13.0.0: - resolution: {integrity: sha512-Xk+SJas70uMAUIApg+m3lZDShxI3LBFHq7mFGbBKoRXc2PVPDyAKmzN64Bbzt4CZdP/CItTiJxWtn4TA0v53Ng==} - - motion-utils@13.0.0: - resolution: {integrity: sha512-7DnN7TmbLcYXcG4RVadXIihWlyuM9afoUww8Y5Agg431kGKiuL2/OMyP4mJ5wLz+pvN3t5ySClLOaVXJ+wekRQ==} - - motion@13.0.0: - resolution: {integrity: sha512-RYZjEpgHUCKjBNqjmUQzW93VJWLvEZGTPdKRFSqOdOl07IIMvz+WrsZmD1XXAkoFLruW/8bO1L7UF+ViQTxtLg==} - peerDependencies: - react: ^18.0.0 || ^19.0.0 - react-dom: ^18.0.0 || ^19.0.0 - peerDependenciesMeta: - react: - optional: true - react-dom: - optional: true - - ms@2.1.3: - resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - - nanoid@3.3.18: - resolution: {integrity: sha512-DTg4MJbGMWkfi6VZFdNt2/caMbQy4Ou+Op/hJQvGEWcnVfoA1QA+xzRKAzw9jD6+GVOOeYr/mIcuDSdug6F6+w==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - - napi-postinstall@0.3.4: - resolution: {integrity: sha512-PHI5f1O0EP5xJ9gQmFGMS6IZcrVvTjpXjz7Na41gTE7eE2hK11lg04CECCYEEjdc17EV4DO+fkGEtt7TpTaTiQ==} - engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} - hasBin: true - - natural-compare@1.4.0: - resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} - - next@16.3.0: - resolution: {integrity: sha512-NEdGOzH+08eTXMUp9UYkA99Nhi5N6Thrhc1jgFOQgfgnGK/dA2hRwBpXep+exdFQrnwlRf/3Wixyp8lLBUpE2A==} - engines: {node: '>=20.9.0'} - hasBin: true - peerDependencies: - '@opentelemetry/api': ^1.1.0 - '@playwright/test': ^1.51.1 - babel-plugin-react-compiler: '*' - react: ^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0 - react-dom: ^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0 - sass: ^1.3.0 - peerDependenciesMeta: - '@opentelemetry/api': - optional: true - '@playwright/test': - optional: true - babel-plugin-react-compiler: - optional: true - sass: - optional: true - - node-exports-info@1.6.2: - resolution: {integrity: sha512-kXs9Go0cah0qHVV2v389IXQLdLCeE1xfFtjOAF+iobu0OIoG1pje8At2vMHyaPMiPMnG/LWP50twML21eMcAag==} - engines: {node: '>= 0.4'} - - node-releases@2.0.53: - resolution: {integrity: sha512-D9UOmYG3UH1V+ENW56t5QXBwJw1YEY18ruVeus89Rw+SyIgjPkCO84bRzO3uNIYosJbNwiabWVn48o3uJLjxFQ==} - engines: {node: '>=18'} - - object-assign@4.1.1: - resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} - engines: {node: '>=0.10.0'} - - object-inspect@1.13.4: - resolution: {integrity: sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==} - engines: {node: '>= 0.4'} - - object-keys@1.1.1: - resolution: {integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==} - engines: {node: '>= 0.4'} - - object.assign@4.1.7: - resolution: {integrity: sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw==} - engines: {node: '>= 0.4'} - - object.entries@1.1.9: - resolution: {integrity: sha512-8u/hfXFRBD1O0hPUjioLhoWFHRmt6tKA4/vZPyckBr18l1KE9uHrFaFaUi8MDRTpi4uak2goyPTSNJLXX2k2Hw==} - engines: {node: '>= 0.4'} - - object.fromentries@2.0.8: - resolution: {integrity: sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ==} - engines: {node: '>= 0.4'} - - object.groupby@1.0.3: - resolution: {integrity: sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ==} - engines: {node: '>= 0.4'} - - object.values@1.2.1: - resolution: {integrity: sha512-gXah6aZrcUxjWg2zR2MwouP2eHlCBzdV4pygudehaKXSGW4v2AsRQUK+lwwXhii6KFZcunEnmSUoYp5CXibxtA==} - engines: {node: '>= 0.4'} - - optionator@0.9.4: - resolution: {integrity: sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==} - engines: {node: '>= 0.8.0'} - - own-keys@1.0.2: - resolution: {integrity: sha512-19YVAg7T+WTrxggPukVq7DjTv6+PJ867TmhCvBsYwmbFCsZd344rq2Ld1p0wo8f8Qrrhgp82c6FJRqdXWtSEhg==} - engines: {node: '>= 0.4'} - - p-limit@3.1.0: - resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} - engines: {node: '>=10'} - - p-locate@5.0.0: - resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} - engines: {node: '>=10'} - - parent-module@1.0.1: - resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} - engines: {node: '>=6'} - - path-exists@4.0.0: - resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} - engines: {node: '>=8'} - - path-key@3.1.1: - resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} - engines: {node: '>=8'} - - path-parse@1.0.7: - resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} - - picocolors@1.1.1: - resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} - - picomatch@2.3.2: - resolution: {integrity: sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==} - engines: {node: '>=8.6'} - - picomatch@4.0.5: - resolution: {integrity: sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==} - engines: {node: '>=12'} - - possible-typed-array-names@1.1.0: - resolution: {integrity: sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==} - engines: {node: '>= 0.4'} - - postcss@8.5.23: - resolution: {integrity: sha512-g50586zr4bZmwFiTlflMu8E0bDTb5I5gertgwAKmsdUlTQIhZtunzUlD1WSzwcVWPoAVpsrA6vlfCD7oXvRwgg==} - engines: {node: ^10 || ^12 || >=14} - - postcss@8.5.26: - resolution: {integrity: sha512-u82N74LFzG8ca+dD8puPnplTXoGH4fTPpVGuIbt36G3qvNlkvfD0lEAZSxaly3KX8TS/L1A1gsCEmvKmBcVbkQ==} - engines: {node: ^10 || ^12 || >=14} - - prelude-ls@1.2.1: - resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} - engines: {node: '>= 0.8.0'} - - prop-types@15.8.1: - resolution: {integrity: sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==} - - punycode@2.3.1: - resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} - engines: {node: '>=6'} - - queue-microtask@1.2.3: - resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} - - react-dom@19.2.8: - resolution: {integrity: sha512-rVprimfGBG3DR+Tq0IQG2DT5PxKth1WIGDmj5yPmlzr4YBe7uyE+Du4oVqTDXZSHGGGXRtTJEGSSePyQCMBglQ==} - peerDependencies: - react: ^19.2.8 - - react-is@16.13.1: - resolution: {integrity: sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==} - - react@19.2.8: - resolution: {integrity: sha512-PWaYA1L/q9u2u7xYQi+Y3L3Yfnie7XyLeaJICV1MGD6LprsBxcAqGjYyr0eY3p+QdsA+x/Irkt4Qif8D63+Sbw==} - engines: {node: '>=0.10.0'} - - reflect.getprototypeof@1.0.10: - resolution: {integrity: sha512-00o4I+DVrefhv+nX0ulyi3biSHCPDe+yLv5o/p6d/UVlirijB8E16FtfwSAi4g3tcqrQ4lRAqQSoFEZJehYEcw==} - engines: {node: '>= 0.4'} - - regexp.prototype.flags@1.5.4: - resolution: {integrity: sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA==} - engines: {node: '>= 0.4'} - - resolve-from@4.0.0: - resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} - engines: {node: '>=4'} - - resolve-pkg-maps@1.0.0: - resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==} - - resolve@2.0.0-next.7: - resolution: {integrity: sha512-tqt+NBWwyaMgw3zDsnygx4CByWjQEJHOPMdslYhppaQSJUtL/D4JO9CcBBlhPoI8lz9oJIDXkwXfhF4aWqP8xQ==} - engines: {node: '>= 0.4'} - hasBin: true - - reusify@1.1.0: - resolution: {integrity: sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==} - engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - - run-parallel@1.2.0: - resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} - - safe-array-concat@1.1.4: - resolution: {integrity: sha512-wtZlHyOje6OZTGqAoaDKxFkgRtkF9CnHAVnCHKfuj200wAgL+bSJhdsCD2l0Qx/2ekEXjPWcyKkfGb5CPboslg==} - engines: {node: '>=0.4'} - - safe-push-apply@1.0.0: - resolution: {integrity: sha512-iKE9w/Z7xCzUMIZqdBsp6pEQvwuEebH4vdpjcDWnyzaI6yl6O9FHvVpmGelvEHNsoY6wGblkxR6Zty/h00WiSA==} - engines: {node: '>= 0.4'} - - safe-regex-test@1.1.0: - resolution: {integrity: sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==} - engines: {node: '>= 0.4'} - - scheduler@0.27.0: - resolution: {integrity: sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==} - - semver@6.3.1: - resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} - hasBin: true - - semver@7.8.5: - resolution: {integrity: sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==} - engines: {node: '>=10'} - hasBin: true - - set-function-length@1.2.2: - resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==} - engines: {node: '>= 0.4'} - - set-function-name@2.0.2: - resolution: {integrity: sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==} - engines: {node: '>= 0.4'} - - set-proto@1.0.0: - resolution: {integrity: sha512-RJRdvCo6IAnPdsvP/7m6bsQqNnn1FCBX5ZNtFL98MmFF/4xAIJTIg1YbHW5DC2W5SKZanrC6i4HsJqlajw/dZw==} - engines: {node: '>= 0.4'} - - sharp@0.35.3: - resolution: {integrity: sha512-ej0zVHuZGHCiABXcNxeYhpRnPNPAcvbG8RMdBAhDAxLKkCRVSpK3Iyu7qbqw3JMzoj0REeM6f3tJLtVwl0023Q==} - engines: {node: '>=20.9.0'} - peerDependencies: - '@types/node': '*' - peerDependenciesMeta: - '@types/node': - optional: true - - shebang-command@2.0.0: - resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} - engines: {node: '>=8'} - - shebang-regex@3.0.0: - resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} - engines: {node: '>=8'} - - side-channel-list@1.0.1: - resolution: {integrity: sha512-mjn/0bi/oUURjc5Xl7IaWi/OJJJumuoJFQJfDDyO46+hBWsfaVM65TBHq2eoZBhzl9EchxOijpkbRC8SVBQU0w==} - engines: {node: '>= 0.4'} - - side-channel-map@1.0.1: - resolution: {integrity: sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==} - engines: {node: '>= 0.4'} - - side-channel-weakmap@1.0.2: - resolution: {integrity: sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==} - engines: {node: '>= 0.4'} - - side-channel@1.1.1: - resolution: {integrity: sha512-6x6dK6zJdpTzF4sQeNYxwtvBzf6Eg4GtlesS94HOvTudUeyK2WXAaIfmDgsyslYrRBeFIlsi54AYsFGUuhmvrQ==} - engines: {node: '>= 0.4'} - - source-map-js@1.2.1: - resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} - engines: {node: '>=0.10.0'} - - stable-hash@0.0.5: - resolution: {integrity: sha512-+L3ccpzibovGXFK+Ap/f8LOS0ahMrHTf3xu7mMLSpEGU0EO9ucaysSylKo9eRDFNhWve/y275iPmIZ4z39a9iA==} - - stop-iteration-iterator@1.1.0: - resolution: {integrity: sha512-eLoXW/DHyl62zxY4SCaIgnRhuMr6ri4juEYARS8E6sCEqzKpOiE521Ucofdx+KnDZl5xmvGYaaKCk5FEOxJCoQ==} - engines: {node: '>= 0.4'} - - string.prototype.includes@2.0.1: - resolution: {integrity: sha512-o7+c9bW6zpAdJHTtujeePODAhkuicdAryFsfVKwA+wGw89wJ4GTY484WTucM9hLtDEOpOvI+aHnzqnC5lHp4Rg==} - engines: {node: '>= 0.4'} - - string.prototype.matchall@4.0.12: - resolution: {integrity: sha512-6CC9uyBL+/48dYizRf7H7VAYCMCNTBeM78x/VTUe9bFEaxBepPJDa1Ow99LqI/1yF7kuy7Q3cQsYMrcjGUcskA==} - engines: {node: '>= 0.4'} - - string.prototype.repeat@1.0.0: - resolution: {integrity: sha512-0u/TldDbKD8bFCQ/4f5+mNRrXwZ8hg2w7ZR8wa16e8z9XpePWl3eGEcUD0OXpEH/VJH/2G3gjUtR3ZOiBe2S/w==} - - string.prototype.trim@1.2.11: - resolution: {integrity: sha512-PwvK7BU+CMTJGYQCTZb5RWXIML92lftJLhQz1tBzgKiqGxJaMlBAa48POXaNAC2s4y8jr3EFqrkF9+44neS46w==} - engines: {node: '>= 0.4'} - - string.prototype.trimend@1.0.10: - resolution: {integrity: sha512-2+3aDAOmPTmuFwjDnmJG2ctEkQKVki7vOSqaxkv42Mowj1V6PnvuwFCRrR5lChUux1TBskPjfkeTOhqczDMxTw==} - engines: {node: '>= 0.4'} - - string.prototype.trimstart@1.0.8: - resolution: {integrity: sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==} - engines: {node: '>= 0.4'} - - strip-bom@3.0.0: - resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==} - engines: {node: '>=4'} - - strip-json-comments@3.1.1: - resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} - engines: {node: '>=8'} - - styled-jsx@5.1.6: - resolution: {integrity: sha512-qSVyDTeMotdvQYoHWLNGwRFJHC+i+ZvdBRYosOFgC+Wg1vx4frN2/RG/NA7SYqqvKNLf39P2LSRA2pu6n0XYZA==} - engines: {node: '>= 12.0.0'} - peerDependencies: - '@babel/core': '*' - babel-plugin-macros: '*' - react: '>= 16.8.0 || 17.x.x || ^18.0.0-0 || ^19.0.0-0' - peerDependenciesMeta: - '@babel/core': - optional: true - babel-plugin-macros: - optional: true - - supports-color@7.2.0: - resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} - engines: {node: '>=8'} - - supports-preserve-symlinks-flag@1.0.0: - resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} - engines: {node: '>= 0.4'} - - tailwindcss@4.3.3: - resolution: {integrity: sha512-gOhV3P7ufE62QDGg1zVaTgCR+EtPv92k2nIhVcVKcLmxT1sUBsQGhnZj175j+MqRt4zLF7ic+sCYjfhxMxj7YQ==} - - tapable@2.3.3: - resolution: {integrity: sha512-uxc/zpqFg6x7C8vOE7lh6Lbda8eEL9zmVm/PLeTPBRhh1xCgdWaQ+J1CUieGpIfm2HdtsUpRv+HshiasBMcc6A==} - engines: {node: '>=6'} - - tinyglobby@0.2.17: - resolution: {integrity: sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==} - engines: {node: '>=12.0.0'} - - to-regex-range@5.0.1: - resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} - engines: {node: '>=8.0'} - - ts-api-utils@2.5.0: - resolution: {integrity: sha512-OJ/ibxhPlqrMM0UiNHJ/0CKQkoKF243/AEmplt3qpRgkW8VG7IfOS41h7V8TjITqdByHzrjcS/2si+y4lIh8NA==} - engines: {node: '>=18.12'} - peerDependencies: - typescript: '>=4.8.4' - - tsconfig-paths@3.15.0: - resolution: {integrity: sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==} - - tslib@2.8.1: - resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} - - type-check@0.4.0: - resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} - engines: {node: '>= 0.8.0'} - - typed-array-buffer@1.0.3: - resolution: {integrity: sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw==} - engines: {node: '>= 0.4'} - - typed-array-byte-length@1.0.3: - resolution: {integrity: sha512-BaXgOuIxz8n8pIq3e7Atg/7s+DpiYrxn4vdot3w9KbnBhcRQq6o3xemQdIfynqSeXeDrF32x+WvfzmOjPiY9lg==} - engines: {node: '>= 0.4'} - - typed-array-byte-offset@1.0.4: - resolution: {integrity: sha512-bTlAFB/FBYMcuX81gbL4OcpH5PmlFHqlCCpAl8AlEzMz5k53oNDvN8p1PNOWLEmI2x4orp3raOFB51tv9X+MFQ==} - engines: {node: '>= 0.4'} - - typed-array-length@1.0.8: - resolution: {integrity: sha512-phPGCwqr2+Qo0fwniCE8e4pKnGu/yFb5nD5Y8bf0EEeiI5GklnACYA9GFy/DrAeRrKHXvHn+1SUsOWgJp6RO+g==} - engines: {node: '>= 0.4'} - - typescript-eslint@8.66.0: - resolution: {integrity: sha512-QlEbBPz/RuJ1XUHj29nm3t0F/O/cSlEnntozqPOYHnnTGAXFamnMBu5i9Vn6vhUPHGAjR+Vl+5J8vPN/BMUrJw==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - peerDependencies: - eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 - typescript: '>=4.8.4 <6.1.0' - - typescript@5.9.3: - resolution: {integrity: sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==} - engines: {node: '>=14.17'} - hasBin: true - - unbox-primitive@1.1.0: - resolution: {integrity: sha512-nWJ91DjeOkej/TA8pXQ3myruKpKEYgqvpw9lz4OPHj/NWFNluYrjbz9j01CJ8yKQd2g4jFoOkINCTW2I5LEEyw==} - engines: {node: '>= 0.4'} - - undici-types@6.21.0: - resolution: {integrity: sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==} - - unrs-resolver@1.12.2: - resolution: {integrity: sha512-dmlRxBJJayXjqTwC+JtF1HhJmgf3ftQ3YejFcZrf4+KKtJv0qDsK1pjqaaVjG7wJ5NJ6UVP1OqRMQ71Z4C3rxQ==} - - update-browserslist-db@1.3.0: - resolution: {integrity: sha512-x/M6q3w4Ybp91CNaS4S69UnliqR3BzRpOT6LWbksjth0S/+jhfaPJsWjt/TewpT8j9eLIojUf5jr29WextHroA==} - hasBin: true - peerDependencies: - browserslist: '>= 4.21.0' - - uri-js@4.4.1: - resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} - - which-boxed-primitive@1.1.1: - resolution: {integrity: sha512-TbX3mj8n0odCBFVlY8AxkqcHASw3L60jIuF8jFP78az3C2YhmGvqbHBpAjTRH2/xqYunrJ9g1jSyjCjpoWzIAA==} - engines: {node: '>= 0.4'} - - which-builtin-type@1.2.1: - resolution: {integrity: sha512-6iBczoX+kDQ7a3+YJBnh3T+KZRxM/iYNPXicqk66/Qfm1b93iu+yOImkg0zHbj5LNOcNv1TEADiZ0xa34B4q6Q==} - engines: {node: '>= 0.4'} - - which-collection@1.0.2: - resolution: {integrity: sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw==} - engines: {node: '>= 0.4'} - - which-typed-array@1.1.22: - resolution: {integrity: sha512-fvO4ExWMFsqyhG3AiPAObMuY1lxaqgYcxbc49CNdWDDECOJNgQyvsOWVwbZc+qf3rzRtxojBK+CMEv0Ld5CYpw==} - engines: {node: '>= 0.4'} - - which@2.0.2: - resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} - engines: {node: '>= 8'} - hasBin: true - - word-wrap@1.2.5: - resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==} - engines: {node: '>=0.10.0'} - - yallist@3.1.1: - resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==} - - yocto-queue@0.1.0: - resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} - engines: {node: '>=10'} - - zod-validation-error@4.0.2: - resolution: {integrity: sha512-Q6/nZLe6jxuU80qb/4uJ4t5v2VEZ44lzQjPDhYJNztRQ4wyWc6VF3D3Kb/fAuPetZQnhS3hnajCf9CsWesghLQ==} - engines: {node: '>=18.0.0'} - peerDependencies: - zod: ^3.25.0 || ^4.0.0 - - zod@4.4.3: - resolution: {integrity: sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ==} - -snapshots: - - '@alloc/quick-lru@5.2.0': {} - - '@babel/code-frame@7.29.7': - dependencies: - '@babel/helper-validator-identifier': 7.29.7 - js-tokens: 4.0.0 - picocolors: 1.1.1 - - '@babel/compat-data@7.29.7': {} - - '@babel/core@7.29.7': - dependencies: - '@babel/code-frame': 7.29.7 - '@babel/generator': 7.29.8 - '@babel/helper-compilation-targets': 7.29.7 - '@babel/helper-module-transforms': 7.29.7(@babel/core@7.29.7) - '@babel/helpers': 7.29.7 - '@babel/parser': 7.29.8 - '@babel/template': 7.29.7 - '@babel/traverse': 7.29.8 - '@babel/types': 7.29.8 - '@jridgewell/remapping': 2.3.5 - convert-source-map: 2.0.0 - debug: 4.4.3 - gensync: 1.0.0-beta.2 - json5: 2.2.3 - semver: 6.3.1 - transitivePeerDependencies: - - supports-color - - '@babel/generator@7.29.8': - dependencies: - '@babel/parser': 7.29.8 - '@babel/types': 7.29.8 - '@jridgewell/gen-mapping': 0.3.13 - '@jridgewell/trace-mapping': 0.3.31 - jsesc: 3.1.0 - - '@babel/helper-compilation-targets@7.29.7': - dependencies: - '@babel/compat-data': 7.29.7 - '@babel/helper-validator-option': 7.29.7 - browserslist: 4.28.7 - lru-cache: 5.1.1 - semver: 6.3.1 - - '@babel/helper-globals@7.29.7': {} - - '@babel/helper-module-imports@7.29.7': - dependencies: - '@babel/traverse': 7.29.8 - '@babel/types': 7.29.8 - transitivePeerDependencies: - - supports-color - - '@babel/helper-module-transforms@7.29.7(@babel/core@7.29.7)': - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-module-imports': 7.29.7 - '@babel/helper-validator-identifier': 7.29.7 - '@babel/traverse': 7.29.8 - transitivePeerDependencies: - - supports-color - - '@babel/helper-string-parser@7.29.7': {} - - '@babel/helper-validator-identifier@7.29.7': {} - - '@babel/helper-validator-option@7.29.7': {} - - '@babel/helpers@7.29.7': - dependencies: - '@babel/template': 7.29.7 - '@babel/types': 7.29.8 - - '@babel/parser@7.29.8': - dependencies: - '@babel/types': 7.29.8 - - '@babel/template@7.29.7': - dependencies: - '@babel/code-frame': 7.29.7 - '@babel/parser': 7.29.8 - '@babel/types': 7.29.8 - - '@babel/traverse@7.29.8': - dependencies: - '@babel/code-frame': 7.29.7 - '@babel/generator': 7.29.8 - '@babel/helper-globals': 7.29.7 - '@babel/parser': 7.29.8 - '@babel/template': 7.29.7 - '@babel/types': 7.29.8 - debug: 4.4.3 - transitivePeerDependencies: - - supports-color - - '@babel/types@7.29.8': - dependencies: - '@babel/helper-string-parser': 7.29.7 - '@babel/helper-validator-identifier': 7.29.7 - - '@emnapi/core@1.10.0': - dependencies: - '@emnapi/wasi-threads': 1.2.1 - tslib: 2.8.1 - optional: true - - '@emnapi/runtime@1.10.0': - dependencies: - tslib: 2.8.1 - optional: true - - '@emnapi/runtime@1.11.3': - dependencies: - tslib: 2.8.1 - optional: true - - '@emnapi/wasi-threads@1.2.1': - dependencies: - tslib: 2.8.1 - optional: true - - '@eslint-community/eslint-utils@4.10.1(eslint@9.39.5(jiti@2.7.0))': - dependencies: - eslint: 9.39.5(jiti@2.7.0) - eslint-visitor-keys: 3.4.3 - - '@eslint-community/eslint-utils@4.9.1(eslint@9.39.5(jiti@2.7.0))': - dependencies: - eslint: 9.39.5(jiti@2.7.0) - eslint-visitor-keys: 3.4.3 - - '@eslint-community/regexpp@4.12.2': {} - - '@eslint/config-array@0.21.2': - dependencies: - '@eslint/object-schema': 2.1.7 - debug: 4.4.3 - minimatch: 3.1.5 - transitivePeerDependencies: - - supports-color - - '@eslint/config-helpers@0.4.2': - dependencies: - '@eslint/core': 0.17.0 - - '@eslint/core@0.17.0': - dependencies: - '@types/json-schema': 7.0.15 - - '@eslint/eslintrc@3.3.6': - dependencies: - ajv: 6.15.0 - debug: 4.4.3 - espree: 10.4.0 - globals: 14.0.0 - ignore: 5.3.2 - import-fresh: 3.3.1 - js-yaml: 4.3.1 - minimatch: 3.1.5 - strip-json-comments: 3.1.1 - transitivePeerDependencies: - - supports-color - - '@eslint/js@9.39.5': {} - - '@eslint/object-schema@2.1.7': {} - - '@eslint/plugin-kit@0.4.1': - dependencies: - '@eslint/core': 0.17.0 - levn: 0.4.1 - - '@humanfs/core@0.19.2': - dependencies: - '@humanfs/types': 0.15.0 - - '@humanfs/node@0.16.8': - dependencies: - '@humanfs/core': 0.19.2 - '@humanfs/types': 0.15.0 - '@humanwhocodes/retry': 0.4.3 - - '@humanfs/types@0.15.0': {} - - '@humanwhocodes/module-importer@1.0.1': {} - - '@humanwhocodes/retry@0.4.3': {} - - '@img/colour@1.1.0': - optional: true - - '@img/sharp-darwin-arm64@0.35.3': - optionalDependencies: - '@img/sharp-libvips-darwin-arm64': 1.3.2 - optional: true - - '@img/sharp-darwin-x64@0.35.3': - optionalDependencies: - '@img/sharp-libvips-darwin-x64': 1.3.2 - optional: true - - '@img/sharp-freebsd-wasm32@0.35.3': - dependencies: - '@img/sharp-wasm32': 0.35.3 - optional: true - - '@img/sharp-libvips-darwin-arm64@1.3.2': - optional: true - - '@img/sharp-libvips-darwin-x64@1.3.2': - optional: true - - '@img/sharp-libvips-linux-arm64@1.3.2': - optional: true - - '@img/sharp-libvips-linux-arm@1.3.2': - optional: true - - '@img/sharp-libvips-linux-ppc64@1.3.2': - optional: true - - '@img/sharp-libvips-linux-riscv64@1.3.2': - optional: true - - '@img/sharp-libvips-linux-s390x@1.3.2': - optional: true - - '@img/sharp-libvips-linux-x64@1.3.2': - optional: true - - '@img/sharp-libvips-linuxmusl-arm64@1.3.2': - optional: true - - '@img/sharp-libvips-linuxmusl-x64@1.3.2': - optional: true - - '@img/sharp-linux-arm64@0.35.3': - optionalDependencies: - '@img/sharp-libvips-linux-arm64': 1.3.2 - optional: true - - '@img/sharp-linux-arm@0.35.3': - optionalDependencies: - '@img/sharp-libvips-linux-arm': 1.3.2 - optional: true - - '@img/sharp-linux-ppc64@0.35.3': - optionalDependencies: - '@img/sharp-libvips-linux-ppc64': 1.3.2 - optional: true - - '@img/sharp-linux-riscv64@0.35.3': - optionalDependencies: - '@img/sharp-libvips-linux-riscv64': 1.3.2 - optional: true - - '@img/sharp-linux-s390x@0.35.3': - optionalDependencies: - '@img/sharp-libvips-linux-s390x': 1.3.2 - optional: true - - '@img/sharp-linux-x64@0.35.3': - optionalDependencies: - '@img/sharp-libvips-linux-x64': 1.3.2 - optional: true - - '@img/sharp-linuxmusl-arm64@0.35.3': - optionalDependencies: - '@img/sharp-libvips-linuxmusl-arm64': 1.3.2 - optional: true - - '@img/sharp-linuxmusl-x64@0.35.3': - optionalDependencies: - '@img/sharp-libvips-linuxmusl-x64': 1.3.2 - optional: true - - '@img/sharp-wasm32@0.35.3': - dependencies: - '@emnapi/runtime': 1.11.3 - optional: true - - '@img/sharp-webcontainers-wasm32@0.35.3': - dependencies: - '@img/sharp-wasm32': 0.35.3 - optional: true - - '@img/sharp-win32-arm64@0.35.3': - optional: true - - '@img/sharp-win32-ia32@0.35.3': - optional: true - - '@img/sharp-win32-x64@0.35.3': - optional: true - - '@jridgewell/gen-mapping@0.3.13': - dependencies: - '@jridgewell/sourcemap-codec': 1.5.5 - '@jridgewell/trace-mapping': 0.3.31 - - '@jridgewell/remapping@2.3.5': - dependencies: - '@jridgewell/gen-mapping': 0.3.13 - '@jridgewell/trace-mapping': 0.3.31 - - '@jridgewell/resolve-uri@3.1.2': {} - - '@jridgewell/sourcemap-codec@1.5.5': {} - - '@jridgewell/trace-mapping@0.3.31': - dependencies: - '@jridgewell/resolve-uri': 3.1.2 - '@jridgewell/sourcemap-codec': 1.5.5 - - '@napi-rs/wasm-runtime@1.2.2(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)': - dependencies: - '@emnapi/core': 1.10.0 - '@emnapi/runtime': 1.10.0 - '@tybys/wasm-util': 0.10.3 - optional: true - - '@next/env@16.3.0': {} - - '@next/eslint-plugin-next@16.3.0(eslint@9.39.5(jiti@2.7.0))': - dependencies: - '@eslint-community/eslint-utils': 4.9.1(eslint@9.39.5(jiti@2.7.0)) - fast-glob: 3.3.1 - transitivePeerDependencies: - - eslint - - '@next/swc-darwin-arm64@16.3.0': - optional: true - - '@next/swc-darwin-x64@16.3.0': - optional: true - - '@next/swc-linux-arm64-gnu@16.3.0': - optional: true - - '@next/swc-linux-arm64-musl@16.3.0': - optional: true - - '@next/swc-linux-x64-gnu@16.3.0': - optional: true - - '@next/swc-linux-x64-musl@16.3.0': - optional: true - - '@next/swc-win32-arm64-msvc@16.3.0': - optional: true - - '@next/swc-win32-x64-msvc@16.3.0': - optional: true - - '@nodelib/fs.scandir@2.1.5': - dependencies: - '@nodelib/fs.stat': 2.0.5 - run-parallel: 1.2.0 - - '@nodelib/fs.stat@2.0.5': {} - - '@nodelib/fs.walk@1.2.8': - dependencies: - '@nodelib/fs.scandir': 2.1.5 - fastq: 1.20.1 - - '@nolyfill/is-core-module@1.0.39': {} - - '@rtsao/scc@1.1.0': {} - - '@swc/helpers@0.5.15': - dependencies: - tslib: 2.8.1 - - '@tailwindcss/node@4.3.3': - dependencies: - '@jridgewell/remapping': 2.3.5 - enhanced-resolve: 5.24.5 - jiti: 2.7.0 - lightningcss: 1.32.0 - magic-string: 0.30.21 - source-map-js: 1.2.1 - tailwindcss: 4.3.3 - - '@tailwindcss/oxide-android-arm64@4.3.3': - optional: true - - '@tailwindcss/oxide-darwin-arm64@4.3.3': - optional: true - - '@tailwindcss/oxide-darwin-x64@4.3.3': - optional: true - - '@tailwindcss/oxide-freebsd-x64@4.3.3': - optional: true - - '@tailwindcss/oxide-linux-arm-gnueabihf@4.3.3': - optional: true - - '@tailwindcss/oxide-linux-arm64-gnu@4.3.3': - optional: true - - '@tailwindcss/oxide-linux-arm64-musl@4.3.3': - optional: true - - '@tailwindcss/oxide-linux-x64-gnu@4.3.3': - optional: true - - '@tailwindcss/oxide-linux-x64-musl@4.3.3': - optional: true - - '@tailwindcss/oxide-wasm32-wasi@4.3.3': - optional: true - - '@tailwindcss/oxide-win32-arm64-msvc@4.3.3': - optional: true - - '@tailwindcss/oxide-win32-x64-msvc@4.3.3': - optional: true - - '@tailwindcss/oxide@4.3.3': - optionalDependencies: - '@tailwindcss/oxide-android-arm64': 4.3.3 - '@tailwindcss/oxide-darwin-arm64': 4.3.3 - '@tailwindcss/oxide-darwin-x64': 4.3.3 - '@tailwindcss/oxide-freebsd-x64': 4.3.3 - '@tailwindcss/oxide-linux-arm-gnueabihf': 4.3.3 - '@tailwindcss/oxide-linux-arm64-gnu': 4.3.3 - '@tailwindcss/oxide-linux-arm64-musl': 4.3.3 - '@tailwindcss/oxide-linux-x64-gnu': 4.3.3 - '@tailwindcss/oxide-linux-x64-musl': 4.3.3 - '@tailwindcss/oxide-wasm32-wasi': 4.3.3 - '@tailwindcss/oxide-win32-arm64-msvc': 4.3.3 - '@tailwindcss/oxide-win32-x64-msvc': 4.3.3 - - '@tailwindcss/postcss@4.3.3': - dependencies: - '@alloc/quick-lru': 5.2.0 - '@tailwindcss/node': 4.3.3 - '@tailwindcss/oxide': 4.3.3 - postcss: 8.5.26 - tailwindcss: 4.3.3 - - '@tybys/wasm-util@0.10.3': - dependencies: - tslib: 2.8.1 - optional: true - - '@types/estree@1.0.9': {} - - '@types/json-schema@7.0.15': {} - - '@types/json5@0.0.29': {} - - '@types/node@20.19.43': - dependencies: - undici-types: 6.21.0 - - '@types/react-dom@19.2.4(@types/react@19.2.18)': - dependencies: - '@types/react': 19.2.18 - - '@types/react@19.2.18': - dependencies: - csstype: 3.2.3 - - '@typescript-eslint/eslint-plugin@8.66.0(@typescript-eslint/parser@8.66.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3))(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3)': - dependencies: - '@eslint-community/regexpp': 4.12.2 - '@typescript-eslint/parser': 8.66.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3) - '@typescript-eslint/scope-manager': 8.66.0 - '@typescript-eslint/type-utils': 8.66.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3) - '@typescript-eslint/utils': 8.66.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3) - '@typescript-eslint/visitor-keys': 8.66.0 - eslint: 9.39.5(jiti@2.7.0) - ignore: 7.0.6 - natural-compare: 1.4.0 - ts-api-utils: 2.5.0(typescript@5.9.3) - typescript: 5.9.3 - transitivePeerDependencies: - - supports-color - - '@typescript-eslint/parser@8.66.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3)': - dependencies: - '@typescript-eslint/scope-manager': 8.66.0 - '@typescript-eslint/types': 8.66.0 - '@typescript-eslint/typescript-estree': 8.66.0(typescript@5.9.3) - '@typescript-eslint/visitor-keys': 8.66.0 - debug: 4.4.3 - eslint: 9.39.5(jiti@2.7.0) - typescript: 5.9.3 - transitivePeerDependencies: - - supports-color - - '@typescript-eslint/project-service@8.66.0(typescript@5.9.3)': - dependencies: - '@typescript-eslint/tsconfig-utils': 8.66.0(typescript@5.9.3) - '@typescript-eslint/types': 8.66.0 - debug: 4.4.3 - typescript: 5.9.3 - transitivePeerDependencies: - - supports-color - - '@typescript-eslint/scope-manager@8.66.0': - dependencies: - '@typescript-eslint/types': 8.66.0 - '@typescript-eslint/visitor-keys': 8.66.0 - - '@typescript-eslint/tsconfig-utils@8.66.0(typescript@5.9.3)': - dependencies: - typescript: 5.9.3 - - '@typescript-eslint/type-utils@8.66.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3)': - dependencies: - '@typescript-eslint/types': 8.66.0 - '@typescript-eslint/typescript-estree': 8.66.0(typescript@5.9.3) - '@typescript-eslint/utils': 8.66.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3) - debug: 4.4.3 - eslint: 9.39.5(jiti@2.7.0) - ts-api-utils: 2.5.0(typescript@5.9.3) - typescript: 5.9.3 - transitivePeerDependencies: - - supports-color - - '@typescript-eslint/types@8.66.0': {} - - '@typescript-eslint/typescript-estree@8.66.0(typescript@5.9.3)': - dependencies: - '@typescript-eslint/project-service': 8.66.0(typescript@5.9.3) - '@typescript-eslint/tsconfig-utils': 8.66.0(typescript@5.9.3) - '@typescript-eslint/types': 8.66.0 - '@typescript-eslint/visitor-keys': 8.66.0 - debug: 4.4.3 - minimatch: 10.2.6 - semver: 7.8.5 - tinyglobby: 0.2.17 - ts-api-utils: 2.5.0(typescript@5.9.3) - typescript: 5.9.3 - transitivePeerDependencies: - - supports-color - - '@typescript-eslint/utils@8.66.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3)': - dependencies: - '@eslint-community/eslint-utils': 4.10.1(eslint@9.39.5(jiti@2.7.0)) - '@typescript-eslint/scope-manager': 8.66.0 - '@typescript-eslint/types': 8.66.0 - '@typescript-eslint/typescript-estree': 8.66.0(typescript@5.9.3) - eslint: 9.39.5(jiti@2.7.0) - typescript: 5.9.3 - transitivePeerDependencies: - - supports-color - - '@typescript-eslint/visitor-keys@8.66.0': - dependencies: - '@typescript-eslint/types': 8.66.0 - eslint-visitor-keys: 5.0.1 - - '@unrs/resolver-binding-android-arm-eabi@1.12.2': - optional: true - - '@unrs/resolver-binding-android-arm64@1.12.2': - optional: true - - '@unrs/resolver-binding-darwin-arm64@1.12.2': - optional: true - - '@unrs/resolver-binding-darwin-x64@1.12.2': - optional: true - - '@unrs/resolver-binding-freebsd-x64@1.12.2': - optional: true - - '@unrs/resolver-binding-linux-arm-gnueabihf@1.12.2': - optional: true - - '@unrs/resolver-binding-linux-arm-musleabihf@1.12.2': - optional: true - - '@unrs/resolver-binding-linux-arm64-gnu@1.12.2': - optional: true - - '@unrs/resolver-binding-linux-arm64-musl@1.12.2': - optional: true - - '@unrs/resolver-binding-linux-loong64-gnu@1.12.2': - optional: true - - '@unrs/resolver-binding-linux-loong64-musl@1.12.2': - optional: true - - '@unrs/resolver-binding-linux-ppc64-gnu@1.12.2': - optional: true - - '@unrs/resolver-binding-linux-riscv64-gnu@1.12.2': - optional: true - - '@unrs/resolver-binding-linux-riscv64-musl@1.12.2': - optional: true - - '@unrs/resolver-binding-linux-s390x-gnu@1.12.2': - optional: true - - '@unrs/resolver-binding-linux-x64-gnu@1.12.2': - optional: true - - '@unrs/resolver-binding-linux-x64-musl@1.12.2': - optional: true - - '@unrs/resolver-binding-openharmony-arm64@1.12.2': - optional: true - - '@unrs/resolver-binding-wasm32-wasi@1.12.2': - dependencies: - '@emnapi/core': 1.10.0 - '@emnapi/runtime': 1.10.0 - '@napi-rs/wasm-runtime': 1.2.2(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0) - optional: true - - '@unrs/resolver-binding-win32-arm64-msvc@1.12.2': - optional: true - - '@unrs/resolver-binding-win32-ia32-msvc@1.12.2': - optional: true - - '@unrs/resolver-binding-win32-x64-msvc@1.12.2': - optional: true - - acorn-jsx@5.3.2(acorn@8.18.0): - dependencies: - acorn: 8.18.0 - - acorn@8.18.0: {} - - ajv@6.15.0: - dependencies: - fast-deep-equal: 3.1.3 - fast-json-stable-stringify: 2.1.0 - json-schema-traverse: 0.4.1 - uri-js: 4.4.1 - - ansi-styles@4.3.0: - dependencies: - color-convert: 2.0.1 - - argparse@2.0.1: {} - - aria-query@5.3.2: {} - - array-buffer-byte-length@1.0.2: - dependencies: - call-bound: 1.0.4 - is-array-buffer: 3.0.5 - - array-includes@3.1.9: - dependencies: - call-bind: 1.0.9 - call-bound: 1.0.4 - define-properties: 1.2.1 - es-abstract: 1.24.2 - es-object-atoms: 1.1.2 - get-intrinsic: 1.3.0 - is-string: 1.1.1 - math-intrinsics: 1.1.0 - - array.prototype.findlast@1.2.5: - dependencies: - call-bind: 1.0.9 - define-properties: 1.2.1 - es-abstract: 1.24.2 - es-errors: 1.3.0 - es-object-atoms: 1.1.2 - es-shim-unscopables: 1.1.0 - - array.prototype.findlastindex@1.2.6: - dependencies: - call-bind: 1.0.9 - call-bound: 1.0.4 - define-properties: 1.2.1 - es-abstract: 1.24.2 - es-errors: 1.3.0 - es-object-atoms: 1.1.2 - es-shim-unscopables: 1.1.0 - - array.prototype.flat@1.3.3: - dependencies: - call-bind: 1.0.9 - define-properties: 1.2.1 - es-abstract: 1.24.2 - es-shim-unscopables: 1.1.0 - - array.prototype.flatmap@1.3.3: - dependencies: - call-bind: 1.0.9 - define-properties: 1.2.1 - es-abstract: 1.24.2 - es-shim-unscopables: 1.1.0 - - array.prototype.tosorted@1.1.4: - dependencies: - call-bind: 1.0.9 - define-properties: 1.2.1 - es-abstract: 1.24.2 - es-errors: 1.3.0 - es-shim-unscopables: 1.1.0 - - arraybuffer.prototype.slice@1.0.4: - dependencies: - array-buffer-byte-length: 1.0.2 - call-bind: 1.0.9 - define-properties: 1.2.1 - es-abstract: 1.24.2 - es-errors: 1.3.0 - get-intrinsic: 1.3.0 - is-array-buffer: 3.0.5 - - ast-types-flow@0.0.8: {} - - async-function@1.0.0: {} - - available-typed-arrays@1.0.7: - dependencies: - possible-typed-array-names: 1.1.0 - - axe-core@4.13.0: {} - - axobject-query@4.1.0: {} - - balanced-match@1.0.2: {} - - balanced-match@4.0.4: {} - - baseline-browser-mapping@2.11.12: {} - - brace-expansion@1.1.18: - dependencies: - balanced-match: 1.0.2 - concat-map: 0.0.1 - - brace-expansion@5.0.9: - dependencies: - balanced-match: 4.0.4 - - braces@3.0.3: - dependencies: - fill-range: 7.1.1 - - browserslist@4.28.7: - dependencies: - baseline-browser-mapping: 2.11.12 - caniuse-lite: 1.0.30001809 - electron-to-chromium: 1.5.402 - node-releases: 2.0.53 - update-browserslist-db: 1.3.0(browserslist@4.28.7) - - call-bind-apply-helpers@1.0.2: - dependencies: - es-errors: 1.3.0 - function-bind: 1.1.2 - - call-bind@1.0.9: - dependencies: - call-bind-apply-helpers: 1.0.2 - es-define-property: 1.0.1 - get-intrinsic: 1.3.0 - set-function-length: 1.2.2 - - call-bound@1.0.4: - dependencies: - call-bind-apply-helpers: 1.0.2 - get-intrinsic: 1.3.0 - - callsites@3.1.0: {} - - caniuse-lite@1.0.30001809: {} - - chalk@4.1.2: - dependencies: - ansi-styles: 4.3.0 - supports-color: 7.2.0 - - client-only@0.0.1: {} - - color-convert@2.0.1: - dependencies: - color-name: 1.1.4 - - color-name@1.1.4: {} - - concat-map@0.0.1: {} - - convert-source-map@2.0.0: {} - - cross-spawn@7.0.6: - dependencies: - path-key: 3.1.1 - shebang-command: 2.0.0 - which: 2.0.2 - - csstype@3.2.3: {} - - damerau-levenshtein@1.0.8: {} - - data-view-buffer@1.0.2: - dependencies: - call-bound: 1.0.4 - es-errors: 1.3.0 - is-data-view: 1.0.2 - - data-view-byte-length@1.0.2: - dependencies: - call-bound: 1.0.4 - es-errors: 1.3.0 - is-data-view: 1.0.2 - - data-view-byte-offset@1.0.1: - dependencies: - call-bound: 1.0.4 - es-errors: 1.3.0 - is-data-view: 1.0.2 - - debug@3.2.7: - dependencies: - ms: 2.1.3 - - debug@4.4.3: - dependencies: - ms: 2.1.3 - - deep-is@0.1.4: {} - - define-data-property@1.1.4: - dependencies: - es-define-property: 1.0.1 - es-errors: 1.3.0 - gopd: 1.2.0 - - define-properties@1.2.1: - dependencies: - define-data-property: 1.1.4 - has-property-descriptors: 1.0.2 - object-keys: 1.1.1 - - detect-libc@2.1.2: {} - - doctrine@2.1.0: - dependencies: - esutils: 2.0.3 - - dunder-proto@1.0.1: - dependencies: - call-bind-apply-helpers: 1.0.2 - es-errors: 1.3.0 - gopd: 1.2.0 - - electron-to-chromium@1.5.402: {} - - emoji-regex@9.2.2: {} - - enhanced-resolve@5.24.5: - dependencies: - graceful-fs: 4.2.11 - tapable: 2.3.3 - - es-abstract-get@1.0.0: - dependencies: - es-errors: 1.3.0 - es-object-atoms: 1.1.2 - is-callable: 1.2.7 - object-inspect: 1.13.4 - - es-abstract@1.24.2: - dependencies: - array-buffer-byte-length: 1.0.2 - arraybuffer.prototype.slice: 1.0.4 - available-typed-arrays: 1.0.7 - call-bind: 1.0.9 - call-bound: 1.0.4 - data-view-buffer: 1.0.2 - data-view-byte-length: 1.0.2 - data-view-byte-offset: 1.0.1 - es-define-property: 1.0.1 - es-errors: 1.3.0 - es-object-atoms: 1.1.2 - es-set-tostringtag: 2.1.0 - es-to-primitive: 1.3.4 - function.prototype.name: 1.2.0 - get-intrinsic: 1.3.0 - get-proto: 1.0.1 - get-symbol-description: 1.1.0 - globalthis: 1.0.4 - gopd: 1.2.0 - has-property-descriptors: 1.0.2 - has-proto: 1.2.0 - has-symbols: 1.1.0 - hasown: 2.0.4 - internal-slot: 1.1.0 - is-array-buffer: 3.0.5 - is-callable: 1.2.7 - is-data-view: 1.0.2 - is-negative-zero: 2.0.3 - is-regex: 1.2.1 - is-set: 2.0.3 - is-shared-array-buffer: 1.0.4 - is-string: 1.1.1 - is-typed-array: 1.1.15 - is-weakref: 1.1.1 - math-intrinsics: 1.1.0 - object-inspect: 1.13.4 - object-keys: 1.1.1 - object.assign: 4.1.7 - own-keys: 1.0.2 - regexp.prototype.flags: 1.5.4 - safe-array-concat: 1.1.4 - safe-push-apply: 1.0.0 - safe-regex-test: 1.1.0 - set-proto: 1.0.0 - stop-iteration-iterator: 1.1.0 - string.prototype.trim: 1.2.11 - string.prototype.trimend: 1.0.10 - string.prototype.trimstart: 1.0.8 - typed-array-buffer: 1.0.3 - typed-array-byte-length: 1.0.3 - typed-array-byte-offset: 1.0.4 - typed-array-length: 1.0.8 - unbox-primitive: 1.1.0 - which-typed-array: 1.1.22 - - es-define-property@1.0.1: {} - - es-errors@1.3.0: {} - - es-iterator-helpers@1.4.0: - dependencies: - call-bind: 1.0.9 - call-bound: 1.0.4 - define-properties: 1.2.1 - es-abstract: 1.24.2 - es-errors: 1.3.0 - es-set-tostringtag: 2.1.0 - function-bind: 1.1.2 - get-intrinsic: 1.3.0 - globalthis: 1.0.4 - gopd: 1.2.0 - has-property-descriptors: 1.0.2 - has-proto: 1.2.0 - has-symbols: 1.1.0 - internal-slot: 1.1.0 - iterator.prototype: 1.1.5 - math-intrinsics: 1.1.0 - - es-object-atoms@1.1.2: - dependencies: - es-errors: 1.3.0 - - es-set-tostringtag@2.1.0: - dependencies: - es-errors: 1.3.0 - get-intrinsic: 1.3.0 - has-tostringtag: 1.0.2 - hasown: 2.0.4 - - es-shim-unscopables@1.1.0: - dependencies: - hasown: 2.0.4 - - es-to-primitive@1.3.4: - dependencies: - es-abstract-get: 1.0.0 - es-define-property: 1.0.1 - es-errors: 1.3.0 - is-callable: 1.2.7 - is-date-object: 1.1.0 - is-symbol: 1.1.1 - - escalade@3.2.0: {} - - escape-string-regexp@4.0.0: {} - - eslint-config-next@16.3.0(@typescript-eslint/parser@8.66.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3))(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3): - dependencies: - '@next/eslint-plugin-next': 16.3.0(eslint@9.39.5(jiti@2.7.0)) - eslint: 9.39.5(jiti@2.7.0) - eslint-import-resolver-node: 0.3.10 - eslint-import-resolver-typescript: 3.10.1(eslint-plugin-import@2.32.0)(eslint@9.39.5(jiti@2.7.0)) - eslint-plugin-import: 2.32.0(@typescript-eslint/parser@8.66.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3))(eslint-import-resolver-typescript@3.10.1)(eslint@9.39.5(jiti@2.7.0)) - eslint-plugin-jsx-a11y: 6.10.2(eslint@9.39.5(jiti@2.7.0)) - eslint-plugin-react: 7.37.5(eslint@9.39.5(jiti@2.7.0)) - eslint-plugin-react-hooks: 7.1.1(eslint@9.39.5(jiti@2.7.0)) - globals: 16.4.0 - typescript-eslint: 8.66.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3) - optionalDependencies: - typescript: 5.9.3 - transitivePeerDependencies: - - '@typescript-eslint/parser' - - eslint-import-resolver-webpack - - eslint-plugin-import-x - - supports-color - - eslint-import-resolver-node@0.3.10: - dependencies: - debug: 3.2.7 - is-core-module: 2.16.2 - resolve: 2.0.0-next.7 - transitivePeerDependencies: - - supports-color - - eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.32.0)(eslint@9.39.5(jiti@2.7.0)): - dependencies: - '@nolyfill/is-core-module': 1.0.39 - debug: 4.4.3 - eslint: 9.39.5(jiti@2.7.0) - get-tsconfig: 4.14.1 - is-bun-module: 2.0.0 - stable-hash: 0.0.5 - tinyglobby: 0.2.17 - unrs-resolver: 1.12.2 - optionalDependencies: - eslint-plugin-import: 2.32.0(@typescript-eslint/parser@8.66.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3))(eslint-import-resolver-typescript@3.10.1)(eslint@9.39.5(jiti@2.7.0)) - transitivePeerDependencies: - - supports-color - - eslint-module-utils@2.14.0(@typescript-eslint/parser@8.66.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3))(eslint-import-resolver-node@0.3.10)(eslint-import-resolver-typescript@3.10.1)(eslint@9.39.5(jiti@2.7.0)): - dependencies: - debug: 3.2.7 - optionalDependencies: - '@typescript-eslint/parser': 8.66.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3) - eslint: 9.39.5(jiti@2.7.0) - eslint-import-resolver-node: 0.3.10 - eslint-import-resolver-typescript: 3.10.1(eslint-plugin-import@2.32.0)(eslint@9.39.5(jiti@2.7.0)) - transitivePeerDependencies: - - supports-color - - eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.66.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3))(eslint-import-resolver-typescript@3.10.1)(eslint@9.39.5(jiti@2.7.0)): - dependencies: - '@rtsao/scc': 1.1.0 - array-includes: 3.1.9 - array.prototype.findlastindex: 1.2.6 - array.prototype.flat: 1.3.3 - array.prototype.flatmap: 1.3.3 - debug: 3.2.7 - doctrine: 2.1.0 - eslint: 9.39.5(jiti@2.7.0) - eslint-import-resolver-node: 0.3.10 - eslint-module-utils: 2.14.0(@typescript-eslint/parser@8.66.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3))(eslint-import-resolver-node@0.3.10)(eslint-import-resolver-typescript@3.10.1)(eslint@9.39.5(jiti@2.7.0)) - hasown: 2.0.4 - is-core-module: 2.16.2 - is-glob: 4.0.3 - minimatch: 3.1.5 - object.fromentries: 2.0.8 - object.groupby: 1.0.3 - object.values: 1.2.1 - semver: 6.3.1 - string.prototype.trimend: 1.0.10 - tsconfig-paths: 3.15.0 - optionalDependencies: - '@typescript-eslint/parser': 8.66.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3) - transitivePeerDependencies: - - eslint-import-resolver-typescript - - eslint-import-resolver-webpack - - supports-color - - eslint-plugin-jsx-a11y@6.10.2(eslint@9.39.5(jiti@2.7.0)): - dependencies: - aria-query: 5.3.2 - array-includes: 3.1.9 - array.prototype.flatmap: 1.3.3 - ast-types-flow: 0.0.8 - axe-core: 4.13.0 - axobject-query: 4.1.0 - damerau-levenshtein: 1.0.8 - emoji-regex: 9.2.2 - eslint: 9.39.5(jiti@2.7.0) - hasown: 2.0.4 - jsx-ast-utils: 3.3.5 - language-tags: 1.0.9 - minimatch: 3.1.5 - object.fromentries: 2.0.8 - safe-regex-test: 1.1.0 - string.prototype.includes: 2.0.1 - - eslint-plugin-react-hooks@7.1.1(eslint@9.39.5(jiti@2.7.0)): - dependencies: - '@babel/core': 7.29.7 - '@babel/parser': 7.29.8 - eslint: 9.39.5(jiti@2.7.0) - hermes-parser: 0.25.1 - zod: 4.4.3 - zod-validation-error: 4.0.2(zod@4.4.3) - transitivePeerDependencies: - - supports-color - - eslint-plugin-react@7.37.5(eslint@9.39.5(jiti@2.7.0)): - dependencies: - array-includes: 3.1.9 - array.prototype.findlast: 1.2.5 - array.prototype.flatmap: 1.3.3 - array.prototype.tosorted: 1.1.4 - doctrine: 2.1.0 - es-iterator-helpers: 1.4.0 - eslint: 9.39.5(jiti@2.7.0) - estraverse: 5.3.0 - hasown: 2.0.4 - jsx-ast-utils: 3.3.5 - minimatch: 3.1.5 - object.entries: 1.1.9 - object.fromentries: 2.0.8 - object.values: 1.2.1 - prop-types: 15.8.1 - resolve: 2.0.0-next.7 - semver: 6.3.1 - string.prototype.matchall: 4.0.12 - string.prototype.repeat: 1.0.0 - - eslint-scope@8.4.0: - dependencies: - esrecurse: 4.3.0 - estraverse: 5.3.0 - - eslint-visitor-keys@3.4.3: {} - - eslint-visitor-keys@4.2.1: {} - - eslint-visitor-keys@5.0.1: {} - - eslint@9.39.5(jiti@2.7.0): - dependencies: - '@eslint-community/eslint-utils': 4.10.1(eslint@9.39.5(jiti@2.7.0)) - '@eslint-community/regexpp': 4.12.2 - '@eslint/config-array': 0.21.2 - '@eslint/config-helpers': 0.4.2 - '@eslint/core': 0.17.0 - '@eslint/eslintrc': 3.3.6 - '@eslint/js': 9.39.5 - '@eslint/plugin-kit': 0.4.1 - '@humanfs/node': 0.16.8 - '@humanwhocodes/module-importer': 1.0.1 - '@humanwhocodes/retry': 0.4.3 - '@types/estree': 1.0.9 - ajv: 6.15.0 - chalk: 4.1.2 - cross-spawn: 7.0.6 - debug: 4.4.3 - escape-string-regexp: 4.0.0 - eslint-scope: 8.4.0 - eslint-visitor-keys: 4.2.1 - espree: 10.4.0 - esquery: 1.7.0 - esutils: 2.0.3 - fast-deep-equal: 3.1.3 - file-entry-cache: 8.0.0 - find-up: 5.0.0 - glob-parent: 6.0.2 - ignore: 5.3.2 - imurmurhash: 0.1.4 - is-glob: 4.0.3 - json-stable-stringify-without-jsonify: 1.0.1 - lodash.merge: 4.6.2 - minimatch: 3.1.5 - natural-compare: 1.4.0 - optionator: 0.9.4 - optionalDependencies: - jiti: 2.7.0 - transitivePeerDependencies: - - supports-color - - espree@10.4.0: - dependencies: - acorn: 8.18.0 - acorn-jsx: 5.3.2(acorn@8.18.0) - eslint-visitor-keys: 4.2.1 - - esquery@1.7.0: - dependencies: - estraverse: 5.3.0 - - esrecurse@4.3.0: - dependencies: - estraverse: 5.3.0 - - estraverse@5.3.0: {} - - esutils@2.0.3: {} - - fast-deep-equal@3.1.3: {} - - fast-glob@3.3.1: - dependencies: - '@nodelib/fs.stat': 2.0.5 - '@nodelib/fs.walk': 1.2.8 - glob-parent: 5.1.2 - merge2: 1.4.1 - micromatch: 4.0.8 - - fast-json-stable-stringify@2.1.0: {} - - fast-levenshtein@2.0.6: {} - - fastq@1.20.1: - dependencies: - reusify: 1.1.0 - - fdir@6.5.0(picomatch@4.0.5): - optionalDependencies: - picomatch: 4.0.5 - - file-entry-cache@8.0.0: - dependencies: - flat-cache: 4.0.1 - - fill-range@7.1.1: - dependencies: - to-regex-range: 5.0.1 - - find-up@5.0.0: - dependencies: - locate-path: 6.0.0 - path-exists: 4.0.0 - - flat-cache@4.0.1: - dependencies: - flatted: 3.4.4 - keyv: 4.5.4 - - flatted@3.4.4: {} - - for-each@0.3.5: - dependencies: - is-callable: 1.2.7 - - framer-motion@13.0.0(react-dom@19.2.8(react@19.2.8))(react@19.2.8): - dependencies: - motion-dom: 13.0.0 - motion-utils: 13.0.0 - tslib: 2.8.1 - optionalDependencies: - react: 19.2.8 - react-dom: 19.2.8(react@19.2.8) - - function-bind@1.1.2: {} - - function.prototype.name@1.2.0: - dependencies: - call-bind: 1.0.9 - call-bound: 1.0.4 - es-define-property: 1.0.1 - es-errors: 1.3.0 - functions-have-names: 1.2.3 - has-property-descriptors: 1.0.2 - hasown: 2.0.4 - is-callable: 1.2.7 - is-document.all: 1.0.0 - - functions-have-names@1.2.3: {} - - generator-function@2.0.1: {} - - gensync@1.0.0-beta.2: {} - - get-intrinsic@1.3.0: - dependencies: - call-bind-apply-helpers: 1.0.2 - es-define-property: 1.0.1 - es-errors: 1.3.0 - es-object-atoms: 1.1.2 - function-bind: 1.1.2 - get-proto: 1.0.1 - gopd: 1.2.0 - has-symbols: 1.1.0 - hasown: 2.0.4 - math-intrinsics: 1.1.0 - - get-proto@1.0.1: - dependencies: - dunder-proto: 1.0.1 - es-object-atoms: 1.1.2 - - get-symbol-description@1.1.0: - dependencies: - call-bound: 1.0.4 - es-errors: 1.3.0 - get-intrinsic: 1.3.0 - - get-tsconfig@4.14.1: - dependencies: - resolve-pkg-maps: 1.0.0 - - glob-parent@5.1.2: - dependencies: - is-glob: 4.0.3 - - glob-parent@6.0.2: - dependencies: - is-glob: 4.0.3 - - globals@14.0.0: {} - - globals@16.4.0: {} - - globalthis@1.0.4: - dependencies: - define-properties: 1.2.1 - gopd: 1.2.0 - - gopd@1.2.0: {} - - graceful-fs@4.2.11: {} - - has-bigints@1.1.0: {} - - has-flag@4.0.0: {} - - has-property-descriptors@1.0.2: - dependencies: - es-define-property: 1.0.1 - - has-proto@1.2.0: - dependencies: - dunder-proto: 1.0.1 - - has-symbols@1.1.0: {} - - has-tostringtag@1.0.2: - dependencies: - has-symbols: 1.1.0 - - hasown@2.0.4: - dependencies: - function-bind: 1.1.2 - - hermes-estree@0.25.1: {} - - hermes-parser@0.25.1: - dependencies: - hermes-estree: 0.25.1 - - ignore@5.3.2: {} - - ignore@7.0.6: {} - - import-fresh@3.3.1: - dependencies: - parent-module: 1.0.1 - resolve-from: 4.0.0 - - imurmurhash@0.1.4: {} - - internal-slot@1.1.0: - dependencies: - es-errors: 1.3.0 - hasown: 2.0.4 - side-channel: 1.1.1 - - is-array-buffer@3.0.5: - dependencies: - call-bind: 1.0.9 - call-bound: 1.0.4 - get-intrinsic: 1.3.0 - - is-async-function@2.1.1: - dependencies: - async-function: 1.0.0 - call-bound: 1.0.4 - get-proto: 1.0.1 - has-tostringtag: 1.0.2 - safe-regex-test: 1.1.0 - - is-bigint@1.1.0: - dependencies: - has-bigints: 1.1.0 - - is-boolean-object@1.2.2: - dependencies: - call-bound: 1.0.4 - has-tostringtag: 1.0.2 - - is-bun-module@2.0.0: - dependencies: - semver: 7.8.5 - - is-callable@1.2.7: {} - - is-core-module@2.16.2: - dependencies: - hasown: 2.0.4 - - is-data-view@1.0.2: - dependencies: - call-bound: 1.0.4 - get-intrinsic: 1.3.0 - is-typed-array: 1.1.15 - - is-date-object@1.1.0: - dependencies: - call-bound: 1.0.4 - has-tostringtag: 1.0.2 - - is-document.all@1.0.0: - dependencies: - call-bound: 1.0.4 - - is-extglob@2.1.1: {} - - is-finalizationregistry@1.1.1: - dependencies: - call-bound: 1.0.4 - - is-generator-function@1.1.2: - dependencies: - call-bound: 1.0.4 - generator-function: 2.0.1 - get-proto: 1.0.1 - has-tostringtag: 1.0.2 - safe-regex-test: 1.1.0 - - is-glob@4.0.3: - dependencies: - is-extglob: 2.1.1 - - is-map@2.0.3: {} - - is-negative-zero@2.0.3: {} - - is-number-object@1.1.1: - dependencies: - call-bound: 1.0.4 - has-tostringtag: 1.0.2 - - is-number@7.0.0: {} - - is-regex@1.2.1: - dependencies: - call-bound: 1.0.4 - gopd: 1.2.0 - has-tostringtag: 1.0.2 - hasown: 2.0.4 - - is-set@2.0.3: {} - - is-shared-array-buffer@1.0.4: - dependencies: - call-bound: 1.0.4 - - is-string@1.1.1: - dependencies: - call-bound: 1.0.4 - has-tostringtag: 1.0.2 - - is-symbol@1.1.1: - dependencies: - call-bound: 1.0.4 - has-symbols: 1.1.0 - safe-regex-test: 1.1.0 - - is-typed-array@1.1.15: - dependencies: - which-typed-array: 1.1.22 - - is-weakmap@2.0.2: {} - - is-weakref@1.1.1: - dependencies: - call-bound: 1.0.4 - - is-weakset@2.0.4: - dependencies: - call-bound: 1.0.4 - get-intrinsic: 1.3.0 - - isarray@2.0.5: {} - - isexe@2.0.0: {} - - iterator.prototype@1.1.5: - dependencies: - define-data-property: 1.1.4 - es-object-atoms: 1.1.2 - get-intrinsic: 1.3.0 - get-proto: 1.0.1 - has-symbols: 1.1.0 - set-function-name: 2.0.2 - - jiti@2.7.0: {} - - js-tokens@4.0.0: {} - - js-yaml@4.3.1: - dependencies: - argparse: 2.0.1 - - jsesc@3.1.0: {} - - json-buffer@3.0.1: {} - - json-schema-traverse@0.4.1: {} - - json-stable-stringify-without-jsonify@1.0.1: {} - - json5@1.0.2: - dependencies: - minimist: 1.2.8 - - json5@2.2.3: {} - - jsx-ast-utils@3.3.5: - dependencies: - array-includes: 3.1.9 - array.prototype.flat: 1.3.3 - object.assign: 4.1.7 - object.values: 1.2.1 - - keyv@4.5.4: - dependencies: - json-buffer: 3.0.1 - - language-subtag-registry@0.3.23: {} - - language-tags@1.0.9: - dependencies: - language-subtag-registry: 0.3.23 - - levn@0.4.1: - dependencies: - prelude-ls: 1.2.1 - type-check: 0.4.0 - - lightningcss-android-arm64@1.32.0: - optional: true - - lightningcss-darwin-arm64@1.32.0: - optional: true - - lightningcss-darwin-x64@1.32.0: - optional: true - - lightningcss-freebsd-x64@1.32.0: - optional: true - - lightningcss-linux-arm-gnueabihf@1.32.0: - optional: true - - lightningcss-linux-arm64-gnu@1.32.0: - optional: true - - lightningcss-linux-arm64-musl@1.32.0: - optional: true - - lightningcss-linux-x64-gnu@1.32.0: - optional: true - - lightningcss-linux-x64-musl@1.32.0: - optional: true - - lightningcss-win32-arm64-msvc@1.32.0: - optional: true - - lightningcss-win32-x64-msvc@1.32.0: - optional: true - - lightningcss@1.32.0: - dependencies: - detect-libc: 2.1.2 - optionalDependencies: - lightningcss-android-arm64: 1.32.0 - lightningcss-darwin-arm64: 1.32.0 - lightningcss-darwin-x64: 1.32.0 - lightningcss-freebsd-x64: 1.32.0 - lightningcss-linux-arm-gnueabihf: 1.32.0 - lightningcss-linux-arm64-gnu: 1.32.0 - lightningcss-linux-arm64-musl: 1.32.0 - lightningcss-linux-x64-gnu: 1.32.0 - lightningcss-linux-x64-musl: 1.32.0 - lightningcss-win32-arm64-msvc: 1.32.0 - lightningcss-win32-x64-msvc: 1.32.0 - - locate-path@6.0.0: - dependencies: - p-locate: 5.0.0 - - lodash.merge@4.6.2: {} - - loose-envify@1.4.0: - dependencies: - js-tokens: 4.0.0 - - lru-cache@5.1.1: - dependencies: - yallist: 3.1.1 - - magic-string@0.30.21: - dependencies: - '@jridgewell/sourcemap-codec': 1.5.5 - - math-intrinsics@1.1.0: {} - - merge2@1.4.1: {} - - micromatch@4.0.8: - dependencies: - braces: 3.0.3 - picomatch: 2.3.2 - - minimatch@10.2.6: - dependencies: - brace-expansion: 5.0.9 - - minimatch@3.1.5: - dependencies: - brace-expansion: 1.1.18 - - minimist@1.2.8: {} - - motion-dom@13.0.0: - dependencies: - motion-utils: 13.0.0 - - motion-utils@13.0.0: {} - - motion@13.0.0(react-dom@19.2.8(react@19.2.8))(react@19.2.8): - dependencies: - framer-motion: 13.0.0(react-dom@19.2.8(react@19.2.8))(react@19.2.8) - tslib: 2.8.1 - optionalDependencies: - react: 19.2.8 - react-dom: 19.2.8(react@19.2.8) - - ms@2.1.3: {} - - nanoid@3.3.18: {} - - napi-postinstall@0.3.4: {} - - natural-compare@1.4.0: {} - - next@16.3.0(@babel/core@7.29.7)(@types/node@20.19.43)(react-dom@19.2.8(react@19.2.8))(react@19.2.8): - dependencies: - '@next/env': 16.3.0 - '@swc/helpers': 0.5.15 - baseline-browser-mapping: 2.11.12 - caniuse-lite: 1.0.30001809 - postcss: 8.5.23 - react: 19.2.8 - react-dom: 19.2.8(react@19.2.8) - styled-jsx: 5.1.6(@babel/core@7.29.7)(react@19.2.8) - optionalDependencies: - '@next/swc-darwin-arm64': 16.3.0 - '@next/swc-darwin-x64': 16.3.0 - '@next/swc-linux-arm64-gnu': 16.3.0 - '@next/swc-linux-arm64-musl': 16.3.0 - '@next/swc-linux-x64-gnu': 16.3.0 - '@next/swc-linux-x64-musl': 16.3.0 - '@next/swc-win32-arm64-msvc': 16.3.0 - '@next/swc-win32-x64-msvc': 16.3.0 - sharp: 0.35.3(@types/node@20.19.43) - transitivePeerDependencies: - - '@babel/core' - - '@types/node' - - babel-plugin-macros - - node-exports-info@1.6.2: - dependencies: - array.prototype.flatmap: 1.3.3 - es-errors: 1.3.0 - object.entries: 1.1.9 - semver: 6.3.1 - - node-releases@2.0.53: {} - - object-assign@4.1.1: {} - - object-inspect@1.13.4: {} - - object-keys@1.1.1: {} - - object.assign@4.1.7: - dependencies: - call-bind: 1.0.9 - call-bound: 1.0.4 - define-properties: 1.2.1 - es-object-atoms: 1.1.2 - has-symbols: 1.1.0 - object-keys: 1.1.1 - - object.entries@1.1.9: - dependencies: - call-bind: 1.0.9 - call-bound: 1.0.4 - define-properties: 1.2.1 - es-object-atoms: 1.1.2 - - object.fromentries@2.0.8: - dependencies: - call-bind: 1.0.9 - define-properties: 1.2.1 - es-abstract: 1.24.2 - es-object-atoms: 1.1.2 - - object.groupby@1.0.3: - dependencies: - call-bind: 1.0.9 - define-properties: 1.2.1 - es-abstract: 1.24.2 - - object.values@1.2.1: - dependencies: - call-bind: 1.0.9 - call-bound: 1.0.4 - define-properties: 1.2.1 - es-object-atoms: 1.1.2 - - optionator@0.9.4: - dependencies: - deep-is: 0.1.4 - fast-levenshtein: 2.0.6 - levn: 0.4.1 - prelude-ls: 1.2.1 - type-check: 0.4.0 - word-wrap: 1.2.5 - - own-keys@1.0.2: - dependencies: - call-bound: 1.0.4 - get-intrinsic: 1.3.0 - object-keys: 1.1.1 - safe-push-apply: 1.0.0 - - p-limit@3.1.0: - dependencies: - yocto-queue: 0.1.0 - - p-locate@5.0.0: - dependencies: - p-limit: 3.1.0 - - parent-module@1.0.1: - dependencies: - callsites: 3.1.0 - - path-exists@4.0.0: {} - - path-key@3.1.1: {} - - path-parse@1.0.7: {} - - picocolors@1.1.1: {} - - picomatch@2.3.2: {} - - picomatch@4.0.5: {} - - possible-typed-array-names@1.1.0: {} - - postcss@8.5.23: - dependencies: - nanoid: 3.3.18 - picocolors: 1.1.1 - source-map-js: 1.2.1 - - postcss@8.5.26: - dependencies: - nanoid: 3.3.18 - picocolors: 1.1.1 - source-map-js: 1.2.1 - - prelude-ls@1.2.1: {} - - prop-types@15.8.1: - dependencies: - loose-envify: 1.4.0 - object-assign: 4.1.1 - react-is: 16.13.1 - - punycode@2.3.1: {} - - queue-microtask@1.2.3: {} - - react-dom@19.2.8(react@19.2.8): - dependencies: - react: 19.2.8 - scheduler: 0.27.0 - - react-is@16.13.1: {} - - react@19.2.8: {} - - reflect.getprototypeof@1.0.10: - dependencies: - call-bind: 1.0.9 - define-properties: 1.2.1 - es-abstract: 1.24.2 - es-errors: 1.3.0 - es-object-atoms: 1.1.2 - get-intrinsic: 1.3.0 - get-proto: 1.0.1 - which-builtin-type: 1.2.1 - - regexp.prototype.flags@1.5.4: - dependencies: - call-bind: 1.0.9 - define-properties: 1.2.1 - es-errors: 1.3.0 - get-proto: 1.0.1 - gopd: 1.2.0 - set-function-name: 2.0.2 - - resolve-from@4.0.0: {} - - resolve-pkg-maps@1.0.0: {} - - resolve@2.0.0-next.7: - dependencies: - es-errors: 1.3.0 - is-core-module: 2.16.2 - node-exports-info: 1.6.2 - object-keys: 1.1.1 - path-parse: 1.0.7 - supports-preserve-symlinks-flag: 1.0.0 - - reusify@1.1.0: {} - - run-parallel@1.2.0: - dependencies: - queue-microtask: 1.2.3 - - safe-array-concat@1.1.4: - dependencies: - call-bind: 1.0.9 - call-bound: 1.0.4 - get-intrinsic: 1.3.0 - has-symbols: 1.1.0 - isarray: 2.0.5 - - safe-push-apply@1.0.0: - dependencies: - es-errors: 1.3.0 - isarray: 2.0.5 - - safe-regex-test@1.1.0: - dependencies: - call-bound: 1.0.4 - es-errors: 1.3.0 - is-regex: 1.2.1 - - scheduler@0.27.0: {} - - semver@6.3.1: {} - - semver@7.8.5: {} - - set-function-length@1.2.2: - dependencies: - define-data-property: 1.1.4 - es-errors: 1.3.0 - function-bind: 1.1.2 - get-intrinsic: 1.3.0 - gopd: 1.2.0 - has-property-descriptors: 1.0.2 - - set-function-name@2.0.2: - dependencies: - define-data-property: 1.1.4 - es-errors: 1.3.0 - functions-have-names: 1.2.3 - has-property-descriptors: 1.0.2 - - set-proto@1.0.0: - dependencies: - dunder-proto: 1.0.1 - es-errors: 1.3.0 - es-object-atoms: 1.1.2 - - sharp@0.35.3(@types/node@20.19.43): - dependencies: - '@img/colour': 1.1.0 - detect-libc: 2.1.2 - semver: 7.8.5 - optionalDependencies: - '@img/sharp-darwin-arm64': 0.35.3 - '@img/sharp-darwin-x64': 0.35.3 - '@img/sharp-freebsd-wasm32': 0.35.3 - '@img/sharp-libvips-darwin-arm64': 1.3.2 - '@img/sharp-libvips-darwin-x64': 1.3.2 - '@img/sharp-libvips-linux-arm': 1.3.2 - '@img/sharp-libvips-linux-arm64': 1.3.2 - '@img/sharp-libvips-linux-ppc64': 1.3.2 - '@img/sharp-libvips-linux-riscv64': 1.3.2 - '@img/sharp-libvips-linux-s390x': 1.3.2 - '@img/sharp-libvips-linux-x64': 1.3.2 - '@img/sharp-libvips-linuxmusl-arm64': 1.3.2 - '@img/sharp-libvips-linuxmusl-x64': 1.3.2 - '@img/sharp-linux-arm': 0.35.3 - '@img/sharp-linux-arm64': 0.35.3 - '@img/sharp-linux-ppc64': 0.35.3 - '@img/sharp-linux-riscv64': 0.35.3 - '@img/sharp-linux-s390x': 0.35.3 - '@img/sharp-linux-x64': 0.35.3 - '@img/sharp-linuxmusl-arm64': 0.35.3 - '@img/sharp-linuxmusl-x64': 0.35.3 - '@img/sharp-webcontainers-wasm32': 0.35.3 - '@img/sharp-win32-arm64': 0.35.3 - '@img/sharp-win32-ia32': 0.35.3 - '@img/sharp-win32-x64': 0.35.3 - '@types/node': 20.19.43 - optional: true - - shebang-command@2.0.0: - dependencies: - shebang-regex: 3.0.0 - - shebang-regex@3.0.0: {} - - side-channel-list@1.0.1: - dependencies: - es-errors: 1.3.0 - object-inspect: 1.13.4 - - side-channel-map@1.0.1: - dependencies: - call-bound: 1.0.4 - es-errors: 1.3.0 - get-intrinsic: 1.3.0 - object-inspect: 1.13.4 - - side-channel-weakmap@1.0.2: - dependencies: - call-bound: 1.0.4 - es-errors: 1.3.0 - get-intrinsic: 1.3.0 - object-inspect: 1.13.4 - side-channel-map: 1.0.1 - - side-channel@1.1.1: - dependencies: - es-errors: 1.3.0 - object-inspect: 1.13.4 - side-channel-list: 1.0.1 - side-channel-map: 1.0.1 - side-channel-weakmap: 1.0.2 - - source-map-js@1.2.1: {} - - stable-hash@0.0.5: {} - - stop-iteration-iterator@1.1.0: - dependencies: - es-errors: 1.3.0 - internal-slot: 1.1.0 - - string.prototype.includes@2.0.1: - dependencies: - call-bind: 1.0.9 - define-properties: 1.2.1 - es-abstract: 1.24.2 - - string.prototype.matchall@4.0.12: - dependencies: - call-bind: 1.0.9 - call-bound: 1.0.4 - define-properties: 1.2.1 - es-abstract: 1.24.2 - es-errors: 1.3.0 - es-object-atoms: 1.1.2 - get-intrinsic: 1.3.0 - gopd: 1.2.0 - has-symbols: 1.1.0 - internal-slot: 1.1.0 - regexp.prototype.flags: 1.5.4 - set-function-name: 2.0.2 - side-channel: 1.1.1 - - string.prototype.repeat@1.0.0: - dependencies: - define-properties: 1.2.1 - es-abstract: 1.24.2 - - string.prototype.trim@1.2.11: - dependencies: - call-bind: 1.0.9 - call-bound: 1.0.4 - define-data-property: 1.1.4 - define-properties: 1.2.1 - es-abstract: 1.24.2 - es-object-atoms: 1.1.2 - has-property-descriptors: 1.0.2 - safe-regex-test: 1.1.0 - - string.prototype.trimend@1.0.10: - dependencies: - call-bind: 1.0.9 - call-bound: 1.0.4 - define-properties: 1.2.1 - es-object-atoms: 1.1.2 - - string.prototype.trimstart@1.0.8: - dependencies: - call-bind: 1.0.9 - define-properties: 1.2.1 - es-object-atoms: 1.1.2 - - strip-bom@3.0.0: {} - - strip-json-comments@3.1.1: {} - - styled-jsx@5.1.6(@babel/core@7.29.7)(react@19.2.8): - dependencies: - client-only: 0.0.1 - react: 19.2.8 - optionalDependencies: - '@babel/core': 7.29.7 - - supports-color@7.2.0: - dependencies: - has-flag: 4.0.0 - - supports-preserve-symlinks-flag@1.0.0: {} - - tailwindcss@4.3.3: {} - - tapable@2.3.3: {} - - tinyglobby@0.2.17: - dependencies: - fdir: 6.5.0(picomatch@4.0.5) - picomatch: 4.0.5 - - to-regex-range@5.0.1: - dependencies: - is-number: 7.0.0 - - ts-api-utils@2.5.0(typescript@5.9.3): - dependencies: - typescript: 5.9.3 - - tsconfig-paths@3.15.0: - dependencies: - '@types/json5': 0.0.29 - json5: 1.0.2 - minimist: 1.2.8 - strip-bom: 3.0.0 - - tslib@2.8.1: {} - - type-check@0.4.0: - dependencies: - prelude-ls: 1.2.1 - - typed-array-buffer@1.0.3: - dependencies: - call-bound: 1.0.4 - es-errors: 1.3.0 - is-typed-array: 1.1.15 - - typed-array-byte-length@1.0.3: - dependencies: - call-bind: 1.0.9 - for-each: 0.3.5 - gopd: 1.2.0 - has-proto: 1.2.0 - is-typed-array: 1.1.15 - - typed-array-byte-offset@1.0.4: - dependencies: - available-typed-arrays: 1.0.7 - call-bind: 1.0.9 - for-each: 0.3.5 - gopd: 1.2.0 - has-proto: 1.2.0 - is-typed-array: 1.1.15 - reflect.getprototypeof: 1.0.10 - - typed-array-length@1.0.8: - dependencies: - call-bind: 1.0.9 - for-each: 0.3.5 - gopd: 1.2.0 - is-typed-array: 1.1.15 - possible-typed-array-names: 1.1.0 - reflect.getprototypeof: 1.0.10 - - typescript-eslint@8.66.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3): - dependencies: - '@typescript-eslint/eslint-plugin': 8.66.0(@typescript-eslint/parser@8.66.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3))(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3) - '@typescript-eslint/parser': 8.66.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3) - '@typescript-eslint/typescript-estree': 8.66.0(typescript@5.9.3) - '@typescript-eslint/utils': 8.66.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3) - eslint: 9.39.5(jiti@2.7.0) - typescript: 5.9.3 - transitivePeerDependencies: - - supports-color - - typescript@5.9.3: {} - - unbox-primitive@1.1.0: - dependencies: - call-bound: 1.0.4 - has-bigints: 1.1.0 - has-symbols: 1.1.0 - which-boxed-primitive: 1.1.1 - - undici-types@6.21.0: {} - - unrs-resolver@1.12.2: - dependencies: - napi-postinstall: 0.3.4 - optionalDependencies: - '@unrs/resolver-binding-android-arm-eabi': 1.12.2 - '@unrs/resolver-binding-android-arm64': 1.12.2 - '@unrs/resolver-binding-darwin-arm64': 1.12.2 - '@unrs/resolver-binding-darwin-x64': 1.12.2 - '@unrs/resolver-binding-freebsd-x64': 1.12.2 - '@unrs/resolver-binding-linux-arm-gnueabihf': 1.12.2 - '@unrs/resolver-binding-linux-arm-musleabihf': 1.12.2 - '@unrs/resolver-binding-linux-arm64-gnu': 1.12.2 - '@unrs/resolver-binding-linux-arm64-musl': 1.12.2 - '@unrs/resolver-binding-linux-loong64-gnu': 1.12.2 - '@unrs/resolver-binding-linux-loong64-musl': 1.12.2 - '@unrs/resolver-binding-linux-ppc64-gnu': 1.12.2 - '@unrs/resolver-binding-linux-riscv64-gnu': 1.12.2 - '@unrs/resolver-binding-linux-riscv64-musl': 1.12.2 - '@unrs/resolver-binding-linux-s390x-gnu': 1.12.2 - '@unrs/resolver-binding-linux-x64-gnu': 1.12.2 - '@unrs/resolver-binding-linux-x64-musl': 1.12.2 - '@unrs/resolver-binding-openharmony-arm64': 1.12.2 - '@unrs/resolver-binding-wasm32-wasi': 1.12.2 - '@unrs/resolver-binding-win32-arm64-msvc': 1.12.2 - '@unrs/resolver-binding-win32-ia32-msvc': 1.12.2 - '@unrs/resolver-binding-win32-x64-msvc': 1.12.2 - - update-browserslist-db@1.3.0(browserslist@4.28.7): - dependencies: - browserslist: 4.28.7 - escalade: 3.2.0 - picocolors: 1.1.1 - - uri-js@4.4.1: - dependencies: - punycode: 2.3.1 - - which-boxed-primitive@1.1.1: - dependencies: - is-bigint: 1.1.0 - is-boolean-object: 1.2.2 - is-number-object: 1.1.1 - is-string: 1.1.1 - is-symbol: 1.1.1 - - which-builtin-type@1.2.1: - dependencies: - call-bound: 1.0.4 - function.prototype.name: 1.2.0 - has-tostringtag: 1.0.2 - is-async-function: 2.1.1 - is-date-object: 1.1.0 - is-finalizationregistry: 1.1.1 - is-generator-function: 1.1.2 - is-regex: 1.2.1 - is-weakref: 1.1.1 - isarray: 2.0.5 - which-boxed-primitive: 1.1.1 - which-collection: 1.0.2 - which-typed-array: 1.1.22 - - which-collection@1.0.2: - dependencies: - is-map: 2.0.3 - is-set: 2.0.3 - is-weakmap: 2.0.2 - is-weakset: 2.0.4 - - which-typed-array@1.1.22: - dependencies: - available-typed-arrays: 1.0.7 - call-bind: 1.0.9 - call-bound: 1.0.4 - for-each: 0.3.5 - get-proto: 1.0.1 - gopd: 1.2.0 - has-tostringtag: 1.0.2 - - which@2.0.2: - dependencies: - isexe: 2.0.0 - - word-wrap@1.2.5: {} - - yallist@3.1.1: {} - - yocto-queue@0.1.0: {} - - zod-validation-error@4.0.2(zod@4.4.3): - dependencies: - zod: 4.4.3 - - zod@4.4.3: {} From c98ff981a9bbfc535ca8feaa0a89169f2fd6a9fe Mon Sep 17 00:00:00 2001 From: Aniketh Galla Date: Fri, 14 Aug 2026 18:16:03 +0530 Subject: [PATCH 4/5] fix: ui design fixes --- .../got-questions/GotQuestionsGraphic.tsx | 107 ++++++++++-------- .../got-questions/GotQuestionsHeading.tsx | 23 +--- .../got-questions/GotQuestionsSubHeading.tsx | 24 ++-- devjams/components/sections/GotQuestions.tsx | 60 ++++++---- .../components/sections/PreviousEvents.tsx | 38 ++++--- 5 files changed, 134 insertions(+), 118 deletions(-) diff --git a/devjams/components/got-questions/GotQuestionsGraphic.tsx b/devjams/components/got-questions/GotQuestionsGraphic.tsx index 01262a6..89da532 100644 --- a/devjams/components/got-questions/GotQuestionsGraphic.tsx +++ b/devjams/components/got-questions/GotQuestionsGraphic.tsx @@ -1,69 +1,86 @@ "use client"; -import { motion, MotionValue } from "motion/react"; +import { motion, MotionValue, useTransform } from "motion/react"; interface GotQuestionsGraphicProps { apexX: MotionValue; apexY: MotionValue; } -export function GotQuestionsGraphic({ apexX, apexY }: GotQuestionsGraphicProps) { - // Triangle path definition starting at top edge (y=0) - const trianglePath = useTransform( - [apexX, apexY], - ([x, y]) => `M 0 0 L 1000 0 L ${x} ${y} Z` - ); +// 16 baseline Y coordinates for horizontal background lines +const LINE_BASELINE_Y = [ + 30, 70, 110, 150, 190, 230, 270, 310, 350, 390, 430, 470, 510, 550, 590, 630 +]; - // Left radiating lines (5 cleanly-spaced lines) - const leftLine1 = useTransform([apexX, apexY], ([x, y]) => `M 0 0 L ${x} ${y}`); - const leftLine2 = useTransform([apexX, apexY], ([x, y]) => `M 0 150 L ${x} ${y}`); - const leftLine3 = useTransform([apexX, apexY], ([x, y]) => `M 0 300 L ${x} ${y}`); - const leftLine4 = useTransform([apexX, apexY], ([x, y]) => `M 0 450 L ${x} ${y}`); - const leftLine5 = useTransform([apexX, apexY], ([x, y]) => `M 0 600 L ${x} ${y}`); +function BentLine({ y0, apexX, apexY }: { y0: number; apexX: MotionValue; apexY: MotionValue }) { + const d = useTransform([apexX, apexY], (values: number[]) => { + const x = values[0] ?? 600; + const y = values[1] ?? 0; + // Only bend a line toward the apex if the apex is BELOW the line's baseline. + // Math.max(y, y0) means: + // - if apexY < y0: vertex snaps to y0 → flat horizontal line (State 1) + // - if apexY >= y0: vertex drops to apexY → V-shape converging to apex + const vertexY = Math.max(y, y0); + return `M 0 ${y0} L ${x.toFixed(1)} ${vertexY.toFixed(1)} L 1000 ${y0}`; + }); - // Right radiating lines (6 cleanly-spaced lines) - const rightLine1 = useTransform([apexX, apexY], ([x, y]) => `M 1000 0 L ${x} ${y}`); - const rightLine2 = useTransform([apexX, apexY], ([x, y]) => `M 1000 130 L ${x} ${y}`); - const rightLine3 = useTransform([apexX, apexY], ([x, y]) => `M 1000 260 L ${x} ${y}`); - const rightLine4 = useTransform([apexX, apexY], ([x, y]) => `M 1000 390 L ${x} ${y}`); - const rightLine5 = useTransform([apexX, apexY], ([x, y]) => `M 1000 520 L ${x} ${y}`); - const rightLine6 = useTransform([apexX, apexY], ([x, y]) => `M 1000 650 L ${x} ${y}`); + return ( + + ); +} + +export function GotQuestionsGraphic({ apexX, apexY }: GotQuestionsGraphicProps) { + // Polygon path definition starting at top edge (y=0) to apex (apexX, apexY) + const trianglePath = useTransform([apexX, apexY], (values: number[]) => { + const x = values[0] ?? 600; + const y = values[1] ?? 0; + return `M 0 0 L 1000 0 L ${x.toFixed(1)} ${y.toFixed(1)} Z`; + }); return ( - - {/* Main horizontal gradient across full coordinate width */} - - - - - + {/* User-defined spectrum gradient (top-left to top-right vector so all 7 colors are fully visible inside the triangle): + #FA3E2C (Minimal Red) → #CC518B (Pink) → #4285F4 (Blue) → #57CAFF (Sky Blue) → #34A853 (Green) → #5CDB6D (Light Green) → #F9AB00 (Minimal Yellow) */} + + + + + + + + + - {/* Main Inverted Triangle */} - - - {/* Left Radiating Lines */} - - - - - + {/* Background Bending Lines — coloured by position matching spectrum */} + + {LINE_BASELINE_Y.map((y0) => ( + + ))} + - {/* Right Radiating Lines */} - - - - - - + {/* Triangle fill — matching spectrum gradient */} + ); } -import { useTransform } from "motion/react"; + + + diff --git a/devjams/components/got-questions/GotQuestionsHeading.tsx b/devjams/components/got-questions/GotQuestionsHeading.tsx index 81889b9..3f4fc4b 100644 --- a/devjams/components/got-questions/GotQuestionsHeading.tsx +++ b/devjams/components/got-questions/GotQuestionsHeading.tsx @@ -1,23 +1,12 @@ "use client"; -import { motion, MotionValue } from "motion/react"; - -interface GotQuestionsHeadingProps { - x: MotionValue; - y: MotionValue; -} - -export function GotQuestionsHeading({ x, y }: GotQuestionsHeadingProps) { +export function GotQuestionsHeading() { return ( - +
Got Questions? - +
); } + + + diff --git a/devjams/components/got-questions/GotQuestionsSubHeading.tsx b/devjams/components/got-questions/GotQuestionsSubHeading.tsx index f72ffcc..607fdd1 100644 --- a/devjams/components/got-questions/GotQuestionsSubHeading.tsx +++ b/devjams/components/got-questions/GotQuestionsSubHeading.tsx @@ -1,22 +1,12 @@ "use client"; -import { motion, MotionValue } from "motion/react"; - -interface GotQuestionsSubHeadingProps { - opacity: MotionValue; - y: MotionValue; -} - -export function GotQuestionsSubHeading({ opacity, y }: GotQuestionsSubHeadingProps) { +export function GotQuestionsSubHeading() { return ( - - Let’s break it down. - +
+ Let’s Break It Down +
); } + + + diff --git a/devjams/components/sections/GotQuestions.tsx b/devjams/components/sections/GotQuestions.tsx index 0e26812..1012f5e 100644 --- a/devjams/components/sections/GotQuestions.tsx +++ b/devjams/components/sections/GotQuestions.tsx @@ -1,7 +1,7 @@ "use client"; import { useRef } from "react"; -import { useScroll, useTransform } from "motion/react"; +import { motion, useScroll, useTransform } from "motion/react"; import { GotQuestionsGraphic } from "../got-questions/GotQuestionsGraphic"; import { GotQuestionsHeading } from "../got-questions/GotQuestionsHeading"; import { GotQuestionsSubHeading } from "../got-questions/GotQuestionsSubHeading"; @@ -9,42 +9,52 @@ import { GotQuestionsSubHeading } from "../got-questions/GotQuestionsSubHeading" export function GotQuestions() { const sectionRef = useRef(null); - // Scroll tracking across section viewport + // Scroll tracking across pinned sticky 350vh viewport const { scrollYProgress } = useScroll({ target: sectionRef, - offset: ["start 80%", "start 10%"], + offset: ["start start", "end end"], }); - // Apex interpolation: Initial (850, 540) -> Final (240, 650) - const apexX = useTransform(scrollYProgress, [0, 1], [850, 240]); - const apexY = useTransform(scrollYProgress, [0, 1], [540, 650]); - - // Text Animations - const gotQuestionsX = useTransform(scrollYProgress, [0, 1], ["54%", "62%"]); - const gotQuestionsY = useTransform(scrollYProgress, [0, 1], ["22%", "16%"]); - - // Sub-heading visibility trigger on scroll - const breakItDownOpacity = useTransform(scrollYProgress, [0.55, 0.85], [0, 1]); - const breakItDownY = useTransform(scrollYProgress, [0.55, 0.85], [30, 0]); + // Apex interpolation matching States 1 -> 2 -> 3 -> 4: + // State 1 (progress 0.0): apexX = 600, apexY = 0 (collapsed at top edge, flat horizontal lines) + // State 2 (progress 0.3): apexX = 600, apexY = 160 (shallow V-shape enters top edge, lines bend) + // State 3 (progress 0.6): apexX = 600, apexY = 400 (deep V-shape extends down) + // State 4 (progress 1.0): apexX = 220, apexY = 650 (apex touches the very bottom edge y=650) + const apexX = useTransform(scrollYProgress, [0, 0.6, 1], [600, 600, 220]); + const apexY = useTransform(scrollYProgress, [0, 0.3, 0.6, 1], [0, 160, 400, 650]); + + // Geometric clip-path mask matching the orange triangle polygon expansion in real time + // SVG viewBox is 1000 x 650 -> apexX / 10 = %, apexY / 6.5 = % + const clipPath = useTransform([apexX, apexY], (values: number[]) => { + const x = ((values[0] ?? 600) / 10).toFixed(2); + const y = ((values[1] ?? 0) / 6.5).toFixed(2); + return `polygon(0% 0%, 100% 0%, ${x}% ${y}%)`; + }); return (
-
- {/* Composable SVG Graphic Canvas */} +
+ {/* Dynamic SVG Graphic Canvas */} - {/* Text Overlay Container */} -
- {/* Composable Main Heading */} - - - {/* Composable Sub Heading */} - -
+ {/* Text Overlay Container clipped by the expanding orange triangle shape */} + + {/* Main Heading */} + + + {/* Sub Heading */} + +
); } + + + diff --git a/devjams/components/sections/PreviousEvents.tsx b/devjams/components/sections/PreviousEvents.tsx index 2817784..1db16f1 100644 --- a/devjams/components/sections/PreviousEvents.tsx +++ b/devjams/components/sections/PreviousEvents.tsx @@ -1,14 +1,26 @@ "use client"; -import { motion } from "motion/react"; +import { useRef } from "react"; +import { motion, useScroll, useTransform } from "motion/react"; import { EventCard } from "../ui/EventCard"; import { EVENTS } from "../previous-events/PreviousEventsData"; import { PreviousEventsHeader } from "../previous-events/PreviousEventsHeader"; import { PreviousEventsDecorations } from "../previous-events/PreviousEventsDecorations"; export function PreviousEvents() { + const sectionRef = useRef(null); + + // Track scroll progress across the whole section + const { scrollYProgress } = useScroll({ + target: sectionRef, + offset: ["start center", "end center"], + }); + + // Map scroll progress to a percentage along the timeline (0% top → 100% bottom) + const dotTop = useTransform(scrollYProgress, [0, 1], ["0%", "100%"]); + return ( -
+
{/* Composable Header */} @@ -17,14 +29,20 @@ export function PreviousEvents() { {/* Central Timeline Line */}
+ {/* Single Scroll-Driven White Dot */} + +
{EVENTS.map((event, index) => { const isEven = index % 2 !== 0; const alignment = isEven ? "left" : "right"; return ( -
- {/* Timeline Dot */} - - {/* Composable Event Card */}
- ); } + From b7a85e219528b7f30adfc07f8eb228150b9e1dcf Mon Sep 17 00:00:00 2001 From: Aniketh Galla Date: Fri, 14 Aug 2026 18:19:03 +0530 Subject: [PATCH 5/5] fix: vercelfixes --- package.json | 10 ++++++++-- vercel.json | 5 +++++ 2 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 vercel.json diff --git a/package.json b/package.json index af2047f..5113001 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,11 @@ { - "dependencies": { - "motion": "^13.1.0" + "name": "devjams26-frontend", + "version": "0.1.0", + "private": true, + "scripts": { + "dev": "npm run dev --prefix devjams", + "build": "npm run build --prefix devjams", + "start": "npm run start --prefix devjams", + "lint": "npm run lint --prefix devjams" } } diff --git a/vercel.json b/vercel.json new file mode 100644 index 0000000..beaa9eb --- /dev/null +++ b/vercel.json @@ -0,0 +1,5 @@ +{ + "framework": "nextjs", + "buildCommand": "npm run build --prefix devjams", + "outputDirectory": "devjams/.next" +}